From: support Date: Thu, 23 Jun 2022 07:21:04 +0000 (+0000) Subject: Built motion from commit 8e18119e.|2.6.11 X-Git-Url: http://repos.xcallymotion.com/base/%22https:/user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png//%22%27?a=commitdiff_plain;h=a6246328115db511d7a2d8ba3e940f5ebbe2aaf0;p=motion2.git Built motion from commit 8e18119e.|2.6.11 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 9d8f856..fc919dc 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-06-21T08:30:10.520Z", + "time": "2022-06-23T07:12:49.513Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index f60df4d..737ee97 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-06-21T08:30:10.520Z", + "time": "2022-06-23T07:12:49.513Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index d1aad3f..8578e3f 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 _0x7588=['urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','integration','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'];(function(_0x43946b,_0x22fa8d){var _0x683065=function(_0x131c44){while(--_0x131c44){_0x43946b['push'](_0x43946b['shift']());}};_0x683065(++_0x22fa8d);}(_0x7588,0x97));var _0x8758=function(_0x49319d,_0x463ab9){_0x49319d=_0x49319d-0x0;var _0x510c9d=_0x7588[_0x49319d];return _0x510c9d;};'use strict';var Sequelize=require(_0x8758('0x0'));module[_0x8758('0x1')]={'name':{'type':Sequelize[_0x8758('0x2')],'get':function(_0x53a575){return this[_0x8758('0x3')](_0x8758('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x8758('0x5'),_0x8758('0x6'),'motionbar',_0x8758('0x7'),_0x8758('0x8'),_0x8758('0x9'),_0x8758('0xa'),_0x8758('0xb')]],'msg':_0x8758('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x8758('0xd')](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['STRING'](0x1000),'comment':_0x8758('0xe')},'data3':{'type':Sequelize[_0x8758('0xd')](0x1000),'comment':_0x8758('0xf')},'data4':{'type':Sequelize[_0x8758('0xd')](0x1000),'comments':_0x8758('0x10')},'data5':{'type':Sequelize[_0x8758('0xd')](0x1000),'comments':_0x8758('0x11')},'data6':{'type':Sequelize[_0x8758('0xd')],'comments':_0x8758('0x12')},'data7':{'type':Sequelize[_0x8758('0x13')],'comments':_0x8758('0x14')}}; \ No newline at end of file +var _0xef6a=['bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','exports','VIRTUAL','action','integration','jscripty'];(function(_0x4295d3,_0x5593b4){var _0x216d5c=function(_0x56f9a9){while(--_0x56f9a9){_0x4295d3['push'](_0x4295d3['shift']());}};_0x216d5c(++_0x5593b4);}(_0xef6a,0x64));var _0xaef6=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xef6a[_0x1969a7];return _0x3d665f;};'use strict';var Sequelize=require('sequelize');module[_0xaef6('0x0')]={'name':{'type':Sequelize[_0xaef6('0x1')],'get':function(_0x21e05a){return this['getDataValue'](_0xaef6('0x2'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xaef6('0x3'),'motionbar',_0xaef6('0x4'),'urlForward','browser',_0xaef6('0x5'),_0xaef6('0x6')]],'msg':_0xaef6('0x7')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xaef6('0x8')](0x1000),'comment':_0xaef6('0x9')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xaef6('0xa')},'data3':{'type':Sequelize[_0xaef6('0x8')](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[_0xaef6('0x8')](0x1000),'comments':_0xaef6('0xb')},'data5':{'type':Sequelize[_0xaef6('0x8')](0x1000),'comments':_0xaef6('0xc')},'data6':{'type':Sequelize[_0xaef6('0x8')],'comments':_0xaef6('0xd')},'data7':{'type':Sequelize['TEXT'],'comments':_0xaef6('0xe')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 66e75ae..542e9b6 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 _0x37d9=['path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','body','find','params','catch','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x4889b1,_0x119316){var _0x226cd4=function(_0x163577){while(--_0x163577){_0x4889b1['push'](_0x4889b1['shift']());}};_0x226cd4(++_0x119316);}(_0x37d9,0xdf));var _0x937d=function(_0x567058,_0x58309e){_0x567058=_0x567058-0x0;var _0x3f8fda=_0x37d9[_0x567058];return _0x3f8fda;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x937d('0x0'));var zipdir=require(_0x937d('0x1'));var jsonpatch=require(_0x937d('0x2'));var rp=require('request-promise');var moment=require(_0x937d('0x3'));var BPromise=require(_0x937d('0x4'));var Mustache=require(_0x937d('0x5'));var util=require(_0x937d('0x6'));var path=require(_0x937d('0x7'));var sox=require(_0x937d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x937d('0x9'));var _=require('lodash');var squel=require(_0x937d('0xa'));var crypto=require(_0x937d('0xb'));var jsforce=require(_0x937d('0xc'));var deskjs=require(_0x937d('0xd'));var toCsv=require(_0x937d('0xe'));var querystring=require(_0x937d('0xf'));var Papa=require('papaparse');var Redis=require(_0x937d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x937d('0x11'));var as=require(_0x937d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x937d('0x13'))(_0x937d('0x14'));var utils=require(_0x937d('0x15'));var config=require(_0x937d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x937d('0x17'))['db'];function respondWithStatusCode(_0x2fc73e,_0x1626a8){_0x1626a8=_0x1626a8||0xcc;return function(_0x1323b7){if(_0x1323b7){return _0x2fc73e[_0x937d('0x18')](_0x1626a8);}return _0x2fc73e[_0x937d('0x19')](_0x1626a8)[_0x937d('0x1a')]();};}function respondWithResult(_0x20f0e2,_0x3e09b7){_0x3e09b7=_0x3e09b7||0xc8;return function(_0xb7061){if(_0xb7061){return _0x20f0e2['status'](_0x3e09b7)[_0x937d('0x1b')](_0xb7061);}};}function respondWithFilteredResult(_0x564196,_0x5a6956){return function(_0x999048){if(_0x999048){var _0x5b91b1=typeof _0x5a6956['offset']==='undefined'&&typeof _0x5a6956[_0x937d('0x1c')]==='undefined';var _0x3102dc=_0x999048[_0x937d('0x1d')];var _0x35ce50=_0x5b91b1?0x0:_0x5a6956['offset'];var _0x45c5d7=_0x5b91b1?_0x999048['count']:_0x5a6956[_0x937d('0x1e')]+_0x5a6956[_0x937d('0x1c')];var _0x239140;if(_0x45c5d7>=_0x3102dc){_0x45c5d7=_0x3102dc;_0x239140=0xc8;}else{_0x239140=0xce;}_0x564196['status'](_0x239140);return _0x564196[_0x937d('0x1f')](_0x937d('0x20'),_0x35ce50+'-'+_0x45c5d7+'/'+_0x3102dc)[_0x937d('0x1b')](_0x999048);}return null;};}function patchUpdates(_0x23398e){return function(_0x24e10f){try{jsonpatch[_0x937d('0x21')](_0x24e10f,_0x23398e,!![]);}catch(_0x13baad){return BPromise[_0x937d('0x22')](_0x13baad);}return _0x24e10f[_0x937d('0x23')]();};}function saveUpdates(_0x2e6df1,_0x2c8608){return function(_0x2ee9a5){if(_0x2ee9a5){return _0x2ee9a5[_0x937d('0x24')](_0x2e6df1)[_0x937d('0x25')](function(_0x1bfd2f){return _0x1bfd2f;});}return null;};}function removeEntity(_0x3f195d,_0x56e606){return function(_0x1f5fb7){if(_0x1f5fb7){return _0x1f5fb7[_0x937d('0x26')]()[_0x937d('0x25')](function(){_0x3f195d['status'](0xcc)[_0x937d('0x1a')]();});}};}function handleEntityNotFound(_0x5dc039,_0x591fab){return function(_0x33ed8a){if(!_0x33ed8a){_0x5dc039[_0x937d('0x18')](0x194);}return _0x33ed8a;};}function handleError(_0x580503,_0x369061){_0x369061=_0x369061||0x1f4;return function(_0xeda6ec){logger[_0x937d('0x27')](_0xeda6ec[_0x937d('0x28')]);if(_0xeda6ec[_0x937d('0x29')]){delete _0xeda6ec[_0x937d('0x29')];}_0x580503[_0x937d('0x19')](_0x369061)['send'](_0xeda6ec);};}exports['update']=function(_0x431e45,_0x11b530){if(_0x431e45['body']['id']){delete _0x431e45[_0x937d('0x2a')]['id'];}return db['Action'][_0x937d('0x2b')]({'where':{'id':_0x431e45[_0x937d('0x2c')]['id']}})[_0x937d('0x25')](handleEntityNotFound(_0x11b530,null))[_0x937d('0x25')](saveUpdates(_0x431e45[_0x937d('0x2a')],null))[_0x937d('0x25')](respondWithResult(_0x11b530,null))[_0x937d('0x2d')](handleError(_0x11b530,null));};exports[_0x937d('0x26')]=function(_0x53524b,_0x546ae4){return db['Action'][_0x937d('0x2b')]({'where':{'id':_0x53524b[_0x937d('0x2c')]['id']}})[_0x937d('0x25')](handleEntityNotFound(_0x546ae4,null))['then'](removeEntity(_0x546ae4,null))[_0x937d('0x2d')](handleError(_0x546ae4,null));}; \ No newline at end of file +var _0xfc3f=['status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','body','Action','find','params','catch','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x2a9bf4,_0x5e0ffb){var _0x5f5ff1=function(_0x34dfce){while(--_0x34dfce){_0x2a9bf4['push'](_0x2a9bf4['shift']());}};_0x5f5ff1(++_0x5e0ffb);}(_0xfc3f,0xaa));var _0xffc3=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xfc3f[_0x31e29a];return _0x32d892;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xffc3('0x0'));var zipdir=require(_0xffc3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xffc3('0x2'));var BPromise=require(_0xffc3('0x3'));var Mustache=require('mustache');var util=require(_0xffc3('0x4'));var path=require(_0xffc3('0x5'));var sox=require(_0xffc3('0x6'));var csv=require(_0xffc3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xffc3('0x8'));var _=require(_0xffc3('0x9'));var squel=require('squel');var crypto=require(_0xffc3('0xa'));var jsforce=require(_0xffc3('0xb'));var deskjs=require(_0xffc3('0xc'));var toCsv=require(_0xffc3('0x7'));var querystring=require(_0xffc3('0xd'));var Papa=require('papaparse');var Redis=require(_0xffc3('0xe'));var authService=require(_0xffc3('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xffc3('0x10'));var hardwareService=require(_0xffc3('0x11'));var logger=require(_0xffc3('0x12'))(_0xffc3('0x13'));var utils=require(_0xffc3('0x14'));var config=require(_0xffc3('0x15'));var licenseUtil=require(_0xffc3('0x16'));var db=require(_0xffc3('0x17'))['db'];function respondWithStatusCode(_0x211948,_0x10cf5b){_0x10cf5b=_0x10cf5b||0xcc;return function(_0x5175bf){if(_0x5175bf){return _0x211948[_0xffc3('0x18')](_0x10cf5b);}return _0x211948['status'](_0x10cf5b)[_0xffc3('0x19')]();};}function respondWithResult(_0x1b37b8,_0x99aceb){_0x99aceb=_0x99aceb||0xc8;return function(_0x5d7759){if(_0x5d7759){return _0x1b37b8[_0xffc3('0x1a')](_0x99aceb)[_0xffc3('0x1b')](_0x5d7759);}};}function respondWithFilteredResult(_0x2aaa30,_0x5817fc){return function(_0x266699){if(_0x266699){var _0x8542e0=typeof _0x5817fc[_0xffc3('0x1c')]==='undefined'&&typeof _0x5817fc[_0xffc3('0x1d')]===_0xffc3('0x1e');var _0x5b8f6d=_0x266699[_0xffc3('0x1f')];var _0x4c0e79=_0x8542e0?0x0:_0x5817fc[_0xffc3('0x1c')];var _0xa971b9=_0x8542e0?_0x266699['count']:_0x5817fc['offset']+_0x5817fc[_0xffc3('0x1d')];var _0x297151;if(_0xa971b9>=_0x5b8f6d){_0xa971b9=_0x5b8f6d;_0x297151=0xc8;}else{_0x297151=0xce;}_0x2aaa30[_0xffc3('0x1a')](_0x297151);return _0x2aaa30[_0xffc3('0x20')](_0xffc3('0x21'),_0x4c0e79+'-'+_0xa971b9+'/'+_0x5b8f6d)[_0xffc3('0x1b')](_0x266699);}return null;};}function patchUpdates(_0x1f1118){return function(_0x50bdd1){try{jsonpatch[_0xffc3('0x22')](_0x50bdd1,_0x1f1118,!![]);}catch(_0x1bd164){return BPromise[_0xffc3('0x23')](_0x1bd164);}return _0x50bdd1[_0xffc3('0x24')]();};}function saveUpdates(_0x2f6700,_0x3faf64){return function(_0x1ac310){if(_0x1ac310){return _0x1ac310[_0xffc3('0x25')](_0x2f6700)[_0xffc3('0x26')](function(_0x32085a){return _0x32085a;});}return null;};}function removeEntity(_0x2bcfec,_0x40dc18){return function(_0x3d63bf){if(_0x3d63bf){return _0x3d63bf[_0xffc3('0x27')]()[_0xffc3('0x26')](function(){_0x2bcfec[_0xffc3('0x1a')](0xcc)[_0xffc3('0x19')]();});}};}function handleEntityNotFound(_0x1b4aa7,_0xc9d7d5){return function(_0x57cdbb){if(!_0x57cdbb){_0x1b4aa7['sendStatus'](0x194);}return _0x57cdbb;};}function handleError(_0x475fc0,_0x1c3e93){_0x1c3e93=_0x1c3e93||0x1f4;return function(_0x4dd22e){logger[_0xffc3('0x28')](_0x4dd22e[_0xffc3('0x29')]);if(_0x4dd22e[_0xffc3('0x2a')]){delete _0x4dd22e[_0xffc3('0x2a')];}_0x475fc0['status'](_0x1c3e93)[_0xffc3('0x2b')](_0x4dd22e);};}exports[_0xffc3('0x25')]=function(_0x526530,_0xc8216d){if(_0x526530[_0xffc3('0x2c')]['id']){delete _0x526530[_0xffc3('0x2c')]['id'];}return db[_0xffc3('0x2d')][_0xffc3('0x2e')]({'where':{'id':_0x526530[_0xffc3('0x2f')]['id']}})[_0xffc3('0x26')](handleEntityNotFound(_0xc8216d,null))['then'](saveUpdates(_0x526530[_0xffc3('0x2c')],null))['then'](respondWithResult(_0xc8216d,null))[_0xffc3('0x30')](handleError(_0xc8216d,null));};exports[_0xffc3('0x27')]=function(_0x64daad,_0xdc7631){return db[_0xffc3('0x2d')][_0xffc3('0x2e')]({'where':{'id':_0x64daad[_0xffc3('0x2f')]['id']}})[_0xffc3('0x26')](handleEntityNotFound(_0xdc7631,null))['then'](removeEntity(_0xdc7631,null))['catch'](handleError(_0xdc7631,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index e02d8fc..26f065b 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 _0x2fe5=['path','rimraf','./action.attributes','exports','define','Action','tools_actions','lodash','util','moment','bluebird','request-promise'];(function(_0xe51964,_0x433b90){var _0x2c2366=function(_0x1bc95c){while(--_0x1bc95c){_0xe51964['push'](_0xe51964['shift']());}};_0x2c2366(++_0x433b90);}(_0x2fe5,0x14b));var _0x52fe=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x2fe5[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x52fe('0x0'));var util=require(_0x52fe('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x52fe('0x2'));var BPromise=require(_0x52fe('0x3'));var rp=require(_0x52fe('0x4'));var fs=require('fs');var path=require(_0x52fe('0x5'));var rimraf=require(_0x52fe('0x6'));var config=require('../../config/environment');var attributes=require(_0x52fe('0x7'));module[_0x52fe('0x8')]=function(_0x584af7,_0x2efcaa){return _0x584af7[_0x52fe('0x9')](_0x52fe('0xa'),attributes,{'tableName':_0x52fe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x602a=['rimraf','./action.attributes','exports','Action','tools_actions','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x39da38,_0x102e56){var _0x56e396=function(_0x5bd3be){while(--_0x5bd3be){_0x39da38['push'](_0x39da38['shift']());}};_0x56e396(++_0x102e56);}(_0x602a,0x1de));var _0xa602=function(_0x31f31e,_0x3dd397){_0x31f31e=_0x31f31e-0x0;var _0x464402=_0x602a[_0x31f31e];return _0x464402;};'use strict';var _=require(_0xa602('0x0'));var util=require('util');var logger=require(_0xa602('0x1'))(_0xa602('0x2'));var moment=require(_0xa602('0x3'));var BPromise=require(_0xa602('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa602('0x5'));var rimraf=require(_0xa602('0x6'));var config=require('../../config/environment');var attributes=require(_0xa602('0x7'));module[_0xa602('0x8')]=function(_0x5c79a1,_0x2a9d2f){return _0x5c79a1['define'](_0xa602('0x9'),attributes,{'tableName':_0xa602('0xa'),'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 7bb8e55..4865b4f 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x226f31,_0x3d1cfa){var _0x14a410=function(_0x40c762){while(--_0x40c762){_0x226f31['push'](_0x226f31['shift']());}};_0x14a410(++_0x3d1cfa);}(_0xe14b,0x93));var _0xbe14=function(_0xe9e47b,_0x570674){_0xe9e47b=_0xe9e47b-0x0;var _0x171e2d=_0xe14b[_0xe9e47b];return _0x171e2d;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x814b,0x1a2));var _0xb814=function(_0x4b9dc9,_0x14b3a2){_0x4b9dc9=_0x4b9dc9-0x0;var _0x57b302=_0x814b[_0x4b9dc9];return _0x57b302;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 3500ce0..59f88c7 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 _0x33c9=['../../components/auth/service','../../components/interaction/service','put','/:id','update','delete','isAuthenticated','destroy','exports','express','Router','fs-extra'];(function(_0x4d4f4f,_0x32b2e2){var _0x5d48bc=function(_0x5a15de){while(--_0x5a15de){_0x4d4f4f['push'](_0x4d4f4f['shift']());}};_0x5d48bc(++_0x32b2e2);}(_0x33c9,0x14d));var _0x933c=function(_0x40373a,_0x51c2c9){_0x40373a=_0x40373a-0x0;var _0x20240e=_0x33c9[_0x40373a];return _0x20240e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x933c('0x0'));var router=express[_0x933c('0x1')]();var fs_extra=require(_0x933c('0x2'));var auth=require(_0x933c('0x3'));var interaction=require(_0x933c('0x4'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0x933c('0x5')](_0x933c('0x6'),auth['isAuthenticated'](),controller[_0x933c('0x7')]);router[_0x933c('0x8')]('/:id',auth[_0x933c('0x9')](),controller[_0x933c('0xa')]);module[_0x933c('0xb')]=router; \ No newline at end of file +var _0x32a2=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','put','/:id','update','delete','isAuthenticated','exports'];(function(_0x15a346,_0x46d825){var _0x275a0f=function(_0x3df115){while(--_0x3df115){_0x15a346['push'](_0x15a346['shift']());}};_0x275a0f(++_0x46d825);}(_0x32a2,0x1c7));var _0x232a=function(_0x42addc,_0x1cd559){_0x42addc=_0x42addc-0x0;var _0x3ef1d1=_0x32a2[_0x42addc];return _0x3ef1d1;};'use strict';var multer=require(_0x232a('0x0'));var util=require(_0x232a('0x1'));var path=require(_0x232a('0x2'));var timeout=require(_0x232a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x232a('0x4'));var auth=require(_0x232a('0x5'));var interaction=require(_0x232a('0x6'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0x232a('0x7')](_0x232a('0x8'),auth['isAuthenticated'](),controller[_0x232a('0x9')]);router[_0x232a('0xa')](_0x232a('0x8'),auth[_0x232a('0xb')](),controller['destroy']);module[_0x232a('0xc')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index b938d36..66be60a 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 _0x3f8a=['TEXT','sequelize','exports','STRING'];(function(_0x5e56f2,_0x283e7b){var _0x4f71e5=function(_0x7a11e3){while(--_0x7a11e3){_0x5e56f2['push'](_0x5e56f2['shift']());}};_0x4f71e5(++_0x283e7b);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x4fa932,_0x2fa9ee){_0x4fa932=_0x4fa932-0x0;var _0x5386f3=_0x3f8a[_0x4fa932];return _0x5386f3;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa3f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa3f8('0x2')]},'conditions':{'type':Sequelize[_0xa3f8('0x3')]},'joins':{'type':Sequelize[_0xa3f8('0x3')]}}; \ No newline at end of file +var _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x9bc97d,_0x47eb1c){var _0x69d9=function(_0x52174c){while(--_0x52174c){_0x9bc97d['push'](_0x9bc97d['shift']());}};_0x69d9(++_0x47eb1c);}(_0xeff8,0x186));var _0x8eff=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0xeff8[_0x2faddb];return _0x273c05;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 1252413..17539ca 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 _0x5e9a=['hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','include','findAll','catch','show','params','keys','rawAttributes','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','cross_join','SUM(%s)','MIN(%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','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','parse','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20EMPTY','keyBy','from','alias','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','COUNT(%s)','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','get','CustomReports','UserProfileResource','name','index','map','fieldName','type','key','model','query','filters','attributes','fields','length'];(function(_0x430e18,_0x6f36a0){var _0x54eff2=function(_0x1f2e48){while(--_0x1f2e48){_0x430e18['push'](_0x430e18['shift']());}};_0x54eff2(++_0x6f36a0);}(_0x5e9a,0x72));var _0xa5e9=function(_0x22e175,_0x2dadbc){_0x22e175=_0x22e175-0x0;var _0x5b84dd=_0x5e9a[_0x22e175];return _0x5b84dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa5e9('0x0'));var zipdir=require(_0xa5e9('0x1'));var jsonpatch=require(_0xa5e9('0x2'));var rp=require(_0xa5e9('0x3'));var moment=require(_0xa5e9('0x4'));var BPromise=require(_0xa5e9('0x5'));var Mustache=require(_0xa5e9('0x6'));var util=require(_0xa5e9('0x7'));var path=require(_0xa5e9('0x8'));var sox=require(_0xa5e9('0x9'));var csv=require(_0xa5e9('0xa'));var ejs=require(_0xa5e9('0xb'));var fs=require('fs');var fs_extra=require(_0xa5e9('0xc'));var _=require(_0xa5e9('0xd'));var squel=require(_0xa5e9('0xe'));var crypto=require(_0xa5e9('0xf'));var jsforce=require(_0xa5e9('0x10'));var deskjs=require(_0xa5e9('0x11'));var toCsv=require(_0xa5e9('0xa'));var querystring=require(_0xa5e9('0x12'));var Papa=require(_0xa5e9('0x13'));var Redis=require(_0xa5e9('0x14'));var authService=require(_0xa5e9('0x15'));var qs=require(_0xa5e9('0x16'));var as=require(_0xa5e9('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa5e9('0x18'))(_0xa5e9('0x19'));var utils=require(_0xa5e9('0x1a'));var config=require(_0xa5e9('0x1b'));var licenseUtil=require(_0xa5e9('0x1c'));var db=require(_0xa5e9('0x1d'))['db'];var dbH=require(_0xa5e9('0x1d'))['dbH'];function respondWithStatusCode(_0x4fb181,_0x4e3e3d){_0x4e3e3d=_0x4e3e3d||0xcc;return function(_0x484a16){if(_0x484a16){return _0x4fb181['sendStatus'](_0x4e3e3d);}return _0x4fb181[_0xa5e9('0x1e')](_0x4e3e3d)[_0xa5e9('0x1f')]();};}function respondWithResult(_0x4dff28,_0x491080){_0x491080=_0x491080||0xc8;return function(_0x5713b9){if(_0x5713b9){return _0x4dff28['status'](_0x491080)[_0xa5e9('0x20')](_0x5713b9);}};}function respondWithFilteredResult(_0x142d43,_0x369cac){return function(_0x218458){if(_0x218458){var _0x3c1553=typeof _0x369cac[_0xa5e9('0x21')]===_0xa5e9('0x22')&&typeof _0x369cac['limit']===_0xa5e9('0x22');var _0x2c004e=_0x218458[_0xa5e9('0x23')];var _0x4360a2=_0x3c1553?0x0:_0x369cac[_0xa5e9('0x21')];var _0xaf4d8e=_0x3c1553?_0x218458[_0xa5e9('0x23')]:_0x369cac['offset']+_0x369cac[_0xa5e9('0x24')];var _0x2c2f7e;if(_0xaf4d8e>=_0x2c004e){_0xaf4d8e=_0x2c004e;_0x2c2f7e=0xc8;}else{_0x2c2f7e=0xce;}_0x142d43[_0xa5e9('0x1e')](_0x2c2f7e);return _0x142d43[_0xa5e9('0x25')](_0xa5e9('0x26'),_0x4360a2+'-'+_0xaf4d8e+'/'+_0x2c004e)['json'](_0x218458);}return null;};}function patchUpdates(_0x595ca5){return function(_0x1fd63a){try{jsonpatch[_0xa5e9('0x27')](_0x1fd63a,_0x595ca5,!![]);}catch(_0x110d31){return BPromise[_0xa5e9('0x28')](_0x110d31);}return _0x1fd63a['save']();};}function saveUpdates(_0x2a9d3c,_0x152caf){return function(_0x518776){if(_0x518776){return _0x518776['update'](_0x2a9d3c)[_0xa5e9('0x29')](function(_0x4aa3bd){return _0x4aa3bd;});}return null;};}function removeEntity(_0x2313dd,_0x5d4177){return function(_0x3761c0){if(_0x3761c0){return _0x3761c0[_0xa5e9('0x2a')]()[_0xa5e9('0x29')](function(){var _0x2de03a=_0x3761c0[_0xa5e9('0x2b')]({'plain':!![]});var _0x295ef5=_0xa5e9('0x2c');return db[_0xa5e9('0x2d')][_0xa5e9('0x2a')]({'where':{'type':_0x295ef5,'resourceId':_0x2de03a['id']}})['then'](function(){return _0x3761c0;});})[_0xa5e9('0x29')](function(){_0x2313dd['status'](0xcc)[_0xa5e9('0x1f')]();});}};}function handleEntityNotFound(_0xe2593,_0x3843a5){return function(_0x93c4a4){if(!_0x93c4a4){_0xe2593['sendStatus'](0x194);}return _0x93c4a4;};}function handleError(_0x515198,_0x50224f){_0x50224f=_0x50224f||0x1f4;return function(_0x12df76){logger['error'](_0x12df76['stack']);if(_0x12df76[_0xa5e9('0x2e')]){delete _0x12df76[_0xa5e9('0x2e')];}_0x515198['status'](_0x50224f)['send'](_0x12df76);};}exports[_0xa5e9('0x2f')]=function(_0x1da525,_0x130ca8){var _0x554c50={},_0x2700f4={},_0x2a3fa4={'count':0x0,'rows':[]};var _0x217d41=_[_0xa5e9('0x30')](db['AnalyticCustomReport']['rawAttributes'],function(_0x317a47){return{'name':_0x317a47[_0xa5e9('0x31')],'type':_0x317a47[_0xa5e9('0x32')][_0xa5e9('0x33')]};});_0x2700f4[_0xa5e9('0x34')]=_['map'](_0x217d41,_0xa5e9('0x2e'));_0x2700f4['query']=_['keys'](_0x1da525[_0xa5e9('0x35')]);_0x2700f4[_0xa5e9('0x36')]=_['intersection'](_0x2700f4[_0xa5e9('0x34')],_0x2700f4['query']);_0x554c50[_0xa5e9('0x37')]=_['intersection'](_0x2700f4[_0xa5e9('0x34')],qs[_0xa5e9('0x38')](_0x1da525[_0xa5e9('0x35')][_0xa5e9('0x38')]));_0x554c50[_0xa5e9('0x37')]=_0x554c50[_0xa5e9('0x37')][_0xa5e9('0x39')]?_0x554c50[_0xa5e9('0x37')]:_0x2700f4['model'];if(!_0x1da525[_0xa5e9('0x35')][_0xa5e9('0x3a')]('nolimit')){_0x554c50[_0xa5e9('0x24')]=qs[_0xa5e9('0x24')](_0x1da525[_0xa5e9('0x35')][_0xa5e9('0x24')]);_0x554c50['offset']=qs['offset'](_0x1da525[_0xa5e9('0x35')][_0xa5e9('0x21')]);}_0x554c50[_0xa5e9('0x3b')]=qs['sort'](_0x1da525['query'][_0xa5e9('0x3c')]);_0x554c50[_0xa5e9('0x3d')]=qs[_0xa5e9('0x36')](_[_0xa5e9('0x3e')](_0x1da525[_0xa5e9('0x35')],_0x2700f4[_0xa5e9('0x36')]),_0x217d41);if(_0x1da525[_0xa5e9('0x35')][_0xa5e9('0x3f')]){_0x554c50[_0xa5e9('0x3d')]=_[_0xa5e9('0x40')](_0x554c50[_0xa5e9('0x3d')],{'$or':_[_0xa5e9('0x30')](_0x217d41,function(_0x36dcb8){if(_0x36dcb8[_0xa5e9('0x32')]!==_0xa5e9('0x41')){var _0x39af09={};_0x39af09[_0x36dcb8[_0xa5e9('0x2e')]]={'$like':'%'+_0x1da525['query'][_0xa5e9('0x3f')]+'%'};return _0x39af09;}})});}_0x554c50=_[_0xa5e9('0x40')]({},_0x554c50,_0x1da525[_0xa5e9('0x42')]);var _0x19f783={'where':_0x554c50[_0xa5e9('0x3d')]};return db[_0xa5e9('0x43')][_0xa5e9('0x23')](_0x19f783)[_0xa5e9('0x29')](function(_0x46189b){_0x2a3fa4[_0xa5e9('0x23')]=_0x46189b;if(_0x1da525[_0xa5e9('0x35')][_0xa5e9('0x44')]){_0x554c50[_0xa5e9('0x45')]=[{'all':!![]}];}return db[_0xa5e9('0x43')][_0xa5e9('0x46')](_0x554c50);})[_0xa5e9('0x29')](function(_0x4baecb){_0x2a3fa4['rows']=_0x4baecb;return _0x2a3fa4;})['then'](respondWithFilteredResult(_0x130ca8,_0x554c50))[_0xa5e9('0x47')](handleError(_0x130ca8,null));};exports[_0xa5e9('0x48')]=function(_0x1e9d9a,_0x245586){var _0x49d4b6={'raw':![],'where':{'id':_0x1e9d9a[_0xa5e9('0x49')]['id']}},_0x364718={};_0x364718[_0xa5e9('0x34')]=_[_0xa5e9('0x4a')](db['AnalyticCustomReport'][_0xa5e9('0x4b')]);_0x364718[_0xa5e9('0x35')]=_[_0xa5e9('0x4a')](_0x1e9d9a[_0xa5e9('0x35')]);_0x364718[_0xa5e9('0x36')]=_[_0xa5e9('0x4c')](_0x364718[_0xa5e9('0x34')],_0x364718[_0xa5e9('0x35')]);_0x49d4b6[_0xa5e9('0x37')]=_[_0xa5e9('0x4c')](_0x364718[_0xa5e9('0x34')],qs[_0xa5e9('0x38')](_0x1e9d9a[_0xa5e9('0x35')][_0xa5e9('0x38')]));_0x49d4b6[_0xa5e9('0x37')]=_0x49d4b6[_0xa5e9('0x37')][_0xa5e9('0x39')]?_0x49d4b6[_0xa5e9('0x37')]:_0x364718[_0xa5e9('0x34')];if(_0x1e9d9a['query']['includeAll']){_0x49d4b6['include']=[{'all':!![]}];}_0x49d4b6=_[_0xa5e9('0x40')]({},_0x49d4b6,_0x1e9d9a[_0xa5e9('0x42')]);return db[_0xa5e9('0x43')][_0xa5e9('0x4d')](_0x49d4b6)[_0xa5e9('0x29')](handleEntityNotFound(_0x245586,null))[_0xa5e9('0x29')](respondWithResult(_0x245586,null))[_0xa5e9('0x47')](handleError(_0x245586,null));};exports['create']=function(_0xb4ef4e,_0x256ad1){return db['AnalyticCustomReport'][_0xa5e9('0x4e')](_0xb4ef4e[_0xa5e9('0x4f')],{})[_0xa5e9('0x29')](function(_0x4e640c){var _0x323b5f=_0xb4ef4e[_0xa5e9('0x50')]['get']({'plain':!![]});if(!_0x323b5f)throw new Error(_0xa5e9('0x51'));if(_0x323b5f[_0xa5e9('0x52')]==='user'){var _0x1e5a75=_0x4e640c[_0xa5e9('0x2b')]({'plain':!![]});var _0x3cc26f=_0xa5e9('0x53');return db[_0xa5e9('0x54')][_0xa5e9('0x4d')]({'where':{'name':_0x3cc26f,'userProfileId':_0x323b5f['userProfileId']},'raw':!![]})['then'](function(_0x2965a3){if(_0x2965a3&&_0x2965a3['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1e5a75[_0xa5e9('0x2e')],'resourceId':_0x1e5a75['id'],'type':_0xa5e9('0x2c'),'sectionId':_0x2965a3['id']},{})['then'](function(){return _0x4e640c;});}else{return _0x4e640c;}})['catch'](function(_0x4ba4de){logger[_0xa5e9('0x55')](_0xa5e9('0x56'),_0x4ba4de);throw _0x4ba4de;});}return _0x4e640c;})[_0xa5e9('0x29')](respondWithResult(_0x256ad1,0xc9))['catch'](handleError(_0x256ad1,null));};exports['update']=function(_0x77c59c,_0x17630f){if(_0x77c59c[_0xa5e9('0x4f')]['id']){delete _0x77c59c['body']['id'];}return db[_0xa5e9('0x43')][_0xa5e9('0x4d')]({'where':{'id':_0x77c59c[_0xa5e9('0x49')]['id']}})[_0xa5e9('0x29')](handleEntityNotFound(_0x17630f,null))[_0xa5e9('0x29')](saveUpdates(_0x77c59c[_0xa5e9('0x4f')],null))[_0xa5e9('0x29')](respondWithResult(_0x17630f,null))[_0xa5e9('0x47')](handleError(_0x17630f,null));};exports[_0xa5e9('0x2a')]=function(_0x4b4334,_0xf1a301){return db[_0xa5e9('0x43')][_0xa5e9('0x4d')]({'where':{'id':_0x4b4334[_0xa5e9('0x49')]['id']}})[_0xa5e9('0x29')](handleEntityNotFound(_0xf1a301,null))['then'](removeEntity(_0xf1a301,null))[_0xa5e9('0x47')](handleError(_0xf1a301,null));};exports[_0xa5e9('0x57')]=function(_0x5badd6,_0x20453e){var _0x27ea6f=0xa;var _0x3dc5ad=[_0xa5e9('0x58'),'left_join',_0xa5e9('0x59'),_0xa5e9('0x5a')];var _0x449ad1={'SUM':_0xa5e9('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xa5e9('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xa5e9('0x5d'),'GROUP_CONCAT DESC':_0xa5e9('0x5e')};var _0xd89b3={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa5e9('0x5f'),'HOUR':_0xa5e9('0x60'),'ROUND':_0xa5e9('0x61'),'UNIX_TIMESTAMP':_0xa5e9('0x62')};var _0x5288df=function(_0xea78a4){return!_[_0xa5e9('0x63')]([_0xa5e9('0x64'),_0xa5e9('0x65'),'IS\x20EMPTY',_0xa5e9('0x66')],_0xea78a4);};var _0x5a4046=function(_0x44a044){if(!_0x44a044||!_0x44a044['rules'][_0xa5e9('0x39')]){return'';}for(var _0x24f779='(',_0x26b116=0x0;_0x26b116<_0x44a044[_0xa5e9('0x67')][_0xa5e9('0x39')];_0x26b116+=0x1){_0x26b116>0x0&&(_0x24f779+='\x20'+_0x44a044[_0xa5e9('0x68')]+'\x20');_0x24f779+=_0x44a044[_0xa5e9('0x67')][_0x26b116][_0xa5e9('0x69')]?_0x5a4046(_0x44a044[_0xa5e9('0x67')][_0x26b116][_0xa5e9('0x69')]):_0x44a044['rules'][_0x26b116][_0xa5e9('0x6a')]+'\x20'+_0x44a044['rules'][_0x26b116][_0xa5e9('0x6b')]+(_0x5288df(_0x44a044[_0xa5e9('0x67')][_0x26b116]['condition'])?'\x20'+_0x44a044[_0xa5e9('0x67')][_0x26b116][_0xa5e9('0x6c')]:'');}return _0x24f779+')';};var _0x303db2={'where':{'id':_0x5badd6[_0xa5e9('0x49')]['id']}},_0x4cb61b,_0x1c60d4,_0x5d33c0,_0x1a5689,_0x10686c;_0x303db2=_[_0xa5e9('0x40')]({},_0x303db2,_0x5badd6[_0xa5e9('0x42')]);return db[_0xa5e9('0x43')][_0xa5e9('0x4d')](_0x303db2)['then'](function(_0x3c84dd){if(_0x3c84dd){_0x4cb61b=_0x3c84dd;return _0x3c84dd[_0xa5e9('0x6d')]();}return null;})[_0xa5e9('0x29')](function(_0x2cb066){if(_0x2cb066){if(!_0x2cb066[_0xa5e9('0x39')]){throw new db[(_0xa5e9('0x6e'))][(_0xa5e9('0x6f'))](_0xa5e9('0x70'),0x193);}_0x1c60d4=_0x2cb066;return db[_0xa5e9('0x71')][_0xa5e9('0x46')]({'raw':!![]});}return null;})[_0xa5e9('0x29')](function(_0x244a48){if(_0x244a48){_0x5d33c0=_['keyBy'](_0x244a48,'id');var _0x29f672;var _0x202269=squel[_0xa5e9('0x72')]();_0x202269['from'](_0x4cb61b[_0xa5e9('0x73')]);for(var _0x3121fe=0x0;_0x3121fe<_0x1c60d4[_0xa5e9('0x39')];_0x3121fe+=0x1){_0x29f672=_0x1c60d4[_0x3121fe][_0xa5e9('0x74')]?_0x5d33c0[_0x1c60d4[_0x3121fe][_0xa5e9('0x74')]][_0xa5e9('0x75')]:_0x1c60d4[_0x3121fe][_0xa5e9('0x6a')];_0x29f672=_0x1c60d4[_0x3121fe][_0xa5e9('0x76')]?_[_0xa5e9('0x77')](_0x449ad1[_0x1c60d4[_0x3121fe]['function']],'%s',_0x29f672):_0x29f672;_0x29f672=_0x1c60d4[_0x3121fe][_0xa5e9('0x78')]?_[_0xa5e9('0x77')](_0xd89b3[_0x1c60d4[_0x3121fe][_0xa5e9('0x78')]],'%s',_0x29f672):_0x29f672;if(_0x1c60d4[_0x3121fe][_0xa5e9('0x79')]){_0x202269[_0xa5e9('0x69')](_0x29f672);}_0x1c60d4[_0x3121fe][_0xa5e9('0x7a')]&&_0x202269[_0xa5e9('0x3b')](_0x29f672,_0x1c60d4[_0x3121fe]['orderBy']===_0xa5e9('0x7b')?![]:!![]);_0x202269[_0xa5e9('0x6a')](_0x29f672,_0x1c60d4[_0x3121fe]['alias']||_0x29f672);}if(_0x4cb61b['joins']){_0x4cb61b['joins']=JSON[_0xa5e9('0x7c')](_0x4cb61b[_0xa5e9('0x7d')]);for(var _0x6bac60=0x0;_0x6bac60<_0x4cb61b[_0xa5e9('0x7d')]['length'];_0x6bac60+=0x1){if(_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60][_0xa5e9('0x32')]&&_[_0xa5e9('0x63')](_0x3dc5ad,_0x4cb61b['joins'][_0x6bac60]['type'])&&_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60][_0xa5e9('0x7e')]&&_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60]['foreignTable']&&_0x4cb61b['joins'][_0x6bac60][_0xa5e9('0x7f')]){_0x202269[_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60][_0xa5e9('0x32')]](_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60][_0xa5e9('0x80')],null,util[_0xa5e9('0x78')](_0xa5e9('0x81'),_0x4cb61b['table'],_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60]['parentKey'],_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60][_0xa5e9('0x80')],_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60][_0xa5e9('0x7f')]));}}}if(_0x4cb61b[_0xa5e9('0x82')]){_0x4cb61b['conditions']=JSON['parse'](_0x4cb61b[_0xa5e9('0x82')]);_0x202269[_0xa5e9('0x3d')](_0x5a4046(_0x4cb61b[_0xa5e9('0x82')][_0xa5e9('0x69')]));}_0x10686c=_0x202269[_0xa5e9('0x83')]();_0x202269['limit'](_0x27ea6f);_0x202269[_0xa5e9('0x21')](0x0);logger[_0xa5e9('0x84')](_0xa5e9('0x85'),_0x202269[_0xa5e9('0x86')]());return dbH[_0xa5e9('0x87')]['query'](_0x202269[_0xa5e9('0x86')](),{'type':dbH[_0xa5e9('0x87')][_0xa5e9('0x88')][_0xa5e9('0x89')]});}})[_0xa5e9('0x29')](respondWithResult(_0x20453e,null))['catch'](handleError(_0x20453e,null));};function runReport(_0x3f888d,_0x1f6032,_0x17b00e){var _0xa48ea9=_0x1f6032[_0xa5e9('0x2e')];var _0x13d97c=0xa;var _0x437bd1=[_0xa5e9('0x58'),_0xa5e9('0x8a'),_0xa5e9('0x59'),'cross_join'];var _0xaba560={'SUM':_0xa5e9('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xa5e9('0x8b'),'MAX':_0xa5e9('0x8c'),'MIN':_0xa5e9('0x5c'),'AVG':_0xa5e9('0x8d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xa5e9('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x400dc8={'SEC_TO_TIME':_0xa5e9('0x8e'),'DATE':_0xa5e9('0x5f'),'HOUR':_0xa5e9('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xa5e9('0x62')};var _0x5ee766=function(_0x20d35a){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xa5e9('0x8f'),_0xa5e9('0x66')],_0x20d35a);};var _0x2537f4=function(_0x1d75a0){if(!_0x1d75a0||!_0x1d75a0['rules']['length']){return'';}for(var _0x148a71='(',_0x1a162c=0x0;_0x1a162c<_0x1d75a0[_0xa5e9('0x67')][_0xa5e9('0x39')];_0x1a162c+=0x1){_0x1a162c>0x0&&(_0x148a71+='\x20'+_0x1d75a0[_0xa5e9('0x68')]+'\x20');_0x148a71+=_0x1d75a0['rules'][_0x1a162c][_0xa5e9('0x69')]?_0x2537f4(_0x1d75a0[_0xa5e9('0x67')][_0x1a162c][_0xa5e9('0x69')]):_0x1d75a0[_0xa5e9('0x67')][_0x1a162c][_0xa5e9('0x6a')]+'\x20'+_0x1d75a0[_0xa5e9('0x67')][_0x1a162c][_0xa5e9('0x6b')]+(_0x5ee766(_0x1d75a0[_0xa5e9('0x67')][_0x1a162c][_0xa5e9('0x6b')])?'\x20'+_0x1d75a0['rules'][_0x1a162c][_0xa5e9('0x6c')]:'');}return _0x148a71+')';};var _0x4a6086={'where':{'id':_0x3f888d['id']}},_0x5327d2,_0x585f46,_0x45443c,_0x2a4a8a,_0x362272;_0x4a6086=_['merge']({},_0x4a6086,_0x17b00e);return db[_0xa5e9('0x43')][_0xa5e9('0x4d')](_0x4a6086)[_0xa5e9('0x29')](function(_0xf31b28){if(_0xf31b28){_0x5327d2=_0xf31b28;return _0xf31b28[_0xa5e9('0x6d')]();}return null;})[_0xa5e9('0x29')](function(_0x147b74){if(_0x147b74){if(!_0x147b74[_0xa5e9('0x39')]){throw new db[(_0xa5e9('0x6e'))][(_0xa5e9('0x6f'))](_0xa5e9('0x70'),0x193);}_0x585f46=_0x147b74;return db[_0xa5e9('0x71')]['findAll']({'raw':!![]});}return null;})[_0xa5e9('0x29')](function(_0x57e62b){if(_0x57e62b){_0x45443c=_[_0xa5e9('0x90')](_0x57e62b,'id');var _0x2b5f72;var _0x58890e=squel[_0xa5e9('0x72')]();_0x58890e[_0xa5e9('0x91')](_0x5327d2[_0xa5e9('0x73')]);for(var _0x46e22c=0x0;_0x46e22c<_0x585f46[_0xa5e9('0x39')];_0x46e22c+=0x1){_0x2b5f72=_0x585f46[_0x46e22c][_0xa5e9('0x74')]?_0x45443c[_0x585f46[_0x46e22c][_0xa5e9('0x74')]][_0xa5e9('0x75')]:_0x585f46[_0x46e22c][_0xa5e9('0x6a')];_0x2b5f72=_0x585f46[_0x46e22c]['function']?_[_0xa5e9('0x77')](_0xaba560[_0x585f46[_0x46e22c]['function']],'%s',_0x2b5f72):_0x2b5f72;_0x2b5f72=_0x585f46[_0x46e22c]['format']?_[_0xa5e9('0x77')](_0x400dc8[_0x585f46[_0x46e22c]['format']],'%s',_0x2b5f72):_0x2b5f72;if(_0x585f46[_0x46e22c][_0xa5e9('0x79')]){_0x58890e[_0xa5e9('0x69')](_0x2b5f72);}_0x585f46[_0x46e22c][_0xa5e9('0x7a')]&&_0x58890e[_0xa5e9('0x3b')](_0x2b5f72,_0x585f46[_0x46e22c][_0xa5e9('0x7a')]===_0xa5e9('0x7b')?![]:!![]);_0x58890e[_0xa5e9('0x6a')](_0x2b5f72,_0x585f46[_0x46e22c][_0xa5e9('0x92')]||_0x2b5f72);}if(_0x5327d2[_0xa5e9('0x7d')]){_0x5327d2[_0xa5e9('0x7d')]=JSON['parse'](_0x5327d2[_0xa5e9('0x7d')]);for(var _0x5d70c8=0x0;_0x5d70c8<_0x5327d2[_0xa5e9('0x7d')]['length'];_0x5d70c8+=0x1){if(_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8][_0xa5e9('0x32')]&&_[_0xa5e9('0x63')](_0x437bd1,_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8]['type'])&&_0x5327d2['joins'][_0x5d70c8][_0xa5e9('0x7e')]&&_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8][_0xa5e9('0x80')]&&_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8][_0xa5e9('0x7f')]){_0x58890e[_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8][_0xa5e9('0x32')]](_0x5327d2['joins'][_0x5d70c8][_0xa5e9('0x80')],null,util[_0xa5e9('0x78')](_0xa5e9('0x81'),_0x5327d2[_0xa5e9('0x73')],_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8][_0xa5e9('0x7e')],_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8][_0xa5e9('0x80')],_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8][_0xa5e9('0x7f')]));}}}if(_0x5327d2['conditions']){_0x5327d2[_0xa5e9('0x82')]=JSON[_0xa5e9('0x7c')](_0x5327d2[_0xa5e9('0x82')]);_0x58890e[_0xa5e9('0x3d')](_0x2537f4(_0x5327d2[_0xa5e9('0x82')][_0xa5e9('0x69')]));}_0x362272=_0x58890e[_0xa5e9('0x83')]();_0x58890e[_0xa5e9('0x24')](_0x13d97c);_0x58890e[_0xa5e9('0x21')](0x0);return;}})[_0xa5e9('0x29')](function(){if(_0x1f6032['output']===_0xa5e9('0x93')){return null;}var _0x4a68a3=_['merge'](_0x1f6032,{'name':_0x1f6032[_0xa5e9('0x94')]||_0x1f6032[_0xa5e9('0x2e')]||_0x5327d2[_0xa5e9('0x2e')],'basename':_0xa48ea9,'savename':util[_0xa5e9('0x78')](_0xa5e9('0x95'),_0x1f6032[_0xa5e9('0x2e')]||_0x5327d2[_0xa5e9('0x2e')],require(_0xa5e9('0x96'))[_0xa5e9('0x97')](0x4),_0x1f6032[_0xa5e9('0x98')]||_0xa5e9('0x99')),'reportId':_0x5327d2['id'],'reportType':_0xa5e9('0x9a')});return db['AnalyticExtractedReport']['create'](_0x4a68a3,{'raw':!![]});})[_0xa5e9('0x29')](function(_0x5c4db6){if(_0x5327d2[_0xa5e9('0x73')]===_0xa5e9('0x9b')){_0x362272[_0xa5e9('0x3d')](_0x5327d2[_0xa5e9('0x73')]+_0xa5e9('0x9c'),_0x1f6032[_0xa5e9('0x9d')],_0x1f6032[_0xa5e9('0x9e')]);}else{_0x362272[_0xa5e9('0x3d')](_0x5327d2[_0xa5e9('0x73')]+_0xa5e9('0x9f'),_0x1f6032[_0xa5e9('0x9d')],_0x1f6032[_0xa5e9('0x9e')]);}if(_0x5c4db6){logger[_0xa5e9('0xa0')](_0xa5e9('0xa1'),_0x362272[_0xa5e9('0x86')]());require(_0xa5e9('0xa2'))[_0xa5e9('0xa3')](path[_0xa5e9('0x58')](__dirname,_0xa5e9('0xa4'),_0x5c4db6[_0xa5e9('0x98')]),[_0x5c4db6['id'],_0x362272[_0xa5e9('0x86')](),path[_0xa5e9('0x58')](__dirname,_0xa5e9('0xa5'),_0x5c4db6[_0xa5e9('0xa6')]),_0xa48ea9]);return _0x5c4db6;}else{var _0x48e099=squel[_0xa5e9('0x72')]();_0x48e099[_0xa5e9('0x91')]('('+_0x362272[_0xa5e9('0x86')]()+')',_0xa5e9('0xa7'));_0x48e099[_0xa5e9('0x6a')](_0xa5e9('0xa8'),_0xa5e9('0x23'));_0x362272['limit'](_0x1f6032[_0xa5e9('0x24')]||_0x13d97c);_0x362272[_0xa5e9('0x21')](_0x1f6032[_0xa5e9('0x21')]||0x0);return dbH[_0xa5e9('0x87')]['query'](_0x48e099[_0xa5e9('0x86')](),{'type':dbH[_0xa5e9('0x87')][_0xa5e9('0x88')][_0xa5e9('0x89')]})[_0xa5e9('0x29')](function(_0x19b160){if(!_0x19b160[_0xa5e9('0x39')]){_0x2a4a8a=0x0;}else{_0x2a4a8a=_0x19b160[0x0][_0xa5e9('0x23')]||0x0;}return dbH[_0xa5e9('0x87')]['query'](_0x362272['toString'](),{'type':dbH[_0xa5e9('0x87')][_0xa5e9('0x88')][_0xa5e9('0x89')]});})['then'](function(_0x22d71c){return{'rows':_0x22d71c||[],'count':_0x2a4a8a};});}});}exports[_0xa5e9('0xa9')]=function(_0x4ac5d0,_0xe83279){return runReport(_0x4ac5d0[_0xa5e9('0x49')],_0x4ac5d0[_0xa5e9('0x35')],_0x4ac5d0[_0xa5e9('0x42')])['then'](respondWithResult(_0xe83279,null))['catch'](handleError(_0xe83279,null));};exports[_0xa5e9('0xaa')]=runReport;exports[_0xa5e9('0x35')]=function(_0x4050c2,_0x23ce0b){var _0x36c001=0xa;var _0x4f7c1e=['join',_0xa5e9('0x8a'),_0xa5e9('0x59'),_0xa5e9('0x5a')];var _0x541131={'SUM':_0xa5e9('0x5b'),'COUNT':_0xa5e9('0xab'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xa5e9('0x8c'),'MIN':_0xa5e9('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xa5e9('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xe43a55={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa5e9('0x5f'),'HOUR':_0xa5e9('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xa5e9('0x62')};var _0x556b3a=function(_0x5bf54b){return!_[_0xa5e9('0x63')]([_0xa5e9('0x64'),_0xa5e9('0x65'),'IS\x20EMPTY',_0xa5e9('0x66')],_0x5bf54b);};var _0x60a994=function(_0x3b118b){if(!_0x3b118b||!_0x3b118b['rules'][_0xa5e9('0x39')]){return'';}for(var _0x165009='(',_0x50435b=0x0;_0x50435b<_0x3b118b['rules'][_0xa5e9('0x39')];_0x50435b+=0x1){_0x50435b>0x0&&(_0x165009+='\x20'+_0x3b118b[_0xa5e9('0x68')]+'\x20');_0x165009+=_0x3b118b['rules'][_0x50435b][_0xa5e9('0x69')]?_0x60a994(_0x3b118b[_0xa5e9('0x67')][_0x50435b][_0xa5e9('0x69')]):_0x3b118b[_0xa5e9('0x67')][_0x50435b][_0xa5e9('0x6a')]+'\x20'+_0x3b118b['rules'][_0x50435b][_0xa5e9('0x6b')]+(_0x556b3a(_0x3b118b[_0xa5e9('0x67')][_0x50435b][_0xa5e9('0x6b')])?'\x20'+_0x3b118b['rules'][_0x50435b][_0xa5e9('0x6c')]:'');}return _0x165009+')';};var _0x8af981={'where':{'id':_0x4050c2['params']['id']}},_0x22118d,_0x12dcc0,_0x15c06b,_0x160562,_0x496aec;_0x8af981=_[_0xa5e9('0x40')]({},_0x8af981,_0x4050c2[_0xa5e9('0x42')]);return db[_0xa5e9('0x43')][_0xa5e9('0x4d')](_0x8af981)[_0xa5e9('0x29')](function(_0x486fa3){if(_0x486fa3){_0x22118d=_0x486fa3;return _0x486fa3[_0xa5e9('0x6d')]();}return null;})['then'](function(_0x43a6cb){if(_0x43a6cb){if(!_0x43a6cb['length']){throw new db[(_0xa5e9('0x6e'))][(_0xa5e9('0x6f'))](_0xa5e9('0x70'),0x193);}_0x12dcc0=_0x43a6cb;return db['AnalyticMetric'][_0xa5e9('0x46')]({'raw':!![]});}return null;})[_0xa5e9('0x29')](function(_0x37a4db){if(_0x37a4db){_0x15c06b=_['keyBy'](_0x37a4db,'id');var _0x175bdf;var _0x16d798=squel['select']();_0x16d798[_0xa5e9('0x91')](_0x22118d['table']);for(var _0x27aacb=0x0;_0x27aacb<_0x12dcc0[_0xa5e9('0x39')];_0x27aacb+=0x1){_0x175bdf=_0x12dcc0[_0x27aacb][_0xa5e9('0x74')]?_0x15c06b[_0x12dcc0[_0x27aacb][_0xa5e9('0x74')]][_0xa5e9('0x75')]:_0x12dcc0[_0x27aacb][_0xa5e9('0x6a')];_0x175bdf=_0x12dcc0[_0x27aacb][_0xa5e9('0x76')]?_[_0xa5e9('0x77')](_0x541131[_0x12dcc0[_0x27aacb][_0xa5e9('0x76')]],'%s',_0x175bdf):_0x175bdf;_0x175bdf=_0x12dcc0[_0x27aacb]['format']?_[_0xa5e9('0x77')](_0xe43a55[_0x12dcc0[_0x27aacb]['format']],'%s',_0x175bdf):_0x175bdf;if(_0x12dcc0[_0x27aacb][_0xa5e9('0x79')]){_0x16d798[_0xa5e9('0x69')](_0x175bdf);}_0x12dcc0[_0x27aacb]['orderBy']&&_0x16d798[_0xa5e9('0x3b')](_0x175bdf,_0x12dcc0[_0x27aacb][_0xa5e9('0x7a')]===_0xa5e9('0x7b')?![]:!![]);_0x16d798['field'](_0x175bdf,_0x12dcc0[_0x27aacb][_0xa5e9('0x92')]||_0x175bdf);}if(_0x22118d[_0xa5e9('0x7d')]){_0x22118d[_0xa5e9('0x7d')]=JSON[_0xa5e9('0x7c')](_0x22118d[_0xa5e9('0x7d')]);for(var _0x4f12e5=0x0;_0x4f12e5<_0x22118d['joins']['length'];_0x4f12e5+=0x1){if(_0x22118d[_0xa5e9('0x7d')][_0x4f12e5]['type']&&_[_0xa5e9('0x63')](_0x4f7c1e,_0x22118d['joins'][_0x4f12e5][_0xa5e9('0x32')])&&_0x22118d[_0xa5e9('0x7d')][_0x4f12e5]['parentKey']&&_0x22118d['joins'][_0x4f12e5][_0xa5e9('0x80')]&&_0x22118d[_0xa5e9('0x7d')][_0x4f12e5]['foreignKey']){_0x16d798[_0x22118d[_0xa5e9('0x7d')][_0x4f12e5][_0xa5e9('0x32')]](_0x22118d['joins'][_0x4f12e5][_0xa5e9('0x80')],null,util[_0xa5e9('0x78')](_0xa5e9('0x81'),_0x22118d[_0xa5e9('0x73')],_0x22118d[_0xa5e9('0x7d')][_0x4f12e5]['parentKey'],_0x22118d[_0xa5e9('0x7d')][_0x4f12e5]['foreignTable'],_0x22118d[_0xa5e9('0x7d')][_0x4f12e5][_0xa5e9('0x7f')]));}}}if(_0x22118d[_0xa5e9('0x82')]){_0x22118d[_0xa5e9('0x82')]=JSON[_0xa5e9('0x7c')](_0x22118d[_0xa5e9('0x82')]);_0x16d798['where'](_0x60a994(_0x22118d['conditions'][_0xa5e9('0x69')]));}_0x496aec=_0x16d798[_0xa5e9('0x83')]();_0x16d798['limit'](_0x36c001);_0x16d798[_0xa5e9('0x21')](0x0);logger['debug'](_0xa5e9('0x85'),_0x16d798[_0xa5e9('0x86')]());return dbH[_0xa5e9('0x87')][_0xa5e9('0x35')](_0x16d798[_0xa5e9('0x86')](),{'type':dbH[_0xa5e9('0x87')][_0xa5e9('0x88')][_0xa5e9('0x89')]});}})[_0xa5e9('0x29')](function(){return{'sql':_0x496aec[_0xa5e9('0x86')]()};})[_0xa5e9('0x29')](respondWithResult(_0x23ce0b,null))[_0xa5e9('0x47')](handleError(_0x23ce0b,null));}; \ No newline at end of file +var _0x63cf=['Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20NOT\x20EMPTY','field','AnalyticMetric','findAll','metric','groupBy','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','child_process','fork','../../components/export/','../../files/reports','COUNT(*)','run','runReport','DESC','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','include','rows','catch','params','includeAll','create','body','user','Reports','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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\x20NOT\x20NULL','IS\x20EMPTY','length','operator','rules','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','replace','function','format','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x63cf,0xc9));var _0xf63c=function(_0x17bb31,_0x2fc6f8){_0x17bb31=_0x17bb31-0x0;var _0x505c71=_0x63cf[_0x17bb31];return _0x505c71;};'use strict';var emlformat=require(_0xf63c('0x0'));var rimraf=require(_0xf63c('0x1'));var zipdir=require(_0xf63c('0x2'));var jsonpatch=require(_0xf63c('0x3'));var rp=require(_0xf63c('0x4'));var moment=require(_0xf63c('0x5'));var BPromise=require(_0xf63c('0x6'));var Mustache=require('mustache');var util=require(_0xf63c('0x7'));var path=require('path');var sox=require(_0xf63c('0x8'));var csv=require(_0xf63c('0x9'));var ejs=require(_0xf63c('0xa'));var fs=require('fs');var fs_extra=require(_0xf63c('0xb'));var _=require(_0xf63c('0xc'));var squel=require('squel');var crypto=require(_0xf63c('0xd'));var jsforce=require(_0xf63c('0xe'));var deskjs=require(_0xf63c('0xf'));var toCsv=require(_0xf63c('0x9'));var querystring=require(_0xf63c('0x10'));var Papa=require(_0xf63c('0x11'));var Redis=require(_0xf63c('0x12'));var authService=require(_0xf63c('0x13'));var qs=require(_0xf63c('0x14'));var as=require(_0xf63c('0x15'));var hardwareService=require(_0xf63c('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xf63c('0x17'));var config=require(_0xf63c('0x18'));var licenseUtil=require(_0xf63c('0x19'));var db=require(_0xf63c('0x1a'))['db'];var dbH=require(_0xf63c('0x1a'))[_0xf63c('0x1b')];function respondWithStatusCode(_0x1dddf3,_0x41ac1e){_0x41ac1e=_0x41ac1e||0xcc;return function(_0x2bff98){if(_0x2bff98){return _0x1dddf3[_0xf63c('0x1c')](_0x41ac1e);}return _0x1dddf3[_0xf63c('0x1d')](_0x41ac1e)[_0xf63c('0x1e')]();};}function respondWithResult(_0x43219a,_0x5378c2){_0x5378c2=_0x5378c2||0xc8;return function(_0xb98e6d){if(_0xb98e6d){return _0x43219a[_0xf63c('0x1d')](_0x5378c2)[_0xf63c('0x1f')](_0xb98e6d);}};}function respondWithFilteredResult(_0x5cd8c1,_0x4e408a){return function(_0x449881){if(_0x449881){var _0xdfa8e3=typeof _0x4e408a[_0xf63c('0x20')]==='undefined'&&typeof _0x4e408a[_0xf63c('0x21')]==='undefined';var _0x86ef2c=_0x449881[_0xf63c('0x22')];var _0x80febe=_0xdfa8e3?0x0:_0x4e408a['offset'];var _0x4567cb=_0xdfa8e3?_0x449881[_0xf63c('0x22')]:_0x4e408a[_0xf63c('0x20')]+_0x4e408a['limit'];var _0x56665e;if(_0x4567cb>=_0x86ef2c){_0x4567cb=_0x86ef2c;_0x56665e=0xc8;}else{_0x56665e=0xce;}_0x5cd8c1[_0xf63c('0x1d')](_0x56665e);return _0x5cd8c1[_0xf63c('0x23')](_0xf63c('0x24'),_0x80febe+'-'+_0x4567cb+'/'+_0x86ef2c)[_0xf63c('0x1f')](_0x449881);}return null;};}function patchUpdates(_0x5e7e0e){return function(_0x5359d1){try{jsonpatch[_0xf63c('0x25')](_0x5359d1,_0x5e7e0e,!![]);}catch(_0x287842){return BPromise[_0xf63c('0x26')](_0x287842);}return _0x5359d1[_0xf63c('0x27')]();};}function saveUpdates(_0x41297f,_0x2945ad){return function(_0x68692d){if(_0x68692d){return _0x68692d[_0xf63c('0x28')](_0x41297f)[_0xf63c('0x29')](function(_0x4221ff){return _0x4221ff;});}return null;};}function removeEntity(_0x3a5bc7,_0x27b8ce){return function(_0x58bbfc){if(_0x58bbfc){return _0x58bbfc[_0xf63c('0x2a')]()[_0xf63c('0x29')](function(){var _0x53e03c=_0x58bbfc['get']({'plain':!![]});var _0x47cb49=_0xf63c('0x2b');return db[_0xf63c('0x2c')][_0xf63c('0x2a')]({'where':{'type':_0x47cb49,'resourceId':_0x53e03c['id']}})[_0xf63c('0x29')](function(){return _0x58bbfc;});})[_0xf63c('0x29')](function(){_0x3a5bc7['status'](0xcc)[_0xf63c('0x1e')]();});}};}function handleEntityNotFound(_0x8468d3,_0x4d2521){return function(_0x1e84b6){if(!_0x1e84b6){_0x8468d3[_0xf63c('0x1c')](0x194);}return _0x1e84b6;};}function handleError(_0x43cbd7,_0xbba601){_0xbba601=_0xbba601||0x1f4;return function(_0x4447cc){logger[_0xf63c('0x2d')](_0x4447cc[_0xf63c('0x2e')]);if(_0x4447cc[_0xf63c('0x2f')]){delete _0x4447cc[_0xf63c('0x2f')];}_0x43cbd7[_0xf63c('0x1d')](_0xbba601)['send'](_0x4447cc);};}exports[_0xf63c('0x30')]=function(_0x5623af,_0x56a667){var _0xffc4a4={},_0x335168={},_0xc592b9={'count':0x0,'rows':[]};var _0x3d6536=_[_0xf63c('0x31')](db[_0xf63c('0x32')][_0xf63c('0x33')],function(_0x1aaaf4){return{'name':_0x1aaaf4['fieldName'],'type':_0x1aaaf4['type']['key']};});_0x335168[_0xf63c('0x34')]=_['map'](_0x3d6536,_0xf63c('0x2f'));_0x335168[_0xf63c('0x35')]=_[_0xf63c('0x36')](_0x5623af['query']);_0x335168[_0xf63c('0x37')]=_[_0xf63c('0x38')](_0x335168[_0xf63c('0x34')],_0x335168[_0xf63c('0x35')]);_0xffc4a4[_0xf63c('0x39')]=_[_0xf63c('0x38')](_0x335168[_0xf63c('0x34')],qs[_0xf63c('0x3a')](_0x5623af[_0xf63c('0x35')][_0xf63c('0x3a')]));_0xffc4a4[_0xf63c('0x39')]=_0xffc4a4[_0xf63c('0x39')]['length']?_0xffc4a4[_0xf63c('0x39')]:_0x335168[_0xf63c('0x34')];if(!_0x5623af[_0xf63c('0x35')][_0xf63c('0x3b')](_0xf63c('0x3c'))){_0xffc4a4[_0xf63c('0x21')]=qs[_0xf63c('0x21')](_0x5623af[_0xf63c('0x35')]['limit']);_0xffc4a4['offset']=qs['offset'](_0x5623af[_0xf63c('0x35')][_0xf63c('0x20')]);}_0xffc4a4[_0xf63c('0x3d')]=qs[_0xf63c('0x3e')](_0x5623af['query'][_0xf63c('0x3e')]);_0xffc4a4[_0xf63c('0x3f')]=qs[_0xf63c('0x37')](_['pick'](_0x5623af['query'],_0x335168[_0xf63c('0x37')]),_0x3d6536);if(_0x5623af[_0xf63c('0x35')]['filter']){_0xffc4a4[_0xf63c('0x3f')]=_[_0xf63c('0x40')](_0xffc4a4[_0xf63c('0x3f')],{'$or':_[_0xf63c('0x31')](_0x3d6536,function(_0xcd5a3d){if(_0xcd5a3d[_0xf63c('0x41')]!==_0xf63c('0x42')){var _0x33b14b={};_0x33b14b[_0xcd5a3d['name']]={'$like':'%'+_0x5623af[_0xf63c('0x35')][_0xf63c('0x43')]+'%'};return _0x33b14b;}})});}_0xffc4a4=_['merge']({},_0xffc4a4,_0x5623af[_0xf63c('0x44')]);var _0x5c69b2={'where':_0xffc4a4[_0xf63c('0x3f')]};return db[_0xf63c('0x32')][_0xf63c('0x22')](_0x5c69b2)[_0xf63c('0x29')](function(_0x6d949c){_0xc592b9[_0xf63c('0x22')]=_0x6d949c;if(_0x5623af[_0xf63c('0x35')]['includeAll']){_0xffc4a4[_0xf63c('0x45')]=[{'all':!![]}];}return db[_0xf63c('0x32')]['findAll'](_0xffc4a4);})['then'](function(_0x149501){_0xc592b9[_0xf63c('0x46')]=_0x149501;return _0xc592b9;})[_0xf63c('0x29')](respondWithFilteredResult(_0x56a667,_0xffc4a4))[_0xf63c('0x47')](handleError(_0x56a667,null));};exports['show']=function(_0xbf6703,_0x4653c5){var _0x2d4936={'raw':![],'where':{'id':_0xbf6703[_0xf63c('0x48')]['id']}},_0x111a30={};_0x111a30[_0xf63c('0x34')]=_[_0xf63c('0x36')](db[_0xf63c('0x32')][_0xf63c('0x33')]);_0x111a30['query']=_[_0xf63c('0x36')](_0xbf6703[_0xf63c('0x35')]);_0x111a30[_0xf63c('0x37')]=_['intersection'](_0x111a30['model'],_0x111a30[_0xf63c('0x35')]);_0x2d4936['attributes']=_[_0xf63c('0x38')](_0x111a30[_0xf63c('0x34')],qs['fields'](_0xbf6703[_0xf63c('0x35')][_0xf63c('0x3a')]));_0x2d4936[_0xf63c('0x39')]=_0x2d4936['attributes']['length']?_0x2d4936[_0xf63c('0x39')]:_0x111a30[_0xf63c('0x34')];if(_0xbf6703[_0xf63c('0x35')][_0xf63c('0x49')]){_0x2d4936[_0xf63c('0x45')]=[{'all':!![]}];}_0x2d4936=_[_0xf63c('0x40')]({},_0x2d4936,_0xbf6703[_0xf63c('0x44')]);return db[_0xf63c('0x32')]['find'](_0x2d4936)[_0xf63c('0x29')](handleEntityNotFound(_0x4653c5,null))['then'](respondWithResult(_0x4653c5,null))[_0xf63c('0x47')](handleError(_0x4653c5,null));};exports[_0xf63c('0x4a')]=function(_0x5ed078,_0x52e1b4){return db[_0xf63c('0x32')]['create'](_0x5ed078[_0xf63c('0x4b')],{})[_0xf63c('0x29')](function(_0x2c4802){var _0x104187=_0x5ed078[_0xf63c('0x4c')]['get']({'plain':!![]});if(!_0x104187)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x104187['role']===_0xf63c('0x4c')){var _0x1481bb=_0x2c4802['get']({'plain':!![]});var _0x1359be=_0xf63c('0x4d');return db[_0xf63c('0x4e')][_0xf63c('0x4f')]({'where':{'name':_0x1359be,'userProfileId':_0x104187['userProfileId']},'raw':!![]})['then'](function(_0x4e5da7){if(_0x4e5da7&&_0x4e5da7[_0xf63c('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x1481bb['name'],'resourceId':_0x1481bb['id'],'type':'CustomReports','sectionId':_0x4e5da7['id']},{})['then'](function(){return _0x2c4802;});}else{return _0x2c4802;}})[_0xf63c('0x47')](function(_0x393c6b){logger[_0xf63c('0x2d')](_0xf63c('0x51'),_0x393c6b);throw _0x393c6b;});}return _0x2c4802;})[_0xf63c('0x29')](respondWithResult(_0x52e1b4,0xc9))[_0xf63c('0x47')](handleError(_0x52e1b4,null));};exports['update']=function(_0x509dde,_0x9fe23a){if(_0x509dde[_0xf63c('0x4b')]['id']){delete _0x509dde[_0xf63c('0x4b')]['id'];}return db[_0xf63c('0x32')][_0xf63c('0x4f')]({'where':{'id':_0x509dde['params']['id']}})[_0xf63c('0x29')](handleEntityNotFound(_0x9fe23a,null))['then'](saveUpdates(_0x509dde[_0xf63c('0x4b')],null))['then'](respondWithResult(_0x9fe23a,null))[_0xf63c('0x47')](handleError(_0x9fe23a,null));};exports['destroy']=function(_0x7891fd,_0x3aac58){return db[_0xf63c('0x32')][_0xf63c('0x4f')]({'where':{'id':_0x7891fd[_0xf63c('0x48')]['id']}})[_0xf63c('0x29')](handleEntityNotFound(_0x3aac58,null))['then'](removeEntity(_0x3aac58,null))[_0xf63c('0x47')](handleError(_0x3aac58,null));};exports['preview']=function(_0xe773f5,_0x55613a){var _0x40bc99=0xa;var _0x1952f6=[_0xf63c('0x52'),_0xf63c('0x53'),_0xf63c('0x54'),_0xf63c('0x55')];var _0x180e25={'SUM':_0xf63c('0x56'),'COUNT':_0xf63c('0x57'),'COUNT DISTINCT':_0xf63c('0x58'),'MAX':_0xf63c('0x59'),'MIN':_0xf63c('0x5a'),'AVG':_0xf63c('0x5b'),'GROUP_CONCAT':_0xf63c('0x5c'),'GROUP_CONCAT ASC':_0xf63c('0x5d'),'GROUP_CONCAT DESC':_0xf63c('0x5e')};var _0x4ea56d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf63c('0x5f'),'HOUR':_0xf63c('0x60'),'ROUND':_0xf63c('0x61'),'UNIX_TIMESTAMP':_0xf63c('0x62')};var _0x414285=function(_0x1e78d4){return!_[_0xf63c('0x63')](['IS\x20NULL',_0xf63c('0x64'),_0xf63c('0x65'),'IS\x20NOT\x20EMPTY'],_0x1e78d4);};var _0x18a2e0=function(_0x437065){if(!_0x437065||!_0x437065['rules'][_0xf63c('0x66')]){return'';}for(var _0x4f06b3='(',_0x2184c2=0x0;_0x2184c2<_0x437065['rules'][_0xf63c('0x66')];_0x2184c2+=0x1){_0x2184c2>0x0&&(_0x4f06b3+='\x20'+_0x437065[_0xf63c('0x67')]+'\x20');_0x4f06b3+=_0x437065[_0xf63c('0x68')][_0x2184c2][_0xf63c('0x69')]?_0x18a2e0(_0x437065[_0xf63c('0x68')][_0x2184c2][_0xf63c('0x69')]):_0x437065['rules'][_0x2184c2]['field']+'\x20'+_0x437065[_0xf63c('0x68')][_0x2184c2][_0xf63c('0x6a')]+(_0x414285(_0x437065[_0xf63c('0x68')][_0x2184c2][_0xf63c('0x6a')])?'\x20'+_0x437065[_0xf63c('0x68')][_0x2184c2][_0xf63c('0x6b')]:'');}return _0x4f06b3+')';};var _0x8a0be3={'where':{'id':_0xe773f5[_0xf63c('0x48')]['id']}},_0x571f05,_0xabc96f,_0x3fad82,_0x52b847,_0x4b4cd4;_0x8a0be3=_[_0xf63c('0x40')]({},_0x8a0be3,_0xe773f5[_0xf63c('0x44')]);return db[_0xf63c('0x32')][_0xf63c('0x4f')](_0x8a0be3)[_0xf63c('0x29')](function(_0x35f4f0){if(_0x35f4f0){_0x571f05=_0x35f4f0;return _0x35f4f0[_0xf63c('0x6c')]();}return null;})[_0xf63c('0x29')](function(_0x1e42bf){if(_0x1e42bf){if(!_0x1e42bf['length']){throw new db[(_0xf63c('0x6d'))][(_0xf63c('0x6e'))](_0xf63c('0x6f'),0x193);}_0xabc96f=_0x1e42bf;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xf63c('0x29')](function(_0x29011c){if(_0x29011c){_0x3fad82=_[_0xf63c('0x70')](_0x29011c,'id');var _0x43cb1e;var _0x282d2d=squel[_0xf63c('0x71')]();_0x282d2d[_0xf63c('0x72')](_0x571f05[_0xf63c('0x73')]);for(var _0x5cd4f2=0x0;_0x5cd4f2<_0xabc96f['length'];_0x5cd4f2+=0x1){_0x43cb1e=_0xabc96f[_0x5cd4f2][_0xf63c('0x74')]?_0x3fad82[_0xabc96f[_0x5cd4f2]['MetricId']]['metric']:_0xabc96f[_0x5cd4f2]['field'];_0x43cb1e=_0xabc96f[_0x5cd4f2]['function']?_[_0xf63c('0x75')](_0x180e25[_0xabc96f[_0x5cd4f2][_0xf63c('0x76')]],'%s',_0x43cb1e):_0x43cb1e;_0x43cb1e=_0xabc96f[_0x5cd4f2][_0xf63c('0x77')]?_[_0xf63c('0x75')](_0x4ea56d[_0xabc96f[_0x5cd4f2][_0xf63c('0x77')]],'%s',_0x43cb1e):_0x43cb1e;if(_0xabc96f[_0x5cd4f2]['groupBy']){_0x282d2d[_0xf63c('0x69')](_0x43cb1e);}_0xabc96f[_0x5cd4f2][_0xf63c('0x78')]&&_0x282d2d['order'](_0x43cb1e,_0xabc96f[_0x5cd4f2][_0xf63c('0x78')]==='DESC'?![]:!![]);_0x282d2d['field'](_0x43cb1e,_0xabc96f[_0x5cd4f2][_0xf63c('0x79')]||_0x43cb1e);}if(_0x571f05[_0xf63c('0x7a')]){_0x571f05[_0xf63c('0x7a')]=JSON[_0xf63c('0x7b')](_0x571f05[_0xf63c('0x7a')]);for(var _0x349e91=0x0;_0x349e91<_0x571f05[_0xf63c('0x7a')]['length'];_0x349e91+=0x1){if(_0x571f05[_0xf63c('0x7a')][_0x349e91]['type']&&_[_0xf63c('0x63')](_0x1952f6,_0x571f05[_0xf63c('0x7a')][_0x349e91][_0xf63c('0x41')])&&_0x571f05['joins'][_0x349e91][_0xf63c('0x7c')]&&_0x571f05[_0xf63c('0x7a')][_0x349e91][_0xf63c('0x7d')]&&_0x571f05['joins'][_0x349e91][_0xf63c('0x7e')]){_0x282d2d[_0x571f05[_0xf63c('0x7a')][_0x349e91]['type']](_0x571f05[_0xf63c('0x7a')][_0x349e91][_0xf63c('0x7d')],null,util[_0xf63c('0x77')](_0xf63c('0x7f'),_0x571f05[_0xf63c('0x73')],_0x571f05[_0xf63c('0x7a')][_0x349e91][_0xf63c('0x7c')],_0x571f05[_0xf63c('0x7a')][_0x349e91][_0xf63c('0x7d')],_0x571f05[_0xf63c('0x7a')][_0x349e91][_0xf63c('0x7e')]));}}}if(_0x571f05[_0xf63c('0x80')]){_0x571f05[_0xf63c('0x80')]=JSON[_0xf63c('0x7b')](_0x571f05[_0xf63c('0x80')]);_0x282d2d[_0xf63c('0x3f')](_0x18a2e0(_0x571f05[_0xf63c('0x80')][_0xf63c('0x69')]));}_0x4b4cd4=_0x282d2d[_0xf63c('0x81')]();_0x282d2d['limit'](_0x40bc99);_0x282d2d[_0xf63c('0x20')](0x0);logger[_0xf63c('0x82')](_0xf63c('0x83'),_0x282d2d[_0xf63c('0x84')]());return dbH[_0xf63c('0x85')][_0xf63c('0x35')](_0x282d2d[_0xf63c('0x84')](),{'type':dbH['sequelize'][_0xf63c('0x86')][_0xf63c('0x87')]});}})[_0xf63c('0x29')](respondWithResult(_0x55613a,null))[_0xf63c('0x47')](handleError(_0x55613a,null));};function runReport(_0x290ae,_0x269ca1,_0x10a7ab){var _0x249350=_0x269ca1[_0xf63c('0x2f')];var _0x676e7=0xa;var _0x5145b7=['join','left_join',_0xf63c('0x54'),'cross_join'];var _0x4e670e={'SUM':'SUM(%s)','COUNT':_0xf63c('0x57'),'COUNT DISTINCT':_0xf63c('0x58'),'MAX':_0xf63c('0x59'),'MIN':_0xf63c('0x5a'),'AVG':_0xf63c('0x5b'),'GROUP_CONCAT':_0xf63c('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf63c('0x5e')};var _0x180791={'SEC_TO_TIME':_0xf63c('0x88'),'DATE':'DATE(%s)','HOUR':_0xf63c('0x60'),'ROUND':_0xf63c('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2b669f=function(_0x4dde3e){return!_[_0xf63c('0x63')]([_0xf63c('0x89'),'IS\x20NOT\x20NULL',_0xf63c('0x65'),_0xf63c('0x8a')],_0x4dde3e);};var _0x44aa57=function(_0x417567){if(!_0x417567||!_0x417567[_0xf63c('0x68')][_0xf63c('0x66')]){return'';}for(var _0x4161ea='(',_0x1485ac=0x0;_0x1485ac<_0x417567[_0xf63c('0x68')][_0xf63c('0x66')];_0x1485ac+=0x1){_0x1485ac>0x0&&(_0x4161ea+='\x20'+_0x417567[_0xf63c('0x67')]+'\x20');_0x4161ea+=_0x417567[_0xf63c('0x68')][_0x1485ac][_0xf63c('0x69')]?_0x44aa57(_0x417567[_0xf63c('0x68')][_0x1485ac]['group']):_0x417567[_0xf63c('0x68')][_0x1485ac][_0xf63c('0x8b')]+'\x20'+_0x417567['rules'][_0x1485ac]['condition']+(_0x2b669f(_0x417567[_0xf63c('0x68')][_0x1485ac]['condition'])?'\x20'+_0x417567[_0xf63c('0x68')][_0x1485ac][_0xf63c('0x6b')]:'');}return _0x4161ea+')';};var _0x5f3cc9={'where':{'id':_0x290ae['id']}},_0x23f342,_0xd610bd,_0x3b6a07,_0x216233,_0x433b50;_0x5f3cc9=_[_0xf63c('0x40')]({},_0x5f3cc9,_0x10a7ab);return db[_0xf63c('0x32')]['find'](_0x5f3cc9)['then'](function(_0xa00856){if(_0xa00856){_0x23f342=_0xa00856;return _0xa00856['getFields']();}return null;})[_0xf63c('0x29')](function(_0x117527){if(_0x117527){if(!_0x117527[_0xf63c('0x66')]){throw new db['Sequelize'][(_0xf63c('0x6e'))](_0xf63c('0x6f'),0x193);}_0xd610bd=_0x117527;return db[_0xf63c('0x8c')][_0xf63c('0x8d')]({'raw':!![]});}return null;})[_0xf63c('0x29')](function(_0x67185b){if(_0x67185b){_0x3b6a07=_[_0xf63c('0x70')](_0x67185b,'id');var _0x183f57;var _0x37bab4=squel[_0xf63c('0x71')]();_0x37bab4['from'](_0x23f342[_0xf63c('0x73')]);for(var _0x3e8d30=0x0;_0x3e8d30<_0xd610bd[_0xf63c('0x66')];_0x3e8d30+=0x1){_0x183f57=_0xd610bd[_0x3e8d30][_0xf63c('0x74')]?_0x3b6a07[_0xd610bd[_0x3e8d30][_0xf63c('0x74')]][_0xf63c('0x8e')]:_0xd610bd[_0x3e8d30][_0xf63c('0x8b')];_0x183f57=_0xd610bd[_0x3e8d30][_0xf63c('0x76')]?_[_0xf63c('0x75')](_0x4e670e[_0xd610bd[_0x3e8d30][_0xf63c('0x76')]],'%s',_0x183f57):_0x183f57;_0x183f57=_0xd610bd[_0x3e8d30][_0xf63c('0x77')]?_[_0xf63c('0x75')](_0x180791[_0xd610bd[_0x3e8d30][_0xf63c('0x77')]],'%s',_0x183f57):_0x183f57;if(_0xd610bd[_0x3e8d30][_0xf63c('0x8f')]){_0x37bab4[_0xf63c('0x69')](_0x183f57);}_0xd610bd[_0x3e8d30][_0xf63c('0x78')]&&_0x37bab4[_0xf63c('0x3d')](_0x183f57,_0xd610bd[_0x3e8d30]['orderBy']==='DESC'?![]:!![]);_0x37bab4[_0xf63c('0x8b')](_0x183f57,_0xd610bd[_0x3e8d30]['alias']||_0x183f57);}if(_0x23f342[_0xf63c('0x7a')]){_0x23f342['joins']=JSON['parse'](_0x23f342['joins']);for(var _0xc99432=0x0;_0xc99432<_0x23f342['joins'][_0xf63c('0x66')];_0xc99432+=0x1){if(_0x23f342[_0xf63c('0x7a')][_0xc99432][_0xf63c('0x41')]&&_[_0xf63c('0x63')](_0x5145b7,_0x23f342[_0xf63c('0x7a')][_0xc99432][_0xf63c('0x41')])&&_0x23f342[_0xf63c('0x7a')][_0xc99432][_0xf63c('0x7c')]&&_0x23f342['joins'][_0xc99432]['foreignTable']&&_0x23f342['joins'][_0xc99432]['foreignKey']){_0x37bab4[_0x23f342[_0xf63c('0x7a')][_0xc99432][_0xf63c('0x41')]](_0x23f342['joins'][_0xc99432][_0xf63c('0x7d')],null,util[_0xf63c('0x77')](_0xf63c('0x7f'),_0x23f342[_0xf63c('0x73')],_0x23f342['joins'][_0xc99432][_0xf63c('0x7c')],_0x23f342[_0xf63c('0x7a')][_0xc99432]['foreignTable'],_0x23f342[_0xf63c('0x7a')][_0xc99432][_0xf63c('0x7e')]));}}}if(_0x23f342[_0xf63c('0x80')]){_0x23f342['conditions']=JSON[_0xf63c('0x7b')](_0x23f342['conditions']);_0x37bab4[_0xf63c('0x3f')](_0x44aa57(_0x23f342[_0xf63c('0x80')][_0xf63c('0x69')]));}_0x433b50=_0x37bab4[_0xf63c('0x81')]();_0x37bab4[_0xf63c('0x21')](_0x676e7);_0x37bab4['offset'](0x0);return;}})[_0xf63c('0x29')](function(){if(_0x269ca1[_0xf63c('0x90')]===_0xf63c('0x91')){return null;}var _0x4ed29a=_['merge'](_0x269ca1,{'name':_0x269ca1[_0xf63c('0x92')]||_0x269ca1['name']||_0x23f342[_0xf63c('0x2f')],'basename':_0x249350,'savename':util['format'](_0xf63c('0x93'),_0x269ca1[_0xf63c('0x2f')]||_0x23f342[_0xf63c('0x2f')],require(_0xf63c('0x94'))[_0xf63c('0x95')](0x4),_0x269ca1[_0xf63c('0x90')]||_0xf63c('0x96')),'reportId':_0x23f342['id'],'reportType':_0xf63c('0x97')});return db[_0xf63c('0x98')][_0xf63c('0x4a')](_0x4ed29a,{'raw':!![]});})[_0xf63c('0x29')](function(_0x2e760d){if(_0x23f342[_0xf63c('0x73')]===_0xf63c('0x99')){_0x433b50[_0xf63c('0x3f')](_0x23f342[_0xf63c('0x73')]+_0xf63c('0x9a'),_0x269ca1['startDate'],_0x269ca1[_0xf63c('0x9b')]);}else{_0x433b50[_0xf63c('0x3f')](_0x23f342[_0xf63c('0x73')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x269ca1[_0xf63c('0x9c')],_0x269ca1['endDate']);}if(_0x2e760d){logger[_0xf63c('0x9d')]('Run\x20Query:',_0x433b50[_0xf63c('0x84')]());require(_0xf63c('0x9e'))[_0xf63c('0x9f')](path[_0xf63c('0x52')](__dirname,_0xf63c('0xa0'),_0x2e760d['output']),[_0x2e760d['id'],_0x433b50[_0xf63c('0x84')](),path['join'](__dirname,_0xf63c('0xa1'),_0x2e760d['savename']),_0x249350]);return _0x2e760d;}else{var _0x1edbdf=squel[_0xf63c('0x71')]();_0x1edbdf[_0xf63c('0x72')]('('+_0x433b50[_0xf63c('0x84')]()+')','countTable');_0x1edbdf[_0xf63c('0x8b')](_0xf63c('0xa2'),_0xf63c('0x22'));_0x433b50['limit'](_0x269ca1[_0xf63c('0x21')]||_0x676e7);_0x433b50[_0xf63c('0x20')](_0x269ca1['offset']||0x0);return dbH['sequelize']['query'](_0x1edbdf[_0xf63c('0x84')](),{'type':dbH[_0xf63c('0x85')][_0xf63c('0x86')][_0xf63c('0x87')]})['then'](function(_0xb086fc){if(!_0xb086fc[_0xf63c('0x66')]){_0x216233=0x0;}else{_0x216233=_0xb086fc[0x0][_0xf63c('0x22')]||0x0;}return dbH[_0xf63c('0x85')][_0xf63c('0x35')](_0x433b50[_0xf63c('0x84')](),{'type':dbH[_0xf63c('0x85')][_0xf63c('0x86')]['SELECT']});})[_0xf63c('0x29')](function(_0x13ead8){return{'rows':_0x13ead8||[],'count':_0x216233};});}});}exports[_0xf63c('0xa3')]=function(_0x57c446,_0x310076){return runReport(_0x57c446[_0xf63c('0x48')],_0x57c446[_0xf63c('0x35')],_0x57c446[_0xf63c('0x44')])[_0xf63c('0x29')](respondWithResult(_0x310076,null))[_0xf63c('0x47')](handleError(_0x310076,null));};exports[_0xf63c('0xa4')]=runReport;exports[_0xf63c('0x35')]=function(_0x164512,_0x4592be){var _0x2683dc=0xa;var _0x351536=[_0xf63c('0x52'),_0xf63c('0x53'),_0xf63c('0x54'),_0xf63c('0x55')];var _0x288c37={'SUM':'SUM(%s)','COUNT':_0xf63c('0x57'),'COUNT DISTINCT':_0xf63c('0x58'),'MAX':_0xf63c('0x59'),'MIN':_0xf63c('0x5a'),'AVG':_0xf63c('0x5b'),'GROUP_CONCAT':_0xf63c('0x5c'),'GROUP_CONCAT ASC':_0xf63c('0x5d'),'GROUP_CONCAT DESC':_0xf63c('0x5e')};var _0x32a8a9={'SEC_TO_TIME':_0xf63c('0x88'),'DATE':_0xf63c('0x5f'),'HOUR':_0xf63c('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xf63c('0x62')};var _0x5d9c69=function(_0x1bb4d7){return!_[_0xf63c('0x63')]([_0xf63c('0x89'),_0xf63c('0x64'),_0xf63c('0x65'),_0xf63c('0x8a')],_0x1bb4d7);};var _0x4ae6d5=function(_0x40b952){if(!_0x40b952||!_0x40b952['rules'][_0xf63c('0x66')]){return'';}for(var _0x48b3bb='(',_0x5613d6=0x0;_0x5613d6<_0x40b952[_0xf63c('0x68')][_0xf63c('0x66')];_0x5613d6+=0x1){_0x5613d6>0x0&&(_0x48b3bb+='\x20'+_0x40b952[_0xf63c('0x67')]+'\x20');_0x48b3bb+=_0x40b952[_0xf63c('0x68')][_0x5613d6][_0xf63c('0x69')]?_0x4ae6d5(_0x40b952[_0xf63c('0x68')][_0x5613d6]['group']):_0x40b952['rules'][_0x5613d6][_0xf63c('0x8b')]+'\x20'+_0x40b952[_0xf63c('0x68')][_0x5613d6][_0xf63c('0x6a')]+(_0x5d9c69(_0x40b952['rules'][_0x5613d6][_0xf63c('0x6a')])?'\x20'+_0x40b952[_0xf63c('0x68')][_0x5613d6][_0xf63c('0x6b')]:'');}return _0x48b3bb+')';};var _0x55d46d={'where':{'id':_0x164512['params']['id']}},_0x4bc093,_0x18e87c,_0xb7efc2,_0x3698bc,_0x4bf262;_0x55d46d=_[_0xf63c('0x40')]({},_0x55d46d,_0x164512[_0xf63c('0x44')]);return db[_0xf63c('0x32')][_0xf63c('0x4f')](_0x55d46d)[_0xf63c('0x29')](function(_0x4fd18a){if(_0x4fd18a){_0x4bc093=_0x4fd18a;return _0x4fd18a[_0xf63c('0x6c')]();}return null;})[_0xf63c('0x29')](function(_0x131d8a){if(_0x131d8a){if(!_0x131d8a[_0xf63c('0x66')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x18e87c=_0x131d8a;return db['AnalyticMetric'][_0xf63c('0x8d')]({'raw':!![]});}return null;})[_0xf63c('0x29')](function(_0x47ea38){if(_0x47ea38){_0xb7efc2=_['keyBy'](_0x47ea38,'id');var _0x5c9654;var _0x139e92=squel['select']();_0x139e92[_0xf63c('0x72')](_0x4bc093[_0xf63c('0x73')]);for(var _0x54db63=0x0;_0x54db63<_0x18e87c['length'];_0x54db63+=0x1){_0x5c9654=_0x18e87c[_0x54db63][_0xf63c('0x74')]?_0xb7efc2[_0x18e87c[_0x54db63][_0xf63c('0x74')]][_0xf63c('0x8e')]:_0x18e87c[_0x54db63][_0xf63c('0x8b')];_0x5c9654=_0x18e87c[_0x54db63][_0xf63c('0x76')]?_[_0xf63c('0x75')](_0x288c37[_0x18e87c[_0x54db63][_0xf63c('0x76')]],'%s',_0x5c9654):_0x5c9654;_0x5c9654=_0x18e87c[_0x54db63][_0xf63c('0x77')]?_[_0xf63c('0x75')](_0x32a8a9[_0x18e87c[_0x54db63][_0xf63c('0x77')]],'%s',_0x5c9654):_0x5c9654;if(_0x18e87c[_0x54db63][_0xf63c('0x8f')]){_0x139e92[_0xf63c('0x69')](_0x5c9654);}_0x18e87c[_0x54db63]['orderBy']&&_0x139e92[_0xf63c('0x3d')](_0x5c9654,_0x18e87c[_0x54db63]['orderBy']===_0xf63c('0xa5')?![]:!![]);_0x139e92['field'](_0x5c9654,_0x18e87c[_0x54db63][_0xf63c('0x79')]||_0x5c9654);}if(_0x4bc093[_0xf63c('0x7a')]){_0x4bc093[_0xf63c('0x7a')]=JSON[_0xf63c('0x7b')](_0x4bc093[_0xf63c('0x7a')]);for(var _0x5f3ea2=0x0;_0x5f3ea2<_0x4bc093['joins'][_0xf63c('0x66')];_0x5f3ea2+=0x1){if(_0x4bc093['joins'][_0x5f3ea2][_0xf63c('0x41')]&&_[_0xf63c('0x63')](_0x351536,_0x4bc093[_0xf63c('0x7a')][_0x5f3ea2][_0xf63c('0x41')])&&_0x4bc093[_0xf63c('0x7a')][_0x5f3ea2][_0xf63c('0x7c')]&&_0x4bc093[_0xf63c('0x7a')][_0x5f3ea2][_0xf63c('0x7d')]&&_0x4bc093['joins'][_0x5f3ea2][_0xf63c('0x7e')]){_0x139e92[_0x4bc093[_0xf63c('0x7a')][_0x5f3ea2]['type']](_0x4bc093['joins'][_0x5f3ea2][_0xf63c('0x7d')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x4bc093[_0xf63c('0x73')],_0x4bc093['joins'][_0x5f3ea2]['parentKey'],_0x4bc093[_0xf63c('0x7a')][_0x5f3ea2][_0xf63c('0x7d')],_0x4bc093[_0xf63c('0x7a')][_0x5f3ea2][_0xf63c('0x7e')]));}}}if(_0x4bc093[_0xf63c('0x80')]){_0x4bc093['conditions']=JSON[_0xf63c('0x7b')](_0x4bc093['conditions']);_0x139e92[_0xf63c('0x3f')](_0x4ae6d5(_0x4bc093['conditions'][_0xf63c('0x69')]));}_0x4bf262=_0x139e92[_0xf63c('0x81')]();_0x139e92[_0xf63c('0x21')](_0x2683dc);_0x139e92[_0xf63c('0x20')](0x0);logger[_0xf63c('0x82')](_0xf63c('0x83'),_0x139e92[_0xf63c('0x84')]());return dbH[_0xf63c('0x85')][_0xf63c('0x35')](_0x139e92[_0xf63c('0x84')](),{'type':dbH['sequelize'][_0xf63c('0x86')][_0xf63c('0x87')]});}})[_0xf63c('0x29')](function(){return{'sql':_0x4bf262[_0xf63c('0x84')]()};})[_0xf63c('0x29')](respondWithResult(_0x4592be,null))[_0xf63c('0x47')](handleError(_0x4592be,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 9c63bb0..b423774 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 _0x7803=['analytics_custom_reports','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x179351,_0x59cee4){var _0x11d0ec=function(_0x204a10){while(--_0x204a10){_0x179351['push'](_0x179351['shift']());}};_0x11d0ec(++_0x59cee4);}(_0x7803,0x1b1));var _0x3780=function(_0x3b2d4f,_0x1ebc96){_0x3b2d4f=_0x3b2d4f-0x0;var _0x4babfb=_0x7803[_0x3b2d4f];return _0x4babfb;};'use strict';var _=require(_0x3780('0x0'));var util=require(_0x3780('0x1'));var logger=require(_0x3780('0x2'))(_0x3780('0x3'));var moment=require(_0x3780('0x4'));var BPromise=require('bluebird');var rp=require(_0x3780('0x5'));var fs=require('fs');var path=require(_0x3780('0x6'));var rimraf=require('rimraf');var config=require(_0x3780('0x7'));var attributes=require(_0x3780('0x8'));module[_0x3780('0x9')]=function(_0x4197da,_0x5759f3){return _0x4197da[_0x3780('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0x3780('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0226=['moment','bluebird','request-promise','path','rimraf','define','AnalyticCustomReport','analytics_custom_reports','lodash','api'];(function(_0x96a34a,_0x48b3c6){var _0x4e325e=function(_0x20e343){while(--_0x20e343){_0x96a34a['push'](_0x96a34a['shift']());}};_0x4e325e(++_0x48b3c6);}(_0x0226,0x1ca));var _0x6022=function(_0x3aaf97,_0x4fa2e8){_0x3aaf97=_0x3aaf97-0x0;var _0xeba75e=_0x0226[_0x3aaf97];return _0xeba75e;};'use strict';var _=require(_0x6022('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6022('0x1'));var moment=require(_0x6022('0x2'));var BPromise=require(_0x6022('0x3'));var rp=require(_0x6022('0x4'));var fs=require('fs');var path=require(_0x6022('0x5'));var rimraf=require(_0x6022('0x6'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x1d8d1d,_0x95bcaf){return _0x1d8d1d[_0x6022('0x7')](_0x6022('0x8'),attributes,{'tableName':_0x6022('0x9'),'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 f88a177..0c2e2d9 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 _0x3be1=['AnalyticCustomReport,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x3be1,0x1bd));var _0x13be=function(_0x2b3f39,_0x137ea5){_0x2b3f39=_0x2b3f39-0x0;var _0x16b06f=_0x3be1[_0x2b3f39];return _0x16b06f;};'use strict';var _=require('lodash');var util=require(_0x13be('0x0'));var moment=require(_0x13be('0x1'));var BPromise=require(_0x13be('0x2'));var rs=require(_0x13be('0x3'));var fs=require('fs');var Redis=require(_0x13be('0x4'));var db=require(_0x13be('0x5'))['db'];var utils=require(_0x13be('0x6'));var logger=require(_0x13be('0x7'))(_0x13be('0x8'));var config=require('../../config/environment');var jayson=require(_0x13be('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b6fa2,_0x2105c8,_0x44ef7b){return new BPromise(function(_0x53d160,_0x141d88){return client['request'](_0x5b6fa2,_0x44ef7b)['then'](function(_0x4e015c){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x2105c8,_0x13be('0xa'));logger['debug'](_0x13be('0xb'),_0x2105c8,_0x13be('0xa'),JSON[_0x13be('0xc')](_0x4e015c));if(_0x4e015c[_0x13be('0xd')]){if(_0x4e015c['error'][_0x13be('0xe')]===0x1f4){logger[_0x13be('0xd')](_0x13be('0xf'),_0x2105c8,_0x4e015c[_0x13be('0xd')][_0x13be('0x10')]);return _0x141d88(_0x4e015c[_0x13be('0xd')][_0x13be('0x10')]);}logger[_0x13be('0xd')](_0x13be('0xf'),_0x2105c8,_0x4e015c[_0x13be('0xd')]['message']);return _0x53d160(_0x4e015c[_0x13be('0xd')][_0x13be('0x10')]);}else{logger[_0x13be('0x11')](_0x13be('0xf'),_0x2105c8,_0x13be('0xa'));_0x53d160(_0x4e015c[_0x13be('0x12')][_0x13be('0x10')]);}})[_0x13be('0x13')](function(_0x40771e){logger[_0x13be('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2105c8,_0x40771e);_0x141d88(_0x40771e);});});} \ No newline at end of file +var _0x43e2=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x247f3f,_0x5f298e){var _0x1381e6=function(_0x1e8355){while(--_0x1e8355){_0x247f3f['push'](_0x247f3f['shift']());}};_0x1381e6(++_0x5f298e);}(_0x43e2,0x14c));var _0x243e=function(_0x588011,_0x5e9d11){_0x588011=_0x588011-0x0;var _0x3b3773=_0x43e2[_0x588011];return _0x3b3773;};'use strict';var _=require(_0x243e('0x0'));var util=require(_0x243e('0x1'));var moment=require(_0x243e('0x2'));var BPromise=require('bluebird');var rs=require(_0x243e('0x3'));var fs=require('fs');var Redis=require(_0x243e('0x4'));var db=require(_0x243e('0x5'))['db'];var utils=require(_0x243e('0x6'));var logger=require(_0x243e('0x7'))(_0x243e('0x8'));var config=require('../../config/environment');var jayson=require(_0x243e('0x9'));var client=jayson[_0x243e('0xa')][_0x243e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x228eed,_0x56fbe7,_0x4a38ed){return new BPromise(function(_0xc34a53,_0xd6f0a7){return client[_0x243e('0xc')](_0x228eed,_0x4a38ed)[_0x243e('0xd')](function(_0x417003){logger[_0x243e('0xe')](_0x243e('0xf'),_0x56fbe7,'request\x20sent');logger['debug'](_0x243e('0x10'),_0x56fbe7,_0x243e('0x11'),JSON[_0x243e('0x12')](_0x417003));if(_0x417003['error']){if(_0x417003[_0x243e('0x13')][_0x243e('0x14')]===0x1f4){logger[_0x243e('0x13')](_0x243e('0xf'),_0x56fbe7,_0x417003[_0x243e('0x13')]['message']);return _0xd6f0a7(_0x417003[_0x243e('0x13')][_0x243e('0x15')]);}logger[_0x243e('0x13')](_0x243e('0xf'),_0x56fbe7,_0x417003[_0x243e('0x13')]['message']);return _0xc34a53(_0x417003[_0x243e('0x13')][_0x243e('0x15')]);}else{logger[_0x243e('0xe')](_0x243e('0xf'),_0x56fbe7,_0x243e('0x11'));_0xc34a53(_0x417003[_0x243e('0x16')]['message']);}})[_0x243e('0x17')](function(_0x5179d8){logger[_0x243e('0x13')](_0x243e('0xf'),_0x56fbe7,_0x5179d8);_0xd6f0a7(_0x5179d8);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 2b089eb..51e373e 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 _0x0b45=['create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/preview','isAuthenticated','preview','/:id/run','run','/:id/query','query','post'];(function(_0x3db456,_0x3b93b5){var _0x2402a1=function(_0x3ae218){while(--_0x3ae218){_0x3db456['push'](_0x3db456['shift']());}};_0x2402a1(++_0x3b93b5);}(_0x0b45,0xb3));var _0x50b4=function(_0x4b5a95,_0x4b046c){_0x4b5a95=_0x4b5a95-0x0;var _0x28d360=_0x0b45[_0x4b5a95];return _0x28d360;};'use strict';var multer=require(_0x50b4('0x0'));var util=require(_0x50b4('0x1'));var path=require(_0x50b4('0x2'));var timeout=require(_0x50b4('0x3'));var express=require(_0x50b4('0x4'));var router=express[_0x50b4('0x5')]();var fs_extra=require(_0x50b4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x50b4('0x7'));var config=require(_0x50b4('0x8'));var controller=require('./analyticCustomReport.controller');router[_0x50b4('0x9')]('/',auth['isAuthenticated'](),controller[_0x50b4('0xa')]);router[_0x50b4('0x9')](_0x50b4('0xb'),auth['isAuthenticated'](),controller[_0x50b4('0xc')]);router[_0x50b4('0x9')](_0x50b4('0xd'),auth[_0x50b4('0xe')](),controller[_0x50b4('0xf')]);router[_0x50b4('0x9')](_0x50b4('0x10'),auth['isAuthenticated'](),controller[_0x50b4('0x11')]);router[_0x50b4('0x9')](_0x50b4('0x12'),auth[_0x50b4('0xe')](),controller[_0x50b4('0x13')]);router[_0x50b4('0x14')]('/',auth[_0x50b4('0xe')](),controller[_0x50b4('0x15')]);router['put'](_0x50b4('0xb'),auth[_0x50b4('0xe')](),controller[_0x50b4('0x16')]);router[_0x50b4('0x17')]('/:id',auth[_0x50b4('0xe')](),controller[_0x50b4('0x18')]);module['exports']=router; \ No newline at end of file +var _0x6d63=['./analyticCustomReport.controller','get','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x59e903,_0x303626){var _0x21e3f6=function(_0x4c304d){while(--_0x4c304d){_0x59e903['push'](_0x59e903['shift']());}};_0x21e3f6(++_0x303626);}(_0x6d63,0x89));var _0x36d6=function(_0x4759c3,_0x24f58a){_0x4759c3=_0x4759c3-0x0;var _0xac8def=_0x6d63[_0x4759c3];return _0xac8def;};'use strict';var multer=require(_0x36d6('0x0'));var util=require(_0x36d6('0x1'));var path=require(_0x36d6('0x2'));var timeout=require(_0x36d6('0x3'));var express=require('express');var router=express[_0x36d6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x36d6('0x5'));var config=require(_0x36d6('0x6'));var controller=require(_0x36d6('0x7'));router[_0x36d6('0x8')]('/',auth[_0x36d6('0x9')](),controller['index']);router['get']('/:id',auth[_0x36d6('0x9')](),controller[_0x36d6('0xa')]);router['get'](_0x36d6('0xb'),auth[_0x36d6('0x9')](),controller[_0x36d6('0xc')]);router['get'](_0x36d6('0xd'),auth[_0x36d6('0x9')](),controller[_0x36d6('0xe')]);router[_0x36d6('0x8')](_0x36d6('0xf'),auth[_0x36d6('0x9')](),controller[_0x36d6('0x10')]);router[_0x36d6('0x11')]('/',auth[_0x36d6('0x9')](),controller['create']);router[_0x36d6('0x12')](_0x36d6('0x13'),auth[_0x36d6('0x9')](),controller[_0x36d6('0x14')]);router[_0x36d6('0x15')](_0x36d6('0x13'),auth['isAuthenticated'](),controller[_0x36d6('0x16')]);module[_0x36d6('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 7b44de4..9f42aa7 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 _0x5d58=['TEXT','STRING'];(function(_0x3e1740,_0x46f1b6){var _0x507cb0=function(_0x5afe84){while(--_0x5afe84){_0x3e1740['push'](_0x3e1740['shift']());}};_0x507cb0(++_0x46f1b6);}(_0x5d58,0x187));var _0x85d5=function(_0x121325,_0x47ec9a){_0x121325=_0x121325-0x0;var _0x1c5f43=_0x5d58[_0x121325];return _0x1c5f43;};'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 +var _0xb4c7=['STRING','TEXT','sequelize','exports'];(function(_0x16eb11,_0x1a2251){var _0x3ae7ef=function(_0x575a01){while(--_0x575a01){_0x16eb11['push'](_0x16eb11['shift']());}};_0x3ae7ef(++_0x1a2251);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x4ea754,_0x1659ec){_0x4ea754=_0x4ea754-0x0;var _0x26a3cd=_0xb4c7[_0x4ea754];return _0x26a3cd;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'name':{'type':Sequelize[_0x7b4c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7b4c('0x2')]},'parent':{'type':Sequelize[_0x7b4c('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7b4c('0x3')]},'joins':{'type':Sequelize[_0x7b4c('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 5df5bf3..6e8bf0c 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 _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x3088cb,_0x3de8ad){var _0x1fb9f3=function(_0x44e19a){while(--_0x44e19a){_0x3088cb['push'](_0x3088cb['shift']());}};_0x1fb9f3(++_0x3de8ad);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5b4f01,_0x2d4c06){_0x5b4f01=_0x5b4f01-0x0;var _0xf8df07=_0x1cb9[_0x5b4f01];return _0xf8df07;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,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(_0x9ac89b,_0x25b61d){var _0x40da74=function(_0x2643a2){while(--_0x2643a2){_0x9ac89b['push'](_0x9ac89b['shift']());}};_0x40da74(++_0x25b61d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xc4aa[_0x5f09c5];return _0x426ad9;};'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 5230690..323c327 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 _0x3272=['exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes'];(function(_0x4f6c8d,_0x5dab1f){var _0x322d13=function(_0x1805b9){while(--_0x1805b9){_0x4f6c8d['push'](_0x4f6c8d['shift']());}};_0x322d13(++_0x5dab1f);}(_0x3272,0x70));var _0x2327=function(_0x3671e7,_0x212b07){_0x3671e7=_0x3671e7-0x0;var _0x10bfc0=_0x3272[_0x3671e7];return _0x10bfc0;};'use strict';var _=require(_0x2327('0x0'));var util=require('util');var logger=require(_0x2327('0x1'))(_0x2327('0x2'));var moment=require('moment');var BPromise=require(_0x2327('0x3'));var rp=require(_0x2327('0x4'));var fs=require('fs');var path=require(_0x2327('0x5'));var rimraf=require(_0x2327('0x6'));var config=require('../../config/environment');var attributes=require(_0x2327('0x7'));module[_0x2327('0x8')]=function(_0x4d946e,_0x470137){return _0x4d946e[_0x2327('0x9')](_0x2327('0xa'),attributes,{'tableName':_0x2327('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae18=['./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x3c44fd,_0x4eb40d){var _0x1d49bb=function(_0x44adc5){while(--_0x44adc5){_0x3c44fd['push'](_0x3c44fd['shift']());}};_0x1d49bb(++_0x4eb40d);}(_0xae18,0x165));var _0x8ae1=function(_0x4fda72,_0x3aa0d3){_0x4fda72=_0x4fda72-0x0;var _0x1cc54a=_0xae18[_0x4fda72];return _0x1cc54a;};'use strict';var _=require('lodash');var util=require(_0x8ae1('0x0'));var logger=require(_0x8ae1('0x1'))(_0x8ae1('0x2'));var moment=require(_0x8ae1('0x3'));var BPromise=require('bluebird');var rp=require(_0x8ae1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ae1('0x5'));var config=require('../../config/environment');var attributes=require(_0x8ae1('0x6'));module[_0x8ae1('0x7')]=function(_0x1976f1,_0x1ea765){return _0x1976f1[_0x8ae1('0x8')](_0x8ae1('0x9'),attributes,{'tableName':_0x8ae1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 14372c8..18175ba 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 _0xb55b=['info','request\x20sent','debug','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0xb55b,0x1d7));var _0xbb55=function(_0xa8b074,_0xeabb35){_0xa8b074=_0xa8b074-0x0;var _0x41f89e=_0xb55b[_0xa8b074];return _0x41f89e;};'use strict';var _=require(_0xbb55('0x0'));var util=require(_0xbb55('0x1'));var moment=require(_0xbb55('0x2'));var BPromise=require(_0xbb55('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb55('0x4'))['db'];var utils=require(_0xbb55('0x5'));var logger=require(_0xbb55('0x6'))(_0xbb55('0x7'));var config=require(_0xbb55('0x8'));var jayson=require(_0xbb55('0x9'));var client=jayson[_0xbb55('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x233c90,_0x341aa6,_0x19dc98){return new BPromise(function(_0x4395a5,_0x253361){return client['request'](_0x233c90,_0x19dc98)[_0xbb55('0xb')](function(_0x41919e){logger[_0xbb55('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x341aa6,_0xbb55('0xd'));logger[_0xbb55('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x341aa6,_0xbb55('0xd'),JSON[_0xbb55('0xf')](_0x41919e));if(_0x41919e[_0xbb55('0x10')]){if(_0x41919e[_0xbb55('0x10')][_0xbb55('0x11')]===0x1f4){logger[_0xbb55('0x10')](_0xbb55('0x12'),_0x341aa6,_0x41919e[_0xbb55('0x10')][_0xbb55('0x13')]);return _0x253361(_0x41919e[_0xbb55('0x10')][_0xbb55('0x13')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x341aa6,_0x41919e['error'][_0xbb55('0x13')]);return _0x4395a5(_0x41919e[_0xbb55('0x10')][_0xbb55('0x13')]);}else{logger[_0xbb55('0xc')](_0xbb55('0x12'),_0x341aa6,_0xbb55('0xd'));_0x4395a5(_0x41919e['result']['message']);}})[_0xbb55('0x14')](function(_0x252856){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x341aa6,_0x252856);_0x253361(_0x252856);});});} \ No newline at end of file +var _0xdb04=['error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1ad901,_0x852d9e){var _0x3c0249=function(_0x319eda){while(--_0x319eda){_0x1ad901['push'](_0x1ad901['shift']());}};_0x3c0249(++_0x852d9e);}(_0xdb04,0x1cf));var _0x4db0=function(_0x5238b4,_0x3df4d6){_0x5238b4=_0x5238b4-0x0;var _0x317074=_0xdb04[_0x5238b4];return _0x317074;};'use strict';var _=require(_0x4db0('0x0'));var util=require(_0x4db0('0x1'));var moment=require(_0x4db0('0x2'));var BPromise=require(_0x4db0('0x3'));var rs=require(_0x4db0('0x4'));var fs=require('fs');var Redis=require(_0x4db0('0x5'));var db=require(_0x4db0('0x6'))['db'];var utils=require(_0x4db0('0x7'));var logger=require(_0x4db0('0x8'))(_0x4db0('0x9'));var config=require(_0x4db0('0xa'));var jayson=require(_0x4db0('0xb'));var client=jayson[_0x4db0('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36fe26,_0x5b593a,_0x3302f9){return new BPromise(function(_0x595542,_0x380e9b){return client[_0x4db0('0xd')](_0x36fe26,_0x3302f9)['then'](function(_0x175135){logger[_0x4db0('0xe')](_0x4db0('0xf'),_0x5b593a,_0x4db0('0x10'));logger[_0x4db0('0x11')](_0x4db0('0x12'),_0x5b593a,_0x4db0('0x10'),JSON[_0x4db0('0x13')](_0x175135));if(_0x175135[_0x4db0('0x14')]){if(_0x175135[_0x4db0('0x14')][_0x4db0('0x15')]===0x1f4){logger[_0x4db0('0x14')](_0x4db0('0xf'),_0x5b593a,_0x175135[_0x4db0('0x14')]['message']);return _0x380e9b(_0x175135[_0x4db0('0x14')][_0x4db0('0x16')]);}logger[_0x4db0('0x14')](_0x4db0('0xf'),_0x5b593a,_0x175135[_0x4db0('0x14')][_0x4db0('0x16')]);return _0x595542(_0x175135[_0x4db0('0x14')][_0x4db0('0x16')]);}else{logger[_0x4db0('0xe')](_0x4db0('0xf'),_0x5b593a,_0x4db0('0x10'));_0x595542(_0x175135['result'][_0x4db0('0x16')]);}})['catch'](function(_0xaec10a){logger[_0x4db0('0x14')](_0x4db0('0xf'),_0x5b593a,_0xaec10a);_0x380e9b(_0xaec10a);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 14c75d0..67cbefb 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 _0xdf7c=['/:id','isAuthenticated','/:id/preview','run','/:id/query','query','post','create','update','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','get','index'];(function(_0x484c5c,_0x5d67b2){var _0x1b8928=function(_0xdfcff4){while(--_0xdfcff4){_0x484c5c['push'](_0x484c5c['shift']());}};_0x1b8928(++_0x5d67b2);}(_0xdf7c,0x149));var _0xcdf7=function(_0x310a1b,_0x4c9129){_0x310a1b=_0x310a1b-0x0;var _0xdea206=_0xdf7c[_0x310a1b];return _0xdea206;};'use strict';var multer=require('multer');var util=require(_0xcdf7('0x0'));var path=require(_0xcdf7('0x1'));var timeout=require(_0xcdf7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcdf7('0x3'));var interaction=require(_0xcdf7('0x4'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0xcdf7('0x5')]('/',auth['isAuthenticated'](),controller[_0xcdf7('0x6')]);router['get'](_0xcdf7('0x7'),auth[_0xcdf7('0x8')](),controller['show']);router[_0xcdf7('0x5')](_0xcdf7('0x9'),auth[_0xcdf7('0x8')](),controller['preview']);router[_0xcdf7('0x5')]('/:id/run',auth[_0xcdf7('0x8')](),controller[_0xcdf7('0xa')]);router[_0xcdf7('0x5')](_0xcdf7('0xb'),auth['isAuthenticated'](),controller[_0xcdf7('0xc')]);router[_0xcdf7('0xd')]('/',auth[_0xcdf7('0x8')](),controller[_0xcdf7('0xe')]);router['put'](_0xcdf7('0x7'),auth[_0xcdf7('0x8')](),controller[_0xcdf7('0xf')]);router['delete'](_0xcdf7('0x7'),auth[_0xcdf7('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x18ec=['post','create','put','update','delete','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','/:id/run','run','/:id/query','query'];(function(_0x2df2b5,_0x50fe36){var _0x4755a0=function(_0x164939){while(--_0x164939){_0x2df2b5['push'](_0x2df2b5['shift']());}};_0x4755a0(++_0x50fe36);}(_0x18ec,0xf7));var _0xc18e=function(_0x512600,_0x44c3b4){_0x512600=_0x512600-0x0;var _0x317eb5=_0x18ec[_0x512600];return _0x317eb5;};'use strict';var multer=require('multer');var util=require(_0xc18e('0x0'));var path=require('path');var timeout=require(_0xc18e('0x1'));var express=require(_0xc18e('0x2'));var router=express[_0xc18e('0x3')]();var fs_extra=require(_0xc18e('0x4'));var auth=require(_0xc18e('0x5'));var interaction=require(_0xc18e('0x6'));var config=require(_0xc18e('0x7'));var controller=require(_0xc18e('0x8'));router[_0xc18e('0x9')]('/',auth['isAuthenticated'](),controller[_0xc18e('0xa')]);router[_0xc18e('0x9')](_0xc18e('0xb'),auth[_0xc18e('0xc')](),controller['show']);router[_0xc18e('0x9')]('/:id/preview',auth['isAuthenticated'](),controller['preview']);router[_0xc18e('0x9')](_0xc18e('0xd'),auth[_0xc18e('0xc')](),controller[_0xc18e('0xe')]);router['get'](_0xc18e('0xf'),auth[_0xc18e('0xc')](),controller[_0xc18e('0x10')]);router[_0xc18e('0x11')]('/',auth[_0xc18e('0xc')](),controller[_0xc18e('0x12')]);router[_0xc18e('0x13')](_0xc18e('0xb'),auth[_0xc18e('0xc')](),controller[_0xc18e('0x14')]);router[_0xc18e('0x15')]('/:id',auth[_0xc18e('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index e0051d5..224b834 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 _0x5162=['pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','csv'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5162,0x7d));var _0x2516=function(_0x2d6df9,_0x45da50){_0x2d6df9=_0x2d6df9-0x0;var _0x429b18=_0x5162[_0x2d6df9];return _0x429b18;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2516('0x0'));module[_0x2516('0x1')]={'name':{'type':Sequelize[_0x2516('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x2516('0x3')](_0x2516('0x4'),_0x2516('0x5'),_0x2516('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x2516('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x2516('0x7')]},'endDate':{'type':Sequelize[_0x2516('0x7')]},'status':{'type':Sequelize[_0x2516('0x2')],'defaultValue':_0x2516('0x8')},'type':{'type':Sequelize[_0x2516('0x3')](_0x2516('0x9'),_0x2516('0xa')),'allowNull':![],'defaultValue':_0x2516('0x9')},'reportId':{'type':Sequelize[_0x2516('0xb')](0xb)[_0x2516('0xc')]},'reportType':{'type':Sequelize[_0x2516('0x2')]}}; \ No newline at end of file +var _0x77fe=['manual','INTEGER','sequelize','moment','exports','csv','pdf','STRING','DATE','scheduled'];(function(_0x5392af,_0x45123c){var _0xc025c5=function(_0x4d0dab){while(--_0x4d0dab){_0x5392af['push'](_0x5392af['shift']());}};_0xc025c5(++_0x45123c);}(_0x77fe,0x110));var _0xe77f=function(_0x1c3e2f,_0x14f882){_0x1c3e2f=_0x1c3e2f-0x0;var _0x36e8a7=_0x77fe[_0x1c3e2f];return _0x36e8a7;};'use strict';var Sequelize=require(_0xe77f('0x0'));var moment=require(_0xe77f('0x1'));module[_0xe77f('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xe77f('0x3'),_0xe77f('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0xe77f('0x3')},'savename':{'type':Sequelize[_0xe77f('0x5')],'allowNull':![]},'startDate':{'type':Sequelize[_0xe77f('0x6')]},'endDate':{'type':Sequelize[_0xe77f('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM']('manual',_0xe77f('0x7')),'allowNull':![],'defaultValue':_0xe77f('0x8')},'reportId':{'type':Sequelize[_0xe77f('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xe77f('0x5')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 8297d33..85b3972 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 _0xc56a=['json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','then','error','stack','name','map','AnalyticExtractedReport','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','%s.%s','basename','toLowerCase','rimraf','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/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status'];(function(_0x3e14bf,_0x19c6ee){var _0x2efa39=function(_0x5f4231){while(--_0x5f4231){_0x3e14bf['push'](_0x3e14bf['shift']());}};_0x2efa39(++_0x19c6ee);}(_0xc56a,0xff));var _0xac56=function(_0x499e75,_0x2f89e3){_0x499e75=_0x499e75-0x0;var _0x24834d=_0xc56a[_0x499e75];return _0x24834d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xac56('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xac56('0x1'));var moment=require(_0xac56('0x2'));var BPromise=require(_0xac56('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xac56('0x4'));var sox=require(_0xac56('0x5'));var csv=require(_0xac56('0x6'));var ejs=require(_0xac56('0x7'));var fs=require('fs');var fs_extra=require(_0xac56('0x8'));var _=require(_0xac56('0x9'));var squel=require(_0xac56('0xa'));var crypto=require(_0xac56('0xb'));var jsforce=require(_0xac56('0xc'));var deskjs=require(_0xac56('0xd'));var toCsv=require(_0xac56('0x6'));var querystring=require(_0xac56('0xe'));var Papa=require(_0xac56('0xf'));var Redis=require(_0xac56('0x10'));var authService=require(_0xac56('0x11'));var qs=require(_0xac56('0x12'));var as=require(_0xac56('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac56('0x14'))(_0xac56('0x15'));var utils=require('../../config/utils');var config=require(_0xac56('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xac56('0x17'))['db'];function respondWithStatusCode(_0x5b7e93,_0xc9058){_0xc9058=_0xc9058||0xcc;return function(_0xf18ef0){if(_0xf18ef0){return _0x5b7e93[_0xac56('0x18')](_0xc9058);}return _0x5b7e93['status'](_0xc9058)[_0xac56('0x19')]();};}function respondWithResult(_0x5ee8aa,_0x1145d8){_0x1145d8=_0x1145d8||0xc8;return function(_0x431800){if(_0x431800){return _0x5ee8aa[_0xac56('0x1a')](_0x1145d8)[_0xac56('0x1b')](_0x431800);}};}function respondWithFilteredResult(_0x277263,_0x447274){return function(_0x2b2395){if(_0x2b2395){var _0x68a377=typeof _0x447274['offset']===_0xac56('0x1c')&&typeof _0x447274[_0xac56('0x1d')]===_0xac56('0x1c');var _0x506c87=_0x2b2395[_0xac56('0x1e')];var _0x470bae=_0x68a377?0x0:_0x447274[_0xac56('0x1f')];var _0x1b1e6a=_0x68a377?_0x2b2395[_0xac56('0x1e')]:_0x447274[_0xac56('0x1f')]+_0x447274[_0xac56('0x1d')];var _0xd72f01;if(_0x1b1e6a>=_0x506c87){_0x1b1e6a=_0x506c87;_0xd72f01=0xc8;}else{_0xd72f01=0xce;}_0x277263[_0xac56('0x1a')](_0xd72f01);return _0x277263[_0xac56('0x20')](_0xac56('0x21'),_0x470bae+'-'+_0x1b1e6a+'/'+_0x506c87)[_0xac56('0x1b')](_0x2b2395);}return null;};}function patchUpdates(_0x525b93){return function(_0x17bc60){try{jsonpatch[_0xac56('0x22')](_0x17bc60,_0x525b93,!![]);}catch(_0x15f278){return BPromise[_0xac56('0x23')](_0x15f278);}return _0x17bc60[_0xac56('0x24')]();};}function saveUpdates(_0x52af78,_0x3f725b){return function(_0x507445){if(_0x507445){return _0x507445[_0xac56('0x25')](_0x52af78)['then'](function(_0x30cc2e){return _0x30cc2e;});}return null;};}function removeEntity(_0x4b7ee2,_0x3b51f0){return function(_0x25dfca){if(_0x25dfca){return _0x25dfca[_0xac56('0x26')]()['then'](function(){var _0x4b1514=_0x25dfca[_0xac56('0x27')]({'plain':!![]});var _0x348d89='ExtractedReports';return db['UserProfileResource']['destroy']({'where':{'type':_0x348d89,'resourceId':_0x4b1514['id']}})[_0xac56('0x28')](function(){return _0x25dfca;});})[_0xac56('0x28')](function(){_0x4b7ee2[_0xac56('0x1a')](0xcc)[_0xac56('0x19')]();});}};}function handleEntityNotFound(_0x177879,_0x351c07){return function(_0xdd34a1){if(!_0xdd34a1){_0x177879['sendStatus'](0x194);}return _0xdd34a1;};}function handleError(_0x93e866,_0x2bfb8f){_0x2bfb8f=_0x2bfb8f||0x1f4;return function(_0x3d77d0){logger[_0xac56('0x29')](_0x3d77d0[_0xac56('0x2a')]);if(_0x3d77d0[_0xac56('0x2b')]){delete _0x3d77d0[_0xac56('0x2b')];}_0x93e866['status'](_0x2bfb8f)['send'](_0x3d77d0);};}exports['index']=function(_0x4b4781,_0x45494f){var _0x5e4ad2={},_0x5c5ab3={},_0x294bd2={'count':0x0,'rows':[]};var _0x44c0d6=_[_0xac56('0x2c')](db[_0xac56('0x2d')][_0xac56('0x2e')],function(_0x4b37c4){return{'name':_0x4b37c4[_0xac56('0x2f')],'type':_0x4b37c4['type'][_0xac56('0x30')]};});_0x5c5ab3['model']=_['map'](_0x44c0d6,'name');_0x5c5ab3[_0xac56('0x31')]=_[_0xac56('0x32')](_0x4b4781['query']);_0x5c5ab3[_0xac56('0x33')]=_[_0xac56('0x34')](_0x5c5ab3['model'],_0x5c5ab3[_0xac56('0x31')]);_0x5e4ad2[_0xac56('0x35')]=_[_0xac56('0x34')](_0x5c5ab3[_0xac56('0x36')],qs[_0xac56('0x37')](_0x4b4781[_0xac56('0x31')][_0xac56('0x37')]));_0x5e4ad2['attributes']=_0x5e4ad2['attributes'][_0xac56('0x38')]?_0x5e4ad2['attributes']:_0x5c5ab3[_0xac56('0x36')];if(!_0x4b4781[_0xac56('0x31')]['hasOwnProperty'](_0xac56('0x39'))){_0x5e4ad2[_0xac56('0x1d')]=qs[_0xac56('0x1d')](_0x4b4781['query'][_0xac56('0x1d')]);_0x5e4ad2[_0xac56('0x1f')]=qs[_0xac56('0x1f')](_0x4b4781['query'][_0xac56('0x1f')]);}_0x5e4ad2[_0xac56('0x3a')]=qs['sort'](_0x4b4781[_0xac56('0x31')][_0xac56('0x3b')]);_0x5e4ad2[_0xac56('0x3c')]=qs[_0xac56('0x33')](_[_0xac56('0x3d')](_0x4b4781[_0xac56('0x31')],_0x5c5ab3[_0xac56('0x33')]),_0x44c0d6);if(_0x4b4781[_0xac56('0x31')][_0xac56('0x3e')]){_0x5e4ad2[_0xac56('0x3c')]=_[_0xac56('0x3f')](_0x5e4ad2[_0xac56('0x3c')],{'$or':_[_0xac56('0x2c')](_0x44c0d6,function(_0x51e132){if(_0x51e132['type']!=='VIRTUAL'){var _0x13d50e={};_0x13d50e[_0x51e132[_0xac56('0x2b')]]={'$like':'%'+_0x4b4781[_0xac56('0x31')]['filter']+'%'};return _0x13d50e;}})});}_0x5e4ad2=_[_0xac56('0x3f')]({},_0x5e4ad2,_0x4b4781[_0xac56('0x40')]);var _0xd8a37f={'where':_0x5e4ad2['where']};return db[_0xac56('0x2d')][_0xac56('0x1e')](_0xd8a37f)[_0xac56('0x28')](function(_0x17d803){_0x294bd2[_0xac56('0x1e')]=_0x17d803;if(_0x4b4781['query'][_0xac56('0x41')]){_0x5e4ad2[_0xac56('0x42')]=[{'all':!![]}];}return db[_0xac56('0x2d')]['findAll'](_0x5e4ad2);})[_0xac56('0x28')](function(_0x2a4c9a){_0x294bd2['rows']=_0x2a4c9a;return _0x294bd2;})[_0xac56('0x28')](respondWithFilteredResult(_0x45494f,_0x5e4ad2))[_0xac56('0x43')](handleError(_0x45494f,null));};exports['show']=function(_0x44f31b,_0x401567){var _0x1399b1={'raw':!![],'where':{'id':_0x44f31b[_0xac56('0x44')]['id']}},_0xdc62cd={};_0xdc62cd[_0xac56('0x36')]=_[_0xac56('0x32')](db[_0xac56('0x2d')]['rawAttributes']);_0xdc62cd[_0xac56('0x31')]=_[_0xac56('0x32')](_0x44f31b[_0xac56('0x31')]);_0xdc62cd['filters']=_['intersection'](_0xdc62cd['model'],_0xdc62cd[_0xac56('0x31')]);_0x1399b1[_0xac56('0x35')]=_[_0xac56('0x34')](_0xdc62cd[_0xac56('0x36')],qs[_0xac56('0x37')](_0x44f31b[_0xac56('0x31')][_0xac56('0x37')]));_0x1399b1[_0xac56('0x35')]=_0x1399b1['attributes']['length']?_0x1399b1[_0xac56('0x35')]:_0xdc62cd[_0xac56('0x36')];if(_0x44f31b[_0xac56('0x31')][_0xac56('0x41')]){_0x1399b1[_0xac56('0x42')]=[{'all':!![]}];}_0x1399b1=_[_0xac56('0x3f')]({},_0x1399b1,_0x44f31b['options']);return db[_0xac56('0x2d')][_0xac56('0x45')](_0x1399b1)['then'](handleEntityNotFound(_0x401567,null))[_0xac56('0x28')](respondWithResult(_0x401567,null))[_0xac56('0x43')](handleError(_0x401567,null));};exports[_0xac56('0x46')]=function(_0x40c512,_0x5a132e){return db[_0xac56('0x2d')][_0xac56('0x46')](_0x40c512[_0xac56('0x47')],{})[_0xac56('0x28')](function(_0x2023e7){var _0x3878bf=_0x40c512[_0xac56('0x48')][_0xac56('0x27')]({'plain':!![]});if(!_0x3878bf)throw new Error(_0xac56('0x49'));if(_0x3878bf[_0xac56('0x4a')]===_0xac56('0x48')){var _0x3ebfa5=_0x2023e7[_0xac56('0x27')]({'plain':!![]});var _0x50069a=_0xac56('0x4b');return db[_0xac56('0x4c')][_0xac56('0x45')]({'where':{'name':_0x50069a,'userProfileId':_0x3878bf['userProfileId']},'raw':!![]})['then'](function(_0xa4c4a8){if(_0xa4c4a8&&_0xa4c4a8[_0xac56('0x4d')]===0x0){return db[_0xac56('0x4e')][_0xac56('0x46')]({'name':_0x3ebfa5[_0xac56('0x2b')],'resourceId':_0x3ebfa5['id'],'type':_0xa4c4a8[_0xac56('0x2b')],'sectionId':_0xa4c4a8['id']},{})[_0xac56('0x28')](function(){return _0x2023e7;});}else{return _0x2023e7;}})[_0xac56('0x43')](function(_0x3d68f1){logger['error'](_0xac56('0x4f'),_0x3d68f1);throw _0x3d68f1;});}return _0x2023e7;})[_0xac56('0x28')](respondWithResult(_0x5a132e,0xc9))[_0xac56('0x43')](handleError(_0x5a132e,null));};exports[_0xac56('0x25')]=function(_0x2dfbb4,_0x543eca){if(_0x2dfbb4[_0xac56('0x47')]['id']){delete _0x2dfbb4[_0xac56('0x47')]['id'];}return db['AnalyticExtractedReport'][_0xac56('0x45')]({'where':{'id':_0x2dfbb4[_0xac56('0x44')]['id']}})[_0xac56('0x28')](handleEntityNotFound(_0x543eca,null))[_0xac56('0x28')](saveUpdates(_0x2dfbb4['body'],null))[_0xac56('0x28')](respondWithResult(_0x543eca,null))[_0xac56('0x43')](handleError(_0x543eca,null));};exports[_0xac56('0x26')]=function(_0x85c1bc,_0x3f4915){return db['AnalyticExtractedReport'][_0xac56('0x45')]({'where':{'id':_0x85c1bc['params']['id']}})['then'](handleEntityNotFound(_0x3f4915,null))[_0xac56('0x28')](removeEntity(_0x3f4915,null))[_0xac56('0x43')](handleError(_0x3f4915,null));};exports['download']=function(_0x4767bc,_0x2a19fd,_0x2fb057){return db[_0xac56('0x2d')]['find']({'where':{'id':_0x4767bc['params']['id']},'attributes':[_0xac56('0x2b'),'basename',_0xac56('0x50'),_0xac56('0x51')],'raw':!![]})[_0xac56('0x28')](handleEntityNotFound(_0x2a19fd,null))[_0xac56('0x28')](function(_0x519ca1){if(_0x519ca1){if(!fs[_0xac56('0x52')](path[_0xac56('0x53')](config[_0xac56('0x54')],_0xac56('0x55'),_0x519ca1[_0xac56('0x50')]))){throw new db[(_0xac56('0x56'))][(_0xac56('0x57'))](_0xac56('0x58'));}if(_0x4767bc['query'][_0xac56('0x59')]){return _0x2a19fd[_0xac56('0x18')](0xc8);}return _0x2a19fd[_0xac56('0x5a')](path[_0xac56('0x53')](config[_0xac56('0x54')],'server/files/reports',_0x519ca1[_0xac56('0x50')]),util['format'](_0xac56('0x5b'),_0x519ca1[_0xac56('0x5c')]||_0x519ca1[_0xac56('0x2b')],_0x519ca1[_0xac56('0x51')][_0xac56('0x5d')]()));}})['catch'](handleError(_0x2a19fd,null));}; \ No newline at end of file +var _0xdaec=['request-promise','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','ExtractedReports','stack','name','send','index','map','AnalyticExtractedReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','basename','existsSync','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','join','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir'];(function(_0x50381c,_0x39beef){var _0x1bc982=function(_0x51be44){while(--_0x51be44){_0x50381c['push'](_0x50381c['shift']());}};_0x1bc982(++_0x39beef);}(_0xdaec,0xc3));var _0xcdae=function(_0x85e755,_0x4e8e31){_0x85e755=_0x85e755-0x0;var _0x473efc=_0xdaec[_0x85e755];return _0x473efc;};'use strict';var emlformat=require(_0xcdae('0x0'));var rimraf=require(_0xcdae('0x1'));var zipdir=require(_0xcdae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcdae('0x3'));var moment=require('moment');var BPromise=require(_0xcdae('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xcdae('0x5'));var sox=require('sox');var csv=require(_0xcdae('0x6'));var ejs=require(_0xcdae('0x7'));var fs=require('fs');var fs_extra=require(_0xcdae('0x8'));var _=require(_0xcdae('0x9'));var squel=require(_0xcdae('0xa'));var crypto=require(_0xcdae('0xb'));var jsforce=require(_0xcdae('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcdae('0x6'));var querystring=require(_0xcdae('0xd'));var Papa=require(_0xcdae('0xe'));var Redis=require(_0xcdae('0xf'));var authService=require(_0xcdae('0x10'));var qs=require(_0xcdae('0x11'));var as=require(_0xcdae('0x12'));var hardwareService=require(_0xcdae('0x13'));var logger=require(_0xcdae('0x14'))(_0xcdae('0x15'));var utils=require(_0xcdae('0x16'));var config=require(_0xcdae('0x17'));var licenseUtil=require(_0xcdae('0x18'));var db=require(_0xcdae('0x19'))['db'];function respondWithStatusCode(_0x326f11,_0xe36c0){_0xe36c0=_0xe36c0||0xcc;return function(_0x48c899){if(_0x48c899){return _0x326f11[_0xcdae('0x1a')](_0xe36c0);}return _0x326f11[_0xcdae('0x1b')](_0xe36c0)[_0xcdae('0x1c')]();};}function respondWithResult(_0x27191d,_0x388115){_0x388115=_0x388115||0xc8;return function(_0x4063ff){if(_0x4063ff){return _0x27191d[_0xcdae('0x1b')](_0x388115)[_0xcdae('0x1d')](_0x4063ff);}};}function respondWithFilteredResult(_0x40dc86,_0x9bf796){return function(_0x56712c){if(_0x56712c){var _0x153df9=typeof _0x9bf796[_0xcdae('0x1e')]===_0xcdae('0x1f')&&typeof _0x9bf796[_0xcdae('0x20')]===_0xcdae('0x1f');var _0x351ed4=_0x56712c['count'];var _0x333120=_0x153df9?0x0:_0x9bf796[_0xcdae('0x1e')];var _0x118558=_0x153df9?_0x56712c[_0xcdae('0x21')]:_0x9bf796[_0xcdae('0x1e')]+_0x9bf796[_0xcdae('0x20')];var _0x4c759f;if(_0x118558>=_0x351ed4){_0x118558=_0x351ed4;_0x4c759f=0xc8;}else{_0x4c759f=0xce;}_0x40dc86[_0xcdae('0x1b')](_0x4c759f);return _0x40dc86[_0xcdae('0x22')](_0xcdae('0x23'),_0x333120+'-'+_0x118558+'/'+_0x351ed4)[_0xcdae('0x1d')](_0x56712c);}return null;};}function patchUpdates(_0x2c2399){return function(_0x38c587){try{jsonpatch['apply'](_0x38c587,_0x2c2399,!![]);}catch(_0x3743df){return BPromise['reject'](_0x3743df);}return _0x38c587[_0xcdae('0x24')]();};}function saveUpdates(_0x590f18,_0x8c35b2){return function(_0x5726da){if(_0x5726da){return _0x5726da[_0xcdae('0x25')](_0x590f18)[_0xcdae('0x26')](function(_0x5c7e19){return _0x5c7e19;});}return null;};}function removeEntity(_0x2860e8,_0x36591d){return function(_0x2aeffc){if(_0x2aeffc){return _0x2aeffc[_0xcdae('0x27')]()[_0xcdae('0x26')](function(){var _0x249302=_0x2aeffc[_0xcdae('0x28')]({'plain':!![]});var _0x287a1c=_0xcdae('0x29');return db['UserProfileResource'][_0xcdae('0x27')]({'where':{'type':_0x287a1c,'resourceId':_0x249302['id']}})[_0xcdae('0x26')](function(){return _0x2aeffc;});})[_0xcdae('0x26')](function(){_0x2860e8[_0xcdae('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20103c,_0x39eda3){return function(_0x489df9){if(!_0x489df9){_0x20103c[_0xcdae('0x1a')](0x194);}return _0x489df9;};}function handleError(_0x837466,_0x46514b){_0x46514b=_0x46514b||0x1f4;return function(_0x1d7a94){logger['error'](_0x1d7a94[_0xcdae('0x2a')]);if(_0x1d7a94['name']){delete _0x1d7a94[_0xcdae('0x2b')];}_0x837466[_0xcdae('0x1b')](_0x46514b)[_0xcdae('0x2c')](_0x1d7a94);};}exports[_0xcdae('0x2d')]=function(_0x455923,_0x1e325a){var _0x1e6026={},_0x29701f={},_0x250236={'count':0x0,'rows':[]};var _0x4e0057=_[_0xcdae('0x2e')](db[_0xcdae('0x2f')]['rawAttributes'],function(_0x9b8833){return{'name':_0x9b8833[_0xcdae('0x30')],'type':_0x9b8833[_0xcdae('0x31')][_0xcdae('0x32')]};});_0x29701f[_0xcdae('0x33')]=_['map'](_0x4e0057,_0xcdae('0x2b'));_0x29701f[_0xcdae('0x34')]=_[_0xcdae('0x35')](_0x455923[_0xcdae('0x34')]);_0x29701f[_0xcdae('0x36')]=_['intersection'](_0x29701f[_0xcdae('0x33')],_0x29701f['query']);_0x1e6026[_0xcdae('0x37')]=_[_0xcdae('0x38')](_0x29701f['model'],qs[_0xcdae('0x39')](_0x455923['query'][_0xcdae('0x39')]));_0x1e6026[_0xcdae('0x37')]=_0x1e6026[_0xcdae('0x37')]['length']?_0x1e6026[_0xcdae('0x37')]:_0x29701f[_0xcdae('0x33')];if(!_0x455923[_0xcdae('0x34')]['hasOwnProperty'](_0xcdae('0x3a'))){_0x1e6026[_0xcdae('0x20')]=qs['limit'](_0x455923[_0xcdae('0x34')][_0xcdae('0x20')]);_0x1e6026[_0xcdae('0x1e')]=qs[_0xcdae('0x1e')](_0x455923[_0xcdae('0x34')][_0xcdae('0x1e')]);}_0x1e6026[_0xcdae('0x3b')]=qs[_0xcdae('0x3c')](_0x455923[_0xcdae('0x34')][_0xcdae('0x3c')]);_0x1e6026[_0xcdae('0x3d')]=qs['filters'](_[_0xcdae('0x3e')](_0x455923['query'],_0x29701f[_0xcdae('0x36')]),_0x4e0057);if(_0x455923['query']['filter']){_0x1e6026[_0xcdae('0x3d')]=_['merge'](_0x1e6026[_0xcdae('0x3d')],{'$or':_['map'](_0x4e0057,function(_0x4982c8){if(_0x4982c8[_0xcdae('0x31')]!=='VIRTUAL'){var _0x5292f8={};_0x5292f8[_0x4982c8[_0xcdae('0x2b')]]={'$like':'%'+_0x455923[_0xcdae('0x34')]['filter']+'%'};return _0x5292f8;}})});}_0x1e6026=_[_0xcdae('0x3f')]({},_0x1e6026,_0x455923[_0xcdae('0x40')]);var _0x3a327c={'where':_0x1e6026[_0xcdae('0x3d')]};return db[_0xcdae('0x2f')]['count'](_0x3a327c)[_0xcdae('0x26')](function(_0x298753){_0x250236['count']=_0x298753;if(_0x455923[_0xcdae('0x34')][_0xcdae('0x41')]){_0x1e6026[_0xcdae('0x42')]=[{'all':!![]}];}return db[_0xcdae('0x2f')][_0xcdae('0x43')](_0x1e6026);})[_0xcdae('0x26')](function(_0x36b2ac){_0x250236[_0xcdae('0x44')]=_0x36b2ac;return _0x250236;})[_0xcdae('0x26')](respondWithFilteredResult(_0x1e325a,_0x1e6026))[_0xcdae('0x45')](handleError(_0x1e325a,null));};exports['show']=function(_0x5f0e43,_0x5f2642){var _0x22665c={'raw':!![],'where':{'id':_0x5f0e43[_0xcdae('0x46')]['id']}},_0x2b0a91={};_0x2b0a91[_0xcdae('0x33')]=_[_0xcdae('0x35')](db['AnalyticExtractedReport'][_0xcdae('0x47')]);_0x2b0a91[_0xcdae('0x34')]=_[_0xcdae('0x35')](_0x5f0e43[_0xcdae('0x34')]);_0x2b0a91[_0xcdae('0x36')]=_['intersection'](_0x2b0a91[_0xcdae('0x33')],_0x2b0a91['query']);_0x22665c[_0xcdae('0x37')]=_[_0xcdae('0x38')](_0x2b0a91[_0xcdae('0x33')],qs[_0xcdae('0x39')](_0x5f0e43[_0xcdae('0x34')]['fields']));_0x22665c['attributes']=_0x22665c[_0xcdae('0x37')][_0xcdae('0x48')]?_0x22665c[_0xcdae('0x37')]:_0x2b0a91[_0xcdae('0x33')];if(_0x5f0e43[_0xcdae('0x34')][_0xcdae('0x41')]){_0x22665c['include']=[{'all':!![]}];}_0x22665c=_[_0xcdae('0x3f')]({},_0x22665c,_0x5f0e43[_0xcdae('0x40')]);return db[_0xcdae('0x2f')]['find'](_0x22665c)[_0xcdae('0x26')](handleEntityNotFound(_0x5f2642,null))[_0xcdae('0x26')](respondWithResult(_0x5f2642,null))[_0xcdae('0x45')](handleError(_0x5f2642,null));};exports['create']=function(_0x4ec14a,_0x122048){return db[_0xcdae('0x2f')]['create'](_0x4ec14a[_0xcdae('0x49')],{})[_0xcdae('0x26')](function(_0x41e60e){var _0x2196f2=_0x4ec14a['user'][_0xcdae('0x28')]({'plain':!![]});if(!_0x2196f2)throw new Error(_0xcdae('0x4a'));if(_0x2196f2[_0xcdae('0x4b')]===_0xcdae('0x4c')){var _0x901576=_0x41e60e[_0xcdae('0x28')]({'plain':!![]});var _0x2fd00a='ExtractedReports';return db[_0xcdae('0x4d')]['find']({'where':{'name':_0x2fd00a,'userProfileId':_0x2196f2[_0xcdae('0x4e')]},'raw':!![]})[_0xcdae('0x26')](function(_0x5360a4){if(_0x5360a4&&_0x5360a4[_0xcdae('0x4f')]===0x0){return db[_0xcdae('0x50')][_0xcdae('0x51')]({'name':_0x901576['name'],'resourceId':_0x901576['id'],'type':_0x5360a4[_0xcdae('0x2b')],'sectionId':_0x5360a4['id']},{})[_0xcdae('0x26')](function(){return _0x41e60e;});}else{return _0x41e60e;}})[_0xcdae('0x45')](function(_0x441366){logger[_0xcdae('0x52')](_0xcdae('0x53'),_0x441366);throw _0x441366;});}return _0x41e60e;})[_0xcdae('0x26')](respondWithResult(_0x122048,0xc9))['catch'](handleError(_0x122048,null));};exports[_0xcdae('0x25')]=function(_0x142d02,_0x50532c){if(_0x142d02[_0xcdae('0x49')]['id']){delete _0x142d02['body']['id'];}return db[_0xcdae('0x2f')][_0xcdae('0x54')]({'where':{'id':_0x142d02[_0xcdae('0x46')]['id']}})[_0xcdae('0x26')](handleEntityNotFound(_0x50532c,null))['then'](saveUpdates(_0x142d02[_0xcdae('0x49')],null))[_0xcdae('0x26')](respondWithResult(_0x50532c,null))[_0xcdae('0x45')](handleError(_0x50532c,null));};exports['destroy']=function(_0x56f390,_0x595067){return db[_0xcdae('0x2f')][_0xcdae('0x54')]({'where':{'id':_0x56f390[_0xcdae('0x46')]['id']}})[_0xcdae('0x26')](handleEntityNotFound(_0x595067,null))[_0xcdae('0x26')](removeEntity(_0x595067,null))[_0xcdae('0x45')](handleError(_0x595067,null));};exports['download']=function(_0x17b875,_0x1817f2,_0x350cb7){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x17b875[_0xcdae('0x46')]['id']},'attributes':[_0xcdae('0x2b'),_0xcdae('0x55'),'savename','output'],'raw':!![]})[_0xcdae('0x26')](handleEntityNotFound(_0x1817f2,null))[_0xcdae('0x26')](function(_0x4fd10a){if(_0x4fd10a){if(!fs[_0xcdae('0x56')](path['join'](config[_0xcdae('0x57')],_0xcdae('0x58'),_0x4fd10a[_0xcdae('0x59')]))){throw new db[(_0xcdae('0x5a'))][(_0xcdae('0x5b'))](_0xcdae('0x5c'));}if(_0x17b875[_0xcdae('0x34')][_0xcdae('0x5d')]){return _0x1817f2[_0xcdae('0x1a')](0xc8);}return _0x1817f2[_0xcdae('0x5e')](path[_0xcdae('0x5f')](config[_0xcdae('0x57')],_0xcdae('0x58'),_0x4fd10a['savename']),util[_0xcdae('0x60')](_0xcdae('0x61'),_0x4fd10a[_0xcdae('0x55')]||_0x4fd10a[_0xcdae('0x2b')],_0x4fd10a['output'][_0xcdae('0x62')]()));}})[_0xcdae('0x45')](handleError(_0x1817f2,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 23d53d8..6d8f93c 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 _0x2885=['AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','bluebird','path','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x103072,_0x1251a4){var _0x329c7e=function(_0x17e85c){while(--_0x17e85c){_0x103072['push'](_0x103072['shift']());}};_0x329c7e(++_0x1251a4);}(_0x2885,0x182));var _0x5288=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x2885[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0x5288('0x0'));var util=require(_0x5288('0x1'));var logger=require('../../config/logger')(_0x5288('0x2'));var moment=require(_0x5288('0x3'));var BPromise=require(_0x5288('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5288('0x5'));var rimraf=require('rimraf');var config=require(_0x5288('0x6'));var attributes=require(_0x5288('0x7'));module[_0x5288('0x8')]=function(_0x953bc3,_0xf8094d){return _0x953bc3[_0x5288('0x9')](_0x5288('0xa'),attributes,{'tableName':_0x5288('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf314=['./analyticExtractedReport.attributes','define','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x86932b,_0xa8fa5c){var _0x12dcaf=function(_0xd378d3){while(--_0xd378d3){_0x86932b['push'](_0x86932b['shift']());}};_0x12dcaf(++_0xa8fa5c);}(_0xf314,0x92));var _0x4f31=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xf314[_0x13b02f];return _0x12e9a6;};'use strict';var _=require(_0x4f31('0x0'));var util=require(_0x4f31('0x1'));var logger=require(_0x4f31('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4f31('0x3'));var rp=require(_0x4f31('0x4'));var fs=require('fs');var path=require(_0x4f31('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4f31('0x6'));module['exports']=function(_0x3ae6f2,_0x532879){return _0x3ae6f2[_0x4f31('0x7')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index bf88cdf..15b0280 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 _0xe764=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe764,0x90));var _0x4e76=function(_0x4801a0,_0x252c24){_0x4801a0=_0x4801a0-0x0;var _0x338e26=_0xe764[_0x4801a0];return _0x338e26;};'use strict';var _=require(_0x4e76('0x0'));var util=require(_0x4e76('0x1'));var moment=require(_0x4e76('0x2'));var BPromise=require(_0x4e76('0x3'));var rs=require(_0x4e76('0x4'));var fs=require('fs');var Redis=require(_0x4e76('0x5'));var db=require(_0x4e76('0x6'))['db'];var utils=require(_0x4e76('0x7'));var logger=require(_0x4e76('0x8'))(_0x4e76('0x9'));var config=require(_0x4e76('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4e76('0xb')][_0x4e76('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ed0e3,_0x2656b7,_0x5d0837){return new BPromise(function(_0x3d7eb2,_0x26a3da){return client[_0x4e76('0xd')](_0x2ed0e3,_0x5d0837)[_0x4e76('0xe')](function(_0x1a1c93){logger[_0x4e76('0xf')](_0x4e76('0x10'),_0x2656b7,'request\x20sent');logger[_0x4e76('0x11')](_0x4e76('0x12'),_0x2656b7,_0x4e76('0x13'),JSON[_0x4e76('0x14')](_0x1a1c93));if(_0x1a1c93[_0x4e76('0x15')]){if(_0x1a1c93['error'][_0x4e76('0x16')]===0x1f4){logger[_0x4e76('0x15')](_0x4e76('0x10'),_0x2656b7,_0x1a1c93[_0x4e76('0x15')][_0x4e76('0x17')]);return _0x26a3da(_0x1a1c93['error'][_0x4e76('0x17')]);}logger[_0x4e76('0x15')](_0x4e76('0x10'),_0x2656b7,_0x1a1c93[_0x4e76('0x15')]['message']);return _0x3d7eb2(_0x1a1c93[_0x4e76('0x15')][_0x4e76('0x17')]);}else{logger[_0x4e76('0xf')](_0x4e76('0x10'),_0x2656b7,_0x4e76('0x13'));_0x3d7eb2(_0x1a1c93['result'][_0x4e76('0x17')]);}})[_0x4e76('0x18')](function(_0x5ab9c4){logger[_0x4e76('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2656b7,_0x5ab9c4);_0x26a3da(_0x5ab9c4);});});} \ No newline at end of file +var _0x0444=['error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1142fb,_0x59acf3){var _0x590d0f=function(_0x56b8e8){while(--_0x56b8e8){_0x1142fb['push'](_0x1142fb['shift']());}};_0x590d0f(++_0x59acf3);}(_0x0444,0xbd));var _0x4044=function(_0x3cc2ee,_0x3ab210){_0x3cc2ee=_0x3cc2ee-0x0;var _0x3262c6=_0x0444[_0x3cc2ee];return _0x3262c6;};'use strict';var _=require(_0x4044('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4044('0x1'));var rs=require(_0x4044('0x2'));var fs=require('fs');var Redis=require(_0x4044('0x3'));var db=require(_0x4044('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4044('0x5'))(_0x4044('0x6'));var config=require(_0x4044('0x7'));var jayson=require(_0x4044('0x8'));var client=jayson[_0x4044('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31c11f,_0x590b6f,_0x3e9f69){return new BPromise(function(_0x15704a,_0x363a5d){return client[_0x4044('0xa')](_0x31c11f,_0x3e9f69)[_0x4044('0xb')](function(_0x2880e2){logger[_0x4044('0xc')](_0x4044('0xd'),_0x590b6f,_0x4044('0xe'));logger[_0x4044('0xf')](_0x4044('0x10'),_0x590b6f,_0x4044('0xe'),JSON[_0x4044('0x11')](_0x2880e2));if(_0x2880e2[_0x4044('0x12')]){if(_0x2880e2[_0x4044('0x12')][_0x4044('0x13')]===0x1f4){logger['error'](_0x4044('0xd'),_0x590b6f,_0x2880e2['error']['message']);return _0x363a5d(_0x2880e2['error'][_0x4044('0x14')]);}logger['error'](_0x4044('0xd'),_0x590b6f,_0x2880e2[_0x4044('0x12')][_0x4044('0x14')]);return _0x15704a(_0x2880e2['error'][_0x4044('0x14')]);}else{logger['info'](_0x4044('0xd'),_0x590b6f,'request\x20sent');_0x15704a(_0x2880e2[_0x4044('0x15')][_0x4044('0x14')]);}})[_0x4044('0x16')](function(_0x2b7824){logger[_0x4044('0x12')](_0x4044('0xd'),_0x590b6f,_0x2b7824);_0x363a5d(_0x2b7824);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index cf9f8ca..54d3237 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 _0xe929=['update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0xe929,0x93));var _0x9e92=function(_0x4ba380,_0x259bee){_0x4ba380=_0x4ba380-0x0;var _0x4b111b=_0xe929[_0x4ba380];return _0x4b111b;};'use strict';var multer=require(_0x9e92('0x0'));var util=require(_0x9e92('0x1'));var path=require('path');var timeout=require(_0x9e92('0x2'));var express=require(_0x9e92('0x3'));var router=express['Router']();var fs_extra=require(_0x9e92('0x4'));var auth=require(_0x9e92('0x5'));var interaction=require(_0x9e92('0x6'));var config=require('../../config/environment');var controller=require(_0x9e92('0x7'));router[_0x9e92('0x8')]('/',auth[_0x9e92('0x9')](),controller[_0x9e92('0xa')]);router[_0x9e92('0x8')](_0x9e92('0xb'),auth[_0x9e92('0x9')](),controller[_0x9e92('0xc')]);router[_0x9e92('0x8')]('/:id/download',auth[_0x9e92('0x9')](),controller['download']);router[_0x9e92('0xd')]('/',auth['isAuthenticated'](),controller[_0x9e92('0xe')]);router['put'](_0x9e92('0xb'),auth[_0x9e92('0x9')](),controller[_0x9e92('0xf')]);router[_0x9e92('0x10')](_0x9e92('0xb'),auth[_0x9e92('0x9')](),controller[_0x9e92('0x11')]);module['exports']=router; \ No newline at end of file +var _0xd267=['/:id','show','/:id/download','download','create','update','delete','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xd267,0x1b8));var _0x7d26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd267[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x7d26('0x0'));var path=require('path');var timeout=require(_0x7d26('0x1'));var express=require('express');var router=express[_0x7d26('0x2')]();var fs_extra=require(_0x7d26('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7d26('0x4'));var config=require(_0x7d26('0x5'));var controller=require(_0x7d26('0x6'));router[_0x7d26('0x7')]('/',auth[_0x7d26('0x8')](),controller[_0x7d26('0x9')]);router[_0x7d26('0x7')](_0x7d26('0xa'),auth[_0x7d26('0x8')](),controller[_0x7d26('0xb')]);router['get'](_0x7d26('0xc'),auth[_0x7d26('0x8')](),controller[_0x7d26('0xd')]);router['post']('/',auth[_0x7d26('0x8')](),controller[_0x7d26('0xe')]);router['put']('/:id',auth[_0x7d26('0x8')](),controller[_0x7d26('0xf')]);router[_0x7d26('0x10')]('/:id',auth[_0x7d26('0x8')](),controller['destroy']);module[_0x7d26('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index a4b2376..a395375 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 _0x2059=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0x2059,0x7c));var _0x9205=function(_0x44454f,_0x4bfbe8){_0x44454f=_0x44454f-0x0;var _0x475150=_0x2059[_0x44454f];return _0x475150;};'use strict';var Sequelize=require(_0x9205('0x0'));module['exports']={'field':{'type':Sequelize[_0x9205('0x1')]},'alias':{'type':Sequelize[_0x9205('0x2')]},'function':{'type':Sequelize[_0x9205('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x9205('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x9205('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x3292=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x45f859,_0x3cbda5){var _0x2410e7=function(_0x3fc569){while(--_0x3fc569){_0x45f859['push'](_0x45f859['shift']());}};_0x2410e7(++_0x3cbda5);}(_0x3292,0xcf));var _0x2329=function(_0x2c1684,_0x3d7540){_0x2c1684=_0x2c1684-0x0;var _0x5cd07a=_0x3292[_0x2c1684];return _0x5cd07a;};'use strict';var Sequelize=require(_0x2329('0x0'));module[_0x2329('0x1')]={'field':{'type':Sequelize[_0x2329('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x2329('0x3')]},'groupBy':{'type':Sequelize[_0x2329('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x2329('0x3')]},'custom':{'type':Sequelize[_0x2329('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 8bf89fd..f430cb5 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 _0x7079=['includeAll','findAll','rows','catch','params','include','merge','find','create','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','error','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','VIRTUAL','options','then'];(function(_0x465c8d,_0x308d2e){var _0x3e64a8=function(_0x4ded4e){while(--_0x4ded4e){_0x465c8d['push'](_0x465c8d['shift']());}};_0x3e64a8(++_0x308d2e);}(_0x7079,0x68));var _0x9707=function(_0x3b145d,_0x3a2aba){_0x3b145d=_0x3b145d-0x0;var _0x320f0a=_0x7079[_0x3b145d];return _0x320f0a;};'use strict';var emlformat=require(_0x9707('0x0'));var rimraf=require(_0x9707('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9707('0x2'));var rp=require(_0x9707('0x3'));var moment=require('moment');var BPromise=require(_0x9707('0x4'));var Mustache=require(_0x9707('0x5'));var util=require(_0x9707('0x6'));var path=require('path');var sox=require(_0x9707('0x7'));var csv=require(_0x9707('0x8'));var ejs=require(_0x9707('0x9'));var fs=require('fs');var fs_extra=require(_0x9707('0xa'));var _=require(_0x9707('0xb'));var squel=require(_0x9707('0xc'));var crypto=require(_0x9707('0xd'));var jsforce=require(_0x9707('0xe'));var deskjs=require(_0x9707('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9707('0x10'));var Redis=require(_0x9707('0x11'));var authService=require(_0x9707('0x12'));var qs=require(_0x9707('0x13'));var as=require(_0x9707('0x14'));var hardwareService=require(_0x9707('0x15'));var logger=require(_0x9707('0x16'))('api');var utils=require(_0x9707('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9707('0x18'));var db=require(_0x9707('0x19'))['db'];function respondWithStatusCode(_0x3364b8,_0x29fde8){_0x29fde8=_0x29fde8||0xcc;return function(_0x3a845a){if(_0x3a845a){return _0x3364b8['sendStatus'](_0x29fde8);}return _0x3364b8[_0x9707('0x1a')](_0x29fde8)['end']();};}function respondWithResult(_0x3b2de1,_0x191cbe){_0x191cbe=_0x191cbe||0xc8;return function(_0x3557bd){if(_0x3557bd){return _0x3b2de1['status'](_0x191cbe)[_0x9707('0x1b')](_0x3557bd);}};}function respondWithFilteredResult(_0x48652a,_0x2f94f8){return function(_0x44c3e7){if(_0x44c3e7){var _0x279662=typeof _0x2f94f8['offset']===_0x9707('0x1c')&&typeof _0x2f94f8[_0x9707('0x1d')]==='undefined';var _0x4e6e85=_0x44c3e7[_0x9707('0x1e')];var _0x4084eb=_0x279662?0x0:_0x2f94f8[_0x9707('0x1f')];var _0x3be78c=_0x279662?_0x44c3e7['count']:_0x2f94f8['offset']+_0x2f94f8[_0x9707('0x1d')];var _0xfe46a7;if(_0x3be78c>=_0x4e6e85){_0x3be78c=_0x4e6e85;_0xfe46a7=0xc8;}else{_0xfe46a7=0xce;}_0x48652a[_0x9707('0x1a')](_0xfe46a7);return _0x48652a[_0x9707('0x20')](_0x9707('0x21'),_0x4084eb+'-'+_0x3be78c+'/'+_0x4e6e85)[_0x9707('0x1b')](_0x44c3e7);}return null;};}function patchUpdates(_0x13b413){return function(_0x14d2b6){try{jsonpatch[_0x9707('0x22')](_0x14d2b6,_0x13b413,!![]);}catch(_0x4c2ec4){return BPromise[_0x9707('0x23')](_0x4c2ec4);}return _0x14d2b6[_0x9707('0x24')]();};}function saveUpdates(_0x4fcf1b,_0x5a3081){return function(_0x1c5ee8){if(_0x1c5ee8){return _0x1c5ee8[_0x9707('0x25')](_0x4fcf1b)['then'](function(_0x52c4b1){return _0x52c4b1;});}return null;};}function removeEntity(_0x57ac1c,_0x1f1e00){return function(_0x434b48){if(_0x434b48){return _0x434b48[_0x9707('0x26')]()['then'](function(){_0x57ac1c['status'](0xcc)[_0x9707('0x27')]();});}};}function handleEntityNotFound(_0x2f4671,_0x3bf90c){return function(_0x3f7428){if(!_0x3f7428){_0x2f4671[_0x9707('0x28')](0x194);}return _0x3f7428;};}function handleError(_0x27ea0e,_0x182540){_0x182540=_0x182540||0x1f4;return function(_0x382ad5){logger[_0x9707('0x29')](_0x382ad5[_0x9707('0x2a')]);if(_0x382ad5[_0x9707('0x2b')]){delete _0x382ad5[_0x9707('0x2b')];}_0x27ea0e[_0x9707('0x1a')](_0x182540)[_0x9707('0x2c')](_0x382ad5);};}exports[_0x9707('0x2d')]=function(_0xff5a53,_0xa12368){var _0x2487e4={},_0x19accd={},_0x15dc75={'count':0x0,'rows':[]};var _0x58fdb1=_[_0x9707('0x2e')](db[_0x9707('0x2f')][_0x9707('0x30')],function(_0x20d27a){return{'name':_0x20d27a[_0x9707('0x31')],'type':_0x20d27a[_0x9707('0x32')][_0x9707('0x33')]};});_0x19accd[_0x9707('0x34')]=_[_0x9707('0x2e')](_0x58fdb1,_0x9707('0x2b'));_0x19accd[_0x9707('0x35')]=_[_0x9707('0x36')](_0xff5a53['query']);_0x19accd['filters']=_[_0x9707('0x37')](_0x19accd['model'],_0x19accd[_0x9707('0x35')]);_0x2487e4[_0x9707('0x38')]=_[_0x9707('0x37')](_0x19accd[_0x9707('0x34')],qs['fields'](_0xff5a53[_0x9707('0x35')][_0x9707('0x39')]));_0x2487e4[_0x9707('0x38')]=_0x2487e4['attributes'][_0x9707('0x3a')]?_0x2487e4[_0x9707('0x38')]:_0x19accd[_0x9707('0x34')];if(!_0xff5a53[_0x9707('0x35')][_0x9707('0x3b')](_0x9707('0x3c'))){_0x2487e4['limit']=qs[_0x9707('0x1d')](_0xff5a53[_0x9707('0x35')][_0x9707('0x1d')]);_0x2487e4['offset']=qs[_0x9707('0x1f')](_0xff5a53[_0x9707('0x35')][_0x9707('0x1f')]);}_0x2487e4[_0x9707('0x3d')]=qs[_0x9707('0x3e')](_0xff5a53[_0x9707('0x35')][_0x9707('0x3e')]);_0x2487e4[_0x9707('0x3f')]=qs[_0x9707('0x40')](_[_0x9707('0x41')](_0xff5a53[_0x9707('0x35')],_0x19accd['filters']),_0x58fdb1);if(_0xff5a53[_0x9707('0x35')][_0x9707('0x42')]){_0x2487e4[_0x9707('0x3f')]=_['merge'](_0x2487e4[_0x9707('0x3f')],{'$or':_[_0x9707('0x2e')](_0x58fdb1,function(_0x557b51){if(_0x557b51['type']!==_0x9707('0x43')){var _0x2e052e={};_0x2e052e[_0x557b51['name']]={'$like':'%'+_0xff5a53[_0x9707('0x35')][_0x9707('0x42')]+'%'};return _0x2e052e;}})});}_0x2487e4=_['merge']({},_0x2487e4,_0xff5a53[_0x9707('0x44')]);var _0x3416f0={'where':_0x2487e4[_0x9707('0x3f')]};return db[_0x9707('0x2f')][_0x9707('0x1e')](_0x3416f0)[_0x9707('0x45')](function(_0x44f8e6){_0x15dc75[_0x9707('0x1e')]=_0x44f8e6;if(_0xff5a53[_0x9707('0x35')][_0x9707('0x46')]){_0x2487e4['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x9707('0x47')](_0x2487e4);})[_0x9707('0x45')](function(_0x106149){_0x15dc75[_0x9707('0x48')]=_0x106149;return _0x15dc75;})[_0x9707('0x45')](respondWithFilteredResult(_0xa12368,_0x2487e4))[_0x9707('0x49')](handleError(_0xa12368,null));};exports['show']=function(_0x14c59a,_0x488bcb){var _0x315762={'raw':![],'where':{'id':_0x14c59a[_0x9707('0x4a')]['id']}},_0x515801={};_0x515801[_0x9707('0x34')]=_[_0x9707('0x36')](db[_0x9707('0x2f')]['rawAttributes']);_0x515801[_0x9707('0x35')]=_[_0x9707('0x36')](_0x14c59a['query']);_0x515801[_0x9707('0x40')]=_[_0x9707('0x37')](_0x515801[_0x9707('0x34')],_0x515801['query']);_0x315762[_0x9707('0x38')]=_[_0x9707('0x37')](_0x515801[_0x9707('0x34')],qs[_0x9707('0x39')](_0x14c59a[_0x9707('0x35')][_0x9707('0x39')]));_0x315762[_0x9707('0x38')]=_0x315762['attributes'][_0x9707('0x3a')]?_0x315762[_0x9707('0x38')]:_0x515801[_0x9707('0x34')];if(_0x14c59a[_0x9707('0x35')]['includeAll']){_0x315762[_0x9707('0x4b')]=[{'all':!![]}];}_0x315762=_[_0x9707('0x4c')]({},_0x315762,_0x14c59a[_0x9707('0x44')]);return db[_0x9707('0x2f')][_0x9707('0x4d')](_0x315762)[_0x9707('0x45')](handleEntityNotFound(_0x488bcb,null))['then'](respondWithResult(_0x488bcb,null))[_0x9707('0x49')](handleError(_0x488bcb,null));};exports['create']=function(_0x18dfda,_0x12e475){return db['AnalyticFieldReport'][_0x9707('0x4e')](_0x18dfda[_0x9707('0x4f')],{})[_0x9707('0x45')](respondWithResult(_0x12e475,0xc9))[_0x9707('0x49')](handleError(_0x12e475,null));};exports[_0x9707('0x50')]=function(_0x1d3ff9,_0x1e6f7a){return db[_0x9707('0x2f')]['bulkCreate'](_0x1d3ff9['body'],{'raw':![],'individualHooks':!![]})[_0x9707('0x45')](respondWithResult(_0x1e6f7a,0xc9))['catch'](handleError(_0x1e6f7a,null));};exports['update']=function(_0x2e2806,_0x1dddf2){if(_0x2e2806[_0x9707('0x4f')]['id']){delete _0x2e2806[_0x9707('0x4f')]['id'];}return db[_0x9707('0x2f')][_0x9707('0x4d')]({'where':{'id':_0x2e2806[_0x9707('0x4a')]['id']}})[_0x9707('0x45')](handleEntityNotFound(_0x1dddf2,null))[_0x9707('0x45')](saveUpdates(_0x2e2806[_0x9707('0x4f')],null))[_0x9707('0x45')](respondWithResult(_0x1dddf2,null))[_0x9707('0x49')](handleError(_0x1dddf2,null));};exports[_0x9707('0x26')]=function(_0x5a7c4d,_0x2ac133){return db['AnalyticFieldReport'][_0x9707('0x4d')]({'where':{'id':_0x5a7c4d[_0x9707('0x4a')]['id']}})[_0x9707('0x45')](handleEntityNotFound(_0x2ac133,null))[_0x9707('0x45')](removeEntity(_0x2ac133,null))[_0x9707('0x49')](handleError(_0x2ac133,null));};exports['bulkDestroy']=function(_0x42872c,_0xcc1894){return db[_0x9707('0x2f')][_0x9707('0x26')]({'where':{'id':_0x42872c[_0x9707('0x35')][_0x9707('0x51')]||[]},'raw':![],'individualHooks':!![]})[_0x9707('0x45')](respondWithResult(_0xcc1894,0xcc))[_0x9707('0x49')](handleError(_0xcc1894,null));};exports[_0x9707('0x52')]=function(_0x5b3be7,_0x1102c5,_0x357901){return db[_0x9707('0x53')][_0x9707('0x54')]({'where':{'id':_0x5b3be7[_0x9707('0x4a')]['id']}})[_0x9707('0x45')](handleEntityNotFound(_0x1102c5,null))[_0x9707('0x45')](function(_0x5770b9){if(_0x5770b9){return db['sequelize'][_0x9707('0x55')](function(_0x45b0a4){return db['AnalyticFieldReport'][_0x9707('0x26')]({'where':{'CustomReportId':_0x5b3be7['params']['id']},'transaction':_0x45b0a4})['then'](function(_0x2086a3){var _0x5645ce=_[_0x9707('0x2e')](_0x5b3be7[_0x9707('0x4f')],function(_0x2ff46b){delete _0x2ff46b['id'];_0x2ff46b[_0x9707('0x56')]=_0x5b3be7['params']['id'];return _0x2ff46b;});return db['AnalyticFieldReport'][_0x9707('0x50')](_0x5645ce,{'transaction':_0x45b0a4});});})['then'](function(){return db[_0x9707('0x2f')][_0x9707('0x47')]({'where':{'CustomReportId':_0x5b3be7[_0x9707('0x4a')]['id']}});});}})['then'](respondWithResult(_0x1102c5,null))['catch'](handleError(_0x1102c5,null));}; \ No newline at end of file +var _0x9ac0=['end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','create','body','bulkCreate','find','bulkDestroy','ids','addFields','sequelize','transaction','CustomReportId','findAll','rimraf','zip-dir','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x1c5285,_0x4c7a94){var _0x5a93ab=function(_0x35f6cf){while(--_0x35f6cf){_0x1c5285['push'](_0x1c5285['shift']());}};_0x5a93ab(++_0x4c7a94);}(_0x9ac0,0x179));var _0x09ac=function(_0x561a58,_0x22f033){_0x561a58=_0x561a58-0x0;var _0x583036=_0x9ac0[_0x561a58];return _0x583036;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x09ac('0x0'));var zipdir=require(_0x09ac('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x09ac('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x09ac('0x3'));var util=require(_0x09ac('0x4'));var path=require(_0x09ac('0x5'));var sox=require(_0x09ac('0x6'));var csv=require('to-csv');var ejs=require(_0x09ac('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x09ac('0x8'));var squel=require(_0x09ac('0x9'));var crypto=require(_0x09ac('0xa'));var jsforce=require(_0x09ac('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x09ac('0xc'));var querystring=require(_0x09ac('0xd'));var Papa=require(_0x09ac('0xe'));var Redis=require(_0x09ac('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x09ac('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x09ac('0x11'))(_0x09ac('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x09ac('0x13'));var db=require(_0x09ac('0x14'))['db'];function respondWithStatusCode(_0x224e6f,_0x2b08e7){_0x2b08e7=_0x2b08e7||0xcc;return function(_0x3f82d5){if(_0x3f82d5){return _0x224e6f[_0x09ac('0x15')](_0x2b08e7);}return _0x224e6f[_0x09ac('0x16')](_0x2b08e7)[_0x09ac('0x17')]();};}function respondWithResult(_0x442880,_0x32fcbb){_0x32fcbb=_0x32fcbb||0xc8;return function(_0x54acad){if(_0x54acad){return _0x442880['status'](_0x32fcbb)[_0x09ac('0x18')](_0x54acad);}};}function respondWithFilteredResult(_0x19d7be,_0x3b376b){return function(_0x1634c8){if(_0x1634c8){var _0x175adf=typeof _0x3b376b[_0x09ac('0x19')]===_0x09ac('0x1a')&&typeof _0x3b376b['limit']==='undefined';var _0x2daa95=_0x1634c8[_0x09ac('0x1b')];var _0x1eb278=_0x175adf?0x0:_0x3b376b[_0x09ac('0x19')];var _0xb41e74=_0x175adf?_0x1634c8[_0x09ac('0x1b')]:_0x3b376b[_0x09ac('0x19')]+_0x3b376b[_0x09ac('0x1c')];var _0x13a6ee;if(_0xb41e74>=_0x2daa95){_0xb41e74=_0x2daa95;_0x13a6ee=0xc8;}else{_0x13a6ee=0xce;}_0x19d7be[_0x09ac('0x16')](_0x13a6ee);return _0x19d7be[_0x09ac('0x1d')](_0x09ac('0x1e'),_0x1eb278+'-'+_0xb41e74+'/'+_0x2daa95)['json'](_0x1634c8);}return null;};}function patchUpdates(_0xcdde03){return function(_0xfa17cf){try{jsonpatch[_0x09ac('0x1f')](_0xfa17cf,_0xcdde03,!![]);}catch(_0x2fa440){return BPromise[_0x09ac('0x20')](_0x2fa440);}return _0xfa17cf[_0x09ac('0x21')]();};}function saveUpdates(_0x191246,_0x22dd26){return function(_0x1848d3){if(_0x1848d3){return _0x1848d3[_0x09ac('0x22')](_0x191246)[_0x09ac('0x23')](function(_0x19bdc8){return _0x19bdc8;});}return null;};}function removeEntity(_0x1e10f9,_0x11711d){return function(_0x39dc22){if(_0x39dc22){return _0x39dc22[_0x09ac('0x24')]()['then'](function(){_0x1e10f9[_0x09ac('0x16')](0xcc)[_0x09ac('0x17')]();});}};}function handleEntityNotFound(_0x2912ae,_0xb1529e){return function(_0x1cfe43){if(!_0x1cfe43){_0x2912ae[_0x09ac('0x15')](0x194);}return _0x1cfe43;};}function handleError(_0x1a815b,_0x4008c7){_0x4008c7=_0x4008c7||0x1f4;return function(_0x414dc0){logger[_0x09ac('0x25')](_0x414dc0[_0x09ac('0x26')]);if(_0x414dc0['name']){delete _0x414dc0[_0x09ac('0x27')];}_0x1a815b['status'](_0x4008c7)[_0x09ac('0x28')](_0x414dc0);};}exports[_0x09ac('0x29')]=function(_0x571b00,_0x429dcd){var _0x325e2d={},_0x36efe0={},_0x41ca09={'count':0x0,'rows':[]};var _0x525015=_['map'](db[_0x09ac('0x2a')][_0x09ac('0x2b')],function(_0xb475cb){return{'name':_0xb475cb['fieldName'],'type':_0xb475cb[_0x09ac('0x2c')][_0x09ac('0x2d')]};});_0x36efe0[_0x09ac('0x2e')]=_[_0x09ac('0x2f')](_0x525015,_0x09ac('0x27'));_0x36efe0[_0x09ac('0x30')]=_[_0x09ac('0x31')](_0x571b00[_0x09ac('0x30')]);_0x36efe0[_0x09ac('0x32')]=_[_0x09ac('0x33')](_0x36efe0[_0x09ac('0x2e')],_0x36efe0[_0x09ac('0x30')]);_0x325e2d[_0x09ac('0x34')]=_[_0x09ac('0x33')](_0x36efe0[_0x09ac('0x2e')],qs[_0x09ac('0x35')](_0x571b00[_0x09ac('0x30')][_0x09ac('0x35')]));_0x325e2d[_0x09ac('0x34')]=_0x325e2d[_0x09ac('0x34')][_0x09ac('0x36')]?_0x325e2d[_0x09ac('0x34')]:_0x36efe0[_0x09ac('0x2e')];if(!_0x571b00[_0x09ac('0x30')]['hasOwnProperty'](_0x09ac('0x37'))){_0x325e2d[_0x09ac('0x1c')]=qs[_0x09ac('0x1c')](_0x571b00[_0x09ac('0x30')]['limit']);_0x325e2d[_0x09ac('0x19')]=qs[_0x09ac('0x19')](_0x571b00[_0x09ac('0x30')][_0x09ac('0x19')]);}_0x325e2d[_0x09ac('0x38')]=qs[_0x09ac('0x39')](_0x571b00[_0x09ac('0x30')][_0x09ac('0x39')]);_0x325e2d[_0x09ac('0x3a')]=qs['filters'](_[_0x09ac('0x3b')](_0x571b00['query'],_0x36efe0[_0x09ac('0x32')]),_0x525015);if(_0x571b00[_0x09ac('0x30')][_0x09ac('0x3c')]){_0x325e2d[_0x09ac('0x3a')]=_[_0x09ac('0x3d')](_0x325e2d[_0x09ac('0x3a')],{'$or':_[_0x09ac('0x2f')](_0x525015,function(_0x53097c){if(_0x53097c['type']!==_0x09ac('0x3e')){var _0x3f28c3={};_0x3f28c3[_0x53097c[_0x09ac('0x27')]]={'$like':'%'+_0x571b00[_0x09ac('0x30')][_0x09ac('0x3c')]+'%'};return _0x3f28c3;}})});}_0x325e2d=_[_0x09ac('0x3d')]({},_0x325e2d,_0x571b00[_0x09ac('0x3f')]);var _0x14f58d={'where':_0x325e2d[_0x09ac('0x3a')]};return db[_0x09ac('0x2a')][_0x09ac('0x1b')](_0x14f58d)[_0x09ac('0x23')](function(_0x224c6e){_0x41ca09['count']=_0x224c6e;if(_0x571b00[_0x09ac('0x30')][_0x09ac('0x40')]){_0x325e2d[_0x09ac('0x41')]=[{'all':!![]}];}return db[_0x09ac('0x2a')]['findAll'](_0x325e2d);})['then'](function(_0x54dcb7){_0x41ca09[_0x09ac('0x42')]=_0x54dcb7;return _0x41ca09;})[_0x09ac('0x23')](respondWithFilteredResult(_0x429dcd,_0x325e2d))[_0x09ac('0x43')](handleError(_0x429dcd,null));};exports['show']=function(_0x76ff6f,_0x474413){var _0x59653f={'raw':![],'where':{'id':_0x76ff6f[_0x09ac('0x44')]['id']}},_0x1f6a9e={};_0x1f6a9e[_0x09ac('0x2e')]=_[_0x09ac('0x31')](db[_0x09ac('0x2a')][_0x09ac('0x2b')]);_0x1f6a9e[_0x09ac('0x30')]=_[_0x09ac('0x31')](_0x76ff6f[_0x09ac('0x30')]);_0x1f6a9e[_0x09ac('0x32')]=_[_0x09ac('0x33')](_0x1f6a9e[_0x09ac('0x2e')],_0x1f6a9e[_0x09ac('0x30')]);_0x59653f[_0x09ac('0x34')]=_[_0x09ac('0x33')](_0x1f6a9e[_0x09ac('0x2e')],qs[_0x09ac('0x35')](_0x76ff6f[_0x09ac('0x30')][_0x09ac('0x35')]));_0x59653f[_0x09ac('0x34')]=_0x59653f[_0x09ac('0x34')]['length']?_0x59653f['attributes']:_0x1f6a9e[_0x09ac('0x2e')];if(_0x76ff6f['query'][_0x09ac('0x40')]){_0x59653f[_0x09ac('0x41')]=[{'all':!![]}];}_0x59653f=_[_0x09ac('0x3d')]({},_0x59653f,_0x76ff6f[_0x09ac('0x3f')]);return db[_0x09ac('0x2a')]['find'](_0x59653f)[_0x09ac('0x23')](handleEntityNotFound(_0x474413,null))[_0x09ac('0x23')](respondWithResult(_0x474413,null))['catch'](handleError(_0x474413,null));};exports[_0x09ac('0x45')]=function(_0x4e285f,_0x5d0dbd){return db[_0x09ac('0x2a')]['create'](_0x4e285f[_0x09ac('0x46')],{})[_0x09ac('0x23')](respondWithResult(_0x5d0dbd,0xc9))[_0x09ac('0x43')](handleError(_0x5d0dbd,null));};exports['bulkCreate']=function(_0x53e83f,_0x381231){return db['AnalyticFieldReport'][_0x09ac('0x47')](_0x53e83f[_0x09ac('0x46')],{'raw':![],'individualHooks':!![]})[_0x09ac('0x23')](respondWithResult(_0x381231,0xc9))[_0x09ac('0x43')](handleError(_0x381231,null));};exports[_0x09ac('0x22')]=function(_0x1da763,_0x47c596){if(_0x1da763['body']['id']){delete _0x1da763[_0x09ac('0x46')]['id'];}return db[_0x09ac('0x2a')][_0x09ac('0x48')]({'where':{'id':_0x1da763[_0x09ac('0x44')]['id']}})[_0x09ac('0x23')](handleEntityNotFound(_0x47c596,null))['then'](saveUpdates(_0x1da763[_0x09ac('0x46')],null))[_0x09ac('0x23')](respondWithResult(_0x47c596,null))[_0x09ac('0x43')](handleError(_0x47c596,null));};exports[_0x09ac('0x24')]=function(_0x2377a6,_0x4a65b0){return db[_0x09ac('0x2a')][_0x09ac('0x48')]({'where':{'id':_0x2377a6[_0x09ac('0x44')]['id']}})[_0x09ac('0x23')](handleEntityNotFound(_0x4a65b0,null))[_0x09ac('0x23')](removeEntity(_0x4a65b0,null))[_0x09ac('0x43')](handleError(_0x4a65b0,null));};exports[_0x09ac('0x49')]=function(_0x458069,_0xbf308a){return db['AnalyticFieldReport'][_0x09ac('0x24')]({'where':{'id':_0x458069[_0x09ac('0x30')][_0x09ac('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x09ac('0x23')](respondWithResult(_0xbf308a,0xcc))[_0x09ac('0x43')](handleError(_0xbf308a,null));};exports[_0x09ac('0x4b')]=function(_0x4a02c1,_0x2e6991,_0x118bc4){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x4a02c1[_0x09ac('0x44')]['id']}})['then'](handleEntityNotFound(_0x2e6991,null))['then'](function(_0x1b4973){if(_0x1b4973){return db[_0x09ac('0x4c')][_0x09ac('0x4d')](function(_0x4b2194){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x4a02c1[_0x09ac('0x44')]['id']},'transaction':_0x4b2194})[_0x09ac('0x23')](function(_0x17b62d){var _0x36c97f=_[_0x09ac('0x2f')](_0x4a02c1['body'],function(_0x1f0e52){delete _0x1f0e52['id'];_0x1f0e52[_0x09ac('0x4e')]=_0x4a02c1[_0x09ac('0x44')]['id'];return _0x1f0e52;});return db['AnalyticFieldReport'][_0x09ac('0x47')](_0x36c97f,{'transaction':_0x4b2194});});})[_0x09ac('0x23')](function(){return db['AnalyticFieldReport'][_0x09ac('0x4f')]({'where':{'CustomReportId':_0x4a02c1[_0x09ac('0x44')]['id']}});});}})['then'](respondWithResult(_0x2e6991,null))[_0x09ac('0x43')](handleError(_0x2e6991,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index b80fd92..fd92556 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 _0xe8dd=['../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xe8dd,0x65));var _0xde8d=function(_0x45af6b,_0x1a4ea8){_0x45af6b=_0x45af6b-0x0;var _0x3bf8a7=_0xe8dd[_0x45af6b];return _0x3bf8a7;};'use strict';var _=require(_0xde8d('0x0'));var util=require(_0xde8d('0x1'));var logger=require(_0xde8d('0x2'))(_0xde8d('0x3'));var moment=require(_0xde8d('0x4'));var BPromise=require(_0xde8d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xde8d('0x6'));var config=require(_0xde8d('0x7'));var attributes=require(_0xde8d('0x8'));module[_0xde8d('0x9')]=function(_0x89d73b,_0x5a66c8){return _0x89d73b[_0xde8d('0xa')](_0xde8d('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d8d=['api','moment','bluebird','path','../../config/environment','AnalyticFieldReport','lodash','util','../../config/logger'];(function(_0x1efc3a,_0x1ca4ce){var _0x176fb1=function(_0x467fe6){while(--_0x467fe6){_0x1efc3a['push'](_0x1efc3a['shift']());}};_0x176fb1(++_0x1ca4ce);}(_0x6d8d,0x9f));var _0xd6d8=function(_0x18b5e2,_0x230b5f){_0x18b5e2=_0x18b5e2-0x0;var _0x257006=_0x6d8d[_0x18b5e2];return _0x257006;};'use strict';var _=require(_0xd6d8('0x0'));var util=require(_0xd6d8('0x1'));var logger=require(_0xd6d8('0x2'))(_0xd6d8('0x3'));var moment=require(_0xd6d8('0x4'));var BPromise=require(_0xd6d8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6d8('0x6'));var rimraf=require('rimraf');var config=require(_0xd6d8('0x7'));var attributes=require('./analyticFieldReport.attributes');module['exports']=function(_0x11a0e4,_0x5a1752){return _0x11a0e4['define'](_0xd6d8('0x8'),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 2ad8936..985ff88 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 _0x8faa=['request\x20sent','result','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5d6c3e,_0x409a3e){var _0x44ecb7=function(_0x936b6a){while(--_0x936b6a){_0x5d6c3e['push'](_0x5d6c3e['shift']());}};_0x44ecb7(++_0x409a3e);}(_0x8faa,0x9a));var _0xa8fa=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x8faa[_0x2df507];return _0x1f7167;};'use strict';var _=require(_0xa8fa('0x0'));var util=require(_0xa8fa('0x1'));var moment=require(_0xa8fa('0x2'));var BPromise=require('bluebird');var rs=require(_0xa8fa('0x3'));var fs=require('fs');var Redis=require(_0xa8fa('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa8fa('0x5'))(_0xa8fa('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa8fa('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x511c6f,_0x5412db,_0x1d65fd){return new BPromise(function(_0xf073f,_0x4419c5){return client[_0xa8fa('0x8')](_0x511c6f,_0x1d65fd)[_0xa8fa('0x9')](function(_0x1fa7d4){logger[_0xa8fa('0xa')](_0xa8fa('0xb'),_0x5412db,'request\x20sent');logger['debug'](_0xa8fa('0xc'),_0x5412db,'request\x20sent',JSON[_0xa8fa('0xd')](_0x1fa7d4));if(_0x1fa7d4[_0xa8fa('0xe')]){if(_0x1fa7d4[_0xa8fa('0xe')][_0xa8fa('0xf')]===0x1f4){logger[_0xa8fa('0xe')](_0xa8fa('0xb'),_0x5412db,_0x1fa7d4['error'][_0xa8fa('0x10')]);return _0x4419c5(_0x1fa7d4[_0xa8fa('0xe')][_0xa8fa('0x10')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x5412db,_0x1fa7d4['error'][_0xa8fa('0x10')]);return _0xf073f(_0x1fa7d4[_0xa8fa('0xe')][_0xa8fa('0x10')]);}else{logger[_0xa8fa('0xa')](_0xa8fa('0xb'),_0x5412db,_0xa8fa('0x11'));_0xf073f(_0x1fa7d4[_0xa8fa('0x12')][_0xa8fa('0x10')]);}})['catch'](function(_0x1188a2){logger[_0xa8fa('0xe')](_0xa8fa('0xb'),_0x5412db,_0x1188a2);_0x4419c5(_0x1188a2);});});} \ No newline at end of file +var _0x2250=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2250,0x164));var _0x0225=function(_0x46dab8,_0x4ef8ed){_0x46dab8=_0x46dab8-0x0;var _0x3d1e3a=_0x2250[_0x46dab8];return _0x3d1e3a;};'use strict';var _=require(_0x0225('0x0'));var util=require('util');var moment=require(_0x0225('0x1'));var BPromise=require(_0x0225('0x2'));var rs=require(_0x0225('0x3'));var fs=require('fs');var Redis=require(_0x0225('0x4'));var db=require(_0x0225('0x5'))['db'];var utils=require(_0x0225('0x6'));var logger=require(_0x0225('0x7'))(_0x0225('0x8'));var config=require(_0x0225('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0225('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7b2636,_0x66dc2c,_0x5b8b46){return new BPromise(function(_0x3b4d8d,_0x32f80d){return client[_0x0225('0xb')](_0x7b2636,_0x5b8b46)[_0x0225('0xc')](function(_0x90bda2){logger[_0x0225('0xd')](_0x0225('0xe'),_0x66dc2c,'request\x20sent');logger[_0x0225('0xf')](_0x0225('0x10'),_0x66dc2c,_0x0225('0x11'),JSON[_0x0225('0x12')](_0x90bda2));if(_0x90bda2[_0x0225('0x13')]){if(_0x90bda2[_0x0225('0x13')][_0x0225('0x14')]===0x1f4){logger[_0x0225('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x66dc2c,_0x90bda2[_0x0225('0x13')][_0x0225('0x15')]);return _0x32f80d(_0x90bda2[_0x0225('0x13')][_0x0225('0x15')]);}logger['error'](_0x0225('0xe'),_0x66dc2c,_0x90bda2[_0x0225('0x13')][_0x0225('0x15')]);return _0x3b4d8d(_0x90bda2[_0x0225('0x13')][_0x0225('0x15')]);}else{logger[_0x0225('0xd')](_0x0225('0xe'),_0x66dc2c,_0x0225('0x11'));_0x3b4d8d(_0x90bda2[_0x0225('0x16')][_0x0225('0x15')]);}})[_0x0225('0x17')](function(_0x3b1a54){logger[_0x0225('0x13')](_0x0225('0xe'),_0x66dc2c,_0x3b1a54);_0x32f80d(_0x3b1a54);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index d85c5a7..1519dd6 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(_0x55bf5e,_0x36933f){var _0x459419=function(_0x45ddc3){while(--_0x45ddc3){_0x55bf5e['push'](_0x55bf5e['shift']());}};_0x459419(++_0x36933f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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(_0x3283db,_0x41b09d){var _0x10c62f=function(_0x574c9f){while(--_0x574c9f){_0x3283db['push'](_0x3283db['shift']());}};_0x10c62f(++_0x41b09d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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 b86b92a..31a3659 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 _0x282b=['sequelize','exports','STRING','name'];(function(_0x206969,_0x2106e4){var _0x20a94d=function(_0x4dd625){while(--_0x4dd625){_0x206969['push'](_0x206969['shift']());}};_0x20a94d(++_0x2106e4);}(_0x282b,0xec));var _0xb282=function(_0x111780,_0xe5970b){_0x111780=_0x111780-0x0;var _0x5edc21=_0x282b[_0x111780];return _0x5edc21;};'use strict';var Sequelize=require(_0xb282('0x0'));module[_0xb282('0x1')]={'name':{'type':Sequelize[_0xb282('0x2')],'allowNull':![],'unique':_0xb282('0x3')},'table':{'type':Sequelize[_0xb282('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8ba2=['exports','STRING','TEXT','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8ba2,0x13f));var _0x28ba=function(_0x34288e,_0x23b339){_0x34288e=_0x34288e-0x0;var _0x21f500=_0x8ba2[_0x34288e];return _0x21f500;};'use strict';var Sequelize=require(_0x28ba('0x0'));module[_0x28ba('0x1')]={'name':{'type':Sequelize[_0x28ba('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x28ba('0x2')]},'metric':{'type':Sequelize[_0x28ba('0x3')]},'description':{'type':Sequelize[_0x28ba('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 9aadbf9..a25bbf4 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 _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x2d136c,_0x2bd813){var _0x483850=function(_0xec695e){while(--_0xec695e){_0x2d136c['push'](_0x2d136c['shift']());}};_0x483850(++_0x2bd813);}(_0x008c,0x188));var _0xc008=function(_0x48e6f1,_0x1bd3e8){_0x48e6f1=_0x48e6f1-0x0;var _0x154ae1=_0x008c[_0x48e6f1];return _0x154ae1;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));}; \ No newline at end of file +var _0x425d=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','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','eml-format','zip-dir','fast-json-patch','request-promise','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','merge'];(function(_0x55b14c,_0x56803e){var _0x48e104=function(_0xe98e28){while(--_0xe98e28){_0x55b14c['push'](_0x55b14c['shift']());}};_0x48e104(++_0x56803e);}(_0x425d,0x1e0));var _0xd425=function(_0x491001,_0x2e13ee){_0x491001=_0x491001-0x0;var _0x2971ef=_0x425d[_0x491001];return _0x2971ef;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){var _0x264b0e=_0x40e84b[_0xd425('0x2b')]({'plain':!![]});var _0x1908a5=_0xd425('0x2c');return db[_0xd425('0x2d')][_0xd425('0x2e')]({'where':{'type':_0x1908a5,'resourceId':_0x264b0e['id']}})['then'](function(){return _0x40e84b;});})[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x57c950,_0x27ef8a){return function(_0x3ad9bd){if(!_0x3ad9bd){_0x57c950[_0xd425('0x1d')](0x194);}return _0x3ad9bd;};}function handleError(_0x999fb9,_0x27d29a){_0x27d29a=_0x27d29a||0x1f4;return function(_0x185d7e){logger[_0xd425('0x2f')](_0x185d7e[_0xd425('0x30')]);if(_0x185d7e[_0xd425('0x31')]){delete _0x185d7e[_0xd425('0x31')];}_0x999fb9['status'](_0x27d29a)[_0xd425('0x32')](_0x185d7e);};}exports[_0xd425('0x33')]=function(_0x298602,_0x3695dd){var _0x3275b1={},_0x1abf33={},_0x47405f={'count':0x0,'rows':[]};var _0x40c392=_[_0xd425('0x34')](db[_0xd425('0x35')][_0xd425('0x36')],function(_0x5f3dab){return{'name':_0x5f3dab[_0xd425('0x37')],'type':_0x5f3dab[_0xd425('0x38')][_0xd425('0x39')]};});_0x1abf33[_0xd425('0x3a')]=_[_0xd425('0x34')](_0x40c392,'name');_0x1abf33[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x298602['query']);_0x1abf33['filters']=_['intersection'](_0x1abf33[_0xd425('0x3a')],_0x1abf33[_0xd425('0x3b')]);_0x3275b1[_0xd425('0x3d')]=_[_0xd425('0x3e')](_0x1abf33['model'],qs[_0xd425('0x3f')](_0x298602[_0xd425('0x3b')][_0xd425('0x3f')]));_0x3275b1[_0xd425('0x3d')]=_0x3275b1[_0xd425('0x3d')][_0xd425('0x40')]?_0x3275b1[_0xd425('0x3d')]:_0x1abf33['model'];if(!_0x298602[_0xd425('0x3b')]['hasOwnProperty'](_0xd425('0x41'))){_0x3275b1[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x298602['query'][_0xd425('0x23')]);_0x3275b1[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x298602[_0xd425('0x3b')]['offset']);}_0x3275b1[_0xd425('0x42')]=qs[_0xd425('0x43')](_0x298602['query']['sort']);_0x3275b1['where']=qs[_0xd425('0x44')](_[_0xd425('0x45')](_0x298602[_0xd425('0x3b')],_0x1abf33['filters']),_0x40c392);if(_0x298602['query']['filter']){_0x3275b1[_0xd425('0x46')]=_[_0xd425('0x47')](_0x3275b1[_0xd425('0x46')],{'$or':_[_0xd425('0x34')](_0x40c392,function(_0xa9fd7c){if(_0xa9fd7c[_0xd425('0x38')]!==_0xd425('0x48')){var _0x4b922f={};_0x4b922f[_0xa9fd7c[_0xd425('0x31')]]={'$like':'%'+_0x298602[_0xd425('0x3b')][_0xd425('0x49')]+'%'};return _0x4b922f;}})});}_0x3275b1=_['merge']({},_0x3275b1,_0x298602[_0xd425('0x4a')]);var _0x2dffc7={'where':_0x3275b1[_0xd425('0x46')]};return db['AnalyticMetric'][_0xd425('0x24')](_0x2dffc7)[_0xd425('0x2a')](function(_0x1c5ba6){_0x47405f[_0xd425('0x24')]=_0x1c5ba6;if(_0x298602['query'][_0xd425('0x4b')]){_0x3275b1[_0xd425('0x4c')]=[{'all':!![]}];}return db[_0xd425('0x35')][_0xd425('0x4d')](_0x3275b1);})[_0xd425('0x2a')](function(_0x2f6bf7){_0x47405f[_0xd425('0x4e')]=_0x2f6bf7;return _0x47405f;})['then'](respondWithFilteredResult(_0x3695dd,_0x3275b1))[_0xd425('0x4f')](handleError(_0x3695dd,null));};exports[_0xd425('0x50')]=function(_0x5b65fe,_0x1a44a8){var _0x491c51={'raw':!![],'where':{'id':_0x5b65fe[_0xd425('0x51')]['id']}},_0x5e12bf={};_0x5e12bf['model']=_[_0xd425('0x3c')](db['AnalyticMetric'][_0xd425('0x36')]);_0x5e12bf[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x5b65fe[_0xd425('0x3b')]);_0x5e12bf[_0xd425('0x44')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],_0x5e12bf['query']);_0x491c51[_0xd425('0x3d')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],qs[_0xd425('0x3f')](_0x5b65fe[_0xd425('0x3b')][_0xd425('0x3f')]));_0x491c51[_0xd425('0x3d')]=_0x491c51['attributes'][_0xd425('0x40')]?_0x491c51[_0xd425('0x3d')]:_0x5e12bf[_0xd425('0x3a')];if(_0x5b65fe[_0xd425('0x3b')][_0xd425('0x4b')]){_0x491c51['include']=[{'all':!![]}];}_0x491c51=_[_0xd425('0x47')]({},_0x491c51,_0x5b65fe[_0xd425('0x4a')]);return db[_0xd425('0x35')][_0xd425('0x52')](_0x491c51)[_0xd425('0x2a')](handleEntityNotFound(_0x1a44a8,null))[_0xd425('0x2a')](respondWithResult(_0x1a44a8,null))['catch'](handleError(_0x1a44a8,null));};exports[_0xd425('0x53')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x35')][_0xd425('0x53')](_0x128cb3[_0xd425('0x54')],{})[_0xd425('0x2a')](function(_0x5c0219){var _0x54f1d=_0x128cb3[_0xd425('0x55')][_0xd425('0x2b')]({'plain':!![]});if(!_0x54f1d)throw new Error(_0xd425('0x56'));if(_0x54f1d[_0xd425('0x57')]==='user'){var _0x4be6fa=_0x5c0219[_0xd425('0x2b')]({'plain':!![]});var _0x5496d8=_0xd425('0x2c');return db[_0xd425('0x58')]['find']({'where':{'name':_0x5496d8,'userProfileId':_0x54f1d[_0xd425('0x59')]},'raw':!![]})['then'](function(_0x48d5b8){if(_0x48d5b8&&_0x48d5b8[_0xd425('0x5a')]===0x0){return db[_0xd425('0x2d')][_0xd425('0x53')]({'name':_0x4be6fa[_0xd425('0x31')],'resourceId':_0x4be6fa['id'],'type':_0x48d5b8[_0xd425('0x31')],'sectionId':_0x48d5b8['id']},{})[_0xd425('0x2a')](function(){return _0x5c0219;});}else{return _0x5c0219;}})[_0xd425('0x4f')](function(_0x4118fe){logger['error'](_0xd425('0x5b'),_0x4118fe);throw _0x4118fe;});}return _0x5c0219;})[_0xd425('0x2a')](respondWithResult(_0x5bfac6,0xc9))[_0xd425('0x4f')](handleError(_0x5bfac6,null));};exports[_0xd425('0x29')]=function(_0x7b1080,_0x1c80c2){if(_0x7b1080[_0xd425('0x54')]['id']){delete _0x7b1080[_0xd425('0x54')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x7b1080['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1c80c2,null))[_0xd425('0x2a')](saveUpdates(_0x7b1080[_0xd425('0x54')],null))[_0xd425('0x2a')](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['destroy']=function(_0x499a60,_0x5e1294){return db[_0xd425('0x35')][_0xd425('0x52')]({'where':{'id':_0x499a60['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5e1294,null))[_0xd425('0x2a')](removeEntity(_0x5e1294,null))[_0xd425('0x4f')](handleError(_0x5e1294,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 52bf436..0c1c4a6 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 _0x5785=['request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','util','../../config/logger','api','moment'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x5785,0x119));var _0x5578=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x5785[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0x5578('0x0'));var util=require(_0x5578('0x1'));var logger=require(_0x5578('0x2'))(_0x5578('0x3'));var moment=require(_0x5578('0x4'));var BPromise=require('bluebird');var rp=require(_0x5578('0x5'));var fs=require('fs');var path=require(_0x5578('0x6'));var rimraf=require(_0x5578('0x7'));var config=require(_0x5578('0x8'));var attributes=require(_0x5578('0x9'));module[_0x5578('0xa')]=function(_0x35a1f4,_0x1a9d73){return _0x35a1f4[_0x5578('0xb')](_0x5578('0xc'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4819=['analytics_metrics','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','AnalyticMetric'];(function(_0x886924,_0x1f6adf){var _0x1ba368=function(_0x45eff4){while(--_0x45eff4){_0x886924['push'](_0x886924['shift']());}};_0x1ba368(++_0x1f6adf);}(_0x4819,0xcd));var _0x9481=function(_0x4ad6e4,_0x103161){_0x4ad6e4=_0x4ad6e4-0x0;var _0x11e62a=_0x4819[_0x4ad6e4];return _0x11e62a;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'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 27fb5bf..5b62bc3 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 _0xd289=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','info','result','lodash','util','moment'];(function(_0x11c361,_0x4f5b42){var _0x1f5355=function(_0x259200){while(--_0x259200){_0x11c361['push'](_0x11c361['shift']());}};_0x1f5355(++_0x4f5b42);}(_0xd289,0x123));var _0x9d28=function(_0x2e78db,_0x5ab8a1){_0x2e78db=_0x2e78db-0x0;var _0x195fb4=_0xd289[_0x2e78db];return _0x195fb4;};'use strict';var _=require(_0x9d28('0x0'));var util=require(_0x9d28('0x1'));var moment=require(_0x9d28('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d28('0x3'));var db=require(_0x9d28('0x4'))['db'];var utils=require(_0x9d28('0x5'));var logger=require('../../config/logger')(_0x9d28('0x6'));var config=require(_0x9d28('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9d28('0x8')][_0x9d28('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43e67c,_0x57c717,_0x504f45){return new BPromise(function(_0x125afb,_0x372542){return client[_0x9d28('0xa')](_0x43e67c,_0x504f45)[_0x9d28('0xb')](function(_0x1cbe67){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x57c717,_0x9d28('0xc'));logger[_0x9d28('0xd')](_0x9d28('0xe'),_0x57c717,_0x9d28('0xc'),JSON[_0x9d28('0xf')](_0x1cbe67));if(_0x1cbe67[_0x9d28('0x10')]){if(_0x1cbe67[_0x9d28('0x10')]['code']===0x1f4){logger[_0x9d28('0x10')](_0x9d28('0x11'),_0x57c717,_0x1cbe67['error'][_0x9d28('0x12')]);return _0x372542(_0x1cbe67['error']['message']);}logger[_0x9d28('0x10')](_0x9d28('0x11'),_0x57c717,_0x1cbe67[_0x9d28('0x10')][_0x9d28('0x12')]);return _0x125afb(_0x1cbe67[_0x9d28('0x10')][_0x9d28('0x12')]);}else{logger[_0x9d28('0x13')](_0x9d28('0x11'),_0x57c717,'request\x20sent');_0x125afb(_0x1cbe67[_0x9d28('0x14')]['message']);}})['catch'](function(_0x545b3b){logger['error'](_0x9d28('0x11'),_0x57c717,_0x545b3b);_0x372542(_0x545b3b);});});} \ No newline at end of file +var _0xcfd9=['message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','AnalyticMetric,\x20%s,\x20%s'];(function(_0x3e9c2c,_0x2d5157){var _0x1ad468=function(_0x344b06){while(--_0x344b06){_0x3e9c2c['push'](_0x3e9c2c['shift']());}};_0x1ad468(++_0x2d5157);}(_0xcfd9,0xea));var _0x9cfd=function(_0x4ec520,_0x15fee2){_0x4ec520=_0x4ec520-0x0;var _0xed49d7=_0xcfd9[_0x4ec520];return _0xed49d7;};'use strict';var _=require(_0x9cfd('0x0'));var util=require(_0x9cfd('0x1'));var moment=require('moment');var BPromise=require(_0x9cfd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9cfd('0x3'));var db=require(_0x9cfd('0x4'))['db'];var utils=require(_0x9cfd('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9cfd('0x6'));var jayson=require(_0x9cfd('0x7'));var client=jayson['client'][_0x9cfd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x146937,_0x569f90,_0x2f9386){return new BPromise(function(_0x287d8b,_0x440fc8){return client[_0x9cfd('0x9')](_0x146937,_0x2f9386)[_0x9cfd('0xa')](function(_0x5dcb66){logger[_0x9cfd('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x569f90,_0x9cfd('0xc'));logger[_0x9cfd('0xd')](_0x9cfd('0xe'),_0x569f90,_0x9cfd('0xc'),JSON['stringify'](_0x5dcb66));if(_0x5dcb66[_0x9cfd('0xf')]){if(_0x5dcb66['error'][_0x9cfd('0x10')]===0x1f4){logger[_0x9cfd('0xf')](_0x9cfd('0x11'),_0x569f90,_0x5dcb66['error']['message']);return _0x440fc8(_0x5dcb66[_0x9cfd('0xf')][_0x9cfd('0x12')]);}logger[_0x9cfd('0xf')](_0x9cfd('0x11'),_0x569f90,_0x5dcb66[_0x9cfd('0xf')][_0x9cfd('0x12')]);return _0x287d8b(_0x5dcb66['error']['message']);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x569f90,_0x9cfd('0xc'));_0x287d8b(_0x5dcb66[_0x9cfd('0x13')]['message']);}})[_0x9cfd('0x14')](function(_0x28b8dd){logger[_0x9cfd('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x569f90,_0x28b8dd);_0x440fc8(_0x28b8dd);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index f3d81df..0b8e958 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 _0x07d7=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy'];(function(_0x349942,_0xaf2dc4){var _0x40a55b=function(_0x460e5c){while(--_0x460e5c){_0x349942['push'](_0x349942['shift']());}};_0x40a55b(++_0xaf2dc4);}(_0x07d7,0x85));var _0x707d=function(_0x1fcaf1,_0x21c3c2){_0x1fcaf1=_0x1fcaf1-0x0;var _0x55f464=_0x07d7[_0x1fcaf1];return _0x55f464;};'use strict';var multer=require(_0x707d('0x0'));var util=require(_0x707d('0x1'));var path=require(_0x707d('0x2'));var timeout=require(_0x707d('0x3'));var express=require(_0x707d('0x4'));var router=express[_0x707d('0x5')]();var fs_extra=require(_0x707d('0x6'));var auth=require(_0x707d('0x7'));var interaction=require(_0x707d('0x8'));var config=require(_0x707d('0x9'));var controller=require(_0x707d('0xa'));router[_0x707d('0xb')]('/',auth[_0x707d('0xc')](),controller[_0x707d('0xd')]);router[_0x707d('0xb')](_0x707d('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x707d('0xf')]('/',auth[_0x707d('0xc')](),controller[_0x707d('0x10')]);router[_0x707d('0x11')](_0x707d('0xe'),auth['isAuthenticated'](),controller[_0x707d('0x12')]);router[_0x707d('0x13')](_0x707d('0xe'),auth['isAuthenticated'](),controller[_0x707d('0x14')]);module[_0x707d('0x15')]=router; \ No newline at end of file +var _0x5b7f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x5b7f,0x8c));var _0xf5b7=function(_0x12c90c,_0x29c6d7){_0x12c90c=_0x12c90c-0x0;var _0x14f0f5=_0x5b7f[_0x12c90c];return _0x14f0f5;};'use strict';var multer=require(_0xf5b7('0x0'));var util=require(_0xf5b7('0x1'));var path=require(_0xf5b7('0x2'));var timeout=require(_0xf5b7('0x3'));var express=require(_0xf5b7('0x4'));var router=express[_0xf5b7('0x5')]();var fs_extra=require(_0xf5b7('0x6'));var auth=require(_0xf5b7('0x7'));var interaction=require(_0xf5b7('0x8'));var config=require(_0xf5b7('0x9'));var controller=require(_0xf5b7('0xa'));router[_0xf5b7('0xb')]('/',auth[_0xf5b7('0xc')](),controller[_0xf5b7('0xd')]);router[_0xf5b7('0xb')](_0xf5b7('0xe'),auth[_0xf5b7('0xc')](),controller[_0xf5b7('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf5b7('0x10')](_0xf5b7('0xe'),auth[_0xf5b7('0xc')](),controller[_0xf5b7('0x11')]);router[_0xf5b7('0x12')](_0xf5b7('0xe'),auth[_0xf5b7('0xc')](),controller[_0xf5b7('0x13')]);module[_0xf5b7('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 c52194e..ab72a91 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 _0xb50a=['sequelize'];(function(_0x576266,_0x4002b0){var _0x18234f=function(_0x4e9ad5){while(--_0x4e9ad5){_0x576266['push'](_0x576266['shift']());}};_0x18234f(++_0x4002b0);}(_0xb50a,0x105));var _0xab50=function(_0x3eddab,_0x2179e6){_0x3eddab=_0x3eddab-0x0;var _0x2c6877=_0xb50a[_0x3eddab];return _0x2c6877;};'use strict';var Sequelize=require(_0xab50('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x42e5=['TEXT'];(function(_0x5a750a,_0x30d794){var _0x21335d=function(_0x4241c1){while(--_0x4241c1){_0x5a750a['push'](_0x5a750a['shift']());}};_0x21335d(++_0x30d794);}(_0x42e5,0x113));var _0x542e=function(_0x206487,_0x28eec1){_0x206487=_0x206487-0x0;var _0x2714c7=_0x42e5[_0x206487];return _0x2714c7;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x542e('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 17933e2..37edadd 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 _0x73fc=['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','limit','undefined','count','set','apply','save','update','then','destroy','sendStatus','name','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','AnalyticTreeReport','includeAll','include','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x73fc,0x115));var _0xc73f=function(_0x4d30ce,_0x2b0b62){_0x4d30ce=_0x4d30ce-0x0;var _0xe8d9cc=_0x73fc[_0x4d30ce];return _0xe8d9cc;};'use strict';var emlformat=require(_0xc73f('0x0'));var rimraf=require(_0xc73f('0x1'));var zipdir=require(_0xc73f('0x2'));var jsonpatch=require(_0xc73f('0x3'));var rp=require(_0xc73f('0x4'));var moment=require(_0xc73f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc73f('0x6'));var path=require(_0xc73f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc73f('0x8'));var fs=require('fs');var fs_extra=require(_0xc73f('0x9'));var _=require(_0xc73f('0xa'));var squel=require(_0xc73f('0xb'));var crypto=require('crypto');var jsforce=require(_0xc73f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc73f('0xd'));var querystring=require(_0xc73f('0xe'));var Papa=require(_0xc73f('0xf'));var Redis=require(_0xc73f('0x10'));var authService=require(_0xc73f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc73f('0x12'));var hardwareService=require(_0xc73f('0x13'));var logger=require(_0xc73f('0x14'))(_0xc73f('0x15'));var utils=require(_0xc73f('0x16'));var config=require(_0xc73f('0x17'));var licenseUtil=require(_0xc73f('0x18'));var db=require(_0xc73f('0x19'))['db'];function respondWithStatusCode(_0x3c1b7a,_0x55fbf7){_0x55fbf7=_0x55fbf7||0xcc;return function(_0x4be378){if(_0x4be378){return _0x3c1b7a['sendStatus'](_0x55fbf7);}return _0x3c1b7a[_0xc73f('0x1a')](_0x55fbf7)[_0xc73f('0x1b')]();};}function respondWithResult(_0x291334,_0x52bb88){_0x52bb88=_0x52bb88||0xc8;return function(_0x36d3ba){if(_0x36d3ba){return _0x291334[_0xc73f('0x1a')](_0x52bb88)[_0xc73f('0x1c')](_0x36d3ba);}};}function respondWithFilteredResult(_0x2bdf0b,_0x1640d4){return function(_0x5f52de){if(_0x5f52de){var _0x2e55db=typeof _0x1640d4[_0xc73f('0x1d')]==='undefined'&&typeof _0x1640d4[_0xc73f('0x1e')]===_0xc73f('0x1f');var _0x4955ca=_0x5f52de[_0xc73f('0x20')];var _0x6b7fb8=_0x2e55db?0x0:_0x1640d4[_0xc73f('0x1d')];var _0x21345b=_0x2e55db?_0x5f52de['count']:_0x1640d4[_0xc73f('0x1d')]+_0x1640d4[_0xc73f('0x1e')];var _0x3133a8;if(_0x21345b>=_0x4955ca){_0x21345b=_0x4955ca;_0x3133a8=0xc8;}else{_0x3133a8=0xce;}_0x2bdf0b[_0xc73f('0x1a')](_0x3133a8);return _0x2bdf0b[_0xc73f('0x21')]('Content-Range',_0x6b7fb8+'-'+_0x21345b+'/'+_0x4955ca)[_0xc73f('0x1c')](_0x5f52de);}return null;};}function patchUpdates(_0x385c0b){return function(_0x4b5f70){try{jsonpatch[_0xc73f('0x22')](_0x4b5f70,_0x385c0b,!![]);}catch(_0xeddbf5){return BPromise['reject'](_0xeddbf5);}return _0x4b5f70[_0xc73f('0x23')]();};}function saveUpdates(_0x37c418,_0x3f25d2){return function(_0x4c4818){if(_0x4c4818){return _0x4c4818[_0xc73f('0x24')](_0x37c418)[_0xc73f('0x25')](function(_0x50a1b5){return _0x50a1b5;});}return null;};}function removeEntity(_0x2abecf,_0x3242fe){return function(_0x48b2a2){if(_0x48b2a2){return _0x48b2a2[_0xc73f('0x26')]()[_0xc73f('0x25')](function(){_0x2abecf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x154be0,_0x399193){return function(_0x3fc8d1){if(!_0x3fc8d1){_0x154be0[_0xc73f('0x27')](0x194);}return _0x3fc8d1;};}function handleError(_0x43e0bb,_0x13bfbb){_0x13bfbb=_0x13bfbb||0x1f4;return function(_0x293bfd){logger['error'](_0x293bfd['stack']);if(_0x293bfd[_0xc73f('0x28')]){delete _0x293bfd[_0xc73f('0x28')];}_0x43e0bb[_0xc73f('0x1a')](_0x13bfbb)['send'](_0x293bfd);};}exports[_0xc73f('0x29')]=function(_0x228fb5,_0x529fd1){var _0x8c873d={},_0x404620={},_0x4f247e={'count':0x0,'rows':[]};var _0x2bcfa6=_[_0xc73f('0x2a')](db['AnalyticTreeReport'][_0xc73f('0x2b')],function(_0x15d8b9){return{'name':_0x15d8b9[_0xc73f('0x2c')],'type':_0x15d8b9['type']['key']};});_0x404620[_0xc73f('0x2d')]=_[_0xc73f('0x2a')](_0x2bcfa6,_0xc73f('0x28'));_0x404620[_0xc73f('0x2e')]=_[_0xc73f('0x2f')](_0x228fb5['query']);_0x404620[_0xc73f('0x30')]=_[_0xc73f('0x31')](_0x404620[_0xc73f('0x2d')],_0x404620[_0xc73f('0x2e')]);_0x8c873d[_0xc73f('0x32')]=_[_0xc73f('0x31')](_0x404620[_0xc73f('0x2d')],qs[_0xc73f('0x33')](_0x228fb5['query'][_0xc73f('0x33')]));_0x8c873d[_0xc73f('0x32')]=_0x8c873d['attributes']['length']?_0x8c873d[_0xc73f('0x32')]:_0x404620[_0xc73f('0x2d')];if(!_0x228fb5['query'][_0xc73f('0x34')](_0xc73f('0x35'))){_0x8c873d[_0xc73f('0x1e')]=qs[_0xc73f('0x1e')](_0x228fb5[_0xc73f('0x2e')]['limit']);_0x8c873d[_0xc73f('0x1d')]=qs['offset'](_0x228fb5[_0xc73f('0x2e')][_0xc73f('0x1d')]);}_0x8c873d['order']=qs['sort'](_0x228fb5['query'][_0xc73f('0x36')]);_0x8c873d[_0xc73f('0x37')]=qs[_0xc73f('0x30')](_[_0xc73f('0x38')](_0x228fb5[_0xc73f('0x2e')],_0x404620[_0xc73f('0x30')]),_0x2bcfa6);if(_0x228fb5[_0xc73f('0x2e')][_0xc73f('0x39')]){_0x8c873d[_0xc73f('0x37')]=_[_0xc73f('0x3a')](_0x8c873d[_0xc73f('0x37')],{'$or':_['map'](_0x2bcfa6,function(_0x16cfbe){if(_0x16cfbe[_0xc73f('0x3b')]!==_0xc73f('0x3c')){var _0x4bdd75={};_0x4bdd75[_0x16cfbe[_0xc73f('0x28')]]={'$like':'%'+_0x228fb5['query'][_0xc73f('0x39')]+'%'};return _0x4bdd75;}})});}_0x8c873d=_['merge']({},_0x8c873d,_0x228fb5[_0xc73f('0x3d')]);var _0x314f95={'where':_0x8c873d[_0xc73f('0x37')]};return db[_0xc73f('0x3e')][_0xc73f('0x20')](_0x314f95)[_0xc73f('0x25')](function(_0x781c62){_0x4f247e['count']=_0x781c62;if(_0x228fb5[_0xc73f('0x2e')][_0xc73f('0x3f')]){_0x8c873d[_0xc73f('0x40')]=[{'all':!![]}];}return db[_0xc73f('0x3e')]['findAll'](_0x8c873d);})[_0xc73f('0x25')](function(_0x50baf4){_0x4f247e[_0xc73f('0x41')]=_0x50baf4;return _0x4f247e;})['then'](respondWithFilteredResult(_0x529fd1,_0x8c873d))[_0xc73f('0x42')](handleError(_0x529fd1,null));};exports[_0xc73f('0x43')]=function(_0x397f3d,_0x45613f){var _0x2aa746={'raw':!![],'where':{'id':_0x397f3d[_0xc73f('0x44')]['id']}},_0x42a770={};_0x42a770['model']=_[_0xc73f('0x2f')](db[_0xc73f('0x3e')][_0xc73f('0x2b')]);_0x42a770[_0xc73f('0x2e')]=_[_0xc73f('0x2f')](_0x397f3d[_0xc73f('0x2e')]);_0x42a770[_0xc73f('0x30')]=_['intersection'](_0x42a770[_0xc73f('0x2d')],_0x42a770[_0xc73f('0x2e')]);_0x2aa746[_0xc73f('0x32')]=_[_0xc73f('0x31')](_0x42a770['model'],qs[_0xc73f('0x33')](_0x397f3d[_0xc73f('0x2e')][_0xc73f('0x33')]));_0x2aa746[_0xc73f('0x32')]=_0x2aa746[_0xc73f('0x32')][_0xc73f('0x45')]?_0x2aa746[_0xc73f('0x32')]:_0x42a770[_0xc73f('0x2d')];if(_0x397f3d[_0xc73f('0x2e')][_0xc73f('0x3f')]){_0x2aa746[_0xc73f('0x40')]=[{'all':!![]}];}_0x2aa746=_[_0xc73f('0x3a')]({},_0x2aa746,_0x397f3d[_0xc73f('0x3d')]);return db[_0xc73f('0x3e')][_0xc73f('0x46')](_0x2aa746)['then'](handleEntityNotFound(_0x45613f,null))[_0xc73f('0x25')](respondWithResult(_0x45613f,null))[_0xc73f('0x42')](handleError(_0x45613f,null));};exports['create']=function(_0x5e43f2,_0x509bcd){return db['AnalyticTreeReport'][_0xc73f('0x47')](_0x5e43f2['body'],{})[_0xc73f('0x25')](respondWithResult(_0x509bcd,0xc9))['catch'](handleError(_0x509bcd,null));};exports[_0xc73f('0x24')]=function(_0x3db903,_0xf8a2aa){if(_0x3db903[_0xc73f('0x48')]['id']){delete _0x3db903[_0xc73f('0x48')]['id'];}return db[_0xc73f('0x3e')][_0xc73f('0x46')]({'where':{'id':_0x3db903['params']['id']}})['then'](handleEntityNotFound(_0xf8a2aa,null))['then'](saveUpdates(_0x3db903[_0xc73f('0x48')],null))[_0xc73f('0x25')](respondWithResult(_0xf8a2aa,null))['catch'](handleError(_0xf8a2aa,null));};exports['destroy']=function(_0x15d8b4,_0x16f742){return db[_0xc73f('0x3e')][_0xc73f('0x46')]({'where':{'id':_0x15d8b4[_0xc73f('0x44')]['id']}})[_0xc73f('0x25')](handleEntityNotFound(_0x16f742,null))[_0xc73f('0x25')](removeEntity(_0x16f742,null))[_0xc73f('0x42')](handleError(_0x16f742,null));}; \ No newline at end of file +var _0xeaac=['update','then','destroy','end','error','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','reject','save'];(function(_0x179c4a,_0x10eb06){var _0x5d1879=function(_0x1f1dcd){while(--_0x1f1dcd){_0x179c4a['push'](_0x179c4a['shift']());}};_0x5d1879(++_0x10eb06);}(_0xeaac,0x1ed));var _0xceaa=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xeaac[_0x13e741];return _0x3f8bb3;};'use strict';var emlformat=require(_0xceaa('0x0'));var rimraf=require(_0xceaa('0x1'));var zipdir=require(_0xceaa('0x2'));var jsonpatch=require(_0xceaa('0x3'));var rp=require(_0xceaa('0x4'));var moment=require(_0xceaa('0x5'));var BPromise=require(_0xceaa('0x6'));var Mustache=require(_0xceaa('0x7'));var util=require(_0xceaa('0x8'));var path=require(_0xceaa('0x9'));var sox=require(_0xceaa('0xa'));var csv=require(_0xceaa('0xb'));var ejs=require(_0xceaa('0xc'));var fs=require('fs');var fs_extra=require(_0xceaa('0xd'));var _=require(_0xceaa('0xe'));var squel=require(_0xceaa('0xf'));var crypto=require(_0xceaa('0x10'));var jsforce=require(_0xceaa('0x11'));var deskjs=require(_0xceaa('0x12'));var toCsv=require(_0xceaa('0xb'));var querystring=require(_0xceaa('0x13'));var Papa=require('papaparse');var Redis=require(_0xceaa('0x14'));var authService=require(_0xceaa('0x15'));var qs=require(_0xceaa('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xceaa('0x17'));var logger=require(_0xceaa('0x18'))(_0xceaa('0x19'));var utils=require(_0xceaa('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xceaa('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe6d904,_0x58077a){_0x58077a=_0x58077a||0xcc;return function(_0x4be3b9){if(_0x4be3b9){return _0xe6d904[_0xceaa('0x1c')](_0x58077a);}return _0xe6d904[_0xceaa('0x1d')](_0x58077a)['end']();};}function respondWithResult(_0x284377,_0x5ecd7b){_0x5ecd7b=_0x5ecd7b||0xc8;return function(_0x3d524e){if(_0x3d524e){return _0x284377[_0xceaa('0x1d')](_0x5ecd7b)['json'](_0x3d524e);}};}function respondWithFilteredResult(_0x4131ce,_0x1204d6){return function(_0x303cf5){if(_0x303cf5){var _0xa2d1de=typeof _0x1204d6[_0xceaa('0x1e')]==='undefined'&&typeof _0x1204d6[_0xceaa('0x1f')]===_0xceaa('0x20');var _0x5868fe=_0x303cf5[_0xceaa('0x21')];var _0x5af760=_0xa2d1de?0x0:_0x1204d6[_0xceaa('0x1e')];var _0x243e84=_0xa2d1de?_0x303cf5['count']:_0x1204d6['offset']+_0x1204d6[_0xceaa('0x1f')];var _0x3ec336;if(_0x243e84>=_0x5868fe){_0x243e84=_0x5868fe;_0x3ec336=0xc8;}else{_0x3ec336=0xce;}_0x4131ce[_0xceaa('0x1d')](_0x3ec336);return _0x4131ce[_0xceaa('0x22')](_0xceaa('0x23'),_0x5af760+'-'+_0x243e84+'/'+_0x5868fe)['json'](_0x303cf5);}return null;};}function patchUpdates(_0x25a5ad){return function(_0x48247d){try{jsonpatch[_0xceaa('0x24')](_0x48247d,_0x25a5ad,!![]);}catch(_0x6705bf){return BPromise[_0xceaa('0x25')](_0x6705bf);}return _0x48247d[_0xceaa('0x26')]();};}function saveUpdates(_0x8c407,_0xc53c3d){return function(_0x17d429){if(_0x17d429){return _0x17d429[_0xceaa('0x27')](_0x8c407)[_0xceaa('0x28')](function(_0x1c7524){return _0x1c7524;});}return null;};}function removeEntity(_0x2ab129,_0x24342e){return function(_0x59429a){if(_0x59429a){return _0x59429a[_0xceaa('0x29')]()[_0xceaa('0x28')](function(){_0x2ab129['status'](0xcc)[_0xceaa('0x2a')]();});}};}function handleEntityNotFound(_0x1fe4c3,_0x4f6428){return function(_0x3640ee){if(!_0x3640ee){_0x1fe4c3['sendStatus'](0x194);}return _0x3640ee;};}function handleError(_0x2e3f5d,_0x3f081f){_0x3f081f=_0x3f081f||0x1f4;return function(_0x8653c1){logger[_0xceaa('0x2b')](_0x8653c1['stack']);if(_0x8653c1[_0xceaa('0x2c')]){delete _0x8653c1[_0xceaa('0x2c')];}_0x2e3f5d[_0xceaa('0x1d')](_0x3f081f)['send'](_0x8653c1);};}exports[_0xceaa('0x2d')]=function(_0x19a3a3,_0x461ac9){var _0x5081cf={},_0x517fb5={},_0x5d34c4={'count':0x0,'rows':[]};var _0x10f133=_[_0xceaa('0x2e')](db[_0xceaa('0x2f')][_0xceaa('0x30')],function(_0x1cddee){return{'name':_0x1cddee[_0xceaa('0x31')],'type':_0x1cddee[_0xceaa('0x32')][_0xceaa('0x33')]};});_0x517fb5[_0xceaa('0x34')]=_['map'](_0x10f133,'name');_0x517fb5['query']=_[_0xceaa('0x35')](_0x19a3a3[_0xceaa('0x36')]);_0x517fb5[_0xceaa('0x37')]=_[_0xceaa('0x38')](_0x517fb5[_0xceaa('0x34')],_0x517fb5[_0xceaa('0x36')]);_0x5081cf[_0xceaa('0x39')]=_[_0xceaa('0x38')](_0x517fb5['model'],qs[_0xceaa('0x3a')](_0x19a3a3[_0xceaa('0x36')][_0xceaa('0x3a')]));_0x5081cf[_0xceaa('0x39')]=_0x5081cf[_0xceaa('0x39')][_0xceaa('0x3b')]?_0x5081cf[_0xceaa('0x39')]:_0x517fb5['model'];if(!_0x19a3a3[_0xceaa('0x36')]['hasOwnProperty'](_0xceaa('0x3c'))){_0x5081cf[_0xceaa('0x1f')]=qs[_0xceaa('0x1f')](_0x19a3a3[_0xceaa('0x36')][_0xceaa('0x1f')]);_0x5081cf[_0xceaa('0x1e')]=qs[_0xceaa('0x1e')](_0x19a3a3[_0xceaa('0x36')][_0xceaa('0x1e')]);}_0x5081cf[_0xceaa('0x3d')]=qs['sort'](_0x19a3a3['query'][_0xceaa('0x3e')]);_0x5081cf[_0xceaa('0x3f')]=qs[_0xceaa('0x37')](_[_0xceaa('0x40')](_0x19a3a3[_0xceaa('0x36')],_0x517fb5[_0xceaa('0x37')]),_0x10f133);if(_0x19a3a3['query'][_0xceaa('0x41')]){_0x5081cf[_0xceaa('0x3f')]=_['merge'](_0x5081cf[_0xceaa('0x3f')],{'$or':_[_0xceaa('0x2e')](_0x10f133,function(_0x34764f){if(_0x34764f[_0xceaa('0x32')]!=='VIRTUAL'){var _0x18c4e8={};_0x18c4e8[_0x34764f[_0xceaa('0x2c')]]={'$like':'%'+_0x19a3a3[_0xceaa('0x36')][_0xceaa('0x41')]+'%'};return _0x18c4e8;}})});}_0x5081cf=_[_0xceaa('0x42')]({},_0x5081cf,_0x19a3a3[_0xceaa('0x43')]);var _0x4b1ea6={'where':_0x5081cf[_0xceaa('0x3f')]};return db[_0xceaa('0x2f')][_0xceaa('0x21')](_0x4b1ea6)[_0xceaa('0x28')](function(_0x4ebc3e){_0x5d34c4['count']=_0x4ebc3e;if(_0x19a3a3[_0xceaa('0x36')][_0xceaa('0x44')]){_0x5081cf[_0xceaa('0x45')]=[{'all':!![]}];}return db[_0xceaa('0x2f')]['findAll'](_0x5081cf);})[_0xceaa('0x28')](function(_0xaf4604){_0x5d34c4['rows']=_0xaf4604;return _0x5d34c4;})['then'](respondWithFilteredResult(_0x461ac9,_0x5081cf))[_0xceaa('0x46')](handleError(_0x461ac9,null));};exports[_0xceaa('0x47')]=function(_0x329d6f,_0x34837f){var _0x42c2bb={'raw':!![],'where':{'id':_0x329d6f['params']['id']}},_0x3ca437={};_0x3ca437[_0xceaa('0x34')]=_[_0xceaa('0x35')](db[_0xceaa('0x2f')][_0xceaa('0x30')]);_0x3ca437[_0xceaa('0x36')]=_['keys'](_0x329d6f[_0xceaa('0x36')]);_0x3ca437['filters']=_[_0xceaa('0x38')](_0x3ca437[_0xceaa('0x34')],_0x3ca437[_0xceaa('0x36')]);_0x42c2bb[_0xceaa('0x39')]=_[_0xceaa('0x38')](_0x3ca437[_0xceaa('0x34')],qs['fields'](_0x329d6f[_0xceaa('0x36')][_0xceaa('0x3a')]));_0x42c2bb[_0xceaa('0x39')]=_0x42c2bb[_0xceaa('0x39')][_0xceaa('0x3b')]?_0x42c2bb[_0xceaa('0x39')]:_0x3ca437[_0xceaa('0x34')];if(_0x329d6f[_0xceaa('0x36')][_0xceaa('0x44')]){_0x42c2bb[_0xceaa('0x45')]=[{'all':!![]}];}_0x42c2bb=_[_0xceaa('0x42')]({},_0x42c2bb,_0x329d6f[_0xceaa('0x43')]);return db[_0xceaa('0x2f')][_0xceaa('0x48')](_0x42c2bb)[_0xceaa('0x28')](handleEntityNotFound(_0x34837f,null))['then'](respondWithResult(_0x34837f,null))[_0xceaa('0x46')](handleError(_0x34837f,null));};exports[_0xceaa('0x49')]=function(_0x3beb82,_0x45a588){return db[_0xceaa('0x2f')][_0xceaa('0x49')](_0x3beb82[_0xceaa('0x4a')],{})['then'](respondWithResult(_0x45a588,0xc9))[_0xceaa('0x46')](handleError(_0x45a588,null));};exports[_0xceaa('0x27')]=function(_0xc84f9f,_0x222e91){if(_0xc84f9f[_0xceaa('0x4a')]['id']){delete _0xc84f9f[_0xceaa('0x4a')]['id'];}return db[_0xceaa('0x2f')][_0xceaa('0x48')]({'where':{'id':_0xc84f9f[_0xceaa('0x4b')]['id']}})[_0xceaa('0x28')](handleEntityNotFound(_0x222e91,null))['then'](saveUpdates(_0xc84f9f[_0xceaa('0x4a')],null))[_0xceaa('0x28')](respondWithResult(_0x222e91,null))['catch'](handleError(_0x222e91,null));};exports[_0xceaa('0x29')]=function(_0x2466b6,_0x144374){return db[_0xceaa('0x2f')][_0xceaa('0x48')]({'where':{'id':_0x2466b6['params']['id']}})[_0xceaa('0x28')](handleEntityNotFound(_0x144374,null))[_0xceaa('0x28')](removeEntity(_0x144374,null))[_0xceaa('0x46')](handleError(_0x144374,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index fb2ae5d..fc362c2 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 _0x4975=['path','rimraf','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3690df,_0x4c761c){var _0x17b3ca=function(_0x274924){while(--_0x274924){_0x3690df['push'](_0x3690df['shift']());}};_0x17b3ca(++_0x4c761c);}(_0x4975,0x1f2));var _0x5497=function(_0x3d51bf,_0x28ee2a){_0x3d51bf=_0x3d51bf-0x0;var _0x42c7f8=_0x4975[_0x3d51bf];return _0x42c7f8;};'use strict';var _=require(_0x5497('0x0'));var util=require(_0x5497('0x1'));var logger=require('../../config/logger')(_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('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0x5497('0x8')]=function(_0x37677a,_0x4a640c){return _0x37677a[_0x5497('0x9')](_0x5497('0xa'),attributes,{'tableName':_0x5497('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdba=['analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','AnalyticTreeReport'];(function(_0x442250,_0x7e4a9c){var _0x1ffde5=function(_0x1575aa){while(--_0x1575aa){_0x442250['push'](_0x442250['shift']());}};_0x1ffde5(++_0x7e4a9c);}(_0xbdba,0x161));var _0xabdb=function(_0x29daac,_0x3067e2){_0x29daac=_0x29daac-0x0;var _0x1f337f=_0xbdba[_0x29daac];return _0x1f337f;};'use strict';var _=require(_0xabdb('0x0'));var util=require('util');var logger=require(_0xabdb('0x1'))(_0xabdb('0x2'));var moment=require(_0xabdb('0x3'));var BPromise=require(_0xabdb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xabdb('0x5'));var rimraf=require(_0xabdb('0x6'));var config=require(_0xabdb('0x7'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x5e933b,_0x167854){return _0x5e933b[_0xabdb('0x8')](_0xabdb('0x9'),attributes,{'tableName':_0xabdb('0xa'),'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 1c250b5..dec5804 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x28015a,_0x37d2d7){var _0x43bbd5=function(_0x146b86){while(--_0x146b86){_0x28015a['push'](_0x28015a['shift']());}};_0x43bbd5(++_0x37d2d7);}(_0x2ef3,0xba));var _0x32ef=function(_0x23da12,_0x11c25a){_0x23da12=_0x23da12-0x0;var _0x1d524b=_0x2ef3[_0x23da12];return _0x1d524b;};'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')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x35ffef,_0x416f48){_0x35ffef=_0x35ffef-0x0;var _0x38540f=_0x7a54[_0x35ffef];return _0x38540f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index f8dd109..04b496e 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 _0x5e74=['update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id','isAuthenticated','post'];(function(_0x222954,_0x16f849){var _0x28a79d=function(_0x21bc82){while(--_0x21bc82){_0x222954['push'](_0x222954['shift']());}};_0x28a79d(++_0x16f849);}(_0x5e74,0xbe));var _0x45e7=function(_0x3b889b,_0x276cd3){_0x3b889b=_0x3b889b-0x0;var _0xf1b31a=_0x5e74[_0x3b889b];return _0xf1b31a;};'use strict';var multer=require(_0x45e7('0x0'));var util=require(_0x45e7('0x1'));var path=require(_0x45e7('0x2'));var timeout=require('connect-timeout');var express=require(_0x45e7('0x3'));var router=express[_0x45e7('0x4')]();var fs_extra=require(_0x45e7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x45e7('0x6'));var config=require(_0x45e7('0x7'));var controller=require(_0x45e7('0x8'));router[_0x45e7('0x9')]('/',auth['isAuthenticated'](),controller[_0x45e7('0xa')]);router[_0x45e7('0x9')](_0x45e7('0xb'),auth[_0x45e7('0xc')](),controller['show']);router[_0x45e7('0xd')]('/',auth[_0x45e7('0xc')](),controller['create']);router['put'](_0x45e7('0xb'),auth[_0x45e7('0xc')](),controller[_0x45e7('0xe')]);router[_0x45e7('0xf')](_0x45e7('0xb'),auth[_0x45e7('0xc')](),controller['destroy']);module[_0x45e7('0x10')]=router; \ No newline at end of file +var _0xf6ee=['update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','./analyticTreeReport.controller','isAuthenticated','get','/:id','show','post','create','put'];(function(_0x3c53d6,_0x3c5886){var _0x1e6fe1=function(_0x51076d){while(--_0x51076d){_0x3c53d6['push'](_0x3c53d6['shift']());}};_0x1e6fe1(++_0x3c5886);}(_0xf6ee,0x190));var _0xef6e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf6ee[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xef6e('0x0'));var util=require('util');var path=require(_0xef6e('0x1'));var timeout=require('connect-timeout');var express=require(_0xef6e('0x2'));var router=express[_0xef6e('0x3')]();var fs_extra=require(_0xef6e('0x4'));var auth=require(_0xef6e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xef6e('0x6'));router['get']('/',auth[_0xef6e('0x7')](),controller['index']);router[_0xef6e('0x8')](_0xef6e('0x9'),auth[_0xef6e('0x7')](),controller[_0xef6e('0xa')]);router[_0xef6e('0xb')]('/',auth[_0xef6e('0x7')](),controller[_0xef6e('0xc')]);router[_0xef6e('0xd')](_0xef6e('0x9'),auth['isAuthenticated'](),controller[_0xef6e('0xe')]);router[_0xef6e('0xf')](_0xef6e('0x9'),auth[_0xef6e('0x7')](),controller[_0xef6e('0x10')]);module[_0xef6e('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 8d37f1e..d8e9a63 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 _0x4156=['STRING','sequelize','exports'];(function(_0x46be5f,_0x170cab){var _0x192673=function(_0x304b3b){while(--_0x304b3b){_0x46be5f['push'](_0x46be5f['shift']());}};_0x192673(++_0x170cab);}(_0x4156,0xf1));var _0x6415=function(_0xc0ca5e,_0x531c0c){_0xc0ca5e=_0xc0ca5e-0x0;var _0x1d6bde=_0x4156[_0xc0ca5e];return _0x1d6bde;};'use strict';var Sequelize=require(_0x6415('0x0'));module[_0x6415('0x1')]={'name':{'type':Sequelize[_0x6415('0x2')]},'basename':{'type':Sequelize[_0x6415('0x2')]},'type':{'type':Sequelize[_0x6415('0x2')]}}; \ No newline at end of file +var _0xa588=['STRING','exports'];(function(_0x52787d,_0x578574){var _0x1062ac=function(_0xb6f9b6){while(--_0xb6f9b6){_0x52787d['push'](_0x52787d['shift']());}};_0x1062ac(++_0x578574);}(_0xa588,0xe1));var _0x8a58=function(_0x22dfe0,_0x43613b){_0x22dfe0=_0x22dfe0-0x0;var _0x91bbfb=_0xa588[_0x22dfe0];return _0x91bbfb;};'use strict';var Sequelize=require('sequelize');module[_0x8a58('0x0')]={'name':{'type':Sequelize[_0x8a58('0x1')]},'basename':{'type':Sequelize[_0x8a58('0x1')]},'type':{'type':Sequelize[_0x8a58('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 617518f..c426051 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 _0x13a9=['offline-chat/','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','find','clone','params','omit','updatedAt','body','create','originalname','basename','file','filename','type','mimetype','findOne','root','server/files/attachments/','join'];(function(_0x1e60e5,_0xd7ac86){var _0x446b8f=function(_0x1961e8){while(--_0x1961e8){_0x1e60e5['push'](_0x1e60e5['shift']());}};_0x446b8f(++_0xd7ac86);}(_0x13a9,0xb2));var _0x913a=function(_0x491ace,_0x13ed1d){_0x491ace=_0x491ace-0x0;var _0x4d6014=_0x13a9[_0x491ace];return _0x4d6014;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x913a('0x0'));var zipdir=require(_0x913a('0x1'));var jsonpatch=require(_0x913a('0x2'));var rp=require(_0x913a('0x3'));var moment=require(_0x913a('0x4'));var BPromise=require(_0x913a('0x5'));var Mustache=require(_0x913a('0x6'));var util=require(_0x913a('0x7'));var path=require(_0x913a('0x8'));var sox=require(_0x913a('0x9'));var csv=require(_0x913a('0xa'));var ejs=require(_0x913a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x913a('0xc'));var squel=require(_0x913a('0xd'));var crypto=require(_0x913a('0xe'));var jsforce=require(_0x913a('0xf'));var deskjs=require(_0x913a('0x10'));var toCsv=require(_0x913a('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x913a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x913a('0x12'));var hardwareService=require(_0x913a('0x13'));var logger=require(_0x913a('0x14'))(_0x913a('0x15'));var utils=require(_0x913a('0x16'));var config=require(_0x913a('0x17'));var licenseUtil=require(_0x913a('0x18'));var db=require(_0x913a('0x19'))['db'];function respondWithStatusCode(_0x2eb4b5,_0x2c9cbd){_0x2c9cbd=_0x2c9cbd||0xcc;return function(_0xb1e9f3){if(_0xb1e9f3){return _0x2eb4b5[_0x913a('0x1a')](_0x2c9cbd);}return _0x2eb4b5['status'](_0x2c9cbd)[_0x913a('0x1b')]();};}function respondWithResult(_0x6dcaa0,_0x3d64da){_0x3d64da=_0x3d64da||0xc8;return function(_0x3e4c1e){if(_0x3e4c1e){return _0x6dcaa0[_0x913a('0x1c')](_0x3d64da)[_0x913a('0x1d')](_0x3e4c1e);}};}function respondWithFilteredResult(_0x2829fc,_0x46e746){return function(_0x4698b6){if(_0x4698b6){var _0x8e1026=typeof _0x46e746[_0x913a('0x1e')]===_0x913a('0x1f')&&typeof _0x46e746['limit']==='undefined';var _0x1f40ca=_0x4698b6[_0x913a('0x20')];var _0x289891=_0x8e1026?0x0:_0x46e746[_0x913a('0x1e')];var _0x2c27b7=_0x8e1026?_0x4698b6[_0x913a('0x20')]:_0x46e746[_0x913a('0x1e')]+_0x46e746['limit'];var _0x3572b9;if(_0x2c27b7>=_0x1f40ca){_0x2c27b7=_0x1f40ca;_0x3572b9=0xc8;}else{_0x3572b9=0xce;}_0x2829fc['status'](_0x3572b9);return _0x2829fc[_0x913a('0x21')](_0x913a('0x22'),_0x289891+'-'+_0x2c27b7+'/'+_0x1f40ca)[_0x913a('0x1d')](_0x4698b6);}return null;};}function patchUpdates(_0x1f9427){return function(_0x28714c){try{jsonpatch[_0x913a('0x23')](_0x28714c,_0x1f9427,!![]);}catch(_0xb766a1){return BPromise['reject'](_0xb766a1);}return _0x28714c[_0x913a('0x24')]();};}function saveUpdates(_0x4259f6,_0x589cdd){return function(_0x3a48e7){if(_0x3a48e7){return _0x3a48e7[_0x913a('0x25')](_0x4259f6)[_0x913a('0x26')](function(_0x30318b){return _0x30318b;});}return null;};}function removeEntity(_0xaa27be,_0x2d4afd){return function(_0x754342){if(_0x754342){return _0x754342[_0x913a('0x27')]()['then'](function(){_0xaa27be[_0x913a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe272ae,_0xb07dfd){return function(_0x4d632f){if(!_0x4d632f){_0xe272ae['sendStatus'](0x194);}return _0x4d632f;};}function handleError(_0x5593aa,_0x2281f2){_0x2281f2=_0x2281f2||0x1f4;return function(_0x329f90){logger[_0x913a('0x28')](_0x329f90[_0x913a('0x29')]);if(_0x329f90[_0x913a('0x2a')]){delete _0x329f90[_0x913a('0x2a')];}_0x5593aa[_0x913a('0x1c')](_0x2281f2)[_0x913a('0x2b')](_0x329f90);};}exports[_0x913a('0x2c')]=function(_0x19a3c7,_0x2152fd){var _0xe42360={},_0x25fac0={},_0x42a136={'count':0x0,'rows':[]};var _0x4e936f=_[_0x913a('0x2d')](db[_0x913a('0x2e')][_0x913a('0x2f')],function(_0x10514a){return{'name':_0x10514a['fieldName'],'type':_0x10514a['type'][_0x913a('0x30')]};});_0x25fac0[_0x913a('0x31')]=_[_0x913a('0x2d')](_0x4e936f,_0x913a('0x2a'));_0x25fac0[_0x913a('0x32')]=_[_0x913a('0x33')](_0x19a3c7[_0x913a('0x32')]);_0x25fac0[_0x913a('0x34')]=_['intersection'](_0x25fac0[_0x913a('0x31')],_0x25fac0[_0x913a('0x32')]);_0xe42360[_0x913a('0x35')]=_[_0x913a('0x36')](_0x25fac0[_0x913a('0x31')],qs['fields'](_0x19a3c7[_0x913a('0x32')][_0x913a('0x37')]));_0xe42360['attributes']=_0xe42360[_0x913a('0x35')][_0x913a('0x38')]?_0xe42360[_0x913a('0x35')]:_0x25fac0[_0x913a('0x31')];if(!_0x19a3c7[_0x913a('0x32')][_0x913a('0x39')](_0x913a('0x3a'))){_0xe42360[_0x913a('0x3b')]=qs[_0x913a('0x3b')](_0x19a3c7[_0x913a('0x32')]['limit']);_0xe42360['offset']=qs['offset'](_0x19a3c7['query']['offset']);}_0xe42360[_0x913a('0x3c')]=qs['sort'](_0x19a3c7[_0x913a('0x32')]['sort']);_0xe42360['where']=qs[_0x913a('0x34')](_['pick'](_0x19a3c7['query'],_0x25fac0[_0x913a('0x34')]),_0x4e936f);if(_0x19a3c7[_0x913a('0x32')]['filter']){_0xe42360[_0x913a('0x3d')]=_[_0x913a('0x3e')](_0xe42360[_0x913a('0x3d')],{'$or':_[_0x913a('0x2d')](_0x4e936f,function(_0xae058a){if(_0xae058a['type']!==_0x913a('0x3f')){var _0x20a358={};_0x20a358[_0xae058a[_0x913a('0x2a')]]={'$like':'%'+_0x19a3c7[_0x913a('0x32')]['filter']+'%'};return _0x20a358;}})});}_0xe42360=_['merge']({},_0xe42360,_0x19a3c7['options']);var _0x582cf1={'where':_0xe42360[_0x913a('0x3d')]};return db['Attachment']['count'](_0x582cf1)[_0x913a('0x26')](function(_0x44e565){_0x42a136['count']=_0x44e565;if(_0x19a3c7['query'][_0x913a('0x40')]){_0xe42360[_0x913a('0x41')]=[{'all':!![]}];}return db['Attachment'][_0x913a('0x42')](_0xe42360);})[_0x913a('0x26')](function(_0x5e2996){_0x42a136[_0x913a('0x43')]=_0x5e2996;return _0x42a136;})[_0x913a('0x26')](respondWithFilteredResult(_0x2152fd,_0xe42360))[_0x913a('0x44')](handleError(_0x2152fd,null));};exports['show']=function(_0x20a74e,_0x29d3cf){var _0x48de71={'raw':!![],'where':{'id':_0x20a74e['params']['id']}},_0x415d38={};_0x415d38['model']=_[_0x913a('0x33')](db['Attachment']['rawAttributes']);_0x415d38[_0x913a('0x32')]=_['keys'](_0x20a74e[_0x913a('0x32')]);_0x415d38[_0x913a('0x34')]=_[_0x913a('0x36')](_0x415d38[_0x913a('0x31')],_0x415d38[_0x913a('0x32')]);_0x48de71[_0x913a('0x35')]=_['intersection'](_0x415d38['model'],qs[_0x913a('0x37')](_0x20a74e[_0x913a('0x32')][_0x913a('0x37')]));_0x48de71[_0x913a('0x35')]=_0x48de71[_0x913a('0x35')][_0x913a('0x38')]?_0x48de71[_0x913a('0x35')]:_0x415d38[_0x913a('0x31')];if(_0x20a74e['query'][_0x913a('0x40')]){_0x48de71[_0x913a('0x41')]=[{'all':!![]}];}_0x48de71=_[_0x913a('0x3e')]({},_0x48de71,_0x20a74e['options']);return db[_0x913a('0x2e')][_0x913a('0x45')](_0x48de71)[_0x913a('0x26')](handleEntityNotFound(_0x29d3cf,null))[_0x913a('0x26')](respondWithResult(_0x29d3cf,null))[_0x913a('0x44')](handleError(_0x29d3cf,null));};exports[_0x913a('0x46')]=function(_0x594dd2,_0x248550){var _0x26c7e4={'where':{'id':_0x594dd2[_0x913a('0x47')]['id']}},_0x44d18b={};_0x44d18b[_0x913a('0x31')]=_[_0x913a('0x33')](db[_0x913a('0x2e')]['rawAttributes']);_0x26c7e4[_0x913a('0x35')]=_[_0x913a('0x36')](_0x44d18b[_0x913a('0x31')],qs[_0x913a('0x37')](_0x594dd2[_0x913a('0x32')][_0x913a('0x37')]));_0x26c7e4['attributes']=_0x26c7e4[_0x913a('0x35')][_0x913a('0x38')]?_0x26c7e4[_0x913a('0x35')]:_0x44d18b[_0x913a('0x31')];if(_0x594dd2['query'][_0x913a('0x40')]){_0x26c7e4[_0x913a('0x41')]=[{'all':!![]}];}_0x26c7e4=_[_0x913a('0x3e')]({},_0x26c7e4,_0x594dd2['options']);return db[_0x913a('0x2e')][_0x913a('0x45')](_0x26c7e4)[_0x913a('0x26')](handleEntityNotFound(_0x248550,null))['then'](function(_0x5eaf65){if(_0x5eaf65){var _0x2e10aa=_0x5eaf65['get']({'plain':!![]});_0x2e10aa=qs[_0x913a('0x48')](_0x2e10aa,['id','createdAt',_0x913a('0x49')]);_0x594dd2[_0x913a('0x4a')]=_['omit'](_0x594dd2[_0x913a('0x4a')],['id','createdAt',_0x913a('0x49')]);return db[_0x913a('0x2e')][_0x913a('0x4b')](_['merge'](_0x2e10aa,_0x594dd2[_0x913a('0x4a')]),{'include':_0x594dd2[_0x913a('0x32')][_0x913a('0x40')]?[{'all':!![]}]:undefined});}})[_0x913a('0x26')](respondWithResult(_0x248550,0xc9))['catch'](handleError(_0x248550,null));};exports[_0x913a('0x25')]=function(_0x4a9759,_0xf3f4fe){if(_0x4a9759[_0x913a('0x4a')]['id']){delete _0x4a9759['body']['id'];}return db['Attachment']['find']({'where':{'id':_0x4a9759['params']['id']}})[_0x913a('0x26')](handleEntityNotFound(_0xf3f4fe,null))['then'](saveUpdates(_0x4a9759[_0x913a('0x4a')],null))['then'](respondWithResult(_0xf3f4fe,null))[_0x913a('0x44')](handleError(_0xf3f4fe,null));};exports[_0x913a('0x27')]=function(_0x5f2641,_0x5ebc93){return db[_0x913a('0x2e')][_0x913a('0x45')]({'where':{'id':_0x5f2641[_0x913a('0x47')]['id']}})[_0x913a('0x26')](handleEntityNotFound(_0x5ebc93,null))[_0x913a('0x26')](removeEntity(_0x5ebc93,null))[_0x913a('0x44')](handleError(_0x5ebc93,null));};exports[_0x913a('0x4b')]=function(_0x331569,_0x26aea8,_0x5d9cc6){_0x331569[_0x913a('0x4a')]['name']=_0x331569['file'][_0x913a('0x4c')];_0x331569['body'][_0x913a('0x4d')]=_0x331569[_0x913a('0x4e')][_0x913a('0x4f')];_0x331569[_0x913a('0x4a')][_0x913a('0x50')]=_0x331569[_0x913a('0x4e')][_0x913a('0x51')];return db['Attachment'][_0x913a('0x4b')](_0x331569[_0x913a('0x4a')])[_0x913a('0x26')](respondWithResult(_0x26aea8,0xc9))[_0x913a('0x44')](handleError(_0x26aea8,null));};exports['download']=function(_0x32eb91,_0x41ab76,_0x26a7c8){return db[_0x913a('0x2e')][_0x913a('0x52')]({'where':{'id':_0x32eb91[_0x913a('0x47')]['id']},'raw':!![]})[_0x913a('0x26')](handleEntityNotFound(_0x41ab76,null))[_0x913a('0x26')](function(_0x2e5a6d){if(_0x2e5a6d){var _0x50fcba=_0x2e5a6d['ChatOfflineMessageId']!==null;var _0x315454=path['join'](config[_0x913a('0x53')],_0x913a('0x54'));if(_0x50fcba){_0x315454=path[_0x913a('0x55')](_0x315454,_0x913a('0x56'));}var _0x5180a1=path[_0x913a('0x55')](_0x315454,_0x2e5a6d[_0x913a('0x4d')]);return _0x41ab76[_0x913a('0x57')](_0x5180a1);}})[_0x913a('0x44')](handleError(_0x41ab76,null));}; \ No newline at end of file +var _0x621c=['rows','catch','params','find','options','get','omit','createdAt','updatedAt','body','create','update','originalname','basename','file','filename','mimetype','download','join','server/files/attachments/','offline-chat/','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','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/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','then','destroy','stack','name','map','Attachment','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x621c,0x111));var _0xc621=function(_0x5e944a,_0x2847b4){_0x5e944a=_0x5e944a-0x0;var _0x38f07b=_0x621c[_0x5e944a];return _0x38f07b;};'use strict';var emlformat=require(_0xc621('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc621('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc621('0x2'));var moment=require('moment');var BPromise=require(_0xc621('0x3'));var Mustache=require(_0xc621('0x4'));var util=require(_0xc621('0x5'));var path=require(_0xc621('0x6'));var sox=require(_0xc621('0x7'));var csv=require('to-csv');var ejs=require(_0xc621('0x8'));var fs=require('fs');var fs_extra=require(_0xc621('0x9'));var _=require(_0xc621('0xa'));var squel=require(_0xc621('0xb'));var crypto=require(_0xc621('0xc'));var jsforce=require(_0xc621('0xd'));var deskjs=require(_0xc621('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc621('0xf'));var Redis=require(_0xc621('0x10'));var authService=require(_0xc621('0x11'));var qs=require(_0xc621('0x12'));var as=require(_0xc621('0x13'));var hardwareService=require(_0xc621('0x14'));var logger=require(_0xc621('0x15'))(_0xc621('0x16'));var utils=require(_0xc621('0x17'));var config=require(_0xc621('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x88fbda,_0x3a1016){_0x3a1016=_0x3a1016||0xcc;return function(_0x2c6510){if(_0x2c6510){return _0x88fbda[_0xc621('0x19')](_0x3a1016);}return _0x88fbda[_0xc621('0x1a')](_0x3a1016)[_0xc621('0x1b')]();};}function respondWithResult(_0x203895,_0x101c2c){_0x101c2c=_0x101c2c||0xc8;return function(_0x50ad44){if(_0x50ad44){return _0x203895[_0xc621('0x1a')](_0x101c2c)['json'](_0x50ad44);}};}function respondWithFilteredResult(_0x25d3e5,_0xcb915e){return function(_0x18c1ce){if(_0x18c1ce){var _0x45130e=typeof _0xcb915e[_0xc621('0x1c')]===_0xc621('0x1d')&&typeof _0xcb915e[_0xc621('0x1e')]===_0xc621('0x1d');var _0x4bd512=_0x18c1ce[_0xc621('0x1f')];var _0x87f93f=_0x45130e?0x0:_0xcb915e[_0xc621('0x1c')];var _0x4a59fe=_0x45130e?_0x18c1ce[_0xc621('0x1f')]:_0xcb915e[_0xc621('0x1c')]+_0xcb915e[_0xc621('0x1e')];var _0x488c6d;if(_0x4a59fe>=_0x4bd512){_0x4a59fe=_0x4bd512;_0x488c6d=0xc8;}else{_0x488c6d=0xce;}_0x25d3e5[_0xc621('0x1a')](_0x488c6d);return _0x25d3e5['set'](_0xc621('0x20'),_0x87f93f+'-'+_0x4a59fe+'/'+_0x4bd512)[_0xc621('0x21')](_0x18c1ce);}return null;};}function patchUpdates(_0x3c284d){return function(_0xac9774){try{jsonpatch['apply'](_0xac9774,_0x3c284d,!![]);}catch(_0x362d0){return BPromise[_0xc621('0x22')](_0x362d0);}return _0xac9774[_0xc621('0x23')]();};}function saveUpdates(_0x2ede67,_0x511e69){return function(_0x1e3d09){if(_0x1e3d09){return _0x1e3d09['update'](_0x2ede67)[_0xc621('0x24')](function(_0x235dfc){return _0x235dfc;});}return null;};}function removeEntity(_0x37b4cb,_0x4193d1){return function(_0x1bbf83){if(_0x1bbf83){return _0x1bbf83[_0xc621('0x25')]()[_0xc621('0x24')](function(){_0x37b4cb[_0xc621('0x1a')](0xcc)[_0xc621('0x1b')]();});}};}function handleEntityNotFound(_0x2b31b6,_0x1ab809){return function(_0x2ab72d){if(!_0x2ab72d){_0x2b31b6[_0xc621('0x19')](0x194);}return _0x2ab72d;};}function handleError(_0x511c96,_0x1bb9e1){_0x1bb9e1=_0x1bb9e1||0x1f4;return function(_0x7aa798){logger['error'](_0x7aa798[_0xc621('0x26')]);if(_0x7aa798[_0xc621('0x27')]){delete _0x7aa798[_0xc621('0x27')];}_0x511c96[_0xc621('0x1a')](_0x1bb9e1)['send'](_0x7aa798);};}exports['index']=function(_0x3a2ca4,_0x3d9613){var _0x1cc931={},_0x1518ed={},_0x281ded={'count':0x0,'rows':[]};var _0x2c42af=_[_0xc621('0x28')](db[_0xc621('0x29')][_0xc621('0x2a')],function(_0x1a813a){return{'name':_0x1a813a[_0xc621('0x2b')],'type':_0x1a813a['type'][_0xc621('0x2c')]};});_0x1518ed[_0xc621('0x2d')]=_['map'](_0x2c42af,'name');_0x1518ed[_0xc621('0x2e')]=_[_0xc621('0x2f')](_0x3a2ca4['query']);_0x1518ed['filters']=_[_0xc621('0x30')](_0x1518ed[_0xc621('0x2d')],_0x1518ed[_0xc621('0x2e')]);_0x1cc931[_0xc621('0x31')]=_[_0xc621('0x30')](_0x1518ed[_0xc621('0x2d')],qs['fields'](_0x3a2ca4['query'][_0xc621('0x32')]));_0x1cc931[_0xc621('0x31')]=_0x1cc931['attributes'][_0xc621('0x33')]?_0x1cc931['attributes']:_0x1518ed[_0xc621('0x2d')];if(!_0x3a2ca4[_0xc621('0x2e')][_0xc621('0x34')](_0xc621('0x35'))){_0x1cc931['limit']=qs[_0xc621('0x1e')](_0x3a2ca4['query'][_0xc621('0x1e')]);_0x1cc931['offset']=qs[_0xc621('0x1c')](_0x3a2ca4['query'][_0xc621('0x1c')]);}_0x1cc931['order']=qs[_0xc621('0x36')](_0x3a2ca4[_0xc621('0x2e')]['sort']);_0x1cc931[_0xc621('0x37')]=qs['filters'](_['pick'](_0x3a2ca4[_0xc621('0x2e')],_0x1518ed[_0xc621('0x38')]),_0x2c42af);if(_0x3a2ca4[_0xc621('0x2e')][_0xc621('0x39')]){_0x1cc931[_0xc621('0x37')]=_[_0xc621('0x3a')](_0x1cc931[_0xc621('0x37')],{'$or':_[_0xc621('0x28')](_0x2c42af,function(_0x2e182d){if(_0x2e182d['type']!==_0xc621('0x3b')){var _0x277d5b={};_0x277d5b[_0x2e182d['name']]={'$like':'%'+_0x3a2ca4[_0xc621('0x2e')][_0xc621('0x39')]+'%'};return _0x277d5b;}})});}_0x1cc931=_['merge']({},_0x1cc931,_0x3a2ca4['options']);var _0x49d637={'where':_0x1cc931[_0xc621('0x37')]};return db['Attachment'][_0xc621('0x1f')](_0x49d637)['then'](function(_0xaed85f){_0x281ded[_0xc621('0x1f')]=_0xaed85f;if(_0x3a2ca4[_0xc621('0x2e')][_0xc621('0x3c')]){_0x1cc931[_0xc621('0x3d')]=[{'all':!![]}];}return db[_0xc621('0x29')][_0xc621('0x3e')](_0x1cc931);})[_0xc621('0x24')](function(_0x17077b){_0x281ded[_0xc621('0x3f')]=_0x17077b;return _0x281ded;})['then'](respondWithFilteredResult(_0x3d9613,_0x1cc931))[_0xc621('0x40')](handleError(_0x3d9613,null));};exports['show']=function(_0x4dc9b7,_0x57212c){var _0xc35328={'raw':!![],'where':{'id':_0x4dc9b7[_0xc621('0x41')]['id']}},_0x3aa78d={};_0x3aa78d[_0xc621('0x2d')]=_['keys'](db[_0xc621('0x29')][_0xc621('0x2a')]);_0x3aa78d['query']=_[_0xc621('0x2f')](_0x4dc9b7[_0xc621('0x2e')]);_0x3aa78d['filters']=_[_0xc621('0x30')](_0x3aa78d['model'],_0x3aa78d['query']);_0xc35328['attributes']=_[_0xc621('0x30')](_0x3aa78d[_0xc621('0x2d')],qs['fields'](_0x4dc9b7[_0xc621('0x2e')][_0xc621('0x32')]));_0xc35328[_0xc621('0x31')]=_0xc35328[_0xc621('0x31')][_0xc621('0x33')]?_0xc35328[_0xc621('0x31')]:_0x3aa78d[_0xc621('0x2d')];if(_0x4dc9b7[_0xc621('0x2e')][_0xc621('0x3c')]){_0xc35328['include']=[{'all':!![]}];}_0xc35328=_[_0xc621('0x3a')]({},_0xc35328,_0x4dc9b7['options']);return db[_0xc621('0x29')][_0xc621('0x42')](_0xc35328)[_0xc621('0x24')](handleEntityNotFound(_0x57212c,null))[_0xc621('0x24')](respondWithResult(_0x57212c,null))[_0xc621('0x40')](handleError(_0x57212c,null));};exports['clone']=function(_0x1075ac,_0x5c715c){var _0x176f19={'where':{'id':_0x1075ac[_0xc621('0x41')]['id']}},_0x18624b={};_0x18624b[_0xc621('0x2d')]=_[_0xc621('0x2f')](db['Attachment'][_0xc621('0x2a')]);_0x176f19[_0xc621('0x31')]=_['intersection'](_0x18624b[_0xc621('0x2d')],qs[_0xc621('0x32')](_0x1075ac[_0xc621('0x2e')][_0xc621('0x32')]));_0x176f19[_0xc621('0x31')]=_0x176f19['attributes'][_0xc621('0x33')]?_0x176f19[_0xc621('0x31')]:_0x18624b[_0xc621('0x2d')];if(_0x1075ac[_0xc621('0x2e')][_0xc621('0x3c')]){_0x176f19[_0xc621('0x3d')]=[{'all':!![]}];}_0x176f19=_['merge']({},_0x176f19,_0x1075ac[_0xc621('0x43')]);return db['Attachment'][_0xc621('0x42')](_0x176f19)['then'](handleEntityNotFound(_0x5c715c,null))[_0xc621('0x24')](function(_0x1a8370){if(_0x1a8370){var _0x41dec6=_0x1a8370[_0xc621('0x44')]({'plain':!![]});_0x41dec6=qs[_0xc621('0x45')](_0x41dec6,['id',_0xc621('0x46'),_0xc621('0x47')]);_0x1075ac['body']=_[_0xc621('0x45')](_0x1075ac[_0xc621('0x48')],['id',_0xc621('0x46'),_0xc621('0x47')]);return db[_0xc621('0x29')][_0xc621('0x49')](_[_0xc621('0x3a')](_0x41dec6,_0x1075ac[_0xc621('0x48')]),{'include':_0x1075ac['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0xc621('0x24')](respondWithResult(_0x5c715c,0xc9))['catch'](handleError(_0x5c715c,null));};exports[_0xc621('0x4a')]=function(_0x897e05,_0x5b8ef0){if(_0x897e05[_0xc621('0x48')]['id']){delete _0x897e05[_0xc621('0x48')]['id'];}return db['Attachment'][_0xc621('0x42')]({'where':{'id':_0x897e05[_0xc621('0x41')]['id']}})[_0xc621('0x24')](handleEntityNotFound(_0x5b8ef0,null))[_0xc621('0x24')](saveUpdates(_0x897e05[_0xc621('0x48')],null))['then'](respondWithResult(_0x5b8ef0,null))[_0xc621('0x40')](handleError(_0x5b8ef0,null));};exports[_0xc621('0x25')]=function(_0x40a91a,_0x4a1c65){return db[_0xc621('0x29')][_0xc621('0x42')]({'where':{'id':_0x40a91a[_0xc621('0x41')]['id']}})[_0xc621('0x24')](handleEntityNotFound(_0x4a1c65,null))['then'](removeEntity(_0x4a1c65,null))[_0xc621('0x40')](handleError(_0x4a1c65,null));};exports[_0xc621('0x49')]=function(_0x7a16ff,_0xfd70d2,_0x5419fb){_0x7a16ff[_0xc621('0x48')][_0xc621('0x27')]=_0x7a16ff['file'][_0xc621('0x4b')];_0x7a16ff[_0xc621('0x48')][_0xc621('0x4c')]=_0x7a16ff[_0xc621('0x4d')][_0xc621('0x4e')];_0x7a16ff[_0xc621('0x48')]['type']=_0x7a16ff[_0xc621('0x4d')][_0xc621('0x4f')];return db[_0xc621('0x29')][_0xc621('0x49')](_0x7a16ff[_0xc621('0x48')])[_0xc621('0x24')](respondWithResult(_0xfd70d2,0xc9))[_0xc621('0x40')](handleError(_0xfd70d2,null));};exports[_0xc621('0x50')]=function(_0x178092,_0x587bf3,_0x1f8918){return db['Attachment']['findOne']({'where':{'id':_0x178092[_0xc621('0x41')]['id']},'raw':!![]})[_0xc621('0x24')](handleEntityNotFound(_0x587bf3,null))[_0xc621('0x24')](function(_0x3c7375){if(_0x3c7375){var _0x4209e4=_0x3c7375['ChatOfflineMessageId']!==null;var _0x2ded26=path[_0xc621('0x51')](config['root'],_0xc621('0x52'));if(_0x4209e4){_0x2ded26=path[_0xc621('0x51')](_0x2ded26,_0xc621('0x53'));}var _0x59634b=path[_0xc621('0x51')](_0x2ded26,_0x3c7375[_0xc621('0x4c')]);return _0x587bf3[_0xc621('0x50')](_0x59634b);}})[_0xc621('0x40')](handleError(_0x587bf3,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 1f673ae..28a6ff2 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 _0x8006=['../../config/logger','api','path','rimraf','./attachment.attributes','Attachment'];(function(_0x22c5fd,_0x110390){var _0x17d5c3=function(_0x8d7738){while(--_0x8d7738){_0x22c5fd['push'](_0x22c5fd['shift']());}};_0x17d5c3(++_0x110390);}(_0x8006,0xba));var _0x6800=function(_0x299f6a,_0x186ef2){_0x299f6a=_0x299f6a-0x0;var _0x5735e5=_0x8006[_0x299f6a];return _0x5735e5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6800('0x0'))(_0x6800('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6800('0x2'));var rimraf=require(_0x6800('0x3'));var config=require('../../config/environment');var attributes=require(_0x6800('0x4'));module['exports']=function(_0x46856a,_0x10b4eb){return _0x46856a['define'](_0x6800('0x5'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe44a=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports','Attachment','lodash','util'];(function(_0x2a22bd,_0x5b5e7a){var _0x2b856e=function(_0x2af0d5){while(--_0x2af0d5){_0x2a22bd['push'](_0x2a22bd['shift']());}};_0x2b856e(++_0x5b5e7a);}(_0xe44a,0x12a));var _0xae44=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe44a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xae44('0x0'));var util=require(_0xae44('0x1'));var logger=require(_0xae44('0x2'))(_0xae44('0x3'));var moment=require(_0xae44('0x4'));var BPromise=require(_0xae44('0x5'));var rp=require(_0xae44('0x6'));var fs=require('fs');var path=require(_0xae44('0x7'));var rimraf=require('rimraf');var config=require(_0xae44('0x8'));var attributes=require(_0xae44('0x9'));module[_0xae44('0xa')]=function(_0x2c024e,_0x5729dd){return _0x2c024e['define'](_0xae44('0xb'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 7882d70..30a16d5 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 _0xb201=['stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','Attachment,\x20%s,\x20%s','message','result','CreateAttachment','Attachment','create','body','options','raw'];(function(_0x1157e7,_0x55bda6){var _0x4da4ab=function(_0x36d590){while(--_0x36d590){_0x1157e7['push'](_0x1157e7['shift']());}};_0x4da4ab(++_0x55bda6);}(_0xb201,0x1b1));var _0x1b20=function(_0x5ca6b1,_0x4bd535){_0x5ca6b1=_0x5ca6b1-0x0;var _0x591553=_0xb201[_0x5ca6b1];return _0x591553;};'use strict';var _=require(_0x1b20('0x0'));var util=require('util');var moment=require(_0x1b20('0x1'));var BPromise=require(_0x1b20('0x2'));var rs=require(_0x1b20('0x3'));var fs=require('fs');var Redis=require(_0x1b20('0x4'));var db=require(_0x1b20('0x5'))['db'];var utils=require(_0x1b20('0x6'));var logger=require('../../config/logger')(_0x1b20('0x7'));var config=require(_0x1b20('0x8'));var jayson=require(_0x1b20('0x9'));var client=jayson['client'][_0x1b20('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50cdbc,_0x34304b,_0x2a184f){return new BPromise(function(_0x3cc600,_0x426ae9){return client['request'](_0x50cdbc,_0x2a184f)[_0x1b20('0xb')](function(_0x1f5ae4){logger[_0x1b20('0xc')]('Attachment,\x20%s,\x20%s',_0x34304b,_0x1b20('0xd'));logger['debug'](_0x1b20('0xe'),_0x34304b,'request\x20sent',JSON['stringify'](_0x1f5ae4));if(_0x1f5ae4[_0x1b20('0xf')]){if(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x10')]===0x1f4){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x426ae9(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x3cc600(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}else{logger['info'](_0x1b20('0x11'),_0x34304b,'request\x20sent');_0x3cc600(_0x1f5ae4[_0x1b20('0x13')][_0x1b20('0x12')]);}})['catch'](function(_0x44e713){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x44e713);_0x426ae9(_0x44e713);});});}exports[_0x1b20('0x14')]=function(_0xff7c72){var _0xf9078e=this;return new Promise(function(_0x34517f,_0x46bb09){return db[_0x1b20('0x15')][_0x1b20('0x16')](_0xff7c72[_0x1b20('0x17')],{'raw':_0xff7c72[_0x1b20('0x18')]?_0xff7c72[_0x1b20('0x18')][_0x1b20('0x19')]===undefined?!![]:![]:!![]})[_0x1b20('0xb')](function(_0x4823d4){logger[_0x1b20('0xc')]('CreateAttachment',_0xff7c72);logger['debug']('CreateAttachment',_0xff7c72,JSON[_0x1b20('0x1a')](_0x4823d4));_0x34517f(_0x4823d4);})['catch'](function(_0x5c3038){logger[_0x1b20('0xf')]('CreateAttachment',_0x5c3038[_0x1b20('0x12')],_0xff7c72);_0x46bb09(_0xf9078e['error'](0x1f4,_0x5c3038[_0x1b20('0x12')]));});});}; \ No newline at end of file +var _0xd87e=['request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','then','info','Attachment,\x20%s,\x20%s'];(function(_0x3ef07b,_0x594344){var _0x53e9a6=function(_0x50a625){while(--_0x50a625){_0x3ef07b['push'](_0x3ef07b['shift']());}};_0x53e9a6(++_0x594344);}(_0xd87e,0x1bf));var _0xed87=function(_0x5300ce,_0x33c8e9){_0x5300ce=_0x5300ce-0x0;var _0x466ff9=_0xd87e[_0x5300ce];return _0x466ff9;};'use strict';var _=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var moment=require('moment');var BPromise=require(_0xed87('0x2'));var rs=require(_0xed87('0x3'));var fs=require('fs');var Redis=require(_0xed87('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed87('0x5'));var logger=require('../../config/logger')(_0xed87('0x6'));var config=require(_0xed87('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xed87('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5da793,_0xa33c67,_0x42fef6){return new BPromise(function(_0x33e1c1,_0x2f348a){return client['request'](_0x5da793,_0x42fef6)[_0xed87('0x9')](function(_0x3dce4b){logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));logger[_0xed87('0xd')](_0xed87('0xe'),_0xa33c67,'request\x20sent',JSON[_0xed87('0xf')](_0x3dce4b));if(_0x3dce4b[_0xed87('0x10')]){if(_0x3dce4b['error'][_0xed87('0x11')]===0x1f4){logger[_0xed87('0x10')]('Attachment,\x20%s,\x20%s',_0xa33c67,_0x3dce4b['error'][_0xed87('0x12')]);return _0x2f348a(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}logger[_0xed87('0x10')](_0xed87('0xb'),_0xa33c67,_0x3dce4b[_0xed87('0x10')]['message']);return _0x33e1c1(_0x3dce4b[_0xed87('0x10')][_0xed87('0x12')]);}else{logger[_0xed87('0xa')](_0xed87('0xb'),_0xa33c67,_0xed87('0xc'));_0x33e1c1(_0x3dce4b[_0xed87('0x13')][_0xed87('0x12')]);}})[_0xed87('0x14')](function(_0x385859){logger['error'](_0xed87('0xb'),_0xa33c67,_0x385859);_0x2f348a(_0x385859);});});}exports[_0xed87('0x15')]=function(_0x2c386a){var _0xfb8a44=this;return new Promise(function(_0x5f4076,_0x211085){return db[_0xed87('0x16')][_0xed87('0x17')](_0x2c386a[_0xed87('0x18')],{'raw':_0x2c386a[_0xed87('0x19')]?_0x2c386a[_0xed87('0x19')][_0xed87('0x1a')]===undefined?!![]:![]:!![]})[_0xed87('0x9')](function(_0x3b7981){logger['info']('CreateAttachment',_0x2c386a);logger['debug']('CreateAttachment',_0x2c386a,JSON[_0xed87('0xf')](_0x3b7981));_0x5f4076(_0x3b7981);})['catch'](function(_0x4191a7){logger[_0xed87('0x10')]('CreateAttachment',_0x4191a7[_0xed87('0x12')],_0x2c386a);_0x211085(_0xfb8a44['error'](0x1f4,_0x4191a7[_0xed87('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index a9f8f27..cd25928 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 _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x17a32f,_0x5a51a){var _0x15a293=function(_0x55fbd3){while(--_0x55fbd3){_0x17a32f['push'](_0x17a32f['shift']());}};_0x15a293(++_0x5a51a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file +var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index ecea123..09e5ce9 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 _0xbeca=['name','User','passport','passport-local','Strategy','moment','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','error','Error\x20authenticate\x20%s:\x20%s','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','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','password','salt','role','disabled','blocked','blockedAt','user','agent','domain','add','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','signToken','json','online','use'];(function(_0x589bc9,_0x49b8ec){var _0x36065b=function(_0x3d5264){while(--_0x3d5264){_0x589bc9['push'](_0x589bc9['shift']());}};_0x36065b(++_0x49b8ec);}(_0xbeca,0x66));var _0xabec=function(_0x529296,_0x1a6a23){_0x529296=_0x529296-0x0;var _0x1796bf=_0xbeca[_0x529296];return _0x1796bf;};'use strict';var passport=require(_0xabec('0x0'));var LocalStrategy=require(_0xabec('0x1'))[_0xabec('0x2')];var moment=require(_0xabec('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xabec('0x4'));var util=require(_0xabec('0x5'));var db=require(_0xabec('0x6'))['db'];var authService=require(_0xabec('0x7'));var utils=require(_0xabec('0x8'));var config=require(_0xabec('0x9'));var logger=require(_0xabec('0xa'))(_0xabec('0xb'));function isActiveDirectoryConfigured(_0xda9982){var _0x5e7de2=![];if(typeof _0xda9982[_0xabec('0xc')]!==_0xabec('0xd')){_0x5e7de2=_0xda9982[_0xabec('0xc')][_0xabec('0xe')]&&_0xda9982[_0xabec('0xc')][_0xabec('0xf')]&&_0xda9982[_0xabec('0xc')]['domain'];}return _0x5e7de2;}function adAuthenticate(_0x3b29d7,_0x2921fe,_0x3db44e){return new BPromise(function(_0x525d83,_0x7a8719){try{var _0x32a777=new ActiveDirectory(_0x3b29d7);_0x32a777['authenticate'](_0x2921fe,_0x3db44e,function(_0x5b448e,_0x53a111){if(_0x5b448e){logger[_0xabec('0x10')](_0xabec('0x11'),_0x2921fe,util['inspect'](_0x5b448e,{'showHidden':![],'depth':null}));_0x7a8719('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x53a111){logger[_0xabec('0x10')](_0xabec('0x12'),_0x2921fe);_0x7a8719(_0xabec('0x13'));}else{_0x525d83(_0x53a111);}});}catch(_0x4a037a){_0x7a8719(_0x4a037a);}});}function ActiveDirectoryAuthenticate(_0x321550,_0x47f841,_0x328573,_0x456ace){var _0x37a0cc,_0x230d03;if(!isActiveDirectoryConfigured(config)){logger[_0xabec('0x10')](_0xabec('0x14'),_0x47f841);return _0x456ace(null,![],{'message':_0xabec('0x13')});}return db[_0xabec('0x15')]['findOne']({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xabec('0x16')],'raw':!![]})[_0xabec('0x17')](function(_0x825801){_0x37a0cc=_0x825801;if(!_0x37a0cc['adSsoEnabled']){logger[_0xabec('0x10')](_0xabec('0x18'),_0x47f841);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x321550[_0xabec('0x19')]({'attributes':['id','name',_0xabec('0x1a'),_0xabec('0x1b'),_0xabec('0x1c'),_0xabec('0x1d'),_0xabec('0x1e'),_0xabec('0x1f'),'online'],'where':{'name':_0x47f841,'role':{'$or':['admin',_0xabec('0x20'),_0xabec('0x21')]},'adSsoEnabled':!![]}});})['then'](function(_0x992108){if(!_0x992108||_0x992108&&_0x992108['name']!==_0x47f841){throw new Error(_0xabec('0x13'));}_0x230d03=_0x992108;var _0x1f653b=_0x230d03['name']+'@'+config[_0xabec('0xc')][_0xabec('0x22')];return adAuthenticate(config[_0xabec('0xc')],_0x1f653b,_0x328573);})[_0xabec('0x17')](function(_0x13cbbe){if(_0x230d03['disabled']){throw new Error(_0xabec('0x13'));}if(_0x37a0cc['blockDuration']>0x0){if(_0x230d03[_0xabec('0x1e')]){if(moment(_0x230d03['blockedAt'])[_0xabec('0x23')](_0x37a0cc['blockDuration'],'minutes')>moment()){throw new Error(_0xabec('0x13'));}return utils[_0xabec('0x24')](_0x230d03,0x0,![],null)[_0xabec('0x17')](function(){return utils[_0xabec('0x25')](_0x230d03);})[_0xabec('0x17')](function(){return _0x456ace(null,_0x230d03);});}else{return utils['getLicense'](_0x230d03)['then'](function(){return _0x456ace(null,_0x230d03);});}}else{return utils[_0xabec('0x25')](_0x230d03)[_0xabec('0x17')](function(){return _0x456ace(null,_0x230d03);});}})[_0xabec('0x26')](function(_0xb395c0){return _0x456ace(null,![],_0xb395c0);});}function handleError(_0x5a95e2,_0x337346,_0x2f4c68){return _0x5a95e2[_0xabec('0x27')](_0x337346||0x1f4)[_0xabec('0x28')]({'message':_0x2f4c68?_0x2f4c68[_0xabec('0x29')]||_0x2f4c68:''});}exports[_0xabec('0x2a')]=function(_0x24096d,_0x1af9f3,_0x19bbb2){passport['authenticate'](_0xabec('0x2b'),function(_0x4ee4b0,_0x313d6b,_0x31a66d){var _0x140f86=_0x4ee4b0||_0x31a66d;if(_0x140f86){return handleError(_0x1af9f3,0x191,_0x140f86);}if(!_0x313d6b){return handleError(_0x1af9f3,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x50d18a={'payload':{'id':_0x313d6b['id'],'role':_0x313d6b[_0xabec('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0xabec('0x2c')](_0x50d18a)[_0xabec('0x17')](function(_0x5df78a){_0x1af9f3[_0xabec('0x2d')]({'id':_0x313d6b['id'],'token':_0x5df78a,'statusCall':'','isAlreadyLogged':_0x313d6b[_0xabec('0x2e')]});});}})(_0x24096d,_0x1af9f3,_0x19bbb2);};passport[_0xabec('0x2f')](_0xabec('0x2b'),new LocalStrategy({'usernameField':_0xabec('0x30'),'passwordField':_0xabec('0x1a')},function(_0x43ef77,_0x767417,_0x262ff5){return ActiveDirectoryAuthenticate(db[_0xabec('0x31')],_0x43ef77,_0x767417,_0x262ff5);})); \ No newline at end of file +var _0x0737=['moment','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','disabled','blockedAt','online','user','agent','blocked','add','minutes','clearBlockUser','getLicense','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','use','User','passport','passport-local','Strategy'];(function(_0x4bef05,_0x289ab6){var _0x122937=function(_0x4ead4a){while(--_0x4ead4a){_0x4bef05['push'](_0x4bef05['shift']());}};_0x122937(++_0x289ab6);}(_0x0737,0xfc));var _0x7073=function(_0x144b47,_0x2dd40f){_0x144b47=_0x144b47-0x0;var _0x5ae881=_0x0737[_0x144b47];return _0x5ae881;};'use strict';var passport=require(_0x7073('0x0'));var LocalStrategy=require(_0x7073('0x1'))[_0x7073('0x2')];var moment=require(_0x7073('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x7073('0x4'));var util=require(_0x7073('0x5'));var db=require(_0x7073('0x6'))['db'];var authService=require(_0x7073('0x7'));var utils=require('../../config/utils');var config=require(_0x7073('0x8'));var logger=require(_0x7073('0x9'))(_0x7073('0xa'));function isActiveDirectoryConfigured(_0x29b16e){var _0x27f3b0=![];if(typeof _0x29b16e[_0x7073('0xb')]!==_0x7073('0xc')){_0x27f3b0=_0x29b16e[_0x7073('0xb')][_0x7073('0xd')]&&_0x29b16e['activedirectory'][_0x7073('0xe')]&&_0x29b16e[_0x7073('0xb')][_0x7073('0xf')];}return _0x27f3b0;}function adAuthenticate(_0x4e6c31,_0x854419,_0x1c660c){return new BPromise(function(_0x1042fd,_0x95aad8){try{var _0x47fd8f=new ActiveDirectory(_0x4e6c31);_0x47fd8f[_0x7073('0x10')](_0x854419,_0x1c660c,function(_0x139d12,_0x39950e){if(_0x139d12){logger[_0x7073('0x11')](_0x7073('0x12'),_0x854419,util[_0x7073('0x13')](_0x139d12,{'showHidden':![],'depth':null}));_0x95aad8(_0x7073('0x14'));}else if(!_0x39950e){logger[_0x7073('0x11')](_0x7073('0x15'),_0x854419);_0x95aad8(_0x7073('0x14'));}else{_0x1042fd(_0x39950e);}});}catch(_0x5b31c3){_0x95aad8(_0x5b31c3);}});}function ActiveDirectoryAuthenticate(_0x113434,_0x4da2c4,_0x4f450d,_0x54f147){var _0x1895e3,_0xdbebad;if(!isActiveDirectoryConfigured(config)){logger[_0x7073('0x11')](_0x7073('0x16'),_0x4da2c4);return _0x54f147(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x7073('0x17')][_0x7073('0x18')]({'where':{'id':0x1},'attributes':[_0x7073('0x19'),_0x7073('0x1a')],'raw':!![]})[_0x7073('0x1b')](function(_0x372554){_0x1895e3=_0x372554;if(!_0x1895e3['adSsoEnabled']){logger[_0x7073('0x11')](_0x7073('0x1c'),_0x4da2c4);throw new Error(_0x7073('0x14'));}return _0x113434[_0x7073('0x18')]({'attributes':['id',_0x7073('0x1d'),_0x7073('0x1e'),_0x7073('0x1f'),'role',_0x7073('0x20'),'blocked',_0x7073('0x21'),_0x7073('0x22')],'where':{'name':_0x4da2c4,'role':{'$or':['admin',_0x7073('0x23'),_0x7073('0x24')]},'adSsoEnabled':!![]}});})[_0x7073('0x1b')](function(_0x5878fb){if(!_0x5878fb||_0x5878fb&&_0x5878fb[_0x7073('0x1d')]!==_0x4da2c4){throw new Error(_0x7073('0x14'));}_0xdbebad=_0x5878fb;var _0x105db6=_0xdbebad['name']+'@'+config[_0x7073('0xb')]['domain'];return adAuthenticate(config[_0x7073('0xb')],_0x105db6,_0x4f450d);})[_0x7073('0x1b')](function(_0x2e6dd1){if(_0xdbebad[_0x7073('0x20')]){throw new Error(_0x7073('0x14'));}if(_0x1895e3[_0x7073('0x1a')]>0x0){if(_0xdbebad[_0x7073('0x25')]){if(moment(_0xdbebad[_0x7073('0x21')])[_0x7073('0x26')](_0x1895e3[_0x7073('0x1a')],_0x7073('0x27'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x7073('0x28')](_0xdbebad,0x0,![],null)[_0x7073('0x1b')](function(){return utils[_0x7073('0x29')](_0xdbebad);})[_0x7073('0x1b')](function(){return _0x54f147(null,_0xdbebad);});}else{return utils[_0x7073('0x29')](_0xdbebad)['then'](function(){return _0x54f147(null,_0xdbebad);});}}else{return utils[_0x7073('0x29')](_0xdbebad)[_0x7073('0x1b')](function(){return _0x54f147(null,_0xdbebad);});}})['catch'](function(_0x408f4e){return _0x54f147(null,![],_0x408f4e);});}function handleError(_0x154123,_0x4ef7d3,_0x5b9422){return _0x154123[_0x7073('0x2a')](_0x4ef7d3||0x1f4)['send']({'message':_0x5b9422?_0x5b9422[_0x7073('0x2b')]||_0x5b9422:''});}exports[_0x7073('0x2c')]=function(_0x204614,_0x51a7a7,_0x4861ab){passport[_0x7073('0x10')](_0x7073('0x2d'),function(_0xf3f716,_0x322e9c,_0x58e795){var _0xdd40e1=_0xf3f716||_0x58e795;if(_0xdd40e1){return handleError(_0x51a7a7,0x191,_0xdd40e1);}if(!_0x322e9c){return handleError(_0x51a7a7,0x194,{'message':_0x7073('0x2e')});}else{var _0x309723={'payload':{'id':_0x322e9c['id'],'role':_0x322e9c[_0x7073('0x2f')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x309723)[_0x7073('0x1b')](function(_0x54681e){_0x51a7a7[_0x7073('0x30')]({'id':_0x322e9c['id'],'token':_0x54681e,'statusCall':'','isAlreadyLogged':_0x322e9c['online']});});}})(_0x204614,_0x51a7a7,_0x4861ab);};passport[_0x7073('0x31')]('ad-login',new LocalStrategy({'usernameField':_0x7073('0x1d'),'passwordField':_0x7073('0x1e')},function(_0xdf5e06,_0x2f4225,_0x20acbe){return ActiveDirectoryAuthenticate(db[_0x7073('0x32')],_0xdf5e06,_0x2f4225,_0x20acbe);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index aead2f3..67b93c6 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 _0x68f4=['post','login','exports','express','./authActiveDirectory.controller'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x68f4,0x134));var _0x468f=function(_0x284a61,_0x231686){_0x284a61=_0x284a61-0x0;var _0x220e3c=_0x68f4[_0x284a61];return _0x220e3c;};'use strict';var express=require(_0x468f('0x0'));var router=express['Router']();var controller=require(_0x468f('0x1'));router[_0x468f('0x2')]('/',controller[_0x468f('0x3')]);module[_0x468f('0x4')]=router; \ No newline at end of file +var _0xe011=['exports','Router','./authActiveDirectory.controller','post','login'];(function(_0x565b7b,_0x2e6420){var _0x580aaf=function(_0x366850){while(--_0x366850){_0x565b7b['push'](_0x565b7b['shift']());}};_0x580aaf(++_0x2e6420);}(_0xe011,0xb5));var _0x1e01=function(_0x562faa,_0x23adc7){_0x562faa=_0x562faa-0x0;var _0xc70f59=_0xe011[_0x562faa];return _0xc70f59;};'use strict';var express=require('express');var router=express[_0x1e01('0x0')]();var controller=require(_0x1e01('0x1'));router[_0x1e01('0x2')]('/',controller[_0x1e01('0x3')]);module[_0x1e01('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 f04402f..2d33c3f 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(_0x5b487a,_0x242987){var _0x4b0f34=function(_0x7de9ad){while(--_0x7de9ad){_0x5b487a['push'](_0x5b487a['shift']());}};_0x4b0f34(++_0x242987);}(_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(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x7a54,0x106));var _0x47a5=function(_0x42a65e,_0x316a8b){_0x42a65e=_0x42a65e-0x0;var _0x4a4670=_0x7a54[_0x42a65e];return _0x4a4670;};'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 942caba..f6b0ec6 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 _0x5d6b=['../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','setTokenCookie','exports','passport','./authGoogle.controller'];(function(_0x52e77f,_0x368694){var _0x3aad87=function(_0x2a4f2e){while(--_0x2a4f2e){_0x52e77f['push'](_0x52e77f['shift']());}};_0x3aad87(++_0x368694);}(_0x5d6b,0xa8));var _0xb5d6=function(_0x5c298a,_0x579b14){_0x5c298a=_0x5c298a-0x0;var _0x3419fe=_0x5d6b[_0x5c298a];return _0x3419fe;};'use strict';var express=require('express');var passport=require(_0xb5d6('0x0'));var router=express['Router']();var controller=require(_0xb5d6('0x1'));var userController=require(_0xb5d6('0x2'));var authService=require(_0xb5d6('0x3'));router[_0xb5d6('0x4')]('/',controller['login']);router['get'](_0xb5d6('0x5'),controller[_0xb5d6('0x6')],authService[_0xb5d6('0x7')],userController['login'],authService[_0xb5d6('0x8')]);module[_0xb5d6('0x9')]=router; \ No newline at end of file +var _0x900a=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','login','setTokenCookie','exports','express','passport','Router'];(function(_0x4a6cb7,_0x48a3d5){var _0x3cc689=function(_0x1b96dc){while(--_0x1b96dc){_0x4a6cb7['push'](_0x4a6cb7['shift']());}};_0x3cc689(++_0x48a3d5);}(_0x900a,0xe7));var _0xa900=function(_0xefe512,_0x50ab6f){_0xefe512=_0xefe512-0x0;var _0x405fa8=_0x900a[_0xefe512];return _0x405fa8;};'use strict';var express=require(_0xa900('0x0'));var passport=require(_0xa900('0x1'));var router=express[_0xa900('0x2')]();var controller=require(_0xa900('0x3'));var userController=require(_0xa900('0x4'));var authService=require(_0xa900('0x5'));router[_0xa900('0x6')]('/',controller['login']);router['get'](_0xa900('0x7'),controller[_0xa900('0x8')],authService[_0xa900('0x9')],userController[_0xa900('0xa')],authService[_0xa900('0xb')]);module[_0xa900('0xc')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 1acfbb2..e476260 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 _0x862f=['online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','host','/reset/','status','Reset\x20Email\x20sent!','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','validatePasswordPattern','previousPasswords','save','use','local-login','util','passport','Strategy','jayson/promise','lodash','../../mysqldb','../../components/auth/service','client','Setting','blockDuration','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','add','clearBlockUser','allowedLoginAttempts','minutes','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','user','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json'];(function(_0x31f2e2,_0x23a432){var _0x2136e5=function(_0x4e4554){while(--_0x4e4554){_0x31f2e2['push'](_0x31f2e2['shift']());}};_0x2136e5(++_0x23a432);}(_0x862f,0xf1));var _0xf862=function(_0x1f4811,_0x53abb2){_0x1f4811=_0x1f4811-0x0;var _0x28b51a=_0x862f[_0x1f4811];return _0x28b51a;};'use strict';var util=require(_0xf862('0x0'));var passport=require(_0xf862('0x1'));var LocalStrategy=require('passport-local')[_0xf862('0x2')];var jayson=require(_0xf862('0x3'));var _=require(_0xf862('0x4'));var rs=require('randomstring');var moment=require('moment');var db=require(_0xf862('0x5'))['db'];var authService=require(_0xf862('0x6'));var utils=require('../../config/utils');var client=jayson[_0xf862('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x3ce5a8,_0xc9199a,_0x351eea,_0xf1f6cc){var _0x5db921,_0x368ba5;return db[_0xf862('0x8')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf862('0x9')],'raw':!![]})['then'](function(_0x28d58f){_0x5db921=_0x28d58f;return _0x3ce5a8['findOne']({'attributes':['id',_0xf862('0xa'),_0xf862('0xb'),_0xf862('0xc'),_0xf862('0xd'),_0xf862('0xe'),'blocked',_0xf862('0xf'),_0xf862('0x10')],'where':{'name':_0xc9199a,'role':{'$or':[_0xf862('0x11'),'user',_0xf862('0x12')]}}});})[_0xf862('0x13')](function(_0x58bf87){if(!_0x58bf87||_0x58bf87&&_0x58bf87['name']!==_0xc9199a){throw new Error(_0xf862('0x14'));}else{_0x368ba5=_0x58bf87;return _0x368ba5;}})[_0xf862('0x13')](function(){_0x368ba5[_0xf862('0x15')](_0x351eea,function(_0x2916ff,_0x37fa6b){var _0x5083e0=_0x368ba5[_0xf862('0x10')]+0x1;if(_0x2916ff){return _0xf1f6cc(_0x2916ff);}else if(!_0x37fa6b){if(_0x368ba5[_0xf862('0xe')]){return _0xf1f6cc(null,![],{'message':_0xf862('0x14')});}else if(_0x5db921['allowedLoginAttempts']>0x0){if(_0x368ba5[_0xf862('0x16')]){if(_0x5db921[_0xf862('0x9')]>0x0){if(moment(_0x368ba5['blockedAt'])[_0xf862('0x17')](_0x5db921[_0xf862('0x9')],'minutes')>moment()){return _0xf1f6cc(null,![],{'message':_0xf862('0x14')});}else{return utils[_0xf862('0x18')](_0x368ba5,_0x5083e0,![],null)[_0xf862('0x13')](function(){return _0xf1f6cc(null,![],{'message':_0xf862('0x14')});});}}else{return _0xf1f6cc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x5083e0>=_0x5db921[_0xf862('0x19')]){return utils[_0xf862('0x18')](_0x368ba5,0x0,!![],moment())[_0xf862('0x13')](function(){return _0xf1f6cc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x368ba5,_0x5083e0,![],null)[_0xf862('0x13')](function(){return _0xf1f6cc(null,![],{'message':_0xf862('0x14')});});}}}else{return _0xf1f6cc(null,![],{'message':_0xf862('0x14')});}}else{if(_0x368ba5[_0xf862('0xe')]){return _0xf1f6cc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x5db921[_0xf862('0x19')]>0x0){if(_0x368ba5[_0xf862('0x16')]){if(_0x5db921[_0xf862('0x9')]>0x0){if(moment(_0x368ba5[_0xf862('0xf')])[_0xf862('0x17')](_0x5db921[_0xf862('0x9')],_0xf862('0x1a'))>moment()){return _0xf1f6cc(null,![],{'message':_0xf862('0x14')});}else{return utils[_0xf862('0x18')](_0x368ba5,0x0,![],null)[_0xf862('0x13')](function(){return utils[_0xf862('0x1b')](_0x368ba5);})[_0xf862('0x13')](function(){return _0xf1f6cc(null,_0x368ba5);});}}else{return _0xf1f6cc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x368ba5,0x0,![],null)['then'](function(){return utils[_0xf862('0x1b')](_0x368ba5);})[_0xf862('0x13')](function(){return _0xf1f6cc(null,_0x368ba5);})['catch'](function(_0xc86c67){return _0xf1f6cc(null,![],_0xc86c67);});}}else{if(_0x368ba5['blocked']){return _0xf1f6cc(null,![],{'message':_0xf862('0x14')});}else{return utils[_0xf862('0x1b')](_0x368ba5)[_0xf862('0x13')](function(){return _0xf1f6cc(null,_0x368ba5);});}}}});})[_0xf862('0x1c')](function(_0x217c51){return _0xf1f6cc(null,![],_0x217c51);});}function sendServiceMail(_0x326865){return db['MailAccount'][_0xf862('0x1d')]({'where':{'service':!![]},'attributes':['id','name',_0xf862('0x1e')],'include':[{'model':db[_0xf862('0x1f')],'as':_0xf862('0x20'),'include':[{'model':db[_0xf862('0x21')],'as':_0xf862('0x21')}]}]})[_0xf862('0x13')](function(_0x5121d6){if(!_0x5121d6){throw new Error(_0xf862('0x22'));}var _0x21a1cb=_0x5121d6[_0xf862('0x23')]();var _0x3fe678={'account':_0x21a1cb,'message':_[_0xf862('0x24')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x5121d6[_0xf862('0xa')],_0x5121d6[_0xf862('0x1e')]||_0x5121d6[_0xf862('0x20')][_0xf862('0x25')])},_0x326865)};return client['request'](_0xf862('0x26'),_0x3fe678);})[_0xf862('0x13')](function(_0x309f56){if(_0x309f56['error']){throw new Error(util['format'](_0xf862('0x27'),_0x309f56[_0xf862('0x28')][_0xf862('0x29')]||JSON['stringify'](_0x309f56[_0xf862('0x28')])));}return!![];});}function handleError(_0x3fd405,_0x22bc37,_0x154fd2){return _0x3fd405['status'](_0x22bc37||0x1f4)[_0xf862('0x2a')]({'message':_0x154fd2?_0x154fd2['message']||_0x154fd2:''});}exports[_0xf862('0x2b')]=function(_0x226ab5,_0x12fda3,_0x250814){passport[_0xf862('0x15')]('local-login',function(_0x50db8e,_0xfdb140,_0x472f58){var _0x23dc1d=_0x50db8e||_0x472f58;if(_0x23dc1d){return handleError(_0x12fda3,0x191,_0x23dc1d);}if(!_0xfdb140){return handleError(_0x12fda3,0x194,{'message':_0xf862('0x2c')});}else{var _0x137ad1={'payload':{'id':_0xfdb140['id'],'role':_0xfdb140[_0xf862('0xd')]},'options':{'expiresIn':0x15180}};return authService[_0xf862('0x2d')](_0x137ad1)[_0xf862('0x13')](function(_0x550698){_0x12fda3[_0xf862('0x2e')]({'id':_0xfdb140['id'],'token':_0x550698,'statusCall':'','isAlreadyLogged':_0xfdb140[_0xf862('0x2f')]});});}})(_0x226ab5,_0x12fda3,_0x250814);};exports[_0xf862('0x30')]=function(_0x504b56,_0x3f477d){if(!_0x504b56[_0xf862('0x31')]['email']){return handleError(_0x3f477d,0x1f4,{'message':_0xf862('0x32')});}var _0x8bb2bf=rs[_0xf862('0x33')]();_0x504b56[_0xf862('0x31')][_0xf862('0x1e')]=_0x504b56['body'][_0xf862('0x1e')][_0xf862('0x34')]()[_0xf862('0x35')]();var _0x13a57c;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf862('0x9')],'raw':!![]})['then'](function(_0x3dbeb2){_0x13a57c=_0x3dbeb2;return db[_0xf862('0x36')][_0xf862('0x1d')]({'where':{'email':_0x504b56['body']['email']}});})['then'](function(_0x4e0edd){if(!_0x4e0edd){throw new Error(_0xf862('0x37'));}if(_0x4e0edd[_0xf862('0xe')]){throw new Error(_0xf862('0x38'));}if(_0x4e0edd[_0xf862('0x16')]){if(moment(_0x4e0edd[_0xf862('0xf')])[_0xf862('0x17')](_0x13a57c[_0xf862('0x9')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4e0edd[_0xf862('0x16')]=![];_0x4e0edd['blockedAt']=null;}}_0x4e0edd[_0xf862('0x39')]=_0x8bb2bf;_0x4e0edd[_0xf862('0x3a')]=Date[_0xf862('0x3b')]()+0x36ee80;return _0x4e0edd['save']();})[_0xf862('0x13')](function(){return sendServiceMail({'to':_0x504b56[_0xf862('0x31')][_0xf862('0x1e')],'subject':_0xf862('0x3c'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xf862('0x3d')+'https://'+_0x504b56['headers'][_0xf862('0x3e')]+_0xf862('0x3f')+_0x8bb2bf+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x3f477d[_0xf862('0x40')](0xc8)[_0xf862('0x2a')]({'message':_0xf862('0x41')});})[_0xf862('0x1c')](function(_0xd9e635){return handleError(_0x3f477d,0x1f4,_0xd9e635);});};exports['reset']=function(_0x89aadd,_0x2502de){return db[_0xf862('0x36')][_0xf862('0x1d')]({'where':{'resetPasswordToken':_0x89aadd['params']['token'],'resetPasswordExpires':{'$gt':Date[_0xf862('0x3b')]()}}})[_0xf862('0x13')](function(_0x527b33){if(!_0x527b33){throw new Error(_0xf862('0x42'));}return db['Setting']['findOne']({'attributes':['id','securePassword','enforcePasswordHistory','passwordHistoryLimit']})[_0xf862('0x13')](function(_0x46635e){if(_0x46635e['securePassword'])authService[_0xf862('0x43')](_0x89aadd[_0xf862('0x31')][_0xf862('0xb')]);if(!_0x46635e['enforcePasswordHistory']||!_0x527b33[_0xf862('0x44')])return _0x527b33;authService['validatePasswordHistory'](_0x89aadd[_0xf862('0x31')][_0xf862('0xb')],_0x527b33['previousPasswords'],_0x46635e['passwordHistoryLimit']);return _0x527b33;})['then'](function(){_0x527b33[_0xf862('0xb')]=_0x89aadd[_0xf862('0x31')][_0xf862('0xb')];_0x527b33[_0xf862('0x39')]=null;_0x527b33[_0xf862('0x3a')]=null;return _0x527b33[_0xf862('0x45')]();});})[_0xf862('0x13')](function(){_0x2502de['status'](0xc8)[_0xf862('0x2a')]({'message':'Password\x20reset!'});})['catch'](function(_0x306e83){return handleError(_0x2502de,0x1f4,_0x306e83);});};passport[_0xf862('0x46')](_0xf862('0x47'),new LocalStrategy({'usernameField':_0xf862('0xa'),'passwordField':_0xf862('0xb')},function(_0x38f157,_0x2eead7,_0x1b7bab){return localAuthenticate(db['User'],_0x38f157,_0x2eead7,_0x1b7bab);})); \ No newline at end of file +var _0x3be7=['send','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','save','xCally\x20Motion\x20Password\x20Reset','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordExpires','Password\x20reset!','util','passport','Strategy','jayson/promise','randomstring','moment','../../config/utils','client','Setting','findOne','blockDuration','then','password','salt','role','disabled','blockedAt','admin','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blocked','add','clearBlockUser','minutes','catch','getLicense','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status'];(function(_0x4cf372,_0x369d12){var _0xf08bf9=function(_0x1617fc){while(--_0x1617fc){_0x4cf372['push'](_0x4cf372['shift']());}};_0xf08bf9(++_0x369d12);}(_0x3be7,0x19c));var _0x73be=function(_0x482b80,_0x31b684){_0x482b80=_0x482b80-0x0;var _0x1608a0=_0x3be7[_0x482b80];return _0x1608a0;};'use strict';var util=require(_0x73be('0x0'));var passport=require(_0x73be('0x1'));var LocalStrategy=require('passport-local')[_0x73be('0x2')];var jayson=require(_0x73be('0x3'));var _=require('lodash');var rs=require(_0x73be('0x4'));var moment=require(_0x73be('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x73be('0x6'));var client=jayson[_0x73be('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x2eeb42,_0x3f635e,_0x52322a,_0x253441){var _0x157aeb,_0x5c6100;return db[_0x73be('0x8')][_0x73be('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x73be('0xa')],'raw':!![]})[_0x73be('0xb')](function(_0x331516){_0x157aeb=_0x331516;return _0x2eeb42[_0x73be('0x9')]({'attributes':['id','name',_0x73be('0xc'),_0x73be('0xd'),_0x73be('0xe'),_0x73be('0xf'),'blocked',_0x73be('0x10'),'loginAttempts'],'where':{'name':_0x3f635e,'role':{'$or':[_0x73be('0x11'),_0x73be('0x12'),_0x73be('0x13')]}}});})[_0x73be('0xb')](function(_0x447dd6){if(!_0x447dd6||_0x447dd6&&_0x447dd6[_0x73be('0x14')]!==_0x3f635e){throw new Error(_0x73be('0x15'));}else{_0x5c6100=_0x447dd6;return _0x5c6100;}})[_0x73be('0xb')](function(){_0x5c6100['authenticate'](_0x52322a,function(_0x18610d,_0x5619b1){var _0x1b87c5=_0x5c6100['loginAttempts']+0x1;if(_0x18610d){return _0x253441(_0x18610d);}else if(!_0x5619b1){if(_0x5c6100[_0x73be('0xf')]){return _0x253441(null,![],{'message':_0x73be('0x15')});}else if(_0x157aeb[_0x73be('0x16')]>0x0){if(_0x5c6100[_0x73be('0x17')]){if(_0x157aeb[_0x73be('0xa')]>0x0){if(moment(_0x5c6100[_0x73be('0x10')])[_0x73be('0x18')](_0x157aeb[_0x73be('0xa')],'minutes')>moment()){return _0x253441(null,![],{'message':_0x73be('0x15')});}else{return utils['clearBlockUser'](_0x5c6100,_0x1b87c5,![],null)['then'](function(){return _0x253441(null,![],{'message':_0x73be('0x15')});});}}else{return _0x253441(null,![],{'message':_0x73be('0x15')});}}else{if(_0x1b87c5>=_0x157aeb[_0x73be('0x16')]){return utils[_0x73be('0x19')](_0x5c6100,0x0,!![],moment())['then'](function(){return _0x253441(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x73be('0x19')](_0x5c6100,_0x1b87c5,![],null)['then'](function(){return _0x253441(null,![],{'message':_0x73be('0x15')});});}}}else{return _0x253441(null,![],{'message':_0x73be('0x15')});}}else{if(_0x5c6100[_0x73be('0xf')]){return _0x253441(null,![],{'message':_0x73be('0x15')});}else if(_0x157aeb[_0x73be('0x16')]>0x0){if(_0x5c6100[_0x73be('0x17')]){if(_0x157aeb[_0x73be('0xa')]>0x0){if(moment(_0x5c6100[_0x73be('0x10')])['add'](_0x157aeb['blockDuration'],_0x73be('0x1a'))>moment()){return _0x253441(null,![],{'message':_0x73be('0x15')});}else{return utils['clearBlockUser'](_0x5c6100,0x0,![],null)[_0x73be('0xb')](function(){return utils['getLicense'](_0x5c6100);})[_0x73be('0xb')](function(){return _0x253441(null,_0x5c6100);});}}else{return _0x253441(null,![],{'message':_0x73be('0x15')});}}else{return utils[_0x73be('0x19')](_0x5c6100,0x0,![],null)[_0x73be('0xb')](function(){return utils['getLicense'](_0x5c6100);})[_0x73be('0xb')](function(){return _0x253441(null,_0x5c6100);})[_0x73be('0x1b')](function(_0x1bc730){return _0x253441(null,![],_0x1bc730);});}}else{if(_0x5c6100['blocked']){return _0x253441(null,![],{'message':_0x73be('0x15')});}else{return utils[_0x73be('0x1c')](_0x5c6100)[_0x73be('0xb')](function(){return _0x253441(null,_0x5c6100);});}}}});})['catch'](function(_0x351974){return _0x253441(null,![],_0x351974);});}function sendServiceMail(_0xbe58b9){return db['MailAccount'][_0x73be('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x73be('0x14'),_0x73be('0x1e')],'include':[{'model':db['MailServerOut'],'as':_0x73be('0x1f'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})[_0x73be('0xb')](function(_0x5e54aa){if(!_0x5e54aa){throw new Error(_0x73be('0x20'));}var _0x45e736=_0x5e54aa[_0x73be('0x21')]();var _0x34d578={'account':_0x45e736,'message':_[_0x73be('0x22')]({'from':util[_0x73be('0x23')](_0x73be('0x24'),_0x5e54aa[_0x73be('0x14')],_0x5e54aa[_0x73be('0x1e')]||_0x5e54aa[_0x73be('0x1f')][_0x73be('0x12')])},_0xbe58b9)};return client[_0x73be('0x25')](_0x73be('0x26'),_0x34d578);})[_0x73be('0xb')](function(_0x75c6b2){if(_0x75c6b2[_0x73be('0x27')]){throw new Error(util['format'](_0x73be('0x28'),_0x75c6b2[_0x73be('0x27')][_0x73be('0x29')]||JSON[_0x73be('0x2a')](_0x75c6b2[_0x73be('0x27')])));}return!![];});}function handleError(_0x11b1ba,_0x45c0f0,_0x28c922){return _0x11b1ba[_0x73be('0x2b')](_0x45c0f0||0x1f4)[_0x73be('0x2c')]({'message':_0x28c922?_0x28c922[_0x73be('0x29')]||_0x28c922:''});}exports[_0x73be('0x2d')]=function(_0xcae45c,_0x3b2f13,_0x2660e4){passport[_0x73be('0x2e')]('local-login',function(_0x39a03a,_0x114551,_0x23de8c){var _0x4b12e4=_0x39a03a||_0x23de8c;if(_0x4b12e4){return handleError(_0x3b2f13,0x191,_0x4b12e4);}if(!_0x114551){return handleError(_0x3b2f13,0x194,{'message':_0x73be('0x2f')});}else{var _0xf1d856={'payload':{'id':_0x114551['id'],'role':_0x114551[_0x73be('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x73be('0x30')](_0xf1d856)[_0x73be('0xb')](function(_0x396d3d){_0x3b2f13[_0x73be('0x31')]({'id':_0x114551['id'],'token':_0x396d3d,'statusCall':'','isAlreadyLogged':_0x114551['online']});});}})(_0xcae45c,_0x3b2f13,_0x2660e4);};exports['forgot']=function(_0x337ed5,_0x1ad96f){if(!_0x337ed5[_0x73be('0x32')]['email']){return handleError(_0x1ad96f,0x1f4,{'message':_0x73be('0x33')});}var _0x346381=rs[_0x73be('0x34')]();_0x337ed5[_0x73be('0x32')][_0x73be('0x1e')]=_0x337ed5[_0x73be('0x32')][_0x73be('0x1e')][_0x73be('0x35')]()[_0x73be('0x36')]();var _0x164287;return db[_0x73be('0x8')][_0x73be('0x9')]({'where':{'id':0x1},'attributes':[_0x73be('0x16'),'blockDuration'],'raw':!![]})[_0x73be('0xb')](function(_0xe76a47){_0x164287=_0xe76a47;return db[_0x73be('0x37')][_0x73be('0x1d')]({'where':{'email':_0x337ed5[_0x73be('0x32')]['email']}});})['then'](function(_0x4ceb0b){if(!_0x4ceb0b){throw new Error(_0x73be('0x38'));}if(_0x4ceb0b[_0x73be('0xf')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x4ceb0b[_0x73be('0x17')]){if(moment(_0x4ceb0b[_0x73be('0x10')])[_0x73be('0x18')](_0x164287['blockDuration'],_0x73be('0x1a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4ceb0b[_0x73be('0x17')]=![];_0x4ceb0b[_0x73be('0x10')]=null;}}_0x4ceb0b[_0x73be('0x39')]=_0x346381;_0x4ceb0b['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x4ceb0b[_0x73be('0x3a')]();})[_0x73be('0xb')](function(){return sendServiceMail({'to':_0x337ed5[_0x73be('0x32')]['email'],'subject':_0x73be('0x3b'),'text':'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://'+_0x337ed5['headers'][_0x73be('0x3c')]+_0x73be('0x3d')+_0x346381+'\x0a\x0a'+_0x73be('0x3e')});})[_0x73be('0xb')](function(){_0x1ad96f[_0x73be('0x2b')](0xc8)['send']({'message':_0x73be('0x3f')});})['catch'](function(_0x41c0aa){return handleError(_0x1ad96f,0x1f4,_0x41c0aa);});};exports[_0x73be('0x40')]=function(_0x4be0bd,_0x19452d){return db[_0x73be('0x37')]['find']({'where':{'resetPasswordToken':_0x4be0bd[_0x73be('0x41')][_0x73be('0x42')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x73be('0xb')](function(_0x3c9188){if(!_0x3c9188){throw new Error(_0x73be('0x43'));}return db[_0x73be('0x8')]['findOne']({'attributes':['id',_0x73be('0x44'),_0x73be('0x45'),'passwordHistoryLimit']})[_0x73be('0xb')](function(_0x4bc574){if(_0x4bc574[_0x73be('0x44')])authService[_0x73be('0x46')](_0x4be0bd[_0x73be('0x32')][_0x73be('0xc')]);if(!_0x4bc574[_0x73be('0x45')]||!_0x3c9188[_0x73be('0x47')])return _0x3c9188;authService[_0x73be('0x48')](_0x4be0bd['body'][_0x73be('0xc')],_0x3c9188['previousPasswords'],_0x4bc574[_0x73be('0x49')]);return _0x3c9188;})[_0x73be('0xb')](function(){_0x3c9188[_0x73be('0xc')]=_0x4be0bd[_0x73be('0x32')][_0x73be('0xc')];_0x3c9188[_0x73be('0x39')]=null;_0x3c9188[_0x73be('0x4a')]=null;return _0x3c9188['save']();});})[_0x73be('0xb')](function(){_0x19452d[_0x73be('0x2b')](0xc8)[_0x73be('0x2c')]({'message':_0x73be('0x4b')});})[_0x73be('0x1b')](function(_0xc7fca6){return handleError(_0x19452d,0x1f4,_0xc7fca6);});};passport['use']('local-login',new LocalStrategy({'usernameField':_0x73be('0x14'),'passwordField':'password'},function(_0x54e245,_0x1b3584,_0xcb2c42){return localAuthenticate(db[_0x73be('0x37')],_0x54e245,_0x1b3584,_0xcb2c42);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 873c20c..808b36f 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 _0xa9e2=['Router','post','/forgot','forgot','/reset/:token','reset','exports','express'];(function(_0x4e46ec,_0xa6c629){var _0x2fdfe0=function(_0x3a77ab){while(--_0x3a77ab){_0x4e46ec['push'](_0x4e46ec['shift']());}};_0x2fdfe0(++_0xa6c629);}(_0xa9e2,0xf7));var _0x2a9e=function(_0xf2691e,_0x2eafbe){_0xf2691e=_0xf2691e-0x0;var _0x439e8c=_0xa9e2[_0xf2691e];return _0x439e8c;};'use strict';var express=require(_0x2a9e('0x0'));var router=express[_0x2a9e('0x1')]();var controller=require('./authLocal.controller');router[_0x2a9e('0x2')]('/',controller['login']);router[_0x2a9e('0x2')](_0x2a9e('0x3'),controller[_0x2a9e('0x4')]);router['post'](_0x2a9e('0x5'),controller[_0x2a9e('0x6')]);module[_0x2a9e('0x7')]=router; \ No newline at end of file +var _0xcb97=['login','post','/forgot','forgot','/reset/:token','reset','exports','express'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xcb97,0x197));var _0x7cb9=function(_0xd4964d,_0x214ea0){_0xd4964d=_0xd4964d-0x0;var _0x4aa6c1=_0xcb97[_0xd4964d];return _0x4aa6c1;};'use strict';var express=require(_0x7cb9('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router['post']('/',controller[_0x7cb9('0x1')]);router[_0x7cb9('0x2')](_0x7cb9('0x3'),controller[_0x7cb9('0x4')]);router[_0x7cb9('0x2')](_0x7cb9('0x5'),controller[_0x7cb9('0x6')]);module[_0x7cb9('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 46c043f..cf530c6 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 _0xebc9=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x4a379b,_0x334e8b){var _0x2e2509=function(_0x82c3b3){while(--_0x82c3b3){_0x4a379b['push'](_0x4a379b['shift']());}};_0x2e2509(++_0x334e8b);}(_0xebc9,0x95));var _0x9ebc=function(_0x3387bd,_0x4639d9){_0x3387bd=_0x3387bd-0x0;var _0x4cf483=_0xebc9[_0x3387bd];return _0x4cf483;};'use strict';var Sequelize=require(_0x9ebc('0x0'));module[_0x9ebc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x9ebc('0x2')]},'description':{'type':Sequelize[_0x9ebc('0x2')]},'status':{'type':Sequelize[_0x9ebc('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9ebc('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x75c9=['exports','STRING','INTEGER','sequelize'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x75c9,0x173));var _0x975c=function(_0x46401e,_0x2a345b){_0x46401e=_0x46401e-0x0;var _0x447cba=_0x75c9[_0x46401e];return _0x447cba;};'use strict';var Sequelize=require(_0x975c('0x0'));module[_0x975c('0x1')]={'name':{'type':Sequelize[_0x975c('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x975c('0x2')]},'description':{'type':Sequelize[_0x975c('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x975c('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 1518df8..85c9a3d 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 _0x35ab=['fast-json-patch','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/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','params','include','options','find','catch','create','body','addConditions','ids','omit','getConditions','findOne','Condition','order','addActions','Action','pick','getActions','eml-format','rimraf','zip-dir'];(function(_0xb1b694,_0x3db15c){var _0x5dcaa3=function(_0x492140){while(--_0x492140){_0xb1b694['push'](_0xb1b694['shift']());}};_0x5dcaa3(++_0x3db15c);}(_0x35ab,0xaf));var _0xb35a=function(_0x4c32f5,_0x3dbbf1){_0x4c32f5=_0x4c32f5-0x0;var _0x19cae9=_0x35ab[_0x4c32f5];return _0x19cae9;};'use strict';var emlformat=require(_0xb35a('0x0'));var rimraf=require(_0xb35a('0x1'));var zipdir=require(_0xb35a('0x2'));var jsonpatch=require(_0xb35a('0x3'));var rp=require('request-promise');var moment=require(_0xb35a('0x4'));var BPromise=require(_0xb35a('0x5'));var Mustache=require(_0xb35a('0x6'));var util=require(_0xb35a('0x7'));var path=require(_0xb35a('0x8'));var sox=require(_0xb35a('0x9'));var csv=require(_0xb35a('0xa'));var ejs=require(_0xb35a('0xb'));var fs=require('fs');var fs_extra=require(_0xb35a('0xc'));var _=require(_0xb35a('0xd'));var squel=require(_0xb35a('0xe'));var crypto=require(_0xb35a('0xf'));var jsforce=require(_0xb35a('0x10'));var deskjs=require(_0xb35a('0x11'));var toCsv=require(_0xb35a('0xa'));var querystring=require(_0xb35a('0x12'));var Papa=require(_0xb35a('0x13'));var Redis=require(_0xb35a('0x14'));var authService=require(_0xb35a('0x15'));var qs=require(_0xb35a('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb35a('0x17'))(_0xb35a('0x18'));var utils=require(_0xb35a('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xb35a('0x1a'));var db=require(_0xb35a('0x1b'))['db'];function respondWithStatusCode(_0x5d5044,_0x413aa7){_0x413aa7=_0x413aa7||0xcc;return function(_0x4c274b){if(_0x4c274b){return _0x5d5044[_0xb35a('0x1c')](_0x413aa7);}return _0x5d5044[_0xb35a('0x1d')](_0x413aa7)['end']();};}function respondWithResult(_0x6e71fb,_0x30cbee){_0x30cbee=_0x30cbee||0xc8;return function(_0x466e96){if(_0x466e96){return _0x6e71fb[_0xb35a('0x1d')](_0x30cbee)[_0xb35a('0x1e')](_0x466e96);}};}function respondWithFilteredResult(_0x3ba8c5,_0x3e59eb){return function(_0x33e179){if(_0x33e179){var _0x293a72=typeof _0x3e59eb[_0xb35a('0x1f')]===_0xb35a('0x20')&&typeof _0x3e59eb[_0xb35a('0x21')]===_0xb35a('0x20');var _0x295131=_0x33e179['count'];var _0x1956b9=_0x293a72?0x0:_0x3e59eb[_0xb35a('0x1f')];var _0x314508=_0x293a72?_0x33e179[_0xb35a('0x22')]:_0x3e59eb['offset']+_0x3e59eb[_0xb35a('0x21')];var _0x55cdaf;if(_0x314508>=_0x295131){_0x314508=_0x295131;_0x55cdaf=0xc8;}else{_0x55cdaf=0xce;}_0x3ba8c5[_0xb35a('0x1d')](_0x55cdaf);return _0x3ba8c5[_0xb35a('0x23')](_0xb35a('0x24'),_0x1956b9+'-'+_0x314508+'/'+_0x295131)[_0xb35a('0x1e')](_0x33e179);}return null;};}function patchUpdates(_0x52c5b5){return function(_0x585cef){try{jsonpatch[_0xb35a('0x25')](_0x585cef,_0x52c5b5,!![]);}catch(_0x3a8102){return BPromise[_0xb35a('0x26')](_0x3a8102);}return _0x585cef[_0xb35a('0x27')]();};}function saveUpdates(_0x14e342,_0x6b3fcb){return function(_0x3b78ca){if(_0x3b78ca){return _0x3b78ca['update'](_0x14e342)[_0xb35a('0x28')](function(_0x25a2dd){return _0x25a2dd;});}return null;};}function removeEntity(_0x3e5378,_0x3a2252){return function(_0x140b07){if(_0x140b07){return _0x140b07[_0xb35a('0x29')]()[_0xb35a('0x28')](function(){_0x3e5378['status'](0xcc)[_0xb35a('0x2a')]();});}};}function handleEntityNotFound(_0x124fb6,_0x4c4d9b){return function(_0x32f7e6){if(!_0x32f7e6){_0x124fb6[_0xb35a('0x1c')](0x194);}return _0x32f7e6;};}function handleError(_0x8e058a,_0xa32e68){_0xa32e68=_0xa32e68||0x1f4;return function(_0x19294b){logger[_0xb35a('0x2b')](_0x19294b['stack']);if(_0x19294b[_0xb35a('0x2c')]){delete _0x19294b[_0xb35a('0x2c')];}_0x8e058a[_0xb35a('0x1d')](_0xa32e68)[_0xb35a('0x2d')](_0x19294b);};}exports[_0xb35a('0x2e')]=function(_0xcfb857,_0x51ff3c){var _0x243d96={},_0x3ad2d3={},_0x2d08cd={'count':0x0,'rows':[]};var _0x38792d=_[_0xb35a('0x2f')](db[_0xb35a('0x30')][_0xb35a('0x31')],function(_0x5b7deb){return{'name':_0x5b7deb[_0xb35a('0x32')],'type':_0x5b7deb[_0xb35a('0x33')][_0xb35a('0x34')]};});_0x3ad2d3[_0xb35a('0x35')]=_['map'](_0x38792d,_0xb35a('0x2c'));_0x3ad2d3[_0xb35a('0x36')]=_[_0xb35a('0x37')](_0xcfb857['query']);_0x3ad2d3[_0xb35a('0x38')]=_[_0xb35a('0x39')](_0x3ad2d3['model'],_0x3ad2d3[_0xb35a('0x36')]);_0x243d96[_0xb35a('0x3a')]=_[_0xb35a('0x39')](_0x3ad2d3[_0xb35a('0x35')],qs['fields'](_0xcfb857[_0xb35a('0x36')][_0xb35a('0x3b')]));_0x243d96[_0xb35a('0x3a')]=_0x243d96['attributes'][_0xb35a('0x3c')]?_0x243d96['attributes']:_0x3ad2d3['model'];if(!_0xcfb857[_0xb35a('0x36')][_0xb35a('0x3d')](_0xb35a('0x3e'))){_0x243d96[_0xb35a('0x21')]=qs[_0xb35a('0x21')](_0xcfb857['query']['limit']);_0x243d96[_0xb35a('0x1f')]=qs[_0xb35a('0x1f')](_0xcfb857[_0xb35a('0x36')]['offset']);}_0x243d96['order']=qs['sort'](_0xcfb857[_0xb35a('0x36')][_0xb35a('0x3f')]);_0x243d96[_0xb35a('0x40')]=qs[_0xb35a('0x38')](_['pick'](_0xcfb857[_0xb35a('0x36')],_0x3ad2d3[_0xb35a('0x38')]),_0x38792d);if(_0xcfb857[_0xb35a('0x36')][_0xb35a('0x41')]){_0x243d96[_0xb35a('0x40')]=_[_0xb35a('0x42')](_0x243d96['where'],{'$or':_[_0xb35a('0x2f')](_0x38792d,function(_0x139ae8){if(_0x139ae8[_0xb35a('0x33')]!==_0xb35a('0x43')){var _0x565e14={};_0x565e14[_0x139ae8[_0xb35a('0x2c')]]={'$like':'%'+_0xcfb857[_0xb35a('0x36')][_0xb35a('0x41')]+'%'};return _0x565e14;}})});}_0x243d96=_[_0xb35a('0x42')]({},_0x243d96,_0xcfb857['options']);var _0x26dbba={'where':_0x243d96[_0xb35a('0x40')]};return db['Automation'][_0xb35a('0x22')](_0x26dbba)[_0xb35a('0x28')](function(_0x28d19e){_0x2d08cd[_0xb35a('0x22')]=_0x28d19e;if(_0xcfb857[_0xb35a('0x36')][_0xb35a('0x44')]){_0x243d96['include']=[{'all':!![]}];}return db[_0xb35a('0x30')][_0xb35a('0x45')](_0x243d96);})[_0xb35a('0x28')](function(_0x5988a1){_0x2d08cd[_0xb35a('0x46')]=_0x5988a1;return _0x2d08cd;})[_0xb35a('0x28')](respondWithFilteredResult(_0x51ff3c,_0x243d96))['catch'](handleError(_0x51ff3c,null));};exports['show']=function(_0x1db02c,_0x1c777e){var _0x9908e7={'raw':![],'where':{'id':_0x1db02c[_0xb35a('0x47')]['id']}},_0x525553={};_0x525553['model']=_['keys'](db[_0xb35a('0x30')][_0xb35a('0x31')]);_0x525553[_0xb35a('0x36')]=_[_0xb35a('0x37')](_0x1db02c[_0xb35a('0x36')]);_0x525553[_0xb35a('0x38')]=_[_0xb35a('0x39')](_0x525553['model'],_0x525553[_0xb35a('0x36')]);_0x9908e7[_0xb35a('0x3a')]=_[_0xb35a('0x39')](_0x525553[_0xb35a('0x35')],qs['fields'](_0x1db02c[_0xb35a('0x36')][_0xb35a('0x3b')]));_0x9908e7[_0xb35a('0x3a')]=_0x9908e7[_0xb35a('0x3a')][_0xb35a('0x3c')]?_0x9908e7[_0xb35a('0x3a')]:_0x525553['model'];if(_0x1db02c[_0xb35a('0x36')][_0xb35a('0x44')]){_0x9908e7[_0xb35a('0x48')]=[{'all':!![]}];}_0x9908e7=_[_0xb35a('0x42')]({},_0x9908e7,_0x1db02c[_0xb35a('0x49')]);return db[_0xb35a('0x30')][_0xb35a('0x4a')](_0x9908e7)['then'](handleEntityNotFound(_0x1c777e,null))[_0xb35a('0x28')](respondWithResult(_0x1c777e,null))[_0xb35a('0x4b')](handleError(_0x1c777e,null));};exports[_0xb35a('0x4c')]=function(_0x508baf,_0x54baf3){return db[_0xb35a('0x30')][_0xb35a('0x4c')](_0x508baf[_0xb35a('0x4d')],{})[_0xb35a('0x28')](respondWithResult(_0x54baf3,0xc9))[_0xb35a('0x4b')](handleError(_0x54baf3,null));};exports['update']=function(_0x1caa03,_0x58ffb5){if(_0x1caa03[_0xb35a('0x4d')]['id']){delete _0x1caa03[_0xb35a('0x4d')]['id'];}return db[_0xb35a('0x30')][_0xb35a('0x4a')]({'where':{'id':_0x1caa03['params']['id']}})[_0xb35a('0x28')](handleEntityNotFound(_0x58ffb5,null))[_0xb35a('0x28')](saveUpdates(_0x1caa03[_0xb35a('0x4d')],null))['then'](respondWithResult(_0x58ffb5,null))['catch'](handleError(_0x58ffb5,null));};exports[_0xb35a('0x29')]=function(_0x48f450,_0x4c870f){return db['Automation'][_0xb35a('0x4a')]({'where':{'id':_0x48f450['params']['id']}})['then'](handleEntityNotFound(_0x4c870f,null))[_0xb35a('0x28')](removeEntity(_0x4c870f,null))['catch'](handleError(_0x4c870f,null));};exports[_0xb35a('0x4e')]=function(_0x20e1eb,_0x1b77af,_0x3bbb02){return db['Condition'][_0xb35a('0x4a')]({'where':{'id':_0x20e1eb[_0xb35a('0x47')]['id']}})[_0xb35a('0x28')](handleEntityNotFound(_0x1b77af,null))['then'](function(_0x5dbe86){if(_0x5dbe86){return _0x5dbe86['addConditions'](_0x20e1eb[_0xb35a('0x4d')][_0xb35a('0x4f')],_[_0xb35a('0x50')](_0x20e1eb[_0xb35a('0x4d')],[_0xb35a('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x1b77af,null))['catch'](handleError(_0x1b77af,null));};exports[_0xb35a('0x51')]=function(_0x2f3935,_0x2f8bb7,_0x2d4bf7){var _0x4178d3={};var _0x2cc593={};var _0x41e002;var _0x2500c5;return db[_0xb35a('0x30')][_0xb35a('0x52')]({'where':{'id':_0x2f3935[_0xb35a('0x47')]['id']}})['then'](handleEntityNotFound(_0x2f8bb7,null))[_0xb35a('0x28')](function(_0x1e8a34){if(_0x1e8a34){_0x41e002=_0x1e8a34;_0x2cc593['model']=_[_0xb35a('0x37')](db[_0xb35a('0x53')][_0xb35a('0x31')]);_0x2cc593[_0xb35a('0x36')]=_[_0xb35a('0x37')](_0x2f3935['query']);_0x2cc593[_0xb35a('0x38')]=_[_0xb35a('0x39')](_0x2cc593[_0xb35a('0x35')],_0x2cc593[_0xb35a('0x36')]);_0x4178d3[_0xb35a('0x3a')]=_[_0xb35a('0x39')](_0x2cc593[_0xb35a('0x35')],qs[_0xb35a('0x3b')](_0x2f3935['query'][_0xb35a('0x3b')]));_0x4178d3[_0xb35a('0x3a')]=_0x4178d3[_0xb35a('0x3a')][_0xb35a('0x3c')]?_0x4178d3[_0xb35a('0x3a')]:_0x2cc593[_0xb35a('0x35')];_0x4178d3[_0xb35a('0x54')]=qs[_0xb35a('0x3f')](_0x2f3935[_0xb35a('0x36')][_0xb35a('0x3f')]);_0x4178d3['where']=qs[_0xb35a('0x38')](_['pick'](_0x2f3935['query'],_0x2cc593[_0xb35a('0x38')]));if(_0x2f3935[_0xb35a('0x36')][_0xb35a('0x41')]){_0x4178d3[_0xb35a('0x40')]=_[_0xb35a('0x42')](_0x4178d3[_0xb35a('0x40')],{'$or':_[_0xb35a('0x2f')](_0x4178d3[_0xb35a('0x3a')],function(_0x24bee7){var _0x44b4de={};_0x44b4de[_0x24bee7]={'$like':'%'+_0x2f3935['query'][_0xb35a('0x41')]+'%'};return _0x44b4de;})});}_0x4178d3=_[_0xb35a('0x42')]({},_0x4178d3,_0x2f3935[_0xb35a('0x49')]);return _0x41e002[_0xb35a('0x51')](_0x4178d3);}})[_0xb35a('0x28')](function(_0xc1571f){if(_0xc1571f){_0x2500c5=_0xc1571f[_0xb35a('0x3c')];if(!_0x2f3935['query'][_0xb35a('0x3d')](_0xb35a('0x3e'))){_0x4178d3[_0xb35a('0x21')]=qs['limit'](_0x2f3935['query'][_0xb35a('0x21')]);_0x4178d3[_0xb35a('0x1f')]=qs['offset'](_0x2f3935[_0xb35a('0x36')]['offset']);}return _0x41e002[_0xb35a('0x51')](_0x4178d3);}})[_0xb35a('0x28')](function(_0xc4af3d){if(_0xc4af3d){return _0xc4af3d?{'count':_0x2500c5,'rows':_0xc4af3d}:null;}})['then'](respondWithResult(_0x2f8bb7,null))['catch'](handleError(_0x2f8bb7,null));};exports[_0xb35a('0x55')]=function(_0x243ee9,_0x5412a6,_0x1b471a){return db[_0xb35a('0x56')][_0xb35a('0x4a')]({'where':{'id':_0x243ee9['params']['id']}})[_0xb35a('0x28')](handleEntityNotFound(_0x5412a6,null))[_0xb35a('0x28')](function(_0x51289f){if(_0x51289f){return _0x51289f['addActions'](_0x243ee9[_0xb35a('0x4d')][_0xb35a('0x4f')],_[_0xb35a('0x50')](_0x243ee9[_0xb35a('0x4d')],[_0xb35a('0x4f'),'id'])||{});}})[_0xb35a('0x28')](respondWithResult(_0x5412a6,null))[_0xb35a('0x4b')](handleError(_0x5412a6,null));};exports['getActions']=function(_0x3881c3,_0x2bff72,_0x4c7cb7){var _0x30bebc={};var _0x20d30a={};var _0x5e01b5;var _0x54777d;return db[_0xb35a('0x30')][_0xb35a('0x52')]({'where':{'id':_0x3881c3[_0xb35a('0x47')]['id']}})[_0xb35a('0x28')](handleEntityNotFound(_0x2bff72,null))[_0xb35a('0x28')](function(_0x5c84b2){if(_0x5c84b2){_0x5e01b5=_0x5c84b2;_0x20d30a['model']=_[_0xb35a('0x37')](db['Action'][_0xb35a('0x31')]);_0x20d30a[_0xb35a('0x36')]=_['keys'](_0x3881c3[_0xb35a('0x36')]);_0x20d30a[_0xb35a('0x38')]=_[_0xb35a('0x39')](_0x20d30a[_0xb35a('0x35')],_0x20d30a[_0xb35a('0x36')]);_0x30bebc[_0xb35a('0x3a')]=_[_0xb35a('0x39')](_0x20d30a[_0xb35a('0x35')],qs[_0xb35a('0x3b')](_0x3881c3[_0xb35a('0x36')][_0xb35a('0x3b')]));_0x30bebc[_0xb35a('0x3a')]=_0x30bebc[_0xb35a('0x3a')][_0xb35a('0x3c')]?_0x30bebc[_0xb35a('0x3a')]:_0x20d30a[_0xb35a('0x35')];_0x30bebc[_0xb35a('0x54')]=qs[_0xb35a('0x3f')](_0x3881c3[_0xb35a('0x36')][_0xb35a('0x3f')]);_0x30bebc[_0xb35a('0x40')]=qs['filters'](_[_0xb35a('0x57')](_0x3881c3[_0xb35a('0x36')],_0x20d30a[_0xb35a('0x38')]));if(_0x3881c3[_0xb35a('0x36')][_0xb35a('0x41')]){_0x30bebc[_0xb35a('0x40')]=_[_0xb35a('0x42')](_0x30bebc[_0xb35a('0x40')],{'$or':_[_0xb35a('0x2f')](_0x30bebc[_0xb35a('0x3a')],function(_0x3abc21){var _0x188527={};_0x188527[_0x3abc21]={'$like':'%'+_0x3881c3[_0xb35a('0x36')][_0xb35a('0x41')]+'%'};return _0x188527;})});}_0x30bebc=_[_0xb35a('0x42')]({},_0x30bebc,_0x3881c3[_0xb35a('0x49')]);return _0x5e01b5[_0xb35a('0x58')](_0x30bebc);}})[_0xb35a('0x28')](function(_0x65ca47){if(_0x65ca47){_0x54777d=_0x65ca47[_0xb35a('0x3c')];if(!_0x3881c3['query']['hasOwnProperty'](_0xb35a('0x3e'))){_0x30bebc[_0xb35a('0x21')]=qs[_0xb35a('0x21')](_0x3881c3[_0xb35a('0x36')][_0xb35a('0x21')]);_0x30bebc[_0xb35a('0x1f')]=qs[_0xb35a('0x1f')](_0x3881c3[_0xb35a('0x36')][_0xb35a('0x1f')]);}return _0x5e01b5['getActions'](_0x30bebc);}})[_0xb35a('0x28')](function(_0x142137){if(_0x142137){return _0x142137?{'count':_0x54777d,'rows':_0x142137}:null;}})['then'](respondWithResult(_0x2bff72,null))['catch'](handleError(_0x2bff72,null));}; \ No newline at end of file +var _0x53af=['body','addConditions','Condition','ids','omit','getConditions','addActions','Action','getActions','findOne','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','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/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','error','name','send','index','map','Automation','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','find','catch','create'];(function(_0x5b7221,_0xcd1f7d){var _0x5b479=function(_0x2c1431){while(--_0x2c1431){_0x5b7221['push'](_0x5b7221['shift']());}};_0x5b479(++_0xcd1f7d);}(_0x53af,0x1f0));var _0xf53a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x53af[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0xf53a('0x0'));var rimraf=require(_0xf53a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf53a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf53a('0x3'));var Mustache=require(_0xf53a('0x4'));var util=require(_0xf53a('0x5'));var path=require('path');var sox=require(_0xf53a('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf53a('0x7'));var squel=require(_0xf53a('0x8'));var crypto=require(_0xf53a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xf53a('0xa'));var toCsv=require(_0xf53a('0xb'));var querystring=require(_0xf53a('0xc'));var Papa=require('papaparse');var Redis=require(_0xf53a('0xd'));var authService=require(_0xf53a('0xe'));var qs=require(_0xf53a('0xf'));var as=require(_0xf53a('0x10'));var hardwareService=require(_0xf53a('0x11'));var logger=require(_0xf53a('0x12'))(_0xf53a('0x13'));var utils=require('../../config/utils');var config=require(_0xf53a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf53a('0x15'))['db'];function respondWithStatusCode(_0x4ff6f5,_0x30ceee){_0x30ceee=_0x30ceee||0xcc;return function(_0x2a5cad){if(_0x2a5cad){return _0x4ff6f5[_0xf53a('0x16')](_0x30ceee);}return _0x4ff6f5[_0xf53a('0x17')](_0x30ceee)[_0xf53a('0x18')]();};}function respondWithResult(_0x196d99,_0x16509d){_0x16509d=_0x16509d||0xc8;return function(_0x5c1d39){if(_0x5c1d39){return _0x196d99[_0xf53a('0x17')](_0x16509d)['json'](_0x5c1d39);}};}function respondWithFilteredResult(_0x32b96f,_0x2bc686){return function(_0x3e8891){if(_0x3e8891){var _0x34eb60=typeof _0x2bc686[_0xf53a('0x19')]==='undefined'&&typeof _0x2bc686[_0xf53a('0x1a')]===_0xf53a('0x1b');var _0x53e4a0=_0x3e8891[_0xf53a('0x1c')];var _0x411e27=_0x34eb60?0x0:_0x2bc686[_0xf53a('0x19')];var _0x97fc81=_0x34eb60?_0x3e8891['count']:_0x2bc686[_0xf53a('0x19')]+_0x2bc686['limit'];var _0x4ea05e;if(_0x97fc81>=_0x53e4a0){_0x97fc81=_0x53e4a0;_0x4ea05e=0xc8;}else{_0x4ea05e=0xce;}_0x32b96f[_0xf53a('0x17')](_0x4ea05e);return _0x32b96f[_0xf53a('0x1d')]('Content-Range',_0x411e27+'-'+_0x97fc81+'/'+_0x53e4a0)[_0xf53a('0x1e')](_0x3e8891);}return null;};}function patchUpdates(_0x31855a){return function(_0x687cb0){try{jsonpatch[_0xf53a('0x1f')](_0x687cb0,_0x31855a,!![]);}catch(_0x3e1967){return BPromise[_0xf53a('0x20')](_0x3e1967);}return _0x687cb0[_0xf53a('0x21')]();};}function saveUpdates(_0x3efd26,_0x4e2857){return function(_0x67252d){if(_0x67252d){return _0x67252d[_0xf53a('0x22')](_0x3efd26)[_0xf53a('0x23')](function(_0x81d012){return _0x81d012;});}return null;};}function removeEntity(_0x36c502,_0x2c4150){return function(_0xffad46){if(_0xffad46){return _0xffad46[_0xf53a('0x24')]()[_0xf53a('0x23')](function(){_0x36c502[_0xf53a('0x17')](0xcc)[_0xf53a('0x18')]();});}};}function handleEntityNotFound(_0x288611,_0x4226f7){return function(_0x33d4b9){if(!_0x33d4b9){_0x288611[_0xf53a('0x16')](0x194);}return _0x33d4b9;};}function handleError(_0x29157f,_0xdd70f7){_0xdd70f7=_0xdd70f7||0x1f4;return function(_0x12b96b){logger[_0xf53a('0x25')](_0x12b96b['stack']);if(_0x12b96b[_0xf53a('0x26')]){delete _0x12b96b[_0xf53a('0x26')];}_0x29157f[_0xf53a('0x17')](_0xdd70f7)[_0xf53a('0x27')](_0x12b96b);};}exports[_0xf53a('0x28')]=function(_0x33b4fe,_0x2da669){var _0x4f248c={},_0x4a7d72={},_0x13ff86={'count':0x0,'rows':[]};var _0x29b2ec=_[_0xf53a('0x29')](db[_0xf53a('0x2a')][_0xf53a('0x2b')],function(_0x3d2ea6){return{'name':_0x3d2ea6['fieldName'],'type':_0x3d2ea6[_0xf53a('0x2c')][_0xf53a('0x2d')]};});_0x4a7d72[_0xf53a('0x2e')]=_[_0xf53a('0x29')](_0x29b2ec,_0xf53a('0x26'));_0x4a7d72[_0xf53a('0x2f')]=_['keys'](_0x33b4fe[_0xf53a('0x2f')]);_0x4a7d72[_0xf53a('0x30')]=_[_0xf53a('0x31')](_0x4a7d72[_0xf53a('0x2e')],_0x4a7d72[_0xf53a('0x2f')]);_0x4f248c[_0xf53a('0x32')]=_['intersection'](_0x4a7d72[_0xf53a('0x2e')],qs[_0xf53a('0x33')](_0x33b4fe['query'][_0xf53a('0x33')]));_0x4f248c[_0xf53a('0x32')]=_0x4f248c[_0xf53a('0x32')][_0xf53a('0x34')]?_0x4f248c['attributes']:_0x4a7d72['model'];if(!_0x33b4fe['query'][_0xf53a('0x35')](_0xf53a('0x36'))){_0x4f248c[_0xf53a('0x1a')]=qs[_0xf53a('0x1a')](_0x33b4fe[_0xf53a('0x2f')][_0xf53a('0x1a')]);_0x4f248c['offset']=qs[_0xf53a('0x19')](_0x33b4fe['query']['offset']);}_0x4f248c[_0xf53a('0x37')]=qs[_0xf53a('0x38')](_0x33b4fe[_0xf53a('0x2f')]['sort']);_0x4f248c[_0xf53a('0x39')]=qs[_0xf53a('0x30')](_['pick'](_0x33b4fe[_0xf53a('0x2f')],_0x4a7d72['filters']),_0x29b2ec);if(_0x33b4fe[_0xf53a('0x2f')][_0xf53a('0x3a')]){_0x4f248c['where']=_[_0xf53a('0x3b')](_0x4f248c[_0xf53a('0x39')],{'$or':_[_0xf53a('0x29')](_0x29b2ec,function(_0x48701a){if(_0x48701a[_0xf53a('0x2c')]!==_0xf53a('0x3c')){var _0x3cd474={};_0x3cd474[_0x48701a[_0xf53a('0x26')]]={'$like':'%'+_0x33b4fe[_0xf53a('0x2f')][_0xf53a('0x3a')]+'%'};return _0x3cd474;}})});}_0x4f248c=_[_0xf53a('0x3b')]({},_0x4f248c,_0x33b4fe[_0xf53a('0x3d')]);var _0x5e82f5={'where':_0x4f248c['where']};return db[_0xf53a('0x2a')][_0xf53a('0x1c')](_0x5e82f5)[_0xf53a('0x23')](function(_0x6583ee){_0x13ff86[_0xf53a('0x1c')]=_0x6583ee;if(_0x33b4fe['query'][_0xf53a('0x3e')]){_0x4f248c[_0xf53a('0x3f')]=[{'all':!![]}];}return db[_0xf53a('0x2a')][_0xf53a('0x40')](_0x4f248c);})[_0xf53a('0x23')](function(_0x1b0f7c){_0x13ff86[_0xf53a('0x41')]=_0x1b0f7c;return _0x13ff86;})['then'](respondWithFilteredResult(_0x2da669,_0x4f248c))['catch'](handleError(_0x2da669,null));};exports['show']=function(_0x421f43,_0x2095d1){var _0x3f04be={'raw':![],'where':{'id':_0x421f43[_0xf53a('0x42')]['id']}},_0x49a3c3={};_0x49a3c3[_0xf53a('0x2e')]=_[_0xf53a('0x43')](db[_0xf53a('0x2a')][_0xf53a('0x2b')]);_0x49a3c3[_0xf53a('0x2f')]=_['keys'](_0x421f43[_0xf53a('0x2f')]);_0x49a3c3[_0xf53a('0x30')]=_[_0xf53a('0x31')](_0x49a3c3[_0xf53a('0x2e')],_0x49a3c3[_0xf53a('0x2f')]);_0x3f04be[_0xf53a('0x32')]=_[_0xf53a('0x31')](_0x49a3c3[_0xf53a('0x2e')],qs[_0xf53a('0x33')](_0x421f43[_0xf53a('0x2f')]['fields']));_0x3f04be[_0xf53a('0x32')]=_0x3f04be['attributes'][_0xf53a('0x34')]?_0x3f04be[_0xf53a('0x32')]:_0x49a3c3[_0xf53a('0x2e')];if(_0x421f43[_0xf53a('0x2f')][_0xf53a('0x3e')]){_0x3f04be[_0xf53a('0x3f')]=[{'all':!![]}];}_0x3f04be=_[_0xf53a('0x3b')]({},_0x3f04be,_0x421f43['options']);return db['Automation'][_0xf53a('0x44')](_0x3f04be)['then'](handleEntityNotFound(_0x2095d1,null))[_0xf53a('0x23')](respondWithResult(_0x2095d1,null))[_0xf53a('0x45')](handleError(_0x2095d1,null));};exports[_0xf53a('0x46')]=function(_0x18f720,_0x35d716){return db[_0xf53a('0x2a')][_0xf53a('0x46')](_0x18f720[_0xf53a('0x47')],{})['then'](respondWithResult(_0x35d716,0xc9))[_0xf53a('0x45')](handleError(_0x35d716,null));};exports[_0xf53a('0x22')]=function(_0x55a214,_0xcfc2cb){if(_0x55a214[_0xf53a('0x47')]['id']){delete _0x55a214['body']['id'];}return db[_0xf53a('0x2a')][_0xf53a('0x44')]({'where':{'id':_0x55a214[_0xf53a('0x42')]['id']}})['then'](handleEntityNotFound(_0xcfc2cb,null))[_0xf53a('0x23')](saveUpdates(_0x55a214[_0xf53a('0x47')],null))[_0xf53a('0x23')](respondWithResult(_0xcfc2cb,null))[_0xf53a('0x45')](handleError(_0xcfc2cb,null));};exports[_0xf53a('0x24')]=function(_0x5bf337,_0x3ea286){return db['Automation'][_0xf53a('0x44')]({'where':{'id':_0x5bf337[_0xf53a('0x42')]['id']}})[_0xf53a('0x23')](handleEntityNotFound(_0x3ea286,null))[_0xf53a('0x23')](removeEntity(_0x3ea286,null))[_0xf53a('0x45')](handleError(_0x3ea286,null));};exports[_0xf53a('0x48')]=function(_0x1774d5,_0x2d1298,_0x70bb63){return db[_0xf53a('0x49')][_0xf53a('0x44')]({'where':{'id':_0x1774d5[_0xf53a('0x42')]['id']}})[_0xf53a('0x23')](handleEntityNotFound(_0x2d1298,null))[_0xf53a('0x23')](function(_0x524291){if(_0x524291){return _0x524291[_0xf53a('0x48')](_0x1774d5[_0xf53a('0x47')][_0xf53a('0x4a')],_[_0xf53a('0x4b')](_0x1774d5[_0xf53a('0x47')],[_0xf53a('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x2d1298,null))[_0xf53a('0x45')](handleError(_0x2d1298,null));};exports[_0xf53a('0x4c')]=function(_0x47ee04,_0x200ab5,_0x3bbcee){var _0x138034={};var _0x38aee8={};var _0x3b1436;var _0xdb87a0;return db[_0xf53a('0x2a')]['findOne']({'where':{'id':_0x47ee04[_0xf53a('0x42')]['id']}})[_0xf53a('0x23')](handleEntityNotFound(_0x200ab5,null))[_0xf53a('0x23')](function(_0x122d82){if(_0x122d82){_0x3b1436=_0x122d82;_0x38aee8['model']=_[_0xf53a('0x43')](db[_0xf53a('0x49')]['rawAttributes']);_0x38aee8[_0xf53a('0x2f')]=_[_0xf53a('0x43')](_0x47ee04[_0xf53a('0x2f')]);_0x38aee8[_0xf53a('0x30')]=_[_0xf53a('0x31')](_0x38aee8[_0xf53a('0x2e')],_0x38aee8[_0xf53a('0x2f')]);_0x138034[_0xf53a('0x32')]=_[_0xf53a('0x31')](_0x38aee8[_0xf53a('0x2e')],qs[_0xf53a('0x33')](_0x47ee04[_0xf53a('0x2f')][_0xf53a('0x33')]));_0x138034['attributes']=_0x138034[_0xf53a('0x32')][_0xf53a('0x34')]?_0x138034[_0xf53a('0x32')]:_0x38aee8[_0xf53a('0x2e')];_0x138034[_0xf53a('0x37')]=qs['sort'](_0x47ee04[_0xf53a('0x2f')]['sort']);_0x138034[_0xf53a('0x39')]=qs[_0xf53a('0x30')](_['pick'](_0x47ee04[_0xf53a('0x2f')],_0x38aee8[_0xf53a('0x30')]));if(_0x47ee04[_0xf53a('0x2f')]['filter']){_0x138034[_0xf53a('0x39')]=_[_0xf53a('0x3b')](_0x138034[_0xf53a('0x39')],{'$or':_[_0xf53a('0x29')](_0x138034[_0xf53a('0x32')],function(_0x1aa3f8){var _0x1fba7c={};_0x1fba7c[_0x1aa3f8]={'$like':'%'+_0x47ee04[_0xf53a('0x2f')]['filter']+'%'};return _0x1fba7c;})});}_0x138034=_[_0xf53a('0x3b')]({},_0x138034,_0x47ee04[_0xf53a('0x3d')]);return _0x3b1436[_0xf53a('0x4c')](_0x138034);}})['then'](function(_0x3ff77d){if(_0x3ff77d){_0xdb87a0=_0x3ff77d[_0xf53a('0x34')];if(!_0x47ee04[_0xf53a('0x2f')]['hasOwnProperty'](_0xf53a('0x36'))){_0x138034[_0xf53a('0x1a')]=qs[_0xf53a('0x1a')](_0x47ee04['query'][_0xf53a('0x1a')]);_0x138034['offset']=qs['offset'](_0x47ee04[_0xf53a('0x2f')][_0xf53a('0x19')]);}return _0x3b1436[_0xf53a('0x4c')](_0x138034);}})[_0xf53a('0x23')](function(_0x137f32){if(_0x137f32){return _0x137f32?{'count':_0xdb87a0,'rows':_0x137f32}:null;}})[_0xf53a('0x23')](respondWithResult(_0x200ab5,null))[_0xf53a('0x45')](handleError(_0x200ab5,null));};exports[_0xf53a('0x4d')]=function(_0x11630c,_0x388f05,_0x3f0d31){return db[_0xf53a('0x4e')][_0xf53a('0x44')]({'where':{'id':_0x11630c[_0xf53a('0x42')]['id']}})[_0xf53a('0x23')](handleEntityNotFound(_0x388f05,null))['then'](function(_0x4777b4){if(_0x4777b4){return _0x4777b4[_0xf53a('0x4d')](_0x11630c[_0xf53a('0x47')][_0xf53a('0x4a')],_[_0xf53a('0x4b')](_0x11630c['body'],[_0xf53a('0x4a'),'id'])||{});}})[_0xf53a('0x23')](respondWithResult(_0x388f05,null))['catch'](handleError(_0x388f05,null));};exports[_0xf53a('0x4f')]=function(_0x220828,_0x533a69,_0x2cd02d){var _0x4e3e73={};var _0xb0e7a9={};var _0x2e9284;var _0x3d9971;return db[_0xf53a('0x2a')][_0xf53a('0x50')]({'where':{'id':_0x220828[_0xf53a('0x42')]['id']}})[_0xf53a('0x23')](handleEntityNotFound(_0x533a69,null))[_0xf53a('0x23')](function(_0x5238f6){if(_0x5238f6){_0x2e9284=_0x5238f6;_0xb0e7a9[_0xf53a('0x2e')]=_['keys'](db[_0xf53a('0x4e')]['rawAttributes']);_0xb0e7a9[_0xf53a('0x2f')]=_[_0xf53a('0x43')](_0x220828[_0xf53a('0x2f')]);_0xb0e7a9[_0xf53a('0x30')]=_[_0xf53a('0x31')](_0xb0e7a9[_0xf53a('0x2e')],_0xb0e7a9[_0xf53a('0x2f')]);_0x4e3e73[_0xf53a('0x32')]=_[_0xf53a('0x31')](_0xb0e7a9['model'],qs[_0xf53a('0x33')](_0x220828[_0xf53a('0x2f')][_0xf53a('0x33')]));_0x4e3e73[_0xf53a('0x32')]=_0x4e3e73[_0xf53a('0x32')][_0xf53a('0x34')]?_0x4e3e73[_0xf53a('0x32')]:_0xb0e7a9[_0xf53a('0x2e')];_0x4e3e73['order']=qs[_0xf53a('0x38')](_0x220828[_0xf53a('0x2f')][_0xf53a('0x38')]);_0x4e3e73[_0xf53a('0x39')]=qs[_0xf53a('0x30')](_['pick'](_0x220828[_0xf53a('0x2f')],_0xb0e7a9[_0xf53a('0x30')]));if(_0x220828[_0xf53a('0x2f')][_0xf53a('0x3a')]){_0x4e3e73[_0xf53a('0x39')]=_[_0xf53a('0x3b')](_0x4e3e73['where'],{'$or':_[_0xf53a('0x29')](_0x4e3e73[_0xf53a('0x32')],function(_0x4d5a8c){var _0x698dd1={};_0x698dd1[_0x4d5a8c]={'$like':'%'+_0x220828[_0xf53a('0x2f')][_0xf53a('0x3a')]+'%'};return _0x698dd1;})});}_0x4e3e73=_[_0xf53a('0x3b')]({},_0x4e3e73,_0x220828[_0xf53a('0x3d')]);return _0x2e9284['getActions'](_0x4e3e73);}})[_0xf53a('0x23')](function(_0x2c8e7b){if(_0x2c8e7b){_0x3d9971=_0x2c8e7b[_0xf53a('0x34')];if(!_0x220828[_0xf53a('0x2f')][_0xf53a('0x35')]('nolimit')){_0x4e3e73[_0xf53a('0x1a')]=qs[_0xf53a('0x1a')](_0x220828[_0xf53a('0x2f')][_0xf53a('0x1a')]);_0x4e3e73['offset']=qs['offset'](_0x220828[_0xf53a('0x2f')][_0xf53a('0x19')]);}return _0x2e9284[_0xf53a('0x4f')](_0x4e3e73);}})[_0xf53a('0x23')](function(_0x9e0940){if(_0x9e0940){return _0x9e0940?{'count':_0x3d9971,'rows':_0x9e0940}:null;}})[_0xf53a('0x23')](respondWithResult(_0x533a69,null))[_0xf53a('0x45')](handleError(_0x533a69,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index dde8ebf..a06d5d0 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 _0xc796=['../../config/logger','bluebird','request-promise','path','rimraf','./automation.attributes','exports','define','Automation','tools_automations','lodash','util'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xc796,0x17e));var _0x6c79=function(_0x219935,_0x5b7d02){_0x219935=_0x219935-0x0;var _0x130409=_0xc796[_0x219935];return _0x130409;};'use strict';var _=require(_0x6c79('0x0'));var util=require(_0x6c79('0x1'));var logger=require(_0x6c79('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6c79('0x3'));var rp=require(_0x6c79('0x4'));var fs=require('fs');var path=require(_0x6c79('0x5'));var rimraf=require(_0x6c79('0x6'));var config=require('../../config/environment');var attributes=require(_0x6c79('0x7'));module[_0x6c79('0x8')]=function(_0x18e549,_0x138192){return _0x18e549[_0x6c79('0x9')](_0x6c79('0xa'),attributes,{'tableName':_0x6c79('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd85c=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','Automation','tools_automations','lodash','util'];(function(_0x387335,_0x1dbb1a){var _0x18bb1c=function(_0x2fdc5a){while(--_0x2fdc5a){_0x387335['push'](_0x387335['shift']());}};_0x18bb1c(++_0x1dbb1a);}(_0xd85c,0xfa));var _0xcd85=function(_0x2969f0,_0x11b411){_0x2969f0=_0x2969f0-0x0;var _0x2ca8c0=_0xd85c[_0x2969f0];return _0x2ca8c0;};'use strict';var _=require(_0xcd85('0x0'));var util=require(_0xcd85('0x1'));var logger=require(_0xcd85('0x2'))('api');var moment=require(_0xcd85('0x3'));var BPromise=require(_0xcd85('0x4'));var rp=require(_0xcd85('0x5'));var fs=require('fs');var path=require(_0xcd85('0x6'));var rimraf=require(_0xcd85('0x7'));var config=require(_0xcd85('0x8'));var attributes=require(_0xcd85('0x9'));module['exports']=function(_0x5057b5,_0x180a61){return _0x5057b5['define'](_0xcd85('0xa'),attributes,{'tableName':_0xcd85('0xb'),'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 f397b5b..b46ca96 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 _0x3f72=['request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s'];(function(_0x33d38c,_0x2ff27b){var _0x537b31=function(_0x152458){while(--_0x152458){_0x33d38c['push'](_0x33d38c['shift']());}};_0x537b31(++_0x2ff27b);}(_0x3f72,0xaf));var _0x23f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f72[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x23f7('0x0'));var util=require(_0x23f7('0x1'));var moment=require(_0x23f7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x23f7('0x3'));var db=require(_0x23f7('0x4'))['db'];var utils=require(_0x23f7('0x5'));var logger=require(_0x23f7('0x6'))(_0x23f7('0x7'));var config=require('../../config/environment');var jayson=require(_0x23f7('0x8'));var client=jayson['client'][_0x23f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cc54a,_0x23e468,_0x2db48b){return new BPromise(function(_0x412d29,_0x258026){return client[_0x23f7('0xa')](_0x5cc54a,_0x2db48b)[_0x23f7('0xb')](function(_0x3a048c){logger[_0x23f7('0xc')](_0x23f7('0xd'),_0x23e468,_0x23f7('0xe'));logger['debug'](_0x23f7('0xf'),_0x23e468,_0x23f7('0xe'),JSON[_0x23f7('0x10')](_0x3a048c));if(_0x3a048c['error']){if(_0x3a048c['error'][_0x23f7('0x11')]===0x1f4){logger[_0x23f7('0x12')](_0x23f7('0xd'),_0x23e468,_0x3a048c[_0x23f7('0x12')][_0x23f7('0x13')]);return _0x258026(_0x3a048c['error'][_0x23f7('0x13')]);}logger[_0x23f7('0x12')](_0x23f7('0xd'),_0x23e468,_0x3a048c[_0x23f7('0x12')]['message']);return _0x412d29(_0x3a048c[_0x23f7('0x12')][_0x23f7('0x13')]);}else{logger[_0x23f7('0xc')](_0x23f7('0xd'),_0x23e468,_0x23f7('0xe'));_0x412d29(_0x3a048c[_0x23f7('0x14')][_0x23f7('0x13')]);}})['catch'](function(_0x2669ab){logger[_0x23f7('0x12')]('Automation,\x20%s,\x20%s',_0x23e468,_0x2669ab);_0x258026(_0x2669ab);});});} \ No newline at end of file +var _0x9512=['rpc','../../config/environment','jayson/promise','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x35e6f5,_0x3c1270){var _0x5a60b0=function(_0x3a52c3){while(--_0x3a52c3){_0x35e6f5['push'](_0x35e6f5['shift']());}};_0x5a60b0(++_0x3c1270);}(_0x9512,0x75));var _0x2951=function(_0x5998c7,_0x514254){_0x5998c7=_0x5998c7-0x0;var _0x321421=_0x9512[_0x5998c7];return _0x321421;};'use strict';var _=require(_0x2951('0x0'));var util=require(_0x2951('0x1'));var moment=require(_0x2951('0x2'));var BPromise=require(_0x2951('0x3'));var rs=require(_0x2951('0x4'));var fs=require('fs');var Redis=require(_0x2951('0x5'));var db=require(_0x2951('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2951('0x7'))(_0x2951('0x8'));var config=require(_0x2951('0x9'));var jayson=require(_0x2951('0xa'));var client=jayson[_0x2951('0xb')][_0x2951('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b50d9,_0x59d947,_0x2c2c11){return new BPromise(function(_0x2c5ad6,_0x3e1a01){return client[_0x2951('0xd')](_0x1b50d9,_0x2c2c11)[_0x2951('0xe')](function(_0x113b97){logger['info'](_0x2951('0xf'),_0x59d947,_0x2951('0x10'));logger[_0x2951('0x11')](_0x2951('0x12'),_0x59d947,'request\x20sent',JSON[_0x2951('0x13')](_0x113b97));if(_0x113b97[_0x2951('0x14')]){if(_0x113b97[_0x2951('0x14')][_0x2951('0x15')]===0x1f4){logger[_0x2951('0x14')]('Automation,\x20%s,\x20%s',_0x59d947,_0x113b97[_0x2951('0x14')][_0x2951('0x16')]);return _0x3e1a01(_0x113b97[_0x2951('0x14')][_0x2951('0x16')]);}logger[_0x2951('0x14')](_0x2951('0xf'),_0x59d947,_0x113b97[_0x2951('0x14')][_0x2951('0x16')]);return _0x2c5ad6(_0x113b97[_0x2951('0x14')][_0x2951('0x16')]);}else{logger[_0x2951('0x17')](_0x2951('0xf'),_0x59d947,_0x2951('0x10'));_0x2c5ad6(_0x113b97['result'][_0x2951('0x16')]);}})[_0x2951('0x18')](function(_0x18e89d){logger[_0x2951('0x14')](_0x2951('0xf'),_0x59d947,_0x18e89d);_0x3e1a01(_0x18e89d);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 66b9b6b..d994f05 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 _0xac52=['/:id','show','/:id/conditions','getConditions','/:id/actions','post','create','addActions','put','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated'];(function(_0x2aa529,_0x1f3c07){var _0x789e1e=function(_0x1c82ab){while(--_0x1c82ab){_0x2aa529['push'](_0x2aa529['shift']());}};_0x789e1e(++_0x1f3c07);}(_0xac52,0x122));var _0x2ac5=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xac52[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require('multer');var util=require(_0x2ac5('0x0'));var path=require(_0x2ac5('0x1'));var timeout=require(_0x2ac5('0x2'));var express=require(_0x2ac5('0x3'));var router=express[_0x2ac5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2ac5('0x5'));var interaction=require(_0x2ac5('0x6'));var config=require('../../config/environment');var controller=require(_0x2ac5('0x7'));router[_0x2ac5('0x8')]('/',auth[_0x2ac5('0x9')](),controller['index']);router['get'](_0x2ac5('0xa'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0xb')]);router[_0x2ac5('0x8')](_0x2ac5('0xc'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0xd')]);router[_0x2ac5('0x8')](_0x2ac5('0xe'),auth[_0x2ac5('0x9')](),controller['getActions']);router[_0x2ac5('0xf')]('/',auth[_0x2ac5('0x9')](),controller[_0x2ac5('0x10')]);router[_0x2ac5('0xf')]('/:id/conditions',auth['isAuthenticated'](),controller['addConditions']);router[_0x2ac5('0xf')](_0x2ac5('0xe'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0x11')]);router[_0x2ac5('0x12')]('/:id',auth[_0x2ac5('0x9')](),controller['update']);router[_0x2ac5('0x13')](_0x2ac5('0xa'),auth[_0x2ac5('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x25b4=['index','get','/:id','getConditions','/:id/actions','create','post','addConditions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x25b4,0x1ab));var _0x425b=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x25b4[_0x20c9b2];return _0x2c6030;};'use strict';var multer=require(_0x425b('0x0'));var util=require('util');var path=require(_0x425b('0x1'));var timeout=require(_0x425b('0x2'));var express=require(_0x425b('0x3'));var router=express[_0x425b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x425b('0x5'));var interaction=require(_0x425b('0x6'));var config=require(_0x425b('0x7'));var controller=require(_0x425b('0x8'));router['get']('/',auth[_0x425b('0x9')](),controller[_0x425b('0xa')]);router[_0x425b('0xb')](_0x425b('0xc'),auth[_0x425b('0x9')](),controller['show']);router[_0x425b('0xb')]('/:id/conditions',auth[_0x425b('0x9')](),controller[_0x425b('0xd')]);router[_0x425b('0xb')](_0x425b('0xe'),auth[_0x425b('0x9')](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x425b('0xf')]);router[_0x425b('0x10')]('/:id/conditions',auth[_0x425b('0x9')](),controller[_0x425b('0x11')]);router['post'](_0x425b('0xe'),auth[_0x425b('0x9')](),controller['addActions']);router[_0x425b('0x12')]('/:id',auth[_0x425b('0x9')](),controller[_0x425b('0x13')]);router[_0x425b('0x14')](_0x425b('0xc'),auth[_0x425b('0x9')](),controller[_0x425b('0x15')]);module[_0x425b('0x16')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 0ee7899..5f8b65b 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 _0x5b25=['#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','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)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x1eafb2,_0x3f3b67){var _0x4280e2=function(_0xb4d2db){while(--_0xb4d2db){_0x1eafb2['push'](_0x1eafb2['shift']());}};_0x4280e2(++_0x3f3b67);}(_0x5b25,0xc9));var _0x55b2=function(_0x35d2ec,_0x30848c){_0x35d2ec=_0x35d2ec-0x0;var _0x1ca87d=_0x5b25[_0x35d2ec];return _0x1ca87d;};'use strict';var Sequelize=require(_0x55b2('0x0'));module['exports']={'name':{'type':Sequelize[_0x55b2('0x1')],'unique':_0x55b2('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x55b2('0x3')](_0x55b2('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x55b2('0x1')]},'active':{'type':Sequelize[_0x55b2('0x5')],'defaultValue':0x0,'comment':_0x55b2('0x6')},'limitCalls':{'type':Sequelize[_0x55b2('0x7')](0x4)[_0x55b2('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x55b2('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x55b2('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x55b2('0x7')](0x3)[_0x55b2('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55b2('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55b2('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x55b2('0x7')](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x55b2('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)[_0x55b2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x55b2('0x7')](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x55b2('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)[_0x55b2('0x8')],'defaultValue':0x3,'comment':_0x55b2('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x55b2('0x7')](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x55b2('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x55b2('0xf')},'dialTimezone':{'type':Sequelize[_0x55b2('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x55b2('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x55b2('0x10'),_0x55b2('0x11')),'defaultValue':_0x55b2('0x12')},'dialAMDActive':{'type':Sequelize[_0x55b2('0x5')],'defaultValue':0x0,'comment':_0x55b2('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x55b2('0x7')](0x9)[_0x55b2('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x55b2('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x55b2('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x55b2('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x55b2('0x7')](0x9)[_0x55b2('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x55b2('0x7')](0x9)[_0x55b2('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x55b2('0x16')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x55b2('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x55b2('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x55b2('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x55b2('0x7')](0x9)[_0x55b2('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x55b2('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x55b2('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x55b2('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x55b2('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x55b2('0x1b'),_0x55b2('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x55b2('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x55b2('0x7')](0x3)[_0x55b2('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x55b2('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x55b2('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55b2('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x55b2('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55b2('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0x55b2('0x7')](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x55b2('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)[_0x55b2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55b2('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x55b2('0x7')](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55b2('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x55b2('0x7')](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55b2('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x55b2('0x7')](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x55b2('0x26')}}; \ No newline at end of file +var _0xbaf4=['#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)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','ivr','STRING','BOOLEAN','INTEGER','Max\x20200\x20calls.','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x447125,_0x140166){var _0x5e21ff=function(_0x3ecfaa){while(--_0x3ecfaa){_0x447125['push'](_0x447125['shift']());}};_0x5e21ff(++_0x140166);}(_0xbaf4,0x13f));var _0x4baf=function(_0x363a62,_0x423698){_0x363a62=_0x363a62-0x0;var _0xadc72=_0xbaf4[_0x363a62];return _0xadc72;};'use strict';var Sequelize=require(_0x4baf('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0x4baf('0x1')},'description':{'type':Sequelize[_0x4baf('0x2')]},'active':{'type':Sequelize[_0x4baf('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x4baf('0x4')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x4baf('0x5')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4baf('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x4baf('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x4baf('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4baf('0x7')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4baf('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4baf('0x8')},'dialBusyRetryFrequency':{'type':Sequelize[_0x4baf('0x4')](0x5)[_0x4baf('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4baf('0x9')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4baf('0x4')](0x5)[_0x4baf('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4baf('0xa')},'dialGlobalMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x4baf('0xb')},'dialCheckDuplicateType':{'type':Sequelize[_0x4baf('0xc')](_0x4baf('0xd'),_0x4baf('0xe'),_0x4baf('0xf')),'defaultValue':_0x4baf('0xd')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x4baf('0x4')](0x9)[_0x4baf('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4baf('0x10')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x4baf('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4baf('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4baf('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x4baf('0x4')](0x9)[_0x4baf('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x4baf('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x4baf('0x4')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x4baf('0x13')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4baf('0x4')](0x9)[_0x4baf('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x4baf('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x4baf('0x4')](0x5)[_0x4baf('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4baf('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x4baf('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4baf('0x16')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x4baf('0x17')),'defaultValue':_0x4baf('0x18')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4baf('0x19')},'dialCutDigit':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4baf('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4baf('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4baf('0x4')](0x5)[_0x4baf('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4baf('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x4baf('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4baf('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4baf('0x4')](0x5)[_0x4baf('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4baf('0x1e')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4baf('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0x4baf('0x4')](0x5)[_0x4baf('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x4baf('0x4')](0x3)[_0x4baf('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4baf('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4baf('0x21')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 84f9c95..b184cfd 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 _0x3306=['send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','includeAll','include','Campaign','findAll','rows','catch','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','options','omit','updatedAt','body','getHoppers','findOne','CmHopper','CampaignId','filter','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','createdAt','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','select','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','insert','cm_contacts','cm_hopper_additional_phones','cmHopperId','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','name'];(function(_0x44c983,_0x3ae50b){var _0x151cfe=function(_0x12c635){while(--_0x12c635){_0x44c983['push'](_0x44c983['shift']());}};_0x151cfe(++_0x3ae50b);}(_0x3306,0x107));var _0x6330=function(_0x510700,_0x173958){_0x510700=_0x510700-0x0;var _0x1e0ccb=_0x3306[_0x510700];return _0x1e0ccb;};'use strict';var emlformat=require(_0x6330('0x0'));var rimraf=require(_0x6330('0x1'));var zipdir=require(_0x6330('0x2'));var jsonpatch=require(_0x6330('0x3'));var rp=require('request-promise');var moment=require(_0x6330('0x4'));var BPromise=require(_0x6330('0x5'));var Mustache=require(_0x6330('0x6'));var util=require(_0x6330('0x7'));var path=require(_0x6330('0x8'));var sox=require('sox');var csv=require(_0x6330('0x9'));var ejs=require(_0x6330('0xa'));var fs=require('fs');var fs_extra=require(_0x6330('0xb'));var _=require(_0x6330('0xc'));var squel=require(_0x6330('0xd'));var crypto=require(_0x6330('0xe'));var jsforce=require(_0x6330('0xf'));var deskjs=require(_0x6330('0x10'));var toCsv=require(_0x6330('0x9'));var querystring=require(_0x6330('0x11'));var Papa=require('papaparse');var Redis=require(_0x6330('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6330('0x13'));var as=require(_0x6330('0x14'));var hardwareService=require(_0x6330('0x15'));var logger=require(_0x6330('0x16'))(_0x6330('0x17'));var utils=require(_0x6330('0x18'));var config=require(_0x6330('0x19'));var licenseUtil=require(_0x6330('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a7e6c,_0x1d4767){_0x1d4767=_0x1d4767||0xcc;return function(_0x27ff9a){if(_0x27ff9a){return _0x5a7e6c[_0x6330('0x1b')](_0x1d4767);}return _0x5a7e6c[_0x6330('0x1c')](_0x1d4767)[_0x6330('0x1d')]();};}function respondWithResult(_0x4b4cce,_0x15fa68){_0x15fa68=_0x15fa68||0xc8;return function(_0x38367a){if(_0x38367a){return _0x4b4cce[_0x6330('0x1c')](_0x15fa68)[_0x6330('0x1e')](_0x38367a);}};}function respondWithFilteredResult(_0x5140e3,_0x4c6860){return function(_0x32b59f){if(_0x32b59f){var _0x476774=typeof _0x4c6860[_0x6330('0x1f')]==='undefined'&&typeof _0x4c6860[_0x6330('0x20')]===_0x6330('0x21');var _0x5a643e=_0x32b59f['count'];var _0x348b34=_0x476774?0x0:_0x4c6860[_0x6330('0x1f')];var _0x3ba601=_0x476774?_0x32b59f[_0x6330('0x22')]:_0x4c6860[_0x6330('0x1f')]+_0x4c6860[_0x6330('0x20')];var _0xfbafd6;if(_0x3ba601>=_0x5a643e){_0x3ba601=_0x5a643e;_0xfbafd6=0xc8;}else{_0xfbafd6=0xce;}_0x5140e3[_0x6330('0x1c')](_0xfbafd6);return _0x5140e3[_0x6330('0x23')](_0x6330('0x24'),_0x348b34+'-'+_0x3ba601+'/'+_0x5a643e)['json'](_0x32b59f);}return null;};}function patchUpdates(_0x1fdc20){return function(_0x206757){try{jsonpatch[_0x6330('0x25')](_0x206757,_0x1fdc20,!![]);}catch(_0x3c8ce5){return BPromise[_0x6330('0x26')](_0x3c8ce5);}return _0x206757['save']();};}function saveUpdates(_0x414fd6,_0x415840){return function(_0x282809){if(_0x282809){return _0x282809[_0x6330('0x27')](_0x414fd6)[_0x6330('0x28')](function(_0x186b91){return _0x186b91;});}return null;};}function removeEntity(_0x50af90,_0x54cbeb){return function(_0x59144c){if(_0x59144c){return _0x59144c[_0x6330('0x29')]()[_0x6330('0x28')](function(){var _0x24702b=_0x59144c[_0x6330('0x2a')]({'plain':!![]});var _0x5899f8=_0x6330('0x2b');return db[_0x6330('0x2c')][_0x6330('0x29')]({'where':{'type':_0x5899f8,'resourceId':_0x24702b['id']}})[_0x6330('0x28')](function(){return _0x59144c;});})[_0x6330('0x28')](function(){_0x50af90['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x255861,_0xfe629c){return function(_0x1aba87){if(!_0x1aba87){_0x255861['sendStatus'](0x194);}return _0x1aba87;};}function handleError(_0x206262,_0x1cb436){_0x1cb436=_0x1cb436||0x1f4;return function(_0x325037){logger[_0x6330('0x2d')](_0x325037['stack']);if(_0x325037[_0x6330('0x2e')]){delete _0x325037['name'];}_0x206262[_0x6330('0x1c')](_0x1cb436)[_0x6330('0x2f')](_0x325037);};}exports[_0x6330('0x30')]=function(_0x3e8efc,_0x4d41c5){var _0x102315={},_0x26a76e={},_0x547f35={'count':0x0,'rows':[]};var _0x3dca32=_[_0x6330('0x31')](db['Campaign'][_0x6330('0x32')],function(_0x47ce15){return{'name':_0x47ce15[_0x6330('0x33')],'type':_0x47ce15['type'][_0x6330('0x34')]};});_0x26a76e['model']=_['map'](_0x3dca32,_0x6330('0x2e'));_0x26a76e[_0x6330('0x35')]=_[_0x6330('0x36')](_0x3e8efc[_0x6330('0x35')]);_0x26a76e[_0x6330('0x37')]=_[_0x6330('0x38')](_0x26a76e[_0x6330('0x39')],_0x26a76e[_0x6330('0x35')]);_0x102315[_0x6330('0x3a')]=_[_0x6330('0x38')](_0x26a76e[_0x6330('0x39')],qs[_0x6330('0x3b')](_0x3e8efc['query'][_0x6330('0x3b')]));_0x102315['attributes']=_0x102315[_0x6330('0x3a')][_0x6330('0x3c')]?_0x102315[_0x6330('0x3a')]:_0x26a76e[_0x6330('0x39')];if(!_0x3e8efc[_0x6330('0x35')][_0x6330('0x3d')](_0x6330('0x3e'))){_0x102315[_0x6330('0x20')]=qs[_0x6330('0x20')](_0x3e8efc[_0x6330('0x35')]['limit']);_0x102315[_0x6330('0x1f')]=qs[_0x6330('0x1f')](_0x3e8efc['query']['offset']);}_0x102315[_0x6330('0x3f')]=qs['sort'](_0x3e8efc[_0x6330('0x35')][_0x6330('0x40')]);_0x102315[_0x6330('0x41')]=qs[_0x6330('0x37')](_[_0x6330('0x42')](_0x3e8efc[_0x6330('0x35')],_0x26a76e[_0x6330('0x37')]),_0x3dca32);if(_0x3e8efc[_0x6330('0x35')]['filter']){_0x102315[_0x6330('0x41')]=_[_0x6330('0x43')](_0x102315[_0x6330('0x41')],{'$or':_['map'](_0x3dca32,function(_0x4ea175){if(_0x4ea175[_0x6330('0x44')]!==_0x6330('0x45')){var _0x3d5440={};_0x3d5440[_0x4ea175['name']]={'$like':'%'+_0x3e8efc['query']['filter']+'%'};return _0x3d5440;}})});}_0x102315=_['merge']({},_0x102315,_0x3e8efc['options']);var _0x1e7964={'where':_0x102315['where']};return db['Campaign'][_0x6330('0x22')](_0x1e7964)[_0x6330('0x28')](function(_0x46f26c){_0x547f35[_0x6330('0x22')]=_0x46f26c;if(_0x3e8efc[_0x6330('0x35')][_0x6330('0x46')]){_0x102315[_0x6330('0x47')]=[{'all':!![]}];}return db[_0x6330('0x48')][_0x6330('0x49')](_0x102315);})[_0x6330('0x28')](function(_0x531c8a){_0x547f35[_0x6330('0x4a')]=_0x531c8a;return _0x547f35;})[_0x6330('0x28')](respondWithFilteredResult(_0x4d41c5,_0x102315))[_0x6330('0x4b')](handleError(_0x4d41c5,null));};exports[_0x6330('0x4c')]=function(_0x3b1fd3,_0x5d9cc9){var _0x2dd36a={'raw':![],'where':{'id':_0x3b1fd3['params']['id']}},_0x10811e={};_0x10811e[_0x6330('0x39')]=_[_0x6330('0x36')](db[_0x6330('0x48')]['rawAttributes']);_0x10811e[_0x6330('0x35')]=_[_0x6330('0x36')](_0x3b1fd3[_0x6330('0x35')]);_0x10811e[_0x6330('0x37')]=_[_0x6330('0x38')](_0x10811e['model'],_0x10811e[_0x6330('0x35')]);_0x2dd36a[_0x6330('0x3a')]=_[_0x6330('0x38')](_0x10811e[_0x6330('0x39')],qs[_0x6330('0x3b')](_0x3b1fd3[_0x6330('0x35')][_0x6330('0x3b')]));_0x2dd36a['attributes']=_0x2dd36a[_0x6330('0x3a')][_0x6330('0x3c')]?_0x2dd36a['attributes']:_0x10811e['model'];if(_0x3b1fd3['query'][_0x6330('0x46')]){_0x2dd36a['include']=[{'all':!![]}];}_0x2dd36a=_[_0x6330('0x43')]({},_0x2dd36a,_0x3b1fd3['options']);return db['Campaign'][_0x6330('0x4d')](_0x2dd36a)[_0x6330('0x28')](handleEntityNotFound(_0x5d9cc9,null))[_0x6330('0x28')](respondWithResult(_0x5d9cc9,null))[_0x6330('0x4b')](handleError(_0x5d9cc9,null));};exports['create']=function(_0x1f77e3,_0x66f6a2){return db['Campaign'][_0x6330('0x4e')](_0x1f77e3['body'],{})[_0x6330('0x28')](function(_0x2ffb53){var _0x42fbed=_0x1f77e3[_0x6330('0x4f')][_0x6330('0x2a')]({'plain':!![]});if(!_0x42fbed)throw new Error(_0x6330('0x50'));if(_0x42fbed[_0x6330('0x51')]==='user'){var _0x156b49=_0x2ffb53[_0x6330('0x2a')]({'plain':!![]});var _0x4101ea='IvrCampaigns';return db[_0x6330('0x52')]['find']({'where':{'name':_0x4101ea,'userProfileId':_0x42fbed[_0x6330('0x53')]},'raw':!![]})['then'](function(_0x2328f8){if(_0x2328f8&&_0x2328f8[_0x6330('0x54')]===0x0){return db[_0x6330('0x2c')][_0x6330('0x4e')]({'name':_0x156b49[_0x6330('0x2e')],'resourceId':_0x156b49['id'],'type':_0x2328f8['name'],'sectionId':_0x2328f8['id']},{})[_0x6330('0x28')](function(){return _0x2ffb53;});}else{return _0x2ffb53;}})[_0x6330('0x4b')](function(_0x1c6fda){logger[_0x6330('0x2d')](_0x6330('0x55'),_0x1c6fda);throw _0x1c6fda;});}return _0x2ffb53;})[_0x6330('0x28')](respondWithResult(_0x66f6a2,0xc9))['catch'](handleError(_0x66f6a2,null));};exports[_0x6330('0x56')]=function(_0x25a720,_0x14524a){var _0x1957ce={'where':{'id':_0x25a720[_0x6330('0x57')]['id']}},_0x445c4f={};_0x445c4f['model']=_[_0x6330('0x36')](db[_0x6330('0x48')][_0x6330('0x32')]);_0x1957ce[_0x6330('0x3a')]=_['intersection'](_0x445c4f[_0x6330('0x39')],qs['fields'](_0x25a720[_0x6330('0x35')][_0x6330('0x3b')]));_0x1957ce[_0x6330('0x3a')]=_0x1957ce['attributes'][_0x6330('0x3c')]?_0x1957ce[_0x6330('0x3a')]:_0x445c4f[_0x6330('0x39')];if(_0x25a720[_0x6330('0x35')][_0x6330('0x46')]){_0x1957ce[_0x6330('0x47')]=[{'all':!![]}];}_0x1957ce=_['merge']({},_0x1957ce,_0x25a720[_0x6330('0x58')]);return db['Campaign']['find'](_0x1957ce)[_0x6330('0x28')](handleEntityNotFound(_0x14524a,null))[_0x6330('0x28')](function(_0x1ae62f){if(_0x1ae62f){var _0x10c4ab=_0x1ae62f['get']({'plain':!![]});_0x10c4ab=qs[_0x6330('0x59')](_0x10c4ab,['id','createdAt',_0x6330('0x5a')]);_0x25a720[_0x6330('0x5b')]=_[_0x6330('0x59')](_0x25a720[_0x6330('0x5b')],['id','createdAt',_0x6330('0x5a')]);return db['Campaign'][_0x6330('0x4e')](_[_0x6330('0x43')](_0x10c4ab,_0x25a720[_0x6330('0x5b')]),{'include':_0x25a720[_0x6330('0x35')][_0x6330('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x527fdd){var _0x84fa67=_0x25a720['user'][_0x6330('0x2a')]({'plain':!![]});if(!_0x84fa67)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x84fa67[_0x6330('0x51')]===_0x6330('0x4f')){var _0x260006=_0x527fdd[_0x6330('0x2a')]({'plain':!![]});var _0x47a841=_0x6330('0x2b');return db[_0x6330('0x52')][_0x6330('0x4d')]({'where':{'name':_0x47a841,'userProfileId':_0x84fa67[_0x6330('0x53')]},'raw':!![]})[_0x6330('0x28')](function(_0x5c57e7){if(_0x5c57e7&&_0x5c57e7[_0x6330('0x54')]===0x0){return db[_0x6330('0x2c')][_0x6330('0x4e')]({'name':_0x260006[_0x6330('0x2e')],'resourceId':_0x260006['id'],'type':_0x5c57e7[_0x6330('0x2e')],'sectionId':_0x5c57e7['id']},{})[_0x6330('0x28')](function(){return _0x527fdd;});}else{return _0x527fdd;}})[_0x6330('0x4b')](function(_0x44a035){logger['error'](_0x6330('0x55'),_0x44a035);throw _0x44a035;});}return _0x527fdd;});}})[_0x6330('0x28')](respondWithResult(_0x14524a,0xc9))['catch'](handleError(_0x14524a,null));};exports[_0x6330('0x27')]=function(_0x476790,_0x20758e){if(_0x476790['body']['id']){delete _0x476790[_0x6330('0x5b')]['id'];}return db[_0x6330('0x48')][_0x6330('0x4d')]({'where':{'id':_0x476790['params']['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x20758e,null))['then'](saveUpdates(_0x476790[_0x6330('0x5b')],null))[_0x6330('0x28')](respondWithResult(_0x20758e,null))[_0x6330('0x4b')](handleError(_0x20758e,null));};exports[_0x6330('0x29')]=function(_0x3aee33,_0x4f1144){return db['Campaign'][_0x6330('0x4d')]({'where':{'id':_0x3aee33[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x4f1144,null))[_0x6330('0x28')](removeEntity(_0x4f1144,null))[_0x6330('0x4b')](handleError(_0x4f1144,null));};exports[_0x6330('0x5c')]=function(_0xd154cb,_0x5a5c7f,_0x4f1c4d){var _0x3d8b99={'raw':!![],'where':{}};var _0x12c59a={};var _0x261f62={'count':0x0,'rows':[]};return db[_0x6330('0x48')][_0x6330('0x5d')]({'where':{'id':_0xd154cb[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x5a5c7f,null))[_0x6330('0x28')](function(_0x2283c5){if(_0x2283c5){_0x12c59a['model']=_[_0x6330('0x36')](db[_0x6330('0x5e')]['rawAttributes']);_0x12c59a[_0x6330('0x35')]=_[_0x6330('0x36')](_0xd154cb[_0x6330('0x35')]);_0x12c59a[_0x6330('0x37')]=_[_0x6330('0x38')](_0x12c59a['model'],_0x12c59a['query']);_0x3d8b99['attributes']=_[_0x6330('0x38')](_0x12c59a[_0x6330('0x39')],qs[_0x6330('0x3b')](_0xd154cb[_0x6330('0x35')]['fields']));_0x3d8b99[_0x6330('0x3a')]=_0x3d8b99[_0x6330('0x3a')]['length']?_0x3d8b99[_0x6330('0x3a')]:_0x12c59a[_0x6330('0x39')];if(!_0xd154cb[_0x6330('0x35')][_0x6330('0x3d')]('nolimit')){_0x3d8b99[_0x6330('0x20')]=qs[_0x6330('0x20')](_0xd154cb['query'][_0x6330('0x20')]);_0x3d8b99[_0x6330('0x1f')]=qs[_0x6330('0x1f')](_0xd154cb[_0x6330('0x35')][_0x6330('0x1f')]);}_0x3d8b99['order']=qs[_0x6330('0x40')](_0xd154cb[_0x6330('0x35')][_0x6330('0x40')]);_0x3d8b99[_0x6330('0x41')]=qs[_0x6330('0x37')](_['pick'](_0xd154cb[_0x6330('0x35')],_0x12c59a[_0x6330('0x37')]));_0x3d8b99[_0x6330('0x41')][_0x6330('0x5f')]=_0x2283c5['id'];if(_0xd154cb['query'][_0x6330('0x60')]){_0x3d8b99[_0x6330('0x41')]=_[_0x6330('0x43')](_0x3d8b99[_0x6330('0x41')],{'$or':_[_0x6330('0x31')](_0x3d8b99[_0x6330('0x3a')],function(_0x53b1f2){var _0x53f521={};_0x53f521[_0x53b1f2]={'$like':'%'+_0xd154cb[_0x6330('0x35')][_0x6330('0x60')]+'%'};return _0x53f521;})});}_0x3d8b99=_[_0x6330('0x43')]({},_0x3d8b99,_0xd154cb[_0x6330('0x58')]);return db[_0x6330('0x5e')][_0x6330('0x22')]({'where':_0x3d8b99['where']})['then'](function(_0x152dcd){_0x261f62[_0x6330('0x22')]=_0x152dcd;if(_0xd154cb[_0x6330('0x35')][_0x6330('0x46')]){_0x3d8b99['include']=[{'all':!![]}];}return db[_0x6330('0x5e')][_0x6330('0x49')](_0x3d8b99);})[_0x6330('0x28')](function(_0x5efaa6){_0x261f62[_0x6330('0x4a')]=_0x5efaa6;return _0x261f62;});}})[_0x6330('0x28')](respondWithFilteredResult(_0x5a5c7f,_0x3d8b99))[_0x6330('0x4b')](handleError(_0x5a5c7f,null));};exports[_0x6330('0x61')]=function(_0x495868,_0x3c764b,_0x8ea670){var _0x1a61b4={'raw':!![],'where':{}};var _0x1f5020={};var _0x10c0da={'count':0x0,'rows':[]};return db['Campaign'][_0x6330('0x5d')]({'where':{'id':_0x495868['params']['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x3c764b,null))['then'](function(_0x22cc13){if(_0x22cc13){_0x1f5020[_0x6330('0x39')]=_[_0x6330('0x36')](db['CmHopperHistory'][_0x6330('0x32')]);_0x1f5020[_0x6330('0x35')]=_[_0x6330('0x36')](_0x495868[_0x6330('0x35')]);_0x1f5020['filters']=_[_0x6330('0x38')](_0x1f5020[_0x6330('0x39')],_0x1f5020['query']);_0x1a61b4[_0x6330('0x3a')]=_[_0x6330('0x38')](_0x1f5020['model'],qs[_0x6330('0x3b')](_0x495868[_0x6330('0x35')][_0x6330('0x3b')]));_0x1a61b4[_0x6330('0x3a')]=_0x1a61b4[_0x6330('0x3a')][_0x6330('0x3c')]?_0x1a61b4[_0x6330('0x3a')]:_0x1f5020[_0x6330('0x39')];if(!_0x495868['query'][_0x6330('0x3d')](_0x6330('0x3e'))){_0x1a61b4[_0x6330('0x20')]=qs[_0x6330('0x20')](_0x495868[_0x6330('0x35')][_0x6330('0x20')]);_0x1a61b4[_0x6330('0x1f')]=qs[_0x6330('0x1f')](_0x495868[_0x6330('0x35')]['offset']);}_0x1a61b4[_0x6330('0x3f')]=qs['sort'](_0x495868[_0x6330('0x35')][_0x6330('0x40')]);_0x1a61b4[_0x6330('0x41')]=qs[_0x6330('0x37')](_[_0x6330('0x42')](_0x495868['query'],_0x1f5020['filters']));_0x1a61b4[_0x6330('0x41')][_0x6330('0x5f')]=_0x22cc13['id'];if(_0x495868[_0x6330('0x35')]['filter']){_0x1a61b4[_0x6330('0x41')]=_['merge'](_0x1a61b4[_0x6330('0x41')],{'$or':_['map'](_0x1a61b4[_0x6330('0x3a')],function(_0x16332f){var _0x1583c0={};_0x1583c0[_0x16332f]={'$like':'%'+_0x495868[_0x6330('0x35')][_0x6330('0x60')]+'%'};return _0x1583c0;})});}_0x1a61b4=_[_0x6330('0x43')]({},_0x1a61b4,_0x495868['options']);return db[_0x6330('0x62')][_0x6330('0x22')]({'where':_0x1a61b4[_0x6330('0x41')]})[_0x6330('0x28')](function(_0x5d57fd){_0x10c0da['count']=_0x5d57fd;if(_0x495868[_0x6330('0x35')][_0x6330('0x46')]){_0x1a61b4[_0x6330('0x47')]=[{'all':!![]}];}return db[_0x6330('0x62')][_0x6330('0x49')](_0x1a61b4);})['then'](function(_0x527d33){_0x10c0da[_0x6330('0x4a')]=_0x527d33;return _0x10c0da;});}})[_0x6330('0x28')](respondWithFilteredResult(_0x3c764b,_0x1a61b4))['catch'](handleError(_0x3c764b,null));};exports[_0x6330('0x63')]=function(_0x31ffc4,_0x370d75,_0x55e47e){var _0x48913d={'raw':!![],'where':{}};var _0x43e3c1={};var _0x2c464b={'count':0x0,'rows':[]};return db[_0x6330('0x48')][_0x6330('0x5d')]({'where':{'id':_0x31ffc4[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x370d75,null))[_0x6330('0x28')](function(_0xfc5f06){if(_0xfc5f06){_0x43e3c1['model']=_[_0x6330('0x36')](db[_0x6330('0x64')][_0x6330('0x32')]);_0x43e3c1[_0x6330('0x35')]=_[_0x6330('0x36')](_0x31ffc4[_0x6330('0x35')]);_0x43e3c1[_0x6330('0x37')]=_['intersection'](_0x43e3c1[_0x6330('0x39')],_0x43e3c1[_0x6330('0x35')]);_0x48913d[_0x6330('0x3a')]=_[_0x6330('0x38')](_0x43e3c1[_0x6330('0x39')],qs['fields'](_0x31ffc4[_0x6330('0x35')][_0x6330('0x3b')]));_0x48913d['attributes']=_0x48913d[_0x6330('0x3a')][_0x6330('0x3c')]?_0x48913d[_0x6330('0x3a')]:_0x43e3c1[_0x6330('0x39')];if(!_0x31ffc4[_0x6330('0x35')][_0x6330('0x3d')](_0x6330('0x3e'))){_0x48913d[_0x6330('0x20')]=qs[_0x6330('0x20')](_0x31ffc4[_0x6330('0x35')][_0x6330('0x20')]);_0x48913d['offset']=qs['offset'](_0x31ffc4[_0x6330('0x35')]['offset']);}_0x48913d['order']=qs[_0x6330('0x40')](_0x31ffc4[_0x6330('0x35')]['sort']);_0x48913d[_0x6330('0x41')]=qs[_0x6330('0x37')](_['pick'](_0x31ffc4[_0x6330('0x35')],_0x43e3c1[_0x6330('0x37')]));_0x48913d[_0x6330('0x41')][_0x6330('0x5f')]=_0xfc5f06['id'];if(_0x31ffc4[_0x6330('0x35')][_0x6330('0x60')]){_0x48913d[_0x6330('0x41')]=_[_0x6330('0x43')](_0x48913d[_0x6330('0x41')],{'$or':_[_0x6330('0x31')](_0x48913d[_0x6330('0x3a')],function(_0x375c00){var _0x12eabf={};_0x12eabf[_0x375c00]={'$like':'%'+_0x31ffc4[_0x6330('0x35')][_0x6330('0x60')]+'%'};return _0x12eabf;})});}_0x48913d=_[_0x6330('0x43')]({},_0x48913d,_0x31ffc4['options']);return db[_0x6330('0x64')][_0x6330('0x22')]({'where':_0x48913d[_0x6330('0x41')]})[_0x6330('0x28')](function(_0x46e243){_0x2c464b[_0x6330('0x22')]=_0x46e243;if(_0x31ffc4[_0x6330('0x35')][_0x6330('0x46')]){_0x48913d[_0x6330('0x47')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x48913d);})[_0x6330('0x28')](function(_0x30ff61){_0x2c464b[_0x6330('0x4a')]=_0x30ff61;return _0x2c464b;});}})[_0x6330('0x28')](respondWithFilteredResult(_0x370d75,_0x48913d))[_0x6330('0x4b')](handleError(_0x370d75,null));};exports['getHopperBlacks']=function(_0x521794,_0xe7c69,_0x13e411){var _0x1f889e={'raw':!![],'where':{}};var _0x33e514={};var _0x52ffde={'count':0x0,'rows':[]};return db[_0x6330('0x48')][_0x6330('0x5d')]({'where':{'id':_0x521794[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0xe7c69,null))[_0x6330('0x28')](function(_0x19a100){if(_0x19a100){_0x33e514[_0x6330('0x39')]=_['keys'](db[_0x6330('0x65')][_0x6330('0x32')]);_0x33e514[_0x6330('0x35')]=_['keys'](_0x521794['query']);_0x33e514[_0x6330('0x37')]=_[_0x6330('0x38')](_0x33e514[_0x6330('0x39')],_0x33e514[_0x6330('0x35')]);_0x1f889e[_0x6330('0x3a')]=_['intersection'](_0x33e514[_0x6330('0x39')],qs[_0x6330('0x3b')](_0x521794[_0x6330('0x35')][_0x6330('0x3b')]));_0x1f889e[_0x6330('0x3a')]=_0x1f889e['attributes'][_0x6330('0x3c')]?_0x1f889e[_0x6330('0x3a')]:_0x33e514[_0x6330('0x39')];if(!_0x521794['query'][_0x6330('0x3d')]('nolimit')){_0x1f889e['limit']=qs[_0x6330('0x20')](_0x521794[_0x6330('0x35')][_0x6330('0x20')]);_0x1f889e[_0x6330('0x1f')]=qs[_0x6330('0x1f')](_0x521794[_0x6330('0x35')][_0x6330('0x1f')]);}_0x1f889e[_0x6330('0x3f')]=qs['sort'](_0x521794[_0x6330('0x35')][_0x6330('0x40')]);_0x1f889e[_0x6330('0x41')]=qs[_0x6330('0x37')](_[_0x6330('0x42')](_0x521794[_0x6330('0x35')],_0x33e514[_0x6330('0x37')]));_0x1f889e[_0x6330('0x41')][_0x6330('0x5f')]=_0x19a100['id'];if(_0x521794[_0x6330('0x35')][_0x6330('0x60')]){_0x1f889e[_0x6330('0x41')]=_[_0x6330('0x43')](_0x1f889e[_0x6330('0x41')],{'$or':_[_0x6330('0x31')](_0x1f889e[_0x6330('0x3a')],function(_0x557516){var _0x14d5c1={};_0x14d5c1[_0x557516]={'$like':'%'+_0x521794[_0x6330('0x35')]['filter']+'%'};return _0x14d5c1;})});}_0x1f889e=_[_0x6330('0x43')]({},_0x1f889e,_0x521794[_0x6330('0x58')]);return db[_0x6330('0x65')]['count']({'where':_0x1f889e[_0x6330('0x41')]})[_0x6330('0x28')](function(_0x7b523a){_0x52ffde['count']=_0x7b523a;if(_0x521794['query'][_0x6330('0x46')]){_0x1f889e[_0x6330('0x47')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x1f889e);})[_0x6330('0x28')](function(_0x1bdd60){_0x52ffde['rows']=_0x1bdd60;return _0x52ffde;});}})[_0x6330('0x28')](respondWithFilteredResult(_0xe7c69,_0x1f889e))[_0x6330('0x4b')](handleError(_0xe7c69,null));};exports[_0x6330('0x66')]=function(_0x3ec0e9,_0x28a54e,_0x2cf290){var _0x48fc16={};var _0x206a0b={};var _0x21069f;var _0x29bc4d;return db['Campaign'][_0x6330('0x5d')]({'where':{'id':_0x3ec0e9['params']['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x28a54e,null))['then'](function(_0x1925cd){if(_0x1925cd){_0x21069f=_0x1925cd;_0x206a0b[_0x6330('0x39')]=_[_0x6330('0x36')](db[_0x6330('0x67')][_0x6330('0x32')]);_0x206a0b[_0x6330('0x35')]=_['keys'](_0x3ec0e9['query']);_0x206a0b['filters']=_[_0x6330('0x38')](_0x206a0b[_0x6330('0x39')],_0x206a0b[_0x6330('0x35')]);_0x48fc16[_0x6330('0x3a')]=_[_0x6330('0x38')](_0x206a0b[_0x6330('0x39')],qs[_0x6330('0x3b')](_0x3ec0e9[_0x6330('0x35')][_0x6330('0x3b')]));_0x48fc16['attributes']=_0x48fc16[_0x6330('0x3a')]['length']?_0x48fc16[_0x6330('0x3a')]:_0x206a0b[_0x6330('0x39')];_0x48fc16[_0x6330('0x3f')]=qs[_0x6330('0x40')](_0x3ec0e9[_0x6330('0x35')][_0x6330('0x40')]);_0x48fc16[_0x6330('0x41')]=qs[_0x6330('0x37')](_[_0x6330('0x42')](_0x3ec0e9[_0x6330('0x35')],_0x206a0b['filters']));if(_0x3ec0e9[_0x6330('0x35')][_0x6330('0x60')]){_0x48fc16[_0x6330('0x41')]=_[_0x6330('0x43')](_0x48fc16[_0x6330('0x41')],{'$or':_['map'](_0x48fc16[_0x6330('0x3a')],function(_0x28b8f3){var _0x4c91d0={};_0x4c91d0[_0x28b8f3]={'$like':'%'+_0x3ec0e9[_0x6330('0x35')][_0x6330('0x60')]+'%'};return _0x4c91d0;})});}_0x48fc16=_[_0x6330('0x43')]({},_0x48fc16,_0x3ec0e9[_0x6330('0x58')]);return _0x21069f[_0x6330('0x66')](_0x48fc16);}})['then'](function(_0x4f9692){if(_0x4f9692){_0x29bc4d=_0x4f9692[_0x6330('0x3c')];if(!_0x3ec0e9['query']['hasOwnProperty']('nolimit')){_0x48fc16[_0x6330('0x20')]=qs[_0x6330('0x20')](_0x3ec0e9[_0x6330('0x35')][_0x6330('0x20')]);_0x48fc16[_0x6330('0x1f')]=qs[_0x6330('0x1f')](_0x3ec0e9[_0x6330('0x35')]['offset']);}return _0x21069f[_0x6330('0x66')](_0x48fc16);}})['then'](function(_0x536f17){if(_0x536f17){return _0x536f17?{'count':_0x29bc4d,'rows':_0x536f17}:null;}})[_0x6330('0x28')](respondWithResult(_0x28a54e,null))[_0x6330('0x4b')](handleError(_0x28a54e,null));};exports[_0x6330('0x68')]=function(_0x26c3db,_0x1a5947,_0x448b45){var _0x4d0ae5,_0x23ddd3;var _0x4c06f7=[];var _0x173987=moment()[_0x6330('0x69')](_0x6330('0x6a'));return db[_0x6330('0x48')][_0x6330('0x4d')]({'where':{'id':_0x26c3db['params']['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x1a5947,null))[_0x6330('0x28')](function(_0x1d450f){if(_0x1d450f){_0x23ddd3=_0x1d450f;return _0x1d450f[_0x6330('0x68')](_0x26c3db[_0x6330('0x5b')][_0x6330('0x6b')],_[_0x6330('0x59')](_0x26c3db[_0x6330('0x5b')],['ids','id'])||{});}return null;})[_0x6330('0x6c')](function(_0x29c256){var _0x222c2e;var _0x51368b;_0x4d0ae5=_0x29c256||[];var _0x48fed2=[];if(_0x29c256){for(var _0x436f17=0x0;_0x436f17<_0x29c256['length'];_0x436f17+=0x1){var _0x335121=_0x29c256[_0x436f17][_0x6330('0x2a')]({'plain':!![]});_0x23ddd3[_0x6330('0x6d')]=_0x26c3db[_0x6330('0x5b')][_0x6330('0x6d')]?_0x26c3db[_0x6330('0x5b')]['dialCheckDuplicateType']:_0x23ddd3[_0x6330('0x6d')];switch(_0x23ddd3[_0x6330('0x6d')]){case _0x6330('0x6e'):_0x222c2e=squel['insert']()[_0x6330('0x6f')](_0x6330('0x70'))[_0x6330('0x71')]([_0x6330('0x72'),_0x6330('0x73'),_0x6330('0x74'),_0x6330('0x75'),_0x6330('0x5f'),'createdAt','updatedAt'],squel['select']()[_0x6330('0x76')](_0x6330('0x72'),'phone')[_0x6330('0x76')](_0x6330('0x77'),_0x6330('0x73'))['field']('id',_0x6330('0x74'))['field'](_0x335121[_0x6330('0x78')][_0x6330('0x79')](),_0x6330('0x75'))[_0x6330('0x76')](_0x26c3db['params']['id']['toString'](),'CampaignId')['field']('\x27'+_0x173987+'\x27',_0x6330('0x7a'))['field']('\x27'+_0x173987+'\x27','updatedAt')['from']('cm_contacts')[_0x6330('0x41')](_0x6330('0x7b'))[_0x6330('0x41')](_0x6330('0x7c'),_0x335121[_0x6330('0x78')][_0x6330('0x79')]())[_0x6330('0x41')](_0x6330('0x7d'))[_0x6330('0x41')](_0x6330('0x7e'),squel['select']()[_0x6330('0x76')](_0x6330('0x7f'))[_0x6330('0x80')](_0x6330('0x81'))['where']('CampaignId\x20=\x20?',_0x26c3db['params']['id'][_0x6330('0x79')]()))[_0x6330('0x41')](_0x6330('0x7e'),squel[_0x6330('0x82')]()['field'](_0x6330('0x83'))[_0x6330('0x80')]('cm_hopper')[_0x6330('0x41')](_0x6330('0x84'),_0x26c3db['params']['id'][_0x6330('0x79')]())))[_0x6330('0x79')]();break;case _0x6330('0x85'):_0x222c2e=squel[_0x6330('0x86')]()['into'](_0x6330('0x70'))[_0x6330('0x71')]([_0x6330('0x72'),_0x6330('0x73'),_0x6330('0x74'),_0x6330('0x75'),_0x6330('0x5f'),_0x6330('0x7a'),_0x6330('0x5a')],squel['select']()['field'](_0x6330('0x72'),'phone')[_0x6330('0x76')]('NOW()',_0x6330('0x73'))[_0x6330('0x76')]('id',_0x6330('0x74'))[_0x6330('0x76')](_0x335121[_0x6330('0x78')][_0x6330('0x79')](),_0x6330('0x75'))[_0x6330('0x76')](_0x26c3db[_0x6330('0x57')]['id'][_0x6330('0x79')](),_0x6330('0x5f'))['field']('\x27'+_0x173987+'\x27',_0x6330('0x7a'))[_0x6330('0x76')]('\x27'+_0x173987+'\x27',_0x6330('0x5a'))[_0x6330('0x80')](_0x6330('0x87'))[_0x6330('0x41')](_0x6330('0x7b'))['where'](_0x6330('0x7c'),_0x335121['CmListId']['toString']())[_0x6330('0x41')](_0x6330('0x7d'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x6330('0x82')]()['field'](_0x6330('0x83'))[_0x6330('0x80')](_0x6330('0x70'))[_0x6330('0x41')]('CampaignId\x20=\x20?',_0x26c3db[_0x6330('0x57')]['id'][_0x6330('0x79')]())))[_0x6330('0x79')]();break;default:_0x222c2e=squel[_0x6330('0x86')]()[_0x6330('0x6f')](_0x6330('0x70'))[_0x6330('0x71')]([_0x6330('0x72'),'scheduledAt',_0x6330('0x74'),'ListId',_0x6330('0x5f'),_0x6330('0x7a'),_0x6330('0x5a')],squel[_0x6330('0x82')]()['field'](_0x6330('0x72'),_0x6330('0x72'))[_0x6330('0x76')](_0x6330('0x77'),_0x6330('0x73'))[_0x6330('0x76')]('id',_0x6330('0x74'))[_0x6330('0x76')](_0x335121['CmListId'][_0x6330('0x79')](),'ListId')['field'](_0x26c3db[_0x6330('0x57')]['id'][_0x6330('0x79')](),'CampaignId')[_0x6330('0x76')]('\x27'+_0x173987+'\x27','createdAt')[_0x6330('0x76')]('\x27'+_0x173987+'\x27','updatedAt')[_0x6330('0x80')](_0x6330('0x87'))[_0x6330('0x41')](_0x6330('0x7b'))[_0x6330('0x41')](_0x6330('0x7c'),_0x335121['CmListId']['toString']())['where'](_0x6330('0x7d')))[_0x6330('0x79')]();}_0x51368b=squel[_0x6330('0x86')]()[_0x6330('0x6f')](_0x6330('0x88'))[_0x6330('0x71')]([_0x6330('0x89'),_0x6330('0x73'),_0x6330('0x72'),'OrderBy',_0x6330('0x7a'),_0x6330('0x5a')],squel['select']()[_0x6330('0x76')](_0x6330('0x8a'),'id')[_0x6330('0x76')](_0x6330('0x77'),_0x6330('0x73'))[_0x6330('0x76')](_0x6330('0x8b'),_0x6330('0x72'))[_0x6330('0x76')](_0x6330('0x8c'),_0x6330('0x8d'))[_0x6330('0x76')]('\x27'+_0x173987+'\x27',_0x6330('0x7a'))[_0x6330('0x76')]('\x27'+_0x173987+'\x27',_0x6330('0x5a'))[_0x6330('0x80')](_0x6330('0x8e'),'ci')[_0x6330('0x8f')](_0x6330('0x70'),'h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0x6330('0x90'),_0x335121[_0x6330('0x78')][_0x6330('0x79')]())['where'](_0x6330('0x91'),_0x26c3db[_0x6330('0x57')]['id'][_0x6330('0x79')]())[_0x6330('0x41')](_0x6330('0x92'),_0x173987))['toString']();_0x48fed2[_0x6330('0x93')](db[_0x6330('0x94')][_0x6330('0x35')](_0x222c2e));_0x4c06f7['push'](db[_0x6330('0x94')]['query'](_0x51368b));}return BPromise['all'](_0x48fed2);}})[_0x6330('0x28')](function(){return BPromise[_0x6330('0x95')](_0x4c06f7);})['then'](function(){return _0x4d0ae5;})[_0x6330('0x28')](respondWithResult(_0x1a5947,null))[_0x6330('0x4b')](handleError(_0x1a5947,null));};exports[_0x6330('0x96')]=function(_0x59a2df,_0x45c24b,_0x11f802){return db[_0x6330('0x48')]['find']({'where':{'id':_0x59a2df[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x45c24b,null))[_0x6330('0x28')](function(_0x4f7c22){if(_0x4f7c22){return _0x4f7c22['removeLists'](_0x59a2df[_0x6330('0x35')][_0x6330('0x6b')]);}})[_0x6330('0x28')](function(_0xdf58db){if(_0xdf58db){return db[_0x6330('0x5e')][_0x6330('0x29')]({'where':{'ListId':_0x59a2df[_0x6330('0x35')]['ids'],'CampaignId':_0x59a2df[_0x6330('0x57')]['id']}})[_0x6330('0x28')](function(){return _0xdf58db;});}})[_0x6330('0x28')](respondWithStatusCode(_0x45c24b,null))['catch'](handleError(_0x45c24b,null));};exports['getBlackLists']=function(_0xc001e8,_0x331311,_0x498a2a){var _0x49605d={};var _0x45d314={};var _0x16ace2;var _0xe3dd85;return db[_0x6330('0x48')][_0x6330('0x5d')]({'where':{'id':_0xc001e8[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x331311,null))[_0x6330('0x28')](function(_0x375f18){if(_0x375f18){_0x16ace2=_0x375f18;_0x45d314[_0x6330('0x39')]=_[_0x6330('0x36')](db[_0x6330('0x67')][_0x6330('0x32')]);_0x45d314['query']=_['keys'](_0xc001e8[_0x6330('0x35')]);_0x45d314[_0x6330('0x37')]=_[_0x6330('0x38')](_0x45d314[_0x6330('0x39')],_0x45d314[_0x6330('0x35')]);_0x49605d[_0x6330('0x3a')]=_[_0x6330('0x38')](_0x45d314['model'],qs[_0x6330('0x3b')](_0xc001e8[_0x6330('0x35')]['fields']));_0x49605d['attributes']=_0x49605d[_0x6330('0x3a')]['length']?_0x49605d[_0x6330('0x3a')]:_0x45d314[_0x6330('0x39')];_0x49605d['order']=qs[_0x6330('0x40')](_0xc001e8[_0x6330('0x35')][_0x6330('0x40')]);_0x49605d[_0x6330('0x41')]=qs[_0x6330('0x37')](_[_0x6330('0x42')](_0xc001e8[_0x6330('0x35')],_0x45d314[_0x6330('0x37')]));if(_0xc001e8[_0x6330('0x35')][_0x6330('0x60')]){_0x49605d[_0x6330('0x41')]=_['merge'](_0x49605d['where'],{'$or':_[_0x6330('0x31')](_0x49605d['attributes'],function(_0x2a11a2){var _0x4c7fd8={};_0x4c7fd8[_0x2a11a2]={'$like':'%'+_0xc001e8['query'][_0x6330('0x60')]+'%'};return _0x4c7fd8;})});}_0x49605d=_['merge']({},_0x49605d,_0xc001e8[_0x6330('0x58')]);return _0x16ace2['getBlackLists'](_0x49605d);}})[_0x6330('0x28')](function(_0x2debb2){if(_0x2debb2){_0xe3dd85=_0x2debb2[_0x6330('0x3c')];if(!_0xc001e8[_0x6330('0x35')][_0x6330('0x3d')](_0x6330('0x3e'))){_0x49605d[_0x6330('0x20')]=qs[_0x6330('0x20')](_0xc001e8[_0x6330('0x35')][_0x6330('0x20')]);_0x49605d['offset']=qs[_0x6330('0x1f')](_0xc001e8['query'][_0x6330('0x1f')]);}return _0x16ace2[_0x6330('0x97')](_0x49605d);}})[_0x6330('0x28')](function(_0x21cec6){if(_0x21cec6){return _0x21cec6?{'count':_0xe3dd85,'rows':_0x21cec6}:null;}})[_0x6330('0x28')](respondWithResult(_0x331311,null))[_0x6330('0x4b')](handleError(_0x331311,null));};exports['addBlackLists']=function(_0x416f08,_0x3f26d7,_0xb22365){var _0x3bd46c,_0x43a1b8;var _0xa6884c=[];var _0x329e60=moment()[_0x6330('0x69')](_0x6330('0x6a'));return db[_0x6330('0x48')][_0x6330('0x4d')]({'where':{'id':_0x416f08[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x3f26d7,null))[_0x6330('0x28')](function(_0x3669b1){if(_0x3669b1){_0x43a1b8=_0x3669b1;return _0x3669b1[_0x6330('0x98')](_0x416f08[_0x6330('0x5b')]['ids'],_[_0x6330('0x59')](_0x416f08[_0x6330('0x5b')],[_0x6330('0x6b'),'id'])||{});}return null;})[_0x6330('0x6c')](function(_0x360582){var _0x5b0ca0;var _0x16d482;_0x3bd46c=_0x360582||[];var _0x468483=[];if(_0x360582){for(var _0x7bfad9=0x0;_0x7bfad9<_0x360582[_0x6330('0x3c')];_0x7bfad9+=0x1){var _0x22af72=_0x360582[_0x7bfad9][_0x6330('0x2a')]({'plain':!![]});_0x5b0ca0=squel[_0x6330('0x86')]()['into'](_0x6330('0x99'))[_0x6330('0x71')](['phone','ContactId',_0x6330('0x75'),_0x6330('0x5f'),_0x6330('0x7a'),'updatedAt'],squel[_0x6330('0x82')]()[_0x6330('0x76')](_0x6330('0x72'),'phone')[_0x6330('0x76')]('id',_0x6330('0x74'))[_0x6330('0x76')](_0x22af72['CmListId'][_0x6330('0x79')](),_0x6330('0x75'))[_0x6330('0x76')](_0x416f08[_0x6330('0x57')]['id'][_0x6330('0x79')](),_0x6330('0x5f'))[_0x6330('0x76')](_0x6330('0x77'),_0x6330('0x7a'))[_0x6330('0x76')](_0x6330('0x77'),_0x6330('0x5a'))[_0x6330('0x80')](_0x6330('0x87'))[_0x6330('0x41')](_0x6330('0x7b'))[_0x6330('0x41')](_0x6330('0x7c'),_0x22af72[_0x6330('0x78')][_0x6330('0x79')]())[_0x6330('0x41')](_0x6330('0x7d')))['toString']();_0x468483[_0x6330('0x93')](db[_0x6330('0x94')][_0x6330('0x35')](_0x5b0ca0));}return BPromise[_0x6330('0x95')](_0x468483);}})[_0x6330('0x28')](function(){return _0x3bd46c;})[_0x6330('0x28')](respondWithResult(_0x3f26d7,null))[_0x6330('0x4b')](handleError(_0x3f26d7,null));};exports[_0x6330('0x9a')]=function(_0x3fc251,_0x6433c4,_0x1d2176){return db[_0x6330('0x48')][_0x6330('0x4d')]({'where':{'id':_0x3fc251[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x6433c4,null))['then'](function(_0x1c7542){if(_0x1c7542){return _0x1c7542['removeBlackLists'](_0x3fc251['query'][_0x6330('0x6b')]);}})['then'](function(_0x11beb0){if(_0x11beb0){return db[_0x6330('0x65')][_0x6330('0x29')]({'where':{'ListId':_0x3fc251['query'][_0x6330('0x6b')],'CampaignId':_0x3fc251['params']['id']}})[_0x6330('0x28')](function(){return _0x11beb0;});}})['then'](respondWithStatusCode(_0x6433c4,null))[_0x6330('0x4b')](handleError(_0x6433c4,null));}; \ No newline at end of file +var _0xefd7=['h.id','OrderBy','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','sequelize','push','all','removeLists','getBlackLists','CmList','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','IvrCampaigns','UserProfileResource','end','error','name','send','index','Campaign','rawAttributes','model','query','keys','filters','intersection','attributes','hasOwnProperty','sort','where','pick','filter','map','merge','includeAll','include','findAll','rows','fields','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','clone','options','omit','createdAt','updatedAt','params','getHoppers','findOne','CmHopper','nolimit','getHopperHistories','CmHopperHistory','order','CampaignId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','format','ids','spread','dialCheckDuplicateType','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','deletedAt\x20IS\x20NULL'];(function(_0x40e60f,_0x5365e1){var _0x35511f=function(_0x41df2d){while(--_0x41df2d){_0x40e60f['push'](_0x40e60f['shift']());}};_0x35511f(++_0x5365e1);}(_0xefd7,0x99));var _0x7efd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xefd7[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7efd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7efd('0x1'));var jsonpatch=require(_0x7efd('0x2'));var rp=require(_0x7efd('0x3'));var moment=require('moment');var BPromise=require(_0x7efd('0x4'));var Mustache=require(_0x7efd('0x5'));var util=require(_0x7efd('0x6'));var path=require(_0x7efd('0x7'));var sox=require('sox');var csv=require(_0x7efd('0x8'));var ejs=require(_0x7efd('0x9'));var fs=require('fs');var fs_extra=require(_0x7efd('0xa'));var _=require(_0x7efd('0xb'));var squel=require(_0x7efd('0xc'));var crypto=require(_0x7efd('0xd'));var jsforce=require(_0x7efd('0xe'));var deskjs=require(_0x7efd('0xf'));var toCsv=require(_0x7efd('0x8'));var querystring=require('querystring');var Papa=require(_0x7efd('0x10'));var Redis=require(_0x7efd('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7efd('0x12'));var as=require(_0x7efd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7efd('0x14'))(_0x7efd('0x15'));var utils=require('../../config/utils');var config=require(_0x7efd('0x16'));var licenseUtil=require(_0x7efd('0x17'));var db=require(_0x7efd('0x18'))['db'];function respondWithStatusCode(_0x57269e,_0x5e017c){_0x5e017c=_0x5e017c||0xcc;return function(_0x424da9){if(_0x424da9){return _0x57269e[_0x7efd('0x19')](_0x5e017c);}return _0x57269e[_0x7efd('0x1a')](_0x5e017c)['end']();};}function respondWithResult(_0x17c1f4,_0x37e9f2){_0x37e9f2=_0x37e9f2||0xc8;return function(_0x237323){if(_0x237323){return _0x17c1f4['status'](_0x37e9f2)[_0x7efd('0x1b')](_0x237323);}};}function respondWithFilteredResult(_0x143cb2,_0x5280a2){return function(_0x196674){if(_0x196674){var _0x5affe3=typeof _0x5280a2[_0x7efd('0x1c')]===_0x7efd('0x1d')&&typeof _0x5280a2[_0x7efd('0x1e')]==='undefined';var _0x2a91e1=_0x196674[_0x7efd('0x1f')];var _0x3c0dc2=_0x5affe3?0x0:_0x5280a2[_0x7efd('0x1c')];var _0x47f98a=_0x5affe3?_0x196674['count']:_0x5280a2[_0x7efd('0x1c')]+_0x5280a2['limit'];var _0x58c994;if(_0x47f98a>=_0x2a91e1){_0x47f98a=_0x2a91e1;_0x58c994=0xc8;}else{_0x58c994=0xce;}_0x143cb2[_0x7efd('0x1a')](_0x58c994);return _0x143cb2[_0x7efd('0x20')](_0x7efd('0x21'),_0x3c0dc2+'-'+_0x47f98a+'/'+_0x2a91e1)[_0x7efd('0x1b')](_0x196674);}return null;};}function patchUpdates(_0x5db31e){return function(_0x4330dc){try{jsonpatch[_0x7efd('0x22')](_0x4330dc,_0x5db31e,!![]);}catch(_0x307568){return BPromise['reject'](_0x307568);}return _0x4330dc[_0x7efd('0x23')]();};}function saveUpdates(_0x45cc61,_0xbdd9f8){return function(_0x230714){if(_0x230714){return _0x230714[_0x7efd('0x24')](_0x45cc61)['then'](function(_0xd04f56){return _0xd04f56;});}return null;};}function removeEntity(_0x1dc48c,_0x127c86){return function(_0x35bdb6){if(_0x35bdb6){return _0x35bdb6[_0x7efd('0x25')]()[_0x7efd('0x26')](function(){var _0x3e3b74=_0x35bdb6[_0x7efd('0x27')]({'plain':!![]});var _0x4e604a=_0x7efd('0x28');return db[_0x7efd('0x29')][_0x7efd('0x25')]({'where':{'type':_0x4e604a,'resourceId':_0x3e3b74['id']}})['then'](function(){return _0x35bdb6;});})[_0x7efd('0x26')](function(){_0x1dc48c[_0x7efd('0x1a')](0xcc)[_0x7efd('0x2a')]();});}};}function handleEntityNotFound(_0x500b6e,_0x433588){return function(_0x563b1f){if(!_0x563b1f){_0x500b6e[_0x7efd('0x19')](0x194);}return _0x563b1f;};}function handleError(_0x81309e,_0x319feb){_0x319feb=_0x319feb||0x1f4;return function(_0x4d3c68){logger[_0x7efd('0x2b')](_0x4d3c68['stack']);if(_0x4d3c68['name']){delete _0x4d3c68[_0x7efd('0x2c')];}_0x81309e[_0x7efd('0x1a')](_0x319feb)[_0x7efd('0x2d')](_0x4d3c68);};}exports[_0x7efd('0x2e')]=function(_0x332967,_0x26cbee){var _0x38fa07={},_0x2fa66e={},_0x123c11={'count':0x0,'rows':[]};var _0x43aa5b=_['map'](db[_0x7efd('0x2f')][_0x7efd('0x30')],function(_0x13b057){return{'name':_0x13b057['fieldName'],'type':_0x13b057['type']['key']};});_0x2fa66e[_0x7efd('0x31')]=_['map'](_0x43aa5b,_0x7efd('0x2c'));_0x2fa66e[_0x7efd('0x32')]=_[_0x7efd('0x33')](_0x332967[_0x7efd('0x32')]);_0x2fa66e[_0x7efd('0x34')]=_[_0x7efd('0x35')](_0x2fa66e['model'],_0x2fa66e[_0x7efd('0x32')]);_0x38fa07['attributes']=_[_0x7efd('0x35')](_0x2fa66e[_0x7efd('0x31')],qs['fields'](_0x332967['query']['fields']));_0x38fa07['attributes']=_0x38fa07[_0x7efd('0x36')]['length']?_0x38fa07['attributes']:_0x2fa66e[_0x7efd('0x31')];if(!_0x332967[_0x7efd('0x32')][_0x7efd('0x37')]('nolimit')){_0x38fa07[_0x7efd('0x1e')]=qs[_0x7efd('0x1e')](_0x332967[_0x7efd('0x32')][_0x7efd('0x1e')]);_0x38fa07[_0x7efd('0x1c')]=qs[_0x7efd('0x1c')](_0x332967[_0x7efd('0x32')][_0x7efd('0x1c')]);}_0x38fa07['order']=qs[_0x7efd('0x38')](_0x332967[_0x7efd('0x32')]['sort']);_0x38fa07[_0x7efd('0x39')]=qs['filters'](_[_0x7efd('0x3a')](_0x332967[_0x7efd('0x32')],_0x2fa66e['filters']),_0x43aa5b);if(_0x332967['query'][_0x7efd('0x3b')]){_0x38fa07[_0x7efd('0x39')]=_['merge'](_0x38fa07[_0x7efd('0x39')],{'$or':_[_0x7efd('0x3c')](_0x43aa5b,function(_0x13481c){if(_0x13481c['type']!=='VIRTUAL'){var _0x57aa0b={};_0x57aa0b[_0x13481c[_0x7efd('0x2c')]]={'$like':'%'+_0x332967[_0x7efd('0x32')][_0x7efd('0x3b')]+'%'};return _0x57aa0b;}})});}_0x38fa07=_[_0x7efd('0x3d')]({},_0x38fa07,_0x332967['options']);var _0x53a63b={'where':_0x38fa07['where']};return db[_0x7efd('0x2f')][_0x7efd('0x1f')](_0x53a63b)['then'](function(_0x2ba456){_0x123c11['count']=_0x2ba456;if(_0x332967[_0x7efd('0x32')][_0x7efd('0x3e')]){_0x38fa07[_0x7efd('0x3f')]=[{'all':!![]}];}return db[_0x7efd('0x2f')][_0x7efd('0x40')](_0x38fa07);})[_0x7efd('0x26')](function(_0x34597a){_0x123c11[_0x7efd('0x41')]=_0x34597a;return _0x123c11;})[_0x7efd('0x26')](respondWithFilteredResult(_0x26cbee,_0x38fa07))['catch'](handleError(_0x26cbee,null));};exports['show']=function(_0x1fdd69,_0x13a533){var _0x5a47ac={'raw':![],'where':{'id':_0x1fdd69['params']['id']}},_0x47e86e={};_0x47e86e['model']=_[_0x7efd('0x33')](db['Campaign']['rawAttributes']);_0x47e86e['query']=_[_0x7efd('0x33')](_0x1fdd69['query']);_0x47e86e['filters']=_[_0x7efd('0x35')](_0x47e86e[_0x7efd('0x31')],_0x47e86e['query']);_0x5a47ac[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x47e86e[_0x7efd('0x31')],qs[_0x7efd('0x42')](_0x1fdd69[_0x7efd('0x32')][_0x7efd('0x42')]));_0x5a47ac['attributes']=_0x5a47ac['attributes'][_0x7efd('0x43')]?_0x5a47ac[_0x7efd('0x36')]:_0x47e86e[_0x7efd('0x31')];if(_0x1fdd69['query'][_0x7efd('0x3e')]){_0x5a47ac[_0x7efd('0x3f')]=[{'all':!![]}];}_0x5a47ac=_[_0x7efd('0x3d')]({},_0x5a47ac,_0x1fdd69['options']);return db[_0x7efd('0x2f')][_0x7efd('0x44')](_0x5a47ac)[_0x7efd('0x26')](handleEntityNotFound(_0x13a533,null))[_0x7efd('0x26')](respondWithResult(_0x13a533,null))[_0x7efd('0x45')](handleError(_0x13a533,null));};exports[_0x7efd('0x46')]=function(_0x5b41dc,_0x320b6d){return db[_0x7efd('0x2f')][_0x7efd('0x46')](_0x5b41dc[_0x7efd('0x47')],{})[_0x7efd('0x26')](function(_0x306a44){var _0x2c1d24=_0x5b41dc[_0x7efd('0x48')]['get']({'plain':!![]});if(!_0x2c1d24)throw new Error(_0x7efd('0x49'));if(_0x2c1d24[_0x7efd('0x4a')]==='user'){var _0x42d37a=_0x306a44[_0x7efd('0x27')]({'plain':!![]});var _0x30706b=_0x7efd('0x28');return db[_0x7efd('0x4b')][_0x7efd('0x44')]({'where':{'name':_0x30706b,'userProfileId':_0x2c1d24['userProfileId']},'raw':!![]})[_0x7efd('0x26')](function(_0x25099e){if(_0x25099e&&_0x25099e[_0x7efd('0x4c')]===0x0){return db[_0x7efd('0x29')][_0x7efd('0x46')]({'name':_0x42d37a[_0x7efd('0x2c')],'resourceId':_0x42d37a['id'],'type':_0x25099e[_0x7efd('0x2c')],'sectionId':_0x25099e['id']},{})[_0x7efd('0x26')](function(){return _0x306a44;});}else{return _0x306a44;}})[_0x7efd('0x45')](function(_0x40773a){logger[_0x7efd('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40773a);throw _0x40773a;});}return _0x306a44;})[_0x7efd('0x26')](respondWithResult(_0x320b6d,0xc9))['catch'](handleError(_0x320b6d,null));};exports[_0x7efd('0x4d')]=function(_0x53e3f9,_0x4b8e29){var _0x48e111={'where':{'id':_0x53e3f9['params']['id']}},_0x4d01b9={};_0x4d01b9['model']=_['keys'](db['Campaign'][_0x7efd('0x30')]);_0x48e111[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x4d01b9[_0x7efd('0x31')],qs[_0x7efd('0x42')](_0x53e3f9[_0x7efd('0x32')][_0x7efd('0x42')]));_0x48e111[_0x7efd('0x36')]=_0x48e111[_0x7efd('0x36')][_0x7efd('0x43')]?_0x48e111['attributes']:_0x4d01b9[_0x7efd('0x31')];if(_0x53e3f9[_0x7efd('0x32')]['includeAll']){_0x48e111['include']=[{'all':!![]}];}_0x48e111=_[_0x7efd('0x3d')]({},_0x48e111,_0x53e3f9[_0x7efd('0x4e')]);return db['Campaign']['find'](_0x48e111)['then'](handleEntityNotFound(_0x4b8e29,null))[_0x7efd('0x26')](function(_0x548aa1){if(_0x548aa1){var _0x4a31c7=_0x548aa1['get']({'plain':!![]});_0x4a31c7=qs[_0x7efd('0x4f')](_0x4a31c7,['id',_0x7efd('0x50'),_0x7efd('0x51')]);_0x53e3f9[_0x7efd('0x47')]=_[_0x7efd('0x4f')](_0x53e3f9[_0x7efd('0x47')],['id',_0x7efd('0x50'),_0x7efd('0x51')]);return db[_0x7efd('0x2f')]['create'](_['merge'](_0x4a31c7,_0x53e3f9['body']),{'include':_0x53e3f9['query'][_0x7efd('0x3e')]?[{'all':!![]}]:undefined})[_0x7efd('0x26')](function(_0x39961c){var _0x54ba4d=_0x53e3f9[_0x7efd('0x48')]['get']({'plain':!![]});if(!_0x54ba4d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54ba4d[_0x7efd('0x4a')]==='user'){var _0x222b9e=_0x39961c[_0x7efd('0x27')]({'plain':!![]});var _0x5c126f=_0x7efd('0x28');return db['UserProfileSection'][_0x7efd('0x44')]({'where':{'name':_0x5c126f,'userProfileId':_0x54ba4d['userProfileId']},'raw':!![]})[_0x7efd('0x26')](function(_0x241709){if(_0x241709&&_0x241709[_0x7efd('0x4c')]===0x0){return db[_0x7efd('0x29')][_0x7efd('0x46')]({'name':_0x222b9e[_0x7efd('0x2c')],'resourceId':_0x222b9e['id'],'type':_0x241709['name'],'sectionId':_0x241709['id']},{})[_0x7efd('0x26')](function(){return _0x39961c;});}else{return _0x39961c;}})['catch'](function(_0x32e001){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32e001);throw _0x32e001;});}return _0x39961c;});}})[_0x7efd('0x26')](respondWithResult(_0x4b8e29,0xc9))[_0x7efd('0x45')](handleError(_0x4b8e29,null));};exports[_0x7efd('0x24')]=function(_0x162721,_0xc0fb5c){if(_0x162721['body']['id']){delete _0x162721[_0x7efd('0x47')]['id'];}return db['Campaign']['find']({'where':{'id':_0x162721[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0xc0fb5c,null))[_0x7efd('0x26')](saveUpdates(_0x162721[_0x7efd('0x47')],null))['then'](respondWithResult(_0xc0fb5c,null))[_0x7efd('0x45')](handleError(_0xc0fb5c,null));};exports[_0x7efd('0x25')]=function(_0x260888,_0x16737c){return db[_0x7efd('0x2f')][_0x7efd('0x44')]({'where':{'id':_0x260888[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x16737c,null))[_0x7efd('0x26')](removeEntity(_0x16737c,null))[_0x7efd('0x45')](handleError(_0x16737c,null));};exports[_0x7efd('0x53')]=function(_0x802460,_0x1a9232,_0x3fdbbc){var _0x5636dd={'raw':!![],'where':{}};var _0x58a6c2={};var _0x1175b2={'count':0x0,'rows':[]};return db[_0x7efd('0x2f')][_0x7efd('0x54')]({'where':{'id':_0x802460[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x1a9232,null))[_0x7efd('0x26')](function(_0x513de5){if(_0x513de5){_0x58a6c2[_0x7efd('0x31')]=_[_0x7efd('0x33')](db[_0x7efd('0x55')]['rawAttributes']);_0x58a6c2[_0x7efd('0x32')]=_['keys'](_0x802460[_0x7efd('0x32')]);_0x58a6c2['filters']=_[_0x7efd('0x35')](_0x58a6c2[_0x7efd('0x31')],_0x58a6c2['query']);_0x5636dd[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x58a6c2['model'],qs['fields'](_0x802460['query'][_0x7efd('0x42')]));_0x5636dd['attributes']=_0x5636dd[_0x7efd('0x36')][_0x7efd('0x43')]?_0x5636dd['attributes']:_0x58a6c2[_0x7efd('0x31')];if(!_0x802460[_0x7efd('0x32')][_0x7efd('0x37')](_0x7efd('0x56'))){_0x5636dd[_0x7efd('0x1e')]=qs['limit'](_0x802460[_0x7efd('0x32')][_0x7efd('0x1e')]);_0x5636dd[_0x7efd('0x1c')]=qs[_0x7efd('0x1c')](_0x802460['query']['offset']);}_0x5636dd['order']=qs[_0x7efd('0x38')](_0x802460[_0x7efd('0x32')][_0x7efd('0x38')]);_0x5636dd['where']=qs[_0x7efd('0x34')](_[_0x7efd('0x3a')](_0x802460['query'],_0x58a6c2[_0x7efd('0x34')]));_0x5636dd['where']['CampaignId']=_0x513de5['id'];if(_0x802460[_0x7efd('0x32')]['filter']){_0x5636dd['where']=_[_0x7efd('0x3d')](_0x5636dd['where'],{'$or':_[_0x7efd('0x3c')](_0x5636dd[_0x7efd('0x36')],function(_0x1831d6){var _0x32d013={};_0x32d013[_0x1831d6]={'$like':'%'+_0x802460[_0x7efd('0x32')][_0x7efd('0x3b')]+'%'};return _0x32d013;})});}_0x5636dd=_[_0x7efd('0x3d')]({},_0x5636dd,_0x802460[_0x7efd('0x4e')]);return db[_0x7efd('0x55')][_0x7efd('0x1f')]({'where':_0x5636dd[_0x7efd('0x39')]})[_0x7efd('0x26')](function(_0x1281f7){_0x1175b2[_0x7efd('0x1f')]=_0x1281f7;if(_0x802460[_0x7efd('0x32')]['includeAll']){_0x5636dd[_0x7efd('0x3f')]=[{'all':!![]}];}return db['CmHopper'][_0x7efd('0x40')](_0x5636dd);})[_0x7efd('0x26')](function(_0x338df0){_0x1175b2[_0x7efd('0x41')]=_0x338df0;return _0x1175b2;});}})['then'](respondWithFilteredResult(_0x1a9232,_0x5636dd))[_0x7efd('0x45')](handleError(_0x1a9232,null));};exports[_0x7efd('0x57')]=function(_0x332383,_0xd864b,_0x3e7efb){var _0x1a541f={'raw':!![],'where':{}};var _0x5833a2={};var _0x46bf7f={'count':0x0,'rows':[]};return db[_0x7efd('0x2f')][_0x7efd('0x54')]({'where':{'id':_0x332383[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0xd864b,null))['then'](function(_0x453fef){if(_0x453fef){_0x5833a2[_0x7efd('0x31')]=_[_0x7efd('0x33')](db[_0x7efd('0x58')][_0x7efd('0x30')]);_0x5833a2[_0x7efd('0x32')]=_[_0x7efd('0x33')](_0x332383[_0x7efd('0x32')]);_0x5833a2[_0x7efd('0x34')]=_['intersection'](_0x5833a2[_0x7efd('0x31')],_0x5833a2['query']);_0x1a541f[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x5833a2['model'],qs[_0x7efd('0x42')](_0x332383['query'][_0x7efd('0x42')]));_0x1a541f['attributes']=_0x1a541f[_0x7efd('0x36')][_0x7efd('0x43')]?_0x1a541f[_0x7efd('0x36')]:_0x5833a2[_0x7efd('0x31')];if(!_0x332383[_0x7efd('0x32')]['hasOwnProperty'](_0x7efd('0x56'))){_0x1a541f[_0x7efd('0x1e')]=qs[_0x7efd('0x1e')](_0x332383[_0x7efd('0x32')][_0x7efd('0x1e')]);_0x1a541f[_0x7efd('0x1c')]=qs[_0x7efd('0x1c')](_0x332383[_0x7efd('0x32')][_0x7efd('0x1c')]);}_0x1a541f[_0x7efd('0x59')]=qs[_0x7efd('0x38')](_0x332383[_0x7efd('0x32')]['sort']);_0x1a541f[_0x7efd('0x39')]=qs[_0x7efd('0x34')](_['pick'](_0x332383['query'],_0x5833a2[_0x7efd('0x34')]));_0x1a541f[_0x7efd('0x39')][_0x7efd('0x5a')]=_0x453fef['id'];if(_0x332383['query'][_0x7efd('0x3b')]){_0x1a541f[_0x7efd('0x39')]=_[_0x7efd('0x3d')](_0x1a541f[_0x7efd('0x39')],{'$or':_[_0x7efd('0x3c')](_0x1a541f[_0x7efd('0x36')],function(_0x424d8d){var _0x5d5028={};_0x5d5028[_0x424d8d]={'$like':'%'+_0x332383[_0x7efd('0x32')][_0x7efd('0x3b')]+'%'};return _0x5d5028;})});}_0x1a541f=_[_0x7efd('0x3d')]({},_0x1a541f,_0x332383[_0x7efd('0x4e')]);return db['CmHopperHistory'][_0x7efd('0x1f')]({'where':_0x1a541f['where']})[_0x7efd('0x26')](function(_0xbecabd){_0x46bf7f[_0x7efd('0x1f')]=_0xbecabd;if(_0x332383['query'][_0x7efd('0x3e')]){_0x1a541f[_0x7efd('0x3f')]=[{'all':!![]}];}return db[_0x7efd('0x58')][_0x7efd('0x40')](_0x1a541f);})[_0x7efd('0x26')](function(_0x4c31aa){_0x46bf7f['rows']=_0x4c31aa;return _0x46bf7f;});}})[_0x7efd('0x26')](respondWithFilteredResult(_0xd864b,_0x1a541f))[_0x7efd('0x45')](handleError(_0xd864b,null));};exports['getHopperFinals']=function(_0x13e891,_0x5a24e9,_0x221ba2){var _0x1601a6={'raw':!![],'where':{}};var _0x1a4444={};var _0x38c128={'count':0x0,'rows':[]};return db[_0x7efd('0x2f')][_0x7efd('0x54')]({'where':{'id':_0x13e891['params']['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x5a24e9,null))[_0x7efd('0x26')](function(_0x4dd443){if(_0x4dd443){_0x1a4444['model']=_[_0x7efd('0x33')](db['CmHopperFinal'][_0x7efd('0x30')]);_0x1a4444[_0x7efd('0x32')]=_[_0x7efd('0x33')](_0x13e891[_0x7efd('0x32')]);_0x1a4444[_0x7efd('0x34')]=_[_0x7efd('0x35')](_0x1a4444['model'],_0x1a4444['query']);_0x1601a6[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x1a4444[_0x7efd('0x31')],qs[_0x7efd('0x42')](_0x13e891['query'][_0x7efd('0x42')]));_0x1601a6[_0x7efd('0x36')]=_0x1601a6[_0x7efd('0x36')][_0x7efd('0x43')]?_0x1601a6['attributes']:_0x1a4444[_0x7efd('0x31')];if(!_0x13e891[_0x7efd('0x32')][_0x7efd('0x37')](_0x7efd('0x56'))){_0x1601a6[_0x7efd('0x1e')]=qs['limit'](_0x13e891['query'][_0x7efd('0x1e')]);_0x1601a6[_0x7efd('0x1c')]=qs[_0x7efd('0x1c')](_0x13e891[_0x7efd('0x32')][_0x7efd('0x1c')]);}_0x1601a6[_0x7efd('0x59')]=qs[_0x7efd('0x38')](_0x13e891[_0x7efd('0x32')]['sort']);_0x1601a6[_0x7efd('0x39')]=qs[_0x7efd('0x34')](_[_0x7efd('0x3a')](_0x13e891[_0x7efd('0x32')],_0x1a4444[_0x7efd('0x34')]));_0x1601a6[_0x7efd('0x39')]['CampaignId']=_0x4dd443['id'];if(_0x13e891['query'][_0x7efd('0x3b')]){_0x1601a6[_0x7efd('0x39')]=_[_0x7efd('0x3d')](_0x1601a6[_0x7efd('0x39')],{'$or':_[_0x7efd('0x3c')](_0x1601a6[_0x7efd('0x36')],function(_0x576fcc){var _0x38e9a9={};_0x38e9a9[_0x576fcc]={'$like':'%'+_0x13e891[_0x7efd('0x32')][_0x7efd('0x3b')]+'%'};return _0x38e9a9;})});}_0x1601a6=_['merge']({},_0x1601a6,_0x13e891[_0x7efd('0x4e')]);return db[_0x7efd('0x5b')][_0x7efd('0x1f')]({'where':_0x1601a6[_0x7efd('0x39')]})['then'](function(_0x5ed761){_0x38c128[_0x7efd('0x1f')]=_0x5ed761;if(_0x13e891[_0x7efd('0x32')][_0x7efd('0x3e')]){_0x1601a6[_0x7efd('0x3f')]=[{'all':!![]}];}return db[_0x7efd('0x5b')]['findAll'](_0x1601a6);})[_0x7efd('0x26')](function(_0x4be134){_0x38c128['rows']=_0x4be134;return _0x38c128;});}})[_0x7efd('0x26')](respondWithFilteredResult(_0x5a24e9,_0x1601a6))[_0x7efd('0x45')](handleError(_0x5a24e9,null));};exports[_0x7efd('0x5c')]=function(_0x467cb0,_0xe2d0b8,_0x27e0cc){var _0x2177e3={'raw':!![],'where':{}};var _0x4b08f3={};var _0xb9c016={'count':0x0,'rows':[]};return db[_0x7efd('0x2f')]['findOne']({'where':{'id':_0x467cb0['params']['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0xe2d0b8,null))['then'](function(_0x5e2dae){if(_0x5e2dae){_0x4b08f3[_0x7efd('0x31')]=_[_0x7efd('0x33')](db[_0x7efd('0x5d')][_0x7efd('0x30')]);_0x4b08f3[_0x7efd('0x32')]=_[_0x7efd('0x33')](_0x467cb0['query']);_0x4b08f3[_0x7efd('0x34')]=_['intersection'](_0x4b08f3[_0x7efd('0x31')],_0x4b08f3[_0x7efd('0x32')]);_0x2177e3['attributes']=_['intersection'](_0x4b08f3['model'],qs['fields'](_0x467cb0[_0x7efd('0x32')][_0x7efd('0x42')]));_0x2177e3['attributes']=_0x2177e3[_0x7efd('0x36')][_0x7efd('0x43')]?_0x2177e3[_0x7efd('0x36')]:_0x4b08f3['model'];if(!_0x467cb0[_0x7efd('0x32')][_0x7efd('0x37')](_0x7efd('0x56'))){_0x2177e3['limit']=qs[_0x7efd('0x1e')](_0x467cb0[_0x7efd('0x32')][_0x7efd('0x1e')]);_0x2177e3[_0x7efd('0x1c')]=qs[_0x7efd('0x1c')](_0x467cb0['query'][_0x7efd('0x1c')]);}_0x2177e3[_0x7efd('0x59')]=qs['sort'](_0x467cb0[_0x7efd('0x32')][_0x7efd('0x38')]);_0x2177e3[_0x7efd('0x39')]=qs['filters'](_[_0x7efd('0x3a')](_0x467cb0['query'],_0x4b08f3[_0x7efd('0x34')]));_0x2177e3[_0x7efd('0x39')]['CampaignId']=_0x5e2dae['id'];if(_0x467cb0[_0x7efd('0x32')][_0x7efd('0x3b')]){_0x2177e3[_0x7efd('0x39')]=_[_0x7efd('0x3d')](_0x2177e3[_0x7efd('0x39')],{'$or':_[_0x7efd('0x3c')](_0x2177e3['attributes'],function(_0x291a87){var _0x107e20={};_0x107e20[_0x291a87]={'$like':'%'+_0x467cb0[_0x7efd('0x32')][_0x7efd('0x3b')]+'%'};return _0x107e20;})});}_0x2177e3=_[_0x7efd('0x3d')]({},_0x2177e3,_0x467cb0[_0x7efd('0x4e')]);return db[_0x7efd('0x5d')][_0x7efd('0x1f')]({'where':_0x2177e3[_0x7efd('0x39')]})[_0x7efd('0x26')](function(_0x9c4e51){_0xb9c016['count']=_0x9c4e51;if(_0x467cb0[_0x7efd('0x32')]['includeAll']){_0x2177e3[_0x7efd('0x3f')]=[{'all':!![]}];}return db[_0x7efd('0x5d')][_0x7efd('0x40')](_0x2177e3);})['then'](function(_0xa1bcdd){_0xb9c016[_0x7efd('0x41')]=_0xa1bcdd;return _0xb9c016;});}})['then'](respondWithFilteredResult(_0xe2d0b8,_0x2177e3))['catch'](handleError(_0xe2d0b8,null));};exports[_0x7efd('0x5e')]=function(_0x331fa8,_0x1060fa,_0x162380){var _0x26b442={};var _0x201066={};var _0xe4db11;var _0x18f5bb;return db['Campaign']['findOne']({'where':{'id':_0x331fa8['params']['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x1060fa,null))['then'](function(_0x21575c){if(_0x21575c){_0xe4db11=_0x21575c;_0x201066[_0x7efd('0x31')]=_[_0x7efd('0x33')](db['CmList']['rawAttributes']);_0x201066[_0x7efd('0x32')]=_[_0x7efd('0x33')](_0x331fa8['query']);_0x201066[_0x7efd('0x34')]=_[_0x7efd('0x35')](_0x201066[_0x7efd('0x31')],_0x201066[_0x7efd('0x32')]);_0x26b442[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x201066[_0x7efd('0x31')],qs['fields'](_0x331fa8[_0x7efd('0x32')][_0x7efd('0x42')]));_0x26b442['attributes']=_0x26b442[_0x7efd('0x36')][_0x7efd('0x43')]?_0x26b442['attributes']:_0x201066['model'];_0x26b442['order']=qs[_0x7efd('0x38')](_0x331fa8[_0x7efd('0x32')][_0x7efd('0x38')]);_0x26b442[_0x7efd('0x39')]=qs[_0x7efd('0x34')](_[_0x7efd('0x3a')](_0x331fa8[_0x7efd('0x32')],_0x201066[_0x7efd('0x34')]));if(_0x331fa8[_0x7efd('0x32')]['filter']){_0x26b442['where']=_[_0x7efd('0x3d')](_0x26b442['where'],{'$or':_['map'](_0x26b442[_0x7efd('0x36')],function(_0x4d241c){var _0x262fcf={};_0x262fcf[_0x4d241c]={'$like':'%'+_0x331fa8['query'][_0x7efd('0x3b')]+'%'};return _0x262fcf;})});}_0x26b442=_[_0x7efd('0x3d')]({},_0x26b442,_0x331fa8['options']);return _0xe4db11['getLists'](_0x26b442);}})[_0x7efd('0x26')](function(_0x20d025){if(_0x20d025){_0x18f5bb=_0x20d025[_0x7efd('0x43')];if(!_0x331fa8[_0x7efd('0x32')]['hasOwnProperty'](_0x7efd('0x56'))){_0x26b442['limit']=qs[_0x7efd('0x1e')](_0x331fa8['query'][_0x7efd('0x1e')]);_0x26b442['offset']=qs['offset'](_0x331fa8['query'][_0x7efd('0x1c')]);}return _0xe4db11[_0x7efd('0x5e')](_0x26b442);}})[_0x7efd('0x26')](function(_0x14b042){if(_0x14b042){return _0x14b042?{'count':_0x18f5bb,'rows':_0x14b042}:null;}})[_0x7efd('0x26')](respondWithResult(_0x1060fa,null))[_0x7efd('0x45')](handleError(_0x1060fa,null));};exports[_0x7efd('0x5f')]=function(_0x528253,_0x5bc084,_0x5d4d96){var _0x358a22,_0x5be137;var _0x1bd50b=[];var _0x2bd409=moment()[_0x7efd('0x60')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x7efd('0x2f')][_0x7efd('0x44')]({'where':{'id':_0x528253['params']['id']}})['then'](handleEntityNotFound(_0x5bc084,null))[_0x7efd('0x26')](function(_0x4ac3e6){if(_0x4ac3e6){_0x5be137=_0x4ac3e6;return _0x4ac3e6[_0x7efd('0x5f')](_0x528253[_0x7efd('0x47')][_0x7efd('0x61')],_['omit'](_0x528253[_0x7efd('0x47')],[_0x7efd('0x61'),'id'])||{});}return null;})[_0x7efd('0x62')](function(_0x1dc4a){var _0x44dfa9;var _0x47da43;_0x358a22=_0x1dc4a||[];var _0x3bfd24=[];if(_0x1dc4a){for(var _0x13e605=0x0;_0x13e605<_0x1dc4a['length'];_0x13e605+=0x1){var _0x4799fb=_0x1dc4a[_0x13e605][_0x7efd('0x27')]({'plain':!![]});_0x5be137[_0x7efd('0x63')]=_0x528253[_0x7efd('0x47')][_0x7efd('0x63')]?_0x528253['body'][_0x7efd('0x63')]:_0x5be137[_0x7efd('0x63')];switch(_0x5be137[_0x7efd('0x63')]){case'always':_0x44dfa9=squel[_0x7efd('0x64')]()[_0x7efd('0x65')]('cm_hopper')[_0x7efd('0x66')]([_0x7efd('0x67'),_0x7efd('0x68'),_0x7efd('0x69'),_0x7efd('0x6a'),_0x7efd('0x5a'),'createdAt',_0x7efd('0x51')],squel[_0x7efd('0x6b')]()[_0x7efd('0x6c')](_0x7efd('0x67'),'phone')[_0x7efd('0x6c')](_0x7efd('0x6d'),'scheduledAt')[_0x7efd('0x6c')]('id',_0x7efd('0x69'))['field'](_0x4799fb[_0x7efd('0x6e')][_0x7efd('0x6f')](),_0x7efd('0x6a'))[_0x7efd('0x6c')](_0x528253[_0x7efd('0x52')]['id'][_0x7efd('0x6f')](),_0x7efd('0x5a'))['field']('\x27'+_0x2bd409+'\x27',_0x7efd('0x50'))[_0x7efd('0x6c')]('\x27'+_0x2bd409+'\x27','updatedAt')[_0x7efd('0x70')](_0x7efd('0x71'))[_0x7efd('0x39')]('deletedAt\x20IS\x20NULL')['where'](_0x7efd('0x72'),_0x4799fb['CmListId'][_0x7efd('0x6f')]())[_0x7efd('0x39')](_0x7efd('0x73'))[_0x7efd('0x39')](_0x7efd('0x74'),squel[_0x7efd('0x6b')]()[_0x7efd('0x6c')]('COALESCE(calleridnum,\x27\x27)')[_0x7efd('0x70')]('cm_hopper_final')[_0x7efd('0x39')]('CampaignId\x20=\x20?',_0x528253['params']['id'][_0x7efd('0x6f')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x7efd('0x6b')]()['field'](_0x7efd('0x75'))[_0x7efd('0x70')](_0x7efd('0x76'))[_0x7efd('0x39')](_0x7efd('0x77'),_0x528253[_0x7efd('0x52')]['id'][_0x7efd('0x6f')]())))['toString']();break;case'onlyIfOpen':_0x44dfa9=squel[_0x7efd('0x64')]()[_0x7efd('0x65')]('cm_hopper')[_0x7efd('0x66')]([_0x7efd('0x67'),_0x7efd('0x68'),_0x7efd('0x69'),'ListId',_0x7efd('0x5a'),_0x7efd('0x50'),_0x7efd('0x51')],squel[_0x7efd('0x6b')]()[_0x7efd('0x6c')]('phone','phone')['field'](_0x7efd('0x6d'),'scheduledAt')[_0x7efd('0x6c')]('id',_0x7efd('0x69'))[_0x7efd('0x6c')](_0x4799fb[_0x7efd('0x6e')][_0x7efd('0x6f')](),'ListId')[_0x7efd('0x6c')](_0x528253[_0x7efd('0x52')]['id'][_0x7efd('0x6f')](),_0x7efd('0x5a'))[_0x7efd('0x6c')]('\x27'+_0x2bd409+'\x27',_0x7efd('0x50'))[_0x7efd('0x6c')]('\x27'+_0x2bd409+'\x27','updatedAt')[_0x7efd('0x70')](_0x7efd('0x71'))[_0x7efd('0x39')](_0x7efd('0x78'))['where'](_0x7efd('0x72'),_0x4799fb[_0x7efd('0x6e')][_0x7efd('0x6f')]())[_0x7efd('0x39')](_0x7efd('0x73'))[_0x7efd('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7efd('0x6b')]()[_0x7efd('0x6c')]('COALESCE(phone,\x27\x27)')[_0x7efd('0x70')](_0x7efd('0x76'))[_0x7efd('0x39')](_0x7efd('0x77'),_0x528253[_0x7efd('0x52')]['id']['toString']())))['toString']();break;default:_0x44dfa9=squel[_0x7efd('0x64')]()['into'](_0x7efd('0x76'))[_0x7efd('0x66')]([_0x7efd('0x67'),_0x7efd('0x68'),_0x7efd('0x69'),'ListId',_0x7efd('0x5a'),'createdAt','updatedAt'],squel['select']()[_0x7efd('0x6c')](_0x7efd('0x67'),_0x7efd('0x67'))[_0x7efd('0x6c')](_0x7efd('0x6d'),_0x7efd('0x68'))[_0x7efd('0x6c')]('id',_0x7efd('0x69'))[_0x7efd('0x6c')](_0x4799fb[_0x7efd('0x6e')][_0x7efd('0x6f')](),_0x7efd('0x6a'))[_0x7efd('0x6c')](_0x528253['params']['id'][_0x7efd('0x6f')](),_0x7efd('0x5a'))[_0x7efd('0x6c')]('\x27'+_0x2bd409+'\x27',_0x7efd('0x50'))[_0x7efd('0x6c')]('\x27'+_0x2bd409+'\x27',_0x7efd('0x51'))['from'](_0x7efd('0x71'))[_0x7efd('0x39')]('deletedAt\x20IS\x20NULL')[_0x7efd('0x39')]('ListId\x20=\x20?',_0x4799fb[_0x7efd('0x6e')][_0x7efd('0x6f')]())['where'](_0x7efd('0x73')))[_0x7efd('0x6f')]();}_0x47da43=squel[_0x7efd('0x64')]()[_0x7efd('0x65')]('cm_hopper_additional_phones')[_0x7efd('0x66')](['cmHopperId','scheduledAt','phone','OrderBy',_0x7efd('0x50'),_0x7efd('0x51')],squel[_0x7efd('0x6b')]()[_0x7efd('0x6c')](_0x7efd('0x79'),'id')[_0x7efd('0x6c')]('NOW()','scheduledAt')[_0x7efd('0x6c')]('ci.item',_0x7efd('0x67'))[_0x7efd('0x6c')]('ci.OrderBY',_0x7efd('0x7a'))[_0x7efd('0x6c')]('\x27'+_0x2bd409+'\x27',_0x7efd('0x50'))[_0x7efd('0x6c')]('\x27'+_0x2bd409+'\x27',_0x7efd('0x51'))['from'](_0x7efd('0x7b'),'ci')[_0x7efd('0x7c')](_0x7efd('0x76'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0x7efd('0x39')](_0x7efd('0x7d'),_0x4799fb[_0x7efd('0x6e')][_0x7efd('0x6f')]())[_0x7efd('0x39')](_0x7efd('0x7e'),_0x528253[_0x7efd('0x52')]['id']['toString']())[_0x7efd('0x39')]('h.createdAt\x20=\x20?',_0x2bd409))['toString']();_0x3bfd24['push'](db[_0x7efd('0x7f')][_0x7efd('0x32')](_0x44dfa9));_0x1bd50b[_0x7efd('0x80')](db[_0x7efd('0x7f')][_0x7efd('0x32')](_0x47da43));}return BPromise[_0x7efd('0x81')](_0x3bfd24);}})[_0x7efd('0x26')](function(){return BPromise[_0x7efd('0x81')](_0x1bd50b);})['then'](function(){return _0x358a22;})[_0x7efd('0x26')](respondWithResult(_0x5bc084,null))[_0x7efd('0x45')](handleError(_0x5bc084,null));};exports[_0x7efd('0x82')]=function(_0x183027,_0x15eb12,_0x21a185){return db[_0x7efd('0x2f')][_0x7efd('0x44')]({'where':{'id':_0x183027[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x15eb12,null))[_0x7efd('0x26')](function(_0x5e9881){if(_0x5e9881){return _0x5e9881[_0x7efd('0x82')](_0x183027['query'][_0x7efd('0x61')]);}})['then'](function(_0x24c5a2){if(_0x24c5a2){return db[_0x7efd('0x55')][_0x7efd('0x25')]({'where':{'ListId':_0x183027['query'][_0x7efd('0x61')],'CampaignId':_0x183027['params']['id']}})[_0x7efd('0x26')](function(){return _0x24c5a2;});}})[_0x7efd('0x26')](respondWithStatusCode(_0x15eb12,null))[_0x7efd('0x45')](handleError(_0x15eb12,null));};exports[_0x7efd('0x83')]=function(_0xd20f4f,_0x116536,_0xf7fd10){var _0x21ae04={};var _0x3ef568={};var _0x5c766d;var _0x1048d9;return db[_0x7efd('0x2f')][_0x7efd('0x54')]({'where':{'id':_0xd20f4f[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x116536,null))[_0x7efd('0x26')](function(_0xb469b0){if(_0xb469b0){_0x5c766d=_0xb469b0;_0x3ef568[_0x7efd('0x31')]=_[_0x7efd('0x33')](db[_0x7efd('0x84')]['rawAttributes']);_0x3ef568[_0x7efd('0x32')]=_[_0x7efd('0x33')](_0xd20f4f[_0x7efd('0x32')]);_0x3ef568[_0x7efd('0x34')]=_['intersection'](_0x3ef568['model'],_0x3ef568['query']);_0x21ae04[_0x7efd('0x36')]=_[_0x7efd('0x35')](_0x3ef568['model'],qs[_0x7efd('0x42')](_0xd20f4f[_0x7efd('0x32')][_0x7efd('0x42')]));_0x21ae04[_0x7efd('0x36')]=_0x21ae04[_0x7efd('0x36')]['length']?_0x21ae04['attributes']:_0x3ef568[_0x7efd('0x31')];_0x21ae04['order']=qs[_0x7efd('0x38')](_0xd20f4f[_0x7efd('0x32')][_0x7efd('0x38')]);_0x21ae04[_0x7efd('0x39')]=qs['filters'](_[_0x7efd('0x3a')](_0xd20f4f['query'],_0x3ef568[_0x7efd('0x34')]));if(_0xd20f4f['query']['filter']){_0x21ae04['where']=_[_0x7efd('0x3d')](_0x21ae04[_0x7efd('0x39')],{'$or':_[_0x7efd('0x3c')](_0x21ae04[_0x7efd('0x36')],function(_0x2ba999){var _0x382d49={};_0x382d49[_0x2ba999]={'$like':'%'+_0xd20f4f['query'][_0x7efd('0x3b')]+'%'};return _0x382d49;})});}_0x21ae04=_['merge']({},_0x21ae04,_0xd20f4f['options']);return _0x5c766d[_0x7efd('0x83')](_0x21ae04);}})[_0x7efd('0x26')](function(_0x1f8ee9){if(_0x1f8ee9){_0x1048d9=_0x1f8ee9[_0x7efd('0x43')];if(!_0xd20f4f[_0x7efd('0x32')][_0x7efd('0x37')](_0x7efd('0x56'))){_0x21ae04[_0x7efd('0x1e')]=qs['limit'](_0xd20f4f['query']['limit']);_0x21ae04[_0x7efd('0x1c')]=qs[_0x7efd('0x1c')](_0xd20f4f[_0x7efd('0x32')][_0x7efd('0x1c')]);}return _0x5c766d['getBlackLists'](_0x21ae04);}})[_0x7efd('0x26')](function(_0x12f58c){if(_0x12f58c){return _0x12f58c?{'count':_0x1048d9,'rows':_0x12f58c}:null;}})[_0x7efd('0x26')](respondWithResult(_0x116536,null))[_0x7efd('0x45')](handleError(_0x116536,null));};exports[_0x7efd('0x85')]=function(_0x46f959,_0x2c3ddd,_0x557e9f){var _0x34857f,_0x5f1309;var _0x106203=[];var _0x17a6db=moment()[_0x7efd('0x60')](_0x7efd('0x86'));return db['Campaign'][_0x7efd('0x44')]({'where':{'id':_0x46f959[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x2c3ddd,null))[_0x7efd('0x26')](function(_0x44ce02){if(_0x44ce02){_0x5f1309=_0x44ce02;return _0x44ce02[_0x7efd('0x85')](_0x46f959[_0x7efd('0x47')][_0x7efd('0x61')],_[_0x7efd('0x4f')](_0x46f959[_0x7efd('0x47')],['ids','id'])||{});}return null;})[_0x7efd('0x62')](function(_0x47b494){var _0x4887db;var _0x4282d7;_0x34857f=_0x47b494||[];var _0x52d5f9=[];if(_0x47b494){for(var _0x2621d7=0x0;_0x2621d7<_0x47b494[_0x7efd('0x43')];_0x2621d7+=0x1){var _0x5b464f=_0x47b494[_0x2621d7][_0x7efd('0x27')]({'plain':!![]});_0x4887db=squel[_0x7efd('0x64')]()[_0x7efd('0x65')](_0x7efd('0x87'))[_0x7efd('0x66')](['phone',_0x7efd('0x69'),_0x7efd('0x6a'),'CampaignId',_0x7efd('0x50'),_0x7efd('0x51')],squel[_0x7efd('0x6b')]()[_0x7efd('0x6c')](_0x7efd('0x67'),_0x7efd('0x67'))['field']('id',_0x7efd('0x69'))[_0x7efd('0x6c')](_0x5b464f[_0x7efd('0x6e')][_0x7efd('0x6f')](),_0x7efd('0x6a'))[_0x7efd('0x6c')](_0x46f959[_0x7efd('0x52')]['id']['toString'](),'CampaignId')[_0x7efd('0x6c')](_0x7efd('0x6d'),'createdAt')[_0x7efd('0x6c')]('NOW()',_0x7efd('0x51'))['from'](_0x7efd('0x71'))[_0x7efd('0x39')](_0x7efd('0x78'))[_0x7efd('0x39')](_0x7efd('0x72'),_0x5b464f[_0x7efd('0x6e')]['toString']())[_0x7efd('0x39')]('phone\x20IS\x20NOT\x20NULL'))[_0x7efd('0x6f')]();_0x52d5f9['push'](db[_0x7efd('0x7f')][_0x7efd('0x32')](_0x4887db));}return BPromise[_0x7efd('0x81')](_0x52d5f9);}})[_0x7efd('0x26')](function(){return _0x34857f;})[_0x7efd('0x26')](respondWithResult(_0x2c3ddd,null))[_0x7efd('0x45')](handleError(_0x2c3ddd,null));};exports['removeBlackLists']=function(_0x120408,_0x4bbdb5,_0x2b8b52){return db['Campaign'][_0x7efd('0x44')]({'where':{'id':_0x120408[_0x7efd('0x52')]['id']}})[_0x7efd('0x26')](handleEntityNotFound(_0x4bbdb5,null))[_0x7efd('0x26')](function(_0x4188ed){if(_0x4188ed){return _0x4188ed[_0x7efd('0x88')](_0x120408[_0x7efd('0x32')][_0x7efd('0x61')]);}})[_0x7efd('0x26')](function(_0x427263){if(_0x427263){return db['CmHopperBlack'][_0x7efd('0x25')]({'where':{'ListId':_0x120408[_0x7efd('0x32')][_0x7efd('0x61')],'CampaignId':_0x120408[_0x7efd('0x52')]['id']}})['then'](function(){return _0x427263;});}})[_0x7efd('0x26')](respondWithStatusCode(_0x4bbdb5,null))['catch'](handleError(_0x4bbdb5,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 62ce57e..92c85f6 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(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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(_0x87e0dc,_0x577dce){var _0x2cd2d1=function(_0x2d8173){while(--_0x2d8173){_0x87e0dc['push'](_0x87e0dc['shift']());}};_0x2cd2d1(++_0x577dce);}(_0x7a54,0x106));var _0x47a5=function(_0x46a0ef,_0x30e507){_0x46a0ef=_0x46a0ef-0x0;var _0xb91d5a=_0x7a54[_0x46a0ef];return _0xb91d5a;};'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 4fc9068..08ffe06 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 _0x4c4e=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCampaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','moment','bluebird'];(function(_0x385c20,_0xa43d3c){var _0x3787e4=function(_0x5f09bd){while(--_0x5f09bd){_0x385c20['push'](_0x385c20['shift']());}};_0x3787e4(++_0xa43d3c);}(_0x4c4e,0x152));var _0xe4c4=function(_0x41890e,_0x4f16fe){_0x41890e=_0x41890e-0x0;var _0xbfafe4=_0x4c4e[_0x41890e];return _0xbfafe4;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x262b64,_0xad105,_0x22085a){return new BPromise(function(_0x329d29,_0x28a42e){return client[_0xe4c4('0xa')](_0x262b64,_0x22085a)['then'](function(_0x589b2e){logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));logger[_0xe4c4('0xe')](_0xe4c4('0xf'),_0xad105,_0xe4c4('0xd'),JSON['stringify'](_0x589b2e));if(_0x589b2e[_0xe4c4('0x10')]){if(_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x11')]===0x1f4){logger[_0xe4c4('0x10')]('Campaign,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x28a42e(_0x589b2e['error'][_0xe4c4('0x12')]);}logger[_0xe4c4('0x10')]('Campaign,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x329d29(_0x589b2e['error'][_0xe4c4('0x12')]);}else{logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));_0x329d29(_0x589b2e[_0xe4c4('0x13')][_0xe4c4('0x12')]);}})[_0xe4c4('0x14')](function(_0x1038cb){logger[_0xe4c4('0x10')](_0xe4c4('0xc'),_0xad105,_0x1038cb);_0x28a42e(_0x1038cb);});});}exports[_0xe4c4('0x15')]=function(_0x42242c){var _0x3820c7=this;return new Promise(function(_0x43a9ce,_0x376585){return db['Campaign'][_0xe4c4('0x16')]({'raw':_0x42242c[_0xe4c4('0x17')]?_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x18')]===undefined?!![]:![]:!![],'where':_0x42242c['options']?_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x19')]||null:null,'attributes':_0x42242c[_0xe4c4('0x17')]?_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x1a')]||null:null,'limit':_0x42242c[_0xe4c4('0x17')]?_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x1b')]||null:null,'include':_0x42242c[_0xe4c4('0x17')]?_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x1c')]?_[_0xe4c4('0x1d')](_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x1c')],function(_0x15873e){return{'model':db[_0x15873e['model']],'as':_0x15873e['as'],'attributes':_0x15873e['attributes'],'include':_0x15873e[_0xe4c4('0x1c')]?_['map'](_0x15873e[_0xe4c4('0x1c')],function(_0x5374fd){return{'model':db[_0x5374fd[_0xe4c4('0x1e')]],'as':_0x5374fd['as'],'attributes':_0x5374fd['attributes'],'include':_0x5374fd[_0xe4c4('0x1c')]?_['map'](_0x5374fd[_0xe4c4('0x1c')],function(_0x4a0199){return{'model':db[_0x4a0199['model']],'as':_0x4a0199['as'],'attributes':_0x4a0199['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3221cd){logger['info']('GetCampaign',_0x42242c);logger[_0xe4c4('0xe')](_0xe4c4('0x15'),_0x42242c,JSON['stringify'](_0x3221cd));_0x43a9ce(_0x3221cd);})['catch'](function(_0x7428ad){logger[_0xe4c4('0x10')]('GetCampaign',_0x7428ad[_0xe4c4('0x12')],_0x42242c);_0x376585(_0x3820c7[_0xe4c4('0x10')](0x1f4,_0x7428ad[_0xe4c4('0x12')]));});});}; \ No newline at end of file +var _0x6737=['stringify','error','code','message','info','result','GetCampaign','Campaign','options','raw','where','attributes','include','map','model','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','Campaign,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x11e30d,_0x5584aa){var _0x2d4e29=function(_0x2486ce){while(--_0x2486ce){_0x11e30d['push'](_0x11e30d['shift']());}};_0x2d4e29(++_0x5584aa);}(_0x6737,0xe2));var _0x7673=function(_0x275aab,_0x50582a){_0x275aab=_0x275aab-0x0;var _0x1e9eed=_0x6737[_0x275aab];return _0x1e9eed;};'use strict';var _=require('lodash');var util=require(_0x7673('0x0'));var moment=require(_0x7673('0x1'));var BPromise=require('bluebird');var rs=require(_0x7673('0x2'));var fs=require('fs');var Redis=require(_0x7673('0x3'));var db=require(_0x7673('0x4'))['db'];var utils=require(_0x7673('0x5'));var logger=require('../../config/logger')(_0x7673('0x6'));var config=require(_0x7673('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7673('0x8')][_0x7673('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5af802,_0x4e4b24,_0x53d67d){return new BPromise(function(_0x5292f7,_0x285c6d){return client['request'](_0x5af802,_0x53d67d)[_0x7673('0xa')](function(_0x1fb769){logger['info'](_0x7673('0xb'),_0x4e4b24,_0x7673('0xc'));logger[_0x7673('0xd')]('Campaign,\x20%s,\x20%s,\x20%s',_0x4e4b24,'request\x20sent',JSON[_0x7673('0xe')](_0x1fb769));if(_0x1fb769['error']){if(_0x1fb769[_0x7673('0xf')][_0x7673('0x10')]===0x1f4){logger[_0x7673('0xf')](_0x7673('0xb'),_0x4e4b24,_0x1fb769[_0x7673('0xf')][_0x7673('0x11')]);return _0x285c6d(_0x1fb769[_0x7673('0xf')][_0x7673('0x11')]);}logger[_0x7673('0xf')](_0x7673('0xb'),_0x4e4b24,_0x1fb769['error'][_0x7673('0x11')]);return _0x5292f7(_0x1fb769[_0x7673('0xf')][_0x7673('0x11')]);}else{logger[_0x7673('0x12')](_0x7673('0xb'),_0x4e4b24,_0x7673('0xc'));_0x5292f7(_0x1fb769[_0x7673('0x13')]['message']);}})['catch'](function(_0x164d05){logger[_0x7673('0xf')]('Campaign,\x20%s,\x20%s',_0x4e4b24,_0x164d05);_0x285c6d(_0x164d05);});});}exports[_0x7673('0x14')]=function(_0x17699a){var _0x58a821=this;return new Promise(function(_0x33ff7d,_0x44704d){return db[_0x7673('0x15')]['findAll']({'raw':_0x17699a['options']?_0x17699a[_0x7673('0x16')][_0x7673('0x17')]===undefined?!![]:![]:!![],'where':_0x17699a['options']?_0x17699a[_0x7673('0x16')][_0x7673('0x18')]||null:null,'attributes':_0x17699a[_0x7673('0x16')]?_0x17699a[_0x7673('0x16')][_0x7673('0x19')]||null:null,'limit':_0x17699a[_0x7673('0x16')]?_0x17699a['options']['limit']||null:null,'include':_0x17699a[_0x7673('0x16')]?_0x17699a[_0x7673('0x16')][_0x7673('0x1a')]?_[_0x7673('0x1b')](_0x17699a[_0x7673('0x16')]['include'],function(_0x2009e1){return{'model':db[_0x2009e1[_0x7673('0x1c')]],'as':_0x2009e1['as'],'attributes':_0x2009e1[_0x7673('0x19')],'include':_0x2009e1[_0x7673('0x1a')]?_[_0x7673('0x1b')](_0x2009e1[_0x7673('0x1a')],function(_0x538280){return{'model':db[_0x538280[_0x7673('0x1c')]],'as':_0x538280['as'],'attributes':_0x538280[_0x7673('0x19')],'include':_0x538280[_0x7673('0x1a')]?_[_0x7673('0x1b')](_0x538280['include'],function(_0x5e2cd7){return{'model':db[_0x5e2cd7[_0x7673('0x1c')]],'as':_0x5e2cd7['as'],'attributes':_0x5e2cd7[_0x7673('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7673('0xa')](function(_0x9d9eab){logger[_0x7673('0x12')](_0x7673('0x14'),_0x17699a);logger[_0x7673('0xd')]('GetCampaign',_0x17699a,JSON['stringify'](_0x9d9eab));_0x33ff7d(_0x9d9eab);})[_0x7673('0x1d')](function(_0x2d4c0a){logger[_0x7673('0xf')](_0x7673('0x14'),_0x2d4c0a[_0x7673('0x11')],_0x17699a);_0x44704d(_0x58a821[_0x7673('0xf')](0x1f4,_0x2d4c0a[_0x7673('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 708a7a5..084fa12 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 _0xbf0b=['/:id/clone','addLists','addBlackLists','/:id','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post'];(function(_0xe58ae2,_0x30a065){var _0x369b69=function(_0xa6a029){while(--_0xa6a029){_0xe58ae2['push'](_0xe58ae2['shift']());}};_0x369b69(++_0x30a065);}(_0xbf0b,0x16a));var _0xbbf0=function(_0x1ee4e9,_0x3f6b36){_0x1ee4e9=_0x1ee4e9-0x0;var _0x587b6a=_0xbf0b[_0x1ee4e9];return _0x587b6a;};'use strict';var multer=require(_0xbbf0('0x0'));var util=require(_0xbbf0('0x1'));var path=require(_0xbbf0('0x2'));var timeout=require(_0xbbf0('0x3'));var express=require('express');var router=express[_0xbbf0('0x4')]();var fs_extra=require(_0xbbf0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbbf0('0x6'));var config=require(_0xbbf0('0x7'));var controller=require('./campaign.controller');router[_0xbbf0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbbf0('0x8')]('/:id',auth[_0xbbf0('0x9')](),controller['show']);router[_0xbbf0('0x8')](_0xbbf0('0xa'),auth['isAuthenticated'](),controller[_0xbbf0('0xb')]);router[_0xbbf0('0x8')](_0xbbf0('0xc'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0xd')]);router[_0xbbf0('0x8')](_0xbbf0('0xe'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0xf')]);router['get'](_0xbbf0('0x10'),auth[_0xbbf0('0x9')](),controller['getHopperBlacks']);router[_0xbbf0('0x8')](_0xbbf0('0x11'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0x12')]);router[_0xbbf0('0x8')](_0xbbf0('0x13'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0x14')]);router[_0xbbf0('0x15')]('/',auth[_0xbbf0('0x9')](),controller['create']);router[_0xbbf0('0x15')](_0xbbf0('0x16'),auth[_0xbbf0('0x9')](),controller['clone']);router[_0xbbf0('0x15')](_0xbbf0('0x11'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0x17')]);router[_0xbbf0('0x15')](_0xbbf0('0x13'),auth['isAuthenticated'](),controller[_0xbbf0('0x18')]);router['put'](_0xbbf0('0x19'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0x1a')]);router[_0xbbf0('0x1b')](_0xbbf0('0x19'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0x1c')]);router[_0xbbf0('0x1b')](_0xbbf0('0x11'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0x1d')]);router[_0xbbf0('0x1b')](_0xbbf0('0x13'),auth['isAuthenticated'](),controller[_0xbbf0('0x1e')]);module[_0xbbf0('0x1f')]=router; \ No newline at end of file +var _0x3870=['update','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','/:id'];(function(_0x31344b,_0x12d6d0){var _0x15012d=function(_0x5e82b5){while(--_0x5e82b5){_0x31344b['push'](_0x31344b['shift']());}};_0x15012d(++_0x12d6d0);}(_0x3870,0x15b));var _0x0387=function(_0x4ce6fa,_0x26a348){_0x4ce6fa=_0x4ce6fa-0x0;var _0xcd00be=_0x3870[_0x4ce6fa];return _0xcd00be;};'use strict';var multer=require(_0x0387('0x0'));var util=require(_0x0387('0x1'));var path=require(_0x0387('0x2'));var timeout=require(_0x0387('0x3'));var express=require(_0x0387('0x4'));var router=express[_0x0387('0x5')]();var fs_extra=require(_0x0387('0x6'));var auth=require(_0x0387('0x7'));var interaction=require(_0x0387('0x8'));var config=require(_0x0387('0x9'));var controller=require(_0x0387('0xa'));router[_0x0387('0xb')]('/',auth[_0x0387('0xc')](),controller[_0x0387('0xd')]);router['get']('/:id',auth[_0x0387('0xc')](),controller[_0x0387('0xe')]);router['get'](_0x0387('0xf'),auth[_0x0387('0xc')](),controller[_0x0387('0x10')]);router[_0x0387('0xb')](_0x0387('0x11'),auth['isAuthenticated'](),controller[_0x0387('0x12')]);router[_0x0387('0xb')]('/:id/hopper_finals',auth[_0x0387('0xc')](),controller[_0x0387('0x13')]);router['get'](_0x0387('0x14'),auth['isAuthenticated'](),controller[_0x0387('0x15')]);router[_0x0387('0xb')]('/:id/lists',auth[_0x0387('0xc')](),controller[_0x0387('0x16')]);router[_0x0387('0xb')](_0x0387('0x17'),auth[_0x0387('0xc')](),controller[_0x0387('0x18')]);router[_0x0387('0x19')]('/',auth[_0x0387('0xc')](),controller['create']);router['post'](_0x0387('0x1a'),auth['isAuthenticated'](),controller[_0x0387('0x1b')]);router[_0x0387('0x19')](_0x0387('0x1c'),auth[_0x0387('0xc')](),controller[_0x0387('0x1d')]);router[_0x0387('0x19')](_0x0387('0x17'),auth[_0x0387('0xc')](),controller[_0x0387('0x1e')]);router[_0x0387('0x1f')](_0x0387('0x20'),auth[_0x0387('0xc')](),controller[_0x0387('0x21')]);router[_0x0387('0x22')](_0x0387('0x20'),auth[_0x0387('0xc')](),controller['destroy']);router[_0x0387('0x22')](_0x0387('0x1c'),auth[_0x0387('0xc')](),controller[_0x0387('0x23')]);router[_0x0387('0x22')]('/:id/blacklists',auth[_0x0387('0xc')](),controller[_0x0387('0x24')]);module[_0x0387('0x25')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 90ae4ed..47b8607 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 _0x23d8=['key','sequelize','exports','TEXT','STRING','VIRTUAL','getDataValue'];(function(_0x1fc183,_0x9e2637){var _0x1301d5=function(_0x3fd342){while(--_0x3fd342){_0x1fc183['push'](_0x1fc183['shift']());}};_0x1301d5(++_0x9e2637);}(_0x23d8,0x127));var _0x823d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x23d8[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x823d('0x0'));module[_0x823d('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x823d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x823d('0x3')]},'name':{'type':Sequelize[_0x823d('0x4')],'get':function(){return this[_0x823d('0x5')](_0x823d('0x6'));}}}; \ No newline at end of file +var _0x22a9=['TEXT','STRING','VIRTUAL','key','sequelize','exports'];(function(_0x54283c,_0xcfb7a7){var _0x3d32fb=function(_0x1fb34f){while(--_0x1fb34f){_0x54283c['push'](_0x54283c['shift']());}};_0x3d32fb(++_0xcfb7a7);}(_0x22a9,0x1a2));var _0x922a=function(_0x3c6d53,_0x9e0f36){_0x3c6d53=_0x3c6d53-0x0;var _0x36fc1a=_0x22a9[_0x3c6d53];return _0x36fc1a;};'use strict';var Sequelize=require(_0x922a('0x0'));module[_0x922a('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x922a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x922a('0x3')]},'name':{'type':Sequelize[_0x922a('0x4')],'get':function(){return this['getDataValue'](_0x922a('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index f6b55be..cc0bde2 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 _0xcff4=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','catch','show','params','length','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x44f45c,_0x47c0d9){var _0x48de2c=function(_0x3a6045){while(--_0x3a6045){_0x44f45c['push'](_0x44f45c['shift']());}};_0x48de2c(++_0x47c0d9);}(_0xcff4,0x9c));var _0x4cff=function(_0xabbb9b,_0x1417cc){_0xabbb9b=_0xabbb9b-0x0;var _0x306a4e=_0xcff4[_0xabbb9b];return _0x306a4e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4cff('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4cff('0x1'));var rp=require('request-promise');var moment=require(_0x4cff('0x2'));var BPromise=require(_0x4cff('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4cff('0x4'));var sox=require(_0x4cff('0x5'));var csv=require(_0x4cff('0x6'));var ejs=require(_0x4cff('0x7'));var fs=require('fs');var fs_extra=require(_0x4cff('0x8'));var _=require('lodash');var squel=require(_0x4cff('0x9'));var crypto=require(_0x4cff('0xa'));var jsforce=require(_0x4cff('0xb'));var deskjs=require(_0x4cff('0xc'));var toCsv=require(_0x4cff('0x6'));var querystring=require(_0x4cff('0xd'));var Papa=require(_0x4cff('0xe'));var Redis=require('ioredis');var authService=require(_0x4cff('0xf'));var qs=require(_0x4cff('0x10'));var as=require(_0x4cff('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4cff('0x12'))('api');var utils=require(_0x4cff('0x13'));var config=require(_0x4cff('0x14'));var licenseUtil=require(_0x4cff('0x15'));var db=require(_0x4cff('0x16'))['db'];function respondWithStatusCode(_0xbea3c1,_0x56c70c){_0x56c70c=_0x56c70c||0xcc;return function(_0x13304a){if(_0x13304a){return _0xbea3c1['sendStatus'](_0x56c70c);}return _0xbea3c1[_0x4cff('0x17')](_0x56c70c)[_0x4cff('0x18')]();};}function respondWithResult(_0x47dd6a,_0x4fa008){_0x4fa008=_0x4fa008||0xc8;return function(_0xf25e8a){if(_0xf25e8a){return _0x47dd6a[_0x4cff('0x17')](_0x4fa008)[_0x4cff('0x19')](_0xf25e8a);}};}function respondWithFilteredResult(_0x5bab79,_0x2aaab4){return function(_0x1f861c){if(_0x1f861c){var _0x583fd6=typeof _0x2aaab4[_0x4cff('0x1a')]===_0x4cff('0x1b')&&typeof _0x2aaab4[_0x4cff('0x1c')]===_0x4cff('0x1b');var _0x5632df=_0x1f861c['count'];var _0x4bdeaf=_0x583fd6?0x0:_0x2aaab4[_0x4cff('0x1a')];var _0x23c8b1=_0x583fd6?_0x1f861c['count']:_0x2aaab4['offset']+_0x2aaab4[_0x4cff('0x1c')];var _0x345fd5;if(_0x23c8b1>=_0x5632df){_0x23c8b1=_0x5632df;_0x345fd5=0xc8;}else{_0x345fd5=0xce;}_0x5bab79[_0x4cff('0x17')](_0x345fd5);return _0x5bab79['set']('Content-Range',_0x4bdeaf+'-'+_0x23c8b1+'/'+_0x5632df)[_0x4cff('0x19')](_0x1f861c);}return null;};}function patchUpdates(_0x5b1cca){return function(_0x51a2da){try{jsonpatch[_0x4cff('0x1d')](_0x51a2da,_0x5b1cca,!![]);}catch(_0x14c941){return BPromise[_0x4cff('0x1e')](_0x14c941);}return _0x51a2da['save']();};}function saveUpdates(_0x5dad64,_0x4a6a72){return function(_0xf9098e){if(_0xf9098e){return _0xf9098e[_0x4cff('0x1f')](_0x5dad64)[_0x4cff('0x20')](function(_0x2a587a){return _0x2a587a;});}return null;};}function removeEntity(_0x47bdb8,_0x41a439){return function(_0x241761){if(_0x241761){return _0x241761[_0x4cff('0x21')]()['then'](function(){var _0x1a0080=_0x241761['get']({'plain':!![]});var _0x214d71='CannedAnswers';return db['UserProfileResource'][_0x4cff('0x21')]({'where':{'type':_0x214d71,'resourceId':_0x1a0080['id']}})[_0x4cff('0x20')](function(){return _0x241761;});})[_0x4cff('0x20')](function(){_0x47bdb8[_0x4cff('0x17')](0xcc)[_0x4cff('0x18')]();});}};}function handleEntityNotFound(_0x110d81,_0x1f1248){return function(_0x2f0eef){if(!_0x2f0eef){_0x110d81[_0x4cff('0x22')](0x194);}return _0x2f0eef;};}function handleError(_0x1e941f,_0x1f1e10){_0x1f1e10=_0x1f1e10||0x1f4;return function(_0x19a34e){logger[_0x4cff('0x23')](_0x19a34e[_0x4cff('0x24')]);if(_0x19a34e[_0x4cff('0x25')]){delete _0x19a34e[_0x4cff('0x25')];}_0x1e941f['status'](_0x1f1e10)[_0x4cff('0x26')](_0x19a34e);};}exports[_0x4cff('0x27')]=function(_0x46cbcb,_0x5c5a02){var _0x303790={},_0x24206c={},_0x1ef498={'count':0x0,'rows':[]};var _0x10cc98=_[_0x4cff('0x28')](db[_0x4cff('0x29')][_0x4cff('0x2a')],function(_0x475b78){return{'name':_0x475b78[_0x4cff('0x2b')],'type':_0x475b78['type'][_0x4cff('0x2c')]};});_0x24206c['model']=_[_0x4cff('0x28')](_0x10cc98,_0x4cff('0x25'));_0x24206c['query']=_[_0x4cff('0x2d')](_0x46cbcb[_0x4cff('0x2e')]);_0x24206c[_0x4cff('0x2f')]=_[_0x4cff('0x30')](_0x24206c[_0x4cff('0x31')],_0x24206c[_0x4cff('0x2e')]);_0x303790[_0x4cff('0x32')]=_['intersection'](_0x24206c[_0x4cff('0x31')],qs[_0x4cff('0x33')](_0x46cbcb[_0x4cff('0x2e')][_0x4cff('0x33')]));_0x303790[_0x4cff('0x32')]=_0x303790[_0x4cff('0x32')]['length']?_0x303790[_0x4cff('0x32')]:_0x24206c[_0x4cff('0x31')];if(!_0x46cbcb['query'][_0x4cff('0x34')]('nolimit')){_0x303790['limit']=qs[_0x4cff('0x1c')](_0x46cbcb[_0x4cff('0x2e')][_0x4cff('0x1c')]);_0x303790[_0x4cff('0x1a')]=qs[_0x4cff('0x1a')](_0x46cbcb[_0x4cff('0x2e')][_0x4cff('0x1a')]);}_0x303790[_0x4cff('0x35')]=qs[_0x4cff('0x36')](_0x46cbcb[_0x4cff('0x2e')][_0x4cff('0x36')]);_0x303790[_0x4cff('0x37')]=qs[_0x4cff('0x2f')](_[_0x4cff('0x38')](_0x46cbcb[_0x4cff('0x2e')],_0x24206c['filters']),_0x10cc98);if(_0x46cbcb[_0x4cff('0x2e')][_0x4cff('0x39')]){_0x303790[_0x4cff('0x37')]=_[_0x4cff('0x3a')](_0x303790[_0x4cff('0x37')],{'$or':[{'key':{'$like':'%'+_0x46cbcb['query'][_0x4cff('0x39')]+'%'}},{'value':{'$like':'%'+_0x46cbcb[_0x4cff('0x2e')]['filter']+'%'}}]});}_0x303790=_[_0x4cff('0x3a')]({},_0x303790,_0x46cbcb[_0x4cff('0x3b')]);var _0x202035={'where':_0x303790[_0x4cff('0x37')]};return db[_0x4cff('0x29')][_0x4cff('0x3c')](_0x202035)[_0x4cff('0x20')](function(_0x909bb8){_0x1ef498[_0x4cff('0x3c')]=_0x909bb8;if(_0x46cbcb[_0x4cff('0x2e')][_0x4cff('0x3d')]){_0x303790[_0x4cff('0x3e')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4cff('0x3f')](_0x303790);})[_0x4cff('0x20')](function(_0x4990ea){_0x1ef498['rows']=_0x4990ea;return _0x1ef498;})[_0x4cff('0x20')](respondWithFilteredResult(_0x5c5a02,_0x303790))[_0x4cff('0x40')](handleError(_0x5c5a02,null));};exports[_0x4cff('0x41')]=function(_0x300d2f,_0x47cc22){var _0x21548e={'raw':!![],'where':{'id':_0x300d2f[_0x4cff('0x42')]['id']}},_0x494b9f={};_0x494b9f[_0x4cff('0x31')]=_[_0x4cff('0x2d')](db[_0x4cff('0x29')][_0x4cff('0x2a')]);_0x494b9f['query']=_[_0x4cff('0x2d')](_0x300d2f[_0x4cff('0x2e')]);_0x494b9f[_0x4cff('0x2f')]=_[_0x4cff('0x30')](_0x494b9f[_0x4cff('0x31')],_0x494b9f[_0x4cff('0x2e')]);_0x21548e[_0x4cff('0x32')]=_[_0x4cff('0x30')](_0x494b9f['model'],qs[_0x4cff('0x33')](_0x300d2f[_0x4cff('0x2e')][_0x4cff('0x33')]));_0x21548e[_0x4cff('0x32')]=_0x21548e[_0x4cff('0x32')][_0x4cff('0x43')]?_0x21548e[_0x4cff('0x32')]:_0x494b9f[_0x4cff('0x31')];if(_0x300d2f[_0x4cff('0x2e')][_0x4cff('0x3d')]){_0x21548e[_0x4cff('0x3e')]=[{'all':!![]}];}_0x21548e=_[_0x4cff('0x3a')]({},_0x21548e,_0x300d2f[_0x4cff('0x3b')]);return db[_0x4cff('0x29')][_0x4cff('0x44')](_0x21548e)[_0x4cff('0x20')](handleEntityNotFound(_0x47cc22,null))[_0x4cff('0x20')](respondWithResult(_0x47cc22,null))[_0x4cff('0x40')](handleError(_0x47cc22,null));};exports[_0x4cff('0x1f')]=function(_0x51b6f9,_0x46e6a4){if(_0x51b6f9[_0x4cff('0x45')]['id']){delete _0x51b6f9['body']['id'];}return db[_0x4cff('0x29')][_0x4cff('0x44')]({'where':{'id':_0x51b6f9[_0x4cff('0x42')]['id']}})[_0x4cff('0x20')](handleEntityNotFound(_0x46e6a4,null))[_0x4cff('0x20')](saveUpdates(_0x51b6f9[_0x4cff('0x45')],null))[_0x4cff('0x20')](respondWithResult(_0x46e6a4,null))[_0x4cff('0x40')](handleError(_0x46e6a4,null));};exports[_0x4cff('0x21')]=function(_0x2693e8,_0x2c8506){return db['CannedAnswer'][_0x4cff('0x44')]({'where':{'id':_0x2693e8[_0x4cff('0x42')]['id']}})['then'](handleEntityNotFound(_0x2c8506,null))[_0x4cff('0x20')](removeEntity(_0x2c8506,null))['catch'](handleError(_0x2c8506,null));};exports['create']=function(_0x10209f,_0x465bb2){var _0x17731b={'key':_0x10209f[_0x4cff('0x45')][_0x4cff('0x2c')]};if(_0x10209f[_0x4cff('0x45')]['MailAccountId']){_0x17731b[_0x4cff('0x46')]=_0x10209f[_0x4cff('0x45')][_0x4cff('0x46')];}else if(_0x10209f[_0x4cff('0x45')][_0x4cff('0x47')]){_0x17731b[_0x4cff('0x47')]=_0x10209f['body'][_0x4cff('0x47')];}else if(_0x10209f[_0x4cff('0x45')][_0x4cff('0x48')]){_0x17731b[_0x4cff('0x48')]=_0x10209f['body']['OpenchannelAccountId'];}else if(_0x10209f['body'][_0x4cff('0x49')]){_0x17731b['ChatWebsiteId']=_0x10209f[_0x4cff('0x45')]['ChatWebsiteId'];}return db['CannedAnswer']['find']({'where':_0x17731b})[_0x4cff('0x20')](function(_0x29ffbc){if(_0x29ffbc){throw new db[(_0x4cff('0x4a'))][(_0x4cff('0x4b'))](_0x4cff('0x4c'));}return db['CannedAnswer'][_0x4cff('0x4d')](_0x10209f[_0x4cff('0x45')]);})[_0x4cff('0x20')](function(_0x14cd6a){var _0x55e946=_0x10209f[_0x4cff('0x4e')][_0x4cff('0x4f')]({'plain':!![]});if(!_0x55e946)throw new Error(_0x4cff('0x50'));if(_0x55e946[_0x4cff('0x51')]===_0x4cff('0x4e')){var _0x5ad994=_0x14cd6a[_0x4cff('0x4f')]({'plain':!![]});return db[_0x4cff('0x52')]['find']({'where':{'name':_0x4cff('0x53'),'userProfileId':_0x55e946[_0x4cff('0x54')]},'raw':!![]})[_0x4cff('0x20')](function(_0x5a06da){if(_0x5a06da&&_0x5a06da['autoAssociation']===0x0){return db['UserProfileResource'][_0x4cff('0x4d')]({'name':_0x5ad994[_0x4cff('0x25')],'resourceId':_0x5ad994['id'],'type':_0x5a06da['name'],'sectionId':_0x5a06da['id']},{})['then'](function(){return _0x14cd6a;});}else{return _0x14cd6a;}})['catch'](function(_0x3ab95c){logger[_0x4cff('0x23')](_0x4cff('0x55'),_0x3ab95c);throw _0x3ab95c;});}return _0x14cd6a;})[_0x4cff('0x20')](respondWithResult(_0x465bb2,0xc9))[_0x4cff('0x40')](handleError(_0x465bb2,null));}; \ No newline at end of file +var _0xa42b=['MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','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','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','name','send','index','map','CannedAnswer','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','includeAll','include','rows','show','options','find','catch','body','params','create'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0xa42b,0xbd));var _0xba42=function(_0x407fb6,_0x4676d5){_0x407fb6=_0x407fb6-0x0;var _0x2a1454=_0xa42b[_0x407fb6];return _0x2a1454;};'use strict';var emlformat=require(_0xba42('0x0'));var rimraf=require(_0xba42('0x1'));var zipdir=require(_0xba42('0x2'));var jsonpatch=require(_0xba42('0x3'));var rp=require(_0xba42('0x4'));var moment=require('moment');var BPromise=require(_0xba42('0x5'));var Mustache=require(_0xba42('0x6'));var util=require(_0xba42('0x7'));var path=require(_0xba42('0x8'));var sox=require(_0xba42('0x9'));var csv=require('to-csv');var ejs=require(_0xba42('0xa'));var fs=require('fs');var fs_extra=require(_0xba42('0xb'));var _=require(_0xba42('0xc'));var squel=require('squel');var crypto=require(_0xba42('0xd'));var jsforce=require(_0xba42('0xe'));var deskjs=require(_0xba42('0xf'));var toCsv=require('to-csv');var querystring=require(_0xba42('0x10'));var Papa=require(_0xba42('0x11'));var Redis=require(_0xba42('0x12'));var authService=require(_0xba42('0x13'));var qs=require(_0xba42('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xba42('0x15'))(_0xba42('0x16'));var utils=require(_0xba42('0x17'));var config=require(_0xba42('0x18'));var licenseUtil=require(_0xba42('0x19'));var db=require(_0xba42('0x1a'))['db'];function respondWithStatusCode(_0x42efba,_0x6b24e8){_0x6b24e8=_0x6b24e8||0xcc;return function(_0x2afdd1){if(_0x2afdd1){return _0x42efba['sendStatus'](_0x6b24e8);}return _0x42efba[_0xba42('0x1b')](_0x6b24e8)[_0xba42('0x1c')]();};}function respondWithResult(_0x108455,_0x26be70){_0x26be70=_0x26be70||0xc8;return function(_0x3a2b3e){if(_0x3a2b3e){return _0x108455[_0xba42('0x1b')](_0x26be70)[_0xba42('0x1d')](_0x3a2b3e);}};}function respondWithFilteredResult(_0x2e2199,_0x16b747){return function(_0x951a9c){if(_0x951a9c){var _0x4d5ba8=typeof _0x16b747[_0xba42('0x1e')]===_0xba42('0x1f')&&typeof _0x16b747['limit']==='undefined';var _0x5ebb4d=_0x951a9c[_0xba42('0x20')];var _0x319934=_0x4d5ba8?0x0:_0x16b747[_0xba42('0x1e')];var _0x1c6218=_0x4d5ba8?_0x951a9c[_0xba42('0x20')]:_0x16b747[_0xba42('0x1e')]+_0x16b747[_0xba42('0x21')];var _0x304808;if(_0x1c6218>=_0x5ebb4d){_0x1c6218=_0x5ebb4d;_0x304808=0xc8;}else{_0x304808=0xce;}_0x2e2199[_0xba42('0x1b')](_0x304808);return _0x2e2199[_0xba42('0x22')](_0xba42('0x23'),_0x319934+'-'+_0x1c6218+'/'+_0x5ebb4d)['json'](_0x951a9c);}return null;};}function patchUpdates(_0xe8cca1){return function(_0x30e056){try{jsonpatch[_0xba42('0x24')](_0x30e056,_0xe8cca1,!![]);}catch(_0x3d76f5){return BPromise[_0xba42('0x25')](_0x3d76f5);}return _0x30e056[_0xba42('0x26')]();};}function saveUpdates(_0x95d37e,_0xed900f){return function(_0x213f95){if(_0x213f95){return _0x213f95[_0xba42('0x27')](_0x95d37e)[_0xba42('0x28')](function(_0x2f4961){return _0x2f4961;});}return null;};}function removeEntity(_0x55804b,_0x30d785){return function(_0x2e700e){if(_0x2e700e){return _0x2e700e[_0xba42('0x29')]()['then'](function(){var _0x3f6a62=_0x2e700e[_0xba42('0x2a')]({'plain':!![]});var _0x2f4271=_0xba42('0x2b');return db[_0xba42('0x2c')]['destroy']({'where':{'type':_0x2f4271,'resourceId':_0x3f6a62['id']}})[_0xba42('0x28')](function(){return _0x2e700e;});})['then'](function(){_0x55804b[_0xba42('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c7a63,_0x3a4edc){return function(_0x55f980){if(!_0x55f980){_0x4c7a63[_0xba42('0x2d')](0x194);}return _0x55f980;};}function handleError(_0x472d01,_0x1eddfa){_0x1eddfa=_0x1eddfa||0x1f4;return function(_0x1284df){logger[_0xba42('0x2e')](_0x1284df['stack']);if(_0x1284df[_0xba42('0x2f')]){delete _0x1284df[_0xba42('0x2f')];}_0x472d01['status'](_0x1eddfa)[_0xba42('0x30')](_0x1284df);};}exports[_0xba42('0x31')]=function(_0x2d39d7,_0x5d9356){var _0xe90a1b={},_0x548b3b={},_0x2ae5cd={'count':0x0,'rows':[]};var _0x86b858=_[_0xba42('0x32')](db[_0xba42('0x33')]['rawAttributes'],function(_0x10ea13){return{'name':_0x10ea13[_0xba42('0x34')],'type':_0x10ea13['type'][_0xba42('0x35')]};});_0x548b3b['model']=_[_0xba42('0x32')](_0x86b858,'name');_0x548b3b[_0xba42('0x36')]=_[_0xba42('0x37')](_0x2d39d7['query']);_0x548b3b[_0xba42('0x38')]=_[_0xba42('0x39')](_0x548b3b[_0xba42('0x3a')],_0x548b3b[_0xba42('0x36')]);_0xe90a1b[_0xba42('0x3b')]=_[_0xba42('0x39')](_0x548b3b[_0xba42('0x3a')],qs[_0xba42('0x3c')](_0x2d39d7[_0xba42('0x36')][_0xba42('0x3c')]));_0xe90a1b[_0xba42('0x3b')]=_0xe90a1b[_0xba42('0x3b')][_0xba42('0x3d')]?_0xe90a1b[_0xba42('0x3b')]:_0x548b3b['model'];if(!_0x2d39d7[_0xba42('0x36')][_0xba42('0x3e')]('nolimit')){_0xe90a1b[_0xba42('0x21')]=qs[_0xba42('0x21')](_0x2d39d7['query'][_0xba42('0x21')]);_0xe90a1b['offset']=qs['offset'](_0x2d39d7[_0xba42('0x36')][_0xba42('0x1e')]);}_0xe90a1b['order']=qs[_0xba42('0x3f')](_0x2d39d7['query'][_0xba42('0x3f')]);_0xe90a1b['where']=qs[_0xba42('0x38')](_[_0xba42('0x40')](_0x2d39d7[_0xba42('0x36')],_0x548b3b[_0xba42('0x38')]),_0x86b858);if(_0x2d39d7[_0xba42('0x36')][_0xba42('0x41')]){_0xe90a1b[_0xba42('0x42')]=_[_0xba42('0x43')](_0xe90a1b[_0xba42('0x42')],{'$or':[{'key':{'$like':'%'+_0x2d39d7['query']['filter']+'%'}},{'value':{'$like':'%'+_0x2d39d7[_0xba42('0x36')][_0xba42('0x41')]+'%'}}]});}_0xe90a1b=_['merge']({},_0xe90a1b,_0x2d39d7['options']);var _0x5da0b1={'where':_0xe90a1b[_0xba42('0x42')]};return db[_0xba42('0x33')]['count'](_0x5da0b1)['then'](function(_0x38d1a5){_0x2ae5cd[_0xba42('0x20')]=_0x38d1a5;if(_0x2d39d7['query'][_0xba42('0x44')]){_0xe90a1b[_0xba42('0x45')]=[{'all':!![]}];}return db[_0xba42('0x33')]['findAll'](_0xe90a1b);})['then'](function(_0x190d0f){_0x2ae5cd[_0xba42('0x46')]=_0x190d0f;return _0x2ae5cd;})['then'](respondWithFilteredResult(_0x5d9356,_0xe90a1b))['catch'](handleError(_0x5d9356,null));};exports[_0xba42('0x47')]=function(_0x11972c,_0x1bc1d2){var _0x5ed842={'raw':!![],'where':{'id':_0x11972c['params']['id']}},_0x2569c3={};_0x2569c3[_0xba42('0x3a')]=_[_0xba42('0x37')](db['CannedAnswer']['rawAttributes']);_0x2569c3['query']=_['keys'](_0x11972c[_0xba42('0x36')]);_0x2569c3[_0xba42('0x38')]=_[_0xba42('0x39')](_0x2569c3[_0xba42('0x3a')],_0x2569c3[_0xba42('0x36')]);_0x5ed842['attributes']=_['intersection'](_0x2569c3[_0xba42('0x3a')],qs[_0xba42('0x3c')](_0x11972c[_0xba42('0x36')][_0xba42('0x3c')]));_0x5ed842[_0xba42('0x3b')]=_0x5ed842[_0xba42('0x3b')][_0xba42('0x3d')]?_0x5ed842[_0xba42('0x3b')]:_0x2569c3[_0xba42('0x3a')];if(_0x11972c[_0xba42('0x36')]['includeAll']){_0x5ed842['include']=[{'all':!![]}];}_0x5ed842=_['merge']({},_0x5ed842,_0x11972c[_0xba42('0x48')]);return db['CannedAnswer'][_0xba42('0x49')](_0x5ed842)[_0xba42('0x28')](handleEntityNotFound(_0x1bc1d2,null))[_0xba42('0x28')](respondWithResult(_0x1bc1d2,null))[_0xba42('0x4a')](handleError(_0x1bc1d2,null));};exports[_0xba42('0x27')]=function(_0x2127ef,_0x5bd334){if(_0x2127ef['body']['id']){delete _0x2127ef[_0xba42('0x4b')]['id'];}return db[_0xba42('0x33')][_0xba42('0x49')]({'where':{'id':_0x2127ef[_0xba42('0x4c')]['id']}})[_0xba42('0x28')](handleEntityNotFound(_0x5bd334,null))[_0xba42('0x28')](saveUpdates(_0x2127ef[_0xba42('0x4b')],null))[_0xba42('0x28')](respondWithResult(_0x5bd334,null))[_0xba42('0x4a')](handleError(_0x5bd334,null));};exports[_0xba42('0x29')]=function(_0x4ad92f,_0x3df239){return db[_0xba42('0x33')][_0xba42('0x49')]({'where':{'id':_0x4ad92f[_0xba42('0x4c')]['id']}})[_0xba42('0x28')](handleEntityNotFound(_0x3df239,null))[_0xba42('0x28')](removeEntity(_0x3df239,null))[_0xba42('0x4a')](handleError(_0x3df239,null));};exports[_0xba42('0x4d')]=function(_0xc4ab0f,_0x12d743){var _0x3d2360={'key':_0xc4ab0f[_0xba42('0x4b')][_0xba42('0x35')]};if(_0xc4ab0f[_0xba42('0x4b')]['MailAccountId']){_0x3d2360[_0xba42('0x4e')]=_0xc4ab0f[_0xba42('0x4b')]['MailAccountId'];}else if(_0xc4ab0f[_0xba42('0x4b')][_0xba42('0x4f')]){_0x3d2360[_0xba42('0x4f')]=_0xc4ab0f[_0xba42('0x4b')][_0xba42('0x4f')];}else if(_0xc4ab0f[_0xba42('0x4b')][_0xba42('0x50')]){_0x3d2360[_0xba42('0x50')]=_0xc4ab0f[_0xba42('0x4b')][_0xba42('0x50')];}else if(_0xc4ab0f['body']['ChatWebsiteId']){_0x3d2360['ChatWebsiteId']=_0xc4ab0f[_0xba42('0x4b')][_0xba42('0x51')];}return db['CannedAnswer'][_0xba42('0x49')]({'where':_0x3d2360})[_0xba42('0x28')](function(_0xc4add9){if(_0xc4add9){throw new db[(_0xba42('0x52'))][(_0xba42('0x53'))](_0xba42('0x54'));}return db[_0xba42('0x33')][_0xba42('0x4d')](_0xc4ab0f[_0xba42('0x4b')]);})[_0xba42('0x28')](function(_0x17f622){var _0x43d7c5=_0xc4ab0f[_0xba42('0x55')][_0xba42('0x2a')]({'plain':!![]});if(!_0x43d7c5)throw new Error(_0xba42('0x56'));if(_0x43d7c5[_0xba42('0x57')]===_0xba42('0x55')){var _0x4196be=_0x17f622[_0xba42('0x2a')]({'plain':!![]});return db[_0xba42('0x58')][_0xba42('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x43d7c5['userProfileId']},'raw':!![]})['then'](function(_0x57887b){if(_0x57887b&&_0x57887b['autoAssociation']===0x0){return db[_0xba42('0x2c')][_0xba42('0x4d')]({'name':_0x4196be[_0xba42('0x2f')],'resourceId':_0x4196be['id'],'type':_0x57887b['name'],'sectionId':_0x57887b['id']},{})[_0xba42('0x28')](function(){return _0x17f622;});}else{return _0x17f622;}})[_0xba42('0x4a')](function(_0x1b814e){logger[_0xba42('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b814e);throw _0x1b814e;});}return _0x17f622;})[_0xba42('0x28')](respondWithResult(_0x12d743,0xc9))[_0xba42('0x4a')](handleError(_0x12d743,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 8d6b1d3..aa2e18d 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 _0x10be=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers'];(function(_0x5b7b22,_0x5bc479){var _0x53dc9d=function(_0x5108c0){while(--_0x5108c0){_0x5b7b22['push'](_0x5b7b22['shift']());}};_0x53dc9d(++_0x5bc479);}(_0x10be,0x161));var _0xe10b=function(_0x5103a4,_0x4b7f5c){_0x5103a4=_0x5103a4-0x0;var _0x4f99e0=_0x10be[_0x5103a4];return _0x4f99e0;};'use strict';var _=require(_0xe10b('0x0'));var util=require('util');var logger=require(_0xe10b('0x1'))(_0xe10b('0x2'));var moment=require('moment');var BPromise=require(_0xe10b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe10b('0x4'));var rimraf=require(_0xe10b('0x5'));var config=require(_0xe10b('0x6'));var attributes=require(_0xe10b('0x7'));module['exports']=function(_0x241fd7,_0x25bda5){return _0x241fd7[_0xe10b('0x8')](_0xe10b('0x9'),attributes,{'tableName':_0xe10b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe10b('0xb'),'collate':_0xe10b('0xc')});}; \ No newline at end of file +var _0x348e=['exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','api','request-promise','path','../../config/environment','./cannedAnswer.attributes'];(function(_0x42acce,_0x30b09f){var _0x2e843b=function(_0x2697ff){while(--_0x2697ff){_0x42acce['push'](_0x42acce['shift']());}};_0x2e843b(++_0x30b09f);}(_0x348e,0x9f));var _0xe348=function(_0x27891e,_0x1d4f82){_0x27891e=_0x27891e-0x0;var _0x13dbd1=_0x348e[_0x27891e];return _0x13dbd1;};'use strict';var _=require(_0xe348('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe348('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe348('0x2'));var fs=require('fs');var path=require(_0xe348('0x3'));var rimraf=require('rimraf');var config=require(_0xe348('0x4'));var attributes=require(_0xe348('0x5'));module[_0xe348('0x6')]=function(_0x2a70c1,_0xa16292){return _0x2a70c1[_0xe348('0x7')](_0xe348('0x8'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe348('0x9'),'collate':_0xe348('0xa')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 40bb775..82787a2 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(_0x465122,_0x107808){var _0x1fd7ee=function(_0xc762a3){while(--_0xc762a3){_0x465122['push'](_0x465122['shift']());}};_0x1fd7ee(++_0x107808);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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(_0x301b74,_0x223dfb){var _0x19e590=function(_0x2b2f66){while(--_0x2b2f66){_0x301b74['push'](_0x301b74['shift']());}};_0x19e590(++_0x223dfb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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 9426695..579a027 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 _0x0f08=['../../components/interaction/service','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x0f08,0x1ea));var _0x80f0=function(_0x308213,_0x224541){_0x308213=_0x308213-0x0;var _0x2e1619=_0x0f08[_0x308213];return _0x2e1619;};'use strict';var multer=require(_0x80f0('0x0'));var util=require(_0x80f0('0x1'));var path=require('path');var timeout=require(_0x80f0('0x2'));var express=require(_0x80f0('0x3'));var router=express[_0x80f0('0x4')]();var fs_extra=require(_0x80f0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x80f0('0x6'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0x80f0('0x7')](),controller[_0x80f0('0x8')]);router['get'](_0x80f0('0x9'),auth['isAuthenticated'](),controller[_0x80f0('0xa')]);router[_0x80f0('0xb')]('/',auth[_0x80f0('0x7')](),controller[_0x80f0('0xc')]);router[_0x80f0('0xd')](_0x80f0('0x9'),auth[_0x80f0('0x7')](),controller['update']);router['delete'](_0x80f0('0x9'),auth['isAuthenticated'](),controller[_0x80f0('0xe')]);module[_0x80f0('0xf')]=router; \ No newline at end of file +var _0x8abc=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','isAuthenticated','index','get','show','post','create','/:id'];(function(_0x8962b1,_0x4bb6b5){var _0x41e583=function(_0x1ea4d4){while(--_0x1ea4d4){_0x8962b1['push'](_0x8962b1['shift']());}};_0x41e583(++_0x4bb6b5);}(_0x8abc,0x1d2));var _0xc8ab=function(_0x155200,_0x228087){_0x155200=_0x155200-0x0;var _0x354c3a=_0x8abc[_0x155200];return _0x354c3a;};'use strict';var multer=require(_0xc8ab('0x0'));var util=require(_0xc8ab('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc8ab('0x2')]();var fs_extra=require(_0xc8ab('0x3'));var auth=require(_0xc8ab('0x4'));var interaction=require(_0xc8ab('0x5'));var config=require('../../config/environment');var controller=require(_0xc8ab('0x6'));router['get']('/',auth[_0xc8ab('0x7')](),controller[_0xc8ab('0x8')]);router[_0xc8ab('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xc8ab('0xa')]);router[_0xc8ab('0xb')]('/',auth['isAuthenticated'](),controller[_0xc8ab('0xc')]);router['put'](_0xc8ab('0xd'),auth[_0xc8ab('0x7')](),controller['update']);router['delete'](_0xc8ab('0xd'),auth[_0xc8ab('0x7')](),controller[_0xc8ab('0xe')]);module[_0xc8ab('0xf')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 74c934d..8de04dc 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 _0xb700=['STRING','INTEGER','sequelize','DATE','1970-01-01\x2000:00:01'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xb700,0x1d3));var _0x0b70=function(_0x3be2e2,_0x5c166d){_0x3be2e2=_0x3be2e2-0x0;var _0x53b9c5=_0xb700[_0x3be2e2];return _0x53b9c5;};'use strict';var Sequelize=require(_0x0b70('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x0b70('0x1')],'allowNull':![],'defaultValue':_0x0b70('0x2')},'clid':{'type':Sequelize[_0x0b70('0x3')]},'src':{'type':Sequelize[_0x0b70('0x3')]},'dst':{'type':Sequelize[_0x0b70('0x3')]},'dcontext':{'type':Sequelize[_0x0b70('0x3')]},'channel':{'type':Sequelize[_0x0b70('0x3')]},'dstchannel':{'type':Sequelize[_0x0b70('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x0b70('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0b70('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0b70('0x3')]},'amaflags':{'type':Sequelize[_0x0b70('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0b70('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0b70('0x3')]},'linkedid':{'type':Sequelize[_0x0b70('0x3')]},'sequence':{'type':Sequelize[_0x0b70('0x3')]},'peeraccount':{'type':Sequelize[_0x0b70('0x3')]},'type':{'type':Sequelize[_0x0b70('0x3')]},'tag':{'type':Sequelize[_0x0b70('0x3')]}}; \ No newline at end of file +var _0xb48d=['sequelize','DATE','STRING','INTEGER'];(function(_0x33dcf7,_0x3d5390){var _0x542d4e=function(_0x281250){while(--_0x281250){_0x33dcf7['push'](_0x33dcf7['shift']());}};_0x542d4e(++_0x3d5390);}(_0xb48d,0x194));var _0xdb48=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xb48d[_0xaa0309];return _0x5de7ce;};'use strict';var Sequelize=require(_0xdb48('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xdb48('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xdb48('0x2')]},'src':{'type':Sequelize[_0xdb48('0x2')]},'dst':{'type':Sequelize[_0xdb48('0x2')]},'dcontext':{'type':Sequelize[_0xdb48('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xdb48('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xdb48('0x2')]},'duration':{'type':Sequelize[_0xdb48('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xdb48('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xdb48('0x2')]},'userfield':{'type':Sequelize[_0xdb48('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xdb48('0x2')]},'sequence':{'type':Sequelize[_0xdb48('0x2')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xdb48('0x2')]},'tag':{'type':Sequelize[_0xdb48('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 163d4cf..33e92c3 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 _0x6b8f=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','apply','reject','save','update','destroy','then','end','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','query','filters','intersection','model'];(function(_0x42cc1f,_0xe9eb20){var _0x175df5=function(_0x2f3e22){while(--_0x2f3e22){_0x42cc1f['push'](_0x42cc1f['shift']());}};_0x175df5(++_0xe9eb20);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x473367,_0x8e5486){_0x473367=_0x473367-0x0;var _0x105e69=_0x6b8f[_0x473367];return _0x105e69;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6b8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6b8('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf6b8('0x2'));var Mustache=require(_0xf6b8('0x3'));var util=require('util');var path=require(_0xf6b8('0x4'));var sox=require(_0xf6b8('0x5'));var csv=require(_0xf6b8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6b8('0x7'));var _=require(_0xf6b8('0x8'));var squel=require(_0xf6b8('0x9'));var crypto=require(_0xf6b8('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf6b8('0x6'));var querystring=require('querystring');var Papa=require(_0xf6b8('0xb'));var Redis=require(_0xf6b8('0xc'));var authService=require(_0xf6b8('0xd'));var qs=require(_0xf6b8('0xe'));var as=require(_0xf6b8('0xf'));var hardwareService=require(_0xf6b8('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf6b8('0x11'));var licenseUtil=require(_0xf6b8('0x12'));var db=require(_0xf6b8('0x13'))['db'];function respondWithStatusCode(_0x1d96b9,_0x5a6118){_0x5a6118=_0x5a6118||0xcc;return function(_0x4e5235){if(_0x4e5235){return _0x1d96b9[_0xf6b8('0x14')](_0x5a6118);}return _0x1d96b9[_0xf6b8('0x15')](_0x5a6118)['end']();};}function respondWithResult(_0xfcecc9,_0x2db10c){_0x2db10c=_0x2db10c||0xc8;return function(_0x454d8a){if(_0x454d8a){return _0xfcecc9['status'](_0x2db10c)[_0xf6b8('0x16')](_0x454d8a);}};}function respondWithFilteredResult(_0x53d744,_0x410345){return function(_0x1ee041){if(_0x1ee041){var _0x2e1748=typeof _0x410345[_0xf6b8('0x17')]===_0xf6b8('0x18')&&typeof _0x410345['limit']==='undefined';var _0x3bb9ae=_0x1ee041['count'];var _0x3cf63c=_0x2e1748?0x0:_0x410345[_0xf6b8('0x17')];var _0x4a93a8=_0x2e1748?_0x1ee041['count']:_0x410345[_0xf6b8('0x17')]+_0x410345[_0xf6b8('0x19')];var _0x3081db;if(_0x4a93a8>=_0x3bb9ae){_0x4a93a8=_0x3bb9ae;_0x3081db=0xc8;}else{_0x3081db=0xce;}_0x53d744[_0xf6b8('0x15')](_0x3081db);return _0x53d744['set']('Content-Range',_0x3cf63c+'-'+_0x4a93a8+'/'+_0x3bb9ae)['json'](_0x1ee041);}return null;};}function patchUpdates(_0x3298a4){return function(_0x2a8195){try{jsonpatch[_0xf6b8('0x1a')](_0x2a8195,_0x3298a4,!![]);}catch(_0x56b48a){return BPromise[_0xf6b8('0x1b')](_0x56b48a);}return _0x2a8195[_0xf6b8('0x1c')]();};}function saveUpdates(_0x3d2c57,_0x9c660c){return function(_0x5dd616){if(_0x5dd616){return _0x5dd616[_0xf6b8('0x1d')](_0x3d2c57)['then'](function(_0x22c52d){return _0x22c52d;});}return null;};}function removeEntity(_0x2b5bd3,_0x13a451){return function(_0x4127c9){if(_0x4127c9){return _0x4127c9[_0xf6b8('0x1e')]()[_0xf6b8('0x1f')](function(){_0x2b5bd3['status'](0xcc)[_0xf6b8('0x20')]();});}};}function handleEntityNotFound(_0x1ebfea,_0x4815f7){return function(_0x205d6c){if(!_0x205d6c){_0x1ebfea[_0xf6b8('0x14')](0x194);}return _0x205d6c;};}function handleError(_0x324057,_0xd5ebb5){_0xd5ebb5=_0xd5ebb5||0x1f4;return function(_0x3365b8){logger['error'](_0x3365b8['stack']);if(_0x3365b8[_0xf6b8('0x21')]){delete _0x3365b8[_0xf6b8('0x21')];}_0x324057['status'](_0xd5ebb5)[_0xf6b8('0x22')](_0x3365b8);};}exports[_0xf6b8('0x23')]=function(_0x888319,_0x5a7f55){var _0x458935={},_0xc958f4={},_0x511896={'count':0x0,'rows':[]};var _0x309f04=_[_0xf6b8('0x24')](db[_0xf6b8('0x25')][_0xf6b8('0x26')],function(_0x51ffcf){return{'name':_0x51ffcf[_0xf6b8('0x27')],'type':_0x51ffcf[_0xf6b8('0x28')][_0xf6b8('0x29')]};});_0xc958f4['model']=_[_0xf6b8('0x24')](_0x309f04,_0xf6b8('0x21'));_0xc958f4[_0xf6b8('0x2a')]=_['keys'](_0x888319[_0xf6b8('0x2a')]);_0xc958f4[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],_0xc958f4['query']);_0x458935[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],qs['fields'](_0x888319['query'][_0xf6b8('0x2f')]));_0x458935[_0xf6b8('0x2e')]=_0x458935[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x458935[_0xf6b8('0x2e')]:_0xc958f4[_0xf6b8('0x2d')];if(!_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x31')](_0xf6b8('0x32'))){_0x458935[_0xf6b8('0x19')]=qs[_0xf6b8('0x19')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x19')]);_0x458935[_0xf6b8('0x17')]=qs[_0xf6b8('0x17')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x17')]);}_0x458935[_0xf6b8('0x33')]=qs['sort'](_0x888319['query'][_0xf6b8('0x34')]);_0x458935[_0xf6b8('0x35')]=qs[_0xf6b8('0x2b')](_[_0xf6b8('0x36')](_0x888319[_0xf6b8('0x2a')],_0xc958f4[_0xf6b8('0x2b')]),_0x309f04);if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]){_0x458935[_0xf6b8('0x35')]=_[_0xf6b8('0x38')](_0x458935[_0xf6b8('0x35')],{'$or':_[_0xf6b8('0x24')](_0x309f04,function(_0x4a8c49){if(_0x4a8c49[_0xf6b8('0x28')]!==_0xf6b8('0x39')){var _0x5d26ad={};_0x5d26ad[_0x4a8c49[_0xf6b8('0x21')]]={'$like':'%'+_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]+'%'};return _0x5d26ad;}})});}_0x458935=_[_0xf6b8('0x38')]({},_0x458935,_0x888319[_0xf6b8('0x3a')]);var _0x87a4ee={'where':_0x458935[_0xf6b8('0x35')]};return db[_0xf6b8('0x25')][_0xf6b8('0x3b')](_0x87a4ee)[_0xf6b8('0x1f')](function(_0x15a63b){_0x511896[_0xf6b8('0x3b')]=_0x15a63b;if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x3c')]){_0x458935['include']=[{'all':!![]}];}return db['Cdr']['findAll'](_0x458935);})[_0xf6b8('0x1f')](function(_0x2c68f5){_0x511896[_0xf6b8('0x3d')]=_0x2c68f5;return _0x511896;})[_0xf6b8('0x1f')](respondWithFilteredResult(_0x5a7f55,_0x458935))[_0xf6b8('0x3e')](handleError(_0x5a7f55,null));};exports[_0xf6b8('0x3f')]=function(_0x1390dc,_0x48f4cb){var _0x1f5e72={'raw':!![],'where':{'id':_0x1390dc[_0xf6b8('0x40')]['id']}},_0x5086d9={};_0x5086d9[_0xf6b8('0x2d')]=_[_0xf6b8('0x41')](db[_0xf6b8('0x25')][_0xf6b8('0x26')]);_0x5086d9['query']=_[_0xf6b8('0x41')](_0x1390dc[_0xf6b8('0x2a')]);_0x5086d9[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],_0x5086d9['query']);_0x1f5e72[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],qs['fields'](_0x1390dc['query'][_0xf6b8('0x2f')]));_0x1f5e72[_0xf6b8('0x2e')]=_0x1f5e72[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x1f5e72['attributes']:_0x5086d9['model'];if(_0x1390dc['query'][_0xf6b8('0x3c')]){_0x1f5e72['include']=[{'all':!![]}];}_0x1f5e72=_[_0xf6b8('0x38')]({},_0x1f5e72,_0x1390dc[_0xf6b8('0x3a')]);return db[_0xf6b8('0x25')][_0xf6b8('0x42')](_0x1f5e72)[_0xf6b8('0x1f')](handleEntityNotFound(_0x48f4cb,null))[_0xf6b8('0x1f')](respondWithResult(_0x48f4cb,null))[_0xf6b8('0x3e')](handleError(_0x48f4cb,null));};exports[_0xf6b8('0x43')]=function(_0x394a34,_0x597511){return db[_0xf6b8('0x25')]['create'](_0x394a34[_0xf6b8('0x44')],{})[_0xf6b8('0x1f')](respondWithResult(_0x597511,0xc9))[_0xf6b8('0x3e')](handleError(_0x597511,null));};exports[_0xf6b8('0x1d')]=function(_0x1abf17,_0x291845){if(_0x1abf17[_0xf6b8('0x44')]['id']){delete _0x1abf17['body']['id'];}return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x1abf17[_0xf6b8('0x40')]['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x291845,null))['then'](saveUpdates(_0x1abf17[_0xf6b8('0x44')],null))[_0xf6b8('0x1f')](respondWithResult(_0x291845,null))['catch'](handleError(_0x291845,null));};exports[_0xf6b8('0x1e')]=function(_0x143164,_0x392582){return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x143164['params']['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x392582,null))[_0xf6b8('0x1f')](removeEntity(_0x392582,null))['catch'](handleError(_0x392582,null));};exports['describe']=function(_0x55c392,_0x22c1eb){return db[_0xf6b8('0x25')][_0xf6b8('0x45')]()[_0xf6b8('0x1f')](respondWithResult(_0x22c1eb,null))['catch'](handleError(_0x22c1eb,null));}; \ No newline at end of file +var _0x723e=['request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','sendStatus','error','name','send','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','Cdr','findAll','params','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch'];(function(_0x7129ea,_0x57833e){var _0x30a7ea=function(_0x5d89a5){while(--_0x5d89a5){_0x7129ea['push'](_0x7129ea['shift']());}};_0x30a7ea(++_0x57833e);}(_0x723e,0x179));var _0xe723=function(_0x10a96a,_0x2e8bda){_0x10a96a=_0x10a96a-0x0;var _0xf50a21=_0x723e[_0x10a96a];return _0xf50a21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe723('0x0'));var zipdir=require(_0xe723('0x1'));var jsonpatch=require(_0xe723('0x2'));var rp=require(_0xe723('0x3'));var moment=require(_0xe723('0x4'));var BPromise=require(_0xe723('0x5'));var Mustache=require(_0xe723('0x6'));var util=require(_0xe723('0x7'));var path=require(_0xe723('0x8'));var sox=require(_0xe723('0x9'));var csv=require('to-csv');var ejs=require(_0xe723('0xa'));var fs=require('fs');var fs_extra=require(_0xe723('0xb'));var _=require(_0xe723('0xc'));var squel=require(_0xe723('0xd'));var crypto=require(_0xe723('0xe'));var jsforce=require(_0xe723('0xf'));var deskjs=require(_0xe723('0x10'));var toCsv=require(_0xe723('0x11'));var querystring=require('querystring');var Papa=require(_0xe723('0x12'));var Redis=require(_0xe723('0x13'));var authService=require(_0xe723('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe723('0x15'));var hardwareService=require(_0xe723('0x16'));var logger=require(_0xe723('0x17'))('api');var utils=require(_0xe723('0x18'));var config=require(_0xe723('0x19'));var licenseUtil=require(_0xe723('0x1a'));var db=require(_0xe723('0x1b'))['db'];function respondWithStatusCode(_0x236b69,_0x5c066c){_0x5c066c=_0x5c066c||0xcc;return function(_0x29a1e){if(_0x29a1e){return _0x236b69['sendStatus'](_0x5c066c);}return _0x236b69['status'](_0x5c066c)['end']();};}function respondWithResult(_0x57bc0e,_0x75c12c){_0x75c12c=_0x75c12c||0xc8;return function(_0x30b2ba){if(_0x30b2ba){return _0x57bc0e[_0xe723('0x1c')](_0x75c12c)[_0xe723('0x1d')](_0x30b2ba);}};}function respondWithFilteredResult(_0xf29a39,_0x5aec97){return function(_0x23d0b2){if(_0x23d0b2){var _0xbf5ca3=typeof _0x5aec97[_0xe723('0x1e')]===_0xe723('0x1f')&&typeof _0x5aec97[_0xe723('0x20')]===_0xe723('0x1f');var _0x2cd7ca=_0x23d0b2[_0xe723('0x21')];var _0x17e2c1=_0xbf5ca3?0x0:_0x5aec97[_0xe723('0x1e')];var _0x2057d7=_0xbf5ca3?_0x23d0b2[_0xe723('0x21')]:_0x5aec97[_0xe723('0x1e')]+_0x5aec97[_0xe723('0x20')];var _0x5e8a90;if(_0x2057d7>=_0x2cd7ca){_0x2057d7=_0x2cd7ca;_0x5e8a90=0xc8;}else{_0x5e8a90=0xce;}_0xf29a39['status'](_0x5e8a90);return _0xf29a39[_0xe723('0x22')](_0xe723('0x23'),_0x17e2c1+'-'+_0x2057d7+'/'+_0x2cd7ca)['json'](_0x23d0b2);}return null;};}function patchUpdates(_0x28caca){return function(_0x2762e2){try{jsonpatch['apply'](_0x2762e2,_0x28caca,!![]);}catch(_0x472502){return BPromise['reject'](_0x472502);}return _0x2762e2[_0xe723('0x24')]();};}function saveUpdates(_0x43ccfc,_0x3b82b2){return function(_0x1fe43d){if(_0x1fe43d){return _0x1fe43d[_0xe723('0x25')](_0x43ccfc)[_0xe723('0x26')](function(_0x25f7d2){return _0x25f7d2;});}return null;};}function removeEntity(_0x15196c,_0x1228f2){return function(_0x19bd0c){if(_0x19bd0c){return _0x19bd0c[_0xe723('0x27')]()[_0xe723('0x26')](function(){_0x15196c['status'](0xcc)[_0xe723('0x28')]();});}};}function handleEntityNotFound(_0x59f095,_0xa258f3){return function(_0x3ffa15){if(!_0x3ffa15){_0x59f095[_0xe723('0x29')](0x194);}return _0x3ffa15;};}function handleError(_0xe7e271,_0x1f81ec){_0x1f81ec=_0x1f81ec||0x1f4;return function(_0x598f15){logger[_0xe723('0x2a')](_0x598f15['stack']);if(_0x598f15['name']){delete _0x598f15[_0xe723('0x2b')];}_0xe7e271['status'](_0x1f81ec)[_0xe723('0x2c')](_0x598f15);};}exports[_0xe723('0x2d')]=function(_0x335c66,_0x4d55cc){var _0x1edbb2={},_0x45e162={},_0x48a97a={'count':0x0,'rows':[]};var _0x3c8c56=_['map'](db['Cdr'][_0xe723('0x2e')],function(_0x2c2240){return{'name':_0x2c2240[_0xe723('0x2f')],'type':_0x2c2240[_0xe723('0x30')]['key']};});_0x45e162['model']=_[_0xe723('0x31')](_0x3c8c56,'name');_0x45e162[_0xe723('0x32')]=_[_0xe723('0x33')](_0x335c66[_0xe723('0x32')]);_0x45e162[_0xe723('0x34')]=_[_0xe723('0x35')](_0x45e162[_0xe723('0x36')],_0x45e162[_0xe723('0x32')]);_0x1edbb2[_0xe723('0x37')]=_[_0xe723('0x35')](_0x45e162[_0xe723('0x36')],qs[_0xe723('0x38')](_0x335c66[_0xe723('0x32')][_0xe723('0x38')]));_0x1edbb2[_0xe723('0x37')]=_0x1edbb2['attributes'][_0xe723('0x39')]?_0x1edbb2['attributes']:_0x45e162[_0xe723('0x36')];if(!_0x335c66[_0xe723('0x32')]['hasOwnProperty']('nolimit')){_0x1edbb2[_0xe723('0x20')]=qs[_0xe723('0x20')](_0x335c66[_0xe723('0x32')][_0xe723('0x20')]);_0x1edbb2[_0xe723('0x1e')]=qs[_0xe723('0x1e')](_0x335c66['query'][_0xe723('0x1e')]);}_0x1edbb2[_0xe723('0x3a')]=qs[_0xe723('0x3b')](_0x335c66[_0xe723('0x32')][_0xe723('0x3b')]);_0x1edbb2[_0xe723('0x3c')]=qs[_0xe723('0x34')](_[_0xe723('0x3d')](_0x335c66[_0xe723('0x32')],_0x45e162[_0xe723('0x34')]),_0x3c8c56);if(_0x335c66[_0xe723('0x32')][_0xe723('0x3e')]){_0x1edbb2[_0xe723('0x3c')]=_[_0xe723('0x3f')](_0x1edbb2[_0xe723('0x3c')],{'$or':_[_0xe723('0x31')](_0x3c8c56,function(_0x5c5027){if(_0x5c5027[_0xe723('0x30')]!==_0xe723('0x40')){var _0x68eda5={};_0x68eda5[_0x5c5027[_0xe723('0x2b')]]={'$like':'%'+_0x335c66['query']['filter']+'%'};return _0x68eda5;}})});}_0x1edbb2=_[_0xe723('0x3f')]({},_0x1edbb2,_0x335c66[_0xe723('0x41')]);var _0xc0c2c7={'where':_0x1edbb2[_0xe723('0x3c')]};return db['Cdr']['count'](_0xc0c2c7)[_0xe723('0x26')](function(_0x2f1618){_0x48a97a[_0xe723('0x21')]=_0x2f1618;if(_0x335c66[_0xe723('0x32')][_0xe723('0x42')]){_0x1edbb2[_0xe723('0x43')]=[{'all':!![]}];}return db[_0xe723('0x44')][_0xe723('0x45')](_0x1edbb2);})[_0xe723('0x26')](function(_0x5b0c89){_0x48a97a['rows']=_0x5b0c89;return _0x48a97a;})[_0xe723('0x26')](respondWithFilteredResult(_0x4d55cc,_0x1edbb2))['catch'](handleError(_0x4d55cc,null));};exports['show']=function(_0x18f4a1,_0x55530b){var _0x36272={'raw':!![],'where':{'id':_0x18f4a1[_0xe723('0x46')]['id']}},_0x42bd2f={};_0x42bd2f[_0xe723('0x36')]=_[_0xe723('0x33')](db[_0xe723('0x44')][_0xe723('0x2e')]);_0x42bd2f['query']=_['keys'](_0x18f4a1[_0xe723('0x32')]);_0x42bd2f['filters']=_[_0xe723('0x35')](_0x42bd2f['model'],_0x42bd2f[_0xe723('0x32')]);_0x36272[_0xe723('0x37')]=_[_0xe723('0x35')](_0x42bd2f[_0xe723('0x36')],qs[_0xe723('0x38')](_0x18f4a1[_0xe723('0x32')][_0xe723('0x38')]));_0x36272[_0xe723('0x37')]=_0x36272[_0xe723('0x37')]['length']?_0x36272['attributes']:_0x42bd2f[_0xe723('0x36')];if(_0x18f4a1[_0xe723('0x32')][_0xe723('0x42')]){_0x36272['include']=[{'all':!![]}];}_0x36272=_['merge']({},_0x36272,_0x18f4a1['options']);return db[_0xe723('0x44')][_0xe723('0x47')](_0x36272)[_0xe723('0x26')](handleEntityNotFound(_0x55530b,null))['then'](respondWithResult(_0x55530b,null))[_0xe723('0x48')](handleError(_0x55530b,null));};exports[_0xe723('0x49')]=function(_0x1cb2b2,_0x38bd1a){return db[_0xe723('0x44')]['create'](_0x1cb2b2[_0xe723('0x4a')],{})['then'](respondWithResult(_0x38bd1a,0xc9))[_0xe723('0x48')](handleError(_0x38bd1a,null));};exports['update']=function(_0x52f42e,_0x1590fe){if(_0x52f42e[_0xe723('0x4a')]['id']){delete _0x52f42e[_0xe723('0x4a')]['id'];}return db['Cdr'][_0xe723('0x47')]({'where':{'id':_0x52f42e['params']['id']}})[_0xe723('0x26')](handleEntityNotFound(_0x1590fe,null))[_0xe723('0x26')](saveUpdates(_0x52f42e[_0xe723('0x4a')],null))[_0xe723('0x26')](respondWithResult(_0x1590fe,null))[_0xe723('0x48')](handleError(_0x1590fe,null));};exports[_0xe723('0x27')]=function(_0x41e1c4,_0x16cb50){return db[_0xe723('0x44')]['find']({'where':{'id':_0x41e1c4[_0xe723('0x46')]['id']}})[_0xe723('0x26')](handleEntityNotFound(_0x16cb50,null))['then'](removeEntity(_0x16cb50,null))[_0xe723('0x48')](handleError(_0x16cb50,null));};exports[_0xe723('0x4b')]=function(_0x56e92a,_0x126ca5){return db['Cdr']['describe']()[_0xe723('0x26')](respondWithResult(_0x126ca5,null))[_0xe723('0x48')](handleError(_0x126ca5,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 89f8057..190b2aa 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(_0x129924,_0x4ebbe7){var _0x3cf3b3=function(_0xa5362f){while(--_0xa5362f){_0x129924['push'](_0x129924['shift']());}};_0x3cf3b3(++_0x4ebbe7);}(_0x7a54,0x106));var _0x47a5=function(_0x346173,_0x113cb9){_0x346173=_0x346173-0x0;var _0x1a1e40=_0x7a54[_0x346173];return _0x1a1e40;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x317d61,_0x5e6335){var _0x3abc20=function(_0x556876){while(--_0x556876){_0x317d61['push'](_0x317d61['shift']());}};_0x3abc20(++_0x5e6335);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index e51b685..c306691 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 _0x130c=['stringify','error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x4b9d96,_0x515ffd){var _0x165387=function(_0x244f86){while(--_0x244f86){_0x4b9d96['push'](_0x4b9d96['shift']());}};_0x165387(++_0x515ffd);}(_0x130c,0x180));var _0xc130=function(_0xeb5495,_0x3373c8){_0xeb5495=_0xeb5495-0x0;var _0x5e17e0=_0x130c[_0xeb5495];return _0x5e17e0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc130('0x0'));var BPromise=require(_0xc130('0x1'));var rs=require(_0xc130('0x2'));var fs=require('fs');var Redis=require(_0xc130('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc130('0x4'))(_0xc130('0x5'));var config=require(_0xc130('0x6'));var jayson=require(_0xc130('0x7'));var client=jayson[_0xc130('0x8')][_0xc130('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c3d20,_0x343345,_0x40c638){return new BPromise(function(_0x1c619d,_0xbd90bc){return client[_0xc130('0xa')](_0x1c3d20,_0x40c638)['then'](function(_0x4c1b50){logger['info'](_0xc130('0xb'),_0x343345,_0xc130('0xc'));logger[_0xc130('0xd')](_0xc130('0xe'),_0x343345,_0xc130('0xc'),JSON[_0xc130('0xf')](_0x4c1b50));if(_0x4c1b50[_0xc130('0x10')]){if(_0x4c1b50[_0xc130('0x10')]['code']===0x1f4){logger[_0xc130('0x10')]('Cdr,\x20%s,\x20%s',_0x343345,_0x4c1b50['error']['message']);return _0xbd90bc(_0x4c1b50[_0xc130('0x10')][_0xc130('0x11')]);}logger[_0xc130('0x10')]('Cdr,\x20%s,\x20%s',_0x343345,_0x4c1b50[_0xc130('0x10')][_0xc130('0x11')]);return _0x1c619d(_0x4c1b50['error'][_0xc130('0x11')]);}else{logger[_0xc130('0x12')](_0xc130('0xb'),_0x343345,_0xc130('0xc'));_0x1c619d(_0x4c1b50[_0xc130('0x13')]['message']);}})[_0xc130('0x14')](function(_0x20acc7){logger[_0xc130('0x10')](_0xc130('0xb'),_0x343345,_0x20acc7);_0xbd90bc(_0x20acc7);});});} \ No newline at end of file +var _0x16d3=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','Cdr,\x20%s,\x20%s','catch','lodash','util','moment','bluebird'];(function(_0x33c7e6,_0x4f70aa){var _0x25dfa2=function(_0x33c2f7){while(--_0x33c2f7){_0x33c7e6['push'](_0x33c7e6['shift']());}};_0x25dfa2(++_0x4f70aa);}(_0x16d3,0x1ca));var _0x316d=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x16d3[_0x2cf2e9];return _0xd3670d;};'use strict';var _=require(_0x316d('0x0'));var util=require(_0x316d('0x1'));var moment=require(_0x316d('0x2'));var BPromise=require(_0x316d('0x3'));var rs=require(_0x316d('0x4'));var fs=require('fs');var Redis=require(_0x316d('0x5'));var db=require(_0x316d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x316d('0x7'))(_0x316d('0x8'));var config=require(_0x316d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x316d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a4d8b,_0x2a46f0,_0x51db46){return new BPromise(function(_0x8b8df7,_0x2a5381){return client[_0x316d('0xb')](_0x5a4d8b,_0x51db46)[_0x316d('0xc')](function(_0x1c9419){logger[_0x316d('0xd')]('Cdr,\x20%s,\x20%s',_0x2a46f0,_0x316d('0xe'));logger[_0x316d('0xf')](_0x316d('0x10'),_0x2a46f0,'request\x20sent',JSON['stringify'](_0x1c9419));if(_0x1c9419['error']){if(_0x1c9419[_0x316d('0x11')][_0x316d('0x12')]===0x1f4){logger[_0x316d('0x11')]('Cdr,\x20%s,\x20%s',_0x2a46f0,_0x1c9419['error'][_0x316d('0x13')]);return _0x2a5381(_0x1c9419['error'][_0x316d('0x13')]);}logger['error'](_0x316d('0x14'),_0x2a46f0,_0x1c9419[_0x316d('0x11')][_0x316d('0x13')]);return _0x8b8df7(_0x1c9419[_0x316d('0x11')][_0x316d('0x13')]);}else{logger[_0x316d('0xd')]('Cdr,\x20%s,\x20%s',_0x2a46f0,_0x316d('0xe'));_0x8b8df7(_0x1c9419['result'][_0x316d('0x13')]);}})[_0x316d('0x15')](function(_0x935110){logger[_0x316d('0x11')]('Cdr,\x20%s,\x20%s',_0x2a46f0,_0x935110);_0x2a5381(_0x935110);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index a7118be..4bf2c02 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x4c974e,_0x513d9e){var _0x31327b=function(_0x5db97c){while(--_0x5db97c){_0x4c974e['push'](_0x4c974e['shift']());}};_0x31327b(++_0x513d9e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _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(_0x3592ab,_0x4f669a){var _0x13298a=function(_0x25f018){while(--_0x25f018){_0x3592ab['push'](_0x3592ab['shift']());}};_0x13298a(++_0x4f669a);}(_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 705a3c0..b658592 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 _0xf74d=['noop','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0xa73aa,_0x4e1e22){var _0x2e8881=function(_0x443ee4){while(--_0x443ee4){_0xa73aa['push'](_0xa73aa['shift']());}};_0x2e8881(++_0x4e1e22);}(_0xf74d,0xe6));var _0xdf74=function(_0x1c4125,_0x169a60){_0x1c4125=_0x1c4125-0x0;var _0x2568a7=_0xf74d[_0x1c4125];return _0x2568a7;};'use strict';var Sequelize=require(_0xdf74('0x0'));module[_0xdf74('0x1')]={'priority':{'type':Sequelize[_0xdf74('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xdf74('0x3')],'allowNull':![],'defaultValue':_0xdf74('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xdf74('0x3')]},'interval':{'type':Sequelize[_0xdf74('0x3')],'defaultValue':_0xdf74('0x5')}}; \ No newline at end of file +var _0x4e88=['noop','TEXT','STRING','*,*,*,*','exports','INTEGER'];(function(_0x56241f,_0xc69854){var _0x2f68ef=function(_0x3fe05e){while(--_0x3fe05e){_0x56241f['push'](_0x56241f['shift']());}};_0x2f68ef(++_0xc69854);}(_0x4e88,0x1d2));var _0x84e8=function(_0x269967,_0x49abd6){_0x269967=_0x269967-0x0;var _0xddff5a=_0x4e88[_0x269967];return _0xddff5a;};'use strict';var Sequelize=require('sequelize');module[_0x84e8('0x0')]={'priority':{'type':Sequelize[_0x84e8('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x84e8('0x2')},'appdata':{'type':Sequelize[_0x84e8('0x3')]()},'description':{'type':Sequelize[_0x84e8('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x84e8('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 4bd6420..293f6fd 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 _0x50a8=['undefined','limit','count','set','Content-Range','json','apply','update','destroy','then','error','stack','name','send','show','params','model','keys','ChatApplication','query','filters','intersection','fields','attributes','length','includeAll','options','find','catch','body','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','offset'];(function(_0x27670b,_0x55ae98){var _0x5a27a9=function(_0x52117f){while(--_0x52117f){_0x27670b['push'](_0x27670b['shift']());}};_0x5a27a9(++_0x55ae98);}(_0x50a8,0x198));var _0x850a=function(_0x3d95e9,_0x45bb17){_0x3d95e9=_0x3d95e9-0x0;var _0x472c9a=_0x50a8[_0x3d95e9];return _0x472c9a;};'use strict';var emlformat=require(_0x850a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x850a('0x1'));var moment=require('moment');var BPromise=require(_0x850a('0x2'));var Mustache=require(_0x850a('0x3'));var util=require(_0x850a('0x4'));var path=require(_0x850a('0x5'));var sox=require(_0x850a('0x6'));var csv=require(_0x850a('0x7'));var ejs=require(_0x850a('0x8'));var fs=require('fs');var fs_extra=require(_0x850a('0x9'));var _=require(_0x850a('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x850a('0xb'));var deskjs=require(_0x850a('0xc'));var toCsv=require(_0x850a('0x7'));var querystring=require(_0x850a('0xd'));var Papa=require('papaparse');var Redis=require(_0x850a('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x850a('0xf'));var hardwareService=require(_0x850a('0x10'));var logger=require(_0x850a('0x11'))(_0x850a('0x12'));var utils=require(_0x850a('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b12a1,_0x4d591d){_0x4d591d=_0x4d591d||0xcc;return function(_0x45cd78){if(_0x45cd78){return _0x3b12a1[_0x850a('0x14')](_0x4d591d);}return _0x3b12a1[_0x850a('0x15')](_0x4d591d)[_0x850a('0x16')]();};}function respondWithResult(_0x3328e6,_0x50c199){_0x50c199=_0x50c199||0xc8;return function(_0x355a31){if(_0x355a31){return _0x3328e6['status'](_0x50c199)['json'](_0x355a31);}};}function respondWithFilteredResult(_0x537679,_0x4c0156){return function(_0x3e6e81){if(_0x3e6e81){var _0x5e0fbe=typeof _0x4c0156[_0x850a('0x17')]===_0x850a('0x18')&&typeof _0x4c0156[_0x850a('0x19')]===_0x850a('0x18');var _0x22d759=_0x3e6e81[_0x850a('0x1a')];var _0x3e2715=_0x5e0fbe?0x0:_0x4c0156[_0x850a('0x17')];var _0x57e789=_0x5e0fbe?_0x3e6e81[_0x850a('0x1a')]:_0x4c0156['offset']+_0x4c0156['limit'];var _0x49690e;if(_0x57e789>=_0x22d759){_0x57e789=_0x22d759;_0x49690e=0xc8;}else{_0x49690e=0xce;}_0x537679['status'](_0x49690e);return _0x537679[_0x850a('0x1b')](_0x850a('0x1c'),_0x3e2715+'-'+_0x57e789+'/'+_0x22d759)[_0x850a('0x1d')](_0x3e6e81);}return null;};}function patchUpdates(_0x5b2917){return function(_0x17eadb){try{jsonpatch[_0x850a('0x1e')](_0x17eadb,_0x5b2917,!![]);}catch(_0x15c39b){return BPromise['reject'](_0x15c39b);}return _0x17eadb['save']();};}function saveUpdates(_0x342b50,_0x285ef4){return function(_0x5758af){if(_0x5758af){return _0x5758af[_0x850a('0x1f')](_0x342b50)['then'](function(_0x5eb2a4){return _0x5eb2a4;});}return null;};}function removeEntity(_0x561fde,_0x4363d4){return function(_0x47d527){if(_0x47d527){return _0x47d527[_0x850a('0x20')]()[_0x850a('0x21')](function(){_0x561fde[_0x850a('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4606ef,_0xc52e71){return function(_0x33327e){if(!_0x33327e){_0x4606ef['sendStatus'](0x194);}return _0x33327e;};}function handleError(_0x1da9ad,_0xe46a27){_0xe46a27=_0xe46a27||0x1f4;return function(_0x4d715c){logger[_0x850a('0x22')](_0x4d715c[_0x850a('0x23')]);if(_0x4d715c[_0x850a('0x24')]){delete _0x4d715c[_0x850a('0x24')];}_0x1da9ad[_0x850a('0x15')](_0xe46a27)[_0x850a('0x25')](_0x4d715c);};}exports[_0x850a('0x26')]=function(_0x314d36,_0x3a228f){var _0x177dd6={'raw':!![],'where':{'id':_0x314d36[_0x850a('0x27')]['id']}},_0x44fb58={};_0x44fb58[_0x850a('0x28')]=_[_0x850a('0x29')](db[_0x850a('0x2a')]['rawAttributes']);_0x44fb58[_0x850a('0x2b')]=_['keys'](_0x314d36[_0x850a('0x2b')]);_0x44fb58[_0x850a('0x2c')]=_[_0x850a('0x2d')](_0x44fb58['model'],_0x44fb58['query']);_0x177dd6['attributes']=_[_0x850a('0x2d')](_0x44fb58['model'],qs[_0x850a('0x2e')](_0x314d36[_0x850a('0x2b')][_0x850a('0x2e')]));_0x177dd6[_0x850a('0x2f')]=_0x177dd6['attributes'][_0x850a('0x30')]?_0x177dd6[_0x850a('0x2f')]:_0x44fb58[_0x850a('0x28')];if(_0x314d36[_0x850a('0x2b')][_0x850a('0x31')]){_0x177dd6['include']=[{'all':!![]}];}_0x177dd6=_['merge']({},_0x177dd6,_0x314d36[_0x850a('0x32')]);return db['ChatApplication'][_0x850a('0x33')](_0x177dd6)[_0x850a('0x21')](handleEntityNotFound(_0x3a228f,null))[_0x850a('0x21')](respondWithResult(_0x3a228f,null))[_0x850a('0x34')](handleError(_0x3a228f,null));};exports[_0x850a('0x1f')]=function(_0x172050,_0x3d88bb){if(_0x172050[_0x850a('0x35')]['id']){delete _0x172050[_0x850a('0x35')]['id'];}return db[_0x850a('0x2a')]['find']({'where':{'id':_0x172050[_0x850a('0x27')]['id']}})[_0x850a('0x21')](handleEntityNotFound(_0x3d88bb,null))[_0x850a('0x21')](saveUpdates(_0x172050[_0x850a('0x35')],null))[_0x850a('0x21')](respondWithResult(_0x3d88bb,null))['catch'](handleError(_0x3d88bb,null));};exports[_0x850a('0x20')]=function(_0x376a12,_0x58d34d){return db[_0x850a('0x2a')][_0x850a('0x33')]({'where':{'id':_0x376a12[_0x850a('0x27')]['id']}})['then'](handleEntityNotFound(_0x58d34d,null))['then'](removeEntity(_0x58d34d,null))[_0x850a('0x34')](handleError(_0x58d34d,null));}; \ No newline at end of file +var _0x4ad3=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','include','merge','options','find','catch','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x14c696,_0x43e421){var _0x39d58e=function(_0x109913){while(--_0x109913){_0x14c696['push'](_0x14c696['shift']());}};_0x39d58e(++_0x43e421);}(_0x4ad3,0x1b1));var _0x34ad=function(_0x334fea,_0x1f1e18){_0x334fea=_0x334fea-0x0;var _0x3c5829=_0x4ad3[_0x334fea];return _0x3c5829;};'use strict';var emlformat=require(_0x34ad('0x0'));var rimraf=require(_0x34ad('0x1'));var zipdir=require(_0x34ad('0x2'));var jsonpatch=require(_0x34ad('0x3'));var rp=require(_0x34ad('0x4'));var moment=require(_0x34ad('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x34ad('0x6'));var util=require(_0x34ad('0x7'));var path=require(_0x34ad('0x8'));var sox=require(_0x34ad('0x9'));var csv=require(_0x34ad('0xa'));var ejs=require(_0x34ad('0xb'));var fs=require('fs');var fs_extra=require(_0x34ad('0xc'));var _=require(_0x34ad('0xd'));var squel=require(_0x34ad('0xe'));var crypto=require(_0x34ad('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x34ad('0xa'));var querystring=require(_0x34ad('0x10'));var Papa=require(_0x34ad('0x11'));var Redis=require(_0x34ad('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x34ad('0x13'));var as=require(_0x34ad('0x14'));var hardwareService=require(_0x34ad('0x15'));var logger=require(_0x34ad('0x16'))(_0x34ad('0x17'));var utils=require(_0x34ad('0x18'));var config=require(_0x34ad('0x19'));var licenseUtil=require(_0x34ad('0x1a'));var db=require(_0x34ad('0x1b'))['db'];function respondWithStatusCode(_0x377c90,_0x14c9fd){_0x14c9fd=_0x14c9fd||0xcc;return function(_0x1be906){if(_0x1be906){return _0x377c90[_0x34ad('0x1c')](_0x14c9fd);}return _0x377c90[_0x34ad('0x1d')](_0x14c9fd)[_0x34ad('0x1e')]();};}function respondWithResult(_0xc64e62,_0x558097){_0x558097=_0x558097||0xc8;return function(_0x4764e9){if(_0x4764e9){return _0xc64e62[_0x34ad('0x1d')](_0x558097)[_0x34ad('0x1f')](_0x4764e9);}};}function respondWithFilteredResult(_0x5e2a1d,_0x21a78c){return function(_0x262123){if(_0x262123){var _0x38a15e=typeof _0x21a78c[_0x34ad('0x20')]===_0x34ad('0x21')&&typeof _0x21a78c['limit']===_0x34ad('0x21');var _0x4daa5c=_0x262123[_0x34ad('0x22')];var _0x294326=_0x38a15e?0x0:_0x21a78c[_0x34ad('0x20')];var _0x7036e0=_0x38a15e?_0x262123[_0x34ad('0x22')]:_0x21a78c['offset']+_0x21a78c[_0x34ad('0x23')];var _0x3a2cd5;if(_0x7036e0>=_0x4daa5c){_0x7036e0=_0x4daa5c;_0x3a2cd5=0xc8;}else{_0x3a2cd5=0xce;}_0x5e2a1d[_0x34ad('0x1d')](_0x3a2cd5);return _0x5e2a1d[_0x34ad('0x24')](_0x34ad('0x25'),_0x294326+'-'+_0x7036e0+'/'+_0x4daa5c)[_0x34ad('0x1f')](_0x262123);}return null;};}function patchUpdates(_0x3c178a){return function(_0x45557e){try{jsonpatch[_0x34ad('0x26')](_0x45557e,_0x3c178a,!![]);}catch(_0x55140c){return BPromise[_0x34ad('0x27')](_0x55140c);}return _0x45557e['save']();};}function saveUpdates(_0x1c2d49,_0x493f73){return function(_0x154ee8){if(_0x154ee8){return _0x154ee8[_0x34ad('0x28')](_0x1c2d49)[_0x34ad('0x29')](function(_0x1c2fa5){return _0x1c2fa5;});}return null;};}function removeEntity(_0x737c2d,_0x4a06a7){return function(_0x5a8379){if(_0x5a8379){return _0x5a8379[_0x34ad('0x2a')]()['then'](function(){_0x737c2d[_0x34ad('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d5495,_0x34d2ae){return function(_0x3df4ca){if(!_0x3df4ca){_0x5d5495[_0x34ad('0x1c')](0x194);}return _0x3df4ca;};}function handleError(_0x3cb657,_0x17fc51){_0x17fc51=_0x17fc51||0x1f4;return function(_0x320b6a){logger[_0x34ad('0x2b')](_0x320b6a[_0x34ad('0x2c')]);if(_0x320b6a[_0x34ad('0x2d')]){delete _0x320b6a[_0x34ad('0x2d')];}_0x3cb657['status'](_0x17fc51)[_0x34ad('0x2e')](_0x320b6a);};}exports[_0x34ad('0x2f')]=function(_0x23bb04,_0x31b880){var _0x2bcdc3={'raw':!![],'where':{'id':_0x23bb04[_0x34ad('0x30')]['id']}},_0x1b2387={};_0x1b2387[_0x34ad('0x31')]=_[_0x34ad('0x32')](db[_0x34ad('0x33')][_0x34ad('0x34')]);_0x1b2387[_0x34ad('0x35')]=_[_0x34ad('0x32')](_0x23bb04[_0x34ad('0x35')]);_0x1b2387[_0x34ad('0x36')]=_[_0x34ad('0x37')](_0x1b2387['model'],_0x1b2387[_0x34ad('0x35')]);_0x2bcdc3['attributes']=_[_0x34ad('0x37')](_0x1b2387[_0x34ad('0x31')],qs[_0x34ad('0x38')](_0x23bb04[_0x34ad('0x35')]['fields']));_0x2bcdc3[_0x34ad('0x39')]=_0x2bcdc3[_0x34ad('0x39')][_0x34ad('0x3a')]?_0x2bcdc3[_0x34ad('0x39')]:_0x1b2387['model'];if(_0x23bb04['query']['includeAll']){_0x2bcdc3[_0x34ad('0x3b')]=[{'all':!![]}];}_0x2bcdc3=_[_0x34ad('0x3c')]({},_0x2bcdc3,_0x23bb04[_0x34ad('0x3d')]);return db[_0x34ad('0x33')][_0x34ad('0x3e')](_0x2bcdc3)['then'](handleEntityNotFound(_0x31b880,null))[_0x34ad('0x29')](respondWithResult(_0x31b880,null))[_0x34ad('0x3f')](handleError(_0x31b880,null));};exports[_0x34ad('0x28')]=function(_0x2a3330,_0x1b79b3){if(_0x2a3330[_0x34ad('0x40')]['id']){delete _0x2a3330[_0x34ad('0x40')]['id'];}return db[_0x34ad('0x33')][_0x34ad('0x3e')]({'where':{'id':_0x2a3330[_0x34ad('0x30')]['id']}})[_0x34ad('0x29')](handleEntityNotFound(_0x1b79b3,null))[_0x34ad('0x29')](saveUpdates(_0x2a3330[_0x34ad('0x40')],null))[_0x34ad('0x29')](respondWithResult(_0x1b79b3,null))[_0x34ad('0x3f')](handleError(_0x1b79b3,null));};exports[_0x34ad('0x2a')]=function(_0x41a5a2,_0x23e15b){return db[_0x34ad('0x33')][_0x34ad('0x3e')]({'where':{'id':_0x41a5a2['params']['id']}})['then'](handleEntityNotFound(_0x23e15b,null))[_0x34ad('0x29')](removeEntity(_0x23e15b,null))[_0x34ad('0x3f')](handleError(_0x23e15b,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index c7ac45b..4896302 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 _0xe920=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xe920,0xbe));var _0x0e92=function(_0x5b5cde,_0x1f7c5f){_0x5b5cde=_0x5b5cde-0x0;var _0x364ad2=_0xe920[_0x5b5cde];return _0x364ad2;};'use strict';var _=require(_0x0e92('0x0'));var util=require(_0x0e92('0x1'));var logger=require(_0x0e92('0x2'))(_0x0e92('0x3'));var moment=require(_0x0e92('0x4'));var BPromise=require(_0x0e92('0x5'));var rp=require(_0x0e92('0x6'));var fs=require('fs');var path=require(_0x0e92('0x7'));var rimraf=require(_0x0e92('0x8'));var config=require(_0x0e92('0x9'));var attributes=require('./chatApplication.attributes');module[_0x0e92('0xa')]=function(_0x5291e2,_0x40d9f2){return _0x5291e2[_0x0e92('0xb')](_0x0e92('0xc'),attributes,{'tableName':_0x0e92('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0e92('0xe')});}; \ No newline at end of file +var _0x4385=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci'];(function(_0x3e8270,_0x293590){var _0x1ccde9=function(_0x213490){while(--_0x213490){_0x3e8270['push'](_0x3e8270['shift']());}};_0x1ccde9(++_0x293590);}(_0x4385,0x168));var _0x5438=function(_0x1336ff,_0x4426b6){_0x1336ff=_0x1336ff-0x0;var _0x1485d5=_0x4385[_0x1336ff];return _0x1485d5;};'use strict';var _=require(_0x5438('0x0'));var util=require(_0x5438('0x1'));var logger=require(_0x5438('0x2'))(_0x5438('0x3'));var moment=require('moment');var BPromise=require(_0x5438('0x4'));var rp=require(_0x5438('0x5'));var fs=require('fs');var path=require(_0x5438('0x6'));var rimraf=require(_0x5438('0x7'));var config=require(_0x5438('0x8'));var attributes=require(_0x5438('0x9'));module[_0x5438('0xa')]=function(_0x4ce1df,_0x46c7fa){return _0x4ce1df[_0x5438('0xb')](_0x5438('0xc'),attributes,{'tableName':_0x5438('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5438('0xe')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 0541f9a..1104a57 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 _0x69a6=['info','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','ChatApplication,\x20%s,\x20%s','message','result','catch','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x58c241,_0x13be02){var _0x358876=function(_0xf76fc6){while(--_0xf76fc6){_0x58c241['push'](_0x58c241['shift']());}};_0x358876(++_0x13be02);}(_0x69a6,0x10d));var _0x669a=function(_0x39e23a,_0x17845e){_0x39e23a=_0x39e23a-0x0;var _0x40eda6=_0x69a6[_0x39e23a];return _0x40eda6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x669a('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x669a('0x1'))['db'];var utils=require(_0x669a('0x2'));var logger=require(_0x669a('0x3'))(_0x669a('0x4'));var config=require(_0x669a('0x5'));var jayson=require(_0x669a('0x6'));var client=jayson[_0x669a('0x7')][_0x669a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f33ae,_0x45c78e,_0x16068d){return new BPromise(function(_0x255ed2,_0x452893){return client[_0x669a('0x9')](_0x2f33ae,_0x16068d)[_0x669a('0xa')](function(_0x26845a){logger[_0x669a('0xb')]('ChatApplication,\x20%s,\x20%s',_0x45c78e,_0x669a('0xc'));logger['debug'](_0x669a('0xd'),_0x45c78e,_0x669a('0xc'),JSON[_0x669a('0xe')](_0x26845a));if(_0x26845a[_0x669a('0xf')]){if(_0x26845a[_0x669a('0xf')]['code']===0x1f4){logger[_0x669a('0xf')](_0x669a('0x10'),_0x45c78e,_0x26845a[_0x669a('0xf')]['message']);return _0x452893(_0x26845a[_0x669a('0xf')][_0x669a('0x11')]);}logger[_0x669a('0xf')](_0x669a('0x10'),_0x45c78e,_0x26845a[_0x669a('0xf')][_0x669a('0x11')]);return _0x255ed2(_0x26845a[_0x669a('0xf')]['message']);}else{logger['info'](_0x669a('0x10'),_0x45c78e,_0x669a('0xc'));_0x255ed2(_0x26845a[_0x669a('0x12')][_0x669a('0x11')]);}})[_0x669a('0x13')](function(_0x2830e4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x45c78e,_0x2830e4);_0x452893(_0x2830e4);});});} \ No newline at end of file +var _0xcf6e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','code','error','message','lodash','util','moment','bluebird'];(function(_0x4314c4,_0x4a21db){var _0x315931=function(_0x38e0c7){while(--_0x38e0c7){_0x4314c4['push'](_0x4314c4['shift']());}};_0x315931(++_0x4a21db);}(_0xcf6e,0xf3));var _0xecf6=function(_0x17211b,_0x52ceee){_0x17211b=_0x17211b-0x0;var _0x27e7a2=_0xcf6e[_0x17211b];return _0x27e7a2;};'use strict';var _=require(_0xecf6('0x0'));var util=require(_0xecf6('0x1'));var moment=require(_0xecf6('0x2'));var BPromise=require(_0xecf6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xecf6('0x4'));var db=require(_0xecf6('0x5'))['db'];var utils=require(_0xecf6('0x6'));var logger=require(_0xecf6('0x7'))(_0xecf6('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xecf6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d84f7,_0x10e3cf,_0x498ddb){return new BPromise(function(_0x5dfb00,_0x3c1554){return client[_0xecf6('0xa')](_0x4d84f7,_0x498ddb)['then'](function(_0x517a45){logger[_0xecf6('0xb')](_0xecf6('0xc'),_0x10e3cf,_0xecf6('0xd'));logger['debug'](_0xecf6('0xe'),_0x10e3cf,'request\x20sent',JSON[_0xecf6('0xf')](_0x517a45));if(_0x517a45['error']){if(_0x517a45['error'][_0xecf6('0x10')]===0x1f4){logger[_0xecf6('0x11')](_0xecf6('0xc'),_0x10e3cf,_0x517a45[_0xecf6('0x11')]['message']);return _0x3c1554(_0x517a45['error']['message']);}logger[_0xecf6('0x11')](_0xecf6('0xc'),_0x10e3cf,_0x517a45[_0xecf6('0x11')][_0xecf6('0x12')]);return _0x5dfb00(_0x517a45[_0xecf6('0x11')][_0xecf6('0x12')]);}else{logger[_0xecf6('0xb')](_0xecf6('0xc'),_0x10e3cf,_0xecf6('0xd'));_0x5dfb00(_0x517a45['result']['message']);}})['catch'](function(_0x1b45ef){logger[_0xecf6('0x11')]('ChatApplication,\x20%s,\x20%s',_0x10e3cf,_0x1b45ef);_0x3c1554(_0x1b45ef);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 3deedcc..387f371 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 _0x91c6=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','/:id','delete','exports','multer','util','path','express','fs-extra'];(function(_0x47875a,_0x514333){var _0x50e74d=function(_0x108d24){while(--_0x108d24){_0x47875a['push'](_0x47875a['shift']());}};_0x50e74d(++_0x514333);}(_0x91c6,0x1db));var _0x691c=function(_0x122884,_0x9867c5){_0x122884=_0x122884-0x0;var _0x3b386f=_0x91c6[_0x122884];return _0x3b386f;};'use strict';var multer=require(_0x691c('0x0'));var util=require(_0x691c('0x1'));var path=require(_0x691c('0x2'));var timeout=require('connect-timeout');var express=require(_0x691c('0x3'));var router=express['Router']();var fs_extra=require(_0x691c('0x4'));var auth=require(_0x691c('0x5'));var interaction=require(_0x691c('0x6'));var config=require(_0x691c('0x7'));var controller=require(_0x691c('0x8'));router[_0x691c('0x9')]('/:id',auth[_0x691c('0xa')](),controller[_0x691c('0xb')]);router['put'](_0x691c('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x691c('0xd')](_0x691c('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x691c('0xe')]=router; \ No newline at end of file +var _0xf56e=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','update'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0xf56e,0x135));var _0xef56=function(_0x2068ae,_0x455540){_0x2068ae=_0x2068ae-0x0;var _0x37d844=_0xf56e[_0x2068ae];return _0x37d844;};'use strict';var multer=require(_0xef56('0x0'));var util=require(_0xef56('0x1'));var path=require(_0xef56('0x2'));var timeout=require(_0xef56('0x3'));var express=require(_0xef56('0x4'));var router=express[_0xef56('0x5')]();var fs_extra=require(_0xef56('0x6'));var auth=require(_0xef56('0x7'));var interaction=require(_0xef56('0x8'));var config=require(_0xef56('0x9'));var controller=require(_0xef56('0xa'));router['get'](_0xef56('0xb'),auth[_0xef56('0xc')](),controller[_0xef56('0xd')]);router['put']('/:id',auth[_0xef56('0xc')](),controller[_0xef56('0xe')]);router[_0xef56('0xf')](_0xef56('0xb'),auth[_0xef56('0xc')](),controller[_0xef56('0x10')]);module[_0xef56('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index bb9f5a5..92ee992 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 _0xc9d9=['sequelize','STRING','BOOLEAN'];(function(_0x4ce3b8,_0x4e86ea){var _0x39056c=function(_0x548e93){while(--_0x548e93){_0x4ce3b8['push'](_0x4ce3b8['shift']());}};_0x39056c(++_0x4e86ea);}(_0xc9d9,0x195));var _0x9c9d=function(_0x2c4ead,_0x6d53e2){_0x2c4ead=_0x2c4ead-0x0;var _0x8100f=_0xc9d9[_0x2c4ead];return _0x8100f;};'use strict';var Sequelize=require(_0x9c9d('0x0'));module['exports']={'name':{'type':Sequelize[_0x9c9d('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x9c9d('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x0170=['STRING','BOOLEAN','sequelize','exports'];(function(_0x41430d,_0x45f545){var _0x3167da=function(_0x12640f){while(--_0x12640f){_0x41430d['push'](_0x41430d['shift']());}};_0x3167da(++_0x45f545);}(_0x0170,0x1d6));var _0x0017=function(_0x5e09f1,_0x4903d1){_0x5e09f1=_0x5e09f1-0x0;var _0x6e80c1=_0x0170[_0x5e09f1];return _0x6e80c1;};'use strict';var Sequelize=require(_0x0017('0x0'));module[_0x0017('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x0017('0x2')]},'write':{'type':Sequelize[_0x0017('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 d902502..a44549e 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 _0x0d59=['reject','save','then','destroy','error','stack','name','index','ChatGroup','rawAttributes','fieldName','type','query','filters','model','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','catch','params','keys','attributes','length','include','find','create','body','update','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','User','map','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply'];(function(_0x252cab,_0x228f2d){var _0x5c5f1e=function(_0xaf4d22){while(--_0xaf4d22){_0x252cab['push'](_0x252cab['shift']());}};_0x5c5f1e(++_0x228f2d);}(_0x0d59,0x1ac));var _0x90d5=function(_0xdaab62,_0x2728ab){_0xdaab62=_0xdaab62-0x0;var _0x13d767=_0x0d59[_0xdaab62];return _0x13d767;};'use strict';var emlformat=require(_0x90d5('0x0'));var rimraf=require(_0x90d5('0x1'));var zipdir=require(_0x90d5('0x2'));var jsonpatch=require(_0x90d5('0x3'));var rp=require('request-promise');var moment=require(_0x90d5('0x4'));var BPromise=require(_0x90d5('0x5'));var Mustache=require(_0x90d5('0x6'));var util=require(_0x90d5('0x7'));var path=require(_0x90d5('0x8'));var sox=require(_0x90d5('0x9'));var csv=require(_0x90d5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x90d5('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x90d5('0xc'));var jsforce=require(_0x90d5('0xd'));var deskjs=require(_0x90d5('0xe'));var toCsv=require(_0x90d5('0xa'));var querystring=require(_0x90d5('0xf'));var Papa=require(_0x90d5('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x90d5('0x11'));var hardwareService=require(_0x90d5('0x12'));var logger=require(_0x90d5('0x13'))(_0x90d5('0x14'));var utils=require(_0x90d5('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x90d5('0x16'))['db'];config['redis']=_['defaults'](config[_0x90d5('0x17')],{'host':_0x90d5('0x18'),'port':0x18eb});var socket=require(_0x90d5('0x19'))(new Redis(config[_0x90d5('0x17')]));require('./chatGroup.socket')[_0x90d5('0x1a')](socket);function respondWithStatusCode(_0xb52769,_0x4941cc){_0x4941cc=_0x4941cc||0xcc;return function(_0x2b66a8){if(_0x2b66a8){return _0xb52769[_0x90d5('0x1b')](_0x4941cc);}return _0xb52769[_0x90d5('0x1c')](_0x4941cc)[_0x90d5('0x1d')]();};}function respondWithResult(_0x8cdf1f,_0x58bf80){_0x58bf80=_0x58bf80||0xc8;return function(_0x5ec7c5){if(_0x5ec7c5){return _0x8cdf1f['status'](_0x58bf80)[_0x90d5('0x1e')](_0x5ec7c5);}};}function respondWithFilteredResult(_0x39dae0,_0x4c4e90){return function(_0xbf63da){if(_0xbf63da){var _0x549de9=typeof _0x4c4e90[_0x90d5('0x1f')]===_0x90d5('0x20')&&typeof _0x4c4e90[_0x90d5('0x21')]===_0x90d5('0x20');var _0x3f754c=_0xbf63da[_0x90d5('0x22')];var _0x1ee93f=_0x549de9?0x0:_0x4c4e90['offset'];var _0x1a8fac=_0x549de9?_0xbf63da['count']:_0x4c4e90[_0x90d5('0x1f')]+_0x4c4e90['limit'];var _0x58608a;if(_0x1a8fac>=_0x3f754c){_0x1a8fac=_0x3f754c;_0x58608a=0xc8;}else{_0x58608a=0xce;}_0x39dae0['status'](_0x58608a);return _0x39dae0['set'](_0x90d5('0x23'),_0x1ee93f+'-'+_0x1a8fac+'/'+_0x3f754c)[_0x90d5('0x1e')](_0xbf63da);}return null;};}function patchUpdates(_0x5a6c06){return function(_0x47c566){try{jsonpatch[_0x90d5('0x24')](_0x47c566,_0x5a6c06,!![]);}catch(_0x1d3913){return BPromise[_0x90d5('0x25')](_0x1d3913);}return _0x47c566[_0x90d5('0x26')]();};}function saveUpdates(_0x46ccdb,_0x239f31){return function(_0x30bc9a){if(_0x30bc9a){return _0x30bc9a['update'](_0x46ccdb)[_0x90d5('0x27')](function(_0xe59bef){return _0xe59bef;});}return null;};}function removeEntity(_0x54ef5c,_0xc2df75){return function(_0x30d214){if(_0x30d214){return _0x30d214[_0x90d5('0x28')]()[_0x90d5('0x27')](function(){_0x54ef5c['status'](0xcc)[_0x90d5('0x1d')]();});}};}function handleEntityNotFound(_0x57d69e,_0x56a7b5){return function(_0x417d0f){if(!_0x417d0f){_0x57d69e[_0x90d5('0x1b')](0x194);}return _0x417d0f;};}function handleError(_0x36c585,_0x31d8af){_0x31d8af=_0x31d8af||0x1f4;return function(_0x1d1503){logger[_0x90d5('0x29')](_0x1d1503[_0x90d5('0x2a')]);if(_0x1d1503[_0x90d5('0x2b')]){delete _0x1d1503[_0x90d5('0x2b')];}_0x36c585[_0x90d5('0x1c')](_0x31d8af)['send'](_0x1d1503);};}exports[_0x90d5('0x2c')]=function(_0x43061e,_0x4c3749){var _0x528fc2={},_0x314815={},_0x112f0b={'count':0x0,'rows':[]};var _0x14aa0d=_['map'](db[_0x90d5('0x2d')][_0x90d5('0x2e')],function(_0x508bb3){return{'name':_0x508bb3[_0x90d5('0x2f')],'type':_0x508bb3[_0x90d5('0x30')]['key']};});_0x314815['model']=_['map'](_0x14aa0d,_0x90d5('0x2b'));_0x314815[_0x90d5('0x31')]=_['keys'](_0x43061e[_0x90d5('0x31')]);_0x314815[_0x90d5('0x32')]=_['intersection'](_0x314815[_0x90d5('0x33')],_0x314815[_0x90d5('0x31')]);_0x528fc2['attributes']=_[_0x90d5('0x34')](_0x314815['model'],qs[_0x90d5('0x35')](_0x43061e[_0x90d5('0x31')][_0x90d5('0x35')]));_0x528fc2['attributes']=_0x528fc2['attributes']['length']?_0x528fc2['attributes']:_0x314815[_0x90d5('0x33')];if(!_0x43061e[_0x90d5('0x31')][_0x90d5('0x36')](_0x90d5('0x37'))){_0x528fc2[_0x90d5('0x21')]=qs[_0x90d5('0x21')](_0x43061e[_0x90d5('0x31')][_0x90d5('0x21')]);_0x528fc2[_0x90d5('0x1f')]=qs['offset'](_0x43061e['query'][_0x90d5('0x1f')]);}_0x528fc2[_0x90d5('0x38')]=qs[_0x90d5('0x39')](_0x43061e[_0x90d5('0x31')][_0x90d5('0x39')]);_0x528fc2[_0x90d5('0x3a')]=qs[_0x90d5('0x32')](_[_0x90d5('0x3b')](_0x43061e[_0x90d5('0x31')],_0x314815[_0x90d5('0x32')]),_0x14aa0d);if(_0x43061e['query'][_0x90d5('0x3c')]){_0x528fc2[_0x90d5('0x3a')]=_[_0x90d5('0x3d')](_0x528fc2['where'],{'$or':_['map'](_0x14aa0d,function(_0xa78192){if(_0xa78192['type']!=='VIRTUAL'){var _0x203d59={};_0x203d59[_0xa78192[_0x90d5('0x2b')]]={'$like':'%'+_0x43061e['query'][_0x90d5('0x3c')]+'%'};return _0x203d59;}})});}_0x528fc2=_[_0x90d5('0x3d')]({},_0x528fc2,_0x43061e[_0x90d5('0x3e')]);var _0xb2a05e={'where':_0x528fc2['where']};return db[_0x90d5('0x2d')][_0x90d5('0x22')](_0xb2a05e)[_0x90d5('0x27')](function(_0x81ac87){_0x112f0b[_0x90d5('0x22')]=_0x81ac87;if(_0x43061e[_0x90d5('0x31')][_0x90d5('0x3f')]){_0x528fc2['include']=[{'all':!![]}];}return db[_0x90d5('0x2d')]['findAll'](_0x528fc2);})[_0x90d5('0x27')](function(_0xe44cb2){_0x112f0b['rows']=_0xe44cb2;return _0x112f0b;})[_0x90d5('0x27')](respondWithFilteredResult(_0x4c3749,_0x528fc2))[_0x90d5('0x40')](handleError(_0x4c3749,null));};exports['show']=function(_0x865f19,_0x2ffd01){var _0x1b41d2={'raw':!![],'where':{'id':_0x865f19[_0x90d5('0x41')]['id']}},_0x226f12={};_0x226f12[_0x90d5('0x33')]=_[_0x90d5('0x42')](db[_0x90d5('0x2d')][_0x90d5('0x2e')]);_0x226f12[_0x90d5('0x31')]=_[_0x90d5('0x42')](_0x865f19['query']);_0x226f12[_0x90d5('0x32')]=_['intersection'](_0x226f12['model'],_0x226f12[_0x90d5('0x31')]);_0x1b41d2['attributes']=_[_0x90d5('0x34')](_0x226f12['model'],qs['fields'](_0x865f19[_0x90d5('0x31')][_0x90d5('0x35')]));_0x1b41d2[_0x90d5('0x43')]=_0x1b41d2[_0x90d5('0x43')][_0x90d5('0x44')]?_0x1b41d2[_0x90d5('0x43')]:_0x226f12[_0x90d5('0x33')];if(_0x865f19['query']['includeAll']){_0x1b41d2[_0x90d5('0x45')]=[{'all':!![]}];}_0x1b41d2=_[_0x90d5('0x3d')]({},_0x1b41d2,_0x865f19[_0x90d5('0x3e')]);return db[_0x90d5('0x2d')][_0x90d5('0x46')](_0x1b41d2)[_0x90d5('0x27')](handleEntityNotFound(_0x2ffd01,null))['then'](respondWithResult(_0x2ffd01,null))[_0x90d5('0x40')](handleError(_0x2ffd01,null));};exports[_0x90d5('0x47')]=function(_0x343748,_0x4e5d16){return db[_0x90d5('0x2d')][_0x90d5('0x47')](_0x343748[_0x90d5('0x48')],{})[_0x90d5('0x27')](respondWithResult(_0x4e5d16,0xc9))[_0x90d5('0x40')](handleError(_0x4e5d16,null));};exports[_0x90d5('0x49')]=function(_0x38ed41,_0x2a2d84){if(_0x38ed41[_0x90d5('0x48')]['id']){delete _0x38ed41[_0x90d5('0x48')]['id'];}return db[_0x90d5('0x2d')][_0x90d5('0x46')]({'where':{'id':_0x38ed41['params']['id']}})[_0x90d5('0x27')](handleEntityNotFound(_0x2a2d84,null))['then'](saveUpdates(_0x38ed41[_0x90d5('0x48')],null))[_0x90d5('0x27')](respondWithResult(_0x2a2d84,null))[_0x90d5('0x40')](handleError(_0x2a2d84,null));};exports[_0x90d5('0x28')]=function(_0x2ce545,_0x1fa33f){return db[_0x90d5('0x2d')][_0x90d5('0x46')]({'where':{'id':_0x2ce545[_0x90d5('0x41')]['id']}})[_0x90d5('0x27')](handleEntityNotFound(_0x1fa33f,null))['then'](removeEntity(_0x1fa33f,null))['catch'](handleError(_0x1fa33f,null));};exports[_0x90d5('0x4a')]=function(_0x43c8ec,_0x40f035){return db['ChatGroup'][_0x90d5('0x4a')]()[_0x90d5('0x27')](respondWithResult(_0x40f035,null))[_0x90d5('0x40')](handleError(_0x40f035,null));};exports[_0x90d5('0x4b')]=function(_0x3d3726,_0x2e73e3,_0x50d0b2){return db[_0x90d5('0x4c')][_0x90d5('0x22')]({'where':{'ChatGroupId':_0x3d3726[_0x90d5('0x41')]['id'],'ToId':_0x3d3726[_0x90d5('0x4d')]['id'],'read':![]}})['then'](function(_0x38bae3){return{'id':_[_0x90d5('0x4e')](_0x3d3726[_0x90d5('0x41')]['id']),'count':_0x38bae3};})[_0x90d5('0x27')](respondWithResult(_0x2e73e3,null))['catch'](handleError(_0x2e73e3,null));};exports[_0x90d5('0x4f')]=function(_0x1220a7,_0x1e56ac,_0x202b4c){return db['ChatGroup'][_0x90d5('0x46')]({'where':{'id':_0x1220a7[_0x90d5('0x41')]['id']}})[_0x90d5('0x27')](handleEntityNotFound(_0x1e56ac,null))['then'](function(_0x288d8f){if(_0x288d8f){return _0x288d8f[_0x90d5('0x4f')](_0x1220a7[_0x90d5('0x48')][_0x90d5('0x50')],_['omit'](_0x1220a7['body'],[_0x90d5('0x50'),'id'])||{});}})[_0x90d5('0x27')](respondWithResult(_0x1e56ac,null))[_0x90d5('0x40')](handleError(_0x1e56ac,null));};exports['getMembers']=function(_0x53a8c9,_0x3f95e3,_0x4ca241){var _0x495daa={};var _0x4fd60b={};var _0x5b5f1c;var _0x1bb019;return db['ChatGroup']['findOne']({'where':{'id':_0x53a8c9['params']['id']}})[_0x90d5('0x27')](handleEntityNotFound(_0x3f95e3,null))['then'](function(_0xfb6524){if(_0xfb6524){_0x5b5f1c=_0xfb6524;_0x4fd60b[_0x90d5('0x33')]=_['keys'](db[_0x90d5('0x51')]['rawAttributes']);_0x4fd60b[_0x90d5('0x31')]=_[_0x90d5('0x42')](_0x53a8c9[_0x90d5('0x31')]);_0x4fd60b['filters']=_[_0x90d5('0x34')](_0x4fd60b[_0x90d5('0x33')],_0x4fd60b[_0x90d5('0x31')]);_0x495daa[_0x90d5('0x43')]=_[_0x90d5('0x34')](_0x4fd60b[_0x90d5('0x33')],qs[_0x90d5('0x35')](_0x53a8c9[_0x90d5('0x31')][_0x90d5('0x35')]));_0x495daa[_0x90d5('0x43')]=_0x495daa[_0x90d5('0x43')][_0x90d5('0x44')]?_0x495daa[_0x90d5('0x43')]:_0x4fd60b[_0x90d5('0x33')];_0x495daa[_0x90d5('0x38')]=qs[_0x90d5('0x39')](_0x53a8c9['query'][_0x90d5('0x39')]);_0x495daa[_0x90d5('0x3a')]=qs[_0x90d5('0x32')](_[_0x90d5('0x3b')](_0x53a8c9[_0x90d5('0x31')],_0x4fd60b[_0x90d5('0x32')]));if(_0x53a8c9[_0x90d5('0x31')][_0x90d5('0x3c')]){_0x495daa[_0x90d5('0x3a')]=_[_0x90d5('0x3d')](_0x495daa[_0x90d5('0x3a')],{'$or':_[_0x90d5('0x52')](_0x495daa[_0x90d5('0x43')],function(_0x4d3d40){var _0x3b2109={};_0x3b2109[_0x4d3d40]={'$like':'%'+_0x53a8c9[_0x90d5('0x31')][_0x90d5('0x3c')]+'%'};return _0x3b2109;})});}_0x495daa=_[_0x90d5('0x3d')]({},_0x495daa,_0x53a8c9['options']);return _0x5b5f1c['getMembers'](_0x495daa);}})[_0x90d5('0x27')](function(_0x456137){if(_0x456137){_0x1bb019=_0x456137['length'];if(!_0x53a8c9['query'][_0x90d5('0x36')](_0x90d5('0x37'))){_0x495daa['limit']=qs[_0x90d5('0x21')](_0x53a8c9[_0x90d5('0x31')][_0x90d5('0x21')]);_0x495daa[_0x90d5('0x1f')]=qs['offset'](_0x53a8c9['query'][_0x90d5('0x1f')]);}return _0x5b5f1c[_0x90d5('0x53')](_0x495daa);}})['then'](function(_0x2eab72){if(_0x2eab72){return _0x2eab72?{'count':_0x1bb019,'rows':_0x2eab72}:null;}})[_0x90d5('0x27')](respondWithResult(_0x3f95e3,null))[_0x90d5('0x40')](handleError(_0x3f95e3,null));};exports[_0x90d5('0x54')]=function(_0x1bc26d,_0x28b925,_0x2d35b7){return db[_0x90d5('0x2d')][_0x90d5('0x46')]({'where':{'id':_0x1bc26d[_0x90d5('0x41')]['id']}})[_0x90d5('0x27')](handleEntityNotFound(_0x28b925,null))[_0x90d5('0x27')](function(_0x345469){if(_0x345469){return _0x345469[_0x90d5('0x54')](_0x1bc26d[_0x90d5('0x31')]['ids']);}})[_0x90d5('0x27')](respondWithStatusCode(_0x28b925,null))[_0x90d5('0x40')](handleError(_0x28b925,null));};exports[_0x90d5('0x55')]=function(_0x3999da,_0x196ed5,_0x3e82ed){if(_0x3999da[_0x90d5('0x48')]['id']){delete _0x3999da[_0x90d5('0x48')]['id'];}return db[_0x90d5('0x2d')][_0x90d5('0x46')]({'where':{'id':_0x3999da[_0x90d5('0x41')]['id']}})[_0x90d5('0x27')](handleEntityNotFound(_0x196ed5,null))[_0x90d5('0x27')](function(_0x258c3c){if(_0x258c3c){_0x3999da[_0x90d5('0x48')][_0x90d5('0x56')]=_0x258c3c['id'];return db[_0x90d5('0x4c')][_0x90d5('0x47')](_0x3999da[_0x90d5('0x48')]);}})['then'](respondWithResult(_0x196ed5,null))[_0x90d5('0x40')](handleError(_0x196ed5,null));};exports[_0x90d5('0x57')]=function(_0x4ab99c,_0x3249dd,_0xebfbf9){var _0x409917={};var _0x59faf8={};var _0x3f930e;var _0x1f7efe;return db['ChatGroup'][_0x90d5('0x58')]({'where':{'id':_0x4ab99c[_0x90d5('0x41')]['id']}})[_0x90d5('0x27')](handleEntityNotFound(_0x3249dd,null))[_0x90d5('0x27')](function(_0x48e524){if(_0x48e524){_0x3f930e=_0x48e524;_0x59faf8[_0x90d5('0x33')]=_[_0x90d5('0x42')](db['ChatInternalMessage'][_0x90d5('0x2e')]);_0x59faf8[_0x90d5('0x31')]=_[_0x90d5('0x42')](_0x4ab99c[_0x90d5('0x31')]);_0x59faf8[_0x90d5('0x32')]=_[_0x90d5('0x34')](_0x59faf8[_0x90d5('0x33')],_0x59faf8[_0x90d5('0x31')]);_0x409917['attributes']=_[_0x90d5('0x34')](_0x59faf8['model'],qs[_0x90d5('0x35')](_0x4ab99c[_0x90d5('0x31')]['fields']));_0x409917[_0x90d5('0x43')]=_0x409917[_0x90d5('0x43')][_0x90d5('0x44')]?_0x409917[_0x90d5('0x43')]:_0x59faf8['model'];_0x409917['order']=qs[_0x90d5('0x39')](_0x4ab99c[_0x90d5('0x31')]['sort']);_0x409917[_0x90d5('0x3a')]=qs[_0x90d5('0x32')](_['pick'](_0x4ab99c['query'],_0x59faf8[_0x90d5('0x32')]));if(_0x4ab99c[_0x90d5('0x31')][_0x90d5('0x3c')]){_0x409917[_0x90d5('0x3a')]=_[_0x90d5('0x3d')](_0x409917[_0x90d5('0x3a')],{'$or':_['map'](_0x409917['attributes'],function(_0x4ad79b){var _0x5432d6={};_0x5432d6[_0x4ad79b]={'$like':'%'+_0x4ab99c[_0x90d5('0x31')]['filter']+'%'};return _0x5432d6;})});}if(_0x4ab99c[_0x90d5('0x31')][_0x90d5('0x59')]){var _0x54aa84=_0x4ab99c['query'][_0x90d5('0x59')][_0x90d5('0x5a')](',');var _0x32ea3e={};_0x32ea3e[_0x54aa84[0x0]]={'$gte':moment(_0x54aa84[0x1])[_0x90d5('0x5b')](_0x90d5('0x5c'))};_0x409917['where']=_[_0x90d5('0x3d')](_0x409917[_0x90d5('0x3a')],_0x32ea3e);}_0x409917=_[_0x90d5('0x3d')]({},_0x409917,_0x4ab99c[_0x90d5('0x3e')]);return _0x3f930e['getMessages'](_0x409917);}})['then'](function(_0x5ab560){if(_0x5ab560){_0x1f7efe=_0x5ab560['length'];if(!_0x4ab99c['query'][_0x90d5('0x36')](_0x90d5('0x37'))){_0x409917[_0x90d5('0x21')]=qs[_0x90d5('0x21')](_0x4ab99c[_0x90d5('0x31')][_0x90d5('0x21')]);_0x409917['offset']=qs[_0x90d5('0x1f')](_0x4ab99c[_0x90d5('0x31')][_0x90d5('0x1f')]);}return _0x3f930e[_0x90d5('0x57')](_0x409917);}})[_0x90d5('0x27')](function(_0x104688){if(_0x104688){return _0x104688?{'count':_0x1f7efe,'rows':_0x104688}:null;}})[_0x90d5('0x27')](respondWithResult(_0x3249dd,null))['catch'](handleError(_0x3249dd,null));}; \ No newline at end of file +var _0xe8fc=['filter','merge','VIRTUAL','options','ChatGroup','includeAll','include','findAll','rows','show','params','find','create','body','catch','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','removeMembers','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','end','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xe8fc,0x149));var _0xce8f=function(_0x35d5ef,_0xf5d87d){_0x35d5ef=_0x35d5ef-0x0;var _0x40356f=_0xe8fc[_0x35d5ef];return _0x40356f;};'use strict';var emlformat=require(_0xce8f('0x0'));var rimraf=require(_0xce8f('0x1'));var zipdir=require(_0xce8f('0x2'));var jsonpatch=require(_0xce8f('0x3'));var rp=require('request-promise');var moment=require(_0xce8f('0x4'));var BPromise=require(_0xce8f('0x5'));var Mustache=require(_0xce8f('0x6'));var util=require(_0xce8f('0x7'));var path=require(_0xce8f('0x8'));var sox=require(_0xce8f('0x9'));var csv=require(_0xce8f('0xa'));var ejs=require(_0xce8f('0xb'));var fs=require('fs');var fs_extra=require(_0xce8f('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xce8f('0xd'));var jsforce=require(_0xce8f('0xe'));var deskjs=require(_0xce8f('0xf'));var toCsv=require('to-csv');var querystring=require(_0xce8f('0x10'));var Papa=require(_0xce8f('0x11'));var Redis=require(_0xce8f('0x12'));var authService=require(_0xce8f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xce8f('0x14'));var hardwareService=require(_0xce8f('0x15'));var logger=require(_0xce8f('0x16'))(_0xce8f('0x17'));var utils=require('../../config/utils');var config=require(_0xce8f('0x18'));var licenseUtil=require(_0xce8f('0x19'));var db=require(_0xce8f('0x1a'))['db'];config[_0xce8f('0x1b')]=_['defaults'](config[_0xce8f('0x1b')],{'host':_0xce8f('0x1c'),'port':0x18eb});var socket=require(_0xce8f('0x1d'))(new Redis(config[_0xce8f('0x1b')]));require(_0xce8f('0x1e'))[_0xce8f('0x1f')](socket);function respondWithStatusCode(_0x1e536e,_0x453e76){_0x453e76=_0x453e76||0xcc;return function(_0x34b16d){if(_0x34b16d){return _0x1e536e[_0xce8f('0x20')](_0x453e76);}return _0x1e536e[_0xce8f('0x21')](_0x453e76)['end']();};}function respondWithResult(_0x2055d8,_0x20c6c7){_0x20c6c7=_0x20c6c7||0xc8;return function(_0x21d085){if(_0x21d085){return _0x2055d8['status'](_0x20c6c7)[_0xce8f('0x22')](_0x21d085);}};}function respondWithFilteredResult(_0x482f41,_0x80e18a){return function(_0x58a219){if(_0x58a219){var _0x27fbb7=typeof _0x80e18a[_0xce8f('0x23')]===_0xce8f('0x24')&&typeof _0x80e18a[_0xce8f('0x25')]===_0xce8f('0x24');var _0x1631bb=_0x58a219[_0xce8f('0x26')];var _0x125c21=_0x27fbb7?0x0:_0x80e18a['offset'];var _0x38e38f=_0x27fbb7?_0x58a219[_0xce8f('0x26')]:_0x80e18a['offset']+_0x80e18a[_0xce8f('0x25')];var _0x19ca18;if(_0x38e38f>=_0x1631bb){_0x38e38f=_0x1631bb;_0x19ca18=0xc8;}else{_0x19ca18=0xce;}_0x482f41[_0xce8f('0x21')](_0x19ca18);return _0x482f41[_0xce8f('0x27')]('Content-Range',_0x125c21+'-'+_0x38e38f+'/'+_0x1631bb)[_0xce8f('0x22')](_0x58a219);}return null;};}function patchUpdates(_0x4cf30b){return function(_0x22113c){try{jsonpatch[_0xce8f('0x28')](_0x22113c,_0x4cf30b,!![]);}catch(_0x41a7df){return BPromise[_0xce8f('0x29')](_0x41a7df);}return _0x22113c[_0xce8f('0x2a')]();};}function saveUpdates(_0x503742,_0x539da4){return function(_0x59474a){if(_0x59474a){return _0x59474a[_0xce8f('0x2b')](_0x503742)['then'](function(_0x384a6f){return _0x384a6f;});}return null;};}function removeEntity(_0x2dd00a,_0x5a24e5){return function(_0x48207d){if(_0x48207d){return _0x48207d[_0xce8f('0x2c')]()[_0xce8f('0x2d')](function(){_0x2dd00a[_0xce8f('0x21')](0xcc)[_0xce8f('0x2e')]();});}};}function handleEntityNotFound(_0x70b22c,_0x1c34ba){return function(_0x2e2940){if(!_0x2e2940){_0x70b22c[_0xce8f('0x20')](0x194);}return _0x2e2940;};}function handleError(_0x4cfb2d,_0x5be323){_0x5be323=_0x5be323||0x1f4;return function(_0x1df531){logger['error'](_0x1df531[_0xce8f('0x2f')]);if(_0x1df531[_0xce8f('0x30')]){delete _0x1df531[_0xce8f('0x30')];}_0x4cfb2d[_0xce8f('0x21')](_0x5be323)[_0xce8f('0x31')](_0x1df531);};}exports[_0xce8f('0x32')]=function(_0x4ae044,_0xf228e8){var _0x39c8ae={},_0x44779d={},_0x272916={'count':0x0,'rows':[]};var _0x128e23=_[_0xce8f('0x33')](db['ChatGroup'][_0xce8f('0x34')],function(_0x354b14){return{'name':_0x354b14['fieldName'],'type':_0x354b14[_0xce8f('0x35')]['key']};});_0x44779d[_0xce8f('0x36')]=_[_0xce8f('0x33')](_0x128e23,'name');_0x44779d[_0xce8f('0x37')]=_[_0xce8f('0x38')](_0x4ae044[_0xce8f('0x37')]);_0x44779d[_0xce8f('0x39')]=_[_0xce8f('0x3a')](_0x44779d[_0xce8f('0x36')],_0x44779d['query']);_0x39c8ae[_0xce8f('0x3b')]=_[_0xce8f('0x3a')](_0x44779d['model'],qs[_0xce8f('0x3c')](_0x4ae044[_0xce8f('0x37')][_0xce8f('0x3c')]));_0x39c8ae['attributes']=_0x39c8ae[_0xce8f('0x3b')][_0xce8f('0x3d')]?_0x39c8ae[_0xce8f('0x3b')]:_0x44779d[_0xce8f('0x36')];if(!_0x4ae044[_0xce8f('0x37')]['hasOwnProperty'](_0xce8f('0x3e'))){_0x39c8ae[_0xce8f('0x25')]=qs[_0xce8f('0x25')](_0x4ae044[_0xce8f('0x37')][_0xce8f('0x25')]);_0x39c8ae[_0xce8f('0x23')]=qs[_0xce8f('0x23')](_0x4ae044[_0xce8f('0x37')]['offset']);}_0x39c8ae[_0xce8f('0x3f')]=qs[_0xce8f('0x40')](_0x4ae044[_0xce8f('0x37')][_0xce8f('0x40')]);_0x39c8ae[_0xce8f('0x41')]=qs[_0xce8f('0x39')](_[_0xce8f('0x42')](_0x4ae044[_0xce8f('0x37')],_0x44779d[_0xce8f('0x39')]),_0x128e23);if(_0x4ae044['query'][_0xce8f('0x43')]){_0x39c8ae[_0xce8f('0x41')]=_[_0xce8f('0x44')](_0x39c8ae[_0xce8f('0x41')],{'$or':_['map'](_0x128e23,function(_0x46f987){if(_0x46f987['type']!==_0xce8f('0x45')){var _0x541e51={};_0x541e51[_0x46f987[_0xce8f('0x30')]]={'$like':'%'+_0x4ae044[_0xce8f('0x37')][_0xce8f('0x43')]+'%'};return _0x541e51;}})});}_0x39c8ae=_['merge']({},_0x39c8ae,_0x4ae044[_0xce8f('0x46')]);var _0x50af6b={'where':_0x39c8ae['where']};return db[_0xce8f('0x47')][_0xce8f('0x26')](_0x50af6b)[_0xce8f('0x2d')](function(_0x51510a){_0x272916[_0xce8f('0x26')]=_0x51510a;if(_0x4ae044[_0xce8f('0x37')][_0xce8f('0x48')]){_0x39c8ae[_0xce8f('0x49')]=[{'all':!![]}];}return db[_0xce8f('0x47')][_0xce8f('0x4a')](_0x39c8ae);})[_0xce8f('0x2d')](function(_0x24d37a){_0x272916[_0xce8f('0x4b')]=_0x24d37a;return _0x272916;})[_0xce8f('0x2d')](respondWithFilteredResult(_0xf228e8,_0x39c8ae))['catch'](handleError(_0xf228e8,null));};exports[_0xce8f('0x4c')]=function(_0x39a1a3,_0x2522f8){var _0x55e594={'raw':!![],'where':{'id':_0x39a1a3[_0xce8f('0x4d')]['id']}},_0xc2707d={};_0xc2707d['model']=_[_0xce8f('0x38')](db['ChatGroup'][_0xce8f('0x34')]);_0xc2707d[_0xce8f('0x37')]=_['keys'](_0x39a1a3[_0xce8f('0x37')]);_0xc2707d[_0xce8f('0x39')]=_[_0xce8f('0x3a')](_0xc2707d[_0xce8f('0x36')],_0xc2707d[_0xce8f('0x37')]);_0x55e594[_0xce8f('0x3b')]=_['intersection'](_0xc2707d[_0xce8f('0x36')],qs[_0xce8f('0x3c')](_0x39a1a3['query']['fields']));_0x55e594[_0xce8f('0x3b')]=_0x55e594[_0xce8f('0x3b')][_0xce8f('0x3d')]?_0x55e594[_0xce8f('0x3b')]:_0xc2707d[_0xce8f('0x36')];if(_0x39a1a3[_0xce8f('0x37')]['includeAll']){_0x55e594['include']=[{'all':!![]}];}_0x55e594=_[_0xce8f('0x44')]({},_0x55e594,_0x39a1a3[_0xce8f('0x46')]);return db['ChatGroup'][_0xce8f('0x4e')](_0x55e594)[_0xce8f('0x2d')](handleEntityNotFound(_0x2522f8,null))[_0xce8f('0x2d')](respondWithResult(_0x2522f8,null))['catch'](handleError(_0x2522f8,null));};exports[_0xce8f('0x4f')]=function(_0x8bb87,_0x3f8691){return db[_0xce8f('0x47')][_0xce8f('0x4f')](_0x8bb87[_0xce8f('0x50')],{})['then'](respondWithResult(_0x3f8691,0xc9))[_0xce8f('0x51')](handleError(_0x3f8691,null));};exports['update']=function(_0x56e9db,_0xcb9d89){if(_0x56e9db['body']['id']){delete _0x56e9db['body']['id'];}return db[_0xce8f('0x47')][_0xce8f('0x4e')]({'where':{'id':_0x56e9db[_0xce8f('0x4d')]['id']}})[_0xce8f('0x2d')](handleEntityNotFound(_0xcb9d89,null))[_0xce8f('0x2d')](saveUpdates(_0x56e9db[_0xce8f('0x50')],null))[_0xce8f('0x2d')](respondWithResult(_0xcb9d89,null))[_0xce8f('0x51')](handleError(_0xcb9d89,null));};exports[_0xce8f('0x2c')]=function(_0x5085c5,_0x32fc10){return db[_0xce8f('0x47')][_0xce8f('0x4e')]({'where':{'id':_0x5085c5[_0xce8f('0x4d')]['id']}})[_0xce8f('0x2d')](handleEntityNotFound(_0x32fc10,null))['then'](removeEntity(_0x32fc10,null))['catch'](handleError(_0x32fc10,null));};exports[_0xce8f('0x52')]=function(_0xb12016,_0x187453){return db[_0xce8f('0x47')][_0xce8f('0x52')]()[_0xce8f('0x2d')](respondWithResult(_0x187453,null))[_0xce8f('0x51')](handleError(_0x187453,null));};exports[_0xce8f('0x53')]=function(_0xa67632,_0x23b7a3,_0x3d87ac){return db[_0xce8f('0x54')]['count']({'where':{'ChatGroupId':_0xa67632['params']['id'],'ToId':_0xa67632[_0xce8f('0x55')]['id'],'read':![]}})[_0xce8f('0x2d')](function(_0x3926f9){return{'id':_[_0xce8f('0x56')](_0xa67632['params']['id']),'count':_0x3926f9};})[_0xce8f('0x2d')](respondWithResult(_0x23b7a3,null))[_0xce8f('0x51')](handleError(_0x23b7a3,null));};exports[_0xce8f('0x57')]=function(_0xdf1b63,_0x5d4254,_0x20e3f9){return db[_0xce8f('0x47')][_0xce8f('0x4e')]({'where':{'id':_0xdf1b63[_0xce8f('0x4d')]['id']}})[_0xce8f('0x2d')](handleEntityNotFound(_0x5d4254,null))[_0xce8f('0x2d')](function(_0x29c876){if(_0x29c876){return _0x29c876[_0xce8f('0x57')](_0xdf1b63['body'][_0xce8f('0x58')],_['omit'](_0xdf1b63[_0xce8f('0x50')],[_0xce8f('0x58'),'id'])||{});}})['then'](respondWithResult(_0x5d4254,null))[_0xce8f('0x51')](handleError(_0x5d4254,null));};exports[_0xce8f('0x59')]=function(_0x2a55da,_0x1acab4,_0x52a4c4){var _0x48deea={};var _0x4353e2={};var _0x10d14a;var _0x2e3a86;return db[_0xce8f('0x47')][_0xce8f('0x5a')]({'where':{'id':_0x2a55da[_0xce8f('0x4d')]['id']}})[_0xce8f('0x2d')](handleEntityNotFound(_0x1acab4,null))['then'](function(_0x50a268){if(_0x50a268){_0x10d14a=_0x50a268;_0x4353e2[_0xce8f('0x36')]=_[_0xce8f('0x38')](db[_0xce8f('0x5b')][_0xce8f('0x34')]);_0x4353e2[_0xce8f('0x37')]=_[_0xce8f('0x38')](_0x2a55da[_0xce8f('0x37')]);_0x4353e2[_0xce8f('0x39')]=_[_0xce8f('0x3a')](_0x4353e2[_0xce8f('0x36')],_0x4353e2['query']);_0x48deea[_0xce8f('0x3b')]=_[_0xce8f('0x3a')](_0x4353e2[_0xce8f('0x36')],qs[_0xce8f('0x3c')](_0x2a55da['query'][_0xce8f('0x3c')]));_0x48deea[_0xce8f('0x3b')]=_0x48deea[_0xce8f('0x3b')][_0xce8f('0x3d')]?_0x48deea[_0xce8f('0x3b')]:_0x4353e2[_0xce8f('0x36')];_0x48deea[_0xce8f('0x3f')]=qs[_0xce8f('0x40')](_0x2a55da['query']['sort']);_0x48deea[_0xce8f('0x41')]=qs[_0xce8f('0x39')](_[_0xce8f('0x42')](_0x2a55da['query'],_0x4353e2[_0xce8f('0x39')]));if(_0x2a55da['query']['filter']){_0x48deea[_0xce8f('0x41')]=_[_0xce8f('0x44')](_0x48deea['where'],{'$or':_[_0xce8f('0x33')](_0x48deea['attributes'],function(_0x2078d9){var _0x4ddd52={};_0x4ddd52[_0x2078d9]={'$like':'%'+_0x2a55da[_0xce8f('0x37')][_0xce8f('0x43')]+'%'};return _0x4ddd52;})});}_0x48deea=_[_0xce8f('0x44')]({},_0x48deea,_0x2a55da[_0xce8f('0x46')]);return _0x10d14a[_0xce8f('0x59')](_0x48deea);}})['then'](function(_0x424136){if(_0x424136){_0x2e3a86=_0x424136[_0xce8f('0x3d')];if(!_0x2a55da['query']['hasOwnProperty']('nolimit')){_0x48deea['limit']=qs[_0xce8f('0x25')](_0x2a55da[_0xce8f('0x37')][_0xce8f('0x25')]);_0x48deea[_0xce8f('0x23')]=qs[_0xce8f('0x23')](_0x2a55da['query'][_0xce8f('0x23')]);}return _0x10d14a[_0xce8f('0x59')](_0x48deea);}})[_0xce8f('0x2d')](function(_0x8f90a7){if(_0x8f90a7){return _0x8f90a7?{'count':_0x2e3a86,'rows':_0x8f90a7}:null;}})['then'](respondWithResult(_0x1acab4,null))[_0xce8f('0x51')](handleError(_0x1acab4,null));};exports[_0xce8f('0x5c')]=function(_0x102448,_0x58cb40,_0x4c3d92){return db[_0xce8f('0x47')]['find']({'where':{'id':_0x102448[_0xce8f('0x4d')]['id']}})[_0xce8f('0x2d')](handleEntityNotFound(_0x58cb40,null))['then'](function(_0x1c59bd){if(_0x1c59bd){return _0x1c59bd[_0xce8f('0x5c')](_0x102448[_0xce8f('0x37')][_0xce8f('0x58')]);}})[_0xce8f('0x2d')](respondWithStatusCode(_0x58cb40,null))[_0xce8f('0x51')](handleError(_0x58cb40,null));};exports['addMessage']=function(_0x1846d3,_0x176259,_0x4939e3){if(_0x1846d3[_0xce8f('0x50')]['id']){delete _0x1846d3[_0xce8f('0x50')]['id'];}return db[_0xce8f('0x47')][_0xce8f('0x4e')]({'where':{'id':_0x1846d3[_0xce8f('0x4d')]['id']}})[_0xce8f('0x2d')](handleEntityNotFound(_0x176259,null))[_0xce8f('0x2d')](function(_0x176512){if(_0x176512){_0x1846d3[_0xce8f('0x50')]['ChatGroupId']=_0x176512['id'];return db[_0xce8f('0x54')][_0xce8f('0x4f')](_0x1846d3[_0xce8f('0x50')]);}})[_0xce8f('0x2d')](respondWithResult(_0x176259,null))['catch'](handleError(_0x176259,null));};exports[_0xce8f('0x5d')]=function(_0x13d463,_0x9faf13,_0x4fb3af){var _0x100b2f={};var _0xc1bd60={};var _0x5777ba;var _0x17c9ca;return db[_0xce8f('0x47')][_0xce8f('0x5a')]({'where':{'id':_0x13d463[_0xce8f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x9faf13,null))[_0xce8f('0x2d')](function(_0x1f2039){if(_0x1f2039){_0x5777ba=_0x1f2039;_0xc1bd60[_0xce8f('0x36')]=_[_0xce8f('0x38')](db[_0xce8f('0x54')][_0xce8f('0x34')]);_0xc1bd60[_0xce8f('0x37')]=_['keys'](_0x13d463[_0xce8f('0x37')]);_0xc1bd60[_0xce8f('0x39')]=_[_0xce8f('0x3a')](_0xc1bd60['model'],_0xc1bd60[_0xce8f('0x37')]);_0x100b2f[_0xce8f('0x3b')]=_[_0xce8f('0x3a')](_0xc1bd60[_0xce8f('0x36')],qs[_0xce8f('0x3c')](_0x13d463[_0xce8f('0x37')][_0xce8f('0x3c')]));_0x100b2f[_0xce8f('0x3b')]=_0x100b2f[_0xce8f('0x3b')]['length']?_0x100b2f['attributes']:_0xc1bd60[_0xce8f('0x36')];_0x100b2f['order']=qs[_0xce8f('0x40')](_0x13d463[_0xce8f('0x37')][_0xce8f('0x40')]);_0x100b2f[_0xce8f('0x41')]=qs[_0xce8f('0x39')](_[_0xce8f('0x42')](_0x13d463[_0xce8f('0x37')],_0xc1bd60[_0xce8f('0x39')]));if(_0x13d463[_0xce8f('0x37')][_0xce8f('0x43')]){_0x100b2f[_0xce8f('0x41')]=_[_0xce8f('0x44')](_0x100b2f[_0xce8f('0x41')],{'$or':_['map'](_0x100b2f[_0xce8f('0x3b')],function(_0x5e97eb){var _0x4c817c={};_0x4c817c[_0x5e97eb]={'$like':'%'+_0x13d463[_0xce8f('0x37')][_0xce8f('0x43')]+'%'};return _0x4c817c;})});}if(_0x13d463[_0xce8f('0x37')][_0xce8f('0x5e')]){var _0x5717f6=_0x13d463[_0xce8f('0x37')][_0xce8f('0x5e')][_0xce8f('0x5f')](',');var _0x57459a={};_0x57459a[_0x5717f6[0x0]]={'$gte':moment(_0x5717f6[0x1])[_0xce8f('0x60')](_0xce8f('0x61'))};_0x100b2f['where']=_[_0xce8f('0x44')](_0x100b2f[_0xce8f('0x41')],_0x57459a);}_0x100b2f=_[_0xce8f('0x44')]({},_0x100b2f,_0x13d463[_0xce8f('0x46')]);return _0x5777ba[_0xce8f('0x5d')](_0x100b2f);}})[_0xce8f('0x2d')](function(_0x3c3188){if(_0x3c3188){_0x17c9ca=_0x3c3188['length'];if(!_0x13d463[_0xce8f('0x37')][_0xce8f('0x62')](_0xce8f('0x3e'))){_0x100b2f[_0xce8f('0x25')]=qs[_0xce8f('0x25')](_0x13d463['query']['limit']);_0x100b2f[_0xce8f('0x23')]=qs['offset'](_0x13d463[_0xce8f('0x37')][_0xce8f('0x23')]);}return _0x5777ba[_0xce8f('0x5d')](_0x100b2f);}})[_0xce8f('0x2d')](function(_0x26a434){if(_0x26a434){return _0x26a434?{'count':_0x17c9ca,'rows':_0x26a434}:null;}})[_0xce8f('0x2d')](respondWithResult(_0x9faf13,null))[_0xce8f('0x51')](handleError(_0x9faf13,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 2af53c5..c2391f9 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 _0x340b=['setMaxListeners','emit','hook','exports','events','../../mysqldb','ChatGroup'];(function(_0x8727fd,_0xdd4faa){var _0x1a3588=function(_0x5a514c){while(--_0x5a514c){_0x8727fd['push'](_0x8727fd['shift']());}};_0x1a3588(++_0xdd4faa);}(_0x340b,0x1b6));var _0xb340=function(_0x3c6f22,_0x4618d4){_0x3c6f22=_0x3c6f22-0x0;var _0x5dc5be=_0x340b[_0x3c6f22];return _0x5dc5be;};'use strict';var EventEmitter=require(_0xb340('0x0'));var ChatGroup=require(_0xb340('0x1'))['db'][_0xb340('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xb340('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5d2004){return function(_0x4a0526,_0x25a9b4,_0x1a7822){ChatGroupEvents[_0xb340('0x4')](_0x5d2004+':'+_0x4a0526['id'],_0x4a0526);ChatGroupEvents['emit'](_0x5d2004,_0x4a0526);_0x1a7822(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xb340('0x5')](e,emitEvent(event));}}module[_0xb340('0x6')]=ChatGroupEvents; \ No newline at end of file +var _0xaecc=['events','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x15876a,_0x15383d){var _0xbd900f=function(_0x103e59){while(--_0x103e59){_0x15876a['push'](_0x15876a['shift']());}};_0xbd900f(++_0x15383d);}(_0xaecc,0x172));var _0xcaec=function(_0x3e1415,_0x2ad5ee){_0x3e1415=_0x3e1415-0x0;var _0x2e1ec7=_0xaecc[_0x3e1415];return _0x2e1ec7;};'use strict';var EventEmitter=require(_0xcaec('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xcaec('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xcaec('0x2')](0x0);var events={'afterCreate':_0xcaec('0x3'),'afterUpdate':_0xcaec('0x4'),'afterDestroy':_0xcaec('0x5')};function emitEvent(_0x1b7339){return function(_0x1de6a3,_0x5ab26c,_0x366499){ChatGroupEvents[_0xcaec('0x6')](_0x1b7339+':'+_0x1de6a3['id'],_0x1de6a3);ChatGroupEvents[_0xcaec('0x6')](_0x1b7339,_0x1de6a3);_0x366499(null);};}for(var e in events){if(events[_0xcaec('0x7')](e)){var event=events[e];ChatGroup[_0xcaec('0x8')](e,emitEvent(event));}}module[_0xcaec('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 6a5651f..45e9076 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 _0xe18b=['ChatGroup','chat_groups','lodash','util','api','moment','request-promise','path','exports','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe18b,0x1a6));var _0xbe18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe18b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbe18('0x0'));var util=require(_0xbe18('0x1'));var logger=require('../../config/logger')(_0xbe18('0x2'));var moment=require(_0xbe18('0x3'));var BPromise=require('bluebird');var rp=require(_0xbe18('0x4'));var fs=require('fs');var path=require(_0xbe18('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0xbe18('0x6')]=function(_0x684159,_0x165d09){return _0x684159[_0xbe18('0x7')](_0xbe18('0x8'),attributes,{'tableName':_0xbe18('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9281=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','ChatGroup'];(function(_0x5820df,_0x24240a){var _0x7a47f1=function(_0x37410b){while(--_0x37410b){_0x5820df['push'](_0x5820df['shift']());}};_0x7a47f1(++_0x24240a);}(_0x9281,0x16b));var _0x1928=function(_0x11666c,_0x2544ad){_0x11666c=_0x11666c-0x0;var _0x4554a5=_0x9281[_0x11666c];return _0x4554a5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1928('0x0'))(_0x1928('0x1'));var moment=require(_0x1928('0x2'));var BPromise=require(_0x1928('0x3'));var rp=require(_0x1928('0x4'));var fs=require('fs');var path=require(_0x1928('0x5'));var rimraf=require(_0x1928('0x6'));var config=require(_0x1928('0x7'));var attributes=require(_0x1928('0x8'));module[_0x1928('0x9')]=function(_0x3cd495,_0x58972c){return _0x3cd495['define'](_0x1928('0xa'),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 4dd749e..46f871e 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 _0xbdba=['redis','defaults','socket.io-emitter','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x47604d,_0x15a014){var _0x388e4c=function(_0x42a446){while(--_0x42a446){_0x47604d['push'](_0x47604d['shift']());}};_0x388e4c(++_0x15a014);}(_0xbdba,0x107));var _0xabdb=function(_0x732d54,_0x5708f4){_0x732d54=_0x732d54-0x0;var _0x55e766=_0xbdba[_0x732d54];return _0x55e766;};'use strict';var _=require(_0xabdb('0x0'));var util=require('util');var moment=require(_0xabdb('0x1'));var BPromise=require(_0xabdb('0x2'));var rs=require(_0xabdb('0x3'));var fs=require('fs');var Redis=require(_0xabdb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xabdb('0x5'));var logger=require(_0xabdb('0x6'))('rpc');var config=require(_0xabdb('0x7'));var jayson=require(_0xabdb('0x8'));var client=jayson[_0xabdb('0x9')]['http']({'port':0x232a});config[_0xabdb('0xa')]=_[_0xabdb('0xb')](config[_0xabdb('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xabdb('0xc'))(new Redis(config[_0xabdb('0xa')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x31227e,_0x4c0c1d,_0x418d19){return new BPromise(function(_0x365c4d,_0x5a258e){return client['request'](_0x31227e,_0x418d19)['then'](function(_0x163861){logger[_0xabdb('0xd')](_0xabdb('0xe'),_0x4c0c1d,_0xabdb('0xf'));logger[_0xabdb('0x10')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x4c0c1d,_0xabdb('0xf'),JSON[_0xabdb('0x11')](_0x163861));if(_0x163861[_0xabdb('0x12')]){if(_0x163861[_0xabdb('0x12')]['code']===0x1f4){logger[_0xabdb('0x12')]('ChatGroup,\x20%s,\x20%s',_0x4c0c1d,_0x163861[_0xabdb('0x12')]['message']);return _0x5a258e(_0x163861[_0xabdb('0x12')][_0xabdb('0x13')]);}logger[_0xabdb('0x12')]('ChatGroup,\x20%s,\x20%s',_0x4c0c1d,_0x163861['error'][_0xabdb('0x13')]);return _0x365c4d(_0x163861[_0xabdb('0x12')][_0xabdb('0x13')]);}else{logger[_0xabdb('0xd')]('ChatGroup,\x20%s,\x20%s',_0x4c0c1d,'request\x20sent');_0x365c4d(_0x163861['result']['message']);}})[_0xabdb('0x14')](function(_0x3ec1a){logger[_0xabdb('0x12')](_0xabdb('0xe'),_0x4c0c1d,_0x3ec1a);_0x5a258e(_0x3ec1a);});});} \ No newline at end of file +var _0x39b3=['register','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0x39b3,0xc9));var _0x339b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x39b3[_0x432682];return _0x463d05;};'use strict';var _=require(_0x339b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x339b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x339b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x339b('0x3'));var logger=require(_0x339b('0x4'))(_0x339b('0x5'));var config=require(_0x339b('0x6'));var jayson=require(_0x339b('0x7'));var client=jayson[_0x339b('0x8')][_0x339b('0x9')]({'port':0x232a});config[_0x339b('0xa')]=_[_0x339b('0xb')](config[_0x339b('0xa')],{'host':_0x339b('0xc'),'port':0x18eb});var socket=require(_0x339b('0xd'))(new Redis(config[_0x339b('0xa')]));require(_0x339b('0xe'))[_0x339b('0xf')](socket);function respondWithRpcPromise(_0x3ce735,_0x2d37e6,_0x4a06ed){return new BPromise(function(_0x640d55,_0xd34d62){return client['request'](_0x3ce735,_0x4a06ed)['then'](function(_0x58cade){logger['info'](_0x339b('0x10'),_0x2d37e6,_0x339b('0x11'));logger[_0x339b('0x12')](_0x339b('0x13'),_0x2d37e6,'request\x20sent',JSON[_0x339b('0x14')](_0x58cade));if(_0x58cade[_0x339b('0x15')]){if(_0x58cade[_0x339b('0x15')][_0x339b('0x16')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x2d37e6,_0x58cade['error'][_0x339b('0x17')]);return _0xd34d62(_0x58cade[_0x339b('0x15')]['message']);}logger[_0x339b('0x15')]('ChatGroup,\x20%s,\x20%s',_0x2d37e6,_0x58cade['error'][_0x339b('0x17')]);return _0x640d55(_0x58cade[_0x339b('0x15')][_0x339b('0x17')]);}else{logger[_0x339b('0x18')](_0x339b('0x10'),_0x2d37e6,'request\x20sent');_0x640d55(_0x58cade[_0x339b('0x19')][_0x339b('0x17')]);}})[_0x339b('0x1a')](function(_0x7872a3){logger[_0x339b('0x15')]('ChatGroup,\x20%s,\x20%s',_0x2d37e6,_0x7872a3);_0xd34d62(_0x7872a3);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 73dd5d4..ee6ce2d 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 _0xcc51=['length','chatGroup:','save','remove','update','emit','removeListener','register'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0xcc51,0xea));var _0x1cc5=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xcc51[_0xd1d19a];return _0x52a79d;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x1cc5('0x0'),_0x1cc5('0x1'),_0x1cc5('0x2')];function createListener(_0x242c0d,_0x104e14){return function(_0x275837){_0x104e14[_0x1cc5('0x3')](_0x242c0d,_0x275837);};}function removeListener(_0x52153e,_0x18ab2a){return function(){ChatGroupEvents[_0x1cc5('0x4')](_0x52153e,_0x18ab2a);};}exports[_0x1cc5('0x5')]=function(_0x25d870){for(var _0x5d32ad=0x0,_0x551dab=events[_0x1cc5('0x6')];_0x5d32ad<_0x551dab;_0x5d32ad++){var _0x5efc9b=events[_0x5d32ad];var _0x351bfd=createListener(_0x1cc5('0x7')+_0x5efc9b,_0x25d870);ChatGroupEvents['on'](_0x5efc9b,_0x351bfd);}}; \ No newline at end of file +var _0x9bfa=['removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x30fae7,_0x562858){var _0x1dbd52=function(_0x4d8c5e){while(--_0x4d8c5e){_0x30fae7['push'](_0x30fae7['shift']());}};_0x1dbd52(++_0x562858);}(_0x9bfa,0xee));var _0xa9bf=function(_0x38825f,_0x5155b4){_0x38825f=_0x38825f-0x0;var _0x364716=_0x9bfa[_0x38825f];return _0x364716;};'use strict';var ChatGroupEvents=require(_0xa9bf('0x0'));var events=[_0xa9bf('0x1'),_0xa9bf('0x2'),_0xa9bf('0x3')];function createListener(_0x47804e,_0x5865f4){return function(_0x2c5730){_0x5865f4[_0xa9bf('0x4')](_0x47804e,_0x2c5730);};}function removeListener(_0x29c7c8,_0x5a82cc){return function(){ChatGroupEvents[_0xa9bf('0x5')](_0x29c7c8,_0x5a82cc);};}exports[_0xa9bf('0x6')]=function(_0x2e9875){for(var _0x11e713=0x0,_0x25a80d=events[_0xa9bf('0x7')];_0x11e713<_0x25a80d;_0x11e713++){var _0x288721=events[_0x11e713];var _0x38307b=createListener(_0xa9bf('0x8')+_0x288721,_0x2e9875);ChatGroupEvents['on'](_0x288721,_0x38307b);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 1a87b22..8e75fb0 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 _0x14ae=['show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','create','post','addMembers','addMessage','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','./chatGroup.controller','index','get','isAuthenticated','describe','/:id'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x14ae,0x152));var _0xe14a=function(_0x531da8,_0x1e61b1){_0x531da8=_0x531da8-0x0;var _0x3901a0=_0x14ae[_0x531da8];return _0x3901a0;};'use strict';var multer=require(_0xe14a('0x0'));var util=require(_0xe14a('0x1'));var path=require(_0xe14a('0x2'));var timeout=require('connect-timeout');var express=require(_0xe14a('0x3'));var router=express[_0xe14a('0x4')]();var fs_extra=require(_0xe14a('0x5'));var auth=require(_0xe14a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe14a('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe14a('0x8')]);router[_0xe14a('0x9')]('/describe',auth[_0xe14a('0xa')](),controller[_0xe14a('0xb')]);router[_0xe14a('0x9')](_0xe14a('0xc'),auth[_0xe14a('0xa')](),controller[_0xe14a('0xd')]);router[_0xe14a('0x9')](_0xe14a('0xe'),auth[_0xe14a('0xa')](),controller[_0xe14a('0xf')]);router['get'](_0xe14a('0x10'),auth[_0xe14a('0xa')](),controller['getMembers']);router[_0xe14a('0x9')](_0xe14a('0x11'),auth[_0xe14a('0xa')](),controller[_0xe14a('0x12')]);router['post']('/',auth[_0xe14a('0xa')](),controller[_0xe14a('0x13')]);router[_0xe14a('0x14')](_0xe14a('0x10'),auth[_0xe14a('0xa')](),controller[_0xe14a('0x15')]);router[_0xe14a('0x14')](_0xe14a('0x11'),auth[_0xe14a('0xa')](),controller[_0xe14a('0x16')]);router[_0xe14a('0x17')](_0xe14a('0xc'),auth[_0xe14a('0xa')](),controller[_0xe14a('0x18')]);router[_0xe14a('0x19')]('/:id',auth[_0xe14a('0xa')](),controller[_0xe14a('0x1a')]);router[_0xe14a('0x19')](_0xe14a('0x10'),auth[_0xe14a('0xa')](),controller['removeMembers']);module['exports']=router; \ No newline at end of file +var _0x652a=['exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','/:id','delete','destroy','removeMembers'];(function(_0x194d03,_0x34be64){var _0x14c9d5=function(_0x53a69b){while(--_0x53a69b){_0x194d03['push'](_0x194d03['shift']());}};_0x14c9d5(++_0x34be64);}(_0x652a,0x175));var _0xa652=function(_0x560788,_0x13d82a){_0x560788=_0x560788-0x0;var _0x4aa652=_0x652a[_0x560788];return _0x4aa652;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa652('0x0'));var timeout=require(_0xa652('0x1'));var express=require(_0xa652('0x2'));var router=express[_0xa652('0x3')]();var fs_extra=require(_0xa652('0x4'));var auth=require(_0xa652('0x5'));var interaction=require(_0xa652('0x6'));var config=require(_0xa652('0x7'));var controller=require(_0xa652('0x8'));router[_0xa652('0x9')]('/',auth['isAuthenticated'](),controller[_0xa652('0xa')]);router[_0xa652('0x9')](_0xa652('0xb'),auth[_0xa652('0xc')](),controller[_0xa652('0xd')]);router[_0xa652('0x9')]('/:id',auth[_0xa652('0xc')](),controller[_0xa652('0xe')]);router[_0xa652('0x9')](_0xa652('0xf'),auth[_0xa652('0xc')](),controller[_0xa652('0x10')]);router[_0xa652('0x9')](_0xa652('0x11'),auth[_0xa652('0xc')](),controller[_0xa652('0x12')]);router[_0xa652('0x9')](_0xa652('0x13'),auth[_0xa652('0xc')](),controller[_0xa652('0x14')]);router[_0xa652('0x15')]('/',auth[_0xa652('0xc')](),controller[_0xa652('0x16')]);router[_0xa652('0x15')](_0xa652('0x11'),auth[_0xa652('0xc')](),controller[_0xa652('0x17')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0xa652('0x18')]);router[_0xa652('0x19')](_0xa652('0x1a'),auth[_0xa652('0xc')](),controller['update']);router[_0xa652('0x1b')]('/:id',auth[_0xa652('0xc')](),controller[_0xa652('0x1c')]);router[_0xa652('0x1b')](_0xa652('0x11'),auth[_0xa652('0xc')](),controller[_0xa652('0x1d')]);module[_0xa652('0x1e')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index d75b215..8b82c36 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 _0x0c71=['BOOLEAN','exports','INTEGER','ENUM','star','TEXT','STRING','DATE','long','out'];(function(_0x16938f,_0x35e57f){var _0x5c66e9=function(_0x5167d7){while(--_0x5167d7){_0x16938f['push'](_0x16938f['shift']());}};_0x5c66e9(++_0x35e57f);}(_0x0c71,0xfb));var _0x10c7=function(_0x2474b0,_0x464f13){_0x2474b0=_0x2474b0-0x0;var _0x3c1022=_0x0c71[_0x2474b0];return _0x3c1022;};'use strict';var Sequelize=require('sequelize');module[_0x10c7('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x10c7('0x1')]},'ratingType':{'type':Sequelize[_0x10c7('0x2')](_0x10c7('0x3'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x10c7('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x10c7('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x10c7('0x6')]},'disposition':{'type':Sequelize[_0x10c7('0x5')]},'secondDisposition':{'type':Sequelize[_0x10c7('0x5')]},'thirdDisposition':{'type':Sequelize[_0x10c7('0x5')]},'note':{'type':Sequelize[_0x10c7('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x10c7('0x5')]},'osName':{'type':Sequelize[_0x10c7('0x5')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x10c7('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x10c7('0x4')]},'customerIp':{'type':Sequelize[_0x10c7('0x5')]},'formData':{'type':Sequelize['TEXT'](_0x10c7('0x7'))},'read1stAt':{'type':Sequelize[_0x10c7('0x6')]},'lastMsgAt':{'type':Sequelize[_0x10c7('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x10c7('0x2')]('in',_0x10c7('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x10c7('0x5')]},'customerPort':{'type':Sequelize[_0x10c7('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x10c7('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x10c7('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0xe511=['DATE','long','ENUM','out','sequelize','exports','INTEGER','star','thumb','TEXT','STRING'];(function(_0xd3d9fa,_0x455487){var _0x441540=function(_0xc89223){while(--_0xc89223){_0xd3d9fa['push'](_0xd3d9fa['shift']());}};_0x441540(++_0x455487);}(_0xe511,0x16f));var _0x1e51=function(_0x69f883,_0x5c785d){_0x69f883=_0x69f883-0x0;var _0x5472ee=_0xe511[_0x69f883];return _0x5472ee;};'use strict';var Sequelize=require(_0x1e51('0x0'));module[_0x1e51('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x1e51('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x1e51('0x3'),_0x1e51('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x1e51('0x5')]},'pathTranscript':{'type':Sequelize[_0x1e51('0x5')]},'mailTranscript':{'type':Sequelize[_0x1e51('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x1e51('0x7')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x1e51('0x6')]},'thirdDisposition':{'type':Sequelize[_0x1e51('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x1e51('0x6')]},'osName':{'type':Sequelize[_0x1e51('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x1e51('0x6')]},'deviceType':{'type':Sequelize[_0x1e51('0x6')]},'referer':{'type':Sequelize[_0x1e51('0x5')]},'customerIp':{'type':Sequelize[_0x1e51('0x6')]},'formData':{'type':Sequelize[_0x1e51('0x5')](_0x1e51('0x8'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x1e51('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x1e51('0x9')]('in',_0x1e51('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x1e51('0x6')]},'customerPort':{'type':Sequelize[_0x1e51('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x1e51('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 62651f3..0a460c3 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 _0x9e92=['customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','zip-dir','moment','bluebird','mustache','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInteraction.socket','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','end','sendStatus','name','send','render','merge','body','contact','agent','interaction','index','map','rawAttributes','type','key','getOptions','findAll','query','show','params','model','keys','filters','attributes','intersection','length','options','ChatInteraction','find','catch','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','user','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','file','originalname','filename','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','basename','download','close','server/files/chat/upload/','format','now','ChatMessage','Messages','User','ContactId','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','fields','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','includeAll','rows','getMyMessages','include','includeAgent','addTags','setTags','spread','Tag','emit','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','push','CmContact','firstName','lastName','read','Account','get','mkdirSync','Chat','Owner','createdAt','closedAt','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer'];(function(_0x47734e,_0x20b0a1){var _0xbd3d4=function(_0x38c9ac){while(--_0x38c9ac){_0x47734e['push'](_0x47734e['shift']());}};_0xbd3d4(++_0x20b0a1);}(_0x9e92,0x1b4));var _0x29e9=function(_0x54fa55,_0x3455a7){_0x54fa55=_0x54fa55-0x0;var _0xb79d2c=_0x9e92[_0x54fa55];return _0xb79d2c;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x29e9('0x0'));var rp=require('request-promise');var moment=require(_0x29e9('0x1'));var BPromise=require(_0x29e9('0x2'));var Mustache=require(_0x29e9('0x3'));var util=require(_0x29e9('0x4'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x29e9('0x5'));var Redis=require(_0x29e9('0x6'));var interaction=require(_0x29e9('0x7'));var qs=require(_0x29e9('0x8'));var pdf=require(_0x29e9('0x9'));var logger=require('../../config/logger')('api');var config=require(_0x29e9('0xa'));var db=require(_0x29e9('0xb'))['db'];config['redis']=_[_0x29e9('0xc')](config[_0x29e9('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x29e9('0xe'))(new Redis(config['redis']));require(_0x29e9('0xf'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x29e9('0x10')][_0x29e9('0x11')]({'port':0x232b});var client9004=jayson['client'][_0x29e9('0x11')]({'port':0x232c});function respondWithRpcPromise(_0x25136a,_0x37cd2f,_0x239897,_0x781bf2){return new BPromise(function(_0x463843,_0xccf684){var _0x422a8e=_0x781bf2||client;return _0x422a8e[_0x29e9('0x12')](_0x25136a,_0x239897)[_0x29e9('0x13')](function(_0x119536){logger[_0x29e9('0x14')](_0x29e9('0x15'),_0x37cd2f,_0x29e9('0x16'));logger[_0x29e9('0x17')](_0x29e9('0x18'),_0x37cd2f,_0x29e9('0x16'),JSON['stringify'](_0x119536));if(_0x119536['error']){if(_0x119536[_0x29e9('0x19')][_0x29e9('0x1a')]===0x1f4){logger[_0x29e9('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x37cd2f,_0x119536[_0x29e9('0x19')]['message']);return _0xccf684(_0x119536[_0x29e9('0x19')]['message']);}logger['error'](_0x29e9('0x15'),_0x37cd2f,_0x119536[_0x29e9('0x19')][_0x29e9('0x1b')]);return _0x463843(_0x119536[_0x29e9('0x19')][_0x29e9('0x1b')]);}else{logger['info'](_0x29e9('0x15'),_0x37cd2f,'request\x20sent');_0x463843(_0x119536[_0x29e9('0x1c')]['message']);}})['catch'](function(_0xbd96bb){logger[_0x29e9('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x37cd2f,_0xbd96bb);_0xccf684(_0xbd96bb);});});}function respondWithStatusCode(_0x27d907,_0x2cf27e){_0x2cf27e=_0x2cf27e||0xcc;return function(_0x15d4a4){if(_0x15d4a4){return _0x27d907['sendStatus'](_0x2cf27e);}return _0x27d907[_0x29e9('0x1d')](_0x2cf27e)['end']();};}function respondWithResult(_0x57794a,_0x3ec9b2){_0x3ec9b2=_0x3ec9b2||0xc8;return function(_0x104b8d){if(_0x104b8d){return _0x57794a[_0x29e9('0x1d')](_0x3ec9b2)['json'](_0x104b8d);}};}function respondWithFilteredResult(_0x216b04,_0x48cfdc){return function(_0x38758c){if(_0x38758c){var _0x1d6bbb=typeof _0x48cfdc[_0x29e9('0x1e')]===_0x29e9('0x1f')&&typeof _0x48cfdc[_0x29e9('0x20')]===_0x29e9('0x1f');var _0x3a53d2=_0x38758c[_0x29e9('0x21')];var _0x5d2445=_0x1d6bbb?0x0:_0x48cfdc[_0x29e9('0x1e')];var _0x2b4a8f=_0x1d6bbb?_0x38758c[_0x29e9('0x21')]:_0x48cfdc['offset']+_0x48cfdc[_0x29e9('0x20')];var _0xf9dcfc;if(_0x2b4a8f>=_0x3a53d2){_0x2b4a8f=_0x3a53d2;_0xf9dcfc=0xc8;}else{_0xf9dcfc=0xce;}_0x216b04['status'](_0xf9dcfc);return _0x216b04[_0x29e9('0x22')](_0x29e9('0x23'),_0x5d2445+'-'+_0x2b4a8f+'/'+_0x3a53d2)[_0x29e9('0x24')](_0x38758c);}return null;};}function saveUpdates(_0xf35b46){return function(_0x54ac02){if(_0x54ac02){return _0x54ac02[_0x29e9('0x25')](_0xf35b46)[_0x29e9('0x13')](function(_0xe8d624){return _0xe8d624;});}return null;};}function removeEntity(_0x324f34){return function(_0x2bdb91){if(_0x2bdb91){return _0x2bdb91[_0x29e9('0x26')]()[_0x29e9('0x13')](function(){_0x324f34[_0x29e9('0x1d')](0xcc)[_0x29e9('0x27')]();});}};}function handleEntityNotFound(_0x45693f){return function(_0x1c4640){if(!_0x1c4640){_0x45693f[_0x29e9('0x28')](0x194);}return _0x1c4640;};}function handleError(_0x471e01,_0x3c7839){_0x3c7839=_0x3c7839||0x1f4;return function(_0x244b14){logger[_0x29e9('0x19')](_0x244b14['stack']);if(_0x244b14['name']){delete _0x244b14[_0x29e9('0x29')];}_0x471e01[_0x29e9('0x1d')](_0x3c7839)[_0x29e9('0x2a')](_0x244b14);};}function getMustacheRender(_0x14a8d6,_0xbd163f){return Mustache[_0x29e9('0x2b')](_0x14a8d6,_[_0x29e9('0x2c')](_0xbd163f[_0x29e9('0x2d')],{'contact':_0xbd163f[_0x29e9('0x2e')],'message':_0xbd163f[_0x29e9('0x1b')],'agent':_0xbd163f[_0x29e9('0x2f')],'interaction':_0xbd163f[_0x29e9('0x30')],'account':_0xbd163f['account']}))||'';}exports[_0x29e9('0x31')]=function(_0x3f1766,_0x38adc6){var _0x4796d8={};var _0x4a36ba=_[_0x29e9('0x32')](db['ChatInteraction'][_0x29e9('0x33')],function(_0x248dc2){return{'name':_0x248dc2['fieldName'],'type':_0x248dc2[_0x29e9('0x34')][_0x29e9('0x35')]};});_0x4796d8=qs[_0x29e9('0x36')](_0x4a36ba,_0x3f1766);return interaction[_0x29e9('0x37')]('chat',_0x3f1766[_0x29e9('0x38')],_0x3f1766['user'],_0x4796d8,_0x4a36ba)[_0x29e9('0x13')](respondWithFilteredResult(_0x38adc6,_0x4796d8))['catch'](handleError(_0x38adc6,null));};exports[_0x29e9('0x39')]=function(_0xfe1ea4,_0x3b0b1b){var _0xfcb682={'raw':![],'where':{'id':_0xfe1ea4[_0x29e9('0x3a')]['id']}},_0x3fa1ee={};_0x3fa1ee[_0x29e9('0x3b')]=_[_0x29e9('0x3c')](db['ChatInteraction'][_0x29e9('0x33')]);_0x3fa1ee['query']=_[_0x29e9('0x3c')](_0xfe1ea4[_0x29e9('0x38')]);_0x3fa1ee[_0x29e9('0x3d')]=_['intersection'](_0x3fa1ee['model'],_0x3fa1ee[_0x29e9('0x38')]);_0xfcb682[_0x29e9('0x3e')]=_[_0x29e9('0x3f')](_0x3fa1ee[_0x29e9('0x3b')],qs['fields'](_0xfe1ea4[_0x29e9('0x38')]['fields']));_0xfcb682[_0x29e9('0x3e')]=_0xfcb682['attributes'][_0x29e9('0x40')]?_0xfcb682[_0x29e9('0x3e')]:_0x3fa1ee[_0x29e9('0x3b')];if(_0xfe1ea4[_0x29e9('0x38')]['includeAll']){_0xfcb682['include']=[{'all':!![]}];}_0xfcb682=_['merge']({},_0xfcb682,_0xfe1ea4[_0x29e9('0x41')]);return db[_0x29e9('0x42')][_0x29e9('0x43')](_0xfcb682)[_0x29e9('0x13')](handleEntityNotFound(_0x3b0b1b,null))['then'](respondWithResult(_0x3b0b1b,null))[_0x29e9('0x44')](handleError(_0x3b0b1b,null));};exports[_0x29e9('0x45')]=function(_0x47241b,_0x6f79e5){return db[_0x29e9('0x42')][_0x29e9('0x45')](_0x47241b[_0x29e9('0x2d')],{})[_0x29e9('0x13')](respondWithResult(_0x6f79e5,0xc9))['catch'](handleError(_0x6f79e5,null));};exports['update']=function(_0x38c8e3,_0x148f11){if(_0x38c8e3[_0x29e9('0x2d')]['id']){delete _0x38c8e3[_0x29e9('0x2d')]['id'];}return db[_0x29e9('0x42')][_0x29e9('0x43')]({'where':{'id':_0x38c8e3[_0x29e9('0x3a')]['id']}})[_0x29e9('0x13')](handleEntityNotFound(_0x148f11,null))[_0x29e9('0x13')](saveUpdates(_0x38c8e3[_0x29e9('0x2d')],null))[_0x29e9('0x13')](respondWithResult(_0x148f11,null))['catch'](handleError(_0x148f11,null));};exports[_0x29e9('0x26')]=function(_0x167ec3,_0x3d527b){return db[_0x29e9('0x42')]['find']({'where':{'id':_0x167ec3[_0x29e9('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3d527b,null))['then'](removeEntity(_0x3d527b,null))[_0x29e9('0x44')](handleError(_0x3d527b,null));};exports[_0x29e9('0x46')]=function(_0x4dab95,_0x2de73f){return db[_0x29e9('0x42')]['describe']()['then'](respondWithResult(_0x2de73f,null))[_0x29e9('0x44')](handleError(_0x2de73f,null));};exports[_0x29e9('0x47')]=function(_0x204e15,_0x9c8e2b){var _0x552c38=_0x204e15[_0x29e9('0x3a')]['id'];var _0x328f7f;var _0x32dd65;var _0x1d93a1;return db['ChatInteraction'][_0x29e9('0x48')]({'where':{'id':_0x552c38}})[_0x29e9('0x13')](function(_0x2a32e9){_0x328f7f=_0x2a32e9;return db[_0x29e9('0x49')][_0x29e9('0x48')]({'where':{'id':_0x2a32e9[_0x29e9('0x4a')]},'attributes':['id',_0x29e9('0x4b'),_0x29e9('0x4c'),_0x29e9('0x4d'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x29e9('0x13')](function(_0x45938f){if(_0x45938f&&_0x45938f[_0x29e9('0x4b')]&&_0x45938f[_0x29e9('0x4c')]){_0x32dd65=_0x45938f;var _0x5f2532={'interaction':{'id':_0x552c38},'agent':{'id':_0x204e15[_0x29e9('0x4e')]['id'],'name':_0x204e15['user'][_0x29e9('0x29')],'fullname':_0x204e15[_0x29e9('0x4e')][_0x29e9('0x4f')],'email':_0x204e15[_0x29e9('0x4e')][_0x29e9('0x50')]},'contact':_0x204e15['body'][_0x29e9('0x2e')],'account':_0x204e15['body'][_0x29e9('0x51')]};var _0x34bb51={'rejectUnauthorized':![],'method':_0x29e9('0x52'),'url':_0x29e9('0x53'),'headers':{'X-APIKEY':_0x45938f['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x204e15[_0x29e9('0x4e')][_0x29e9('0x50')]],'buttons':null,'topic':_0x32dd65['vidaooTopic'],'note':_[_0x29e9('0x54')](_0x32dd65['vidaooNote'])?null:getMustacheRender(_0x32dd65[_0x29e9('0x55')],_0x5f2532),'metadata':null},'redirect':_0x29e9('0x56'),'json':!![]};try{if(!_[_0x29e9('0x54')](_0x32dd65[_0x29e9('0x57')])){var _0x50be9d=getMustacheRender(_0x32dd65[_0x29e9('0x57')],_0x5f2532);var _0x389a77=JSON[_0x29e9('0x58')](_0x50be9d);_0x34bb51[_0x29e9('0x2d')][_0x29e9('0x59')]=_0x389a77;}}catch(_0x1db766){throw new db[(_0x29e9('0x5a'))][(_0x29e9('0x5b'))](_0x29e9('0x5c'));}return rp(_0x34bb51);}else{throw new db[(_0x29e9('0x5a'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x29e9('0x13')](function(_0x519cee){_0x1d93a1=_0x519cee;if(_0x1d93a1['id']){var _0x374b5c={'body':_0x1d93a1[_0x29e9('0x5d')],'ChatWebsiteId':_0x32dd65['id'],'ChatInteractionId':_0x328f7f['id'],'direction':_0x29e9('0x5e'),'UserId':_0x204e15[_0x29e9('0x4e')]['id']};return db['ChatMessage'][_0x29e9('0x45')](_0x374b5c,{});}else{throw new db[(_0x29e9('0x5a'))][(_0x29e9('0x5b'))](_0x29e9('0x5f'));}})[_0x29e9('0x13')](function(){return _0x328f7f[_0x29e9('0x60')]({'vidaooSessionId':_0x1d93a1['id']});})[_0x29e9('0x13')](respondWithResult(_0x9c8e2b,null))[_0x29e9('0x44')](handleError(_0x9c8e2b,null));};exports[_0x29e9('0x61')]=function(_0x2d0a62,_0x40b4a3){if(_0x2d0a62[_0x29e9('0x2d')]['id']){delete _0x2d0a62[_0x29e9('0x2d')]['id'];}return db[_0x29e9('0x42')][_0x29e9('0x43')]({'where':{'id':_0x2d0a62[_0x29e9('0x3a')]['id']},'include':[{'model':db['CmContact'],'as':_0x29e9('0x62')}]})[_0x29e9('0x13')](handleEntityNotFound(_0x40b4a3,null))[_0x29e9('0x13')](saveUpdates(_0x2d0a62[_0x29e9('0x2d')],null))['then'](respondWithResult(_0x40b4a3,null))['catch'](handleError(_0x40b4a3,null));};exports[_0x29e9('0x63')]=function(_0x726fb9,_0x4463b3){if(_0x726fb9[_0x29e9('0x2d')]['id']){delete _0x726fb9[_0x29e9('0x2d')]['id'];}return db[_0x29e9('0x42')][_0x29e9('0x43')]({'where':{'id':_0x726fb9[_0x29e9('0x3a')]['id']}})[_0x29e9('0x13')](function(_0x777cb1){if(!_0x777cb1){logger[_0x29e9('0x19')](_0x29e9('0x64'),_0x29e9('0x63'),0x194,_0x29e9('0x65'));_0x4463b3[_0x29e9('0x28')](0x194);}else{if(_0x777cb1[_0x29e9('0x66')]){throw new db[(_0x29e9('0x5a'))][(_0x29e9('0x5b'))](_0x29e9('0x67'));}}return _0x777cb1;})[_0x29e9('0x13')](function(_0x5b1dc6){if(_0x5b1dc6){return _0x5b1dc6[_0x29e9('0x25')]({'closed':_0x726fb9[_0x29e9('0x2d')][_0x29e9('0x68')],'disposition':_0x726fb9[_0x29e9('0x2d')][_0x29e9('0x69')]})[_0x29e9('0x13')](function(_0x5bdb8a){return _0x5bdb8a;});}})[_0x29e9('0x13')](function(){return respondWithRpcPromise('AbandonInteraction',_0x29e9('0x63'),_0x726fb9['body'],client9004);})[_0x29e9('0x13')](respondWithResult(_0x4463b3,null))[_0x29e9('0x44')](handleError(_0x4463b3,null));};exports['attachmentUpload']=function(_0x12d948,_0x375a9e){_0x12d948[_0x29e9('0x2d')][_0x29e9('0x29')]=_0x12d948[_0x29e9('0x6a')][_0x29e9('0x6b')];_0x12d948[_0x29e9('0x2d')]['basename']=_0x12d948[_0x29e9('0x6a')][_0x29e9('0x6c')];_0x12d948['body']['type']=_0x12d948[_0x29e9('0x6a')]['mimetype'];return db[_0x29e9('0x6d')][_0x29e9('0x45')](_0x12d948[_0x29e9('0x2d')])[_0x29e9('0x13')](respondWithResult(_0x375a9e,0xc9))[_0x29e9('0x44')](handleError(_0x375a9e,null));};exports[_0x29e9('0x6e')]=function(_0x325fdf,_0x50dc3b){return db[_0x29e9('0x42')]['findOne']({'where':{'id':_0x325fdf[_0x29e9('0x3a')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x50dc3b,null))[_0x29e9('0x13')](function(_0x3a611b){if(_0x3a611b){if(_0x3a611b['closed']){return _0x50dc3b[_0x29e9('0x1d')](0x193)[_0x29e9('0x24')]({'status':0x193,'message':_0x29e9('0x6f')});}return db[_0x29e9('0x6d')][_0x29e9('0x48')]({'where':{'id':_0x325fdf['query'][_0x29e9('0x70')]},'raw':!![]})[_0x29e9('0x13')](handleEntityNotFound(_0x50dc3b,null));}})['then'](function(_0x7ee748){if(_0x7ee748){var _0x2c786a=_0x7ee748['ChatOfflineMessageId']!==null;var _0xb08b0a=path[_0x29e9('0x71')](config[_0x29e9('0x72')],_0x29e9('0x73'));if(_0x2c786a){_0xb08b0a=path[_0x29e9('0x71')](_0xb08b0a,'offline-chat/');}var _0x1dc781=path[_0x29e9('0x71')](_0xb08b0a,_0x7ee748[_0x29e9('0x74')]);return _0x50dc3b[_0x29e9('0x75')](_0x1dc781);}})[_0x29e9('0x44')](handleError(_0x50dc3b,null));};exports[_0x29e9('0x76')]=function(_0x4d778c,_0x1be1fa){var _0x978f3=null;var _0x58996f=null;var _0x2f39b2=null;if(_0x4d778c['body']['id']){delete _0x4d778c[_0x29e9('0x2d')]['id'];}if(_0x4d778c[_0x29e9('0x2d')]['mailTranscript']){_0x2f39b2=path['join'](config['root'],_0x29e9('0x77'),util[_0x29e9('0x78')]('transcript-%s.txt',Date[_0x29e9('0x79')]()));_0x4d778c[_0x29e9('0x2d')]['pathTranscript']=_0x2f39b2;}return db['ChatInteraction'][_0x29e9('0x43')]({'where':{'id':_0x4d778c[_0x29e9('0x3a')]['id']},'include':[{'model':db[_0x29e9('0x7a')],'as':_0x29e9('0x7b'),'include':[{'model':db[_0x29e9('0x7c')],'as':_0x29e9('0x7c')}]}]})['then'](handleEntityNotFound(_0x1be1fa,null))[_0x29e9('0x13')](saveUpdates(_0x4d778c[_0x29e9('0x2d')],null))[_0x29e9('0x13')](function(_0x417c0f){if(_0x417c0f){_0x978f3=_0x417c0f;return db[_0x29e9('0x49')][_0x29e9('0x43')]({'where':{'id':_0x978f3[_0x29e9('0x4a')]}});}})['then'](function(_0x4991e2){if(_0x4991e2){_0x58996f=_0x4991e2;return db['CmContact'][_0x29e9('0x43')]({'where':{'id':_0x978f3[_0x29e9('0x7d')]}});}})['then'](function(_0x408f9f){if(_0x408f9f){if(_0x2f39b2){var _0x2e43d5=null;for(var _0x50db62=0x1;_0x50db62<_0x978f3[_0x29e9('0x7b')][_0x29e9('0x40')];++_0x50db62){_0x2e43d5=_0x978f3[_0x29e9('0x7b')][_0x50db62];var _0x2b91c4=_0x2e43d5[_0x29e9('0x66')]?util['format'](_0x29e9('0x7e'),_0x58996f[_0x29e9('0x7f')],_0x2e43d5[_0x29e9('0x66')]):'System';var _0x1cca10=_0x4d778c[_0x29e9('0x2d')][_0x29e9('0x80')]||util[_0x29e9('0x78')]('%s%d',_0x29e9('0x81'),_0x2e43d5[_0x29e9('0x7d')]);switch(_0x58996f[_0x29e9('0x82')]){case _0x29e9('0x83'):_0x2b91c4=_0x2e43d5[_0x29e9('0x66')]?util['format']('%s%d',_0x58996f[_0x29e9('0x7f')],_0x2e43d5[_0x29e9('0x66')]):_0x29e9('0x84');break;case _0x29e9('0x85'):_0x2b91c4=_0x2e43d5[_0x29e9('0x66')]?_0x2e43d5[_0x29e9('0x7c')][_0x29e9('0x86')]||_0x2e43d5[_0x29e9('0x7c')][_0x29e9('0x4f')]:_0x29e9('0x84');break;case'agent_fullname':_0x2b91c4=_0x2e43d5[_0x29e9('0x66')]?_0x2e43d5[_0x29e9('0x7c')][_0x29e9('0x4f')]:_0x29e9('0x84');break;default:_0x2b91c4=_0x2e43d5['UserId']?util[_0x29e9('0x78')](_0x29e9('0x7e'),_0x58996f[_0x29e9('0x7f')],_0x2e43d5['UserId']):_0x29e9('0x84');}var _0x5edd32=util[_0x29e9('0x78')](_0x29e9('0x87'),moment(_0x2e43d5['createdAt'])[_0x29e9('0x78')]('MM/DD/YYYY\x20HH:mm:ss'),_0x2e43d5[_0x29e9('0x88')]==='in'?_0x1cca10:_0x2b91c4,_0x2e43d5['body']);if(!_0x2e43d5[_0x29e9('0x89')]){fs[_0x29e9('0x8a')](_0x2f39b2,_0x5edd32);}}return db[_0x29e9('0x8b')][_0x29e9('0x48')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x29e9('0x8c'),'raw':!![],'include':[{'model':db[_0x29e9('0x8d')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x29e9('0x13')](function(_0x5c89ac){if(!_0x5c89ac||!_0x5c89ac[_0x29e9('0x8c')]||!_0x4d778c[_0x29e9('0x2d')])return _0x978f3;var _0x1a3072=_0x5c89ac[_0x29e9('0x8e')]();return respondWithRpcPromise('SendMail',_0x29e9('0x8f'),{'account':_0x1a3072,'message':{'from':util[_0x29e9('0x78')](_0x29e9('0x90'),_0x5c89ac[_0x29e9('0x29')],_0x5c89ac['email']||_0x5c89ac[_0x29e9('0x8c')]['user']),'to':_0x4d778c[_0x29e9('0x2d')][_0x29e9('0x91')],'subject':_0x29e9('0x92'),'text':util[_0x29e9('0x78')](_0x29e9('0x93'),_0x4d778c[_0x29e9('0x2d')][_0x29e9('0x91')]),'attachments':[{'path':_0x2f39b2}]}})[_0x29e9('0x13')](function(){return _0x978f3;})[_0x29e9('0x44')](function(_0x129650){logger[_0x29e9('0x19')](_0x129650);});})[_0x29e9('0x13')](respondWithStatusCode(_0x1be1fa,0xc8))[_0x29e9('0x44')](handleError(_0x1be1fa,null));};exports[_0x29e9('0x94')]=function(_0x17f21d,_0x33c63d){return db[_0x29e9('0x7a')][_0x29e9('0x43')]({'where':{'id':_0x17f21d[_0x29e9('0x3a')]['id']}})['then'](handleEntityNotFound(_0x33c63d,null))['then'](function(_0x318003){if(_0x318003){return _0x318003[_0x29e9('0x94')](_0x17f21d['body'][_0x29e9('0x95')],_[_0x29e9('0x96')](_0x17f21d[_0x29e9('0x2d')],[_0x29e9('0x95'),'id'])||{});}})[_0x29e9('0x13')](respondWithResult(_0x33c63d,null))['catch'](handleError(_0x33c63d,null));};exports[_0x29e9('0x97')]=function(_0x1e65c7,_0x307cc3){var _0x404426={'raw':![],'where':{}};var _0x49ac6e={};var _0x2e439c={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x29e9('0x48')]({'where':{'id':_0x1e65c7[_0x29e9('0x3a')]['id']}})[_0x29e9('0x13')](handleEntityNotFound(_0x307cc3,null))[_0x29e9('0x13')](function(_0x2bb038){if(_0x2bb038){_0x49ac6e['model']=_[_0x29e9('0x3c')](db[_0x29e9('0x7a')][_0x29e9('0x33')]);_0x49ac6e[_0x29e9('0x38')]=_[_0x29e9('0x3c')](_0x1e65c7['query']);_0x49ac6e[_0x29e9('0x3d')]=_[_0x29e9('0x3f')](_0x49ac6e[_0x29e9('0x3b')],_0x49ac6e[_0x29e9('0x38')]);_0x404426[_0x29e9('0x3e')]=_['intersection'](_0x49ac6e[_0x29e9('0x3b')],qs[_0x29e9('0x98')](_0x1e65c7[_0x29e9('0x38')][_0x29e9('0x98')]));_0x404426[_0x29e9('0x3e')]=_0x404426[_0x29e9('0x3e')]['length']?_0x404426[_0x29e9('0x3e')]:_0x49ac6e[_0x29e9('0x3b')];if(!_0x1e65c7[_0x29e9('0x38')][_0x29e9('0x99')](_0x29e9('0x9a'))){_0x404426[_0x29e9('0x20')]=qs[_0x29e9('0x20')](_0x1e65c7[_0x29e9('0x38')][_0x29e9('0x20')]);_0x404426['offset']=qs[_0x29e9('0x1e')](_0x1e65c7[_0x29e9('0x38')]['offset']);}_0x404426[_0x29e9('0x9b')]=qs[_0x29e9('0x9c')](_0x1e65c7[_0x29e9('0x38')][_0x29e9('0x9c')]);_0x404426[_0x29e9('0x9d')]=qs[_0x29e9('0x3d')](_[_0x29e9('0x9e')](_0x1e65c7[_0x29e9('0x38')],_0x49ac6e[_0x29e9('0x3d')]));_0x404426['where'][_0x29e9('0x9f')]=_0x2bb038['id'];if(_0x1e65c7[_0x29e9('0x38')][_0x29e9('0xa0')]){_0x404426['where']=_[_0x29e9('0x2c')](_0x404426['where'],{'$or':_['map'](_0x404426[_0x29e9('0x3e')],function(_0x473c96){var _0x265a56={};_0x265a56[_0x473c96]={'$like':'%'+_0x1e65c7[_0x29e9('0x38')][_0x29e9('0xa0')]+'%'};return _0x265a56;})});}if(_0x1e65c7[_0x29e9('0x38')][_0x29e9('0xa1')]){var _0xa4943a=_0x1e65c7['query'][_0x29e9('0xa1')][_0x29e9('0xa2')](',');var _0x52c783={};_0x52c783[_0xa4943a[0x0]]={'$gte':moment(_0xa4943a[0x1])[_0x29e9('0x78')]('YYYY-MM-DD\x20HH:mm:ss')};_0x404426[_0x29e9('0x9d')]=_['merge'](_0x404426[_0x29e9('0x9d')],_0x52c783);}_0x404426=_[_0x29e9('0x2c')]({},_0x404426,_0x1e65c7['options']);return db[_0x29e9('0x7a')]['count']({'where':_0x404426[_0x29e9('0x9d')]})[_0x29e9('0x13')](function(_0x4a5d83){_0x2e439c[_0x29e9('0x21')]=_0x4a5d83;if(_0x1e65c7[_0x29e9('0x38')][_0x29e9('0xa3')]){_0x404426['include']=[{'all':!![]}];}return db[_0x29e9('0x7a')][_0x29e9('0x37')](_0x404426);})[_0x29e9('0x13')](function(_0x57bf02){_0x2e439c[_0x29e9('0xa4')]=_0x57bf02;return _0x2e439c;});}})[_0x29e9('0x13')](respondWithFilteredResult(_0x307cc3,_0x404426))[_0x29e9('0x44')](handleError(_0x307cc3,null));};exports[_0x29e9('0xa5')]=function(_0x1e8a8d,_0x1cad1c){var _0x58cf23={'where':{}},_0x3fc806={},_0x13344e={'count':0x0,'rows':[]};return db[_0x29e9('0x42')][_0x29e9('0x48')]({'where':{'id':_0x1e8a8d[_0x29e9('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1cad1c,null))[_0x29e9('0x13')](function(_0x451d8b){if(_0x451d8b){_0x3fc806[_0x29e9('0x3b')]=_['keys'](db['ChatMessage'][_0x29e9('0x33')]);_0x3fc806[_0x29e9('0x38')]=_['keys'](_0x1e8a8d[_0x29e9('0x38')]);_0x3fc806[_0x29e9('0x3d')]=_[_0x29e9('0x3f')](_0x3fc806['model'],_0x3fc806[_0x29e9('0x38')]);_0x58cf23['attributes']=_['intersection'](_0x3fc806[_0x29e9('0x3b')],qs[_0x29e9('0x98')](_0x1e8a8d[_0x29e9('0x38')][_0x29e9('0x98')]));_0x58cf23['attributes']=_0x58cf23[_0x29e9('0x3e')]['length']?_0x58cf23['attributes']:_0x3fc806['model'];if(!_0x1e8a8d[_0x29e9('0x38')]['hasOwnProperty']('nolimit')){_0x58cf23[_0x29e9('0x20')]=qs['limit'](_0x1e8a8d['query']['limit']);_0x58cf23[_0x29e9('0x1e')]=qs[_0x29e9('0x1e')](_0x1e8a8d[_0x29e9('0x38')][_0x29e9('0x1e')]);}_0x58cf23[_0x29e9('0x9b')]=qs[_0x29e9('0x9c')](_0x1e8a8d[_0x29e9('0x38')]['sort']);_0x58cf23['where']=qs[_0x29e9('0x3d')](_['pick'](_0x1e8a8d['query'],_0x3fc806[_0x29e9('0x3d')]));_0x58cf23[_0x29e9('0x9d')][_0x29e9('0x9f')]=_0x451d8b['id'];if(_0x1e8a8d['query'][_0x29e9('0xa0')]){_0x58cf23[_0x29e9('0x9d')]=_[_0x29e9('0x2c')](_0x58cf23[_0x29e9('0x9d')],{'$or':_['map'](_0x58cf23['attributes'],function(_0x24c79f){var _0x329dd7={};_0x329dd7[_0x24c79f]={'$like':'%'+_0x1e8a8d['query'][_0x29e9('0xa0')]+'%'};return _0x329dd7;})});}_0x58cf23[_0x29e9('0x9d')][_0x29e9('0x89')]=![];if(_0x1e8a8d[_0x29e9('0x38')]['id']){_0x58cf23[_0x29e9('0x9d')]['id']={'$gt':_0x1e8a8d[_0x29e9('0x38')]['id']};}_0x58cf23=_['merge']({},_0x58cf23,_0x1e8a8d['options']);return db[_0x29e9('0x7a')][_0x29e9('0x21')]({'where':_0x58cf23[_0x29e9('0x9d')]})[_0x29e9('0x13')](function(_0x2d8b40){_0x13344e[_0x29e9('0x21')]=_0x2d8b40;_0x58cf23[_0x29e9('0xa6')]=[];if(_0x1e8a8d[_0x29e9('0x38')][_0x29e9('0xa7')]){_0x58cf23['include']['push']({'model':db[_0x29e9('0x7c')],'as':_0x29e9('0x7c'),'attributes':['id',_0x29e9('0x4f'),_0x29e9('0x86')]});}if(_0x1e8a8d[_0x29e9('0x38')][_0x29e9('0xa3')]){_0x58cf23['include']=[{'all':!![]}];}return db[_0x29e9('0x7a')][_0x29e9('0x37')](_0x58cf23);})[_0x29e9('0x13')](function(_0x23414a){_0x13344e[_0x29e9('0xa4')]=_0x23414a;return _0x13344e;});}})[_0x29e9('0x13')](respondWithFilteredResult(_0x1cad1c,_0x58cf23))['catch'](handleError(_0x1cad1c,null));};exports[_0x29e9('0xa8')]=function(_0x4bed96,_0x3a346d){return db['ChatInteraction'][_0x29e9('0x43')]({'where':{'id':_0x4bed96['params']['id']}})[_0x29e9('0x13')](handleEntityNotFound(_0x3a346d,null))[_0x29e9('0x13')](function(_0x23f09b){if(_0x23f09b){return _0x23f09b[_0x29e9('0xa9')](_0x4bed96[_0x29e9('0x2d')]['ids'],_['omit'](_0x4bed96[_0x29e9('0x2d')],[_0x29e9('0x95'),'id'])||{})[_0x29e9('0xaa')](function(){return db[_0x29e9('0xab')][_0x29e9('0x37')]({'attributes':['id',_0x29e9('0x29'),'color'],'where':{'id':_0x4bed96[_0x29e9('0x2d')][_0x29e9('0x95')]}});})['then'](function(_0x35a444){socket[_0x29e9('0xac')]('chatInteractionTags:save',{'id':Number(_0x4bed96[_0x29e9('0x3a')]['id']),'tags':_0x35a444||[]});return{'id':Number(_0x4bed96[_0x29e9('0x3a')]['id']),'tags':_0x35a444||[]};});}})[_0x29e9('0x13')](respondWithResult(_0x3a346d,null))[_0x29e9('0x44')](handleError(_0x3a346d,null));};exports[_0x29e9('0xad')]=function(_0x2998b7,_0x38dff7){return db['ChatInteraction'][_0x29e9('0x43')]({'where':{'id':_0x2998b7[_0x29e9('0x3a')]['id']}})[_0x29e9('0x13')](handleEntityNotFound(_0x38dff7,null))[_0x29e9('0x13')](function(_0x23c56f){if(_0x23c56f){return _0x23c56f[_0x29e9('0xad')](_0x2998b7[_0x29e9('0x38')]['ids']);}})['then'](respondWithStatusCode(_0x38dff7,null))['catch'](handleError(_0x38dff7,null));};exports[_0x29e9('0x75')]=function(_0x162e1f,_0x19aea5){var _0x4486b7=moment()[_0x29e9('0xae')]()[_0x29e9('0xaf')]();var _0x458d4b=path[_0x29e9('0x71')](config[_0x29e9('0x72')],_0x29e9('0xb0'),_0x29e9('0xb1'),_0x29e9('0xb2'));var _0x1377c9=path['join'](config[_0x29e9('0x72')],'server',_0x29e9('0xb1'),_0x29e9('0xb3'));var _0x3fd3be=path[_0x29e9('0x71')](_0x458d4b,_0x4486b7);var _0x1c81c1=util[_0x29e9('0x78')](_0x29e9('0xb4'),_0x162e1f['params']['id'],_0x4486b7);var _0x172204=path[_0x29e9('0x71')](_0x458d4b,_0x1c81c1);var _0x513362=[];_0x513362[_0x29e9('0xb5')]({'model':db['User'],'as':'User','attributes':['id',_0x29e9('0x4f')],'raw':!![]});_0x513362[_0x29e9('0xb5')]({'model':db[_0x29e9('0xb6')],'as':_0x29e9('0x62'),'attributes':['id',_0x29e9('0xb7'),_0x29e9('0xb8')],'raw':!![]});if(_0x162e1f[_0x29e9('0x38')][_0x29e9('0xb3')]){_0x513362[_0x29e9('0xb5')]({'model':db[_0x29e9('0x6d')],'as':_0x29e9('0x6d'),'raw':!![]});}var _0xaa3f79=[{'model':db[_0x29e9('0x7a')],'as':'Messages','attributes':['id',_0x29e9('0x2d'),'createdAt',_0x29e9('0x88'),_0x29e9('0x89'),_0x29e9('0xb9')],'include':_0x513362}];_0xaa3f79[_0x29e9('0xb5')]({'model':db[_0x29e9('0x49')],'as':_0x29e9('0xba'),'attributes':['id',_0x29e9('0x29')]});_0xaa3f79[_0x29e9('0xb5')]({'model':db[_0x29e9('0x7c')],'as':'Owner','attributes':['id',_0x29e9('0x4f')]});return db['ChatInteraction'][_0x29e9('0x43')]({'where':{'id':_0x162e1f[_0x29e9('0x3a')]['id']},'include':_0xaa3f79})['then'](handleEntityNotFound(_0x19aea5,null))['then'](function(_0x36e1d6){if(_0x36e1d6){var _0xa1ce62=_0x36e1d6[_0x29e9('0xbb')]({'plain':!![]});fs[_0x29e9('0xbc')](_0x3fd3be);var _0x3b32e0={'channel':_0x29e9('0xbd'),'account':_0xa1ce62[_0x29e9('0xba')][_0x29e9('0x29')],'agent':_0xa1ce62[_0x29e9('0xbe')]?_0xa1ce62[_0x29e9('0xbe')][_0x29e9('0x4f')]:'N.A.','createdAt':moment(_0xa1ce62[_0x29e9('0xbf')])[_0x29e9('0x78')]('YYYY-MM-DD\x20HH:mm:ss')[_0x29e9('0xaf')](),'closedAt':_0xa1ce62[_0x29e9('0x68')]?moment(_0xa1ce62[_0x29e9('0xc0')])[_0x29e9('0x78')](_0x29e9('0xc1'))[_0x29e9('0xaf')]():'','disposition':_0xa1ce62['disposition'],'chatInfo':{'browser':_0xa1ce62[_0x29e9('0xc2')],'os':_0xa1ce62[_0x29e9('0xc3')],'referer':_0xa1ce62[_0x29e9('0xc4')],'customerIp':_0xa1ce62[_0x29e9('0xc5')],'customerPort':_0xa1ce62['customerPort']?_0xa1ce62[_0x29e9('0xc6')]:_0x29e9('0xc7')},'messages':_(_0xa1ce62[_0x29e9('0x7b')])[_0x29e9('0xc8')]()[_0x29e9('0xa0')]({'secret':![]})[_0x29e9('0x32')](function(_0x960fee){if(_0x960fee[_0x29e9('0x6d')]){var _0x1e8ffd=path[_0x29e9('0x71')](_0x1377c9,_0x960fee[_0x29e9('0x6d')][_0x29e9('0x74')]);if(fs[_0x29e9('0xc9')](_0x1e8ffd)){fs[_0x29e9('0xca')](_0x1e8ffd)[_0x29e9('0xcb')](fs['createWriteStream'](path[_0x29e9('0x71')](_0x3fd3be,_0x960fee[_0x29e9('0x6d')]['basename'])));}}return{'date':moment(_0x960fee[_0x29e9('0xbf')])['format'](_0x29e9('0xc1'))[_0x29e9('0xaf')](),'sender':_0x960fee['direction']==='out'?_0x960fee[_0x29e9('0x7c')]?_0x960fee[_0x29e9('0x7c')][_0x29e9('0x4f')]:'System':_0x960fee['Contact']['firstName']+(_0x960fee[_0x29e9('0x62')][_0x29e9('0xb8')]?'\x20'+_0x960fee[_0x29e9('0x62')][_0x29e9('0xb8')]:''),'body':_0x960fee[_0x29e9('0x6d')]?_0x960fee[_0x29e9('0x6d')][_0x29e9('0x74')]:_0x960fee[_0x29e9('0x2d')],'direction':_0x960fee[_0x29e9('0x88')]==='out'?'A':'C','secret':_0x960fee['secret'],'read':_0x960fee[_0x29e9('0xb9')],'attachment':_0x960fee[_0x29e9('0x6d')]};})[_0x29e9('0xcc')]()};return ejs[_0x29e9('0xcd')](path[_0x29e9('0x71')](config[_0x29e9('0x72')],_0x29e9('0xb0'),_0x29e9('0xce'),'downloadInteraction.ejs'),{'interaction':_0x3b32e0})[_0x29e9('0x13')](function(_0x45b8a6){var _0x4649b=path[_0x29e9('0x71')](_0x3fd3be,_0x29e9('0xcf')+_0xa1ce62['id']+'-'+_0x4486b7+_0x29e9('0xd0'));var _0x3ab764={'path':_0x4649b,'channel':_0x29e9('0xbd'),'interactionId':_0xa1ce62['id']};return pdf[_0x29e9('0xd1')](_0x45b8a6,_0x3ab764);})[_0x29e9('0x13')](function(){return new Promise(function(_0x40bcb1,_0x488ebb){zipdir(_0x3fd3be,{'saveTo':_0x172204},function(_0x78b3b0,_0x771bcc){if(_0x78b3b0)return _0x488ebb(_0x78b3b0);return _0x40bcb1(_0x771bcc);});})[_0x29e9('0x13')](function(){return new BPromise(function(_0xe9305,_0x4a5831){rimraf(_0x3fd3be,function(_0xf26cd0){if(_0xf26cd0)_0x4a5831(_0xf26cd0);return _0xe9305();});});})[_0x29e9('0x13')](function(){return _0x19aea5[_0x29e9('0x75')](_0x172204,_0x1c81c1,function(_0x16871b){if(_0x16871b){logger[_0x29e9('0x19')](_0x29e9('0xd2'),_0x16871b);}else{fs['unlinkSync'](_0x172204);}});});});}else{return _0x19aea5['sendStatus'](0xc8);}})[_0x29e9('0x44')](handleError(_0x19aea5,null));}; \ No newline at end of file +var _0xa884=['getMessages','hasOwnProperty','nolimit','order','sort','where','ChatInteractionId','filter','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','push','addTags','spread','Tag','color','emit','removeTags','unix','toString','server','tmp','files','transcript-%d-%s.zip','firstName','lastName','attachments','Owner','get','mkdirSync','Account','N.A.','createdAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Chat','unlinkSync','rimraf','zip-dir','request-promise','moment','mustache','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','destroy','stack','name','send','render','merge','body','contact','agent','account','index','map','ChatInteraction','rawAttributes','type','getOptions','findAll','query','user','show','params','model','keys','filters','intersection','fields','length','attributes','includeAll','include','options','find','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ValidationError','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','update','closed','disposition','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','ChatMessage','Messages','User','ContactId','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','%s%d','alias','fullname','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','CloudProvider','Smtp','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids'];(function(_0x37c570,_0x537f0c){var _0x5e4c88=function(_0x3f3a0e){while(--_0x3f3a0e){_0x37c570['push'](_0x37c570['shift']());}};_0x5e4c88(++_0x537f0c);}(_0xa884,0x103));var _0x4a88=function(_0x2136d5,_0x4b0479){_0x2136d5=_0x2136d5-0x0;var _0x3bee2e=_0xa884[_0x2136d5];return _0x3bee2e;};'use strict';var rimraf=require(_0x4a88('0x0'));var zipdir=require(_0x4a88('0x1'));var rp=require(_0x4a88('0x2'));var moment=require(_0x4a88('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4a88('0x4'));var util=require(_0x4a88('0x5'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4a88('0x6'));var Redis=require(_0x4a88('0x7'));var interaction=require(_0x4a88('0x8'));var qs=require(_0x4a88('0x9'));var pdf=require(_0x4a88('0xa'));var logger=require(_0x4a88('0xb'))(_0x4a88('0xc'));var config=require(_0x4a88('0xd'));var db=require(_0x4a88('0xe'))['db'];config['redis']=_[_0x4a88('0xf')](config[_0x4a88('0x10')],{'host':_0x4a88('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a88('0x10')]));require(_0x4a88('0x12'))['register'](socket);var jayson=require(_0x4a88('0x13'));var client=jayson[_0x4a88('0x14')]['http']({'port':0x232b});var client9004=jayson[_0x4a88('0x14')][_0x4a88('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x386e6b,_0x4cdeff,_0x4c7ef6,_0x4c066d){return new BPromise(function(_0x4d13eb,_0x82b791){var _0x1b4a67=_0x4c066d||client;return _0x1b4a67[_0x4a88('0x16')](_0x386e6b,_0x4c7ef6)[_0x4a88('0x17')](function(_0x599852){logger[_0x4a88('0x18')](_0x4a88('0x19'),_0x4cdeff,'request\x20sent');logger['debug'](_0x4a88('0x1a'),_0x4cdeff,_0x4a88('0x1b'),JSON['stringify'](_0x599852));if(_0x599852[_0x4a88('0x1c')]){if(_0x599852[_0x4a88('0x1c')][_0x4a88('0x1d')]===0x1f4){logger['error'](_0x4a88('0x19'),_0x4cdeff,_0x599852['error'][_0x4a88('0x1e')]);return _0x82b791(_0x599852[_0x4a88('0x1c')][_0x4a88('0x1e')]);}logger['error'](_0x4a88('0x19'),_0x4cdeff,_0x599852[_0x4a88('0x1c')][_0x4a88('0x1e')]);return _0x4d13eb(_0x599852[_0x4a88('0x1c')][_0x4a88('0x1e')]);}else{logger[_0x4a88('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x4cdeff,_0x4a88('0x1b'));_0x4d13eb(_0x599852[_0x4a88('0x1f')][_0x4a88('0x1e')]);}})[_0x4a88('0x20')](function(_0xd5c38a){logger[_0x4a88('0x1c')](_0x4a88('0x19'),_0x4cdeff,_0xd5c38a);_0x82b791(_0xd5c38a);});});}function respondWithStatusCode(_0x195525,_0x146523){_0x146523=_0x146523||0xcc;return function(_0x251c26){if(_0x251c26){return _0x195525[_0x4a88('0x21')](_0x146523);}return _0x195525[_0x4a88('0x22')](_0x146523)[_0x4a88('0x23')]();};}function respondWithResult(_0x2ad4b9,_0x38cef0){_0x38cef0=_0x38cef0||0xc8;return function(_0x13f020){if(_0x13f020){return _0x2ad4b9[_0x4a88('0x22')](_0x38cef0)[_0x4a88('0x24')](_0x13f020);}};}function respondWithFilteredResult(_0x4507f6,_0x378c65){return function(_0x47cd1d){if(_0x47cd1d){var _0x495ae2=typeof _0x378c65['offset']==='undefined'&&typeof _0x378c65[_0x4a88('0x25')]===_0x4a88('0x26');var _0x56afa9=_0x47cd1d[_0x4a88('0x27')];var _0x15a872=_0x495ae2?0x0:_0x378c65['offset'];var _0x47849b=_0x495ae2?_0x47cd1d[_0x4a88('0x27')]:_0x378c65[_0x4a88('0x28')]+_0x378c65[_0x4a88('0x25')];var _0x5aa141;if(_0x47849b>=_0x56afa9){_0x47849b=_0x56afa9;_0x5aa141=0xc8;}else{_0x5aa141=0xce;}_0x4507f6[_0x4a88('0x22')](_0x5aa141);return _0x4507f6['set'](_0x4a88('0x29'),_0x15a872+'-'+_0x47849b+'/'+_0x56afa9)[_0x4a88('0x24')](_0x47cd1d);}return null;};}function saveUpdates(_0x5b803b){return function(_0x457847){if(_0x457847){return _0x457847['update'](_0x5b803b)['then'](function(_0x5518e9){return _0x5518e9;});}return null;};}function removeEntity(_0x3fa33f){return function(_0x2c9f4f){if(_0x2c9f4f){return _0x2c9f4f[_0x4a88('0x2a')]()[_0x4a88('0x17')](function(){_0x3fa33f[_0x4a88('0x22')](0xcc)[_0x4a88('0x23')]();});}};}function handleEntityNotFound(_0x232977){return function(_0xef24a1){if(!_0xef24a1){_0x232977[_0x4a88('0x21')](0x194);}return _0xef24a1;};}function handleError(_0x1f7f26,_0x16881f){_0x16881f=_0x16881f||0x1f4;return function(_0x230650){logger[_0x4a88('0x1c')](_0x230650[_0x4a88('0x2b')]);if(_0x230650[_0x4a88('0x2c')]){delete _0x230650[_0x4a88('0x2c')];}_0x1f7f26[_0x4a88('0x22')](_0x16881f)[_0x4a88('0x2d')](_0x230650);};}function getMustacheRender(_0x4057d4,_0x5c4f99){return Mustache[_0x4a88('0x2e')](_0x4057d4,_[_0x4a88('0x2f')](_0x5c4f99[_0x4a88('0x30')],{'contact':_0x5c4f99[_0x4a88('0x31')],'message':_0x5c4f99[_0x4a88('0x1e')],'agent':_0x5c4f99[_0x4a88('0x32')],'interaction':_0x5c4f99['interaction'],'account':_0x5c4f99[_0x4a88('0x33')]}))||'';}exports[_0x4a88('0x34')]=function(_0x20a740,_0x817b69){var _0x4fc45e={};var _0x8e290e=_[_0x4a88('0x35')](db[_0x4a88('0x36')][_0x4a88('0x37')],function(_0x2f010e){return{'name':_0x2f010e['fieldName'],'type':_0x2f010e[_0x4a88('0x38')]['key']};});_0x4fc45e=qs[_0x4a88('0x39')](_0x8e290e,_0x20a740);return interaction[_0x4a88('0x3a')]('chat',_0x20a740[_0x4a88('0x3b')],_0x20a740[_0x4a88('0x3c')],_0x4fc45e,_0x8e290e)['then'](respondWithFilteredResult(_0x817b69,_0x4fc45e))[_0x4a88('0x20')](handleError(_0x817b69,null));};exports[_0x4a88('0x3d')]=function(_0x225f38,_0x439037){var _0x114660={'raw':![],'where':{'id':_0x225f38[_0x4a88('0x3e')]['id']}},_0x163e83={};_0x163e83[_0x4a88('0x3f')]=_[_0x4a88('0x40')](db['ChatInteraction'][_0x4a88('0x37')]);_0x163e83['query']=_[_0x4a88('0x40')](_0x225f38[_0x4a88('0x3b')]);_0x163e83[_0x4a88('0x41')]=_['intersection'](_0x163e83[_0x4a88('0x3f')],_0x163e83[_0x4a88('0x3b')]);_0x114660['attributes']=_[_0x4a88('0x42')](_0x163e83[_0x4a88('0x3f')],qs[_0x4a88('0x43')](_0x225f38['query'][_0x4a88('0x43')]));_0x114660['attributes']=_0x114660['attributes'][_0x4a88('0x44')]?_0x114660[_0x4a88('0x45')]:_0x163e83['model'];if(_0x225f38[_0x4a88('0x3b')][_0x4a88('0x46')]){_0x114660[_0x4a88('0x47')]=[{'all':!![]}];}_0x114660=_[_0x4a88('0x2f')]({},_0x114660,_0x225f38[_0x4a88('0x48')]);return db[_0x4a88('0x36')][_0x4a88('0x49')](_0x114660)[_0x4a88('0x17')](handleEntityNotFound(_0x439037,null))['then'](respondWithResult(_0x439037,null))[_0x4a88('0x20')](handleError(_0x439037,null));};exports[_0x4a88('0x4a')]=function(_0x5786e1,_0x62f319){return db[_0x4a88('0x36')]['create'](_0x5786e1[_0x4a88('0x30')],{})[_0x4a88('0x17')](respondWithResult(_0x62f319,0xc9))[_0x4a88('0x20')](handleError(_0x62f319,null));};exports['update']=function(_0x2e374a,_0x4c4da5){if(_0x2e374a[_0x4a88('0x30')]['id']){delete _0x2e374a[_0x4a88('0x30')]['id'];}return db[_0x4a88('0x36')][_0x4a88('0x49')]({'where':{'id':_0x2e374a['params']['id']}})[_0x4a88('0x17')](handleEntityNotFound(_0x4c4da5,null))[_0x4a88('0x17')](saveUpdates(_0x2e374a[_0x4a88('0x30')],null))['then'](respondWithResult(_0x4c4da5,null))['catch'](handleError(_0x4c4da5,null));};exports['destroy']=function(_0x28ee5e,_0x22b486){return db['ChatInteraction'][_0x4a88('0x49')]({'where':{'id':_0x28ee5e[_0x4a88('0x3e')]['id']}})['then'](handleEntityNotFound(_0x22b486,null))[_0x4a88('0x17')](removeEntity(_0x22b486,null))[_0x4a88('0x20')](handleError(_0x22b486,null));};exports[_0x4a88('0x4b')]=function(_0x5e8d78,_0x3f72db){return db['ChatInteraction'][_0x4a88('0x4b')]()[_0x4a88('0x17')](respondWithResult(_0x3f72db,null))[_0x4a88('0x20')](handleError(_0x3f72db,null));};exports[_0x4a88('0x4c')]=function(_0x142d43,_0x122f5c){var _0x69a45c=_0x142d43[_0x4a88('0x3e')]['id'];var _0x6158f0;var _0x313831;var _0x39c6db;return db['ChatInteraction'][_0x4a88('0x4d')]({'where':{'id':_0x69a45c}})[_0x4a88('0x17')](function(_0x11d16c){_0x6158f0=_0x11d16c;return db[_0x4a88('0x4e')][_0x4a88('0x4d')]({'where':{'id':_0x11d16c[_0x4a88('0x4f')]},'attributes':['id',_0x4a88('0x50'),_0x4a88('0x51'),_0x4a88('0x52'),_0x4a88('0x53'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x2c8cce){if(_0x2c8cce&&_0x2c8cce[_0x4a88('0x50')]&&_0x2c8cce[_0x4a88('0x51')]){_0x313831=_0x2c8cce;var _0x19afe5={'interaction':{'id':_0x69a45c},'agent':{'id':_0x142d43['user']['id'],'name':_0x142d43[_0x4a88('0x3c')]['name'],'fullname':_0x142d43[_0x4a88('0x3c')]['fullname'],'email':_0x142d43[_0x4a88('0x3c')][_0x4a88('0x54')]},'contact':_0x142d43['body'][_0x4a88('0x31')],'account':_0x142d43[_0x4a88('0x30')][_0x4a88('0x33')]};var _0x29fbc6={'rejectUnauthorized':![],'method':_0x4a88('0x55'),'url':_0x4a88('0x56'),'headers':{'X-APIKEY':_0x2c8cce[_0x4a88('0x50')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x142d43[_0x4a88('0x3c')][_0x4a88('0x54')]],'buttons':null,'topic':_0x313831[_0x4a88('0x52')],'note':_[_0x4a88('0x57')](_0x313831[_0x4a88('0x53')])?null:getMustacheRender(_0x313831[_0x4a88('0x53')],_0x19afe5),'metadata':null},'redirect':_0x4a88('0x58'),'json':!![]};try{if(!_[_0x4a88('0x57')](_0x313831[_0x4a88('0x59')])){var _0x4fe8db=getMustacheRender(_0x313831[_0x4a88('0x59')],_0x19afe5);var _0x535ec0=JSON[_0x4a88('0x5a')](_0x4fe8db);_0x29fbc6[_0x4a88('0x30')][_0x4a88('0x5b')]=_0x535ec0;}}catch(_0x458c05){throw new db[(_0x4a88('0x5c'))]['ValidationError'](_0x4a88('0x5d'));}return rp(_0x29fbc6);}else{throw new db['Sequelize']['ValidationError'](_0x4a88('0x5e'));}})['then'](function(_0x2473fe){_0x39c6db=_0x2473fe;if(_0x39c6db['id']){var _0x52646d={'body':_0x39c6db[_0x4a88('0x5f')],'ChatWebsiteId':_0x313831['id'],'ChatInteractionId':_0x6158f0['id'],'direction':'out','UserId':_0x142d43[_0x4a88('0x3c')]['id']};return db['ChatMessage'][_0x4a88('0x4a')](_0x52646d,{});}else{throw new db['Sequelize'][(_0x4a88('0x60'))](_0x4a88('0x61'));}})[_0x4a88('0x17')](function(){return _0x6158f0[_0x4a88('0x62')]({'vidaooSessionId':_0x39c6db['id']});})[_0x4a88('0x17')](respondWithResult(_0x122f5c,null))['catch'](handleError(_0x122f5c,null));};exports['customUpdate']=function(_0x506b08,_0x366804){if(_0x506b08['body']['id']){delete _0x506b08[_0x4a88('0x30')]['id'];}return db['ChatInteraction'][_0x4a88('0x49')]({'where':{'id':_0x506b08['params']['id']},'include':[{'model':db[_0x4a88('0x63')],'as':_0x4a88('0x64')}]})[_0x4a88('0x17')](handleEntityNotFound(_0x366804,null))[_0x4a88('0x17')](saveUpdates(_0x506b08['body'],null))[_0x4a88('0x17')](respondWithResult(_0x366804,null))[_0x4a88('0x20')](handleError(_0x366804,null));};exports[_0x4a88('0x65')]=function(_0x408990,_0xc4586d){if(_0x408990[_0x4a88('0x30')]['id']){delete _0x408990[_0x4a88('0x30')]['id'];}return db[_0x4a88('0x36')][_0x4a88('0x49')]({'where':{'id':_0x408990[_0x4a88('0x3e')]['id']}})[_0x4a88('0x17')](function(_0x5a28f0){if(!_0x5a28f0){logger[_0x4a88('0x1c')](_0x4a88('0x66'),_0x4a88('0x65'),0x194,_0x4a88('0x67'));_0xc4586d['sendStatus'](0x194);}else{if(_0x5a28f0[_0x4a88('0x68')]){throw new db['Sequelize']['ValidationError'](_0x4a88('0x69'));}}return _0x5a28f0;})['then'](function(_0x27b242){if(_0x27b242){return _0x27b242[_0x4a88('0x6a')]({'closed':_0x408990[_0x4a88('0x30')][_0x4a88('0x6b')],'disposition':_0x408990[_0x4a88('0x30')][_0x4a88('0x6c')]})['then'](function(_0x3db325){return _0x3db325;});}})[_0x4a88('0x17')](function(){return respondWithRpcPromise('AbandonInteraction',_0x4a88('0x65'),_0x408990['body'],client9004);})['then'](respondWithResult(_0xc4586d,null))[_0x4a88('0x20')](handleError(_0xc4586d,null));};exports[_0x4a88('0x6d')]=function(_0x475795,_0x1eb510){_0x475795[_0x4a88('0x30')][_0x4a88('0x2c')]=_0x475795[_0x4a88('0x6e')][_0x4a88('0x6f')];_0x475795[_0x4a88('0x30')][_0x4a88('0x70')]=_0x475795[_0x4a88('0x6e')][_0x4a88('0x71')];_0x475795[_0x4a88('0x30')][_0x4a88('0x38')]=_0x475795[_0x4a88('0x6e')][_0x4a88('0x72')];return db[_0x4a88('0x73')][_0x4a88('0x4a')](_0x475795[_0x4a88('0x30')])[_0x4a88('0x17')](respondWithResult(_0x1eb510,0xc9))[_0x4a88('0x20')](handleError(_0x1eb510,null));};exports[_0x4a88('0x74')]=function(_0x3a819f,_0x2b2a83){return db[_0x4a88('0x36')][_0x4a88('0x4d')]({'where':{'id':_0x3a819f[_0x4a88('0x3e')]['id']},'raw':!![]})[_0x4a88('0x17')](handleEntityNotFound(_0x2b2a83,null))[_0x4a88('0x17')](function(_0x24b7f4){if(_0x24b7f4){if(_0x24b7f4[_0x4a88('0x6b')]){return _0x2b2a83[_0x4a88('0x22')](0x193)[_0x4a88('0x24')]({'status':0x193,'message':_0x4a88('0x75')});}return db[_0x4a88('0x73')][_0x4a88('0x4d')]({'where':{'id':_0x3a819f[_0x4a88('0x3b')][_0x4a88('0x76')]},'raw':!![]})['then'](handleEntityNotFound(_0x2b2a83,null));}})[_0x4a88('0x17')](function(_0xd4cc3b){if(_0xd4cc3b){var _0x4778eb=_0xd4cc3b[_0x4a88('0x77')]!==null;var _0x251c7a=path[_0x4a88('0x78')](config[_0x4a88('0x79')],_0x4a88('0x7a'));if(_0x4778eb){_0x251c7a=path[_0x4a88('0x78')](_0x251c7a,'offline-chat/');}var _0x1315b6=path[_0x4a88('0x78')](_0x251c7a,_0xd4cc3b[_0x4a88('0x70')]);return _0x2b2a83[_0x4a88('0x7b')](_0x1315b6);}})['catch'](handleError(_0x2b2a83,null));};exports[_0x4a88('0x7c')]=function(_0x58099b,_0x43b23c){var _0x3bc7e3=null;var _0x585ed3=null;var _0x352e4e=null;if(_0x58099b[_0x4a88('0x30')]['id']){delete _0x58099b[_0x4a88('0x30')]['id'];}if(_0x58099b[_0x4a88('0x30')][_0x4a88('0x7d')]){_0x352e4e=path['join'](config[_0x4a88('0x79')],_0x4a88('0x7e'),util[_0x4a88('0x7f')]('transcript-%s.txt',Date[_0x4a88('0x80')]()));_0x58099b[_0x4a88('0x30')][_0x4a88('0x81')]=_0x352e4e;}return db[_0x4a88('0x36')][_0x4a88('0x49')]({'where':{'id':_0x58099b['params']['id']},'include':[{'model':db[_0x4a88('0x82')],'as':_0x4a88('0x83'),'include':[{'model':db[_0x4a88('0x84')],'as':_0x4a88('0x84')}]}]})[_0x4a88('0x17')](handleEntityNotFound(_0x43b23c,null))[_0x4a88('0x17')](saveUpdates(_0x58099b[_0x4a88('0x30')],null))[_0x4a88('0x17')](function(_0x3e53bb){if(_0x3e53bb){_0x3bc7e3=_0x3e53bb;return db[_0x4a88('0x4e')]['find']({'where':{'id':_0x3bc7e3['ChatWebsiteId']}});}})[_0x4a88('0x17')](function(_0x4f1c48){if(_0x4f1c48){_0x585ed3=_0x4f1c48;return db[_0x4a88('0x63')]['find']({'where':{'id':_0x3bc7e3[_0x4a88('0x85')]}});}})['then'](function(_0x184b2c){if(_0x184b2c){if(_0x352e4e){var _0x4c9c5a=null;for(var _0x4fed14=0x1;_0x4fed14<_0x3bc7e3[_0x4a88('0x83')]['length'];++_0x4fed14){_0x4c9c5a=_0x3bc7e3[_0x4a88('0x83')][_0x4fed14];var _0x3684e6=_0x4c9c5a['UserId']?util[_0x4a88('0x7f')]('%s%d',_0x585ed3[_0x4a88('0x86')],_0x4c9c5a['UserId']):_0x4a88('0x87');var _0x591192=_0x58099b[_0x4a88('0x30')][_0x4a88('0x88')]||util[_0x4a88('0x7f')]('%s%d',_0x4a88('0x89'),_0x4c9c5a['ContactId']);switch(_0x585ed3[_0x4a88('0x8a')]){case _0x4a88('0x8b'):_0x3684e6=_0x4c9c5a[_0x4a88('0x68')]?util[_0x4a88('0x7f')](_0x4a88('0x8c'),_0x585ed3[_0x4a88('0x86')],_0x4c9c5a[_0x4a88('0x68')]):_0x4a88('0x87');break;case'agent_alias':_0x3684e6=_0x4c9c5a[_0x4a88('0x68')]?_0x4c9c5a['User'][_0x4a88('0x8d')]||_0x4c9c5a[_0x4a88('0x84')][_0x4a88('0x8e')]:_0x4a88('0x87');break;case _0x4a88('0x8f'):_0x3684e6=_0x4c9c5a[_0x4a88('0x68')]?_0x4c9c5a[_0x4a88('0x84')][_0x4a88('0x8e')]:_0x4a88('0x87');break;default:_0x3684e6=_0x4c9c5a[_0x4a88('0x68')]?util[_0x4a88('0x7f')](_0x4a88('0x8c'),_0x585ed3[_0x4a88('0x86')],_0x4c9c5a[_0x4a88('0x68')]):_0x4a88('0x87');}var _0x569f83=util[_0x4a88('0x7f')]('[%s]\x20%s:\x20%s\x0a',moment(_0x4c9c5a['createdAt'])['format'](_0x4a88('0x90')),_0x4c9c5a[_0x4a88('0x91')]==='in'?_0x591192:_0x3684e6,_0x4c9c5a[_0x4a88('0x30')]);if(!_0x4c9c5a[_0x4a88('0x92')]){fs['appendFileSync'](_0x352e4e,_0x569f83);}}return db[_0x4a88('0x93')][_0x4a88('0x4d')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x4a88('0x94')],'as':_0x4a88('0x94'),'raw':!![]}]}]});}}})[_0x4a88('0x17')](function(_0x1b9c12){if(!_0x1b9c12||!_0x1b9c12[_0x4a88('0x95')]||!_0x58099b['body'])return _0x3bc7e3;var _0x498f0b=_0x1b9c12[_0x4a88('0x96')]();return respondWithRpcPromise(_0x4a88('0x97'),'sendMail',{'account':_0x498f0b,'message':{'from':util[_0x4a88('0x7f')](_0x4a88('0x98'),_0x1b9c12[_0x4a88('0x2c')],_0x1b9c12[_0x4a88('0x54')]||_0x1b9c12['Smtp'][_0x4a88('0x3c')]),'to':_0x58099b[_0x4a88('0x30')]['mailTranscript'],'subject':_0x4a88('0x99'),'text':util['format'](_0x4a88('0x9a'),_0x58099b[_0x4a88('0x30')]['mailTranscript']),'attachments':[{'path':_0x352e4e}]}})[_0x4a88('0x17')](function(){return _0x3bc7e3;})['catch'](function(_0x4962d1){logger[_0x4a88('0x1c')](_0x4962d1);});})['then'](respondWithStatusCode(_0x43b23c,0xc8))[_0x4a88('0x20')](handleError(_0x43b23c,null));};exports[_0x4a88('0x9b')]=function(_0x2da868,_0x273575){return db[_0x4a88('0x82')][_0x4a88('0x49')]({'where':{'id':_0x2da868[_0x4a88('0x3e')]['id']}})[_0x4a88('0x17')](handleEntityNotFound(_0x273575,null))[_0x4a88('0x17')](function(_0x1ed2bd){if(_0x1ed2bd){return _0x1ed2bd['addMessage'](_0x2da868[_0x4a88('0x30')][_0x4a88('0x9c')],_['omit'](_0x2da868[_0x4a88('0x30')],['ids','id'])||{});}})[_0x4a88('0x17')](respondWithResult(_0x273575,null))[_0x4a88('0x20')](handleError(_0x273575,null));};exports[_0x4a88('0x9d')]=function(_0x26d862,_0x5c7c1f){var _0x356c62={'raw':![],'where':{}};var _0x4e8548={};var _0x456429={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x4a88('0x4d')]({'where':{'id':_0x26d862[_0x4a88('0x3e')]['id']}})[_0x4a88('0x17')](handleEntityNotFound(_0x5c7c1f,null))[_0x4a88('0x17')](function(_0x5f04ce){if(_0x5f04ce){_0x4e8548[_0x4a88('0x3f')]=_['keys'](db[_0x4a88('0x82')][_0x4a88('0x37')]);_0x4e8548[_0x4a88('0x3b')]=_[_0x4a88('0x40')](_0x26d862[_0x4a88('0x3b')]);_0x4e8548[_0x4a88('0x41')]=_[_0x4a88('0x42')](_0x4e8548[_0x4a88('0x3f')],_0x4e8548[_0x4a88('0x3b')]);_0x356c62[_0x4a88('0x45')]=_[_0x4a88('0x42')](_0x4e8548[_0x4a88('0x3f')],qs[_0x4a88('0x43')](_0x26d862[_0x4a88('0x3b')]['fields']));_0x356c62['attributes']=_0x356c62[_0x4a88('0x45')]['length']?_0x356c62[_0x4a88('0x45')]:_0x4e8548[_0x4a88('0x3f')];if(!_0x26d862[_0x4a88('0x3b')][_0x4a88('0x9e')](_0x4a88('0x9f'))){_0x356c62[_0x4a88('0x25')]=qs[_0x4a88('0x25')](_0x26d862[_0x4a88('0x3b')][_0x4a88('0x25')]);_0x356c62[_0x4a88('0x28')]=qs[_0x4a88('0x28')](_0x26d862[_0x4a88('0x3b')][_0x4a88('0x28')]);}_0x356c62[_0x4a88('0xa0')]=qs[_0x4a88('0xa1')](_0x26d862[_0x4a88('0x3b')][_0x4a88('0xa1')]);_0x356c62[_0x4a88('0xa2')]=qs['filters'](_['pick'](_0x26d862[_0x4a88('0x3b')],_0x4e8548[_0x4a88('0x41')]));_0x356c62['where'][_0x4a88('0xa3')]=_0x5f04ce['id'];if(_0x26d862['query'][_0x4a88('0xa4')]){_0x356c62[_0x4a88('0xa2')]=_[_0x4a88('0x2f')](_0x356c62['where'],{'$or':_['map'](_0x356c62[_0x4a88('0x45')],function(_0x15f605){var _0x305aeb={};_0x305aeb[_0x15f605]={'$like':'%'+_0x26d862[_0x4a88('0x3b')][_0x4a88('0xa4')]+'%'};return _0x305aeb;})});}if(_0x26d862[_0x4a88('0x3b')]['$gte']){var _0x5984b5=_0x26d862['query']['$gte']['split'](',');var _0x4b972a={};_0x4b972a[_0x5984b5[0x0]]={'$gte':moment(_0x5984b5[0x1])[_0x4a88('0x7f')](_0x4a88('0xa5'))};_0x356c62[_0x4a88('0xa2')]=_[_0x4a88('0x2f')](_0x356c62[_0x4a88('0xa2')],_0x4b972a);}_0x356c62=_[_0x4a88('0x2f')]({},_0x356c62,_0x26d862[_0x4a88('0x48')]);return db[_0x4a88('0x82')][_0x4a88('0x27')]({'where':_0x356c62[_0x4a88('0xa2')]})[_0x4a88('0x17')](function(_0x1e35ff){_0x456429[_0x4a88('0x27')]=_0x1e35ff;if(_0x26d862[_0x4a88('0x3b')][_0x4a88('0x46')]){_0x356c62[_0x4a88('0x47')]=[{'all':!![]}];}return db[_0x4a88('0x82')][_0x4a88('0x3a')](_0x356c62);})[_0x4a88('0x17')](function(_0xf03daf){_0x456429[_0x4a88('0xa6')]=_0xf03daf;return _0x456429;});}})[_0x4a88('0x17')](respondWithFilteredResult(_0x5c7c1f,_0x356c62))[_0x4a88('0x20')](handleError(_0x5c7c1f,null));};exports[_0x4a88('0xa7')]=function(_0x16ea34,_0x518d21){var _0x53ac01={'where':{}},_0x393d69={},_0x147902={'count':0x0,'rows':[]};return db[_0x4a88('0x36')]['findOne']({'where':{'id':_0x16ea34[_0x4a88('0x3e')]['id']}})['then'](handleEntityNotFound(_0x518d21,null))[_0x4a88('0x17')](function(_0x20b19b){if(_0x20b19b){_0x393d69[_0x4a88('0x3f')]=_['keys'](db[_0x4a88('0x82')][_0x4a88('0x37')]);_0x393d69['query']=_['keys'](_0x16ea34[_0x4a88('0x3b')]);_0x393d69['filters']=_[_0x4a88('0x42')](_0x393d69[_0x4a88('0x3f')],_0x393d69[_0x4a88('0x3b')]);_0x53ac01[_0x4a88('0x45')]=_[_0x4a88('0x42')](_0x393d69[_0x4a88('0x3f')],qs[_0x4a88('0x43')](_0x16ea34['query'][_0x4a88('0x43')]));_0x53ac01[_0x4a88('0x45')]=_0x53ac01[_0x4a88('0x45')][_0x4a88('0x44')]?_0x53ac01[_0x4a88('0x45')]:_0x393d69[_0x4a88('0x3f')];if(!_0x16ea34[_0x4a88('0x3b')][_0x4a88('0x9e')](_0x4a88('0x9f'))){_0x53ac01['limit']=qs['limit'](_0x16ea34[_0x4a88('0x3b')][_0x4a88('0x25')]);_0x53ac01[_0x4a88('0x28')]=qs[_0x4a88('0x28')](_0x16ea34['query'][_0x4a88('0x28')]);}_0x53ac01['order']=qs[_0x4a88('0xa1')](_0x16ea34[_0x4a88('0x3b')][_0x4a88('0xa1')]);_0x53ac01['where']=qs[_0x4a88('0x41')](_['pick'](_0x16ea34[_0x4a88('0x3b')],_0x393d69[_0x4a88('0x41')]));_0x53ac01[_0x4a88('0xa2')][_0x4a88('0xa3')]=_0x20b19b['id'];if(_0x16ea34[_0x4a88('0x3b')][_0x4a88('0xa4')]){_0x53ac01[_0x4a88('0xa2')]=_[_0x4a88('0x2f')](_0x53ac01[_0x4a88('0xa2')],{'$or':_['map'](_0x53ac01[_0x4a88('0x45')],function(_0x35f0ff){var _0x4c190c={};_0x4c190c[_0x35f0ff]={'$like':'%'+_0x16ea34['query'][_0x4a88('0xa4')]+'%'};return _0x4c190c;})});}_0x53ac01[_0x4a88('0xa2')]['secret']=![];if(_0x16ea34['query']['id']){_0x53ac01[_0x4a88('0xa2')]['id']={'$gt':_0x16ea34[_0x4a88('0x3b')]['id']};}_0x53ac01=_[_0x4a88('0x2f')]({},_0x53ac01,_0x16ea34[_0x4a88('0x48')]);return db[_0x4a88('0x82')][_0x4a88('0x27')]({'where':_0x53ac01[_0x4a88('0xa2')]})[_0x4a88('0x17')](function(_0x2701ec){_0x147902['count']=_0x2701ec;_0x53ac01['include']=[];if(_0x16ea34['query'][_0x4a88('0xa8')]){_0x53ac01[_0x4a88('0x47')][_0x4a88('0xa9')]({'model':db[_0x4a88('0x84')],'as':_0x4a88('0x84'),'attributes':['id',_0x4a88('0x8e'),'alias']});}if(_0x16ea34[_0x4a88('0x3b')][_0x4a88('0x46')]){_0x53ac01[_0x4a88('0x47')]=[{'all':!![]}];}return db[_0x4a88('0x82')][_0x4a88('0x3a')](_0x53ac01);})['then'](function(_0x493766){_0x147902[_0x4a88('0xa6')]=_0x493766;return _0x147902;});}})['then'](respondWithFilteredResult(_0x518d21,_0x53ac01))[_0x4a88('0x20')](handleError(_0x518d21,null));};exports[_0x4a88('0xaa')]=function(_0x1bdd83,_0x302e36){return db[_0x4a88('0x36')][_0x4a88('0x49')]({'where':{'id':_0x1bdd83['params']['id']}})['then'](handleEntityNotFound(_0x302e36,null))['then'](function(_0x2fb9e1){if(_0x2fb9e1){return _0x2fb9e1['setTags'](_0x1bdd83[_0x4a88('0x30')]['ids'],_['omit'](_0x1bdd83[_0x4a88('0x30')],['ids','id'])||{})[_0x4a88('0xab')](function(){return db[_0x4a88('0xac')][_0x4a88('0x3a')]({'attributes':['id',_0x4a88('0x2c'),_0x4a88('0xad')],'where':{'id':_0x1bdd83[_0x4a88('0x30')][_0x4a88('0x9c')]}});})['then'](function(_0x120834){socket[_0x4a88('0xae')]('chatInteractionTags:save',{'id':Number(_0x1bdd83[_0x4a88('0x3e')]['id']),'tags':_0x120834||[]});return{'id':Number(_0x1bdd83['params']['id']),'tags':_0x120834||[]};});}})[_0x4a88('0x17')](respondWithResult(_0x302e36,null))['catch'](handleError(_0x302e36,null));};exports[_0x4a88('0xaf')]=function(_0x3e6a52,_0xd0e507){return db[_0x4a88('0x36')][_0x4a88('0x49')]({'where':{'id':_0x3e6a52[_0x4a88('0x3e')]['id']}})[_0x4a88('0x17')](handleEntityNotFound(_0xd0e507,null))[_0x4a88('0x17')](function(_0x3affa0){if(_0x3affa0){return _0x3affa0[_0x4a88('0xaf')](_0x3e6a52[_0x4a88('0x3b')][_0x4a88('0x9c')]);}})[_0x4a88('0x17')](respondWithStatusCode(_0xd0e507,null))[_0x4a88('0x20')](handleError(_0xd0e507,null));};exports['download']=function(_0x141936,_0x1b66c7){var _0x26dd8a=moment()[_0x4a88('0xb0')]()[_0x4a88('0xb1')]();var _0x307e98=path[_0x4a88('0x78')](config[_0x4a88('0x79')],_0x4a88('0xb2'),'files',_0x4a88('0xb3'));var _0x426f91=path[_0x4a88('0x78')](config[_0x4a88('0x79')],_0x4a88('0xb2'),_0x4a88('0xb4'),'attachments');var _0x2795ff=path[_0x4a88('0x78')](_0x307e98,_0x26dd8a);var _0xaa40b8=util['format'](_0x4a88('0xb5'),_0x141936['params']['id'],_0x26dd8a);var _0x49dd2e=path[_0x4a88('0x78')](_0x307e98,_0xaa40b8);var _0x3eb485=[];_0x3eb485['push']({'model':db[_0x4a88('0x84')],'as':_0x4a88('0x84'),'attributes':['id','fullname'],'raw':!![]});_0x3eb485[_0x4a88('0xa9')]({'model':db[_0x4a88('0x63')],'as':_0x4a88('0x64'),'attributes':['id',_0x4a88('0xb6'),_0x4a88('0xb7')],'raw':!![]});if(_0x141936[_0x4a88('0x3b')][_0x4a88('0xb8')]){_0x3eb485[_0x4a88('0xa9')]({'model':db[_0x4a88('0x73')],'as':_0x4a88('0x73'),'raw':!![]});}var _0x4b77fc=[{'model':db[_0x4a88('0x82')],'as':_0x4a88('0x83'),'attributes':['id',_0x4a88('0x30'),'createdAt',_0x4a88('0x91'),_0x4a88('0x92'),'read'],'include':_0x3eb485}];_0x4b77fc[_0x4a88('0xa9')]({'model':db[_0x4a88('0x4e')],'as':'Account','attributes':['id',_0x4a88('0x2c')]});_0x4b77fc[_0x4a88('0xa9')]({'model':db[_0x4a88('0x84')],'as':_0x4a88('0xb9'),'attributes':['id',_0x4a88('0x8e')]});return db[_0x4a88('0x36')][_0x4a88('0x49')]({'where':{'id':_0x141936[_0x4a88('0x3e')]['id']},'include':_0x4b77fc})['then'](handleEntityNotFound(_0x1b66c7,null))['then'](function(_0x23fe2a){if(_0x23fe2a){var _0x62f877=_0x23fe2a[_0x4a88('0xba')]({'plain':!![]});fs[_0x4a88('0xbb')](_0x2795ff);var _0x4ace18={'channel':'Chat','account':_0x62f877[_0x4a88('0xbc')]['name'],'agent':_0x62f877[_0x4a88('0xb9')]?_0x62f877[_0x4a88('0xb9')][_0x4a88('0x8e')]:_0x4a88('0xbd'),'createdAt':moment(_0x62f877[_0x4a88('0xbe')])[_0x4a88('0x7f')](_0x4a88('0xa5'))[_0x4a88('0xb1')](),'closedAt':_0x62f877[_0x4a88('0x6b')]?moment(_0x62f877['closedAt'])[_0x4a88('0x7f')](_0x4a88('0xa5'))['toString']():'','disposition':_0x62f877[_0x4a88('0x6c')],'chatInfo':{'browser':_0x62f877[_0x4a88('0xbf')],'os':_0x62f877[_0x4a88('0xc0')],'referer':_0x62f877[_0x4a88('0xc1')],'customerIp':_0x62f877[_0x4a88('0xc2')],'customerPort':_0x62f877[_0x4a88('0xc3')]?_0x62f877[_0x4a88('0xc3')]:_0x4a88('0xbd')},'messages':_(_0x62f877[_0x4a88('0x83')])[_0x4a88('0xc4')]()[_0x4a88('0xa4')]({'secret':![]})[_0x4a88('0x35')](function(_0xe99d88){if(_0xe99d88[_0x4a88('0x73')]){var _0x56b269=path['join'](_0x426f91,_0xe99d88[_0x4a88('0x73')]['basename']);if(fs[_0x4a88('0xc5')](_0x56b269)){fs[_0x4a88('0xc6')](_0x56b269)[_0x4a88('0xc7')](fs['createWriteStream'](path[_0x4a88('0x78')](_0x2795ff,_0xe99d88[_0x4a88('0x73')][_0x4a88('0x70')])));}}return{'date':moment(_0xe99d88['createdAt'])[_0x4a88('0x7f')](_0x4a88('0xa5'))[_0x4a88('0xb1')](),'sender':_0xe99d88[_0x4a88('0x91')]===_0x4a88('0xc8')?_0xe99d88[_0x4a88('0x84')]?_0xe99d88['User'][_0x4a88('0x8e')]:_0x4a88('0x87'):_0xe99d88[_0x4a88('0x64')][_0x4a88('0xb6')]+(_0xe99d88[_0x4a88('0x64')][_0x4a88('0xb7')]?'\x20'+_0xe99d88[_0x4a88('0x64')]['lastName']:''),'body':_0xe99d88[_0x4a88('0x73')]?_0xe99d88[_0x4a88('0x73')][_0x4a88('0x70')]:_0xe99d88[_0x4a88('0x30')],'direction':_0xe99d88[_0x4a88('0x91')]==='out'?'A':'C','secret':_0xe99d88[_0x4a88('0x92')],'read':_0xe99d88['read'],'attachment':_0xe99d88['Attachment']};})['value']()};return ejs[_0x4a88('0xc9')](path[_0x4a88('0x78')](config[_0x4a88('0x79')],_0x4a88('0xb2'),_0x4a88('0xca'),_0x4a88('0xcb')),{'interaction':_0x4ace18})[_0x4a88('0x17')](function(_0x19b8eb){var _0x2b6866=path['join'](_0x2795ff,_0x4a88('0xcc')+_0x62f877['id']+'-'+_0x26dd8a+_0x4a88('0xcd'));var _0x2e5c0d={'path':_0x2b6866,'channel':_0x4a88('0xce'),'interactionId':_0x62f877['id']};return pdf['createPdfFromHTML'](_0x19b8eb,_0x2e5c0d);})['then'](function(){return new Promise(function(_0x21e369,_0x43ad70){zipdir(_0x2795ff,{'saveTo':_0x49dd2e},function(_0x54b383,_0x264fc4){if(_0x54b383)return _0x43ad70(_0x54b383);return _0x21e369(_0x264fc4);});})[_0x4a88('0x17')](function(){return new BPromise(function(_0x5dc1e8,_0x12b992){rimraf(_0x2795ff,function(_0x54e77b){if(_0x54e77b)_0x12b992(_0x54e77b);return _0x5dc1e8();});});})['then'](function(){return _0x1b66c7[_0x4a88('0x7b')](_0x49dd2e,_0xaa40b8,function(_0x41d8ec){if(_0x41d8ec){logger[_0x4a88('0x1c')]('err',_0x41d8ec);}else{fs[_0x4a88('0xcf')](_0x49dd2e);}});});});}else{return _0x1b66c7['sendStatus'](0xc8);}})[_0x4a88('0x20')](handleError(_0x1b66c7,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 6eaaf11..7362f28 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 _0x28f0=['../../mysqldb','ChatMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','exports'];(function(_0x50b1c5,_0x1cf2a9){var _0x344f99=function(_0x5d6ef0){while(--_0x5d6ef0){_0x50b1c5['push'](_0x50b1c5['shift']());}};_0x344f99(++_0x1cf2a9);}(_0x28f0,0x168));var _0x028f=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x28f0[_0xdea41a];return _0x15d0d8;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x028f('0x0'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0x028f('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x028f('0x2')](0x0);var events={'afterCreate':_0x028f('0x3'),'afterUpdate':'update','afterDestroy':_0x028f('0x4')};function emitEvent(_0x5a01a2){return function(_0x4e7b46,_0x2f9c78,_0x1805eb){_0x4e7b46[_0x028f('0x5')]({'attributes':['id'],'raw':!![]})[_0x028f('0x6')](function(_0x26c57c){_0x4e7b46[_0x028f('0x7')](_0x028f('0x8'),_0x26c57c[_0x028f('0x9')](function(_0x1ec8a1){return{'id':_0x1ec8a1['id']};}));return ChatMessage[_0x028f('0xa')]({'where':{'ChatInteractionId':_0x4e7b46['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2e5fae){_0x4e7b46[_0x028f('0x7')](_0x028f('0xb'),_0x2e5fae[_0x028f('0xc')]);ChatInteractionEvents['emit'](_0x5a01a2+':'+_0x4e7b46['id'],_0x4e7b46);ChatInteractionEvents[_0x028f('0xd')](_0x5a01a2,_0x4e7b46);_0x1805eb(null);})['catch'](_0x1805eb(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x028f('0xe')]=ChatInteractionEvents; \ No newline at end of file +var _0xbf0d=['catch','hook','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers','Users','map','findAll','then','setDataValue','unreadMessages','emit'];(function(_0x242d4b,_0x351a8b){var _0x45b4a8=function(_0x5b041e){while(--_0x5b041e){_0x242d4b['push'](_0x242d4b['shift']());}};_0x45b4a8(++_0x351a8b);}(_0xbf0d,0x1bc));var _0xdbf0=function(_0x2247d7,_0x402cf3){_0x2247d7=_0x2247d7-0x0;var _0x2e3191=_0xbf0d[_0x2247d7];return _0x2e3191;};'use strict';var EventEmitter=require(_0xdbf0('0x0'));var ChatInteraction=require(_0xdbf0('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xdbf0('0x1'))['db'][_0xdbf0('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdbf0('0x3')](0x0);var events={'afterCreate':_0xdbf0('0x4'),'afterUpdate':_0xdbf0('0x5'),'afterDestroy':_0xdbf0('0x6')};function emitEvent(_0x42fd62){return function(_0x44422e,_0x293c64,_0x4cee31){_0x44422e[_0xdbf0('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1b6ea6){_0x44422e['setDataValue'](_0xdbf0('0x8'),_0x1b6ea6[_0xdbf0('0x9')](function(_0x82992b){return{'id':_0x82992b['id']};}));return ChatMessage[_0xdbf0('0xa')]({'where':{'ChatInteractionId':_0x44422e['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdbf0('0xb')](function(_0x1c614b){_0x44422e[_0xdbf0('0xc')](_0xdbf0('0xd'),_0x1c614b['length']);ChatInteractionEvents[_0xdbf0('0xe')](_0x42fd62+':'+_0x44422e['id'],_0x44422e);ChatInteractionEvents[_0xdbf0('0xe')](_0x42fd62,_0x44422e);_0x4cee31(null);})[_0xdbf0('0xf')](_0x4cee31(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xdbf0('0x10')](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 9d098ce..ca1246c 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 _0x5772=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x46450a,_0x15684e){var _0x1a02ad=function(_0x1eaeaf){while(--_0x1eaeaf){_0x46450a['push'](_0x46450a['shift']());}};_0x1a02ad(++_0x15684e);}(_0x5772,0x7c));var _0x2577=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5772[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x2577('0x0'));var util=require(_0x2577('0x1'));var logger=require(_0x2577('0x2'))(_0x2577('0x3'));var moment=require(_0x2577('0x4'));var BPromise=require('bluebird');var rp=require(_0x2577('0x5'));var fs=require('fs');var path=require(_0x2577('0x6'));var rimraf=require(_0x2577('0x7'));var config=require(_0x2577('0x8'));var attributes=require(_0x2577('0x9'));module['exports']=function(_0x358608,_0x130a9e){return _0x358608[_0x2577('0xa')](_0x2577('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x22756e,_0x9d2342,_0x14c96a){if(_0x22756e[_0x2577('0xc')](_0x2577('0xd'))){_0x22756e[_0x2577('0xe')]=moment()['format'](_0x2577('0xf'));}_0x14c96a(null,_0x22756e);}},'charset':_0x2577('0x10'),'collate':_0x2577('0x11')});}; \ No newline at end of file +var _0x5565=['../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closedAt','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x47a05e,_0x20ab31){var _0x436415=function(_0x13b68e){while(--_0x13b68e){_0x47a05e['push'](_0x47a05e['shift']());}};_0x436415(++_0x20ab31);}(_0x5565,0x199));var _0x5556=function(_0x49919f,_0x9eb84){_0x49919f=_0x49919f-0x0;var _0x17e37a=_0x5565[_0x49919f];return _0x17e37a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5556('0x0'))(_0x5556('0x1'));var moment=require(_0x5556('0x2'));var BPromise=require(_0x5556('0x3'));var rp=require(_0x5556('0x4'));var fs=require('fs');var path=require(_0x5556('0x5'));var rimraf=require(_0x5556('0x6'));var config=require(_0x5556('0x7'));var attributes=require(_0x5556('0x8'));module[_0x5556('0x9')]=function(_0x16c837,_0x3d4a83){return _0x16c837[_0x5556('0xa')]('ChatInteraction',attributes,{'tableName':_0x5556('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5750a0,_0x3081f6,_0x252102){if(_0x5750a0[_0x5556('0xc')]('closed')){_0x5750a0[_0x5556('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x252102(null,_0x5750a0);}},'charset':_0x5556('0xe'),'collate':_0x5556('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 5d8c894..907fe34 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 _0x59a5=['randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ChatInteraction','update','body','options','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x59a5,0x183));var _0x559a=function(_0x553f0b,_0x177fc1){_0x553f0b=_0x553f0b-0x0;var _0x143135=_0x59a5[_0x553f0b];return _0x143135;};'use strict';var _=require(_0x559a('0x0'));var util=require(_0x559a('0x1'));var moment=require(_0x559a('0x2'));var BPromise=require('bluebird');var rs=require(_0x559a('0x3'));var fs=require('fs');var Redis=require(_0x559a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x559a('0x5'))(_0x559a('0x6'));var config=require('../../config/environment');var jayson=require(_0x559a('0x7'));var client=jayson[_0x559a('0x8')][_0x559a('0x9')]({'port':0x232a});config[_0x559a('0xa')]=_['defaults'](config[_0x559a('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x559a('0xa')]));require(_0x559a('0xb'))[_0x559a('0xc')](socket);function respondWithRpcPromise(_0x328ef3,_0x2732d0,_0x2e9537){return new BPromise(function(_0x13f2d0,_0x1682de){return client[_0x559a('0xd')](_0x328ef3,_0x2e9537)[_0x559a('0xe')](function(_0x26bff6){logger[_0x559a('0xf')](_0x559a('0x10'),_0x2732d0,_0x559a('0x11'));logger[_0x559a('0x12')](_0x559a('0x13'),_0x2732d0,_0x559a('0x11'),JSON[_0x559a('0x14')](_0x26bff6));if(_0x26bff6[_0x559a('0x15')]){if(_0x26bff6[_0x559a('0x15')][_0x559a('0x16')]===0x1f4){logger[_0x559a('0x15')](_0x559a('0x10'),_0x2732d0,_0x26bff6['error'][_0x559a('0x17')]);return _0x1682de(_0x26bff6[_0x559a('0x15')][_0x559a('0x17')]);}logger['error'](_0x559a('0x10'),_0x2732d0,_0x26bff6[_0x559a('0x15')][_0x559a('0x17')]);return _0x13f2d0(_0x26bff6[_0x559a('0x15')][_0x559a('0x17')]);}else{logger[_0x559a('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x2732d0,_0x559a('0x11'));_0x13f2d0(_0x26bff6['result'][_0x559a('0x17')]);}})[_0x559a('0x18')](function(_0x224016){logger['error'](_0x559a('0x10'),_0x2732d0,_0x224016);_0x1682de(_0x224016);});});}exports['UpdateChatInteraction']=function(_0x3dbbc0){var _0x53fa52=this;return new Promise(function(_0x372561,_0x37a5ea){return db[_0x559a('0x19')][_0x559a('0x1a')](_0x3dbbc0[_0x559a('0x1b')],{'raw':_0x3dbbc0[_0x559a('0x1c')]?_0x3dbbc0[_0x559a('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3dbbc0[_0x559a('0x1c')]?_0x3dbbc0['options'][_0x559a('0x1d')]||null:null,'attributes':_0x3dbbc0['options']?_0x3dbbc0[_0x559a('0x1c')][_0x559a('0x1e')]||null:null,'limit':_0x3dbbc0['options']?_0x3dbbc0['options'][_0x559a('0x1f')]||null:null})[_0x559a('0xe')](function(_0x19974b){logger['info'](_0x559a('0x20'),_0x3dbbc0);logger[_0x559a('0x12')]('UpdateChatInteraction',_0x3dbbc0,JSON['stringify'](_0x19974b));_0x372561(_0x19974b);})[_0x559a('0x18')](function(_0x105d3a){logger[_0x559a('0x15')](_0x559a('0x20'),_0x105d3a[_0x559a('0x17')],_0x3dbbc0);_0x37a5ea(_0x53fa52[_0x559a('0x15')](0x1f4,_0x105d3a['message']));});});};exports[_0x559a('0x21')]=function(_0x595a8d){return new Promise(function(_0x147677,_0x18f12f){return db[_0x559a('0x19')][_0x559a('0x22')]({'where':_0x595a8d[_0x559a('0x1c')]?_0x595a8d[_0x559a('0x1c')]['where']||null:null})['then'](function(_0x30aef8){if(_0x30aef8){return _0x30aef8[_0x559a('0x23')](_0x595a8d[_0x559a('0x1b')][_0x559a('0x24')],_['omit'](_0x595a8d[_0x559a('0x1b')],['ids','id'])||{});}})[_0x559a('0x25')](function(_0x2ef3db){logger['info'](_0x559a('0x26'),_0x595a8d);logger['debug']('AddTags',_0x595a8d,JSON[_0x559a('0x14')](_0x2ef3db));_0x147677(_0x2ef3db);})[_0x559a('0x18')](function(_0x31de66){logger[_0x559a('0x15')](_0x559a('0x26'),_0x31de66[_0x559a('0x17')],_0x595a8d);_0x18f12f(_this['error'](0x1f4,_0x31de66['message']));});});}; \ No newline at end of file +var _0xee85=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','update','options','where','attributes','UpdateChatInteraction','stringify','ChatInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','../../config/utils','rpc'];(function(_0x5aa042,_0x4b5430){var _0x2477a1=function(_0x1d1177){while(--_0x1d1177){_0x5aa042['push'](_0x5aa042['shift']());}};_0x2477a1(++_0x4b5430);}(_0xee85,0x13a));var _0x5ee8=function(_0x5ce268,_0x1835b6){_0x5ce268=_0x5ce268-0x0;var _0x28c96a=_0xee85[_0x5ce268];return _0x28c96a;};'use strict';var _=require(_0x5ee8('0x0'));var util=require('util');var moment=require(_0x5ee8('0x1'));var BPromise=require(_0x5ee8('0x2'));var rs=require(_0x5ee8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5ee8('0x4'));var logger=require('../../config/logger')(_0x5ee8('0x5'));var config=require(_0x5ee8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5ee8('0x7')][_0x5ee8('0x8')]({'port':0x232a});config[_0x5ee8('0x9')]=_[_0x5ee8('0xa')](config[_0x5ee8('0x9')],{'host':_0x5ee8('0xb'),'port':0x18eb});var socket=require(_0x5ee8('0xc'))(new Redis(config[_0x5ee8('0x9')]));require(_0x5ee8('0xd'))[_0x5ee8('0xe')](socket);function respondWithRpcPromise(_0x4464af,_0x2cc8c0,_0x13c18d){return new BPromise(function(_0x1a62ad,_0x49fb43){return client['request'](_0x4464af,_0x13c18d)[_0x5ee8('0xf')](function(_0x424787){logger[_0x5ee8('0x10')](_0x5ee8('0x11'),_0x2cc8c0,_0x5ee8('0x12'));logger[_0x5ee8('0x13')](_0x5ee8('0x14'),_0x2cc8c0,_0x5ee8('0x12'),JSON['stringify'](_0x424787));if(_0x424787['error']){if(_0x424787[_0x5ee8('0x15')][_0x5ee8('0x16')]===0x1f4){logger[_0x5ee8('0x15')](_0x5ee8('0x11'),_0x2cc8c0,_0x424787['error'][_0x5ee8('0x17')]);return _0x49fb43(_0x424787['error']['message']);}logger[_0x5ee8('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x2cc8c0,_0x424787[_0x5ee8('0x15')][_0x5ee8('0x17')]);return _0x1a62ad(_0x424787['error']['message']);}else{logger[_0x5ee8('0x10')](_0x5ee8('0x11'),_0x2cc8c0,_0x5ee8('0x12'));_0x1a62ad(_0x424787[_0x5ee8('0x18')][_0x5ee8('0x17')]);}})[_0x5ee8('0x19')](function(_0x439e76){logger[_0x5ee8('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x2cc8c0,_0x439e76);_0x49fb43(_0x439e76);});});}exports['UpdateChatInteraction']=function(_0x1e4fa7){var _0x4d98ec=this;return new Promise(function(_0xd5523e,_0x5c21a6){return db['ChatInteraction'][_0x5ee8('0x1a')](_0x1e4fa7['body'],{'raw':_0x1e4fa7[_0x5ee8('0x1b')]?_0x1e4fa7[_0x5ee8('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e4fa7[_0x5ee8('0x1b')]?_0x1e4fa7[_0x5ee8('0x1b')][_0x5ee8('0x1c')]||null:null,'attributes':_0x1e4fa7[_0x5ee8('0x1b')]?_0x1e4fa7[_0x5ee8('0x1b')][_0x5ee8('0x1d')]||null:null,'limit':_0x1e4fa7[_0x5ee8('0x1b')]?_0x1e4fa7[_0x5ee8('0x1b')]['limit']||null:null})[_0x5ee8('0xf')](function(_0x1fceb0){logger[_0x5ee8('0x10')]('UpdateChatInteraction',_0x1e4fa7);logger['debug'](_0x5ee8('0x1e'),_0x1e4fa7,JSON[_0x5ee8('0x1f')](_0x1fceb0));_0xd5523e(_0x1fceb0);})[_0x5ee8('0x19')](function(_0x5b55bd){logger[_0x5ee8('0x15')](_0x5ee8('0x1e'),_0x5b55bd[_0x5ee8('0x17')],_0x1e4fa7);_0x5c21a6(_0x4d98ec[_0x5ee8('0x15')](0x1f4,_0x5b55bd[_0x5ee8('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x25b3c0){return new Promise(function(_0x409476,_0x1c643c){return db[_0x5ee8('0x20')][_0x5ee8('0x21')]({'where':_0x25b3c0[_0x5ee8('0x1b')]?_0x25b3c0[_0x5ee8('0x1b')][_0x5ee8('0x1c')]||null:null})['then'](function(_0x5e6912){if(_0x5e6912){return _0x5e6912[_0x5ee8('0x22')](_0x25b3c0[_0x5ee8('0x23')][_0x5ee8('0x24')],_[_0x5ee8('0x25')](_0x25b3c0[_0x5ee8('0x23')],[_0x5ee8('0x24'),'id'])||{});}})[_0x5ee8('0x26')](function(_0xd282a8){logger['info']('AddTags',_0x25b3c0);logger[_0x5ee8('0x13')](_0x5ee8('0x27'),_0x25b3c0,JSON['stringify'](_0xd282a8));_0x409476(_0xd282a8);})[_0x5ee8('0x19')](function(_0x59a6bd){logger[_0x5ee8('0x15')](_0x5ee8('0x27'),_0x59a6bd[_0x5ee8('0x17')],_0x25b3c0);_0x1c643c(_this[_0x5ee8('0x15')](0x1f4,_0x59a6bd[_0x5ee8('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 7d76fc2..2bd5168 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 _0x1f36=['remove','update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x460ece,_0x3312d3){var _0x29013c=function(_0xf1ae9e){while(--_0xf1ae9e){_0x460ece['push'](_0x460ece['shift']());}};_0x29013c(++_0x3312d3);}(_0x1f36,0x1ed));var _0x61f3=function(_0x4024a8,_0x24792b){_0x4024a8=_0x4024a8-0x0;var _0x4d7178=_0x1f36[_0x4024a8];return _0x4d7178;};'use strict';var ChatInteractionEvents=require(_0x61f3('0x0'));var events=[_0x61f3('0x1'),_0x61f3('0x2'),_0x61f3('0x3')];function createListener(_0x530c15,_0x43cb61){return function(_0x5f4742){_0x43cb61[_0x61f3('0x4')](_0x530c15,_0x5f4742);};}function removeListener(_0x596aab,_0x17d9bf){return function(){ChatInteractionEvents[_0x61f3('0x5')](_0x596aab,_0x17d9bf);};}exports[_0x61f3('0x6')]=function(_0x12c372){for(var _0x72af3d=0x0,_0x52a5eb=events[_0x61f3('0x7')];_0x72af3d<_0x52a5eb;_0x72af3d++){var _0x2f1f60=events[_0x72af3d];var _0x2bfda3=createListener(_0x61f3('0x8')+_0x2f1f60,_0x12c372);ChatInteractionEvents['on'](_0x2f1f60,_0x2bfda3);}}; \ No newline at end of file +var _0xae5e=['emit','register','length','chatInteraction:','./chatInteraction.events','update'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xae5e,0x1d2));var _0xeae5=function(_0x5cf032,_0x55f08d){_0x5cf032=_0x5cf032-0x0;var _0x5d21d8=_0xae5e[_0x5cf032];return _0x5d21d8;};'use strict';var ChatInteractionEvents=require(_0xeae5('0x0'));var events=['save','remove',_0xeae5('0x1')];function createListener(_0x2ff580,_0x244d0a){return function(_0x5e4920){_0x244d0a[_0xeae5('0x2')](_0x2ff580,_0x5e4920);};}function removeListener(_0x51f89d,_0xefba31){return function(){ChatInteractionEvents['removeListener'](_0x51f89d,_0xefba31);};}exports[_0xeae5('0x3')]=function(_0x2b2391){for(var _0x4728dd=0x0,_0x471e8d=events[_0xeae5('0x4')];_0x4728dd<_0x471e8d;_0x4728dd++){var _0x4ba737=events[_0x4728dd];var _0x38b135=createListener(_0xeae5('0x5')+_0x4ba737,_0x2b2391);ChatInteractionEvents['on'](_0x4ba737,_0x38b135);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 38c96ac..671e3ff 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 _0x3a89=['attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','replace','post','/:id/attachment_upload','file','attachmentUpload','addMessage','tracked','chatinteraction:addtags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','isChatInteractionAuthorized'];(function(_0x29eb3b,_0x32f55e){var _0x5da960=function(_0x68eca2){while(--_0x68eca2){_0x29eb3b['push'](_0x29eb3b['shift']());}};_0x5da960(++_0x32f55e);}(_0x3a89,0x192));var _0x93a8=function(_0x2e49ae,_0x2ce021){_0x2e49ae=_0x2e49ae-0x0;var _0x217ac0=_0x3a89[_0x2e49ae];return _0x217ac0;};'use strict';var multer=require(_0x93a8('0x0'));var util=require('util');var path=require(_0x93a8('0x1'));var timeout=require(_0x93a8('0x2'));var express=require(_0x93a8('0x3'));var router=express[_0x93a8('0x4')]();var fs_extra=require(_0x93a8('0x5'));var auth=require(_0x93a8('0x6'));var interaction=require(_0x93a8('0x7'));var config=require(_0x93a8('0x8'));var controller=require('./chatInteraction.controller');router[_0x93a8('0x9')]('/',auth[_0x93a8('0xa')](),controller['index']);router[_0x93a8('0x9')](_0x93a8('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x93a8('0x9')](_0x93a8('0xc'),auth[_0x93a8('0xd')](),controller['show']);router[_0x93a8('0x9')]('/:id/attachment_download',auth[_0x93a8('0xd')](),controller[_0x93a8('0xe')]);router['get'](_0x93a8('0xf'),auth['isAuthenticated'](),controller[_0x93a8('0x10')]);router[_0x93a8('0x9')](_0x93a8('0x11'),auth['isChatInteractionAuthorized'](),controller[_0x93a8('0x12')]);router[_0x93a8('0x9')](_0x93a8('0x13'),auth['isAuthenticated'](),controller[_0x93a8('0x14')]);router['post']('/',auth[_0x93a8('0xa')](),controller['create']);router['post'](_0x93a8('0x15'),auth['isAuthenticated'](),controller[_0x93a8('0x16')]);var upload=multer({'storage':multer[_0x93a8('0x17')]({'destination':function(_0x274301,_0x332bf4,_0x36eabf){_0x36eabf(null,path[_0x93a8('0x18')](config[_0x93a8('0x19')],_0x93a8('0x1a')));},'filename':function(_0x3c3878,_0x48dd63,_0x39789e){_0x39789e(null,util[_0x93a8('0x1b')](_0x93a8('0x1c'),Date['now'](),_0x48dd63[_0x93a8('0x1d')][_0x93a8('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x93a8('0x1f')](_0x93a8('0x20'),upload['single'](_0x93a8('0x21')),controller[_0x93a8('0x22')]);router[_0x93a8('0x1f')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x93a8('0x23')]);router['post']('/:id/tags',auth[_0x93a8('0xa')](),interaction[_0x93a8('0x24')]('chat',_0x93a8('0x25')),controller['addTags']);router[_0x93a8('0x26')](_0x93a8('0xc'),auth[_0x93a8('0xa')](),interaction[_0x93a8('0x24')](_0x93a8('0x27'),_0x93a8('0x28')),controller[_0x93a8('0x29')]);router[_0x93a8('0x26')](_0x93a8('0x2a'),controller[_0x93a8('0x2b')]);router[_0x93a8('0x26')]('/:id/abandon',auth[_0x93a8('0xd')](),controller['abandon']);router['put'](_0x93a8('0x2c'),controller[_0x93a8('0x2d')]);router[_0x93a8('0x2e')]('/:id',auth[_0x93a8('0xa')](),interaction[_0x93a8('0x24')](_0x93a8('0x27'),_0x93a8('0x2f')),controller[_0x93a8('0x30')]);router[_0x93a8('0x2e')](_0x93a8('0x31'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x32')]);module[_0x93a8('0x33')]=router; \ No newline at end of file +var _0x4050=['tracked','chatinteraction:destroy','destroy','removeTags','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','delete'];(function(_0x315585,_0x1acf90){var _0x2d9542=function(_0x531ce8){while(--_0x531ce8){_0x315585['push'](_0x315585['shift']());}};_0x2d9542(++_0x1acf90);}(_0x4050,0x193));var _0x0405=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0x4050[_0x3f5dca];return _0x5b833a;};'use strict';var multer=require(_0x0405('0x0'));var util=require(_0x0405('0x1'));var path=require(_0x0405('0x2'));var timeout=require('connect-timeout');var express=require(_0x0405('0x3'));var router=express['Router']();var fs_extra=require(_0x0405('0x4'));var auth=require(_0x0405('0x5'));var interaction=require(_0x0405('0x6'));var config=require(_0x0405('0x7'));var controller=require(_0x0405('0x8'));router[_0x0405('0x9')]('/',auth[_0x0405('0xa')](),controller[_0x0405('0xb')]);router[_0x0405('0x9')](_0x0405('0xc'),auth[_0x0405('0xa')](),controller[_0x0405('0xd')]);router[_0x0405('0x9')](_0x0405('0xe'),auth[_0x0405('0xf')](),controller[_0x0405('0x10')]);router[_0x0405('0x9')](_0x0405('0x11'),auth[_0x0405('0xf')](),controller[_0x0405('0x12')]);router[_0x0405('0x9')](_0x0405('0x13'),auth['isAuthenticated'](),controller['getMessages']);router[_0x0405('0x9')](_0x0405('0x14'),auth[_0x0405('0xf')](),controller['getMyMessages']);router[_0x0405('0x9')]('/:id/download',auth[_0x0405('0xa')](),controller[_0x0405('0x15')]);router['post']('/',auth[_0x0405('0xa')](),controller[_0x0405('0x16')]);router[_0x0405('0x17')](_0x0405('0x18'),auth[_0x0405('0xa')](),controller[_0x0405('0x19')]);var upload=multer({'storage':multer[_0x0405('0x1a')]({'destination':function(_0x607fe5,_0x8bee71,_0x4cd34c){_0x4cd34c(null,path[_0x0405('0x1b')](config[_0x0405('0x1c')],_0x0405('0x1d')));},'filename':function(_0x35e1c8,_0x3dfc44,_0x4271e0){_0x4271e0(null,util[_0x0405('0x1e')](_0x0405('0x1f'),Date[_0x0405('0x20')](),_0x3dfc44[_0x0405('0x21')][_0x0405('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x0405('0x17')](_0x0405('0x23'),upload[_0x0405('0x24')](_0x0405('0x25')),controller[_0x0405('0x26')]);router['post']('/:id/messages',auth[_0x0405('0xf')](),controller[_0x0405('0x27')]);router['post'](_0x0405('0x28'),auth['isAuthenticated'](),interaction['tracked'](_0x0405('0x29'),_0x0405('0x2a')),controller[_0x0405('0x2b')]);router[_0x0405('0x2c')](_0x0405('0xe'),auth[_0x0405('0xa')](),interaction['tracked'](_0x0405('0x29'),_0x0405('0x2d')),controller[_0x0405('0x2e')]);router[_0x0405('0x2c')](_0x0405('0x2f'),controller[_0x0405('0x30')]);router[_0x0405('0x2c')]('/:id/abandon',auth[_0x0405('0xf')](),controller[_0x0405('0x31')]);router[_0x0405('0x2c')](_0x0405('0x32'),controller[_0x0405('0x33')]);router[_0x0405('0x34')](_0x0405('0xe'),auth[_0x0405('0xa')](),interaction[_0x0405('0x35')](_0x0405('0x29'),_0x0405('0x36')),controller[_0x0405('0x37')]);router['delete'](_0x0405('0x28'),auth[_0x0405('0xa')](),controller[_0x0405('0x38')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 4a7e9cd..96d902d 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 _0xc0a5=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x39db05,_0x3868d0){var _0x3f0e22=function(_0x532c4f){while(--_0x532c4f){_0x39db05['push'](_0x39db05['shift']());}};_0x3f0e22(++_0x3868d0);}(_0xc0a5,0x1e0));var _0x5c0a=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xc0a5[_0x19b3f9];return _0x18c3f6;};'use strict';var Sequelize=require(_0x5c0a('0x0'));module[_0x5c0a('0x1')]={'body':{'type':Sequelize[_0x5c0a('0x2')](_0x5c0a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5c0a('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5c0a('0x5')]}}; \ No newline at end of file +var _0x8df1=['medium','BOOLEAN','sequelize','TEXT'];(function(_0x158bbc,_0x56cba7){var _0x4b7f70=function(_0x1204f0){while(--_0x1204f0){_0x158bbc['push'](_0x158bbc['shift']());}};_0x4b7f70(++_0x56cba7);}(_0x8df1,0xe6));var _0x18df=function(_0x29bafa,_0x1f0f42){_0x29bafa=_0x29bafa-0x0;var _0x3c76d4=_0x8df1[_0x29bafa];return _0x3c76d4;};'use strict';var Sequelize=require(_0x18df('0x0'));module['exports']={'body':{'type':Sequelize[_0x18df('0x1')](_0x18df('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x18df('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index e1dd9da..31e3d2e 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 _0x5b81=['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/license/util','defaults','localhost','redis','./chatInternalMessage.socket','register','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','then','end','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','destroy','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x48d2f6,_0x27d596){var _0x219dba=function(_0x6d0dff){while(--_0x6d0dff){_0x48d2f6['push'](_0x48d2f6['shift']());}};_0x219dba(++_0x27d596);}(_0x5b81,0x65));var _0x15b8=function(_0x168600,_0x592ff9){_0x168600=_0x168600-0x0;var _0x36d379=_0x5b81[_0x168600];return _0x36d379;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x15b8('0x0'));var zipdir=require(_0x15b8('0x1'));var jsonpatch=require(_0x15b8('0x2'));var rp=require(_0x15b8('0x3'));var moment=require(_0x15b8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x15b8('0x5'));var path=require(_0x15b8('0x6'));var sox=require(_0x15b8('0x7'));var csv=require(_0x15b8('0x8'));var ejs=require(_0x15b8('0x9'));var fs=require('fs');var fs_extra=require(_0x15b8('0xa'));var _=require(_0x15b8('0xb'));var squel=require(_0x15b8('0xc'));var crypto=require(_0x15b8('0xd'));var jsforce=require(_0x15b8('0xe'));var deskjs=require(_0x15b8('0xf'));var toCsv=require(_0x15b8('0x8'));var querystring=require(_0x15b8('0x10'));var Papa=require(_0x15b8('0x11'));var Redis=require(_0x15b8('0x12'));var authService=require(_0x15b8('0x13'));var qs=require(_0x15b8('0x14'));var as=require(_0x15b8('0x15'));var hardwareService=require(_0x15b8('0x16'));var logger=require(_0x15b8('0x17'))(_0x15b8('0x18'));var utils=require(_0x15b8('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x15b8('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x15b8('0x1b')](config['redis'],{'host':_0x15b8('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x15b8('0x1d')]));require(_0x15b8('0x1e'))[_0x15b8('0x1f')](socket);function respondWithStatusCode(_0x561ab6,_0x261018){_0x261018=_0x261018||0xcc;return function(_0x335752){if(_0x335752){return _0x561ab6[_0x15b8('0x20')](_0x261018);}return _0x561ab6['status'](_0x261018)['end']();};}function respondWithResult(_0xccc4af,_0x5679fa){_0x5679fa=_0x5679fa||0xc8;return function(_0x3fa648){if(_0x3fa648){return _0xccc4af[_0x15b8('0x21')](_0x5679fa)[_0x15b8('0x22')](_0x3fa648);}};}function respondWithFilteredResult(_0x4e1f7,_0x34c3c8){return function(_0x4d4c56){if(_0x4d4c56){var _0x2285f4=typeof _0x34c3c8['offset']===_0x15b8('0x23')&&typeof _0x34c3c8[_0x15b8('0x24')]==='undefined';var _0x2e55d8=_0x4d4c56[_0x15b8('0x25')];var _0x23aa13=_0x2285f4?0x0:_0x34c3c8[_0x15b8('0x26')];var _0x566d82=_0x2285f4?_0x4d4c56[_0x15b8('0x25')]:_0x34c3c8[_0x15b8('0x26')]+_0x34c3c8[_0x15b8('0x24')];var _0x390d84;if(_0x566d82>=_0x2e55d8){_0x566d82=_0x2e55d8;_0x390d84=0xc8;}else{_0x390d84=0xce;}_0x4e1f7['status'](_0x390d84);return _0x4e1f7['set'](_0x15b8('0x27'),_0x23aa13+'-'+_0x566d82+'/'+_0x2e55d8)[_0x15b8('0x22')](_0x4d4c56);}return null;};}function patchUpdates(_0x1c50fd){return function(_0x25a69e){try{jsonpatch[_0x15b8('0x28')](_0x25a69e,_0x1c50fd,!![]);}catch(_0x33b81f){return BPromise['reject'](_0x33b81f);}return _0x25a69e[_0x15b8('0x29')]();};}function saveUpdates(_0xf274c0,_0x4585c5){return function(_0x2aff5a){if(_0x2aff5a){return _0x2aff5a['update'](_0xf274c0)[_0x15b8('0x2a')](function(_0x2f09df){return _0x2f09df;});}return null;};}function removeEntity(_0x253ee6,_0x11c081){return function(_0x11c8b9){if(_0x11c8b9){return _0x11c8b9['destroy']()[_0x15b8('0x2a')](function(){_0x253ee6[_0x15b8('0x21')](0xcc)[_0x15b8('0x2b')]();});}};}function handleEntityNotFound(_0x2f61d3,_0x141729){return function(_0x141a20){if(!_0x141a20){_0x2f61d3[_0x15b8('0x20')](0x194);}return _0x141a20;};}function handleError(_0x2c7e7a,_0x236a42){_0x236a42=_0x236a42||0x1f4;return function(_0x4a8a23){logger[_0x15b8('0x2c')](_0x4a8a23[_0x15b8('0x2d')]);if(_0x4a8a23[_0x15b8('0x2e')]){delete _0x4a8a23['name'];}_0x2c7e7a[_0x15b8('0x21')](_0x236a42)[_0x15b8('0x2f')](_0x4a8a23);};}exports[_0x15b8('0x30')]=function(_0xab3c99,_0x6a074b){var _0x3a77fc={},_0x1f091f={},_0x220f96={'count':0x0,'rows':[]};var _0x2c1356=_[_0x15b8('0x31')](db[_0x15b8('0x32')][_0x15b8('0x33')],function(_0x5ec7c8){return{'name':_0x5ec7c8[_0x15b8('0x34')],'type':_0x5ec7c8[_0x15b8('0x35')][_0x15b8('0x36')]};});_0x1f091f['model']=_[_0x15b8('0x31')](_0x2c1356,_0x15b8('0x2e'));_0x1f091f[_0x15b8('0x37')]=_['keys'](_0xab3c99[_0x15b8('0x37')]);_0x1f091f[_0x15b8('0x38')]=_[_0x15b8('0x39')](_0x1f091f[_0x15b8('0x3a')],_0x1f091f[_0x15b8('0x37')]);_0x3a77fc['attributes']=_[_0x15b8('0x39')](_0x1f091f['model'],qs[_0x15b8('0x3b')](_0xab3c99[_0x15b8('0x37')]['fields']));_0x3a77fc[_0x15b8('0x3c')]=_0x3a77fc[_0x15b8('0x3c')][_0x15b8('0x3d')]?_0x3a77fc[_0x15b8('0x3c')]:_0x1f091f[_0x15b8('0x3a')];if(!_0xab3c99[_0x15b8('0x37')][_0x15b8('0x3e')]('nolimit')){_0x3a77fc[_0x15b8('0x24')]=qs[_0x15b8('0x24')](_0xab3c99[_0x15b8('0x37')]['limit']);_0x3a77fc[_0x15b8('0x26')]=qs[_0x15b8('0x26')](_0xab3c99['query'][_0x15b8('0x26')]);}_0x3a77fc[_0x15b8('0x3f')]=qs['sort'](_0xab3c99[_0x15b8('0x37')][_0x15b8('0x40')]);_0x3a77fc[_0x15b8('0x41')]=qs[_0x15b8('0x38')](_['pick'](_0xab3c99[_0x15b8('0x37')],_0x1f091f[_0x15b8('0x38')]),_0x2c1356);if(_0xab3c99['query'][_0x15b8('0x42')]){_0x3a77fc['where']=_['merge'](_0x3a77fc[_0x15b8('0x41')],{'$or':_[_0x15b8('0x31')](_0x2c1356,function(_0x42a177){if(_0x42a177[_0x15b8('0x35')]!=='VIRTUAL'){var _0x21cd70={};_0x21cd70[_0x42a177[_0x15b8('0x2e')]]={'$like':'%'+_0xab3c99[_0x15b8('0x37')]['filter']+'%'};return _0x21cd70;}})});}_0x3a77fc=_[_0x15b8('0x43')]({},_0x3a77fc,_0xab3c99['options']);var _0xe8b617={'where':_0x3a77fc['where']};return db['ChatInternalMessage'][_0x15b8('0x25')](_0xe8b617)[_0x15b8('0x2a')](function(_0x440192){_0x220f96[_0x15b8('0x25')]=_0x440192;if(_0xab3c99[_0x15b8('0x37')]['includeAll']){_0x3a77fc[_0x15b8('0x44')]=[{'all':!![]}];}return db[_0x15b8('0x32')][_0x15b8('0x45')](_0x3a77fc);})[_0x15b8('0x2a')](function(_0x43f006){_0x220f96[_0x15b8('0x46')]=_0x43f006;return _0x220f96;})[_0x15b8('0x2a')](respondWithFilteredResult(_0x6a074b,_0x3a77fc))[_0x15b8('0x47')](handleError(_0x6a074b,null));};exports[_0x15b8('0x48')]=function(_0x19399d,_0x3b4d20){var _0x55a787={'raw':!![],'where':{'id':_0x19399d[_0x15b8('0x49')]['id']}},_0xc691f8={};_0xc691f8[_0x15b8('0x3a')]=_['keys'](db[_0x15b8('0x32')]['rawAttributes']);_0xc691f8[_0x15b8('0x37')]=_[_0x15b8('0x4a')](_0x19399d['query']);_0xc691f8[_0x15b8('0x38')]=_['intersection'](_0xc691f8[_0x15b8('0x3a')],_0xc691f8['query']);_0x55a787[_0x15b8('0x3c')]=_['intersection'](_0xc691f8[_0x15b8('0x3a')],qs[_0x15b8('0x3b')](_0x19399d[_0x15b8('0x37')]['fields']));_0x55a787[_0x15b8('0x3c')]=_0x55a787[_0x15b8('0x3c')][_0x15b8('0x3d')]?_0x55a787[_0x15b8('0x3c')]:_0xc691f8[_0x15b8('0x3a')];if(_0x19399d[_0x15b8('0x37')][_0x15b8('0x4b')]){_0x55a787[_0x15b8('0x44')]=[{'all':!![]}];}_0x55a787=_[_0x15b8('0x43')]({},_0x55a787,_0x19399d['options']);return db[_0x15b8('0x32')][_0x15b8('0x4c')](_0x55a787)[_0x15b8('0x2a')](handleEntityNotFound(_0x3b4d20,null))[_0x15b8('0x2a')](respondWithResult(_0x3b4d20,null))[_0x15b8('0x47')](handleError(_0x3b4d20,null));};exports[_0x15b8('0x4d')]=function(_0x4ff971,_0x184ddd){return db['ChatInternalMessage'][_0x15b8('0x4d')](_0x4ff971[_0x15b8('0x4e')],{})['then'](respondWithResult(_0x184ddd,0xc9))[_0x15b8('0x47')](handleError(_0x184ddd,null));};exports['update']=function(_0x914da9,_0x4c933b){if(_0x914da9[_0x15b8('0x4e')]['id']){delete _0x914da9['body']['id'];}return db['ChatInternalMessage'][_0x15b8('0x4c')]({'where':{'id':_0x914da9['params']['id']}})['then'](handleEntityNotFound(_0x4c933b,null))[_0x15b8('0x2a')](saveUpdates(_0x914da9['body'],null))[_0x15b8('0x2a')](respondWithResult(_0x4c933b,null))[_0x15b8('0x47')](handleError(_0x4c933b,null));};exports[_0x15b8('0x4f')]=function(_0x992156,_0x208933){return db[_0x15b8('0x32')][_0x15b8('0x4c')]({'where':{'id':_0x992156['params']['id']}})['then'](handleEntityNotFound(_0x208933,null))[_0x15b8('0x2a')](removeEntity(_0x208933,null))[_0x15b8('0x47')](handleError(_0x208933,null));};exports[_0x15b8('0x50')]=function(_0x2a06e1,_0x4e53f6){return db[_0x15b8('0x32')][_0x15b8('0x50')]()['then'](respondWithResult(_0x4e53f6,null))[_0x15b8('0x47')](handleError(_0x4e53f6,null));};function wrapUser(_0x111df3){return function(_0x29ff0f){var _0x17d00c=_0x111df3[_0x15b8('0x51')]({'plain':!![]});_0x17d00c[_0x15b8('0x52')]=[];if(_0x29ff0f){_0x17d00c['lastMessageAt']=_0x29ff0f[_0x15b8('0x53')];_0x17d00c[_0x15b8('0x54')]=_0x29ff0f;}else{_0x17d00c[_0x15b8('0x55')]=moment(0x0)[_0x15b8('0x56')](_0x15b8('0x57'));_0x17d00c[_0x15b8('0x54')]={};}return _0x17d00c;};}exports[_0x15b8('0x58')]=function(_0x22cfdc,_0x226cf8,_0x5bfdea){var _0x2a416d=[];return db[_0x15b8('0x59')][_0x15b8('0x45')]({'where':{'role':[_0x15b8('0x5a'),_0x15b8('0x5b'),_0x15b8('0x5c')]},'attributes':['id',_0x15b8('0x5d'),_0x15b8('0x2e'),_0x15b8('0x5e'),_0x15b8('0x5f'),'internal',_0x15b8('0x60'),_0x15b8('0x61'),_0x15b8('0x62'),_0x15b8('0x63')],'order':qs[_0x15b8('0x40')](_0x15b8('0x64')),'include':[{'model':db[_0x15b8('0x65')],'as':_0x15b8('0x66'),'attributes':['id',_0x15b8('0x2e'),_0x15b8('0x35')],'through':{'attributes':[]}}]})[_0x15b8('0x2a')](function(_0x54b438){if(_0x54b438){var _0x12ea7d=_0x22cfdc[_0x15b8('0x5c')][_0x15b8('0x51')]({'plain':!![]});if(!_0x12ea7d)throw new Error(_0x15b8('0x67'));if(_0x12ea7d[_0x15b8('0x5e')]===_0x15b8('0x5c')){return db['UserProfileSection'][_0x15b8('0x4c')]({'where':{'name':_0x15b8('0x68'),'userProfileId':_0x12ea7d[_0x15b8('0x69')]},'raw':!![]})[_0x15b8('0x2a')](function(_0xc543dd){if(_0xc543dd){if(_0xc543dd['autoAssociation']===0x0){return db[_0x15b8('0x6a')]['findAll']({'where':{'sectionId':_0xc543dd['id']},'raw':!![]})['then'](function(_0x51412b){var _0x2da23f=[];if(_[_0x15b8('0x6b')](_0x51412b)){_0x2da23f=_[_0x15b8('0x42')](_0x54b438,function(_0x131eaa){if(_0x131eaa[_0x15b8('0x5e')]!==_0x15b8('0x5a')){return _0x131eaa;}});return _0x2da23f;}else{for(var _0x22c9a9=0x0;_0x22c9a9<_0x54b438[_0x15b8('0x3d')];_0x22c9a9++){var _0x532ec4=_0x54b438[_0x22c9a9];if(_0x532ec4['role']===_0x15b8('0x5a')){var _0x17d6ee=_[_0x15b8('0x4c')](_0x51412b,function(_0x4a23a3){return _0x4a23a3[_0x15b8('0x6c')]===_0x532ec4['id'];});if(_0x17d6ee)_0x2da23f[_0x15b8('0x6d')](_0x532ec4);}else{_0x2da23f[_0x15b8('0x6d')](_0x532ec4);}}return _0x2da23f;}});}else{return _0x54b438;}}else{var _0x477ae8=_[_0x15b8('0x42')](_0x54b438,function(_0x3ae1c2){if(_0x3ae1c2['role']!==_0x15b8('0x5a')){return _0x3ae1c2;}});return _0x477ae8;}});}else{return _0x54b438;}}})[_0x15b8('0x2a')](function(_0x1c2a4e){var _0x2442c8=[];if(_0x1c2a4e){_0x2a416d=_0x1c2a4e;for(var _0x5b7fef=0x0;_0x5b7fef<_0x1c2a4e[_0x15b8('0x3d')];_0x5b7fef+=0x1){_0x2a416d[_0x5b7fef]['messages']=[];_0x2442c8[_0x15b8('0x6d')](db[_0x15b8('0x32')][_0x15b8('0x4c')]({'where':{'FromId':[_0x22cfdc[_0x15b8('0x5c')]['id'],_0x1c2a4e[_0x5b7fef]['id']],'ToId':[_0x22cfdc[_0x15b8('0x5c')]['id'],_0x1c2a4e[_0x5b7fef]['id']],'ChatGroupId':null},'attributes':['id',_0x15b8('0x53'),_0x15b8('0x6e'),_0x15b8('0x6f'),_0x15b8('0x70'),'body'],'order':qs[_0x15b8('0x40')](_0x15b8('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x15b8('0x2a')](wrapUser(_0x1c2a4e[_0x5b7fef])));}return BPromise['all'](_0x2442c8);}return[];})[_0x15b8('0x2a')](function(_0x3cacc1){return{'rows':_0x3cacc1,'count':_0x3cacc1['length']};})[_0x15b8('0x2a')](respondWithResult(_0x226cf8,null))[_0x15b8('0x47')](handleError(_0x226cf8,null));}; \ No newline at end of file +var _0xdce3=['map','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','include','findAll','catch','params','keys','ChatInternalMessage','includeAll','create','body','update','find','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','isEmpty','agent','push','FromId','ToId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatInternalMessage.socket','register','sendStatus','end','json','limit','undefined','count','offset','status','set','apply','reject','save','then','error','stack','name','send','index','rawAttributes','type','key','model'];(function(_0x113a7b,_0x3d8bae){var _0xa6fedf=function(_0x57f7a2){while(--_0x57f7a2){_0x113a7b['push'](_0x113a7b['shift']());}};_0xa6fedf(++_0x3d8bae);}(_0xdce3,0x1f0));var _0x3dce=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdce3[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x3dce('0x0'));var rimraf=require(_0x3dce('0x1'));var zipdir=require(_0x3dce('0x2'));var jsonpatch=require(_0x3dce('0x3'));var rp=require(_0x3dce('0x4'));var moment=require(_0x3dce('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3dce('0x6'));var util=require('util');var path=require('path');var sox=require(_0x3dce('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3dce('0x8'));var _=require(_0x3dce('0x9'));var squel=require('squel');var crypto=require(_0x3dce('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3dce('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3dce('0xc'));var Papa=require(_0x3dce('0xd'));var Redis=require(_0x3dce('0xe'));var authService=require(_0x3dce('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3dce('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3dce('0x11'))('api');var utils=require(_0x3dce('0x12'));var config=require(_0x3dce('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3dce('0x14'))['db'];config['redis']=_[_0x3dce('0x15')](config['redis'],{'host':_0x3dce('0x16'),'port':0x18eb});var socket=require(_0x3dce('0x17'))(new Redis(config[_0x3dce('0x18')]));require(_0x3dce('0x19'))[_0x3dce('0x1a')](socket);function respondWithStatusCode(_0x42c56d,_0x545f79){_0x545f79=_0x545f79||0xcc;return function(_0x50ca7f){if(_0x50ca7f){return _0x42c56d[_0x3dce('0x1b')](_0x545f79);}return _0x42c56d['status'](_0x545f79)[_0x3dce('0x1c')]();};}function respondWithResult(_0x45efab,_0x4d29de){_0x4d29de=_0x4d29de||0xc8;return function(_0x57b445){if(_0x57b445){return _0x45efab['status'](_0x4d29de)[_0x3dce('0x1d')](_0x57b445);}};}function respondWithFilteredResult(_0x37e8c4,_0x26ce8b){return function(_0x553fd2){if(_0x553fd2){var _0x3758d0=typeof _0x26ce8b['offset']==='undefined'&&typeof _0x26ce8b[_0x3dce('0x1e')]===_0x3dce('0x1f');var _0x382bcd=_0x553fd2[_0x3dce('0x20')];var _0x16f7a1=_0x3758d0?0x0:_0x26ce8b[_0x3dce('0x21')];var _0x3bc9dd=_0x3758d0?_0x553fd2[_0x3dce('0x20')]:_0x26ce8b['offset']+_0x26ce8b[_0x3dce('0x1e')];var _0x55b532;if(_0x3bc9dd>=_0x382bcd){_0x3bc9dd=_0x382bcd;_0x55b532=0xc8;}else{_0x55b532=0xce;}_0x37e8c4[_0x3dce('0x22')](_0x55b532);return _0x37e8c4[_0x3dce('0x23')]('Content-Range',_0x16f7a1+'-'+_0x3bc9dd+'/'+_0x382bcd)[_0x3dce('0x1d')](_0x553fd2);}return null;};}function patchUpdates(_0x118da3){return function(_0x43ec82){try{jsonpatch[_0x3dce('0x24')](_0x43ec82,_0x118da3,!![]);}catch(_0x519a1b){return BPromise[_0x3dce('0x25')](_0x519a1b);}return _0x43ec82[_0x3dce('0x26')]();};}function saveUpdates(_0x190450,_0x5d2039){return function(_0x4d59e8){if(_0x4d59e8){return _0x4d59e8['update'](_0x190450)[_0x3dce('0x27')](function(_0x3be493){return _0x3be493;});}return null;};}function removeEntity(_0x32d306,_0x1a9c4a){return function(_0x33fd99){if(_0x33fd99){return _0x33fd99['destroy']()['then'](function(){_0x32d306[_0x3dce('0x22')](0xcc)[_0x3dce('0x1c')]();});}};}function handleEntityNotFound(_0x36842a,_0x539cba){return function(_0x3ec2e3){if(!_0x3ec2e3){_0x36842a[_0x3dce('0x1b')](0x194);}return _0x3ec2e3;};}function handleError(_0x537fe2,_0x3991df){_0x3991df=_0x3991df||0x1f4;return function(_0x2e93dd){logger[_0x3dce('0x28')](_0x2e93dd[_0x3dce('0x29')]);if(_0x2e93dd[_0x3dce('0x2a')]){delete _0x2e93dd[_0x3dce('0x2a')];}_0x537fe2['status'](_0x3991df)[_0x3dce('0x2b')](_0x2e93dd);};}exports[_0x3dce('0x2c')]=function(_0x50ad15,_0x35cb15){var _0x38ccf9={},_0x15d2ac={},_0x29bfad={'count':0x0,'rows':[]};var _0x1490b3=_['map'](db['ChatInternalMessage'][_0x3dce('0x2d')],function(_0x394c6f){return{'name':_0x394c6f['fieldName'],'type':_0x394c6f[_0x3dce('0x2e')][_0x3dce('0x2f')]};});_0x15d2ac[_0x3dce('0x30')]=_[_0x3dce('0x31')](_0x1490b3,_0x3dce('0x2a'));_0x15d2ac['query']=_['keys'](_0x50ad15[_0x3dce('0x32')]);_0x15d2ac['filters']=_['intersection'](_0x15d2ac[_0x3dce('0x30')],_0x15d2ac[_0x3dce('0x32')]);_0x38ccf9[_0x3dce('0x33')]=_[_0x3dce('0x34')](_0x15d2ac[_0x3dce('0x30')],qs[_0x3dce('0x35')](_0x50ad15['query'][_0x3dce('0x35')]));_0x38ccf9['attributes']=_0x38ccf9[_0x3dce('0x33')][_0x3dce('0x36')]?_0x38ccf9[_0x3dce('0x33')]:_0x15d2ac[_0x3dce('0x30')];if(!_0x50ad15[_0x3dce('0x32')][_0x3dce('0x37')](_0x3dce('0x38'))){_0x38ccf9[_0x3dce('0x1e')]=qs['limit'](_0x50ad15[_0x3dce('0x32')]['limit']);_0x38ccf9['offset']=qs[_0x3dce('0x21')](_0x50ad15[_0x3dce('0x32')][_0x3dce('0x21')]);}_0x38ccf9[_0x3dce('0x39')]=qs[_0x3dce('0x3a')](_0x50ad15['query'][_0x3dce('0x3a')]);_0x38ccf9['where']=qs[_0x3dce('0x3b')](_[_0x3dce('0x3c')](_0x50ad15[_0x3dce('0x32')],_0x15d2ac[_0x3dce('0x3b')]),_0x1490b3);if(_0x50ad15[_0x3dce('0x32')][_0x3dce('0x3d')]){_0x38ccf9[_0x3dce('0x3e')]=_['merge'](_0x38ccf9[_0x3dce('0x3e')],{'$or':_[_0x3dce('0x31')](_0x1490b3,function(_0x2c5254){if(_0x2c5254[_0x3dce('0x2e')]!==_0x3dce('0x3f')){var _0x12102d={};_0x12102d[_0x2c5254[_0x3dce('0x2a')]]={'$like':'%'+_0x50ad15[_0x3dce('0x32')][_0x3dce('0x3d')]+'%'};return _0x12102d;}})});}_0x38ccf9=_[_0x3dce('0x40')]({},_0x38ccf9,_0x50ad15['options']);var _0x10f05b={'where':_0x38ccf9[_0x3dce('0x3e')]};return db['ChatInternalMessage'][_0x3dce('0x20')](_0x10f05b)['then'](function(_0x570fae){_0x29bfad[_0x3dce('0x20')]=_0x570fae;if(_0x50ad15['query']['includeAll']){_0x38ccf9[_0x3dce('0x41')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x3dce('0x42')](_0x38ccf9);})[_0x3dce('0x27')](function(_0x159019){_0x29bfad['rows']=_0x159019;return _0x29bfad;})[_0x3dce('0x27')](respondWithFilteredResult(_0x35cb15,_0x38ccf9))[_0x3dce('0x43')](handleError(_0x35cb15,null));};exports['show']=function(_0x52ad27,_0x35a6d4){var _0x1db8a0={'raw':!![],'where':{'id':_0x52ad27[_0x3dce('0x44')]['id']}},_0x304335={};_0x304335[_0x3dce('0x30')]=_[_0x3dce('0x45')](db[_0x3dce('0x46')][_0x3dce('0x2d')]);_0x304335[_0x3dce('0x32')]=_['keys'](_0x52ad27[_0x3dce('0x32')]);_0x304335['filters']=_[_0x3dce('0x34')](_0x304335[_0x3dce('0x30')],_0x304335[_0x3dce('0x32')]);_0x1db8a0[_0x3dce('0x33')]=_[_0x3dce('0x34')](_0x304335[_0x3dce('0x30')],qs[_0x3dce('0x35')](_0x52ad27[_0x3dce('0x32')]['fields']));_0x1db8a0[_0x3dce('0x33')]=_0x1db8a0[_0x3dce('0x33')]['length']?_0x1db8a0[_0x3dce('0x33')]:_0x304335[_0x3dce('0x30')];if(_0x52ad27[_0x3dce('0x32')][_0x3dce('0x47')]){_0x1db8a0[_0x3dce('0x41')]=[{'all':!![]}];}_0x1db8a0=_[_0x3dce('0x40')]({},_0x1db8a0,_0x52ad27['options']);return db[_0x3dce('0x46')]['find'](_0x1db8a0)['then'](handleEntityNotFound(_0x35a6d4,null))[_0x3dce('0x27')](respondWithResult(_0x35a6d4,null))['catch'](handleError(_0x35a6d4,null));};exports['create']=function(_0x468c6d,_0x5ee469){return db['ChatInternalMessage'][_0x3dce('0x48')](_0x468c6d[_0x3dce('0x49')],{})[_0x3dce('0x27')](respondWithResult(_0x5ee469,0xc9))[_0x3dce('0x43')](handleError(_0x5ee469,null));};exports[_0x3dce('0x4a')]=function(_0x5abab2,_0x12e223){if(_0x5abab2['body']['id']){delete _0x5abab2[_0x3dce('0x49')]['id'];}return db['ChatInternalMessage'][_0x3dce('0x4b')]({'where':{'id':_0x5abab2[_0x3dce('0x44')]['id']}})['then'](handleEntityNotFound(_0x12e223,null))[_0x3dce('0x27')](saveUpdates(_0x5abab2[_0x3dce('0x49')],null))[_0x3dce('0x27')](respondWithResult(_0x12e223,null))[_0x3dce('0x43')](handleError(_0x12e223,null));};exports['destroy']=function(_0xb3a8d4,_0x91d567){return db[_0x3dce('0x46')][_0x3dce('0x4b')]({'where':{'id':_0xb3a8d4[_0x3dce('0x44')]['id']}})[_0x3dce('0x27')](handleEntityNotFound(_0x91d567,null))['then'](removeEntity(_0x91d567,null))['catch'](handleError(_0x91d567,null));};exports[_0x3dce('0x4c')]=function(_0x38f442,_0x5424f8){return db[_0x3dce('0x46')][_0x3dce('0x4c')]()['then'](respondWithResult(_0x5424f8,null))[_0x3dce('0x43')](handleError(_0x5424f8,null));};function wrapUser(_0x115969){return function(_0x225e34){var _0x49b1e6=_0x115969[_0x3dce('0x4d')]({'plain':!![]});_0x49b1e6[_0x3dce('0x4e')]=[];if(_0x225e34){_0x49b1e6[_0x3dce('0x4f')]=_0x225e34[_0x3dce('0x50')];_0x49b1e6[_0x3dce('0x51')]=_0x225e34;}else{_0x49b1e6[_0x3dce('0x4f')]=moment(0x0)[_0x3dce('0x52')](_0x3dce('0x53'));_0x49b1e6[_0x3dce('0x51')]={};}return _0x49b1e6;};}exports[_0x3dce('0x54')]=function(_0x48ab06,_0x5e1c69,_0xaf9aca){var _0x1dfba5=[];return db[_0x3dce('0x55')][_0x3dce('0x42')]({'where':{'role':['agent',_0x3dce('0x56'),'user']},'attributes':['id',_0x3dce('0x57'),_0x3dce('0x2a'),_0x3dce('0x58'),_0x3dce('0x59'),_0x3dce('0x5a'),_0x3dce('0x5b'),_0x3dce('0x5c'),_0x3dce('0x5d'),'showWebBar'],'order':qs['sort'](_0x3dce('0x5e')),'include':[{'model':db[_0x3dce('0x5f')],'as':_0x3dce('0x60'),'attributes':['id',_0x3dce('0x2a'),_0x3dce('0x2e')],'through':{'attributes':[]}}]})[_0x3dce('0x27')](function(_0x19dae0){if(_0x19dae0){var _0x532b54=_0x48ab06[_0x3dce('0x61')][_0x3dce('0x4d')]({'plain':!![]});if(!_0x532b54)throw new Error(_0x3dce('0x62'));if(_0x532b54[_0x3dce('0x58')]===_0x3dce('0x61')){return db['UserProfileSection'][_0x3dce('0x4b')]({'where':{'name':_0x3dce('0x63'),'userProfileId':_0x532b54[_0x3dce('0x64')]},'raw':!![]})['then'](function(_0x3804dc){if(_0x3804dc){if(_0x3804dc[_0x3dce('0x65')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x3804dc['id']},'raw':!![]})[_0x3dce('0x27')](function(_0x262d83){var _0x1a6baa=[];if(_[_0x3dce('0x66')](_0x262d83)){_0x1a6baa=_[_0x3dce('0x3d')](_0x19dae0,function(_0x16bec9){if(_0x16bec9['role']!==_0x3dce('0x67')){return _0x16bec9;}});return _0x1a6baa;}else{for(var _0x139617=0x0;_0x139617<_0x19dae0[_0x3dce('0x36')];_0x139617++){var _0x53c9ab=_0x19dae0[_0x139617];if(_0x53c9ab[_0x3dce('0x58')]===_0x3dce('0x67')){var _0x4fabd5=_['find'](_0x262d83,function(_0x31680a){return _0x31680a['resourceId']===_0x53c9ab['id'];});if(_0x4fabd5)_0x1a6baa[_0x3dce('0x68')](_0x53c9ab);}else{_0x1a6baa[_0x3dce('0x68')](_0x53c9ab);}}return _0x1a6baa;}});}else{return _0x19dae0;}}else{var _0x3a9a91=_[_0x3dce('0x3d')](_0x19dae0,function(_0x592fda){if(_0x592fda[_0x3dce('0x58')]!==_0x3dce('0x67')){return _0x592fda;}});return _0x3a9a91;}});}else{return _0x19dae0;}}})[_0x3dce('0x27')](function(_0x3b5050){var _0x523e0a=[];if(_0x3b5050){_0x1dfba5=_0x3b5050;for(var _0x254851=0x0;_0x254851<_0x3b5050['length'];_0x254851+=0x1){_0x1dfba5[_0x254851][_0x3dce('0x4e')]=[];_0x523e0a['push'](db[_0x3dce('0x46')][_0x3dce('0x4b')]({'where':{'FromId':[_0x48ab06[_0x3dce('0x61')]['id'],_0x3b5050[_0x254851]['id']],'ToId':[_0x48ab06[_0x3dce('0x61')]['id'],_0x3b5050[_0x254851]['id']],'ChatGroupId':null},'attributes':['id',_0x3dce('0x50'),_0x3dce('0x69'),_0x3dce('0x6a'),'read',_0x3dce('0x49')],'order':qs[_0x3dce('0x3a')](_0x3dce('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x3dce('0x27')](wrapUser(_0x3b5050[_0x254851])));}return BPromise[_0x3dce('0x6c')](_0x523e0a);}return[];})[_0x3dce('0x27')](function(_0x568b3a){return{'rows':_0x568b3a,'count':_0x568b3a[_0x3dce('0x36')]};})[_0x3dce('0x27')](respondWithResult(_0x5e1c69,null))[_0x3dce('0x43')](handleError(_0x5e1c69,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 89c608d..9a26020 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 _0x90ad=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x2a9ec5,_0xed23b){var _0x52c7c0=function(_0x54b22d){while(--_0x54b22d){_0x2a9ec5['push'](_0x2a9ec5['shift']());}};_0x52c7c0(++_0xed23b);}(_0x90ad,0x195));var _0xd90a=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x90ad[_0x550d12];return _0x12103d;};'use strict';var EventEmitter=require(_0xd90a('0x0'));var ChatInternalMessage=require(_0xd90a('0x1'))['db'][_0xd90a('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd90a('0x3')](0x0);var events={'afterCreate':_0xd90a('0x4'),'afterUpdate':'update','afterDestroy':_0xd90a('0x5')};function emitEvent(_0x844190){return function(_0x45e9f3,_0x5e9622,_0x2691eb){ChatInternalMessageEvents['emit'](_0x844190+':'+_0x45e9f3['id'],_0x45e9f3);ChatInternalMessageEvents[_0xd90a('0x6')](_0x844190,_0x45e9f3);_0x2691eb(null);};}for(var e in events){if(events[_0xd90a('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xd90a('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xed61=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xed61,0x7e));var _0x1ed6=function(_0xd73d53,_0x598443){_0xd73d53=_0xd73d53-0x0;var _0x560148=_0xed61[_0xd73d53];return _0x560148;};'use strict';var EventEmitter=require(_0x1ed6('0x0'));var ChatInternalMessage=require(_0x1ed6('0x1'))['db'][_0x1ed6('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1ed6('0x3')](0x0);var events={'afterCreate':_0x1ed6('0x4'),'afterUpdate':_0x1ed6('0x5'),'afterDestroy':_0x1ed6('0x6')};function emitEvent(_0x9f07a6){return function(_0x2bf8fb,_0x4f4687,_0x5e4458){ChatInternalMessageEvents[_0x1ed6('0x7')](_0x9f07a6+':'+_0x2bf8fb['id'],_0x2bf8fb);ChatInternalMessageEvents[_0x1ed6('0x7')](_0x9f07a6,_0x2bf8fb);_0x5e4458(null);};}for(var e in events){if(events[_0x1ed6('0x8')](e)){var event=events[e];ChatInternalMessage[_0x1ed6('0x9')](e,emitEvent(event));}}module[_0x1ed6('0xa')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 986fd47..44d7e40 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 _0x19ca=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','./chatInternalMessage.attributes','exports','define'];(function(_0x17bb6a,_0x20cbca){var _0x5346ec=function(_0x1fda6a){while(--_0x1fda6a){_0x17bb6a['push'](_0x17bb6a['shift']());}};_0x5346ec(++_0x20cbca);}(_0x19ca,0xda));var _0xa19c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x19ca[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xa19c('0x0'));var logger=require(_0xa19c('0x1'))(_0xa19c('0x2'));var moment=require(_0xa19c('0x3'));var BPromise=require(_0xa19c('0x4'));var rp=require(_0xa19c('0x5'));var fs=require('fs');var path=require(_0xa19c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa19c('0x7'));module[_0xa19c('0x8')]=function(_0x56b94b,_0x4058bc){return _0x56b94b[_0xa19c('0x9')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa19c('0xa'),'collate':_0xa19c('0xb')});}; \ No newline at end of file +var _0xe136=['../../config/environment','./chatInternalMessage.attributes','exports','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x3fb5eb,_0x5947a6){var _0x481291=function(_0x74e4e){while(--_0x74e4e){_0x3fb5eb['push'](_0x3fb5eb['shift']());}};_0x481291(++_0x5947a6);}(_0xe136,0xd6));var _0x6e13=function(_0x459fee,_0x568ca0){_0x459fee=_0x459fee-0x0;var _0x7ba8e3=_0xe136[_0x459fee];return _0x7ba8e3;};'use strict';var _=require(_0x6e13('0x0'));var util=require(_0x6e13('0x1'));var logger=require('../../config/logger')(_0x6e13('0x2'));var moment=require(_0x6e13('0x3'));var BPromise=require(_0x6e13('0x4'));var rp=require(_0x6e13('0x5'));var fs=require('fs');var path=require(_0x6e13('0x6'));var rimraf=require('rimraf');var config=require(_0x6e13('0x7'));var attributes=require(_0x6e13('0x8'));module[_0x6e13('0x9')]=function(_0x31abfa,_0x6db7fd){return _0x31abfa['define'](_0x6e13('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6e13('0xb'),'collate':_0x6e13('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index fb8a455..eec43e7 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 _0x3aca=['stringify','error','message','ChatInternalMessage,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./chatInternalMessage.socket','register','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s'];(function(_0x2a3c4d,_0x9c6b37){var _0x55c390=function(_0x4871cf){while(--_0x4871cf){_0x2a3c4d['push'](_0x2a3c4d['shift']());}};_0x55c390(++_0x9c6b37);}(_0x3aca,0x83));var _0xa3ac=function(_0x55d8c5,_0x10287a){_0x55d8c5=_0x55d8c5-0x0;var _0x225ae5=_0x3aca[_0x55d8c5];return _0x225ae5;};'use strict';var _=require(_0xa3ac('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa3ac('0x1'));var rs=require(_0xa3ac('0x2'));var fs=require('fs');var Redis=require(_0xa3ac('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa3ac('0x4'));var logger=require(_0xa3ac('0x5'))(_0xa3ac('0x6'));var config=require(_0xa3ac('0x7'));var jayson=require(_0xa3ac('0x8'));var client=jayson['client'][_0xa3ac('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xa3ac('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa3ac('0xb'))(new Redis(config[_0xa3ac('0xa')]));require(_0xa3ac('0xc'))[_0xa3ac('0xd')](socket);function respondWithRpcPromise(_0x29f541,_0x5e8f4f,_0x1d3727){return new BPromise(function(_0x3817e3,_0x234168){return client['request'](_0x29f541,_0x1d3727)[_0xa3ac('0xe')](function(_0x9d8ba){logger[_0xa3ac('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x5e8f4f,_0xa3ac('0x10'));logger[_0xa3ac('0x11')](_0xa3ac('0x12'),_0x5e8f4f,_0xa3ac('0x10'),JSON[_0xa3ac('0x13')](_0x9d8ba));if(_0x9d8ba[_0xa3ac('0x14')]){if(_0x9d8ba[_0xa3ac('0x14')]['code']===0x1f4){logger[_0xa3ac('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x5e8f4f,_0x9d8ba['error']['message']);return _0x234168(_0x9d8ba[_0xa3ac('0x14')][_0xa3ac('0x15')]);}logger[_0xa3ac('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x5e8f4f,_0x9d8ba[_0xa3ac('0x14')][_0xa3ac('0x15')]);return _0x3817e3(_0x9d8ba['error'][_0xa3ac('0x15')]);}else{logger[_0xa3ac('0xf')](_0xa3ac('0x16'),_0x5e8f4f,_0xa3ac('0x10'));_0x3817e3(_0x9d8ba[_0xa3ac('0x17')]['message']);}})[_0xa3ac('0x18')](function(_0x1307be){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x5e8f4f,_0x1307be);_0x234168(_0x1307be);});});} \ No newline at end of file +var _0xfe6a=['lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInternalMessage.socket','request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0xfe6a,0x16c));var _0xafe6=function(_0x5d2c6c,_0x33e6f5){_0x5d2c6c=_0x5d2c6c-0x0;var _0x4bb774=_0xfe6a[_0x5d2c6c];return _0x4bb774;};'use strict';var _=require(_0xafe6('0x0'));var util=require(_0xafe6('0x1'));var moment=require(_0xafe6('0x2'));var BPromise=require('bluebird');var rs=require(_0xafe6('0x3'));var fs=require('fs');var Redis=require(_0xafe6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xafe6('0x5'));var logger=require(_0xafe6('0x6'))(_0xafe6('0x7'));var config=require(_0xafe6('0x8'));var jayson=require(_0xafe6('0x9'));var client=jayson[_0xafe6('0xa')][_0xafe6('0xb')]({'port':0x232a});config[_0xafe6('0xc')]=_[_0xafe6('0xd')](config['redis'],{'host':_0xafe6('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xafe6('0xc')]));require(_0xafe6('0xf'))['register'](socket);function respondWithRpcPromise(_0x52ea92,_0xfe2a6e,_0x272cc3){return new BPromise(function(_0x5e3db2,_0x2e2f6a){return client[_0xafe6('0x10')](_0x52ea92,_0x272cc3)[_0xafe6('0x11')](function(_0x7aaac4){logger['info'](_0xafe6('0x12'),_0xfe2a6e,_0xafe6('0x13'));logger['debug'](_0xafe6('0x14'),_0xfe2a6e,_0xafe6('0x13'),JSON['stringify'](_0x7aaac4));if(_0x7aaac4[_0xafe6('0x15')]){if(_0x7aaac4[_0xafe6('0x15')][_0xafe6('0x16')]===0x1f4){logger['error'](_0xafe6('0x12'),_0xfe2a6e,_0x7aaac4[_0xafe6('0x15')]['message']);return _0x2e2f6a(_0x7aaac4[_0xafe6('0x15')][_0xafe6('0x17')]);}logger[_0xafe6('0x15')](_0xafe6('0x12'),_0xfe2a6e,_0x7aaac4[_0xafe6('0x15')][_0xafe6('0x17')]);return _0x5e3db2(_0x7aaac4[_0xafe6('0x15')][_0xafe6('0x17')]);}else{logger[_0xafe6('0x18')](_0xafe6('0x12'),_0xfe2a6e,'request\x20sent');_0x5e3db2(_0x7aaac4[_0xafe6('0x19')]['message']);}})['catch'](function(_0x3bca7a){logger[_0xafe6('0x15')](_0xafe6('0x12'),_0xfe2a6e,_0x3bca7a);_0x2e2f6a(_0x3bca7a);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 88802dc..70f24ee 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 _0x252a=['update','emit','chatInternalMessage:','save','remove'];(function(_0x3a07d4,_0xa80b88){var _0x2c352=function(_0x27926b){while(--_0x27926b){_0x3a07d4['push'](_0x3a07d4['shift']());}};_0x2c352(++_0xa80b88);}(_0x252a,0x8f));var _0xa252=function(_0xd361b3,_0x3c7724){_0xd361b3=_0xd361b3-0x0;var _0x59a458=_0x252a[_0xd361b3];return _0x59a458;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xa252('0x0'),_0xa252('0x1'),_0xa252('0x2')];function createListener(_0x7f85fd,_0x43f243){return function(_0x938ae1){_0x43f243[_0xa252('0x3')](_0x7f85fd,_0x938ae1);};}function removeListener(_0x1b4a83,_0x24c27a){return function(){ChatInternalMessageEvents['removeListener'](_0x1b4a83,_0x24c27a);};}exports['register']=function(_0x1d16d7){for(var _0x28de3d=0x0,_0x43df42=events['length'];_0x28de3d<_0x43df42;_0x28de3d++){var _0x5648da=events[_0x28de3d];var _0x54c7a1=createListener(_0xa252('0x4')+_0x5648da,_0x1d16d7);ChatInternalMessageEvents['on'](_0x5648da,_0x54c7a1);}}; \ No newline at end of file +var _0x56e8=['remove','emit','register','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x5a8cb8,_0x4fb918){var _0xa5d455=function(_0x1ab326){while(--_0x1ab326){_0x5a8cb8['push'](_0x5a8cb8['shift']());}};_0xa5d455(++_0x4fb918);}(_0x56e8,0x184));var _0x856e=function(_0x5e6966,_0x985401){_0x5e6966=_0x5e6966-0x0;var _0x5409f2=_0x56e8[_0x5e6966];return _0x5409f2;};'use strict';var ChatInternalMessageEvents=require(_0x856e('0x0'));var events=[_0x856e('0x1'),_0x856e('0x2'),'update'];function createListener(_0x9d8f4e,_0x5899a9){return function(_0x29a139){_0x5899a9[_0x856e('0x3')](_0x9d8f4e,_0x29a139);};}function removeListener(_0x3a2890,_0x16b044){return function(){ChatInternalMessageEvents['removeListener'](_0x3a2890,_0x16b044);};}exports[_0x856e('0x4')]=function(_0x771474){for(var _0x5143f3=0x0,_0x436cff=events['length'];_0x5143f3<_0x436cff;_0x5143f3++){var _0x56f66f=events[_0x5143f3];var _0x5ec70c=createListener(_0x856e('0x5')+_0x56f66f,_0x771474);ChatInternalMessageEvents['on'](_0x56f66f,_0x5ec70c);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index e427d20..383bbfe 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 _0x0c99=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','/:id','post'];(function(_0x429b8c,_0xa0de50){var _0x5033dc=function(_0x1c612f){while(--_0x1c612f){_0x429b8c['push'](_0x429b8c['shift']());}};_0x5033dc(++_0xa0de50);}(_0x0c99,0x186));var _0x90c9=function(_0x26b5ff,_0x92009a){_0x26b5ff=_0x26b5ff-0x0;var _0x58603e=_0x0c99[_0x26b5ff];return _0x58603e;};'use strict';var multer=require(_0x90c9('0x0'));var util=require('util');var path=require(_0x90c9('0x1'));var timeout=require(_0x90c9('0x2'));var express=require(_0x90c9('0x3'));var router=express[_0x90c9('0x4')]();var fs_extra=require(_0x90c9('0x5'));var auth=require(_0x90c9('0x6'));var interaction=require(_0x90c9('0x7'));var config=require(_0x90c9('0x8'));var controller=require(_0x90c9('0x9'));router[_0x90c9('0xa')]('/',auth[_0x90c9('0xb')](),controller[_0x90c9('0xc')]);router['get'](_0x90c9('0xd'),auth['isAuthenticated'](),controller[_0x90c9('0xe')]);router[_0x90c9('0xa')](_0x90c9('0xf'),auth['isAuthenticated'](),controller['getUsers']);router[_0x90c9('0xa')](_0x90c9('0x10'),auth[_0x90c9('0xb')](),controller['show']);router[_0x90c9('0x11')]('/',auth[_0x90c9('0xb')](),controller[_0x90c9('0x12')]);router[_0x90c9('0x13')](_0x90c9('0x10'),controller[_0x90c9('0x14')]);router[_0x90c9('0x15')](_0x90c9('0x10'),auth[_0x90c9('0xb')](),controller[_0x90c9('0x16')]);module[_0x90c9('0x17')]=router; \ No newline at end of file +var _0x74be=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','getUsers','/:id','show','post','create','put','delete','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x58ef68,_0x275204){var _0x169a7f=function(_0x479c79){while(--_0x479c79){_0x58ef68['push'](_0x58ef68['shift']());}};_0x169a7f(++_0x275204);}(_0x74be,0xd7));var _0xe74b=function(_0x596496,_0x57a567){_0x596496=_0x596496-0x0;var _0x5f0acd=_0x74be[_0x596496];return _0x5f0acd;};'use strict';var multer=require('multer');var util=require(_0xe74b('0x0'));var path=require('path');var timeout=require(_0xe74b('0x1'));var express=require(_0xe74b('0x2'));var router=express[_0xe74b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe74b('0x4'));var interaction=require(_0xe74b('0x5'));var config=require(_0xe74b('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xe74b('0x7')]('/',auth[_0xe74b('0x8')](),controller[_0xe74b('0x9')]);router[_0xe74b('0x7')](_0xe74b('0xa'),auth[_0xe74b('0x8')](),controller[_0xe74b('0xb')]);router['get']('/users',auth[_0xe74b('0x8')](),controller[_0xe74b('0xc')]);router[_0xe74b('0x7')](_0xe74b('0xd'),auth[_0xe74b('0x8')](),controller[_0xe74b('0xe')]);router[_0xe74b('0xf')]('/',auth[_0xe74b('0x8')](),controller[_0xe74b('0x10')]);router[_0xe74b('0x11')](_0xe74b('0xd'),controller['update']);router[_0xe74b('0x12')](_0xe74b('0xd'),auth[_0xe74b('0x8')](),controller['destroy']);module[_0xe74b('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 1f46d32..572ace6 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 _0x6901=['medium','ENUM','out','STRING','sequelize','TEXT'];(function(_0x296955,_0x19b6cc){var _0x4a9f7d=function(_0x38c303){while(--_0x38c303){_0x296955['push'](_0x296955['shift']());}};_0x4a9f7d(++_0x19b6cc);}(_0x6901,0x100));var _0x1690=function(_0x22d52a,_0x20f13a){_0x22d52a=_0x22d52a-0x0;var _0x553752=_0x6901[_0x22d52a];return _0x553752;};'use strict';var Sequelize=require(_0x1690('0x0'));module['exports']={'body':{'type':Sequelize[_0x1690('0x1')](_0x1690('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x1690('0x3')]('in',_0x1690('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x1690('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x7462=['out','STRING','TEXT','sequelize','exports','BOOLEAN'];(function(_0x488db3,_0x4a5cae){var _0x358b3c=function(_0x4b3fcf){while(--_0x4b3fcf){_0x488db3['push'](_0x488db3['shift']());}};_0x358b3c(++_0x4a5cae);}(_0x7462,0x165));var _0x2746=function(_0x349a9e,_0x473cb8){_0x349a9e=_0x349a9e-0x0;var _0x24c207=_0x7462[_0x349a9e];return _0x24c207;};'use strict';var Sequelize=require(_0x2746('0x0'));module[_0x2746('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2746('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x2746('0x3')),'defaultValue':_0x2746('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x2746('0x4')]},'providerResponse':{'type':Sequelize[_0x2746('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 708d4af..16a10f6 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 _0x1e9b=['catch','sendStatus','end','status','limit','undefined','count','offset','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','show','params','rawAttributes','ChatMessage','create','body','find','describe','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteractionId','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','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','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','result'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x1e9b,0xe2));var _0xb1e9=function(_0x31ebac,_0x58de2c){_0x31ebac=_0x31ebac-0x0;var _0x188a43=_0x1e9b[_0x31ebac];return _0x188a43;};'use strict';var emlformat=require(_0xb1e9('0x0'));var rimraf=require(_0xb1e9('0x1'));var zipdir=require(_0xb1e9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb1e9('0x3'));var moment=require(_0xb1e9('0x4'));var BPromise=require(_0xb1e9('0x5'));var Mustache=require(_0xb1e9('0x6'));var util=require(_0xb1e9('0x7'));var path=require(_0xb1e9('0x8'));var sox=require(_0xb1e9('0x9'));var csv=require(_0xb1e9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1e9('0xb'));var _=require(_0xb1e9('0xc'));var squel=require(_0xb1e9('0xd'));var crypto=require(_0xb1e9('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb1e9('0xa'));var querystring=require('querystring');var Papa=require(_0xb1e9('0xf'));var Redis=require('ioredis');var authService=require(_0xb1e9('0x10'));var qs=require(_0xb1e9('0x11'));var as=require(_0xb1e9('0x12'));var hardwareService=require(_0xb1e9('0x13'));var logger=require(_0xb1e9('0x14'))('api');var utils=require(_0xb1e9('0x15'));var config=require(_0xb1e9('0x16'));var licenseUtil=require(_0xb1e9('0x17'));var db=require('../../mysqldb')['db'];config[_0xb1e9('0x18')]=_['defaults'](config[_0xb1e9('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb1e9('0x19'))(new Redis(config[_0xb1e9('0x18')]));require(_0xb1e9('0x1a'))[_0xb1e9('0x1b')](socket);var jayson=require(_0xb1e9('0x1c'));var client=jayson[_0xb1e9('0x1d')][_0xb1e9('0x1e')]({'port':0x232c});var client9002=jayson[_0xb1e9('0x1d')][_0xb1e9('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x210f98,_0x4fabb3,_0x43934c,_0x4b82a7){return new BPromise(function(_0x371150,_0x3668a4){var _0x906c7c=_0x4b82a7||client;return _0x906c7c[_0xb1e9('0x1f')](_0x210f98,_0x43934c)['then'](function(_0x1774ac){logger[_0xb1e9('0x20')]('ChatMessage,\x20%s,\x20%s',_0x4fabb3,_0xb1e9('0x21'));logger[_0xb1e9('0x22')](_0xb1e9('0x23'),_0x4fabb3,_0xb1e9('0x21'),JSON[_0xb1e9('0x24')](_0x1774ac));if(_0x1774ac[_0xb1e9('0x25')]){if(_0x1774ac['error'][_0xb1e9('0x26')]===0x1f4){logger[_0xb1e9('0x25')]('ChatMessage,\x20%s,\x20%s',_0x4fabb3,_0x1774ac[_0xb1e9('0x25')][_0xb1e9('0x27')]);return _0x3668a4(_0x1774ac[_0xb1e9('0x25')][_0xb1e9('0x27')]);}logger[_0xb1e9('0x25')](_0xb1e9('0x28'),_0x4fabb3,_0x1774ac[_0xb1e9('0x25')][_0xb1e9('0x27')]);return _0x371150(_0x1774ac[_0xb1e9('0x25')][_0xb1e9('0x27')]);}else{logger[_0xb1e9('0x20')](_0xb1e9('0x28'),_0x4fabb3,_0xb1e9('0x21'));_0x371150(_0x1774ac[_0xb1e9('0x29')]['message']);}})[_0xb1e9('0x2a')](function(_0x1afb1a){logger[_0xb1e9('0x25')]('ChatMessage,\x20%s,\x20%s',_0x4fabb3,_0x1afb1a);_0x3668a4(_0x1afb1a);});});}function respondWithStatusCode(_0x5655b2,_0x2eb237){_0x2eb237=_0x2eb237||0xcc;return function(_0x42ea93){if(_0x42ea93){return _0x5655b2[_0xb1e9('0x2b')](_0x2eb237);}return _0x5655b2['status'](_0x2eb237)[_0xb1e9('0x2c')]();};}function respondWithResult(_0x254c7c,_0x25c898){_0x25c898=_0x25c898||0xc8;return function(_0x1094e1){if(_0x1094e1){return _0x254c7c[_0xb1e9('0x2d')](_0x25c898)['json'](_0x1094e1);}};}function respondWithFilteredResult(_0x34ff3a,_0x227595){return function(_0x1d553b){if(_0x1d553b){var _0x45cb07=typeof _0x227595['offset']==='undefined'&&typeof _0x227595[_0xb1e9('0x2e')]===_0xb1e9('0x2f');var _0xc85b16=_0x1d553b[_0xb1e9('0x30')];var _0x52a058=_0x45cb07?0x0:_0x227595['offset'];var _0x1e1322=_0x45cb07?_0x1d553b['count']:_0x227595[_0xb1e9('0x31')]+_0x227595[_0xb1e9('0x2e')];var _0x49cfce;if(_0x1e1322>=_0xc85b16){_0x1e1322=_0xc85b16;_0x49cfce=0xc8;}else{_0x49cfce=0xce;}_0x34ff3a[_0xb1e9('0x2d')](_0x49cfce);return _0x34ff3a['set'](_0xb1e9('0x32'),_0x52a058+'-'+_0x1e1322+'/'+_0xc85b16)['json'](_0x1d553b);}return null;};}function patchUpdates(_0x44c36a){return function(_0x3d61f3){try{jsonpatch[_0xb1e9('0x33')](_0x3d61f3,_0x44c36a,!![]);}catch(_0x59eab4){return BPromise[_0xb1e9('0x34')](_0x59eab4);}return _0x3d61f3[_0xb1e9('0x35')]();};}function saveUpdates(_0x50c896,_0x9ab3ef){return function(_0x202f49){if(_0x202f49){return _0x202f49[_0xb1e9('0x36')](_0x50c896)['then'](function(_0x2068ff){return _0x2068ff;});}return null;};}function removeEntity(_0x254256,_0x18678d){return function(_0x4aa218){if(_0x4aa218){return _0x4aa218[_0xb1e9('0x37')]()['then'](function(){_0x254256[_0xb1e9('0x2d')](0xcc)[_0xb1e9('0x2c')]();});}};}function handleEntityNotFound(_0x361afd,_0x522784){return function(_0x57b188){if(!_0x57b188){_0x361afd[_0xb1e9('0x2b')](0x194);}return _0x57b188;};}function handleError(_0x55ba59,_0x21c564){_0x21c564=_0x21c564||0x1f4;return function(_0x114162){logger[_0xb1e9('0x25')](_0x114162[_0xb1e9('0x38')]);if(_0x114162['name']){delete _0x114162[_0xb1e9('0x39')];}_0x55ba59[_0xb1e9('0x2d')](_0x21c564)[_0xb1e9('0x3a')](_0x114162);};}exports[_0xb1e9('0x3b')]=function(_0x278751,_0x1dc108){var _0x43dc5f={},_0x450a16={},_0x488b20={'count':0x0,'rows':[]};var _0x526d2c=_[_0xb1e9('0x3c')](db['ChatMessage']['rawAttributes'],function(_0x306526){return{'name':_0x306526['fieldName'],'type':_0x306526[_0xb1e9('0x3d')][_0xb1e9('0x3e')]};});_0x450a16['model']=_[_0xb1e9('0x3c')](_0x526d2c,'name');_0x450a16[_0xb1e9('0x3f')]=_[_0xb1e9('0x40')](_0x278751[_0xb1e9('0x3f')]);_0x450a16[_0xb1e9('0x41')]=_[_0xb1e9('0x42')](_0x450a16[_0xb1e9('0x43')],_0x450a16[_0xb1e9('0x3f')]);_0x43dc5f[_0xb1e9('0x44')]=_[_0xb1e9('0x42')](_0x450a16[_0xb1e9('0x43')],qs[_0xb1e9('0x45')](_0x278751['query'][_0xb1e9('0x45')]));_0x43dc5f[_0xb1e9('0x44')]=_0x43dc5f[_0xb1e9('0x44')][_0xb1e9('0x46')]?_0x43dc5f[_0xb1e9('0x44')]:_0x450a16['model'];if(!_0x278751['query'][_0xb1e9('0x47')](_0xb1e9('0x48'))){_0x43dc5f[_0xb1e9('0x2e')]=qs[_0xb1e9('0x2e')](_0x278751[_0xb1e9('0x3f')]['limit']);_0x43dc5f[_0xb1e9('0x31')]=qs[_0xb1e9('0x31')](_0x278751[_0xb1e9('0x3f')][_0xb1e9('0x31')]);}_0x43dc5f[_0xb1e9('0x49')]=qs[_0xb1e9('0x4a')](_0x278751['query'][_0xb1e9('0x4a')]);_0x43dc5f['where']=qs[_0xb1e9('0x41')](_[_0xb1e9('0x4b')](_0x278751[_0xb1e9('0x3f')],_0x450a16[_0xb1e9('0x41')]),_0x526d2c);if(_0x278751[_0xb1e9('0x3f')][_0xb1e9('0x4c')]){_0x43dc5f[_0xb1e9('0x4d')]=_[_0xb1e9('0x4e')](_0x43dc5f[_0xb1e9('0x4d')],{'$or':_['map'](_0x526d2c,function(_0x3e226f){if(_0x3e226f[_0xb1e9('0x3d')]!==_0xb1e9('0x4f')){var _0x2fb1bb={};_0x2fb1bb[_0x3e226f[_0xb1e9('0x39')]]={'$like':'%'+_0x278751[_0xb1e9('0x3f')][_0xb1e9('0x4c')]+'%'};return _0x2fb1bb;}})});}_0x43dc5f=_['merge']({},_0x43dc5f,_0x278751[_0xb1e9('0x50')]);var _0x38b47e={'where':_0x43dc5f[_0xb1e9('0x4d')]};return db['ChatMessage'][_0xb1e9('0x30')](_0x38b47e)[_0xb1e9('0x51')](function(_0x42e5b0){_0x488b20[_0xb1e9('0x30')]=_0x42e5b0;if(_0x278751['query'][_0xb1e9('0x52')]){_0x43dc5f[_0xb1e9('0x53')]=[{'all':!![]}];}return db['ChatMessage'][_0xb1e9('0x54')](_0x43dc5f);})[_0xb1e9('0x51')](function(_0x2114f9){_0x488b20[_0xb1e9('0x55')]=_0x2114f9;return _0x488b20;})[_0xb1e9('0x51')](respondWithFilteredResult(_0x1dc108,_0x43dc5f))[_0xb1e9('0x2a')](handleError(_0x1dc108,null));};exports[_0xb1e9('0x56')]=function(_0xd4c442,_0x188402){var _0x459b0c={'raw':!![],'where':{'id':_0xd4c442[_0xb1e9('0x57')]['id']}},_0x1ad874={};_0x1ad874[_0xb1e9('0x43')]=_['keys'](db['ChatMessage'][_0xb1e9('0x58')]);_0x1ad874[_0xb1e9('0x3f')]=_['keys'](_0xd4c442['query']);_0x1ad874[_0xb1e9('0x41')]=_[_0xb1e9('0x42')](_0x1ad874['model'],_0x1ad874['query']);_0x459b0c[_0xb1e9('0x44')]=_[_0xb1e9('0x42')](_0x1ad874[_0xb1e9('0x43')],qs[_0xb1e9('0x45')](_0xd4c442[_0xb1e9('0x3f')][_0xb1e9('0x45')]));_0x459b0c[_0xb1e9('0x44')]=_0x459b0c[_0xb1e9('0x44')][_0xb1e9('0x46')]?_0x459b0c[_0xb1e9('0x44')]:_0x1ad874['model'];if(_0xd4c442[_0xb1e9('0x3f')][_0xb1e9('0x52')]){_0x459b0c[_0xb1e9('0x53')]=[{'all':!![]}];}_0x459b0c=_['merge']({},_0x459b0c,_0xd4c442[_0xb1e9('0x50')]);return db['ChatMessage']['find'](_0x459b0c)[_0xb1e9('0x51')](handleEntityNotFound(_0x188402,null))['then'](respondWithResult(_0x188402,null))[_0xb1e9('0x2a')](handleError(_0x188402,null));};exports['create']=function(_0x8d2727,_0x2cd099){return db[_0xb1e9('0x59')][_0xb1e9('0x5a')](_0x8d2727[_0xb1e9('0x5b')],{})['then'](respondWithResult(_0x2cd099,0xc9))[_0xb1e9('0x2a')](handleError(_0x2cd099,null));};exports['update']=function(_0x237e3f,_0x56dd6e){if(_0x237e3f[_0xb1e9('0x5b')]['id']){delete _0x237e3f[_0xb1e9('0x5b')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x237e3f[_0xb1e9('0x57')]['id']}})[_0xb1e9('0x51')](handleEntityNotFound(_0x56dd6e,null))[_0xb1e9('0x51')](saveUpdates(_0x237e3f[_0xb1e9('0x5b')],null))[_0xb1e9('0x51')](respondWithResult(_0x56dd6e,null))[_0xb1e9('0x2a')](handleError(_0x56dd6e,null));};exports[_0xb1e9('0x37')]=function(_0x428414,_0x12c09d){return db['ChatMessage'][_0xb1e9('0x5c')]({'where':{'id':_0x428414[_0xb1e9('0x57')]['id']}})[_0xb1e9('0x51')](handleEntityNotFound(_0x12c09d,null))[_0xb1e9('0x51')](removeEntity(_0x12c09d,null))['catch'](handleError(_0x12c09d,null));};exports['describe']=function(_0x3b6e7b,_0x2b345d){return db[_0xb1e9('0x59')][_0xb1e9('0x5d')]()['then'](respondWithResult(_0x2b345d,null))[_0xb1e9('0x2a')](handleError(_0x2b345d,null));};var interaction_log=require(_0xb1e9('0x14'))('chat-interactions');exports[_0xb1e9('0x5e')]=function(_0xc52b2d,_0x572a98,_0x1a9f9d){var _0x2e6cf3={'agent':{},'channel':_0xb1e9('0x5f')};if(_0xc52b2d[_0xb1e9('0x5b')]['id']){delete _0xc52b2d[_0xb1e9('0x5b')]['id'];}_0xc52b2d[_0xb1e9('0x5b')][_0xb1e9('0x60')]=!![];_0xc52b2d[_0xb1e9('0x5b')]['readAt']=moment()[_0xb1e9('0x61')](_0xb1e9('0x62'));_0xc52b2d['body'][_0xb1e9('0x63')]=_0xc52b2d[_0xb1e9('0x5b')][_0xb1e9('0x63')]||_0xc52b2d[_0xb1e9('0x64')]['id'];_0x2e6cf3[_0xb1e9('0x65')]['id']=_0xc52b2d['body'][_0xb1e9('0x63')];return db[_0xb1e9('0x59')][_0xb1e9('0x5c')]({'where':{'id':_0xc52b2d[_0xb1e9('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x572a98,null))['then'](saveUpdates(_0xc52b2d['body'],null))[_0xb1e9('0x51')](function(_0x461a2b){if(_0x461a2b){_0x2e6cf3[_0xb1e9('0x27')]=_0x461a2b['get']({'plain':!![]});return db['ChatInteraction'][_0xb1e9('0x5c')]({'where':{'id':_0x461a2b[_0xb1e9('0x66')]}});}return null;})[_0xb1e9('0x51')](handleEntityNotFound(_0x572a98,null))[_0xb1e9('0x51')](function(_0x4abef4){if(_0x4abef4){return _0x4abef4['update']({'UserId':_0xc52b2d[_0xb1e9('0x5b')][_0xb1e9('0x63')],'read1stAt':_['isNil'](_0x4abef4['read1stAt'])?moment()[_0xb1e9('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb1e9('0x51')](function(_0x8c9c03){if(_0x8c9c03){_0x2e6cf3[_0xb1e9('0x67')]=_0x8c9c03[_0xb1e9('0x68')]({'plain':!![]});interaction_log['info'](_0xb1e9('0x69'),_0xc52b2d[_0xb1e9('0x64')]['id'],_0xc52b2d[_0xb1e9('0x64')]['name'],_0xc52b2d[_0xb1e9('0x64')][_0xb1e9('0x6a')],_0x2e6cf3[_0xb1e9('0x67')]['id'],_0xc52b2d[_0xb1e9('0x5b')]?JSON[_0xb1e9('0x24')](_0xc52b2d[_0xb1e9('0x5b')]):_0xb1e9('0x6b'));return respondWithRpcPromise(_0xb1e9('0x6c'),'acceptMessage',_0x2e6cf3);}return null;})[_0xb1e9('0x51')](function(_0x36c621){var _0x511968=_0xb1e9('0x6d')+_0x36c621[_0xb1e9('0x27')][_0xb1e9('0x6e')];return db[_0xb1e9('0x6f')][_0xb1e9('0x3f')](_0x511968,{'type':db[_0xb1e9('0x70')][_0xb1e9('0x71')][_0xb1e9('0x72')],'raw':!![]})[_0xb1e9('0x51')](function(_0x27703b){return _0x27703b;});})[_0xb1e9('0x51')](function(_0x9c585d){if(_0x9c585d){_0x2e6cf3[_0xb1e9('0x27')]['contact']=_0x9c585d[0x0];if(!_0xc52b2d[_0xb1e9('0x5b')][_0xb1e9('0x63')])return;return db[_0xb1e9('0x73')][_0xb1e9('0x5c')]({'where':{'id':_0xc52b2d['body'][_0xb1e9('0x63')],'role':'agent'},'attributes':['id',_0xb1e9('0x39'),_0xb1e9('0x74'),_0xb1e9('0x75'),_0xb1e9('0x76')],'raw':!![]});}return null;})[_0xb1e9('0x51')](function(_0x22713c){if(!_0x22713c)return null;_0x2e6cf3[_0xb1e9('0x27')][_0xb1e9('0x65')]=_0x22713c;return _0x2e6cf3;})['then'](function(_0x5a6a96){if(_0x5a6a96){if(_0xc52b2d['body']['manual']){_0x2e6cf3[_0xb1e9('0x27')][_0xb1e9('0x77')]=util[_0xb1e9('0x61')](_0xb1e9('0x78'),_0xc52b2d['user'][_0xb1e9('0x39')]);_0x2e6cf3[_0xb1e9('0x27')]['channel']=_0x2e6cf3[_0xb1e9('0x79')];_0x2e6cf3[_0xb1e9('0x27')]['motionChannel']=_0x2e6cf3[_0xb1e9('0x79')];_0x2e6cf3[_0xb1e9('0x27')][_0xb1e9('0x7a')]=_0xb1e9('0x5e');return respondWithRpcPromise(_0xb1e9('0x7b'),'EventManager',{'event':_0xb1e9('0x7c'),'message':_[_0xb1e9('0x4e')](_0x2e6cf3['message'],JSON[_0xb1e9('0x7d')](_0x2e6cf3[_0xb1e9('0x67')][_0xb1e9('0x7e')]))},client9002)[_0xb1e9('0x51')](function(){return _0x2e6cf3;});}return _0x2e6cf3;}return null;})['then'](respondWithResult(_0x572a98,null))[_0xb1e9('0x2a')](handleError(_0x572a98,null));};var interaction_log=require(_0xb1e9('0x14'))(_0xb1e9('0x7f'));exports['reject']=function(_0x16817e,_0x18b042,_0x36f8fb){var _0x2384d0={'agent':{},'channel':_0xb1e9('0x5f')};if(_0x16817e['body']['id']){delete _0x16817e['body']['id'];}_0x16817e[_0xb1e9('0x5b')][_0xb1e9('0x63')]=_0x16817e['body'][_0xb1e9('0x63')]||_0x16817e[_0xb1e9('0x64')]['id'];_0x2384d0['agent']['id']=_0x16817e[_0xb1e9('0x5b')][_0xb1e9('0x63')];return db[_0xb1e9('0x59')][_0xb1e9('0x5c')]({'where':{'id':_0x16817e[_0xb1e9('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x18b042,null))[_0xb1e9('0x51')](function(_0x5e8401){if(_0x5e8401){_0x2384d0[_0xb1e9('0x27')]=_0x5e8401[_0xb1e9('0x68')]({'plain':!![]});return db[_0xb1e9('0x80')][_0xb1e9('0x5c')]({'where':{'id':_0x5e8401['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x18b042,null))[_0xb1e9('0x51')](function(_0x3a1f8b){if(_0x3a1f8b){_0x2384d0['interaction']=_0x3a1f8b[_0xb1e9('0x68')]({'plain':!![]});interaction_log[_0xb1e9('0x20')](_0xb1e9('0x81'),_0x16817e[_0xb1e9('0x64')]['id'],_0x16817e['user'][_0xb1e9('0x39')],_0x16817e[_0xb1e9('0x64')]['role'],_0x2384d0[_0xb1e9('0x67')]['id'],_0x16817e['body']?JSON[_0xb1e9('0x24')](_0x16817e[_0xb1e9('0x5b')]):_0xb1e9('0x6b'));return respondWithRpcPromise(_0xb1e9('0x82'),_0xb1e9('0x83'),_0x2384d0);}return null;})[_0xb1e9('0x51')](function(_0x2b9dac){var _0x34bbd3=_0xb1e9('0x6d')+_0x2b9dac[_0xb1e9('0x27')]['ContactId'];return db['sequelize'][_0xb1e9('0x3f')](_0x34bbd3,{'type':db[_0xb1e9('0x70')][_0xb1e9('0x71')][_0xb1e9('0x72')],'raw':!![]})['then'](function(_0x143d8d){return _0x143d8d;});})[_0xb1e9('0x51')](function(_0x5a7e1b){if(_0x5a7e1b){_0x2384d0['message']['contact']=_0x5a7e1b[0x0];if(!_0x16817e['body'][_0xb1e9('0x63')])return;return db['User']['find']({'where':{'id':_0x16817e['body'][_0xb1e9('0x63')],'role':_0xb1e9('0x65')},'attributes':['id',_0xb1e9('0x39'),_0xb1e9('0x74'),'email',_0xb1e9('0x76')],'raw':!![]});}return null;})['then'](function(_0x44858a){if(!_0x44858a)return null;_0x2384d0[_0xb1e9('0x27')]['agent']=_0x44858a;return _0x2384d0;})[_0xb1e9('0x51')](function(_0x46c511){if(_0x46c511){_0x46c511[_0xb1e9('0x27')][_0xb1e9('0x77')]=util[_0xb1e9('0x61')](_0xb1e9('0x78'),_0x16817e[_0xb1e9('0x64')][_0xb1e9('0x39')]);_0x46c511[_0xb1e9('0x27')][_0xb1e9('0x79')]=_0x2384d0['channel'];_0x46c511[_0xb1e9('0x27')][_0xb1e9('0x84')]=_0x2384d0[_0xb1e9('0x79')];_0x46c511[_0xb1e9('0x27')]['event']=_0xb1e9('0x34');respondWithRpcPromise(_0xb1e9('0x7b'),_0xb1e9('0x7b'),{'event':_0xb1e9('0x85'),'message':_[_0xb1e9('0x4e')](_0x2384d0['message'],JSON[_0xb1e9('0x7d')](_0x2384d0['interaction'][_0xb1e9('0x7e')]))},client9002);return _0x2384d0;}return null;})['then'](respondWithResult(_0x18b042,null))[_0xb1e9('0x2a')](handleError(_0x18b042,null));}; \ No newline at end of file +var _0xd5a4=['get','ChatInteraction','ChatInteractionId','update','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','SIP/%s','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','end','json','undefined','limit','count','offset','set','apply','destroy','name','send','map','rawAttributes','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','where','pick','filter','VIRTUAL','merge','ChatMessage','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent'];(function(_0x255737,_0x23d57a){var _0x3e3310=function(_0x24da7a){while(--_0x24da7a){_0x255737['push'](_0x255737['shift']());}};_0x3e3310(++_0x23d57a);}(_0xd5a4,0x125));var _0x4d5a=function(_0x329dfd,_0x8b20c7){_0x329dfd=_0x329dfd-0x0;var _0x4ded23=_0xd5a4[_0x329dfd];return _0x4ded23;};'use strict';var emlformat=require(_0x4d5a('0x0'));var rimraf=require(_0x4d5a('0x1'));var zipdir=require(_0x4d5a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4d5a('0x3'));var moment=require(_0x4d5a('0x4'));var BPromise=require(_0x4d5a('0x5'));var Mustache=require(_0x4d5a('0x6'));var util=require('util');var path=require(_0x4d5a('0x7'));var sox=require(_0x4d5a('0x8'));var csv=require(_0x4d5a('0x9'));var ejs=require(_0x4d5a('0xa'));var fs=require('fs');var fs_extra=require(_0x4d5a('0xb'));var _=require(_0x4d5a('0xc'));var squel=require(_0x4d5a('0xd'));var crypto=require(_0x4d5a('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4d5a('0x9'));var querystring=require(_0x4d5a('0xf'));var Papa=require(_0x4d5a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4d5a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4d5a('0x12'))(_0x4d5a('0x13'));var utils=require('../../config/utils');var config=require(_0x4d5a('0x14'));var licenseUtil=require(_0x4d5a('0x15'));var db=require(_0x4d5a('0x16'))['db'];config['redis']=_['defaults'](config[_0x4d5a('0x17')],{'host':_0x4d5a('0x18'),'port':0x18eb});var socket=require(_0x4d5a('0x19'))(new Redis(config[_0x4d5a('0x17')]));require(_0x4d5a('0x1a'))[_0x4d5a('0x1b')](socket);var jayson=require(_0x4d5a('0x1c'));var client=jayson[_0x4d5a('0x1d')][_0x4d5a('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x4d5a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2e2c59,_0x57d142,_0x2cb642,_0x332dae){return new BPromise(function(_0x395e2b,_0x266280){var _0x526a75=_0x332dae||client;return _0x526a75[_0x4d5a('0x1f')](_0x2e2c59,_0x2cb642)[_0x4d5a('0x20')](function(_0x572349){logger[_0x4d5a('0x21')](_0x4d5a('0x22'),_0x57d142,_0x4d5a('0x23'));logger[_0x4d5a('0x24')](_0x4d5a('0x25'),_0x57d142,_0x4d5a('0x23'),JSON[_0x4d5a('0x26')](_0x572349));if(_0x572349['error']){if(_0x572349[_0x4d5a('0x27')][_0x4d5a('0x28')]===0x1f4){logger[_0x4d5a('0x27')](_0x4d5a('0x22'),_0x57d142,_0x572349[_0x4d5a('0x27')][_0x4d5a('0x29')]);return _0x266280(_0x572349[_0x4d5a('0x27')][_0x4d5a('0x29')]);}logger[_0x4d5a('0x27')](_0x4d5a('0x22'),_0x57d142,_0x572349[_0x4d5a('0x27')]['message']);return _0x395e2b(_0x572349['error']['message']);}else{logger[_0x4d5a('0x21')](_0x4d5a('0x22'),_0x57d142,_0x4d5a('0x23'));_0x395e2b(_0x572349['result']['message']);}})['catch'](function(_0x5876bd){logger[_0x4d5a('0x27')](_0x4d5a('0x22'),_0x57d142,_0x5876bd);_0x266280(_0x5876bd);});});}function respondWithStatusCode(_0x11f362,_0x5c9e37){_0x5c9e37=_0x5c9e37||0xcc;return function(_0x4ce22f){if(_0x4ce22f){return _0x11f362['sendStatus'](_0x5c9e37);}return _0x11f362[_0x4d5a('0x2a')](_0x5c9e37)[_0x4d5a('0x2b')]();};}function respondWithResult(_0x19f6ae,_0x5393e0){_0x5393e0=_0x5393e0||0xc8;return function(_0x1764ae){if(_0x1764ae){return _0x19f6ae[_0x4d5a('0x2a')](_0x5393e0)[_0x4d5a('0x2c')](_0x1764ae);}};}function respondWithFilteredResult(_0x402f96,_0x175517){return function(_0x597bfa){if(_0x597bfa){var _0x288976=typeof _0x175517['offset']===_0x4d5a('0x2d')&&typeof _0x175517[_0x4d5a('0x2e')]===_0x4d5a('0x2d');var _0x517f5b=_0x597bfa[_0x4d5a('0x2f')];var _0x1eef60=_0x288976?0x0:_0x175517[_0x4d5a('0x30')];var _0xdb1c99=_0x288976?_0x597bfa[_0x4d5a('0x2f')]:_0x175517[_0x4d5a('0x30')]+_0x175517[_0x4d5a('0x2e')];var _0x4e0198;if(_0xdb1c99>=_0x517f5b){_0xdb1c99=_0x517f5b;_0x4e0198=0xc8;}else{_0x4e0198=0xce;}_0x402f96['status'](_0x4e0198);return _0x402f96[_0x4d5a('0x31')]('Content-Range',_0x1eef60+'-'+_0xdb1c99+'/'+_0x517f5b)[_0x4d5a('0x2c')](_0x597bfa);}return null;};}function patchUpdates(_0x766744){return function(_0xd6ebc1){try{jsonpatch[_0x4d5a('0x32')](_0xd6ebc1,_0x766744,!![]);}catch(_0x3097e4){return BPromise['reject'](_0x3097e4);}return _0xd6ebc1['save']();};}function saveUpdates(_0x34fffd,_0x25555f){return function(_0x267482){if(_0x267482){return _0x267482['update'](_0x34fffd)[_0x4d5a('0x20')](function(_0xe55abb){return _0xe55abb;});}return null;};}function removeEntity(_0x316db4,_0x2660dc){return function(_0x136e5a){if(_0x136e5a){return _0x136e5a[_0x4d5a('0x33')]()[_0x4d5a('0x20')](function(){_0x316db4[_0x4d5a('0x2a')](0xcc)[_0x4d5a('0x2b')]();});}};}function handleEntityNotFound(_0x1a710a,_0x334083){return function(_0x2b2a38){if(!_0x2b2a38){_0x1a710a['sendStatus'](0x194);}return _0x2b2a38;};}function handleError(_0x3288a9,_0x1ba720){_0x1ba720=_0x1ba720||0x1f4;return function(_0xb2665c){logger[_0x4d5a('0x27')](_0xb2665c['stack']);if(_0xb2665c[_0x4d5a('0x34')]){delete _0xb2665c[_0x4d5a('0x34')];}_0x3288a9[_0x4d5a('0x2a')](_0x1ba720)[_0x4d5a('0x35')](_0xb2665c);};}exports['index']=function(_0x359caa,_0xf3d2dd){var _0x2a929d={},_0x1bb590={},_0x241423={'count':0x0,'rows':[]};var _0x5cb392=_[_0x4d5a('0x36')](db['ChatMessage'][_0x4d5a('0x37')],function(_0x44eb72){return{'name':_0x44eb72['fieldName'],'type':_0x44eb72[_0x4d5a('0x38')][_0x4d5a('0x39')]};});_0x1bb590['model']=_[_0x4d5a('0x36')](_0x5cb392,'name');_0x1bb590['query']=_[_0x4d5a('0x3a')](_0x359caa[_0x4d5a('0x3b')]);_0x1bb590[_0x4d5a('0x3c')]=_['intersection'](_0x1bb590['model'],_0x1bb590[_0x4d5a('0x3b')]);_0x2a929d['attributes']=_[_0x4d5a('0x3d')](_0x1bb590[_0x4d5a('0x3e')],qs[_0x4d5a('0x3f')](_0x359caa[_0x4d5a('0x3b')][_0x4d5a('0x3f')]));_0x2a929d['attributes']=_0x2a929d['attributes']['length']?_0x2a929d[_0x4d5a('0x40')]:_0x1bb590[_0x4d5a('0x3e')];if(!_0x359caa[_0x4d5a('0x3b')][_0x4d5a('0x41')]('nolimit')){_0x2a929d[_0x4d5a('0x2e')]=qs[_0x4d5a('0x2e')](_0x359caa['query'][_0x4d5a('0x2e')]);_0x2a929d[_0x4d5a('0x30')]=qs[_0x4d5a('0x30')](_0x359caa[_0x4d5a('0x3b')][_0x4d5a('0x30')]);}_0x2a929d['order']=qs['sort'](_0x359caa[_0x4d5a('0x3b')]['sort']);_0x2a929d[_0x4d5a('0x42')]=qs[_0x4d5a('0x3c')](_[_0x4d5a('0x43')](_0x359caa['query'],_0x1bb590[_0x4d5a('0x3c')]),_0x5cb392);if(_0x359caa[_0x4d5a('0x3b')][_0x4d5a('0x44')]){_0x2a929d[_0x4d5a('0x42')]=_['merge'](_0x2a929d[_0x4d5a('0x42')],{'$or':_['map'](_0x5cb392,function(_0x292b48){if(_0x292b48[_0x4d5a('0x38')]!==_0x4d5a('0x45')){var _0x4b3ec8={};_0x4b3ec8[_0x292b48[_0x4d5a('0x34')]]={'$like':'%'+_0x359caa[_0x4d5a('0x3b')][_0x4d5a('0x44')]+'%'};return _0x4b3ec8;}})});}_0x2a929d=_[_0x4d5a('0x46')]({},_0x2a929d,_0x359caa['options']);var _0x245e74={'where':_0x2a929d[_0x4d5a('0x42')]};return db[_0x4d5a('0x47')][_0x4d5a('0x2f')](_0x245e74)[_0x4d5a('0x20')](function(_0x1ec71f){_0x241423[_0x4d5a('0x2f')]=_0x1ec71f;if(_0x359caa['query'][_0x4d5a('0x48')]){_0x2a929d[_0x4d5a('0x49')]=[{'all':!![]}];}return db[_0x4d5a('0x47')][_0x4d5a('0x4a')](_0x2a929d);})[_0x4d5a('0x20')](function(_0x1cff4a){_0x241423[_0x4d5a('0x4b')]=_0x1cff4a;return _0x241423;})['then'](respondWithFilteredResult(_0xf3d2dd,_0x2a929d))[_0x4d5a('0x4c')](handleError(_0xf3d2dd,null));};exports[_0x4d5a('0x4d')]=function(_0x426227,_0x43ec6a){var _0x12d867={'raw':!![],'where':{'id':_0x426227[_0x4d5a('0x4e')]['id']}},_0x30c04b={};_0x30c04b[_0x4d5a('0x3e')]=_['keys'](db[_0x4d5a('0x47')][_0x4d5a('0x37')]);_0x30c04b[_0x4d5a('0x3b')]=_['keys'](_0x426227[_0x4d5a('0x3b')]);_0x30c04b[_0x4d5a('0x3c')]=_['intersection'](_0x30c04b[_0x4d5a('0x3e')],_0x30c04b[_0x4d5a('0x3b')]);_0x12d867[_0x4d5a('0x40')]=_[_0x4d5a('0x3d')](_0x30c04b['model'],qs[_0x4d5a('0x3f')](_0x426227[_0x4d5a('0x3b')]['fields']));_0x12d867[_0x4d5a('0x40')]=_0x12d867[_0x4d5a('0x40')][_0x4d5a('0x4f')]?_0x12d867[_0x4d5a('0x40')]:_0x30c04b[_0x4d5a('0x3e')];if(_0x426227['query'][_0x4d5a('0x48')]){_0x12d867[_0x4d5a('0x49')]=[{'all':!![]}];}_0x12d867=_['merge']({},_0x12d867,_0x426227[_0x4d5a('0x50')]);return db[_0x4d5a('0x47')][_0x4d5a('0x51')](_0x12d867)[_0x4d5a('0x20')](handleEntityNotFound(_0x43ec6a,null))[_0x4d5a('0x20')](respondWithResult(_0x43ec6a,null))[_0x4d5a('0x4c')](handleError(_0x43ec6a,null));};exports[_0x4d5a('0x52')]=function(_0x1fd6c1,_0x29d027){return db[_0x4d5a('0x47')]['create'](_0x1fd6c1[_0x4d5a('0x53')],{})[_0x4d5a('0x20')](respondWithResult(_0x29d027,0xc9))[_0x4d5a('0x4c')](handleError(_0x29d027,null));};exports['update']=function(_0xeaf250,_0xb0e5a8){if(_0xeaf250['body']['id']){delete _0xeaf250[_0x4d5a('0x53')]['id'];}return db[_0x4d5a('0x47')]['find']({'where':{'id':_0xeaf250[_0x4d5a('0x4e')]['id']}})['then'](handleEntityNotFound(_0xb0e5a8,null))[_0x4d5a('0x20')](saveUpdates(_0xeaf250[_0x4d5a('0x53')],null))[_0x4d5a('0x20')](respondWithResult(_0xb0e5a8,null))[_0x4d5a('0x4c')](handleError(_0xb0e5a8,null));};exports[_0x4d5a('0x33')]=function(_0x1e2dcf,_0x468def){return db[_0x4d5a('0x47')][_0x4d5a('0x51')]({'where':{'id':_0x1e2dcf[_0x4d5a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x468def,null))[_0x4d5a('0x20')](removeEntity(_0x468def,null))[_0x4d5a('0x4c')](handleError(_0x468def,null));};exports[_0x4d5a('0x54')]=function(_0x591a1f,_0x5ab8e7){return db[_0x4d5a('0x47')][_0x4d5a('0x54')]()[_0x4d5a('0x20')](respondWithResult(_0x5ab8e7,null))['catch'](handleError(_0x5ab8e7,null));};var interaction_log=require(_0x4d5a('0x12'))(_0x4d5a('0x55'));exports[_0x4d5a('0x56')]=function(_0x2a58c2,_0x3a02e5,_0x208825){var _0x57ce94={'agent':{},'channel':_0x4d5a('0x57')};if(_0x2a58c2[_0x4d5a('0x53')]['id']){delete _0x2a58c2[_0x4d5a('0x53')]['id'];}_0x2a58c2['body'][_0x4d5a('0x58')]=!![];_0x2a58c2['body']['readAt']=moment()[_0x4d5a('0x59')](_0x4d5a('0x5a'));_0x2a58c2[_0x4d5a('0x53')][_0x4d5a('0x5b')]=_0x2a58c2[_0x4d5a('0x53')][_0x4d5a('0x5b')]||_0x2a58c2[_0x4d5a('0x5c')]['id'];_0x57ce94[_0x4d5a('0x5d')]['id']=_0x2a58c2[_0x4d5a('0x53')]['UserId'];return db[_0x4d5a('0x47')]['find']({'where':{'id':_0x2a58c2['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3a02e5,null))[_0x4d5a('0x20')](saveUpdates(_0x2a58c2[_0x4d5a('0x53')],null))[_0x4d5a('0x20')](function(_0x1d69b2){if(_0x1d69b2){_0x57ce94[_0x4d5a('0x29')]=_0x1d69b2[_0x4d5a('0x5e')]({'plain':!![]});return db[_0x4d5a('0x5f')][_0x4d5a('0x51')]({'where':{'id':_0x1d69b2[_0x4d5a('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x3a02e5,null))[_0x4d5a('0x20')](function(_0x91706f){if(_0x91706f){return _0x91706f[_0x4d5a('0x61')]({'UserId':_0x2a58c2[_0x4d5a('0x53')]['UserId'],'read1stAt':_[_0x4d5a('0x62')](_0x91706f[_0x4d5a('0x63')])?moment()['format'](_0x4d5a('0x5a')):undefined});}return null;})[_0x4d5a('0x20')](function(_0x4cade1){if(_0x4cade1){_0x57ce94[_0x4d5a('0x64')]=_0x4cade1[_0x4d5a('0x5e')]({'plain':!![]});interaction_log[_0x4d5a('0x21')](_0x4d5a('0x65'),_0x2a58c2[_0x4d5a('0x5c')]['id'],_0x2a58c2['user'][_0x4d5a('0x34')],_0x2a58c2[_0x4d5a('0x5c')][_0x4d5a('0x66')],_0x57ce94['interaction']['id'],_0x2a58c2[_0x4d5a('0x53')]?JSON['stringify'](_0x2a58c2[_0x4d5a('0x53')]):_0x4d5a('0x67'));return respondWithRpcPromise('AcceptMessage',_0x4d5a('0x68'),_0x57ce94);}return null;})[_0x4d5a('0x20')](function(_0x5321f8){var _0x2b598c=_0x4d5a('0x69')+_0x5321f8[_0x4d5a('0x29')][_0x4d5a('0x6a')];return db[_0x4d5a('0x6b')][_0x4d5a('0x3b')](_0x2b598c,{'type':db[_0x4d5a('0x6c')][_0x4d5a('0x6d')][_0x4d5a('0x6e')],'raw':!![]})[_0x4d5a('0x20')](function(_0x5154d8){return _0x5154d8;});})[_0x4d5a('0x20')](function(_0x2bc246){if(_0x2bc246){_0x57ce94[_0x4d5a('0x29')][_0x4d5a('0x6f')]=_0x2bc246[0x0];if(!_0x2a58c2['body'][_0x4d5a('0x5b')])return;return db[_0x4d5a('0x70')][_0x4d5a('0x51')]({'where':{'id':_0x2a58c2[_0x4d5a('0x53')][_0x4d5a('0x5b')],'role':'agent'},'attributes':['id',_0x4d5a('0x34'),_0x4d5a('0x71'),_0x4d5a('0x72'),_0x4d5a('0x73')],'raw':!![]});}return null;})[_0x4d5a('0x20')](function(_0x35fa95){if(!_0x35fa95)return null;_0x57ce94[_0x4d5a('0x29')][_0x4d5a('0x5d')]=_0x35fa95;return _0x57ce94;})[_0x4d5a('0x20')](function(_0x20b574){if(_0x20b574){if(_0x2a58c2[_0x4d5a('0x53')][_0x4d5a('0x74')]){_0x57ce94['message'][_0x4d5a('0x75')]=util[_0x4d5a('0x59')]('SIP/%s',_0x2a58c2['user'][_0x4d5a('0x34')]);_0x57ce94[_0x4d5a('0x29')][_0x4d5a('0x76')]=_0x57ce94[_0x4d5a('0x76')];_0x57ce94[_0x4d5a('0x29')][_0x4d5a('0x77')]=_0x57ce94[_0x4d5a('0x76')];_0x57ce94['message'][_0x4d5a('0x78')]=_0x4d5a('0x56');return respondWithRpcPromise(_0x4d5a('0x79'),_0x4d5a('0x79'),{'event':_0x4d5a('0x7a'),'message':_['merge'](_0x57ce94['message'],JSON[_0x4d5a('0x7b')](_0x57ce94[_0x4d5a('0x64')][_0x4d5a('0x7c')]))},client9002)[_0x4d5a('0x20')](function(){return _0x57ce94;});}return _0x57ce94;}return null;})[_0x4d5a('0x20')](respondWithResult(_0x3a02e5,null))[_0x4d5a('0x4c')](handleError(_0x3a02e5,null));};var interaction_log=require(_0x4d5a('0x12'))(_0x4d5a('0x55'));exports[_0x4d5a('0x7d')]=function(_0x11ed07,_0x5abec1,_0x3e8add){var _0x1a2c3b={'agent':{},'channel':_0x4d5a('0x57')};if(_0x11ed07[_0x4d5a('0x53')]['id']){delete _0x11ed07[_0x4d5a('0x53')]['id'];}_0x11ed07['body']['UserId']=_0x11ed07[_0x4d5a('0x53')][_0x4d5a('0x5b')]||_0x11ed07[_0x4d5a('0x5c')]['id'];_0x1a2c3b[_0x4d5a('0x5d')]['id']=_0x11ed07[_0x4d5a('0x53')][_0x4d5a('0x5b')];return db[_0x4d5a('0x47')][_0x4d5a('0x51')]({'where':{'id':_0x11ed07[_0x4d5a('0x4e')]['id'],'UserId':null}})[_0x4d5a('0x20')](handleEntityNotFound(_0x5abec1,null))[_0x4d5a('0x20')](function(_0xd0183b){if(_0xd0183b){_0x1a2c3b[_0x4d5a('0x29')]=_0xd0183b[_0x4d5a('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x4d5a('0x51')]({'where':{'id':_0xd0183b[_0x4d5a('0x60')]}});}return null;})[_0x4d5a('0x20')](handleEntityNotFound(_0x5abec1,null))['then'](function(_0x13fbc5){if(_0x13fbc5){_0x1a2c3b['interaction']=_0x13fbc5['get']({'plain':!![]});interaction_log[_0x4d5a('0x21')](_0x4d5a('0x7e'),_0x11ed07[_0x4d5a('0x5c')]['id'],_0x11ed07[_0x4d5a('0x5c')]['name'],_0x11ed07['user']['role'],_0x1a2c3b[_0x4d5a('0x64')]['id'],_0x11ed07[_0x4d5a('0x53')]?JSON[_0x4d5a('0x26')](_0x11ed07[_0x4d5a('0x53')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x1a2c3b);}return null;})['then'](function(_0x2a9d6a){var _0x222820='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2a9d6a[_0x4d5a('0x29')][_0x4d5a('0x6a')];return db[_0x4d5a('0x6b')][_0x4d5a('0x3b')](_0x222820,{'type':db[_0x4d5a('0x6c')][_0x4d5a('0x6d')][_0x4d5a('0x6e')],'raw':!![]})[_0x4d5a('0x20')](function(_0x42040e){return _0x42040e;});})[_0x4d5a('0x20')](function(_0xf50bac){if(_0xf50bac){_0x1a2c3b[_0x4d5a('0x29')]['contact']=_0xf50bac[0x0];if(!_0x11ed07[_0x4d5a('0x53')][_0x4d5a('0x5b')])return;return db['User'][_0x4d5a('0x51')]({'where':{'id':_0x11ed07['body'][_0x4d5a('0x5b')],'role':_0x4d5a('0x5d')},'attributes':['id',_0x4d5a('0x34'),'fullname',_0x4d5a('0x72'),_0x4d5a('0x73')],'raw':!![]});}return null;})[_0x4d5a('0x20')](function(_0x3fbfc5){if(!_0x3fbfc5)return null;_0x1a2c3b['message'][_0x4d5a('0x5d')]=_0x3fbfc5;return _0x1a2c3b;})[_0x4d5a('0x20')](function(_0x1c2bab){if(_0x1c2bab){_0x1c2bab[_0x4d5a('0x29')]['interface']=util[_0x4d5a('0x59')](_0x4d5a('0x7f'),_0x11ed07[_0x4d5a('0x5c')]['name']);_0x1c2bab['message']['channel']=_0x1a2c3b[_0x4d5a('0x76')];_0x1c2bab['message'][_0x4d5a('0x77')]=_0x1a2c3b[_0x4d5a('0x76')];_0x1c2bab[_0x4d5a('0x29')][_0x4d5a('0x78')]=_0x4d5a('0x7d');respondWithRpcPromise('EventManager',_0x4d5a('0x79'),{'event':_0x4d5a('0x80'),'message':_[_0x4d5a('0x46')](_0x1a2c3b[_0x4d5a('0x29')],JSON['parse'](_0x1a2c3b[_0x4d5a('0x64')][_0x4d5a('0x7c')]))},client9002);return _0x1a2c3b;}return null;})[_0x4d5a('0x20')](respondWithResult(_0x5abec1,null))[_0x4d5a('0x4c')](handleError(_0x5abec1,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index ad075b5..464ebb8 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 _0x1386=['events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','hook'];(function(_0x4233f5,_0x23e9dd){var _0x45966c=function(_0x5024c4){while(--_0x5024c4){_0x4233f5['push'](_0x4233f5['shift']());}};_0x45966c(++_0x23e9dd);}(_0x1386,0x170));var _0x6138=function(_0x18145c,_0x23c102){_0x18145c=_0x18145c-0x0;var _0x52dd35=_0x1386[_0x18145c];return _0x52dd35;};'use strict';var EventEmitter=require(_0x6138('0x0'));var ChatMessage=require(_0x6138('0x1'))['db'][_0x6138('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6138('0x3')](0x0);var events={'afterCreate':_0x6138('0x4'),'afterUpdate':_0x6138('0x5'),'afterDestroy':_0x6138('0x6')};function emitEvent(_0x395a9f){return function(_0x5d7d96,_0x522b8d,_0x17a78b){ChatMessageEvents['emit'](_0x395a9f+':'+_0x5d7d96['id'],_0x5d7d96);ChatMessageEvents['emit'](_0x395a9f,_0x5d7d96);_0x17a78b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x6138('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0xadd3=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','remove'];(function(_0x4b9fcd,_0x10fc42){var _0x3f83cd=function(_0x539400){while(--_0x539400){_0x4b9fcd['push'](_0x4b9fcd['shift']());}};_0x3f83cd(++_0x10fc42);}(_0xadd3,0xc2));var _0x3add=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xadd3[_0x5f3f88];return _0xd08119;};'use strict';var EventEmitter=require(_0x3add('0x0'));var ChatMessage=require(_0x3add('0x1'))['db'][_0x3add('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3add('0x3')](0x0);var events={'afterCreate':_0x3add('0x4'),'afterUpdate':'update','afterDestroy':_0x3add('0x5')};function emitEvent(_0x59666e){return function(_0x24cd62,_0x3ab179,_0x386081){ChatMessageEvents[_0x3add('0x6')](_0x59666e+':'+_0x24cd62['id'],_0x24cd62);ChatMessageEvents[_0x3add('0x6')](_0x59666e,_0x24cd62);_0x386081(null);};}for(var e in events){if(events[_0x3add('0x7')](e)){var event=events[e];ChatMessage[_0x3add('0x8')](e,emitEvent(event));}}module[_0x3add('0x9')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 025d77b..a69880b 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 _0xfe11=['direction','toLowerCase','out','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','define','ChatMessage','chat_messages','body','FULLTEXT','models','get'];(function(_0x45c398,_0x3bed1d){var _0x54ab01=function(_0x3eb807){while(--_0x3eb807){_0x45c398['push'](_0x45c398['shift']());}};_0x54ab01(++_0x3bed1d);}(_0xfe11,0x94));var _0x1fe1=function(_0x531613,_0x24832c){_0x531613=_0x531613-0x0;var _0x3aadd2=_0xfe11[_0x531613];return _0x3aadd2;};'use strict';var _=require(_0x1fe1('0x0'));var util=require(_0x1fe1('0x1'));var logger=require(_0x1fe1('0x2'))(_0x1fe1('0x3'));var moment=require(_0x1fe1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fe1('0x5'));var rimraf=require(_0x1fe1('0x6'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module['exports']=function(_0x53145e,_0x16e421){return _0x53145e[_0x1fe1('0x7')](_0x1fe1('0x8'),attributes,{'tableName':_0x1fe1('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x1fe1('0xa')],'type':_0x1fe1('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xfdb9e0,_0x3a1784,_0x14b4a4){var _0x260e96=_0x53145e[_0x1fe1('0xc')];var _0x5e2a94=_0xfdb9e0[_0x1fe1('0xd')]({'plain':!![]});if(_0x5e2a94[_0x1fe1('0xe')]['toLowerCase']()==='in'||_0x5e2a94[_0x1fe1('0xe')][_0x1fe1('0xf')]()===_0x1fe1('0x10')&&!_0x5e2a94['secret']&&!_['isNil'](_0x5e2a94[_0x1fe1('0x11')])){_0x260e96[_0x1fe1('0x12')][_0x1fe1('0x13')]({'where':{'id':_0x5e2a94[_0x1fe1('0x14')]}})[_0x1fe1('0x15')](function(_0x4320e0){if(_0x4320e0){_0x4320e0[_0x1fe1('0x16')]({'lastMsgAt':_0x5e2a94[_0x1fe1('0x17')],'lastMsgDirection':_0x5e2a94[_0x1fe1('0xe')][_0x1fe1('0xf')]()});}})[_0x1fe1('0x18')](function(_0x405e77){console['error'](_0x405e77);});}_0x14b4a4();}},'charset':_0x1fe1('0x19'),'collate':_0x1fe1('0x1a')});}; \ No newline at end of file +var _0xca0f=['chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','./chatMessage.attributes','exports','define','ChatMessage'];(function(_0x11d61c,_0xc601d4){var _0x5ccbfa=function(_0x49ec4a){while(--_0x49ec4a){_0x11d61c['push'](_0x11d61c['shift']());}};_0x5ccbfa(++_0xc601d4);}(_0xca0f,0x90));var _0xfca0=function(_0x57bd7c,_0x40aa96){_0x57bd7c=_0x57bd7c-0x0;var _0xe558a=_0xca0f[_0x57bd7c];return _0xe558a;};'use strict';var _=require(_0xfca0('0x0'));var util=require(_0xfca0('0x1'));var logger=require(_0xfca0('0x2'))(_0xfca0('0x3'));var moment=require(_0xfca0('0x4'));var BPromise=require('bluebird');var rp=require(_0xfca0('0x5'));var fs=require('fs');var path=require(_0xfca0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfca0('0x7'));module[_0xfca0('0x8')]=function(_0x289dc2,_0x151284){return _0x289dc2[_0xfca0('0x9')](_0xfca0('0xa'),attributes,{'tableName':_0xfca0('0xb'),'paranoid':![],'indexes':[{'name':_0xfca0('0xc'),'fields':[_0xfca0('0xd')],'type':_0xfca0('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5c5430,_0x55c3fe,_0x269991){var _0x487e7f=_0x289dc2['models'];var _0x58aa2f=_0x5c5430[_0xfca0('0xf')]({'plain':!![]});if(_0x58aa2f[_0xfca0('0x10')][_0xfca0('0x11')]()==='in'||_0x58aa2f[_0xfca0('0x10')][_0xfca0('0x11')]()===_0xfca0('0x12')&&!_0x58aa2f[_0xfca0('0x13')]&&!_[_0xfca0('0x14')](_0x58aa2f[_0xfca0('0x15')])){_0x487e7f[_0xfca0('0x16')][_0xfca0('0x17')]({'where':{'id':_0x58aa2f[_0xfca0('0x18')]}})[_0xfca0('0x19')](function(_0x478e56){if(_0x478e56){_0x478e56[_0xfca0('0x1a')]({'lastMsgAt':_0x58aa2f[_0xfca0('0x1b')],'lastMsgDirection':_0x58aa2f['direction'][_0xfca0('0x11')]()});}})[_0xfca0('0x1c')](function(_0x3c9924){console['error'](_0x3c9924);});}_0x269991();}},'charset':_0xfca0('0x1d'),'collate':_0xfca0('0x1e')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index b3c4ce9..c91b568 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 _0xe4b0=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateChatMessage','create','body','options','raw','debug','catch','lodash','util'];(function(_0x137173,_0x38df2a){var _0x242689=function(_0x119101){while(--_0x119101){_0x137173['push'](_0x137173['shift']());}};_0x242689(++_0x38df2a);}(_0xe4b0,0x9e));var _0x0e4b=function(_0x202753,_0x209b89){_0x202753=_0x202753-0x0;var _0x2c4038=_0xe4b0[_0x202753];return _0x2c4038;};'use strict';var _=require(_0x0e4b('0x0'));var util=require(_0x0e4b('0x1'));var moment=require(_0x0e4b('0x2'));var BPromise=require(_0x0e4b('0x3'));var rs=require(_0x0e4b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0e4b('0x5'));var logger=require(_0x0e4b('0x6'))(_0x0e4b('0x7'));var config=require('../../config/environment');var jayson=require(_0x0e4b('0x8'));var client=jayson[_0x0e4b('0x9')][_0x0e4b('0xa')]({'port':0x232a});config[_0x0e4b('0xb')]=_['defaults'](config[_0x0e4b('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0e4b('0xc'))(new Redis(config['redis']));require(_0x0e4b('0xd'))[_0x0e4b('0xe')](socket);function respondWithRpcPromise(_0x5c0846,_0x5a67d9,_0x2619ed){return new BPromise(function(_0x2bd148,_0x535fc3){return client['request'](_0x5c0846,_0x2619ed)[_0x0e4b('0xf')](function(_0x39bb2b){logger[_0x0e4b('0x10')](_0x0e4b('0x11'),_0x5a67d9,'request\x20sent');logger['debug'](_0x0e4b('0x12'),_0x5a67d9,_0x0e4b('0x13'),JSON[_0x0e4b('0x14')](_0x39bb2b));if(_0x39bb2b['error']){if(_0x39bb2b[_0x0e4b('0x15')][_0x0e4b('0x16')]===0x1f4){logger[_0x0e4b('0x15')]('ChatMessage,\x20%s,\x20%s',_0x5a67d9,_0x39bb2b['error'][_0x0e4b('0x17')]);return _0x535fc3(_0x39bb2b[_0x0e4b('0x15')][_0x0e4b('0x17')]);}logger[_0x0e4b('0x15')](_0x0e4b('0x11'),_0x5a67d9,_0x39bb2b[_0x0e4b('0x15')][_0x0e4b('0x17')]);return _0x2bd148(_0x39bb2b[_0x0e4b('0x15')][_0x0e4b('0x17')]);}else{logger[_0x0e4b('0x10')](_0x0e4b('0x11'),_0x5a67d9,'request\x20sent');_0x2bd148(_0x39bb2b[_0x0e4b('0x18')][_0x0e4b('0x17')]);}})['catch'](function(_0x3817bc){logger[_0x0e4b('0x15')](_0x0e4b('0x11'),_0x5a67d9,_0x3817bc);_0x535fc3(_0x3817bc);});});}exports[_0x0e4b('0x19')]=function(_0x2ed880){var _0x1a94eb=this;return new Promise(function(_0x3cbdae,_0x2837ee){return db['ChatMessage'][_0x0e4b('0x1a')](_0x2ed880[_0x0e4b('0x1b')],{'raw':_0x2ed880[_0x0e4b('0x1c')]?_0x2ed880[_0x0e4b('0x1c')][_0x0e4b('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x551044){logger[_0x0e4b('0x10')]('CreateChatMessage',_0x2ed880);logger[_0x0e4b('0x1e')](_0x0e4b('0x19'),_0x2ed880,JSON['stringify'](_0x551044));_0x3cbdae(_0x551044);})[_0x0e4b('0x1f')](function(_0x4212b5){logger[_0x0e4b('0x15')](_0x0e4b('0x19'),_0x4212b5[_0x0e4b('0x17')],_0x2ed880);_0x2837ee(_0x1a94eb[_0x0e4b('0x15')](0x1f4,_0x4212b5['message']));});});}; \ No newline at end of file +var _0x2c27=['register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ChatMessage','create','body','options','raw','CreateChatMessage','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatMessage.socket'];(function(_0x58bb16,_0x5d2f3f){var _0x3e83ef=function(_0x275787){while(--_0x275787){_0x58bb16['push'](_0x58bb16['shift']());}};_0x3e83ef(++_0x5d2f3f);}(_0x2c27,0x9f));var _0x72c2=function(_0x134717,_0x5b6841){_0x134717=_0x134717-0x0;var _0x321b06=_0x2c27[_0x134717];return _0x321b06;};'use strict';var _=require(_0x72c2('0x0'));var util=require(_0x72c2('0x1'));var moment=require(_0x72c2('0x2'));var BPromise=require('bluebird');var rs=require(_0x72c2('0x3'));var fs=require('fs');var Redis=require(_0x72c2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x72c2('0x5'));var logger=require(_0x72c2('0x6'))(_0x72c2('0x7'));var config=require(_0x72c2('0x8'));var jayson=require(_0x72c2('0x9'));var client=jayson[_0x72c2('0xa')][_0x72c2('0xb')]({'port':0x232a});config['redis']=_[_0x72c2('0xc')](config[_0x72c2('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x72c2('0xe'))(new Redis(config[_0x72c2('0xd')]));require(_0x72c2('0xf'))[_0x72c2('0x10')](socket);function respondWithRpcPromise(_0x623278,_0xc263bb,_0x599db9){return new BPromise(function(_0xcf25c5,_0x1296f5){return client[_0x72c2('0x11')](_0x623278,_0x599db9)[_0x72c2('0x12')](function(_0xb36679){logger[_0x72c2('0x13')](_0x72c2('0x14'),_0xc263bb,'request\x20sent');logger[_0x72c2('0x15')](_0x72c2('0x16'),_0xc263bb,_0x72c2('0x17'),JSON[_0x72c2('0x18')](_0xb36679));if(_0xb36679[_0x72c2('0x19')]){if(_0xb36679[_0x72c2('0x19')]['code']===0x1f4){logger[_0x72c2('0x19')]('ChatMessage,\x20%s,\x20%s',_0xc263bb,_0xb36679[_0x72c2('0x19')][_0x72c2('0x1a')]);return _0x1296f5(_0xb36679[_0x72c2('0x19')]['message']);}logger[_0x72c2('0x19')](_0x72c2('0x14'),_0xc263bb,_0xb36679[_0x72c2('0x19')]['message']);return _0xcf25c5(_0xb36679[_0x72c2('0x19')][_0x72c2('0x1a')]);}else{logger[_0x72c2('0x13')]('ChatMessage,\x20%s,\x20%s',_0xc263bb,_0x72c2('0x17'));_0xcf25c5(_0xb36679[_0x72c2('0x1b')][_0x72c2('0x1a')]);}})[_0x72c2('0x1c')](function(_0x283956){logger[_0x72c2('0x19')]('ChatMessage,\x20%s,\x20%s',_0xc263bb,_0x283956);_0x1296f5(_0x283956);});});}exports['CreateChatMessage']=function(_0x56bfbf){var _0x5148f9=this;return new Promise(function(_0x5ffd18,_0x5509d9){return db[_0x72c2('0x1d')][_0x72c2('0x1e')](_0x56bfbf[_0x72c2('0x1f')],{'raw':_0x56bfbf[_0x72c2('0x20')]?_0x56bfbf[_0x72c2('0x20')][_0x72c2('0x21')]===undefined?!![]:![]:!![]})[_0x72c2('0x12')](function(_0x5254f7){logger[_0x72c2('0x13')](_0x72c2('0x22'),_0x56bfbf);logger[_0x72c2('0x15')]('CreateChatMessage',_0x56bfbf,JSON[_0x72c2('0x18')](_0x5254f7));_0x5ffd18(_0x5254f7);})['catch'](function(_0x1ce66c){logger[_0x72c2('0x19')](_0x72c2('0x22'),_0x1ce66c['message'],_0x56bfbf);_0x5509d9(_0x5148f9[_0x72c2('0x19')](0x1f4,_0x1ce66c['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index b6e3441..8668f65 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 _0x9879=['remove','emit','removeListener','register','chatMessage:','./chatMessage.events','save'];(function(_0x5e8282,_0x1f2962){var _0x5cd37d=function(_0x208ec7){while(--_0x208ec7){_0x5e8282['push'](_0x5e8282['shift']());}};_0x5cd37d(++_0x1f2962);}(_0x9879,0x98));var _0x9987=function(_0x3290a8,_0x37178b){_0x3290a8=_0x3290a8-0x0;var _0x6d3825=_0x9879[_0x3290a8];return _0x6d3825;};'use strict';var ChatMessageEvents=require(_0x9987('0x0'));var events=[_0x9987('0x1'),_0x9987('0x2'),'update'];function createListener(_0xadce9d,_0x525218){return function(_0x3a2473){_0x525218[_0x9987('0x3')](_0xadce9d,_0x3a2473);};}function removeListener(_0x1fd45d,_0xcc5722){return function(){ChatMessageEvents[_0x9987('0x4')](_0x1fd45d,_0xcc5722);};}exports[_0x9987('0x5')]=function(_0x4258df){for(var _0x4d479d=0x0,_0x34d2fd=events['length'];_0x4d479d<_0x34d2fd;_0x4d479d++){var _0x6cb988=events[_0x4d479d];var _0x3e5538=createListener(_0x9987('0x6')+_0x6cb988,_0x4258df);ChatMessageEvents['on'](_0x6cb988,_0x3e5538);}}; \ No newline at end of file +var _0x8ad5=['remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x8ad5,0xf1));var _0x58ad=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x8ad5[_0x3b380d];return _0x54502b;};'use strict';var ChatMessageEvents=require(_0x58ad('0x0'));var events=[_0x58ad('0x1'),_0x58ad('0x2'),_0x58ad('0x3')];function createListener(_0x4cfe26,_0x5dca8a){return function(_0x1e5eb9){_0x5dca8a[_0x58ad('0x4')](_0x4cfe26,_0x1e5eb9);};}function removeListener(_0x223e54,_0x22aba9){return function(){ChatMessageEvents[_0x58ad('0x5')](_0x223e54,_0x22aba9);};}exports[_0x58ad('0x6')]=function(_0x51d560){for(var _0x5888f7=0x0,_0x394972=events[_0x58ad('0x7')];_0x5888f7<_0x394972;_0x5888f7++){var _0x220c5f=events[_0x5888f7];var _0x2033a3=createListener(_0x58ad('0x8')+_0x220c5f,_0x51d560);ChatMessageEvents['on'](_0x220c5f,_0x2033a3);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 52beee6..22994f6 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 _0x6a1e=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','accept','/:id/reject','reject','destroy'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x6a1e,0x6d));var _0xe6a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a1e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe6a1('0x0'));var util=require(_0xe6a1('0x1'));var path=require(_0xe6a1('0x2'));var timeout=require(_0xe6a1('0x3'));var express=require(_0xe6a1('0x4'));var router=express[_0xe6a1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe6a1('0x6'));var interaction=require(_0xe6a1('0x7'));var config=require('../../config/environment');var controller=require(_0xe6a1('0x8'));router[_0xe6a1('0x9')]('/',auth[_0xe6a1('0xa')](),controller[_0xe6a1('0xb')]);router[_0xe6a1('0x9')](_0xe6a1('0xc'),auth[_0xe6a1('0xa')](),controller['describe']);router[_0xe6a1('0x9')](_0xe6a1('0xd'),auth[_0xe6a1('0xa')](),controller[_0xe6a1('0xe')]);router[_0xe6a1('0xf')]('/',auth[_0xe6a1('0xa')](),interaction[_0xe6a1('0x10')](_0xe6a1('0x11'),_0xe6a1('0x12')),controller[_0xe6a1('0x13')]);router[_0xe6a1('0x14')](_0xe6a1('0xd'),controller[_0xe6a1('0x15')]);router[_0xe6a1('0x14')]('/:id/accept',auth['isAuthenticated'](),controller[_0xe6a1('0x16')]);router[_0xe6a1('0x14')](_0xe6a1('0x17'),auth['isAuthenticated'](),controller[_0xe6a1('0x18')]);router['delete'](_0xe6a1('0xd'),auth[_0xe6a1('0xa')](),controller[_0xe6a1('0x19')]);module[_0xe6a1('0x1a')]=router; \ No newline at end of file +var _0x39e1=['../../components/auth/service','../../config/environment','get','isAuthenticated','describe','chat','chatmessage:create','create','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','destroy','util','connect-timeout','express','Router','fs-extra'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x39e1,0x14b));var _0x139e=function(_0x421273,_0x190dc3){_0x421273=_0x421273-0x0;var _0x564b90=_0x39e1[_0x421273];return _0x564b90;};'use strict';var multer=require('multer');var util=require(_0x139e('0x0'));var path=require('path');var timeout=require(_0x139e('0x1'));var express=require(_0x139e('0x2'));var router=express[_0x139e('0x3')]();var fs_extra=require(_0x139e('0x4'));var auth=require(_0x139e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x139e('0x6'));var controller=require('./chatMessage.controller');router[_0x139e('0x7')]('/',auth[_0x139e('0x8')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x139e('0x9')]);router['get']('/:id',auth[_0x139e('0x8')](),controller['show']);router['post']('/',auth[_0x139e('0x8')](),interaction['tracked'](_0x139e('0xa'),_0x139e('0xb')),controller[_0x139e('0xc')]);router[_0x139e('0xd')](_0x139e('0xe'),controller['update']);router['put'](_0x139e('0xf'),auth[_0x139e('0x8')](),controller[_0x139e('0x10')]);router[_0x139e('0xd')](_0x139e('0x11'),auth[_0x139e('0x8')](),controller[_0x139e('0x12')]);router[_0x139e('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x139e('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 4e609bb..3039d67 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 _0xb10b=['medium','sequelize','TEXT'];(function(_0x458cea,_0x5ec209){var _0x2d11ae=function(_0x1f20a1){while(--_0x1f20a1){_0x458cea['push'](_0x458cea['shift']());}};_0x2d11ae(++_0x5ec209);}(_0xb10b,0x12a));var _0xbb10=function(_0x33199e,_0x428ded){_0x33199e=_0x33199e-0x0;var _0x2eef3c=_0xb10b[_0x33199e];return _0x2eef3c;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x5f66=['medium','TEXT','exports'];(function(_0x36fd49,_0xea7b34){var _0x446d04=function(_0x576c89){while(--_0x576c89){_0x36fd49['push'](_0x36fd49['shift']());}};_0x446d04(++_0xea7b34);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index a567d4e..f98bf65 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(_0x2210af,_0x47d68a){var _0x190bb4=function(_0x1d8bc9){while(--_0x1d8bc9){_0x2210af['push'](_0x2210af['shift']());}};_0x190bb4(++_0x47d68a);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x7a54,0x106));var _0x47a5=function(_0x4f08dd,_0x33b6ec){_0x4f08dd=_0x4f08dd-0x0;var _0x6dd3d7=_0x7a54[_0x4f08dd];return _0x6dd3d7;};'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 a3efda4..7f497bf 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 _0xd1f3=['emit','hasOwnProperty','hook','exports','events','ChatOfflineMessage','save','update','remove'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xd1f3,0x16c));var _0x3d1f=function(_0x2af90c,_0x14fdac){_0x2af90c=_0x2af90c-0x0;var _0x1b493c=_0xd1f3[_0x2af90c];return _0x1b493c;};'use strict';var EventEmitter=require(_0x3d1f('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x3d1f('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3d1f('0x2'),'afterUpdate':_0x3d1f('0x3'),'afterDestroy':_0x3d1f('0x4')};function emitEvent(_0x54ef8e){return function(_0x5cbc7f,_0x24345f,_0x16cb2d){ChatOfflineMessageEvents[_0x3d1f('0x5')](_0x54ef8e+':'+_0x5cbc7f['id'],_0x5cbc7f);ChatOfflineMessageEvents[_0x3d1f('0x5')](_0x54ef8e,_0x5cbc7f);_0x16cb2d(null);};}for(var e in events){if(events[_0x3d1f('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x3d1f('0x7')](e,emitEvent(event));}}module[_0x3d1f('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x8efc=['hasOwnProperty','hook','exports','ChatOfflineMessage','save','remove','emit'];(function(_0x4f0ed9,_0x319274){var _0x58143d=function(_0x4cb6be){while(--_0x4cb6be){_0x4f0ed9['push'](_0x4f0ed9['shift']());}};_0x58143d(++_0x319274);}(_0x8efc,0x8f));var _0xc8ef=function(_0xd27ded,_0x1164e2){_0xd27ded=_0xd27ded-0x0;var _0x5ef850=_0x8efc[_0xd27ded];return _0x5ef850;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require('../../mysqldb')['db'][_0xc8ef('0x0')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc8ef('0x1'),'afterUpdate':'update','afterDestroy':_0xc8ef('0x2')};function emitEvent(_0xb39bee){return function(_0x4dbf24,_0x4ee0cc,_0x13b577){ChatOfflineMessageEvents['emit'](_0xb39bee+':'+_0x4dbf24['id'],_0x4dbf24);ChatOfflineMessageEvents[_0xc8ef('0x3')](_0xb39bee,_0x4dbf24);_0x13b577(null);};}for(var e in events){if(events[_0xc8ef('0x4')](e)){var event=events[e];ChatOfflineMessage[_0xc8ef('0x5')](e,emitEvent(event));}}module[_0xc8ef('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 53bc106..ade3620 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 _0x699d=['exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x215b17,_0x4de070){var _0x1dbe04=function(_0x47311e){while(--_0x47311e){_0x215b17['push'](_0x215b17['shift']());}};_0x1dbe04(++_0x4de070);}(_0x699d,0x1cd));var _0xd699=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x699d[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0xd699('0x0'));module[_0xd699('0x1')]=function(_0x1521f6){return _0x1521f6['define'](_0xd699('0x2'),attributes,{'tableName':_0xd699('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd699('0x4'),'collate':_0xd699('0x5')});}; \ No newline at end of file +var _0xdd87=['chat_offline_messages','utf8mb4','./chatOfflineMessage.attributes','exports','define'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xdd87,0xfc));var _0x7dd8=function(_0x3e9de5,_0x103a03){_0x3e9de5=_0x3e9de5-0x0;var _0x30f865=_0xdd87[_0x3e9de5];return _0x30f865;};'use strict';var attributes=require(_0x7dd8('0x0'));module[_0x7dd8('0x1')]=function(_0x5c9950){return _0x5c9950[_0x7dd8('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0x7dd8('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7dd8('0x4'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 7c1ec02..0832fde 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 _0x221f=['request','then','debug','request\x20sent','stringify','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','info','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client'];(function(_0x513938,_0x3db266){var _0x20e2d3=function(_0x19189e){while(--_0x19189e){_0x513938['push'](_0x513938['shift']());}};_0x20e2d3(++_0x3db266);}(_0x221f,0x14e));var _0xf221=function(_0x4474c2,_0x59cf02){_0x4474c2=_0x4474c2-0x0;var _0x435fbb=_0x221f[_0x4474c2];return _0x435fbb;};'use strict';var _=require(_0xf221('0x0'));var util=require(_0xf221('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf221('0x2'));var fs=require('fs');var Redis=require(_0xf221('0x3'));var db=require(_0xf221('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf221('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf221('0x6'));var client=jayson[_0xf221('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2402aa,_0xd54b8e,_0x1c6591){return new BPromise(function(_0x55dcf5,_0x50fe01){return client[_0xf221('0x8')](_0x2402aa,_0x1c6591)[_0xf221('0x9')](function(_0x1b6213){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0xd54b8e,'request\x20sent');logger[_0xf221('0xa')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0xd54b8e,_0xf221('0xb'),JSON[_0xf221('0xc')](_0x1b6213));if(_0x1b6213[_0xf221('0xd')]){if(_0x1b6213['error'][_0xf221('0xe')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0xd54b8e,_0x1b6213['error'][_0xf221('0xf')]);return _0x50fe01(_0x1b6213['error'][_0xf221('0xf')]);}logger[_0xf221('0xd')](_0xf221('0x10'),_0xd54b8e,_0x1b6213[_0xf221('0xd')]['message']);return _0x55dcf5(_0x1b6213[_0xf221('0xd')]['message']);}else{logger[_0xf221('0x11')](_0xf221('0x10'),_0xd54b8e,_0xf221('0xb'));_0x55dcf5(_0x1b6213['result']['message']);}})['catch'](function(_0xda249e){logger[_0xf221('0xd')](_0xf221('0x10'),_0xd54b8e,_0xda249e);_0x50fe01(_0xda249e);});});} \ No newline at end of file +var _0xec96=['message','ChatOfflineMessage,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0xec96,0x119));var _0x6ec9=function(_0x370847,_0x2123f9){_0x370847=_0x370847-0x0;var _0x60fc1b=_0xec96[_0x370847];return _0x60fc1b;};'use strict';var _=require(_0x6ec9('0x0'));var util=require(_0x6ec9('0x1'));var moment=require(_0x6ec9('0x2'));var BPromise=require(_0x6ec9('0x3'));var rs=require(_0x6ec9('0x4'));var fs=require('fs');var Redis=require(_0x6ec9('0x5'));var db=require(_0x6ec9('0x6'))['db'];var utils=require(_0x6ec9('0x7'));var logger=require('../../config/logger')(_0x6ec9('0x8'));var config=require(_0x6ec9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6ec9('0xa')][_0x6ec9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34e1d0,_0x32dd03,_0x53744b){return new BPromise(function(_0x38869b,_0x404ac0){return client[_0x6ec9('0xc')](_0x34e1d0,_0x53744b)[_0x6ec9('0xd')](function(_0x17e5c8){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x32dd03,_0x6ec9('0xe'));logger['debug'](_0x6ec9('0xf'),_0x32dd03,_0x6ec9('0xe'),JSON['stringify'](_0x17e5c8));if(_0x17e5c8[_0x6ec9('0x10')]){if(_0x17e5c8[_0x6ec9('0x10')][_0x6ec9('0x11')]===0x1f4){logger[_0x6ec9('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x32dd03,_0x17e5c8[_0x6ec9('0x10')][_0x6ec9('0x12')]);return _0x404ac0(_0x17e5c8['error'][_0x6ec9('0x12')]);}logger[_0x6ec9('0x10')](_0x6ec9('0x13'),_0x32dd03,_0x17e5c8[_0x6ec9('0x10')][_0x6ec9('0x12')]);return _0x38869b(_0x17e5c8[_0x6ec9('0x10')][_0x6ec9('0x12')]);}else{logger[_0x6ec9('0x14')](_0x6ec9('0x13'),_0x32dd03,_0x6ec9('0xe'));_0x38869b(_0x17e5c8[_0x6ec9('0x15')]['message']);}})[_0x6ec9('0x16')](function(_0x124178){logger['error'](_0x6ec9('0x13'),_0x32dd03,_0x124178);_0x404ac0(_0x124178);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index eff80c4..82b6ef2 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 _0x520f=['/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','isAuthenticated','describe'];(function(_0x8c1ea9,_0x460765){var _0x92f2ac=function(_0x564ebc){while(--_0x564ebc){_0x8c1ea9['push'](_0x8c1ea9['shift']());}};_0x92f2ac(++_0x460765);}(_0x520f,0x1e8));var _0xf520=function(_0x5a2c7b,_0x441265){_0x5a2c7b=_0x5a2c7b-0x0;var _0x3ad931=_0x520f[_0x5a2c7b];return _0x3ad931;};'use strict';var multer=require(_0xf520('0x0'));var util=require('util');var path=require(_0xf520('0x1'));var timeout=require(_0xf520('0x2'));var express=require('express');var router=express[_0xf520('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf520('0x4'));var interaction=require(_0xf520('0x5'));var config=require(_0xf520('0x6'));var controller=require(_0xf520('0x7'));router[_0xf520('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf520('0x8')](_0xf520('0x9'),auth[_0xf520('0xa')](),controller[_0xf520('0xb')]);router['get'](_0xf520('0xc'),auth[_0xf520('0xa')](),controller[_0xf520('0xd')]);router['post']('/',auth[_0xf520('0xa')](),controller[_0xf520('0xe')]);router[_0xf520('0xf')]('/:id',auth[_0xf520('0xa')](),controller[_0xf520('0x10')]);router[_0xf520('0x11')](_0xf520('0xc'),auth[_0xf520('0xa')](),controller[_0xf520('0x12')]);module[_0xf520('0x13')]=router; \ No newline at end of file +var _0x48eb=['show','post','create','put','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','/:id','isAuthenticated'];(function(_0xdfd39e,_0x400310){var _0x2cf782=function(_0x1cc8c3){while(--_0x1cc8c3){_0xdfd39e['push'](_0xdfd39e['shift']());}};_0x2cf782(++_0x400310);}(_0x48eb,0x147));var _0xb48e=function(_0x2cb4cb,_0x273e65){_0x2cb4cb=_0x2cb4cb-0x0;var _0x5566fd=_0x48eb[_0x2cb4cb];return _0x5566fd;};'use strict';var multer=require(_0xb48e('0x0'));var util=require(_0xb48e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb48e('0x2')]();var fs_extra=require(_0xb48e('0x3'));var auth=require(_0xb48e('0x4'));var interaction=require(_0xb48e('0x5'));var config=require(_0xb48e('0x6'));var controller=require(_0xb48e('0x7'));router[_0xb48e('0x8')]('/',auth['isAuthenticated'](),controller[_0xb48e('0x9')]);router['get'](_0xb48e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xb48e('0x8')](_0xb48e('0xb'),auth[_0xb48e('0xc')](),controller[_0xb48e('0xd')]);router[_0xb48e('0xe')]('/',auth[_0xb48e('0xc')](),controller[_0xb48e('0xf')]);router[_0xb48e('0x10')]('/:id',auth[_0xb48e('0xc')](),controller['update']);router[_0xb48e('0x11')](_0xb48e('0xb'),auth[_0xb48e('0xc')](),controller[_0xb48e('0x12')]);module[_0xb48e('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 9961d15..7bcfedd 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 _0x76ef=['timeout','STRING','INTEGER','sequelize','exports','ENUM'];(function(_0x3f5238,_0x39e5b6){var _0x115624=function(_0x57db3a){while(--_0x57db3a){_0x3f5238['push'](_0x3f5238['shift']());}};_0x115624(++_0x39e5b6);}(_0x76ef,0x14d));var _0xf76e=function(_0x2574e7,_0x2165de){_0x2574e7=_0x2574e7-0x0;var _0x39b967=_0x76ef[_0x2574e7];return _0x39b967;};'use strict';var Sequelize=require(_0xf76e('0x0'));module[_0xf76e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf76e('0x2')]('mouseOver',_0xf76e('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xf76e('0x4')]},'timeout':{'type':Sequelize[_0xf76e('0x5')]}}; \ No newline at end of file +var _0x0bce=['mouseOver','INTEGER','STRING','ENUM'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0x0bce,0x18e));var _0xe0bc=function(_0x594745,_0x28d995){_0x594745=_0x594745-0x0;var _0x543ec7=_0x0bce[_0x594745];return _0x543ec7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe0bc('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xe0bc('0x1')](_0xe0bc('0x2'),'timeout'),'defaultValue':_0xe0bc('0x2')},'selector':{'type':Sequelize[_0xe0bc('0x0')]},'timeout':{'type':Sequelize[_0xe0bc('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index c3a8754..6201320 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 _0x5243=['mustache','util','sox','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','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','sendStatus','error','name','show','params','keys','ChatProactiveAction','rawAttributes','query','filters','model','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','body','catch','destroy','eml-format','fast-json-patch','request-promise'];(function(_0x5a7f64,_0x347d57){var _0x3d30f1=function(_0x4bd1d6){while(--_0x4bd1d6){_0x5a7f64['push'](_0x5a7f64['shift']());}};_0x3d30f1(++_0x347d57);}(_0x5243,0x71));var _0x3524=function(_0x55eb4b,_0x2c3c51){_0x55eb4b=_0x55eb4b-0x0;var _0x525ca2=_0x5243[_0x55eb4b];return _0x525ca2;};'use strict';var emlformat=require(_0x3524('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3524('0x1'));var rp=require(_0x3524('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3524('0x3'));var util=require(_0x3524('0x4'));var path=require('path');var sox=require(_0x3524('0x5'));var csv=require('to-csv');var ejs=require(_0x3524('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3524('0x7'));var squel=require(_0x3524('0x8'));var crypto=require(_0x3524('0x9'));var jsforce=require(_0x3524('0xa'));var deskjs=require(_0x3524('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3524('0xc'));var Redis=require(_0x3524('0xd'));var authService=require(_0x3524('0xe'));var qs=require(_0x3524('0xf'));var as=require(_0x3524('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3524('0x11'))(_0x3524('0x12'));var utils=require('../../config/utils');var config=require(_0x3524('0x13'));var licenseUtil=require(_0x3524('0x14'));var db=require(_0x3524('0x15'))['db'];function respondWithStatusCode(_0x5d5a60,_0x4f49da){_0x4f49da=_0x4f49da||0xcc;return function(_0x50c11f){if(_0x50c11f){return _0x5d5a60['sendStatus'](_0x4f49da);}return _0x5d5a60[_0x3524('0x16')](_0x4f49da)[_0x3524('0x17')]();};}function respondWithResult(_0x58cd29,_0x3aa2da){_0x3aa2da=_0x3aa2da||0xc8;return function(_0x253d92){if(_0x253d92){return _0x58cd29[_0x3524('0x16')](_0x3aa2da)[_0x3524('0x18')](_0x253d92);}};}function respondWithFilteredResult(_0xe5df67,_0x235cfd){return function(_0x34d9a0){if(_0x34d9a0){var _0x8440a4=typeof _0x235cfd[_0x3524('0x19')]==='undefined'&&typeof _0x235cfd[_0x3524('0x1a')]==='undefined';var _0x2eb681=_0x34d9a0[_0x3524('0x1b')];var _0x44ee2e=_0x8440a4?0x0:_0x235cfd[_0x3524('0x19')];var _0x1ca615=_0x8440a4?_0x34d9a0[_0x3524('0x1b')]:_0x235cfd['offset']+_0x235cfd['limit'];var _0x1acbd1;if(_0x1ca615>=_0x2eb681){_0x1ca615=_0x2eb681;_0x1acbd1=0xc8;}else{_0x1acbd1=0xce;}_0xe5df67['status'](_0x1acbd1);return _0xe5df67[_0x3524('0x1c')](_0x3524('0x1d'),_0x44ee2e+'-'+_0x1ca615+'/'+_0x2eb681)[_0x3524('0x18')](_0x34d9a0);}return null;};}function patchUpdates(_0xd285a3){return function(_0x1d25f8){try{jsonpatch[_0x3524('0x1e')](_0x1d25f8,_0xd285a3,!![]);}catch(_0x4f584a){return BPromise[_0x3524('0x1f')](_0x4f584a);}return _0x1d25f8[_0x3524('0x20')]();};}function saveUpdates(_0x1ab2c5,_0xf1b3b1){return function(_0x2d20c8){if(_0x2d20c8){return _0x2d20c8['update'](_0x1ab2c5)[_0x3524('0x21')](function(_0x52600c){return _0x52600c;});}return null;};}function removeEntity(_0x2eb72f,_0x26c20e){return function(_0x101e9a){if(_0x101e9a){return _0x101e9a['destroy']()[_0x3524('0x21')](function(){_0x2eb72f[_0x3524('0x16')](0xcc)[_0x3524('0x17')]();});}};}function handleEntityNotFound(_0x27bd6a,_0x4dfd49){return function(_0x4256ca){if(!_0x4256ca){_0x27bd6a[_0x3524('0x22')](0x194);}return _0x4256ca;};}function handleError(_0x1765a4,_0x5dc071){_0x5dc071=_0x5dc071||0x1f4;return function(_0x1d351e){logger[_0x3524('0x23')](_0x1d351e['stack']);if(_0x1d351e[_0x3524('0x24')]){delete _0x1d351e[_0x3524('0x24')];}_0x1765a4['status'](_0x5dc071)['send'](_0x1d351e);};}exports[_0x3524('0x25')]=function(_0x3fddc1,_0x225b26){var _0x651f11={'raw':!![],'where':{'id':_0x3fddc1[_0x3524('0x26')]['id']}},_0x5bf38e={};_0x5bf38e['model']=_[_0x3524('0x27')](db[_0x3524('0x28')][_0x3524('0x29')]);_0x5bf38e['query']=_['keys'](_0x3fddc1[_0x3524('0x2a')]);_0x5bf38e[_0x3524('0x2b')]=_['intersection'](_0x5bf38e[_0x3524('0x2c')],_0x5bf38e[_0x3524('0x2a')]);_0x651f11[_0x3524('0x2d')]=_[_0x3524('0x2e')](_0x5bf38e[_0x3524('0x2c')],qs['fields'](_0x3fddc1[_0x3524('0x2a')][_0x3524('0x2f')]));_0x651f11[_0x3524('0x2d')]=_0x651f11['attributes'][_0x3524('0x30')]?_0x651f11[_0x3524('0x2d')]:_0x5bf38e[_0x3524('0x2c')];if(_0x3fddc1[_0x3524('0x2a')][_0x3524('0x31')]){_0x651f11[_0x3524('0x32')]=[{'all':!![]}];}_0x651f11=_[_0x3524('0x33')]({},_0x651f11,_0x3fddc1[_0x3524('0x34')]);return db[_0x3524('0x28')][_0x3524('0x35')](_0x651f11)[_0x3524('0x21')](handleEntityNotFound(_0x225b26,null))['then'](respondWithResult(_0x225b26,null))['catch'](handleError(_0x225b26,null));};exports['create']=function(_0x197f78,_0x48b54b){return db[_0x3524('0x28')][_0x3524('0x36')](_0x197f78[_0x3524('0x37')],{})['then'](respondWithResult(_0x48b54b,0xc9))[_0x3524('0x38')](handleError(_0x48b54b,null));};exports['update']=function(_0x18ee71,_0xcc63d5){if(_0x18ee71[_0x3524('0x37')]['id']){delete _0x18ee71[_0x3524('0x37')]['id'];}return db[_0x3524('0x28')]['find']({'where':{'id':_0x18ee71[_0x3524('0x26')]['id']}})[_0x3524('0x21')](handleEntityNotFound(_0xcc63d5,null))[_0x3524('0x21')](saveUpdates(_0x18ee71[_0x3524('0x37')],null))['then'](respondWithResult(_0xcc63d5,null))[_0x3524('0x38')](handleError(_0xcc63d5,null));};exports[_0x3524('0x39')]=function(_0x449c51,_0x97b711){return db[_0x3524('0x28')]['find']({'where':{'id':_0x449c51['params']['id']}})[_0x3524('0x21')](handleEntityNotFound(_0x97b711,null))[_0x3524('0x21')](removeEntity(_0x97b711,null))[_0x3524('0x38')](handleError(_0x97b711,null));}; \ No newline at end of file +var _0xa566=['params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','json','apply','reject','update','then','destroy','error','name','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','create','body'];(function(_0x50ca48,_0x493806){var _0x127340=function(_0x340ec7){while(--_0x340ec7){_0x50ca48['push'](_0x50ca48['shift']());}};_0x127340(++_0x493806);}(_0xa566,0x1c1));var _0x6a56=function(_0x192de1,_0x5485f0){_0x192de1=_0x192de1-0x0;var _0x20dc0e=_0xa566[_0x192de1];return _0x20dc0e;};'use strict';var emlformat=require(_0x6a56('0x0'));var rimraf=require(_0x6a56('0x1'));var zipdir=require(_0x6a56('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a56('0x3'));var moment=require(_0x6a56('0x4'));var BPromise=require(_0x6a56('0x5'));var Mustache=require(_0x6a56('0x6'));var util=require('util');var path=require(_0x6a56('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(_0x6a56('0x8'));var squel=require('squel');var crypto=require(_0x6a56('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x6a56('0xa'));var toCsv=require(_0x6a56('0xb'));var querystring=require('querystring');var Papa=require(_0x6a56('0xc'));var Redis=require(_0x6a56('0xd'));var authService=require(_0x6a56('0xe'));var qs=require(_0x6a56('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6a56('0x10'));var logger=require(_0x6a56('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x6a56('0x12'));var licenseUtil=require(_0x6a56('0x13'));var db=require(_0x6a56('0x14'))['db'];function respondWithStatusCode(_0x26f443,_0x3e9389){_0x3e9389=_0x3e9389||0xcc;return function(_0x10f894){if(_0x10f894){return _0x26f443[_0x6a56('0x15')](_0x3e9389);}return _0x26f443['status'](_0x3e9389)[_0x6a56('0x16')]();};}function respondWithResult(_0x14237e,_0x46fbaa){_0x46fbaa=_0x46fbaa||0xc8;return function(_0x10fd64){if(_0x10fd64){return _0x14237e[_0x6a56('0x17')](_0x46fbaa)['json'](_0x10fd64);}};}function respondWithFilteredResult(_0x232176,_0xc0e603){return function(_0x28bb4e){if(_0x28bb4e){var _0xc5f78d=typeof _0xc0e603[_0x6a56('0x18')]==='undefined'&&typeof _0xc0e603['limit']===_0x6a56('0x19');var _0x2288b1=_0x28bb4e['count'];var _0x162c52=_0xc5f78d?0x0:_0xc0e603[_0x6a56('0x18')];var _0x4c2f9c=_0xc5f78d?_0x28bb4e[_0x6a56('0x1a')]:_0xc0e603[_0x6a56('0x18')]+_0xc0e603['limit'];var _0x26b33e;if(_0x4c2f9c>=_0x2288b1){_0x4c2f9c=_0x2288b1;_0x26b33e=0xc8;}else{_0x26b33e=0xce;}_0x232176['status'](_0x26b33e);return _0x232176[_0x6a56('0x1b')]('Content-Range',_0x162c52+'-'+_0x4c2f9c+'/'+_0x2288b1)[_0x6a56('0x1c')](_0x28bb4e);}return null;};}function patchUpdates(_0x2239ff){return function(_0x11e479){try{jsonpatch[_0x6a56('0x1d')](_0x11e479,_0x2239ff,!![]);}catch(_0x32118b){return BPromise[_0x6a56('0x1e')](_0x32118b);}return _0x11e479['save']();};}function saveUpdates(_0x2e217a,_0x148548){return function(_0x4845aa){if(_0x4845aa){return _0x4845aa[_0x6a56('0x1f')](_0x2e217a)[_0x6a56('0x20')](function(_0x3cf1b3){return _0x3cf1b3;});}return null;};}function removeEntity(_0x5a0986,_0x2a6ece){return function(_0x3e0aab){if(_0x3e0aab){return _0x3e0aab[_0x6a56('0x21')]()[_0x6a56('0x20')](function(){_0x5a0986[_0x6a56('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51d23a,_0x5ce125){return function(_0x302316){if(!_0x302316){_0x51d23a[_0x6a56('0x15')](0x194);}return _0x302316;};}function handleError(_0x2bd80f,_0x55e714){_0x55e714=_0x55e714||0x1f4;return function(_0x1df843){logger[_0x6a56('0x22')](_0x1df843['stack']);if(_0x1df843[_0x6a56('0x23')]){delete _0x1df843[_0x6a56('0x23')];}_0x2bd80f[_0x6a56('0x17')](_0x55e714)['send'](_0x1df843);};}exports[_0x6a56('0x24')]=function(_0x27bcd0,_0x151537){var _0xe26d09={'raw':!![],'where':{'id':_0x27bcd0['params']['id']}},_0x10b1cb={};_0x10b1cb[_0x6a56('0x25')]=_[_0x6a56('0x26')](db[_0x6a56('0x27')][_0x6a56('0x28')]);_0x10b1cb['query']=_[_0x6a56('0x26')](_0x27bcd0[_0x6a56('0x29')]);_0x10b1cb[_0x6a56('0x2a')]=_['intersection'](_0x10b1cb[_0x6a56('0x25')],_0x10b1cb['query']);_0xe26d09[_0x6a56('0x2b')]=_[_0x6a56('0x2c')](_0x10b1cb[_0x6a56('0x25')],qs[_0x6a56('0x2d')](_0x27bcd0[_0x6a56('0x29')][_0x6a56('0x2d')]));_0xe26d09[_0x6a56('0x2b')]=_0xe26d09[_0x6a56('0x2b')][_0x6a56('0x2e')]?_0xe26d09[_0x6a56('0x2b')]:_0x10b1cb[_0x6a56('0x25')];if(_0x27bcd0['query'][_0x6a56('0x2f')]){_0xe26d09[_0x6a56('0x30')]=[{'all':!![]}];}_0xe26d09=_[_0x6a56('0x31')]({},_0xe26d09,_0x27bcd0[_0x6a56('0x32')]);return db['ChatProactiveAction'][_0x6a56('0x33')](_0xe26d09)[_0x6a56('0x20')](handleEntityNotFound(_0x151537,null))[_0x6a56('0x20')](respondWithResult(_0x151537,null))[_0x6a56('0x34')](handleError(_0x151537,null));};exports['create']=function(_0xf4ff24,_0xadea5b){return db['ChatProactiveAction'][_0x6a56('0x35')](_0xf4ff24['body'],{})[_0x6a56('0x20')](respondWithResult(_0xadea5b,0xc9))[_0x6a56('0x34')](handleError(_0xadea5b,null));};exports[_0x6a56('0x1f')]=function(_0x390444,_0x22ad72){if(_0x390444[_0x6a56('0x36')]['id']){delete _0x390444[_0x6a56('0x36')]['id'];}return db['ChatProactiveAction'][_0x6a56('0x33')]({'where':{'id':_0x390444[_0x6a56('0x37')]['id']}})[_0x6a56('0x20')](handleEntityNotFound(_0x22ad72,null))[_0x6a56('0x20')](saveUpdates(_0x390444[_0x6a56('0x36')],null))[_0x6a56('0x20')](respondWithResult(_0x22ad72,null))[_0x6a56('0x34')](handleError(_0x22ad72,null));};exports[_0x6a56('0x21')]=function(_0x130426,_0x4b1f65){return db[_0x6a56('0x27')][_0x6a56('0x33')]({'where':{'id':_0x130426[_0x6a56('0x37')]['id']}})[_0x6a56('0x20')](handleEntityNotFound(_0x4b1f65,null))[_0x6a56('0x20')](removeEntity(_0x4b1f65,null))[_0x6a56('0x34')](handleError(_0x4b1f65,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index a81e884..7721261 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 _0x6524=['moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','api'];(function(_0x3050c5,_0x51747a){var _0x1dd23c=function(_0x36f880){while(--_0x36f880){_0x3050c5['push'](_0x3050c5['shift']());}};_0x1dd23c(++_0x51747a);}(_0x6524,0x1e9));var _0x4652=function(_0x54781c,_0x5b5683){_0x54781c=_0x54781c-0x0;var _0x4804bc=_0x6524[_0x54781c];return _0x4804bc;};'use strict';var _=require(_0x4652('0x0'));var util=require(_0x4652('0x1'));var logger=require('../../config/logger')(_0x4652('0x2'));var moment=require(_0x4652('0x3'));var BPromise=require(_0x4652('0x4'));var rp=require(_0x4652('0x5'));var fs=require('fs');var path=require(_0x4652('0x6'));var rimraf=require(_0x4652('0x7'));var config=require('../../config/environment');var attributes=require(_0x4652('0x8'));module['exports']=function(_0x4e602e,_0x14864f){return _0x4e602e[_0x4652('0x9')](_0x4652('0xa'),attributes,{'tableName':_0x4652('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x26dd=['path','../../config/environment','./chatProactiveAction.attributes','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4580eb,_0x5d0afa){var _0x3f7f92=function(_0x34a6d0){while(--_0x34a6d0){_0x4580eb['push'](_0x4580eb['shift']());}};_0x3f7f92(++_0x5d0afa);}(_0x26dd,0xf5));var _0xd26d=function(_0xdf61c7,_0x4dbc6e){_0xdf61c7=_0xdf61c7-0x0;var _0x3bb686=_0x26dd[_0xdf61c7];return _0x3bb686;};'use strict';var _=require(_0xd26d('0x0'));var util=require(_0xd26d('0x1'));var logger=require(_0xd26d('0x2'))('api');var moment=require(_0xd26d('0x3'));var BPromise=require(_0xd26d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd26d('0x5'));var rimraf=require('rimraf');var config=require(_0xd26d('0x6'));var attributes=require(_0xd26d('0x7'));module['exports']=function(_0x1a5196,_0x4b653b){return _0x1a5196['define'](_0xd26d('0x8'),attributes,{'tableName':_0xd26d('0x9'),'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 0543df6..694c2b5 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 _0xa167=['../../config/environment','jayson/promise','client','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4b6778,_0x505a76){var _0x22dbb9=function(_0x4881eb){while(--_0x4881eb){_0x4b6778['push'](_0x4b6778['shift']());}};_0x22dbb9(++_0x505a76);}(_0xa167,0xce));var _0x7a16=function(_0x52b902,_0x43c4aa){_0x52b902=_0x52b902-0x0;var _0x397611=_0xa167[_0x52b902];return _0x397611;};'use strict';var _=require(_0x7a16('0x0'));var util=require(_0x7a16('0x1'));var moment=require(_0x7a16('0x2'));var BPromise=require(_0x7a16('0x3'));var rs=require(_0x7a16('0x4'));var fs=require('fs');var Redis=require(_0x7a16('0x5'));var db=require(_0x7a16('0x6'))['db'];var utils=require(_0x7a16('0x7'));var logger=require(_0x7a16('0x8'))(_0x7a16('0x9'));var config=require(_0x7a16('0xa'));var jayson=require(_0x7a16('0xb'));var client=jayson[_0x7a16('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x173fd5,_0x15c517,_0x2c9012){return new BPromise(function(_0x5b23cf,_0x116fe3){return client['request'](_0x173fd5,_0x2c9012)[_0x7a16('0xd')](function(_0x1570b0){logger['info'](_0x7a16('0xe'),_0x15c517,_0x7a16('0xf'));logger[_0x7a16('0x10')](_0x7a16('0x11'),_0x15c517,'request\x20sent',JSON['stringify'](_0x1570b0));if(_0x1570b0[_0x7a16('0x12')]){if(_0x1570b0[_0x7a16('0x12')][_0x7a16('0x13')]===0x1f4){logger['error'](_0x7a16('0xe'),_0x15c517,_0x1570b0[_0x7a16('0x12')][_0x7a16('0x14')]);return _0x116fe3(_0x1570b0[_0x7a16('0x12')]['message']);}logger[_0x7a16('0x12')](_0x7a16('0xe'),_0x15c517,_0x1570b0['error'][_0x7a16('0x14')]);return _0x5b23cf(_0x1570b0['error']['message']);}else{logger[_0x7a16('0x15')](_0x7a16('0xe'),_0x15c517,_0x7a16('0xf'));_0x5b23cf(_0x1570b0[_0x7a16('0x16')][_0x7a16('0x14')]);}})[_0x7a16('0x17')](function(_0x40a4da){logger[_0x7a16('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x15c517,_0x40a4da);_0x116fe3(_0x40a4da);});});} \ No newline at end of file +var _0xfca1=['randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','bluebird'];(function(_0x118814,_0x1d5d0e){var _0x4dd647=function(_0x4f89f9){while(--_0x4f89f9){_0x118814['push'](_0x118814['shift']());}};_0x4dd647(++_0x1d5d0e);}(_0xfca1,0x168));var _0x1fca=function(_0x2e9497,_0x46a98d){_0x2e9497=_0x2e9497-0x0;var _0x59e0ab=_0xfca1[_0x2e9497];return _0x59e0ab;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x1fca('0x0'));var rs=require(_0x1fca('0x1'));var fs=require('fs');var Redis=require(_0x1fca('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fca('0x3'));var logger=require('../../config/logger')(_0x1fca('0x4'));var config=require('../../config/environment');var jayson=require(_0x1fca('0x5'));var client=jayson[_0x1fca('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x365e3e,_0x3c4c3d,_0xf917af){return new BPromise(function(_0x573217,_0x1d5771){return client[_0x1fca('0x7')](_0x365e3e,_0xf917af)[_0x1fca('0x8')](function(_0x404500){logger[_0x1fca('0x9')](_0x1fca('0xa'),_0x3c4c3d,_0x1fca('0xb'));logger[_0x1fca('0xc')](_0x1fca('0xd'),_0x3c4c3d,'request\x20sent',JSON[_0x1fca('0xe')](_0x404500));if(_0x404500[_0x1fca('0xf')]){if(_0x404500['error'][_0x1fca('0x10')]===0x1f4){logger[_0x1fca('0xf')](_0x1fca('0xa'),_0x3c4c3d,_0x404500[_0x1fca('0xf')][_0x1fca('0x11')]);return _0x1d5771(_0x404500[_0x1fca('0xf')][_0x1fca('0x11')]);}logger[_0x1fca('0xf')](_0x1fca('0xa'),_0x3c4c3d,_0x404500[_0x1fca('0xf')]['message']);return _0x573217(_0x404500[_0x1fca('0xf')][_0x1fca('0x11')]);}else{logger[_0x1fca('0x9')](_0x1fca('0xa'),_0x3c4c3d,'request\x20sent');_0x573217(_0x404500['result'][_0x1fca('0x11')]);}})[_0x1fca('0x12')](function(_0x1280b0){logger[_0x1fca('0xf')](_0x1fca('0xa'),_0x3c4c3d,_0x1280b0);_0x1d5771(_0x1280b0);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 38f1fd9..1bfc642 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 _0xac9d=['get','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3093ea,_0x3a94bc){var _0x19d889=function(_0x858d3e){while(--_0x858d3e){_0x3093ea['push'](_0x3093ea['shift']());}};_0x19d889(++_0x3a94bc);}(_0xac9d,0x14d));var _0xdac9=function(_0x4a8227,_0x27ab19){_0x4a8227=_0x4a8227-0x0;var _0x403b2c=_0xac9d[_0x4a8227];return _0x403b2c;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var fs_extra=require(_0xdac9('0x6'));var auth=require(_0xdac9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdac9('0x8'));var controller=require('./chatProactiveAction.controller');router[_0xdac9('0x9')](_0xdac9('0xa'),auth[_0xdac9('0xb')](),controller[_0xdac9('0xc')]);router[_0xdac9('0xd')]('/',auth[_0xdac9('0xb')](),controller['create']);router[_0xdac9('0xe')]('/:id',auth[_0xdac9('0xb')](),controller[_0xdac9('0xf')]);router[_0xdac9('0x10')](_0xdac9('0xa'),auth[_0xdac9('0xb')](),controller[_0xdac9('0x11')]);module[_0xdac9('0x12')]=router; \ No newline at end of file +var _0xdbf5=['post','put','update','delete','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x11f50c,_0x28e6e8){var _0x230df2=function(_0x319145){while(--_0x319145){_0x11f50c['push'](_0x11f50c['shift']());}};_0x230df2(++_0x28e6e8);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x5b9d0a,_0x105c2a){_0x5b9d0a=_0x5b9d0a-0x0;var _0x1eb7cb=_0xdbf5[_0x5b9d0a];return _0x1eb7cb;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var fs_extra=require(_0x5dbf('0x3'));var auth=require(_0x5dbf('0x4'));var interaction=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var controller=require(_0x5dbf('0x7'));router[_0x5dbf('0x8')](_0x5dbf('0x9'),auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xb')]);router[_0x5dbf('0xc')]('/',auth[_0x5dbf('0xa')](),controller['create']);router[_0x5dbf('0xd')]('/:id',auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xe')]);router[_0x5dbf('0xf')](_0x5dbf('0x9'),auth['isAuthenticated'](),controller[_0x5dbf('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 565eb8e..7262b40 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 _0x14dd=['STRING','name','INTEGER','ENUM','beepall','roundrobin','sequelize','exports'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x14dd,0x196));var _0xd14d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14dd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd14d('0x0'));module[_0xd14d('0x1')]={'name':{'type':Sequelize[_0xd14d('0x2')],'unique':_0xd14d('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd14d('0x2')]},'timeout':{'type':Sequelize[_0xd14d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd14d('0x5')]('rrmemory',_0xd14d('0x6'),_0xd14d('0x7'))}}; \ No newline at end of file +var _0x6d5d=['sequelize','exports','INTEGER','beepall'];(function(_0x5ef905,_0x564b87){var _0x367808=function(_0x14f487){while(--_0x14f487){_0x5ef905['push'](_0x5ef905['shift']());}};_0x367808(++_0x564b87);}(_0x6d5d,0x1d4));var _0xd6d5=function(_0x5a5c58,_0x26ced8){_0x5a5c58=_0x5a5c58-0x0;var _0x2e76b9=_0x6d5d[_0x5a5c58];return _0x2e76b9;};'use strict';var Sequelize=require(_0xd6d5('0x0'));module[_0xd6d5('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd6d5('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xd6d5('0x3'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index ec16ed2..df73d2a 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 _0xfc18=['value','transaction','isEmpty','removeAgents','forEach','emit','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','getAgents','eml-format','rimraf','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','get','UserProfileResource','destroy','stack','name','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','ChatQueue','includeAll','include','findAll','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','getMembers','findOne','ChatQueueId','UserId','agent','chatPause','createdAt','format','getTeams','addTeams','User','Agents','online','interface','sequelize','each','UserChatQueue','findOrCreate','removeTeams','ids','select','tq.TeamId','from','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact'];(function(_0x193249,_0x2104b6){var _0x224eb3=function(_0x2bccd2){while(--_0x2bccd2){_0x193249['push'](_0x193249['shift']());}};_0x224eb3(++_0x2104b6);}(_0xfc18,0x1da));var _0x8fc1=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0xfc18[_0x4eafed];return _0x159c85;};'use strict';var emlformat=require(_0x8fc1('0x0'));var rimraf=require(_0x8fc1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8fc1('0x2'));var BPromise=require(_0x8fc1('0x3'));var Mustache=require(_0x8fc1('0x4'));var util=require('util');var path=require(_0x8fc1('0x5'));var sox=require(_0x8fc1('0x6'));var csv=require('to-csv');var ejs=require(_0x8fc1('0x7'));var fs=require('fs');var fs_extra=require(_0x8fc1('0x8'));var _=require(_0x8fc1('0x9'));var squel=require(_0x8fc1('0xa'));var crypto=require(_0x8fc1('0xb'));var jsforce=require(_0x8fc1('0xc'));var deskjs=require(_0x8fc1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8fc1('0xe'));var Papa=require(_0x8fc1('0xf'));var Redis=require(_0x8fc1('0x10'));var authService=require(_0x8fc1('0x11'));var qs=require(_0x8fc1('0x12'));var as=require(_0x8fc1('0x13'));var hardwareService=require(_0x8fc1('0x14'));var logger=require(_0x8fc1('0x15'))(_0x8fc1('0x16'));var utils=require(_0x8fc1('0x17'));var config=require(_0x8fc1('0x18'));var licenseUtil=require(_0x8fc1('0x19'));var db=require(_0x8fc1('0x1a'))['db'];config[_0x8fc1('0x1b')]=_[_0x8fc1('0x1c')](config[_0x8fc1('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x8fc1('0x1d'))(new Redis(config[_0x8fc1('0x1b')]));require(_0x8fc1('0x1e'))[_0x8fc1('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8fc1('0x20')][_0x8fc1('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x894d0b,_0x4daac1,_0x395cf1,_0x1efc11){return new BPromise(function(_0x5ddf2d,_0x282589){var _0x52527f=_0x1efc11||client;return _0x52527f[_0x8fc1('0x22')](_0x894d0b,_0x395cf1)[_0x8fc1('0x23')](function(_0x177331){logger[_0x8fc1('0x24')](_0x8fc1('0x25'),_0x4daac1,'request\x20sent');logger[_0x8fc1('0x26')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4daac1,_0x8fc1('0x27'),JSON[_0x8fc1('0x28')](_0x177331));if(_0x177331['error']){if(_0x177331['error'][_0x8fc1('0x29')]===0x1f4){logger[_0x8fc1('0x2a')](_0x8fc1('0x25'),_0x4daac1,_0x177331[_0x8fc1('0x2a')][_0x8fc1('0x2b')]);return _0x282589(_0x177331[_0x8fc1('0x2a')][_0x8fc1('0x2b')]);}logger[_0x8fc1('0x2a')]('ChatQueue,\x20%s,\x20%s',_0x4daac1,_0x177331['error'][_0x8fc1('0x2b')]);return _0x5ddf2d(_0x177331[_0x8fc1('0x2a')][_0x8fc1('0x2b')]);}else{logger[_0x8fc1('0x24')](_0x8fc1('0x25'),_0x4daac1,_0x8fc1('0x27'));_0x5ddf2d(_0x177331[_0x8fc1('0x2c')][_0x8fc1('0x2b')]);}})[_0x8fc1('0x2d')](function(_0x1dd479){logger[_0x8fc1('0x2a')](_0x8fc1('0x25'),_0x4daac1,_0x1dd479);_0x282589(_0x1dd479);});});}function respondWithStatusCode(_0x4d6caa,_0x194e44){_0x194e44=_0x194e44||0xcc;return function(_0x44a1ae){if(_0x44a1ae){return _0x4d6caa[_0x8fc1('0x2e')](_0x194e44);}return _0x4d6caa[_0x8fc1('0x2f')](_0x194e44)[_0x8fc1('0x30')]();};}function respondWithResult(_0x56af10,_0x5d2dd1){_0x5d2dd1=_0x5d2dd1||0xc8;return function(_0x4ab9cb){if(_0x4ab9cb){return _0x56af10['status'](_0x5d2dd1)[_0x8fc1('0x31')](_0x4ab9cb);}};}function respondWithFilteredResult(_0x2f34f9,_0x557a22){return function(_0x516b77){if(_0x516b77){var _0x224f9b=typeof _0x557a22[_0x8fc1('0x32')]===_0x8fc1('0x33')&&typeof _0x557a22[_0x8fc1('0x34')]==='undefined';var _0x4d7420=_0x516b77[_0x8fc1('0x35')];var _0x2cf6db=_0x224f9b?0x0:_0x557a22[_0x8fc1('0x32')];var _0x2c95fe=_0x224f9b?_0x516b77[_0x8fc1('0x35')]:_0x557a22[_0x8fc1('0x32')]+_0x557a22[_0x8fc1('0x34')];var _0x1d59eb;if(_0x2c95fe>=_0x4d7420){_0x2c95fe=_0x4d7420;_0x1d59eb=0xc8;}else{_0x1d59eb=0xce;}_0x2f34f9['status'](_0x1d59eb);return _0x2f34f9[_0x8fc1('0x36')](_0x8fc1('0x37'),_0x2cf6db+'-'+_0x2c95fe+'/'+_0x4d7420)[_0x8fc1('0x31')](_0x516b77);}return null;};}function patchUpdates(_0x380892){return function(_0x529592){try{jsonpatch[_0x8fc1('0x38')](_0x529592,_0x380892,!![]);}catch(_0x16d50f){return BPromise[_0x8fc1('0x39')](_0x16d50f);}return _0x529592[_0x8fc1('0x3a')]();};}function saveUpdates(_0x5cf19b,_0x19dbe9){return function(_0x47ab20){if(_0x47ab20){return _0x47ab20['update'](_0x5cf19b)[_0x8fc1('0x23')](function(_0x17689c){return _0x17689c;});}return null;};}function removeEntity(_0x505c92,_0x5a0982){return function(_0x31216f){if(_0x31216f){return _0x31216f['destroy']()[_0x8fc1('0x23')](function(){var _0x5d794b=_0x31216f[_0x8fc1('0x3b')]({'plain':!![]});var _0x4b8487='ChatQueues';return db[_0x8fc1('0x3c')][_0x8fc1('0x3d')]({'where':{'type':_0x4b8487,'resourceId':_0x5d794b['id']}})[_0x8fc1('0x23')](function(){return _0x31216f;});})['then'](function(){_0x505c92[_0x8fc1('0x2f')](0xcc)[_0x8fc1('0x30')]();});}};}function handleEntityNotFound(_0x1d8e78,_0x4845e6){return function(_0xe8e791){if(!_0xe8e791){_0x1d8e78[_0x8fc1('0x2e')](0x194);}return _0xe8e791;};}function handleError(_0x353104,_0x3e4631){_0x3e4631=_0x3e4631||0x1f4;return function(_0x320f01){logger[_0x8fc1('0x2a')](_0x320f01[_0x8fc1('0x3e')]);if(_0x320f01[_0x8fc1('0x3f')]){delete _0x320f01[_0x8fc1('0x3f')];}_0x353104['status'](_0x3e4631)['send'](_0x320f01);};}exports['index']=function(_0x3d9898,_0x11771b){var _0x39fd1b={},_0xdc39e3={},_0x1f477f={'count':0x0,'rows':[]};var _0x54eeb3=_['map'](db['ChatQueue'][_0x8fc1('0x40')],function(_0xc79d98){return{'name':_0xc79d98[_0x8fc1('0x41')],'type':_0xc79d98[_0x8fc1('0x42')][_0x8fc1('0x43')]};});_0xdc39e3['model']=_[_0x8fc1('0x44')](_0x54eeb3,_0x8fc1('0x3f'));_0xdc39e3[_0x8fc1('0x45')]=_[_0x8fc1('0x46')](_0x3d9898[_0x8fc1('0x45')]);_0xdc39e3['filters']=_[_0x8fc1('0x47')](_0xdc39e3[_0x8fc1('0x48')],_0xdc39e3[_0x8fc1('0x45')]);_0x39fd1b[_0x8fc1('0x49')]=_[_0x8fc1('0x47')](_0xdc39e3['model'],qs[_0x8fc1('0x4a')](_0x3d9898[_0x8fc1('0x45')][_0x8fc1('0x4a')]));_0x39fd1b[_0x8fc1('0x49')]=_0x39fd1b[_0x8fc1('0x49')][_0x8fc1('0x4b')]?_0x39fd1b[_0x8fc1('0x49')]:_0xdc39e3['model'];if(!_0x3d9898[_0x8fc1('0x45')][_0x8fc1('0x4c')](_0x8fc1('0x4d'))){_0x39fd1b[_0x8fc1('0x34')]=qs[_0x8fc1('0x34')](_0x3d9898['query'][_0x8fc1('0x34')]);_0x39fd1b['offset']=qs['offset'](_0x3d9898['query']['offset']);}_0x39fd1b[_0x8fc1('0x4e')]=qs[_0x8fc1('0x4f')](_0x3d9898[_0x8fc1('0x45')][_0x8fc1('0x4f')]);_0x39fd1b[_0x8fc1('0x50')]=qs[_0x8fc1('0x51')](_[_0x8fc1('0x52')](_0x3d9898['query'],_0xdc39e3[_0x8fc1('0x51')]),_0x54eeb3);if(_0x3d9898['query'][_0x8fc1('0x53')]){_0x39fd1b['where']=_['merge'](_0x39fd1b[_0x8fc1('0x50')],{'$or':_[_0x8fc1('0x44')](_0x54eeb3,function(_0x542634){if(_0x542634['type']!==_0x8fc1('0x54')){var _0x52efde={};_0x52efde[_0x542634[_0x8fc1('0x3f')]]={'$like':'%'+_0x3d9898['query'][_0x8fc1('0x53')]+'%'};return _0x52efde;}})});}_0x39fd1b=_[_0x8fc1('0x55')]({},_0x39fd1b,_0x3d9898[_0x8fc1('0x56')]);var _0x29ad45={'where':_0x39fd1b[_0x8fc1('0x50')]};return db[_0x8fc1('0x57')][_0x8fc1('0x35')](_0x29ad45)[_0x8fc1('0x23')](function(_0x5a1e2b){_0x1f477f[_0x8fc1('0x35')]=_0x5a1e2b;if(_0x3d9898[_0x8fc1('0x45')][_0x8fc1('0x58')]){_0x39fd1b[_0x8fc1('0x59')]=[{'all':!![]}];}return db[_0x8fc1('0x57')][_0x8fc1('0x5a')](_0x39fd1b);})['then'](function(_0x1b3f8a){_0x1f477f['rows']=_0x1b3f8a;return _0x1f477f;})[_0x8fc1('0x23')](respondWithFilteredResult(_0x11771b,_0x39fd1b))['catch'](handleError(_0x11771b,null));};exports[_0x8fc1('0x5b')]=function(_0x411551,_0x519962){var _0x34fd11={'raw':!![],'where':{'id':_0x411551['params']['id']}},_0xc0540c={};_0xc0540c[_0x8fc1('0x48')]=_[_0x8fc1('0x46')](db[_0x8fc1('0x57')]['rawAttributes']);_0xc0540c[_0x8fc1('0x45')]=_[_0x8fc1('0x46')](_0x411551['query']);_0xc0540c[_0x8fc1('0x51')]=_['intersection'](_0xc0540c[_0x8fc1('0x48')],_0xc0540c[_0x8fc1('0x45')]);_0x34fd11[_0x8fc1('0x49')]=_[_0x8fc1('0x47')](_0xc0540c[_0x8fc1('0x48')],qs[_0x8fc1('0x4a')](_0x411551[_0x8fc1('0x45')][_0x8fc1('0x4a')]));_0x34fd11[_0x8fc1('0x49')]=_0x34fd11[_0x8fc1('0x49')]['length']?_0x34fd11[_0x8fc1('0x49')]:_0xc0540c[_0x8fc1('0x48')];if(_0x411551[_0x8fc1('0x45')]['includeAll']){_0x34fd11[_0x8fc1('0x59')]=[{'all':!![]}];}_0x34fd11=_[_0x8fc1('0x55')]({},_0x34fd11,_0x411551['options']);return db[_0x8fc1('0x57')]['find'](_0x34fd11)[_0x8fc1('0x23')](handleEntityNotFound(_0x519962,null))[_0x8fc1('0x23')](respondWithResult(_0x519962,null))[_0x8fc1('0x2d')](handleError(_0x519962,null));};exports['create']=function(_0x15dd10,_0x2ab9df){return db[_0x8fc1('0x57')][_0x8fc1('0x5c')](_0x15dd10['body'],{})[_0x8fc1('0x23')](function(_0x41bcee){var _0x2c4351=_0x15dd10[_0x8fc1('0x5d')]['get']({'plain':!![]});if(!_0x2c4351)throw new Error(_0x8fc1('0x5e'));if(_0x2c4351[_0x8fc1('0x5f')]===_0x8fc1('0x5d')){var _0x7e6e94=_0x41bcee['get']({'plain':!![]});var _0x4833ab=_0x8fc1('0x60');return db['UserProfileSection'][_0x8fc1('0x61')]({'where':{'name':_0x4833ab,'userProfileId':_0x2c4351[_0x8fc1('0x62')]},'raw':!![]})[_0x8fc1('0x23')](function(_0x1aa39e){if(_0x1aa39e&&_0x1aa39e[_0x8fc1('0x63')]===0x0){return db['UserProfileResource'][_0x8fc1('0x5c')]({'name':_0x7e6e94[_0x8fc1('0x3f')],'resourceId':_0x7e6e94['id'],'type':_0x1aa39e[_0x8fc1('0x3f')],'sectionId':_0x1aa39e['id']},{})[_0x8fc1('0x23')](function(){return _0x41bcee;});}else{return _0x41bcee;}})[_0x8fc1('0x2d')](function(_0x10c7f7){logger[_0x8fc1('0x2a')](_0x8fc1('0x64'),_0x10c7f7);throw _0x10c7f7;});}return _0x41bcee;})[_0x8fc1('0x23')](respondWithResult(_0x2ab9df,0xc9))[_0x8fc1('0x2d')](handleError(_0x2ab9df,null));};exports[_0x8fc1('0x65')]=function(_0x4a2309,_0x3a4094){if(_0x4a2309[_0x8fc1('0x66')]['id']){delete _0x4a2309['body']['id'];}return db[_0x8fc1('0x57')]['find']({'where':{'id':_0x4a2309[_0x8fc1('0x67')]['id']}})[_0x8fc1('0x23')](handleEntityNotFound(_0x3a4094,null))[_0x8fc1('0x23')](saveUpdates(_0x4a2309['body'],null))[_0x8fc1('0x23')](respondWithResult(_0x3a4094,null))[_0x8fc1('0x2d')](handleError(_0x3a4094,null));};exports[_0x8fc1('0x3d')]=function(_0x48eb9a,_0x310ca2){return db['ChatQueue']['find']({'where':{'id':_0x48eb9a[_0x8fc1('0x67')]['id']}})['then'](handleEntityNotFound(_0x310ca2,null))[_0x8fc1('0x23')](removeEntity(_0x310ca2,null))[_0x8fc1('0x2d')](handleError(_0x310ca2,null));};exports[_0x8fc1('0x68')]=function(_0x372b44,_0xb84d9d){return db['ChatQueue'][_0x8fc1('0x68')]()[_0x8fc1('0x23')](respondWithResult(_0xb84d9d,null))[_0x8fc1('0x2d')](handleError(_0xb84d9d,null));};exports[_0x8fc1('0x69')]=function(_0x1c9f80,_0x42cbe5,_0x208948){var _0x589de0={'raw':!![],'where':{}},_0x21ac3f={},_0xe0ffff;return db[_0x8fc1('0x57')][_0x8fc1('0x6a')]({'where':{'id':_0x1c9f80[_0x8fc1('0x67')]['id']}})[_0x8fc1('0x23')](handleEntityNotFound(_0x42cbe5,null))[_0x8fc1('0x23')](function(_0x28e9a7){if(_0x28e9a7){_0xe0ffff=_0x28e9a7[_0x8fc1('0x3b')]({'plain':!![]});_0x21ac3f['model']=_[_0x8fc1('0x46')](db['UserChatQueue'][_0x8fc1('0x40')]);_0x21ac3f[_0x8fc1('0x45')]=_[_0x8fc1('0x46')](_0x1c9f80['query']);_0x21ac3f[_0x8fc1('0x51')]=_[_0x8fc1('0x47')](_0x21ac3f['model'],_0x21ac3f['query']);_0x589de0[_0x8fc1('0x49')]=_[_0x8fc1('0x47')](_0x21ac3f[_0x8fc1('0x48')],qs[_0x8fc1('0x4a')](_0x1c9f80[_0x8fc1('0x45')][_0x8fc1('0x4a')]));_0x589de0[_0x8fc1('0x49')]=_0x589de0[_0x8fc1('0x49')][_0x8fc1('0x4b')]?_0x589de0[_0x8fc1('0x49')]:_0x21ac3f[_0x8fc1('0x48')];if(!_0x1c9f80[_0x8fc1('0x45')]['hasOwnProperty']('nolimit')){_0x589de0[_0x8fc1('0x34')]=qs[_0x8fc1('0x34')](_0x1c9f80[_0x8fc1('0x45')][_0x8fc1('0x34')]);_0x589de0[_0x8fc1('0x32')]=qs[_0x8fc1('0x32')](_0x1c9f80[_0x8fc1('0x45')][_0x8fc1('0x32')]);}_0x589de0[_0x8fc1('0x4e')]=qs[_0x8fc1('0x4f')](_0x1c9f80[_0x8fc1('0x45')]['sort']);_0x589de0[_0x8fc1('0x50')]=qs[_0x8fc1('0x51')](_[_0x8fc1('0x52')](_0x1c9f80['query'],_0x21ac3f[_0x8fc1('0x51')]));_0x589de0['where'][_0x8fc1('0x6b')]=_0x28e9a7['id'];if(_0x1c9f80[_0x8fc1('0x45')]['filter']){_0x589de0[_0x8fc1('0x50')]=_[_0x8fc1('0x55')](_0x589de0[_0x8fc1('0x50')],{'$or':_[_0x8fc1('0x44')](_0x589de0[_0x8fc1('0x49')],function(_0x1dfcd0){var _0x4dd067={};_0x4dd067[_0x1dfcd0]={'$like':'%'+_0x1c9f80[_0x8fc1('0x45')]['filter']+'%'};return _0x4dd067;})});}_0x589de0=_[_0x8fc1('0x55')]({},_0x589de0,_0x1c9f80[_0x8fc1('0x56')]);return db['UserChatQueue'][_0x8fc1('0x5a')](_0x589de0);}})[_0x8fc1('0x23')](function(_0x3f7eb4){if(_0x3f7eb4){return db['User']['findAndCountAll']({'where':{'id':_[_0x8fc1('0x44')](_0x3f7eb4,_0x8fc1('0x6c')),'role':_0x8fc1('0x6d')},'attributes':['id','name',_0x8fc1('0x6e'),'updatedAt',_0x8fc1('0x6f')]});}})[_0x8fc1('0x23')](function(_0x5575dc){if(_0x5575dc){return{'count':_0x5575dc['count'],'rows':_[_0x8fc1('0x44')](_0x5575dc['rows'],function(_0x127210){return{'membername':_0x127210[_0x8fc1('0x3f')],'UserId':_0x127210['id'],'queue_name':_0xe0ffff['name'],'ChatQueueId':_0xe0ffff['id'],'interface':util[_0x8fc1('0x70')]('%s/%s','SIP',_0x127210[_0x8fc1('0x3f')]),'penalty':0x0,'paused':_0x127210['chatPause'],'createdAt':_0x127210[_0x8fc1('0x6f')],'updatedAt':_0x127210['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8fc1('0x23')](respondWithFilteredResult(_0x42cbe5,_0x589de0))[_0x8fc1('0x2d')](handleError(_0x42cbe5,null));};exports[_0x8fc1('0x71')]=function(_0x553c66,_0x200b65,_0x372f94){var _0x5bf3d0={};var _0x1b013f={};var _0x4ba9f4;var _0x3a79e4;return db[_0x8fc1('0x57')][_0x8fc1('0x6a')]({'where':{'id':_0x553c66[_0x8fc1('0x67')]['id']}})[_0x8fc1('0x23')](handleEntityNotFound(_0x200b65,null))['then'](function(_0x470fa4){if(_0x470fa4){_0x4ba9f4=_0x470fa4;_0x1b013f[_0x8fc1('0x48')]=_['keys'](db['Team']['rawAttributes']);_0x1b013f['query']=_[_0x8fc1('0x46')](_0x553c66['query']);_0x1b013f['filters']=_[_0x8fc1('0x47')](_0x1b013f[_0x8fc1('0x48')],_0x1b013f[_0x8fc1('0x45')]);_0x5bf3d0[_0x8fc1('0x49')]=_[_0x8fc1('0x47')](_0x1b013f[_0x8fc1('0x48')],qs[_0x8fc1('0x4a')](_0x553c66[_0x8fc1('0x45')][_0x8fc1('0x4a')]));_0x5bf3d0[_0x8fc1('0x49')]=_0x5bf3d0[_0x8fc1('0x49')][_0x8fc1('0x4b')]?_0x5bf3d0[_0x8fc1('0x49')]:_0x1b013f['model'];_0x5bf3d0['order']=qs[_0x8fc1('0x4f')](_0x553c66[_0x8fc1('0x45')]['sort']);_0x5bf3d0[_0x8fc1('0x50')]=qs[_0x8fc1('0x51')](_['pick'](_0x553c66[_0x8fc1('0x45')],_0x1b013f[_0x8fc1('0x51')]));if(_0x553c66['query']['filter']){_0x5bf3d0['where']=_[_0x8fc1('0x55')](_0x5bf3d0[_0x8fc1('0x50')],{'$or':_[_0x8fc1('0x44')](_0x5bf3d0['attributes'],function(_0x1cd499){var _0xcd80ef={};_0xcd80ef[_0x1cd499]={'$like':'%'+_0x553c66[_0x8fc1('0x45')][_0x8fc1('0x53')]+'%'};return _0xcd80ef;})});}_0x5bf3d0=_[_0x8fc1('0x55')]({},_0x5bf3d0,_0x553c66[_0x8fc1('0x56')]);return _0x4ba9f4[_0x8fc1('0x71')](_0x5bf3d0);}})[_0x8fc1('0x23')](function(_0x2deda9){if(_0x2deda9){_0x3a79e4=_0x2deda9[_0x8fc1('0x4b')];if(!_0x553c66[_0x8fc1('0x45')][_0x8fc1('0x4c')](_0x8fc1('0x4d'))){_0x5bf3d0['limit']=qs[_0x8fc1('0x34')](_0x553c66['query'][_0x8fc1('0x34')]);_0x5bf3d0[_0x8fc1('0x32')]=qs['offset'](_0x553c66[_0x8fc1('0x45')][_0x8fc1('0x32')]);}return _0x4ba9f4[_0x8fc1('0x71')](_0x5bf3d0);}})[_0x8fc1('0x23')](function(_0x2ea34e){if(_0x2ea34e){return _0x2ea34e?{'count':_0x3a79e4,'rows':_0x2ea34e}:null;}})['then'](respondWithResult(_0x200b65,null))[_0x8fc1('0x2d')](handleError(_0x200b65,null));};exports[_0x8fc1('0x72')]=function(_0x58c089,_0x520a3d,_0x2c4644){var _0x1ef84c=_0x58c089['body']['ids'];return db['Team'][_0x8fc1('0x5a')]({'where':{'id':_0x1ef84c},'attributes':['id'],'include':[{'model':db[_0x8fc1('0x73')],'as':_0x8fc1('0x74'),'attributes':['id',_0x8fc1('0x3f'),_0x8fc1('0x75'),'voicePause',_0x8fc1('0x76')],'raw':!![]}]})['then'](function(_0x3b2c10){if(_0x3b2c10){var _0x16fc71=_['flatMap'](_0x3b2c10,function(_0x3e56f2){var _0x278202=_0x3e56f2['get']({'plain':!![]});return _0x278202[_0x8fc1('0x74')];});return db[_0x8fc1('0x57')][_0x8fc1('0x61')]({'where':{'id':_0x58c089[_0x8fc1('0x67')]['id']}})[_0x8fc1('0x23')](function(_0x283407){return db[_0x8fc1('0x77')]['transaction'](function(_0x4179eb){return _0x283407['addTeams'](_0x1ef84c,{'transaction':_0x4179eb})[_0x8fc1('0x23')](function(){return BPromise[_0x8fc1('0x78')](_0x16fc71,function(_0x17f0f8){return db[_0x8fc1('0x79')][_0x8fc1('0x7a')]({'where':{'UserId':_0x17f0f8['id'],'ChatQueueId':_0x58c089['params']['id']},'transaction':_0x4179eb});});})[_0x8fc1('0x23')](function(){_0x16fc71['forEach'](function(_0x27e085){socket['emit']('userChatQueue:save',{'UserId':_0x27e085['id'],'ChatQueueId':_0x283407['id']});});});});});}})['then'](respondWithStatusCode(_0x520a3d,null))[_0x8fc1('0x2d')](handleError(_0x520a3d,null));};exports[_0x8fc1('0x7b')]=function(_0x17f0d6,_0x2394c4,_0x5da567){return db['Team'][_0x8fc1('0x5a')]({'where':{'id':_0x17f0d6['query'][_0x8fc1('0x7c')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8fc1('0x23')](handleEntityNotFound(_0x2394c4,null))[_0x8fc1('0x23')](function(_0x58e754){var _0xdda60e=_[_0x8fc1('0x44')](_0x58e754,'id');var _0x50bc47=[];var _0x249b7a=[];var _0xa8b307=squel[_0x8fc1('0x7d')]();_0xa8b307['field'](_0x8fc1('0x7e'))[_0x8fc1('0x7f')]('team_has_chat_queues','tq')[_0x8fc1('0x80')](_0x8fc1('0x81'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x8fc1('0x82'),_0x17f0d6[_0x8fc1('0x67')]['id']);for(var _0x161740=0x0;_0x161740<_0x58e754[_0x8fc1('0x4b')];_0x161740+=0x1){let _0x450019=_0x58e754[_0x161740];for(var _0x362a10=0x0;_0x362a10<_0x450019['Agents'][_0x8fc1('0x4b')];_0x362a10+=0x1){let _0x46aa9b=_0x450019[_0x8fc1('0x74')][_0x362a10];var _0x3b4c3e=_0xa8b307[_0x8fc1('0x83')]();_0x3b4c3e[_0x8fc1('0x50')](_0x8fc1('0x84'),_0x46aa9b['id']);_0x249b7a[_0x8fc1('0x85')](db[_0x8fc1('0x77')][_0x8fc1('0x45')](_0x3b4c3e[_0x8fc1('0x86')](),{'type':db[_0x8fc1('0x77')]['QueryTypes'][_0x8fc1('0x87')]})[_0x8fc1('0x23')](function(_0x2010f6){if(_0x2010f6[_0x8fc1('0x4b')]===0x1){return _0x46aa9b['id'];}else{var _0x2e6b8c=_[_0x8fc1('0x88')](_['map'](_0x2010f6,_0x8fc1('0x89')),function(_0x50b273){return _[_0x8fc1('0x8a')](_0xdda60e,_0x50b273);});if(_0x2e6b8c){return _0x46aa9b['id'];}}}));}}return BPromise[_0x8fc1('0x8b')](_0x249b7a)['then'](function(_0x3a0775){_0x50bc47=_(_0x50bc47)[_0x8fc1('0x8c')](_0x3a0775)[_0x8fc1('0x8d')]()[_0x8fc1('0x8e')]();return db['ChatQueue'][_0x8fc1('0x61')]({'where':{'id':_0x17f0d6[_0x8fc1('0x67')]['id']}})['then'](function(_0x41b2a6){return db['sequelize'][_0x8fc1('0x8f')](function(_0x539e3d){return _0x41b2a6[_0x8fc1('0x7b')](_0x17f0d6[_0x8fc1('0x45')][_0x8fc1('0x7c')],{'transaction':_0x539e3d})[_0x8fc1('0x23')](function(){if(!_[_0x8fc1('0x90')](_0x50bc47)){return _0x41b2a6[_0x8fc1('0x91')](_0x50bc47,{'transaction':_0x539e3d});}})[_0x8fc1('0x23')](function(){_0x50bc47[_0x8fc1('0x92')](function(_0x20c4df){socket[_0x8fc1('0x93')](_0x8fc1('0x94'),{'UserId':_0x20c4df,'ChatQueueId':_0x41b2a6['id']});});});});});});})['then'](respondWithStatusCode(_0x2394c4,null))[_0x8fc1('0x2d')](handleError(_0x2394c4,null));};exports['addAgents']=function(_0x3de89,_0x43e89a,_0x1ff9ad){return db[_0x8fc1('0x57')][_0x8fc1('0x61')]({'where':{'id':_0x3de89[_0x8fc1('0x67')]['id']}})[_0x8fc1('0x23')](handleEntityNotFound(_0x43e89a,null))[_0x8fc1('0x23')](function(_0x250c50){if(_0x250c50){return _0x250c50[_0x8fc1('0x95')](_0x3de89[_0x8fc1('0x66')][_0x8fc1('0x7c')],_[_0x8fc1('0x96')](_0x3de89[_0x8fc1('0x66')],[_0x8fc1('0x7c'),'id'])||{})[_0x8fc1('0x97')](function(_0x4b0d1d){for(var _0x2a193b=0x0;_0x2a193b<_0x3de89['body']['ids'][_0x8fc1('0x4b')];_0x2a193b+=0x1){socket[_0x8fc1('0x93')](_0x8fc1('0x98'),{'UserId':Number(_0x3de89[_0x8fc1('0x66')][_0x8fc1('0x7c')][_0x2a193b]),'ChatQueueId':Number(_0x3de89['params']['id'])});}return _0x4b0d1d;});}})[_0x8fc1('0x23')](respondWithResult(_0x43e89a,null))[_0x8fc1('0x2d')](handleError(_0x43e89a,null));};exports['removeAgents']=function(_0x28b78d,_0x1be480,_0x42c96e){return db[_0x8fc1('0x57')][_0x8fc1('0x61')]({'where':{'id':_0x28b78d[_0x8fc1('0x67')]['id']}})['then'](handleEntityNotFound(_0x1be480,null))[_0x8fc1('0x23')](function(_0x1e92de){if(_0x1e92de){return _0x1e92de[_0x8fc1('0x91')](_0x28b78d[_0x8fc1('0x45')][_0x8fc1('0x7c')])[_0x8fc1('0x23')](function(){if(_['isArray'](_0x28b78d[_0x8fc1('0x45')]['ids'])){for(var _0x1e859e=0x0;_0x1e859e<_0x28b78d[_0x8fc1('0x45')][_0x8fc1('0x7c')][_0x8fc1('0x4b')];_0x1e859e+=0x1){socket[_0x8fc1('0x93')]('userChatQueue:remove',{'UserId':Number(_0x28b78d['query']['ids'][_0x1e859e]),'ChatQueueId':Number(_0x28b78d[_0x8fc1('0x67')]['id'])});}}else{socket[_0x8fc1('0x93')]('userChatQueue:remove',{'UserId':Number(_0x28b78d[_0x8fc1('0x45')]['ids']),'ChatQueueId':Number(_0x28b78d[_0x8fc1('0x67')]['id'])});}});}})[_0x8fc1('0x23')](respondWithStatusCode(_0x1be480,null))[_0x8fc1('0x2d')](handleError(_0x1be480,null));};exports[_0x8fc1('0x99')]=function(_0x255809,_0x486794,_0x43a06f){var _0x197621={};var _0x4ad299={};var _0x35dc03;var _0x5e2c42;return db[_0x8fc1('0x57')][_0x8fc1('0x6a')]({'where':{'id':_0x255809[_0x8fc1('0x67')]['id']}})[_0x8fc1('0x23')](handleEntityNotFound(_0x486794,null))['then'](function(_0x3f2e7b){if(_0x3f2e7b){_0x35dc03=_0x3f2e7b;_0x4ad299[_0x8fc1('0x48')]=_['keys'](db[_0x8fc1('0x73')][_0x8fc1('0x40')]);_0x4ad299['query']=_['keys'](_0x255809[_0x8fc1('0x45')]);_0x4ad299[_0x8fc1('0x51')]=_[_0x8fc1('0x47')](_0x4ad299[_0x8fc1('0x48')],_0x4ad299[_0x8fc1('0x45')]);_0x197621[_0x8fc1('0x49')]=_[_0x8fc1('0x47')](_0x4ad299[_0x8fc1('0x48')],qs[_0x8fc1('0x4a')](_0x255809[_0x8fc1('0x45')][_0x8fc1('0x4a')]));_0x197621['attributes']=_0x197621['attributes']['length']?_0x197621[_0x8fc1('0x49')]:_0x4ad299[_0x8fc1('0x48')];_0x197621[_0x8fc1('0x4e')]=qs['sort'](_0x255809['query'][_0x8fc1('0x4f')]);_0x197621[_0x8fc1('0x50')]=qs[_0x8fc1('0x51')](_[_0x8fc1('0x52')](_0x255809[_0x8fc1('0x45')],_0x4ad299[_0x8fc1('0x51')]));if(_0x255809[_0x8fc1('0x45')][_0x8fc1('0x53')]){_0x197621[_0x8fc1('0x50')]=_[_0x8fc1('0x55')](_0x197621[_0x8fc1('0x50')],{'$or':_[_0x8fc1('0x44')](_0x197621['attributes'],function(_0x168b25){var _0x304098={};_0x304098[_0x168b25]={'$like':'%'+_0x255809['query'][_0x8fc1('0x53')]+'%'};return _0x304098;})});}_0x197621=_[_0x8fc1('0x55')]({},_0x197621,_0x255809[_0x8fc1('0x56')]);return _0x35dc03[_0x8fc1('0x99')](_0x197621);}})['then'](function(_0x2b5e27){if(_0x2b5e27){_0x5e2c42=_0x2b5e27[_0x8fc1('0x4b')];if(!_0x255809[_0x8fc1('0x45')][_0x8fc1('0x4c')](_0x8fc1('0x4d'))){_0x197621[_0x8fc1('0x34')]=qs['limit'](_0x255809[_0x8fc1('0x45')][_0x8fc1('0x34')]);_0x197621[_0x8fc1('0x32')]=qs[_0x8fc1('0x32')](_0x255809[_0x8fc1('0x45')][_0x8fc1('0x32')]);}return _0x35dc03[_0x8fc1('0x99')](_0x197621);}})[_0x8fc1('0x23')](function(_0x44c924){if(_0x44c924){return _0x44c924?{'count':_0x5e2c42,'rows':_0x44c924}:null;}})['then'](respondWithResult(_0x486794,null))[_0x8fc1('0x2d')](handleError(_0x486794,null));}; \ No newline at end of file +var _0x3465=['result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','ChatQueue','include','findAll','rows','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserChatQueue','order','pick','ChatQueueId','User','findAndCountAll','agent','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','addTeams','ids','online','flatMap','Agents','sequelize','transaction','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','userChatQueue:remove','addAgents','spread','removeAgents','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0x3465,0x6e));var _0x5346=function(_0x583ba8,_0x40bb0d){_0x583ba8=_0x583ba8-0x0;var _0x515683=_0x3465[_0x583ba8];return _0x515683;};'use strict';var emlformat=require(_0x5346('0x0'));var rimraf=require(_0x5346('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5346('0x2'));var rp=require(_0x5346('0x3'));var moment=require('moment');var BPromise=require(_0x5346('0x4'));var Mustache=require(_0x5346('0x5'));var util=require(_0x5346('0x6'));var path=require(_0x5346('0x7'));var sox=require(_0x5346('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5346('0x9'));var _=require(_0x5346('0xa'));var squel=require(_0x5346('0xb'));var crypto=require(_0x5346('0xc'));var jsforce=require(_0x5346('0xd'));var deskjs=require(_0x5346('0xe'));var toCsv=require(_0x5346('0xf'));var querystring=require(_0x5346('0x10'));var Papa=require(_0x5346('0x11'));var Redis=require(_0x5346('0x12'));var authService=require(_0x5346('0x13'));var qs=require(_0x5346('0x14'));var as=require(_0x5346('0x15'));var hardwareService=require(_0x5346('0x16'));var logger=require('../../config/logger')(_0x5346('0x17'));var utils=require('../../config/utils');var config=require(_0x5346('0x18'));var licenseUtil=require(_0x5346('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5346('0x1a')](config[_0x5346('0x1b')],{'host':_0x5346('0x1c'),'port':0x18eb});var socket=require(_0x5346('0x1d'))(new Redis(config[_0x5346('0x1b')]));require(_0x5346('0x1e'))[_0x5346('0x1f')](socket);var jayson=require(_0x5346('0x20'));var client=jayson[_0x5346('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57bf39,_0x18304b,_0x239fdf,_0x474407){return new BPromise(function(_0x5e250f,_0x597410){var _0x4eafc5=_0x474407||client;return _0x4eafc5['request'](_0x57bf39,_0x239fdf)[_0x5346('0x22')](function(_0x21dbe2){logger[_0x5346('0x23')]('ChatQueue,\x20%s,\x20%s',_0x18304b,_0x5346('0x24'));logger['debug'](_0x5346('0x25'),_0x18304b,_0x5346('0x24'),JSON[_0x5346('0x26')](_0x21dbe2));if(_0x21dbe2[_0x5346('0x27')]){if(_0x21dbe2[_0x5346('0x27')][_0x5346('0x28')]===0x1f4){logger[_0x5346('0x27')](_0x5346('0x29'),_0x18304b,_0x21dbe2[_0x5346('0x27')][_0x5346('0x2a')]);return _0x597410(_0x21dbe2['error'][_0x5346('0x2a')]);}logger[_0x5346('0x27')](_0x5346('0x29'),_0x18304b,_0x21dbe2['error'][_0x5346('0x2a')]);return _0x5e250f(_0x21dbe2['error'][_0x5346('0x2a')]);}else{logger[_0x5346('0x23')]('ChatQueue,\x20%s,\x20%s',_0x18304b,_0x5346('0x24'));_0x5e250f(_0x21dbe2[_0x5346('0x2b')][_0x5346('0x2a')]);}})[_0x5346('0x2c')](function(_0x1c3e36){logger[_0x5346('0x27')](_0x5346('0x29'),_0x18304b,_0x1c3e36);_0x597410(_0x1c3e36);});});}function respondWithStatusCode(_0x4619ae,_0x42086c){_0x42086c=_0x42086c||0xcc;return function(_0x2f5169){if(_0x2f5169){return _0x4619ae['sendStatus'](_0x42086c);}return _0x4619ae[_0x5346('0x2d')](_0x42086c)[_0x5346('0x2e')]();};}function respondWithResult(_0x40aafa,_0x7d8747){_0x7d8747=_0x7d8747||0xc8;return function(_0x569a48){if(_0x569a48){return _0x40aafa[_0x5346('0x2d')](_0x7d8747)[_0x5346('0x2f')](_0x569a48);}};}function respondWithFilteredResult(_0x141e24,_0x2a918b){return function(_0x5ed7f1){if(_0x5ed7f1){var _0x459ee7=typeof _0x2a918b[_0x5346('0x30')]===_0x5346('0x31')&&typeof _0x2a918b['limit']===_0x5346('0x31');var _0x302828=_0x5ed7f1['count'];var _0x4fbc8d=_0x459ee7?0x0:_0x2a918b['offset'];var _0x18c747=_0x459ee7?_0x5ed7f1[_0x5346('0x32')]:_0x2a918b['offset']+_0x2a918b[_0x5346('0x33')];var _0x9877f;if(_0x18c747>=_0x302828){_0x18c747=_0x302828;_0x9877f=0xc8;}else{_0x9877f=0xce;}_0x141e24[_0x5346('0x2d')](_0x9877f);return _0x141e24[_0x5346('0x34')](_0x5346('0x35'),_0x4fbc8d+'-'+_0x18c747+'/'+_0x302828)[_0x5346('0x2f')](_0x5ed7f1);}return null;};}function patchUpdates(_0x1f0f9d){return function(_0x4c4ed6){try{jsonpatch[_0x5346('0x36')](_0x4c4ed6,_0x1f0f9d,!![]);}catch(_0x43625e){return BPromise[_0x5346('0x37')](_0x43625e);}return _0x4c4ed6[_0x5346('0x38')]();};}function saveUpdates(_0x2e294c,_0x1f2d3e){return function(_0x5d1c40){if(_0x5d1c40){return _0x5d1c40[_0x5346('0x39')](_0x2e294c)['then'](function(_0x4335d6){return _0x4335d6;});}return null;};}function removeEntity(_0x5a0fff,_0x3c4331){return function(_0x38f80c){if(_0x38f80c){return _0x38f80c[_0x5346('0x3a')]()[_0x5346('0x22')](function(){var _0x17987c=_0x38f80c[_0x5346('0x3b')]({'plain':!![]});var _0x3fe2cb=_0x5346('0x3c');return db[_0x5346('0x3d')][_0x5346('0x3a')]({'where':{'type':_0x3fe2cb,'resourceId':_0x17987c['id']}})[_0x5346('0x22')](function(){return _0x38f80c;});})[_0x5346('0x22')](function(){_0x5a0fff[_0x5346('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19a13c,_0x32a8ea){return function(_0x5b8380){if(!_0x5b8380){_0x19a13c[_0x5346('0x3e')](0x194);}return _0x5b8380;};}function handleError(_0x52ff9d,_0xe44220){_0xe44220=_0xe44220||0x1f4;return function(_0x2008db){logger[_0x5346('0x27')](_0x2008db[_0x5346('0x3f')]);if(_0x2008db[_0x5346('0x40')]){delete _0x2008db['name'];}_0x52ff9d[_0x5346('0x2d')](_0xe44220)[_0x5346('0x41')](_0x2008db);};}exports[_0x5346('0x42')]=function(_0x85cc2b,_0x5cb986){var _0x5daa82={},_0x532eaf={},_0x1b4d2c={'count':0x0,'rows':[]};var _0x51fac8=_[_0x5346('0x43')](db['ChatQueue'][_0x5346('0x44')],function(_0x415d72){return{'name':_0x415d72[_0x5346('0x45')],'type':_0x415d72[_0x5346('0x46')][_0x5346('0x47')]};});_0x532eaf[_0x5346('0x48')]=_[_0x5346('0x43')](_0x51fac8,_0x5346('0x40'));_0x532eaf[_0x5346('0x49')]=_['keys'](_0x85cc2b[_0x5346('0x49')]);_0x532eaf['filters']=_[_0x5346('0x4a')](_0x532eaf[_0x5346('0x48')],_0x532eaf[_0x5346('0x49')]);_0x5daa82[_0x5346('0x4b')]=_['intersection'](_0x532eaf[_0x5346('0x48')],qs['fields'](_0x85cc2b[_0x5346('0x49')][_0x5346('0x4c')]));_0x5daa82[_0x5346('0x4b')]=_0x5daa82['attributes']['length']?_0x5daa82[_0x5346('0x4b')]:_0x532eaf[_0x5346('0x48')];if(!_0x85cc2b[_0x5346('0x49')][_0x5346('0x4d')](_0x5346('0x4e'))){_0x5daa82[_0x5346('0x33')]=qs[_0x5346('0x33')](_0x85cc2b[_0x5346('0x49')]['limit']);_0x5daa82[_0x5346('0x30')]=qs[_0x5346('0x30')](_0x85cc2b[_0x5346('0x49')]['offset']);}_0x5daa82['order']=qs[_0x5346('0x4f')](_0x85cc2b[_0x5346('0x49')]['sort']);_0x5daa82[_0x5346('0x50')]=qs[_0x5346('0x51')](_['pick'](_0x85cc2b['query'],_0x532eaf[_0x5346('0x51')]),_0x51fac8);if(_0x85cc2b[_0x5346('0x49')][_0x5346('0x52')]){_0x5daa82[_0x5346('0x50')]=_[_0x5346('0x53')](_0x5daa82[_0x5346('0x50')],{'$or':_[_0x5346('0x43')](_0x51fac8,function(_0x27180f){if(_0x27180f[_0x5346('0x46')]!==_0x5346('0x54')){var _0x11613a={};_0x11613a[_0x27180f[_0x5346('0x40')]]={'$like':'%'+_0x85cc2b[_0x5346('0x49')][_0x5346('0x52')]+'%'};return _0x11613a;}})});}_0x5daa82=_['merge']({},_0x5daa82,_0x85cc2b[_0x5346('0x55')]);var _0x285588={'where':_0x5daa82['where']};return db[_0x5346('0x56')][_0x5346('0x32')](_0x285588)[_0x5346('0x22')](function(_0x229789){_0x1b4d2c[_0x5346('0x32')]=_0x229789;if(_0x85cc2b[_0x5346('0x49')]['includeAll']){_0x5daa82[_0x5346('0x57')]=[{'all':!![]}];}return db[_0x5346('0x56')][_0x5346('0x58')](_0x5daa82);})[_0x5346('0x22')](function(_0x403751){_0x1b4d2c[_0x5346('0x59')]=_0x403751;return _0x1b4d2c;})['then'](respondWithFilteredResult(_0x5cb986,_0x5daa82))[_0x5346('0x2c')](handleError(_0x5cb986,null));};exports[_0x5346('0x5a')]=function(_0x36699c,_0x592fda){var _0x3406cd={'raw':!![],'where':{'id':_0x36699c[_0x5346('0x5b')]['id']}},_0x231bb7={};_0x231bb7[_0x5346('0x48')]=_[_0x5346('0x5c')](db[_0x5346('0x56')][_0x5346('0x44')]);_0x231bb7[_0x5346('0x49')]=_['keys'](_0x36699c['query']);_0x231bb7[_0x5346('0x51')]=_[_0x5346('0x4a')](_0x231bb7['model'],_0x231bb7[_0x5346('0x49')]);_0x3406cd[_0x5346('0x4b')]=_[_0x5346('0x4a')](_0x231bb7['model'],qs[_0x5346('0x4c')](_0x36699c[_0x5346('0x49')][_0x5346('0x4c')]));_0x3406cd[_0x5346('0x4b')]=_0x3406cd['attributes'][_0x5346('0x5d')]?_0x3406cd[_0x5346('0x4b')]:_0x231bb7[_0x5346('0x48')];if(_0x36699c['query']['includeAll']){_0x3406cd[_0x5346('0x57')]=[{'all':!![]}];}_0x3406cd=_['merge']({},_0x3406cd,_0x36699c[_0x5346('0x55')]);return db[_0x5346('0x56')][_0x5346('0x5e')](_0x3406cd)[_0x5346('0x22')](handleEntityNotFound(_0x592fda,null))['then'](respondWithResult(_0x592fda,null))[_0x5346('0x2c')](handleError(_0x592fda,null));};exports[_0x5346('0x5f')]=function(_0x4ccaa3,_0x4a2a13){return db[_0x5346('0x56')][_0x5346('0x5f')](_0x4ccaa3[_0x5346('0x60')],{})[_0x5346('0x22')](function(_0x59cb30){var _0x39fe6e=_0x4ccaa3[_0x5346('0x61')][_0x5346('0x3b')]({'plain':!![]});if(!_0x39fe6e)throw new Error(_0x5346('0x62'));if(_0x39fe6e[_0x5346('0x63')]===_0x5346('0x61')){var _0x2d38b9=_0x59cb30[_0x5346('0x3b')]({'plain':!![]});var _0x35a0e4=_0x5346('0x3c');return db['UserProfileSection'][_0x5346('0x5e')]({'where':{'name':_0x35a0e4,'userProfileId':_0x39fe6e[_0x5346('0x64')]},'raw':!![]})[_0x5346('0x22')](function(_0x3dc34d){if(_0x3dc34d&&_0x3dc34d['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2d38b9[_0x5346('0x40')],'resourceId':_0x2d38b9['id'],'type':_0x3dc34d['name'],'sectionId':_0x3dc34d['id']},{})[_0x5346('0x22')](function(){return _0x59cb30;});}else{return _0x59cb30;}})[_0x5346('0x2c')](function(_0x4641d2){logger[_0x5346('0x27')](_0x5346('0x65'),_0x4641d2);throw _0x4641d2;});}return _0x59cb30;})[_0x5346('0x22')](respondWithResult(_0x4a2a13,0xc9))['catch'](handleError(_0x4a2a13,null));};exports[_0x5346('0x39')]=function(_0x17bfba,_0x262020){if(_0x17bfba[_0x5346('0x60')]['id']){delete _0x17bfba[_0x5346('0x60')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x17bfba['params']['id']}})[_0x5346('0x22')](handleEntityNotFound(_0x262020,null))[_0x5346('0x22')](saveUpdates(_0x17bfba[_0x5346('0x60')],null))[_0x5346('0x22')](respondWithResult(_0x262020,null))[_0x5346('0x2c')](handleError(_0x262020,null));};exports['destroy']=function(_0x43d8ec,_0x59f746){return db[_0x5346('0x56')][_0x5346('0x5e')]({'where':{'id':_0x43d8ec[_0x5346('0x5b')]['id']}})[_0x5346('0x22')](handleEntityNotFound(_0x59f746,null))[_0x5346('0x22')](removeEntity(_0x59f746,null))[_0x5346('0x2c')](handleError(_0x59f746,null));};exports[_0x5346('0x66')]=function(_0x2279d3,_0x18d527){return db[_0x5346('0x56')][_0x5346('0x66')]()[_0x5346('0x22')](respondWithResult(_0x18d527,null))[_0x5346('0x2c')](handleError(_0x18d527,null));};exports[_0x5346('0x67')]=function(_0x31a9f8,_0xd7f89d,_0x45e3c0){var _0x354f7a={'raw':!![],'where':{}},_0x20857d={},_0x3cbc04;return db['ChatQueue']['findOne']({'where':{'id':_0x31a9f8['params']['id']}})[_0x5346('0x22')](handleEntityNotFound(_0xd7f89d,null))[_0x5346('0x22')](function(_0x21ccc7){if(_0x21ccc7){_0x3cbc04=_0x21ccc7[_0x5346('0x3b')]({'plain':!![]});_0x20857d[_0x5346('0x48')]=_[_0x5346('0x5c')](db[_0x5346('0x68')][_0x5346('0x44')]);_0x20857d['query']=_[_0x5346('0x5c')](_0x31a9f8[_0x5346('0x49')]);_0x20857d[_0x5346('0x51')]=_[_0x5346('0x4a')](_0x20857d[_0x5346('0x48')],_0x20857d[_0x5346('0x49')]);_0x354f7a['attributes']=_[_0x5346('0x4a')](_0x20857d[_0x5346('0x48')],qs['fields'](_0x31a9f8[_0x5346('0x49')]['fields']));_0x354f7a[_0x5346('0x4b')]=_0x354f7a[_0x5346('0x4b')][_0x5346('0x5d')]?_0x354f7a[_0x5346('0x4b')]:_0x20857d[_0x5346('0x48')];if(!_0x31a9f8[_0x5346('0x49')][_0x5346('0x4d')](_0x5346('0x4e'))){_0x354f7a[_0x5346('0x33')]=qs[_0x5346('0x33')](_0x31a9f8[_0x5346('0x49')][_0x5346('0x33')]);_0x354f7a[_0x5346('0x30')]=qs[_0x5346('0x30')](_0x31a9f8[_0x5346('0x49')]['offset']);}_0x354f7a[_0x5346('0x69')]=qs[_0x5346('0x4f')](_0x31a9f8['query'][_0x5346('0x4f')]);_0x354f7a[_0x5346('0x50')]=qs[_0x5346('0x51')](_[_0x5346('0x6a')](_0x31a9f8[_0x5346('0x49')],_0x20857d['filters']));_0x354f7a[_0x5346('0x50')][_0x5346('0x6b')]=_0x21ccc7['id'];if(_0x31a9f8[_0x5346('0x49')][_0x5346('0x52')]){_0x354f7a[_0x5346('0x50')]=_[_0x5346('0x53')](_0x354f7a[_0x5346('0x50')],{'$or':_[_0x5346('0x43')](_0x354f7a[_0x5346('0x4b')],function(_0x366331){var _0x5af2e0={};_0x5af2e0[_0x366331]={'$like':'%'+_0x31a9f8[_0x5346('0x49')][_0x5346('0x52')]+'%'};return _0x5af2e0;})});}_0x354f7a=_[_0x5346('0x53')]({},_0x354f7a,_0x31a9f8[_0x5346('0x55')]);return db[_0x5346('0x68')]['findAll'](_0x354f7a);}})[_0x5346('0x22')](function(_0x22b865){if(_0x22b865){return db[_0x5346('0x6c')][_0x5346('0x6d')]({'where':{'id':_[_0x5346('0x43')](_0x22b865,'UserId'),'role':_0x5346('0x6e')},'attributes':['id',_0x5346('0x40'),'chatPause',_0x5346('0x6f'),_0x5346('0x70')]});}})[_0x5346('0x22')](function(_0x397cc6){if(_0x397cc6){return{'count':_0x397cc6[_0x5346('0x32')],'rows':_[_0x5346('0x43')](_0x397cc6['rows'],function(_0x2c2ed4){return{'membername':_0x2c2ed4[_0x5346('0x40')],'UserId':_0x2c2ed4['id'],'queue_name':_0x3cbc04['name'],'ChatQueueId':_0x3cbc04['id'],'interface':util[_0x5346('0x71')](_0x5346('0x72'),'SIP',_0x2c2ed4['name']),'penalty':0x0,'paused':_0x2c2ed4['chatPause'],'createdAt':_0x2c2ed4[_0x5346('0x70')],'updatedAt':_0x2c2ed4[_0x5346('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5346('0x22')](respondWithFilteredResult(_0xd7f89d,_0x354f7a))[_0x5346('0x2c')](handleError(_0xd7f89d,null));};exports[_0x5346('0x73')]=function(_0x1efc79,_0x1fcb37,_0x38a941){var _0x2e7149={};var _0x5833b4={};var _0x4011d4;var _0x1e79b4;return db[_0x5346('0x56')][_0x5346('0x74')]({'where':{'id':_0x1efc79[_0x5346('0x5b')]['id']}})[_0x5346('0x22')](handleEntityNotFound(_0x1fcb37,null))['then'](function(_0x1ddec6){if(_0x1ddec6){_0x4011d4=_0x1ddec6;_0x5833b4[_0x5346('0x48')]=_[_0x5346('0x5c')](db[_0x5346('0x75')][_0x5346('0x44')]);_0x5833b4['query']=_[_0x5346('0x5c')](_0x1efc79[_0x5346('0x49')]);_0x5833b4[_0x5346('0x51')]=_[_0x5346('0x4a')](_0x5833b4[_0x5346('0x48')],_0x5833b4[_0x5346('0x49')]);_0x2e7149[_0x5346('0x4b')]=_['intersection'](_0x5833b4[_0x5346('0x48')],qs['fields'](_0x1efc79['query'][_0x5346('0x4c')]));_0x2e7149[_0x5346('0x4b')]=_0x2e7149[_0x5346('0x4b')][_0x5346('0x5d')]?_0x2e7149[_0x5346('0x4b')]:_0x5833b4[_0x5346('0x48')];_0x2e7149['order']=qs[_0x5346('0x4f')](_0x1efc79[_0x5346('0x49')][_0x5346('0x4f')]);_0x2e7149['where']=qs[_0x5346('0x51')](_[_0x5346('0x6a')](_0x1efc79[_0x5346('0x49')],_0x5833b4['filters']));if(_0x1efc79[_0x5346('0x49')][_0x5346('0x52')]){_0x2e7149['where']=_['merge'](_0x2e7149['where'],{'$or':_[_0x5346('0x43')](_0x2e7149[_0x5346('0x4b')],function(_0x7a7488){var _0x4073ea={};_0x4073ea[_0x7a7488]={'$like':'%'+_0x1efc79[_0x5346('0x49')][_0x5346('0x52')]+'%'};return _0x4073ea;})});}_0x2e7149=_[_0x5346('0x53')]({},_0x2e7149,_0x1efc79['options']);return _0x4011d4[_0x5346('0x73')](_0x2e7149);}})[_0x5346('0x22')](function(_0x3889ac){if(_0x3889ac){_0x1e79b4=_0x3889ac['length'];if(!_0x1efc79[_0x5346('0x49')][_0x5346('0x4d')]('nolimit')){_0x2e7149[_0x5346('0x33')]=qs[_0x5346('0x33')](_0x1efc79['query']['limit']);_0x2e7149['offset']=qs[_0x5346('0x30')](_0x1efc79[_0x5346('0x49')][_0x5346('0x30')]);}return _0x4011d4[_0x5346('0x73')](_0x2e7149);}})['then'](function(_0x4c8952){if(_0x4c8952){return _0x4c8952?{'count':_0x1e79b4,'rows':_0x4c8952}:null;}})['then'](respondWithResult(_0x1fcb37,null))[_0x5346('0x2c')](handleError(_0x1fcb37,null));};exports[_0x5346('0x76')]=function(_0x4905fd,_0x372416,_0x1333a9){var _0x3db77c=_0x4905fd[_0x5346('0x60')][_0x5346('0x77')];return db[_0x5346('0x75')][_0x5346('0x58')]({'where':{'id':_0x3db77c},'attributes':['id'],'include':[{'model':db[_0x5346('0x6c')],'as':'Agents','attributes':['id',_0x5346('0x40'),_0x5346('0x78'),'voicePause','interface'],'raw':!![]}]})[_0x5346('0x22')](function(_0x4e19dd){if(_0x4e19dd){var _0xb2c46=_[_0x5346('0x79')](_0x4e19dd,function(_0x4bd2f2){var _0x5dd48b=_0x4bd2f2[_0x5346('0x3b')]({'plain':!![]});return _0x5dd48b[_0x5346('0x7a')];});return db[_0x5346('0x56')][_0x5346('0x5e')]({'where':{'id':_0x4905fd[_0x5346('0x5b')]['id']}})[_0x5346('0x22')](function(_0x20c6f9){return db[_0x5346('0x7b')][_0x5346('0x7c')](function(_0x2a43c4){return _0x20c6f9[_0x5346('0x76')](_0x3db77c,{'transaction':_0x2a43c4})[_0x5346('0x22')](function(){return BPromise['each'](_0xb2c46,function(_0x7d7a90){return db[_0x5346('0x68')][_0x5346('0x7d')]({'where':{'UserId':_0x7d7a90['id'],'ChatQueueId':_0x4905fd[_0x5346('0x5b')]['id']},'transaction':_0x2a43c4});});})[_0x5346('0x22')](function(){_0xb2c46[_0x5346('0x7e')](function(_0x264123){socket[_0x5346('0x7f')](_0x5346('0x80'),{'UserId':_0x264123['id'],'ChatQueueId':_0x20c6f9['id']});});});});});}})[_0x5346('0x22')](respondWithStatusCode(_0x372416,null))[_0x5346('0x2c')](handleError(_0x372416,null));};exports[_0x5346('0x81')]=function(_0x376a07,_0x26dba4,_0x24ffce){return db[_0x5346('0x75')][_0x5346('0x58')]({'where':{'id':_0x376a07[_0x5346('0x49')][_0x5346('0x77')]},'attributes':['id'],'include':[{'model':db[_0x5346('0x6c')],'as':_0x5346('0x7a'),'attributes':['id'],'raw':!![]}]})[_0x5346('0x22')](handleEntityNotFound(_0x26dba4,null))[_0x5346('0x22')](function(_0x244042){var _0x1d03c0=_[_0x5346('0x43')](_0x244042,'id');var _0x5efaff=[];var _0x87164=[];var _0x435a31=squel[_0x5346('0x82')]();_0x435a31[_0x5346('0x83')]('tq.TeamId')['from']('team_has_chat_queues','tq')[_0x5346('0x84')](_0x5346('0x85'),'ut',_0x5346('0x86'))[_0x5346('0x50')](_0x5346('0x87'),_0x376a07[_0x5346('0x5b')]['id']);for(var _0x430700=0x0;_0x430700<_0x244042[_0x5346('0x5d')];_0x430700+=0x1){let _0x84c226=_0x244042[_0x430700];for(var _0x5622d4=0x0;_0x5622d4<_0x84c226['Agents']['length'];_0x5622d4+=0x1){let _0x1094a3=_0x84c226[_0x5346('0x7a')][_0x5622d4];var _0x958494=_0x435a31[_0x5346('0x88')]();_0x958494[_0x5346('0x50')](_0x5346('0x89'),_0x1094a3['id']);_0x87164['push'](db[_0x5346('0x7b')][_0x5346('0x49')](_0x958494[_0x5346('0x8a')](),{'type':db[_0x5346('0x7b')]['QueryTypes'][_0x5346('0x8b')]})[_0x5346('0x22')](function(_0x6e6885){if(_0x6e6885[_0x5346('0x5d')]===0x1){return _0x1094a3['id'];}else{var _0x13e940=_[_0x5346('0x8c')](_['map'](_0x6e6885,_0x5346('0x8d')),function(_0x25bb24){return _[_0x5346('0x8e')](_0x1d03c0,_0x25bb24);});if(_0x13e940){return _0x1094a3['id'];}}}));}}return BPromise[_0x5346('0x8f')](_0x87164)[_0x5346('0x22')](function(_0x4c3bd6){_0x5efaff=_(_0x5efaff)[_0x5346('0x90')](_0x4c3bd6)[_0x5346('0x91')]()[_0x5346('0x92')]();return db[_0x5346('0x56')][_0x5346('0x5e')]({'where':{'id':_0x376a07[_0x5346('0x5b')]['id']}})[_0x5346('0x22')](function(_0xdc21aa){return db[_0x5346('0x7b')][_0x5346('0x7c')](function(_0x54ab71){return _0xdc21aa[_0x5346('0x81')](_0x376a07[_0x5346('0x49')][_0x5346('0x77')],{'transaction':_0x54ab71})[_0x5346('0x22')](function(){if(!_[_0x5346('0x93')](_0x5efaff)){return _0xdc21aa['removeAgents'](_0x5efaff,{'transaction':_0x54ab71});}})['then'](function(){_0x5efaff[_0x5346('0x7e')](function(_0x33304b){socket[_0x5346('0x7f')](_0x5346('0x94'),{'UserId':_0x33304b,'ChatQueueId':_0xdc21aa['id']});});});});});});})[_0x5346('0x22')](respondWithStatusCode(_0x26dba4,null))[_0x5346('0x2c')](handleError(_0x26dba4,null));};exports['addAgents']=function(_0x51097c,_0x44dd3f,_0x183b47){return db['ChatQueue'][_0x5346('0x5e')]({'where':{'id':_0x51097c[_0x5346('0x5b')]['id']}})[_0x5346('0x22')](handleEntityNotFound(_0x44dd3f,null))[_0x5346('0x22')](function(_0x2514d9){if(_0x2514d9){return _0x2514d9[_0x5346('0x95')](_0x51097c[_0x5346('0x60')][_0x5346('0x77')],_['omit'](_0x51097c[_0x5346('0x60')],['ids','id'])||{})[_0x5346('0x96')](function(_0x11ff87){for(var _0x1f9630=0x0;_0x1f9630<_0x51097c['body']['ids'][_0x5346('0x5d')];_0x1f9630+=0x1){socket[_0x5346('0x7f')](_0x5346('0x80'),{'UserId':Number(_0x51097c[_0x5346('0x60')][_0x5346('0x77')][_0x1f9630]),'ChatQueueId':Number(_0x51097c[_0x5346('0x5b')]['id'])});}return _0x11ff87;});}})[_0x5346('0x22')](respondWithResult(_0x44dd3f,null))[_0x5346('0x2c')](handleError(_0x44dd3f,null));};exports[_0x5346('0x97')]=function(_0x488585,_0x537d5e,_0x476116){return db['ChatQueue']['find']({'where':{'id':_0x488585[_0x5346('0x5b')]['id']}})[_0x5346('0x22')](handleEntityNotFound(_0x537d5e,null))[_0x5346('0x22')](function(_0x25b4b9){if(_0x25b4b9){return _0x25b4b9['removeAgents'](_0x488585[_0x5346('0x49')][_0x5346('0x77')])['then'](function(){if(_['isArray'](_0x488585['query'][_0x5346('0x77')])){for(var _0xe990b3=0x0;_0xe990b3<_0x488585[_0x5346('0x49')][_0x5346('0x77')][_0x5346('0x5d')];_0xe990b3+=0x1){socket[_0x5346('0x7f')](_0x5346('0x94'),{'UserId':Number(_0x488585['query'][_0x5346('0x77')][_0xe990b3]),'ChatQueueId':Number(_0x488585[_0x5346('0x5b')]['id'])});}}else{socket[_0x5346('0x7f')](_0x5346('0x94'),{'UserId':Number(_0x488585[_0x5346('0x49')][_0x5346('0x77')]),'ChatQueueId':Number(_0x488585[_0x5346('0x5b')]['id'])});}});}})[_0x5346('0x22')](respondWithStatusCode(_0x537d5e,null))[_0x5346('0x2c')](handleError(_0x537d5e,null));};exports[_0x5346('0x98')]=function(_0x1cf58b,_0x241004,_0x3f6eed){var _0x106c60={};var _0x25e271={};var _0x3587ce;var _0x2ba96e;return db['ChatQueue'][_0x5346('0x74')]({'where':{'id':_0x1cf58b[_0x5346('0x5b')]['id']}})[_0x5346('0x22')](handleEntityNotFound(_0x241004,null))['then'](function(_0x2d1e65){if(_0x2d1e65){_0x3587ce=_0x2d1e65;_0x25e271['model']=_['keys'](db[_0x5346('0x6c')][_0x5346('0x44')]);_0x25e271[_0x5346('0x49')]=_[_0x5346('0x5c')](_0x1cf58b[_0x5346('0x49')]);_0x25e271['filters']=_[_0x5346('0x4a')](_0x25e271[_0x5346('0x48')],_0x25e271[_0x5346('0x49')]);_0x106c60[_0x5346('0x4b')]=_[_0x5346('0x4a')](_0x25e271['model'],qs['fields'](_0x1cf58b[_0x5346('0x49')][_0x5346('0x4c')]));_0x106c60[_0x5346('0x4b')]=_0x106c60[_0x5346('0x4b')][_0x5346('0x5d')]?_0x106c60[_0x5346('0x4b')]:_0x25e271[_0x5346('0x48')];_0x106c60['order']=qs['sort'](_0x1cf58b[_0x5346('0x49')]['sort']);_0x106c60[_0x5346('0x50')]=qs[_0x5346('0x51')](_[_0x5346('0x6a')](_0x1cf58b[_0x5346('0x49')],_0x25e271[_0x5346('0x51')]));if(_0x1cf58b[_0x5346('0x49')]['filter']){_0x106c60[_0x5346('0x50')]=_['merge'](_0x106c60[_0x5346('0x50')],{'$or':_[_0x5346('0x43')](_0x106c60[_0x5346('0x4b')],function(_0xe1dc18){var _0x4a0b18={};_0x4a0b18[_0xe1dc18]={'$like':'%'+_0x1cf58b[_0x5346('0x49')][_0x5346('0x52')]+'%'};return _0x4a0b18;})});}_0x106c60=_['merge']({},_0x106c60,_0x1cf58b[_0x5346('0x55')]);return _0x3587ce[_0x5346('0x98')](_0x106c60);}})['then'](function(_0x487c8){if(_0x487c8){_0x2ba96e=_0x487c8[_0x5346('0x5d')];if(!_0x1cf58b[_0x5346('0x49')][_0x5346('0x4d')]('nolimit')){_0x106c60['limit']=qs[_0x5346('0x33')](_0x1cf58b['query'][_0x5346('0x33')]);_0x106c60[_0x5346('0x30')]=qs[_0x5346('0x30')](_0x1cf58b['query'][_0x5346('0x30')]);}return _0x3587ce[_0x5346('0x98')](_0x106c60);}})[_0x5346('0x22')](function(_0xc1ef7b){if(_0xc1ef7b){return _0xc1ef7b?{'count':_0x2ba96e,'rows':_0xc1ef7b}:null;}})['then'](respondWithResult(_0x241004,null))['catch'](handleError(_0x241004,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 4011e2e..ca55fd1 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 _0xe5e7=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x1d0764,_0x2beb7c){var _0x423f49=function(_0x5334ee){while(--_0x5334ee){_0x1d0764['push'](_0x1d0764['shift']());}};_0x423f49(++_0x2beb7c);}(_0xe5e7,0x1ee));var _0x7e5e=function(_0xb72675,_0xae6a45){_0xb72675=_0xb72675-0x0;var _0x1a1d2e=_0xe5e7[_0xb72675];return _0x1a1d2e;};'use strict';var EventEmitter=require(_0x7e5e('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7e5e('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7e5e('0x2'),'afterDestroy':_0x7e5e('0x3')};function emitEvent(_0x14d122){return function(_0x336f3f,_0x1de085,_0xb36e08){ChatQueueEvents['emit'](_0x14d122+':'+_0x336f3f['id'],_0x336f3f);ChatQueueEvents[_0x7e5e('0x4')](_0x14d122,_0x336f3f);_0xb36e08(null);};}for(var e in events){if(events[_0x7e5e('0x5')](e)){var event=events[e];ChatQueue[_0x7e5e('0x6')](e,emitEvent(event));}}module[_0x7e5e('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x1195=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','remove'];(function(_0x1dc0d6,_0xa034fc){var _0x2d848c=function(_0x2494e5){while(--_0x2494e5){_0x1dc0d6['push'](_0x1dc0d6['shift']());}};_0x2d848c(++_0xa034fc);}(_0x1195,0xc4));var _0x5119=function(_0x29e4c0,_0xf8b14d){_0x29e4c0=_0x29e4c0-0x0;var _0x15b64b=_0x1195[_0x29e4c0];return _0x15b64b;};'use strict';var EventEmitter=require(_0x5119('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5119('0x1')](0x0);var events={'afterCreate':_0x5119('0x2'),'afterUpdate':'update','afterDestroy':_0x5119('0x3')};function emitEvent(_0x53400c){return function(_0x233402,_0x1e1546,_0x567cf9){ChatQueueEvents[_0x5119('0x4')](_0x53400c+':'+_0x233402['id'],_0x233402);ChatQueueEvents['emit'](_0x53400c,_0x233402);_0x567cf9(null);};}for(var e in events){if(events[_0x5119('0x5')](e)){var event=events[e];ChatQueue[_0x5119('0x6')](e,emitEvent(event));}}module[_0x5119('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index ee1c6bf..afc63cb 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 _0x33c6=['ChatQueue','chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x33c6,0xd2));var _0x633c=function(_0x4da9d8,_0x42fb50){_0x4da9d8=_0x4da9d8-0x0;var _0x468872=_0x33c6[_0x4da9d8];return _0x468872;};'use strict';var _=require('lodash');var util=require(_0x633c('0x0'));var logger=require(_0x633c('0x1'))(_0x633c('0x2'));var moment=require(_0x633c('0x3'));var BPromise=require(_0x633c('0x4'));var rp=require(_0x633c('0x5'));var fs=require('fs');var path=require(_0x633c('0x6'));var rimraf=require('rimraf');var config=require(_0x633c('0x7'));var attributes=require(_0x633c('0x8'));module[_0x633c('0x9')]=function(_0x41e5f4,_0x4872e0){return _0x41e5f4[_0x633c('0xa')](_0x633c('0xb'),attributes,{'tableName':_0x633c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8837=['moment','bluebird','path','rimraf','exports','define','ChatQueue','chat_queues','lodash','../../config/logger','api'];(function(_0x432e72,_0x247efd){var _0x432ccd=function(_0x280670){while(--_0x280670){_0x432e72['push'](_0x432e72['shift']());}};_0x432ccd(++_0x247efd);}(_0x8837,0xd9));var _0x7883=function(_0x38e8ef,_0x59ae9a){_0x38e8ef=_0x38e8ef-0x0;var _0x310744=_0x8837[_0x38e8ef];return _0x310744;};'use strict';var _=require(_0x7883('0x0'));var util=require('util');var logger=require(_0x7883('0x1'))(_0x7883('0x2'));var moment=require(_0x7883('0x3'));var BPromise=require(_0x7883('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7883('0x5'));var rimraf=require(_0x7883('0x6'));var config=require('../../config/environment');var attributes=require('./chatQueue.attributes');module[_0x7883('0x7')]=function(_0x25e248,_0x557e03){return _0x25e248[_0x7883('0x8')](_0x7883('0x9'),attributes,{'tableName':_0x7883('0xa'),'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 edffbd0..702ed13 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 _0xc15c=['http','redis','localhost','socket.io-emitter','./chatQueue.socket','request','then','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','findAll','options','where','attributes','limit','include','model','map','info','debug','ChatQueue','find','raw','ShowChatQueue','moment','bluebird','randomstring','../../mysqldb','rpc','client'];(function(_0x47c199,_0x4ba09f){var _0x60c20b=function(_0x134218){while(--_0x134218){_0x47c199['push'](_0x47c199['shift']());}};_0x60c20b(++_0x4ba09f);}(_0xc15c,0xae));var _0xcc15=function(_0xee78c0,_0x23a380){_0xee78c0=_0xee78c0-0x0;var _0x294bec=_0xc15c[_0xee78c0];return _0x294bec;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcc15('0x0'));var BPromise=require(_0xcc15('0x1'));var rs=require(_0xcc15('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc15('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcc15('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcc15('0x5')][_0xcc15('0x6')]({'port':0x232a});config['redis']=_['defaults'](config[_0xcc15('0x7')],{'host':_0xcc15('0x8'),'port':0x18eb});var socket=require(_0xcc15('0x9'))(new Redis(config[_0xcc15('0x7')]));require(_0xcc15('0xa'))['register'](socket);function respondWithRpcPromise(_0x355a96,_0x363e58,_0x24316b){return new BPromise(function(_0x391197,_0x55a853){return client[_0xcc15('0xb')](_0x355a96,_0x24316b)[_0xcc15('0xc')](function(_0x40dded){logger['info']('ChatQueue,\x20%s,\x20%s',_0x363e58,_0xcc15('0xd'));logger['debug'](_0xcc15('0xe'),_0x363e58,'request\x20sent',JSON[_0xcc15('0xf')](_0x40dded));if(_0x40dded['error']){if(_0x40dded[_0xcc15('0x10')]['code']===0x1f4){logger[_0xcc15('0x10')](_0xcc15('0x11'),_0x363e58,_0x40dded[_0xcc15('0x10')][_0xcc15('0x12')]);return _0x55a853(_0x40dded['error']['message']);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x363e58,_0x40dded[_0xcc15('0x10')][_0xcc15('0x12')]);return _0x391197(_0x40dded[_0xcc15('0x10')]['message']);}else{logger['info'](_0xcc15('0x11'),_0x363e58,'request\x20sent');_0x391197(_0x40dded[_0xcc15('0x13')][_0xcc15('0x12')]);}})[_0xcc15('0x14')](function(_0x47a574){logger['error'](_0xcc15('0x11'),_0x363e58,_0x47a574);_0x55a853(_0x47a574);});});}exports[_0xcc15('0x15')]=function(_0x590809){var _0x25de95=this;return new Promise(function(_0x3254a9,_0x3f574c){return db['ChatQueue'][_0xcc15('0x16')]({'raw':_0x590809['options']?_0x590809[_0xcc15('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x590809[_0xcc15('0x17')]?_0x590809[_0xcc15('0x17')][_0xcc15('0x18')]||null:null,'attributes':_0x590809[_0xcc15('0x17')]?_0x590809['options'][_0xcc15('0x19')]||null:null,'limit':_0x590809[_0xcc15('0x17')]?_0x590809[_0xcc15('0x17')][_0xcc15('0x1a')]||null:null,'include':_0x590809['options']?_0x590809[_0xcc15('0x17')][_0xcc15('0x1b')]?_['map'](_0x590809['options'][_0xcc15('0x1b')],function(_0x3ebade){return{'model':db[_0x3ebade[_0xcc15('0x1c')]],'as':_0x3ebade['as'],'attributes':_0x3ebade[_0xcc15('0x19')],'include':_0x3ebade['include']?_[_0xcc15('0x1d')](_0x3ebade[_0xcc15('0x1b')],function(_0x4f4af8){return{'model':db[_0x4f4af8[_0xcc15('0x1c')]],'as':_0x4f4af8['as'],'attributes':_0x4f4af8['attributes'],'include':_0x4f4af8['include']?_[_0xcc15('0x1d')](_0x4f4af8['include'],function(_0x481c4e){return{'model':db[_0x481c4e[_0xcc15('0x1c')]],'as':_0x481c4e['as'],'attributes':_0x481c4e[_0xcc15('0x19')]};}):[]};}):[]};}):[]:[]})[_0xcc15('0xc')](function(_0x171a09){logger[_0xcc15('0x1e')]('GetChatQueue',_0x590809);logger[_0xcc15('0x1f')](_0xcc15('0x15'),_0x590809,JSON[_0xcc15('0xf')](_0x171a09));_0x3254a9(_0x171a09);})[_0xcc15('0x14')](function(_0x3c6102){logger[_0xcc15('0x10')](_0xcc15('0x15'),_0x3c6102[_0xcc15('0x12')],_0x590809);_0x3f574c(_0x25de95[_0xcc15('0x10')](0x1f4,_0x3c6102[_0xcc15('0x12')]));});});};exports['ShowChatQueue']=function(_0x57db3e){var _0x21b2fd=this;return new Promise(function(_0x4698e1,_0xf2b71c){return db[_0xcc15('0x20')][_0xcc15('0x21')]({'raw':_0x57db3e[_0xcc15('0x17')]?_0x57db3e['options'][_0xcc15('0x22')]===undefined?!![]:![]:!![],'where':_0x57db3e['options']?_0x57db3e[_0xcc15('0x17')][_0xcc15('0x18')]||null:null,'attributes':_0x57db3e[_0xcc15('0x17')]?_0x57db3e[_0xcc15('0x17')][_0xcc15('0x19')]||null:null,'include':_0x57db3e[_0xcc15('0x17')]?_0x57db3e[_0xcc15('0x17')][_0xcc15('0x1b')]?_[_0xcc15('0x1d')](_0x57db3e[_0xcc15('0x17')]['include'],function(_0xb0116){return{'model':db[_0xb0116[_0xcc15('0x1c')]],'as':_0xb0116['as'],'attributes':_0xb0116[_0xcc15('0x19')],'include':_0xb0116[_0xcc15('0x1b')]?_[_0xcc15('0x1d')](_0xb0116['include'],function(_0x3f8cd1){return{'model':db[_0x3f8cd1[_0xcc15('0x1c')]],'as':_0x3f8cd1['as'],'attributes':_0x3f8cd1[_0xcc15('0x19')],'include':_0x3f8cd1['include']?_['map'](_0x3f8cd1[_0xcc15('0x1b')],function(_0x979923){return{'model':db[_0x979923['model']],'as':_0x979923['as'],'attributes':_0x979923[_0xcc15('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x69ba47){logger[_0xcc15('0x1e')](_0xcc15('0x23'),_0x57db3e);logger[_0xcc15('0x1f')]('ShowChatQueue',_0x57db3e,JSON[_0xcc15('0xf')](_0x69ba47));_0x4698e1(_0x69ba47);})[_0xcc15('0x14')](function(_0x2d769a){logger[_0xcc15('0x10')](_0xcc15('0x23'),_0x2d769a[_0xcc15('0x12')],_0x57db3e);_0xf2b71c(_0x21b2fd[_0xcc15('0x10')](0x1f4,_0x2d769a[_0xcc15('0x12')]));});});}; \ No newline at end of file +var _0x1f75=['catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowChatQueue','find','stringify','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x3e531a,_0x28a82a){var _0x3c2574=function(_0x4a0c98){while(--_0x4a0c98){_0x3e531a['push'](_0x3e531a['shift']());}};_0x3c2574(++_0x28a82a);}(_0x1f75,0x13c));var _0x51f7=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x1f75[_0x4fde08];return _0x12e725;};'use strict';var _=require('lodash');var util=require(_0x51f7('0x0'));var moment=require(_0x51f7('0x1'));var BPromise=require(_0x51f7('0x2'));var rs=require(_0x51f7('0x3'));var fs=require('fs');var Redis=require(_0x51f7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x51f7('0x5'));var logger=require(_0x51f7('0x6'))(_0x51f7('0x7'));var config=require(_0x51f7('0x8'));var jayson=require(_0x51f7('0x9'));var client=jayson[_0x51f7('0xa')][_0x51f7('0xb')]({'port':0x232a});config[_0x51f7('0xc')]=_[_0x51f7('0xd')](config[_0x51f7('0xc')],{'host':_0x51f7('0xe'),'port':0x18eb});var socket=require(_0x51f7('0xf'))(new Redis(config['redis']));require(_0x51f7('0x10'))[_0x51f7('0x11')](socket);function respondWithRpcPromise(_0x4d7014,_0x11e24c,_0x3ad08e){return new BPromise(function(_0x4c5629,_0x4ddeb4){return client[_0x51f7('0x12')](_0x4d7014,_0x3ad08e)[_0x51f7('0x13')](function(_0x55e3cd){logger[_0x51f7('0x14')](_0x51f7('0x15'),_0x11e24c,'request\x20sent');logger[_0x51f7('0x16')](_0x51f7('0x17'),_0x11e24c,_0x51f7('0x18'),JSON['stringify'](_0x55e3cd));if(_0x55e3cd['error']){if(_0x55e3cd[_0x51f7('0x19')][_0x51f7('0x1a')]===0x1f4){logger[_0x51f7('0x19')](_0x51f7('0x15'),_0x11e24c,_0x55e3cd[_0x51f7('0x19')][_0x51f7('0x1b')]);return _0x4ddeb4(_0x55e3cd['error'][_0x51f7('0x1b')]);}logger[_0x51f7('0x19')](_0x51f7('0x15'),_0x11e24c,_0x55e3cd[_0x51f7('0x19')][_0x51f7('0x1b')]);return _0x4c5629(_0x55e3cd[_0x51f7('0x19')][_0x51f7('0x1b')]);}else{logger['info'](_0x51f7('0x15'),_0x11e24c,_0x51f7('0x18'));_0x4c5629(_0x55e3cd['result'][_0x51f7('0x1b')]);}})[_0x51f7('0x1c')](function(_0x4dfdef){logger['error']('ChatQueue,\x20%s,\x20%s',_0x11e24c,_0x4dfdef);_0x4ddeb4(_0x4dfdef);});});}exports[_0x51f7('0x1d')]=function(_0x5a4e63){var _0x5c869a=this;return new Promise(function(_0x293eee,_0x1decc1){return db[_0x51f7('0x1e')][_0x51f7('0x1f')]({'raw':_0x5a4e63[_0x51f7('0x20')]?_0x5a4e63[_0x51f7('0x20')][_0x51f7('0x21')]===undefined?!![]:![]:!![],'where':_0x5a4e63[_0x51f7('0x20')]?_0x5a4e63['options'][_0x51f7('0x22')]||null:null,'attributes':_0x5a4e63['options']?_0x5a4e63[_0x51f7('0x20')][_0x51f7('0x23')]||null:null,'limit':_0x5a4e63[_0x51f7('0x20')]?_0x5a4e63[_0x51f7('0x20')][_0x51f7('0x24')]||null:null,'include':_0x5a4e63[_0x51f7('0x20')]?_0x5a4e63[_0x51f7('0x20')][_0x51f7('0x25')]?_[_0x51f7('0x26')](_0x5a4e63[_0x51f7('0x20')][_0x51f7('0x25')],function(_0x47ed7c){return{'model':db[_0x47ed7c[_0x51f7('0x27')]],'as':_0x47ed7c['as'],'attributes':_0x47ed7c[_0x51f7('0x23')],'include':_0x47ed7c[_0x51f7('0x25')]?_['map'](_0x47ed7c[_0x51f7('0x25')],function(_0x11e723){return{'model':db[_0x11e723[_0x51f7('0x27')]],'as':_0x11e723['as'],'attributes':_0x11e723[_0x51f7('0x23')],'include':_0x11e723['include']?_[_0x51f7('0x26')](_0x11e723[_0x51f7('0x25')],function(_0x1d8bf6){return{'model':db[_0x1d8bf6[_0x51f7('0x27')]],'as':_0x1d8bf6['as'],'attributes':_0x1d8bf6[_0x51f7('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x31cf1f){logger[_0x51f7('0x14')](_0x51f7('0x1d'),_0x5a4e63);logger['debug'](_0x51f7('0x1d'),_0x5a4e63,JSON['stringify'](_0x31cf1f));_0x293eee(_0x31cf1f);})['catch'](function(_0x12a9ce){logger[_0x51f7('0x19')](_0x51f7('0x1d'),_0x12a9ce[_0x51f7('0x1b')],_0x5a4e63);_0x1decc1(_0x5c869a[_0x51f7('0x19')](0x1f4,_0x12a9ce[_0x51f7('0x1b')]));});});};exports[_0x51f7('0x28')]=function(_0x5d7dec){var _0x4a8ee1=this;return new Promise(function(_0x411f39,_0x3e3078){return db[_0x51f7('0x1e')][_0x51f7('0x29')]({'raw':_0x5d7dec[_0x51f7('0x20')]?_0x5d7dec[_0x51f7('0x20')][_0x51f7('0x21')]===undefined?!![]:![]:!![],'where':_0x5d7dec[_0x51f7('0x20')]?_0x5d7dec[_0x51f7('0x20')]['where']||null:null,'attributes':_0x5d7dec[_0x51f7('0x20')]?_0x5d7dec['options'][_0x51f7('0x23')]||null:null,'include':_0x5d7dec['options']?_0x5d7dec[_0x51f7('0x20')]['include']?_[_0x51f7('0x26')](_0x5d7dec['options'][_0x51f7('0x25')],function(_0x2506da){return{'model':db[_0x2506da[_0x51f7('0x27')]],'as':_0x2506da['as'],'attributes':_0x2506da['attributes'],'include':_0x2506da[_0x51f7('0x25')]?_[_0x51f7('0x26')](_0x2506da['include'],function(_0x537d7d){return{'model':db[_0x537d7d['model']],'as':_0x537d7d['as'],'attributes':_0x537d7d[_0x51f7('0x23')],'include':_0x537d7d[_0x51f7('0x25')]?_[_0x51f7('0x26')](_0x537d7d['include'],function(_0x8f385e){return{'model':db[_0x8f385e[_0x51f7('0x27')]],'as':_0x8f385e['as'],'attributes':_0x8f385e[_0x51f7('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12aaa5){logger[_0x51f7('0x14')](_0x51f7('0x28'),_0x5d7dec);logger['debug'](_0x51f7('0x28'),_0x5d7dec,JSON[_0x51f7('0x2a')](_0x12aaa5));_0x411f39(_0x12aaa5);})[_0x51f7('0x1c')](function(_0x48ba5b){logger[_0x51f7('0x19')](_0x51f7('0x28'),_0x48ba5b[_0x51f7('0x1b')],_0x5d7dec);_0x3e3078(_0x4a8ee1[_0x51f7('0x19')](0x1f4,_0x48ba5b[_0x51f7('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index e1ad1dc..ebe9ae2 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 _0x3667=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x87c64,_0x54f61a){var _0x30ad6e=function(_0x5871d9){while(--_0x5871d9){_0x87c64['push'](_0x87c64['shift']());}};_0x30ad6e(++_0x54f61a);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var ChatQueueEvents=require(_0x7366('0x0'));var events=[_0x7366('0x1'),_0x7366('0x2'),_0x7366('0x3')];function createListener(_0x3c601d,_0x5d1072){return function(_0x27a90d){_0x5d1072[_0x7366('0x4')](_0x3c601d,_0x27a90d);};}function removeListener(_0x4b32a7,_0x27726b){return function(){ChatQueueEvents[_0x7366('0x5')](_0x4b32a7,_0x27726b);};}exports[_0x7366('0x6')]=function(_0x1c0cf4){for(var _0x101e3d=0x0,_0x589397=events[_0x7366('0x7')];_0x101e3d<_0x589397;_0x101e3d++){var _0xa1a3c5=events[_0x101e3d];var _0x2dd32b=createListener(_0x7366('0x8')+_0xa1a3c5,_0x1c0cf4);ChatQueueEvents['on'](_0xa1a3c5,_0x2dd32b);}}; \ No newline at end of file +var _0xf3cd=['remove','update','emit','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2459fd,_0x575d9b){_0x2459fd=_0x2459fd-0x0;var _0x364cd2=_0xf3cd[_0x2459fd];return _0x364cd2;};'use strict';var ChatQueueEvents=require(_0xdf3c('0x0'));var events=[_0xdf3c('0x1'),_0xdf3c('0x2'),_0xdf3c('0x3')];function createListener(_0x1839ec,_0x433a7f){return function(_0x54db05){_0x433a7f[_0xdf3c('0x4')](_0x1839ec,_0x54db05);};}function removeListener(_0x71b446,_0x9f71cb){return function(){ChatQueueEvents['removeListener'](_0x71b446,_0x9f71cb);};}exports[_0xdf3c('0x5')]=function(_0x17d42a){for(var _0x1313d5=0x0,_0x1f0601=events[_0xdf3c('0x6')];_0x1313d5<_0x1f0601;_0x1313d5++){var _0x28edae=events[_0x1313d5];var _0x52c073=createListener(_0xdf3c('0x7')+_0x28edae,_0x17d42a);ChatQueueEvents['on'](_0x28edae,_0x52c073);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 7172ddb..46a6ec4 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 _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x521010,_0x2b9c5a){var _0x2f5e4f=function(_0x542e49){while(--_0x542e49){_0x521010['push'](_0x521010['shift']());}};_0x2f5e4f(++_0x2b9c5a);}(_0x7217,0x19e));var _0x7721=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x7217[_0x3c2a69];return _0x596bc8;};'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['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file +var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x5fc3,0xa8));var _0x35fc=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x5fc3[_0x422905];return _0x33dc6c;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 2723934..04df73a 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 _0xfbd8=['STRING','DATE','moment','sequelize','exports'];(function(_0x3be036,_0x1a88a4){var _0x3751c7=function(_0x1daa6b){while(--_0x1daa6b){_0x3be036['push'](_0x3be036['shift']());}};_0x3751c7(++_0x1a88a4);}(_0xfbd8,0x1ba));var _0x8fbd=function(_0x557f5f,_0x31d8e7){_0x557f5f=_0x557f5f-0x0;var _0x196eba=_0xfbd8[_0x557f5f];return _0x196eba;};'use strict';var moment=require(_0x8fbd('0x0'));var Sequelize=require(_0x8fbd('0x1'));module[_0x8fbd('0x2')]={'uniqueid':{'type':Sequelize[_0x8fbd('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x8fbd('0x3')]},'joinAt':{'type':Sequelize[_0x8fbd('0x4')]},'leaveAt':{'type':Sequelize[_0x8fbd('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8fbd('0x4')]},'reason':{'type':Sequelize[_0x8fbd('0x3')]}}; \ No newline at end of file +var _0xa786=['DATE','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa786,0x1d2));var _0x6a78=function(_0x230ba8,_0x2fa3ba){_0x230ba8=_0x230ba8-0x0;var _0x4a3d66=_0xa786[_0x230ba8];return _0x4a3d66;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x6a78('0x0')]={'uniqueid':{'type':Sequelize[_0x6a78('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x6a78('0x1')]},'joinAt':{'type':Sequelize[_0x6a78('0x2')]},'leaveAt':{'type':Sequelize[_0x6a78('0x2')]},'acceptAt':{'type':Sequelize[_0x6a78('0x2')]},'exitAt':{'type':Sequelize[_0x6a78('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 222fb3d..071d91f 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 _0x19fb=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','map','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','ChatQueueReport','findAll','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x369b7b,_0x3135a9){var _0x45f573=function(_0x175203){while(--_0x175203){_0x369b7b['push'](_0x369b7b['shift']());}};_0x45f573(++_0x3135a9);}(_0x19fb,0xdd));var _0xb19f=function(_0x12e6b5,_0x2ea21a){_0x12e6b5=_0x12e6b5-0x0;var _0x2a0a23=_0x19fb[_0x12e6b5];return _0x2a0a23;};'use strict';var emlformat=require(_0xb19f('0x0'));var rimraf=require(_0xb19f('0x1'));var zipdir=require(_0xb19f('0x2'));var jsonpatch=require(_0xb19f('0x3'));var rp=require(_0xb19f('0x4'));var moment=require(_0xb19f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb19f('0x6'));var path=require(_0xb19f('0x7'));var sox=require(_0xb19f('0x8'));var csv=require(_0xb19f('0x9'));var ejs=require(_0xb19f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb19f('0xb'));var squel=require(_0xb19f('0xc'));var crypto=require(_0xb19f('0xd'));var jsforce=require(_0xb19f('0xe'));var deskjs=require(_0xb19f('0xf'));var toCsv=require(_0xb19f('0x9'));var querystring=require(_0xb19f('0x10'));var Papa=require(_0xb19f('0x11'));var Redis=require('ioredis');var authService=require(_0xb19f('0x12'));var qs=require(_0xb19f('0x13'));var as=require(_0xb19f('0x14'));var hardwareService=require(_0xb19f('0x15'));var logger=require(_0xb19f('0x16'))(_0xb19f('0x17'));var utils=require(_0xb19f('0x18'));var config=require(_0xb19f('0x19'));var licenseUtil=require(_0xb19f('0x1a'));var db=require(_0xb19f('0x1b'))['db'];function respondWithStatusCode(_0x22272f,_0x26a1d1){_0x26a1d1=_0x26a1d1||0xcc;return function(_0xc4a0b5){if(_0xc4a0b5){return _0x22272f[_0xb19f('0x1c')](_0x26a1d1);}return _0x22272f[_0xb19f('0x1d')](_0x26a1d1)['end']();};}function respondWithResult(_0x214290,_0x3482f9){_0x3482f9=_0x3482f9||0xc8;return function(_0x34518a){if(_0x34518a){return _0x214290['status'](_0x3482f9)[_0xb19f('0x1e')](_0x34518a);}};}function respondWithFilteredResult(_0x13ebd4,_0x46b688){return function(_0x5640ea){if(_0x5640ea){var _0x11318c=typeof _0x46b688[_0xb19f('0x1f')]===_0xb19f('0x20')&&typeof _0x46b688['limit']===_0xb19f('0x20');var _0x49d304=_0x5640ea['count'];var _0x5b52d9=_0x11318c?0x0:_0x46b688[_0xb19f('0x1f')];var _0x3b4367=_0x11318c?_0x5640ea[_0xb19f('0x21')]:_0x46b688[_0xb19f('0x1f')]+_0x46b688['limit'];var _0x2aedec;if(_0x3b4367>=_0x49d304){_0x3b4367=_0x49d304;_0x2aedec=0xc8;}else{_0x2aedec=0xce;}_0x13ebd4[_0xb19f('0x1d')](_0x2aedec);return _0x13ebd4['set'](_0xb19f('0x22'),_0x5b52d9+'-'+_0x3b4367+'/'+_0x49d304)['json'](_0x5640ea);}return null;};}function patchUpdates(_0x3950c9){return function(_0x2acb39){try{jsonpatch[_0xb19f('0x23')](_0x2acb39,_0x3950c9,!![]);}catch(_0xb449b4){return BPromise[_0xb19f('0x24')](_0xb449b4);}return _0x2acb39[_0xb19f('0x25')]();};}function saveUpdates(_0x333198,_0x4eb288){return function(_0x9ab8fc){if(_0x9ab8fc){return _0x9ab8fc[_0xb19f('0x26')](_0x333198)[_0xb19f('0x27')](function(_0x34c638){return _0x34c638;});}return null;};}function removeEntity(_0x47e313,_0x25fbdc){return function(_0x33b4ad){if(_0x33b4ad){return _0x33b4ad[_0xb19f('0x28')]()[_0xb19f('0x27')](function(){_0x47e313[_0xb19f('0x1d')](0xcc)[_0xb19f('0x29')]();});}};}function handleEntityNotFound(_0x28e0ad,_0x388b28){return function(_0xf528d){if(!_0xf528d){_0x28e0ad[_0xb19f('0x1c')](0x194);}return _0xf528d;};}function handleError(_0x2e0544,_0x59ccde){_0x59ccde=_0x59ccde||0x1f4;return function(_0x3e1365){logger[_0xb19f('0x2a')](_0x3e1365['stack']);if(_0x3e1365[_0xb19f('0x2b')]){delete _0x3e1365[_0xb19f('0x2b')];}_0x2e0544['status'](_0x59ccde)['send'](_0x3e1365);};}exports[_0xb19f('0x2c')]=function(_0x17c22d,_0x3d2f84){var _0x46abbe={},_0x5e479a={},_0x5043b2={'count':0x0,'rows':[]};var _0x5e4a74=_[_0xb19f('0x2d')](db['ChatQueueReport']['rawAttributes'],function(_0x4b06eb){return{'name':_0x4b06eb[_0xb19f('0x2e')],'type':_0x4b06eb[_0xb19f('0x2f')][_0xb19f('0x30')]};});_0x5e479a[_0xb19f('0x31')]=_[_0xb19f('0x2d')](_0x5e4a74,_0xb19f('0x2b'));_0x5e479a['query']=_[_0xb19f('0x32')](_0x17c22d[_0xb19f('0x33')]);_0x5e479a['filters']=_[_0xb19f('0x34')](_0x5e479a[_0xb19f('0x31')],_0x5e479a[_0xb19f('0x33')]);_0x46abbe[_0xb19f('0x35')]=_[_0xb19f('0x34')](_0x5e479a[_0xb19f('0x31')],qs['fields'](_0x17c22d[_0xb19f('0x33')][_0xb19f('0x36')]));_0x46abbe[_0xb19f('0x35')]=_0x46abbe[_0xb19f('0x35')][_0xb19f('0x37')]?_0x46abbe[_0xb19f('0x35')]:_0x5e479a['model'];if(!_0x17c22d[_0xb19f('0x33')][_0xb19f('0x38')](_0xb19f('0x39'))){_0x46abbe[_0xb19f('0x3a')]=qs[_0xb19f('0x3a')](_0x17c22d[_0xb19f('0x33')]['limit']);_0x46abbe[_0xb19f('0x1f')]=qs[_0xb19f('0x1f')](_0x17c22d[_0xb19f('0x33')][_0xb19f('0x1f')]);}_0x46abbe[_0xb19f('0x3b')]=qs[_0xb19f('0x3c')](_0x17c22d[_0xb19f('0x33')]['sort']);_0x46abbe[_0xb19f('0x3d')]=qs['filters'](_[_0xb19f('0x3e')](_0x17c22d[_0xb19f('0x33')],_0x5e479a[_0xb19f('0x3f')]),_0x5e4a74);if(_0x17c22d['query'][_0xb19f('0x40')]){_0x46abbe['where']=_[_0xb19f('0x41')](_0x46abbe[_0xb19f('0x3d')],{'$or':_['map'](_0x5e4a74,function(_0x1e0a79){if(_0x1e0a79[_0xb19f('0x2f')]!==_0xb19f('0x42')){var _0x13afe8={};_0x13afe8[_0x1e0a79['name']]={'$like':'%'+_0x17c22d[_0xb19f('0x33')][_0xb19f('0x40')]+'%'};return _0x13afe8;}})});}_0x46abbe=_[_0xb19f('0x41')]({},_0x46abbe,_0x17c22d[_0xb19f('0x43')]);var _0x2b4b5d={'where':_0x46abbe[_0xb19f('0x3d')]};return db['ChatQueueReport'][_0xb19f('0x21')](_0x2b4b5d)['then'](function(_0x1b85f6){_0x5043b2['count']=_0x1b85f6;if(_0x17c22d[_0xb19f('0x33')][_0xb19f('0x44')]){_0x46abbe['include']=[{'all':!![]}];}return db[_0xb19f('0x45')][_0xb19f('0x46')](_0x46abbe);})[_0xb19f('0x27')](function(_0x13cae8){_0x5043b2['rows']=_0x13cae8;return _0x5043b2;})[_0xb19f('0x27')](respondWithFilteredResult(_0x3d2f84,_0x46abbe))[_0xb19f('0x47')](handleError(_0x3d2f84,null));};exports[_0xb19f('0x48')]=function(_0x52c368,_0x2c68de){var _0x5772ac={'raw':!![],'where':{'id':_0x52c368[_0xb19f('0x49')]['id']}},_0x16bf0d={};_0x16bf0d[_0xb19f('0x31')]=_[_0xb19f('0x32')](db[_0xb19f('0x45')][_0xb19f('0x4a')]);_0x16bf0d[_0xb19f('0x33')]=_[_0xb19f('0x32')](_0x52c368['query']);_0x16bf0d[_0xb19f('0x3f')]=_[_0xb19f('0x34')](_0x16bf0d['model'],_0x16bf0d[_0xb19f('0x33')]);_0x5772ac[_0xb19f('0x35')]=_[_0xb19f('0x34')](_0x16bf0d['model'],qs[_0xb19f('0x36')](_0x52c368['query'][_0xb19f('0x36')]));_0x5772ac['attributes']=_0x5772ac[_0xb19f('0x35')]['length']?_0x5772ac[_0xb19f('0x35')]:_0x16bf0d[_0xb19f('0x31')];if(_0x52c368[_0xb19f('0x33')]['includeAll']){_0x5772ac['include']=[{'all':!![]}];}_0x5772ac=_[_0xb19f('0x41')]({},_0x5772ac,_0x52c368[_0xb19f('0x43')]);return db[_0xb19f('0x45')]['find'](_0x5772ac)['then'](handleEntityNotFound(_0x2c68de,null))['then'](respondWithResult(_0x2c68de,null))[_0xb19f('0x47')](handleError(_0x2c68de,null));};exports[_0xb19f('0x4b')]=function(_0x5dbfdc,_0x194910){return db['ChatQueueReport'][_0xb19f('0x4b')](_0x5dbfdc[_0xb19f('0x4c')],{})[_0xb19f('0x27')](respondWithResult(_0x194910,0xc9))[_0xb19f('0x47')](handleError(_0x194910,null));};exports[_0xb19f('0x26')]=function(_0x401787,_0x20da72){if(_0x401787[_0xb19f('0x4c')]['id']){delete _0x401787[_0xb19f('0x4c')]['id'];}return db[_0xb19f('0x45')][_0xb19f('0x4d')]({'where':{'id':_0x401787['params']['id']}})['then'](handleEntityNotFound(_0x20da72,null))[_0xb19f('0x27')](saveUpdates(_0x401787[_0xb19f('0x4c')],null))[_0xb19f('0x27')](respondWithResult(_0x20da72,null))[_0xb19f('0x47')](handleError(_0x20da72,null));};exports[_0xb19f('0x28')]=function(_0x57812a,_0x58b3c5){return db[_0xb19f('0x45')]['find']({'where':{'id':_0x57812a[_0xb19f('0x49')]['id']}})[_0xb19f('0x27')](handleEntityNotFound(_0x58b3c5,null))[_0xb19f('0x27')](removeEntity(_0x58b3c5,null))['catch'](handleError(_0x58b3c5,null));};exports[_0xb19f('0x4e')]=function(_0x12b227,_0x1b7e57){return db[_0xb19f('0x45')][_0xb19f('0x4e')]()[_0xb19f('0x27')](respondWithResult(_0x1b7e57,null))[_0xb19f('0x47')](handleError(_0x1b7e57,null));}; \ No newline at end of file +var _0x9fd4=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','ChatQueueReport','rawAttributes','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','include','findAll','rows','catch','params','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x9fd4,0x16c));var _0x49fd=function(_0x461eaa,_0x5b9604){_0x461eaa=_0x461eaa-0x0;var _0x3f2756=_0x9fd4[_0x461eaa];return _0x3f2756;};'use strict';var emlformat=require(_0x49fd('0x0'));var rimraf=require(_0x49fd('0x1'));var zipdir=require(_0x49fd('0x2'));var jsonpatch=require(_0x49fd('0x3'));var rp=require(_0x49fd('0x4'));var moment=require(_0x49fd('0x5'));var BPromise=require(_0x49fd('0x6'));var Mustache=require(_0x49fd('0x7'));var util=require(_0x49fd('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x49fd('0x9'));var ejs=require(_0x49fd('0xa'));var fs=require('fs');var fs_extra=require(_0x49fd('0xb'));var _=require(_0x49fd('0xc'));var squel=require('squel');var crypto=require(_0x49fd('0xd'));var jsforce=require(_0x49fd('0xe'));var deskjs=require(_0x49fd('0xf'));var toCsv=require(_0x49fd('0x9'));var querystring=require(_0x49fd('0x10'));var Papa=require('papaparse');var Redis=require(_0x49fd('0x11'));var authService=require(_0x49fd('0x12'));var qs=require(_0x49fd('0x13'));var as=require(_0x49fd('0x14'));var hardwareService=require(_0x49fd('0x15'));var logger=require(_0x49fd('0x16'))(_0x49fd('0x17'));var utils=require('../../config/utils');var config=require(_0x49fd('0x18'));var licenseUtil=require(_0x49fd('0x19'));var db=require(_0x49fd('0x1a'))['db'];function respondWithStatusCode(_0x40d1b0,_0x15dabd){_0x15dabd=_0x15dabd||0xcc;return function(_0x206bd8){if(_0x206bd8){return _0x40d1b0[_0x49fd('0x1b')](_0x15dabd);}return _0x40d1b0[_0x49fd('0x1c')](_0x15dabd)[_0x49fd('0x1d')]();};}function respondWithResult(_0x652890,_0x157b09){_0x157b09=_0x157b09||0xc8;return function(_0x44c18c){if(_0x44c18c){return _0x652890[_0x49fd('0x1c')](_0x157b09)[_0x49fd('0x1e')](_0x44c18c);}};}function respondWithFilteredResult(_0x264ab1,_0x201109){return function(_0x2859f2){if(_0x2859f2){var _0x3ca675=typeof _0x201109[_0x49fd('0x1f')]===_0x49fd('0x20')&&typeof _0x201109[_0x49fd('0x21')]===_0x49fd('0x20');var _0x320fe5=_0x2859f2[_0x49fd('0x22')];var _0xb55d24=_0x3ca675?0x0:_0x201109[_0x49fd('0x1f')];var _0x598793=_0x3ca675?_0x2859f2[_0x49fd('0x22')]:_0x201109[_0x49fd('0x1f')]+_0x201109['limit'];var _0x5c323a;if(_0x598793>=_0x320fe5){_0x598793=_0x320fe5;_0x5c323a=0xc8;}else{_0x5c323a=0xce;}_0x264ab1[_0x49fd('0x1c')](_0x5c323a);return _0x264ab1['set'](_0x49fd('0x23'),_0xb55d24+'-'+_0x598793+'/'+_0x320fe5)[_0x49fd('0x1e')](_0x2859f2);}return null;};}function patchUpdates(_0x599315){return function(_0xf7efcf){try{jsonpatch[_0x49fd('0x24')](_0xf7efcf,_0x599315,!![]);}catch(_0x5ae3bc){return BPromise[_0x49fd('0x25')](_0x5ae3bc);}return _0xf7efcf[_0x49fd('0x26')]();};}function saveUpdates(_0x2e1c40,_0x290f59){return function(_0x20fa0d){if(_0x20fa0d){return _0x20fa0d[_0x49fd('0x27')](_0x2e1c40)['then'](function(_0x46019d){return _0x46019d;});}return null;};}function removeEntity(_0xd43815,_0x8f202b){return function(_0x4bf811){if(_0x4bf811){return _0x4bf811[_0x49fd('0x28')]()[_0x49fd('0x29')](function(){_0xd43815[_0x49fd('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x597161,_0x497469){return function(_0x13c5a8){if(!_0x13c5a8){_0x597161[_0x49fd('0x1b')](0x194);}return _0x13c5a8;};}function handleError(_0x4ec190,_0x302ab2){_0x302ab2=_0x302ab2||0x1f4;return function(_0x9587b9){logger[_0x49fd('0x2a')](_0x9587b9[_0x49fd('0x2b')]);if(_0x9587b9[_0x49fd('0x2c')]){delete _0x9587b9['name'];}_0x4ec190[_0x49fd('0x1c')](_0x302ab2)['send'](_0x9587b9);};}exports[_0x49fd('0x2d')]=function(_0x89badc,_0x54acb5){var _0x203038={},_0x2c8568={},_0x23374c={'count':0x0,'rows':[]};var _0x43826f=_[_0x49fd('0x2e')](db[_0x49fd('0x2f')][_0x49fd('0x30')],function(_0x242203){return{'name':_0x242203['fieldName'],'type':_0x242203[_0x49fd('0x31')]['key']};});_0x2c8568[_0x49fd('0x32')]=_['map'](_0x43826f,_0x49fd('0x2c'));_0x2c8568[_0x49fd('0x33')]=_[_0x49fd('0x34')](_0x89badc['query']);_0x2c8568['filters']=_['intersection'](_0x2c8568[_0x49fd('0x32')],_0x2c8568[_0x49fd('0x33')]);_0x203038['attributes']=_[_0x49fd('0x35')](_0x2c8568['model'],qs['fields'](_0x89badc[_0x49fd('0x33')][_0x49fd('0x36')]));_0x203038[_0x49fd('0x37')]=_0x203038[_0x49fd('0x37')][_0x49fd('0x38')]?_0x203038['attributes']:_0x2c8568['model'];if(!_0x89badc[_0x49fd('0x33')][_0x49fd('0x39')](_0x49fd('0x3a'))){_0x203038[_0x49fd('0x21')]=qs['limit'](_0x89badc[_0x49fd('0x33')][_0x49fd('0x21')]);_0x203038[_0x49fd('0x1f')]=qs[_0x49fd('0x1f')](_0x89badc[_0x49fd('0x33')][_0x49fd('0x1f')]);}_0x203038[_0x49fd('0x3b')]=qs[_0x49fd('0x3c')](_0x89badc[_0x49fd('0x33')][_0x49fd('0x3c')]);_0x203038[_0x49fd('0x3d')]=qs['filters'](_[_0x49fd('0x3e')](_0x89badc[_0x49fd('0x33')],_0x2c8568[_0x49fd('0x3f')]),_0x43826f);if(_0x89badc[_0x49fd('0x33')][_0x49fd('0x40')]){_0x203038[_0x49fd('0x3d')]=_[_0x49fd('0x41')](_0x203038[_0x49fd('0x3d')],{'$or':_[_0x49fd('0x2e')](_0x43826f,function(_0x4a1856){if(_0x4a1856[_0x49fd('0x31')]!=='VIRTUAL'){var _0x46e84c={};_0x46e84c[_0x4a1856[_0x49fd('0x2c')]]={'$like':'%'+_0x89badc['query'][_0x49fd('0x40')]+'%'};return _0x46e84c;}})});}_0x203038=_[_0x49fd('0x41')]({},_0x203038,_0x89badc['options']);var _0x1f9a65={'where':_0x203038['where']};return db['ChatQueueReport']['count'](_0x1f9a65)[_0x49fd('0x29')](function(_0x32982e){_0x23374c[_0x49fd('0x22')]=_0x32982e;if(_0x89badc[_0x49fd('0x33')]['includeAll']){_0x203038[_0x49fd('0x42')]=[{'all':!![]}];}return db[_0x49fd('0x2f')][_0x49fd('0x43')](_0x203038);})[_0x49fd('0x29')](function(_0x115c5a){_0x23374c[_0x49fd('0x44')]=_0x115c5a;return _0x23374c;})[_0x49fd('0x29')](respondWithFilteredResult(_0x54acb5,_0x203038))[_0x49fd('0x45')](handleError(_0x54acb5,null));};exports['show']=function(_0x255a73,_0x2c8ab1){var _0x4dce94={'raw':!![],'where':{'id':_0x255a73[_0x49fd('0x46')]['id']}},_0x3be41b={};_0x3be41b['model']=_[_0x49fd('0x34')](db['ChatQueueReport'][_0x49fd('0x30')]);_0x3be41b[_0x49fd('0x33')]=_[_0x49fd('0x34')](_0x255a73[_0x49fd('0x33')]);_0x3be41b['filters']=_['intersection'](_0x3be41b[_0x49fd('0x32')],_0x3be41b['query']);_0x4dce94[_0x49fd('0x37')]=_[_0x49fd('0x35')](_0x3be41b[_0x49fd('0x32')],qs[_0x49fd('0x36')](_0x255a73['query'][_0x49fd('0x36')]));_0x4dce94[_0x49fd('0x37')]=_0x4dce94[_0x49fd('0x37')][_0x49fd('0x38')]?_0x4dce94[_0x49fd('0x37')]:_0x3be41b[_0x49fd('0x32')];if(_0x255a73[_0x49fd('0x33')][_0x49fd('0x47')]){_0x4dce94[_0x49fd('0x42')]=[{'all':!![]}];}_0x4dce94=_[_0x49fd('0x41')]({},_0x4dce94,_0x255a73[_0x49fd('0x48')]);return db[_0x49fd('0x2f')][_0x49fd('0x49')](_0x4dce94)[_0x49fd('0x29')](handleEntityNotFound(_0x2c8ab1,null))['then'](respondWithResult(_0x2c8ab1,null))['catch'](handleError(_0x2c8ab1,null));};exports[_0x49fd('0x4a')]=function(_0xa3518f,_0x42287e){return db[_0x49fd('0x2f')]['create'](_0xa3518f[_0x49fd('0x4b')],{})[_0x49fd('0x29')](respondWithResult(_0x42287e,0xc9))['catch'](handleError(_0x42287e,null));};exports[_0x49fd('0x27')]=function(_0x270360,_0xaac56f){if(_0x270360[_0x49fd('0x4b')]['id']){delete _0x270360[_0x49fd('0x4b')]['id'];}return db[_0x49fd('0x2f')][_0x49fd('0x49')]({'where':{'id':_0x270360[_0x49fd('0x46')]['id']}})[_0x49fd('0x29')](handleEntityNotFound(_0xaac56f,null))[_0x49fd('0x29')](saveUpdates(_0x270360[_0x49fd('0x4b')],null))['then'](respondWithResult(_0xaac56f,null))[_0x49fd('0x45')](handleError(_0xaac56f,null));};exports[_0x49fd('0x28')]=function(_0x32694b,_0x263cf3){return db[_0x49fd('0x2f')][_0x49fd('0x49')]({'where':{'id':_0x32694b['params']['id']}})['then'](handleEntityNotFound(_0x263cf3,null))[_0x49fd('0x29')](removeEntity(_0x263cf3,null))[_0x49fd('0x45')](handleError(_0x263cf3,null));};exports[_0x49fd('0x4c')]=function(_0x5c34c0,_0x31783f){return db[_0x49fd('0x2f')]['describe']()['then'](respondWithResult(_0x31783f,null))['catch'](handleError(_0x31783f,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 7e05813..ec25308 100644 --- a/server/api/chatQueueReport/chatQueueReport.model.js +++ b/server/api/chatQueueReport/chatQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x32d442,_0x318f79){var _0x544226=function(_0x241d65){while(--_0x241d65){_0x32d442['push'](_0x32d442['shift']());}};_0x544226(++_0x318f79);}(_0x757a,0xde));var _0xa757=function(_0x1f11cf,_0x450690){_0x1f11cf=_0x1f11cf-0x0;var _0x43cd9c=_0x757a[_0x1f11cf];return _0x43cd9c;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5e6b2e,_0x43cd8c){var _0x453c51=function(_0x153230){while(--_0x153230){_0x5e6b2e['push'](_0x5e6b2e['shift']());}};_0x453c51(++_0x43cd8c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index c1e7d84..585ffc1 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 _0xd237=['debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','raw','stringify','update','options','where','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','ChatQueueReport,\x20%s,\x20%s'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xd237,0x14f));var _0x7d23=function(_0x2c30ea,_0x3deb34){_0x2c30ea=_0x2c30ea-0x0;var _0x3e0406=_0xd237[_0x2c30ea];return _0x3e0406;};'use strict';var _=require(_0x7d23('0x0'));var util=require(_0x7d23('0x1'));var moment=require(_0x7d23('0x2'));var BPromise=require(_0x7d23('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d23('0x4'));var db=require(_0x7d23('0x5'))['db'];var utils=require(_0x7d23('0x6'));var logger=require(_0x7d23('0x7'))(_0x7d23('0x8'));var config=require(_0x7d23('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7d23('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ca126,_0x48358f,_0xc43371){return new BPromise(function(_0x42c334,_0x6ce28d){return client[_0x7d23('0xb')](_0x5ca126,_0xc43371)[_0x7d23('0xc')](function(_0x23f1d6){logger[_0x7d23('0xd')](_0x7d23('0xe'),_0x48358f,'request\x20sent');logger[_0x7d23('0xf')](_0x7d23('0x10'),_0x48358f,_0x7d23('0x11'),JSON['stringify'](_0x23f1d6));if(_0x23f1d6[_0x7d23('0x12')]){if(_0x23f1d6['error'][_0x7d23('0x13')]===0x1f4){logger[_0x7d23('0x12')](_0x7d23('0xe'),_0x48358f,_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);return _0x6ce28d(_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x48358f,_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);return _0x42c334(_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);}else{logger['info'](_0x7d23('0xe'),_0x48358f,'request\x20sent');_0x42c334(_0x23f1d6[_0x7d23('0x15')]['message']);}})[_0x7d23('0x16')](function(_0x46a35b){logger[_0x7d23('0x12')](_0x7d23('0xe'),_0x48358f,_0x46a35b);_0x6ce28d(_0x46a35b);});});}exports[_0x7d23('0x17')]=function(_0x506a3b){var _0x313471=this;return new Promise(function(_0x3d6a7b,_0x49ce32){return db[_0x7d23('0x18')][_0x7d23('0x19')](_0x506a3b[_0x7d23('0x1a')],{'raw':_0x506a3b['options']?_0x506a3b['options'][_0x7d23('0x1b')]===undefined?!![]:![]:!![]})[_0x7d23('0xc')](function(_0x56b0ba){logger[_0x7d23('0xd')]('CreateChatQueueReport',_0x506a3b);logger[_0x7d23('0xf')]('CreateChatQueueReport',_0x506a3b,JSON[_0x7d23('0x1c')](_0x56b0ba));_0x3d6a7b(_0x56b0ba);})[_0x7d23('0x16')](function(_0x59522b){logger[_0x7d23('0x12')](_0x7d23('0x17'),_0x59522b[_0x7d23('0x14')],_0x506a3b);_0x49ce32(_0x313471['error'](0x1f4,_0x59522b[_0x7d23('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x2e6d9f){var _0x354b2a=this;return new Promise(function(_0x1c007a,_0x3a5d87){return db[_0x7d23('0x18')][_0x7d23('0x1d')](_0x2e6d9f[_0x7d23('0x1a')],{'raw':_0x2e6d9f[_0x7d23('0x1e')]?_0x2e6d9f[_0x7d23('0x1e')][_0x7d23('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e6d9f[_0x7d23('0x1e')]?_0x2e6d9f['options'][_0x7d23('0x1f')]||null:null,'attributes':_0x2e6d9f[_0x7d23('0x1e')]?_0x2e6d9f[_0x7d23('0x1e')][_0x7d23('0x20')]||null:null,'limit':_0x2e6d9f[_0x7d23('0x1e')]?_0x2e6d9f[_0x7d23('0x1e')][_0x7d23('0x21')]||null:null})[_0x7d23('0xc')](function(_0x4808f2){logger[_0x7d23('0xd')](_0x7d23('0x22'),_0x2e6d9f);logger['debug'](_0x7d23('0x22'),_0x2e6d9f,JSON[_0x7d23('0x1c')](_0x4808f2));_0x1c007a(_0x4808f2);})[_0x7d23('0x16')](function(_0x4b1c92){logger[_0x7d23('0x12')](_0x7d23('0x22'),_0x4b1c92[_0x7d23('0x14')],_0x2e6d9f);_0x3a5d87(_0x354b2a[_0x7d23('0x12')](0x1f4,_0x4b1c92[_0x7d23('0x14')]));});});}; \ No newline at end of file +var _0x63c6=['body','options','raw','then','info','where','UpdateChatQueueReport','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatQueueReport','ChatQueueReport'];(function(_0x132edb,_0x54e052){var _0x294aab=function(_0x3630cf){while(--_0x3630cf){_0x132edb['push'](_0x132edb['shift']());}};_0x294aab(++_0x54e052);}(_0x63c6,0xbb));var _0x663c=function(_0x10f318,_0x3b4ab5){_0x10f318=_0x10f318-0x0;var _0x1d471b=_0x63c6[_0x10f318];return _0x1d471b;};'use strict';var _=require(_0x663c('0x0'));var util=require(_0x663c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x663c('0x2'));var fs=require('fs');var Redis=require(_0x663c('0x3'));var db=require(_0x663c('0x4'))['db'];var utils=require(_0x663c('0x5'));var logger=require(_0x663c('0x6'))(_0x663c('0x7'));var config=require(_0x663c('0x8'));var jayson=require(_0x663c('0x9'));var client=jayson[_0x663c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1dbe47,_0xe6ac97,_0x3eb551){return new BPromise(function(_0xb32d9e,_0x5b9376){return client[_0x663c('0xb')](_0x1dbe47,_0x3eb551)['then'](function(_0x38dc88){logger['info'](_0x663c('0xc'),_0xe6ac97,_0x663c('0xd'));logger[_0x663c('0xe')](_0x663c('0xf'),_0xe6ac97,_0x663c('0xd'),JSON[_0x663c('0x10')](_0x38dc88));if(_0x38dc88[_0x663c('0x11')]){if(_0x38dc88['error']['code']===0x1f4){logger[_0x663c('0x11')](_0x663c('0xc'),_0xe6ac97,_0x38dc88['error'][_0x663c('0x12')]);return _0x5b9376(_0x38dc88[_0x663c('0x11')][_0x663c('0x12')]);}logger[_0x663c('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0xe6ac97,_0x38dc88[_0x663c('0x11')][_0x663c('0x12')]);return _0xb32d9e(_0x38dc88['error'][_0x663c('0x12')]);}else{logger['info'](_0x663c('0xc'),_0xe6ac97,_0x663c('0xd'));_0xb32d9e(_0x38dc88[_0x663c('0x13')][_0x663c('0x12')]);}})[_0x663c('0x14')](function(_0x2d2a8f){logger[_0x663c('0x11')](_0x663c('0xc'),_0xe6ac97,_0x2d2a8f);_0x5b9376(_0x2d2a8f);});});}exports[_0x663c('0x15')]=function(_0x3c87fe){var _0x517f70=this;return new Promise(function(_0x2fd707,_0x33f149){return db[_0x663c('0x16')]['create'](_0x3c87fe[_0x663c('0x17')],{'raw':_0x3c87fe[_0x663c('0x18')]?_0x3c87fe[_0x663c('0x18')][_0x663c('0x19')]===undefined?!![]:![]:!![]})[_0x663c('0x1a')](function(_0x54fa2f){logger[_0x663c('0x1b')](_0x663c('0x15'),_0x3c87fe);logger[_0x663c('0xe')](_0x663c('0x15'),_0x3c87fe,JSON['stringify'](_0x54fa2f));_0x2fd707(_0x54fa2f);})['catch'](function(_0x2ac148){logger[_0x663c('0x11')](_0x663c('0x15'),_0x2ac148[_0x663c('0x12')],_0x3c87fe);_0x33f149(_0x517f70[_0x663c('0x11')](0x1f4,_0x2ac148['message']));});});};exports['UpdateChatQueueReport']=function(_0x4b7213){var _0x2587a5=this;return new Promise(function(_0x357986,_0x35842e){return db[_0x663c('0x16')]['update'](_0x4b7213[_0x663c('0x17')],{'raw':_0x4b7213[_0x663c('0x18')]?_0x4b7213[_0x663c('0x18')][_0x663c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b7213[_0x663c('0x18')]?_0x4b7213['options'][_0x663c('0x1c')]||null:null,'attributes':_0x4b7213['options']?_0x4b7213[_0x663c('0x18')]['attributes']||null:null,'limit':_0x4b7213['options']?_0x4b7213[_0x663c('0x18')]['limit']||null:null})[_0x663c('0x1a')](function(_0x274a2a){logger[_0x663c('0x1b')](_0x663c('0x1d'),_0x4b7213);logger[_0x663c('0xe')](_0x663c('0x1d'),_0x4b7213,JSON[_0x663c('0x10')](_0x274a2a));_0x357986(_0x274a2a);})['catch'](function(_0x61ebd3){logger[_0x663c('0x11')](_0x663c('0x1d'),_0x61ebd3[_0x663c('0x12')],_0x4b7213);_0x35842e(_0x2587a5[_0x663c('0x11')](0x1f4,_0x61ebd3[_0x663c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 0fe77ed..0eed898 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 _0x61e9=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','index','get','/describe','/:id','isAuthenticated','post','put','update','delete','exports'];(function(_0x3911e0,_0x1e4327){var _0x5096fb=function(_0x4325f7){while(--_0x4325f7){_0x3911e0['push'](_0x3911e0['shift']());}};_0x5096fb(++_0x1e4327);}(_0x61e9,0x160));var _0x961e=function(_0x52f19f,_0x52164b){_0x52f19f=_0x52f19f-0x0;var _0x528dd8=_0x61e9[_0x52f19f];return _0x528dd8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x961e('0x0'));var timeout=require(_0x961e('0x1'));var express=require(_0x961e('0x2'));var router=express['Router']();var fs_extra=require(_0x961e('0x3'));var auth=require(_0x961e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x961e('0x5'));var controller=require('./chatQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x961e('0x6')]);router[_0x961e('0x7')](_0x961e('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x961e('0x7')](_0x961e('0x9'),auth[_0x961e('0xa')](),controller['show']);router[_0x961e('0xb')]('/',auth[_0x961e('0xa')](),controller['create']);router[_0x961e('0xc')](_0x961e('0x9'),auth[_0x961e('0xa')](),controller[_0x961e('0xd')]);router[_0x961e('0xe')](_0x961e('0x9'),auth[_0x961e('0xa')](),controller['destroy']);module[_0x961e('0xf')]=router; \ No newline at end of file +var _0x0b9b=['index','isAuthenticated','describe','show','create','update','delete','/:id','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x0b9b,0xf1));var _0xb0b9=function(_0x1e8821,_0x44257b){_0x1e8821=_0x1e8821-0x0;var _0x126b21=_0x0b9b[_0x1e8821];return _0x126b21;};'use strict';var multer=require(_0xb0b9('0x0'));var util=require(_0xb0b9('0x1'));var path=require(_0xb0b9('0x2'));var timeout=require('connect-timeout');var express=require(_0xb0b9('0x3'));var router=express[_0xb0b9('0x4')]();var fs_extra=require(_0xb0b9('0x5'));var auth=require(_0xb0b9('0x6'));var interaction=require(_0xb0b9('0x7'));var config=require(_0xb0b9('0x8'));var controller=require(_0xb0b9('0x9'));router[_0xb0b9('0xa')]('/',auth['isAuthenticated'](),controller[_0xb0b9('0xb')]);router['get']('/describe',auth[_0xb0b9('0xc')](),controller[_0xb0b9('0xd')]);router[_0xb0b9('0xa')]('/:id',auth[_0xb0b9('0xc')](),controller[_0xb0b9('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb0b9('0xf')]);router['put']('/:id',auth[_0xb0b9('0xc')](),controller[_0xb0b9('0x10')]);router[_0xb0b9('0x11')](_0xb0b9('0x12'),auth[_0xb0b9('0xc')](),controller[_0xb0b9('0x13')]);module[_0xb0b9('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 14e8c11..688ab0a 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x1d4c60,_0xc3ffad){var _0x2252b4=function(_0x1121b7){while(--_0x1121b7){_0x1d4c60['push'](_0x1d4c60['shift']());}};_0x2252b4(++_0xc3ffad);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2dc96f,_0x459058){_0x2dc96f=_0x2dc96f-0x0;var _0xd012da=_0xcb91[_0x2dc96f];return _0xd012da;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xb43b,0x1b2));var _0xbb43=function(_0x55acc5,_0x9a1492){_0x55acc5=_0x55acc5-0x0;var _0x5521b5=_0xb43b[_0x55acc5];return _0x5521b5;};'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/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 39677ab..14ec664 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 _0x42fa=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','reject','save','update','destroy','error','name','send','index','map','ChatTransferReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','catch','show','options','find','create','body','params','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0x45c957,_0x276317){var _0x1bf7f4=function(_0x51688b){while(--_0x51688b){_0x45c957['push'](_0x45c957['shift']());}};_0x1bf7f4(++_0x276317);}(_0x42fa,0xd8));var _0xa42f=function(_0xdbc0da,_0x376234){_0xdbc0da=_0xdbc0da-0x0;var _0x54157f=_0x42fa[_0xdbc0da];return _0x54157f;};'use strict';var emlformat=require(_0xa42f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa42f('0x1'));var rp=require('request-promise');var moment=require(_0xa42f('0x2'));var BPromise=require(_0xa42f('0x3'));var Mustache=require(_0xa42f('0x4'));var util=require(_0xa42f('0x5'));var path=require(_0xa42f('0x6'));var sox=require(_0xa42f('0x7'));var csv=require('to-csv');var ejs=require(_0xa42f('0x8'));var fs=require('fs');var fs_extra=require(_0xa42f('0x9'));var _=require(_0xa42f('0xa'));var squel=require(_0xa42f('0xb'));var crypto=require(_0xa42f('0xc'));var jsforce=require(_0xa42f('0xd'));var deskjs=require(_0xa42f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa42f('0xf'));var Papa=require(_0xa42f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa42f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa42f('0x12'));var logger=require('../../config/logger')(_0xa42f('0x13'));var utils=require(_0xa42f('0x14'));var config=require(_0xa42f('0x15'));var licenseUtil=require(_0xa42f('0x16'));var db=require(_0xa42f('0x17'))['db'];function respondWithStatusCode(_0x5f4f15,_0x2eb730){_0x2eb730=_0x2eb730||0xcc;return function(_0x1cfeaa){if(_0x1cfeaa){return _0x5f4f15[_0xa42f('0x18')](_0x2eb730);}return _0x5f4f15['status'](_0x2eb730)[_0xa42f('0x19')]();};}function respondWithResult(_0x56bc41,_0x1faa39){_0x1faa39=_0x1faa39||0xc8;return function(_0x444210){if(_0x444210){return _0x56bc41[_0xa42f('0x1a')](_0x1faa39)[_0xa42f('0x1b')](_0x444210);}};}function respondWithFilteredResult(_0x4522da,_0x547338){return function(_0x23a1b1){if(_0x23a1b1){var _0x20f2e4=typeof _0x547338[_0xa42f('0x1c')]==='undefined'&&typeof _0x547338[_0xa42f('0x1d')]===_0xa42f('0x1e');var _0x216d41=_0x23a1b1[_0xa42f('0x1f')];var _0x582eb1=_0x20f2e4?0x0:_0x547338[_0xa42f('0x1c')];var _0x3cf16f=_0x20f2e4?_0x23a1b1[_0xa42f('0x1f')]:_0x547338[_0xa42f('0x1c')]+_0x547338[_0xa42f('0x1d')];var _0x440d9b;if(_0x3cf16f>=_0x216d41){_0x3cf16f=_0x216d41;_0x440d9b=0xc8;}else{_0x440d9b=0xce;}_0x4522da[_0xa42f('0x1a')](_0x440d9b);return _0x4522da[_0xa42f('0x20')]('Content-Range',_0x582eb1+'-'+_0x3cf16f+'/'+_0x216d41)[_0xa42f('0x1b')](_0x23a1b1);}return null;};}function patchUpdates(_0x40ef63){return function(_0x1c5b14){try{jsonpatch['apply'](_0x1c5b14,_0x40ef63,!![]);}catch(_0x361824){return BPromise[_0xa42f('0x21')](_0x361824);}return _0x1c5b14[_0xa42f('0x22')]();};}function saveUpdates(_0x1bf246,_0x26a066){return function(_0x11cbfa){if(_0x11cbfa){return _0x11cbfa[_0xa42f('0x23')](_0x1bf246)['then'](function(_0x315bdf){return _0x315bdf;});}return null;};}function removeEntity(_0x1fb90b,_0x3e8de8){return function(_0x362d52){if(_0x362d52){return _0x362d52[_0xa42f('0x24')]()['then'](function(){_0x1fb90b[_0xa42f('0x1a')](0xcc)[_0xa42f('0x19')]();});}};}function handleEntityNotFound(_0x45fd28,_0x54e225){return function(_0x5a9dfc){if(!_0x5a9dfc){_0x45fd28[_0xa42f('0x18')](0x194);}return _0x5a9dfc;};}function handleError(_0x41fd77,_0x370bd4){_0x370bd4=_0x370bd4||0x1f4;return function(_0x4e14df){logger[_0xa42f('0x25')](_0x4e14df['stack']);if(_0x4e14df[_0xa42f('0x26')]){delete _0x4e14df[_0xa42f('0x26')];}_0x41fd77[_0xa42f('0x1a')](_0x370bd4)[_0xa42f('0x27')](_0x4e14df);};}exports[_0xa42f('0x28')]=function(_0x5987d7,_0x56218){var _0x597d0e={},_0x159c80={},_0x424f57={'count':0x0,'rows':[]};var _0x1576fd=_[_0xa42f('0x29')](db[_0xa42f('0x2a')]['rawAttributes'],function(_0x10816c){return{'name':_0x10816c[_0xa42f('0x2b')],'type':_0x10816c[_0xa42f('0x2c')][_0xa42f('0x2d')]};});_0x159c80[_0xa42f('0x2e')]=_[_0xa42f('0x29')](_0x1576fd,_0xa42f('0x26'));_0x159c80[_0xa42f('0x2f')]=_[_0xa42f('0x30')](_0x5987d7['query']);_0x159c80[_0xa42f('0x31')]=_[_0xa42f('0x32')](_0x159c80[_0xa42f('0x2e')],_0x159c80[_0xa42f('0x2f')]);_0x597d0e['attributes']=_[_0xa42f('0x32')](_0x159c80['model'],qs['fields'](_0x5987d7[_0xa42f('0x2f')][_0xa42f('0x33')]));_0x597d0e[_0xa42f('0x34')]=_0x597d0e[_0xa42f('0x34')][_0xa42f('0x35')]?_0x597d0e['attributes']:_0x159c80[_0xa42f('0x2e')];if(!_0x5987d7['query'][_0xa42f('0x36')](_0xa42f('0x37'))){_0x597d0e[_0xa42f('0x1d')]=qs['limit'](_0x5987d7['query'][_0xa42f('0x1d')]);_0x597d0e[_0xa42f('0x1c')]=qs['offset'](_0x5987d7[_0xa42f('0x2f')]['offset']);}_0x597d0e[_0xa42f('0x38')]=qs[_0xa42f('0x39')](_0x5987d7[_0xa42f('0x2f')][_0xa42f('0x39')]);_0x597d0e[_0xa42f('0x3a')]=qs[_0xa42f('0x31')](_[_0xa42f('0x3b')](_0x5987d7['query'],_0x159c80['filters']),_0x1576fd);if(_0x5987d7[_0xa42f('0x2f')][_0xa42f('0x3c')]){_0x597d0e[_0xa42f('0x3a')]=_[_0xa42f('0x3d')](_0x597d0e[_0xa42f('0x3a')],{'$or':_[_0xa42f('0x29')](_0x1576fd,function(_0x44fe4a){if(_0x44fe4a['type']!==_0xa42f('0x3e')){var _0x4c8938={};_0x4c8938[_0x44fe4a[_0xa42f('0x26')]]={'$like':'%'+_0x5987d7[_0xa42f('0x2f')][_0xa42f('0x3c')]+'%'};return _0x4c8938;}})});}_0x597d0e=_[_0xa42f('0x3d')]({},_0x597d0e,_0x5987d7['options']);var _0xbb5a68={'where':_0x597d0e['where']};return db[_0xa42f('0x2a')][_0xa42f('0x1f')](_0xbb5a68)[_0xa42f('0x3f')](function(_0x3faba3){_0x424f57[_0xa42f('0x1f')]=_0x3faba3;if(_0x5987d7[_0xa42f('0x2f')][_0xa42f('0x40')]){_0x597d0e[_0xa42f('0x41')]=[{'all':!![]}];}return db[_0xa42f('0x2a')][_0xa42f('0x42')](_0x597d0e);})[_0xa42f('0x3f')](function(_0x110c5e){_0x424f57['rows']=_0x110c5e;return _0x424f57;})[_0xa42f('0x3f')](respondWithFilteredResult(_0x56218,_0x597d0e))[_0xa42f('0x43')](handleError(_0x56218,null));};exports[_0xa42f('0x44')]=function(_0x2bac0d,_0x48c7fc){var _0x4f986d={'raw':!![],'where':{'id':_0x2bac0d['params']['id']}},_0x54ed5f={};_0x54ed5f['model']=_['keys'](db[_0xa42f('0x2a')]['rawAttributes']);_0x54ed5f[_0xa42f('0x2f')]=_[_0xa42f('0x30')](_0x2bac0d[_0xa42f('0x2f')]);_0x54ed5f[_0xa42f('0x31')]=_[_0xa42f('0x32')](_0x54ed5f[_0xa42f('0x2e')],_0x54ed5f[_0xa42f('0x2f')]);_0x4f986d['attributes']=_[_0xa42f('0x32')](_0x54ed5f[_0xa42f('0x2e')],qs[_0xa42f('0x33')](_0x2bac0d[_0xa42f('0x2f')][_0xa42f('0x33')]));_0x4f986d[_0xa42f('0x34')]=_0x4f986d[_0xa42f('0x34')][_0xa42f('0x35')]?_0x4f986d[_0xa42f('0x34')]:_0x54ed5f['model'];if(_0x2bac0d['query'][_0xa42f('0x40')]){_0x4f986d[_0xa42f('0x41')]=[{'all':!![]}];}_0x4f986d=_[_0xa42f('0x3d')]({},_0x4f986d,_0x2bac0d[_0xa42f('0x45')]);return db['ChatTransferReport'][_0xa42f('0x46')](_0x4f986d)[_0xa42f('0x3f')](handleEntityNotFound(_0x48c7fc,null))[_0xa42f('0x3f')](respondWithResult(_0x48c7fc,null))['catch'](handleError(_0x48c7fc,null));};exports[_0xa42f('0x47')]=function(_0x402622,_0x2eaa54){return db[_0xa42f('0x2a')]['create'](_0x402622['body'],{})[_0xa42f('0x3f')](respondWithResult(_0x2eaa54,0xc9))[_0xa42f('0x43')](handleError(_0x2eaa54,null));};exports[_0xa42f('0x23')]=function(_0x374c7c,_0x33b575){if(_0x374c7c['body']['id']){delete _0x374c7c[_0xa42f('0x48')]['id'];}return db[_0xa42f('0x2a')]['find']({'where':{'id':_0x374c7c['params']['id']}})[_0xa42f('0x3f')](handleEntityNotFound(_0x33b575,null))['then'](saveUpdates(_0x374c7c['body'],null))[_0xa42f('0x3f')](respondWithResult(_0x33b575,null))[_0xa42f('0x43')](handleError(_0x33b575,null));};exports[_0xa42f('0x24')]=function(_0x48db39,_0x41eac2){return db['ChatTransferReport'][_0xa42f('0x46')]({'where':{'id':_0x48db39[_0xa42f('0x49')]['id']}})[_0xa42f('0x3f')](handleEntityNotFound(_0x41eac2,null))[_0xa42f('0x3f')](removeEntity(_0x41eac2,null))[_0xa42f('0x43')](handleError(_0x41eac2,null));};exports[_0xa42f('0x4a')]=function(_0x465a88,_0x12a929){return db['ChatTransferReport'][_0xa42f('0x4a')]()[_0xa42f('0x3f')](respondWithResult(_0x12a929,null))['catch'](handleError(_0x12a929,null));}; \ No newline at end of file +var _0xdf35=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filters','pick','where','VIRTUAL','filter','merge','ChatTransferReport','rows','catch','show','length','includeAll','include','options','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x1ed46f,_0x7691d7){var _0x43b931=function(_0x5f2454){while(--_0x5f2454){_0x1ed46f['push'](_0x1ed46f['shift']());}};_0x43b931(++_0x7691d7);}(_0xdf35,0xd7));var _0x5df3=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xdf35[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x5df3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5df3('0x1'));var jsonpatch=require(_0x5df3('0x2'));var rp=require(_0x5df3('0x3'));var moment=require(_0x5df3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5df3('0x5'));var sox=require(_0x5df3('0x6'));var csv=require(_0x5df3('0x7'));var ejs=require(_0x5df3('0x8'));var fs=require('fs');var fs_extra=require(_0x5df3('0x9'));var _=require(_0x5df3('0xa'));var squel=require(_0x5df3('0xb'));var crypto=require('crypto');var jsforce=require(_0x5df3('0xc'));var deskjs=require(_0x5df3('0xd'));var toCsv=require(_0x5df3('0x7'));var querystring=require(_0x5df3('0xe'));var Papa=require('papaparse');var Redis=require(_0x5df3('0xf'));var authService=require(_0x5df3('0x10'));var qs=require(_0x5df3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5df3('0x12'));var logger=require(_0x5df3('0x13'))('api');var utils=require(_0x5df3('0x14'));var config=require(_0x5df3('0x15'));var licenseUtil=require(_0x5df3('0x16'));var db=require(_0x5df3('0x17'))['db'];function respondWithStatusCode(_0x2aa332,_0x36243c){_0x36243c=_0x36243c||0xcc;return function(_0x155fad){if(_0x155fad){return _0x2aa332[_0x5df3('0x18')](_0x36243c);}return _0x2aa332['status'](_0x36243c)[_0x5df3('0x19')]();};}function respondWithResult(_0x42bca6,_0x57af28){_0x57af28=_0x57af28||0xc8;return function(_0x4af505){if(_0x4af505){return _0x42bca6[_0x5df3('0x1a')](_0x57af28)[_0x5df3('0x1b')](_0x4af505);}};}function respondWithFilteredResult(_0x223439,_0x2066d7){return function(_0x983ddf){if(_0x983ddf){var _0x64cd75=typeof _0x2066d7[_0x5df3('0x1c')]===_0x5df3('0x1d')&&typeof _0x2066d7['limit']===_0x5df3('0x1d');var _0x49f1d9=_0x983ddf[_0x5df3('0x1e')];var _0x54166d=_0x64cd75?0x0:_0x2066d7[_0x5df3('0x1c')];var _0x3f9dc1=_0x64cd75?_0x983ddf['count']:_0x2066d7[_0x5df3('0x1c')]+_0x2066d7['limit'];var _0xf76c8b;if(_0x3f9dc1>=_0x49f1d9){_0x3f9dc1=_0x49f1d9;_0xf76c8b=0xc8;}else{_0xf76c8b=0xce;}_0x223439[_0x5df3('0x1a')](_0xf76c8b);return _0x223439[_0x5df3('0x1f')](_0x5df3('0x20'),_0x54166d+'-'+_0x3f9dc1+'/'+_0x49f1d9)[_0x5df3('0x1b')](_0x983ddf);}return null;};}function patchUpdates(_0x47f820){return function(_0x401a72){try{jsonpatch[_0x5df3('0x21')](_0x401a72,_0x47f820,!![]);}catch(_0x42ef33){return BPromise[_0x5df3('0x22')](_0x42ef33);}return _0x401a72[_0x5df3('0x23')]();};}function saveUpdates(_0x4c9404,_0x1beb40){return function(_0x1feda9){if(_0x1feda9){return _0x1feda9[_0x5df3('0x24')](_0x4c9404)['then'](function(_0x592d43){return _0x592d43;});}return null;};}function removeEntity(_0x8dba27,_0x4d191a){return function(_0x4d769c){if(_0x4d769c){return _0x4d769c[_0x5df3('0x25')]()[_0x5df3('0x26')](function(){_0x8dba27[_0x5df3('0x1a')](0xcc)[_0x5df3('0x19')]();});}};}function handleEntityNotFound(_0x133cbb,_0x30e116){return function(_0x5c28ac){if(!_0x5c28ac){_0x133cbb[_0x5df3('0x18')](0x194);}return _0x5c28ac;};}function handleError(_0x1441ca,_0x247876){_0x247876=_0x247876||0x1f4;return function(_0x5c1141){logger['error'](_0x5c1141[_0x5df3('0x27')]);if(_0x5c1141['name']){delete _0x5c1141[_0x5df3('0x28')];}_0x1441ca['status'](_0x247876)[_0x5df3('0x29')](_0x5c1141);};}exports[_0x5df3('0x2a')]=function(_0x30413a,_0x2070b6){var _0x39c946={},_0x5828d1={},_0xbf5357={'count':0x0,'rows':[]};var _0x1ba198=_['map'](db['ChatTransferReport'][_0x5df3('0x2b')],function(_0x9bd995){return{'name':_0x9bd995[_0x5df3('0x2c')],'type':_0x9bd995[_0x5df3('0x2d')][_0x5df3('0x2e')]};});_0x5828d1[_0x5df3('0x2f')]=_[_0x5df3('0x30')](_0x1ba198,_0x5df3('0x28'));_0x5828d1[_0x5df3('0x31')]=_[_0x5df3('0x32')](_0x30413a[_0x5df3('0x31')]);_0x5828d1['filters']=_[_0x5df3('0x33')](_0x5828d1[_0x5df3('0x2f')],_0x5828d1[_0x5df3('0x31')]);_0x39c946[_0x5df3('0x34')]=_[_0x5df3('0x33')](_0x5828d1[_0x5df3('0x2f')],qs[_0x5df3('0x35')](_0x30413a[_0x5df3('0x31')]['fields']));_0x39c946['attributes']=_0x39c946[_0x5df3('0x34')]['length']?_0x39c946[_0x5df3('0x34')]:_0x5828d1['model'];if(!_0x30413a[_0x5df3('0x31')][_0x5df3('0x36')](_0x5df3('0x37'))){_0x39c946[_0x5df3('0x38')]=qs[_0x5df3('0x38')](_0x30413a['query'][_0x5df3('0x38')]);_0x39c946['offset']=qs[_0x5df3('0x1c')](_0x30413a[_0x5df3('0x31')]['offset']);}_0x39c946[_0x5df3('0x39')]=qs[_0x5df3('0x3a')](_0x30413a['query'][_0x5df3('0x3a')]);_0x39c946['where']=qs[_0x5df3('0x3b')](_[_0x5df3('0x3c')](_0x30413a[_0x5df3('0x31')],_0x5828d1['filters']),_0x1ba198);if(_0x30413a['query']['filter']){_0x39c946[_0x5df3('0x3d')]=_['merge'](_0x39c946[_0x5df3('0x3d')],{'$or':_[_0x5df3('0x30')](_0x1ba198,function(_0x18b964){if(_0x18b964[_0x5df3('0x2d')]!==_0x5df3('0x3e')){var _0x1d3662={};_0x1d3662[_0x18b964[_0x5df3('0x28')]]={'$like':'%'+_0x30413a[_0x5df3('0x31')][_0x5df3('0x3f')]+'%'};return _0x1d3662;}})});}_0x39c946=_[_0x5df3('0x40')]({},_0x39c946,_0x30413a['options']);var _0xbc2c0e={'where':_0x39c946[_0x5df3('0x3d')]};return db[_0x5df3('0x41')]['count'](_0xbc2c0e)[_0x5df3('0x26')](function(_0x52699e){_0xbf5357[_0x5df3('0x1e')]=_0x52699e;if(_0x30413a['query']['includeAll']){_0x39c946['include']=[{'all':!![]}];}return db[_0x5df3('0x41')]['findAll'](_0x39c946);})['then'](function(_0x334223){_0xbf5357[_0x5df3('0x42')]=_0x334223;return _0xbf5357;})['then'](respondWithFilteredResult(_0x2070b6,_0x39c946))[_0x5df3('0x43')](handleError(_0x2070b6,null));};exports[_0x5df3('0x44')]=function(_0x36c709,_0x3425b6){var _0x1a4af5={'raw':!![],'where':{'id':_0x36c709['params']['id']}},_0xc3dddf={};_0xc3dddf['model']=_[_0x5df3('0x32')](db['ChatTransferReport'][_0x5df3('0x2b')]);_0xc3dddf['query']=_[_0x5df3('0x32')](_0x36c709[_0x5df3('0x31')]);_0xc3dddf[_0x5df3('0x3b')]=_[_0x5df3('0x33')](_0xc3dddf[_0x5df3('0x2f')],_0xc3dddf['query']);_0x1a4af5[_0x5df3('0x34')]=_[_0x5df3('0x33')](_0xc3dddf[_0x5df3('0x2f')],qs[_0x5df3('0x35')](_0x36c709[_0x5df3('0x31')]['fields']));_0x1a4af5['attributes']=_0x1a4af5[_0x5df3('0x34')][_0x5df3('0x45')]?_0x1a4af5['attributes']:_0xc3dddf[_0x5df3('0x2f')];if(_0x36c709[_0x5df3('0x31')][_0x5df3('0x46')]){_0x1a4af5[_0x5df3('0x47')]=[{'all':!![]}];}_0x1a4af5=_['merge']({},_0x1a4af5,_0x36c709[_0x5df3('0x48')]);return db[_0x5df3('0x41')][_0x5df3('0x49')](_0x1a4af5)[_0x5df3('0x26')](handleEntityNotFound(_0x3425b6,null))[_0x5df3('0x26')](respondWithResult(_0x3425b6,null))[_0x5df3('0x43')](handleError(_0x3425b6,null));};exports['create']=function(_0x56177f,_0x337e9c){return db[_0x5df3('0x41')][_0x5df3('0x4a')](_0x56177f[_0x5df3('0x4b')],{})['then'](respondWithResult(_0x337e9c,0xc9))[_0x5df3('0x43')](handleError(_0x337e9c,null));};exports[_0x5df3('0x24')]=function(_0x134be4,_0x4acd76){if(_0x134be4[_0x5df3('0x4b')]['id']){delete _0x134be4['body']['id'];}return db[_0x5df3('0x41')][_0x5df3('0x49')]({'where':{'id':_0x134be4['params']['id']}})['then'](handleEntityNotFound(_0x4acd76,null))['then'](saveUpdates(_0x134be4['body'],null))[_0x5df3('0x26')](respondWithResult(_0x4acd76,null))[_0x5df3('0x43')](handleError(_0x4acd76,null));};exports['destroy']=function(_0x280d39,_0x514d6d){return db[_0x5df3('0x41')][_0x5df3('0x49')]({'where':{'id':_0x280d39[_0x5df3('0x4c')]['id']}})[_0x5df3('0x26')](handleEntityNotFound(_0x514d6d,null))[_0x5df3('0x26')](removeEntity(_0x514d6d,null))['catch'](handleError(_0x514d6d,null));};exports['describe']=function(_0x5951ed,_0x53532c){return db[_0x5df3('0x41')][_0x5df3('0x4d')]()['then'](respondWithResult(_0x53532c,null))['catch'](handleError(_0x53532c,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 036835f..5d891e8 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 _0x3d07=['../../config/environment','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3d07,0xbb));var _0x73d0=function(_0x562ec5,_0x36b5a4){_0x562ec5=_0x562ec5-0x0;var _0x279c8c=_0x3d07[_0x562ec5];return _0x279c8c;};'use strict';var _=require(_0x73d0('0x0'));var util=require(_0x73d0('0x1'));var logger=require(_0x73d0('0x2'))(_0x73d0('0x3'));var moment=require(_0x73d0('0x4'));var BPromise=require(_0x73d0('0x5'));var rp=require(_0x73d0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x73d0('0x7'));var config=require(_0x73d0('0x8'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x3203b3,_0x4b16fa){return _0x3203b3[_0x73d0('0x9')](_0x73d0('0xa'),attributes,{'tableName':_0x73d0('0xb'),'paranoid':![],'indexes':[{'name':_0x73d0('0xc'),'fields':[_0x73d0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x593d=['../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','api','request-promise','path','rimraf'];(function(_0x10dc64,_0x11bb29){var _0x9cf98d=function(_0x558d71){while(--_0x558d71){_0x10dc64['push'](_0x10dc64['shift']());}};_0x9cf98d(++_0x11bb29);}(_0x593d,0x159));var _0xd593=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x593d[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xd593('0x0'));var util=require('util');var logger=require(_0xd593('0x1'))(_0xd593('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd593('0x3'));var fs=require('fs');var path=require(_0xd593('0x4'));var rimraf=require(_0xd593('0x5'));var config=require(_0xd593('0x6'));var attributes=require(_0xd593('0x7'));module[_0xd593('0x8')]=function(_0x301d5d,_0x2861e1){return _0x301d5d[_0xd593('0x9')](_0xd593('0xa'),attributes,{'tableName':_0xd593('0xb'),'paranoid':![],'indexes':[{'name':_0xd593('0xc'),'fields':[_0xd593('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 61d9363..37f73d8 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 _0x00c1=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','util','moment'];(function(_0xdde82,_0x11bb2c){var _0x5164eb=function(_0x113405){while(--_0x113405){_0xdde82['push'](_0xdde82['shift']());}};_0x5164eb(++_0x11bb2c);}(_0x00c1,0x11c));var _0x100c=function(_0x47c09b,_0x47d19b){_0x47c09b=_0x47c09b-0x0;var _0x532567=_0x00c1[_0x47c09b];return _0x532567;};'use strict';var _=require('lodash');var util=require(_0x100c('0x0'));var moment=require(_0x100c('0x1'));var BPromise=require(_0x100c('0x2'));var rs=require(_0x100c('0x3'));var fs=require('fs');var Redis=require(_0x100c('0x4'));var db=require(_0x100c('0x5'))['db'];var utils=require(_0x100c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x100c('0x7'));var jayson=require(_0x100c('0x8'));var client=jayson[_0x100c('0x9')][_0x100c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9c9ec7,_0x10a4a9,_0x39049e){return new BPromise(function(_0x2be317,_0x26d5be){return client[_0x100c('0xb')](_0x9c9ec7,_0x39049e)[_0x100c('0xc')](function(_0x3d98ce){logger[_0x100c('0xd')](_0x100c('0xe'),_0x10a4a9,'request\x20sent');logger[_0x100c('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x10a4a9,'request\x20sent',JSON[_0x100c('0x10')](_0x3d98ce));if(_0x3d98ce[_0x100c('0x11')]){if(_0x3d98ce[_0x100c('0x11')][_0x100c('0x12')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x10a4a9,_0x3d98ce[_0x100c('0x11')]['message']);return _0x26d5be(_0x3d98ce['error']['message']);}logger[_0x100c('0x11')](_0x100c('0xe'),_0x10a4a9,_0x3d98ce[_0x100c('0x11')][_0x100c('0x13')]);return _0x2be317(_0x3d98ce['error'][_0x100c('0x13')]);}else{logger['info'](_0x100c('0xe'),_0x10a4a9,_0x100c('0x14'));_0x2be317(_0x3d98ce[_0x100c('0x15')][_0x100c('0x13')]);}})['catch'](function(_0x5e32da){logger[_0x100c('0x11')](_0x100c('0xe'),_0x10a4a9,_0x5e32da);_0x26d5be(_0x5e32da);});});} \ No newline at end of file +var _0x48eb=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4135d8,_0x19e538){var _0x10d479=function(_0x19a721){while(--_0x19a721){_0x4135d8['push'](_0x4135d8['shift']());}};_0x10d479(++_0x19e538);}(_0x48eb,0x170));var _0xb48e=function(_0x39065e,_0x17a1d2){_0x39065e=_0x39065e-0x0;var _0x456b5a=_0x48eb[_0x39065e];return _0x456b5a;};'use strict';var _=require(_0xb48e('0x0'));var util=require('util');var moment=require(_0xb48e('0x1'));var BPromise=require(_0xb48e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb48e('0x3'));var db=require(_0xb48e('0x4'))['db'];var utils=require(_0xb48e('0x5'));var logger=require('../../config/logger')(_0xb48e('0x6'));var config=require('../../config/environment');var jayson=require(_0xb48e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52a325,_0xc03c49,_0x2174f6){return new BPromise(function(_0x368b23,_0x48b813){return client[_0xb48e('0x8')](_0x52a325,_0x2174f6)[_0xb48e('0x9')](function(_0x15ce5f){logger['info'](_0xb48e('0xa'),_0xc03c49,_0xb48e('0xb'));logger[_0xb48e('0xc')](_0xb48e('0xd'),_0xc03c49,'request\x20sent',JSON[_0xb48e('0xe')](_0x15ce5f));if(_0x15ce5f[_0xb48e('0xf')]){if(_0x15ce5f['error']['code']===0x1f4){logger[_0xb48e('0xf')](_0xb48e('0xa'),_0xc03c49,_0x15ce5f[_0xb48e('0xf')][_0xb48e('0x10')]);return _0x48b813(_0x15ce5f['error'][_0xb48e('0x10')]);}logger['error'](_0xb48e('0xa'),_0xc03c49,_0x15ce5f['error']['message']);return _0x368b23(_0x15ce5f['error'][_0xb48e('0x10')]);}else{logger[_0xb48e('0x11')](_0xb48e('0xa'),_0xc03c49,_0xb48e('0xb'));_0x368b23(_0x15ce5f[_0xb48e('0x12')][_0xb48e('0x10')]);}})[_0xb48e('0x13')](function(_0xe2c1a6){logger[_0xb48e('0xf')](_0xb48e('0xa'),_0xc03c49,_0xe2c1a6);_0x48b813(_0xe2c1a6);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index f1a00ef..1151d5a 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 _0x603a=['update','delete','destroy','multer','express','fs-extra','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x8012b2,_0x370e3b){var _0x99bfa9=function(_0x4d1e29){while(--_0x4d1e29){_0x8012b2['push'](_0x8012b2['shift']());}};_0x99bfa9(++_0x370e3b);}(_0x603a,0x153));var _0xa603=function(_0x23cbb1,_0x178ee1){_0x23cbb1=_0x23cbb1-0x0;var _0x34273b=_0x603a[_0x23cbb1];return _0x34273b;};'use strict';var multer=require(_0xa603('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa603('0x1'));var router=express['Router']();var fs_extra=require(_0xa603('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xa603('0x3'));var config=require('../../config/environment');var controller=require(_0xa603('0x4'));router[_0xa603('0x5')]('/',auth[_0xa603('0x6')](),controller[_0xa603('0x7')]);router[_0xa603('0x5')](_0xa603('0x8'),auth['isAuthenticated'](),controller[_0xa603('0x9')]);router[_0xa603('0x5')](_0xa603('0xa'),auth[_0xa603('0x6')](),controller[_0xa603('0xb')]);router[_0xa603('0xc')]('/',auth[_0xa603('0x6')](),controller['create']);router['put'](_0xa603('0xa'),auth[_0xa603('0x6')](),controller[_0xa603('0xd')]);router[_0xa603('0xe')](_0xa603('0xa'),auth[_0xa603('0x6')](),controller[_0xa603('0xf')]);module['exports']=router; \ No newline at end of file +var _0xf43d=['../../config/environment','./chatTransferReport.controller','index','get','/describe','describe','/:id','isAuthenticated','show','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x25cf7c,_0x11966c){var _0x51d963=function(_0xf9dd94){while(--_0xf9dd94){_0x25cf7c['push'](_0x25cf7c['shift']());}};_0x51d963(++_0x11966c);}(_0xf43d,0x1f2));var _0xdf43=function(_0x100e02,_0x499d66){_0x100e02=_0x100e02-0x0;var _0x1f3fce=_0xf43d[_0x100e02];return _0x1f3fce;};'use strict';var multer=require('multer');var util=require(_0xdf43('0x0'));var path=require(_0xdf43('0x1'));var timeout=require(_0xdf43('0x2'));var express=require(_0xdf43('0x3'));var router=express[_0xdf43('0x4')]();var fs_extra=require(_0xdf43('0x5'));var auth=require(_0xdf43('0x6'));var interaction=require(_0xdf43('0x7'));var config=require(_0xdf43('0x8'));var controller=require(_0xdf43('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xdf43('0xa')]);router[_0xdf43('0xb')](_0xdf43('0xc'),auth['isAuthenticated'](),controller[_0xdf43('0xd')]);router[_0xdf43('0xb')](_0xdf43('0xe'),auth[_0xdf43('0xf')](),controller[_0xdf43('0x10')]);router['post']('/',auth[_0xdf43('0xf')](),controller['create']);router[_0xdf43('0x11')](_0xdf43('0xe'),auth[_0xdf43('0xf')](),controller[_0xdf43('0x12')]);router[_0xdf43('0x13')](_0xdf43('0xe'),auth[_0xdf43('0xf')](),controller[_0xdf43('0x14')]);module[_0xdf43('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 3ce0a70..8f12943 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 _0x34e8=['Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','star','TEXT','name','text','input','getDataValue','onlineForm','stringify','offlineForm','parse','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.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email'];(function(_0x1c5231,_0x352b7c){var _0x2db207=function(_0x2ccf2d){while(--_0x2ccf2d){_0x1c5231['push'](_0x1c5231['shift']());}};_0x2db207(++_0x352b7c);}(_0x34e8,0x12c));var _0x834e=function(_0x29d380,_0x27d909){_0x29d380=_0x29d380-0x0;var _0x4aa321=_0x34e8[_0x29d380];return _0x4aa321;};'use strict';var Sequelize=require(_0x834e('0x0'));var rs=require(_0x834e('0x1'));module[_0x834e('0x2')]={'name':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x834e('0x4')},'description':{'type':Sequelize[_0x834e('0x3')]},'mapKey':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x5')},'mapKeyOffline':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x5')},'key':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x834e('0x3')]},'animation':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x834e('0xb')](_0x834e('0xc'),_0x834e('0xd')),'defaultValue':_0x834e('0xc')},'header_online':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0xe')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0xf')},'offline_chat_button':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x10')},'download_transcript':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x13')},'noteTitle':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x15')},'closingMessage':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x16')},'closingMessageButton':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x17')},'skipMessageButton':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x18')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x834e('0xb')](_0x834e('0x19'),'thumb'),'defaultValue':_0x834e('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x834e('0x1a')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x834e('0x1b'),'type':_0x834e('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x834e('0x1d'),'props':{'title':_0x834e('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x834e('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x834e('0x1e')](_0x834e('0x1f'))?JSON['parse'](this[_0x834e('0x1e')](_0x834e('0x1f'))):{};},'set':function(_0x5e1cc5){return this['setDataValue'](_0x834e('0x1f'),JSON['stringify'](_0x5e1cc5));}},'offlineForm':{'type':Sequelize[_0x834e('0x1a')],'defaultValue':function(){return JSON[_0x834e('0x20')]({'items':[{'type':_0x834e('0x1d'),'props':{'title':_0x834e('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x834e('0x5'),'type':_0x834e('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x834e('0x1e')](_0x834e('0x21'))?JSON[_0x834e('0x22')](this['getDataValue'](_0x834e('0x21'))):{};},'set':function(_0x11f1ce){return this[_0x834e('0x23')](_0x834e('0x21'),JSON[_0x834e('0x20')](_0x11f1ce));}},'token':{'type':Sequelize[_0x834e('0x3')],'defaultValue':function(){return rs[_0x834e('0x24')]();}},'autoclose':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x834e('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x834e('0x3')]},'waitingTitle':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x25')},'waitingMessage':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x27')},'offlineMessageBody':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x29')},'skipUnmanaged':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x18')},'sendUnmanaged':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x834e('0x1a')],'defaultValue':function(){return _0x834e('0x2a');}},'notificationSound':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x834e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x2b')},'verticalAlignment':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x2c')},'messagesAlignment':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x834e('0x1a')]},'showCustomerAvatar':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x834e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x834e('0x1a')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x834e('0x9')],'comment':_0x834e('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![],'comment':_0x834e('0x2f'),'set':function(_0x574ea8){if(!_0x574ea8)this[_0x834e('0x23')](_0x834e('0x30'),null);this[_0x834e('0x23')]('mandatoryDisposition',_0x574ea8);}},'vidaooEscalation':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x834e('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x834e('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x834e('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x834e('0x1a')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x9f62=['Skip','Feedback','thumb','stringify','input','name','getDataValue','parse','setDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!'];(function(_0x5afbac,_0xb65c4d){var _0x325fba=function(_0x789e25){while(--_0x789e25){_0x5afbac['push'](_0x5afbac['shift']());}};_0x325fba(++_0xb65c4d);}(_0x9f62,0x154));var _0x29f6=function(_0x592308,_0xe42315){_0x592308=_0x592308-0x0;var _0x1dd0b9=_0x9f62[_0x592308];return _0x1dd0b9;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x29f6('0x0'));module['exports']={'name':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'unique':_0x29f6('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0x3')},'mapKeyOffline':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x3')},'key':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0x4')},'customerAlias':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'defaultValue':_0x29f6('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x29f6('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29f6('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x29f6('0x8')](_0x29f6('0x9'),'squared'),'defaultValue':_0x29f6('0x9')},'header_online':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x29f6('0xa')},'header_offline':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xb')},'download_transcript':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x29f6('0xe')]},'closingQuestion':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x11')},'noteTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x12')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x13')},'closingMessageButton':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x15')},'ratingType':{'type':Sequelize[_0x29f6('0x8')]('star',_0x29f6('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return JSON[_0x29f6('0x17')]({'items':[{'type':_0x29f6('0x18'),'variable':null,'config':{'placeholder':_0x29f6('0x19'),'type':'text','required':!![]},'props':{'title':_0x29f6('0x19'),'helpText':''}},{'type':'input','props':{'title':_0x29f6('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x29f6('0x3'),'type':_0x29f6('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x29f6('0x1a')]('onlineForm')?JSON[_0x29f6('0x1b')](this[_0x29f6('0x1a')]('onlineForm')):{};},'set':function(_0x1401fb){return this[_0x29f6('0x1c')](_0x29f6('0x1d'),JSON[_0x29f6('0x17')](_0x1401fb));}},'offlineForm':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return JSON[_0x29f6('0x17')]({'items':[{'type':_0x29f6('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x29f6('0x3'),'type':_0x29f6('0x3')},'variable':null},{'type':_0x29f6('0x1e'),'config':{'placeholder':_0x29f6('0x1f')},'props':{'title':_0x29f6('0x1f'),'helpText':_0x29f6('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x29f6('0x1a')](_0x29f6('0x21'))?JSON[_0x29f6('0x1b')](this[_0x29f6('0x1a')](_0x29f6('0x21'))):{};},'set':function(_0x1c3f0b){return this[_0x29f6('0x1c')](_0x29f6('0x21'),JSON[_0x29f6('0x17')](_0x1c3f0b));}},'token':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':function(){return rs[_0x29f6('0x22')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x29f6('0x1')]},'waitingTitle':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x23')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x24')},'offlineMessageBody':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x26')},'skipUnmanaged':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x14')},'sendUnmanaged':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0xa')},'enableCustomerAttachment':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x29f6('0xe')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':function(){return _0x29f6('0x27');}},'notificationSound':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x29f6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':_0x29f6('0x29')},'messagesAlignment':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x29f6('0x1')]},'customerAvatar':{'type':Sequelize[_0x29f6('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x29f6('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x29f6('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x29f6('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3f3475){if(!_0x3f3475)this[_0x29f6('0x1c')]('mandatoryDispositionPauseId',null);this[_0x29f6('0x1c')](_0x29f6('0x2a'),_0x3f3475);}},'vidaooEscalation':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x29f6('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x29f6('0x2b')},'vidaooNote':{'type':Sequelize[_0x29f6('0x1')],'defaultValue':function(){return _0x29f6('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0x29f6('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x29f6('0xc')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 758f0d2..8d0eaa4 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 _0x176c=['destroy','findAndCountAll','priority','finally','getApplications','addProactiveActions','omit','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','lodash','querystring','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','debug','request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','update','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','show','params','keys','intersection','includeAll','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','file','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','sitepic','existsSync','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','notify','user-agent-parser','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','Contacts','DESC','ChatApplication','Applications','List','list','orderBy','asc','account','defaults','from','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','%s\x20%s','version','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','applications','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','offline','CompanyId','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','spread','readFileSync','render','toPairs','offlineMessageBody','originalname','files','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOfflineAddress','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','increment','chatLicenseExceeded','all','some','utf8','URL','origin','3.1.0','remote','x-real-ip','connection','virtual','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED'];(function(_0x269cd7,_0x35b9d9){var _0x2e103d=function(_0x2e1e72){while(--_0x2e1e72){_0x269cd7['push'](_0x269cd7['shift']());}};_0x2e103d(++_0x35b9d9);}(_0x176c,0x141));var _0xc176=function(_0x5d506f,_0x8da43f){_0x5d506f=_0x5d506f-0x0;var _0x7a9c9b=_0x176c[_0x5d506f];return _0x7a9c9b;};'use strict';var BPromise=require(_0xc176('0x0'));var Mustache=require(_0xc176('0x1'));var util=require(_0xc176('0x2'));var path=require(_0xc176('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc176('0x4'));var _=require(_0xc176('0x5'));var querystring=require(_0xc176('0x6'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xc176('0x7'))(_0xc176('0x8'));var config=require('../../config/environment');var url=require('url');var db=require(_0xc176('0x9'))['db'];config['redis']=_['defaults'](config[_0xc176('0xa')],{'host':_0xc176('0xb'),'port':0x18eb});var socket=require(_0xc176('0xc'))(new Redis(config[_0xc176('0xa')]));require(_0xc176('0xd'))[_0xc176('0xe')](socket);var htmlToText=require(_0xc176('0xf'));var jayson=require(_0xc176('0x10'));var client=jayson[_0xc176('0x11')]['http']({'port':0x232c});var client9002=jayson[_0xc176('0x11')]['http']({'port':0x232a});var client9003=jayson['client'][_0xc176('0x12')]({'port':0x232b});var client9001=jayson[_0xc176('0x11')][_0xc176('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x4266ac,_0x32ac74,_0x9044f9,_0xc6ab06){return new BPromise(function(_0x405363,_0x56392a){var _0x15193d=_0xc6ab06||client;return _0x15193d[_0xc176('0x13')](_0x4266ac,_0x9044f9)[_0xc176('0x14')](function(_0x11164e){logger[_0xc176('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x32ac74,'request\x20sent');logger[_0xc176('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x32ac74,_0xc176('0x17'),JSON['stringify'](_0x11164e));if(_0x11164e[_0xc176('0x18')]){if(_0x11164e['error'][_0xc176('0x19')]===0x1f4){logger[_0xc176('0x18')](_0xc176('0x1a'),_0x32ac74,_0x11164e[_0xc176('0x18')][_0xc176('0x1b')]);return _0x56392a(_0x11164e[_0xc176('0x18')][_0xc176('0x1b')]);}logger[_0xc176('0x18')](_0xc176('0x1a'),_0x32ac74,_0x11164e[_0xc176('0x18')][_0xc176('0x1b')]);return _0x405363(_0x11164e[_0xc176('0x18')][_0xc176('0x1b')]);}else{logger[_0xc176('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x32ac74,_0xc176('0x17'));_0x405363(_0x11164e[_0xc176('0x1c')][_0xc176('0x1b')]);}})[_0xc176('0x1d')](function(_0x286c4c){logger[_0xc176('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x32ac74,_0x286c4c);_0x56392a(_0x286c4c);});});}function respondWithStatusCode(_0x52ea38,_0x491a58){_0x491a58=_0x491a58||0xcc;return function(_0x3f6bf4){if(_0x3f6bf4){return _0x52ea38[_0xc176('0x1e')](_0x491a58);}return _0x52ea38[_0xc176('0x1f')](_0x491a58)[_0xc176('0x20')]();};}function respondWithResult(_0x52f409,_0x18523d){_0x18523d=_0x18523d||0xc8;return function(_0x51c014){if(_0x51c014){return _0x52f409[_0xc176('0x1f')](_0x18523d)[_0xc176('0x21')](_0x51c014);}};}function respondWithFilteredResult(_0x547f83,_0x427311){return function(_0x3dfe05){if(_0x3dfe05){var _0xae0e39=typeof _0x427311[_0xc176('0x22')]===_0xc176('0x23')&&typeof _0x427311[_0xc176('0x24')]==='undefined';var _0x4d1349=_0x3dfe05[_0xc176('0x25')];var _0x529c40=_0xae0e39?0x0:_0x427311[_0xc176('0x22')];var _0x1a7b9d=_0xae0e39?_0x3dfe05[_0xc176('0x25')]:_0x427311[_0xc176('0x22')]+_0x427311['limit'];var _0x4a0f92;if(_0x1a7b9d>=_0x4d1349){_0x1a7b9d=_0x4d1349;_0x4a0f92=0xc8;}else{_0x4a0f92=0xce;}_0x547f83['status'](_0x4a0f92);return _0x547f83['set']('Content-Range',_0x529c40+'-'+_0x1a7b9d+'/'+_0x4d1349)[_0xc176('0x21')](_0x3dfe05);}return null;};}function saveUpdates(_0x37e565){return function(_0x4a4df1){if(_0x4a4df1){return _0x4a4df1[_0xc176('0x26')](_0x37e565)[_0xc176('0x14')](function(_0x4443ae){return _0x4443ae;});}return null;};}function removeEntity(_0x3a739c){return function(_0x5ccdb3){if(_0x5ccdb3){return _0x5ccdb3['destroy']()['then'](function(){var _0x4d9dae=_0x5ccdb3[_0xc176('0x27')]({'plain':!![]});var _0x39228a=_0xc176('0x28');return db[_0xc176('0x29')]['destroy']({'where':{'type':_0x39228a,'resourceId':_0x4d9dae['id']}})[_0xc176('0x14')](function(){return _0x5ccdb3;});})[_0xc176('0x14')](function(){_0x3a739c['status'](0xcc)[_0xc176('0x20')]();});}};}function handleEntityNotFound(_0xaecbb0){return function(_0x1272c7){if(!_0x1272c7){_0xaecbb0['sendStatus'](0x194);}return _0x1272c7;};}function handleError(_0x3c9b20,_0xb48e4){_0xb48e4=_0xb48e4||0x1f4;return function(_0x53c223){logger[_0xc176('0x18')](_0x53c223[_0xc176('0x2a')]);if(_0x53c223[_0xc176('0x2b')]){delete _0x53c223[_0xc176('0x2b')];}_0x3c9b20['status'](_0xb48e4)[_0xc176('0x2c')](_0x53c223);};}exports[_0xc176('0x2d')]=function(_0x14473d,_0x103dc4){var _0x1ed99c={'include':[{'model':db[_0xc176('0x2e')],'as':_0xc176('0x2f')}]},_0x39732a={},_0x55bdf2={'count':0x0,'rows':[]};var _0xa30f9e=_[_0xc176('0x30')](db[_0xc176('0x31')][_0xc176('0x32')],function(_0x5b0b51){return{'name':_0x5b0b51[_0xc176('0x33')],'type':_0x5b0b51[_0xc176('0x34')][_0xc176('0x35')]};});_0x39732a[_0xc176('0x36')]=_[_0xc176('0x30')](_0xa30f9e,'name');_0x39732a[_0xc176('0x37')]=_['keys'](_0x14473d['query']);_0x39732a[_0xc176('0x38')]=_['intersection'](_0x39732a['model'],_0x39732a[_0xc176('0x37')]);_0x1ed99c[_0xc176('0x39')]=_['intersection'](_0x39732a[_0xc176('0x36')],qs[_0xc176('0x3a')](_0x14473d[_0xc176('0x37')][_0xc176('0x3a')]));_0x1ed99c[_0xc176('0x39')]=_0x1ed99c[_0xc176('0x39')][_0xc176('0x3b')]?_0x1ed99c[_0xc176('0x39')]:_0x39732a[_0xc176('0x36')];if(!_0x14473d[_0xc176('0x37')][_0xc176('0x3c')]('nolimit')){_0x1ed99c[_0xc176('0x24')]=qs['limit'](_0x14473d[_0xc176('0x37')][_0xc176('0x24')]);_0x1ed99c[_0xc176('0x22')]=qs['offset'](_0x14473d['query'][_0xc176('0x22')]);}_0x1ed99c[_0xc176('0x3d')]=qs[_0xc176('0x3e')](_0x14473d['query'][_0xc176('0x3e')]);_0x1ed99c[_0xc176('0x3f')]=qs[_0xc176('0x38')](_[_0xc176('0x40')](_0x14473d[_0xc176('0x37')],_0x39732a['filters']),_0xa30f9e);if(_0x14473d[_0xc176('0x37')][_0xc176('0x41')]){_0x1ed99c[_0xc176('0x3f')]=_[_0xc176('0x42')](_0x1ed99c['where'],{'$or':_[_0xc176('0x30')](_0xa30f9e,function(_0x3e348e){if(_0x3e348e[_0xc176('0x34')]!=='VIRTUAL'){var _0x3e0849={};_0x3e0849[_0x3e348e[_0xc176('0x2b')]]={'$like':'%'+_0x14473d[_0xc176('0x37')][_0xc176('0x41')]+'%'};return _0x3e0849;}})});}_0x1ed99c=_['merge']({},_0x1ed99c,_0x14473d[_0xc176('0x43')]);var _0x330681={'where':_0x1ed99c[_0xc176('0x3f')]};return db[_0xc176('0x31')][_0xc176('0x25')](_0x330681)['then'](function(_0x53be6b){_0x55bdf2[_0xc176('0x25')]=_0x53be6b;if(_0x14473d[_0xc176('0x37')]['includeAll']){_0x1ed99c[_0xc176('0x44')]=[{'all':!![]}];}return db['ChatWebsite'][_0xc176('0x45')](_0x1ed99c);})[_0xc176('0x14')](function(_0x4a02a6){_0x55bdf2['rows']=_0x4a02a6;return _0x55bdf2;})[_0xc176('0x14')](respondWithFilteredResult(_0x103dc4,_0x1ed99c))[_0xc176('0x1d')](handleError(_0x103dc4,null));};exports[_0xc176('0x46')]=function(_0x5292f7,_0xcfb1ea){var _0x513e2e={'raw':![],'where':{'id':_0x5292f7[_0xc176('0x47')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1f646e={};_0x1f646e['model']=_['keys'](db[_0xc176('0x31')]['rawAttributes']);_0x1f646e[_0xc176('0x37')]=_[_0xc176('0x48')](_0x5292f7[_0xc176('0x37')]);_0x1f646e[_0xc176('0x38')]=_[_0xc176('0x49')](_0x1f646e[_0xc176('0x36')],_0x1f646e['query']);_0x513e2e[_0xc176('0x39')]=_[_0xc176('0x49')](_0x1f646e[_0xc176('0x36')],qs[_0xc176('0x3a')](_0x5292f7[_0xc176('0x37')][_0xc176('0x3a')]));_0x513e2e[_0xc176('0x39')]=_0x513e2e[_0xc176('0x39')][_0xc176('0x3b')]?_0x513e2e['attributes']:_0x1f646e[_0xc176('0x36')];if(_0x5292f7['query'][_0xc176('0x4a')]){_0x513e2e[_0xc176('0x44')]=[{'all':!![]}];}_0x513e2e=_[_0xc176('0x42')]({},_0x513e2e,_0x5292f7[_0xc176('0x43')]);return db[_0xc176('0x31')][_0xc176('0x4b')](_0x513e2e)[_0xc176('0x14')](handleEntityNotFound(_0xcfb1ea,null))[_0xc176('0x14')](respondWithResult(_0xcfb1ea,null))['catch'](handleError(_0xcfb1ea,null));};exports['create']=function(_0x528b07,_0x27ac17){return db[_0xc176('0x31')]['create'](_0x528b07[_0xc176('0x4c')],{})['then'](function(_0x170442){var _0x3b6ea4=_0x528b07[_0xc176('0x4d')][_0xc176('0x27')]({'plain':!![]});if(!_0x3b6ea4)throw new Error(_0xc176('0x4e'));if(_0x3b6ea4[_0xc176('0x4f')]===_0xc176('0x4d')){var _0x4b7092=_0x170442['get']({'plain':!![]});var _0x6cd3ba=_0xc176('0x28');return db['UserProfileSection'][_0xc176('0x4b')]({'where':{'name':_0x6cd3ba,'userProfileId':_0x3b6ea4['userProfileId']},'raw':!![]})['then'](function(_0x24b605){if(_0x24b605&&_0x24b605[_0xc176('0x50')]===0x0){return db[_0xc176('0x29')][_0xc176('0x51')]({'name':_0x4b7092[_0xc176('0x2b')],'resourceId':_0x4b7092['id'],'type':_0x24b605[_0xc176('0x2b')],'sectionId':_0x24b605['id']},{})['then'](function(){return _0x170442;});}else{return _0x170442;}})[_0xc176('0x1d')](function(_0x563541){logger[_0xc176('0x18')](_0xc176('0x52'),_0x563541);throw _0x563541;});}return _0x170442;})[_0xc176('0x14')](respondWithResult(_0x27ac17,0xc9))[_0xc176('0x1d')](handleError(_0x27ac17,null));};exports[_0xc176('0x26')]=function(_0x160bb8,_0x33dd02){if(_0x160bb8[_0xc176('0x4c')]['id']){delete _0x160bb8[_0xc176('0x4c')]['id'];}return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x160bb8['params']['id']},'include':[{'model':db[_0xc176('0x2e')],'as':_0xc176('0x2f')}]})[_0xc176('0x14')](handleEntityNotFound(_0x33dd02,null))['then'](saveUpdates(_0x160bb8[_0xc176('0x4c')],null))['then'](respondWithResult(_0x33dd02,null))[_0xc176('0x1d')](handleError(_0x33dd02,null));};exports['destroy']=function(_0x4f40b9,_0x5d721b){return db['ChatWebsite']['find']({'where':{'id':_0x4f40b9[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d721b,null))['then'](removeEntity(_0x5d721b,null))[_0xc176('0x1d')](handleError(_0x5d721b,null));};exports[_0xc176('0x53')]=function(_0x152139,_0x59f38c){return db[_0xc176('0x31')][_0xc176('0x53')]()[_0xc176('0x14')](respondWithResult(_0x59f38c,null))['catch'](handleError(_0x59f38c,null));};exports[_0xc176('0x54')]=function(_0x397358,_0x23b0df){if(_0x397358['body']['id']){delete _0x397358[_0xc176('0x4c')]['id'];}return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x397358[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0x23b0df,null))[_0xc176('0x14')](function(_0x231e1f){if(_0x231e1f){_0x397358['body'][_0xc176('0x55')]=_0x231e1f['id'];return db[_0xc176('0x56')]['create'](_0x397358['body']);}})[_0xc176('0x14')](respondWithResult(_0x23b0df,null))[_0xc176('0x1d')](handleError(_0x23b0df,null));};exports[_0xc176('0x57')]=function(_0x5554b3,_0x5b7f31){var _0x59a405={'raw':![],'where':{}};var _0x35cc6d={};var _0x146aaf={'count':0x0,'rows':[]};return db[_0xc176('0x31')][_0xc176('0x58')]({'where':{'id':_0x5554b3[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0x5b7f31,null))[_0xc176('0x14')](function(_0x1f5cf5){if(_0x1f5cf5){_0x35cc6d[_0xc176('0x36')]=_[_0xc176('0x48')](db[_0xc176('0x56')][_0xc176('0x32')]);_0x35cc6d[_0xc176('0x37')]=_['keys'](_0x5554b3[_0xc176('0x37')]);_0x35cc6d['filters']=_['intersection'](_0x35cc6d[_0xc176('0x36')],_0x35cc6d[_0xc176('0x37')]);_0x59a405[_0xc176('0x39')]=_[_0xc176('0x49')](_0x35cc6d[_0xc176('0x36')],qs['fields'](_0x5554b3[_0xc176('0x37')][_0xc176('0x3a')]));_0x59a405['attributes']=_0x59a405[_0xc176('0x39')]['length']?_0x59a405[_0xc176('0x39')]:_0x35cc6d['model'];if(!_0x5554b3[_0xc176('0x37')][_0xc176('0x3c')](_0xc176('0x59'))){_0x59a405[_0xc176('0x24')]=qs[_0xc176('0x24')](_0x5554b3[_0xc176('0x37')][_0xc176('0x24')]);_0x59a405[_0xc176('0x22')]=qs[_0xc176('0x22')](_0x5554b3[_0xc176('0x37')][_0xc176('0x22')]);}_0x59a405[_0xc176('0x3d')]=qs[_0xc176('0x3e')](_0x5554b3[_0xc176('0x37')][_0xc176('0x3e')]);_0x59a405[_0xc176('0x3f')]=qs['filters'](_[_0xc176('0x40')](_0x5554b3['query'],_0x35cc6d[_0xc176('0x38')]));_0x59a405[_0xc176('0x3f')][_0xc176('0x55')]=_0x1f5cf5['id'];if(_0x5554b3[_0xc176('0x37')][_0xc176('0x41')]){_0x59a405[_0xc176('0x3f')]=_[_0xc176('0x42')](_0x59a405[_0xc176('0x3f')],{'$or':_[_0xc176('0x30')](_0x59a405['attributes'],function(_0x3c92fd){var _0x24747d={};_0x24747d[_0x3c92fd]={'$like':'%'+_0x5554b3[_0xc176('0x37')]['filter']+'%'};return _0x24747d;})});}_0x59a405=_[_0xc176('0x42')]({},_0x59a405,_0x5554b3[_0xc176('0x43')]);return db['Disposition']['count']({'where':_0x59a405['where']})['then'](function(_0xe59f26){_0x146aaf['count']=_0xe59f26;if(_0x5554b3['query']['includeAll']){_0x59a405[_0xc176('0x44')]=[{'all':!![]}];}return db[_0xc176('0x56')][_0xc176('0x45')](_0x59a405);})[_0xc176('0x14')](function(_0x45682f){_0x146aaf[_0xc176('0x5a')]=_0x45682f;return _0x146aaf;});}})[_0xc176('0x14')](respondWithFilteredResult(_0x5b7f31,_0x59a405))[_0xc176('0x1d')](handleError(_0x5b7f31,null));};exports[_0xc176('0x5b')]=function(_0x5c1f7e,_0xc550c8){return db['ChatWebsite'][_0xc176('0x4b')]({'where':{'id':_0x5c1f7e[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0xc550c8,null))[_0xc176('0x14')](function(_0x4819cc){if(_0x4819cc){return _0x4819cc[_0xc176('0x5b')](_0x5c1f7e['query'][_0xc176('0x5c')]);}})[_0xc176('0x14')](respondWithStatusCode(_0xc550c8,null))['catch'](handleError(_0xc550c8,null));};exports[_0xc176('0x5d')]=function(_0x3bce66,_0x51e7a1){if(_0x3bce66[_0xc176('0x4c')]['id']){delete _0x3bce66['body']['id'];}return db['ChatWebsite'][_0xc176('0x4b')]({'where':{'id':_0x3bce66[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0x51e7a1,null))[_0xc176('0x14')](function(_0xf3ac47){if(_0xf3ac47){_0x3bce66[_0xc176('0x4c')]['ChatWebsiteId']=_0xf3ac47['id'];return db[_0xc176('0x5e')][_0xc176('0x51')](_0x3bce66[_0xc176('0x4c')]);}})['then'](respondWithResult(_0x51e7a1,null))[_0xc176('0x1d')](handleError(_0x51e7a1,null));};exports['getAnswers']=function(_0x73877e,_0xec286f){var _0x3993c9={'raw':![],'where':{}};var _0x206cf8={};var _0x4485bf={'count':0x0,'rows':[]};return db[_0xc176('0x31')][_0xc176('0x58')]({'where':{'id':_0x73877e[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0xec286f,null))[_0xc176('0x14')](function(_0x56f492){if(_0x56f492){_0x206cf8['model']=_[_0xc176('0x48')](db['CannedAnswer']['rawAttributes']);_0x206cf8[_0xc176('0x37')]=_[_0xc176('0x48')](_0x73877e[_0xc176('0x37')]);_0x206cf8[_0xc176('0x38')]=_[_0xc176('0x49')](_0x206cf8[_0xc176('0x36')],_0x206cf8['query']);_0x3993c9[_0xc176('0x39')]=_['intersection'](_0x206cf8[_0xc176('0x36')],qs[_0xc176('0x3a')](_0x73877e[_0xc176('0x37')]['fields']));_0x3993c9['attributes']=_0x3993c9[_0xc176('0x39')]['length']?_0x3993c9[_0xc176('0x39')]:_0x206cf8[_0xc176('0x36')];if(!_0x73877e[_0xc176('0x37')][_0xc176('0x3c')](_0xc176('0x59'))){_0x3993c9[_0xc176('0x24')]=qs[_0xc176('0x24')](_0x73877e[_0xc176('0x37')][_0xc176('0x24')]);_0x3993c9['offset']=qs[_0xc176('0x22')](_0x73877e[_0xc176('0x37')]['offset']);}_0x3993c9[_0xc176('0x3d')]=qs[_0xc176('0x3e')](_0x73877e['query'][_0xc176('0x3e')]);_0x3993c9[_0xc176('0x3f')]=qs[_0xc176('0x38')](_[_0xc176('0x40')](_0x73877e[_0xc176('0x37')],_0x206cf8[_0xc176('0x38')]));_0x3993c9[_0xc176('0x3f')][_0xc176('0x55')]=_0x56f492['id'];if(_0x73877e[_0xc176('0x37')][_0xc176('0x41')]){_0x3993c9['where']=_['merge'](_0x3993c9['where'],{'$or':_[_0xc176('0x30')](_0x3993c9[_0xc176('0x39')],function(_0x3cc768){var _0x4368ec={};_0x4368ec[_0x3cc768]={'$like':'%'+_0x73877e[_0xc176('0x37')][_0xc176('0x41')]+'%'};return _0x4368ec;})});}_0x3993c9=_[_0xc176('0x42')]({},_0x3993c9,_0x73877e[_0xc176('0x43')]);return db[_0xc176('0x5e')]['count']({'where':_0x3993c9[_0xc176('0x3f')]})[_0xc176('0x14')](function(_0x25e314){_0x4485bf[_0xc176('0x25')]=_0x25e314;if(_0x73877e['query'][_0xc176('0x4a')]){_0x3993c9[_0xc176('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0xc176('0x45')](_0x3993c9);})[_0xc176('0x14')](function(_0xf7b6d){_0x4485bf[_0xc176('0x5a')]=_0xf7b6d;return _0x4485bf;});}})[_0xc176('0x14')](respondWithFilteredResult(_0xec286f,_0x3993c9))['catch'](handleError(_0xec286f,null));};exports['removeAnswers']=function(_0x1fcc4,_0xed64ed){return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x1fcc4[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0xed64ed,null))[_0xc176('0x14')](function(_0x3e0c7f){if(_0x3e0c7f){return _0x3e0c7f[_0xc176('0x5f')](_0x1fcc4[_0xc176('0x37')][_0xc176('0x5c')]);}})[_0xc176('0x14')](respondWithStatusCode(_0xed64ed,null))['catch'](handleError(_0xed64ed,null));};exports['addLogo']=function(_0x38e701,_0x581610){_0x38e701[_0xc176('0x4c')]['sitepic']=_0x38e701['file'][_0xc176('0x60')];return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x38e701['params']['id']}})['then'](handleEntityNotFound(_0x581610,null))[_0xc176('0x14')](saveUpdates(_0x38e701[_0xc176('0x4c')],null))[_0xc176('0x14')](respondWithResult(_0x581610,null))[_0xc176('0x1d')](handleError(_0x581610,null));};exports[_0xc176('0x61')]=function(_0x2c82ec,_0x703d61){_0x2c82ec[_0xc176('0x4c')][_0xc176('0x62')]=_0x2c82ec['file']['filename'];return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x2c82ec[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0x703d61,null))['then'](saveUpdates(_0x2c82ec[_0xc176('0x4c')],null))[_0xc176('0x14')](respondWithResult(_0x703d61,null))['catch'](handleError(_0x703d61,null));};exports[_0xc176('0x63')]=function(_0x40661a,_0x24dc42){_0x40661a['body'][_0xc176('0x64')]=_0x40661a[_0xc176('0x65')][_0xc176('0x60')];return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x40661a[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0x24dc42,null))[_0xc176('0x14')](saveUpdates(_0x40661a[_0xc176('0x4c')],null))[_0xc176('0x14')](respondWithResult(_0x24dc42,null))[_0xc176('0x1d')](handleError(_0x24dc42,null));};exports[_0xc176('0x66')]=function(_0x35fbc7,_0x19a216){_0x35fbc7[_0xc176('0x4c')][_0xc176('0x67')]=_0x35fbc7[_0xc176('0x65')][_0xc176('0x60')];return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x35fbc7[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0x19a216,null))[_0xc176('0x14')](saveUpdates(_0x35fbc7['body'],null))[_0xc176('0x14')](respondWithResult(_0x19a216,null))[_0xc176('0x1d')](handleError(_0x19a216,null));};exports[_0xc176('0x68')]=function(_0x2eda37,_0x5ccaee){var _0x5b6f90=path['join'](config[_0xc176('0x69')],_0xc176('0x6a'));var _0x36b134={'where':{'id':_0x2eda37['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x15914e=![];return require(_0xc176('0x6b'))[_0xc176('0x6c')]()[_0xc176('0x14')](function(_0x7f5600){if(_0x7f5600){_0x15914e=_0x7f5600[_0xc176('0x6d')];}})[_0xc176('0x14')](function(){return db[_0xc176('0x31')][_0xc176('0x4b')](_0x36b134);})['then'](handleEntityNotFound(_0x5ccaee,null))[_0xc176('0x14')](function(_0x5e318f){if(_0x5e318f){if(!_[_0xc176('0x6e')](_0x5e318f[_0xc176('0x6f')])){if(fs[_0xc176('0x70')](path[_0xc176('0x71')](config['root'],_0xc176('0x72'),_0x5e318f['sitepic']))&&_0x15914e){_0x5b6f90=path[_0xc176('0x71')](config[_0xc176('0x69')],'server/files/images/logos/',_0x5e318f[_0xc176('0x6f')]);}}return _0x5ccaee[_0xc176('0x73')](_0x5b6f90);}})[_0xc176('0x1d')](handleError(_0x5ccaee,null));};exports['getAvatar']=function(_0x35e4f2,_0x298d2a){var _0x42f1d1=path['join'](config[_0xc176('0x69')],_0xc176('0x74'));var _0x1c371b={'where':{'id':_0x35e4f2[_0xc176('0x47')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xc176('0x31')][_0xc176('0x4b')](_0x1c371b)['then'](handleEntityNotFound(_0x298d2a,null))[_0xc176('0x14')](function(_0x207a31){if(_0x207a31){if(!_[_0xc176('0x6e')](_0x207a31[_0xc176('0x62')])){if(fs[_0xc176('0x70')](path['join'](config[_0xc176('0x69')],_0xc176('0x75'),_0x207a31[_0xc176('0x62')]))){_0x42f1d1=path[_0xc176('0x71')](config[_0xc176('0x69')],_0xc176('0x75'),_0x207a31[_0xc176('0x62')]);}}return _0x298d2a[_0xc176('0x73')](_0x42f1d1);}})[_0xc176('0x1d')](handleError(_0x298d2a,null));};exports[_0xc176('0x76')]=function(_0x13ea68,_0x36d2e3){var _0x527535=path[_0xc176('0x71')](config[_0xc176('0x69')],_0xc176('0x77'));var _0x2e823b={'where':{'id':_0x13ea68['params']['id']},'attributes':['id',_0xc176('0x64'),_0xc176('0x78')],'raw':!![]};return db[_0xc176('0x31')][_0xc176('0x4b')](_0x2e823b)[_0xc176('0x14')](handleEntityNotFound(_0x36d2e3,null))[_0xc176('0x14')](function(_0x324315){if(_0x324315){if(!_['isNil'](_0x324315[_0xc176('0x64')])){if(fs['existsSync'](path['join'](config[_0xc176('0x69')],'server/files/images/avatars/',_0x324315[_0xc176('0x64')]))&&_0x324315['showCustomerAvatar']){_0x527535=path[_0xc176('0x71')](config['root'],_0xc176('0x75'),_0x324315[_0xc176('0x64')]);}}return _0x36d2e3[_0xc176('0x73')](_0x527535);}})[_0xc176('0x1d')](handleError(_0x36d2e3,null));};exports[_0xc176('0x79')]=function(_0x7be092,_0x20455c){var _0x135501=path['join'](config['root'],'server/files/images/avatars/system_avatar.png');var _0x196d86={'where':{'id':_0x7be092[_0xc176('0x47')]['id']},'attributes':['id',_0xc176('0x67')],'raw':!![]};return db[_0xc176('0x31')][_0xc176('0x4b')](_0x196d86)[_0xc176('0x14')](handleEntityNotFound(_0x20455c,null))[_0xc176('0x14')](function(_0x520aaf){if(_0x520aaf){if(!_[_0xc176('0x6e')](_0x520aaf[_0xc176('0x67')])){if(fs['existsSync'](path['join'](config['root'],_0xc176('0x75'),_0x520aaf['systemAvatar']))){_0x135501=path['join'](config[_0xc176('0x69')],'server/files/images/avatars/',_0x520aaf['systemAvatar']);}}return _0x20455c['download'](_0x135501);}})[_0xc176('0x1d')](handleError(_0x20455c,null));};exports[_0xc176('0x7a')]=function(_0x5b8eba,_0x1023af){var _0x45d0a0=require(_0xc176('0x7b'));var _0x8b34e8=new _0x45d0a0();var _0x3cf3f4=_0x8b34e8['setUA'](_0x5b8eba[_0xc176('0x7c')][_0xc176('0x7d')])['getResult']();var _0x5bac57={'body':_0x5b8eba['body'],'channel':_0xc176('0x7e')};var _0x488f1e=[];var _0x409a3e=[];var _0x2b5a01={};var _0x58664d=![];return db[_0xc176('0x7f')][_0xc176('0x53')]()['then'](function(_0xce7f8){if(!_0xce7f8){throw new db[(_0xc176('0x80'))][(_0xc176('0x81'))](_0xc176('0x82'));}_0x488f1e=_[_0xc176('0x83')](_[_0xc176('0x48')](_0xce7f8),[_0xc176('0x84'),'updatedAt']);_0x409a3e=_[_0xc176('0x83')](_[_0xc176('0x48')](_0xce7f8),[_0xc176('0x84'),_0xc176('0x85'),'CompanyId',_0xc176('0x86')]);if(_0x5b8eba['body']['id']){delete _0x5b8eba[_0xc176('0x4c')]['id'];}if(_[_0xc176('0x6e')](_0x5b8eba[_0xc176('0x4c')]['from'])){throw new db['Sequelize'][(_0xc176('0x81'))](_0xc176('0x87'));}if(_[_0xc176('0x6e')](_0x5b8eba[_0xc176('0x4c')][_0xc176('0x4c')])||_0x5b8eba[_0xc176('0x4c')][_0xc176('0x4c')]===''){throw new db[(_0xc176('0x80'))][(_0xc176('0x81'))](_0xc176('0x88'));}if(_[_0xc176('0x6e')](_0x5b8eba['body'][_0xc176('0x89')])){throw new db[(_0xc176('0x80'))][(_0xc176('0x81'))](_0xc176('0x8a')+_0x409a3e);}if(!_[_0xc176('0x8b')](_0x409a3e,_0x5b8eba[_0xc176('0x4c')][_0xc176('0x89')])){throw new db[(_0xc176('0x80'))][(_0xc176('0x81'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x409a3e);}_0x2b5a01[_0x5b8eba['body'][_0xc176('0x89')]]=_0x5b8eba['body']['from'];})[_0xc176('0x14')](function(){return db['ChatWebsite'][_0xc176('0x4b')]({'where':{'id':_0x5b8eba[_0xc176('0x47')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xc176('0x7f')],'as':_0xc176('0x8c'),'where':_0x2b5a01,'limit':0x1,'order':[[_0xc176('0x85'),_0xc176('0x8d')]]}]},{'model':db[_0xc176('0x8e')],'as':_0xc176('0x8f')}]});})[_0xc176('0x14')](handleEntityNotFound(_0x1023af,null))[_0xc176('0x14')](function(_0x3cf3d2){if(_0x3cf3d2&&_0x3cf3d2[_0xc176('0x90')]){_0x5bac57['account']=_0x3cf3d2;_0x5bac57['applications']=_0x3cf3d2[_0xc176('0x8f')];_0x5bac57[_0xc176('0x91')]=_0x3cf3d2[_0xc176('0x90')];_0x5bac57['applications']=_[_0xc176('0x92')](_0x5bac57['applications'],['priority'],[_0xc176('0x93')]);if(_0x5bac57['account']['Applications']){delete _0x5bac57[_0xc176('0x94')][_0xc176('0x8f')];}if(_0x5bac57[_0xc176('0x94')]['List']&&_0x5bac57[_0xc176('0x94')][_0xc176('0x90')]['Contacts'][_0xc176('0x3b')]){return _0x5bac57[_0xc176('0x94')][_0xc176('0x90')][_0xc176('0x8c')][0x0];}var _0x159718=_[_0xc176('0x95')](_0x5b8eba['body'],{'firstName':_0x5b8eba[_0xc176('0x4c')]['from'],'ListId':_0x3cf3d2[_0xc176('0x86')]});_0x159718[_0x5b8eba[_0xc176('0x4c')]['mapKey']]=_0x5b8eba[_0xc176('0x4c')][_0xc176('0x96')];return db[_0xc176('0x7f')][_0xc176('0x51')](_0x159718,{'fields':_0x488f1e,'raw':!![]});}})[_0xc176('0x14')](handleEntityNotFound(_0x1023af,null))[_0xc176('0x14')](function(_0x4d8caa){_0x5bac57[_0xc176('0x97')]=_0x4d8caa;var _0x11132c=_0x5b8eba[_0xc176('0x4c')][_0xc176('0x98')];if(_0x5b8eba[_0xc176('0x7c')][_0xc176('0x99')]){_0x11132c=_0x5b8eba[_0xc176('0x7c')]['cf-connecting-ip'];}else if(_0x5b8eba['headers'][_0xc176('0x9a')]){_0x11132c=_['first'](_0x5b8eba[_0xc176('0x7c')][_0xc176('0x9a')][_0xc176('0x9b')](','));}if(_0x4d8caa){var _0x2fb464={'ContactId':_0x4d8caa['id'],'ChatWebsiteId':_0x5b8eba['params']['id'],'from':(_0x4d8caa[_0xc176('0x9c')]||'')+'\x20'+(_0x4d8caa[_0xc176('0x9d')]||''),'customerIp':_0x11132c,'customerPort':_0x5b8eba[_0xc176('0x7c')][_0xc176('0x9e')]?_0x5b8eba[_0xc176('0x7c')][_0xc176('0x9e')]:null,'referer':_0x5b8eba[_0xc176('0x4c')][_0xc176('0x9f')],'browserName':_0x3cf3f4[_0xc176('0xa0')][_0xc176('0x2b')]&&_0x3cf3f4[_0xc176('0xa0')]['version']?util['format'](_0xc176('0xa1'),_0x3cf3f4['browser']['name'],_0x3cf3f4[_0xc176('0xa0')][_0xc176('0xa2')]):'unknown','browserVersion':_0x3cf3f4[_0xc176('0xa0')][_0xc176('0xa2')]||_0xc176('0xa3'),'osName':util[_0xc176('0xa4')](_0xc176('0xa1'),_0x3cf3f4['os'][_0xc176('0x2b')],_0x3cf3f4['os'][_0xc176('0xa2')]),'osVersion':_0x3cf3f4['os'][_0xc176('0xa2')],'deviceModel':_0x3cf3f4[_0xc176('0xa5')]['model']&&_0x3cf3f4[_0xc176('0xa5')][_0xc176('0xa6')]?util[_0xc176('0xa4')](_0xc176('0xa7'),_0x3cf3f4[_0xc176('0xa5')][_0xc176('0x36')],_0x3cf3f4['device'][_0xc176('0xa6')],_0x3cf3f4[_0xc176('0xa5')]['type']):null,'deviceVendor':_0x3cf3f4[_0xc176('0xa5')]['vendor'],'deviceType':_0x3cf3f4[_0xc176('0xa5')][_0xc176('0x34')],'formData':JSON['stringify'](_0x5b8eba[_0xc176('0x4c')])};var _0x5354f8={'ChatWebsiteId':_0x5b8eba[_0xc176('0x47')]['id'],'closed':![]};if(_0x5b8eba[_0xc176('0x4c')][_0xc176('0xa8')]){_0x5354f8[_0xc176('0xa8')]=_0x5b8eba[_0xc176('0x4c')][_0xc176('0xa8')];return db[_0xc176('0xa9')][_0xc176('0x4b')]({'where':_0x5354f8})[_0xc176('0x14')](function(_0x301950){if(_0x301950){return[_0x301950,![]];}_0x2fb464[_0xc176('0xa8')]=_0x5b8eba[_0xc176('0x4c')][_0xc176('0xa8')];_0x2fb464[_0xc176('0xaa')]=_0x5b8eba[_0xc176('0x4c')][_0xc176('0xaa')];return db[_0xc176('0xa9')][_0xc176('0x51')](_0x2fb464)[_0xc176('0x14')](function(_0x3dd10a){return[_0x3dd10a,!![]];});});}_0x5354f8[_0xc176('0xab')]=_0x4d8caa['id'];if(_0x5b8eba[_0xc176('0x4c')][_0xc176('0xac')]&&_0x5b8eba['body'][_0xc176('0xac')]['id']){_0x5354f8['id']=_0x5b8eba[_0xc176('0x4c')][_0xc176('0xac')]['id'];return db[_0xc176('0xa9')][_0xc176('0x4b')]({'where':_0x5354f8})[_0xc176('0x14')](function(_0x114f60){if(_0x114f60){return[_0x114f60,![]];}return db[_0xc176('0xa9')][_0xc176('0x51')](_0x2fb464)['then'](function(_0x5078db){return[_0x5078db,!![]];});});}return db[_0xc176('0xa9')][_0xc176('0x51')](_0x2fb464)[_0xc176('0x14')](function(_0x1feb6b){return[_0x1feb6b,!![]];});}})['spread'](function(_0x77312b,_0xe8a1e6){if(_0x77312b){_0x58664d=_0xe8a1e6;if(!_0xe8a1e6){var _0xe433d4={'from':(_0x5bac57[_0xc176('0x97')][_0xc176('0x9c')]||'')+'\x20'+(_0x5bac57[_0xc176('0x97')][_0xc176('0x9d')]||'')};if(_0x5b8eba[_0xc176('0x4c')][_0xc176('0xa8')]&&_0x5b8eba['body'][_0xc176('0xad')]&&_0x5b8eba[_0xc176('0x4c')][_0xc176('0xa8')]!=_0x5b8eba[_0xc176('0x4c')][_0xc176('0xad')]){_0xe433d4[_0xc176('0xa8')]=_0x5b8eba[_0xc176('0x4c')]['messageId'];}return _0x77312b[_0xc176('0x26')](_0xe433d4);}else{return _0x77312b;}}})[_0xc176('0x14')](function(_0x307ea6){_0x5bac57[_0xc176('0xac')]=_0x307ea6[_0xc176('0x27')]({'plain':!![]});_0x5bac57[_0xc176('0xac')][_0xc176('0xae')]=_0x58664d;if(_0x5bac57[_0xc176('0xac')][_0xc176('0xae')]){if(_0x5bac57[_0xc176('0x94')]['autoclose']){_0x5bac57[_0xc176('0xaf')][_0xc176('0xb0')]({'id':0x0,'priority':_0x5bac57[_0xc176('0xaf')]['length']+0x1,'app':_0xc176('0xb1'),'appdata':_0xc176('0xb2'),'interval':_0xc176('0xb3')});}}return db[_0xc176('0xb4')][_0xc176('0x51')]({'body':_0x5b8eba[_0xc176('0x4c')][_0xc176('0x4c')],'ChatWebsiteId':_0x5b8eba[_0xc176('0x47')]['id'],'ChatInteractionId':_0x307ea6['id'],'direction':'in','ContactId':_0x5bac57['contact']['id'],'AttachmentId':_0x5b8eba[_0xc176('0x4c')][_0xc176('0xb5')]});})[_0xc176('0x14')](function(_0x53e07b){_0x5bac57[_0xc176('0x1b')]=_0x53e07b;if(_0x5bac57[_0xc176('0xac')][_0xc176('0xb6')]){return db[_0xc176('0xb7')][_0xc176('0x4b')]({'attributes':['id',_0xc176('0x2b')],'where':{'id':_0x5bac57[_0xc176('0xac')]['UserId']}})[_0xc176('0x14')](function(_0x196abb){if(_0x196abb){_0x5bac57[_0xc176('0xaf')][_0xc176('0xb8')]({'id':0x0,'priority':0x0,'app':_0xc176('0xb9'),'appdata':_0x196abb['name']+','+(_0x5bac57[_0xc176('0x94')][_0xc176('0xba')]||0xa),'interval':_0xc176('0xb3')});_0x5bac57[_0xc176('0xbb')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x5bac57);});}return respondWithRpcPromise('Start',_0xc176('0xbc'),_0x5bac57);})['then'](function(_0x304735){respondWithRpcPromise(_0xc176('0xbd'),_0xc176('0xbd'),{'event':_0xc176('0x7a'),'message':_0x304735},client9002);return _0x304735;})['then'](respondWithResult(_0x1023af,null))[_0xc176('0x1d')](handleError(_0x1023af,null));};exports[_0xc176('0xbe')]=function(_0x12a308,_0x3208d9){var _0x4405d8,_0x29f4ac,_0x2c81ac;var _0x363673=[];var _0xd84481={};var _0x312107=_0x12a308['files']||[];var _0x9a527f=[];var _0x46a574;return db[_0xc176('0x7f')][_0xc176('0x53')]()[_0xc176('0x14')](function(_0x5e8863){if(!_0x5e8863){throw new db['Sequelize'][(_0xc176('0x81'))](_0xc176('0x82'));}_0x363673=_[_0xc176('0x83')](_[_0xc176('0x48')](_0x5e8863),[_0xc176('0x84'),_0xc176('0x85'),_0xc176('0xbf'),'ListId']);if(_0x12a308[_0xc176('0x4c')]['id']){delete _0x12a308['body']['id'];}if(_[_0xc176('0x6e')](_0x12a308[_0xc176('0x4c')][_0xc176('0x96')])){throw _0x3208d9[_0xc176('0x1f')](0x1f4)[_0xc176('0x2c')](new db[(_0xc176('0x80'))][(_0xc176('0x81'))](_0xc176('0x87')));}if(_['isNil'](_0x12a308[_0xc176('0x4c')][_0xc176('0x4c')])||_0x12a308[_0xc176('0x4c')][_0xc176('0x4c')]===''){throw _0x3208d9[_0xc176('0x1f')](0x1f4)[_0xc176('0x2c')](new db[(_0xc176('0x80'))][(_0xc176('0x81'))](_0xc176('0x88')));}if(_['isNil'](_0x12a308['body']['mapKeyOffline'])){throw _0x3208d9['status'](0x1f4)[_0xc176('0x2c')](new db[(_0xc176('0x80'))][(_0xc176('0x81'))](_0xc176('0xc0')+_0x363673));}if(!_[_0xc176('0x8b')](_0x363673,_0x12a308[_0xc176('0x4c')]['mapKeyOffline'])){throw _0x3208d9['status'](0x1f4)[_0xc176('0x2c')](new db[(_0xc176('0x80'))][(_0xc176('0x81'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x363673));}_0xd84481[_0x12a308[_0xc176('0x4c')]['mapKeyOffline']]=_0x12a308['body'][_0xc176('0x96')];})[_0xc176('0x14')](function(){return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x12a308['params']['id']},'include':[{'model':db[_0xc176('0xc1')],'as':_0xc176('0x90')},{'model':db[_0xc176('0xc2')],'as':_0xc176('0xc2')}]});})[_0xc176('0x14')](handleEntityNotFound(_0x3208d9,null))['then'](function(_0xdac1a1){if(_0xdac1a1&&_0xdac1a1['List']){_0x29f4ac=_0xdac1a1;var _0x2be313=_[_0xc176('0x95')](_0x12a308[_0xc176('0x4c')],{'firstName':_0x12a308[_0xc176('0x4c')][_0xc176('0x96')],'phone':_0x12a308[_0xc176('0x4c')][_0xc176('0x96')],'ListId':_0xdac1a1['ListId']});_0x2be313[_0x12a308[_0xc176('0x4c')]['mapKeyOffline']]=_0x12a308[_0xc176('0x4c')]['from'];return db[_0xc176('0x7f')][_0xc176('0xc3')]({'where':_0xd84481,'defaults':_0x2be313});}})[_0xc176('0xc4')](function(_0x311e9f){if(_0x311e9f){_0x2c81ac=_0x311e9f;var _0x5b7b97=fs[_0xc176('0xc5')](path['join'](config[_0xc176('0x69')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x51718e=ejs[_0xc176('0xc6')](_0x5b7b97,{'body':_[_0xc176('0xc7')](_0x12a308[_0xc176('0x4c')]['body']),'bodyTitle':_0x29f4ac[_0xc176('0xc8')]});return db['ChatOfflineMessage']['create']({'body':_0x51718e,'plainBody':htmlToText['fromString'](_0x51718e),'ContactId':_0x311e9f['id'],'ChatWebsiteId':_0x29f4ac['id']});}})[_0xc176('0x14')](function(_0x28b229){_0x46a574=_0x28b229;if(_0x312107[_0xc176('0x3b')]){var _0x259c98=_0x312107[_0xc176('0x30')](function(_0x4ddad9){return{'name':_0x4ddad9[_0xc176('0xc9')],'basename':_0x4ddad9['filename'],'type':_0x4ddad9['mimetype'],'ChatOfflineMessageId':_0x28b229['id']};});_0x9a527f=_0x259c98[_0xc176('0x30')](_0x11276d=>{var _0x5aa8e3={'filename':_0x11276d['name'],'path':path[_0xc176('0x71')](config[_0xc176('0x69')],'server',_0xc176('0xca'),_0xc176('0xcb'),_0xc176('0xcc'),_0x11276d[_0xc176('0xcd')])};return _0x5aa8e3;});if(!_0x29f4ac[_0xc176('0xce')]){return db[_0xc176('0xcf')][_0xc176('0xd0')](function(_0x56a409){return db['Attachment'][_0xc176('0xd1')](_0x259c98,{'transaction':_0x56a409});});}}})['then'](function(){if(_0x46a574){_0x4405d8=_0x46a574;return db[_0xc176('0xc2')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xc176('0xd2')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xc176('0xd3')],'as':_0xc176('0xd3'),'raw':!![]}]}]});}})[_0xc176('0x14')](function(_0x1b2857){if(_0x1b2857&&_0x1b2857[_0xc176('0xd4')]&&_0x29f4ac['forwardOffline']&&_0x29f4ac[_0xc176('0xd5')]){var _0x3debd1=_0x1b2857['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0xc176('0xd6'),{'account':_0x3debd1,'message':{'from':util['format'](_0xc176('0xd7'),_0x1b2857[_0xc176('0x2b')],_0x1b2857[_0xc176('0xd8')]||_0x1b2857[_0xc176('0xd4')][_0xc176('0x4d')]),'to':_0x29f4ac[_0xc176('0xd5')],'subject':_0x29f4ac[_0xc176('0xd9')],'html':_0x4405d8[_0xc176('0x4c')],'attachments':_0x9a527f}},client9003)['then'](function(){return _0x4405d8;})['catch'](function(_0x34685a){logger[_0xc176('0x18')](_0x34685a);});}})[_0xc176('0x14')](function(){if(_0x29f4ac&&_0x29f4ac[_0xc176('0xce')]&&_0x29f4ac[_0xc176('0xda')]){var _0x2e45a9=[];if(_0x312107['length']){_0x2e45a9=_0x312107[_0xc176('0x30')](function(_0x50a753){return{'name':_0x50a753[_0xc176('0xc9')],'basename':_0x50a753[_0xc176('0x60')],'type':_0x50a753[_0xc176('0xdb')],'ChatOfflineMessageId':_0x46a574['id']};});}var _0x5285c;if(!_[_0xc176('0x6e')](_0x29f4ac[_0xc176('0xdc')])){var _0x1f7ff6=_[_0xc176('0x30')](_0x12a308[_0xc176('0x4c')],function(_0x63eb3d){return _0x63eb3d;});var _0x1afa4a=_['toPairsIn'](_0x1f7ff6)[0x0];var _0x3b5542=_['mapValues'](_0x1afa4a,function(_0x455afb){return _0x455afb;});_0x5285c=_0x3b5542[0x1][_0x29f4ac[_0xc176('0xdc')]];}var _0x3474ec={'from':_0x2c81ac['email'],'firstName':_0x2c81ac[_0xc176('0x9c')],'lastName':_0x2c81ac[_0xc176('0x9d')],'mapKey':_0xc176('0xd8'),'message':{'from':_0x2c81ac[_0xc176('0xd8')],'to':_0x29f4ac['MailAccount'][_0xc176('0xd8')],'cc':'','subject':_['isNil'](_0x5285c)?_0x29f4ac[_0xc176('0xd9')]:_0x5285c,'messageId':'','sentAt':new Date(),'attach':_0x2e45a9[_0xc176('0x3b')],'attachments':_0x2e45a9,'originChannel':_0xc176('0xdd'),'ChatWebsiteId':_0x29f4ac['id'],'ChatOfflineMessageId':_0x4405d8['id'],'originTo':_0x29f4ac[_0xc176('0xc2')][_0xc176('0xd8')]},'body':_0x4405d8['body']};var _0x7b1f60={'account':{'id':_0x29f4ac[_0xc176('0xda')]},'body':_0x3474ec,'log':_0xc176('0xde')};return respondWithRpcPromise(_0xc176('0xde'),_0xc176('0xdf'),_0x7b1f60,client9001)['then'](function(){return _0x4405d8;})[_0xc176('0x1d')](function(_0x747e38){logger['error'](_0x747e38);});}return;})['then'](function(){if(_0x4405d8){return _0x4405d8;}})['then'](respondWithResult(_0x3208d9,null))[_0xc176('0x1d')](function(_0x1ace02){logger[_0xc176('0x18')](_0xc176('0x1d'),_0x1ace02);for(var _0xab20ea of _0x312107){var _0x1f2295=path[_0xc176('0x71')](config[_0xc176('0x69')],_0xc176('0xe0'),'files',_0xc176('0xcb'),_0xc176('0xcc'),_0xab20ea[_0xc176('0x60')]);fs_extra[_0xc176('0xe1')](_0x1f2295)[_0xc176('0x1d')](function(_0x24d3e9){logger[_0xc176('0x18')](_0xc176('0xe2'),_0x1f2295,_0x24d3e9);});}});};exports[_0xc176('0xe3')]=function(_0x136924,_0x42ad0d){return db[_0xc176('0xa9')][_0xc176('0x4b')]({'where':{'id':_0x136924['params']['id']}})[_0xc176('0x14')](handleEntityNotFound(_0x42ad0d,null))[_0xc176('0x14')](function(_0x4acc7f){if(_0x4acc7f){return _0x4acc7f[_0xc176('0xe3')](_0x136924[_0xc176('0x4c')][_0xc176('0x5c')],_['omit'](_0x136924[_0xc176('0x4c')],[_0xc176('0x5c'),'id'])||{});}})[_0xc176('0x14')](respondWithResult(_0x42ad0d,null))[_0xc176('0x1d')](handleError(_0x42ad0d,null));};exports[_0xc176('0xe4')]=function(_0x23d78b,_0x3dbd17){var _0x4f60ea={'raw':![],'where':{}};var _0xe0ac73={};var _0x397f51={'count':0x0,'rows':[]};return db[_0xc176('0x31')][_0xc176('0x58')]({'where':{'id':_0x23d78b['params']['id']}})['then'](handleEntityNotFound(_0x3dbd17,null))[_0xc176('0x14')](function(_0x112e98){if(_0x112e98){_0xe0ac73[_0xc176('0x36')]=_[_0xc176('0x48')](db[_0xc176('0xa9')][_0xc176('0x32')]);_0xe0ac73[_0xc176('0x37')]=_[_0xc176('0x48')](_0x23d78b[_0xc176('0x37')]);_0xe0ac73[_0xc176('0x38')]=_[_0xc176('0x49')](_0xe0ac73[_0xc176('0x36')],_0xe0ac73['query']);_0x4f60ea[_0xc176('0x39')]=_[_0xc176('0x49')](_0xe0ac73['model'],qs[_0xc176('0x3a')](_0x23d78b[_0xc176('0x37')][_0xc176('0x3a')]));_0x4f60ea[_0xc176('0x39')]=_0x4f60ea[_0xc176('0x39')][_0xc176('0x3b')]?_0x4f60ea[_0xc176('0x39')]:_0xe0ac73[_0xc176('0x36')];if(!_0x23d78b[_0xc176('0x37')][_0xc176('0x3c')](_0xc176('0x59'))){_0x4f60ea[_0xc176('0x24')]=qs['limit'](_0x23d78b[_0xc176('0x37')][_0xc176('0x24')]);_0x4f60ea['offset']=qs[_0xc176('0x22')](_0x23d78b['query'][_0xc176('0x22')]);}_0x4f60ea[_0xc176('0x3d')]=qs['sort'](_0x23d78b['query']['sort']);_0x4f60ea[_0xc176('0x3f')]=qs['filters'](_[_0xc176('0x40')](_0x23d78b['query'],_0xe0ac73[_0xc176('0x38')]));_0x4f60ea[_0xc176('0x3f')][_0xc176('0x55')]=_0x112e98['id'];if(_0x23d78b[_0xc176('0x37')][_0xc176('0x41')]){_0x4f60ea[_0xc176('0x3f')]=_[_0xc176('0x42')](_0x4f60ea[_0xc176('0x3f')],{'$or':_['map'](_0x4f60ea[_0xc176('0x39')],function(_0x5b0f3b){var _0x4fd3c4={};_0x4fd3c4[_0x5b0f3b]={'$like':'%'+_0x23d78b['query'][_0xc176('0x41')]+'%'};return _0x4fd3c4;})});}_0x4f60ea=_[_0xc176('0x42')]({},_0x4f60ea,_0x23d78b['options']);return db[_0xc176('0xa9')][_0xc176('0x25')]({'where':_0x4f60ea[_0xc176('0x3f')]})['then'](function(_0x140c16){_0x397f51[_0xc176('0x25')]=_0x140c16;if(_0x23d78b['query'][_0xc176('0x4a')]){_0x4f60ea[_0xc176('0x44')]=[{'model':db[_0xc176('0x7f')],'as':_0xc176('0xe5'),'required':![]},{'model':db[_0xc176('0xb7')],'as':_0xc176('0xe6'),'attributes':['name',_0xc176('0xe7'),_0xc176('0xe8')],'required':![]},{'model':db[_0xc176('0xe9')],'as':_0xc176('0xea'),'attributes':['id',_0xc176('0x2b'),_0xc176('0xeb')],'where':_0x23d78b[_0xc176('0x37')][_0xc176('0xec')]?{'id':_0x23d78b['query'][_0xc176('0xec')]}:undefined,'required':_0x23d78b['query'][_0xc176('0xec')]?!![]:![]}];}return db[_0xc176('0xa9')][_0xc176('0x45')](_0x4f60ea);})['then'](function(_0x5001bc){_0x397f51['rows']=_0x5001bc;return _0x397f51;});}})[_0xc176('0x14')](respondWithFilteredResult(_0x3dbd17,_0x4f60ea))['catch'](handleError(_0x3dbd17,null));};function iftimePromise(_0xa63d8c,_0xa688ab){return respondWithRpcPromise('Command',_0xc176('0xed'),{'command':_0xa688ab[_0xc176('0xee')]?util[_0xc176('0xa4')](_0xc176('0xef'),_0xa63d8c[_0xc176('0xf0')],_0xa688ab['timezone']):util[_0xc176('0xa4')](_0xc176('0xf1'),_0xa63d8c[_0xc176('0xf0')])},client9002)['then'](function(_0x5b597b){var _0x41a2c1=_0x5b597b&&_0x5b597b['indexOf'](_0xc176('0xf2'))>=0x0?!![]:![];logger[_0xc176('0x15')](_0xc176('0xf3'),_0xa688ab['id'],_0xa63d8c['id'],_0xa63d8c['interval'],_0x41a2c1?_0xc176('0xf4'):_0xc176('0xf5'),_0xa688ab[_0xc176('0xee')]?_0xa688ab[_0xc176('0xee')]:_0xc176('0xf6'));return _0x41a2c1;})[_0xc176('0x1d')](function(_0x5c6920){logger[_0xc176('0x18')](_0xc176('0xf3'),_0xa688ab['id'],_0xa63d8c['id'],_0xa63d8c['interval'],util[_0xc176('0xf7')](_0x5c6920,{'showHidden':![],'depth':null}),_0xa688ab[_0xc176('0xee')]?_0xa688ab['timezone']:_0xc176('0xf6'));return![];});}exports[_0xc176('0xed')]=function(_0x3cb3d5,_0x30534c){var _0x5d85a6=0x0;var _0x55c610=0x0;var _0xc0463b=![];var _0x18da2b;var _0x3a622a;return db['ChatWebsite']['find']({'where':{'id':_0x3cb3d5[_0xc176('0x47')]['id']},'include':[{'model':db[_0xc176('0xf8')],'as':_0xc176('0xf8'),'include':[{'model':db[_0xc176('0xf8')],'as':_0xc176('0xf9'),'attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x30534c,null))[_0xc176('0x14')](function(_0x1b5ab9){if(_0x1b5ab9){_0x18da2b=_0x1b5ab9;return _0x1b5ab9[_0xc176('0xfa')]({'raw':!![]});}})[_0xc176('0x14')](function(_0x4fa164){if(_0x18da2b){if(_0x4fa164){_0x3a622a=_0x4fa164;}}return require(_0xc176('0x6b'))[_0xc176('0x6c')]();})[_0xc176('0x14')](function(_0x48c800){if(_0x48c800){_0x55c610=_0x48c800['virtual'];_0xc0463b=_0x48c800['custom'];}})[_0xc176('0x14')](function(){return db['ChatInteraction'][_0xc176('0x25')]({'where':{'closed':![]}});})['then'](function(_0x4ee060){_0x5d85a6=_0x4ee060;if(_0x55c610&&_0x4ee060>_0x55c610){return db['License'][_0xc176('0x58')]({'where':{'id':0x1}})[_0xc176('0x14')](function(_0x4435e7){if(_0x4435e7){_0x4435e7[_0xc176('0xfb')](_0xc176('0xfc'));}});}})[_0xc176('0x14')](function(){if(_0x18da2b['Interval']&&_0x18da2b[_0xc176('0xf8')]['Intervals']){var _0x687223=[];for(var _0x33bd67=0x0;_0x33bd67<_0x18da2b[_0xc176('0xf8')][_0xc176('0xf9')][_0xc176('0x3b')];_0x33bd67++){var _0x2cc243=_0x18da2b[_0xc176('0xf8')][_0xc176('0xf9')][_0x33bd67][_0xc176('0x27')]({'plain':!![]});_0x687223['push'](iftimePromise(_0x2cc243,_0x18da2b));}return BPromise[_0xc176('0xfd')](_0x687223)[_0xc176('0x14')](function(_0x104b8a){return _[_0xc176('0xfe')](_0x104b8a);});}else{return!![];}})[_0xc176('0x14')](function(_0x15f9d9){var _0x261f89=fs['readFileSync'](path[_0xc176('0x71')](config[_0xc176('0x69')],'server/files/chat/iframe.ejs'),_0xc176('0xff'));var _0x4d7dcd=new url[(_0xc176('0x100'))](_0x18da2b['address'])[_0xc176('0x101')];var _0x87d09d=_0xc176('0x102');var _0x3abb15=![];var _0x136a38={'chatVersion':_0x87d09d,'chatWebsiteAddressOrigin':_0x4d7dcd,'remote':_0x18da2b[_0xc176('0x103')],'query':querystring['stringify'](_[_0xc176('0x42')](_0x18da2b[_0xc176('0x27')]({'plain':!![]}),{'customerIp':_0x3cb3d5[_0xc176('0x7c')]['x-forwarded-for']||_0x3cb3d5[_0xc176('0x7c')][_0xc176('0x104')]||_0x3cb3d5[_0xc176('0x105')]['remoteAddress']||_0x3cb3d5['ip'],'referer':_0x3cb3d5[_0xc176('0x7c')][_0xc176('0x9f')],'openedInteractions':_0x5d85a6,'maxInteractions':_0x55c610,'virtual':_0xc0463b[_0xc176('0x106')],'online':_0x15f9d9,'custom':_0xc0463b}))[_0xc176('0x107')](/'/g,'\x5c\x27')};_0x30534c[_0xc176('0x2c')](ejs['render'](Mustache['render'](_0x261f89,_0x136a38),{'proactiveActions':_0x3a622a,'alignment':_0x18da2b[_0xc176('0x108')],'verticalAlignment':_0x18da2b[_0xc176('0x109')],'div_color':_0x18da2b[_0xc176('0xeb')],'labelText':_0x18da2b[_0xc176('0x10a')],'text_color':_0x18da2b[_0xc176('0x10b')],'text_button_color':_0x18da2b[_0xc176('0x10c')],'button_color':_0x18da2b[_0xc176('0x10d')],'background_color':_0x18da2b[_0xc176('0x10e')],'hideWhenOffline':_0x18da2b[_0xc176('0x10f')],'intervalId':_0x18da2b[_0xc176('0x110')],'isDevelopment':_0x3abb15,'chatVersion':_0x87d09d}));})[_0xc176('0x1d')](handleError(_0x30534c,null));};exports[_0xc176('0x111')]=function(_0x33b9c0,_0x5be755){var _0x2f2044=_0x33b9c0['params']['id'];var _0x3c50b5=_0x33b9c0['body'];var _0x1ce584=0xc8;var _0x24dd17=null;return db[_0xc176('0xcf')]['transaction']({'isolationLevel':db[_0xc176('0xcf')][_0xc176('0x112')][_0xc176('0x113')][_0xc176('0x114')]},function(_0x505d45){return db[_0xc176('0x31')][_0xc176('0x58')]({'where':{'id':_0x2f2044},'transaction':_0x505d45})[_0xc176('0x14')](function(_0xb2157b){if(_0xb2157b){return db[_0xc176('0x8e')][_0xc176('0x115')]({'where':{'ChatWebsiteId':_0x2f2044},'transaction':_0x505d45})[_0xc176('0x14')](function(){var _0x17e089=_['map'](_0x3c50b5,function(_0x11c0b4){_0x11c0b4[_0xc176('0x55')]=_0x2f2044;return _0x11c0b4;});return db[_0xc176('0x8e')]['bulkCreate'](_0x17e089,{'transaction':_0x505d45});});}else{_0x1ce584=0x194;_0x24dd17=[];}});})[_0xc176('0x14')](function(){if(_0x1ce584!==0x194){return db[_0xc176('0x8e')][_0xc176('0x116')]({'where':{'ChatWebsiteId':_0x2f2044},'order':_0xc176('0x117')})[_0xc176('0x14')](function(_0x47990f){_0x24dd17=_0x47990f;});}})[_0xc176('0x1d')](function(_0x5624d2){_0x1ce584=0x1f4;logger[_0xc176('0x18')](_0x5624d2[_0xc176('0x2a')]);if(_0x5624d2[_0xc176('0x2b')]){delete _0x5624d2[_0xc176('0x2b')];}_0x24dd17=_0x5624d2;})[_0xc176('0x118')](function(){if(_0x24dd17===null){_0x5be755[_0xc176('0x1e')](_0x1ce584);}else{if(_0x1ce584===0x1f4){_0x5be755[_0xc176('0x1f')](_0x1ce584)[_0xc176('0x2c')](_0x24dd17);}else{_0x5be755[_0xc176('0x1f')](_0x1ce584)[_0xc176('0x21')](_0x24dd17);}}});};exports['getApplications']=function(_0x35ca0c,_0x3fe310){var _0x53d3da={};var _0x11ac6f={};var _0x52c9bd;var _0x6e00f1;return db[_0xc176('0x31')][_0xc176('0x58')]({'where':{'id':_0x35ca0c['params']['id']}})[_0xc176('0x14')](handleEntityNotFound(_0x3fe310,null))[_0xc176('0x14')](function(_0x5776fd){if(_0x5776fd){_0x52c9bd=_0x5776fd;_0x11ac6f[_0xc176('0x36')]=_[_0xc176('0x48')](db[_0xc176('0x8e')][_0xc176('0x32')]);_0x11ac6f['query']=_[_0xc176('0x48')](_0x35ca0c[_0xc176('0x37')]);_0x11ac6f[_0xc176('0x38')]=_[_0xc176('0x49')](_0x11ac6f['model'],_0x11ac6f[_0xc176('0x37')]);_0x53d3da[_0xc176('0x39')]=_[_0xc176('0x49')](_0x11ac6f[_0xc176('0x36')],qs['fields'](_0x35ca0c['query'][_0xc176('0x3a')]));_0x53d3da['attributes']=_0x53d3da[_0xc176('0x39')][_0xc176('0x3b')]?_0x53d3da['attributes']:_0x11ac6f[_0xc176('0x36')];_0x53d3da[_0xc176('0x3d')]=qs[_0xc176('0x3e')](_0x35ca0c['query'][_0xc176('0x3e')]);_0x53d3da['where']=qs[_0xc176('0x38')](_['pick'](_0x35ca0c[_0xc176('0x37')],_0x11ac6f[_0xc176('0x38')]));if(_0x35ca0c[_0xc176('0x37')][_0xc176('0x41')]){_0x53d3da[_0xc176('0x3f')]=_[_0xc176('0x42')](_0x53d3da[_0xc176('0x3f')],{'$or':_[_0xc176('0x30')](_0x53d3da['attributes'],function(_0x1596f8){var _0x519a04={};_0x519a04[_0x1596f8]={'$like':'%'+_0x35ca0c[_0xc176('0x37')][_0xc176('0x41')]+'%'};return _0x519a04;})});}_0x53d3da=_['merge']({},_0x53d3da,_0x35ca0c[_0xc176('0x43')]);return _0x52c9bd[_0xc176('0x119')](_0x53d3da);}})[_0xc176('0x14')](function(_0x5214ca){if(_0x5214ca){_0x6e00f1=_0x5214ca[_0xc176('0x3b')];if(!_0x35ca0c[_0xc176('0x37')][_0xc176('0x3c')]('nolimit')){_0x53d3da[_0xc176('0x24')]=qs[_0xc176('0x24')](_0x35ca0c[_0xc176('0x37')][_0xc176('0x24')]);_0x53d3da[_0xc176('0x22')]=qs[_0xc176('0x22')](_0x35ca0c[_0xc176('0x37')][_0xc176('0x22')]);}return _0x52c9bd[_0xc176('0x119')](_0x53d3da);}})[_0xc176('0x14')](function(_0x4b5c1d){if(_0x4b5c1d){return _0x4b5c1d?{'count':_0x6e00f1,'rows':_0x4b5c1d}:null;}})[_0xc176('0x14')](respondWithResult(_0x3fe310,null))['catch'](handleError(_0x3fe310,null));};exports[_0xc176('0x11a')]=function(_0x5f17b9,_0x402fac){return db['chatProactiveAction'][_0xc176('0x4b')]({'where':{'id':_0x5f17b9[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0x402fac,null))[_0xc176('0x14')](function(_0x1244a4){if(_0x1244a4){return _0x1244a4[_0xc176('0x11a')](_0x5f17b9[_0xc176('0x4c')][_0xc176('0x5c')],_[_0xc176('0x11b')](_0x5f17b9[_0xc176('0x4c')],[_0xc176('0x5c'),'id'])||{});}})[_0xc176('0x14')](respondWithResult(_0x402fac,null))['catch'](handleError(_0x402fac,null));};exports['getProactiveActions']=function(_0x38885c,_0x3f5535){var _0x69614a={};var _0x3aa269={};var _0x168cb4;var _0x277cd2;return db[_0xc176('0x31')][_0xc176('0x58')]({'where':{'id':_0x38885c[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f5535,null))['then'](function(_0x26a0c6){if(_0x26a0c6){_0x168cb4=_0x26a0c6;_0x3aa269[_0xc176('0x36')]=_['keys'](db[_0xc176('0x11c')][_0xc176('0x32')]);_0x3aa269[_0xc176('0x37')]=_['keys'](_0x38885c[_0xc176('0x37')]);_0x3aa269[_0xc176('0x38')]=_['intersection'](_0x3aa269[_0xc176('0x36')],_0x3aa269[_0xc176('0x37')]);_0x69614a[_0xc176('0x39')]=_[_0xc176('0x49')](_0x3aa269['model'],qs['fields'](_0x38885c['query'][_0xc176('0x3a')]));_0x69614a['attributes']=_0x69614a[_0xc176('0x39')][_0xc176('0x3b')]?_0x69614a[_0xc176('0x39')]:_0x3aa269[_0xc176('0x36')];_0x69614a['order']=qs[_0xc176('0x3e')](_0x38885c[_0xc176('0x37')][_0xc176('0x3e')]);_0x69614a[_0xc176('0x3f')]=qs['filters'](_[_0xc176('0x40')](_0x38885c[_0xc176('0x37')],_0x3aa269[_0xc176('0x38')]));if(_0x38885c[_0xc176('0x37')][_0xc176('0x41')]){_0x69614a['where']=_[_0xc176('0x42')](_0x69614a[_0xc176('0x3f')],{'$or':_[_0xc176('0x30')](_0x69614a[_0xc176('0x39')],function(_0xea3c6){var _0x2f95b4={};_0x2f95b4[_0xea3c6]={'$like':'%'+_0x38885c[_0xc176('0x37')]['filter']+'%'};return _0x2f95b4;})});}_0x69614a=_[_0xc176('0x42')]({},_0x69614a,_0x38885c[_0xc176('0x43')]);return _0x168cb4[_0xc176('0xfa')](_0x69614a);}})[_0xc176('0x14')](function(_0xa31cb2){if(_0xa31cb2){_0x277cd2=_0xa31cb2['length'];if(!_0x38885c[_0xc176('0x37')][_0xc176('0x3c')]('nolimit')){_0x69614a['limit']=qs[_0xc176('0x24')](_0x38885c[_0xc176('0x37')][_0xc176('0x24')]);_0x69614a[_0xc176('0x22')]=qs['offset'](_0x38885c[_0xc176('0x37')]['offset']);}return _0x168cb4[_0xc176('0xfa')](_0x69614a);}})[_0xc176('0x14')](function(_0x3638c8){if(_0x3638c8){return _0x3638c8?{'count':_0x277cd2,'rows':_0x3638c8}:null;}})['then'](respondWithResult(_0x3f5535,null))[_0xc176('0x1d')](handleError(_0x3f5535,null));};exports[_0xc176('0x11d')]=function(_0x42a3af,_0x18831f){var _0x309007=_0x42a3af[_0xc176('0x37')][_0xc176('0x11e')]===_0xc176('0x11f')?_0xc176('0x120'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x309007],'where':{'id':_0x42a3af[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0x18831f,null))[_0xc176('0x14')](function(_0x43ce5b){if(_0x43ce5b){var _0x37f4b3=_0x43ce5b[_0x309007];var _0x6e7346=_0x37f4b3&&_0x37f4b3['items']?_0x37f4b3[_0xc176('0x121')]:[];_0x18831f[_0xc176('0x2c')]({'fromKey':_[_0xc176('0x6e')](_0x37f4b3[_0xc176('0x122')])?undefined:_0x37f4b3[_0xc176('0x122')],'count':_0x6e7346[_0xc176('0x3b')],'rows':_0x6e7346});}})[_0xc176('0x1d')](handleError(_0x18831f,null));};exports[_0xc176('0x123')]=function(_0x1d1d3b,_0x1f464b){var _0x52d435={'raw':![],'where':{}};var _0x160279={};var _0x51c7c4={'count':0x0,'rows':[]};return db[_0xc176('0x31')]['findOne']({'where':{'id':_0x1d1d3b[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f464b,null))[_0xc176('0x14')](function(_0x1dae1d){if(_0x1dae1d){_0x160279['model']=_['keys'](db[_0xc176('0x124')]['rawAttributes']);_0x160279['query']=_['keys'](_0x1d1d3b['query']);_0x160279[_0xc176('0x38')]=_[_0xc176('0x49')](_0x160279['model'],_0x160279[_0xc176('0x37')]);_0x52d435[_0xc176('0x39')]=_['intersection'](_0x160279[_0xc176('0x36')],qs['fields'](_0x1d1d3b[_0xc176('0x37')][_0xc176('0x3a')]));_0x52d435[_0xc176('0x39')]=_0x52d435[_0xc176('0x39')][_0xc176('0x3b')]?_0x52d435[_0xc176('0x39')]:_0x160279['model'];if(!_0x1d1d3b[_0xc176('0x37')][_0xc176('0x3c')]('nolimit')){_0x52d435[_0xc176('0x24')]=qs[_0xc176('0x24')](_0x1d1d3b['query'][_0xc176('0x24')]);_0x52d435[_0xc176('0x22')]=qs[_0xc176('0x22')](_0x1d1d3b['query'][_0xc176('0x22')]);}_0x52d435[_0xc176('0x3d')]=qs[_0xc176('0x3e')](_0x1d1d3b[_0xc176('0x37')]['sort']);_0x52d435[_0xc176('0x3f')]=qs[_0xc176('0x38')](_[_0xc176('0x40')](_0x1d1d3b['query'],_0x160279[_0xc176('0x38')]));_0x52d435['where']['ChatWebsiteId']=_0x1dae1d['id'];if(_0x1d1d3b['query'][_0xc176('0x41')]){_0x52d435[_0xc176('0x3f')]=_[_0xc176('0x42')](_0x52d435[_0xc176('0x3f')],{'$or':_['map'](_0x52d435[_0xc176('0x39')],function(_0x4fabbc){var _0x8f8164={};_0x8f8164[_0x4fabbc]={'$like':'%'+_0x1d1d3b[_0xc176('0x37')][_0xc176('0x41')]+'%'};return _0x8f8164;})});}_0x52d435=_[_0xc176('0x42')]({},_0x52d435,_0x1d1d3b[_0xc176('0x43')]);return db[_0xc176('0x124')][_0xc176('0x25')]({'where':_0x52d435[_0xc176('0x3f')]})[_0xc176('0x14')](function(_0x17d03e){_0x51c7c4['count']=_0x17d03e;if(_0x1d1d3b['query'][_0xc176('0x4a')]){_0x52d435[_0xc176('0x44')]=[{'all':!![]}];}else{_0x52d435['include']=[{'model':db[_0xc176('0x7f')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xc176('0x124')]['findAll'](_0x52d435);})[_0xc176('0x14')](function(_0x8d5a1f){_0x51c7c4[_0xc176('0x5a')]=_0x8d5a1f;return _0x51c7c4;});}})[_0xc176('0x14')](respondWithFilteredResult(_0x1f464b,_0x52d435))['catch'](handleError(_0x1f464b,null));};exports[_0xc176('0x125')]=function(_0x52a6fe,_0x478ac1){return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x52a6fe[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0x478ac1,null))[_0xc176('0x14')](function(_0x204ddc){if(_0x204ddc){return _0x204ddc[_0xc176('0x125')](_0x52a6fe['body'][_0xc176('0x5c')],_['omit'](_0x52a6fe[_0xc176('0x4c')],[_0xc176('0x5c'),'id'])||{})[_0xc176('0xc4')](function(_0x5106fb){for(var _0x5d4dfa=0x0;_0x5d4dfa<_0x52a6fe['body']['ids'][_0xc176('0x3b')];_0x5d4dfa+=0x1){socket[_0xc176('0x126')](_0xc176('0x127'),{'UserId':Number(_0x52a6fe[_0xc176('0x4c')][_0xc176('0x5c')][_0x5d4dfa]),'ChatWebsiteId':Number(_0x52a6fe[_0xc176('0x47')]['id'])});}return _0x5106fb;});}})[_0xc176('0x14')](respondWithResult(_0x478ac1,null))['catch'](handleError(_0x478ac1,null));};exports[_0xc176('0x128')]=function(_0x31a4ce,_0xc3fbca){return db[_0xc176('0x31')]['find']({'where':{'id':_0x31a4ce[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0xc3fbca,null))['then'](function(_0x2b0f02){if(_0x2b0f02){return _0x2b0f02['removeAgents'](_0x31a4ce['query']['ids'])[_0xc176('0x14')](function(){if(_['isArray'](_0x31a4ce[_0xc176('0x37')][_0xc176('0x5c')])){for(var _0x586e6f=0x0;_0x586e6f<_0x31a4ce[_0xc176('0x37')][_0xc176('0x5c')][_0xc176('0x3b')];_0x586e6f+=0x1){socket[_0xc176('0x126')](_0xc176('0x129'),{'UserId':Number(_0x31a4ce['query'][_0xc176('0x5c')][_0x586e6f]),'ChatWebsiteId':Number(_0x31a4ce[_0xc176('0x47')]['id'])});}}else{socket[_0xc176('0x126')](_0xc176('0x129'),{'UserId':Number(_0x31a4ce['query'][_0xc176('0x5c')]),'ChatWebsiteId':Number(_0x31a4ce[_0xc176('0x47')]['id'])});}});}})[_0xc176('0x14')](respondWithStatusCode(_0xc3fbca,null))[_0xc176('0x1d')](handleError(_0xc3fbca,null));};exports[_0xc176('0x12a')]=function(_0x598ad9,_0x51e939){var _0xcb47f9={};var _0x1048eb={};var _0x46238d;var _0x96b9e4;return db[_0xc176('0x31')][_0xc176('0x58')]({'where':{'id':_0x598ad9['params']['id']}})['then'](handleEntityNotFound(_0x51e939,null))[_0xc176('0x14')](function(_0xed25c7){if(_0xed25c7){_0x46238d=_0xed25c7;_0x1048eb[_0xc176('0x36')]=_[_0xc176('0x48')](db[_0xc176('0xb7')][_0xc176('0x32')]);_0x1048eb[_0xc176('0x37')]=_[_0xc176('0x48')](_0x598ad9[_0xc176('0x37')]);_0x1048eb[_0xc176('0x38')]=_[_0xc176('0x49')](_0x1048eb[_0xc176('0x36')],_0x1048eb[_0xc176('0x37')]);_0xcb47f9['attributes']=_['intersection'](_0x1048eb[_0xc176('0x36')],qs[_0xc176('0x3a')](_0x598ad9['query'][_0xc176('0x3a')]));_0xcb47f9['attributes']=_0xcb47f9[_0xc176('0x39')][_0xc176('0x3b')]?_0xcb47f9[_0xc176('0x39')]:_0x1048eb[_0xc176('0x36')];_0xcb47f9[_0xc176('0x3d')]=qs[_0xc176('0x3e')](_0x598ad9[_0xc176('0x37')]['sort']);_0xcb47f9['where']=qs[_0xc176('0x38')](_[_0xc176('0x40')](_0x598ad9[_0xc176('0x37')],_0x1048eb[_0xc176('0x38')]));if(_0x598ad9[_0xc176('0x37')]['filter']){_0xcb47f9[_0xc176('0x3f')]=_[_0xc176('0x42')](_0xcb47f9['where'],{'$or':_[_0xc176('0x30')](_0xcb47f9[_0xc176('0x39')],function(_0x23f329){var _0x2ab59b={};_0x2ab59b[_0x23f329]={'$like':'%'+_0x598ad9['query'][_0xc176('0x41')]+'%'};return _0x2ab59b;})});}_0xcb47f9=_['merge']({},_0xcb47f9,_0x598ad9[_0xc176('0x43')]);return _0x46238d[_0xc176('0x12a')](_0xcb47f9);}})['then'](function(_0x8a617d){if(_0x8a617d){_0x96b9e4=_0x8a617d[_0xc176('0x3b')];if(!_0x598ad9['query'][_0xc176('0x3c')](_0xc176('0x59'))){_0xcb47f9[_0xc176('0x24')]=qs['limit'](_0x598ad9[_0xc176('0x37')][_0xc176('0x24')]);_0xcb47f9[_0xc176('0x22')]=qs[_0xc176('0x22')](_0x598ad9[_0xc176('0x37')]['offset']);}return _0x46238d[_0xc176('0x12a')](_0xcb47f9);}})[_0xc176('0x14')](function(_0x2553fc){if(_0x2553fc){return _0x2553fc?{'count':_0x96b9e4,'rows':_0x2553fc}:null;}})[_0xc176('0x14')](respondWithResult(_0x51e939,null))[_0xc176('0x1d')](handleError(_0x51e939,null));}; \ No newline at end of file +var _0x2552=['../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','status','end','json','undefined','count','limit','Content-Range','update','ChatWebsites','UserProfileResource','destroy','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','include','findAll','catch','params','keys','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','includeAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','file','filename','addAvatar','addCustomerAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','isNil','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','notify','user-agent-parser','setUA','headers','user-agent','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','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','CmList','List','Contacts','DESC','ChatApplication','applications','Applications','orderBy','priority','asc','account','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','x-real-port','referer','browser','version','%s\x20%s','unknown','format','device','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','lastName','messageId','created','autoclose','close','unmanaged','*,*,*,*','AttachmentId','UserId','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mapValues','subjectOffline','firstName','Chat','NotifyMailAccount','notifyMail','server','offline-chat','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','User','Owner','internal','Tag','Tags','tag','Command','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','indexOf','ONLINE','OFFLINE','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','custom','License','push','all','some','server/files/chat/iframe.ejs','utf8','3.1.0','remote','x-real-ip','connection','remoteAddress','render','alignment','verticalAlignment','color','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','bulkCreate','stack','getApplications','addProactiveActions','chatProactiveAction','omit','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','getAgents','mustache','util','path','ejs','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','url'];(function(_0xd6ea2c,_0x3a4393){var _0x3eac91=function(_0x5d4fb9){while(--_0x5d4fb9){_0xd6ea2c['push'](_0xd6ea2c['shift']());}};_0x3eac91(++_0x3a4393);}(_0x2552,0x121));var _0x2255=function(_0xe290f9,_0x2ded4f){_0xe290f9=_0xe290f9-0x0;var _0x5d1402=_0x2552[_0xe290f9];return _0x5d1402;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x2255('0x0'));var util=require(_0x2255('0x1'));var path=require(_0x2255('0x2'));var ejs=require(_0x2255('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require('querystring');var Redis=require(_0x2255('0x4'));var qs=require(_0x2255('0x5'));var logger=require(_0x2255('0x6'))('api');var config=require(_0x2255('0x7'));var url=require(_0x2255('0x8'));var db=require(_0x2255('0x9'))['db'];config[_0x2255('0xa')]=_[_0x2255('0xb')](config[_0x2255('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x2255('0xc'))(new Redis(config[_0x2255('0xa')]));require(_0x2255('0xd'))[_0x2255('0xe')](socket);var htmlToText=require(_0x2255('0xf'));var jayson=require('jayson/promise');var client=jayson[_0x2255('0x10')]['http']({'port':0x232c});var client9002=jayson['client'][_0x2255('0x11')]({'port':0x232a});var client9003=jayson[_0x2255('0x10')][_0x2255('0x11')]({'port':0x232b});var client9001=jayson[_0x2255('0x10')]['http']({'port':0x2329});function respondWithRpcPromise(_0x4cfe10,_0x147879,_0x1304e6,_0x5f2bb9){return new BPromise(function(_0x35af56,_0x53ee77){var _0x2755b2=_0x5f2bb9||client;return _0x2755b2[_0x2255('0x12')](_0x4cfe10,_0x1304e6)[_0x2255('0x13')](function(_0x40a477){logger[_0x2255('0x14')](_0x2255('0x15'),_0x147879,_0x2255('0x16'));logger['debug'](_0x2255('0x17'),_0x147879,_0x2255('0x16'),JSON['stringify'](_0x40a477));if(_0x40a477['error']){if(_0x40a477['error']['code']===0x1f4){logger[_0x2255('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x147879,_0x40a477['error']['message']);return _0x53ee77(_0x40a477[_0x2255('0x18')][_0x2255('0x19')]);}logger['error'](_0x2255('0x15'),_0x147879,_0x40a477[_0x2255('0x18')][_0x2255('0x19')]);return _0x35af56(_0x40a477[_0x2255('0x18')][_0x2255('0x19')]);}else{logger[_0x2255('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x147879,_0x2255('0x16'));_0x35af56(_0x40a477[_0x2255('0x1a')][_0x2255('0x19')]);}})['catch'](function(_0x309c9f){logger[_0x2255('0x18')](_0x2255('0x15'),_0x147879,_0x309c9f);_0x53ee77(_0x309c9f);});});}function respondWithStatusCode(_0xfc8c0,_0x135772){_0x135772=_0x135772||0xcc;return function(_0x5ca2d4){if(_0x5ca2d4){return _0xfc8c0['sendStatus'](_0x135772);}return _0xfc8c0[_0x2255('0x1b')](_0x135772)[_0x2255('0x1c')]();};}function respondWithResult(_0x58aa88,_0x44f226){_0x44f226=_0x44f226||0xc8;return function(_0x4a7168){if(_0x4a7168){return _0x58aa88[_0x2255('0x1b')](_0x44f226)[_0x2255('0x1d')](_0x4a7168);}};}function respondWithFilteredResult(_0x372f85,_0x112c2d){return function(_0x52647e){if(_0x52647e){var _0x556a67=typeof _0x112c2d['offset']===_0x2255('0x1e')&&typeof _0x112c2d['limit']===_0x2255('0x1e');var _0x22db29=_0x52647e[_0x2255('0x1f')];var _0x15f48d=_0x556a67?0x0:_0x112c2d['offset'];var _0xd3229d=_0x556a67?_0x52647e[_0x2255('0x1f')]:_0x112c2d['offset']+_0x112c2d[_0x2255('0x20')];var _0xf4529d;if(_0xd3229d>=_0x22db29){_0xd3229d=_0x22db29;_0xf4529d=0xc8;}else{_0xf4529d=0xce;}_0x372f85[_0x2255('0x1b')](_0xf4529d);return _0x372f85['set'](_0x2255('0x21'),_0x15f48d+'-'+_0xd3229d+'/'+_0x22db29)['json'](_0x52647e);}return null;};}function saveUpdates(_0x23bc13){return function(_0x1817a9){if(_0x1817a9){return _0x1817a9[_0x2255('0x22')](_0x23bc13)[_0x2255('0x13')](function(_0x54768c){return _0x54768c;});}return null;};}function removeEntity(_0x308b64){return function(_0x4e3d1f){if(_0x4e3d1f){return _0x4e3d1f['destroy']()['then'](function(){var _0x5dc4e4=_0x4e3d1f['get']({'plain':!![]});var _0x496d99=_0x2255('0x23');return db[_0x2255('0x24')][_0x2255('0x25')]({'where':{'type':_0x496d99,'resourceId':_0x5dc4e4['id']}})['then'](function(){return _0x4e3d1f;});})[_0x2255('0x13')](function(){_0x308b64['status'](0xcc)[_0x2255('0x1c')]();});}};}function handleEntityNotFound(_0x43ae7e){return function(_0x151e50){if(!_0x151e50){_0x43ae7e[_0x2255('0x26')](0x194);}return _0x151e50;};}function handleError(_0x4e7b18,_0x4dce94){_0x4dce94=_0x4dce94||0x1f4;return function(_0x47f8cb){logger[_0x2255('0x18')](_0x47f8cb['stack']);if(_0x47f8cb[_0x2255('0x27')]){delete _0x47f8cb['name'];}_0x4e7b18[_0x2255('0x1b')](_0x4dce94)[_0x2255('0x28')](_0x47f8cb);};}exports[_0x2255('0x29')]=function(_0x1a4a83,_0x28e279){var _0x33e21c={'include':[{'model':db[_0x2255('0x2a')],'as':_0x2255('0x2b')}]},_0x488425={},_0x373f1c={'count':0x0,'rows':[]};var _0x3c7905=_[_0x2255('0x2c')](db[_0x2255('0x2d')]['rawAttributes'],function(_0x155756){return{'name':_0x155756[_0x2255('0x2e')],'type':_0x155756['type']['key']};});_0x488425['model']=_[_0x2255('0x2c')](_0x3c7905,_0x2255('0x27'));_0x488425[_0x2255('0x2f')]=_['keys'](_0x1a4a83[_0x2255('0x2f')]);_0x488425['filters']=_[_0x2255('0x30')](_0x488425[_0x2255('0x31')],_0x488425[_0x2255('0x2f')]);_0x33e21c['attributes']=_[_0x2255('0x30')](_0x488425[_0x2255('0x31')],qs[_0x2255('0x32')](_0x1a4a83[_0x2255('0x2f')][_0x2255('0x32')]));_0x33e21c['attributes']=_0x33e21c[_0x2255('0x33')][_0x2255('0x34')]?_0x33e21c[_0x2255('0x33')]:_0x488425[_0x2255('0x31')];if(!_0x1a4a83[_0x2255('0x2f')][_0x2255('0x35')](_0x2255('0x36'))){_0x33e21c[_0x2255('0x20')]=qs[_0x2255('0x20')](_0x1a4a83['query'][_0x2255('0x20')]);_0x33e21c['offset']=qs[_0x2255('0x37')](_0x1a4a83['query'][_0x2255('0x37')]);}_0x33e21c[_0x2255('0x38')]=qs[_0x2255('0x39')](_0x1a4a83[_0x2255('0x2f')]['sort']);_0x33e21c[_0x2255('0x3a')]=qs[_0x2255('0x3b')](_[_0x2255('0x3c')](_0x1a4a83[_0x2255('0x2f')],_0x488425[_0x2255('0x3b')]),_0x3c7905);if(_0x1a4a83[_0x2255('0x2f')][_0x2255('0x3d')]){_0x33e21c['where']=_['merge'](_0x33e21c['where'],{'$or':_['map'](_0x3c7905,function(_0x107aa0){if(_0x107aa0[_0x2255('0x3e')]!==_0x2255('0x3f')){var _0x10f6e6={};_0x10f6e6[_0x107aa0[_0x2255('0x27')]]={'$like':'%'+_0x1a4a83[_0x2255('0x2f')][_0x2255('0x3d')]+'%'};return _0x10f6e6;}})});}_0x33e21c=_[_0x2255('0x40')]({},_0x33e21c,_0x1a4a83[_0x2255('0x41')]);var _0x5d2aaa={'where':_0x33e21c[_0x2255('0x3a')]};return db[_0x2255('0x2d')][_0x2255('0x1f')](_0x5d2aaa)[_0x2255('0x13')](function(_0x41cb8b){_0x373f1c[_0x2255('0x1f')]=_0x41cb8b;if(_0x1a4a83[_0x2255('0x2f')]['includeAll']){_0x33e21c[_0x2255('0x42')]=[{'all':!![]}];}return db[_0x2255('0x2d')][_0x2255('0x43')](_0x33e21c);})[_0x2255('0x13')](function(_0x3d2eb3){_0x373f1c['rows']=_0x3d2eb3;return _0x373f1c;})[_0x2255('0x13')](respondWithFilteredResult(_0x28e279,_0x33e21c))[_0x2255('0x44')](handleError(_0x28e279,null));};exports['show']=function(_0x407568,_0x295f66){var _0x237be6={'raw':![],'where':{'id':_0x407568[_0x2255('0x45')]['id']},'include':[{'model':db[_0x2255('0x2a')],'as':_0x2255('0x2b')}]},_0x52196c={};_0x52196c[_0x2255('0x31')]=_[_0x2255('0x46')](db[_0x2255('0x2d')][_0x2255('0x47')]);_0x52196c['query']=_['keys'](_0x407568['query']);_0x52196c['filters']=_[_0x2255('0x30')](_0x52196c[_0x2255('0x31')],_0x52196c[_0x2255('0x2f')]);_0x237be6[_0x2255('0x33')]=_[_0x2255('0x30')](_0x52196c[_0x2255('0x31')],qs[_0x2255('0x32')](_0x407568['query'][_0x2255('0x32')]));_0x237be6[_0x2255('0x33')]=_0x237be6['attributes'][_0x2255('0x34')]?_0x237be6[_0x2255('0x33')]:_0x52196c[_0x2255('0x31')];if(_0x407568['query']['includeAll']){_0x237be6['include']=[{'all':!![]}];}_0x237be6=_[_0x2255('0x40')]({},_0x237be6,_0x407568[_0x2255('0x41')]);return db['ChatWebsite'][_0x2255('0x48')](_0x237be6)['then'](handleEntityNotFound(_0x295f66,null))['then'](respondWithResult(_0x295f66,null))['catch'](handleError(_0x295f66,null));};exports[_0x2255('0x49')]=function(_0x4304fa,_0x1fca6e){return db[_0x2255('0x2d')][_0x2255('0x49')](_0x4304fa[_0x2255('0x4a')],{})[_0x2255('0x13')](function(_0x5ebcb0){var _0x35ecf1=_0x4304fa[_0x2255('0x4b')][_0x2255('0x4c')]({'plain':!![]});if(!_0x35ecf1)throw new Error(_0x2255('0x4d'));if(_0x35ecf1['role']===_0x2255('0x4b')){var _0x3c9fa5=_0x5ebcb0[_0x2255('0x4c')]({'plain':!![]});var _0x5ca827=_0x2255('0x23');return db[_0x2255('0x4e')]['find']({'where':{'name':_0x5ca827,'userProfileId':_0x35ecf1[_0x2255('0x4f')]},'raw':!![]})[_0x2255('0x13')](function(_0x3ae936){if(_0x3ae936&&_0x3ae936[_0x2255('0x50')]===0x0){return db['UserProfileResource'][_0x2255('0x49')]({'name':_0x3c9fa5[_0x2255('0x27')],'resourceId':_0x3c9fa5['id'],'type':_0x3ae936[_0x2255('0x27')],'sectionId':_0x3ae936['id']},{})[_0x2255('0x13')](function(){return _0x5ebcb0;});}else{return _0x5ebcb0;}})['catch'](function(_0xea52c8){logger[_0x2255('0x18')](_0x2255('0x51'),_0xea52c8);throw _0xea52c8;});}return _0x5ebcb0;})[_0x2255('0x13')](respondWithResult(_0x1fca6e,0xc9))['catch'](handleError(_0x1fca6e,null));};exports[_0x2255('0x22')]=function(_0x4c2f8d,_0x30a785){if(_0x4c2f8d[_0x2255('0x4a')]['id']){delete _0x4c2f8d[_0x2255('0x4a')]['id'];}return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x4c2f8d['params']['id']},'include':[{'model':db[_0x2255('0x2a')],'as':_0x2255('0x2b')}]})[_0x2255('0x13')](handleEntityNotFound(_0x30a785,null))[_0x2255('0x13')](saveUpdates(_0x4c2f8d[_0x2255('0x4a')],null))[_0x2255('0x13')](respondWithResult(_0x30a785,null))[_0x2255('0x44')](handleError(_0x30a785,null));};exports[_0x2255('0x25')]=function(_0x2cb9b2,_0x43ff87){return db[_0x2255('0x2d')]['find']({'where':{'id':_0x2cb9b2['params']['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x43ff87,null))['then'](removeEntity(_0x43ff87,null))['catch'](handleError(_0x43ff87,null));};exports[_0x2255('0x52')]=function(_0x2648d7,_0x5cfe38){return db[_0x2255('0x2d')]['describe']()[_0x2255('0x13')](respondWithResult(_0x5cfe38,null))['catch'](handleError(_0x5cfe38,null));};exports[_0x2255('0x53')]=function(_0x2aceba,_0x392cb1){if(_0x2aceba['body']['id']){delete _0x2aceba['body']['id'];}return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x2aceba[_0x2255('0x45')]['id']}})['then'](handleEntityNotFound(_0x392cb1,null))[_0x2255('0x13')](function(_0x3ce7ae){if(_0x3ce7ae){_0x2aceba[_0x2255('0x4a')][_0x2255('0x54')]=_0x3ce7ae['id'];return db['Disposition'][_0x2255('0x49')](_0x2aceba[_0x2255('0x4a')]);}})[_0x2255('0x13')](respondWithResult(_0x392cb1,null))['catch'](handleError(_0x392cb1,null));};exports[_0x2255('0x55')]=function(_0x15b5f8,_0x32e35a){var _0x1ff769={'raw':![],'where':{}};var _0xbdaab9={};var _0x3ad724={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2255('0x56')]({'where':{'id':_0x15b5f8['params']['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x32e35a,null))[_0x2255('0x13')](function(_0x5e88fc){if(_0x5e88fc){_0xbdaab9[_0x2255('0x31')]=_[_0x2255('0x46')](db[_0x2255('0x57')]['rawAttributes']);_0xbdaab9[_0x2255('0x2f')]=_[_0x2255('0x46')](_0x15b5f8[_0x2255('0x2f')]);_0xbdaab9['filters']=_[_0x2255('0x30')](_0xbdaab9[_0x2255('0x31')],_0xbdaab9[_0x2255('0x2f')]);_0x1ff769[_0x2255('0x33')]=_[_0x2255('0x30')](_0xbdaab9['model'],qs[_0x2255('0x32')](_0x15b5f8[_0x2255('0x2f')][_0x2255('0x32')]));_0x1ff769[_0x2255('0x33')]=_0x1ff769[_0x2255('0x33')]['length']?_0x1ff769[_0x2255('0x33')]:_0xbdaab9[_0x2255('0x31')];if(!_0x15b5f8['query'][_0x2255('0x35')](_0x2255('0x36'))){_0x1ff769[_0x2255('0x20')]=qs['limit'](_0x15b5f8[_0x2255('0x2f')][_0x2255('0x20')]);_0x1ff769[_0x2255('0x37')]=qs[_0x2255('0x37')](_0x15b5f8[_0x2255('0x2f')][_0x2255('0x37')]);}_0x1ff769[_0x2255('0x38')]=qs[_0x2255('0x39')](_0x15b5f8[_0x2255('0x2f')][_0x2255('0x39')]);_0x1ff769[_0x2255('0x3a')]=qs['filters'](_['pick'](_0x15b5f8[_0x2255('0x2f')],_0xbdaab9['filters']));_0x1ff769[_0x2255('0x3a')]['ChatWebsiteId']=_0x5e88fc['id'];if(_0x15b5f8['query'][_0x2255('0x3d')]){_0x1ff769[_0x2255('0x3a')]=_[_0x2255('0x40')](_0x1ff769['where'],{'$or':_[_0x2255('0x2c')](_0x1ff769[_0x2255('0x33')],function(_0x2ec1c4){var _0x9c9203={};_0x9c9203[_0x2ec1c4]={'$like':'%'+_0x15b5f8['query'][_0x2255('0x3d')]+'%'};return _0x9c9203;})});}_0x1ff769=_[_0x2255('0x40')]({},_0x1ff769,_0x15b5f8[_0x2255('0x41')]);return db[_0x2255('0x57')][_0x2255('0x1f')]({'where':_0x1ff769[_0x2255('0x3a')]})[_0x2255('0x13')](function(_0x5d1b5c){_0x3ad724[_0x2255('0x1f')]=_0x5d1b5c;if(_0x15b5f8['query'][_0x2255('0x58')]){_0x1ff769['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1ff769);})['then'](function(_0x25fb59){_0x3ad724[_0x2255('0x59')]=_0x25fb59;return _0x3ad724;});}})[_0x2255('0x13')](respondWithFilteredResult(_0x32e35a,_0x1ff769))[_0x2255('0x44')](handleError(_0x32e35a,null));};exports[_0x2255('0x5a')]=function(_0x1a127e,_0x5bfaab){return db[_0x2255('0x2d')]['find']({'where':{'id':_0x1a127e['params']['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x5bfaab,null))[_0x2255('0x13')](function(_0x578a68){if(_0x578a68){return _0x578a68[_0x2255('0x5a')](_0x1a127e[_0x2255('0x2f')][_0x2255('0x5b')]);}})['then'](respondWithStatusCode(_0x5bfaab,null))[_0x2255('0x44')](handleError(_0x5bfaab,null));};exports[_0x2255('0x5c')]=function(_0x2f74ea,_0x7018c2){if(_0x2f74ea[_0x2255('0x4a')]['id']){delete _0x2f74ea[_0x2255('0x4a')]['id'];}return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x2f74ea['params']['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x7018c2,null))[_0x2255('0x13')](function(_0x57c7e6){if(_0x57c7e6){_0x2f74ea[_0x2255('0x4a')][_0x2255('0x54')]=_0x57c7e6['id'];return db[_0x2255('0x5d')][_0x2255('0x49')](_0x2f74ea[_0x2255('0x4a')]);}})[_0x2255('0x13')](respondWithResult(_0x7018c2,null))[_0x2255('0x44')](handleError(_0x7018c2,null));};exports[_0x2255('0x5e')]=function(_0x43a1ac,_0x459a89){var _0x1cb659={'raw':![],'where':{}};var _0x4573d5={};var _0x2e6de7={'count':0x0,'rows':[]};return db[_0x2255('0x2d')][_0x2255('0x56')]({'where':{'id':_0x43a1ac[_0x2255('0x45')]['id']}})['then'](handleEntityNotFound(_0x459a89,null))['then'](function(_0x546bea){if(_0x546bea){_0x4573d5[_0x2255('0x31')]=_[_0x2255('0x46')](db[_0x2255('0x5d')][_0x2255('0x47')]);_0x4573d5[_0x2255('0x2f')]=_['keys'](_0x43a1ac[_0x2255('0x2f')]);_0x4573d5[_0x2255('0x3b')]=_[_0x2255('0x30')](_0x4573d5['model'],_0x4573d5[_0x2255('0x2f')]);_0x1cb659[_0x2255('0x33')]=_[_0x2255('0x30')](_0x4573d5['model'],qs[_0x2255('0x32')](_0x43a1ac['query'][_0x2255('0x32')]));_0x1cb659[_0x2255('0x33')]=_0x1cb659['attributes']['length']?_0x1cb659[_0x2255('0x33')]:_0x4573d5[_0x2255('0x31')];if(!_0x43a1ac['query'][_0x2255('0x35')](_0x2255('0x36'))){_0x1cb659[_0x2255('0x20')]=qs['limit'](_0x43a1ac[_0x2255('0x2f')][_0x2255('0x20')]);_0x1cb659[_0x2255('0x37')]=qs['offset'](_0x43a1ac[_0x2255('0x2f')]['offset']);}_0x1cb659[_0x2255('0x38')]=qs[_0x2255('0x39')](_0x43a1ac[_0x2255('0x2f')][_0x2255('0x39')]);_0x1cb659[_0x2255('0x3a')]=qs['filters'](_[_0x2255('0x3c')](_0x43a1ac[_0x2255('0x2f')],_0x4573d5[_0x2255('0x3b')]));_0x1cb659[_0x2255('0x3a')][_0x2255('0x54')]=_0x546bea['id'];if(_0x43a1ac[_0x2255('0x2f')]['filter']){_0x1cb659[_0x2255('0x3a')]=_['merge'](_0x1cb659[_0x2255('0x3a')],{'$or':_[_0x2255('0x2c')](_0x1cb659[_0x2255('0x33')],function(_0x5d9cf8){var _0x4c503b={};_0x4c503b[_0x5d9cf8]={'$like':'%'+_0x43a1ac[_0x2255('0x2f')][_0x2255('0x3d')]+'%'};return _0x4c503b;})});}_0x1cb659=_[_0x2255('0x40')]({},_0x1cb659,_0x43a1ac[_0x2255('0x41')]);return db[_0x2255('0x5d')][_0x2255('0x1f')]({'where':_0x1cb659[_0x2255('0x3a')]})[_0x2255('0x13')](function(_0x15cd68){_0x2e6de7[_0x2255('0x1f')]=_0x15cd68;if(_0x43a1ac[_0x2255('0x2f')]['includeAll']){_0x1cb659[_0x2255('0x42')]=[{'all':!![]}];}return db[_0x2255('0x5d')][_0x2255('0x43')](_0x1cb659);})[_0x2255('0x13')](function(_0x3a4fc6){_0x2e6de7[_0x2255('0x59')]=_0x3a4fc6;return _0x2e6de7;});}})[_0x2255('0x13')](respondWithFilteredResult(_0x459a89,_0x1cb659))[_0x2255('0x44')](handleError(_0x459a89,null));};exports[_0x2255('0x5f')]=function(_0x2f84ce,_0x18b269){return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x2f84ce[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x18b269,null))[_0x2255('0x13')](function(_0x22e570){if(_0x22e570){return _0x22e570[_0x2255('0x5f')](_0x2f84ce['query'][_0x2255('0x5b')]);}})['then'](respondWithStatusCode(_0x18b269,null))[_0x2255('0x44')](handleError(_0x18b269,null));};exports[_0x2255('0x60')]=function(_0x1ef5cd,_0x299f40){_0x1ef5cd['body']['sitepic']=_0x1ef5cd[_0x2255('0x61')][_0x2255('0x62')];return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x1ef5cd['params']['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x299f40,null))[_0x2255('0x13')](saveUpdates(_0x1ef5cd[_0x2255('0x4a')],null))[_0x2255('0x13')](respondWithResult(_0x299f40,null))['catch'](handleError(_0x299f40,null));};exports[_0x2255('0x63')]=function(_0x2a897f,_0x17ece0){_0x2a897f[_0x2255('0x4a')]['agentAvatar']=_0x2a897f['file'][_0x2255('0x62')];return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x2a897f[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x17ece0,null))[_0x2255('0x13')](saveUpdates(_0x2a897f['body'],null))[_0x2255('0x13')](respondWithResult(_0x17ece0,null))[_0x2255('0x44')](handleError(_0x17ece0,null));};exports[_0x2255('0x64')]=function(_0x46da65,_0x542ed1){_0x46da65[_0x2255('0x4a')]['customerAvatar']=_0x46da65['file'][_0x2255('0x62')];return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x46da65[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x542ed1,null))[_0x2255('0x13')](saveUpdates(_0x46da65[_0x2255('0x4a')],null))[_0x2255('0x13')](respondWithResult(_0x542ed1,null))['catch'](handleError(_0x542ed1,null));};exports['addSystemAvatar']=function(_0x2ddce5,_0x1e0471){_0x2ddce5['body'][_0x2255('0x65')]=_0x2ddce5['file']['filename'];return db[_0x2255('0x2d')]['find']({'where':{'id':_0x2ddce5['params']['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x1e0471,null))['then'](saveUpdates(_0x2ddce5[_0x2255('0x4a')],null))['then'](respondWithResult(_0x1e0471,null))[_0x2255('0x44')](handleError(_0x1e0471,null));};exports[_0x2255('0x66')]=function(_0x348bf0,_0x3ecf30){var _0x23ced0=path[_0x2255('0x67')](config['root'],_0x2255('0x68'));var _0x5b2425={'where':{'id':_0x348bf0[_0x2255('0x45')]['id']},'attributes':['id',_0x2255('0x69')],'raw':!![]};var _0x4cef55=![];return require(_0x2255('0x6a'))['getLicense']()['then'](function(_0x132f78){if(_0x132f78){_0x4cef55=_0x132f78['custom'];}})[_0x2255('0x13')](function(){return db['ChatWebsite'][_0x2255('0x48')](_0x5b2425);})[_0x2255('0x13')](handleEntityNotFound(_0x3ecf30,null))['then'](function(_0x3839ab){if(_0x3839ab){if(!_[_0x2255('0x6b')](_0x3839ab['sitepic'])){if(fs['existsSync'](path['join'](config[_0x2255('0x6c')],_0x2255('0x6d'),_0x3839ab[_0x2255('0x69')]))&&_0x4cef55){_0x23ced0=path['join'](config[_0x2255('0x6c')],_0x2255('0x6d'),_0x3839ab[_0x2255('0x69')]);}}return _0x3ecf30[_0x2255('0x6e')](_0x23ced0);}})[_0x2255('0x44')](handleError(_0x3ecf30,null));};exports[_0x2255('0x6f')]=function(_0x13bd2d,_0x10d88f){var _0x451494=path[_0x2255('0x67')](config[_0x2255('0x6c')],_0x2255('0x70'));var _0x508ef7={'where':{'id':_0x13bd2d[_0x2255('0x45')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x2255('0x2d')][_0x2255('0x48')](_0x508ef7)[_0x2255('0x13')](handleEntityNotFound(_0x10d88f,null))['then'](function(_0xdd5e72){if(_0xdd5e72){if(!_[_0x2255('0x6b')](_0xdd5e72[_0x2255('0x71')])){if(fs[_0x2255('0x72')](path['join'](config['root'],_0x2255('0x73'),_0xdd5e72['agentAvatar']))){_0x451494=path[_0x2255('0x67')](config['root'],_0x2255('0x73'),_0xdd5e72[_0x2255('0x71')]);}}return _0x10d88f[_0x2255('0x6e')](_0x451494);}})[_0x2255('0x44')](handleError(_0x10d88f,null));};exports[_0x2255('0x74')]=function(_0x2ba9f,_0x3ba0d8){var _0x65ecd1=path[_0x2255('0x67')](config[_0x2255('0x6c')],_0x2255('0x75'));var _0x2a0db0={'where':{'id':_0x2ba9f['params']['id']},'attributes':['id',_0x2255('0x76'),_0x2255('0x77')],'raw':!![]};return db[_0x2255('0x2d')][_0x2255('0x48')](_0x2a0db0)[_0x2255('0x13')](handleEntityNotFound(_0x3ba0d8,null))['then'](function(_0xfd858c){if(_0xfd858c){if(!_[_0x2255('0x6b')](_0xfd858c['customerAvatar'])){if(fs['existsSync'](path['join'](config[_0x2255('0x6c')],_0x2255('0x73'),_0xfd858c['customerAvatar']))&&_0xfd858c[_0x2255('0x77')]){_0x65ecd1=path[_0x2255('0x67')](config[_0x2255('0x6c')],_0x2255('0x73'),_0xfd858c[_0x2255('0x76')]);}}return _0x3ba0d8[_0x2255('0x6e')](_0x65ecd1);}})['catch'](handleError(_0x3ba0d8,null));};exports[_0x2255('0x78')]=function(_0x42a762,_0x208637){var _0xc34330=path[_0x2255('0x67')](config[_0x2255('0x6c')],'server/files/images/avatars/system_avatar.png');var _0x2af09e={'where':{'id':_0x42a762[_0x2255('0x45')]['id']},'attributes':['id',_0x2255('0x65')],'raw':!![]};return db[_0x2255('0x2d')][_0x2255('0x48')](_0x2af09e)[_0x2255('0x13')](handleEntityNotFound(_0x208637,null))['then'](function(_0x435639){if(_0x435639){if(!_[_0x2255('0x6b')](_0x435639['systemAvatar'])){if(fs[_0x2255('0x72')](path['join'](config['root'],_0x2255('0x73'),_0x435639['systemAvatar']))){_0xc34330=path[_0x2255('0x67')](config[_0x2255('0x6c')],_0x2255('0x73'),_0x435639[_0x2255('0x65')]);}}return _0x208637[_0x2255('0x6e')](_0xc34330);}})[_0x2255('0x44')](handleError(_0x208637,null));};exports[_0x2255('0x79')]=function(_0x4dfb3b,_0x1e8515){var _0x1daaee=require(_0x2255('0x7a'));var _0x50ec82=new _0x1daaee();var _0x12b9cd=_0x50ec82[_0x2255('0x7b')](_0x4dfb3b[_0x2255('0x7c')][_0x2255('0x7d')])['getResult']();var _0x31c0a4={'body':_0x4dfb3b[_0x2255('0x4a')],'channel':'chat'};var _0x488550=[];var _0x4eb4d7=[];var _0x2ffe0e={};var _0x450d66=![];return db[_0x2255('0x7e')]['describe']()[_0x2255('0x13')](function(_0xf640b8){if(!_0xf640b8){throw new db[(_0x2255('0x7f'))][(_0x2255('0x80'))](_0x2255('0x81'));}_0x488550=_[_0x2255('0x82')](_[_0x2255('0x46')](_0xf640b8),['createdAt',_0x2255('0x83')]);_0x4eb4d7=_[_0x2255('0x82')](_[_0x2255('0x46')](_0xf640b8),[_0x2255('0x84'),_0x2255('0x83'),_0x2255('0x85'),_0x2255('0x86')]);if(_0x4dfb3b[_0x2255('0x4a')]['id']){delete _0x4dfb3b[_0x2255('0x4a')]['id'];}if(_[_0x2255('0x6b')](_0x4dfb3b[_0x2255('0x4a')][_0x2255('0x87')])){throw new db[(_0x2255('0x7f'))]['ValidationError'](_0x2255('0x88'));}if(_[_0x2255('0x6b')](_0x4dfb3b[_0x2255('0x4a')]['body'])||_0x4dfb3b[_0x2255('0x4a')][_0x2255('0x4a')]===''){throw new db['Sequelize'][(_0x2255('0x80'))](_0x2255('0x89'));}if(_[_0x2255('0x6b')](_0x4dfb3b[_0x2255('0x4a')][_0x2255('0x8a')])){throw new db['Sequelize'][(_0x2255('0x80'))](_0x2255('0x8b')+_0x4eb4d7);}if(!_[_0x2255('0x8c')](_0x4eb4d7,_0x4dfb3b[_0x2255('0x4a')][_0x2255('0x8a')])){throw new db[(_0x2255('0x7f'))][(_0x2255('0x80'))](_0x2255('0x8d')+_0x4eb4d7);}_0x2ffe0e[_0x4dfb3b[_0x2255('0x4a')][_0x2255('0x8a')]]=_0x4dfb3b[_0x2255('0x4a')]['from'];})[_0x2255('0x13')](function(){return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0x4dfb3b[_0x2255('0x45')]['id']},'include':[{'model':db[_0x2255('0x8e')],'as':_0x2255('0x8f'),'include':[{'model':db[_0x2255('0x7e')],'as':_0x2255('0x90'),'where':_0x2ffe0e,'limit':0x1,'order':[['updatedAt',_0x2255('0x91')]]}]},{'model':db[_0x2255('0x92')],'as':'Applications'}]});})[_0x2255('0x13')](handleEntityNotFound(_0x1e8515,null))['then'](function(_0x2756cf){if(_0x2756cf&&_0x2756cf[_0x2255('0x8f')]){_0x31c0a4['account']=_0x2756cf;_0x31c0a4[_0x2255('0x93')]=_0x2756cf[_0x2255('0x94')];_0x31c0a4['list']=_0x2756cf['List'];_0x31c0a4[_0x2255('0x93')]=_[_0x2255('0x95')](_0x31c0a4['applications'],[_0x2255('0x96')],[_0x2255('0x97')]);if(_0x31c0a4[_0x2255('0x98')][_0x2255('0x94')]){delete _0x31c0a4[_0x2255('0x98')][_0x2255('0x94')];}if(_0x31c0a4[_0x2255('0x98')][_0x2255('0x8f')]&&_0x31c0a4['account'][_0x2255('0x8f')]['Contacts']['length']){return _0x31c0a4[_0x2255('0x98')][_0x2255('0x8f')][_0x2255('0x90')][0x0];}var _0x7ab084=_[_0x2255('0xb')](_0x4dfb3b['body'],{'firstName':_0x4dfb3b[_0x2255('0x4a')]['from'],'ListId':_0x2756cf['ListId']});_0x7ab084[_0x4dfb3b[_0x2255('0x4a')]['mapKey']]=_0x4dfb3b[_0x2255('0x4a')]['from'];return db[_0x2255('0x7e')]['create'](_0x7ab084,{'fields':_0x488550,'raw':!![]});}})[_0x2255('0x13')](handleEntityNotFound(_0x1e8515,null))[_0x2255('0x13')](function(_0x11879d){_0x31c0a4[_0x2255('0x99')]=_0x11879d;var _0x1a00e4=_0x4dfb3b['body'][_0x2255('0x9a')];if(_0x4dfb3b[_0x2255('0x7c')][_0x2255('0x9b')]){_0x1a00e4=_0x4dfb3b['headers']['cf-connecting-ip'];}else if(_0x4dfb3b[_0x2255('0x7c')][_0x2255('0x9c')]){_0x1a00e4=_[_0x2255('0x9d')](_0x4dfb3b['headers'][_0x2255('0x9c')]['split'](','));}if(_0x11879d){var _0x2a5cab={'ContactId':_0x11879d['id'],'ChatWebsiteId':_0x4dfb3b['params']['id'],'from':(_0x11879d['firstName']||'')+'\x20'+(_0x11879d['lastName']||''),'customerIp':_0x1a00e4,'customerPort':_0x4dfb3b[_0x2255('0x7c')][_0x2255('0x9e')]?_0x4dfb3b['headers']['x-real-port']:null,'referer':_0x4dfb3b[_0x2255('0x4a')][_0x2255('0x9f')],'browserName':_0x12b9cd[_0x2255('0xa0')][_0x2255('0x27')]&&_0x12b9cd['browser'][_0x2255('0xa1')]?util['format'](_0x2255('0xa2'),_0x12b9cd[_0x2255('0xa0')][_0x2255('0x27')],_0x12b9cd[_0x2255('0xa0')][_0x2255('0xa1')]):_0x2255('0xa3'),'browserVersion':_0x12b9cd[_0x2255('0xa0')][_0x2255('0xa1')]||'unknown','osName':util[_0x2255('0xa4')](_0x2255('0xa2'),_0x12b9cd['os'][_0x2255('0x27')],_0x12b9cd['os'][_0x2255('0xa1')]),'osVersion':_0x12b9cd['os'][_0x2255('0xa1')],'deviceModel':_0x12b9cd[_0x2255('0xa5')][_0x2255('0x31')]&&_0x12b9cd['device']['vendor']?util['format']('%s\x20%s\x20%s',_0x12b9cd[_0x2255('0xa5')]['model'],_0x12b9cd['device']['vendor'],_0x12b9cd['device'][_0x2255('0x3e')]):null,'deviceVendor':_0x12b9cd[_0x2255('0xa5')]['vendor'],'deviceType':_0x12b9cd[_0x2255('0xa5')][_0x2255('0x3e')],'formData':JSON[_0x2255('0xa6')](_0x4dfb3b['body'])};var _0x93374f={'ChatWebsiteId':_0x4dfb3b[_0x2255('0x45')]['id'],'closed':![]};if(_0x4dfb3b[_0x2255('0x4a')][_0x2255('0xa7')]){_0x93374f[_0x2255('0xa7')]=_0x4dfb3b['body'][_0x2255('0xa7')];return db[_0x2255('0xa8')]['find']({'where':_0x93374f})[_0x2255('0x13')](function(_0x4e7188){if(_0x4e7188){return[_0x4e7188,![]];}_0x2a5cab[_0x2255('0xa7')]=_0x4dfb3b[_0x2255('0x4a')][_0x2255('0xa7')];_0x2a5cab[_0x2255('0xa9')]=_0x4dfb3b['body'][_0x2255('0xa9')];return db[_0x2255('0xa8')]['create'](_0x2a5cab)[_0x2255('0x13')](function(_0x5a6ccd){return[_0x5a6ccd,!![]];});});}_0x93374f[_0x2255('0xaa')]=_0x11879d['id'];if(_0x4dfb3b['body']['interaction']&&_0x4dfb3b[_0x2255('0x4a')][_0x2255('0xab')]['id']){_0x93374f['id']=_0x4dfb3b[_0x2255('0x4a')]['interaction']['id'];return db['ChatInteraction']['find']({'where':_0x93374f})[_0x2255('0x13')](function(_0x57e726){if(_0x57e726){return[_0x57e726,![]];}return db[_0x2255('0xa8')][_0x2255('0x49')](_0x2a5cab)[_0x2255('0x13')](function(_0x2536ba){return[_0x2536ba,!![]];});});}return db[_0x2255('0xa8')][_0x2255('0x49')](_0x2a5cab)['then'](function(_0x527634){return[_0x527634,!![]];});}})['spread'](function(_0x75fad,_0xe0da67){if(_0x75fad){_0x450d66=_0xe0da67;if(!_0xe0da67){var _0x31cf4e={'from':(_0x31c0a4[_0x2255('0x99')]['firstName']||'')+'\x20'+(_0x31c0a4['contact'][_0x2255('0xac')]||'')};if(_0x4dfb3b['body'][_0x2255('0xa7')]&&_0x4dfb3b[_0x2255('0x4a')][_0x2255('0xad')]&&_0x4dfb3b[_0x2255('0x4a')][_0x2255('0xa7')]!=_0x4dfb3b[_0x2255('0x4a')][_0x2255('0xad')]){_0x31cf4e['threadId']=_0x4dfb3b['body']['messageId'];}return _0x75fad[_0x2255('0x22')](_0x31cf4e);}else{return _0x75fad;}}})['then'](function(_0x1ca603){_0x31c0a4[_0x2255('0xab')]=_0x1ca603[_0x2255('0x4c')]({'plain':!![]});_0x31c0a4['interaction'][_0x2255('0xae')]=_0x450d66;if(_0x31c0a4['interaction'][_0x2255('0xae')]){if(_0x31c0a4[_0x2255('0x98')][_0x2255('0xaf')]){_0x31c0a4['applications']['push']({'id':0x0,'priority':_0x31c0a4[_0x2255('0x93')][_0x2255('0x34')]+0x1,'app':_0x2255('0xb0'),'appdata':_0x2255('0xb1'),'interval':_0x2255('0xb2')});}}return db['ChatMessage'][_0x2255('0x49')]({'body':_0x4dfb3b[_0x2255('0x4a')]['body'],'ChatWebsiteId':_0x4dfb3b[_0x2255('0x45')]['id'],'ChatInteractionId':_0x1ca603['id'],'direction':'in','ContactId':_0x31c0a4[_0x2255('0x99')]['id'],'AttachmentId':_0x4dfb3b[_0x2255('0x4a')][_0x2255('0xb3')]});})[_0x2255('0x13')](function(_0x2b376c){_0x31c0a4['message']=_0x2b376c;if(_0x31c0a4['interaction'][_0x2255('0xb4')]){return db['User'][_0x2255('0x48')]({'attributes':['id',_0x2255('0x27')],'where':{'id':_0x31c0a4[_0x2255('0xab')][_0x2255('0xb4')]}})['then'](function(_0x4b2da5){if(_0x4b2da5){_0x31c0a4[_0x2255('0x93')]['unshift']({'id':0x0,'priority':0x0,'app':_0x2255('0xb5'),'appdata':_0x4b2da5[_0x2255('0x27')]+','+(_0x31c0a4[_0x2255('0x98')][_0x2255('0xb6')]||0xa),'interval':_0x2255('0xb2')});_0x31c0a4[_0x2255('0xb7')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x31c0a4);});}return respondWithRpcPromise('Start',_0x2255('0xb8'),_0x31c0a4);})[_0x2255('0x13')](function(_0xade164){respondWithRpcPromise(_0x2255('0xb9'),_0x2255('0xb9'),{'event':_0x2255('0x79'),'message':_0xade164},client9002);return _0xade164;})[_0x2255('0x13')](respondWithResult(_0x1e8515,null))[_0x2255('0x44')](handleError(_0x1e8515,null));};exports[_0x2255('0xba')]=function(_0xd0b191,_0x5b50c9){var _0x489100,_0x4e1abc,_0x20f6c0;var _0x4e99f0=[];var _0x3ac5cb={};var _0x3dd387=_0xd0b191[_0x2255('0xbb')]||[];var _0x2e29de=[];var _0x20b839;return db[_0x2255('0x7e')][_0x2255('0x52')]()[_0x2255('0x13')](function(_0x18eeee){if(!_0x18eeee){throw new db['Sequelize']['ValidationError'](_0x2255('0x81'));}_0x4e99f0=_[_0x2255('0x82')](_[_0x2255('0x46')](_0x18eeee),['createdAt',_0x2255('0x83'),_0x2255('0x85'),'ListId']);if(_0xd0b191['body']['id']){delete _0xd0b191[_0x2255('0x4a')]['id'];}if(_[_0x2255('0x6b')](_0xd0b191[_0x2255('0x4a')][_0x2255('0x87')])){throw _0x5b50c9[_0x2255('0x1b')](0x1f4)['send'](new db[(_0x2255('0x7f'))][(_0x2255('0x80'))](_0x2255('0x88')));}if(_[_0x2255('0x6b')](_0xd0b191['body'][_0x2255('0x4a')])||_0xd0b191['body'][_0x2255('0x4a')]===''){throw _0x5b50c9[_0x2255('0x1b')](0x1f4)[_0x2255('0x28')](new db[(_0x2255('0x7f'))]['ValidationError'](_0x2255('0x89')));}if(_[_0x2255('0x6b')](_0xd0b191[_0x2255('0x4a')][_0x2255('0xbc')])){throw _0x5b50c9['status'](0x1f4)[_0x2255('0x28')](new db[(_0x2255('0x7f'))][(_0x2255('0x80'))](_0x2255('0xbd')+_0x4e99f0));}if(!_['includes'](_0x4e99f0,_0xd0b191[_0x2255('0x4a')][_0x2255('0xbc')])){throw _0x5b50c9['status'](0x1f4)[_0x2255('0x28')](new db[(_0x2255('0x7f'))][(_0x2255('0x80'))](_0x2255('0xbe')+_0x4e99f0));}_0x3ac5cb[_0xd0b191[_0x2255('0x4a')][_0x2255('0xbc')]]=_0xd0b191['body'][_0x2255('0x87')];})[_0x2255('0x13')](function(){return db[_0x2255('0x2d')][_0x2255('0x48')]({'where':{'id':_0xd0b191[_0x2255('0x45')]['id']},'include':[{'model':db[_0x2255('0x8e')],'as':_0x2255('0x8f')},{'model':db[_0x2255('0xbf')],'as':_0x2255('0xbf')}]});})[_0x2255('0x13')](handleEntityNotFound(_0x5b50c9,null))[_0x2255('0x13')](function(_0x272d2e){if(_0x272d2e&&_0x272d2e[_0x2255('0x8f')]){_0x4e1abc=_0x272d2e;var _0x5b3dab=_[_0x2255('0xb')](_0xd0b191[_0x2255('0x4a')],{'firstName':_0xd0b191[_0x2255('0x4a')]['from'],'phone':_0xd0b191[_0x2255('0x4a')][_0x2255('0x87')],'ListId':_0x272d2e[_0x2255('0x86')]});_0x5b3dab[_0xd0b191['body']['mapKeyOffline']]=_0xd0b191['body']['from'];return db['CmContact'][_0x2255('0xc0')]({'where':_0x3ac5cb,'defaults':_0x5b3dab});}})[_0x2255('0xc1')](function(_0x3e758b){if(_0x3e758b){_0x20f6c0=_0x3e758b;var _0x10b6b0=fs[_0x2255('0xc2')](path[_0x2255('0x67')](config[_0x2255('0x6c')],_0x2255('0xc3')),'utf8');var _0x4e2201=ejs['render'](_0x10b6b0,{'body':_[_0x2255('0xc4')](_0xd0b191[_0x2255('0x4a')][_0x2255('0x4a')]),'bodyTitle':_0x4e1abc[_0x2255('0xc5')]});return db[_0x2255('0xc6')][_0x2255('0x49')]({'body':_0x4e2201,'plainBody':htmlToText[_0x2255('0xc7')](_0x4e2201),'ContactId':_0x3e758b['id'],'ChatWebsiteId':_0x4e1abc['id']});}})[_0x2255('0x13')](function(_0x29d98a){_0x20b839=_0x29d98a;if(_0x3dd387['length']){var _0x29c7d6=_0x3dd387[_0x2255('0x2c')](function(_0x14692b){return{'name':_0x14692b[_0x2255('0xc8')],'basename':_0x14692b['filename'],'type':_0x14692b[_0x2255('0xc9')],'ChatOfflineMessageId':_0x29d98a['id']};});_0x2e29de=_0x29c7d6['map'](_0xc2f789=>{var _0x89281={'filename':_0xc2f789['name'],'path':path['join'](config[_0x2255('0x6c')],'server',_0x2255('0xbb'),_0x2255('0xca'),'offline-chat',_0xc2f789[_0x2255('0xcb')])};return _0x89281;});if(!_0x4e1abc[_0x2255('0xcc')]){return db[_0x2255('0xcd')][_0x2255('0xce')](function(_0x92e3a){return db[_0x2255('0xcf')]['bulkCreate'](_0x29c7d6,{'transaction':_0x92e3a});});}}})['then'](function(){if(_0x20b839){_0x489100=_0x20b839;return db[_0x2255('0xbf')][_0x2255('0x56')]({'where':{'service':!![]},'include':[{'model':db[_0x2255('0xd0')],'as':_0x2255('0xd1'),'raw':!![],'include':[{'model':db[_0x2255('0xd2')],'as':_0x2255('0xd2'),'raw':!![]}]}]});}})[_0x2255('0x13')](function(_0x52f99b){if(_0x52f99b&&_0x52f99b[_0x2255('0xd1')]&&_0x4e1abc[_0x2255('0xd3')]&&_0x4e1abc[_0x2255('0xd4')]){var _0x5a9057=_0x52f99b['getSmtpOptions']();return respondWithRpcPromise(_0x2255('0xd5'),_0x2255('0xd6'),{'account':_0x5a9057,'message':{'from':util[_0x2255('0xa4')](_0x2255('0xd7'),_0x52f99b[_0x2255('0x27')],_0x52f99b[_0x2255('0xd8')]||_0x52f99b[_0x2255('0xd1')][_0x2255('0x4b')]),'to':_0x4e1abc[_0x2255('0xd4')],'subject':_0x4e1abc[_0x2255('0xd9')],'html':_0x489100['body'],'attachments':_0x2e29de}},client9003)[_0x2255('0x13')](function(){return _0x489100;})[_0x2255('0x44')](function(_0x16d042){logger[_0x2255('0x18')](_0x16d042);});}})[_0x2255('0x13')](function(){if(_0x4e1abc&&_0x4e1abc[_0x2255('0xcc')]&&_0x4e1abc[_0x2255('0xda')]){var _0x3aa029=[];if(_0x3dd387['length']){_0x3aa029=_0x3dd387[_0x2255('0x2c')](function(_0x2f2226){return{'name':_0x2f2226[_0x2255('0xc8')],'basename':_0x2f2226[_0x2255('0x62')],'type':_0x2f2226[_0x2255('0xc9')],'ChatOfflineMessageId':_0x20b839['id']};});}var _0xd05cf4;if(!_[_0x2255('0x6b')](_0x4e1abc['subjectOffline'])){var _0x28db2b=_[_0x2255('0x2c')](_0xd0b191['body'],function(_0x512d94){return _0x512d94;});var _0xf73e24=_['toPairsIn'](_0x28db2b)[0x0];var _0x154b6f=_[_0x2255('0xdb')](_0xf73e24,function(_0x3df43a){return _0x3df43a;});_0xd05cf4=_0x154b6f[0x1][_0x4e1abc[_0x2255('0xdc')]];}var _0x45df49={'from':_0x20f6c0[_0x2255('0xd8')],'firstName':_0x20f6c0[_0x2255('0xdd')],'lastName':_0x20f6c0[_0x2255('0xac')],'mapKey':_0x2255('0xd8'),'message':{'from':_0x20f6c0[_0x2255('0xd8')],'to':_0x4e1abc[_0x2255('0xbf')][_0x2255('0xd8')],'cc':'','subject':_[_0x2255('0x6b')](_0xd05cf4)?_0x4e1abc[_0x2255('0xd9')]:_0xd05cf4,'messageId':'','sentAt':new Date(),'attach':_0x3aa029['length'],'attachments':_0x3aa029,'originChannel':_0x2255('0xde'),'ChatWebsiteId':_0x4e1abc['id'],'ChatOfflineMessageId':_0x489100['id'],'originTo':_0x4e1abc[_0x2255('0xbf')][_0x2255('0xd8')]},'body':_0x489100['body']};var _0x1bc506={'account':{'id':_0x4e1abc[_0x2255('0xda')]},'body':_0x45df49,'log':_0x2255('0xdf')};return respondWithRpcPromise(_0x2255('0xdf'),_0x2255('0xe0'),_0x1bc506,client9001)[_0x2255('0x13')](function(){return _0x489100;})['catch'](function(_0x1d3d7c){logger[_0x2255('0x18')](_0x1d3d7c);});}return;})['then'](function(){if(_0x489100){return _0x489100;}})['then'](respondWithResult(_0x5b50c9,null))[_0x2255('0x44')](function(_0xfa6f06){logger[_0x2255('0x18')](_0x2255('0x44'),_0xfa6f06);for(var _0x59e784 of _0x3dd387){var _0x2a3b6d=path[_0x2255('0x67')](config[_0x2255('0x6c')],_0x2255('0xe1'),_0x2255('0xbb'),_0x2255('0xca'),_0x2255('0xe2'),_0x59e784[_0x2255('0x62')]);fs_extra['remove'](_0x2a3b6d)[_0x2255('0x44')](function(_0x373729){logger[_0x2255('0x18')](_0x2255('0xe3'),_0x2a3b6d,_0x373729);});}});};exports[_0x2255('0xe4')]=function(_0x1c1891,_0x3d8d26){return db['ChatInteraction']['find']({'where':{'id':_0x1c1891[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x3d8d26,null))[_0x2255('0x13')](function(_0x142bef){if(_0x142bef){return _0x142bef['addInteraction'](_0x1c1891[_0x2255('0x4a')][_0x2255('0x5b')],_['omit'](_0x1c1891['body'],[_0x2255('0x5b'),'id'])||{});}})[_0x2255('0x13')](respondWithResult(_0x3d8d26,null))['catch'](handleError(_0x3d8d26,null));};exports[_0x2255('0xe5')]=function(_0x27bf61,_0x4bd979){var _0x1adfaf={'raw':![],'where':{}};var _0x10d746={};var _0x300814={'count':0x0,'rows':[]};return db[_0x2255('0x2d')][_0x2255('0x56')]({'where':{'id':_0x27bf61[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x4bd979,null))[_0x2255('0x13')](function(_0x393187){if(_0x393187){_0x10d746[_0x2255('0x31')]=_[_0x2255('0x46')](db[_0x2255('0xa8')][_0x2255('0x47')]);_0x10d746[_0x2255('0x2f')]=_[_0x2255('0x46')](_0x27bf61['query']);_0x10d746[_0x2255('0x3b')]=_[_0x2255('0x30')](_0x10d746[_0x2255('0x31')],_0x10d746['query']);_0x1adfaf[_0x2255('0x33')]=_[_0x2255('0x30')](_0x10d746[_0x2255('0x31')],qs[_0x2255('0x32')](_0x27bf61[_0x2255('0x2f')][_0x2255('0x32')]));_0x1adfaf['attributes']=_0x1adfaf[_0x2255('0x33')][_0x2255('0x34')]?_0x1adfaf[_0x2255('0x33')]:_0x10d746[_0x2255('0x31')];if(!_0x27bf61[_0x2255('0x2f')][_0x2255('0x35')](_0x2255('0x36'))){_0x1adfaf[_0x2255('0x20')]=qs['limit'](_0x27bf61['query'][_0x2255('0x20')]);_0x1adfaf[_0x2255('0x37')]=qs['offset'](_0x27bf61[_0x2255('0x2f')][_0x2255('0x37')]);}_0x1adfaf[_0x2255('0x38')]=qs[_0x2255('0x39')](_0x27bf61[_0x2255('0x2f')][_0x2255('0x39')]);_0x1adfaf[_0x2255('0x3a')]=qs[_0x2255('0x3b')](_['pick'](_0x27bf61[_0x2255('0x2f')],_0x10d746[_0x2255('0x3b')]));_0x1adfaf[_0x2255('0x3a')][_0x2255('0x54')]=_0x393187['id'];if(_0x27bf61['query'][_0x2255('0x3d')]){_0x1adfaf['where']=_[_0x2255('0x40')](_0x1adfaf[_0x2255('0x3a')],{'$or':_[_0x2255('0x2c')](_0x1adfaf['attributes'],function(_0x5d7a39){var _0x5a7264={};_0x5a7264[_0x5d7a39]={'$like':'%'+_0x27bf61[_0x2255('0x2f')][_0x2255('0x3d')]+'%'};return _0x5a7264;})});}_0x1adfaf=_[_0x2255('0x40')]({},_0x1adfaf,_0x27bf61[_0x2255('0x41')]);return db['ChatInteraction'][_0x2255('0x1f')]({'where':_0x1adfaf[_0x2255('0x3a')]})[_0x2255('0x13')](function(_0x8cd8ee){_0x300814[_0x2255('0x1f')]=_0x8cd8ee;if(_0x27bf61[_0x2255('0x2f')]['includeAll']){_0x1adfaf[_0x2255('0x42')]=[{'model':db[_0x2255('0x7e')],'as':_0x2255('0xe6'),'required':![]},{'model':db[_0x2255('0xe7')],'as':_0x2255('0xe8'),'attributes':[_0x2255('0x27'),'fullname',_0x2255('0xe9')],'required':![]},{'model':db[_0x2255('0xea')],'as':_0x2255('0xeb'),'attributes':['id',_0x2255('0x27'),'color'],'where':_0x27bf61[_0x2255('0x2f')][_0x2255('0xec')]?{'id':_0x27bf61[_0x2255('0x2f')][_0x2255('0xec')]}:undefined,'required':_0x27bf61[_0x2255('0x2f')][_0x2255('0xec')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x1adfaf);})[_0x2255('0x13')](function(_0x2f2fe1){_0x300814['rows']=_0x2f2fe1;return _0x300814;});}})[_0x2255('0x13')](respondWithFilteredResult(_0x4bd979,_0x1adfaf))['catch'](handleError(_0x4bd979,null));};function iftimePromise(_0x1ee3b5,_0x541df3){return respondWithRpcPromise(_0x2255('0xed'),_0x2255('0xee'),{'command':_0x541df3[_0x2255('0xef')]?util['format'](_0x2255('0xf0'),_0x1ee3b5['interval'],_0x541df3[_0x2255('0xef')]):util[_0x2255('0xa4')](_0x2255('0xf1'),_0x1ee3b5['interval'])},client9002)['then'](function(_0x26dd3e){var _0x6428f5=_0x26dd3e&&_0x26dd3e[_0x2255('0xf2')]('true')>=0x0?!![]:![];logger[_0x2255('0x14')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x541df3['id'],_0x1ee3b5['id'],_0x1ee3b5['interval'],_0x6428f5?_0x2255('0xf3'):_0x2255('0xf4'),_0x541df3[_0x2255('0xef')]?_0x541df3[_0x2255('0xef')]:'No\x20timezone');return _0x6428f5;})[_0x2255('0x44')](function(_0x24f20e){logger['error'](_0x2255('0xf5'),_0x541df3['id'],_0x1ee3b5['id'],_0x1ee3b5[_0x2255('0xf6')],util[_0x2255('0xf7')](_0x24f20e,{'showHidden':![],'depth':null}),_0x541df3[_0x2255('0xef')]?_0x541df3[_0x2255('0xef')]:'No\x20timezone');return![];});}exports[_0x2255('0xee')]=function(_0x520256,_0x362354){var _0x2b7424=0x0;var _0x1bd242=0x0;var _0x56936c=![];var _0x23bcce;var _0x807904;return db[_0x2255('0x2d')]['find']({'where':{'id':_0x520256[_0x2255('0x45')]['id']},'include':[{'model':db[_0x2255('0xf8')],'as':_0x2255('0xf8'),'include':[{'model':db[_0x2255('0xf8')],'as':_0x2255('0xf9'),'attributes':['id',_0x2255('0xf6')],'raw':!![]}]}]})[_0x2255('0x13')](handleEntityNotFound(_0x362354,null))[_0x2255('0x13')](function(_0x522c){if(_0x522c){_0x23bcce=_0x522c;return _0x522c[_0x2255('0xfa')]({'raw':!![]});}})[_0x2255('0x13')](function(_0x5a5a77){if(_0x23bcce){if(_0x5a5a77){_0x807904=_0x5a5a77;}}return require(_0x2255('0x6a'))[_0x2255('0xfb')]();})[_0x2255('0x13')](function(_0x2c7416){if(_0x2c7416){_0x1bd242=_0x2c7416[_0x2255('0xfc')];_0x56936c=_0x2c7416[_0x2255('0xfd')];}})['then'](function(){return db[_0x2255('0xa8')][_0x2255('0x1f')]({'where':{'closed':![]}});})[_0x2255('0x13')](function(_0x3ca15e){_0x2b7424=_0x3ca15e;if(_0x1bd242&&_0x3ca15e>_0x1bd242){return db[_0x2255('0xfe')][_0x2255('0x56')]({'where':{'id':0x1}})['then'](function(_0x4c789f){if(_0x4c789f){_0x4c789f['increment']('chatLicenseExceeded');}});}})[_0x2255('0x13')](function(){if(_0x23bcce[_0x2255('0xf8')]&&_0x23bcce[_0x2255('0xf8')][_0x2255('0xf9')]){var _0x1fdade=[];for(var _0x461010=0x0;_0x461010<_0x23bcce['Interval'][_0x2255('0xf9')][_0x2255('0x34')];_0x461010++){var _0x1c82e7=_0x23bcce[_0x2255('0xf8')][_0x2255('0xf9')][_0x461010][_0x2255('0x4c')]({'plain':!![]});_0x1fdade[_0x2255('0xff')](iftimePromise(_0x1c82e7,_0x23bcce));}return BPromise[_0x2255('0x100')](_0x1fdade)[_0x2255('0x13')](function(_0x206cfd){return _[_0x2255('0x101')](_0x206cfd);});}else{return!![];}})[_0x2255('0x13')](function(_0x5cebed){var _0x137c45=fs['readFileSync'](path[_0x2255('0x67')](config[_0x2255('0x6c')],_0x2255('0x102')),_0x2255('0x103'));var _0x148c19=new url['URL'](_0x23bcce['address'])['origin'];var _0x595ebb=_0x2255('0x104');var _0x2ee95b=![];var _0x5368bb={'chatVersion':_0x595ebb,'chatWebsiteAddressOrigin':_0x148c19,'remote':_0x23bcce[_0x2255('0x105')],'query':querystring['stringify'](_['merge'](_0x23bcce[_0x2255('0x4c')]({'plain':!![]}),{'customerIp':_0x520256['headers'][_0x2255('0x9c')]||_0x520256[_0x2255('0x7c')][_0x2255('0x106')]||_0x520256[_0x2255('0x107')][_0x2255('0x108')]||_0x520256['ip'],'referer':_0x520256[_0x2255('0x7c')][_0x2255('0x9f')],'openedInteractions':_0x2b7424,'maxInteractions':_0x1bd242,'virtual':_0x56936c[_0x2255('0xfc')],'online':_0x5cebed,'custom':_0x56936c}))['replace'](/'/g,'\x5c\x27')};_0x362354[_0x2255('0x28')](ejs['render'](Mustache[_0x2255('0x109')](_0x137c45,_0x5368bb),{'proactiveActions':_0x807904,'alignment':_0x23bcce[_0x2255('0x10a')],'verticalAlignment':_0x23bcce[_0x2255('0x10b')],'div_color':_0x23bcce[_0x2255('0x10c')],'labelText':_0x23bcce['labelText'],'text_color':_0x23bcce[_0x2255('0x10d')],'text_button_color':_0x23bcce[_0x2255('0x10e')],'button_color':_0x23bcce[_0x2255('0x10f')],'background_color':_0x23bcce['backgroundColor'],'hideWhenOffline':_0x23bcce[_0x2255('0x110')],'intervalId':_0x23bcce[_0x2255('0x111')],'isDevelopment':_0x2ee95b,'chatVersion':_0x595ebb}));})[_0x2255('0x44')](handleError(_0x362354,null));};exports[_0x2255('0x112')]=function(_0x2abd15,_0x91fb01){var _0x9f1941=_0x2abd15[_0x2255('0x45')]['id'];var _0x533840=_0x2abd15[_0x2255('0x4a')];var _0x166f9d=0xc8;var _0x13f4f8=null;return db[_0x2255('0xcd')][_0x2255('0xce')]({'isolationLevel':db[_0x2255('0xcd')][_0x2255('0x113')][_0x2255('0x114')]['READ_COMMITTED']},function(_0x22bf0e){return db[_0x2255('0x2d')]['findOne']({'where':{'id':_0x9f1941},'transaction':_0x22bf0e})[_0x2255('0x13')](function(_0x104273){if(_0x104273){return db[_0x2255('0x92')][_0x2255('0x25')]({'where':{'ChatWebsiteId':_0x9f1941},'transaction':_0x22bf0e})[_0x2255('0x13')](function(){var _0x5399ab=_[_0x2255('0x2c')](_0x533840,function(_0x2832b9){_0x2832b9[_0x2255('0x54')]=_0x9f1941;return _0x2832b9;});return db[_0x2255('0x92')][_0x2255('0x115')](_0x5399ab,{'transaction':_0x22bf0e});});}else{_0x166f9d=0x194;_0x13f4f8=[];}});})[_0x2255('0x13')](function(){if(_0x166f9d!==0x194){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x9f1941},'order':'priority'})[_0x2255('0x13')](function(_0x3c2a51){_0x13f4f8=_0x3c2a51;});}})['catch'](function(_0x2cee93){_0x166f9d=0x1f4;logger[_0x2255('0x18')](_0x2cee93[_0x2255('0x116')]);if(_0x2cee93[_0x2255('0x27')]){delete _0x2cee93['name'];}_0x13f4f8=_0x2cee93;})['finally'](function(){if(_0x13f4f8===null){_0x91fb01[_0x2255('0x26')](_0x166f9d);}else{if(_0x166f9d===0x1f4){_0x91fb01[_0x2255('0x1b')](_0x166f9d)[_0x2255('0x28')](_0x13f4f8);}else{_0x91fb01['status'](_0x166f9d)[_0x2255('0x1d')](_0x13f4f8);}}});};exports['getApplications']=function(_0x341018,_0x3445b9){var _0x554170={};var _0x4c8a7a={};var _0x58d146;var _0x44308a;return db[_0x2255('0x2d')][_0x2255('0x56')]({'where':{'id':_0x341018[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x3445b9,null))[_0x2255('0x13')](function(_0x4012e0){if(_0x4012e0){_0x58d146=_0x4012e0;_0x4c8a7a['model']=_[_0x2255('0x46')](db[_0x2255('0x92')][_0x2255('0x47')]);_0x4c8a7a[_0x2255('0x2f')]=_[_0x2255('0x46')](_0x341018[_0x2255('0x2f')]);_0x4c8a7a[_0x2255('0x3b')]=_[_0x2255('0x30')](_0x4c8a7a[_0x2255('0x31')],_0x4c8a7a[_0x2255('0x2f')]);_0x554170[_0x2255('0x33')]=_['intersection'](_0x4c8a7a[_0x2255('0x31')],qs[_0x2255('0x32')](_0x341018['query'][_0x2255('0x32')]));_0x554170[_0x2255('0x33')]=_0x554170['attributes'][_0x2255('0x34')]?_0x554170['attributes']:_0x4c8a7a[_0x2255('0x31')];_0x554170[_0x2255('0x38')]=qs[_0x2255('0x39')](_0x341018['query'][_0x2255('0x39')]);_0x554170['where']=qs[_0x2255('0x3b')](_['pick'](_0x341018[_0x2255('0x2f')],_0x4c8a7a[_0x2255('0x3b')]));if(_0x341018['query']['filter']){_0x554170[_0x2255('0x3a')]=_[_0x2255('0x40')](_0x554170[_0x2255('0x3a')],{'$or':_[_0x2255('0x2c')](_0x554170['attributes'],function(_0x340ba3){var _0x19592e={};_0x19592e[_0x340ba3]={'$like':'%'+_0x341018[_0x2255('0x2f')]['filter']+'%'};return _0x19592e;})});}_0x554170=_[_0x2255('0x40')]({},_0x554170,_0x341018[_0x2255('0x41')]);return _0x58d146[_0x2255('0x117')](_0x554170);}})[_0x2255('0x13')](function(_0x26de4a){if(_0x26de4a){_0x44308a=_0x26de4a['length'];if(!_0x341018[_0x2255('0x2f')][_0x2255('0x35')](_0x2255('0x36'))){_0x554170[_0x2255('0x20')]=qs[_0x2255('0x20')](_0x341018[_0x2255('0x2f')][_0x2255('0x20')]);_0x554170[_0x2255('0x37')]=qs['offset'](_0x341018[_0x2255('0x2f')][_0x2255('0x37')]);}return _0x58d146[_0x2255('0x117')](_0x554170);}})[_0x2255('0x13')](function(_0x2017b4){if(_0x2017b4){return _0x2017b4?{'count':_0x44308a,'rows':_0x2017b4}:null;}})['then'](respondWithResult(_0x3445b9,null))[_0x2255('0x44')](handleError(_0x3445b9,null));};exports[_0x2255('0x118')]=function(_0x4b1661,_0x49fc39){return db[_0x2255('0x119')][_0x2255('0x48')]({'where':{'id':_0x4b1661[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x49fc39,null))[_0x2255('0x13')](function(_0x146b33){if(_0x146b33){return _0x146b33[_0x2255('0x118')](_0x4b1661[_0x2255('0x4a')][_0x2255('0x5b')],_[_0x2255('0x11a')](_0x4b1661[_0x2255('0x4a')],[_0x2255('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x49fc39,null))[_0x2255('0x44')](handleError(_0x49fc39,null));};exports['getProactiveActions']=function(_0x3e78e0,_0x322c49){var _0x39718c={};var _0xa35369={};var _0x4ad6ce;var _0x23cad3;return db[_0x2255('0x2d')][_0x2255('0x56')]({'where':{'id':_0x3e78e0[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x322c49,null))[_0x2255('0x13')](function(_0x34e27a){if(_0x34e27a){_0x4ad6ce=_0x34e27a;_0xa35369[_0x2255('0x31')]=_['keys'](db['ChatProactiveAction'][_0x2255('0x47')]);_0xa35369[_0x2255('0x2f')]=_[_0x2255('0x46')](_0x3e78e0['query']);_0xa35369[_0x2255('0x3b')]=_['intersection'](_0xa35369[_0x2255('0x31')],_0xa35369[_0x2255('0x2f')]);_0x39718c[_0x2255('0x33')]=_[_0x2255('0x30')](_0xa35369[_0x2255('0x31')],qs[_0x2255('0x32')](_0x3e78e0[_0x2255('0x2f')][_0x2255('0x32')]));_0x39718c['attributes']=_0x39718c[_0x2255('0x33')][_0x2255('0x34')]?_0x39718c[_0x2255('0x33')]:_0xa35369[_0x2255('0x31')];_0x39718c['order']=qs['sort'](_0x3e78e0[_0x2255('0x2f')]['sort']);_0x39718c[_0x2255('0x3a')]=qs[_0x2255('0x3b')](_[_0x2255('0x3c')](_0x3e78e0[_0x2255('0x2f')],_0xa35369[_0x2255('0x3b')]));if(_0x3e78e0[_0x2255('0x2f')][_0x2255('0x3d')]){_0x39718c[_0x2255('0x3a')]=_['merge'](_0x39718c[_0x2255('0x3a')],{'$or':_[_0x2255('0x2c')](_0x39718c['attributes'],function(_0x585c7e){var _0x4b9063={};_0x4b9063[_0x585c7e]={'$like':'%'+_0x3e78e0['query'][_0x2255('0x3d')]+'%'};return _0x4b9063;})});}_0x39718c=_[_0x2255('0x40')]({},_0x39718c,_0x3e78e0['options']);return _0x4ad6ce[_0x2255('0xfa')](_0x39718c);}})[_0x2255('0x13')](function(_0x465dfe){if(_0x465dfe){_0x23cad3=_0x465dfe['length'];if(!_0x3e78e0[_0x2255('0x2f')][_0x2255('0x35')](_0x2255('0x36'))){_0x39718c[_0x2255('0x20')]=qs[_0x2255('0x20')](_0x3e78e0[_0x2255('0x2f')]['limit']);_0x39718c[_0x2255('0x37')]=qs[_0x2255('0x37')](_0x3e78e0[_0x2255('0x2f')][_0x2255('0x37')]);}return _0x4ad6ce[_0x2255('0xfa')](_0x39718c);}})['then'](function(_0x21170b){if(_0x21170b){return _0x21170b?{'count':_0x23cad3,'rows':_0x21170b}:null;}})[_0x2255('0x13')](respondWithResult(_0x322c49,null))[_0x2255('0x44')](handleError(_0x322c49,null));};exports[_0x2255('0x11b')]=function(_0x336144,_0x5cfd75){var _0x822924=_0x336144[_0x2255('0x2f')][_0x2255('0x11c')]===_0x2255('0x11d')?_0x2255('0x11e'):_0x2255('0x11f');return db[_0x2255('0x2d')][_0x2255('0x48')]({'attributes':['id',_0x822924],'where':{'id':_0x336144['params']['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x5cfd75,null))[_0x2255('0x13')](function(_0x27aabe){if(_0x27aabe){var _0x11ed02=_0x27aabe[_0x822924];var _0x42270f=_0x11ed02&&_0x11ed02[_0x2255('0x120')]?_0x11ed02['items']:[];_0x5cfd75['send']({'fromKey':_[_0x2255('0x6b')](_0x11ed02[_0x2255('0x121')])?undefined:_0x11ed02[_0x2255('0x121')],'count':_0x42270f[_0x2255('0x34')],'rows':_0x42270f});}})[_0x2255('0x44')](handleError(_0x5cfd75,null));};exports[_0x2255('0x122')]=function(_0x1ee3d2,_0x261f50){var _0x456c41={'raw':![],'where':{}};var _0x2750d8={};var _0x5b7a60={'count':0x0,'rows':[]};return db[_0x2255('0x2d')][_0x2255('0x56')]({'where':{'id':_0x1ee3d2[_0x2255('0x45')]['id']}})[_0x2255('0x13')](handleEntityNotFound(_0x261f50,null))['then'](function(_0x3ca90b){if(_0x3ca90b){_0x2750d8[_0x2255('0x31')]=_['keys'](db[_0x2255('0xc6')][_0x2255('0x47')]);_0x2750d8[_0x2255('0x2f')]=_['keys'](_0x1ee3d2[_0x2255('0x2f')]);_0x2750d8[_0x2255('0x3b')]=_[_0x2255('0x30')](_0x2750d8['model'],_0x2750d8['query']);_0x456c41[_0x2255('0x33')]=_[_0x2255('0x30')](_0x2750d8[_0x2255('0x31')],qs[_0x2255('0x32')](_0x1ee3d2[_0x2255('0x2f')]['fields']));_0x456c41[_0x2255('0x33')]=_0x456c41[_0x2255('0x33')]['length']?_0x456c41[_0x2255('0x33')]:_0x2750d8[_0x2255('0x31')];if(!_0x1ee3d2[_0x2255('0x2f')][_0x2255('0x35')](_0x2255('0x36'))){_0x456c41['limit']=qs[_0x2255('0x20')](_0x1ee3d2[_0x2255('0x2f')][_0x2255('0x20')]);_0x456c41[_0x2255('0x37')]=qs[_0x2255('0x37')](_0x1ee3d2[_0x2255('0x2f')]['offset']);}_0x456c41[_0x2255('0x38')]=qs['sort'](_0x1ee3d2[_0x2255('0x2f')][_0x2255('0x39')]);_0x456c41[_0x2255('0x3a')]=qs[_0x2255('0x3b')](_[_0x2255('0x3c')](_0x1ee3d2[_0x2255('0x2f')],_0x2750d8[_0x2255('0x3b')]));_0x456c41[_0x2255('0x3a')][_0x2255('0x54')]=_0x3ca90b['id'];if(_0x1ee3d2[_0x2255('0x2f')]['filter']){_0x456c41['where']=_[_0x2255('0x40')](_0x456c41[_0x2255('0x3a')],{'$or':_[_0x2255('0x2c')](_0x456c41['attributes'],function(_0x3e372b){var _0x5bac5d={};_0x5bac5d[_0x3e372b]={'$like':'%'+_0x1ee3d2[_0x2255('0x2f')][_0x2255('0x3d')]+'%'};return _0x5bac5d;})});}_0x456c41=_['merge']({},_0x456c41,_0x1ee3d2['options']);return db[_0x2255('0xc6')][_0x2255('0x1f')]({'where':_0x456c41[_0x2255('0x3a')]})['then'](function(_0x1d296c){_0x5b7a60[_0x2255('0x1f')]=_0x1d296c;if(_0x1ee3d2[_0x2255('0x2f')]['includeAll']){_0x456c41[_0x2255('0x42')]=[{'all':!![]}];}else{_0x456c41[_0x2255('0x42')]=[{'model':db[_0x2255('0x7e')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':_0x2255('0x123'),'required':![]}];}return db[_0x2255('0xc6')][_0x2255('0x43')](_0x456c41);})[_0x2255('0x13')](function(_0x34d838){_0x5b7a60[_0x2255('0x59')]=_0x34d838;return _0x5b7a60;});}})['then'](respondWithFilteredResult(_0x261f50,_0x456c41))[_0x2255('0x44')](handleError(_0x261f50,null));};exports[_0x2255('0x124')]=function(_0x21918b,_0x4809fa){return db['ChatWebsite'][_0x2255('0x48')]({'where':{'id':_0x21918b[_0x2255('0x45')]['id']}})['then'](handleEntityNotFound(_0x4809fa,null))['then'](function(_0x10d997){if(_0x10d997){return _0x10d997['addAgents'](_0x21918b[_0x2255('0x4a')][_0x2255('0x5b')],_[_0x2255('0x11a')](_0x21918b[_0x2255('0x4a')],[_0x2255('0x5b'),'id'])||{})[_0x2255('0xc1')](function(_0x4b6549){for(var _0x2e7149=0x0;_0x2e7149<_0x21918b[_0x2255('0x4a')][_0x2255('0x5b')]['length'];_0x2e7149+=0x1){socket[_0x2255('0x125')](_0x2255('0x126'),{'UserId':Number(_0x21918b['body'][_0x2255('0x5b')][_0x2e7149]),'ChatWebsiteId':Number(_0x21918b['params']['id'])});}return _0x4b6549;});}})[_0x2255('0x13')](respondWithResult(_0x4809fa,null))['catch'](handleError(_0x4809fa,null));};exports[_0x2255('0x127')]=function(_0x22898b,_0x1bb465){return db['ChatWebsite'][_0x2255('0x48')]({'where':{'id':_0x22898b[_0x2255('0x45')]['id']}})['then'](handleEntityNotFound(_0x1bb465,null))[_0x2255('0x13')](function(_0x3d7038){if(_0x3d7038){return _0x3d7038[_0x2255('0x127')](_0x22898b[_0x2255('0x2f')][_0x2255('0x5b')])[_0x2255('0x13')](function(){if(_[_0x2255('0x128')](_0x22898b[_0x2255('0x2f')][_0x2255('0x5b')])){for(var _0x8cc1e1=0x0;_0x8cc1e1<_0x22898b[_0x2255('0x2f')][_0x2255('0x5b')][_0x2255('0x34')];_0x8cc1e1+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x22898b[_0x2255('0x2f')][_0x2255('0x5b')][_0x8cc1e1]),'ChatWebsiteId':Number(_0x22898b[_0x2255('0x45')]['id'])});}}else{socket[_0x2255('0x125')]('userChatWebsite:remove',{'UserId':Number(_0x22898b[_0x2255('0x2f')][_0x2255('0x5b')]),'ChatWebsiteId':Number(_0x22898b[_0x2255('0x45')]['id'])});}});}})['then'](respondWithStatusCode(_0x1bb465,null))[_0x2255('0x44')](handleError(_0x1bb465,null));};exports[_0x2255('0x129')]=function(_0x3c0c1a,_0x26d12a){var _0x5a0e3d={};var _0x5e3ed5={};var _0x59b888;var _0x12d18b;return db[_0x2255('0x2d')]['findOne']({'where':{'id':_0x3c0c1a['params']['id']}})['then'](handleEntityNotFound(_0x26d12a,null))[_0x2255('0x13')](function(_0x253145){if(_0x253145){_0x59b888=_0x253145;_0x5e3ed5[_0x2255('0x31')]=_[_0x2255('0x46')](db[_0x2255('0xe7')][_0x2255('0x47')]);_0x5e3ed5[_0x2255('0x2f')]=_['keys'](_0x3c0c1a[_0x2255('0x2f')]);_0x5e3ed5[_0x2255('0x3b')]=_[_0x2255('0x30')](_0x5e3ed5[_0x2255('0x31')],_0x5e3ed5[_0x2255('0x2f')]);_0x5a0e3d[_0x2255('0x33')]=_[_0x2255('0x30')](_0x5e3ed5[_0x2255('0x31')],qs[_0x2255('0x32')](_0x3c0c1a[_0x2255('0x2f')]['fields']));_0x5a0e3d[_0x2255('0x33')]=_0x5a0e3d[_0x2255('0x33')][_0x2255('0x34')]?_0x5a0e3d['attributes']:_0x5e3ed5[_0x2255('0x31')];_0x5a0e3d[_0x2255('0x38')]=qs[_0x2255('0x39')](_0x3c0c1a[_0x2255('0x2f')]['sort']);_0x5a0e3d[_0x2255('0x3a')]=qs[_0x2255('0x3b')](_[_0x2255('0x3c')](_0x3c0c1a[_0x2255('0x2f')],_0x5e3ed5[_0x2255('0x3b')]));if(_0x3c0c1a[_0x2255('0x2f')][_0x2255('0x3d')]){_0x5a0e3d[_0x2255('0x3a')]=_[_0x2255('0x40')](_0x5a0e3d[_0x2255('0x3a')],{'$or':_[_0x2255('0x2c')](_0x5a0e3d[_0x2255('0x33')],function(_0x5ec577){var _0xcd2444={};_0xcd2444[_0x5ec577]={'$like':'%'+_0x3c0c1a[_0x2255('0x2f')][_0x2255('0x3d')]+'%'};return _0xcd2444;})});}_0x5a0e3d=_[_0x2255('0x40')]({},_0x5a0e3d,_0x3c0c1a['options']);return _0x59b888['getAgents'](_0x5a0e3d);}})[_0x2255('0x13')](function(_0x2a37f6){if(_0x2a37f6){_0x12d18b=_0x2a37f6[_0x2255('0x34')];if(!_0x3c0c1a[_0x2255('0x2f')][_0x2255('0x35')](_0x2255('0x36'))){_0x5a0e3d[_0x2255('0x20')]=qs[_0x2255('0x20')](_0x3c0c1a['query'][_0x2255('0x20')]);_0x5a0e3d[_0x2255('0x37')]=qs[_0x2255('0x37')](_0x3c0c1a[_0x2255('0x2f')][_0x2255('0x37')]);}return _0x59b888[_0x2255('0x129')](_0x5a0e3d);}})[_0x2255('0x13')](function(_0x31bd32){if(_0x31bd32){return _0x31bd32?{'count':_0x12d18b,'rows':_0x31bd32}:null;}})['then'](respondWithResult(_0x26d12a,null))[_0x2255('0x44')](handleError(_0x26d12a,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 7fcc331..8eb2065 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 _0x06f4=['setMaxListeners','save','emit','hook','events','../../mysqldb'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0x06f4,0x136));var _0x406f=function(_0x5a41bd,_0x488422){_0x5a41bd=_0x5a41bd-0x0;var _0x1c4b84=_0x06f4[_0x5a41bd];return _0x1c4b84;};'use strict';var EventEmitter=require(_0x406f('0x0'));var ChatWebsite=require(_0x406f('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x406f('0x2')](0x0);var events={'afterCreate':_0x406f('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3a4ff0){return function(_0x5ed32f,_0x32abfd,_0x275c63){ChatWebsiteEvents[_0x406f('0x4')](_0x3a4ff0+':'+_0x5ed32f['id'],_0x5ed32f);ChatWebsiteEvents[_0x406f('0x4')](_0x3a4ff0,_0x5ed32f);_0x275c63(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x406f('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0xbe48=['exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x2385fc,_0x4c17b4){var _0x5e7e2e=function(_0x2063e8){while(--_0x2063e8){_0x2385fc['push'](_0x2385fc['shift']());}};_0x5e7e2e(++_0x4c17b4);}(_0xbe48,0x121));var _0x8be4=function(_0xd80c55,_0x5866a0){_0xd80c55=_0xd80c55-0x0;var _0x5af3ff=_0xbe48[_0xd80c55];return _0x5af3ff;};'use strict';var EventEmitter=require(_0x8be4('0x0'));var ChatWebsite=require(_0x8be4('0x1'))['db'][_0x8be4('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8be4('0x3')](0x0);var events={'afterCreate':_0x8be4('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3404c7){return function(_0x95e50e,_0x53fdb0,_0x191a88){ChatWebsiteEvents[_0x8be4('0x5')](_0x3404c7+':'+_0x95e50e['id'],_0x95e50e);ChatWebsiteEvents[_0x8be4('0x5')](_0x3404c7,_0x95e50e);_0x191a88(null);};}for(var e in events){if(events[_0x8be4('0x6')](e)){var event=events[e];ChatWebsite[_0x8be4('0x7')](e,emitEvent(event));}}module[_0x8be4('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index c1b01cd..26c8ce4 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 _0xc70e=['lodash','moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x14dc28,_0x9e76c0){var _0x24f9b0=function(_0x2d68e3){while(--_0x2d68e3){_0x14dc28['push'](_0x14dc28['shift']());}};_0x24f9b0(++_0x9e76c0);}(_0xc70e,0xfa));var _0xec70=function(_0x3ad62c,_0x465700){_0x3ad62c=_0x3ad62c-0x0;var _0x18e4f3=_0xc70e[_0x3ad62c];return _0x18e4f3;};'use strict';var _=require(_0xec70('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xec70('0x1'));var BPromise=require(_0xec70('0x2'));var rp=require(_0xec70('0x3'));var fs=require('fs');var path=require(_0xec70('0x4'));var rimraf=require('rimraf');var config=require(_0xec70('0x5'));var attributes=require(_0xec70('0x6'));module[_0xec70('0x7')]=function(_0x5c931a,_0x409405){return _0x5c931a[_0xec70('0x8')](_0xec70('0x9'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf45b=['lodash','util','request-promise','path','rimraf','./chatWebsite.attributes','define','ChatWebsite','chat_websites'];(function(_0x1e84f2,_0x235272){var _0x59973e=function(_0x51c2ac){while(--_0x51c2ac){_0x1e84f2['push'](_0x1e84f2['shift']());}};_0x59973e(++_0x235272);}(_0xf45b,0x6c));var _0xbf45=function(_0x4e697a,_0x56a14b){_0x4e697a=_0x4e697a-0x0;var _0x88850c=_0xf45b[_0x4e697a];return _0x88850c;};'use strict';var _=require(_0xbf45('0x0'));var util=require(_0xbf45('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbf45('0x2'));var fs=require('fs');var path=require(_0xbf45('0x3'));var rimraf=require(_0xbf45('0x4'));var config=require('../../config/environment');var attributes=require(_0xbf45('0x5'));module['exports']=function(_0x1557aa,_0xe227c8){return _0x1557aa[_0xbf45('0x6')](_0xbf45('0x7'),attributes,{'tableName':_0xbf45('0x8'),'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 56f6544..c771e0c 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 _0xcfc6=['rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','result','lodash','util','bluebird','ioredis','../../config/logger'];(function(_0x398c23,_0x294a30){var _0x5392c0=function(_0x4dc9b3){while(--_0x4dc9b3){_0x398c23['push'](_0x398c23['shift']());}};_0x5392c0(++_0x294a30);}(_0xcfc6,0x11b));var _0x6cfc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcfc6[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6cfc('0x0'));var util=require(_0x6cfc('0x1'));var moment=require('moment');var BPromise=require(_0x6cfc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6cfc('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6cfc('0x4'))(_0x6cfc('0x5'));var config=require(_0x6cfc('0x6'));var jayson=require(_0x6cfc('0x7'));var client=jayson[_0x6cfc('0x8')][_0x6cfc('0x9')]({'port':0x232a});config['redis']=_[_0x6cfc('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6cfc('0xb'))(new Redis(config[_0x6cfc('0xc')]));require(_0x6cfc('0xd'))[_0x6cfc('0xe')](socket);function respondWithRpcPromise(_0x4aee93,_0x29102b,_0x1f1320){return new BPromise(function(_0x570e53,_0x24a7fe){return client[_0x6cfc('0xf')](_0x4aee93,_0x1f1320)[_0x6cfc('0x10')](function(_0x17366d){logger['info'](_0x6cfc('0x11'),_0x29102b,'request\x20sent');logger['debug'](_0x6cfc('0x12'),_0x29102b,'request\x20sent',JSON['stringify'](_0x17366d));if(_0x17366d['error']){if(_0x17366d[_0x6cfc('0x13')]['code']===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x29102b,_0x17366d['error'][_0x6cfc('0x14')]);return _0x24a7fe(_0x17366d['error'][_0x6cfc('0x14')]);}logger['error'](_0x6cfc('0x11'),_0x29102b,_0x17366d['error'][_0x6cfc('0x14')]);return _0x570e53(_0x17366d[_0x6cfc('0x13')][_0x6cfc('0x14')]);}else{logger[_0x6cfc('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x29102b,_0x6cfc('0x16'));_0x570e53(_0x17366d[_0x6cfc('0x17')][_0x6cfc('0x14')]);}})['catch'](function(_0x46a7b0){logger['error'](_0x6cfc('0x11'),_0x29102b,_0x46a7b0);_0x24a7fe(_0x46a7b0);});});} \ No newline at end of file +var _0x163f=['then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x30fc83,_0x5a895a){var _0xd7247b=function(_0x41ea93){while(--_0x41ea93){_0x30fc83['push'](_0x30fc83['shift']());}};_0xd7247b(++_0x5a895a);}(_0x163f,0x112));var _0xf163=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x163f[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xf163('0x0'));var util=require(_0xf163('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf163('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf163('0x3'));var logger=require(_0xf163('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf163('0x5'));var client=jayson[_0xf163('0x6')][_0xf163('0x7')]({'port':0x232a});config['redis']=_[_0xf163('0x8')](config[_0xf163('0x9')],{'host':_0xf163('0xa'),'port':0x18eb});var socket=require(_0xf163('0xb'))(new Redis(config[_0xf163('0x9')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x1e2f7c,_0x15b53e,_0x313d24){return new BPromise(function(_0x2811bc,_0x54578d){return client['request'](_0x1e2f7c,_0x313d24)[_0xf163('0xc')](function(_0x1200df){logger[_0xf163('0xd')](_0xf163('0xe'),_0x15b53e,_0xf163('0xf'));logger[_0xf163('0x10')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x15b53e,'request\x20sent',JSON['stringify'](_0x1200df));if(_0x1200df[_0xf163('0x11')]){if(_0x1200df['error'][_0xf163('0x12')]===0x1f4){logger[_0xf163('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x15b53e,_0x1200df[_0xf163('0x11')][_0xf163('0x13')]);return _0x54578d(_0x1200df[_0xf163('0x11')]['message']);}logger[_0xf163('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x15b53e,_0x1200df[_0xf163('0x11')]['message']);return _0x2811bc(_0x1200df['error'][_0xf163('0x13')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x15b53e,_0xf163('0xf'));_0x2811bc(_0x1200df[_0xf163('0x14')][_0xf163('0x13')]);}})[_0xf163('0x15')](function(_0x5a67be){logger[_0xf163('0x11')](_0xf163('0xe'),_0x15b53e,_0x5a67be);_0x54578d(_0x5a67be);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 85c6fd2..fd36c21 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 _0x7c29=['remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x7c29,0xb6));var _0x97c2=function(_0x5eb839,_0x553a7f){_0x5eb839=_0x5eb839-0x0;var _0x3f3c71=_0x7c29[_0x5eb839];return _0x3f3c71;};'use strict';var ChatWebsiteEvents=require(_0x97c2('0x0'));var events=[_0x97c2('0x1'),_0x97c2('0x2'),'update'];function createListener(_0x4da097,_0x4899e9){return function(_0xfa655b){_0x4899e9[_0x97c2('0x3')](_0x4da097,_0xfa655b);};}function removeListener(_0x542649,_0x5a04e3){return function(){ChatWebsiteEvents[_0x97c2('0x4')](_0x542649,_0x5a04e3);};}exports[_0x97c2('0x5')]=function(_0x169ff0){for(var _0x2dfa75=0x0,_0xd2ff51=events[_0x97c2('0x6')];_0x2dfa75<_0xd2ff51;_0x2dfa75++){var _0x1f7be1=events[_0x2dfa75];var _0x3d9cec=createListener(_0x97c2('0x7')+_0x1f7be1,_0x169ff0);ChatWebsiteEvents['on'](_0x1f7be1,_0x3d9cec);}}; \ No newline at end of file +var _0x1895=['update','emit','register','length','save'];(function(_0x4686be,_0x39f490){var _0x44ead1=function(_0x4b6bff){while(--_0x4b6bff){_0x4686be['push'](_0x4686be['shift']());}};_0x44ead1(++_0x39f490);}(_0x1895,0x108));var _0x5189=function(_0x3d790e,_0x1ecaa3){_0x3d790e=_0x3d790e-0x0;var _0xb9b79a=_0x1895[_0x3d790e];return _0xb9b79a;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x5189('0x0'),'remove',_0x5189('0x1')];function createListener(_0x23b607,_0x1b16c6){return function(_0x4d267f){_0x1b16c6[_0x5189('0x2')](_0x23b607,_0x4d267f);};}function removeListener(_0x2f7750,_0x2b0395){return function(){ChatWebsiteEvents['removeListener'](_0x2f7750,_0x2b0395);};}exports[_0x5189('0x3')]=function(_0x5522e4){for(var _0x127a96=0x0,_0x71b7c6=events[_0x5189('0x4')];_0x127a96<_0x71b7c6;_0x127a96++){var _0x454abe=events[_0x127a96];var _0x8970b0=createListener('chatWebsite:'+_0x454abe,_0x5522e4);ChatWebsiteEvents['on'](_0x454abe,_0x8970b0);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 0ac670f..d3b4d49 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 _0xb37b=['offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','/:id/users','addAgents','/:id','update','delete','destroy','removeAnswers','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getAgents','post','create','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','single','file','addLogo','join','addAvatar','server/files/images/avatars/','now','originalname','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','attachments'];(function(_0x1dc00d,_0x456c64){var _0x1de5ce=function(_0x189848){while(--_0x189848){_0x1dc00d['push'](_0x1dc00d['shift']());}};_0x1de5ce(++_0x456c64);}(_0xb37b,0x184));var _0xbb37=function(_0x546bf7,_0x4f807f){_0x546bf7=_0x546bf7-0x0;var _0x918211=_0xb37b[_0x546bf7];return _0x918211;};'use strict';var multer=require(_0xbb37('0x0'));var util=require(_0xbb37('0x1'));var path=require(_0xbb37('0x2'));var timeout=require(_0xbb37('0x3'));var express=require('express');var router=express[_0xbb37('0x4')]();var fs_extra=require(_0xbb37('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbb37('0x6'));var controller=require('./chatWebsite.controller');router[_0xbb37('0x7')]('/',auth[_0xbb37('0x8')](),controller[_0xbb37('0x9')]);router[_0xbb37('0x7')](_0xbb37('0xa'),auth[_0xbb37('0x8')](),controller[_0xbb37('0xb')]);router[_0xbb37('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xbb37('0xc')]);router[_0xbb37('0x7')](_0xbb37('0xd'),auth[_0xbb37('0x8')](),controller[_0xbb37('0xe')]);router[_0xbb37('0x7')](_0xbb37('0xf'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x10')]);router[_0xbb37('0x7')](_0xbb37('0x11'),controller[_0xbb37('0x12')]);router['get'](_0xbb37('0x13'),controller[_0xbb37('0x14')]);router[_0xbb37('0x7')](_0xbb37('0x15'),controller['getCustomerAvatar']);router['get'](_0xbb37('0x16'),controller[_0xbb37('0x17')]);router[_0xbb37('0x7')](_0xbb37('0x18'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x19')]);router[_0xbb37('0x7')](_0xbb37('0x1a'),controller[_0xbb37('0x1b')]);router['get'](_0xbb37('0x1c'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x1d')]);router[_0xbb37('0x7')](_0xbb37('0x1e'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x1f')]);router[_0xbb37('0x7')]('/:id/fields',controller[_0xbb37('0x20')]);router[_0xbb37('0x7')](_0xbb37('0x21'),auth[_0xbb37('0x8')](),controller['getOfflineMessages']);router['get']('/:id/users',auth[_0xbb37('0x8')](),controller[_0xbb37('0x22')]);router[_0xbb37('0x23')]('/',auth[_0xbb37('0x8')](),controller[_0xbb37('0x24')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0xbb37('0x23')](_0xbb37('0xf'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x25')]);var upload=multer({'storage':multer[_0xbb37('0x26')]({'destination':function(_0x9fcb3a,_0x3730e1,_0x313245){_0x313245(null,path['join'](config[_0xbb37('0x27')],_0xbb37('0x28')));},'filename':function(_0x3ee6bf,_0x5d87f3,_0x31b963){_0x31b963(null,util[_0xbb37('0x29')](_0xbb37('0x2a'),Date['now'](),_0x5d87f3['originalname']));}})});router[_0xbb37('0x23')](_0xbb37('0x11'),upload[_0xbb37('0x2b')](_0xbb37('0x2c')),controller[_0xbb37('0x2d')]);var upload=multer({'storage':multer[_0xbb37('0x26')]({'destination':function(_0x42e32b,_0xf60386,_0x19139f){_0x19139f(null,path[_0xbb37('0x2e')](config[_0xbb37('0x27')],'server/files/images/avatars/'));},'filename':function(_0x436f49,_0x3fbae1,_0x2cc3c9){_0x2cc3c9(null,util[_0xbb37('0x29')](_0xbb37('0x2a'),Date['now'](),_0x3fbae1['originalname']));}})});router[_0xbb37('0x23')](_0xbb37('0x13'),upload[_0xbb37('0x2b')](_0xbb37('0x2c')),controller[_0xbb37('0x2f')]);var upload=multer({'storage':multer[_0xbb37('0x26')]({'destination':function(_0x4d6e81,_0x1f0b69,_0x3dc565){_0x3dc565(null,path[_0xbb37('0x2e')](config[_0xbb37('0x27')],_0xbb37('0x30')));},'filename':function(_0x34247a,_0x3c6251,_0x42e8a2){_0x42e8a2(null,util[_0xbb37('0x29')](_0xbb37('0x2a'),Date[_0xbb37('0x31')](),_0x3c6251[_0xbb37('0x32')]));}})});router[_0xbb37('0x23')](_0xbb37('0x15'),upload['single'](_0xbb37('0x2c')),controller[_0xbb37('0x33')]);var upload=multer({'storage':multer[_0xbb37('0x26')]({'destination':function(_0x5826f0,_0x41a587,_0x15ba78){_0x15ba78(null,path[_0xbb37('0x2e')](config[_0xbb37('0x27')],_0xbb37('0x30')));},'filename':function(_0x5b76ec,_0x4447ad,_0x4e39d4){_0x4e39d4(null,util['format']('%s-%s',Date[_0xbb37('0x31')](),_0x4447ad[_0xbb37('0x32')]));}})});router[_0xbb37('0x23')]('/:id/system_avatar',upload[_0xbb37('0x2b')](_0xbb37('0x2c')),controller[_0xbb37('0x34')]);router[_0xbb37('0x23')](_0xbb37('0x35'),controller[_0xbb37('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0xbb37('0x26')]({'destination':function(_0x1ea5f2,_0x2d9eaa,_0x52a945){const _0x933b01=path[_0xbb37('0x2e')](config[_0xbb37('0x27')],'server/files',_0xbb37('0x37'),_0xbb37('0x38'));fs_extra[_0xbb37('0x39')](_0x933b01,function(){_0x52a945(null,_0x933b01);});},'filename':function(_0x119c70,_0x57ee97,_0x84e8dd){const _0x553d9a=_0x57ee97[_0xbb37('0x32')][_0xbb37('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5133c8=path[_0xbb37('0x3b')](_0x553d9a);const _0x384408=Date['now']()+'-'+_0x553d9a['replace'](_0x5133c8,'')+_0x5133c8;_0x84e8dd(null,_0x384408);}})});router[_0xbb37('0x23')](_0xbb37('0x3c'),offlineUploadMulter[_0xbb37('0x3d')](),controller[_0xbb37('0x3e')]);router['post'](_0xbb37('0x18'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x3f')]);router[_0xbb37('0x23')](_0xbb37('0x1c'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x40')]);router[_0xbb37('0x23')](_0xbb37('0x1e'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x41')]);router[_0xbb37('0x23')](_0xbb37('0x42'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x43')]);router['put'](_0xbb37('0x44'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x45')]);router[_0xbb37('0x46')](_0xbb37('0x44'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x47')]);router[_0xbb37('0x46')](_0xbb37('0xd'),auth[_0xbb37('0x8')](),controller['removeDispositions']);router[_0xbb37('0x46')](_0xbb37('0xf'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x48')]);router[_0xbb37('0x46')](_0xbb37('0x42'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x49')]);module['exports']=router; \ No newline at end of file +var _0x6ad1=['getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','addLogo','server/files/images/avatars/','file','addAvatar','addCustomerAvatar','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','offline','addApplications','addProactiveActions','addAgents','/:id','update','delete','removeDispositions','removeAnswers','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','describe','show','/:id/dispositions','isAuthenticated','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages'];(function(_0x17723c,_0x1ea81d){var _0x1ffbf3=function(_0x5276cd){while(--_0x5276cd){_0x17723c['push'](_0x17723c['shift']());}};_0x1ffbf3(++_0x1ea81d);}(_0x6ad1,0x14b));var _0x16ad=function(_0x47088b,_0x576c1a){_0x47088b=_0x47088b-0x0;var _0x2cf2b8=_0x6ad1[_0x47088b];return _0x2cf2b8;};'use strict';var multer=require(_0x16ad('0x0'));var util=require(_0x16ad('0x1'));var path=require(_0x16ad('0x2'));var timeout=require('connect-timeout');var express=require(_0x16ad('0x3'));var router=express[_0x16ad('0x4')]();var fs_extra=require(_0x16ad('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x16ad('0x6'));var config=require(_0x16ad('0x7'));var controller=require('./chatWebsite.controller');router[_0x16ad('0x8')]('/',auth['isAuthenticated'](),controller[_0x16ad('0x9')]);router['get'](_0x16ad('0xa'),auth['isAuthenticated'](),controller[_0x16ad('0xb')]);router[_0x16ad('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x16ad('0xc')]);router[_0x16ad('0x8')](_0x16ad('0xd'),auth[_0x16ad('0xe')](),controller['getDispositions']);router[_0x16ad('0x8')](_0x16ad('0xf'),auth[_0x16ad('0xe')](),controller[_0x16ad('0x10')]);router[_0x16ad('0x8')](_0x16ad('0x11'),controller[_0x16ad('0x12')]);router[_0x16ad('0x8')](_0x16ad('0x13'),controller[_0x16ad('0x14')]);router[_0x16ad('0x8')](_0x16ad('0x15'),controller[_0x16ad('0x16')]);router[_0x16ad('0x8')](_0x16ad('0x17'),controller['getSystemAvatar']);router[_0x16ad('0x8')](_0x16ad('0x18'),auth['isAuthenticated'](),controller[_0x16ad('0x19')]);router[_0x16ad('0x8')](_0x16ad('0x1a'),controller[_0x16ad('0x1b')]);router[_0x16ad('0x8')]('/:id/applications',auth['isAuthenticated'](),controller[_0x16ad('0x1c')]);router[_0x16ad('0x8')](_0x16ad('0x1d'),auth[_0x16ad('0xe')](),controller[_0x16ad('0x1e')]);router[_0x16ad('0x8')](_0x16ad('0x1f'),controller[_0x16ad('0x20')]);router[_0x16ad('0x8')](_0x16ad('0x21'),auth[_0x16ad('0xe')](),controller[_0x16ad('0x22')]);router[_0x16ad('0x8')](_0x16ad('0x23'),auth[_0x16ad('0xe')](),controller[_0x16ad('0x24')]);router[_0x16ad('0x25')]('/',auth[_0x16ad('0xe')](),controller[_0x16ad('0x26')]);router['post'](_0x16ad('0xd'),auth[_0x16ad('0xe')](),controller[_0x16ad('0x27')]);router[_0x16ad('0x25')]('/:id/canned_answers',auth[_0x16ad('0xe')](),controller[_0x16ad('0x28')]);var upload=multer({'storage':multer[_0x16ad('0x29')]({'destination':function(_0x38ceb1,_0x334ca2,_0x5d1c5a){_0x5d1c5a(null,path[_0x16ad('0x2a')](config[_0x16ad('0x2b')],_0x16ad('0x2c')));},'filename':function(_0x2f08a4,_0x5855d4,_0x2c3ba4){_0x2c3ba4(null,util[_0x16ad('0x2d')](_0x16ad('0x2e'),Date[_0x16ad('0x2f')](),_0x5855d4[_0x16ad('0x30')]));}})});router[_0x16ad('0x25')](_0x16ad('0x11'),upload[_0x16ad('0x31')]('file'),controller[_0x16ad('0x32')]);var upload=multer({'storage':multer[_0x16ad('0x29')]({'destination':function(_0x4ee843,_0x365e3c,_0x30d426){_0x30d426(null,path[_0x16ad('0x2a')](config['root'],_0x16ad('0x33')));},'filename':function(_0x4903ff,_0xe17893,_0x23024d){_0x23024d(null,util[_0x16ad('0x2d')](_0x16ad('0x2e'),Date['now'](),_0xe17893[_0x16ad('0x30')]));}})});router[_0x16ad('0x25')](_0x16ad('0x13'),upload[_0x16ad('0x31')](_0x16ad('0x34')),controller[_0x16ad('0x35')]);var upload=multer({'storage':multer[_0x16ad('0x29')]({'destination':function(_0x1f054a,_0x58cb35,_0x106576){_0x106576(null,path[_0x16ad('0x2a')](config['root'],_0x16ad('0x33')));},'filename':function(_0x32574f,_0x49381b,_0x32ead5){_0x32ead5(null,util[_0x16ad('0x2d')]('%s-%s',Date['now'](),_0x49381b[_0x16ad('0x30')]));}})});router[_0x16ad('0x25')](_0x16ad('0x15'),upload['single'](_0x16ad('0x34')),controller[_0x16ad('0x36')]);var upload=multer({'storage':multer[_0x16ad('0x29')]({'destination':function(_0x10d0d1,_0x3937b5,_0xb70e18){_0xb70e18(null,path[_0x16ad('0x2a')](config[_0x16ad('0x2b')],_0x16ad('0x33')));},'filename':function(_0x587a48,_0x13fac5,_0x4edfd8){_0x4edfd8(null,util[_0x16ad('0x2d')](_0x16ad('0x2e'),Date['now'](),_0x13fac5[_0x16ad('0x30')]));}})});router[_0x16ad('0x25')](_0x16ad('0x17'),upload[_0x16ad('0x31')]('file'),controller[_0x16ad('0x37')]);router[_0x16ad('0x25')]('/:id/notify',controller[_0x16ad('0x38')]);const offlineUploadMulter=multer({'storage':multer[_0x16ad('0x29')]({'destination':function(_0x53e19e,_0x23db80,_0xc7a05){const _0x1eea5e=path[_0x16ad('0x2a')](config[_0x16ad('0x2b')],_0x16ad('0x39'),_0x16ad('0x3a'),_0x16ad('0x3b'));fs_extra[_0x16ad('0x3c')](_0x1eea5e,function(){_0xc7a05(null,_0x1eea5e);});},'filename':function(_0x11b655,_0x3e9325,_0x16336b){const _0x379e1d=_0x3e9325['originalname'][_0x16ad('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5043ca=path['extname'](_0x379e1d);const _0xec53aa=Date[_0x16ad('0x2f')]()+'-'+_0x379e1d['replace'](_0x5043ca,'')+_0x5043ca;_0x16336b(null,_0xec53aa);}})});router[_0x16ad('0x25')](_0x16ad('0x3e'),offlineUploadMulter['any'](),controller[_0x16ad('0x3f')]);router['post'](_0x16ad('0x18'),auth[_0x16ad('0xe')](),controller['addInteraction']);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x16ad('0x40')]);router['post']('/:id/proactive_actions',auth[_0x16ad('0xe')](),controller[_0x16ad('0x41')]);router[_0x16ad('0x25')](_0x16ad('0x23'),auth[_0x16ad('0xe')](),controller[_0x16ad('0x42')]);router['put'](_0x16ad('0x43'),auth['isAuthenticated'](),controller[_0x16ad('0x44')]);router[_0x16ad('0x45')](_0x16ad('0x43'),auth[_0x16ad('0xe')](),controller['destroy']);router[_0x16ad('0x45')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x16ad('0x46')]);router[_0x16ad('0x45')](_0x16ad('0xf'),auth[_0x16ad('0xe')](),controller[_0x16ad('0x47')]);router[_0x16ad('0x45')](_0x16ad('0x23'),auth[_0x16ad('0xe')](),controller['removeAgents']);module[_0x16ad('0x48')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index b25fcda..c77850f 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 _0x2270=['env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','../components/auth/service'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x2270,0x180));var _0x0227=function(_0x59f62a,_0x28dfa2){_0x59f62a=_0x59f62a-0x0;var _0x402f07=_0x2270[_0x59f62a];return _0x402f07;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0x0227('0x0'));var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0x0227('0x1')]===_0x0227('0x2')||![];function clientSideLogs(_0x56e9c2,_0x13d928,_0x42bcf7){var _0x2fe042=_0x56e9c2[_0x0227('0x3')][_0x0227('0x4')](_0x0227('0x5'));if(!_0x2fe042){throw new Error(_0x0227('0x6'));}return beaverLogger[_0x0227('0x7')]({'uri':_0x0227('0x8'),'logger':_0x2fe042,'enableCors':!isProduction})(_0x56e9c2,_0x13d928,_0x42bcf7);}router[_0x0227('0x9')](auth[_0x0227('0xa')](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0xafda=['get','client-side-logger','expressEndpoint','use','isAuthenticated','exports','beaver-logger/server','../components/auth/service','Router','app'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xafda,0xb0));var _0xaafd=function(_0xcf4569,_0x1ce755){_0xcf4569=_0xcf4569-0x0;var _0x7fef=_0xafda[_0xcf4569];return _0x7fef;};var beaverLogger=require(_0xaafd('0x0'));var express=require('express');var auth=require(_0xaafd('0x1'));var config=require('../config/environment');var router=express[_0xaafd('0x2')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x1baef7,_0x276110,_0x14a3eb){var _0x2873ef=_0x1baef7[_0xaafd('0x3')][_0xaafd('0x4')](_0xaafd('0x5'));if(!_0x2873ef){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xaafd('0x6')]({'uri':'/client-logs','logger':_0x2873ef,'enableCors':!isProduction})(_0x1baef7,_0x276110,_0x14a3eb);}router[_0xaafd('0x7')](auth[_0xaafd('0x8')](),clientSideLogs);module[_0xaafd('0x9')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index bb02343..9bbf749 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 _0x242d=['exports','STRING','ENUM','AmazonAWS','Google','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x8cd627,_0x1bf5ca){var _0x7e454=function(_0x562038){while(--_0x562038){_0x8cd627['push'](_0x8cd627['shift']());}};_0x7e454(++_0x1bf5ca);}(_0x242d,0x18c));var _0xd242=function(_0x1587cd,_0x3e66c2){_0x1587cd=_0x1587cd-0x0;var _0x4ed6e5=_0x242d[_0x1587cd];return _0x4ed6e5;};'use strict';var Sequelize=require('sequelize');module[_0xd242('0x0')]={'name':{'type':Sequelize[_0xd242('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd242('0x2')](_0xd242('0x3'),_0xd242('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365',_0xd242('0x5'))},'data1':{'type':Sequelize[_0xd242('0x1')],'comment':_0xd242('0x6')},'data2':{'type':Sequelize[_0xd242('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xd242('0x1')],'comment':_0xd242('0x7')},'data5':{'type':Sequelize[_0xd242('0x8')],'comment':_0xd242('0x9')},'data6':{'type':Sequelize['TEXT'],'comment':_0xd242('0xa')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0xbecd=['MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x24fa1a,_0x16d9c2){var _0xc5621f=function(_0x5616ac){while(--_0x5616ac){_0x24fa1a['push'](_0x24fa1a['shift']());}};_0xc5621f(++_0x16d9c2);}(_0xbecd,0x189));var _0xdbec=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbecd[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xdbec('0x0'));module[_0xdbec('0x1')]={'name':{'type':Sequelize[_0xdbec('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xdbec('0x3')](_0xdbec('0x4'),_0xdbec('0x5'),_0xdbec('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xdbec('0x3')]('Outlook365',_0xdbec('0x7'))},'data1':{'type':Sequelize[_0xdbec('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xdbec('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':_0xdbec('0x8')},'data4':{'type':Sequelize[_0xdbec('0x2')],'comment':_0xdbec('0x9')},'data5':{'type':Sequelize[_0xdbec('0xa')],'comment':_0xdbec('0xb')},'data6':{'type':Sequelize['TEXT'],'comment':_0xdbec('0xc')},'data7':{'type':Sequelize[_0xdbec('0xa')],'comment':_0xdbec('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 1f90f5e..0339688 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 _0x4e6a=['get','state','parse','from','base64','toString','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','data5','access_token','data6','refresh_token','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','defaults','redis','localhost','socket.io-emitter','status','end','json','count','offset','limit','set','Content-Range','update','then','destroy','name','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','rows','service','decryptString','data3','catch','show','params','includeAll','options','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','sendStatus','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','error'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x4e6a,0xd4));var _0xa4e6=function(_0x1b2f05,_0x497bc8){_0x1b2f05=_0x1b2f05-0x0;var _0x2ef85b=_0x4e6a[_0x1b2f05];return _0x2ef85b;};'use strict';var _=require(_0xa4e6('0x0'));var Redis=require('ioredis');var qs=require(_0xa4e6('0x1'));var encryptor=require(_0xa4e6('0x2'));var config=require(_0xa4e6('0x3'));var logger=require(_0xa4e6('0x4'))(_0xa4e6('0x5'));var db=require('../../mysqldb')['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_[_0xa4e6('0x6')](config[_0xa4e6('0x7')],{'host':_0xa4e6('0x8'),'port':0x18eb});var socket=require(_0xa4e6('0x9'))(new Redis(config[_0xa4e6('0x7')]));var redis=new Redis(config[_0xa4e6('0x7')]);function respondWithStatusCode(_0x5560de,_0x2e81b3){_0x2e81b3=_0x2e81b3||0xcc;return function(_0x105f63){if(_0x105f63){return _0x5560de['sendStatus'](_0x2e81b3);}return _0x5560de[_0xa4e6('0xa')](_0x2e81b3)[_0xa4e6('0xb')]();};}function respondWithResult(_0x418b1b,_0xf8cf01){_0xf8cf01=_0xf8cf01||0xc8;return function(_0x43571d){if(_0x43571d){return _0x418b1b[_0xa4e6('0xa')](_0xf8cf01)[_0xa4e6('0xc')](_0x43571d);}};}function respondWithFilteredResult(_0x535184,_0xca4977){return function(_0x452eb6){if(_0x452eb6){var _0x2cd819=typeof _0xca4977['offset']==='undefined'&&typeof _0xca4977['limit']==='undefined';var _0x4f73b7=_0x452eb6[_0xa4e6('0xd')];var _0xb9b83d=_0x2cd819?0x0:_0xca4977[_0xa4e6('0xe')];var _0x12ed5a=_0x2cd819?_0x452eb6['count']:_0xca4977[_0xa4e6('0xe')]+_0xca4977[_0xa4e6('0xf')];var _0x2517ea;if(_0x12ed5a>=_0x4f73b7){_0x12ed5a=_0x4f73b7;_0x2517ea=0xc8;}else{_0x2517ea=0xce;}_0x535184[_0xa4e6('0xa')](_0x2517ea);return _0x535184[_0xa4e6('0x10')](_0xa4e6('0x11'),_0xb9b83d+'-'+_0x12ed5a+'/'+_0x4f73b7)[_0xa4e6('0xc')](_0x452eb6);}return null;};}function saveUpdates(_0x3961ba){return function(_0x4c8690){if(_0x4c8690){return _0x4c8690[_0xa4e6('0x12')](_0x3961ba)[_0xa4e6('0x13')](function(_0x394794){return _0x394794;});}return null;};}function removeEntity(_0x5e1448){return function(_0x3405f7){if(_0x3405f7){return _0x3405f7[_0xa4e6('0x14')]()[_0xa4e6('0x13')](function(){_0x5e1448[_0xa4e6('0xa')](0xcc)[_0xa4e6('0xb')]();});}};}function handleEntityNotFound(_0x2fc4fd){return function(_0x13be0a){if(!_0x13be0a){_0x2fc4fd['sendStatus'](0x194);}return _0x13be0a;};}function handleError(_0x339f92,_0x38db86){_0x38db86=_0x38db86||0x1f4;return function(_0x5f4cf4){logger['error'](_0x5f4cf4['stack']);if(_0x5f4cf4[_0xa4e6('0x15')]){delete _0x5f4cf4['name'];}_0x339f92[_0xa4e6('0xa')](_0x38db86)['send'](_0x5f4cf4);};}function maskClientSecret(_0x40901d){return _[_0xa4e6('0x16')](_0x40901d[_0xa4e6('0x17')](0x0,0x3),0x14,'*');}exports[_0xa4e6('0x18')]=function(_0x5cbad3,_0x3c5c89){var _0x293e42={},_0x3e08a2={},_0x11fa9c={'count':0x0,'rows':[]};var _0x167435=_[_0xa4e6('0x19')](db[_0xa4e6('0x1a')][_0xa4e6('0x1b')],function(_0xba4e98){return{'name':_0xba4e98[_0xa4e6('0x1c')],'type':_0xba4e98[_0xa4e6('0x1d')][_0xa4e6('0x1e')]};});_0x3e08a2[_0xa4e6('0x1f')]=_[_0xa4e6('0x19')](_0x167435,'name');_0x3e08a2['query']=_[_0xa4e6('0x20')](_0x5cbad3['query']);_0x3e08a2[_0xa4e6('0x21')]=_[_0xa4e6('0x22')](_0x3e08a2['model'],_0x3e08a2[_0xa4e6('0x23')]);_0x293e42['attributes']=_[_0xa4e6('0x22')](_0x3e08a2[_0xa4e6('0x1f')],qs[_0xa4e6('0x24')](_0x5cbad3[_0xa4e6('0x23')][_0xa4e6('0x24')]));_0x293e42[_0xa4e6('0x25')]=_0x293e42[_0xa4e6('0x25')][_0xa4e6('0x26')]?_0x293e42[_0xa4e6('0x25')]:_0x3e08a2[_0xa4e6('0x1f')];if(!_0x5cbad3['query'][_0xa4e6('0x27')](_0xa4e6('0x28'))){_0x293e42[_0xa4e6('0xf')]=qs[_0xa4e6('0xf')](_0x5cbad3[_0xa4e6('0x23')]['limit']);_0x293e42[_0xa4e6('0xe')]=qs[_0xa4e6('0xe')](_0x5cbad3[_0xa4e6('0x23')][_0xa4e6('0xe')]);}_0x293e42[_0xa4e6('0x29')]=qs['sort'](_0x5cbad3[_0xa4e6('0x23')][_0xa4e6('0x2a')]);_0x293e42[_0xa4e6('0x2b')]=qs['filters'](_[_0xa4e6('0x2c')](_0x5cbad3[_0xa4e6('0x23')],_0x3e08a2[_0xa4e6('0x21')]),_0x167435);if(_0x5cbad3['query']['filter']){_0x293e42[_0xa4e6('0x2b')]=_[_0xa4e6('0x2d')](_0x293e42['where'],{'$or':_[_0xa4e6('0x19')](_0x167435,function(_0x3a95ef){if(_0x3a95ef['type']!==_0xa4e6('0x2e')){var _0x584e82={};_0x584e82[_0x3a95ef[_0xa4e6('0x15')]]={'$like':'%'+_0x5cbad3[_0xa4e6('0x23')][_0xa4e6('0x2f')]+'%'};return _0x584e82;}})});}_0x293e42=_[_0xa4e6('0x2d')]({},_0x293e42,_0x5cbad3['options']);var _0x3aa101={'where':_0x293e42[_0xa4e6('0x2b')]};return db['CloudProvider'][_0xa4e6('0xd')](_0x3aa101)[_0xa4e6('0x13')](function(_0x14796e){_0x11fa9c['count']=_0x14796e;if(_0x5cbad3[_0xa4e6('0x23')]['includeAll']){_0x293e42[_0xa4e6('0x30')]=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x293e42);})[_0xa4e6('0x13')](function(_0x38f7c9){_0x11fa9c[_0xa4e6('0x31')]=_[_0xa4e6('0x19')](_0x38f7c9,function(_0x9e4f63){if(_0x9e4f63[_0xa4e6('0x32')]==='MicrosoftAzure'){var _0x3ce548=encryptor[_0xa4e6('0x33')](_0x9e4f63[_0xa4e6('0x34')]);_0x9e4f63[_0xa4e6('0x34')]=maskClientSecret(_0x3ce548);}return _0x9e4f63;});return _0x11fa9c;})[_0xa4e6('0x13')](respondWithFilteredResult(_0x3c5c89,_0x293e42))[_0xa4e6('0x35')](handleError(_0x3c5c89,null));};exports[_0xa4e6('0x36')]=function(_0x194b77,_0x58b9d3){var _0x1cb42f={'raw':!![],'where':{'id':_0x194b77[_0xa4e6('0x37')]['id']}},_0x3ace79={};_0x3ace79[_0xa4e6('0x1f')]=_[_0xa4e6('0x20')](db[_0xa4e6('0x1a')][_0xa4e6('0x1b')]);_0x3ace79['query']=_['keys'](_0x194b77[_0xa4e6('0x23')]);_0x3ace79[_0xa4e6('0x21')]=_[_0xa4e6('0x22')](_0x3ace79[_0xa4e6('0x1f')],_0x3ace79['query']);_0x1cb42f[_0xa4e6('0x25')]=_[_0xa4e6('0x22')](_0x3ace79['model'],qs[_0xa4e6('0x24')](_0x194b77[_0xa4e6('0x23')]['fields']));_0x1cb42f[_0xa4e6('0x25')]=_0x1cb42f[_0xa4e6('0x25')][_0xa4e6('0x26')]?_0x1cb42f[_0xa4e6('0x25')]:_0x3ace79[_0xa4e6('0x1f')];if(_0x194b77[_0xa4e6('0x23')][_0xa4e6('0x38')]){_0x1cb42f[_0xa4e6('0x30')]=[{'all':!![]}];}_0x1cb42f=_[_0xa4e6('0x2d')]({},_0x1cb42f,_0x194b77[_0xa4e6('0x39')]);return db[_0xa4e6('0x1a')][_0xa4e6('0x3a')](_0x1cb42f)['then'](handleEntityNotFound(_0x58b9d3,null))[_0xa4e6('0x13')](function(_0x230d79){if(_0x230d79[_0xa4e6('0x32')]===_0xa4e6('0x3b')){var _0x32f282=encryptor[_0xa4e6('0x33')](_0x230d79[_0xa4e6('0x34')]);_0x230d79['data3']=maskClientSecret(_0x32f282);}return _0x230d79;})['then'](respondWithResult(_0x58b9d3,null))[_0xa4e6('0x35')](handleError(_0x58b9d3,null));};exports[_0xa4e6('0x3c')]=function(_0x42ebed,_0x51aa9d){if(!_0x42ebed[_0xa4e6('0x3d')][_0xa4e6('0x15')])throw new Error(_0xa4e6('0x3e'));if(!_0x42ebed['body'][_0xa4e6('0x32')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x12dea5=db[_0xa4e6('0x1a')][_0xa4e6('0x1b')][_0xa4e6('0x32')]['values'];if(!_0x12dea5[_0xa4e6('0x3f')](_0x42ebed[_0xa4e6('0x3d')][_0xa4e6('0x32')]))throw new Error(_0xa4e6('0x40')+_0x12dea5[_0xa4e6('0x41')](',\x20'));if(_0x42ebed['body']['service']===_0xa4e6('0x3b')&&_0x42ebed[_0xa4e6('0x3d')][_0xa4e6('0x34')]){_0x42ebed['body']['data3']=encryptor['encryptString'](_0x42ebed['body'][_0xa4e6('0x34')]);}return db[_0xa4e6('0x1a')][_0xa4e6('0x3c')](_0x42ebed[_0xa4e6('0x3d')],{})[_0xa4e6('0x13')](respondWithResult(_0x51aa9d,0xc9))[_0xa4e6('0x35')](handleError(_0x51aa9d,null));};exports[_0xa4e6('0x12')]=function(_0x4076f4,_0x50b423){if(_0x4076f4[_0xa4e6('0x3d')]['id']){delete _0x4076f4['body']['id'];}return db[_0xa4e6('0x1a')][_0xa4e6('0x3a')]({'where':{'id':_0x4076f4[_0xa4e6('0x37')]['id']}})[_0xa4e6('0x13')](handleEntityNotFound(_0x50b423,null))[_0xa4e6('0x13')](function(_0x56c0f3){if(_0x56c0f3[_0xa4e6('0x32')]==='MicrosoftAzure'&&_0x4076f4[_0xa4e6('0x3d')][_0xa4e6('0x34')]){_0x4076f4[_0xa4e6('0x3d')]['data3']=encryptor[_0xa4e6('0x42')](_0x4076f4['body'][_0xa4e6('0x34')]);}return _0x56c0f3;})[_0xa4e6('0x13')](saveUpdates(_0x4076f4[_0xa4e6('0x3d')],null))['then'](respondWithResult(_0x50b423,null))[_0xa4e6('0x35')](handleError(_0x50b423,null));};exports[_0xa4e6('0x14')]=function(_0x503577,_0x32eb78){return db[_0xa4e6('0x1a')][_0xa4e6('0x3a')]({'where':{'id':_0x503577[_0xa4e6('0x37')]['id']}})[_0xa4e6('0x13')](handleEntityNotFound(_0x32eb78,null))[_0xa4e6('0x13')](removeEntity(_0x32eb78,null))[_0xa4e6('0x35')](handleError(_0x32eb78,null));};exports[_0xa4e6('0x43')]=function(_0x3e2603,_0x41994d){return db[_0xa4e6('0x1a')][_0xa4e6('0x44')]({'where':{'id':_0x3e2603[_0xa4e6('0x37')]['id']},'raw':!![]})[_0xa4e6('0x13')](function(_0x3aa3f7){if(!_0x3aa3f7)return _0x41994d[_0xa4e6('0x45')](0x194);return{'url':oauth[_0xa4e6('0x46')](_0x3aa3f7,_0x3e2603['user']['id'])};})[_0xa4e6('0x13')](respondWithResult(_0x41994d,null))[_0xa4e6('0x35')](handleError(_0x41994d,null));};exports[_0xa4e6('0x47')]=function(_0x5c414a,_0x23b43e){var _0x52a2ae=_0x5c414a[_0xa4e6('0x3d')];var _0x533ca9;var _0x16f4f7;if(_0x52a2ae[_0xa4e6('0x48')])throw _0x52a2ae;redis[_0xa4e6('0x49')](_0x52a2ae[_0xa4e6('0x4a')])[_0xa4e6('0x13')](function(_0x16a59a){if(!_0x16a59a)throw new Error('Invalid\x20state\x20parameter');_0x533ca9=JSON[_0xa4e6('0x4b')](_0x16a59a);var _0x5960b4=Buffer[_0xa4e6('0x4c')](_0x52a2ae['state'],_0xa4e6('0x4d'))[_0xa4e6('0x4e')]('ascii');_0x16f4f7=JSON['parse'](_0x5960b4);if(!oauth[_0xa4e6('0x4f')](_0x52a2ae[_0xa4e6('0x50')],_0x533ca9['oauth2Claims']))throw new Error(_0xa4e6('0x51'));redis[_0xa4e6('0x52')](_0x52a2ae[_0xa4e6('0x4a')]);return oauth['getOauth2MicrosoftAccessToken'](_0x52a2ae['code'],_0x533ca9);})[_0xa4e6('0x13')](function(_0xd8a061){_0x533ca9[_0xa4e6('0x53')]=_0xd8a061[_0xa4e6('0x54')];_0x533ca9[_0xa4e6('0x55')]=_0xd8a061[_0xa4e6('0x56')];return db[_0xa4e6('0x1a')][_0xa4e6('0x12')]({'data5':_0x533ca9['data5'],'data6':_0x533ca9[_0xa4e6('0x55')]},{'where':{'id':_0x533ca9['id']}});})[_0xa4e6('0x13')](function(){oauth['startRefreshInterval'](_0x533ca9);socket['emit'](_0xa4e6('0x57'),{'id':_0x16f4f7['id']});return;})[_0xa4e6('0x13')](respondWithStatusCode(_0x23b43e,null))[_0xa4e6('0x35')](function(_0x14a453){if(_0x16f4f7){socket[_0xa4e6('0x58')](_0xa4e6('0x59'),{'id':_0x16f4f7['id']});}if(!_0x533ca9){logger['error'](_0xa4e6('0x5a'),_0x14a453);return _0x23b43e[_0xa4e6('0xa')](0x1f4)[_0xa4e6('0x5b')](_0x14a453[_0xa4e6('0x5c')]);}logger['error'](_0xa4e6('0x5d'),_0x533ca9['id'],JSON[_0xa4e6('0x5e')](_0x14a453));});}; \ No newline at end of file +var _0x01c6=['user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','set','json','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','show','CloudProvider','include','find','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','encryptString','create','params','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl'];(function(_0xd336fa,_0x39d1b2){var _0x3370b1=function(_0x41c5cc){while(--_0x41c5cc){_0xd336fa['push'](_0xd336fa['shift']());}};_0x3370b1(++_0x39d1b2);}(_0x01c6,0x1f1));var _0x601c=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x01c6[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x601c('0x0'));var Redis=require(_0x601c('0x1'));var qs=require(_0x601c('0x2'));var encryptor=require(_0x601c('0x3'));var config=require('../../config/environment');var logger=require('../../config/logger')('api');var db=require(_0x601c('0x4'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x601c('0x5')]=_[_0x601c('0x6')](config[_0x601c('0x5')],{'host':_0x601c('0x7'),'port':0x18eb});var socket=require(_0x601c('0x8'))(new Redis(config['redis']));var redis=new Redis(config[_0x601c('0x5')]);function respondWithStatusCode(_0x2fdafc,_0x25ce77){_0x25ce77=_0x25ce77||0xcc;return function(_0x4ca925){if(_0x4ca925){return _0x2fdafc[_0x601c('0x9')](_0x25ce77);}return _0x2fdafc[_0x601c('0xa')](_0x25ce77)[_0x601c('0xb')]();};}function respondWithResult(_0x21d59b,_0xdcc448){_0xdcc448=_0xdcc448||0xc8;return function(_0x2a2eca){if(_0x2a2eca){return _0x21d59b['status'](_0xdcc448)['json'](_0x2a2eca);}};}function respondWithFilteredResult(_0x146961,_0x3f6ca8){return function(_0x3f2335){if(_0x3f2335){var _0x65b796=typeof _0x3f6ca8[_0x601c('0xc')]===_0x601c('0xd')&&typeof _0x3f6ca8[_0x601c('0xe')]===_0x601c('0xd');var _0xf3e47d=_0x3f2335[_0x601c('0xf')];var _0xfb350c=_0x65b796?0x0:_0x3f6ca8[_0x601c('0xc')];var _0x139c81=_0x65b796?_0x3f2335['count']:_0x3f6ca8[_0x601c('0xc')]+_0x3f6ca8[_0x601c('0xe')];var _0x4e4e46;if(_0x139c81>=_0xf3e47d){_0x139c81=_0xf3e47d;_0x4e4e46=0xc8;}else{_0x4e4e46=0xce;}_0x146961[_0x601c('0xa')](_0x4e4e46);return _0x146961[_0x601c('0x10')]('Content-Range',_0xfb350c+'-'+_0x139c81+'/'+_0xf3e47d)[_0x601c('0x11')](_0x3f2335);}return null;};}function saveUpdates(_0x42cc21){return function(_0x507b47){if(_0x507b47){return _0x507b47[_0x601c('0x12')](_0x42cc21)[_0x601c('0x13')](function(_0x3a32c8){return _0x3a32c8;});}return null;};}function removeEntity(_0x326dfb){return function(_0x49a356){if(_0x49a356){return _0x49a356['destroy']()[_0x601c('0x13')](function(){_0x326dfb['status'](0xcc)[_0x601c('0xb')]();});}};}function handleEntityNotFound(_0x424eff){return function(_0x151eca){if(!_0x151eca){_0x424eff[_0x601c('0x9')](0x194);}return _0x151eca;};}function handleError(_0xd22a37,_0x2edb6d){_0x2edb6d=_0x2edb6d||0x1f4;return function(_0x4721f3){logger[_0x601c('0x14')](_0x4721f3[_0x601c('0x15')]);if(_0x4721f3[_0x601c('0x16')]){delete _0x4721f3[_0x601c('0x16')];}_0xd22a37[_0x601c('0xa')](_0x2edb6d)[_0x601c('0x17')](_0x4721f3);};}function maskClientSecret(_0x20c8c0){return _['padEnd'](_0x20c8c0['slice'](0x0,0x3),0x14,'*');}exports[_0x601c('0x18')]=function(_0x55a0c2,_0x5b9451){var _0x3bc9df={},_0xc456ee={},_0x34b54b={'count':0x0,'rows':[]};var _0x13f136=_[_0x601c('0x19')](db['CloudProvider'][_0x601c('0x1a')],function(_0x3c471c){return{'name':_0x3c471c[_0x601c('0x1b')],'type':_0x3c471c['type']['key']};});_0xc456ee[_0x601c('0x1c')]=_[_0x601c('0x19')](_0x13f136,_0x601c('0x16'));_0xc456ee[_0x601c('0x1d')]=_[_0x601c('0x1e')](_0x55a0c2[_0x601c('0x1d')]);_0xc456ee[_0x601c('0x1f')]=_[_0x601c('0x20')](_0xc456ee[_0x601c('0x1c')],_0xc456ee[_0x601c('0x1d')]);_0x3bc9df[_0x601c('0x21')]=_[_0x601c('0x20')](_0xc456ee[_0x601c('0x1c')],qs[_0x601c('0x22')](_0x55a0c2[_0x601c('0x1d')]['fields']));_0x3bc9df[_0x601c('0x21')]=_0x3bc9df[_0x601c('0x21')]['length']?_0x3bc9df['attributes']:_0xc456ee[_0x601c('0x1c')];if(!_0x55a0c2['query'][_0x601c('0x23')](_0x601c('0x24'))){_0x3bc9df['limit']=qs['limit'](_0x55a0c2[_0x601c('0x1d')][_0x601c('0xe')]);_0x3bc9df[_0x601c('0xc')]=qs['offset'](_0x55a0c2[_0x601c('0x1d')][_0x601c('0xc')]);}_0x3bc9df[_0x601c('0x25')]=qs['sort'](_0x55a0c2['query'][_0x601c('0x26')]);_0x3bc9df[_0x601c('0x27')]=qs[_0x601c('0x1f')](_[_0x601c('0x28')](_0x55a0c2[_0x601c('0x1d')],_0xc456ee[_0x601c('0x1f')]),_0x13f136);if(_0x55a0c2[_0x601c('0x1d')][_0x601c('0x29')]){_0x3bc9df['where']=_[_0x601c('0x2a')](_0x3bc9df['where'],{'$or':_[_0x601c('0x19')](_0x13f136,function(_0x3fb16a){if(_0x3fb16a[_0x601c('0x2b')]!=='VIRTUAL'){var _0x1740c7={};_0x1740c7[_0x3fb16a[_0x601c('0x16')]]={'$like':'%'+_0x55a0c2[_0x601c('0x1d')][_0x601c('0x29')]+'%'};return _0x1740c7;}})});}_0x3bc9df=_[_0x601c('0x2a')]({},_0x3bc9df,_0x55a0c2[_0x601c('0x2c')]);var _0x2fd9d7={'where':_0x3bc9df[_0x601c('0x27')]};return db['CloudProvider']['count'](_0x2fd9d7)[_0x601c('0x13')](function(_0x209013){_0x34b54b['count']=_0x209013;if(_0x55a0c2[_0x601c('0x1d')][_0x601c('0x2d')]){_0x3bc9df['include']=[{'all':!![]}];}return db['CloudProvider'][_0x601c('0x2e')](_0x3bc9df);})[_0x601c('0x13')](function(_0xd08749){_0x34b54b[_0x601c('0x2f')]=_['map'](_0xd08749,function(_0x17f8d0){if(_0x17f8d0[_0x601c('0x30')]===_0x601c('0x31')){var _0x2f84f3=encryptor[_0x601c('0x32')](_0x17f8d0[_0x601c('0x33')]);_0x17f8d0[_0x601c('0x33')]=maskClientSecret(_0x2f84f3);}return _0x17f8d0;});return _0x34b54b;})[_0x601c('0x13')](respondWithFilteredResult(_0x5b9451,_0x3bc9df))[_0x601c('0x34')](handleError(_0x5b9451,null));};exports[_0x601c('0x35')]=function(_0x3d6506,_0x39815b){var _0x4d8af6={'raw':!![],'where':{'id':_0x3d6506['params']['id']}},_0x4e4311={};_0x4e4311[_0x601c('0x1c')]=_[_0x601c('0x1e')](db[_0x601c('0x36')][_0x601c('0x1a')]);_0x4e4311[_0x601c('0x1d')]=_[_0x601c('0x1e')](_0x3d6506['query']);_0x4e4311[_0x601c('0x1f')]=_[_0x601c('0x20')](_0x4e4311[_0x601c('0x1c')],_0x4e4311[_0x601c('0x1d')]);_0x4d8af6[_0x601c('0x21')]=_[_0x601c('0x20')](_0x4e4311['model'],qs[_0x601c('0x22')](_0x3d6506[_0x601c('0x1d')][_0x601c('0x22')]));_0x4d8af6[_0x601c('0x21')]=_0x4d8af6[_0x601c('0x21')]['length']?_0x4d8af6[_0x601c('0x21')]:_0x4e4311[_0x601c('0x1c')];if(_0x3d6506[_0x601c('0x1d')][_0x601c('0x2d')]){_0x4d8af6[_0x601c('0x37')]=[{'all':!![]}];}_0x4d8af6=_[_0x601c('0x2a')]({},_0x4d8af6,_0x3d6506['options']);return db[_0x601c('0x36')][_0x601c('0x38')](_0x4d8af6)[_0x601c('0x13')](handleEntityNotFound(_0x39815b,null))[_0x601c('0x13')](function(_0x438f55){if(_0x438f55[_0x601c('0x30')]===_0x601c('0x31')){var _0x2a17e2=encryptor['decryptString'](_0x438f55[_0x601c('0x33')]);_0x438f55[_0x601c('0x33')]=maskClientSecret(_0x2a17e2);}return _0x438f55;})[_0x601c('0x13')](respondWithResult(_0x39815b,null))[_0x601c('0x34')](handleError(_0x39815b,null));};exports['create']=function(_0x16915e,_0x1337a4){if(!_0x16915e[_0x601c('0x39')][_0x601c('0x16')])throw new Error(_0x601c('0x3a'));if(!_0x16915e[_0x601c('0x39')][_0x601c('0x30')])throw new Error(_0x601c('0x3b'));var _0x56fcc7=db[_0x601c('0x36')][_0x601c('0x1a')]['service']['values'];if(!_0x56fcc7['includes'](_0x16915e[_0x601c('0x39')][_0x601c('0x30')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x56fcc7['join'](',\x20'));if(_0x16915e[_0x601c('0x39')][_0x601c('0x30')]==='MicrosoftAzure'&&_0x16915e[_0x601c('0x39')]['data3']){_0x16915e[_0x601c('0x39')][_0x601c('0x33')]=encryptor[_0x601c('0x3c')](_0x16915e[_0x601c('0x39')]['data3']);}return db[_0x601c('0x36')][_0x601c('0x3d')](_0x16915e[_0x601c('0x39')],{})['then'](respondWithResult(_0x1337a4,0xc9))[_0x601c('0x34')](handleError(_0x1337a4,null));};exports[_0x601c('0x12')]=function(_0x3d0c66,_0x2db8b6){if(_0x3d0c66['body']['id']){delete _0x3d0c66[_0x601c('0x39')]['id'];}return db[_0x601c('0x36')][_0x601c('0x38')]({'where':{'id':_0x3d0c66[_0x601c('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2db8b6,null))[_0x601c('0x13')](function(_0x47476b){if(_0x47476b[_0x601c('0x30')]===_0x601c('0x31')&&_0x3d0c66[_0x601c('0x39')][_0x601c('0x33')]){_0x3d0c66[_0x601c('0x39')][_0x601c('0x33')]=encryptor[_0x601c('0x3c')](_0x3d0c66[_0x601c('0x39')][_0x601c('0x33')]);}return _0x47476b;})[_0x601c('0x13')](saveUpdates(_0x3d0c66[_0x601c('0x39')],null))[_0x601c('0x13')](respondWithResult(_0x2db8b6,null))[_0x601c('0x34')](handleError(_0x2db8b6,null));};exports[_0x601c('0x3f')]=function(_0x2670a3,_0x33eb98){return db[_0x601c('0x36')][_0x601c('0x38')]({'where':{'id':_0x2670a3[_0x601c('0x3e')]['id']}})[_0x601c('0x13')](handleEntityNotFound(_0x33eb98,null))['then'](removeEntity(_0x33eb98,null))[_0x601c('0x34')](handleError(_0x33eb98,null));};exports[_0x601c('0x40')]=function(_0x3152d3,_0x5acaf9){return db['CloudProvider'][_0x601c('0x41')]({'where':{'id':_0x3152d3['params']['id']},'raw':!![]})[_0x601c('0x13')](function(_0x5cef5c){if(!_0x5cef5c)return _0x5acaf9[_0x601c('0x9')](0x194);return{'url':oauth[_0x601c('0x42')](_0x5cef5c,_0x3152d3[_0x601c('0x43')]['id'])};})[_0x601c('0x13')](respondWithResult(_0x5acaf9,null))[_0x601c('0x34')](handleError(_0x5acaf9,null));};exports[_0x601c('0x44')]=function(_0x3341dd,_0x59fe04){var _0x57f27a=_0x3341dd['body'];var _0x5d0433;var _0x718ada;if(_0x57f27a[_0x601c('0x14')])throw _0x57f27a;redis[_0x601c('0x45')](_0x57f27a[_0x601c('0x46')])['then'](function(_0x30b578){if(!_0x30b578)throw new Error(_0x601c('0x47'));_0x5d0433=JSON[_0x601c('0x48')](_0x30b578);var _0x449171=Buffer[_0x601c('0x49')](_0x57f27a[_0x601c('0x46')],_0x601c('0x4a'))[_0x601c('0x4b')](_0x601c('0x4c'));_0x718ada=JSON[_0x601c('0x48')](_0x449171);if(!oauth['isValidIdToken'](_0x57f27a[_0x601c('0x4d')],_0x5d0433[_0x601c('0x4e')]))throw new Error(_0x601c('0x4f'));redis[_0x601c('0x50')](_0x57f27a[_0x601c('0x46')]);return oauth[_0x601c('0x51')](_0x57f27a['code'],_0x5d0433);})[_0x601c('0x13')](function(_0x286aa2){_0x5d0433[_0x601c('0x52')]=_0x286aa2[_0x601c('0x53')];_0x5d0433['data6']=_0x286aa2[_0x601c('0x54')];return db[_0x601c('0x36')][_0x601c('0x12')]({'data5':_0x5d0433[_0x601c('0x52')],'data6':_0x5d0433[_0x601c('0x55')]},{'where':{'id':_0x5d0433['id']}});})[_0x601c('0x13')](function(){oauth[_0x601c('0x56')](_0x5d0433);socket[_0x601c('0x57')](_0x601c('0x58'),{'id':_0x718ada['id']});return;})[_0x601c('0x13')](respondWithStatusCode(_0x59fe04,null))[_0x601c('0x34')](function(_0x576b29){if(_0x718ada){socket['emit'](_0x601c('0x59'),{'id':_0x718ada['id']});}if(!_0x5d0433){logger[_0x601c('0x14')](_0x601c('0x5a'),_0x576b29);return _0x59fe04[_0x601c('0xa')](0x1f4)[_0x601c('0x17')](_0x576b29[_0x601c('0x5b')]);}logger[_0x601c('0x14')](_0x601c('0x5c'),_0x5d0433['id'],JSON[_0x601c('0x5d')](_0x576b29));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 0c73291..a3ada3c 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 _0x84a9=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','CloudProvider','cloud_providers'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x84a9,0x180));var _0x984a=function(_0x4905a0,_0x22dbe6){_0x4905a0=_0x4905a0-0x0;var _0x3e6f4d=_0x84a9[_0x4905a0];return _0x3e6f4d;};'use strict';var _=require(_0x984a('0x0'));var util=require(_0x984a('0x1'));var logger=require(_0x984a('0x2'))(_0x984a('0x3'));var moment=require(_0x984a('0x4'));var BPromise=require(_0x984a('0x5'));var rp=require(_0x984a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x984a('0x7'));var config=require(_0x984a('0x8'));var attributes=require('./cloudProvider.attributes');module[_0x984a('0x9')]=function(_0x592fff,_0x4e18a6){return _0x592fff['define'](_0x984a('0xa'),attributes,{'tableName':_0x984a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb9af=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','cloud_providers','lodash'];(function(_0x2ba022,_0x59cad3){var _0x2bc6ca=function(_0x4cc435){while(--_0x4cc435){_0x2ba022['push'](_0x2ba022['shift']());}};_0x2bc6ca(++_0x59cad3);}(_0xb9af,0xb5));var _0xfb9a=function(_0x5f41de,_0x1d3e30){_0x5f41de=_0x5f41de-0x0;var _0x12cbf7=_0xb9af[_0x5f41de];return _0x12cbf7;};'use strict';var _=require(_0xfb9a('0x0'));var util=require(_0xfb9a('0x1'));var logger=require(_0xfb9a('0x2'))(_0xfb9a('0x3'));var moment=require(_0xfb9a('0x4'));var BPromise=require(_0xfb9a('0x5'));var rp=require(_0xfb9a('0x6'));var fs=require('fs');var path=require(_0xfb9a('0x7'));var rimraf=require(_0xfb9a('0x8'));var config=require(_0xfb9a('0x9'));var attributes=require('./cloudProvider.attributes');module[_0xfb9a('0xa')]=function(_0x4c9e73,_0x38f2b2){return _0x4c9e73[_0xfb9a('0xb')]('CloudProvider',attributes,{'tableName':_0xfb9a('0xc'),'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 7d4578b..f745d1d 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 _0x15ba=['data2','then','data5','access_token','refresh_token','update','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','bind','all','inspect','error','exports','lodash','crypto','jsonwebtoken','request-promise','util','../../config/logger','api','../../config/schedule/cloud-provider','localhost','redis','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','map','type','push','data7','/.default','Outlook365','Dynamics365','{TENANT_ID}','code','stringify','toString','base64','randomBytes','hex','data4','response_mode','form_post','scope','state','nonce','login','key','join','oauth2Claims','replace','oauth2/','set','payload','issuer','aud','audience','isAfter','unix','resolve','CloudProvider','findOne','data6','data1','decryptString'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x15ba,0x120));var _0xa15b=function(_0x1b26ac,_0x5ea577){_0x1b26ac=_0x1b26ac-0x0;var _0x2d88ec=_0x15ba[_0x1b26ac];return _0x2d88ec;};'use strict';var _=require(_0xa15b('0x0'));var crypto=require(_0xa15b('0x1'));var jwt=require(_0xa15b('0x2'));var moment=require('moment');var Redis=require('ioredis');var rp=require(_0xa15b('0x3'));var util=require(_0xa15b('0x4'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0xa15b('0x5'))(_0xa15b('0x6'));var schedule=require(_0xa15b('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xa15b('0x8'),'port':0x18eb});var redis=new Redis(config[_0xa15b('0x9')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xa15b('0xa'),_0xa15b('0xb'),_0xa15b('0xc'),_0xa15b('0xd'),_0xa15b('0xe'),_0xa15b('0xf'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xa15b('0xa'),_0xa15b('0xd')]};var MICROSOFT_AUTH_ENDPOINT=_0xa15b('0x10');var MICROSOFT_TOKEN_ENDPOINT=_0xa15b('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x57fc68){var _0x4bf462=_[_0xa15b('0x12')](AZURE_AUTH_SCOPES[_0x57fc68[_0xa15b('0x13')]]);if(_0x57fc68['type']==='Dynamics365')_0x4bf462[_0xa15b('0x14')](_0x57fc68[_0xa15b('0x15')]+_0xa15b('0x16'));return _0x4bf462['join']('\x20');}function getAccessTokenScope(_0x454148){if(_0x454148['type']===_0xa15b('0x17'))return _0xa15b('0xe');if(_0x454148[_0xa15b('0x13')]===_0xa15b('0x18'))return _0x454148[_0xa15b('0x15')]+_0xa15b('0x16');}function generateMicrosoftAuthorizationUrl(_0x4a2fa3,_0x1fd991){var _0x5903c2=MICROSOFT_AUTH_URL['replace'](_0xa15b('0x19'),_0x4a2fa3['data2']);var _0x1f491b=[_0xa15b('0x1a'),'id_token'];var _0x382127=Buffer['from'](JSON[_0xa15b('0x1b')]({'id':_0x1fd991}))[_0xa15b('0x1c')](_0xa15b('0x1d'));var _0x559aca=crypto[_0xa15b('0x1e')](0x10)[_0xa15b('0x1c')](_0xa15b('0x1f'));var _0x53b09f=getAuthorizationScopes(_0x4a2fa3);var _0x568926=[{'key':'client_id','value':_0x4a2fa3['data1']},{'key':'response_type','value':encodeURIComponent(_0x1f491b['join']('\x20'))},{'key':'redirect_uri','value':_0x4a2fa3[_0xa15b('0x20')]},{'key':_0xa15b('0x21'),'value':_0xa15b('0x22')},{'key':_0xa15b('0x23'),'value':encodeURIComponent(_0x53b09f)},{'key':_0xa15b('0x24'),'value':_0x382127},{'key':_0xa15b('0x25'),'value':_0x559aca},{'key':'prompt','value':_0xa15b('0x26')}];var _0x3ad18a=_0x5903c2+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xa15b('0x12')](_0x568926,function(_0x7a9f62){return _0x7a9f62[_0xa15b('0x27')]+'='+_0x7a9f62['value'];})[_0xa15b('0x28')]('&');_0x4a2fa3[_0xa15b('0x29')]={'issuer':_0x5903c2[_0xa15b('0x2a')](_0xa15b('0x2b'),''),'audience':_0x4a2fa3['data1'],'state':_0x382127,'nonce':_0x559aca};redis[_0xa15b('0x2c')](_0x382127,JSON[_0xa15b('0x1b')](_0x4a2fa3));return _0x3ad18a;}function isValidIdToken(_0x2f993b,_0x4bb2c9){try{var _0x53f86f=jwt['decode'](_0x2f993b,{'complete':!![]});var _0x182a31=_0x53f86f[_0xa15b('0x2d')];if(_0x182a31['iss']!==_0x4bb2c9[_0xa15b('0x2e')])return![];if(_0x182a31[_0xa15b('0x2f')]!==_0x4bb2c9[_0xa15b('0x30')])return![];if(_0x182a31[_0xa15b('0x25')]!==_0x4bb2c9[_0xa15b('0x25')])return![];if(moment()[_0xa15b('0x31')](moment[_0xa15b('0x32')](_0x182a31['exp'])))return![];return!![];}catch(_0x17283c){throw _0x17283c;}}function refreshOauth2MicrosoftAccessToken(_0x179007){return Promise[_0xa15b('0x33')]()['then'](function(){if(_0x179007['data3'])return _0x179007;return db[_0xa15b('0x34')][_0xa15b('0x35')]({'where':{'id':_0x179007['id']},'raw':!![]});})['then'](function(_0x4d5082){var _0x531102={'grant_type':'refresh_token','refresh_token':_0x4d5082[_0xa15b('0x36')],'scope':getAccessTokenScope(_0x4d5082),'redirect_uri':_0x4d5082[_0xa15b('0x20')],'client_id':_0x4d5082[_0xa15b('0x37')],'client_secret':encryptor[_0xa15b('0x38')](_0x4d5082['data3'])};var _0x3234a5={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xa15b('0x2a')](_0xa15b('0x19'),_0x4d5082[_0xa15b('0x39')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x531102,'json':!![]};return rp(_0x3234a5);})[_0xa15b('0x3a')](function(_0x5c4fcf){_0x179007[_0xa15b('0x3b')]=_0x5c4fcf[_0xa15b('0x3c')];_0x179007[_0xa15b('0x36')]=_0x5c4fcf[_0xa15b('0x3d')];return db[_0xa15b('0x34')][_0xa15b('0x3e')]({'data5':_0x179007[_0xa15b('0x3b')],'data6':_0x179007[_0xa15b('0x36')]},{'where':{'id':_0x179007['id']}});})[_0xa15b('0x3a')](function(){return _0x179007;})['catch'](function(_0x48c1db){logger['error'](_0xa15b('0x3f'),_0x179007['id'],_0x48c1db);});}function getOauth2MicrosoftAccessToken(_0x495ae2,_0x352328){var _0x3f47de={'grant_type':'authorization_code','code':_0x495ae2,'scope':getAccessTokenScope(_0x352328),'redirect_uri':_0x352328['data4'],'client_id':_0x352328[_0xa15b('0x37')],'client_secret':encryptor[_0xa15b('0x38')](_0x352328['data3'])};var _0x1b7b4a={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xa15b('0x2a')](_0xa15b('0x19'),_0x352328[_0xa15b('0x39')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3f47de,'json':!![]};return rp(_0x1b7b4a);}function startRefreshInterval(_0x4a36b7){var _0x153ac6=schedule['intervals'];if(_0x153ac6[_0x4a36b7['id']])clearInterval(_0x153ac6[_0x4a36b7['id']]);_0x153ac6[_0x4a36b7['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xa15b('0x40')](this,{'id':_0x4a36b7['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x153ac6;}function startAllRefreshIntervals(){return db[_0xa15b('0x34')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xa15b('0x3a')](function(_0x1681fe){var _0x11ad39=_0x1681fe[_0xa15b('0x12')](function(_0xf30aeb){return refreshOauth2MicrosoftAccessToken(_0xf30aeb)[_0xa15b('0x3a')](function(_0x99649c){startRefreshInterval(_0x99649c);});});return Promise[_0xa15b('0x41')](_0x11ad39);})['catch'](function(_0x7690f1){var _0x142e70=_0x7690f1?util[_0xa15b('0x42')](_0x7690f1,{'showHidden':![],'depth':null}):'';logger[_0xa15b('0x43')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x142e70);});}module[_0xa15b('0x44')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xc32d=['Outlook365','replace','{TENANT_ID}','data2','id_token','from','stringify','toString','client_id','data1','redirect_uri','data4','form_post','scope','state','nonce','prompt','login','map','value','oauth2/','set','decode','payload','iss','audience','unix','exp','data3','CloudProvider','findOne','then','refresh_token','data6','decryptString','POST','data5','access_token','error','authorization_code','intervals','bind','findAll','all','catch','inspect','exports','jsonwebtoken','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','Dynamics365','push','data7','/.default','join'];(function(_0x5b8255,_0x2b696f){var _0x4559c3=function(_0x384edb){while(--_0x384edb){_0x5b8255['push'](_0x5b8255['shift']());}};_0x4559c3(++_0x2b696f);}(_0xc32d,0x10d));var _0xdc32=function(_0x279d07,_0x13f4bd){_0x279d07=_0x279d07-0x0;var _0x13b943=_0xc32d[_0x279d07];return _0x13b943;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0xdc32('0x0'));var moment=require('moment');var Redis=require(_0xdc32('0x1'));var rp=require(_0xdc32('0x2'));var util=require(_0xdc32('0x3'));var encryptor=require(_0xdc32('0x4'));var config=require(_0xdc32('0x5'));var logger=require(_0xdc32('0x6'))(_0xdc32('0x7'));var schedule=require(_0xdc32('0x8'));var db=require(_0xdc32('0x9'))['db'];config['redis']=_['defaults'](config[_0xdc32('0xa')],{'host':_0xdc32('0xb'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xdc32('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xdc32('0xd'),_0xdc32('0xe'),_0xdc32('0xf'),_0xdc32('0x10'),_0xdc32('0x11'),'https://outlook.office.com/POP.AccessAsUser.All',_0xdc32('0x12')],'Dynamics365':[_0xdc32('0xd'),_0xdc32('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0xdc32('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xdc32('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x360df4){var _0x56095c=_['map'](AZURE_AUTH_SCOPES[_0x360df4[_0xdc32('0x15')]]);if(_0x360df4[_0xdc32('0x15')]===_0xdc32('0x16'))_0x56095c[_0xdc32('0x17')](_0x360df4[_0xdc32('0x18')]+_0xdc32('0x19'));return _0x56095c[_0xdc32('0x1a')]('\x20');}function getAccessTokenScope(_0x194ccd){if(_0x194ccd[_0xdc32('0x15')]===_0xdc32('0x1b'))return _0xdc32('0x11');if(_0x194ccd[_0xdc32('0x15')]==='Dynamics365')return _0x194ccd['data7']+_0xdc32('0x19');}function generateMicrosoftAuthorizationUrl(_0x5d08bf,_0x48047d){var _0x7df838=MICROSOFT_AUTH_URL[_0xdc32('0x1c')](_0xdc32('0x1d'),_0x5d08bf[_0xdc32('0x1e')]);var _0x15f889=['code',_0xdc32('0x1f')];var _0x21bf17=Buffer[_0xdc32('0x20')](JSON[_0xdc32('0x21')]({'id':_0x48047d}))[_0xdc32('0x22')]('base64');var _0x11b5f7=crypto['randomBytes'](0x10)[_0xdc32('0x22')]('hex');var _0x1b4e23=getAuthorizationScopes(_0x5d08bf);var _0x28f060=[{'key':_0xdc32('0x23'),'value':_0x5d08bf[_0xdc32('0x24')]},{'key':'response_type','value':encodeURIComponent(_0x15f889[_0xdc32('0x1a')]('\x20'))},{'key':_0xdc32('0x25'),'value':_0x5d08bf[_0xdc32('0x26')]},{'key':'response_mode','value':_0xdc32('0x27')},{'key':_0xdc32('0x28'),'value':encodeURIComponent(_0x1b4e23)},{'key':_0xdc32('0x29'),'value':_0x21bf17},{'key':_0xdc32('0x2a'),'value':_0x11b5f7},{'key':_0xdc32('0x2b'),'value':_0xdc32('0x2c')}];var _0x3bb5e1=_0x7df838+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xdc32('0x2d')](_0x28f060,function(_0x52f207){return _0x52f207['key']+'='+_0x52f207[_0xdc32('0x2e')];})[_0xdc32('0x1a')]('&');_0x5d08bf['oauth2Claims']={'issuer':_0x7df838[_0xdc32('0x1c')](_0xdc32('0x2f'),''),'audience':_0x5d08bf[_0xdc32('0x24')],'state':_0x21bf17,'nonce':_0x11b5f7};redis[_0xdc32('0x30')](_0x21bf17,JSON['stringify'](_0x5d08bf));return _0x3bb5e1;}function isValidIdToken(_0x4d642e,_0x43b7cd){try{var _0x1eef2b=jwt[_0xdc32('0x31')](_0x4d642e,{'complete':!![]});var _0xa4135b=_0x1eef2b[_0xdc32('0x32')];if(_0xa4135b[_0xdc32('0x33')]!==_0x43b7cd['issuer'])return![];if(_0xa4135b['aud']!==_0x43b7cd[_0xdc32('0x34')])return![];if(_0xa4135b[_0xdc32('0x2a')]!==_0x43b7cd['nonce'])return![];if(moment()['isAfter'](moment[_0xdc32('0x35')](_0xa4135b[_0xdc32('0x36')])))return![];return!![];}catch(_0xeb0c53){throw _0xeb0c53;}}function refreshOauth2MicrosoftAccessToken(_0x203bca){return Promise['resolve']()['then'](function(){if(_0x203bca[_0xdc32('0x37')])return _0x203bca;return db[_0xdc32('0x38')][_0xdc32('0x39')]({'where':{'id':_0x203bca['id']},'raw':!![]});})[_0xdc32('0x3a')](function(_0x49f6e7){var _0xe58865={'grant_type':_0xdc32('0x3b'),'refresh_token':_0x49f6e7[_0xdc32('0x3c')],'scope':getAccessTokenScope(_0x49f6e7),'redirect_uri':_0x49f6e7[_0xdc32('0x26')],'client_id':_0x49f6e7['data1'],'client_secret':encryptor[_0xdc32('0x3d')](_0x49f6e7[_0xdc32('0x37')])};var _0x370f77={'method':_0xdc32('0x3e'),'uri':MICROSOFT_AUTH_URL['replace'](_0xdc32('0x1d'),_0x49f6e7[_0xdc32('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xe58865,'json':!![]};return rp(_0x370f77);})[_0xdc32('0x3a')](function(_0xd75af){_0x203bca[_0xdc32('0x3f')]=_0xd75af[_0xdc32('0x40')];_0x203bca[_0xdc32('0x3c')]=_0xd75af[_0xdc32('0x3b')];return db[_0xdc32('0x38')]['update']({'data5':_0x203bca[_0xdc32('0x3f')],'data6':_0x203bca[_0xdc32('0x3c')]},{'where':{'id':_0x203bca['id']}});})['then'](function(){return _0x203bca;})['catch'](function(_0x4e52d4){logger[_0xdc32('0x41')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x203bca['id'],_0x4e52d4);});}function getOauth2MicrosoftAccessToken(_0x381c22,_0x95617a){var _0x944d3b={'grant_type':_0xdc32('0x42'),'code':_0x381c22,'scope':getAccessTokenScope(_0x95617a),'redirect_uri':_0x95617a['data4'],'client_id':_0x95617a[_0xdc32('0x24')],'client_secret':encryptor[_0xdc32('0x3d')](_0x95617a[_0xdc32('0x37')])};var _0x2c1032={'method':_0xdc32('0x3e'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x95617a[_0xdc32('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x944d3b,'json':!![]};return rp(_0x2c1032);}function startRefreshInterval(_0x1e0276){var _0x4df50a=schedule[_0xdc32('0x43')];if(_0x4df50a[_0x1e0276['id']])clearInterval(_0x4df50a[_0x1e0276['id']]);_0x4df50a[_0x1e0276['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xdc32('0x44')](this,{'id':_0x1e0276['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xdc32('0x43')]=_0x4df50a;}function startAllRefreshIntervals(){return db[_0xdc32('0x38')][_0xdc32('0x45')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xdc32('0x3a')](function(_0x205734){var _0x281de0=_0x205734['map'](function(_0x42936c){return refreshOauth2MicrosoftAccessToken(_0x42936c)[_0xdc32('0x3a')](function(_0x3a3b5e){startRefreshInterval(_0x3a3b5e);});});return Promise[_0xdc32('0x46')](_0x281de0);})[_0xdc32('0x47')](function(_0x6af338){var _0x39ac8f=_0x6af338?util[_0xdc32('0x48')](_0x6af338,{'showHidden':![],'depth':null}):'';logger[_0xdc32('0x41')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x39ac8f);});}module[_0xdc32('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 f2ee3f4..8a18cc7 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 _0x0570=['request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xd02def,_0x144f25){var _0x2e8374=function(_0x5ceb35){while(--_0x5ceb35){_0xd02def['push'](_0xd02def['shift']());}};_0x2e8374(++_0x144f25);}(_0x0570,0x172));var _0x0057=function(_0x31011c,_0x3f6aa6){_0x31011c=_0x31011c-0x0;var _0x5078c4=_0x0570[_0x31011c];return _0x5078c4;};'use strict';var _=require('lodash');var util=require(_0x0057('0x0'));var moment=require(_0x0057('0x1'));var BPromise=require(_0x0057('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0057('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0057('0x4'));var logger=require('../../config/logger')(_0x0057('0x5'));var config=require(_0x0057('0x6'));var jayson=require(_0x0057('0x7'));var client=jayson[_0x0057('0x8')][_0x0057('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5096e2,_0xc86734,_0x529f55){return new BPromise(function(_0x15d424,_0x2f9d7f){return client[_0x0057('0xa')](_0x5096e2,_0x529f55)[_0x0057('0xb')](function(_0x29b7c6){logger['info'](_0x0057('0xc'),_0xc86734,_0x0057('0xd'));logger[_0x0057('0xe')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0xc86734,_0x0057('0xd'),JSON[_0x0057('0xf')](_0x29b7c6));if(_0x29b7c6['error']){if(_0x29b7c6['error'][_0x0057('0x10')]===0x1f4){logger[_0x0057('0x11')](_0x0057('0xc'),_0xc86734,_0x29b7c6['error'][_0x0057('0x12')]);return _0x2f9d7f(_0x29b7c6[_0x0057('0x11')][_0x0057('0x12')]);}logger[_0x0057('0x11')]('CloudProvider,\x20%s,\x20%s',_0xc86734,_0x29b7c6[_0x0057('0x11')][_0x0057('0x12')]);return _0x15d424(_0x29b7c6['error'][_0x0057('0x12')]);}else{logger[_0x0057('0x13')]('CloudProvider,\x20%s,\x20%s',_0xc86734,_0x0057('0xd'));_0x15d424(_0x29b7c6['result'][_0x0057('0x12')]);}})['catch'](function(_0x4be851){logger[_0x0057('0x11')]('CloudProvider,\x20%s,\x20%s',_0xc86734,_0x4be851);_0x2f9d7f(_0x4be851);});});} \ No newline at end of file +var _0xda81=['then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request'];(function(_0x2c24b8,_0x168e0b){var _0x563ed6=function(_0x7c1aa9){while(--_0x7c1aa9){_0x2c24b8['push'](_0x2c24b8['shift']());}};_0x563ed6(++_0x168e0b);}(_0xda81,0x1c3));var _0x1da8=function(_0x19c8e1,_0x33f9da){_0x19c8e1=_0x19c8e1-0x0;var _0x73cbf3=_0xda81[_0x19c8e1];return _0x73cbf3;};'use strict';var _=require(_0x1da8('0x0'));var util=require(_0x1da8('0x1'));var moment=require(_0x1da8('0x2'));var BPromise=require('bluebird');var rs=require(_0x1da8('0x3'));var fs=require('fs');var Redis=require(_0x1da8('0x4'));var db=require(_0x1da8('0x5'))['db'];var utils=require(_0x1da8('0x6'));var logger=require('../../config/logger')(_0x1da8('0x7'));var config=require(_0x1da8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1da8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x891482,_0x2c2bb4,_0xea1eb1){return new BPromise(function(_0x1a3278,_0x11dc1e){return client[_0x1da8('0xa')](_0x891482,_0xea1eb1)[_0x1da8('0xb')](function(_0x17a7fc){logger[_0x1da8('0xc')]('CloudProvider,\x20%s,\x20%s',_0x2c2bb4,_0x1da8('0xd'));logger[_0x1da8('0xe')](_0x1da8('0xf'),_0x2c2bb4,_0x1da8('0xd'),JSON[_0x1da8('0x10')](_0x17a7fc));if(_0x17a7fc['error']){if(_0x17a7fc[_0x1da8('0x11')]['code']===0x1f4){logger[_0x1da8('0x11')](_0x1da8('0x12'),_0x2c2bb4,_0x17a7fc[_0x1da8('0x11')][_0x1da8('0x13')]);return _0x11dc1e(_0x17a7fc[_0x1da8('0x11')]['message']);}logger[_0x1da8('0x11')]('CloudProvider,\x20%s,\x20%s',_0x2c2bb4,_0x17a7fc[_0x1da8('0x11')][_0x1da8('0x13')]);return _0x1a3278(_0x17a7fc[_0x1da8('0x11')][_0x1da8('0x13')]);}else{logger[_0x1da8('0xc')](_0x1da8('0x12'),_0x2c2bb4,'request\x20sent');_0x1a3278(_0x17a7fc[_0x1da8('0x14')][_0x1da8('0x13')]);}})[_0x1da8('0x15')](function(_0x197b09){logger[_0x1da8('0x11')](_0x1da8('0x12'),_0x2c2bb4,_0x197b09);_0x11dc1e(_0x197b09);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index b1f7097..8342beb 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 _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x7a54,0x106));var _0x47a5=function(_0x10df32,_0x16e49e){_0x10df32=_0x10df32-0x0;var _0x4023a6=_0x7a54[_0x10df32];return _0x4023a6;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file +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(_0x118555,_0xe6dd6c){var _0x24ec92=function(_0x85f999){while(--_0x85f999){_0x118555['push'](_0x118555['shift']());}};_0x24ec92(++_0xe6dd6c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xc4aa[_0x199572];return _0x13cfa3;};'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 diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index dfb0344..7da178f 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 _0xda9c=['exports','STRING','name','sequelize'];(function(_0x2e5afc,_0x352c85){var _0x32c519=function(_0x5f0313){while(--_0x5f0313){_0x2e5afc['push'](_0x2e5afc['shift']());}};_0x32c519(++_0x352c85);}(_0xda9c,0x7b));var _0xcda9=function(_0x523eaf,_0x487fc6){_0x523eaf=_0x523eaf-0x0;var _0x319ba0=_0xda9c[_0x523eaf];return _0x319ba0;};'use strict';var Sequelize=require(_0xcda9('0x0'));module[_0xcda9('0x1')]={'name':{'type':Sequelize[_0xcda9('0x2')],'unique':_0xcda9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xcda9('0x2')]},'companyId':{'type':Sequelize[_0xcda9('0x2')]},'website':{'type':Sequelize[_0xcda9('0x2')]},'phone':{'type':Sequelize[_0xcda9('0x2')]},'fax':{'type':Sequelize[_0xcda9('0x2')]},'type':{'type':Sequelize[_0xcda9('0x2')]},'street':{'type':Sequelize[_0xcda9('0x2')]},'postalCode':{'type':Sequelize[_0xcda9('0x2')]},'city':{'type':Sequelize[_0xcda9('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xcda9('0x2')]},'sCity':{'type':Sequelize[_0xcda9('0x2')]},'sCountry':{'type':Sequelize[_0xcda9('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x023f=['name','sequelize','exports','STRING'];(function(_0x34b951,_0x554a89){var _0x2b259f=function(_0x39bf00){while(--_0x39bf00){_0x34b951['push'](_0x34b951['shift']());}};_0x2b259f(++_0x554a89);}(_0x023f,0x69));var _0xf023=function(_0x44164b,_0x4b4ea1){_0x44164b=_0x44164b-0x0;var _0x869b3d=_0x023f[_0x44164b];return _0x869b3d;};'use strict';var Sequelize=require(_0xf023('0x0'));module[_0xf023('0x1')]={'name':{'type':Sequelize[_0xf023('0x2')],'unique':_0xf023('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf023('0x2')]},'companyId':{'type':Sequelize[_0xf023('0x2')]},'website':{'type':Sequelize[_0xf023('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xf023('0x2')]},'type':{'type':Sequelize[_0xf023('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf023('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf023('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf023('0x2')]},'sStreet':{'type':Sequelize[_0xf023('0x2')]},'sPostalCode':{'type':Sequelize[_0xf023('0x2')]},'sCity':{'type':Sequelize[_0xf023('0x2')]},'sCountry':{'type':Sequelize[_0xf023('0x2')]},'description':{'type':Sequelize[_0xf023('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 1ca3f84..31f0dee 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 _0xb0a5=['path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','apply','save','then','destroy','get','Companies','UserProfileResource','error','stack','name','index','CmCompany','describe','keys','query','filters','intersection','model','fields','attributes','order','sort','where','merge','map','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','CmContact','addContacts','omit','getContacts','pick','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x29c08e,_0x36cac6){var _0x24ee90=function(_0x5c966e){while(--_0x5c966e){_0x29c08e['push'](_0x29c08e['shift']());}};_0x24ee90(++_0x36cac6);}(_0xb0a5,0x13c));var _0x5b0a=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0xb0a5[_0x1e6db3];return _0x1de886;};'use strict';var emlformat=require(_0x5b0a('0x0'));var rimraf=require(_0x5b0a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5b0a('0x2'));var rp=require(_0x5b0a('0x3'));var moment=require(_0x5b0a('0x4'));var BPromise=require(_0x5b0a('0x5'));var Mustache=require(_0x5b0a('0x6'));var util=require(_0x5b0a('0x7'));var path=require(_0x5b0a('0x8'));var sox=require('sox');var csv=require(_0x5b0a('0x9'));var ejs=require(_0x5b0a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5b0a('0xb'));var crypto=require(_0x5b0a('0xc'));var jsforce=require(_0x5b0a('0xd'));var deskjs=require(_0x5b0a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5b0a('0xf'));var Papa=require(_0x5b0a('0x10'));var Redis=require('ioredis');var authService=require(_0x5b0a('0x11'));var qs=require(_0x5b0a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b0a('0x13'));var logger=require(_0x5b0a('0x14'))(_0x5b0a('0x15'));var utils=require('../../config/utils');var config=require(_0x5b0a('0x16'));var licenseUtil=require(_0x5b0a('0x17'));var db=require(_0x5b0a('0x18'))['db'];function respondWithStatusCode(_0x882c5,_0x2dc12c){_0x2dc12c=_0x2dc12c||0xcc;return function(_0x5c98dd){if(_0x5c98dd){return _0x882c5['sendStatus'](_0x2dc12c);}return _0x882c5[_0x5b0a('0x19')](_0x2dc12c)[_0x5b0a('0x1a')]();};}function respondWithResult(_0x46f2eb,_0x45a076){_0x45a076=_0x45a076||0xc8;return function(_0x32117c){if(_0x32117c){return _0x46f2eb[_0x5b0a('0x19')](_0x45a076)[_0x5b0a('0x1b')](_0x32117c);}};}function respondWithFilteredResult(_0x248143,_0x3e9ac1){return function(_0x2fda60){if(_0x2fda60){var _0x1daead=typeof _0x3e9ac1['offset']===_0x5b0a('0x1c')&&typeof _0x3e9ac1[_0x5b0a('0x1d')]===_0x5b0a('0x1c');var _0x29a8ef=_0x2fda60[_0x5b0a('0x1e')];var _0x3b95c3=_0x1daead?0x0:_0x3e9ac1[_0x5b0a('0x1f')];var _0x48654b=_0x1daead?_0x2fda60[_0x5b0a('0x1e')]:_0x3e9ac1[_0x5b0a('0x1f')]+_0x3e9ac1[_0x5b0a('0x1d')];var _0x47b153;if(_0x48654b>=_0x29a8ef){_0x48654b=_0x29a8ef;_0x47b153=0xc8;}else{_0x47b153=0xce;}_0x248143['status'](_0x47b153);return _0x248143['set']('Content-Range',_0x3b95c3+'-'+_0x48654b+'/'+_0x29a8ef)[_0x5b0a('0x1b')](_0x2fda60);}return null;};}function patchUpdates(_0x497c4b){return function(_0x3ab22e){try{jsonpatch[_0x5b0a('0x20')](_0x3ab22e,_0x497c4b,!![]);}catch(_0x499576){return BPromise['reject'](_0x499576);}return _0x3ab22e[_0x5b0a('0x21')]();};}function saveUpdates(_0x8386c4,_0x2b9b6a){return function(_0x3a93f7){if(_0x3a93f7){return _0x3a93f7['update'](_0x8386c4)[_0x5b0a('0x22')](function(_0x2863e7){return _0x2863e7;});}return null;};}function removeEntity(_0x16c564,_0xf5efa3){return function(_0x380b3f){if(_0x380b3f){return _0x380b3f[_0x5b0a('0x23')]()[_0x5b0a('0x22')](function(){var _0x53a196=_0x380b3f[_0x5b0a('0x24')]({'plain':!![]});var _0x385355=_0x5b0a('0x25');return db[_0x5b0a('0x26')][_0x5b0a('0x23')]({'where':{'type':_0x385355,'resourceId':_0x53a196['id']}})[_0x5b0a('0x22')](function(){return _0x380b3f;});})[_0x5b0a('0x22')](function(){_0x16c564[_0x5b0a('0x19')](0xcc)[_0x5b0a('0x1a')]();});}};}function handleEntityNotFound(_0x161316,_0x295c0d){return function(_0x26eb0e){if(!_0x26eb0e){_0x161316['sendStatus'](0x194);}return _0x26eb0e;};}function handleError(_0x2da3de,_0x212436){_0x212436=_0x212436||0x1f4;return function(_0x1aa9d4){logger[_0x5b0a('0x27')](_0x1aa9d4[_0x5b0a('0x28')]);if(_0x1aa9d4[_0x5b0a('0x29')]){delete _0x1aa9d4[_0x5b0a('0x29')];}_0x2da3de[_0x5b0a('0x19')](_0x212436)['send'](_0x1aa9d4);};}exports[_0x5b0a('0x2a')]=function(_0x123f11,_0x35a999){var _0x3caa32={},_0x2a8545={},_0x12c17={'count':0x0,'rows':[]};return db[_0x5b0a('0x2b')][_0x5b0a('0x2c')]()[_0x5b0a('0x22')](function(_0x26cf75){_0x2a8545['model']=_[_0x5b0a('0x2d')](_0x26cf75);_0x2a8545[_0x5b0a('0x2e')]=_['keys'](_0x123f11[_0x5b0a('0x2e')]);_0x2a8545[_0x5b0a('0x2f')]=_[_0x5b0a('0x30')](_0x2a8545[_0x5b0a('0x31')],_0x2a8545['query']);_0x3caa32['attributes']=_[_0x5b0a('0x30')](_0x2a8545['model'],qs[_0x5b0a('0x32')](_0x123f11[_0x5b0a('0x2e')][_0x5b0a('0x32')]));_0x3caa32[_0x5b0a('0x33')]=_0x3caa32[_0x5b0a('0x33')]['length']?_0x3caa32[_0x5b0a('0x33')]:_0x2a8545['model'];if(!_0x123f11['query']['hasOwnProperty']('nolimit')){_0x3caa32['limit']=qs[_0x5b0a('0x1d')](_0x123f11[_0x5b0a('0x2e')][_0x5b0a('0x1d')]);_0x3caa32[_0x5b0a('0x1f')]=qs['offset'](_0x123f11[_0x5b0a('0x2e')]['offset']);}_0x3caa32[_0x5b0a('0x34')]=qs[_0x5b0a('0x35')](_0x123f11['query'][_0x5b0a('0x35')]);_0x3caa32[_0x5b0a('0x36')]=qs[_0x5b0a('0x2f')](_['pick'](_0x123f11[_0x5b0a('0x2e')],_0x2a8545[_0x5b0a('0x2f')]),_0x26cf75);if(_0x123f11[_0x5b0a('0x2e')]['filter']){_0x3caa32[_0x5b0a('0x36')]=_[_0x5b0a('0x37')](_0x3caa32[_0x5b0a('0x36')],{'$or':_[_0x5b0a('0x38')](_0x3caa32[_0x5b0a('0x33')],function(_0x15783f){var _0x499689={};_0x499689[_0x15783f]={'$like':'%'+_0x123f11['query'][_0x5b0a('0x39')]+'%'};return _0x499689;})});}_0x3caa32=_[_0x5b0a('0x37')]({},_0x3caa32,_0x123f11['options']);var _0x6b08aa={'where':_0x3caa32['where']};return db['CmCompany'][_0x5b0a('0x1e')](_0x6b08aa)[_0x5b0a('0x22')](function(_0x5de7c5){_0x12c17[_0x5b0a('0x1e')]=_0x5de7c5;if(_0x123f11[_0x5b0a('0x2e')][_0x5b0a('0x3a')]){_0x3caa32[_0x5b0a('0x3b')]=[{'all':!![]}];}return db[_0x5b0a('0x2b')][_0x5b0a('0x3c')](_0x3caa32);})[_0x5b0a('0x22')](function(_0x264893){_0x12c17[_0x5b0a('0x3d')]=_0x264893;return _0x12c17;})[_0x5b0a('0x22')](respondWithFilteredResult(_0x35a999,_0x3caa32))[_0x5b0a('0x3e')](handleError(_0x35a999,null));})[_0x5b0a('0x3e')](handleError(_0x35a999,null));};exports[_0x5b0a('0x3f')]=function(_0x3caf9a,_0x3669af){var _0xfa809e={'raw':![],'where':{'id':_0x3caf9a[_0x5b0a('0x40')]['id']}},_0x2c5991={};_0x2c5991['model']=_[_0x5b0a('0x2d')](db['CmCompany'][_0x5b0a('0x41')]);_0x2c5991[_0x5b0a('0x2e')]=_[_0x5b0a('0x2d')](_0x3caf9a[_0x5b0a('0x2e')]);_0x2c5991[_0x5b0a('0x2f')]=_[_0x5b0a('0x30')](_0x2c5991[_0x5b0a('0x31')],_0x2c5991[_0x5b0a('0x2e')]);_0xfa809e[_0x5b0a('0x33')]=_[_0x5b0a('0x30')](_0x2c5991['model'],qs[_0x5b0a('0x32')](_0x3caf9a[_0x5b0a('0x2e')]['fields']));_0xfa809e[_0x5b0a('0x33')]=_0xfa809e[_0x5b0a('0x33')][_0x5b0a('0x42')]?_0xfa809e['attributes']:_0x2c5991[_0x5b0a('0x31')];if(_0x3caf9a[_0x5b0a('0x2e')][_0x5b0a('0x3a')]){_0xfa809e[_0x5b0a('0x3b')]=[{'all':!![]}];}_0xfa809e=_['merge']({},_0xfa809e,_0x3caf9a[_0x5b0a('0x43')]);return db[_0x5b0a('0x2b')]['find'](_0xfa809e)[_0x5b0a('0x22')](handleEntityNotFound(_0x3669af,null))[_0x5b0a('0x22')](respondWithResult(_0x3669af,null))[_0x5b0a('0x3e')](handleError(_0x3669af,null));};exports['create']=function(_0x58d027,_0x3d7bbc){return db[_0x5b0a('0x2b')][_0x5b0a('0x44')](_0x58d027[_0x5b0a('0x45')],{})[_0x5b0a('0x22')](function(_0x1aec14){var _0x2f5095=_0x58d027[_0x5b0a('0x46')][_0x5b0a('0x24')]({'plain':!![]});if(!_0x2f5095)throw new Error(_0x5b0a('0x47'));if(_0x2f5095['role']==='user'){var _0x430ecb=_0x1aec14[_0x5b0a('0x24')]({'plain':!![]});var _0x35bf50=_0x5b0a('0x25');return db['UserProfileSection'][_0x5b0a('0x48')]({'where':{'name':_0x35bf50,'userProfileId':_0x2f5095[_0x5b0a('0x49')]},'raw':!![]})[_0x5b0a('0x22')](function(_0x4d7beb){if(_0x4d7beb&&_0x4d7beb['autoAssociation']===0x0){return db[_0x5b0a('0x26')][_0x5b0a('0x44')]({'name':_0x430ecb[_0x5b0a('0x29')],'resourceId':_0x430ecb['id'],'type':_0x4d7beb['name'],'sectionId':_0x4d7beb['id']},{})[_0x5b0a('0x22')](function(){return _0x1aec14;});}else{return _0x1aec14;}})[_0x5b0a('0x3e')](function(_0x4d4b3f){logger['error'](_0x5b0a('0x4a'),_0x4d4b3f);throw _0x4d4b3f;});}return _0x1aec14;})['then'](respondWithResult(_0x3d7bbc,0xc9))[_0x5b0a('0x3e')](handleError(_0x3d7bbc,null));};exports[_0x5b0a('0x4b')]=function(_0x17b864,_0x36ebf4){if(_0x17b864[_0x5b0a('0x45')]['id']){delete _0x17b864[_0x5b0a('0x45')]['id'];}return db[_0x5b0a('0x2b')][_0x5b0a('0x48')]({'where':{'id':_0x17b864[_0x5b0a('0x40')]['id']}})[_0x5b0a('0x22')](handleEntityNotFound(_0x36ebf4,null))[_0x5b0a('0x22')](saveUpdates(_0x17b864[_0x5b0a('0x45')],null))[_0x5b0a('0x22')](respondWithResult(_0x36ebf4,null))[_0x5b0a('0x3e')](handleError(_0x36ebf4,null));};exports[_0x5b0a('0x23')]=function(_0x6c6bc7,_0x387efe){return db['CmCompany'][_0x5b0a('0x48')]({'where':{'id':_0x6c6bc7['params']['id']}})['then'](handleEntityNotFound(_0x387efe,null))[_0x5b0a('0x22')](removeEntity(_0x387efe,null))[_0x5b0a('0x3e')](handleError(_0x387efe,null));};exports[_0x5b0a('0x2c')]=function(_0x2db606,_0xdb3d1e){return db[_0x5b0a('0x2b')]['describe']()['then'](respondWithResult(_0xdb3d1e,null))[_0x5b0a('0x3e')](handleError(_0xdb3d1e,null));};exports['addContacts']=function(_0x151d58,_0x3f3592,_0x22cd35){return db[_0x5b0a('0x4c')][_0x5b0a('0x48')]({'where':{'id':_0x151d58[_0x5b0a('0x40')]['id']}})[_0x5b0a('0x22')](handleEntityNotFound(_0x3f3592,null))['then'](function(_0x540fe5){if(_0x540fe5){return _0x540fe5[_0x5b0a('0x4d')](_0x151d58[_0x5b0a('0x45')]['ids'],_[_0x5b0a('0x4e')](_0x151d58[_0x5b0a('0x45')],['ids','id'])||{});}})[_0x5b0a('0x22')](respondWithResult(_0x3f3592,null))[_0x5b0a('0x3e')](handleError(_0x3f3592,null));};exports[_0x5b0a('0x4f')]=function(_0xa71a88,_0x23edaa,_0x110ee0){var _0x5dbb90={};var _0x4c41d5={};var _0xe72d0;var _0x5918fb;return db['CmCompany']['findOne']({'where':{'id':_0xa71a88[_0x5b0a('0x40')]['id']}})[_0x5b0a('0x22')](handleEntityNotFound(_0x23edaa,null))[_0x5b0a('0x22')](function(_0xc0b9b1){if(_0xc0b9b1){_0xe72d0=_0xc0b9b1;_0x4c41d5[_0x5b0a('0x31')]=_[_0x5b0a('0x2d')](db[_0x5b0a('0x4c')][_0x5b0a('0x41')]);_0x4c41d5[_0x5b0a('0x2e')]=_['keys'](_0xa71a88['query']);_0x4c41d5['filters']=_['intersection'](_0x4c41d5[_0x5b0a('0x31')],_0x4c41d5[_0x5b0a('0x2e')]);_0x5dbb90[_0x5b0a('0x33')]=_[_0x5b0a('0x30')](_0x4c41d5['model'],qs['fields'](_0xa71a88[_0x5b0a('0x2e')][_0x5b0a('0x32')]));_0x5dbb90['attributes']=_0x5dbb90['attributes'][_0x5b0a('0x42')]?_0x5dbb90[_0x5b0a('0x33')]:_0x4c41d5[_0x5b0a('0x31')];_0x5dbb90['order']=qs[_0x5b0a('0x35')](_0xa71a88['query'][_0x5b0a('0x35')]);_0x5dbb90[_0x5b0a('0x36')]=qs[_0x5b0a('0x2f')](_[_0x5b0a('0x50')](_0xa71a88[_0x5b0a('0x2e')],_0x4c41d5[_0x5b0a('0x2f')]));if(_0xa71a88[_0x5b0a('0x2e')][_0x5b0a('0x39')]){_0x5dbb90[_0x5b0a('0x36')]=_['merge'](_0x5dbb90['where'],{'$or':_[_0x5b0a('0x38')](_0x5dbb90[_0x5b0a('0x33')],function(_0x29d1e3){var _0x70dd9b={};_0x70dd9b[_0x29d1e3]={'$like':'%'+_0xa71a88['query'][_0x5b0a('0x39')]+'%'};return _0x70dd9b;})});}_0x5dbb90=_[_0x5b0a('0x37')]({},_0x5dbb90,_0xa71a88['options']);return _0xe72d0[_0x5b0a('0x4f')](_0x5dbb90);}})[_0x5b0a('0x22')](function(_0x341ca8){if(_0x341ca8){_0x5918fb=_0x341ca8[_0x5b0a('0x42')];if(!_0xa71a88[_0x5b0a('0x2e')]['hasOwnProperty']('nolimit')){_0x5dbb90['limit']=qs['limit'](_0xa71a88[_0x5b0a('0x2e')]['limit']);_0x5dbb90[_0x5b0a('0x1f')]=qs['offset'](_0xa71a88['query'][_0x5b0a('0x1f')]);}return _0xe72d0[_0x5b0a('0x4f')](_0x5dbb90);}})[_0x5b0a('0x22')](function(_0x1133b0){if(_0x1133b0){return _0x1133b0?{'count':_0x5918fb,'rows':_0x1133b0}:null;}})['then'](respondWithResult(_0x23edaa,null))[_0x5b0a('0x3e')](handleError(_0x23edaa,null));}; \ No newline at end of file +var _0x82cb=['create','body','user','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','nolimit','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','Companies','error','stack','name','send','index','CmCompany','describe','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes'];(function(_0x2f10b6,_0x565c9b){var _0x2f4066=function(_0x2b31b2){while(--_0x2b31b2){_0x2f10b6['push'](_0x2f10b6['shift']());}};_0x2f4066(++_0x565c9b);}(_0x82cb,0x17c));var _0xb82c=function(_0x13cd39,_0x5c317b){_0x13cd39=_0x13cd39-0x0;var _0x405d90=_0x82cb[_0x13cd39];return _0x405d90;};'use strict';var emlformat=require(_0xb82c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb82c('0x1'));var jsonpatch=require(_0xb82c('0x2'));var rp=require('request-promise');var moment=require(_0xb82c('0x3'));var BPromise=require(_0xb82c('0x4'));var Mustache=require(_0xb82c('0x5'));var util=require(_0xb82c('0x6'));var path=require(_0xb82c('0x7'));var sox=require(_0xb82c('0x8'));var csv=require(_0xb82c('0x9'));var ejs=require(_0xb82c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb82c('0xb'));var squel=require(_0xb82c('0xc'));var crypto=require(_0xb82c('0xd'));var jsforce=require(_0xb82c('0xe'));var deskjs=require(_0xb82c('0xf'));var toCsv=require(_0xb82c('0x9'));var querystring=require(_0xb82c('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb82c('0x11'));var qs=require(_0xb82c('0x12'));var as=require(_0xb82c('0x13'));var hardwareService=require(_0xb82c('0x14'));var logger=require(_0xb82c('0x15'))(_0xb82c('0x16'));var utils=require(_0xb82c('0x17'));var config=require(_0xb82c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb82c('0x19'))['db'];function respondWithStatusCode(_0x193dcc,_0x1dfb16){_0x1dfb16=_0x1dfb16||0xcc;return function(_0x1eeac8){if(_0x1eeac8){return _0x193dcc[_0xb82c('0x1a')](_0x1dfb16);}return _0x193dcc['status'](_0x1dfb16)[_0xb82c('0x1b')]();};}function respondWithResult(_0x4eab47,_0x35fdf8){_0x35fdf8=_0x35fdf8||0xc8;return function(_0x63c6f1){if(_0x63c6f1){return _0x4eab47[_0xb82c('0x1c')](_0x35fdf8)[_0xb82c('0x1d')](_0x63c6f1);}};}function respondWithFilteredResult(_0x268bb6,_0x57b49a){return function(_0x459023){if(_0x459023){var _0x2deb89=typeof _0x57b49a[_0xb82c('0x1e')]==='undefined'&&typeof _0x57b49a[_0xb82c('0x1f')]===_0xb82c('0x20');var _0x4b1b23=_0x459023[_0xb82c('0x21')];var _0x13199c=_0x2deb89?0x0:_0x57b49a['offset'];var _0x2e1efa=_0x2deb89?_0x459023[_0xb82c('0x21')]:_0x57b49a['offset']+_0x57b49a[_0xb82c('0x1f')];var _0x58efaf;if(_0x2e1efa>=_0x4b1b23){_0x2e1efa=_0x4b1b23;_0x58efaf=0xc8;}else{_0x58efaf=0xce;}_0x268bb6['status'](_0x58efaf);return _0x268bb6[_0xb82c('0x22')](_0xb82c('0x23'),_0x13199c+'-'+_0x2e1efa+'/'+_0x4b1b23)[_0xb82c('0x1d')](_0x459023);}return null;};}function patchUpdates(_0x469508){return function(_0x3db8d7){try{jsonpatch['apply'](_0x3db8d7,_0x469508,!![]);}catch(_0x3a6588){return BPromise[_0xb82c('0x24')](_0x3a6588);}return _0x3db8d7[_0xb82c('0x25')]();};}function saveUpdates(_0x5c7aba,_0xa94978){return function(_0x236590){if(_0x236590){return _0x236590[_0xb82c('0x26')](_0x5c7aba)[_0xb82c('0x27')](function(_0x202761){return _0x202761;});}return null;};}function removeEntity(_0x9434c7,_0x2d7879){return function(_0x6762cd){if(_0x6762cd){return _0x6762cd[_0xb82c('0x28')]()[_0xb82c('0x27')](function(){var _0x227c09=_0x6762cd[_0xb82c('0x29')]({'plain':!![]});var _0x57ee5f=_0xb82c('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x57ee5f,'resourceId':_0x227c09['id']}})[_0xb82c('0x27')](function(){return _0x6762cd;});})[_0xb82c('0x27')](function(){_0x9434c7[_0xb82c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x415edf,_0x3df6aa){return function(_0x310777){if(!_0x310777){_0x415edf['sendStatus'](0x194);}return _0x310777;};}function handleError(_0x7ddd98,_0x4e0985){_0x4e0985=_0x4e0985||0x1f4;return function(_0x337f05){logger[_0xb82c('0x2b')](_0x337f05[_0xb82c('0x2c')]);if(_0x337f05[_0xb82c('0x2d')]){delete _0x337f05[_0xb82c('0x2d')];}_0x7ddd98[_0xb82c('0x1c')](_0x4e0985)[_0xb82c('0x2e')](_0x337f05);};}exports[_0xb82c('0x2f')]=function(_0x4bfd63,_0xd90571){var _0x49aab7={},_0xa60d95={},_0x52834c={'count':0x0,'rows':[]};return db[_0xb82c('0x30')][_0xb82c('0x31')]()[_0xb82c('0x27')](function(_0x460bd4){_0xa60d95['model']=_[_0xb82c('0x32')](_0x460bd4);_0xa60d95[_0xb82c('0x33')]=_[_0xb82c('0x32')](_0x4bfd63[_0xb82c('0x33')]);_0xa60d95[_0xb82c('0x34')]=_[_0xb82c('0x35')](_0xa60d95['model'],_0xa60d95[_0xb82c('0x33')]);_0x49aab7['attributes']=_[_0xb82c('0x35')](_0xa60d95[_0xb82c('0x36')],qs[_0xb82c('0x37')](_0x4bfd63[_0xb82c('0x33')][_0xb82c('0x37')]));_0x49aab7[_0xb82c('0x38')]=_0x49aab7[_0xb82c('0x38')][_0xb82c('0x39')]?_0x49aab7['attributes']:_0xa60d95['model'];if(!_0x4bfd63[_0xb82c('0x33')][_0xb82c('0x3a')]('nolimit')){_0x49aab7[_0xb82c('0x1f')]=qs[_0xb82c('0x1f')](_0x4bfd63['query'][_0xb82c('0x1f')]);_0x49aab7['offset']=qs[_0xb82c('0x1e')](_0x4bfd63[_0xb82c('0x33')][_0xb82c('0x1e')]);}_0x49aab7[_0xb82c('0x3b')]=qs[_0xb82c('0x3c')](_0x4bfd63[_0xb82c('0x33')]['sort']);_0x49aab7['where']=qs['filters'](_[_0xb82c('0x3d')](_0x4bfd63['query'],_0xa60d95[_0xb82c('0x34')]),_0x460bd4);if(_0x4bfd63['query'][_0xb82c('0x3e')]){_0x49aab7[_0xb82c('0x3f')]=_[_0xb82c('0x40')](_0x49aab7[_0xb82c('0x3f')],{'$or':_[_0xb82c('0x41')](_0x49aab7[_0xb82c('0x38')],function(_0x1d381c){var _0x232469={};_0x232469[_0x1d381c]={'$like':'%'+_0x4bfd63[_0xb82c('0x33')][_0xb82c('0x3e')]+'%'};return _0x232469;})});}_0x49aab7=_['merge']({},_0x49aab7,_0x4bfd63[_0xb82c('0x42')]);var _0x3eecf0={'where':_0x49aab7[_0xb82c('0x3f')]};return db['CmCompany'][_0xb82c('0x21')](_0x3eecf0)[_0xb82c('0x27')](function(_0x5a343e){_0x52834c[_0xb82c('0x21')]=_0x5a343e;if(_0x4bfd63[_0xb82c('0x33')][_0xb82c('0x43')]){_0x49aab7[_0xb82c('0x44')]=[{'all':!![]}];}return db['CmCompany'][_0xb82c('0x45')](_0x49aab7);})[_0xb82c('0x27')](function(_0x5f17a2){_0x52834c[_0xb82c('0x46')]=_0x5f17a2;return _0x52834c;})[_0xb82c('0x27')](respondWithFilteredResult(_0xd90571,_0x49aab7))[_0xb82c('0x47')](handleError(_0xd90571,null));})[_0xb82c('0x47')](handleError(_0xd90571,null));};exports[_0xb82c('0x48')]=function(_0x4d14b7,_0x310162){var _0x5c3be1={'raw':![],'where':{'id':_0x4d14b7[_0xb82c('0x49')]['id']}},_0xc810d9={};_0xc810d9[_0xb82c('0x36')]=_[_0xb82c('0x32')](db[_0xb82c('0x30')][_0xb82c('0x4a')]);_0xc810d9[_0xb82c('0x33')]=_[_0xb82c('0x32')](_0x4d14b7[_0xb82c('0x33')]);_0xc810d9[_0xb82c('0x34')]=_[_0xb82c('0x35')](_0xc810d9['model'],_0xc810d9[_0xb82c('0x33')]);_0x5c3be1[_0xb82c('0x38')]=_[_0xb82c('0x35')](_0xc810d9[_0xb82c('0x36')],qs[_0xb82c('0x37')](_0x4d14b7[_0xb82c('0x33')][_0xb82c('0x37')]));_0x5c3be1[_0xb82c('0x38')]=_0x5c3be1['attributes'][_0xb82c('0x39')]?_0x5c3be1[_0xb82c('0x38')]:_0xc810d9[_0xb82c('0x36')];if(_0x4d14b7[_0xb82c('0x33')][_0xb82c('0x43')]){_0x5c3be1[_0xb82c('0x44')]=[{'all':!![]}];}_0x5c3be1=_[_0xb82c('0x40')]({},_0x5c3be1,_0x4d14b7[_0xb82c('0x42')]);return db[_0xb82c('0x30')]['find'](_0x5c3be1)[_0xb82c('0x27')](handleEntityNotFound(_0x310162,null))['then'](respondWithResult(_0x310162,null))[_0xb82c('0x47')](handleError(_0x310162,null));};exports[_0xb82c('0x4b')]=function(_0x26bb54,_0x35fb4e){return db[_0xb82c('0x30')][_0xb82c('0x4b')](_0x26bb54[_0xb82c('0x4c')],{})['then'](function(_0x2bc92f){var _0x55c9b6=_0x26bb54[_0xb82c('0x4d')][_0xb82c('0x29')]({'plain':!![]});if(!_0x55c9b6)throw new Error(_0xb82c('0x4e'));if(_0x55c9b6[_0xb82c('0x4f')]===_0xb82c('0x4d')){var _0x5492d3=_0x2bc92f[_0xb82c('0x29')]({'plain':!![]});var _0x456d5a=_0xb82c('0x2a');return db[_0xb82c('0x50')]['find']({'where':{'name':_0x456d5a,'userProfileId':_0x55c9b6['userProfileId']},'raw':!![]})[_0xb82c('0x27')](function(_0x984d29){if(_0x984d29&&_0x984d29[_0xb82c('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x5492d3[_0xb82c('0x2d')],'resourceId':_0x5492d3['id'],'type':_0x984d29[_0xb82c('0x2d')],'sectionId':_0x984d29['id']},{})[_0xb82c('0x27')](function(){return _0x2bc92f;});}else{return _0x2bc92f;}})[_0xb82c('0x47')](function(_0xaea839){logger[_0xb82c('0x2b')](_0xb82c('0x52'),_0xaea839);throw _0xaea839;});}return _0x2bc92f;})[_0xb82c('0x27')](respondWithResult(_0x35fb4e,0xc9))[_0xb82c('0x47')](handleError(_0x35fb4e,null));};exports[_0xb82c('0x26')]=function(_0x15859b,_0xf53f48){if(_0x15859b[_0xb82c('0x4c')]['id']){delete _0x15859b[_0xb82c('0x4c')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x15859b['params']['id']}})[_0xb82c('0x27')](handleEntityNotFound(_0xf53f48,null))[_0xb82c('0x27')](saveUpdates(_0x15859b['body'],null))[_0xb82c('0x27')](respondWithResult(_0xf53f48,null))['catch'](handleError(_0xf53f48,null));};exports['destroy']=function(_0x571767,_0x316ecd){return db[_0xb82c('0x30')][_0xb82c('0x53')]({'where':{'id':_0x571767[_0xb82c('0x49')]['id']}})['then'](handleEntityNotFound(_0x316ecd,null))['then'](removeEntity(_0x316ecd,null))[_0xb82c('0x47')](handleError(_0x316ecd,null));};exports[_0xb82c('0x31')]=function(_0x9ec2b8,_0x16f579){return db[_0xb82c('0x30')][_0xb82c('0x31')]()[_0xb82c('0x27')](respondWithResult(_0x16f579,null))[_0xb82c('0x47')](handleError(_0x16f579,null));};exports[_0xb82c('0x54')]=function(_0xca9a7c,_0x5c0c39,_0x35b55d){return db[_0xb82c('0x55')][_0xb82c('0x53')]({'where':{'id':_0xca9a7c['params']['id']}})[_0xb82c('0x27')](handleEntityNotFound(_0x5c0c39,null))[_0xb82c('0x27')](function(_0x309465){if(_0x309465){return _0x309465[_0xb82c('0x54')](_0xca9a7c[_0xb82c('0x4c')][_0xb82c('0x56')],_[_0xb82c('0x57')](_0xca9a7c[_0xb82c('0x4c')],[_0xb82c('0x56'),'id'])||{});}})['then'](respondWithResult(_0x5c0c39,null))[_0xb82c('0x47')](handleError(_0x5c0c39,null));};exports[_0xb82c('0x58')]=function(_0x4f7f0c,_0x4ea230,_0x328773){var _0x331f2f={};var _0x5bb9e1={};var _0x5a9886;var _0x1477ac;return db[_0xb82c('0x30')][_0xb82c('0x59')]({'where':{'id':_0x4f7f0c[_0xb82c('0x49')]['id']}})[_0xb82c('0x27')](handleEntityNotFound(_0x4ea230,null))[_0xb82c('0x27')](function(_0x16d232){if(_0x16d232){_0x5a9886=_0x16d232;_0x5bb9e1[_0xb82c('0x36')]=_[_0xb82c('0x32')](db['CmContact'][_0xb82c('0x4a')]);_0x5bb9e1[_0xb82c('0x33')]=_[_0xb82c('0x32')](_0x4f7f0c['query']);_0x5bb9e1[_0xb82c('0x34')]=_[_0xb82c('0x35')](_0x5bb9e1[_0xb82c('0x36')],_0x5bb9e1[_0xb82c('0x33')]);_0x331f2f[_0xb82c('0x38')]=_[_0xb82c('0x35')](_0x5bb9e1[_0xb82c('0x36')],qs['fields'](_0x4f7f0c['query'][_0xb82c('0x37')]));_0x331f2f[_0xb82c('0x38')]=_0x331f2f[_0xb82c('0x38')]['length']?_0x331f2f[_0xb82c('0x38')]:_0x5bb9e1['model'];_0x331f2f['order']=qs[_0xb82c('0x3c')](_0x4f7f0c[_0xb82c('0x33')][_0xb82c('0x3c')]);_0x331f2f[_0xb82c('0x3f')]=qs['filters'](_[_0xb82c('0x3d')](_0x4f7f0c['query'],_0x5bb9e1[_0xb82c('0x34')]));if(_0x4f7f0c[_0xb82c('0x33')][_0xb82c('0x3e')]){_0x331f2f['where']=_[_0xb82c('0x40')](_0x331f2f[_0xb82c('0x3f')],{'$or':_[_0xb82c('0x41')](_0x331f2f['attributes'],function(_0x583aaa){var _0x8ea71d={};_0x8ea71d[_0x583aaa]={'$like':'%'+_0x4f7f0c[_0xb82c('0x33')][_0xb82c('0x3e')]+'%'};return _0x8ea71d;})});}_0x331f2f=_[_0xb82c('0x40')]({},_0x331f2f,_0x4f7f0c[_0xb82c('0x42')]);return _0x5a9886[_0xb82c('0x58')](_0x331f2f);}})[_0xb82c('0x27')](function(_0x1de299){if(_0x1de299){_0x1477ac=_0x1de299[_0xb82c('0x39')];if(!_0x4f7f0c[_0xb82c('0x33')][_0xb82c('0x3a')](_0xb82c('0x5a'))){_0x331f2f[_0xb82c('0x1f')]=qs['limit'](_0x4f7f0c[_0xb82c('0x33')][_0xb82c('0x1f')]);_0x331f2f[_0xb82c('0x1e')]=qs[_0xb82c('0x1e')](_0x4f7f0c[_0xb82c('0x33')][_0xb82c('0x1e')]);}return _0x5a9886[_0xb82c('0x58')](_0x331f2f);}})[_0xb82c('0x27')](function(_0x26fa17){if(_0x26fa17){return _0x26fa17?{'count':_0x1477ac,'rows':_0x26fa17}:null;}})['then'](respondWithResult(_0x4ea230,null))[_0xb82c('0x47')](handleError(_0x4ea230,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index ede9555..f562cea 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 _0x7b6a=['cm_companies','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany'];(function(_0x3e4a76,_0x27f26d){var _0x3ccebe=function(_0x435044){while(--_0x435044){_0x3e4a76['push'](_0x3e4a76['shift']());}};_0x3ccebe(++_0x27f26d);}(_0x7b6a,0x14b));var _0xa7b6=function(_0xe2c51a,_0x292d36){_0xe2c51a=_0xe2c51a-0x0;var _0x101e57=_0x7b6a[_0xe2c51a];return _0x101e57;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa7b6('0x0'))(_0xa7b6('0x1'));var moment=require('moment');var BPromise=require(_0xa7b6('0x2'));var rp=require(_0xa7b6('0x3'));var fs=require('fs');var path=require(_0xa7b6('0x4'));var rimraf=require(_0xa7b6('0x5'));var config=require(_0xa7b6('0x6'));var attributes=require(_0xa7b6('0x7'));module[_0xa7b6('0x8')]=function(_0xd659b0,_0x2d668e){return _0xd659b0['define'](_0xa7b6('0x9'),attributes,{'tableName':_0xa7b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x514e=['moment','bluebird','path','../../config/environment','./cmCompany.attributes','exports','CmCompany','lodash','../../config/logger','api'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x514e,0x197));var _0xe514=function(_0x59fcd3,_0x232666){_0x59fcd3=_0x59fcd3-0x0;var _0x1d0db7=_0x514e[_0x59fcd3];return _0x1d0db7;};'use strict';var _=require(_0xe514('0x0'));var util=require('util');var logger=require(_0xe514('0x1'))(_0xe514('0x2'));var moment=require(_0xe514('0x3'));var BPromise=require(_0xe514('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe514('0x5'));var rimraf=require('rimraf');var config=require(_0xe514('0x6'));var attributes=require(_0xe514('0x7'));module[_0xe514('0x8')]=function(_0x4fe7cf,_0x1da638){return _0x4fe7cf['define'](_0xe514('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 1242317..0490afd 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 _0xb0fa=['message','CmCompany,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x103f46,_0x1cbbbb){var _0x58d92e=function(_0x3e2d14){while(--_0x3e2d14){_0x103f46['push'](_0x103f46['shift']());}};_0x58d92e(++_0x1cbbbb);}(_0xb0fa,0x14e));var _0xab0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb0fa[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xab0f('0x0'));var util=require(_0xab0f('0x1'));var moment=require('moment');var BPromise=require(_0xab0f('0x2'));var rs=require(_0xab0f('0x3'));var fs=require('fs');var Redis=require(_0xab0f('0x4'));var db=require(_0xab0f('0x5'))['db'];var utils=require(_0xab0f('0x6'));var logger=require(_0xab0f('0x7'))(_0xab0f('0x8'));var config=require(_0xab0f('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xab0f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bf769,_0x367849,_0x41cd9e){return new BPromise(function(_0x3a45bf,_0x1f95ed){return client[_0xab0f('0xb')](_0x5bf769,_0x41cd9e)['then'](function(_0x2f36df){logger[_0xab0f('0xc')]('CmCompany,\x20%s,\x20%s',_0x367849,_0xab0f('0xd'));logger[_0xab0f('0xe')](_0xab0f('0xf'),_0x367849,_0xab0f('0xd'),JSON[_0xab0f('0x10')](_0x2f36df));if(_0x2f36df[_0xab0f('0x11')]){if(_0x2f36df['error']['code']===0x1f4){logger[_0xab0f('0x11')]('CmCompany,\x20%s,\x20%s',_0x367849,_0x2f36df[_0xab0f('0x11')][_0xab0f('0x12')]);return _0x1f95ed(_0x2f36df['error'][_0xab0f('0x12')]);}logger['error'](_0xab0f('0x13'),_0x367849,_0x2f36df[_0xab0f('0x11')][_0xab0f('0x12')]);return _0x3a45bf(_0x2f36df[_0xab0f('0x11')][_0xab0f('0x12')]);}else{logger[_0xab0f('0xc')](_0xab0f('0x13'),_0x367849,_0xab0f('0xd'));_0x3a45bf(_0x2f36df[_0xab0f('0x14')][_0xab0f('0x12')]);}})[_0xab0f('0x15')](function(_0x276587){logger['error']('CmCompany,\x20%s,\x20%s',_0x367849,_0x276587);_0x1f95ed(_0x276587);});});} \ No newline at end of file +var _0xb172=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util'];(function(_0x3e0ba8,_0x562bf7){var _0xcecac3=function(_0x3ad54a){while(--_0x3ad54a){_0x3e0ba8['push'](_0x3e0ba8['shift']());}};_0xcecac3(++_0x562bf7);}(_0xb172,0x70));var _0x2b17=function(_0x3652a6,_0x1c76ad){_0x3652a6=_0x3652a6-0x0;var _0x28da2e=_0xb172[_0x3652a6];return _0x28da2e;};'use strict';var _=require(_0x2b17('0x0'));var util=require(_0x2b17('0x1'));var moment=require('moment');var BPromise=require(_0x2b17('0x2'));var rs=require(_0x2b17('0x3'));var fs=require('fs');var Redis=require(_0x2b17('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b17('0x5'));var logger=require('../../config/logger')(_0x2b17('0x6'));var config=require(_0x2b17('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2b17('0x8')][_0x2b17('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5719eb,_0x4b25ae,_0x14b904){return new BPromise(function(_0x91d10b,_0x45ff35){return client['request'](_0x5719eb,_0x14b904)[_0x2b17('0xa')](function(_0x479460){logger[_0x2b17('0xb')](_0x2b17('0xc'),_0x4b25ae,_0x2b17('0xd'));logger['debug'](_0x2b17('0xe'),_0x4b25ae,_0x2b17('0xd'),JSON['stringify'](_0x479460));if(_0x479460['error']){if(_0x479460[_0x2b17('0xf')][_0x2b17('0x10')]===0x1f4){logger[_0x2b17('0xf')](_0x2b17('0xc'),_0x4b25ae,_0x479460[_0x2b17('0xf')][_0x2b17('0x11')]);return _0x45ff35(_0x479460['error'][_0x2b17('0x11')]);}logger[_0x2b17('0xf')]('CmCompany,\x20%s,\x20%s',_0x4b25ae,_0x479460['error'][_0x2b17('0x11')]);return _0x91d10b(_0x479460[_0x2b17('0xf')][_0x2b17('0x11')]);}else{logger[_0x2b17('0xb')]('CmCompany,\x20%s,\x20%s',_0x4b25ae,_0x2b17('0xd'));_0x91d10b(_0x479460[_0x2b17('0x12')][_0x2b17('0x11')]);}})['catch'](function(_0x4fd7c1){logger[_0x2b17('0xf')](_0x2b17('0xc'),_0x4b25ae,_0x4fd7c1);_0x45ff35(_0x4fd7c1);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index ef0c370..8a5130a 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 _0x914a=['post','addContacts','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','getContacts','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x914a,0x6b));var _0xa914=function(_0x5ecb26,_0xdd72bd){_0x5ecb26=_0x5ecb26-0x0;var _0x5c374a=_0x914a[_0x5ecb26];return _0x5c374a;};'use strict';var multer=require(_0xa914('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa914('0x1'));var express=require(_0xa914('0x2'));var router=express[_0xa914('0x3')]();var fs_extra=require(_0xa914('0x4'));var auth=require(_0xa914('0x5'));var interaction=require(_0xa914('0x6'));var config=require(_0xa914('0x7'));var controller=require(_0xa914('0x8'));router[_0xa914('0x9')]('/',auth[_0xa914('0xa')](),controller['index']);router[_0xa914('0x9')](_0xa914('0xb'),auth[_0xa914('0xa')](),controller[_0xa914('0xc')]);router[_0xa914('0x9')](_0xa914('0xd'),auth[_0xa914('0xa')](),controller[_0xa914('0xe')]);router[_0xa914('0x9')](_0xa914('0xf'),auth[_0xa914('0xa')](),controller[_0xa914('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa914('0x11')]);router[_0xa914('0x12')](_0xa914('0xf'),auth[_0xa914('0xa')](),controller[_0xa914('0x13')]);router[_0xa914('0x14')](_0xa914('0xd'),auth[_0xa914('0xa')](),controller[_0xa914('0x15')]);router[_0xa914('0x16')]('/:id',auth[_0xa914('0xa')](),controller[_0xa914('0x17')]);module[_0xa914('0x18')]=router; \ No newline at end of file +var _0x30a0=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','/:id/contacts','post','create','addContacts','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x6ddbbc,_0x5061a9){var _0xcb1ef0=function(_0x23f7ad){while(--_0x23f7ad){_0x6ddbbc['push'](_0x6ddbbc['shift']());}};_0xcb1ef0(++_0x5061a9);}(_0x30a0,0x19b));var _0x030a=function(_0xb55873,_0x5b0e91){_0xb55873=_0xb55873-0x0;var _0xc7408d=_0x30a0[_0xb55873];return _0xc7408d;};'use strict';var multer=require(_0x030a('0x0'));var util=require(_0x030a('0x1'));var path=require('path');var timeout=require(_0x030a('0x2'));var express=require(_0x030a('0x3'));var router=express[_0x030a('0x4')]();var fs_extra=require(_0x030a('0x5'));var auth=require(_0x030a('0x6'));var interaction=require(_0x030a('0x7'));var config=require('../../config/environment');var controller=require(_0x030a('0x8'));router[_0x030a('0x9')]('/',auth[_0x030a('0xa')](),controller[_0x030a('0xb')]);router[_0x030a('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x030a('0xc')]);router[_0x030a('0x9')](_0x030a('0xd'),auth[_0x030a('0xa')](),controller['show']);router[_0x030a('0x9')](_0x030a('0xe'),auth[_0x030a('0xa')](),controller['getContacts']);router[_0x030a('0xf')]('/',auth['isAuthenticated'](),controller[_0x030a('0x10')]);router['post'](_0x030a('0xe'),auth[_0x030a('0xa')](),controller[_0x030a('0x11')]);router[_0x030a('0x12')](_0x030a('0xd'),auth[_0x030a('0xa')](),controller[_0x030a('0x13')]);router[_0x030a('0x14')](_0x030a('0xd'),auth[_0x030a('0xa')](),controller[_0x030a('0x15')]);module[_0x030a('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index b501987..9f554ed 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 _0x2c2b=['lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x5539ea,_0x4f0539){var _0x21fc7c=function(_0xcebc50){while(--_0xcebc50){_0x5539ea['push'](_0x5539ea['shift']());}};_0x21fc7c(++_0x4f0539);}(_0x2c2b,0x68));var _0xb2c2=function(_0x399fb4,_0x3b9673){_0x399fb4=_0x399fb4-0x0;var _0x599673=_0x2c2b[_0x399fb4];return _0x599673;};'use strict';var _=require(_0xb2c2('0x0'));var Sequelize=require(_0xb2c2('0x1'));module[_0xb2c2('0x2')]={'firstName':{'type':Sequelize[_0xb2c2('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xb2c2('0x3')]},'street':{'type':Sequelize[_0xb2c2('0x3')]},'postalCode':{'type':Sequelize[_0xb2c2('0x3')]},'city':{'type':Sequelize[_0xb2c2('0x3')]},'country':{'type':Sequelize[_0xb2c2('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb2c2('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xb2c2('0x3')]},'fax':{'type':Sequelize[_0xb2c2('0x3')]},'email':{'type':Sequelize[_0xb2c2('0x3')]},'url':{'type':Sequelize[_0xb2c2('0x3')]},'facebook':{'type':Sequelize[_0xb2c2('0x3')]},'fb_data':{'type':Sequelize[_0xb2c2('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xb2c2('0x3')]},'line':{'type':Sequelize[_0xb2c2('0x3')]},'wechat':{'type':Sequelize[_0xb2c2('0x3')]},'telegram':{'type':Sequelize[_0xb2c2('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xb2c2('0x3')]},'priority':{'type':Sequelize[_0xb2c2('0x5')](0x2)[_0xb2c2('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xb2c2('0x7')]},'dialTimezone':{'type':Sequelize[_0xb2c2('0x3')]},'utcOffset':{'type':Sequelize[_0xb2c2('0x5')]}}; \ No newline at end of file +var _0x5dca=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','exports'];(function(_0x391606,_0x1407f2){var _0xad5ff7=function(_0x187d18){while(--_0x187d18){_0x391606['push'](_0x391606['shift']());}};_0xad5ff7(++_0x1407f2);}(_0x5dca,0xfe));var _0xa5dc=function(_0x270dc6,_0xf1afd0){_0x270dc6=_0x270dc6-0x0;var _0x9fce80=_0x5dca[_0x270dc6];return _0x9fce80;};'use strict';var _=require(_0xa5dc('0x0'));var Sequelize=require('sequelize');module[_0xa5dc('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xa5dc('0x2')]},'street':{'type':Sequelize[_0xa5dc('0x2')]},'postalCode':{'type':Sequelize[_0xa5dc('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xa5dc('0x2')]},'dateOfBirth':{'type':Sequelize[_0xa5dc('0x2')]},'description':{'type':Sequelize[_0xa5dc('0x3')]},'phone':{'type':Sequelize[_0xa5dc('0x2')]},'mobile':{'type':Sequelize[_0xa5dc('0x2')]},'fax':{'type':Sequelize[_0xa5dc('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xa5dc('0x2')]},'facebook':{'type':Sequelize[_0xa5dc('0x2')]},'fb_data':{'type':Sequelize[_0xa5dc('0x2')]},'twitter':{'type':Sequelize[_0xa5dc('0x2')]},'skype':{'type':Sequelize[_0xa5dc('0x2')]},'teams':{'type':Sequelize[_0xa5dc('0x2')]},'viber':{'type':Sequelize[_0xa5dc('0x2')]},'line':{'type':Sequelize[_0xa5dc('0x2')]},'wechat':{'type':Sequelize[_0xa5dc('0x2')]},'telegram':{'type':Sequelize[_0xa5dc('0x2')]},'UserId':{'type':Sequelize[_0xa5dc('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xa5dc('0x4')](0x2)[_0xa5dc('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa5dc('0x6')],'defaultValue':Sequelize[_0xa5dc('0x7')]},'dialTimezone':{'type':Sequelize[_0xa5dc('0x2')]},'utcOffset':{'type':Sequelize[_0xa5dc('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 5f32afe..4eba933 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(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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(_0x4e4f0e,_0x1c3892){var _0x1a7219=function(_0x3821ad){while(--_0x3821ad){_0x4e4f0e['push'](_0x4e4f0e['shift']());}};_0x1a7219(++_0x1c3892);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 e60ef95..1d3f2d7 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 _0xb413=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','CmContact'];(function(_0x233a9f,_0x413c85){var _0x34776e=function(_0x4fc7f8){while(--_0x4fc7f8){_0x233a9f['push'](_0x233a9f['shift']());}};_0x34776e(++_0x413c85);}(_0xb413,0x142));var _0x3b41=function(_0x550788,_0x1b8cc5){_0x550788=_0x550788-0x0;var _0x129c97=_0xb413[_0x550788];return _0x129c97;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x3b41('0x0'))['db'][_0x3b41('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x3b41('0x2')](0x0);var events={'afterCreate':_0x3b41('0x3'),'afterUpdate':'update','afterDestroy':_0x3b41('0x4')};function emitEvent(_0x56987e){return function(_0x396e75,_0x2cfd28,_0x29f50c){CmContactEvents['emit'](_0x56987e+':'+_0x396e75['id'],_0x396e75);CmContactEvents[_0x3b41('0x5')](_0x56987e,_0x396e75);_0x29f50c(null);};}for(var e in events){if(events[_0x3b41('0x6')](e)){var event=events[e];CmContact[_0x3b41('0x7')](e,emitEvent(event));}}module[_0x3b41('0x8')]=CmContactEvents; \ No newline at end of file +var _0x768e=['hasOwnProperty','exports','events','../../mysqldb','CmContact','setMaxListeners','save','update','remove'];(function(_0x6376b0,_0x52d8c1){var _0x47ac71=function(_0x4cf390){while(--_0x4cf390){_0x6376b0['push'](_0x6376b0['shift']());}};_0x47ac71(++_0x52d8c1);}(_0x768e,0x9b));var _0xe768=function(_0x4eaaa5,_0x1053ac){_0x4eaaa5=_0x4eaaa5-0x0;var _0x690660=_0x768e[_0x4eaaa5];return _0x690660;};'use strict';var EventEmitter=require(_0xe768('0x0'));var CmContact=require(_0xe768('0x1'))['db'][_0xe768('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xe768('0x3')](0x0);var events={'afterCreate':_0xe768('0x4'),'afterUpdate':_0xe768('0x5'),'afterDestroy':_0xe768('0x6')};function emitEvent(_0x664e26){return function(_0x235fcd,_0x16b7fe,_0x112c75){CmContactEvents['emit'](_0x664e26+':'+_0x235fcd['id'],_0x235fcd);CmContactEvents['emit'](_0x664e26,_0x235fcd);_0x112c75(null);};}for(var e in events){if(events[_0xe768('0x7')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0xe768('0x8')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 4aa4f68..9da47f0 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 _0xa20b=['push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cmContact.attributes','exports','cm_contacts','phone','firstName','lastName','mobile','fax','FULLTEXT','utf8mb4','models','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','findOne','timezones','utcOffset','add','minutes','then','ret','CmHopper','cmContact,\x20afterCreate\x20','create','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','ListId','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','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','cmContact,\x20%s,\x20%s','message','BlackLists','CmHopperBlack','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId'];(function(_0x29d5ce,_0x1503e9){var _0x266f7b=function(_0x40e12e){while(--_0x40e12e){_0x29d5ce['push'](_0x29d5ce['shift']());}};_0x266f7b(++_0x1503e9);}(_0xa20b,0x95));var _0xba20=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa20b[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xba20('0x0'))(_0xba20('0x1'));var moment=require('moment');var BPromise=require(_0xba20('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba20('0x3'));var rimraf=require(_0xba20('0x4'));var config=require(_0xba20('0x5'));var shared=require('../../config/environment/shared');var attributes=require(_0xba20('0x6'));module[_0xba20('0x7')]=function(_0x4488f7,_0x3d4450){return _0x4488f7['define']('CmContact',attributes,{'tableName':_0xba20('0x8'),'paranoid':!![],'indexes':[{'name':_0xba20('0x9'),'fields':[_0xba20('0x9')]},{'name':'fti_cm_contacts','fields':[_0xba20('0xa'),_0xba20('0xb'),_0xba20('0x9'),_0xba20('0xc'),_0xba20('0xd'),'email'],'type':_0xba20('0xe')}],'timestamps':!![],'charset':_0xba20('0xf'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x440de6,_0x3573fc,_0x3bd71b){var _0x1e8f15=_0x4488f7[_0xba20('0x10')];var _0x17609f=_0x440de6[_0xba20('0x11')]({'plain':!![]});function _0x2649a2(){return function(_0x336a89){logger[_0xba20('0x12')](_0xba20('0x13'),_0xba20('0x14'),util[_0xba20('0x15')](_0x336a89,{'showHidden':![],'depth':null}));};}function _0x486496(_0x1f3527,_0x330607){var _0x4c0cee=_0x330607[_0xba20('0x16')]?_0x330607[_0xba20('0x16')]:moment()[_0xba20('0x17')](_0xba20('0x18'));return new BPromise(function(_0x5b7630,_0x5acb91){if(_[_0xba20('0x19')](_0x330607[_0xba20('0x1a')])){_0x5b7630({'ret':_0x4c0cee});}else{_0x1e8f15['VoiceQueue'][_0xba20('0x1b')]({'where':{'id':_0x1f3527['id']}})['then'](function(_0x29af1c){if(!_['isNil'](_0x29af1c)){var _0x431c54=_0x29af1c['dialTimezone'];if(!_['isNil'](_0x431c54)){var _0x3ec8c9=shared[_0xba20('0x1c')];var _0x1e3cc3=_0x3ec8c9[_0x431c54];var _0x178bd1=_0x3ec8c9[_0x330607[_0xba20('0x1a')]];if(!_[_0xba20('0x19')](_0x1e3cc3)&&!_[_0xba20('0x19')](_0x178bd1)){var _0x560433=_0x1e3cc3[_0xba20('0x1d')]-_0x178bd1[_0xba20('0x1d')];_0x4c0cee=_0x330607[_0xba20('0x16')]?_0x330607[_0xba20('0x16')]:moment();var _0x4a9889=moment(_0x4c0cee)[_0xba20('0x1e')](_0x560433,_0xba20('0x1f'));_0x5b7630({'ret':_0x4a9889[_0xba20('0x17')](_0xba20('0x18'))});}else _0x5b7630({'ret':_0x4c0cee});}else _0x5b7630({'ret':_0x4c0cee});}else{_0x5b7630({'ret':_0x4c0cee});}});}});return 0xa;}var _0x5d74b0=function(_0xdfaa66){return new BPromise(function(_0x319476,_0x54aa70){_0x486496(_0xdfaa66,_0x17609f)[_0xba20('0x20')](function(_0x34a081){_0x17609f[_0xba20('0x16')]=_0x34a081[_0xba20('0x21')];_0x1e8f15[_0xba20('0x22')][_0xba20('0x1b')]({'where':{'phone':_0x17609f['phone'],'VoiceQueueId':_0xdfaa66['id']}})['then'](function(_0x2ea99d){if(!_[_0xba20('0x19')](_0x2ea99d)){throw new Error(_0xba20('0x23')+_0x17609f['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0xdfaa66['id']);}return _0x1e8f15[_0xba20('0x22')][_0xba20('0x24')]({'phone':_0x17609f[_0xba20('0x9')],'ContactId':_0x17609f['id'],'ListId':_0x17609f['ListId'],'priority':_0x17609f[_0xba20('0x25')]?_0x17609f[_0xba20('0x25')]:0x2,'scheduledat':_0x17609f[_0xba20('0x16')]?_0x17609f[_0xba20('0x16')]:moment()[_0xba20('0x17')](_0xba20('0x18')),'callback':_0x17609f[_0xba20('0x26')]?!![]:![],'callbackuniqueid':_0x17609f['callbackUniqueid']?_0x17609f[_0xba20('0x26')]:undefined,'callbackat':_0x17609f[_0xba20('0x26')]?moment()['format'](_0xba20('0x18')):undefined,'VoiceQueueId':_0xdfaa66['id']});})[_0xba20('0x27')](function(_0x1497c1){_0x54aa70(_0x1497c1);});});});};var _0x911ba4=function(_0x13fa3a){return new BPromise(function(_0x44e77f,_0x185e6b){_0x486496(_0x13fa3a,_0x17609f)[_0xba20('0x20')](function(_0x295472){_0x17609f[_0xba20('0x16')]=_0x295472[_0xba20('0x21')];_0x1e8f15[_0xba20('0x22')]['findOne']({'where':{'phone':_0x17609f[_0xba20('0x9')],'VoiceQueueId':_0x13fa3a['id']}})[_0xba20('0x20')](function(_0x393926){if(!_[_0xba20('0x19')](_0x393926)){throw new Error(_0xba20('0x23')+_0x17609f[_0xba20('0x9')]+_0xba20('0x28')+_0x13fa3a['id']);}return _0x1e8f15['CmHopperFinal'][_0xba20('0x1b')]({'where':{'calleridnum':_0x17609f[_0xba20('0x9')],'VoiceQueueId':_0x13fa3a['id']}});})['then'](function(_0x3cdfef){if(!_[_0xba20('0x19')](_0x3cdfef)){throw new Error(_0xba20('0x29')+_0x17609f[_0xba20('0x9')]+_0xba20('0x2a')+_0x13fa3a['id']);}return _0x1e8f15[_0xba20('0x22')][_0xba20('0x24')]({'phone':_0x17609f['phone'],'ContactId':_0x17609f['id'],'ListId':_0x17609f[_0xba20('0x2b')],'priority':_0x17609f['priority']?_0x17609f['priority']:0x2,'scheduledat':_0x17609f[_0xba20('0x16')]?_0x17609f[_0xba20('0x16')]:moment()['format'](_0xba20('0x18')),'callback':_0x17609f[_0xba20('0x26')]?!![]:![],'callbackuniqueid':_0x17609f[_0xba20('0x26')]?_0x17609f['callbackUniqueid']:undefined,'callbackat':_0x17609f[_0xba20('0x26')]?moment()[_0xba20('0x17')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x13fa3a['id']});})[_0xba20('0x27')](function(_0x15793e){_0x185e6b(_0x15793e);});});});};function _0x3a8625(){return function(_0x3c4ab0){logger[_0xba20('0x12')](_0xba20('0x13'),'afterCreate',util[_0xba20('0x15')](_0x3c4ab0,{'showHidden':![],'depth':null}));};}function _0x5ccf2c(_0x48c20b,_0x31a343){var _0x418ae4=_0x31a343[_0xba20('0x16')]?_0x31a343[_0xba20('0x16')]:moment()['format'](_0xba20('0x18'));return new BPromise(function(_0x48b3a0,_0x390f62){if(_['isNil'](_0x31a343['dialTimezone'])){_0x48b3a0({'ret':_0x418ae4});}else{_0x1e8f15[_0xba20('0x2c')][_0xba20('0x1b')]({'where':{'id':_0x48c20b['id']}})['then'](function(_0xe41624){if(!_['isNil'](_0xe41624)){var _0x10015d=_0xe41624[_0xba20('0x1a')];if(!_[_0xba20('0x19')](_0x10015d)){var _0x5971dc=shared[_0xba20('0x1c')];var _0xcfd68b=_0x5971dc[_0x10015d];var _0x16d92b=_0x5971dc[_0x31a343['dialTimezone']];if(!_[_0xba20('0x19')](_0xcfd68b)&&!_[_0xba20('0x19')](_0x16d92b)){var _0x2317bf=_0xcfd68b['utcOffset']-_0x16d92b[_0xba20('0x1d')];_0x418ae4=_0x31a343['scheduledat']?_0x31a343[_0xba20('0x16')]:moment();var _0x199a84=moment(_0x418ae4)[_0xba20('0x1e')](_0x2317bf,_0xba20('0x1f'));_0x48b3a0({'ret':_0x199a84[_0xba20('0x17')](_0xba20('0x18'))});}else _0x48b3a0({'ret':_0x418ae4});}else _0x48b3a0({'ret':_0x418ae4});}else{_0x48b3a0({'ret':_0x418ae4});}});}});return 0xa;}var _0x56b546=function(_0x46ec1b){return new BPromise(function(_0x422f1a,_0x8da858){_0x5ccf2c(_0x46ec1b,_0x17609f)[_0xba20('0x20')](function(_0x376a5a){_0x17609f['scheduledat']=_0x376a5a[_0xba20('0x21')];_0x1e8f15[_0xba20('0x22')][_0xba20('0x1b')]({'where':{'phone':_0x17609f[_0xba20('0x9')],'CampaignId':_0x46ec1b['id']}})['then'](function(_0x4b89a0){if(!_[_0xba20('0x19')](_0x4b89a0)){throw new Error(_0xba20('0x23')+_0x17609f[_0xba20('0x9')]+_0xba20('0x2d')+_0x46ec1b['id']);}return _0x1e8f15[_0xba20('0x22')][_0xba20('0x24')]({'phone':_0x17609f[_0xba20('0x9')],'ContactId':_0x17609f['id'],'ListId':_0x17609f[_0xba20('0x2b')],'priority':_0x17609f[_0xba20('0x25')]?_0x17609f['priority']:0x2,'scheduledat':_0x17609f[_0xba20('0x16')]?_0x17609f[_0xba20('0x16')]:moment()[_0xba20('0x17')](_0xba20('0x18')),'callback':_0x17609f[_0xba20('0x26')]?!![]:![],'callbackuniqueid':_0x17609f[_0xba20('0x26')]?_0x17609f[_0xba20('0x26')]:undefined,'callbackat':_0x17609f[_0xba20('0x26')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x46ec1b['id']});})['catch'](function(_0xbebffc){_0x8da858(_0xbebffc);});});});};var _0x1ed8e4=function(_0x2a998d){return new BPromise(function(_0x5770ff,_0x31dc1f){_0x5ccf2c(_0x2a998d,_0x17609f)[_0xba20('0x20')](function(_0x2828bb){_0x17609f[_0xba20('0x16')]=_0x2828bb[_0xba20('0x21')];_0x1e8f15[_0xba20('0x22')][_0xba20('0x1b')]({'where':{'phone':_0x17609f['phone'],'CampaignId':_0x2a998d['id']}})[_0xba20('0x20')](function(_0x132884){if(!_[_0xba20('0x19')](_0x132884)){throw new Error(_0xba20('0x23')+_0x17609f[_0xba20('0x9')]+_0xba20('0x2e')+_0x2a998d['id']);}return _0x1e8f15[_0xba20('0x2f')][_0xba20('0x1b')]({'where':{'calleridnum':_0x17609f[_0xba20('0x9')],'CampaignId':_0x2a998d['id']}});})[_0xba20('0x20')](function(_0x2bdce3){if(!_[_0xba20('0x19')](_0x2bdce3)){throw new Error(_0xba20('0x29')+_0x17609f[_0xba20('0x9')]+_0xba20('0x30')+_0x2a998d['id']);}return _0x1e8f15[_0xba20('0x22')][_0xba20('0x24')]({'phone':_0x17609f[_0xba20('0x9')],'ContactId':_0x17609f['id'],'ListId':_0x17609f[_0xba20('0x2b')],'priority':_0x17609f[_0xba20('0x25')]?_0x17609f[_0xba20('0x25')]:0x2,'scheduledat':_0x17609f['scheduledat']?_0x17609f[_0xba20('0x16')]:moment()[_0xba20('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x17609f[_0xba20('0x26')]?!![]:![],'callbackuniqueid':_0x17609f[_0xba20('0x26')]?_0x17609f['callbackUniqueid']:undefined,'callbackat':_0x17609f[_0xba20('0x26')]?moment()[_0xba20('0x17')](_0xba20('0x18')):undefined,'CampaignId':_0x2a998d['id']});})[_0xba20('0x27')](function(_0x65c5){_0x31dc1f(_0x65c5);});});});};if(_0x17609f[_0xba20('0x2b')]){_0x1e8f15[_0xba20('0x31')][_0xba20('0x32')]({'where':{'type':'outbound'},'attributes':['id',_0xba20('0x33'),_0xba20('0x1a')],'include':[{'model':_0x1e8f15[_0xba20('0x34')],'as':_0xba20('0x35'),'where':{'id':_0x17609f['ListId']}}]})['then'](function(_0x176f99){if(_0x176f99){var _0x4800c6=[];for(var _0x4279f2=0x0,_0x40cfbc;_0x4279f2<_0x176f99[_0xba20('0x36')];_0x4279f2+=0x1){_0x40cfbc=_0x176f99[_0x4279f2][_0xba20('0x11')]({'plain':!![]});switch(_0x40cfbc[_0xba20('0x33')]){case _0xba20('0x37'):_0x911ba4(_0x40cfbc)[_0xba20('0x27')](_0x2649a2());break;case _0xba20('0x38'):_0x5d74b0(_0x40cfbc)[_0xba20('0x27')](_0x2649a2());break;default:_0x5ccf2c(_0x40cfbc,_0x17609f)[_0xba20('0x20')](function(_0x2dfeb8){_0x17609f[_0xba20('0x16')]=_0x2dfeb8['ret'];_0x1e8f15[_0xba20('0x22')][_0xba20('0x24')]({'phone':_0x17609f[_0xba20('0x9')],'ContactId':_0x17609f['id'],'ListId':_0x17609f[_0xba20('0x2b')],'scheduledat':_0x17609f[_0xba20('0x16')]?_0x17609f['scheduledat']:moment()[_0xba20('0x17')](_0xba20('0x18')),'priority':_0x17609f[_0xba20('0x25')]?_0x17609f['priority']:0x2,'callback':_0x17609f[_0xba20('0x26')]?!![]:![],'callbackuniqueid':_0x17609f['callbackUniqueid']?_0x17609f[_0xba20('0x26')]:undefined,'callbackat':_0x17609f['callbackUniqueid']?moment()[_0xba20('0x17')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x40cfbc['id']})[_0xba20('0x27')](_0x2649a2());});}}}})['then'](function(){return _0x1e8f15[_0xba20('0x31')][_0xba20('0x32')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x1e8f15[_0xba20('0x34')],'as':'BlackLists','where':{'id':_0x17609f[_0xba20('0x2b')]}}]})[_0xba20('0x20')](function(_0x331902){if(_0x331902){var _0x5775f9=[];for(var _0x16fdc7=0x0,_0x4ef55b;_0x16fdc7<_0x331902[_0xba20('0x36')];_0x16fdc7+=0x1){_0x4ef55b=_0x331902[_0x16fdc7][_0xba20('0x11')]({'plain':!![]});_0x1e8f15['CmHopperBlack'][_0xba20('0x24')]({'phone':_0x17609f['phone'],'ContactId':_0x17609f['id'],'ListId':_0x17609f[_0xba20('0x2b')],'VoiceQueueId':_0x4ef55b['id']})[_0xba20('0x27')](function(_0x4922cc){logger[_0xba20('0x12')](_0xba20('0x39'),_0xba20('0x14'),_0x4922cc[_0xba20('0x3a')]);});}}});})['then'](function(){return _0x1e8f15[_0xba20('0x2c')]['findAll']({'attributes':['id','dialCheckDuplicateType','dialTimezone'],'include':[{'model':_0x1e8f15[_0xba20('0x34')],'as':_0xba20('0x35'),'where':{'id':_0x17609f[_0xba20('0x2b')]}}]})[_0xba20('0x20')](function(_0x55999f){if(_0x55999f){var _0x6bf579=[];for(var _0x37c5bf=0x0,_0x24d840;_0x37c5bf<_0x55999f[_0xba20('0x36')];_0x37c5bf+=0x1){_0x24d840=_0x55999f[_0x37c5bf][_0xba20('0x11')]({'plain':!![]});switch(_0x24d840[_0xba20('0x33')]){case'always':_0x1ed8e4(_0x24d840)['catch'](_0x3a8625());break;case _0xba20('0x38'):_0x56b546(_0x24d840)[_0xba20('0x27')](_0x3a8625());break;default:_0x1e8f15[_0xba20('0x22')][_0xba20('0x24')]({'phone':_0x17609f[_0xba20('0x9')],'ContactId':_0x17609f['id'],'ListId':_0x17609f[_0xba20('0x2b')],'scheduledat':_0x17609f['scheduledat']?_0x17609f[_0xba20('0x16')]:moment()[_0xba20('0x17')](_0xba20('0x18')),'priority':_0x17609f[_0xba20('0x25')]?_0x17609f[_0xba20('0x25')]:0x2,'callback':_0x17609f['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x17609f['callbackUniqueid']?_0x17609f['callbackUniqueid']:undefined,'callbackat':_0x17609f[_0xba20('0x26')]?moment()[_0xba20('0x17')](_0xba20('0x18')):undefined,'CampaignId':_0x24d840['id']})[_0xba20('0x27')](_0x3a8625());}}}});})[_0xba20('0x20')](function(){return _0x1e8f15[_0xba20('0x2c')][_0xba20('0x32')]({'attributes':['id'],'include':[{'model':_0x1e8f15[_0xba20('0x34')],'as':_0xba20('0x3b'),'where':{'id':_0x17609f[_0xba20('0x2b')]}}]})[_0xba20('0x20')](function(_0x4d34cf){if(_0x4d34cf){var _0xd1df3a=[];for(var _0x15ffca=0x0,_0x503dc4;_0x15ffca<_0x4d34cf[_0xba20('0x36')];_0x15ffca+=0x1){_0x503dc4=_0x4d34cf[_0x15ffca]['get']({'plain':!![]});_0x1e8f15[_0xba20('0x3c')][_0xba20('0x24')]({'phone':_0x17609f[_0xba20('0x9')],'ContactId':_0x17609f['id'],'ListId':_0x17609f[_0xba20('0x2b')],'CampaignId':_0x503dc4['id']})['catch'](function(_0x113b34){logger[_0xba20('0x12')](_0xba20('0x39'),_0xba20('0x14'),_0x113b34['message']);});}}});})[_0xba20('0x20')](function(){_0x3bd71b();})['catch'](function(_0x4a80cd){logger[_0xba20('0x12')](_0xba20('0x39'),_0xba20('0x14'),_0x4a80cd[_0xba20('0x3a')]);_0x3bd71b(_0x4a80cd);});}else{_0x3bd71b(new Error(_0xba20('0x3d')));}},'afterDestroy':function(_0x5e4091,_0x536716,_0x5caff9){var _0x50a33c=_0x4488f7['models'];var _0x5ecd43=_0x5e4091[_0xba20('0x11')]({'plain':!![]});return _0x50a33c['CmHopper'][_0xba20('0x32')]({'raw':!![],'where':{'ListId':_0x5ecd43[_0xba20('0x2b')],'ContactId':_0x5ecd43['id']}})[_0xba20('0x20')](function(_0x2e9e87){if(!_[_0xba20('0x3e')](_0x2e9e87)){var _0x3b7da9=[];for(var _0x4767d2=0x0;_0x4767d2<_0x2e9e87['length'];_0x4767d2+=0x1){var _0x1bb59c=_0x50a33c[_0xba20('0x22')][_0xba20('0x3f')]({'where':{'ListId':_0x2e9e87[_0x4767d2][_0xba20('0x2b')],'ContactId':_0x2e9e87[_0x4767d2][_0xba20('0x40')],'VoiceQueueId':_0x2e9e87[_0x4767d2][_0xba20('0x41')],'CampaignId':_0x2e9e87[_0x4767d2][_0xba20('0x42')]}});_0x3b7da9[_0xba20('0x43')](_0x1bb59c);}return BPromise[_0xba20('0x44')](_0x3b7da9);}})[_0xba20('0x20')](function(_0x276f6a){logger[_0xba20('0x45')](_0xba20('0x46'),util['inspect'](_0x276f6a,{'showHidden':![],'depth':null}));_0x5caff9();})[_0xba20('0x27')](function(_0x22393b){logger['error'](_0xba20('0x47'),util[_0xba20('0x15')](_0x22393b,{'showHidden':![],'depth':null}));_0x5caff9(_0x22393b);});}}});}; \ No newline at end of file +var _0xc992=['timezones','utcOffset','add','minutes','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','priority','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','ret','\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','catch','inspect','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','dialCheckDuplicateType','Lists','length','always','outbound','CmList','BlackLists','cmContact,\x20%s,\x20%s','findAll','CmHopperBlack','message','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','info','[CmContact][afterDestroy][Succesfull]','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','firstName','lastName','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','scheduledat','format','isNil','VoiceQueue','findOne','then','dialTimezone'];(function(_0x4c38af,_0x55a605){var _0xf94a80=function(_0x390c08){while(--_0x390c08){_0x4c38af['push'](_0x4c38af['shift']());}};_0xf94a80(++_0x55a605);}(_0xc992,0x10e));var _0x2c99=function(_0x33bf01,_0x49af88){_0x33bf01=_0x33bf01-0x0;var _0x53ab57=_0xc992[_0x33bf01];return _0x53ab57;};'use strict';var _=require(_0x2c99('0x0'));var util=require(_0x2c99('0x1'));var logger=require(_0x2c99('0x2'))(_0x2c99('0x3'));var moment=require(_0x2c99('0x4'));var BPromise=require('bluebird');var rp=require(_0x2c99('0x5'));var fs=require('fs');var path=require(_0x2c99('0x6'));var rimraf=require(_0x2c99('0x7'));var config=require('../../config/environment');var shared=require(_0x2c99('0x8'));var attributes=require(_0x2c99('0x9'));module[_0x2c99('0xa')]=function(_0x70cb07,_0x150b29){return _0x70cb07[_0x2c99('0xb')](_0x2c99('0xc'),attributes,{'tableName':_0x2c99('0xd'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0x2c99('0xe')]},{'name':'fti_cm_contacts','fields':[_0x2c99('0xf'),_0x2c99('0x10'),_0x2c99('0xe'),'mobile',_0x2c99('0x11'),_0x2c99('0x12')],'type':_0x2c99('0x13')}],'timestamps':!![],'charset':_0x2c99('0x14'),'collate':_0x2c99('0x15'),'hooks':{'afterCreate':function(_0x412866,_0x281fbf,_0x55bc09){var _0x110dd3=_0x70cb07[_0x2c99('0x16')];var _0x1c2ca3=_0x412866[_0x2c99('0x17')]({'plain':!![]});function _0x3caf62(){return function(_0x5cde6f){logger[_0x2c99('0x18')](_0x2c99('0x19'),_0x2c99('0x1a'),util['inspect'](_0x5cde6f,{'showHidden':![],'depth':null}));};}function _0x20ab86(_0x5465fc,_0xe762ca){var _0x5ce756=_0xe762ca[_0x2c99('0x1b')]?_0xe762ca['scheduledat']:moment()[_0x2c99('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x22f42a,_0xb579cc){if(_[_0x2c99('0x1d')](_0xe762ca['dialTimezone'])){_0x22f42a({'ret':_0x5ce756});}else{_0x110dd3[_0x2c99('0x1e')][_0x2c99('0x1f')]({'where':{'id':_0x5465fc['id']}})[_0x2c99('0x20')](function(_0x388b27){if(!_[_0x2c99('0x1d')](_0x388b27)){var _0x4f41c7=_0x388b27[_0x2c99('0x21')];if(!_[_0x2c99('0x1d')](_0x4f41c7)){var _0x36051=shared[_0x2c99('0x22')];var _0x134511=_0x36051[_0x4f41c7];var _0x564dfd=_0x36051[_0xe762ca['dialTimezone']];if(!_[_0x2c99('0x1d')](_0x134511)&&!_[_0x2c99('0x1d')](_0x564dfd)){var _0x25b41c=_0x134511['utcOffset']-_0x564dfd[_0x2c99('0x23')];_0x5ce756=_0xe762ca[_0x2c99('0x1b')]?_0xe762ca[_0x2c99('0x1b')]:moment();var _0xaf235d=moment(_0x5ce756)[_0x2c99('0x24')](_0x25b41c,_0x2c99('0x25'));_0x22f42a({'ret':_0xaf235d[_0x2c99('0x1c')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x22f42a({'ret':_0x5ce756});}else _0x22f42a({'ret':_0x5ce756});}else{_0x22f42a({'ret':_0x5ce756});}});}});return 0xa;}var _0x3d8e94=function(_0x4a4dfe){return new BPromise(function(_0x42988f,_0x220ce3){_0x20ab86(_0x4a4dfe,_0x1c2ca3)[_0x2c99('0x20')](function(_0x4c8c62){_0x1c2ca3[_0x2c99('0x1b')]=_0x4c8c62['ret'];_0x110dd3['CmHopper'][_0x2c99('0x1f')]({'where':{'phone':_0x1c2ca3[_0x2c99('0xe')],'VoiceQueueId':_0x4a4dfe['id']}})[_0x2c99('0x20')](function(_0x467445){if(!_[_0x2c99('0x1d')](_0x467445)){throw new Error(_0x2c99('0x26')+_0x1c2ca3[_0x2c99('0xe')]+_0x2c99('0x27')+_0x4a4dfe['id']);}return _0x110dd3[_0x2c99('0x28')][_0x2c99('0x29')]({'phone':_0x1c2ca3['phone'],'ContactId':_0x1c2ca3['id'],'ListId':_0x1c2ca3['ListId'],'priority':_0x1c2ca3[_0x2c99('0x2a')]?_0x1c2ca3[_0x2c99('0x2a')]:0x2,'scheduledat':_0x1c2ca3[_0x2c99('0x1b')]?_0x1c2ca3[_0x2c99('0x1b')]:moment()[_0x2c99('0x1c')](_0x2c99('0x2b')),'callback':_0x1c2ca3[_0x2c99('0x2c')]?!![]:![],'callbackuniqueid':_0x1c2ca3['callbackUniqueid']?_0x1c2ca3[_0x2c99('0x2c')]:undefined,'callbackat':_0x1c2ca3[_0x2c99('0x2c')]?moment()[_0x2c99('0x1c')](_0x2c99('0x2b')):undefined,'VoiceQueueId':_0x4a4dfe['id']});})['catch'](function(_0xf0dd7d){_0x220ce3(_0xf0dd7d);});});});};var _0xe652e=function(_0x152c49){return new BPromise(function(_0x537a9d,_0x5afaa6){_0x20ab86(_0x152c49,_0x1c2ca3)['then'](function(_0x1c4e32){_0x1c2ca3[_0x2c99('0x1b')]=_0x1c4e32[_0x2c99('0x2d')];_0x110dd3[_0x2c99('0x28')][_0x2c99('0x1f')]({'where':{'phone':_0x1c2ca3[_0x2c99('0xe')],'VoiceQueueId':_0x152c49['id']}})['then'](function(_0x3c7b43){if(!_['isNil'](_0x3c7b43)){throw new Error(_0x2c99('0x26')+_0x1c2ca3[_0x2c99('0xe')]+_0x2c99('0x2e')+_0x152c49['id']);}return _0x110dd3[_0x2c99('0x2f')][_0x2c99('0x1f')]({'where':{'calleridnum':_0x1c2ca3['phone'],'VoiceQueueId':_0x152c49['id']}});})[_0x2c99('0x20')](function(_0xdf2440){if(!_['isNil'](_0xdf2440)){throw new Error(_0x2c99('0x30')+_0x1c2ca3[_0x2c99('0xe')]+_0x2c99('0x31')+_0x152c49['id']);}return _0x110dd3[_0x2c99('0x28')]['create']({'phone':_0x1c2ca3[_0x2c99('0xe')],'ContactId':_0x1c2ca3['id'],'ListId':_0x1c2ca3[_0x2c99('0x32')],'priority':_0x1c2ca3[_0x2c99('0x2a')]?_0x1c2ca3['priority']:0x2,'scheduledat':_0x1c2ca3[_0x2c99('0x1b')]?_0x1c2ca3[_0x2c99('0x1b')]:moment()[_0x2c99('0x1c')](_0x2c99('0x2b')),'callback':_0x1c2ca3[_0x2c99('0x2c')]?!![]:![],'callbackuniqueid':_0x1c2ca3['callbackUniqueid']?_0x1c2ca3[_0x2c99('0x2c')]:undefined,'callbackat':_0x1c2ca3[_0x2c99('0x2c')]?moment()[_0x2c99('0x1c')](_0x2c99('0x2b')):undefined,'VoiceQueueId':_0x152c49['id']});})[_0x2c99('0x33')](function(_0x2da9cc){_0x5afaa6(_0x2da9cc);});});});};function _0x3bf4a1(){return function(_0x1feca2){logger[_0x2c99('0x18')](_0x2c99('0x19'),_0x2c99('0x1a'),util[_0x2c99('0x34')](_0x1feca2,{'showHidden':![],'depth':null}));};}function _0x2e927f(_0x54cf07,_0x56c202){var _0x1f486f=_0x56c202[_0x2c99('0x1b')]?_0x56c202[_0x2c99('0x1b')]:moment()['format'](_0x2c99('0x2b'));return new BPromise(function(_0x2bc578,_0x5a9d2a){if(_[_0x2c99('0x1d')](_0x56c202['dialTimezone'])){_0x2bc578({'ret':_0x1f486f});}else{_0x110dd3[_0x2c99('0x35')][_0x2c99('0x1f')]({'where':{'id':_0x54cf07['id']}})[_0x2c99('0x20')](function(_0x5b66cf){if(!_[_0x2c99('0x1d')](_0x5b66cf)){var _0x485e70=_0x5b66cf[_0x2c99('0x21')];if(!_['isNil'](_0x485e70)){var _0x260b66=shared[_0x2c99('0x22')];var _0x194032=_0x260b66[_0x485e70];var _0x51c370=_0x260b66[_0x56c202[_0x2c99('0x21')]];if(!_[_0x2c99('0x1d')](_0x194032)&&!_[_0x2c99('0x1d')](_0x51c370)){var _0x202b28=_0x194032['utcOffset']-_0x51c370[_0x2c99('0x23')];_0x1f486f=_0x56c202['scheduledat']?_0x56c202['scheduledat']:moment();var _0x3f9a14=moment(_0x1f486f)[_0x2c99('0x24')](_0x202b28,'minutes');_0x2bc578({'ret':_0x3f9a14[_0x2c99('0x1c')](_0x2c99('0x2b'))});}else _0x2bc578({'ret':_0x1f486f});}else _0x2bc578({'ret':_0x1f486f});}else{_0x2bc578({'ret':_0x1f486f});}});}});return 0xa;}var _0x408747=function(_0x7aa011){return new BPromise(function(_0x322d50,_0x538b6a){_0x2e927f(_0x7aa011,_0x1c2ca3)[_0x2c99('0x20')](function(_0x3ff7ac){_0x1c2ca3['scheduledat']=_0x3ff7ac[_0x2c99('0x2d')];_0x110dd3[_0x2c99('0x28')]['findOne']({'where':{'phone':_0x1c2ca3[_0x2c99('0xe')],'CampaignId':_0x7aa011['id']}})[_0x2c99('0x20')](function(_0x558b93){if(!_['isNil'](_0x558b93)){throw new Error(_0x2c99('0x26')+_0x1c2ca3[_0x2c99('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x7aa011['id']);}return _0x110dd3[_0x2c99('0x28')]['create']({'phone':_0x1c2ca3[_0x2c99('0xe')],'ContactId':_0x1c2ca3['id'],'ListId':_0x1c2ca3['ListId'],'priority':_0x1c2ca3[_0x2c99('0x2a')]?_0x1c2ca3[_0x2c99('0x2a')]:0x2,'scheduledat':_0x1c2ca3[_0x2c99('0x1b')]?_0x1c2ca3['scheduledat']:moment()['format'](_0x2c99('0x2b')),'callback':_0x1c2ca3[_0x2c99('0x2c')]?!![]:![],'callbackuniqueid':_0x1c2ca3['callbackUniqueid']?_0x1c2ca3[_0x2c99('0x2c')]:undefined,'callbackat':_0x1c2ca3[_0x2c99('0x2c')]?moment()[_0x2c99('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x7aa011['id']});})['catch'](function(_0x2f245d){_0x538b6a(_0x2f245d);});});});};var _0x1ce8c6=function(_0x354d3e){return new BPromise(function(_0xdbe294,_0x6d9381){_0x2e927f(_0x354d3e,_0x1c2ca3)[_0x2c99('0x20')](function(_0x4ab8ca){_0x1c2ca3[_0x2c99('0x1b')]=_0x4ab8ca['ret'];_0x110dd3[_0x2c99('0x28')][_0x2c99('0x1f')]({'where':{'phone':_0x1c2ca3[_0x2c99('0xe')],'CampaignId':_0x354d3e['id']}})[_0x2c99('0x20')](function(_0x4b3d04){if(!_[_0x2c99('0x1d')](_0x4b3d04)){throw new Error('cmContact,\x20afterCreate\x20'+_0x1c2ca3[_0x2c99('0xe')]+_0x2c99('0x36')+_0x354d3e['id']);}return _0x110dd3[_0x2c99('0x2f')]['findOne']({'where':{'calleridnum':_0x1c2ca3[_0x2c99('0xe')],'CampaignId':_0x354d3e['id']}});})[_0x2c99('0x20')](function(_0x366724){if(!_[_0x2c99('0x1d')](_0x366724)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x1c2ca3[_0x2c99('0xe')]+_0x2c99('0x37')+_0x354d3e['id']);}return _0x110dd3[_0x2c99('0x28')]['create']({'phone':_0x1c2ca3[_0x2c99('0xe')],'ContactId':_0x1c2ca3['id'],'ListId':_0x1c2ca3[_0x2c99('0x32')],'priority':_0x1c2ca3['priority']?_0x1c2ca3[_0x2c99('0x2a')]:0x2,'scheduledat':_0x1c2ca3[_0x2c99('0x1b')]?_0x1c2ca3[_0x2c99('0x1b')]:moment()[_0x2c99('0x1c')](_0x2c99('0x2b')),'callback':_0x1c2ca3['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1c2ca3[_0x2c99('0x2c')]?_0x1c2ca3[_0x2c99('0x2c')]:undefined,'callbackat':_0x1c2ca3[_0x2c99('0x2c')]?moment()[_0x2c99('0x1c')](_0x2c99('0x2b')):undefined,'CampaignId':_0x354d3e['id']});})[_0x2c99('0x33')](function(_0x9c5ba7){_0x6d9381(_0x9c5ba7);});});});};if(_0x1c2ca3[_0x2c99('0x32')]){_0x110dd3['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id',_0x2c99('0x38'),_0x2c99('0x21')],'include':[{'model':_0x110dd3['CmList'],'as':_0x2c99('0x39'),'where':{'id':_0x1c2ca3[_0x2c99('0x32')]}}]})[_0x2c99('0x20')](function(_0x4501ce){if(_0x4501ce){var _0x313671=[];for(var _0xfcb8e8=0x0,_0x1e4075;_0xfcb8e8<_0x4501ce[_0x2c99('0x3a')];_0xfcb8e8+=0x1){_0x1e4075=_0x4501ce[_0xfcb8e8]['get']({'plain':!![]});switch(_0x1e4075[_0x2c99('0x38')]){case _0x2c99('0x3b'):_0xe652e(_0x1e4075)[_0x2c99('0x33')](_0x3caf62());break;case'onlyIfOpen':_0x3d8e94(_0x1e4075)[_0x2c99('0x33')](_0x3caf62());break;default:_0x2e927f(_0x1e4075,_0x1c2ca3)[_0x2c99('0x20')](function(_0x585bd6){_0x1c2ca3[_0x2c99('0x1b')]=_0x585bd6['ret'];_0x110dd3[_0x2c99('0x28')]['create']({'phone':_0x1c2ca3[_0x2c99('0xe')],'ContactId':_0x1c2ca3['id'],'ListId':_0x1c2ca3['ListId'],'scheduledat':_0x1c2ca3[_0x2c99('0x1b')]?_0x1c2ca3['scheduledat']:moment()[_0x2c99('0x1c')](_0x2c99('0x2b')),'priority':_0x1c2ca3[_0x2c99('0x2a')]?_0x1c2ca3[_0x2c99('0x2a')]:0x2,'callback':_0x1c2ca3['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x1c2ca3[_0x2c99('0x2c')]?_0x1c2ca3['callbackUniqueid']:undefined,'callbackat':_0x1c2ca3[_0x2c99('0x2c')]?moment()[_0x2c99('0x1c')](_0x2c99('0x2b')):undefined,'VoiceQueueId':_0x1e4075['id']})[_0x2c99('0x33')](_0x3caf62());});}}}})[_0x2c99('0x20')](function(){return _0x110dd3[_0x2c99('0x1e')]['findAll']({'where':{'type':_0x2c99('0x3c')},'attributes':['id'],'include':[{'model':_0x110dd3[_0x2c99('0x3d')],'as':_0x2c99('0x3e'),'where':{'id':_0x1c2ca3[_0x2c99('0x32')]}}]})[_0x2c99('0x20')](function(_0x44229f){if(_0x44229f){var _0x376af8=[];for(var _0x2dc8f1=0x0,_0x4d4df5;_0x2dc8f1<_0x44229f[_0x2c99('0x3a')];_0x2dc8f1+=0x1){_0x4d4df5=_0x44229f[_0x2dc8f1][_0x2c99('0x17')]({'plain':!![]});_0x110dd3['CmHopperBlack']['create']({'phone':_0x1c2ca3[_0x2c99('0xe')],'ContactId':_0x1c2ca3['id'],'ListId':_0x1c2ca3['ListId'],'VoiceQueueId':_0x4d4df5['id']})['catch'](function(_0x1ee307){logger[_0x2c99('0x18')](_0x2c99('0x3f'),'afterCreate',_0x1ee307['message']);});}}});})[_0x2c99('0x20')](function(){return _0x110dd3[_0x2c99('0x35')][_0x2c99('0x40')]({'attributes':['id',_0x2c99('0x38'),'dialTimezone'],'include':[{'model':_0x110dd3[_0x2c99('0x3d')],'as':'Lists','where':{'id':_0x1c2ca3[_0x2c99('0x32')]}}]})['then'](function(_0x3c2af1){if(_0x3c2af1){var _0x2c5781=[];for(var _0x559a32=0x0,_0x3a97c8;_0x559a32<_0x3c2af1[_0x2c99('0x3a')];_0x559a32+=0x1){_0x3a97c8=_0x3c2af1[_0x559a32][_0x2c99('0x17')]({'plain':!![]});switch(_0x3a97c8[_0x2c99('0x38')]){case'always':_0x1ce8c6(_0x3a97c8)[_0x2c99('0x33')](_0x3bf4a1());break;case'onlyIfOpen':_0x408747(_0x3a97c8)['catch'](_0x3bf4a1());break;default:_0x110dd3[_0x2c99('0x28')][_0x2c99('0x29')]({'phone':_0x1c2ca3['phone'],'ContactId':_0x1c2ca3['id'],'ListId':_0x1c2ca3[_0x2c99('0x32')],'scheduledat':_0x1c2ca3[_0x2c99('0x1b')]?_0x1c2ca3['scheduledat']:moment()[_0x2c99('0x1c')](_0x2c99('0x2b')),'priority':_0x1c2ca3[_0x2c99('0x2a')]?_0x1c2ca3[_0x2c99('0x2a')]:0x2,'callback':_0x1c2ca3[_0x2c99('0x2c')]?!![]:![],'callbackuniqueid':_0x1c2ca3[_0x2c99('0x2c')]?_0x1c2ca3[_0x2c99('0x2c')]:undefined,'callbackat':_0x1c2ca3[_0x2c99('0x2c')]?moment()[_0x2c99('0x1c')](_0x2c99('0x2b')):undefined,'CampaignId':_0x3a97c8['id']})[_0x2c99('0x33')](_0x3bf4a1());}}}});})[_0x2c99('0x20')](function(){return _0x110dd3[_0x2c99('0x35')][_0x2c99('0x40')]({'attributes':['id'],'include':[{'model':_0x110dd3[_0x2c99('0x3d')],'as':'BlackLists','where':{'id':_0x1c2ca3[_0x2c99('0x32')]}}]})[_0x2c99('0x20')](function(_0x201873){if(_0x201873){var _0x2f4122=[];for(var _0x1d7cd1=0x0,_0x144f88;_0x1d7cd1<_0x201873[_0x2c99('0x3a')];_0x1d7cd1+=0x1){_0x144f88=_0x201873[_0x1d7cd1][_0x2c99('0x17')]({'plain':!![]});_0x110dd3[_0x2c99('0x41')][_0x2c99('0x29')]({'phone':_0x1c2ca3[_0x2c99('0xe')],'ContactId':_0x1c2ca3['id'],'ListId':_0x1c2ca3[_0x2c99('0x32')],'CampaignId':_0x144f88['id']})[_0x2c99('0x33')](function(_0x4aecab){logger['error'](_0x2c99('0x3f'),_0x2c99('0x1a'),_0x4aecab[_0x2c99('0x42')]);});}}});})[_0x2c99('0x20')](function(){_0x55bc09();})[_0x2c99('0x33')](function(_0x92c83b){logger[_0x2c99('0x18')](_0x2c99('0x3f'),_0x2c99('0x1a'),_0x92c83b[_0x2c99('0x42')]);_0x55bc09(_0x92c83b);});}else{_0x55bc09(new Error(_0x2c99('0x43')));}},'afterDestroy':function(_0x5be419,_0x16c55d,_0x2249b6){var _0x493748=_0x70cb07['models'];var _0x19b2c6=_0x5be419['get']({'plain':!![]});return _0x493748['CmHopper'][_0x2c99('0x40')]({'raw':!![],'where':{'ListId':_0x19b2c6[_0x2c99('0x32')],'ContactId':_0x19b2c6['id']}})['then'](function(_0x59b440){if(!_[_0x2c99('0x44')](_0x59b440)){var _0x31adeb=[];for(var _0xea0ad3=0x0;_0xea0ad3<_0x59b440[_0x2c99('0x3a')];_0xea0ad3+=0x1){var _0x3dd912=_0x493748[_0x2c99('0x28')][_0x2c99('0x45')]({'where':{'ListId':_0x59b440[_0xea0ad3][_0x2c99('0x32')],'ContactId':_0x59b440[_0xea0ad3][_0x2c99('0x46')],'VoiceQueueId':_0x59b440[_0xea0ad3][_0x2c99('0x47')],'CampaignId':_0x59b440[_0xea0ad3][_0x2c99('0x48')]}});_0x31adeb[_0x2c99('0x49')](_0x3dd912);}return BPromise['all'](_0x31adeb);}})[_0x2c99('0x20')](function(_0x343b1a){logger[_0x2c99('0x4a')](_0x2c99('0x4b'),util['inspect'](_0x343b1a,{'showHidden':![],'depth':null}));_0x2249b6();})['catch'](function(_0x4e3518){logger[_0x2c99('0x18')]('[CmContact][afterDestroy][Error]',util['inspect'](_0x4e3518,{'showHidden':![],'depth':null}));_0x2249b6(_0x4e3518);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 27657c5..e202ff1 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(_0x57906f,_0xe15414){var _0x3b4c29=function(_0xc5d427){while(--_0xc5d427){_0x57906f['push'](_0x57906f['shift']());}};_0x3b4c29(++_0xe15414);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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(_0x48b047,_0xed0b4f){var _0x2a7671=function(_0x5644b4){while(--_0x5644b4){_0x48b047['push'](_0x48b047['shift']());}};_0x2a7671(++_0xed0b4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 c430893..d408da8 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 _0xbd50=['PHONE','sequelize','exports','INTEGER','STRING'];(function(_0x360bd0,_0x2ad1d5){var _0x1baaed=function(_0x3e025f){while(--_0x3e025f){_0x360bd0['push'](_0x360bd0['shift']());}};_0x1baaed(++_0x2ad1d5);}(_0xbd50,0x196));var _0x0bd5=function(_0x3c7246,_0x391009){_0x3c7246=_0x3c7246-0x0;var _0x28c8c4=_0xbd50[_0x3c7246];return _0x28c8c4;};'use strict';var Sequelize=require(_0x0bd5('0x0'));module[_0x0bd5('0x1')]={'CmContactId':{'type':Sequelize[_0x0bd5('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x0bd5('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x0bd5('0x3')],'defaultValue':_0x0bd5('0x4')},'OrderBy':{'type':Sequelize[_0x0bd5('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x0bd5('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0xf197=['sequelize','exports','INTEGER','STRING'];(function(_0x5a16f7,_0x15e545){var _0x5cb364=function(_0xfa7198){while(--_0xfa7198){_0x5a16f7['push'](_0x5a16f7['shift']());}};_0x5cb364(++_0x15e545);}(_0xf197,0x130));var _0x7f19=function(_0x37881d,_0x15bb92){_0x37881d=_0x37881d-0x0;var _0x17f0c1=_0xf197[_0x37881d];return _0x17f0c1;};'use strict';var Sequelize=require(_0x7f19('0x0'));module[_0x7f19('0x1')]={'CmContactId':{'type':Sequelize[_0x7f19('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x7f19('0x3')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize['STRING'],'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 36abf1b..0933104 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 _0x0da7=['json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','map','CmContactHasItem','rawAttributes','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','fields','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0x0da7,0x128));var _0x70da=function(_0x3e1ccd,_0x3d3880){_0x3e1ccd=_0x3e1ccd-0x0;var _0x3e02ed=_0x0da7[_0x3e1ccd];return _0x3e02ed;};'use strict';var emlformat=require(_0x70da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x70da('0x1'));var jsonpatch=require(_0x70da('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x70da('0x3'));var Mustache=require(_0x70da('0x4'));var util=require(_0x70da('0x5'));var path=require(_0x70da('0x6'));var sox=require(_0x70da('0x7'));var csv=require('to-csv');var ejs=require(_0x70da('0x8'));var fs=require('fs');var fs_extra=require(_0x70da('0x9'));var _=require(_0x70da('0xa'));var squel=require(_0x70da('0xb'));var crypto=require(_0x70da('0xc'));var jsforce=require(_0x70da('0xd'));var deskjs=require(_0x70da('0xe'));var toCsv=require(_0x70da('0xf'));var querystring=require(_0x70da('0x10'));var Papa=require(_0x70da('0x11'));var Redis=require(_0x70da('0x12'));var authService=require(_0x70da('0x13'));var qs=require(_0x70da('0x14'));var as=require(_0x70da('0x15'));var hardwareService=require(_0x70da('0x16'));var logger=require('../../config/logger')(_0x70da('0x17'));var utils=require(_0x70da('0x18'));var config=require(_0x70da('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21a3bb,_0x4bf80f){_0x4bf80f=_0x4bf80f||0xcc;return function(_0x126e7c){if(_0x126e7c){return _0x21a3bb['sendStatus'](_0x4bf80f);}return _0x21a3bb[_0x70da('0x1a')](_0x4bf80f)[_0x70da('0x1b')]();};}function respondWithResult(_0x5d8114,_0x4aa464){_0x4aa464=_0x4aa464||0xc8;return function(_0x1472a5){if(_0x1472a5){return _0x5d8114['status'](_0x4aa464)[_0x70da('0x1c')](_0x1472a5);}};}function respondWithFilteredResult(_0x2acc59,_0x15892b){return function(_0x588c98){if(_0x588c98){var _0x42206a=typeof _0x15892b['offset']===_0x70da('0x1d')&&typeof _0x15892b[_0x70da('0x1e')]===_0x70da('0x1d');var _0x1f10c2=_0x588c98[_0x70da('0x1f')];var _0x3cb4bd=_0x42206a?0x0:_0x15892b[_0x70da('0x20')];var _0x3edd83=_0x42206a?_0x588c98[_0x70da('0x1f')]:_0x15892b[_0x70da('0x20')]+_0x15892b[_0x70da('0x1e')];var _0x1ea37c;if(_0x3edd83>=_0x1f10c2){_0x3edd83=_0x1f10c2;_0x1ea37c=0xc8;}else{_0x1ea37c=0xce;}_0x2acc59[_0x70da('0x1a')](_0x1ea37c);return _0x2acc59[_0x70da('0x21')](_0x70da('0x22'),_0x3cb4bd+'-'+_0x3edd83+'/'+_0x1f10c2)[_0x70da('0x1c')](_0x588c98);}return null;};}function patchUpdates(_0x34787e){return function(_0x334ba7){try{jsonpatch[_0x70da('0x23')](_0x334ba7,_0x34787e,!![]);}catch(_0x324f14){return BPromise['reject'](_0x324f14);}return _0x334ba7[_0x70da('0x24')]();};}function saveUpdates(_0x2249b9,_0x376ab9){return function(_0x15fbd3){if(_0x15fbd3){return _0x15fbd3[_0x70da('0x25')](_0x2249b9)[_0x70da('0x26')](function(_0xf9e1bc){return _0xf9e1bc;});}return null;};}function removeEntity(_0x22ca1b,_0x1fd2dd){return function(_0x31d32c){if(_0x31d32c){return _0x31d32c[_0x70da('0x27')]()[_0x70da('0x26')](function(){var _0x137269=_0x31d32c[_0x70da('0x28')]({'plain':!![]});var _0xf4d04b='CmContactHasItems';return db[_0x70da('0x29')][_0x70da('0x27')]({'where':{'type':_0xf4d04b,'resourceId':_0x137269['id']}})[_0x70da('0x26')](function(){return _0x31d32c;});})[_0x70da('0x26')](function(){_0x22ca1b['status'](0xcc)[_0x70da('0x1b')]();});}};}function handleEntityNotFound(_0x250e15,_0x5964a0){return function(_0x3242ac){if(!_0x3242ac){_0x250e15['sendStatus'](0x194);}return _0x3242ac;};}function handleError(_0x6d292c,_0x51adc0){_0x51adc0=_0x51adc0||0x1f4;return function(_0x13ecec){logger[_0x70da('0x2a')](_0x13ecec[_0x70da('0x2b')]);if(_0x13ecec[_0x70da('0x2c')]){delete _0x13ecec['name'];}_0x6d292c['status'](_0x51adc0)['send'](_0x13ecec);};}exports['index']=function(_0x3986dd,_0x544720){var _0x5edad3={},_0xb1953f={},_0x28572f={'count':0x0,'rows':[]};var _0x1484cd=_[_0x70da('0x2d')](db[_0x70da('0x2e')][_0x70da('0x2f')],function(_0x279a72){return{'name':_0x279a72['fieldName'],'type':_0x279a72[_0x70da('0x30')][_0x70da('0x31')]};});_0xb1953f[_0x70da('0x32')]=_[_0x70da('0x2d')](_0x1484cd,_0x70da('0x2c'));_0xb1953f[_0x70da('0x33')]=_[_0x70da('0x34')](_0x3986dd['query']);_0xb1953f['filters']=_[_0x70da('0x35')](_0xb1953f[_0x70da('0x32')],_0xb1953f[_0x70da('0x33')]);_0x5edad3[_0x70da('0x36')]=_['intersection'](_0xb1953f[_0x70da('0x32')],qs['fields'](_0x3986dd[_0x70da('0x33')]['fields']));_0x5edad3['attributes']=_0x5edad3['attributes'][_0x70da('0x37')]?_0x5edad3[_0x70da('0x36')]:_0xb1953f[_0x70da('0x32')];if(!_0x3986dd['query'][_0x70da('0x38')](_0x70da('0x39'))){_0x5edad3[_0x70da('0x1e')]=qs[_0x70da('0x1e')](_0x3986dd['query'][_0x70da('0x1e')]);_0x5edad3[_0x70da('0x20')]=qs[_0x70da('0x20')](_0x3986dd[_0x70da('0x33')][_0x70da('0x20')]);}_0x5edad3[_0x70da('0x3a')]=qs[_0x70da('0x3b')](_0x3986dd['query']['sort']);_0x5edad3[_0x70da('0x3c')]=qs[_0x70da('0x3d')](_[_0x70da('0x3e')](_0x3986dd['query'],_0xb1953f[_0x70da('0x3d')]),_0x1484cd);if(_0x3986dd[_0x70da('0x33')][_0x70da('0x3f')]){_0x5edad3[_0x70da('0x3c')]=_[_0x70da('0x40')](_0x5edad3['where'],{'$or':_[_0x70da('0x2d')](_0x1484cd,function(_0x2c18e9){if(_0x2c18e9[_0x70da('0x30')]!=='VIRTUAL'){var _0x23c5f6={};_0x23c5f6[_0x2c18e9[_0x70da('0x2c')]]={'$like':'%'+_0x3986dd[_0x70da('0x33')]['filter']+'%'};return _0x23c5f6;}})});}_0x5edad3=_['merge']({},_0x5edad3,_0x3986dd[_0x70da('0x41')]);var _0x27d52e={'where':_0x5edad3[_0x70da('0x3c')]};return db[_0x70da('0x2e')][_0x70da('0x1f')](_0x27d52e)[_0x70da('0x26')](function(_0x242eb0){_0x28572f['count']=_0x242eb0;if(_0x3986dd[_0x70da('0x33')][_0x70da('0x42')]){_0x5edad3[_0x70da('0x43')]=[{'all':!![]}];}return db[_0x70da('0x2e')][_0x70da('0x44')](_0x5edad3);})[_0x70da('0x26')](function(_0x20c0ac){_0x28572f['rows']=_0x20c0ac;return _0x28572f;})[_0x70da('0x26')](respondWithFilteredResult(_0x544720,_0x5edad3))[_0x70da('0x45')](handleError(_0x544720,null));};exports['show']=function(_0x3acc81,_0x3a551f){var _0x2c73d6={'raw':!![],'where':{'id':_0x3acc81['params']['id']}},_0x204983={};_0x204983[_0x70da('0x32')]=_[_0x70da('0x34')](db[_0x70da('0x2e')][_0x70da('0x2f')]);_0x204983['query']=_[_0x70da('0x34')](_0x3acc81[_0x70da('0x33')]);_0x204983['filters']=_['intersection'](_0x204983[_0x70da('0x32')],_0x204983[_0x70da('0x33')]);_0x2c73d6['attributes']=_[_0x70da('0x35')](_0x204983['model'],qs[_0x70da('0x46')](_0x3acc81[_0x70da('0x33')][_0x70da('0x46')]));_0x2c73d6['attributes']=_0x2c73d6[_0x70da('0x36')][_0x70da('0x37')]?_0x2c73d6[_0x70da('0x36')]:_0x204983[_0x70da('0x32')];if(_0x3acc81[_0x70da('0x33')]['includeAll']){_0x2c73d6[_0x70da('0x43')]=[{'all':!![]}];}_0x2c73d6=_[_0x70da('0x40')]({},_0x2c73d6,_0x3acc81['options']);return db[_0x70da('0x2e')]['find'](_0x2c73d6)['then'](handleEntityNotFound(_0x3a551f,null))[_0x70da('0x26')](respondWithResult(_0x3a551f,null))[_0x70da('0x45')](handleError(_0x3a551f,null));};exports[_0x70da('0x47')]=function(_0x34b54c,_0x37efe2){return db[_0x70da('0x2e')][_0x70da('0x47')](_0x34b54c[_0x70da('0x48')],{})[_0x70da('0x26')](function(_0x27aad6){var _0x6422a4=_0x34b54c[_0x70da('0x49')][_0x70da('0x28')]({'plain':!![]});if(!_0x6422a4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6422a4[_0x70da('0x4a')]===_0x70da('0x49')){var _0x244669=_0x27aad6[_0x70da('0x28')]({'plain':!![]});var _0xcaace5='CmContactHasItems';return db[_0x70da('0x4b')][_0x70da('0x4c')]({'where':{'name':_0xcaace5,'userProfileId':_0x6422a4[_0x70da('0x4d')]},'raw':!![]})[_0x70da('0x26')](function(_0x2e9e26){if(_0x2e9e26&&_0x2e9e26[_0x70da('0x4e')]===0x0){return db['UserProfileResource'][_0x70da('0x47')]({'name':_0x244669['name'],'resourceId':_0x244669['id'],'type':_0x2e9e26['name'],'sectionId':_0x2e9e26['id']},{})[_0x70da('0x26')](function(){return _0x27aad6;});}else{return _0x27aad6;}})['catch'](function(_0x599b25){logger[_0x70da('0x2a')](_0x70da('0x4f'),_0x599b25);throw _0x599b25;});}return _0x27aad6;})[_0x70da('0x26')](respondWithResult(_0x37efe2,0xc9))[_0x70da('0x45')](handleError(_0x37efe2,null));};exports[_0x70da('0x25')]=function(_0x43b1da,_0x4533dd){if(_0x43b1da[_0x70da('0x48')]['id']){delete _0x43b1da['body']['id'];}return db[_0x70da('0x2e')][_0x70da('0x4c')]({'where':{'id':_0x43b1da['params']['id']}})['then'](handleEntityNotFound(_0x4533dd,null))[_0x70da('0x26')](saveUpdates(_0x43b1da['body'],null))['then'](respondWithResult(_0x4533dd,null))['catch'](handleError(_0x4533dd,null));};exports['destroy']=function(_0x5651ed,_0x2f30ec){return db['CmContactHasItem'][_0x70da('0x4c')]({'where':{'id':_0x5651ed[_0x70da('0x50')]['id']}})[_0x70da('0x26')](handleEntityNotFound(_0x2f30ec,null))[_0x70da('0x26')](removeEntity(_0x2f30ec,null))[_0x70da('0x45')](handleError(_0x2f30ec,null));}; \ No newline at end of file +var _0x1519=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','CmContactHasItems','UserProfileResource','sendStatus','stack','name','send','index','map','CmContactHasItem','rawAttributes','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','options','includeAll','include','rows','catch','params','merge','find','create','body','get','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1cd64d,_0x3c3843){var _0xa086be=function(_0x51dcc0){while(--_0x51dcc0){_0x1cd64d['push'](_0x1cd64d['shift']());}};_0xa086be(++_0x3c3843);}(_0x1519,0x124));var _0x9151=function(_0x351b2b,_0x53e0df){_0x351b2b=_0x351b2b-0x0;var _0x3247c3=_0x1519[_0x351b2b];return _0x3247c3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9151('0x0'));var zipdir=require(_0x9151('0x1'));var jsonpatch=require(_0x9151('0x2'));var rp=require(_0x9151('0x3'));var moment=require(_0x9151('0x4'));var BPromise=require(_0x9151('0x5'));var Mustache=require(_0x9151('0x6'));var util=require(_0x9151('0x7'));var path=require('path');var sox=require(_0x9151('0x8'));var csv=require(_0x9151('0x9'));var ejs=require(_0x9151('0xa'));var fs=require('fs');var fs_extra=require(_0x9151('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9151('0xc'));var jsforce=require(_0x9151('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9151('0x9'));var querystring=require('querystring');var Papa=require(_0x9151('0xe'));var Redis=require(_0x9151('0xf'));var authService=require(_0x9151('0x10'));var qs=require(_0x9151('0x11'));var as=require(_0x9151('0x12'));var hardwareService=require(_0x9151('0x13'));var logger=require(_0x9151('0x14'))('api');var utils=require(_0x9151('0x15'));var config=require(_0x9151('0x16'));var licenseUtil=require(_0x9151('0x17'));var db=require(_0x9151('0x18'))['db'];function respondWithStatusCode(_0x2e91f0,_0x12725e){_0x12725e=_0x12725e||0xcc;return function(_0x2f7328){if(_0x2f7328){return _0x2e91f0['sendStatus'](_0x12725e);}return _0x2e91f0[_0x9151('0x19')](_0x12725e)[_0x9151('0x1a')]();};}function respondWithResult(_0x797787,_0x4e3bb5){_0x4e3bb5=_0x4e3bb5||0xc8;return function(_0x7c48ee){if(_0x7c48ee){return _0x797787[_0x9151('0x19')](_0x4e3bb5)[_0x9151('0x1b')](_0x7c48ee);}};}function respondWithFilteredResult(_0x5aa938,_0x16ce7a){return function(_0xbd6af9){if(_0xbd6af9){var _0x11056d=typeof _0x16ce7a[_0x9151('0x1c')]===_0x9151('0x1d')&&typeof _0x16ce7a[_0x9151('0x1e')]===_0x9151('0x1d');var _0x4a2d7f=_0xbd6af9['count'];var _0x46f68c=_0x11056d?0x0:_0x16ce7a[_0x9151('0x1c')];var _0x27951c=_0x11056d?_0xbd6af9[_0x9151('0x1f')]:_0x16ce7a[_0x9151('0x1c')]+_0x16ce7a[_0x9151('0x1e')];var _0x369c58;if(_0x27951c>=_0x4a2d7f){_0x27951c=_0x4a2d7f;_0x369c58=0xc8;}else{_0x369c58=0xce;}_0x5aa938['status'](_0x369c58);return _0x5aa938[_0x9151('0x20')](_0x9151('0x21'),_0x46f68c+'-'+_0x27951c+'/'+_0x4a2d7f)['json'](_0xbd6af9);}return null;};}function patchUpdates(_0x7ca67b){return function(_0x53ed9e){try{jsonpatch[_0x9151('0x22')](_0x53ed9e,_0x7ca67b,!![]);}catch(_0x5aad1a){return BPromise['reject'](_0x5aad1a);}return _0x53ed9e[_0x9151('0x23')]();};}function saveUpdates(_0x5bb6a3,_0x1ac216){return function(_0x5589c6){if(_0x5589c6){return _0x5589c6['update'](_0x5bb6a3)[_0x9151('0x24')](function(_0x41a824){return _0x41a824;});}return null;};}function removeEntity(_0x1e14a2,_0x9f9e8e){return function(_0x393b7e){if(_0x393b7e){return _0x393b7e[_0x9151('0x25')]()[_0x9151('0x24')](function(){var _0x525d82=_0x393b7e['get']({'plain':!![]});var _0x4553ee=_0x9151('0x26');return db[_0x9151('0x27')][_0x9151('0x25')]({'where':{'type':_0x4553ee,'resourceId':_0x525d82['id']}})['then'](function(){return _0x393b7e;});})[_0x9151('0x24')](function(){_0x1e14a2['status'](0xcc)[_0x9151('0x1a')]();});}};}function handleEntityNotFound(_0x565736,_0x103bb8){return function(_0x3735b1){if(!_0x3735b1){_0x565736[_0x9151('0x28')](0x194);}return _0x3735b1;};}function handleError(_0x2c211d,_0x54a044){_0x54a044=_0x54a044||0x1f4;return function(_0x357329){logger['error'](_0x357329[_0x9151('0x29')]);if(_0x357329[_0x9151('0x2a')]){delete _0x357329['name'];}_0x2c211d[_0x9151('0x19')](_0x54a044)[_0x9151('0x2b')](_0x357329);};}exports[_0x9151('0x2c')]=function(_0x132acf,_0x1e54f1){var _0x1ad51b={},_0x4d60b3={},_0xe91ea6={'count':0x0,'rows':[]};var _0x51c42a=_[_0x9151('0x2d')](db[_0x9151('0x2e')][_0x9151('0x2f')],function(_0x44a819){return{'name':_0x44a819['fieldName'],'type':_0x44a819['type'][_0x9151('0x30')]};});_0x4d60b3[_0x9151('0x31')]=_[_0x9151('0x2d')](_0x51c42a,'name');_0x4d60b3['query']=_[_0x9151('0x32')](_0x132acf['query']);_0x4d60b3[_0x9151('0x33')]=_[_0x9151('0x34')](_0x4d60b3['model'],_0x4d60b3[_0x9151('0x35')]);_0x1ad51b[_0x9151('0x36')]=_[_0x9151('0x34')](_0x4d60b3[_0x9151('0x31')],qs[_0x9151('0x37')](_0x132acf[_0x9151('0x35')]['fields']));_0x1ad51b['attributes']=_0x1ad51b['attributes'][_0x9151('0x38')]?_0x1ad51b[_0x9151('0x36')]:_0x4d60b3['model'];if(!_0x132acf['query'][_0x9151('0x39')](_0x9151('0x3a'))){_0x1ad51b['limit']=qs['limit'](_0x132acf['query'][_0x9151('0x1e')]);_0x1ad51b[_0x9151('0x1c')]=qs[_0x9151('0x1c')](_0x132acf[_0x9151('0x35')]['offset']);}_0x1ad51b['order']=qs[_0x9151('0x3b')](_0x132acf[_0x9151('0x35')][_0x9151('0x3b')]);_0x1ad51b[_0x9151('0x3c')]=qs[_0x9151('0x33')](_['pick'](_0x132acf['query'],_0x4d60b3[_0x9151('0x33')]),_0x51c42a);if(_0x132acf[_0x9151('0x35')][_0x9151('0x3d')]){_0x1ad51b['where']=_['merge'](_0x1ad51b[_0x9151('0x3c')],{'$or':_['map'](_0x51c42a,function(_0x4b4cd7){if(_0x4b4cd7['type']!=='VIRTUAL'){var _0x1e6687={};_0x1e6687[_0x4b4cd7[_0x9151('0x2a')]]={'$like':'%'+_0x132acf['query'][_0x9151('0x3d')]+'%'};return _0x1e6687;}})});}_0x1ad51b=_['merge']({},_0x1ad51b,_0x132acf[_0x9151('0x3e')]);var _0x4fb2e8={'where':_0x1ad51b['where']};return db['CmContactHasItem']['count'](_0x4fb2e8)[_0x9151('0x24')](function(_0x319efe){_0xe91ea6[_0x9151('0x1f')]=_0x319efe;if(_0x132acf['query'][_0x9151('0x3f')]){_0x1ad51b[_0x9151('0x40')]=[{'all':!![]}];}return db[_0x9151('0x2e')]['findAll'](_0x1ad51b);})[_0x9151('0x24')](function(_0x27785c){_0xe91ea6[_0x9151('0x41')]=_0x27785c;return _0xe91ea6;})[_0x9151('0x24')](respondWithFilteredResult(_0x1e54f1,_0x1ad51b))[_0x9151('0x42')](handleError(_0x1e54f1,null));};exports['show']=function(_0x4ebba3,_0x26491e){var _0x33d8fd={'raw':!![],'where':{'id':_0x4ebba3[_0x9151('0x43')]['id']}},_0x496113={};_0x496113[_0x9151('0x31')]=_[_0x9151('0x32')](db[_0x9151('0x2e')]['rawAttributes']);_0x496113[_0x9151('0x35')]=_['keys'](_0x4ebba3[_0x9151('0x35')]);_0x496113[_0x9151('0x33')]=_[_0x9151('0x34')](_0x496113[_0x9151('0x31')],_0x496113['query']);_0x33d8fd[_0x9151('0x36')]=_[_0x9151('0x34')](_0x496113[_0x9151('0x31')],qs[_0x9151('0x37')](_0x4ebba3[_0x9151('0x35')][_0x9151('0x37')]));_0x33d8fd[_0x9151('0x36')]=_0x33d8fd[_0x9151('0x36')][_0x9151('0x38')]?_0x33d8fd[_0x9151('0x36')]:_0x496113[_0x9151('0x31')];if(_0x4ebba3[_0x9151('0x35')][_0x9151('0x3f')]){_0x33d8fd[_0x9151('0x40')]=[{'all':!![]}];}_0x33d8fd=_[_0x9151('0x44')]({},_0x33d8fd,_0x4ebba3[_0x9151('0x3e')]);return db[_0x9151('0x2e')][_0x9151('0x45')](_0x33d8fd)[_0x9151('0x24')](handleEntityNotFound(_0x26491e,null))[_0x9151('0x24')](respondWithResult(_0x26491e,null))[_0x9151('0x42')](handleError(_0x26491e,null));};exports['create']=function(_0xdf9291,_0x6a449){return db[_0x9151('0x2e')][_0x9151('0x46')](_0xdf9291[_0x9151('0x47')],{})[_0x9151('0x24')](function(_0x26b8a6){var _0x3b6a5a=_0xdf9291['user'][_0x9151('0x48')]({'plain':!![]});if(!_0x3b6a5a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b6a5a['role']==='user'){var _0x593d53=_0x26b8a6[_0x9151('0x48')]({'plain':!![]});var _0x53c3a7=_0x9151('0x26');return db[_0x9151('0x49')][_0x9151('0x45')]({'where':{'name':_0x53c3a7,'userProfileId':_0x3b6a5a[_0x9151('0x4a')]},'raw':!![]})[_0x9151('0x24')](function(_0x39c2cb){if(_0x39c2cb&&_0x39c2cb['autoAssociation']===0x0){return db[_0x9151('0x27')][_0x9151('0x46')]({'name':_0x593d53[_0x9151('0x2a')],'resourceId':_0x593d53['id'],'type':_0x39c2cb[_0x9151('0x2a')],'sectionId':_0x39c2cb['id']},{})[_0x9151('0x24')](function(){return _0x26b8a6;});}else{return _0x26b8a6;}})[_0x9151('0x42')](function(_0x2c6cb6){logger[_0x9151('0x4b')](_0x9151('0x4c'),_0x2c6cb6);throw _0x2c6cb6;});}return _0x26b8a6;})[_0x9151('0x24')](respondWithResult(_0x6a449,0xc9))[_0x9151('0x42')](handleError(_0x6a449,null));};exports[_0x9151('0x4d')]=function(_0x4ac09f,_0x2390dd){if(_0x4ac09f[_0x9151('0x47')]['id']){delete _0x4ac09f[_0x9151('0x47')]['id'];}return db[_0x9151('0x2e')][_0x9151('0x45')]({'where':{'id':_0x4ac09f[_0x9151('0x43')]['id']}})[_0x9151('0x24')](handleEntityNotFound(_0x2390dd,null))[_0x9151('0x24')](saveUpdates(_0x4ac09f['body'],null))[_0x9151('0x24')](respondWithResult(_0x2390dd,null))[_0x9151('0x42')](handleError(_0x2390dd,null));};exports['destroy']=function(_0xea4636,_0x484a0e){return db[_0x9151('0x2e')][_0x9151('0x45')]({'where':{'id':_0xea4636[_0x9151('0x43')]['id']}})['then'](handleEntityNotFound(_0x484a0e,null))['then'](removeEntity(_0x484a0e,null))[_0x9151('0x42')](handleError(_0x484a0e,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index ab84d13..13c3ec9 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 _0xf725=['request-promise','rimraf','./cmContactHasItem.attributes','exports','CmContactHasItem','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x286855,_0x4f518a){var _0x4ddd85=function(_0x325db4){while(--_0x325db4){_0x286855['push'](_0x286855['shift']());}};_0x4ddd85(++_0x4f518a);}(_0xf725,0x14f));var _0x5f72=function(_0x495791,_0x42c570){_0x495791=_0x495791-0x0;var _0x2a5fe8=_0xf725[_0x495791];return _0x2a5fe8;};'use strict';var _=require(_0x5f72('0x0'));var util=require(_0x5f72('0x1'));var logger=require(_0x5f72('0x2'))(_0x5f72('0x3'));var moment=require(_0x5f72('0x4'));var BPromise=require(_0x5f72('0x5'));var rp=require(_0x5f72('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f72('0x7'));var config=require('../../config/environment');var attributes=require(_0x5f72('0x8'));module[_0x5f72('0x9')]=function(_0x363d71,_0x344868){return _0x363d71['define'](_0x5f72('0xa'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ab9=['rimraf','exports','define','lodash','util','api','moment','bluebird','path'];(function(_0x196eb2,_0x118ec8){var _0x39c1f9=function(_0x5cb086){while(--_0x5cb086){_0x196eb2['push'](_0x196eb2['shift']());}};_0x39c1f9(++_0x118ec8);}(_0x0ab9,0xc0));var _0x90ab=function(_0x406d17,_0x500942){_0x406d17=_0x406d17-0x0;var _0x2440e2=_0x0ab9[_0x406d17];return _0x2440e2;};'use strict';var _=require(_0x90ab('0x0'));var util=require(_0x90ab('0x1'));var logger=require('../../config/logger')(_0x90ab('0x2'));var moment=require(_0x90ab('0x3'));var BPromise=require(_0x90ab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x90ab('0x5'));var rimraf=require(_0x90ab('0x6'));var config=require('../../config/environment');var attributes=require('./cmContactHasItem.attributes');module[_0x90ab('0x7')]=function(_0x4fc747,_0xe7ee49){return _0x4fc747[_0x90ab('0x8')]('CmContactHasItem',attributes,{'tableName':'cm_contact_has_items','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 f91ea27..6184660 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 _0x91fd=['message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','CmContactHasItem,\x20%s,\x20%s'];(function(_0x5b9d3a,_0x1f1842){var _0x383375=function(_0xd8fa11){while(--_0xd8fa11){_0x5b9d3a['push'](_0x5b9d3a['shift']());}};_0x383375(++_0x1f1842);}(_0x91fd,0x13e));var _0xd91f=function(_0x2904b5,_0x25d24a){_0x2904b5=_0x2904b5-0x0;var _0x237851=_0x91fd[_0x2904b5];return _0x237851;};'use strict';var _=require(_0xd91f('0x0'));var util=require('util');var moment=require(_0xd91f('0x1'));var BPromise=require(_0xd91f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd91f('0x3'));var db=require(_0xd91f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd91f('0x5'))(_0xd91f('0x6'));var config=require('../../config/environment');var jayson=require(_0xd91f('0x7'));var client=jayson[_0xd91f('0x8')][_0xd91f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x438d43,_0x2a0444,_0x118910){return new BPromise(function(_0x263a77,_0x578dae){return client[_0xd91f('0xa')](_0x438d43,_0x118910)[_0xd91f('0xb')](function(_0x365506){logger[_0xd91f('0xc')]('CmContactHasItem,\x20%s,\x20%s',_0x2a0444,_0xd91f('0xd'));logger[_0xd91f('0xe')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x2a0444,_0xd91f('0xd'),JSON[_0xd91f('0xf')](_0x365506));if(_0x365506[_0xd91f('0x10')]){if(_0x365506[_0xd91f('0x10')]['code']===0x1f4){logger[_0xd91f('0x10')](_0xd91f('0x11'),_0x2a0444,_0x365506[_0xd91f('0x10')][_0xd91f('0x12')]);return _0x578dae(_0x365506[_0xd91f('0x10')]['message']);}logger[_0xd91f('0x10')](_0xd91f('0x11'),_0x2a0444,_0x365506[_0xd91f('0x10')][_0xd91f('0x12')]);return _0x263a77(_0x365506[_0xd91f('0x10')][_0xd91f('0x12')]);}else{logger[_0xd91f('0xc')](_0xd91f('0x11'),_0x2a0444,_0xd91f('0xd'));_0x263a77(_0x365506[_0xd91f('0x13')][_0xd91f('0x12')]);}})[_0xd91f('0x14')](function(_0x2d626a){logger['error'](_0xd91f('0x11'),_0x2a0444,_0x2d626a);_0x578dae(_0x2d626a);});});} \ No newline at end of file +var _0x9d70=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s'];(function(_0x3b541f,_0x3e17ad){var _0x508723=function(_0x4ba2b2){while(--_0x4ba2b2){_0x3b541f['push'](_0x3b541f['shift']());}};_0x508723(++_0x3e17ad);}(_0x9d70,0x7e));var _0x09d7=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x9d70[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0x09d7('0x0'));var util=require(_0x09d7('0x1'));var moment=require('moment');var BPromise=require(_0x09d7('0x2'));var rs=require(_0x09d7('0x3'));var fs=require('fs');var Redis=require(_0x09d7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x09d7('0x5'));var logger=require(_0x09d7('0x6'))(_0x09d7('0x7'));var config=require(_0x09d7('0x8'));var jayson=require(_0x09d7('0x9'));var client=jayson[_0x09d7('0xa')][_0x09d7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x192fb7,_0x2bc70f,_0xd4eb){return new BPromise(function(_0xb1e187,_0x47a096){return client[_0x09d7('0xc')](_0x192fb7,_0xd4eb)[_0x09d7('0xd')](function(_0x2faf2f){logger[_0x09d7('0xe')](_0x09d7('0xf'),_0x2bc70f,_0x09d7('0x10'));logger['debug'](_0x09d7('0x11'),_0x2bc70f,_0x09d7('0x10'),JSON[_0x09d7('0x12')](_0x2faf2f));if(_0x2faf2f[_0x09d7('0x13')]){if(_0x2faf2f['error'][_0x09d7('0x14')]===0x1f4){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x2bc70f,_0x2faf2f[_0x09d7('0x13')][_0x09d7('0x15')]);return _0x47a096(_0x2faf2f[_0x09d7('0x13')]['message']);}logger[_0x09d7('0x13')]('CmContactHasItem,\x20%s,\x20%s',_0x2bc70f,_0x2faf2f[_0x09d7('0x13')]['message']);return _0xb1e187(_0x2faf2f[_0x09d7('0x13')]['message']);}else{logger[_0x09d7('0xe')](_0x09d7('0xf'),_0x2bc70f,'request\x20sent');_0xb1e187(_0x2faf2f[_0x09d7('0x16')][_0x09d7('0x15')]);}})[_0x09d7('0x17')](function(_0x22cb1e){logger[_0x09d7('0x13')]('CmContactHasItem,\x20%s,\x20%s',_0x2bc70f,_0x22cb1e);_0x47a096(_0x22cb1e);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index d77b8ef..fc0e0a1 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 _0x0cc3=['destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','/:id','isAuthenticated','create','put','update','delete'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x0cc3,0xa2));var _0x30cc=function(_0x1d59b6,_0x331646){_0x1d59b6=_0x1d59b6-0x0;var _0x42a4d4=_0x0cc3[_0x1d59b6];return _0x42a4d4;};'use strict';var multer=require('multer');var util=require(_0x30cc('0x0'));var path=require(_0x30cc('0x1'));var timeout=require('connect-timeout');var express=require(_0x30cc('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x30cc('0x3'));var interaction=require(_0x30cc('0x4'));var config=require(_0x30cc('0x5'));var controller=require(_0x30cc('0x6'));router[_0x30cc('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x30cc('0x7')](_0x30cc('0x8'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x30cc('0x9')](),controller[_0x30cc('0xa')]);router[_0x30cc('0xb')](_0x30cc('0x8'),auth[_0x30cc('0x9')](),controller[_0x30cc('0xc')]);router[_0x30cc('0xd')](_0x30cc('0x8'),auth['isAuthenticated'](),controller[_0x30cc('0xe')]);module[_0x30cc('0xf')]=router; \ No newline at end of file +var _0x5c7e=['path','connect-timeout','express','fs-extra','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','show','create','put','/:id','destroy','multer','util'];(function(_0x14f66b,_0x235110){var _0x1b866d=function(_0x40d02d){while(--_0x40d02d){_0x14f66b['push'](_0x14f66b['shift']());}};_0x1b866d(++_0x235110);}(_0x5c7e,0x16e));var _0xe5c7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5c7e[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xe5c7('0x0'));var util=require(_0xe5c7('0x1'));var path=require(_0xe5c7('0x2'));var timeout=require(_0xe5c7('0x3'));var express=require(_0xe5c7('0x4'));var router=express['Router']();var fs_extra=require(_0xe5c7('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe5c7('0x6'));var controller=require(_0xe5c7('0x7'));router[_0xe5c7('0x8')]('/',auth[_0xe5c7('0x9')](),controller[_0xe5c7('0xa')]);router[_0xe5c7('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xe5c7('0xb')]);router['post']('/',auth[_0xe5c7('0x9')](),controller[_0xe5c7('0xc')]);router[_0xe5c7('0xd')](_0xe5c7('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe5c7('0xe'),auth[_0xe5c7('0x9')](),controller[_0xe5c7('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 4553a0a..642e5b3 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 _0xbde0=['ENUM','voice','sequelize','lodash','getDataValue','STRING','setDataValue','alias','name','TEXT','type','select','parse','values','BOOLEAN'];(function(_0x4c6f32,_0x535f85){var _0x3bcf45=function(_0x526119){while(--_0x526119){_0x4c6f32['push'](_0x4c6f32['shift']());}};_0x3bcf45(++_0x535f85);}(_0xbde0,0x12e));var _0x0bde=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xbde0[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0x0bde('0x0'));var _=require(_0x0bde('0x1'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3ccf7a){return this[_0x0bde('0x2')]('alias');}},'alias':{'type':Sequelize[_0x0bde('0x3')],'allowNull':![],'set':function(_0x1d43f2){this[_0x0bde('0x4')](_0x0bde('0x5'),_0x1d43f2?_0x1d43f2:this[_0x0bde('0x2')](_0x0bde('0x6')));}},'type':{'type':Sequelize[_0x0bde('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0x0bde('0x7')]('long'),'get':function(){if(this['getDataValue'](_0x0bde('0x8'))===_0x0bde('0x9')){return JSON[_0x0bde('0xa')](this[_0x0bde('0x2')](_0x0bde('0xb')));}else{return this[_0x0bde('0x2')](_0x0bde('0xb'));}},'set':function(_0x2831c0){if(Array['isArray'](_0x2831c0)){this['setDataValue'](_0x0bde('0xb'),JSON['stringify'](_0x2831c0));}else{this[_0x0bde('0x4')](_0x0bde('0xb'),_0x2831c0);}}},'required':{'type':Sequelize[_0x0bde('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x0bde('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x0bde('0xd')](_0x0bde('0xe'))}}; \ No newline at end of file +var _0x91f9=['voice','exports','VIRTUAL','alias','STRING','setDataValue','long','type','select','parse','getDataValue','values','isArray','stringify','BOOLEAN','ENUM'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0x91f9,0xa1));var _0x991f=function(_0xd6aad,_0x3fd78e){_0xd6aad=_0xd6aad-0x0;var _0x1109e6=_0x91f9[_0xd6aad];return _0x1109e6;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x991f('0x0')]={'name':{'type':Sequelize[_0x991f('0x1')],'get':function(_0x4ffcd2){return this['getDataValue'](_0x991f('0x2'));}},'alias':{'type':Sequelize[_0x991f('0x3')],'allowNull':![],'set':function(_0x9129dc){this[_0x991f('0x4')](_0x991f('0x2'),_0x9129dc?_0x9129dc:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0x991f('0x3')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x991f('0x5')),'get':function(){if(this['getDataValue'](_0x991f('0x6'))===_0x991f('0x7')){return JSON[_0x991f('0x8')](this[_0x991f('0x9')](_0x991f('0xa')));}else{return this[_0x991f('0x9')](_0x991f('0xa'));}},'set':function(_0x139015){if(Array[_0x991f('0xb')](_0x139015)){this['setDataValue'](_0x991f('0xa'),JSON[_0x991f('0xc')](_0x139015));}else{this[_0x991f('0x4')]('values',_0x139015);}}},'required':{'type':Sequelize[_0x991f('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x991f('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x991f('0xe')](_0x991f('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index f001c62..044a42a 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 _0x73bd=['eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','CmCustomField','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','body','create','sequelize','transaction','Sequelize','TEXT','text','INTEGER','switch','queryInterface','addColumn','cm_contacts','format','cf_%d'];(function(_0x425be3,_0x78240c){var _0x214d5e=function(_0x54f85e){while(--_0x54f85e){_0x425be3['push'](_0x425be3['shift']());}};_0x214d5e(++_0x78240c);}(_0x73bd,0xf9));var _0xd73b=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x73bd[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0xd73b('0x0'));var rimraf=require(_0xd73b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd73b('0x2'));var moment=require(_0xd73b('0x3'));var BPromise=require(_0xd73b('0x4'));var Mustache=require(_0xd73b('0x5'));var util=require(_0xd73b('0x6'));var path=require(_0xd73b('0x7'));var sox=require(_0xd73b('0x8'));var csv=require(_0xd73b('0x9'));var ejs=require(_0xd73b('0xa'));var fs=require('fs');var fs_extra=require(_0xd73b('0xb'));var _=require('lodash');var squel=require(_0xd73b('0xc'));var crypto=require(_0xd73b('0xd'));var jsforce=require(_0xd73b('0xe'));var deskjs=require(_0xd73b('0xf'));var toCsv=require(_0xd73b('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd73b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd73b('0x11'));var hardwareService=require(_0xd73b('0x12'));var logger=require(_0xd73b('0x13'))(_0xd73b('0x14'));var utils=require(_0xd73b('0x15'));var config=require(_0xd73b('0x16'));var licenseUtil=require(_0xd73b('0x17'));var db=require(_0xd73b('0x18'))['db'];function respondWithStatusCode(_0x20f26f,_0x55c9be){_0x55c9be=_0x55c9be||0xcc;return function(_0xa53f82){if(_0xa53f82){return _0x20f26f[_0xd73b('0x19')](_0x55c9be);}return _0x20f26f[_0xd73b('0x1a')](_0x55c9be)[_0xd73b('0x1b')]();};}function respondWithResult(_0x1e0f21,_0x5e15a8){_0x5e15a8=_0x5e15a8||0xc8;return function(_0x4207b6){if(_0x4207b6){return _0x1e0f21['status'](_0x5e15a8)[_0xd73b('0x1c')](_0x4207b6);}};}function respondWithFilteredResult(_0x3d2286,_0x3b62f1){return function(_0xb845c0){if(_0xb845c0){var _0x403d2d=typeof _0x3b62f1[_0xd73b('0x1d')]===_0xd73b('0x1e')&&typeof _0x3b62f1[_0xd73b('0x1f')]===_0xd73b('0x1e');var _0x261600=_0xb845c0['count'];var _0xed74a=_0x403d2d?0x0:_0x3b62f1[_0xd73b('0x1d')];var _0x21d4af=_0x403d2d?_0xb845c0[_0xd73b('0x20')]:_0x3b62f1[_0xd73b('0x1d')]+_0x3b62f1[_0xd73b('0x1f')];var _0x9519de;if(_0x21d4af>=_0x261600){_0x21d4af=_0x261600;_0x9519de=0xc8;}else{_0x9519de=0xce;}_0x3d2286[_0xd73b('0x1a')](_0x9519de);return _0x3d2286['set'](_0xd73b('0x21'),_0xed74a+'-'+_0x21d4af+'/'+_0x261600)[_0xd73b('0x1c')](_0xb845c0);}return null;};}function patchUpdates(_0x179859){return function(_0x37f803){try{jsonpatch[_0xd73b('0x22')](_0x37f803,_0x179859,!![]);}catch(_0x46ed81){return BPromise[_0xd73b('0x23')](_0x46ed81);}return _0x37f803[_0xd73b('0x24')]();};}function saveUpdates(_0x21a4a0,_0xc6b276){return function(_0x6f1346){if(_0x6f1346){return _0x6f1346[_0xd73b('0x25')](_0x21a4a0)[_0xd73b('0x26')](function(_0xfb640c){return _0xfb640c;});}return null;};}function removeEntity(_0x18644f,_0x359995){return function(_0x1b7263){if(_0x1b7263){return _0x1b7263['destroy']()[_0xd73b('0x26')](function(){_0x18644f[_0xd73b('0x1a')](0xcc)[_0xd73b('0x1b')]();});}};}function handleEntityNotFound(_0x27fdb5,_0x56f40f){return function(_0x25b519){if(!_0x25b519){_0x27fdb5[_0xd73b('0x19')](0x194);}return _0x25b519;};}function handleError(_0x2d440b,_0x35454c){_0x35454c=_0x35454c||0x1f4;return function(_0xe5eb87){logger[_0xd73b('0x27')](_0xe5eb87[_0xd73b('0x28')]);if(_0xe5eb87['name']){delete _0xe5eb87[_0xd73b('0x29')];}_0x2d440b[_0xd73b('0x1a')](_0x35454c)[_0xd73b('0x2a')](_0xe5eb87);};}exports['index']=function(_0x37d382,_0x503496){var _0xd055d3={},_0x3ebf96={},_0x3d20d5={'count':0x0,'rows':[]};var _0x37180e=_['map'](db[_0xd73b('0x2b')][_0xd73b('0x2c')],function(_0x2d1fcc){return{'name':_0x2d1fcc['fieldName'],'type':_0x2d1fcc[_0xd73b('0x2d')]['key']};});_0x3ebf96[_0xd73b('0x2e')]=_['differenceBy'](_['map'](_0x37180e,_0xd73b('0x29')),['name']);_0x3ebf96[_0xd73b('0x2f')]=_[_0xd73b('0x30')](_0x37d382[_0xd73b('0x2f')]);_0x3ebf96[_0xd73b('0x31')]=_[_0xd73b('0x32')](_0x3ebf96[_0xd73b('0x2e')],_0x3ebf96[_0xd73b('0x2f')]);_0xd055d3[_0xd73b('0x33')]=_[_0xd73b('0x32')](_0x3ebf96[_0xd73b('0x2e')],qs[_0xd73b('0x34')](_0x37d382[_0xd73b('0x2f')][_0xd73b('0x34')]));_0xd055d3[_0xd73b('0x33')]=_0xd055d3[_0xd73b('0x33')][_0xd73b('0x35')]?_0xd055d3[_0xd73b('0x33')]:_0x3ebf96[_0xd73b('0x2e')];if(!_0x37d382[_0xd73b('0x2f')]['hasOwnProperty']('nolimit')){_0xd055d3['limit']=qs[_0xd73b('0x1f')](_0x37d382['query']['limit']);_0xd055d3[_0xd73b('0x1d')]=qs[_0xd73b('0x1d')](_0x37d382[_0xd73b('0x2f')][_0xd73b('0x1d')]);}_0xd055d3[_0xd73b('0x36')]=qs[_0xd73b('0x37')](_0x37d382['query'][_0xd73b('0x37')]);_0xd055d3[_0xd73b('0x38')]=qs[_0xd73b('0x31')](_['pick'](_0x37d382[_0xd73b('0x2f')],_0x3ebf96[_0xd73b('0x31')]),_0x37180e);if(_0x37d382[_0xd73b('0x2f')][_0xd73b('0x39')]){_0xd055d3[_0xd73b('0x38')]=_[_0xd73b('0x3a')](_0xd055d3[_0xd73b('0x38')],{'$or':_['map'](_0x37180e,function(_0x2901b4){if(_0x2901b4[_0xd73b('0x2d')]!==_0xd73b('0x3b')){var _0xd3d015={};_0xd3d015[_0x2901b4[_0xd73b('0x29')]]={'$like':'%'+_0x37d382['query']['filter']+'%'};return _0xd3d015;}})});}_0xd055d3=_[_0xd73b('0x3a')]({},_0xd055d3,_0x37d382[_0xd73b('0x3c')]);var _0x33ad47={'where':_0xd055d3['where']};return db[_0xd73b('0x2b')]['count'](_0x33ad47)[_0xd73b('0x26')](function(_0x141119){_0x3d20d5[_0xd73b('0x20')]=_0x141119;if(_0x37d382['query'][_0xd73b('0x3d')]){_0xd055d3[_0xd73b('0x3e')]=[{'all':!![]}];}return db[_0xd73b('0x2b')][_0xd73b('0x3f')](_0xd055d3);})[_0xd73b('0x26')](function(_0x3cd5c7){_0x3d20d5[_0xd73b('0x40')]=_0x3cd5c7;return _0x3d20d5;})['then'](respondWithFilteredResult(_0x503496,_0xd055d3))[_0xd73b('0x41')](handleError(_0x503496,null));};exports[_0xd73b('0x42')]=function(_0x27beea,_0x9a67b4){var _0xdf3739={'raw':!![],'where':{'id':_0x27beea[_0xd73b('0x43')]['id']}},_0x5f579d={};_0x5f579d[_0xd73b('0x2e')]=_[_0xd73b('0x30')](db[_0xd73b('0x2b')][_0xd73b('0x2c')]);_0x5f579d['query']=_['keys'](_0x27beea['query']);_0x5f579d['filters']=_[_0xd73b('0x32')](_0x5f579d['model'],_0x5f579d[_0xd73b('0x2f')]);_0xdf3739[_0xd73b('0x33')]=_[_0xd73b('0x32')](_0x5f579d['model'],qs[_0xd73b('0x34')](_0x27beea[_0xd73b('0x2f')][_0xd73b('0x34')]));_0xdf3739[_0xd73b('0x33')]=_0xdf3739['attributes'][_0xd73b('0x35')]?_0xdf3739['attributes']:_0x5f579d[_0xd73b('0x2e')];if(_0x27beea[_0xd73b('0x2f')][_0xd73b('0x3d')]){_0xdf3739['include']=[{'all':!![]}];}_0xdf3739=_[_0xd73b('0x3a')]({},_0xdf3739,_0x27beea['options']);return db[_0xd73b('0x2b')][_0xd73b('0x44')](_0xdf3739)[_0xd73b('0x26')](handleEntityNotFound(_0x9a67b4,null))[_0xd73b('0x26')](respondWithResult(_0x9a67b4,null))[_0xd73b('0x41')](handleError(_0x9a67b4,null));};exports[_0xd73b('0x25')]=function(_0x4052c4,_0x44c3a8){if(_0x4052c4['body']['id']){delete _0x4052c4[_0xd73b('0x45')]['id'];}return db[_0xd73b('0x2b')][_0xd73b('0x44')]({'where':{'id':_0x4052c4['params']['id']}})['then'](handleEntityNotFound(_0x44c3a8,null))[_0xd73b('0x26')](saveUpdates(_0x4052c4[_0xd73b('0x45')],null))['then'](respondWithResult(_0x44c3a8,null))[_0xd73b('0x41')](handleError(_0x44c3a8,null));};exports['destroy']=function(_0x14f497,_0x40c7e5){return db['CmCustomField'][_0xd73b('0x44')]({'where':{'id':_0x14f497[_0xd73b('0x43')]['id']}})[_0xd73b('0x26')](handleEntityNotFound(_0x40c7e5,null))['then'](removeEntity(_0x40c7e5,null))[_0xd73b('0x41')](handleError(_0x40c7e5,null));};exports[_0xd73b('0x46')]=function(_0xdbc16e,_0x3ab949){var _0x7c699f;return db[_0xd73b('0x47')][_0xd73b('0x48')](function(_0x111ee3){return db[_0xd73b('0x2b')][_0xd73b('0x46')](_0xdbc16e[_0xd73b('0x45')],{'transaction':_0x111ee3})['then'](function(_0x20acb6){_0x7c699f=_0x20acb6;var _0x136e94={'type':db[_0xd73b('0x49')][_0xd73b('0x4a')],'transaction':_0x111ee3};switch(_0xdbc16e[_0xd73b('0x45')]['type']){case _0xd73b('0x4b'):_0x136e94[_0xd73b('0x2d')]=db[_0xd73b('0x49')][_0xd73b('0x4a')];break;case'number':_0x136e94[_0xd73b('0x2d')]=db[_0xd73b('0x49')][_0xd73b('0x4c')];break;case _0xd73b('0x4d'):_0x136e94[_0xd73b('0x2d')]=db[_0xd73b('0x49')]['BOOLEAN'];_0x136e94['defaultValue']=![];break;default:}return db[_0xd73b('0x47')][_0xd73b('0x4e')][_0xd73b('0x4f')](_0xd73b('0x50'),util[_0xd73b('0x51')](_0xd73b('0x52'),_0x7c699f['id']),_0x136e94);})[_0xd73b('0x26')](function(){return _0x7c699f;});})['then'](respondWithResult(_0x3ab949,0xc9))[_0xd73b('0x41')](handleError(_0x3ab949,null));}; \ No newline at end of file +var _0x0650=['name','send','index','map','CmCustomField','rawAttributes','fieldName','differenceBy','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','create','sequelize','transaction','TEXT','text','Sequelize','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','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','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','end','error','stack'];(function(_0x78a4c9,_0x5f67d0){var _0x3abd9b=function(_0x5781e3){while(--_0x5781e3){_0x78a4c9['push'](_0x78a4c9['shift']());}};_0x3abd9b(++_0x5f67d0);}(_0x0650,0x1ed));var _0x0065=function(_0x421791,_0x3625d8){_0x421791=_0x421791-0x0;var _0x495838=_0x0650[_0x421791];return _0x495838;};'use strict';var emlformat=require(_0x0065('0x0'));var rimraf=require(_0x0065('0x1'));var zipdir=require(_0x0065('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0065('0x3'));var moment=require(_0x0065('0x4'));var BPromise=require(_0x0065('0x5'));var Mustache=require('mustache');var util=require(_0x0065('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0065('0x7'));var ejs=require(_0x0065('0x8'));var fs=require('fs');var fs_extra=require(_0x0065('0x9'));var _=require(_0x0065('0xa'));var squel=require('squel');var crypto=require(_0x0065('0xb'));var jsforce=require(_0x0065('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0065('0xd'));var Redis=require(_0x0065('0xe'));var authService=require(_0x0065('0xf'));var qs=require(_0x0065('0x10'));var as=require(_0x0065('0x11'));var hardwareService=require(_0x0065('0x12'));var logger=require('../../config/logger')(_0x0065('0x13'));var utils=require(_0x0065('0x14'));var config=require(_0x0065('0x15'));var licenseUtil=require(_0x0065('0x16'));var db=require(_0x0065('0x17'))['db'];function respondWithStatusCode(_0x1d3856,_0x440df3){_0x440df3=_0x440df3||0xcc;return function(_0x4d4c91){if(_0x4d4c91){return _0x1d3856[_0x0065('0x18')](_0x440df3);}return _0x1d3856[_0x0065('0x19')](_0x440df3)['end']();};}function respondWithResult(_0x52d4da,_0x13d8b8){_0x13d8b8=_0x13d8b8||0xc8;return function(_0x5a5856){if(_0x5a5856){return _0x52d4da['status'](_0x13d8b8)['json'](_0x5a5856);}};}function respondWithFilteredResult(_0x5042ab,_0xba4299){return function(_0x1b7b24){if(_0x1b7b24){var _0x466fe4=typeof _0xba4299[_0x0065('0x1a')]===_0x0065('0x1b')&&typeof _0xba4299['limit']===_0x0065('0x1b');var _0x2af9bb=_0x1b7b24[_0x0065('0x1c')];var _0xddac63=_0x466fe4?0x0:_0xba4299['offset'];var _0x2001ed=_0x466fe4?_0x1b7b24[_0x0065('0x1c')]:_0xba4299[_0x0065('0x1a')]+_0xba4299[_0x0065('0x1d')];var _0x5290d6;if(_0x2001ed>=_0x2af9bb){_0x2001ed=_0x2af9bb;_0x5290d6=0xc8;}else{_0x5290d6=0xce;}_0x5042ab['status'](_0x5290d6);return _0x5042ab[_0x0065('0x1e')]('Content-Range',_0xddac63+'-'+_0x2001ed+'/'+_0x2af9bb)[_0x0065('0x1f')](_0x1b7b24);}return null;};}function patchUpdates(_0x2bee5a){return function(_0x4b4386){try{jsonpatch[_0x0065('0x20')](_0x4b4386,_0x2bee5a,!![]);}catch(_0x2b61db){return BPromise[_0x0065('0x21')](_0x2b61db);}return _0x4b4386[_0x0065('0x22')]();};}function saveUpdates(_0x2768ad,_0x58d195){return function(_0x3ec487){if(_0x3ec487){return _0x3ec487[_0x0065('0x23')](_0x2768ad)[_0x0065('0x24')](function(_0xbf2fc8){return _0xbf2fc8;});}return null;};}function removeEntity(_0x5020eb,_0x5c7b9a){return function(_0x4e0dfe){if(_0x4e0dfe){return _0x4e0dfe[_0x0065('0x25')]()[_0x0065('0x24')](function(){_0x5020eb[_0x0065('0x19')](0xcc)[_0x0065('0x26')]();});}};}function handleEntityNotFound(_0x95be27,_0x236d00){return function(_0x15966d){if(!_0x15966d){_0x95be27['sendStatus'](0x194);}return _0x15966d;};}function handleError(_0x34ee33,_0x3d8c40){_0x3d8c40=_0x3d8c40||0x1f4;return function(_0x56d9bf){logger[_0x0065('0x27')](_0x56d9bf[_0x0065('0x28')]);if(_0x56d9bf[_0x0065('0x29')]){delete _0x56d9bf[_0x0065('0x29')];}_0x34ee33[_0x0065('0x19')](_0x3d8c40)[_0x0065('0x2a')](_0x56d9bf);};}exports[_0x0065('0x2b')]=function(_0x447bb0,_0x26c9c3){var _0x45a695={},_0x453228={},_0x4852c1={'count':0x0,'rows':[]};var _0x3fbf4d=_[_0x0065('0x2c')](db[_0x0065('0x2d')][_0x0065('0x2e')],function(_0x272dfe){return{'name':_0x272dfe[_0x0065('0x2f')],'type':_0x272dfe['type']['key']};});_0x453228['model']=_[_0x0065('0x30')](_[_0x0065('0x2c')](_0x3fbf4d,_0x0065('0x29')),[_0x0065('0x29')]);_0x453228[_0x0065('0x31')]=_['keys'](_0x447bb0[_0x0065('0x31')]);_0x453228[_0x0065('0x32')]=_['intersection'](_0x453228[_0x0065('0x33')],_0x453228[_0x0065('0x31')]);_0x45a695[_0x0065('0x34')]=_[_0x0065('0x35')](_0x453228[_0x0065('0x33')],qs['fields'](_0x447bb0[_0x0065('0x31')][_0x0065('0x36')]));_0x45a695[_0x0065('0x34')]=_0x45a695[_0x0065('0x34')][_0x0065('0x37')]?_0x45a695[_0x0065('0x34')]:_0x453228[_0x0065('0x33')];if(!_0x447bb0[_0x0065('0x31')][_0x0065('0x38')](_0x0065('0x39'))){_0x45a695['limit']=qs[_0x0065('0x1d')](_0x447bb0['query'][_0x0065('0x1d')]);_0x45a695[_0x0065('0x1a')]=qs[_0x0065('0x1a')](_0x447bb0[_0x0065('0x31')]['offset']);}_0x45a695[_0x0065('0x3a')]=qs['sort'](_0x447bb0[_0x0065('0x31')][_0x0065('0x3b')]);_0x45a695[_0x0065('0x3c')]=qs[_0x0065('0x32')](_[_0x0065('0x3d')](_0x447bb0[_0x0065('0x31')],_0x453228[_0x0065('0x32')]),_0x3fbf4d);if(_0x447bb0['query'][_0x0065('0x3e')]){_0x45a695[_0x0065('0x3c')]=_['merge'](_0x45a695[_0x0065('0x3c')],{'$or':_['map'](_0x3fbf4d,function(_0x131117){if(_0x131117[_0x0065('0x3f')]!==_0x0065('0x40')){var _0x8f4689={};_0x8f4689[_0x131117['name']]={'$like':'%'+_0x447bb0[_0x0065('0x31')][_0x0065('0x3e')]+'%'};return _0x8f4689;}})});}_0x45a695=_[_0x0065('0x41')]({},_0x45a695,_0x447bb0[_0x0065('0x42')]);var _0x1a16b3={'where':_0x45a695[_0x0065('0x3c')]};return db['CmCustomField'][_0x0065('0x1c')](_0x1a16b3)[_0x0065('0x24')](function(_0x47480f){_0x4852c1[_0x0065('0x1c')]=_0x47480f;if(_0x447bb0[_0x0065('0x31')][_0x0065('0x43')]){_0x45a695[_0x0065('0x44')]=[{'all':!![]}];}return db[_0x0065('0x2d')][_0x0065('0x45')](_0x45a695);})[_0x0065('0x24')](function(_0x48120d){_0x4852c1[_0x0065('0x46')]=_0x48120d;return _0x4852c1;})[_0x0065('0x24')](respondWithFilteredResult(_0x26c9c3,_0x45a695))[_0x0065('0x47')](handleError(_0x26c9c3,null));};exports['show']=function(_0x53bad5,_0x551be0){var _0x48b320={'raw':!![],'where':{'id':_0x53bad5[_0x0065('0x48')]['id']}},_0x1b4ee9={};_0x1b4ee9[_0x0065('0x33')]=_['keys'](db['CmCustomField'][_0x0065('0x2e')]);_0x1b4ee9[_0x0065('0x31')]=_[_0x0065('0x49')](_0x53bad5['query']);_0x1b4ee9[_0x0065('0x32')]=_['intersection'](_0x1b4ee9[_0x0065('0x33')],_0x1b4ee9[_0x0065('0x31')]);_0x48b320[_0x0065('0x34')]=_['intersection'](_0x1b4ee9[_0x0065('0x33')],qs[_0x0065('0x36')](_0x53bad5['query'][_0x0065('0x36')]));_0x48b320['attributes']=_0x48b320[_0x0065('0x34')][_0x0065('0x37')]?_0x48b320['attributes']:_0x1b4ee9[_0x0065('0x33')];if(_0x53bad5['query'][_0x0065('0x43')]){_0x48b320['include']=[{'all':!![]}];}_0x48b320=_[_0x0065('0x41')]({},_0x48b320,_0x53bad5[_0x0065('0x42')]);return db[_0x0065('0x2d')][_0x0065('0x4a')](_0x48b320)[_0x0065('0x24')](handleEntityNotFound(_0x551be0,null))[_0x0065('0x24')](respondWithResult(_0x551be0,null))[_0x0065('0x47')](handleError(_0x551be0,null));};exports[_0x0065('0x23')]=function(_0x46afa1,_0x52a709){if(_0x46afa1[_0x0065('0x4b')]['id']){delete _0x46afa1[_0x0065('0x4b')]['id'];}return db[_0x0065('0x2d')][_0x0065('0x4a')]({'where':{'id':_0x46afa1['params']['id']}})[_0x0065('0x24')](handleEntityNotFound(_0x52a709,null))[_0x0065('0x24')](saveUpdates(_0x46afa1[_0x0065('0x4b')],null))[_0x0065('0x24')](respondWithResult(_0x52a709,null))['catch'](handleError(_0x52a709,null));};exports[_0x0065('0x25')]=function(_0x5076ea,_0x30446b){return db['CmCustomField'][_0x0065('0x4a')]({'where':{'id':_0x5076ea[_0x0065('0x48')]['id']}})[_0x0065('0x24')](handleEntityNotFound(_0x30446b,null))[_0x0065('0x24')](removeEntity(_0x30446b,null))['catch'](handleError(_0x30446b,null));};exports[_0x0065('0x4c')]=function(_0x1b23ef,_0x303f3c){var _0x3ac273;return db[_0x0065('0x4d')][_0x0065('0x4e')](function(_0x442af3){return db['CmCustomField'][_0x0065('0x4c')](_0x1b23ef[_0x0065('0x4b')],{'transaction':_0x442af3})[_0x0065('0x24')](function(_0x5d5fad){_0x3ac273=_0x5d5fad;var _0x1c0c46={'type':db['Sequelize'][_0x0065('0x4f')],'transaction':_0x442af3};switch(_0x1b23ef[_0x0065('0x4b')][_0x0065('0x3f')]){case _0x0065('0x50'):_0x1c0c46['type']=db[_0x0065('0x51')]['TEXT'];break;case _0x0065('0x52'):_0x1c0c46[_0x0065('0x3f')]=db[_0x0065('0x51')][_0x0065('0x53')];break;case'switch':_0x1c0c46['type']=db[_0x0065('0x51')][_0x0065('0x54')];_0x1c0c46[_0x0065('0x55')]=![];break;default:}return db['sequelize'][_0x0065('0x56')][_0x0065('0x57')]('cm_contacts',util[_0x0065('0x58')]('cf_%d',_0x3ac273['id']),_0x1c0c46);})[_0x0065('0x24')](function(){return _0x3ac273;});})[_0x0065('0x24')](respondWithResult(_0x303f3c,0xc9))[_0x0065('0x47')](handleError(_0x303f3c,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 2c45ca8..aa42f4d 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 _0x083f=['bluebird','request-promise','rimraf','../../config/environment','./cmCustomField.attributes','define','cm_custom_fields','moment'];(function(_0x588011,_0x5e9d11){var _0x3b3773=function(_0x4cca54){while(--_0x4cca54){_0x588011['push'](_0x588011['shift']());}};_0x3b3773(++_0x5e9d11);}(_0x083f,0x15f));var _0xf083=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x083f[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf083('0x0'));var BPromise=require(_0xf083('0x1'));var rp=require(_0xf083('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf083('0x3'));var config=require(_0xf083('0x4'));var attributes=require(_0xf083('0x5'));module['exports']=function(_0x5172fe,_0x2bd8e2){return _0x5172fe[_0xf083('0x6')]('CmCustomField',attributes,{'tableName':_0xf083('0x7'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55a2=['lodash','util','../../config/logger','api','moment','path','rimraf','exports','cm_custom_fields'];(function(_0xb1b481,_0x337b26){var _0x2433d2=function(_0x5c8bdf){while(--_0x5c8bdf){_0xb1b481['push'](_0xb1b481['shift']());}};_0x2433d2(++_0x337b26);}(_0x55a2,0xf3));var _0x255a=function(_0x1db251,_0xf0443d){_0x1db251=_0x1db251-0x0;var _0x56685a=_0x55a2[_0x1db251];return _0x56685a;};'use strict';var _=require(_0x255a('0x0'));var util=require(_0x255a('0x1'));var logger=require(_0x255a('0x2'))(_0x255a('0x3'));var moment=require(_0x255a('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x255a('0x5'));var rimraf=require(_0x255a('0x6'));var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module[_0x255a('0x7')]=function(_0x2addb1,_0x1118c1){return _0x2addb1['define']('CmCustomField',attributes,{'tableName':_0x255a('0x8'),'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 3790b56..76bc97f 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 _0x186f=['jayson/promise','http','request','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x24e40d,_0x379ad2){var _0x368bf3=function(_0x2d1ff4){while(--_0x2d1ff4){_0x24e40d['push'](_0x24e40d['shift']());}};_0x368bf3(++_0x379ad2);}(_0x186f,0x70));var _0xf186=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x186f[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0xf186('0x0'));var util=require('util');var moment=require(_0xf186('0x1'));var BPromise=require(_0xf186('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf186('0x3'));var db=require(_0xf186('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf186('0x5'))(_0xf186('0x6'));var config=require(_0xf186('0x7'));var jayson=require(_0xf186('0x8'));var client=jayson['client'][_0xf186('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x306aea,_0x4b9ed0,_0x486e55){return new BPromise(function(_0x574546,_0x21bf6f){return client[_0xf186('0xa')](_0x306aea,_0x486e55)['then'](function(_0x58dec2){logger[_0xf186('0xb')]('CmCustomField,\x20%s,\x20%s',_0x4b9ed0,_0xf186('0xc'));logger[_0xf186('0xd')](_0xf186('0xe'),_0x4b9ed0,_0xf186('0xc'),JSON['stringify'](_0x58dec2));if(_0x58dec2['error']){if(_0x58dec2[_0xf186('0xf')]['code']===0x1f4){logger[_0xf186('0xf')](_0xf186('0x10'),_0x4b9ed0,_0x58dec2['error']['message']);return _0x21bf6f(_0x58dec2[_0xf186('0xf')][_0xf186('0x11')]);}logger[_0xf186('0xf')](_0xf186('0x10'),_0x4b9ed0,_0x58dec2['error']['message']);return _0x574546(_0x58dec2[_0xf186('0xf')][_0xf186('0x11')]);}else{logger[_0xf186('0xb')]('CmCustomField,\x20%s,\x20%s',_0x4b9ed0,_0xf186('0xc'));_0x574546(_0x58dec2[_0xf186('0x12')][_0xf186('0x11')]);}})[_0xf186('0x13')](function(_0x591430){logger[_0xf186('0xf')](_0xf186('0x10'),_0x4b9ed0,_0x591430);_0x21bf6f(_0x591430);});});} \ No newline at end of file +var _0x60fa=['error','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s'];(function(_0x4bc4f6,_0x46272d){var _0x226260=function(_0x44ae52){while(--_0x44ae52){_0x4bc4f6['push'](_0x4bc4f6['shift']());}};_0x226260(++_0x46272d);}(_0x60fa,0x149));var _0xa60f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x60fa[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa60f('0x0'));var util=require(_0xa60f('0x1'));var moment=require('moment');var BPromise=require(_0xa60f('0x2'));var rs=require(_0xa60f('0x3'));var fs=require('fs');var Redis=require(_0xa60f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa60f('0x5'));var logger=require('../../config/logger')(_0xa60f('0x6'));var config=require(_0xa60f('0x7'));var jayson=require(_0xa60f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3aa638,_0x3c7918,_0x5bc108){return new BPromise(function(_0x8975dc,_0x2a2705){return client['request'](_0x3aa638,_0x5bc108)[_0xa60f('0x9')](function(_0x194256){logger[_0xa60f('0xa')]('CmCustomField,\x20%s,\x20%s',_0x3c7918,_0xa60f('0xb'));logger['debug'](_0xa60f('0xc'),_0x3c7918,_0xa60f('0xb'),JSON['stringify'](_0x194256));if(_0x194256[_0xa60f('0xd')]){if(_0x194256['error']['code']===0x1f4){logger[_0xa60f('0xd')](_0xa60f('0xe'),_0x3c7918,_0x194256[_0xa60f('0xd')][_0xa60f('0xf')]);return _0x2a2705(_0x194256['error']['message']);}logger[_0xa60f('0xd')](_0xa60f('0xe'),_0x3c7918,_0x194256[_0xa60f('0xd')][_0xa60f('0xf')]);return _0x8975dc(_0x194256[_0xa60f('0xd')][_0xa60f('0xf')]);}else{logger['info']('CmCustomField,\x20%s,\x20%s',_0x3c7918,'request\x20sent');_0x8975dc(_0x194256[_0xa60f('0x10')][_0xa60f('0xf')]);}})[_0xa60f('0x11')](function(_0x4626e2){logger[_0xa60f('0xd')](_0xa60f('0xe'),_0x3c7918,_0x4626e2);_0x2a2705(_0x4626e2);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 32271f8..4b14afa 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 _0xf873=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util','path'];(function(_0x374ada,_0x27b3a5){var _0x449ed8=function(_0x3efc46){while(--_0x3efc46){_0x374ada['push'](_0x374ada['shift']());}};_0x449ed8(++_0x27b3a5);}(_0xf873,0xb2));var _0x3f87=function(_0x3066c0,_0x58b8ce){_0x3066c0=_0x3066c0-0x0;var _0x5612b7=_0xf873[_0x3066c0];return _0x5612b7;};'use strict';var multer=require('multer');var util=require(_0x3f87('0x0'));var path=require(_0x3f87('0x1'));var timeout=require(_0x3f87('0x2'));var express=require(_0x3f87('0x3'));var router=express[_0x3f87('0x4')]();var fs_extra=require(_0x3f87('0x5'));var auth=require(_0x3f87('0x6'));var interaction=require(_0x3f87('0x7'));var config=require(_0x3f87('0x8'));var controller=require('./cmCustomField.controller');router[_0x3f87('0x9')]('/',auth[_0x3f87('0xa')](),controller[_0x3f87('0xb')]);router['get'](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller[_0x3f87('0xd')]);router[_0x3f87('0xe')]('/',auth[_0x3f87('0xa')](),controller[_0x3f87('0xf')]);router['put'](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x10')]);router[_0x3f87('0x11')](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x12')]);module[_0x3f87('0x13')]=router; \ No newline at end of file +var _0x3de2=['../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x246bcc,_0x4051a2){var _0x2e5f50=function(_0x1e118f){while(--_0x1e118f){_0x246bcc['push'](_0x246bcc['shift']());}};_0x2e5f50(++_0x4051a2);}(_0x3de2,0x79));var _0x23de=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x3de2[_0x1762b4];return _0x29beda;};'use strict';var multer=require(_0x23de('0x0'));var util=require('util');var path=require(_0x23de('0x1'));var timeout=require(_0x23de('0x2'));var express=require(_0x23de('0x3'));var router=express[_0x23de('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x23de('0x5'));var config=require(_0x23de('0x6'));var controller=require(_0x23de('0x7'));router[_0x23de('0x8')]('/',auth['isAuthenticated'](),controller[_0x23de('0x9')]);router['get'](_0x23de('0xa'),auth[_0x23de('0xb')](),controller[_0x23de('0xc')]);router[_0x23de('0xd')]('/',auth[_0x23de('0xb')](),controller[_0x23de('0xe')]);router[_0x23de('0xf')]('/:id',auth[_0x23de('0xb')](),controller['update']);router[_0x23de('0x10')](_0x23de('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x23de('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 260838e..23dc2ab 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 _0x758b=['STRING','BOOLEAN','DATE','format','INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x210d7f,_0x2abe4f){var _0x42d687=function(_0x46b2ae){while(--_0x46b2ae){_0x210d7f['push'](_0x210d7f['shift']());}};_0x42d687(++_0x2abe4f);}(_0x758b,0x96));var _0xb758=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x758b[_0x2a6809];return _0x11c371;};'use strict';var moment=require(_0xb758('0x0'));var Sequelize=require(_0xb758('0x1'));module[_0xb758('0x2')]={'phone':{'type':Sequelize[_0xb758('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xb758('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xb758('0x5')],'defaultValue':moment()[_0xb758('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xb758('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb758('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xb758('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb758('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb758('0x5')]},'priority':{'type':Sequelize[_0xb758('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xb758('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xb758('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xb758('0x7')],'unique':_0xb758('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xb758('0x7')],'unique':_0xb758('0x8')},'CampaignId':{'type':Sequelize[_0xb758('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xb758('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb758('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb758('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xb758('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xb758('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0xb758('0x5')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xc6b2=['UNSIGNED','contactListQueue','sequelize','exports','STRING','BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x583636,_0x8ba17e){var _0x5cc9d0=function(_0x3c9c60){while(--_0x3c9c60){_0x583636['push'](_0x583636['shift']());}};_0x5cc9d0(++_0x8ba17e);}(_0xc6b2,0x12b));var _0x2c6b=function(_0x531e62,_0x1dbb03){_0x531e62=_0x531e62-0x0;var _0x45b806=_0xc6b2[_0x531e62];return _0x45b806;};'use strict';var moment=require('moment');var Sequelize=require(_0x2c6b('0x0'));module[_0x2c6b('0x1')]={'phone':{'type':Sequelize[_0x2c6b('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x2c6b('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x2c6b('0x4')],'defaultValue':moment()['format'](_0x2c6b('0x5'))},'countbusyretry':{'type':Sequelize[_0x2c6b('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2c6b('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2c6b('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x2c6b('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2c6b('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x2c6b('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x2c6b('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x2c6b('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x2c6b('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x2c6b('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x2c6b('0x8')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x2c6b('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x2c6b('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x2c6b('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x2c6b('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x2c6b('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x2c6b('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x2c6b('0x4')],'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 1d2de9c..113f339 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 _0x0bde=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','CmHopper','rows','show','params','options','catch','create','body','find','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','user','deletedat','calleridnum','phone','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','dialPreviewAutoRecallMe','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','sequelize','COALESCE(CmHopper.UserId,\x200)\x20ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','Queue','dialActive','scheduledat','getOpenContacts','outbound','preview','format','YYYY-MM-DD\x20HH:mm:ss','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','lodash','../../config/logger','api','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','Content-Range','update','then','sendStatus','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','intersection','filters','$and','$or','$gt','$gte','$lt','$lte','$ne','$between','$notBetween','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','attributes','fields'];(function(_0x5447aa,_0x3afc00){var _0xb21e53=function(_0x2d05f6){while(--_0x2d05f6){_0x5447aa['push'](_0x5447aa['shift']());}};_0xb21e53(++_0x3afc00);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require('moment');var _=require(_0xe0bd('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0xe0bd('0x1'))(_0xe0bd('0x2'));var shared=require(_0xe0bd('0x3'));var db=require(_0xe0bd('0x4'))['db'];function respondWithResult(_0x2da4bd,_0x5541b9){_0x5541b9=_0x5541b9||0xc8;return function(_0x34df88){if(_0x34df88){return _0x2da4bd[_0xe0bd('0x5')](_0x5541b9)[_0xe0bd('0x6')](_0x34df88);}};}function respondWithFilteredResult(_0x3b712a,_0x22bfd1){return function(_0x26393f){if(_0x26393f){var _0x217145=typeof _0x22bfd1['offset']===_0xe0bd('0x7')&&typeof _0x22bfd1[_0xe0bd('0x8')]===_0xe0bd('0x7');var _0x2d32c6=_0x26393f[_0xe0bd('0x9')];var _0x3c47c4=_0x217145?0x0:_0x22bfd1[_0xe0bd('0xa')];var _0x58d892=_0x217145?_0x26393f['count']:_0x22bfd1['offset']+_0x22bfd1['limit'];var _0x44ffa9;if(_0x58d892>=_0x2d32c6){_0x58d892=_0x2d32c6;_0x44ffa9=0xc8;}else{_0x44ffa9=0xce;}_0x3b712a['status'](_0x44ffa9);return _0x3b712a['set'](_0xe0bd('0xb'),_0x3c47c4+'-'+_0x58d892+'/'+_0x2d32c6)[_0xe0bd('0x6')](_0x26393f);}return null;};}function saveUpdates(_0x54d40e,_0xc492b4){return function(_0x5272ca){if(_0x5272ca){return _0x5272ca[_0xe0bd('0xc')](_0x54d40e)[_0xe0bd('0xd')](function(_0x3b2fb1){return _0x3b2fb1;});}return null;};}function handleEntityNotFound(_0x20ab47,_0x47664e){return function(_0x335f17){if(!_0x335f17){_0x20ab47[_0xe0bd('0xe')](0x194);}return _0x335f17;};}function handleError(_0x210f20,_0x4f63fa){_0x4f63fa=_0x4f63fa||0x1f4;return function(_0x50891d){logger['error'](_0x50891d[_0xe0bd('0xf')]);if(_0x50891d[_0xe0bd('0x10')]){delete _0x50891d[_0xe0bd('0x10')];}_0x210f20[_0xe0bd('0x5')](_0x4f63fa)[_0xe0bd('0x11')](_0x50891d);};}exports['index']=function(_0x4ebe7a,_0x1becc8){var _0x4ac920={},_0x4f36f7={},_0x418d64={'count':0x0,'rows':[]};var _0xec158d=_[_0xe0bd('0x12')](db['CmHopper'][_0xe0bd('0x13')],function(_0xe1d808){return{'name':_0xe1d808[_0xe0bd('0x14')],'type':_0xe1d808['type'][_0xe0bd('0x15')]};});_0x4f36f7[_0xe0bd('0x16')]=_[_0xe0bd('0x12')](_0xec158d,'name');_0x4f36f7[_0xe0bd('0x17')]=_[_0xe0bd('0x18')](_0x4ebe7a[_0xe0bd('0x17')]);_0x4f36f7['filters']=_[_0xe0bd('0x19')](_0x4f36f7['model'],_0x4f36f7[_0xe0bd('0x17')]);_0x4f36f7[_0xe0bd('0x1a')]=_['concat'](_0x4f36f7[_0xe0bd('0x1a')],[_0xe0bd('0x1b'),_0xe0bd('0x1c'),_0xe0bd('0x1d'),_0xe0bd('0x1e'),_0xe0bd('0x1f'),_0xe0bd('0x20'),_0xe0bd('0x21'),'$eq','$not',_0xe0bd('0x22'),_0xe0bd('0x23'),'$in','$notIn',_0xe0bd('0x24'),_0xe0bd('0x25'),_0xe0bd('0x26'),_0xe0bd('0x27'),'$like',_0xe0bd('0x28'),'$contains',_0xe0bd('0x29'),_0xe0bd('0x2a')]);_0x4ac920[_0xe0bd('0x2b')]=_[_0xe0bd('0x19')](_0x4f36f7[_0xe0bd('0x16')],qs[_0xe0bd('0x2c')](_0x4ebe7a[_0xe0bd('0x17')][_0xe0bd('0x2c')]));_0x4ac920[_0xe0bd('0x2b')]=_0x4ac920[_0xe0bd('0x2b')][_0xe0bd('0x2d')]?_0x4ac920[_0xe0bd('0x2b')]:_0x4f36f7[_0xe0bd('0x16')];if(!_0x4ebe7a['query'][_0xe0bd('0x2e')](_0xe0bd('0x2f'))){_0x4ac920[_0xe0bd('0x8')]=qs[_0xe0bd('0x8')](_0x4ebe7a[_0xe0bd('0x17')][_0xe0bd('0x8')]);_0x4ac920['offset']=qs['offset'](_0x4ebe7a[_0xe0bd('0x17')][_0xe0bd('0xa')]);}_0x4ac920[_0xe0bd('0x30')]=qs[_0xe0bd('0x31')](_0x4ebe7a[_0xe0bd('0x17')][_0xe0bd('0x31')]);_0x4ac920[_0xe0bd('0x32')]=qs['filters'](_[_0xe0bd('0x33')](_0x4ebe7a[_0xe0bd('0x17')],_0x4f36f7[_0xe0bd('0x1a')]),_0xec158d);if(_0x4ebe7a[_0xe0bd('0x17')][_0xe0bd('0x34')]){_0x4ac920[_0xe0bd('0x32')]=_['merge'](_0x4ac920[_0xe0bd('0x32')],{'$or':_[_0xe0bd('0x12')](_0xec158d,function(_0x24b857){if(_0x24b857[_0xe0bd('0x35')]!==_0xe0bd('0x36')){var _0x5881e5={};_0x5881e5[_0x24b857['name']]={'$like':'%'+_0x4ebe7a[_0xe0bd('0x17')][_0xe0bd('0x34')]+'%'};return _0x5881e5;}})});}_0x4ac920=_[_0xe0bd('0x37')]({},_0x4ac920,_0x4ebe7a['options']);var _0x8a331={'where':_0x4ac920['where']};return db['CmHopper'][_0xe0bd('0x9')](_0x8a331)[_0xe0bd('0xd')](function(_0x4d8695){_0x418d64['count']=_0x4d8695;if(_0x4ebe7a['query'][_0xe0bd('0x38')]){_0x4ac920[_0xe0bd('0x39')]=[{'all':!![]}];}return db[_0xe0bd('0x3a')]['findAll'](_0x4ac920);})[_0xe0bd('0xd')](function(_0x2b4814){_0x418d64[_0xe0bd('0x3b')]=_0x2b4814;return _0x418d64;})['then'](respondWithFilteredResult(_0x1becc8,_0x4ac920))['catch'](handleError(_0x1becc8,null));};exports[_0xe0bd('0x3c')]=function(_0x4e5247,_0x1eba8b){var _0x195f0f={'raw':!![],'where':{'id':_0x4e5247[_0xe0bd('0x3d')]['id']}},_0x5aee49={};_0x5aee49[_0xe0bd('0x16')]=_[_0xe0bd('0x18')](db[_0xe0bd('0x3a')][_0xe0bd('0x13')]);_0x5aee49[_0xe0bd('0x17')]=_[_0xe0bd('0x18')](_0x4e5247['query']);_0x5aee49[_0xe0bd('0x1a')]=_[_0xe0bd('0x19')](_0x5aee49[_0xe0bd('0x16')],_0x5aee49[_0xe0bd('0x17')]);_0x195f0f[_0xe0bd('0x2b')]=_['intersection'](_0x5aee49['model'],qs['fields'](_0x4e5247[_0xe0bd('0x17')][_0xe0bd('0x2c')]));_0x195f0f[_0xe0bd('0x2b')]=_0x195f0f[_0xe0bd('0x2b')]['length']?_0x195f0f['attributes']:_0x5aee49[_0xe0bd('0x16')];if(_0x4e5247[_0xe0bd('0x17')][_0xe0bd('0x38')]){_0x195f0f[_0xe0bd('0x39')]=[{'all':!![]}];}_0x195f0f=_[_0xe0bd('0x37')]({},_0x195f0f,_0x4e5247[_0xe0bd('0x3e')]);return db[_0xe0bd('0x3a')]['find'](_0x195f0f)[_0xe0bd('0xd')](handleEntityNotFound(_0x1eba8b,null))['then'](respondWithResult(_0x1eba8b,null))[_0xe0bd('0x3f')](handleError(_0x1eba8b,null));};exports[_0xe0bd('0x40')]=function(_0x507876,_0x4cfad0){return db[_0xe0bd('0x3a')][_0xe0bd('0x40')](_0x507876[_0xe0bd('0x41')],{})[_0xe0bd('0xd')](respondWithResult(_0x4cfad0,0xc9))[_0xe0bd('0x3f')](handleError(_0x4cfad0,null));};exports[_0xe0bd('0xc')]=function(_0x368549,_0x37f9ea){if(_0x368549[_0xe0bd('0x41')]['id']){delete _0x368549['body']['id'];}return db[_0xe0bd('0x3a')][_0xe0bd('0x42')]({'where':{'id':_0x368549[_0xe0bd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x37f9ea,null))[_0xe0bd('0xd')](saveUpdates(_0x368549[_0xe0bd('0x41')],null))['then'](respondWithResult(_0x37f9ea,null))[_0xe0bd('0x3f')](handleError(_0x37f9ea,null));};exports[_0xe0bd('0x43')]=function(_0x578792,_0xd14c1d){return db[_0xe0bd('0x3a')][_0xe0bd('0x43')]()['then'](respondWithResult(_0xd14c1d,null))[_0xe0bd('0x3f')](handleError(_0xd14c1d,null));};exports[_0xe0bd('0x44')]=function(_0x147438,_0x21ae20){var _0x119d5c;var _0x2eff0d=_0x147438[_0xe0bd('0x3d')]['id'];return db[_0xe0bd('0x3a')][_0xe0bd('0x42')]({'where':{'id':_0x147438['params']['id']}})['then'](handleEntityNotFound(_0x21ae20,null))['then'](function(_0x43b646){if(_0x43b646){return _0x43b646[_0xe0bd('0x44')]()['then'](function(_0xacd120){return _0xacd120;});}})[_0xe0bd('0xd')](function(_0x1ab9b0){_0x119d5c=_0x1ab9b0;if(_0x1ab9b0){if(_0x1ab9b0[_0xe0bd('0x45')]||_0x1ab9b0[_0xe0bd('0x46')]){return db[_0x1ab9b0[_0xe0bd('0x45')]?_0xe0bd('0x47'):_0xe0bd('0x48')][_0xe0bd('0x42')]({'where':{'id':_0x1ab9b0[_0xe0bd('0x45')]?_0x1ab9b0['VoiceQueueId']:_0x1ab9b0[_0xe0bd('0x46')]},'attributes':['id',_0xe0bd('0x10')],'raw':!![]});}}})[_0xe0bd('0xd')](function(_0x52573c){var _0x16dda5={};if(_0x52573c){_[_0xe0bd('0x37')](_0x16dda5,_[_0xe0bd('0x49')](_0x119d5c[_0xe0bd('0x4a')],[_0xe0bd('0x4b'),_0xe0bd('0x4c'),'id']));_0x16dda5[_0xe0bd('0x4d')]=0x15;_0x16dda5[_0xe0bd('0x4e')]=_0xe0bd('0x4f');_0x16dda5['campaign']=_0x52573c[_0xe0bd('0x10')];_0x16dda5[_0xe0bd('0x50')]=_0x147438[_0xe0bd('0x51')][_0xe0bd('0x10')];_0x16dda5['UserId']=_0x147438[_0xe0bd('0x51')]['id'];_0x16dda5[_0xe0bd('0x4f')]=!![];_0x16dda5[_0xe0bd('0x52')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x16dda5[_0xe0bd('0x53')]=_0x119d5c[_0xe0bd('0x54')];_0x16dda5['campaigntype']=_0x119d5c[_0xe0bd('0x45')]?_0xe0bd('0x55'):_0xe0bd('0x56');return db[_0xe0bd('0x57')]['find']({'where':{'id':_0x16dda5[_0xe0bd('0x58')]},'attributes':[_0xe0bd('0x59'),_0xe0bd('0x5a')]})[_0xe0bd('0xd')](function(_0x373846){if(!_[_0xe0bd('0x5b')](_0x21ae20)&&!_[_0xe0bd('0x5b')](_0x373846['firstName'])){_0x16dda5[_0xe0bd('0x5c')]=_0x373846[_0xe0bd('0x59')];if(!_[_0xe0bd('0x5b')](_0x373846[_0xe0bd('0x5a')])){_0x16dda5[_0xe0bd('0x5c')]+='\x20'+_0x373846[_0xe0bd('0x5a')];}}})[_0xe0bd('0x5d')](function(){return db[_0xe0bd('0x5e')][_0xe0bd('0x40')](_0x16dda5);});}})[_0xe0bd('0xd')](function(_0x29b248){return db[_0xe0bd('0x5f')][_0xe0bd('0x44')]({'where':{'CmHopperId':_0x2eff0d}});})[_0xe0bd('0xd')](function(){return _0x21ae20[_0xe0bd('0x5')](0xcc)[_0xe0bd('0x60')]();})[_0xe0bd('0x3f')](handleError(_0x21ae20,null));};exports[_0xe0bd('0x61')]=function(_0x178398,_0x8e61d6){var _0x9d03de=[];return db[_0xe0bd('0x57')][_0xe0bd('0x43')]()['then'](function(_0x4b461a){_0x9d03de=_[_0xe0bd('0x18')](_0x4b461a);return _0x178398[_0xe0bd('0x51')][_0xe0bd('0x62')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id','dialOrderByScheduledAt',_0xe0bd('0x63')],'raw':!![]});})[_0xe0bd('0xd')](function(_0x4dfd2a){if(_0x4dfd2a&&_0x4dfd2a[_0xe0bd('0x2d')]){return db['sequelize'][_0xe0bd('0x64')](function(_0x2ede67){var _0x14bbeb={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x4dfd2a,'id')},'$or':[{'UserId':null},{'UserId':_0x178398[_0xe0bd('0x51')]['id']}]};var _0x1c9407={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4dfd2a)[_0xe0bd('0x34')]([_0xe0bd('0x63'),0x0])[_0xe0bd('0x12')]('id')[_0xe0bd('0x65')]()},'$or':[{'UserId':null},{'UserId':_0x178398['user']['id']}]};var _0x338028={'$or':[_0x14bbeb,_0x1c9407]};var _0x40a584=[];if(_0x178398['body'][_0xe0bd('0x66')]&&_0x178398[_0xe0bd('0x41')][_0xe0bd('0x66')]===_0xe0bd('0x67')){if(!_[_0xe0bd('0x68')](_0x178398[_0xe0bd('0x41')][_0xe0bd('0x69')])){_0x338028['id']={'$in':_0x178398[_0xe0bd('0x41')]['hopperIds']};}_0x40a584=[[_0xe0bd('0x6a'),_0xe0bd('0x6b')],[_0xe0bd('0x6c'),_0x4dfd2a[0x0]['dialOrderByScheduledAt']===_0xe0bd('0x6b')?_0xe0bd('0x6d'):_0xe0bd('0x6b')],db[_0xe0bd('0x6e')]['literal'](_0xe0bd('0x6f')),['id',_0xe0bd('0x6d')]];}else{if(!_[_0xe0bd('0x68')](_0x178398['body'][_0xe0bd('0x69')])){_0x338028['id']={'$notIn':_0x178398[_0xe0bd('0x41')][_0xe0bd('0x69')]};}_0x40a584=[['priority',_0xe0bd('0x6d')],['scheduledAt',_0x4dfd2a[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0xe0bd('0x70')](_0xe0bd('0x71')),['id',_0xe0bd('0x6b')]];}return db[_0xe0bd('0x3a')]['findOne']({'attributes':['id','scheduledat',_0xe0bd('0x54'),_0xe0bd('0x72')],'where':_0x338028,'order':_0x40a584,'transaction':_0x2ede67,'lock':_0x2ede67[_0xe0bd('0x73')][_0xe0bd('0x74')],'include':[{'model':db[_0xe0bd('0x57')],'as':_0xe0bd('0x75'),'attributes':_0x9d03de,'include':[{'model':db[_0xe0bd('0x76')],'as':_0xe0bd('0x77'),'attributes':['id',_0xe0bd('0x10')]}]},{'model':db[_0xe0bd('0x78')],'as':'List','attributes':['id',_0xe0bd('0x10')]},{'model':db['VoiceQueue'],'as':_0xe0bd('0x79'),'attributes':['id',_0xe0bd('0x10'),_0xe0bd('0x7a')]}]})[_0xe0bd('0xd')](function(_0x191423){if(_0x191423){return _0x191423[_0xe0bd('0xc')]({'UserId':_0x178398[_0xe0bd('0x51')]['id']},{'transaction':_0x2ede67});}});});}})['then'](handleEntityNotFound(_0x8e61d6,null))[_0xe0bd('0xd')](respondWithResult(_0x8e61d6,null))[_0xe0bd('0x3f')](handleError(_0x8e61d6,null));};exports['getPreviewRecall']=function(_0x4303ec,_0x2acb14,_0x1f230d){var _0x4fb0cb=[];var _0x5991e5=_0x4303ec[_0xe0bd('0x3d')]['id'];var _0x1cc0dd=_0x4303ec['user']['id'];return db[_0xe0bd('0x57')][_0xe0bd('0x43')]()['then'](function(_0x485bde){_0x4fb0cb=_[_0xe0bd('0x18')](_0x485bde);return db[_0xe0bd('0x6e')][_0xe0bd('0x64')](function(_0x6e9712){const _0x4e3815={'id':_0x5991e5};return db[_0xe0bd('0x3a')]['findOne']({'attributes':['id',_0xe0bd('0x7b'),_0xe0bd('0x72')],'where':_0x4e3815,'transaction':_0x6e9712,'lock':_0x6e9712[_0xe0bd('0x73')][_0xe0bd('0x74')],'include':[{'model':db[_0xe0bd('0x57')],'as':_0xe0bd('0x75'),'attributes':_0x4fb0cb,'include':[{'model':db[_0xe0bd('0x76')],'as':_0xe0bd('0x77'),'attributes':['id',_0xe0bd('0x10')]}]},{'model':db[_0xe0bd('0x78')],'as':'List','attributes':['id',_0xe0bd('0x10')]},{'model':db[_0xe0bd('0x47')],'as':_0xe0bd('0x79'),'attributes':['id','name',_0xe0bd('0x7a')]}]})[_0xe0bd('0xd')](function(_0x6a6012){if(_0x6a6012){return _0x6a6012[_0xe0bd('0xc')]({'UserId':_0x1cc0dd},{'transaction':_0x6e9712});}});});})[_0xe0bd('0xd')](handleEntityNotFound(_0x2acb14,null))[_0xe0bd('0xd')](respondWithResult(_0x2acb14,null))['catch'](handleError(_0x2acb14,null));};exports[_0xe0bd('0x7c')]=function(_0x378034,_0x17435d){return _0x378034[_0xe0bd('0x51')]['getVoiceQueues']({'where':{'type':_0xe0bd('0x7d'),'dialActive':!![],'dialMethod':_0xe0bd('0x7e')},'attributes':['id'],'raw':!![]})[_0xe0bd('0xd')](function(_0x3fb7f9){if(_0x3fb7f9&&_0x3fb7f9[_0xe0bd('0x2d')]){return db['CmHopper'][_0xe0bd('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe0bd('0x7f')](_0xe0bd('0x80'))},'VoiceQueueId':{'$in':_[_0xe0bd('0x12')](_0x3fb7f9,'id')},'$or':[{'UserId':null},{'UserId':_0x378034[_0xe0bd('0x51')]['id']}]}});}return 0x0;})[_0xe0bd('0xd')](function(_0x3a82a5){if(!_[_0xe0bd('0x5b')](_0x3a82a5)&&_[_0xe0bd('0x81')](_0x3a82a5)){return _0x17435d[_0xe0bd('0x5')](0xc8)[_0xe0bd('0x6')]({'contacts':_0x3a82a5});}else{logger[_0xe0bd('0x82')](_0xe0bd('0x83'),_0xe0bd('0x7c'),0x194,_0xe0bd('0x84'));_0x17435d[_0xe0bd('0xe')](0x194);}})[_0xe0bd('0x3f')](handleError(_0x17435d,null));};exports[_0xe0bd('0x85')]=function(_0x5a9a57,_0x9b312e){var _0x36ca72=shared[_0xe0bd('0x86')];var _0x52287d=[];_[_0xe0bd('0x12')](_0x36ca72,function(_0x1ae29c){_0x52287d[_0xe0bd('0x87')]({'id':_0x1ae29c[_0xe0bd('0x10')],'name':_0x1ae29c[_0xe0bd('0x10')],'utcOffset':_0x1ae29c[_0xe0bd('0x88')]});});return _0x9b312e[_0xe0bd('0x5')](0xc8)[_0xe0bd('0x6')]({'tz':_0x52287d});};exports[_0xe0bd('0x89')]=function(_0x531f39,_0x52a859){var _0x4e9fe0=shared[_0xe0bd('0x86')];var _0x42b1b4={};if(!_[_0xe0bd('0x5b')](_0x4e9fe0[_0x531f39['body']['id']]))_0x42b1b4=_0x4e9fe0[_0x531f39[_0xe0bd('0x41')]['id']];return _0x52a859[_0xe0bd('0x5')](0xc8)[_0xe0bd('0x6')](_0x42b1b4);}; \ No newline at end of file +var _0x106f=['where','pick','merge','VIRTUAL','filter','options','then','includeAll','include','find','catch','create','body','describe','destroy','params','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','CmContact','firstName','isNil','calleridname','lastName','CmHopperFinal','end','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','value','direction','prev','hopperIds','ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','isEmpty','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','Contact','CmCompany','Company','List','Queue','dialActive','getPreviewRecall','recallme','UPDATE','CmList','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','getTimezones','push','utcOffset','getTimezone','moment','lodash','../../config/logger','api','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','update','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$iLike','$notILike','$like','$overlap','$contains','$contained','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x22d670,_0x2611ef){var _0x21ef8f=function(_0x1ed25f){while(--_0x1ed25f){_0x22d670['push'](_0x22d670['shift']());}};_0x21ef8f(++_0x2611ef);}(_0x106f,0x162));var _0xf106=function(_0x7c829f,_0x111571){_0x7c829f=_0x7c829f-0x0;var _0x2c5b51=_0x106f[_0x7c829f];return _0x2c5b51;};'use strict';var moment=require(_0xf106('0x0'));var _=require(_0xf106('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xf106('0x2'))(_0xf106('0x3'));var shared=require('../../config/environment');var db=require(_0xf106('0x4'))['db'];function respondWithResult(_0x4ab04f,_0x1236af){_0x1236af=_0x1236af||0xc8;return function(_0x370f6a){if(_0x370f6a){return _0x4ab04f[_0xf106('0x5')](_0x1236af)[_0xf106('0x6')](_0x370f6a);}};}function respondWithFilteredResult(_0x253f6d,_0x282fd4){return function(_0xc9588d){if(_0xc9588d){var _0x546acc=typeof _0x282fd4[_0xf106('0x7')]===_0xf106('0x8')&&typeof _0x282fd4['limit']==='undefined';var _0x507ad9=_0xc9588d['count'];var _0x52befe=_0x546acc?0x0:_0x282fd4[_0xf106('0x7')];var _0x3761d5=_0x546acc?_0xc9588d[_0xf106('0x9')]:_0x282fd4[_0xf106('0x7')]+_0x282fd4[_0xf106('0xa')];var _0x32ba4d;if(_0x3761d5>=_0x507ad9){_0x3761d5=_0x507ad9;_0x32ba4d=0xc8;}else{_0x32ba4d=0xce;}_0x253f6d[_0xf106('0x5')](_0x32ba4d);return _0x253f6d[_0xf106('0xb')](_0xf106('0xc'),_0x52befe+'-'+_0x3761d5+'/'+_0x507ad9)[_0xf106('0x6')](_0xc9588d);}return null;};}function saveUpdates(_0x31eebf,_0x5e9da8){return function(_0x2bd234){if(_0x2bd234){return _0x2bd234[_0xf106('0xd')](_0x31eebf)['then'](function(_0x59854c){return _0x59854c;});}return null;};}function handleEntityNotFound(_0x322351,_0x2cdbf6){return function(_0x292a0d){if(!_0x292a0d){_0x322351['sendStatus'](0x194);}return _0x292a0d;};}function handleError(_0x26bd1b,_0x26186f){_0x26186f=_0x26186f||0x1f4;return function(_0xf05683){logger['error'](_0xf05683[_0xf106('0xe')]);if(_0xf05683[_0xf106('0xf')]){delete _0xf05683['name'];}_0x26bd1b[_0xf106('0x5')](_0x26186f)[_0xf106('0x10')](_0xf05683);};}exports[_0xf106('0x11')]=function(_0x5e4c8f,_0x5d02c0){var _0x13b6b4={},_0x726d7c={},_0x7e15d1={'count':0x0,'rows':[]};var _0x4d395d=_[_0xf106('0x12')](db[_0xf106('0x13')][_0xf106('0x14')],function(_0x17b243){return{'name':_0x17b243[_0xf106('0x15')],'type':_0x17b243[_0xf106('0x16')][_0xf106('0x17')]};});_0x726d7c[_0xf106('0x18')]=_[_0xf106('0x12')](_0x4d395d,'name');_0x726d7c['query']=_[_0xf106('0x19')](_0x5e4c8f['query']);_0x726d7c[_0xf106('0x1a')]=_[_0xf106('0x1b')](_0x726d7c[_0xf106('0x18')],_0x726d7c[_0xf106('0x1c')]);_0x726d7c[_0xf106('0x1a')]=_['concat'](_0x726d7c['filters'],[_0xf106('0x1d'),_0xf106('0x1e'),_0xf106('0x1f'),_0xf106('0x20'),_0xf106('0x21'),_0xf106('0x22'),_0xf106('0x23'),_0xf106('0x24'),_0xf106('0x25'),_0xf106('0x26'),_0xf106('0x27'),_0xf106('0x28'),'$notIn','$like','$notLike',_0xf106('0x29'),_0xf106('0x2a'),_0xf106('0x2b'),_0xf106('0x2c'),_0xf106('0x2d'),_0xf106('0x2e'),'$any']);_0x13b6b4[_0xf106('0x2f')]=_[_0xf106('0x1b')](_0x726d7c[_0xf106('0x18')],qs[_0xf106('0x30')](_0x5e4c8f['query'][_0xf106('0x30')]));_0x13b6b4[_0xf106('0x2f')]=_0x13b6b4[_0xf106('0x2f')][_0xf106('0x31')]?_0x13b6b4[_0xf106('0x2f')]:_0x726d7c[_0xf106('0x18')];if(!_0x5e4c8f['query'][_0xf106('0x32')](_0xf106('0x33'))){_0x13b6b4[_0xf106('0xa')]=qs[_0xf106('0xa')](_0x5e4c8f['query'][_0xf106('0xa')]);_0x13b6b4[_0xf106('0x7')]=qs['offset'](_0x5e4c8f[_0xf106('0x1c')][_0xf106('0x7')]);}_0x13b6b4[_0xf106('0x34')]=qs[_0xf106('0x35')](_0x5e4c8f[_0xf106('0x1c')][_0xf106('0x35')]);_0x13b6b4[_0xf106('0x36')]=qs[_0xf106('0x1a')](_[_0xf106('0x37')](_0x5e4c8f[_0xf106('0x1c')],_0x726d7c[_0xf106('0x1a')]),_0x4d395d);if(_0x5e4c8f['query']['filter']){_0x13b6b4[_0xf106('0x36')]=_[_0xf106('0x38')](_0x13b6b4[_0xf106('0x36')],{'$or':_['map'](_0x4d395d,function(_0x149645){if(_0x149645[_0xf106('0x16')]!==_0xf106('0x39')){var _0xebb99={};_0xebb99[_0x149645[_0xf106('0xf')]]={'$like':'%'+_0x5e4c8f['query'][_0xf106('0x3a')]+'%'};return _0xebb99;}})});}_0x13b6b4=_['merge']({},_0x13b6b4,_0x5e4c8f[_0xf106('0x3b')]);var _0x2e4c93={'where':_0x13b6b4[_0xf106('0x36')]};return db[_0xf106('0x13')]['count'](_0x2e4c93)[_0xf106('0x3c')](function(_0x3d1e1f){_0x7e15d1[_0xf106('0x9')]=_0x3d1e1f;if(_0x5e4c8f['query']['includeAll']){_0x13b6b4['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x13b6b4);})[_0xf106('0x3c')](function(_0x5de95b){_0x7e15d1['rows']=_0x5de95b;return _0x7e15d1;})[_0xf106('0x3c')](respondWithFilteredResult(_0x5d02c0,_0x13b6b4))['catch'](handleError(_0x5d02c0,null));};exports['show']=function(_0x26ffc3,_0x1a3b02){var _0x2d4c90={'raw':!![],'where':{'id':_0x26ffc3['params']['id']}},_0x3e557d={};_0x3e557d[_0xf106('0x18')]=_[_0xf106('0x19')](db['CmHopper'][_0xf106('0x14')]);_0x3e557d[_0xf106('0x1c')]=_[_0xf106('0x19')](_0x26ffc3[_0xf106('0x1c')]);_0x3e557d[_0xf106('0x1a')]=_[_0xf106('0x1b')](_0x3e557d[_0xf106('0x18')],_0x3e557d['query']);_0x2d4c90['attributes']=_[_0xf106('0x1b')](_0x3e557d['model'],qs['fields'](_0x26ffc3[_0xf106('0x1c')][_0xf106('0x30')]));_0x2d4c90['attributes']=_0x2d4c90['attributes'][_0xf106('0x31')]?_0x2d4c90['attributes']:_0x3e557d[_0xf106('0x18')];if(_0x26ffc3[_0xf106('0x1c')][_0xf106('0x3d')]){_0x2d4c90[_0xf106('0x3e')]=[{'all':!![]}];}_0x2d4c90=_[_0xf106('0x38')]({},_0x2d4c90,_0x26ffc3[_0xf106('0x3b')]);return db[_0xf106('0x13')][_0xf106('0x3f')](_0x2d4c90)[_0xf106('0x3c')](handleEntityNotFound(_0x1a3b02,null))[_0xf106('0x3c')](respondWithResult(_0x1a3b02,null))[_0xf106('0x40')](handleError(_0x1a3b02,null));};exports[_0xf106('0x41')]=function(_0x39763c,_0x252ee1){return db[_0xf106('0x13')][_0xf106('0x41')](_0x39763c[_0xf106('0x42')],{})[_0xf106('0x3c')](respondWithResult(_0x252ee1,0xc9))['catch'](handleError(_0x252ee1,null));};exports[_0xf106('0xd')]=function(_0x20942e,_0xd0e741){if(_0x20942e[_0xf106('0x42')]['id']){delete _0x20942e[_0xf106('0x42')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x20942e['params']['id']}})['then'](handleEntityNotFound(_0xd0e741,null))[_0xf106('0x3c')](saveUpdates(_0x20942e['body'],null))['then'](respondWithResult(_0xd0e741,null))[_0xf106('0x40')](handleError(_0xd0e741,null));};exports[_0xf106('0x43')]=function(_0xd50443,_0x105337){return db['CmHopper'][_0xf106('0x43')]()[_0xf106('0x3c')](respondWithResult(_0x105337,null))[_0xf106('0x40')](handleError(_0x105337,null));};exports[_0xf106('0x44')]=function(_0x1bf065,_0x519192){var _0x59bd01;var _0x37dc6a=_0x1bf065[_0xf106('0x45')]['id'];return db[_0xf106('0x13')]['find']({'where':{'id':_0x1bf065[_0xf106('0x45')]['id']}})[_0xf106('0x3c')](handleEntityNotFound(_0x519192,null))[_0xf106('0x3c')](function(_0x1ddfce){if(_0x1ddfce){return _0x1ddfce['destroy']()[_0xf106('0x3c')](function(_0x5b80a8){return _0x5b80a8;});}})['then'](function(_0x148730){_0x59bd01=_0x148730;if(_0x148730){if(_0x148730[_0xf106('0x46')]||_0x148730['CampaignId']){return db[_0x148730[_0xf106('0x46')]?_0xf106('0x47'):_0xf106('0x48')][_0xf106('0x3f')]({'where':{'id':_0x148730[_0xf106('0x46')]?_0x148730[_0xf106('0x46')]:_0x148730['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})[_0xf106('0x3c')](function(_0x53b682){var _0x20c935={};if(_0x53b682){_['merge'](_0x20c935,_[_0xf106('0x49')](_0x59bd01[_0xf106('0x4a')],[_0xf106('0x4b'),_0xf106('0x4c'),'id']));_0x20c935['state']=0x15;_0x20c935[_0xf106('0x4d')]=_0xf106('0x4e');_0x20c935[_0xf106('0x4f')]=_0x53b682[_0xf106('0xf')];_0x20c935[_0xf106('0x50')]=_0x1bf065[_0xf106('0x51')][_0xf106('0xf')];_0x20c935[_0xf106('0x52')]=_0x1bf065[_0xf106('0x51')]['id'];_0x20c935[_0xf106('0x4e')]=!![];_0x20c935[_0xf106('0x53')]=moment()[_0xf106('0x54')](_0xf106('0x55'));_0x20c935[_0xf106('0x56')]=_0x59bd01[_0xf106('0x57')];_0x20c935[_0xf106('0x58')]=_0x59bd01['VoiceQueueId']?'queue':_0xf106('0x59');return db[_0xf106('0x5a')][_0xf106('0x3f')]({'where':{'id':_0x20c935['ContactId']},'attributes':[_0xf106('0x5b'),'lastName']})[_0xf106('0x3c')](function(_0x332a79){if(!_[_0xf106('0x5c')](_0x519192)&&!_['isNil'](_0x332a79[_0xf106('0x5b')])){_0x20c935['calleridname']=_0x332a79[_0xf106('0x5b')];if(!_[_0xf106('0x5c')](_0x332a79['lastName'])){_0x20c935[_0xf106('0x5d')]+='\x20'+_0x332a79[_0xf106('0x5e')];}}})['finally'](function(){return db[_0xf106('0x5f')][_0xf106('0x41')](_0x20c935);});}})['then'](function(_0x24f283){return db['CmHopperAdditionalPhone'][_0xf106('0x44')]({'where':{'CmHopperId':_0x37dc6a}});})[_0xf106('0x3c')](function(){return _0x519192['status'](0xcc)[_0xf106('0x60')]();})['catch'](handleError(_0x519192,null));};exports['getPreview']=function(_0x151d33,_0x1b903b){var _0x15bf0f=[];return db[_0xf106('0x5a')][_0xf106('0x43')]()[_0xf106('0x3c')](function(_0xe2c0ee){_0x15bf0f=_[_0xf106('0x19')](_0xe2c0ee);return _0x151d33[_0xf106('0x51')][_0xf106('0x61')]({'where':{'type':_0xf106('0x62'),'dialActive':!![],'dialMethod':_0xf106('0x63')},'attributes':['id',_0xf106('0x64'),_0xf106('0x65')],'raw':!![]});})[_0xf106('0x3c')](function(_0x40bc98){if(_0x40bc98&&_0x40bc98['length']){return db[_0xf106('0x66')]['transaction'](function(_0x40be0c){var _0x505f8f={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xf106('0x55'))},'VoiceQueueId':{'$in':_['map'](_0x40bc98,'id')},'$or':[{'UserId':null},{'UserId':_0x151d33[_0xf106('0x51')]['id']}]};var _0x3c07c6={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x40bc98)[_0xf106('0x3a')]([_0xf106('0x65'),0x0])[_0xf106('0x12')]('id')[_0xf106('0x67')]()},'$or':[{'UserId':null},{'UserId':_0x151d33[_0xf106('0x51')]['id']}]};var _0x1eac36={'$or':[_0x505f8f,_0x3c07c6]};var _0x409d13=[];if(_0x151d33['body'][_0xf106('0x68')]&&_0x151d33[_0xf106('0x42')]['direction']===_0xf106('0x69')){if(!_['isEmpty'](_0x151d33[_0xf106('0x42')][_0xf106('0x6a')])){_0x1eac36['id']={'$in':_0x151d33[_0xf106('0x42')][_0xf106('0x6a')]};}_0x409d13=[['priority',_0xf106('0x6b')],[_0xf106('0x6c'),_0x40bc98[0x0][_0xf106('0x64')]===_0xf106('0x6b')?'DESC':_0xf106('0x6b')],db[_0xf106('0x66')][_0xf106('0x6d')](_0xf106('0x6e')),['id',_0xf106('0x6f')]];}else{if(!_[_0xf106('0x70')](_0x151d33[_0xf106('0x42')][_0xf106('0x6a')])){_0x1eac36['id']={'$notIn':_0x151d33[_0xf106('0x42')][_0xf106('0x6a')]};}_0x409d13=[[_0xf106('0x71'),_0xf106('0x6f')],['scheduledAt',_0x40bc98[0x0][_0xf106('0x64')]],db[_0xf106('0x66')][_0xf106('0x6d')](_0xf106('0x72')),['id',_0xf106('0x6b')]];}return db['CmHopper'][_0xf106('0x73')]({'attributes':['id',_0xf106('0x74'),_0xf106('0x57'),'recallme'],'where':_0x1eac36,'order':_0x409d13,'transaction':_0x40be0c,'lock':_0x40be0c[_0xf106('0x75')]['UPDATE'],'include':[{'model':db[_0xf106('0x5a')],'as':_0xf106('0x76'),'attributes':_0x15bf0f,'include':[{'model':db[_0xf106('0x77')],'as':_0xf106('0x78'),'attributes':['id',_0xf106('0xf')]}]},{'model':db['CmList'],'as':_0xf106('0x79'),'attributes':['id','name']},{'model':db[_0xf106('0x47')],'as':_0xf106('0x7a'),'attributes':['id',_0xf106('0xf'),_0xf106('0x7b')]}]})[_0xf106('0x3c')](function(_0x27f68c){if(_0x27f68c){return _0x27f68c[_0xf106('0xd')]({'UserId':_0x151d33[_0xf106('0x51')]['id']},{'transaction':_0x40be0c});}});});}})['then'](handleEntityNotFound(_0x1b903b,null))[_0xf106('0x3c')](respondWithResult(_0x1b903b,null))['catch'](handleError(_0x1b903b,null));};exports[_0xf106('0x7c')]=function(_0x4393b1,_0x5974ed,_0x1d4b0f){var _0x340317=[];var _0x5258ad=_0x4393b1[_0xf106('0x45')]['id'];var _0x5eafcf=_0x4393b1[_0xf106('0x51')]['id'];return db[_0xf106('0x5a')][_0xf106('0x43')]()['then'](function(_0x35263c){_0x340317=_['keys'](_0x35263c);return db[_0xf106('0x66')]['transaction'](function(_0x26fc26){const _0x28e042={'id':_0x5258ad};return db[_0xf106('0x13')][_0xf106('0x73')]({'attributes':['id',_0xf106('0x74'),_0xf106('0x7d')],'where':_0x28e042,'transaction':_0x26fc26,'lock':_0x26fc26[_0xf106('0x75')][_0xf106('0x7e')],'include':[{'model':db[_0xf106('0x5a')],'as':_0xf106('0x76'),'attributes':_0x340317,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0xf106('0xf')]}]},{'model':db[_0xf106('0x7f')],'as':_0xf106('0x79'),'attributes':['id',_0xf106('0xf')]},{'model':db[_0xf106('0x47')],'as':_0xf106('0x7a'),'attributes':['id','name',_0xf106('0x7b')]}]})[_0xf106('0x3c')](function(_0x4b5ef5){if(_0x4b5ef5){return _0x4b5ef5[_0xf106('0xd')]({'UserId':_0x5eafcf},{'transaction':_0x26fc26});}});});})[_0xf106('0x3c')](handleEntityNotFound(_0x5974ed,null))['then'](respondWithResult(_0x5974ed,null))[_0xf106('0x40')](handleError(_0x5974ed,null));};exports[_0xf106('0x80')]=function(_0x1ce81f,_0x5a1d5e){return _0x1ce81f[_0xf106('0x51')][_0xf106('0x61')]({'where':{'type':_0xf106('0x62'),'dialActive':!![],'dialMethod':_0xf106('0x63')},'attributes':['id'],'raw':!![]})[_0xf106('0x3c')](function(_0x2f6a31){if(_0x2f6a31&&_0x2f6a31[_0xf106('0x31')]){return db[_0xf106('0x13')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xf106('0x55'))},'VoiceQueueId':{'$in':_['map'](_0x2f6a31,'id')},'$or':[{'UserId':null},{'UserId':_0x1ce81f['user']['id']}]}});}return 0x0;})[_0xf106('0x3c')](function(_0x5547ed){if(!_[_0xf106('0x5c')](_0x5547ed)&&_['isNumber'](_0x5547ed)){return _0x5a1d5e[_0xf106('0x5')](0xc8)[_0xf106('0x6')]({'contacts':_0x5547ed});}else{logger['error'](_0xf106('0x81'),_0xf106('0x80'),0x194,_0xf106('0x82'));_0x5a1d5e[_0xf106('0x83')](0x194);}})[_0xf106('0x40')](handleError(_0x5a1d5e,null));};exports[_0xf106('0x84')]=function(_0x50d390,_0x92e626){var _0x4760fd=shared['timezones'];var _0x4b6927=[];_[_0xf106('0x12')](_0x4760fd,function(_0x1f2297){_0x4b6927[_0xf106('0x85')]({'id':_0x1f2297[_0xf106('0xf')],'name':_0x1f2297[_0xf106('0xf')],'utcOffset':_0x1f2297[_0xf106('0x86')]});});return _0x92e626[_0xf106('0x5')](0xc8)[_0xf106('0x6')]({'tz':_0x4b6927});};exports[_0xf106('0x87')]=function(_0x578815,_0x3e037e){var _0x10fb6e=shared['timezones'];var _0x4986c9={};if(!_[_0xf106('0x5c')](_0x10fb6e[_0x578815[_0xf106('0x42')]['id']]))_0x4986c9=_0x10fb6e[_0x578815['body']['id']];return _0x3e037e[_0xf106('0x5')](0xc8)['json'](_0x4986c9);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 26c770f..6e0c570 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 _0x71ab=['rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','api','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x71ab,0x64));var _0xb71a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x71ab[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));module[_0xb71a('0x8')]=function(_0x38d931,_0x22c072){return _0x38d931[_0xb71a('0x9')](_0xb71a('0xa'),attributes,{'tableName':_0xb71a('0xb'),'paranoid':![],'indexes':[{'name':_0xb71a('0xc'),'fields':[_0xb71a('0xc')]},{'name':_0xb71a('0xd'),'fields':[_0xb71a('0xd')]},{'name':_0xb71a('0xe'),'fields':[_0xb71a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeff8=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','define','CmHopper','scheduledat','phone'];(function(_0x315b4f,_0x295860){var _0x1d1f56=function(_0x163d50){while(--_0x163d50){_0x315b4f['push'](_0x315b4f['shift']());}};_0x1d1f56(++_0x295860);}(_0xeff8,0x186));var _0x8eff=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xeff8[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));module['exports']=function(_0x469641,_0xb54063){return _0x469641[_0x8eff('0x9')](_0x8eff('0xa'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x8eff('0xb'),'fields':[_0x8eff('0xb')]},{'name':_0x8eff('0xc'),'fields':[_0x8eff('0xc')]},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 36a1bc6..dffea61 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 _0x4be5=['findOne','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','CmList','List','NOW()','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','GetCmHopper','CmHopper','findAll','options','raw','limit','include','map','attributes','model','then','info','stringify','catch','error','ShowCmHopper','find','debug','message','CreateCmHopper','UpdateCmHopper','update','where','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','order','UPDATE','keys','User','Agent','name','voicePause','length','UserId','body','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','MoveContactManagedDialer','transaction','CmHopperFinal','create','destroy','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','GetContactRecallMe','LOCK','GetCmHopperPreview','Contact','GetContactByPhone'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x4be5,0x192));var _0x54be=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x4be5[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x54be('0x0'));var util=require(_0x54be('0x1'));var moment=require(_0x54be('0x2'));var BPromise=require(_0x54be('0x3'));var db=require(_0x54be('0x4'))['db'];var logger=require(_0x54be('0x5'))('rpc');exports[_0x54be('0x6')]=function(_0x53d016){var _0x7ae831=this;return new Promise(function(_0x162644,_0x5d8d7b){return db[_0x54be('0x7')][_0x54be('0x8')]({'raw':_0x53d016[_0x54be('0x9')]?_0x53d016['options'][_0x54be('0xa')]===undefined?!![]:![]:!![],'where':_0x53d016['options']?_0x53d016['options']['where']||null:null,'attributes':_0x53d016[_0x54be('0x9')]?_0x53d016[_0x54be('0x9')]['attributes']||null:null,'limit':_0x53d016[_0x54be('0x9')]?_0x53d016[_0x54be('0x9')][_0x54be('0xb')]||null:null,'include':_0x53d016[_0x54be('0x9')]?_0x53d016['options'][_0x54be('0xc')]?_[_0x54be('0xd')](_0x53d016[_0x54be('0x9')][_0x54be('0xc')],function(_0x1aac0f){return{'model':db[_0x1aac0f['model']],'as':_0x1aac0f['as'],'attributes':_0x1aac0f[_0x54be('0xe')],'include':_0x1aac0f['include']?_[_0x54be('0xd')](_0x1aac0f[_0x54be('0xc')],function(_0x2852d4){return{'model':db[_0x2852d4['model']],'as':_0x2852d4['as'],'attributes':_0x2852d4['attributes'],'include':_0x2852d4[_0x54be('0xc')]?_[_0x54be('0xd')](_0x2852d4[_0x54be('0xc')],function(_0x370551){return{'model':db[_0x370551[_0x54be('0xf')]],'as':_0x370551['as'],'attributes':_0x370551[_0x54be('0xe')]};}):[]};}):[]};}):[]:[]})[_0x54be('0x10')](function(_0x5b5be6){logger[_0x54be('0x11')](_0x54be('0x6'),_0x53d016);logger['debug'](_0x54be('0x6'),_0x53d016,JSON[_0x54be('0x12')](_0x5b5be6));_0x162644(_0x5b5be6);})[_0x54be('0x13')](function(_0x4c284b){logger[_0x54be('0x14')](_0x54be('0x6'),_0x4c284b['message'],_0x53d016);_0x5d8d7b(_0x7ae831[_0x54be('0x14')](0x1f4,_0x4c284b['message']));});});};exports[_0x54be('0x15')]=function(_0x295e53){var _0x1429a6=this;return new Promise(function(_0x4b707e,_0x52dd3d){return db[_0x54be('0x7')][_0x54be('0x16')]({'raw':_0x295e53[_0x54be('0x9')]?_0x295e53[_0x54be('0x9')][_0x54be('0xa')]===undefined?!![]:![]:!![],'where':_0x295e53[_0x54be('0x9')]?_0x295e53['options']['where']||null:null,'attributes':_0x295e53[_0x54be('0x9')]?_0x295e53['options'][_0x54be('0xe')]||null:null,'include':_0x295e53['options']?_0x295e53['options'][_0x54be('0xc')]?_['map'](_0x295e53['options'][_0x54be('0xc')],function(_0x287683){return{'model':db[_0x287683['model']],'as':_0x287683['as'],'attributes':_0x287683['attributes'],'include':_0x287683[_0x54be('0xc')]?_[_0x54be('0xd')](_0x287683[_0x54be('0xc')],function(_0x4e7f4a){return{'model':db[_0x4e7f4a[_0x54be('0xf')]],'as':_0x4e7f4a['as'],'attributes':_0x4e7f4a['attributes'],'include':_0x4e7f4a[_0x54be('0xc')]?_[_0x54be('0xd')](_0x4e7f4a['include'],function(_0x514603){return{'model':db[_0x514603[_0x54be('0xf')]],'as':_0x514603['as'],'attributes':_0x514603[_0x54be('0xe')]};}):[]};}):[]};}):[]:[]})[_0x54be('0x10')](function(_0x1cdc90){logger[_0x54be('0x11')]('ShowCmHopper',_0x295e53);logger[_0x54be('0x17')](_0x54be('0x15'),_0x295e53,JSON[_0x54be('0x12')](_0x1cdc90));_0x4b707e(_0x1cdc90);})['catch'](function(_0x15cc2d){logger['error'](_0x54be('0x15'),_0x15cc2d['message'],_0x295e53);_0x52dd3d(_0x1429a6['error'](0x1f4,_0x15cc2d[_0x54be('0x18')]));});});};exports[_0x54be('0x19')]=function(_0x5c55d0){var _0x2a29d2=this;return new Promise(function(_0xf345f8,_0x12525a){return db[_0x54be('0x7')]['create'](_0x5c55d0['body'],{'raw':_0x5c55d0['options']?_0x5c55d0[_0x54be('0x9')][_0x54be('0xa')]===undefined?!![]:![]:!![]})['then'](function(_0x535022){logger[_0x54be('0x11')](_0x54be('0x19'),_0x5c55d0);logger[_0x54be('0x17')](_0x54be('0x19'),_0x5c55d0,JSON['stringify'](_0x535022));_0xf345f8(_0x535022);})[_0x54be('0x13')](function(_0x3fceea){logger[_0x54be('0x14')](_0x54be('0x19'),_0x3fceea[_0x54be('0x18')],_0x5c55d0);_0x12525a(_0x2a29d2['error'](0x1f4,_0x3fceea['message']));});});};exports[_0x54be('0x1a')]=function(_0x35f123){var _0x4b56c4=this;return new Promise(function(_0xca0f8a,_0x5ccd70){return db[_0x54be('0x7')][_0x54be('0x1b')](_0x35f123['body'],{'raw':_0x35f123[_0x54be('0x9')]?_0x35f123[_0x54be('0x9')][_0x54be('0xa')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35f123[_0x54be('0x9')]?_0x35f123[_0x54be('0x9')][_0x54be('0x1c')]||null:null,'attributes':_0x35f123[_0x54be('0x9')]?_0x35f123[_0x54be('0x9')]['attributes']||null:null,'limit':_0x35f123[_0x54be('0x9')]?_0x35f123[_0x54be('0x9')][_0x54be('0xb')]||null:null})[_0x54be('0x10')](function(_0xdc1716){logger['info'](_0x54be('0x1a'),_0x35f123);logger[_0x54be('0x11')](_0x54be('0x1d'),JSON[_0x54be('0x12')](_0x35f123['options'][_0x54be('0x1c')]),_0x35f123['body']['active']);logger['debug'](_0x54be('0x1a'),_0x35f123,JSON[_0x54be('0x12')](_0xdc1716));_0xca0f8a(_0xdc1716);})['catch'](function(_0x5d16e7){logger[_0x54be('0x14')](_0x54be('0x1a'),_0x5d16e7[_0x54be('0x18')],_0x35f123);_0x5ccd70(_0x4b56c4[_0x54be('0x14')](0x1f4,_0x5d16e7[_0x54be('0x18')]));});});};exports[_0x54be('0x1e')]=function(_0x120e0e){var _0x35a6f3=this;return new Promise(function(_0x4378cb,_0x415d86){return db[_0x54be('0x7')]['destroy']({'where':_0x120e0e[_0x54be('0x9')]?_0x120e0e['options'][_0x54be('0x1c')]||null:null})[_0x54be('0x10')](function(_0x43dc57){logger[_0x54be('0x11')](_0x54be('0x1e'),_0x120e0e);logger[_0x54be('0x17')](_0x54be('0x1e'),_0x120e0e,JSON[_0x54be('0x12')](_0x43dc57));_0x4378cb(_0x43dc57);})[_0x54be('0x13')](function(_0x534aff){logger[_0x54be('0x14')](_0x54be('0x1e'),_0x534aff[_0x54be('0x18')],_0x120e0e);_0x415d86(_0x35a6f3['error'](0x1f4,_0x534aff[_0x54be('0x18')]));});});};exports[_0x54be('0x1f')]=function(_0x183741){var _0x55025d=this;return new Promise(function(_0x426a81,_0x257854){return db[_0x54be('0x20')][_0x54be('0x21')]()[_0x54be('0x10')](function(_0x1d3aff){return db[_0x54be('0x22')]['transaction'](function(_0x14a040){return db[_0x54be('0x7')][_0x54be('0x8')]({'where':_0x183741[_0x54be('0x9')]?_0x183741[_0x54be('0x9')][_0x54be('0x1c')]||null:null,'attributes':_0x183741[_0x54be('0x9')]?_0x183741[_0x54be('0x9')][_0x54be('0xe')]||null:null,'limit':_0x183741[_0x54be('0x9')]?_0x183741[_0x54be('0x9')][_0x54be('0xb')]||null:null,'order':_0x183741[_0x54be('0x9')]?_0x183741['options'][_0x54be('0x23')]||null:null,'transaction':_0x14a040,'lock':_0x14a040['LOCK'][_0x54be('0x24')],'include':[{'model':db[_0x54be('0x20')],'as':'Contact','attributes':_[_0x54be('0x25')](_0x1d3aff)},{'model':db[_0x54be('0x26')],'as':_0x54be('0x27'),'attributes':['id',_0x54be('0x28'),_0x54be('0x29')]}]})[_0x54be('0x10')](function(_0x3b1cb4){var _0x2a9614=[];var _0x10677a=[];for(var _0x29eea3=0x0;_0x29eea3<_0x3b1cb4[_0x54be('0x2a')];_0x29eea3+=0x1){var _0x5ee4bc=_0x3b1cb4[_0x29eea3][_0x54be('0x2b')];if(_0x5ee4bc===null){_0x2a9614['push'](_0x3b1cb4[_0x29eea3][_0x54be('0x1b')](_0x183741[_0x54be('0x2c')],{'transaction':_0x14a040}));}else if(!_0x10677a['includes'](_0x5ee4bc)){_0x10677a[_0x54be('0x2d')](_0x5ee4bc);_0x2a9614['push'](_0x3b1cb4[_0x29eea3][_0x54be('0x1b')](_0x183741['body'],{'transaction':_0x14a040}));}}return BPromise[_0x54be('0x2e')](_0x2a9614);});})[_0x54be('0x10')](function(_0x2d8087){logger[_0x54be('0x11')](_0x54be('0x1f'),_0x183741);if(_0x2d8087[_0x54be('0x2a')]>0x0){logger[_0x54be('0x11')](_0x54be('0x2f'),_0x2d8087[0x0][_0x54be('0x30')]['id'],_0x2d8087[0x0][_0x54be('0x30')][_0x54be('0x31')],_0x2d8087[0x0]['dataValues'][_0x54be('0x32')]);}logger[_0x54be('0x17')](_0x54be('0x1f'),_0x183741,JSON[_0x54be('0x12')](_0x2d8087));_0x426a81(_0x2d8087);})['catch'](function(_0x43a02a){logger[_0x54be('0x14')](_0x54be('0x1f'),_0x43a02a['message'],_0x183741);_0x257854(_0x55025d[_0x54be('0x14')](0x1f4,_0x43a02a['message']));});});});};exports[_0x54be('0x33')]=function(_0x2a8f62){var _0x5874e7=this;return new Promise(function(_0x258fc4,_0x3a6624){return db[_0x54be('0x22')][_0x54be('0x34')](function(_0x34173b){return db[_0x54be('0x35')][_0x54be('0x36')](_0x2a8f62[_0x54be('0x2c')],{'raw':_0x2a8f62[_0x54be('0x9')]?_0x2a8f62[_0x54be('0x9')][_0x54be('0xa')]===undefined?!![]:![]:!![],'transaction':_0x34173b})[_0x54be('0x10')](function(){logger['info']('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x2a8f62[_0x54be('0x9')][_0x54be('0x1c')]),_0x2a8f62[_0x54be('0x9')][_0x54be('0x1c')][_0x54be('0x32')]);return db[_0x54be('0x7')][_0x54be('0x37')]({'where':_0x2a8f62[_0x54be('0x9')]?_0x2a8f62[_0x54be('0x9')]['where']||null:null,'transaction':_0x34173b});});})[_0x54be('0x10')](function(_0x518998){logger[_0x54be('0x11')]('MoveContactManagedDialer',_0x2a8f62);logger['debug'](_0x54be('0x33'),_0x2a8f62,JSON[_0x54be('0x12')](_0x518998));_0x258fc4(_0x518998);})[_0x54be('0x13')](function(_0x48af41){logger[_0x54be('0x14')](_0x54be('0x33'),_0x48af41['message'],_0x2a8f62);_0x3a6624(_0x5874e7[_0x54be('0x14')](0x1f4,_0x48af41[_0x54be('0x18')]));});});};exports[_0x54be('0x38')]=function(_0x51f881){var _0x21943f=this;return new Promise(function(_0x4e53ca,_0x386349){return db[_0x54be('0x7')]['findAll']({'raw':_0x51f881[_0x54be('0x9')]?_0x51f881['options'][_0x54be('0xa')]===undefined?!![]:![]:!![],'where':_0x51f881[_0x54be('0x9')]?_0x51f881[_0x54be('0x9')][_0x54be('0x1c')]||null:null,'attributes':[[db[_0x54be('0x22')]['fn'](_0x54be('0x39'),db[_0x54be('0x22')]['fn']('IF',db[_0x54be('0x22')]['literal'](_0x54be('0x3a')+util['format'](_0x54be('0x3b'),moment()['format'](_0x54be('0x3c')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})['then'](function(_0x595ac3){logger[_0x54be('0x11')](_0x54be('0x38'),_0x51f881);logger[_0x54be('0x17')](_0x54be('0x38'),_0x51f881,JSON[_0x54be('0x12')](_0x595ac3));_0x4e53ca(_0x595ac3);})['catch'](function(_0x5ccf5b){logger[_0x54be('0x14')](_0x54be('0x38'),_0x5ccf5b[_0x54be('0x18')],_0x51f881);_0x386349(_0x21943f[_0x54be('0x14')](0x1f4,_0x5ccf5b['message']));});});};exports[_0x54be('0x3d')]=function(_0x479e44){var _0x1c2320=this;return new Promise(function(_0x4e72a8,_0x4c4718){return db[_0x54be('0x20')][_0x54be('0x21')]()[_0x54be('0x10')](function(){return db[_0x54be('0x22')]['transaction'](function(_0x4a5ec3){return db[_0x54be('0x7')]['findAll']({'where':_0x479e44[_0x54be('0x9')]?_0x479e44[_0x54be('0x9')]['where']||null:null,'attributes':_0x479e44[_0x54be('0x9')]?_0x479e44[_0x54be('0x9')][_0x54be('0xe')]||null:null,'limit':0x1,'order':_0x479e44[_0x54be('0x9')]?_0x479e44['options'][_0x54be('0x23')]||null:null,'group':db['CmHopper'][_0x54be('0x2b')],'transaction':_0x4a5ec3,'lock':_0x4a5ec3[_0x54be('0x3e')][_0x54be('0x24')],'include':_0x479e44['options']?_0x479e44[_0x54be('0x9')][_0x54be('0xc')]?_[_0x54be('0xd')](_0x479e44[_0x54be('0x9')]['include'],function(_0x115604){return{'model':db[_0x115604['model']],'as':_0x115604['as'],'attributes':_0x115604[_0x54be('0xe')],'include':_0x115604[_0x54be('0xc')]?_[_0x54be('0xd')](_0x115604[_0x54be('0xc')],function(_0x31ce35){return{'model':db[_0x31ce35['model']],'as':_0x31ce35['as'],'attributes':_0x31ce35[_0x54be('0xe')],'include':_0x31ce35[_0x54be('0xc')]?_[_0x54be('0xd')](_0x31ce35[_0x54be('0xc')],function(_0x57d34e){return{'model':db[_0x57d34e[_0x54be('0xf')]],'as':_0x57d34e['as'],'attributes':_0x57d34e[_0x54be('0xe')]};}):[]};}):[]};}):[]:[]})[_0x54be('0x10')](function(_0x3c5b7b){var _0x34b2be=[];for(var _0xdacf86=0x0;_0xdacf86<_0x3c5b7b['length'];_0xdacf86+=0x1){_0x34b2be[_0x54be('0x2d')](_0x3c5b7b[_0xdacf86][_0x54be('0x1b')](_0x479e44['body'],{'transaction':_0x4a5ec3}));}return BPromise[_0x54be('0x2e')](_0x34b2be);});})[_0x54be('0x10')](function(_0x59e40c){logger[_0x54be('0x11')](_0x54be('0x3d'),_0x479e44);logger[_0x54be('0x17')](_0x54be('0x3d'),_0x479e44,JSON[_0x54be('0x12')](_0x59e40c));_0x4e72a8(_0x59e40c);})[_0x54be('0x13')](function(_0x184906){logger[_0x54be('0x14')](_0x54be('0x3d'),_0x184906[_0x54be('0x18')],_0x479e44);_0x4c4718(_0x1c2320[_0x54be('0x14')](0x1f4,_0x184906[_0x54be('0x18')]));});});});};exports[_0x54be('0x3f')]=function(_0x274516){var _0x55567c=this;return new Promise(function(_0x130651,_0x1308d6){db[_0x54be('0x20')]['describe']()[_0x54be('0x10')](function(_0x419e7f){return db[_0x54be('0x7')][_0x54be('0x8')]({'raw':_0x274516['options']?_0x274516[_0x54be('0x9')][_0x54be('0xa')]===undefined?!![]:![]:!![],'where':_0x274516[_0x54be('0x9')]?_0x274516[_0x54be('0x9')][_0x54be('0x1c')]||null:null,'attributes':_0x274516[_0x54be('0x9')]?_0x274516[_0x54be('0x9')][_0x54be('0xe')]||null:null,'limit':_0x274516['options']?_0x274516[_0x54be('0x9')]['limit']||null:null,'include':_0x274516['options']?_0x274516[_0x54be('0x9')][_0x54be('0xc')]?_[_0x54be('0xd')](_0x274516[_0x54be('0x9')][_0x54be('0xc')],function(_0x1a0fd3){return{'model':db[_0x1a0fd3[_0x54be('0xf')]],'as':_0x1a0fd3['as'],'attributes':_0x1a0fd3['as']===_0x54be('0x40')?_[_0x54be('0x25')](_0x419e7f):_0x1a0fd3[_0x54be('0xe')],'include':_0x1a0fd3[_0x54be('0xc')]?_[_0x54be('0xd')](_0x1a0fd3['include'],function(_0xacf531){return{'model':db[_0xacf531[_0x54be('0xf')]],'as':_0xacf531['as'],'attributes':_0xacf531[_0x54be('0xe')],'include':_0xacf531[_0x54be('0xc')]?_[_0x54be('0xd')](_0xacf531[_0x54be('0xc')],function(_0x15136e){return{'model':db[_0x15136e[_0x54be('0xf')]],'as':_0x15136e['as'],'attributes':_0x15136e['attributes']};}):[]};}):[]};}):[]:[]})[_0x54be('0x10')](function(_0x574170){logger[_0x54be('0x11')](_0x54be('0x6'),_0x274516);logger[_0x54be('0x17')](_0x54be('0x6'),_0x274516,JSON[_0x54be('0x12')](_0x574170));_0x130651(_0x574170);})[_0x54be('0x13')](function(_0x9fcb27){logger[_0x54be('0x14')](_0x54be('0x6'),_0x9fcb27[_0x54be('0x18')],_0x274516);_0x1308d6(_0x55567c['error'](0x1f4,_0x9fcb27[_0x54be('0x18')]));});});});};exports[_0x54be('0x41')]=function(_0x35c500){var _0x3fe09f=this;return new Promise(function(_0x42ac0e,_0x343705){return db[_0x54be('0x20')][_0x54be('0x42')]({'raw':!![],'where':{'phone':_0x35c500[_0x54be('0x9')][_0x54be('0x1c')]['phone']},'attributes':['id','dialTimezone'],'order':[['id','DESC']]})[_0x54be('0x10')](function(_0x4c21dd){logger[_0x54be('0x11')](_0x54be('0x43'),_0x35c500);logger[_0x54be('0x17')]('getContactByPhone',_0x35c500,JSON[_0x54be('0x12')](_0x4c21dd));_0x42ac0e(_0x4c21dd);})[_0x54be('0x13')](function(_0x27620b){logger['error'](_0x54be('0x43'),_0x27620b[_0x54be('0x18')],_0x35c500);_0x343705(_0x3fe09f[_0x54be('0x14')](0x1f4,_0x27620b['message']));});});};exports[_0x54be('0x44')]=function(_0x323d62){var _0x1dd0d0=this;return new Promise(function(_0x20bdff,_0x32208e){return db[_0x54be('0x22')][_0x54be('0x34')](function(_0xb4a09b){var _0x223730=_0x323d62[_0x54be('0x9')]&&_0x323d62[_0x54be('0x9')][_0x54be('0x1c')]?_0x323d62[_0x54be('0x9')]['where']:{};return db[_0x54be('0x7')]['update'](_0x323d62[_0x54be('0x2c')],{'where':_0x223730,'transaction':_0xb4a09b})[_0x54be('0x10')](function(_0xda9920){logger[_0x54be('0x11')](_0x54be('0x44'),_0x323d62);logger[_0x54be('0x17')](_0x54be('0x44'),_0x323d62,JSON[_0x54be('0x12')](_0xda9920));_0x20bdff(_0xda9920);})[_0x54be('0x13')](function(_0x4f2a75){logger[_0x54be('0x14')](_0x54be('0x44'),_0x4f2a75[_0x54be('0x18')],_0x323d62);_0x32208e(_0x1dd0d0[_0x54be('0x14')](0x1f4,_0x4f2a75[_0x54be('0x18')]));});});});};exports[_0x54be('0x45')]=function(_0xed3ac2){var _0xb4c9f3=this;var _0xd9af90=_0xed3ac2['body'][_0x54be('0x1c')][_0x54be('0x46')];var _0x3771c4=_0xed3ac2[_0x54be('0x2c')]['where']['interval'];var _0x13f9a2=_0xed3ac2[_0x54be('0x2c')][_0x54be('0x1c')][_0x54be('0x47')];return new Promise(function(_0x19effd,_0x496753){return db[_0x54be('0x7')][_0x54be('0x8')]({'where':{'voiceQueueId':{'$in':_0xd9af90},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x54be('0x22')][_0x54be('0x48')](_0x54be('0x49')+_0x3771c4+_0x54be('0x4a')),'$gt':db['sequelize'][_0x54be('0x48')]('NOW()')}},'UserId':{'$in':_0x13f9a2}},'include':[{'model':db[_0x54be('0x20')],'as':_0x54be('0x40')},{'model':db[_0x54be('0x26')],'as':_0x54be('0x27'),'attributes':['id',_0x54be('0x28'),'voicePause']},{'model':db[_0x54be('0x4b')],'as':_0x54be('0x4c')}]})[_0x54be('0x10')](function(_0x461816){if(_0x461816[_0x54be('0x2a')]>0x0){return db[_0x54be('0x22')][_0x54be('0x34')](function(_0x2661ca){return db[_0x54be('0x7')][_0x54be('0x1b')]({'recallmeNotifiedDate':db[_0x54be('0x22')][_0x54be('0x48')](_0x54be('0x4d'))},{'where':{'id':{'$in':_[_0x54be('0xd')](_0x461816,'id')}},'transaction':_0x2661ca})[_0x54be('0x10')](function(){_0x19effd(_0x461816);})[_0x54be('0x13')](function(_0x4ec2ba){logger['error'](_0x54be('0x45'),_0x4ec2ba[_0x54be('0x18')],_0xed3ac2);_0x496753(_0xb4c9f3[_0x54be('0x14')](0x1f4,_0x4ec2ba[_0x54be('0x18')]));});})['catch'](function(_0x51a1cd){logger['error'](_0x54be('0x45'),_0x51a1cd[_0x54be('0x18')],_0xed3ac2);_0x496753(_0xb4c9f3['error'](0x1f4,_0x51a1cd[_0x54be('0x18')]));});}else{_0x19effd(_0x461816);}});});}; \ No newline at end of file +var _0x60a8=['ContactId','active','MoveContactManagedDialer','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','sequelize','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','LOCK','GetCmHopperPreview','GetContactByPhone','findOne','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','Agent','CmList','List','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','bluebird','../../config/logger','GetCmHopper','CmHopper','findAll','options','raw','where','limit','include','map','model','attributes','info','debug','stringify','error','message','ShowCmHopper','find','CreateCmHopper','create','body','then','catch','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','order','UPDATE','Contact','keys','User','name','voicePause','push','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x60a8,0x16a));var _0x860a=function(_0x152518,_0x5dbbe6){_0x152518=_0x152518-0x0;var _0x5b752f=_0x60a8[_0x152518];return _0x5b752f;};'use strict';var _=require(_0x860a('0x0'));var util=require(_0x860a('0x1'));var moment=require(_0x860a('0x2'));var BPromise=require(_0x860a('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x860a('0x4'))('rpc');exports[_0x860a('0x5')]=function(_0x4ec4ee){var _0x4d8583=this;return new Promise(function(_0x1e8cfb,_0x20be23){return db[_0x860a('0x6')][_0x860a('0x7')]({'raw':_0x4ec4ee[_0x860a('0x8')]?_0x4ec4ee[_0x860a('0x8')][_0x860a('0x9')]===undefined?!![]:![]:!![],'where':_0x4ec4ee[_0x860a('0x8')]?_0x4ec4ee[_0x860a('0x8')][_0x860a('0xa')]||null:null,'attributes':_0x4ec4ee[_0x860a('0x8')]?_0x4ec4ee[_0x860a('0x8')]['attributes']||null:null,'limit':_0x4ec4ee['options']?_0x4ec4ee['options'][_0x860a('0xb')]||null:null,'include':_0x4ec4ee[_0x860a('0x8')]?_0x4ec4ee[_0x860a('0x8')][_0x860a('0xc')]?_[_0x860a('0xd')](_0x4ec4ee[_0x860a('0x8')][_0x860a('0xc')],function(_0x1747bb){return{'model':db[_0x1747bb[_0x860a('0xe')]],'as':_0x1747bb['as'],'attributes':_0x1747bb[_0x860a('0xf')],'include':_0x1747bb[_0x860a('0xc')]?_[_0x860a('0xd')](_0x1747bb[_0x860a('0xc')],function(_0xca8754){return{'model':db[_0xca8754['model']],'as':_0xca8754['as'],'attributes':_0xca8754[_0x860a('0xf')],'include':_0xca8754[_0x860a('0xc')]?_['map'](_0xca8754[_0x860a('0xc')],function(_0x445193){return{'model':db[_0x445193[_0x860a('0xe')]],'as':_0x445193['as'],'attributes':_0x445193['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x20eca6){logger[_0x860a('0x10')](_0x860a('0x5'),_0x4ec4ee);logger[_0x860a('0x11')]('GetCmHopper',_0x4ec4ee,JSON[_0x860a('0x12')](_0x20eca6));_0x1e8cfb(_0x20eca6);})['catch'](function(_0x2a9591){logger[_0x860a('0x13')]('GetCmHopper',_0x2a9591[_0x860a('0x14')],_0x4ec4ee);_0x20be23(_0x4d8583[_0x860a('0x13')](0x1f4,_0x2a9591[_0x860a('0x14')]));});});};exports[_0x860a('0x15')]=function(_0x41798b){var _0x85c2e3=this;return new Promise(function(_0x13f0fb,_0xf0ac9f){return db[_0x860a('0x6')][_0x860a('0x16')]({'raw':_0x41798b['options']?_0x41798b[_0x860a('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x41798b[_0x860a('0x8')]?_0x41798b[_0x860a('0x8')][_0x860a('0xa')]||null:null,'attributes':_0x41798b[_0x860a('0x8')]?_0x41798b[_0x860a('0x8')][_0x860a('0xf')]||null:null,'include':_0x41798b[_0x860a('0x8')]?_0x41798b[_0x860a('0x8')][_0x860a('0xc')]?_[_0x860a('0xd')](_0x41798b[_0x860a('0x8')]['include'],function(_0x33a0c5){return{'model':db[_0x33a0c5[_0x860a('0xe')]],'as':_0x33a0c5['as'],'attributes':_0x33a0c5[_0x860a('0xf')],'include':_0x33a0c5[_0x860a('0xc')]?_[_0x860a('0xd')](_0x33a0c5[_0x860a('0xc')],function(_0x388a0a){return{'model':db[_0x388a0a[_0x860a('0xe')]],'as':_0x388a0a['as'],'attributes':_0x388a0a[_0x860a('0xf')],'include':_0x388a0a['include']?_['map'](_0x388a0a[_0x860a('0xc')],function(_0x5dd335){return{'model':db[_0x5dd335[_0x860a('0xe')]],'as':_0x5dd335['as'],'attributes':_0x5dd335[_0x860a('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8d5af8){logger[_0x860a('0x10')](_0x860a('0x15'),_0x41798b);logger['debug']('ShowCmHopper',_0x41798b,JSON[_0x860a('0x12')](_0x8d5af8));_0x13f0fb(_0x8d5af8);})['catch'](function(_0xf0e855){logger['error'](_0x860a('0x15'),_0xf0e855[_0x860a('0x14')],_0x41798b);_0xf0ac9f(_0x85c2e3[_0x860a('0x13')](0x1f4,_0xf0e855['message']));});});};exports[_0x860a('0x17')]=function(_0x3809c3){var _0x4ed18f=this;return new Promise(function(_0x457396,_0x28e4fd){return db[_0x860a('0x6')][_0x860a('0x18')](_0x3809c3[_0x860a('0x19')],{'raw':_0x3809c3[_0x860a('0x8')]?_0x3809c3[_0x860a('0x8')]['raw']===undefined?!![]:![]:!![]})[_0x860a('0x1a')](function(_0x403eae){logger[_0x860a('0x10')]('CreateCmHopper',_0x3809c3);logger[_0x860a('0x11')](_0x860a('0x17'),_0x3809c3,JSON[_0x860a('0x12')](_0x403eae));_0x457396(_0x403eae);})[_0x860a('0x1b')](function(_0x344cde){logger[_0x860a('0x13')](_0x860a('0x17'),_0x344cde[_0x860a('0x14')],_0x3809c3);_0x28e4fd(_0x4ed18f[_0x860a('0x13')](0x1f4,_0x344cde[_0x860a('0x14')]));});});};exports[_0x860a('0x1c')]=function(_0x525d36){var _0x559c30=this;return new Promise(function(_0x42f7ba,_0x415674){return db[_0x860a('0x6')][_0x860a('0x1d')](_0x525d36[_0x860a('0x19')],{'raw':_0x525d36[_0x860a('0x8')]?_0x525d36[_0x860a('0x8')][_0x860a('0x9')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x525d36[_0x860a('0x8')]?_0x525d36[_0x860a('0x8')][_0x860a('0xa')]||null:null,'attributes':_0x525d36[_0x860a('0x8')]?_0x525d36['options'][_0x860a('0xf')]||null:null,'limit':_0x525d36[_0x860a('0x8')]?_0x525d36[_0x860a('0x8')][_0x860a('0xb')]||null:null})[_0x860a('0x1a')](function(_0x670a9e){logger[_0x860a('0x10')](_0x860a('0x1c'),_0x525d36);logger[_0x860a('0x10')](_0x860a('0x1e'),JSON[_0x860a('0x12')](_0x525d36[_0x860a('0x8')][_0x860a('0xa')]),_0x525d36[_0x860a('0x19')]['active']);logger[_0x860a('0x11')](_0x860a('0x1c'),_0x525d36,JSON[_0x860a('0x12')](_0x670a9e));_0x42f7ba(_0x670a9e);})[_0x860a('0x1b')](function(_0x2deed9){logger['error']('UpdateCmHopper',_0x2deed9[_0x860a('0x14')],_0x525d36);_0x415674(_0x559c30['error'](0x1f4,_0x2deed9[_0x860a('0x14')]));});});};exports[_0x860a('0x1f')]=function(_0x3a13a6){var _0x1bb835=this;return new Promise(function(_0x3aa701,_0x3026fe){return db[_0x860a('0x6')][_0x860a('0x20')]({'where':_0x3a13a6[_0x860a('0x8')]?_0x3a13a6[_0x860a('0x8')][_0x860a('0xa')]||null:null})[_0x860a('0x1a')](function(_0x4d228e){logger['info']('DestroyCmHopper',_0x3a13a6);logger['debug']('DestroyCmHopper',_0x3a13a6,JSON[_0x860a('0x12')](_0x4d228e));_0x3aa701(_0x4d228e);})['catch'](function(_0x5b6e3b){logger['error'](_0x860a('0x1f'),_0x5b6e3b[_0x860a('0x14')],_0x3a13a6);_0x3026fe(_0x1bb835[_0x860a('0x13')](0x1f4,_0x5b6e3b[_0x860a('0x14')]));});});};exports[_0x860a('0x21')]=function(_0x409cf6){var _0x2bb2f6=this;return new Promise(function(_0x27b0c4,_0x3214bd){return db[_0x860a('0x22')][_0x860a('0x23')]()[_0x860a('0x1a')](function(_0x446a1e){return db['sequelize']['transaction'](function(_0x43f736){return db[_0x860a('0x6')][_0x860a('0x7')]({'where':_0x409cf6[_0x860a('0x8')]?_0x409cf6['options'][_0x860a('0xa')]||null:null,'attributes':_0x409cf6[_0x860a('0x8')]?_0x409cf6[_0x860a('0x8')][_0x860a('0xf')]||null:null,'limit':_0x409cf6['options']?_0x409cf6['options'][_0x860a('0xb')]||null:null,'order':_0x409cf6['options']?_0x409cf6['options'][_0x860a('0x24')]||null:null,'transaction':_0x43f736,'lock':_0x43f736['LOCK'][_0x860a('0x25')],'include':[{'model':db[_0x860a('0x22')],'as':_0x860a('0x26'),'attributes':_[_0x860a('0x27')](_0x446a1e)},{'model':db[_0x860a('0x28')],'as':'Agent','attributes':['id',_0x860a('0x29'),_0x860a('0x2a')]}]})[_0x860a('0x1a')](function(_0x3bd842){var _0x14efea=[];var _0x348750=[];for(var _0x91cadf=0x0;_0x91cadf<_0x3bd842['length'];_0x91cadf+=0x1){var _0x100e22=_0x3bd842[_0x91cadf]['UserId'];if(_0x100e22===null){_0x14efea[_0x860a('0x2b')](_0x3bd842[_0x91cadf][_0x860a('0x1d')](_0x409cf6[_0x860a('0x19')],{'transaction':_0x43f736}));}else if(!_0x348750['includes'](_0x100e22)){_0x348750['push'](_0x100e22);_0x14efea[_0x860a('0x2b')](_0x3bd842[_0x91cadf]['update'](_0x409cf6['body'],{'transaction':_0x43f736}));}}return BPromise[_0x860a('0x2c')](_0x14efea);});})['then'](function(_0x4afe41){logger[_0x860a('0x10')](_0x860a('0x21'),_0x409cf6);if(_0x4afe41[_0x860a('0x2d')]>0x0){logger[_0x860a('0x10')](_0x860a('0x2e'),_0x4afe41[0x0][_0x860a('0x2f')]['id'],_0x4afe41[0x0]['dataValues'][_0x860a('0x30')],_0x4afe41[0x0][_0x860a('0x2f')][_0x860a('0x31')]);}logger[_0x860a('0x11')](_0x860a('0x21'),_0x409cf6,JSON[_0x860a('0x12')](_0x4afe41));_0x27b0c4(_0x4afe41);})['catch'](function(_0x58dff9){logger[_0x860a('0x13')]('GetContactDialer',_0x58dff9[_0x860a('0x14')],_0x409cf6);_0x3214bd(_0x2bb2f6[_0x860a('0x13')](0x1f4,_0x58dff9[_0x860a('0x14')]));});});});};exports[_0x860a('0x32')]=function(_0xba8782){var _0x559f0f=this;return new Promise(function(_0x4c7cab,_0x44348f){return db['sequelize'][_0x860a('0x33')](function(_0x103220){return db[_0x860a('0x34')][_0x860a('0x18')](_0xba8782[_0x860a('0x19')],{'raw':_0xba8782[_0x860a('0x8')]?_0xba8782[_0x860a('0x8')][_0x860a('0x9')]===undefined?!![]:![]:!![],'transaction':_0x103220})[_0x860a('0x1a')](function(){logger[_0x860a('0x10')](_0x860a('0x35'),JSON[_0x860a('0x12')](_0xba8782[_0x860a('0x8')][_0x860a('0xa')]),_0xba8782[_0x860a('0x8')][_0x860a('0xa')][_0x860a('0x31')]);return db[_0x860a('0x6')][_0x860a('0x20')]({'where':_0xba8782[_0x860a('0x8')]?_0xba8782[_0x860a('0x8')][_0x860a('0xa')]||null:null,'transaction':_0x103220});});})[_0x860a('0x1a')](function(_0x3289d0){logger[_0x860a('0x10')](_0x860a('0x32'),_0xba8782);logger[_0x860a('0x11')]('MoveContactManagedDialer',_0xba8782,JSON[_0x860a('0x12')](_0x3289d0));_0x4c7cab(_0x3289d0);})[_0x860a('0x1b')](function(_0x371d86){logger[_0x860a('0x13')](_0x860a('0x32'),_0x371d86[_0x860a('0x14')],_0xba8782);_0x44348f(_0x559f0f[_0x860a('0x13')](0x1f4,_0x371d86[_0x860a('0x14')]));});});};exports[_0x860a('0x36')]=function(_0x8cc823){var _0x47ec75=this;return new Promise(function(_0x555f4a,_0x280c8d){return db[_0x860a('0x6')][_0x860a('0x7')]({'raw':_0x8cc823[_0x860a('0x8')]?_0x8cc823[_0x860a('0x8')][_0x860a('0x9')]===undefined?!![]:![]:!![],'where':_0x8cc823['options']?_0x8cc823[_0x860a('0x8')][_0x860a('0xa')]||null:null,'attributes':[[db['sequelize']['fn'](_0x860a('0x37'),db[_0x860a('0x38')]['fn']('IF',db[_0x860a('0x38')][_0x860a('0x39')](_0x860a('0x3a')+util['format'](_0x860a('0x3b'),moment()[_0x860a('0x3c')](_0x860a('0x3d')))+_0x860a('0x3e')))),_0x860a('0x3f')]]})[_0x860a('0x1a')](function(_0x11faa5){logger[_0x860a('0x10')](_0x860a('0x36'),_0x8cc823);logger[_0x860a('0x11')](_0x860a('0x36'),_0x8cc823,JSON['stringify'](_0x11faa5));_0x555f4a(_0x11faa5);})[_0x860a('0x1b')](function(_0x212607){logger['error'](_0x860a('0x36'),_0x212607[_0x860a('0x14')],_0x8cc823);_0x280c8d(_0x47ec75[_0x860a('0x13')](0x1f4,_0x212607[_0x860a('0x14')]));});});};exports[_0x860a('0x40')]=function(_0x1afb95){var _0x553fe2=this;return new Promise(function(_0x55d943,_0x3203cd){return db[_0x860a('0x22')]['describe']()[_0x860a('0x1a')](function(){return db[_0x860a('0x38')][_0x860a('0x33')](function(_0x215381){return db['CmHopper']['findAll']({'where':_0x1afb95[_0x860a('0x8')]?_0x1afb95[_0x860a('0x8')][_0x860a('0xa')]||null:null,'attributes':_0x1afb95[_0x860a('0x8')]?_0x1afb95[_0x860a('0x8')][_0x860a('0xf')]||null:null,'limit':0x1,'order':_0x1afb95[_0x860a('0x8')]?_0x1afb95['options'][_0x860a('0x24')]||null:null,'group':db['CmHopper'][_0x860a('0x41')],'transaction':_0x215381,'lock':_0x215381[_0x860a('0x42')][_0x860a('0x25')],'include':_0x1afb95[_0x860a('0x8')]?_0x1afb95['options']['include']?_[_0x860a('0xd')](_0x1afb95[_0x860a('0x8')][_0x860a('0xc')],function(_0x42137b){return{'model':db[_0x42137b[_0x860a('0xe')]],'as':_0x42137b['as'],'attributes':_0x42137b['attributes'],'include':_0x42137b[_0x860a('0xc')]?_[_0x860a('0xd')](_0x42137b['include'],function(_0x4e497e){return{'model':db[_0x4e497e['model']],'as':_0x4e497e['as'],'attributes':_0x4e497e[_0x860a('0xf')],'include':_0x4e497e[_0x860a('0xc')]?_['map'](_0x4e497e['include'],function(_0xa16182){return{'model':db[_0xa16182['model']],'as':_0xa16182['as'],'attributes':_0xa16182[_0x860a('0xf')]};}):[]};}):[]};}):[]:[]})[_0x860a('0x1a')](function(_0x24b552){var _0x2663fc=[];for(var _0x4fd7e6=0x0;_0x4fd7e6<_0x24b552[_0x860a('0x2d')];_0x4fd7e6+=0x1){_0x2663fc[_0x860a('0x2b')](_0x24b552[_0x4fd7e6][_0x860a('0x1d')](_0x1afb95[_0x860a('0x19')],{'transaction':_0x215381}));}return BPromise[_0x860a('0x2c')](_0x2663fc);});})[_0x860a('0x1a')](function(_0x45f9ea){logger[_0x860a('0x10')](_0x860a('0x40'),_0x1afb95);logger[_0x860a('0x11')](_0x860a('0x40'),_0x1afb95,JSON[_0x860a('0x12')](_0x45f9ea));_0x55d943(_0x45f9ea);})[_0x860a('0x1b')](function(_0x8806cb){logger[_0x860a('0x13')](_0x860a('0x40'),_0x8806cb[_0x860a('0x14')],_0x1afb95);_0x3203cd(_0x553fe2[_0x860a('0x13')](0x1f4,_0x8806cb[_0x860a('0x14')]));});});});};exports[_0x860a('0x43')]=function(_0x3ebfed){var _0x47d654=this;return new Promise(function(_0x109def,_0x36f996){db[_0x860a('0x22')]['describe']()[_0x860a('0x1a')](function(_0x58627b){return db[_0x860a('0x6')][_0x860a('0x7')]({'raw':_0x3ebfed[_0x860a('0x8')]?_0x3ebfed[_0x860a('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x3ebfed[_0x860a('0x8')]?_0x3ebfed[_0x860a('0x8')][_0x860a('0xa')]||null:null,'attributes':_0x3ebfed[_0x860a('0x8')]?_0x3ebfed[_0x860a('0x8')]['attributes']||null:null,'limit':_0x3ebfed[_0x860a('0x8')]?_0x3ebfed[_0x860a('0x8')][_0x860a('0xb')]||null:null,'include':_0x3ebfed[_0x860a('0x8')]?_0x3ebfed[_0x860a('0x8')][_0x860a('0xc')]?_[_0x860a('0xd')](_0x3ebfed[_0x860a('0x8')]['include'],function(_0x2efb82){return{'model':db[_0x2efb82[_0x860a('0xe')]],'as':_0x2efb82['as'],'attributes':_0x2efb82['as']===_0x860a('0x26')?_['keys'](_0x58627b):_0x2efb82[_0x860a('0xf')],'include':_0x2efb82[_0x860a('0xc')]?_['map'](_0x2efb82[_0x860a('0xc')],function(_0x1090ca){return{'model':db[_0x1090ca['model']],'as':_0x1090ca['as'],'attributes':_0x1090ca[_0x860a('0xf')],'include':_0x1090ca[_0x860a('0xc')]?_[_0x860a('0xd')](_0x1090ca[_0x860a('0xc')],function(_0x1e80fe){return{'model':db[_0x1e80fe['model']],'as':_0x1e80fe['as'],'attributes':_0x1e80fe[_0x860a('0xf')]};}):[]};}):[]};}):[]:[]})[_0x860a('0x1a')](function(_0x384f58){logger[_0x860a('0x10')](_0x860a('0x5'),_0x3ebfed);logger[_0x860a('0x11')]('GetCmHopper',_0x3ebfed,JSON[_0x860a('0x12')](_0x384f58));_0x109def(_0x384f58);})['catch'](function(_0x1a5f0e){logger[_0x860a('0x13')]('GetCmHopper',_0x1a5f0e[_0x860a('0x14')],_0x3ebfed);_0x36f996(_0x47d654[_0x860a('0x13')](0x1f4,_0x1a5f0e[_0x860a('0x14')]));});});});};exports[_0x860a('0x44')]=function(_0x27983d){var _0x430d73=this;return new Promise(function(_0x1e6d2f,_0x412b6c){return db[_0x860a('0x22')][_0x860a('0x45')]({'raw':!![],'where':{'phone':_0x27983d[_0x860a('0x8')][_0x860a('0xa')]['phone']},'attributes':['id','dialTimezone'],'order':[['id',_0x860a('0x46')]]})[_0x860a('0x1a')](function(_0x376622){logger['info'](_0x860a('0x47'),_0x27983d);logger[_0x860a('0x11')](_0x860a('0x47'),_0x27983d,JSON['stringify'](_0x376622));_0x1e6d2f(_0x376622);})['catch'](function(_0x5e9676){logger['error'](_0x860a('0x47'),_0x5e9676[_0x860a('0x14')],_0x27983d);_0x412b6c(_0x430d73[_0x860a('0x13')](0x1f4,_0x5e9676[_0x860a('0x14')]));});});};exports[_0x860a('0x48')]=function(_0x5ef95c){var _0x57f023=this;return new Promise(function(_0x18a867,_0x1a5529){return db[_0x860a('0x38')][_0x860a('0x33')](function(_0x3bbf6b){var _0x3b5773=_0x5ef95c[_0x860a('0x8')]&&_0x5ef95c[_0x860a('0x8')][_0x860a('0xa')]?_0x5ef95c[_0x860a('0x8')][_0x860a('0xa')]:{};return db['CmHopper'][_0x860a('0x1d')](_0x5ef95c[_0x860a('0x19')],{'where':_0x3b5773,'transaction':_0x3bbf6b})[_0x860a('0x1a')](function(_0x2d5072){logger['info'](_0x860a('0x48'),_0x5ef95c);logger[_0x860a('0x11')](_0x860a('0x48'),_0x5ef95c,JSON['stringify'](_0x2d5072));_0x18a867(_0x2d5072);})[_0x860a('0x1b')](function(_0x4a9c77){logger[_0x860a('0x13')](_0x860a('0x48'),_0x4a9c77[_0x860a('0x14')],_0x5ef95c);_0x1a5529(_0x57f023[_0x860a('0x13')](0x1f4,_0x4a9c77[_0x860a('0x14')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x243d0f){var _0x4490de=this;var _0x11b1ba=_0x243d0f[_0x860a('0x19')][_0x860a('0xa')][_0x860a('0x49')];var _0x2e9f53=_0x243d0f['body']['where']['interval'];var _0x2be9fb=_0x243d0f['body'][_0x860a('0xa')][_0x860a('0x4a')];return new Promise(function(_0x428a0f,_0x3c67e4){return db['CmHopper'][_0x860a('0x7')]({'where':{'voiceQueueId':{'$in':_0x11b1ba},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x860a('0x38')]['literal'](_0x860a('0x4b')+_0x2e9f53+_0x860a('0x4c')),'$gt':db[_0x860a('0x38')][_0x860a('0x39')](_0x860a('0x4d'))}},'UserId':{'$in':_0x2be9fb}},'include':[{'model':db[_0x860a('0x22')],'as':'Contact'},{'model':db[_0x860a('0x28')],'as':_0x860a('0x4e'),'attributes':['id',_0x860a('0x29'),'voicePause']},{'model':db[_0x860a('0x4f')],'as':_0x860a('0x50')}]})['then'](function(_0x4f3956){if(_0x4f3956['length']>0x0){return db['sequelize'][_0x860a('0x33')](function(_0x55a54a){return db[_0x860a('0x6')]['update']({'recallmeNotifiedDate':db[_0x860a('0x38')][_0x860a('0x39')](_0x860a('0x4d'))},{'where':{'id':{'$in':_['map'](_0x4f3956,'id')}},'transaction':_0x55a54a})[_0x860a('0x1a')](function(){_0x428a0f(_0x4f3956);})['catch'](function(_0x38c9dc){logger[_0x860a('0x13')]('CmHopperHandlePreviewRecallNotifications',_0x38c9dc[_0x860a('0x14')],_0x243d0f);_0x3c67e4(_0x4490de[_0x860a('0x13')](0x1f4,_0x38c9dc[_0x860a('0x14')]));});})[_0x860a('0x1b')](function(_0xf72ddb){logger[_0x860a('0x13')](_0x860a('0x51'),_0xf72ddb[_0x860a('0x14')],_0x243d0f);_0x3c67e4(_0x4490de[_0x860a('0x13')](0x1f4,_0xf72ddb[_0x860a('0x14')]));});}else{_0x428a0f(_0x4f3956);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 4ac4884..3a09b67 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 _0x9545=['delete','destroy','express','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','describe','/opencontacts','getOpenContacts','getTimezones','/:id','show','getPreviewRecall','post','create','/preview','getPreview','/timezone','getTimezone','put','update'];(function(_0x385b0b,_0x2faffa){var _0x50c84b=function(_0x355800){while(--_0x355800){_0x385b0b['push'](_0x385b0b['shift']());}};_0x50c84b(++_0x2faffa);}(_0x9545,0xe8));var _0x5954=function(_0x5962b4,_0x84be73){_0x5962b4=_0x5962b4-0x0;var _0xe6443c=_0x9545[_0x5962b4];return _0xe6443c;};'use strict';var express=require(_0x5954('0x0'));var router=express['Router']();var auth=require(_0x5954('0x1'));var controller=require(_0x5954('0x2'));router[_0x5954('0x3')]('/',auth[_0x5954('0x4')](),controller[_0x5954('0x5')]);router[_0x5954('0x3')]('/describe',auth[_0x5954('0x4')](),controller[_0x5954('0x6')]);router['get'](_0x5954('0x7'),auth[_0x5954('0x4')](),controller[_0x5954('0x8')]);router[_0x5954('0x3')]('/timezones',auth[_0x5954('0x4')](),controller[_0x5954('0x9')]);router[_0x5954('0x3')](_0x5954('0xa'),auth[_0x5954('0x4')](),controller[_0x5954('0xb')]);router['get']('/:id/previewrecall',auth[_0x5954('0x4')](),controller[_0x5954('0xc')]);router[_0x5954('0xd')]('/',auth['isAuthenticated'](),controller[_0x5954('0xe')]);router['post'](_0x5954('0xf'),auth[_0x5954('0x4')](),controller[_0x5954('0x10')]);router[_0x5954('0xd')](_0x5954('0x11'),auth[_0x5954('0x4')](),controller[_0x5954('0x12')]);router[_0x5954('0x13')]('/:id',auth[_0x5954('0x4')](),controller[_0x5954('0x14')]);router[_0x5954('0x15')]('/:id',auth[_0x5954('0x4')](),controller[_0x5954('0x16')]);module['exports']=router; \ No newline at end of file +var _0x9952=['isAuthenticated','index','/describe','describe','/opencontacts','/timezones','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','getTimezone','put','/:id','update','destroy','exports','express','Router','./cmHopper.controller','get'];(function(_0x513a35,_0x309c26){var _0x4a31d5=function(_0x574227){while(--_0x574227){_0x513a35['push'](_0x513a35['shift']());}};_0x4a31d5(++_0x309c26);}(_0x9952,0xcb));var _0x2995=function(_0x23c6f2,_0x4e033c){_0x23c6f2=_0x23c6f2-0x0;var _0x4c270b=_0x9952[_0x23c6f2];return _0x4c270b;};'use strict';var express=require(_0x2995('0x0'));var router=express[_0x2995('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x2995('0x2'));router[_0x2995('0x3')]('/',auth[_0x2995('0x4')](),controller[_0x2995('0x5')]);router[_0x2995('0x3')](_0x2995('0x6'),auth[_0x2995('0x4')](),controller[_0x2995('0x7')]);router['get'](_0x2995('0x8'),auth[_0x2995('0x4')](),controller['getOpenContacts']);router[_0x2995('0x3')](_0x2995('0x9'),auth[_0x2995('0x4')](),controller['getTimezones']);router[_0x2995('0x3')]('/:id',auth[_0x2995('0x4')](),controller[_0x2995('0xa')]);router[_0x2995('0x3')](_0x2995('0xb'),auth[_0x2995('0x4')](),controller[_0x2995('0xc')]);router[_0x2995('0xd')]('/',auth[_0x2995('0x4')](),controller[_0x2995('0xe')]);router['post'](_0x2995('0xf'),auth['isAuthenticated'](),controller[_0x2995('0x10')]);router['post']('/timezone',auth['isAuthenticated'](),controller[_0x2995('0x11')]);router[_0x2995('0x12')](_0x2995('0x13'),auth[_0x2995('0x4')](),controller[_0x2995('0x14')]);router['delete'](_0x2995('0x13'),auth[_0x2995('0x4')](),controller[_0x2995('0x15')]);module[_0x2995('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index d25ebbf..bb9fc68 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 _0x4b3b=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER','STRING'];(function(_0x33a253,_0x3bd729){var _0x166d51=function(_0x9cf8b1){while(--_0x9cf8b1){_0x33a253['push'](_0x33a253['shift']());}};_0x166d51(++_0x3bd729);}(_0x4b3b,0x19b));var _0xb4b3=function(_0x394a8f,_0x202459){_0x394a8f=_0x394a8f-0x0;var _0x11dcbf=_0x4b3b[_0x394a8f];return _0x11dcbf;};'use strict';var moment=require(_0xb4b3('0x0'));var Sequelize=require(_0xb4b3('0x1'));module[_0xb4b3('0x2')]={'CmHopperId':{'type':Sequelize[_0xb4b3('0x3')]},'phone':{'type':Sequelize[_0xb4b3('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xb4b3('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xb4b3('0x5')],'defaultValue':moment()[_0xb4b3('0x6')](_0xb4b3('0x7'))},'countbusyretry':{'type':Sequelize[_0xb4b3('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb4b3('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb4b3('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xb4b3('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb4b3('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb4b3('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb4b3('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb4b3('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xde41=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x4e5f27,_0x58efea){var _0x4b67ae=function(_0x83bb4d){while(--_0x83bb4d){_0x4e5f27['push'](_0x4e5f27['shift']());}};_0x4b67ae(++_0x58efea);}(_0xde41,0xf0));var _0x1de4=function(_0x57209c,_0x567249){_0x57209c=_0x57209c-0x0;var _0x575b1f=_0xde41[_0x57209c];return _0x575b1f;};'use strict';var moment=require('moment');var Sequelize=require(_0x1de4('0x0'));module[_0x1de4('0x1')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x1de4('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x1de4('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x1de4('0x4')],'defaultValue':moment()[_0x1de4('0x5')](_0x1de4('0x6'))},'countbusyretry':{'type':Sequelize[_0x1de4('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1de4('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1de4('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x1de4('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1de4('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1de4('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1de4('0x3')],'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 7cc440b..1742db3 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 _0xbb4e=['intersection','attributes','model','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','fs-extra','lodash','crypto','desk.js','to-csv','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','apply','reject','update','destroy','CmHopperAdditionalPhones','UserProfileResource','then','error','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','query','keys','filters'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0xbb4e,0x1be));var _0xebb4=function(_0x403115,_0x2d6d03){_0x403115=_0x403115-0x0;var _0x596ef3=_0xbb4e[_0x403115];return _0x596ef3;};'use strict';var emlformat=require(_0xebb4('0x0'));var rimraf=require(_0xebb4('0x1'));var zipdir=require(_0xebb4('0x2'));var jsonpatch=require(_0xebb4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xebb4('0x4'));var Mustache=require(_0xebb4('0x5'));var util=require(_0xebb4('0x6'));var path=require(_0xebb4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xebb4('0x8'));var _=require(_0xebb4('0x9'));var squel=require('squel');var crypto=require(_0xebb4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xebb4('0xb'));var toCsv=require(_0xebb4('0xc'));var querystring=require(_0xebb4('0xd'));var Papa=require(_0xebb4('0xe'));var Redis=require(_0xebb4('0xf'));var authService=require(_0xebb4('0x10'));var qs=require(_0xebb4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xebb4('0x12'))(_0xebb4('0x13'));var utils=require(_0xebb4('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xebb4('0x15'));var db=require(_0xebb4('0x16'))['db'];function respondWithStatusCode(_0xf4a161,_0x1efad2){_0x1efad2=_0x1efad2||0xcc;return function(_0x42e399){if(_0x42e399){return _0xf4a161[_0xebb4('0x17')](_0x1efad2);}return _0xf4a161[_0xebb4('0x18')](_0x1efad2)[_0xebb4('0x19')]();};}function respondWithResult(_0x5a6a2b,_0xd265cd){_0xd265cd=_0xd265cd||0xc8;return function(_0x150196){if(_0x150196){return _0x5a6a2b[_0xebb4('0x18')](_0xd265cd)[_0xebb4('0x1a')](_0x150196);}};}function respondWithFilteredResult(_0x409698,_0x23024e){return function(_0xb2f857){if(_0xb2f857){var _0x4fb60f=typeof _0x23024e[_0xebb4('0x1b')]===_0xebb4('0x1c')&&typeof _0x23024e[_0xebb4('0x1d')]===_0xebb4('0x1c');var _0x4ba0f4=_0xb2f857[_0xebb4('0x1e')];var _0x1900c2=_0x4fb60f?0x0:_0x23024e[_0xebb4('0x1b')];var _0x1d9e4e=_0x4fb60f?_0xb2f857[_0xebb4('0x1e')]:_0x23024e[_0xebb4('0x1b')]+_0x23024e[_0xebb4('0x1d')];var _0x12e5ec;if(_0x1d9e4e>=_0x4ba0f4){_0x1d9e4e=_0x4ba0f4;_0x12e5ec=0xc8;}else{_0x12e5ec=0xce;}_0x409698[_0xebb4('0x18')](_0x12e5ec);return _0x409698[_0xebb4('0x1f')](_0xebb4('0x20'),_0x1900c2+'-'+_0x1d9e4e+'/'+_0x4ba0f4)[_0xebb4('0x1a')](_0xb2f857);}return null;};}function patchUpdates(_0x556dd7){return function(_0x4fe4d7){try{jsonpatch[_0xebb4('0x21')](_0x4fe4d7,_0x556dd7,!![]);}catch(_0x2deef5){return BPromise[_0xebb4('0x22')](_0x2deef5);}return _0x4fe4d7['save']();};}function saveUpdates(_0x171486,_0x593e2b){return function(_0x5b7dc2){if(_0x5b7dc2){return _0x5b7dc2[_0xebb4('0x23')](_0x171486)['then'](function(_0x31f615){return _0x31f615;});}return null;};}function removeEntity(_0xc4d9e4,_0x2f7313){return function(_0x46828e){if(_0x46828e){return _0x46828e[_0xebb4('0x24')]()['then'](function(){var _0x16e1ab=_0x46828e['get']({'plain':!![]});var _0x54d6a1=_0xebb4('0x25');return db[_0xebb4('0x26')][_0xebb4('0x24')]({'where':{'type':_0x54d6a1,'resourceId':_0x16e1ab['id']}})[_0xebb4('0x27')](function(){return _0x46828e;});})['then'](function(){_0xc4d9e4[_0xebb4('0x18')](0xcc)[_0xebb4('0x19')]();});}};}function handleEntityNotFound(_0x41ac33,_0x28a0ba){return function(_0x409f0b){if(!_0x409f0b){_0x41ac33['sendStatus'](0x194);}return _0x409f0b;};}function handleError(_0x30f19c,_0x50ee2e){_0x50ee2e=_0x50ee2e||0x1f4;return function(_0x44dc82){logger[_0xebb4('0x28')](_0x44dc82['stack']);if(_0x44dc82[_0xebb4('0x29')]){delete _0x44dc82[_0xebb4('0x29')];}_0x30f19c[_0xebb4('0x18')](_0x50ee2e)[_0xebb4('0x2a')](_0x44dc82);};}exports[_0xebb4('0x2b')]=function(_0x40ec51,_0x50fd67){var _0xfec350={},_0x16875d={},_0x3ecf67={'count':0x0,'rows':[]};var _0x4e57c5=_[_0xebb4('0x2c')](db[_0xebb4('0x2d')][_0xebb4('0x2e')],function(_0x1c6add){return{'name':_0x1c6add[_0xebb4('0x2f')],'type':_0x1c6add[_0xebb4('0x30')]['key']};});_0x16875d['model']=_['map'](_0x4e57c5,_0xebb4('0x29'));_0x16875d[_0xebb4('0x31')]=_[_0xebb4('0x32')](_0x40ec51[_0xebb4('0x31')]);_0x16875d[_0xebb4('0x33')]=_[_0xebb4('0x34')](_0x16875d['model'],_0x16875d[_0xebb4('0x31')]);_0xfec350[_0xebb4('0x35')]=_[_0xebb4('0x34')](_0x16875d[_0xebb4('0x36')],qs[_0xebb4('0x37')](_0x40ec51[_0xebb4('0x31')][_0xebb4('0x37')]));_0xfec350[_0xebb4('0x35')]=_0xfec350['attributes'][_0xebb4('0x38')]?_0xfec350[_0xebb4('0x35')]:_0x16875d[_0xebb4('0x36')];if(!_0x40ec51[_0xebb4('0x31')][_0xebb4('0x39')]('nolimit')){_0xfec350['limit']=qs[_0xebb4('0x1d')](_0x40ec51[_0xebb4('0x31')][_0xebb4('0x1d')]);_0xfec350['offset']=qs[_0xebb4('0x1b')](_0x40ec51[_0xebb4('0x31')]['offset']);}_0xfec350[_0xebb4('0x3a')]=qs[_0xebb4('0x3b')](_0x40ec51['query'][_0xebb4('0x3b')]);_0xfec350['where']=qs[_0xebb4('0x33')](_[_0xebb4('0x3c')](_0x40ec51['query'],_0x16875d[_0xebb4('0x33')]),_0x4e57c5);if(_0x40ec51[_0xebb4('0x31')][_0xebb4('0x3d')]){_0xfec350[_0xebb4('0x3e')]=_[_0xebb4('0x3f')](_0xfec350[_0xebb4('0x3e')],{'$or':_[_0xebb4('0x2c')](_0x4e57c5,function(_0x1f3364){if(_0x1f3364['type']!==_0xebb4('0x40')){var _0x59f9fc={};_0x59f9fc[_0x1f3364[_0xebb4('0x29')]]={'$like':'%'+_0x40ec51[_0xebb4('0x31')][_0xebb4('0x3d')]+'%'};return _0x59f9fc;}})});}_0xfec350=_['merge']({},_0xfec350,_0x40ec51[_0xebb4('0x41')]);var _0x102de8={'where':_0xfec350[_0xebb4('0x3e')]};return db['CmHopperAdditionalPhone'][_0xebb4('0x1e')](_0x102de8)['then'](function(_0x326459){_0x3ecf67[_0xebb4('0x1e')]=_0x326459;if(_0x40ec51[_0xebb4('0x31')][_0xebb4('0x42')]){_0xfec350[_0xebb4('0x43')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0xebb4('0x44')](_0xfec350);})[_0xebb4('0x27')](function(_0x2e5e33){_0x3ecf67[_0xebb4('0x45')]=_0x2e5e33;return _0x3ecf67;})['then'](respondWithFilteredResult(_0x50fd67,_0xfec350))['catch'](handleError(_0x50fd67,null));};exports[_0xebb4('0x46')]=function(_0x1b707c,_0x556164){var _0x340eed={'raw':!![],'where':{'id':_0x1b707c[_0xebb4('0x47')]['id']}},_0x29dbd0={};_0x29dbd0[_0xebb4('0x36')]=_[_0xebb4('0x32')](db[_0xebb4('0x2d')][_0xebb4('0x2e')]);_0x29dbd0[_0xebb4('0x31')]=_[_0xebb4('0x32')](_0x1b707c[_0xebb4('0x31')]);_0x29dbd0['filters']=_[_0xebb4('0x34')](_0x29dbd0[_0xebb4('0x36')],_0x29dbd0['query']);_0x340eed['attributes']=_[_0xebb4('0x34')](_0x29dbd0[_0xebb4('0x36')],qs[_0xebb4('0x37')](_0x1b707c[_0xebb4('0x31')][_0xebb4('0x37')]));_0x340eed['attributes']=_0x340eed[_0xebb4('0x35')]['length']?_0x340eed[_0xebb4('0x35')]:_0x29dbd0[_0xebb4('0x36')];if(_0x1b707c['query'][_0xebb4('0x42')]){_0x340eed[_0xebb4('0x43')]=[{'all':!![]}];}_0x340eed=_['merge']({},_0x340eed,_0x1b707c['options']);return db[_0xebb4('0x2d')][_0xebb4('0x48')](_0x340eed)[_0xebb4('0x27')](handleEntityNotFound(_0x556164,null))[_0xebb4('0x27')](respondWithResult(_0x556164,null))[_0xebb4('0x49')](handleError(_0x556164,null));};exports['create']=function(_0x51fcd5,_0x587860){return db['CmHopperAdditionalPhone'][_0xebb4('0x4a')](_0x51fcd5[_0xebb4('0x4b')],{})[_0xebb4('0x27')](function(_0x17b356){var _0x5d736b=_0x51fcd5[_0xebb4('0x4c')][_0xebb4('0x4d')]({'plain':!![]});if(!_0x5d736b)throw new Error(_0xebb4('0x4e'));if(_0x5d736b['role']===_0xebb4('0x4c')){var _0xa9dba9=_0x17b356[_0xebb4('0x4d')]({'plain':!![]});var _0x4e79e1='CmHopperAdditionalPhones';return db[_0xebb4('0x4f')][_0xebb4('0x48')]({'where':{'name':_0x4e79e1,'userProfileId':_0x5d736b[_0xebb4('0x50')]},'raw':!![]})[_0xebb4('0x27')](function(_0x57697a){if(_0x57697a&&_0x57697a[_0xebb4('0x51')]===0x0){return db['UserProfileResource'][_0xebb4('0x4a')]({'name':_0xa9dba9[_0xebb4('0x29')],'resourceId':_0xa9dba9['id'],'type':_0x57697a['name'],'sectionId':_0x57697a['id']},{})[_0xebb4('0x27')](function(){return _0x17b356;});}else{return _0x17b356;}})[_0xebb4('0x49')](function(_0x1d2f18){logger[_0xebb4('0x28')](_0xebb4('0x52'),_0x1d2f18);throw _0x1d2f18;});}return _0x17b356;})['then'](respondWithResult(_0x587860,0xc9))[_0xebb4('0x49')](handleError(_0x587860,null));};exports[_0xebb4('0x23')]=function(_0xed08a4,_0x28fdc5){if(_0xed08a4['body']['id']){delete _0xed08a4[_0xebb4('0x4b')]['id'];}return db[_0xebb4('0x2d')][_0xebb4('0x48')]({'where':{'id':_0xed08a4[_0xebb4('0x47')]['id']}})['then'](handleEntityNotFound(_0x28fdc5,null))[_0xebb4('0x27')](saveUpdates(_0xed08a4['body'],null))[_0xebb4('0x27')](respondWithResult(_0x28fdc5,null))['catch'](handleError(_0x28fdc5,null));};exports[_0xebb4('0x24')]=function(_0x35fdef,_0x1089b3){return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x35fdef['params']['id']}})[_0xebb4('0x27')](handleEntityNotFound(_0x1089b3,null))['then'](removeEntity(_0x1089b3,null))[_0xebb4('0x49')](handleError(_0x1089b3,null));}; \ No newline at end of file +var _0xdc94=['get','UserProfileResource','error','stack','name','send','index','CmHopperAdditionalPhone','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','catch','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','CmHopperAdditionalPhones','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','lodash','crypto','ioredis','../../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','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x3fe54c,_0x5a4bcd){var _0x370328=function(_0xf1b04c){while(--_0xf1b04c){_0x3fe54c['push'](_0x3fe54c['shift']());}};_0x370328(++_0x5a4bcd);}(_0xdc94,0x1e4));var _0x4dc9=function(_0x2d72bd,_0xc16f3a){_0x2d72bd=_0x2d72bd-0x0;var _0x63a00a=_0xdc94[_0x2d72bd];return _0x63a00a;};'use strict';var emlformat=require(_0x4dc9('0x0'));var rimraf=require(_0x4dc9('0x1'));var zipdir=require(_0x4dc9('0x2'));var jsonpatch=require(_0x4dc9('0x3'));var rp=require('request-promise');var moment=require(_0x4dc9('0x4'));var BPromise=require(_0x4dc9('0x5'));var Mustache=require('mustache');var util=require(_0x4dc9('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4dc9('0x7'));var ejs=require(_0x4dc9('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4dc9('0x9'));var squel=require('squel');var crypto=require(_0x4dc9('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4dc9('0xb'));var authService=require(_0x4dc9('0xc'));var qs=require(_0x4dc9('0xd'));var as=require(_0x4dc9('0xe'));var hardwareService=require(_0x4dc9('0xf'));var logger=require(_0x4dc9('0x10'))('api');var utils=require(_0x4dc9('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x4dc9('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1dd811,_0x3c57c6){_0x3c57c6=_0x3c57c6||0xcc;return function(_0x29e2e8){if(_0x29e2e8){return _0x1dd811[_0x4dc9('0x13')](_0x3c57c6);}return _0x1dd811[_0x4dc9('0x14')](_0x3c57c6)[_0x4dc9('0x15')]();};}function respondWithResult(_0x366069,_0x7cc1d){_0x7cc1d=_0x7cc1d||0xc8;return function(_0x7fc639){if(_0x7fc639){return _0x366069['status'](_0x7cc1d)[_0x4dc9('0x16')](_0x7fc639);}};}function respondWithFilteredResult(_0xa6801b,_0x1cacaa){return function(_0x4ffbf9){if(_0x4ffbf9){var _0x58705b=typeof _0x1cacaa[_0x4dc9('0x17')]===_0x4dc9('0x18')&&typeof _0x1cacaa[_0x4dc9('0x19')]==='undefined';var _0x42a60d=_0x4ffbf9[_0x4dc9('0x1a')];var _0x2b086d=_0x58705b?0x0:_0x1cacaa[_0x4dc9('0x17')];var _0x42cbd7=_0x58705b?_0x4ffbf9[_0x4dc9('0x1a')]:_0x1cacaa['offset']+_0x1cacaa['limit'];var _0x6d455;if(_0x42cbd7>=_0x42a60d){_0x42cbd7=_0x42a60d;_0x6d455=0xc8;}else{_0x6d455=0xce;}_0xa6801b['status'](_0x6d455);return _0xa6801b['set'](_0x4dc9('0x1b'),_0x2b086d+'-'+_0x42cbd7+'/'+_0x42a60d)[_0x4dc9('0x16')](_0x4ffbf9);}return null;};}function patchUpdates(_0x2f0446){return function(_0x44b12d){try{jsonpatch[_0x4dc9('0x1c')](_0x44b12d,_0x2f0446,!![]);}catch(_0x3e5604){return BPromise[_0x4dc9('0x1d')](_0x3e5604);}return _0x44b12d[_0x4dc9('0x1e')]();};}function saveUpdates(_0x428389,_0x4cce71){return function(_0x373850){if(_0x373850){return _0x373850[_0x4dc9('0x1f')](_0x428389)[_0x4dc9('0x20')](function(_0x366617){return _0x366617;});}return null;};}function removeEntity(_0x315fcb,_0x394786){return function(_0x1e20cc){if(_0x1e20cc){return _0x1e20cc[_0x4dc9('0x21')]()['then'](function(){var _0x36368e=_0x1e20cc[_0x4dc9('0x22')]({'plain':!![]});var _0x270f5c='CmHopperAdditionalPhones';return db[_0x4dc9('0x23')]['destroy']({'where':{'type':_0x270f5c,'resourceId':_0x36368e['id']}})['then'](function(){return _0x1e20cc;});})[_0x4dc9('0x20')](function(){_0x315fcb['status'](0xcc)[_0x4dc9('0x15')]();});}};}function handleEntityNotFound(_0x11851,_0x53f61d){return function(_0x1ae9ec){if(!_0x1ae9ec){_0x11851[_0x4dc9('0x13')](0x194);}return _0x1ae9ec;};}function handleError(_0xc33840,_0xb687c2){_0xb687c2=_0xb687c2||0x1f4;return function(_0x3b6b82){logger[_0x4dc9('0x24')](_0x3b6b82[_0x4dc9('0x25')]);if(_0x3b6b82['name']){delete _0x3b6b82[_0x4dc9('0x26')];}_0xc33840[_0x4dc9('0x14')](_0xb687c2)[_0x4dc9('0x27')](_0x3b6b82);};}exports[_0x4dc9('0x28')]=function(_0x4e9d9c,_0xf31d31){var _0x4d571d={},_0x7994c6={},_0x5ac31d={'count':0x0,'rows':[]};var _0x58bc1b=_['map'](db[_0x4dc9('0x29')]['rawAttributes'],function(_0x141fa6){return{'name':_0x141fa6['fieldName'],'type':_0x141fa6['type'][_0x4dc9('0x2a')]};});_0x7994c6['model']=_[_0x4dc9('0x2b')](_0x58bc1b,_0x4dc9('0x26'));_0x7994c6[_0x4dc9('0x2c')]=_[_0x4dc9('0x2d')](_0x4e9d9c[_0x4dc9('0x2c')]);_0x7994c6[_0x4dc9('0x2e')]=_[_0x4dc9('0x2f')](_0x7994c6[_0x4dc9('0x30')],_0x7994c6[_0x4dc9('0x2c')]);_0x4d571d[_0x4dc9('0x31')]=_[_0x4dc9('0x2f')](_0x7994c6['model'],qs[_0x4dc9('0x32')](_0x4e9d9c[_0x4dc9('0x2c')][_0x4dc9('0x32')]));_0x4d571d[_0x4dc9('0x31')]=_0x4d571d[_0x4dc9('0x31')]['length']?_0x4d571d[_0x4dc9('0x31')]:_0x7994c6[_0x4dc9('0x30')];if(!_0x4e9d9c[_0x4dc9('0x2c')][_0x4dc9('0x33')](_0x4dc9('0x34'))){_0x4d571d[_0x4dc9('0x19')]=qs[_0x4dc9('0x19')](_0x4e9d9c['query'][_0x4dc9('0x19')]);_0x4d571d[_0x4dc9('0x17')]=qs[_0x4dc9('0x17')](_0x4e9d9c['query'][_0x4dc9('0x17')]);}_0x4d571d[_0x4dc9('0x35')]=qs[_0x4dc9('0x36')](_0x4e9d9c[_0x4dc9('0x2c')][_0x4dc9('0x36')]);_0x4d571d[_0x4dc9('0x37')]=qs[_0x4dc9('0x2e')](_['pick'](_0x4e9d9c[_0x4dc9('0x2c')],_0x7994c6[_0x4dc9('0x2e')]),_0x58bc1b);if(_0x4e9d9c[_0x4dc9('0x2c')][_0x4dc9('0x38')]){_0x4d571d[_0x4dc9('0x37')]=_[_0x4dc9('0x39')](_0x4d571d[_0x4dc9('0x37')],{'$or':_[_0x4dc9('0x2b')](_0x58bc1b,function(_0x39e84d){if(_0x39e84d['type']!=='VIRTUAL'){var _0x40c344={};_0x40c344[_0x39e84d['name']]={'$like':'%'+_0x4e9d9c[_0x4dc9('0x2c')][_0x4dc9('0x38')]+'%'};return _0x40c344;}})});}_0x4d571d=_[_0x4dc9('0x39')]({},_0x4d571d,_0x4e9d9c[_0x4dc9('0x3a')]);var _0x24a6a1={'where':_0x4d571d[_0x4dc9('0x37')]};return db['CmHopperAdditionalPhone'][_0x4dc9('0x1a')](_0x24a6a1)[_0x4dc9('0x20')](function(_0x1e4bbb){_0x5ac31d[_0x4dc9('0x1a')]=_0x1e4bbb;if(_0x4e9d9c[_0x4dc9('0x2c')][_0x4dc9('0x3b')]){_0x4d571d['include']=[{'all':!![]}];}return db[_0x4dc9('0x29')][_0x4dc9('0x3c')](_0x4d571d);})[_0x4dc9('0x20')](function(_0x1a7d85){_0x5ac31d['rows']=_0x1a7d85;return _0x5ac31d;})[_0x4dc9('0x20')](respondWithFilteredResult(_0xf31d31,_0x4d571d))[_0x4dc9('0x3d')](handleError(_0xf31d31,null));};exports['show']=function(_0x253fd7,_0x5c5b05){var _0x115b24={'raw':!![],'where':{'id':_0x253fd7[_0x4dc9('0x3e')]['id']}},_0x2af733={};_0x2af733[_0x4dc9('0x30')]=_[_0x4dc9('0x2d')](db[_0x4dc9('0x29')][_0x4dc9('0x3f')]);_0x2af733[_0x4dc9('0x2c')]=_[_0x4dc9('0x2d')](_0x253fd7[_0x4dc9('0x2c')]);_0x2af733[_0x4dc9('0x2e')]=_[_0x4dc9('0x2f')](_0x2af733[_0x4dc9('0x30')],_0x2af733[_0x4dc9('0x2c')]);_0x115b24[_0x4dc9('0x31')]=_['intersection'](_0x2af733[_0x4dc9('0x30')],qs[_0x4dc9('0x32')](_0x253fd7[_0x4dc9('0x2c')][_0x4dc9('0x32')]));_0x115b24[_0x4dc9('0x31')]=_0x115b24['attributes'][_0x4dc9('0x40')]?_0x115b24[_0x4dc9('0x31')]:_0x2af733[_0x4dc9('0x30')];if(_0x253fd7[_0x4dc9('0x2c')]['includeAll']){_0x115b24['include']=[{'all':!![]}];}_0x115b24=_[_0x4dc9('0x39')]({},_0x115b24,_0x253fd7['options']);return db[_0x4dc9('0x29')][_0x4dc9('0x41')](_0x115b24)['then'](handleEntityNotFound(_0x5c5b05,null))[_0x4dc9('0x20')](respondWithResult(_0x5c5b05,null))['catch'](handleError(_0x5c5b05,null));};exports[_0x4dc9('0x42')]=function(_0x2559b0,_0x38026c){return db['CmHopperAdditionalPhone']['create'](_0x2559b0[_0x4dc9('0x43')],{})[_0x4dc9('0x20')](function(_0x251bd3){var _0x728a88=_0x2559b0[_0x4dc9('0x44')][_0x4dc9('0x22')]({'plain':!![]});if(!_0x728a88)throw new Error(_0x4dc9('0x45'));if(_0x728a88['role']==='user'){var _0x340064=_0x251bd3[_0x4dc9('0x22')]({'plain':!![]});var _0x120f3c=_0x4dc9('0x46');return db[_0x4dc9('0x47')][_0x4dc9('0x41')]({'where':{'name':_0x120f3c,'userProfileId':_0x728a88[_0x4dc9('0x48')]},'raw':!![]})[_0x4dc9('0x20')](function(_0x19a6d0){if(_0x19a6d0&&_0x19a6d0[_0x4dc9('0x49')]===0x0){return db['UserProfileResource'][_0x4dc9('0x42')]({'name':_0x340064['name'],'resourceId':_0x340064['id'],'type':_0x19a6d0['name'],'sectionId':_0x19a6d0['id']},{})['then'](function(){return _0x251bd3;});}else{return _0x251bd3;}})[_0x4dc9('0x3d')](function(_0x32f81a){logger[_0x4dc9('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32f81a);throw _0x32f81a;});}return _0x251bd3;})['then'](respondWithResult(_0x38026c,0xc9))['catch'](handleError(_0x38026c,null));};exports[_0x4dc9('0x1f')]=function(_0x9cbf0,_0xdc1afa){if(_0x9cbf0[_0x4dc9('0x43')]['id']){delete _0x9cbf0[_0x4dc9('0x43')]['id'];}return db[_0x4dc9('0x29')][_0x4dc9('0x41')]({'where':{'id':_0x9cbf0[_0x4dc9('0x3e')]['id']}})[_0x4dc9('0x20')](handleEntityNotFound(_0xdc1afa,null))[_0x4dc9('0x20')](saveUpdates(_0x9cbf0[_0x4dc9('0x43')],null))[_0x4dc9('0x20')](respondWithResult(_0xdc1afa,null))['catch'](handleError(_0xdc1afa,null));};exports[_0x4dc9('0x21')]=function(_0x521ad2,_0x37aa30){return db[_0x4dc9('0x29')]['find']({'where':{'id':_0x521ad2[_0x4dc9('0x3e')]['id']}})['then'](handleEntityNotFound(_0x37aa30,null))[_0x4dc9('0x20')](removeEntity(_0x37aa30,null))['catch'](handleError(_0x37aa30,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 1d76228..1312873 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 _0xf682=['util','../../config/logger','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','cm_hopper_additional_phones'];(function(_0x1225fc,_0x24a2e1){var _0x304002=function(_0x57f347){while(--_0x57f347){_0x1225fc['push'](_0x1225fc['shift']());}};_0x304002(++_0x24a2e1);}(_0xf682,0x1a4));var _0x2f68=function(_0x274078,_0x1b48ff){_0x274078=_0x274078-0x0;var _0x1a4a8e=_0xf682[_0x274078];return _0x1a4a8e;};'use strict';var _=require('lodash');var util=require(_0x2f68('0x0'));var logger=require(_0x2f68('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2f68('0x2'));var fs=require('fs');var path=require(_0x2f68('0x3'));var rimraf=require(_0x2f68('0x4'));var config=require(_0x2f68('0x5'));var attributes=require(_0x2f68('0x6'));module[_0x2f68('0x7')]=function(_0x59b25e,_0x1d8b3c){return _0x59b25e[_0x2f68('0x8')]('CmHopperAdditionalPhone',attributes,{'tableName':_0x2f68('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x03f5=['CmHopperAdditionalPhone','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','exports','define'];(function(_0x202281,_0x232389){var _0x3d3abe=function(_0x548acf){while(--_0x548acf){_0x202281['push'](_0x202281['shift']());}};_0x3d3abe(++_0x232389);}(_0x03f5,0xc9));var _0x503f=function(_0x11ec53,_0x37fd2b){_0x11ec53=_0x11ec53-0x0;var _0x4b46da=_0x03f5[_0x11ec53];return _0x4b46da;};'use strict';var _=require(_0x503f('0x0'));var util=require(_0x503f('0x1'));var logger=require(_0x503f('0x2'))(_0x503f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x503f('0x4'));var rimraf=require(_0x503f('0x5'));var config=require(_0x503f('0x6'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x503f('0x7')]=function(_0x3038d3,_0x2d642f){return _0x3038d3[_0x503f('0x8')](_0x503f('0x9'),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 5ee86f9..f0dfbd3 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 _0x73d3=['then','countbusyretry','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','countnosuchnumberretry','countagentrejectretry','catch','CmHopper','duration','waitTime','isNil','scheduledat','minutes','add','countnoanswerretry','createdAt','updatedAt','phone','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','VerifyAdditionalPhones','ContactId','body','ListId','VoiceQueueId','CampaignId','findOne','OrderBy','ASC'];(function(_0xb8dc44,_0x226016){var _0x1698ec=function(_0x403b37){while(--_0x403b37){_0xb8dc44['push'](_0xb8dc44['shift']());}};_0x1698ec(++_0x226016);}(_0x73d3,0x15f));var _0x373d=function(_0x430b42,_0x3b2121){_0x430b42=_0x430b42-0x0;var _0x6a065c=_0x73d3[_0x430b42];return _0x6a065c;};'use strict';var _=require(_0x373d('0x0'));var util=require('util');var moment=require(_0x373d('0x1'));var BPromise=require(_0x373d('0x2'));var rs=require(_0x373d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x373d('0x4'));var logger=require(_0x373d('0x5'))('rpc');var config=require(_0x373d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x373d('0x7')][_0x373d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x177194,_0x8b5244,_0x571a53){return new BPromise(function(_0x220514,_0x14296a){return client[_0x373d('0x9')](_0x177194,_0x571a53)['then'](function(_0x4ccada){logger[_0x373d('0xa')](_0x373d('0xb'),_0x8b5244,_0x373d('0xc'));logger['debug']('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x8b5244,'request\x20sent',JSON[_0x373d('0xd')](_0x4ccada));if(_0x4ccada['error']){if(_0x4ccada[_0x373d('0xe')][_0x373d('0xf')]===0x1f4){logger[_0x373d('0xe')](_0x373d('0xb'),_0x8b5244,_0x4ccada[_0x373d('0xe')][_0x373d('0x10')]);return _0x14296a(_0x4ccada[_0x373d('0xe')][_0x373d('0x10')]);}logger[_0x373d('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x8b5244,_0x4ccada[_0x373d('0xe')]['message']);return _0x220514(_0x4ccada[_0x373d('0xe')]['message']);}else{logger[_0x373d('0xa')](_0x373d('0xb'),_0x8b5244,_0x373d('0xc'));_0x220514(_0x4ccada[_0x373d('0x11')][_0x373d('0x10')]);}})['catch'](function(_0x42b071){logger[_0x373d('0xe')](_0x373d('0xb'),_0x8b5244,_0x42b071);_0x14296a(_0x42b071);});});}exports[_0x373d('0x12')]=function(_0x12d580){var _0x241bc3=this;return new Promise(function(_0x5a51ef,_0x441dae){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x12d580['body'][_0x373d('0x13')],'ListId':_0x12d580[_0x373d('0x14')][_0x373d('0x15')],'VoiceQueueId':_0x12d580[_0x373d('0x14')][_0x373d('0x16')]===undefined?null:_0x12d580['body'][_0x373d('0x16')],'CampaignId':_0x12d580[_0x373d('0x14')]['CampaignId']===undefined?null:_0x12d580[_0x373d('0x14')][_0x373d('0x17')]}})['then'](function(_0xaa034a){if(_0xaa034a!=null){return db['CmHopperAdditionalPhone'][_0x373d('0x18')]({'raw':!![],'where':{'CmHopperId':_0xaa034a['id'],'OrderBy':{'$gt':_0xaa034a[_0x373d('0x19')]}},'order':[[_0x373d('0x19'),_0x373d('0x1a')]]})[_0x373d('0x1b')](function(_0x3597a0){var _0xe8d193=0x0;if(_0x3597a0){if(_0x3597a0[_0x373d('0x1c')]+_0x3597a0[_0x373d('0x1d')]+_0x3597a0['countnoanswerretry']+_0x3597a0['countnosuchnumberretry']+_0x3597a0[_0x373d('0x1e')]+_0x3597a0[_0x373d('0x1f')]+_0x3597a0[_0x373d('0x20')]+_0x3597a0['countagentrejectretry']<_0x12d580[_0x373d('0x21')][_0x373d('0x22')])_0xe8d193=0x1;_0x5a51ef({'additional':_0xe8d193});}else{return db[_0x373d('0x23')]['findOne']({'raw':!![],'where':{'CmHopperId':_0xaa034a['id']},'order':[['OrderBy',_0x373d('0x1a')]]})[_0x373d('0x1b')](function(_0x2efa5d){var _0x2db722=0x0;if(_0x2efa5d){if(_0x2efa5d[_0x373d('0x1c')]+_0x2efa5d[_0x373d('0x1d')]+_0x2efa5d['countnoanswerretry']+_0x2efa5d[_0x373d('0x24')]+_0x2efa5d[_0x373d('0x1e')]+_0x2efa5d[_0x373d('0x1f')]+_0x2efa5d['countmachineretry']+_0x2efa5d[_0x373d('0x25')]<_0x12d580[_0x373d('0x21')][_0x373d('0x22')])_0x2db722=0x1;_0x5a51ef({'additional':_0x2db722});}else{_0x5a51ef({'additional':0x0});}})[_0x373d('0x26')](function(_0x169734){logger['error']('VerifyAdditionalPhones',_0x169734[_0x373d('0x10')]);_0x441dae(_0x241bc3[_0x373d('0xe')](0x1f4,_0x169734[_0x373d('0x10')]));});}})[_0x373d('0x26')](function(_0x3d3f76){logger[_0x373d('0xe')](_0x373d('0x12'),_0x3d3f76[_0x373d('0x10')]);_0x441dae(_0x241bc3['error'](0x1f4,_0x3d3f76['message']));});}else _0x5a51ef({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x46d39d){var _0xebf452=this;return new Promise(function(_0x250053,_0x294420){return db[_0x373d('0x27')]['findOne']({'raw':!![],'where':{'ContactId':_0x46d39d[_0x373d('0x14')][_0x373d('0x13')],'ListId':_0x46d39d[_0x373d('0x14')][_0x373d('0x15')],'VoiceQueueId':_0x46d39d[_0x373d('0x14')][_0x373d('0x16')]===undefined?null:_0x46d39d['body'][_0x373d('0x16')],'CampaignId':_0x46d39d[_0x373d('0x14')][_0x373d('0x17')]===undefined?null:_0x46d39d['body']['CampaignId']}})[_0x373d('0x1b')](function(_0x46136f){if(_0x46136f!=null){return db[_0x373d('0x23')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x46136f['id'],'OrderBy':{'$gte':_0x46136f['OrderBy']}},'order':[[_0x373d('0x19'),_0x373d('0x1a')]]})['then'](function(_0xb83cc0){if(_0xb83cc0)return activateAdditionalPhone(_0x46136f,_0x46d39d[_0x373d('0x14')],_0xb83cc0,_0x46d39d[_0x373d('0x28')],_0x46d39d[_0x373d('0x29')])[_0x373d('0x1b')](function(_0x35c445){_0x250053(_0x35c445);});else{return db['CmHopperAdditionalPhone'][_0x373d('0x18')]({'raw':!![],'where':{'CmHopperId':_0x46136f['id']},'order':[[_0x373d('0x19'),'ASC']]})[_0x373d('0x1b')](function(_0x1c3c8e){if(_0x1c3c8e)return activateAdditionalPhone(_0x46136f,_0x46d39d['body'],_0x1c3c8e,_0x46d39d[_0x373d('0x28')],_0x46d39d[_0x373d('0x29')])[_0x373d('0x1b')](function(_0x5d1752){_0x250053(_0x5d1752);});else{_0x250053({'id':_0x46136f['id'],'phone':''});}})[_0x373d('0x26')](function(_0xfbb743){logger[_0x373d('0xe')]('VerifyAdditionalPhones',_0xfbb743['message']);_0x294420(_0xebf452[_0x373d('0xe')](0x1f4,_0xfbb743[_0x373d('0x10')]));});}})[_0x373d('0x26')](function(_0x2c7366){logger[_0x373d('0xe')](_0x373d('0x12'),_0x2c7366[_0x373d('0x10')]);_0x294420(_0xebf452[_0x373d('0xe')](0x1f4,_0x2c7366[_0x373d('0x10')]));});}else _0x250053(0x1);});});};function activateAdditionalPhone(_0x48956c,_0x27fd24,_0x1b3528,_0x304851,_0x355708){return new Promise(function(_0x424945,_0x1bc56d){var _0x52fd63;if(_[_0x373d('0x2a')](_0x1b3528[_0x373d('0x2b')])){_0x1b3528['scheduledat']=moment();}if(moment()>moment(_0x1b3528['scheduledat'])){_0x52fd63=moment()['add'](_0x355708||0x3,_0x373d('0x2c'));}else{if(_0x1b3528[_0x373d('0x19')]==0x0){_0x52fd63=moment(_0x1b3528[_0x373d('0x2b')]);}else{_0x52fd63=moment()[_0x373d('0x2d')](_0x355708||0x3,'minutes');}}if(_['isNil'](_0x52fd63)){_0x52fd63=moment()['add'](_0x355708||0x3,_0x373d('0x2c'));}var _0x1d0fd7={'phone':_0x48956c['phone'],'active':0x0,'OrderBy':_['isNil'](_0x48956c[_0x373d('0x19')])?0x0:_0x48956c[_0x373d('0x19')],'scheduledat':moment()[_0x373d('0x2d')](_0x304851||0x1,_0x373d('0x2c')),'countbusyretry':_0x27fd24[_0x373d('0x1c')],'countcongestionretry':_0x27fd24[_0x373d('0x1d')],'countnoanswerretry':_0x27fd24[_0x373d('0x2e')],'countnosuchnumberretry':_0x27fd24[_0x373d('0x24')],'countdropretry':_0x27fd24[_0x373d('0x1e')],'countabandonedretry':_0x27fd24['countabandonedretry'],'countmachineretry':_0x27fd24[_0x373d('0x20')],'countagentrejectretry':_0x27fd24['countagentrejectretry'],'createdAt':_0x27fd24[_0x373d('0x2f')],'updatedAt':_0x27fd24[_0x373d('0x30')]};var _0x52dee5={'CmHopperId':_0x48956c['id'],'phone':_0x1b3528[_0x373d('0x31')],'active':0x0,'OrderBy':_[_0x373d('0x2a')](_0x1b3528['OrderBy'])?0x0:_0x1b3528['OrderBy'],'scheduledat':_0x52fd63,'countbusyretry':_0x1b3528['countbusyretry'],'countcongestionretry':_0x1b3528['countcongestionretry'],'countnoanswerretry':_0x1b3528['countnoanswerretry'],'countnosuchnumberretry':_0x1b3528['countnosuchnumberretry'],'countdropretry':_0x1b3528[_0x373d('0x1e')],'countabandonedretry':_0x1b3528[_0x373d('0x1f')],'countmachineretry':_0x1b3528[_0x373d('0x20')],'countagentrejectretry':_0x1b3528[_0x373d('0x25')],'createdAt':_0x1b3528[_0x373d('0x2f')],'updatedAt':_0x1b3528['updatedAt']};return db['sequelize']['transaction'](function(_0x182ddc){return db[_0x373d('0x23')][_0x373d('0x32')](_0x1d0fd7,{'where':{'id':_0x1b3528['id']}},{'transaction':_0x182ddc})[_0x373d('0x1b')](function(){return db[_0x373d('0x27')][_0x373d('0x32')](_0x52dee5,{'where':{'id':_0x48956c['id']}},{'transaction':_0x182ddc});});})['then'](function(_0x3c11c9){_0x424945({'id':_0x48956c['id'],'phone':_0x1b3528[_0x373d('0x31')]});})[_0x373d('0x26')](function(_0x369887){logger[_0x373d('0xe')](_0x373d('0x33'),_0x369887[_0x373d('0x10')]);_0x1bc56d({'error':_0x369887[_0x373d('0x10')]});});});}exports[_0x373d('0x34')]=function(_0x34001d){var _0x463306=this;return new Promise(function(_0x2e3470,_0x4eeb13){return db['CmHopper'][_0x373d('0x32')](_0x34001d[_0x373d('0x14')][_0x373d('0x35')],{'where':{'id':_0x34001d[_0x373d('0x14')]['id']}})['then'](function(_0xaf1ccd){_0x2e3470(_0xaf1ccd);})['catch'](function(_0x321220){logger['error'](_0x373d('0x34'),_0x321220[_0x373d('0x10')]);_0x4eeb13(_0x463306[_0x373d('0xe')](0x1f4,_0x321220[_0x373d('0x10')]));});});}; \ No newline at end of file +var _0x5289=['transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VerifyAdditionalPhones','CmHopper','ListId','VoiceQueueId','body','CampaignId','then','CmHopperAdditionalPhone','findOne','OrderBy','ASC','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','sequelize'];(function(_0x6ca542,_0x42bdeb){var _0x364a74=function(_0x33e420){while(--_0x33e420){_0x6ca542['push'](_0x6ca542['shift']());}};_0x364a74(++_0x42bdeb);}(_0x5289,0x1bd));var _0x9528=function(_0x12565e,_0x4640b4){_0x12565e=_0x12565e-0x0;var _0x338be7=_0x5289[_0x12565e];return _0x338be7;};'use strict';var _=require(_0x9528('0x0'));var util=require(_0x9528('0x1'));var moment=require(_0x9528('0x2'));var BPromise=require(_0x9528('0x3'));var rs=require(_0x9528('0x4'));var fs=require('fs');var Redis=require(_0x9528('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9528('0x6'));var logger=require(_0x9528('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9528('0x8'));var client=jayson[_0x9528('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x294821,_0x28db7c,_0x358b61){return new BPromise(function(_0x208229,_0x2c7bb7){return client[_0x9528('0xa')](_0x294821,_0x358b61)['then'](function(_0x49df58){logger[_0x9528('0xb')](_0x9528('0xc'),_0x28db7c,_0x9528('0xd'));logger['debug'](_0x9528('0xe'),_0x28db7c,_0x9528('0xd'),JSON[_0x9528('0xf')](_0x49df58));if(_0x49df58[_0x9528('0x10')]){if(_0x49df58[_0x9528('0x10')][_0x9528('0x11')]===0x1f4){logger[_0x9528('0x10')](_0x9528('0xc'),_0x28db7c,_0x49df58[_0x9528('0x10')]['message']);return _0x2c7bb7(_0x49df58[_0x9528('0x10')][_0x9528('0x12')]);}logger['error'](_0x9528('0xc'),_0x28db7c,_0x49df58[_0x9528('0x10')][_0x9528('0x12')]);return _0x208229(_0x49df58['error'][_0x9528('0x12')]);}else{logger[_0x9528('0xb')](_0x9528('0xc'),_0x28db7c,_0x9528('0xd'));_0x208229(_0x49df58[_0x9528('0x13')][_0x9528('0x12')]);}})[_0x9528('0x14')](function(_0x315b5f){logger[_0x9528('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x28db7c,_0x315b5f);_0x2c7bb7(_0x315b5f);});});}exports[_0x9528('0x15')]=function(_0x1f1250){var _0x18745c=this;return new Promise(function(_0x19f382,_0x3bc515){return db[_0x9528('0x16')]['findOne']({'raw':!![],'where':{'ContactId':_0x1f1250['body']['ContactId'],'ListId':_0x1f1250['body'][_0x9528('0x17')],'VoiceQueueId':_0x1f1250['body'][_0x9528('0x18')]===undefined?null:_0x1f1250['body'][_0x9528('0x18')],'CampaignId':_0x1f1250[_0x9528('0x19')]['CampaignId']===undefined?null:_0x1f1250[_0x9528('0x19')][_0x9528('0x1a')]}})[_0x9528('0x1b')](function(_0x4f1abd){if(_0x4f1abd!=null){return db[_0x9528('0x1c')][_0x9528('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x4f1abd['id'],'OrderBy':{'$gt':_0x4f1abd[_0x9528('0x1e')]}},'order':[[_0x9528('0x1e'),_0x9528('0x1f')]]})[_0x9528('0x1b')](function(_0x15f19f){var _0x408d94=0x0;if(_0x15f19f){if(_0x15f19f[_0x9528('0x20')]+_0x15f19f['countcongestionretry']+_0x15f19f[_0x9528('0x21')]+_0x15f19f[_0x9528('0x22')]+_0x15f19f[_0x9528('0x23')]+_0x15f19f[_0x9528('0x24')]+_0x15f19f[_0x9528('0x25')]+_0x15f19f[_0x9528('0x26')]<_0x1f1250[_0x9528('0x27')][_0x9528('0x28')])_0x408d94=0x1;_0x19f382({'additional':_0x408d94});}else{return db[_0x9528('0x1c')][_0x9528('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x4f1abd['id']},'order':[['OrderBy','ASC']]})[_0x9528('0x1b')](function(_0x339463){var _0x587bd2=0x0;if(_0x339463){if(_0x339463[_0x9528('0x20')]+_0x339463['countcongestionretry']+_0x339463[_0x9528('0x21')]+_0x339463[_0x9528('0x22')]+_0x339463[_0x9528('0x23')]+_0x339463[_0x9528('0x24')]+_0x339463[_0x9528('0x25')]+_0x339463[_0x9528('0x26')]<_0x1f1250[_0x9528('0x27')][_0x9528('0x28')])_0x587bd2=0x1;_0x19f382({'additional':_0x587bd2});}else{_0x19f382({'additional':0x0});}})[_0x9528('0x14')](function(_0x11154d){logger[_0x9528('0x10')]('VerifyAdditionalPhones',_0x11154d['message']);_0x3bc515(_0x18745c[_0x9528('0x10')](0x1f4,_0x11154d[_0x9528('0x12')]));});}})[_0x9528('0x14')](function(_0x3539b0){logger['error'](_0x9528('0x15'),_0x3539b0['message']);_0x3bc515(_0x18745c[_0x9528('0x10')](0x1f4,_0x3539b0[_0x9528('0x12')]));});}else _0x19f382({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x2f3f7d){var _0x46642c=this;return new Promise(function(_0x503aac,_0x43988c){return db[_0x9528('0x16')][_0x9528('0x1d')]({'raw':!![],'where':{'ContactId':_0x2f3f7d['body']['ContactId'],'ListId':_0x2f3f7d[_0x9528('0x19')][_0x9528('0x17')],'VoiceQueueId':_0x2f3f7d[_0x9528('0x19')][_0x9528('0x18')]===undefined?null:_0x2f3f7d[_0x9528('0x19')][_0x9528('0x18')],'CampaignId':_0x2f3f7d[_0x9528('0x19')][_0x9528('0x1a')]===undefined?null:_0x2f3f7d[_0x9528('0x19')]['CampaignId']}})[_0x9528('0x1b')](function(_0x4cb8e2){if(_0x4cb8e2!=null){return db[_0x9528('0x1c')][_0x9528('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x4cb8e2['id'],'OrderBy':{'$gte':_0x4cb8e2[_0x9528('0x1e')]}},'order':[[_0x9528('0x1e'),_0x9528('0x1f')]]})[_0x9528('0x1b')](function(_0x326b09){if(_0x326b09)return activateAdditionalPhone(_0x4cb8e2,_0x2f3f7d[_0x9528('0x19')],_0x326b09,_0x2f3f7d['duration'],_0x2f3f7d[_0x9528('0x29')])['then'](function(_0x28f78f){_0x503aac(_0x28f78f);});else{return db[_0x9528('0x1c')][_0x9528('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x4cb8e2['id']},'order':[[_0x9528('0x1e'),_0x9528('0x1f')]]})[_0x9528('0x1b')](function(_0x1191fa){if(_0x1191fa)return activateAdditionalPhone(_0x4cb8e2,_0x2f3f7d['body'],_0x1191fa,_0x2f3f7d['duration'],_0x2f3f7d[_0x9528('0x29')])['then'](function(_0x18da44){_0x503aac(_0x18da44);});else{_0x503aac({'id':_0x4cb8e2['id'],'phone':''});}})[_0x9528('0x14')](function(_0x6a3900){logger['error'](_0x9528('0x15'),_0x6a3900[_0x9528('0x12')]);_0x43988c(_0x46642c[_0x9528('0x10')](0x1f4,_0x6a3900['message']));});}})[_0x9528('0x14')](function(_0x520aac){logger[_0x9528('0x10')](_0x9528('0x15'),_0x520aac['message']);_0x43988c(_0x46642c[_0x9528('0x10')](0x1f4,_0x520aac[_0x9528('0x12')]));});}else _0x503aac(0x1);});});};function activateAdditionalPhone(_0xa49832,_0x26b2d9,_0x56218e,_0x2e23fa,_0x352003){return new Promise(function(_0xb8e283,_0x3f4f70){var _0x4b3616;if(_[_0x9528('0x2a')](_0x56218e[_0x9528('0x2b')])){_0x56218e['scheduledat']=moment();}if(moment()>moment(_0x56218e[_0x9528('0x2b')])){_0x4b3616=moment()[_0x9528('0x2c')](_0x352003||0x3,_0x9528('0x2d'));}else{if(_0x56218e[_0x9528('0x1e')]==0x0){_0x4b3616=moment(_0x56218e[_0x9528('0x2b')]);}else{_0x4b3616=moment()['add'](_0x352003||0x3,_0x9528('0x2d'));}}if(_[_0x9528('0x2a')](_0x4b3616)){_0x4b3616=moment()[_0x9528('0x2c')](_0x352003||0x3,_0x9528('0x2d'));}var _0x2dffb9={'phone':_0xa49832[_0x9528('0x2e')],'active':0x0,'OrderBy':_['isNil'](_0xa49832['OrderBy'])?0x0:_0xa49832[_0x9528('0x1e')],'scheduledat':moment()['add'](_0x2e23fa||0x1,_0x9528('0x2d')),'countbusyretry':_0x26b2d9[_0x9528('0x20')],'countcongestionretry':_0x26b2d9['countcongestionretry'],'countnoanswerretry':_0x26b2d9[_0x9528('0x21')],'countnosuchnumberretry':_0x26b2d9[_0x9528('0x22')],'countdropretry':_0x26b2d9['countdropretry'],'countabandonedretry':_0x26b2d9[_0x9528('0x24')],'countmachineretry':_0x26b2d9[_0x9528('0x25')],'countagentrejectretry':_0x26b2d9[_0x9528('0x26')],'createdAt':_0x26b2d9[_0x9528('0x2f')],'updatedAt':_0x26b2d9[_0x9528('0x30')]};var _0x30c0d3={'CmHopperId':_0xa49832['id'],'phone':_0x56218e[_0x9528('0x2e')],'active':0x0,'OrderBy':_[_0x9528('0x2a')](_0x56218e['OrderBy'])?0x0:_0x56218e[_0x9528('0x1e')],'scheduledat':_0x4b3616,'countbusyretry':_0x56218e[_0x9528('0x20')],'countcongestionretry':_0x56218e['countcongestionretry'],'countnoanswerretry':_0x56218e[_0x9528('0x21')],'countnosuchnumberretry':_0x56218e[_0x9528('0x22')],'countdropretry':_0x56218e['countdropretry'],'countabandonedretry':_0x56218e[_0x9528('0x24')],'countmachineretry':_0x56218e[_0x9528('0x25')],'countagentrejectretry':_0x56218e[_0x9528('0x26')],'createdAt':_0x56218e[_0x9528('0x2f')],'updatedAt':_0x56218e['updatedAt']};return db[_0x9528('0x31')][_0x9528('0x32')](function(_0x59e202){return db[_0x9528('0x1c')][_0x9528('0x33')](_0x2dffb9,{'where':{'id':_0x56218e['id']}},{'transaction':_0x59e202})[_0x9528('0x1b')](function(){return db['CmHopper']['update'](_0x30c0d3,{'where':{'id':_0xa49832['id']}},{'transaction':_0x59e202});});})[_0x9528('0x1b')](function(_0x4a3344){_0xb8e283({'id':_0xa49832['id'],'phone':_0x56218e[_0x9528('0x2e')]});})[_0x9528('0x14')](function(_0x569efc){logger[_0x9528('0x10')](_0x9528('0x34'),_0x569efc['message']);_0x3f4f70({'error':_0x569efc['message']});});});}exports[_0x9528('0x35')]=function(_0x531f99){var _0x7b72e2=this;return new Promise(function(_0x2d2ab0,_0xa9eca3){return db[_0x9528('0x16')][_0x9528('0x33')](_0x531f99[_0x9528('0x19')][_0x9528('0x36')],{'where':{'id':_0x531f99[_0x9528('0x19')]['id']}})[_0x9528('0x1b')](function(_0x3ba3a3){_0x2d2ab0(_0x3ba3a3);})[_0x9528('0x14')](function(_0x29effc){logger[_0x9528('0x10')]('IncrementPreviewCounters',_0x29effc[_0x9528('0x12')]);_0xa9eca3(_0x7b72e2[_0x9528('0x10')](0x1f4,_0x29effc['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index efd33c3..5589a9b 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 _0x51c3=['../../components/auth/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1e5068,_0x31e9c4){var _0x2230b6=function(_0xaa2ee){while(--_0xaa2ee){_0x1e5068['push'](_0x1e5068['shift']());}};_0x2230b6(++_0x31e9c4);}(_0x51c3,0x111));var _0x351c=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x51c3[_0x455c6c];return _0x488242;};'use strict';var multer=require(_0x351c('0x0'));var util=require(_0x351c('0x1'));var path=require(_0x351c('0x2'));var timeout=require(_0x351c('0x3'));var express=require(_0x351c('0x4'));var router=express[_0x351c('0x5')]();var fs_extra=require(_0x351c('0x6'));var auth=require(_0x351c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x351c('0x8'));var controller=require(_0x351c('0x9'));router[_0x351c('0xa')]('/',auth[_0x351c('0xb')](),controller['index']);router[_0x351c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x351c('0xc')]);router[_0x351c('0xd')]('/',auth['isAuthenticated'](),controller[_0x351c('0xe')]);router[_0x351c('0xf')](_0x351c('0x10'),auth[_0x351c('0xb')](),controller['update']);router[_0x351c('0x11')](_0x351c('0x10'),auth['isAuthenticated'](),controller[_0x351c('0x12')]);module[_0x351c('0x13')]=router; \ No newline at end of file +var _0x15bf=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperAdditionalPhone.controller','isAuthenticated','index','get','show','post','/:id','update','destroy','exports','multer','util'];(function(_0x2a9dcf,_0x408af3){var _0x9d5122=function(_0x5bc6bc){while(--_0x5bc6bc){_0x2a9dcf['push'](_0x2a9dcf['shift']());}};_0x9d5122(++_0x408af3);}(_0x15bf,0x18e));var _0xf15b=function(_0x35af23,_0x9190f6){_0x35af23=_0x35af23-0x0;var _0x340506=_0x15bf[_0x35af23];return _0x340506;};'use strict';var multer=require(_0xf15b('0x0'));var util=require(_0xf15b('0x1'));var path=require('path');var timeout=require(_0xf15b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf15b('0x3'));var auth=require(_0xf15b('0x4'));var interaction=require(_0xf15b('0x5'));var config=require('../../config/environment');var controller=require(_0xf15b('0x6'));router['get']('/',auth[_0xf15b('0x7')](),controller[_0xf15b('0x8')]);router[_0xf15b('0x9')]('/:id',auth[_0xf15b('0x7')](),controller[_0xf15b('0xa')]);router[_0xf15b('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf15b('0xc'),auth[_0xf15b('0x7')](),controller[_0xf15b('0xd')]);router['delete'](_0xf15b('0xc'),auth['isAuthenticated'](),controller[_0xf15b('0xe')]);module[_0xf15b('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 8d29c11..19a59f5 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 _0x1d3c=['STRING','INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x20be11,_0x5d8dbe){var _0x261243=function(_0x3c6b00){while(--_0x3c6b00){_0x20be11['push'](_0x20be11['shift']());}};_0x261243(++_0x5d8dbe);}(_0x1d3c,0x6f));var _0xc1d3=function(_0x434783,_0xff395d){_0x434783=_0x434783-0x0;var _0x13efcf=_0x1d3c[_0x434783];return _0x13efcf;};'use strict';var moment=require(_0xc1d3('0x0'));var Sequelize=require(_0xc1d3('0x1'));module[_0xc1d3('0x2')]={'phone':{'type':Sequelize[_0xc1d3('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xc1d3('0x4')],'unique':_0xc1d3('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xc1d3('0x4')],'unique':_0xc1d3('0x5')}}; \ No newline at end of file +var _0xe58e=['INTEGER','contactListQueue','moment','sequelize'];(function(_0x4a8418,_0x39078a){var _0x390174=function(_0x173ea6){while(--_0x173ea6){_0x4a8418['push'](_0x4a8418['shift']());}};_0x390174(++_0x39078a);}(_0xe58e,0x10e));var _0xee58=function(_0x2946a1,_0x5b5fa4){_0x2946a1=_0x2946a1-0x0;var _0x342ccd=_0xe58e[_0x2946a1];return _0x342ccd;};'use strict';var moment=require(_0xee58('0x0'));var Sequelize=require(_0xee58('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xee58('0x2')],'unique':_0xee58('0x3')},'ListId':{'type':Sequelize[_0xee58('0x2')],'unique':_0xee58('0x3')},'VoiceQueueId':{'type':Sequelize[_0xee58('0x2')],'unique':_0xee58('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 2bd64d9..0dc1ce1 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 _0xabd3=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','save','then','destroy','error','send','map','CmHopperBlack','rawAttributes','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','include','find','body','params','catch','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x37d7d6,_0x2b540b){var _0x39ae77=function(_0x506cb5){while(--_0x506cb5){_0x37d7d6['push'](_0x37d7d6['shift']());}};_0x39ae77(++_0x2b540b);}(_0xabd3,0x1f3));var _0x3abd=function(_0x39caaa,_0x1f37bc){_0x39caaa=_0x39caaa-0x0;var _0x9b9c7d=_0xabd3[_0x39caaa];return _0x9b9c7d;};'use strict';var emlformat=require(_0x3abd('0x0'));var rimraf=require(_0x3abd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3abd('0x2'));var rp=require(_0x3abd('0x3'));var moment=require(_0x3abd('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3abd('0x5'));var path=require(_0x3abd('0x6'));var sox=require(_0x3abd('0x7'));var csv=require('to-csv');var ejs=require(_0x3abd('0x8'));var fs=require('fs');var fs_extra=require(_0x3abd('0x9'));var _=require('lodash');var squel=require(_0x3abd('0xa'));var crypto=require(_0x3abd('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3abd('0xc'));var toCsv=require(_0x3abd('0xd'));var querystring=require(_0x3abd('0xe'));var Papa=require(_0x3abd('0xf'));var Redis=require(_0x3abd('0x10'));var authService=require(_0x3abd('0x11'));var qs=require(_0x3abd('0x12'));var as=require(_0x3abd('0x13'));var hardwareService=require(_0x3abd('0x14'));var logger=require(_0x3abd('0x15'))(_0x3abd('0x16'));var utils=require(_0x3abd('0x17'));var config=require(_0x3abd('0x18'));var licenseUtil=require(_0x3abd('0x19'));var db=require(_0x3abd('0x1a'))['db'];function respondWithStatusCode(_0x56b8b6,_0x2796e1){_0x2796e1=_0x2796e1||0xcc;return function(_0x24ea10){if(_0x24ea10){return _0x56b8b6[_0x3abd('0x1b')](_0x2796e1);}return _0x56b8b6[_0x3abd('0x1c')](_0x2796e1)[_0x3abd('0x1d')]();};}function respondWithResult(_0x43a2e8,_0x3b6ccf){_0x3b6ccf=_0x3b6ccf||0xc8;return function(_0x3ba5db){if(_0x3ba5db){return _0x43a2e8['status'](_0x3b6ccf)[_0x3abd('0x1e')](_0x3ba5db);}};}function respondWithFilteredResult(_0x2c9068,_0x353738){return function(_0x5c3658){if(_0x5c3658){var _0x3aec49=typeof _0x353738[_0x3abd('0x1f')]==='undefined'&&typeof _0x353738['limit']===_0x3abd('0x20');var _0x42963f=_0x5c3658[_0x3abd('0x21')];var _0x45f792=_0x3aec49?0x0:_0x353738[_0x3abd('0x1f')];var _0x29d882=_0x3aec49?_0x5c3658['count']:_0x353738[_0x3abd('0x1f')]+_0x353738['limit'];var _0x4ca84a;if(_0x29d882>=_0x42963f){_0x29d882=_0x42963f;_0x4ca84a=0xc8;}else{_0x4ca84a=0xce;}_0x2c9068[_0x3abd('0x1c')](_0x4ca84a);return _0x2c9068['set'](_0x3abd('0x22'),_0x45f792+'-'+_0x29d882+'/'+_0x42963f)['json'](_0x5c3658);}return null;};}function patchUpdates(_0x3cc1b8){return function(_0xfbbb11){try{jsonpatch['apply'](_0xfbbb11,_0x3cc1b8,!![]);}catch(_0x72168f){return BPromise[_0x3abd('0x23')](_0x72168f);}return _0xfbbb11[_0x3abd('0x24')]();};}function saveUpdates(_0x7b6412,_0x129412){return function(_0x6544b0){if(_0x6544b0){return _0x6544b0['update'](_0x7b6412)[_0x3abd('0x25')](function(_0x41982a){return _0x41982a;});}return null;};}function removeEntity(_0xbfd0b4,_0x48108e){return function(_0xec8b88){if(_0xec8b88){return _0xec8b88[_0x3abd('0x26')]()['then'](function(){_0xbfd0b4[_0x3abd('0x1c')](0xcc)[_0x3abd('0x1d')]();});}};}function handleEntityNotFound(_0x5aead7,_0x33be06){return function(_0x5bbfc3){if(!_0x5bbfc3){_0x5aead7['sendStatus'](0x194);}return _0x5bbfc3;};}function handleError(_0x139e8a,_0x4bab2d){_0x4bab2d=_0x4bab2d||0x1f4;return function(_0x2af4d6){logger[_0x3abd('0x27')](_0x2af4d6['stack']);if(_0x2af4d6['name']){delete _0x2af4d6['name'];}_0x139e8a[_0x3abd('0x1c')](_0x4bab2d)[_0x3abd('0x28')](_0x2af4d6);};}exports['index']=function(_0x4fe96e,_0x1faad9){var _0x593a37={},_0x18ac66={},_0x50cd29={'count':0x0,'rows':[]};var _0x250df0=_[_0x3abd('0x29')](db[_0x3abd('0x2a')][_0x3abd('0x2b')],function(_0x5b7d36){return{'name':_0x5b7d36['fieldName'],'type':_0x5b7d36['type']['key']};});_0x18ac66[_0x3abd('0x2c')]=_[_0x3abd('0x29')](_0x250df0,_0x3abd('0x2d'));_0x18ac66[_0x3abd('0x2e')]=_[_0x3abd('0x2f')](_0x4fe96e['query']);_0x18ac66[_0x3abd('0x30')]=_[_0x3abd('0x31')](_0x18ac66['model'],_0x18ac66['query']);_0x593a37[_0x3abd('0x32')]=_[_0x3abd('0x31')](_0x18ac66['model'],qs[_0x3abd('0x33')](_0x4fe96e['query'][_0x3abd('0x33')]));_0x593a37[_0x3abd('0x32')]=_0x593a37[_0x3abd('0x32')][_0x3abd('0x34')]?_0x593a37['attributes']:_0x18ac66[_0x3abd('0x2c')];if(!_0x4fe96e[_0x3abd('0x2e')][_0x3abd('0x35')](_0x3abd('0x36'))){_0x593a37[_0x3abd('0x37')]=qs[_0x3abd('0x37')](_0x4fe96e[_0x3abd('0x2e')][_0x3abd('0x37')]);_0x593a37['offset']=qs[_0x3abd('0x1f')](_0x4fe96e[_0x3abd('0x2e')]['offset']);}_0x593a37[_0x3abd('0x38')]=qs['sort'](_0x4fe96e[_0x3abd('0x2e')][_0x3abd('0x39')]);_0x593a37[_0x3abd('0x3a')]=qs[_0x3abd('0x30')](_[_0x3abd('0x3b')](_0x4fe96e[_0x3abd('0x2e')],_0x18ac66[_0x3abd('0x30')]),_0x250df0);if(_0x4fe96e[_0x3abd('0x2e')][_0x3abd('0x3c')]){_0x593a37['where']=_[_0x3abd('0x3d')](_0x593a37[_0x3abd('0x3a')],{'$or':_[_0x3abd('0x29')](_0x250df0,function(_0x18a087){if(_0x18a087[_0x3abd('0x3e')]!==_0x3abd('0x3f')){var _0x26a97c={};_0x26a97c[_0x18a087[_0x3abd('0x2d')]]={'$like':'%'+_0x4fe96e[_0x3abd('0x2e')][_0x3abd('0x3c')]+'%'};return _0x26a97c;}})});}_0x593a37=_['merge']({},_0x593a37,_0x4fe96e[_0x3abd('0x40')]);var _0x528ead={'where':_0x593a37[_0x3abd('0x3a')]};return db[_0x3abd('0x2a')][_0x3abd('0x21')](_0x528ead)['then'](function(_0x776d24){_0x50cd29[_0x3abd('0x21')]=_0x776d24;if(_0x4fe96e['query'][_0x3abd('0x41')]){_0x593a37['include']=[{'all':!![]}];}return db[_0x3abd('0x2a')][_0x3abd('0x42')](_0x593a37);})['then'](function(_0x330028){_0x50cd29[_0x3abd('0x43')]=_0x330028;return _0x50cd29;})['then'](respondWithFilteredResult(_0x1faad9,_0x593a37))['catch'](handleError(_0x1faad9,null));};exports[_0x3abd('0x44')]=function(_0x1ac404,_0x2bf964){var _0x203dbf={'raw':!![],'where':{'id':_0x1ac404['params']['id']}},_0x571d3e={};_0x571d3e['model']=_['keys'](db['CmHopperBlack'][_0x3abd('0x2b')]);_0x571d3e[_0x3abd('0x2e')]=_[_0x3abd('0x2f')](_0x1ac404[_0x3abd('0x2e')]);_0x571d3e[_0x3abd('0x30')]=_[_0x3abd('0x31')](_0x571d3e[_0x3abd('0x2c')],_0x571d3e['query']);_0x203dbf[_0x3abd('0x32')]=_[_0x3abd('0x31')](_0x571d3e[_0x3abd('0x2c')],qs[_0x3abd('0x33')](_0x1ac404[_0x3abd('0x2e')][_0x3abd('0x33')]));_0x203dbf['attributes']=_0x203dbf['attributes'][_0x3abd('0x34')]?_0x203dbf['attributes']:_0x571d3e['model'];if(_0x1ac404[_0x3abd('0x2e')][_0x3abd('0x41')]){_0x203dbf[_0x3abd('0x45')]=[{'all':!![]}];}_0x203dbf=_[_0x3abd('0x3d')]({},_0x203dbf,_0x1ac404[_0x3abd('0x40')]);return db[_0x3abd('0x2a')][_0x3abd('0x46')](_0x203dbf)['then'](handleEntityNotFound(_0x2bf964,null))[_0x3abd('0x25')](respondWithResult(_0x2bf964,null))['catch'](handleError(_0x2bf964,null));};exports['update']=function(_0x166cd1,_0x4699c6){if(_0x166cd1[_0x3abd('0x47')]['id']){delete _0x166cd1[_0x3abd('0x47')]['id'];}return db[_0x3abd('0x2a')][_0x3abd('0x46')]({'where':{'id':_0x166cd1[_0x3abd('0x48')]['id']}})['then'](handleEntityNotFound(_0x4699c6,null))[_0x3abd('0x25')](saveUpdates(_0x166cd1[_0x3abd('0x47')],null))[_0x3abd('0x25')](respondWithResult(_0x4699c6,null))[_0x3abd('0x49')](handleError(_0x4699c6,null));};exports['destroy']=function(_0x14d468,_0x25643a){return db[_0x3abd('0x2a')][_0x3abd('0x46')]({'where':{'id':_0x14d468['params']['id']}})['then'](handleEntityNotFound(_0x25643a,null))[_0x3abd('0x25')](removeEntity(_0x25643a,null))[_0x3abd('0x49')](handleError(_0x25643a,null));};exports[_0x3abd('0x4a')]=function(_0x57ac31,_0x529d6b){return db[_0x3abd('0x2a')][_0x3abd('0x4a')]()[_0x3abd('0x25')](respondWithResult(_0x529d6b,null))[_0x3abd('0x49')](handleError(_0x529d6b,null));}; \ No newline at end of file +var _0x6851=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','findAll','rows','show','params','rawAttributes','include','catch','update','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','index','map','CmHopperBlack','fieldName','type','key','query','keys','intersection','model'];(function(_0x7a4b16,_0x2c3b70){var _0x59e441=function(_0xfc8375){while(--_0xfc8375){_0x7a4b16['push'](_0x7a4b16['shift']());}};_0x59e441(++_0x2c3b70);}(_0x6851,0xb3));var _0x1685=function(_0x16ff13,_0x574da6){_0x16ff13=_0x16ff13-0x0;var _0x167afd=_0x6851[_0x16ff13];return _0x167afd;};'use strict';var emlformat=require(_0x1685('0x0'));var rimraf=require(_0x1685('0x1'));var zipdir=require(_0x1685('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1685('0x3'));var moment=require(_0x1685('0x4'));var BPromise=require(_0x1685('0x5'));var Mustache=require('mustache');var util=require(_0x1685('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x1685('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1685('0x8'));var _=require(_0x1685('0x9'));var squel=require(_0x1685('0xa'));var crypto=require(_0x1685('0xb'));var jsforce=require(_0x1685('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1685('0x7'));var querystring=require(_0x1685('0xd'));var Papa=require(_0x1685('0xe'));var Redis=require(_0x1685('0xf'));var authService=require(_0x1685('0x10'));var qs=require(_0x1685('0x11'));var as=require(_0x1685('0x12'));var hardwareService=require(_0x1685('0x13'));var logger=require(_0x1685('0x14'))(_0x1685('0x15'));var utils=require(_0x1685('0x16'));var config=require(_0x1685('0x17'));var licenseUtil=require(_0x1685('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e9b8a,_0x3bfeba){_0x3bfeba=_0x3bfeba||0xcc;return function(_0x59141a){if(_0x59141a){return _0x3e9b8a[_0x1685('0x19')](_0x3bfeba);}return _0x3e9b8a[_0x1685('0x1a')](_0x3bfeba)[_0x1685('0x1b')]();};}function respondWithResult(_0x19b47e,_0x1c7066){_0x1c7066=_0x1c7066||0xc8;return function(_0x373e37){if(_0x373e37){return _0x19b47e[_0x1685('0x1a')](_0x1c7066)[_0x1685('0x1c')](_0x373e37);}};}function respondWithFilteredResult(_0x56e76b,_0x2f39f3){return function(_0x20cba9){if(_0x20cba9){var _0xec8710=typeof _0x2f39f3[_0x1685('0x1d')]===_0x1685('0x1e')&&typeof _0x2f39f3[_0x1685('0x1f')]===_0x1685('0x1e');var _0x240447=_0x20cba9[_0x1685('0x20')];var _0x3471c6=_0xec8710?0x0:_0x2f39f3[_0x1685('0x1d')];var _0x2b4155=_0xec8710?_0x20cba9[_0x1685('0x20')]:_0x2f39f3[_0x1685('0x1d')]+_0x2f39f3['limit'];var _0x59f610;if(_0x2b4155>=_0x240447){_0x2b4155=_0x240447;_0x59f610=0xc8;}else{_0x59f610=0xce;}_0x56e76b[_0x1685('0x1a')](_0x59f610);return _0x56e76b[_0x1685('0x21')](_0x1685('0x22'),_0x3471c6+'-'+_0x2b4155+'/'+_0x240447)[_0x1685('0x1c')](_0x20cba9);}return null;};}function patchUpdates(_0x425728){return function(_0x514312){try{jsonpatch['apply'](_0x514312,_0x425728,!![]);}catch(_0xd87d1){return BPromise['reject'](_0xd87d1);}return _0x514312[_0x1685('0x23')]();};}function saveUpdates(_0x4bc5b7,_0x53f5bc){return function(_0x3855f4){if(_0x3855f4){return _0x3855f4['update'](_0x4bc5b7)[_0x1685('0x24')](function(_0x59497f){return _0x59497f;});}return null;};}function removeEntity(_0x8c0424,_0x50e4f9){return function(_0x3c4323){if(_0x3c4323){return _0x3c4323[_0x1685('0x25')]()[_0x1685('0x24')](function(){_0x8c0424['status'](0xcc)[_0x1685('0x1b')]();});}};}function handleEntityNotFound(_0x43ce51,_0xb3ce42){return function(_0x5f36ce){if(!_0x5f36ce){_0x43ce51['sendStatus'](0x194);}return _0x5f36ce;};}function handleError(_0xd2120e,_0x2be024){_0x2be024=_0x2be024||0x1f4;return function(_0x506f12){logger[_0x1685('0x26')](_0x506f12[_0x1685('0x27')]);if(_0x506f12[_0x1685('0x28')]){delete _0x506f12[_0x1685('0x28')];}_0xd2120e[_0x1685('0x1a')](_0x2be024)[_0x1685('0x29')](_0x506f12);};}exports[_0x1685('0x2a')]=function(_0x1a7fd7,_0x585a16){var _0x2625af={},_0x2e66e4={},_0x30a8f9={'count':0x0,'rows':[]};var _0x41a751=_[_0x1685('0x2b')](db[_0x1685('0x2c')]['rawAttributes'],function(_0x59a527){return{'name':_0x59a527[_0x1685('0x2d')],'type':_0x59a527[_0x1685('0x2e')][_0x1685('0x2f')]};});_0x2e66e4['model']=_['map'](_0x41a751,'name');_0x2e66e4[_0x1685('0x30')]=_[_0x1685('0x31')](_0x1a7fd7['query']);_0x2e66e4['filters']=_[_0x1685('0x32')](_0x2e66e4[_0x1685('0x33')],_0x2e66e4['query']);_0x2625af[_0x1685('0x34')]=_[_0x1685('0x32')](_0x2e66e4[_0x1685('0x33')],qs[_0x1685('0x35')](_0x1a7fd7['query'][_0x1685('0x35')]));_0x2625af[_0x1685('0x34')]=_0x2625af[_0x1685('0x34')][_0x1685('0x36')]?_0x2625af[_0x1685('0x34')]:_0x2e66e4[_0x1685('0x33')];if(!_0x1a7fd7[_0x1685('0x30')][_0x1685('0x37')](_0x1685('0x38'))){_0x2625af[_0x1685('0x1f')]=qs[_0x1685('0x1f')](_0x1a7fd7[_0x1685('0x30')]['limit']);_0x2625af[_0x1685('0x1d')]=qs[_0x1685('0x1d')](_0x1a7fd7[_0x1685('0x30')][_0x1685('0x1d')]);}_0x2625af[_0x1685('0x39')]=qs[_0x1685('0x3a')](_0x1a7fd7[_0x1685('0x30')][_0x1685('0x3a')]);_0x2625af[_0x1685('0x3b')]=qs[_0x1685('0x3c')](_[_0x1685('0x3d')](_0x1a7fd7[_0x1685('0x30')],_0x2e66e4[_0x1685('0x3c')]),_0x41a751);if(_0x1a7fd7[_0x1685('0x30')]['filter']){_0x2625af[_0x1685('0x3b')]=_[_0x1685('0x3e')](_0x2625af['where'],{'$or':_[_0x1685('0x2b')](_0x41a751,function(_0x46a3ee){if(_0x46a3ee[_0x1685('0x2e')]!=='VIRTUAL'){var _0x43e2ff={};_0x43e2ff[_0x46a3ee[_0x1685('0x28')]]={'$like':'%'+_0x1a7fd7[_0x1685('0x30')][_0x1685('0x3f')]+'%'};return _0x43e2ff;}})});}_0x2625af=_['merge']({},_0x2625af,_0x1a7fd7[_0x1685('0x40')]);var _0x38b975={'where':_0x2625af[_0x1685('0x3b')]};return db[_0x1685('0x2c')][_0x1685('0x20')](_0x38b975)['then'](function(_0x27afc5){_0x30a8f9[_0x1685('0x20')]=_0x27afc5;if(_0x1a7fd7[_0x1685('0x30')][_0x1685('0x41')]){_0x2625af['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x1685('0x42')](_0x2625af);})[_0x1685('0x24')](function(_0x5b09d0){_0x30a8f9[_0x1685('0x43')]=_0x5b09d0;return _0x30a8f9;})['then'](respondWithFilteredResult(_0x585a16,_0x2625af))['catch'](handleError(_0x585a16,null));};exports[_0x1685('0x44')]=function(_0x1bbeb9,_0x1f89b5){var _0x4293e1={'raw':!![],'where':{'id':_0x1bbeb9[_0x1685('0x45')]['id']}},_0x28326c={};_0x28326c[_0x1685('0x33')]=_['keys'](db[_0x1685('0x2c')][_0x1685('0x46')]);_0x28326c[_0x1685('0x30')]=_[_0x1685('0x31')](_0x1bbeb9[_0x1685('0x30')]);_0x28326c[_0x1685('0x3c')]=_[_0x1685('0x32')](_0x28326c[_0x1685('0x33')],_0x28326c[_0x1685('0x30')]);_0x4293e1[_0x1685('0x34')]=_[_0x1685('0x32')](_0x28326c[_0x1685('0x33')],qs[_0x1685('0x35')](_0x1bbeb9[_0x1685('0x30')][_0x1685('0x35')]));_0x4293e1[_0x1685('0x34')]=_0x4293e1[_0x1685('0x34')][_0x1685('0x36')]?_0x4293e1[_0x1685('0x34')]:_0x28326c[_0x1685('0x33')];if(_0x1bbeb9['query'][_0x1685('0x41')]){_0x4293e1[_0x1685('0x47')]=[{'all':!![]}];}_0x4293e1=_[_0x1685('0x3e')]({},_0x4293e1,_0x1bbeb9['options']);return db[_0x1685('0x2c')]['find'](_0x4293e1)['then'](handleEntityNotFound(_0x1f89b5,null))['then'](respondWithResult(_0x1f89b5,null))[_0x1685('0x48')](handleError(_0x1f89b5,null));};exports[_0x1685('0x49')]=function(_0x485d7b,_0xcdfa64){if(_0x485d7b[_0x1685('0x4a')]['id']){delete _0x485d7b[_0x1685('0x4a')]['id'];}return db[_0x1685('0x2c')][_0x1685('0x4b')]({'where':{'id':_0x485d7b[_0x1685('0x45')]['id']}})[_0x1685('0x24')](handleEntityNotFound(_0xcdfa64,null))['then'](saveUpdates(_0x485d7b['body'],null))[_0x1685('0x24')](respondWithResult(_0xcdfa64,null))[_0x1685('0x48')](handleError(_0xcdfa64,null));};exports[_0x1685('0x25')]=function(_0xf1c8df,_0x86f57e){return db[_0x1685('0x2c')][_0x1685('0x4b')]({'where':{'id':_0xf1c8df[_0x1685('0x45')]['id']}})[_0x1685('0x24')](handleEntityNotFound(_0x86f57e,null))[_0x1685('0x24')](removeEntity(_0x86f57e,null))['catch'](handleError(_0x86f57e,null));};exports[_0x1685('0x4c')]=function(_0x1ba734,_0x3470aa){return db[_0x1685('0x2c')][_0x1685('0x4c')]()['then'](respondWithResult(_0x3470aa,null))['catch'](handleError(_0x3470aa,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 69b0c03..4ba7f42 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 _0xf520=['CmHopperBlack','cm_hopper_black','../../config/logger','api','request-promise','path','rimraf','define'];(function(_0xc2c347,_0x442863){var _0x2c07d2=function(_0x35e5d6){while(--_0x35e5d6){_0xc2c347['push'](_0xc2c347['shift']());}};_0x2c07d2(++_0x442863);}(_0xf520,0x10a));var _0x0f52=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xf520[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0f52('0x0'))(_0x0f52('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0f52('0x2'));var fs=require('fs');var path=require(_0x0f52('0x3'));var rimraf=require(_0x0f52('0x4'));var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0x26eae6,_0x268252){return _0x26eae6[_0x0f52('0x5')](_0x0f52('0x6'),attributes,{'tableName':_0x0f52('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd58=['cm_hopper_black','lodash','util','../../config/logger','api','request-promise','path','rimraf','./cmHopperBlack.attributes','exports','define'];(function(_0x45903d,_0x382ee6){var _0x298cea=function(_0x311ac3){while(--_0x311ac3){_0x45903d['push'](_0x45903d['shift']());}};_0x298cea(++_0x382ee6);}(_0xdd58,0xfe));var _0x8dd5=function(_0x10cf5d,_0x396a02){_0x10cf5d=_0x10cf5d-0x0;var _0x5b9d4b=_0xdd58[_0x10cf5d];return _0x5b9d4b;};'use strict';var _=require(_0x8dd5('0x0'));var util=require(_0x8dd5('0x1'));var logger=require(_0x8dd5('0x2'))(_0x8dd5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8dd5('0x4'));var fs=require('fs');var path=require(_0x8dd5('0x5'));var rimraf=require(_0x8dd5('0x6'));var config=require('../../config/environment');var attributes=require(_0x8dd5('0x7'));module[_0x8dd5('0x8')]=function(_0x4f63f6,_0x1ff388){return _0x4f63f6[_0x8dd5('0x9')]('CmHopperBlack',attributes,{'tableName':_0x8dd5('0xa'),'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 09c132c..8a08a4b 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 _0xeea7=['code','message','info','result','catch','GetCmHopperBlack','findAll','options','where','attributes','limit','include','map','model','UpdateCmHopperBlack','CmHopperBlack','update','body','raw','DestroyCmHopperBlack','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4e6c14,_0x4ee47d){var _0xe58422=function(_0x30ca53){while(--_0x30ca53){_0x4e6c14['push'](_0x4e6c14['shift']());}};_0xe58422(++_0x4ee47d);}(_0xeea7,0x161));var _0x7eea=function(_0x3feef9,_0x1df14e){_0x3feef9=_0x3feef9-0x0;var _0x3b7fee=_0xeea7[_0x3feef9];return _0x3b7fee;};'use strict';var _=require(_0x7eea('0x0'));var util=require('util');var moment=require(_0x7eea('0x1'));var BPromise=require('bluebird');var rs=require(_0x7eea('0x2'));var fs=require('fs');var Redis=require(_0x7eea('0x3'));var db=require(_0x7eea('0x4'))['db'];var utils=require(_0x7eea('0x5'));var logger=require(_0x7eea('0x6'))(_0x7eea('0x7'));var config=require(_0x7eea('0x8'));var jayson=require(_0x7eea('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ae7f8,_0x4db196,_0xe45c93){return new BPromise(function(_0x180435,_0x48cb16){return client[_0x7eea('0xa')](_0x3ae7f8,_0xe45c93)[_0x7eea('0xb')](function(_0x588752){logger['info'](_0x7eea('0xc'),_0x4db196,'request\x20sent');logger[_0x7eea('0xd')](_0x7eea('0xe'),_0x4db196,'request\x20sent',JSON[_0x7eea('0xf')](_0x588752));if(_0x588752['error']){if(_0x588752[_0x7eea('0x10')][_0x7eea('0x11')]===0x1f4){logger[_0x7eea('0x10')](_0x7eea('0xc'),_0x4db196,_0x588752[_0x7eea('0x10')][_0x7eea('0x12')]);return _0x48cb16(_0x588752[_0x7eea('0x10')][_0x7eea('0x12')]);}logger[_0x7eea('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x4db196,_0x588752[_0x7eea('0x10')]['message']);return _0x180435(_0x588752[_0x7eea('0x10')][_0x7eea('0x12')]);}else{logger[_0x7eea('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x4db196,'request\x20sent');_0x180435(_0x588752[_0x7eea('0x14')][_0x7eea('0x12')]);}})[_0x7eea('0x15')](function(_0x20e228){logger[_0x7eea('0x10')](_0x7eea('0xc'),_0x4db196,_0x20e228);_0x48cb16(_0x20e228);});});}exports[_0x7eea('0x16')]=function(_0x3c5980){var _0x122abb=this;return new Promise(function(_0x21c450,_0x54f604){return db['CmHopperBlack'][_0x7eea('0x17')]({'raw':_0x3c5980[_0x7eea('0x18')]?_0x3c5980[_0x7eea('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3c5980[_0x7eea('0x18')]?_0x3c5980[_0x7eea('0x18')][_0x7eea('0x19')]||null:null,'attributes':_0x3c5980['options']?_0x3c5980[_0x7eea('0x18')][_0x7eea('0x1a')]||null:null,'limit':_0x3c5980['options']?_0x3c5980[_0x7eea('0x18')][_0x7eea('0x1b')]||null:null,'include':_0x3c5980[_0x7eea('0x18')]?_0x3c5980[_0x7eea('0x18')][_0x7eea('0x1c')]?_[_0x7eea('0x1d')](_0x3c5980['options'][_0x7eea('0x1c')],function(_0x58773d){return{'model':db[_0x58773d[_0x7eea('0x1e')]],'as':_0x58773d['as'],'attributes':_0x58773d[_0x7eea('0x1a')],'include':_0x58773d[_0x7eea('0x1c')]?_['map'](_0x58773d[_0x7eea('0x1c')],function(_0x216947){return{'model':db[_0x216947['model']],'as':_0x216947['as'],'attributes':_0x216947[_0x7eea('0x1a')],'include':_0x216947[_0x7eea('0x1c')]?_[_0x7eea('0x1d')](_0x216947[_0x7eea('0x1c')],function(_0x2a158d){return{'model':db[_0x2a158d[_0x7eea('0x1e')]],'as':_0x2a158d['as'],'attributes':_0x2a158d[_0x7eea('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7eea('0xb')](function(_0x4f94df){logger[_0x7eea('0x13')](_0x7eea('0x16'),_0x3c5980);logger['debug'](_0x7eea('0x16'),_0x3c5980,JSON[_0x7eea('0xf')](_0x4f94df));_0x21c450(_0x4f94df);})[_0x7eea('0x15')](function(_0x7ff05f){logger['error'](_0x7eea('0x16'),_0x7ff05f[_0x7eea('0x12')],_0x3c5980);_0x54f604(_0x122abb[_0x7eea('0x10')](0x1f4,_0x7ff05f[_0x7eea('0x12')]));});});};exports[_0x7eea('0x1f')]=function(_0x3ac0c5){var _0x862a21=this;return new Promise(function(_0x11675d,_0x2fefd7){return db[_0x7eea('0x20')][_0x7eea('0x21')](_0x3ac0c5[_0x7eea('0x22')],{'raw':_0x3ac0c5['options']?_0x3ac0c5[_0x7eea('0x18')][_0x7eea('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ac0c5[_0x7eea('0x18')]?_0x3ac0c5['options'][_0x7eea('0x19')]||null:null,'attributes':_0x3ac0c5[_0x7eea('0x18')]?_0x3ac0c5[_0x7eea('0x18')]['attributes']||null:null,'limit':_0x3ac0c5[_0x7eea('0x18')]?_0x3ac0c5[_0x7eea('0x18')][_0x7eea('0x1b')]||null:null})['then'](function(_0x3e5264){logger[_0x7eea('0x13')](_0x7eea('0x1f'),_0x3ac0c5);logger[_0x7eea('0xd')]('UpdateCmHopperBlack',_0x3ac0c5,JSON['stringify'](_0x3e5264));_0x11675d(_0x3e5264);})[_0x7eea('0x15')](function(_0x4686ca){logger['error'](_0x7eea('0x1f'),_0x4686ca['message'],_0x3ac0c5);_0x2fefd7(_0x862a21[_0x7eea('0x10')](0x1f4,_0x4686ca['message']));});});};exports['DestroyCmHopperBlack']=function(_0x25c505){var _0x5d02f5=this;return new Promise(function(_0x57d63d,_0x429c29){return db[_0x7eea('0x20')]['destroy']({'where':_0x25c505[_0x7eea('0x18')]?_0x25c505['options']['where']||null:null})[_0x7eea('0xb')](function(_0x5a0e4b){logger[_0x7eea('0x13')](_0x7eea('0x24'),_0x25c505);logger[_0x7eea('0xd')](_0x7eea('0x24'),_0x25c505,JSON[_0x7eea('0xf')](_0x5a0e4b));_0x57d63d(_0x5a0e4b);})[_0x7eea('0x15')](function(_0x67f1d4){logger[_0x7eea('0x10')](_0x7eea('0x24'),_0x67f1d4['message'],_0x25c505);_0x429c29(_0x5d02f5['error'](0x1f4,_0x67f1d4['message']));});});}; \ No newline at end of file +var _0x6aef=['attributes','stringify','UpdateCmHopperBlack','body','raw','limit','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','include','map','model'];(function(_0x5d08e4,_0x1c1ba6){var _0x1c7d40=function(_0x378004){while(--_0x378004){_0x5d08e4['push'](_0x5d08e4['shift']());}};_0x1c7d40(++_0x1c1ba6);}(_0x6aef,0x1c0));var _0xf6ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6aef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf6ae('0x0'));var util=require(_0xf6ae('0x1'));var moment=require(_0xf6ae('0x2'));var BPromise=require(_0xf6ae('0x3'));var rs=require(_0xf6ae('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6ae('0x5'))['db'];var utils=require(_0xf6ae('0x6'));var logger=require(_0xf6ae('0x7'))(_0xf6ae('0x8'));var config=require(_0xf6ae('0x9'));var jayson=require(_0xf6ae('0xa'));var client=jayson[_0xf6ae('0xb')][_0xf6ae('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21a337,_0x3e292c,_0x3f54a1){return new BPromise(function(_0x38039b,_0x2c8215){return client['request'](_0x21a337,_0x3f54a1)[_0xf6ae('0xd')](function(_0x18f31a){logger[_0xf6ae('0xe')](_0xf6ae('0xf'),_0x3e292c,_0xf6ae('0x10'));logger[_0xf6ae('0x11')](_0xf6ae('0x12'),_0x3e292c,_0xf6ae('0x10'),JSON['stringify'](_0x18f31a));if(_0x18f31a['error']){if(_0x18f31a[_0xf6ae('0x13')][_0xf6ae('0x14')]===0x1f4){logger[_0xf6ae('0x13')](_0xf6ae('0xf'),_0x3e292c,_0x18f31a['error'][_0xf6ae('0x15')]);return _0x2c8215(_0x18f31a[_0xf6ae('0x13')][_0xf6ae('0x15')]);}logger[_0xf6ae('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x3e292c,_0x18f31a[_0xf6ae('0x13')][_0xf6ae('0x15')]);return _0x38039b(_0x18f31a['error'][_0xf6ae('0x15')]);}else{logger['info'](_0xf6ae('0xf'),_0x3e292c,_0xf6ae('0x10'));_0x38039b(_0x18f31a[_0xf6ae('0x16')][_0xf6ae('0x15')]);}})[_0xf6ae('0x17')](function(_0x1583ea){logger['error'](_0xf6ae('0xf'),_0x3e292c,_0x1583ea);_0x2c8215(_0x1583ea);});});}exports[_0xf6ae('0x18')]=function(_0x316f3c){var _0x2300ea=this;return new Promise(function(_0x50e19d,_0x24e7bb){return db[_0xf6ae('0x19')][_0xf6ae('0x1a')]({'raw':_0x316f3c[_0xf6ae('0x1b')]?_0x316f3c[_0xf6ae('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x316f3c['options']?_0x316f3c[_0xf6ae('0x1b')][_0xf6ae('0x1c')]||null:null,'attributes':_0x316f3c[_0xf6ae('0x1b')]?_0x316f3c[_0xf6ae('0x1b')]['attributes']||null:null,'limit':_0x316f3c[_0xf6ae('0x1b')]?_0x316f3c[_0xf6ae('0x1b')]['limit']||null:null,'include':_0x316f3c[_0xf6ae('0x1b')]?_0x316f3c[_0xf6ae('0x1b')][_0xf6ae('0x1d')]?_[_0xf6ae('0x1e')](_0x316f3c[_0xf6ae('0x1b')]['include'],function(_0x50c1b2){return{'model':db[_0x50c1b2[_0xf6ae('0x1f')]],'as':_0x50c1b2['as'],'attributes':_0x50c1b2[_0xf6ae('0x20')],'include':_0x50c1b2[_0xf6ae('0x1d')]?_['map'](_0x50c1b2[_0xf6ae('0x1d')],function(_0x20974e){return{'model':db[_0x20974e[_0xf6ae('0x1f')]],'as':_0x20974e['as'],'attributes':_0x20974e[_0xf6ae('0x20')],'include':_0x20974e['include']?_[_0xf6ae('0x1e')](_0x20974e[_0xf6ae('0x1d')],function(_0x172964){return{'model':db[_0x172964[_0xf6ae('0x1f')]],'as':_0x172964['as'],'attributes':_0x172964[_0xf6ae('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x431b22){logger[_0xf6ae('0xe')](_0xf6ae('0x18'),_0x316f3c);logger[_0xf6ae('0x11')](_0xf6ae('0x18'),_0x316f3c,JSON[_0xf6ae('0x21')](_0x431b22));_0x50e19d(_0x431b22);})['catch'](function(_0x380f5b){logger['error'](_0xf6ae('0x18'),_0x380f5b[_0xf6ae('0x15')],_0x316f3c);_0x24e7bb(_0x2300ea['error'](0x1f4,_0x380f5b['message']));});});};exports[_0xf6ae('0x22')]=function(_0x3c376d){var _0x451e43=this;return new Promise(function(_0xad46c4,_0x3d17ba){return db['CmHopperBlack']['update'](_0x3c376d[_0xf6ae('0x23')],{'raw':_0x3c376d['options']?_0x3c376d[_0xf6ae('0x1b')][_0xf6ae('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c376d[_0xf6ae('0x1b')]?_0x3c376d['options'][_0xf6ae('0x1c')]||null:null,'attributes':_0x3c376d['options']?_0x3c376d['options'][_0xf6ae('0x20')]||null:null,'limit':_0x3c376d['options']?_0x3c376d['options'][_0xf6ae('0x25')]||null:null})[_0xf6ae('0xd')](function(_0x41f1d3){logger['info']('UpdateCmHopperBlack',_0x3c376d);logger['debug'](_0xf6ae('0x22'),_0x3c376d,JSON[_0xf6ae('0x21')](_0x41f1d3));_0xad46c4(_0x41f1d3);})['catch'](function(_0x37d744){logger[_0xf6ae('0x13')](_0xf6ae('0x22'),_0x37d744[_0xf6ae('0x15')],_0x3c376d);_0x3d17ba(_0x451e43[_0xf6ae('0x13')](0x1f4,_0x37d744[_0xf6ae('0x15')]));});});};exports[_0xf6ae('0x26')]=function(_0x372d42){var _0x2424bc=this;return new Promise(function(_0x5efc3c,_0xce85d2){return db[_0xf6ae('0x19')][_0xf6ae('0x27')]({'where':_0x372d42['options']?_0x372d42[_0xf6ae('0x1b')]['where']||null:null})[_0xf6ae('0xd')](function(_0x137791){logger[_0xf6ae('0xe')](_0xf6ae('0x26'),_0x372d42);logger[_0xf6ae('0x11')](_0xf6ae('0x26'),_0x372d42,JSON['stringify'](_0x137791));_0x5efc3c(_0x137791);})[_0xf6ae('0x17')](function(_0x32cd84){logger[_0xf6ae('0x13')]('DestroyCmHopperBlack',_0x32cd84[_0xf6ae('0x15')],_0x372d42);_0xce85d2(_0x2424bc[_0xf6ae('0x13')](0x1f4,_0x32cd84[_0xf6ae('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 8485f36..571e669 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 _0xfb11=['show','put','delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','/describe','describe','get','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xfb11[_0x40bffc];return _0x3007e9;};'use strict';var multer=require(_0x1fb1('0x0'));var util=require('util');var path=require(_0x1fb1('0x1'));var timeout=require(_0x1fb1('0x2'));var express=require('express');var router=express[_0x1fb1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1fb1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1fb1('0x5'));var controller=require(_0x1fb1('0x6'));router['get']('/',auth[_0x1fb1('0x7')](),controller[_0x1fb1('0x8')]);router['get'](_0x1fb1('0x9'),auth[_0x1fb1('0x7')](),controller[_0x1fb1('0xa')]);router[_0x1fb1('0xb')](_0x1fb1('0xc'),auth[_0x1fb1('0x7')](),controller[_0x1fb1('0xd')]);router[_0x1fb1('0xe')](_0x1fb1('0xc'),auth[_0x1fb1('0x7')](),controller['update']);router[_0x1fb1('0xf')]('/:id',auth[_0x1fb1('0x7')](),controller['destroy']);module[_0x1fb1('0x10')]=router; \ No newline at end of file +var _0x1261=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','index','get','isAuthenticated','describe','/:id','put','delete','destroy'];(function(_0x230bac,_0x542cfe){var _0x5148be=function(_0x1e6ed5){while(--_0x1e6ed5){_0x230bac['push'](_0x230bac['shift']());}};_0x5148be(++_0x542cfe);}(_0x1261,0x144));var _0x1126=function(_0x442ede,_0x2c3376){_0x442ede=_0x442ede-0x0;var _0x3b7c68=_0x1261[_0x442ede];return _0x3b7c68;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/describe',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['show']);router[_0x1126('0xf')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['update']);router[_0x1126('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x1126('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 0ff59a9..f704131 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 _0xe16d=['followuptime','diff','seconds','BOOLEAN','moment','INTEGER','STRING','DATE','setDataValue'];(function(_0x239dba,_0x309e95){var _0x1ceb11=function(_0x14efe6){while(--_0x14efe6){_0x239dba['push'](_0x239dba['shift']());}};_0x1ceb11(++_0x309e95);}(_0xe16d,0x1c6));var _0xde16=function(_0x8b298b,_0x2c3ed5){_0x8b298b=_0x8b298b-0x0;var _0x10cc1f=_0xe16d[_0x8b298b];return _0x10cc1f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xde16('0x0'));module['exports']={'state':{'type':Sequelize[_0xde16('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xde16('0x2')]},'scheduledat':{'type':Sequelize[_0xde16('0x3')]},'countbusyretry':{'type':Sequelize[_0xde16('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xde16('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xde16('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xde16('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xde16('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xde16('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xde16('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xde16('0x3')]},'answertime':{'type':Sequelize[_0xde16('0x3')]},'droptime':{'type':Sequelize[_0xde16('0x3')]},'endtime':{'type':Sequelize[_0xde16('0x3')]},'ringtime':{'type':Sequelize[_0xde16('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xde16('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xde16('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xde16('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xde16('0x2')]},'reason':{'type':Sequelize[_0xde16('0x2')]},'disposition':{'type':Sequelize[_0xde16('0x2')]},'secondDisposition':{'type':Sequelize[_0xde16('0x2')]},'thirdDisposition':{'type':Sequelize[_0xde16('0x2')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x907cc9){var _0x1a9dbd=this['getDataValue']('endtime');if(_0x1a9dbd&&_0x907cc9){this[_0xde16('0x4')](_0xde16('0x5'),moment(_0x907cc9)[_0xde16('0x6')](moment(_0x1a9dbd),_0xde16('0x7')));}}},'amd':{'type':Sequelize[_0xde16('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0xde16('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xde16('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xde16('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xde16('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xde16('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xde16('0x3')]},'deleted':{'type':Sequelize[_0xde16('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xde16('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xde16('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xde16('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xbc80=['followuptime','diff','seconds','BOOLEAN','sequelize','INTEGER','STRING','DATE','getDataValue','setDataValue'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xbc80,0xae));var _0x0bc8=function(_0x580b15,_0x28afa4){_0x580b15=_0x580b15-0x0;var _0x1adb1b=_0xbc80[_0x580b15];return _0x1adb1b;};'use strict';var Sequelize=require(_0x0bc8('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0x0bc8('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x0bc8('0x2')]},'scheduledat':{'type':Sequelize[_0x0bc8('0x3')]},'countbusyretry':{'type':Sequelize[_0x0bc8('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0bc8('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0bc8('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0bc8('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x0bc8('0x2')]},'originatecalleridname':{'type':Sequelize[_0x0bc8('0x2')]},'calleridnum':{'type':Sequelize[_0x0bc8('0x2')]},'calleridname':{'type':Sequelize[_0x0bc8('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x0bc8('0x3')]},'answertime':{'type':Sequelize[_0x0bc8('0x3')]},'droptime':{'type':Sequelize[_0x0bc8('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x0bc8('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0bc8('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0bc8('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0bc8('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x0bc8('0x2')]},'membername':{'type':Sequelize[_0x0bc8('0x2')]},'reason':{'type':Sequelize[_0x0bc8('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x0bc8('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x0bc8('0x3')],'set':function(_0x3f6b78){var _0x4a66b2=this[_0x0bc8('0x4')]('endtime');if(_0x4a66b2&&_0x3f6b78){this[_0x0bc8('0x5')](_0x0bc8('0x6'),moment(_0x3f6b78)[_0x0bc8('0x7')](moment(_0x4a66b2),_0x0bc8('0x8')));}}},'amd':{'type':Sequelize[_0x0bc8('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0x0bc8('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x0bc8('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x0bc8('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x0bc8('0x3')]},'callback':{'type':Sequelize[_0x0bc8('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0bc8('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x0bc8('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x0bc8('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x0bc8('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x0bc8('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0bc8('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0bc8('0x1')],'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 343ab8c..48fa30c 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 _0x781d=['length','nolimit','order','where','filters','filter','merge','VIRTUAL','includeAll','catch','show','params','rawAttributes','options','body','uniqueid','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','findAll','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','VoiceQueueId\x20=\x20?','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','fromQuery','CampaignId','CampaignId\x20=\x20?','checkContactHopper','CmHopper','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','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','Content-Range','json','apply','reject','update','destroy','then','error','name','send','index','map','CmHopperFinal','fieldName','type','key','query','keys','intersection','model','attributes','fields'];(function(_0x5534fe,_0x43c22e){var _0x3d1dc2=function(_0x9df12){while(--_0x9df12){_0x5534fe['push'](_0x5534fe['shift']());}};_0x3d1dc2(++_0x43c22e);}(_0x781d,0x14a));var _0xd781=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x781d[_0x160c73];return _0xd9302;};'use strict';var emlformat=require(_0xd781('0x0'));var rimraf=require(_0xd781('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd781('0x2'));var moment=require(_0xd781('0x3'));var BPromise=require(_0xd781('0x4'));var Mustache=require(_0xd781('0x5'));var util=require(_0xd781('0x6'));var path=require(_0xd781('0x7'));var sox=require(_0xd781('0x8'));var csv=require(_0xd781('0x9'));var ejs=require(_0xd781('0xa'));var fs=require('fs');var fs_extra=require(_0xd781('0xb'));var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var authService=require(_0xd781('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd781('0x13'));var hardwareService=require(_0xd781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd781('0x15'));var config=require(_0xd781('0x16'));var licenseUtil=require(_0xd781('0x17'));var db=require(_0xd781('0x18'))['db'];function respondWithStatusCode(_0xbea78b,_0x1f2f1e){_0x1f2f1e=_0x1f2f1e||0xcc;return function(_0xc7758f){if(_0xc7758f){return _0xbea78b[_0xd781('0x19')](_0x1f2f1e);}return _0xbea78b[_0xd781('0x1a')](_0x1f2f1e)[_0xd781('0x1b')]();};}function respondWithResult(_0xd454e7,_0x587953){_0x587953=_0x587953||0xc8;return function(_0x477bdc){if(_0x477bdc){return _0xd454e7[_0xd781('0x1a')](_0x587953)['json'](_0x477bdc);}};}function respondWithFilteredResult(_0x3a1f48,_0x48bffc){return function(_0x294e5a){if(_0x294e5a){var _0x22d787=typeof _0x48bffc[_0xd781('0x1c')]===_0xd781('0x1d')&&typeof _0x48bffc[_0xd781('0x1e')]===_0xd781('0x1d');var _0x501b0d=_0x294e5a['count'];var _0x1407fc=_0x22d787?0x0:_0x48bffc[_0xd781('0x1c')];var _0x395d9c=_0x22d787?_0x294e5a[_0xd781('0x1f')]:_0x48bffc[_0xd781('0x1c')]+_0x48bffc[_0xd781('0x1e')];var _0x260aa8;if(_0x395d9c>=_0x501b0d){_0x395d9c=_0x501b0d;_0x260aa8=0xc8;}else{_0x260aa8=0xce;}_0x3a1f48[_0xd781('0x1a')](_0x260aa8);return _0x3a1f48['set'](_0xd781('0x20'),_0x1407fc+'-'+_0x395d9c+'/'+_0x501b0d)[_0xd781('0x21')](_0x294e5a);}return null;};}function patchUpdates(_0x1036d3){return function(_0x103758){try{jsonpatch[_0xd781('0x22')](_0x103758,_0x1036d3,!![]);}catch(_0x274665){return BPromise[_0xd781('0x23')](_0x274665);}return _0x103758['save']();};}function saveUpdates(_0xe0c65f,_0x4e2c56){return function(_0x567fdf){if(_0x567fdf){return _0x567fdf[_0xd781('0x24')](_0xe0c65f)['then'](function(_0x175ba6){return _0x175ba6;});}return null;};}function removeEntity(_0x101480,_0x395087){return function(_0x31bf57){if(_0x31bf57){return _0x31bf57[_0xd781('0x25')]()[_0xd781('0x26')](function(){_0x101480[_0xd781('0x1a')](0xcc)[_0xd781('0x1b')]();});}};}function handleEntityNotFound(_0x10940b,_0x5662db){return function(_0x529ca1){if(!_0x529ca1){_0x10940b[_0xd781('0x19')](0x194);}return _0x529ca1;};}function handleError(_0x849587,_0xdad0b1){_0xdad0b1=_0xdad0b1||0x1f4;return function(_0x57b41e){logger[_0xd781('0x27')](_0x57b41e['stack']);if(_0x57b41e['name']){delete _0x57b41e[_0xd781('0x28')];}_0x849587['status'](_0xdad0b1)[_0xd781('0x29')](_0x57b41e);};}exports[_0xd781('0x2a')]=function(_0x5c3848,_0x5b6b9d){var _0x43cc74={},_0x5b0464={},_0x296a0b={'count':0x0,'rows':[]};var _0x4a3bd3=_[_0xd781('0x2b')](db[_0xd781('0x2c')]['rawAttributes'],function(_0x54521e){return{'name':_0x54521e[_0xd781('0x2d')],'type':_0x54521e[_0xd781('0x2e')][_0xd781('0x2f')]};});_0x5b0464['model']=_['map'](_0x4a3bd3,_0xd781('0x28'));_0x5b0464[_0xd781('0x30')]=_[_0xd781('0x31')](_0x5c3848['query']);_0x5b0464['filters']=_[_0xd781('0x32')](_0x5b0464[_0xd781('0x33')],_0x5b0464['query']);_0x43cc74[_0xd781('0x34')]=_[_0xd781('0x32')](_0x5b0464['model'],qs[_0xd781('0x35')](_0x5c3848[_0xd781('0x30')][_0xd781('0x35')]));_0x43cc74[_0xd781('0x34')]=_0x43cc74['attributes'][_0xd781('0x36')]?_0x43cc74[_0xd781('0x34')]:_0x5b0464[_0xd781('0x33')];if(!_0x5c3848[_0xd781('0x30')]['hasOwnProperty'](_0xd781('0x37'))){_0x43cc74[_0xd781('0x1e')]=qs['limit'](_0x5c3848[_0xd781('0x30')]['limit']);_0x43cc74[_0xd781('0x1c')]=qs[_0xd781('0x1c')](_0x5c3848['query'][_0xd781('0x1c')]);}_0x43cc74[_0xd781('0x38')]=qs['sort'](_0x5c3848[_0xd781('0x30')]['sort']);_0x43cc74[_0xd781('0x39')]=qs[_0xd781('0x3a')](_['pick'](_0x5c3848[_0xd781('0x30')],_0x5b0464[_0xd781('0x3a')]),_0x4a3bd3);if(_0x5c3848['query'][_0xd781('0x3b')]){_0x43cc74[_0xd781('0x39')]=_[_0xd781('0x3c')](_0x43cc74['where'],{'$or':_[_0xd781('0x2b')](_0x4a3bd3,function(_0x22b94e){if(_0x22b94e[_0xd781('0x2e')]!==_0xd781('0x3d')){var _0x2e8218={};_0x2e8218[_0x22b94e[_0xd781('0x28')]]={'$like':'%'+_0x5c3848[_0xd781('0x30')][_0xd781('0x3b')]+'%'};return _0x2e8218;}})});}_0x43cc74=_[_0xd781('0x3c')]({},_0x43cc74,_0x5c3848['options']);var _0x2a60d6={'where':_0x43cc74['where']};return db[_0xd781('0x2c')][_0xd781('0x1f')](_0x2a60d6)['then'](function(_0x1a5833){_0x296a0b[_0xd781('0x1f')]=_0x1a5833;if(_0x5c3848[_0xd781('0x30')][_0xd781('0x3e')]){_0x43cc74['include']=[{'all':!![]}];}return db[_0xd781('0x2c')]['findAll'](_0x43cc74);})[_0xd781('0x26')](function(_0xcdaacf){_0x296a0b['rows']=_0xcdaacf;return _0x296a0b;})['then'](respondWithFilteredResult(_0x5b6b9d,_0x43cc74))[_0xd781('0x3f')](handleError(_0x5b6b9d,null));};exports[_0xd781('0x40')]=function(_0x15b49d,_0x23bbab){var _0x53aba6={'raw':!![],'where':{'id':_0x15b49d[_0xd781('0x41')]['id']}},_0x46e7f6={};_0x46e7f6['model']=_['keys'](db[_0xd781('0x2c')][_0xd781('0x42')]);_0x46e7f6[_0xd781('0x30')]=_['keys'](_0x15b49d['query']);_0x46e7f6[_0xd781('0x3a')]=_[_0xd781('0x32')](_0x46e7f6[_0xd781('0x33')],_0x46e7f6[_0xd781('0x30')]);_0x53aba6[_0xd781('0x34')]=_[_0xd781('0x32')](_0x46e7f6['model'],qs['fields'](_0x15b49d[_0xd781('0x30')][_0xd781('0x35')]));_0x53aba6[_0xd781('0x34')]=_0x53aba6[_0xd781('0x34')][_0xd781('0x36')]?_0x53aba6['attributes']:_0x46e7f6[_0xd781('0x33')];if(_0x15b49d[_0xd781('0x30')][_0xd781('0x3e')]){_0x53aba6['include']=[{'all':!![]}];}_0x53aba6=_[_0xd781('0x3c')]({},_0x53aba6,_0x15b49d[_0xd781('0x43')]);return db[_0xd781('0x2c')]['find'](_0x53aba6)[_0xd781('0x26')](handleEntityNotFound(_0x23bbab,null))[_0xd781('0x26')](respondWithResult(_0x23bbab,null))['catch'](handleError(_0x23bbab,null));};exports['describe']=function(_0x13a907,_0x16d16e){return db[_0xd781('0x2c')]['describe']()[_0xd781('0x26')](respondWithResult(_0x16d16e,null))[_0xd781('0x3f')](handleError(_0x16d16e,null));};exports[_0xd781('0x24')]=function(_0x39ecdb,_0x336d30){if(_0x39ecdb[_0xd781('0x44')][_0xd781('0x45')]){delete _0x39ecdb['body'][_0xd781('0x45')];}return db[_0xd781('0x2c')][_0xd781('0x46')]({'where':{'uniqueid':_0x39ecdb['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x336d30,null))[_0xd781('0x26')](saveUpdates(_0x39ecdb['body'],null))[_0xd781('0x26')](respondWithResult(_0x336d30,null))[_0xd781('0x3f')](handleError(_0x336d30,null));};exports[_0xd781('0x47')]=function(_0x207546,_0x42a2f9,_0x599915){return db[_0xd781('0x2c')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x207546[_0xd781('0x41')]['id']},'attributes':[[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0xd781('0x4b')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xd781('0x4c')],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')](_0xd781('0x4d')))),_0xd781('0x4e')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize']['literal'](_0xd781('0x4f')))),_0xd781('0x50')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db[_0xd781('0x49')]['literal'](_0xd781('0x51')))),_0xd781('0x52')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x2022,\x201,\x20null'))),_0xd781('0x53')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')]['literal'](_0xd781('0x54')))),_0xd781('0x55')]]})['then'](handleEntityNotFound(_0x42a2f9,null))[_0xd781('0x26')](respondWithResult(_0x42a2f9,null))[_0xd781('0x3f')](handleError(_0x42a2f9,null));};exports[_0xd781('0x56')]=function(_0x2c4874,_0x2e8bab,_0x38bd3e){return db[_0xd781('0x2c')][_0xd781('0x57')]({'raw':![],'where':{'CampaignId':_0x2c4874[_0xd781('0x41')]['id']},'attributes':[[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x58')))),_0xd781('0x59')],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x5a')))),_0xd781('0x4b')],[db['sequelize']['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x4d')))),_0xd781('0x4e')],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x4f')))),_0xd781('0x50')],[db['sequelize']['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')](_0xd781('0x51')))),_0xd781('0x52')],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x5b')))),_0xd781('0x53')],[db['sequelize']['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xd781('0x26')](handleEntityNotFound(_0x2e8bab,null))[_0xd781('0x26')](respondWithResult(_0x2e8bab,null))[_0xd781('0x3f')](handleError(_0x2e8bab,null));};exports[_0xd781('0x5c')]=function(_0x26a0a9,_0x172a05,_0x2e0401){return db[_0xd781('0x5d')][_0xd781('0x46')]({'where':{'id':_0x26a0a9['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x172a05,null))[_0xd781('0x26')](function(_0x4c712f){var _0x24e3f5;if(_0x4c712f){_0x24e3f5=squel['insert']()[_0xd781('0x5e')](_0xd781('0x5f'))['fromQuery'](['phone',_0xd781('0x60'),_0xd781('0x61'),_0xd781('0x62'),_0xd781('0x63'),_0xd781('0x64'),_0xd781('0x65')],squel['select']()[_0xd781('0x66')](_0xd781('0x67'),_0xd781('0x68'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x60'))[_0xd781('0x66')](_0xd781('0x6a'),_0xd781('0x61'))[_0xd781('0x66')](_0xd781('0x6b'),'ListId')[_0xd781('0x66')]('ANY_VALUE(VoiceQueueId)',_0xd781('0x63'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x64'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x65'))[_0xd781('0x6c')](_0xd781('0x6d'))[_0xd781('0x39')]('VoiceQueueId\x20=\x20?',_0x26a0a9[_0xd781('0x41')]['id'][_0xd781('0x6e')]())['where'](_0xd781('0x6f'),_0x26a0a9[_0xd781('0x44')][_0xd781('0x70')]['toString']())['where'](_0xd781('0x71'))['where'](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x68'))[_0xd781('0x6c')]('cm_hopper')[_0xd781('0x39')](_0xd781('0x74'),_0x26a0a9[_0xd781('0x41')]['id'][_0xd781('0x6e')]()))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x75'))[_0xd781('0x6c')](_0xd781('0x6d'))['where'](_0xd781('0x74'),_0x26a0a9[_0xd781('0x41')]['id']['toString']())[_0xd781('0x39')](_0xd781('0x76')))[_0xd781('0x77')]('ContactId'))[_0xd781('0x6e')]();return db[_0xd781('0x49')]['query'](_0x24e3f5);}return[];})[_0xd781('0x26')](respondWithResult(_0x172a05,null))['catch'](handleError(_0x172a05,null));};exports[_0xd781('0x78')]=function(_0x23dba5,_0x3e0749,_0x192c95){return db[_0xd781('0x79')]['find']({'where':{'id':_0x23dba5[_0xd781('0x41')]['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x3e0749,null))[_0xd781('0x26')](function(_0x3897bf){var _0xaa945b;if(_0x3897bf){_0xaa945b=squel[_0xd781('0x7a')]()['into'](_0xd781('0x5f'))[_0xd781('0x7b')](['phone',_0xd781('0x60'),_0xd781('0x61'),'ListId',_0xd781('0x7c'),_0xd781('0x64'),_0xd781('0x65')],squel[_0xd781('0x73')]()[_0xd781('0x66')]('ANY_VALUE(calleridnum)','phone')['field'](_0xd781('0x69'),_0xd781('0x60'))[_0xd781('0x66')](_0xd781('0x6a'),_0xd781('0x61'))[_0xd781('0x66')](_0xd781('0x6b'),_0xd781('0x62'))[_0xd781('0x66')]('ANY_VALUE(CampaignId)',_0xd781('0x7c'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x64'))[_0xd781('0x66')]('NOW()','updatedAt')['from'](_0xd781('0x6d'))['where'](_0xd781('0x7d'),_0x23dba5[_0xd781('0x41')]['id']['toString']())['where'](_0xd781('0x6f'),_0x23dba5[_0xd781('0x44')][_0xd781('0x70')][_0xd781('0x6e')]())['where'](_0xd781('0x71'))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')]('phone')[_0xd781('0x6c')](_0xd781('0x5f'))['where'](_0xd781('0x7d'),_0x23dba5[_0xd781('0x41')]['id'][_0xd781('0x6e')]()))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x75'))['from']('cm_hopper_final')[_0xd781('0x39')](_0xd781('0x7d'),_0x23dba5['params']['id'][_0xd781('0x6e')]())[_0xd781('0x39')]('state\x20=\x204'))[_0xd781('0x77')](_0xd781('0x61')))['toString']();return db[_0xd781('0x49')]['query'](_0xaa945b);}return[];})[_0xd781('0x26')](respondWithResult(_0x3e0749,null))[_0xd781('0x3f')](handleError(_0x3e0749,null));};exports[_0xd781('0x7e')]=function(_0x52b9c6,_0x5a2252,_0x356c56){return db[_0xd781('0x7f')]['findOne']({'where':{'VoiceQueueId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x63')],'CampaignId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x7c')],'ContactId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x61')]}})[_0xd781('0x26')](handleEntityNotFound(_0x5a2252,null))[_0xd781('0x26')](function(_0x532fd8){if(_0x532fd8){return _0x532fd8;}return null;})[_0xd781('0x26')](respondWithResult(_0x5a2252,null))[_0xd781('0x3f')](handleError(_0x5a2252,null));}; \ No newline at end of file +var _0x57ca=['state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','cm_hopper','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','toString','group','moveContactsIvrCampaignHopperFinal','scheduledAt','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','from','state\x20=\x204','checkContactHopper','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','CmHopperFinal','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','params','find','catch','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noAnswerContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','phone','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','cm_hopper_final','VoiceQueueId\x20=\x20?'];(function(_0x1bec15,_0x501038){var _0x5cec2b=function(_0x39f11d){while(--_0x39f11d){_0x1bec15['push'](_0x1bec15['shift']());}};_0x5cec2b(++_0x501038);}(_0x57ca,0x108));var _0xa57c=function(_0xa015cf,_0x14c10c){_0xa015cf=_0xa015cf-0x0;var _0x4f9ee9=_0x57ca[_0xa015cf];return _0x4f9ee9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57c('0x0'));var zipdir=require(_0xa57c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var Mustache=require(_0xa57c('0x5'));var util=require(_0xa57c('0x6'));var path=require('path');var sox=require(_0xa57c('0x7'));var csv=require(_0xa57c('0x8'));var ejs=require(_0xa57c('0x9'));var fs=require('fs');var fs_extra=require(_0xa57c('0xa'));var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x8'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa57c('0x15'));var db=require(_0xa57c('0x16'))['db'];function respondWithStatusCode(_0x1f2bb5,_0x9e25bf){_0x9e25bf=_0x9e25bf||0xcc;return function(_0x205e72){if(_0x205e72){return _0x1f2bb5['sendStatus'](_0x9e25bf);}return _0x1f2bb5[_0xa57c('0x17')](_0x9e25bf)['end']();};}function respondWithResult(_0x30d23d,_0x3d5995){_0x3d5995=_0x3d5995||0xc8;return function(_0x30940d){if(_0x30940d){return _0x30d23d[_0xa57c('0x17')](_0x3d5995)[_0xa57c('0x18')](_0x30940d);}};}function respondWithFilteredResult(_0x37a323,_0x3f900a){return function(_0x4b4bdb){if(_0x4b4bdb){var _0x26607a=typeof _0x3f900a[_0xa57c('0x19')]===_0xa57c('0x1a')&&typeof _0x3f900a['limit']===_0xa57c('0x1a');var _0x5f33f1=_0x4b4bdb[_0xa57c('0x1b')];var _0x3d781d=_0x26607a?0x0:_0x3f900a[_0xa57c('0x19')];var _0xe3d505=_0x26607a?_0x4b4bdb[_0xa57c('0x1b')]:_0x3f900a[_0xa57c('0x19')]+_0x3f900a[_0xa57c('0x1c')];var _0x595c7a;if(_0xe3d505>=_0x5f33f1){_0xe3d505=_0x5f33f1;_0x595c7a=0xc8;}else{_0x595c7a=0xce;}_0x37a323['status'](_0x595c7a);return _0x37a323[_0xa57c('0x1d')]('Content-Range',_0x3d781d+'-'+_0xe3d505+'/'+_0x5f33f1)['json'](_0x4b4bdb);}return null;};}function patchUpdates(_0x418415){return function(_0xa5b314){try{jsonpatch[_0xa57c('0x1e')](_0xa5b314,_0x418415,!![]);}catch(_0x23bec0){return BPromise['reject'](_0x23bec0);}return _0xa5b314[_0xa57c('0x1f')]();};}function saveUpdates(_0x25715f,_0x34d1bc){return function(_0x2213b2){if(_0x2213b2){return _0x2213b2[_0xa57c('0x20')](_0x25715f)[_0xa57c('0x21')](function(_0x1e0192){return _0x1e0192;});}return null;};}function removeEntity(_0x42038e,_0x2e99ed){return function(_0xdf65dd){if(_0xdf65dd){return _0xdf65dd[_0xa57c('0x22')]()[_0xa57c('0x21')](function(){_0x42038e[_0xa57c('0x17')](0xcc)[_0xa57c('0x23')]();});}};}function handleEntityNotFound(_0x431bec,_0x511a26){return function(_0x2db443){if(!_0x2db443){_0x431bec[_0xa57c('0x24')](0x194);}return _0x2db443;};}function handleError(_0x27884d,_0x5228b9){_0x5228b9=_0x5228b9||0x1f4;return function(_0x315ad7){logger[_0xa57c('0x25')](_0x315ad7[_0xa57c('0x26')]);if(_0x315ad7[_0xa57c('0x27')]){delete _0x315ad7[_0xa57c('0x27')];}_0x27884d[_0xa57c('0x17')](_0x5228b9)['send'](_0x315ad7);};}exports[_0xa57c('0x28')]=function(_0x4c1478,_0x54a18b){var _0x257661={},_0x7d10ec={},_0x5a3e03={'count':0x0,'rows':[]};var _0x12898b=_[_0xa57c('0x29')](db[_0xa57c('0x2a')]['rawAttributes'],function(_0xd779f1){return{'name':_0xd779f1['fieldName'],'type':_0xd779f1[_0xa57c('0x2b')]['key']};});_0x7d10ec[_0xa57c('0x2c')]=_['map'](_0x12898b,_0xa57c('0x27'));_0x7d10ec['query']=_[_0xa57c('0x2d')](_0x4c1478[_0xa57c('0x2e')]);_0x7d10ec[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x7d10ec[_0xa57c('0x2c')],_0x7d10ec[_0xa57c('0x2e')]);_0x257661[_0xa57c('0x31')]=_['intersection'](_0x7d10ec[_0xa57c('0x2c')],qs['fields'](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x257661[_0xa57c('0x31')]=_0x257661['attributes'][_0xa57c('0x33')]?_0x257661['attributes']:_0x7d10ec[_0xa57c('0x2c')];if(!_0x4c1478['query'][_0xa57c('0x34')]('nolimit')){_0x257661[_0xa57c('0x1c')]=qs[_0xa57c('0x1c')](_0x4c1478['query'][_0xa57c('0x1c')]);_0x257661['offset']=qs[_0xa57c('0x19')](_0x4c1478['query'][_0xa57c('0x19')]);}_0x257661[_0xa57c('0x35')]=qs[_0xa57c('0x36')](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x36')]);_0x257661[_0xa57c('0x37')]=qs['filters'](_['pick'](_0x4c1478[_0xa57c('0x2e')],_0x7d10ec[_0xa57c('0x2f')]),_0x12898b);if(_0x4c1478[_0xa57c('0x2e')]['filter']){_0x257661[_0xa57c('0x37')]=_['merge'](_0x257661[_0xa57c('0x37')],{'$or':_[_0xa57c('0x29')](_0x12898b,function(_0x5c8256){if(_0x5c8256['type']!=='VIRTUAL'){var _0x3be888={};_0x3be888[_0x5c8256[_0xa57c('0x27')]]={'$like':'%'+_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x38')]+'%'};return _0x3be888;}})});}_0x257661=_[_0xa57c('0x39')]({},_0x257661,_0x4c1478[_0xa57c('0x3a')]);var _0x5a444a={'where':_0x257661[_0xa57c('0x37')]};return db[_0xa57c('0x2a')]['count'](_0x5a444a)['then'](function(_0x5e10b){_0x5a3e03[_0xa57c('0x1b')]=_0x5e10b;if(_0x4c1478['query'][_0xa57c('0x3b')]){_0x257661[_0xa57c('0x3c')]=[{'all':!![]}];}return db[_0xa57c('0x2a')][_0xa57c('0x3d')](_0x257661);})[_0xa57c('0x21')](function(_0x43c1d7){_0x5a3e03['rows']=_0x43c1d7;return _0x5a3e03;})[_0xa57c('0x21')](respondWithFilteredResult(_0x54a18b,_0x257661))['catch'](handleError(_0x54a18b,null));};exports['show']=function(_0x5b3300,_0x520383){var _0x588199={'raw':!![],'where':{'id':_0x5b3300[_0xa57c('0x3e')]['id']}},_0x39b20f={};_0x39b20f[_0xa57c('0x2c')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x39b20f[_0xa57c('0x2e')]=_[_0xa57c('0x2d')](_0x5b3300[_0xa57c('0x2e')]);_0x39b20f[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],_0x39b20f['query']);_0x588199[_0xa57c('0x31')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],qs[_0xa57c('0x32')](_0x5b3300[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x588199['attributes']=_0x588199[_0xa57c('0x31')][_0xa57c('0x33')]?_0x588199[_0xa57c('0x31')]:_0x39b20f[_0xa57c('0x2c')];if(_0x5b3300[_0xa57c('0x2e')]['includeAll']){_0x588199[_0xa57c('0x3c')]=[{'all':!![]}];}_0x588199=_[_0xa57c('0x39')]({},_0x588199,_0x5b3300[_0xa57c('0x3a')]);return db[_0xa57c('0x2a')][_0xa57c('0x3f')](_0x588199)[_0xa57c('0x21')](handleEntityNotFound(_0x520383,null))['then'](respondWithResult(_0x520383,null))[_0xa57c('0x40')](handleError(_0x520383,null));};exports[_0xa57c('0x41')]=function(_0x247906,_0x44ea0a){return db[_0xa57c('0x2a')][_0xa57c('0x41')]()['then'](respondWithResult(_0x44ea0a,null))['catch'](handleError(_0x44ea0a,null));};exports['update']=function(_0x5082ef,_0x232675){if(_0x5082ef['body'][_0xa57c('0x42')]){delete _0x5082ef[_0xa57c('0x43')]['uniqueid'];}return db[_0xa57c('0x2a')][_0xa57c('0x3f')]({'where':{'uniqueid':_0x5082ef[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x232675,null))[_0xa57c('0x21')](saveUpdates(_0x5082ef['body'],null))[_0xa57c('0x21')](respondWithResult(_0x232675,null))[_0xa57c('0x40')](handleError(_0x232675,null));};exports[_0xa57c('0x44')]=function(_0xd57bac,_0x2e4b84,_0x5ace6d){return db[_0xa57c('0x2a')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0xd57bac['params']['id']},'attributes':[[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db[_0xa57c('0x45')]['fn']('IF',db['sequelize']['literal'](_0xa57c('0x47')))),_0xa57c('0x48')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db['sequelize']['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x4a')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xa57c('0x46'),db[_0xa57c('0x45')]['fn']('IF',db['sequelize'][_0xa57c('0x49')](_0xa57c('0x4b')))),_0xa57c('0x4c')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db[_0xa57c('0x45')]['fn']('IF',db[_0xa57c('0x45')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xa57c('0x4d')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db[_0xa57c('0x45')]['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x4e')))),_0xa57c('0x4f')],[db['sequelize']['fn']('COUNT',db[_0xa57c('0x45')]['fn']('IF',db['sequelize'][_0xa57c('0x49')](_0xa57c('0x50')))),_0xa57c('0x51')],[db['sequelize']['fn'](_0xa57c('0x46'),db['sequelize']['fn']('IF',db[_0xa57c('0x45')]['literal'](_0xa57c('0x52')))),_0xa57c('0x53')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db['sequelize']['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x54')))),_0xa57c('0x55')]]})[_0xa57c('0x21')](handleEntityNotFound(_0x2e4b84,null))['then'](respondWithResult(_0x2e4b84,null))[_0xa57c('0x40')](handleError(_0x2e4b84,null));};exports[_0xa57c('0x56')]=function(_0x1899ad,_0xb19d93,_0x2adcf6){return db[_0xa57c('0x2a')][_0xa57c('0x3d')]({'raw':![],'where':{'CampaignId':_0x1899ad[_0xa57c('0x3e')]['id']},'attributes':[[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db['sequelize']['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x47')))),_0xa57c('0x48')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db['sequelize']['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')]('`state`\x20=\x203,\x201,\x20null'))),_0xa57c('0x57')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db[_0xa57c('0x45')]['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x4b')))),'busyContacts'],[db[_0xa57c('0x45')]['fn']('COUNT',db[_0xa57c('0x45')]['fn']('IF',db['sequelize'][_0xa57c('0x49')]('`state`\x20=\x208,\x201,\x20null'))),_0xa57c('0x4d')],[db[_0xa57c('0x45')]['fn']('COUNT',db[_0xa57c('0x45')]['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x4e')))),'dropContacts'],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db[_0xa57c('0x45')]['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x50')))),_0xa57c('0x51')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db[_0xa57c('0x45')]['fn']('IF',db[_0xa57c('0x45')][_0xa57c('0x49')](_0xa57c('0x52')))),_0xa57c('0x53')],[db[_0xa57c('0x45')]['fn'](_0xa57c('0x46'),db['sequelize']['fn']('IF',db[_0xa57c('0x45')]['literal'](_0xa57c('0x54')))),_0xa57c('0x55')]]})[_0xa57c('0x21')](handleEntityNotFound(_0xb19d93,null))['then'](respondWithResult(_0xb19d93,null))[_0xa57c('0x40')](handleError(_0xb19d93,null));};exports[_0xa57c('0x58')]=function(_0x1be631,_0x47e3d5,_0x571e10){return db[_0xa57c('0x59')][_0xa57c('0x3f')]({'where':{'id':_0x1be631[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x47e3d5,null))[_0xa57c('0x21')](function(_0x39411b){var _0x2a7aab;if(_0x39411b){_0x2a7aab=squel[_0xa57c('0x5a')]()[_0xa57c('0x5b')]('cm_hopper')[_0xa57c('0x5c')]([_0xa57c('0x5d'),'scheduledAt',_0xa57c('0x5e'),_0xa57c('0x5f'),_0xa57c('0x60'),_0xa57c('0x61'),_0xa57c('0x62')],squel[_0xa57c('0x63')]()[_0xa57c('0x64')](_0xa57c('0x65'),'phone')[_0xa57c('0x64')](_0xa57c('0x66'),'scheduledAt')[_0xa57c('0x64')](_0xa57c('0x67'),'ContactId')['field'](_0xa57c('0x68'),_0xa57c('0x5f'))[_0xa57c('0x64')](_0xa57c('0x69'),_0xa57c('0x60'))['field'](_0xa57c('0x66'),_0xa57c('0x61'))[_0xa57c('0x64')]('NOW()',_0xa57c('0x62'))['from'](_0xa57c('0x6a'))[_0xa57c('0x37')](_0xa57c('0x6b'),_0x1be631[_0xa57c('0x3e')]['id']['toString']())[_0xa57c('0x37')](_0xa57c('0x6c'),_0x1be631[_0xa57c('0x43')][_0xa57c('0x6d')]['toString']())[_0xa57c('0x37')](_0xa57c('0x6e'))[_0xa57c('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xa57c('0x63')]()[_0xa57c('0x64')](_0xa57c('0x5d'))['from'](_0xa57c('0x6f'))[_0xa57c('0x37')](_0xa57c('0x6b'),_0x1be631[_0xa57c('0x3e')]['id']['toString']()))[_0xa57c('0x37')](_0xa57c('0x70'),squel['select']()[_0xa57c('0x64')](_0xa57c('0x71'))['from'](_0xa57c('0x6a'))['where'](_0xa57c('0x6b'),_0x1be631[_0xa57c('0x3e')]['id'][_0xa57c('0x72')]())[_0xa57c('0x37')]('state\x20=\x204'))[_0xa57c('0x73')](_0xa57c('0x5e')))[_0xa57c('0x72')]();return db[_0xa57c('0x45')][_0xa57c('0x2e')](_0x2a7aab);}return[];})[_0xa57c('0x21')](respondWithResult(_0x47e3d5,null))[_0xa57c('0x40')](handleError(_0x47e3d5,null));};exports[_0xa57c('0x74')]=function(_0x1129f,_0x2c4e6c,_0x46dbb1){return db['Campaign']['find']({'where':{'id':_0x1129f['params']['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x2c4e6c,null))['then'](function(_0x43c430){var _0x442dc7;if(_0x43c430){_0x442dc7=squel[_0xa57c('0x5a')]()['into'](_0xa57c('0x6f'))[_0xa57c('0x5c')]([_0xa57c('0x5d'),_0xa57c('0x75'),_0xa57c('0x5e'),_0xa57c('0x5f'),_0xa57c('0x76'),'createdAt',_0xa57c('0x62')],squel[_0xa57c('0x63')]()['field']('ANY_VALUE(calleridnum)',_0xa57c('0x5d'))[_0xa57c('0x64')]('NOW()','scheduledAt')[_0xa57c('0x64')]('ANY_VALUE(ContactId)',_0xa57c('0x5e'))[_0xa57c('0x64')]('ANY_VALUE(ListId)',_0xa57c('0x5f'))[_0xa57c('0x64')](_0xa57c('0x77'),_0xa57c('0x76'))[_0xa57c('0x64')]('NOW()',_0xa57c('0x61'))['field'](_0xa57c('0x66'),_0xa57c('0x62'))['from']('cm_hopper_final')['where'](_0xa57c('0x78'),_0x1129f['params']['id']['toString']())[_0xa57c('0x37')](_0xa57c('0x6c'),_0x1129f[_0xa57c('0x43')]['state'][_0xa57c('0x72')]())[_0xa57c('0x37')](_0xa57c('0x6e'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xa57c('0x63')]()['field'](_0xa57c('0x5d'))[_0xa57c('0x79')]('cm_hopper')[_0xa57c('0x37')]('CampaignId\x20=\x20?',_0x1129f['params']['id']['toString']()))[_0xa57c('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xa57c('0x71'))[_0xa57c('0x79')]('cm_hopper_final')[_0xa57c('0x37')](_0xa57c('0x78'),_0x1129f[_0xa57c('0x3e')]['id']['toString']())[_0xa57c('0x37')](_0xa57c('0x7a')))[_0xa57c('0x73')](_0xa57c('0x5e')))['toString']();return db['sequelize'][_0xa57c('0x2e')](_0x442dc7);}return[];})['then'](respondWithResult(_0x2c4e6c,null))[_0xa57c('0x40')](handleError(_0x2c4e6c,null));};exports[_0xa57c('0x7b')]=function(_0x2cc12b,_0x4dc6ac,_0x138c4e){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x2cc12b[_0xa57c('0x43')]['VoiceQueueId'],'CampaignId':_0x2cc12b[_0xa57c('0x43')][_0xa57c('0x76')],'ContactId':_0x2cc12b['body']['ContactId']}})[_0xa57c('0x21')](handleEntityNotFound(_0x4dc6ac,null))[_0xa57c('0x21')](function(_0x50a940){if(_0x50a940){return _0x50a940;}return null;})['then'](respondWithResult(_0x4dc6ac,null))[_0xa57c('0x40')](handleError(_0x4dc6ac,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index a226aab..da940fe 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 _0xebf9=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0xebf9,0xed));var _0x9ebf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xebf9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9ebf('0x0'));var util=require(_0x9ebf('0x1'));var logger=require(_0x9ebf('0x2'))(_0x9ebf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9ebf('0x4'));var fs=require('fs');var path=require(_0x9ebf('0x5'));var rimraf=require(_0x9ebf('0x6'));var config=require(_0x9ebf('0x7'));var attributes=require(_0x9ebf('0x8'));module['exports']=function(_0x20d186,_0x29b6d2){return _0x20d186[_0x9ebf('0x9')](_0x9ebf('0xa'),attributes,{'tableName':_0x9ebf('0xb'),'paranoid':![],'indexes':[{'name':_0x9ebf('0xc'),'fields':['calleridnum']},{'name':_0x9ebf('0xd'),'fields':[_0x9ebf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x47b2=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum'];(function(_0x5ebc04,_0x14a363){var _0x17845c=function(_0x360850){while(--_0x360850){_0x5ebc04['push'](_0x5ebc04['shift']());}};_0x17845c(++_0x14a363);}(_0x47b2,0x111));var _0x247b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x47b2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x247b('0x0'));var util=require(_0x247b('0x1'));var logger=require(_0x247b('0x2'))(_0x247b('0x3'));var moment=require(_0x247b('0x4'));var BPromise=require(_0x247b('0x5'));var rp=require(_0x247b('0x6'));var fs=require('fs');var path=require(_0x247b('0x7'));var rimraf=require(_0x247b('0x8'));var config=require(_0x247b('0x9'));var attributes=require(_0x247b('0xa'));module[_0x247b('0xb')]=function(_0x85ba64,_0x219a89){return _0x85ba64['define'](_0x247b('0xc'),attributes,{'tableName':_0x247b('0xd'),'paranoid':![],'indexes':[{'name':_0x247b('0xe'),'fields':[_0x247b('0xe')]},{'name':_0x247b('0xf'),'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 24b0ef1..9c8925f 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0xe026dd,_0x410aa3){var _0x9f88bf=function(_0x205dcf){while(--_0x205dcf){_0xe026dd['push'](_0xe026dd['shift']());}};_0x9f88bf(++_0x410aa3);}(_0xb10b,0x12a));var _0xbb10=function(_0xd3e0b9,_0xd80d4d){_0xd3e0b9=_0xd3e0b9-0x0;var _0x470133=_0xb10b[_0xd3e0b9];return _0x470133;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x1ec9ef,_0x496bc2){var _0x3ce85c=function(_0x2985d4){while(--_0x2985d4){_0x1ec9ef['push'](_0x1ec9ef['shift']());}};_0x3ce85c(++_0x496bc2);}(_0x7a54,0x106));var _0x47a5=function(_0x5442b3,_0x9b8660){_0x5442b3=_0x5442b3-0x0;var _0x568fd1=_0x7a54[_0x5442b3];return _0x568fd1;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index abc4fc6..4037644 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 _0x05e8=['put','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','isAuthenticated','get','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper'];(function(_0x2da929,_0x482098){var _0x241aa3=function(_0x4471ac){while(--_0x4471ac){_0x2da929['push'](_0x2da929['shift']());}};_0x241aa3(++_0x482098);}(_0x05e8,0xc9));var _0x805e=function(_0x11c564,_0x55be84){_0x11c564=_0x11c564-0x0;var _0x492549=_0x05e8[_0x11c564];return _0x492549;};'use strict';var multer=require(_0x805e('0x0'));var util=require(_0x805e('0x1'));var path=require(_0x805e('0x2'));var timeout=require(_0x805e('0x3'));var express=require('express');var router=express[_0x805e('0x4')]();var fs_extra=require(_0x805e('0x5'));var auth=require(_0x805e('0x6'));var interaction=require(_0x805e('0x7'));var config=require('../../config/environment');var controller=require(_0x805e('0x8'));router['get']('/',auth[_0x805e('0x9')](),controller['index']);router[_0x805e('0xa')]('/describe',auth[_0x805e('0x9')](),controller['describe']);router['get'](_0x805e('0xb'),auth[_0x805e('0x9')](),controller[_0x805e('0xc')]);router[_0x805e('0xa')](_0x805e('0xd'),auth['isAuthenticated'](),controller[_0x805e('0xe')]);router[_0x805e('0xa')](_0x805e('0xf'),auth[_0x805e('0x9')](),controller[_0x805e('0x10')]);router[_0x805e('0x11')](_0x805e('0x12'),auth[_0x805e('0x9')](),controller[_0x805e('0x13')]);router['post'](_0x805e('0x14'),auth['isAuthenticated'](),controller[_0x805e('0x15')]);router[_0x805e('0x11')](_0x805e('0x16'),auth[_0x805e('0x9')](),controller[_0x805e('0x17')]);router[_0x805e('0x18')]('/:id',auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x2420=['./cmHopperFinal.controller','index','get','/describe','isAuthenticated','describe','/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x5a2141,_0x10f036){var _0x577f88=function(_0xc7f5b3){while(--_0xc7f5b3){_0x5a2141['push'](_0x5a2141['shift']());}};_0x577f88(++_0x10f036);}(_0x2420,0xfd));var _0x0242=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x2420[_0x1d9aa0];return _0x226868;};'use strict';var multer=require(_0x0242('0x0'));var util=require(_0x0242('0x1'));var path=require(_0x0242('0x2'));var timeout=require(_0x0242('0x3'));var express=require('express');var router=express[_0x0242('0x4')]();var fs_extra=require(_0x0242('0x5'));var auth=require(_0x0242('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0242('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x0242('0x8')]);router[_0x0242('0x9')](_0x0242('0xa'),auth[_0x0242('0xb')](),controller[_0x0242('0xc')]);router[_0x0242('0x9')](_0x0242('0xd'),auth[_0x0242('0xb')](),controller['show']);router[_0x0242('0x9')]('/voice/queue/countAttributes/:id',auth[_0x0242('0xb')](),controller[_0x0242('0xe')]);router[_0x0242('0x9')](_0x0242('0xf'),auth[_0x0242('0xb')](),controller[_0x0242('0x10')]);router[_0x0242('0x11')](_0x0242('0x12'),auth[_0x0242('0xb')](),controller[_0x0242('0x13')]);router[_0x0242('0x11')](_0x0242('0x14'),auth[_0x0242('0xb')](),controller[_0x0242('0x15')]);router[_0x0242('0x11')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0x0242('0x16')]);router[_0x0242('0x17')](_0x0242('0xd'),auth[_0x0242('0xb')](),controller[_0x0242('0x18')]);module[_0x0242('0x19')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index f20b338..da7af50 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 _0xd798=['BOOLEAN','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd798,0x97));var _0x8d79=function(_0x5287fb,_0x398e56){_0x5287fb=_0x5287fb-0x0;var _0x36ad71=_0xd798[_0x5287fb];return _0x36ad71;};'use strict';var Sequelize=require(_0x8d79('0x0'));module[_0x8d79('0x1')]={'state':{'type':Sequelize[_0x8d79('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x8d79('0x3')]},'scheduledat':{'type':Sequelize[_0x8d79('0x4')]},'countbusyretry':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8d79('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x8d79('0x3')]},'originatecalleridname':{'type':Sequelize[_0x8d79('0x3')]},'calleridnum':{'type':Sequelize[_0x8d79('0x3')]},'calleridname':{'type':Sequelize[_0x8d79('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x8d79('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x8d79('0x4')]},'endtime':{'type':Sequelize[_0x8d79('0x4')]},'ringtime':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8d79('0x3')]},'campaign':{'type':Sequelize[_0x8d79('0x3')]},'campaigntype':{'type':Sequelize[_0x8d79('0x3')]},'membername':{'type':Sequelize[_0x8d79('0x3')]},'reason':{'type':Sequelize[_0x8d79('0x3')]},'amd':{'type':Sequelize[_0x8d79('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x8d79('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x8d79('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8d79('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x8d79('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x8d79('0x4')]},'edited':{'type':Sequelize[_0x8d79('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x8d79('0x3')]}}; \ No newline at end of file +var _0x8da0=['DATE','STRING','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8da0,0x135));var _0x08da=function(_0x2fde0d,_0x562ca3){_0x2fde0d=_0x2fde0d-0x0;var _0x48d470=_0x8da0[_0x2fde0d];return _0x48d470;};'use strict';var Sequelize=require(_0x08da('0x0'));module[_0x08da('0x1')]={'state':{'type':Sequelize[_0x08da('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x08da('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x08da('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x08da('0x4')]},'calleridnum':{'type':Sequelize[_0x08da('0x4')]},'calleridname':{'type':Sequelize[_0x08da('0x4')]},'starttime':{'type':Sequelize[_0x08da('0x3')]},'responsetime':{'type':Sequelize[_0x08da('0x3')]},'answertime':{'type':Sequelize[_0x08da('0x3')]},'droptime':{'type':Sequelize[_0x08da('0x3')]},'endtime':{'type':Sequelize[_0x08da('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x08da('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x08da('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x08da('0x4')]},'campaign':{'type':Sequelize[_0x08da('0x4')]},'campaigntype':{'type':Sequelize[_0x08da('0x4')]},'membername':{'type':Sequelize[_0x08da('0x4')]},'reason':{'type':Sequelize[_0x08da('0x4')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x08da('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x08da('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x08da('0x3')]},'recallme':{'type':Sequelize[_0x08da('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x08da('0x3')]},'edited':{'type':Sequelize[_0x08da('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x08da('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x08da('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index b4b1fd9..3ad941a 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 _0x70d8=['body','describe','update','uniqueid','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','include','create'];(function(_0x58347e,_0x2c6409){var _0x493ca6=function(_0x8b3a4c){while(--_0x8b3a4c){_0x58347e['push'](_0x58347e['shift']());}};_0x493ca6(++_0x2c6409);}(_0x70d8,0x12c));var _0x870d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x70d8[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x870d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x870d('0x1'));var moment=require('moment');var BPromise=require(_0x870d('0x2'));var Mustache=require(_0x870d('0x3'));var util=require(_0x870d('0x4'));var path=require(_0x870d('0x5'));var sox=require('sox');var csv=require(_0x870d('0x6'));var ejs=require(_0x870d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x870d('0x8'));var squel=require(_0x870d('0x9'));var crypto=require(_0x870d('0xa'));var jsforce=require(_0x870d('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x870d('0xc'));var Papa=require(_0x870d('0xd'));var Redis=require(_0x870d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x870d('0xf'));var as=require(_0x870d('0x10'));var hardwareService=require(_0x870d('0x11'));var logger=require(_0x870d('0x12'))(_0x870d('0x13'));var utils=require(_0x870d('0x14'));var config=require(_0x870d('0x15'));var licenseUtil=require(_0x870d('0x16'));var db=require(_0x870d('0x17'))['db'];function respondWithStatusCode(_0x29fec0,_0x1f3995){_0x1f3995=_0x1f3995||0xcc;return function(_0x1dde24){if(_0x1dde24){return _0x29fec0['sendStatus'](_0x1f3995);}return _0x29fec0[_0x870d('0x18')](_0x1f3995)[_0x870d('0x19')]();};}function respondWithResult(_0x44c12c,_0x5eb6b5){_0x5eb6b5=_0x5eb6b5||0xc8;return function(_0x2112b6){if(_0x2112b6){return _0x44c12c['status'](_0x5eb6b5)[_0x870d('0x1a')](_0x2112b6);}};}function respondWithFilteredResult(_0x2b4f1f,_0x42e379){return function(_0x11b089){if(_0x11b089){var _0x13d46e=typeof _0x42e379[_0x870d('0x1b')]===_0x870d('0x1c')&&typeof _0x42e379[_0x870d('0x1d')]==='undefined';var _0x16038b=_0x11b089[_0x870d('0x1e')];var _0x23dc76=_0x13d46e?0x0:_0x42e379[_0x870d('0x1b')];var _0x3d19ee=_0x13d46e?_0x11b089[_0x870d('0x1e')]:_0x42e379[_0x870d('0x1b')]+_0x42e379[_0x870d('0x1d')];var _0x31de01;if(_0x3d19ee>=_0x16038b){_0x3d19ee=_0x16038b;_0x31de01=0xc8;}else{_0x31de01=0xce;}_0x2b4f1f[_0x870d('0x18')](_0x31de01);return _0x2b4f1f['set'](_0x870d('0x1f'),_0x23dc76+'-'+_0x3d19ee+'/'+_0x16038b)[_0x870d('0x1a')](_0x11b089);}return null;};}function patchUpdates(_0x268ba7){return function(_0x654af8){try{jsonpatch[_0x870d('0x20')](_0x654af8,_0x268ba7,!![]);}catch(_0x2dd373){return BPromise[_0x870d('0x21')](_0x2dd373);}return _0x654af8[_0x870d('0x22')]();};}function saveUpdates(_0x22a21f,_0x265282){return function(_0x10240e){if(_0x10240e){return _0x10240e['update'](_0x22a21f)['then'](function(_0x496c82){return _0x496c82;});}return null;};}function removeEntity(_0x5a142f,_0x54c62d){return function(_0x1b7943){if(_0x1b7943){return _0x1b7943[_0x870d('0x23')]()[_0x870d('0x24')](function(){_0x5a142f[_0x870d('0x18')](0xcc)[_0x870d('0x19')]();});}};}function handleEntityNotFound(_0x1dcf57,_0x381fbe){return function(_0x17a37f){if(!_0x17a37f){_0x1dcf57['sendStatus'](0x194);}return _0x17a37f;};}function handleError(_0x42a96a,_0xdbe43e){_0xdbe43e=_0xdbe43e||0x1f4;return function(_0x495bc9){logger[_0x870d('0x25')](_0x495bc9[_0x870d('0x26')]);if(_0x495bc9[_0x870d('0x27')]){delete _0x495bc9[_0x870d('0x27')];}_0x42a96a[_0x870d('0x18')](_0xdbe43e)[_0x870d('0x28')](_0x495bc9);};}exports[_0x870d('0x29')]=function(_0x14168d,_0x5b462a){var _0x48cff2={},_0x483342={},_0x1048ec={'count':0x0,'rows':[]};var _0x4e4c6e=_[_0x870d('0x2a')](db[_0x870d('0x2b')][_0x870d('0x2c')],function(_0x1e925d){return{'name':_0x1e925d[_0x870d('0x2d')],'type':_0x1e925d[_0x870d('0x2e')]['key']};});_0x483342[_0x870d('0x2f')]=_[_0x870d('0x2a')](_0x4e4c6e,_0x870d('0x27'));_0x483342[_0x870d('0x30')]=_[_0x870d('0x31')](_0x14168d[_0x870d('0x30')]);_0x483342[_0x870d('0x32')]=_['intersection'](_0x483342['model'],_0x483342['query']);_0x48cff2[_0x870d('0x33')]=_[_0x870d('0x34')](_0x483342[_0x870d('0x2f')],qs[_0x870d('0x35')](_0x14168d[_0x870d('0x30')]['fields']));_0x48cff2['attributes']=_0x48cff2[_0x870d('0x33')][_0x870d('0x36')]?_0x48cff2[_0x870d('0x33')]:_0x483342[_0x870d('0x2f')];if(!_0x14168d['query']['hasOwnProperty'](_0x870d('0x37'))){_0x48cff2[_0x870d('0x1d')]=qs['limit'](_0x14168d[_0x870d('0x30')][_0x870d('0x1d')]);_0x48cff2[_0x870d('0x1b')]=qs[_0x870d('0x1b')](_0x14168d[_0x870d('0x30')][_0x870d('0x1b')]);}_0x48cff2[_0x870d('0x38')]=qs[_0x870d('0x39')](_0x14168d[_0x870d('0x30')]['sort']);_0x48cff2[_0x870d('0x3a')]=qs['filters'](_[_0x870d('0x3b')](_0x14168d['query'],_0x483342['filters']),_0x4e4c6e);if(_0x14168d[_0x870d('0x30')][_0x870d('0x3c')]){_0x48cff2[_0x870d('0x3a')]=_[_0x870d('0x3d')](_0x48cff2['where'],{'$or':_['map'](_0x4e4c6e,function(_0x18f15a){if(_0x18f15a[_0x870d('0x2e')]!==_0x870d('0x3e')){var _0x428103={};_0x428103[_0x18f15a[_0x870d('0x27')]]={'$like':'%'+_0x14168d[_0x870d('0x30')][_0x870d('0x3c')]+'%'};return _0x428103;}})});}_0x48cff2=_[_0x870d('0x3d')]({},_0x48cff2,_0x14168d[_0x870d('0x3f')]);var _0x26f2f1={'where':_0x48cff2[_0x870d('0x3a')]};return db[_0x870d('0x2b')][_0x870d('0x1e')](_0x26f2f1)[_0x870d('0x24')](function(_0x30f882){_0x1048ec[_0x870d('0x1e')]=_0x30f882;if(_0x14168d[_0x870d('0x30')][_0x870d('0x40')]){_0x48cff2['include']=[{'all':!![]}];}return db[_0x870d('0x2b')][_0x870d('0x41')](_0x48cff2);})[_0x870d('0x24')](function(_0x2fb098){_0x1048ec[_0x870d('0x42')]=_0x2fb098;return _0x1048ec;})['then'](respondWithFilteredResult(_0x5b462a,_0x48cff2))[_0x870d('0x43')](handleError(_0x5b462a,null));};exports['show']=function(_0x1324a3,_0x75fbbc){var _0x3d5944={'raw':!![],'where':{'id':_0x1324a3['params']['id']}},_0x2fe27b={};_0x2fe27b[_0x870d('0x2f')]=_[_0x870d('0x31')](db[_0x870d('0x2b')][_0x870d('0x2c')]);_0x2fe27b[_0x870d('0x30')]=_['keys'](_0x1324a3[_0x870d('0x30')]);_0x2fe27b[_0x870d('0x32')]=_['intersection'](_0x2fe27b['model'],_0x2fe27b[_0x870d('0x30')]);_0x3d5944[_0x870d('0x33')]=_[_0x870d('0x34')](_0x2fe27b[_0x870d('0x2f')],qs[_0x870d('0x35')](_0x1324a3[_0x870d('0x30')][_0x870d('0x35')]));_0x3d5944['attributes']=_0x3d5944[_0x870d('0x33')][_0x870d('0x36')]?_0x3d5944[_0x870d('0x33')]:_0x2fe27b[_0x870d('0x2f')];if(_0x1324a3[_0x870d('0x30')][_0x870d('0x40')]){_0x3d5944[_0x870d('0x44')]=[{'all':!![]}];}_0x3d5944=_['merge']({},_0x3d5944,_0x1324a3[_0x870d('0x3f')]);return db['CmHopperHistory']['find'](_0x3d5944)[_0x870d('0x24')](handleEntityNotFound(_0x75fbbc,null))[_0x870d('0x24')](respondWithResult(_0x75fbbc,null))[_0x870d('0x43')](handleError(_0x75fbbc,null));};exports[_0x870d('0x45')]=function(_0x3f0c07,_0x1afce6){return db['CmHopperHistory'][_0x870d('0x45')](_0x3f0c07[_0x870d('0x46')],{})['then'](respondWithResult(_0x1afce6,0xc9))[_0x870d('0x43')](handleError(_0x1afce6,null));};exports[_0x870d('0x47')]=function(_0x41e067,_0x15fd16){return db[_0x870d('0x2b')][_0x870d('0x47')]()[_0x870d('0x24')](respondWithResult(_0x15fd16,null))[_0x870d('0x43')](handleError(_0x15fd16,null));};exports[_0x870d('0x48')]=function(_0x36109a,_0x4ceb49){if(_0x36109a[_0x870d('0x46')][_0x870d('0x49')]){delete _0x36109a[_0x870d('0x46')]['uniqueid'];}return db[_0x870d('0x2b')]['find']({'where':{'uniqueid':_0x36109a['params']['id']}})[_0x870d('0x24')](handleEntityNotFound(_0x4ceb49,null))[_0x870d('0x24')](saveUpdates(_0x36109a['body'],null))[_0x870d('0x24')](respondWithResult(_0x4ceb49,null))[_0x870d('0x43')](handleError(_0x4ceb49,null));}; \ No newline at end of file +var _0xcaac=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','include','rows','show','params','includeAll','options','catch','create','body','describe','find','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','squel','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','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','keys','query','intersection'];(function(_0x3235ad,_0x32d674){var _0x4d64d4=function(_0x3a62fc){while(--_0x3a62fc){_0x3235ad['push'](_0x3235ad['shift']());}};_0x4d64d4(++_0x32d674);}(_0xcaac,0xae));var _0xccaa=function(_0x410764,_0x12442e){_0x410764=_0x410764-0x0;var _0x145342=_0xcaac[_0x410764];return _0x145342;};'use strict';var emlformat=require(_0xccaa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xccaa('0x1'));var jsonpatch=require(_0xccaa('0x2'));var rp=require(_0xccaa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xccaa('0x4'));var util=require('util');var path=require(_0xccaa('0x5'));var sox=require(_0xccaa('0x6'));var csv=require(_0xccaa('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xccaa('0x8'));var crypto=require('crypto');var jsforce=require(_0xccaa('0x9'));var deskjs=require(_0xccaa('0xa'));var toCsv=require(_0xccaa('0x7'));var querystring=require('querystring');var Papa=require(_0xccaa('0xb'));var Redis=require(_0xccaa('0xc'));var authService=require(_0xccaa('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xccaa('0xe'));var hardwareService=require(_0xccaa('0xf'));var logger=require(_0xccaa('0x10'))(_0xccaa('0x11'));var utils=require(_0xccaa('0x12'));var config=require(_0xccaa('0x13'));var licenseUtil=require(_0xccaa('0x14'));var db=require(_0xccaa('0x15'))['db'];function respondWithStatusCode(_0x8e8ffb,_0x3d5341){_0x3d5341=_0x3d5341||0xcc;return function(_0x3e2171){if(_0x3e2171){return _0x8e8ffb[_0xccaa('0x16')](_0x3d5341);}return _0x8e8ffb[_0xccaa('0x17')](_0x3d5341)[_0xccaa('0x18')]();};}function respondWithResult(_0x58ff45,_0x1b1db4){_0x1b1db4=_0x1b1db4||0xc8;return function(_0x15392d){if(_0x15392d){return _0x58ff45['status'](_0x1b1db4)[_0xccaa('0x19')](_0x15392d);}};}function respondWithFilteredResult(_0x17e62d,_0x3a9292){return function(_0x247faa){if(_0x247faa){var _0x46e6ca=typeof _0x3a9292[_0xccaa('0x1a')]===_0xccaa('0x1b')&&typeof _0x3a9292[_0xccaa('0x1c')]===_0xccaa('0x1b');var _0x2a7bf0=_0x247faa[_0xccaa('0x1d')];var _0x3cfc35=_0x46e6ca?0x0:_0x3a9292[_0xccaa('0x1a')];var _0x1980a6=_0x46e6ca?_0x247faa['count']:_0x3a9292[_0xccaa('0x1a')]+_0x3a9292[_0xccaa('0x1c')];var _0x219a3e;if(_0x1980a6>=_0x2a7bf0){_0x1980a6=_0x2a7bf0;_0x219a3e=0xc8;}else{_0x219a3e=0xce;}_0x17e62d['status'](_0x219a3e);return _0x17e62d['set'](_0xccaa('0x1e'),_0x3cfc35+'-'+_0x1980a6+'/'+_0x2a7bf0)[_0xccaa('0x19')](_0x247faa);}return null;};}function patchUpdates(_0x2165a0){return function(_0x19d27b){try{jsonpatch[_0xccaa('0x1f')](_0x19d27b,_0x2165a0,!![]);}catch(_0x10f400){return BPromise['reject'](_0x10f400);}return _0x19d27b[_0xccaa('0x20')]();};}function saveUpdates(_0xc76944,_0x354ebb){return function(_0x2a0c8a){if(_0x2a0c8a){return _0x2a0c8a[_0xccaa('0x21')](_0xc76944)[_0xccaa('0x22')](function(_0x385802){return _0x385802;});}return null;};}function removeEntity(_0x237c99,_0x44644){return function(_0x2bd1cb){if(_0x2bd1cb){return _0x2bd1cb[_0xccaa('0x23')]()['then'](function(){_0x237c99[_0xccaa('0x17')](0xcc)[_0xccaa('0x18')]();});}};}function handleEntityNotFound(_0x27824b,_0x1be091){return function(_0x586da7){if(!_0x586da7){_0x27824b['sendStatus'](0x194);}return _0x586da7;};}function handleError(_0x172409,_0x9733fd){_0x9733fd=_0x9733fd||0x1f4;return function(_0x16e05e){logger[_0xccaa('0x24')](_0x16e05e[_0xccaa('0x25')]);if(_0x16e05e[_0xccaa('0x26')]){delete _0x16e05e[_0xccaa('0x26')];}_0x172409[_0xccaa('0x17')](_0x9733fd)[_0xccaa('0x27')](_0x16e05e);};}exports[_0xccaa('0x28')]=function(_0x2c0b32,_0x58b03a){var _0x44f019={},_0x6fef3d={},_0x12af35={'count':0x0,'rows':[]};var _0x7ac198=_[_0xccaa('0x29')](db[_0xccaa('0x2a')][_0xccaa('0x2b')],function(_0x4d6764){return{'name':_0x4d6764[_0xccaa('0x2c')],'type':_0x4d6764[_0xccaa('0x2d')][_0xccaa('0x2e')]};});_0x6fef3d[_0xccaa('0x2f')]=_[_0xccaa('0x29')](_0x7ac198,_0xccaa('0x26'));_0x6fef3d['query']=_[_0xccaa('0x30')](_0x2c0b32[_0xccaa('0x31')]);_0x6fef3d['filters']=_[_0xccaa('0x32')](_0x6fef3d[_0xccaa('0x2f')],_0x6fef3d[_0xccaa('0x31')]);_0x44f019[_0xccaa('0x33')]=_['intersection'](_0x6fef3d['model'],qs[_0xccaa('0x34')](_0x2c0b32[_0xccaa('0x31')][_0xccaa('0x34')]));_0x44f019[_0xccaa('0x33')]=_0x44f019[_0xccaa('0x33')][_0xccaa('0x35')]?_0x44f019[_0xccaa('0x33')]:_0x6fef3d['model'];if(!_0x2c0b32[_0xccaa('0x31')][_0xccaa('0x36')](_0xccaa('0x37'))){_0x44f019[_0xccaa('0x1c')]=qs['limit'](_0x2c0b32[_0xccaa('0x31')]['limit']);_0x44f019[_0xccaa('0x1a')]=qs['offset'](_0x2c0b32['query'][_0xccaa('0x1a')]);}_0x44f019[_0xccaa('0x38')]=qs[_0xccaa('0x39')](_0x2c0b32[_0xccaa('0x31')][_0xccaa('0x39')]);_0x44f019['where']=qs[_0xccaa('0x3a')](_[_0xccaa('0x3b')](_0x2c0b32[_0xccaa('0x31')],_0x6fef3d['filters']),_0x7ac198);if(_0x2c0b32['query'][_0xccaa('0x3c')]){_0x44f019['where']=_[_0xccaa('0x3d')](_0x44f019[_0xccaa('0x3e')],{'$or':_[_0xccaa('0x29')](_0x7ac198,function(_0x512830){if(_0x512830[_0xccaa('0x2d')]!==_0xccaa('0x3f')){var _0x5b79fe={};_0x5b79fe[_0x512830[_0xccaa('0x26')]]={'$like':'%'+_0x2c0b32[_0xccaa('0x31')][_0xccaa('0x3c')]+'%'};return _0x5b79fe;}})});}_0x44f019=_['merge']({},_0x44f019,_0x2c0b32['options']);var _0x4331f4={'where':_0x44f019[_0xccaa('0x3e')]};return db[_0xccaa('0x2a')]['count'](_0x4331f4)[_0xccaa('0x22')](function(_0x257473){_0x12af35[_0xccaa('0x1d')]=_0x257473;if(_0x2c0b32[_0xccaa('0x31')]['includeAll']){_0x44f019[_0xccaa('0x40')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x44f019);})['then'](function(_0x1db5db){_0x12af35[_0xccaa('0x41')]=_0x1db5db;return _0x12af35;})[_0xccaa('0x22')](respondWithFilteredResult(_0x58b03a,_0x44f019))['catch'](handleError(_0x58b03a,null));};exports[_0xccaa('0x42')]=function(_0x5c283b,_0x5bc543){var _0xb2f0ea={'raw':!![],'where':{'id':_0x5c283b[_0xccaa('0x43')]['id']}},_0x424a3f={};_0x424a3f[_0xccaa('0x2f')]=_[_0xccaa('0x30')](db[_0xccaa('0x2a')][_0xccaa('0x2b')]);_0x424a3f[_0xccaa('0x31')]=_[_0xccaa('0x30')](_0x5c283b[_0xccaa('0x31')]);_0x424a3f[_0xccaa('0x3a')]=_[_0xccaa('0x32')](_0x424a3f[_0xccaa('0x2f')],_0x424a3f[_0xccaa('0x31')]);_0xb2f0ea[_0xccaa('0x33')]=_[_0xccaa('0x32')](_0x424a3f[_0xccaa('0x2f')],qs[_0xccaa('0x34')](_0x5c283b['query'][_0xccaa('0x34')]));_0xb2f0ea['attributes']=_0xb2f0ea['attributes']['length']?_0xb2f0ea[_0xccaa('0x33')]:_0x424a3f['model'];if(_0x5c283b[_0xccaa('0x31')][_0xccaa('0x44')]){_0xb2f0ea[_0xccaa('0x40')]=[{'all':!![]}];}_0xb2f0ea=_[_0xccaa('0x3d')]({},_0xb2f0ea,_0x5c283b[_0xccaa('0x45')]);return db['CmHopperHistory']['find'](_0xb2f0ea)[_0xccaa('0x22')](handleEntityNotFound(_0x5bc543,null))['then'](respondWithResult(_0x5bc543,null))[_0xccaa('0x46')](handleError(_0x5bc543,null));};exports[_0xccaa('0x47')]=function(_0x537734,_0x2046c1){return db[_0xccaa('0x2a')]['create'](_0x537734[_0xccaa('0x48')],{})[_0xccaa('0x22')](respondWithResult(_0x2046c1,0xc9))[_0xccaa('0x46')](handleError(_0x2046c1,null));};exports[_0xccaa('0x49')]=function(_0x37e137,_0x297d74){return db[_0xccaa('0x2a')][_0xccaa('0x49')]()['then'](respondWithResult(_0x297d74,null))[_0xccaa('0x46')](handleError(_0x297d74,null));};exports[_0xccaa('0x21')]=function(_0xc00dc2,_0xcc43db){if(_0xc00dc2[_0xccaa('0x48')]['uniqueid']){delete _0xc00dc2['body']['uniqueid'];}return db[_0xccaa('0x2a')][_0xccaa('0x4a')]({'where':{'uniqueid':_0xc00dc2[_0xccaa('0x43')]['id']}})[_0xccaa('0x22')](handleEntityNotFound(_0xcc43db,null))['then'](saveUpdates(_0xc00dc2['body'],null))[_0xccaa('0x22')](respondWithResult(_0xcc43db,null))['catch'](handleError(_0xcc43db,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 66b0402..60d150d 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 _0xf417=['../../config/logger','api','bluebird','rimraf','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util'];(function(_0x162ac7,_0x2c3d07){var _0x1f2d14=function(_0x5b5a45){while(--_0x5b5a45){_0x162ac7['push'](_0x162ac7['shift']());}};_0x1f2d14(++_0x2c3d07);}(_0xf417,0x8f));var _0x7f41=function(_0x1a3eb1,_0x5188d5){_0x1a3eb1=_0x1a3eb1-0x0;var _0x29efec=_0xf417[_0x1a3eb1];return _0x29efec;};'use strict';var _=require('lodash');var util=require(_0x7f41('0x0'));var logger=require(_0x7f41('0x1'))(_0x7f41('0x2'));var moment=require('moment');var BPromise=require(_0x7f41('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7f41('0x4'));var config=require('../../config/environment');var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x5ecdb2,_0x1775d8){return _0x5ecdb2['define'](_0x7f41('0x5'),attributes,{'tableName':_0x7f41('0x6'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x7f41('0x7')]},{'name':'uniqueid','fields':[_0x7f41('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5ed9=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash'];(function(_0x5341bb,_0x91e184){var _0x4d043c=function(_0x34891b){while(--_0x34891b){_0x5341bb['push'](_0x5341bb['shift']());}};_0x4d043c(++_0x91e184);}(_0x5ed9,0x1e9));var _0x95ed=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5ed9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x95ed('0x0'));var util=require(_0x95ed('0x1'));var logger=require('../../config/logger')(_0x95ed('0x2'));var moment=require(_0x95ed('0x3'));var BPromise=require(_0x95ed('0x4'));var rp=require(_0x95ed('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95ed('0x6'));var config=require(_0x95ed('0x7'));var attributes=require(_0x95ed('0x8'));module['exports']=function(_0x2c9009,_0x5a5117){return _0x2c9009[_0x95ed('0x9')](_0x95ed('0xa'),attributes,{'tableName':_0x95ed('0xb'),'paranoid':![],'indexes':[{'name':_0x95ed('0xc'),'fields':[_0x95ed('0xc')]},{'name':_0x95ed('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 8140744..051804d 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 _0xd909=['`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','findAll','ivrAnswerCallsDay','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','debug','stringify','where','sequelize','COUNT','col','literal','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null'];(function(_0x539c5c,_0x421f98){var _0x26fcdb=function(_0x146878){while(--_0x146878){_0x539c5c['push'](_0x539c5c['shift']());}};_0x26fcdb(++_0x421f98);}(_0xd909,0x1c1));var _0x9d90=function(_0xaf8043,_0x416e4b){_0xaf8043=_0xaf8043-0x0;var _0x340a1f=_0xd909[_0xaf8043];return _0x340a1f;};'use strict';var _=require('lodash');var util=require(_0x9d90('0x0'));var moment=require(_0x9d90('0x1'));var BPromise=require(_0x9d90('0x2'));var rs=require(_0x9d90('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d90('0x4'))['db'];var utils=require(_0x9d90('0x5'));var logger=require(_0x9d90('0x6'))(_0x9d90('0x7'));var config=require(_0x9d90('0x8'));var jayson=require(_0x9d90('0x9'));var client=jayson[_0x9d90('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10930a,_0x1036d5,_0x36ff88){return new BPromise(function(_0x19d78a,_0x3a815b){return client[_0x9d90('0xb')](_0x10930a,_0x36ff88)[_0x9d90('0xc')](function(_0x115e66){logger[_0x9d90('0xd')](_0x9d90('0xe'),_0x1036d5,_0x9d90('0xf'));logger['debug'](_0x9d90('0x10'),_0x1036d5,_0x9d90('0xf'),JSON['stringify'](_0x115e66));if(_0x115e66[_0x9d90('0x11')]){if(_0x115e66['error']['code']===0x1f4){logger[_0x9d90('0x11')](_0x9d90('0xe'),_0x1036d5,_0x115e66[_0x9d90('0x11')][_0x9d90('0x12')]);return _0x3a815b(_0x115e66[_0x9d90('0x11')]['message']);}logger['error'](_0x9d90('0xe'),_0x1036d5,_0x115e66[_0x9d90('0x11')][_0x9d90('0x12')]);return _0x19d78a(_0x115e66[_0x9d90('0x11')][_0x9d90('0x12')]);}else{logger['info'](_0x9d90('0xe'),_0x1036d5,_0x9d90('0xf'));_0x19d78a(_0x115e66[_0x9d90('0x13')][_0x9d90('0x12')]);}})[_0x9d90('0x14')](function(_0x4007d0){logger[_0x9d90('0x11')](_0x9d90('0xe'),_0x1036d5,_0x4007d0);_0x3a815b(_0x4007d0);});});}exports[_0x9d90('0x15')]=function(_0x6d042f){var _0x1070bf=this;return new Promise(function(_0x64a9d,_0x156430){return db[_0x9d90('0x16')][_0x9d90('0x17')](_0x6d042f[_0x9d90('0x18')],{'raw':_0x6d042f[_0x9d90('0x19')]?_0x6d042f[_0x9d90('0x19')][_0x9d90('0x1a')]===undefined?!![]:![]:!![]})[_0x9d90('0xc')](function(_0x5e5916){logger[_0x9d90('0xd')](_0x9d90('0x15'),_0x6d042f);logger[_0x9d90('0x1b')](_0x9d90('0x15'),_0x6d042f,JSON[_0x9d90('0x1c')](_0x5e5916));_0x64a9d(_0x5e5916);})[_0x9d90('0x14')](function(_0x3c9f49){logger[_0x9d90('0x11')](_0x9d90('0x15'),_0x3c9f49['message'],_0x6d042f);_0x156430(_0x1070bf[_0x9d90('0x11')](0x1f4,_0x3c9f49['message']));});});};exports['AvgHandleTime']=function(_0xea86c){var _0x4bde99=this;return new Promise(function(_0x947c0,_0x245327){return db[_0x9d90('0x16')]['findAll']({'raw':_0xea86c['options']?_0xea86c[_0x9d90('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xea86c[_0x9d90('0x19')]?_0xea86c['options'][_0x9d90('0x1d')]||null:null,'attributes':[[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')][_0x9d90('0x20')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn'](_0x9d90('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0x9d90('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x9d90('0x22')],[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')]['literal']('`state`\x20=\x2010,\x201,\x20null'))),_0x9d90('0x23')],[db['sequelize']['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')]['literal'](_0x9d90('0x24')))),_0x9d90('0x25')],[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x26'),db[_0x9d90('0x1e')]['fn']('IF',db['sequelize'][_0x9d90('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x9d90('0x27')],[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x26'),db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')][_0x9d90('0x21')](_0x9d90('0x28')))),_0x9d90('0x29')]]})[_0x9d90('0xc')](function(_0x2f4e5c){logger[_0x9d90('0xd')](_0x9d90('0x2a'),_0xea86c);logger[_0x9d90('0x1b')](_0x9d90('0x2a'),_0xea86c,JSON[_0x9d90('0x1c')](_0x2f4e5c));_0x947c0(_0x2f4e5c);})[_0x9d90('0x14')](function(_0x15a2c8){logger[_0x9d90('0x11')]('AvgHandleTime',_0x15a2c8['message'],_0xea86c);_0x245327(_0x4bde99[_0x9d90('0x11')](0x1f4,_0x15a2c8['message']));});});};exports[_0x9d90('0x2b')]=function(_0x101e4c){var _0x4f8f02=this;return new Promise(function(_0x11ea7c,_0x399bc9){return db[_0x9d90('0x16')]['findAll']({'raw':_0x101e4c[_0x9d90('0x19')]?_0x101e4c[_0x9d90('0x19')][_0x9d90('0x1a')]===undefined?!![]:![]:!![],'where':_0x101e4c[_0x9d90('0x19')]?_0x101e4c['options'][_0x9d90('0x1d')]||null:null,'attributes':[[_0x9d90('0x2c'),_0x9d90('0x2d')],[db['sequelize']['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x9d90('0x2e')],[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')]['literal'](_0x9d90('0x2f')))),'outboundNoAnswerCallsDay'],[db[_0x9d90('0x1e')]['fn']('COUNT',db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')][_0x9d90('0x21')](_0x9d90('0x30')))),_0x9d90('0x31')],[db[_0x9d90('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x9d90('0x1e')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x9d90('0x32')],[db['sequelize']['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')][_0x9d90('0x21')](_0x9d90('0x33')))),_0x9d90('0x34')],[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x9d90('0x35')))),_0x9d90('0x36')],[db[_0x9d90('0x1e')]['fn']('COUNT',db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')][_0x9d90('0x21')](_0x9d90('0x37')))),_0x9d90('0x38')],[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x1f'),db['sequelize']['fn']('IF',db[_0x9d90('0x1e')]['literal'](_0x9d90('0x39')))),_0x9d90('0x3a')],[db['sequelize']['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')][_0x9d90('0x21')](_0x9d90('0x3b')))),_0x9d90('0x3c')],[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')]['literal'](_0x9d90('0x3d')))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x9d90('0x1e')]['fn']('IF',db['sequelize'][_0x9d90('0x21')](_0x9d90('0x3e')))),'outboundRejectCallsDay'],[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x1f'),db['sequelize']['fn']('IF',db[_0x9d90('0x1e')]['literal'](_0x9d90('0x3f')))),_0x9d90('0x40')],[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')][_0x9d90('0x21')]('`state`\x20=\x2020,\x201,\x20null'))),_0x9d90('0x41')],[db['sequelize']['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')]['fn']('IF',db['sequelize'][_0x9d90('0x21')](_0x9d90('0x42')))),_0x9d90('0x43')]],'group':[_0x9d90('0x2c')]})['then'](function(_0x38589d){logger[_0x9d90('0xd')](_0x9d90('0x2b'),_0x101e4c);logger['debug'](_0x9d90('0x2b'),_0x101e4c,JSON[_0x9d90('0x1c')](_0x38589d));_0x11ea7c(_0x38589d);})[_0x9d90('0x14')](function(_0x3dd6b1){logger[_0x9d90('0x11')](_0x9d90('0x2b'),_0x3dd6b1[_0x9d90('0x12')],_0x101e4c);_0x399bc9(_0x4f8f02[_0x9d90('0x11')](0x1f4,_0x3dd6b1[_0x9d90('0x12')]));});});};exports[_0x9d90('0x44')]=function(_0x24d759){var _0x3f060d=this;return new Promise(function(_0x2e5e07,_0x5a1779){return db[_0x9d90('0x16')][_0x9d90('0x45')]({'raw':_0x24d759[_0x9d90('0x19')]?_0x24d759[_0x9d90('0x19')][_0x9d90('0x1a')]===undefined?!![]:![]:!![],'where':_0x24d759[_0x9d90('0x19')]?_0x24d759[_0x9d90('0x19')]['where']||null:null,'attributes':[[_0x9d90('0x2c'),'name'],[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')][_0x9d90('0x20')]('id')),'ivrTotalCallsDays'],[db[_0x9d90('0x1e')]['fn']('COUNT',db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')][_0x9d90('0x21')](_0x9d90('0x30')))),_0x9d90('0x46')]],'group':[_0x9d90('0x2c')]})[_0x9d90('0xc')](function(_0x20171c){logger['info'](_0x9d90('0x44'),_0x24d759);logger['debug'](_0x9d90('0x44'),_0x24d759,JSON[_0x9d90('0x1c')](_0x20171c));_0x2e5e07(_0x20171c);})[_0x9d90('0x14')](function(_0x25c224){logger[_0x9d90('0x11')]('GetCampaignHopperHistory',_0x25c224[_0x9d90('0x12')],_0x24d759);_0x5a1779(_0x3f060d[_0x9d90('0x11')](0x1f4,_0x25c224[_0x9d90('0x12')]));});});}; \ No newline at end of file +var _0x79d3=['outboundReCallsDay','GetVoiceQueueHopperHistory','name','col','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','then','AvgHandleTime','where','sequelize','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','findAll','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'];(function(_0x2f13cb,_0x475f96){var _0x571b65=function(_0xb65af3){while(--_0xb65af3){_0x2f13cb['push'](_0x2f13cb['shift']());}};_0x571b65(++_0x475f96);}(_0x79d3,0x179));var _0x379d=function(_0x1320fe,_0x5dae3a){_0x1320fe=_0x1320fe-0x0;var _0xe9340a=_0x79d3[_0x1320fe];return _0xe9340a;};'use strict';var _=require(_0x379d('0x0'));var util=require(_0x379d('0x1'));var moment=require(_0x379d('0x2'));var BPromise=require(_0x379d('0x3'));var rs=require(_0x379d('0x4'));var fs=require('fs');var Redis=require(_0x379d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x379d('0x6'));var logger=require(_0x379d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x379d('0x8'));var client=jayson[_0x379d('0x9')][_0x379d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x214194,_0x2bf985,_0x4f32c7){return new BPromise(function(_0x226765,_0x1fb281){return client[_0x379d('0xb')](_0x214194,_0x4f32c7)['then'](function(_0x59c547){logger[_0x379d('0xc')](_0x379d('0xd'),_0x2bf985,'request\x20sent');logger[_0x379d('0xe')](_0x379d('0xf'),_0x2bf985,_0x379d('0x10'),JSON[_0x379d('0x11')](_0x59c547));if(_0x59c547['error']){if(_0x59c547[_0x379d('0x12')][_0x379d('0x13')]===0x1f4){logger['error'](_0x379d('0xd'),_0x2bf985,_0x59c547[_0x379d('0x12')]['message']);return _0x1fb281(_0x59c547['error'][_0x379d('0x14')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x2bf985,_0x59c547[_0x379d('0x12')]['message']);return _0x226765(_0x59c547[_0x379d('0x12')]['message']);}else{logger[_0x379d('0xc')](_0x379d('0xd'),_0x2bf985,_0x379d('0x10'));_0x226765(_0x59c547[_0x379d('0x15')][_0x379d('0x14')]);}})[_0x379d('0x16')](function(_0x18f0fb){logger[_0x379d('0x12')](_0x379d('0xd'),_0x2bf985,_0x18f0fb);_0x1fb281(_0x18f0fb);});});}exports[_0x379d('0x17')]=function(_0x58653d){var _0x4c2add=this;return new Promise(function(_0x37f319,_0xf18983){return db[_0x379d('0x18')][_0x379d('0x19')](_0x58653d[_0x379d('0x1a')],{'raw':_0x58653d[_0x379d('0x1b')]?_0x58653d['options'][_0x379d('0x1c')]===undefined?!![]:![]:!![]})[_0x379d('0x1d')](function(_0x34f791){logger[_0x379d('0xc')](_0x379d('0x17'),_0x58653d);logger[_0x379d('0xe')](_0x379d('0x17'),_0x58653d,JSON[_0x379d('0x11')](_0x34f791));_0x37f319(_0x34f791);})[_0x379d('0x16')](function(_0x139d23){logger[_0x379d('0x12')](_0x379d('0x17'),_0x139d23[_0x379d('0x14')],_0x58653d);_0xf18983(_0x4c2add[_0x379d('0x12')](0x1f4,_0x139d23[_0x379d('0x14')]));});});};exports[_0x379d('0x1e')]=function(_0x26e2b3){var _0x1471c8=this;return new Promise(function(_0x15c29c,_0x4a082b){return db[_0x379d('0x18')]['findAll']({'raw':_0x26e2b3[_0x379d('0x1b')]?_0x26e2b3[_0x379d('0x1b')][_0x379d('0x1c')]===undefined?!![]:![]:!![],'where':_0x26e2b3[_0x379d('0x1b')]?_0x26e2b3[_0x379d('0x1b')][_0x379d('0x1f')]||null:null,'attributes':[[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x23')))),_0x379d('0x24')],[db[_0x379d('0x20')]['fn']('COUNT',db[_0x379d('0x20')]['fn']('IF',db['sequelize'][_0x379d('0x22')](_0x379d('0x25')))),_0x379d('0x26')],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['fn']('IF',db['sequelize'][_0x379d('0x22')](_0x379d('0x27')))),_0x379d('0x28')],[db[_0x379d('0x20')]['fn'](_0x379d('0x29'),db['sequelize']['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x2a')))),'predictiveIntervalAvgHoldtime'],[db[_0x379d('0x20')]['fn'](_0x379d('0x29'),db['sequelize']['fn']('IF',db['sequelize'][_0x379d('0x22')](_0x379d('0x2b')))),_0x379d('0x2c')]]})[_0x379d('0x1d')](function(_0xd6bb2d){logger['info'](_0x379d('0x1e'),_0x26e2b3);logger['debug'](_0x379d('0x1e'),_0x26e2b3,JSON[_0x379d('0x11')](_0xd6bb2d));_0x15c29c(_0xd6bb2d);})[_0x379d('0x16')](function(_0x4cc85a){logger['error'](_0x379d('0x1e'),_0x4cc85a[_0x379d('0x14')],_0x26e2b3);_0x4a082b(_0x1471c8['error'](0x1f4,_0x4cc85a[_0x379d('0x14')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x4f44d7){var _0x5455e3=this;return new Promise(function(_0x408740,_0x459dce){return db[_0x379d('0x18')][_0x379d('0x2d')]({'raw':_0x4f44d7[_0x379d('0x1b')]?_0x4f44d7[_0x379d('0x1b')][_0x379d('0x1c')]===undefined?!![]:![]:!![],'where':_0x4f44d7[_0x379d('0x1b')]?_0x4f44d7['options'][_0x379d('0x1f')]||null:null,'attributes':[[_0x379d('0x2e'),'name'],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['fn']('IF',db['sequelize'][_0x379d('0x22')](_0x379d('0x2f')))),_0x379d('0x30')],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')]['literal'](_0x379d('0x31')))),_0x379d('0x32')],[db['sequelize']['fn'](_0x379d('0x21'),db['sequelize']['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x23')))),_0x379d('0x33')],[db[_0x379d('0x20')]['fn']('COUNT',db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x34')))),_0x379d('0x35')],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db['sequelize']['fn']('IF',db[_0x379d('0x20')]['literal']('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0x379d('0x20')]['fn']('COUNT',db[_0x379d('0x20')]['fn']('IF',db['sequelize'][_0x379d('0x22')](_0x379d('0x36')))),'outboundDropCallsDayTimeout'],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['fn']('IF',db['sequelize'][_0x379d('0x22')](_0x379d('0x37')))),_0x379d('0x38')],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x39')))),_0x379d('0x3a')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x379d('0x22')](_0x379d('0x3b')))),_0x379d('0x3c')],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db['sequelize']['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x3d')))),_0x379d('0x3e')],[db[_0x379d('0x20')]['fn']('COUNT',db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x3f')))),'outboundRejectCallsDay'],[db[_0x379d('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x40')))),'outboundAnswerAgiCallsDay'],[db[_0x379d('0x20')]['fn']('COUNT',db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')]('`state`\x20=\x2020,\x201,\x20null'))),_0x379d('0x41')],[db[_0x379d('0x20')]['fn']('COUNT',db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x42')))),_0x379d('0x43')]],'group':['campaign']})[_0x379d('0x1d')](function(_0x4fb8fe){logger['info'](_0x379d('0x44'),_0x4f44d7);logger[_0x379d('0xe')](_0x379d('0x44'),_0x4f44d7,JSON[_0x379d('0x11')](_0x4fb8fe));_0x408740(_0x4fb8fe);})['catch'](function(_0x58da4e){logger[_0x379d('0x12')](_0x379d('0x44'),_0x58da4e[_0x379d('0x14')],_0x4f44d7);_0x459dce(_0x5455e3[_0x379d('0x12')](0x1f4,_0x58da4e[_0x379d('0x14')]));});});};exports['GetCampaignHopperHistory']=function(_0x1fdb72){var _0x11a6c8=this;return new Promise(function(_0x2d07f1,_0x2120e1){return db['CmHopperHistory']['findAll']({'raw':_0x1fdb72['options']?_0x1fdb72[_0x379d('0x1b')][_0x379d('0x1c')]===undefined?!![]:![]:!![],'where':_0x1fdb72[_0x379d('0x1b')]?_0x1fdb72[_0x379d('0x1b')][_0x379d('0x1f')]||null:null,'attributes':[[_0x379d('0x2e'),_0x379d('0x45')],[db['sequelize']['fn'](_0x379d('0x21'),db[_0x379d('0x20')][_0x379d('0x46')]('id')),_0x379d('0x47')],[db[_0x379d('0x20')]['fn'](_0x379d('0x21'),db[_0x379d('0x20')]['fn']('IF',db[_0x379d('0x20')][_0x379d('0x22')](_0x379d('0x23')))),_0x379d('0x48')]],'group':['campaign']})[_0x379d('0x1d')](function(_0x5bef33){logger[_0x379d('0xc')]('GetCampaignHopperHistory',_0x1fdb72);logger['debug'](_0x379d('0x49'),_0x1fdb72,JSON['stringify'](_0x5bef33));_0x2d07f1(_0x5bef33);})['catch'](function(_0x57587a){logger[_0x379d('0x12')](_0x379d('0x49'),_0x57587a['message'],_0x1fdb72);_0x2120e1(_0x11a6c8[_0x379d('0x12')](0x1f4,_0x57587a[_0x379d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 7f296c5..4b2b75e 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 _0xa40d=['../../components/auth/service','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','exports','util','path','connect-timeout','express','Router'];(function(_0x5b5781,_0x1f8aae){var _0x21f9be=function(_0x3fed7d){while(--_0x3fed7d){_0x5b5781['push'](_0x5b5781['shift']());}};_0x21f9be(++_0x1f8aae);}(_0xa40d,0x79));var _0xda40=function(_0x23a766,_0x2eab2c){_0x23a766=_0x23a766-0x0;var _0x439cd4=_0xa40d[_0x23a766];return _0x439cd4;};'use strict';var multer=require('multer');var util=require(_0xda40('0x0'));var path=require(_0xda40('0x1'));var timeout=require(_0xda40('0x2'));var express=require(_0xda40('0x3'));var router=express[_0xda40('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xda40('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xda40('0x6'));router[_0xda40('0x7')]('/',auth[_0xda40('0x8')](),controller[_0xda40('0x9')]);router[_0xda40('0x7')](_0xda40('0xa'),auth[_0xda40('0x8')](),controller['describe']);router[_0xda40('0x7')](_0xda40('0xb'),auth['isAuthenticated'](),controller[_0xda40('0xc')]);router[_0xda40('0xd')]('/',auth[_0xda40('0x8')](),controller[_0xda40('0xe')]);router[_0xda40('0xf')](_0xda40('0xb'),auth[_0xda40('0x8')](),controller[_0xda40('0x10')]);module[_0xda40('0x11')]=router; \ No newline at end of file +var _0x5930=['Router','fs-extra','../../config/environment','./cmHopperHistory.controller','index','get','/describe','isAuthenticated','describe','show','/:id','update','exports','multer','util','connect-timeout','express'];(function(_0xe0d11,_0x5aae5d){var _0x1210bb=function(_0x58662f){while(--_0x58662f){_0xe0d11['push'](_0xe0d11['shift']());}};_0x1210bb(++_0x5aae5d);}(_0x5930,0x12e));var _0x0593=function(_0x261750,_0x5d0d44){_0x261750=_0x261750-0x0;var _0x12a0a3=_0x5930[_0x261750];return _0x12a0a3;};'use strict';var multer=require(_0x0593('0x0'));var util=require(_0x0593('0x1'));var path=require('path');var timeout=require(_0x0593('0x2'));var express=require(_0x0593('0x3'));var router=express[_0x0593('0x4')]();var fs_extra=require(_0x0593('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0593('0x6'));var controller=require(_0x0593('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x0593('0x8')]);router[_0x0593('0x9')](_0x0593('0xa'),auth[_0x0593('0xb')](),controller[_0x0593('0xc')]);router[_0x0593('0x9')]('/:id',auth[_0x0593('0xb')](),controller[_0x0593('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x0593('0xe'),auth[_0x0593('0xb')](),controller[_0x0593('0xf')]);module[_0x0593('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index b3e3399..935c7a5 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 _0xab3f=['sequelize','STRING','name'];(function(_0x37ffea,_0x25b006){var _0x2e2615=function(_0x5e6c74){while(--_0x5e6c74){_0x37ffea['push'](_0x37ffea['shift']());}};_0x2e2615(++_0x25b006);}(_0xab3f,0x72));var _0xfab3=function(_0x5991d7,_0x3ca7f8){_0x5991d7=_0x5991d7-0x0;var _0x5b299d=_0xab3f[_0x5991d7];return _0x5b299d;};'use strict';var Sequelize=require(_0xfab3('0x0'));module['exports']={'name':{'type':Sequelize[_0xfab3('0x1')],'unique':_0xfab3('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfab3('0x1')]},'dialPrefix':{'type':Sequelize[_0xfab3('0x1')]}}; \ No newline at end of file +var _0xb26e=['STRING','sequelize'];(function(_0x1853e5,_0x2193d4){var _0x26baad=function(_0x5405c5){while(--_0x5405c5){_0x1853e5['push'](_0x1853e5['shift']());}};_0x26baad(++_0x2193d4);}(_0xb26e,0x11d));var _0xeb26=function(_0x2f4345,_0x14c406){_0x2f4345=_0x2f4345-0x0;var _0x59f2e4=_0xb26e[_0x2f4345];return _0x59f2e4;};'use strict';var Sequelize=require(_0xeb26('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xeb26('0x1')]},'dialPrefix':{'type':Sequelize[_0xeb26('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index f8c008d..54cf803 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 _0xbc1b=['moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','update','then','destroy','get','Lists','UserProfileResource','error','stack','name','index','map','rawAttributes','key','query','keys','filters','intersection','attributes','model','fields','length','order','sort','where','pick','filter','merge','type','CmList','count','include','findAll','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','describe','ListId','Disposition','findOne','hasOwnProperty','nolimit','includeAll','rows','ids','addContacts','CmContact','tags','isArray','join','each','success','dataValues','push','Malformed\x20request\x20syntax','getContacts','concat','format','cf_%d','raw','ContactItemType','OrderBy','CmCustomField','alias','select','from','cm_contacts','c.ListId\x20=\x20?','distinct','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','addCustomField','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','omit','emit','removeAgents','userCmList:remove','User','getAgents','spread','message','eml-format','rimraf','zip-dir'];(function(_0x3c1953,_0x5670c6){var _0x51f45d=function(_0x3a1d41){while(--_0x3a1d41){_0x3c1953['push'](_0x3c1953['shift']());}};_0x51f45d(++_0x5670c6);}(_0xbc1b,0x13b));var _0xbbc1=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0xbc1b[_0x49d41c];return _0xb64c5f;};'use strict';var emlformat=require(_0xbbc1('0x0'));var rimraf=require(_0xbbc1('0x1'));var zipdir=require(_0xbbc1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbbc1('0x3'));var BPromise=require(_0xbbc1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbbc1('0x5'));var sox=require(_0xbbc1('0x6'));var csv=require(_0xbbc1('0x7'));var ejs=require(_0xbbc1('0x8'));var fs=require('fs');var fs_extra=require(_0xbbc1('0x9'));var _=require(_0xbbc1('0xa'));var squel=require('squel');var crypto=require(_0xbbc1('0xb'));var jsforce=require(_0xbbc1('0xc'));var deskjs=require(_0xbbc1('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbbc1('0xe'));var Papa=require('papaparse');var Redis=require(_0xbbc1('0xf'));var authService=require(_0xbbc1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbbc1('0x11'));var hardwareService=require(_0xbbc1('0x12'));var logger=require(_0xbbc1('0x13'))(_0xbbc1('0x14'));var utils=require('../../config/utils');var config=require(_0xbbc1('0x15'));var licenseUtil=require(_0xbbc1('0x16'));var db=require('../../mysqldb')['db'];var csv_results;config[_0xbbc1('0x17')]=_[_0xbbc1('0x18')](config[_0xbbc1('0x17')],{'host':_0xbbc1('0x19'),'port':0x18eb});var socket=require(_0xbbc1('0x1a'))(new Redis(config['redis']));require(_0xbbc1('0x1b'))[_0xbbc1('0x1c')](socket);function respondWithStatusCode(_0x1f294d,_0xb3dc1d){_0xb3dc1d=_0xb3dc1d||0xcc;return function(_0x55fe82){if(_0x55fe82){return _0x1f294d[_0xbbc1('0x1d')](_0xb3dc1d);}return _0x1f294d['status'](_0xb3dc1d)[_0xbbc1('0x1e')]();};}function respondWithResult(_0x5aa68f,_0x46a91a){_0x46a91a=_0x46a91a||0xc8;return function(_0x2f1380){if(_0x2f1380){return _0x5aa68f[_0xbbc1('0x1f')](_0x46a91a)[_0xbbc1('0x20')](_0x2f1380);}};}function respondWithFilteredResult(_0x48db53,_0x5b3520){return function(_0x4e1ed0){if(_0x4e1ed0){var _0x19a665=typeof _0x5b3520[_0xbbc1('0x21')]===_0xbbc1('0x22')&&typeof _0x5b3520[_0xbbc1('0x23')]===_0xbbc1('0x22');var _0x4f3ab3=_0x4e1ed0['count'];var _0x5b7bd0=_0x19a665?0x0:_0x5b3520[_0xbbc1('0x21')];var _0x49072d=_0x19a665?_0x4e1ed0['count']:_0x5b3520[_0xbbc1('0x21')]+_0x5b3520['limit'];var _0x5ce865;if(_0x49072d>=_0x4f3ab3){_0x49072d=_0x4f3ab3;_0x5ce865=0xc8;}else{_0x5ce865=0xce;}_0x48db53[_0xbbc1('0x1f')](_0x5ce865);return _0x48db53[_0xbbc1('0x24')](_0xbbc1('0x25'),_0x5b7bd0+'-'+_0x49072d+'/'+_0x4f3ab3)['json'](_0x4e1ed0);}return null;};}function patchUpdates(_0x5c205c){return function(_0x144181){try{jsonpatch[_0xbbc1('0x26')](_0x144181,_0x5c205c,!![]);}catch(_0x565330){return BPromise['reject'](_0x565330);}return _0x144181['save']();};}function saveUpdates(_0x26ee3a,_0x2a01b2){return function(_0xa6aa97){if(_0xa6aa97){return _0xa6aa97[_0xbbc1('0x27')](_0x26ee3a)[_0xbbc1('0x28')](function(_0x16b71e){return _0x16b71e;});}return null;};}function removeEntity(_0x15f517,_0x152ab8){return function(_0x87541c){if(_0x87541c){return _0x87541c[_0xbbc1('0x29')]()['then'](function(){var _0x3ff561=_0x87541c[_0xbbc1('0x2a')]({'plain':!![]});var _0x39b8a6=_0xbbc1('0x2b');return db[_0xbbc1('0x2c')][_0xbbc1('0x29')]({'where':{'type':_0x39b8a6,'resourceId':_0x3ff561['id']}})[_0xbbc1('0x28')](function(){return _0x87541c;});})['then'](function(){_0x15f517['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x142866,_0x3174f0){return function(_0x12ef82){if(!_0x12ef82){_0x142866['sendStatus'](0x194);}return _0x12ef82;};}function handleError(_0x5c9609,_0x3db7de){_0x3db7de=_0x3db7de||0x1f4;return function(_0x46c7a2){logger[_0xbbc1('0x2d')](_0x46c7a2[_0xbbc1('0x2e')]);if(_0x46c7a2[_0xbbc1('0x2f')]){delete _0x46c7a2[_0xbbc1('0x2f')];}_0x5c9609[_0xbbc1('0x1f')](_0x3db7de)['send'](_0x46c7a2);};}exports[_0xbbc1('0x30')]=function(_0x52350d,_0x41b107){var _0x37d8ee={},_0x336e50={},_0x27589f={'count':0x0,'rows':[]};var _0xaa4f0c=_[_0xbbc1('0x31')](db['CmList'][_0xbbc1('0x32')],function(_0x24e9ac){return{'name':_0x24e9ac['fieldName'],'type':_0x24e9ac['type'][_0xbbc1('0x33')]};});_0x336e50['model']=_[_0xbbc1('0x31')](_0xaa4f0c,_0xbbc1('0x2f'));_0x336e50[_0xbbc1('0x34')]=_[_0xbbc1('0x35')](_0x52350d[_0xbbc1('0x34')]);_0x336e50[_0xbbc1('0x36')]=_[_0xbbc1('0x37')](_0x336e50['model'],_0x336e50[_0xbbc1('0x34')]);_0x37d8ee[_0xbbc1('0x38')]=_[_0xbbc1('0x37')](_0x336e50[_0xbbc1('0x39')],qs['fields'](_0x52350d['query'][_0xbbc1('0x3a')]));_0x37d8ee[_0xbbc1('0x38')]=_0x37d8ee['attributes'][_0xbbc1('0x3b')]?_0x37d8ee[_0xbbc1('0x38')]:_0x336e50['model'];if(!_0x52350d[_0xbbc1('0x34')]['hasOwnProperty']('nolimit')){_0x37d8ee['limit']=qs[_0xbbc1('0x23')](_0x52350d['query'][_0xbbc1('0x23')]);_0x37d8ee[_0xbbc1('0x21')]=qs[_0xbbc1('0x21')](_0x52350d[_0xbbc1('0x34')][_0xbbc1('0x21')]);}_0x37d8ee[_0xbbc1('0x3c')]=qs[_0xbbc1('0x3d')](_0x52350d[_0xbbc1('0x34')][_0xbbc1('0x3d')]);_0x37d8ee[_0xbbc1('0x3e')]=qs[_0xbbc1('0x36')](_[_0xbbc1('0x3f')](_0x52350d[_0xbbc1('0x34')],_0x336e50[_0xbbc1('0x36')]),_0xaa4f0c);if(_0x52350d[_0xbbc1('0x34')][_0xbbc1('0x40')]){_0x37d8ee['where']=_[_0xbbc1('0x41')](_0x37d8ee[_0xbbc1('0x3e')],{'$or':_[_0xbbc1('0x31')](_0xaa4f0c,function(_0x1b9a47){if(_0x1b9a47[_0xbbc1('0x42')]!=='VIRTUAL'){var _0x1e01c0={};_0x1e01c0[_0x1b9a47[_0xbbc1('0x2f')]]={'$like':'%'+_0x52350d['query'][_0xbbc1('0x40')]+'%'};return _0x1e01c0;}})});}_0x37d8ee=_[_0xbbc1('0x41')]({},_0x37d8ee,_0x52350d['options']);var _0x596c45={'where':_0x37d8ee[_0xbbc1('0x3e')]};return db[_0xbbc1('0x43')][_0xbbc1('0x44')](_0x596c45)[_0xbbc1('0x28')](function(_0x38f326){_0x27589f[_0xbbc1('0x44')]=_0x38f326;if(_0x52350d[_0xbbc1('0x34')]['includeAll']){_0x37d8ee[_0xbbc1('0x45')]=[{'all':!![]}];}return db[_0xbbc1('0x43')][_0xbbc1('0x46')](_0x37d8ee);})['then'](function(_0x56e6b1){_0x27589f['rows']=_0x56e6b1;return _0x27589f;})[_0xbbc1('0x28')](respondWithFilteredResult(_0x41b107,_0x37d8ee))[_0xbbc1('0x47')](handleError(_0x41b107,null));};exports[_0xbbc1('0x48')]=function(_0x1358a8,_0x3bccb6){var _0x39921a={'raw':![],'where':{'id':_0x1358a8[_0xbbc1('0x49')]['id']}},_0x4dd9b1={};_0x4dd9b1[_0xbbc1('0x39')]=_[_0xbbc1('0x35')](db[_0xbbc1('0x43')][_0xbbc1('0x32')]);_0x4dd9b1[_0xbbc1('0x34')]=_[_0xbbc1('0x35')](_0x1358a8[_0xbbc1('0x34')]);_0x4dd9b1[_0xbbc1('0x36')]=_['intersection'](_0x4dd9b1['model'],_0x4dd9b1[_0xbbc1('0x34')]);_0x39921a[_0xbbc1('0x38')]=_[_0xbbc1('0x37')](_0x4dd9b1['model'],qs[_0xbbc1('0x3a')](_0x1358a8['query'][_0xbbc1('0x3a')]));_0x39921a['attributes']=_0x39921a[_0xbbc1('0x38')][_0xbbc1('0x3b')]?_0x39921a[_0xbbc1('0x38')]:_0x4dd9b1['model'];if(_0x1358a8[_0xbbc1('0x34')]['includeAll']){_0x39921a['include']=[{'all':!![]}];}_0x39921a=_[_0xbbc1('0x41')]({},_0x39921a,_0x1358a8[_0xbbc1('0x4a')]);return db[_0xbbc1('0x43')][_0xbbc1('0x4b')](_0x39921a)[_0xbbc1('0x28')](handleEntityNotFound(_0x3bccb6,null))[_0xbbc1('0x28')](respondWithResult(_0x3bccb6,null))[_0xbbc1('0x47')](handleError(_0x3bccb6,null));};exports['create']=function(_0x36f84f,_0x8a828b){return db[_0xbbc1('0x43')][_0xbbc1('0x4c')](_0x36f84f[_0xbbc1('0x4d')],{})[_0xbbc1('0x28')](function(_0x51a51f){var _0x5d5ff4=_0x36f84f[_0xbbc1('0x4e')][_0xbbc1('0x2a')]({'plain':!![]});if(!_0x5d5ff4)throw new Error(_0xbbc1('0x4f'));if(_0x5d5ff4['role']===_0xbbc1('0x4e')){var _0x32069e=_0x51a51f[_0xbbc1('0x2a')]({'plain':!![]});var _0x354cab='Lists';return db[_0xbbc1('0x50')]['find']({'where':{'name':_0x354cab,'userProfileId':_0x5d5ff4[_0xbbc1('0x51')]},'raw':!![]})['then'](function(_0xaa78e0){if(_0xaa78e0&&_0xaa78e0['autoAssociation']===0x0){return db[_0xbbc1('0x2c')][_0xbbc1('0x4c')]({'name':_0x32069e[_0xbbc1('0x2f')],'resourceId':_0x32069e['id'],'type':_0xaa78e0[_0xbbc1('0x2f')],'sectionId':_0xaa78e0['id']},{})[_0xbbc1('0x28')](function(){return _0x51a51f;});}else{return _0x51a51f;}})[_0xbbc1('0x47')](function(_0x2d13a5){logger[_0xbbc1('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d13a5);throw _0x2d13a5;});}return _0x51a51f;})[_0xbbc1('0x28')](respondWithResult(_0x8a828b,0xc9))[_0xbbc1('0x47')](handleError(_0x8a828b,null));};exports[_0xbbc1('0x27')]=function(_0x3ee747,_0x10e745){if(_0x3ee747[_0xbbc1('0x4d')]['id']){delete _0x3ee747[_0xbbc1('0x4d')]['id'];}return db['CmList'][_0xbbc1('0x4b')]({'where':{'id':_0x3ee747[_0xbbc1('0x49')]['id']}})[_0xbbc1('0x28')](handleEntityNotFound(_0x10e745,null))[_0xbbc1('0x28')](saveUpdates(_0x3ee747[_0xbbc1('0x4d')],null))[_0xbbc1('0x28')](respondWithResult(_0x10e745,null))[_0xbbc1('0x47')](handleError(_0x10e745,null));};exports[_0xbbc1('0x29')]=function(_0xc4d7ec,_0x94a2e5){return db[_0xbbc1('0x43')][_0xbbc1('0x4b')]({'where':{'id':_0xc4d7ec[_0xbbc1('0x49')]['id']}})[_0xbbc1('0x28')](handleEntityNotFound(_0x94a2e5,null))[_0xbbc1('0x28')](removeEntity(_0x94a2e5,null))['catch'](handleError(_0x94a2e5,null));};exports[_0xbbc1('0x52')]=function(_0x274309,_0x31eeae){return db[_0xbbc1('0x43')]['describe']()[_0xbbc1('0x28')](respondWithResult(_0x31eeae,null))[_0xbbc1('0x47')](handleError(_0x31eeae,null));};exports['addDisposition']=function(_0x2b6f92,_0x49c05c,_0x500e5b){if(_0x2b6f92[_0xbbc1('0x4d')]['id']){delete _0x2b6f92['body']['id'];}return db[_0xbbc1('0x43')][_0xbbc1('0x4b')]({'where':{'id':_0x2b6f92[_0xbbc1('0x49')]['id']}})[_0xbbc1('0x28')](handleEntityNotFound(_0x49c05c,null))[_0xbbc1('0x28')](function(_0x1195af){if(_0x1195af){_0x2b6f92['body'][_0xbbc1('0x53')]=_0x1195af['id'];return db[_0xbbc1('0x54')]['create'](_0x2b6f92['body']);}})[_0xbbc1('0x28')](respondWithResult(_0x49c05c,null))[_0xbbc1('0x47')](handleError(_0x49c05c,null));};exports['getDispositions']=function(_0x48f3d0,_0x48002f,_0x37ca6a){var _0x3cc936={'raw':![],'where':{}};var _0x23392e={};var _0x521a7c={'count':0x0,'rows':[]};return db[_0xbbc1('0x43')][_0xbbc1('0x55')]({'where':{'id':_0x48f3d0['params']['id']}})[_0xbbc1('0x28')](handleEntityNotFound(_0x48002f,null))['then'](function(_0x29d830){if(_0x29d830){_0x23392e[_0xbbc1('0x39')]=_['keys'](db[_0xbbc1('0x54')][_0xbbc1('0x32')]);_0x23392e['query']=_[_0xbbc1('0x35')](_0x48f3d0[_0xbbc1('0x34')]);_0x23392e['filters']=_[_0xbbc1('0x37')](_0x23392e['model'],_0x23392e[_0xbbc1('0x34')]);_0x3cc936['attributes']=_[_0xbbc1('0x37')](_0x23392e[_0xbbc1('0x39')],qs[_0xbbc1('0x3a')](_0x48f3d0[_0xbbc1('0x34')][_0xbbc1('0x3a')]));_0x3cc936['attributes']=_0x3cc936[_0xbbc1('0x38')]['length']?_0x3cc936[_0xbbc1('0x38')]:_0x23392e['model'];if(!_0x48f3d0[_0xbbc1('0x34')][_0xbbc1('0x56')](_0xbbc1('0x57'))){_0x3cc936[_0xbbc1('0x23')]=qs[_0xbbc1('0x23')](_0x48f3d0[_0xbbc1('0x34')]['limit']);_0x3cc936[_0xbbc1('0x21')]=qs[_0xbbc1('0x21')](_0x48f3d0[_0xbbc1('0x34')][_0xbbc1('0x21')]);}_0x3cc936[_0xbbc1('0x3c')]=qs['sort'](_0x48f3d0[_0xbbc1('0x34')][_0xbbc1('0x3d')]);_0x3cc936[_0xbbc1('0x3e')]=qs[_0xbbc1('0x36')](_['pick'](_0x48f3d0['query'],_0x23392e[_0xbbc1('0x36')]));_0x3cc936['where']['ListId']=_0x29d830['id'];if(_0x48f3d0[_0xbbc1('0x34')][_0xbbc1('0x40')]){_0x3cc936[_0xbbc1('0x3e')]=_[_0xbbc1('0x41')](_0x3cc936[_0xbbc1('0x3e')],{'$or':_['map'](_0x3cc936[_0xbbc1('0x38')],function(_0x43e2ab){var _0x39dd2e={};_0x39dd2e[_0x43e2ab]={'$like':'%'+_0x48f3d0[_0xbbc1('0x34')][_0xbbc1('0x40')]+'%'};return _0x39dd2e;})});}_0x3cc936=_[_0xbbc1('0x41')]({},_0x3cc936,_0x48f3d0['options']);return db['Disposition'][_0xbbc1('0x44')]({'where':_0x3cc936[_0xbbc1('0x3e')]})[_0xbbc1('0x28')](function(_0x4b45a2){_0x521a7c[_0xbbc1('0x44')]=_0x4b45a2;if(_0x48f3d0[_0xbbc1('0x34')][_0xbbc1('0x58')]){_0x3cc936[_0xbbc1('0x45')]=[{'all':!![]}];}return db[_0xbbc1('0x54')][_0xbbc1('0x46')](_0x3cc936);})['then'](function(_0x51b79f){_0x521a7c[_0xbbc1('0x59')]=_0x51b79f;return _0x521a7c;});}})[_0xbbc1('0x28')](respondWithFilteredResult(_0x48002f,_0x3cc936))['catch'](handleError(_0x48002f,null));};exports['removeDispositions']=function(_0x18fe71,_0x48e957,_0x30656a){return db[_0xbbc1('0x43')]['find']({'where':{'id':_0x18fe71[_0xbbc1('0x49')]['id']}})[_0xbbc1('0x28')](handleEntityNotFound(_0x48e957,null))['then'](function(_0x17d552){if(_0x17d552){return _0x17d552['removeDispositions'](_0x18fe71[_0xbbc1('0x34')][_0xbbc1('0x5a')]);}})[_0xbbc1('0x28')](respondWithStatusCode(_0x48e957,null))[_0xbbc1('0x47')](handleError(_0x48e957,null));};exports[_0xbbc1('0x5b')]=function(_0x1dc6f2,_0x2a1582,_0x15d01b){return db[_0xbbc1('0x43')][_0xbbc1('0x4b')]({'where':{'id':_0x1dc6f2['params']['id']}})['then'](handleEntityNotFound(_0x2a1582,null))[_0xbbc1('0x28')](function(_0x95409f){if(_0x95409f){var _0x33fdca=[];var _0x121111={'success':[],'errors':[]};return db[_0xbbc1('0x5c')][_0xbbc1('0x52')]()[_0xbbc1('0x28')](function(_0x2db566){if(_0x1dc6f2[_0xbbc1('0x4d')][_0xbbc1('0x5d')]&&_[_0xbbc1('0x5e')](_0x1dc6f2[_0xbbc1('0x4d')]['tags'])){if(_0x1dc6f2[_0xbbc1('0x4d')][_0xbbc1('0x5d')][_0xbbc1('0x3b')]){_0x1dc6f2[_0xbbc1('0x4d')][_0xbbc1('0x5d')]=_0x1dc6f2['body'][_0xbbc1('0x5d')][_0xbbc1('0x5f')](';')+';';}else{_0x1dc6f2[_0xbbc1('0x4d')]['tags']=null;}}else{_0x1dc6f2[_0xbbc1('0x4d')]['tags']=null;}if(_0x1dc6f2[_0xbbc1('0x4d')]&&_['isArray'](_0x1dc6f2[_0xbbc1('0x4d')])){for(var _0x3d0baa=0x0;_0x3d0baa<_0x1dc6f2[_0xbbc1('0x4d')][_0xbbc1('0x3b')];_0x3d0baa+=0x1){_0x1dc6f2[_0xbbc1('0x4d')][_0x3d0baa]['ListId']=_0x1dc6f2[_0xbbc1('0x49')]['id'];_0x33fdca['push'](_0x1dc6f2[_0xbbc1('0x4d')][_0x3d0baa]);}return BPromise[_0xbbc1('0x60')](_0x33fdca,function(_0x524334){return db[_0xbbc1('0x5c')][_0xbbc1('0x4c')](_['omit'](_0x524334,[_0xbbc1('0x5a'),'id'])||{},{'fields':_[_0xbbc1('0x35')](_0x2db566),'raw':!![]})[_0xbbc1('0x28')](function(_0x371fb7){_0x121111[_0xbbc1('0x61')]['push'](_0x371fb7[_0xbbc1('0x62')]);})['catch'](function(_0x2f39c6){_0x121111['errors'][_0xbbc1('0x63')]({'data':_0x524334,'error':_0x2f39c6['message']});});})[_0xbbc1('0x28')](function(_0x397e61){return _0x121111;})[_0xbbc1('0x47')](function(_0x3f1d91){return _0x3f1d91;});}else{_0x2a1582[_0xbbc1('0x1f')](0x190)['json']({'message':_0xbbc1('0x64')});}});}})[_0xbbc1('0x28')](respondWithResult(_0x2a1582,null))[_0xbbc1('0x47')](handleError(_0x2a1582,null));};exports[_0xbbc1('0x65')]=function(_0x4ffd7f,_0x38c2b4,_0x43bf96){var _0x88bad6;return db[_0xbbc1('0x43')][_0xbbc1('0x4b')]({'where':{'id':_0x4ffd7f[_0xbbc1('0x49')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0xbbc1('0x28')](handleEntityNotFound(_0x38c2b4,null))[_0xbbc1('0x28')](function(_0x519e7b){if(_0x519e7b){_0x88bad6=_0x519e7b;return db['CmContact'][_0xbbc1('0x32')];}})[_0xbbc1('0x28')](function(_0x25adf3){if(_0x25adf3){var _0x9047a2={};var _0x31e2c4={};_0x31e2c4['model']=_[_0xbbc1('0x66')](_[_0xbbc1('0x35')](_0x25adf3),_[_0xbbc1('0x31')](_0x88bad6['CustomFields'],function(_0x2f3afe){return util[_0xbbc1('0x67')](_0xbbc1('0x68'),_0x2f3afe['id']);}));_0x31e2c4[_0xbbc1('0x34')]=_[_0xbbc1('0x35')](_0x4ffd7f[_0xbbc1('0x34')]);_0x31e2c4['filters']=_[_0xbbc1('0x37')](_0x31e2c4[_0xbbc1('0x39')],_0x31e2c4[_0xbbc1('0x34')]);_0x9047a2[_0xbbc1('0x38')]=_[_0xbbc1('0x37')](_0x31e2c4[_0xbbc1('0x39')],qs[_0xbbc1('0x3a')](_0x4ffd7f[_0xbbc1('0x34')][_0xbbc1('0x3a')]));_0x9047a2[_0xbbc1('0x38')]=_0x9047a2[_0xbbc1('0x38')]['length']?_0x9047a2[_0xbbc1('0x38')]:_0x31e2c4[_0xbbc1('0x39')];if(!_0x4ffd7f['query'][_0xbbc1('0x56')](_0xbbc1('0x57'))){_0x9047a2[_0xbbc1('0x23')]=qs['limit'](_0x4ffd7f['query'][_0xbbc1('0x23')]);_0x9047a2[_0xbbc1('0x21')]=qs[_0xbbc1('0x21')](_0x4ffd7f[_0xbbc1('0x34')][_0xbbc1('0x21')]);}_0x9047a2['order']=qs[_0xbbc1('0x3d')](_0x4ffd7f[_0xbbc1('0x34')][_0xbbc1('0x3d')]);_0x9047a2[_0xbbc1('0x3e')]=qs[_0xbbc1('0x36')](_[_0xbbc1('0x3f')](_0x4ffd7f['query'],_0x31e2c4[_0xbbc1('0x36')]));_0x9047a2[_0xbbc1('0x69')]=!![];if(_0x4ffd7f[_0xbbc1('0x34')][_0xbbc1('0x40')]){_0x9047a2[_0xbbc1('0x3e')]=_[_0xbbc1('0x41')](_0x9047a2[_0xbbc1('0x3e')],{'$or':_[_0xbbc1('0x31')](_0x9047a2['attributes'],function(_0x48e924){var _0x11295a={};_0x11295a[_0x48e924]={'$like':'%'+_0x4ffd7f[_0xbbc1('0x34')][_0xbbc1('0x40')]+'%'};return _0x11295a;})});}_0x9047a2=_['merge']({},_0x9047a2,_0x4ffd7f['options']);return _0x88bad6['getContacts'](_0x9047a2);}})[_0xbbc1('0x28')](respondWithResult(_0x38c2b4,null))[_0xbbc1('0x47')](handleError(_0x38c2b4,null));};exports['getContactsCsv']=function(_0x262fec,_0x4cd22f,_0x2cd34b){var _0x506b90;var _0x1e5347;var _0x2fc6e7;var _0xeff8b3=_0x262fec[_0xbbc1('0x49')]['id'];csv_results=[];return db[_0xbbc1('0x6a')][_0xbbc1('0x46')]({'attributes':['id',_0xbbc1('0x2f')],'raw':!![],'order':[_0xbbc1('0x6b')]})[_0xbbc1('0x28')](function(_0x25391b){_0x506b90=_0x25391b;var _0x55835f=_[_0xbbc1('0x35')](db[_0xbbc1('0x5c')][_0xbbc1('0x32')]);return db[_0xbbc1('0x6c')]['findAll']({'raw':!![],'attributes':['id',_0xbbc1('0x6d')]})[_0xbbc1('0x28')](function(_0x4ba774){_0x1e5347=_0x4ba774;var _0x535aed=squel[_0xbbc1('0x6e')]()[_0xbbc1('0x3a')](_0x55835f)[_0xbbc1('0x6f')](_0xbbc1('0x70'),'c')[_0xbbc1('0x3e')](_0xbbc1('0x71'),_0xeff8b3)[_0xbbc1('0x3e')]('c.deletedAt\x20is\x20null')[_0xbbc1('0x72')]();for(var _0x157c5a=0x0;_0x157c5a<_0x1e5347[_0xbbc1('0x3b')];_0x157c5a++){_0x535aed[_0xbbc1('0x73')](_0xbbc1('0x74')+_0x1e5347[_0x157c5a]['id'],_0xbbc1('0x75')+_0x1e5347[_0x157c5a][_0xbbc1('0x6d')]);}for(var _0x157c5a=0x0;_0x157c5a<_0x506b90[_0xbbc1('0x3b')];_0x157c5a++){_0x535aed['field'](squel['select']()[_0xbbc1('0x73')](_0xbbc1('0x76'))[_0xbbc1('0x6f')](_0xbbc1('0x77'))[_0xbbc1('0x3e')](_0xbbc1('0x78'),_0x506b90[_0x157c5a]['id'])[_0xbbc1('0x3e')](_0xbbc1('0x79')),_0xbbc1('0x7a')+_0x506b90[_0x157c5a][_0xbbc1('0x2f')]);_0x535aed['field'](squel['select']()[_0xbbc1('0x73')](_0xbbc1('0x7b'))[_0xbbc1('0x6f')](_0xbbc1('0x77'))['where'](_0xbbc1('0x78'),_0x506b90[_0x157c5a]['id'])[_0xbbc1('0x3e')](_0xbbc1('0x79')),_0xbbc1('0x7c')+_0x506b90[_0x157c5a]['name']);}var _0x2d2596=[];_0x2d2596[_0xbbc1('0x63')](_0x535aed[_0xbbc1('0x7d')]());BPromise[_0xbbc1('0x60')](_0x2d2596,handleQuery)['then'](function(_0xc7f0b1){handleQuery(_0x535aed['toString']());var _0x3d98a6=csv_results[0x0];if(!_[_0xbbc1('0x7e')](_0x3d98a6)){var _0x102d92=toCsv(_0x3d98a6);var _0x172f46=Date[_0xbbc1('0x7f')]();fs['writeFileSync'](util[_0xbbc1('0x67')](_0xbbc1('0x80'),_0xeff8b3,_0x172f46),_0x102d92);_0x4cd22f[_0xbbc1('0x81')](_0xbbc1('0x82'),_0xbbc1('0x83')+util[_0xbbc1('0x67')]('list_%d_%s.csv',_0xeff8b3,_0x172f46));_0x4cd22f['setHeader'](_0xbbc1('0x84'),_0xbbc1('0x85'));return _0x4cd22f[_0xbbc1('0x86')](util[_0xbbc1('0x67')]('/tmp/list_%d_%s.csv',_0xeff8b3,_0x172f46));}else{return _0x4cd22f[_0xbbc1('0x1d')](0xcc);}});});});};exports[_0xbbc1('0x87')]=function(_0x387008,_0x1ada14,_0x214a0e){var _0x5c6aee;delete _0x387008['body']['id'];return db[_0xbbc1('0x43')]['findOne']({'where':{'id':_0x387008[_0xbbc1('0x49')]['id']}})[_0xbbc1('0x28')](handleEntityNotFound(_0x1ada14,null))[_0xbbc1('0x28')](function(_0x5cb5f7){if(_0x5cb5f7){return db[_0xbbc1('0x88')][_0xbbc1('0x89')](function(_0x2c0cf2){return db['CmCustomField'][_0xbbc1('0x4c')](_0x387008[_0xbbc1('0x4d')],{'transaction':_0x2c0cf2})[_0xbbc1('0x28')](function(_0x9ed7c9){_0x5c6aee=_0x9ed7c9;return _0x5cb5f7['addCustomFields'](_0x9ed7c9,{'transaction':_0x2c0cf2});})[_0xbbc1('0x28')](function(){var _0x221ae3={'type':db[_0xbbc1('0x8a')][_0xbbc1('0x8b')],'transaction':_0x2c0cf2};switch(_0x387008[_0xbbc1('0x4d')][_0xbbc1('0x42')]){case _0xbbc1('0x8c'):_0x221ae3[_0xbbc1('0x42')]=db['Sequelize']['TEXT'];break;case _0xbbc1('0x8d'):_0x221ae3[_0xbbc1('0x42')]=db[_0xbbc1('0x8a')][_0xbbc1('0x8e')];break;case'switch':_0x221ae3[_0xbbc1('0x42')]=db[_0xbbc1('0x8a')][_0xbbc1('0x8f')];_0x221ae3['defaultValue']=![];break;default:}return db[_0xbbc1('0x88')][_0xbbc1('0x90')][_0xbbc1('0x91')](_0xbbc1('0x70'),util['format'](_0xbbc1('0x92'),_0x5c6aee['id']),_0x221ae3);})[_0xbbc1('0x28')](function(){return _0x5c6aee;});});}})[_0xbbc1('0x28')](respondWithResult(_0x1ada14,null))['catch'](handleError(_0x1ada14,null));};exports[_0xbbc1('0x93')]=function(_0x1d8848,_0x51efec,_0x57871f){var _0xf90de5={};var _0x599c4b={};var _0x5b50d5;var _0x522fbe;return db[_0xbbc1('0x43')][_0xbbc1('0x55')]({'where':{'id':_0x1d8848[_0xbbc1('0x49')]['id']}})[_0xbbc1('0x28')](handleEntityNotFound(_0x51efec,null))[_0xbbc1('0x28')](function(_0x4353d4){if(_0x4353d4){_0x5b50d5=_0x4353d4;_0x599c4b[_0xbbc1('0x39')]=_[_0xbbc1('0x35')](db[_0xbbc1('0x6c')][_0xbbc1('0x32')]);_0x599c4b[_0xbbc1('0x34')]=_[_0xbbc1('0x35')](_0x1d8848[_0xbbc1('0x34')]);_0x599c4b[_0xbbc1('0x36')]=_[_0xbbc1('0x37')](_0x599c4b[_0xbbc1('0x39')],_0x599c4b[_0xbbc1('0x34')]);_0xf90de5[_0xbbc1('0x38')]=_[_0xbbc1('0x37')](_0x599c4b['model'],qs['fields'](_0x1d8848[_0xbbc1('0x34')][_0xbbc1('0x3a')]));_0xf90de5[_0xbbc1('0x38')]=_0xf90de5[_0xbbc1('0x38')]['length']?_0xf90de5[_0xbbc1('0x38')]:_0x599c4b[_0xbbc1('0x39')];_0xf90de5['order']=qs[_0xbbc1('0x3d')](_0x1d8848[_0xbbc1('0x34')]['sort']);_0xf90de5[_0xbbc1('0x3e')]=qs['filters'](_[_0xbbc1('0x3f')](_0x1d8848[_0xbbc1('0x34')],_0x599c4b[_0xbbc1('0x36')]));_0xf90de5['where']=_[_0xbbc1('0x41')](_0xf90de5[_0xbbc1('0x3e')],{'$or':[{'ListId':_0x4353d4['id']},{'ListId':null}]});if(_0x1d8848[_0xbbc1('0x34')]['filter']){_0xf90de5[_0xbbc1('0x3e')]=_[_0xbbc1('0x41')](_0xf90de5[_0xbbc1('0x3e')],{'$or':_[_0xbbc1('0x31')](_0xf90de5[_0xbbc1('0x38')],function(_0x1465f7){var _0xd7b6dc={};_0xd7b6dc[_0x1465f7]={'$like':'%'+_0x1d8848[_0xbbc1('0x34')][_0xbbc1('0x40')]+'%'};return _0xd7b6dc;})});}_0xf90de5=_[_0xbbc1('0x41')]({},_0xf90de5,_0x1d8848[_0xbbc1('0x4a')]);return db['CmCustomField'][_0xbbc1('0x94')](_0xf90de5);}})[_0xbbc1('0x28')](respondWithResult(_0x51efec,null))[_0xbbc1('0x47')](handleError(_0x51efec,null));};exports[_0xbbc1('0x95')]=function(_0x275b43,_0x3bcf75){return db['CmCustomField'][_0xbbc1('0x94')]({'where':{'ListId':null}})[_0xbbc1('0x28')](handleEntityNotFound(_0x3bcf75,null))[_0xbbc1('0x28')](function(_0x2104da){return _0x2104da;})[_0xbbc1('0x28')](respondWithResult(_0x3bcf75,null))[_0xbbc1('0x47')](handleError(_0x3bcf75,null));};exports[_0xbbc1('0x96')]=function(_0x828463,_0x417ca9,_0x1c05c0){return db[_0xbbc1('0x43')][_0xbbc1('0x4b')]({'where':{'id':_0x828463[_0xbbc1('0x49')]['id']}})[_0xbbc1('0x28')](handleEntityNotFound(_0x417ca9,null))['then'](function(_0x269313){if(_0x269313){return _0x269313[_0xbbc1('0x96')](_0x828463[_0xbbc1('0x4d')][_0xbbc1('0x5a')],_[_0xbbc1('0x97')](_0x828463[_0xbbc1('0x4d')],[_0xbbc1('0x5a'),'id'])||{})['spread'](function(_0x309cfe){for(var _0x2b9017=0x0;_0x2b9017<_0x828463[_0xbbc1('0x4d')][_0xbbc1('0x5a')][_0xbbc1('0x3b')];_0x2b9017+=0x1){socket[_0xbbc1('0x98')]('userCmList:save',{'UserId':Number(_0x828463[_0xbbc1('0x4d')][_0xbbc1('0x5a')][_0x2b9017]),'CmListId':Number(_0x828463[_0xbbc1('0x49')]['id'])});}return _0x309cfe;});}})[_0xbbc1('0x28')](respondWithResult(_0x417ca9,null))[_0xbbc1('0x47')](handleError(_0x417ca9,null));};exports[_0xbbc1('0x99')]=function(_0x23c6ab,_0x5f0eef,_0x3be5ce){return db[_0xbbc1('0x43')][_0xbbc1('0x4b')]({'where':{'id':_0x23c6ab['params']['id']}})['then'](handleEntityNotFound(_0x5f0eef,null))['then'](function(_0x204fe2){if(_0x204fe2){return _0x204fe2[_0xbbc1('0x99')](_0x23c6ab[_0xbbc1('0x34')][_0xbbc1('0x5a')])[_0xbbc1('0x28')](function(){if(_['isArray'](_0x23c6ab['query']['ids'])){for(var _0x3c8cda=0x0;_0x3c8cda<_0x23c6ab['query'][_0xbbc1('0x5a')][_0xbbc1('0x3b')];_0x3c8cda+=0x1){socket['emit'](_0xbbc1('0x9a'),{'UserId':Number(_0x23c6ab[_0xbbc1('0x34')][_0xbbc1('0x5a')][_0x3c8cda]),'CmListId':Number(_0x23c6ab[_0xbbc1('0x49')]['id'])});}}else{socket[_0xbbc1('0x98')](_0xbbc1('0x9a'),{'UserId':Number(_0x23c6ab[_0xbbc1('0x34')]['ids']),'CmListId':Number(_0x23c6ab[_0xbbc1('0x49')]['id'])});}});}})[_0xbbc1('0x28')](respondWithStatusCode(_0x5f0eef,null))[_0xbbc1('0x47')](handleError(_0x5f0eef,null));};exports['getAgents']=function(_0x5e2431,_0x1811da,_0x11b7aa){var _0x57ffa8={};var _0x2accc0={};var _0x15669f;var _0xa89f3d;return db['CmList']['findOne']({'where':{'id':_0x5e2431[_0xbbc1('0x49')]['id']}})[_0xbbc1('0x28')](handleEntityNotFound(_0x1811da,null))[_0xbbc1('0x28')](function(_0x429a24){if(_0x429a24){_0x15669f=_0x429a24;_0x2accc0[_0xbbc1('0x39')]=_['keys'](db[_0xbbc1('0x9b')][_0xbbc1('0x32')]);_0x2accc0['query']=_[_0xbbc1('0x35')](_0x5e2431['query']);_0x2accc0['filters']=_[_0xbbc1('0x37')](_0x2accc0[_0xbbc1('0x39')],_0x2accc0[_0xbbc1('0x34')]);_0x57ffa8[_0xbbc1('0x38')]=_[_0xbbc1('0x37')](_0x2accc0[_0xbbc1('0x39')],qs[_0xbbc1('0x3a')](_0x5e2431['query'][_0xbbc1('0x3a')]));_0x57ffa8[_0xbbc1('0x38')]=_0x57ffa8['attributes'][_0xbbc1('0x3b')]?_0x57ffa8[_0xbbc1('0x38')]:_0x2accc0['model'];_0x57ffa8[_0xbbc1('0x3c')]=qs[_0xbbc1('0x3d')](_0x5e2431[_0xbbc1('0x34')][_0xbbc1('0x3d')]);_0x57ffa8['where']=qs[_0xbbc1('0x36')](_[_0xbbc1('0x3f')](_0x5e2431['query'],_0x2accc0[_0xbbc1('0x36')]));if(_0x5e2431[_0xbbc1('0x34')][_0xbbc1('0x40')]){_0x57ffa8['where']=_['merge'](_0x57ffa8['where'],{'$or':_[_0xbbc1('0x31')](_0x57ffa8[_0xbbc1('0x38')],function(_0x2a7799){var _0x28b5e0={};_0x28b5e0[_0x2a7799]={'$like':'%'+_0x5e2431[_0xbbc1('0x34')][_0xbbc1('0x40')]+'%'};return _0x28b5e0;})});}_0x57ffa8=_['merge']({},_0x57ffa8,_0x5e2431[_0xbbc1('0x4a')]);return _0x15669f['getAgents'](_0x57ffa8);}})[_0xbbc1('0x28')](function(_0x590340){if(_0x590340){_0xa89f3d=_0x590340[_0xbbc1('0x3b')];if(!_0x5e2431[_0xbbc1('0x34')][_0xbbc1('0x56')](_0xbbc1('0x57'))){_0x57ffa8['limit']=qs[_0xbbc1('0x23')](_0x5e2431[_0xbbc1('0x34')][_0xbbc1('0x23')]);_0x57ffa8[_0xbbc1('0x21')]=qs[_0xbbc1('0x21')](_0x5e2431[_0xbbc1('0x34')][_0xbbc1('0x21')]);}return _0x15669f[_0xbbc1('0x9c')](_0x57ffa8);}})[_0xbbc1('0x28')](function(_0x15ee87){if(_0x15ee87){return _0x15ee87?{'count':_0xa89f3d,'rows':_0x15ee87}:null;}})[_0xbbc1('0x28')](respondWithResult(_0x1811da,null))[_0xbbc1('0x47')](handleError(_0x1811da,null));};function handleQuery(_0x434497){logger['info'](_0x434497);return db['sequelize']['query'](_0x434497)[_0xbbc1('0x9d')](function(_0x5e0912){csv_results[_0xbbc1('0x63')](_0x5e0912);})[_0xbbc1('0x47')](function(_0x2ec147){logger[_0xbbc1('0x2d')](_0x2ec147[_0xbbc1('0x9e')]);});} \ No newline at end of file +var _0xdbfa=['isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','text/csv','download','transaction','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','User','info','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','Lists','UserProfileResource','end','name','index','map','CmList','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','include','findAll','rows','catch','params','keys','length','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','removeDispositions','ids','CmContact','tags','isArray','join','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','raw','getContactsCsv','alias','select','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','customField_','cm_contact_has_items','ItemTypeId\x20=\x20?','additionalPhone_','description','from','CmContactId\x20=\x20c.id','description_additionalPhone_','toString'];(function(_0x10bcc4,_0x4400e2){var _0x2da988=function(_0x2ee849){while(--_0x2ee849){_0x10bcc4['push'](_0x10bcc4['shift']());}};_0x2da988(++_0x4400e2);}(_0xdbfa,0x15e));var _0xadbf=function(_0x11ac68,_0x56debc){_0x11ac68=_0x11ac68-0x0;var _0x1d5277=_0xdbfa[_0x11ac68];return _0x1d5277;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xadbf('0x0'));var jsonpatch=require(_0xadbf('0x1'));var rp=require(_0xadbf('0x2'));var moment=require('moment');var BPromise=require(_0xadbf('0x3'));var Mustache=require(_0xadbf('0x4'));var util=require(_0xadbf('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xadbf('0x6'));var fs=require('fs');var fs_extra=require(_0xadbf('0x7'));var _=require(_0xadbf('0x8'));var squel=require(_0xadbf('0x9'));var crypto=require(_0xadbf('0xa'));var jsforce=require(_0xadbf('0xb'));var deskjs=require(_0xadbf('0xc'));var toCsv=require(_0xadbf('0xd'));var querystring=require(_0xadbf('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xadbf('0xf'));var qs=require(_0xadbf('0x10'));var as=require(_0xadbf('0x11'));var hardwareService=require(_0xadbf('0x12'));var logger=require('../../config/logger')(_0xadbf('0x13'));var utils=require(_0xadbf('0x14'));var config=require(_0xadbf('0x15'));var licenseUtil=require(_0xadbf('0x16'));var db=require(_0xadbf('0x17'))['db'];var csv_results;config['redis']=_[_0xadbf('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xadbf('0x19')]));require('./cmList.socket')[_0xadbf('0x1a')](socket);function respondWithStatusCode(_0x30bc20,_0x5b7709){_0x5b7709=_0x5b7709||0xcc;return function(_0x4d0591){if(_0x4d0591){return _0x30bc20[_0xadbf('0x1b')](_0x5b7709);}return _0x30bc20[_0xadbf('0x1c')](_0x5b7709)['end']();};}function respondWithResult(_0x160eee,_0x3a918c){_0x3a918c=_0x3a918c||0xc8;return function(_0x2a64ac){if(_0x2a64ac){return _0x160eee[_0xadbf('0x1c')](_0x3a918c)[_0xadbf('0x1d')](_0x2a64ac);}};}function respondWithFilteredResult(_0x43cc16,_0x42f207){return function(_0x103ba6){if(_0x103ba6){var _0x54f0cb=typeof _0x42f207[_0xadbf('0x1e')]===_0xadbf('0x1f')&&typeof _0x42f207['limit']===_0xadbf('0x1f');var _0x5e86ec=_0x103ba6[_0xadbf('0x20')];var _0x4779f8=_0x54f0cb?0x0:_0x42f207['offset'];var _0x1f2ee7=_0x54f0cb?_0x103ba6['count']:_0x42f207[_0xadbf('0x1e')]+_0x42f207[_0xadbf('0x21')];var _0x5d0cf9;if(_0x1f2ee7>=_0x5e86ec){_0x1f2ee7=_0x5e86ec;_0x5d0cf9=0xc8;}else{_0x5d0cf9=0xce;}_0x43cc16[_0xadbf('0x1c')](_0x5d0cf9);return _0x43cc16['set'](_0xadbf('0x22'),_0x4779f8+'-'+_0x1f2ee7+'/'+_0x5e86ec)[_0xadbf('0x1d')](_0x103ba6);}return null;};}function patchUpdates(_0x2aa7cd){return function(_0x528773){try{jsonpatch[_0xadbf('0x23')](_0x528773,_0x2aa7cd,!![]);}catch(_0x42bf75){return BPromise[_0xadbf('0x24')](_0x42bf75);}return _0x528773[_0xadbf('0x25')]();};}function saveUpdates(_0xd30da9,_0x5142f8){return function(_0x5eb809){if(_0x5eb809){return _0x5eb809[_0xadbf('0x26')](_0xd30da9)[_0xadbf('0x27')](function(_0x461df4){return _0x461df4;});}return null;};}function removeEntity(_0x52304f,_0x58d203){return function(_0x5c84a2){if(_0x5c84a2){return _0x5c84a2[_0xadbf('0x28')]()[_0xadbf('0x27')](function(){var _0x542a3b=_0x5c84a2[_0xadbf('0x29')]({'plain':!![]});var _0x2bb6e5=_0xadbf('0x2a');return db[_0xadbf('0x2b')]['destroy']({'where':{'type':_0x2bb6e5,'resourceId':_0x542a3b['id']}})['then'](function(){return _0x5c84a2;});})['then'](function(){_0x52304f['status'](0xcc)[_0xadbf('0x2c')]();});}};}function handleEntityNotFound(_0x1e2df1,_0x195e8a){return function(_0x1d248b){if(!_0x1d248b){_0x1e2df1['sendStatus'](0x194);}return _0x1d248b;};}function handleError(_0xde74d7,_0x1f2c13){_0x1f2c13=_0x1f2c13||0x1f4;return function(_0xb945fa){logger['error'](_0xb945fa['stack']);if(_0xb945fa['name']){delete _0xb945fa[_0xadbf('0x2d')];}_0xde74d7[_0xadbf('0x1c')](_0x1f2c13)['send'](_0xb945fa);};}exports[_0xadbf('0x2e')]=function(_0x2ca0d0,_0x59555e){var _0x42627c={},_0x2676c3={},_0x44e566={'count':0x0,'rows':[]};var _0x2eaf6e=_[_0xadbf('0x2f')](db[_0xadbf('0x30')][_0xadbf('0x31')],function(_0x41dcaf){return{'name':_0x41dcaf[_0xadbf('0x32')],'type':_0x41dcaf[_0xadbf('0x33')][_0xadbf('0x34')]};});_0x2676c3['model']=_[_0xadbf('0x2f')](_0x2eaf6e,_0xadbf('0x2d'));_0x2676c3[_0xadbf('0x35')]=_['keys'](_0x2ca0d0[_0xadbf('0x35')]);_0x2676c3[_0xadbf('0x36')]=_[_0xadbf('0x37')](_0x2676c3['model'],_0x2676c3[_0xadbf('0x35')]);_0x42627c[_0xadbf('0x38')]=_[_0xadbf('0x37')](_0x2676c3[_0xadbf('0x39')],qs[_0xadbf('0x3a')](_0x2ca0d0[_0xadbf('0x35')]['fields']));_0x42627c[_0xadbf('0x38')]=_0x42627c[_0xadbf('0x38')]['length']?_0x42627c[_0xadbf('0x38')]:_0x2676c3['model'];if(!_0x2ca0d0[_0xadbf('0x35')][_0xadbf('0x3b')](_0xadbf('0x3c'))){_0x42627c[_0xadbf('0x21')]=qs[_0xadbf('0x21')](_0x2ca0d0[_0xadbf('0x35')][_0xadbf('0x21')]);_0x42627c[_0xadbf('0x1e')]=qs['offset'](_0x2ca0d0[_0xadbf('0x35')][_0xadbf('0x1e')]);}_0x42627c[_0xadbf('0x3d')]=qs[_0xadbf('0x3e')](_0x2ca0d0[_0xadbf('0x35')][_0xadbf('0x3e')]);_0x42627c['where']=qs['filters'](_[_0xadbf('0x3f')](_0x2ca0d0['query'],_0x2676c3['filters']),_0x2eaf6e);if(_0x2ca0d0[_0xadbf('0x35')]['filter']){_0x42627c[_0xadbf('0x40')]=_[_0xadbf('0x41')](_0x42627c['where'],{'$or':_[_0xadbf('0x2f')](_0x2eaf6e,function(_0x225947){if(_0x225947[_0xadbf('0x33')]!=='VIRTUAL'){var _0x2c1eb2={};_0x2c1eb2[_0x225947[_0xadbf('0x2d')]]={'$like':'%'+_0x2ca0d0[_0xadbf('0x35')][_0xadbf('0x42')]+'%'};return _0x2c1eb2;}})});}_0x42627c=_[_0xadbf('0x41')]({},_0x42627c,_0x2ca0d0[_0xadbf('0x43')]);var _0x1a0704={'where':_0x42627c[_0xadbf('0x40')]};return db[_0xadbf('0x30')][_0xadbf('0x20')](_0x1a0704)[_0xadbf('0x27')](function(_0x4410dd){_0x44e566[_0xadbf('0x20')]=_0x4410dd;if(_0x2ca0d0[_0xadbf('0x35')]['includeAll']){_0x42627c[_0xadbf('0x44')]=[{'all':!![]}];}return db['CmList'][_0xadbf('0x45')](_0x42627c);})[_0xadbf('0x27')](function(_0x302fff){_0x44e566[_0xadbf('0x46')]=_0x302fff;return _0x44e566;})[_0xadbf('0x27')](respondWithFilteredResult(_0x59555e,_0x42627c))[_0xadbf('0x47')](handleError(_0x59555e,null));};exports['show']=function(_0x1c2205,_0x5690f8){var _0x8cf05f={'raw':![],'where':{'id':_0x1c2205[_0xadbf('0x48')]['id']}},_0x3380d1={};_0x3380d1[_0xadbf('0x39')]=_[_0xadbf('0x49')](db[_0xadbf('0x30')][_0xadbf('0x31')]);_0x3380d1[_0xadbf('0x35')]=_[_0xadbf('0x49')](_0x1c2205[_0xadbf('0x35')]);_0x3380d1[_0xadbf('0x36')]=_[_0xadbf('0x37')](_0x3380d1['model'],_0x3380d1['query']);_0x8cf05f[_0xadbf('0x38')]=_[_0xadbf('0x37')](_0x3380d1[_0xadbf('0x39')],qs['fields'](_0x1c2205['query']['fields']));_0x8cf05f[_0xadbf('0x38')]=_0x8cf05f['attributes'][_0xadbf('0x4a')]?_0x8cf05f[_0xadbf('0x38')]:_0x3380d1[_0xadbf('0x39')];if(_0x1c2205[_0xadbf('0x35')][_0xadbf('0x4b')]){_0x8cf05f[_0xadbf('0x44')]=[{'all':!![]}];}_0x8cf05f=_[_0xadbf('0x41')]({},_0x8cf05f,_0x1c2205[_0xadbf('0x43')]);return db[_0xadbf('0x30')]['find'](_0x8cf05f)['then'](handleEntityNotFound(_0x5690f8,null))[_0xadbf('0x27')](respondWithResult(_0x5690f8,null))[_0xadbf('0x47')](handleError(_0x5690f8,null));};exports[_0xadbf('0x4c')]=function(_0x50d14b,_0x5dfa9e){return db[_0xadbf('0x30')][_0xadbf('0x4c')](_0x50d14b[_0xadbf('0x4d')],{})[_0xadbf('0x27')](function(_0x81243b){var _0x643f4d=_0x50d14b[_0xadbf('0x4e')][_0xadbf('0x29')]({'plain':!![]});if(!_0x643f4d)throw new Error(_0xadbf('0x4f'));if(_0x643f4d[_0xadbf('0x50')]===_0xadbf('0x4e')){var _0x23b513=_0x81243b[_0xadbf('0x29')]({'plain':!![]});var _0x593084=_0xadbf('0x2a');return db[_0xadbf('0x51')][_0xadbf('0x52')]({'where':{'name':_0x593084,'userProfileId':_0x643f4d[_0xadbf('0x53')]},'raw':!![]})[_0xadbf('0x27')](function(_0x49d290){if(_0x49d290&&_0x49d290['autoAssociation']===0x0){return db[_0xadbf('0x2b')][_0xadbf('0x4c')]({'name':_0x23b513[_0xadbf('0x2d')],'resourceId':_0x23b513['id'],'type':_0x49d290['name'],'sectionId':_0x49d290['id']},{})[_0xadbf('0x27')](function(){return _0x81243b;});}else{return _0x81243b;}})[_0xadbf('0x47')](function(_0x380612){logger[_0xadbf('0x54')](_0xadbf('0x55'),_0x380612);throw _0x380612;});}return _0x81243b;})[_0xadbf('0x27')](respondWithResult(_0x5dfa9e,0xc9))[_0xadbf('0x47')](handleError(_0x5dfa9e,null));};exports[_0xadbf('0x26')]=function(_0xf054e,_0x5d5c17){if(_0xf054e[_0xadbf('0x4d')]['id']){delete _0xf054e[_0xadbf('0x4d')]['id'];}return db[_0xadbf('0x30')]['find']({'where':{'id':_0xf054e[_0xadbf('0x48')]['id']}})['then'](handleEntityNotFound(_0x5d5c17,null))[_0xadbf('0x27')](saveUpdates(_0xf054e[_0xadbf('0x4d')],null))['then'](respondWithResult(_0x5d5c17,null))[_0xadbf('0x47')](handleError(_0x5d5c17,null));};exports['destroy']=function(_0x3db271,_0x1666aa){return db[_0xadbf('0x30')][_0xadbf('0x52')]({'where':{'id':_0x3db271[_0xadbf('0x48')]['id']}})['then'](handleEntityNotFound(_0x1666aa,null))[_0xadbf('0x27')](removeEntity(_0x1666aa,null))[_0xadbf('0x47')](handleError(_0x1666aa,null));};exports['describe']=function(_0x370896,_0x2dc85d){return db[_0xadbf('0x30')][_0xadbf('0x56')]()[_0xadbf('0x27')](respondWithResult(_0x2dc85d,null))['catch'](handleError(_0x2dc85d,null));};exports[_0xadbf('0x57')]=function(_0x5ba99d,_0x146fce,_0x545086){if(_0x5ba99d['body']['id']){delete _0x5ba99d['body']['id'];}return db[_0xadbf('0x30')][_0xadbf('0x52')]({'where':{'id':_0x5ba99d[_0xadbf('0x48')]['id']}})[_0xadbf('0x27')](handleEntityNotFound(_0x146fce,null))[_0xadbf('0x27')](function(_0x488ccb){if(_0x488ccb){_0x5ba99d[_0xadbf('0x4d')][_0xadbf('0x58')]=_0x488ccb['id'];return db[_0xadbf('0x59')][_0xadbf('0x4c')](_0x5ba99d['body']);}})['then'](respondWithResult(_0x146fce,null))['catch'](handleError(_0x146fce,null));};exports[_0xadbf('0x5a')]=function(_0x2ec8cb,_0x52ecd9,_0x5685b9){var _0x54849f={'raw':![],'where':{}};var _0x491d81={};var _0x1670c3={'count':0x0,'rows':[]};return db[_0xadbf('0x30')][_0xadbf('0x5b')]({'where':{'id':_0x2ec8cb[_0xadbf('0x48')]['id']}})[_0xadbf('0x27')](handleEntityNotFound(_0x52ecd9,null))[_0xadbf('0x27')](function(_0x37da07){if(_0x37da07){_0x491d81[_0xadbf('0x39')]=_[_0xadbf('0x49')](db[_0xadbf('0x59')]['rawAttributes']);_0x491d81['query']=_[_0xadbf('0x49')](_0x2ec8cb[_0xadbf('0x35')]);_0x491d81[_0xadbf('0x36')]=_[_0xadbf('0x37')](_0x491d81['model'],_0x491d81['query']);_0x54849f[_0xadbf('0x38')]=_['intersection'](_0x491d81[_0xadbf('0x39')],qs[_0xadbf('0x3a')](_0x2ec8cb['query']['fields']));_0x54849f[_0xadbf('0x38')]=_0x54849f[_0xadbf('0x38')][_0xadbf('0x4a')]?_0x54849f[_0xadbf('0x38')]:_0x491d81[_0xadbf('0x39')];if(!_0x2ec8cb['query'][_0xadbf('0x3b')](_0xadbf('0x3c'))){_0x54849f[_0xadbf('0x21')]=qs[_0xadbf('0x21')](_0x2ec8cb[_0xadbf('0x35')][_0xadbf('0x21')]);_0x54849f['offset']=qs[_0xadbf('0x1e')](_0x2ec8cb[_0xadbf('0x35')][_0xadbf('0x1e')]);}_0x54849f['order']=qs[_0xadbf('0x3e')](_0x2ec8cb[_0xadbf('0x35')][_0xadbf('0x3e')]);_0x54849f['where']=qs[_0xadbf('0x36')](_['pick'](_0x2ec8cb[_0xadbf('0x35')],_0x491d81['filters']));_0x54849f[_0xadbf('0x40')]['ListId']=_0x37da07['id'];if(_0x2ec8cb[_0xadbf('0x35')][_0xadbf('0x42')]){_0x54849f[_0xadbf('0x40')]=_[_0xadbf('0x41')](_0x54849f['where'],{'$or':_[_0xadbf('0x2f')](_0x54849f[_0xadbf('0x38')],function(_0x4a9154){var _0x2aabc0={};_0x2aabc0[_0x4a9154]={'$like':'%'+_0x2ec8cb['query'][_0xadbf('0x42')]+'%'};return _0x2aabc0;})});}_0x54849f=_[_0xadbf('0x41')]({},_0x54849f,_0x2ec8cb['options']);return db['Disposition'][_0xadbf('0x20')]({'where':_0x54849f['where']})[_0xadbf('0x27')](function(_0x482b88){_0x1670c3[_0xadbf('0x20')]=_0x482b88;if(_0x2ec8cb[_0xadbf('0x35')]['includeAll']){_0x54849f[_0xadbf('0x44')]=[{'all':!![]}];}return db[_0xadbf('0x59')][_0xadbf('0x45')](_0x54849f);})[_0xadbf('0x27')](function(_0x4f5909){_0x1670c3[_0xadbf('0x46')]=_0x4f5909;return _0x1670c3;});}})['then'](respondWithFilteredResult(_0x52ecd9,_0x54849f))[_0xadbf('0x47')](handleError(_0x52ecd9,null));};exports[_0xadbf('0x5c')]=function(_0x48c7e9,_0x5c27ed,_0x2f0fd0){return db[_0xadbf('0x30')][_0xadbf('0x52')]({'where':{'id':_0x48c7e9[_0xadbf('0x48')]['id']}})[_0xadbf('0x27')](handleEntityNotFound(_0x5c27ed,null))['then'](function(_0x3adeab){if(_0x3adeab){return _0x3adeab[_0xadbf('0x5c')](_0x48c7e9[_0xadbf('0x35')][_0xadbf('0x5d')]);}})[_0xadbf('0x27')](respondWithStatusCode(_0x5c27ed,null))[_0xadbf('0x47')](handleError(_0x5c27ed,null));};exports['addContacts']=function(_0x48c6bb,_0x427bf9,_0x304cc2){return db[_0xadbf('0x30')][_0xadbf('0x52')]({'where':{'id':_0x48c6bb[_0xadbf('0x48')]['id']}})[_0xadbf('0x27')](handleEntityNotFound(_0x427bf9,null))['then'](function(_0x132c32){if(_0x132c32){var _0x346d38=[];var _0x3832cb={'success':[],'errors':[]};return db[_0xadbf('0x5e')][_0xadbf('0x56')]()[_0xadbf('0x27')](function(_0x4d19a5){if(_0x48c6bb[_0xadbf('0x4d')][_0xadbf('0x5f')]&&_[_0xadbf('0x60')](_0x48c6bb[_0xadbf('0x4d')][_0xadbf('0x5f')])){if(_0x48c6bb[_0xadbf('0x4d')]['tags'][_0xadbf('0x4a')]){_0x48c6bb[_0xadbf('0x4d')][_0xadbf('0x5f')]=_0x48c6bb[_0xadbf('0x4d')][_0xadbf('0x5f')][_0xadbf('0x61')](';')+';';}else{_0x48c6bb[_0xadbf('0x4d')][_0xadbf('0x5f')]=null;}}else{_0x48c6bb[_0xadbf('0x4d')][_0xadbf('0x5f')]=null;}if(_0x48c6bb[_0xadbf('0x4d')]&&_['isArray'](_0x48c6bb[_0xadbf('0x4d')])){for(var _0x49dfc5=0x0;_0x49dfc5<_0x48c6bb[_0xadbf('0x4d')][_0xadbf('0x4a')];_0x49dfc5+=0x1){_0x48c6bb[_0xadbf('0x4d')][_0x49dfc5][_0xadbf('0x58')]=_0x48c6bb[_0xadbf('0x48')]['id'];_0x346d38[_0xadbf('0x62')](_0x48c6bb[_0xadbf('0x4d')][_0x49dfc5]);}return BPromise[_0xadbf('0x63')](_0x346d38,function(_0x463ffe){return db[_0xadbf('0x5e')][_0xadbf('0x4c')](_[_0xadbf('0x64')](_0x463ffe,[_0xadbf('0x5d'),'id'])||{},{'fields':_[_0xadbf('0x49')](_0x4d19a5),'raw':!![]})[_0xadbf('0x27')](function(_0x344fb1){_0x3832cb[_0xadbf('0x65')][_0xadbf('0x62')](_0x344fb1[_0xadbf('0x66')]);})[_0xadbf('0x47')](function(_0x3caad3){_0x3832cb[_0xadbf('0x67')]['push']({'data':_0x463ffe,'error':_0x3caad3[_0xadbf('0x68')]});});})['then'](function(_0x1b870c){return _0x3832cb;})[_0xadbf('0x47')](function(_0x380187){return _0x380187;});}else{_0x427bf9[_0xadbf('0x1c')](0x190)[_0xadbf('0x1d')]({'message':_0xadbf('0x69')});}});}})[_0xadbf('0x27')](respondWithResult(_0x427bf9,null))['catch'](handleError(_0x427bf9,null));};exports[_0xadbf('0x6a')]=function(_0x570db7,_0x201f2e,_0x520c42){var _0xa34365;return db[_0xadbf('0x30')][_0xadbf('0x52')]({'where':{'id':_0x570db7[_0xadbf('0x48')]['id']},'include':[{'model':db[_0xadbf('0x6b')],'as':_0xadbf('0x6c')}]})[_0xadbf('0x27')](handleEntityNotFound(_0x201f2e,null))[_0xadbf('0x27')](function(_0xbe8e75){if(_0xbe8e75){_0xa34365=_0xbe8e75;return db[_0xadbf('0x5e')][_0xadbf('0x31')];}})['then'](function(_0x391ca7){if(_0x391ca7){var _0x5d626e={};var _0x2737db={};_0x2737db[_0xadbf('0x39')]=_['concat'](_[_0xadbf('0x49')](_0x391ca7),_[_0xadbf('0x2f')](_0xa34365[_0xadbf('0x6c')],function(_0x44ac4c){return util[_0xadbf('0x6d')]('cf_%d',_0x44ac4c['id']);}));_0x2737db[_0xadbf('0x35')]=_['keys'](_0x570db7[_0xadbf('0x35')]);_0x2737db[_0xadbf('0x36')]=_['intersection'](_0x2737db[_0xadbf('0x39')],_0x2737db[_0xadbf('0x35')]);_0x5d626e[_0xadbf('0x38')]=_[_0xadbf('0x37')](_0x2737db[_0xadbf('0x39')],qs['fields'](_0x570db7[_0xadbf('0x35')]['fields']));_0x5d626e[_0xadbf('0x38')]=_0x5d626e['attributes'][_0xadbf('0x4a')]?_0x5d626e[_0xadbf('0x38')]:_0x2737db[_0xadbf('0x39')];if(!_0x570db7['query']['hasOwnProperty']('nolimit')){_0x5d626e[_0xadbf('0x21')]=qs[_0xadbf('0x21')](_0x570db7[_0xadbf('0x35')][_0xadbf('0x21')]);_0x5d626e[_0xadbf('0x1e')]=qs['offset'](_0x570db7[_0xadbf('0x35')][_0xadbf('0x1e')]);}_0x5d626e['order']=qs[_0xadbf('0x3e')](_0x570db7[_0xadbf('0x35')][_0xadbf('0x3e')]);_0x5d626e[_0xadbf('0x40')]=qs[_0xadbf('0x36')](_['pick'](_0x570db7[_0xadbf('0x35')],_0x2737db[_0xadbf('0x36')]));_0x5d626e[_0xadbf('0x6e')]=!![];if(_0x570db7[_0xadbf('0x35')]['filter']){_0x5d626e[_0xadbf('0x40')]=_[_0xadbf('0x41')](_0x5d626e['where'],{'$or':_['map'](_0x5d626e[_0xadbf('0x38')],function(_0x227885){var _0x1db020={};_0x1db020[_0x227885]={'$like':'%'+_0x570db7['query']['filter']+'%'};return _0x1db020;})});}_0x5d626e=_[_0xadbf('0x41')]({},_0x5d626e,_0x570db7[_0xadbf('0x43')]);return _0xa34365['getContacts'](_0x5d626e);}})['then'](respondWithResult(_0x201f2e,null))[_0xadbf('0x47')](handleError(_0x201f2e,null));};exports[_0xadbf('0x6f')]=function(_0x507784,_0x77f363,_0x6887c8){var _0x6d4cc5;var _0x515199;var _0x4ca093;var _0x5c64be=_0x507784['params']['id'];csv_results=[];return db['ContactItemType'][_0xadbf('0x45')]({'attributes':['id',_0xadbf('0x2d')],'raw':!![],'order':['OrderBy']})['then'](function(_0x1eb570){_0x6d4cc5=_0x1eb570;var _0x47adf9=_[_0xadbf('0x49')](db['CmContact'][_0xadbf('0x31')]);return db[_0xadbf('0x6b')][_0xadbf('0x45')]({'raw':!![],'attributes':['id',_0xadbf('0x70')]})[_0xadbf('0x27')](function(_0x1d6991){_0x515199=_0x1d6991;var _0x1118ab=squel[_0xadbf('0x71')]()[_0xadbf('0x3a')](_0x47adf9)['from']('cm_contacts','c')[_0xadbf('0x40')](_0xadbf('0x72'),_0x5c64be)[_0xadbf('0x40')](_0xadbf('0x73'))[_0xadbf('0x74')]();for(var _0x447141=0x0;_0x447141<_0x515199[_0xadbf('0x4a')];_0x447141++){_0x1118ab[_0xadbf('0x75')]('c.cf_'+_0x515199[_0x447141]['id'],_0xadbf('0x76')+_0x515199[_0x447141][_0xadbf('0x70')]);}for(var _0x447141=0x0;_0x447141<_0x6d4cc5[_0xadbf('0x4a')];_0x447141++){_0x1118ab['field'](squel[_0xadbf('0x71')]()['field']('item')['from'](_0xadbf('0x77'))['where'](_0xadbf('0x78'),_0x6d4cc5[_0x447141]['id'])[_0xadbf('0x40')]('CmContactId\x20=\x20c.id'),_0xadbf('0x79')+_0x6d4cc5[_0x447141][_0xadbf('0x2d')]);_0x1118ab['field'](squel['select']()[_0xadbf('0x75')](_0xadbf('0x7a'))[_0xadbf('0x7b')](_0xadbf('0x77'))[_0xadbf('0x40')](_0xadbf('0x78'),_0x6d4cc5[_0x447141]['id'])[_0xadbf('0x40')](_0xadbf('0x7c')),_0xadbf('0x7d')+_0x6d4cc5[_0x447141][_0xadbf('0x2d')]);}var _0x576609=[];_0x576609[_0xadbf('0x62')](_0x1118ab['toString']());BPromise['each'](_0x576609,handleQuery)[_0xadbf('0x27')](function(_0x53740f){handleQuery(_0x1118ab[_0xadbf('0x7e')]());var _0x37e60a=csv_results[0x0];if(!_[_0xadbf('0x7f')](_0x37e60a)){var _0x80f62f=toCsv(_0x37e60a);var _0x23bd7e=Date[_0xadbf('0x80')]();fs[_0xadbf('0x81')](util[_0xadbf('0x6d')](_0xadbf('0x82'),_0x5c64be,_0x23bd7e),_0x80f62f);_0x77f363[_0xadbf('0x83')]('Content-disposition',_0xadbf('0x84')+util[_0xadbf('0x6d')]('list_%d_%s.csv',_0x5c64be,_0x23bd7e));_0x77f363[_0xadbf('0x83')]('Content-type',_0xadbf('0x85'));return _0x77f363[_0xadbf('0x86')](util[_0xadbf('0x6d')](_0xadbf('0x82'),_0x5c64be,_0x23bd7e));}else{return _0x77f363[_0xadbf('0x1b')](0xcc);}});});});};exports['addCustomField']=function(_0x387b49,_0x4b3d07,_0x1a8940){var _0x525de2;delete _0x387b49[_0xadbf('0x4d')]['id'];return db[_0xadbf('0x30')][_0xadbf('0x5b')]({'where':{'id':_0x387b49['params']['id']}})[_0xadbf('0x27')](handleEntityNotFound(_0x4b3d07,null))[_0xadbf('0x27')](function(_0x2e6991){if(_0x2e6991){return db['sequelize'][_0xadbf('0x87')](function(_0x1628cb){return db['CmCustomField']['create'](_0x387b49['body'],{'transaction':_0x1628cb})[_0xadbf('0x27')](function(_0x1e5dd7){_0x525de2=_0x1e5dd7;return _0x2e6991['addCustomFields'](_0x1e5dd7,{'transaction':_0x1628cb});})[_0xadbf('0x27')](function(){var _0x26ad2c={'type':db[_0xadbf('0x88')][_0xadbf('0x89')],'transaction':_0x1628cb};switch(_0x387b49['body'][_0xadbf('0x33')]){case _0xadbf('0x8a'):_0x26ad2c[_0xadbf('0x33')]=db[_0xadbf('0x88')][_0xadbf('0x89')];break;case _0xadbf('0x8b'):_0x26ad2c[_0xadbf('0x33')]=db['Sequelize'][_0xadbf('0x8c')];break;case _0xadbf('0x8d'):_0x26ad2c[_0xadbf('0x33')]=db[_0xadbf('0x88')]['BOOLEAN'];_0x26ad2c[_0xadbf('0x8e')]=![];break;default:}return db[_0xadbf('0x8f')][_0xadbf('0x90')][_0xadbf('0x91')](_0xadbf('0x92'),util[_0xadbf('0x6d')](_0xadbf('0x93'),_0x525de2['id']),_0x26ad2c);})[_0xadbf('0x27')](function(){return _0x525de2;});});}})[_0xadbf('0x27')](respondWithResult(_0x4b3d07,null))[_0xadbf('0x47')](handleError(_0x4b3d07,null));};exports[_0xadbf('0x94')]=function(_0x44237e,_0x617f57,_0x4d45a8){var _0x8bc6d1={};var _0x3aa6a5={};var _0x356d93;var _0x400227;return db[_0xadbf('0x30')][_0xadbf('0x5b')]({'where':{'id':_0x44237e['params']['id']}})[_0xadbf('0x27')](handleEntityNotFound(_0x617f57,null))[_0xadbf('0x27')](function(_0x176453){if(_0x176453){_0x356d93=_0x176453;_0x3aa6a5[_0xadbf('0x39')]=_[_0xadbf('0x49')](db[_0xadbf('0x6b')][_0xadbf('0x31')]);_0x3aa6a5[_0xadbf('0x35')]=_[_0xadbf('0x49')](_0x44237e['query']);_0x3aa6a5['filters']=_[_0xadbf('0x37')](_0x3aa6a5[_0xadbf('0x39')],_0x3aa6a5[_0xadbf('0x35')]);_0x8bc6d1[_0xadbf('0x38')]=_[_0xadbf('0x37')](_0x3aa6a5[_0xadbf('0x39')],qs['fields'](_0x44237e['query'][_0xadbf('0x3a')]));_0x8bc6d1['attributes']=_0x8bc6d1[_0xadbf('0x38')][_0xadbf('0x4a')]?_0x8bc6d1['attributes']:_0x3aa6a5[_0xadbf('0x39')];_0x8bc6d1[_0xadbf('0x3d')]=qs[_0xadbf('0x3e')](_0x44237e[_0xadbf('0x35')][_0xadbf('0x3e')]);_0x8bc6d1[_0xadbf('0x40')]=qs[_0xadbf('0x36')](_[_0xadbf('0x3f')](_0x44237e[_0xadbf('0x35')],_0x3aa6a5[_0xadbf('0x36')]));_0x8bc6d1[_0xadbf('0x40')]=_['merge'](_0x8bc6d1[_0xadbf('0x40')],{'$or':[{'ListId':_0x176453['id']},{'ListId':null}]});if(_0x44237e[_0xadbf('0x35')][_0xadbf('0x42')]){_0x8bc6d1[_0xadbf('0x40')]=_[_0xadbf('0x41')](_0x8bc6d1[_0xadbf('0x40')],{'$or':_['map'](_0x8bc6d1[_0xadbf('0x38')],function(_0x41ae41){var _0x52cdf8={};_0x52cdf8[_0x41ae41]={'$like':'%'+_0x44237e[_0xadbf('0x35')]['filter']+'%'};return _0x52cdf8;})});}_0x8bc6d1=_['merge']({},_0x8bc6d1,_0x44237e['options']);return db[_0xadbf('0x6b')][_0xadbf('0x95')](_0x8bc6d1);}})[_0xadbf('0x27')](respondWithResult(_0x617f57,null))['catch'](handleError(_0x617f57,null));};exports[_0xadbf('0x96')]=function(_0x951cf1,_0x4183da){return db[_0xadbf('0x6b')][_0xadbf('0x95')]({'where':{'ListId':null}})[_0xadbf('0x27')](handleEntityNotFound(_0x4183da,null))['then'](function(_0x10c7df){return _0x10c7df;})[_0xadbf('0x27')](respondWithResult(_0x4183da,null))[_0xadbf('0x47')](handleError(_0x4183da,null));};exports[_0xadbf('0x97')]=function(_0x32cbd0,_0x340868,_0x2bb40c){return db[_0xadbf('0x30')][_0xadbf('0x52')]({'where':{'id':_0x32cbd0[_0xadbf('0x48')]['id']}})['then'](handleEntityNotFound(_0x340868,null))['then'](function(_0x11f12c){if(_0x11f12c){return _0x11f12c['addAgents'](_0x32cbd0[_0xadbf('0x4d')]['ids'],_['omit'](_0x32cbd0['body'],[_0xadbf('0x5d'),'id'])||{})[_0xadbf('0x98')](function(_0x1ab7d5){for(var _0x4af5c3=0x0;_0x4af5c3<_0x32cbd0[_0xadbf('0x4d')][_0xadbf('0x5d')]['length'];_0x4af5c3+=0x1){socket[_0xadbf('0x99')]('userCmList:save',{'UserId':Number(_0x32cbd0['body'][_0xadbf('0x5d')][_0x4af5c3]),'CmListId':Number(_0x32cbd0[_0xadbf('0x48')]['id'])});}return _0x1ab7d5;});}})[_0xadbf('0x27')](respondWithResult(_0x340868,null))[_0xadbf('0x47')](handleError(_0x340868,null));};exports[_0xadbf('0x9a')]=function(_0x556d91,_0xce1858,_0x456598){return db['CmList'][_0xadbf('0x52')]({'where':{'id':_0x556d91[_0xadbf('0x48')]['id']}})[_0xadbf('0x27')](handleEntityNotFound(_0xce1858,null))[_0xadbf('0x27')](function(_0x20360f){if(_0x20360f){return _0x20360f['removeAgents'](_0x556d91['query'][_0xadbf('0x5d')])[_0xadbf('0x27')](function(){if(_['isArray'](_0x556d91[_0xadbf('0x35')][_0xadbf('0x5d')])){for(var _0x339040=0x0;_0x339040<_0x556d91[_0xadbf('0x35')][_0xadbf('0x5d')][_0xadbf('0x4a')];_0x339040+=0x1){socket[_0xadbf('0x99')]('userCmList:remove',{'UserId':Number(_0x556d91['query'][_0xadbf('0x5d')][_0x339040]),'CmListId':Number(_0x556d91[_0xadbf('0x48')]['id'])});}}else{socket['emit'](_0xadbf('0x9b'),{'UserId':Number(_0x556d91[_0xadbf('0x35')][_0xadbf('0x5d')]),'CmListId':Number(_0x556d91[_0xadbf('0x48')]['id'])});}});}})[_0xadbf('0x27')](respondWithStatusCode(_0xce1858,null))[_0xadbf('0x47')](handleError(_0xce1858,null));};exports[_0xadbf('0x9c')]=function(_0x43720c,_0x5c47f2,_0x121841){var _0x4b826f={};var _0x2ec722={};var _0x73b541;var _0x4d8f95;return db[_0xadbf('0x30')][_0xadbf('0x5b')]({'where':{'id':_0x43720c['params']['id']}})[_0xadbf('0x27')](handleEntityNotFound(_0x5c47f2,null))[_0xadbf('0x27')](function(_0x4d6589){if(_0x4d6589){_0x73b541=_0x4d6589;_0x2ec722['model']=_['keys'](db[_0xadbf('0x9d')][_0xadbf('0x31')]);_0x2ec722[_0xadbf('0x35')]=_[_0xadbf('0x49')](_0x43720c[_0xadbf('0x35')]);_0x2ec722[_0xadbf('0x36')]=_['intersection'](_0x2ec722[_0xadbf('0x39')],_0x2ec722['query']);_0x4b826f[_0xadbf('0x38')]=_[_0xadbf('0x37')](_0x2ec722[_0xadbf('0x39')],qs[_0xadbf('0x3a')](_0x43720c[_0xadbf('0x35')][_0xadbf('0x3a')]));_0x4b826f['attributes']=_0x4b826f[_0xadbf('0x38')][_0xadbf('0x4a')]?_0x4b826f[_0xadbf('0x38')]:_0x2ec722[_0xadbf('0x39')];_0x4b826f[_0xadbf('0x3d')]=qs[_0xadbf('0x3e')](_0x43720c[_0xadbf('0x35')][_0xadbf('0x3e')]);_0x4b826f[_0xadbf('0x40')]=qs[_0xadbf('0x36')](_['pick'](_0x43720c[_0xadbf('0x35')],_0x2ec722[_0xadbf('0x36')]));if(_0x43720c[_0xadbf('0x35')][_0xadbf('0x42')]){_0x4b826f[_0xadbf('0x40')]=_[_0xadbf('0x41')](_0x4b826f[_0xadbf('0x40')],{'$or':_[_0xadbf('0x2f')](_0x4b826f[_0xadbf('0x38')],function(_0x1d3810){var _0x1d7bf5={};_0x1d7bf5[_0x1d3810]={'$like':'%'+_0x43720c[_0xadbf('0x35')][_0xadbf('0x42')]+'%'};return _0x1d7bf5;})});}_0x4b826f=_[_0xadbf('0x41')]({},_0x4b826f,_0x43720c[_0xadbf('0x43')]);return _0x73b541[_0xadbf('0x9c')](_0x4b826f);}})[_0xadbf('0x27')](function(_0x1dae8e){if(_0x1dae8e){_0x4d8f95=_0x1dae8e['length'];if(!_0x43720c[_0xadbf('0x35')][_0xadbf('0x3b')]('nolimit')){_0x4b826f[_0xadbf('0x21')]=qs[_0xadbf('0x21')](_0x43720c[_0xadbf('0x35')][_0xadbf('0x21')]);_0x4b826f['offset']=qs[_0xadbf('0x1e')](_0x43720c[_0xadbf('0x35')]['offset']);}return _0x73b541['getAgents'](_0x4b826f);}})[_0xadbf('0x27')](function(_0x23627e){if(_0x23627e){return _0x23627e?{'count':_0x4d8f95,'rows':_0x23627e}:null;}})['then'](respondWithResult(_0x5c47f2,null))[_0xadbf('0x47')](handleError(_0x5c47f2,null));};function handleQuery(_0x1491ad){logger[_0xadbf('0x9e')](_0x1491ad);return db[_0xadbf('0x8f')][_0xadbf('0x35')](_0x1491ad)[_0xadbf('0x98')](function(_0x3dad11){csv_results[_0xadbf('0x62')](_0x3dad11);})[_0xadbf('0x47')](function(_0x5609cd){logger[_0xadbf('0x54')](_0x5609cd[_0xadbf('0x68')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 1721f86..f9aead1 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 _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0x55ca,0x126));var _0xa55c=function(_0x5fe5ca,_0x4e92d3){_0x5fe5ca=_0x5fe5ca-0x0;var _0x42f45f=_0x55ca[_0x5fe5ca];return _0x42f45f;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x1d1b12,_0x22604b){var _0x5f26c8=function(_0x42c78d){while(--_0x42c78d){_0x1d1b12['push'](_0x1d1b12['shift']());}};_0x5f26c8(++_0x22604b);}(_0x814b,0x1a2));var _0xb814=function(_0x9a7ea6,_0x1807a2){_0x9a7ea6=_0x9a7ea6-0x0;var _0x1c2040=_0x814b[_0x9a7ea6];return _0x1c2040;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 1dae9b3..ba48bd5 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 _0xe14d=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','cm_lists','lodash'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xe14d,0x1ee));var _0xde14=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xe14d[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var logger=require(_0xde14('0x2'))(_0xde14('0x3'));var moment=require('moment');var BPromise=require(_0xde14('0x4'));var rp=require(_0xde14('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var attributes=require(_0xde14('0x8'));module[_0xde14('0x9')]=function(_0x461af3,_0xba1514){return _0x461af3['define']('CmList',attributes,{'tableName':_0xde14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x750a=['path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','util','moment','bluebird','request-promise'];(function(_0x1d73ab,_0x4db32c){var _0x2ed1df=function(_0x245cc6){while(--_0x245cc6){_0x1d73ab['push'](_0x1d73ab['shift']());}};_0x2ed1df(++_0x4db32c);}(_0x750a,0x140));var _0xa750=function(_0x1b1ad8,_0x2a4b7c){_0x1b1ad8=_0x1b1ad8-0x0;var _0x2bc059=_0x750a[_0x1b1ad8];return _0x2bc059;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa750('0x1'));var BPromise=require(_0xa750('0x2'));var rp=require(_0xa750('0x3'));var fs=require('fs');var path=require(_0xa750('0x4'));var rimraf=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var attributes=require(_0xa750('0x7'));module[_0xa750('0x8')]=function(_0x10b4d9,_0x2497df){return _0x10b4d9[_0xa750('0x9')](_0xa750('0xa'),attributes,{'tableName':_0xa750('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 167d694..1de9561 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 _0x4cf5=['localhost','socket.io-emitter','./cmList.socket','register','request','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults'];(function(_0x2378c0,_0x39eb52){var _0x28a3a6=function(_0xe94967){while(--_0xe94967){_0x2378c0['push'](_0x2378c0['shift']());}};_0x28a3a6(++_0x39eb52);}(_0x4cf5,0xaf));var _0x54cf=function(_0x39ad1e,_0x528c25){_0x39ad1e=_0x39ad1e-0x0;var _0x2c8b53=_0x4cf5[_0x39ad1e];return _0x2c8b53;};'use strict';var _=require(_0x54cf('0x0'));var util=require(_0x54cf('0x1'));var moment=require(_0x54cf('0x2'));var BPromise=require(_0x54cf('0x3'));var rs=require(_0x54cf('0x4'));var fs=require('fs');var Redis=require(_0x54cf('0x5'));var db=require(_0x54cf('0x6'))['db'];var utils=require(_0x54cf('0x7'));var logger=require('../../config/logger')(_0x54cf('0x8'));var config=require(_0x54cf('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x54cf('0xa')][_0x54cf('0xb')]({'port':0x232a});config[_0x54cf('0xc')]=_[_0x54cf('0xd')](config[_0x54cf('0xc')],{'host':_0x54cf('0xe'),'port':0x18eb});var socket=require(_0x54cf('0xf'))(new Redis(config[_0x54cf('0xc')]));require(_0x54cf('0x10'))[_0x54cf('0x11')](socket);function respondWithRpcPromise(_0x5dca6e,_0x188ecf,_0x3b1eb1){return new BPromise(function(_0xf69102,_0x2a588f){return client[_0x54cf('0x12')](_0x5dca6e,_0x3b1eb1)['then'](function(_0x4bdf77){logger['info'](_0x54cf('0x13'),_0x188ecf,_0x54cf('0x14'));logger[_0x54cf('0x15')]('CmList,\x20%s,\x20%s,\x20%s',_0x188ecf,_0x54cf('0x14'),JSON[_0x54cf('0x16')](_0x4bdf77));if(_0x4bdf77[_0x54cf('0x17')]){if(_0x4bdf77[_0x54cf('0x17')][_0x54cf('0x18')]===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0x188ecf,_0x4bdf77[_0x54cf('0x17')][_0x54cf('0x19')]);return _0x2a588f(_0x4bdf77['error'][_0x54cf('0x19')]);}logger[_0x54cf('0x17')]('CmList,\x20%s,\x20%s',_0x188ecf,_0x4bdf77[_0x54cf('0x17')][_0x54cf('0x19')]);return _0xf69102(_0x4bdf77['error'][_0x54cf('0x19')]);}else{logger[_0x54cf('0x1a')](_0x54cf('0x13'),_0x188ecf,_0x54cf('0x14'));_0xf69102(_0x4bdf77['result']['message']);}})['catch'](function(_0x3e7e5c){logger[_0x54cf('0x17')](_0x54cf('0x13'),_0x188ecf,_0x3e7e5c);_0x2a588f(_0x3e7e5c);});});} \ No newline at end of file +var _0xd3fb=['info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./cmList.socket','register','request','request\x20sent','debug','stringify','error','CmList,\x20%s,\x20%s','message'];(function(_0x45f426,_0x1db67b){var _0x3d1326=function(_0x1514a7){while(--_0x1514a7){_0x45f426['push'](_0x45f426['shift']());}};_0x3d1326(++_0x1db67b);}(_0xd3fb,0x17d));var _0xbd3f=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xd3fb[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0xbd3f('0x0'));var moment=require(_0xbd3f('0x1'));var BPromise=require(_0xbd3f('0x2'));var rs=require(_0xbd3f('0x3'));var fs=require('fs');var Redis=require(_0xbd3f('0x4'));var db=require(_0xbd3f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd3f('0x6'))(_0xbd3f('0x7'));var config=require(_0xbd3f('0x8'));var jayson=require(_0xbd3f('0x9'));var client=jayson[_0xbd3f('0xa')][_0xbd3f('0xb')]({'port':0x232a});config[_0xbd3f('0xc')]=_[_0xbd3f('0xd')](config[_0xbd3f('0xc')],{'host':_0xbd3f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbd3f('0xc')]));require(_0xbd3f('0xf'))[_0xbd3f('0x10')](socket);function respondWithRpcPromise(_0x21f630,_0x1147b3,_0x578d81){return new BPromise(function(_0x506fd0,_0x318e01){return client[_0xbd3f('0x11')](_0x21f630,_0x578d81)['then'](function(_0x38015c){logger['info']('CmList,\x20%s,\x20%s',_0x1147b3,_0xbd3f('0x12'));logger[_0xbd3f('0x13')]('CmList,\x20%s,\x20%s,\x20%s',_0x1147b3,_0xbd3f('0x12'),JSON[_0xbd3f('0x14')](_0x38015c));if(_0x38015c['error']){if(_0x38015c[_0xbd3f('0x15')]['code']===0x1f4){logger['error'](_0xbd3f('0x16'),_0x1147b3,_0x38015c[_0xbd3f('0x15')][_0xbd3f('0x17')]);return _0x318e01(_0x38015c[_0xbd3f('0x15')][_0xbd3f('0x17')]);}logger[_0xbd3f('0x15')]('CmList,\x20%s,\x20%s',_0x1147b3,_0x38015c[_0xbd3f('0x15')]['message']);return _0x506fd0(_0x38015c[_0xbd3f('0x15')][_0xbd3f('0x17')]);}else{logger[_0xbd3f('0x18')](_0xbd3f('0x16'),_0x1147b3,_0xbd3f('0x12'));_0x506fd0(_0x38015c[_0xbd3f('0x19')][_0xbd3f('0x17')]);}})[_0xbd3f('0x1a')](function(_0x457332){logger['error']('CmList,\x20%s,\x20%s',_0x1147b3,_0x457332);_0x318e01(_0x457332);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index ceb0b09..121d571 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 _0x7bbf=['emit','removeListener','register','./cmList.events','save','remove','update'];(function(_0x13e1e1,_0x18c2eb){var _0x4298f9=function(_0x301e70){while(--_0x301e70){_0x13e1e1['push'](_0x13e1e1['shift']());}};_0x4298f9(++_0x18c2eb);}(_0x7bbf,0xce));var _0xf7bb=function(_0x48fd01,_0x35518f){_0x48fd01=_0x48fd01-0x0;var _0x1002f5=_0x7bbf[_0x48fd01];return _0x1002f5;};'use strict';var CmListEvents=require(_0xf7bb('0x0'));var events=[_0xf7bb('0x1'),_0xf7bb('0x2'),_0xf7bb('0x3')];function createListener(_0x57ebba,_0x2b05ef){return function(_0x5abac7){_0x2b05ef[_0xf7bb('0x4')](_0x57ebba,_0x5abac7);};}function removeListener(_0x1901a6,_0x3e20e8){return function(){CmListEvents[_0xf7bb('0x5')](_0x1901a6,_0x3e20e8);};}exports[_0xf7bb('0x6')]=function(_0x30d181){for(var _0x64f263=0x0,_0x565ef6=events['length'];_0x64f263<_0x565ef6;_0x64f263++){var _0x18a591=events[_0x64f263];var _0x24a9fc=createListener('cmList:'+_0x18a591,_0x30d181);CmListEvents['on'](_0x18a591,_0x24a9fc);}}; \ No newline at end of file +var _0x4770=['register','cmList:','save','update','removeListener'];(function(_0x1d2a74,_0x5ec11c){var _0x2c937a=function(_0x165eb1){while(--_0x165eb1){_0x1d2a74['push'](_0x1d2a74['shift']());}};_0x2c937a(++_0x5ec11c);}(_0x4770,0xf2));var _0x0477=function(_0x223124,_0x5607d3){_0x223124=_0x223124-0x0;var _0x391c38=_0x4770[_0x223124];return _0x391c38;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x0477('0x0'),'remove',_0x0477('0x1')];function createListener(_0x35bbee,_0x4f354f){return function(_0x2ee803){_0x4f354f['emit'](_0x35bbee,_0x2ee803);};}function removeListener(_0x11f522,_0x3d4c46){return function(){CmListEvents[_0x0477('0x2')](_0x11f522,_0x3d4c46);};}exports[_0x0477('0x3')]=function(_0x373e35){for(var _0x40c4d5=0x0,_0x2e0f58=events['length'];_0x40c4d5<_0x2e0f58;_0x40c4d5++){var _0x1c366e=events[_0x40c4d5];var _0x2701a6=createListener(_0x0477('0x4')+_0x1c366e,_0x373e35);CmListEvents['on'](_0x1c366e,_0x2701a6);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 7178911..384aa4b 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 _0xfb30=['/:id/users','addAgents','put','delete','destroy','removeDispositions','removeAgents','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','getGlobalCustomFields','/:id','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','getAgents','post','create'];(function(_0x48f99c,_0xad646d){var _0x2d5e7e=function(_0x28cc49){while(--_0x28cc49){_0x48f99c['push'](_0x48f99c['shift']());}};_0x2d5e7e(++_0xad646d);}(_0xfb30,0x88));var _0x0fb3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xfb30[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x0fb3('0x0'));var util=require(_0x0fb3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0fb3('0x2'));var router=express['Router']();var fs_extra=require(_0x0fb3('0x3'));var auth=require(_0x0fb3('0x4'));var interaction=require(_0x0fb3('0x5'));var config=require(_0x0fb3('0x6'));var controller=require(_0x0fb3('0x7'));router[_0x0fb3('0x8')]('/',auth[_0x0fb3('0x9')](),controller[_0x0fb3('0xa')]);router[_0x0fb3('0x8')](_0x0fb3('0xb'),auth[_0x0fb3('0x9')](),controller['describe']);router[_0x0fb3('0x8')]('/global_fields',auth[_0x0fb3('0x9')](),controller[_0x0fb3('0xc')]);router[_0x0fb3('0x8')](_0x0fb3('0xd'),auth[_0x0fb3('0x9')](),controller['show']);router['get'](_0x0fb3('0xe'),auth[_0x0fb3('0x9')](),controller[_0x0fb3('0xf')]);router[_0x0fb3('0x8')]('/:id/contacts',auth[_0x0fb3('0x9')](),controller[_0x0fb3('0x10')]);router['get'](_0x0fb3('0x11'),auth[_0x0fb3('0x9')](),controller[_0x0fb3('0x12')]);router[_0x0fb3('0x8')](_0x0fb3('0x13'),auth[_0x0fb3('0x9')](),controller[_0x0fb3('0x14')]);router[_0x0fb3('0x8')]('/:id/users',auth[_0x0fb3('0x9')](),controller[_0x0fb3('0x15')]);router[_0x0fb3('0x16')]('/',auth[_0x0fb3('0x9')](),controller[_0x0fb3('0x17')]);router[_0x0fb3('0x16')](_0x0fb3('0xe'),auth[_0x0fb3('0x9')](),controller['addDisposition']);router[_0x0fb3('0x16')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router[_0x0fb3('0x16')](_0x0fb3('0x13'),auth[_0x0fb3('0x9')](),controller['addCustomField']);router[_0x0fb3('0x16')](_0x0fb3('0x18'),auth[_0x0fb3('0x9')](),controller[_0x0fb3('0x19')]);router[_0x0fb3('0x1a')](_0x0fb3('0xd'),auth[_0x0fb3('0x9')](),controller['update']);router[_0x0fb3('0x1b')](_0x0fb3('0xd'),auth[_0x0fb3('0x9')](),controller[_0x0fb3('0x1c')]);router[_0x0fb3('0x1b')](_0x0fb3('0xe'),auth['isAuthenticated'](),controller[_0x0fb3('0x1d')]);router[_0x0fb3('0x1b')](_0x0fb3('0x18'),auth[_0x0fb3('0x9')](),controller[_0x0fb3('0x1e')]);module[_0x0fb3('0x1f')]=router; \ No newline at end of file +var _0x94c9=['addContacts','addCustomField','/:id/users','addAgents','put','update','delete','removeDispositions','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','create','addDisposition','post'];(function(_0x47d732,_0x14aa71){var _0x31dcbc=function(_0x3f6dc5){while(--_0x3f6dc5){_0x47d732['push'](_0x47d732['shift']());}};_0x31dcbc(++_0x14aa71);}(_0x94c9,0x1dd));var _0x994c=function(_0x185a67,_0x244aa7){_0x185a67=_0x185a67-0x0;var _0x95a3f4=_0x94c9[_0x185a67];return _0x95a3f4;};'use strict';var multer=require(_0x994c('0x0'));var util=require(_0x994c('0x1'));var path=require(_0x994c('0x2'));var timeout=require('connect-timeout');var express=require(_0x994c('0x3'));var router=express[_0x994c('0x4')]();var fs_extra=require(_0x994c('0x5'));var auth=require(_0x994c('0x6'));var interaction=require(_0x994c('0x7'));var config=require('../../config/environment');var controller=require(_0x994c('0x8'));router[_0x994c('0x9')]('/',auth[_0x994c('0xa')](),controller[_0x994c('0xb')]);router[_0x994c('0x9')](_0x994c('0xc'),auth[_0x994c('0xa')](),controller[_0x994c('0xd')]);router['get'](_0x994c('0xe'),auth[_0x994c('0xa')](),controller[_0x994c('0xf')]);router[_0x994c('0x9')](_0x994c('0x10'),auth[_0x994c('0xa')](),controller[_0x994c('0x11')]);router[_0x994c('0x9')](_0x994c('0x12'),auth[_0x994c('0xa')](),controller[_0x994c('0x13')]);router[_0x994c('0x9')]('/:id/contacts',auth[_0x994c('0xa')](),controller[_0x994c('0x14')]);router[_0x994c('0x9')](_0x994c('0x15'),auth[_0x994c('0xa')](),controller['getContactsCsv']);router[_0x994c('0x9')](_0x994c('0x16'),auth[_0x994c('0xa')](),controller[_0x994c('0x17')]);router[_0x994c('0x9')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x994c('0xa')](),controller[_0x994c('0x18')]);router['post'](_0x994c('0x12'),auth[_0x994c('0xa')](),controller[_0x994c('0x19')]);router[_0x994c('0x1a')]('/:id/contacts',auth[_0x994c('0xa')](),controller[_0x994c('0x1b')]);router[_0x994c('0x1a')](_0x994c('0x16'),auth[_0x994c('0xa')](),controller[_0x994c('0x1c')]);router[_0x994c('0x1a')](_0x994c('0x1d'),auth[_0x994c('0xa')](),controller[_0x994c('0x1e')]);router[_0x994c('0x1f')](_0x994c('0x10'),auth[_0x994c('0xa')](),controller[_0x994c('0x20')]);router[_0x994c('0x21')](_0x994c('0x10'),auth[_0x994c('0xa')](),controller['destroy']);router[_0x994c('0x21')](_0x994c('0x12'),auth[_0x994c('0xa')](),controller[_0x994c('0x22')]);router[_0x994c('0x21')](_0x994c('0x1d'),auth[_0x994c('0xa')](),controller['removeAgents']);module[_0x994c('0x23')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index bf51147..cddbdc1 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 _0x7db8=['field','STRING','exports','VIRTUAL'];(function(_0x185d4c,_0x541480){var _0x413709=function(_0x828720){while(--_0x828720){_0x185d4c['push'](_0x185d4c['shift']());}};_0x413709(++_0x541480);}(_0x7db8,0x122));var _0x87db=function(_0x157e04,_0x56e521){_0x157e04=_0x157e04-0x0;var _0x499987=_0x7db8[_0x157e04];return _0x499987;};'use strict';var Sequelize=require('sequelize');module[_0x87db('0x0')]={'name':{'type':Sequelize[_0x87db('0x1')],'get':function(_0x38fc76){return this['getDataValue'](_0x87db('0x2'));}},'field':{'type':Sequelize[_0x87db('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x87db('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x87db('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x25fd=['STRING','sequelize','VIRTUAL','getDataValue','field'];(function(_0x578c21,_0x162330){var _0x48ae7b=function(_0xb9cde3){while(--_0xb9cde3){_0x578c21['push'](_0x578c21['shift']());}};_0x48ae7b(++_0x162330);}(_0x25fd,0x1b9));var _0xd25f=function(_0x1c6873,_0x96f1aa){_0x1c6873=_0x1c6873-0x0;var _0x31dac9=_0x25fd[_0x1c6873];return _0x31dac9;};'use strict';var Sequelize=require(_0xd25f('0x0'));module['exports']={'name':{'type':Sequelize[_0xd25f('0x1')],'get':function(_0xfbf32d){return this[_0xd25f('0x2')](_0xd25f('0x3'));}},'field':{'type':Sequelize[_0xd25f('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xd25f('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 5383150..ef9719b 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x4ec9a5,_0x1ac9a2){var _0x513e8d=function(_0x35aded){while(--_0x35aded){_0x4ec9a5['push'](_0x4ec9a5['shift']());}};_0x513e8d(++_0x1ac9a2);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _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(_0x169fd6,_0x5ad6d2){var _0x3e6a90=function(_0x243e46){while(--_0x243e46){_0x169fd6['push'](_0x169fd6['shift']());}};_0x3e6a90(++_0x5ad6d2);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 9a89721..9943880 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 _0x975f=['rimraf','../../config/environment','./condition.attributes','exports','Condition','tools_conditions','lodash','util','api','moment','request-promise','path'];(function(_0x24d6e5,_0x8cb8af){var _0x5b85c1=function(_0x179381){while(--_0x179381){_0x24d6e5['push'](_0x24d6e5['shift']());}};_0x5b85c1(++_0x8cb8af);}(_0x975f,0x156));var _0xf975=function(_0x1428d9,_0xded63c){_0x1428d9=_0x1428d9-0x0;var _0x438019=_0x975f[_0x1428d9];return _0x438019;};'use strict';var _=require(_0xf975('0x0'));var util=require(_0xf975('0x1'));var logger=require('../../config/logger')(_0xf975('0x2'));var moment=require(_0xf975('0x3'));var BPromise=require('bluebird');var rp=require(_0xf975('0x4'));var fs=require('fs');var path=require(_0xf975('0x5'));var rimraf=require(_0xf975('0x6'));var config=require(_0xf975('0x7'));var attributes=require(_0xf975('0x8'));module[_0xf975('0x9')]=function(_0x574dfb,_0xd325d2){return _0x574dfb['define'](_0xf975('0xa'),attributes,{'tableName':_0xf975('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39f0=['request-promise','path','rimraf','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1cff16,_0x5d25e3){var _0x1ab256=function(_0x4110aa){while(--_0x4110aa){_0x1cff16['push'](_0x1cff16['shift']());}};_0x1ab256(++_0x5d25e3);}(_0x39f0,0xe8));var _0x039f=function(_0x67acd2,_0x49abcb){_0x67acd2=_0x67acd2-0x0;var _0x2cd246=_0x39f0[_0x67acd2];return _0x2cd246;};'use strict';var _=require(_0x039f('0x0'));var util=require(_0x039f('0x1'));var logger=require(_0x039f('0x2'))(_0x039f('0x3'));var moment=require(_0x039f('0x4'));var BPromise=require(_0x039f('0x5'));var rp=require(_0x039f('0x6'));var fs=require('fs');var path=require(_0x039f('0x7'));var rimraf=require(_0x039f('0x8'));var config=require('../../config/environment');var attributes=require(_0x039f('0x9'));module[_0x039f('0xa')]=function(_0x165923,_0x5cfc83){return _0x165923[_0x039f('0xb')](_0x039f('0xc'),attributes,{'tableName':_0x039f('0xd'),'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 4e2fcd0..198183d 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 _0x3807=['catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','client','http','request','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x97eb67,_0x183cbf){var _0x544ced=function(_0x20481a){while(--_0x20481a){_0x97eb67['push'](_0x97eb67['shift']());}};_0x544ced(++_0x183cbf);}(_0x3807,0xfd));var _0x7380=function(_0x123afa,_0x4e5c4e){_0x123afa=_0x123afa-0x0;var _0x58f934=_0x3807[_0x123afa];return _0x58f934;};'use strict';var _=require(_0x7380('0x0'));var util=require(_0x7380('0x1'));var moment=require(_0x7380('0x2'));var BPromise=require(_0x7380('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7380('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7380('0x5'));var logger=require('../../config/logger')(_0x7380('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7380('0x7')][_0x7380('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bfa0e,_0xe41b81,_0x835357){return new BPromise(function(_0x172e91,_0x2af221){return client[_0x7380('0x9')](_0x1bfa0e,_0x835357)[_0x7380('0xa')](function(_0x3c4a3f){logger[_0x7380('0xb')](_0x7380('0xc'),_0xe41b81,'request\x20sent');logger[_0x7380('0xd')](_0x7380('0xe'),_0xe41b81,_0x7380('0xf'),JSON['stringify'](_0x3c4a3f));if(_0x3c4a3f[_0x7380('0x10')]){if(_0x3c4a3f[_0x7380('0x10')][_0x7380('0x11')]===0x1f4){logger[_0x7380('0x10')](_0x7380('0xc'),_0xe41b81,_0x3c4a3f[_0x7380('0x10')][_0x7380('0x12')]);return _0x2af221(_0x3c4a3f['error'][_0x7380('0x12')]);}logger[_0x7380('0x10')](_0x7380('0xc'),_0xe41b81,_0x3c4a3f[_0x7380('0x10')][_0x7380('0x12')]);return _0x172e91(_0x3c4a3f['error'][_0x7380('0x12')]);}else{logger[_0x7380('0xb')](_0x7380('0xc'),_0xe41b81,_0x7380('0xf'));_0x172e91(_0x3c4a3f[_0x7380('0x13')][_0x7380('0x12')]);}})[_0x7380('0x14')](function(_0x33cb58){logger[_0x7380('0x10')](_0x7380('0xc'),_0xe41b81,_0x33cb58);_0x2af221(_0x33cb58);});});} \ No newline at end of file +var _0x51d9=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','moment','bluebird','randomstring','ioredis'];(function(_0x5af59e,_0x3771c1){var _0x4240df=function(_0x2267fd){while(--_0x2267fd){_0x5af59e['push'](_0x5af59e['shift']());}};_0x4240df(++_0x3771c1);}(_0x51d9,0x106));var _0x951d=function(_0x26fa6f,_0x331c69){_0x26fa6f=_0x26fa6f-0x0;var _0x34c23c=_0x51d9[_0x26fa6f];return _0x34c23c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x951d('0x0'));var BPromise=require(_0x951d('0x1'));var rs=require(_0x951d('0x2'));var fs=require('fs');var Redis=require(_0x951d('0x3'));var db=require(_0x951d('0x4'))['db'];var utils=require(_0x951d('0x5'));var logger=require(_0x951d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x951d('0x7'));var client=jayson['client'][_0x951d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x407c79,_0x24be89,_0x492231){return new BPromise(function(_0x48e4b5,_0x954f77){return client['request'](_0x407c79,_0x492231)[_0x951d('0x9')](function(_0x536904){logger[_0x951d('0xa')](_0x951d('0xb'),_0x24be89,_0x951d('0xc'));logger[_0x951d('0xd')](_0x951d('0xe'),_0x24be89,_0x951d('0xc'),JSON[_0x951d('0xf')](_0x536904));if(_0x536904[_0x951d('0x10')]){if(_0x536904[_0x951d('0x10')]['code']===0x1f4){logger['error'](_0x951d('0xb'),_0x24be89,_0x536904[_0x951d('0x10')][_0x951d('0x11')]);return _0x954f77(_0x536904[_0x951d('0x10')]['message']);}logger['error']('Condition,\x20%s,\x20%s',_0x24be89,_0x536904[_0x951d('0x10')][_0x951d('0x11')]);return _0x48e4b5(_0x536904[_0x951d('0x10')][_0x951d('0x11')]);}else{logger[_0x951d('0xa')](_0x951d('0xb'),_0x24be89,_0x951d('0xc'));_0x48e4b5(_0x536904[_0x951d('0x12')][_0x951d('0x11')]);}})['catch'](function(_0x1f3c6b){logger[_0x951d('0x10')](_0x951d('0xb'),_0x24be89,_0x1f3c6b);_0x954f77(_0x1f3c6b);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 8e4e95a..d1c359a 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 _0xf3d8=['../../components/interaction/service','../../config/environment','/:id','update','delete','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x136a19,_0x2ee0cc){var _0x26c0f8=function(_0xdbf3){while(--_0xdbf3){_0x136a19['push'](_0x136a19['shift']());}};_0x26c0f8(++_0x2ee0cc);}(_0xf3d8,0xad));var _0x8f3d=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xf3d8[_0x543084];return _0x306a57;};'use strict';var multer=require(_0x8f3d('0x0'));var util=require(_0x8f3d('0x1'));var path=require(_0x8f3d('0x2'));var timeout=require(_0x8f3d('0x3'));var express=require(_0x8f3d('0x4'));var router=express[_0x8f3d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8f3d('0x6'));var interaction=require(_0x8f3d('0x7'));var config=require(_0x8f3d('0x8'));var controller=require('./condition.controller');router['put'](_0x8f3d('0x9'),auth['isAuthenticated'](),controller[_0x8f3d('0xa')]);router[_0x8f3d('0xb')](_0x8f3d('0x9'),auth[_0x8f3d('0xc')](),controller[_0x8f3d('0xd')]);module[_0x8f3d('0xe')]=router; \ No newline at end of file +var _0x2eda=['isAuthenticated','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id'];(function(_0x5e9d5c,_0x4e7595){var _0x26970f=function(_0x4ab4e1){while(--_0x4ab4e1){_0x5e9d5c['push'](_0x5e9d5c['shift']());}};_0x26970f(++_0x4e7595);}(_0x2eda,0xb8));var _0xa2ed=function(_0x239d9f,_0x4f5a4b){_0x239d9f=_0x239d9f-0x0;var _0x12422a=_0x2eda[_0x239d9f];return _0x12422a;};'use strict';var multer=require(_0xa2ed('0x0'));var util=require(_0xa2ed('0x1'));var path=require(_0xa2ed('0x2'));var timeout=require(_0xa2ed('0x3'));var express=require('express');var router=express[_0xa2ed('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa2ed('0x5'));var interaction=require(_0xa2ed('0x6'));var config=require(_0xa2ed('0x7'));var controller=require(_0xa2ed('0x8'));router[_0xa2ed('0x9')](_0xa2ed('0xa'),auth[_0xa2ed('0xb')](),controller[_0xa2ed('0xc')]);router['delete'](_0xa2ed('0xa'),auth[_0xa2ed('0xb')](),controller[_0xa2ed('0xd')]);module[_0xa2ed('0xe')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 4264dd0..bb480dc 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 _0x50c3=['STRING','name','INTEGER','sequelize','exports'];(function(_0x34506b,_0x1d2c6f){var _0x3c77a4=function(_0xef19b1){while(--_0xef19b1){_0x34506b['push'](_0x34506b['shift']());}};_0x3c77a4(++_0x1d2c6f);}(_0x50c3,0x7b));var _0x350c=function(_0x52b54b,_0x47f996){_0x52b54b=_0x52b54b-0x0;var _0x1c9573=_0x50c3[_0x52b54b];return _0x1c9573;};'use strict';var Sequelize=require(_0x350c('0x0'));module[_0x350c('0x1')]={'name':{'type':Sequelize[_0x350c('0x2')],'allowNull':![],'unique':_0x350c('0x3')},'OrderBy':{'type':Sequelize[_0x350c('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x2ff0=['STRING','name','INTEGER','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2ff0,0x80));var _0x02ff=function(_0x4e8823,_0x1767d8){_0x4e8823=_0x4e8823-0x0;var _0x42cd85=_0x2ff0[_0x4e8823];return _0x42cd85;};'use strict';var Sequelize=require(_0x02ff('0x0'));module[_0x02ff('0x1')]={'name':{'type':Sequelize[_0x02ff('0x2')],'allowNull':![],'unique':_0x02ff('0x3')},'OrderBy':{'type':Sequelize[_0x02ff('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x02ff('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index e2d8a6d..46f8204 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 _0x2032=['limit','count','set','Content-Range','apply','save','then','destroy','get','ContactItemTypes','sendStatus','error','stack','name','send','index','map','ContactItemType','fieldName','model','query','keys','filters','intersection','attributes','fields','nolimit','order','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','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','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined'];(function(_0x11d2a2,_0x15abec){var _0x7d6d26=function(_0x34975b){while(--_0x34975b){_0x11d2a2['push'](_0x11d2a2['shift']());}};_0x7d6d26(++_0x15abec);}(_0x2032,0xd9));var _0x2203=function(_0x328104,_0x1ab674){_0x328104=_0x328104-0x0;var _0x33a60c=_0x2032[_0x328104];return _0x33a60c;};'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(){var _0x1244f4=_0x2718f5[_0x2203('0x25')]({'plain':!![]});var _0x49c12=_0x2203('0x26');return db['UserProfileResource'][_0x2203('0x24')]({'where':{'type':_0x49c12,'resourceId':_0x1244f4['id']}})[_0x2203('0x23')](function(){return _0x2718f5;});})[_0x2203('0x23')](function(){_0x5c8da9['status'](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x1cec17,_0x5c5fd3){return function(_0xd6e109){if(!_0xd6e109){_0x1cec17[_0x2203('0x27')](0x194);}return _0xd6e109;};}function handleError(_0x1c6a77,_0x46b8b9){_0x46b8b9=_0x46b8b9||0x1f4;return function(_0x28ae02){logger[_0x2203('0x28')](_0x28ae02[_0x2203('0x29')]);if(_0x28ae02['name']){delete _0x28ae02[_0x2203('0x2a')];}_0x1c6a77[_0x2203('0x19')](_0x46b8b9)[_0x2203('0x2b')](_0x28ae02);};}exports[_0x2203('0x2c')]=function(_0x52a426,_0x3a8e23){var _0x21ff0d={},_0x287c95={},_0xf59954={'count':0x0,'rows':[]};var _0x520602=_[_0x2203('0x2d')](db[_0x2203('0x2e')]['rawAttributes'],function(_0x5c0157){return{'name':_0x5c0157[_0x2203('0x2f')],'type':_0x5c0157['type']['key']};});_0x287c95[_0x2203('0x30')]=_[_0x2203('0x2d')](_0x520602,_0x2203('0x2a'));_0x287c95[_0x2203('0x31')]=_[_0x2203('0x32')](_0x52a426['query']);_0x287c95[_0x2203('0x33')]=_[_0x2203('0x34')](_0x287c95['model'],_0x287c95[_0x2203('0x31')]);_0x21ff0d[_0x2203('0x35')]=_[_0x2203('0x34')](_0x287c95[_0x2203('0x30')],qs[_0x2203('0x36')](_0x52a426[_0x2203('0x31')][_0x2203('0x36')]));_0x21ff0d[_0x2203('0x35')]=_0x21ff0d[_0x2203('0x35')]['length']?_0x21ff0d[_0x2203('0x35')]:_0x287c95[_0x2203('0x30')];if(!_0x52a426['query']['hasOwnProperty'](_0x2203('0x37'))){_0x21ff0d['limit']=qs[_0x2203('0x1d')](_0x52a426[_0x2203('0x31')][_0x2203('0x1d')]);_0x21ff0d['offset']=qs['offset'](_0x52a426[_0x2203('0x31')]['offset']);}_0x21ff0d[_0x2203('0x38')]=qs['sort'](_0x52a426[_0x2203('0x31')]['sort']);_0x21ff0d[_0x2203('0x39')]=qs[_0x2203('0x33')](_[_0x2203('0x3a')](_0x52a426[_0x2203('0x31')],_0x287c95[_0x2203('0x33')]),_0x520602);if(_0x52a426['query']['filter']){_0x21ff0d['where']=_[_0x2203('0x3b')](_0x21ff0d[_0x2203('0x39')],{'$or':_[_0x2203('0x2d')](_0x520602,function(_0x3b0c7a){if(_0x3b0c7a[_0x2203('0x3c')]!==_0x2203('0x3d')){var _0x1c7e3d={};_0x1c7e3d[_0x3b0c7a['name']]={'$like':'%'+_0x52a426[_0x2203('0x31')][_0x2203('0x3e')]+'%'};return _0x1c7e3d;}})});}_0x21ff0d=_[_0x2203('0x3b')]({},_0x21ff0d,_0x52a426[_0x2203('0x3f')]);var _0x493d12={'where':_0x21ff0d['where']};return db[_0x2203('0x2e')]['count'](_0x493d12)[_0x2203('0x23')](function(_0x446209){_0xf59954[_0x2203('0x1e')]=_0x446209;if(_0x52a426['query']['includeAll']){_0x21ff0d[_0x2203('0x40')]=[{'all':!![]}];}return db[_0x2203('0x2e')][_0x2203('0x41')](_0x21ff0d);})[_0x2203('0x23')](function(_0x372709){_0xf59954[_0x2203('0x42')]=_0x372709;return _0xf59954;})['then'](respondWithFilteredResult(_0x3a8e23,_0x21ff0d))[_0x2203('0x43')](handleError(_0x3a8e23,null));};exports[_0x2203('0x44')]=function(_0x3a866c,_0x266076){var _0x16b452={'raw':!![],'where':{'id':_0x3a866c[_0x2203('0x45')]['id']}},_0x36b99f={};_0x36b99f[_0x2203('0x30')]=_[_0x2203('0x32')](db[_0x2203('0x2e')]['rawAttributes']);_0x36b99f[_0x2203('0x31')]=_[_0x2203('0x32')](_0x3a866c[_0x2203('0x31')]);_0x36b99f[_0x2203('0x33')]=_['intersection'](_0x36b99f['model'],_0x36b99f[_0x2203('0x31')]);_0x16b452['attributes']=_[_0x2203('0x34')](_0x36b99f[_0x2203('0x30')],qs[_0x2203('0x36')](_0x3a866c[_0x2203('0x31')]['fields']));_0x16b452[_0x2203('0x35')]=_0x16b452[_0x2203('0x35')]['length']?_0x16b452[_0x2203('0x35')]:_0x36b99f[_0x2203('0x30')];if(_0x3a866c[_0x2203('0x31')][_0x2203('0x46')]){_0x16b452['include']=[{'all':!![]}];}_0x16b452=_['merge']({},_0x16b452,_0x3a866c[_0x2203('0x3f')]);return db['ContactItemType']['find'](_0x16b452)[_0x2203('0x23')](handleEntityNotFound(_0x266076,null))[_0x2203('0x23')](respondWithResult(_0x266076,null))[_0x2203('0x43')](handleError(_0x266076,null));};exports['create']=function(_0x4c1496,_0x131aec){return db[_0x2203('0x2e')][_0x2203('0x47')](_0x4c1496[_0x2203('0x48')],{})[_0x2203('0x23')](function(_0x21fd78){var _0x4a7f4e=_0x4c1496[_0x2203('0x49')]['get']({'plain':!![]});if(!_0x4a7f4e)throw new Error(_0x2203('0x4a'));if(_0x4a7f4e[_0x2203('0x4b')]===_0x2203('0x49')){var _0x1e49dd=_0x21fd78['get']({'plain':!![]});var _0x506795=_0x2203('0x26');return db[_0x2203('0x4c')][_0x2203('0x4d')]({'where':{'name':_0x506795,'userProfileId':_0x4a7f4e[_0x2203('0x4e')]},'raw':!![]})['then'](function(_0x4de47a){if(_0x4de47a&&_0x4de47a['autoAssociation']===0x0){return db[_0x2203('0x4f')][_0x2203('0x47')]({'name':_0x1e49dd['name'],'resourceId':_0x1e49dd['id'],'type':_0x4de47a[_0x2203('0x2a')],'sectionId':_0x4de47a['id']},{})[_0x2203('0x23')](function(){return _0x21fd78;});}else{return _0x21fd78;}})['catch'](function(_0x32b1db){logger[_0x2203('0x28')](_0x2203('0x50'),_0x32b1db);throw _0x32b1db;});}return _0x21fd78;})[_0x2203('0x23')](respondWithResult(_0x131aec,0xc9))['catch'](handleError(_0x131aec,null));};exports[_0x2203('0x51')]=function(_0x5268d6,_0x3858f0){if(_0x5268d6[_0x2203('0x48')]['id']){delete _0x5268d6['body']['id'];}return db[_0x2203('0x2e')][_0x2203('0x4d')]({'where':{'id':_0x5268d6[_0x2203('0x45')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x3858f0,null))[_0x2203('0x23')](saveUpdates(_0x5268d6[_0x2203('0x48')],null))['then'](respondWithResult(_0x3858f0,null))['catch'](handleError(_0x3858f0,null));};exports[_0x2203('0x24')]=function(_0x524356,_0x56e881){return db[_0x2203('0x2e')][_0x2203('0x4d')]({'where':{'id':_0x524356[_0x2203('0x45')]['id']}})['then'](handleEntityNotFound(_0x56e881,null))[_0x2203('0x23')](db['CmContactHasItem']['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x524356[_0x2203('0x45')]['id']}}))['then'](removeEntity(_0x56e881,null))['catch'](handleError(_0x56e881,null));}; \ No newline at end of file +var _0xbbbc=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','ContactItemType','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','fields','include','options','create','body','user','ContactItemTypes','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x531073,_0x7f076c){var _0x1b6566=function(_0x36455d){while(--_0x36455d){_0x531073['push'](_0x531073['shift']());}};_0x1b6566(++_0x7f076c);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x54d1ae,_0x56a2b9){_0x54d1ae=_0x54d1ae-0x0;var _0x5b033b=_0xbbbc[_0x54d1ae];return _0x5b033b;};'use strict';var emlformat=require(_0xcbbb('0x0'));var rimraf=require(_0xcbbb('0x1'));var zipdir=require(_0xcbbb('0x2'));var jsonpatch=require(_0xcbbb('0x3'));var rp=require(_0xcbbb('0x4'));var moment=require(_0xcbbb('0x5'));var BPromise=require(_0xcbbb('0x6'));var Mustache=require('mustache');var util=require(_0xcbbb('0x7'));var path=require(_0xcbbb('0x8'));var sox=require(_0xcbbb('0x9'));var csv=require(_0xcbbb('0xa'));var ejs=require(_0xcbbb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbbb('0xc'));var squel=require(_0xcbbb('0xd'));var crypto=require(_0xcbbb('0xe'));var jsforce=require(_0xcbbb('0xf'));var deskjs=require(_0xcbbb('0x10'));var toCsv=require(_0xcbbb('0xa'));var querystring=require(_0xcbbb('0x11'));var Papa=require('papaparse');var Redis=require(_0xcbbb('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcbbb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbbb('0x14'))('api');var utils=require(_0xcbbb('0x15'));var config=require(_0xcbbb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcbbb('0x17'))['db'];function respondWithStatusCode(_0x53e651,_0x56f81){_0x56f81=_0x56f81||0xcc;return function(_0x523c50){if(_0x523c50){return _0x53e651[_0xcbbb('0x18')](_0x56f81);}return _0x53e651[_0xcbbb('0x19')](_0x56f81)[_0xcbbb('0x1a')]();};}function respondWithResult(_0x47ea6a,_0x27ba56){_0x27ba56=_0x27ba56||0xc8;return function(_0x3ff767){if(_0x3ff767){return _0x47ea6a[_0xcbbb('0x19')](_0x27ba56)[_0xcbbb('0x1b')](_0x3ff767);}};}function respondWithFilteredResult(_0x47e679,_0x5af226){return function(_0x1bba39){if(_0x1bba39){var _0x30297d=typeof _0x5af226[_0xcbbb('0x1c')]===_0xcbbb('0x1d')&&typeof _0x5af226['limit']===_0xcbbb('0x1d');var _0x4ff973=_0x1bba39[_0xcbbb('0x1e')];var _0x3436af=_0x30297d?0x0:_0x5af226[_0xcbbb('0x1c')];var _0x5052df=_0x30297d?_0x1bba39['count']:_0x5af226['offset']+_0x5af226[_0xcbbb('0x1f')];var _0x3ae91b;if(_0x5052df>=_0x4ff973){_0x5052df=_0x4ff973;_0x3ae91b=0xc8;}else{_0x3ae91b=0xce;}_0x47e679[_0xcbbb('0x19')](_0x3ae91b);return _0x47e679[_0xcbbb('0x20')](_0xcbbb('0x21'),_0x3436af+'-'+_0x5052df+'/'+_0x4ff973)[_0xcbbb('0x1b')](_0x1bba39);}return null;};}function patchUpdates(_0x45de5f){return function(_0x2be36c){try{jsonpatch[_0xcbbb('0x22')](_0x2be36c,_0x45de5f,!![]);}catch(_0x2d4335){return BPromise['reject'](_0x2d4335);}return _0x2be36c[_0xcbbb('0x23')]();};}function saveUpdates(_0xe07b0,_0x159c62){return function(_0x42aaf1){if(_0x42aaf1){return _0x42aaf1[_0xcbbb('0x24')](_0xe07b0)[_0xcbbb('0x25')](function(_0x297eae){return _0x297eae;});}return null;};}function removeEntity(_0xabb565,_0x3ca570){return function(_0x5e3970){if(_0x5e3970){return _0x5e3970[_0xcbbb('0x26')]()[_0xcbbb('0x25')](function(){var _0x4c543a=_0x5e3970[_0xcbbb('0x27')]({'plain':!![]});var _0x4ffa80='ContactItemTypes';return db[_0xcbbb('0x28')][_0xcbbb('0x26')]({'where':{'type':_0x4ffa80,'resourceId':_0x4c543a['id']}})['then'](function(){return _0x5e3970;});})['then'](function(){_0xabb565['status'](0xcc)[_0xcbbb('0x1a')]();});}};}function handleEntityNotFound(_0x55e1d8,_0x4da775){return function(_0x21e3b1){if(!_0x21e3b1){_0x55e1d8[_0xcbbb('0x18')](0x194);}return _0x21e3b1;};}function handleError(_0x38f1c6,_0x13121e){_0x13121e=_0x13121e||0x1f4;return function(_0x372024){logger[_0xcbbb('0x29')](_0x372024[_0xcbbb('0x2a')]);if(_0x372024[_0xcbbb('0x2b')]){delete _0x372024[_0xcbbb('0x2b')];}_0x38f1c6[_0xcbbb('0x19')](_0x13121e)[_0xcbbb('0x2c')](_0x372024);};}exports[_0xcbbb('0x2d')]=function(_0xfa973b,_0x1ce741){var _0x2a9639={},_0xcae72c={},_0x117739={'count':0x0,'rows':[]};var _0x21c560=_['map'](db[_0xcbbb('0x2e')][_0xcbbb('0x2f')],function(_0x5332f9){return{'name':_0x5332f9[_0xcbbb('0x30')],'type':_0x5332f9['type'][_0xcbbb('0x31')]};});_0xcae72c[_0xcbbb('0x32')]=_[_0xcbbb('0x33')](_0x21c560,'name');_0xcae72c[_0xcbbb('0x34')]=_[_0xcbbb('0x35')](_0xfa973b[_0xcbbb('0x34')]);_0xcae72c[_0xcbbb('0x36')]=_[_0xcbbb('0x37')](_0xcae72c[_0xcbbb('0x32')],_0xcae72c[_0xcbbb('0x34')]);_0x2a9639[_0xcbbb('0x38')]=_[_0xcbbb('0x37')](_0xcae72c[_0xcbbb('0x32')],qs['fields'](_0xfa973b['query']['fields']));_0x2a9639['attributes']=_0x2a9639[_0xcbbb('0x38')][_0xcbbb('0x39')]?_0x2a9639[_0xcbbb('0x38')]:_0xcae72c[_0xcbbb('0x32')];if(!_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x3a')](_0xcbbb('0x3b'))){_0x2a9639[_0xcbbb('0x1f')]=qs[_0xcbbb('0x1f')](_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x1f')]);_0x2a9639[_0xcbbb('0x1c')]=qs['offset'](_0xfa973b['query'][_0xcbbb('0x1c')]);}_0x2a9639['order']=qs['sort'](_0xfa973b['query'][_0xcbbb('0x3c')]);_0x2a9639[_0xcbbb('0x3d')]=qs[_0xcbbb('0x36')](_[_0xcbbb('0x3e')](_0xfa973b[_0xcbbb('0x34')],_0xcae72c[_0xcbbb('0x36')]),_0x21c560);if(_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x3f')]){_0x2a9639[_0xcbbb('0x3d')]=_[_0xcbbb('0x40')](_0x2a9639[_0xcbbb('0x3d')],{'$or':_['map'](_0x21c560,function(_0x21ec4b){if(_0x21ec4b['type']!==_0xcbbb('0x41')){var _0xf5b6f9={};_0xf5b6f9[_0x21ec4b[_0xcbbb('0x2b')]]={'$like':'%'+_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x3f')]+'%'};return _0xf5b6f9;}})});}_0x2a9639=_[_0xcbbb('0x40')]({},_0x2a9639,_0xfa973b['options']);var _0x4d31d2={'where':_0x2a9639['where']};return db[_0xcbbb('0x2e')][_0xcbbb('0x1e')](_0x4d31d2)[_0xcbbb('0x25')](function(_0x162979){_0x117739[_0xcbbb('0x1e')]=_0x162979;if(_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x42')]){_0x2a9639['include']=[{'all':!![]}];}return db[_0xcbbb('0x2e')][_0xcbbb('0x43')](_0x2a9639);})['then'](function(_0x15b3bc){_0x117739[_0xcbbb('0x44')]=_0x15b3bc;return _0x117739;})[_0xcbbb('0x25')](respondWithFilteredResult(_0x1ce741,_0x2a9639))[_0xcbbb('0x45')](handleError(_0x1ce741,null));};exports[_0xcbbb('0x46')]=function(_0x50adf5,_0x224682){var _0x58d5cb={'raw':!![],'where':{'id':_0x50adf5[_0xcbbb('0x47')]['id']}},_0x520448={};_0x520448[_0xcbbb('0x32')]=_[_0xcbbb('0x35')](db[_0xcbbb('0x2e')][_0xcbbb('0x2f')]);_0x520448[_0xcbbb('0x34')]=_[_0xcbbb('0x35')](_0x50adf5[_0xcbbb('0x34')]);_0x520448[_0xcbbb('0x36')]=_[_0xcbbb('0x37')](_0x520448[_0xcbbb('0x32')],_0x520448[_0xcbbb('0x34')]);_0x58d5cb[_0xcbbb('0x38')]=_[_0xcbbb('0x37')](_0x520448['model'],qs[_0xcbbb('0x48')](_0x50adf5[_0xcbbb('0x34')][_0xcbbb('0x48')]));_0x58d5cb[_0xcbbb('0x38')]=_0x58d5cb['attributes']['length']?_0x58d5cb['attributes']:_0x520448[_0xcbbb('0x32')];if(_0x50adf5[_0xcbbb('0x34')][_0xcbbb('0x42')]){_0x58d5cb[_0xcbbb('0x49')]=[{'all':!![]}];}_0x58d5cb=_[_0xcbbb('0x40')]({},_0x58d5cb,_0x50adf5[_0xcbbb('0x4a')]);return db[_0xcbbb('0x2e')]['find'](_0x58d5cb)[_0xcbbb('0x25')](handleEntityNotFound(_0x224682,null))[_0xcbbb('0x25')](respondWithResult(_0x224682,null))[_0xcbbb('0x45')](handleError(_0x224682,null));};exports[_0xcbbb('0x4b')]=function(_0x478c22,_0x3378cd){return db[_0xcbbb('0x2e')][_0xcbbb('0x4b')](_0x478c22[_0xcbbb('0x4c')],{})['then'](function(_0x5e0366){var _0x3e1fdc=_0x478c22[_0xcbbb('0x4d')][_0xcbbb('0x27')]({'plain':!![]});if(!_0x3e1fdc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e1fdc['role']==='user'){var _0x189a40=_0x5e0366[_0xcbbb('0x27')]({'plain':!![]});var _0x4b866e=_0xcbbb('0x4e');return db[_0xcbbb('0x4f')][_0xcbbb('0x50')]({'where':{'name':_0x4b866e,'userProfileId':_0x3e1fdc[_0xcbbb('0x51')]},'raw':!![]})['then'](function(_0x33d21c){if(_0x33d21c&&_0x33d21c[_0xcbbb('0x52')]===0x0){return db[_0xcbbb('0x28')][_0xcbbb('0x4b')]({'name':_0x189a40[_0xcbbb('0x2b')],'resourceId':_0x189a40['id'],'type':_0x33d21c[_0xcbbb('0x2b')],'sectionId':_0x33d21c['id']},{})[_0xcbbb('0x25')](function(){return _0x5e0366;});}else{return _0x5e0366;}})[_0xcbbb('0x45')](function(_0x2d3990){logger[_0xcbbb('0x29')](_0xcbbb('0x53'),_0x2d3990);throw _0x2d3990;});}return _0x5e0366;})['then'](respondWithResult(_0x3378cd,0xc9))['catch'](handleError(_0x3378cd,null));};exports[_0xcbbb('0x24')]=function(_0x1eb822,_0x354efc){if(_0x1eb822['body']['id']){delete _0x1eb822[_0xcbbb('0x4c')]['id'];}return db['ContactItemType'][_0xcbbb('0x50')]({'where':{'id':_0x1eb822[_0xcbbb('0x47')]['id']}})[_0xcbbb('0x25')](handleEntityNotFound(_0x354efc,null))[_0xcbbb('0x25')](saveUpdates(_0x1eb822[_0xcbbb('0x4c')],null))[_0xcbbb('0x25')](respondWithResult(_0x354efc,null))['catch'](handleError(_0x354efc,null));};exports['destroy']=function(_0x4cc098,_0x370e6d){return db[_0xcbbb('0x2e')][_0xcbbb('0x50')]({'where':{'id':_0x4cc098[_0xcbbb('0x47')]['id']}})[_0xcbbb('0x25')](handleEntityNotFound(_0x370e6d,null))[_0xcbbb('0x25')](db[_0xcbbb('0x54')][_0xcbbb('0x24')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x4cc098[_0xcbbb('0x47')]['id']}}))[_0xcbbb('0x25')](removeEntity(_0x370e6d,null))[_0xcbbb('0x45')](handleError(_0x370e6d,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index c5cd183..736ae37 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 _0x9b83=['rimraf','../../config/environment','exports','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x340e88,_0xefa352){var _0x1642f9=function(_0x397d8c){while(--_0x397d8c){_0x340e88['push'](_0x340e88['shift']());}};_0x1642f9(++_0xefa352);}(_0x9b83,0x84));var _0x39b8=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x9b83[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x39b8('0x0'));var util=require(_0x39b8('0x1'));var logger=require(_0x39b8('0x2'))(_0x39b8('0x3'));var moment=require(_0x39b8('0x4'));var BPromise=require(_0x39b8('0x5'));var rp=require(_0x39b8('0x6'));var fs=require('fs');var path=require(_0x39b8('0x7'));var rimraf=require(_0x39b8('0x8'));var config=require(_0x39b8('0x9'));var attributes=require('./contactItemType.attributes');module[_0x39b8('0xa')]=function(_0x4a8ff8,_0x563fe1){return _0x4a8ff8[_0x39b8('0xb')](_0x39b8('0xc'),attributes,{'tableName':_0x39b8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3cc2=['tools_contact_item_types','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./contactItemType.attributes','define','ContactItemType'];(function(_0x31cc6e,_0x4da430){var _0x39a234=function(_0x3fe7cd){while(--_0x3fe7cd){_0x31cc6e['push'](_0x31cc6e['shift']());}};_0x39a234(++_0x4da430);}(_0x3cc2,0x14b));var _0x23cc=function(_0x20b003,_0x45162c){_0x20b003=_0x20b003-0x0;var _0x1161fd=_0x3cc2[_0x20b003];return _0x1161fd;};'use strict';var _=require(_0x23cc('0x0'));var util=require(_0x23cc('0x1'));var logger=require(_0x23cc('0x2'))('api');var moment=require('moment');var BPromise=require(_0x23cc('0x3'));var rp=require(_0x23cc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x23cc('0x5'));var config=require(_0x23cc('0x6'));var attributes=require(_0x23cc('0x7'));module['exports']=function(_0x4443da,_0x322ac2){return _0x4443da[_0x23cc('0x8')](_0x23cc('0x9'),attributes,{'tableName':_0x23cc('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 4e62395..75161d6 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 _0xea28=['rpc','../../config/environment','jayson/promise','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1f7e25,_0x3321e2){var _0x26c32f=function(_0x2086e4){while(--_0x2086e4){_0x1f7e25['push'](_0x1f7e25['shift']());}};_0x26c32f(++_0x3321e2);}(_0xea28,0x13a));var _0x8ea2=function(_0x418527,_0x432932){_0x418527=_0x418527-0x0;var _0x49bb68=_0xea28[_0x418527];return _0x49bb68;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var moment=require(_0x8ea2('0x2'));var BPromise=require(_0x8ea2('0x3'));var rs=require(_0x8ea2('0x4'));var fs=require('fs');var Redis=require(_0x8ea2('0x5'));var db=require(_0x8ea2('0x6'))['db'];var utils=require(_0x8ea2('0x7'));var logger=require('../../config/logger')(_0x8ea2('0x8'));var config=require(_0x8ea2('0x9'));var jayson=require(_0x8ea2('0xa'));var client=jayson['client'][_0x8ea2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x435d78,_0xb7f278,_0x39b1fa){return new BPromise(function(_0x28b5b8,_0x929304){return client[_0x8ea2('0xc')](_0x435d78,_0x39b1fa)[_0x8ea2('0xd')](function(_0x3de4a1){logger[_0x8ea2('0xe')](_0x8ea2('0xf'),_0xb7f278,_0x8ea2('0x10'));logger['debug']('ContactItemType,\x20%s,\x20%s,\x20%s',_0xb7f278,_0x8ea2('0x10'),JSON[_0x8ea2('0x11')](_0x3de4a1));if(_0x3de4a1[_0x8ea2('0x12')]){if(_0x3de4a1['error'][_0x8ea2('0x13')]===0x1f4){logger[_0x8ea2('0x12')](_0x8ea2('0xf'),_0xb7f278,_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);return _0x929304(_0x3de4a1['error'][_0x8ea2('0x14')]);}logger['error']('ContactItemType,\x20%s,\x20%s',_0xb7f278,_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);return _0x28b5b8(_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);}else{logger[_0x8ea2('0xe')](_0x8ea2('0xf'),_0xb7f278,_0x8ea2('0x10'));_0x28b5b8(_0x3de4a1[_0x8ea2('0x15')][_0x8ea2('0x14')]);}})[_0x8ea2('0x16')](function(_0x2dfa7c){logger[_0x8ea2('0x12')](_0x8ea2('0xf'),_0xb7f278,_0x2dfa7c);_0x929304(_0x2dfa7c);});});} \ No newline at end of file +var _0x7701=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x221f3f,_0x572f89){var _0x4cee7c=function(_0x474015){while(--_0x474015){_0x221f3f['push'](_0x221f3f['shift']());}};_0x4cee7c(++_0x572f89);}(_0x7701,0xc2));var _0x1770=function(_0x47faab,_0x2f0254){_0x47faab=_0x47faab-0x0;var _0x392a8b=_0x7701[_0x47faab];return _0x392a8b;};'use strict';var _=require(_0x1770('0x0'));var util=require(_0x1770('0x1'));var moment=require(_0x1770('0x2'));var BPromise=require(_0x1770('0x3'));var rs=require(_0x1770('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1770('0x5'))['db'];var utils=require(_0x1770('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1770('0x7'));var client=jayson[_0x1770('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1311c2,_0x18b2bb,_0x505bfa){return new BPromise(function(_0x433c9f,_0x442af9){return client['request'](_0x1311c2,_0x505bfa)['then'](function(_0x1641ef){logger[_0x1770('0x9')](_0x1770('0xa'),_0x18b2bb,_0x1770('0xb'));logger[_0x1770('0xc')](_0x1770('0xd'),_0x18b2bb,_0x1770('0xb'),JSON[_0x1770('0xe')](_0x1641ef));if(_0x1641ef[_0x1770('0xf')]){if(_0x1641ef[_0x1770('0xf')]['code']===0x1f4){logger[_0x1770('0xf')](_0x1770('0xa'),_0x18b2bb,_0x1641ef['error']['message']);return _0x442af9(_0x1641ef[_0x1770('0xf')][_0x1770('0x10')]);}logger[_0x1770('0xf')](_0x1770('0xa'),_0x18b2bb,_0x1641ef[_0x1770('0xf')]['message']);return _0x433c9f(_0x1641ef['error'][_0x1770('0x10')]);}else{logger[_0x1770('0x9')](_0x1770('0xa'),_0x18b2bb,_0x1770('0xb'));_0x433c9f(_0x1641ef[_0x1770('0x11')]['message']);}})[_0x1770('0x12')](function(_0x441705){logger[_0x1770('0xf')](_0x1770('0xa'),_0x18b2bb,_0x441705);_0x442af9(_0x441705);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 55f8985..5a7894b 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 _0x01a3=['isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./contactItemType.controller','get'];(function(_0x22b86b,_0x14f499){var _0x4d51b6=function(_0x23ffc8){while(--_0x23ffc8){_0x22b86b['push'](_0x22b86b['shift']());}};_0x4d51b6(++_0x14f499);}(_0x01a3,0x82));var _0x301a=function(_0xc84120,_0x46ad5b){_0xc84120=_0xc84120-0x0;var _0x4be770=_0x01a3[_0xc84120];return _0x4be770;};'use strict';var multer=require(_0x301a('0x0'));var util=require(_0x301a('0x1'));var path=require(_0x301a('0x2'));var timeout=require(_0x301a('0x3'));var express=require(_0x301a('0x4'));var router=express[_0x301a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x301a('0x6'));var config=require(_0x301a('0x7'));var controller=require(_0x301a('0x8'));router[_0x301a('0x9')]('/',auth[_0x301a('0xa')](),controller[_0x301a('0xb')]);router[_0x301a('0x9')](_0x301a('0xc'),auth[_0x301a('0xa')](),controller[_0x301a('0xd')]);router[_0x301a('0xe')]('/',auth[_0x301a('0xa')](),controller[_0x301a('0xf')]);router['put'](_0x301a('0xc'),auth[_0x301a('0xa')](),controller[_0x301a('0x10')]);router[_0x301a('0x11')](_0x301a('0xc'),auth[_0x301a('0xa')](),controller[_0x301a('0x12')]);module[_0x301a('0x13')]=router; \ No newline at end of file +var _0x5822=['../../components/interaction/service','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1ed354,_0x4bb5be){var _0x532757=function(_0x574f3e){while(--_0x574f3e){_0x1ed354['push'](_0x1ed354['shift']());}};_0x532757(++_0x4bb5be);}(_0x5822,0xbf));var _0x2582=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0x5822[_0x4dab14];return _0xf41aa;};'use strict';var multer=require('multer');var util=require(_0x2582('0x0'));var path=require(_0x2582('0x1'));var timeout=require(_0x2582('0x2'));var express=require(_0x2582('0x3'));var router=express[_0x2582('0x4')]();var fs_extra=require(_0x2582('0x5'));var auth=require(_0x2582('0x6'));var interaction=require(_0x2582('0x7'));var config=require('../../config/environment');var controller=require(_0x2582('0x8'));router[_0x2582('0x9')]('/',auth[_0x2582('0xa')](),controller[_0x2582('0xb')]);router['get'](_0x2582('0xc'),auth['isAuthenticated'](),controller[_0x2582('0xd')]);router[_0x2582('0xe')]('/',auth[_0x2582('0xa')](),controller['create']);router[_0x2582('0xf')](_0x2582('0xc'),auth['isAuthenticated'](),controller[_0x2582('0x10')]);router['delete'](_0x2582('0xc'),auth[_0x2582('0xa')](),controller['destroy']);module[_0x2582('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 1bcd6cf..4850ecc 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 _0xb10b=['name','sequelize','STRING'];(function(_0x4d1a46,_0x120f45){var _0x4559cc=function(_0x3adc60){while(--_0x3adc60){_0x4d1a46['push'](_0x4d1a46['shift']());}};_0x4559cc(++_0x120f45);}(_0xb10b,0x12a));var _0xbb10=function(_0x6d0143,_0x3d7c30){_0x6d0143=_0x6d0143-0x0;var _0x29cb75=_0xb10b[_0x6d0143];return _0x29cb75;};'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(_0x194431,_0x29170c){var _0x5bfcbd=function(_0x349c87){while(--_0x349c87){_0x194431['push'](_0x194431['shift']());}};_0x5bfcbd(++_0x29170c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index e426f01..180f57b 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 _0xc9d3=['path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','./dashboard.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','CustomDashboards','error','stack','send','map','Dashboard','rawAttributes','fieldName','type','model','name','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','UserProfileSection','UserProfileResource','iframe','attrUrl','attrs','attrPath','clock','attrHourFormat','value','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x40ded9,_0x4c9e4a){var _0x413b82=function(_0x50db8f){while(--_0x50db8f){_0x40ded9['push'](_0x40ded9['shift']());}};_0x413b82(++_0x4c9e4a);}(_0xc9d3,0xf3));var _0x3c9d=function(_0x5be24b,_0x5872e5){_0x5be24b=_0x5be24b-0x0;var _0x4fedc6=_0xc9d3[_0x5be24b];return _0x4fedc6;};'use strict';var emlformat=require(_0x3c9d('0x0'));var rimraf=require(_0x3c9d('0x1'));var zipdir=require(_0x3c9d('0x2'));var jsonpatch=require(_0x3c9d('0x3'));var rp=require(_0x3c9d('0x4'));var moment=require(_0x3c9d('0x5'));var BPromise=require(_0x3c9d('0x6'));var Mustache=require(_0x3c9d('0x7'));var util=require(_0x3c9d('0x8'));var path=require(_0x3c9d('0x9'));var sox=require('sox');var csv=require(_0x3c9d('0xa'));var ejs=require(_0x3c9d('0xb'));var fs=require('fs');var fs_extra=require(_0x3c9d('0xc'));var _=require('lodash');var squel=require(_0x3c9d('0xd'));var crypto=require(_0x3c9d('0xe'));var jsforce=require(_0x3c9d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3c9d('0xa'));var querystring=require(_0x3c9d('0x10'));var Papa=require(_0x3c9d('0x11'));var Redis=require(_0x3c9d('0x12'));var authService=require(_0x3c9d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3c9d('0x14'));var hardwareService=require(_0x3c9d('0x15'));var logger=require(_0x3c9d('0x16'))(_0x3c9d('0x17'));var utils=require('../../config/utils');var config=require(_0x3c9d('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x3c9d('0x19')]=_[_0x3c9d('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3c9d('0x19')]));require(_0x3c9d('0x1b'))[_0x3c9d('0x1c')](socket);function respondWithStatusCode(_0x557405,_0x639d2c){_0x639d2c=_0x639d2c||0xcc;return function(_0x36766b){if(_0x36766b){return _0x557405[_0x3c9d('0x1d')](_0x639d2c);}return _0x557405[_0x3c9d('0x1e')](_0x639d2c)[_0x3c9d('0x1f')]();};}function respondWithResult(_0xfa39ed,_0x227abe){_0x227abe=_0x227abe||0xc8;return function(_0x326d73){if(_0x326d73){return _0xfa39ed[_0x3c9d('0x1e')](_0x227abe)[_0x3c9d('0x20')](_0x326d73);}};}function respondWithFilteredResult(_0x1ef323,_0x18b310){return function(_0x4ece8f){if(_0x4ece8f){var _0x330018=typeof _0x18b310['offset']===_0x3c9d('0x21')&&typeof _0x18b310[_0x3c9d('0x22')]==='undefined';var _0x26cea8=_0x4ece8f[_0x3c9d('0x23')];var _0x334155=_0x330018?0x0:_0x18b310[_0x3c9d('0x24')];var _0x3b0563=_0x330018?_0x4ece8f[_0x3c9d('0x23')]:_0x18b310[_0x3c9d('0x24')]+_0x18b310[_0x3c9d('0x22')];var _0x5b3e4f;if(_0x3b0563>=_0x26cea8){_0x3b0563=_0x26cea8;_0x5b3e4f=0xc8;}else{_0x5b3e4f=0xce;}_0x1ef323[_0x3c9d('0x1e')](_0x5b3e4f);return _0x1ef323['set']('Content-Range',_0x334155+'-'+_0x3b0563+'/'+_0x26cea8)['json'](_0x4ece8f);}return null;};}function patchUpdates(_0x5f2318){return function(_0x54e115){try{jsonpatch[_0x3c9d('0x25')](_0x54e115,_0x5f2318,!![]);}catch(_0x58d533){return BPromise[_0x3c9d('0x26')](_0x58d533);}return _0x54e115[_0x3c9d('0x27')]();};}function saveUpdates(_0x483d79,_0x40a2e2){return function(_0x323ed8){if(_0x323ed8){return _0x323ed8[_0x3c9d('0x28')](_0x483d79)[_0x3c9d('0x29')](function(_0x3d7fda){return _0x3d7fda;});}return null;};}function removeEntity(_0x5985f8,_0x9c2d90){return function(_0x512ac1){if(_0x512ac1){return _0x512ac1[_0x3c9d('0x2a')]()[_0x3c9d('0x29')](function(){var _0x334e0b=_0x512ac1['get']({'plain':!![]});var _0xe4cde5=_0x3c9d('0x2b');return db['UserProfileResource'][_0x3c9d('0x2a')]({'where':{'type':_0xe4cde5,'resourceId':_0x334e0b['id']}})['then'](function(){return _0x512ac1;});})['then'](function(){_0x5985f8['status'](0xcc)[_0x3c9d('0x1f')]();});}};}function handleEntityNotFound(_0x1a7c91,_0x12003c){return function(_0x2a56ac){if(!_0x2a56ac){_0x1a7c91['sendStatus'](0x194);}return _0x2a56ac;};}function handleError(_0x487ba8,_0x4f7025){_0x4f7025=_0x4f7025||0x1f4;return function(_0x3758de){logger[_0x3c9d('0x2c')](_0x3758de[_0x3c9d('0x2d')]);if(_0x3758de['name']){delete _0x3758de['name'];}_0x487ba8[_0x3c9d('0x1e')](_0x4f7025)[_0x3c9d('0x2e')](_0x3758de);};}exports['index']=function(_0x1def01,_0x115277){var _0x4a0ea2={},_0x4e1bcd={},_0x313bc2={'count':0x0,'rows':[]};var _0x5eb537=_[_0x3c9d('0x2f')](db[_0x3c9d('0x30')][_0x3c9d('0x31')],function(_0xb1b233){return{'name':_0xb1b233[_0x3c9d('0x32')],'type':_0xb1b233[_0x3c9d('0x33')]['key']};});_0x4e1bcd[_0x3c9d('0x34')]=_[_0x3c9d('0x2f')](_0x5eb537,_0x3c9d('0x35'));_0x4e1bcd[_0x3c9d('0x36')]=_[_0x3c9d('0x37')](_0x1def01[_0x3c9d('0x36')]);_0x4e1bcd['filters']=_['intersection'](_0x4e1bcd['model'],_0x4e1bcd[_0x3c9d('0x36')]);_0x4a0ea2[_0x3c9d('0x38')]=_[_0x3c9d('0x39')](_0x4e1bcd[_0x3c9d('0x34')],qs[_0x3c9d('0x3a')](_0x1def01[_0x3c9d('0x36')][_0x3c9d('0x3a')]));_0x4a0ea2[_0x3c9d('0x38')]=_0x4a0ea2[_0x3c9d('0x38')][_0x3c9d('0x3b')]?_0x4a0ea2[_0x3c9d('0x38')]:_0x4e1bcd['model'];if(!_0x1def01[_0x3c9d('0x36')][_0x3c9d('0x3c')](_0x3c9d('0x3d'))){_0x4a0ea2[_0x3c9d('0x22')]=qs[_0x3c9d('0x22')](_0x1def01['query'][_0x3c9d('0x22')]);_0x4a0ea2[_0x3c9d('0x24')]=qs['offset'](_0x1def01[_0x3c9d('0x36')][_0x3c9d('0x24')]);}_0x4a0ea2[_0x3c9d('0x3e')]=qs[_0x3c9d('0x3f')](_0x1def01[_0x3c9d('0x36')][_0x3c9d('0x3f')]);_0x4a0ea2['where']=qs[_0x3c9d('0x40')](_[_0x3c9d('0x41')](_0x1def01[_0x3c9d('0x36')],_0x4e1bcd[_0x3c9d('0x40')]),_0x5eb537);if(_0x1def01[_0x3c9d('0x36')][_0x3c9d('0x42')]){_0x4a0ea2[_0x3c9d('0x43')]=_[_0x3c9d('0x44')](_0x4a0ea2[_0x3c9d('0x43')],{'$or':_['map'](_0x5eb537,function(_0x553a5c){if(_0x553a5c[_0x3c9d('0x33')]!==_0x3c9d('0x45')){var _0x494fae={};_0x494fae[_0x553a5c['name']]={'$like':'%'+_0x1def01[_0x3c9d('0x36')]['filter']+'%'};return _0x494fae;}})});}_0x4a0ea2=_[_0x3c9d('0x44')]({},_0x4a0ea2,_0x1def01[_0x3c9d('0x46')]);var _0x22a6db={'where':_0x4a0ea2['where']};return db[_0x3c9d('0x30')][_0x3c9d('0x23')](_0x22a6db)['then'](function(_0x4a8cdf){_0x313bc2[_0x3c9d('0x23')]=_0x4a8cdf;if(_0x1def01[_0x3c9d('0x36')][_0x3c9d('0x47')]){_0x4a0ea2[_0x3c9d('0x48')]=[{'all':!![]}];}return db[_0x3c9d('0x30')][_0x3c9d('0x49')](_0x4a0ea2);})[_0x3c9d('0x29')](function(_0x4aad03){_0x313bc2[_0x3c9d('0x4a')]=_0x4aad03;return _0x313bc2;})[_0x3c9d('0x29')](respondWithFilteredResult(_0x115277,_0x4a0ea2))[_0x3c9d('0x4b')](handleError(_0x115277,null));};exports['show']=function(_0x49c5f6,_0x4140f1){var _0x112cd5={'raw':![],'where':{'id':_0x49c5f6[_0x3c9d('0x4c')]['id']}},_0x1419bf={};_0x1419bf[_0x3c9d('0x34')]=_[_0x3c9d('0x37')](db[_0x3c9d('0x30')][_0x3c9d('0x31')]);_0x1419bf[_0x3c9d('0x36')]=_[_0x3c9d('0x37')](_0x49c5f6[_0x3c9d('0x36')]);_0x1419bf[_0x3c9d('0x40')]=_[_0x3c9d('0x39')](_0x1419bf[_0x3c9d('0x34')],_0x1419bf[_0x3c9d('0x36')]);_0x112cd5[_0x3c9d('0x38')]=_[_0x3c9d('0x39')](_0x1419bf[_0x3c9d('0x34')],qs[_0x3c9d('0x3a')](_0x49c5f6[_0x3c9d('0x36')][_0x3c9d('0x3a')]));_0x112cd5[_0x3c9d('0x38')]=_0x112cd5['attributes']['length']?_0x112cd5[_0x3c9d('0x38')]:_0x1419bf[_0x3c9d('0x34')];if(_0x49c5f6[_0x3c9d('0x36')]['includeAll']){_0x112cd5[_0x3c9d('0x48')]=[{'all':!![]}];}_0x112cd5=_[_0x3c9d('0x44')]({},_0x112cd5,_0x49c5f6[_0x3c9d('0x46')]);return db[_0x3c9d('0x30')][_0x3c9d('0x4d')](_0x112cd5)[_0x3c9d('0x29')](handleEntityNotFound(_0x4140f1,null))['then'](respondWithResult(_0x4140f1,null))[_0x3c9d('0x4b')](handleError(_0x4140f1,null));};exports[_0x3c9d('0x4e')]=function(_0x1fdd14,_0x5b7f69){return db['Dashboard'][_0x3c9d('0x4e')](_0x1fdd14[_0x3c9d('0x4f')],{})[_0x3c9d('0x29')](function(_0x3f3b91){var _0x591c08=_0x1fdd14[_0x3c9d('0x50')][_0x3c9d('0x51')]({'plain':!![]});if(!_0x591c08)throw new Error(_0x3c9d('0x52'));if(_0x591c08['role']===_0x3c9d('0x50')){var _0x28fede=_0x3f3b91[_0x3c9d('0x51')]({'plain':!![]});var _0x2c9edf=_0x3c9d('0x2b');return db['UserProfileSection'][_0x3c9d('0x4d')]({'where':{'name':_0x2c9edf,'userProfileId':_0x591c08[_0x3c9d('0x53')]},'raw':!![]})[_0x3c9d('0x29')](function(_0x73fa62){if(_0x73fa62&&_0x73fa62[_0x3c9d('0x54')]===0x0){return db['UserProfileResource'][_0x3c9d('0x4e')]({'name':_0x28fede[_0x3c9d('0x35')],'resourceId':_0x28fede['id'],'type':_0x73fa62[_0x3c9d('0x35')],'sectionId':_0x73fa62['id']},{})[_0x3c9d('0x29')](function(){return _0x3f3b91;});}else{return _0x3f3b91;}})[_0x3c9d('0x4b')](function(_0x2b6ab6){logger['error'](_0x3c9d('0x55'),_0x2b6ab6);throw _0x2b6ab6;});}return _0x3f3b91;})[_0x3c9d('0x29')](respondWithResult(_0x5b7f69,0xc9))['catch'](handleError(_0x5b7f69,null));};exports[_0x3c9d('0x56')]=function(_0x7e6161,_0x48dd53){var _0x10eccc={'where':{'id':_0x7e6161[_0x3c9d('0x4c')]['id']}},_0x24653f={};_0x24653f[_0x3c9d('0x34')]=_[_0x3c9d('0x37')](db[_0x3c9d('0x30')][_0x3c9d('0x31')]);_0x10eccc[_0x3c9d('0x38')]=_[_0x3c9d('0x39')](_0x24653f[_0x3c9d('0x34')],qs[_0x3c9d('0x3a')](_0x7e6161['query'][_0x3c9d('0x3a')]));_0x10eccc[_0x3c9d('0x38')]=_0x10eccc[_0x3c9d('0x38')]['length']?_0x10eccc[_0x3c9d('0x38')]:_0x24653f[_0x3c9d('0x34')];if(_0x7e6161['query'][_0x3c9d('0x47')]){_0x10eccc['include']=[{'all':!![]}];}_0x10eccc=_[_0x3c9d('0x44')]({},_0x10eccc,_0x7e6161[_0x3c9d('0x46')]);return db['Dashboard'][_0x3c9d('0x4d')](_0x10eccc)[_0x3c9d('0x29')](handleEntityNotFound(_0x48dd53,null))[_0x3c9d('0x29')](function(_0x4bcbce){if(_0x4bcbce){var _0x11b8db=_0x4bcbce['get']({'plain':!![]});_0x11b8db=qs['omit'](_0x11b8db,['id',_0x3c9d('0x57'),_0x3c9d('0x58')]);_0x7e6161['body']=_[_0x3c9d('0x59')](_0x7e6161[_0x3c9d('0x4f')],['id',_0x3c9d('0x57'),_0x3c9d('0x58')]);return db[_0x3c9d('0x30')][_0x3c9d('0x4e')](_['merge'](_0x11b8db,_0x7e6161['body']),{'include':_0x7e6161[_0x3c9d('0x36')][_0x3c9d('0x47')]?[{'all':!![]}]:undefined})[_0x3c9d('0x29')](function(_0x3e85c9){var _0x42b8ad=_0x7e6161['user'][_0x3c9d('0x51')]({'plain':!![]});if(!_0x42b8ad)throw new Error(_0x3c9d('0x52'));if(_0x42b8ad['role']===_0x3c9d('0x50')){var _0x34b8d3=_0x3e85c9[_0x3c9d('0x51')]({'plain':!![]});var _0x367a12='CustomDashboards';return db[_0x3c9d('0x5a')][_0x3c9d('0x4d')]({'where':{'name':_0x367a12,'userProfileId':_0x42b8ad[_0x3c9d('0x53')]},'raw':!![]})['then'](function(_0x29bcef){if(_0x29bcef&&_0x29bcef[_0x3c9d('0x54')]===0x0){return db[_0x3c9d('0x5b')]['create']({'name':_0x34b8d3[_0x3c9d('0x35')],'resourceId':_0x34b8d3['id'],'type':_0x29bcef['name'],'sectionId':_0x29bcef['id']},{})[_0x3c9d('0x29')](function(){return _0x3e85c9;});}else{return _0x3e85c9;}})['catch'](function(_0x5c1d57){logger['error'](_0x3c9d('0x55'),_0x5c1d57);throw _0x5c1d57;});}return _0x3e85c9;});}})[_0x3c9d('0x29')](respondWithResult(_0x48dd53,0xc9))[_0x3c9d('0x4b')](handleError(_0x48dd53,null));};exports[_0x3c9d('0x28')]=function(_0x247b8a,_0x3142a3){if(_0x247b8a[_0x3c9d('0x4f')]['id']){delete _0x247b8a[_0x3c9d('0x4f')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x247b8a['params']['id']}})['then'](handleEntityNotFound(_0x3142a3,null))[_0x3c9d('0x29')](saveUpdates(_0x247b8a['body'],null))['then'](respondWithResult(_0x3142a3,null))[_0x3c9d('0x4b')](handleError(_0x3142a3,null));};exports[_0x3c9d('0x2a')]=function(_0xedef6,_0x565c4e){return db[_0x3c9d('0x30')]['find']({'where':{'id':_0xedef6[_0x3c9d('0x4c')]['id']}})[_0x3c9d('0x29')](handleEntityNotFound(_0x565c4e,null))[_0x3c9d('0x29')](removeEntity(_0x565c4e,null))[_0x3c9d('0x4b')](handleError(_0x565c4e,null));};function widgetAttributes(_0x1c9f13){try{switch(_0x1c9f13[_0x3c9d('0x33')]){case _0x3c9d('0x5c'):return[{'name':_0x3c9d('0x5d'),'value':_0x1c9f13['attrUrl']||(_0x1c9f13['attrs']&&_0x1c9f13[_0x3c9d('0x5e')][0x0]?_0x1c9f13['attrs'][0x0]['value']:undefined)||'https://'}];case'custom':return[{'name':_0x3c9d('0x5f'),'value':_0x1c9f13[_0x3c9d('0x5f')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x0]?_0x1c9f13[_0x3c9d('0x5e')][0x0]['value']:undefined)||''}];case _0x3c9d('0x60'):return[{'name':_0x3c9d('0x61'),'value':_0x1c9f13[_0x3c9d('0x61')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x0]?_0x1c9f13[_0x3c9d('0x5e')][0x0][_0x3c9d('0x62')]:undefined)||_0x3c9d('0x63')},{'name':'attrTimezone','value':_0x1c9f13[_0x3c9d('0x64')]||(_0x1c9f13['attrs']&&_0x1c9f13[_0x3c9d('0x5e')][0x1]?_0x1c9f13[_0x3c9d('0x5e')][0x1][_0x3c9d('0x62')]:undefined)||'0.00'},{'name':_0x3c9d('0x65'),'value':_0x1c9f13[_0x3c9d('0x65')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13['attrs'][0x2]?_0x1c9f13['attrs'][0x2][_0x3c9d('0x62')]:undefined)||0xc}];case _0x3c9d('0x66'):return[{'name':'attrMetric','value':_0x1c9f13[_0x3c9d('0x67')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13['attrs'][0x0]?_0x1c9f13[_0x3c9d('0x5e')][0x0]['value']:undefined)||_0x3c9d('0x68')},{'name':_0x3c9d('0x69'),'value':_0x1c9f13['attrVoiceQueues']||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x1]?_0x1c9f13[_0x3c9d('0x5e')][0x1][_0x3c9d('0x62')]:undefined)||[]},{'name':_0x3c9d('0x65'),'value':_0x1c9f13['attrFontSize']||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x2]?_0x1c9f13['attrs'][0x2]['value']:undefined)||0x14},{'name':_0x3c9d('0x6a'),'value':_0x1c9f13[_0x3c9d('0x6a')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x3]?_0x1c9f13[_0x3c9d('0x5e')][0x3][_0x3c9d('0x62')]:undefined)||_0x3c9d('0x6b')},{'name':_0x3c9d('0x6c'),'value':_0x1c9f13[_0x3c9d('0x6c')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13['attrs'][0x4]?_0x1c9f13[_0x3c9d('0x5e')][0x4][_0x3c9d('0x62')]:undefined)||''},{'name':_0x3c9d('0x6d'),'value':_0x1c9f13[_0x3c9d('0x6d')]||(_0x1c9f13['attrs']&&_0x1c9f13['attrs'][0x5]?_0x1c9f13['attrs'][0x5][_0x3c9d('0x62')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x1c9f13[_0x3c9d('0x6e')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x6]?_0x1c9f13['attrs'][0x6][_0x3c9d('0x62')]:undefined)||''},{'name':_0x3c9d('0x6f'),'value':_0x1c9f13[_0x3c9d('0x6f')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x7]?_0x1c9f13['attrs'][0x7][_0x3c9d('0x62')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1c9f13[_0x3c9d('0x70')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x8]?_0x1c9f13['attrs'][0x8][_0x3c9d('0x62')]:undefined)||''},{'name':_0x3c9d('0x71'),'value':_0x1c9f13[_0x3c9d('0x71')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x9]?_0x1c9f13[_0x3c9d('0x5e')][0x9][_0x3c9d('0x62')]:undefined)||''}];case _0x3c9d('0x72'):case _0x3c9d('0x73'):return[{'name':_0x3c9d('0x74'),'value':_0x1c9f13[_0x3c9d('0x74')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13['attrs'][0x0]?_0x1c9f13['attrs'][0x0]['value']:undefined)||_0x3c9d('0x68')},{'name':_0x3c9d('0x75'),'value':_0x1c9f13[_0x3c9d('0x75')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13['attrs'][0x1]?_0x1c9f13[_0x3c9d('0x5e')][0x1][_0x3c9d('0x62')]:undefined)||null},{'name':_0x3c9d('0x76'),'value':_0x1c9f13[_0x3c9d('0x76')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x2]?_0x1c9f13[_0x3c9d('0x5e')][0x2][_0x3c9d('0x62')]:undefined)||null},{'name':_0x3c9d('0x69'),'value':_0x1c9f13[_0x3c9d('0x69')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13['attrs'][0x3]?_0x1c9f13[_0x3c9d('0x5e')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x1c9f13[_0x3c9d('0x6a')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x4]?_0x1c9f13[_0x3c9d('0x5e')][0x4]['value']:undefined)||_0x3c9d('0x6b')},{'name':_0x3c9d('0x6c'),'value':_0x1c9f13[_0x3c9d('0x6c')]||(_0x1c9f13['attrs']&&_0x1c9f13['attrs'][0x5]?_0x1c9f13[_0x3c9d('0x5e')][0x5][_0x3c9d('0x62')]:undefined)||''},{'name':_0x3c9d('0x6d'),'value':_0x1c9f13[_0x3c9d('0x6d')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x6]?_0x1c9f13[_0x3c9d('0x5e')][0x6][_0x3c9d('0x62')]:undefined)||''},{'name':_0x3c9d('0x6e'),'value':_0x1c9f13[_0x3c9d('0x6e')]||(_0x1c9f13['attrs']&&_0x1c9f13[_0x3c9d('0x5e')][0x7]?_0x1c9f13[_0x3c9d('0x5e')][0x7]['value']:undefined)||''},{'name':_0x3c9d('0x6f'),'value':_0x1c9f13['attrOpenchannelAccounts']||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x8]?_0x1c9f13[_0x3c9d('0x5e')][0x8][_0x3c9d('0x62')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1c9f13[_0x3c9d('0x70')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x9]?_0x1c9f13[_0x3c9d('0x5e')][0x9][_0x3c9d('0x62')]:undefined)||''},{'name':_0x3c9d('0x71'),'value':_0x1c9f13[_0x3c9d('0x71')]||(_0x1c9f13['attrs']&&_0x1c9f13[_0x3c9d('0x5e')][0xa]?_0x1c9f13[_0x3c9d('0x5e')][0xa]['value']:undefined)||''}];case'web-report':return[{'name':_0x3c9d('0x77'),'type':_0x1c9f13['reportType']||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x0]?_0x1c9f13['attrs'][0x0][_0x3c9d('0x33')]:undefined)||null,'value':_0x1c9f13[_0x3c9d('0x77')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x0]?_0x1c9f13['attrs'][0x0][_0x3c9d('0x62')]:undefined)||null},{'name':'attrRefresh','value':_0x1c9f13['attrRefresh']||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x1]?_0x1c9f13[_0x3c9d('0x5e')][0x1][_0x3c9d('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x2df255){logger['error'](_0x3c9d('0x78'),JSON[_0x3c9d('0x79')](_0x2df255));return[];}}exports[_0x3c9d('0x7a')]=function(_0x31e421,_0x49fc10,_0x1dcc4b){if(_0x31e421[_0x3c9d('0x4f')]['id']){delete _0x31e421[_0x3c9d('0x4f')]['id'];}return db[_0x3c9d('0x30')][_0x3c9d('0x4d')]({'where':{'id':_0x31e421[_0x3c9d('0x4c')]['id']}})[_0x3c9d('0x29')](handleEntityNotFound(_0x49fc10,null))[_0x3c9d('0x29')](function(_0x3a3d3a){if(_0x3a3d3a){_0x31e421[_0x3c9d('0x4f')][_0x3c9d('0x7b')]=_0x3a3d3a['id'];_0x31e421['body'][_0x3c9d('0x5e')]=widgetAttributes(_0x31e421['body']);return db[_0x3c9d('0x7c')][_0x3c9d('0x4e')](_0x31e421['body']);}})[_0x3c9d('0x29')](respondWithResult(_0x49fc10,null))[_0x3c9d('0x4b')](handleError(_0x49fc10,null));};exports[_0x3c9d('0x7d')]=function(_0x1e9df7,_0x4339fa,_0x311833){var _0x54e82a={};var _0x52e76d={};var _0x1f320a;var _0x54696c;return db[_0x3c9d('0x30')]['findOne']({'where':{'id':_0x1e9df7[_0x3c9d('0x4c')]['id']}})[_0x3c9d('0x29')](handleEntityNotFound(_0x4339fa,null))[_0x3c9d('0x29')](function(_0x1e6173){if(_0x1e6173){_0x1f320a=_0x1e6173;_0x52e76d[_0x3c9d('0x34')]=_[_0x3c9d('0x37')](db['DashboardItem']['rawAttributes']);_0x52e76d[_0x3c9d('0x36')]=_[_0x3c9d('0x37')](_0x1e9df7[_0x3c9d('0x36')]);_0x52e76d[_0x3c9d('0x40')]=_['intersection'](_0x52e76d[_0x3c9d('0x34')],_0x52e76d['query']);_0x54e82a[_0x3c9d('0x38')]=_[_0x3c9d('0x39')](_0x52e76d[_0x3c9d('0x34')],qs['fields'](_0x1e9df7[_0x3c9d('0x36')][_0x3c9d('0x3a')]));_0x54e82a[_0x3c9d('0x38')]=_0x54e82a[_0x3c9d('0x38')][_0x3c9d('0x3b')]?_0x54e82a[_0x3c9d('0x38')]:_0x52e76d[_0x3c9d('0x34')];_0x54e82a[_0x3c9d('0x3e')]=qs['sort'](_0x1e9df7['query'][_0x3c9d('0x3f')]);_0x54e82a[_0x3c9d('0x43')]=qs[_0x3c9d('0x40')](_['pick'](_0x1e9df7[_0x3c9d('0x36')],_0x52e76d['filters']));if(_0x1e9df7[_0x3c9d('0x36')][_0x3c9d('0x42')]){_0x54e82a[_0x3c9d('0x43')]=_[_0x3c9d('0x44')](_0x54e82a['where'],{'$or':_['map'](_0x54e82a[_0x3c9d('0x38')],function(_0x3f7759){var _0x3fe799={};_0x3fe799[_0x3f7759]={'$like':'%'+_0x1e9df7['query']['filter']+'%'};return _0x3fe799;})});}_0x54e82a=_[_0x3c9d('0x44')]({},_0x54e82a,_0x1e9df7[_0x3c9d('0x46')]);return _0x1f320a[_0x3c9d('0x7d')](_0x54e82a);}})[_0x3c9d('0x29')](function(_0x35a253){if(_0x35a253){_0x54696c=_0x35a253[_0x3c9d('0x3b')];if(!_0x1e9df7['query']['hasOwnProperty'](_0x3c9d('0x3d'))){_0x54e82a[_0x3c9d('0x22')]=qs[_0x3c9d('0x22')](_0x1e9df7[_0x3c9d('0x36')][_0x3c9d('0x22')]);_0x54e82a['offset']=qs['offset'](_0x1e9df7[_0x3c9d('0x36')][_0x3c9d('0x24')]);}return _0x1f320a[_0x3c9d('0x7d')](_0x54e82a);}})[_0x3c9d('0x29')](function(_0xbc105b){if(_0xbc105b){return _0xbc105b?{'count':_0x54696c,'rows':_0xbc105b}:null;}})[_0x3c9d('0x29')](respondWithResult(_0x4339fa,null))[_0x3c9d('0x4b')](handleError(_0x4339fa,null));}; \ No newline at end of file +var _0xf16d=['userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','role','UserProfileSection','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','stringify','addItem','DashboardItem','getItems','findOne','order','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','update','then','destroy','get','CustomDashboards','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','options','Dashboard','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x474c66,_0xbce925){var _0xcbd9bf=function(_0x44019d){while(--_0x44019d){_0x474c66['push'](_0x474c66['shift']());}};_0xcbd9bf(++_0xbce925);}(_0xf16d,0x1b9));var _0xdf16=function(_0x365179,_0x254d11){_0x365179=_0x365179-0x0;var _0x3cb0d0=_0xf16d[_0x365179];return _0x3cb0d0;};'use strict';var emlformat=require(_0xdf16('0x0'));var rimraf=require(_0xdf16('0x1'));var zipdir=require(_0xdf16('0x2'));var jsonpatch=require(_0xdf16('0x3'));var rp=require(_0xdf16('0x4'));var moment=require(_0xdf16('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdf16('0x6'));var path=require(_0xdf16('0x7'));var sox=require(_0xdf16('0x8'));var csv=require('to-csv');var ejs=require(_0xdf16('0x9'));var fs=require('fs');var fs_extra=require(_0xdf16('0xa'));var _=require(_0xdf16('0xb'));var squel=require(_0xdf16('0xc'));var crypto=require('crypto');var jsforce=require(_0xdf16('0xd'));var deskjs=require(_0xdf16('0xe'));var toCsv=require(_0xdf16('0xf'));var querystring=require(_0xdf16('0x10'));var Papa=require(_0xdf16('0x11'));var Redis=require(_0xdf16('0x12'));var authService=require(_0xdf16('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xdf16('0x14'));var hardwareService=require(_0xdf16('0x15'));var logger=require('../../config/logger')(_0xdf16('0x16'));var utils=require('../../config/utils');var config=require(_0xdf16('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xdf16('0x18')]=_[_0xdf16('0x19')](config[_0xdf16('0x18')],{'host':_0xdf16('0x1a'),'port':0x18eb});var socket=require(_0xdf16('0x1b'))(new Redis(config[_0xdf16('0x18')]));require(_0xdf16('0x1c'))[_0xdf16('0x1d')](socket);function respondWithStatusCode(_0x3fccb1,_0x52ff99){_0x52ff99=_0x52ff99||0xcc;return function(_0x1557f6){if(_0x1557f6){return _0x3fccb1[_0xdf16('0x1e')](_0x52ff99);}return _0x3fccb1[_0xdf16('0x1f')](_0x52ff99)[_0xdf16('0x20')]();};}function respondWithResult(_0x21c082,_0x35d412){_0x35d412=_0x35d412||0xc8;return function(_0x5e8052){if(_0x5e8052){return _0x21c082[_0xdf16('0x1f')](_0x35d412)['json'](_0x5e8052);}};}function respondWithFilteredResult(_0x5cdfbd,_0x56c915){return function(_0x2b9d83){if(_0x2b9d83){var _0x2606f4=typeof _0x56c915['offset']===_0xdf16('0x21')&&typeof _0x56c915[_0xdf16('0x22')]===_0xdf16('0x21');var _0x1260ef=_0x2b9d83[_0xdf16('0x23')];var _0x24bef8=_0x2606f4?0x0:_0x56c915[_0xdf16('0x24')];var _0x4e735b=_0x2606f4?_0x2b9d83[_0xdf16('0x23')]:_0x56c915[_0xdf16('0x24')]+_0x56c915[_0xdf16('0x22')];var _0x17e4c2;if(_0x4e735b>=_0x1260ef){_0x4e735b=_0x1260ef;_0x17e4c2=0xc8;}else{_0x17e4c2=0xce;}_0x5cdfbd[_0xdf16('0x1f')](_0x17e4c2);return _0x5cdfbd[_0xdf16('0x25')](_0xdf16('0x26'),_0x24bef8+'-'+_0x4e735b+'/'+_0x1260ef)[_0xdf16('0x27')](_0x2b9d83);}return null;};}function patchUpdates(_0x48c4b7){return function(_0x176032){try{jsonpatch[_0xdf16('0x28')](_0x176032,_0x48c4b7,!![]);}catch(_0xf48765){return BPromise['reject'](_0xf48765);}return _0x176032['save']();};}function saveUpdates(_0x27892a,_0x11fd58){return function(_0x2358f2){if(_0x2358f2){return _0x2358f2[_0xdf16('0x29')](_0x27892a)[_0xdf16('0x2a')](function(_0x379d33){return _0x379d33;});}return null;};}function removeEntity(_0x587682,_0x44e83e){return function(_0x1e27aa){if(_0x1e27aa){return _0x1e27aa[_0xdf16('0x2b')]()[_0xdf16('0x2a')](function(){var _0x1eb34b=_0x1e27aa[_0xdf16('0x2c')]({'plain':!![]});var _0x379816=_0xdf16('0x2d');return db['UserProfileResource'][_0xdf16('0x2b')]({'where':{'type':_0x379816,'resourceId':_0x1eb34b['id']}})[_0xdf16('0x2a')](function(){return _0x1e27aa;});})['then'](function(){_0x587682[_0xdf16('0x1f')](0xcc)[_0xdf16('0x20')]();});}};}function handleEntityNotFound(_0xc344d9,_0x1cc5ae){return function(_0x1ee4bd){if(!_0x1ee4bd){_0xc344d9[_0xdf16('0x1e')](0x194);}return _0x1ee4bd;};}function handleError(_0x1e121b,_0x2ad3e6){_0x2ad3e6=_0x2ad3e6||0x1f4;return function(_0x59b14a){logger[_0xdf16('0x2e')](_0x59b14a[_0xdf16('0x2f')]);if(_0x59b14a[_0xdf16('0x30')]){delete _0x59b14a[_0xdf16('0x30')];}_0x1e121b[_0xdf16('0x1f')](_0x2ad3e6)[_0xdf16('0x31')](_0x59b14a);};}exports['index']=function(_0x2bdcea,_0x5dcc55){var _0x9a197c={},_0x55154c={},_0x21fb8a={'count':0x0,'rows':[]};var _0x462511=_[_0xdf16('0x32')](db['Dashboard'][_0xdf16('0x33')],function(_0x16803e){return{'name':_0x16803e[_0xdf16('0x34')],'type':_0x16803e['type'][_0xdf16('0x35')]};});_0x55154c[_0xdf16('0x36')]=_[_0xdf16('0x32')](_0x462511,_0xdf16('0x30'));_0x55154c[_0xdf16('0x37')]=_[_0xdf16('0x38')](_0x2bdcea[_0xdf16('0x37')]);_0x55154c[_0xdf16('0x39')]=_['intersection'](_0x55154c[_0xdf16('0x36')],_0x55154c[_0xdf16('0x37')]);_0x9a197c[_0xdf16('0x3a')]=_[_0xdf16('0x3b')](_0x55154c[_0xdf16('0x36')],qs[_0xdf16('0x3c')](_0x2bdcea['query'][_0xdf16('0x3c')]));_0x9a197c[_0xdf16('0x3a')]=_0x9a197c['attributes'][_0xdf16('0x3d')]?_0x9a197c[_0xdf16('0x3a')]:_0x55154c[_0xdf16('0x36')];if(!_0x2bdcea['query'][_0xdf16('0x3e')]('nolimit')){_0x9a197c[_0xdf16('0x22')]=qs[_0xdf16('0x22')](_0x2bdcea[_0xdf16('0x37')]['limit']);_0x9a197c['offset']=qs[_0xdf16('0x24')](_0x2bdcea[_0xdf16('0x37')][_0xdf16('0x24')]);}_0x9a197c['order']=qs[_0xdf16('0x3f')](_0x2bdcea[_0xdf16('0x37')][_0xdf16('0x3f')]);_0x9a197c[_0xdf16('0x40')]=qs[_0xdf16('0x39')](_[_0xdf16('0x41')](_0x2bdcea['query'],_0x55154c[_0xdf16('0x39')]),_0x462511);if(_0x2bdcea[_0xdf16('0x37')][_0xdf16('0x42')]){_0x9a197c[_0xdf16('0x40')]=_[_0xdf16('0x43')](_0x9a197c[_0xdf16('0x40')],{'$or':_[_0xdf16('0x32')](_0x462511,function(_0x2d0df8){if(_0x2d0df8[_0xdf16('0x44')]!=='VIRTUAL'){var _0x41543b={};_0x41543b[_0x2d0df8[_0xdf16('0x30')]]={'$like':'%'+_0x2bdcea['query'][_0xdf16('0x42')]+'%'};return _0x41543b;}})});}_0x9a197c=_[_0xdf16('0x43')]({},_0x9a197c,_0x2bdcea[_0xdf16('0x45')]);var _0x496790={'where':_0x9a197c[_0xdf16('0x40')]};return db[_0xdf16('0x46')][_0xdf16('0x23')](_0x496790)[_0xdf16('0x2a')](function(_0xd83b36){_0x21fb8a[_0xdf16('0x23')]=_0xd83b36;if(_0x2bdcea['query'][_0xdf16('0x47')]){_0x9a197c[_0xdf16('0x48')]=[{'all':!![]}];}return db[_0xdf16('0x46')][_0xdf16('0x49')](_0x9a197c);})[_0xdf16('0x2a')](function(_0x23643f){_0x21fb8a[_0xdf16('0x4a')]=_0x23643f;return _0x21fb8a;})[_0xdf16('0x2a')](respondWithFilteredResult(_0x5dcc55,_0x9a197c))['catch'](handleError(_0x5dcc55,null));};exports[_0xdf16('0x4b')]=function(_0x22d696,_0x52c49e){var _0x5c524a={'raw':![],'where':{'id':_0x22d696[_0xdf16('0x4c')]['id']}},_0x4a4003={};_0x4a4003['model']=_[_0xdf16('0x38')](db[_0xdf16('0x46')]['rawAttributes']);_0x4a4003['query']=_[_0xdf16('0x38')](_0x22d696[_0xdf16('0x37')]);_0x4a4003[_0xdf16('0x39')]=_[_0xdf16('0x3b')](_0x4a4003[_0xdf16('0x36')],_0x4a4003['query']);_0x5c524a[_0xdf16('0x3a')]=_[_0xdf16('0x3b')](_0x4a4003[_0xdf16('0x36')],qs['fields'](_0x22d696['query'][_0xdf16('0x3c')]));_0x5c524a[_0xdf16('0x3a')]=_0x5c524a['attributes'][_0xdf16('0x3d')]?_0x5c524a[_0xdf16('0x3a')]:_0x4a4003['model'];if(_0x22d696[_0xdf16('0x37')][_0xdf16('0x47')]){_0x5c524a[_0xdf16('0x48')]=[{'all':!![]}];}_0x5c524a=_[_0xdf16('0x43')]({},_0x5c524a,_0x22d696[_0xdf16('0x45')]);return db[_0xdf16('0x46')][_0xdf16('0x4d')](_0x5c524a)[_0xdf16('0x2a')](handleEntityNotFound(_0x52c49e,null))[_0xdf16('0x2a')](respondWithResult(_0x52c49e,null))[_0xdf16('0x4e')](handleError(_0x52c49e,null));};exports[_0xdf16('0x4f')]=function(_0x26c384,_0xbc7139){return db['Dashboard'][_0xdf16('0x4f')](_0x26c384[_0xdf16('0x50')],{})[_0xdf16('0x2a')](function(_0x43d959){var _0x1a0274=_0x26c384[_0xdf16('0x51')]['get']({'plain':!![]});if(!_0x1a0274)throw new Error(_0xdf16('0x52'));if(_0x1a0274['role']===_0xdf16('0x51')){var _0x3acacc=_0x43d959['get']({'plain':!![]});var _0x13dd2a='CustomDashboards';return db['UserProfileSection'][_0xdf16('0x4d')]({'where':{'name':_0x13dd2a,'userProfileId':_0x1a0274[_0xdf16('0x53')]},'raw':!![]})[_0xdf16('0x2a')](function(_0x586e2e){if(_0x586e2e&&_0x586e2e[_0xdf16('0x54')]===0x0){return db[_0xdf16('0x55')][_0xdf16('0x4f')]({'name':_0x3acacc[_0xdf16('0x30')],'resourceId':_0x3acacc['id'],'type':_0x586e2e[_0xdf16('0x30')],'sectionId':_0x586e2e['id']},{})[_0xdf16('0x2a')](function(){return _0x43d959;});}else{return _0x43d959;}})[_0xdf16('0x4e')](function(_0x6fc6f0){logger[_0xdf16('0x2e')](_0xdf16('0x56'),_0x6fc6f0);throw _0x6fc6f0;});}return _0x43d959;})[_0xdf16('0x2a')](respondWithResult(_0xbc7139,0xc9))['catch'](handleError(_0xbc7139,null));};exports[_0xdf16('0x57')]=function(_0x42d940,_0x331da4){var _0xee7405={'where':{'id':_0x42d940[_0xdf16('0x4c')]['id']}},_0x1e79fc={};_0x1e79fc[_0xdf16('0x36')]=_[_0xdf16('0x38')](db['Dashboard'][_0xdf16('0x33')]);_0xee7405[_0xdf16('0x3a')]=_['intersection'](_0x1e79fc[_0xdf16('0x36')],qs[_0xdf16('0x3c')](_0x42d940[_0xdf16('0x37')][_0xdf16('0x3c')]));_0xee7405[_0xdf16('0x3a')]=_0xee7405[_0xdf16('0x3a')][_0xdf16('0x3d')]?_0xee7405[_0xdf16('0x3a')]:_0x1e79fc[_0xdf16('0x36')];if(_0x42d940[_0xdf16('0x37')][_0xdf16('0x47')]){_0xee7405['include']=[{'all':!![]}];}_0xee7405=_[_0xdf16('0x43')]({},_0xee7405,_0x42d940[_0xdf16('0x45')]);return db[_0xdf16('0x46')][_0xdf16('0x4d')](_0xee7405)[_0xdf16('0x2a')](handleEntityNotFound(_0x331da4,null))[_0xdf16('0x2a')](function(_0xcdd4f2){if(_0xcdd4f2){var _0x59a402=_0xcdd4f2[_0xdf16('0x2c')]({'plain':!![]});_0x59a402=qs[_0xdf16('0x58')](_0x59a402,['id','createdAt','updatedAt']);_0x42d940[_0xdf16('0x50')]=_[_0xdf16('0x58')](_0x42d940[_0xdf16('0x50')],['id','createdAt',_0xdf16('0x59')]);return db[_0xdf16('0x46')][_0xdf16('0x4f')](_[_0xdf16('0x43')](_0x59a402,_0x42d940[_0xdf16('0x50')]),{'include':_0x42d940['query'][_0xdf16('0x47')]?[{'all':!![]}]:undefined})[_0xdf16('0x2a')](function(_0x26298a){var _0x33296f=_0x42d940['user']['get']({'plain':!![]});if(!_0x33296f)throw new Error(_0xdf16('0x52'));if(_0x33296f[_0xdf16('0x5a')]===_0xdf16('0x51')){var _0x5ed021=_0x26298a['get']({'plain':!![]});var _0x5cc306=_0xdf16('0x2d');return db[_0xdf16('0x5b')][_0xdf16('0x4d')]({'where':{'name':_0x5cc306,'userProfileId':_0x33296f[_0xdf16('0x53')]},'raw':!![]})[_0xdf16('0x2a')](function(_0x3ee8d7){if(_0x3ee8d7&&_0x3ee8d7[_0xdf16('0x54')]===0x0){return db[_0xdf16('0x55')][_0xdf16('0x4f')]({'name':_0x5ed021[_0xdf16('0x30')],'resourceId':_0x5ed021['id'],'type':_0x3ee8d7[_0xdf16('0x30')],'sectionId':_0x3ee8d7['id']},{})[_0xdf16('0x2a')](function(){return _0x26298a;});}else{return _0x26298a;}})[_0xdf16('0x4e')](function(_0x5d5163){logger[_0xdf16('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d5163);throw _0x5d5163;});}return _0x26298a;});}})[_0xdf16('0x2a')](respondWithResult(_0x331da4,0xc9))['catch'](handleError(_0x331da4,null));};exports[_0xdf16('0x29')]=function(_0x2ee497,_0x4989a8){if(_0x2ee497['body']['id']){delete _0x2ee497[_0xdf16('0x50')]['id'];}return db[_0xdf16('0x46')][_0xdf16('0x4d')]({'where':{'id':_0x2ee497[_0xdf16('0x4c')]['id']}})[_0xdf16('0x2a')](handleEntityNotFound(_0x4989a8,null))['then'](saveUpdates(_0x2ee497[_0xdf16('0x50')],null))[_0xdf16('0x2a')](respondWithResult(_0x4989a8,null))[_0xdf16('0x4e')](handleError(_0x4989a8,null));};exports[_0xdf16('0x2b')]=function(_0x3207c0,_0xe71cf4){return db[_0xdf16('0x46')]['find']({'where':{'id':_0x3207c0['params']['id']}})[_0xdf16('0x2a')](handleEntityNotFound(_0xe71cf4,null))[_0xdf16('0x2a')](removeEntity(_0xe71cf4,null))['catch'](handleError(_0xe71cf4,null));};function widgetAttributes(_0x1cf565){try{switch(_0x1cf565['type']){case _0xdf16('0x5c'):return[{'name':_0xdf16('0x5d'),'value':_0x1cf565['attrUrl']||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565['attrs'][0x0]?_0x1cf565[_0xdf16('0x5e')][0x0][_0xdf16('0x5f')]:undefined)||_0xdf16('0x60')}];case'custom':return[{'name':_0xdf16('0x61'),'value':_0x1cf565['attrPath']||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565['attrs'][0x0]?_0x1cf565[_0xdf16('0x5e')][0x0][_0xdf16('0x5f')]:undefined)||''}];case _0xdf16('0x62'):return[{'name':_0xdf16('0x63'),'value':_0x1cf565[_0xdf16('0x63')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x0]?_0x1cf565['attrs'][0x0]['value']:undefined)||_0xdf16('0x64')},{'name':_0xdf16('0x65'),'value':_0x1cf565[_0xdf16('0x65')]||(_0x1cf565['attrs']&&_0x1cf565['attrs'][0x1]?_0x1cf565[_0xdf16('0x5e')][0x1][_0xdf16('0x5f')]:undefined)||_0xdf16('0x66')},{'name':_0xdf16('0x67'),'value':_0x1cf565[_0xdf16('0x67')]||(_0x1cf565['attrs']&&_0x1cf565[_0xdf16('0x5e')][0x2]?_0x1cf565[_0xdf16('0x5e')][0x2][_0xdf16('0x5f')]:undefined)||0xc}];case _0xdf16('0x68'):return[{'name':_0xdf16('0x69'),'value':_0x1cf565['attrMetric']||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x0]?_0x1cf565[_0xdf16('0x5e')][0x0][_0xdf16('0x5f')]:undefined)||_0xdf16('0x6a')},{'name':_0xdf16('0x6b'),'value':_0x1cf565[_0xdf16('0x6b')]||(_0x1cf565['attrs']&&_0x1cf565[_0xdf16('0x5e')][0x1]?_0x1cf565[_0xdf16('0x5e')][0x1][_0xdf16('0x5f')]:undefined)||[]},{'name':'attrFontSize','value':_0x1cf565[_0xdf16('0x67')]||(_0x1cf565['attrs']&&_0x1cf565[_0xdf16('0x5e')][0x2]?_0x1cf565[_0xdf16('0x5e')][0x2][_0xdf16('0x5f')]:undefined)||0x14},{'name':_0xdf16('0x6c'),'value':_0x1cf565[_0xdf16('0x6c')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x3]?_0x1cf565[_0xdf16('0x5e')][0x3][_0xdf16('0x5f')]:undefined)||_0xdf16('0x6d')},{'name':_0xdf16('0x6e'),'value':_0x1cf565[_0xdf16('0x6e')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x4]?_0x1cf565[_0xdf16('0x5e')][0x4][_0xdf16('0x5f')]:undefined)||''},{'name':_0xdf16('0x6f'),'value':_0x1cf565['attrFaxAccounts']||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565['attrs'][0x5]?_0x1cf565[_0xdf16('0x5e')][0x5][_0xdf16('0x5f')]:undefined)||''},{'name':_0xdf16('0x70'),'value':_0x1cf565[_0xdf16('0x70')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x6]?_0x1cf565[_0xdf16('0x5e')][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x1cf565[_0xdf16('0x71')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x7]?_0x1cf565['attrs'][0x7][_0xdf16('0x5f')]:undefined)||''},{'name':_0xdf16('0x72'),'value':_0x1cf565[_0xdf16('0x72')]||(_0x1cf565['attrs']&&_0x1cf565[_0xdf16('0x5e')][0x8]?_0x1cf565[_0xdf16('0x5e')][0x8][_0xdf16('0x5f')]:undefined)||''},{'name':'attrChatWebsites','value':_0x1cf565[_0xdf16('0x73')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x9]?_0x1cf565[_0xdf16('0x5e')][0x9][_0xdf16('0x5f')]:undefined)||''}];case _0xdf16('0x74'):case _0xdf16('0x75'):return[{'name':_0xdf16('0x76'),'value':_0x1cf565[_0xdf16('0x76')]||(_0x1cf565['attrs']&&_0x1cf565['attrs'][0x0]?_0x1cf565[_0xdf16('0x5e')][0x0][_0xdf16('0x5f')]:undefined)||_0xdf16('0x6a')},{'name':'attrSerie2','value':_0x1cf565[_0xdf16('0x77')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x1]?_0x1cf565[_0xdf16('0x5e')][0x1]['value']:undefined)||null},{'name':_0xdf16('0x78'),'value':_0x1cf565['attrSerie3']||(_0x1cf565['attrs']&&_0x1cf565[_0xdf16('0x5e')][0x2]?_0x1cf565[_0xdf16('0x5e')][0x2][_0xdf16('0x5f')]:undefined)||null},{'name':_0xdf16('0x6b'),'value':_0x1cf565[_0xdf16('0x6b')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x3]?_0x1cf565[_0xdf16('0x5e')][0x3][_0xdf16('0x5f')]:undefined)||[]},{'name':_0xdf16('0x6c'),'value':_0x1cf565[_0xdf16('0x6c')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x4]?_0x1cf565[_0xdf16('0x5e')][0x4][_0xdf16('0x5f')]:undefined)||_0xdf16('0x6d')},{'name':_0xdf16('0x6e'),'value':_0x1cf565['attrEmailAccounts']||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x5]?_0x1cf565['attrs'][0x5][_0xdf16('0x5f')]:undefined)||''},{'name':_0xdf16('0x6f'),'value':_0x1cf565[_0xdf16('0x6f')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x6]?_0x1cf565[_0xdf16('0x5e')][0x6]['value']:undefined)||''},{'name':_0xdf16('0x70'),'value':_0x1cf565[_0xdf16('0x70')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565['attrs'][0x7]?_0x1cf565[_0xdf16('0x5e')][0x7]['value']:undefined)||''},{'name':_0xdf16('0x71'),'value':_0x1cf565[_0xdf16('0x71')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x8]?_0x1cf565[_0xdf16('0x5e')][0x8][_0xdf16('0x5f')]:undefined)||''},{'name':_0xdf16('0x72'),'value':_0x1cf565[_0xdf16('0x72')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x9]?_0x1cf565['attrs'][0x9][_0xdf16('0x5f')]:undefined)||''},{'name':_0xdf16('0x73'),'value':_0x1cf565[_0xdf16('0x73')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0xa]?_0x1cf565[_0xdf16('0x5e')][0xa]['value']:undefined)||''}];case _0xdf16('0x79'):return[{'name':_0xdf16('0x7a'),'type':_0x1cf565[_0xdf16('0x7b')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x0]?_0x1cf565[_0xdf16('0x5e')][0x0]['type']:undefined)||null,'value':_0x1cf565[_0xdf16('0x7a')]||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x0]?_0x1cf565[_0xdf16('0x5e')][0x0][_0xdf16('0x5f')]:undefined)||null},{'name':'attrRefresh','value':_0x1cf565['attrRefresh']||(_0x1cf565[_0xdf16('0x5e')]&&_0x1cf565[_0xdf16('0x5e')][0x1]?_0x1cf565[_0xdf16('0x5e')][0x1][_0xdf16('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x2eff41){logger['error']('widgetAttributes:\x20%s',JSON[_0xdf16('0x7c')](_0x2eff41));return[];}}exports[_0xdf16('0x7d')]=function(_0x526e81,_0x33d1a0,_0x123f77){if(_0x526e81[_0xdf16('0x50')]['id']){delete _0x526e81['body']['id'];}return db[_0xdf16('0x46')][_0xdf16('0x4d')]({'where':{'id':_0x526e81[_0xdf16('0x4c')]['id']}})[_0xdf16('0x2a')](handleEntityNotFound(_0x33d1a0,null))[_0xdf16('0x2a')](function(_0x55d815){if(_0x55d815){_0x526e81[_0xdf16('0x50')]['DashboardId']=_0x55d815['id'];_0x526e81['body'][_0xdf16('0x5e')]=widgetAttributes(_0x526e81[_0xdf16('0x50')]);return db[_0xdf16('0x7e')]['create'](_0x526e81[_0xdf16('0x50')]);}})[_0xdf16('0x2a')](respondWithResult(_0x33d1a0,null))[_0xdf16('0x4e')](handleError(_0x33d1a0,null));};exports[_0xdf16('0x7f')]=function(_0x4a18ee,_0x459ea7,_0x1469f3){var _0x2833c3={};var _0x36bd13={};var _0x30e113;var _0x455be4;return db[_0xdf16('0x46')][_0xdf16('0x80')]({'where':{'id':_0x4a18ee[_0xdf16('0x4c')]['id']}})[_0xdf16('0x2a')](handleEntityNotFound(_0x459ea7,null))[_0xdf16('0x2a')](function(_0x5ef04e){if(_0x5ef04e){_0x30e113=_0x5ef04e;_0x36bd13[_0xdf16('0x36')]=_[_0xdf16('0x38')](db[_0xdf16('0x7e')][_0xdf16('0x33')]);_0x36bd13['query']=_[_0xdf16('0x38')](_0x4a18ee[_0xdf16('0x37')]);_0x36bd13[_0xdf16('0x39')]=_[_0xdf16('0x3b')](_0x36bd13[_0xdf16('0x36')],_0x36bd13[_0xdf16('0x37')]);_0x2833c3[_0xdf16('0x3a')]=_[_0xdf16('0x3b')](_0x36bd13[_0xdf16('0x36')],qs[_0xdf16('0x3c')](_0x4a18ee[_0xdf16('0x37')][_0xdf16('0x3c')]));_0x2833c3['attributes']=_0x2833c3['attributes'][_0xdf16('0x3d')]?_0x2833c3[_0xdf16('0x3a')]:_0x36bd13[_0xdf16('0x36')];_0x2833c3[_0xdf16('0x81')]=qs[_0xdf16('0x3f')](_0x4a18ee[_0xdf16('0x37')][_0xdf16('0x3f')]);_0x2833c3[_0xdf16('0x40')]=qs[_0xdf16('0x39')](_[_0xdf16('0x41')](_0x4a18ee[_0xdf16('0x37')],_0x36bd13[_0xdf16('0x39')]));if(_0x4a18ee[_0xdf16('0x37')][_0xdf16('0x42')]){_0x2833c3[_0xdf16('0x40')]=_['merge'](_0x2833c3['where'],{'$or':_[_0xdf16('0x32')](_0x2833c3[_0xdf16('0x3a')],function(_0x4c9568){var _0xad67ca={};_0xad67ca[_0x4c9568]={'$like':'%'+_0x4a18ee[_0xdf16('0x37')][_0xdf16('0x42')]+'%'};return _0xad67ca;})});}_0x2833c3=_['merge']({},_0x2833c3,_0x4a18ee[_0xdf16('0x45')]);return _0x30e113['getItems'](_0x2833c3);}})[_0xdf16('0x2a')](function(_0xbba289){if(_0xbba289){_0x455be4=_0xbba289[_0xdf16('0x3d')];if(!_0x4a18ee[_0xdf16('0x37')]['hasOwnProperty'](_0xdf16('0x82'))){_0x2833c3[_0xdf16('0x22')]=qs[_0xdf16('0x22')](_0x4a18ee[_0xdf16('0x37')]['limit']);_0x2833c3['offset']=qs[_0xdf16('0x24')](_0x4a18ee[_0xdf16('0x37')][_0xdf16('0x24')]);}return _0x30e113[_0xdf16('0x7f')](_0x2833c3);}})[_0xdf16('0x2a')](function(_0x49afed){if(_0x49afed){return _0x49afed?{'count':_0x455be4,'rows':_0x49afed}:null;}})[_0xdf16('0x2a')](respondWithResult(_0x459ea7,null))[_0xdf16('0x4e')](handleError(_0x459ea7,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 83a3bc9..21936a5 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 _0xabac=['emit','hasOwnProperty','exports','events','../../mysqldb','Dashboard'];(function(_0x4fa438,_0x1f15a7){var _0x4e3958=function(_0x28f510){while(--_0x28f510){_0x4fa438['push'](_0x4fa438['shift']());}};_0x4e3958(++_0x1f15a7);}(_0xabac,0x1dd));var _0xcaba=function(_0x1a1de1,_0x6938a6){_0x1a1de1=_0x1a1de1-0x0;var _0x170706=_0xabac[_0x1a1de1];return _0x170706;};'use strict';var EventEmitter=require(_0xcaba('0x0'));var Dashboard=require(_0xcaba('0x1'))['db'][_0xcaba('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2b0c48){return function(_0x4676f3,_0x1c169f,_0x4ee126){DashboardEvents[_0xcaba('0x3')](_0x2b0c48+':'+_0x4676f3['id'],_0x4676f3);DashboardEvents[_0xcaba('0x3')](_0x2b0c48,_0x4676f3);_0x4ee126(null);};}for(var e in events){if(events[_0xcaba('0x4')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xcaba('0x5')]=DashboardEvents; \ No newline at end of file +var _0xbeff=['hasOwnProperty','hook','exports','events','setMaxListeners','save','remove','emit'];(function(_0x14a2e3,_0x4b8009){var _0x1277d9=function(_0x15c805){while(--_0x15c805){_0x14a2e3['push'](_0x14a2e3['shift']());}};_0x1277d9(++_0x4b8009);}(_0xbeff,0x14b));var _0xfbef=function(_0x3378ae,_0x39af6b){_0x3378ae=_0x3378ae-0x0;var _0x4892e7=_0xbeff[_0x3378ae];return _0x4892e7;};'use strict';var EventEmitter=require(_0xfbef('0x0'));var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xfbef('0x1')](0x0);var events={'afterCreate':_0xfbef('0x2'),'afterUpdate':'update','afterDestroy':_0xfbef('0x3')};function emitEvent(_0x13da02){return function(_0x281e14,_0x159047,_0x150bab){DashboardEvents[_0xfbef('0x4')](_0x13da02+':'+_0x281e14['id'],_0x281e14);DashboardEvents[_0xfbef('0x4')](_0x13da02,_0x281e14);_0x150bab(null);};}for(var e in events){if(events[_0xfbef('0x5')](e)){var event=events[e];Dashboard[_0xfbef('0x6')](e,emitEvent(event));}}module[_0xfbef('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 f0ff431..32d64ca 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 _0x0e8f=['request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','util','api','bluebird'];(function(_0x48d45e,_0x568691){var _0x419141=function(_0x1d60b6){while(--_0x1d60b6){_0x48d45e['push'](_0x48d45e['shift']());}};_0x419141(++_0x568691);}(_0x0e8f,0x1c5));var _0xf0e8=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x0e8f[_0x5d4607];return _0x5e4a86;};'use strict';var _=require('lodash');var util=require(_0xf0e8('0x0'));var logger=require('../../config/logger')(_0xf0e8('0x1'));var moment=require('moment');var BPromise=require(_0xf0e8('0x2'));var rp=require(_0xf0e8('0x3'));var fs=require('fs');var path=require(_0xf0e8('0x4'));var rimraf=require(_0xf0e8('0x5'));var config=require(_0xf0e8('0x6'));var attributes=require(_0xf0e8('0x7'));module[_0xf0e8('0x8')]=function(_0x286af9,_0x28df36){return _0x286af9[_0xf0e8('0x9')](_0xf0e8('0xa'),attributes,{'tableName':_0xf0e8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4abf=['moment','request-promise','path','rimraf','../../config/environment','define','Dashboard','dashboards','lodash','util','../../config/logger','api'];(function(_0x19042a,_0x5d5f34){var _0x368e80=function(_0xf95424){while(--_0xf95424){_0x19042a['push'](_0x19042a['shift']());}};_0x368e80(++_0x5d5f34);}(_0x4abf,0x8c));var _0xf4ab=function(_0x3ec510,_0x196121){_0x3ec510=_0x3ec510-0x0;var _0x30a8f7=_0x4abf[_0x3ec510];return _0x30a8f7;};'use strict';var _=require(_0xf4ab('0x0'));var util=require(_0xf4ab('0x1'));var logger=require(_0xf4ab('0x2'))(_0xf4ab('0x3'));var moment=require(_0xf4ab('0x4'));var BPromise=require('bluebird');var rp=require(_0xf4ab('0x5'));var fs=require('fs');var path=require(_0xf4ab('0x6'));var rimraf=require(_0xf4ab('0x7'));var config=require(_0xf4ab('0x8'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x2b66bd,_0x10079e){return _0x2b66bd[_0xf4ab('0x9')](_0xf4ab('0xa'),attributes,{'tableName':_0xf4ab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index f86af06..0c7565c 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 _0x1260=['request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register'];(function(_0x2b3d8f,_0x545a31){var _0xc44f2e=function(_0x5b0d55){while(--_0x5b0d55){_0x2b3d8f['push'](_0x2b3d8f['shift']());}};_0xc44f2e(++_0x545a31);}(_0x1260,0x15d));var _0x0126=function(_0x4b2645,_0xabae49){_0x4b2645=_0x4b2645-0x0;var _0xdc5f2=_0x1260[_0x4b2645];return _0xdc5f2;};'use strict';var _=require(_0x0126('0x0'));var util=require(_0x0126('0x1'));var moment=require('moment');var BPromise=require(_0x0126('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0126('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0126('0x4'))(_0x0126('0x5'));var config=require(_0x0126('0x6'));var jayson=require(_0x0126('0x7'));var client=jayson['client'][_0x0126('0x8')]({'port':0x232a});config[_0x0126('0x9')]=_[_0x0126('0xa')](config[_0x0126('0x9')],{'host':_0x0126('0xb'),'port':0x18eb});var socket=require(_0x0126('0xc'))(new Redis(config[_0x0126('0x9')]));require(_0x0126('0xd'))[_0x0126('0xe')](socket);function respondWithRpcPromise(_0x39b789,_0x5f4746,_0x4e7693){return new BPromise(function(_0xabc44f,_0x2c87c4){return client[_0x0126('0xf')](_0x39b789,_0x4e7693)[_0x0126('0x10')](function(_0xf4eb12){logger[_0x0126('0x11')](_0x0126('0x12'),_0x5f4746,_0x0126('0x13'));logger[_0x0126('0x14')](_0x0126('0x15'),_0x5f4746,_0x0126('0x13'),JSON[_0x0126('0x16')](_0xf4eb12));if(_0xf4eb12['error']){if(_0xf4eb12[_0x0126('0x17')][_0x0126('0x18')]===0x1f4){logger['error'](_0x0126('0x12'),_0x5f4746,_0xf4eb12[_0x0126('0x17')][_0x0126('0x19')]);return _0x2c87c4(_0xf4eb12[_0x0126('0x17')][_0x0126('0x19')]);}logger[_0x0126('0x17')](_0x0126('0x12'),_0x5f4746,_0xf4eb12[_0x0126('0x17')][_0x0126('0x19')]);return _0xabc44f(_0xf4eb12[_0x0126('0x17')][_0x0126('0x19')]);}else{logger[_0x0126('0x11')](_0x0126('0x12'),_0x5f4746,'request\x20sent');_0xabc44f(_0xf4eb12[_0x0126('0x1a')][_0x0126('0x19')]);}})[_0x0126('0x1b')](function(_0x1a0a5b){logger[_0x0126('0x17')](_0x0126('0x12'),_0x5f4746,_0x1a0a5b);_0x2c87c4(_0x1a0a5b);});});} \ No newline at end of file +var _0x8d56=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboard.socket','register','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0xc1f465,_0x469e9e){var _0x2a092e=function(_0x123b1a){while(--_0x123b1a){_0xc1f465['push'](_0xc1f465['shift']());}};_0x2a092e(++_0x469e9e);}(_0x8d56,0x128));var _0x68d5=function(_0x396466,_0xe9857b){_0x396466=_0x396466-0x0;var _0x5e9ab4=_0x8d56[_0x396466];return _0x5e9ab4;};'use strict';var _=require(_0x68d5('0x0'));var util=require(_0x68d5('0x1'));var moment=require('moment');var BPromise=require(_0x68d5('0x2'));var rs=require(_0x68d5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x68d5('0x4'))['db'];var utils=require(_0x68d5('0x5'));var logger=require(_0x68d5('0x6'))(_0x68d5('0x7'));var config=require('../../config/environment');var jayson=require(_0x68d5('0x8'));var client=jayson[_0x68d5('0x9')][_0x68d5('0xa')]({'port':0x232a});config[_0x68d5('0xb')]=_['defaults'](config[_0x68d5('0xb')],{'host':_0x68d5('0xc'),'port':0x18eb});var socket=require(_0x68d5('0xd'))(new Redis(config[_0x68d5('0xb')]));require(_0x68d5('0xe'))[_0x68d5('0xf')](socket);function respondWithRpcPromise(_0x3ffbcc,_0x26a938,_0x22fbfa){return new BPromise(function(_0x4fe842,_0x347977){return client['request'](_0x3ffbcc,_0x22fbfa)[_0x68d5('0x10')](function(_0x52c854){logger[_0x68d5('0x11')](_0x68d5('0x12'),_0x26a938,_0x68d5('0x13'));logger[_0x68d5('0x14')](_0x68d5('0x15'),_0x26a938,'request\x20sent',JSON[_0x68d5('0x16')](_0x52c854));if(_0x52c854[_0x68d5('0x17')]){if(_0x52c854[_0x68d5('0x17')][_0x68d5('0x18')]===0x1f4){logger[_0x68d5('0x17')]('Dashboard,\x20%s,\x20%s',_0x26a938,_0x52c854[_0x68d5('0x17')][_0x68d5('0x19')]);return _0x347977(_0x52c854[_0x68d5('0x17')][_0x68d5('0x19')]);}logger['error']('Dashboard,\x20%s,\x20%s',_0x26a938,_0x52c854[_0x68d5('0x17')]['message']);return _0x4fe842(_0x52c854[_0x68d5('0x17')][_0x68d5('0x19')]);}else{logger[_0x68d5('0x11')](_0x68d5('0x12'),_0x26a938,_0x68d5('0x13'));_0x4fe842(_0x52c854['result'][_0x68d5('0x19')]);}})[_0x68d5('0x1a')](function(_0x2aeb71){logger[_0x68d5('0x17')](_0x68d5('0x12'),_0x26a938,_0x2aeb71);_0x347977(_0x2aeb71);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index ce45fce..26887ec 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 _0x0732=['dashboard:','./dashboard.events','save','remove','update','emit','removeListener','register','length'];(function(_0x303663,_0x53f318){var _0x3849bd=function(_0x34d0dc){while(--_0x34d0dc){_0x303663['push'](_0x303663['shift']());}};_0x3849bd(++_0x53f318);}(_0x0732,0x184));var _0x2073=function(_0x2fc2e4,_0xf15e31){_0x2fc2e4=_0x2fc2e4-0x0;var _0x21d7b3=_0x0732[_0x2fc2e4];return _0x21d7b3;};'use strict';var DashboardEvents=require(_0x2073('0x0'));var events=[_0x2073('0x1'),_0x2073('0x2'),_0x2073('0x3')];function createListener(_0x235b4e,_0x329e4a){return function(_0x5b4b25){_0x329e4a[_0x2073('0x4')](_0x235b4e,_0x5b4b25);};}function removeListener(_0x3aeaeb,_0x28266c){return function(){DashboardEvents[_0x2073('0x5')](_0x3aeaeb,_0x28266c);};}exports[_0x2073('0x6')]=function(_0x4525da){for(var _0x22eea5=0x0,_0x317b28=events[_0x2073('0x7')];_0x22eea5<_0x317b28;_0x22eea5++){var _0x283934=events[_0x22eea5];var _0x48504d=createListener(_0x2073('0x8')+_0x283934,_0x4525da);DashboardEvents['on'](_0x283934,_0x48504d);}}; \ No newline at end of file +var _0xc521=['save','remove','update','emit','./dashboard.events'];(function(_0x177b03,_0x128b63){var _0x5a5b23=function(_0x2e054c){while(--_0x2e054c){_0x177b03['push'](_0x177b03['shift']());}};_0x5a5b23(++_0x128b63);}(_0xc521,0x171));var _0x1c52=function(_0xbc6b6d,_0x2085e7){_0xbc6b6d=_0xbc6b6d-0x0;var _0x5e2937=_0xc521[_0xbc6b6d];return _0x5e2937;};'use strict';var DashboardEvents=require(_0x1c52('0x0'));var events=[_0x1c52('0x1'),_0x1c52('0x2'),_0x1c52('0x3')];function createListener(_0x142a2b,_0x83afb6){return function(_0x4fd0df){_0x83afb6[_0x1c52('0x4')](_0x142a2b,_0x4fd0df);};}function removeListener(_0x212eea,_0x4df419){return function(){DashboardEvents['removeListener'](_0x212eea,_0x4df419);};}exports['register']=function(_0x703b62){for(var _0x40a070=0x0,_0x5a1b93=events['length'];_0x40a070<_0x5a1b93;_0x40a070++){var _0x4c71c8=events[_0x40a070];var _0x35148d=createListener('dashboard:'+_0x4c71c8,_0x703b62);DashboardEvents['on'](_0x4c71c8,_0x35148d);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 957dc81..0d3a01e 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 _0x4940=['/:id/clone','clone','update','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/items','post','create'];(function(_0x528fb8,_0x14d80c){var _0x3a2a6d=function(_0x1634f2){while(--_0x1634f2){_0x528fb8['push'](_0x528fb8['shift']());}};_0x3a2a6d(++_0x14d80c);}(_0x4940,0x15a));var _0x0494=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4940[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x0494('0x0'));var util=require(_0x0494('0x1'));var path=require('path');var timeout=require(_0x0494('0x2'));var express=require('express');var router=express[_0x0494('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0494('0x4'));var interaction=require(_0x0494('0x5'));var config=require(_0x0494('0x6'));var controller=require('./dashboard.controller');router[_0x0494('0x7')]('/',auth[_0x0494('0x8')](),controller[_0x0494('0x9')]);router['get'](_0x0494('0xa'),auth[_0x0494('0x8')](),controller[_0x0494('0xb')]);router['get'](_0x0494('0xc'),auth['isAuthenticated'](),controller['getItems']);router[_0x0494('0xd')]('/',auth[_0x0494('0x8')](),controller[_0x0494('0xe')]);router['post'](_0x0494('0xf'),auth[_0x0494('0x8')](),controller[_0x0494('0x10')]);router[_0x0494('0xd')]('/:id/items',auth[_0x0494('0x8')](),controller['addItem']);router['put'](_0x0494('0xa'),auth[_0x0494('0x8')](),controller[_0x0494('0x11')]);router['delete'](_0x0494('0xa'),auth[_0x0494('0x8')](),controller['destroy']);module[_0x0494('0x12')]=router; \ No newline at end of file +var _0x3584=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','getItems','post','/:id/clone','clone','update','exports','multer'];(function(_0x345ac8,_0x2daa49){var _0x552f86=function(_0x2210b8){while(--_0x2210b8){_0x345ac8['push'](_0x345ac8['shift']());}};_0x552f86(++_0x2daa49);}(_0x3584,0xe6));var _0x4358=function(_0x393b18,_0x3ac010){_0x393b18=_0x393b18-0x0;var _0x310964=_0x3584[_0x393b18];return _0x310964;};'use strict';var multer=require(_0x4358('0x0'));var util=require(_0x4358('0x1'));var path=require(_0x4358('0x2'));var timeout=require(_0x4358('0x3'));var express=require(_0x4358('0x4'));var router=express[_0x4358('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4358('0x6'));var interaction=require(_0x4358('0x7'));var config=require(_0x4358('0x8'));var controller=require(_0x4358('0x9'));router[_0x4358('0xa')]('/',auth[_0x4358('0xb')](),controller[_0x4358('0xc')]);router[_0x4358('0xa')](_0x4358('0xd'),auth[_0x4358('0xb')](),controller[_0x4358('0xe')]);router[_0x4358('0xa')]('/:id/items',auth[_0x4358('0xb')](),controller[_0x4358('0xf')]);router[_0x4358('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4358('0x10')](_0x4358('0x11'),auth[_0x4358('0xb')](),controller[_0x4358('0x12')]);router['post']('/:id/items',auth[_0x4358('0xb')](),controller['addItem']);router['put'](_0x4358('0xd'),auth[_0x4358('0xb')](),controller[_0x4358('0x13')]);router['delete']('/:id',auth[_0x4358('0xb')](),controller['destroy']);module[_0x4358('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 82680dd..e2195d3 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 _0x71ab=['setDataValue','stringify','INTEGER','#2196f3','squel','exports','STRING','TEXT','long','parse','getDataValue','attrs'];(function(_0xfd495c,_0x4a3c1a){var _0x561dd8=function(_0x83e915){while(--_0x83e915){_0xfd495c['push'](_0xfd495c['shift']());}};_0x561dd8(++_0x4a3c1a);}(_0x71ab,0x64));var _0xb71a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x71ab[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require('sequelize');var squel=require(_0xb71a('0x0'));var _=require('lodash');module[_0xb71a('0x1')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb71a('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb71a('0x3')](_0xb71a('0x4')),'get':function(){try{return JSON[_0xb71a('0x5')](this[_0xb71a('0x6')](_0xb71a('0x7')));}catch(_0x2192e8){return[];}},'set':function(_0x38d931){try{this[_0xb71a('0x8')](_0xb71a('0x7'),JSON[_0xb71a('0x9')](_0x38d931));}catch(_0x2a4c86){this[_0xb71a('0x8')](_0xb71a('0x7'),JSON[_0xb71a('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xb71a('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb71a('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb71a('0xa')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0xb71a('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb71a('0x2')],'allowNull':![],'defaultValue':_0xb71a('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb71a('0x2')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0xabce=['squel','lodash','exports','STRING','long','parse','getDataValue','attrs','setDataValue','INTEGER','#ffffff','#2196f3','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0xabce[_0x397cfb];return _0x15fed9;};'use strict';var Sequelize=require(_0xeabc('0x0'));var squel=require(_0xeabc('0x1'));var _=require(_0xeabc('0x2'));module[_0xeabc('0x3')]={'title':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xeabc('0x5')),'get':function(){try{return JSON[_0xeabc('0x6')](this[_0xeabc('0x7')]('attrs'));}catch(_0x54e4a8){return[];}},'set':function(_0x1b07a8){try{this['setDataValue'](_0xeabc('0x8'),JSON['stringify'](_0x1b07a8));}catch(_0x3bdc29){this[_0xeabc('0x9')](_0xeabc('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xeabc('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xeabc('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xeabc('0xa')]},'col':{'type':Sequelize[_0xeabc('0xa')]},'background':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![],'defaultValue':_0xeabc('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xeabc('0x4')],'allowNull':![],'defaultValue':_0xeabc('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xeabc('0x4')]},'titleFontSize':{'type':Sequelize[_0xeabc('0xa')],'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 2951227..16e4abd 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 _0x8375=['attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','attrRefresh','stringify','create','update','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','show','params','DashboardItem','rawAttributes','query','filters','intersection','model','attributes','fields','includeAll','options','catch','type','iframe','attrUrl','attrs','custom','attrPath','value','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts'];(function(_0x58400d,_0x104621){var _0x28bfb6=function(_0x2732d7){while(--_0x2732d7){_0x58400d['push'](_0x58400d['shift']());}};_0x28bfb6(++_0x104621);}(_0x8375,0x132));var _0x5837=function(_0x4d8d91,_0xf1c804){_0x4d8d91=_0x4d8d91-0x0;var _0x574f26=_0x8375[_0x4d8d91];return _0x574f26;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5837('0x0'));var zipdir=require(_0x5837('0x1'));var jsonpatch=require(_0x5837('0x2'));var rp=require(_0x5837('0x3'));var moment=require(_0x5837('0x4'));var BPromise=require(_0x5837('0x5'));var Mustache=require('mustache');var util=require(_0x5837('0x6'));var path=require(_0x5837('0x7'));var sox=require('sox');var csv=require(_0x5837('0x8'));var ejs=require(_0x5837('0x9'));var fs=require('fs');var fs_extra=require(_0x5837('0xa'));var _=require(_0x5837('0xb'));var squel=require('squel');var crypto=require(_0x5837('0xc'));var jsforce=require(_0x5837('0xd'));var deskjs=require(_0x5837('0xe'));var toCsv=require(_0x5837('0x8'));var querystring=require(_0x5837('0xf'));var Papa=require(_0x5837('0x10'));var Redis=require(_0x5837('0x11'));var authService=require(_0x5837('0x12'));var qs=require(_0x5837('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5837('0x14'));var logger=require(_0x5837('0x15'))('api');var utils=require(_0x5837('0x16'));var config=require(_0x5837('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5837('0x18'))['db'];config['redis']=_[_0x5837('0x19')](config[_0x5837('0x1a')],{'host':_0x5837('0x1b'),'port':0x18eb});var socket=require(_0x5837('0x1c'))(new Redis(config['redis']));require(_0x5837('0x1d'))[_0x5837('0x1e')](socket);function respondWithStatusCode(_0x2bc6f6,_0x5bc01f){_0x5bc01f=_0x5bc01f||0xcc;return function(_0x292949){if(_0x292949){return _0x2bc6f6[_0x5837('0x1f')](_0x5bc01f);}return _0x2bc6f6[_0x5837('0x20')](_0x5bc01f)[_0x5837('0x21')]();};}function respondWithResult(_0x304fe7,_0x2eb338){_0x2eb338=_0x2eb338||0xc8;return function(_0x4adc98){if(_0x4adc98){return _0x304fe7['status'](_0x2eb338)['json'](_0x4adc98);}};}function respondWithFilteredResult(_0x37824b,_0x106824){return function(_0x1a5725){if(_0x1a5725){var _0x423a9f=typeof _0x106824[_0x5837('0x22')]===_0x5837('0x23')&&typeof _0x106824[_0x5837('0x24')]==='undefined';var _0x3c5ec9=_0x1a5725[_0x5837('0x25')];var _0x295ae3=_0x423a9f?0x0:_0x106824[_0x5837('0x22')];var _0x387809=_0x423a9f?_0x1a5725['count']:_0x106824['offset']+_0x106824[_0x5837('0x24')];var _0x21c0bf;if(_0x387809>=_0x3c5ec9){_0x387809=_0x3c5ec9;_0x21c0bf=0xc8;}else{_0x21c0bf=0xce;}_0x37824b[_0x5837('0x20')](_0x21c0bf);return _0x37824b['set'](_0x5837('0x26'),_0x295ae3+'-'+_0x387809+'/'+_0x3c5ec9)[_0x5837('0x27')](_0x1a5725);}return null;};}function patchUpdates(_0x4b59b1){return function(_0x3e055d){try{jsonpatch[_0x5837('0x28')](_0x3e055d,_0x4b59b1,!![]);}catch(_0x5e9c2e){return BPromise[_0x5837('0x29')](_0x5e9c2e);}return _0x3e055d[_0x5837('0x2a')]();};}function saveUpdates(_0x1366c1,_0x56d9b0){return function(_0x413ea9){if(_0x413ea9){return _0x413ea9['update'](_0x1366c1)[_0x5837('0x2b')](function(_0x8e5a48){return _0x8e5a48;});}return null;};}function removeEntity(_0x31d25b,_0x3f96b1){return function(_0x3c92eb){if(_0x3c92eb){return _0x3c92eb[_0x5837('0x2c')]()[_0x5837('0x2b')](function(){_0x31d25b[_0x5837('0x20')](0xcc)[_0x5837('0x21')]();});}};}function handleEntityNotFound(_0x192883,_0x24b941){return function(_0x27848d){if(!_0x27848d){_0x192883[_0x5837('0x1f')](0x194);}return _0x27848d;};}function handleError(_0x3a6cc8,_0x271e23){_0x271e23=_0x271e23||0x1f4;return function(_0x5c17dd){logger[_0x5837('0x2d')](_0x5c17dd[_0x5837('0x2e')]);if(_0x5c17dd[_0x5837('0x2f')]){delete _0x5c17dd[_0x5837('0x2f')];}_0x3a6cc8[_0x5837('0x20')](_0x271e23)[_0x5837('0x30')](_0x5c17dd);};}exports[_0x5837('0x31')]=function(_0x4e3259,_0x89e7e5){var _0x290e14={'raw':![],'where':{'id':_0x4e3259[_0x5837('0x32')]['id']}},_0x3a3a34={};_0x3a3a34['model']=_['keys'](db[_0x5837('0x33')][_0x5837('0x34')]);_0x3a3a34[_0x5837('0x35')]=_['keys'](_0x4e3259[_0x5837('0x35')]);_0x3a3a34[_0x5837('0x36')]=_[_0x5837('0x37')](_0x3a3a34[_0x5837('0x38')],_0x3a3a34[_0x5837('0x35')]);_0x290e14[_0x5837('0x39')]=_['intersection'](_0x3a3a34[_0x5837('0x38')],qs[_0x5837('0x3a')](_0x4e3259['query'][_0x5837('0x3a')]));_0x290e14[_0x5837('0x39')]=_0x290e14[_0x5837('0x39')]['length']?_0x290e14['attributes']:_0x3a3a34['model'];if(_0x4e3259['query'][_0x5837('0x3b')]){_0x290e14['include']=[{'all':!![]}];}_0x290e14=_['merge']({},_0x290e14,_0x4e3259[_0x5837('0x3c')]);return db[_0x5837('0x33')]['find'](_0x290e14)[_0x5837('0x2b')](handleEntityNotFound(_0x89e7e5,null))['then'](respondWithResult(_0x89e7e5,null))[_0x5837('0x3d')](handleError(_0x89e7e5,null));};exports[_0x5837('0x2c')]=function(_0x4c0c4a,_0x4109fa){return db[_0x5837('0x33')]['find']({'where':{'id':_0x4c0c4a[_0x5837('0x32')]['id']}})['then'](handleEntityNotFound(_0x4109fa,null))[_0x5837('0x2b')](removeEntity(_0x4109fa,null))['catch'](handleError(_0x4109fa,null));};function widgetAttributes(_0x495901){try{switch(_0x495901[_0x5837('0x3e')]){case _0x5837('0x3f'):return[{'name':_0x5837('0x40'),'value':_0x495901[_0x5837('0x40')]||(_0x495901[_0x5837('0x41')]&&_0x495901['attrs'][0x0]?_0x495901[_0x5837('0x41')][0x0]['value']:undefined)||'https://'}];case _0x5837('0x42'):return[{'name':_0x5837('0x43'),'value':_0x495901['attrPath']||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x0]?_0x495901[_0x5837('0x41')][0x0][_0x5837('0x44')]:undefined)||''}];case _0x5837('0x45'):return[{'name':_0x5837('0x46'),'value':_0x495901[_0x5837('0x46')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x0]?_0x495901['attrs'][0x0][_0x5837('0x44')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x495901[_0x5837('0x47')]||(_0x495901[_0x5837('0x41')]&&_0x495901['attrs'][0x1]?_0x495901[_0x5837('0x41')][0x1][_0x5837('0x44')]:undefined)||_0x5837('0x48')},{'name':_0x5837('0x49'),'value':_0x495901['attrFontSize']||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x2]?_0x495901[_0x5837('0x41')][0x2][_0x5837('0x44')]:undefined)||0xc}];case _0x5837('0x4a'):return[{'name':'attrMetric','value':_0x495901[_0x5837('0x4b')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x0]?_0x495901['attrs'][0x0][_0x5837('0x44')]:undefined)||_0x5837('0x4c')},{'name':_0x5837('0x4d'),'value':_0x495901[_0x5837('0x4d')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x1]?_0x495901[_0x5837('0x41')][0x1][_0x5837('0x44')]:undefined)||[]},{'name':_0x5837('0x49'),'value':_0x495901[_0x5837('0x49')]||(_0x495901[_0x5837('0x41')]&&_0x495901['attrs'][0x2]?_0x495901[_0x5837('0x41')][0x2][_0x5837('0x44')]:undefined)||0x14},{'name':'attrChannel','value':_0x495901['attrChannel']||(_0x495901[_0x5837('0x41')]&&_0x495901['attrs'][0x3]?_0x495901[_0x5837('0x41')][0x3][_0x5837('0x44')]:undefined)||_0x5837('0x4e')},{'name':_0x5837('0x4f'),'value':_0x495901['attrEmailAccounts']||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x4]?_0x495901[_0x5837('0x41')][0x4][_0x5837('0x44')]:undefined)||''},{'name':_0x5837('0x50'),'value':_0x495901[_0x5837('0x50')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x5]?_0x495901[_0x5837('0x41')][0x5]['value']:undefined)||''},{'name':_0x5837('0x51'),'value':_0x495901[_0x5837('0x51')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x6]?_0x495901[_0x5837('0x41')][0x6][_0x5837('0x44')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x495901[_0x5837('0x52')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x7]?_0x495901[_0x5837('0x41')][0x7][_0x5837('0x44')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x495901[_0x5837('0x53')]||(_0x495901['attrs']&&_0x495901[_0x5837('0x41')][0x8]?_0x495901[_0x5837('0x41')][0x8][_0x5837('0x44')]:undefined)||''},{'name':'attrChatWebsites','value':_0x495901[_0x5837('0x54')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x9]?_0x495901[_0x5837('0x41')][0x9][_0x5837('0x44')]:undefined)||''}];case _0x5837('0x55'):case _0x5837('0x56'):return[{'name':_0x5837('0x57'),'value':_0x495901[_0x5837('0x57')]||(_0x495901['attrs']&&_0x495901['attrs'][0x0]?_0x495901[_0x5837('0x41')][0x0][_0x5837('0x44')]:undefined)||'total'},{'name':'attrSerie2','value':_0x495901[_0x5837('0x58')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x1]?_0x495901[_0x5837('0x41')][0x1][_0x5837('0x44')]:undefined)||null},{'name':'attrSerie3','value':_0x495901[_0x5837('0x59')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x2]?_0x495901['attrs'][0x2]['value']:undefined)||null},{'name':_0x5837('0x4d'),'value':_0x495901[_0x5837('0x4d')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x3]?_0x495901['attrs'][0x3][_0x5837('0x44')]:undefined)||[]},{'name':'attrChannel','value':_0x495901['attrChannel']||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x4]?_0x495901['attrs'][0x4][_0x5837('0x44')]:undefined)||_0x5837('0x4e')},{'name':_0x5837('0x4f'),'value':_0x495901['attrEmailAccounts']||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x5]?_0x495901[_0x5837('0x41')][0x5][_0x5837('0x44')]:undefined)||''},{'name':_0x5837('0x50'),'value':_0x495901['attrFaxAccounts']||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x6]?_0x495901['attrs'][0x6][_0x5837('0x44')]:undefined)||''},{'name':_0x5837('0x51'),'value':_0x495901['attrSmsAccounts']||(_0x495901[_0x5837('0x41')]&&_0x495901['attrs'][0x7]?_0x495901[_0x5837('0x41')][0x7][_0x5837('0x44')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x495901['attrOpenchannelAccounts']||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x8]?_0x495901['attrs'][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x495901[_0x5837('0x53')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x9]?_0x495901[_0x5837('0x41')][0x9][_0x5837('0x44')]:undefined)||''},{'name':'attrChatWebsites','value':_0x495901[_0x5837('0x54')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0xa]?_0x495901[_0x5837('0x41')][0xa][_0x5837('0x44')]:undefined)||''}];case'web-report':return[{'name':_0x5837('0x5a'),'type':_0x495901['reportType']||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x0]?_0x495901['attrs'][0x0][_0x5837('0x3e')]:undefined)||null,'value':_0x495901[_0x5837('0x5a')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x0]?_0x495901[_0x5837('0x41')][0x0]['value']:undefined)||null},{'name':_0x5837('0x5b'),'value':_0x495901[_0x5837('0x5b')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x1]?_0x495901['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x515156){logger[_0x5837('0x2d')]('widgetAttributes:\x20%s',JSON[_0x5837('0x5c')](_0x515156));return[];}}exports[_0x5837('0x5d')]=function(_0x29c4e1,_0x154c9f){if(_0x29c4e1['body']){_0x29c4e1['body'][_0x5837('0x41')]=widgetAttributes(_0x29c4e1['body']);}return db[_0x5837('0x33')][_0x5837('0x5d')](_0x29c4e1['body'],{})[_0x5837('0x2b')](respondWithResult(_0x154c9f,0xc9))[_0x5837('0x3d')](handleError(_0x154c9f,null));};exports[_0x5837('0x5e')]=function(_0x307d73,_0x23c6f6){if(_0x307d73[_0x5837('0x5f')]['id']){delete _0x307d73[_0x5837('0x5f')]['id'];}_0x307d73['body'][_0x5837('0x41')]=widgetAttributes(_0x307d73[_0x5837('0x5f')]);return db[_0x5837('0x33')][_0x5837('0x60')]({'where':{'id':_0x307d73['params']['id']}})['then'](handleEntityNotFound(_0x23c6f6,null))[_0x5837('0x2b')](saveUpdates(_0x307d73['body'],null))[_0x5837('0x2b')](respondWithResult(_0x23c6f6,null))[_0x5837('0x3d')](handleError(_0x23c6f6,null));}; \ No newline at end of file +var _0x9e54=['attributes','fields','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie3','web-report','attrReport','attrRefresh','error','stringify','create','body','update','eml-format','rimraf','moment','bluebird','mustache','path','sox','ejs','squel','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','then','end','sendStatus','stack','name','send','show','params','model','keys','DashboardItem','query','filters','intersection'];(function(_0x1090db,_0x1460e6){var _0x3c41fb=function(_0x18e7da){while(--_0x18e7da){_0x1090db['push'](_0x1090db['shift']());}};_0x3c41fb(++_0x1460e6);}(_0x9e54,0x88));var _0x49e5=function(_0x52bd65,_0x160646){_0x52bd65=_0x52bd65-0x0;var _0x13fd57=_0x9e54[_0x52bd65];return _0x13fd57;};'use strict';var emlformat=require(_0x49e5('0x0'));var rimraf=require(_0x49e5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x49e5('0x2'));var BPromise=require(_0x49e5('0x3'));var Mustache=require(_0x49e5('0x4'));var util=require('util');var path=require(_0x49e5('0x5'));var sox=require(_0x49e5('0x6'));var csv=require('to-csv');var ejs=require(_0x49e5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x49e5('0x8'));var crypto=require('crypto');var jsforce=require(_0x49e5('0x9'));var deskjs=require(_0x49e5('0xa'));var toCsv=require(_0x49e5('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x49e5('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x49e5('0xd'));var as=require(_0x49e5('0xe'));var hardwareService=require(_0x49e5('0xf'));var logger=require(_0x49e5('0x10'))(_0x49e5('0x11'));var utils=require('../../config/utils');var config=require(_0x49e5('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x49e5('0x13'))['db'];config[_0x49e5('0x14')]=_[_0x49e5('0x15')](config[_0x49e5('0x14')],{'host':_0x49e5('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x49e5('0x17'))[_0x49e5('0x18')](socket);function respondWithStatusCode(_0x5ea43e,_0x56ae34){_0x56ae34=_0x56ae34||0xcc;return function(_0x3b7cd4){if(_0x3b7cd4){return _0x5ea43e['sendStatus'](_0x56ae34);}return _0x5ea43e[_0x49e5('0x19')](_0x56ae34)['end']();};}function respondWithResult(_0x2cc353,_0x13bc7f){_0x13bc7f=_0x13bc7f||0xc8;return function(_0x375488){if(_0x375488){return _0x2cc353['status'](_0x13bc7f)[_0x49e5('0x1a')](_0x375488);}};}function respondWithFilteredResult(_0x273023,_0x37c0d3){return function(_0x1e2723){if(_0x1e2723){var _0xfc4935=typeof _0x37c0d3[_0x49e5('0x1b')]===_0x49e5('0x1c')&&typeof _0x37c0d3['limit']===_0x49e5('0x1c');var _0x200a4e=_0x1e2723['count'];var _0x2370ad=_0xfc4935?0x0:_0x37c0d3['offset'];var _0x305b4c=_0xfc4935?_0x1e2723[_0x49e5('0x1d')]:_0x37c0d3['offset']+_0x37c0d3[_0x49e5('0x1e')];var _0x41c6d0;if(_0x305b4c>=_0x200a4e){_0x305b4c=_0x200a4e;_0x41c6d0=0xc8;}else{_0x41c6d0=0xce;}_0x273023[_0x49e5('0x19')](_0x41c6d0);return _0x273023[_0x49e5('0x1f')](_0x49e5('0x20'),_0x2370ad+'-'+_0x305b4c+'/'+_0x200a4e)[_0x49e5('0x1a')](_0x1e2723);}return null;};}function patchUpdates(_0x5e8569){return function(_0x1a2f8e){try{jsonpatch['apply'](_0x1a2f8e,_0x5e8569,!![]);}catch(_0x3f2f6b){return BPromise[_0x49e5('0x21')](_0x3f2f6b);}return _0x1a2f8e[_0x49e5('0x22')]();};}function saveUpdates(_0x2d1d63,_0x25ecb9){return function(_0xe5b1ea){if(_0xe5b1ea){return _0xe5b1ea['update'](_0x2d1d63)['then'](function(_0xd96520){return _0xd96520;});}return null;};}function removeEntity(_0x3bdd2b,_0x5531bf){return function(_0x3a6837){if(_0x3a6837){return _0x3a6837[_0x49e5('0x23')]()[_0x49e5('0x24')](function(){_0x3bdd2b[_0x49e5('0x19')](0xcc)[_0x49e5('0x25')]();});}};}function handleEntityNotFound(_0x21b29a,_0x4e0ed2){return function(_0xadf789){if(!_0xadf789){_0x21b29a[_0x49e5('0x26')](0x194);}return _0xadf789;};}function handleError(_0x3cb351,_0x5d0700){_0x5d0700=_0x5d0700||0x1f4;return function(_0x300754){logger['error'](_0x300754[_0x49e5('0x27')]);if(_0x300754[_0x49e5('0x28')]){delete _0x300754['name'];}_0x3cb351['status'](_0x5d0700)[_0x49e5('0x29')](_0x300754);};}exports[_0x49e5('0x2a')]=function(_0x51f1ad,_0x35a5f4){var _0x5c0cb8={'raw':![],'where':{'id':_0x51f1ad[_0x49e5('0x2b')]['id']}},_0x36d49e={};_0x36d49e[_0x49e5('0x2c')]=_[_0x49e5('0x2d')](db[_0x49e5('0x2e')]['rawAttributes']);_0x36d49e[_0x49e5('0x2f')]=_[_0x49e5('0x2d')](_0x51f1ad[_0x49e5('0x2f')]);_0x36d49e[_0x49e5('0x30')]=_[_0x49e5('0x31')](_0x36d49e['model'],_0x36d49e[_0x49e5('0x2f')]);_0x5c0cb8[_0x49e5('0x32')]=_['intersection'](_0x36d49e[_0x49e5('0x2c')],qs['fields'](_0x51f1ad['query'][_0x49e5('0x33')]));_0x5c0cb8[_0x49e5('0x32')]=_0x5c0cb8['attributes']['length']?_0x5c0cb8[_0x49e5('0x32')]:_0x36d49e['model'];if(_0x51f1ad[_0x49e5('0x2f')][_0x49e5('0x34')]){_0x5c0cb8[_0x49e5('0x35')]=[{'all':!![]}];}_0x5c0cb8=_[_0x49e5('0x36')]({},_0x5c0cb8,_0x51f1ad[_0x49e5('0x37')]);return db[_0x49e5('0x2e')][_0x49e5('0x38')](_0x5c0cb8)[_0x49e5('0x24')](handleEntityNotFound(_0x35a5f4,null))[_0x49e5('0x24')](respondWithResult(_0x35a5f4,null))[_0x49e5('0x39')](handleError(_0x35a5f4,null));};exports['destroy']=function(_0xdbf2a6,_0x4cf7a2){return db['DashboardItem'][_0x49e5('0x38')]({'where':{'id':_0xdbf2a6[_0x49e5('0x2b')]['id']}})[_0x49e5('0x24')](handleEntityNotFound(_0x4cf7a2,null))[_0x49e5('0x24')](removeEntity(_0x4cf7a2,null))[_0x49e5('0x39')](handleError(_0x4cf7a2,null));};function widgetAttributes(_0x2c0e59){try{switch(_0x2c0e59[_0x49e5('0x3a')]){case _0x49e5('0x3b'):return[{'name':_0x49e5('0x3c'),'value':_0x2c0e59[_0x49e5('0x3c')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x0]?_0x2c0e59[_0x49e5('0x3d')][0x0][_0x49e5('0x3e')]:undefined)||_0x49e5('0x3f')}];case'custom':return[{'name':_0x49e5('0x40'),'value':_0x2c0e59['attrPath']||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x0]?_0x2c0e59['attrs'][0x0][_0x49e5('0x3e')]:undefined)||''}];case _0x49e5('0x41'):return[{'name':'attrHourFormat','value':_0x2c0e59[_0x49e5('0x42')]||(_0x2c0e59['attrs']&&_0x2c0e59[_0x49e5('0x3d')][0x0]?_0x2c0e59[_0x49e5('0x3d')][0x0][_0x49e5('0x3e')]:undefined)||'HH:mm:ss'},{'name':_0x49e5('0x43'),'value':_0x2c0e59[_0x49e5('0x43')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59['attrs'][0x1]?_0x2c0e59[_0x49e5('0x3d')][0x1]['value']:undefined)||_0x49e5('0x44')},{'name':'attrFontSize','value':_0x2c0e59[_0x49e5('0x45')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x2]?_0x2c0e59[_0x49e5('0x3d')][0x2][_0x49e5('0x3e')]:undefined)||0xc}];case _0x49e5('0x46'):return[{'name':_0x49e5('0x47'),'value':_0x2c0e59[_0x49e5('0x47')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x0]?_0x2c0e59['attrs'][0x0][_0x49e5('0x3e')]:undefined)||_0x49e5('0x48')},{'name':'attrVoiceQueues','value':_0x2c0e59[_0x49e5('0x49')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x1]?_0x2c0e59['attrs'][0x1][_0x49e5('0x3e')]:undefined)||[]},{'name':_0x49e5('0x45'),'value':_0x2c0e59['attrFontSize']||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x2]?_0x2c0e59[_0x49e5('0x3d')][0x2]['value']:undefined)||0x14},{'name':_0x49e5('0x4a'),'value':_0x2c0e59[_0x49e5('0x4a')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x3]?_0x2c0e59[_0x49e5('0x3d')][0x3][_0x49e5('0x3e')]:undefined)||_0x49e5('0x4b')},{'name':_0x49e5('0x4c'),'value':_0x2c0e59['attrEmailAccounts']||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x4]?_0x2c0e59[_0x49e5('0x3d')][0x4][_0x49e5('0x3e')]:undefined)||''},{'name':_0x49e5('0x4d'),'value':_0x2c0e59[_0x49e5('0x4d')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x5]?_0x2c0e59[_0x49e5('0x3d')][0x5][_0x49e5('0x3e')]:undefined)||''},{'name':_0x49e5('0x4e'),'value':_0x2c0e59[_0x49e5('0x4e')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59['attrs'][0x6]?_0x2c0e59[_0x49e5('0x3d')][0x6][_0x49e5('0x3e')]:undefined)||''},{'name':_0x49e5('0x4f'),'value':_0x2c0e59[_0x49e5('0x4f')]||(_0x2c0e59['attrs']&&_0x2c0e59[_0x49e5('0x3d')][0x7]?_0x2c0e59[_0x49e5('0x3d')][0x7][_0x49e5('0x3e')]:undefined)||''},{'name':_0x49e5('0x50'),'value':_0x2c0e59['attrWhatsappAccounts']||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x8]?_0x2c0e59[_0x49e5('0x3d')][0x8][_0x49e5('0x3e')]:undefined)||''},{'name':'attrChatWebsites','value':_0x2c0e59[_0x49e5('0x51')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x9]?_0x2c0e59[_0x49e5('0x3d')][0x9][_0x49e5('0x3e')]:undefined)||''}];case'multibar-chart':case _0x49e5('0x52'):return[{'name':_0x49e5('0x53'),'value':_0x2c0e59[_0x49e5('0x53')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x0]?_0x2c0e59[_0x49e5('0x3d')][0x0][_0x49e5('0x3e')]:undefined)||_0x49e5('0x48')},{'name':'attrSerie2','value':_0x2c0e59['attrSerie2']||(_0x2c0e59['attrs']&&_0x2c0e59[_0x49e5('0x3d')][0x1]?_0x2c0e59['attrs'][0x1][_0x49e5('0x3e')]:undefined)||null},{'name':_0x49e5('0x54'),'value':_0x2c0e59['attrSerie3']||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59['attrs'][0x2]?_0x2c0e59[_0x49e5('0x3d')][0x2][_0x49e5('0x3e')]:undefined)||null},{'name':_0x49e5('0x49'),'value':_0x2c0e59[_0x49e5('0x49')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x3]?_0x2c0e59[_0x49e5('0x3d')][0x3]['value']:undefined)||[]},{'name':_0x49e5('0x4a'),'value':_0x2c0e59[_0x49e5('0x4a')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x4]?_0x2c0e59[_0x49e5('0x3d')][0x4]['value']:undefined)||_0x49e5('0x4b')},{'name':_0x49e5('0x4c'),'value':_0x2c0e59['attrEmailAccounts']||(_0x2c0e59['attrs']&&_0x2c0e59[_0x49e5('0x3d')][0x5]?_0x2c0e59['attrs'][0x5]['value']:undefined)||''},{'name':_0x49e5('0x4d'),'value':_0x2c0e59[_0x49e5('0x4d')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x6]?_0x2c0e59['attrs'][0x6][_0x49e5('0x3e')]:undefined)||''},{'name':_0x49e5('0x4e'),'value':_0x2c0e59[_0x49e5('0x4e')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x7]?_0x2c0e59['attrs'][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x2c0e59['attrOpenchannelAccounts']||(_0x2c0e59['attrs']&&_0x2c0e59[_0x49e5('0x3d')][0x8]?_0x2c0e59['attrs'][0x8][_0x49e5('0x3e')]:undefined)||''},{'name':_0x49e5('0x50'),'value':_0x2c0e59[_0x49e5('0x50')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x9]?_0x2c0e59[_0x49e5('0x3d')][0x9][_0x49e5('0x3e')]:undefined)||''},{'name':_0x49e5('0x51'),'value':_0x2c0e59[_0x49e5('0x51')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0xa]?_0x2c0e59[_0x49e5('0x3d')][0xa][_0x49e5('0x3e')]:undefined)||''}];case _0x49e5('0x55'):return[{'name':_0x49e5('0x56'),'type':_0x2c0e59['reportType']||(_0x2c0e59['attrs']&&_0x2c0e59[_0x49e5('0x3d')][0x0]?_0x2c0e59[_0x49e5('0x3d')][0x0][_0x49e5('0x3a')]:undefined)||null,'value':_0x2c0e59['attrReport']||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x0]?_0x2c0e59[_0x49e5('0x3d')][0x0]['value']:undefined)||null},{'name':_0x49e5('0x57'),'value':_0x2c0e59[_0x49e5('0x57')]||(_0x2c0e59[_0x49e5('0x3d')]&&_0x2c0e59[_0x49e5('0x3d')][0x1]?_0x2c0e59[_0x49e5('0x3d')][0x1][_0x49e5('0x3e')]:undefined)||0x0}];default:return[];}}catch(_0x42e6be){logger[_0x49e5('0x58')]('widgetAttributes:\x20%s',JSON[_0x49e5('0x59')](_0x42e6be));return[];}}exports[_0x49e5('0x5a')]=function(_0x34a920,_0x3d9dca){if(_0x34a920[_0x49e5('0x5b')]){_0x34a920[_0x49e5('0x5b')][_0x49e5('0x3d')]=widgetAttributes(_0x34a920[_0x49e5('0x5b')]);}return db[_0x49e5('0x2e')][_0x49e5('0x5a')](_0x34a920[_0x49e5('0x5b')],{})[_0x49e5('0x24')](respondWithResult(_0x3d9dca,0xc9))[_0x49e5('0x39')](handleError(_0x3d9dca,null));};exports[_0x49e5('0x5c')]=function(_0x292cbe,_0x47e48c){if(_0x292cbe[_0x49e5('0x5b')]['id']){delete _0x292cbe[_0x49e5('0x5b')]['id'];}_0x292cbe[_0x49e5('0x5b')][_0x49e5('0x3d')]=widgetAttributes(_0x292cbe[_0x49e5('0x5b')]);return db[_0x49e5('0x2e')]['find']({'where':{'id':_0x292cbe[_0x49e5('0x2b')]['id']}})[_0x49e5('0x24')](handleEntityNotFound(_0x47e48c,null))['then'](saveUpdates(_0x292cbe[_0x49e5('0x5b')],null))[_0x49e5('0x24')](respondWithResult(_0x47e48c,null))[_0x49e5('0x39')](handleError(_0x47e48c,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 2776863..8890c2c 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 _0xd07e=['DashboardItem','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0xbc863b,_0xc6a868){var _0xe0b916=function(_0x537795){while(--_0x537795){_0xbc863b['push'](_0xbc863b['shift']());}};_0xe0b916(++_0xc6a868);}(_0xd07e,0x8e));var _0xed07=function(_0x2a83e8,_0x5236fb){_0x2a83e8=_0x2a83e8-0x0;var _0x46860f=_0xd07e[_0x2a83e8];return _0x46860f;};'use strict';var EventEmitter=require(_0xed07('0x0'));var DashboardItem=require(_0xed07('0x1'))['db'][_0xed07('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xed07('0x3')](0x0);var events={'afterCreate':_0xed07('0x4'),'afterUpdate':'update','afterDestroy':_0xed07('0x5')};function emitEvent(_0x1d1e24){return function(_0x1546dd,_0x580878,_0x44e93e){DashboardItemEvents[_0xed07('0x6')](_0x1d1e24+':'+_0x1546dd['id'],_0x1546dd);DashboardItemEvents['emit'](_0x1d1e24,_0x1546dd);_0x44e93e(null);};}for(var e in events){if(events[_0xed07('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xed07('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x99b4=['exports','events','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x1cb84c,_0x576b00){var _0x1ff4ed=function(_0x27e6b4){while(--_0x27e6b4){_0x1cb84c['push'](_0x1cb84c['shift']());}};_0x1ff4ed(++_0x576b00);}(_0x99b4,0x139));var _0x499b=function(_0x517369,_0x3b6b69){_0x517369=_0x517369-0x0;var _0x4a2428=_0x99b4[_0x517369];return _0x4a2428;};'use strict';var EventEmitter=require(_0x499b('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x499b('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x499b('0x2'),'afterDestroy':_0x499b('0x3')};function emitEvent(_0x55401c){return function(_0x478ad4,_0x57ebbf,_0x2aba1d){DashboardItemEvents[_0x499b('0x4')](_0x55401c+':'+_0x478ad4['id'],_0x478ad4);DashboardItemEvents[_0x499b('0x4')](_0x55401c,_0x478ad4);_0x2aba1d(null);};}for(var e in events){if(events[_0x499b('0x5')](e)){var event=events[e];DashboardItem[_0x499b('0x6')](e,emitEvent(event));}}module[_0x499b('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 2782fc2..d3c5ef0 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 _0x462f=['define','DashboardItem','dashboard_items','util','api','bluebird','path','rimraf','./dashboardItem.attributes','exports'];(function(_0x210b46,_0x52a05f){var _0x203df2=function(_0x3421ea){while(--_0x3421ea){_0x210b46['push'](_0x210b46['shift']());}};_0x203df2(++_0x52a05f);}(_0x462f,0x1c5));var _0xf462=function(_0xcd5a3d,_0x3c5b33){_0xcd5a3d=_0xcd5a3d-0x0;var _0xd43207=_0x462f[_0xcd5a3d];return _0xd43207;};'use strict';var _=require('lodash');var util=require(_0xf462('0x0'));var logger=require('../../config/logger')(_0xf462('0x1'));var moment=require('moment');var BPromise=require(_0xf462('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf462('0x3'));var rimraf=require(_0xf462('0x4'));var config=require('../../config/environment');var attributes=require(_0xf462('0x5'));module[_0xf462('0x6')]=function(_0x522b9f,_0x561fa1){return _0x522b9f[_0xf462('0x7')](_0xf462('0x8'),attributes,{'tableName':_0xf462('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6343=['../../config/logger','api','request-promise','path','rimraf','./dashboardItem.attributes','exports','DashboardItem','dashboard_items','util'];(function(_0x5ccd0c,_0x4c70fb){var _0x5a0634=function(_0x245c52){while(--_0x245c52){_0x5ccd0c['push'](_0x5ccd0c['shift']());}};_0x5a0634(++_0x4c70fb);}(_0x6343,0x1e9));var _0x3634=function(_0x2074c0,_0x5146a8){_0x2074c0=_0x2074c0-0x0;var _0x514e2e=_0x6343[_0x2074c0];return _0x514e2e;};'use strict';var _=require('lodash');var util=require(_0x3634('0x0'));var logger=require(_0x3634('0x1'))(_0x3634('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3634('0x3'));var fs=require('fs');var path=require(_0x3634('0x4'));var rimraf=require(_0x3634('0x5'));var config=require('../../config/environment');var attributes=require(_0x3634('0x6'));module[_0x3634('0x7')]=function(_0x5db25c,_0x4c5f9a){return _0x5db25c['define'](_0x3634('0x8'),attributes,{'tableName':_0x3634('0x9'),'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 6056f67..fecd552 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 _0x3c89=['defaults','localhost','socket.io-emitter','./dashboardItem.socket','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis'];(function(_0x23dad9,_0x5dc8f2){var _0x527967=function(_0x2d9dc2){while(--_0x2d9dc2){_0x23dad9['push'](_0x23dad9['shift']());}};_0x527967(++_0x5dc8f2);}(_0x3c89,0x19f));var _0x93c8=function(_0x14c670,_0x494742){_0x14c670=_0x14c670-0x0;var _0x5e5f02=_0x3c89[_0x14c670];return _0x5e5f02;};'use strict';var _=require(_0x93c8('0x0'));var util=require(_0x93c8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x93c8('0x2'));var fs=require('fs');var Redis=require(_0x93c8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x93c8('0x4'))(_0x93c8('0x5'));var config=require(_0x93c8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x93c8('0x7')][_0x93c8('0x8')]({'port':0x232a});config[_0x93c8('0x9')]=_[_0x93c8('0xa')](config[_0x93c8('0x9')],{'host':_0x93c8('0xb'),'port':0x18eb});var socket=require(_0x93c8('0xc'))(new Redis(config[_0x93c8('0x9')]));require(_0x93c8('0xd'))['register'](socket);function respondWithRpcPromise(_0x5ab741,_0xc09f30,_0x5841db){return new BPromise(function(_0x473d0a,_0x220f26){return client[_0x93c8('0xe')](_0x5ab741,_0x5841db)['then'](function(_0x35539e){logger[_0x93c8('0xf')](_0x93c8('0x10'),_0xc09f30,_0x93c8('0x11'));logger[_0x93c8('0x12')](_0x93c8('0x13'),_0xc09f30,'request\x20sent',JSON['stringify'](_0x35539e));if(_0x35539e[_0x93c8('0x14')]){if(_0x35539e['error'][_0x93c8('0x15')]===0x1f4){logger[_0x93c8('0x14')](_0x93c8('0x10'),_0xc09f30,_0x35539e[_0x93c8('0x14')]['message']);return _0x220f26(_0x35539e[_0x93c8('0x14')][_0x93c8('0x16')]);}logger[_0x93c8('0x14')](_0x93c8('0x10'),_0xc09f30,_0x35539e[_0x93c8('0x14')][_0x93c8('0x16')]);return _0x473d0a(_0x35539e['error'][_0x93c8('0x16')]);}else{logger[_0x93c8('0xf')](_0x93c8('0x10'),_0xc09f30,_0x93c8('0x11'));_0x473d0a(_0x35539e[_0x93c8('0x17')][_0x93c8('0x16')]);}})[_0x93c8('0x18')](function(_0x276316){logger['error'](_0x93c8('0x10'),_0xc09f30,_0x276316);_0x220f26(_0x276316);});});} \ No newline at end of file +var _0x7703=['message','result','catch','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x1c88f9,_0x211646){var _0x1779f7=function(_0x1dc48e){while(--_0x1dc48e){_0x1c88f9['push'](_0x1c88f9['shift']());}};_0x1779f7(++_0x211646);}(_0x7703,0x93));var _0x3770=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0x7703[_0x3826ad];return _0x17b900;};'use strict';var _=require(_0x3770('0x0'));var util=require(_0x3770('0x1'));var moment=require(_0x3770('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3770('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3770('0x4'))(_0x3770('0x5'));var config=require(_0x3770('0x6'));var jayson=require(_0x3770('0x7'));var client=jayson[_0x3770('0x8')][_0x3770('0x9')]({'port':0x232a});config['redis']=_[_0x3770('0xa')](config[_0x3770('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3770('0xc'))(new Redis(config['redis']));require(_0x3770('0xd'))[_0x3770('0xe')](socket);function respondWithRpcPromise(_0x12e9bc,_0x3893a5,_0x1ec7c7){return new BPromise(function(_0x541543,_0x20286d){return client['request'](_0x12e9bc,_0x1ec7c7)[_0x3770('0xf')](function(_0x1ec069){logger[_0x3770('0x10')](_0x3770('0x11'),_0x3893a5,_0x3770('0x12'));logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x3893a5,_0x3770('0x12'),JSON['stringify'](_0x1ec069));if(_0x1ec069[_0x3770('0x13')]){if(_0x1ec069['error'][_0x3770('0x14')]===0x1f4){logger['error'](_0x3770('0x11'),_0x3893a5,_0x1ec069[_0x3770('0x13')][_0x3770('0x15')]);return _0x20286d(_0x1ec069[_0x3770('0x13')]['message']);}logger[_0x3770('0x13')](_0x3770('0x11'),_0x3893a5,_0x1ec069[_0x3770('0x13')][_0x3770('0x15')]);return _0x541543(_0x1ec069[_0x3770('0x13')][_0x3770('0x15')]);}else{logger[_0x3770('0x10')](_0x3770('0x11'),_0x3893a5,_0x3770('0x12'));_0x541543(_0x1ec069[_0x3770('0x16')][_0x3770('0x15')]);}})[_0x3770('0x17')](function(_0x53b502){logger[_0x3770('0x13')](_0x3770('0x11'),_0x3893a5,_0x53b502);_0x20286d(_0x53b502);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 9c9da67..62b8f3d 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 _0x2cea=['./dashboardItem.events','save','remove','emit','removeListener','register'];(function(_0x4b2069,_0x46d675){var _0x2a2ae5=function(_0x495703){while(--_0x495703){_0x4b2069['push'](_0x4b2069['shift']());}};_0x2a2ae5(++_0x46d675);}(_0x2cea,0x192));var _0xa2ce=function(_0x5dc9f5,_0x5362c7){_0x5dc9f5=_0x5dc9f5-0x0;var _0x4faea5=_0x2cea[_0x5dc9f5];return _0x4faea5;};'use strict';var DashboardItemEvents=require(_0xa2ce('0x0'));var events=[_0xa2ce('0x1'),_0xa2ce('0x2'),'update'];function createListener(_0x56e788,_0x372b04){return function(_0x17b301){_0x372b04[_0xa2ce('0x3')](_0x56e788,_0x17b301);};}function removeListener(_0x34bda1,_0x5ad363){return function(){DashboardItemEvents[_0xa2ce('0x4')](_0x34bda1,_0x5ad363);};}exports[_0xa2ce('0x5')]=function(_0x32fe42){for(var _0xbe09b0=0x0,_0x3a2bac=events['length'];_0xbe09b0<_0x3a2bac;_0xbe09b0++){var _0x16b5da=events[_0xbe09b0];var _0x44a62c=createListener('dashboardItem:'+_0x16b5da,_0x32fe42);DashboardItemEvents['on'](_0x16b5da,_0x44a62c);}}; \ No newline at end of file +var _0x3fcb=['remove','update','emit','removeListener','register','length','dashboardItem:','save'];(function(_0xa06e0b,_0x6c2305){var _0x14142f=function(_0x2ac612){while(--_0x2ac612){_0xa06e0b['push'](_0xa06e0b['shift']());}};_0x14142f(++_0x6c2305);}(_0x3fcb,0x1bf));var _0xb3fc=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x3fcb[_0xbca1b1];return _0x4e1686;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xb3fc('0x0'),_0xb3fc('0x1'),_0xb3fc('0x2')];function createListener(_0x3adf8d,_0x474491){return function(_0x1764ca){_0x474491[_0xb3fc('0x3')](_0x3adf8d,_0x1764ca);};}function removeListener(_0x19705a,_0x43150e){return function(){DashboardItemEvents[_0xb3fc('0x4')](_0x19705a,_0x43150e);};}exports[_0xb3fc('0x5')]=function(_0x5b0254){for(var _0x29e7ef=0x0,_0x491a82=events[_0xb3fc('0x6')];_0x29e7ef<_0x491a82;_0x29e7ef++){var _0x57a45c=events[_0x29e7ef];var _0x5367bb=createListener(_0xb3fc('0x7')+_0x57a45c,_0x5b0254);DashboardItemEvents['on'](_0x57a45c,_0x5367bb);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 92da5c3..cbe50b2 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 _0x196e=['delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','show','post','create','/:id'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x196e,0x16b));var _0xe196=function(_0x179c4a,_0x10eb06){_0x179c4a=_0x179c4a-0x0;var _0x5d1879=_0x196e[_0x179c4a];return _0x5d1879;};'use strict';var multer=require('multer');var util=require(_0xe196('0x0'));var path=require(_0xe196('0x1'));var timeout=require(_0xe196('0x2'));var express=require('express');var router=express[_0xe196('0x3')]();var fs_extra=require(_0xe196('0x4'));var auth=require(_0xe196('0x5'));var interaction=require(_0xe196('0x6'));var config=require(_0xe196('0x7'));var controller=require(_0xe196('0x8'));router[_0xe196('0x9')]('/:id',auth[_0xe196('0xa')](),controller[_0xe196('0xb')]);router[_0xe196('0xc')]('/',auth['isAuthenticated'](),controller[_0xe196('0xd')]);router['put'](_0xe196('0xe'),auth[_0xe196('0xa')](),controller['update']);router[_0xe196('0xf')](_0xe196('0xe'),auth[_0xe196('0xa')](),controller[_0xe196('0x10')]);module[_0xe196('0x11')]=router; \ No newline at end of file +var _0x5f0d=['post','isAuthenticated','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./dashboardItem.controller','show'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x5f0d,0x1a6));var _0xd5f0=function(_0x46a088,_0x1d5b12){_0x46a088=_0x46a088-0x0;var _0x490de3=_0x5f0d[_0x46a088];return _0x490de3;};'use strict';var multer=require(_0xd5f0('0x0'));var util=require(_0xd5f0('0x1'));var path=require(_0xd5f0('0x2'));var timeout=require(_0xd5f0('0x3'));var express=require(_0xd5f0('0x4'));var router=express[_0xd5f0('0x5')]();var fs_extra=require(_0xd5f0('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd5f0('0x7'));var controller=require(_0xd5f0('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0xd5f0('0x9')]);router[_0xd5f0('0xa')]('/',auth[_0xd5f0('0xb')](),controller[_0xd5f0('0xc')]);router[_0xd5f0('0xd')](_0xd5f0('0xe'),auth[_0xd5f0('0xb')](),controller[_0xd5f0('0xf')]);router[_0xd5f0('0x10')](_0xd5f0('0xe'),auth[_0xd5f0('0xb')](),controller['destroy']);module[_0xd5f0('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 31e57d9..539bfee 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 _0x8690=['second','third','exports','STRING','first'];(function(_0x2c1f47,_0x1b4117){var _0x5d6e5d=function(_0x11da19){while(--_0x11da19){_0x2c1f47['push'](_0x2c1f47['shift']());}};_0x5d6e5d(++_0x1b4117);}(_0x8690,0x1c9));var _0x0869=function(_0xf72786,_0x1a0ddd){_0xf72786=_0xf72786-0x0;var _0x113f3e=_0x8690[_0xf72786];return _0x113f3e;};'use strict';var Sequelize=require('sequelize');module[_0x0869('0x0')]={'name':{'type':Sequelize[_0x0869('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x0869('0x2'),_0x0869('0x3'),_0x0869('0x4')),'allowNull':![],'defaultValue':_0x0869('0x2')},'description':{'type':Sequelize[_0x0869('0x1')]}}; \ No newline at end of file +var _0xf804=['first','exports','ENUM','second'];(function(_0x495e8f,_0x2b5af6){var _0x2dd9f3=function(_0x1517b9){while(--_0x1517b9){_0x495e8f['push'](_0x495e8f['shift']());}};_0x2dd9f3(++_0x2b5af6);}(_0xf804,0x81));var _0x4f80=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xf804[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require('sequelize');module[_0x4f80('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x4f80('0x1')]('first',_0x4f80('0x2'),'third'),'allowNull':![],'defaultValue':_0x4f80('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 18125f8..42b164e 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 _0x71ab=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','map','Disposition','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x71ab,0x64));var _0xb71a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x71ab[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb71a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb71a('0x1'));var rp=require('request-promise');var moment=require(_0xb71a('0x2'));var BPromise=require(_0xb71a('0x3'));var Mustache=require(_0xb71a('0x4'));var util=require(_0xb71a('0x5'));var path=require(_0xb71a('0x6'));var sox=require(_0xb71a('0x7'));var csv=require(_0xb71a('0x8'));var ejs=require(_0xb71a('0x9'));var fs=require('fs');var fs_extra=require(_0xb71a('0xa'));var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x8'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb71a('0x18'))['db'];function respondWithStatusCode(_0x50030d,_0x50b43b){_0x50b43b=_0x50b43b||0xcc;return function(_0x3346a5){if(_0x3346a5){return _0x50030d[_0xb71a('0x19')](_0x50b43b);}return _0x50030d[_0xb71a('0x1a')](_0x50b43b)[_0xb71a('0x1b')]();};}function respondWithResult(_0x483d77,_0x47ee48){_0x47ee48=_0x47ee48||0xc8;return function(_0x5364e3){if(_0x5364e3){return _0x483d77[_0xb71a('0x1a')](_0x47ee48)[_0xb71a('0x1c')](_0x5364e3);}};}function respondWithFilteredResult(_0x15252a,_0x42fc55){return function(_0x3cd0f0){if(_0x3cd0f0){var _0x1e9363=typeof _0x42fc55[_0xb71a('0x1d')]===_0xb71a('0x1e')&&typeof _0x42fc55[_0xb71a('0x1f')]==='undefined';var _0x1ca65e=_0x3cd0f0[_0xb71a('0x20')];var _0x374c8c=_0x1e9363?0x0:_0x42fc55[_0xb71a('0x1d')];var _0x2bdb61=_0x1e9363?_0x3cd0f0[_0xb71a('0x20')]:_0x42fc55[_0xb71a('0x1d')]+_0x42fc55[_0xb71a('0x1f')];var _0x20bdfe;if(_0x2bdb61>=_0x1ca65e){_0x2bdb61=_0x1ca65e;_0x20bdfe=0xc8;}else{_0x20bdfe=0xce;}_0x15252a[_0xb71a('0x1a')](_0x20bdfe);return _0x15252a[_0xb71a('0x21')]('Content-Range',_0x374c8c+'-'+_0x2bdb61+'/'+_0x1ca65e)['json'](_0x3cd0f0);}return null;};}function patchUpdates(_0x1358f2){return function(_0x578fe4){try{jsonpatch['apply'](_0x578fe4,_0x1358f2,!![]);}catch(_0x4d8871){return BPromise[_0xb71a('0x22')](_0x4d8871);}return _0x578fe4['save']();};}function saveUpdates(_0x76d6dc,_0x4227c7){return function(_0x3ac77b){if(_0x3ac77b){return _0x3ac77b[_0xb71a('0x23')](_0x76d6dc)[_0xb71a('0x24')](function(_0x14b2a1){return _0x14b2a1;});}return null;};}function removeEntity(_0x2f4fac,_0x14aac7){return function(_0x5f3f19){if(_0x5f3f19){return _0x5f3f19[_0xb71a('0x25')]()[_0xb71a('0x24')](function(){var _0x353930=_0x5f3f19[_0xb71a('0x26')]({'plain':!![]});var _0x3401f7=_0xb71a('0x27');return db[_0xb71a('0x28')][_0xb71a('0x25')]({'where':{'type':_0x3401f7,'resourceId':_0x353930['id']}})[_0xb71a('0x24')](function(){return _0x5f3f19;});})[_0xb71a('0x24')](function(){_0x2f4fac[_0xb71a('0x1a')](0xcc)[_0xb71a('0x1b')]();});}};}function handleEntityNotFound(_0x160f0f,_0x5ae0ed){return function(_0x2e8ea6){if(!_0x2e8ea6){_0x160f0f[_0xb71a('0x19')](0x194);}return _0x2e8ea6;};}function handleError(_0x1689ce,_0x358954){_0x358954=_0x358954||0x1f4;return function(_0x2fbd73){logger[_0xb71a('0x29')](_0x2fbd73[_0xb71a('0x2a')]);if(_0x2fbd73[_0xb71a('0x2b')]){delete _0x2fbd73[_0xb71a('0x2b')];}_0x1689ce[_0xb71a('0x1a')](_0x358954)[_0xb71a('0x2c')](_0x2fbd73);};}exports['index']=function(_0x56f5a4,_0x3112d3){var _0x5c2a45={},_0x70299a={},_0x1b1aa8={'count':0x0,'rows':[]};var _0x4d9e1a=_[_0xb71a('0x2d')](db[_0xb71a('0x2e')][_0xb71a('0x2f')],function(_0x251d82){return{'name':_0x251d82[_0xb71a('0x30')],'type':_0x251d82[_0xb71a('0x31')]['key']};});_0x70299a[_0xb71a('0x32')]=_[_0xb71a('0x2d')](_0x4d9e1a,_0xb71a('0x2b'));_0x70299a[_0xb71a('0x33')]=_['keys'](_0x56f5a4[_0xb71a('0x33')]);_0x70299a[_0xb71a('0x34')]=_[_0xb71a('0x35')](_0x70299a[_0xb71a('0x32')],_0x70299a[_0xb71a('0x33')]);_0x5c2a45[_0xb71a('0x36')]=_[_0xb71a('0x35')](_0x70299a[_0xb71a('0x32')],qs[_0xb71a('0x37')](_0x56f5a4[_0xb71a('0x33')]['fields']));_0x5c2a45['attributes']=_0x5c2a45[_0xb71a('0x36')][_0xb71a('0x38')]?_0x5c2a45[_0xb71a('0x36')]:_0x70299a[_0xb71a('0x32')];if(!_0x56f5a4[_0xb71a('0x33')][_0xb71a('0x39')](_0xb71a('0x3a'))){_0x5c2a45['limit']=qs[_0xb71a('0x1f')](_0x56f5a4['query'][_0xb71a('0x1f')]);_0x5c2a45[_0xb71a('0x1d')]=qs[_0xb71a('0x1d')](_0x56f5a4[_0xb71a('0x33')]['offset']);}_0x5c2a45[_0xb71a('0x3b')]=qs[_0xb71a('0x3c')](_0x56f5a4[_0xb71a('0x33')][_0xb71a('0x3c')]);_0x5c2a45[_0xb71a('0x3d')]=qs[_0xb71a('0x34')](_[_0xb71a('0x3e')](_0x56f5a4[_0xb71a('0x33')],_0x70299a[_0xb71a('0x34')]),_0x4d9e1a);if(_0x56f5a4['query'][_0xb71a('0x3f')]){_0x5c2a45['where']=_[_0xb71a('0x40')](_0x5c2a45[_0xb71a('0x3d')],{'$or':_[_0xb71a('0x2d')](_0x4d9e1a,function(_0x3cca63){if(_0x3cca63[_0xb71a('0x31')]!==_0xb71a('0x41')){var _0x4aa607={};_0x4aa607[_0x3cca63['name']]={'$like':'%'+_0x56f5a4['query'][_0xb71a('0x3f')]+'%'};return _0x4aa607;}})});}_0x5c2a45=_['merge']({},_0x5c2a45,_0x56f5a4[_0xb71a('0x42')]);var _0x23f542={'where':_0x5c2a45[_0xb71a('0x3d')]};return db[_0xb71a('0x2e')][_0xb71a('0x20')](_0x23f542)[_0xb71a('0x24')](function(_0x59530a){_0x1b1aa8[_0xb71a('0x20')]=_0x59530a;if(_0x56f5a4[_0xb71a('0x33')][_0xb71a('0x43')]){_0x5c2a45[_0xb71a('0x44')]=[{'all':!![]}];}return db[_0xb71a('0x2e')][_0xb71a('0x45')](_0x5c2a45);})['then'](function(_0x2afff3){_0x1b1aa8[_0xb71a('0x46')]=_0x2afff3;return _0x1b1aa8;})[_0xb71a('0x24')](respondWithFilteredResult(_0x3112d3,_0x5c2a45))[_0xb71a('0x47')](handleError(_0x3112d3,null));};exports[_0xb71a('0x48')]=function(_0x8f97ff,_0x1d1c38){var _0x48baae={'raw':!![],'where':{'id':_0x8f97ff[_0xb71a('0x49')]['id']}},_0x48db05={};_0x48db05[_0xb71a('0x32')]=_[_0xb71a('0x4a')](db[_0xb71a('0x2e')]['rawAttributes']);_0x48db05[_0xb71a('0x33')]=_['keys'](_0x8f97ff[_0xb71a('0x33')]);_0x48db05[_0xb71a('0x34')]=_['intersection'](_0x48db05[_0xb71a('0x32')],_0x48db05[_0xb71a('0x33')]);_0x48baae[_0xb71a('0x36')]=_[_0xb71a('0x35')](_0x48db05['model'],qs[_0xb71a('0x37')](_0x8f97ff[_0xb71a('0x33')][_0xb71a('0x37')]));_0x48baae['attributes']=_0x48baae[_0xb71a('0x36')][_0xb71a('0x38')]?_0x48baae[_0xb71a('0x36')]:_0x48db05['model'];if(_0x8f97ff[_0xb71a('0x33')][_0xb71a('0x43')]){_0x48baae[_0xb71a('0x44')]=[{'all':!![]}];}_0x48baae=_[_0xb71a('0x40')]({},_0x48baae,_0x8f97ff[_0xb71a('0x42')]);return db['Disposition'][_0xb71a('0x4b')](_0x48baae)[_0xb71a('0x24')](handleEntityNotFound(_0x1d1c38,null))[_0xb71a('0x24')](respondWithResult(_0x1d1c38,null))[_0xb71a('0x47')](handleError(_0x1d1c38,null));};exports['create']=function(_0x48fbde,_0x23b4c0){return db[_0xb71a('0x2e')][_0xb71a('0x4c')](_0x48fbde[_0xb71a('0x4d')],{})[_0xb71a('0x24')](function(_0x2f2187){var _0x2a7804=_0x48fbde[_0xb71a('0x4e')][_0xb71a('0x26')]({'plain':!![]});if(!_0x2a7804)throw new Error(_0xb71a('0x4f'));if(_0x2a7804['role']===_0xb71a('0x4e')){var _0x2ce711=_0x2f2187['get']({'plain':!![]});var _0x1c0536='Dispositions';return db[_0xb71a('0x50')][_0xb71a('0x4b')]({'where':{'name':_0x1c0536,'userProfileId':_0x2a7804[_0xb71a('0x51')]},'raw':!![]})[_0xb71a('0x24')](function(_0x84c587){if(_0x84c587&&_0x84c587['autoAssociation']===0x0){return db[_0xb71a('0x28')]['create']({'name':_0x2ce711[_0xb71a('0x2b')],'resourceId':_0x2ce711['id'],'type':_0x84c587[_0xb71a('0x2b')],'sectionId':_0x84c587['id']},{})['then'](function(){return _0x2f2187;});}else{return _0x2f2187;}})['catch'](function(_0x1d534d){logger[_0xb71a('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d534d);throw _0x1d534d;});}return _0x2f2187;})['then'](respondWithResult(_0x23b4c0,0xc9))['catch'](handleError(_0x23b4c0,null));};exports[_0xb71a('0x23')]=function(_0x57ef8f,_0x59d583){if(_0x57ef8f[_0xb71a('0x4d')]['id']){delete _0x57ef8f[_0xb71a('0x4d')]['id'];}return db[_0xb71a('0x2e')][_0xb71a('0x4b')]({'where':{'id':_0x57ef8f['params']['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x59d583,null))[_0xb71a('0x24')](saveUpdates(_0x57ef8f[_0xb71a('0x4d')],null))['then'](respondWithResult(_0x59d583,null))[_0xb71a('0x47')](handleError(_0x59d583,null));};exports[_0xb71a('0x25')]=function(_0x4dee60,_0x2d14f0){return db[_0xb71a('0x2e')][_0xb71a('0x4b')]({'where':{'id':_0x4dee60['params']['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x2d14f0,null))['then'](removeEntity(_0x2d14f0,null))[_0xb71a('0x47')](handleError(_0x2d14f0,null));}; \ No newline at end of file +var _0xd9dc=['update','destroy','Dispositions','then','sendStatus','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','Disposition','findAll','rows','catch','show','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','count','offset','limit','Content-Range','apply','save'];(function(_0x16764b,_0x392163){var _0x418b11=function(_0x4c6745){while(--_0x4c6745){_0x16764b['push'](_0x16764b['shift']());}};_0x418b11(++_0x392163);}(_0xd9dc,0x18b));var _0xcd9d=function(_0x2d2823,_0x2c1e2f){_0x2d2823=_0x2d2823-0x0;var _0x339a27=_0xd9dc[_0x2d2823];return _0x339a27;};'use strict';var emlformat=require(_0xcd9d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd9d('0x1'));var jsonpatch=require(_0xcd9d('0x2'));var rp=require(_0xcd9d('0x3'));var moment=require(_0xcd9d('0x4'));var BPromise=require(_0xcd9d('0x5'));var Mustache=require(_0xcd9d('0x6'));var util=require(_0xcd9d('0x7'));var path=require(_0xcd9d('0x8'));var sox=require(_0xcd9d('0x9'));var csv=require(_0xcd9d('0xa'));var ejs=require(_0xcd9d('0xb'));var fs=require('fs');var fs_extra=require(_0xcd9d('0xc'));var _=require(_0xcd9d('0xd'));var squel=require(_0xcd9d('0xe'));var crypto=require('crypto');var jsforce=require(_0xcd9d('0xf'));var deskjs=require(_0xcd9d('0x10'));var toCsv=require(_0xcd9d('0xa'));var querystring=require(_0xcd9d('0x11'));var Papa=require(_0xcd9d('0x12'));var Redis=require(_0xcd9d('0x13'));var authService=require(_0xcd9d('0x14'));var qs=require(_0xcd9d('0x15'));var as=require(_0xcd9d('0x16'));var hardwareService=require(_0xcd9d('0x17'));var logger=require(_0xcd9d('0x18'))(_0xcd9d('0x19'));var utils=require(_0xcd9d('0x1a'));var config=require(_0xcd9d('0x1b'));var licenseUtil=require(_0xcd9d('0x1c'));var db=require(_0xcd9d('0x1d'))['db'];function respondWithStatusCode(_0x2a7c70,_0x24e9eb){_0x24e9eb=_0x24e9eb||0xcc;return function(_0x26f7b4){if(_0x26f7b4){return _0x2a7c70['sendStatus'](_0x24e9eb);}return _0x2a7c70['status'](_0x24e9eb)[_0xcd9d('0x1e')]();};}function respondWithResult(_0x5beba3,_0x3fe56d){_0x3fe56d=_0x3fe56d||0xc8;return function(_0x195a50){if(_0x195a50){return _0x5beba3[_0xcd9d('0x1f')](_0x3fe56d)[_0xcd9d('0x20')](_0x195a50);}};}function respondWithFilteredResult(_0x5c8a04,_0xaed2f9){return function(_0x2e5b9e){if(_0x2e5b9e){var _0x9481e3=typeof _0xaed2f9['offset']==='undefined'&&typeof _0xaed2f9['limit']===_0xcd9d('0x21');var _0x1052b7=_0x2e5b9e[_0xcd9d('0x22')];var _0x4e18e8=_0x9481e3?0x0:_0xaed2f9[_0xcd9d('0x23')];var _0x2cc86a=_0x9481e3?_0x2e5b9e['count']:_0xaed2f9[_0xcd9d('0x23')]+_0xaed2f9[_0xcd9d('0x24')];var _0x47ae73;if(_0x2cc86a>=_0x1052b7){_0x2cc86a=_0x1052b7;_0x47ae73=0xc8;}else{_0x47ae73=0xce;}_0x5c8a04['status'](_0x47ae73);return _0x5c8a04['set'](_0xcd9d('0x25'),_0x4e18e8+'-'+_0x2cc86a+'/'+_0x1052b7)['json'](_0x2e5b9e);}return null;};}function patchUpdates(_0x4a873b){return function(_0x1d2ac2){try{jsonpatch[_0xcd9d('0x26')](_0x1d2ac2,_0x4a873b,!![]);}catch(_0x287dbe){return BPromise['reject'](_0x287dbe);}return _0x1d2ac2[_0xcd9d('0x27')]();};}function saveUpdates(_0x47e5a5,_0x16b8e0){return function(_0x557354){if(_0x557354){return _0x557354[_0xcd9d('0x28')](_0x47e5a5)['then'](function(_0x10fa94){return _0x10fa94;});}return null;};}function removeEntity(_0xfca313,_0x289771){return function(_0x3d421f){if(_0x3d421f){return _0x3d421f[_0xcd9d('0x29')]()['then'](function(){var _0x15bb5d=_0x3d421f['get']({'plain':!![]});var _0x4cdb1d=_0xcd9d('0x2a');return db['UserProfileResource'][_0xcd9d('0x29')]({'where':{'type':_0x4cdb1d,'resourceId':_0x15bb5d['id']}})[_0xcd9d('0x2b')](function(){return _0x3d421f;});})[_0xcd9d('0x2b')](function(){_0xfca313['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x94d7e0,_0x4eb1c0){return function(_0x1b6c0b){if(!_0x1b6c0b){_0x94d7e0[_0xcd9d('0x2c')](0x194);}return _0x1b6c0b;};}function handleError(_0x5d58bc,_0x37dc1a){_0x37dc1a=_0x37dc1a||0x1f4;return function(_0x113979){logger['error'](_0x113979[_0xcd9d('0x2d')]);if(_0x113979['name']){delete _0x113979[_0xcd9d('0x2e')];}_0x5d58bc['status'](_0x37dc1a)[_0xcd9d('0x2f')](_0x113979);};}exports[_0xcd9d('0x30')]=function(_0x27e2c4,_0x4801dd){var _0x22fb76={},_0xf38a99={},_0x4a4bc3={'count':0x0,'rows':[]};var _0x5385be=_['map'](db['Disposition'][_0xcd9d('0x31')],function(_0x4e2fea){return{'name':_0x4e2fea['fieldName'],'type':_0x4e2fea[_0xcd9d('0x32')][_0xcd9d('0x33')]};});_0xf38a99[_0xcd9d('0x34')]=_[_0xcd9d('0x35')](_0x5385be,_0xcd9d('0x2e'));_0xf38a99[_0xcd9d('0x36')]=_['keys'](_0x27e2c4[_0xcd9d('0x36')]);_0xf38a99[_0xcd9d('0x37')]=_[_0xcd9d('0x38')](_0xf38a99[_0xcd9d('0x34')],_0xf38a99[_0xcd9d('0x36')]);_0x22fb76[_0xcd9d('0x39')]=_[_0xcd9d('0x38')](_0xf38a99[_0xcd9d('0x34')],qs[_0xcd9d('0x3a')](_0x27e2c4['query'][_0xcd9d('0x3a')]));_0x22fb76[_0xcd9d('0x39')]=_0x22fb76[_0xcd9d('0x39')][_0xcd9d('0x3b')]?_0x22fb76[_0xcd9d('0x39')]:_0xf38a99['model'];if(!_0x27e2c4['query'][_0xcd9d('0x3c')]('nolimit')){_0x22fb76['limit']=qs[_0xcd9d('0x24')](_0x27e2c4[_0xcd9d('0x36')][_0xcd9d('0x24')]);_0x22fb76[_0xcd9d('0x23')]=qs['offset'](_0x27e2c4[_0xcd9d('0x36')]['offset']);}_0x22fb76[_0xcd9d('0x3d')]=qs[_0xcd9d('0x3e')](_0x27e2c4[_0xcd9d('0x36')]['sort']);_0x22fb76[_0xcd9d('0x3f')]=qs[_0xcd9d('0x37')](_[_0xcd9d('0x40')](_0x27e2c4[_0xcd9d('0x36')],_0xf38a99[_0xcd9d('0x37')]),_0x5385be);if(_0x27e2c4[_0xcd9d('0x36')][_0xcd9d('0x41')]){_0x22fb76['where']=_['merge'](_0x22fb76['where'],{'$or':_[_0xcd9d('0x35')](_0x5385be,function(_0x37bbb1){if(_0x37bbb1[_0xcd9d('0x32')]!==_0xcd9d('0x42')){var _0x1e67d2={};_0x1e67d2[_0x37bbb1['name']]={'$like':'%'+_0x27e2c4[_0xcd9d('0x36')][_0xcd9d('0x41')]+'%'};return _0x1e67d2;}})});}_0x22fb76=_[_0xcd9d('0x43')]({},_0x22fb76,_0x27e2c4[_0xcd9d('0x44')]);var _0x16c773={'where':_0x22fb76[_0xcd9d('0x3f')]};return db['Disposition'][_0xcd9d('0x22')](_0x16c773)[_0xcd9d('0x2b')](function(_0x46b781){_0x4a4bc3['count']=_0x46b781;if(_0x27e2c4[_0xcd9d('0x36')][_0xcd9d('0x45')]){_0x22fb76['include']=[{'all':!![]}];}return db[_0xcd9d('0x46')][_0xcd9d('0x47')](_0x22fb76);})[_0xcd9d('0x2b')](function(_0x105d50){_0x4a4bc3[_0xcd9d('0x48')]=_0x105d50;return _0x4a4bc3;})['then'](respondWithFilteredResult(_0x4801dd,_0x22fb76))[_0xcd9d('0x49')](handleError(_0x4801dd,null));};exports[_0xcd9d('0x4a')]=function(_0x1bccd6,_0x121634){var _0x402462={'raw':!![],'where':{'id':_0x1bccd6[_0xcd9d('0x4b')]['id']}},_0x4d0dff={};_0x4d0dff[_0xcd9d('0x34')]=_[_0xcd9d('0x4c')](db['Disposition'][_0xcd9d('0x31')]);_0x4d0dff[_0xcd9d('0x36')]=_[_0xcd9d('0x4c')](_0x1bccd6[_0xcd9d('0x36')]);_0x4d0dff[_0xcd9d('0x37')]=_['intersection'](_0x4d0dff[_0xcd9d('0x34')],_0x4d0dff['query']);_0x402462[_0xcd9d('0x39')]=_['intersection'](_0x4d0dff[_0xcd9d('0x34')],qs['fields'](_0x1bccd6['query'][_0xcd9d('0x3a')]));_0x402462[_0xcd9d('0x39')]=_0x402462['attributes'][_0xcd9d('0x3b')]?_0x402462[_0xcd9d('0x39')]:_0x4d0dff[_0xcd9d('0x34')];if(_0x1bccd6[_0xcd9d('0x36')][_0xcd9d('0x45')]){_0x402462['include']=[{'all':!![]}];}_0x402462=_[_0xcd9d('0x43')]({},_0x402462,_0x1bccd6[_0xcd9d('0x44')]);return db[_0xcd9d('0x46')][_0xcd9d('0x4d')](_0x402462)[_0xcd9d('0x2b')](handleEntityNotFound(_0x121634,null))[_0xcd9d('0x2b')](respondWithResult(_0x121634,null))[_0xcd9d('0x49')](handleError(_0x121634,null));};exports[_0xcd9d('0x4e')]=function(_0xf2946e,_0x5d1a43){return db['Disposition']['create'](_0xf2946e[_0xcd9d('0x4f')],{})[_0xcd9d('0x2b')](function(_0xea1ebd){var _0x318d3e=_0xf2946e[_0xcd9d('0x50')][_0xcd9d('0x51')]({'plain':!![]});if(!_0x318d3e)throw new Error(_0xcd9d('0x52'));if(_0x318d3e['role']===_0xcd9d('0x50')){var _0x135990=_0xea1ebd[_0xcd9d('0x51')]({'plain':!![]});var _0x469475=_0xcd9d('0x2a');return db[_0xcd9d('0x53')][_0xcd9d('0x4d')]({'where':{'name':_0x469475,'userProfileId':_0x318d3e[_0xcd9d('0x54')]},'raw':!![]})[_0xcd9d('0x2b')](function(_0x11db47){if(_0x11db47&&_0x11db47[_0xcd9d('0x55')]===0x0){return db['UserProfileResource'][_0xcd9d('0x4e')]({'name':_0x135990[_0xcd9d('0x2e')],'resourceId':_0x135990['id'],'type':_0x11db47[_0xcd9d('0x2e')],'sectionId':_0x11db47['id']},{})[_0xcd9d('0x2b')](function(){return _0xea1ebd;});}else{return _0xea1ebd;}})['catch'](function(_0x42670c){logger[_0xcd9d('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42670c);throw _0x42670c;});}return _0xea1ebd;})[_0xcd9d('0x2b')](respondWithResult(_0x5d1a43,0xc9))['catch'](handleError(_0x5d1a43,null));};exports[_0xcd9d('0x28')]=function(_0x5c682f,_0x42a505){if(_0x5c682f['body']['id']){delete _0x5c682f['body']['id'];}return db[_0xcd9d('0x46')]['find']({'where':{'id':_0x5c682f['params']['id']}})[_0xcd9d('0x2b')](handleEntityNotFound(_0x42a505,null))['then'](saveUpdates(_0x5c682f[_0xcd9d('0x4f')],null))['then'](respondWithResult(_0x42a505,null))[_0xcd9d('0x49')](handleError(_0x42a505,null));};exports[_0xcd9d('0x29')]=function(_0x1c230d,_0x4dbeae){return db[_0xcd9d('0x46')][_0xcd9d('0x4d')]({'where':{'id':_0x1c230d[_0xcd9d('0x4b')]['id']}})[_0xcd9d('0x2b')](handleEntityNotFound(_0x4dbeae,null))[_0xcd9d('0x2b')](removeEntity(_0x4dbeae,null))[_0xcd9d('0x49')](handleError(_0x4dbeae,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 29c881e..9f5b237 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 _0xd221=['name_voice','name','name_chat','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','api','moment','request-promise','./disposition.attributes','exports','define','Disposition','tools_dispositions'];(function(_0x5b1b8d,_0xf4575b){var _0xbd8358=function(_0x488832){while(--_0x488832){_0x5b1b8d['push'](_0x5b1b8d['shift']());}};_0xbd8358(++_0xf4575b);}(_0xd221,0x186));var _0x1d22=function(_0x52aa99,_0x193333){_0x52aa99=_0x52aa99-0x0;var _0x11f1ab=_0xd221[_0x52aa99];return _0x11f1ab;};'use strict';var _=require('lodash');var util=require(_0x1d22('0x0'));var logger=require('../../config/logger')(_0x1d22('0x1'));var moment=require(_0x1d22('0x2'));var BPromise=require('bluebird');var rp=require(_0x1d22('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1d22('0x4'));module[_0x1d22('0x5')]=function(_0x1a3d81,_0x14361f){return _0x1a3d81[_0x1d22('0x6')](_0x1d22('0x7'),attributes,{'tableName':_0x1d22('0x8'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x1d22('0x9'),'fields':[_0x1d22('0xa'),'ListId']},{'unique':!![],'name':_0x1d22('0xb'),'fields':[_0x1d22('0xa'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x1d22('0xa'),_0x1d22('0xc')]},{'unique':!![],'name':_0x1d22('0xd'),'fields':['name',_0x1d22('0xe')]},{'unique':!![],'name':_0x1d22('0xf'),'fields':['name',_0x1d22('0x10')]},{'unique':!![],'name':_0x1d22('0x11'),'fields':['name',_0x1d22('0x12')]},{'unique':!![],'name':_0x1d22('0x13'),'fields':[_0x1d22('0xa'),_0x1d22('0x14')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1f07=['name_openchannel','OpenchannelAccountId','name_whatsapp','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./disposition.attributes','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId'];(function(_0x574fc1,_0x9079d){var _0x422848=function(_0x6e6906){while(--_0x6e6906){_0x574fc1['push'](_0x574fc1['shift']());}};_0x422848(++_0x9079d);}(_0x1f07,0x148));var _0x71f0=function(_0x6a13ef,_0x5e6baf){_0x6a13ef=_0x6a13ef-0x0;var _0x35262b=_0x1f07[_0x6a13ef];return _0x35262b;};'use strict';var _=require('lodash');var util=require(_0x71f0('0x0'));var logger=require(_0x71f0('0x1'))(_0x71f0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x71f0('0x3'));var fs=require('fs');var path=require(_0x71f0('0x4'));var rimraf=require(_0x71f0('0x5'));var config=require(_0x71f0('0x6'));var attributes=require(_0x71f0('0x7'));module['exports']=function(_0x225f7f,_0x202262){return _0x225f7f[_0x71f0('0x8')](_0x71f0('0x9'),attributes,{'tableName':_0x71f0('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x71f0('0xb'),'fields':[_0x71f0('0xc'),_0x71f0('0xd')]},{'unique':!![],'name':_0x71f0('0xe'),'fields':[_0x71f0('0xc'),_0x71f0('0xf')]},{'unique':!![],'name':_0x71f0('0x10'),'fields':[_0x71f0('0xc'),_0x71f0('0x11')]},{'unique':!![],'name':_0x71f0('0x12'),'fields':[_0x71f0('0xc'),_0x71f0('0x13')]},{'unique':!![],'name':_0x71f0('0x14'),'fields':['name',_0x71f0('0x15')]},{'unique':!![],'name':_0x71f0('0x16'),'fields':[_0x71f0('0xc'),_0x71f0('0x17')]},{'unique':!![],'name':_0x71f0('0x18'),'fields':[_0x71f0('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 b971d1d..2b4dfca 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(_0x3bc001,_0x417f03){var _0x5f25b7=function(_0x3d6beb){while(--_0x3d6beb){_0x3bc001['push'](_0x3bc001['shift']());}};_0x5f25b7(++_0x417f03);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x12b18d,_0x21a617){var _0x90e3de=function(_0x30c745){while(--_0x30c745){_0x12b18d['push'](_0x12b18d['shift']());}};_0x90e3de(++_0x21a617);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 189cd93..a6e5031 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 _0xde0b=['./disposition.controller','get','isAuthenticated','/:id','show','post','create','put','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xde0b,0xd9));var _0xbde0=function(_0xfa3937,_0x1ba5a1){_0xfa3937=_0xfa3937-0x0;var _0x145823=_0xde0b[_0xfa3937];return _0x145823;};'use strict';var multer=require(_0xbde0('0x0'));var util=require(_0xbde0('0x1'));var path=require(_0xbde0('0x2'));var timeout=require(_0xbde0('0x3'));var express=require('express');var router=express[_0xbde0('0x4')]();var fs_extra=require(_0xbde0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbde0('0x6'));var config=require('../../config/environment');var controller=require(_0xbde0('0x7'));router[_0xbde0('0x8')]('/',auth[_0xbde0('0x9')](),controller['index']);router[_0xbde0('0x8')](_0xbde0('0xa'),auth[_0xbde0('0x9')](),controller[_0xbde0('0xb')]);router[_0xbde0('0xc')]('/',auth[_0xbde0('0x9')](),controller[_0xbde0('0xd')]);router[_0xbde0('0xe')]('/:id',auth[_0xbde0('0x9')](),controller['update']);router[_0xbde0('0xf')](_0xbde0('0xa'),auth[_0xbde0('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5ee9=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x4d5827,_0x2415e8){var _0x18afc5=function(_0x33fe27){while(--_0x33fe27){_0x4d5827['push'](_0x4d5827['shift']());}};_0x18afc5(++_0x2415e8);}(_0x5ee9,0x7d));var _0x95ee=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5ee9[_0x5f0089];return _0x193892;};'use strict';var multer=require('multer');var util=require(_0x95ee('0x0'));var path=require(_0x95ee('0x1'));var timeout=require(_0x95ee('0x2'));var express=require(_0x95ee('0x3'));var router=express[_0x95ee('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x95ee('0x5'));var interaction=require(_0x95ee('0x6'));var config=require(_0x95ee('0x7'));var controller=require(_0x95ee('0x8'));router[_0x95ee('0x9')]('/',auth[_0x95ee('0xa')](),controller[_0x95ee('0xb')]);router[_0x95ee('0x9')](_0x95ee('0xc'),auth[_0x95ee('0xa')](),controller[_0x95ee('0xd')]);router[_0x95ee('0xe')]('/',auth['isAuthenticated'](),controller[_0x95ee('0xf')]);router[_0x95ee('0x10')](_0x95ee('0xc'),auth[_0x95ee('0xa')](),controller[_0x95ee('0x11')]);router[_0x95ee('0x12')](_0x95ee('0xc'),auth[_0x95ee('0xa')](),controller[_0x95ee('0x13')]);module[_0x95ee('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 275759c..1b73617 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 _0xa495=['mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','14400','12000','v17,v27,v29','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','setDataValue'];(function(_0x423c2d,_0x2e1541){var _0x2a9ae6=function(_0x33a0d8){while(--_0x33a0d8){_0x423c2d['push'](_0x423c2d['shift']());}};_0x2a9ae6(++_0x2e1541);}(_0xa495,0x79));var _0x5a49=function(_0x1e354d,_0x4cdd11){_0x1e354d=_0x1e354d-0x0;var _0x25445d=_0xa495[_0x1e354d];return _0x25445d;};'use strict';var Sequelize=require(_0x5a49('0x0'));module[_0x5a49('0x1')]={'name':{'type':Sequelize[_0x5a49('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5a49('0x2')]},'ecm':{'type':Sequelize[_0x5a49('0x3')](_0x5a49('0x4'),'no'),'defaultValue':_0x5a49('0x4')},'headerinfo':{'type':Sequelize[_0x5a49('0x2')],'defaultValue':_0x5a49('0x5')},'localstationid':{'type':Sequelize[_0x5a49('0x2')],'unique':_0x5a49('0x6')},'minrate':{'type':Sequelize[_0x5a49('0x3')](_0x5a49('0x7'),_0x5a49('0x8'),_0x5a49('0x9'),_0x5a49('0xa'),'12000',_0x5a49('0xb')),'defaultValue':_0x5a49('0x8')},'maxrate':{'type':Sequelize[_0x5a49('0x3')]('2400',_0x5a49('0x8'),_0x5a49('0x9'),'9600',_0x5a49('0xc'),_0x5a49('0xb')),'defaultValue':_0x5a49('0xb')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x5a49('0xd')},'gateway':{'type':Sequelize[_0x5a49('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x5a49('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x5a49('0x3')](_0x5a49('0xe'),_0x5a49('0xf'),_0x5a49('0x10'),_0x5a49('0x11')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5a49('0x12')],'defaultValue':function(){return _0x5a49('0x13');}},'notificationSound':{'type':Sequelize[_0x5a49('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5a49('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5a49('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5a49('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5a49('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5a49('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5a49('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5a49('0x15')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5a49('0x14')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x82640c){if(!_0x82640c)this[_0x5a49('0x16')](_0x5a49('0x17'),null);this[_0x5a49('0x16')]('mandatoryDisposition',_0x82640c);}}}; \ No newline at end of file +var _0xaced=['sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','7200','9600','12000','14400','2400','4800','v17,v27,v29','INTEGER','DADHI','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x235481,_0x4624ab){var _0x40295b=function(_0x6cc636){while(--_0x6cc636){_0x235481['push'](_0x235481['shift']());}};_0x40295b(++_0x4624ab);}(_0xaced,0x18c));var _0xdace=function(_0x143a27,_0xa06ddb){_0x143a27=_0x143a27-0x0;var _0x3956f4=_0xaced[_0x143a27];return _0x3956f4;};'use strict';var Sequelize=require(_0xdace('0x0'));module[_0xdace('0x1')]={'name':{'type':Sequelize[_0xdace('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdace('0x2')]},'ecm':{'type':Sequelize[_0xdace('0x3')]('yes','no'),'defaultValue':_0xdace('0x4')},'headerinfo':{'type':Sequelize[_0xdace('0x2')],'defaultValue':_0xdace('0x5')},'localstationid':{'type':Sequelize[_0xdace('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0xdace('0x3')]('2400','4800',_0xdace('0x6'),_0xdace('0x7'),_0xdace('0x8'),_0xdace('0x9')),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0xdace('0xa'),_0xdace('0xb'),_0xdace('0x6'),_0xdace('0x7'),'12000',_0xdace('0x9')),'defaultValue':_0xdace('0x9')},'modem':{'type':Sequelize[_0xdace('0x2')],'defaultValue':_0xdace('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xdace('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xdace('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM']('SIP','IAX',_0xdace('0xe'),'KHOMP'),'defaultValue':_0xdace('0xf')},'key':{'type':Sequelize[_0xdace('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xdace('0x10')],'defaultValue':function(){return _0xdace('0x11');}},'notificationSound':{'type':Sequelize[_0xdace('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xdace('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xdace('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdace('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdace('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdace('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xdace('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xdace('0x12')],'defaultValue':![],'comment':_0xdace('0x14'),'set':function(_0xa3594e){if(!_0xa3594e)this[_0xdace('0x15')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0xa3594e);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 52fe61c..64d5181 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 _0xa8c2=['create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','describe','FaxAccountId','getDispositions','findOne','Disposition','nolimit','order','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','send','getApplications','context','from-voip-provider','localstationid','app','system','description','Fax\x20Extension','priority','appdata','push','Answer','Set','ecm','gateway','faxdetect','minrate','modem','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','transaction','tech','key','createdAt','updatedAt','TrunkId','ListId','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','CmList','List','Contacts','attachments','join','basename','CheckAfterSend','isNil','from','fax','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','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','end','stack','name','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','include','rows','show','params','includeAll','find'];(function(_0x4370c7,_0x5dbfb0){var _0xce78a9=function(_0x157b2c){while(--_0x157b2c){_0x4370c7['push'](_0x4370c7['shift']());}};_0xce78a9(++_0x5dbfb0);}(_0xa8c2,0x6c));var _0x2a8c=function(_0x4e68aa,_0x77632d){_0x4e68aa=_0x4e68aa-0x0;var _0xfe0a56=_0xa8c2[_0x4e68aa];return _0xfe0a56;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2a8c('0x0'));var jsonpatch=require(_0x2a8c('0x1'));var rp=require(_0x2a8c('0x2'));var moment=require(_0x2a8c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2a8c('0x4'));var util=require(_0x2a8c('0x5'));var path=require(_0x2a8c('0x6'));var sox=require(_0x2a8c('0x7'));var csv=require(_0x2a8c('0x8'));var ejs=require(_0x2a8c('0x9'));var fs=require('fs');var fs_extra=require(_0x2a8c('0xa'));var _=require('lodash');var squel=require(_0x2a8c('0xb'));var crypto=require(_0x2a8c('0xc'));var jsforce=require(_0x2a8c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2a8c('0x8'));var querystring=require(_0x2a8c('0xe'));var Papa=require(_0x2a8c('0xf'));var Redis=require('ioredis');var authService=require(_0x2a8c('0x10'));var qs=require(_0x2a8c('0x11'));var as=require(_0x2a8c('0x12'));var hardwareService=require(_0x2a8c('0x13'));var logger=require(_0x2a8c('0x14'))(_0x2a8c('0x15'));var utils=require(_0x2a8c('0x16'));var config=require(_0x2a8c('0x17'));var licenseUtil=require(_0x2a8c('0x18'));var db=require(_0x2a8c('0x19'))['db'];config[_0x2a8c('0x1a')]=_[_0x2a8c('0x1b')](config[_0x2a8c('0x1a')],{'host':_0x2a8c('0x1c'),'port':0x18eb});var socket=require(_0x2a8c('0x1d'))(new Redis(config[_0x2a8c('0x1a')]));require('./faxAccount.socket')[_0x2a8c('0x1e')](socket);var jayson=require(_0x2a8c('0x1f'));var client=jayson[_0x2a8c('0x20')][_0x2a8c('0x21')]({'port':0x232c});var client9002=jayson[_0x2a8c('0x20')][_0x2a8c('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x3c9240,_0x50d0f7,_0x597ac9,_0x3303bf){return new BPromise(function(_0x291667,_0x45d2b0){var _0x2c7cd2=_0x3303bf||client;return _0x2c7cd2[_0x2a8c('0x22')](_0x3c9240,_0x597ac9)[_0x2a8c('0x23')](function(_0x455a9a){logger[_0x2a8c('0x24')](_0x2a8c('0x25'),_0x50d0f7,_0x2a8c('0x26'));logger[_0x2a8c('0x27')](_0x2a8c('0x28'),_0x50d0f7,'request\x20sent',JSON[_0x2a8c('0x29')](_0x455a9a));if(_0x455a9a[_0x2a8c('0x2a')]){if(_0x455a9a['error'][_0x2a8c('0x2b')]===0x1f4){logger[_0x2a8c('0x2a')]('FaxAccount,\x20%s,\x20%s',_0x50d0f7,_0x455a9a['error'][_0x2a8c('0x2c')]);return _0x45d2b0(_0x455a9a[_0x2a8c('0x2a')][_0x2a8c('0x2c')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x50d0f7,_0x455a9a[_0x2a8c('0x2a')][_0x2a8c('0x2c')]);return _0x291667(_0x455a9a[_0x2a8c('0x2a')][_0x2a8c('0x2c')]);}else{logger['info'](_0x2a8c('0x25'),_0x50d0f7,'request\x20sent');_0x291667(_0x455a9a[_0x2a8c('0x2d')]['message']);}})[_0x2a8c('0x2e')](function(_0x5c51d3){logger['error'](_0x2a8c('0x25'),_0x50d0f7,_0x5c51d3);_0x45d2b0(_0x5c51d3);});});}function respondWithStatusCode(_0x5e8b1f,_0x37782f){_0x37782f=_0x37782f||0xcc;return function(_0x417e0d){if(_0x417e0d){return _0x5e8b1f[_0x2a8c('0x2f')](_0x37782f);}return _0x5e8b1f['status'](_0x37782f)['end']();};}function respondWithResult(_0x2e0188,_0x15b954){_0x15b954=_0x15b954||0xc8;return function(_0x27c551){if(_0x27c551){return _0x2e0188[_0x2a8c('0x30')](_0x15b954)[_0x2a8c('0x31')](_0x27c551);}};}function respondWithFilteredResult(_0x5a47a0,_0x29dab4){return function(_0x509cef){if(_0x509cef){var _0x176e48=typeof _0x29dab4[_0x2a8c('0x32')]===_0x2a8c('0x33')&&typeof _0x29dab4[_0x2a8c('0x34')]===_0x2a8c('0x33');var _0x2c3757=_0x509cef[_0x2a8c('0x35')];var _0x429c54=_0x176e48?0x0:_0x29dab4['offset'];var _0xc7df79=_0x176e48?_0x509cef[_0x2a8c('0x35')]:_0x29dab4[_0x2a8c('0x32')]+_0x29dab4[_0x2a8c('0x34')];var _0x593241;if(_0xc7df79>=_0x2c3757){_0xc7df79=_0x2c3757;_0x593241=0xc8;}else{_0x593241=0xce;}_0x5a47a0['status'](_0x593241);return _0x5a47a0['set'](_0x2a8c('0x36'),_0x429c54+'-'+_0xc7df79+'/'+_0x2c3757)[_0x2a8c('0x31')](_0x509cef);}return null;};}function patchUpdates(_0x14ebca){return function(_0x47eb46){try{jsonpatch[_0x2a8c('0x37')](_0x47eb46,_0x14ebca,!![]);}catch(_0x4feb37){return BPromise[_0x2a8c('0x38')](_0x4feb37);}return _0x47eb46[_0x2a8c('0x39')]();};}function saveUpdates(_0x2a5ea7,_0x456ef1){return function(_0x536cf7){if(_0x536cf7){return _0x536cf7[_0x2a8c('0x3a')](_0x2a5ea7)[_0x2a8c('0x23')](function(_0x1731de){return _0x1731de;});}return null;};}function removeEntity(_0x2d5082,_0x1f484c){return function(_0x24c933){if(_0x24c933){return _0x24c933[_0x2a8c('0x3b')]()[_0x2a8c('0x23')](function(){var _0x400a10=_0x24c933[_0x2a8c('0x3c')]({'plain':!![]});var _0x456948='FaxAccounts';return db[_0x2a8c('0x3d')][_0x2a8c('0x3b')]({'where':{'type':_0x456948,'resourceId':_0x400a10['id']}})[_0x2a8c('0x23')](function(){return _0x24c933;});})[_0x2a8c('0x23')](function(){_0x2d5082[_0x2a8c('0x30')](0xcc)[_0x2a8c('0x3e')]();});}};}function handleEntityNotFound(_0x7b8580,_0xa3f033){return function(_0x39fc6f){if(!_0x39fc6f){_0x7b8580[_0x2a8c('0x2f')](0x194);}return _0x39fc6f;};}function handleError(_0xd5a3c4,_0x474eae){_0x474eae=_0x474eae||0x1f4;return function(_0x318f33){logger[_0x2a8c('0x2a')](_0x318f33[_0x2a8c('0x3f')]);if(_0x318f33[_0x2a8c('0x40')]){delete _0x318f33[_0x2a8c('0x40')];}_0xd5a3c4[_0x2a8c('0x30')](_0x474eae)['send'](_0x318f33);};}exports[_0x2a8c('0x41')]=function(_0x2fa386,_0x520249){var _0x2f097a={'include':[{'model':db[_0x2a8c('0x42')],'as':_0x2a8c('0x43')}]},_0x1b4f3b={},_0x5281cd={'count':0x0,'rows':[]};var _0x502473=_[_0x2a8c('0x44')](db[_0x2a8c('0x45')][_0x2a8c('0x46')],function(_0x5db77c){return{'name':_0x5db77c[_0x2a8c('0x47')],'type':_0x5db77c['type']['key']};});_0x1b4f3b[_0x2a8c('0x48')]=_[_0x2a8c('0x44')](_0x502473,_0x2a8c('0x40'));_0x1b4f3b[_0x2a8c('0x49')]=_[_0x2a8c('0x4a')](_0x2fa386[_0x2a8c('0x49')]);_0x1b4f3b[_0x2a8c('0x4b')]=_[_0x2a8c('0x4c')](_0x1b4f3b[_0x2a8c('0x48')],_0x1b4f3b[_0x2a8c('0x49')]);_0x2f097a['attributes']=_[_0x2a8c('0x4c')](_0x1b4f3b[_0x2a8c('0x48')],qs[_0x2a8c('0x4d')](_0x2fa386[_0x2a8c('0x49')][_0x2a8c('0x4d')]));_0x2f097a[_0x2a8c('0x4e')]=_0x2f097a['attributes'][_0x2a8c('0x4f')]?_0x2f097a[_0x2a8c('0x4e')]:_0x1b4f3b[_0x2a8c('0x48')];if(!_0x2fa386['query'][_0x2a8c('0x50')]('nolimit')){_0x2f097a[_0x2a8c('0x34')]=qs['limit'](_0x2fa386[_0x2a8c('0x49')]['limit']);_0x2f097a['offset']=qs[_0x2a8c('0x32')](_0x2fa386[_0x2a8c('0x49')][_0x2a8c('0x32')]);}_0x2f097a['order']=qs[_0x2a8c('0x51')](_0x2fa386['query'][_0x2a8c('0x51')]);_0x2f097a[_0x2a8c('0x52')]=qs['filters'](_[_0x2a8c('0x53')](_0x2fa386[_0x2a8c('0x49')],_0x1b4f3b['filters']),_0x502473);if(_0x2fa386[_0x2a8c('0x49')][_0x2a8c('0x54')]){_0x2f097a['where']=_[_0x2a8c('0x55')](_0x2f097a[_0x2a8c('0x52')],{'$or':_[_0x2a8c('0x44')](_0x502473,function(_0x1885f8){if(_0x1885f8[_0x2a8c('0x56')]!=='VIRTUAL'){var _0x1d602c={};_0x1d602c[_0x1885f8[_0x2a8c('0x40')]]={'$like':'%'+_0x2fa386[_0x2a8c('0x49')][_0x2a8c('0x54')]+'%'};return _0x1d602c;}})});}_0x2f097a=_['merge']({},_0x2f097a,_0x2fa386['options']);var _0x5f27fd={'where':_0x2f097a[_0x2a8c('0x52')]};return db['FaxAccount'][_0x2a8c('0x35')](_0x5f27fd)[_0x2a8c('0x23')](function(_0x525b96){_0x5281cd[_0x2a8c('0x35')]=_0x525b96;if(_0x2fa386[_0x2a8c('0x49')]['includeAll']){_0x2f097a[_0x2a8c('0x57')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x2f097a);})['then'](function(_0x12cd1d){_0x5281cd[_0x2a8c('0x58')]=_0x12cd1d;return _0x5281cd;})[_0x2a8c('0x23')](respondWithFilteredResult(_0x520249,_0x2f097a))[_0x2a8c('0x2e')](handleError(_0x520249,null));};exports[_0x2a8c('0x59')]=function(_0x240e7f,_0x2f33f8){var _0x3abec0={'raw':![],'where':{'id':_0x240e7f[_0x2a8c('0x5a')]['id']},'include':[{'model':db[_0x2a8c('0x42')],'as':_0x2a8c('0x43')}]},_0x479d36={};_0x479d36[_0x2a8c('0x48')]=_[_0x2a8c('0x4a')](db[_0x2a8c('0x45')][_0x2a8c('0x46')]);_0x479d36[_0x2a8c('0x49')]=_[_0x2a8c('0x4a')](_0x240e7f[_0x2a8c('0x49')]);_0x479d36['filters']=_['intersection'](_0x479d36['model'],_0x479d36[_0x2a8c('0x49')]);_0x3abec0[_0x2a8c('0x4e')]=_[_0x2a8c('0x4c')](_0x479d36[_0x2a8c('0x48')],qs[_0x2a8c('0x4d')](_0x240e7f['query']['fields']));_0x3abec0[_0x2a8c('0x4e')]=_0x3abec0[_0x2a8c('0x4e')][_0x2a8c('0x4f')]?_0x3abec0[_0x2a8c('0x4e')]:_0x479d36[_0x2a8c('0x48')];if(_0x240e7f[_0x2a8c('0x49')][_0x2a8c('0x5b')]){_0x3abec0['include']=[{'all':!![]}];}_0x3abec0=_[_0x2a8c('0x55')]({},_0x3abec0,_0x240e7f['options']);return db[_0x2a8c('0x45')][_0x2a8c('0x5c')](_0x3abec0)[_0x2a8c('0x23')](handleEntityNotFound(_0x2f33f8,null))[_0x2a8c('0x23')](respondWithResult(_0x2f33f8,null))[_0x2a8c('0x2e')](handleError(_0x2f33f8,null));};exports[_0x2a8c('0x5d')]=function(_0x3e2da1,_0x43dab0){return db[_0x2a8c('0x45')][_0x2a8c('0x5d')](_0x3e2da1[_0x2a8c('0x5e')],{})[_0x2a8c('0x23')](function(_0x1273a5){var _0x813a10=_0x3e2da1['user']['get']({'plain':!![]});if(!_0x813a10)throw new Error(_0x2a8c('0x5f'));if(_0x813a10['role']===_0x2a8c('0x60')){var _0x56c280=_0x1273a5['get']({'plain':!![]});var _0x5d5acb='FaxAccounts';return db[_0x2a8c('0x61')][_0x2a8c('0x5c')]({'where':{'name':_0x5d5acb,'userProfileId':_0x813a10[_0x2a8c('0x62')]},'raw':!![]})['then'](function(_0x2632e2){if(_0x2632e2&&_0x2632e2[_0x2a8c('0x63')]===0x0){return db['UserProfileResource'][_0x2a8c('0x5d')]({'name':_0x56c280['name'],'resourceId':_0x56c280['id'],'type':_0x2632e2[_0x2a8c('0x40')],'sectionId':_0x2632e2['id']},{})[_0x2a8c('0x23')](function(){return _0x1273a5;});}else{return _0x1273a5;}})[_0x2a8c('0x2e')](function(_0x12bf5e){logger[_0x2a8c('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12bf5e);throw _0x12bf5e;});}return _0x1273a5;})[_0x2a8c('0x23')](respondWithResult(_0x43dab0,0xc9))[_0x2a8c('0x2e')](handleError(_0x43dab0,null));};exports[_0x2a8c('0x3a')]=function(_0x4c95b0,_0x1be6ca){if(_0x4c95b0[_0x2a8c('0x5e')]['id']){delete _0x4c95b0[_0x2a8c('0x5e')]['id'];}return db[_0x2a8c('0x45')][_0x2a8c('0x5c')]({'where':{'id':_0x4c95b0[_0x2a8c('0x5a')]['id']},'include':[{'model':db[_0x2a8c('0x42')],'as':_0x2a8c('0x43')}]})[_0x2a8c('0x23')](handleEntityNotFound(_0x1be6ca,null))[_0x2a8c('0x23')](saveUpdates(_0x4c95b0['body'],null))[_0x2a8c('0x23')](respondWithResult(_0x1be6ca,null))[_0x2a8c('0x2e')](handleError(_0x1be6ca,null));};exports['destroy']=function(_0x139d18,_0x35494a){return db[_0x2a8c('0x45')]['find']({'where':{'id':_0x139d18[_0x2a8c('0x5a')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x35494a,null))[_0x2a8c('0x23')](removeEntity(_0x35494a,null))['catch'](handleError(_0x35494a,null));};exports[_0x2a8c('0x64')]=function(_0x1c3105,_0x3f682f){return db['FaxAccount'][_0x2a8c('0x64')]()[_0x2a8c('0x23')](respondWithResult(_0x3f682f,null))[_0x2a8c('0x2e')](handleError(_0x3f682f,null));};exports['addDisposition']=function(_0x4a8456,_0x4c792b,_0x51c45c){if(_0x4a8456[_0x2a8c('0x5e')]['id']){delete _0x4a8456['body']['id'];}return db[_0x2a8c('0x45')]['find']({'where':{'id':_0x4a8456[_0x2a8c('0x5a')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x4c792b,null))['then'](function(_0x2f07b6){if(_0x2f07b6){_0x4a8456['body'][_0x2a8c('0x65')]=_0x2f07b6['id'];return db['Disposition'][_0x2a8c('0x5d')](_0x4a8456[_0x2a8c('0x5e')]);}})[_0x2a8c('0x23')](respondWithResult(_0x4c792b,null))[_0x2a8c('0x2e')](handleError(_0x4c792b,null));};exports[_0x2a8c('0x66')]=function(_0x5526f2,_0x35538c,_0x45a928){var _0x36f1b7={'raw':![],'where':{}};var _0x189598={};var _0x59fcdf={'count':0x0,'rows':[]};return db[_0x2a8c('0x45')][_0x2a8c('0x67')]({'where':{'id':_0x5526f2[_0x2a8c('0x5a')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x35538c,null))[_0x2a8c('0x23')](function(_0x1b9ad8){if(_0x1b9ad8){_0x189598[_0x2a8c('0x48')]=_[_0x2a8c('0x4a')](db[_0x2a8c('0x68')][_0x2a8c('0x46')]);_0x189598[_0x2a8c('0x49')]=_[_0x2a8c('0x4a')](_0x5526f2[_0x2a8c('0x49')]);_0x189598['filters']=_[_0x2a8c('0x4c')](_0x189598['model'],_0x189598['query']);_0x36f1b7[_0x2a8c('0x4e')]=_[_0x2a8c('0x4c')](_0x189598['model'],qs[_0x2a8c('0x4d')](_0x5526f2[_0x2a8c('0x49')][_0x2a8c('0x4d')]));_0x36f1b7['attributes']=_0x36f1b7[_0x2a8c('0x4e')][_0x2a8c('0x4f')]?_0x36f1b7[_0x2a8c('0x4e')]:_0x189598['model'];if(!_0x5526f2[_0x2a8c('0x49')][_0x2a8c('0x50')](_0x2a8c('0x69'))){_0x36f1b7[_0x2a8c('0x34')]=qs['limit'](_0x5526f2[_0x2a8c('0x49')][_0x2a8c('0x34')]);_0x36f1b7[_0x2a8c('0x32')]=qs[_0x2a8c('0x32')](_0x5526f2[_0x2a8c('0x49')][_0x2a8c('0x32')]);}_0x36f1b7[_0x2a8c('0x6a')]=qs[_0x2a8c('0x51')](_0x5526f2['query']['sort']);_0x36f1b7['where']=qs['filters'](_['pick'](_0x5526f2[_0x2a8c('0x49')],_0x189598['filters']));_0x36f1b7['where'][_0x2a8c('0x65')]=_0x1b9ad8['id'];if(_0x5526f2[_0x2a8c('0x49')][_0x2a8c('0x54')]){_0x36f1b7['where']=_[_0x2a8c('0x55')](_0x36f1b7['where'],{'$or':_[_0x2a8c('0x44')](_0x36f1b7[_0x2a8c('0x4e')],function(_0x9522f5){var _0x3c539b={};_0x3c539b[_0x9522f5]={'$like':'%'+_0x5526f2[_0x2a8c('0x49')][_0x2a8c('0x54')]+'%'};return _0x3c539b;})});}_0x36f1b7=_[_0x2a8c('0x55')]({},_0x36f1b7,_0x5526f2[_0x2a8c('0x6b')]);return db['Disposition'][_0x2a8c('0x35')]({'where':_0x36f1b7[_0x2a8c('0x52')]})[_0x2a8c('0x23')](function(_0xee4a84){_0x59fcdf[_0x2a8c('0x35')]=_0xee4a84;if(_0x5526f2[_0x2a8c('0x49')][_0x2a8c('0x5b')]){_0x36f1b7[_0x2a8c('0x57')]=[{'all':!![]}];}return db[_0x2a8c('0x68')]['findAll'](_0x36f1b7);})[_0x2a8c('0x23')](function(_0x4aadcd){_0x59fcdf['rows']=_0x4aadcd;return _0x59fcdf;});}})['then'](respondWithFilteredResult(_0x35538c,_0x36f1b7))[_0x2a8c('0x2e')](handleError(_0x35538c,null));};exports[_0x2a8c('0x6c')]=function(_0x4900db,_0x465c4d,_0xe2deb2){return db[_0x2a8c('0x45')][_0x2a8c('0x5c')]({'where':{'id':_0x4900db['params']['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x465c4d,null))[_0x2a8c('0x23')](function(_0x17d9f1){if(_0x17d9f1){return _0x17d9f1[_0x2a8c('0x6c')](_0x4900db[_0x2a8c('0x49')][_0x2a8c('0x6d')]);}})[_0x2a8c('0x23')](respondWithStatusCode(_0x465c4d,null))[_0x2a8c('0x2e')](handleError(_0x465c4d,null));};exports[_0x2a8c('0x6e')]=function(_0x54a14d,_0x837b03,_0x3d3d9e){if(_0x54a14d[_0x2a8c('0x5e')]['id']){delete _0x54a14d[_0x2a8c('0x5e')]['id'];}return db[_0x2a8c('0x45')][_0x2a8c('0x5c')]({'where':{'id':_0x54a14d[_0x2a8c('0x5a')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x837b03,null))[_0x2a8c('0x23')](function(_0x12fbf7){if(_0x12fbf7){_0x54a14d['body']['FaxAccountId']=_0x12fbf7['id'];return db[_0x2a8c('0x6f')][_0x2a8c('0x5d')](_0x54a14d[_0x2a8c('0x5e')]);}})['then'](respondWithResult(_0x837b03,null))[_0x2a8c('0x2e')](handleError(_0x837b03,null));};exports[_0x2a8c('0x70')]=function(_0x463e8e,_0x497ef1,_0x28073e){var _0x23fdb8={'raw':![],'where':{}};var _0x158a7d={};var _0x6a973e={'count':0x0,'rows':[]};return db[_0x2a8c('0x45')][_0x2a8c('0x67')]({'where':{'id':_0x463e8e[_0x2a8c('0x5a')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x497ef1,null))['then'](function(_0xa5b87a){if(_0xa5b87a){_0x158a7d[_0x2a8c('0x48')]=_['keys'](db[_0x2a8c('0x6f')]['rawAttributes']);_0x158a7d[_0x2a8c('0x49')]=_[_0x2a8c('0x4a')](_0x463e8e[_0x2a8c('0x49')]);_0x158a7d['filters']=_[_0x2a8c('0x4c')](_0x158a7d[_0x2a8c('0x48')],_0x158a7d[_0x2a8c('0x49')]);_0x23fdb8[_0x2a8c('0x4e')]=_['intersection'](_0x158a7d[_0x2a8c('0x48')],qs[_0x2a8c('0x4d')](_0x463e8e[_0x2a8c('0x49')][_0x2a8c('0x4d')]));_0x23fdb8[_0x2a8c('0x4e')]=_0x23fdb8[_0x2a8c('0x4e')][_0x2a8c('0x4f')]?_0x23fdb8[_0x2a8c('0x4e')]:_0x158a7d['model'];if(!_0x463e8e[_0x2a8c('0x49')]['hasOwnProperty'](_0x2a8c('0x69'))){_0x23fdb8[_0x2a8c('0x34')]=qs[_0x2a8c('0x34')](_0x463e8e[_0x2a8c('0x49')]['limit']);_0x23fdb8[_0x2a8c('0x32')]=qs[_0x2a8c('0x32')](_0x463e8e[_0x2a8c('0x49')]['offset']);}_0x23fdb8['order']=qs['sort'](_0x463e8e['query'][_0x2a8c('0x51')]);_0x23fdb8[_0x2a8c('0x52')]=qs[_0x2a8c('0x4b')](_[_0x2a8c('0x53')](_0x463e8e[_0x2a8c('0x49')],_0x158a7d[_0x2a8c('0x4b')]));_0x23fdb8[_0x2a8c('0x52')]['FaxAccountId']=_0xa5b87a['id'];if(_0x463e8e['query'][_0x2a8c('0x54')]){_0x23fdb8[_0x2a8c('0x52')]=_[_0x2a8c('0x55')](_0x23fdb8[_0x2a8c('0x52')],{'$or':_['map'](_0x23fdb8['attributes'],function(_0x3c55d2){var _0x1662a9={};_0x1662a9[_0x3c55d2]={'$like':'%'+_0x463e8e['query']['filter']+'%'};return _0x1662a9;})});}_0x23fdb8=_[_0x2a8c('0x55')]({},_0x23fdb8,_0x463e8e[_0x2a8c('0x6b')]);return db[_0x2a8c('0x6f')][_0x2a8c('0x35')]({'where':_0x23fdb8[_0x2a8c('0x52')]})[_0x2a8c('0x23')](function(_0x58ef1a){_0x6a973e[_0x2a8c('0x35')]=_0x58ef1a;if(_0x463e8e[_0x2a8c('0x49')][_0x2a8c('0x5b')]){_0x23fdb8[_0x2a8c('0x57')]=[{'all':!![]}];}return db[_0x2a8c('0x6f')]['findAll'](_0x23fdb8);})[_0x2a8c('0x23')](function(_0x455b02){_0x6a973e['rows']=_0x455b02;return _0x6a973e;});}})[_0x2a8c('0x23')](respondWithFilteredResult(_0x497ef1,_0x23fdb8))[_0x2a8c('0x2e')](handleError(_0x497ef1,null));};exports[_0x2a8c('0x71')]=function(_0x3461a0,_0x2c0910,_0x3a0cc0){return db[_0x2a8c('0x45')][_0x2a8c('0x5c')]({'where':{'id':_0x3461a0[_0x2a8c('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2c0910,null))[_0x2a8c('0x23')](function(_0x12ff12){if(_0x12ff12){return _0x12ff12['removeAnswers'](_0x3461a0[_0x2a8c('0x49')][_0x2a8c('0x6d')]);}})[_0x2a8c('0x23')](respondWithStatusCode(_0x2c0910,null))[_0x2a8c('0x2e')](handleError(_0x2c0910,null));};exports[_0x2a8c('0x72')]=function(_0xcd13f5,_0x4c5102,_0x108022){return db[_0x2a8c('0x73')]['find']({'where':{'id':_0xcd13f5[_0x2a8c('0x5a')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x4c5102,null))[_0x2a8c('0x23')](function(_0x15532a){if(_0x15532a){return _0x15532a[_0x2a8c('0x72')](_0xcd13f5[_0x2a8c('0x5e')][_0x2a8c('0x6d')],_[_0x2a8c('0x74')](_0xcd13f5[_0x2a8c('0x5e')],[_0x2a8c('0x6d'),'id'])||{});}})[_0x2a8c('0x23')](respondWithResult(_0x4c5102,null))['catch'](handleError(_0x4c5102,null));};exports[_0x2a8c('0x75')]=function(_0x5e24d0,_0x4de65a,_0xb35f00){var _0x258e31={'raw':![],'where':{}};var _0x5a1d7c={};var _0x37d969={'count':0x0,'rows':[]};return db['FaxAccount'][_0x2a8c('0x67')]({'where':{'id':_0x5e24d0['params']['id']}})['then'](handleEntityNotFound(_0x4de65a,null))[_0x2a8c('0x23')](function(_0x3518b2){if(_0x3518b2){_0x5a1d7c['model']=_[_0x2a8c('0x4a')](db[_0x2a8c('0x73')][_0x2a8c('0x46')]);_0x5a1d7c[_0x2a8c('0x49')]=_[_0x2a8c('0x4a')](_0x5e24d0['query']);_0x5a1d7c[_0x2a8c('0x4b')]=_[_0x2a8c('0x4c')](_0x5a1d7c['model'],_0x5a1d7c[_0x2a8c('0x49')]);_0x258e31[_0x2a8c('0x4e')]=_[_0x2a8c('0x4c')](_0x5a1d7c[_0x2a8c('0x48')],qs[_0x2a8c('0x4d')](_0x5e24d0[_0x2a8c('0x49')]['fields']));_0x258e31['attributes']=_0x258e31[_0x2a8c('0x4e')][_0x2a8c('0x4f')]?_0x258e31[_0x2a8c('0x4e')]:_0x5a1d7c[_0x2a8c('0x48')];if(!_0x5e24d0[_0x2a8c('0x49')][_0x2a8c('0x50')](_0x2a8c('0x69'))){_0x258e31[_0x2a8c('0x34')]=qs[_0x2a8c('0x34')](_0x5e24d0[_0x2a8c('0x49')][_0x2a8c('0x34')]);_0x258e31[_0x2a8c('0x32')]=qs[_0x2a8c('0x32')](_0x5e24d0[_0x2a8c('0x49')]['offset']);}_0x258e31[_0x2a8c('0x6a')]=qs[_0x2a8c('0x51')](_0x5e24d0['query'][_0x2a8c('0x51')]);_0x258e31[_0x2a8c('0x52')]=qs[_0x2a8c('0x4b')](_['pick'](_0x5e24d0['query'],_0x5a1d7c['filters']));_0x258e31[_0x2a8c('0x52')][_0x2a8c('0x65')]=_0x3518b2['id'];if(_0x5e24d0['query'][_0x2a8c('0x54')]){_0x258e31['where']=_[_0x2a8c('0x55')](_0x258e31[_0x2a8c('0x52')],{'$or':_[_0x2a8c('0x44')](_0x258e31[_0x2a8c('0x4e')],function(_0x502566){var _0x46b830={};_0x46b830[_0x502566]={'$like':'%'+_0x5e24d0[_0x2a8c('0x49')]['filter']+'%'};return _0x46b830;})});}_0x258e31=_[_0x2a8c('0x55')]({},_0x258e31,_0x5e24d0[_0x2a8c('0x6b')]);return db[_0x2a8c('0x73')][_0x2a8c('0x35')]({'where':_0x258e31['where']})[_0x2a8c('0x23')](function(_0x415f16){_0x37d969['count']=_0x415f16;if(_0x5e24d0[_0x2a8c('0x49')][_0x2a8c('0x5b')]){_0x258e31['include']=[{'model':db[_0x2a8c('0x76')],'as':'Contact','required':![]},{'model':db[_0x2a8c('0x77')],'as':_0x2a8c('0x78'),'attributes':[_0x2a8c('0x40'),_0x2a8c('0x79'),'internal'],'required':![]},{'model':db[_0x2a8c('0x7a')],'as':_0x2a8c('0x7b'),'attributes':['id',_0x2a8c('0x40'),_0x2a8c('0x7c')],'where':_0x5e24d0[_0x2a8c('0x49')][_0x2a8c('0x7d')]?{'id':_0x5e24d0[_0x2a8c('0x49')][_0x2a8c('0x7d')]}:undefined,'required':_0x5e24d0[_0x2a8c('0x49')]['tag']?!![]:![]}];}return db[_0x2a8c('0x73')]['findAll'](_0x258e31);})[_0x2a8c('0x23')](function(_0x2f3dd6){_0x37d969['rows']=_0x2f3dd6;return _0x37d969;});}})[_0x2a8c('0x23')](respondWithFilteredResult(_0x4de65a,_0x258e31))[_0x2a8c('0x2e')](handleError(_0x4de65a,null));};exports[_0x2a8c('0x7e')]=function(_0x131d2c,_0x978e3a){var _0x96164c=_0x131d2c['params']['id'];var _0x5308db=_0x131d2c[_0x2a8c('0x5e')];var _0x3c9091=0xc8;var _0xc33e98=null;return db[_0x2a8c('0x7f')]['transaction']({'isolationLevel':db[_0x2a8c('0x7f')][_0x2a8c('0x80')][_0x2a8c('0x81')][_0x2a8c('0x82')]},function(_0x2a596d){return db[_0x2a8c('0x45')][_0x2a8c('0x67')]({'where':{'id':_0x96164c},'transaction':_0x2a596d})['then'](function(_0x45d8a0){if(_0x45d8a0){return db[_0x2a8c('0x83')][_0x2a8c('0x3b')]({'where':{'FaxAccountId':_0x96164c},'transaction':_0x2a596d})[_0x2a8c('0x23')](function(){var _0x1fec90=_[_0x2a8c('0x44')](_0x5308db,function(_0x418c4a){_0x418c4a['FaxAccountId']=_0x96164c;return _0x418c4a;});return db[_0x2a8c('0x83')][_0x2a8c('0x84')](_0x1fec90,{'transaction':_0x2a596d});});}else{_0x3c9091=0x194;_0xc33e98=[];}});})[_0x2a8c('0x23')](function(){if(_0x3c9091!==0x194){return db[_0x2a8c('0x83')][_0x2a8c('0x85')]({'where':{'FaxAccountId':_0x96164c},'order':'priority'})['then'](function(_0x499d37){_0xc33e98=_0x499d37;});}})[_0x2a8c('0x2e')](function(_0x26cd56){_0x3c9091=0x1f4;logger[_0x2a8c('0x2a')](_0x26cd56[_0x2a8c('0x3f')]);if(_0x26cd56['name']){delete _0x26cd56[_0x2a8c('0x40')];}_0xc33e98=_0x26cd56;})['finally'](function(){if(_0xc33e98===null){_0x978e3a[_0x2a8c('0x2f')](_0x3c9091);}else{if(_0x3c9091===0x1f4){_0x978e3a[_0x2a8c('0x30')](_0x3c9091)[_0x2a8c('0x86')](_0xc33e98);}else{_0x978e3a[_0x2a8c('0x30')](_0x3c9091)[_0x2a8c('0x31')](_0xc33e98);}}});};exports[_0x2a8c('0x87')]=function(_0x4feaf0,_0x40d7b3,_0x5edf20){var _0x15e472={};var _0x3927f6={};var _0x54b5c0;var _0x227008;return db['FaxAccount'][_0x2a8c('0x67')]({'where':{'id':_0x4feaf0[_0x2a8c('0x5a')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x40d7b3,null))[_0x2a8c('0x23')](function(_0x7f7755){if(_0x7f7755){_0x54b5c0=_0x7f7755;_0x3927f6[_0x2a8c('0x48')]=_[_0x2a8c('0x4a')](db['FaxApplication'][_0x2a8c('0x46')]);_0x3927f6['query']=_[_0x2a8c('0x4a')](_0x4feaf0['query']);_0x3927f6[_0x2a8c('0x4b')]=_[_0x2a8c('0x4c')](_0x3927f6[_0x2a8c('0x48')],_0x3927f6[_0x2a8c('0x49')]);_0x15e472[_0x2a8c('0x4e')]=_[_0x2a8c('0x4c')](_0x3927f6[_0x2a8c('0x48')],qs[_0x2a8c('0x4d')](_0x4feaf0[_0x2a8c('0x49')][_0x2a8c('0x4d')]));_0x15e472['attributes']=_0x15e472[_0x2a8c('0x4e')][_0x2a8c('0x4f')]?_0x15e472[_0x2a8c('0x4e')]:_0x3927f6[_0x2a8c('0x48')];_0x15e472['order']=qs[_0x2a8c('0x51')](_0x4feaf0['query'][_0x2a8c('0x51')]);_0x15e472[_0x2a8c('0x52')]=qs[_0x2a8c('0x4b')](_[_0x2a8c('0x53')](_0x4feaf0[_0x2a8c('0x49')],_0x3927f6[_0x2a8c('0x4b')]));if(_0x4feaf0['query'][_0x2a8c('0x54')]){_0x15e472['where']=_[_0x2a8c('0x55')](_0x15e472[_0x2a8c('0x52')],{'$or':_[_0x2a8c('0x44')](_0x15e472['attributes'],function(_0x4396f9){var _0x1dd534={};_0x1dd534[_0x4396f9]={'$like':'%'+_0x4feaf0[_0x2a8c('0x49')][_0x2a8c('0x54')]+'%'};return _0x1dd534;})});}_0x15e472=_['merge']({},_0x15e472,_0x4feaf0[_0x2a8c('0x6b')]);return _0x54b5c0[_0x2a8c('0x87')](_0x15e472);}})[_0x2a8c('0x23')](function(_0x3008b3){if(_0x3008b3){_0x227008=_0x3008b3[_0x2a8c('0x4f')];if(!_0x4feaf0[_0x2a8c('0x49')][_0x2a8c('0x50')](_0x2a8c('0x69'))){_0x15e472[_0x2a8c('0x34')]=qs['limit'](_0x4feaf0[_0x2a8c('0x49')][_0x2a8c('0x34')]);_0x15e472['offset']=qs[_0x2a8c('0x32')](_0x4feaf0[_0x2a8c('0x49')]['offset']);}return _0x54b5c0['getApplications'](_0x15e472);}})['then'](function(_0x4c0a59){if(_0x4c0a59){return _0x4c0a59?{'count':_0x227008,'rows':_0x4c0a59}:null;}})[_0x2a8c('0x23')](respondWithResult(_0x40d7b3,null))[_0x2a8c('0x2e')](handleError(_0x40d7b3,null));};function Extension(_0x6b62d0,_0x15dbbf,_0x54a894,_0x939f39){this[_0x2a8c('0x88')]=_0x2a8c('0x89');this['exten']=_0x6b62d0[_0x2a8c('0x8a')];this[_0x2a8c('0x8b')]=_0x939f39;this[_0x2a8c('0x56')]=_0x2a8c('0x8c');this[_0x2a8c('0x8d')]=_0x2a8c('0x8e');this[_0x2a8c('0x65')]=_0x6b62d0['id'];this[_0x2a8c('0x8f')]=_0x15dbbf;this[_0x2a8c('0x90')]=_0x54a894;}function createExtensionsReciveFax(_0x211cf2){var _0x3503d5=0x1;var _0x298149=[];_0x298149[_0x2a8c('0x91')](new Extension(_0x211cf2,_0x3503d5,'',_0x2a8c('0x92')));_0x3503d5+=0x1;_0x298149['push'](new Extension(_0x211cf2,_0x3503d5,'CDR(type)=inbound-fax',_0x2a8c('0x93')));_0x3503d5+=0x1;for(var _0x13ca6f in _0x211cf2){if(_0x211cf2[_0x2a8c('0x50')](_0x13ca6f)&&(_0x13ca6f===_0x2a8c('0x94')||_0x13ca6f===_0x2a8c('0x8a')||_0x13ca6f===_0x2a8c('0x95')||_0x13ca6f===_0x2a8c('0x96')||_0x13ca6f==='headerinfo'||_0x13ca6f==='maxrate'||_0x13ca6f===_0x2a8c('0x97')||_0x13ca6f===_0x2a8c('0x98')||_0x13ca6f==='t38timeout')){_0x298149[_0x2a8c('0x91')](new Extension(_0x211cf2,_0x3503d5,'FAXOPT('+_0x13ca6f+')='+_0x211cf2[_0x13ca6f],_0x2a8c('0x93')));_0x3503d5+=0x1;}}_0x298149['push'](new Extension(_0x211cf2,_0x3503d5,'6',_0x2a8c('0x99')));_0x3503d5+=0x1;_0x298149['push'](new Extension(_0x211cf2,_0x3503d5,_0x2a8c('0x9a'),_0x2a8c('0x9b')));_0x3503d5=0x0;return _0x298149;}exports[_0x2a8c('0x9c')]=function(_0x15d476,_0x2eea09,_0x53c118){var _0x40b675;return db[_0x2a8c('0x7f')]['transaction'](function(_0x9f11f1){return db[_0x2a8c('0x45')][_0x2a8c('0x5d')](_0x15d476['body'],{'transaction':_0x9f11f1})[_0x2a8c('0x23')](function(_0x23b1c4){_0x40b675=_0x23b1c4[_0x2a8c('0x3c')]({'plain':!![]});return db[_0x2a8c('0x9d')][_0x2a8c('0x84')](createExtensionsReciveFax(_0x40b675),{'transaction':_0x9f11f1});});})[_0x2a8c('0x23')](function(){return _0x40b675;})[_0x2a8c('0x23')](respondWithResult(_0x2eea09,null))[_0x2a8c('0x2e')](handleError(_0x2eea09,null));};exports[_0x2a8c('0x9e')]=function(_0x11bab0,_0x2135fd,_0x5f4234){var _0x2083d9;return db[_0x2a8c('0x7f')][_0x2a8c('0x9f')](function(_0x226709){return db[_0x2a8c('0x45')][_0x2a8c('0x3a')](_0x11bab0['body'],{'where':{'id':_0x11bab0['body']['id']},'transaction':_0x226709})[_0x2a8c('0x23')](function(_0x1d903f){return db[_0x2a8c('0x9d')]['destroy']({'where':{'FaxAccountId':_0x11bab0[_0x2a8c('0x5e')]['id']},'transaction':_0x226709})[_0x2a8c('0x23')](function(_0x55ad34){return db['VoiceExtension'][_0x2a8c('0x84')](createExtensionsReciveFax(_['omit'](_0x11bab0[_0x2a8c('0x5e')],[_0x2a8c('0xa0'),_0x2a8c('0xa1'),_0x2a8c('0xa2'),_0x2a8c('0xa3'),_0x2a8c('0xa4'),_0x2a8c('0xa5')])),{'transaction':_0x226709});});});})['then'](function(){return db['FaxAccount']['findById'](_0x11bab0[_0x2a8c('0x5e')]['id']);})[_0x2a8c('0x23')](respondWithResult(_0x2135fd,null))[_0x2a8c('0x2e')](handleError(_0x2135fd,null));};exports[_0x2a8c('0xa6')]=function(_0x12d546,_0x2d2ea8,_0x479b0c){var _0x389c84={'raw':!![],'where':{}};var _0x4abc33={};var _0x27c2aa={'count':0x0,'rows':[]};return db[_0x2a8c('0x45')][_0x2a8c('0x67')]({'where':{'id':_0x12d546[_0x2a8c('0x5a')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x2d2ea8,null))[_0x2a8c('0x23')](function(_0x5abb66){if(_0x5abb66){_0x4abc33['model']=_[_0x2a8c('0x4a')](db[_0x2a8c('0xa7')][_0x2a8c('0x46')]);_0x4abc33['query']=_[_0x2a8c('0x4a')](_0x12d546[_0x2a8c('0x49')]);_0x4abc33['filters']=_[_0x2a8c('0x4c')](_0x4abc33['model'],_0x4abc33['query']);_0x389c84[_0x2a8c('0x4e')]=_[_0x2a8c('0x4c')](_0x4abc33[_0x2a8c('0x48')],qs[_0x2a8c('0x4d')](_0x12d546[_0x2a8c('0x49')][_0x2a8c('0x4d')]));_0x389c84['attributes']=_0x389c84[_0x2a8c('0x4e')][_0x2a8c('0x4f')]?_0x389c84['attributes']:_0x4abc33[_0x2a8c('0x48')];if(!_0x12d546[_0x2a8c('0x49')][_0x2a8c('0x50')](_0x2a8c('0x69'))){_0x389c84['limit']=qs[_0x2a8c('0x34')](_0x12d546['query']['limit']);_0x389c84[_0x2a8c('0x32')]=qs[_0x2a8c('0x32')](_0x12d546[_0x2a8c('0x49')][_0x2a8c('0x32')]);}_0x389c84[_0x2a8c('0x6a')]=qs[_0x2a8c('0x51')](_0x12d546['query']['sort']);_0x389c84[_0x2a8c('0x52')]=qs['filters'](_[_0x2a8c('0x53')](_0x12d546[_0x2a8c('0x49')],_0x4abc33['filters']));_0x389c84[_0x2a8c('0x52')][_0x2a8c('0x65')]=_0x5abb66['id'];if(_0x12d546[_0x2a8c('0x49')][_0x2a8c('0x54')]){_0x389c84[_0x2a8c('0x52')]=_[_0x2a8c('0x55')](_0x389c84[_0x2a8c('0x52')],{'$or':_[_0x2a8c('0x44')](_0x389c84[_0x2a8c('0x4e')],function(_0x3f8737){var _0x10e40a={};_0x10e40a[_0x3f8737]={'$like':'%'+_0x12d546[_0x2a8c('0x49')][_0x2a8c('0x54')]+'%'};return _0x10e40a;})});}if(_0x12d546[_0x2a8c('0x49')][_0x2a8c('0xa8')]){var _0x57295b=_0x12d546['query'][_0x2a8c('0xa8')][_0x2a8c('0xa9')](',');var _0x3833b5={};_0x3833b5[_0x57295b[0x0]]={'$gte':moment(_0x57295b[0x1])[_0x2a8c('0xaa')](_0x2a8c('0xab'))};_0x389c84[_0x2a8c('0x52')]=_[_0x2a8c('0x55')](_0x389c84[_0x2a8c('0x52')],_0x3833b5);}_0x389c84=_['merge']({},_0x389c84,_0x12d546[_0x2a8c('0x6b')]);return db[_0x2a8c('0xa7')][_0x2a8c('0x35')]({'where':_0x389c84[_0x2a8c('0x52')]})[_0x2a8c('0x23')](function(_0x14920f){_0x27c2aa['count']=_0x14920f;if(_0x12d546[_0x2a8c('0x49')][_0x2a8c('0x5b')]){_0x389c84[_0x2a8c('0x57')]=[{'all':!![]}];}return db[_0x2a8c('0xa7')][_0x2a8c('0xac')](_0x389c84);})['then'](function(_0x2a297d){_0x27c2aa[_0x2a8c('0x58')]=_0x2a297d;return _0x27c2aa;});}})['then'](respondWithFilteredResult(_0x2d2ea8,_0x389c84))['catch'](handleError(_0x2d2ea8,null));};exports[_0x2a8c('0x86')]=function(_0x26d985,_0x596551,_0x5e650f){var _0x113aa4,_0x8f777a={},_0x605626;if(_0x26d985[_0x2a8c('0x5e')]['to']){_0x605626=_0x26d985['body']['to'][0x0];}return db['FaxAccount'][_0x2a8c('0x5c')]({'where':{'id':_0x26d985['params']['id']},'include':[{'model':db[_0x2a8c('0xad')],'as':_0x2a8c('0xae'),'include':[{'model':db[_0x2a8c('0x76')],'as':_0x2a8c('0xaf'),'where':{'fax':_0x605626},'limit':0x1,'order':[[_0x2a8c('0xa3'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x596551,null))[_0x2a8c('0x23')](function(_0x359808){_0x113aa4=_0x359808;if(_0x26d985[_0x2a8c('0x5e')]['attachments']&&_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][_0x2a8c('0x4f')]){for(var _0x484147=0x0;_0x484147<_0x26d985['body'][_0x2a8c('0xb0')][_0x2a8c('0x4f')];_0x484147+=0x1){_0x26d985['body'][_0x2a8c('0xb0')][_0x484147]={'filename':_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][_0x484147][_0x2a8c('0x40')],'id':_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][_0x484147]['id'],'path':path[_0x2a8c('0xb1')](config['root'],'server/files/attachments',_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][_0x484147][_0x2a8c('0xb2')])};}}return respondWithRpcPromise(_0x2a8c('0xb3'),_0x2a8c('0xb3'),{'FaxAccountId':_[_0x2a8c('0xb4')](_0x26d985[_0x2a8c('0x5a')]['id'])?undefined:_0x26d985[_0x2a8c('0x5a')]['id'],'path':_['isNil'](_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][0x0][_0x2a8c('0x6')])?undefined:_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][0x0][_0x2a8c('0x6')],'fax':_[_0x2a8c('0xb4')](_0x26d985[_0x2a8c('0x5e')]['to'][0x0])?undefined:_0x26d985[_0x2a8c('0x5e')]['to'][0x0]},client9002);})['then'](function(){if(_0x113aa4){if(_[_0x2a8c('0xb4')](_0x26d985['body'][_0x2a8c('0xb5')])){_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb5')]=util[_0x2a8c('0xaa')]('\x22%s\x22\x20<%s>',_0x113aa4[_0x2a8c('0x40')],_0x113aa4[_0x2a8c('0xb6')]);}if(_0x113aa4[_0x2a8c('0xae')]){if(_0x113aa4['List'][_0x2a8c('0xaf')][_0x2a8c('0x4f')]){return _0x113aa4[_0x2a8c('0xae')]['Contacts'][0x0];}else{return db[_0x2a8c('0x76')][_0x2a8c('0x5d')](_[_0x2a8c('0x1b')](_0x26d985['body'],{'firstName':_0x26d985[_0x2a8c('0x5e')]['to'][0x0],'phone':_0x26d985['body']['to'][0x0],'fax':_0x26d985[_0x2a8c('0x5e')]['to'][0x0],'ListId':_0x113aa4[_0x2a8c('0xa5')]}));}}else{throw new Error(_0x2a8c('0xb7'));}}else{throw new Error(_0x2a8c('0xb8'));}})['then'](function(_0x2092f){if(_0x2092f){return db[_0x2a8c('0x73')][_0x2a8c('0x5c')]({'where':{'ContactId':_0x2092f['id'],'closed':![],'FaxAccountId':_0x113aa4['id']}})[_0x2a8c('0x23')](function(_0x2295f3){if(_0x2295f3){return[_0x2295f3,![]];}return db[_0x2a8c('0x73')]['create']({'UserId':_0x26d985[_0x2a8c('0x60')]['id'],'ContactId':_0x2092f['id'],'FaxAccountId':_0x113aa4['id'],'fax':_0x26d985['body']['to'][0x0],'firstMsgDirection':_0x2a8c('0xb9'),'Messages':[_[_0x2a8c('0x55')](_0x26d985[_0x2a8c('0x5e')],{'read':![],'body':_0x26d985[_0x2a8c('0x5e')]['attachments'][0x0][_0x2a8c('0xba')],'FaxAccountId':_0x113aa4['id'],'UserId':_0x26d985[_0x2a8c('0x60')]['id'],'ContactId':_0x2092f['id'],'AttachmentId':_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][0x0]['id']})]},{'include':[{'model':db[_0x2a8c('0xa7')],'as':_0x2a8c('0xbb')}]})['then'](function(_0xdebe84){return[_0xdebe84,!![]];});});}else{throw new Error(_0x2a8c('0xbc'));}})[_0x2a8c('0xbd')](function(_0x3e10ae,_0x1c4ff8){if(_0x1c4ff8){return _0x3e10ae;}return db[_0x2a8c('0xa7')]['create']({'direction':'out','read':![],'body':_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][0x0][_0x2a8c('0xba')],'FaxAccountId':_0x113aa4['id'],'FaxInteractionId':_0x3e10ae['id'],'UserId':_0x26d985[_0x2a8c('0x60')]['id'],'ContactId':_0x3e10ae[_0x2a8c('0xbe')],'AttachmentId':_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][0x0]['id']})[_0x2a8c('0x23')](function(_0x2b5671){_0x3e10ae[_0x2a8c('0xbf')][_0x2a8c('0xbb')]=[];_0x3e10ae[_0x2a8c('0xbf')]['Messages'][_0x2a8c('0x91')](_0x2b5671['dataValues']);return _0x3e10ae;});})[_0x2a8c('0x23')](function(_0x3587df){respondWithRpcPromise(_0x2a8c('0xc0'),_0x2a8c('0xc0'),{'FaxAccountId':_['isNil'](_0x26d985[_0x2a8c('0x5a')]['id'])?undefined:_0x26d985[_0x2a8c('0x5a')]['id'],'path':_[_0x2a8c('0xb4')](_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][0x0][_0x2a8c('0x6')])?undefined:_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][0x0][_0x2a8c('0x6')],'fax':_[_0x2a8c('0xb4')](_0x26d985[_0x2a8c('0x5e')]['to'][0x0])?undefined:_0x26d985['body']['to'][0x0],'AttachmentId':_0x26d985[_0x2a8c('0x5e')]['attachments'][0x0]['id']},client9002)['then'](function(_0x4ac2df){logger[_0x2a8c('0x24')](_0x2a8c('0xc1'),_0x4ac2df);})[_0x2a8c('0x2e')](function(_0x3facb4){logger[_0x2a8c('0x24')](_0x2a8c('0xc1'),_0x3facb4);});return _0x3587df;})['then'](respondWithResult(_0x596551,null))[_0x2a8c('0x2e')](handleError(_0x596551,null));};exports[_0x2a8c('0xc2')]=function(_0x11b004,_0xa59318,_0x4f327a){return db[_0x2a8c('0x45')]['find']({'where':{'id':_0x11b004[_0x2a8c('0x5a')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0xa59318,null))[_0x2a8c('0x23')](function(_0x9c57c3){if(_0x9c57c3){return _0x9c57c3[_0x2a8c('0xc2')](_0x11b004[_0x2a8c('0x5e')][_0x2a8c('0x6d')],_[_0x2a8c('0x74')](_0x11b004[_0x2a8c('0x5e')],[_0x2a8c('0x6d'),'id'])||{})['spread'](function(_0x5a4394){for(var _0x5c2059=0x0;_0x5c2059<_0x11b004['body']['ids'][_0x2a8c('0x4f')];_0x5c2059+=0x1){socket[_0x2a8c('0xc3')](_0x2a8c('0xc4'),{'UserId':Number(_0x11b004[_0x2a8c('0x5e')]['ids'][_0x5c2059]),'FaxAccountId':Number(_0x11b004[_0x2a8c('0x5a')]['id'])});}return _0x5a4394;});}})[_0x2a8c('0x23')](respondWithResult(_0xa59318,null))[_0x2a8c('0x2e')](handleError(_0xa59318,null));};exports[_0x2a8c('0xc5')]=function(_0x33ee08,_0x391c2b,_0x4fd9b4){return db[_0x2a8c('0x45')][_0x2a8c('0x5c')]({'where':{'id':_0x33ee08['params']['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x391c2b,null))[_0x2a8c('0x23')](function(_0x176f77){if(_0x176f77){return _0x176f77[_0x2a8c('0xc5')](_0x33ee08[_0x2a8c('0x49')][_0x2a8c('0x6d')])[_0x2a8c('0x23')](function(){if(_[_0x2a8c('0xc6')](_0x33ee08['query']['ids'])){for(var _0xe65015=0x0;_0xe65015<_0x33ee08['query'][_0x2a8c('0x6d')][_0x2a8c('0x4f')];_0xe65015+=0x1){socket['emit'](_0x2a8c('0xc7'),{'UserId':Number(_0x33ee08[_0x2a8c('0x49')][_0x2a8c('0x6d')][_0xe65015]),'FaxAccountId':Number(_0x33ee08['params']['id'])});}}else{socket[_0x2a8c('0xc3')](_0x2a8c('0xc7'),{'UserId':Number(_0x33ee08[_0x2a8c('0x49')][_0x2a8c('0x6d')]),'FaxAccountId':Number(_0x33ee08[_0x2a8c('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x391c2b,null))['catch'](handleError(_0x391c2b,null));};exports[_0x2a8c('0xc8')]=function(_0x4921ef,_0x5893a6,_0x5a459c){var _0xcc7efd={};var _0x43b046={};var _0x56fc5c;var _0x3ea048;return db['FaxAccount'][_0x2a8c('0x67')]({'where':{'id':_0x4921ef['params']['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x5893a6,null))['then'](function(_0x10bd30){if(_0x10bd30){_0x56fc5c=_0x10bd30;_0x43b046['model']=_[_0x2a8c('0x4a')](db[_0x2a8c('0x77')][_0x2a8c('0x46')]);_0x43b046[_0x2a8c('0x49')]=_[_0x2a8c('0x4a')](_0x4921ef['query']);_0x43b046['filters']=_[_0x2a8c('0x4c')](_0x43b046[_0x2a8c('0x48')],_0x43b046[_0x2a8c('0x49')]);_0xcc7efd[_0x2a8c('0x4e')]=_['intersection'](_0x43b046[_0x2a8c('0x48')],qs[_0x2a8c('0x4d')](_0x4921ef[_0x2a8c('0x49')]['fields']));_0xcc7efd['attributes']=_0xcc7efd[_0x2a8c('0x4e')][_0x2a8c('0x4f')]?_0xcc7efd['attributes']:_0x43b046['model'];_0xcc7efd[_0x2a8c('0x6a')]=qs[_0x2a8c('0x51')](_0x4921ef[_0x2a8c('0x49')][_0x2a8c('0x51')]);_0xcc7efd[_0x2a8c('0x52')]=qs[_0x2a8c('0x4b')](_[_0x2a8c('0x53')](_0x4921ef[_0x2a8c('0x49')],_0x43b046[_0x2a8c('0x4b')]));if(_0x4921ef[_0x2a8c('0x49')][_0x2a8c('0x54')]){_0xcc7efd['where']=_['merge'](_0xcc7efd[_0x2a8c('0x52')],{'$or':_[_0x2a8c('0x44')](_0xcc7efd[_0x2a8c('0x4e')],function(_0x11925e){var _0x41b81e={};_0x41b81e[_0x11925e]={'$like':'%'+_0x4921ef[_0x2a8c('0x49')][_0x2a8c('0x54')]+'%'};return _0x41b81e;})});}_0xcc7efd=_[_0x2a8c('0x55')]({},_0xcc7efd,_0x4921ef[_0x2a8c('0x6b')]);return _0x56fc5c['getAgents'](_0xcc7efd);}})['then'](function(_0x24f2fa){if(_0x24f2fa){_0x3ea048=_0x24f2fa['length'];if(!_0x4921ef[_0x2a8c('0x49')][_0x2a8c('0x50')]('nolimit')){_0xcc7efd['limit']=qs[_0x2a8c('0x34')](_0x4921ef[_0x2a8c('0x49')][_0x2a8c('0x34')]);_0xcc7efd[_0x2a8c('0x32')]=qs[_0x2a8c('0x32')](_0x4921ef[_0x2a8c('0x49')][_0x2a8c('0x32')]);}return _0x56fc5c[_0x2a8c('0xc8')](_0xcc7efd);}})['then'](function(_0x417f02){if(_0x417f02){return _0x417f02?{'count':_0x3ea048,'rows':_0x417f02}:null;}})[_0x2a8c('0x23')](respondWithResult(_0x5893a6,null))[_0x2a8c('0x2e')](handleError(_0x5893a6,null));}; \ No newline at end of file +var _0x9e70=['Tags','color','tag','FaxInteraction','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','maxrate','minrate','modem','t38timeout','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','addAccountApplications','VoiceExtension','updateAccountApplications','createdAt','updatedAt','TrunkId','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','attachments','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','defaults','ListId','Send\x20Fax\x20failed','out','Contact\x20not\x20found','spread','Messages','dataValues','SendFax','addAgents','userFaxAccount:save','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./faxAccount.socket','register','client','http','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','destroy','FaxAccounts','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','filter','options','where','includeAll','findAll','rows','params','rawAttributes','include','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','omit','getInteractions','CmContact','Contact','User','fullname','internal'];(function(_0x22f238,_0x64514e){var _0x370c2c=function(_0x280981){while(--_0x280981){_0x22f238['push'](_0x22f238['shift']());}};_0x370c2c(++_0x64514e);}(_0x9e70,0x10a));var _0x09e7=function(_0x5845d3,_0x2e2ca0){_0x5845d3=_0x5845d3-0x0;var _0x4d01ae=_0x9e70[_0x5845d3];return _0x4d01ae;};'use strict';var emlformat=require(_0x09e7('0x0'));var rimraf=require(_0x09e7('0x1'));var zipdir=require(_0x09e7('0x2'));var jsonpatch=require(_0x09e7('0x3'));var rp=require(_0x09e7('0x4'));var moment=require(_0x09e7('0x5'));var BPromise=require(_0x09e7('0x6'));var Mustache=require(_0x09e7('0x7'));var util=require(_0x09e7('0x8'));var path=require(_0x09e7('0x9'));var sox=require(_0x09e7('0xa'));var csv=require(_0x09e7('0xb'));var ejs=require(_0x09e7('0xc'));var fs=require('fs');var fs_extra=require(_0x09e7('0xd'));var _=require('lodash');var squel=require(_0x09e7('0xe'));var crypto=require(_0x09e7('0xf'));var jsforce=require(_0x09e7('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x09e7('0x11'));var Papa=require(_0x09e7('0x12'));var Redis=require(_0x09e7('0x13'));var authService=require(_0x09e7('0x14'));var qs=require(_0x09e7('0x15'));var as=require(_0x09e7('0x16'));var hardwareService=require(_0x09e7('0x17'));var logger=require('../../config/logger')(_0x09e7('0x18'));var utils=require(_0x09e7('0x19'));var config=require(_0x09e7('0x1a'));var licenseUtil=require(_0x09e7('0x1b'));var db=require(_0x09e7('0x1c'))['db'];config['redis']=_['defaults'](config[_0x09e7('0x1d')],{'host':_0x09e7('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x09e7('0x1d')]));require(_0x09e7('0x1f'))[_0x09e7('0x20')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x09e7('0x21')][_0x09e7('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x3ab0f0,_0x7536e3,_0xfc8fd1,_0x574c2a){return new BPromise(function(_0xa97f34,_0x6f657d){var _0x5352a5=_0x574c2a||client;return _0x5352a5['request'](_0x3ab0f0,_0xfc8fd1)[_0x09e7('0x23')](function(_0x367408){logger[_0x09e7('0x24')](_0x09e7('0x25'),_0x7536e3,'request\x20sent');logger[_0x09e7('0x26')](_0x09e7('0x27'),_0x7536e3,'request\x20sent',JSON[_0x09e7('0x28')](_0x367408));if(_0x367408[_0x09e7('0x29')]){if(_0x367408[_0x09e7('0x29')][_0x09e7('0x2a')]===0x1f4){logger[_0x09e7('0x29')](_0x09e7('0x25'),_0x7536e3,_0x367408[_0x09e7('0x29')][_0x09e7('0x2b')]);return _0x6f657d(_0x367408['error'][_0x09e7('0x2b')]);}logger['error'](_0x09e7('0x25'),_0x7536e3,_0x367408[_0x09e7('0x29')][_0x09e7('0x2b')]);return _0xa97f34(_0x367408[_0x09e7('0x29')][_0x09e7('0x2b')]);}else{logger[_0x09e7('0x24')](_0x09e7('0x25'),_0x7536e3,_0x09e7('0x2c'));_0xa97f34(_0x367408[_0x09e7('0x2d')][_0x09e7('0x2b')]);}})[_0x09e7('0x2e')](function(_0x43c558){logger['error'](_0x09e7('0x25'),_0x7536e3,_0x43c558);_0x6f657d(_0x43c558);});});}function respondWithStatusCode(_0x1b37ef,_0x5ea573){_0x5ea573=_0x5ea573||0xcc;return function(_0xb18c8b){if(_0xb18c8b){return _0x1b37ef['sendStatus'](_0x5ea573);}return _0x1b37ef[_0x09e7('0x2f')](_0x5ea573)[_0x09e7('0x30')]();};}function respondWithResult(_0x27479a,_0x5515eb){_0x5515eb=_0x5515eb||0xc8;return function(_0x356782){if(_0x356782){return _0x27479a[_0x09e7('0x2f')](_0x5515eb)[_0x09e7('0x31')](_0x356782);}};}function respondWithFilteredResult(_0x322eb6,_0x2259d5){return function(_0x413789){if(_0x413789){var _0x2ed0e7=typeof _0x2259d5['offset']===_0x09e7('0x32')&&typeof _0x2259d5[_0x09e7('0x33')]===_0x09e7('0x32');var _0x29175f=_0x413789[_0x09e7('0x34')];var _0x4e4bef=_0x2ed0e7?0x0:_0x2259d5[_0x09e7('0x35')];var _0x5937b0=_0x2ed0e7?_0x413789[_0x09e7('0x34')]:_0x2259d5[_0x09e7('0x35')]+_0x2259d5[_0x09e7('0x33')];var _0x99adae;if(_0x5937b0>=_0x29175f){_0x5937b0=_0x29175f;_0x99adae=0xc8;}else{_0x99adae=0xce;}_0x322eb6['status'](_0x99adae);return _0x322eb6[_0x09e7('0x36')](_0x09e7('0x37'),_0x4e4bef+'-'+_0x5937b0+'/'+_0x29175f)[_0x09e7('0x31')](_0x413789);}return null;};}function patchUpdates(_0x3a931e){return function(_0x7379e5){try{jsonpatch[_0x09e7('0x38')](_0x7379e5,_0x3a931e,!![]);}catch(_0xd291b1){return BPromise['reject'](_0xd291b1);}return _0x7379e5['save']();};}function saveUpdates(_0x5bf05b,_0x1a0e8c){return function(_0xe078cc){if(_0xe078cc){return _0xe078cc['update'](_0x5bf05b)[_0x09e7('0x23')](function(_0x5dcb40){return _0x5dcb40;});}return null;};}function removeEntity(_0x4407b2,_0x2dfc64){return function(_0x4db1be){if(_0x4db1be){return _0x4db1be[_0x09e7('0x39')]()[_0x09e7('0x23')](function(){var _0x46f880=_0x4db1be['get']({'plain':!![]});var _0x413e77=_0x09e7('0x3a');return db['UserProfileResource'][_0x09e7('0x39')]({'where':{'type':_0x413e77,'resourceId':_0x46f880['id']}})[_0x09e7('0x23')](function(){return _0x4db1be;});})[_0x09e7('0x23')](function(){_0x4407b2[_0x09e7('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b8464,_0x252fdc){return function(_0x8364dd){if(!_0x8364dd){_0x5b8464[_0x09e7('0x3b')](0x194);}return _0x8364dd;};}function handleError(_0x34c0d2,_0x20aa94){_0x20aa94=_0x20aa94||0x1f4;return function(_0xc4c4b3){logger[_0x09e7('0x29')](_0xc4c4b3[_0x09e7('0x3c')]);if(_0xc4c4b3[_0x09e7('0x3d')]){delete _0xc4c4b3[_0x09e7('0x3d')];}_0x34c0d2['status'](_0x20aa94)[_0x09e7('0x3e')](_0xc4c4b3);};}exports[_0x09e7('0x3f')]=function(_0x41a1b8,_0x1ca8ed){var _0x22af0a={'include':[{'model':db[_0x09e7('0x40')],'as':_0x09e7('0x41')}]},_0x153801={},_0x577cb2={'count':0x0,'rows':[]};var _0x194fa7=_[_0x09e7('0x42')](db[_0x09e7('0x43')]['rawAttributes'],function(_0x5bc0b7){return{'name':_0x5bc0b7['fieldName'],'type':_0x5bc0b7[_0x09e7('0x44')]['key']};});_0x153801[_0x09e7('0x45')]=_[_0x09e7('0x42')](_0x194fa7,_0x09e7('0x3d'));_0x153801[_0x09e7('0x46')]=_[_0x09e7('0x47')](_0x41a1b8[_0x09e7('0x46')]);_0x153801[_0x09e7('0x48')]=_[_0x09e7('0x49')](_0x153801[_0x09e7('0x45')],_0x153801['query']);_0x22af0a[_0x09e7('0x4a')]=_[_0x09e7('0x49')](_0x153801[_0x09e7('0x45')],qs[_0x09e7('0x4b')](_0x41a1b8[_0x09e7('0x46')]['fields']));_0x22af0a[_0x09e7('0x4a')]=_0x22af0a[_0x09e7('0x4a')][_0x09e7('0x4c')]?_0x22af0a[_0x09e7('0x4a')]:_0x153801['model'];if(!_0x41a1b8[_0x09e7('0x46')][_0x09e7('0x4d')]('nolimit')){_0x22af0a['limit']=qs[_0x09e7('0x33')](_0x41a1b8[_0x09e7('0x46')]['limit']);_0x22af0a[_0x09e7('0x35')]=qs[_0x09e7('0x35')](_0x41a1b8[_0x09e7('0x46')][_0x09e7('0x35')]);}_0x22af0a[_0x09e7('0x4e')]=qs[_0x09e7('0x4f')](_0x41a1b8['query'][_0x09e7('0x4f')]);_0x22af0a['where']=qs[_0x09e7('0x48')](_[_0x09e7('0x50')](_0x41a1b8[_0x09e7('0x46')],_0x153801[_0x09e7('0x48')]),_0x194fa7);if(_0x41a1b8[_0x09e7('0x46')]['filter']){_0x22af0a['where']=_[_0x09e7('0x51')](_0x22af0a['where'],{'$or':_[_0x09e7('0x42')](_0x194fa7,function(_0x27cf18){if(_0x27cf18[_0x09e7('0x44')]!=='VIRTUAL'){var _0x1da447={};_0x1da447[_0x27cf18[_0x09e7('0x3d')]]={'$like':'%'+_0x41a1b8[_0x09e7('0x46')][_0x09e7('0x52')]+'%'};return _0x1da447;}})});}_0x22af0a=_[_0x09e7('0x51')]({},_0x22af0a,_0x41a1b8[_0x09e7('0x53')]);var _0x12a69={'where':_0x22af0a[_0x09e7('0x54')]};return db[_0x09e7('0x43')]['count'](_0x12a69)[_0x09e7('0x23')](function(_0x845c4e){_0x577cb2['count']=_0x845c4e;if(_0x41a1b8['query'][_0x09e7('0x55')]){_0x22af0a['include']=[{'all':!![]}];}return db['FaxAccount'][_0x09e7('0x56')](_0x22af0a);})[_0x09e7('0x23')](function(_0x55a3cc){_0x577cb2[_0x09e7('0x57')]=_0x55a3cc;return _0x577cb2;})[_0x09e7('0x23')](respondWithFilteredResult(_0x1ca8ed,_0x22af0a))[_0x09e7('0x2e')](handleError(_0x1ca8ed,null));};exports['show']=function(_0x500434,_0x363b22){var _0x53bfea={'raw':![],'where':{'id':_0x500434[_0x09e7('0x58')]['id']},'include':[{'model':db[_0x09e7('0x40')],'as':'mandatoryDispositionPause'}]},_0x24832c={};_0x24832c[_0x09e7('0x45')]=_['keys'](db[_0x09e7('0x43')][_0x09e7('0x59')]);_0x24832c[_0x09e7('0x46')]=_[_0x09e7('0x47')](_0x500434['query']);_0x24832c[_0x09e7('0x48')]=_['intersection'](_0x24832c[_0x09e7('0x45')],_0x24832c[_0x09e7('0x46')]);_0x53bfea['attributes']=_[_0x09e7('0x49')](_0x24832c[_0x09e7('0x45')],qs[_0x09e7('0x4b')](_0x500434[_0x09e7('0x46')][_0x09e7('0x4b')]));_0x53bfea[_0x09e7('0x4a')]=_0x53bfea[_0x09e7('0x4a')][_0x09e7('0x4c')]?_0x53bfea[_0x09e7('0x4a')]:_0x24832c[_0x09e7('0x45')];if(_0x500434[_0x09e7('0x46')][_0x09e7('0x55')]){_0x53bfea[_0x09e7('0x5a')]=[{'all':!![]}];}_0x53bfea=_[_0x09e7('0x51')]({},_0x53bfea,_0x500434[_0x09e7('0x53')]);return db['FaxAccount'][_0x09e7('0x5b')](_0x53bfea)[_0x09e7('0x23')](handleEntityNotFound(_0x363b22,null))[_0x09e7('0x23')](respondWithResult(_0x363b22,null))[_0x09e7('0x2e')](handleError(_0x363b22,null));};exports[_0x09e7('0x5c')]=function(_0x3540bd,_0x3fe194){return db[_0x09e7('0x43')][_0x09e7('0x5c')](_0x3540bd[_0x09e7('0x5d')],{})[_0x09e7('0x23')](function(_0x176809){var _0x574582=_0x3540bd[_0x09e7('0x5e')][_0x09e7('0x5f')]({'plain':!![]});if(!_0x574582)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x574582[_0x09e7('0x60')]==='user'){var _0x24e21f=_0x176809['get']({'plain':!![]});var _0x12cb63=_0x09e7('0x3a');return db[_0x09e7('0x61')][_0x09e7('0x5b')]({'where':{'name':_0x12cb63,'userProfileId':_0x574582[_0x09e7('0x62')]},'raw':!![]})[_0x09e7('0x23')](function(_0x5390fb){if(_0x5390fb&&_0x5390fb[_0x09e7('0x63')]===0x0){return db[_0x09e7('0x64')]['create']({'name':_0x24e21f[_0x09e7('0x3d')],'resourceId':_0x24e21f['id'],'type':_0x5390fb[_0x09e7('0x3d')],'sectionId':_0x5390fb['id']},{})['then'](function(){return _0x176809;});}else{return _0x176809;}})['catch'](function(_0x277b23){logger[_0x09e7('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x277b23);throw _0x277b23;});}return _0x176809;})[_0x09e7('0x23')](respondWithResult(_0x3fe194,0xc9))[_0x09e7('0x2e')](handleError(_0x3fe194,null));};exports['update']=function(_0x4c2846,_0x1a7763){if(_0x4c2846['body']['id']){delete _0x4c2846[_0x09e7('0x5d')]['id'];}return db[_0x09e7('0x43')][_0x09e7('0x5b')]({'where':{'id':_0x4c2846[_0x09e7('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x09e7('0x41')}]})[_0x09e7('0x23')](handleEntityNotFound(_0x1a7763,null))[_0x09e7('0x23')](saveUpdates(_0x4c2846['body'],null))[_0x09e7('0x23')](respondWithResult(_0x1a7763,null))[_0x09e7('0x2e')](handleError(_0x1a7763,null));};exports[_0x09e7('0x39')]=function(_0x551aa3,_0x3131a5){return db['FaxAccount'][_0x09e7('0x5b')]({'where':{'id':_0x551aa3[_0x09e7('0x58')]['id']}})[_0x09e7('0x23')](handleEntityNotFound(_0x3131a5,null))[_0x09e7('0x23')](removeEntity(_0x3131a5,null))[_0x09e7('0x2e')](handleError(_0x3131a5,null));};exports[_0x09e7('0x65')]=function(_0x583c4c,_0x1749ad){return db[_0x09e7('0x43')][_0x09e7('0x65')]()[_0x09e7('0x23')](respondWithResult(_0x1749ad,null))[_0x09e7('0x2e')](handleError(_0x1749ad,null));};exports[_0x09e7('0x66')]=function(_0xcf8b15,_0x356cf9,_0x4ac4bb){if(_0xcf8b15[_0x09e7('0x5d')]['id']){delete _0xcf8b15[_0x09e7('0x5d')]['id'];}return db[_0x09e7('0x43')][_0x09e7('0x5b')]({'where':{'id':_0xcf8b15[_0x09e7('0x58')]['id']}})['then'](handleEntityNotFound(_0x356cf9,null))[_0x09e7('0x23')](function(_0x312b89){if(_0x312b89){_0xcf8b15[_0x09e7('0x5d')][_0x09e7('0x67')]=_0x312b89['id'];return db[_0x09e7('0x68')]['create'](_0xcf8b15[_0x09e7('0x5d')]);}})[_0x09e7('0x23')](respondWithResult(_0x356cf9,null))['catch'](handleError(_0x356cf9,null));};exports[_0x09e7('0x69')]=function(_0x5ac31f,_0x2b5d80,_0x363de8){var _0x4223ca={'raw':![],'where':{}};var _0x23c079={};var _0x3e1743={'count':0x0,'rows':[]};return db[_0x09e7('0x43')][_0x09e7('0x6a')]({'where':{'id':_0x5ac31f[_0x09e7('0x58')]['id']}})[_0x09e7('0x23')](handleEntityNotFound(_0x2b5d80,null))[_0x09e7('0x23')](function(_0x2d953e){if(_0x2d953e){_0x23c079[_0x09e7('0x45')]=_[_0x09e7('0x47')](db[_0x09e7('0x68')][_0x09e7('0x59')]);_0x23c079['query']=_['keys'](_0x5ac31f['query']);_0x23c079[_0x09e7('0x48')]=_[_0x09e7('0x49')](_0x23c079['model'],_0x23c079['query']);_0x4223ca[_0x09e7('0x4a')]=_[_0x09e7('0x49')](_0x23c079[_0x09e7('0x45')],qs[_0x09e7('0x4b')](_0x5ac31f[_0x09e7('0x46')][_0x09e7('0x4b')]));_0x4223ca['attributes']=_0x4223ca[_0x09e7('0x4a')][_0x09e7('0x4c')]?_0x4223ca[_0x09e7('0x4a')]:_0x23c079['model'];if(!_0x5ac31f['query']['hasOwnProperty'](_0x09e7('0x6b'))){_0x4223ca[_0x09e7('0x33')]=qs['limit'](_0x5ac31f['query']['limit']);_0x4223ca[_0x09e7('0x35')]=qs[_0x09e7('0x35')](_0x5ac31f[_0x09e7('0x46')]['offset']);}_0x4223ca[_0x09e7('0x4e')]=qs['sort'](_0x5ac31f[_0x09e7('0x46')]['sort']);_0x4223ca[_0x09e7('0x54')]=qs[_0x09e7('0x48')](_[_0x09e7('0x50')](_0x5ac31f[_0x09e7('0x46')],_0x23c079[_0x09e7('0x48')]));_0x4223ca[_0x09e7('0x54')][_0x09e7('0x67')]=_0x2d953e['id'];if(_0x5ac31f[_0x09e7('0x46')][_0x09e7('0x52')]){_0x4223ca[_0x09e7('0x54')]=_[_0x09e7('0x51')](_0x4223ca[_0x09e7('0x54')],{'$or':_[_0x09e7('0x42')](_0x4223ca[_0x09e7('0x4a')],function(_0x53ad47){var _0x3e4216={};_0x3e4216[_0x53ad47]={'$like':'%'+_0x5ac31f[_0x09e7('0x46')][_0x09e7('0x52')]+'%'};return _0x3e4216;})});}_0x4223ca=_[_0x09e7('0x51')]({},_0x4223ca,_0x5ac31f['options']);return db[_0x09e7('0x68')][_0x09e7('0x34')]({'where':_0x4223ca['where']})[_0x09e7('0x23')](function(_0x2e6972){_0x3e1743[_0x09e7('0x34')]=_0x2e6972;if(_0x5ac31f[_0x09e7('0x46')][_0x09e7('0x55')]){_0x4223ca[_0x09e7('0x5a')]=[{'all':!![]}];}return db['Disposition'][_0x09e7('0x56')](_0x4223ca);})[_0x09e7('0x23')](function(_0xbf335b){_0x3e1743[_0x09e7('0x57')]=_0xbf335b;return _0x3e1743;});}})[_0x09e7('0x23')](respondWithFilteredResult(_0x2b5d80,_0x4223ca))['catch'](handleError(_0x2b5d80,null));};exports[_0x09e7('0x6c')]=function(_0x3432fa,_0x55b5bc,_0x51940e){return db[_0x09e7('0x43')]['find']({'where':{'id':_0x3432fa[_0x09e7('0x58')]['id']}})[_0x09e7('0x23')](handleEntityNotFound(_0x55b5bc,null))[_0x09e7('0x23')](function(_0x44f825){if(_0x44f825){return _0x44f825[_0x09e7('0x6c')](_0x3432fa[_0x09e7('0x46')][_0x09e7('0x6d')]);}})[_0x09e7('0x23')](respondWithStatusCode(_0x55b5bc,null))['catch'](handleError(_0x55b5bc,null));};exports[_0x09e7('0x6e')]=function(_0x24d985,_0x4ce1a9,_0x1b3e3b){if(_0x24d985['body']['id']){delete _0x24d985[_0x09e7('0x5d')]['id'];}return db[_0x09e7('0x43')][_0x09e7('0x5b')]({'where':{'id':_0x24d985['params']['id']}})['then'](handleEntityNotFound(_0x4ce1a9,null))[_0x09e7('0x23')](function(_0x9e3e9c){if(_0x9e3e9c){_0x24d985[_0x09e7('0x5d')][_0x09e7('0x67')]=_0x9e3e9c['id'];return db[_0x09e7('0x6f')][_0x09e7('0x5c')](_0x24d985['body']);}})[_0x09e7('0x23')](respondWithResult(_0x4ce1a9,null))[_0x09e7('0x2e')](handleError(_0x4ce1a9,null));};exports['getAnswers']=function(_0x55522a,_0xe52f20,_0x409ca4){var _0x31e581={'raw':![],'where':{}};var _0x2afc6e={};var _0x3a8461={'count':0x0,'rows':[]};return db[_0x09e7('0x43')]['findOne']({'where':{'id':_0x55522a[_0x09e7('0x58')]['id']}})['then'](handleEntityNotFound(_0xe52f20,null))[_0x09e7('0x23')](function(_0xb69b54){if(_0xb69b54){_0x2afc6e[_0x09e7('0x45')]=_[_0x09e7('0x47')](db[_0x09e7('0x6f')]['rawAttributes']);_0x2afc6e[_0x09e7('0x46')]=_[_0x09e7('0x47')](_0x55522a[_0x09e7('0x46')]);_0x2afc6e[_0x09e7('0x48')]=_[_0x09e7('0x49')](_0x2afc6e[_0x09e7('0x45')],_0x2afc6e[_0x09e7('0x46')]);_0x31e581[_0x09e7('0x4a')]=_[_0x09e7('0x49')](_0x2afc6e[_0x09e7('0x45')],qs[_0x09e7('0x4b')](_0x55522a['query'][_0x09e7('0x4b')]));_0x31e581[_0x09e7('0x4a')]=_0x31e581[_0x09e7('0x4a')]['length']?_0x31e581[_0x09e7('0x4a')]:_0x2afc6e[_0x09e7('0x45')];if(!_0x55522a['query']['hasOwnProperty'](_0x09e7('0x6b'))){_0x31e581[_0x09e7('0x33')]=qs['limit'](_0x55522a['query']['limit']);_0x31e581[_0x09e7('0x35')]=qs['offset'](_0x55522a[_0x09e7('0x46')]['offset']);}_0x31e581[_0x09e7('0x4e')]=qs['sort'](_0x55522a[_0x09e7('0x46')][_0x09e7('0x4f')]);_0x31e581[_0x09e7('0x54')]=qs['filters'](_[_0x09e7('0x50')](_0x55522a[_0x09e7('0x46')],_0x2afc6e[_0x09e7('0x48')]));_0x31e581[_0x09e7('0x54')][_0x09e7('0x67')]=_0xb69b54['id'];if(_0x55522a['query'][_0x09e7('0x52')]){_0x31e581[_0x09e7('0x54')]=_[_0x09e7('0x51')](_0x31e581[_0x09e7('0x54')],{'$or':_['map'](_0x31e581[_0x09e7('0x4a')],function(_0x42525f){var _0x1cc50b={};_0x1cc50b[_0x42525f]={'$like':'%'+_0x55522a[_0x09e7('0x46')][_0x09e7('0x52')]+'%'};return _0x1cc50b;})});}_0x31e581=_[_0x09e7('0x51')]({},_0x31e581,_0x55522a[_0x09e7('0x53')]);return db['CannedAnswer'][_0x09e7('0x34')]({'where':_0x31e581[_0x09e7('0x54')]})[_0x09e7('0x23')](function(_0x14ef40){_0x3a8461[_0x09e7('0x34')]=_0x14ef40;if(_0x55522a[_0x09e7('0x46')]['includeAll']){_0x31e581[_0x09e7('0x5a')]=[{'all':!![]}];}return db[_0x09e7('0x6f')]['findAll'](_0x31e581);})[_0x09e7('0x23')](function(_0xa3bb3a){_0x3a8461[_0x09e7('0x57')]=_0xa3bb3a;return _0x3a8461;});}})[_0x09e7('0x23')](respondWithFilteredResult(_0xe52f20,_0x31e581))[_0x09e7('0x2e')](handleError(_0xe52f20,null));};exports[_0x09e7('0x70')]=function(_0x15df75,_0x474228,_0x1df4fe){return db[_0x09e7('0x43')]['find']({'where':{'id':_0x15df75['params']['id']}})[_0x09e7('0x23')](handleEntityNotFound(_0x474228,null))[_0x09e7('0x23')](function(_0x18bd71){if(_0x18bd71){return _0x18bd71[_0x09e7('0x70')](_0x15df75[_0x09e7('0x46')][_0x09e7('0x6d')]);}})[_0x09e7('0x23')](respondWithStatusCode(_0x474228,null))[_0x09e7('0x2e')](handleError(_0x474228,null));};exports['addInteraction']=function(_0xab2893,_0x116348,_0x1a1d46){return db['FaxInteraction']['find']({'where':{'id':_0xab2893[_0x09e7('0x58')]['id']}})['then'](handleEntityNotFound(_0x116348,null))[_0x09e7('0x23')](function(_0x16bdad){if(_0x16bdad){return _0x16bdad['addInteraction'](_0xab2893[_0x09e7('0x5d')]['ids'],_[_0x09e7('0x71')](_0xab2893[_0x09e7('0x5d')],['ids','id'])||{});}})[_0x09e7('0x23')](respondWithResult(_0x116348,null))[_0x09e7('0x2e')](handleError(_0x116348,null));};exports[_0x09e7('0x72')]=function(_0x44c015,_0x468fdf,_0x693d8e){var _0x59c359={'raw':![],'where':{}};var _0x201491={};var _0x1a6660={'count':0x0,'rows':[]};return db[_0x09e7('0x43')][_0x09e7('0x6a')]({'where':{'id':_0x44c015[_0x09e7('0x58')]['id']}})[_0x09e7('0x23')](handleEntityNotFound(_0x468fdf,null))['then'](function(_0x289e4b){if(_0x289e4b){_0x201491[_0x09e7('0x45')]=_[_0x09e7('0x47')](db['FaxInteraction'][_0x09e7('0x59')]);_0x201491[_0x09e7('0x46')]=_[_0x09e7('0x47')](_0x44c015[_0x09e7('0x46')]);_0x201491['filters']=_[_0x09e7('0x49')](_0x201491[_0x09e7('0x45')],_0x201491['query']);_0x59c359[_0x09e7('0x4a')]=_[_0x09e7('0x49')](_0x201491[_0x09e7('0x45')],qs[_0x09e7('0x4b')](_0x44c015['query'][_0x09e7('0x4b')]));_0x59c359[_0x09e7('0x4a')]=_0x59c359[_0x09e7('0x4a')][_0x09e7('0x4c')]?_0x59c359[_0x09e7('0x4a')]:_0x201491[_0x09e7('0x45')];if(!_0x44c015[_0x09e7('0x46')][_0x09e7('0x4d')]('nolimit')){_0x59c359[_0x09e7('0x33')]=qs[_0x09e7('0x33')](_0x44c015[_0x09e7('0x46')][_0x09e7('0x33')]);_0x59c359[_0x09e7('0x35')]=qs['offset'](_0x44c015[_0x09e7('0x46')]['offset']);}_0x59c359[_0x09e7('0x4e')]=qs['sort'](_0x44c015[_0x09e7('0x46')][_0x09e7('0x4f')]);_0x59c359[_0x09e7('0x54')]=qs[_0x09e7('0x48')](_['pick'](_0x44c015[_0x09e7('0x46')],_0x201491[_0x09e7('0x48')]));_0x59c359[_0x09e7('0x54')][_0x09e7('0x67')]=_0x289e4b['id'];if(_0x44c015[_0x09e7('0x46')][_0x09e7('0x52')]){_0x59c359[_0x09e7('0x54')]=_[_0x09e7('0x51')](_0x59c359[_0x09e7('0x54')],{'$or':_['map'](_0x59c359[_0x09e7('0x4a')],function(_0x22e257){var _0x36740d={};_0x36740d[_0x22e257]={'$like':'%'+_0x44c015['query'][_0x09e7('0x52')]+'%'};return _0x36740d;})});}_0x59c359=_[_0x09e7('0x51')]({},_0x59c359,_0x44c015[_0x09e7('0x53')]);return db['FaxInteraction'][_0x09e7('0x34')]({'where':_0x59c359['where']})[_0x09e7('0x23')](function(_0x19013a){_0x1a6660['count']=_0x19013a;if(_0x44c015['query'][_0x09e7('0x55')]){_0x59c359['include']=[{'model':db[_0x09e7('0x73')],'as':_0x09e7('0x74'),'required':![]},{'model':db[_0x09e7('0x75')],'as':'Owner','attributes':[_0x09e7('0x3d'),_0x09e7('0x76'),_0x09e7('0x77')],'required':![]},{'model':db['Tag'],'as':_0x09e7('0x78'),'attributes':['id',_0x09e7('0x3d'),_0x09e7('0x79')],'where':_0x44c015[_0x09e7('0x46')][_0x09e7('0x7a')]?{'id':_0x44c015['query']['tag']}:undefined,'required':_0x44c015[_0x09e7('0x46')][_0x09e7('0x7a')]?!![]:![]}];}return db[_0x09e7('0x7b')][_0x09e7('0x56')](_0x59c359);})[_0x09e7('0x23')](function(_0x372633){_0x1a6660['rows']=_0x372633;return _0x1a6660;});}})[_0x09e7('0x23')](respondWithFilteredResult(_0x468fdf,_0x59c359))[_0x09e7('0x2e')](handleError(_0x468fdf,null));};exports[_0x09e7('0x7c')]=function(_0x29e885,_0x108bb6){var _0x107df2=_0x29e885[_0x09e7('0x58')]['id'];var _0x4a9dda=_0x29e885[_0x09e7('0x5d')];var _0x49a9cd=0xc8;var _0x732e4f=null;return db[_0x09e7('0x7d')][_0x09e7('0x7e')]({'isolationLevel':db[_0x09e7('0x7d')][_0x09e7('0x7f')][_0x09e7('0x80')]['READ_COMMITTED']},function(_0x401f37){return db[_0x09e7('0x43')]['findOne']({'where':{'id':_0x107df2},'transaction':_0x401f37})[_0x09e7('0x23')](function(_0x2090b4){if(_0x2090b4){return db[_0x09e7('0x81')][_0x09e7('0x39')]({'where':{'FaxAccountId':_0x107df2},'transaction':_0x401f37})[_0x09e7('0x23')](function(){var _0x4a866f=_['map'](_0x4a9dda,function(_0x27c89d){_0x27c89d[_0x09e7('0x67')]=_0x107df2;return _0x27c89d;});return db[_0x09e7('0x81')][_0x09e7('0x82')](_0x4a866f,{'transaction':_0x401f37});});}else{_0x49a9cd=0x194;_0x732e4f=[];}});})[_0x09e7('0x23')](function(){if(_0x49a9cd!==0x194){return db['FaxApplication'][_0x09e7('0x83')]({'where':{'FaxAccountId':_0x107df2},'order':_0x09e7('0x84')})[_0x09e7('0x23')](function(_0x20e13e){_0x732e4f=_0x20e13e;});}})['catch'](function(_0x1f8c20){_0x49a9cd=0x1f4;logger[_0x09e7('0x29')](_0x1f8c20[_0x09e7('0x3c')]);if(_0x1f8c20[_0x09e7('0x3d')]){delete _0x1f8c20[_0x09e7('0x3d')];}_0x732e4f=_0x1f8c20;})[_0x09e7('0x85')](function(){if(_0x732e4f===null){_0x108bb6[_0x09e7('0x3b')](_0x49a9cd);}else{if(_0x49a9cd===0x1f4){_0x108bb6[_0x09e7('0x2f')](_0x49a9cd)['send'](_0x732e4f);}else{_0x108bb6[_0x09e7('0x2f')](_0x49a9cd)['json'](_0x732e4f);}}});};exports[_0x09e7('0x86')]=function(_0x2ddfb3,_0x38856c,_0x2a51b5){var _0x46d861={};var _0xc9e1f7={};var _0xd3e6a9;var _0x317cda;return db[_0x09e7('0x43')][_0x09e7('0x6a')]({'where':{'id':_0x2ddfb3['params']['id']}})[_0x09e7('0x23')](handleEntityNotFound(_0x38856c,null))['then'](function(_0x5124eb){if(_0x5124eb){_0xd3e6a9=_0x5124eb;_0xc9e1f7[_0x09e7('0x45')]=_['keys'](db[_0x09e7('0x81')][_0x09e7('0x59')]);_0xc9e1f7[_0x09e7('0x46')]=_[_0x09e7('0x47')](_0x2ddfb3[_0x09e7('0x46')]);_0xc9e1f7['filters']=_[_0x09e7('0x49')](_0xc9e1f7[_0x09e7('0x45')],_0xc9e1f7['query']);_0x46d861[_0x09e7('0x4a')]=_['intersection'](_0xc9e1f7[_0x09e7('0x45')],qs[_0x09e7('0x4b')](_0x2ddfb3[_0x09e7('0x46')][_0x09e7('0x4b')]));_0x46d861[_0x09e7('0x4a')]=_0x46d861[_0x09e7('0x4a')]['length']?_0x46d861[_0x09e7('0x4a')]:_0xc9e1f7['model'];_0x46d861['order']=qs[_0x09e7('0x4f')](_0x2ddfb3[_0x09e7('0x46')]['sort']);_0x46d861['where']=qs['filters'](_[_0x09e7('0x50')](_0x2ddfb3[_0x09e7('0x46')],_0xc9e1f7[_0x09e7('0x48')]));if(_0x2ddfb3[_0x09e7('0x46')][_0x09e7('0x52')]){_0x46d861[_0x09e7('0x54')]=_['merge'](_0x46d861[_0x09e7('0x54')],{'$or':_['map'](_0x46d861[_0x09e7('0x4a')],function(_0x446c0e){var _0x4b298b={};_0x4b298b[_0x446c0e]={'$like':'%'+_0x2ddfb3[_0x09e7('0x46')][_0x09e7('0x52')]+'%'};return _0x4b298b;})});}_0x46d861=_[_0x09e7('0x51')]({},_0x46d861,_0x2ddfb3[_0x09e7('0x53')]);return _0xd3e6a9[_0x09e7('0x86')](_0x46d861);}})['then'](function(_0x1e2237){if(_0x1e2237){_0x317cda=_0x1e2237[_0x09e7('0x4c')];if(!_0x2ddfb3[_0x09e7('0x46')][_0x09e7('0x4d')]('nolimit')){_0x46d861[_0x09e7('0x33')]=qs[_0x09e7('0x33')](_0x2ddfb3['query'][_0x09e7('0x33')]);_0x46d861[_0x09e7('0x35')]=qs['offset'](_0x2ddfb3[_0x09e7('0x46')][_0x09e7('0x35')]);}return _0xd3e6a9[_0x09e7('0x86')](_0x46d861);}})['then'](function(_0x5596f0){if(_0x5596f0){return _0x5596f0?{'count':_0x317cda,'rows':_0x5596f0}:null;}})[_0x09e7('0x23')](respondWithResult(_0x38856c,null))[_0x09e7('0x2e')](handleError(_0x38856c,null));};function Extension(_0x5e8ef2,_0xfcd6ef,_0x4e7c44,_0x434c07){this[_0x09e7('0x87')]=_0x09e7('0x88');this[_0x09e7('0x89')]=_0x5e8ef2[_0x09e7('0x8a')];this[_0x09e7('0x8b')]=_0x434c07;this[_0x09e7('0x44')]=_0x09e7('0x8c');this['description']=_0x09e7('0x8d');this['FaxAccountId']=_0x5e8ef2['id'];this['priority']=_0xfcd6ef;this[_0x09e7('0x8e')]=_0x4e7c44;}function createExtensionsReciveFax(_0x822dc1){var _0x753d62=0x1;var _0x2107bf=[];_0x2107bf[_0x09e7('0x8f')](new Extension(_0x822dc1,_0x753d62,'',_0x09e7('0x90')));_0x753d62+=0x1;_0x2107bf[_0x09e7('0x8f')](new Extension(_0x822dc1,_0x753d62,_0x09e7('0x91'),_0x09e7('0x92')));_0x753d62+=0x1;for(var _0x45f820 in _0x822dc1){if(_0x822dc1[_0x09e7('0x4d')](_0x45f820)&&(_0x45f820===_0x09e7('0x93')||_0x45f820===_0x09e7('0x8a')||_0x45f820===_0x09e7('0x94')||_0x45f820==='faxdetect'||_0x45f820==='headerinfo'||_0x45f820===_0x09e7('0x95')||_0x45f820===_0x09e7('0x96')||_0x45f820===_0x09e7('0x97')||_0x45f820===_0x09e7('0x98'))){_0x2107bf[_0x09e7('0x8f')](new Extension(_0x822dc1,_0x753d62,_0x09e7('0x99')+_0x45f820+')='+_0x822dc1[_0x45f820],_0x09e7('0x92')));_0x753d62+=0x1;}}_0x2107bf['push'](new Extension(_0x822dc1,_0x753d62,'6',_0x09e7('0x9a')));_0x753d62+=0x1;_0x2107bf[_0x09e7('0x8f')](new Extension(_0x822dc1,_0x753d62,_0x09e7('0x9b'),'ReceiveFax'));_0x753d62=0x0;return _0x2107bf;}exports[_0x09e7('0x9c')]=function(_0x54e778,_0x309aac,_0x355a55){var _0x26c4e9;return db[_0x09e7('0x7d')][_0x09e7('0x7e')](function(_0x2e69ae){return db[_0x09e7('0x43')][_0x09e7('0x5c')](_0x54e778[_0x09e7('0x5d')],{'transaction':_0x2e69ae})[_0x09e7('0x23')](function(_0x6e0cfc){_0x26c4e9=_0x6e0cfc[_0x09e7('0x5f')]({'plain':!![]});return db[_0x09e7('0x9d')]['bulkCreate'](createExtensionsReciveFax(_0x26c4e9),{'transaction':_0x2e69ae});});})[_0x09e7('0x23')](function(){return _0x26c4e9;})['then'](respondWithResult(_0x309aac,null))[_0x09e7('0x2e')](handleError(_0x309aac,null));};exports[_0x09e7('0x9e')]=function(_0x169fac,_0x311b66,_0x1caeaa){var _0x45c16b;return db[_0x09e7('0x7d')][_0x09e7('0x7e')](function(_0x5d4257){return db[_0x09e7('0x43')]['update'](_0x169fac[_0x09e7('0x5d')],{'where':{'id':_0x169fac['body']['id']},'transaction':_0x5d4257})[_0x09e7('0x23')](function(_0x5094b6){return db[_0x09e7('0x9d')][_0x09e7('0x39')]({'where':{'FaxAccountId':_0x169fac[_0x09e7('0x5d')]['id']},'transaction':_0x5d4257})['then'](function(_0x1bf067){return db['VoiceExtension'][_0x09e7('0x82')](createExtensionsReciveFax(_[_0x09e7('0x71')](_0x169fac[_0x09e7('0x5d')],['tech','key',_0x09e7('0x9f'),_0x09e7('0xa0'),_0x09e7('0xa1'),'ListId'])),{'transaction':_0x5d4257});});});})[_0x09e7('0x23')](function(){return db['FaxAccount']['findById'](_0x169fac[_0x09e7('0x5d')]['id']);})[_0x09e7('0x23')](respondWithResult(_0x311b66,null))['catch'](handleError(_0x311b66,null));};exports[_0x09e7('0xa2')]=function(_0x1adb56,_0x3b2334,_0x30dafc){var _0xee9f5b={'raw':!![],'where':{}};var _0x2acf5e={};var _0xf7763d={'count':0x0,'rows':[]};return db[_0x09e7('0x43')]['findOne']({'where':{'id':_0x1adb56[_0x09e7('0x58')]['id']}})[_0x09e7('0x23')](handleEntityNotFound(_0x3b2334,null))[_0x09e7('0x23')](function(_0x5d038c){if(_0x5d038c){_0x2acf5e[_0x09e7('0x45')]=_['keys'](db[_0x09e7('0xa3')][_0x09e7('0x59')]);_0x2acf5e['query']=_[_0x09e7('0x47')](_0x1adb56[_0x09e7('0x46')]);_0x2acf5e[_0x09e7('0x48')]=_[_0x09e7('0x49')](_0x2acf5e[_0x09e7('0x45')],_0x2acf5e[_0x09e7('0x46')]);_0xee9f5b[_0x09e7('0x4a')]=_[_0x09e7('0x49')](_0x2acf5e[_0x09e7('0x45')],qs['fields'](_0x1adb56[_0x09e7('0x46')][_0x09e7('0x4b')]));_0xee9f5b[_0x09e7('0x4a')]=_0xee9f5b['attributes'][_0x09e7('0x4c')]?_0xee9f5b['attributes']:_0x2acf5e['model'];if(!_0x1adb56[_0x09e7('0x46')]['hasOwnProperty'](_0x09e7('0x6b'))){_0xee9f5b[_0x09e7('0x33')]=qs[_0x09e7('0x33')](_0x1adb56[_0x09e7('0x46')]['limit']);_0xee9f5b['offset']=qs[_0x09e7('0x35')](_0x1adb56['query']['offset']);}_0xee9f5b[_0x09e7('0x4e')]=qs[_0x09e7('0x4f')](_0x1adb56['query'][_0x09e7('0x4f')]);_0xee9f5b[_0x09e7('0x54')]=qs[_0x09e7('0x48')](_[_0x09e7('0x50')](_0x1adb56[_0x09e7('0x46')],_0x2acf5e[_0x09e7('0x48')]));_0xee9f5b[_0x09e7('0x54')][_0x09e7('0x67')]=_0x5d038c['id'];if(_0x1adb56['query'][_0x09e7('0x52')]){_0xee9f5b[_0x09e7('0x54')]=_['merge'](_0xee9f5b[_0x09e7('0x54')],{'$or':_[_0x09e7('0x42')](_0xee9f5b[_0x09e7('0x4a')],function(_0x4f384c){var _0x3c084f={};_0x3c084f[_0x4f384c]={'$like':'%'+_0x1adb56['query']['filter']+'%'};return _0x3c084f;})});}if(_0x1adb56[_0x09e7('0x46')][_0x09e7('0xa4')]){var _0x4937d9=_0x1adb56[_0x09e7('0x46')]['$gte'][_0x09e7('0xa5')](',');var _0xd2ceb3={};_0xd2ceb3[_0x4937d9[0x0]]={'$gte':moment(_0x4937d9[0x1])[_0x09e7('0xa6')](_0x09e7('0xa7'))};_0xee9f5b[_0x09e7('0x54')]=_[_0x09e7('0x51')](_0xee9f5b[_0x09e7('0x54')],_0xd2ceb3);}_0xee9f5b=_[_0x09e7('0x51')]({},_0xee9f5b,_0x1adb56[_0x09e7('0x53')]);return db[_0x09e7('0xa3')][_0x09e7('0x34')]({'where':_0xee9f5b[_0x09e7('0x54')]})[_0x09e7('0x23')](function(_0x52c206){_0xf7763d['count']=_0x52c206;if(_0x1adb56['query'][_0x09e7('0x55')]){_0xee9f5b[_0x09e7('0x5a')]=[{'all':!![]}];}return db['FaxMessage'][_0x09e7('0x56')](_0xee9f5b);})[_0x09e7('0x23')](function(_0x32567e){_0xf7763d[_0x09e7('0x57')]=_0x32567e;return _0xf7763d;});}})[_0x09e7('0x23')](respondWithFilteredResult(_0x3b2334,_0xee9f5b))[_0x09e7('0x2e')](handleError(_0x3b2334,null));};exports['send']=function(_0x5a4771,_0x3f7bb5,_0x4b8baa){var _0x3a42ef,_0x2bc5f5={},_0x126c2b;if(_0x5a4771[_0x09e7('0x5d')]['to']){_0x126c2b=_0x5a4771['body']['to'][0x0];}return db[_0x09e7('0x43')][_0x09e7('0x5b')]({'where':{'id':_0x5a4771[_0x09e7('0x58')]['id']},'include':[{'model':db[_0x09e7('0xa8')],'as':_0x09e7('0xa9'),'include':[{'model':db[_0x09e7('0x73')],'as':_0x09e7('0xaa'),'where':{'fax':_0x126c2b},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x09e7('0x23')](handleEntityNotFound(_0x3f7bb5,null))[_0x09e7('0x23')](function(_0x1b7bfe){_0x3a42ef=_0x1b7bfe;if(_0x5a4771[_0x09e7('0x5d')][_0x09e7('0xab')]&&_0x5a4771[_0x09e7('0x5d')][_0x09e7('0xab')][_0x09e7('0x4c')]){for(var _0x18431b=0x0;_0x18431b<_0x5a4771[_0x09e7('0x5d')][_0x09e7('0xab')][_0x09e7('0x4c')];_0x18431b+=0x1){_0x5a4771['body'][_0x09e7('0xab')][_0x18431b]={'filename':_0x5a4771[_0x09e7('0x5d')][_0x09e7('0xab')][_0x18431b][_0x09e7('0x3d')],'id':_0x5a4771[_0x09e7('0x5d')][_0x09e7('0xab')][_0x18431b]['id'],'path':path['join'](config['root'],_0x09e7('0xac'),_0x5a4771['body']['attachments'][_0x18431b]['basename'])};}}return respondWithRpcPromise(_0x09e7('0xad'),_0x09e7('0xad'),{'FaxAccountId':_[_0x09e7('0xae')](_0x5a4771['params']['id'])?undefined:_0x5a4771[_0x09e7('0x58')]['id'],'path':_[_0x09e7('0xae')](_0x5a4771['body'][_0x09e7('0xab')][0x0]['path'])?undefined:_0x5a4771['body']['attachments'][0x0][_0x09e7('0x9')],'fax':_[_0x09e7('0xae')](_0x5a4771[_0x09e7('0x5d')]['to'][0x0])?undefined:_0x5a4771['body']['to'][0x0]},client9002);})['then'](function(){if(_0x3a42ef){if(_[_0x09e7('0xae')](_0x5a4771['body'][_0x09e7('0xaf')])){_0x5a4771[_0x09e7('0x5d')][_0x09e7('0xaf')]=util['format'](_0x09e7('0xb0'),_0x3a42ef[_0x09e7('0x3d')],_0x3a42ef[_0x09e7('0xb1')]);}if(_0x3a42ef[_0x09e7('0xa9')]){if(_0x3a42ef[_0x09e7('0xa9')]['Contacts'][_0x09e7('0x4c')]){return _0x3a42ef[_0x09e7('0xa9')]['Contacts'][0x0];}else{return db[_0x09e7('0x73')][_0x09e7('0x5c')](_[_0x09e7('0xb2')](_0x5a4771[_0x09e7('0x5d')],{'firstName':_0x5a4771[_0x09e7('0x5d')]['to'][0x0],'phone':_0x5a4771[_0x09e7('0x5d')]['to'][0x0],'fax':_0x5a4771[_0x09e7('0x5d')]['to'][0x0],'ListId':_0x3a42ef[_0x09e7('0xb3')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x09e7('0xb4'));}})[_0x09e7('0x23')](function(_0x4f38b6){if(_0x4f38b6){return db[_0x09e7('0x7b')][_0x09e7('0x5b')]({'where':{'ContactId':_0x4f38b6['id'],'closed':![],'FaxAccountId':_0x3a42ef['id']}})[_0x09e7('0x23')](function(_0x1232e6){if(_0x1232e6){return[_0x1232e6,![]];}return db[_0x09e7('0x7b')][_0x09e7('0x5c')]({'UserId':_0x5a4771[_0x09e7('0x5e')]['id'],'ContactId':_0x4f38b6['id'],'FaxAccountId':_0x3a42ef['id'],'fax':_0x5a4771[_0x09e7('0x5d')]['to'][0x0],'firstMsgDirection':_0x09e7('0xb5'),'Messages':[_['merge'](_0x5a4771['body'],{'read':![],'body':_0x5a4771['body'][_0x09e7('0xab')][0x0]['filename'],'FaxAccountId':_0x3a42ef['id'],'UserId':_0x5a4771[_0x09e7('0x5e')]['id'],'ContactId':_0x4f38b6['id'],'AttachmentId':_0x5a4771[_0x09e7('0x5d')]['attachments'][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})[_0x09e7('0x23')](function(_0x36e360){return[_0x36e360,!![]];});});}else{throw new Error(_0x09e7('0xb6'));}})[_0x09e7('0xb7')](function(_0x31b73d,_0x3d4da2){if(_0x3d4da2){return _0x31b73d;}return db[_0x09e7('0xa3')][_0x09e7('0x5c')]({'direction':_0x09e7('0xb5'),'read':![],'body':_0x5a4771[_0x09e7('0x5d')][_0x09e7('0xab')][0x0]['filename'],'FaxAccountId':_0x3a42ef['id'],'FaxInteractionId':_0x31b73d['id'],'UserId':_0x5a4771[_0x09e7('0x5e')]['id'],'ContactId':_0x31b73d['ContactId'],'AttachmentId':_0x5a4771[_0x09e7('0x5d')][_0x09e7('0xab')][0x0]['id']})[_0x09e7('0x23')](function(_0x943580){_0x31b73d['dataValues']['Messages']=[];_0x31b73d['dataValues'][_0x09e7('0xb8')][_0x09e7('0x8f')](_0x943580[_0x09e7('0xb9')]);return _0x31b73d;});})['then'](function(_0x4693ff){respondWithRpcPromise(_0x09e7('0xba'),_0x09e7('0xba'),{'FaxAccountId':_['isNil'](_0x5a4771[_0x09e7('0x58')]['id'])?undefined:_0x5a4771[_0x09e7('0x58')]['id'],'path':_[_0x09e7('0xae')](_0x5a4771[_0x09e7('0x5d')]['attachments'][0x0][_0x09e7('0x9')])?undefined:_0x5a4771[_0x09e7('0x5d')][_0x09e7('0xab')][0x0][_0x09e7('0x9')],'fax':_['isNil'](_0x5a4771[_0x09e7('0x5d')]['to'][0x0])?undefined:_0x5a4771[_0x09e7('0x5d')]['to'][0x0],'AttachmentId':_0x5a4771[_0x09e7('0x5d')][_0x09e7('0xab')][0x0]['id']},client9002)[_0x09e7('0x23')](function(_0x155b59){logger[_0x09e7('0x24')]('SendFaxRpc,\x20%s',_0x155b59);})[_0x09e7('0x2e')](function(_0x32d248){logger[_0x09e7('0x24')]('SendFaxRpc,\x20%s',_0x32d248);});return _0x4693ff;})['then'](respondWithResult(_0x3f7bb5,null))[_0x09e7('0x2e')](handleError(_0x3f7bb5,null));};exports[_0x09e7('0xbb')]=function(_0x4add6f,_0x25eeda,_0x404f30){return db['FaxAccount'][_0x09e7('0x5b')]({'where':{'id':_0x4add6f['params']['id']}})[_0x09e7('0x23')](handleEntityNotFound(_0x25eeda,null))[_0x09e7('0x23')](function(_0x4badfe){if(_0x4badfe){return _0x4badfe[_0x09e7('0xbb')](_0x4add6f[_0x09e7('0x5d')][_0x09e7('0x6d')],_[_0x09e7('0x71')](_0x4add6f[_0x09e7('0x5d')],[_0x09e7('0x6d'),'id'])||{})[_0x09e7('0xb7')](function(_0x2483dd){for(var _0x3d46c5=0x0;_0x3d46c5<_0x4add6f[_0x09e7('0x5d')][_0x09e7('0x6d')][_0x09e7('0x4c')];_0x3d46c5+=0x1){socket['emit'](_0x09e7('0xbc'),{'UserId':Number(_0x4add6f[_0x09e7('0x5d')][_0x09e7('0x6d')][_0x3d46c5]),'FaxAccountId':Number(_0x4add6f['params']['id'])});}return _0x2483dd;});}})['then'](respondWithResult(_0x25eeda,null))[_0x09e7('0x2e')](handleError(_0x25eeda,null));};exports['removeAgents']=function(_0x2a9e83,_0x3a13df,_0x4b2b01){return db['FaxAccount'][_0x09e7('0x5b')]({'where':{'id':_0x2a9e83[_0x09e7('0x58')]['id']}})[_0x09e7('0x23')](handleEntityNotFound(_0x3a13df,null))['then'](function(_0x56f53a){if(_0x56f53a){return _0x56f53a['removeAgents'](_0x2a9e83[_0x09e7('0x46')][_0x09e7('0x6d')])[_0x09e7('0x23')](function(){if(_[_0x09e7('0xbd')](_0x2a9e83[_0x09e7('0x46')]['ids'])){for(var _0x4ce818=0x0;_0x4ce818<_0x2a9e83[_0x09e7('0x46')][_0x09e7('0x6d')][_0x09e7('0x4c')];_0x4ce818+=0x1){socket[_0x09e7('0xbe')](_0x09e7('0xbf'),{'UserId':Number(_0x2a9e83[_0x09e7('0x46')][_0x09e7('0x6d')][_0x4ce818]),'FaxAccountId':Number(_0x2a9e83['params']['id'])});}}else{socket[_0x09e7('0xbe')](_0x09e7('0xbf'),{'UserId':Number(_0x2a9e83[_0x09e7('0x46')][_0x09e7('0x6d')]),'FaxAccountId':Number(_0x2a9e83[_0x09e7('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x3a13df,null))['catch'](handleError(_0x3a13df,null));};exports['getAgents']=function(_0x586ea4,_0x389b97,_0x5a33e7){var _0x566aeb={};var _0x5a4a28={};var _0x1b78fc;var _0x109352;return db[_0x09e7('0x43')][_0x09e7('0x6a')]({'where':{'id':_0x586ea4['params']['id']}})['then'](handleEntityNotFound(_0x389b97,null))[_0x09e7('0x23')](function(_0x47a993){if(_0x47a993){_0x1b78fc=_0x47a993;_0x5a4a28[_0x09e7('0x45')]=_['keys'](db[_0x09e7('0x75')][_0x09e7('0x59')]);_0x5a4a28[_0x09e7('0x46')]=_[_0x09e7('0x47')](_0x586ea4[_0x09e7('0x46')]);_0x5a4a28[_0x09e7('0x48')]=_[_0x09e7('0x49')](_0x5a4a28[_0x09e7('0x45')],_0x5a4a28[_0x09e7('0x46')]);_0x566aeb[_0x09e7('0x4a')]=_['intersection'](_0x5a4a28[_0x09e7('0x45')],qs[_0x09e7('0x4b')](_0x586ea4[_0x09e7('0x46')]['fields']));_0x566aeb[_0x09e7('0x4a')]=_0x566aeb['attributes']['length']?_0x566aeb[_0x09e7('0x4a')]:_0x5a4a28[_0x09e7('0x45')];_0x566aeb[_0x09e7('0x4e')]=qs[_0x09e7('0x4f')](_0x586ea4['query']['sort']);_0x566aeb[_0x09e7('0x54')]=qs[_0x09e7('0x48')](_['pick'](_0x586ea4['query'],_0x5a4a28[_0x09e7('0x48')]));if(_0x586ea4[_0x09e7('0x46')]['filter']){_0x566aeb[_0x09e7('0x54')]=_[_0x09e7('0x51')](_0x566aeb[_0x09e7('0x54')],{'$or':_[_0x09e7('0x42')](_0x566aeb[_0x09e7('0x4a')],function(_0x3810f8){var _0x4ac12d={};_0x4ac12d[_0x3810f8]={'$like':'%'+_0x586ea4[_0x09e7('0x46')][_0x09e7('0x52')]+'%'};return _0x4ac12d;})});}_0x566aeb=_['merge']({},_0x566aeb,_0x586ea4[_0x09e7('0x53')]);return _0x1b78fc[_0x09e7('0xc0')](_0x566aeb);}})[_0x09e7('0x23')](function(_0x8ea913){if(_0x8ea913){_0x109352=_0x8ea913[_0x09e7('0x4c')];if(!_0x586ea4[_0x09e7('0x46')][_0x09e7('0x4d')](_0x09e7('0x6b'))){_0x566aeb[_0x09e7('0x33')]=qs[_0x09e7('0x33')](_0x586ea4[_0x09e7('0x46')][_0x09e7('0x33')]);_0x566aeb['offset']=qs[_0x09e7('0x35')](_0x586ea4[_0x09e7('0x46')][_0x09e7('0x35')]);}return _0x1b78fc[_0x09e7('0xc0')](_0x566aeb);}})[_0x09e7('0x23')](function(_0x4fe1d5){if(_0x4fe1d5){return _0x4fe1d5?{'count':_0x109352,'rows':_0x4fe1d5}:null;}})[_0x09e7('0x23')](respondWithResult(_0x389b97,null))[_0x09e7('0x2e')](handleError(_0x389b97,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index b1ecd05..9013b13 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 _0x326b=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0x326b,0x1dc));var _0xb326=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0x326b[_0x35fb56];return _0x2fd52c;};'use strict';var EventEmitter=require(_0xb326('0x0'));var FaxAccount=require(_0xb326('0x1'))['db'][_0xb326('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xb326('0x3')](0x0);var events={'afterCreate':_0xb326('0x4'),'afterUpdate':_0xb326('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3fdbc2){return function(_0x50e112,_0x217543,_0x51ffb8){FaxAccountEvents[_0xb326('0x6')](_0x3fdbc2+':'+_0x50e112['id'],_0x50e112);FaxAccountEvents['emit'](_0x3fdbc2,_0x50e112);_0x51ffb8(null);};}for(var e in events){if(events[_0xb326('0x7')](e)){var event=events[e];FaxAccount[_0xb326('0x8')](e,emitEvent(event));}}module[_0xb326('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x1c5e=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x3aacbb,_0x2e334f){var _0x199e55=function(_0x55e3f2){while(--_0x55e3f2){_0x3aacbb['push'](_0x3aacbb['shift']());}};_0x199e55(++_0x2e334f);}(_0x1c5e,0x15d));var _0xe1c5=function(_0x310a23,_0x49f6b5){_0x310a23=_0x310a23-0x0;var _0x50fe57=_0x1c5e[_0x310a23];return _0x50fe57;};'use strict';var EventEmitter=require(_0xe1c5('0x0'));var FaxAccount=require(_0xe1c5('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xe1c5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe1c5('0x3'),'afterDestroy':'remove'};function emitEvent(_0x553163){return function(_0x4f319a,_0x40a5f0,_0xdcad13){FaxAccountEvents['emit'](_0x553163+':'+_0x4f319a['id'],_0x4f319a);FaxAccountEvents[_0xe1c5('0x4')](_0x553163,_0x4f319a);_0xdcad13(null);};}for(var e in events){if(events[_0xe1c5('0x5')](e)){var event=events[e];FaxAccount[_0xe1c5('0x6')](e,emitEvent(event));}}module[_0xe1c5('0x7')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 7fc28a1..a8e9cd4 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 _0xae6a=['define','FaxAccount','fax_accounts','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./faxAccount.attributes','exports'];(function(_0x357769,_0x370af5){var _0x15a333=function(_0x5bda5e){while(--_0x5bda5e){_0x357769['push'](_0x357769['shift']());}};_0x15a333(++_0x370af5);}(_0xae6a,0x153));var _0xaae6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xae6a[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xaae6('0x0'));var util=require('util');var logger=require(_0xaae6('0x1'))('api');var moment=require(_0xaae6('0x2'));var BPromise=require(_0xaae6('0x3'));var rp=require(_0xaae6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaae6('0x5'));var config=require(_0xaae6('0x6'));var attributes=require(_0xaae6('0x7'));module[_0xaae6('0x8')]=function(_0x402f83,_0x198efb){return _0x402f83[_0xaae6('0x9')](_0xaae6('0xa'),attributes,{'tableName':_0xaae6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9332=['define','FaxAccount','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x2b86eb,_0x2f8516){var _0x4d4f06=function(_0x5f2965){while(--_0x5f2965){_0x2b86eb['push'](_0x2b86eb['shift']());}};_0x4d4f06(++_0x2f8516);}(_0x9332,0x86));var _0x2933=function(_0x114adc,_0x1b1c55){_0x114adc=_0x114adc-0x0;var _0x19199a=_0x9332[_0x114adc];return _0x19199a;};'use strict';var _=require(_0x2933('0x0'));var util=require(_0x2933('0x1'));var logger=require(_0x2933('0x2'))(_0x2933('0x3'));var moment=require(_0x2933('0x4'));var BPromise=require(_0x2933('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2933('0x6'));var rimraf=require(_0x2933('0x7'));var config=require(_0x2933('0x8'));var attributes=require('./faxAccount.attributes');module[_0x2933('0x9')]=function(_0x27af6e,_0x5b9803){return _0x27af6e[_0x2933('0xa')](_0x2933('0xb'),attributes,{'tableName':'fax_accounts','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 bb54c4f..2572b2c 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 _0x3703=['Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','CmList','List','CmContact','Contacts','DESC','FaxApplication','Applications','get','account','applications','list','orderBy','length','create','FaxInteraction','Contact\x20not\x20found','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','unshift','name','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','findAll','options','raw','where','attributes','limit','include','map','model','GetFaxAccount','catch','NotifyFaxAccount','body','fax','describe','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from'];(function(_0x17edd1,_0xd37b1f){var _0x20d982=function(_0x5d4209){while(--_0x5d4209){_0x17edd1['push'](_0x17edd1['shift']());}};_0x20d982(++_0xd37b1f);}(_0x3703,0xd7));var _0x3370=function(_0x2bdeef,_0x21f965){_0x2bdeef=_0x2bdeef-0x0;var _0x59664b=_0x3703[_0x2bdeef];return _0x59664b;};'use strict';var _=require(_0x3370('0x0'));var util=require(_0x3370('0x1'));var moment=require(_0x3370('0x2'));var BPromise=require('bluebird');var rs=require(_0x3370('0x3'));var fs=require('fs');var Redis=require(_0x3370('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3370('0x5'));var logger=require('../../config/logger')(_0x3370('0x6'));var config=require('../../config/environment');var jayson=require(_0x3370('0x7'));var client=jayson['client']['http']({'port':0x232c});config[_0x3370('0x8')]=_[_0x3370('0x9')](config[_0x3370('0x8')],{'host':_0x3370('0xa'),'port':0x18eb});var socket=require(_0x3370('0xb'))(new Redis(config[_0x3370('0x8')]));require(_0x3370('0xc'))['register'](socket);function respondWithRpcPromise(_0x75cc4f,_0x1c2e8e,_0x10294e){return new BPromise(function(_0x4bb0d2,_0x26454b){return client[_0x3370('0xd')](_0x75cc4f,_0x10294e)[_0x3370('0xe')](function(_0x3030cd){logger['info'](_0x3370('0xf'),_0x1c2e8e,_0x3370('0x10'));logger[_0x3370('0x11')](_0x3370('0x12'),_0x1c2e8e,'request\x20sent',JSON[_0x3370('0x13')](_0x3030cd));if(_0x3030cd[_0x3370('0x14')]){if(_0x3030cd[_0x3370('0x14')][_0x3370('0x15')]===0x1f4){logger[_0x3370('0x14')](_0x3370('0xf'),_0x1c2e8e,_0x3030cd['error'][_0x3370('0x16')]);return _0x26454b(_0x3030cd['error'][_0x3370('0x16')]);}logger[_0x3370('0x14')]('FaxAccount,\x20%s,\x20%s',_0x1c2e8e,_0x3030cd[_0x3370('0x14')][_0x3370('0x16')]);return _0x4bb0d2(_0x3030cd['error'][_0x3370('0x16')]);}else{logger[_0x3370('0x17')](_0x3370('0xf'),_0x1c2e8e,_0x3370('0x10'));_0x4bb0d2(_0x3030cd['result'][_0x3370('0x16')]);}})['catch'](function(_0x1bcf59){logger[_0x3370('0x14')](_0x3370('0xf'),_0x1c2e8e,_0x1bcf59);_0x26454b(_0x1bcf59);});});}exports['GetFaxAccount']=function(_0x83787c){var _0x38c311=this;return new Promise(function(_0x131536,_0x15f42a){return db['FaxAccount'][_0x3370('0x18')]({'raw':_0x83787c[_0x3370('0x19')]?_0x83787c[_0x3370('0x19')][_0x3370('0x1a')]===undefined?!![]:![]:!![],'where':_0x83787c['options']?_0x83787c[_0x3370('0x19')][_0x3370('0x1b')]||null:null,'attributes':_0x83787c[_0x3370('0x19')]?_0x83787c[_0x3370('0x19')][_0x3370('0x1c')]||null:null,'limit':_0x83787c[_0x3370('0x19')]?_0x83787c['options'][_0x3370('0x1d')]||null:null,'include':_0x83787c[_0x3370('0x19')]?_0x83787c['options'][_0x3370('0x1e')]?_[_0x3370('0x1f')](_0x83787c['options']['include'],function(_0x426df7){return{'model':db[_0x426df7[_0x3370('0x20')]],'as':_0x426df7['as'],'attributes':_0x426df7[_0x3370('0x1c')],'include':_0x426df7['include']?_['map'](_0x426df7[_0x3370('0x1e')],function(_0x303868){return{'model':db[_0x303868['model']],'as':_0x303868['as'],'attributes':_0x303868[_0x3370('0x1c')],'include':_0x303868[_0x3370('0x1e')]?_[_0x3370('0x1f')](_0x303868[_0x3370('0x1e')],function(_0x3fe263){return{'model':db[_0x3fe263[_0x3370('0x20')]],'as':_0x3fe263['as'],'attributes':_0x3fe263[_0x3370('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x599ca6){logger['info'](_0x3370('0x21'),_0x83787c);logger['debug'](_0x3370('0x21'),_0x83787c,JSON[_0x3370('0x13')](_0x599ca6));_0x131536(_0x599ca6);})[_0x3370('0x22')](function(_0xc253b8){logger[_0x3370('0x14')](_0x3370('0x21'),_0xc253b8[_0x3370('0x16')],_0x83787c);_0x15f42a(_0x38c311[_0x3370('0x14')](0x1f4,_0xc253b8['message']));});});};exports[_0x3370('0x23')]=function(_0xdb3ca5,_0x350ec5,_0xe4564c){var _0x28a62e=this;return new Promise(function(_0x44f67b,_0x4dcc9a){var _0x1ce45a={'body':_0xdb3ca5[_0x3370('0x24')],'channel':_0x3370('0x25')};var _0x56120f=[];var _0x27e3d6=[];var _0x466660={};return db['CmContact'][_0x3370('0x26')]()[_0x3370('0xe')](function(_0x12073d){if(!_0x12073d){throw new db['Sequelize'][(_0x3370('0x27'))](_0x3370('0x28'));}_0x56120f=_[_0x3370('0x29')](_[_0x3370('0x2a')](_0x12073d),[_0x3370('0x2b'),_0x3370('0x2c')]);_0x27e3d6=_[_0x3370('0x29')](_[_0x3370('0x2a')](_0x12073d),[_0x3370('0x2b'),_0x3370('0x2c'),_0x3370('0x2d'),_0x3370('0x2e')]);if(_0xdb3ca5[_0x3370('0x24')]['id']){delete _0xdb3ca5['body']['id'];}if(_[_0x3370('0x2f')](_0xdb3ca5[_0x3370('0x24')][_0x3370('0x30')])){throw new db[(_0x3370('0x31'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0xdb3ca5[_0x3370('0x24')][_0x3370('0x24')])||_0xdb3ca5['body'][_0x3370('0x24')]===''){throw new db['Sequelize']['ValidationError'](_0x3370('0x32'));}if(_[_0x3370('0x2f')](_0xdb3ca5[_0x3370('0x24')][_0x3370('0x33')])){throw new db[(_0x3370('0x31'))][(_0x3370('0x27'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x27e3d6);}if(!_[_0x3370('0x34')](_0x27e3d6,_0xdb3ca5[_0x3370('0x24')][_0x3370('0x33')])){throw new db[(_0x3370('0x31'))][(_0x3370('0x27'))](_0x3370('0x35')+_0x27e3d6);}_0x466660[_0xdb3ca5['body'][_0x3370('0x33')]]=_0xdb3ca5[_0x3370('0x24')][_0x3370('0x30')];})['then'](function(){return db[_0x3370('0x36')][_0x3370('0x37')]({'where':{'id':_0xdb3ca5['account']['id']},'include':[{'model':db[_0x3370('0x38')],'as':_0x3370('0x39'),'include':[{'model':db[_0x3370('0x3a')],'as':_0x3370('0x3b'),'where':_0x466660,'limit':0x1,'order':[[_0x3370('0x2c'),_0x3370('0x3c')]]}]},{'model':db[_0x3370('0x3d')],'as':_0x3370('0x3e')}]});})[_0x3370('0xe')](function(_0x3e1bf1){if(_0x3e1bf1&&_0x3e1bf1[_0x3370('0x39')]){var _0x528623=_0x3e1bf1[_0x3370('0x3f')]({'plain':!![]});_0x1ce45a[_0x3370('0x40')]=_0x528623;_0x1ce45a[_0x3370('0x41')]=_0x528623['Applications'];_0x1ce45a[_0x3370('0x42')]=_0x528623[_0x3370('0x39')];_0x1ce45a[_0x3370('0x41')]=_[_0x3370('0x43')](_0x1ce45a[_0x3370('0x41')],['priority'],['asc']);if(_0x1ce45a['account']['Applications']){delete _0x1ce45a[_0x3370('0x40')]['Applications'];}if(_0x1ce45a[_0x3370('0x40')]['List']&&_0x1ce45a[_0x3370('0x40')]['List'][_0x3370('0x3b')][_0x3370('0x44')]){return _0x1ce45a['account'][_0x3370('0x39')][_0x3370('0x3b')][0x0];}var _0x3f8710=_[_0x3370('0x9')](_0xdb3ca5['body'],{'firstName':_0xdb3ca5[_0x3370('0x24')][_0x3370('0x30')],'ListId':_0x528623[_0x3370('0x2e')]});_0x3f8710[_0xdb3ca5[_0x3370('0x24')]['mapKey']]=_0xdb3ca5[_0x3370('0x24')][_0x3370('0x30')];return db[_0x3370('0x3a')][_0x3370('0x45')](_0x3f8710,{'fields':_0x56120f,'raw':!![]});}})['then'](function(_0x302a3f){_0x1ce45a['contact']=_0x302a3f;if(_0x302a3f){var _0xf5d4a4={'ContactId':_0x302a3f['id'],'FaxAccountId':_0xdb3ca5[_0x3370('0x40')]['id'],'fax':_0x302a3f[_0x3370('0x25')]};return db[_0x3370('0x46')][_0x3370('0x37')]({'where':{'ContactId':_0x302a3f['id'],'closed':![],'FaxAccountId':_0xdb3ca5[_0x3370('0x40')]['id']}})[_0x3370('0xe')](function(_0x57b060){if(_0x57b060){return[_0x57b060,![]];}return db[_0x3370('0x46')]['create'](_0xf5d4a4)[_0x3370('0xe')](function(_0x45d075){return[_0x45d075,!![]];});});}else{throw new Error(_0x3370('0x47'));}})['spread'](function(_0x8bb3e4,_0x10950a){var _0x28b754=_0x8bb3e4[_0x3370('0x3f')]({'plain':!![]});if(_0x10950a){if(_0x1ce45a['account'][_0x3370('0x48')]){_0x1ce45a[_0x3370('0x41')][_0x3370('0x49')]({'id':0x0,'priority':_0x1ce45a[_0x3370('0x41')][_0x3370('0x44')]+0x1,'app':_0x3370('0x4a'),'appdata':_0x3370('0x4b'),'interval':_0x3370('0x4c')});}_0x28b754[_0x3370('0x4d')]=!![];}else{_0x28b754[_0x3370('0x4d')]=![];}_0x1ce45a[_0x3370('0x4e')]=_0x28b754;return db[_0x3370('0x4f')][_0x3370('0x45')]({'body':_0xdb3ca5['body'][_0x3370('0x24')],'FaxAccountId':_0xdb3ca5[_0x3370('0x40')]['id'],'FaxInteractionId':_0x8bb3e4['id'],'direction':'in','ContactId':_0x8bb3e4[_0x3370('0x50')],'AttachmentId':_0xdb3ca5[_0x3370('0x24')][_0x3370('0x51')]});})[_0x3370('0xe')](function(_0x1ff7eb){_0x1ce45a['message']=_0x1ff7eb;if(_0x1ce45a[_0x3370('0x4e')][_0x3370('0x52')]){return db[_0x3370('0x53')][_0x3370('0x37')]({'attributes':['id','name'],'where':{'id':_0x1ce45a[_0x3370('0x4e')][_0x3370('0x52')]}})[_0x3370('0xe')](function(_0x324d9c){if(_0x324d9c){_0x1ce45a[_0x3370('0x41')][_0x3370('0x54')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x324d9c[_0x3370('0x55')]+','+(_0x1ce45a[_0x3370('0x40')]['waitForTheAssignedAgent']||0xa),'interval':_0x3370('0x4c')});}return respondWithRpcPromise(_0x3370('0x56'),_0x3370('0x57'),_0x1ce45a);});}return respondWithRpcPromise('Start',_0x3370('0x57'),_0x1ce45a);})[_0x3370('0xe')](function(_0x493a84){_0x44f67b(_0x493a84);})[_0x3370('0x22')](function(_0x3f60cf){_0x4dcc9a(_0x28a62e['error'](0x1f4,_0x3f60cf[_0x3370('0x16')]));});});}; \ No newline at end of file +var _0x9007=['options','where','attributes','include','map','model','stringify','NotifyFaxAccount','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','applications','list','orderBy','priority','asc','length','CmContact','create','contact','FaxInteraction','Contact\x20not\x20found','spread','get','autoclose','push','close','unmanaged','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId','User','name','agent','startRouting','Start','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetFaxAccount','findAll'];(function(_0x3b711c,_0x4b22dc){var _0x2685f0=function(_0x3b5ba6){while(--_0x3b5ba6){_0x3b711c['push'](_0x3b711c['shift']());}};_0x2685f0(++_0x4b22dc);}(_0x9007,0x9c));var _0x7900=function(_0x5da63e,_0x4d3503){_0x5da63e=_0x5da63e-0x0;var _0x442aca=_0x9007[_0x5da63e];return _0x442aca;};'use strict';var _=require(_0x7900('0x0'));var util=require('util');var moment=require(_0x7900('0x1'));var BPromise=require('bluebird');var rs=require(_0x7900('0x2'));var fs=require('fs');var Redis=require(_0x7900('0x3'));var db=require(_0x7900('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7900('0x5'));var config=require(_0x7900('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7900('0x7')]({'port':0x232c});config[_0x7900('0x8')]=_[_0x7900('0x9')](config[_0x7900('0x8')],{'host':_0x7900('0xa'),'port':0x18eb});var socket=require(_0x7900('0xb'))(new Redis(config[_0x7900('0x8')]));require(_0x7900('0xc'))[_0x7900('0xd')](socket);function respondWithRpcPromise(_0x282bb4,_0x41e2d8,_0x4b6778){return new BPromise(function(_0x4ba254,_0xcb9f75){return client[_0x7900('0xe')](_0x282bb4,_0x4b6778)[_0x7900('0xf')](function(_0x15dd71){logger[_0x7900('0x10')](_0x7900('0x11'),_0x41e2d8,'request\x20sent');logger[_0x7900('0x12')](_0x7900('0x13'),_0x41e2d8,_0x7900('0x14'),JSON['stringify'](_0x15dd71));if(_0x15dd71[_0x7900('0x15')]){if(_0x15dd71['error'][_0x7900('0x16')]===0x1f4){logger[_0x7900('0x15')]('FaxAccount,\x20%s,\x20%s',_0x41e2d8,_0x15dd71[_0x7900('0x15')][_0x7900('0x17')]);return _0xcb9f75(_0x15dd71[_0x7900('0x15')][_0x7900('0x17')]);}logger[_0x7900('0x15')]('FaxAccount,\x20%s,\x20%s',_0x41e2d8,_0x15dd71[_0x7900('0x15')][_0x7900('0x17')]);return _0x4ba254(_0x15dd71[_0x7900('0x15')][_0x7900('0x17')]);}else{logger['info'](_0x7900('0x11'),_0x41e2d8,_0x7900('0x14'));_0x4ba254(_0x15dd71[_0x7900('0x18')]['message']);}})[_0x7900('0x19')](function(_0xa62cde){logger[_0x7900('0x15')]('FaxAccount,\x20%s,\x20%s',_0x41e2d8,_0xa62cde);_0xcb9f75(_0xa62cde);});});}exports[_0x7900('0x1a')]=function(_0x1094bf){var _0x293775=this;return new Promise(function(_0x1acd52,_0x2b241f){return db['FaxAccount'][_0x7900('0x1b')]({'raw':_0x1094bf[_0x7900('0x1c')]?_0x1094bf[_0x7900('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1094bf['options']?_0x1094bf[_0x7900('0x1c')][_0x7900('0x1d')]||null:null,'attributes':_0x1094bf['options']?_0x1094bf[_0x7900('0x1c')][_0x7900('0x1e')]||null:null,'limit':_0x1094bf[_0x7900('0x1c')]?_0x1094bf[_0x7900('0x1c')]['limit']||null:null,'include':_0x1094bf[_0x7900('0x1c')]?_0x1094bf[_0x7900('0x1c')][_0x7900('0x1f')]?_[_0x7900('0x20')](_0x1094bf[_0x7900('0x1c')][_0x7900('0x1f')],function(_0x45af21){return{'model':db[_0x45af21[_0x7900('0x21')]],'as':_0x45af21['as'],'attributes':_0x45af21[_0x7900('0x1e')],'include':_0x45af21[_0x7900('0x1f')]?_[_0x7900('0x20')](_0x45af21['include'],function(_0x31f756){return{'model':db[_0x31f756[_0x7900('0x21')]],'as':_0x31f756['as'],'attributes':_0x31f756[_0x7900('0x1e')],'include':_0x31f756['include']?_['map'](_0x31f756['include'],function(_0x2fde16){return{'model':db[_0x2fde16['model']],'as':_0x2fde16['as'],'attributes':_0x2fde16[_0x7900('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7900('0xf')](function(_0x93b92d){logger[_0x7900('0x10')]('GetFaxAccount',_0x1094bf);logger[_0x7900('0x12')]('GetFaxAccount',_0x1094bf,JSON[_0x7900('0x22')](_0x93b92d));_0x1acd52(_0x93b92d);})[_0x7900('0x19')](function(_0xbcb92){logger['error'](_0x7900('0x1a'),_0xbcb92[_0x7900('0x17')],_0x1094bf);_0x2b241f(_0x293775[_0x7900('0x15')](0x1f4,_0xbcb92[_0x7900('0x17')]));});});};exports[_0x7900('0x23')]=function(_0x2c8c88,_0x38a90e,_0x19b438){var _0x461b34=this;return new Promise(function(_0x395cab,_0x2b6d84){var _0x369ba7={'body':_0x2c8c88[_0x7900('0x24')],'channel':_0x7900('0x25')};var _0x3aed9f=[];var _0x304bff=[];var _0x259165={};return db['CmContact'][_0x7900('0x26')]()[_0x7900('0xf')](function(_0x4a2ace){if(!_0x4a2ace){throw new db[(_0x7900('0x27'))][(_0x7900('0x28'))](_0x7900('0x29'));}_0x3aed9f=_[_0x7900('0x2a')](_[_0x7900('0x2b')](_0x4a2ace),[_0x7900('0x2c'),'updatedAt']);_0x304bff=_['difference'](_[_0x7900('0x2b')](_0x4a2ace),[_0x7900('0x2c'),_0x7900('0x2d'),_0x7900('0x2e'),_0x7900('0x2f')]);if(_0x2c8c88[_0x7900('0x24')]['id']){delete _0x2c8c88['body']['id'];}if(_[_0x7900('0x30')](_0x2c8c88[_0x7900('0x24')][_0x7900('0x31')])){throw new db[(_0x7900('0x27'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x7900('0x30')](_0x2c8c88[_0x7900('0x24')][_0x7900('0x24')])||_0x2c8c88[_0x7900('0x24')][_0x7900('0x24')]===''){throw new db[(_0x7900('0x27'))][(_0x7900('0x28'))](_0x7900('0x32'));}if(_['isNil'](_0x2c8c88[_0x7900('0x24')]['mapKey'])){throw new db['Sequelize'][(_0x7900('0x28'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x304bff);}if(!_[_0x7900('0x33')](_0x304bff,_0x2c8c88['body'][_0x7900('0x34')])){throw new db[(_0x7900('0x27'))][(_0x7900('0x28'))](_0x7900('0x35')+_0x304bff);}_0x259165[_0x2c8c88[_0x7900('0x24')][_0x7900('0x34')]]=_0x2c8c88[_0x7900('0x24')][_0x7900('0x31')];})[_0x7900('0xf')](function(){return db[_0x7900('0x36')][_0x7900('0x37')]({'where':{'id':_0x2c8c88[_0x7900('0x38')]['id']},'include':[{'model':db[_0x7900('0x39')],'as':_0x7900('0x3a'),'include':[{'model':db['CmContact'],'as':_0x7900('0x3b'),'where':_0x259165,'limit':0x1,'order':[['updatedAt',_0x7900('0x3c')]]}]},{'model':db[_0x7900('0x3d')],'as':_0x7900('0x3e')}]});})[_0x7900('0xf')](function(_0x1b193d){if(_0x1b193d&&_0x1b193d['List']){var _0x2556ae=_0x1b193d['get']({'plain':!![]});_0x369ba7['account']=_0x2556ae;_0x369ba7[_0x7900('0x3f')]=_0x2556ae[_0x7900('0x3e')];_0x369ba7[_0x7900('0x40')]=_0x2556ae[_0x7900('0x3a')];_0x369ba7[_0x7900('0x3f')]=_[_0x7900('0x41')](_0x369ba7[_0x7900('0x3f')],[_0x7900('0x42')],[_0x7900('0x43')]);if(_0x369ba7[_0x7900('0x38')]['Applications']){delete _0x369ba7['account'][_0x7900('0x3e')];}if(_0x369ba7[_0x7900('0x38')][_0x7900('0x3a')]&&_0x369ba7[_0x7900('0x38')][_0x7900('0x3a')][_0x7900('0x3b')][_0x7900('0x44')]){return _0x369ba7[_0x7900('0x38')][_0x7900('0x3a')][_0x7900('0x3b')][0x0];}var _0x4a341f=_[_0x7900('0x9')](_0x2c8c88['body'],{'firstName':_0x2c8c88[_0x7900('0x24')][_0x7900('0x31')],'ListId':_0x2556ae['ListId']});_0x4a341f[_0x2c8c88[_0x7900('0x24')][_0x7900('0x34')]]=_0x2c8c88['body'][_0x7900('0x31')];return db[_0x7900('0x45')][_0x7900('0x46')](_0x4a341f,{'fields':_0x3aed9f,'raw':!![]});}})[_0x7900('0xf')](function(_0x1572f2){_0x369ba7[_0x7900('0x47')]=_0x1572f2;if(_0x1572f2){var _0x3e36f0={'ContactId':_0x1572f2['id'],'FaxAccountId':_0x2c8c88[_0x7900('0x38')]['id'],'fax':_0x1572f2[_0x7900('0x25')]};return db[_0x7900('0x48')][_0x7900('0x37')]({'where':{'ContactId':_0x1572f2['id'],'closed':![],'FaxAccountId':_0x2c8c88[_0x7900('0x38')]['id']}})[_0x7900('0xf')](function(_0x558c3b){if(_0x558c3b){return[_0x558c3b,![]];}return db[_0x7900('0x48')]['create'](_0x3e36f0)[_0x7900('0xf')](function(_0x256cc1){return[_0x256cc1,!![]];});});}else{throw new Error(_0x7900('0x49'));}})[_0x7900('0x4a')](function(_0x53bdfe,_0x12b534){var _0x1faf8f=_0x53bdfe[_0x7900('0x4b')]({'plain':!![]});if(_0x12b534){if(_0x369ba7[_0x7900('0x38')][_0x7900('0x4c')]){_0x369ba7[_0x7900('0x3f')][_0x7900('0x4d')]({'id':0x0,'priority':_0x369ba7['applications']['length']+0x1,'app':_0x7900('0x4e'),'appdata':_0x7900('0x4f'),'interval':_0x7900('0x50')});}_0x1faf8f[_0x7900('0x51')]=!![];}else{_0x1faf8f[_0x7900('0x51')]=![];}_0x369ba7['interaction']=_0x1faf8f;return db[_0x7900('0x52')]['create']({'body':_0x2c8c88[_0x7900('0x24')][_0x7900('0x24')],'FaxAccountId':_0x2c8c88['account']['id'],'FaxInteractionId':_0x53bdfe['id'],'direction':'in','ContactId':_0x53bdfe[_0x7900('0x53')],'AttachmentId':_0x2c8c88[_0x7900('0x24')][_0x7900('0x54')]});})[_0x7900('0xf')](function(_0x247280){_0x369ba7[_0x7900('0x17')]=_0x247280;if(_0x369ba7[_0x7900('0x55')][_0x7900('0x56')]){return db[_0x7900('0x57')][_0x7900('0x37')]({'attributes':['id',_0x7900('0x58')],'where':{'id':_0x369ba7['interaction']['UserId']}})[_0x7900('0xf')](function(_0x234421){if(_0x234421){_0x369ba7[_0x7900('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':_0x7900('0x59'),'appdata':_0x234421[_0x7900('0x58')]+','+(_0x369ba7[_0x7900('0x38')]['waitForTheAssignedAgent']||0xa),'interval':_0x7900('0x50')});}return respondWithRpcPromise('Start',_0x7900('0x5a'),_0x369ba7);});}return respondWithRpcPromise(_0x7900('0x5b'),'startRouting',_0x369ba7);})[_0x7900('0xf')](function(_0x18a5f7){_0x395cab(_0x18a5f7);})[_0x7900('0x19')](function(_0x59da59){_0x2b6d84(_0x461b34['error'](0x1f4,_0x59da59['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 9024eba..cb1ac1b 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 _0xb8d5=['length','faxAccount:','./faxAccount.events','remove','update','removeListener','register'];(function(_0x513978,_0x49dbf1){var _0x1ab35d=function(_0x44d8f8){while(--_0x44d8f8){_0x513978['push'](_0x513978['shift']());}};_0x1ab35d(++_0x49dbf1);}(_0xb8d5,0x1d7));var _0x5b8d=function(_0x1eb4ca,_0xe6035d){_0x1eb4ca=_0x1eb4ca-0x0;var _0x34309d=_0xb8d5[_0x1eb4ca];return _0x34309d;};'use strict';var FaxAccountEvents=require(_0x5b8d('0x0'));var events=['save',_0x5b8d('0x1'),_0x5b8d('0x2')];function createListener(_0x29dddb,_0x5371b6){return function(_0x45361c){_0x5371b6['emit'](_0x29dddb,_0x45361c);};}function removeListener(_0x3e6501,_0x327dbd){return function(){FaxAccountEvents[_0x5b8d('0x3')](_0x3e6501,_0x327dbd);};}exports[_0x5b8d('0x4')]=function(_0x29ef86){for(var _0x30ccda=0x0,_0x1c2c6=events[_0x5b8d('0x5')];_0x30ccda<_0x1c2c6;_0x30ccda++){var _0x54f369=events[_0x30ccda];var _0x1c50ce=createListener(_0x5b8d('0x6')+_0x54f369,_0x29ef86);FaxAccountEvents['on'](_0x54f369,_0x1c50ce);}}; \ No newline at end of file +var _0x7501=['./faxAccount.events','save','remove','update','emit','length','faxAccount:'];(function(_0x3024be,_0x581862){var _0x3c26b3=function(_0x5cf1d1){while(--_0x5cf1d1){_0x3024be['push'](_0x3024be['shift']());}};_0x3c26b3(++_0x581862);}(_0x7501,0x10a));var _0x1750=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x7501[_0x1762b4];return _0x29beda;};'use strict';var FaxAccountEvents=require(_0x1750('0x0'));var events=[_0x1750('0x1'),_0x1750('0x2'),_0x1750('0x3')];function createListener(_0xa186db,_0x1665a7){return function(_0x4c04f8){_0x1665a7[_0x1750('0x4')](_0xa186db,_0x4c04f8);};}function removeListener(_0x32951f,_0x216136){return function(){FaxAccountEvents['removeListener'](_0x32951f,_0x216136);};}exports['register']=function(_0x316756){for(var _0x20312b=0x0,_0xce3df=events[_0x1750('0x5')];_0x20312b<_0xce3df;_0x20312b++){var _0x158e38=events[_0x20312b];var _0x999bc=createListener(_0x1750('0x6')+_0x158e38,_0x316756);FaxAccountEvents['on'](_0x158e38,_0x999bc);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 54f1467..2284c5e 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(_0x14edeb,_0x3f100c){var _0x57ec60=function(_0x4545b8){while(--_0x4545b8){_0x14edeb['push'](_0x14edeb['shift']());}};_0x57ec60(++_0x3f100c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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(_0x261bbf,_0x567f53){var _0x3434e5=function(_0x5c194c){while(--_0x5c194c){_0x261bbf['push'](_0x261bbf['shift']());}};_0x3434e5(++_0x567f53);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 33261c3..53f34b9 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 _0xe287=['INTEGER','STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0xda21e8,_0x19d184){var _0x28904b=function(_0x10c833){while(--_0x10c833){_0xda21e8['push'](_0xda21e8['shift']());}};_0x28904b(++_0x19d184);}(_0xe287,0x82));var _0x7e28=function(_0x25ca4d,_0x188c79){_0x25ca4d=_0x25ca4d-0x0;var _0x227edf=_0xe287[_0x25ca4d];return _0x227edf;};'use strict';var Sequelize=require(_0x7e28('0x0'));module[_0x7e28('0x1')]={'priority':{'type':Sequelize[_0x7e28('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7e28('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7e28('0x4')]()},'description':{'type':Sequelize[_0x7e28('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7e28('0x5')}}; \ No newline at end of file +var _0x7efa=['INTEGER','STRING','TEXT','*,*,*,*','exports'];(function(_0x73dcd,_0x482364){var _0x4949fa=function(_0x593f20){while(--_0x593f20){_0x73dcd['push'](_0x73dcd['shift']());}};_0x4949fa(++_0x482364);}(_0x7efa,0x130));var _0xa7ef=function(_0x1a0ef3,_0x535bbf){_0x1a0ef3=_0x1a0ef3-0x0;var _0x2b86da=_0x7efa[_0x1a0ef3];return _0x2b86da;};'use strict';var Sequelize=require('sequelize');module[_0xa7ef('0x0')]={'priority':{'type':Sequelize[_0xa7ef('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa7ef('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xa7ef('0x3')]()},'description':{'type':Sequelize[_0xa7ef('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa7ef('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index f1ffe9b..72c67ad 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 _0xb28d=['sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','FaxApplication','rawAttributes','type','keys','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','catch','params','intersection','includeAll','find','create','update','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0xb28d,0x109));var _0xdb28=function(_0x1a2877,_0x4b2963){_0x1a2877=_0x1a2877-0x0;var _0xe5dbce=_0xb28d[_0x1a2877];return _0xe5dbce;};'use strict';var emlformat=require(_0xdb28('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb28('0x1'));var jsonpatch=require(_0xdb28('0x2'));var rp=require(_0xdb28('0x3'));var moment=require(_0xdb28('0x4'));var BPromise=require(_0xdb28('0x5'));var Mustache=require('mustache');var util=require(_0xdb28('0x6'));var path=require(_0xdb28('0x7'));var sox=require('sox');var csv=require(_0xdb28('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb28('0x9'));var squel=require(_0xdb28('0xa'));var crypto=require('crypto');var jsforce=require(_0xdb28('0xb'));var deskjs=require(_0xdb28('0xc'));var toCsv=require(_0xdb28('0x8'));var querystring=require('querystring');var Papa=require(_0xdb28('0xd'));var Redis=require(_0xdb28('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xdb28('0xf'));var as=require(_0xdb28('0x10'));var hardwareService=require(_0xdb28('0x11'));var logger=require(_0xdb28('0x12'))(_0xdb28('0x13'));var utils=require(_0xdb28('0x14'));var config=require(_0xdb28('0x15'));var licenseUtil=require(_0xdb28('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x119bec,_0x47db21){_0x47db21=_0x47db21||0xcc;return function(_0x100c18){if(_0x100c18){return _0x119bec[_0xdb28('0x17')](_0x47db21);}return _0x119bec[_0xdb28('0x18')](_0x47db21)[_0xdb28('0x19')]();};}function respondWithResult(_0x347359,_0xca5344){_0xca5344=_0xca5344||0xc8;return function(_0x398f8f){if(_0x398f8f){return _0x347359[_0xdb28('0x18')](_0xca5344)['json'](_0x398f8f);}};}function respondWithFilteredResult(_0x1417bf,_0x47f664){return function(_0x1e9aff){if(_0x1e9aff){var _0x19216c=typeof _0x47f664[_0xdb28('0x1a')]==='undefined'&&typeof _0x47f664[_0xdb28('0x1b')]==='undefined';var _0x4d048e=_0x1e9aff[_0xdb28('0x1c')];var _0x34e485=_0x19216c?0x0:_0x47f664[_0xdb28('0x1a')];var _0x386534=_0x19216c?_0x1e9aff[_0xdb28('0x1c')]:_0x47f664[_0xdb28('0x1a')]+_0x47f664[_0xdb28('0x1b')];var _0x5ce25d;if(_0x386534>=_0x4d048e){_0x386534=_0x4d048e;_0x5ce25d=0xc8;}else{_0x5ce25d=0xce;}_0x1417bf[_0xdb28('0x18')](_0x5ce25d);return _0x1417bf[_0xdb28('0x1d')](_0xdb28('0x1e'),_0x34e485+'-'+_0x386534+'/'+_0x4d048e)[_0xdb28('0x1f')](_0x1e9aff);}return null;};}function patchUpdates(_0x1d4507){return function(_0x1121f4){try{jsonpatch[_0xdb28('0x20')](_0x1121f4,_0x1d4507,!![]);}catch(_0x3a40de){return BPromise[_0xdb28('0x21')](_0x3a40de);}return _0x1121f4[_0xdb28('0x22')]();};}function saveUpdates(_0x5d804d,_0x8d8ccd){return function(_0x5aaaaf){if(_0x5aaaaf){return _0x5aaaaf['update'](_0x5d804d)[_0xdb28('0x23')](function(_0x4cb50b){return _0x4cb50b;});}return null;};}function removeEntity(_0x56bd69,_0x197b54){return function(_0x1f44dc){if(_0x1f44dc){return _0x1f44dc[_0xdb28('0x24')]()[_0xdb28('0x23')](function(){_0x56bd69[_0xdb28('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x295f15,_0x4a8e79){return function(_0x374621){if(!_0x374621){_0x295f15['sendStatus'](0x194);}return _0x374621;};}function handleError(_0x7c1f2a,_0x521321){_0x521321=_0x521321||0x1f4;return function(_0x4455b9){logger[_0xdb28('0x25')](_0x4455b9[_0xdb28('0x26')]);if(_0x4455b9[_0xdb28('0x27')]){delete _0x4455b9['name'];}_0x7c1f2a[_0xdb28('0x18')](_0x521321)[_0xdb28('0x28')](_0x4455b9);};}exports[_0xdb28('0x29')]=function(_0x3a6969,_0x584a71){var _0x39949f={},_0x48bc8d={},_0x180521={'count':0x0,'rows':[]};var _0x2d9696=_[_0xdb28('0x2a')](db[_0xdb28('0x2b')][_0xdb28('0x2c')],function(_0xaa7092){return{'name':_0xaa7092['fieldName'],'type':_0xaa7092[_0xdb28('0x2d')]['key']};});_0x48bc8d['model']=_['map'](_0x2d9696,'name');_0x48bc8d['query']=_[_0xdb28('0x2e')](_0x3a6969[_0xdb28('0x2f')]);_0x48bc8d[_0xdb28('0x30')]=_['intersection'](_0x48bc8d[_0xdb28('0x31')],_0x48bc8d[_0xdb28('0x2f')]);_0x39949f[_0xdb28('0x32')]=_['intersection'](_0x48bc8d[_0xdb28('0x31')],qs[_0xdb28('0x33')](_0x3a6969[_0xdb28('0x2f')]['fields']));_0x39949f[_0xdb28('0x32')]=_0x39949f[_0xdb28('0x32')][_0xdb28('0x34')]?_0x39949f[_0xdb28('0x32')]:_0x48bc8d[_0xdb28('0x31')];if(!_0x3a6969['query'][_0xdb28('0x35')](_0xdb28('0x36'))){_0x39949f['limit']=qs[_0xdb28('0x1b')](_0x3a6969['query']['limit']);_0x39949f[_0xdb28('0x1a')]=qs[_0xdb28('0x1a')](_0x3a6969['query'][_0xdb28('0x1a')]);}_0x39949f[_0xdb28('0x37')]=qs[_0xdb28('0x38')](_0x3a6969[_0xdb28('0x2f')][_0xdb28('0x38')]);_0x39949f[_0xdb28('0x39')]=qs[_0xdb28('0x30')](_[_0xdb28('0x3a')](_0x3a6969[_0xdb28('0x2f')],_0x48bc8d[_0xdb28('0x30')]),_0x2d9696);if(_0x3a6969[_0xdb28('0x2f')][_0xdb28('0x3b')]){_0x39949f[_0xdb28('0x39')]=_[_0xdb28('0x3c')](_0x39949f[_0xdb28('0x39')],{'$or':_[_0xdb28('0x2a')](_0x2d9696,function(_0xde9af1){if(_0xde9af1[_0xdb28('0x2d')]!=='VIRTUAL'){var _0x248795={};_0x248795[_0xde9af1['name']]={'$like':'%'+_0x3a6969['query'][_0xdb28('0x3b')]+'%'};return _0x248795;}})});}_0x39949f=_[_0xdb28('0x3c')]({},_0x39949f,_0x3a6969[_0xdb28('0x3d')]);var _0x4141b3={'where':_0x39949f['where']};return db[_0xdb28('0x2b')][_0xdb28('0x1c')](_0x4141b3)[_0xdb28('0x23')](function(_0xa32b59){_0x180521[_0xdb28('0x1c')]=_0xa32b59;if(_0x3a6969[_0xdb28('0x2f')]['includeAll']){_0x39949f[_0xdb28('0x3e')]=[{'all':!![]}];}return db['FaxApplication'][_0xdb28('0x3f')](_0x39949f);})[_0xdb28('0x23')](function(_0x3cc1c4){_0x180521['rows']=_0x3cc1c4;return _0x180521;})['then'](respondWithFilteredResult(_0x584a71,_0x39949f))[_0xdb28('0x40')](handleError(_0x584a71,null));};exports['show']=function(_0x98b4a2,_0x3c9eb2){var _0x3c438={'raw':!![],'where':{'id':_0x98b4a2[_0xdb28('0x41')]['id']}},_0x5412f3={};_0x5412f3[_0xdb28('0x31')]=_[_0xdb28('0x2e')](db[_0xdb28('0x2b')][_0xdb28('0x2c')]);_0x5412f3[_0xdb28('0x2f')]=_['keys'](_0x98b4a2[_0xdb28('0x2f')]);_0x5412f3[_0xdb28('0x30')]=_[_0xdb28('0x42')](_0x5412f3['model'],_0x5412f3[_0xdb28('0x2f')]);_0x3c438[_0xdb28('0x32')]=_[_0xdb28('0x42')](_0x5412f3['model'],qs[_0xdb28('0x33')](_0x98b4a2[_0xdb28('0x2f')]['fields']));_0x3c438[_0xdb28('0x32')]=_0x3c438['attributes'][_0xdb28('0x34')]?_0x3c438[_0xdb28('0x32')]:_0x5412f3[_0xdb28('0x31')];if(_0x98b4a2['query'][_0xdb28('0x43')]){_0x3c438[_0xdb28('0x3e')]=[{'all':!![]}];}_0x3c438=_['merge']({},_0x3c438,_0x98b4a2['options']);return db[_0xdb28('0x2b')][_0xdb28('0x44')](_0x3c438)[_0xdb28('0x23')](handleEntityNotFound(_0x3c9eb2,null))['then'](respondWithResult(_0x3c9eb2,null))[_0xdb28('0x40')](handleError(_0x3c9eb2,null));};exports[_0xdb28('0x45')]=function(_0x2e5d51,_0x12ae8e){return db['FaxApplication'][_0xdb28('0x45')](_0x2e5d51['body'],{})[_0xdb28('0x23')](respondWithResult(_0x12ae8e,0xc9))[_0xdb28('0x40')](handleError(_0x12ae8e,null));};exports[_0xdb28('0x46')]=function(_0x5e5ccf,_0x53464d){if(_0x5e5ccf[_0xdb28('0x47')]['id']){delete _0x5e5ccf[_0xdb28('0x47')]['id'];}return db[_0xdb28('0x2b')]['find']({'where':{'id':_0x5e5ccf[_0xdb28('0x41')]['id']}})[_0xdb28('0x23')](handleEntityNotFound(_0x53464d,null))[_0xdb28('0x23')](saveUpdates(_0x5e5ccf['body'],null))['then'](respondWithResult(_0x53464d,null))['catch'](handleError(_0x53464d,null));};exports[_0xdb28('0x24')]=function(_0x187f79,_0xc2d8d7){return db[_0xdb28('0x2b')][_0xdb28('0x44')]({'where':{'id':_0x187f79[_0xdb28('0x41')]['id']}})[_0xdb28('0x23')](handleEntityNotFound(_0xc2d8d7,null))[_0xdb28('0x23')](removeEntity(_0xc2d8d7,null))[_0xdb28('0x40')](handleError(_0xc2d8d7,null));}; \ No newline at end of file +var _0xd927=['../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','FaxApplication','fieldName','type','key','model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','moment','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x497ea0,_0x655799){var _0x559272=function(_0x1dd1fd){while(--_0x1dd1fd){_0x497ea0['push'](_0x497ea0['shift']());}};_0x559272(++_0x655799);}(_0xd927,0x1eb));var _0x7d92=function(_0x900f11,_0x207f78){_0x900f11=_0x900f11-0x0;var _0x27d255=_0xd927[_0x900f11];return _0x27d255;};'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('request-promise');var moment=require(_0x7d92('0x0'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7d92('0x1'));var path=require('path');var sox=require(_0x7d92('0x2'));var csv=require(_0x7d92('0x3'));var ejs=require(_0x7d92('0x4'));var fs=require('fs');var fs_extra=require(_0x7d92('0x5'));var _=require('lodash');var squel=require(_0x7d92('0x6'));var crypto=require(_0x7d92('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x7d92('0x8'));var toCsv=require(_0x7d92('0x3'));var querystring=require(_0x7d92('0x9'));var Papa=require(_0x7d92('0xa'));var Redis=require(_0x7d92('0xb'));var authService=require(_0x7d92('0xc'));var qs=require(_0x7d92('0xd'));var as=require(_0x7d92('0xe'));var hardwareService=require(_0x7d92('0xf'));var logger=require(_0x7d92('0x10'))(_0x7d92('0x11'));var utils=require(_0x7d92('0x12'));var config=require(_0x7d92('0x13'));var licenseUtil=require(_0x7d92('0x14'));var db=require(_0x7d92('0x15'))['db'];function respondWithStatusCode(_0x3ee2ab,_0x7a92f0){_0x7a92f0=_0x7a92f0||0xcc;return function(_0x506394){if(_0x506394){return _0x3ee2ab[_0x7d92('0x16')](_0x7a92f0);}return _0x3ee2ab['status'](_0x7a92f0)[_0x7d92('0x17')]();};}function respondWithResult(_0x251851,_0x4be42f){_0x4be42f=_0x4be42f||0xc8;return function(_0x11eb69){if(_0x11eb69){return _0x251851[_0x7d92('0x18')](_0x4be42f)['json'](_0x11eb69);}};}function respondWithFilteredResult(_0x4c4933,_0x737d22){return function(_0x44f5b3){if(_0x44f5b3){var _0x5f26b6=typeof _0x737d22[_0x7d92('0x19')]==='undefined'&&typeof _0x737d22[_0x7d92('0x1a')]===_0x7d92('0x1b');var _0x28acb3=_0x44f5b3[_0x7d92('0x1c')];var _0x13f16f=_0x5f26b6?0x0:_0x737d22['offset'];var _0x5d90a5=_0x5f26b6?_0x44f5b3[_0x7d92('0x1c')]:_0x737d22[_0x7d92('0x19')]+_0x737d22[_0x7d92('0x1a')];var _0x2f995a;if(_0x5d90a5>=_0x28acb3){_0x5d90a5=_0x28acb3;_0x2f995a=0xc8;}else{_0x2f995a=0xce;}_0x4c4933[_0x7d92('0x18')](_0x2f995a);return _0x4c4933[_0x7d92('0x1d')](_0x7d92('0x1e'),_0x13f16f+'-'+_0x5d90a5+'/'+_0x28acb3)[_0x7d92('0x1f')](_0x44f5b3);}return null;};}function patchUpdates(_0x1dfc4b){return function(_0x13a2b9){try{jsonpatch[_0x7d92('0x20')](_0x13a2b9,_0x1dfc4b,!![]);}catch(_0x3dfb0d){return BPromise['reject'](_0x3dfb0d);}return _0x13a2b9[_0x7d92('0x21')]();};}function saveUpdates(_0x538e1d,_0x22c4e9){return function(_0x1b90ac){if(_0x1b90ac){return _0x1b90ac[_0x7d92('0x22')](_0x538e1d)[_0x7d92('0x23')](function(_0x3b7478){return _0x3b7478;});}return null;};}function removeEntity(_0x95df00,_0x358c52){return function(_0x3bd62d){if(_0x3bd62d){return _0x3bd62d[_0x7d92('0x24')]()[_0x7d92('0x23')](function(){_0x95df00[_0x7d92('0x18')](0xcc)[_0x7d92('0x17')]();});}};}function handleEntityNotFound(_0x1cc803,_0x4edb40){return function(_0x4c2e90){if(!_0x4c2e90){_0x1cc803[_0x7d92('0x16')](0x194);}return _0x4c2e90;};}function handleError(_0xe70e5e,_0xfe50b3){_0xfe50b3=_0xfe50b3||0x1f4;return function(_0x4fb032){logger[_0x7d92('0x25')](_0x4fb032[_0x7d92('0x26')]);if(_0x4fb032[_0x7d92('0x27')]){delete _0x4fb032[_0x7d92('0x27')];}_0xe70e5e['status'](_0xfe50b3)[_0x7d92('0x28')](_0x4fb032);};}exports[_0x7d92('0x29')]=function(_0x6dbe45,_0x27befc){var _0x3396bb={},_0x3152de={},_0x533add={'count':0x0,'rows':[]};var _0x2e161a=_[_0x7d92('0x2a')](db[_0x7d92('0x2b')]['rawAttributes'],function(_0x525e36){return{'name':_0x525e36[_0x7d92('0x2c')],'type':_0x525e36[_0x7d92('0x2d')][_0x7d92('0x2e')]};});_0x3152de[_0x7d92('0x2f')]=_[_0x7d92('0x2a')](_0x2e161a,_0x7d92('0x27'));_0x3152de['query']=_[_0x7d92('0x30')](_0x6dbe45['query']);_0x3152de[_0x7d92('0x31')]=_[_0x7d92('0x32')](_0x3152de[_0x7d92('0x2f')],_0x3152de['query']);_0x3396bb['attributes']=_[_0x7d92('0x32')](_0x3152de['model'],qs[_0x7d92('0x33')](_0x6dbe45[_0x7d92('0x34')][_0x7d92('0x33')]));_0x3396bb[_0x7d92('0x35')]=_0x3396bb[_0x7d92('0x35')][_0x7d92('0x36')]?_0x3396bb['attributes']:_0x3152de['model'];if(!_0x6dbe45[_0x7d92('0x34')][_0x7d92('0x37')](_0x7d92('0x38'))){_0x3396bb[_0x7d92('0x1a')]=qs[_0x7d92('0x1a')](_0x6dbe45['query']['limit']);_0x3396bb['offset']=qs[_0x7d92('0x19')](_0x6dbe45[_0x7d92('0x34')][_0x7d92('0x19')]);}_0x3396bb[_0x7d92('0x39')]=qs[_0x7d92('0x3a')](_0x6dbe45[_0x7d92('0x34')][_0x7d92('0x3a')]);_0x3396bb[_0x7d92('0x3b')]=qs['filters'](_['pick'](_0x6dbe45[_0x7d92('0x34')],_0x3152de['filters']),_0x2e161a);if(_0x6dbe45[_0x7d92('0x34')][_0x7d92('0x3c')]){_0x3396bb['where']=_['merge'](_0x3396bb[_0x7d92('0x3b')],{'$or':_[_0x7d92('0x2a')](_0x2e161a,function(_0x2bebc7){if(_0x2bebc7[_0x7d92('0x2d')]!==_0x7d92('0x3d')){var _0x3bf7af={};_0x3bf7af[_0x2bebc7[_0x7d92('0x27')]]={'$like':'%'+_0x6dbe45['query'][_0x7d92('0x3c')]+'%'};return _0x3bf7af;}})});}_0x3396bb=_[_0x7d92('0x3e')]({},_0x3396bb,_0x6dbe45[_0x7d92('0x3f')]);var _0x55e11c={'where':_0x3396bb[_0x7d92('0x3b')]};return db[_0x7d92('0x2b')]['count'](_0x55e11c)[_0x7d92('0x23')](function(_0xa5f227){_0x533add[_0x7d92('0x1c')]=_0xa5f227;if(_0x6dbe45[_0x7d92('0x34')][_0x7d92('0x40')]){_0x3396bb[_0x7d92('0x41')]=[{'all':!![]}];}return db[_0x7d92('0x2b')][_0x7d92('0x42')](_0x3396bb);})[_0x7d92('0x23')](function(_0x27f329){_0x533add['rows']=_0x27f329;return _0x533add;})[_0x7d92('0x23')](respondWithFilteredResult(_0x27befc,_0x3396bb))[_0x7d92('0x43')](handleError(_0x27befc,null));};exports[_0x7d92('0x44')]=function(_0x49d556,_0x214282){var _0x4a5e12={'raw':!![],'where':{'id':_0x49d556[_0x7d92('0x45')]['id']}},_0x10e567={};_0x10e567[_0x7d92('0x2f')]=_['keys'](db[_0x7d92('0x2b')]['rawAttributes']);_0x10e567[_0x7d92('0x34')]=_[_0x7d92('0x30')](_0x49d556['query']);_0x10e567[_0x7d92('0x31')]=_[_0x7d92('0x32')](_0x10e567[_0x7d92('0x2f')],_0x10e567[_0x7d92('0x34')]);_0x4a5e12[_0x7d92('0x35')]=_['intersection'](_0x10e567[_0x7d92('0x2f')],qs[_0x7d92('0x33')](_0x49d556[_0x7d92('0x34')][_0x7d92('0x33')]));_0x4a5e12[_0x7d92('0x35')]=_0x4a5e12[_0x7d92('0x35')][_0x7d92('0x36')]?_0x4a5e12[_0x7d92('0x35')]:_0x10e567['model'];if(_0x49d556[_0x7d92('0x34')][_0x7d92('0x40')]){_0x4a5e12[_0x7d92('0x41')]=[{'all':!![]}];}_0x4a5e12=_[_0x7d92('0x3e')]({},_0x4a5e12,_0x49d556[_0x7d92('0x3f')]);return db[_0x7d92('0x2b')][_0x7d92('0x46')](_0x4a5e12)[_0x7d92('0x23')](handleEntityNotFound(_0x214282,null))[_0x7d92('0x23')](respondWithResult(_0x214282,null))['catch'](handleError(_0x214282,null));};exports[_0x7d92('0x47')]=function(_0x34110c,_0x218db9){return db[_0x7d92('0x2b')][_0x7d92('0x47')](_0x34110c[_0x7d92('0x48')],{})['then'](respondWithResult(_0x218db9,0xc9))[_0x7d92('0x43')](handleError(_0x218db9,null));};exports[_0x7d92('0x22')]=function(_0x23092d,_0x6752a9){if(_0x23092d['body']['id']){delete _0x23092d[_0x7d92('0x48')]['id'];}return db[_0x7d92('0x2b')][_0x7d92('0x46')]({'where':{'id':_0x23092d['params']['id']}})[_0x7d92('0x23')](handleEntityNotFound(_0x6752a9,null))['then'](saveUpdates(_0x23092d[_0x7d92('0x48')],null))['then'](respondWithResult(_0x6752a9,null))[_0x7d92('0x43')](handleError(_0x6752a9,null));};exports[_0x7d92('0x24')]=function(_0x40343b,_0xce854d){return db[_0x7d92('0x2b')][_0x7d92('0x46')]({'where':{'id':_0x40343b[_0x7d92('0x45')]['id']}})[_0x7d92('0x23')](handleEntityNotFound(_0xce854d,null))[_0x7d92('0x23')](removeEntity(_0xce854d,null))[_0x7d92('0x43')](handleError(_0xce854d,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 2123fe6..6a74b1c 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 _0x6dfa=['fax_applications','utf8mb4','../../config/logger','api','moment','request-promise','path','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x6dfa,0x7a));var _0xa6df=function(_0x22bf04,_0x119eea){_0x22bf04=_0x22bf04-0x0;var _0x1e9c8a=_0x6dfa[_0x22bf04];return _0x1e9c8a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa6df('0x0'))(_0xa6df('0x1'));var moment=require(_0xa6df('0x2'));var BPromise=require('bluebird');var rp=require(_0xa6df('0x3'));var fs=require('fs');var path=require(_0xa6df('0x4'));var rimraf=require('rimraf');var config=require(_0xa6df('0x5'));var attributes=require(_0xa6df('0x6'));module[_0xa6df('0x7')]=function(_0x4bf7ed,_0x3abc11){return _0x4bf7ed[_0xa6df('0x8')](_0xa6df('0x9'),attributes,{'tableName':_0xa6df('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa6df('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x5a94=['utf8mb4_unicode_ci','../../config/logger','moment','rimraf','./faxApplication.attributes','exports','utf8mb4'];(function(_0x5cc5b8,_0x18eeb2){var _0x54d755=function(_0x655836){while(--_0x655836){_0x5cc5b8['push'](_0x5cc5b8['shift']());}};_0x54d755(++_0x18eeb2);}(_0x5a94,0xe8));var _0x45a9=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x5a94[_0x13b02f];return _0x12e9a6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x45a9('0x0'))('api');var moment=require(_0x45a9('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x45a9('0x2'));var config=require('../../config/environment');var attributes=require(_0x45a9('0x3'));module[_0x45a9('0x4')]=function(_0x12abc9,_0x1859b4){return _0x12abc9['define']('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x45a9('0x5'),'collate':_0x45a9('0x6')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index e3a2c27..54052df 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 _0x6d6b=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','FaxApplication,\x20%s,\x20%s','message','catch','UpdateFaxApplication','FaxApplication','update','options','raw','where','attributes','limit','debug','lodash','util','bluebird'];(function(_0x264861,_0x3f9f6b){var _0x58b323=function(_0x4edf15){while(--_0x4edf15){_0x264861['push'](_0x264861['shift']());}};_0x58b323(++_0x3f9f6b);}(_0x6d6b,0x165));var _0xb6d6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6d6b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb6d6('0x0'));var util=require(_0xb6d6('0x1'));var moment=require('moment');var BPromise=require(_0xb6d6('0x2'));var rs=require(_0xb6d6('0x3'));var fs=require('fs');var Redis=require(_0xb6d6('0x4'));var db=require(_0xb6d6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb6d6('0x6'))(_0xb6d6('0x7'));var config=require(_0xb6d6('0x8'));var jayson=require(_0xb6d6('0x9'));var client=jayson['client'][_0xb6d6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e0114,_0x5da93e,_0x50934b){return new BPromise(function(_0x373cff,_0x5dc05b){return client[_0xb6d6('0xb')](_0x1e0114,_0x50934b)[_0xb6d6('0xc')](function(_0x4f4d65){logger[_0xb6d6('0xd')]('FaxApplication,\x20%s,\x20%s',_0x5da93e,_0xb6d6('0xe'));logger['debug'](_0xb6d6('0xf'),_0x5da93e,_0xb6d6('0xe'),JSON[_0xb6d6('0x10')](_0x4f4d65));if(_0x4f4d65[_0xb6d6('0x11')]){if(_0x4f4d65[_0xb6d6('0x11')]['code']===0x1f4){logger['error'](_0xb6d6('0x12'),_0x5da93e,_0x4f4d65[_0xb6d6('0x11')][_0xb6d6('0x13')]);return _0x5dc05b(_0x4f4d65[_0xb6d6('0x11')]['message']);}logger['error'](_0xb6d6('0x12'),_0x5da93e,_0x4f4d65[_0xb6d6('0x11')][_0xb6d6('0x13')]);return _0x373cff(_0x4f4d65[_0xb6d6('0x11')][_0xb6d6('0x13')]);}else{logger[_0xb6d6('0xd')](_0xb6d6('0x12'),_0x5da93e,_0xb6d6('0xe'));_0x373cff(_0x4f4d65['result']['message']);}})[_0xb6d6('0x14')](function(_0x15f005){logger[_0xb6d6('0x11')](_0xb6d6('0x12'),_0x5da93e,_0x15f005);_0x5dc05b(_0x15f005);});});}exports[_0xb6d6('0x15')]=function(_0x48265e){var _0x45c18a=this;return new Promise(function(_0x11d6bb,_0x3c95b8){return db[_0xb6d6('0x16')][_0xb6d6('0x17')](_0x48265e['body'],{'raw':_0x48265e[_0xb6d6('0x18')]?_0x48265e[_0xb6d6('0x18')][_0xb6d6('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48265e[_0xb6d6('0x18')]?_0x48265e['options'][_0xb6d6('0x1a')]||null:null,'attributes':_0x48265e[_0xb6d6('0x18')]?_0x48265e['options'][_0xb6d6('0x1b')]||null:null,'limit':_0x48265e['options']?_0x48265e[_0xb6d6('0x18')][_0xb6d6('0x1c')]||null:null})[_0xb6d6('0xc')](function(_0x2694b9){logger[_0xb6d6('0xd')]('UpdateFaxApplication',_0x48265e);logger[_0xb6d6('0x1d')](_0xb6d6('0x15'),_0x48265e,JSON['stringify'](_0x2694b9));_0x11d6bb(_0x2694b9);})[_0xb6d6('0x14')](function(_0x1761a6){logger['error'](_0xb6d6('0x15'),_0x1761a6[_0xb6d6('0x13')],_0x48265e);_0x3c95b8(_0x45c18a['error'](0x1f4,_0x1761a6[_0xb6d6('0x13')]));});});}; \ No newline at end of file +var _0xad1b=['code','FaxApplication,\x20%s,\x20%s','message','result','catch','FaxApplication','body','options','raw','where','attributes','limit','then','UpdateFaxApplication','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','error'];(function(_0x2950fc,_0x1219c6){var _0x4bbb25=function(_0x40f217){while(--_0x40f217){_0x2950fc['push'](_0x2950fc['shift']());}};_0x4bbb25(++_0x1219c6);}(_0xad1b,0x12f));var _0xbad1=function(_0x2f8d91,_0x208e5f){_0x2f8d91=_0x2f8d91-0x0;var _0x271286=_0xad1b[_0x2f8d91];return _0x271286;};'use strict';var _=require(_0xbad1('0x0'));var util=require(_0xbad1('0x1'));var moment=require(_0xbad1('0x2'));var BPromise=require(_0xbad1('0x3'));var rs=require(_0xbad1('0x4'));var fs=require('fs');var Redis=require(_0xbad1('0x5'));var db=require(_0xbad1('0x6'))['db'];var utils=require(_0xbad1('0x7'));var logger=require(_0xbad1('0x8'))(_0xbad1('0x9'));var config=require(_0xbad1('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbad1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34eb0e,_0xda4c5a,_0x36cb85){return new BPromise(function(_0x43f29a,_0x2b03ec){return client[_0xbad1('0xc')](_0x34eb0e,_0x36cb85)['then'](function(_0x26a11e){logger[_0xbad1('0xd')]('FaxApplication,\x20%s,\x20%s',_0xda4c5a,_0xbad1('0xe'));logger[_0xbad1('0xf')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0xda4c5a,_0xbad1('0xe'),JSON['stringify'](_0x26a11e));if(_0x26a11e[_0xbad1('0x10')]){if(_0x26a11e[_0xbad1('0x10')][_0xbad1('0x11')]===0x1f4){logger[_0xbad1('0x10')](_0xbad1('0x12'),_0xda4c5a,_0x26a11e[_0xbad1('0x10')][_0xbad1('0x13')]);return _0x2b03ec(_0x26a11e[_0xbad1('0x10')][_0xbad1('0x13')]);}logger[_0xbad1('0x10')](_0xbad1('0x12'),_0xda4c5a,_0x26a11e[_0xbad1('0x10')][_0xbad1('0x13')]);return _0x43f29a(_0x26a11e['error']['message']);}else{logger[_0xbad1('0xd')]('FaxApplication,\x20%s,\x20%s',_0xda4c5a,_0xbad1('0xe'));_0x43f29a(_0x26a11e[_0xbad1('0x14')][_0xbad1('0x13')]);}})[_0xbad1('0x15')](function(_0x2fc162){logger['error']('FaxApplication,\x20%s,\x20%s',_0xda4c5a,_0x2fc162);_0x2b03ec(_0x2fc162);});});}exports['UpdateFaxApplication']=function(_0x436de4){var _0x621f2=this;return new Promise(function(_0xde0cca,_0x359765){return db[_0xbad1('0x16')]['update'](_0x436de4[_0xbad1('0x17')],{'raw':_0x436de4['options']?_0x436de4[_0xbad1('0x18')][_0xbad1('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x436de4[_0xbad1('0x18')]?_0x436de4[_0xbad1('0x18')][_0xbad1('0x1a')]||null:null,'attributes':_0x436de4[_0xbad1('0x18')]?_0x436de4[_0xbad1('0x18')][_0xbad1('0x1b')]||null:null,'limit':_0x436de4[_0xbad1('0x18')]?_0x436de4[_0xbad1('0x18')][_0xbad1('0x1c')]||null:null})[_0xbad1('0x1d')](function(_0x164272){logger['info'](_0xbad1('0x1e'),_0x436de4);logger[_0xbad1('0xf')](_0xbad1('0x1e'),_0x436de4,JSON[_0xbad1('0x1f')](_0x164272));_0xde0cca(_0x164272);})[_0xbad1('0x15')](function(_0x5a98d6){logger[_0xbad1('0x10')](_0xbad1('0x1e'),_0x5a98d6[_0xbad1('0x13')],_0x436de4);_0x359765(_0x621f2[_0xbad1('0x10')](0x1f4,_0x5a98d6[_0xbad1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 41b5520..62c0e3a 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 _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x24709b,_0x2e9d6d){_0x24709b=_0x24709b-0x0;var _0xb51589=_0x9ffd[_0x24709b];return _0xb51589;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file +var _0xb10b=['./faxApplication.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x86c61b,_0x3b6335){var _0x40d661=function(_0x28efbc){while(--_0x28efbc){_0x86c61b['push'](_0x86c61b['shift']());}};_0x40d661(++_0x3b6335);}(_0xb10b,0x12a));var _0xbb10=function(_0x4d417e,_0x3f0f60){_0x4d417e=_0x4d417e-0x0;var _0x34fb1d=_0xb10b[_0x4d417e];return _0x34fb1d;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 52140de..f1d645b 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 _0x40d3=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x40d3,0x14f));var _0x340d=function(_0x3deaa8,_0x451abe){_0x3deaa8=_0x3deaa8-0x0;var _0x5227c2=_0x40d3[_0x3deaa8];return _0x5227c2;};'use strict';var Sequelize=require(_0x340d('0x0'));module[_0x340d('0x1')]={'closed':{'type':Sequelize[_0x340d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x340d('0x3')]},'disposition':{'type':Sequelize[_0x340d('0x4')]},'secondDisposition':{'type':Sequelize[_0x340d('0x4')]},'thirdDisposition':{'type':Sequelize[_0x340d('0x4')]},'note':{'type':Sequelize[_0x340d('0x4')]},'read1stAt':{'type':Sequelize[_0x340d('0x3')]},'fax':{'type':Sequelize[_0x340d('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x340d('0x5')]('in',_0x340d('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x340d('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x340d('0x5')]('in',_0x340d('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x8e8a=['STRING','ENUM','out','sequelize','BOOLEAN','DATE'];(function(_0x579e83,_0x1d9b3d){var _0x212cce=function(_0x4e6f4d){while(--_0x4e6f4d){_0x579e83['push'](_0x579e83['shift']());}};_0x212cce(++_0x1d9b3d);}(_0x8e8a,0x1ad));var _0xa8e8=function(_0x281918,_0xb2b078){_0x281918=_0x281918-0x0;var _0x359ab1=_0x8e8a[_0x281918];return _0x359ab1;};'use strict';var Sequelize=require(_0xa8e8('0x0'));module['exports']={'closed':{'type':Sequelize[_0xa8e8('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa8e8('0x2')]},'disposition':{'type':Sequelize[_0xa8e8('0x3')]},'secondDisposition':{'type':Sequelize[_0xa8e8('0x3')]},'thirdDisposition':{'type':Sequelize[_0xa8e8('0x3')]},'note':{'type':Sequelize[_0xa8e8('0x3')]},'read1stAt':{'type':Sequelize[_0xa8e8('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0xa8e8('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa8e8('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xa8e8('0x4')]('in',_0xa8e8('0x5')),'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 1d62d81..82cfc0c 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 _0x865b=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','error','stack','name','index','fieldName','key','getOptions','findAll','fax','query','catch','show','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','include','merge','options','FaxInteraction','create','body','find','destroy','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','nolimit','order','sort','where','pick','FaxInteractionId','filter','map','$gte','split','format','setTags','spread','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','files','tmp','root','server','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','existsSync','createReadStream','pipe','createWriteStream','basename','unlinkSync','rimraf','zip-dir','moment','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket'];(function(_0x441e17,_0x340ea9){var _0x3c9eb4=function(_0x3b941f){while(--_0x3b941f){_0x441e17['push'](_0x441e17['shift']());}};_0x3c9eb4(++_0x340ea9);}(_0x865b,0x18c));var _0xb865=function(_0x4b245d,_0x4f2abd){_0x4b245d=_0x4b245d-0x0;var _0x2d3a29=_0x865b[_0x4b245d];return _0x2d3a29;};'use strict';var rimraf=require(_0xb865('0x0'));var zipdir=require(_0xb865('0x1'));var moment=require(_0xb865('0x2'));var BPromise=require('bluebird');var util=require(_0xb865('0x3'));var path=require(_0xb865('0x4'));var fs=require('fs');var _=require(_0xb865('0x5'));var Redis=require(_0xb865('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0xb865('0x7'));var logger=require(_0xb865('0x8'))('api');var config=require(_0xb865('0x9'));var db=require(_0xb865('0xa'))['db'];config[_0xb865('0xb')]=_[_0xb865('0xc')](config[_0xb865('0xb')],{'host':_0xb865('0xd'),'port':0x18eb});var socket=require(_0xb865('0xe'))(new Redis(config[_0xb865('0xb')]));require(_0xb865('0xf'))['register'](socket);function respondWithStatusCode(_0x59c3d2,_0x49dcb9){_0x49dcb9=_0x49dcb9||0xcc;return function(_0xfd702){if(_0xfd702){return _0x59c3d2[_0xb865('0x10')](_0x49dcb9);}return _0x59c3d2[_0xb865('0x11')](_0x49dcb9)[_0xb865('0x12')]();};}function respondWithResult(_0x5854fc,_0x3131b0){_0x3131b0=_0x3131b0||0xc8;return function(_0x2a1f26){if(_0x2a1f26){return _0x5854fc[_0xb865('0x11')](_0x3131b0)[_0xb865('0x13')](_0x2a1f26);}};}function respondWithFilteredResult(_0x58fd6f,_0x54f00b){return function(_0x5f0f8a){if(_0x5f0f8a){var _0x25dad9=typeof _0x54f00b[_0xb865('0x14')]===_0xb865('0x15')&&typeof _0x54f00b[_0xb865('0x16')]==='undefined';var _0x546d97=_0x5f0f8a[_0xb865('0x17')];var _0x36d271=_0x25dad9?0x0:_0x54f00b['offset'];var _0x389d59=_0x25dad9?_0x5f0f8a['count']:_0x54f00b[_0xb865('0x14')]+_0x54f00b[_0xb865('0x16')];var _0x40a19b;if(_0x389d59>=_0x546d97){_0x389d59=_0x546d97;_0x40a19b=0xc8;}else{_0x40a19b=0xce;}_0x58fd6f[_0xb865('0x11')](_0x40a19b);return _0x58fd6f[_0xb865('0x18')](_0xb865('0x19'),_0x36d271+'-'+_0x389d59+'/'+_0x546d97)[_0xb865('0x13')](_0x5f0f8a);}return null;};}function saveUpdates(_0x8064cf){return function(_0x326f90){if(_0x326f90){return _0x326f90[_0xb865('0x1a')](_0x8064cf)['then'](function(_0x2cef7f){return _0x2cef7f;});}return null;};}function removeEntity(_0x3a30e8){return function(_0x1846d9){if(_0x1846d9){return _0x1846d9['destroy']()[_0xb865('0x1b')](function(){_0x3a30e8['status'](0xcc)[_0xb865('0x12')]();});}};}function handleEntityNotFound(_0x31e742){return function(_0x471faa){if(!_0x471faa){_0x31e742['sendStatus'](0x194);}return _0x471faa;};}function handleError(_0x3406d0,_0x3304e8){_0x3304e8=_0x3304e8||0x1f4;return function(_0x27d5c3){logger[_0xb865('0x1c')](_0x27d5c3[_0xb865('0x1d')]);if(_0x27d5c3[_0xb865('0x1e')]){delete _0x27d5c3[_0xb865('0x1e')];}_0x3406d0[_0xb865('0x11')](_0x3304e8)['send'](_0x27d5c3);};}exports[_0xb865('0x1f')]=function(_0x2e1e4c,_0x240dde){var _0x501d15={};var _0x3da187=_['map'](db['FaxInteraction']['rawAttributes'],function(_0x36a91d){return{'name':_0x36a91d[_0xb865('0x20')],'type':_0x36a91d['type'][_0xb865('0x21')]};});_0x501d15=qs[_0xb865('0x22')](_0x3da187,_0x2e1e4c);return interaction[_0xb865('0x23')](_0xb865('0x24'),_0x2e1e4c[_0xb865('0x25')],_0x2e1e4c['user'],_0x501d15,_0x3da187)[_0xb865('0x1b')](respondWithFilteredResult(_0x240dde,_0x501d15))[_0xb865('0x26')](handleError(_0x240dde,null));};exports[_0xb865('0x27')]=function(_0x48c1b9,_0x1223a6){var _0x597f00={'raw':![],'where':{'id':_0x48c1b9[_0xb865('0x28')]['id']}},_0x51b535={};_0x51b535[_0xb865('0x29')]=_[_0xb865('0x2a')](db['FaxInteraction'][_0xb865('0x2b')]);_0x51b535[_0xb865('0x25')]=_[_0xb865('0x2a')](_0x48c1b9[_0xb865('0x25')]);_0x51b535[_0xb865('0x2c')]=_[_0xb865('0x2d')](_0x51b535[_0xb865('0x29')],_0x51b535[_0xb865('0x25')]);_0x597f00[_0xb865('0x2e')]=_['intersection'](_0x51b535[_0xb865('0x29')],qs[_0xb865('0x2f')](_0x48c1b9['query'][_0xb865('0x2f')]));_0x597f00[_0xb865('0x2e')]=_0x597f00['attributes'][_0xb865('0x30')]?_0x597f00[_0xb865('0x2e')]:_0x51b535[_0xb865('0x29')];if(_0x48c1b9[_0xb865('0x25')][_0xb865('0x31')]){_0x597f00[_0xb865('0x32')]=[{'all':!![]}];}_0x597f00=_[_0xb865('0x33')]({},_0x597f00,_0x48c1b9[_0xb865('0x34')]);return db[_0xb865('0x35')]['find'](_0x597f00)[_0xb865('0x1b')](handleEntityNotFound(_0x1223a6,null))[_0xb865('0x1b')](respondWithResult(_0x1223a6,null))[_0xb865('0x26')](handleError(_0x1223a6,null));};exports['create']=function(_0x4d9ca3,_0x1ad173){return db[_0xb865('0x35')][_0xb865('0x36')](_0x4d9ca3[_0xb865('0x37')],{})[_0xb865('0x1b')](respondWithResult(_0x1ad173,0xc9))[_0xb865('0x26')](handleError(_0x1ad173,null));};exports[_0xb865('0x1a')]=function(_0x5adc8c,_0xb2ed41){if(_0x5adc8c[_0xb865('0x37')]['id']){delete _0x5adc8c[_0xb865('0x37')]['id'];}return db[_0xb865('0x35')][_0xb865('0x38')]({'where':{'id':_0x5adc8c[_0xb865('0x28')]['id']}})['then'](handleEntityNotFound(_0xb2ed41,null))[_0xb865('0x1b')](saveUpdates(_0x5adc8c[_0xb865('0x37')],null))[_0xb865('0x1b')](respondWithResult(_0xb2ed41,null))['catch'](handleError(_0xb2ed41,null));};exports[_0xb865('0x39')]=function(_0xc66dad,_0x3e3abc){return db['FaxInteraction'][_0xb865('0x38')]({'where':{'id':_0xc66dad[_0xb865('0x28')]['id']}})[_0xb865('0x1b')](handleEntityNotFound(_0x3e3abc,null))[_0xb865('0x1b')](removeEntity(_0x3e3abc,null))[_0xb865('0x26')](handleError(_0x3e3abc,null));};exports[_0xb865('0x3a')]=function(_0x3bbdc2,_0xd906e7){return db[_0xb865('0x35')][_0xb865('0x3a')]()[_0xb865('0x1b')](respondWithResult(_0xd906e7,null))[_0xb865('0x26')](handleError(_0xd906e7,null));};exports[_0xb865('0x3b')]=function(_0x4d0d56,_0x3e367a){return db[_0xb865('0x3c')]['find']({'where':{'id':_0x4d0d56[_0xb865('0x28')]['id']}})[_0xb865('0x1b')](handleEntityNotFound(_0x3e367a,null))[_0xb865('0x1b')](function(_0x573469){if(_0x573469){return _0x573469[_0xb865('0x3b')](_0x4d0d56[_0xb865('0x37')][_0xb865('0x3d')],_[_0xb865('0x3e')](_0x4d0d56['body'],[_0xb865('0x3d'),'id'])||{});}})['then'](respondWithResult(_0x3e367a,null))[_0xb865('0x26')](handleError(_0x3e367a,null));};exports[_0xb865('0x3f')]=function(_0x49f282,_0x47f6d4){var _0x2555d6={'raw':![],'where':{}};var _0x31f079={};var _0x3a211e={'count':0x0,'rows':[]};return db[_0xb865('0x35')][_0xb865('0x40')]({'where':{'id':_0x49f282['params']['id']}})['then'](handleEntityNotFound(_0x47f6d4,null))[_0xb865('0x1b')](function(_0x4adb24){if(_0x4adb24){_0x31f079[_0xb865('0x29')]=_[_0xb865('0x2a')](db[_0xb865('0x3c')][_0xb865('0x2b')]);_0x31f079[_0xb865('0x25')]=_[_0xb865('0x2a')](_0x49f282[_0xb865('0x25')]);_0x31f079['filters']=_[_0xb865('0x2d')](_0x31f079[_0xb865('0x29')],_0x31f079['query']);_0x2555d6['attributes']=_[_0xb865('0x2d')](_0x31f079['model'],qs[_0xb865('0x2f')](_0x49f282[_0xb865('0x25')]['fields']));_0x2555d6[_0xb865('0x2e')]=_0x2555d6[_0xb865('0x2e')][_0xb865('0x30')]?_0x2555d6['attributes']:_0x31f079[_0xb865('0x29')];if(!_0x49f282['query']['hasOwnProperty'](_0xb865('0x41'))){_0x2555d6[_0xb865('0x16')]=qs[_0xb865('0x16')](_0x49f282[_0xb865('0x25')][_0xb865('0x16')]);_0x2555d6['offset']=qs[_0xb865('0x14')](_0x49f282[_0xb865('0x25')][_0xb865('0x14')]);}_0x2555d6[_0xb865('0x42')]=qs[_0xb865('0x43')](_0x49f282[_0xb865('0x25')][_0xb865('0x43')]);_0x2555d6[_0xb865('0x44')]=qs['filters'](_[_0xb865('0x45')](_0x49f282['query'],_0x31f079[_0xb865('0x2c')]));_0x2555d6['where'][_0xb865('0x46')]=_0x4adb24['id'];if(_0x49f282[_0xb865('0x25')][_0xb865('0x47')]){_0x2555d6[_0xb865('0x44')]=_['merge'](_0x2555d6[_0xb865('0x44')],{'$or':_[_0xb865('0x48')](_0x2555d6[_0xb865('0x2e')],function(_0x21c28f){var _0x4067c4={};_0x4067c4[_0x21c28f]={'$like':'%'+_0x49f282[_0xb865('0x25')]['filter']+'%'};return _0x4067c4;})});}if(_0x49f282['query'][_0xb865('0x49')]){var _0x38bff8=_0x49f282[_0xb865('0x25')][_0xb865('0x49')][_0xb865('0x4a')](',');var _0x243484={};_0x243484[_0x38bff8[0x0]]={'$gte':moment(_0x38bff8[0x1])[_0xb865('0x4b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2555d6[_0xb865('0x44')]=_[_0xb865('0x33')](_0x2555d6[_0xb865('0x44')],_0x243484);}_0x2555d6=_['merge']({},_0x2555d6,_0x49f282[_0xb865('0x34')]);return db[_0xb865('0x3c')]['count']({'where':_0x2555d6[_0xb865('0x44')]})[_0xb865('0x1b')](function(_0x2cfdf1){_0x3a211e[_0xb865('0x17')]=_0x2cfdf1;if(_0x49f282[_0xb865('0x25')]['includeAll']){_0x2555d6['include']=[{'all':!![]}];}return db[_0xb865('0x3c')][_0xb865('0x23')](_0x2555d6);})[_0xb865('0x1b')](function(_0x269b8e){_0x3a211e['rows']=_0x269b8e;return _0x3a211e;});}})[_0xb865('0x1b')](respondWithFilteredResult(_0x47f6d4,_0x2555d6))[_0xb865('0x26')](handleError(_0x47f6d4,null));};exports['addTags']=function(_0x414cca,_0xf856e0){return db[_0xb865('0x35')][_0xb865('0x38')]({'where':{'id':_0x414cca[_0xb865('0x28')]['id']}})[_0xb865('0x1b')](handleEntityNotFound(_0xf856e0,null))[_0xb865('0x1b')](function(_0x555eff){if(_0x555eff){return _0x555eff[_0xb865('0x4c')](_0x414cca[_0xb865('0x37')]['ids'],_['omit'](_0x414cca[_0xb865('0x37')],['ids','id'])||{})[_0xb865('0x4d')](function(){return db[_0xb865('0x4e')]['findAll']({'attributes':['id',_0xb865('0x1e'),_0xb865('0x4f')],'where':{'id':_0x414cca['body'][_0xb865('0x3d')]}});})['then'](function(_0x3e7919){socket[_0xb865('0x50')](_0xb865('0x51'),{'id':Number(_0x414cca[_0xb865('0x28')]['id']),'tags':_0x3e7919||[]});return{'id':Number(_0x414cca[_0xb865('0x28')]['id']),'tags':_0x3e7919||[]};});}})[_0xb865('0x1b')](respondWithResult(_0xf856e0,null))['catch'](handleError(_0xf856e0,null));};exports['removeTags']=function(_0x47cf69,_0x1c76a9){return db[_0xb865('0x35')][_0xb865('0x38')]({'where':{'id':_0x47cf69[_0xb865('0x28')]['id']}})[_0xb865('0x1b')](handleEntityNotFound(_0x1c76a9,null))[_0xb865('0x1b')](function(_0x2543c4){if(_0x2543c4){return _0x2543c4[_0xb865('0x52')](_0x47cf69[_0xb865('0x25')][_0xb865('0x3d')]);}})[_0xb865('0x1b')](respondWithStatusCode(_0x1c76a9,null))[_0xb865('0x26')](handleError(_0x1c76a9,null));};exports[_0xb865('0x53')]=function(_0xccdf30,_0x2d7574){var _0x497006=moment()[_0xb865('0x54')]()[_0xb865('0x55')]();var _0x1b01cf=path[_0xb865('0x56')](config['root'],'server',_0xb865('0x57'),_0xb865('0x58'));var _0x5a21cf=path['join'](config[_0xb865('0x59')],_0xb865('0x5a'),'files',_0xb865('0x5b'));var _0x39c711=path[_0xb865('0x56')](_0x1b01cf,_0x497006);var _0x2abbd5=util[_0xb865('0x4b')](_0xb865('0x5c'),_0xccdf30[_0xb865('0x28')]['id'],_0x497006);var _0x1ae71d=path[_0xb865('0x56')](_0x1b01cf,_0x2abbd5);var _0x434bbb=[];_0x434bbb[_0xb865('0x5d')]({'model':db[_0xb865('0x5e')],'as':_0xb865('0x5e'),'raw':!![]});var _0x205125=[{'model':db['FaxMessage'],'as':_0xb865('0x5f'),'attributes':['id',_0xb865('0x37'),_0xb865('0x60')],'include':_0x434bbb}];return db['FaxInteraction'][_0xb865('0x38')]({'where':{'id':_0xccdf30[_0xb865('0x28')]['id']},'include':_0x205125})[_0xb865('0x1b')](handleEntityNotFound(_0x2d7574,null))[_0xb865('0x1b')](function(_0x4b2fa0){if(_0x4b2fa0&&_0x4b2fa0['Messages']){var _0x5974f4=_0x4b2fa0['get']({'plain':!![]});fs['mkdirSync'](_0x39c711);for(var _0x18fc05=0x0;_0x18fc05<_0x5974f4[_0xb865('0x5f')][_0xb865('0x30')];_0x18fc05++){var _0x4139dc=_0x5974f4[_0xb865('0x5f')][_0x18fc05][_0xb865('0x5e')];if(_0x4139dc){var _0x34c841=path['join'](_0x5a21cf,_0x4139dc['basename']);if(fs[_0xb865('0x61')](_0x34c841)){fs[_0xb865('0x62')](_0x34c841)[_0xb865('0x63')](fs[_0xb865('0x64')](path[_0xb865('0x56')](_0x39c711,_0x4139dc[_0xb865('0x65')])));}}}return BPromise['resolve']()[_0xb865('0x1b')](function(){return new BPromise(function(_0x1cc715,_0x7d6e94){zipdir(_0x39c711,{'saveTo':_0x1ae71d},function(_0x30e559,_0x3d9f6){if(_0x30e559)return _0x7d6e94(_0x30e559);return _0x1cc715(_0x3d9f6);});})[_0xb865('0x1b')](function(){return new BPromise(function(_0x582744,_0x3e426c){rimraf(_0x39c711,function(_0x655197){if(_0x655197)_0x3e426c(_0x655197);return _0x582744();});});})[_0xb865('0x1b')](function(){return _0x2d7574['download'](_0x1ae71d,_0x2abbd5,function(_0x985942){if(_0x985942){console['log']('err',_0x985942);}else{fs[_0xb865('0x66')](_0x1ae71d);}});});});}else{return _0x2d7574[_0xb865('0x10')](0xc8);}})[_0xb865('0x26')](handleError(_0x2d7574,null));}; \ No newline at end of file +var _0x1fdd=['addTags','setTags','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Messages','get','mkdirSync','createReadStream','pipe','resolve','err','unlinkSync','rimraf','zip-dir','moment','path','lodash','ioredis','../../components/parsers/qs','../../config/environment','defaults','socket.io-emitter','redis','./faxInteraction.socket','register','sendStatus','end','status','offset','undefined','limit','count','Content-Range','update','then','error','stack','name','send','FaxInteraction','rawAttributes','fieldName','key','query','user','catch','show','model','keys','attributes','intersection','fields','length','includeAll','merge','options','create','body','find','params','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','filters','hasOwnProperty','nolimit','order','sort','where','pick','FaxInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x1fdd,0x19f));var _0xd1fd=function(_0x22c718,_0x4126b8){_0x22c718=_0x22c718-0x0;var _0x921848=_0x1fdd[_0x22c718];return _0x921848;};'use strict';var rimraf=require(_0xd1fd('0x0'));var zipdir=require(_0xd1fd('0x1'));var moment=require(_0xd1fd('0x2'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xd1fd('0x3'));var fs=require('fs');var _=require(_0xd1fd('0x4'));var Redis=require(_0xd1fd('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0xd1fd('0x6'));var logger=require('../../config/logger')('api');var config=require(_0xd1fd('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd1fd('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd1fd('0x9'))(new Redis(config[_0xd1fd('0xa')]));require(_0xd1fd('0xb'))[_0xd1fd('0xc')](socket);function respondWithStatusCode(_0x2e0559,_0x2a7472){_0x2a7472=_0x2a7472||0xcc;return function(_0x1b4a2f){if(_0x1b4a2f){return _0x2e0559[_0xd1fd('0xd')](_0x2a7472);}return _0x2e0559['status'](_0x2a7472)[_0xd1fd('0xe')]();};}function respondWithResult(_0x348382,_0x5a8ec9){_0x5a8ec9=_0x5a8ec9||0xc8;return function(_0x59f931){if(_0x59f931){return _0x348382[_0xd1fd('0xf')](_0x5a8ec9)['json'](_0x59f931);}};}function respondWithFilteredResult(_0x26d766,_0x27fafe){return function(_0x10bd94){if(_0x10bd94){var _0x21028f=typeof _0x27fafe[_0xd1fd('0x10')]===_0xd1fd('0x11')&&typeof _0x27fafe[_0xd1fd('0x12')]===_0xd1fd('0x11');var _0x3099fe=_0x10bd94['count'];var _0x1b80ca=_0x21028f?0x0:_0x27fafe[_0xd1fd('0x10')];var _0x3ea084=_0x21028f?_0x10bd94[_0xd1fd('0x13')]:_0x27fafe[_0xd1fd('0x10')]+_0x27fafe[_0xd1fd('0x12')];var _0x4ea348;if(_0x3ea084>=_0x3099fe){_0x3ea084=_0x3099fe;_0x4ea348=0xc8;}else{_0x4ea348=0xce;}_0x26d766[_0xd1fd('0xf')](_0x4ea348);return _0x26d766['set'](_0xd1fd('0x14'),_0x1b80ca+'-'+_0x3ea084+'/'+_0x3099fe)['json'](_0x10bd94);}return null;};}function saveUpdates(_0x74560){return function(_0x1fbeef){if(_0x1fbeef){return _0x1fbeef[_0xd1fd('0x15')](_0x74560)[_0xd1fd('0x16')](function(_0x51ed01){return _0x51ed01;});}return null;};}function removeEntity(_0x2043d4){return function(_0x1c6e61){if(_0x1c6e61){return _0x1c6e61['destroy']()['then'](function(){_0x2043d4[_0xd1fd('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c92f8){return function(_0x38ab08){if(!_0x38ab08){_0x3c92f8[_0xd1fd('0xd')](0x194);}return _0x38ab08;};}function handleError(_0x443457,_0x16519b){_0x16519b=_0x16519b||0x1f4;return function(_0x31958f){logger[_0xd1fd('0x17')](_0x31958f[_0xd1fd('0x18')]);if(_0x31958f[_0xd1fd('0x19')]){delete _0x31958f['name'];}_0x443457[_0xd1fd('0xf')](_0x16519b)[_0xd1fd('0x1a')](_0x31958f);};}exports['index']=function(_0x208775,_0x5b108c){var _0x31bf1f={};var _0x10e12f=_['map'](db[_0xd1fd('0x1b')][_0xd1fd('0x1c')],function(_0x4093cb){return{'name':_0x4093cb[_0xd1fd('0x1d')],'type':_0x4093cb['type'][_0xd1fd('0x1e')]};});_0x31bf1f=qs['getOptions'](_0x10e12f,_0x208775);return interaction['findAll']('fax',_0x208775[_0xd1fd('0x1f')],_0x208775[_0xd1fd('0x20')],_0x31bf1f,_0x10e12f)['then'](respondWithFilteredResult(_0x5b108c,_0x31bf1f))[_0xd1fd('0x21')](handleError(_0x5b108c,null));};exports[_0xd1fd('0x22')]=function(_0x13dcd4,_0xe7a804){var _0x41fe51={'raw':![],'where':{'id':_0x13dcd4['params']['id']}},_0x37f887={};_0x37f887[_0xd1fd('0x23')]=_[_0xd1fd('0x24')](db[_0xd1fd('0x1b')][_0xd1fd('0x1c')]);_0x37f887[_0xd1fd('0x1f')]=_[_0xd1fd('0x24')](_0x13dcd4['query']);_0x37f887['filters']=_['intersection'](_0x37f887['model'],_0x37f887[_0xd1fd('0x1f')]);_0x41fe51[_0xd1fd('0x25')]=_[_0xd1fd('0x26')](_0x37f887[_0xd1fd('0x23')],qs['fields'](_0x13dcd4[_0xd1fd('0x1f')][_0xd1fd('0x27')]));_0x41fe51[_0xd1fd('0x25')]=_0x41fe51['attributes'][_0xd1fd('0x28')]?_0x41fe51['attributes']:_0x37f887[_0xd1fd('0x23')];if(_0x13dcd4[_0xd1fd('0x1f')][_0xd1fd('0x29')]){_0x41fe51['include']=[{'all':!![]}];}_0x41fe51=_[_0xd1fd('0x2a')]({},_0x41fe51,_0x13dcd4[_0xd1fd('0x2b')]);return db[_0xd1fd('0x1b')]['find'](_0x41fe51)[_0xd1fd('0x16')](handleEntityNotFound(_0xe7a804,null))['then'](respondWithResult(_0xe7a804,null))[_0xd1fd('0x21')](handleError(_0xe7a804,null));};exports[_0xd1fd('0x2c')]=function(_0x4eeb27,_0x432584){return db[_0xd1fd('0x1b')][_0xd1fd('0x2c')](_0x4eeb27[_0xd1fd('0x2d')],{})[_0xd1fd('0x16')](respondWithResult(_0x432584,0xc9))['catch'](handleError(_0x432584,null));};exports[_0xd1fd('0x15')]=function(_0x59a3c0,_0x312d32){if(_0x59a3c0[_0xd1fd('0x2d')]['id']){delete _0x59a3c0['body']['id'];}return db[_0xd1fd('0x1b')][_0xd1fd('0x2e')]({'where':{'id':_0x59a3c0[_0xd1fd('0x2f')]['id']}})[_0xd1fd('0x16')](handleEntityNotFound(_0x312d32,null))[_0xd1fd('0x16')](saveUpdates(_0x59a3c0['body'],null))[_0xd1fd('0x16')](respondWithResult(_0x312d32,null))[_0xd1fd('0x21')](handleError(_0x312d32,null));};exports['destroy']=function(_0x3324,_0x5a8759){return db[_0xd1fd('0x1b')]['find']({'where':{'id':_0x3324['params']['id']}})[_0xd1fd('0x16')](handleEntityNotFound(_0x5a8759,null))[_0xd1fd('0x16')](removeEntity(_0x5a8759,null))['catch'](handleError(_0x5a8759,null));};exports[_0xd1fd('0x30')]=function(_0x4fd0c5,_0x83f4b7){return db[_0xd1fd('0x1b')]['describe']()[_0xd1fd('0x16')](respondWithResult(_0x83f4b7,null))[_0xd1fd('0x21')](handleError(_0x83f4b7,null));};exports[_0xd1fd('0x31')]=function(_0x46a572,_0x30288b){return db[_0xd1fd('0x32')]['find']({'where':{'id':_0x46a572[_0xd1fd('0x2f')]['id']}})['then'](handleEntityNotFound(_0x30288b,null))['then'](function(_0x414e93){if(_0x414e93){return _0x414e93[_0xd1fd('0x31')](_0x46a572[_0xd1fd('0x2d')][_0xd1fd('0x33')],_[_0xd1fd('0x34')](_0x46a572[_0xd1fd('0x2d')],[_0xd1fd('0x33'),'id'])||{});}})[_0xd1fd('0x16')](respondWithResult(_0x30288b,null))[_0xd1fd('0x21')](handleError(_0x30288b,null));};exports[_0xd1fd('0x35')]=function(_0x13ec6b,_0x201042){var _0x36dc6b={'raw':![],'where':{}};var _0x360f4d={};var _0x5a888c={'count':0x0,'rows':[]};return db[_0xd1fd('0x1b')][_0xd1fd('0x36')]({'where':{'id':_0x13ec6b[_0xd1fd('0x2f')]['id']}})[_0xd1fd('0x16')](handleEntityNotFound(_0x201042,null))['then'](function(_0xb79411){if(_0xb79411){_0x360f4d[_0xd1fd('0x23')]=_[_0xd1fd('0x24')](db[_0xd1fd('0x32')]['rawAttributes']);_0x360f4d[_0xd1fd('0x1f')]=_[_0xd1fd('0x24')](_0x13ec6b[_0xd1fd('0x1f')]);_0x360f4d[_0xd1fd('0x37')]=_[_0xd1fd('0x26')](_0x360f4d[_0xd1fd('0x23')],_0x360f4d[_0xd1fd('0x1f')]);_0x36dc6b[_0xd1fd('0x25')]=_[_0xd1fd('0x26')](_0x360f4d[_0xd1fd('0x23')],qs[_0xd1fd('0x27')](_0x13ec6b[_0xd1fd('0x1f')][_0xd1fd('0x27')]));_0x36dc6b[_0xd1fd('0x25')]=_0x36dc6b['attributes'][_0xd1fd('0x28')]?_0x36dc6b[_0xd1fd('0x25')]:_0x360f4d['model'];if(!_0x13ec6b['query'][_0xd1fd('0x38')](_0xd1fd('0x39'))){_0x36dc6b[_0xd1fd('0x12')]=qs[_0xd1fd('0x12')](_0x13ec6b[_0xd1fd('0x1f')][_0xd1fd('0x12')]);_0x36dc6b[_0xd1fd('0x10')]=qs[_0xd1fd('0x10')](_0x13ec6b[_0xd1fd('0x1f')][_0xd1fd('0x10')]);}_0x36dc6b[_0xd1fd('0x3a')]=qs[_0xd1fd('0x3b')](_0x13ec6b[_0xd1fd('0x1f')][_0xd1fd('0x3b')]);_0x36dc6b[_0xd1fd('0x3c')]=qs['filters'](_[_0xd1fd('0x3d')](_0x13ec6b['query'],_0x360f4d['filters']));_0x36dc6b[_0xd1fd('0x3c')][_0xd1fd('0x3e')]=_0xb79411['id'];if(_0x13ec6b[_0xd1fd('0x1f')][_0xd1fd('0x3f')]){_0x36dc6b[_0xd1fd('0x3c')]=_['merge'](_0x36dc6b[_0xd1fd('0x3c')],{'$or':_[_0xd1fd('0x40')](_0x36dc6b['attributes'],function(_0x542bbb){var _0x3caa50={};_0x3caa50[_0x542bbb]={'$like':'%'+_0x13ec6b['query'][_0xd1fd('0x3f')]+'%'};return _0x3caa50;})});}if(_0x13ec6b[_0xd1fd('0x1f')][_0xd1fd('0x41')]){var _0x15cd5d=_0x13ec6b[_0xd1fd('0x1f')]['$gte'][_0xd1fd('0x42')](',');var _0x1b2bc6={};_0x1b2bc6[_0x15cd5d[0x0]]={'$gte':moment(_0x15cd5d[0x1])['format'](_0xd1fd('0x43'))};_0x36dc6b['where']=_[_0xd1fd('0x2a')](_0x36dc6b['where'],_0x1b2bc6);}_0x36dc6b=_[_0xd1fd('0x2a')]({},_0x36dc6b,_0x13ec6b[_0xd1fd('0x2b')]);return db['FaxMessage']['count']({'where':_0x36dc6b[_0xd1fd('0x3c')]})['then'](function(_0x30620a){_0x5a888c[_0xd1fd('0x13')]=_0x30620a;if(_0x13ec6b['query'][_0xd1fd('0x29')]){_0x36dc6b['include']=[{'all':!![]}];}return db[_0xd1fd('0x32')][_0xd1fd('0x44')](_0x36dc6b);})[_0xd1fd('0x16')](function(_0x224d8a){_0x5a888c[_0xd1fd('0x45')]=_0x224d8a;return _0x5a888c;});}})[_0xd1fd('0x16')](respondWithFilteredResult(_0x201042,_0x36dc6b))[_0xd1fd('0x21')](handleError(_0x201042,null));};exports[_0xd1fd('0x46')]=function(_0x17eade,_0x10eb9f){return db[_0xd1fd('0x1b')][_0xd1fd('0x2e')]({'where':{'id':_0x17eade[_0xd1fd('0x2f')]['id']}})[_0xd1fd('0x16')](handleEntityNotFound(_0x10eb9f,null))[_0xd1fd('0x16')](function(_0x125025){if(_0x125025){return _0x125025[_0xd1fd('0x47')](_0x17eade[_0xd1fd('0x2d')][_0xd1fd('0x33')],_[_0xd1fd('0x34')](_0x17eade[_0xd1fd('0x2d')],[_0xd1fd('0x33'),'id'])||{})[_0xd1fd('0x48')](function(){return db['Tag']['findAll']({'attributes':['id',_0xd1fd('0x19'),_0xd1fd('0x49')],'where':{'id':_0x17eade['body'][_0xd1fd('0x33')]}});})[_0xd1fd('0x16')](function(_0x49e037){socket[_0xd1fd('0x4a')](_0xd1fd('0x4b'),{'id':Number(_0x17eade[_0xd1fd('0x2f')]['id']),'tags':_0x49e037||[]});return{'id':Number(_0x17eade[_0xd1fd('0x2f')]['id']),'tags':_0x49e037||[]};});}})['then'](respondWithResult(_0x10eb9f,null))[_0xd1fd('0x21')](handleError(_0x10eb9f,null));};exports[_0xd1fd('0x4c')]=function(_0x4040a5,_0x5dccce){return db[_0xd1fd('0x1b')]['find']({'where':{'id':_0x4040a5[_0xd1fd('0x2f')]['id']}})['then'](handleEntityNotFound(_0x5dccce,null))[_0xd1fd('0x16')](function(_0x19968f){if(_0x19968f){return _0x19968f[_0xd1fd('0x4c')](_0x4040a5[_0xd1fd('0x1f')][_0xd1fd('0x33')]);}})[_0xd1fd('0x16')](respondWithStatusCode(_0x5dccce,null))['catch'](handleError(_0x5dccce,null));};exports[_0xd1fd('0x4d')]=function(_0x4944e4,_0xa7b864){var _0x5f199e=moment()[_0xd1fd('0x4e')]()[_0xd1fd('0x4f')]();var _0x49019e=path[_0xd1fd('0x50')](config[_0xd1fd('0x51')],_0xd1fd('0x52'),_0xd1fd('0x53'),_0xd1fd('0x54'));var _0x810ebb=path[_0xd1fd('0x50')](config[_0xd1fd('0x51')],'server',_0xd1fd('0x53'),_0xd1fd('0x55'));var _0x5e8d3c=path[_0xd1fd('0x50')](_0x49019e,_0x5f199e);var _0x37de8c=util['format'](_0xd1fd('0x56'),_0x4944e4[_0xd1fd('0x2f')]['id'],_0x5f199e);var _0x59db5b=path[_0xd1fd('0x50')](_0x49019e,_0x37de8c);var _0x3bf202=[];_0x3bf202[_0xd1fd('0x57')]({'model':db[_0xd1fd('0x58')],'as':_0xd1fd('0x58'),'raw':!![]});var _0x47d323=[{'model':db[_0xd1fd('0x32')],'as':_0xd1fd('0x59'),'attributes':['id',_0xd1fd('0x2d'),'createdAt'],'include':_0x3bf202}];return db[_0xd1fd('0x1b')][_0xd1fd('0x2e')]({'where':{'id':_0x4944e4['params']['id']},'include':_0x47d323})[_0xd1fd('0x16')](handleEntityNotFound(_0xa7b864,null))[_0xd1fd('0x16')](function(_0x18f9a1){if(_0x18f9a1&&_0x18f9a1[_0xd1fd('0x59')]){var _0x3ee0e1=_0x18f9a1[_0xd1fd('0x5a')]({'plain':!![]});fs[_0xd1fd('0x5b')](_0x5e8d3c);for(var _0x4eed3b=0x0;_0x4eed3b<_0x3ee0e1[_0xd1fd('0x59')][_0xd1fd('0x28')];_0x4eed3b++){var _0x4ce391=_0x3ee0e1['Messages'][_0x4eed3b][_0xd1fd('0x58')];if(_0x4ce391){var _0x56f81a=path[_0xd1fd('0x50')](_0x810ebb,_0x4ce391['basename']);if(fs['existsSync'](_0x56f81a)){fs[_0xd1fd('0x5c')](_0x56f81a)[_0xd1fd('0x5d')](fs['createWriteStream'](path[_0xd1fd('0x50')](_0x5e8d3c,_0x4ce391['basename'])));}}}return BPromise[_0xd1fd('0x5e')]()['then'](function(){return new BPromise(function(_0x5795fe,_0xdd6bab){zipdir(_0x5e8d3c,{'saveTo':_0x59db5b},function(_0x55ee1f,_0x1b903b){if(_0x55ee1f)return _0xdd6bab(_0x55ee1f);return _0x5795fe(_0x1b903b);});})['then'](function(){return new BPromise(function(_0x17fbf2,_0x4a3f28){rimraf(_0x5e8d3c,function(_0x40e8ba){if(_0x40e8ba)_0x4a3f28(_0x40e8ba);return _0x17fbf2();});});})[_0xd1fd('0x16')](function(){return _0xa7b864['download'](_0x59db5b,_0x37de8c,function(_0x4d777d){if(_0x4d777d){console['log'](_0xd1fd('0x5f'),_0x4d777d);}else{fs[_0xd1fd('0x60')](_0x59db5b);}});});});}else{return _0xa7b864[_0xd1fd('0xd')](0xc8);}})[_0xd1fd('0x21')](handleError(_0xa7b864,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 851f463..a10f7b7 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 _0x5927=['Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','setDataValue'];(function(_0xdfe01d,_0x4bcb05){var _0x48de04=function(_0x1bfdda){while(--_0x1bfdda){_0xdfe01d['push'](_0xdfe01d['shift']());}};_0x48de04(++_0x4bcb05);}(_0x5927,0x12a));var _0x7592=function(_0x4456a2,_0x376ff2){_0x4456a2=_0x4456a2-0x0;var _0xf36b56=_0x5927[_0x4456a2];return _0xf36b56;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x7592('0x0'))['db'][_0x7592('0x1')];var FaxMessage=require(_0x7592('0x0'))['db'][_0x7592('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x7592('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7592('0x4'),'afterDestroy':'remove'};function emitEvent(_0x53413c){return function(_0x47e5af,_0x35de31,_0x50b0ad){_0x47e5af['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x3a1f1c){_0x47e5af[_0x7592('0x5')](_0x7592('0x6'),_0x3a1f1c[_0x7592('0x7')](function(_0x38d4d3){return{'id':_0x38d4d3['id']};}));return FaxMessage[_0x7592('0x8')]({'where':{'FaxInteractionId':_0x47e5af['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x25eae8){_0x47e5af[_0x7592('0x5')](_0x7592('0x9'),_0x25eae8[_0x7592('0xa')]);FaxInteractionEvents[_0x7592('0xb')](_0x53413c+':'+_0x47e5af['id'],_0x47e5af);FaxInteractionEvents[_0x7592('0xb')](_0x53413c,_0x47e5af);_0x50b0ad(null);})[_0x7592('0xc')](_0x50b0ad(null));};}for(var e in events){if(events[_0x7592('0xd')](e)){var event=events[e];FaxInteraction[_0x7592('0xe')](e,emitEvent(event));}}module[_0x7592('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0xcb9b=['../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x3bab18,_0x53d735){var _0x12585f=function(_0x6cb5c4){while(--_0x6cb5c4){_0x3bab18['push'](_0x3bab18['shift']());}};_0x12585f(++_0x53d735);}(_0xcb9b,0xcb));var _0xbcb9=function(_0x28cf13,_0x26cf35){_0x28cf13=_0x28cf13-0x0;var _0x202155=_0xcb9b[_0x28cf13];return _0x202155;};'use strict';var EventEmitter=require(_0xbcb9('0x0'));var FaxInteraction=require(_0xbcb9('0x1'))['db'][_0xbcb9('0x2')];var FaxMessage=require(_0xbcb9('0x1'))['db'][_0xbcb9('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xbcb9('0x4')](0x0);var events={'afterCreate':_0xbcb9('0x5'),'afterUpdate':'update','afterDestroy':_0xbcb9('0x6')};function emitEvent(_0x239864){return function(_0x14ec9a,_0x32b292,_0x377d7c){_0x14ec9a[_0xbcb9('0x7')]({'attributes':['id'],'raw':!![]})[_0xbcb9('0x8')](function(_0x3e70da){_0x14ec9a[_0xbcb9('0x9')]('Users',_0x3e70da['map'](function(_0x258ded){return{'id':_0x258ded['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x14ec9a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbcb9('0x8')](function(_0x5825ab){_0x14ec9a[_0xbcb9('0x9')](_0xbcb9('0xa'),_0x5825ab[_0xbcb9('0xb')]);FaxInteractionEvents[_0xbcb9('0xc')](_0x239864+':'+_0x14ec9a['id'],_0x14ec9a);FaxInteractionEvents[_0xbcb9('0xc')](_0x239864,_0x14ec9a);_0x377d7c(null);})[_0xbcb9('0xd')](_0x377d7c(null));};}for(var e in events){if(events[_0xbcb9('0xe')](e)){var event=events[e];FaxInteraction[_0xbcb9('0xf')](e,emitEvent(event));}}module[_0xbcb9('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 369c2e5..65cda84 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 _0xedca=['../../config/logger','api','request-promise','path','rimraf','exports','FaxInteraction','fax_interactions','changed','closed','closedAt','format','lodash','util'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xedca,0x15c));var _0xaedc=function(_0x4556c1,_0x507828){_0x4556c1=_0x4556c1-0x0;var _0x4ec556=_0xedca[_0x4556c1];return _0x4ec556;};'use strict';var _=require(_0xaedc('0x0'));var util=require(_0xaedc('0x1'));var logger=require(_0xaedc('0x2'))(_0xaedc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaedc('0x4'));var fs=require('fs');var path=require(_0xaedc('0x5'));var rimraf=require(_0xaedc('0x6'));var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module[_0xaedc('0x7')]=function(_0x25babe,_0x4414dc){return _0x25babe['define'](_0xaedc('0x8'),attributes,{'tableName':_0xaedc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5217e5,_0x238f5b,_0x14e71a){if(_0x5217e5[_0xaedc('0xa')](_0xaedc('0xb'))){_0x5217e5[_0xaedc('0xc')]=moment()[_0xaedc('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x14e71a(null,_0x5217e5);}}});}; \ No newline at end of file +var _0xf365=['path','rimraf','../../config/environment','define','FaxInteraction','fax_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','api','bluebird','request-promise'];(function(_0x3dfeb9,_0x1cc6e4){var _0x412314=function(_0x321253){while(--_0x321253){_0x3dfeb9['push'](_0x3dfeb9['shift']());}};_0x412314(++_0x1cc6e4);}(_0xf365,0x1a0));var _0x5f36=function(_0x17249c,_0x168d62){_0x17249c=_0x17249c-0x0;var _0x324e7b=_0xf365[_0x17249c];return _0x324e7b;};'use strict';var _=require(_0x5f36('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5f36('0x1'));var moment=require('moment');var BPromise=require(_0x5f36('0x2'));var rp=require(_0x5f36('0x3'));var fs=require('fs');var path=require(_0x5f36('0x4'));var rimraf=require(_0x5f36('0x5'));var config=require(_0x5f36('0x6'));var attributes=require('./faxInteraction.attributes');module['exports']=function(_0xe0f49e,_0x29bf2d){return _0xe0f49e[_0x5f36('0x7')](_0x5f36('0x8'),attributes,{'tableName':_0x5f36('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a698e,_0x3c1776,_0x43d67e){if(_0x5a698e[_0x5f36('0xa')](_0x5f36('0xb'))){_0x5a698e[_0x5f36('0xc')]=moment()['format'](_0x5f36('0xd'));}_0x43d67e(null,_0x5a698e);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index fa2a107..ae57a20 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 _0x01c6=['../../config/logger','rpc','redis','defaults','localhost','./faxInteraction.socket','register','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','FaxInteraction,\x20%s,\x20%s','message','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','limit','catch','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x360619,_0x5075d2){var _0x59f98a=function(_0x47211d){while(--_0x47211d){_0x360619['push'](_0x360619['shift']());}};_0x59f98a(++_0x5075d2);}(_0x01c6,0xd7));var _0x601c=function(_0x40927b,_0xf9b0a0){_0x40927b=_0x40927b-0x0;var _0x2635e8=_0x01c6[_0x40927b];return _0x2635e8;};'use strict';var _=require(_0x601c('0x0'));var util=require(_0x601c('0x1'));var moment=require(_0x601c('0x2'));var BPromise=require(_0x601c('0x3'));var rs=require(_0x601c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x601c('0x5'))['db'];var utils=require(_0x601c('0x6'));var logger=require(_0x601c('0x7'))(_0x601c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x601c('0x9')]=_[_0x601c('0xa')](config[_0x601c('0x9')],{'host':_0x601c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x601c('0x9')]));require(_0x601c('0xc'))[_0x601c('0xd')](socket);function respondWithRpcPromise(_0x2a19ab,_0x1b8b73,_0x4ff6a6){return new BPromise(function(_0x10e50c,_0x4e7caa){return client['request'](_0x2a19ab,_0x4ff6a6)[_0x601c('0xe')](function(_0x1b1b54){logger[_0x601c('0xf')]('FaxInteraction,\x20%s,\x20%s',_0x1b8b73,_0x601c('0x10'));logger[_0x601c('0x11')](_0x601c('0x12'),_0x1b8b73,'request\x20sent',JSON[_0x601c('0x13')](_0x1b1b54));if(_0x1b1b54['error']){if(_0x1b1b54[_0x601c('0x14')]['code']===0x1f4){logger[_0x601c('0x14')](_0x601c('0x15'),_0x1b8b73,_0x1b1b54[_0x601c('0x14')][_0x601c('0x16')]);return _0x4e7caa(_0x1b1b54['error'][_0x601c('0x16')]);}logger[_0x601c('0x14')](_0x601c('0x15'),_0x1b8b73,_0x1b1b54[_0x601c('0x14')][_0x601c('0x16')]);return _0x10e50c(_0x1b1b54[_0x601c('0x14')][_0x601c('0x16')]);}else{logger[_0x601c('0xf')](_0x601c('0x15'),_0x1b8b73,_0x601c('0x10'));_0x10e50c(_0x1b1b54['result'][_0x601c('0x16')]);}})['catch'](function(_0x15796d){logger[_0x601c('0x14')](_0x601c('0x15'),_0x1b8b73,_0x15796d);_0x4e7caa(_0x15796d);});});}exports[_0x601c('0x17')]=function(_0x17c5a6){var _0x4f2b50=this;return new Promise(function(_0x4d0025,_0x58b68b){return db[_0x601c('0x18')][_0x601c('0x19')](_0x17c5a6[_0x601c('0x1a')],{'raw':_0x17c5a6[_0x601c('0x1b')]?_0x17c5a6['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17c5a6[_0x601c('0x1b')]?_0x17c5a6[_0x601c('0x1b')][_0x601c('0x1c')]||null:null,'attributes':_0x17c5a6[_0x601c('0x1b')]?_0x17c5a6['options'][_0x601c('0x1d')]||null:null,'limit':_0x17c5a6['options']?_0x17c5a6[_0x601c('0x1b')][_0x601c('0x1e')]||null:null})[_0x601c('0xe')](function(_0x3098ca){logger['info'](_0x601c('0x17'),_0x17c5a6);logger[_0x601c('0x11')]('UpdateFaxInteraction',_0x17c5a6,JSON[_0x601c('0x13')](_0x3098ca));_0x4d0025(_0x3098ca);})[_0x601c('0x1f')](function(_0x27e97e){logger['error'](_0x601c('0x17'),_0x27e97e[_0x601c('0x16')],_0x17c5a6);_0x58b68b(_0x4f2b50[_0x601c('0x14')](0x1f4,_0x27e97e[_0x601c('0x16')]));});});};exports['AddTagsToFaxInteraction']=function(_0xc7679e){return new Promise(function(_0x387e5f,_0x3c6456){return db[_0x601c('0x18')][_0x601c('0x20')]({'where':_0xc7679e[_0x601c('0x1b')]?_0xc7679e[_0x601c('0x1b')][_0x601c('0x1c')]||null:null})[_0x601c('0xe')](function(_0x345585){if(_0x345585){return _0x345585[_0x601c('0x21')](_0xc7679e['body'][_0x601c('0x22')],_['omit'](_0xc7679e['body'],[_0x601c('0x22'),'id'])||{});}})[_0x601c('0x23')](function(_0x40cd93){logger['info'](_0x601c('0x24'),_0xc7679e);logger[_0x601c('0x11')]('AddTags',_0xc7679e,JSON[_0x601c('0x13')](_0x40cd93));_0x387e5f(_0x40cd93);})[_0x601c('0x1f')](function(_0x48b2cc){logger[_0x601c('0x14')](_0x601c('0x24'),_0x48b2cc['message'],_0xc7679e);_0x3c6456(_this[_0x601c('0x14')](0x1f4,_0x48b2cc[_0x601c('0x16')]));});});}; \ No newline at end of file +var _0xfc25=['UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x39b634,_0x205c0b){var _0x1e17cc=function(_0x482269){while(--_0x482269){_0x39b634['push'](_0x39b634['shift']());}};_0x1e17cc(++_0x205c0b);}(_0xfc25,0x67));var _0x5fc2=function(_0x21a055,_0x4b2849){_0x21a055=_0x21a055-0x0;var _0x394416=_0xfc25[_0x21a055];return _0x394416;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5fc2('0x0'));var BPromise=require(_0x5fc2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5fc2('0x2'));var db=require(_0x5fc2('0x3'))['db'];var utils=require(_0x5fc2('0x4'));var logger=require(_0x5fc2('0x5'))(_0x5fc2('0x6'));var config=require('../../config/environment');var jayson=require(_0x5fc2('0x7'));var client=jayson[_0x5fc2('0x8')][_0x5fc2('0x9')]({'port':0x232a});config[_0x5fc2('0xa')]=_['defaults'](config['redis'],{'host':_0x5fc2('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5fc2('0xc'))[_0x5fc2('0xd')](socket);function respondWithRpcPromise(_0x278c9a,_0x3249d5,_0x401568){return new BPromise(function(_0x3b66f7,_0x4aa63f){return client[_0x5fc2('0xe')](_0x278c9a,_0x401568)[_0x5fc2('0xf')](function(_0x134cac){logger[_0x5fc2('0x10')](_0x5fc2('0x11'),_0x3249d5,_0x5fc2('0x12'));logger[_0x5fc2('0x13')](_0x5fc2('0x14'),_0x3249d5,'request\x20sent',JSON['stringify'](_0x134cac));if(_0x134cac[_0x5fc2('0x15')]){if(_0x134cac[_0x5fc2('0x15')][_0x5fc2('0x16')]===0x1f4){logger[_0x5fc2('0x15')](_0x5fc2('0x11'),_0x3249d5,_0x134cac['error']['message']);return _0x4aa63f(_0x134cac['error'][_0x5fc2('0x17')]);}logger[_0x5fc2('0x15')](_0x5fc2('0x11'),_0x3249d5,_0x134cac[_0x5fc2('0x15')][_0x5fc2('0x17')]);return _0x3b66f7(_0x134cac['error']['message']);}else{logger[_0x5fc2('0x10')](_0x5fc2('0x11'),_0x3249d5,_0x5fc2('0x12'));_0x3b66f7(_0x134cac[_0x5fc2('0x18')][_0x5fc2('0x17')]);}})[_0x5fc2('0x19')](function(_0x4ad411){logger[_0x5fc2('0x15')](_0x5fc2('0x11'),_0x3249d5,_0x4ad411);_0x4aa63f(_0x4ad411);});});}exports[_0x5fc2('0x1a')]=function(_0x1d1c64){var _0x10f7e8=this;return new Promise(function(_0x302537,_0x3ebd50){return db[_0x5fc2('0x1b')][_0x5fc2('0x1c')](_0x1d1c64[_0x5fc2('0x1d')],{'raw':_0x1d1c64['options']?_0x1d1c64[_0x5fc2('0x1e')][_0x5fc2('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d1c64['options']?_0x1d1c64[_0x5fc2('0x1e')][_0x5fc2('0x20')]||null:null,'attributes':_0x1d1c64[_0x5fc2('0x1e')]?_0x1d1c64[_0x5fc2('0x1e')][_0x5fc2('0x21')]||null:null,'limit':_0x1d1c64[_0x5fc2('0x1e')]?_0x1d1c64['options'][_0x5fc2('0x22')]||null:null})[_0x5fc2('0xf')](function(_0x1f7f68){logger[_0x5fc2('0x10')](_0x5fc2('0x1a'),_0x1d1c64);logger[_0x5fc2('0x13')](_0x5fc2('0x1a'),_0x1d1c64,JSON[_0x5fc2('0x23')](_0x1f7f68));_0x302537(_0x1f7f68);})['catch'](function(_0x2a858d){logger[_0x5fc2('0x15')]('UpdateFaxInteraction',_0x2a858d['message'],_0x1d1c64);_0x3ebd50(_0x10f7e8[_0x5fc2('0x15')](0x1f4,_0x2a858d[_0x5fc2('0x17')]));});});};exports[_0x5fc2('0x24')]=function(_0x158258){return new Promise(function(_0x37244d,_0x4daec9){return db[_0x5fc2('0x1b')][_0x5fc2('0x25')]({'where':_0x158258[_0x5fc2('0x1e')]?_0x158258[_0x5fc2('0x1e')][_0x5fc2('0x20')]||null:null})['then'](function(_0x272e3a){if(_0x272e3a){return _0x272e3a[_0x5fc2('0x26')](_0x158258['body'][_0x5fc2('0x27')],_[_0x5fc2('0x28')](_0x158258[_0x5fc2('0x1d')],[_0x5fc2('0x27'),'id'])||{});}})[_0x5fc2('0x29')](function(_0x3c9c22){logger[_0x5fc2('0x10')](_0x5fc2('0x2a'),_0x158258);logger[_0x5fc2('0x13')](_0x5fc2('0x2a'),_0x158258,JSON[_0x5fc2('0x23')](_0x3c9c22));_0x37244d(_0x3c9c22);})['catch'](function(_0x5c268f){logger[_0x5fc2('0x15')](_0x5fc2('0x2a'),_0x5c268f[_0x5fc2('0x17')],_0x158258);_0x4daec9(_this[_0x5fc2('0x15')](0x1f4,_0x5c268f[_0x5fc2('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 768dec7..b70cdba 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 _0xc6b1=['removeListener','./faxInteraction.events','remove','emit'];(function(_0x118af7,_0x183c90){var _0x54bbc6=function(_0x13bf1a){while(--_0x13bf1a){_0x118af7['push'](_0x118af7['shift']());}};_0x54bbc6(++_0x183c90);}(_0xc6b1,0xc1));var _0x1c6b=function(_0xb2c77b,_0x216e45){_0xb2c77b=_0xb2c77b-0x0;var _0x15b68c=_0xc6b1[_0xb2c77b];return _0x15b68c;};'use strict';var FaxInteractionEvents=require(_0x1c6b('0x0'));var events=['save',_0x1c6b('0x1'),'update'];function createListener(_0x3c1be9,_0x40c374){return function(_0x504ec9){_0x40c374[_0x1c6b('0x2')](_0x3c1be9,_0x504ec9);};}function removeListener(_0x349250,_0x2c6bff){return function(){FaxInteractionEvents[_0x1c6b('0x3')](_0x349250,_0x2c6bff);};}exports['register']=function(_0x254ba3){for(var _0x5215d1=0x0,_0x46842e=events['length'];_0x5215d1<_0x46842e;_0x5215d1++){var _0x212d96=events[_0x5215d1];var _0x492205=createListener('faxInteraction:'+_0x212d96,_0x254ba3);FaxInteractionEvents['on'](_0x212d96,_0x492205);}}; \ No newline at end of file +var _0x7c95=['./faxInteraction.events','save','remove','update','emit','removeListener','length','faxInteraction:'];(function(_0x11c3c0,_0x13d09e){var _0x584eb0=function(_0x3a5274){while(--_0x3a5274){_0x11c3c0['push'](_0x11c3c0['shift']());}};_0x584eb0(++_0x13d09e);}(_0x7c95,0x160));var _0x57c9=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x7c95[_0x2dadb9];return _0x2f0097;};'use strict';var FaxInteractionEvents=require(_0x57c9('0x0'));var events=[_0x57c9('0x1'),_0x57c9('0x2'),_0x57c9('0x3')];function createListener(_0x39277d,_0x164d2c){return function(_0x399b57){_0x164d2c[_0x57c9('0x4')](_0x39277d,_0x399b57);};}function removeListener(_0x589028,_0x2c031e){return function(){FaxInteractionEvents[_0x57c9('0x5')](_0x589028,_0x2c031e);};}exports['register']=function(_0x342684){for(var _0x440e30=0x0,_0x2a1074=events[_0x57c9('0x6')];_0x440e30<_0x2a1074;_0x440e30++){var _0x3c5a13=events[_0x440e30];var _0x252385=createListener(_0x57c9('0x7')+_0x3c5a13,_0x342684);FaxInteractionEvents['on'](_0x3c5a13,_0x252385);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 0ff34a8..b6973bd 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 _0xa7af=['addMessage','/:id/tags','fax','faxinteraction:addtags','addTags','put','tracked','update','delete','faxinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index','describe','/:id','show','/:id/messages','isAuthenticated','getMessages','/:id/download','download','create','post'];(function(_0x5ce8b9,_0x5cded8){var _0xe34be0=function(_0xe3d4e5){while(--_0xe3d4e5){_0x5ce8b9['push'](_0x5ce8b9['shift']());}};_0xe34be0(++_0x5cded8);}(_0xa7af,0x13e));var _0xfa7a=function(_0x742080,_0x2421ae){_0x742080=_0x742080-0x0;var _0x44fac6=_0xa7af[_0x742080];return _0x44fac6;};'use strict';var multer=require(_0xfa7a('0x0'));var util=require(_0xfa7a('0x1'));var path=require(_0xfa7a('0x2'));var timeout=require(_0xfa7a('0x3'));var express=require(_0xfa7a('0x4'));var router=express['Router']();var fs_extra=require(_0xfa7a('0x5'));var auth=require(_0xfa7a('0x6'));var interaction=require(_0xfa7a('0x7'));var config=require(_0xfa7a('0x8'));var controller=require(_0xfa7a('0x9'));router[_0xfa7a('0xa')]('/',auth['isAuthenticated'](),controller[_0xfa7a('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xfa7a('0xc')]);router[_0xfa7a('0xa')](_0xfa7a('0xd'),auth['isAuthenticated'](),controller[_0xfa7a('0xe')]);router['get'](_0xfa7a('0xf'),auth[_0xfa7a('0x10')](),controller[_0xfa7a('0x11')]);router['get'](_0xfa7a('0x12'),auth[_0xfa7a('0x10')](),controller[_0xfa7a('0x13')]);router['post']('/',auth[_0xfa7a('0x10')](),controller[_0xfa7a('0x14')]);router[_0xfa7a('0x15')](_0xfa7a('0xf'),auth[_0xfa7a('0x10')](),controller[_0xfa7a('0x16')]);router[_0xfa7a('0x15')](_0xfa7a('0x17'),auth[_0xfa7a('0x10')](),interaction['tracked'](_0xfa7a('0x18'),_0xfa7a('0x19')),controller[_0xfa7a('0x1a')]);router[_0xfa7a('0x1b')](_0xfa7a('0xd'),auth['isAuthenticated'](),interaction[_0xfa7a('0x1c')]('fax','faxinteraction:update'),controller[_0xfa7a('0x1d')]);router[_0xfa7a('0x1e')](_0xfa7a('0xd'),auth[_0xfa7a('0x10')](),interaction['tracked']('fax',_0xfa7a('0x1f')),controller['destroy']);router['delete'](_0xfa7a('0x17'),auth['isAuthenticated'](),controller[_0xfa7a('0x20')]);module[_0xfa7a('0x21')]=router; \ No newline at end of file +var _0x0002=['Router','fs-extra','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','show','getMessages','/:id/download','create','/:id/messages','addMessage','post','tracked','fax','faxinteraction:addtags','addTags','update','delete','faxinteraction:destroy','/:id/tags','removeTags','exports','util','connect-timeout','express'];(function(_0x22aa61,_0x45e107){var _0x51500a=function(_0x16a73b){while(--_0x16a73b){_0x22aa61['push'](_0x22aa61['shift']());}};_0x51500a(++_0x45e107);}(_0x0002,0x8e));var _0x2000=function(_0x109839,_0x34aed1){_0x109839=_0x109839-0x0;var _0x18c491=_0x0002[_0x109839];return _0x18c491;};'use strict';var multer=require('multer');var util=require(_0x2000('0x0'));var path=require('path');var timeout=require(_0x2000('0x1'));var express=require(_0x2000('0x2'));var router=express[_0x2000('0x3')]();var fs_extra=require(_0x2000('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2000('0x5'));var config=require('../../config/environment');var controller=require(_0x2000('0x6'));router[_0x2000('0x7')]('/',auth[_0x2000('0x8')](),controller[_0x2000('0x9')]);router['get'](_0x2000('0xa'),auth['isAuthenticated'](),controller[_0x2000('0xb')]);router[_0x2000('0x7')]('/:id',auth[_0x2000('0x8')](),controller[_0x2000('0xc')]);router['get']('/:id/messages',auth[_0x2000('0x8')](),controller[_0x2000('0xd')]);router[_0x2000('0x7')](_0x2000('0xe'),auth[_0x2000('0x8')](),controller['download']);router['post']('/',auth[_0x2000('0x8')](),controller[_0x2000('0xf')]);router['post'](_0x2000('0x10'),auth[_0x2000('0x8')](),controller[_0x2000('0x11')]);router[_0x2000('0x12')]('/:id/tags',auth[_0x2000('0x8')](),interaction[_0x2000('0x13')](_0x2000('0x14'),_0x2000('0x15')),controller[_0x2000('0x16')]);router['put']('/:id',auth[_0x2000('0x8')](),interaction[_0x2000('0x13')](_0x2000('0x14'),'faxinteraction:update'),controller[_0x2000('0x17')]);router[_0x2000('0x18')]('/:id',auth[_0x2000('0x8')](),interaction[_0x2000('0x13')]('fax',_0x2000('0x19')),controller['destroy']);router[_0x2000('0x18')](_0x2000('0x1a'),auth[_0x2000('0x8')](),controller[_0x2000('0x1b')]);module[_0x2000('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 839729a..cf33f03 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 _0x303a=['ENUM','out','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x158ab3,_0x4b5908){var _0x302830=function(_0x19fa14){while(--_0x19fa14){_0x158ab3['push'](_0x158ab3['shift']());}};_0x302830(++_0x4b5908);}(_0x303a,0x1a0));var _0xa303=function(_0x4ecd76,_0x79f1f3){_0x4ecd76=_0x4ecd76-0x0;var _0x240f34=_0x303a[_0x4ecd76];return _0x240f34;};'use strict';var Sequelize=require(_0xa303('0x0'));module['exports']={'body':{'type':Sequelize[_0xa303('0x1')](_0xa303('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xa303('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa303('0x4')]('in','out'),'defaultValue':_0xa303('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xa303('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xa303('0x6')]}}; \ No newline at end of file +var _0xe0c3=['ENUM','out','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x40aada,_0x102460){var _0x503f78=function(_0x21ccfa){while(--_0x21ccfa){_0x40aada['push'](_0x40aada['shift']());}};_0x503f78(++_0x102460);}(_0xe0c3,0xea));var _0x3e0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe0c3[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3e0c('0x0'));module['exports']={'body':{'type':Sequelize[_0x3e0c('0x1')](_0x3e0c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3e0c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3e0c('0x4')]('in',_0x3e0c('0x5')),'defaultValue':_0x3e0c('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x3e0c('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0x3e0c('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index f0c36bc..9c0613a 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 _0x940c=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','localhost','socket.io-emitter','./faxMessage.socket','register','client','http','request','then','info','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','stack','name','index','map','FaxMessage','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','count','includeAll','include','findAll','show','params','length','options','find','body','destroy','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteractionId','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','create','CmContact','isNil','AttachmentId','SendFax','FaxAccountId','basename','join','files','attachments','Attachment','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs'];(function(_0xe6c244,_0x1e6199){var _0x2d3f91=function(_0x34c5d1){while(--_0x34c5d1){_0xe6c244['push'](_0xe6c244['shift']());}};_0x2d3f91(++_0x1e6199);}(_0x940c,0x10a));var _0xc940=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x940c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc940('0x0'));var zipdir=require(_0xc940('0x1'));var jsonpatch=require(_0xc940('0x2'));var rp=require('request-promise');var moment=require(_0xc940('0x3'));var BPromise=require(_0xc940('0x4'));var Mustache=require(_0xc940('0x5'));var util=require(_0xc940('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc940('0x7'));var ejs=require(_0xc940('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc940('0x9'));var crypto=require(_0xc940('0xa'));var jsforce=require(_0xc940('0xb'));var deskjs=require(_0xc940('0xc'));var toCsv=require(_0xc940('0x7'));var querystring=require(_0xc940('0xd'));var Papa=require(_0xc940('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc940('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc940('0x10'))('api');var utils=require(_0xc940('0x11'));var config=require(_0xc940('0x12'));var licenseUtil=require(_0xc940('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xc940('0x14'),'port':0x18eb});var socket=require(_0xc940('0x15'))(new Redis(config['redis']));require(_0xc940('0x16'))[_0xc940('0x17')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc940('0x18')]['http']({'port':0x232c});var client9002=jayson['client'][_0xc940('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x1b6389,_0x1d8e89,_0xa51172,_0x27d65c){return new BPromise(function(_0x5abe99,_0x3c95c6){var _0xf24f80=_0x27d65c||client;return _0xf24f80[_0xc940('0x1a')](_0x1b6389,_0xa51172)[_0xc940('0x1b')](function(_0x27ec3d){logger[_0xc940('0x1c')]('FaxMessage,\x20%s,\x20%s',_0x1d8e89,'request\x20sent');logger[_0xc940('0x1d')](_0xc940('0x1e'),_0x1d8e89,_0xc940('0x1f'),JSON[_0xc940('0x20')](_0x27ec3d));if(_0x27ec3d[_0xc940('0x21')]){if(_0x27ec3d[_0xc940('0x21')][_0xc940('0x22')]===0x1f4){logger[_0xc940('0x21')](_0xc940('0x23'),_0x1d8e89,_0x27ec3d[_0xc940('0x21')][_0xc940('0x24')]);return _0x3c95c6(_0x27ec3d[_0xc940('0x21')][_0xc940('0x24')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x1d8e89,_0x27ec3d[_0xc940('0x21')][_0xc940('0x24')]);return _0x5abe99(_0x27ec3d['error']['message']);}else{logger[_0xc940('0x1c')](_0xc940('0x23'),_0x1d8e89,_0xc940('0x1f'));_0x5abe99(_0x27ec3d[_0xc940('0x25')]['message']);}})[_0xc940('0x26')](function(_0x5638a5){logger[_0xc940('0x21')]('FaxMessage,\x20%s,\x20%s',_0x1d8e89,_0x5638a5);_0x3c95c6(_0x5638a5);});});}function respondWithStatusCode(_0x57e902,_0x46e3c4){_0x46e3c4=_0x46e3c4||0xcc;return function(_0x379da7){if(_0x379da7){return _0x57e902[_0xc940('0x27')](_0x46e3c4);}return _0x57e902[_0xc940('0x28')](_0x46e3c4)[_0xc940('0x29')]();};}function respondWithResult(_0x157304,_0x317fbc){_0x317fbc=_0x317fbc||0xc8;return function(_0x20c638){if(_0x20c638){return _0x157304[_0xc940('0x28')](_0x317fbc)[_0xc940('0x2a')](_0x20c638);}};}function respondWithFilteredResult(_0x14419a,_0x32bb63){return function(_0x4c9359){if(_0x4c9359){var _0x468bc6=typeof _0x32bb63['offset']===_0xc940('0x2b')&&typeof _0x32bb63[_0xc940('0x2c')]===_0xc940('0x2b');var _0x528543=_0x4c9359['count'];var _0x56f435=_0x468bc6?0x0:_0x32bb63[_0xc940('0x2d')];var _0x5558f6=_0x468bc6?_0x4c9359['count']:_0x32bb63[_0xc940('0x2d')]+_0x32bb63[_0xc940('0x2c')];var _0x57a414;if(_0x5558f6>=_0x528543){_0x5558f6=_0x528543;_0x57a414=0xc8;}else{_0x57a414=0xce;}_0x14419a[_0xc940('0x28')](_0x57a414);return _0x14419a[_0xc940('0x2e')](_0xc940('0x2f'),_0x56f435+'-'+_0x5558f6+'/'+_0x528543)['json'](_0x4c9359);}return null;};}function patchUpdates(_0x980d13){return function(_0x524118){try{jsonpatch[_0xc940('0x30')](_0x524118,_0x980d13,!![]);}catch(_0x208a47){return BPromise[_0xc940('0x31')](_0x208a47);}return _0x524118[_0xc940('0x32')]();};}function saveUpdates(_0x411bf3,_0x503d53){return function(_0xee974f){if(_0xee974f){return _0xee974f[_0xc940('0x33')](_0x411bf3)[_0xc940('0x1b')](function(_0x323e3a){return _0x323e3a;});}return null;};}function removeEntity(_0x459c20,_0x3c08df){return function(_0x56094f){if(_0x56094f){return _0x56094f['destroy']()['then'](function(){_0x459c20[_0xc940('0x28')](0xcc)[_0xc940('0x29')]();});}};}function handleEntityNotFound(_0xfb0d4e,_0x22289b){return function(_0x378586){if(!_0x378586){_0xfb0d4e[_0xc940('0x27')](0x194);}return _0x378586;};}function handleError(_0x46f4b5,_0x4bde34){_0x4bde34=_0x4bde34||0x1f4;return function(_0x23d7d9){logger[_0xc940('0x21')](_0x23d7d9[_0xc940('0x34')]);if(_0x23d7d9[_0xc940('0x35')]){delete _0x23d7d9[_0xc940('0x35')];}_0x46f4b5[_0xc940('0x28')](_0x4bde34)['send'](_0x23d7d9);};}exports[_0xc940('0x36')]=function(_0x12d30c,_0x88d30d){var _0x1d5652={},_0x531905={},_0x51badb={'count':0x0,'rows':[]};var _0x3e3a23=_[_0xc940('0x37')](db[_0xc940('0x38')][_0xc940('0x39')],function(_0x37e4d2){return{'name':_0x37e4d2['fieldName'],'type':_0x37e4d2['type'][_0xc940('0x3a')]};});_0x531905['model']=_['map'](_0x3e3a23,_0xc940('0x35'));_0x531905[_0xc940('0x3b')]=_[_0xc940('0x3c')](_0x12d30c['query']);_0x531905[_0xc940('0x3d')]=_[_0xc940('0x3e')](_0x531905[_0xc940('0x3f')],_0x531905[_0xc940('0x3b')]);_0x1d5652['attributes']=_['intersection'](_0x531905[_0xc940('0x3f')],qs[_0xc940('0x40')](_0x12d30c['query']['fields']));_0x1d5652['attributes']=_0x1d5652['attributes']['length']?_0x1d5652[_0xc940('0x41')]:_0x531905[_0xc940('0x3f')];if(!_0x12d30c[_0xc940('0x3b')][_0xc940('0x42')](_0xc940('0x43'))){_0x1d5652[_0xc940('0x2c')]=qs[_0xc940('0x2c')](_0x12d30c[_0xc940('0x3b')]['limit']);_0x1d5652[_0xc940('0x2d')]=qs['offset'](_0x12d30c[_0xc940('0x3b')]['offset']);}_0x1d5652[_0xc940('0x44')]=qs[_0xc940('0x45')](_0x12d30c[_0xc940('0x3b')][_0xc940('0x45')]);_0x1d5652[_0xc940('0x46')]=qs['filters'](_[_0xc940('0x47')](_0x12d30c[_0xc940('0x3b')],_0x531905[_0xc940('0x3d')]),_0x3e3a23);if(_0x12d30c[_0xc940('0x3b')][_0xc940('0x48')]){_0x1d5652[_0xc940('0x46')]=_['merge'](_0x1d5652['where'],{'$or':_['map'](_0x3e3a23,function(_0x25ff51){if(_0x25ff51[_0xc940('0x49')]!==_0xc940('0x4a')){var _0x2a6c6d={};_0x2a6c6d[_0x25ff51[_0xc940('0x35')]]={'$like':'%'+_0x12d30c[_0xc940('0x3b')][_0xc940('0x48')]+'%'};return _0x2a6c6d;}})});}_0x1d5652=_[_0xc940('0x4b')]({},_0x1d5652,_0x12d30c['options']);var _0x497974={'where':_0x1d5652[_0xc940('0x46')]};return db[_0xc940('0x38')][_0xc940('0x4c')](_0x497974)[_0xc940('0x1b')](function(_0x170056){_0x51badb['count']=_0x170056;if(_0x12d30c['query'][_0xc940('0x4d')]){_0x1d5652[_0xc940('0x4e')]=[{'all':!![]}];}return db[_0xc940('0x38')][_0xc940('0x4f')](_0x1d5652);})[_0xc940('0x1b')](function(_0x1cf98b){_0x51badb['rows']=_0x1cf98b;return _0x51badb;})[_0xc940('0x1b')](respondWithFilteredResult(_0x88d30d,_0x1d5652))[_0xc940('0x26')](handleError(_0x88d30d,null));};exports[_0xc940('0x50')]=function(_0x215c8b,_0x4cf223){var _0x39056e={'raw':!![],'where':{'id':_0x215c8b[_0xc940('0x51')]['id']}},_0x4a03a8={};_0x4a03a8[_0xc940('0x3f')]=_[_0xc940('0x3c')](db['FaxMessage'][_0xc940('0x39')]);_0x4a03a8[_0xc940('0x3b')]=_[_0xc940('0x3c')](_0x215c8b[_0xc940('0x3b')]);_0x4a03a8[_0xc940('0x3d')]=_[_0xc940('0x3e')](_0x4a03a8[_0xc940('0x3f')],_0x4a03a8[_0xc940('0x3b')]);_0x39056e[_0xc940('0x41')]=_[_0xc940('0x3e')](_0x4a03a8['model'],qs['fields'](_0x215c8b[_0xc940('0x3b')][_0xc940('0x40')]));_0x39056e[_0xc940('0x41')]=_0x39056e[_0xc940('0x41')][_0xc940('0x52')]?_0x39056e[_0xc940('0x41')]:_0x4a03a8[_0xc940('0x3f')];if(_0x215c8b[_0xc940('0x3b')]['includeAll']){_0x39056e['include']=[{'all':!![]}];}_0x39056e=_[_0xc940('0x4b')]({},_0x39056e,_0x215c8b[_0xc940('0x53')]);return db[_0xc940('0x38')][_0xc940('0x54')](_0x39056e)[_0xc940('0x1b')](handleEntityNotFound(_0x4cf223,null))[_0xc940('0x1b')](respondWithResult(_0x4cf223,null))['catch'](handleError(_0x4cf223,null));};exports[_0xc940('0x33')]=function(_0x435b5d,_0x503a16){if(_0x435b5d['body']['id']){delete _0x435b5d['body']['id'];}return db[_0xc940('0x38')]['find']({'where':{'id':_0x435b5d['params']['id']}})[_0xc940('0x1b')](handleEntityNotFound(_0x503a16,null))[_0xc940('0x1b')](saveUpdates(_0x435b5d[_0xc940('0x55')],null))['then'](respondWithResult(_0x503a16,null))['catch'](handleError(_0x503a16,null));};exports[_0xc940('0x56')]=function(_0x3613e2,_0x32bbb5){return db[_0xc940('0x38')][_0xc940('0x54')]({'where':{'id':_0x3613e2[_0xc940('0x51')]['id']}})[_0xc940('0x1b')](handleEntityNotFound(_0x32bbb5,null))[_0xc940('0x1b')](removeEntity(_0x32bbb5,null))[_0xc940('0x26')](handleError(_0x32bbb5,null));};exports[_0xc940('0x57')]=function(_0x3c546f,_0x4bed8f){return db['FaxMessage'][_0xc940('0x57')]()[_0xc940('0x1b')](respondWithResult(_0x4bed8f,null))['catch'](handleError(_0x4bed8f,null));};var interaction_log=require(_0xc940('0x10'))(_0xc940('0x58'));exports[_0xc940('0x59')]=function(_0x457840,_0x217cb2,_0x3ca6f4){var _0x5544d0={'agent':{},'channel':_0xc940('0x5a')};if(_0x457840['body']['id']){delete _0x457840['body']['id'];}_0x457840[_0xc940('0x55')][_0xc940('0x5b')]=!![];_0x457840[_0xc940('0x55')][_0xc940('0x5c')]=moment()[_0xc940('0x5d')](_0xc940('0x5e'));_0x457840[_0xc940('0x55')][_0xc940('0x5f')]=_0x457840[_0xc940('0x55')][_0xc940('0x5f')]||_0x457840[_0xc940('0x60')]['id'];_0x5544d0[_0xc940('0x61')]['id']=_0x457840[_0xc940('0x55')][_0xc940('0x5f')];return db[_0xc940('0x38')][_0xc940('0x54')]({'where':{'id':_0x457840[_0xc940('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x217cb2,null))['then'](saveUpdates(_0x457840[_0xc940('0x55')],null))[_0xc940('0x1b')](function(_0x5b187e){if(_0x5b187e){_0x5544d0[_0xc940('0x24')]=_0x5b187e[_0xc940('0x62')]({'plain':!![]});return db['FaxInteraction'][_0xc940('0x54')]({'where':{'id':_0x5b187e[_0xc940('0x63')]}});}return null;})[_0xc940('0x1b')](handleEntityNotFound(_0x217cb2,null))[_0xc940('0x1b')](function(_0x7faa41){if(_0x7faa41){return _0x7faa41['update']({'UserId':_0x457840[_0xc940('0x55')][_0xc940('0x5f')],'read1stAt':_['isNil'](_0x7faa41[_0xc940('0x64')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xc940('0x1b')](function(_0x1dd6ca){if(_0x1dd6ca){_0x5544d0['interaction']=_0x1dd6ca['get']({'plain':!![]});interaction_log['info'](_0xc940('0x65'),_0x457840['user']['id'],_0x457840[_0xc940('0x60')]['name'],_0x457840[_0xc940('0x60')][_0xc940('0x66')],_0x5544d0[_0xc940('0x67')]['id'],_0x457840['body']?JSON['stringify'](_0x457840[_0xc940('0x55')]):_0xc940('0x68'));return respondWithRpcPromise(_0xc940('0x69'),_0xc940('0x6a'),_0x5544d0);}return null;})['then'](function(_0x244f0e){var _0x5b713d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x244f0e[_0xc940('0x24')][_0xc940('0x6b')];return db[_0xc940('0x6c')]['query'](_0x5b713d,{'type':db[_0xc940('0x6d')][_0xc940('0x6e')][_0xc940('0x6f')],'raw':!![]})[_0xc940('0x1b')](function(_0x4c5870){return _0x4c5870;});})[_0xc940('0x1b')](function(_0x12d3d7){if(_0x12d3d7){_0x5544d0['message'][_0xc940('0x70')]=_0x12d3d7[0x0];if(!_0x457840[_0xc940('0x55')][_0xc940('0x5f')])return;return db[_0xc940('0x71')][_0xc940('0x54')]({'where':{'id':_0x457840[_0xc940('0x55')][_0xc940('0x5f')],'role':_0xc940('0x61')},'attributes':['id',_0xc940('0x35'),_0xc940('0x72'),_0xc940('0x73'),_0xc940('0x74')],'raw':!![]});}return null;})['then'](function(_0x7b8a23){if(!_0x7b8a23)return null;_0x5544d0[_0xc940('0x24')]['agent']=_0x7b8a23;return _0x5544d0;})[_0xc940('0x1b')](function(_0x245523){if(_0x245523){if(_0x457840[_0xc940('0x55')][_0xc940('0x75')]){_0x5544d0[_0xc940('0x24')][_0xc940('0x76')]=util[_0xc940('0x5d')](_0xc940('0x77'),_0x457840[_0xc940('0x60')][_0xc940('0x35')]);_0x5544d0['message'][_0xc940('0x78')]=_0x5544d0[_0xc940('0x78')];_0x5544d0['message'][_0xc940('0x79')]=_0x5544d0[_0xc940('0x78')];_0x5544d0[_0xc940('0x24')][_0xc940('0x7a')]=_0xc940('0x59');return respondWithRpcPromise('EventManager',_0xc940('0x7b'),{'event':_0xc940('0x7c'),'message':_0x5544d0[_0xc940('0x24')]},client9002)[_0xc940('0x1b')](function(){return _0x5544d0;});}return _0x5544d0;}return null;})[_0xc940('0x1b')](respondWithResult(_0x217cb2,null))['catch'](handleError(_0x217cb2,null));};var interaction_log=require(_0xc940('0x10'))(_0xc940('0x58'));exports[_0xc940('0x31')]=function(_0x447dcc,_0x352086,_0x438703){var _0x5cc54d={'agent':{},'channel':_0xc940('0x5a')};if(_0x447dcc[_0xc940('0x55')]['id']){delete _0x447dcc[_0xc940('0x55')]['id'];}_0x447dcc['body']['UserId']=_0x447dcc[_0xc940('0x55')]['UserId']||_0x447dcc[_0xc940('0x60')]['id'];_0x5cc54d[_0xc940('0x61')]['id']=_0x447dcc[_0xc940('0x55')][_0xc940('0x5f')];return db['FaxMessage'][_0xc940('0x54')]({'where':{'id':_0x447dcc[_0xc940('0x51')]['id'],'UserId':null}})[_0xc940('0x1b')](handleEntityNotFound(_0x352086,null))[_0xc940('0x1b')](function(_0x285d2c){if(_0x285d2c){_0x5cc54d[_0xc940('0x24')]=_0x285d2c['get']({'plain':!![]});return db[_0xc940('0x7d')][_0xc940('0x54')]({'where':{'id':_0x285d2c['FaxInteractionId']}});}return null;})[_0xc940('0x1b')](handleEntityNotFound(_0x352086,null))[_0xc940('0x1b')](function(_0x4e7bdf){if(_0x4e7bdf){_0x5cc54d[_0xc940('0x67')]=_0x4e7bdf[_0xc940('0x62')]({'plain':!![]});interaction_log[_0xc940('0x1c')](_0xc940('0x7e'),_0x447dcc[_0xc940('0x60')]['id'],_0x447dcc[_0xc940('0x60')]['name'],_0x447dcc[_0xc940('0x60')][_0xc940('0x66')],_0x5cc54d['interaction']['id'],_0x447dcc[_0xc940('0x55')]?JSON['stringify'](_0x447dcc[_0xc940('0x55')]):_0xc940('0x68'));return respondWithRpcPromise(_0xc940('0x7f'),_0xc940('0x80'),_0x5cc54d);}return null;})[_0xc940('0x1b')](function(_0x4334c5){var _0x34a296=_0xc940('0x81')+_0x4334c5['message']['ContactId'];return db[_0xc940('0x6c')][_0xc940('0x3b')](_0x34a296,{'type':db[_0xc940('0x6d')][_0xc940('0x6e')][_0xc940('0x6f')],'raw':!![]})['then'](function(_0x3fc6ee){return _0x3fc6ee;});})[_0xc940('0x1b')](function(_0x5d0963){if(_0x5d0963){_0x5cc54d[_0xc940('0x24')]['contact']=_0x5d0963[0x0];if(!_0x447dcc[_0xc940('0x55')][_0xc940('0x5f')])return;return db[_0xc940('0x71')][_0xc940('0x54')]({'where':{'id':_0x447dcc[_0xc940('0x55')][_0xc940('0x5f')],'role':_0xc940('0x61')},'attributes':['id','name',_0xc940('0x72'),_0xc940('0x73'),_0xc940('0x74')],'raw':!![]});}return null;})[_0xc940('0x1b')](function(_0x13ebc7){if(!_0x13ebc7)return null;_0x5cc54d['message'][_0xc940('0x61')]=_0x13ebc7;return _0x5cc54d;})['then'](function(_0x1d7f26){if(_0x1d7f26){_0x1d7f26[_0xc940('0x24')][_0xc940('0x76')]=util['format'](_0xc940('0x77'),_0x447dcc[_0xc940('0x60')]['name']);_0x1d7f26[_0xc940('0x24')][_0xc940('0x78')]=_0x5cc54d['channel'];_0x1d7f26[_0xc940('0x24')][_0xc940('0x79')]=_0x5cc54d['channel'];_0x1d7f26[_0xc940('0x24')]['event']=_0xc940('0x31');respondWithRpcPromise(_0xc940('0x7b'),_0xc940('0x7b'),{'event':'rejectmessage','message':_0x1d7f26[_0xc940('0x24')]},client9002);return _0x5cc54d;}return null;})['then'](respondWithResult(_0x352086,null))[_0xc940('0x26')](handleError(_0x352086,null));};exports[_0xc940('0x82')]=function(_0x487ec3,_0x22fe83){var _0x4c2a4c;return db[_0xc940('0x38')]['create'](_0x487ec3['body'],{})['then'](function(_0x438769){_0x4c2a4c=_0x438769;return db[_0xc940('0x83')]['findOne']({'where':{'id':_0x4c2a4c[_0xc940('0x6b')]}});})[_0xc940('0x1b')](function(_0x29b03c){if(_[_0xc940('0x84')](_0x29b03c)){return;}else{_0x4c2a4c[_0xc940('0x5a')]=_0x29b03c[_0xc940('0x5a')];return db['Attachment']['findOne']({'where':{'id':_0x4c2a4c[_0xc940('0x85')]}});}})[_0xc940('0x1b')](function(_0x3de55d){return respondWithRpcPromise('SendFax',_0xc940('0x86'),{'FaxAccountId':_['isNil'](_0x487ec3[_0xc940('0x55')])?undefined:_0x487ec3[_0xc940('0x55')][_0xc940('0x87')],'path':_[_0xc940('0x84')](_0x3de55d)?undefined:util[_0xc940('0x5d')]('/var/opt/motion2/server/files/attachments/%s',_0x3de55d[_0xc940('0x88')]),'fax':_[_0xc940('0x84')](_0x4c2a4c[_0xc940('0x5a')])?undefined:_0x4c2a4c[_0xc940('0x5a')],'AttachmentId':_0x4c2a4c[_0xc940('0x85')]},client9002);})[_0xc940('0x1b')](respondWithResult(_0x22fe83,0xc9))[_0xc940('0x26')](handleError(_0x22fe83,null));};exports['download']=function(_0x387e16,_0x197ef3){var _0x146145=path[_0xc940('0x89')](config['root'],'server',_0xc940('0x8a'),_0xc940('0x8b'));return db[_0xc940('0x38')][_0xc940('0x54')]({'where':{'id':_0x387e16['params']['id']},'include':[{'model':db[_0xc940('0x8c')],'as':_0xc940('0x8c')}]})[_0xc940('0x1b')](handleEntityNotFound(_0x197ef3,null))[_0xc940('0x1b')](function(_0x189a29){if(_0x189a29){return _0x197ef3['download'](path[_0xc940('0x89')](_0x146145,_0x189a29['Attachment']['basename']));}})[_0xc940('0x26')](handleError(_0x197ef3,null));}; \ No newline at end of file +var _0xc34e=['agent','get','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','user','role','interaction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','email','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','RejectMessage','rejectMessage','fullname','internal','motionChannel','rejectmessage','create','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','join','root','server','files','attachments','basename','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','rawAttributes','fieldName','type','query','keys','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','filter','options','FaxMessage','includeAll','include','findAll','rows','show','params','body','find','describe','fax-interactions','fax','read','readAt','format','UserId'];(function(_0x1b2a09,_0x2d2258){var _0x5bd49d=function(_0x4d30a7){while(--_0x4d30a7){_0x1b2a09['push'](_0x1b2a09['shift']());}};_0x5bd49d(++_0x2d2258);}(_0xc34e,0x149));var _0xec34=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc34e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xec34('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xec34('0x1'));var jsonpatch=require(_0xec34('0x2'));var rp=require(_0xec34('0x3'));var moment=require(_0xec34('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xec34('0x5'));var util=require(_0xec34('0x6'));var path=require(_0xec34('0x7'));var sox=require(_0xec34('0x8'));var csv=require(_0xec34('0x9'));var ejs=require(_0xec34('0xa'));var fs=require('fs');var fs_extra=require(_0xec34('0xb'));var _=require('lodash');var squel=require(_0xec34('0xc'));var crypto=require(_0xec34('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xec34('0xe'));var toCsv=require(_0xec34('0x9'));var querystring=require(_0xec34('0xf'));var Papa=require('papaparse');var Redis=require(_0xec34('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xec34('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec34('0x12'));var logger=require(_0xec34('0x13'))('api');var utils=require(_0xec34('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xec34('0x15'));var db=require(_0xec34('0x16'))['db'];config[_0xec34('0x17')]=_[_0xec34('0x18')](config['redis'],{'host':_0xec34('0x19'),'port':0x18eb});var socket=require(_0xec34('0x1a'))(new Redis(config[_0xec34('0x17')]));require(_0xec34('0x1b'))[_0xec34('0x1c')](socket);var jayson=require(_0xec34('0x1d'));var client=jayson[_0xec34('0x1e')][_0xec34('0x1f')]({'port':0x232c});var client9002=jayson[_0xec34('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x250aea,_0x15728a,_0x36be41,_0x331954){return new BPromise(function(_0x5e099a,_0x22925d){var _0x13dcf5=_0x331954||client;return _0x13dcf5[_0xec34('0x20')](_0x250aea,_0x36be41)[_0xec34('0x21')](function(_0x499ef5){logger[_0xec34('0x22')](_0xec34('0x23'),_0x15728a,_0xec34('0x24'));logger[_0xec34('0x25')](_0xec34('0x26'),_0x15728a,_0xec34('0x24'),JSON['stringify'](_0x499ef5));if(_0x499ef5[_0xec34('0x27')]){if(_0x499ef5[_0xec34('0x27')][_0xec34('0x28')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x15728a,_0x499ef5[_0xec34('0x27')][_0xec34('0x29')]);return _0x22925d(_0x499ef5[_0xec34('0x27')]['message']);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x15728a,_0x499ef5[_0xec34('0x27')]['message']);return _0x5e099a(_0x499ef5['error']['message']);}else{logger[_0xec34('0x22')](_0xec34('0x23'),_0x15728a,_0xec34('0x24'));_0x5e099a(_0x499ef5['result'][_0xec34('0x29')]);}})[_0xec34('0x2a')](function(_0x18ba90){logger[_0xec34('0x27')](_0xec34('0x23'),_0x15728a,_0x18ba90);_0x22925d(_0x18ba90);});});}function respondWithStatusCode(_0x1832aa,_0xc749f){_0xc749f=_0xc749f||0xcc;return function(_0x38f66b){if(_0x38f66b){return _0x1832aa[_0xec34('0x2b')](_0xc749f);}return _0x1832aa['status'](_0xc749f)[_0xec34('0x2c')]();};}function respondWithResult(_0x40732f,_0x2a6356){_0x2a6356=_0x2a6356||0xc8;return function(_0x562cf2){if(_0x562cf2){return _0x40732f['status'](_0x2a6356)[_0xec34('0x2d')](_0x562cf2);}};}function respondWithFilteredResult(_0x3898d6,_0x595b03){return function(_0x114de2){if(_0x114de2){var _0x414db4=typeof _0x595b03[_0xec34('0x2e')]==='undefined'&&typeof _0x595b03[_0xec34('0x2f')]===_0xec34('0x30');var _0x4b7d11=_0x114de2[_0xec34('0x31')];var _0x5f35ab=_0x414db4?0x0:_0x595b03[_0xec34('0x2e')];var _0xac283c=_0x414db4?_0x114de2[_0xec34('0x31')]:_0x595b03[_0xec34('0x2e')]+_0x595b03['limit'];var _0x4d512f;if(_0xac283c>=_0x4b7d11){_0xac283c=_0x4b7d11;_0x4d512f=0xc8;}else{_0x4d512f=0xce;}_0x3898d6[_0xec34('0x32')](_0x4d512f);return _0x3898d6[_0xec34('0x33')](_0xec34('0x34'),_0x5f35ab+'-'+_0xac283c+'/'+_0x4b7d11)[_0xec34('0x2d')](_0x114de2);}return null;};}function patchUpdates(_0x205e5c){return function(_0x10e196){try{jsonpatch[_0xec34('0x35')](_0x10e196,_0x205e5c,!![]);}catch(_0x23469c){return BPromise[_0xec34('0x36')](_0x23469c);}return _0x10e196[_0xec34('0x37')]();};}function saveUpdates(_0x500cae,_0x4b8de2){return function(_0x2f919a){if(_0x2f919a){return _0x2f919a[_0xec34('0x38')](_0x500cae)[_0xec34('0x21')](function(_0x4fbe8f){return _0x4fbe8f;});}return null;};}function removeEntity(_0x31cd23,_0x48fbdc){return function(_0x53302b){if(_0x53302b){return _0x53302b[_0xec34('0x39')]()['then'](function(){_0x31cd23['status'](0xcc)[_0xec34('0x2c')]();});}};}function handleEntityNotFound(_0x53d9c0,_0x38eed5){return function(_0x3c936d){if(!_0x3c936d){_0x53d9c0[_0xec34('0x2b')](0x194);}return _0x3c936d;};}function handleError(_0x2d9755,_0x241f6b){_0x241f6b=_0x241f6b||0x1f4;return function(_0x3977cc){logger[_0xec34('0x27')](_0x3977cc[_0xec34('0x3a')]);if(_0x3977cc[_0xec34('0x3b')]){delete _0x3977cc['name'];}_0x2d9755['status'](_0x241f6b)['send'](_0x3977cc);};}exports[_0xec34('0x3c')]=function(_0x2c9570,_0x59a44d){var _0x4c31fe={},_0x52edba={},_0x7a3bbc={'count':0x0,'rows':[]};var _0x3f79e=_[_0xec34('0x3d')](db['FaxMessage'][_0xec34('0x3e')],function(_0x4ea0f9){return{'name':_0x4ea0f9[_0xec34('0x3f')],'type':_0x4ea0f9[_0xec34('0x40')]['key']};});_0x52edba['model']=_[_0xec34('0x3d')](_0x3f79e,_0xec34('0x3b'));_0x52edba[_0xec34('0x41')]=_[_0xec34('0x42')](_0x2c9570['query']);_0x52edba['filters']=_[_0xec34('0x43')](_0x52edba['model'],_0x52edba['query']);_0x4c31fe[_0xec34('0x44')]=_[_0xec34('0x43')](_0x52edba[_0xec34('0x45')],qs[_0xec34('0x46')](_0x2c9570[_0xec34('0x41')]['fields']));_0x4c31fe[_0xec34('0x44')]=_0x4c31fe[_0xec34('0x44')]['length']?_0x4c31fe[_0xec34('0x44')]:_0x52edba[_0xec34('0x45')];if(!_0x2c9570['query'][_0xec34('0x47')](_0xec34('0x48'))){_0x4c31fe[_0xec34('0x2f')]=qs[_0xec34('0x2f')](_0x2c9570[_0xec34('0x41')][_0xec34('0x2f')]);_0x4c31fe['offset']=qs[_0xec34('0x2e')](_0x2c9570[_0xec34('0x41')]['offset']);}_0x4c31fe['order']=qs[_0xec34('0x49')](_0x2c9570[_0xec34('0x41')][_0xec34('0x49')]);_0x4c31fe[_0xec34('0x4a')]=qs['filters'](_[_0xec34('0x4b')](_0x2c9570[_0xec34('0x41')],_0x52edba[_0xec34('0x4c')]),_0x3f79e);if(_0x2c9570[_0xec34('0x41')]['filter']){_0x4c31fe[_0xec34('0x4a')]=_[_0xec34('0x4d')](_0x4c31fe[_0xec34('0x4a')],{'$or':_[_0xec34('0x3d')](_0x3f79e,function(_0x2cff39){if(_0x2cff39[_0xec34('0x40')]!==_0xec34('0x4e')){var _0x14b54f={};_0x14b54f[_0x2cff39[_0xec34('0x3b')]]={'$like':'%'+_0x2c9570[_0xec34('0x41')][_0xec34('0x4f')]+'%'};return _0x14b54f;}})});}_0x4c31fe=_[_0xec34('0x4d')]({},_0x4c31fe,_0x2c9570[_0xec34('0x50')]);var _0x5384cc={'where':_0x4c31fe[_0xec34('0x4a')]};return db[_0xec34('0x51')][_0xec34('0x31')](_0x5384cc)[_0xec34('0x21')](function(_0x3860d1){_0x7a3bbc[_0xec34('0x31')]=_0x3860d1;if(_0x2c9570[_0xec34('0x41')][_0xec34('0x52')]){_0x4c31fe[_0xec34('0x53')]=[{'all':!![]}];}return db[_0xec34('0x51')][_0xec34('0x54')](_0x4c31fe);})[_0xec34('0x21')](function(_0x32be4c){_0x7a3bbc[_0xec34('0x55')]=_0x32be4c;return _0x7a3bbc;})[_0xec34('0x21')](respondWithFilteredResult(_0x59a44d,_0x4c31fe))['catch'](handleError(_0x59a44d,null));};exports[_0xec34('0x56')]=function(_0x4cfd60,_0x25032f){var _0x3b97a5={'raw':!![],'where':{'id':_0x4cfd60[_0xec34('0x57')]['id']}},_0x52e097={};_0x52e097[_0xec34('0x45')]=_['keys'](db['FaxMessage']['rawAttributes']);_0x52e097[_0xec34('0x41')]=_[_0xec34('0x42')](_0x4cfd60[_0xec34('0x41')]);_0x52e097[_0xec34('0x4c')]=_['intersection'](_0x52e097['model'],_0x52e097['query']);_0x3b97a5[_0xec34('0x44')]=_[_0xec34('0x43')](_0x52e097[_0xec34('0x45')],qs[_0xec34('0x46')](_0x4cfd60[_0xec34('0x41')][_0xec34('0x46')]));_0x3b97a5['attributes']=_0x3b97a5[_0xec34('0x44')]['length']?_0x3b97a5['attributes']:_0x52e097['model'];if(_0x4cfd60['query']['includeAll']){_0x3b97a5['include']=[{'all':!![]}];}_0x3b97a5=_[_0xec34('0x4d')]({},_0x3b97a5,_0x4cfd60[_0xec34('0x50')]);return db[_0xec34('0x51')]['find'](_0x3b97a5)[_0xec34('0x21')](handleEntityNotFound(_0x25032f,null))['then'](respondWithResult(_0x25032f,null))[_0xec34('0x2a')](handleError(_0x25032f,null));};exports[_0xec34('0x38')]=function(_0x414786,_0x1f8338){if(_0x414786[_0xec34('0x58')]['id']){delete _0x414786['body']['id'];}return db[_0xec34('0x51')][_0xec34('0x59')]({'where':{'id':_0x414786[_0xec34('0x57')]['id']}})[_0xec34('0x21')](handleEntityNotFound(_0x1f8338,null))[_0xec34('0x21')](saveUpdates(_0x414786[_0xec34('0x58')],null))[_0xec34('0x21')](respondWithResult(_0x1f8338,null))[_0xec34('0x2a')](handleError(_0x1f8338,null));};exports['destroy']=function(_0x1732e5,_0x32d39a){return db[_0xec34('0x51')][_0xec34('0x59')]({'where':{'id':_0x1732e5[_0xec34('0x57')]['id']}})[_0xec34('0x21')](handleEntityNotFound(_0x32d39a,null))[_0xec34('0x21')](removeEntity(_0x32d39a,null))['catch'](handleError(_0x32d39a,null));};exports[_0xec34('0x5a')]=function(_0xec5833,_0x104266){return db['FaxMessage'][_0xec34('0x5a')]()[_0xec34('0x21')](respondWithResult(_0x104266,null))[_0xec34('0x2a')](handleError(_0x104266,null));};var interaction_log=require('../../config/logger')(_0xec34('0x5b'));exports['accept']=function(_0x35422b,_0x4121b6,_0x49d664){var _0x39e846={'agent':{},'channel':_0xec34('0x5c')};if(_0x35422b['body']['id']){delete _0x35422b[_0xec34('0x58')]['id'];}_0x35422b[_0xec34('0x58')][_0xec34('0x5d')]=!![];_0x35422b[_0xec34('0x58')][_0xec34('0x5e')]=moment()[_0xec34('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x35422b[_0xec34('0x58')]['UserId']=_0x35422b[_0xec34('0x58')][_0xec34('0x60')]||_0x35422b['user']['id'];_0x39e846[_0xec34('0x61')]['id']=_0x35422b[_0xec34('0x58')][_0xec34('0x60')];return db[_0xec34('0x51')][_0xec34('0x59')]({'where':{'id':_0x35422b['params']['id'],'UserId':null}})[_0xec34('0x21')](handleEntityNotFound(_0x4121b6,null))['then'](saveUpdates(_0x35422b[_0xec34('0x58')],null))[_0xec34('0x21')](function(_0x59bdeb){if(_0x59bdeb){_0x39e846['message']=_0x59bdeb[_0xec34('0x62')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x59bdeb[_0xec34('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x4121b6,null))[_0xec34('0x21')](function(_0x460b59){if(_0x460b59){return _0x460b59[_0xec34('0x38')]({'UserId':_0x35422b[_0xec34('0x58')][_0xec34('0x60')],'read1stAt':_[_0xec34('0x64')](_0x460b59[_0xec34('0x65')])?moment()[_0xec34('0x5f')](_0xec34('0x66')):undefined});}return null;})[_0xec34('0x21')](function(_0x30853b){if(_0x30853b){_0x39e846['interaction']=_0x30853b[_0xec34('0x62')]({'plain':!![]});interaction_log[_0xec34('0x22')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x35422b[_0xec34('0x67')]['id'],_0x35422b[_0xec34('0x67')][_0xec34('0x3b')],_0x35422b[_0xec34('0x67')][_0xec34('0x68')],_0x39e846[_0xec34('0x69')]['id'],_0x35422b['body']?JSON['stringify'](_0x35422b[_0xec34('0x58')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x39e846);}return null;})[_0xec34('0x21')](function(_0x55ad6f){var _0x2dbf46=_0xec34('0x6a')+_0x55ad6f[_0xec34('0x29')][_0xec34('0x6b')];return db[_0xec34('0x6c')]['query'](_0x2dbf46,{'type':db[_0xec34('0x6d')][_0xec34('0x6e')][_0xec34('0x6f')],'raw':!![]})[_0xec34('0x21')](function(_0x2111f9){return _0x2111f9;});})[_0xec34('0x21')](function(_0x1cac5c){if(_0x1cac5c){_0x39e846[_0xec34('0x29')]['contact']=_0x1cac5c[0x0];if(!_0x35422b[_0xec34('0x58')][_0xec34('0x60')])return;return db[_0xec34('0x70')][_0xec34('0x59')]({'where':{'id':_0x35422b[_0xec34('0x58')][_0xec34('0x60')],'role':_0xec34('0x61')},'attributes':['id',_0xec34('0x3b'),'fullname',_0xec34('0x71'),'internal'],'raw':!![]});}return null;})['then'](function(_0x398b62){if(!_0x398b62)return null;_0x39e846['message']['agent']=_0x398b62;return _0x39e846;})[_0xec34('0x21')](function(_0x242f2b){if(_0x242f2b){if(_0x35422b[_0xec34('0x58')]['manual']){_0x39e846[_0xec34('0x29')][_0xec34('0x72')]=util['format'](_0xec34('0x73'),_0x35422b[_0xec34('0x67')][_0xec34('0x3b')]);_0x39e846[_0xec34('0x29')]['channel']=_0x39e846['channel'];_0x39e846[_0xec34('0x29')]['motionChannel']=_0x39e846[_0xec34('0x74')];_0x39e846[_0xec34('0x29')][_0xec34('0x75')]=_0xec34('0x76');return respondWithRpcPromise(_0xec34('0x77'),'EventManager',{'event':_0xec34('0x78'),'message':_0x39e846[_0xec34('0x29')]},client9002)[_0xec34('0x21')](function(){return _0x39e846;});}return _0x39e846;}return null;})[_0xec34('0x21')](respondWithResult(_0x4121b6,null))['catch'](handleError(_0x4121b6,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0xec34('0x36')]=function(_0xf48e59,_0x1eb952,_0x1117f6){var _0x3a2d7d={'agent':{},'channel':'fax'};if(_0xf48e59[_0xec34('0x58')]['id']){delete _0xf48e59[_0xec34('0x58')]['id'];}_0xf48e59[_0xec34('0x58')][_0xec34('0x60')]=_0xf48e59[_0xec34('0x58')][_0xec34('0x60')]||_0xf48e59['user']['id'];_0x3a2d7d[_0xec34('0x61')]['id']=_0xf48e59['body']['UserId'];return db['FaxMessage'][_0xec34('0x59')]({'where':{'id':_0xf48e59[_0xec34('0x57')]['id'],'UserId':null}})[_0xec34('0x21')](handleEntityNotFound(_0x1eb952,null))[_0xec34('0x21')](function(_0x21b052){if(_0x21b052){_0x3a2d7d[_0xec34('0x29')]=_0x21b052[_0xec34('0x62')]({'plain':!![]});return db[_0xec34('0x79')]['find']({'where':{'id':_0x21b052['FaxInteractionId']}});}return null;})[_0xec34('0x21')](handleEntityNotFound(_0x1eb952,null))['then'](function(_0x263846){if(_0x263846){_0x3a2d7d[_0xec34('0x69')]=_0x263846['get']({'plain':!![]});interaction_log[_0xec34('0x22')](_0xec34('0x7a'),_0xf48e59[_0xec34('0x67')]['id'],_0xf48e59[_0xec34('0x67')]['name'],_0xf48e59[_0xec34('0x67')][_0xec34('0x68')],_0x3a2d7d['interaction']['id'],_0xf48e59[_0xec34('0x58')]?JSON[_0xec34('0x7b')](_0xf48e59[_0xec34('0x58')]):_0xec34('0x7c'));return respondWithRpcPromise(_0xec34('0x7d'),_0xec34('0x7e'),_0x3a2d7d);}return null;})[_0xec34('0x21')](function(_0x4f918a){var _0x31c55d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4f918a[_0xec34('0x29')][_0xec34('0x6b')];return db['sequelize'][_0xec34('0x41')](_0x31c55d,{'type':db['Sequelize'][_0xec34('0x6e')][_0xec34('0x6f')],'raw':!![]})[_0xec34('0x21')](function(_0x13eb62){return _0x13eb62;});})[_0xec34('0x21')](function(_0x2933de){if(_0x2933de){_0x3a2d7d['message']['contact']=_0x2933de[0x0];if(!_0xf48e59[_0xec34('0x58')][_0xec34('0x60')])return;return db[_0xec34('0x70')][_0xec34('0x59')]({'where':{'id':_0xf48e59[_0xec34('0x58')][_0xec34('0x60')],'role':'agent'},'attributes':['id',_0xec34('0x3b'),_0xec34('0x7f'),_0xec34('0x71'),_0xec34('0x80')],'raw':!![]});}return null;})[_0xec34('0x21')](function(_0x3f4f61){if(!_0x3f4f61)return null;_0x3a2d7d[_0xec34('0x29')][_0xec34('0x61')]=_0x3f4f61;return _0x3a2d7d;})['then'](function(_0x2e1cbc){if(_0x2e1cbc){_0x2e1cbc[_0xec34('0x29')]['interface']=util[_0xec34('0x5f')](_0xec34('0x73'),_0xf48e59[_0xec34('0x67')][_0xec34('0x3b')]);_0x2e1cbc[_0xec34('0x29')][_0xec34('0x74')]=_0x3a2d7d[_0xec34('0x74')];_0x2e1cbc[_0xec34('0x29')][_0xec34('0x81')]=_0x3a2d7d[_0xec34('0x74')];_0x2e1cbc['message'][_0xec34('0x75')]=_0xec34('0x36');respondWithRpcPromise(_0xec34('0x77'),_0xec34('0x77'),{'event':_0xec34('0x82'),'message':_0x2e1cbc[_0xec34('0x29')]},client9002);return _0x3a2d7d;}return null;})['then'](respondWithResult(_0x1eb952,null))[_0xec34('0x2a')](handleError(_0x1eb952,null));};exports[_0xec34('0x83')]=function(_0x49f343,_0x54d52d){var _0x11ccfb;return db[_0xec34('0x51')][_0xec34('0x83')](_0x49f343[_0xec34('0x58')],{})['then'](function(_0x5cbb60){_0x11ccfb=_0x5cbb60;return db['CmContact']['findOne']({'where':{'id':_0x11ccfb[_0xec34('0x6b')]}});})[_0xec34('0x21')](function(_0x280fb2){if(_['isNil'](_0x280fb2)){return;}else{_0x11ccfb[_0xec34('0x5c')]=_0x280fb2[_0xec34('0x5c')];return db[_0xec34('0x84')]['findOne']({'where':{'id':_0x11ccfb[_0xec34('0x85')]}});}})[_0xec34('0x21')](function(_0x49b454){return respondWithRpcPromise(_0xec34('0x86'),'SendFax',{'FaxAccountId':_[_0xec34('0x64')](_0x49f343[_0xec34('0x58')])?undefined:_0x49f343[_0xec34('0x58')]['FaxAccountId'],'path':_[_0xec34('0x64')](_0x49b454)?undefined:util[_0xec34('0x5f')](_0xec34('0x87'),_0x49b454['basename']),'fax':_['isNil'](_0x11ccfb[_0xec34('0x5c')])?undefined:_0x11ccfb[_0xec34('0x5c')],'AttachmentId':_0x11ccfb[_0xec34('0x85')]},client9002);})[_0xec34('0x21')](respondWithResult(_0x54d52d,0xc9))[_0xec34('0x2a')](handleError(_0x54d52d,null));};exports['download']=function(_0x5d621f,_0x3293c5){var _0x311c96=path[_0xec34('0x88')](config[_0xec34('0x89')],_0xec34('0x8a'),_0xec34('0x8b'),_0xec34('0x8c'));return db[_0xec34('0x51')][_0xec34('0x59')]({'where':{'id':_0x5d621f[_0xec34('0x57')]['id']},'include':[{'model':db[_0xec34('0x84')],'as':'Attachment'}]})[_0xec34('0x21')](handleEntityNotFound(_0x3293c5,null))[_0xec34('0x21')](function(_0x501b2f){if(_0x501b2f){return _0x3293c5['download'](path['join'](_0x311c96,_0x501b2f[_0xec34('0x84')][_0xec34('0x8d')]));}})[_0xec34('0x2a')](handleError(_0x3293c5,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 9aff860..a8c0211 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 _0xb7f0=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x184f59,_0x5815cc){var _0x2b01bc=function(_0x33f8ec){while(--_0x33f8ec){_0x184f59['push'](_0x184f59['shift']());}};_0x2b01bc(++_0x5815cc);}(_0xb7f0,0x1eb));var _0x0b7f=function(_0x5d4db8,_0x4ad01b){_0x5d4db8=_0x5d4db8-0x0;var _0x415548=_0xb7f0[_0x5d4db8];return _0x415548;};'use strict';var EventEmitter=require(_0x0b7f('0x0'));var FaxMessage=require(_0x0b7f('0x1'))['db'][_0x0b7f('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x0b7f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0b7f('0x4')};function emitEvent(_0xa1285e){return function(_0x228377,_0x188ea8,_0x34e188){FaxMessageEvents[_0x0b7f('0x5')](_0xa1285e+':'+_0x228377['id'],_0x228377);FaxMessageEvents[_0x0b7f('0x5')](_0xa1285e,_0x228377);_0x34e188(null);};}for(var e in events){if(events[_0x0b7f('0x6')](e)){var event=events[e];FaxMessage[_0x0b7f('0x7')](e,emitEvent(event));}}module[_0x0b7f('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x9a96=['../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0x9a96,0xd0));var _0x69a9=function(_0x23faaa,_0x41f6e2){_0x23faaa=_0x23faaa-0x0;var _0x53e177=_0x9a96[_0x23faaa];return _0x53e177;};'use strict';var EventEmitter=require(_0x69a9('0x0'));var FaxMessage=require(_0x69a9('0x1'))['db'][_0x69a9('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x69a9('0x3')](0x0);var events={'afterCreate':_0x69a9('0x4'),'afterUpdate':_0x69a9('0x5'),'afterDestroy':_0x69a9('0x6')};function emitEvent(_0x6c91e5){return function(_0x303516,_0x2480e1,_0xb7ac87){FaxMessageEvents[_0x69a9('0x7')](_0x6c91e5+':'+_0x303516['id'],_0x303516);FaxMessageEvents['emit'](_0x6c91e5,_0x303516);_0xb7ac87(null);};}for(var e in events){if(events[_0x69a9('0x8')](e)){var event=events[e];FaxMessage[_0x69a9('0x9')](e,emitEvent(event));}}module[_0x69a9('0xa')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index aaf630d..10f0a20 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 _0x0660=['bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','fax_messages','fti_fax_messages','body','FULLTEXT','get','direction','toLowerCase','out','isNil','FaxInteraction','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment'];(function(_0x229c57,_0x5eecbe){var _0x7bf8de=function(_0x33ca4e){while(--_0x33ca4e){_0x229c57['push'](_0x229c57['shift']());}};_0x7bf8de(++_0x5eecbe);}(_0x0660,0xf0));var _0x0066=function(_0x5540be,_0x55841d){_0x5540be=_0x5540be-0x0;var _0x15c0dc=_0x0660[_0x5540be];return _0x15c0dc;};'use strict';var _=require('lodash');var util=require(_0x0066('0x0'));var logger=require(_0x0066('0x1'))('api');var moment=require(_0x0066('0x2'));var BPromise=require(_0x0066('0x3'));var rp=require(_0x0066('0x4'));var fs=require('fs');var path=require(_0x0066('0x5'));var rimraf=require(_0x0066('0x6'));var config=require(_0x0066('0x7'));var attributes=require(_0x0066('0x8'));module[_0x0066('0x9')]=function(_0xab713,_0x5025ae){return _0xab713[_0x0066('0xa')]('FaxMessage',attributes,{'tableName':_0x0066('0xb'),'paranoid':![],'indexes':[{'name':_0x0066('0xc'),'fields':[_0x0066('0xd')],'type':_0x0066('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4375a3,_0x18d7b2,_0x528c1c){var _0x577976=_0xab713['models'];var _0x3796f2=_0x4375a3[_0x0066('0xf')]({'plain':!![]});if(_0x3796f2[_0x0066('0x10')][_0x0066('0x11')]()==='in'||_0x3796f2[_0x0066('0x10')][_0x0066('0x11')]()===_0x0066('0x12')&&!_0x3796f2['secret']&&!_[_0x0066('0x13')](_0x3796f2['UserId'])){_0x577976[_0x0066('0x14')]['findOne']({'where':{'id':_0x3796f2['FaxInteractionId']}})[_0x0066('0x15')](function(_0x59d0e5){if(_0x59d0e5){_0x59d0e5[_0x0066('0x16')]({'lastMsgAt':_0x3796f2[_0x0066('0x17')],'lastMsgDirection':_0x3796f2[_0x0066('0x10')][_0x0066('0x11')]()});}})[_0x0066('0x18')](function(_0xdce864){console['error'](_0xdce864);});}_0x528c1c();}},'charset':_0x0066('0x19'),'collate':_0x0066('0x1a')});}; \ No newline at end of file +var _0x6e98=['../../config/environment','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','models','get','toLowerCase','direction','secret','isNil','UserId','FaxInteraction','findOne','then','update','createdAt','error','utf8mb4_unicode_ci','lodash','../../config/logger','api','request-promise','path','rimraf'];(function(_0x302579,_0x5d6904){var _0x5d1267=function(_0x1fcff6){while(--_0x1fcff6){_0x302579['push'](_0x302579['shift']());}};_0x5d1267(++_0x5d6904);}(_0x6e98,0x159));var _0x86e9=function(_0x24cf7f,_0xcda231){_0x24cf7f=_0x24cf7f-0x0;var _0x4c6742=_0x6e98[_0x24cf7f];return _0x4c6742;};'use strict';var _=require(_0x86e9('0x0'));var util=require('util');var logger=require(_0x86e9('0x1'))(_0x86e9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x86e9('0x3'));var fs=require('fs');var path=require(_0x86e9('0x4'));var rimraf=require(_0x86e9('0x5'));var config=require(_0x86e9('0x6'));var attributes=require('./faxMessage.attributes');module[_0x86e9('0x7')]=function(_0x42d57c,_0x283be3){return _0x42d57c[_0x86e9('0x8')](_0x86e9('0x9'),attributes,{'tableName':_0x86e9('0xa'),'paranoid':![],'indexes':[{'name':_0x86e9('0xb'),'fields':[_0x86e9('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xd66cfd,_0x461f9d,_0x2ccca6){var _0x33c2c0=_0x42d57c[_0x86e9('0xd')];var _0xf151d0=_0xd66cfd[_0x86e9('0xe')]({'plain':!![]});if(_0xf151d0['direction'][_0x86e9('0xf')]()==='in'||_0xf151d0[_0x86e9('0x10')][_0x86e9('0xf')]()==='out'&&!_0xf151d0[_0x86e9('0x11')]&&!_[_0x86e9('0x12')](_0xf151d0[_0x86e9('0x13')])){_0x33c2c0[_0x86e9('0x14')][_0x86e9('0x15')]({'where':{'id':_0xf151d0['FaxInteractionId']}})[_0x86e9('0x16')](function(_0x276f98){if(_0x276f98){_0x276f98[_0x86e9('0x17')]({'lastMsgAt':_0xf151d0[_0x86e9('0x18')],'lastMsgDirection':_0xf151d0['direction'][_0x86e9('0xf')]()});}})['catch'](function(_0x4b74ea){console[_0x86e9('0x19')](_0x4b74ea);});}_0x2ccca6();}},'charset':'utf8mb4','collate':_0x86e9('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index da6c41d..79370a2 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 _0x5fd1=['debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxMessage','FaxMessage','create','body','raw','catch','UpdateFaxMessage','options','where','attributes','limit','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5fd1,0x155));var _0x15fd=function(_0x39cbd,_0x3fc63c){_0x39cbd=_0x39cbd-0x0;var _0x8d8414=_0x5fd1[_0x39cbd];return _0x8d8414;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});config[_0x15fd('0xa')]=_[_0x15fd('0xb')](config['redis'],{'host':_0x15fd('0xc'),'port':0x18eb});var socket=require(_0x15fd('0xd'))(new Redis(config[_0x15fd('0xa')]));require('./faxMessage.socket')[_0x15fd('0xe')](socket);function respondWithRpcPromise(_0x5c9c63,_0x3dfdbb,_0x250457){return new BPromise(function(_0x4c226a,_0x4883fd){return client['request'](_0x5c9c63,_0x250457)[_0x15fd('0xf')](function(_0x2a4d55){logger[_0x15fd('0x10')](_0x15fd('0x11'),_0x3dfdbb,_0x15fd('0x12'));logger[_0x15fd('0x13')](_0x15fd('0x14'),_0x3dfdbb,_0x15fd('0x12'),JSON[_0x15fd('0x15')](_0x2a4d55));if(_0x2a4d55['error']){if(_0x2a4d55['error']['code']===0x1f4){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);return _0x4883fd(_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);}logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55['error']['message']);return _0x4c226a(_0x2a4d55[_0x15fd('0x16')]['message']);}else{logger[_0x15fd('0x10')]('FaxMessage,\x20%s,\x20%s',_0x3dfdbb,_0x15fd('0x12'));_0x4c226a(_0x2a4d55[_0x15fd('0x18')][_0x15fd('0x17')]);}})['catch'](function(_0x367c36){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x367c36);_0x4883fd(_0x367c36);});});}exports[_0x15fd('0x19')]=function(_0x2fb919){var _0x36a90e=this;return new Promise(function(_0x3761db,_0x2f46f1){return db[_0x15fd('0x1a')][_0x15fd('0x1b')](_0x2fb919[_0x15fd('0x1c')],{'raw':_0x2fb919['options']?_0x2fb919['options'][_0x15fd('0x1d')]===undefined?!![]:![]:!![]})[_0x15fd('0xf')](function(_0x252a1c){logger[_0x15fd('0x10')](_0x15fd('0x19'),_0x2fb919);logger[_0x15fd('0x13')](_0x15fd('0x19'),_0x2fb919,JSON['stringify'](_0x252a1c));_0x3761db(_0x252a1c);})[_0x15fd('0x1e')](function(_0x2d19ac){logger[_0x15fd('0x16')]('CreateFaxMessage',_0x2d19ac[_0x15fd('0x17')],_0x2fb919);_0x2f46f1(_0x36a90e['error'](0x1f4,_0x2d19ac[_0x15fd('0x17')]));});});};exports[_0x15fd('0x1f')]=function(_0x21601d){var _0x4c9708=this;return new Promise(function(_0x16b87c,_0x1cbf2c){return db[_0x15fd('0x1a')]['update'](_0x21601d[_0x15fd('0x1c')],{'raw':_0x21601d['options']?_0x21601d[_0x15fd('0x20')][_0x15fd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x21')]||null:null,'attributes':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x22')]||null:null,'limit':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x23')]||null:null})['then'](function(_0x47c22c){logger[_0x15fd('0x10')]('UpdateFaxMessage',_0x21601d);logger[_0x15fd('0x13')](_0x15fd('0x1f'),_0x21601d,JSON['stringify'](_0x47c22c));_0x16b87c(_0x47c22c);})[_0x15fd('0x1e')](function(_0x197d15){logger['error'](_0x15fd('0x1f'),_0x197d15[_0x15fd('0x17')],_0x21601d);_0x1cbf2c(_0x4c9708[_0x15fd('0x16')](0x1f4,_0x197d15[_0x15fd('0x17')]));});});}; \ No newline at end of file +var _0x54ef=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./faxMessage.socket','request','then','info','request\x20sent','stringify','error','FaxMessage,\x20%s,\x20%s','message','result','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','where','attributes','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x1e3cdb,_0x3767f9){var _0x3fb2f9=function(_0x1c9e5a){while(--_0x1c9e5a){_0x1e3cdb['push'](_0x1e3cdb['shift']());}};_0x3fb2f9(++_0x3767f9);}(_0x54ef,0x112));var _0xf54e=function(_0x102137,_0x476aba){_0x102137=_0x102137-0x0;var _0x5f573d=_0x54ef[_0x102137];return _0x5f573d;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});config[_0xf54e('0xb')]=_[_0xf54e('0xc')](config['redis'],{'host':_0xf54e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf54e('0xb')]));require(_0xf54e('0xe'))['register'](socket);function respondWithRpcPromise(_0x26fc3e,_0xefa1c0,_0x6b9e61){return new BPromise(function(_0x3ecfb3,_0x5f232a){return client[_0xf54e('0xf')](_0x26fc3e,_0x6b9e61)[_0xf54e('0x10')](function(_0x143d66){logger[_0xf54e('0x11')]('FaxMessage,\x20%s,\x20%s',_0xefa1c0,_0xf54e('0x12'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0xefa1c0,_0xf54e('0x12'),JSON[_0xf54e('0x13')](_0x143d66));if(_0x143d66[_0xf54e('0x14')]){if(_0x143d66[_0xf54e('0x14')]['code']===0x1f4){logger[_0xf54e('0x14')](_0xf54e('0x15'),_0xefa1c0,_0x143d66[_0xf54e('0x14')][_0xf54e('0x16')]);return _0x5f232a(_0x143d66['error'][_0xf54e('0x16')]);}logger[_0xf54e('0x14')](_0xf54e('0x15'),_0xefa1c0,_0x143d66['error']['message']);return _0x3ecfb3(_0x143d66[_0xf54e('0x14')][_0xf54e('0x16')]);}else{logger[_0xf54e('0x11')](_0xf54e('0x15'),_0xefa1c0,_0xf54e('0x12'));_0x3ecfb3(_0x143d66[_0xf54e('0x17')][_0xf54e('0x16')]);}})[_0xf54e('0x18')](function(_0x1dcc04){logger[_0xf54e('0x14')](_0xf54e('0x15'),_0xefa1c0,_0x1dcc04);_0x5f232a(_0x1dcc04);});});}exports['CreateFaxMessage']=function(_0x48a7e1){var _0x23e14=this;return new Promise(function(_0x59f338,_0x3e1556){return db[_0xf54e('0x19')][_0xf54e('0x1a')](_0x48a7e1[_0xf54e('0x1b')],{'raw':_0x48a7e1[_0xf54e('0x1c')]?_0x48a7e1[_0xf54e('0x1c')][_0xf54e('0x1d')]===undefined?!![]:![]:!![]})[_0xf54e('0x10')](function(_0x3c0169){logger[_0xf54e('0x11')](_0xf54e('0x1e'),_0x48a7e1);logger['debug'](_0xf54e('0x1e'),_0x48a7e1,JSON['stringify'](_0x3c0169));_0x59f338(_0x3c0169);})[_0xf54e('0x18')](function(_0x272df6){logger[_0xf54e('0x14')](_0xf54e('0x1e'),_0x272df6[_0xf54e('0x16')],_0x48a7e1);_0x3e1556(_0x23e14[_0xf54e('0x14')](0x1f4,_0x272df6[_0xf54e('0x16')]));});});};exports[_0xf54e('0x1f')]=function(_0x2342a9){var _0x33457f=this;return new Promise(function(_0xf6cdd7,_0x39c0ae){return db[_0xf54e('0x19')]['update'](_0x2342a9[_0xf54e('0x1b')],{'raw':_0x2342a9['options']?_0x2342a9[_0xf54e('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2342a9[_0xf54e('0x1c')]?_0x2342a9[_0xf54e('0x1c')][_0xf54e('0x20')]||null:null,'attributes':_0x2342a9[_0xf54e('0x1c')]?_0x2342a9[_0xf54e('0x1c')][_0xf54e('0x21')]||null:null,'limit':_0x2342a9[_0xf54e('0x1c')]?_0x2342a9['options']['limit']||null:null})[_0xf54e('0x10')](function(_0x258d29){logger[_0xf54e('0x11')](_0xf54e('0x1f'),_0x2342a9);logger[_0xf54e('0x22')](_0xf54e('0x1f'),_0x2342a9,JSON[_0xf54e('0x13')](_0x258d29));_0xf6cdd7(_0x258d29);})[_0xf54e('0x18')](function(_0x3ae704){logger[_0xf54e('0x14')]('UpdateFaxMessage',_0x3ae704['message'],_0x2342a9);_0x39c0ae(_0x33457f[_0xf54e('0x14')](0x1f4,_0x3ae704[_0xf54e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 8f35a36..b3e977f 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 _0x12e2=['./faxMessage.events','save','remove','update','emit','length'];(function(_0x59098e,_0x4f5ada){var _0x28833a=function(_0x4e059e){while(--_0x4e059e){_0x59098e['push'](_0x59098e['shift']());}};_0x28833a(++_0x4f5ada);}(_0x12e2,0xcc));var _0x212e=function(_0x3342ef,_0x13fda4){_0x3342ef=_0x3342ef-0x0;var _0x386571=_0x12e2[_0x3342ef];return _0x386571;};'use strict';var FaxMessageEvents=require(_0x212e('0x0'));var events=[_0x212e('0x1'),_0x212e('0x2'),_0x212e('0x3')];function createListener(_0x180cf0,_0x73e556){return function(_0x28f70a){_0x73e556[_0x212e('0x4')](_0x180cf0,_0x28f70a);};}function removeListener(_0x1fd36a,_0xbeb464){return function(){FaxMessageEvents['removeListener'](_0x1fd36a,_0xbeb464);};}exports['register']=function(_0x2eb045){for(var _0x4cb999=0x0,_0x2650e9=events[_0x212e('0x5')];_0x4cb999<_0x2650e9;_0x4cb999++){var _0x2e067f=events[_0x4cb999];var _0x2286be=createListener('faxMessage:'+_0x2e067f,_0x2eb045);FaxMessageEvents['on'](_0x2e067f,_0x2286be);}}; \ No newline at end of file +var _0x2e16=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x339dd4,_0x4c1563){var _0x10992f=function(_0x44a770){while(--_0x44a770){_0x339dd4['push'](_0x339dd4['shift']());}};_0x10992f(++_0x4c1563);}(_0x2e16,0x1ce));var _0x62e1=function(_0x36ddcf,_0x2010c9){_0x36ddcf=_0x36ddcf-0x0;var _0x1da059=_0x2e16[_0x36ddcf];return _0x1da059;};'use strict';var FaxMessageEvents=require(_0x62e1('0x0'));var events=[_0x62e1('0x1'),_0x62e1('0x2'),_0x62e1('0x3')];function createListener(_0x27c8d3,_0x25182d){return function(_0x2c88fc){_0x25182d[_0x62e1('0x4')](_0x27c8d3,_0x2c88fc);};}function removeListener(_0x1df16f,_0x363b70){return function(){FaxMessageEvents[_0x62e1('0x5')](_0x1df16f,_0x363b70);};}exports[_0x62e1('0x6')]=function(_0x178fa2){for(var _0x1e70bf=0x0,_0x59cc34=events[_0x62e1('0x7')];_0x1e70bf<_0x59cc34;_0x1e70bf++){var _0x172609=events[_0x1e70bf];var _0x49c0f3=createListener(_0x62e1('0x8')+_0x172609,_0x178fa2);FaxMessageEvents['on'](_0x172609,_0x49c0f3);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 425a717..a2f1bae 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 _0xca66=['faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','tracked','fax'];(function(_0x220b13,_0x949610){var _0x5283e5=function(_0x2e0b40){while(--_0x2e0b40){_0x220b13['push'](_0x220b13['shift']());}};_0x5283e5(++_0x949610);}(_0xca66,0x8b));var _0x6ca6=function(_0x2c13c7,_0x11f488){_0x2c13c7=_0x2c13c7-0x0;var _0x4a6a45=_0xca66[_0x2c13c7];return _0x4a6a45;};'use strict';var multer=require(_0x6ca6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ca6('0x1'));var express=require(_0x6ca6('0x2'));var router=express[_0x6ca6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6ca6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6ca6('0x5'));var controller=require('./faxMessage.controller');router[_0x6ca6('0x6')]('/',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x8')]);router[_0x6ca6('0x6')](_0x6ca6('0x9'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xa')]);router['get'](_0x6ca6('0xb'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xc')]);router[_0x6ca6('0x6')](_0x6ca6('0xd'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xe')]);router['post']('/',auth[_0x6ca6('0x7')](),interaction[_0x6ca6('0xf')](_0x6ca6('0x10'),_0x6ca6('0x11')),controller[_0x6ca6('0x12')]);router[_0x6ca6('0x13')]('/:id',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x14')]);router['put'](_0x6ca6('0x15'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x16')]);router[_0x6ca6('0x13')](_0x6ca6('0x17'),auth[_0x6ca6('0x7')](),controller['reject']);router['delete']('/:id',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x18')]);module[_0x6ca6('0x19')]=router; \ No newline at end of file +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','faxmessage:create','create','put','update','/:id/accept','/:id/reject','delete','destroy','multer','util','path','express','Router'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe706,0xa3));var _0x6e70=function(_0x2089b3,_0x31fbde){_0x2089b3=_0x2089b3-0x0;var _0x181087=_0xe706[_0x2089b3];return _0x181087;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')]('/',auth[_0x6e70('0xb')](),interaction['tracked']('fax',_0x6e70('0x14')),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')](_0x6e70('0x18'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x6e70('0x19'),auth['isAuthenticated'](),controller['reject']);router[_0x6e70('0x1a')](_0x6e70('0xf'),auth['isAuthenticated'](),controller[_0x6e70('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index bd50669..f47e685 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 _0x5c21=['exports','STRING','name','ENUM','rrmemory','beepall','roundrobin','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c21,0x90));var _0x15c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c21[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x15c2('0x0')]={'name':{'type':Sequelize[_0x15c2('0x1')],'unique':_0x15c2('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x15c2('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x15c2('0x3')](_0x15c2('0x4'),_0x15c2('0x5'),_0x15c2('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x15c2('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9354=['INTEGER','sequelize','exports','STRING','name','ENUM','beepall'];(function(_0x1edf32,_0x1246c7){var _0x291779=function(_0x1fc985){while(--_0x1fc985){_0x1edf32['push'](_0x1edf32['shift']());}};_0x291779(++_0x1246c7);}(_0x9354,0xf6));var _0x4935=function(_0x4bf96c,_0x4d24fd){_0x4bf96c=_0x4bf96c-0x0;var _0x281d09=_0x9354[_0x4bf96c];return _0x281d09;};'use strict';var Sequelize=require(_0x4935('0x0'));module[_0x4935('0x1')]={'name':{'type':Sequelize[_0x4935('0x2')],'unique':_0x4935('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4935('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4935('0x4')]('rrmemory',_0x4935('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x4935('0x6')],'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 2726c21..e2073b4 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 _0xa831=['findAll','online','interface','flatMap','sequelize','transaction','each','emit','userFaxQueue:save','removeTeams','Team','ids','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','every','TeamId','includes','all','union','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','spread','getAgents','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','FaxQueue','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','error','params','describe','getMembers','findOne','UserFaxQueue','nolimit','User','findAndCountAll','UserId','faxPause','updatedAt','format','%s/%s','SIP','getTeams','addTeams'];(function(_0x37cbfc,_0x315a49){var _0x123ea8=function(_0x5a94f0){while(--_0x5a94f0){_0x37cbfc['push'](_0x37cbfc['shift']());}};_0x123ea8(++_0x315a49);}(_0xa831,0x138));var _0x1a83=function(_0x2b737c,_0x274adf){_0x2b737c=_0x2b737c-0x0;var _0x466ed5=_0xa831[_0x2b737c];return _0x466ed5;};'use strict';var emlformat=require(_0x1a83('0x0'));var rimraf=require(_0x1a83('0x1'));var zipdir=require(_0x1a83('0x2'));var jsonpatch=require(_0x1a83('0x3'));var rp=require(_0x1a83('0x4'));var moment=require('moment');var BPromise=require(_0x1a83('0x5'));var Mustache=require(_0x1a83('0x6'));var util=require(_0x1a83('0x7'));var path=require(_0x1a83('0x8'));var sox=require(_0x1a83('0x9'));var csv=require(_0x1a83('0xa'));var ejs=require(_0x1a83('0xb'));var fs=require('fs');var fs_extra=require(_0x1a83('0xc'));var _=require('lodash');var squel=require(_0x1a83('0xd'));var crypto=require(_0x1a83('0xe'));var jsforce=require(_0x1a83('0xf'));var deskjs=require(_0x1a83('0x10'));var toCsv=require(_0x1a83('0xa'));var querystring=require(_0x1a83('0x11'));var Papa=require(_0x1a83('0x12'));var Redis=require(_0x1a83('0x13'));var authService=require(_0x1a83('0x14'));var qs=require(_0x1a83('0x15'));var as=require(_0x1a83('0x16'));var hardwareService=require(_0x1a83('0x17'));var logger=require(_0x1a83('0x18'))('api');var utils=require(_0x1a83('0x19'));var config=require(_0x1a83('0x1a'));var licenseUtil=require(_0x1a83('0x1b'));var db=require(_0x1a83('0x1c'))['db'];config['redis']=_[_0x1a83('0x1d')](config[_0x1a83('0x1e')],{'host':_0x1a83('0x1f'),'port':0x18eb});var socket=require(_0x1a83('0x20'))(new Redis(config[_0x1a83('0x1e')]));require(_0x1a83('0x21'))[_0x1a83('0x22')](socket);function respondWithStatusCode(_0x3c8699,_0x2b4b55){_0x2b4b55=_0x2b4b55||0xcc;return function(_0x265c74){if(_0x265c74){return _0x3c8699[_0x1a83('0x23')](_0x2b4b55);}return _0x3c8699[_0x1a83('0x24')](_0x2b4b55)[_0x1a83('0x25')]();};}function respondWithResult(_0x20d439,_0x27db53){_0x27db53=_0x27db53||0xc8;return function(_0x34621c){if(_0x34621c){return _0x20d439[_0x1a83('0x24')](_0x27db53)[_0x1a83('0x26')](_0x34621c);}};}function respondWithFilteredResult(_0x1bc815,_0x5cee42){return function(_0x4548b5){if(_0x4548b5){var _0x250add=typeof _0x5cee42[_0x1a83('0x27')]==='undefined'&&typeof _0x5cee42[_0x1a83('0x28')]==='undefined';var _0x55ed28=_0x4548b5['count'];var _0x3dc477=_0x250add?0x0:_0x5cee42[_0x1a83('0x27')];var _0x53a245=_0x250add?_0x4548b5[_0x1a83('0x29')]:_0x5cee42['offset']+_0x5cee42['limit'];var _0x104370;if(_0x53a245>=_0x55ed28){_0x53a245=_0x55ed28;_0x104370=0xc8;}else{_0x104370=0xce;}_0x1bc815[_0x1a83('0x24')](_0x104370);return _0x1bc815[_0x1a83('0x2a')](_0x1a83('0x2b'),_0x3dc477+'-'+_0x53a245+'/'+_0x55ed28)[_0x1a83('0x26')](_0x4548b5);}return null;};}function patchUpdates(_0x54769d){return function(_0x1c6b40){try{jsonpatch[_0x1a83('0x2c')](_0x1c6b40,_0x54769d,!![]);}catch(_0x4594ca){return BPromise[_0x1a83('0x2d')](_0x4594ca);}return _0x1c6b40[_0x1a83('0x2e')]();};}function saveUpdates(_0x3d99d5,_0x473fcb){return function(_0x18b058){if(_0x18b058){return _0x18b058[_0x1a83('0x2f')](_0x3d99d5)[_0x1a83('0x30')](function(_0x4b2ba6){return _0x4b2ba6;});}return null;};}function removeEntity(_0x2f6013,_0x9a4b69){return function(_0x5a5f20){if(_0x5a5f20){return _0x5a5f20[_0x1a83('0x31')]()[_0x1a83('0x30')](function(){var _0x52c5c9=_0x5a5f20[_0x1a83('0x32')]({'plain':!![]});var _0x4dbe6b=_0x1a83('0x33');return db['UserProfileResource'][_0x1a83('0x31')]({'where':{'type':_0x4dbe6b,'resourceId':_0x52c5c9['id']}})[_0x1a83('0x30')](function(){return _0x5a5f20;});})[_0x1a83('0x30')](function(){_0x2f6013[_0x1a83('0x24')](0xcc)[_0x1a83('0x25')]();});}};}function handleEntityNotFound(_0x5baa20,_0x39de8a){return function(_0x21dade){if(!_0x21dade){_0x5baa20['sendStatus'](0x194);}return _0x21dade;};}function handleError(_0xfb689d,_0x3e87b1){_0x3e87b1=_0x3e87b1||0x1f4;return function(_0x3e92a4){logger['error'](_0x3e92a4['stack']);if(_0x3e92a4[_0x1a83('0x34')]){delete _0x3e92a4['name'];}_0xfb689d['status'](_0x3e87b1)[_0x1a83('0x35')](_0x3e92a4);};}exports[_0x1a83('0x36')]=function(_0x23fcbd,_0x4c2549){var _0x1c7dd8={},_0x3b6351={},_0x62c5a1={'count':0x0,'rows':[]};var _0x2fb5d2=_[_0x1a83('0x37')](db['FaxQueue'][_0x1a83('0x38')],function(_0x20cae1){return{'name':_0x20cae1[_0x1a83('0x39')],'type':_0x20cae1[_0x1a83('0x3a')][_0x1a83('0x3b')]};});_0x3b6351[_0x1a83('0x3c')]=_[_0x1a83('0x37')](_0x2fb5d2,_0x1a83('0x34'));_0x3b6351['query']=_[_0x1a83('0x3d')](_0x23fcbd[_0x1a83('0x3e')]);_0x3b6351[_0x1a83('0x3f')]=_['intersection'](_0x3b6351[_0x1a83('0x3c')],_0x3b6351[_0x1a83('0x3e')]);_0x1c7dd8[_0x1a83('0x40')]=_[_0x1a83('0x41')](_0x3b6351[_0x1a83('0x3c')],qs[_0x1a83('0x42')](_0x23fcbd['query']['fields']));_0x1c7dd8[_0x1a83('0x40')]=_0x1c7dd8[_0x1a83('0x40')][_0x1a83('0x43')]?_0x1c7dd8['attributes']:_0x3b6351[_0x1a83('0x3c')];if(!_0x23fcbd[_0x1a83('0x3e')]['hasOwnProperty']('nolimit')){_0x1c7dd8[_0x1a83('0x28')]=qs[_0x1a83('0x28')](_0x23fcbd[_0x1a83('0x3e')][_0x1a83('0x28')]);_0x1c7dd8[_0x1a83('0x27')]=qs[_0x1a83('0x27')](_0x23fcbd[_0x1a83('0x3e')][_0x1a83('0x27')]);}_0x1c7dd8[_0x1a83('0x44')]=qs['sort'](_0x23fcbd[_0x1a83('0x3e')][_0x1a83('0x45')]);_0x1c7dd8[_0x1a83('0x46')]=qs[_0x1a83('0x3f')](_[_0x1a83('0x47')](_0x23fcbd[_0x1a83('0x3e')],_0x3b6351['filters']),_0x2fb5d2);if(_0x23fcbd[_0x1a83('0x3e')][_0x1a83('0x48')]){_0x1c7dd8[_0x1a83('0x46')]=_[_0x1a83('0x49')](_0x1c7dd8[_0x1a83('0x46')],{'$or':_[_0x1a83('0x37')](_0x2fb5d2,function(_0x3f63e0){if(_0x3f63e0['type']!==_0x1a83('0x4a')){var _0x81c537={};_0x81c537[_0x3f63e0['name']]={'$like':'%'+_0x23fcbd[_0x1a83('0x3e')][_0x1a83('0x48')]+'%'};return _0x81c537;}})});}_0x1c7dd8=_[_0x1a83('0x49')]({},_0x1c7dd8,_0x23fcbd[_0x1a83('0x4b')]);var _0x3c5b25={'where':_0x1c7dd8[_0x1a83('0x46')]};return db['FaxQueue'][_0x1a83('0x29')](_0x3c5b25)[_0x1a83('0x30')](function(_0xcaca5f){_0x62c5a1[_0x1a83('0x29')]=_0xcaca5f;if(_0x23fcbd[_0x1a83('0x3e')][_0x1a83('0x4c')]){_0x1c7dd8[_0x1a83('0x4d')]=[{'all':!![]}];}return db[_0x1a83('0x4e')]['findAll'](_0x1c7dd8);})['then'](function(_0x5994ab){_0x62c5a1[_0x1a83('0x4f')]=_0x5994ab;return _0x62c5a1;})[_0x1a83('0x30')](respondWithFilteredResult(_0x4c2549,_0x1c7dd8))[_0x1a83('0x50')](handleError(_0x4c2549,null));};exports[_0x1a83('0x51')]=function(_0x41bfe5,_0x3a67c1){var _0xc60362={'raw':!![],'where':{'id':_0x41bfe5['params']['id']}},_0x5c0bd5={};_0x5c0bd5[_0x1a83('0x3c')]=_[_0x1a83('0x3d')](db['FaxQueue'][_0x1a83('0x38')]);_0x5c0bd5[_0x1a83('0x3e')]=_[_0x1a83('0x3d')](_0x41bfe5['query']);_0x5c0bd5[_0x1a83('0x3f')]=_[_0x1a83('0x41')](_0x5c0bd5[_0x1a83('0x3c')],_0x5c0bd5[_0x1a83('0x3e')]);_0xc60362[_0x1a83('0x40')]=_[_0x1a83('0x41')](_0x5c0bd5[_0x1a83('0x3c')],qs[_0x1a83('0x42')](_0x41bfe5[_0x1a83('0x3e')][_0x1a83('0x42')]));_0xc60362[_0x1a83('0x40')]=_0xc60362[_0x1a83('0x40')][_0x1a83('0x43')]?_0xc60362['attributes']:_0x5c0bd5[_0x1a83('0x3c')];if(_0x41bfe5['query'][_0x1a83('0x4c')]){_0xc60362[_0x1a83('0x4d')]=[{'all':!![]}];}_0xc60362=_[_0x1a83('0x49')]({},_0xc60362,_0x41bfe5[_0x1a83('0x4b')]);return db[_0x1a83('0x4e')][_0x1a83('0x52')](_0xc60362)[_0x1a83('0x30')](handleEntityNotFound(_0x3a67c1,null))[_0x1a83('0x30')](respondWithResult(_0x3a67c1,null))[_0x1a83('0x50')](handleError(_0x3a67c1,null));};exports[_0x1a83('0x53')]=function(_0x2741cb,_0x40f218){return db[_0x1a83('0x4e')][_0x1a83('0x53')](_0x2741cb[_0x1a83('0x54')],{})[_0x1a83('0x30')](function(_0x42e933){var _0x35f930=_0x2741cb[_0x1a83('0x55')][_0x1a83('0x32')]({'plain':!![]});if(!_0x35f930)throw new Error(_0x1a83('0x56'));if(_0x35f930[_0x1a83('0x57')]==='user'){var _0x4332fe=_0x42e933['get']({'plain':!![]});var _0x3a5929=_0x1a83('0x33');return db[_0x1a83('0x58')][_0x1a83('0x52')]({'where':{'name':_0x3a5929,'userProfileId':_0x35f930[_0x1a83('0x59')]},'raw':!![]})[_0x1a83('0x30')](function(_0x551485){if(_0x551485&&_0x551485['autoAssociation']===0x0){return db[_0x1a83('0x5a')][_0x1a83('0x53')]({'name':_0x4332fe[_0x1a83('0x34')],'resourceId':_0x4332fe['id'],'type':_0x551485[_0x1a83('0x34')],'sectionId':_0x551485['id']},{})[_0x1a83('0x30')](function(){return _0x42e933;});}else{return _0x42e933;}})[_0x1a83('0x50')](function(_0x33501d){logger[_0x1a83('0x5b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33501d);throw _0x33501d;});}return _0x42e933;})[_0x1a83('0x30')](respondWithResult(_0x40f218,0xc9))[_0x1a83('0x50')](handleError(_0x40f218,null));};exports[_0x1a83('0x2f')]=function(_0x1f6dcf,_0x318558){if(_0x1f6dcf[_0x1a83('0x54')]['id']){delete _0x1f6dcf[_0x1a83('0x54')]['id'];}return db['FaxQueue'][_0x1a83('0x52')]({'where':{'id':_0x1f6dcf[_0x1a83('0x5c')]['id']}})[_0x1a83('0x30')](handleEntityNotFound(_0x318558,null))[_0x1a83('0x30')](saveUpdates(_0x1f6dcf[_0x1a83('0x54')],null))[_0x1a83('0x30')](respondWithResult(_0x318558,null))[_0x1a83('0x50')](handleError(_0x318558,null));};exports[_0x1a83('0x31')]=function(_0x53daf2,_0x1466ca){return db['FaxQueue'][_0x1a83('0x52')]({'where':{'id':_0x53daf2['params']['id']}})['then'](handleEntityNotFound(_0x1466ca,null))[_0x1a83('0x30')](removeEntity(_0x1466ca,null))[_0x1a83('0x50')](handleError(_0x1466ca,null));};exports[_0x1a83('0x5d')]=function(_0x37c8b4,_0x78f85a){return db[_0x1a83('0x4e')][_0x1a83('0x5d')]()[_0x1a83('0x30')](respondWithResult(_0x78f85a,null))[_0x1a83('0x50')](handleError(_0x78f85a,null));};exports[_0x1a83('0x5e')]=function(_0x25639e,_0x4b9c35,_0x9c866c){var _0x3fa0f3={'raw':!![],'where':{}},_0x14a4eb={},_0x1a49eb;return db['FaxQueue'][_0x1a83('0x5f')]({'where':{'id':_0x25639e['params']['id']}})[_0x1a83('0x30')](handleEntityNotFound(_0x4b9c35,null))[_0x1a83('0x30')](function(_0xdfc09b){if(_0xdfc09b){_0x1a49eb=_0xdfc09b['get']({'plain':!![]});_0x14a4eb[_0x1a83('0x3c')]=_[_0x1a83('0x3d')](db[_0x1a83('0x60')][_0x1a83('0x38')]);_0x14a4eb['query']=_['keys'](_0x25639e[_0x1a83('0x3e')]);_0x14a4eb[_0x1a83('0x3f')]=_['intersection'](_0x14a4eb[_0x1a83('0x3c')],_0x14a4eb['query']);_0x3fa0f3[_0x1a83('0x40')]=_['intersection'](_0x14a4eb[_0x1a83('0x3c')],qs[_0x1a83('0x42')](_0x25639e[_0x1a83('0x3e')][_0x1a83('0x42')]));_0x3fa0f3[_0x1a83('0x40')]=_0x3fa0f3['attributes'][_0x1a83('0x43')]?_0x3fa0f3[_0x1a83('0x40')]:_0x14a4eb[_0x1a83('0x3c')];if(!_0x25639e['query']['hasOwnProperty'](_0x1a83('0x61'))){_0x3fa0f3[_0x1a83('0x28')]=qs[_0x1a83('0x28')](_0x25639e[_0x1a83('0x3e')]['limit']);_0x3fa0f3['offset']=qs[_0x1a83('0x27')](_0x25639e[_0x1a83('0x3e')][_0x1a83('0x27')]);}_0x3fa0f3[_0x1a83('0x44')]=qs[_0x1a83('0x45')](_0x25639e['query']['sort']);_0x3fa0f3[_0x1a83('0x46')]=qs[_0x1a83('0x3f')](_[_0x1a83('0x47')](_0x25639e[_0x1a83('0x3e')],_0x14a4eb['filters']));_0x3fa0f3[_0x1a83('0x46')]['FaxQueueId']=_0xdfc09b['id'];if(_0x25639e['query'][_0x1a83('0x48')]){_0x3fa0f3[_0x1a83('0x46')]=_['merge'](_0x3fa0f3[_0x1a83('0x46')],{'$or':_['map'](_0x3fa0f3[_0x1a83('0x40')],function(_0x9dd8f3){var _0x4de935={};_0x4de935[_0x9dd8f3]={'$like':'%'+_0x25639e[_0x1a83('0x3e')][_0x1a83('0x48')]+'%'};return _0x4de935;})});}_0x3fa0f3=_[_0x1a83('0x49')]({},_0x3fa0f3,_0x25639e['options']);return db[_0x1a83('0x60')]['findAll'](_0x3fa0f3);}})[_0x1a83('0x30')](function(_0x5811ff){if(_0x5811ff){return db[_0x1a83('0x62')][_0x1a83('0x63')]({'where':{'id':_['map'](_0x5811ff,_0x1a83('0x64')),'role':'agent'},'attributes':['id',_0x1a83('0x34'),_0x1a83('0x65'),_0x1a83('0x66'),'createdAt']});}})[_0x1a83('0x30')](function(_0x54f14b){if(_0x54f14b){return{'count':_0x54f14b['count'],'rows':_['map'](_0x54f14b[_0x1a83('0x4f')],function(_0x17bf91){return{'membername':_0x17bf91[_0x1a83('0x34')],'UserId':_0x17bf91['id'],'queue_name':_0x1a49eb[_0x1a83('0x34')],'FaxQueueId':_0x1a49eb['id'],'interface':util[_0x1a83('0x67')](_0x1a83('0x68'),_0x1a83('0x69'),_0x17bf91[_0x1a83('0x34')]),'penalty':0x0,'paused':_0x17bf91['faxPause'],'createdAt':_0x17bf91['createdAt'],'updatedAt':_0x17bf91[_0x1a83('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1a83('0x30')](respondWithFilteredResult(_0x4b9c35,_0x3fa0f3))[_0x1a83('0x50')](handleError(_0x4b9c35,null));};exports[_0x1a83('0x6a')]=function(_0x2a817a,_0x1a88d0,_0x4daf54){var _0x51df1c={};var _0x5a4a43={};var _0x2a4855;var _0x19d99f;return db[_0x1a83('0x4e')][_0x1a83('0x5f')]({'where':{'id':_0x2a817a['params']['id']}})[_0x1a83('0x30')](handleEntityNotFound(_0x1a88d0,null))['then'](function(_0x3ad222){if(_0x3ad222){_0x2a4855=_0x3ad222;_0x5a4a43['model']=_[_0x1a83('0x3d')](db['Team'][_0x1a83('0x38')]);_0x5a4a43[_0x1a83('0x3e')]=_[_0x1a83('0x3d')](_0x2a817a[_0x1a83('0x3e')]);_0x5a4a43[_0x1a83('0x3f')]=_[_0x1a83('0x41')](_0x5a4a43[_0x1a83('0x3c')],_0x5a4a43[_0x1a83('0x3e')]);_0x51df1c[_0x1a83('0x40')]=_['intersection'](_0x5a4a43[_0x1a83('0x3c')],qs['fields'](_0x2a817a[_0x1a83('0x3e')]['fields']));_0x51df1c[_0x1a83('0x40')]=_0x51df1c[_0x1a83('0x40')][_0x1a83('0x43')]?_0x51df1c[_0x1a83('0x40')]:_0x5a4a43['model'];_0x51df1c[_0x1a83('0x44')]=qs[_0x1a83('0x45')](_0x2a817a[_0x1a83('0x3e')][_0x1a83('0x45')]);_0x51df1c[_0x1a83('0x46')]=qs[_0x1a83('0x3f')](_[_0x1a83('0x47')](_0x2a817a[_0x1a83('0x3e')],_0x5a4a43[_0x1a83('0x3f')]));if(_0x2a817a[_0x1a83('0x3e')]['filter']){_0x51df1c[_0x1a83('0x46')]=_['merge'](_0x51df1c[_0x1a83('0x46')],{'$or':_[_0x1a83('0x37')](_0x51df1c[_0x1a83('0x40')],function(_0xe8c340){var _0x343e91={};_0x343e91[_0xe8c340]={'$like':'%'+_0x2a817a[_0x1a83('0x3e')][_0x1a83('0x48')]+'%'};return _0x343e91;})});}_0x51df1c=_[_0x1a83('0x49')]({},_0x51df1c,_0x2a817a[_0x1a83('0x4b')]);return _0x2a4855[_0x1a83('0x6a')](_0x51df1c);}})['then'](function(_0x11ec5e){if(_0x11ec5e){_0x19d99f=_0x11ec5e['length'];if(!_0x2a817a['query']['hasOwnProperty'](_0x1a83('0x61'))){_0x51df1c[_0x1a83('0x28')]=qs[_0x1a83('0x28')](_0x2a817a[_0x1a83('0x3e')]['limit']);_0x51df1c['offset']=qs['offset'](_0x2a817a[_0x1a83('0x3e')]['offset']);}return _0x2a4855[_0x1a83('0x6a')](_0x51df1c);}})[_0x1a83('0x30')](function(_0x3e3279){if(_0x3e3279){return _0x3e3279?{'count':_0x19d99f,'rows':_0x3e3279}:null;}})[_0x1a83('0x30')](respondWithResult(_0x1a88d0,null))[_0x1a83('0x50')](handleError(_0x1a88d0,null));};exports[_0x1a83('0x6b')]=function(_0x26db67,_0x346c7b,_0x4818b2){var _0x199937=_0x26db67[_0x1a83('0x54')]['ids'];return db['Team'][_0x1a83('0x6c')]({'where':{'id':_0x199937},'attributes':['id'],'include':[{'model':db[_0x1a83('0x62')],'as':'Agents','attributes':['id',_0x1a83('0x34'),_0x1a83('0x6d'),'voicePause',_0x1a83('0x6e')],'raw':!![]}]})[_0x1a83('0x30')](function(_0x2a8bc2){if(_0x2a8bc2){var _0x487483=_[_0x1a83('0x6f')](_0x2a8bc2,function(_0x2546a9){var _0x5b783d=_0x2546a9['get']({'plain':!![]});return _0x5b783d['Agents'];});return db[_0x1a83('0x4e')][_0x1a83('0x52')]({'where':{'id':_0x26db67[_0x1a83('0x5c')]['id']}})['then'](function(_0x2dbdbf){return db[_0x1a83('0x70')][_0x1a83('0x71')](function(_0x31dab8){return _0x2dbdbf[_0x1a83('0x6b')](_0x199937,{'transaction':_0x31dab8})[_0x1a83('0x30')](function(){return BPromise[_0x1a83('0x72')](_0x487483,function(_0x2a6ca9){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x2a6ca9['id'],'FaxQueueId':_0x26db67['params']['id']},'transaction':_0x31dab8});});})[_0x1a83('0x30')](function(){_0x487483['forEach'](function(_0x177097){socket[_0x1a83('0x73')](_0x1a83('0x74'),{'UserId':_0x177097['id'],'FaxQueueId':_0x2dbdbf['id']});});});});});}})['then'](respondWithStatusCode(_0x346c7b,null))[_0x1a83('0x50')](handleError(_0x346c7b,null));};exports[_0x1a83('0x75')]=function(_0x16f796,_0x235ec4,_0x498175){return db[_0x1a83('0x76')]['findAll']({'where':{'id':_0x16f796[_0x1a83('0x3e')][_0x1a83('0x77')]},'attributes':['id'],'include':[{'model':db[_0x1a83('0x62')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x235ec4,null))[_0x1a83('0x30')](function(_0x42c0df){var _0x49b861=_[_0x1a83('0x37')](_0x42c0df,'id');var _0x4c5a3a=[];var _0x1e6786=[];var _0x1da784=squel['select']();_0x1da784[_0x1a83('0x78')]('tq.TeamId')[_0x1a83('0x79')]('team_has_fax_queues','tq')['join'](_0x1a83('0x7a'),'ut',_0x1a83('0x7b'))['where']('FaxQueueId\x20=\x20?',_0x16f796['params']['id']);for(var _0x245cea=0x0;_0x245cea<_0x42c0df['length'];_0x245cea+=0x1){let _0x4ea058=_0x42c0df[_0x245cea];for(var _0x49227f=0x0;_0x49227f<_0x4ea058['Agents'][_0x1a83('0x43')];_0x49227f+=0x1){let _0x2e6e34=_0x4ea058['Agents'][_0x49227f];var _0x50053c=_0x1da784[_0x1a83('0x7c')]();_0x50053c['where'](_0x1a83('0x7d'),_0x2e6e34['id']);_0x1e6786['push'](db['sequelize'][_0x1a83('0x3e')](_0x50053c['toString'](),{'type':db[_0x1a83('0x70')]['QueryTypes']['SELECT']})[_0x1a83('0x30')](function(_0x2d220a){if(_0x2d220a[_0x1a83('0x43')]===0x1){return _0x2e6e34['id'];}else{var _0x36e565=_[_0x1a83('0x7e')](_['map'](_0x2d220a,_0x1a83('0x7f')),function(_0x40bf0e){return _[_0x1a83('0x80')](_0x49b861,_0x40bf0e);});if(_0x36e565){return _0x2e6e34['id'];}}}));}}return BPromise[_0x1a83('0x81')](_0x1e6786)[_0x1a83('0x30')](function(_0x50919a){_0x4c5a3a=_(_0x4c5a3a)[_0x1a83('0x82')](_0x50919a)['compact']()['value']();return db['FaxQueue'][_0x1a83('0x52')]({'where':{'id':_0x16f796[_0x1a83('0x5c')]['id']}})[_0x1a83('0x30')](function(_0x2b92d7){return db[_0x1a83('0x70')][_0x1a83('0x71')](function(_0x256138){return _0x2b92d7[_0x1a83('0x75')](_0x16f796['query'][_0x1a83('0x77')],{'transaction':_0x256138})['then'](function(){if(!_[_0x1a83('0x83')](_0x4c5a3a)){return _0x2b92d7[_0x1a83('0x84')](_0x4c5a3a,{'transaction':_0x256138});}})[_0x1a83('0x30')](function(){_0x4c5a3a[_0x1a83('0x85')](function(_0x4ce209){socket[_0x1a83('0x73')](_0x1a83('0x86'),{'UserId':_0x4ce209,'FaxQueueId':_0x2b92d7['id']});});});});});});})[_0x1a83('0x30')](respondWithStatusCode(_0x235ec4,null))[_0x1a83('0x50')](handleError(_0x235ec4,null));};exports[_0x1a83('0x87')]=function(_0x3b3499,_0x360f23,_0x3c0f56){return db[_0x1a83('0x4e')][_0x1a83('0x52')]({'where':{'id':_0x3b3499[_0x1a83('0x5c')]['id']}})[_0x1a83('0x30')](handleEntityNotFound(_0x360f23,null))[_0x1a83('0x30')](function(_0x2d5140){if(_0x2d5140){return _0x2d5140['addAgents'](_0x3b3499[_0x1a83('0x54')]['ids'],_[_0x1a83('0x88')](_0x3b3499[_0x1a83('0x54')],['ids','id'])||{})[_0x1a83('0x89')](function(_0x181992){for(var _0x598564=0x0;_0x598564<_0x3b3499[_0x1a83('0x54')][_0x1a83('0x77')][_0x1a83('0x43')];_0x598564+=0x1){socket[_0x1a83('0x73')](_0x1a83('0x74'),{'UserId':Number(_0x3b3499[_0x1a83('0x54')][_0x1a83('0x77')][_0x598564]),'FaxQueueId':Number(_0x3b3499[_0x1a83('0x5c')]['id'])});}return _0x181992;});}})[_0x1a83('0x30')](respondWithResult(_0x360f23,null))[_0x1a83('0x50')](handleError(_0x360f23,null));};exports[_0x1a83('0x84')]=function(_0x20e013,_0x2e0370,_0xd035c6){return db[_0x1a83('0x4e')][_0x1a83('0x52')]({'where':{'id':_0x20e013[_0x1a83('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2e0370,null))[_0x1a83('0x30')](function(_0x2d64e4){if(_0x2d64e4){return _0x2d64e4[_0x1a83('0x84')](_0x20e013[_0x1a83('0x3e')][_0x1a83('0x77')])[_0x1a83('0x30')](function(){if(_['isArray'](_0x20e013[_0x1a83('0x3e')][_0x1a83('0x77')])){for(var _0x467a37=0x0;_0x467a37<_0x20e013['query'][_0x1a83('0x77')]['length'];_0x467a37+=0x1){socket[_0x1a83('0x73')]('userFaxQueue:remove',{'UserId':Number(_0x20e013['query']['ids'][_0x467a37]),'FaxQueueId':Number(_0x20e013[_0x1a83('0x5c')]['id'])});}}else{socket[_0x1a83('0x73')]('userFaxQueue:remove',{'UserId':Number(_0x20e013[_0x1a83('0x3e')]['ids']),'FaxQueueId':Number(_0x20e013[_0x1a83('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x2e0370,null))[_0x1a83('0x50')](handleError(_0x2e0370,null));};exports['getAgents']=function(_0xee6689,_0x153c70,_0x1a466d){var _0x10d21a={};var _0x44444={};var _0x1cee56;var _0x84c0dc;return db['FaxQueue'][_0x1a83('0x5f')]({'where':{'id':_0xee6689[_0x1a83('0x5c')]['id']}})[_0x1a83('0x30')](handleEntityNotFound(_0x153c70,null))[_0x1a83('0x30')](function(_0x454311){if(_0x454311){_0x1cee56=_0x454311;_0x44444[_0x1a83('0x3c')]=_['keys'](db[_0x1a83('0x62')][_0x1a83('0x38')]);_0x44444[_0x1a83('0x3e')]=_[_0x1a83('0x3d')](_0xee6689[_0x1a83('0x3e')]);_0x44444['filters']=_[_0x1a83('0x41')](_0x44444[_0x1a83('0x3c')],_0x44444[_0x1a83('0x3e')]);_0x10d21a[_0x1a83('0x40')]=_[_0x1a83('0x41')](_0x44444[_0x1a83('0x3c')],qs[_0x1a83('0x42')](_0xee6689[_0x1a83('0x3e')][_0x1a83('0x42')]));_0x10d21a['attributes']=_0x10d21a['attributes']['length']?_0x10d21a[_0x1a83('0x40')]:_0x44444[_0x1a83('0x3c')];_0x10d21a[_0x1a83('0x44')]=qs[_0x1a83('0x45')](_0xee6689['query']['sort']);_0x10d21a[_0x1a83('0x46')]=qs[_0x1a83('0x3f')](_[_0x1a83('0x47')](_0xee6689[_0x1a83('0x3e')],_0x44444[_0x1a83('0x3f')]));if(_0xee6689['query']['filter']){_0x10d21a[_0x1a83('0x46')]=_[_0x1a83('0x49')](_0x10d21a[_0x1a83('0x46')],{'$or':_['map'](_0x10d21a[_0x1a83('0x40')],function(_0xf3a4c9){var _0x3b6af4={};_0x3b6af4[_0xf3a4c9]={'$like':'%'+_0xee6689[_0x1a83('0x3e')]['filter']+'%'};return _0x3b6af4;})});}_0x10d21a=_[_0x1a83('0x49')]({},_0x10d21a,_0xee6689[_0x1a83('0x4b')]);return _0x1cee56[_0x1a83('0x8a')](_0x10d21a);}})[_0x1a83('0x30')](function(_0xbb6d62){if(_0xbb6d62){_0x84c0dc=_0xbb6d62[_0x1a83('0x43')];if(!_0xee6689['query'][_0x1a83('0x8b')](_0x1a83('0x61'))){_0x10d21a['limit']=qs[_0x1a83('0x28')](_0xee6689[_0x1a83('0x3e')][_0x1a83('0x28')]);_0x10d21a[_0x1a83('0x27')]=qs[_0x1a83('0x27')](_0xee6689['query'][_0x1a83('0x27')]);}return _0x1cee56[_0x1a83('0x8a')](_0x10d21a);}})[_0x1a83('0x30')](function(_0x9391ae){if(_0x9391ae){return _0x9391ae?{'count':_0x84c0dc,'rows':_0x9391ae}:null;}})[_0x1a83('0x30')](respondWithResult(_0x153c70,null))[_0x1a83('0x50')](handleError(_0x153c70,null));}; \ No newline at end of file +var _0xba6f=['Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','union','value','emit','userFaxQueue:remove','addAgents','userFaxQueue:save','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','update','then','destroy','FaxQueues','error','stack','name','send','map','FaxQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','UserId','agent','createdAt','format','%s/%s','faxPause','updatedAt','getTeams','hasOwnProperty','addTeams','ids','Team','findAll'];(function(_0x4a2689,_0x314a16){var _0x463450=function(_0x5388b8){while(--_0x5388b8){_0x4a2689['push'](_0x4a2689['shift']());}};_0x463450(++_0x314a16);}(_0xba6f,0x1d0));var _0xfba6=function(_0x11946c,_0x12152c){_0x11946c=_0x11946c-0x0;var _0x383935=_0xba6f[_0x11946c];return _0x383935;};'use strict';var emlformat=require(_0xfba6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfba6('0x1'));var jsonpatch=require(_0xfba6('0x2'));var rp=require(_0xfba6('0x3'));var moment=require(_0xfba6('0x4'));var BPromise=require(_0xfba6('0x5'));var Mustache=require(_0xfba6('0x6'));var util=require(_0xfba6('0x7'));var path=require(_0xfba6('0x8'));var sox=require(_0xfba6('0x9'));var csv=require(_0xfba6('0xa'));var ejs=require(_0xfba6('0xb'));var fs=require('fs');var fs_extra=require(_0xfba6('0xc'));var _=require(_0xfba6('0xd'));var squel=require('squel');var crypto=require(_0xfba6('0xe'));var jsforce=require(_0xfba6('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfba6('0x10'));var Redis=require(_0xfba6('0x11'));var authService=require(_0xfba6('0x12'));var qs=require(_0xfba6('0x13'));var as=require(_0xfba6('0x14'));var hardwareService=require(_0xfba6('0x15'));var logger=require(_0xfba6('0x16'))(_0xfba6('0x17'));var utils=require(_0xfba6('0x18'));var config=require(_0xfba6('0x19'));var licenseUtil=require(_0xfba6('0x1a'));var db=require('../../mysqldb')['db'];config[_0xfba6('0x1b')]=_[_0xfba6('0x1c')](config[_0xfba6('0x1b')],{'host':_0xfba6('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfba6('0x1b')]));require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x184169,_0x30e5cb){_0x30e5cb=_0x30e5cb||0xcc;return function(_0x12534b){if(_0x12534b){return _0x184169[_0xfba6('0x1e')](_0x30e5cb);}return _0x184169[_0xfba6('0x1f')](_0x30e5cb)[_0xfba6('0x20')]();};}function respondWithResult(_0x24b6a0,_0x2f575f){_0x2f575f=_0x2f575f||0xc8;return function(_0x401f25){if(_0x401f25){return _0x24b6a0[_0xfba6('0x1f')](_0x2f575f)[_0xfba6('0x21')](_0x401f25);}};}function respondWithFilteredResult(_0xf3dbbc,_0x2ef1b8){return function(_0x5a29a4){if(_0x5a29a4){var _0x35e4a7=typeof _0x2ef1b8[_0xfba6('0x22')]==='undefined'&&typeof _0x2ef1b8['limit']===_0xfba6('0x23');var _0x204784=_0x5a29a4['count'];var _0x14990f=_0x35e4a7?0x0:_0x2ef1b8[_0xfba6('0x22')];var _0x34d440=_0x35e4a7?_0x5a29a4['count']:_0x2ef1b8[_0xfba6('0x22')]+_0x2ef1b8[_0xfba6('0x24')];var _0xa16868;if(_0x34d440>=_0x204784){_0x34d440=_0x204784;_0xa16868=0xc8;}else{_0xa16868=0xce;}_0xf3dbbc['status'](_0xa16868);return _0xf3dbbc[_0xfba6('0x25')](_0xfba6('0x26'),_0x14990f+'-'+_0x34d440+'/'+_0x204784)[_0xfba6('0x21')](_0x5a29a4);}return null;};}function patchUpdates(_0x2afd26){return function(_0x76af17){try{jsonpatch[_0xfba6('0x27')](_0x76af17,_0x2afd26,!![]);}catch(_0x203a4e){return BPromise['reject'](_0x203a4e);}return _0x76af17['save']();};}function saveUpdates(_0x41b356,_0x27bf10){return function(_0x21f7b9){if(_0x21f7b9){return _0x21f7b9[_0xfba6('0x28')](_0x41b356)[_0xfba6('0x29')](function(_0x53c99a){return _0x53c99a;});}return null;};}function removeEntity(_0x408ccc,_0x4114bc){return function(_0x314f65){if(_0x314f65){return _0x314f65[_0xfba6('0x2a')]()[_0xfba6('0x29')](function(){var _0x7c7f6a=_0x314f65['get']({'plain':!![]});var _0x29b513=_0xfba6('0x2b');return db['UserProfileResource'][_0xfba6('0x2a')]({'where':{'type':_0x29b513,'resourceId':_0x7c7f6a['id']}})[_0xfba6('0x29')](function(){return _0x314f65;});})['then'](function(){_0x408ccc[_0xfba6('0x1f')](0xcc)[_0xfba6('0x20')]();});}};}function handleEntityNotFound(_0x5f31af,_0x47973f){return function(_0x56e8e6){if(!_0x56e8e6){_0x5f31af[_0xfba6('0x1e')](0x194);}return _0x56e8e6;};}function handleError(_0x373f14,_0x24e860){_0x24e860=_0x24e860||0x1f4;return function(_0x57dd4f){logger[_0xfba6('0x2c')](_0x57dd4f[_0xfba6('0x2d')]);if(_0x57dd4f[_0xfba6('0x2e')]){delete _0x57dd4f[_0xfba6('0x2e')];}_0x373f14['status'](_0x24e860)[_0xfba6('0x2f')](_0x57dd4f);};}exports['index']=function(_0xe3ea6d,_0xb72cf9){var _0x43a2c={},_0x221b7f={},_0x37dca0={'count':0x0,'rows':[]};var _0x47933b=_[_0xfba6('0x30')](db[_0xfba6('0x31')]['rawAttributes'],function(_0x388917){return{'name':_0x388917[_0xfba6('0x32')],'type':_0x388917[_0xfba6('0x33')][_0xfba6('0x34')]};});_0x221b7f[_0xfba6('0x35')]=_[_0xfba6('0x30')](_0x47933b,_0xfba6('0x2e'));_0x221b7f[_0xfba6('0x36')]=_[_0xfba6('0x37')](_0xe3ea6d[_0xfba6('0x36')]);_0x221b7f[_0xfba6('0x38')]=_[_0xfba6('0x39')](_0x221b7f['model'],_0x221b7f[_0xfba6('0x36')]);_0x43a2c[_0xfba6('0x3a')]=_[_0xfba6('0x39')](_0x221b7f[_0xfba6('0x35')],qs[_0xfba6('0x3b')](_0xe3ea6d[_0xfba6('0x36')][_0xfba6('0x3b')]));_0x43a2c[_0xfba6('0x3a')]=_0x43a2c[_0xfba6('0x3a')][_0xfba6('0x3c')]?_0x43a2c[_0xfba6('0x3a')]:_0x221b7f['model'];if(!_0xe3ea6d[_0xfba6('0x36')]['hasOwnProperty'](_0xfba6('0x3d'))){_0x43a2c[_0xfba6('0x24')]=qs[_0xfba6('0x24')](_0xe3ea6d[_0xfba6('0x36')][_0xfba6('0x24')]);_0x43a2c[_0xfba6('0x22')]=qs[_0xfba6('0x22')](_0xe3ea6d[_0xfba6('0x36')]['offset']);}_0x43a2c[_0xfba6('0x3e')]=qs[_0xfba6('0x3f')](_0xe3ea6d['query'][_0xfba6('0x3f')]);_0x43a2c['where']=qs[_0xfba6('0x38')](_[_0xfba6('0x40')](_0xe3ea6d['query'],_0x221b7f[_0xfba6('0x38')]),_0x47933b);if(_0xe3ea6d[_0xfba6('0x36')][_0xfba6('0x41')]){_0x43a2c['where']=_[_0xfba6('0x42')](_0x43a2c[_0xfba6('0x43')],{'$or':_[_0xfba6('0x30')](_0x47933b,function(_0x2126b9){if(_0x2126b9[_0xfba6('0x33')]!==_0xfba6('0x44')){var _0x47dfae={};_0x47dfae[_0x2126b9[_0xfba6('0x2e')]]={'$like':'%'+_0xe3ea6d[_0xfba6('0x36')][_0xfba6('0x41')]+'%'};return _0x47dfae;}})});}_0x43a2c=_[_0xfba6('0x42')]({},_0x43a2c,_0xe3ea6d[_0xfba6('0x45')]);var _0x7140f8={'where':_0x43a2c[_0xfba6('0x43')]};return db[_0xfba6('0x31')]['count'](_0x7140f8)['then'](function(_0x18b81d){_0x37dca0['count']=_0x18b81d;if(_0xe3ea6d[_0xfba6('0x36')][_0xfba6('0x46')]){_0x43a2c[_0xfba6('0x47')]=[{'all':!![]}];}return db[_0xfba6('0x31')]['findAll'](_0x43a2c);})[_0xfba6('0x29')](function(_0x5aaa7f){_0x37dca0[_0xfba6('0x48')]=_0x5aaa7f;return _0x37dca0;})['then'](respondWithFilteredResult(_0xb72cf9,_0x43a2c))[_0xfba6('0x49')](handleError(_0xb72cf9,null));};exports[_0xfba6('0x4a')]=function(_0x28a675,_0xda0205){var _0x6a17={'raw':!![],'where':{'id':_0x28a675[_0xfba6('0x4b')]['id']}},_0x279857={};_0x279857[_0xfba6('0x35')]=_[_0xfba6('0x37')](db['FaxQueue'][_0xfba6('0x4c')]);_0x279857[_0xfba6('0x36')]=_[_0xfba6('0x37')](_0x28a675[_0xfba6('0x36')]);_0x279857[_0xfba6('0x38')]=_[_0xfba6('0x39')](_0x279857[_0xfba6('0x35')],_0x279857[_0xfba6('0x36')]);_0x6a17[_0xfba6('0x3a')]=_[_0xfba6('0x39')](_0x279857[_0xfba6('0x35')],qs[_0xfba6('0x3b')](_0x28a675[_0xfba6('0x36')][_0xfba6('0x3b')]));_0x6a17[_0xfba6('0x3a')]=_0x6a17['attributes'][_0xfba6('0x3c')]?_0x6a17[_0xfba6('0x3a')]:_0x279857[_0xfba6('0x35')];if(_0x28a675[_0xfba6('0x36')][_0xfba6('0x46')]){_0x6a17[_0xfba6('0x47')]=[{'all':!![]}];}_0x6a17=_[_0xfba6('0x42')]({},_0x6a17,_0x28a675[_0xfba6('0x45')]);return db['FaxQueue']['find'](_0x6a17)[_0xfba6('0x29')](handleEntityNotFound(_0xda0205,null))[_0xfba6('0x29')](respondWithResult(_0xda0205,null))[_0xfba6('0x49')](handleError(_0xda0205,null));};exports[_0xfba6('0x4d')]=function(_0x4158f8,_0x47ca4c){return db['FaxQueue'][_0xfba6('0x4d')](_0x4158f8[_0xfba6('0x4e')],{})['then'](function(_0x4c150){var _0x4cbd77=_0x4158f8[_0xfba6('0x4f')]['get']({'plain':!![]});if(!_0x4cbd77)throw new Error(_0xfba6('0x50'));if(_0x4cbd77['role']===_0xfba6('0x4f')){var _0x1a68b3=_0x4c150[_0xfba6('0x51')]({'plain':!![]});var _0x8d3364=_0xfba6('0x2b');return db[_0xfba6('0x52')][_0xfba6('0x53')]({'where':{'name':_0x8d3364,'userProfileId':_0x4cbd77[_0xfba6('0x54')]},'raw':!![]})[_0xfba6('0x29')](function(_0x72db){if(_0x72db&&_0x72db[_0xfba6('0x55')]===0x0){return db[_0xfba6('0x56')][_0xfba6('0x4d')]({'name':_0x1a68b3['name'],'resourceId':_0x1a68b3['id'],'type':_0x72db[_0xfba6('0x2e')],'sectionId':_0x72db['id']},{})['then'](function(){return _0x4c150;});}else{return _0x4c150;}})[_0xfba6('0x49')](function(_0x327833){logger['error'](_0xfba6('0x57'),_0x327833);throw _0x327833;});}return _0x4c150;})[_0xfba6('0x29')](respondWithResult(_0x47ca4c,0xc9))[_0xfba6('0x49')](handleError(_0x47ca4c,null));};exports[_0xfba6('0x28')]=function(_0x7a6bf1,_0x4407b4){if(_0x7a6bf1[_0xfba6('0x4e')]['id']){delete _0x7a6bf1[_0xfba6('0x4e')]['id'];}return db[_0xfba6('0x31')]['find']({'where':{'id':_0x7a6bf1[_0xfba6('0x4b')]['id']}})[_0xfba6('0x29')](handleEntityNotFound(_0x4407b4,null))[_0xfba6('0x29')](saveUpdates(_0x7a6bf1[_0xfba6('0x4e')],null))[_0xfba6('0x29')](respondWithResult(_0x4407b4,null))[_0xfba6('0x49')](handleError(_0x4407b4,null));};exports[_0xfba6('0x2a')]=function(_0x20af75,_0x2e6296){return db[_0xfba6('0x31')][_0xfba6('0x53')]({'where':{'id':_0x20af75[_0xfba6('0x4b')]['id']}})[_0xfba6('0x29')](handleEntityNotFound(_0x2e6296,null))['then'](removeEntity(_0x2e6296,null))[_0xfba6('0x49')](handleError(_0x2e6296,null));};exports[_0xfba6('0x58')]=function(_0x48b937,_0x2014a1){return db[_0xfba6('0x31')][_0xfba6('0x58')]()[_0xfba6('0x29')](respondWithResult(_0x2014a1,null))[_0xfba6('0x49')](handleError(_0x2014a1,null));};exports[_0xfba6('0x59')]=function(_0x445a8e,_0x4c5a20,_0x51b3c6){var _0x56e3ab={'raw':!![],'where':{}},_0x5832fb={},_0x1bb0c1;return db[_0xfba6('0x31')][_0xfba6('0x5a')]({'where':{'id':_0x445a8e[_0xfba6('0x4b')]['id']}})[_0xfba6('0x29')](handleEntityNotFound(_0x4c5a20,null))[_0xfba6('0x29')](function(_0x5c3329){if(_0x5c3329){_0x1bb0c1=_0x5c3329[_0xfba6('0x51')]({'plain':!![]});_0x5832fb[_0xfba6('0x35')]=_[_0xfba6('0x37')](db[_0xfba6('0x5b')][_0xfba6('0x4c')]);_0x5832fb[_0xfba6('0x36')]=_[_0xfba6('0x37')](_0x445a8e['query']);_0x5832fb[_0xfba6('0x38')]=_['intersection'](_0x5832fb[_0xfba6('0x35')],_0x5832fb[_0xfba6('0x36')]);_0x56e3ab[_0xfba6('0x3a')]=_[_0xfba6('0x39')](_0x5832fb['model'],qs[_0xfba6('0x3b')](_0x445a8e[_0xfba6('0x36')][_0xfba6('0x3b')]));_0x56e3ab[_0xfba6('0x3a')]=_0x56e3ab[_0xfba6('0x3a')][_0xfba6('0x3c')]?_0x56e3ab['attributes']:_0x5832fb['model'];if(!_0x445a8e[_0xfba6('0x36')]['hasOwnProperty'](_0xfba6('0x3d'))){_0x56e3ab['limit']=qs[_0xfba6('0x24')](_0x445a8e[_0xfba6('0x36')][_0xfba6('0x24')]);_0x56e3ab[_0xfba6('0x22')]=qs['offset'](_0x445a8e[_0xfba6('0x36')]['offset']);}_0x56e3ab[_0xfba6('0x3e')]=qs['sort'](_0x445a8e[_0xfba6('0x36')][_0xfba6('0x3f')]);_0x56e3ab['where']=qs[_0xfba6('0x38')](_[_0xfba6('0x40')](_0x445a8e[_0xfba6('0x36')],_0x5832fb[_0xfba6('0x38')]));_0x56e3ab[_0xfba6('0x43')][_0xfba6('0x5c')]=_0x5c3329['id'];if(_0x445a8e[_0xfba6('0x36')][_0xfba6('0x41')]){_0x56e3ab[_0xfba6('0x43')]=_[_0xfba6('0x42')](_0x56e3ab[_0xfba6('0x43')],{'$or':_[_0xfba6('0x30')](_0x56e3ab['attributes'],function(_0x5568d6){var _0x4a5b86={};_0x4a5b86[_0x5568d6]={'$like':'%'+_0x445a8e[_0xfba6('0x36')][_0xfba6('0x41')]+'%'};return _0x4a5b86;})});}_0x56e3ab=_[_0xfba6('0x42')]({},_0x56e3ab,_0x445a8e['options']);return db['UserFaxQueue']['findAll'](_0x56e3ab);}})[_0xfba6('0x29')](function(_0xefc11e){if(_0xefc11e){return db[_0xfba6('0x5d')][_0xfba6('0x5e')]({'where':{'id':_[_0xfba6('0x30')](_0xefc11e,_0xfba6('0x5f')),'role':_0xfba6('0x60')},'attributes':['id',_0xfba6('0x2e'),'faxPause','updatedAt',_0xfba6('0x61')]});}})[_0xfba6('0x29')](function(_0xf9c01e){if(_0xf9c01e){return{'count':_0xf9c01e['count'],'rows':_['map'](_0xf9c01e[_0xfba6('0x48')],function(_0x591126){return{'membername':_0x591126[_0xfba6('0x2e')],'UserId':_0x591126['id'],'queue_name':_0x1bb0c1[_0xfba6('0x2e')],'FaxQueueId':_0x1bb0c1['id'],'interface':util[_0xfba6('0x62')](_0xfba6('0x63'),'SIP',_0x591126[_0xfba6('0x2e')]),'penalty':0x0,'paused':_0x591126[_0xfba6('0x64')],'createdAt':_0x591126[_0xfba6('0x61')],'updatedAt':_0x591126[_0xfba6('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfba6('0x29')](respondWithFilteredResult(_0x4c5a20,_0x56e3ab))[_0xfba6('0x49')](handleError(_0x4c5a20,null));};exports[_0xfba6('0x66')]=function(_0xfc1301,_0x3a18d4,_0x2931d7){var _0x14825e={};var _0x27c1e3={};var _0x1c3954;var _0x1e04bf;return db[_0xfba6('0x31')][_0xfba6('0x5a')]({'where':{'id':_0xfc1301[_0xfba6('0x4b')]['id']}})[_0xfba6('0x29')](handleEntityNotFound(_0x3a18d4,null))[_0xfba6('0x29')](function(_0x479253){if(_0x479253){_0x1c3954=_0x479253;_0x27c1e3[_0xfba6('0x35')]=_[_0xfba6('0x37')](db['Team'][_0xfba6('0x4c')]);_0x27c1e3['query']=_[_0xfba6('0x37')](_0xfc1301['query']);_0x27c1e3[_0xfba6('0x38')]=_['intersection'](_0x27c1e3[_0xfba6('0x35')],_0x27c1e3[_0xfba6('0x36')]);_0x14825e[_0xfba6('0x3a')]=_[_0xfba6('0x39')](_0x27c1e3['model'],qs['fields'](_0xfc1301[_0xfba6('0x36')][_0xfba6('0x3b')]));_0x14825e['attributes']=_0x14825e[_0xfba6('0x3a')][_0xfba6('0x3c')]?_0x14825e[_0xfba6('0x3a')]:_0x27c1e3['model'];_0x14825e[_0xfba6('0x3e')]=qs[_0xfba6('0x3f')](_0xfc1301[_0xfba6('0x36')][_0xfba6('0x3f')]);_0x14825e[_0xfba6('0x43')]=qs[_0xfba6('0x38')](_[_0xfba6('0x40')](_0xfc1301[_0xfba6('0x36')],_0x27c1e3[_0xfba6('0x38')]));if(_0xfc1301[_0xfba6('0x36')][_0xfba6('0x41')]){_0x14825e[_0xfba6('0x43')]=_[_0xfba6('0x42')](_0x14825e['where'],{'$or':_[_0xfba6('0x30')](_0x14825e['attributes'],function(_0x3e93ac){var _0x3804c2={};_0x3804c2[_0x3e93ac]={'$like':'%'+_0xfc1301[_0xfba6('0x36')][_0xfba6('0x41')]+'%'};return _0x3804c2;})});}_0x14825e=_[_0xfba6('0x42')]({},_0x14825e,_0xfc1301[_0xfba6('0x45')]);return _0x1c3954[_0xfba6('0x66')](_0x14825e);}})[_0xfba6('0x29')](function(_0x1f8053){if(_0x1f8053){_0x1e04bf=_0x1f8053[_0xfba6('0x3c')];if(!_0xfc1301['query'][_0xfba6('0x67')](_0xfba6('0x3d'))){_0x14825e[_0xfba6('0x24')]=qs[_0xfba6('0x24')](_0xfc1301['query'][_0xfba6('0x24')]);_0x14825e['offset']=qs[_0xfba6('0x22')](_0xfc1301[_0xfba6('0x36')]['offset']);}return _0x1c3954['getTeams'](_0x14825e);}})[_0xfba6('0x29')](function(_0x578116){if(_0x578116){return _0x578116?{'count':_0x1e04bf,'rows':_0x578116}:null;}})[_0xfba6('0x29')](respondWithResult(_0x3a18d4,null))[_0xfba6('0x49')](handleError(_0x3a18d4,null));};exports[_0xfba6('0x68')]=function(_0x40e31c,_0x46e6a7,_0x1c6e99){var _0x45a640=_0x40e31c[_0xfba6('0x4e')][_0xfba6('0x69')];return db[_0xfba6('0x6a')][_0xfba6('0x6b')]({'where':{'id':_0x45a640},'attributes':['id'],'include':[{'model':db[_0xfba6('0x5d')],'as':_0xfba6('0x6c'),'attributes':['id',_0xfba6('0x2e'),_0xfba6('0x6d'),_0xfba6('0x6e'),_0xfba6('0x6f')],'raw':!![]}]})[_0xfba6('0x29')](function(_0x2c8cda){if(_0x2c8cda){var _0x120265=_[_0xfba6('0x70')](_0x2c8cda,function(_0x214b97){var _0x518095=_0x214b97[_0xfba6('0x51')]({'plain':!![]});return _0x518095[_0xfba6('0x6c')];});return db[_0xfba6('0x31')][_0xfba6('0x53')]({'where':{'id':_0x40e31c[_0xfba6('0x4b')]['id']}})[_0xfba6('0x29')](function(_0x423c00){return db[_0xfba6('0x71')][_0xfba6('0x72')](function(_0x564fdf){return _0x423c00[_0xfba6('0x68')](_0x45a640,{'transaction':_0x564fdf})[_0xfba6('0x29')](function(){return BPromise[_0xfba6('0x73')](_0x120265,function(_0x3cd3a9){return db[_0xfba6('0x5b')]['findOrCreate']({'where':{'UserId':_0x3cd3a9['id'],'FaxQueueId':_0x40e31c[_0xfba6('0x4b')]['id']},'transaction':_0x564fdf});});})[_0xfba6('0x29')](function(){_0x120265[_0xfba6('0x74')](function(_0x4c6834){socket['emit']('userFaxQueue:save',{'UserId':_0x4c6834['id'],'FaxQueueId':_0x423c00['id']});});});});});}})[_0xfba6('0x29')](respondWithStatusCode(_0x46e6a7,null))[_0xfba6('0x49')](handleError(_0x46e6a7,null));};exports[_0xfba6('0x75')]=function(_0x530f7d,_0x4c8bed,_0x62abc3){return db[_0xfba6('0x6a')][_0xfba6('0x6b')]({'where':{'id':_0x530f7d['query'][_0xfba6('0x69')]},'attributes':['id'],'include':[{'model':db[_0xfba6('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xfba6('0x29')](handleEntityNotFound(_0x4c8bed,null))['then'](function(_0x4f9143){var _0x1b03e9=_['map'](_0x4f9143,'id');var _0x173663=[];var _0x13b979=[];var _0xa8fb50=squel[_0xfba6('0x76')]();_0xa8fb50[_0xfba6('0x77')](_0xfba6('0x78'))[_0xfba6('0x79')](_0xfba6('0x7a'),'tq')[_0xfba6('0x7b')](_0xfba6('0x7c'),'ut',_0xfba6('0x7d'))[_0xfba6('0x43')](_0xfba6('0x7e'),_0x530f7d[_0xfba6('0x4b')]['id']);for(var _0x12e4cb=0x0;_0x12e4cb<_0x4f9143[_0xfba6('0x3c')];_0x12e4cb+=0x1){let _0xd63cfe=_0x4f9143[_0x12e4cb];for(var _0xbc565e=0x0;_0xbc565e<_0xd63cfe['Agents'][_0xfba6('0x3c')];_0xbc565e+=0x1){let _0x2db65d=_0xd63cfe[_0xfba6('0x6c')][_0xbc565e];var _0x86d4c1=_0xa8fb50['clone']();_0x86d4c1[_0xfba6('0x43')](_0xfba6('0x7f'),_0x2db65d['id']);_0x13b979['push'](db['sequelize'][_0xfba6('0x36')](_0x86d4c1[_0xfba6('0x80')](),{'type':db[_0xfba6('0x71')][_0xfba6('0x81')][_0xfba6('0x82')]})[_0xfba6('0x29')](function(_0x491030){if(_0x491030['length']===0x1){return _0x2db65d['id'];}else{var _0x2f5f03=_[_0xfba6('0x83')](_[_0xfba6('0x30')](_0x491030,_0xfba6('0x84')),function(_0xe563ba){return _['includes'](_0x1b03e9,_0xe563ba);});if(_0x2f5f03){return _0x2db65d['id'];}}}));}}return BPromise[_0xfba6('0x85')](_0x13b979)[_0xfba6('0x29')](function(_0x24da3b){_0x173663=_(_0x173663)[_0xfba6('0x86')](_0x24da3b)['compact']()[_0xfba6('0x87')]();return db[_0xfba6('0x31')][_0xfba6('0x53')]({'where':{'id':_0x530f7d[_0xfba6('0x4b')]['id']}})[_0xfba6('0x29')](function(_0x53e329){return db[_0xfba6('0x71')][_0xfba6('0x72')](function(_0x197625){return _0x53e329[_0xfba6('0x75')](_0x530f7d[_0xfba6('0x36')][_0xfba6('0x69')],{'transaction':_0x197625})[_0xfba6('0x29')](function(){if(!_['isEmpty'](_0x173663)){return _0x53e329['removeAgents'](_0x173663,{'transaction':_0x197625});}})['then'](function(){_0x173663['forEach'](function(_0x1e78b8){socket[_0xfba6('0x88')](_0xfba6('0x89'),{'UserId':_0x1e78b8,'FaxQueueId':_0x53e329['id']});});});});});});})['then'](respondWithStatusCode(_0x4c8bed,null))['catch'](handleError(_0x4c8bed,null));};exports[_0xfba6('0x8a')]=function(_0x10f346,_0x59d4be,_0x295114){return db['FaxQueue']['find']({'where':{'id':_0x10f346['params']['id']}})[_0xfba6('0x29')](handleEntityNotFound(_0x59d4be,null))[_0xfba6('0x29')](function(_0x10363d){if(_0x10363d){return _0x10363d[_0xfba6('0x8a')](_0x10f346['body'][_0xfba6('0x69')],_['omit'](_0x10f346[_0xfba6('0x4e')],['ids','id'])||{})['spread'](function(_0x5894df){for(var _0x22e470=0x0;_0x22e470<_0x10f346[_0xfba6('0x4e')][_0xfba6('0x69')][_0xfba6('0x3c')];_0x22e470+=0x1){socket[_0xfba6('0x88')](_0xfba6('0x8b'),{'UserId':Number(_0x10f346[_0xfba6('0x4e')][_0xfba6('0x69')][_0x22e470]),'FaxQueueId':Number(_0x10f346[_0xfba6('0x4b')]['id'])});}return _0x5894df;});}})[_0xfba6('0x29')](respondWithResult(_0x59d4be,null))[_0xfba6('0x49')](handleError(_0x59d4be,null));};exports[_0xfba6('0x8c')]=function(_0x56b56a,_0x3b8697,_0x4ddb14){return db['FaxQueue'][_0xfba6('0x53')]({'where':{'id':_0x56b56a['params']['id']}})[_0xfba6('0x29')](handleEntityNotFound(_0x3b8697,null))['then'](function(_0x2ceba7){if(_0x2ceba7){return _0x2ceba7[_0xfba6('0x8c')](_0x56b56a[_0xfba6('0x36')][_0xfba6('0x69')])[_0xfba6('0x29')](function(){if(_[_0xfba6('0x8d')](_0x56b56a[_0xfba6('0x36')]['ids'])){for(var _0x325297=0x0;_0x325297<_0x56b56a[_0xfba6('0x36')]['ids'][_0xfba6('0x3c')];_0x325297+=0x1){socket[_0xfba6('0x88')](_0xfba6('0x89'),{'UserId':Number(_0x56b56a[_0xfba6('0x36')]['ids'][_0x325297]),'FaxQueueId':Number(_0x56b56a[_0xfba6('0x4b')]['id'])});}}else{socket[_0xfba6('0x88')](_0xfba6('0x89'),{'UserId':Number(_0x56b56a['query'][_0xfba6('0x69')]),'FaxQueueId':Number(_0x56b56a[_0xfba6('0x4b')]['id'])});}});}})[_0xfba6('0x29')](respondWithStatusCode(_0x3b8697,null))[_0xfba6('0x49')](handleError(_0x3b8697,null));};exports[_0xfba6('0x8e')]=function(_0x2ca257,_0x353af4,_0x3a138b){var _0x12d7d5={};var _0x419005={};var _0x4cadc4;var _0x11817f;return db[_0xfba6('0x31')]['findOne']({'where':{'id':_0x2ca257[_0xfba6('0x4b')]['id']}})[_0xfba6('0x29')](handleEntityNotFound(_0x353af4,null))[_0xfba6('0x29')](function(_0xa8950e){if(_0xa8950e){_0x4cadc4=_0xa8950e;_0x419005[_0xfba6('0x35')]=_[_0xfba6('0x37')](db[_0xfba6('0x5d')][_0xfba6('0x4c')]);_0x419005[_0xfba6('0x36')]=_[_0xfba6('0x37')](_0x2ca257['query']);_0x419005[_0xfba6('0x38')]=_[_0xfba6('0x39')](_0x419005[_0xfba6('0x35')],_0x419005[_0xfba6('0x36')]);_0x12d7d5[_0xfba6('0x3a')]=_['intersection'](_0x419005[_0xfba6('0x35')],qs[_0xfba6('0x3b')](_0x2ca257[_0xfba6('0x36')][_0xfba6('0x3b')]));_0x12d7d5['attributes']=_0x12d7d5[_0xfba6('0x3a')][_0xfba6('0x3c')]?_0x12d7d5['attributes']:_0x419005[_0xfba6('0x35')];_0x12d7d5[_0xfba6('0x3e')]=qs[_0xfba6('0x3f')](_0x2ca257[_0xfba6('0x36')]['sort']);_0x12d7d5[_0xfba6('0x43')]=qs[_0xfba6('0x38')](_['pick'](_0x2ca257['query'],_0x419005[_0xfba6('0x38')]));if(_0x2ca257['query'][_0xfba6('0x41')]){_0x12d7d5[_0xfba6('0x43')]=_[_0xfba6('0x42')](_0x12d7d5[_0xfba6('0x43')],{'$or':_[_0xfba6('0x30')](_0x12d7d5[_0xfba6('0x3a')],function(_0x18bead){var _0x2c996d={};_0x2c996d[_0x18bead]={'$like':'%'+_0x2ca257['query'][_0xfba6('0x41')]+'%'};return _0x2c996d;})});}_0x12d7d5=_['merge']({},_0x12d7d5,_0x2ca257[_0xfba6('0x45')]);return _0x4cadc4[_0xfba6('0x8e')](_0x12d7d5);}})[_0xfba6('0x29')](function(_0x796be0){if(_0x796be0){_0x11817f=_0x796be0['length'];if(!_0x2ca257['query']['hasOwnProperty']('nolimit')){_0x12d7d5[_0xfba6('0x24')]=qs['limit'](_0x2ca257[_0xfba6('0x36')]['limit']);_0x12d7d5['offset']=qs[_0xfba6('0x22')](_0x2ca257['query'][_0xfba6('0x22')]);}return _0x4cadc4[_0xfba6('0x8e')](_0x12d7d5);}})[_0xfba6('0x29')](function(_0x544019){if(_0x544019){return _0x544019?{'count':_0x11817f,'rows':_0x544019}:null;}})['then'](respondWithResult(_0x353af4,null))[_0xfba6('0x49')](handleError(_0x353af4,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 9ce8590..cf2e984 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 _0x6f8f=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners'];(function(_0x31ad1e,_0x5fdfb8){var _0x21215c=function(_0x1ad9d4){while(--_0x1ad9d4){_0x31ad1e['push'](_0x31ad1e['shift']());}};_0x21215c(++_0x5fdfb8);}(_0x6f8f,0x172));var _0xf6f8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f8f[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xf6f8('0x0'));var FaxQueue=require(_0xf6f8('0x1'))['db'][_0xf6f8('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xf6f8('0x3')](0x0);var events={'afterCreate':_0xf6f8('0x4'),'afterUpdate':_0xf6f8('0x5'),'afterDestroy':_0xf6f8('0x6')};function emitEvent(_0x540be7){return function(_0x1acb2a,_0x840c40,_0x42a672){FaxQueueEvents[_0xf6f8('0x7')](_0x540be7+':'+_0x1acb2a['id'],_0x1acb2a);FaxQueueEvents[_0xf6f8('0x7')](_0x540be7,_0x1acb2a);_0x42a672(null);};}for(var e in events){if(events[_0xf6f8('0x8')](e)){var event=events[e];FaxQueue[_0xf6f8('0x9')](e,emitEvent(event));}}module[_0xf6f8('0xa')]=FaxQueueEvents; \ No newline at end of file +var _0x3dfd=['../../mysqldb','FaxQueue','save','update','remove','emit','hook','events'];(function(_0x515f30,_0x5ae1ae){var _0x532d1b=function(_0x1b9ebc){while(--_0x1b9ebc){_0x515f30['push'](_0x515f30['shift']());}};_0x532d1b(++_0x5ae1ae);}(_0x3dfd,0xb7));var _0xd3df=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x3dfd[_0x4b055c];return _0x4b62bb;};'use strict';var EventEmitter=require(_0xd3df('0x0'));var FaxQueue=require(_0xd3df('0x1'))['db'][_0xd3df('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd3df('0x3'),'afterUpdate':_0xd3df('0x4'),'afterDestroy':_0xd3df('0x5')};function emitEvent(_0x35570f){return function(_0x222223,_0x35d494,_0x31825e){FaxQueueEvents[_0xd3df('0x6')](_0x35570f+':'+_0x222223['id'],_0x222223);FaxQueueEvents[_0xd3df('0x6')](_0x35570f,_0x222223);_0x31825e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xd3df('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index cec7bc2..3f824df 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 _0x0031=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','define','fax_queues','lodash'];(function(_0x59417a,_0x4f376c){var _0x2d3362=function(_0xac08b4){while(--_0xac08b4){_0x59417a['push'](_0x59417a['shift']());}};_0x2d3362(++_0x4f376c);}(_0x0031,0x74));var _0x1003=function(_0x1c8fb1,_0xb39e81){_0x1c8fb1=_0x1c8fb1-0x0;var _0x57f8e8=_0x0031[_0x1c8fb1];return _0x57f8e8;};'use strict';var _=require(_0x1003('0x0'));var util=require(_0x1003('0x1'));var logger=require(_0x1003('0x2'))(_0x1003('0x3'));var moment=require(_0x1003('0x4'));var BPromise=require(_0x1003('0x5'));var rp=require(_0x1003('0x6'));var fs=require('fs');var path=require(_0x1003('0x7'));var rimraf=require(_0x1003('0x8'));var config=require(_0x1003('0x9'));var attributes=require(_0x1003('0xa'));module['exports']=function(_0x1d2db5,_0x3de7fb){return _0x1d2db5[_0x1003('0xb')]('FaxQueue',attributes,{'tableName':_0x1003('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb57d=['FaxQueue','util','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0xb57d,0xd9));var _0xdb57=function(_0x1144c8,_0x454242){_0x1144c8=_0x1144c8-0x0;var _0xa4c112=_0xb57d[_0x1144c8];return _0xa4c112;};'use strict';var _=require('lodash');var util=require(_0xdb57('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xdb57('0x1'));var rp=require(_0xdb57('0x2'));var fs=require('fs');var path=require(_0xdb57('0x3'));var rimraf=require(_0xdb57('0x4'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0xdb57('0x5')]=function(_0x392967,_0x3a4ad9){return _0x392967[_0xdb57('0x6')](_0xdb57('0x7'),attributes,{'tableName':'fax_queues','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 9aa4845..cb41eea 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 _0xee18=['result','catch','GetFaxQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowFaxQueue','FaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x4601f3,_0x4d2401){var _0x2afb49=function(_0x297f98){while(--_0x297f98){_0x4601f3['push'](_0x4601f3['shift']());}};_0x2afb49(++_0x4d2401);}(_0xee18,0xe6));var _0x8ee1=function(_0x1d5677,_0x342d27){_0x1d5677=_0x1d5677-0x0;var _0x274227=_0xee18[_0x1d5677];return _0x274227;};'use strict';var _=require(_0x8ee1('0x0'));var util=require(_0x8ee1('0x1'));var moment=require(_0x8ee1('0x2'));var BPromise=require(_0x8ee1('0x3'));var rs=require(_0x8ee1('0x4'));var fs=require('fs');var Redis=require(_0x8ee1('0x5'));var db=require(_0x8ee1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ee1('0x7'))(_0x8ee1('0x8'));var config=require('../../config/environment');var jayson=require(_0x8ee1('0x9'));var client=jayson[_0x8ee1('0xa')][_0x8ee1('0xb')]({'port':0x232a});config[_0x8ee1('0xc')]=_[_0x8ee1('0xd')](config[_0x8ee1('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ee1('0xe'))(new Redis(config[_0x8ee1('0xc')]));require(_0x8ee1('0xf'))[_0x8ee1('0x10')](socket);function respondWithRpcPromise(_0x1d5252,_0x2e12b5,_0x2f1784){return new BPromise(function(_0x4466f2,_0x4c17f4){return client[_0x8ee1('0x11')](_0x1d5252,_0x2f1784)[_0x8ee1('0x12')](function(_0x33366c){logger[_0x8ee1('0x13')](_0x8ee1('0x14'),_0x2e12b5,_0x8ee1('0x15'));logger[_0x8ee1('0x16')](_0x8ee1('0x17'),_0x2e12b5,_0x8ee1('0x15'),JSON[_0x8ee1('0x18')](_0x33366c));if(_0x33366c['error']){if(_0x33366c['error'][_0x8ee1('0x19')]===0x1f4){logger['error'](_0x8ee1('0x14'),_0x2e12b5,_0x33366c['error']['message']);return _0x4c17f4(_0x33366c[_0x8ee1('0x1a')]['message']);}logger[_0x8ee1('0x1a')](_0x8ee1('0x14'),_0x2e12b5,_0x33366c[_0x8ee1('0x1a')]['message']);return _0x4466f2(_0x33366c['error'][_0x8ee1('0x1b')]);}else{logger[_0x8ee1('0x13')]('FaxQueue,\x20%s,\x20%s',_0x2e12b5,_0x8ee1('0x15'));_0x4466f2(_0x33366c[_0x8ee1('0x1c')][_0x8ee1('0x1b')]);}})[_0x8ee1('0x1d')](function(_0x4b2a35){logger[_0x8ee1('0x1a')](_0x8ee1('0x14'),_0x2e12b5,_0x4b2a35);_0x4c17f4(_0x4b2a35);});});}exports[_0x8ee1('0x1e')]=function(_0x38b07d){var _0x2abee1=this;return new Promise(function(_0x5979f9,_0x2fdc58){return db['FaxQueue'][_0x8ee1('0x1f')]({'raw':_0x38b07d[_0x8ee1('0x20')]?_0x38b07d[_0x8ee1('0x20')][_0x8ee1('0x21')]===undefined?!![]:![]:!![],'where':_0x38b07d[_0x8ee1('0x20')]?_0x38b07d['options'][_0x8ee1('0x22')]||null:null,'attributes':_0x38b07d['options']?_0x38b07d[_0x8ee1('0x20')][_0x8ee1('0x23')]||null:null,'limit':_0x38b07d[_0x8ee1('0x20')]?_0x38b07d[_0x8ee1('0x20')][_0x8ee1('0x24')]||null:null,'include':_0x38b07d[_0x8ee1('0x20')]?_0x38b07d['options']['include']?_[_0x8ee1('0x25')](_0x38b07d['options'][_0x8ee1('0x26')],function(_0x265ebf){return{'model':db[_0x265ebf['model']],'as':_0x265ebf['as'],'attributes':_0x265ebf[_0x8ee1('0x23')],'include':_0x265ebf['include']?_[_0x8ee1('0x25')](_0x265ebf[_0x8ee1('0x26')],function(_0x282e86){return{'model':db[_0x282e86[_0x8ee1('0x27')]],'as':_0x282e86['as'],'attributes':_0x282e86[_0x8ee1('0x23')],'include':_0x282e86[_0x8ee1('0x26')]?_[_0x8ee1('0x25')](_0x282e86['include'],function(_0x14bf94){return{'model':db[_0x14bf94[_0x8ee1('0x27')]],'as':_0x14bf94['as'],'attributes':_0x14bf94[_0x8ee1('0x23')]};}):[]};}):[]};}):[]:[]})[_0x8ee1('0x12')](function(_0x32dddf){logger[_0x8ee1('0x13')](_0x8ee1('0x1e'),_0x38b07d);logger[_0x8ee1('0x16')](_0x8ee1('0x1e'),_0x38b07d,JSON[_0x8ee1('0x18')](_0x32dddf));_0x5979f9(_0x32dddf);})[_0x8ee1('0x1d')](function(_0x2c1c56){logger[_0x8ee1('0x1a')]('GetFaxQueue',_0x2c1c56[_0x8ee1('0x1b')],_0x38b07d);_0x2fdc58(_0x2abee1['error'](0x1f4,_0x2c1c56[_0x8ee1('0x1b')]));});});};exports[_0x8ee1('0x28')]=function(_0x40c518){var _0x27a169=this;return new Promise(function(_0x2b4dc9,_0x4fc7ae){return db[_0x8ee1('0x29')][_0x8ee1('0x2a')]({'raw':_0x40c518[_0x8ee1('0x20')]?_0x40c518[_0x8ee1('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x40c518[_0x8ee1('0x20')]?_0x40c518[_0x8ee1('0x20')]['where']||null:null,'attributes':_0x40c518[_0x8ee1('0x20')]?_0x40c518[_0x8ee1('0x20')][_0x8ee1('0x23')]||null:null,'include':_0x40c518['options']?_0x40c518['options'][_0x8ee1('0x26')]?_[_0x8ee1('0x25')](_0x40c518[_0x8ee1('0x20')][_0x8ee1('0x26')],function(_0x43966e){return{'model':db[_0x43966e[_0x8ee1('0x27')]],'as':_0x43966e['as'],'attributes':_0x43966e[_0x8ee1('0x23')],'include':_0x43966e[_0x8ee1('0x26')]?_[_0x8ee1('0x25')](_0x43966e['include'],function(_0x49d5fa){return{'model':db[_0x49d5fa[_0x8ee1('0x27')]],'as':_0x49d5fa['as'],'attributes':_0x49d5fa['attributes'],'include':_0x49d5fa['include']?_[_0x8ee1('0x25')](_0x49d5fa[_0x8ee1('0x26')],function(_0x2f1358){return{'model':db[_0x2f1358['model']],'as':_0x2f1358['as'],'attributes':_0x2f1358[_0x8ee1('0x23')]};}):[]};}):[]};}):[]:[]})[_0x8ee1('0x12')](function(_0x23646e){logger[_0x8ee1('0x13')]('ShowFaxQueue',_0x40c518);logger[_0x8ee1('0x16')](_0x8ee1('0x28'),_0x40c518,JSON[_0x8ee1('0x18')](_0x23646e));_0x2b4dc9(_0x23646e);})[_0x8ee1('0x1d')](function(_0x1e9791){logger[_0x8ee1('0x1a')]('ShowFaxQueue',_0x1e9791[_0x8ee1('0x1b')],_0x40c518);_0x4fc7ae(_0x27a169[_0x8ee1('0x1a')](0x1f4,_0x1e9791['message']));});});}; \ No newline at end of file +var _0x7086=['rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./faxQueue.socket','register','request','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','catch','findAll','options','attributes','limit','include','map','model','GetFaxQueue','FaxQueue','find','raw','then','ShowFaxQueue','lodash','moment','bluebird','randomstring','../../config/utils'];(function(_0x49d04b,_0x3057e8){var _0xbef275=function(_0x18c062){while(--_0x18c062){_0x49d04b['push'](_0x49d04b['shift']());}};_0xbef275(++_0x3057e8);}(_0x7086,0xb4));var _0x6708=function(_0xb26a90,_0x35cc71){_0xb26a90=_0xb26a90-0x0;var _0x147751=_0x7086[_0xb26a90];return _0x147751;};'use strict';var _=require(_0x6708('0x0'));var util=require('util');var moment=require(_0x6708('0x1'));var BPromise=require(_0x6708('0x2'));var rs=require(_0x6708('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6708('0x4'));var logger=require('../../config/logger')(_0x6708('0x5'));var config=require(_0x6708('0x6'));var jayson=require(_0x6708('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x6708('0x8')]=_[_0x6708('0x9')](config[_0x6708('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x6708('0xa'))(new Redis(config[_0x6708('0x8')]));require(_0x6708('0xb'))[_0x6708('0xc')](socket);function respondWithRpcPromise(_0x2350ba,_0x3bf276,_0x67bdb1){return new BPromise(function(_0x3ccdee,_0x17d648){return client[_0x6708('0xd')](_0x2350ba,_0x67bdb1)['then'](function(_0x56b433){logger[_0x6708('0xe')]('FaxQueue,\x20%s,\x20%s',_0x3bf276,_0x6708('0xf'));logger[_0x6708('0x10')](_0x6708('0x11'),_0x3bf276,_0x6708('0xf'),JSON[_0x6708('0x12')](_0x56b433));if(_0x56b433[_0x6708('0x13')]){if(_0x56b433['error'][_0x6708('0x14')]===0x1f4){logger[_0x6708('0x13')](_0x6708('0x15'),_0x3bf276,_0x56b433[_0x6708('0x13')][_0x6708('0x16')]);return _0x17d648(_0x56b433[_0x6708('0x13')][_0x6708('0x16')]);}logger[_0x6708('0x13')]('FaxQueue,\x20%s,\x20%s',_0x3bf276,_0x56b433[_0x6708('0x13')]['message']);return _0x3ccdee(_0x56b433[_0x6708('0x13')]['message']);}else{logger[_0x6708('0xe')](_0x6708('0x15'),_0x3bf276,_0x6708('0xf'));_0x3ccdee(_0x56b433['result'][_0x6708('0x16')]);}})[_0x6708('0x17')](function(_0x5e0e25){logger['error'](_0x6708('0x15'),_0x3bf276,_0x5e0e25);_0x17d648(_0x5e0e25);});});}exports['GetFaxQueue']=function(_0x2c0128){var _0x2a5979=this;return new Promise(function(_0xf94c7c,_0x136308){return db['FaxQueue'][_0x6708('0x18')]({'raw':_0x2c0128['options']?_0x2c0128['options']['raw']===undefined?!![]:![]:!![],'where':_0x2c0128['options']?_0x2c0128[_0x6708('0x19')]['where']||null:null,'attributes':_0x2c0128[_0x6708('0x19')]?_0x2c0128[_0x6708('0x19')][_0x6708('0x1a')]||null:null,'limit':_0x2c0128[_0x6708('0x19')]?_0x2c0128[_0x6708('0x19')][_0x6708('0x1b')]||null:null,'include':_0x2c0128[_0x6708('0x19')]?_0x2c0128[_0x6708('0x19')][_0x6708('0x1c')]?_[_0x6708('0x1d')](_0x2c0128[_0x6708('0x19')]['include'],function(_0x387a19){return{'model':db[_0x387a19[_0x6708('0x1e')]],'as':_0x387a19['as'],'attributes':_0x387a19['attributes'],'include':_0x387a19[_0x6708('0x1c')]?_[_0x6708('0x1d')](_0x387a19[_0x6708('0x1c')],function(_0x3f304){return{'model':db[_0x3f304['model']],'as':_0x3f304['as'],'attributes':_0x3f304[_0x6708('0x1a')],'include':_0x3f304[_0x6708('0x1c')]?_[_0x6708('0x1d')](_0x3f304[_0x6708('0x1c')],function(_0x2d3f6b){return{'model':db[_0x2d3f6b[_0x6708('0x1e')]],'as':_0x2d3f6b['as'],'attributes':_0x2d3f6b[_0x6708('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f63da){logger[_0x6708('0xe')](_0x6708('0x1f'),_0x2c0128);logger[_0x6708('0x10')](_0x6708('0x1f'),_0x2c0128,JSON[_0x6708('0x12')](_0x3f63da));_0xf94c7c(_0x3f63da);})['catch'](function(_0x4bc260){logger[_0x6708('0x13')](_0x6708('0x1f'),_0x4bc260[_0x6708('0x16')],_0x2c0128);_0x136308(_0x2a5979[_0x6708('0x13')](0x1f4,_0x4bc260[_0x6708('0x16')]));});});};exports['ShowFaxQueue']=function(_0x18992f){var _0x32ef6b=this;return new Promise(function(_0x2c7658,_0x41529f){return db[_0x6708('0x20')][_0x6708('0x21')]({'raw':_0x18992f[_0x6708('0x19')]?_0x18992f[_0x6708('0x19')][_0x6708('0x22')]===undefined?!![]:![]:!![],'where':_0x18992f[_0x6708('0x19')]?_0x18992f['options']['where']||null:null,'attributes':_0x18992f[_0x6708('0x19')]?_0x18992f[_0x6708('0x19')][_0x6708('0x1a')]||null:null,'include':_0x18992f[_0x6708('0x19')]?_0x18992f[_0x6708('0x19')][_0x6708('0x1c')]?_['map'](_0x18992f['options'][_0x6708('0x1c')],function(_0x42edcd){return{'model':db[_0x42edcd[_0x6708('0x1e')]],'as':_0x42edcd['as'],'attributes':_0x42edcd['attributes'],'include':_0x42edcd[_0x6708('0x1c')]?_[_0x6708('0x1d')](_0x42edcd[_0x6708('0x1c')],function(_0x54b0d6){return{'model':db[_0x54b0d6[_0x6708('0x1e')]],'as':_0x54b0d6['as'],'attributes':_0x54b0d6['attributes'],'include':_0x54b0d6[_0x6708('0x1c')]?_[_0x6708('0x1d')](_0x54b0d6[_0x6708('0x1c')],function(_0x52c7c8){return{'model':db[_0x52c7c8[_0x6708('0x1e')]],'as':_0x52c7c8['as'],'attributes':_0x52c7c8[_0x6708('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6708('0x23')](function(_0x32ed86){logger['info'](_0x6708('0x24'),_0x18992f);logger[_0x6708('0x10')](_0x6708('0x24'),_0x18992f,JSON['stringify'](_0x32ed86));_0x2c7658(_0x32ed86);})['catch'](function(_0x44f00b){logger[_0x6708('0x13')](_0x6708('0x24'),_0x44f00b[_0x6708('0x16')],_0x18992f);_0x41529f(_0x32ef6b[_0x6708('0x13')](0x1f4,_0x44f00b[_0x6708('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index e4e1fa7..3cc9b5e 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 _0x4f96=['faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener','length'];(function(_0x280ae7,_0x456fb1){var _0x418b9e=function(_0x4d730d){while(--_0x4d730d){_0x280ae7['push'](_0x280ae7['shift']());}};_0x418b9e(++_0x456fb1);}(_0x4f96,0xb9));var _0x64f9=function(_0x25b242,_0x161fd7){_0x25b242=_0x25b242-0x0;var _0x4a18ad=_0x4f96[_0x25b242];return _0x4a18ad;};'use strict';var FaxQueueEvents=require(_0x64f9('0x0'));var events=[_0x64f9('0x1'),_0x64f9('0x2'),_0x64f9('0x3')];function createListener(_0x241264,_0x31e759){return function(_0x4a87d5){_0x31e759[_0x64f9('0x4')](_0x241264,_0x4a87d5);};}function removeListener(_0x4c95fa,_0x5c4300){return function(){FaxQueueEvents[_0x64f9('0x5')](_0x4c95fa,_0x5c4300);};}exports['register']=function(_0x727113){for(var _0x307cb5=0x0,_0x3569eb=events[_0x64f9('0x6')];_0x307cb5<_0x3569eb;_0x307cb5++){var _0x1bc33d=events[_0x307cb5];var _0x512be8=createListener(_0x64f9('0x7')+_0x1bc33d,_0x727113);FaxQueueEvents['on'](_0x1bc33d,_0x512be8);}}; \ No newline at end of file +var _0x8ae2=['length','faxQueue:','./faxQueue.events','save','remove','update'];(function(_0x5162e9,_0x55c047){var _0xea59da=function(_0x5e71ed){while(--_0x5e71ed){_0x5162e9['push'](_0x5162e9['shift']());}};_0xea59da(++_0x55c047);}(_0x8ae2,0x140));var _0x28ae=function(_0x125318,_0x43102e){_0x125318=_0x125318-0x0;var _0x1db4fc=_0x8ae2[_0x125318];return _0x1db4fc;};'use strict';var FaxQueueEvents=require(_0x28ae('0x0'));var events=[_0x28ae('0x1'),_0x28ae('0x2'),_0x28ae('0x3')];function createListener(_0x4c8c9d,_0x425112){return function(_0x23bb74){_0x425112['emit'](_0x4c8c9d,_0x23bb74);};}function removeListener(_0xf430bb,_0x5df267){return function(){FaxQueueEvents['removeListener'](_0xf430bb,_0x5df267);};}exports['register']=function(_0x3ea80d){for(var _0x2ea573=0x0,_0x1debf2=events[_0x28ae('0x4')];_0x2ea573<_0x1debf2;_0x2ea573++){var _0x328f8e=events[_0x2ea573];var _0x3ce5d6=createListener(_0x28ae('0x5')+_0x328f8e,_0x3ea80d);FaxQueueEvents['on'](_0x328f8e,_0x3ce5d6);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index c72fe6a..63080c8 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 _0xdeb3=['exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','isAuthenticated','get','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','put','update','delete','removeTeams','removeAgents'];(function(_0x282612,_0x45e458){var _0x36b461=function(_0x5b07e0){while(--_0x5b07e0){_0x282612['push'](_0x282612['shift']());}};_0x36b461(++_0x45e458);}(_0xdeb3,0xb7));var _0x3deb=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xdeb3[_0x4b369d];return _0x571a98;};'use strict';var multer=require('multer');var util=require(_0x3deb('0x0'));var path=require(_0x3deb('0x1'));var timeout=require(_0x3deb('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3deb('0x3'));var auth=require(_0x3deb('0x4'));var interaction=require(_0x3deb('0x5'));var config=require(_0x3deb('0x6'));var controller=require(_0x3deb('0x7'));router['get']('/',auth[_0x3deb('0x8')](),controller['index']);router[_0x3deb('0x9')]('/describe',auth[_0x3deb('0x8')](),controller[_0x3deb('0xa')]);router[_0x3deb('0x9')](_0x3deb('0xb'),auth[_0x3deb('0x8')](),controller[_0x3deb('0xc')]);router[_0x3deb('0x9')](_0x3deb('0xd'),auth[_0x3deb('0x8')](),controller['getMembers']);router['get'](_0x3deb('0xe'),auth[_0x3deb('0x8')](),controller[_0x3deb('0xf')]);router['get'](_0x3deb('0x10'),auth[_0x3deb('0x8')](),controller[_0x3deb('0x11')]);router[_0x3deb('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x3deb('0xe'),auth[_0x3deb('0x8')](),controller[_0x3deb('0x13')]);router['post'](_0x3deb('0x10'),auth[_0x3deb('0x8')](),controller['addAgents']);router[_0x3deb('0x14')](_0x3deb('0xb'),auth['isAuthenticated'](),controller[_0x3deb('0x15')]);router['delete'](_0x3deb('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x3deb('0x16')](_0x3deb('0xe'),auth[_0x3deb('0x8')](),controller[_0x3deb('0x17')]);router[_0x3deb('0x16')](_0x3deb('0x10'),auth['isAuthenticated'](),controller[_0x3deb('0x18')]);module[_0x3deb('0x19')]=router; \ No newline at end of file +var _0xaa37=['delete','removeTeams','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','isAuthenticated','describe','show','/:id/members','getMembers','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','/:id','destroy'];(function(_0x1a9f7c,_0x271aaa){var _0x56046b=function(_0x31ed8b){while(--_0x31ed8b){_0x1a9f7c['push'](_0x1a9f7c['shift']());}};_0x56046b(++_0x271aaa);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xaa37[_0x24061a];return _0x82054e;};'use strict';var multer=require(_0x7aa3('0x0'));var util=require(_0x7aa3('0x1'));var path=require(_0x7aa3('0x2'));var timeout=require(_0x7aa3('0x3'));var express=require('express');var router=express[_0x7aa3('0x4')]();var fs_extra=require(_0x7aa3('0x5'));var auth=require(_0x7aa3('0x6'));var interaction=require(_0x7aa3('0x7'));var config=require(_0x7aa3('0x8'));var controller=require(_0x7aa3('0x9'));router[_0x7aa3('0xa')]('/',auth['isAuthenticated'](),controller[_0x7aa3('0xb')]);router[_0x7aa3('0xa')]('/describe',auth[_0x7aa3('0xc')](),controller[_0x7aa3('0xd')]);router[_0x7aa3('0xa')]('/:id',auth[_0x7aa3('0xc')](),controller[_0x7aa3('0xe')]);router[_0x7aa3('0xa')](_0x7aa3('0xf'),auth[_0x7aa3('0xc')](),controller[_0x7aa3('0x10')]);router['get']('/:id/teams',auth[_0x7aa3('0xc')](),controller['getTeams']);router[_0x7aa3('0xa')](_0x7aa3('0x11'),auth['isAuthenticated'](),controller[_0x7aa3('0x12')]);router[_0x7aa3('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x7aa3('0x14'),auth[_0x7aa3('0xc')](),controller[_0x7aa3('0x15')]);router[_0x7aa3('0x13')](_0x7aa3('0x11'),auth['isAuthenticated'](),controller[_0x7aa3('0x16')]);router[_0x7aa3('0x17')](_0x7aa3('0x18'),auth[_0x7aa3('0xc')](),controller['update']);router['delete'](_0x7aa3('0x18'),auth['isAuthenticated'](),controller[_0x7aa3('0x19')]);router[_0x7aa3('0x1a')]('/:id/teams',auth[_0x7aa3('0xc')](),controller[_0x7aa3('0x1b')]);router[_0x7aa3('0x1a')](_0x7aa3('0x11'),auth[_0x7aa3('0xc')](),controller['removeAgents']);module[_0x7aa3('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 5abef7a..4442ae9 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 _0xdab2=['DATE','moment','sequelize','exports','STRING'];(function(_0x5e51eb,_0x1fe638){var _0x1be186=function(_0x3a30ce){while(--_0x3a30ce){_0x5e51eb['push'](_0x5e51eb['shift']());}};_0x1be186(++_0x1fe638);}(_0xdab2,0x17d));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x2dab('0x0'));var Sequelize=require(_0x2dab('0x1'));module[_0x2dab('0x2')]={'uniqueid':{'type':Sequelize[_0x2dab('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2dab('0x3')]},'joinAt':{'type':Sequelize[_0x2dab('0x4')]},'leaveAt':{'type':Sequelize[_0x2dab('0x4')]},'acceptAt':{'type':Sequelize[_0x2dab('0x4')]},'exitAt':{'type':Sequelize[_0x2dab('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x66a4=['DATE','moment','sequelize','exports','STRING'];(function(_0x17784a,_0x42fe44){var _0x41aded=function(_0x2e7319){while(--_0x2e7319){_0x17784a['push'](_0x17784a['shift']());}};_0x41aded(++_0x42fe44);}(_0x66a4,0x123));var _0x466a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x66a4[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0x466a('0x0'));var Sequelize=require(_0x466a('0x1'));module[_0x466a('0x2')]={'uniqueid':{'type':Sequelize[_0x466a('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x466a('0x4')]},'exitAt':{'type':Sequelize[_0x466a('0x4')]},'reason':{'type':Sequelize[_0x466a('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 02fcdf4..40e0473 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 _0x4b8a=['set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','index','map','FaxQueueReport','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','options','catch','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset'];(function(_0x1e7e12,_0x586d42){var _0x32781c=function(_0x39ee5b){while(--_0x39ee5b){_0x1e7e12['push'](_0x1e7e12['shift']());}};_0x32781c(++_0x586d42);}(_0x4b8a,0xd3));var _0xa4b8=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4b8a[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa4b8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa4b8('0x1'));var rp=require(_0xa4b8('0x2'));var moment=require(_0xa4b8('0x3'));var BPromise=require(_0xa4b8('0x4'));var Mustache=require(_0xa4b8('0x5'));var util=require(_0xa4b8('0x6'));var path=require(_0xa4b8('0x7'));var sox=require(_0xa4b8('0x8'));var csv=require(_0xa4b8('0x9'));var ejs=require(_0xa4b8('0xa'));var fs=require('fs');var fs_extra=require(_0xa4b8('0xb'));var _=require(_0xa4b8('0xc'));var squel=require(_0xa4b8('0xd'));var crypto=require(_0xa4b8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa4b8('0xf'));var toCsv=require(_0xa4b8('0x9'));var querystring=require(_0xa4b8('0x10'));var Papa=require(_0xa4b8('0x11'));var Redis=require(_0xa4b8('0x12'));var authService=require(_0xa4b8('0x13'));var qs=require(_0xa4b8('0x14'));var as=require(_0xa4b8('0x15'));var hardwareService=require(_0xa4b8('0x16'));var logger=require(_0xa4b8('0x17'))(_0xa4b8('0x18'));var utils=require(_0xa4b8('0x19'));var config=require(_0xa4b8('0x1a'));var licenseUtil=require(_0xa4b8('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c2d6b,_0x83aa39){_0x83aa39=_0x83aa39||0xcc;return function(_0x488b99){if(_0x488b99){return _0x4c2d6b[_0xa4b8('0x1c')](_0x83aa39);}return _0x4c2d6b[_0xa4b8('0x1d')](_0x83aa39)['end']();};}function respondWithResult(_0x2f3199,_0x157d7f){_0x157d7f=_0x157d7f||0xc8;return function(_0x1c8369){if(_0x1c8369){return _0x2f3199[_0xa4b8('0x1d')](_0x157d7f)[_0xa4b8('0x1e')](_0x1c8369);}};}function respondWithFilteredResult(_0x3bba1b,_0x238cac){return function(_0x443d7f){if(_0x443d7f){var _0x2fd884=typeof _0x238cac['offset']===_0xa4b8('0x1f')&&typeof _0x238cac[_0xa4b8('0x20')]==='undefined';var _0x315df1=_0x443d7f[_0xa4b8('0x21')];var _0x215cdf=_0x2fd884?0x0:_0x238cac[_0xa4b8('0x22')];var _0x20cf62=_0x2fd884?_0x443d7f['count']:_0x238cac['offset']+_0x238cac['limit'];var _0x518134;if(_0x20cf62>=_0x315df1){_0x20cf62=_0x315df1;_0x518134=0xc8;}else{_0x518134=0xce;}_0x3bba1b[_0xa4b8('0x1d')](_0x518134);return _0x3bba1b[_0xa4b8('0x23')](_0xa4b8('0x24'),_0x215cdf+'-'+_0x20cf62+'/'+_0x315df1)[_0xa4b8('0x1e')](_0x443d7f);}return null;};}function patchUpdates(_0x39676c){return function(_0x113812){try{jsonpatch[_0xa4b8('0x25')](_0x113812,_0x39676c,!![]);}catch(_0x10534b){return BPromise[_0xa4b8('0x26')](_0x10534b);}return _0x113812[_0xa4b8('0x27')]();};}function saveUpdates(_0xbdc088,_0x46c994){return function(_0x144e62){if(_0x144e62){return _0x144e62[_0xa4b8('0x28')](_0xbdc088)[_0xa4b8('0x29')](function(_0xeb5ae1){return _0xeb5ae1;});}return null;};}function removeEntity(_0x34f5d2,_0x4b28ae){return function(_0x27530c){if(_0x27530c){return _0x27530c[_0xa4b8('0x2a')]()['then'](function(){_0x34f5d2[_0xa4b8('0x1d')](0xcc)[_0xa4b8('0x2b')]();});}};}function handleEntityNotFound(_0x5b0257,_0x58b94d){return function(_0x4cd363){if(!_0x4cd363){_0x5b0257[_0xa4b8('0x1c')](0x194);}return _0x4cd363;};}function handleError(_0x2adaa0,_0x239b62){_0x239b62=_0x239b62||0x1f4;return function(_0xa11b76){logger['error'](_0xa11b76[_0xa4b8('0x2c')]);if(_0xa11b76[_0xa4b8('0x2d')]){delete _0xa11b76[_0xa4b8('0x2d')];}_0x2adaa0[_0xa4b8('0x1d')](_0x239b62)['send'](_0xa11b76);};}exports[_0xa4b8('0x2e')]=function(_0x4475eb,_0x3d5ed1){var _0x39b754={},_0x33fa28={},_0x3a6652={'count':0x0,'rows':[]};var _0x3d60ff=_[_0xa4b8('0x2f')](db[_0xa4b8('0x30')][_0xa4b8('0x31')],function(_0x41f627){return{'name':_0x41f627[_0xa4b8('0x32')],'type':_0x41f627['type'][_0xa4b8('0x33')]};});_0x33fa28[_0xa4b8('0x34')]=_[_0xa4b8('0x2f')](_0x3d60ff,'name');_0x33fa28[_0xa4b8('0x35')]=_[_0xa4b8('0x36')](_0x4475eb['query']);_0x33fa28['filters']=_['intersection'](_0x33fa28['model'],_0x33fa28[_0xa4b8('0x35')]);_0x39b754['attributes']=_[_0xa4b8('0x37')](_0x33fa28[_0xa4b8('0x34')],qs[_0xa4b8('0x38')](_0x4475eb['query'][_0xa4b8('0x38')]));_0x39b754[_0xa4b8('0x39')]=_0x39b754[_0xa4b8('0x39')][_0xa4b8('0x3a')]?_0x39b754[_0xa4b8('0x39')]:_0x33fa28['model'];if(!_0x4475eb[_0xa4b8('0x35')][_0xa4b8('0x3b')](_0xa4b8('0x3c'))){_0x39b754[_0xa4b8('0x20')]=qs[_0xa4b8('0x20')](_0x4475eb[_0xa4b8('0x35')][_0xa4b8('0x20')]);_0x39b754['offset']=qs[_0xa4b8('0x22')](_0x4475eb[_0xa4b8('0x35')][_0xa4b8('0x22')]);}_0x39b754[_0xa4b8('0x3d')]=qs[_0xa4b8('0x3e')](_0x4475eb['query'][_0xa4b8('0x3e')]);_0x39b754[_0xa4b8('0x3f')]=qs[_0xa4b8('0x40')](_[_0xa4b8('0x41')](_0x4475eb['query'],_0x33fa28['filters']),_0x3d60ff);if(_0x4475eb[_0xa4b8('0x35')][_0xa4b8('0x42')]){_0x39b754[_0xa4b8('0x3f')]=_[_0xa4b8('0x43')](_0x39b754[_0xa4b8('0x3f')],{'$or':_[_0xa4b8('0x2f')](_0x3d60ff,function(_0x22555b){if(_0x22555b[_0xa4b8('0x44')]!==_0xa4b8('0x45')){var _0xed5f77={};_0xed5f77[_0x22555b[_0xa4b8('0x2d')]]={'$like':'%'+_0x4475eb[_0xa4b8('0x35')][_0xa4b8('0x42')]+'%'};return _0xed5f77;}})});}_0x39b754=_[_0xa4b8('0x43')]({},_0x39b754,_0x4475eb['options']);var _0x35d62c={'where':_0x39b754['where']};return db[_0xa4b8('0x30')][_0xa4b8('0x21')](_0x35d62c)['then'](function(_0x5b9529){_0x3a6652[_0xa4b8('0x21')]=_0x5b9529;if(_0x4475eb[_0xa4b8('0x35')][_0xa4b8('0x46')]){_0x39b754[_0xa4b8('0x47')]=[{'all':!![]}];}return db[_0xa4b8('0x30')][_0xa4b8('0x48')](_0x39b754);})['then'](function(_0x9ac740){_0x3a6652[_0xa4b8('0x49')]=_0x9ac740;return _0x3a6652;})[_0xa4b8('0x29')](respondWithFilteredResult(_0x3d5ed1,_0x39b754))['catch'](handleError(_0x3d5ed1,null));};exports[_0xa4b8('0x4a')]=function(_0x2710de,_0xff9fc0){var _0x13a27c={'raw':!![],'where':{'id':_0x2710de[_0xa4b8('0x4b')]['id']}},_0x6c6438={};_0x6c6438[_0xa4b8('0x34')]=_[_0xa4b8('0x36')](db[_0xa4b8('0x30')]['rawAttributes']);_0x6c6438[_0xa4b8('0x35')]=_[_0xa4b8('0x36')](_0x2710de[_0xa4b8('0x35')]);_0x6c6438[_0xa4b8('0x40')]=_[_0xa4b8('0x37')](_0x6c6438[_0xa4b8('0x34')],_0x6c6438[_0xa4b8('0x35')]);_0x13a27c['attributes']=_[_0xa4b8('0x37')](_0x6c6438['model'],qs[_0xa4b8('0x38')](_0x2710de[_0xa4b8('0x35')]['fields']));_0x13a27c[_0xa4b8('0x39')]=_0x13a27c['attributes'][_0xa4b8('0x3a')]?_0x13a27c[_0xa4b8('0x39')]:_0x6c6438[_0xa4b8('0x34')];if(_0x2710de[_0xa4b8('0x35')][_0xa4b8('0x46')]){_0x13a27c[_0xa4b8('0x47')]=[{'all':!![]}];}_0x13a27c=_[_0xa4b8('0x43')]({},_0x13a27c,_0x2710de[_0xa4b8('0x4c')]);return db[_0xa4b8('0x30')]['find'](_0x13a27c)[_0xa4b8('0x29')](handleEntityNotFound(_0xff9fc0,null))['then'](respondWithResult(_0xff9fc0,null))[_0xa4b8('0x4d')](handleError(_0xff9fc0,null));};exports[_0xa4b8('0x4e')]=function(_0x375dd7,_0x551638){return db['FaxQueueReport'][_0xa4b8('0x4e')](_0x375dd7[_0xa4b8('0x4f')],{})['then'](respondWithResult(_0x551638,0xc9))[_0xa4b8('0x4d')](handleError(_0x551638,null));};exports['update']=function(_0x1b8a91,_0x6b9b99){if(_0x1b8a91[_0xa4b8('0x4f')]['id']){delete _0x1b8a91['body']['id'];}return db[_0xa4b8('0x30')][_0xa4b8('0x50')]({'where':{'id':_0x1b8a91[_0xa4b8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x6b9b99,null))['then'](saveUpdates(_0x1b8a91[_0xa4b8('0x4f')],null))[_0xa4b8('0x29')](respondWithResult(_0x6b9b99,null))[_0xa4b8('0x4d')](handleError(_0x6b9b99,null));};exports[_0xa4b8('0x2a')]=function(_0x3ca6fb,_0x510175){return db[_0xa4b8('0x30')]['find']({'where':{'id':_0x3ca6fb[_0xa4b8('0x4b')]['id']}})[_0xa4b8('0x29')](handleEntityNotFound(_0x510175,null))[_0xa4b8('0x29')](removeEntity(_0x510175,null))['catch'](handleError(_0x510175,null));};exports[_0xa4b8('0x51')]=function(_0x3cca98,_0x3edebc){return db[_0xa4b8('0x30')][_0xa4b8('0x51')]()[_0xa4b8('0x29')](respondWithResult(_0x3edebc,null))[_0xa4b8('0x4d')](handleError(_0x3edebc,null));}; \ No newline at end of file +var _0x7dc2=['find','create','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','end','stack','name','send','index','map','FaxQueueReport','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','options','includeAll','include','findAll','catch','show','keys'];(function(_0x2cca07,_0x310dd3){var _0x18767f=function(_0x4080a5){while(--_0x4080a5){_0x2cca07['push'](_0x2cca07['shift']());}};_0x18767f(++_0x310dd3);}(_0x7dc2,0x19d));var _0x27dc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7dc2[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x27dc('0x0'));var jsonpatch=require(_0x27dc('0x1'));var rp=require(_0x27dc('0x2'));var moment=require(_0x27dc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x27dc('0x4'));var util=require(_0x27dc('0x5'));var path=require('path');var sox=require(_0x27dc('0x6'));var csv=require(_0x27dc('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x27dc('0x8'));var _=require('lodash');var squel=require(_0x27dc('0x9'));var crypto=require(_0x27dc('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x27dc('0xb'));var toCsv=require(_0x27dc('0x7'));var querystring=require(_0x27dc('0xc'));var Papa=require(_0x27dc('0xd'));var Redis=require('ioredis');var authService=require(_0x27dc('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x27dc('0xf'));var hardwareService=require(_0x27dc('0x10'));var logger=require(_0x27dc('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x27dc('0x12'));var licenseUtil=require(_0x27dc('0x13'));var db=require(_0x27dc('0x14'))['db'];function respondWithStatusCode(_0x1c7a9e,_0x4d8afd){_0x4d8afd=_0x4d8afd||0xcc;return function(_0x2d7799){if(_0x2d7799){return _0x1c7a9e['sendStatus'](_0x4d8afd);}return _0x1c7a9e[_0x27dc('0x15')](_0x4d8afd)['end']();};}function respondWithResult(_0x1282f2,_0x22d9ac){_0x22d9ac=_0x22d9ac||0xc8;return function(_0x7972d8){if(_0x7972d8){return _0x1282f2[_0x27dc('0x15')](_0x22d9ac)['json'](_0x7972d8);}};}function respondWithFilteredResult(_0x110316,_0x1bd473){return function(_0x798f50){if(_0x798f50){var _0x4193f9=typeof _0x1bd473[_0x27dc('0x16')]==='undefined'&&typeof _0x1bd473[_0x27dc('0x17')]===_0x27dc('0x18');var _0x21f537=_0x798f50[_0x27dc('0x19')];var _0x5d308b=_0x4193f9?0x0:_0x1bd473[_0x27dc('0x16')];var _0x1ff9a2=_0x4193f9?_0x798f50[_0x27dc('0x19')]:_0x1bd473[_0x27dc('0x16')]+_0x1bd473[_0x27dc('0x17')];var _0x3dcfca;if(_0x1ff9a2>=_0x21f537){_0x1ff9a2=_0x21f537;_0x3dcfca=0xc8;}else{_0x3dcfca=0xce;}_0x110316[_0x27dc('0x15')](_0x3dcfca);return _0x110316[_0x27dc('0x1a')](_0x27dc('0x1b'),_0x5d308b+'-'+_0x1ff9a2+'/'+_0x21f537)[_0x27dc('0x1c')](_0x798f50);}return null;};}function patchUpdates(_0x5064d5){return function(_0x3b9afc){try{jsonpatch[_0x27dc('0x1d')](_0x3b9afc,_0x5064d5,!![]);}catch(_0x4bb946){return BPromise[_0x27dc('0x1e')](_0x4bb946);}return _0x3b9afc['save']();};}function saveUpdates(_0x5c0fca,_0x2843b1){return function(_0x4eddfe){if(_0x4eddfe){return _0x4eddfe[_0x27dc('0x1f')](_0x5c0fca)['then'](function(_0x4a7d2a){return _0x4a7d2a;});}return null;};}function removeEntity(_0x14fa88,_0x4a9da0){return function(_0x37917e){if(_0x37917e){return _0x37917e['destroy']()[_0x27dc('0x20')](function(){_0x14fa88[_0x27dc('0x15')](0xcc)[_0x27dc('0x21')]();});}};}function handleEntityNotFound(_0x19db16,_0x5205ed){return function(_0x473e2d){if(!_0x473e2d){_0x19db16['sendStatus'](0x194);}return _0x473e2d;};}function handleError(_0x4d91f7,_0x1409fd){_0x1409fd=_0x1409fd||0x1f4;return function(_0x25bfb7){logger['error'](_0x25bfb7[_0x27dc('0x22')]);if(_0x25bfb7[_0x27dc('0x23')]){delete _0x25bfb7[_0x27dc('0x23')];}_0x4d91f7[_0x27dc('0x15')](_0x1409fd)[_0x27dc('0x24')](_0x25bfb7);};}exports[_0x27dc('0x25')]=function(_0x76d54b,_0x15904d){var _0x1e751d={},_0xb4e273={},_0x295776={'count':0x0,'rows':[]};var _0x5ef2cc=_[_0x27dc('0x26')](db[_0x27dc('0x27')]['rawAttributes'],function(_0x14a8a1){return{'name':_0x14a8a1[_0x27dc('0x28')],'type':_0x14a8a1[_0x27dc('0x29')][_0x27dc('0x2a')]};});_0xb4e273['model']=_[_0x27dc('0x26')](_0x5ef2cc,_0x27dc('0x23'));_0xb4e273[_0x27dc('0x2b')]=_['keys'](_0x76d54b[_0x27dc('0x2b')]);_0xb4e273[_0x27dc('0x2c')]=_[_0x27dc('0x2d')](_0xb4e273[_0x27dc('0x2e')],_0xb4e273['query']);_0x1e751d[_0x27dc('0x2f')]=_[_0x27dc('0x2d')](_0xb4e273[_0x27dc('0x2e')],qs['fields'](_0x76d54b[_0x27dc('0x2b')][_0x27dc('0x30')]));_0x1e751d[_0x27dc('0x2f')]=_0x1e751d[_0x27dc('0x2f')][_0x27dc('0x31')]?_0x1e751d['attributes']:_0xb4e273[_0x27dc('0x2e')];if(!_0x76d54b[_0x27dc('0x2b')][_0x27dc('0x32')](_0x27dc('0x33'))){_0x1e751d[_0x27dc('0x17')]=qs['limit'](_0x76d54b['query'][_0x27dc('0x17')]);_0x1e751d[_0x27dc('0x16')]=qs[_0x27dc('0x16')](_0x76d54b[_0x27dc('0x2b')]['offset']);}_0x1e751d['order']=qs[_0x27dc('0x34')](_0x76d54b[_0x27dc('0x2b')][_0x27dc('0x34')]);_0x1e751d['where']=qs[_0x27dc('0x2c')](_['pick'](_0x76d54b[_0x27dc('0x2b')],_0xb4e273['filters']),_0x5ef2cc);if(_0x76d54b[_0x27dc('0x2b')][_0x27dc('0x35')]){_0x1e751d[_0x27dc('0x36')]=_[_0x27dc('0x37')](_0x1e751d[_0x27dc('0x36')],{'$or':_[_0x27dc('0x26')](_0x5ef2cc,function(_0x1f72fc){if(_0x1f72fc[_0x27dc('0x29')]!=='VIRTUAL'){var _0x3f017b={};_0x3f017b[_0x1f72fc[_0x27dc('0x23')]]={'$like':'%'+_0x76d54b['query'][_0x27dc('0x35')]+'%'};return _0x3f017b;}})});}_0x1e751d=_[_0x27dc('0x37')]({},_0x1e751d,_0x76d54b[_0x27dc('0x38')]);var _0x49fa10={'where':_0x1e751d[_0x27dc('0x36')]};return db[_0x27dc('0x27')][_0x27dc('0x19')](_0x49fa10)[_0x27dc('0x20')](function(_0x5800fa){_0x295776[_0x27dc('0x19')]=_0x5800fa;if(_0x76d54b[_0x27dc('0x2b')][_0x27dc('0x39')]){_0x1e751d[_0x27dc('0x3a')]=[{'all':!![]}];}return db[_0x27dc('0x27')][_0x27dc('0x3b')](_0x1e751d);})['then'](function(_0x5066b5){_0x295776['rows']=_0x5066b5;return _0x295776;})[_0x27dc('0x20')](respondWithFilteredResult(_0x15904d,_0x1e751d))[_0x27dc('0x3c')](handleError(_0x15904d,null));};exports[_0x27dc('0x3d')]=function(_0xc15911,_0x4fcbe6){var _0x57b207={'raw':!![],'where':{'id':_0xc15911['params']['id']}},_0x725244={};_0x725244[_0x27dc('0x2e')]=_[_0x27dc('0x3e')](db[_0x27dc('0x27')]['rawAttributes']);_0x725244[_0x27dc('0x2b')]=_[_0x27dc('0x3e')](_0xc15911[_0x27dc('0x2b')]);_0x725244[_0x27dc('0x2c')]=_['intersection'](_0x725244[_0x27dc('0x2e')],_0x725244[_0x27dc('0x2b')]);_0x57b207['attributes']=_[_0x27dc('0x2d')](_0x725244[_0x27dc('0x2e')],qs[_0x27dc('0x30')](_0xc15911[_0x27dc('0x2b')][_0x27dc('0x30')]));_0x57b207[_0x27dc('0x2f')]=_0x57b207[_0x27dc('0x2f')][_0x27dc('0x31')]?_0x57b207[_0x27dc('0x2f')]:_0x725244['model'];if(_0xc15911[_0x27dc('0x2b')]['includeAll']){_0x57b207[_0x27dc('0x3a')]=[{'all':!![]}];}_0x57b207=_[_0x27dc('0x37')]({},_0x57b207,_0xc15911[_0x27dc('0x38')]);return db[_0x27dc('0x27')][_0x27dc('0x3f')](_0x57b207)['then'](handleEntityNotFound(_0x4fcbe6,null))[_0x27dc('0x20')](respondWithResult(_0x4fcbe6,null))[_0x27dc('0x3c')](handleError(_0x4fcbe6,null));};exports[_0x27dc('0x40')]=function(_0x255323,_0x1a3256){return db[_0x27dc('0x27')][_0x27dc('0x40')](_0x255323[_0x27dc('0x41')],{})[_0x27dc('0x20')](respondWithResult(_0x1a3256,0xc9))['catch'](handleError(_0x1a3256,null));};exports['update']=function(_0x8db62d,_0x37517d){if(_0x8db62d['body']['id']){delete _0x8db62d[_0x27dc('0x41')]['id'];}return db[_0x27dc('0x27')]['find']({'where':{'id':_0x8db62d['params']['id']}})['then'](handleEntityNotFound(_0x37517d,null))[_0x27dc('0x20')](saveUpdates(_0x8db62d['body'],null))['then'](respondWithResult(_0x37517d,null))[_0x27dc('0x3c')](handleError(_0x37517d,null));};exports[_0x27dc('0x42')]=function(_0x22f3df,_0x5ee5e3){return db[_0x27dc('0x27')][_0x27dc('0x3f')]({'where':{'id':_0x22f3df['params']['id']}})[_0x27dc('0x20')](handleEntityNotFound(_0x5ee5e3,null))[_0x27dc('0x20')](removeEntity(_0x5ee5e3,null))['catch'](handleError(_0x5ee5e3,null));};exports[_0x27dc('0x43')]=function(_0xb2eda0,_0x371516){return db[_0x27dc('0x27')][_0x27dc('0x43')]()[_0x27dc('0x20')](respondWithResult(_0x371516,null))['catch'](handleError(_0x371516,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 8668c8b..146ab50 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 _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./faxQueueReport.attributes','exports','define','report_fax_queue','uniqueid','lodash'];(function(_0x16013b,_0x221ddc){var _0x9827cc=function(_0x28b468){while(--_0x28b468){_0x16013b['push'](_0x16013b['shift']());}};_0x9827cc(++_0x221ddc);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0x5fc3[_0x5ecadc];return _0x565037;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('FaxQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xabce=['path','rimraf','../../config/environment','define','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x1f7451,_0x37e415){var _0x17cb1a=function(_0x2a376d){while(--_0x2a376d){_0x1f7451['push'](_0x1f7451['shift']());}};_0x17cb1a(++_0x37e415);}(_0xabce,0x103));var _0xeabc=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xabce[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('FaxQueueReport',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[{'name':_0xeabc('0xa'),'fields':[_0xeabc('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 0079a50..56590b5 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 _0xd063=['jayson/promise','client','http','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','update','raw','where','attributes','UpdateFaxQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x456068,_0x2d7a87){var _0x142a0d=function(_0x24d55a){while(--_0x24d55a){_0x456068['push'](_0x456068['shift']());}};_0x142a0d(++_0x2d7a87);}(_0xd063,0x121));var _0x3d06=function(_0xc55368,_0x1ba192){_0xc55368=_0xc55368-0x0;var _0xf78a58=_0xd063[_0xc55368];return _0xf78a58;};'use strict';var _=require(_0x3d06('0x0'));var util=require(_0x3d06('0x1'));var moment=require(_0x3d06('0x2'));var BPromise=require(_0x3d06('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d06('0x4'));var db=require(_0x3d06('0x5'))['db'];var utils=require(_0x3d06('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3d06('0x7'));var jayson=require(_0x3d06('0x8'));var client=jayson[_0x3d06('0x9')][_0x3d06('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x177840,_0xe8e866,_0x569f30){return new BPromise(function(_0x4d1386,_0xd73130){return client['request'](_0x177840,_0x569f30)[_0x3d06('0xb')](function(_0x4d66b6){logger[_0x3d06('0xc')](_0x3d06('0xd'),_0xe8e866,'request\x20sent');logger[_0x3d06('0xe')](_0x3d06('0xf'),_0xe8e866,_0x3d06('0x10'),JSON[_0x3d06('0x11')](_0x4d66b6));if(_0x4d66b6['error']){if(_0x4d66b6[_0x3d06('0x12')][_0x3d06('0x13')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0xe8e866,_0x4d66b6[_0x3d06('0x12')]['message']);return _0xd73130(_0x4d66b6[_0x3d06('0x12')][_0x3d06('0x14')]);}logger[_0x3d06('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0xe8e866,_0x4d66b6[_0x3d06('0x12')]['message']);return _0x4d1386(_0x4d66b6[_0x3d06('0x12')]['message']);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0xe8e866,_0x3d06('0x10'));_0x4d1386(_0x4d66b6[_0x3d06('0x15')][_0x3d06('0x14')]);}})[_0x3d06('0x16')](function(_0x859dbc){logger[_0x3d06('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0xe8e866,_0x859dbc);_0xd73130(_0x859dbc);});});}exports[_0x3d06('0x17')]=function(_0x251d9e){var _0x4dda62=this;return new Promise(function(_0x28a6c0,_0x56212a){return db[_0x3d06('0x18')][_0x3d06('0x19')](_0x251d9e[_0x3d06('0x1a')],{'raw':_0x251d9e[_0x3d06('0x1b')]?_0x251d9e[_0x3d06('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2e56e4){logger[_0x3d06('0xc')]('CreateFaxQueueReport',_0x251d9e);logger[_0x3d06('0xe')]('CreateFaxQueueReport',_0x251d9e,JSON[_0x3d06('0x11')](_0x2e56e4));_0x28a6c0(_0x2e56e4);})[_0x3d06('0x16')](function(_0x19eea8){logger['error']('CreateFaxQueueReport',_0x19eea8['message'],_0x251d9e);_0x56212a(_0x4dda62[_0x3d06('0x12')](0x1f4,_0x19eea8[_0x3d06('0x14')]));});});};exports['UpdateFaxQueueReport']=function(_0x471eff){var _0x24bf73=this;return new Promise(function(_0x3847c6,_0x2db6a6){return db[_0x3d06('0x18')][_0x3d06('0x1c')](_0x471eff[_0x3d06('0x1a')],{'raw':_0x471eff[_0x3d06('0x1b')]?_0x471eff[_0x3d06('0x1b')][_0x3d06('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x471eff[_0x3d06('0x1b')]?_0x471eff[_0x3d06('0x1b')][_0x3d06('0x1e')]||null:null,'attributes':_0x471eff[_0x3d06('0x1b')]?_0x471eff[_0x3d06('0x1b')][_0x3d06('0x1f')]||null:null,'limit':_0x471eff[_0x3d06('0x1b')]?_0x471eff[_0x3d06('0x1b')]['limit']||null:null})['then'](function(_0x1f1408){logger[_0x3d06('0xc')](_0x3d06('0x20'),_0x471eff);logger[_0x3d06('0xe')](_0x3d06('0x20'),_0x471eff,JSON[_0x3d06('0x11')](_0x1f1408));_0x3847c6(_0x1f1408);})[_0x3d06('0x16')](function(_0x5c6dbe){logger[_0x3d06('0x12')]('UpdateFaxQueueReport',_0x5c6dbe['message'],_0x471eff);_0x2db6a6(_0x24bf73[_0x3d06('0x12')](0x1f4,_0x5c6dbe[_0x3d06('0x14')]));});});}; \ No newline at end of file +var _0xc3b5=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','stringify','error','FaxQueueReport,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateFaxQueueReport','create','body','options','raw','debug','UpdateFaxQueueReport','FaxQueueReport','update','limit','then','lodash','util','moment','randomstring'];(function(_0x40116b,_0x3c4870){var _0x12df1d=function(_0x1c5e5b){while(--_0x1c5e5b){_0x40116b['push'](_0x40116b['shift']());}};_0x12df1d(++_0x3c4870);}(_0xc3b5,0x15c));var _0x5c3b=function(_0x13fba5,_0x330e55){_0x13fba5=_0x13fba5-0x0;var _0x5c27d7=_0xc3b5[_0x13fba5];return _0x5c27d7;};'use strict';var _=require(_0x5c3b('0x0'));var util=require(_0x5c3b('0x1'));var moment=require(_0x5c3b('0x2'));var BPromise=require('bluebird');var rs=require(_0x5c3b('0x3'));var fs=require('fs');var Redis=require(_0x5c3b('0x4'));var db=require(_0x5c3b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5c3b('0x6'))(_0x5c3b('0x7'));var config=require(_0x5c3b('0x8'));var jayson=require(_0x5c3b('0x9'));var client=jayson[_0x5c3b('0xa')][_0x5c3b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f33f1,_0x1b790b,_0x5b26aa){return new BPromise(function(_0x28efb9,_0x263b22){return client[_0x5c3b('0xc')](_0x5f33f1,_0x5b26aa)['then'](function(_0x551ab6){logger[_0x5c3b('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x1b790b,'request\x20sent');logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x1b790b,'request\x20sent',JSON[_0x5c3b('0xe')](_0x551ab6));if(_0x551ab6[_0x5c3b('0xf')]){if(_0x551ab6[_0x5c3b('0xf')]['code']===0x1f4){logger[_0x5c3b('0xf')](_0x5c3b('0x10'),_0x1b790b,_0x551ab6[_0x5c3b('0xf')][_0x5c3b('0x11')]);return _0x263b22(_0x551ab6['error'][_0x5c3b('0x11')]);}logger[_0x5c3b('0xf')](_0x5c3b('0x10'),_0x1b790b,_0x551ab6[_0x5c3b('0xf')]['message']);return _0x28efb9(_0x551ab6['error'][_0x5c3b('0x11')]);}else{logger[_0x5c3b('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x1b790b,_0x5c3b('0x12'));_0x28efb9(_0x551ab6[_0x5c3b('0x13')][_0x5c3b('0x11')]);}})[_0x5c3b('0x14')](function(_0x5ec186){logger[_0x5c3b('0xf')](_0x5c3b('0x10'),_0x1b790b,_0x5ec186);_0x263b22(_0x5ec186);});});}exports[_0x5c3b('0x15')]=function(_0x4d112d){var _0x832209=this;return new Promise(function(_0x42d12d,_0x6d2861){return db['FaxQueueReport'][_0x5c3b('0x16')](_0x4d112d[_0x5c3b('0x17')],{'raw':_0x4d112d[_0x5c3b('0x18')]?_0x4d112d[_0x5c3b('0x18')][_0x5c3b('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3f76c4){logger[_0x5c3b('0xd')](_0x5c3b('0x15'),_0x4d112d);logger[_0x5c3b('0x1a')](_0x5c3b('0x15'),_0x4d112d,JSON['stringify'](_0x3f76c4));_0x42d12d(_0x3f76c4);})[_0x5c3b('0x14')](function(_0x10e6fd){logger[_0x5c3b('0xf')](_0x5c3b('0x15'),_0x10e6fd[_0x5c3b('0x11')],_0x4d112d);_0x6d2861(_0x832209['error'](0x1f4,_0x10e6fd[_0x5c3b('0x11')]));});});};exports[_0x5c3b('0x1b')]=function(_0x317710){var _0x2dfcd9=this;return new Promise(function(_0x110e1e,_0x1dcfeb){return db[_0x5c3b('0x1c')][_0x5c3b('0x1d')](_0x317710[_0x5c3b('0x17')],{'raw':_0x317710[_0x5c3b('0x18')]?_0x317710[_0x5c3b('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x317710[_0x5c3b('0x18')]?_0x317710[_0x5c3b('0x18')]['where']||null:null,'attributes':_0x317710[_0x5c3b('0x18')]?_0x317710[_0x5c3b('0x18')]['attributes']||null:null,'limit':_0x317710[_0x5c3b('0x18')]?_0x317710['options'][_0x5c3b('0x1e')]||null:null})[_0x5c3b('0x1f')](function(_0x14b0b6){logger['info'](_0x5c3b('0x1b'),_0x317710);logger[_0x5c3b('0x1a')]('UpdateFaxQueueReport',_0x317710,JSON['stringify'](_0x14b0b6));_0x110e1e(_0x14b0b6);})[_0x5c3b('0x14')](function(_0x4f957a){logger[_0x5c3b('0xf')](_0x5c3b('0x1b'),_0x4f957a[_0x5c3b('0x11')],_0x317710);_0x1dcfeb(_0x2dfcd9[_0x5c3b('0xf')](0x1f4,_0x4f957a[_0x5c3b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 0062ea5..c72f0bc 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 _0x0243=['isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get'];(function(_0x57cbbc,_0x5dcaa0){var _0x270483=function(_0x303157){while(--_0x303157){_0x57cbbc['push'](_0x57cbbc['shift']());}};_0x270483(++_0x5dcaa0);}(_0x0243,0x14b));var _0x3024=function(_0x91fd3a,_0x35ea08){_0x91fd3a=_0x91fd3a-0x0;var _0x2180e0=_0x0243[_0x91fd3a];return _0x2180e0;};'use strict';var multer=require(_0x3024('0x0'));var util=require('util');var path=require(_0x3024('0x1'));var timeout=require(_0x3024('0x2'));var express=require('express');var router=express[_0x3024('0x3')]();var fs_extra=require(_0x3024('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3024('0x5'));var config=require(_0x3024('0x6'));var controller=require(_0x3024('0x7'));router[_0x3024('0x8')]('/',auth[_0x3024('0x9')](),controller['index']);router[_0x3024('0x8')](_0x3024('0xa'),auth['isAuthenticated'](),controller[_0x3024('0xb')]);router[_0x3024('0x8')](_0x3024('0xc'),auth[_0x3024('0x9')](),controller[_0x3024('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3024('0xe')]);router[_0x3024('0xf')]('/:id',auth[_0x3024('0x9')](),controller[_0x3024('0x10')]);router[_0x3024('0x11')](_0x3024('0xc'),auth[_0x3024('0x9')](),controller[_0x3024('0x12')]);module[_0x3024('0x13')]=router; \ No newline at end of file +var _0x0df5=['multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x4e0717,_0x43ba49){var _0x5c89a1=function(_0x4dc7f3){while(--_0x4dc7f3){_0x4e0717['push'](_0x4e0717['shift']());}};_0x5c89a1(++_0x43ba49);}(_0x0df5,0x168));var _0x50df=function(_0x23130e,_0x938869){_0x23130e=_0x23130e-0x0;var _0x5dfd0d=_0x0df5[_0x23130e];return _0x5dfd0d;};'use strict';var multer=require(_0x50df('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x50df('0x1'));var router=express[_0x50df('0x2')]();var fs_extra=require(_0x50df('0x3'));var auth=require(_0x50df('0x4'));var interaction=require(_0x50df('0x5'));var config=require(_0x50df('0x6'));var controller=require('./faxQueueReport.controller');router[_0x50df('0x7')]('/',auth[_0x50df('0x8')](),controller[_0x50df('0x9')]);router[_0x50df('0x7')](_0x50df('0xa'),auth['isAuthenticated'](),controller[_0x50df('0xb')]);router['get'](_0x50df('0xc'),auth['isAuthenticated'](),controller[_0x50df('0xd')]);router[_0x50df('0xe')]('/',auth[_0x50df('0x8')](),controller[_0x50df('0xf')]);router[_0x50df('0x10')](_0x50df('0xc'),auth[_0x50df('0x8')](),controller['update']);router[_0x50df('0x11')](_0x50df('0xc'),auth[_0x50df('0x8')](),controller[_0x50df('0x12')]);module[_0x50df('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 25eb339..fd0b508 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x54c747,_0x22e625){var _0x50b206=function(_0x3aaf14){while(--_0x3aaf14){_0x54c747['push'](_0x54c747['shift']());}};_0x50b206(++_0x22e625);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4171c9,_0x473f12){_0x4171c9=_0x4171c9-0x0;var _0x2f6908=_0xf4eb[_0x4171c9];return _0x2f6908;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x2d61b2,_0x142947){var _0x12df89=function(_0x31c717){while(--_0x31c717){_0x2d61b2['push'](_0x2d61b2['shift']());}};_0x12df89(++_0x142947);}(_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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index faafd02..0d1b2b7 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 _0x3983=['FaxTransferReport','rawAttributes','fieldName','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','options','includeAll','include','findAll','catch','show','params','length','body','update','find','describe','rimraf','zip-dir','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','status','error','name','send','index','map'];(function(_0x1982eb,_0x43a2ec){var _0x3a7933=function(_0x19c8b9){while(--_0x19c8b9){_0x1982eb['push'](_0x1982eb['shift']());}};_0x3a7933(++_0x43a2ec);}(_0x3983,0x1e7));var _0x3398=function(_0x5e33f6,_0x21ce06){_0x5e33f6=_0x5e33f6-0x0;var _0x38bab6=_0x3983[_0x5e33f6];return _0x38bab6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3398('0x0'));var zipdir=require(_0x3398('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3398('0x2'));var moment=require(_0x3398('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3398('0x4'));var util=require('util');var path=require(_0x3398('0x5'));var sox=require(_0x3398('0x6'));var csv=require(_0x3398('0x7'));var ejs=require(_0x3398('0x8'));var fs=require('fs');var fs_extra=require(_0x3398('0x9'));var _=require(_0x3398('0xa'));var squel=require(_0x3398('0xb'));var crypto=require(_0x3398('0xc'));var jsforce=require(_0x3398('0xd'));var deskjs=require(_0x3398('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3398('0xf'));var Papa=require(_0x3398('0x10'));var Redis=require(_0x3398('0x11'));var authService=require(_0x3398('0x12'));var qs=require(_0x3398('0x13'));var as=require(_0x3398('0x14'));var hardwareService=require(_0x3398('0x15'));var logger=require(_0x3398('0x16'))('api');var utils=require(_0x3398('0x17'));var config=require(_0x3398('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3398('0x19'))['db'];function respondWithStatusCode(_0x3c0806,_0x113ad3){_0x113ad3=_0x113ad3||0xcc;return function(_0x1ab78b){if(_0x1ab78b){return _0x3c0806[_0x3398('0x1a')](_0x113ad3);}return _0x3c0806['status'](_0x113ad3)[_0x3398('0x1b')]();};}function respondWithResult(_0x2cac49,_0x126d81){_0x126d81=_0x126d81||0xc8;return function(_0x50ad08){if(_0x50ad08){return _0x2cac49['status'](_0x126d81)[_0x3398('0x1c')](_0x50ad08);}};}function respondWithFilteredResult(_0x187ee5,_0x59d6bd){return function(_0x63c564){if(_0x63c564){var _0x57935f=typeof _0x59d6bd[_0x3398('0x1d')]===_0x3398('0x1e')&&typeof _0x59d6bd[_0x3398('0x1f')]===_0x3398('0x1e');var _0x54b595=_0x63c564[_0x3398('0x20')];var _0x54bc9b=_0x57935f?0x0:_0x59d6bd[_0x3398('0x1d')];var _0x26351e=_0x57935f?_0x63c564[_0x3398('0x20')]:_0x59d6bd[_0x3398('0x1d')]+_0x59d6bd[_0x3398('0x1f')];var _0x35a845;if(_0x26351e>=_0x54b595){_0x26351e=_0x54b595;_0x35a845=0xc8;}else{_0x35a845=0xce;}_0x187ee5['status'](_0x35a845);return _0x187ee5[_0x3398('0x21')](_0x3398('0x22'),_0x54bc9b+'-'+_0x26351e+'/'+_0x54b595)[_0x3398('0x1c')](_0x63c564);}return null;};}function patchUpdates(_0x4bd722){return function(_0x32ed73){try{jsonpatch[_0x3398('0x23')](_0x32ed73,_0x4bd722,!![]);}catch(_0xee91f0){return BPromise['reject'](_0xee91f0);}return _0x32ed73[_0x3398('0x24')]();};}function saveUpdates(_0x21d64f,_0x55ed60){return function(_0x47750d){if(_0x47750d){return _0x47750d['update'](_0x21d64f)[_0x3398('0x25')](function(_0x305a72){return _0x305a72;});}return null;};}function removeEntity(_0x3d6260,_0x17980b){return function(_0x201006){if(_0x201006){return _0x201006[_0x3398('0x26')]()['then'](function(){_0x3d6260[_0x3398('0x27')](0xcc)[_0x3398('0x1b')]();});}};}function handleEntityNotFound(_0x485557,_0x45e13c){return function(_0x865dfe){if(!_0x865dfe){_0x485557['sendStatus'](0x194);}return _0x865dfe;};}function handleError(_0x5dc3bc,_0x1ec177){_0x1ec177=_0x1ec177||0x1f4;return function(_0x591cbf){logger[_0x3398('0x28')](_0x591cbf['stack']);if(_0x591cbf['name']){delete _0x591cbf[_0x3398('0x29')];}_0x5dc3bc[_0x3398('0x27')](_0x1ec177)[_0x3398('0x2a')](_0x591cbf);};}exports[_0x3398('0x2b')]=function(_0x4ebf95,_0xd95a59){var _0x51355d={},_0x142a44={},_0x59273a={'count':0x0,'rows':[]};var _0x17580f=_[_0x3398('0x2c')](db[_0x3398('0x2d')][_0x3398('0x2e')],function(_0x292ab1){return{'name':_0x292ab1[_0x3398('0x2f')],'type':_0x292ab1['type'][_0x3398('0x30')]};});_0x142a44['model']=_['map'](_0x17580f,_0x3398('0x29'));_0x142a44[_0x3398('0x31')]=_[_0x3398('0x32')](_0x4ebf95['query']);_0x142a44['filters']=_[_0x3398('0x33')](_0x142a44[_0x3398('0x34')],_0x142a44[_0x3398('0x31')]);_0x51355d['attributes']=_[_0x3398('0x33')](_0x142a44[_0x3398('0x34')],qs[_0x3398('0x35')](_0x4ebf95['query']['fields']));_0x51355d[_0x3398('0x36')]=_0x51355d[_0x3398('0x36')]['length']?_0x51355d[_0x3398('0x36')]:_0x142a44[_0x3398('0x34')];if(!_0x4ebf95[_0x3398('0x31')][_0x3398('0x37')](_0x3398('0x38'))){_0x51355d[_0x3398('0x1f')]=qs['limit'](_0x4ebf95[_0x3398('0x31')][_0x3398('0x1f')]);_0x51355d[_0x3398('0x1d')]=qs[_0x3398('0x1d')](_0x4ebf95['query'][_0x3398('0x1d')]);}_0x51355d[_0x3398('0x39')]=qs[_0x3398('0x3a')](_0x4ebf95[_0x3398('0x31')][_0x3398('0x3a')]);_0x51355d[_0x3398('0x3b')]=qs[_0x3398('0x3c')](_['pick'](_0x4ebf95[_0x3398('0x31')],_0x142a44[_0x3398('0x3c')]),_0x17580f);if(_0x4ebf95[_0x3398('0x31')][_0x3398('0x3d')]){_0x51355d['where']=_[_0x3398('0x3e')](_0x51355d[_0x3398('0x3b')],{'$or':_[_0x3398('0x2c')](_0x17580f,function(_0x2fa7e9){if(_0x2fa7e9[_0x3398('0x3f')]!=='VIRTUAL'){var _0x1ff7a0={};_0x1ff7a0[_0x2fa7e9[_0x3398('0x29')]]={'$like':'%'+_0x4ebf95[_0x3398('0x31')][_0x3398('0x3d')]+'%'};return _0x1ff7a0;}})});}_0x51355d=_[_0x3398('0x3e')]({},_0x51355d,_0x4ebf95[_0x3398('0x40')]);var _0x5839a4={'where':_0x51355d[_0x3398('0x3b')]};return db['FaxTransferReport'][_0x3398('0x20')](_0x5839a4)[_0x3398('0x25')](function(_0xf1ec7a){_0x59273a['count']=_0xf1ec7a;if(_0x4ebf95[_0x3398('0x31')][_0x3398('0x41')]){_0x51355d[_0x3398('0x42')]=[{'all':!![]}];}return db[_0x3398('0x2d')][_0x3398('0x43')](_0x51355d);})[_0x3398('0x25')](function(_0x574fe0){_0x59273a['rows']=_0x574fe0;return _0x59273a;})[_0x3398('0x25')](respondWithFilteredResult(_0xd95a59,_0x51355d))[_0x3398('0x44')](handleError(_0xd95a59,null));};exports[_0x3398('0x45')]=function(_0xc2020e,_0x48c599){var _0xb2cf63={'raw':!![],'where':{'id':_0xc2020e[_0x3398('0x46')]['id']}},_0x1dd436={};_0x1dd436[_0x3398('0x34')]=_['keys'](db[_0x3398('0x2d')][_0x3398('0x2e')]);_0x1dd436[_0x3398('0x31')]=_['keys'](_0xc2020e['query']);_0x1dd436['filters']=_[_0x3398('0x33')](_0x1dd436[_0x3398('0x34')],_0x1dd436['query']);_0xb2cf63[_0x3398('0x36')]=_[_0x3398('0x33')](_0x1dd436[_0x3398('0x34')],qs[_0x3398('0x35')](_0xc2020e[_0x3398('0x31')][_0x3398('0x35')]));_0xb2cf63[_0x3398('0x36')]=_0xb2cf63[_0x3398('0x36')][_0x3398('0x47')]?_0xb2cf63[_0x3398('0x36')]:_0x1dd436['model'];if(_0xc2020e['query'][_0x3398('0x41')]){_0xb2cf63[_0x3398('0x42')]=[{'all':!![]}];}_0xb2cf63=_[_0x3398('0x3e')]({},_0xb2cf63,_0xc2020e['options']);return db[_0x3398('0x2d')]['find'](_0xb2cf63)[_0x3398('0x25')](handleEntityNotFound(_0x48c599,null))['then'](respondWithResult(_0x48c599,null))[_0x3398('0x44')](handleError(_0x48c599,null));};exports['create']=function(_0x3bc6c2,_0x55524b){return db[_0x3398('0x2d')]['create'](_0x3bc6c2[_0x3398('0x48')],{})['then'](respondWithResult(_0x55524b,0xc9))[_0x3398('0x44')](handleError(_0x55524b,null));};exports[_0x3398('0x49')]=function(_0x54da44,_0x18f4ec){if(_0x54da44[_0x3398('0x48')]['id']){delete _0x54da44['body']['id'];}return db['FaxTransferReport'][_0x3398('0x4a')]({'where':{'id':_0x54da44[_0x3398('0x46')]['id']}})[_0x3398('0x25')](handleEntityNotFound(_0x18f4ec,null))[_0x3398('0x25')](saveUpdates(_0x54da44['body'],null))[_0x3398('0x25')](respondWithResult(_0x18f4ec,null))[_0x3398('0x44')](handleError(_0x18f4ec,null));};exports[_0x3398('0x26')]=function(_0xaa76bb,_0x10e359){return db[_0x3398('0x2d')][_0x3398('0x4a')]({'where':{'id':_0xaa76bb['params']['id']}})[_0x3398('0x25')](handleEntityNotFound(_0x10e359,null))[_0x3398('0x25')](removeEntity(_0x10e359,null))[_0x3398('0x44')](handleError(_0x10e359,null));};exports['describe']=function(_0x162f2f,_0x98f0a2){return db[_0x3398('0x2d')][_0x3398('0x4b')]()[_0x3398('0x25')](respondWithResult(_0x98f0a2,null))[_0x3398('0x44')](handleError(_0x98f0a2,null));}; \ No newline at end of file +var _0xe8f0=['mustache','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','then','error','stack','name','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','order','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','update','describe','eml-format','fast-json-patch','request-promise','moment','bluebird'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0xe8f0,0x145));var _0x0e8f=function(_0x3ea384,_0x461b81){_0x3ea384=_0x3ea384-0x0;var _0x3fec60=_0xe8f0[_0x3ea384];return _0x3fec60;};'use strict';var emlformat=require(_0x0e8f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0e8f('0x1'));var rp=require(_0x0e8f('0x2'));var moment=require(_0x0e8f('0x3'));var BPromise=require(_0x0e8f('0x4'));var Mustache=require(_0x0e8f('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0e8f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0e8f('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0e8f('0x8'));var jsforce=require(_0x0e8f('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x0e8f('0x6'));var querystring=require(_0x0e8f('0xa'));var Papa=require(_0x0e8f('0xb'));var Redis=require(_0x0e8f('0xc'));var authService=require(_0x0e8f('0xd'));var qs=require(_0x0e8f('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e8f('0xf'));var logger=require('../../config/logger')(_0x0e8f('0x10'));var utils=require(_0x0e8f('0x11'));var config=require(_0x0e8f('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x279c66,_0x8adb58){_0x8adb58=_0x8adb58||0xcc;return function(_0x4d0655){if(_0x4d0655){return _0x279c66['sendStatus'](_0x8adb58);}return _0x279c66[_0x0e8f('0x13')](_0x8adb58)[_0x0e8f('0x14')]();};}function respondWithResult(_0x31995a,_0x131a5a){_0x131a5a=_0x131a5a||0xc8;return function(_0x4b72e8){if(_0x4b72e8){return _0x31995a[_0x0e8f('0x13')](_0x131a5a)[_0x0e8f('0x15')](_0x4b72e8);}};}function respondWithFilteredResult(_0x4f27c1,_0x3478b3){return function(_0x27c9b){if(_0x27c9b){var _0x5cb83a=typeof _0x3478b3[_0x0e8f('0x16')]==='undefined'&&typeof _0x3478b3[_0x0e8f('0x17')]===_0x0e8f('0x18');var _0x5c5fe4=_0x27c9b[_0x0e8f('0x19')];var _0x43d910=_0x5cb83a?0x0:_0x3478b3[_0x0e8f('0x16')];var _0x2e09b6=_0x5cb83a?_0x27c9b[_0x0e8f('0x19')]:_0x3478b3[_0x0e8f('0x16')]+_0x3478b3[_0x0e8f('0x17')];var _0x1ff3ff;if(_0x2e09b6>=_0x5c5fe4){_0x2e09b6=_0x5c5fe4;_0x1ff3ff=0xc8;}else{_0x1ff3ff=0xce;}_0x4f27c1[_0x0e8f('0x13')](_0x1ff3ff);return _0x4f27c1['set'](_0x0e8f('0x1a'),_0x43d910+'-'+_0x2e09b6+'/'+_0x5c5fe4)[_0x0e8f('0x15')](_0x27c9b);}return null;};}function patchUpdates(_0x2cd488){return function(_0x1d3e39){try{jsonpatch[_0x0e8f('0x1b')](_0x1d3e39,_0x2cd488,!![]);}catch(_0x137caf){return BPromise[_0x0e8f('0x1c')](_0x137caf);}return _0x1d3e39['save']();};}function saveUpdates(_0x223495,_0x355be6){return function(_0x530eb9){if(_0x530eb9){return _0x530eb9['update'](_0x223495)[_0x0e8f('0x1d')](function(_0x50a525){return _0x50a525;});}return null;};}function removeEntity(_0x5a8e41,_0x6619f9){return function(_0x36b6c5){if(_0x36b6c5){return _0x36b6c5['destroy']()[_0x0e8f('0x1d')](function(){_0x5a8e41[_0x0e8f('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38de31,_0x5ccea0){return function(_0x4c443d){if(!_0x4c443d){_0x38de31['sendStatus'](0x194);}return _0x4c443d;};}function handleError(_0x22d952,_0x421c98){_0x421c98=_0x421c98||0x1f4;return function(_0x57279f){logger[_0x0e8f('0x1e')](_0x57279f[_0x0e8f('0x1f')]);if(_0x57279f[_0x0e8f('0x20')]){delete _0x57279f['name'];}_0x22d952['status'](_0x421c98)['send'](_0x57279f);};}exports['index']=function(_0x8e2778,_0x5488b2){var _0x24d3da={},_0x2d3747={},_0x51eb41={'count':0x0,'rows':[]};var _0xb0886f=_[_0x0e8f('0x21')](db[_0x0e8f('0x22')][_0x0e8f('0x23')],function(_0x4afbce){return{'name':_0x4afbce[_0x0e8f('0x24')],'type':_0x4afbce[_0x0e8f('0x25')]['key']};});_0x2d3747[_0x0e8f('0x26')]=_[_0x0e8f('0x21')](_0xb0886f,'name');_0x2d3747[_0x0e8f('0x27')]=_['keys'](_0x8e2778[_0x0e8f('0x27')]);_0x2d3747['filters']=_['intersection'](_0x2d3747[_0x0e8f('0x26')],_0x2d3747[_0x0e8f('0x27')]);_0x24d3da['attributes']=_[_0x0e8f('0x28')](_0x2d3747[_0x0e8f('0x26')],qs[_0x0e8f('0x29')](_0x8e2778['query']['fields']));_0x24d3da['attributes']=_0x24d3da[_0x0e8f('0x2a')][_0x0e8f('0x2b')]?_0x24d3da[_0x0e8f('0x2a')]:_0x2d3747[_0x0e8f('0x26')];if(!_0x8e2778['query'][_0x0e8f('0x2c')]('nolimit')){_0x24d3da[_0x0e8f('0x17')]=qs['limit'](_0x8e2778[_0x0e8f('0x27')][_0x0e8f('0x17')]);_0x24d3da[_0x0e8f('0x16')]=qs[_0x0e8f('0x16')](_0x8e2778[_0x0e8f('0x27')][_0x0e8f('0x16')]);}_0x24d3da[_0x0e8f('0x2d')]=qs['sort'](_0x8e2778[_0x0e8f('0x27')]['sort']);_0x24d3da[_0x0e8f('0x2e')]=qs[_0x0e8f('0x2f')](_[_0x0e8f('0x30')](_0x8e2778[_0x0e8f('0x27')],_0x2d3747[_0x0e8f('0x2f')]),_0xb0886f);if(_0x8e2778[_0x0e8f('0x27')]['filter']){_0x24d3da[_0x0e8f('0x2e')]=_[_0x0e8f('0x31')](_0x24d3da['where'],{'$or':_['map'](_0xb0886f,function(_0x9d4383){if(_0x9d4383[_0x0e8f('0x25')]!==_0x0e8f('0x32')){var _0x569741={};_0x569741[_0x9d4383[_0x0e8f('0x20')]]={'$like':'%'+_0x8e2778['query'][_0x0e8f('0x33')]+'%'};return _0x569741;}})});}_0x24d3da=_[_0x0e8f('0x31')]({},_0x24d3da,_0x8e2778['options']);var _0x17a129={'where':_0x24d3da[_0x0e8f('0x2e')]};return db['FaxTransferReport']['count'](_0x17a129)['then'](function(_0x10d9c1){_0x51eb41[_0x0e8f('0x19')]=_0x10d9c1;if(_0x8e2778['query'][_0x0e8f('0x34')]){_0x24d3da[_0x0e8f('0x35')]=[{'all':!![]}];}return db[_0x0e8f('0x22')][_0x0e8f('0x36')](_0x24d3da);})[_0x0e8f('0x1d')](function(_0x2d89ca){_0x51eb41[_0x0e8f('0x37')]=_0x2d89ca;return _0x51eb41;})[_0x0e8f('0x1d')](respondWithFilteredResult(_0x5488b2,_0x24d3da))[_0x0e8f('0x38')](handleError(_0x5488b2,null));};exports[_0x0e8f('0x39')]=function(_0x1cd6fd,_0x80f131){var _0x436553={'raw':!![],'where':{'id':_0x1cd6fd[_0x0e8f('0x3a')]['id']}},_0x5cfff3={};_0x5cfff3['model']=_[_0x0e8f('0x3b')](db['FaxTransferReport']['rawAttributes']);_0x5cfff3['query']=_[_0x0e8f('0x3b')](_0x1cd6fd[_0x0e8f('0x27')]);_0x5cfff3['filters']=_['intersection'](_0x5cfff3[_0x0e8f('0x26')],_0x5cfff3['query']);_0x436553['attributes']=_[_0x0e8f('0x28')](_0x5cfff3[_0x0e8f('0x26')],qs[_0x0e8f('0x29')](_0x1cd6fd[_0x0e8f('0x27')]['fields']));_0x436553[_0x0e8f('0x2a')]=_0x436553[_0x0e8f('0x2a')][_0x0e8f('0x2b')]?_0x436553[_0x0e8f('0x2a')]:_0x5cfff3['model'];if(_0x1cd6fd[_0x0e8f('0x27')][_0x0e8f('0x34')]){_0x436553[_0x0e8f('0x35')]=[{'all':!![]}];}_0x436553=_[_0x0e8f('0x31')]({},_0x436553,_0x1cd6fd[_0x0e8f('0x3c')]);return db[_0x0e8f('0x22')][_0x0e8f('0x3d')](_0x436553)['then'](handleEntityNotFound(_0x80f131,null))[_0x0e8f('0x1d')](respondWithResult(_0x80f131,null))[_0x0e8f('0x38')](handleError(_0x80f131,null));};exports[_0x0e8f('0x3e')]=function(_0x29a7a3,_0x102101){return db[_0x0e8f('0x22')]['create'](_0x29a7a3[_0x0e8f('0x3f')],{})['then'](respondWithResult(_0x102101,0xc9))[_0x0e8f('0x38')](handleError(_0x102101,null));};exports[_0x0e8f('0x40')]=function(_0x40fe61,_0xd53a00){if(_0x40fe61['body']['id']){delete _0x40fe61[_0x0e8f('0x3f')]['id'];}return db[_0x0e8f('0x22')][_0x0e8f('0x3d')]({'where':{'id':_0x40fe61[_0x0e8f('0x3a')]['id']}})[_0x0e8f('0x1d')](handleEntityNotFound(_0xd53a00,null))[_0x0e8f('0x1d')](saveUpdates(_0x40fe61[_0x0e8f('0x3f')],null))[_0x0e8f('0x1d')](respondWithResult(_0xd53a00,null))['catch'](handleError(_0xd53a00,null));};exports['destroy']=function(_0x28349c,_0x1e6fb6){return db[_0x0e8f('0x22')][_0x0e8f('0x3d')]({'where':{'id':_0x28349c['params']['id']}})[_0x0e8f('0x1d')](handleEntityNotFound(_0x1e6fb6,null))[_0x0e8f('0x1d')](removeEntity(_0x1e6fb6,null))[_0x0e8f('0x38')](handleError(_0x1e6fb6,null));};exports[_0x0e8f('0x41')]=function(_0x346baf,_0x4d6fab){return db[_0x0e8f('0x22')]['describe']()[_0x0e8f('0x1d')](respondWithResult(_0x4d6fab,null))[_0x0e8f('0x38')](handleError(_0x4d6fab,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index ebc1523..1b5148a 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 _0x9106=['lodash','util','../../config/logger','api','bluebird','request-promise','path','define','report_fax_transfer','uniqueid'];(function(_0x486f21,_0x4d5dad){var _0x266da6=function(_0x1fc651){while(--_0x1fc651){_0x486f21['push'](_0x486f21['shift']());}};_0x266da6(++_0x4d5dad);}(_0x9106,0x6e));var _0x6910=function(_0x515da8,_0x3b69d2){_0x515da8=_0x515da8-0x0;var _0x10da36=_0x9106[_0x515da8];return _0x10da36;};'use strict';var _=require(_0x6910('0x0'));var util=require(_0x6910('0x1'));var logger=require(_0x6910('0x2'))(_0x6910('0x3'));var moment=require('moment');var BPromise=require(_0x6910('0x4'));var rp=require(_0x6910('0x5'));var fs=require('fs');var path=require(_0x6910('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x28b7a9,_0x582073){return _0x28b7a9[_0x6910('0x7')]('FaxTransferReport',attributes,{'tableName':_0x6910('0x8'),'paranoid':![],'indexes':[{'name':_0x6910('0x9'),'fields':[_0x6910('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x76e0=['path','../../config/environment','./faxTransferReport.attributes','exports','report_fax_transfer','uniqueid','moment','request-promise'];(function(_0x1e8ac6,_0x121f2f){var _0x2f96c7=function(_0x44363e){while(--_0x44363e){_0x1e8ac6['push'](_0x1e8ac6['shift']());}};_0x2f96c7(++_0x121f2f);}(_0x76e0,0x6e));var _0x076e=function(_0x1b2221,_0x2ccd50){_0x1b2221=_0x1b2221-0x0;var _0x54c723=_0x76e0[_0x1b2221];return _0x54c723;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x076e('0x0'));var BPromise=require('bluebird');var rp=require(_0x076e('0x1'));var fs=require('fs');var path=require(_0x076e('0x2'));var rimraf=require('rimraf');var config=require(_0x076e('0x3'));var attributes=require(_0x076e('0x4'));module[_0x076e('0x5')]=function(_0x617416,_0x70551c){return _0x617416['define']('FaxTransferReport',attributes,{'tableName':_0x076e('0x6'),'paranoid':![],'indexes':[{'name':_0x076e('0x7'),'fields':[_0x076e('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index c2ae64e..9ab7de5 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 _0xce76=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x101a71,_0x5bd9ba){var _0x35f4cb=function(_0x416359){while(--_0x416359){_0x101a71['push'](_0x101a71['shift']());}};_0x35f4cb(++_0x5bd9ba);}(_0xce76,0x128));var _0x6ce7=function(_0x507abd,_0x45c48c){_0x507abd=_0x507abd-0x0;var _0x31663a=_0xce76[_0x507abd];return _0x31663a;};'use strict';var _=require(_0x6ce7('0x0'));var util=require('util');var moment=require(_0x6ce7('0x1'));var BPromise=require(_0x6ce7('0x2'));var rs=require(_0x6ce7('0x3'));var fs=require('fs');var Redis=require(_0x6ce7('0x4'));var db=require(_0x6ce7('0x5'))['db'];var utils=require(_0x6ce7('0x6'));var logger=require(_0x6ce7('0x7'))(_0x6ce7('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6ce7('0x9')][_0x6ce7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b633f,_0x39c3b3,_0x2d9a33){return new BPromise(function(_0x57f9f7,_0x4fe1a8){return client['request'](_0x3b633f,_0x2d9a33)[_0x6ce7('0xb')](function(_0x5736c7){logger[_0x6ce7('0xc')](_0x6ce7('0xd'),_0x39c3b3,_0x6ce7('0xe'));logger['debug'](_0x6ce7('0xf'),_0x39c3b3,_0x6ce7('0xe'),JSON['stringify'](_0x5736c7));if(_0x5736c7[_0x6ce7('0x10')]){if(_0x5736c7[_0x6ce7('0x10')]['code']===0x1f4){logger[_0x6ce7('0x10')](_0x6ce7('0xd'),_0x39c3b3,_0x5736c7[_0x6ce7('0x10')][_0x6ce7('0x11')]);return _0x4fe1a8(_0x5736c7[_0x6ce7('0x10')][_0x6ce7('0x11')]);}logger[_0x6ce7('0x10')](_0x6ce7('0xd'),_0x39c3b3,_0x5736c7['error'][_0x6ce7('0x11')]);return _0x57f9f7(_0x5736c7[_0x6ce7('0x10')]['message']);}else{logger[_0x6ce7('0xc')](_0x6ce7('0xd'),_0x39c3b3,_0x6ce7('0xe'));_0x57f9f7(_0x5736c7[_0x6ce7('0x12')][_0x6ce7('0x11')]);}})[_0x6ce7('0x13')](function(_0x27b725){logger['error'](_0x6ce7('0xd'),_0x39c3b3,_0x27b725);_0x4fe1a8(_0x27b725);});});} \ No newline at end of file +var _0xa8cd=['code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x21e6bf,_0x5af80c){var _0x5ac6ed=function(_0x10da02){while(--_0x10da02){_0x21e6bf['push'](_0x21e6bf['shift']());}};_0x5ac6ed(++_0x5af80c);}(_0xa8cd,0x140));var _0xda8c=function(_0x51b0dc,_0x5307b7){_0x51b0dc=_0x51b0dc-0x0;var _0x13fa89=_0xa8cd[_0x51b0dc];return _0x13fa89;};'use strict';var _=require(_0xda8c('0x0'));var util=require(_0xda8c('0x1'));var moment=require(_0xda8c('0x2'));var BPromise=require(_0xda8c('0x3'));var rs=require(_0xda8c('0x4'));var fs=require('fs');var Redis=require(_0xda8c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xda8c('0x6'));var logger=require(_0xda8c('0x7'))('rpc');var config=require(_0xda8c('0x8'));var jayson=require(_0xda8c('0x9'));var client=jayson['client'][_0xda8c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8116b0,_0x343bb4,_0x56c34d){return new BPromise(function(_0xbac66c,_0x2840ba){return client[_0xda8c('0xb')](_0x8116b0,_0x56c34d)['then'](function(_0x3aaf93){logger['info'](_0xda8c('0xc'),_0x343bb4,_0xda8c('0xd'));logger['debug'](_0xda8c('0xe'),_0x343bb4,_0xda8c('0xd'),JSON['stringify'](_0x3aaf93));if(_0x3aaf93['error']){if(_0x3aaf93[_0xda8c('0xf')][_0xda8c('0x10')]===0x1f4){logger[_0xda8c('0xf')](_0xda8c('0xc'),_0x343bb4,_0x3aaf93[_0xda8c('0xf')]['message']);return _0x2840ba(_0x3aaf93[_0xda8c('0xf')][_0xda8c('0x11')]);}logger[_0xda8c('0xf')](_0xda8c('0xc'),_0x343bb4,_0x3aaf93[_0xda8c('0xf')][_0xda8c('0x11')]);return _0xbac66c(_0x3aaf93['error'][_0xda8c('0x11')]);}else{logger[_0xda8c('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x343bb4,_0xda8c('0xd'));_0xbac66c(_0x3aaf93[_0xda8c('0x13')][_0xda8c('0x11')]);}})[_0xda8c('0x14')](function(_0x12686d){logger[_0xda8c('0xf')](_0xda8c('0xc'),_0x343bb4,_0x12686d);_0x2840ba(_0x12686d);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index c789094..e115abe 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 _0x5545=['../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x560953,_0x59e548){var _0x52c747=function(_0x574373){while(--_0x574373){_0x560953['push'](_0x560953['shift']());}};_0x52c747(++_0x59e548);}(_0x5545,0x151));var _0x5554=function(_0x1b2d88,_0x4712c5){_0x1b2d88=_0x1b2d88-0x0;var _0x4f1754=_0x5545[_0x1b2d88];return _0x4f1754;};'use strict';var multer=require(_0x5554('0x0'));var util=require(_0x5554('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5554('0x2')]();var fs_extra=require(_0x5554('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5554('0x4'));var config=require(_0x5554('0x5'));var controller=require(_0x5554('0x6'));router[_0x5554('0x7')]('/',auth[_0x5554('0x8')](),controller[_0x5554('0x9')]);router[_0x5554('0x7')](_0x5554('0xa'),auth[_0x5554('0x8')](),controller[_0x5554('0xb')]);router[_0x5554('0x7')](_0x5554('0xc'),auth[_0x5554('0x8')](),controller[_0x5554('0xd')]);router['post']('/',auth[_0x5554('0x8')](),controller[_0x5554('0xe')]);router['put'](_0x5554('0xc'),auth[_0x5554('0x8')](),controller[_0x5554('0xf')]);router[_0x5554('0x10')](_0x5554('0xc'),auth[_0x5554('0x8')](),controller[_0x5554('0x11')]);module[_0x5554('0x12')]=router; \ No newline at end of file +var _0xb722=['update','delete','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x244055,_0x3bf2c0){var _0x31cd46=function(_0xaebf68){while(--_0xaebf68){_0x244055['push'](_0x244055['shift']());}};_0x31cd46(++_0x3bf2c0);}(_0xb722,0x129));var _0x2b72=function(_0x841743,_0x3c81df){_0x841743=_0x841743-0x0;var _0x5a1384=_0xb722[_0x841743];return _0x5a1384;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2b72('0x0'));var timeout=require(_0x2b72('0x1'));var express=require(_0x2b72('0x2'));var router=express['Router']();var fs_extra=require(_0x2b72('0x3'));var auth=require(_0x2b72('0x4'));var interaction=require(_0x2b72('0x5'));var config=require(_0x2b72('0x6'));var controller=require(_0x2b72('0x7'));router[_0x2b72('0x8')]('/',auth[_0x2b72('0x9')](),controller[_0x2b72('0xa')]);router[_0x2b72('0x8')](_0x2b72('0xb'),auth[_0x2b72('0x9')](),controller[_0x2b72('0xc')]);router['get'](_0x2b72('0xd'),auth[_0x2b72('0x9')](),controller[_0x2b72('0xe')]);router[_0x2b72('0xf')]('/',auth['isAuthenticated'](),controller[_0x2b72('0x10')]);router[_0x2b72('0x11')](_0x2b72('0xd'),auth[_0x2b72('0x9')](),controller[_0x2b72('0x12')]);router[_0x2b72('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x2b72('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 5a0adc1..e00a6c2 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 _0xe367=['create','post','addConfiguration','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x27d7e0,_0x420e5d){var _0x57939b=function(_0x12658d){while(--_0x12658d){_0x27d7e0['push'](_0x27d7e0['shift']());}};_0x57939b(++_0x420e5d);}(_0xe367,0x10f));var _0x7e36=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xe367[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x7e36('0x0'));var util=require(_0x7e36('0x1'));var path=require(_0x7e36('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7e36('0x3')]();var fs_extra=require(_0x7e36('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7e36('0x5'));var config=require(_0x7e36('0x6'));var controller=require(_0x7e36('0x7'));router['get']('/',auth[_0x7e36('0x8')](),controller[_0x7e36('0x9')]);router[_0x7e36('0xa')](_0x7e36('0xb'),auth[_0x7e36('0x8')](),controller[_0x7e36('0xc')]);router[_0x7e36('0xa')](_0x7e36('0xd'),auth[_0x7e36('0x8')](),controller[_0x7e36('0xe')]);router[_0x7e36('0xa')](_0x7e36('0xf'),auth[_0x7e36('0x8')](),controller[_0x7e36('0x10')]);router['post']('/',auth[_0x7e36('0x8')](),controller[_0x7e36('0x11')]);router[_0x7e36('0x12')](_0x7e36('0xd'),auth['isAuthenticated'](),controller[_0x7e36('0x13')]);router['put'](_0x7e36('0xb'),auth[_0x7e36('0x8')](),controller[_0x7e36('0x14')]);router[_0x7e36('0x15')]('/:id',auth[_0x7e36('0x8')](),controller[_0x7e36('0x16')]);module[_0x7e36('0x17')]=router; \ No newline at end of file +var _0x775d=['post','create','/:id/configurations','addConfiguration','update','delete','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','getConfigurations','/:id/fields','getFields'];(function(_0x343b4b,_0x42f443){var _0xe26b35=function(_0x5b8229){while(--_0x5b8229){_0x343b4b['push'](_0x343b4b['shift']());}};_0xe26b35(++_0x42f443);}(_0x775d,0xce));var _0xd775=function(_0x5016a9,_0x2bf9b4){_0x5016a9=_0x5016a9-0x0;var _0x1f1941=_0x775d[_0x5016a9];return _0x1f1941;};'use strict';var multer=require(_0xd775('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd775('0x1'));var express=require(_0xd775('0x2'));var router=express[_0xd775('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd775('0x4'));var config=require(_0xd775('0x5'));var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0xd775('0x6')](),controller[_0xd775('0x7')]);router[_0xd775('0x8')](_0xd775('0x9'),auth[_0xd775('0x6')](),controller[_0xd775('0xa')]);router['get']('/:id/configurations',auth[_0xd775('0x6')](),controller[_0xd775('0xb')]);router[_0xd775('0x8')](_0xd775('0xc'),auth[_0xd775('0x6')](),controller[_0xd775('0xd')]);router[_0xd775('0xe')]('/',auth[_0xd775('0x6')](),controller[_0xd775('0xf')]);router[_0xd775('0xe')](_0xd775('0x10'),auth[_0xd775('0x6')](),controller[_0xd775('0x11')]);router['put'](_0xd775('0x9'),auth[_0xd775('0x6')](),controller[_0xd775('0x12')]);router[_0xd775('0x13')](_0xd775('0x9'),auth[_0xd775('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index a7837c0..5274b62 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 _0x6e69=['STRING','ENUM','basic','newTab','integrationTab','sequelize','exports'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x6e69,0x6e));var _0x96e6=function(_0x471c71,_0x403c2f){_0x471c71=_0x471c71-0x0;var _0xdc3230=_0x6e69[_0x471c71];return _0xdc3230;};'use strict';var Sequelize=require(_0x96e6('0x0'));module[_0x96e6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x96e6('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x96e6('0x2')]},'authType':{'type':Sequelize[_0x96e6('0x3')](_0x96e6('0x4')),'defaultValue':_0x96e6('0x4')},'password':{'type':Sequelize[_0x96e6('0x2')]},'consumerKey':{'type':Sequelize[_0x96e6('0x2')]},'consumerSecret':{'type':Sequelize[_0x96e6('0x2')]},'token':{'type':Sequelize[_0x96e6('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x96e6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x96e6('0x3')]('integrationTab',_0x96e6('0x5')),'defaultValue':_0x96e6('0x6')}}; \ No newline at end of file +var _0xd134=['newTab','sequelize','exports','STRING','ENUM','basic','integrationTab'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0xd134,0x15f));var _0x4d13=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xd134[_0x476bf4];return _0x788ffe;};'use strict';var Sequelize=require(_0x4d13('0x0'));module[_0x4d13('0x1')]={'name':{'type':Sequelize[_0x4d13('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4d13('0x2')]},'remoteUri':{'type':Sequelize[_0x4d13('0x2')]},'authType':{'type':Sequelize[_0x4d13('0x3')]('basic'),'defaultValue':_0x4d13('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x4d13('0x2')]},'consumerSecret':{'type':Sequelize[_0x4d13('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x4d13('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4d13('0x3')](_0x4d13('0x5'),_0x4d13('0x6')),'defaultValue':_0x4d13('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 1293a40..87e4b30 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 _0x4905=['destroy','sendStatus','error','stack','name','send','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','options','DeskAccount','includeAll','include','rows','catch','show','params','create','body','find','getConfigurations','rawAttributes','filter','hasOwnProperty','findOne','AccountId','Subjects','Descriptions','getDescriptions','DeskConfiguration','DeskField','getFields','priority','remoteUri','username','password','consumerKey','consumerSecret','token','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','authType','basic','headers','Basic\x20%s','%s:%s','toString','concat','_embedded','entries','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then'];(function(_0x84293f,_0x1b4173){var _0x15a611=function(_0x32f46b){while(--_0x32f46b){_0x84293f['push'](_0x84293f['shift']());}};_0x15a611(++_0x1b4173);}(_0x4905,0x135));var _0x5490=function(_0x53bcc3,_0x364374){_0x53bcc3=_0x53bcc3-0x0;var _0x47c959=_0x4905[_0x53bcc3];return _0x47c959;};'use strict';var emlformat=require(_0x5490('0x0'));var rimraf=require(_0x5490('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5490('0x2'));var moment=require(_0x5490('0x3'));var BPromise=require(_0x5490('0x4'));var Mustache=require(_0x5490('0x5'));var util=require(_0x5490('0x6'));var path=require(_0x5490('0x7'));var sox=require(_0x5490('0x8'));var csv=require('to-csv');var ejs=require(_0x5490('0x9'));var fs=require('fs');var fs_extra=require(_0x5490('0xa'));var _=require(_0x5490('0xb'));var squel=require(_0x5490('0xc'));var crypto=require(_0x5490('0xd'));var jsforce=require(_0x5490('0xe'));var deskjs=require(_0x5490('0xf'));var toCsv=require(_0x5490('0x10'));var querystring=require(_0x5490('0x11'));var Papa=require(_0x5490('0x12'));var Redis=require(_0x5490('0x13'));var authService=require(_0x5490('0x14'));var qs=require(_0x5490('0x15'));var as=require(_0x5490('0x16'));var hardwareService=require(_0x5490('0x17'));var logger=require(_0x5490('0x18'))(_0x5490('0x19'));var utils=require(_0x5490('0x1a'));var config=require(_0x5490('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x5490('0x1c'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3a6aa2,_0x7320d7){_0x7320d7=_0x7320d7||0xcc;return function(_0x5218d8){if(_0x5218d8){return _0x3a6aa2['sendStatus'](_0x7320d7);}return _0x3a6aa2['status'](_0x7320d7)[_0x5490('0x1d')]();};}function respondWithResult(_0x17d105,_0x3bf4f6){_0x3bf4f6=_0x3bf4f6||0xc8;return function(_0x3d2c98){if(_0x3d2c98){return _0x17d105[_0x5490('0x1e')](_0x3bf4f6)[_0x5490('0x1f')](_0x3d2c98);}};}function respondWithFilteredResult(_0x3231d9,_0x4d8de5){return function(_0x2b45a7){if(_0x2b45a7){var _0x2d68e0=typeof _0x4d8de5[_0x5490('0x20')]===_0x5490('0x21')&&typeof _0x4d8de5['limit']===_0x5490('0x21');var _0x197cb6=_0x2b45a7[_0x5490('0x22')];var _0x38ea4b=_0x2d68e0?0x0:_0x4d8de5[_0x5490('0x20')];var _0x14475e=_0x2d68e0?_0x2b45a7[_0x5490('0x22')]:_0x4d8de5[_0x5490('0x20')]+_0x4d8de5[_0x5490('0x23')];var _0x4cd467;if(_0x14475e>=_0x197cb6){_0x14475e=_0x197cb6;_0x4cd467=0xc8;}else{_0x4cd467=0xce;}_0x3231d9[_0x5490('0x1e')](_0x4cd467);return _0x3231d9['set'](_0x5490('0x24'),_0x38ea4b+'-'+_0x14475e+'/'+_0x197cb6)[_0x5490('0x1f')](_0x2b45a7);}return null;};}function patchUpdates(_0x597769){return function(_0x425aa3){try{jsonpatch[_0x5490('0x25')](_0x425aa3,_0x597769,!![]);}catch(_0x49ba84){return BPromise[_0x5490('0x26')](_0x49ba84);}return _0x425aa3[_0x5490('0x27')]();};}function saveUpdates(_0xa57330,_0x522519){return function(_0x12e7df){if(_0x12e7df){return _0x12e7df[_0x5490('0x28')](_0xa57330)[_0x5490('0x29')](function(_0x138096){return _0x138096;});}return null;};}function removeEntity(_0x2f5401,_0x476131){return function(_0x85b958){if(_0x85b958){return _0x85b958[_0x5490('0x2a')]()[_0x5490('0x29')](function(){_0x2f5401[_0x5490('0x1e')](0xcc)[_0x5490('0x1d')]();});}};}function handleEntityNotFound(_0x54fa30,_0x111698){return function(_0x354323){if(!_0x354323){_0x54fa30[_0x5490('0x2b')](0x194);}return _0x354323;};}function handleError(_0x51115d,_0x13de9b){_0x13de9b=_0x13de9b||0x1f4;return function(_0x58ee85){logger[_0x5490('0x2c')](_0x58ee85[_0x5490('0x2d')]);if(_0x58ee85['name']){delete _0x58ee85[_0x5490('0x2e')];}_0x51115d['status'](_0x13de9b)[_0x5490('0x2f')](_0x58ee85);};}exports['index']=function(_0x25d486,_0x3e7325){var _0x814cfc={},_0x404760={},_0x3bdb36={'count':0x0,'rows':[]};var _0xc7104f=_['map'](db['DeskAccount']['rawAttributes'],function(_0x3f1459){return{'name':_0x3f1459[_0x5490('0x30')],'type':_0x3f1459[_0x5490('0x31')][_0x5490('0x32')]};});_0x404760[_0x5490('0x33')]=_[_0x5490('0x34')](_0xc7104f,_0x5490('0x2e'));_0x404760[_0x5490('0x35')]=_[_0x5490('0x36')](_0x25d486[_0x5490('0x35')]);_0x404760[_0x5490('0x37')]=_['intersection'](_0x404760[_0x5490('0x33')],_0x404760[_0x5490('0x35')]);_0x814cfc[_0x5490('0x38')]=_[_0x5490('0x39')](_0x404760[_0x5490('0x33')],qs[_0x5490('0x3a')](_0x25d486[_0x5490('0x35')][_0x5490('0x3a')]));_0x814cfc[_0x5490('0x38')]=_0x814cfc[_0x5490('0x38')][_0x5490('0x3b')]?_0x814cfc[_0x5490('0x38')]:_0x404760[_0x5490('0x33')];if(!_0x25d486[_0x5490('0x35')]['hasOwnProperty'](_0x5490('0x3c'))){_0x814cfc[_0x5490('0x23')]=qs['limit'](_0x25d486['query'][_0x5490('0x23')]);_0x814cfc['offset']=qs[_0x5490('0x20')](_0x25d486['query']['offset']);}_0x814cfc[_0x5490('0x3d')]=qs['sort'](_0x25d486[_0x5490('0x35')][_0x5490('0x3e')]);_0x814cfc['where']=qs[_0x5490('0x37')](_[_0x5490('0x3f')](_0x25d486['query'],_0x404760[_0x5490('0x37')]),_0xc7104f);if(_0x25d486[_0x5490('0x35')]['filter']){_0x814cfc[_0x5490('0x40')]=_[_0x5490('0x41')](_0x814cfc[_0x5490('0x40')],{'$or':_[_0x5490('0x34')](_0xc7104f,function(_0x4df6ee){if(_0x4df6ee[_0x5490('0x31')]!==_0x5490('0x42')){var _0x58176d={};_0x58176d[_0x4df6ee[_0x5490('0x2e')]]={'$like':'%'+_0x25d486[_0x5490('0x35')]['filter']+'%'};return _0x58176d;}})});}_0x814cfc=_[_0x5490('0x41')]({},_0x814cfc,_0x25d486[_0x5490('0x43')]);var _0x101ca5={'where':_0x814cfc[_0x5490('0x40')]};return db[_0x5490('0x44')]['count'](_0x101ca5)[_0x5490('0x29')](function(_0x1eade5){_0x3bdb36[_0x5490('0x22')]=_0x1eade5;if(_0x25d486[_0x5490('0x35')][_0x5490('0x45')]){_0x814cfc[_0x5490('0x46')]=[{'all':!![]}];}return db[_0x5490('0x44')]['findAll'](_0x814cfc);})[_0x5490('0x29')](function(_0x4c7efd){_0x3bdb36[_0x5490('0x47')]=_0x4c7efd;return _0x3bdb36;})[_0x5490('0x29')](respondWithFilteredResult(_0x3e7325,_0x814cfc))[_0x5490('0x48')](handleError(_0x3e7325,null));};exports[_0x5490('0x49')]=function(_0x4b710b,_0x479ee1){var _0x4e0b1b={'raw':![],'where':{'id':_0x4b710b[_0x5490('0x4a')]['id']}},_0x5c55a6={};_0x5c55a6[_0x5490('0x33')]=_[_0x5490('0x36')](db[_0x5490('0x44')]['rawAttributes']);_0x5c55a6[_0x5490('0x35')]=_['keys'](_0x4b710b['query']);_0x5c55a6[_0x5490('0x37')]=_[_0x5490('0x39')](_0x5c55a6[_0x5490('0x33')],_0x5c55a6[_0x5490('0x35')]);_0x4e0b1b[_0x5490('0x38')]=_[_0x5490('0x39')](_0x5c55a6['model'],qs['fields'](_0x4b710b[_0x5490('0x35')][_0x5490('0x3a')]));_0x4e0b1b['attributes']=_0x4e0b1b[_0x5490('0x38')]['length']?_0x4e0b1b[_0x5490('0x38')]:_0x5c55a6['model'];if(_0x4b710b[_0x5490('0x35')]['includeAll']){_0x4e0b1b['include']=[{'all':!![]}];}_0x4e0b1b=_[_0x5490('0x41')]({},_0x4e0b1b,_0x4b710b[_0x5490('0x43')]);return db['DeskAccount']['find'](_0x4e0b1b)[_0x5490('0x29')](handleEntityNotFound(_0x479ee1,null))[_0x5490('0x29')](respondWithResult(_0x479ee1,null))['catch'](handleError(_0x479ee1,null));};exports['create']=function(_0x2105a1,_0x5415fb){return db[_0x5490('0x44')][_0x5490('0x4b')](_0x2105a1[_0x5490('0x4c')],{})[_0x5490('0x29')](respondWithResult(_0x5415fb,0xc9))[_0x5490('0x48')](handleError(_0x5415fb,null));};exports['update']=function(_0x34129f,_0x402f9d){if(_0x34129f[_0x5490('0x4c')]['id']){delete _0x34129f['body']['id'];}return db[_0x5490('0x44')][_0x5490('0x4d')]({'where':{'id':_0x34129f['params']['id']}})['then'](handleEntityNotFound(_0x402f9d,null))['then'](saveUpdates(_0x34129f['body'],null))[_0x5490('0x29')](respondWithResult(_0x402f9d,null))[_0x5490('0x48')](handleError(_0x402f9d,null));};exports[_0x5490('0x2a')]=function(_0x58e9f9,_0x393fc0){return db[_0x5490('0x44')][_0x5490('0x4d')]({'where':{'id':_0x58e9f9[_0x5490('0x4a')]['id']}})['then'](handleEntityNotFound(_0x393fc0,null))[_0x5490('0x29')](removeEntity(_0x393fc0,null))[_0x5490('0x48')](handleError(_0x393fc0,null));};exports[_0x5490('0x4e')]=function(_0x57313a,_0x2144b7,_0x4f28cb){var _0x160191={};var _0x218444={};var _0x4cf224;var _0x326b11;return db['DeskAccount']['findOne']({'where':{'id':_0x57313a[_0x5490('0x4a')]['id']}})[_0x5490('0x29')](handleEntityNotFound(_0x2144b7,null))[_0x5490('0x29')](function(_0x6d3eb8){if(_0x6d3eb8){_0x4cf224=_0x6d3eb8;_0x218444[_0x5490('0x33')]=_[_0x5490('0x36')](db['DeskConfiguration'][_0x5490('0x4f')]);_0x218444['query']=_[_0x5490('0x36')](_0x57313a[_0x5490('0x35')]);_0x218444['filters']=_['intersection'](_0x218444[_0x5490('0x33')],_0x218444['query']);_0x160191['attributes']=_[_0x5490('0x39')](_0x218444['model'],qs[_0x5490('0x3a')](_0x57313a['query'][_0x5490('0x3a')]));_0x160191[_0x5490('0x38')]=_0x160191['attributes'][_0x5490('0x3b')]?_0x160191['attributes']:_0x218444['model'];_0x160191['order']=qs[_0x5490('0x3e')](_0x57313a[_0x5490('0x35')][_0x5490('0x3e')]);_0x160191[_0x5490('0x40')]=qs[_0x5490('0x37')](_[_0x5490('0x3f')](_0x57313a[_0x5490('0x35')],_0x218444['filters']));if(_0x57313a[_0x5490('0x35')]['filter']){_0x160191[_0x5490('0x40')]=_[_0x5490('0x41')](_0x160191[_0x5490('0x40')],{'$or':_[_0x5490('0x34')](_0x160191[_0x5490('0x38')],function(_0x662555){var _0x11e1c1={};_0x11e1c1[_0x662555]={'$like':'%'+_0x57313a[_0x5490('0x35')][_0x5490('0x50')]+'%'};return _0x11e1c1;})});}_0x160191=_['merge']({},_0x160191,_0x57313a[_0x5490('0x43')]);return _0x4cf224['getConfigurations'](_0x160191);}})[_0x5490('0x29')](function(_0x2dcc79){if(_0x2dcc79){_0x326b11=_0x2dcc79[_0x5490('0x3b')];if(!_0x57313a[_0x5490('0x35')][_0x5490('0x51')](_0x5490('0x3c'))){_0x160191['limit']=qs[_0x5490('0x23')](_0x57313a[_0x5490('0x35')]['limit']);_0x160191[_0x5490('0x20')]=qs[_0x5490('0x20')](_0x57313a['query']['offset']);}return _0x4cf224['getConfigurations'](_0x160191);}})[_0x5490('0x29')](function(_0x53140b){if(_0x53140b){return _0x53140b?{'count':_0x326b11,'rows':_0x53140b}:null;}})[_0x5490('0x29')](respondWithResult(_0x2144b7,null))[_0x5490('0x48')](handleError(_0x2144b7,null));};exports['addConfiguration']=function(_0x5246fc,_0x390b31,_0x54caa2){if(_0x5246fc[_0x5490('0x4c')]['id']){delete _0x5246fc[_0x5490('0x4c')]['id'];}return db[_0x5490('0x44')][_0x5490('0x52')]({'where':{'id':_0x5246fc[_0x5490('0x4a')]['id']}})[_0x5490('0x29')](handleEntityNotFound(_0x390b31,null))[_0x5490('0x29')](function(_0x26089b){if(_0x26089b){_0x5246fc[_0x5490('0x4c')][_0x5490('0x53')]=_0x26089b['id'];_0x5246fc[_0x5490('0x4c')][_0x5490('0x54')]=integrations['getSubjects'](_0x5246fc[_0x5490('0x4c')]['channel'],_0x5246fc[_0x5490('0x4c')][_0x5490('0x31')]);_0x5246fc[_0x5490('0x4c')][_0x5490('0x55')]=integrations[_0x5490('0x56')](_0x5246fc[_0x5490('0x4c')]['channel'],_0x5246fc[_0x5490('0x4c')][_0x5490('0x31')]);return db[_0x5490('0x57')][_0x5490('0x4b')](_0x5246fc[_0x5490('0x4c')],{'include':[{'model':db[_0x5490('0x58')],'as':_0x5490('0x54')},{'model':db[_0x5490('0x58')],'as':_0x5490('0x55')}]});}return null;})[_0x5490('0x29')](respondWithResult(_0x390b31,null))[_0x5490('0x48')](handleError(_0x390b31,null));};exports[_0x5490('0x59')]=function(_0x9d38dd,_0x517c59,_0x5569ce){var _0xe2898e=[{'name':_0x5490('0x5a'),'label':_0x5490('0x5a'),'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 _0x505e9b='';return db[_0x5490('0x44')][_0x5490('0x52')]({'where':{'id':_0x9d38dd[_0x5490('0x4a')]['id']},'attributes':['id',_0x5490('0x5b'),'authType',_0x5490('0x5c'),_0x5490('0x5d'),_0x5490('0x5e'),_0x5490('0x5f'),_0x5490('0x60'),'tokenSecret']})['then'](handleEntityNotFound(_0x517c59,null))[_0x5490('0x29')](function(_0x56a2f5){if(_0x56a2f5){_0x505e9b=_0x56a2f5[_0x5490('0x5b')];var _0x18728f=_0x505e9b[_0x5490('0x61')](-0x1);if(_0x18728f==='/'){_0x505e9b=_0x505e9b['substring'](0x0,_0x505e9b[_0x5490('0x62')](_0x18728f));}var _0x19cff5={'method':_0x5490('0x63'),'uri':util[_0x5490('0x64')](_0x5490('0x65'),_0x505e9b),'headers':{'Content-Type':_0x5490('0x66'),'Accept':_0x5490('0x66')},'json':!![]};if(_0x56a2f5[_0x5490('0x67')]===_0x5490('0x68')){_0x19cff5[_0x5490('0x69')]['Authorization']=util[_0x5490('0x64')](_0x5490('0x6a'),new Buffer(util[_0x5490('0x64')](_0x5490('0x6b'),_0x56a2f5[_0x5490('0x5c')],_0x56a2f5[_0x5490('0x5d')]))[_0x5490('0x6c')]('base64'));}return rp(_0x19cff5)[_0x5490('0x29')](function(_0x13378b){return _0xe2898e[_0x5490('0x6d')](_['map'](_0x13378b[_0x5490('0x6e')][_0x5490('0x6f')],function(_0x14c0b6){return{'id':_0x14c0b6[_0x5490('0x2e')],'name':_0x14c0b6['name'],'type':_0x14c0b6[_0x5490('0x31')],'active':_0x14c0b6[_0x5490('0x70')],'label':_0x14c0b6['label'],'custom':!![]};}));});}})['then'](function(_0x44217e){return{'count':_0x44217e[_0x5490('0x3b')],'rows':_0x44217e};})[_0x5490('0x29')](respondWithResult(_0x517c59,null))[_0x5490('0x48')](function(_0x365286){var _0x46f303=_0x9d38dd[_0x5490('0x35')][_0x5490('0x71')]?0x1f4:_0x365286[_0x5490('0x72')]||0x1f4;logger[_0x5490('0x2c')](_0x5490('0x73'),'getFields',_0x46f303,JSON['stringify'](_0x365286));delete _0x365286[_0x5490('0x2e')];if(_0x46f303===0x191){_0x46f303=0x190;}_0x517c59[_0x5490('0x1e')](_0x46f303)['send'](_0x9d38dd[_0x5490('0x35')]['test']?{'message':_0x5490('0x74'),'statusCode':_0x365286[_0x5490('0x72')]}:_0x365286);});}; \ No newline at end of file +var _0xaad0=['AccountId','Subjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','GET','format','application/json','basic','Authorization','Basic\x20%s','toString','base64','concat','_embedded','entries','active','label','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','DeskAccount','findAll','rows','show','params','options','create','body','catch','find','DeskConfiguration','rawAttributes','nolimit','getConfigurations','addConfiguration','findOne'];(function(_0x49dc8,_0x331325){var _0x1be465=function(_0xa39f6){while(--_0xa39f6){_0x49dc8['push'](_0x49dc8['shift']());}};_0x1be465(++_0x331325);}(_0xaad0,0xff));var _0x0aad=function(_0x415332,_0x1663c8){_0x415332=_0x415332-0x0;var _0x39c980=_0xaad0[_0x415332];return _0x39c980;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0aad('0x0'));var jsonpatch=require(_0x0aad('0x1'));var rp=require(_0x0aad('0x2'));var moment=require(_0x0aad('0x3'));var BPromise=require(_0x0aad('0x4'));var Mustache=require(_0x0aad('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0aad('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0aad('0x7'));var toCsv=require(_0x0aad('0x6'));var querystring=require(_0x0aad('0x8'));var Papa=require(_0x0aad('0x9'));var Redis=require('ioredis');var authService=require(_0x0aad('0xa'));var qs=require(_0x0aad('0xb'));var as=require(_0x0aad('0xc'));var hardwareService=require(_0x0aad('0xd'));var logger=require(_0x0aad('0xe'))(_0x0aad('0xf'));var utils=require(_0x0aad('0x10'));var config=require(_0x0aad('0x11'));var licenseUtil=require(_0x0aad('0x12'));var db=require(_0x0aad('0x13'))['db'];var integrations=require(_0x0aad('0x14'));function respondWithStatusCode(_0x17b7f3,_0x35aa22){_0x35aa22=_0x35aa22||0xcc;return function(_0x172a1b){if(_0x172a1b){return _0x17b7f3[_0x0aad('0x15')](_0x35aa22);}return _0x17b7f3[_0x0aad('0x16')](_0x35aa22)['end']();};}function respondWithResult(_0x45105a,_0x1e9d9b){_0x1e9d9b=_0x1e9d9b||0xc8;return function(_0x2188cc){if(_0x2188cc){return _0x45105a[_0x0aad('0x16')](_0x1e9d9b)[_0x0aad('0x17')](_0x2188cc);}};}function respondWithFilteredResult(_0x3d88ef,_0x4d6f5d){return function(_0x168d75){if(_0x168d75){var _0x29ef67=typeof _0x4d6f5d[_0x0aad('0x18')]===_0x0aad('0x19')&&typeof _0x4d6f5d[_0x0aad('0x1a')]===_0x0aad('0x19');var _0x408a84=_0x168d75['count'];var _0x4b93df=_0x29ef67?0x0:_0x4d6f5d[_0x0aad('0x18')];var _0x6d8aae=_0x29ef67?_0x168d75[_0x0aad('0x1b')]:_0x4d6f5d[_0x0aad('0x18')]+_0x4d6f5d['limit'];var _0x18213c;if(_0x6d8aae>=_0x408a84){_0x6d8aae=_0x408a84;_0x18213c=0xc8;}else{_0x18213c=0xce;}_0x3d88ef[_0x0aad('0x16')](_0x18213c);return _0x3d88ef[_0x0aad('0x1c')](_0x0aad('0x1d'),_0x4b93df+'-'+_0x6d8aae+'/'+_0x408a84)[_0x0aad('0x17')](_0x168d75);}return null;};}function patchUpdates(_0x126f72){return function(_0x2dfd27){try{jsonpatch[_0x0aad('0x1e')](_0x2dfd27,_0x126f72,!![]);}catch(_0x30eb11){return BPromise[_0x0aad('0x1f')](_0x30eb11);}return _0x2dfd27[_0x0aad('0x20')]();};}function saveUpdates(_0x3aff45,_0x4b4d05){return function(_0x4750e5){if(_0x4750e5){return _0x4750e5[_0x0aad('0x21')](_0x3aff45)[_0x0aad('0x22')](function(_0xa16803){return _0xa16803;});}return null;};}function removeEntity(_0x39b8ae,_0x136d07){return function(_0x197502){if(_0x197502){return _0x197502[_0x0aad('0x23')]()[_0x0aad('0x22')](function(){_0x39b8ae['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x39ff07,_0x12ef1b){return function(_0x1bc676){if(!_0x1bc676){_0x39ff07[_0x0aad('0x15')](0x194);}return _0x1bc676;};}function handleError(_0x42f9c6,_0x4824c3){_0x4824c3=_0x4824c3||0x1f4;return function(_0x4b97fc){logger[_0x0aad('0x24')](_0x4b97fc['stack']);if(_0x4b97fc[_0x0aad('0x25')]){delete _0x4b97fc[_0x0aad('0x25')];}_0x42f9c6['status'](_0x4824c3)[_0x0aad('0x26')](_0x4b97fc);};}exports[_0x0aad('0x27')]=function(_0x37d760,_0x2534a4){var _0x16eb46={},_0x2606d0={},_0x23c8a9={'count':0x0,'rows':[]};var _0x52b7b0=_['map'](db['DeskAccount']['rawAttributes'],function(_0x2e0f48){return{'name':_0x2e0f48[_0x0aad('0x28')],'type':_0x2e0f48[_0x0aad('0x29')][_0x0aad('0x2a')]};});_0x2606d0[_0x0aad('0x2b')]=_[_0x0aad('0x2c')](_0x52b7b0,_0x0aad('0x25'));_0x2606d0[_0x0aad('0x2d')]=_[_0x0aad('0x2e')](_0x37d760[_0x0aad('0x2d')]);_0x2606d0[_0x0aad('0x2f')]=_[_0x0aad('0x30')](_0x2606d0[_0x0aad('0x2b')],_0x2606d0['query']);_0x16eb46[_0x0aad('0x31')]=_[_0x0aad('0x30')](_0x2606d0['model'],qs[_0x0aad('0x32')](_0x37d760[_0x0aad('0x2d')][_0x0aad('0x32')]));_0x16eb46[_0x0aad('0x31')]=_0x16eb46[_0x0aad('0x31')][_0x0aad('0x33')]?_0x16eb46[_0x0aad('0x31')]:_0x2606d0['model'];if(!_0x37d760[_0x0aad('0x2d')][_0x0aad('0x34')]('nolimit')){_0x16eb46[_0x0aad('0x1a')]=qs[_0x0aad('0x1a')](_0x37d760[_0x0aad('0x2d')][_0x0aad('0x1a')]);_0x16eb46[_0x0aad('0x18')]=qs['offset'](_0x37d760[_0x0aad('0x2d')]['offset']);}_0x16eb46[_0x0aad('0x35')]=qs[_0x0aad('0x36')](_0x37d760[_0x0aad('0x2d')]['sort']);_0x16eb46['where']=qs['filters'](_[_0x0aad('0x37')](_0x37d760[_0x0aad('0x2d')],_0x2606d0[_0x0aad('0x2f')]),_0x52b7b0);if(_0x37d760[_0x0aad('0x2d')][_0x0aad('0x38')]){_0x16eb46[_0x0aad('0x39')]=_[_0x0aad('0x3a')](_0x16eb46['where'],{'$or':_[_0x0aad('0x2c')](_0x52b7b0,function(_0x13841e){if(_0x13841e['type']!==_0x0aad('0x3b')){var _0x5b2d02={};_0x5b2d02[_0x13841e['name']]={'$like':'%'+_0x37d760[_0x0aad('0x2d')]['filter']+'%'};return _0x5b2d02;}})});}_0x16eb46=_[_0x0aad('0x3a')]({},_0x16eb46,_0x37d760['options']);var _0x387b85={'where':_0x16eb46[_0x0aad('0x39')]};return db['DeskAccount']['count'](_0x387b85)[_0x0aad('0x22')](function(_0x2b1624){_0x23c8a9[_0x0aad('0x1b')]=_0x2b1624;if(_0x37d760[_0x0aad('0x2d')][_0x0aad('0x3c')]){_0x16eb46[_0x0aad('0x3d')]=[{'all':!![]}];}return db[_0x0aad('0x3e')][_0x0aad('0x3f')](_0x16eb46);})[_0x0aad('0x22')](function(_0x528b63){_0x23c8a9[_0x0aad('0x40')]=_0x528b63;return _0x23c8a9;})[_0x0aad('0x22')](respondWithFilteredResult(_0x2534a4,_0x16eb46))['catch'](handleError(_0x2534a4,null));};exports[_0x0aad('0x41')]=function(_0x2b57c0,_0xad5668){var _0x4ad519={'raw':![],'where':{'id':_0x2b57c0[_0x0aad('0x42')]['id']}},_0x399d75={};_0x399d75[_0x0aad('0x2b')]=_[_0x0aad('0x2e')](db[_0x0aad('0x3e')]['rawAttributes']);_0x399d75[_0x0aad('0x2d')]=_[_0x0aad('0x2e')](_0x2b57c0[_0x0aad('0x2d')]);_0x399d75[_0x0aad('0x2f')]=_[_0x0aad('0x30')](_0x399d75[_0x0aad('0x2b')],_0x399d75[_0x0aad('0x2d')]);_0x4ad519['attributes']=_['intersection'](_0x399d75[_0x0aad('0x2b')],qs[_0x0aad('0x32')](_0x2b57c0[_0x0aad('0x2d')][_0x0aad('0x32')]));_0x4ad519['attributes']=_0x4ad519['attributes'][_0x0aad('0x33')]?_0x4ad519[_0x0aad('0x31')]:_0x399d75[_0x0aad('0x2b')];if(_0x2b57c0[_0x0aad('0x2d')][_0x0aad('0x3c')]){_0x4ad519[_0x0aad('0x3d')]=[{'all':!![]}];}_0x4ad519=_[_0x0aad('0x3a')]({},_0x4ad519,_0x2b57c0[_0x0aad('0x43')]);return db[_0x0aad('0x3e')]['find'](_0x4ad519)['then'](handleEntityNotFound(_0xad5668,null))[_0x0aad('0x22')](respondWithResult(_0xad5668,null))['catch'](handleError(_0xad5668,null));};exports[_0x0aad('0x44')]=function(_0x2742c6,_0x5847c5){return db['DeskAccount'][_0x0aad('0x44')](_0x2742c6[_0x0aad('0x45')],{})['then'](respondWithResult(_0x5847c5,0xc9))[_0x0aad('0x46')](handleError(_0x5847c5,null));};exports['update']=function(_0xdebba7,_0x2f71f0){if(_0xdebba7[_0x0aad('0x45')]['id']){delete _0xdebba7['body']['id'];}return db[_0x0aad('0x3e')][_0x0aad('0x47')]({'where':{'id':_0xdebba7[_0x0aad('0x42')]['id']}})[_0x0aad('0x22')](handleEntityNotFound(_0x2f71f0,null))[_0x0aad('0x22')](saveUpdates(_0xdebba7[_0x0aad('0x45')],null))[_0x0aad('0x22')](respondWithResult(_0x2f71f0,null))[_0x0aad('0x46')](handleError(_0x2f71f0,null));};exports[_0x0aad('0x23')]=function(_0xcaf217,_0x176c10){return db[_0x0aad('0x3e')][_0x0aad('0x47')]({'where':{'id':_0xcaf217['params']['id']}})[_0x0aad('0x22')](handleEntityNotFound(_0x176c10,null))[_0x0aad('0x22')](removeEntity(_0x176c10,null))[_0x0aad('0x46')](handleError(_0x176c10,null));};exports['getConfigurations']=function(_0x993694,_0x569432,_0x57a137){var _0xd18c3c={};var _0x4469e1={};var _0x15ad64;var _0x535645;return db[_0x0aad('0x3e')]['findOne']({'where':{'id':_0x993694['params']['id']}})[_0x0aad('0x22')](handleEntityNotFound(_0x569432,null))[_0x0aad('0x22')](function(_0x536453){if(_0x536453){_0x15ad64=_0x536453;_0x4469e1[_0x0aad('0x2b')]=_[_0x0aad('0x2e')](db[_0x0aad('0x48')][_0x0aad('0x49')]);_0x4469e1[_0x0aad('0x2d')]=_[_0x0aad('0x2e')](_0x993694['query']);_0x4469e1[_0x0aad('0x2f')]=_['intersection'](_0x4469e1[_0x0aad('0x2b')],_0x4469e1[_0x0aad('0x2d')]);_0xd18c3c['attributes']=_[_0x0aad('0x30')](_0x4469e1['model'],qs['fields'](_0x993694[_0x0aad('0x2d')]['fields']));_0xd18c3c['attributes']=_0xd18c3c[_0x0aad('0x31')]['length']?_0xd18c3c['attributes']:_0x4469e1[_0x0aad('0x2b')];_0xd18c3c[_0x0aad('0x35')]=qs[_0x0aad('0x36')](_0x993694[_0x0aad('0x2d')][_0x0aad('0x36')]);_0xd18c3c['where']=qs[_0x0aad('0x2f')](_[_0x0aad('0x37')](_0x993694[_0x0aad('0x2d')],_0x4469e1[_0x0aad('0x2f')]));if(_0x993694[_0x0aad('0x2d')][_0x0aad('0x38')]){_0xd18c3c[_0x0aad('0x39')]=_[_0x0aad('0x3a')](_0xd18c3c[_0x0aad('0x39')],{'$or':_['map'](_0xd18c3c['attributes'],function(_0x406dec){var _0x4a7524={};_0x4a7524[_0x406dec]={'$like':'%'+_0x993694[_0x0aad('0x2d')][_0x0aad('0x38')]+'%'};return _0x4a7524;})});}_0xd18c3c=_[_0x0aad('0x3a')]({},_0xd18c3c,_0x993694['options']);return _0x15ad64['getConfigurations'](_0xd18c3c);}})[_0x0aad('0x22')](function(_0x2c45e8){if(_0x2c45e8){_0x535645=_0x2c45e8[_0x0aad('0x33')];if(!_0x993694[_0x0aad('0x2d')][_0x0aad('0x34')](_0x0aad('0x4a'))){_0xd18c3c[_0x0aad('0x1a')]=qs[_0x0aad('0x1a')](_0x993694['query'][_0x0aad('0x1a')]);_0xd18c3c[_0x0aad('0x18')]=qs[_0x0aad('0x18')](_0x993694[_0x0aad('0x2d')][_0x0aad('0x18')]);}return _0x15ad64[_0x0aad('0x4b')](_0xd18c3c);}})[_0x0aad('0x22')](function(_0x149aeb){if(_0x149aeb){return _0x149aeb?{'count':_0x535645,'rows':_0x149aeb}:null;}})[_0x0aad('0x22')](respondWithResult(_0x569432,null))['catch'](handleError(_0x569432,null));};exports[_0x0aad('0x4c')]=function(_0x52b9f4,_0x4bfc2c,_0x22353d){if(_0x52b9f4[_0x0aad('0x45')]['id']){delete _0x52b9f4[_0x0aad('0x45')]['id'];}return db[_0x0aad('0x3e')][_0x0aad('0x4d')]({'where':{'id':_0x52b9f4[_0x0aad('0x42')]['id']}})[_0x0aad('0x22')](handleEntityNotFound(_0x4bfc2c,null))[_0x0aad('0x22')](function(_0x3d72a7){if(_0x3d72a7){_0x52b9f4[_0x0aad('0x45')][_0x0aad('0x4e')]=_0x3d72a7['id'];_0x52b9f4['body'][_0x0aad('0x4f')]=integrations['getSubjects'](_0x52b9f4[_0x0aad('0x45')][_0x0aad('0x50')],_0x52b9f4['body'][_0x0aad('0x29')]);_0x52b9f4[_0x0aad('0x45')][_0x0aad('0x51')]=integrations[_0x0aad('0x52')](_0x52b9f4['body']['channel'],_0x52b9f4[_0x0aad('0x45')][_0x0aad('0x29')]);return db['DeskConfiguration'][_0x0aad('0x44')](_0x52b9f4['body'],{'include':[{'model':db[_0x0aad('0x53')],'as':_0x0aad('0x4f')},{'model':db[_0x0aad('0x53')],'as':_0x0aad('0x51')}]});}return null;})['then'](respondWithResult(_0x4bfc2c,null))[_0x0aad('0x46')](handleError(_0x4bfc2c,null));};exports[_0x0aad('0x54')]=function(_0xeab00b,_0x344035,_0x3cf82b){var _0x2ca1df=[{'name':_0x0aad('0x55'),'label':_0x0aad('0x55'),'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 _0x396523='';return db[_0x0aad('0x3e')][_0x0aad('0x4d')]({'where':{'id':_0xeab00b[_0x0aad('0x42')]['id']},'attributes':['id',_0x0aad('0x56'),_0x0aad('0x57'),_0x0aad('0x58'),_0x0aad('0x59'),_0x0aad('0x5a'),_0x0aad('0x5b'),_0x0aad('0x5c'),_0x0aad('0x5d')]})[_0x0aad('0x22')](handleEntityNotFound(_0x344035,null))[_0x0aad('0x22')](function(_0x34ed0d){if(_0x34ed0d){_0x396523=_0x34ed0d['remoteUri'];var _0x4da3d4=_0x396523[_0x0aad('0x5e')](-0x1);if(_0x4da3d4==='/'){_0x396523=_0x396523['substring'](0x0,_0x396523['lastIndexOf'](_0x4da3d4));}var _0x513781={'method':_0x0aad('0x5f'),'uri':util[_0x0aad('0x60')]('%s/custom_fields',_0x396523),'headers':{'Content-Type':_0x0aad('0x61'),'Accept':'application/json'},'json':!![]};if(_0x34ed0d[_0x0aad('0x57')]===_0x0aad('0x62')){_0x513781['headers'][_0x0aad('0x63')]=util[_0x0aad('0x60')](_0x0aad('0x64'),new Buffer(util[_0x0aad('0x60')]('%s:%s',_0x34ed0d[_0x0aad('0x58')],_0x34ed0d[_0x0aad('0x59')]))[_0x0aad('0x65')](_0x0aad('0x66')));}return rp(_0x513781)['then'](function(_0x16def1){return _0x2ca1df[_0x0aad('0x67')](_[_0x0aad('0x2c')](_0x16def1[_0x0aad('0x68')][_0x0aad('0x69')],function(_0x1fec7c){return{'id':_0x1fec7c[_0x0aad('0x25')],'name':_0x1fec7c[_0x0aad('0x25')],'type':_0x1fec7c[_0x0aad('0x29')],'active':_0x1fec7c[_0x0aad('0x6a')],'label':_0x1fec7c[_0x0aad('0x6b')],'custom':!![]};}));});}})[_0x0aad('0x22')](function(_0x4a5845){return{'count':_0x4a5845[_0x0aad('0x33')],'rows':_0x4a5845};})[_0x0aad('0x22')](respondWithResult(_0x344035,null))[_0x0aad('0x46')](function(_0xf9b6a){var _0x1fcd33=_0xeab00b['query'][_0x0aad('0x6c')]?0x1f4:_0xf9b6a['statusCode']||0x1f4;logger[_0x0aad('0x24')](_0x0aad('0x6d'),_0x0aad('0x54'),_0x1fcd33,JSON['stringify'](_0xf9b6a));delete _0xf9b6a['name'];if(_0x1fcd33===0x191){_0x1fcd33=0x190;}_0x344035[_0x0aad('0x16')](_0x1fcd33)['send'](_0xeab00b[_0x0aad('0x2d')][_0x0aad('0x6c')]?{'message':_0x0aad('0x6e'),'statusCode':_0xf9b6a['statusCode']}:_0xf9b6a);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 44cda1d..59e45fe 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 _0x311d=['moment','bluebird','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','util','../../config/logger','api'];(function(_0x50f5ae,_0x1f4029){var _0x85b7b0=function(_0x754981){while(--_0x754981){_0x50f5ae['push'](_0x50f5ae['shift']());}};_0x85b7b0(++_0x1f4029);}(_0x311d,0x14d));var _0xd311=function(_0x47e384,_0x574f23){_0x47e384=_0x47e384-0x0;var _0x43fe06=_0x311d[_0x47e384];return _0x43fe06;};'use strict';var _=require('lodash');var util=require(_0xd311('0x0'));var logger=require(_0xd311('0x1'))(_0xd311('0x2'));var moment=require(_0xd311('0x3'));var BPromise=require(_0xd311('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd311('0x5'));var config=require(_0xd311('0x6'));var attributes=require(_0xd311('0x7'));var integrations=require(_0xd311('0x8'));module[_0xd311('0x9')]=function(_0x43bb7a,_0x3489a7){return _0x43bb7a[_0xd311('0xa')]('DeskAccount',attributes,{'tableName':_0xd311('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5117=['DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','define'];(function(_0x203a8e,_0x33358b){var _0x5b08a5=function(_0x23d287){while(--_0x23d287){_0x203a8e['push'](_0x203a8e['shift']());}};_0x5b08a5(++_0x33358b);}(_0x5117,0xab));var _0x7511=function(_0x532d78,_0x25b6a8){_0x532d78=_0x532d78-0x0;var _0x5990c4=_0x5117[_0x532d78];return _0x5990c4;};'use strict';var _=require(_0x7511('0x0'));var util=require(_0x7511('0x1'));var logger=require(_0x7511('0x2'))(_0x7511('0x3'));var moment=require('moment');var BPromise=require(_0x7511('0x4'));var rp=require(_0x7511('0x5'));var fs=require('fs');var path=require(_0x7511('0x6'));var rimraf=require(_0x7511('0x7'));var config=require('../../config/environment');var attributes=require(_0x7511('0x8'));var integrations=require(_0x7511('0x9'));module['exports']=function(_0x1c0381,_0x21a634){return _0x1c0381[_0x7511('0xa')](_0x7511('0xb'),attributes,{'tableName':_0x7511('0xc'),'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 4c00efd..f529540 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 _0xa48c=['map','model','ShowDeskAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0x5e8159,_0x2e7e21){var _0x1cbb9b=function(_0x262752){while(--_0x262752){_0x5e8159['push'](_0x5e8159['shift']());}};_0x1cbb9b(++_0x2e7e21);}(_0xa48c,0x151));var _0xca48=function(_0x5b3950,_0x4e5556){_0x5b3950=_0x5b3950-0x0;var _0x41e436=_0xa48c[_0x5b3950];return _0x41e436;};'use strict';var _=require(_0xca48('0x0'));var util=require('util');var moment=require(_0xca48('0x1'));var BPromise=require('bluebird');var rs=require(_0xca48('0x2'));var fs=require('fs');var Redis=require(_0xca48('0x3'));var db=require(_0xca48('0x4'))['db'];var utils=require(_0xca48('0x5'));var logger=require(_0xca48('0x6'))('rpc');var config=require(_0xca48('0x7'));var jayson=require(_0xca48('0x8'));var client=jayson[_0xca48('0x9')][_0xca48('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52e6d7,_0x513978,_0x4474a5){return new BPromise(function(_0x47895c,_0x472f55){return client[_0xca48('0xb')](_0x52e6d7,_0x4474a5)[_0xca48('0xc')](function(_0x3583d2){logger[_0xca48('0xd')]('DeskAccount,\x20%s,\x20%s',_0x513978,'request\x20sent');logger[_0xca48('0xe')](_0xca48('0xf'),_0x513978,_0xca48('0x10'),JSON[_0xca48('0x11')](_0x3583d2));if(_0x3583d2['error']){if(_0x3583d2[_0xca48('0x12')][_0xca48('0x13')]===0x1f4){logger[_0xca48('0x12')](_0xca48('0x14'),_0x513978,_0x3583d2[_0xca48('0x12')][_0xca48('0x15')]);return _0x472f55(_0x3583d2['error'][_0xca48('0x15')]);}logger[_0xca48('0x12')](_0xca48('0x14'),_0x513978,_0x3583d2[_0xca48('0x12')][_0xca48('0x15')]);return _0x47895c(_0x3583d2['error'][_0xca48('0x15')]);}else{logger['info'](_0xca48('0x14'),_0x513978,'request\x20sent');_0x47895c(_0x3583d2[_0xca48('0x16')][_0xca48('0x15')]);}})[_0xca48('0x17')](function(_0x2d5e82){logger[_0xca48('0x12')](_0xca48('0x14'),_0x513978,_0x2d5e82);_0x472f55(_0x2d5e82);});});}exports[_0xca48('0x18')]=function(_0x2e7e20){var _0x369427=this;return new Promise(function(_0x23cc72,_0xdb9619){return db[_0xca48('0x19')][_0xca48('0x1a')]({'raw':_0x2e7e20[_0xca48('0x1b')]?_0x2e7e20[_0xca48('0x1b')][_0xca48('0x1c')]===undefined?!![]:![]:!![],'where':_0x2e7e20[_0xca48('0x1b')]?_0x2e7e20[_0xca48('0x1b')][_0xca48('0x1d')]||null:null,'attributes':_0x2e7e20['options']?_0x2e7e20['options'][_0xca48('0x1e')]||null:null,'limit':_0x2e7e20[_0xca48('0x1b')]?_0x2e7e20[_0xca48('0x1b')][_0xca48('0x1f')]||null:null,'include':_0x2e7e20[_0xca48('0x1b')]?_0x2e7e20[_0xca48('0x1b')][_0xca48('0x20')]?_[_0xca48('0x21')](_0x2e7e20['options']['include'],function(_0x5c2381){return{'model':db[_0x5c2381['model']],'as':_0x5c2381['as'],'attributes':_0x5c2381[_0xca48('0x1e')],'include':_0x5c2381['include']?_[_0xca48('0x21')](_0x5c2381[_0xca48('0x20')],function(_0x497799){return{'model':db[_0x497799['model']],'as':_0x497799['as'],'attributes':_0x497799[_0xca48('0x1e')],'include':_0x497799['include']?_[_0xca48('0x21')](_0x497799[_0xca48('0x20')],function(_0x3c3ee4){return{'model':db[_0x3c3ee4[_0xca48('0x22')]],'as':_0x3c3ee4['as'],'attributes':_0x3c3ee4['attributes']};}):[]};}):[]};}):[]:[]})[_0xca48('0xc')](function(_0x81a5fd){logger[_0xca48('0xd')](_0xca48('0x18'),_0x2e7e20);logger[_0xca48('0xe')](_0xca48('0x18'),_0x2e7e20,JSON[_0xca48('0x11')](_0x81a5fd));_0x23cc72(_0x81a5fd);})[_0xca48('0x17')](function(_0x2c40a5){logger[_0xca48('0x12')]('GetDeskAccount',_0x2c40a5['message'],_0x2e7e20);_0xdb9619(_0x369427['error'](0x1f4,_0x2c40a5[_0xca48('0x15')]));});});};exports[_0xca48('0x23')]=function(_0x1b7161){var _0x195ebc=this;return new Promise(function(_0x4b4779,_0x505f66){return db[_0xca48('0x19')][_0xca48('0x24')]({'raw':_0x1b7161['options']?_0x1b7161[_0xca48('0x1b')][_0xca48('0x1c')]===undefined?!![]:![]:!![],'where':_0x1b7161[_0xca48('0x1b')]?_0x1b7161[_0xca48('0x1b')]['where']||null:null,'attributes':_0x1b7161[_0xca48('0x1b')]?_0x1b7161[_0xca48('0x1b')][_0xca48('0x1e')]||null:null,'include':_0x1b7161['options']?_0x1b7161[_0xca48('0x1b')][_0xca48('0x20')]?_[_0xca48('0x21')](_0x1b7161['options']['include'],function(_0x540e25){return{'model':db[_0x540e25['model']],'as':_0x540e25['as'],'attributes':_0x540e25[_0xca48('0x1e')],'include':_0x540e25[_0xca48('0x20')]?_[_0xca48('0x21')](_0x540e25['include'],function(_0x1f2e39){return{'model':db[_0x1f2e39[_0xca48('0x22')]],'as':_0x1f2e39['as'],'attributes':_0x1f2e39[_0xca48('0x1e')],'include':_0x1f2e39['include']?_['map'](_0x1f2e39[_0xca48('0x20')],function(_0x87e7c1){return{'model':db[_0x87e7c1[_0xca48('0x22')]],'as':_0x87e7c1['as'],'attributes':_0x87e7c1[_0xca48('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5355af){logger[_0xca48('0xd')](_0xca48('0x23'),_0x1b7161);logger[_0xca48('0xe')](_0xca48('0x23'),_0x1b7161,JSON[_0xca48('0x11')](_0x5355af));_0x4b4779(_0x5355af);})['catch'](function(_0x27aecc){logger[_0xca48('0x12')]('ShowDeskAccount',_0x27aecc['message'],_0x1b7161);_0x505f66(_0x195ebc[_0xca48('0x12')](0x1f4,_0x27aecc['message']));});});}; \ No newline at end of file +var _0x5bff=['info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','message','catch','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','map','include','model','stringify','ShowDeskAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2381d1,_0x56f1a9){var _0x2827b6=function(_0x25f20a){while(--_0x25f20a){_0x2381d1['push'](_0x2381d1['shift']());}};_0x2827b6(++_0x56f1a9);}(_0x5bff,0xfa));var _0xf5bf=function(_0x3c4362,_0x292e8d){_0x3c4362=_0x3c4362-0x0;var _0x368439=_0x5bff[_0x3c4362];return _0x368439;};'use strict';var _=require(_0xf5bf('0x0'));var util=require(_0xf5bf('0x1'));var moment=require(_0xf5bf('0x2'));var BPromise=require(_0xf5bf('0x3'));var rs=require(_0xf5bf('0x4'));var fs=require('fs');var Redis=require(_0xf5bf('0x5'));var db=require(_0xf5bf('0x6'))['db'];var utils=require(_0xf5bf('0x7'));var logger=require(_0xf5bf('0x8'))(_0xf5bf('0x9'));var config=require(_0xf5bf('0xa'));var jayson=require(_0xf5bf('0xb'));var client=jayson[_0xf5bf('0xc')][_0xf5bf('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1f86a5,_0xc071dd,_0x41bb8c){return new BPromise(function(_0x2be9f1,_0x1f909d){return client[_0xf5bf('0xe')](_0x1f86a5,_0x41bb8c)[_0xf5bf('0xf')](function(_0xb11de4){logger[_0xf5bf('0x10')](_0xf5bf('0x11'),_0xc071dd,_0xf5bf('0x12'));logger[_0xf5bf('0x13')](_0xf5bf('0x14'),_0xc071dd,_0xf5bf('0x12'),JSON['stringify'](_0xb11de4));if(_0xb11de4['error']){if(_0xb11de4['error']['code']===0x1f4){logger[_0xf5bf('0x15')]('DeskAccount,\x20%s,\x20%s',_0xc071dd,_0xb11de4[_0xf5bf('0x15')][_0xf5bf('0x16')]);return _0x1f909d(_0xb11de4[_0xf5bf('0x15')]['message']);}logger['error']('DeskAccount,\x20%s,\x20%s',_0xc071dd,_0xb11de4[_0xf5bf('0x15')][_0xf5bf('0x16')]);return _0x2be9f1(_0xb11de4[_0xf5bf('0x15')][_0xf5bf('0x16')]);}else{logger['info'](_0xf5bf('0x11'),_0xc071dd,_0xf5bf('0x12'));_0x2be9f1(_0xb11de4['result'][_0xf5bf('0x16')]);}})[_0xf5bf('0x17')](function(_0xc0fafa){logger[_0xf5bf('0x15')](_0xf5bf('0x11'),_0xc071dd,_0xc0fafa);_0x1f909d(_0xc0fafa);});});}exports[_0xf5bf('0x18')]=function(_0x1f9d53){var _0x3ad1a1=this;return new Promise(function(_0x1b23fb,_0x667800){return db[_0xf5bf('0x19')][_0xf5bf('0x1a')]({'raw':_0x1f9d53[_0xf5bf('0x1b')]?_0x1f9d53[_0xf5bf('0x1b')][_0xf5bf('0x1c')]===undefined?!![]:![]:!![],'where':_0x1f9d53[_0xf5bf('0x1b')]?_0x1f9d53[_0xf5bf('0x1b')]['where']||null:null,'attributes':_0x1f9d53[_0xf5bf('0x1b')]?_0x1f9d53[_0xf5bf('0x1b')][_0xf5bf('0x1d')]||null:null,'limit':_0x1f9d53[_0xf5bf('0x1b')]?_0x1f9d53['options'][_0xf5bf('0x1e')]||null:null,'include':_0x1f9d53[_0xf5bf('0x1b')]?_0x1f9d53[_0xf5bf('0x1b')]['include']?_[_0xf5bf('0x1f')](_0x1f9d53[_0xf5bf('0x1b')][_0xf5bf('0x20')],function(_0x258e57){return{'model':db[_0x258e57[_0xf5bf('0x21')]],'as':_0x258e57['as'],'attributes':_0x258e57['attributes'],'include':_0x258e57[_0xf5bf('0x20')]?_['map'](_0x258e57[_0xf5bf('0x20')],function(_0x271f47){return{'model':db[_0x271f47[_0xf5bf('0x21')]],'as':_0x271f47['as'],'attributes':_0x271f47['attributes'],'include':_0x271f47[_0xf5bf('0x20')]?_[_0xf5bf('0x1f')](_0x271f47[_0xf5bf('0x20')],function(_0x2fe782){return{'model':db[_0x2fe782['model']],'as':_0x2fe782['as'],'attributes':_0x2fe782[_0xf5bf('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf5bf('0xf')](function(_0x176cc2){logger[_0xf5bf('0x10')](_0xf5bf('0x18'),_0x1f9d53);logger[_0xf5bf('0x13')](_0xf5bf('0x18'),_0x1f9d53,JSON[_0xf5bf('0x22')](_0x176cc2));_0x1b23fb(_0x176cc2);})[_0xf5bf('0x17')](function(_0x497dfc){logger[_0xf5bf('0x15')]('GetDeskAccount',_0x497dfc['message'],_0x1f9d53);_0x667800(_0x3ad1a1[_0xf5bf('0x15')](0x1f4,_0x497dfc[_0xf5bf('0x16')]));});});};exports[_0xf5bf('0x23')]=function(_0x4c2538){var _0x57a7fd=this;return new Promise(function(_0x5f15e6,_0x4994de){return db[_0xf5bf('0x19')][_0xf5bf('0x24')]({'raw':_0x4c2538[_0xf5bf('0x1b')]?_0x4c2538['options']['raw']===undefined?!![]:![]:!![],'where':_0x4c2538[_0xf5bf('0x1b')]?_0x4c2538[_0xf5bf('0x1b')][_0xf5bf('0x25')]||null:null,'attributes':_0x4c2538[_0xf5bf('0x1b')]?_0x4c2538['options'][_0xf5bf('0x1d')]||null:null,'include':_0x4c2538[_0xf5bf('0x1b')]?_0x4c2538['options']['include']?_[_0xf5bf('0x1f')](_0x4c2538[_0xf5bf('0x1b')]['include'],function(_0x49c7d5){return{'model':db[_0x49c7d5[_0xf5bf('0x21')]],'as':_0x49c7d5['as'],'attributes':_0x49c7d5[_0xf5bf('0x1d')],'include':_0x49c7d5[_0xf5bf('0x20')]?_[_0xf5bf('0x1f')](_0x49c7d5[_0xf5bf('0x20')],function(_0xf48b93){return{'model':db[_0xf48b93['model']],'as':_0xf48b93['as'],'attributes':_0xf48b93['attributes'],'include':_0xf48b93[_0xf5bf('0x20')]?_[_0xf5bf('0x1f')](_0xf48b93['include'],function(_0x1f85d3){return{'model':db[_0x1f85d3[_0xf5bf('0x21')]],'as':_0x1f85d3['as'],'attributes':_0x1f85d3[_0xf5bf('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16ddce){logger[_0xf5bf('0x10')](_0xf5bf('0x23'),_0x4c2538);logger['debug'](_0xf5bf('0x23'),_0x4c2538,JSON[_0xf5bf('0x22')](_0x16ddce));_0x5f15e6(_0x16ddce);})[_0xf5bf('0x17')](function(_0x309fcc){logger[_0xf5bf('0x15')](_0xf5bf('0x23'),_0x309fcc['message'],_0x4c2538);_0x4994de(_0x57a7fd[_0xf5bf('0x15')](0x1f4,_0x309fcc[_0xf5bf('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 9d8b69d..2be9bda 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 _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x2bd177,_0x2c645c){var _0x392860=function(_0x3ebc39){while(--_0x3ebc39){_0x2bd177['push'](_0x2bd177['shift']());}};_0x392860(++_0x2c645c);}(_0xedd9,0xfc));var _0x9edd=function(_0x22962a,_0xcfcaf4){_0x22962a=_0x22962a-0x0;var _0x241ada=_0xedd9[_0x22962a];return _0x241ada;};'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('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('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(_0x5214ec,_0x58864e){var _0x40cc3c=function(_0xefa8f7){while(--_0xefa8f7){_0x5214ec['push'](_0x5214ec['shift']());}};_0x40cc3c(++_0x58864e);}(_0x7217,0x19e));var _0x7721=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x7217[_0x56482c];return _0x5aae7a;};'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 22276f8..0b16176 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 _0x6e9d=['STRING','sequelize','exports'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x6e9d,0x133));var _0xd6e9=function(_0x19ea5b,_0x4b201c){_0x19ea5b=_0x19ea5b-0x0;var _0x38a464=_0x6e9d[_0x19ea5b];return _0x38a464;};'use strict';var Sequelize=require(_0xd6e9('0x0'));module[_0xd6e9('0x1')]={'name':{'type':Sequelize[_0xd6e9('0x2')]},'description':{'type':Sequelize[_0xd6e9('0x2')]}}; \ No newline at end of file +var _0xc61e=['STRING'];(function(_0x1a7cf5,_0x24c34a){var _0x39ca1f=function(_0x5217e3){while(--_0x5217e3){_0x1a7cf5['push'](_0x1a7cf5['shift']());}};_0x39ca1f(++_0x24c34a);}(_0xc61e,0x84));var _0xec61=function(_0x9aafd9,_0xd6119f){_0x9aafd9=_0x9aafd9-0x0;var _0x407103=_0xc61e[_0x9aafd9];return _0x407103;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xec61('0x0')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index f9964aa..04fca76 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 _0x90dc=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','limit','status','set','Content-Range','reject','update','then','destroy','end','error','name','map','DeskConfiguration','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','getFields','findOne','DeskField','pick','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids'];(function(_0x381d3c,_0x4bc7d0){var _0x12542e=function(_0xc3e0c7){while(--_0xc3e0c7){_0x381d3c['push'](_0x381d3c['shift']());}};_0x12542e(++_0x4bc7d0);}(_0x90dc,0x150));var _0xc90d=function(_0x59a22e,_0x304d0e){_0x59a22e=_0x59a22e-0x0;var _0x49b1cf=_0x90dc[_0x59a22e];return _0x49b1cf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc90d('0x0'));var zipdir=require(_0xc90d('0x1'));var jsonpatch=require(_0xc90d('0x2'));var rp=require(_0xc90d('0x3'));var moment=require('moment');var BPromise=require(_0xc90d('0x4'));var Mustache=require(_0xc90d('0x5'));var util=require(_0xc90d('0x6'));var path=require(_0xc90d('0x7'));var sox=require(_0xc90d('0x8'));var csv=require(_0xc90d('0x9'));var ejs=require(_0xc90d('0xa'));var fs=require('fs');var fs_extra=require(_0xc90d('0xb'));var _=require(_0xc90d('0xc'));var squel=require(_0xc90d('0xd'));var crypto=require(_0xc90d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc90d('0xf'));var toCsv=require(_0xc90d('0x9'));var querystring=require(_0xc90d('0x10'));var Papa=require(_0xc90d('0x11'));var Redis=require(_0xc90d('0x12'));var authService=require(_0xc90d('0x13'));var qs=require(_0xc90d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc90d('0x15'));var logger=require(_0xc90d('0x16'))(_0xc90d('0x17'));var utils=require(_0xc90d('0x18'));var config=require(_0xc90d('0x19'));var licenseUtil=require(_0xc90d('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ed287,_0x552599){_0x552599=_0x552599||0xcc;return function(_0x41705e){if(_0x41705e){return _0x2ed287[_0xc90d('0x1b')](_0x552599);}return _0x2ed287['status'](_0x552599)['end']();};}function respondWithResult(_0x564667,_0x39a8a2){_0x39a8a2=_0x39a8a2||0xc8;return function(_0x298a36){if(_0x298a36){return _0x564667['status'](_0x39a8a2)[_0xc90d('0x1c')](_0x298a36);}};}function respondWithFilteredResult(_0x2fbe51,_0x51e647){return function(_0x516835){if(_0x516835){var _0x1c976c=typeof _0x51e647[_0xc90d('0x1d')]===_0xc90d('0x1e')&&typeof _0x51e647[_0xc90d('0x1f')]===_0xc90d('0x1e');var _0x4e4b68=_0x516835['count'];var _0x2c173f=_0x1c976c?0x0:_0x51e647[_0xc90d('0x1d')];var _0x1f9ca9=_0x1c976c?_0x516835['count']:_0x51e647[_0xc90d('0x1d')]+_0x51e647[_0xc90d('0x1f')];var _0x28afaf;if(_0x1f9ca9>=_0x4e4b68){_0x1f9ca9=_0x4e4b68;_0x28afaf=0xc8;}else{_0x28afaf=0xce;}_0x2fbe51[_0xc90d('0x20')](_0x28afaf);return _0x2fbe51[_0xc90d('0x21')](_0xc90d('0x22'),_0x2c173f+'-'+_0x1f9ca9+'/'+_0x4e4b68)[_0xc90d('0x1c')](_0x516835);}return null;};}function patchUpdates(_0x3abf0f){return function(_0x16281c){try{jsonpatch['apply'](_0x16281c,_0x3abf0f,!![]);}catch(_0x370138){return BPromise[_0xc90d('0x23')](_0x370138);}return _0x16281c['save']();};}function saveUpdates(_0x23666c,_0xd1d679){return function(_0x1c3bfd){if(_0x1c3bfd){return _0x1c3bfd[_0xc90d('0x24')](_0x23666c)[_0xc90d('0x25')](function(_0x23083e){return _0x23083e;});}return null;};}function removeEntity(_0x1ff42b,_0x5c1f2f){return function(_0x5eb1b7){if(_0x5eb1b7){return _0x5eb1b7[_0xc90d('0x26')]()[_0xc90d('0x25')](function(){_0x1ff42b[_0xc90d('0x20')](0xcc)[_0xc90d('0x27')]();});}};}function handleEntityNotFound(_0xb8c32b,_0x11e793){return function(_0x393078){if(!_0x393078){_0xb8c32b[_0xc90d('0x1b')](0x194);}return _0x393078;};}function handleError(_0xde8c5e,_0x5ef4d2){_0x5ef4d2=_0x5ef4d2||0x1f4;return function(_0x379e74){logger[_0xc90d('0x28')](_0x379e74['stack']);if(_0x379e74['name']){delete _0x379e74[_0xc90d('0x29')];}_0xde8c5e['status'](_0x5ef4d2)['send'](_0x379e74);};}exports['index']=function(_0x48e0fa,_0x350d85){var _0x16ac5a={},_0x219be2={},_0x280313={'count':0x0,'rows':[]};var _0x538644=_[_0xc90d('0x2a')](db[_0xc90d('0x2b')][_0xc90d('0x2c')],function(_0x322b73){return{'name':_0x322b73['fieldName'],'type':_0x322b73[_0xc90d('0x2d')][_0xc90d('0x2e')]};});_0x219be2[_0xc90d('0x2f')]=_[_0xc90d('0x2a')](_0x538644,_0xc90d('0x29'));_0x219be2[_0xc90d('0x30')]=_['keys'](_0x48e0fa[_0xc90d('0x30')]);_0x219be2[_0xc90d('0x31')]=_['intersection'](_0x219be2[_0xc90d('0x2f')],_0x219be2[_0xc90d('0x30')]);_0x16ac5a[_0xc90d('0x32')]=_[_0xc90d('0x33')](_0x219be2['model'],qs[_0xc90d('0x34')](_0x48e0fa[_0xc90d('0x30')]['fields']));_0x16ac5a[_0xc90d('0x32')]=_0x16ac5a[_0xc90d('0x32')]['length']?_0x16ac5a[_0xc90d('0x32')]:_0x219be2[_0xc90d('0x2f')];if(!_0x48e0fa['query']['hasOwnProperty'](_0xc90d('0x35'))){_0x16ac5a[_0xc90d('0x1f')]=qs[_0xc90d('0x1f')](_0x48e0fa[_0xc90d('0x30')][_0xc90d('0x1f')]);_0x16ac5a['offset']=qs[_0xc90d('0x1d')](_0x48e0fa[_0xc90d('0x30')][_0xc90d('0x1d')]);}_0x16ac5a[_0xc90d('0x36')]=qs[_0xc90d('0x37')](_0x48e0fa[_0xc90d('0x30')][_0xc90d('0x37')]);_0x16ac5a[_0xc90d('0x38')]=qs[_0xc90d('0x31')](_['pick'](_0x48e0fa[_0xc90d('0x30')],_0x219be2[_0xc90d('0x31')]),_0x538644);if(_0x48e0fa[_0xc90d('0x30')][_0xc90d('0x39')]){_0x16ac5a[_0xc90d('0x38')]=_['merge'](_0x16ac5a[_0xc90d('0x38')],{'$or':_[_0xc90d('0x2a')](_0x538644,function(_0x162c41){if(_0x162c41[_0xc90d('0x2d')]!==_0xc90d('0x3a')){var _0x5672a7={};_0x5672a7[_0x162c41['name']]={'$like':'%'+_0x48e0fa[_0xc90d('0x30')][_0xc90d('0x39')]+'%'};return _0x5672a7;}})});}_0x16ac5a=_[_0xc90d('0x3b')]({},_0x16ac5a,_0x48e0fa[_0xc90d('0x3c')]);var _0x5f58d7={'where':_0x16ac5a[_0xc90d('0x38')]};return db[_0xc90d('0x2b')]['count'](_0x5f58d7)[_0xc90d('0x25')](function(_0x22a7d3){_0x280313['count']=_0x22a7d3;if(_0x48e0fa[_0xc90d('0x30')][_0xc90d('0x3d')]){_0x16ac5a[_0xc90d('0x3e')]=[{'all':!![]}];}return db[_0xc90d('0x2b')][_0xc90d('0x3f')](_0x16ac5a);})['then'](function(_0xd6a0a5){_0x280313[_0xc90d('0x40')]=_0xd6a0a5;return _0x280313;})[_0xc90d('0x25')](respondWithFilteredResult(_0x350d85,_0x16ac5a))[_0xc90d('0x41')](handleError(_0x350d85,null));};exports[_0xc90d('0x42')]=function(_0xb11488,_0x3dd32d){var _0x47593c={'raw':![],'where':{'id':_0xb11488[_0xc90d('0x43')]['id']}},_0x19e911={};_0x19e911[_0xc90d('0x2f')]=_[_0xc90d('0x44')](db[_0xc90d('0x2b')][_0xc90d('0x2c')]);_0x19e911[_0xc90d('0x30')]=_[_0xc90d('0x44')](_0xb11488[_0xc90d('0x30')]);_0x19e911[_0xc90d('0x31')]=_['intersection'](_0x19e911[_0xc90d('0x2f')],_0x19e911[_0xc90d('0x30')]);_0x47593c['attributes']=_['intersection'](_0x19e911[_0xc90d('0x2f')],qs[_0xc90d('0x34')](_0xb11488[_0xc90d('0x30')][_0xc90d('0x34')]));_0x47593c[_0xc90d('0x32')]=_0x47593c[_0xc90d('0x32')][_0xc90d('0x45')]?_0x47593c[_0xc90d('0x32')]:_0x19e911[_0xc90d('0x2f')];if(_0xb11488[_0xc90d('0x30')][_0xc90d('0x3d')]){_0x47593c[_0xc90d('0x3e')]=[{'all':!![]}];}_0x47593c=_[_0xc90d('0x3b')]({},_0x47593c,_0xb11488[_0xc90d('0x3c')]);return db[_0xc90d('0x2b')][_0xc90d('0x46')](_0x47593c)[_0xc90d('0x25')](handleEntityNotFound(_0x3dd32d,null))[_0xc90d('0x25')](respondWithResult(_0x3dd32d,null))['catch'](handleError(_0x3dd32d,null));};exports[_0xc90d('0x47')]=function(_0x414d53,_0x38c1bd){return db[_0xc90d('0x2b')][_0xc90d('0x47')](_0x414d53[_0xc90d('0x48')],{})[_0xc90d('0x25')](respondWithResult(_0x38c1bd,0xc9))[_0xc90d('0x41')](handleError(_0x38c1bd,null));};exports[_0xc90d('0x24')]=function(_0x2136ff,_0x5e13de){if(_0x2136ff[_0xc90d('0x48')]['id']){delete _0x2136ff[_0xc90d('0x48')]['id'];}return db[_0xc90d('0x2b')]['find']({'where':{'id':_0x2136ff['params']['id']}})[_0xc90d('0x25')](handleEntityNotFound(_0x5e13de,null))['then'](saveUpdates(_0x2136ff[_0xc90d('0x48')],null))['then'](respondWithResult(_0x5e13de,null))[_0xc90d('0x41')](handleError(_0x5e13de,null));};exports[_0xc90d('0x26')]=function(_0x2031d8,_0x6072f2){return db[_0xc90d('0x2b')][_0xc90d('0x46')]({'where':{'id':_0x2031d8[_0xc90d('0x43')]['id']}})[_0xc90d('0x25')](handleEntityNotFound(_0x6072f2,null))['then'](removeEntity(_0x6072f2,null))[_0xc90d('0x41')](handleError(_0x6072f2,null));};exports[_0xc90d('0x49')]=function(_0x1c5d87,_0x270e59,_0x5a20a4){var _0x1a7e0b={};var _0x43d1b8={};var _0x31f9e8;var _0x2a5931;return db[_0xc90d('0x2b')][_0xc90d('0x4a')]({'where':{'id':_0x1c5d87['params']['id']}})[_0xc90d('0x25')](handleEntityNotFound(_0x270e59,null))['then'](function(_0x241a63){if(_0x241a63){_0x31f9e8=_0x241a63;_0x43d1b8[_0xc90d('0x2f')]=_[_0xc90d('0x44')](db[_0xc90d('0x4b')][_0xc90d('0x2c')]);_0x43d1b8['query']=_[_0xc90d('0x44')](_0x1c5d87['query']);_0x43d1b8[_0xc90d('0x31')]=_['intersection'](_0x43d1b8['model'],_0x43d1b8[_0xc90d('0x30')]);_0x1a7e0b[_0xc90d('0x32')]=_[_0xc90d('0x33')](_0x43d1b8[_0xc90d('0x2f')],qs[_0xc90d('0x34')](_0x1c5d87[_0xc90d('0x30')][_0xc90d('0x34')]));_0x1a7e0b[_0xc90d('0x32')]=_0x1a7e0b[_0xc90d('0x32')][_0xc90d('0x45')]?_0x1a7e0b[_0xc90d('0x32')]:_0x43d1b8[_0xc90d('0x2f')];_0x1a7e0b[_0xc90d('0x36')]=qs[_0xc90d('0x37')](_0x1c5d87[_0xc90d('0x30')][_0xc90d('0x37')]);_0x1a7e0b[_0xc90d('0x38')]=qs['filters'](_[_0xc90d('0x4c')](_0x1c5d87[_0xc90d('0x30')],_0x43d1b8[_0xc90d('0x31')]));if(_0x1c5d87[_0xc90d('0x30')][_0xc90d('0x39')]){_0x1a7e0b[_0xc90d('0x38')]=_[_0xc90d('0x3b')](_0x1a7e0b['where'],{'$or':_[_0xc90d('0x2a')](_0x1a7e0b['attributes'],function(_0x50a8f9){var _0x31f9c9={};_0x31f9c9[_0x50a8f9]={'$like':'%'+_0x1c5d87[_0xc90d('0x30')][_0xc90d('0x39')]+'%'};return _0x31f9c9;})});}_0x1a7e0b=_['merge']({},_0x1a7e0b,_0x1c5d87[_0xc90d('0x3c')]);return _0x31f9e8[_0xc90d('0x49')](_0x1a7e0b);}})[_0xc90d('0x25')](function(_0xe52d43){if(_0xe52d43){_0x2a5931=_0xe52d43[_0xc90d('0x45')];if(!_0x1c5d87[_0xc90d('0x30')][_0xc90d('0x4d')]('nolimit')){_0x1a7e0b[_0xc90d('0x1f')]=qs[_0xc90d('0x1f')](_0x1c5d87[_0xc90d('0x30')][_0xc90d('0x1f')]);_0x1a7e0b[_0xc90d('0x1d')]=qs['offset'](_0x1c5d87['query'][_0xc90d('0x1d')]);}return _0x31f9e8[_0xc90d('0x49')](_0x1a7e0b);}})['then'](function(_0x51e136){if(_0x51e136){return _0x51e136?{'count':_0x2a5931,'rows':_0x51e136}:null;}})[_0xc90d('0x25')](respondWithResult(_0x270e59,null))[_0xc90d('0x41')](handleError(_0x270e59,null));};exports[_0xc90d('0x4e')]=function(_0xf543c2,_0x1aca7f,_0x184b9e){var _0x3c02b7={};var _0x1c5b99={};var _0x755fa1;var _0xd89faa;return db[_0xc90d('0x2b')][_0xc90d('0x4a')]({'where':{'id':_0xf543c2[_0xc90d('0x43')]['id']}})[_0xc90d('0x25')](handleEntityNotFound(_0x1aca7f,null))[_0xc90d('0x25')](function(_0x425548){if(_0x425548){_0x755fa1=_0x425548;_0x1c5b99[_0xc90d('0x2f')]=_[_0xc90d('0x44')](db[_0xc90d('0x4b')]['rawAttributes']);_0x1c5b99[_0xc90d('0x30')]=_[_0xc90d('0x44')](_0xf543c2['query']);_0x1c5b99['filters']=_[_0xc90d('0x33')](_0x1c5b99['model'],_0x1c5b99[_0xc90d('0x30')]);_0x3c02b7['attributes']=_['intersection'](_0x1c5b99[_0xc90d('0x2f')],qs[_0xc90d('0x34')](_0xf543c2['query'][_0xc90d('0x34')]));_0x3c02b7[_0xc90d('0x32')]=_0x3c02b7[_0xc90d('0x32')][_0xc90d('0x45')]?_0x3c02b7[_0xc90d('0x32')]:_0x1c5b99['model'];_0x3c02b7['order']=qs['sort'](_0xf543c2[_0xc90d('0x30')][_0xc90d('0x37')]);_0x3c02b7[_0xc90d('0x38')]=qs['filters'](_[_0xc90d('0x4c')](_0xf543c2[_0xc90d('0x30')],_0x1c5b99['filters']));if(_0xf543c2[_0xc90d('0x30')][_0xc90d('0x39')]){_0x3c02b7['where']=_[_0xc90d('0x3b')](_0x3c02b7['where'],{'$or':_[_0xc90d('0x2a')](_0x3c02b7['attributes'],function(_0x7e6bdd){var _0x339bba={};_0x339bba[_0x7e6bdd]={'$like':'%'+_0xf543c2[_0xc90d('0x30')][_0xc90d('0x39')]+'%'};return _0x339bba;})});}_0x3c02b7=_[_0xc90d('0x3b')]({},_0x3c02b7,_0xf543c2['options']);return _0x755fa1[_0xc90d('0x4e')](_0x3c02b7);}})['then'](function(_0x197b9c){if(_0x197b9c){_0xd89faa=_0x197b9c[_0xc90d('0x45')];if(!_0xf543c2[_0xc90d('0x30')][_0xc90d('0x4d')](_0xc90d('0x35'))){_0x3c02b7[_0xc90d('0x1f')]=qs[_0xc90d('0x1f')](_0xf543c2[_0xc90d('0x30')][_0xc90d('0x1f')]);_0x3c02b7[_0xc90d('0x1d')]=qs[_0xc90d('0x1d')](_0xf543c2[_0xc90d('0x30')][_0xc90d('0x1d')]);}return _0x755fa1['getSubjects'](_0x3c02b7);}})[_0xc90d('0x25')](function(_0x402387){if(_0x402387){return _0x402387?{'count':_0xd89faa,'rows':_0x402387}:null;}})[_0xc90d('0x25')](respondWithResult(_0x1aca7f,null))[_0xc90d('0x41')](handleError(_0x1aca7f,null));};exports[_0xc90d('0x4f')]=function(_0x1ac1fa,_0x154876,_0x2f3a33){var _0x2e3809={};var _0x4c5e02={};var _0x536ec8;var _0x551220;return db['DeskConfiguration']['findOne']({'where':{'id':_0x1ac1fa[_0xc90d('0x43')]['id']}})[_0xc90d('0x25')](handleEntityNotFound(_0x154876,null))[_0xc90d('0x25')](function(_0x500bd0){if(_0x500bd0){_0x536ec8=_0x500bd0;_0x4c5e02['model']=_[_0xc90d('0x44')](db[_0xc90d('0x4b')][_0xc90d('0x2c')]);_0x4c5e02[_0xc90d('0x30')]=_[_0xc90d('0x44')](_0x1ac1fa['query']);_0x4c5e02['filters']=_[_0xc90d('0x33')](_0x4c5e02[_0xc90d('0x2f')],_0x4c5e02[_0xc90d('0x30')]);_0x2e3809[_0xc90d('0x32')]=_[_0xc90d('0x33')](_0x4c5e02[_0xc90d('0x2f')],qs[_0xc90d('0x34')](_0x1ac1fa[_0xc90d('0x30')][_0xc90d('0x34')]));_0x2e3809[_0xc90d('0x32')]=_0x2e3809['attributes'][_0xc90d('0x45')]?_0x2e3809[_0xc90d('0x32')]:_0x4c5e02[_0xc90d('0x2f')];_0x2e3809[_0xc90d('0x36')]=qs[_0xc90d('0x37')](_0x1ac1fa['query'][_0xc90d('0x37')]);_0x2e3809[_0xc90d('0x38')]=qs[_0xc90d('0x31')](_[_0xc90d('0x4c')](_0x1ac1fa[_0xc90d('0x30')],_0x4c5e02[_0xc90d('0x31')]));if(_0x1ac1fa['query'][_0xc90d('0x39')]){_0x2e3809[_0xc90d('0x38')]=_['merge'](_0x2e3809['where'],{'$or':_[_0xc90d('0x2a')](_0x2e3809[_0xc90d('0x32')],function(_0x18c30e){var _0x14dd02={};_0x14dd02[_0x18c30e]={'$like':'%'+_0x1ac1fa['query'][_0xc90d('0x39')]+'%'};return _0x14dd02;})});}_0x2e3809=_[_0xc90d('0x3b')]({},_0x2e3809,_0x1ac1fa[_0xc90d('0x3c')]);return _0x536ec8[_0xc90d('0x4f')](_0x2e3809);}})[_0xc90d('0x25')](function(_0x4de89b){if(_0x4de89b){_0x551220=_0x4de89b[_0xc90d('0x45')];if(!_0x1ac1fa['query'][_0xc90d('0x4d')](_0xc90d('0x35'))){_0x2e3809[_0xc90d('0x1f')]=qs[_0xc90d('0x1f')](_0x1ac1fa[_0xc90d('0x30')][_0xc90d('0x1f')]);_0x2e3809[_0xc90d('0x1d')]=qs['offset'](_0x1ac1fa['query'][_0xc90d('0x1d')]);}return _0x536ec8['getDescriptions'](_0x2e3809);}})[_0xc90d('0x25')](function(_0x39a924){if(_0x39a924){return _0x39a924?{'count':_0x551220,'rows':_0x39a924}:null;}})[_0xc90d('0x25')](respondWithResult(_0x154876,null))[_0xc90d('0x41')](handleError(_0x154876,null));};exports[_0xc90d('0x50')]=function(_0x60fda,_0x218264,_0x500677){var _0x757da3={};var _0x7f1610={};var _0x56de42;var _0x2bb97c;return db[_0xc90d('0x2b')][_0xc90d('0x4a')]({'where':{'id':_0x60fda[_0xc90d('0x43')]['id']}})[_0xc90d('0x25')](handleEntityNotFound(_0x218264,null))[_0xc90d('0x25')](function(_0x4402df){if(_0x4402df){_0x56de42=_0x4402df;_0x7f1610[_0xc90d('0x2f')]=_[_0xc90d('0x44')](db[_0xc90d('0x51')][_0xc90d('0x2c')]);_0x7f1610[_0xc90d('0x30')]=_[_0xc90d('0x44')](_0x60fda[_0xc90d('0x30')]);_0x7f1610['filters']=_[_0xc90d('0x33')](_0x7f1610[_0xc90d('0x2f')],_0x7f1610[_0xc90d('0x30')]);_0x757da3[_0xc90d('0x32')]=_[_0xc90d('0x33')](_0x7f1610['model'],qs[_0xc90d('0x34')](_0x60fda[_0xc90d('0x30')][_0xc90d('0x34')]));_0x757da3['attributes']=_0x757da3[_0xc90d('0x32')][_0xc90d('0x45')]?_0x757da3['attributes']:_0x7f1610[_0xc90d('0x2f')];_0x757da3['order']=qs[_0xc90d('0x37')](_0x60fda[_0xc90d('0x30')][_0xc90d('0x37')]);_0x757da3[_0xc90d('0x38')]=qs[_0xc90d('0x31')](_[_0xc90d('0x4c')](_0x60fda[_0xc90d('0x30')],_0x7f1610[_0xc90d('0x31')]));if(_0x60fda[_0xc90d('0x30')][_0xc90d('0x39')]){_0x757da3[_0xc90d('0x38')]=_[_0xc90d('0x3b')](_0x757da3[_0xc90d('0x38')],{'$or':_['map'](_0x757da3[_0xc90d('0x32')],function(_0x41a9bd){var _0x1a032a={};_0x1a032a[_0x41a9bd]={'$like':'%'+_0x60fda[_0xc90d('0x30')][_0xc90d('0x39')]+'%'};return _0x1a032a;})});}_0x757da3=_[_0xc90d('0x3b')]({},_0x757da3,_0x60fda[_0xc90d('0x3c')]);return _0x56de42[_0xc90d('0x50')](_0x757da3);}})[_0xc90d('0x25')](function(_0xbc2e4f){if(_0xbc2e4f){_0x2bb97c=_0xbc2e4f['length'];if(!_0x60fda[_0xc90d('0x30')][_0xc90d('0x4d')](_0xc90d('0x35'))){_0x757da3[_0xc90d('0x1f')]=qs[_0xc90d('0x1f')](_0x60fda['query'][_0xc90d('0x1f')]);_0x757da3[_0xc90d('0x1d')]=qs[_0xc90d('0x1d')](_0x60fda[_0xc90d('0x30')][_0xc90d('0x1d')]);}return _0x56de42[_0xc90d('0x50')](_0x757da3);}})['then'](function(_0x12df7d){if(_0x12df7d){return _0x12df7d?{'count':_0x2bb97c,'rows':_0x12df7d}:null;}})[_0xc90d('0x25')](respondWithResult(_0x218264,null))[_0xc90d('0x41')](handleError(_0x218264,null));};exports[_0xc90d('0x52')]=function(_0x1978a6,_0x4d3503,_0x43b11d){if(_0x1978a6['body']['id']){delete _0x1978a6['body']['id'];}return db[_0xc90d('0x2b')]['findOne']({'where':{'id':_0x1978a6['params']['id']}})['then'](handleEntityNotFound(_0x4d3503,null))[_0xc90d('0x25')](function(_0x18c094){if(_0x18c094){return _0x18c094['setTags'](_0x1978a6[_0xc90d('0x48')][_0xc90d('0x53')]||[]);}return null;})[_0xc90d('0x25')](respondWithResult(_0x4d3503,null))['catch'](handleError(_0x4d3503,null));}; \ No newline at end of file +var _0xd8f4=['getDescriptions','getTags','Tag','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','index','map','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','DeskConfiguration','findAll','catch','show','params','rawAttributes','find','create','body','getFields','findOne','DeskField','getSubjects'];(function(_0x356127,_0x4873ac){var _0x5d4c75=function(_0x4fe60c){while(--_0x4fe60c){_0x356127['push'](_0x356127['shift']());}};_0x5d4c75(++_0x4873ac);}(_0xd8f4,0xf7));var _0x4d8f=function(_0x106941,_0x4a1182){_0x106941=_0x106941-0x0;var _0x2a99d0=_0xd8f4[_0x106941];return _0x2a99d0;};'use strict';var emlformat=require(_0x4d8f('0x0'));var rimraf=require(_0x4d8f('0x1'));var zipdir=require(_0x4d8f('0x2'));var jsonpatch=require(_0x4d8f('0x3'));var rp=require(_0x4d8f('0x4'));var moment=require(_0x4d8f('0x5'));var BPromise=require(_0x4d8f('0x6'));var Mustache=require('mustache');var util=require(_0x4d8f('0x7'));var path=require(_0x4d8f('0x8'));var sox=require(_0x4d8f('0x9'));var csv=require(_0x4d8f('0xa'));var ejs=require(_0x4d8f('0xb'));var fs=require('fs');var fs_extra=require(_0x4d8f('0xc'));var _=require(_0x4d8f('0xd'));var squel=require(_0x4d8f('0xe'));var crypto=require(_0x4d8f('0xf'));var jsforce=require(_0x4d8f('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x4d8f('0xa'));var querystring=require(_0x4d8f('0x11'));var Papa=require(_0x4d8f('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4d8f('0x13'));var hardwareService=require(_0x4d8f('0x14'));var logger=require(_0x4d8f('0x15'))(_0x4d8f('0x16'));var utils=require(_0x4d8f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4d8f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3691d2,_0x454fb4){_0x454fb4=_0x454fb4||0xcc;return function(_0x439995){if(_0x439995){return _0x3691d2['sendStatus'](_0x454fb4);}return _0x3691d2[_0x4d8f('0x19')](_0x454fb4)[_0x4d8f('0x1a')]();};}function respondWithResult(_0x300739,_0x482ba7){_0x482ba7=_0x482ba7||0xc8;return function(_0x1043bb){if(_0x1043bb){return _0x300739['status'](_0x482ba7)[_0x4d8f('0x1b')](_0x1043bb);}};}function respondWithFilteredResult(_0x28dd15,_0x2aaecf){return function(_0x2fb788){if(_0x2fb788){var _0x419468=typeof _0x2aaecf[_0x4d8f('0x1c')]===_0x4d8f('0x1d')&&typeof _0x2aaecf[_0x4d8f('0x1e')]===_0x4d8f('0x1d');var _0x339383=_0x2fb788[_0x4d8f('0x1f')];var _0x5d40c3=_0x419468?0x0:_0x2aaecf[_0x4d8f('0x1c')];var _0x45ddbd=_0x419468?_0x2fb788[_0x4d8f('0x1f')]:_0x2aaecf[_0x4d8f('0x1c')]+_0x2aaecf['limit'];var _0x514004;if(_0x45ddbd>=_0x339383){_0x45ddbd=_0x339383;_0x514004=0xc8;}else{_0x514004=0xce;}_0x28dd15['status'](_0x514004);return _0x28dd15[_0x4d8f('0x20')](_0x4d8f('0x21'),_0x5d40c3+'-'+_0x45ddbd+'/'+_0x339383)[_0x4d8f('0x1b')](_0x2fb788);}return null;};}function patchUpdates(_0x447ea1){return function(_0x4522cb){try{jsonpatch[_0x4d8f('0x22')](_0x4522cb,_0x447ea1,!![]);}catch(_0x56c17d){return BPromise[_0x4d8f('0x23')](_0x56c17d);}return _0x4522cb['save']();};}function saveUpdates(_0x4d3db0,_0x55a65b){return function(_0x3ae71e){if(_0x3ae71e){return _0x3ae71e[_0x4d8f('0x24')](_0x4d3db0)[_0x4d8f('0x25')](function(_0xdf1e0a){return _0xdf1e0a;});}return null;};}function removeEntity(_0x40dd71,_0x3c9556){return function(_0x331fda){if(_0x331fda){return _0x331fda[_0x4d8f('0x26')]()[_0x4d8f('0x25')](function(){_0x40dd71[_0x4d8f('0x19')](0xcc)[_0x4d8f('0x1a')]();});}};}function handleEntityNotFound(_0x390b40,_0x370f56){return function(_0x511648){if(!_0x511648){_0x390b40[_0x4d8f('0x27')](0x194);}return _0x511648;};}function handleError(_0x16f020,_0x3d32ac){_0x3d32ac=_0x3d32ac||0x1f4;return function(_0x5e795f){logger['error'](_0x5e795f[_0x4d8f('0x28')]);if(_0x5e795f[_0x4d8f('0x29')]){delete _0x5e795f[_0x4d8f('0x29')];}_0x16f020['status'](_0x3d32ac)['send'](_0x5e795f);};}exports[_0x4d8f('0x2a')]=function(_0x30d163,_0x1ba15b){var _0x2ebedc={},_0x44e8d1={},_0x5c622c={'count':0x0,'rows':[]};var _0x1c304b=_[_0x4d8f('0x2b')](db['DeskConfiguration']['rawAttributes'],function(_0x29efb8){return{'name':_0x29efb8['fieldName'],'type':_0x29efb8[_0x4d8f('0x2c')]['key']};});_0x44e8d1[_0x4d8f('0x2d')]=_[_0x4d8f('0x2b')](_0x1c304b,_0x4d8f('0x29'));_0x44e8d1[_0x4d8f('0x2e')]=_[_0x4d8f('0x2f')](_0x30d163['query']);_0x44e8d1[_0x4d8f('0x30')]=_[_0x4d8f('0x31')](_0x44e8d1[_0x4d8f('0x2d')],_0x44e8d1[_0x4d8f('0x2e')]);_0x2ebedc[_0x4d8f('0x32')]=_[_0x4d8f('0x31')](_0x44e8d1[_0x4d8f('0x2d')],qs['fields'](_0x30d163[_0x4d8f('0x2e')][_0x4d8f('0x33')]));_0x2ebedc['attributes']=_0x2ebedc[_0x4d8f('0x32')][_0x4d8f('0x34')]?_0x2ebedc['attributes']:_0x44e8d1[_0x4d8f('0x2d')];if(!_0x30d163['query'][_0x4d8f('0x35')](_0x4d8f('0x36'))){_0x2ebedc[_0x4d8f('0x1e')]=qs[_0x4d8f('0x1e')](_0x30d163[_0x4d8f('0x2e')][_0x4d8f('0x1e')]);_0x2ebedc[_0x4d8f('0x1c')]=qs[_0x4d8f('0x1c')](_0x30d163[_0x4d8f('0x2e')][_0x4d8f('0x1c')]);}_0x2ebedc[_0x4d8f('0x37')]=qs[_0x4d8f('0x38')](_0x30d163[_0x4d8f('0x2e')][_0x4d8f('0x38')]);_0x2ebedc[_0x4d8f('0x39')]=qs[_0x4d8f('0x30')](_[_0x4d8f('0x3a')](_0x30d163[_0x4d8f('0x2e')],_0x44e8d1['filters']),_0x1c304b);if(_0x30d163[_0x4d8f('0x2e')][_0x4d8f('0x3b')]){_0x2ebedc[_0x4d8f('0x39')]=_[_0x4d8f('0x3c')](_0x2ebedc[_0x4d8f('0x39')],{'$or':_[_0x4d8f('0x2b')](_0x1c304b,function(_0x11f6be){if(_0x11f6be[_0x4d8f('0x2c')]!==_0x4d8f('0x3d')){var _0x4f9353={};_0x4f9353[_0x11f6be[_0x4d8f('0x29')]]={'$like':'%'+_0x30d163[_0x4d8f('0x2e')]['filter']+'%'};return _0x4f9353;}})});}_0x2ebedc=_['merge']({},_0x2ebedc,_0x30d163[_0x4d8f('0x3e')]);var _0x198653={'where':_0x2ebedc['where']};return db['DeskConfiguration'][_0x4d8f('0x1f')](_0x198653)[_0x4d8f('0x25')](function(_0x14c138){_0x5c622c[_0x4d8f('0x1f')]=_0x14c138;if(_0x30d163[_0x4d8f('0x2e')][_0x4d8f('0x3f')]){_0x2ebedc['include']=[{'all':!![]}];}return db[_0x4d8f('0x40')][_0x4d8f('0x41')](_0x2ebedc);})[_0x4d8f('0x25')](function(_0x3db3f2){_0x5c622c['rows']=_0x3db3f2;return _0x5c622c;})['then'](respondWithFilteredResult(_0x1ba15b,_0x2ebedc))[_0x4d8f('0x42')](handleError(_0x1ba15b,null));};exports[_0x4d8f('0x43')]=function(_0x44660b,_0x4cf0aa){var _0x4bab6a={'raw':![],'where':{'id':_0x44660b[_0x4d8f('0x44')]['id']}},_0x171104={};_0x171104[_0x4d8f('0x2d')]=_[_0x4d8f('0x2f')](db[_0x4d8f('0x40')][_0x4d8f('0x45')]);_0x171104[_0x4d8f('0x2e')]=_[_0x4d8f('0x2f')](_0x44660b[_0x4d8f('0x2e')]);_0x171104['filters']=_[_0x4d8f('0x31')](_0x171104[_0x4d8f('0x2d')],_0x171104['query']);_0x4bab6a['attributes']=_['intersection'](_0x171104[_0x4d8f('0x2d')],qs[_0x4d8f('0x33')](_0x44660b['query'][_0x4d8f('0x33')]));_0x4bab6a[_0x4d8f('0x32')]=_0x4bab6a[_0x4d8f('0x32')]['length']?_0x4bab6a[_0x4d8f('0x32')]:_0x171104[_0x4d8f('0x2d')];if(_0x44660b[_0x4d8f('0x2e')]['includeAll']){_0x4bab6a['include']=[{'all':!![]}];}_0x4bab6a=_['merge']({},_0x4bab6a,_0x44660b['options']);return db['DeskConfiguration'][_0x4d8f('0x46')](_0x4bab6a)['then'](handleEntityNotFound(_0x4cf0aa,null))[_0x4d8f('0x25')](respondWithResult(_0x4cf0aa,null))['catch'](handleError(_0x4cf0aa,null));};exports[_0x4d8f('0x47')]=function(_0x5dcc81,_0x3ccecc){return db['DeskConfiguration']['create'](_0x5dcc81['body'],{})[_0x4d8f('0x25')](respondWithResult(_0x3ccecc,0xc9))[_0x4d8f('0x42')](handleError(_0x3ccecc,null));};exports['update']=function(_0x49d45f,_0x2ca158){if(_0x49d45f[_0x4d8f('0x48')]['id']){delete _0x49d45f[_0x4d8f('0x48')]['id'];}return db['DeskConfiguration'][_0x4d8f('0x46')]({'where':{'id':_0x49d45f[_0x4d8f('0x44')]['id']}})['then'](handleEntityNotFound(_0x2ca158,null))[_0x4d8f('0x25')](saveUpdates(_0x49d45f[_0x4d8f('0x48')],null))[_0x4d8f('0x25')](respondWithResult(_0x2ca158,null))['catch'](handleError(_0x2ca158,null));};exports[_0x4d8f('0x26')]=function(_0x1d009c,_0x361543){return db[_0x4d8f('0x40')][_0x4d8f('0x46')]({'where':{'id':_0x1d009c[_0x4d8f('0x44')]['id']}})[_0x4d8f('0x25')](handleEntityNotFound(_0x361543,null))[_0x4d8f('0x25')](removeEntity(_0x361543,null))[_0x4d8f('0x42')](handleError(_0x361543,null));};exports[_0x4d8f('0x49')]=function(_0x3db453,_0x51ee5e,_0x39712c){var _0x4b8698={};var _0x528062={};var _0x25099f;var _0x24f1aa;return db['DeskConfiguration'][_0x4d8f('0x4a')]({'where':{'id':_0x3db453['params']['id']}})[_0x4d8f('0x25')](handleEntityNotFound(_0x51ee5e,null))[_0x4d8f('0x25')](function(_0xf5f9bf){if(_0xf5f9bf){_0x25099f=_0xf5f9bf;_0x528062[_0x4d8f('0x2d')]=_[_0x4d8f('0x2f')](db[_0x4d8f('0x4b')][_0x4d8f('0x45')]);_0x528062[_0x4d8f('0x2e')]=_[_0x4d8f('0x2f')](_0x3db453[_0x4d8f('0x2e')]);_0x528062[_0x4d8f('0x30')]=_[_0x4d8f('0x31')](_0x528062[_0x4d8f('0x2d')],_0x528062[_0x4d8f('0x2e')]);_0x4b8698[_0x4d8f('0x32')]=_['intersection'](_0x528062['model'],qs['fields'](_0x3db453[_0x4d8f('0x2e')][_0x4d8f('0x33')]));_0x4b8698[_0x4d8f('0x32')]=_0x4b8698[_0x4d8f('0x32')][_0x4d8f('0x34')]?_0x4b8698[_0x4d8f('0x32')]:_0x528062[_0x4d8f('0x2d')];_0x4b8698[_0x4d8f('0x37')]=qs[_0x4d8f('0x38')](_0x3db453[_0x4d8f('0x2e')]['sort']);_0x4b8698[_0x4d8f('0x39')]=qs['filters'](_[_0x4d8f('0x3a')](_0x3db453[_0x4d8f('0x2e')],_0x528062[_0x4d8f('0x30')]));if(_0x3db453[_0x4d8f('0x2e')]['filter']){_0x4b8698[_0x4d8f('0x39')]=_[_0x4d8f('0x3c')](_0x4b8698['where'],{'$or':_[_0x4d8f('0x2b')](_0x4b8698[_0x4d8f('0x32')],function(_0x109ffc){var _0x2b7c81={};_0x2b7c81[_0x109ffc]={'$like':'%'+_0x3db453[_0x4d8f('0x2e')]['filter']+'%'};return _0x2b7c81;})});}_0x4b8698=_[_0x4d8f('0x3c')]({},_0x4b8698,_0x3db453[_0x4d8f('0x3e')]);return _0x25099f['getFields'](_0x4b8698);}})[_0x4d8f('0x25')](function(_0x1b32e8){if(_0x1b32e8){_0x24f1aa=_0x1b32e8[_0x4d8f('0x34')];if(!_0x3db453[_0x4d8f('0x2e')][_0x4d8f('0x35')](_0x4d8f('0x36'))){_0x4b8698[_0x4d8f('0x1e')]=qs[_0x4d8f('0x1e')](_0x3db453[_0x4d8f('0x2e')][_0x4d8f('0x1e')]);_0x4b8698['offset']=qs[_0x4d8f('0x1c')](_0x3db453[_0x4d8f('0x2e')][_0x4d8f('0x1c')]);}return _0x25099f[_0x4d8f('0x49')](_0x4b8698);}})[_0x4d8f('0x25')](function(_0x17b36a){if(_0x17b36a){return _0x17b36a?{'count':_0x24f1aa,'rows':_0x17b36a}:null;}})[_0x4d8f('0x25')](respondWithResult(_0x51ee5e,null))[_0x4d8f('0x42')](handleError(_0x51ee5e,null));};exports[_0x4d8f('0x4c')]=function(_0x1a9a5a,_0x54fd4a,_0x419f5b){var _0x587591={};var _0x4e97f3={};var _0x57f24d;var _0x351edb;return db['DeskConfiguration'][_0x4d8f('0x4a')]({'where':{'id':_0x1a9a5a[_0x4d8f('0x44')]['id']}})[_0x4d8f('0x25')](handleEntityNotFound(_0x54fd4a,null))[_0x4d8f('0x25')](function(_0x255441){if(_0x255441){_0x57f24d=_0x255441;_0x4e97f3[_0x4d8f('0x2d')]=_[_0x4d8f('0x2f')](db[_0x4d8f('0x4b')][_0x4d8f('0x45')]);_0x4e97f3[_0x4d8f('0x2e')]=_[_0x4d8f('0x2f')](_0x1a9a5a[_0x4d8f('0x2e')]);_0x4e97f3['filters']=_[_0x4d8f('0x31')](_0x4e97f3['model'],_0x4e97f3[_0x4d8f('0x2e')]);_0x587591[_0x4d8f('0x32')]=_[_0x4d8f('0x31')](_0x4e97f3[_0x4d8f('0x2d')],qs['fields'](_0x1a9a5a[_0x4d8f('0x2e')][_0x4d8f('0x33')]));_0x587591['attributes']=_0x587591[_0x4d8f('0x32')][_0x4d8f('0x34')]?_0x587591['attributes']:_0x4e97f3['model'];_0x587591[_0x4d8f('0x37')]=qs[_0x4d8f('0x38')](_0x1a9a5a['query'][_0x4d8f('0x38')]);_0x587591[_0x4d8f('0x39')]=qs[_0x4d8f('0x30')](_['pick'](_0x1a9a5a[_0x4d8f('0x2e')],_0x4e97f3[_0x4d8f('0x30')]));if(_0x1a9a5a[_0x4d8f('0x2e')][_0x4d8f('0x3b')]){_0x587591[_0x4d8f('0x39')]=_[_0x4d8f('0x3c')](_0x587591[_0x4d8f('0x39')],{'$or':_[_0x4d8f('0x2b')](_0x587591[_0x4d8f('0x32')],function(_0x3bc42c){var _0x378b18={};_0x378b18[_0x3bc42c]={'$like':'%'+_0x1a9a5a[_0x4d8f('0x2e')][_0x4d8f('0x3b')]+'%'};return _0x378b18;})});}_0x587591=_[_0x4d8f('0x3c')]({},_0x587591,_0x1a9a5a['options']);return _0x57f24d[_0x4d8f('0x4c')](_0x587591);}})[_0x4d8f('0x25')](function(_0x291328){if(_0x291328){_0x351edb=_0x291328[_0x4d8f('0x34')];if(!_0x1a9a5a[_0x4d8f('0x2e')][_0x4d8f('0x35')](_0x4d8f('0x36'))){_0x587591['limit']=qs[_0x4d8f('0x1e')](_0x1a9a5a[_0x4d8f('0x2e')][_0x4d8f('0x1e')]);_0x587591[_0x4d8f('0x1c')]=qs[_0x4d8f('0x1c')](_0x1a9a5a[_0x4d8f('0x2e')]['offset']);}return _0x57f24d['getSubjects'](_0x587591);}})[_0x4d8f('0x25')](function(_0x4167bc){if(_0x4167bc){return _0x4167bc?{'count':_0x351edb,'rows':_0x4167bc}:null;}})[_0x4d8f('0x25')](respondWithResult(_0x54fd4a,null))[_0x4d8f('0x42')](handleError(_0x54fd4a,null));};exports['getDescriptions']=function(_0x407824,_0x3c1ae3,_0x1aceee){var _0x260d9f={};var _0x5df431={};var _0x509a31;var _0x4cedce;return db[_0x4d8f('0x40')][_0x4d8f('0x4a')]({'where':{'id':_0x407824[_0x4d8f('0x44')]['id']}})[_0x4d8f('0x25')](handleEntityNotFound(_0x3c1ae3,null))[_0x4d8f('0x25')](function(_0x8d159a){if(_0x8d159a){_0x509a31=_0x8d159a;_0x5df431[_0x4d8f('0x2d')]=_[_0x4d8f('0x2f')](db[_0x4d8f('0x4b')][_0x4d8f('0x45')]);_0x5df431[_0x4d8f('0x2e')]=_[_0x4d8f('0x2f')](_0x407824['query']);_0x5df431['filters']=_[_0x4d8f('0x31')](_0x5df431[_0x4d8f('0x2d')],_0x5df431[_0x4d8f('0x2e')]);_0x260d9f[_0x4d8f('0x32')]=_['intersection'](_0x5df431[_0x4d8f('0x2d')],qs['fields'](_0x407824[_0x4d8f('0x2e')][_0x4d8f('0x33')]));_0x260d9f[_0x4d8f('0x32')]=_0x260d9f[_0x4d8f('0x32')][_0x4d8f('0x34')]?_0x260d9f['attributes']:_0x5df431[_0x4d8f('0x2d')];_0x260d9f['order']=qs[_0x4d8f('0x38')](_0x407824[_0x4d8f('0x2e')][_0x4d8f('0x38')]);_0x260d9f[_0x4d8f('0x39')]=qs['filters'](_[_0x4d8f('0x3a')](_0x407824['query'],_0x5df431[_0x4d8f('0x30')]));if(_0x407824['query'][_0x4d8f('0x3b')]){_0x260d9f['where']=_['merge'](_0x260d9f[_0x4d8f('0x39')],{'$or':_[_0x4d8f('0x2b')](_0x260d9f[_0x4d8f('0x32')],function(_0x5ef66a){var _0x142c08={};_0x142c08[_0x5ef66a]={'$like':'%'+_0x407824[_0x4d8f('0x2e')][_0x4d8f('0x3b')]+'%'};return _0x142c08;})});}_0x260d9f=_[_0x4d8f('0x3c')]({},_0x260d9f,_0x407824[_0x4d8f('0x3e')]);return _0x509a31[_0x4d8f('0x4d')](_0x260d9f);}})[_0x4d8f('0x25')](function(_0x535eb9){if(_0x535eb9){_0x4cedce=_0x535eb9[_0x4d8f('0x34')];if(!_0x407824[_0x4d8f('0x2e')][_0x4d8f('0x35')](_0x4d8f('0x36'))){_0x260d9f['limit']=qs[_0x4d8f('0x1e')](_0x407824[_0x4d8f('0x2e')][_0x4d8f('0x1e')]);_0x260d9f[_0x4d8f('0x1c')]=qs[_0x4d8f('0x1c')](_0x407824['query'][_0x4d8f('0x1c')]);}return _0x509a31[_0x4d8f('0x4d')](_0x260d9f);}})['then'](function(_0x4c7d7a){if(_0x4c7d7a){return _0x4c7d7a?{'count':_0x4cedce,'rows':_0x4c7d7a}:null;}})[_0x4d8f('0x25')](respondWithResult(_0x3c1ae3,null))[_0x4d8f('0x42')](handleError(_0x3c1ae3,null));};exports[_0x4d8f('0x4e')]=function(_0x4683cd,_0x28c1c2,_0x5e226c){var _0x3d8285={};var _0x42ad4d={};var _0x294a49;var _0x495a7f;return db[_0x4d8f('0x40')][_0x4d8f('0x4a')]({'where':{'id':_0x4683cd[_0x4d8f('0x44')]['id']}})[_0x4d8f('0x25')](handleEntityNotFound(_0x28c1c2,null))[_0x4d8f('0x25')](function(_0x89aaea){if(_0x89aaea){_0x294a49=_0x89aaea;_0x42ad4d[_0x4d8f('0x2d')]=_[_0x4d8f('0x2f')](db[_0x4d8f('0x4f')][_0x4d8f('0x45')]);_0x42ad4d[_0x4d8f('0x2e')]=_[_0x4d8f('0x2f')](_0x4683cd['query']);_0x42ad4d[_0x4d8f('0x30')]=_[_0x4d8f('0x31')](_0x42ad4d['model'],_0x42ad4d['query']);_0x3d8285[_0x4d8f('0x32')]=_[_0x4d8f('0x31')](_0x42ad4d[_0x4d8f('0x2d')],qs['fields'](_0x4683cd[_0x4d8f('0x2e')][_0x4d8f('0x33')]));_0x3d8285[_0x4d8f('0x32')]=_0x3d8285[_0x4d8f('0x32')][_0x4d8f('0x34')]?_0x3d8285['attributes']:_0x42ad4d['model'];_0x3d8285['order']=qs['sort'](_0x4683cd[_0x4d8f('0x2e')][_0x4d8f('0x38')]);_0x3d8285[_0x4d8f('0x39')]=qs[_0x4d8f('0x30')](_[_0x4d8f('0x3a')](_0x4683cd[_0x4d8f('0x2e')],_0x42ad4d[_0x4d8f('0x30')]));if(_0x4683cd[_0x4d8f('0x2e')][_0x4d8f('0x3b')]){_0x3d8285[_0x4d8f('0x39')]=_[_0x4d8f('0x3c')](_0x3d8285[_0x4d8f('0x39')],{'$or':_[_0x4d8f('0x2b')](_0x3d8285[_0x4d8f('0x32')],function(_0x1aa687){var _0x322a84={};_0x322a84[_0x1aa687]={'$like':'%'+_0x4683cd[_0x4d8f('0x2e')][_0x4d8f('0x3b')]+'%'};return _0x322a84;})});}_0x3d8285=_[_0x4d8f('0x3c')]({},_0x3d8285,_0x4683cd['options']);return _0x294a49[_0x4d8f('0x4e')](_0x3d8285);}})['then'](function(_0x444748){if(_0x444748){_0x495a7f=_0x444748[_0x4d8f('0x34')];if(!_0x4683cd[_0x4d8f('0x2e')]['hasOwnProperty'](_0x4d8f('0x36'))){_0x3d8285['limit']=qs[_0x4d8f('0x1e')](_0x4683cd[_0x4d8f('0x2e')][_0x4d8f('0x1e')]);_0x3d8285[_0x4d8f('0x1c')]=qs['offset'](_0x4683cd['query'][_0x4d8f('0x1c')]);}return _0x294a49['getTags'](_0x3d8285);}})[_0x4d8f('0x25')](function(_0x44ed84){if(_0x44ed84){return _0x44ed84?{'count':_0x495a7f,'rows':_0x44ed84}:null;}})[_0x4d8f('0x25')](respondWithResult(_0x28c1c2,null))['catch'](handleError(_0x28c1c2,null));};exports['setTags']=function(_0x432a54,_0x3d0bc6,_0x334d7a){if(_0x432a54[_0x4d8f('0x48')]['id']){delete _0x432a54[_0x4d8f('0x48')]['id'];}return db['DeskConfiguration'][_0x4d8f('0x4a')]({'where':{'id':_0x432a54[_0x4d8f('0x44')]['id']}})['then'](handleEntityNotFound(_0x3d0bc6,null))[_0x4d8f('0x25')](function(_0x2120ab){if(_0x2120ab){return _0x2120ab['setTags'](_0x432a54[_0x4d8f('0x48')][_0x4d8f('0x50')]||[]);}return null;})[_0x4d8f('0x25')](respondWithResult(_0x3d0bc6,null))[_0x4d8f('0x42')](handleError(_0x3d0bc6,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 2b3eff3..b7a7f31 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 _0xe422=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','DeskConfiguration','lodash','util'];(function(_0x39e914,_0xb02b2a){var _0x4c66b1=function(_0x3f16c9){while(--_0x3f16c9){_0x39e914['push'](_0x39e914['shift']());}};_0x4c66b1(++_0xb02b2a);}(_0xe422,0x1ab));var _0x2e42=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xe422[_0x2f45ea];return _0x485a84;};'use strict';var _=require(_0x2e42('0x0'));var util=require(_0x2e42('0x1'));var logger=require(_0x2e42('0x2'))(_0x2e42('0x3'));var moment=require(_0x2e42('0x4'));var BPromise=require(_0x2e42('0x5'));var rp=require(_0x2e42('0x6'));var fs=require('fs');var path=require(_0x2e42('0x7'));var rimraf=require(_0x2e42('0x8'));var config=require(_0x2e42('0x9'));var attributes=require('./intDeskConfiguration.attributes');module[_0x2e42('0xa')]=function(_0x33f09d,_0x1dbb68){return _0x33f09d[_0x2e42('0xb')](_0x2e42('0xc'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6e6=['request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','define','int_desk_configurations','lodash','../../config/logger','bluebird'];(function(_0x216edc,_0x57df05){var _0x745d3e=function(_0x2b1bf8){while(--_0x2b1bf8){_0x216edc['push'](_0x216edc['shift']());}};_0x745d3e(++_0x57df05);}(_0xa6e6,0x183));var _0x6a6e=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0xa6e6[_0x576170];return _0x397c70;};'use strict';var _=require(_0x6a6e('0x0'));var util=require('util');var logger=require(_0x6a6e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6a6e('0x2'));var rp=require(_0x6a6e('0x3'));var fs=require('fs');var path=require(_0x6a6e('0x4'));var rimraf=require(_0x6a6e('0x5'));var config=require(_0x6a6e('0x6'));var attributes=require(_0x6a6e('0x7'));module['exports']=function(_0xfc4153,_0x86f68c){return _0xfc4153[_0x6a6e('0x8')]('DeskConfiguration',attributes,{'tableName':_0x6a6e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 6006912..b458af6 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 _0x19cb=['message','result','catch','util','moment','randomstring','../../mysqldb','../../config/environment','jayson/promise','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x36bb8c,_0x2d9109){var _0x506570=function(_0x24848f){while(--_0x24848f){_0x36bb8c['push'](_0x36bb8c['shift']());}};_0x506570(++_0x2d9109);}(_0x19cb,0x146));var _0xb19c=function(_0x43e878,_0x4e5fda){_0x43e878=_0x43e878-0x0;var _0x2b45d3=_0x19cb[_0x43e878];return _0x2b45d3;};'use strict';var _=require('lodash');var util=require(_0xb19c('0x0'));var moment=require(_0xb19c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb19c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb19c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb19c('0x4'));var jayson=require(_0xb19c('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d6a30,_0x477ac1,_0x35c200){return new BPromise(function(_0x262354,_0x5d50d4){return client['request'](_0x2d6a30,_0x35c200)[_0xb19c('0x6')](function(_0x3ffb45){logger[_0xb19c('0x7')](_0xb19c('0x8'),_0x477ac1,_0xb19c('0x9'));logger['debug'](_0xb19c('0xa'),_0x477ac1,_0xb19c('0x9'),JSON[_0xb19c('0xb')](_0x3ffb45));if(_0x3ffb45[_0xb19c('0xc')]){if(_0x3ffb45[_0xb19c('0xc')][_0xb19c('0xd')]===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x477ac1,_0x3ffb45['error'][_0xb19c('0xe')]);return _0x5d50d4(_0x3ffb45[_0xb19c('0xc')][_0xb19c('0xe')]);}logger['error'](_0xb19c('0x8'),_0x477ac1,_0x3ffb45[_0xb19c('0xc')][_0xb19c('0xe')]);return _0x262354(_0x3ffb45['error'][_0xb19c('0xe')]);}else{logger['info'](_0xb19c('0x8'),_0x477ac1,_0xb19c('0x9'));_0x262354(_0x3ffb45[_0xb19c('0xf')][_0xb19c('0xe')]);}})[_0xb19c('0x10')](function(_0x5bae0a){logger[_0xb19c('0xc')](_0xb19c('0x8'),_0x477ac1,_0x5bae0a);_0x5d50d4(_0x5bae0a);});});} \ No newline at end of file +var _0xb01c=['stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x371ffa,_0x2b8650){var _0x515a92=function(_0x26a714){while(--_0x26a714){_0x371ffa['push'](_0x371ffa['shift']());}};_0x515a92(++_0x2b8650);}(_0xb01c,0xbe));var _0xcb01=function(_0x395587,_0xf0b3b6){_0x395587=_0x395587-0x0;var _0x21b425=_0xb01c[_0x395587];return _0x21b425;};'use strict';var _=require(_0xcb01('0x0'));var util=require('util');var moment=require(_0xcb01('0x1'));var BPromise=require(_0xcb01('0x2'));var rs=require(_0xcb01('0x3'));var fs=require('fs');var Redis=require(_0xcb01('0x4'));var db=require(_0xcb01('0x5'))['db'];var utils=require(_0xcb01('0x6'));var logger=require(_0xcb01('0x7'))('rpc');var config=require(_0xcb01('0x8'));var jayson=require(_0xcb01('0x9'));var client=jayson[_0xcb01('0xa')][_0xcb01('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x357bf9,_0xc52f89,_0x370bf7){return new BPromise(function(_0x57f028,_0x3d0571){return client[_0xcb01('0xc')](_0x357bf9,_0x370bf7)[_0xcb01('0xd')](function(_0xdc4c5d){logger['info'](_0xcb01('0xe'),_0xc52f89,_0xcb01('0xf'));logger[_0xcb01('0x10')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0xc52f89,_0xcb01('0xf'),JSON[_0xcb01('0x11')](_0xdc4c5d));if(_0xdc4c5d[_0xcb01('0x12')]){if(_0xdc4c5d[_0xcb01('0x12')][_0xcb01('0x13')]===0x1f4){logger['error'](_0xcb01('0xe'),_0xc52f89,_0xdc4c5d[_0xcb01('0x12')][_0xcb01('0x14')]);return _0x3d0571(_0xdc4c5d[_0xcb01('0x12')][_0xcb01('0x14')]);}logger[_0xcb01('0x12')](_0xcb01('0xe'),_0xc52f89,_0xdc4c5d[_0xcb01('0x12')][_0xcb01('0x14')]);return _0x57f028(_0xdc4c5d[_0xcb01('0x12')][_0xcb01('0x14')]);}else{logger[_0xcb01('0x15')]('DeskConfiguration,\x20%s,\x20%s',_0xc52f89,'request\x20sent');_0x57f028(_0xdc4c5d['result'][_0xcb01('0x14')]);}})[_0xcb01('0x16')](function(_0x50aef4){logger['error'](_0xcb01('0xe'),_0xc52f89,_0x50aef4);_0x3d0571(_0x50aef4);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 62ef764..2035b72 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 _0x767b=['show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x767b,0xd0));var _0xb767=function(_0x3cb21e,_0x11849a){_0x3cb21e=_0x3cb21e-0x0;var _0xeacd6a=_0x767b[_0x3cb21e];return _0xeacd6a;};'use strict';var multer=require(_0xb767('0x0'));var util=require(_0xb767('0x1'));var path=require(_0xb767('0x2'));var timeout=require(_0xb767('0x3'));var express=require(_0xb767('0x4'));var router=express[_0xb767('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb767('0x6'));var config=require('../../config/environment');var controller=require(_0xb767('0x7'));router[_0xb767('0x8')]('/',auth[_0xb767('0x9')](),controller[_0xb767('0xa')]);router[_0xb767('0x8')](_0xb767('0xb'),auth[_0xb767('0x9')](),controller[_0xb767('0xc')]);router[_0xb767('0xd')]('/',auth[_0xb767('0x9')](),controller[_0xb767('0xe')]);router[_0xb767('0xf')](_0xb767('0xb'),auth['isAuthenticated'](),controller[_0xb767('0x10')]);router[_0xb767('0x11')](_0xb767('0xb'),auth[_0xb767('0x9')](),controller[_0xb767('0x12')]);module[_0xb767('0x13')]=router; \ No newline at end of file +var _0xc033=['/:id','show','post','create','update','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','get'];(function(_0x364db3,_0x24a4b8){var _0x65d39a=function(_0x18443a){while(--_0x18443a){_0x364db3['push'](_0x364db3['shift']());}};_0x65d39a(++_0x24a4b8);}(_0xc033,0xd3));var _0x3c03=function(_0x40a0ca,_0x1193ed){_0x40a0ca=_0x40a0ca-0x0;var _0x59da70=_0xc033[_0x40a0ca];return _0x59da70;};'use strict';var multer=require(_0x3c03('0x0'));var util=require(_0x3c03('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3c03('0x2'));var router=express['Router']();var fs_extra=require(_0x3c03('0x3'));var auth=require(_0x3c03('0x4'));var interaction=require(_0x3c03('0x5'));var config=require(_0x3c03('0x6'));var controller=require(_0x3c03('0x7'));router['get']('/',auth[_0x3c03('0x8')](),controller['index']);router[_0x3c03('0x9')](_0x3c03('0xa'),auth['isAuthenticated'](),controller[_0x3c03('0xb')]);router[_0x3c03('0xc')]('/',auth[_0x3c03('0x8')](),controller[_0x3c03('0xd')]);router['put']('/:id',auth[_0x3c03('0x8')](),controller[_0x3c03('0xe')]);router['delete'](_0x3c03('0xa'),auth[_0x3c03('0x8')](),controller[_0x3c03('0xf')]);module[_0x3c03('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index bd225f1..17a0631 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 _0x5c4f=['customVariable','keyValue','picklist','string','STRING','ENUM','BOOLEAN','sequelize','exports','variable'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x5c4f,0x1dd));var _0xf5c4=function(_0x398eeb,_0x4908d8){_0x398eeb=_0x398eeb-0x0;var _0x500dc9=_0x5c4f[_0x398eeb];return _0x500dc9;};'use strict';var Sequelize=require(_0xf5c4('0x0'));module[_0xf5c4('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xf5c4('0x2'),_0xf5c4('0x3'),_0xf5c4('0x4'),_0xf5c4('0x5')),'defaultValue':_0xf5c4('0x6')},'content':{'type':Sequelize[_0xf5c4('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf5c4('0x8')](_0xf5c4('0x6'),_0xf5c4('0x2'),_0xf5c4('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf5c4('0x7')]},'nameField':{'type':Sequelize[_0xf5c4('0x7')]},'customField':{'type':Sequelize[_0xf5c4('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf5c4('0x7')]}}; \ No newline at end of file +var _0x4920=['customVariable','picklist','STRING','ENUM','BOOLEAN','exports','string','variable'];(function(_0x3ba36a,_0xe50f9d){var _0x42ee88=function(_0x11da0a){while(--_0x11da0a){_0x3ba36a['push'](_0x3ba36a['shift']());}};_0x42ee88(++_0xe50f9d);}(_0x4920,0x1ed));var _0x0492=function(_0x517c9e,_0x1944b4){_0x517c9e=_0x517c9e-0x0;var _0x173257=_0x4920[_0x517c9e];return _0x173257;};'use strict';var Sequelize=require('sequelize');module[_0x0492('0x0')]={'type':{'type':Sequelize['ENUM'](_0x0492('0x1'),_0x0492('0x2'),_0x0492('0x3'),'keyValue',_0x0492('0x4')),'defaultValue':_0x0492('0x1')},'content':{'type':Sequelize[_0x0492('0x5')]},'key':{'type':Sequelize[_0x0492('0x5')]},'keyType':{'type':Sequelize[_0x0492('0x6')]('string',_0x0492('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x0492('0x5')]},'idField':{'type':Sequelize[_0x0492('0x5')]},'nameField':{'type':Sequelize[_0x0492('0x5')]},'customField':{'type':Sequelize[_0x0492('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0492('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 13341cb..f27c509 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 _0xa68e=['querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','error','stack','name','send','index','DeskField','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x4fbbe3,_0x121d85){var _0x93068f=function(_0x56c9c9){while(--_0x56c9c9){_0x4fbbe3['push'](_0x4fbbe3['shift']());}};_0x93068f(++_0x121d85);}(_0xa68e,0xd3));var _0xea68=function(_0x2383f7,_0x53e3ca){_0x2383f7=_0x2383f7-0x0;var _0x1432c6=_0xa68e[_0x2383f7];return _0x1432c6;};'use strict';var emlformat=require(_0xea68('0x0'));var rimraf=require(_0xea68('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea68('0x2'));var rp=require(_0xea68('0x3'));var moment=require(_0xea68('0x4'));var BPromise=require(_0xea68('0x5'));var Mustache=require(_0xea68('0x6'));var util=require(_0xea68('0x7'));var path=require(_0xea68('0x8'));var sox=require(_0xea68('0x9'));var csv=require(_0xea68('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea68('0xb'));var _=require(_0xea68('0xc'));var squel=require(_0xea68('0xd'));var crypto=require(_0xea68('0xe'));var jsforce=require(_0xea68('0xf'));var deskjs=require(_0xea68('0x10'));var toCsv=require(_0xea68('0xa'));var querystring=require(_0xea68('0x11'));var Papa=require(_0xea68('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xea68('0x13'));var hardwareService=require(_0xea68('0x14'));var logger=require('../../config/logger')(_0xea68('0x15'));var utils=require(_0xea68('0x16'));var config=require(_0xea68('0x17'));var licenseUtil=require(_0xea68('0x18'));var db=require(_0xea68('0x19'))['db'];function respondWithStatusCode(_0x82f070,_0x36c239){_0x36c239=_0x36c239||0xcc;return function(_0x1e73d3){if(_0x1e73d3){return _0x82f070[_0xea68('0x1a')](_0x36c239);}return _0x82f070[_0xea68('0x1b')](_0x36c239)[_0xea68('0x1c')]();};}function respondWithResult(_0x540a23,_0x17bd4a){_0x17bd4a=_0x17bd4a||0xc8;return function(_0x5d460c){if(_0x5d460c){return _0x540a23[_0xea68('0x1b')](_0x17bd4a)[_0xea68('0x1d')](_0x5d460c);}};}function respondWithFilteredResult(_0x4f0b72,_0x4b520a){return function(_0x3f591d){if(_0x3f591d){var _0x1d1ae5=typeof _0x4b520a[_0xea68('0x1e')]===_0xea68('0x1f')&&typeof _0x4b520a[_0xea68('0x20')]===_0xea68('0x1f');var _0x255cfb=_0x3f591d[_0xea68('0x21')];var _0x38cb81=_0x1d1ae5?0x0:_0x4b520a[_0xea68('0x1e')];var _0x4cc7e6=_0x1d1ae5?_0x3f591d['count']:_0x4b520a['offset']+_0x4b520a[_0xea68('0x20')];var _0x43cbbe;if(_0x4cc7e6>=_0x255cfb){_0x4cc7e6=_0x255cfb;_0x43cbbe=0xc8;}else{_0x43cbbe=0xce;}_0x4f0b72[_0xea68('0x1b')](_0x43cbbe);return _0x4f0b72['set']('Content-Range',_0x38cb81+'-'+_0x4cc7e6+'/'+_0x255cfb)[_0xea68('0x1d')](_0x3f591d);}return null;};}function patchUpdates(_0x48f636){return function(_0x28e643){try{jsonpatch[_0xea68('0x22')](_0x28e643,_0x48f636,!![]);}catch(_0x1d2eb5){return BPromise[_0xea68('0x23')](_0x1d2eb5);}return _0x28e643['save']();};}function saveUpdates(_0x5033bf,_0x39bcfa){return function(_0x5e7cf1){if(_0x5e7cf1){return _0x5e7cf1[_0xea68('0x24')](_0x5033bf)[_0xea68('0x25')](function(_0x1744f3){return _0x1744f3;});}return null;};}function removeEntity(_0x577d0a,_0x151a69){return function(_0x42aa24){if(_0x42aa24){return _0x42aa24[_0xea68('0x26')]()[_0xea68('0x25')](function(){_0x577d0a[_0xea68('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f1d0e,_0x2d0029){return function(_0x19e327){if(!_0x19e327){_0x2f1d0e[_0xea68('0x1a')](0x194);}return _0x19e327;};}function handleError(_0x24fdf5,_0x2a0ff5){_0x2a0ff5=_0x2a0ff5||0x1f4;return function(_0x277948){logger[_0xea68('0x27')](_0x277948[_0xea68('0x28')]);if(_0x277948[_0xea68('0x29')]){delete _0x277948[_0xea68('0x29')];}_0x24fdf5['status'](_0x2a0ff5)[_0xea68('0x2a')](_0x277948);};}exports[_0xea68('0x2b')]=function(_0x36384e,_0xe0879e){var _0x481eb3={},_0x8c72ed={},_0x54ce75={'count':0x0,'rows':[]};var _0x17ef94=_['map'](db[_0xea68('0x2c')][_0xea68('0x2d')],function(_0x33c3c3){return{'name':_0x33c3c3[_0xea68('0x2e')],'type':_0x33c3c3['type'][_0xea68('0x2f')]};});_0x8c72ed[_0xea68('0x30')]=_[_0xea68('0x31')](_0x17ef94,_0xea68('0x29'));_0x8c72ed[_0xea68('0x32')]=_[_0xea68('0x33')](_0x36384e[_0xea68('0x32')]);_0x8c72ed[_0xea68('0x34')]=_[_0xea68('0x35')](_0x8c72ed['model'],_0x8c72ed[_0xea68('0x32')]);_0x481eb3['attributes']=_[_0xea68('0x35')](_0x8c72ed[_0xea68('0x30')],qs[_0xea68('0x36')](_0x36384e[_0xea68('0x32')][_0xea68('0x36')]));_0x481eb3['attributes']=_0x481eb3[_0xea68('0x37')][_0xea68('0x38')]?_0x481eb3['attributes']:_0x8c72ed[_0xea68('0x30')];if(!_0x36384e[_0xea68('0x32')][_0xea68('0x39')](_0xea68('0x3a'))){_0x481eb3['limit']=qs['limit'](_0x36384e[_0xea68('0x32')]['limit']);_0x481eb3[_0xea68('0x1e')]=qs['offset'](_0x36384e[_0xea68('0x32')][_0xea68('0x1e')]);}_0x481eb3[_0xea68('0x3b')]=qs['sort'](_0x36384e['query'][_0xea68('0x3c')]);_0x481eb3['where']=qs[_0xea68('0x34')](_[_0xea68('0x3d')](_0x36384e['query'],_0x8c72ed[_0xea68('0x34')]),_0x17ef94);if(_0x36384e['query'][_0xea68('0x3e')]){_0x481eb3[_0xea68('0x3f')]=_[_0xea68('0x40')](_0x481eb3[_0xea68('0x3f')],{'$or':_['map'](_0x17ef94,function(_0x3f92a3){if(_0x3f92a3['type']!==_0xea68('0x41')){var _0x5314c2={};_0x5314c2[_0x3f92a3[_0xea68('0x29')]]={'$like':'%'+_0x36384e[_0xea68('0x32')][_0xea68('0x3e')]+'%'};return _0x5314c2;}})});}_0x481eb3=_['merge']({},_0x481eb3,_0x36384e['options']);var _0x41852e={'where':_0x481eb3[_0xea68('0x3f')]};return db[_0xea68('0x2c')][_0xea68('0x21')](_0x41852e)[_0xea68('0x25')](function(_0x264f0f){_0x54ce75['count']=_0x264f0f;if(_0x36384e['query'][_0xea68('0x42')]){_0x481eb3['include']=[{'all':!![]}];}return db[_0xea68('0x2c')][_0xea68('0x43')](_0x481eb3);})[_0xea68('0x25')](function(_0x3f04c4){_0x54ce75[_0xea68('0x44')]=_0x3f04c4;return _0x54ce75;})['then'](respondWithFilteredResult(_0xe0879e,_0x481eb3))[_0xea68('0x45')](handleError(_0xe0879e,null));};exports[_0xea68('0x46')]=function(_0x4c1db7,_0x35634a){var _0x461b8b={'raw':!![],'where':{'id':_0x4c1db7[_0xea68('0x47')]['id']}},_0xb99c04={};_0xb99c04[_0xea68('0x30')]=_[_0xea68('0x33')](db[_0xea68('0x2c')][_0xea68('0x2d')]);_0xb99c04[_0xea68('0x32')]=_['keys'](_0x4c1db7[_0xea68('0x32')]);_0xb99c04['filters']=_[_0xea68('0x35')](_0xb99c04[_0xea68('0x30')],_0xb99c04['query']);_0x461b8b[_0xea68('0x37')]=_['intersection'](_0xb99c04[_0xea68('0x30')],qs[_0xea68('0x36')](_0x4c1db7[_0xea68('0x32')]['fields']));_0x461b8b['attributes']=_0x461b8b['attributes']['length']?_0x461b8b['attributes']:_0xb99c04[_0xea68('0x30')];if(_0x4c1db7[_0xea68('0x32')]['includeAll']){_0x461b8b['include']=[{'all':!![]}];}_0x461b8b=_[_0xea68('0x40')]({},_0x461b8b,_0x4c1db7[_0xea68('0x48')]);return db[_0xea68('0x2c')][_0xea68('0x49')](_0x461b8b)[_0xea68('0x25')](handleEntityNotFound(_0x35634a,null))[_0xea68('0x25')](respondWithResult(_0x35634a,null))[_0xea68('0x45')](handleError(_0x35634a,null));};exports[_0xea68('0x4a')]=function(_0x3ee5ea,_0x1b0249){return db['DeskField'][_0xea68('0x4a')](_0x3ee5ea['body'],{})[_0xea68('0x25')](respondWithResult(_0x1b0249,0xc9))[_0xea68('0x45')](handleError(_0x1b0249,null));};exports[_0xea68('0x24')]=function(_0x1f9c45,_0x1b17f1){if(_0x1f9c45[_0xea68('0x4b')]['id']){delete _0x1f9c45[_0xea68('0x4b')]['id'];}return db[_0xea68('0x2c')][_0xea68('0x49')]({'where':{'id':_0x1f9c45['params']['id']}})[_0xea68('0x25')](handleEntityNotFound(_0x1b17f1,null))['then'](saveUpdates(_0x1f9c45['body'],null))[_0xea68('0x25')](respondWithResult(_0x1b17f1,null))['catch'](handleError(_0x1b17f1,null));};exports[_0xea68('0x26')]=function(_0x4dd956,_0x605ba0){return db['DeskField'][_0xea68('0x49')]({'where':{'id':_0x4dd956[_0xea68('0x47')]['id']}})[_0xea68('0x25')](handleEntityNotFound(_0x605ba0,null))[_0xea68('0x25')](removeEntity(_0x605ba0,null))['catch'](handleError(_0x605ba0,null));}; \ No newline at end of file +var _0x9b97=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','DeskField','includeAll','include','findAll','rows','rawAttributes','keys','intersection','length','find','catch','create','body','params','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x9b97,0x11e));var _0x79b9=function(_0x1ecd1a,_0x645374){_0x1ecd1a=_0x1ecd1a-0x0;var _0x2b681c=_0x9b97[_0x1ecd1a];return _0x2b681c;};'use strict';var emlformat=require(_0x79b9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x79b9('0x1'));var jsonpatch=require(_0x79b9('0x2'));var rp=require(_0x79b9('0x3'));var moment=require(_0x79b9('0x4'));var BPromise=require(_0x79b9('0x5'));var Mustache=require(_0x79b9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x79b9('0x7'));var csv=require(_0x79b9('0x8'));var ejs=require(_0x79b9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x79b9('0xa'));var squel=require(_0x79b9('0xb'));var crypto=require('crypto');var jsforce=require(_0x79b9('0xc'));var deskjs=require(_0x79b9('0xd'));var toCsv=require(_0x79b9('0x8'));var querystring=require(_0x79b9('0xe'));var Papa=require(_0x79b9('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x79b9('0x10'));var as=require(_0x79b9('0x11'));var hardwareService=require(_0x79b9('0x12'));var logger=require(_0x79b9('0x13'))(_0x79b9('0x14'));var utils=require(_0x79b9('0x15'));var config=require(_0x79b9('0x16'));var licenseUtil=require(_0x79b9('0x17'));var db=require(_0x79b9('0x18'))['db'];function respondWithStatusCode(_0xc0f6ae,_0x3f0a9e){_0x3f0a9e=_0x3f0a9e||0xcc;return function(_0x51682c){if(_0x51682c){return _0xc0f6ae[_0x79b9('0x19')](_0x3f0a9e);}return _0xc0f6ae[_0x79b9('0x1a')](_0x3f0a9e)['end']();};}function respondWithResult(_0x548f65,_0x4f90fe){_0x4f90fe=_0x4f90fe||0xc8;return function(_0x2e175d){if(_0x2e175d){return _0x548f65[_0x79b9('0x1a')](_0x4f90fe)[_0x79b9('0x1b')](_0x2e175d);}};}function respondWithFilteredResult(_0xbf8150,_0x398977){return function(_0x4fad8e){if(_0x4fad8e){var _0x4e465a=typeof _0x398977[_0x79b9('0x1c')]===_0x79b9('0x1d')&&typeof _0x398977[_0x79b9('0x1e')]===_0x79b9('0x1d');var _0x5917ab=_0x4fad8e[_0x79b9('0x1f')];var _0x621505=_0x4e465a?0x0:_0x398977['offset'];var _0x54dc9d=_0x4e465a?_0x4fad8e[_0x79b9('0x1f')]:_0x398977['offset']+_0x398977['limit'];var _0x5e1572;if(_0x54dc9d>=_0x5917ab){_0x54dc9d=_0x5917ab;_0x5e1572=0xc8;}else{_0x5e1572=0xce;}_0xbf8150[_0x79b9('0x1a')](_0x5e1572);return _0xbf8150[_0x79b9('0x20')]('Content-Range',_0x621505+'-'+_0x54dc9d+'/'+_0x5917ab)[_0x79b9('0x1b')](_0x4fad8e);}return null;};}function patchUpdates(_0x26f60c){return function(_0x2de174){try{jsonpatch[_0x79b9('0x21')](_0x2de174,_0x26f60c,!![]);}catch(_0x58b88c){return BPromise[_0x79b9('0x22')](_0x58b88c);}return _0x2de174[_0x79b9('0x23')]();};}function saveUpdates(_0x16cb83,_0x25006f){return function(_0x2dcf13){if(_0x2dcf13){return _0x2dcf13[_0x79b9('0x24')](_0x16cb83)[_0x79b9('0x25')](function(_0x50d357){return _0x50d357;});}return null;};}function removeEntity(_0xdd133f,_0x2399fa){return function(_0x495971){if(_0x495971){return _0x495971['destroy']()[_0x79b9('0x25')](function(){_0xdd133f[_0x79b9('0x1a')](0xcc)[_0x79b9('0x26')]();});}};}function handleEntityNotFound(_0x59ae09,_0x2ee1e4){return function(_0x3fd9d2){if(!_0x3fd9d2){_0x59ae09[_0x79b9('0x19')](0x194);}return _0x3fd9d2;};}function handleError(_0xa213d3,_0x400677){_0x400677=_0x400677||0x1f4;return function(_0x186764){logger[_0x79b9('0x27')](_0x186764[_0x79b9('0x28')]);if(_0x186764[_0x79b9('0x29')]){delete _0x186764[_0x79b9('0x29')];}_0xa213d3[_0x79b9('0x1a')](_0x400677)[_0x79b9('0x2a')](_0x186764);};}exports[_0x79b9('0x2b')]=function(_0x1bfadb,_0x322d7e){var _0x8f0513={},_0x12d87e={},_0x1d307f={'count':0x0,'rows':[]};var _0x531e7f=_[_0x79b9('0x2c')](db['DeskField']['rawAttributes'],function(_0x4edc64){return{'name':_0x4edc64[_0x79b9('0x2d')],'type':_0x4edc64[_0x79b9('0x2e')][_0x79b9('0x2f')]};});_0x12d87e[_0x79b9('0x30')]=_['map'](_0x531e7f,'name');_0x12d87e[_0x79b9('0x31')]=_['keys'](_0x1bfadb['query']);_0x12d87e[_0x79b9('0x32')]=_['intersection'](_0x12d87e[_0x79b9('0x30')],_0x12d87e[_0x79b9('0x31')]);_0x8f0513['attributes']=_['intersection'](_0x12d87e[_0x79b9('0x30')],qs[_0x79b9('0x33')](_0x1bfadb[_0x79b9('0x31')][_0x79b9('0x33')]));_0x8f0513[_0x79b9('0x34')]=_0x8f0513['attributes']['length']?_0x8f0513['attributes']:_0x12d87e[_0x79b9('0x30')];if(!_0x1bfadb[_0x79b9('0x31')][_0x79b9('0x35')](_0x79b9('0x36'))){_0x8f0513[_0x79b9('0x1e')]=qs[_0x79b9('0x1e')](_0x1bfadb[_0x79b9('0x31')]['limit']);_0x8f0513[_0x79b9('0x1c')]=qs['offset'](_0x1bfadb[_0x79b9('0x31')][_0x79b9('0x1c')]);}_0x8f0513[_0x79b9('0x37')]=qs['sort'](_0x1bfadb[_0x79b9('0x31')][_0x79b9('0x38')]);_0x8f0513[_0x79b9('0x39')]=qs[_0x79b9('0x32')](_['pick'](_0x1bfadb['query'],_0x12d87e[_0x79b9('0x32')]),_0x531e7f);if(_0x1bfadb[_0x79b9('0x31')][_0x79b9('0x3a')]){_0x8f0513[_0x79b9('0x39')]=_['merge'](_0x8f0513[_0x79b9('0x39')],{'$or':_['map'](_0x531e7f,function(_0x5e71f2){if(_0x5e71f2[_0x79b9('0x2e')]!==_0x79b9('0x3b')){var _0x4d5187={};_0x4d5187[_0x5e71f2[_0x79b9('0x29')]]={'$like':'%'+_0x1bfadb[_0x79b9('0x31')][_0x79b9('0x3a')]+'%'};return _0x4d5187;}})});}_0x8f0513=_[_0x79b9('0x3c')]({},_0x8f0513,_0x1bfadb[_0x79b9('0x3d')]);var _0x5bc1de={'where':_0x8f0513[_0x79b9('0x39')]};return db[_0x79b9('0x3e')]['count'](_0x5bc1de)['then'](function(_0x2eab0d){_0x1d307f[_0x79b9('0x1f')]=_0x2eab0d;if(_0x1bfadb['query'][_0x79b9('0x3f')]){_0x8f0513[_0x79b9('0x40')]=[{'all':!![]}];}return db[_0x79b9('0x3e')][_0x79b9('0x41')](_0x8f0513);})[_0x79b9('0x25')](function(_0xbabbce){_0x1d307f[_0x79b9('0x42')]=_0xbabbce;return _0x1d307f;})[_0x79b9('0x25')](respondWithFilteredResult(_0x322d7e,_0x8f0513))['catch'](handleError(_0x322d7e,null));};exports['show']=function(_0x53563c,_0xe21f32){var _0x1125ec={'raw':!![],'where':{'id':_0x53563c['params']['id']}},_0x17f05f={};_0x17f05f['model']=_['keys'](db['DeskField'][_0x79b9('0x43')]);_0x17f05f[_0x79b9('0x31')]=_[_0x79b9('0x44')](_0x53563c[_0x79b9('0x31')]);_0x17f05f[_0x79b9('0x32')]=_['intersection'](_0x17f05f[_0x79b9('0x30')],_0x17f05f[_0x79b9('0x31')]);_0x1125ec[_0x79b9('0x34')]=_[_0x79b9('0x45')](_0x17f05f[_0x79b9('0x30')],qs[_0x79b9('0x33')](_0x53563c[_0x79b9('0x31')][_0x79b9('0x33')]));_0x1125ec[_0x79b9('0x34')]=_0x1125ec[_0x79b9('0x34')][_0x79b9('0x46')]?_0x1125ec[_0x79b9('0x34')]:_0x17f05f[_0x79b9('0x30')];if(_0x53563c[_0x79b9('0x31')][_0x79b9('0x3f')]){_0x1125ec[_0x79b9('0x40')]=[{'all':!![]}];}_0x1125ec=_[_0x79b9('0x3c')]({},_0x1125ec,_0x53563c[_0x79b9('0x3d')]);return db[_0x79b9('0x3e')][_0x79b9('0x47')](_0x1125ec)[_0x79b9('0x25')](handleEntityNotFound(_0xe21f32,null))[_0x79b9('0x25')](respondWithResult(_0xe21f32,null))[_0x79b9('0x48')](handleError(_0xe21f32,null));};exports[_0x79b9('0x49')]=function(_0x3f972e,_0xca2ca8){return db[_0x79b9('0x3e')]['create'](_0x3f972e[_0x79b9('0x4a')],{})[_0x79b9('0x25')](respondWithResult(_0xca2ca8,0xc9))['catch'](handleError(_0xca2ca8,null));};exports[_0x79b9('0x24')]=function(_0x5bc93f,_0x151cb0){if(_0x5bc93f['body']['id']){delete _0x5bc93f[_0x79b9('0x4a')]['id'];}return db[_0x79b9('0x3e')]['find']({'where':{'id':_0x5bc93f[_0x79b9('0x4b')]['id']}})[_0x79b9('0x25')](handleEntityNotFound(_0x151cb0,null))[_0x79b9('0x25')](saveUpdates(_0x5bc93f[_0x79b9('0x4a')],null))['then'](respondWithResult(_0x151cb0,null))[_0x79b9('0x48')](handleError(_0x151cb0,null));};exports[_0x79b9('0x4c')]=function(_0x1b8d57,_0x3fdde0){return db[_0x79b9('0x3e')][_0x79b9('0x47')]({'where':{'id':_0x1b8d57[_0x79b9('0x4b')]['id']}})[_0x79b9('0x25')](handleEntityNotFound(_0x3fdde0,null))['then'](removeEntity(_0x3fdde0,null))[_0x79b9('0x48')](handleError(_0x3fdde0,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index ced3083..7cfc407 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 _0x361a=['DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','exports'];(function(_0x4849f6,_0x104836){var _0x1a3dcd=function(_0x494d3c){while(--_0x494d3c){_0x4849f6['push'](_0x4849f6['shift']());}};_0x1a3dcd(++_0x104836);}(_0x361a,0xfc));var _0xa361=function(_0x56cc7d,_0x462750){_0x56cc7d=_0x56cc7d-0x0;var _0x49f3d6=_0x361a[_0x56cc7d];return _0x49f3d6;};'use strict';var _=require(_0xa361('0x0'));var util=require(_0xa361('0x1'));var logger=require(_0xa361('0x2'))(_0xa361('0x3'));var moment=require('moment');var BPromise=require(_0xa361('0x4'));var rp=require(_0xa361('0x5'));var fs=require('fs');var path=require(_0xa361('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0xa361('0x7')]=function(_0x528066,_0x4d29ec){return _0x528066['define'](_0xa361('0x8'),attributes,{'tableName':_0xa361('0x9'),'paranoid':![],'indexes':[{'name':_0xa361('0xa'),'fields':[_0xa361('0xb'),_0xa361('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x388c=['idField','FieldId','lodash','util','../../config/logger','api','bluebird','path','rimraf','exports','define','int_desk_fields','desk_unique_index'];(function(_0x211158,_0x5edf3c){var _0x197bef=function(_0x4da6c0){while(--_0x4da6c0){_0x211158['push'](_0x211158['shift']());}};_0x197bef(++_0x5edf3c);}(_0x388c,0xb8));var _0xc388=function(_0x3bfd91,_0x360af9){_0x3bfd91=_0x3bfd91-0x0;var _0x144324=_0x388c[_0x3bfd91];return _0x144324;};'use strict';var _=require(_0xc388('0x0'));var util=require(_0xc388('0x1'));var logger=require(_0xc388('0x2'))(_0xc388('0x3'));var moment=require('moment');var BPromise=require(_0xc388('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc388('0x5'));var rimraf=require(_0xc388('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0xc388('0x7')]=function(_0x163aa6,_0x39e17d){return _0x163aa6[_0xc388('0x8')]('DeskField',attributes,{'tableName':_0xc388('0x9'),'paranoid':![],'indexes':[{'name':_0xc388('0xa'),'fields':[_0xc388('0xb'),_0xc388('0xc')],'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 3f5bf98..bdcd3dc 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 _0x1707=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','DeskField,\x20%s,\x20%s','result','catch','lodash'];(function(_0x47964e,_0x452685){var _0x2af854=function(_0x1d0c0d){while(--_0x1d0c0d){_0x47964e['push'](_0x47964e['shift']());}};_0x2af854(++_0x452685);}(_0x1707,0x77));var _0x7170=function(_0x225ce1,_0x463907){_0x225ce1=_0x225ce1-0x0;var _0x50aca1=_0x1707[_0x225ce1];return _0x50aca1;};'use strict';var _=require(_0x7170('0x0'));var util=require('util');var moment=require(_0x7170('0x1'));var BPromise=require('bluebird');var rs=require(_0x7170('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7170('0x3'))['db'];var utils=require(_0x7170('0x4'));var logger=require(_0x7170('0x5'))(_0x7170('0x6'));var config=require(_0x7170('0x7'));var jayson=require(_0x7170('0x8'));var client=jayson[_0x7170('0x9')][_0x7170('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36feb8,_0x30f689,_0x4761a9){return new BPromise(function(_0x35c186,_0x13dc30){return client[_0x7170('0xb')](_0x36feb8,_0x4761a9)[_0x7170('0xc')](function(_0x44e074){logger['info']('DeskField,\x20%s,\x20%s',_0x30f689,_0x7170('0xd'));logger[_0x7170('0xe')](_0x7170('0xf'),_0x30f689,'request\x20sent',JSON[_0x7170('0x10')](_0x44e074));if(_0x44e074[_0x7170('0x11')]){if(_0x44e074['error'][_0x7170('0x12')]===0x1f4){logger[_0x7170('0x11')]('DeskField,\x20%s,\x20%s',_0x30f689,_0x44e074[_0x7170('0x11')][_0x7170('0x13')]);return _0x13dc30(_0x44e074[_0x7170('0x11')][_0x7170('0x13')]);}logger[_0x7170('0x11')]('DeskField,\x20%s,\x20%s',_0x30f689,_0x44e074[_0x7170('0x11')]['message']);return _0x35c186(_0x44e074[_0x7170('0x11')][_0x7170('0x13')]);}else{logger[_0x7170('0x14')](_0x7170('0x15'),_0x30f689,_0x7170('0xd'));_0x35c186(_0x44e074[_0x7170('0x16')][_0x7170('0x13')]);}})[_0x7170('0x17')](function(_0x1f1f6a){logger[_0x7170('0x11')](_0x7170('0x15'),_0x30f689,_0x1f1f6a);_0x13dc30(_0x1f1f6a);});});} \ No newline at end of file +var _0xec29=['http','request','then','info','request\x20sent','debug','stringify','error','code','DeskField,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x57494a,_0x3d5f2f){var _0x45e30f=function(_0x1d70da){while(--_0x1d70da){_0x57494a['push'](_0x57494a['shift']());}};_0x45e30f(++_0x3d5f2f);}(_0xec29,0xad));var _0x9ec2=function(_0x502043,_0x48ecc4){_0x502043=_0x502043-0x0;var _0x2ec3f2=_0xec29[_0x502043];return _0x2ec3f2;};'use strict';var _=require(_0x9ec2('0x0'));var util=require('util');var moment=require(_0x9ec2('0x1'));var BPromise=require(_0x9ec2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ec2('0x3'));var db=require(_0x9ec2('0x4'))['db'];var utils=require(_0x9ec2('0x5'));var logger=require(_0x9ec2('0x6'))(_0x9ec2('0x7'));var config=require(_0x9ec2('0x8'));var jayson=require(_0x9ec2('0x9'));var client=jayson[_0x9ec2('0xa')][_0x9ec2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52c08c,_0x4becbc,_0x149d1a){return new BPromise(function(_0x9cb02f,_0x22b0a2){return client[_0x9ec2('0xc')](_0x52c08c,_0x149d1a)[_0x9ec2('0xd')](function(_0x3af298){logger[_0x9ec2('0xe')]('DeskField,\x20%s,\x20%s',_0x4becbc,_0x9ec2('0xf'));logger[_0x9ec2('0x10')]('DeskField,\x20%s,\x20%s,\x20%s',_0x4becbc,_0x9ec2('0xf'),JSON[_0x9ec2('0x11')](_0x3af298));if(_0x3af298[_0x9ec2('0x12')]){if(_0x3af298[_0x9ec2('0x12')][_0x9ec2('0x13')]===0x1f4){logger[_0x9ec2('0x12')](_0x9ec2('0x14'),_0x4becbc,_0x3af298[_0x9ec2('0x12')][_0x9ec2('0x15')]);return _0x22b0a2(_0x3af298[_0x9ec2('0x12')]['message']);}logger['error'](_0x9ec2('0x14'),_0x4becbc,_0x3af298['error'][_0x9ec2('0x15')]);return _0x9cb02f(_0x3af298[_0x9ec2('0x12')][_0x9ec2('0x15')]);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x4becbc,_0x9ec2('0xf'));_0x9cb02f(_0x3af298['result']['message']);}})[_0x9ec2('0x16')](function(_0x1e88df){logger[_0x9ec2('0x12')](_0x9ec2('0x14'),_0x4becbc,_0x1e88df);_0x22b0a2(_0x1e88df);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 2e8da8c..59e2ba2 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 _0x17f2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0xf544dd,_0x33c7c8){var _0x1e130a=function(_0x3b38f8){while(--_0x3b38f8){_0xf544dd['push'](_0xf544dd['shift']());}};_0x1e130a(++_0x33c7c8);}(_0x17f2,0x173));var _0x217f=function(_0xa79977,_0x4f7f12){_0xa79977=_0xa79977-0x0;var _0x109f10=_0x17f2[_0xa79977];return _0x109f10;};'use strict';var multer=require(_0x217f('0x0'));var util=require(_0x217f('0x1'));var path=require(_0x217f('0x2'));var timeout=require(_0x217f('0x3'));var express=require(_0x217f('0x4'));var router=express[_0x217f('0x5')]();var fs_extra=require(_0x217f('0x6'));var auth=require(_0x217f('0x7'));var interaction=require(_0x217f('0x8'));var config=require(_0x217f('0x9'));var controller=require(_0x217f('0xa'));router[_0x217f('0xb')]('/',auth[_0x217f('0xc')](),controller['index']);router[_0x217f('0xb')](_0x217f('0xd'),auth[_0x217f('0xc')](),controller[_0x217f('0xe')]);router['get']('/:id/configurations',auth[_0x217f('0xc')](),controller[_0x217f('0xf')]);router[_0x217f('0xb')](_0x217f('0x10'),auth[_0x217f('0xc')](),controller[_0x217f('0x11')]);router[_0x217f('0x12')]('/',auth[_0x217f('0xc')](),controller[_0x217f('0x13')]);router['post'](_0x217f('0x14'),auth[_0x217f('0xc')](),controller[_0x217f('0x15')]);router[_0x217f('0x16')](_0x217f('0xd'),auth[_0x217f('0xc')](),controller[_0x217f('0x17')]);router[_0x217f('0x18')](_0x217f('0xd'),auth['isAuthenticated'](),controller[_0x217f('0x19')]);module[_0x217f('0x1a')]=router; \ No newline at end of file +var _0x9fea=['addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','post','create'];(function(_0x5edac0,_0x4140fb){var _0x194236=function(_0x209c22){while(--_0x209c22){_0x5edac0['push'](_0x5edac0['shift']());}};_0x194236(++_0x4140fb);}(_0x9fea,0xb5));var _0xa9fe=function(_0x5efb0e,_0x326332){_0x5efb0e=_0x5efb0e-0x0;var _0x3b75bb=_0x9fea[_0x5efb0e];return _0x3b75bb;};'use strict';var multer=require(_0xa9fe('0x0'));var util=require(_0xa9fe('0x1'));var path=require(_0xa9fe('0x2'));var timeout=require(_0xa9fe('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa9fe('0x4'));var auth=require(_0xa9fe('0x5'));var interaction=require(_0xa9fe('0x6'));var config=require('../../config/environment');var controller=require(_0xa9fe('0x7'));router[_0xa9fe('0x8')]('/',auth[_0xa9fe('0x9')](),controller[_0xa9fe('0xa')]);router[_0xa9fe('0x8')](_0xa9fe('0xb'),auth[_0xa9fe('0x9')](),controller['show']);router[_0xa9fe('0x8')](_0xa9fe('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xa9fe('0x8')](_0xa9fe('0xd'),auth[_0xa9fe('0x9')](),controller[_0xa9fe('0xe')]);router[_0xa9fe('0xf')]('/',auth[_0xa9fe('0x9')](),controller[_0xa9fe('0x10')]);router[_0xa9fe('0xf')](_0xa9fe('0xc'),auth[_0xa9fe('0x9')](),controller[_0xa9fe('0x11')]);router[_0xa9fe('0x12')](_0xa9fe('0xb'),auth[_0xa9fe('0x9')](),controller[_0xa9fe('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa9fe('0x14')]);module[_0xa9fe('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index e2d2b8b..3089e4f 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 _0x03db=['STRING','BOOLEAN','sequelize','exports'];(function(_0x110248,_0x3d39fe){var _0x464879=function(_0x1f084e){while(--_0x1f084e){_0x110248['push'](_0x110248['shift']());}};_0x464879(++_0x3d39fe);}(_0x03db,0x156));var _0xb03d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x03db[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xb03d('0x0'));module[_0xb03d('0x1')]={'name':{'type':Sequelize[_0xb03d('0x2')]},'username':{'type':Sequelize[_0xb03d('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb03d('0x2')]},'tenantId':{'type':Sequelize[_0xb03d('0x2')]},'clientId':{'type':Sequelize[_0xb03d('0x2')]},'clientSecret':{'type':Sequelize[_0xb03d('0x2')]},'serverUrl':{'type':Sequelize[_0xb03d('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xb03d('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xd8a5=['BOOLEAN','sequelize','STRING'];(function(_0x257ff1,_0x532332){var _0xbcecff=function(_0x28f644){while(--_0x28f644){_0x257ff1['push'](_0x257ff1['shift']());}};_0xbcecff(++_0x532332);}(_0xd8a5,0x160));var _0x5d8a=function(_0x3c1c71,_0x1b3831){_0x3c1c71=_0x3c1c71-0x0;var _0x2a9570=_0xd8a5[_0x3c1c71];return _0x2a9570;};'use strict';var Sequelize=require(_0x5d8a('0x0'));module['exports']={'name':{'type':Sequelize[_0x5d8a('0x1')]},'username':{'type':Sequelize[_0x5d8a('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x5d8a('0x1')]},'tenantId':{'type':Sequelize[_0x5d8a('0x1')]},'clientId':{'type':Sequelize[_0x5d8a('0x1')]},'clientSecret':{'type':Sequelize[_0x5d8a('0x1')]},'serverUrl':{'type':Sequelize[_0x5d8a('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5d8a('0x1')]},'modernAuthentication':{'type':Sequelize[_0x5d8a('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 54d25d1..41aa585 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 _0xb939=['BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','UserLocalizedLabel','Label','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','count','set','Content-Range','update','then','end','sendStatus','error','stack','name','status','send','index','Dynamics365Account','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','getConfigurations','Dynamics365Configuration','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','description','customerid','caseorigincode','subject','regardingobjectid','directioncode','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidyominame','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','slaname','socialprofileidname','statecode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','username','password','clientId','clientSecret','modernAuthentication','CloudProvider','access_token','data5','data7','POST','/oauth2/token','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','4.0','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','StringAttributeMetadata'];(function(_0x42c806,_0x5447ac){var _0x4152ba=function(_0x5733ce){while(--_0x5733ce){_0x42c806['push'](_0x42c806['shift']());}};_0x4152ba(++_0x5447ac);}(_0xb939,0xd2));var _0x9b93=function(_0x5d8941,_0x7f85f){_0x5d8941=_0x5d8941-0x0;var _0x7e8d7=_0xb939[_0x5d8941];return _0x7e8d7;};'use strict';var rp=require('request-promise');var util=require(_0x9b93('0x0'));var _=require('lodash');var qs=require(_0x9b93('0x1'));var logger=require(_0x9b93('0x2'))(_0x9b93('0x3'));var db=require(_0x9b93('0x4'))['db'];var integrations=require(_0x9b93('0x5'));function respondWithResult(_0x22865c,_0x5c8829){_0x5c8829=_0x5c8829||0xc8;return function(_0x4bf7eb){if(_0x4bf7eb){return _0x22865c['status'](_0x5c8829)[_0x9b93('0x6')](_0x4bf7eb);}};}function respondWithFilteredResult(_0x2df05a,_0x59c94d){return function(_0x1a447d){if(_0x1a447d){var _0x3d6df5=typeof _0x59c94d[_0x9b93('0x7')]===_0x9b93('0x8')&&typeof _0x59c94d[_0x9b93('0x9')]==='undefined';var _0x1462c9=_0x1a447d[_0x9b93('0xa')];var _0x178f3d=_0x3d6df5?0x0:_0x59c94d[_0x9b93('0x7')];var _0x276c7d=_0x3d6df5?_0x1a447d[_0x9b93('0xa')]:_0x59c94d[_0x9b93('0x7')]+_0x59c94d[_0x9b93('0x9')];var _0x538bd0;if(_0x276c7d>=_0x1462c9){_0x276c7d=_0x1462c9;_0x538bd0=0xc8;}else{_0x538bd0=0xce;}_0x2df05a['status'](_0x538bd0);return _0x2df05a[_0x9b93('0xb')](_0x9b93('0xc'),_0x178f3d+'-'+_0x276c7d+'/'+_0x1462c9)[_0x9b93('0x6')](_0x1a447d);}return null;};}function saveUpdates(_0x309c1d){return function(_0x220c33){if(_0x220c33){return _0x220c33[_0x9b93('0xd')](_0x309c1d)['then'](function(_0x535bdd){return _0x535bdd;});}return null;};}function removeEntity(_0x5efe47){return function(_0x599858){if(_0x599858){return _0x599858['destroy']()[_0x9b93('0xe')](function(){_0x5efe47['status'](0xcc)[_0x9b93('0xf')]();});}};}function handleEntityNotFound(_0x4667f9){return function(_0x4d4df2){if(!_0x4d4df2){_0x4667f9[_0x9b93('0x10')](0x194);}return _0x4d4df2;};}function handleError(_0xd1fbb9,_0x10e6e0){_0x10e6e0=_0x10e6e0||0x1f4;return function(_0x13e2d2){logger[_0x9b93('0x11')](_0x13e2d2[_0x9b93('0x12')]);if(_0x13e2d2[_0x9b93('0x13')]){delete _0x13e2d2[_0x9b93('0x13')];}_0xd1fbb9[_0x9b93('0x14')](_0x10e6e0)[_0x9b93('0x15')](_0x13e2d2);};}exports[_0x9b93('0x16')]=function(_0x92f59c,_0x5498bd){var _0xa19ee5={},_0x254b9d={},_0xfe47b7={'count':0x0,'rows':[]};var _0x47496c=_['map'](db[_0x9b93('0x17')][_0x9b93('0x18')],function(_0x1e9d73){return{'name':_0x1e9d73[_0x9b93('0x19')],'type':_0x1e9d73[_0x9b93('0x1a')]['key']};});_0x254b9d[_0x9b93('0x1b')]=_['map'](_0x47496c,_0x9b93('0x13'));_0x254b9d[_0x9b93('0x1c')]=_[_0x9b93('0x1d')](_0x92f59c[_0x9b93('0x1c')]);_0x254b9d[_0x9b93('0x1e')]=_[_0x9b93('0x1f')](_0x254b9d['model'],_0x254b9d[_0x9b93('0x1c')]);_0xa19ee5['attributes']=_['intersection'](_0x254b9d[_0x9b93('0x1b')],qs[_0x9b93('0x20')](_0x92f59c[_0x9b93('0x1c')][_0x9b93('0x20')]));_0xa19ee5[_0x9b93('0x21')]=_0xa19ee5[_0x9b93('0x21')]['length']?_0xa19ee5[_0x9b93('0x21')]:_0x254b9d[_0x9b93('0x1b')];if(!_0x92f59c['query'][_0x9b93('0x22')]('nolimit')){_0xa19ee5[_0x9b93('0x9')]=qs['limit'](_0x92f59c[_0x9b93('0x1c')]['limit']);_0xa19ee5[_0x9b93('0x7')]=qs[_0x9b93('0x7')](_0x92f59c[_0x9b93('0x1c')]['offset']);}_0xa19ee5[_0x9b93('0x23')]=qs[_0x9b93('0x24')](_0x92f59c[_0x9b93('0x1c')][_0x9b93('0x24')]);_0xa19ee5[_0x9b93('0x25')]=qs[_0x9b93('0x1e')](_[_0x9b93('0x26')](_0x92f59c[_0x9b93('0x1c')],_0x254b9d['filters']),_0x47496c);if(_0x92f59c[_0x9b93('0x1c')][_0x9b93('0x27')]){_0xa19ee5[_0x9b93('0x25')]=_[_0x9b93('0x28')](_0xa19ee5[_0x9b93('0x25')],{'$or':_[_0x9b93('0x29')](_0x47496c,function(_0x43a6a5){if(_0x43a6a5[_0x9b93('0x1a')]!=='VIRTUAL'){var _0x3d5f33={};_0x3d5f33[_0x43a6a5[_0x9b93('0x13')]]={'$like':'%'+_0x92f59c[_0x9b93('0x1c')][_0x9b93('0x27')]+'%'};return _0x3d5f33;}})});}_0xa19ee5=_[_0x9b93('0x28')]({},_0xa19ee5,_0x92f59c[_0x9b93('0x2a')]);var _0x12619e={'where':_0xa19ee5[_0x9b93('0x25')]};return db[_0x9b93('0x17')]['count'](_0x12619e)[_0x9b93('0xe')](function(_0x3d5a5e){_0xfe47b7[_0x9b93('0xa')]=_0x3d5a5e;if(_0x92f59c[_0x9b93('0x1c')][_0x9b93('0x2b')]){_0xa19ee5[_0x9b93('0x2c')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x9b93('0x2d')](_0xa19ee5);})[_0x9b93('0xe')](function(_0x302118){_0xfe47b7[_0x9b93('0x2e')]=_0x302118;return _0xfe47b7;})[_0x9b93('0xe')](respondWithFilteredResult(_0x5498bd,_0xa19ee5))[_0x9b93('0x2f')](handleError(_0x5498bd,null));};exports[_0x9b93('0x30')]=function(_0x25af44,_0x20e252){var _0x1d1376={'raw':![],'where':{'id':_0x25af44[_0x9b93('0x31')]['id']}},_0x3c3d2a={};_0x3c3d2a[_0x9b93('0x1b')]=_[_0x9b93('0x1d')](db[_0x9b93('0x17')][_0x9b93('0x18')]);_0x3c3d2a[_0x9b93('0x1c')]=_[_0x9b93('0x1d')](_0x25af44['query']);_0x3c3d2a[_0x9b93('0x1e')]=_[_0x9b93('0x1f')](_0x3c3d2a[_0x9b93('0x1b')],_0x3c3d2a[_0x9b93('0x1c')]);_0x1d1376[_0x9b93('0x21')]=_[_0x9b93('0x1f')](_0x3c3d2a['model'],qs[_0x9b93('0x20')](_0x25af44['query'][_0x9b93('0x20')]));_0x1d1376[_0x9b93('0x21')]=_0x1d1376[_0x9b93('0x21')][_0x9b93('0x32')]?_0x1d1376[_0x9b93('0x21')]:_0x3c3d2a[_0x9b93('0x1b')];if(_0x25af44[_0x9b93('0x1c')][_0x9b93('0x2b')]){_0x1d1376[_0x9b93('0x2c')]=[{'all':!![]}];}_0x1d1376=_[_0x9b93('0x28')]({},_0x1d1376,_0x25af44['options']);return db[_0x9b93('0x17')][_0x9b93('0x33')](_0x1d1376)[_0x9b93('0xe')](handleEntityNotFound(_0x20e252,null))[_0x9b93('0xe')](respondWithResult(_0x20e252,null))[_0x9b93('0x2f')](handleError(_0x20e252,null));};exports[_0x9b93('0x34')]=function(_0x859d85,_0x2b00ec){return db[_0x9b93('0x17')][_0x9b93('0x34')](_0x859d85['body'],{})[_0x9b93('0xe')](respondWithResult(_0x2b00ec,0xc9))['catch'](handleError(_0x2b00ec,null));};exports[_0x9b93('0xd')]=function(_0x1c4422,_0x4fd249){if(_0x1c4422[_0x9b93('0x35')]['id']){delete _0x1c4422['body']['id'];}return db[_0x9b93('0x17')]['find']({'where':{'id':_0x1c4422[_0x9b93('0x31')]['id']}})[_0x9b93('0xe')](handleEntityNotFound(_0x4fd249,null))[_0x9b93('0xe')](saveUpdates(_0x1c4422[_0x9b93('0x35')],null))['then'](respondWithResult(_0x4fd249,null))[_0x9b93('0x2f')](handleError(_0x4fd249,null));};exports[_0x9b93('0x36')]=function(_0x436081,_0x58ae72){return db[_0x9b93('0x17')]['find']({'where':{'id':_0x436081['params']['id']}})[_0x9b93('0xe')](handleEntityNotFound(_0x58ae72,null))[_0x9b93('0xe')](removeEntity(_0x58ae72,null))['catch'](handleError(_0x58ae72,null));};exports[_0x9b93('0x37')]=function(_0x17a74d,_0x41fbc6){var _0x2c941a={};var _0x39a494={};var _0x409b72;var _0xa476d4;return db['Dynamics365Account']['findOne']({'where':{'id':_0x17a74d[_0x9b93('0x31')]['id']}})[_0x9b93('0xe')](handleEntityNotFound(_0x41fbc6,null))[_0x9b93('0xe')](function(_0x30f2e5){if(_0x30f2e5){_0x409b72=_0x30f2e5;_0x39a494[_0x9b93('0x1b')]=_['keys'](db[_0x9b93('0x38')][_0x9b93('0x18')]);_0x39a494['query']=_[_0x9b93('0x1d')](_0x17a74d[_0x9b93('0x1c')]);_0x39a494[_0x9b93('0x1e')]=_['intersection'](_0x39a494[_0x9b93('0x1b')],_0x39a494['query']);_0x2c941a['attributes']=_[_0x9b93('0x1f')](_0x39a494[_0x9b93('0x1b')],qs['fields'](_0x17a74d[_0x9b93('0x1c')][_0x9b93('0x20')]));_0x2c941a[_0x9b93('0x21')]=_0x2c941a['attributes'][_0x9b93('0x32')]?_0x2c941a[_0x9b93('0x21')]:_0x39a494['model'];_0x2c941a[_0x9b93('0x23')]=qs[_0x9b93('0x24')](_0x17a74d[_0x9b93('0x1c')][_0x9b93('0x24')]);_0x2c941a[_0x9b93('0x25')]=qs[_0x9b93('0x1e')](_[_0x9b93('0x26')](_0x17a74d[_0x9b93('0x1c')],_0x39a494[_0x9b93('0x1e')]));if(_0x17a74d['query'][_0x9b93('0x27')]){_0x2c941a[_0x9b93('0x25')]=_['merge'](_0x2c941a['where'],{'$or':_[_0x9b93('0x29')](_0x2c941a['attributes'],function(_0x2649c8){var _0x491eec={};_0x491eec[_0x2649c8]={'$like':'%'+_0x17a74d[_0x9b93('0x1c')][_0x9b93('0x27')]+'%'};return _0x491eec;})});}_0x2c941a=_[_0x9b93('0x28')]({},_0x2c941a,_0x17a74d[_0x9b93('0x2a')]);return _0x409b72[_0x9b93('0x37')](_0x2c941a);}})[_0x9b93('0xe')](function(_0x16ba07){if(_0x16ba07){_0xa476d4=_0x16ba07[_0x9b93('0x32')];if(!_0x17a74d[_0x9b93('0x1c')]['hasOwnProperty'](_0x9b93('0x39'))){_0x2c941a[_0x9b93('0x9')]=qs[_0x9b93('0x9')](_0x17a74d[_0x9b93('0x1c')][_0x9b93('0x9')]);_0x2c941a[_0x9b93('0x7')]=qs[_0x9b93('0x7')](_0x17a74d[_0x9b93('0x1c')][_0x9b93('0x7')]);}return _0x409b72[_0x9b93('0x37')](_0x2c941a);}})['then'](function(_0x3595bd){if(_0x3595bd){return _0x3595bd?{'count':_0xa476d4,'rows':_0x3595bd}:null;}})['then'](respondWithResult(_0x41fbc6,null))[_0x9b93('0x2f')](handleError(_0x41fbc6,null));};exports[_0x9b93('0x3a')]=function(_0x11f8a7,_0x312d21){if(_0x11f8a7[_0x9b93('0x35')]['id']){delete _0x11f8a7[_0x9b93('0x35')]['id'];}return db[_0x9b93('0x17')][_0x9b93('0x3b')]({'where':{'id':_0x11f8a7['params']['id']}})[_0x9b93('0xe')](handleEntityNotFound(_0x312d21,null))[_0x9b93('0xe')](function(_0x57737e){if(_0x57737e){_0x11f8a7[_0x9b93('0x35')][_0x9b93('0x3c')]=_0x57737e['id'];_0x11f8a7[_0x9b93('0x35')][_0x9b93('0x3d')]=integrations[_0x9b93('0x3e')](_0x11f8a7[_0x9b93('0x35')]['channel'],_0x11f8a7[_0x9b93('0x35')][_0x9b93('0x1a')]);_0x11f8a7[_0x9b93('0x35')]['Descriptions']=integrations['getDescriptions'](_0x11f8a7[_0x9b93('0x35')]['channel'],_0x11f8a7[_0x9b93('0x35')][_0x9b93('0x1a')]);return db[_0x9b93('0x38')][_0x9b93('0x34')](_0x11f8a7['body'],{'include':[{'model':db[_0x9b93('0x3f')],'as':_0x9b93('0x3d')},{'model':db[_0x9b93('0x3f')],'as':_0x9b93('0x40')}]});}return null;})['then'](respondWithResult(_0x312d21,null))[_0x9b93('0x2f')](handleError(_0x312d21,null));};function sanitizeRemoteUri(_0x3d173b){var _0x5646d8=_0x3d173b[_0x9b93('0x41')](-0x1);if(_0x5646d8==='/')return _0x3d173b[_0x9b93('0x42')](0x0,_0x3d173b[_0x9b93('0x43')](_0x5646d8));return _0x3d173b;}function getWebApiUrl(_0x50ec3f){return util[_0x9b93('0x44')](_0x9b93('0x45'),_0x50ec3f);}exports[_0x9b93('0x46')]=function(_0x54251b,_0x5e0f4e){var _0x3e550b=_0x54251b[_0x9b93('0x1c')][_0x9b93('0x47')];var _0x2eb55d=_0x3e550b===_0x9b93('0x48')?_0x9b93('0x49'):_0x9b93('0x4a');var _0x4a9044='';var _0x587445='';var _0x4388b6='';var _0x4f9a65='';var _0x14665f='';var _0x313cf8='';var _0x14a864='';var _0x136152='';var _0x124339=['title',_0x9b93('0x4b'),_0x9b93('0x4c'),'ownerid',_0x9b93('0x4d'),_0x9b93('0x4e'),'phonenumber',_0x9b93('0x4f'),_0x9b93('0x50'),'phonecall_activity_parties'];var _0x3d8804=['accountidname','accountidyominame',_0x9b93('0x51'),_0x9b93('0x52'),'contactidname',_0x9b93('0x53'),_0x9b93('0x54'),_0x9b93('0x55'),_0x9b93('0x56'),_0x9b93('0x57'),'createdbyname','createdbyyominame',_0x9b93('0x58'),'createdonbehalfbyname',_0x9b93('0x59'),_0x9b93('0x5a'),'customeridtype',_0x9b93('0x5b'),_0x9b93('0x5c'),'entitlementidname',_0x9b93('0x5d'),_0x9b93('0x5e'),_0x9b93('0x5f'),_0x9b93('0x60'),_0x9b93('0x61'),_0x9b93('0x62'),_0x9b93('0x63'),_0x9b93('0x64'),_0x9b93('0x65'),'lastonholdtime',_0x9b93('0x66'),_0x9b93('0x67'),_0x9b93('0x68'),_0x9b93('0x69'),_0x9b93('0x6a'),_0x9b93('0x6b'),_0x9b93('0x6c'),_0x9b93('0x6d'),_0x9b93('0x6e'),_0x9b93('0x6f'),'numberofchildincidents','onholdtime',_0x9b93('0x70'),_0x9b93('0x71'),_0x9b93('0x72'),_0x9b93('0x73'),'parentcaseidname','primarycontactidname',_0x9b93('0x74'),'prioritycodename',_0x9b93('0x75'),_0x9b93('0x76'),_0x9b93('0x77'),_0x9b93('0x78'),'responseby',_0x9b93('0x79'),_0x9b93('0x7a'),'sentimentvalue','slainvokedidname',_0x9b93('0x7b'),_0x9b93('0x7c'),_0x9b93('0x7d'),'statuscode','subjectidname',_0x9b93('0x7e'),_0x9b93('0x7f'),_0x9b93('0x80'),'traversedpath',_0x9b93('0x81'),_0x9b93('0x82')];var _0x328b10=_0x124339[_0x9b93('0x83')](_0x3d8804);return db[_0x9b93('0x17')][_0x9b93('0x3b')]({'where':{'id':_0x54251b[_0x9b93('0x31')]['id']},'attributes':['id',_0x9b93('0x84'),_0x9b93('0x85'),'remoteUri','tenantId',_0x9b93('0x86'),_0x9b93('0x87'),_0x9b93('0x88')],'include':[{'model':db[_0x9b93('0x89')],'as':_0x9b93('0x89'),'attributes':['id','data5','data7']}]})['then'](handleEntityNotFound(_0x5e0f4e,null))[_0x9b93('0xe')](function(_0x2a00f5){if(_0x2a00f5){if(_0x2a00f5[_0x9b93('0x88')]){_0x2a00f5[_0x9b93('0x8a')]=_0x2a00f5[_0x9b93('0x89')][_0x9b93('0x8b')];_0x136152=sanitizeRemoteUri(_0x2a00f5[_0x9b93('0x89')][_0x9b93('0x8c')]);_0x14a864=getWebApiUrl(_0x136152);return _0x2a00f5;}_0x136152=sanitizeRemoteUri(_0x2a00f5['remoteUri']);_0x14a864=getWebApiUrl(_0x136152);var _0x137ab6={'method':_0x9b93('0x8d'),'uri':'https://login.microsoftonline.com/'+_0x2a00f5['tenantId']+_0x9b93('0x8e'),'form':{'client_id':_0x2a00f5[_0x9b93('0x86')],'resource':_0x136152,'username':_0x2a00f5[_0x9b93('0x84')],'password':_0x2a00f5[_0x9b93('0x85')],'grant_type':_0x9b93('0x85'),'client_secret':_0x2a00f5[_0x9b93('0x87')]},'json':!![]};return rp(_0x137ab6);}})[_0x9b93('0xe')](function(_0x4e88d2){_0x313cf8=_0x4e88d2[_0x9b93('0x8a')];var _0x392f43={'method':'GET','uri':encodeURI(_0x14a864+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x2eb55d+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x313cf8,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x392f43);})['then'](function(_0x383977){var _0x2db92b=_0x383977[_0x9b93('0x8f')][0x0];var _0x51d974=_0x2db92b[_0x9b93('0x90')];var _0xfe09e6={'method':_0x9b93('0x91'),'uri':_0x14a864+_0x9b93('0x92')+_0x51d974+_0x9b93('0x93'),'headers':{'Authorization':_0x9b93('0x94')+_0x313cf8,'If-None-Match':null,'OData-Version':_0x9b93('0x95')},'json':!![]};return rp(_0xfe09e6);})[_0x9b93('0xe')](function(_0x3721ed){_0x4a9044=_0x3721ed;_0x587445=_0x4a9044[_0x9b93('0x96')];_0x587445=_[_0x9b93('0x97')](_0x587445,function(_0x4d6153){return!_0x328b10[_0x9b93('0x98')](_0x4d6153[_0x9b93('0x99')]);});var _0x324976=[];var _0x23d396=[];_0x587445[_0x9b93('0x9a')](function(_0x20b816){if(_0x20b816['@odata.type']){var _0x4f2d59=_0x20b816[_0x9b93('0x9b')][_0x9b93('0x42')](_0x20b816[_0x9b93('0x9b')][_0x9b93('0x43')]('.')+0x1);if(_0x4f2d59===_0x9b93('0x9c')){_0x324976[_0x9b93('0x9d')](getSelectList(_0x14a864,_0x3e550b,_0x23d396,_0x4a9044[_0x9b93('0x90')],_0x20b816[_0x9b93('0x90')],_0x313cf8));}}});return Promise[_0x9b93('0x9e')](_0x324976);})[_0x9b93('0xe')](function(_0x200e44){_0x4388b6=_0x200e44[0x0];var _0x28bfb1=[];var _0x339d1e=[];_0x587445[_0x9b93('0x9a')](function(_0x4cec10){if(!_['isNil'](_0x4cec10[_0x9b93('0x9b')])){var _0x50fcf0=_0x4cec10[_0x9b93('0x9b')][_0x9b93('0x42')](_0x4cec10[_0x9b93('0x9b')][_0x9b93('0x43')]('.')+0x1);if(_0x50fcf0==='BooleanAttributeMetadata'){_0x28bfb1[_0x9b93('0x9d')](getBooleanList(_0x14a864,_0x3e550b,_0x339d1e,_0x4a9044[_0x9b93('0x90')],_0x4cec10[_0x9b93('0x90')],_0x313cf8));}}});return Promise[_0x9b93('0x9e')](_0x28bfb1);})[_0x9b93('0xe')](function(_0x22897b){_0x4f9a65=_0x22897b[0x0];var _0x382258=[];var _0x162ba3=[];_0x587445[_0x9b93('0x9a')](function(_0x208312){if(_0x208312[_0x9b93('0x9b')]){var _0xd9c6d2=_0x208312['@odata.type']['substring'](_0x208312['@odata.type'][_0x9b93('0x43')]('.')+0x1);if(_0xd9c6d2===_0x9b93('0x9f')||_0xd9c6d2==='DoubleAttributeMetadata'||_0xd9c6d2===_0x9b93('0xa0')||_0xd9c6d2===_0x9b93('0xa1')||_0xd9c6d2===_0x9b93('0xa2')||_0xd9c6d2===_0x9b93('0xa3')||_0xd9c6d2===_0x9b93('0xa4')||_0xd9c6d2==='EntityNameAttributeMetadata'||_0xd9c6d2===_0x9b93('0xa5')||_0xd9c6d2===_0x9b93('0xa6')){_0x382258[_0x9b93('0x9d')](getInputList(_0x14a864,_0x3e550b,_0xd9c6d2,_0x162ba3,_0x4a9044[_0x9b93('0x90')],_0x208312[_0x9b93('0x90')],_0x313cf8));}}});return Promise[_0x9b93('0x9e')](_0x382258);})[_0x9b93('0xe')](function(_0x3757db){_0x14665f=_0x3757db[0x0];var _0x3c9199=_0x4388b6[_0x9b93('0x83')](_0x4f9a65)[_0x9b93('0x83')](_0x14665f);var _0x2efb95={'count':_0x3c9199[_0x9b93('0x32')],'rows':_0x3c9199};return _0x2efb95;})[_0x9b93('0xe')](respondWithResult(_0x5e0f4e,null))['catch'](function(_0x547844){var _0x4dabc0=_0x54251b[_0x9b93('0x1c')][_0x9b93('0xa7')]?0x1f4:_0x547844[_0x9b93('0xa8')]||0x1f4;logger[_0x9b93('0x11')](_0x547844[_0x9b93('0x12')]);delete _0x547844[_0x9b93('0x13')];if(_0x4dabc0===0x191){_0x4dabc0=0x190;}_0x5e0f4e[_0x9b93('0x14')](_0x4dabc0)[_0x9b93('0x15')](_0x54251b[_0x9b93('0x1c')][_0x9b93('0xa7')]?{'message':_0x9b93('0xa9'),'statusCode':_0x547844[_0x9b93('0xa8')]}:_0x547844);});};function getSelectList(_0x541dd5,_0x23a0c2,_0x1f263a,_0x1073d4,_0x1574fc,_0x4d13f8){var _0x10d84d={'method':_0x9b93('0x91'),'uri':_0x541dd5+_0x9b93('0x92')+_0x1073d4+_0x9b93('0xaa')+_0x1574fc+_0x9b93('0xab')+_0x9b93('0xac'),'headers':{'Authorization':_0x9b93('0x94')+_0x4d13f8,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x10d84d)[_0x9b93('0xe')](function(_0x1d1da6){var _0x423ca1=[];var _0x22fed8=_0x1d1da6[_0x9b93('0xad')]['Options'];_0x22fed8['forEach'](function(_0x2fb4e7){_0x423ca1[_0x9b93('0x9d')]({'name':_0x2fb4e7['Label'][_0x9b93('0xae')][_0x9b93('0xaf')],'value':String(_0x2fb4e7[_0x9b93('0xb0')])});});var _0x5d50aa={'id':_0x23a0c2+'_'+_0x1d1da6[_0x9b93('0x99')],'name':_0x1d1da6['DisplayName']['UserLocalizedLabel']['Label'],'custom':![],'options':_0x423ca1};_0x1f263a[_0x9b93('0x9d')](_0x5d50aa);return _0x1f263a;});}function getBooleanList(_0x139d11,_0x5e50f1,_0x58e28d,_0x4e702c,_0x58362a,_0x1f9bdc){var _0x4ad9af={'method':'GET','uri':_0x139d11+_0x9b93('0x92')+_0x4e702c+')/Attributes('+_0x58362a+_0x9b93('0xb1'),'headers':{'Authorization':_0x9b93('0x94')+_0x1f9bdc,'If-None-Match':null,'OData-Version':_0x9b93('0x95')},'json':!![]};return rp(_0x4ad9af)[_0x9b93('0xe')](function(_0x2c5717){var _0x36e961=[];_0x36e961[_0x9b93('0x9d')]({'name':_0x2c5717[_0x9b93('0xad')][_0x9b93('0xb2')][_0x9b93('0xaf')][_0x9b93('0xae')][_0x9b93('0xaf')],'value':_0x9b93('0xb3')},{'name':_0x2c5717[_0x9b93('0xad')][_0x9b93('0xb4')][_0x9b93('0xaf')][_0x9b93('0xae')]['Label'],'value':_0x9b93('0xb5')});var _0x343802={'id':_0x5e50f1+'_'+_0x2c5717[_0x9b93('0x99')],'name':_0x2c5717[_0x9b93('0xb6')][_0x9b93('0xae')][_0x9b93('0xaf')],'custom':![],'options':_0x36e961};_0x58e28d[_0x9b93('0x9d')](_0x343802);return _0x58e28d;});}function getInputList(_0x25700b,_0x3396ff,_0x2e7dd5,_0x33945e,_0x16a0a3,_0x2a09e8,_0x1680a1){var _0x16d65d={'method':_0x9b93('0x91'),'uri':_0x25700b+'EntityDefinitions('+_0x16a0a3+_0x9b93('0xaa')+_0x2a09e8+_0x9b93('0xb7')+_0x2e7dd5+_0x9b93('0xb8'),'headers':{'Authorization':_0x9b93('0x94')+_0x1680a1,'If-None-Match':null,'OData-Version':_0x9b93('0x95')},'json':!![]};return rp(_0x16d65d)[_0x9b93('0xe')](function(_0x6ad39a){var _0x584a84={'id':_0x3396ff+'_'+_0x6ad39a[_0x9b93('0x99')],'name':_0x6ad39a[_0x9b93('0xb6')][_0x9b93('0xae')]?_0x6ad39a['DisplayName']['UserLocalizedLabel']['Label']:_0x6ad39a[_0x9b93('0x99')],'custom':![],'options':[]};_0x33945e['push'](_0x584a84);return _0x33945e;});} \ No newline at end of file +var _0x2d58=['push','all','BooleanAttributeMetadata','MetadataId','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../config/logger','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','body','params','Dynamics365Configuration','nolimit','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','getFields','ticketType','incident','Incident','PhoneCall','title','description','ownerid','caseorigincode','subject','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','customeridtype','emailaddress','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','slainvokedidname','slaname','socialprofileidname','statecode','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','POST','https://login.microsoftonline.com/','/oauth2/token','username','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','LogicalName','forEach','@odata.type','PicklistAttributeMetadata'];(function(_0x43d2ac,_0x48521a){var _0x4b4a33=function(_0xc5ffda){while(--_0xc5ffda){_0x43d2ac['push'](_0x43d2ac['shift']());}};_0x4b4a33(++_0x48521a);}(_0x2d58,0x186));var _0x82d5=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2d58[_0xa464c9];return _0x3d73c4;};'use strict';var rp=require(_0x82d5('0x0'));var util=require(_0x82d5('0x1'));var _=require(_0x82d5('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x82d5('0x3'))('api');var db=require(_0x82d5('0x4'))['db'];var integrations=require(_0x82d5('0x5'));function respondWithResult(_0x19fd57,_0x763bbb){_0x763bbb=_0x763bbb||0xc8;return function(_0x37830c){if(_0x37830c){return _0x19fd57[_0x82d5('0x6')](_0x763bbb)[_0x82d5('0x7')](_0x37830c);}};}function respondWithFilteredResult(_0x4c95fe,_0xd636fe){return function(_0x2f5257){if(_0x2f5257){var _0x24c9cb=typeof _0xd636fe[_0x82d5('0x8')]===_0x82d5('0x9')&&typeof _0xd636fe[_0x82d5('0xa')]===_0x82d5('0x9');var _0x19d045=_0x2f5257[_0x82d5('0xb')];var _0x4744d7=_0x24c9cb?0x0:_0xd636fe['offset'];var _0x29f9e3=_0x24c9cb?_0x2f5257[_0x82d5('0xb')]:_0xd636fe[_0x82d5('0x8')]+_0xd636fe[_0x82d5('0xa')];var _0x5a3cb2;if(_0x29f9e3>=_0x19d045){_0x29f9e3=_0x19d045;_0x5a3cb2=0xc8;}else{_0x5a3cb2=0xce;}_0x4c95fe['status'](_0x5a3cb2);return _0x4c95fe[_0x82d5('0xc')](_0x82d5('0xd'),_0x4744d7+'-'+_0x29f9e3+'/'+_0x19d045)['json'](_0x2f5257);}return null;};}function saveUpdates(_0x14ccdc){return function(_0x5c2d84){if(_0x5c2d84){return _0x5c2d84[_0x82d5('0xe')](_0x14ccdc)[_0x82d5('0xf')](function(_0x3a33eb){return _0x3a33eb;});}return null;};}function removeEntity(_0x265753){return function(_0x201e56){if(_0x201e56){return _0x201e56[_0x82d5('0x10')]()[_0x82d5('0xf')](function(){_0x265753[_0x82d5('0x6')](0xcc)['end']();});}};}function handleEntityNotFound(_0x128c42){return function(_0x26caa1){if(!_0x26caa1){_0x128c42['sendStatus'](0x194);}return _0x26caa1;};}function handleError(_0x6ad68c,_0x2194c6){_0x2194c6=_0x2194c6||0x1f4;return function(_0x421d58){logger[_0x82d5('0x11')](_0x421d58[_0x82d5('0x12')]);if(_0x421d58['name']){delete _0x421d58[_0x82d5('0x13')];}_0x6ad68c[_0x82d5('0x6')](_0x2194c6)[_0x82d5('0x14')](_0x421d58);};}exports[_0x82d5('0x15')]=function(_0xa4319c,_0x40b689){var _0x3505b8={},_0x53fef6={},_0x539d35={'count':0x0,'rows':[]};var _0x3c12d5=_[_0x82d5('0x16')](db[_0x82d5('0x17')][_0x82d5('0x18')],function(_0x32be04){return{'name':_0x32be04[_0x82d5('0x19')],'type':_0x32be04[_0x82d5('0x1a')][_0x82d5('0x1b')]};});_0x53fef6['model']=_[_0x82d5('0x16')](_0x3c12d5,_0x82d5('0x13'));_0x53fef6[_0x82d5('0x1c')]=_[_0x82d5('0x1d')](_0xa4319c['query']);_0x53fef6[_0x82d5('0x1e')]=_['intersection'](_0x53fef6[_0x82d5('0x1f')],_0x53fef6[_0x82d5('0x1c')]);_0x3505b8[_0x82d5('0x20')]=_[_0x82d5('0x21')](_0x53fef6[_0x82d5('0x1f')],qs[_0x82d5('0x22')](_0xa4319c['query'][_0x82d5('0x22')]));_0x3505b8['attributes']=_0x3505b8['attributes'][_0x82d5('0x23')]?_0x3505b8['attributes']:_0x53fef6[_0x82d5('0x1f')];if(!_0xa4319c[_0x82d5('0x1c')][_0x82d5('0x24')]('nolimit')){_0x3505b8[_0x82d5('0xa')]=qs[_0x82d5('0xa')](_0xa4319c[_0x82d5('0x1c')]['limit']);_0x3505b8[_0x82d5('0x8')]=qs['offset'](_0xa4319c[_0x82d5('0x1c')][_0x82d5('0x8')]);}_0x3505b8[_0x82d5('0x25')]=qs['sort'](_0xa4319c[_0x82d5('0x1c')][_0x82d5('0x26')]);_0x3505b8[_0x82d5('0x27')]=qs[_0x82d5('0x1e')](_[_0x82d5('0x28')](_0xa4319c[_0x82d5('0x1c')],_0x53fef6[_0x82d5('0x1e')]),_0x3c12d5);if(_0xa4319c['query'][_0x82d5('0x29')]){_0x3505b8[_0x82d5('0x27')]=_[_0x82d5('0x2a')](_0x3505b8['where'],{'$or':_[_0x82d5('0x16')](_0x3c12d5,function(_0xe85e04){if(_0xe85e04['type']!==_0x82d5('0x2b')){var _0xbe0c27={};_0xbe0c27[_0xe85e04[_0x82d5('0x13')]]={'$like':'%'+_0xa4319c[_0x82d5('0x1c')]['filter']+'%'};return _0xbe0c27;}})});}_0x3505b8=_[_0x82d5('0x2a')]({},_0x3505b8,_0xa4319c[_0x82d5('0x2c')]);var _0x780deb={'where':_0x3505b8[_0x82d5('0x27')]};return db[_0x82d5('0x17')][_0x82d5('0xb')](_0x780deb)[_0x82d5('0xf')](function(_0x1d78b6){_0x539d35['count']=_0x1d78b6;if(_0xa4319c['query'][_0x82d5('0x2d')]){_0x3505b8[_0x82d5('0x2e')]=[{'all':!![]}];}return db[_0x82d5('0x17')][_0x82d5('0x2f')](_0x3505b8);})[_0x82d5('0xf')](function(_0xdb5796){_0x539d35[_0x82d5('0x30')]=_0xdb5796;return _0x539d35;})[_0x82d5('0xf')](respondWithFilteredResult(_0x40b689,_0x3505b8))[_0x82d5('0x31')](handleError(_0x40b689,null));};exports[_0x82d5('0x32')]=function(_0x33c96d,_0x243444){var _0x21fb67={'raw':![],'where':{'id':_0x33c96d['params']['id']}},_0x4cdfc5={};_0x4cdfc5[_0x82d5('0x1f')]=_[_0x82d5('0x1d')](db[_0x82d5('0x17')][_0x82d5('0x18')]);_0x4cdfc5[_0x82d5('0x1c')]=_['keys'](_0x33c96d[_0x82d5('0x1c')]);_0x4cdfc5[_0x82d5('0x1e')]=_[_0x82d5('0x21')](_0x4cdfc5['model'],_0x4cdfc5[_0x82d5('0x1c')]);_0x21fb67[_0x82d5('0x20')]=_[_0x82d5('0x21')](_0x4cdfc5[_0x82d5('0x1f')],qs[_0x82d5('0x22')](_0x33c96d[_0x82d5('0x1c')]['fields']));_0x21fb67['attributes']=_0x21fb67[_0x82d5('0x20')]['length']?_0x21fb67[_0x82d5('0x20')]:_0x4cdfc5[_0x82d5('0x1f')];if(_0x33c96d['query'][_0x82d5('0x2d')]){_0x21fb67[_0x82d5('0x2e')]=[{'all':!![]}];}_0x21fb67=_['merge']({},_0x21fb67,_0x33c96d[_0x82d5('0x2c')]);return db[_0x82d5('0x17')][_0x82d5('0x33')](_0x21fb67)[_0x82d5('0xf')](handleEntityNotFound(_0x243444,null))['then'](respondWithResult(_0x243444,null))['catch'](handleError(_0x243444,null));};exports['create']=function(_0x40a0a9,_0x3ebdbb){return db['Dynamics365Account']['create'](_0x40a0a9['body'],{})[_0x82d5('0xf')](respondWithResult(_0x3ebdbb,0xc9))[_0x82d5('0x31')](handleError(_0x3ebdbb,null));};exports[_0x82d5('0xe')]=function(_0xe063f7,_0x4d17de){if(_0xe063f7['body']['id']){delete _0xe063f7[_0x82d5('0x34')]['id'];}return db['Dynamics365Account'][_0x82d5('0x33')]({'where':{'id':_0xe063f7[_0x82d5('0x35')]['id']}})[_0x82d5('0xf')](handleEntityNotFound(_0x4d17de,null))['then'](saveUpdates(_0xe063f7[_0x82d5('0x34')],null))[_0x82d5('0xf')](respondWithResult(_0x4d17de,null))[_0x82d5('0x31')](handleError(_0x4d17de,null));};exports[_0x82d5('0x10')]=function(_0x367eb3,_0x14bc4d){return db[_0x82d5('0x17')]['find']({'where':{'id':_0x367eb3[_0x82d5('0x35')]['id']}})['then'](handleEntityNotFound(_0x14bc4d,null))[_0x82d5('0xf')](removeEntity(_0x14bc4d,null))[_0x82d5('0x31')](handleError(_0x14bc4d,null));};exports['getConfigurations']=function(_0x1973aa,_0x37c5d1){var _0x3abe36={};var _0x43584b={};var _0x1873d5;var _0x4241b4;return db[_0x82d5('0x17')]['findOne']({'where':{'id':_0x1973aa['params']['id']}})['then'](handleEntityNotFound(_0x37c5d1,null))[_0x82d5('0xf')](function(_0x2778a6){if(_0x2778a6){_0x1873d5=_0x2778a6;_0x43584b['model']=_[_0x82d5('0x1d')](db[_0x82d5('0x36')]['rawAttributes']);_0x43584b['query']=_[_0x82d5('0x1d')](_0x1973aa[_0x82d5('0x1c')]);_0x43584b['filters']=_[_0x82d5('0x21')](_0x43584b[_0x82d5('0x1f')],_0x43584b[_0x82d5('0x1c')]);_0x3abe36[_0x82d5('0x20')]=_[_0x82d5('0x21')](_0x43584b['model'],qs[_0x82d5('0x22')](_0x1973aa[_0x82d5('0x1c')][_0x82d5('0x22')]));_0x3abe36['attributes']=_0x3abe36[_0x82d5('0x20')][_0x82d5('0x23')]?_0x3abe36['attributes']:_0x43584b[_0x82d5('0x1f')];_0x3abe36[_0x82d5('0x25')]=qs[_0x82d5('0x26')](_0x1973aa[_0x82d5('0x1c')][_0x82d5('0x26')]);_0x3abe36[_0x82d5('0x27')]=qs[_0x82d5('0x1e')](_['pick'](_0x1973aa[_0x82d5('0x1c')],_0x43584b['filters']));if(_0x1973aa['query'][_0x82d5('0x29')]){_0x3abe36[_0x82d5('0x27')]=_[_0x82d5('0x2a')](_0x3abe36[_0x82d5('0x27')],{'$or':_[_0x82d5('0x16')](_0x3abe36['attributes'],function(_0xe70ce8){var _0x36c383={};_0x36c383[_0xe70ce8]={'$like':'%'+_0x1973aa[_0x82d5('0x1c')][_0x82d5('0x29')]+'%'};return _0x36c383;})});}_0x3abe36=_['merge']({},_0x3abe36,_0x1973aa[_0x82d5('0x2c')]);return _0x1873d5['getConfigurations'](_0x3abe36);}})[_0x82d5('0xf')](function(_0xe8d2d9){if(_0xe8d2d9){_0x4241b4=_0xe8d2d9[_0x82d5('0x23')];if(!_0x1973aa['query'][_0x82d5('0x24')](_0x82d5('0x37'))){_0x3abe36[_0x82d5('0xa')]=qs['limit'](_0x1973aa['query']['limit']);_0x3abe36[_0x82d5('0x8')]=qs[_0x82d5('0x8')](_0x1973aa[_0x82d5('0x1c')][_0x82d5('0x8')]);}return _0x1873d5[_0x82d5('0x38')](_0x3abe36);}})[_0x82d5('0xf')](function(_0x189363){if(_0x189363){return _0x189363?{'count':_0x4241b4,'rows':_0x189363}:null;}})[_0x82d5('0xf')](respondWithResult(_0x37c5d1,null))['catch'](handleError(_0x37c5d1,null));};exports[_0x82d5('0x39')]=function(_0x9b62c0,_0x1d3a13){if(_0x9b62c0[_0x82d5('0x34')]['id']){delete _0x9b62c0[_0x82d5('0x34')]['id'];}return db[_0x82d5('0x17')][_0x82d5('0x3a')]({'where':{'id':_0x9b62c0[_0x82d5('0x35')]['id']}})[_0x82d5('0xf')](handleEntityNotFound(_0x1d3a13,null))[_0x82d5('0xf')](function(_0x36573f){if(_0x36573f){_0x9b62c0['body'][_0x82d5('0x3b')]=_0x36573f['id'];_0x9b62c0[_0x82d5('0x34')][_0x82d5('0x3c')]=integrations[_0x82d5('0x3d')](_0x9b62c0['body'][_0x82d5('0x3e')],_0x9b62c0['body']['type']);_0x9b62c0['body'][_0x82d5('0x3f')]=integrations[_0x82d5('0x40')](_0x9b62c0[_0x82d5('0x34')]['channel'],_0x9b62c0[_0x82d5('0x34')]['type']);return db[_0x82d5('0x36')]['create'](_0x9b62c0[_0x82d5('0x34')],{'include':[{'model':db[_0x82d5('0x41')],'as':_0x82d5('0x3c')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0x82d5('0xf')](respondWithResult(_0x1d3a13,null))[_0x82d5('0x31')](handleError(_0x1d3a13,null));};function sanitizeRemoteUri(_0x5c1d2a){var _0x5ade71=_0x5c1d2a[_0x82d5('0x42')](-0x1);if(_0x5ade71==='/')return _0x5c1d2a[_0x82d5('0x43')](0x0,_0x5c1d2a[_0x82d5('0x44')](_0x5ade71));return _0x5c1d2a;}function getWebApiUrl(_0x5cf7f3){return util['format']('%s/api/data/v9.0/',_0x5cf7f3);}exports[_0x82d5('0x45')]=function(_0x2ea849,_0x7a7a4){var _0x5dccb4=_0x2ea849[_0x82d5('0x1c')][_0x82d5('0x46')];var _0x4a226b=_0x5dccb4===_0x82d5('0x47')?_0x82d5('0x48'):_0x82d5('0x49');var _0x443675='';var _0x158918='';var _0x120f8a='';var _0x44845d='';var _0x48e9c1='';var _0x4526af='';var _0x261950='';var _0x57cb83='';var _0x46cb35=[_0x82d5('0x4a'),_0x82d5('0x4b'),'customerid',_0x82d5('0x4c'),_0x82d5('0x4d'),_0x82d5('0x4e'),'phonenumber',_0x82d5('0x4f'),'directioncode',_0x82d5('0x50')];var _0x27b42a=[_0x82d5('0x51'),_0x82d5('0x52'),'actualserviceunits',_0x82d5('0x53'),'contactidname',_0x82d5('0x54'),_0x82d5('0x55'),_0x82d5('0x56'),_0x82d5('0x57'),_0x82d5('0x58'),_0x82d5('0x59'),_0x82d5('0x5a'),_0x82d5('0x5b'),'createdonbehalfbyname','createdonbehalfbyyominame','customeridname',_0x82d5('0x5c'),'customeridyominame',_0x82d5('0x5d'),'entitlementidname',_0x82d5('0x5e'),'entityimage_url',_0x82d5('0x5f'),_0x82d5('0x60'),_0x82d5('0x61'),_0x82d5('0x62'),_0x82d5('0x63'),_0x82d5('0x64'),'kbarticleidname',_0x82d5('0x65'),'masteridname',_0x82d5('0x66'),_0x82d5('0x67'),'modifiedbyname',_0x82d5('0x68'),'modifiedon',_0x82d5('0x69'),_0x82d5('0x6a'),'msdyn_incidenttypename',_0x82d5('0x6b'),'numberofchildincidents',_0x82d5('0x6c'),_0x82d5('0x6d'),_0x82d5('0x6e'),_0x82d5('0x6f'),'owneridyominame',_0x82d5('0x70'),_0x82d5('0x71'),_0x82d5('0x72'),_0x82d5('0x73'),'productidname',_0x82d5('0x74'),'resolveby',_0x82d5('0x75'),_0x82d5('0x76'),_0x82d5('0x77'),'responsiblecontactidyominame','sentimentvalue',_0x82d5('0x78'),_0x82d5('0x79'),_0x82d5('0x7a'),_0x82d5('0x7b'),'statuscode','subjectidname','ticketnumber','timezoneruleversionnumber',_0x82d5('0x7c'),'traversedpath',_0x82d5('0x7d'),_0x82d5('0x7e')];var _0x410367=_0x46cb35[_0x82d5('0x7f')](_0x27b42a);return db[_0x82d5('0x17')][_0x82d5('0x3a')]({'where':{'id':_0x2ea849[_0x82d5('0x35')]['id']},'attributes':['id','username',_0x82d5('0x80'),_0x82d5('0x81'),_0x82d5('0x82'),_0x82d5('0x83'),_0x82d5('0x84'),_0x82d5('0x85')],'include':[{'model':db[_0x82d5('0x86')],'as':_0x82d5('0x86'),'attributes':['id',_0x82d5('0x87'),_0x82d5('0x88')]}]})[_0x82d5('0xf')](handleEntityNotFound(_0x7a7a4,null))[_0x82d5('0xf')](function(_0x4bb5c0){if(_0x4bb5c0){if(_0x4bb5c0[_0x82d5('0x85')]){_0x4bb5c0[_0x82d5('0x89')]=_0x4bb5c0[_0x82d5('0x86')][_0x82d5('0x87')];_0x57cb83=sanitizeRemoteUri(_0x4bb5c0[_0x82d5('0x86')]['data7']);_0x261950=getWebApiUrl(_0x57cb83);return _0x4bb5c0;}_0x57cb83=sanitizeRemoteUri(_0x4bb5c0['remoteUri']);_0x261950=getWebApiUrl(_0x57cb83);var _0x439387={'method':_0x82d5('0x8a'),'uri':_0x82d5('0x8b')+_0x4bb5c0[_0x82d5('0x82')]+_0x82d5('0x8c'),'form':{'client_id':_0x4bb5c0[_0x82d5('0x83')],'resource':_0x57cb83,'username':_0x4bb5c0[_0x82d5('0x8d')],'password':_0x4bb5c0[_0x82d5('0x80')],'grant_type':_0x82d5('0x80'),'client_secret':_0x4bb5c0[_0x82d5('0x84')]},'json':!![]};return rp(_0x439387);}})[_0x82d5('0xf')](function(_0x2547c5){_0x4526af=_0x2547c5[_0x82d5('0x89')];var _0x3dc873={'method':'GET','uri':encodeURI(_0x261950+_0x82d5('0x8e')+_0x4a226b+'\x27'),'headers':{'Authorization':_0x82d5('0x8f')+_0x4526af,'If-None-Match':null,'OData-Version':_0x82d5('0x90')},'json':!![]};return rp(_0x3dc873);})[_0x82d5('0xf')](function(_0xf75509){var _0x128162=_0xf75509[_0x82d5('0x91')][0x0];var _0x5925f6=_0x128162['MetadataId'];var _0x3bfeca={'method':_0x82d5('0x92'),'uri':_0x261950+_0x82d5('0x93')+_0x5925f6+_0x82d5('0x94'),'headers':{'Authorization':'Bearer\x20'+_0x4526af,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3bfeca);})[_0x82d5('0xf')](function(_0xbd40fa){_0x443675=_0xbd40fa;_0x158918=_0x443675['Attributes'];_0x158918=_['remove'](_0x158918,function(_0x412fe6){return!_0x410367['includes'](_0x412fe6[_0x82d5('0x95')]);});var _0x5250cc=[];var _0x1aee4d=[];_0x158918[_0x82d5('0x96')](function(_0x3870a6){if(_0x3870a6[_0x82d5('0x97')]){var _0x1019d4=_0x3870a6[_0x82d5('0x97')][_0x82d5('0x43')](_0x3870a6['@odata.type'][_0x82d5('0x44')]('.')+0x1);if(_0x1019d4===_0x82d5('0x98')){_0x5250cc[_0x82d5('0x99')](getSelectList(_0x261950,_0x5dccb4,_0x1aee4d,_0x443675['MetadataId'],_0x3870a6['MetadataId'],_0x4526af));}}});return Promise[_0x82d5('0x9a')](_0x5250cc);})[_0x82d5('0xf')](function(_0x1d9e0d){_0x120f8a=_0x1d9e0d[0x0];var _0x3b7e4c=[];var _0xd4134b=[];_0x158918[_0x82d5('0x96')](function(_0x2d560b){if(!_['isNil'](_0x2d560b['@odata.type'])){var _0x4e8ce3=_0x2d560b['@odata.type'][_0x82d5('0x43')](_0x2d560b[_0x82d5('0x97')]['lastIndexOf']('.')+0x1);if(_0x4e8ce3===_0x82d5('0x9b')){_0x3b7e4c[_0x82d5('0x99')](getBooleanList(_0x261950,_0x5dccb4,_0xd4134b,_0x443675[_0x82d5('0x9c')],_0x2d560b[_0x82d5('0x9c')],_0x4526af));}}});return Promise['all'](_0x3b7e4c);})['then'](function(_0x145ac0){_0x44845d=_0x145ac0[0x0];var _0x126cad=[];var _0x139c84=[];_0x158918[_0x82d5('0x96')](function(_0x68ef88){if(_0x68ef88[_0x82d5('0x97')]){var _0x444c93=_0x68ef88[_0x82d5('0x97')][_0x82d5('0x43')](_0x68ef88[_0x82d5('0x97')][_0x82d5('0x44')]('.')+0x1);if(_0x444c93==='StringAttributeMetadata'||_0x444c93===_0x82d5('0x9d')||_0x444c93===_0x82d5('0x9e')||_0x444c93===_0x82d5('0x9f')||_0x444c93===_0x82d5('0xa0')||_0x444c93===_0x82d5('0xa1')||_0x444c93===_0x82d5('0xa2')||_0x444c93===_0x82d5('0xa3')||_0x444c93===_0x82d5('0xa4')||_0x444c93==='DecimalAttributeMetadata'){_0x126cad[_0x82d5('0x99')](getInputList(_0x261950,_0x5dccb4,_0x444c93,_0x139c84,_0x443675[_0x82d5('0x9c')],_0x68ef88['MetadataId'],_0x4526af));}}});return Promise[_0x82d5('0x9a')](_0x126cad);})[_0x82d5('0xf')](function(_0x5d93f7){_0x48e9c1=_0x5d93f7[0x0];var _0x4f1a3b=_0x120f8a['concat'](_0x44845d)[_0x82d5('0x7f')](_0x48e9c1);var _0x101243={'count':_0x4f1a3b['length'],'rows':_0x4f1a3b};return _0x101243;})[_0x82d5('0xf')](respondWithResult(_0x7a7a4,null))[_0x82d5('0x31')](function(_0x1ff96e){var _0x2ed80b=_0x2ea849['query'][_0x82d5('0xa5')]?0x1f4:_0x1ff96e[_0x82d5('0xa6')]||0x1f4;logger[_0x82d5('0x11')](_0x1ff96e[_0x82d5('0x12')]);delete _0x1ff96e[_0x82d5('0x13')];if(_0x2ed80b===0x191){_0x2ed80b=0x190;}_0x7a7a4[_0x82d5('0x6')](_0x2ed80b)[_0x82d5('0x14')](_0x2ea849[_0x82d5('0x1c')][_0x82d5('0xa5')]?{'message':'Wrong\x20credentials','statusCode':_0x1ff96e[_0x82d5('0xa6')]}:_0x1ff96e);});};function getSelectList(_0xf07ef9,_0x781e32,_0x82571f,_0x589ece,_0x29593b,_0x2dceca){var _0x4ef58b={'method':_0x82d5('0x92'),'uri':_0xf07ef9+_0x82d5('0x93')+_0x589ece+_0x82d5('0xa7')+_0x29593b+_0x82d5('0xa8')+_0x82d5('0xa9'),'headers':{'Authorization':_0x82d5('0x8f')+_0x2dceca,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4ef58b)[_0x82d5('0xf')](function(_0x25398d){var _0x3c1d21=[];var _0x251609=_0x25398d['OptionSet'][_0x82d5('0xaa')];_0x251609[_0x82d5('0x96')](function(_0x46ed75){_0x3c1d21[_0x82d5('0x99')]({'name':_0x46ed75[_0x82d5('0xab')][_0x82d5('0xac')][_0x82d5('0xab')],'value':String(_0x46ed75[_0x82d5('0xad')])});});var _0x3ad1a3={'id':_0x781e32+'_'+_0x25398d[_0x82d5('0x95')],'name':_0x25398d['DisplayName'][_0x82d5('0xac')]['Label'],'custom':![],'options':_0x3c1d21};_0x82571f['push'](_0x3ad1a3);return _0x82571f;});}function getBooleanList(_0x586d1e,_0x242db9,_0x17af8a,_0x24347d,_0x4c8dc7,_0x307c62){var _0x25a8cb={'method':_0x82d5('0x92'),'uri':_0x586d1e+_0x82d5('0x93')+_0x24347d+_0x82d5('0xa7')+_0x4c8dc7+_0x82d5('0xae'),'headers':{'Authorization':_0x82d5('0x8f')+_0x307c62,'If-None-Match':null,'OData-Version':_0x82d5('0x90')},'json':!![]};return rp(_0x25a8cb)[_0x82d5('0xf')](function(_0xc0e97a){var _0x219178=[];_0x219178[_0x82d5('0x99')]({'name':_0xc0e97a[_0x82d5('0xaf')][_0x82d5('0xb0')][_0x82d5('0xab')][_0x82d5('0xac')][_0x82d5('0xab')],'value':_0x82d5('0xb1')},{'name':_0xc0e97a[_0x82d5('0xaf')]['FalseOption'][_0x82d5('0xab')][_0x82d5('0xac')][_0x82d5('0xab')],'value':'false'});var _0xc83737={'id':_0x242db9+'_'+_0xc0e97a[_0x82d5('0x95')],'name':_0xc0e97a[_0x82d5('0xb2')][_0x82d5('0xac')][_0x82d5('0xab')],'custom':![],'options':_0x219178};_0x17af8a[_0x82d5('0x99')](_0xc83737);return _0x17af8a;});}function getInputList(_0x3ec399,_0x1e682c,_0x42e120,_0x13b748,_0x2e3a0c,_0x5d5e0b,_0x2351c2){var _0x383e08={'method':_0x82d5('0x92'),'uri':_0x3ec399+_0x82d5('0x93')+_0x2e3a0c+_0x82d5('0xa7')+_0x5d5e0b+_0x82d5('0xb3')+_0x42e120+_0x82d5('0xb4'),'headers':{'Authorization':_0x82d5('0x8f')+_0x2351c2,'If-None-Match':null,'OData-Version':_0x82d5('0x90')},'json':!![]};return rp(_0x383e08)[_0x82d5('0xf')](function(_0x4e5207){var _0x3cbaeb={'id':_0x1e682c+'_'+_0x4e5207['LogicalName'],'name':_0x4e5207[_0x82d5('0xb2')][_0x82d5('0xac')]?_0x4e5207[_0x82d5('0xb2')][_0x82d5('0xac')][_0x82d5('0xab')]:_0x4e5207[_0x82d5('0x95')],'custom':![],'options':[]};_0x13b748['push'](_0x3cbaeb);return _0x13b748;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 7ebf869..6ac537c 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 _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x1d24ff,_0x22a8fb){var _0x37d564=function(_0x1e416d){while(--_0x1e416d){_0x1d24ff['push'](_0x1d24ff['shift']());}};_0x37d564(++_0x22a8fb);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'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'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0xc264cd,_0xb3b7aa){var _0x45eb57=function(_0x39f6d3){while(--_0x39f6d3){_0xc264cd['push'](_0xc264cd['shift']());}};_0x45eb57(++_0xb3b7aa);}(_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'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','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 8dff26e..44d646d 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 _0xdeb4=['stringify','error','code','message','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','ShowDynamics365Account','find','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s'];(function(_0x2931e6,_0x4b79a2){var _0x1b1208=function(_0x3012b0){while(--_0x3012b0){_0x2931e6['push'](_0x2931e6['shift']());}};_0x1b1208(++_0x4b79a2);}(_0xdeb4,0xa2));var _0x4deb=function(_0x58cab5,_0x227d14){_0x58cab5=_0x58cab5-0x0;var _0x421e81=_0xdeb4[_0x58cab5];return _0x421e81;};'use strict';var _=require(_0x4deb('0x0'));var util=require(_0x4deb('0x1'));var moment=require(_0x4deb('0x2'));var BPromise=require(_0x4deb('0x3'));var rs=require(_0x4deb('0x4'));var fs=require('fs');var Redis=require(_0x4deb('0x5'));var db=require(_0x4deb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4deb('0x7'))(_0x4deb('0x8'));var config=require('../../config/environment');var jayson=require(_0x4deb('0x9'));var client=jayson[_0x4deb('0xa')][_0x4deb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ce4e9,_0x125c7d,_0xb12386){return new BPromise(function(_0x22e0d0,_0x2c20b6){return client['request'](_0x2ce4e9,_0xb12386)[_0x4deb('0xc')](function(_0x50ec09){logger[_0x4deb('0xd')](_0x4deb('0xe'),_0x125c7d,_0x4deb('0xf'));logger[_0x4deb('0x10')](_0x4deb('0x11'),_0x125c7d,_0x4deb('0xf'),JSON[_0x4deb('0x12')](_0x50ec09));if(_0x50ec09['error']){if(_0x50ec09[_0x4deb('0x13')][_0x4deb('0x14')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x125c7d,_0x50ec09['error']['message']);return _0x2c20b6(_0x50ec09[_0x4deb('0x13')]['message']);}logger[_0x4deb('0x13')](_0x4deb('0xe'),_0x125c7d,_0x50ec09[_0x4deb('0x13')][_0x4deb('0x15')]);return _0x22e0d0(_0x50ec09['error'][_0x4deb('0x15')]);}else{logger['info'](_0x4deb('0xe'),_0x125c7d,_0x4deb('0xf'));_0x22e0d0(_0x50ec09['result'][_0x4deb('0x15')]);}})['catch'](function(_0x147310){logger[_0x4deb('0x13')]('Dynamics365Account,\x20%s,\x20%s',_0x125c7d,_0x147310);_0x2c20b6(_0x147310);});});}exports[_0x4deb('0x16')]=function(_0x5944a1){var _0x62a51b=this;return new Promise(function(_0x322f9f,_0x3e3d0e){return db[_0x4deb('0x17')][_0x4deb('0x18')]({'raw':_0x5944a1[_0x4deb('0x19')]?_0x5944a1[_0x4deb('0x19')][_0x4deb('0x1a')]===undefined?!![]:![]:!![],'where':_0x5944a1[_0x4deb('0x19')]?_0x5944a1[_0x4deb('0x19')][_0x4deb('0x1b')]||null:null,'attributes':_0x5944a1['options']?_0x5944a1[_0x4deb('0x19')][_0x4deb('0x1c')]||null:null,'limit':_0x5944a1[_0x4deb('0x19')]?_0x5944a1['options'][_0x4deb('0x1d')]||null:null,'include':_0x5944a1[_0x4deb('0x19')]?_0x5944a1[_0x4deb('0x19')][_0x4deb('0x1e')]?_[_0x4deb('0x1f')](_0x5944a1['options']['include'],function(_0x186c7d){return{'model':db[_0x186c7d[_0x4deb('0x20')]],'as':_0x186c7d['as'],'attributes':_0x186c7d[_0x4deb('0x1c')],'include':_0x186c7d[_0x4deb('0x1e')]?_[_0x4deb('0x1f')](_0x186c7d[_0x4deb('0x1e')],function(_0x4ce52c){return{'model':db[_0x4ce52c[_0x4deb('0x20')]],'as':_0x4ce52c['as'],'attributes':_0x4ce52c[_0x4deb('0x1c')],'include':_0x4ce52c['include']?_[_0x4deb('0x1f')](_0x4ce52c[_0x4deb('0x1e')],function(_0x58b969){return{'model':db[_0x58b969[_0x4deb('0x20')]],'as':_0x58b969['as'],'attributes':_0x58b969[_0x4deb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4deb('0xc')](function(_0x5adb14){logger['info'](_0x4deb('0x16'),_0x5944a1);logger[_0x4deb('0x10')]('GetDynamics365Account',_0x5944a1,JSON[_0x4deb('0x12')](_0x5adb14));_0x322f9f(_0x5adb14);})['catch'](function(_0x2ef9eb){logger[_0x4deb('0x13')](_0x4deb('0x16'),_0x2ef9eb[_0x4deb('0x15')],_0x5944a1);_0x3e3d0e(_0x62a51b['error'](0x1f4,_0x2ef9eb[_0x4deb('0x15')]));});});};exports[_0x4deb('0x21')]=function(_0x4e0bba){var _0x9c3f87=this;return new Promise(function(_0x25b922,_0x2e245d){return db[_0x4deb('0x17')][_0x4deb('0x22')]({'raw':_0x4e0bba[_0x4deb('0x19')]?_0x4e0bba[_0x4deb('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4e0bba[_0x4deb('0x19')]?_0x4e0bba[_0x4deb('0x19')][_0x4deb('0x1b')]||null:null,'attributes':_0x4e0bba[_0x4deb('0x19')]?_0x4e0bba[_0x4deb('0x19')][_0x4deb('0x1c')]||null:null,'include':_0x4e0bba['options']?_0x4e0bba[_0x4deb('0x19')][_0x4deb('0x1e')]?_[_0x4deb('0x1f')](_0x4e0bba['options'][_0x4deb('0x1e')],function(_0x4dd76c){return{'model':db[_0x4dd76c[_0x4deb('0x20')]],'as':_0x4dd76c['as'],'attributes':_0x4dd76c[_0x4deb('0x1c')],'include':_0x4dd76c[_0x4deb('0x1e')]?_[_0x4deb('0x1f')](_0x4dd76c[_0x4deb('0x1e')],function(_0x3636c2){return{'model':db[_0x3636c2[_0x4deb('0x20')]],'as':_0x3636c2['as'],'attributes':_0x3636c2[_0x4deb('0x1c')],'include':_0x3636c2[_0x4deb('0x1e')]?_[_0x4deb('0x1f')](_0x3636c2[_0x4deb('0x1e')],function(_0x58b661){return{'model':db[_0x58b661[_0x4deb('0x20')]],'as':_0x58b661['as'],'attributes':_0x58b661[_0x4deb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4deb('0xc')](function(_0x21339a){logger[_0x4deb('0xd')]('ShowDynamics365Account',_0x4e0bba);logger['debug'](_0x4deb('0x21'),_0x4e0bba,JSON[_0x4deb('0x12')](_0x21339a));_0x25b922(_0x21339a);})[_0x4deb('0x23')](function(_0x19e967){logger[_0x4deb('0x13')](_0x4deb('0x21'),_0x19e967[_0x4deb('0x15')],_0x4e0bba);_0x2e245d(_0x9c3f87[_0x4deb('0x13')](0x1f4,_0x19e967[_0x4deb('0x15')]));});});}; \ No newline at end of file +var _0xb344=['../../config/utils','rpc','jayson/promise','client','http','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','model','include','map','attributes','info','catch','find','ShowDynamics365Account','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x218994,_0x2cf487){var _0x3f350b=function(_0x2e2065){while(--_0x2e2065){_0x218994['push'](_0x218994['shift']());}};_0x3f350b(++_0x2cf487);}(_0xb344,0x113));var _0x4b34=function(_0x40b7ec,_0x307707){_0x40b7ec=_0x40b7ec-0x0;var _0x72b976=_0xb344[_0x40b7ec];return _0x72b976;};'use strict';var _=require(_0x4b34('0x0'));var util=require('util');var moment=require(_0x4b34('0x1'));var BPromise=require('bluebird');var rs=require(_0x4b34('0x2'));var fs=require('fs');var Redis=require(_0x4b34('0x3'));var db=require(_0x4b34('0x4'))['db'];var utils=require(_0x4b34('0x5'));var logger=require('../../config/logger')(_0x4b34('0x6'));var config=require('../../config/environment');var jayson=require(_0x4b34('0x7'));var client=jayson[_0x4b34('0x8')][_0x4b34('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x325195,_0x573954,_0xa57069){return new BPromise(function(_0x35ff52,_0x1fa956){return client[_0x4b34('0xa')](_0x325195,_0xa57069)[_0x4b34('0xb')](function(_0x408c14){logger['info'](_0x4b34('0xc'),_0x573954,_0x4b34('0xd'));logger[_0x4b34('0xe')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x573954,'request\x20sent',JSON[_0x4b34('0xf')](_0x408c14));if(_0x408c14[_0x4b34('0x10')]){if(_0x408c14[_0x4b34('0x10')][_0x4b34('0x11')]===0x1f4){logger['error'](_0x4b34('0xc'),_0x573954,_0x408c14[_0x4b34('0x10')]['message']);return _0x1fa956(_0x408c14[_0x4b34('0x10')]['message']);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x573954,_0x408c14['error'][_0x4b34('0x12')]);return _0x35ff52(_0x408c14['error'][_0x4b34('0x12')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x573954,_0x4b34('0xd'));_0x35ff52(_0x408c14[_0x4b34('0x13')][_0x4b34('0x12')]);}})['catch'](function(_0x3f8346){logger['error'](_0x4b34('0xc'),_0x573954,_0x3f8346);_0x1fa956(_0x3f8346);});});}exports[_0x4b34('0x14')]=function(_0x3ade19){var _0x32aeb8=this;return new Promise(function(_0x1142be,_0x19c0fe){return db[_0x4b34('0x15')][_0x4b34('0x16')]({'raw':_0x3ade19[_0x4b34('0x17')]?_0x3ade19['options'][_0x4b34('0x18')]===undefined?!![]:![]:!![],'where':_0x3ade19['options']?_0x3ade19['options'][_0x4b34('0x19')]||null:null,'attributes':_0x3ade19['options']?_0x3ade19[_0x4b34('0x17')]['attributes']||null:null,'limit':_0x3ade19[_0x4b34('0x17')]?_0x3ade19['options'][_0x4b34('0x1a')]||null:null,'include':_0x3ade19[_0x4b34('0x17')]?_0x3ade19[_0x4b34('0x17')]['include']?_['map'](_0x3ade19['options']['include'],function(_0x106c76){return{'model':db[_0x106c76[_0x4b34('0x1b')]],'as':_0x106c76['as'],'attributes':_0x106c76['attributes'],'include':_0x106c76[_0x4b34('0x1c')]?_[_0x4b34('0x1d')](_0x106c76['include'],function(_0x187ff6){return{'model':db[_0x187ff6[_0x4b34('0x1b')]],'as':_0x187ff6['as'],'attributes':_0x187ff6[_0x4b34('0x1e')],'include':_0x187ff6[_0x4b34('0x1c')]?_[_0x4b34('0x1d')](_0x187ff6[_0x4b34('0x1c')],function(_0x5cb893){return{'model':db[_0x5cb893[_0x4b34('0x1b')]],'as':_0x5cb893['as'],'attributes':_0x5cb893[_0x4b34('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4b34('0xb')](function(_0x1f5f94){logger[_0x4b34('0x1f')](_0x4b34('0x14'),_0x3ade19);logger['debug']('GetDynamics365Account',_0x3ade19,JSON[_0x4b34('0xf')](_0x1f5f94));_0x1142be(_0x1f5f94);})[_0x4b34('0x20')](function(_0x2d794f){logger['error'](_0x4b34('0x14'),_0x2d794f['message'],_0x3ade19);_0x19c0fe(_0x32aeb8['error'](0x1f4,_0x2d794f[_0x4b34('0x12')]));});});};exports['ShowDynamics365Account']=function(_0x33bd00){var _0x2b7ece=this;return new Promise(function(_0x431272,_0x4cbe94){return db['Dynamics365Account'][_0x4b34('0x21')]({'raw':_0x33bd00['options']?_0x33bd00[_0x4b34('0x17')][_0x4b34('0x18')]===undefined?!![]:![]:!![],'where':_0x33bd00[_0x4b34('0x17')]?_0x33bd00[_0x4b34('0x17')][_0x4b34('0x19')]||null:null,'attributes':_0x33bd00[_0x4b34('0x17')]?_0x33bd00[_0x4b34('0x17')]['attributes']||null:null,'include':_0x33bd00[_0x4b34('0x17')]?_0x33bd00[_0x4b34('0x17')][_0x4b34('0x1c')]?_[_0x4b34('0x1d')](_0x33bd00[_0x4b34('0x17')][_0x4b34('0x1c')],function(_0x5cfc53){return{'model':db[_0x5cfc53[_0x4b34('0x1b')]],'as':_0x5cfc53['as'],'attributes':_0x5cfc53['attributes'],'include':_0x5cfc53[_0x4b34('0x1c')]?_[_0x4b34('0x1d')](_0x5cfc53['include'],function(_0xd39a0c){return{'model':db[_0xd39a0c[_0x4b34('0x1b')]],'as':_0xd39a0c['as'],'attributes':_0xd39a0c['attributes'],'include':_0xd39a0c[_0x4b34('0x1c')]?_[_0x4b34('0x1d')](_0xd39a0c[_0x4b34('0x1c')],function(_0x588d5d){return{'model':db[_0x588d5d[_0x4b34('0x1b')]],'as':_0x588d5d['as'],'attributes':_0x588d5d[_0x4b34('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4b34('0xb')](function(_0x4a7aab){logger[_0x4b34('0x1f')](_0x4b34('0x22'),_0x33bd00);logger['debug'](_0x4b34('0x22'),_0x33bd00,JSON['stringify'](_0x4a7aab));_0x431272(_0x4a7aab);})[_0x4b34('0x20')](function(_0x56bfe1){logger[_0x4b34('0x10')](_0x4b34('0x22'),_0x56bfe1['message'],_0x33bd00);_0x4cbe94(_0x2b7ece[_0x4b34('0x10')](0x1f4,_0x56bfe1[_0x4b34('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index b85564e..c30c943 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 _0x27f4=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','../../config/environment','./intDynamics365Configuration.controller','get','index','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x27f4,0x14e));var _0x427f=function(_0x1e6bdf,_0x377d56){_0x1e6bdf=_0x1e6bdf-0x0;var _0xf1d42f=_0x27f4[_0x1e6bdf];return _0xf1d42f;};'use strict';var multer=require('multer');var util=require(_0x427f('0x0'));var path=require(_0x427f('0x1'));var timeout=require(_0x427f('0x2'));var express=require(_0x427f('0x3'));var router=express[_0x427f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x427f('0x5'));var controller=require(_0x427f('0x6'));router[_0x427f('0x7')]('/',auth['isAuthenticated'](),controller[_0x427f('0x8')]);router[_0x427f('0x7')]('/:id',auth[_0x427f('0x9')](),controller['show']);router[_0x427f('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x427f('0xa')]);router[_0x427f('0x7')](_0x427f('0xb'),auth[_0x427f('0x9')](),controller[_0x427f('0xc')]);router[_0x427f('0x7')](_0x427f('0xd'),auth[_0x427f('0x9')](),controller[_0x427f('0xe')]);router[_0x427f('0xf')]('/',auth[_0x427f('0x9')](),controller[_0x427f('0x10')]);router[_0x427f('0x11')](_0x427f('0x12'),auth[_0x427f('0x9')](),controller[_0x427f('0x13')]);router[_0x427f('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x427f('0x15')]=router; \ No newline at end of file +var _0x7e74=['index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7e74,0xbd));var _0x47e7=function(_0x31a62a,_0x56d90e){_0x31a62a=_0x31a62a-0x0;var _0x5d696a=_0x7e74[_0x31a62a];return _0x5d696a;};'use strict';var multer=require(_0x47e7('0x0'));var util=require('util');var path=require(_0x47e7('0x1'));var timeout=require(_0x47e7('0x2'));var express=require(_0x47e7('0x3'));var router=express[_0x47e7('0x4')]();var fs_extra=require(_0x47e7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x47e7('0x6'));var config=require(_0x47e7('0x7'));var controller=require(_0x47e7('0x8'));router[_0x47e7('0x9')]('/',auth[_0x47e7('0xa')](),controller[_0x47e7('0xb')]);router[_0x47e7('0x9')]('/:id',auth[_0x47e7('0xa')](),controller['show']);router[_0x47e7('0x9')](_0x47e7('0xc'),auth[_0x47e7('0xa')](),controller[_0x47e7('0xd')]);router[_0x47e7('0x9')](_0x47e7('0xe'),auth[_0x47e7('0xa')](),controller[_0x47e7('0xf')]);router[_0x47e7('0x9')](_0x47e7('0x10'),auth[_0x47e7('0xa')](),controller[_0x47e7('0x11')]);router[_0x47e7('0x12')]('/',auth['isAuthenticated'](),controller[_0x47e7('0x13')]);router[_0x47e7('0x14')](_0x47e7('0x15'),auth['isAuthenticated'](),controller[_0x47e7('0x16')]);router[_0x47e7('0x17')](_0x47e7('0x15'),auth[_0x47e7('0xa')](),controller['destroy']);module[_0x47e7('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 7b6cf77..ea2ad5c 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 _0xb10b=['incident','nothing','contact','BOOLEAN','exports','STRING','ENUM'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0xb10b,0xc8));var _0xbb10=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0xb10b[_0xf79bae];return _0x5d2cb7;};'use strict';var Sequelize=require('sequelize');module[_0xbb10('0x0')]={'name':{'type':Sequelize[_0xbb10('0x1')]},'description':{'type':Sequelize[_0xbb10('0x1')]},'ticketType':{'type':Sequelize[_0xbb10('0x2')](_0xbb10('0x3'),'phonecall'),'defaultValue':_0xbb10('0x3')},'moduleCreate':{'type':Sequelize[_0xbb10('0x2')]('contact',_0xbb10('0x4')),'defaultValue':_0xbb10('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xbb10('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xbb10('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0x126b=['BOOLEAN','exports','STRING','incident','phonecall','nothing','contact'];(function(_0x2cdf66,_0x530f7f){var _0x5af684=function(_0x3a2d69){while(--_0x3a2d69){_0x2cdf66['push'](_0x2cdf66['shift']());}};_0x5af684(++_0x530f7f);}(_0x126b,0x94));var _0xb126=function(_0x3296d4,_0x289af3){_0x3296d4=_0x3296d4-0x0;var _0x42164d=_0x126b[_0x3296d4];return _0x42164d;};'use strict';var Sequelize=require('sequelize');module[_0xb126('0x0')]={'name':{'type':Sequelize[_0xb126('0x1')]},'description':{'type':Sequelize[_0xb126('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0xb126('0x2'),_0xb126('0x3')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize['ENUM']('contact',_0xb126('0x4')),'defaultValue':_0xb126('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xb126('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xb126('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 2429cd0..eb2495d 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 _0x6357=['eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','save','update','destroy','error','stack','name','send','index','map','Dynamics365Configuration','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','getFields','findOne','getSubjects','getDescriptions'];(function(_0x7267da,_0x118a05){var _0x5d2773=function(_0x2e3d68){while(--_0x2e3d68){_0x7267da['push'](_0x7267da['shift']());}};_0x5d2773(++_0x118a05);}(_0x6357,0xe7));var _0x7635=function(_0x40cff7,_0x5c3eb5){_0x40cff7=_0x40cff7-0x0;var _0x38006f=_0x6357[_0x40cff7];return _0x38006f;};'use strict';var emlformat=require(_0x7635('0x0'));var rimraf=require(_0x7635('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7635('0x2'));var moment=require(_0x7635('0x3'));var BPromise=require(_0x7635('0x4'));var Mustache=require(_0x7635('0x5'));var util=require(_0x7635('0x6'));var path=require(_0x7635('0x7'));var sox=require('sox');var csv=require(_0x7635('0x8'));var ejs=require(_0x7635('0x9'));var fs=require('fs');var fs_extra=require(_0x7635('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7635('0xb'));var jsforce=require(_0x7635('0xc'));var deskjs=require(_0x7635('0xd'));var toCsv=require(_0x7635('0x8'));var querystring=require('querystring');var Papa=require(_0x7635('0xe'));var Redis=require(_0x7635('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7635('0x10'));var hardwareService=require(_0x7635('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x7635('0x12'));var config=require(_0x7635('0x13'));var licenseUtil=require(_0x7635('0x14'));var db=require(_0x7635('0x15'))['db'];function respondWithStatusCode(_0x2f3c85,_0x4ec553){_0x4ec553=_0x4ec553||0xcc;return function(_0xd9ca39){if(_0xd9ca39){return _0x2f3c85[_0x7635('0x16')](_0x4ec553);}return _0x2f3c85[_0x7635('0x17')](_0x4ec553)['end']();};}function respondWithResult(_0x573d0f,_0x56264a){_0x56264a=_0x56264a||0xc8;return function(_0xa64f1b){if(_0xa64f1b){return _0x573d0f['status'](_0x56264a)['json'](_0xa64f1b);}};}function respondWithFilteredResult(_0x1e2d22,_0x2a293b){return function(_0x2653f7){if(_0x2653f7){var _0x521718=typeof _0x2a293b[_0x7635('0x18')]==='undefined'&&typeof _0x2a293b['limit']===_0x7635('0x19');var _0x21f94c=_0x2653f7[_0x7635('0x1a')];var _0xc51eb0=_0x521718?0x0:_0x2a293b[_0x7635('0x18')];var _0x352a10=_0x521718?_0x2653f7[_0x7635('0x1a')]:_0x2a293b[_0x7635('0x18')]+_0x2a293b[_0x7635('0x1b')];var _0x190bbf;if(_0x352a10>=_0x21f94c){_0x352a10=_0x21f94c;_0x190bbf=0xc8;}else{_0x190bbf=0xce;}_0x1e2d22[_0x7635('0x17')](_0x190bbf);return _0x1e2d22['set'](_0x7635('0x1c'),_0xc51eb0+'-'+_0x352a10+'/'+_0x21f94c)[_0x7635('0x1d')](_0x2653f7);}return null;};}function patchUpdates(_0x492a83){return function(_0x1a98b2){try{jsonpatch[_0x7635('0x1e')](_0x1a98b2,_0x492a83,!![]);}catch(_0x245f71){return BPromise['reject'](_0x245f71);}return _0x1a98b2[_0x7635('0x1f')]();};}function saveUpdates(_0x56c077,_0x4427ac){return function(_0x15f85f){if(_0x15f85f){return _0x15f85f[_0x7635('0x20')](_0x56c077)['then'](function(_0x62b789){return _0x62b789;});}return null;};}function removeEntity(_0x5a2ba3,_0x57ac07){return function(_0x31ffe6){if(_0x31ffe6){return _0x31ffe6[_0x7635('0x21')]()['then'](function(){_0x5a2ba3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31a14,_0x5cccef){return function(_0xffaa0b){if(!_0xffaa0b){_0x31a14['sendStatus'](0x194);}return _0xffaa0b;};}function handleError(_0x510c3a,_0x6ecf70){_0x6ecf70=_0x6ecf70||0x1f4;return function(_0xcc9c5d){logger[_0x7635('0x22')](_0xcc9c5d[_0x7635('0x23')]);if(_0xcc9c5d[_0x7635('0x24')]){delete _0xcc9c5d['name'];}_0x510c3a['status'](_0x6ecf70)[_0x7635('0x25')](_0xcc9c5d);};}exports[_0x7635('0x26')]=function(_0x30a673,_0x3fa3cb){var _0x237f3d={},_0x510ff8={},_0x1a59e4={'count':0x0,'rows':[]};var _0x112484=_[_0x7635('0x27')](db[_0x7635('0x28')]['rawAttributes'],function(_0x26130f){return{'name':_0x26130f[_0x7635('0x29')],'type':_0x26130f['type'][_0x7635('0x2a')]};});_0x510ff8['model']=_[_0x7635('0x27')](_0x112484,_0x7635('0x24'));_0x510ff8[_0x7635('0x2b')]=_[_0x7635('0x2c')](_0x30a673['query']);_0x510ff8[_0x7635('0x2d')]=_[_0x7635('0x2e')](_0x510ff8[_0x7635('0x2f')],_0x510ff8[_0x7635('0x2b')]);_0x237f3d[_0x7635('0x30')]=_['intersection'](_0x510ff8[_0x7635('0x2f')],qs[_0x7635('0x31')](_0x30a673[_0x7635('0x2b')]['fields']));_0x237f3d[_0x7635('0x30')]=_0x237f3d[_0x7635('0x30')][_0x7635('0x32')]?_0x237f3d[_0x7635('0x30')]:_0x510ff8[_0x7635('0x2f')];if(!_0x30a673[_0x7635('0x2b')][_0x7635('0x33')](_0x7635('0x34'))){_0x237f3d[_0x7635('0x1b')]=qs[_0x7635('0x1b')](_0x30a673['query'][_0x7635('0x1b')]);_0x237f3d[_0x7635('0x18')]=qs[_0x7635('0x18')](_0x30a673[_0x7635('0x2b')]['offset']);}_0x237f3d[_0x7635('0x35')]=qs[_0x7635('0x36')](_0x30a673[_0x7635('0x2b')][_0x7635('0x36')]);_0x237f3d[_0x7635('0x37')]=qs[_0x7635('0x2d')](_[_0x7635('0x38')](_0x30a673[_0x7635('0x2b')],_0x510ff8[_0x7635('0x2d')]),_0x112484);if(_0x30a673[_0x7635('0x2b')][_0x7635('0x39')]){_0x237f3d['where']=_[_0x7635('0x3a')](_0x237f3d[_0x7635('0x37')],{'$or':_[_0x7635('0x27')](_0x112484,function(_0x21d37f){if(_0x21d37f[_0x7635('0x3b')]!=='VIRTUAL'){var _0x3443e2={};_0x3443e2[_0x21d37f['name']]={'$like':'%'+_0x30a673[_0x7635('0x2b')]['filter']+'%'};return _0x3443e2;}})});}_0x237f3d=_[_0x7635('0x3a')]({},_0x237f3d,_0x30a673[_0x7635('0x3c')]);var _0x37444d={'where':_0x237f3d['where']};return db[_0x7635('0x28')][_0x7635('0x1a')](_0x37444d)[_0x7635('0x3d')](function(_0x120789){_0x1a59e4[_0x7635('0x1a')]=_0x120789;if(_0x30a673[_0x7635('0x2b')][_0x7635('0x3e')]){_0x237f3d[_0x7635('0x3f')]=[{'all':!![]}];}return db[_0x7635('0x28')][_0x7635('0x40')](_0x237f3d);})[_0x7635('0x3d')](function(_0x3d24e1){_0x1a59e4[_0x7635('0x41')]=_0x3d24e1;return _0x1a59e4;})[_0x7635('0x3d')](respondWithFilteredResult(_0x3fa3cb,_0x237f3d))[_0x7635('0x42')](handleError(_0x3fa3cb,null));};exports[_0x7635('0x43')]=function(_0xe0e7c5,_0x775cae){var _0x2655f4={'raw':![],'where':{'id':_0xe0e7c5[_0x7635('0x44')]['id']}},_0x1e40d3={};_0x1e40d3[_0x7635('0x2f')]=_['keys'](db[_0x7635('0x28')][_0x7635('0x45')]);_0x1e40d3[_0x7635('0x2b')]=_[_0x7635('0x2c')](_0xe0e7c5[_0x7635('0x2b')]);_0x1e40d3[_0x7635('0x2d')]=_[_0x7635('0x2e')](_0x1e40d3[_0x7635('0x2f')],_0x1e40d3[_0x7635('0x2b')]);_0x2655f4['attributes']=_[_0x7635('0x2e')](_0x1e40d3['model'],qs['fields'](_0xe0e7c5[_0x7635('0x2b')][_0x7635('0x31')]));_0x2655f4[_0x7635('0x30')]=_0x2655f4[_0x7635('0x30')][_0x7635('0x32')]?_0x2655f4['attributes']:_0x1e40d3[_0x7635('0x2f')];if(_0xe0e7c5[_0x7635('0x2b')][_0x7635('0x3e')]){_0x2655f4[_0x7635('0x3f')]=[{'all':!![]}];}_0x2655f4=_['merge']({},_0x2655f4,_0xe0e7c5['options']);return db['Dynamics365Configuration']['find'](_0x2655f4)[_0x7635('0x3d')](handleEntityNotFound(_0x775cae,null))[_0x7635('0x3d')](respondWithResult(_0x775cae,null))[_0x7635('0x42')](handleError(_0x775cae,null));};exports[_0x7635('0x46')]=function(_0x13cc0,_0x11118a){return db['Dynamics365Configuration'][_0x7635('0x46')](_0x13cc0[_0x7635('0x47')],{})['then'](respondWithResult(_0x11118a,0xc9))[_0x7635('0x42')](handleError(_0x11118a,null));};exports[_0x7635('0x20')]=function(_0x34fa38,_0x5beccf){if(_0x34fa38[_0x7635('0x47')]['id']){delete _0x34fa38['body']['id'];}return db[_0x7635('0x28')]['find']({'where':{'id':_0x34fa38[_0x7635('0x44')]['id']}})[_0x7635('0x3d')](handleEntityNotFound(_0x5beccf,null))['then'](saveUpdates(_0x34fa38['body'],null))['then'](respondWithResult(_0x5beccf,null))[_0x7635('0x42')](handleError(_0x5beccf,null));};exports['destroy']=function(_0x1ebd94,_0x269081){return db[_0x7635('0x28')][_0x7635('0x48')]({'where':{'id':_0x1ebd94[_0x7635('0x44')]['id']}})[_0x7635('0x3d')](handleEntityNotFound(_0x269081,null))[_0x7635('0x3d')](removeEntity(_0x269081,null))[_0x7635('0x42')](handleError(_0x269081,null));};exports[_0x7635('0x49')]=function(_0x510e0e,_0xba8e9e,_0x18af56){var _0x2b9cc1={};var _0x126a84={};var _0x29fbc7;var _0x2b874a;return db[_0x7635('0x28')][_0x7635('0x4a')]({'where':{'id':_0x510e0e['params']['id']}})[_0x7635('0x3d')](handleEntityNotFound(_0xba8e9e,null))[_0x7635('0x3d')](function(_0xd883c3){if(_0xd883c3){_0x29fbc7=_0xd883c3;_0x126a84[_0x7635('0x2f')]=_[_0x7635('0x2c')](db['Dynamics365Field'][_0x7635('0x45')]);_0x126a84[_0x7635('0x2b')]=_[_0x7635('0x2c')](_0x510e0e[_0x7635('0x2b')]);_0x126a84[_0x7635('0x2d')]=_['intersection'](_0x126a84[_0x7635('0x2f')],_0x126a84[_0x7635('0x2b')]);_0x2b9cc1[_0x7635('0x30')]=_[_0x7635('0x2e')](_0x126a84[_0x7635('0x2f')],qs[_0x7635('0x31')](_0x510e0e['query'][_0x7635('0x31')]));_0x2b9cc1[_0x7635('0x30')]=_0x2b9cc1[_0x7635('0x30')]['length']?_0x2b9cc1[_0x7635('0x30')]:_0x126a84['model'];_0x2b9cc1['order']=qs[_0x7635('0x36')](_0x510e0e[_0x7635('0x2b')][_0x7635('0x36')]);_0x2b9cc1[_0x7635('0x37')]=qs[_0x7635('0x2d')](_[_0x7635('0x38')](_0x510e0e[_0x7635('0x2b')],_0x126a84[_0x7635('0x2d')]));if(_0x510e0e[_0x7635('0x2b')][_0x7635('0x39')]){_0x2b9cc1[_0x7635('0x37')]=_[_0x7635('0x3a')](_0x2b9cc1[_0x7635('0x37')],{'$or':_['map'](_0x2b9cc1['attributes'],function(_0xf0c89f){var _0x2c13eb={};_0x2c13eb[_0xf0c89f]={'$like':'%'+_0x510e0e['query'][_0x7635('0x39')]+'%'};return _0x2c13eb;})});}_0x2b9cc1=_[_0x7635('0x3a')]({},_0x2b9cc1,_0x510e0e[_0x7635('0x3c')]);return _0x29fbc7[_0x7635('0x49')](_0x2b9cc1);}})[_0x7635('0x3d')](function(_0x11f1e1){if(_0x11f1e1){_0x2b874a=_0x11f1e1[_0x7635('0x32')];if(!_0x510e0e[_0x7635('0x2b')][_0x7635('0x33')]('nolimit')){_0x2b9cc1['limit']=qs[_0x7635('0x1b')](_0x510e0e[_0x7635('0x2b')][_0x7635('0x1b')]);_0x2b9cc1[_0x7635('0x18')]=qs['offset'](_0x510e0e[_0x7635('0x2b')]['offset']);}return _0x29fbc7['getFields'](_0x2b9cc1);}})['then'](function(_0x4c9f02){if(_0x4c9f02){return _0x4c9f02?{'count':_0x2b874a,'rows':_0x4c9f02}:null;}})[_0x7635('0x3d')](respondWithResult(_0xba8e9e,null))[_0x7635('0x42')](handleError(_0xba8e9e,null));};exports[_0x7635('0x4b')]=function(_0x3a5c7e,_0xbb19ba,_0x59acc5){var _0x4e081a={};var _0x36cfe6={};var _0x12d183;var _0x3bd8cc;return db['Dynamics365Configuration'][_0x7635('0x4a')]({'where':{'id':_0x3a5c7e[_0x7635('0x44')]['id']}})[_0x7635('0x3d')](handleEntityNotFound(_0xbb19ba,null))[_0x7635('0x3d')](function(_0x1a3080){if(_0x1a3080){_0x12d183=_0x1a3080;_0x36cfe6[_0x7635('0x2f')]=_[_0x7635('0x2c')](db['Dynamics365Field'][_0x7635('0x45')]);_0x36cfe6['query']=_['keys'](_0x3a5c7e[_0x7635('0x2b')]);_0x36cfe6[_0x7635('0x2d')]=_[_0x7635('0x2e')](_0x36cfe6[_0x7635('0x2f')],_0x36cfe6[_0x7635('0x2b')]);_0x4e081a['attributes']=_['intersection'](_0x36cfe6[_0x7635('0x2f')],qs[_0x7635('0x31')](_0x3a5c7e[_0x7635('0x2b')]['fields']));_0x4e081a[_0x7635('0x30')]=_0x4e081a[_0x7635('0x30')][_0x7635('0x32')]?_0x4e081a['attributes']:_0x36cfe6[_0x7635('0x2f')];_0x4e081a[_0x7635('0x35')]=qs['sort'](_0x3a5c7e['query'][_0x7635('0x36')]);_0x4e081a[_0x7635('0x37')]=qs[_0x7635('0x2d')](_[_0x7635('0x38')](_0x3a5c7e['query'],_0x36cfe6['filters']));if(_0x3a5c7e[_0x7635('0x2b')][_0x7635('0x39')]){_0x4e081a[_0x7635('0x37')]=_[_0x7635('0x3a')](_0x4e081a['where'],{'$or':_[_0x7635('0x27')](_0x4e081a['attributes'],function(_0x45d320){var _0x3650c5={};_0x3650c5[_0x45d320]={'$like':'%'+_0x3a5c7e[_0x7635('0x2b')][_0x7635('0x39')]+'%'};return _0x3650c5;})});}_0x4e081a=_['merge']({},_0x4e081a,_0x3a5c7e[_0x7635('0x3c')]);return _0x12d183[_0x7635('0x4b')](_0x4e081a);}})[_0x7635('0x3d')](function(_0x5e7a37){if(_0x5e7a37){_0x3bd8cc=_0x5e7a37['length'];if(!_0x3a5c7e[_0x7635('0x2b')][_0x7635('0x33')]('nolimit')){_0x4e081a[_0x7635('0x1b')]=qs[_0x7635('0x1b')](_0x3a5c7e['query'][_0x7635('0x1b')]);_0x4e081a[_0x7635('0x18')]=qs[_0x7635('0x18')](_0x3a5c7e[_0x7635('0x2b')][_0x7635('0x18')]);}return _0x12d183[_0x7635('0x4b')](_0x4e081a);}})[_0x7635('0x3d')](function(_0x7c1f3b){if(_0x7c1f3b){return _0x7c1f3b?{'count':_0x3bd8cc,'rows':_0x7c1f3b}:null;}})[_0x7635('0x3d')](respondWithResult(_0xbb19ba,null))[_0x7635('0x42')](handleError(_0xbb19ba,null));};exports[_0x7635('0x4c')]=function(_0x52c1e6,_0x25ca4a,_0x1893a4){var _0x2458e6={};var _0x24e2cd={};var _0x53e5c6;var _0x445a5b;return db[_0x7635('0x28')][_0x7635('0x4a')]({'where':{'id':_0x52c1e6[_0x7635('0x44')]['id']}})[_0x7635('0x3d')](handleEntityNotFound(_0x25ca4a,null))[_0x7635('0x3d')](function(_0x39e6b6){if(_0x39e6b6){_0x53e5c6=_0x39e6b6;_0x24e2cd[_0x7635('0x2f')]=_[_0x7635('0x2c')](db['Dynamics365Field'][_0x7635('0x45')]);_0x24e2cd['query']=_['keys'](_0x52c1e6[_0x7635('0x2b')]);_0x24e2cd[_0x7635('0x2d')]=_['intersection'](_0x24e2cd['model'],_0x24e2cd['query']);_0x2458e6['attributes']=_['intersection'](_0x24e2cd[_0x7635('0x2f')],qs['fields'](_0x52c1e6[_0x7635('0x2b')][_0x7635('0x31')]));_0x2458e6[_0x7635('0x30')]=_0x2458e6['attributes'][_0x7635('0x32')]?_0x2458e6[_0x7635('0x30')]:_0x24e2cd[_0x7635('0x2f')];_0x2458e6[_0x7635('0x35')]=qs[_0x7635('0x36')](_0x52c1e6[_0x7635('0x2b')][_0x7635('0x36')]);_0x2458e6[_0x7635('0x37')]=qs[_0x7635('0x2d')](_['pick'](_0x52c1e6[_0x7635('0x2b')],_0x24e2cd[_0x7635('0x2d')]));if(_0x52c1e6[_0x7635('0x2b')]['filter']){_0x2458e6[_0x7635('0x37')]=_[_0x7635('0x3a')](_0x2458e6[_0x7635('0x37')],{'$or':_['map'](_0x2458e6[_0x7635('0x30')],function(_0x4d1d41){var _0x26e41c={};_0x26e41c[_0x4d1d41]={'$like':'%'+_0x52c1e6[_0x7635('0x2b')][_0x7635('0x39')]+'%'};return _0x26e41c;})});}_0x2458e6=_[_0x7635('0x3a')]({},_0x2458e6,_0x52c1e6['options']);return _0x53e5c6[_0x7635('0x4c')](_0x2458e6);}})[_0x7635('0x3d')](function(_0x484537){if(_0x484537){_0x445a5b=_0x484537[_0x7635('0x32')];if(!_0x52c1e6[_0x7635('0x2b')][_0x7635('0x33')](_0x7635('0x34'))){_0x2458e6[_0x7635('0x1b')]=qs[_0x7635('0x1b')](_0x52c1e6[_0x7635('0x2b')]['limit']);_0x2458e6[_0x7635('0x18')]=qs[_0x7635('0x18')](_0x52c1e6['query']['offset']);}return _0x53e5c6[_0x7635('0x4c')](_0x2458e6);}})['then'](function(_0xe7b480){if(_0xe7b480){return _0xe7b480?{'count':_0x445a5b,'rows':_0xe7b480}:null;}})['then'](respondWithResult(_0x25ca4a,null))['catch'](handleError(_0x25ca4a,null));}; \ No newline at end of file +var _0x9e47=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','Dynamics365Configuration','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','getFields','Dynamics365Field','filter','getSubjects','findOne','getDescriptions'];(function(_0x841f96,_0xc747f2){var _0x306ba3=function(_0x4fee97){while(--_0x4fee97){_0x841f96['push'](_0x841f96['shift']());}};_0x306ba3(++_0xc747f2);}(_0x9e47,0xa4));var _0x79e4=function(_0x32de22,_0x3e3ebf){_0x32de22=_0x32de22-0x0;var _0x343c85=_0x9e47[_0x32de22];return _0x343c85;};'use strict';var emlformat=require(_0x79e4('0x0'));var rimraf=require(_0x79e4('0x1'));var zipdir=require(_0x79e4('0x2'));var jsonpatch=require(_0x79e4('0x3'));var rp=require('request-promise');var moment=require(_0x79e4('0x4'));var BPromise=require(_0x79e4('0x5'));var Mustache=require(_0x79e4('0x6'));var util=require(_0x79e4('0x7'));var path=require(_0x79e4('0x8'));var sox=require(_0x79e4('0x9'));var csv=require(_0x79e4('0xa'));var ejs=require(_0x79e4('0xb'));var fs=require('fs');var fs_extra=require(_0x79e4('0xc'));var _=require('lodash');var squel=require(_0x79e4('0xd'));var crypto=require(_0x79e4('0xe'));var jsforce=require(_0x79e4('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x79e4('0xa'));var querystring=require(_0x79e4('0x10'));var Papa=require(_0x79e4('0x11'));var Redis=require(_0x79e4('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x79e4('0x13'));var hardwareService=require(_0x79e4('0x14'));var logger=require('../../config/logger')(_0x79e4('0x15'));var utils=require(_0x79e4('0x16'));var config=require(_0x79e4('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x79e4('0x18'))['db'];function respondWithStatusCode(_0x486bd1,_0x255751){_0x255751=_0x255751||0xcc;return function(_0x5eb1c3){if(_0x5eb1c3){return _0x486bd1['sendStatus'](_0x255751);}return _0x486bd1[_0x79e4('0x19')](_0x255751)[_0x79e4('0x1a')]();};}function respondWithResult(_0x5ce680,_0x4e5b76){_0x4e5b76=_0x4e5b76||0xc8;return function(_0x149612){if(_0x149612){return _0x5ce680['status'](_0x4e5b76)[_0x79e4('0x1b')](_0x149612);}};}function respondWithFilteredResult(_0x585d67,_0x38f87f){return function(_0x39fe97){if(_0x39fe97){var _0x149942=typeof _0x38f87f[_0x79e4('0x1c')]===_0x79e4('0x1d')&&typeof _0x38f87f[_0x79e4('0x1e')]===_0x79e4('0x1d');var _0x403049=_0x39fe97[_0x79e4('0x1f')];var _0x58bbf3=_0x149942?0x0:_0x38f87f[_0x79e4('0x1c')];var _0x166356=_0x149942?_0x39fe97[_0x79e4('0x1f')]:_0x38f87f[_0x79e4('0x1c')]+_0x38f87f[_0x79e4('0x1e')];var _0x1e20f6;if(_0x166356>=_0x403049){_0x166356=_0x403049;_0x1e20f6=0xc8;}else{_0x1e20f6=0xce;}_0x585d67['status'](_0x1e20f6);return _0x585d67[_0x79e4('0x20')]('Content-Range',_0x58bbf3+'-'+_0x166356+'/'+_0x403049)[_0x79e4('0x1b')](_0x39fe97);}return null;};}function patchUpdates(_0x51c15c){return function(_0x48738c){try{jsonpatch[_0x79e4('0x21')](_0x48738c,_0x51c15c,!![]);}catch(_0x240050){return BPromise[_0x79e4('0x22')](_0x240050);}return _0x48738c[_0x79e4('0x23')]();};}function saveUpdates(_0x144d6b,_0x3bd95f){return function(_0x2cddf8){if(_0x2cddf8){return _0x2cddf8[_0x79e4('0x24')](_0x144d6b)[_0x79e4('0x25')](function(_0x397bff){return _0x397bff;});}return null;};}function removeEntity(_0x188195,_0x259f7f){return function(_0x15ec2f){if(_0x15ec2f){return _0x15ec2f[_0x79e4('0x26')]()[_0x79e4('0x25')](function(){_0x188195[_0x79e4('0x19')](0xcc)[_0x79e4('0x1a')]();});}};}function handleEntityNotFound(_0x2c4104,_0x351c7d){return function(_0x54b42c){if(!_0x54b42c){_0x2c4104[_0x79e4('0x27')](0x194);}return _0x54b42c;};}function handleError(_0x234ddc,_0x2bbe74){_0x2bbe74=_0x2bbe74||0x1f4;return function(_0x3462f4){logger[_0x79e4('0x28')](_0x3462f4[_0x79e4('0x29')]);if(_0x3462f4[_0x79e4('0x2a')]){delete _0x3462f4[_0x79e4('0x2a')];}_0x234ddc[_0x79e4('0x19')](_0x2bbe74)[_0x79e4('0x2b')](_0x3462f4);};}exports[_0x79e4('0x2c')]=function(_0x8faf44,_0x78d80){var _0x4bf294={},_0x54b6f5={},_0x4fb7b5={'count':0x0,'rows':[]};var _0x3419f5=_[_0x79e4('0x2d')](db['Dynamics365Configuration']['rawAttributes'],function(_0x1a8deb){return{'name':_0x1a8deb[_0x79e4('0x2e')],'type':_0x1a8deb[_0x79e4('0x2f')]['key']};});_0x54b6f5[_0x79e4('0x30')]=_[_0x79e4('0x2d')](_0x3419f5,'name');_0x54b6f5[_0x79e4('0x31')]=_[_0x79e4('0x32')](_0x8faf44[_0x79e4('0x31')]);_0x54b6f5[_0x79e4('0x33')]=_[_0x79e4('0x34')](_0x54b6f5[_0x79e4('0x30')],_0x54b6f5['query']);_0x4bf294[_0x79e4('0x35')]=_[_0x79e4('0x34')](_0x54b6f5[_0x79e4('0x30')],qs[_0x79e4('0x36')](_0x8faf44['query'][_0x79e4('0x36')]));_0x4bf294[_0x79e4('0x35')]=_0x4bf294[_0x79e4('0x35')][_0x79e4('0x37')]?_0x4bf294[_0x79e4('0x35')]:_0x54b6f5['model'];if(!_0x8faf44[_0x79e4('0x31')][_0x79e4('0x38')](_0x79e4('0x39'))){_0x4bf294[_0x79e4('0x1e')]=qs[_0x79e4('0x1e')](_0x8faf44[_0x79e4('0x31')][_0x79e4('0x1e')]);_0x4bf294[_0x79e4('0x1c')]=qs[_0x79e4('0x1c')](_0x8faf44['query'][_0x79e4('0x1c')]);}_0x4bf294[_0x79e4('0x3a')]=qs[_0x79e4('0x3b')](_0x8faf44['query']['sort']);_0x4bf294[_0x79e4('0x3c')]=qs[_0x79e4('0x33')](_[_0x79e4('0x3d')](_0x8faf44[_0x79e4('0x31')],_0x54b6f5[_0x79e4('0x33')]),_0x3419f5);if(_0x8faf44['query']['filter']){_0x4bf294[_0x79e4('0x3c')]=_[_0x79e4('0x3e')](_0x4bf294['where'],{'$or':_[_0x79e4('0x2d')](_0x3419f5,function(_0x4af4a0){if(_0x4af4a0[_0x79e4('0x2f')]!=='VIRTUAL'){var _0x162779={};_0x162779[_0x4af4a0[_0x79e4('0x2a')]]={'$like':'%'+_0x8faf44[_0x79e4('0x31')]['filter']+'%'};return _0x162779;}})});}_0x4bf294=_[_0x79e4('0x3e')]({},_0x4bf294,_0x8faf44['options']);var _0x555ba5={'where':_0x4bf294[_0x79e4('0x3c')]};return db[_0x79e4('0x3f')][_0x79e4('0x1f')](_0x555ba5)['then'](function(_0xf69c69){_0x4fb7b5[_0x79e4('0x1f')]=_0xf69c69;if(_0x8faf44[_0x79e4('0x31')][_0x79e4('0x40')]){_0x4bf294[_0x79e4('0x41')]=[{'all':!![]}];}return db[_0x79e4('0x3f')][_0x79e4('0x42')](_0x4bf294);})[_0x79e4('0x25')](function(_0x5157c5){_0x4fb7b5[_0x79e4('0x43')]=_0x5157c5;return _0x4fb7b5;})[_0x79e4('0x25')](respondWithFilteredResult(_0x78d80,_0x4bf294))[_0x79e4('0x44')](handleError(_0x78d80,null));};exports[_0x79e4('0x45')]=function(_0x3a36c6,_0x5d982f){var _0x493e5a={'raw':![],'where':{'id':_0x3a36c6[_0x79e4('0x46')]['id']}},_0x48d422={};_0x48d422[_0x79e4('0x30')]=_['keys'](db['Dynamics365Configuration'][_0x79e4('0x47')]);_0x48d422[_0x79e4('0x31')]=_['keys'](_0x3a36c6['query']);_0x48d422[_0x79e4('0x33')]=_[_0x79e4('0x34')](_0x48d422[_0x79e4('0x30')],_0x48d422[_0x79e4('0x31')]);_0x493e5a[_0x79e4('0x35')]=_[_0x79e4('0x34')](_0x48d422[_0x79e4('0x30')],qs[_0x79e4('0x36')](_0x3a36c6[_0x79e4('0x31')][_0x79e4('0x36')]));_0x493e5a[_0x79e4('0x35')]=_0x493e5a[_0x79e4('0x35')][_0x79e4('0x37')]?_0x493e5a[_0x79e4('0x35')]:_0x48d422[_0x79e4('0x30')];if(_0x3a36c6[_0x79e4('0x31')][_0x79e4('0x40')]){_0x493e5a[_0x79e4('0x41')]=[{'all':!![]}];}_0x493e5a=_[_0x79e4('0x3e')]({},_0x493e5a,_0x3a36c6[_0x79e4('0x48')]);return db['Dynamics365Configuration'][_0x79e4('0x49')](_0x493e5a)['then'](handleEntityNotFound(_0x5d982f,null))[_0x79e4('0x25')](respondWithResult(_0x5d982f,null))['catch'](handleError(_0x5d982f,null));};exports[_0x79e4('0x4a')]=function(_0x4ddcc4,_0x99be37){return db[_0x79e4('0x3f')][_0x79e4('0x4a')](_0x4ddcc4['body'],{})[_0x79e4('0x25')](respondWithResult(_0x99be37,0xc9))[_0x79e4('0x44')](handleError(_0x99be37,null));};exports[_0x79e4('0x24')]=function(_0x224d16,_0x310154){if(_0x224d16[_0x79e4('0x4b')]['id']){delete _0x224d16[_0x79e4('0x4b')]['id'];}return db[_0x79e4('0x3f')][_0x79e4('0x49')]({'where':{'id':_0x224d16['params']['id']}})['then'](handleEntityNotFound(_0x310154,null))[_0x79e4('0x25')](saveUpdates(_0x224d16[_0x79e4('0x4b')],null))[_0x79e4('0x25')](respondWithResult(_0x310154,null))[_0x79e4('0x44')](handleError(_0x310154,null));};exports['destroy']=function(_0x163c06,_0x5ebbd0){return db[_0x79e4('0x3f')][_0x79e4('0x49')]({'where':{'id':_0x163c06['params']['id']}})[_0x79e4('0x25')](handleEntityNotFound(_0x5ebbd0,null))[_0x79e4('0x25')](removeEntity(_0x5ebbd0,null))[_0x79e4('0x44')](handleError(_0x5ebbd0,null));};exports[_0x79e4('0x4c')]=function(_0x49414e,_0x120937,_0x60a444){var _0x597593={};var _0x1b5a32={};var _0x3251cb;var _0x46c70f;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x49414e['params']['id']}})[_0x79e4('0x25')](handleEntityNotFound(_0x120937,null))['then'](function(_0x21d588){if(_0x21d588){_0x3251cb=_0x21d588;_0x1b5a32[_0x79e4('0x30')]=_['keys'](db[_0x79e4('0x4d')][_0x79e4('0x47')]);_0x1b5a32[_0x79e4('0x31')]=_['keys'](_0x49414e[_0x79e4('0x31')]);_0x1b5a32['filters']=_[_0x79e4('0x34')](_0x1b5a32['model'],_0x1b5a32['query']);_0x597593[_0x79e4('0x35')]=_[_0x79e4('0x34')](_0x1b5a32['model'],qs['fields'](_0x49414e[_0x79e4('0x31')][_0x79e4('0x36')]));_0x597593[_0x79e4('0x35')]=_0x597593['attributes'][_0x79e4('0x37')]?_0x597593[_0x79e4('0x35')]:_0x1b5a32[_0x79e4('0x30')];_0x597593[_0x79e4('0x3a')]=qs[_0x79e4('0x3b')](_0x49414e[_0x79e4('0x31')]['sort']);_0x597593[_0x79e4('0x3c')]=qs[_0x79e4('0x33')](_['pick'](_0x49414e['query'],_0x1b5a32[_0x79e4('0x33')]));if(_0x49414e[_0x79e4('0x31')][_0x79e4('0x4e')]){_0x597593[_0x79e4('0x3c')]=_['merge'](_0x597593[_0x79e4('0x3c')],{'$or':_[_0x79e4('0x2d')](_0x597593['attributes'],function(_0x453718){var _0x2de211={};_0x2de211[_0x453718]={'$like':'%'+_0x49414e[_0x79e4('0x31')][_0x79e4('0x4e')]+'%'};return _0x2de211;})});}_0x597593=_[_0x79e4('0x3e')]({},_0x597593,_0x49414e['options']);return _0x3251cb['getFields'](_0x597593);}})[_0x79e4('0x25')](function(_0x57f5d7){if(_0x57f5d7){_0x46c70f=_0x57f5d7[_0x79e4('0x37')];if(!_0x49414e[_0x79e4('0x31')][_0x79e4('0x38')]('nolimit')){_0x597593[_0x79e4('0x1e')]=qs[_0x79e4('0x1e')](_0x49414e[_0x79e4('0x31')][_0x79e4('0x1e')]);_0x597593[_0x79e4('0x1c')]=qs[_0x79e4('0x1c')](_0x49414e[_0x79e4('0x31')][_0x79e4('0x1c')]);}return _0x3251cb[_0x79e4('0x4c')](_0x597593);}})[_0x79e4('0x25')](function(_0x37cfde){if(_0x37cfde){return _0x37cfde?{'count':_0x46c70f,'rows':_0x37cfde}:null;}})[_0x79e4('0x25')](respondWithResult(_0x120937,null))[_0x79e4('0x44')](handleError(_0x120937,null));};exports[_0x79e4('0x4f')]=function(_0x319119,_0x13026f,_0x4ea28e){var _0x8a13e6={};var _0x2b2ba9={};var _0x38d31b;var _0x3d419b;return db[_0x79e4('0x3f')][_0x79e4('0x50')]({'where':{'id':_0x319119['params']['id']}})[_0x79e4('0x25')](handleEntityNotFound(_0x13026f,null))[_0x79e4('0x25')](function(_0xd1a590){if(_0xd1a590){_0x38d31b=_0xd1a590;_0x2b2ba9[_0x79e4('0x30')]=_['keys'](db[_0x79e4('0x4d')][_0x79e4('0x47')]);_0x2b2ba9[_0x79e4('0x31')]=_[_0x79e4('0x32')](_0x319119['query']);_0x2b2ba9['filters']=_[_0x79e4('0x34')](_0x2b2ba9[_0x79e4('0x30')],_0x2b2ba9[_0x79e4('0x31')]);_0x8a13e6[_0x79e4('0x35')]=_['intersection'](_0x2b2ba9['model'],qs[_0x79e4('0x36')](_0x319119[_0x79e4('0x31')][_0x79e4('0x36')]));_0x8a13e6[_0x79e4('0x35')]=_0x8a13e6[_0x79e4('0x35')]['length']?_0x8a13e6[_0x79e4('0x35')]:_0x2b2ba9[_0x79e4('0x30')];_0x8a13e6[_0x79e4('0x3a')]=qs['sort'](_0x319119[_0x79e4('0x31')]['sort']);_0x8a13e6[_0x79e4('0x3c')]=qs[_0x79e4('0x33')](_[_0x79e4('0x3d')](_0x319119[_0x79e4('0x31')],_0x2b2ba9[_0x79e4('0x33')]));if(_0x319119[_0x79e4('0x31')]['filter']){_0x8a13e6[_0x79e4('0x3c')]=_['merge'](_0x8a13e6[_0x79e4('0x3c')],{'$or':_[_0x79e4('0x2d')](_0x8a13e6[_0x79e4('0x35')],function(_0x21f841){var _0x37bbea={};_0x37bbea[_0x21f841]={'$like':'%'+_0x319119['query'][_0x79e4('0x4e')]+'%'};return _0x37bbea;})});}_0x8a13e6=_[_0x79e4('0x3e')]({},_0x8a13e6,_0x319119[_0x79e4('0x48')]);return _0x38d31b[_0x79e4('0x4f')](_0x8a13e6);}})[_0x79e4('0x25')](function(_0x4816c1){if(_0x4816c1){_0x3d419b=_0x4816c1[_0x79e4('0x37')];if(!_0x319119['query'][_0x79e4('0x38')]('nolimit')){_0x8a13e6[_0x79e4('0x1e')]=qs['limit'](_0x319119['query']['limit']);_0x8a13e6[_0x79e4('0x1c')]=qs[_0x79e4('0x1c')](_0x319119[_0x79e4('0x31')][_0x79e4('0x1c')]);}return _0x38d31b['getSubjects'](_0x8a13e6);}})[_0x79e4('0x25')](function(_0x5821f9){if(_0x5821f9){return _0x5821f9?{'count':_0x3d419b,'rows':_0x5821f9}:null;}})[_0x79e4('0x25')](respondWithResult(_0x13026f,null))[_0x79e4('0x44')](handleError(_0x13026f,null));};exports[_0x79e4('0x51')]=function(_0x50abf2,_0x36e60a,_0xd77757){var _0x1c3348={};var _0x5e504f={};var _0x1b51ef;var _0x539884;return db[_0x79e4('0x3f')][_0x79e4('0x50')]({'where':{'id':_0x50abf2[_0x79e4('0x46')]['id']}})['then'](handleEntityNotFound(_0x36e60a,null))['then'](function(_0x8842bb){if(_0x8842bb){_0x1b51ef=_0x8842bb;_0x5e504f[_0x79e4('0x30')]=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x5e504f[_0x79e4('0x31')]=_[_0x79e4('0x32')](_0x50abf2[_0x79e4('0x31')]);_0x5e504f[_0x79e4('0x33')]=_[_0x79e4('0x34')](_0x5e504f['model'],_0x5e504f[_0x79e4('0x31')]);_0x1c3348['attributes']=_['intersection'](_0x5e504f[_0x79e4('0x30')],qs[_0x79e4('0x36')](_0x50abf2['query'][_0x79e4('0x36')]));_0x1c3348[_0x79e4('0x35')]=_0x1c3348[_0x79e4('0x35')][_0x79e4('0x37')]?_0x1c3348[_0x79e4('0x35')]:_0x5e504f['model'];_0x1c3348[_0x79e4('0x3a')]=qs[_0x79e4('0x3b')](_0x50abf2[_0x79e4('0x31')][_0x79e4('0x3b')]);_0x1c3348[_0x79e4('0x3c')]=qs[_0x79e4('0x33')](_[_0x79e4('0x3d')](_0x50abf2[_0x79e4('0x31')],_0x5e504f['filters']));if(_0x50abf2[_0x79e4('0x31')]['filter']){_0x1c3348['where']=_['merge'](_0x1c3348[_0x79e4('0x3c')],{'$or':_[_0x79e4('0x2d')](_0x1c3348['attributes'],function(_0x2d7ad3){var _0x72b539={};_0x72b539[_0x2d7ad3]={'$like':'%'+_0x50abf2['query'][_0x79e4('0x4e')]+'%'};return _0x72b539;})});}_0x1c3348=_[_0x79e4('0x3e')]({},_0x1c3348,_0x50abf2[_0x79e4('0x48')]);return _0x1b51ef[_0x79e4('0x51')](_0x1c3348);}})[_0x79e4('0x25')](function(_0x1182b9){if(_0x1182b9){_0x539884=_0x1182b9[_0x79e4('0x37')];if(!_0x50abf2[_0x79e4('0x31')][_0x79e4('0x38')](_0x79e4('0x39'))){_0x1c3348[_0x79e4('0x1e')]=qs[_0x79e4('0x1e')](_0x50abf2['query'][_0x79e4('0x1e')]);_0x1c3348[_0x79e4('0x1c')]=qs[_0x79e4('0x1c')](_0x50abf2[_0x79e4('0x31')][_0x79e4('0x1c')]);}return _0x1b51ef[_0x79e4('0x51')](_0x1c3348);}})['then'](function(_0x4ac9c6){if(_0x4ac9c6){return _0x4ac9c6?{'count':_0x539884,'rows':_0x4ac9c6}:null;}})[_0x79e4('0x25')](respondWithResult(_0x36e60a,null))[_0x79e4('0x44')](handleError(_0x36e60a,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 1370d25..f5b4d7c 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 _0x4b84=['moment','path','rimraf','../../config/environment','Dynamics365Configuration','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b84,0x1cc));var _0x44b8=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0x4b84[_0x6a0266];return _0x309e00;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x44b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x44b8('0x3'));var rimraf=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var attributes=require('./intDynamics365Configuration.attributes');module['exports']=function(_0x55f25d,_0x996a8b){return _0x55f25d['define'](_0x44b8('0x6'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2bd894,_0x2acc9a){var _0x413158=function(_0x23ffb0){while(--_0x23ffb0){_0x2bd894['push'](_0x2bd894['shift']());}};_0x413158(++_0x2acc9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index ac3c440..b213913 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 _0x326d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x326d,0x1bd));var _0xd326=function(_0x5ef516,_0x23266d){_0x5ef516=_0x5ef516-0x0;var _0x2a65b7=_0x326d[_0x5ef516];return _0x2a65b7;};'use strict';var _=require(_0xd326('0x0'));var util=require(_0xd326('0x1'));var moment=require(_0xd326('0x2'));var BPromise=require(_0xd326('0x3'));var rs=require(_0xd326('0x4'));var fs=require('fs');var Redis=require(_0xd326('0x5'));var db=require(_0xd326('0x6'))['db'];var utils=require(_0xd326('0x7'));var logger=require(_0xd326('0x8'))(_0xd326('0x9'));var config=require(_0xd326('0xa'));var jayson=require(_0xd326('0xb'));var client=jayson[_0xd326('0xc')][_0xd326('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4a859b,_0x4f54d4,_0x5c7c22){return new BPromise(function(_0x30e2d1,_0x50b24a){return client['request'](_0x4a859b,_0x5c7c22)[_0xd326('0xe')](function(_0x25833f){logger[_0xd326('0xf')](_0xd326('0x10'),_0x4f54d4,_0xd326('0x11'));logger[_0xd326('0x12')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x4f54d4,'request\x20sent',JSON[_0xd326('0x13')](_0x25833f));if(_0x25833f[_0xd326('0x14')]){if(_0x25833f[_0xd326('0x14')][_0xd326('0x15')]===0x1f4){logger[_0xd326('0x14')](_0xd326('0x10'),_0x4f54d4,_0x25833f['error'][_0xd326('0x16')]);return _0x50b24a(_0x25833f[_0xd326('0x14')][_0xd326('0x16')]);}logger['error'](_0xd326('0x10'),_0x4f54d4,_0x25833f[_0xd326('0x14')][_0xd326('0x16')]);return _0x30e2d1(_0x25833f[_0xd326('0x14')]['message']);}else{logger['info'](_0xd326('0x10'),_0x4f54d4,_0xd326('0x11'));_0x30e2d1(_0x25833f[_0xd326('0x17')][_0xd326('0x16')]);}})[_0xd326('0x18')](function(_0x4c21f8){logger[_0xd326('0x14')](_0xd326('0x10'),_0x4f54d4,_0x4c21f8);_0x50b24a(_0x4c21f8);});});} \ No newline at end of file +var _0x1b2d=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x17bcce,_0x39ec4a){var _0x47fccb=function(_0x4cd19b){while(--_0x4cd19b){_0x17bcce['push'](_0x17bcce['shift']());}};_0x47fccb(++_0x39ec4a);}(_0x1b2d,0x1c6));var _0xd1b2=function(_0x36398b,_0x46a031){_0x36398b=_0x36398b-0x0;var _0x460e1d=_0x1b2d[_0x36398b];return _0x460e1d;};'use strict';var _=require('lodash');var util=require(_0xd1b2('0x0'));var moment=require('moment');var BPromise=require(_0xd1b2('0x1'));var rs=require(_0xd1b2('0x2'));var fs=require('fs');var Redis=require(_0xd1b2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd1b2('0x4'));var logger=require(_0xd1b2('0x5'))(_0xd1b2('0x6'));var config=require(_0xd1b2('0x7'));var jayson=require(_0xd1b2('0x8'));var client=jayson[_0xd1b2('0x9')][_0xd1b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f7c82,_0x57b234,_0x4c413f){return new BPromise(function(_0x3dbd7d,_0x4da47b){return client[_0xd1b2('0xb')](_0x2f7c82,_0x4c413f)[_0xd1b2('0xc')](function(_0x2fae66){logger[_0xd1b2('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x57b234,_0xd1b2('0xe'));logger[_0xd1b2('0xf')](_0xd1b2('0x10'),_0x57b234,_0xd1b2('0xe'),JSON[_0xd1b2('0x11')](_0x2fae66));if(_0x2fae66[_0xd1b2('0x12')]){if(_0x2fae66[_0xd1b2('0x12')]['code']===0x1f4){logger[_0xd1b2('0x12')](_0xd1b2('0x13'),_0x57b234,_0x2fae66[_0xd1b2('0x12')][_0xd1b2('0x14')]);return _0x4da47b(_0x2fae66[_0xd1b2('0x12')][_0xd1b2('0x14')]);}logger['error'](_0xd1b2('0x13'),_0x57b234,_0x2fae66[_0xd1b2('0x12')]['message']);return _0x3dbd7d(_0x2fae66['error']['message']);}else{logger['info'](_0xd1b2('0x13'),_0x57b234,_0xd1b2('0xe'));_0x3dbd7d(_0x2fae66[_0xd1b2('0x15')]['message']);}})[_0xd1b2('0x16')](function(_0x290467){logger[_0xd1b2('0x12')](_0xd1b2('0x13'),_0x57b234,_0x290467);_0x4da47b(_0x290467);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 5e2a50e..c3a610a 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 _0x14f2=['connect-timeout','express','Router','../../components/auth/service','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x44abbc,_0x3258e1){var _0x1d3158=function(_0x1ccd64){while(--_0x1ccd64){_0x44abbc['push'](_0x44abbc['shift']());}};_0x1d3158(++_0x3258e1);}(_0x14f2,0xca));var _0x214f=function(_0x597a8e,_0x5bb918){_0x597a8e=_0x597a8e-0x0;var _0x163624=_0x14f2[_0x597a8e];return _0x163624;};'use strict';var multer=require(_0x214f('0x0'));var util=require('util');var path=require(_0x214f('0x1'));var timeout=require(_0x214f('0x2'));var express=require(_0x214f('0x3'));var router=express[_0x214f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x214f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router[_0x214f('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x214f('0x6')](_0x214f('0x7'),auth[_0x214f('0x8')](),controller[_0x214f('0x9')]);router[_0x214f('0xa')]('/',auth['isAuthenticated'](),controller[_0x214f('0xb')]);router[_0x214f('0xc')](_0x214f('0x7'),auth[_0x214f('0x8')](),controller[_0x214f('0xd')]);router[_0x214f('0xe')](_0x214f('0x7'),auth[_0x214f('0x8')](),controller[_0x214f('0xf')]);module[_0x214f('0x10')]=router; \ No newline at end of file +var _0x144f=['../../components/interaction/service','../../config/environment','get','index','isAuthenticated','post','update','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x580c07,_0x2974eb){var _0xe468ac=function(_0x751833){while(--_0x751833){_0x580c07['push'](_0x580c07['shift']());}};_0xe468ac(++_0x2974eb);}(_0x144f,0x188));var _0xf144=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x144f[_0x88cd7b];return _0x56fcc8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf144('0x0'));var timeout=require(_0xf144('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf144('0x2'));var auth=require(_0xf144('0x3'));var interaction=require(_0xf144('0x4'));var config=require(_0xf144('0x5'));var controller=require('./intDynamics365Field.controller');router[_0xf144('0x6')]('/',auth['isAuthenticated'](),controller[_0xf144('0x7')]);router[_0xf144('0x6')]('/:id',auth[_0xf144('0x8')](),controller['show']);router[_0xf144('0x9')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xf144('0x8')](),controller[_0xf144('0xa')]);router['delete']('/:id',auth[_0xf144('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 47f5589..1ed23cb 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 _0xf6e6=['BOOLEAN','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x15c068,_0x441624){var _0x369daf=function(_0x3868f0){while(--_0x3868f0){_0x15c068['push'](_0x15c068['shift']());}};_0x369daf(++_0x441624);}(_0xf6e6,0x181));var _0x6f6e=function(_0x2d360e,_0x250ab){_0x2d360e=_0x2d360e-0x0;var _0x244edd=_0xf6e6[_0x2d360e];return _0x244edd;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x6f6e('0x0')](_0x6f6e('0x1'),_0x6f6e('0x2'),_0x6f6e('0x3'),_0x6f6e('0x4'),_0x6f6e('0x5')),'defaultValue':_0x6f6e('0x1')},'content':{'type':Sequelize[_0x6f6e('0x6')]},'key':{'type':Sequelize[_0x6f6e('0x6')]},'keyType':{'type':Sequelize[_0x6f6e('0x0')]('string',_0x6f6e('0x2'),_0x6f6e('0x3'))},'keyContent':{'type':Sequelize[_0x6f6e('0x6')]},'idField':{'type':Sequelize[_0x6f6e('0x6')]},'nameField':{'type':Sequelize[_0x6f6e('0x6')]},'customField':{'type':Sequelize[_0x6f6e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6f6e('0x6')]}}; \ No newline at end of file +var _0xa445=['variable','keyValue','picklist','STRING','customVariable','sequelize','exports','ENUM','string'];(function(_0x3b7891,_0x557a09){var _0x1d6669=function(_0x39f8a1){while(--_0x39f8a1){_0x3b7891['push'](_0x3b7891['shift']());}};_0x1d6669(++_0x557a09);}(_0xa445,0x7a));var _0x5a44=function(_0x139e34,_0x3e81b4){_0x139e34=_0x139e34-0x0;var _0xcab508=_0xa445[_0x139e34];return _0xcab508;};'use strict';var Sequelize=require(_0x5a44('0x0'));module[_0x5a44('0x1')]={'type':{'type':Sequelize[_0x5a44('0x2')](_0x5a44('0x3'),_0x5a44('0x4'),'customVariable',_0x5a44('0x5'),_0x5a44('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x5a44('0x7')]},'key':{'type':Sequelize[_0x5a44('0x7')]},'keyType':{'type':Sequelize[_0x5a44('0x2')](_0x5a44('0x3'),_0x5a44('0x4'),_0x5a44('0x8'))},'keyContent':{'type':Sequelize[_0x5a44('0x7')]},'idField':{'type':Sequelize[_0x5a44('0x7')]},'nameField':{'type':Sequelize[_0x5a44('0x7')]},'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 51ed286..7919525 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 _0x7282=['limit','Content-Range','reject','destroy','then','stack','name','send','index','map','Dynamics365Field','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','merge','where','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x7282,0x1bf));var _0x2728=function(_0x2bb452,_0x2dbbc0){_0x2bb452=_0x2bb452-0x0;var _0x5f50a6=_0x7282[_0x2bb452];return _0x5f50a6;};'use strict';var emlformat=require(_0x2728('0x0'));var rimraf=require(_0x2728('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2728('0x2'));var rp=require('request-promise');var moment=require(_0x2728('0x3'));var BPromise=require(_0x2728('0x4'));var Mustache=require(_0x2728('0x5'));var util=require(_0x2728('0x6'));var path=require(_0x2728('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2728('0x8'));var _=require('lodash');var squel=require(_0x2728('0x9'));var crypto=require(_0x2728('0xa'));var jsforce=require(_0x2728('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2728('0xc'));var querystring=require(_0x2728('0xd'));var Papa=require('papaparse');var Redis=require(_0x2728('0xe'));var authService=require(_0x2728('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2728('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2728('0x11'))(_0x2728('0x12'));var utils=require(_0x2728('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2728('0x14'));var db=require(_0x2728('0x15'))['db'];function respondWithStatusCode(_0x2c64fb,_0x3e0132){_0x3e0132=_0x3e0132||0xcc;return function(_0x38a0b7){if(_0x38a0b7){return _0x2c64fb[_0x2728('0x16')](_0x3e0132);}return _0x2c64fb[_0x2728('0x17')](_0x3e0132)[_0x2728('0x18')]();};}function respondWithResult(_0x640219,_0x4c75ca){_0x4c75ca=_0x4c75ca||0xc8;return function(_0x46a75d){if(_0x46a75d){return _0x640219[_0x2728('0x17')](_0x4c75ca)[_0x2728('0x19')](_0x46a75d);}};}function respondWithFilteredResult(_0x1dfb20,_0x531bb1){return function(_0x614beb){if(_0x614beb){var _0x3e31c6=typeof _0x531bb1['offset']==='undefined'&&typeof _0x531bb1['limit']===_0x2728('0x1a');var _0x15dc70=_0x614beb[_0x2728('0x1b')];var _0x3039cf=_0x3e31c6?0x0:_0x531bb1[_0x2728('0x1c')];var _0x36f725=_0x3e31c6?_0x614beb[_0x2728('0x1b')]:_0x531bb1[_0x2728('0x1c')]+_0x531bb1[_0x2728('0x1d')];var _0x374309;if(_0x36f725>=_0x15dc70){_0x36f725=_0x15dc70;_0x374309=0xc8;}else{_0x374309=0xce;}_0x1dfb20[_0x2728('0x17')](_0x374309);return _0x1dfb20['set'](_0x2728('0x1e'),_0x3039cf+'-'+_0x36f725+'/'+_0x15dc70)[_0x2728('0x19')](_0x614beb);}return null;};}function patchUpdates(_0x3a2c4b){return function(_0x3ecdc8){try{jsonpatch['apply'](_0x3ecdc8,_0x3a2c4b,!![]);}catch(_0x383719){return BPromise[_0x2728('0x1f')](_0x383719);}return _0x3ecdc8['save']();};}function saveUpdates(_0x17f0b6,_0x26c870){return function(_0x5dd5f1){if(_0x5dd5f1){return _0x5dd5f1['update'](_0x17f0b6)['then'](function(_0x335594){return _0x335594;});}return null;};}function removeEntity(_0x325ca0,_0x24c550){return function(_0x33218e){if(_0x33218e){return _0x33218e[_0x2728('0x20')]()[_0x2728('0x21')](function(){_0x325ca0[_0x2728('0x17')](0xcc)[_0x2728('0x18')]();});}};}function handleEntityNotFound(_0x45484f,_0x1ca5d5){return function(_0x57a620){if(!_0x57a620){_0x45484f[_0x2728('0x16')](0x194);}return _0x57a620;};}function handleError(_0x2aa24c,_0x495710){_0x495710=_0x495710||0x1f4;return function(_0x4f223c){logger['error'](_0x4f223c[_0x2728('0x22')]);if(_0x4f223c[_0x2728('0x23')]){delete _0x4f223c[_0x2728('0x23')];}_0x2aa24c[_0x2728('0x17')](_0x495710)[_0x2728('0x24')](_0x4f223c);};}exports[_0x2728('0x25')]=function(_0x1378e7,_0x126fb7){var _0x32bc96={},_0x1752b9={},_0x2c8ae9={'count':0x0,'rows':[]};var _0x5286e2=_[_0x2728('0x26')](db[_0x2728('0x27')]['rawAttributes'],function(_0x1405f1){return{'name':_0x1405f1['fieldName'],'type':_0x1405f1[_0x2728('0x28')][_0x2728('0x29')]};});_0x1752b9[_0x2728('0x2a')]=_[_0x2728('0x26')](_0x5286e2,_0x2728('0x23'));_0x1752b9[_0x2728('0x2b')]=_[_0x2728('0x2c')](_0x1378e7[_0x2728('0x2b')]);_0x1752b9[_0x2728('0x2d')]=_[_0x2728('0x2e')](_0x1752b9[_0x2728('0x2a')],_0x1752b9[_0x2728('0x2b')]);_0x32bc96[_0x2728('0x2f')]=_[_0x2728('0x2e')](_0x1752b9[_0x2728('0x2a')],qs[_0x2728('0x30')](_0x1378e7['query'][_0x2728('0x30')]));_0x32bc96[_0x2728('0x2f')]=_0x32bc96[_0x2728('0x2f')][_0x2728('0x31')]?_0x32bc96['attributes']:_0x1752b9['model'];if(!_0x1378e7['query'][_0x2728('0x32')](_0x2728('0x33'))){_0x32bc96[_0x2728('0x1d')]=qs[_0x2728('0x1d')](_0x1378e7['query'][_0x2728('0x1d')]);_0x32bc96[_0x2728('0x1c')]=qs[_0x2728('0x1c')](_0x1378e7[_0x2728('0x2b')][_0x2728('0x1c')]);}_0x32bc96['order']=qs[_0x2728('0x34')](_0x1378e7[_0x2728('0x2b')][_0x2728('0x34')]);_0x32bc96['where']=qs[_0x2728('0x2d')](_['pick'](_0x1378e7[_0x2728('0x2b')],_0x1752b9['filters']),_0x5286e2);if(_0x1378e7['query']['filter']){_0x32bc96['where']=_[_0x2728('0x35')](_0x32bc96[_0x2728('0x36')],{'$or':_[_0x2728('0x26')](_0x5286e2,function(_0x5bf2a3){if(_0x5bf2a3[_0x2728('0x28')]!==_0x2728('0x37')){var _0x205ccf={};_0x205ccf[_0x5bf2a3[_0x2728('0x23')]]={'$like':'%'+_0x1378e7['query'][_0x2728('0x38')]+'%'};return _0x205ccf;}})});}_0x32bc96=_[_0x2728('0x35')]({},_0x32bc96,_0x1378e7['options']);var _0x5f3ded={'where':_0x32bc96[_0x2728('0x36')]};return db[_0x2728('0x27')][_0x2728('0x1b')](_0x5f3ded)[_0x2728('0x21')](function(_0xd745e5){_0x2c8ae9[_0x2728('0x1b')]=_0xd745e5;if(_0x1378e7[_0x2728('0x2b')][_0x2728('0x39')]){_0x32bc96[_0x2728('0x3a')]=[{'all':!![]}];}return db[_0x2728('0x27')][_0x2728('0x3b')](_0x32bc96);})[_0x2728('0x21')](function(_0x5e9a86){_0x2c8ae9[_0x2728('0x3c')]=_0x5e9a86;return _0x2c8ae9;})['then'](respondWithFilteredResult(_0x126fb7,_0x32bc96))[_0x2728('0x3d')](handleError(_0x126fb7,null));};exports[_0x2728('0x3e')]=function(_0x42921c,_0x59ac93){var _0xe2eaf6={'raw':!![],'where':{'id':_0x42921c[_0x2728('0x3f')]['id']}},_0x20576f={};_0x20576f[_0x2728('0x2a')]=_[_0x2728('0x2c')](db['Dynamics365Field'][_0x2728('0x40')]);_0x20576f['query']=_[_0x2728('0x2c')](_0x42921c['query']);_0x20576f['filters']=_[_0x2728('0x2e')](_0x20576f[_0x2728('0x2a')],_0x20576f[_0x2728('0x2b')]);_0xe2eaf6[_0x2728('0x2f')]=_[_0x2728('0x2e')](_0x20576f[_0x2728('0x2a')],qs[_0x2728('0x30')](_0x42921c[_0x2728('0x2b')]['fields']));_0xe2eaf6[_0x2728('0x2f')]=_0xe2eaf6[_0x2728('0x2f')][_0x2728('0x31')]?_0xe2eaf6['attributes']:_0x20576f[_0x2728('0x2a')];if(_0x42921c[_0x2728('0x2b')]['includeAll']){_0xe2eaf6[_0x2728('0x3a')]=[{'all':!![]}];}_0xe2eaf6=_[_0x2728('0x35')]({},_0xe2eaf6,_0x42921c['options']);return db[_0x2728('0x27')]['find'](_0xe2eaf6)[_0x2728('0x21')](handleEntityNotFound(_0x59ac93,null))['then'](respondWithResult(_0x59ac93,null))[_0x2728('0x3d')](handleError(_0x59ac93,null));};exports[_0x2728('0x41')]=function(_0x23a840,_0x42d37c){return db['Dynamics365Field'][_0x2728('0x41')](_0x23a840[_0x2728('0x42')],{})['then'](respondWithResult(_0x42d37c,0xc9))[_0x2728('0x3d')](handleError(_0x42d37c,null));};exports['update']=function(_0x37dc84,_0x1aa6e4){if(_0x37dc84[_0x2728('0x42')]['id']){delete _0x37dc84[_0x2728('0x42')]['id'];}return db[_0x2728('0x27')][_0x2728('0x43')]({'where':{'id':_0x37dc84['params']['id']}})[_0x2728('0x21')](handleEntityNotFound(_0x1aa6e4,null))[_0x2728('0x21')](saveUpdates(_0x37dc84[_0x2728('0x42')],null))[_0x2728('0x21')](respondWithResult(_0x1aa6e4,null))[_0x2728('0x3d')](handleError(_0x1aa6e4,null));};exports[_0x2728('0x20')]=function(_0x30eda9,_0x5af788){return db['Dynamics365Field'][_0x2728('0x43')]({'where':{'id':_0x30eda9[_0x2728('0x3f')]['id']}})[_0x2728('0x21')](handleEntityNotFound(_0x5af788,null))['then'](removeEntity(_0x5af788,null))[_0x2728('0x3d')](handleError(_0x5af788,null));}; \ No newline at end of file +var _0xa40a=['nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','catch','show','params','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','send','index','Dynamics365Field','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length'];(function(_0x213f7e,_0x4c5d64){var _0x2f788f=function(_0x522346){while(--_0x522346){_0x213f7e['push'](_0x213f7e['shift']());}};_0x2f788f(++_0x4c5d64);}(_0xa40a,0xe3));var _0xaa40=function(_0x26ea7a,_0x35380a){_0x26ea7a=_0x26ea7a-0x0;var _0x1db05b=_0xa40a[_0x26ea7a];return _0x1db05b;};'use strict';var emlformat=require(_0xaa40('0x0'));var rimraf=require(_0xaa40('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa40('0x2'));var rp=require(_0xaa40('0x3'));var moment=require(_0xaa40('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xaa40('0x5'));var util=require(_0xaa40('0x6'));var path=require(_0xaa40('0x7'));var sox=require(_0xaa40('0x8'));var csv=require('to-csv');var ejs=require(_0xaa40('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa40('0xa'));var squel=require(_0xaa40('0xb'));var crypto=require(_0xaa40('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaa40('0xd'));var toCsv=require('to-csv');var querystring=require(_0xaa40('0xe'));var Papa=require('papaparse');var Redis=require(_0xaa40('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xaa40('0x10'));var as=require(_0xaa40('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xaa40('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaa40('0x13'))['db'];function respondWithStatusCode(_0x40c8ea,_0x393c16){_0x393c16=_0x393c16||0xcc;return function(_0x582ef2){if(_0x582ef2){return _0x40c8ea[_0xaa40('0x14')](_0x393c16);}return _0x40c8ea[_0xaa40('0x15')](_0x393c16)[_0xaa40('0x16')]();};}function respondWithResult(_0x337683,_0x5c925e){_0x5c925e=_0x5c925e||0xc8;return function(_0x58fb8f){if(_0x58fb8f){return _0x337683[_0xaa40('0x15')](_0x5c925e)['json'](_0x58fb8f);}};}function respondWithFilteredResult(_0x5bf7a8,_0x6161f6){return function(_0x104a77){if(_0x104a77){var _0x2ebcc3=typeof _0x6161f6[_0xaa40('0x17')]==='undefined'&&typeof _0x6161f6[_0xaa40('0x18')]===_0xaa40('0x19');var _0x6385b5=_0x104a77[_0xaa40('0x1a')];var _0x3a60e0=_0x2ebcc3?0x0:_0x6161f6[_0xaa40('0x17')];var _0x4d80dd=_0x2ebcc3?_0x104a77[_0xaa40('0x1a')]:_0x6161f6[_0xaa40('0x17')]+_0x6161f6[_0xaa40('0x18')];var _0x1cf5b8;if(_0x4d80dd>=_0x6385b5){_0x4d80dd=_0x6385b5;_0x1cf5b8=0xc8;}else{_0x1cf5b8=0xce;}_0x5bf7a8[_0xaa40('0x15')](_0x1cf5b8);return _0x5bf7a8[_0xaa40('0x1b')](_0xaa40('0x1c'),_0x3a60e0+'-'+_0x4d80dd+'/'+_0x6385b5)[_0xaa40('0x1d')](_0x104a77);}return null;};}function patchUpdates(_0x290986){return function(_0x374b95){try{jsonpatch[_0xaa40('0x1e')](_0x374b95,_0x290986,!![]);}catch(_0x2035ef){return BPromise[_0xaa40('0x1f')](_0x2035ef);}return _0x374b95[_0xaa40('0x20')]();};}function saveUpdates(_0x219feb,_0x2d1ee7){return function(_0x72a7a4){if(_0x72a7a4){return _0x72a7a4['update'](_0x219feb)[_0xaa40('0x21')](function(_0x46db5f){return _0x46db5f;});}return null;};}function removeEntity(_0x2b8056,_0x1eb293){return function(_0x32f87b){if(_0x32f87b){return _0x32f87b[_0xaa40('0x22')]()['then'](function(){_0x2b8056[_0xaa40('0x15')](0xcc)[_0xaa40('0x16')]();});}};}function handleEntityNotFound(_0x107a11,_0xff0e7d){return function(_0x4e6420){if(!_0x4e6420){_0x107a11['sendStatus'](0x194);}return _0x4e6420;};}function handleError(_0x454a00,_0x26875b){_0x26875b=_0x26875b||0x1f4;return function(_0x2feb15){logger['error'](_0x2feb15[_0xaa40('0x23')]);if(_0x2feb15[_0xaa40('0x24')]){delete _0x2feb15[_0xaa40('0x24')];}_0x454a00['status'](_0x26875b)[_0xaa40('0x25')](_0x2feb15);};}exports[_0xaa40('0x26')]=function(_0xeb64c8,_0x4cb217){var _0x286db6={},_0x20f583={},_0x3bb5a5={'count':0x0,'rows':[]};var _0xb36b38=_['map'](db[_0xaa40('0x27')][_0xaa40('0x28')],function(_0x15338a){return{'name':_0x15338a[_0xaa40('0x29')],'type':_0x15338a[_0xaa40('0x2a')][_0xaa40('0x2b')]};});_0x20f583[_0xaa40('0x2c')]=_[_0xaa40('0x2d')](_0xb36b38,_0xaa40('0x24'));_0x20f583[_0xaa40('0x2e')]=_[_0xaa40('0x2f')](_0xeb64c8[_0xaa40('0x2e')]);_0x20f583[_0xaa40('0x30')]=_[_0xaa40('0x31')](_0x20f583[_0xaa40('0x2c')],_0x20f583['query']);_0x286db6[_0xaa40('0x32')]=_[_0xaa40('0x31')](_0x20f583[_0xaa40('0x2c')],qs['fields'](_0xeb64c8['query'][_0xaa40('0x33')]));_0x286db6[_0xaa40('0x32')]=_0x286db6[_0xaa40('0x32')][_0xaa40('0x34')]?_0x286db6[_0xaa40('0x32')]:_0x20f583[_0xaa40('0x2c')];if(!_0xeb64c8[_0xaa40('0x2e')]['hasOwnProperty'](_0xaa40('0x35'))){_0x286db6[_0xaa40('0x18')]=qs[_0xaa40('0x18')](_0xeb64c8['query']['limit']);_0x286db6[_0xaa40('0x17')]=qs[_0xaa40('0x17')](_0xeb64c8['query'][_0xaa40('0x17')]);}_0x286db6[_0xaa40('0x36')]=qs[_0xaa40('0x37')](_0xeb64c8[_0xaa40('0x2e')][_0xaa40('0x37')]);_0x286db6[_0xaa40('0x38')]=qs[_0xaa40('0x30')](_[_0xaa40('0x39')](_0xeb64c8[_0xaa40('0x2e')],_0x20f583[_0xaa40('0x30')]),_0xb36b38);if(_0xeb64c8['query']['filter']){_0x286db6[_0xaa40('0x38')]=_['merge'](_0x286db6[_0xaa40('0x38')],{'$or':_[_0xaa40('0x2d')](_0xb36b38,function(_0x33d0a0){if(_0x33d0a0[_0xaa40('0x2a')]!==_0xaa40('0x3a')){var _0xbeca53={};_0xbeca53[_0x33d0a0[_0xaa40('0x24')]]={'$like':'%'+_0xeb64c8[_0xaa40('0x2e')]['filter']+'%'};return _0xbeca53;}})});}_0x286db6=_[_0xaa40('0x3b')]({},_0x286db6,_0xeb64c8[_0xaa40('0x3c')]);var _0x5afb6c={'where':_0x286db6['where']};return db[_0xaa40('0x27')][_0xaa40('0x1a')](_0x5afb6c)[_0xaa40('0x21')](function(_0x3f8f1d){_0x3bb5a5[_0xaa40('0x1a')]=_0x3f8f1d;if(_0xeb64c8['query'][_0xaa40('0x3d')]){_0x286db6[_0xaa40('0x3e')]=[{'all':!![]}];}return db[_0xaa40('0x27')]['findAll'](_0x286db6);})[_0xaa40('0x21')](function(_0x1c8412){_0x3bb5a5['rows']=_0x1c8412;return _0x3bb5a5;})[_0xaa40('0x21')](respondWithFilteredResult(_0x4cb217,_0x286db6))[_0xaa40('0x3f')](handleError(_0x4cb217,null));};exports[_0xaa40('0x40')]=function(_0x42cbfb,_0x16f8da){var _0x3cba27={'raw':!![],'where':{'id':_0x42cbfb[_0xaa40('0x41')]['id']}},_0x172c94={};_0x172c94['model']=_[_0xaa40('0x2f')](db[_0xaa40('0x27')][_0xaa40('0x28')]);_0x172c94[_0xaa40('0x2e')]=_[_0xaa40('0x2f')](_0x42cbfb[_0xaa40('0x2e')]);_0x172c94[_0xaa40('0x30')]=_[_0xaa40('0x31')](_0x172c94[_0xaa40('0x2c')],_0x172c94[_0xaa40('0x2e')]);_0x3cba27[_0xaa40('0x32')]=_[_0xaa40('0x31')](_0x172c94[_0xaa40('0x2c')],qs[_0xaa40('0x33')](_0x42cbfb['query']['fields']));_0x3cba27[_0xaa40('0x32')]=_0x3cba27[_0xaa40('0x32')][_0xaa40('0x34')]?_0x3cba27[_0xaa40('0x32')]:_0x172c94['model'];if(_0x42cbfb[_0xaa40('0x2e')]['includeAll']){_0x3cba27[_0xaa40('0x3e')]=[{'all':!![]}];}_0x3cba27=_[_0xaa40('0x3b')]({},_0x3cba27,_0x42cbfb[_0xaa40('0x3c')]);return db['Dynamics365Field'][_0xaa40('0x42')](_0x3cba27)[_0xaa40('0x21')](handleEntityNotFound(_0x16f8da,null))[_0xaa40('0x21')](respondWithResult(_0x16f8da,null))[_0xaa40('0x3f')](handleError(_0x16f8da,null));};exports['create']=function(_0x433cb9,_0x3ef428){return db['Dynamics365Field'][_0xaa40('0x43')](_0x433cb9[_0xaa40('0x44')],{})[_0xaa40('0x21')](respondWithResult(_0x3ef428,0xc9))[_0xaa40('0x3f')](handleError(_0x3ef428,null));};exports[_0xaa40('0x45')]=function(_0x85d341,_0x46d162){if(_0x85d341['body']['id']){delete _0x85d341['body']['id'];}return db[_0xaa40('0x27')][_0xaa40('0x42')]({'where':{'id':_0x85d341[_0xaa40('0x41')]['id']}})[_0xaa40('0x21')](handleEntityNotFound(_0x46d162,null))[_0xaa40('0x21')](saveUpdates(_0x85d341['body'],null))[_0xaa40('0x21')](respondWithResult(_0x46d162,null))['catch'](handleError(_0x46d162,null));};exports['destroy']=function(_0x4792bd,_0x5eb9d6){return db['Dynamics365Field'][_0xaa40('0x42')]({'where':{'id':_0x4792bd[_0xaa40('0x41')]['id']}})[_0xaa40('0x21')](handleEntityNotFound(_0x5eb9d6,null))[_0xaa40('0x21')](removeEntity(_0x5eb9d6,null))[_0xaa40('0x3f')](handleError(_0x5eb9d6,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index f423158..8917ac0 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 _0x3931=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x680821,_0x23e67f){var _0x3f132c=function(_0x1bbcea){while(--_0x1bbcea){_0x680821['push'](_0x680821['shift']());}};_0x3f132c(++_0x23e67f);}(_0x3931,0x16d));var _0x1393=function(_0x33de0a,_0x30e3bd){_0x33de0a=_0x33de0a-0x0;var _0x266c2e=_0x3931[_0x33de0a];return _0x266c2e;};'use strict';var _=require(_0x1393('0x0'));var util=require(_0x1393('0x1'));var logger=require(_0x1393('0x2'))(_0x1393('0x3'));var moment=require(_0x1393('0x4'));var BPromise=require(_0x1393('0x5'));var rp=require(_0x1393('0x6'));var fs=require('fs');var path=require(_0x1393('0x7'));var rimraf=require(_0x1393('0x8'));var config=require(_0x1393('0x9'));var attributes=require(_0x1393('0xa'));module['exports']=function(_0x5f3041,_0x46b354){return _0x5f3041[_0x1393('0xb')](_0x1393('0xc'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x1393('0xd'),'fields':[_0x1393('0xe'),_0x1393('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc92c=['int_dynamics365_fields','dynamics365_unique_index','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./intDynamics365Field.attributes','exports','define','Dynamics365Field'];(function(_0xac2edb,_0x7ee06d){var _0x5eb36e=function(_0x4e9e37){while(--_0x4e9e37){_0xac2edb['push'](_0xac2edb['shift']());}};_0x5eb36e(++_0x7ee06d);}(_0xc92c,0x16f));var _0xcc92=function(_0x6bd121,_0x3963f8){_0x6bd121=_0x6bd121-0x0;var _0x1a0ec3=_0xc92c[_0x6bd121];return _0x1a0ec3;};'use strict';var _=require(_0xcc92('0x0'));var util=require(_0xcc92('0x1'));var logger=require(_0xcc92('0x2'))('api');var moment=require(_0xcc92('0x3'));var BPromise=require(_0xcc92('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc92('0x5'));var rimraf=require(_0xcc92('0x6'));var config=require('../../config/environment');var attributes=require(_0xcc92('0x7'));module[_0xcc92('0x8')]=function(_0x70b44f,_0x4cd90a){return _0x70b44f[_0xcc92('0x9')](_0xcc92('0xa'),attributes,{'tableName':_0xcc92('0xb'),'paranoid':![],'indexes':[{'name':_0xcc92('0xc'),'fields':[_0xcc92('0xd'),'FieldId'],'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 d9566f0..8de1498 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 _0x94cb=['Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x44d97a,_0x3b7e19){var _0x2be6a9=function(_0x777cec){while(--_0x777cec){_0x44d97a['push'](_0x44d97a['shift']());}};_0x2be6a9(++_0x3b7e19);}(_0x94cb,0x1a2));var _0xb94c=function(_0x2bf906,_0xac4094){_0x2bf906=_0x2bf906-0x0;var _0x22a00f=_0x94cb[_0x2bf906];return _0x22a00f;};'use strict';var _=require(_0xb94c('0x0'));var util=require(_0xb94c('0x1'));var moment=require(_0xb94c('0x2'));var BPromise=require(_0xb94c('0x3'));var rs=require(_0xb94c('0x4'));var fs=require('fs');var Redis=require(_0xb94c('0x5'));var db=require(_0xb94c('0x6'))['db'];var utils=require(_0xb94c('0x7'));var logger=require('../../config/logger')(_0xb94c('0x8'));var config=require(_0xb94c('0x9'));var jayson=require(_0xb94c('0xa'));var client=jayson[_0xb94c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54f519,_0x4e73e7,_0x33cc7e){return new BPromise(function(_0xe32aa2,_0xa94353){return client['request'](_0x54f519,_0x33cc7e)[_0xb94c('0xc')](function(_0x3cf1b7){logger[_0xb94c('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x4e73e7,_0xb94c('0xe'));logger[_0xb94c('0xf')](_0xb94c('0x10'),_0x4e73e7,_0xb94c('0xe'),JSON['stringify'](_0x3cf1b7));if(_0x3cf1b7['error']){if(_0x3cf1b7[_0xb94c('0x11')][_0xb94c('0x12')]===0x1f4){logger['error'](_0xb94c('0x13'),_0x4e73e7,_0x3cf1b7[_0xb94c('0x11')]['message']);return _0xa94353(_0x3cf1b7[_0xb94c('0x11')][_0xb94c('0x14')]);}logger[_0xb94c('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x4e73e7,_0x3cf1b7[_0xb94c('0x11')][_0xb94c('0x14')]);return _0xe32aa2(_0x3cf1b7['error'][_0xb94c('0x14')]);}else{logger[_0xb94c('0xd')](_0xb94c('0x13'),_0x4e73e7,_0xb94c('0xe'));_0xe32aa2(_0x3cf1b7[_0xb94c('0x15')][_0xb94c('0x14')]);}})[_0xb94c('0x16')](function(_0x872d5c){logger[_0xb94c('0x11')](_0xb94c('0x13'),_0x4e73e7,_0x872d5c);_0xa94353(_0x872d5c);});});} \ No newline at end of file +var _0xc21e=['bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash'];(function(_0x200618,_0x9cf7c2){var _0x2fe3bb=function(_0xcecdf7){while(--_0xcecdf7){_0x200618['push'](_0x200618['shift']());}};_0x2fe3bb(++_0x9cf7c2);}(_0xc21e,0x17b));var _0xec21=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xc21e[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xec21('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xec21('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xec21('0x2'));var db=require(_0xec21('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xec21('0x4'))(_0xec21('0x5'));var config=require(_0xec21('0x6'));var jayson=require(_0xec21('0x7'));var client=jayson['client'][_0xec21('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1438b2,_0x5d7f8c,_0x310012){return new BPromise(function(_0x3d818f,_0x17ee07){return client[_0xec21('0x9')](_0x1438b2,_0x310012)[_0xec21('0xa')](function(_0x245a60){logger['info'](_0xec21('0xb'),_0x5d7f8c,_0xec21('0xc'));logger[_0xec21('0xd')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x5d7f8c,_0xec21('0xc'),JSON['stringify'](_0x245a60));if(_0x245a60[_0xec21('0xe')]){if(_0x245a60[_0xec21('0xe')][_0xec21('0xf')]===0x1f4){logger['error'](_0xec21('0xb'),_0x5d7f8c,_0x245a60[_0xec21('0xe')][_0xec21('0x10')]);return _0x17ee07(_0x245a60[_0xec21('0xe')]['message']);}logger[_0xec21('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x5d7f8c,_0x245a60['error'][_0xec21('0x10')]);return _0x3d818f(_0x245a60[_0xec21('0xe')][_0xec21('0x10')]);}else{logger[_0xec21('0x11')](_0xec21('0xb'),_0x5d7f8c,_0xec21('0xc'));_0x3d818f(_0x245a60[_0xec21('0x12')][_0xec21('0x10')]);}})[_0xec21('0x13')](function(_0x3ae3a7){logger[_0xec21('0xe')](_0xec21('0xb'),_0x5d7f8c,_0x3ae3a7);_0x17ee07(_0x3ae3a7);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index bd14d9c..d08ac0f 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 _0xb7b6=['getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x155a6c,_0x48b201){var _0x6497d=function(_0x11a6c9){while(--_0x11a6c9){_0x155a6c['push'](_0x155a6c['shift']());}};_0x6497d(++_0x48b201);}(_0xb7b6,0x1be));var _0x6b7b=function(_0x1002de,_0x4718ad){_0x1002de=_0x1002de-0x0;var _0x1a420d=_0xb7b6[_0x1002de];return _0x1a420d;};'use strict';var multer=require(_0x6b7b('0x0'));var util=require(_0x6b7b('0x1'));var path=require('path');var timeout=require(_0x6b7b('0x2'));var express=require(_0x6b7b('0x3'));var router=express[_0x6b7b('0x4')]();var fs_extra=require(_0x6b7b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6b7b('0x6'));var config=require('../../config/environment');var controller=require(_0x6b7b('0x7'));router[_0x6b7b('0x8')]('/',auth[_0x6b7b('0x9')](),controller[_0x6b7b('0xa')]);router[_0x6b7b('0x8')](_0x6b7b('0xb'),auth[_0x6b7b('0x9')](),controller[_0x6b7b('0xc')]);router[_0x6b7b('0x8')](_0x6b7b('0xd'),auth['isAuthenticated'](),controller[_0x6b7b('0xe')]);router[_0x6b7b('0x8')](_0x6b7b('0xf'),auth[_0x6b7b('0x9')](),controller[_0x6b7b('0x10')]);router['post']('/',auth[_0x6b7b('0x9')](),controller['create']);router[_0x6b7b('0x11')](_0x6b7b('0xd'),auth['isAuthenticated'](),controller[_0x6b7b('0x12')]);router[_0x6b7b('0x13')]('/:id',auth[_0x6b7b('0x9')](),controller['update']);router[_0x6b7b('0x14')](_0x6b7b('0xb'),auth[_0x6b7b('0x9')](),controller[_0x6b7b('0x15')]);module[_0x6b7b('0x16')]=router; \ No newline at end of file +var _0x1b6a=['delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','create','post','put','update'];(function(_0x1bec0d,_0x338db4){var _0x49e3e3=function(_0x372c7a){while(--_0x372c7a){_0x1bec0d['push'](_0x1bec0d['shift']());}};_0x49e3e3(++_0x338db4);}(_0x1b6a,0x11b));var _0xa1b6=function(_0x4d8857,_0x3428c0){_0x4d8857=_0x4d8857-0x0;var _0x34bf9a=_0x1b6a[_0x4d8857];return _0x34bf9a;};'use strict';var multer=require(_0xa1b6('0x0'));var util=require(_0xa1b6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa1b6('0x2'));var router=express[_0xa1b6('0x3')]();var fs_extra=require(_0xa1b6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa1b6('0x5'));var config=require(_0xa1b6('0x6'));var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth[_0xa1b6('0x7')](),controller[_0xa1b6('0x8')]);router[_0xa1b6('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xa1b6('0xa')]);router[_0xa1b6('0x9')](_0xa1b6('0xb'),auth['isAuthenticated'](),controller[_0xa1b6('0xc')]);router['get']('/:id/fields',auth[_0xa1b6('0x7')](),controller['getFields']);router['post']('/',auth[_0xa1b6('0x7')](),controller[_0xa1b6('0xd')]);router[_0xa1b6('0xe')](_0xa1b6('0xb'),auth[_0xa1b6('0x7')](),controller['addConfiguration']);router[_0xa1b6('0xf')]('/:id',auth[_0xa1b6('0x7')](),controller[_0xa1b6('0x10')]);router[_0xa1b6('0x11')]('/:id',auth[_0xa1b6('0x7')](),controller[_0xa1b6('0x12')]);module[_0xa1b6('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 1862744..8858f12 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 _0xa456=['STRING','username','sequelize','exports'];(function(_0x37c8a3,_0x98a584){var _0x2f2f70=function(_0x25517a){while(--_0x25517a){_0x37c8a3['push'](_0x37c8a3['shift']());}};_0x2f2f70(++_0x98a584);}(_0xa456,0x142));var _0x6a45=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xa456[_0x432fca];return _0x3adba4;};'use strict';var Sequelize=require(_0x6a45('0x0'));module[_0x6a45('0x1')]={'name':{'type':Sequelize[_0x6a45('0x2')]},'description':{'type':Sequelize[_0x6a45('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6a45('0x3')},'apiKey':{'type':Sequelize[_0x6a45('0x2')]},'remoteUri':{'type':Sequelize[_0x6a45('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6a45('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x236c=['remoteUri','sequelize','STRING','username'];(function(_0x25771c,_0x4573df){var _0x68c135=function(_0x473345){while(--_0x473345){_0x25771c['push'](_0x25771c['shift']());}};_0x68c135(++_0x4573df);}(_0x236c,0x155));var _0xc236=function(_0x280afc,_0x299ac0){_0x280afc=_0x280afc-0x0;var _0x58a6ae=_0x236c[_0x280afc];return _0x58a6ae;};'use strict';var Sequelize=require(_0xc236('0x0'));module['exports']={'name':{'type':Sequelize[_0xc236('0x1')]},'description':{'type':Sequelize[_0xc236('0x1')]},'username':{'type':Sequelize[_0xc236('0x1')],'unique':_0xc236('0x2')},'apiKey':{'type':Sequelize[_0xc236('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xc236('0x3')},'serverUrl':{'type':Sequelize[_0xc236('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 1418e48..a7e216f 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 _0xd52a=['offset','undefined','count','set','apply','reject','save','then','stack','name','send','index','map','FreshdeskAccount','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','body','update','find','destroy','getConfigurations','FreshdeskConfiguration','addConfiguration','findOne','AccountId','Subjects','Descriptions','getDescriptions','channel','type','FreshdeskField','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:X','toString','base64','subject','agent','description','priority','group','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','stringify','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json'];(function(_0x17b207,_0x36a21d){var _0x2630b9=function(_0x5cd15e){while(--_0x5cd15e){_0x17b207['push'](_0x17b207['shift']());}};_0x2630b9(++_0x36a21d);}(_0xd52a,0xca));var _0xad52=function(_0x30ecfc,_0x3f28c3){_0x30ecfc=_0x30ecfc-0x0;var _0x3c3605=_0xd52a[_0x30ecfc];return _0x3c3605;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xad52('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad52('0x1'));var rp=require(_0xad52('0x2'));var moment=require(_0xad52('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xad52('0x4'));var util=require(_0xad52('0x5'));var path=require(_0xad52('0x6'));var sox=require(_0xad52('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xad52('0x8'));var squel=require('squel');var crypto=require(_0xad52('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xad52('0xa'));var toCsv=require(_0xad52('0xb'));var querystring=require('querystring');var Papa=require(_0xad52('0xc'));var Redis=require('ioredis');var authService=require(_0xad52('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xad52('0xe'));var hardwareService=require(_0xad52('0xf'));var logger=require(_0xad52('0x10'))(_0xad52('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xad52('0x12'))['db'];var integrations=require(_0xad52('0x13'));function respondWithStatusCode(_0x378b0c,_0x41331e){_0x41331e=_0x41331e||0xcc;return function(_0x11127c){if(_0x11127c){return _0x378b0c[_0xad52('0x14')](_0x41331e);}return _0x378b0c[_0xad52('0x15')](_0x41331e)[_0xad52('0x16')]();};}function respondWithResult(_0x3d2df6,_0x5727a2){_0x5727a2=_0x5727a2||0xc8;return function(_0x330794){if(_0x330794){return _0x3d2df6[_0xad52('0x15')](_0x5727a2)[_0xad52('0x17')](_0x330794);}};}function respondWithFilteredResult(_0x42eb20,_0x38be7e){return function(_0xcb6cd5){if(_0xcb6cd5){var _0x2bbaad=typeof _0x38be7e[_0xad52('0x18')]===_0xad52('0x19')&&typeof _0x38be7e['limit']==='undefined';var _0x2f8ac5=_0xcb6cd5[_0xad52('0x1a')];var _0x351440=_0x2bbaad?0x0:_0x38be7e[_0xad52('0x18')];var _0x33da89=_0x2bbaad?_0xcb6cd5['count']:_0x38be7e[_0xad52('0x18')]+_0x38be7e['limit'];var _0x164ffd;if(_0x33da89>=_0x2f8ac5){_0x33da89=_0x2f8ac5;_0x164ffd=0xc8;}else{_0x164ffd=0xce;}_0x42eb20[_0xad52('0x15')](_0x164ffd);return _0x42eb20[_0xad52('0x1b')]('Content-Range',_0x351440+'-'+_0x33da89+'/'+_0x2f8ac5)[_0xad52('0x17')](_0xcb6cd5);}return null;};}function patchUpdates(_0x593dfd){return function(_0x1bc745){try{jsonpatch[_0xad52('0x1c')](_0x1bc745,_0x593dfd,!![]);}catch(_0x3262e4){return BPromise[_0xad52('0x1d')](_0x3262e4);}return _0x1bc745[_0xad52('0x1e')]();};}function saveUpdates(_0x2f1526,_0x4b5f2f){return function(_0x7de59d){if(_0x7de59d){return _0x7de59d['update'](_0x2f1526)[_0xad52('0x1f')](function(_0x2acbb4){return _0x2acbb4;});}return null;};}function removeEntity(_0x2fa90c,_0x5bce67){return function(_0x379f53){if(_0x379f53){return _0x379f53['destroy']()['then'](function(){_0x2fa90c[_0xad52('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x477b47,_0x3a54a1){return function(_0x537df0){if(!_0x537df0){_0x477b47['sendStatus'](0x194);}return _0x537df0;};}function handleError(_0xb526bf,_0x31b5e0){_0x31b5e0=_0x31b5e0||0x1f4;return function(_0x42db69){logger['error'](_0x42db69[_0xad52('0x20')]);if(_0x42db69['name']){delete _0x42db69[_0xad52('0x21')];}_0xb526bf[_0xad52('0x15')](_0x31b5e0)[_0xad52('0x22')](_0x42db69);};}exports[_0xad52('0x23')]=function(_0x503bd0,_0x426106){var _0x2a604c={},_0x534cc5={},_0x3f5757={'count':0x0,'rows':[]};var _0x3a0fd6=_[_0xad52('0x24')](db[_0xad52('0x25')][_0xad52('0x26')],function(_0x558f90){return{'name':_0x558f90['fieldName'],'type':_0x558f90['type'][_0xad52('0x27')]};});_0x534cc5[_0xad52('0x28')]=_[_0xad52('0x24')](_0x3a0fd6,'name');_0x534cc5['query']=_[_0xad52('0x29')](_0x503bd0[_0xad52('0x2a')]);_0x534cc5[_0xad52('0x2b')]=_[_0xad52('0x2c')](_0x534cc5[_0xad52('0x28')],_0x534cc5[_0xad52('0x2a')]);_0x2a604c['attributes']=_[_0xad52('0x2c')](_0x534cc5[_0xad52('0x28')],qs[_0xad52('0x2d')](_0x503bd0[_0xad52('0x2a')][_0xad52('0x2d')]));_0x2a604c[_0xad52('0x2e')]=_0x2a604c[_0xad52('0x2e')][_0xad52('0x2f')]?_0x2a604c[_0xad52('0x2e')]:_0x534cc5[_0xad52('0x28')];if(!_0x503bd0[_0xad52('0x2a')]['hasOwnProperty'](_0xad52('0x30'))){_0x2a604c[_0xad52('0x31')]=qs[_0xad52('0x31')](_0x503bd0[_0xad52('0x2a')][_0xad52('0x31')]);_0x2a604c[_0xad52('0x18')]=qs['offset'](_0x503bd0[_0xad52('0x2a')][_0xad52('0x18')]);}_0x2a604c[_0xad52('0x32')]=qs['sort'](_0x503bd0[_0xad52('0x2a')][_0xad52('0x33')]);_0x2a604c[_0xad52('0x34')]=qs['filters'](_[_0xad52('0x35')](_0x503bd0[_0xad52('0x2a')],_0x534cc5[_0xad52('0x2b')]),_0x3a0fd6);if(_0x503bd0['query'][_0xad52('0x36')]){_0x2a604c[_0xad52('0x34')]=_[_0xad52('0x37')](_0x2a604c[_0xad52('0x34')],{'$or':_[_0xad52('0x24')](_0x3a0fd6,function(_0x2dc1f2){if(_0x2dc1f2['type']!==_0xad52('0x38')){var _0x5775b4={};_0x5775b4[_0x2dc1f2[_0xad52('0x21')]]={'$like':'%'+_0x503bd0[_0xad52('0x2a')][_0xad52('0x36')]+'%'};return _0x5775b4;}})});}_0x2a604c=_[_0xad52('0x37')]({},_0x2a604c,_0x503bd0[_0xad52('0x39')]);var _0x4aa1d1={'where':_0x2a604c[_0xad52('0x34')]};return db[_0xad52('0x25')][_0xad52('0x1a')](_0x4aa1d1)['then'](function(_0x23faff){_0x3f5757[_0xad52('0x1a')]=_0x23faff;if(_0x503bd0[_0xad52('0x2a')]['includeAll']){_0x2a604c[_0xad52('0x3a')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0xad52('0x3b')](_0x2a604c);})[_0xad52('0x1f')](function(_0x272907){_0x3f5757[_0xad52('0x3c')]=_0x272907;return _0x3f5757;})['then'](respondWithFilteredResult(_0x426106,_0x2a604c))[_0xad52('0x3d')](handleError(_0x426106,null));};exports[_0xad52('0x3e')]=function(_0x249724,_0x2bd94a){var _0x3886ec={'raw':![],'where':{'id':_0x249724[_0xad52('0x3f')]['id']}},_0x44a56b={};_0x44a56b[_0xad52('0x28')]=_['keys'](db[_0xad52('0x25')]['rawAttributes']);_0x44a56b[_0xad52('0x2a')]=_[_0xad52('0x29')](_0x249724[_0xad52('0x2a')]);_0x44a56b[_0xad52('0x2b')]=_[_0xad52('0x2c')](_0x44a56b[_0xad52('0x28')],_0x44a56b[_0xad52('0x2a')]);_0x3886ec[_0xad52('0x2e')]=_[_0xad52('0x2c')](_0x44a56b[_0xad52('0x28')],qs[_0xad52('0x2d')](_0x249724[_0xad52('0x2a')][_0xad52('0x2d')]));_0x3886ec[_0xad52('0x2e')]=_0x3886ec[_0xad52('0x2e')][_0xad52('0x2f')]?_0x3886ec[_0xad52('0x2e')]:_0x44a56b[_0xad52('0x28')];if(_0x249724[_0xad52('0x2a')][_0xad52('0x40')]){_0x3886ec['include']=[{'all':!![]}];}_0x3886ec=_[_0xad52('0x37')]({},_0x3886ec,_0x249724[_0xad52('0x39')]);return db[_0xad52('0x25')]['find'](_0x3886ec)[_0xad52('0x1f')](handleEntityNotFound(_0x2bd94a,null))['then'](respondWithResult(_0x2bd94a,null))[_0xad52('0x3d')](handleError(_0x2bd94a,null));};exports['create']=function(_0x4cf477,_0x35eaac){return db[_0xad52('0x25')][_0xad52('0x41')](_0x4cf477[_0xad52('0x42')],{})['then'](respondWithResult(_0x35eaac,0xc9))['catch'](handleError(_0x35eaac,null));};exports[_0xad52('0x43')]=function(_0x5dede4,_0x207096){if(_0x5dede4['body']['id']){delete _0x5dede4[_0xad52('0x42')]['id'];}return db[_0xad52('0x25')][_0xad52('0x44')]({'where':{'id':_0x5dede4[_0xad52('0x3f')]['id']}})[_0xad52('0x1f')](handleEntityNotFound(_0x207096,null))[_0xad52('0x1f')](saveUpdates(_0x5dede4['body'],null))[_0xad52('0x1f')](respondWithResult(_0x207096,null))[_0xad52('0x3d')](handleError(_0x207096,null));};exports[_0xad52('0x45')]=function(_0xb3a238,_0x4ab950){return db[_0xad52('0x25')][_0xad52('0x44')]({'where':{'id':_0xb3a238[_0xad52('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4ab950,null))[_0xad52('0x1f')](removeEntity(_0x4ab950,null))[_0xad52('0x3d')](handleError(_0x4ab950,null));};exports[_0xad52('0x46')]=function(_0xe9baec,_0x4a35ef,_0x32a6c3){var _0x36d038={};var _0x15533a={};var _0x35d509;var _0x197fac;return db['FreshdeskAccount']['findOne']({'where':{'id':_0xe9baec[_0xad52('0x3f')]['id']}})[_0xad52('0x1f')](handleEntityNotFound(_0x4a35ef,null))[_0xad52('0x1f')](function(_0x93114f){if(_0x93114f){_0x35d509=_0x93114f;_0x15533a[_0xad52('0x28')]=_['keys'](db[_0xad52('0x47')]['rawAttributes']);_0x15533a[_0xad52('0x2a')]=_[_0xad52('0x29')](_0xe9baec[_0xad52('0x2a')]);_0x15533a['filters']=_[_0xad52('0x2c')](_0x15533a['model'],_0x15533a[_0xad52('0x2a')]);_0x36d038[_0xad52('0x2e')]=_[_0xad52('0x2c')](_0x15533a['model'],qs['fields'](_0xe9baec[_0xad52('0x2a')]['fields']));_0x36d038[_0xad52('0x2e')]=_0x36d038[_0xad52('0x2e')]['length']?_0x36d038[_0xad52('0x2e')]:_0x15533a['model'];_0x36d038[_0xad52('0x32')]=qs[_0xad52('0x33')](_0xe9baec[_0xad52('0x2a')][_0xad52('0x33')]);_0x36d038['where']=qs['filters'](_[_0xad52('0x35')](_0xe9baec[_0xad52('0x2a')],_0x15533a['filters']));if(_0xe9baec[_0xad52('0x2a')][_0xad52('0x36')]){_0x36d038[_0xad52('0x34')]=_[_0xad52('0x37')](_0x36d038['where'],{'$or':_[_0xad52('0x24')](_0x36d038[_0xad52('0x2e')],function(_0x40b3e9){var _0x4082d7={};_0x4082d7[_0x40b3e9]={'$like':'%'+_0xe9baec[_0xad52('0x2a')][_0xad52('0x36')]+'%'};return _0x4082d7;})});}_0x36d038=_[_0xad52('0x37')]({},_0x36d038,_0xe9baec[_0xad52('0x39')]);return _0x35d509['getConfigurations'](_0x36d038);}})['then'](function(_0x1778fa){if(_0x1778fa){_0x197fac=_0x1778fa[_0xad52('0x2f')];if(!_0xe9baec[_0xad52('0x2a')]['hasOwnProperty'](_0xad52('0x30'))){_0x36d038[_0xad52('0x31')]=qs[_0xad52('0x31')](_0xe9baec['query'][_0xad52('0x31')]);_0x36d038['offset']=qs[_0xad52('0x18')](_0xe9baec['query']['offset']);}return _0x35d509[_0xad52('0x46')](_0x36d038);}})[_0xad52('0x1f')](function(_0x4fbc36){if(_0x4fbc36){return _0x4fbc36?{'count':_0x197fac,'rows':_0x4fbc36}:null;}})['then'](respondWithResult(_0x4a35ef,null))['catch'](handleError(_0x4a35ef,null));};exports[_0xad52('0x48')]=function(_0x46039d,_0x482f93,_0x42d855){if(_0x46039d[_0xad52('0x42')]['id']){delete _0x46039d[_0xad52('0x42')]['id'];}return db['FreshdeskAccount'][_0xad52('0x49')]({'where':{'id':_0x46039d[_0xad52('0x3f')]['id']}})[_0xad52('0x1f')](handleEntityNotFound(_0x482f93,null))['then'](function(_0x551aa6){if(_0x551aa6){_0x46039d[_0xad52('0x42')][_0xad52('0x4a')]=_0x551aa6['id'];_0x46039d[_0xad52('0x42')][_0xad52('0x4b')]=integrations['getSubjects'](_0x46039d[_0xad52('0x42')]['channel'],_0x46039d[_0xad52('0x42')]['type']);_0x46039d[_0xad52('0x42')][_0xad52('0x4c')]=integrations[_0xad52('0x4d')](_0x46039d[_0xad52('0x42')][_0xad52('0x4e')],_0x46039d[_0xad52('0x42')][_0xad52('0x4f')]);return db[_0xad52('0x47')][_0xad52('0x41')](_0x46039d[_0xad52('0x42')],{'include':[{'model':db[_0xad52('0x50')],'as':'Subjects'},{'model':db['FreshdeskField'],'as':_0xad52('0x4c')}]});}return null;})['then'](respondWithResult(_0x482f93,null))[_0xad52('0x3d')](handleError(_0x482f93,null));};exports[_0xad52('0x51')]=function(_0x2b4d14,_0x500058,_0x3b865f){var _0x55b17b='';return db['FreshdeskAccount'][_0xad52('0x49')]({'where':{'id':_0x2b4d14[_0xad52('0x3f')]['id']},'attributes':['id',_0xad52('0x52'),_0xad52('0x53')]})[_0xad52('0x1f')](handleEntityNotFound(_0x500058,null))['then'](function(_0x290f9a){if(_0x290f9a){_0x55b17b=_0x290f9a['remoteUri'];var _0x2d160e=_0x55b17b[_0xad52('0x54')](-0x1);if(_0x2d160e==='/'){_0x55b17b=_0x55b17b['substring'](0x0,_0x55b17b[_0xad52('0x55')](_0x2d160e));}return rp({'method':_0xad52('0x56'),'uri':util[_0xad52('0x57')](_0xad52('0x58'),_0x55b17b,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xad52('0x57')](_0xad52('0x59'),new Buffer(util[_0xad52('0x57')](_0xad52('0x5a'),_0x290f9a[_0xad52('0x53')]))[_0xad52('0x5b')](_0xad52('0x5c')))},'json':!![]});}})[_0xad52('0x1f')](function(_0x3bc927){if(_0x3bc927){var _0x31422e=['requester',_0xad52('0x5d'),_0xad52('0x5e'),_0xad52('0x5f'),'status',_0xad52('0x60'),_0xad52('0x61'),_0xad52('0x62'),_0xad52('0x63'),_0xad52('0x61'),_0xad52('0x64')];_[_0xad52('0x65')](_0x3bc927,function(_0x233404){return _0x31422e[_0xad52('0x66')](_0x233404[_0xad52('0x21')])||!_0x233404[_0xad52('0x67')]&&_0x233404[_0xad52('0x4f')]!==_0xad52('0x68')&&_0x233404[_0xad52('0x4f')]!==_0xad52('0x69');});return{'count':_0x3bc927[_0xad52('0x2f')],'rows':_['map'](_0x3bc927,function(_0x13c1e0){return{'id':_0x13c1e0[_0xad52('0x21')],'name':_0x13c1e0[_0xad52('0x6a')],'custom':!_0x13c1e0[_0xad52('0x67')],'options':_0x13c1e0[_0xad52('0x6b')]?_[_0xad52('0x24')](_0x13c1e0[_0xad52('0x6b')],function(_0x236261){return{'name':_[_0xad52('0x6c')](_0x236261),'value':_0x236261};}):[]};})};}})[_0xad52('0x1f')](respondWithResult(_0x500058,null))['catch'](function(_0x461e3a){var _0x14e0de=_0x2b4d14[_0xad52('0x2a')][_0xad52('0x6d')]?0x1f4:_0x461e3a[_0xad52('0x6e')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x14e0de,JSON[_0xad52('0x6f')](_0x461e3a));delete _0x461e3a['name'];if(_0x14e0de===0x191){_0x14e0de=0x190;}_0x500058[_0xad52('0x15')](_0x14e0de)['send'](_0x2b4d14['query'][_0xad52('0x6d')]?{'message':_0xad52('0x70'),'statusCode':_0x461e3a[_0xad52('0x6e')]}:_0x461e3a);});}; \ No newline at end of file +var _0x45c8=['requester','subject','agent','description','source','group','remove','default','custom_text','custom_dropdown','label','choices','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','sendStatus','stack','name','send','index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','find','create','body','update','getConfigurations','findOne','FreshdeskConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','slice','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','base64'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x45c8,0xef));var _0x845c=function(_0x5dba73,_0xba61f0){_0x5dba73=_0x5dba73-0x0;var _0x90c71d=_0x45c8[_0x5dba73];return _0x90c71d;};'use strict';var emlformat=require(_0x845c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x845c('0x1'));var jsonpatch=require(_0x845c('0x2'));var rp=require(_0x845c('0x3'));var moment=require(_0x845c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x845c('0x5'));var csv=require(_0x845c('0x6'));var ejs=require(_0x845c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x845c('0x8'));var squel=require('squel');var crypto=require(_0x845c('0x9'));var jsforce=require(_0x845c('0xa'));var deskjs=require(_0x845c('0xb'));var toCsv=require(_0x845c('0x6'));var querystring=require(_0x845c('0xc'));var Papa=require(_0x845c('0xd'));var Redis=require(_0x845c('0xe'));var authService=require(_0x845c('0xf'));var qs=require(_0x845c('0x10'));var as=require(_0x845c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x845c('0x12'));var utils=require(_0x845c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x845c('0x14'));var db=require(_0x845c('0x15'))['db'];var integrations=require(_0x845c('0x16'));function respondWithStatusCode(_0x3312bd,_0x469056){_0x469056=_0x469056||0xcc;return function(_0x246cef){if(_0x246cef){return _0x3312bd['sendStatus'](_0x469056);}return _0x3312bd[_0x845c('0x17')](_0x469056)[_0x845c('0x18')]();};}function respondWithResult(_0x5c0d9c,_0x185eb0){_0x185eb0=_0x185eb0||0xc8;return function(_0x3ca30e){if(_0x3ca30e){return _0x5c0d9c[_0x845c('0x17')](_0x185eb0)[_0x845c('0x19')](_0x3ca30e);}};}function respondWithFilteredResult(_0xf0cc1b,_0x27cedd){return function(_0x14b400){if(_0x14b400){var _0x4cbe3d=typeof _0x27cedd['offset']===_0x845c('0x1a')&&typeof _0x27cedd[_0x845c('0x1b')]===_0x845c('0x1a');var _0x4ac4d0=_0x14b400[_0x845c('0x1c')];var _0x104314=_0x4cbe3d?0x0:_0x27cedd[_0x845c('0x1d')];var _0x48e7d4=_0x4cbe3d?_0x14b400['count']:_0x27cedd['offset']+_0x27cedd[_0x845c('0x1b')];var _0x5171ed;if(_0x48e7d4>=_0x4ac4d0){_0x48e7d4=_0x4ac4d0;_0x5171ed=0xc8;}else{_0x5171ed=0xce;}_0xf0cc1b[_0x845c('0x17')](_0x5171ed);return _0xf0cc1b[_0x845c('0x1e')](_0x845c('0x1f'),_0x104314+'-'+_0x48e7d4+'/'+_0x4ac4d0)[_0x845c('0x19')](_0x14b400);}return null;};}function patchUpdates(_0x4629d4){return function(_0x55418b){try{jsonpatch[_0x845c('0x20')](_0x55418b,_0x4629d4,!![]);}catch(_0x513ba1){return BPromise[_0x845c('0x21')](_0x513ba1);}return _0x55418b['save']();};}function saveUpdates(_0x2c6bc8,_0x5767e8){return function(_0x18ed7c){if(_0x18ed7c){return _0x18ed7c['update'](_0x2c6bc8)[_0x845c('0x22')](function(_0x21dfef){return _0x21dfef;});}return null;};}function removeEntity(_0x362975,_0x129b6e){return function(_0x132516){if(_0x132516){return _0x132516[_0x845c('0x23')]()['then'](function(){_0x362975[_0x845c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26327b,_0x28f05d){return function(_0x49a2ef){if(!_0x49a2ef){_0x26327b[_0x845c('0x24')](0x194);}return _0x49a2ef;};}function handleError(_0x236529,_0x189c19){_0x189c19=_0x189c19||0x1f4;return function(_0x5ca436){logger['error'](_0x5ca436[_0x845c('0x25')]);if(_0x5ca436[_0x845c('0x26')]){delete _0x5ca436[_0x845c('0x26')];}_0x236529['status'](_0x189c19)[_0x845c('0x27')](_0x5ca436);};}exports[_0x845c('0x28')]=function(_0x447d69,_0x2ba824){var _0x5d7b58={},_0x19a44b={},_0x2003f6={'count':0x0,'rows':[]};var _0x32ba01=_['map'](db[_0x845c('0x29')][_0x845c('0x2a')],function(_0x578d3b){return{'name':_0x578d3b[_0x845c('0x2b')],'type':_0x578d3b[_0x845c('0x2c')][_0x845c('0x2d')]};});_0x19a44b[_0x845c('0x2e')]=_['map'](_0x32ba01,'name');_0x19a44b[_0x845c('0x2f')]=_[_0x845c('0x30')](_0x447d69[_0x845c('0x2f')]);_0x19a44b[_0x845c('0x31')]=_[_0x845c('0x32')](_0x19a44b[_0x845c('0x2e')],_0x19a44b[_0x845c('0x2f')]);_0x5d7b58[_0x845c('0x33')]=_[_0x845c('0x32')](_0x19a44b[_0x845c('0x2e')],qs[_0x845c('0x34')](_0x447d69['query'][_0x845c('0x34')]));_0x5d7b58['attributes']=_0x5d7b58[_0x845c('0x33')][_0x845c('0x35')]?_0x5d7b58[_0x845c('0x33')]:_0x19a44b[_0x845c('0x2e')];if(!_0x447d69[_0x845c('0x2f')]['hasOwnProperty'](_0x845c('0x36'))){_0x5d7b58[_0x845c('0x1b')]=qs['limit'](_0x447d69['query'][_0x845c('0x1b')]);_0x5d7b58['offset']=qs[_0x845c('0x1d')](_0x447d69['query'][_0x845c('0x1d')]);}_0x5d7b58['order']=qs['sort'](_0x447d69[_0x845c('0x2f')][_0x845c('0x37')]);_0x5d7b58[_0x845c('0x38')]=qs[_0x845c('0x31')](_[_0x845c('0x39')](_0x447d69[_0x845c('0x2f')],_0x19a44b['filters']),_0x32ba01);if(_0x447d69[_0x845c('0x2f')]['filter']){_0x5d7b58[_0x845c('0x38')]=_[_0x845c('0x3a')](_0x5d7b58[_0x845c('0x38')],{'$or':_[_0x845c('0x3b')](_0x32ba01,function(_0x3563e8){if(_0x3563e8[_0x845c('0x2c')]!==_0x845c('0x3c')){var _0x3510cc={};_0x3510cc[_0x3563e8[_0x845c('0x26')]]={'$like':'%'+_0x447d69['query'][_0x845c('0x3d')]+'%'};return _0x3510cc;}})});}_0x5d7b58=_[_0x845c('0x3a')]({},_0x5d7b58,_0x447d69[_0x845c('0x3e')]);var _0x20227d={'where':_0x5d7b58[_0x845c('0x38')]};return db[_0x845c('0x29')][_0x845c('0x1c')](_0x20227d)[_0x845c('0x22')](function(_0x22b604){_0x2003f6[_0x845c('0x1c')]=_0x22b604;if(_0x447d69['query'][_0x845c('0x3f')]){_0x5d7b58[_0x845c('0x40')]=[{'all':!![]}];}return db[_0x845c('0x29')][_0x845c('0x41')](_0x5d7b58);})['then'](function(_0x12907e){_0x2003f6['rows']=_0x12907e;return _0x2003f6;})['then'](respondWithFilteredResult(_0x2ba824,_0x5d7b58))[_0x845c('0x42')](handleError(_0x2ba824,null));};exports['show']=function(_0x54d515,_0x4435b8){var _0x1022ad={'raw':![],'where':{'id':_0x54d515[_0x845c('0x43')]['id']}},_0x3d0cad={};_0x3d0cad['model']=_['keys'](db['FreshdeskAccount'][_0x845c('0x2a')]);_0x3d0cad[_0x845c('0x2f')]=_['keys'](_0x54d515['query']);_0x3d0cad[_0x845c('0x31')]=_[_0x845c('0x32')](_0x3d0cad[_0x845c('0x2e')],_0x3d0cad[_0x845c('0x2f')]);_0x1022ad['attributes']=_[_0x845c('0x32')](_0x3d0cad[_0x845c('0x2e')],qs[_0x845c('0x34')](_0x54d515['query'][_0x845c('0x34')]));_0x1022ad[_0x845c('0x33')]=_0x1022ad[_0x845c('0x33')][_0x845c('0x35')]?_0x1022ad[_0x845c('0x33')]:_0x3d0cad['model'];if(_0x54d515[_0x845c('0x2f')]['includeAll']){_0x1022ad[_0x845c('0x40')]=[{'all':!![]}];}_0x1022ad=_[_0x845c('0x3a')]({},_0x1022ad,_0x54d515[_0x845c('0x3e')]);return db[_0x845c('0x29')][_0x845c('0x44')](_0x1022ad)[_0x845c('0x22')](handleEntityNotFound(_0x4435b8,null))[_0x845c('0x22')](respondWithResult(_0x4435b8,null))[_0x845c('0x42')](handleError(_0x4435b8,null));};exports[_0x845c('0x45')]=function(_0x4c706b,_0xeb86a5){return db['FreshdeskAccount'][_0x845c('0x45')](_0x4c706b[_0x845c('0x46')],{})[_0x845c('0x22')](respondWithResult(_0xeb86a5,0xc9))[_0x845c('0x42')](handleError(_0xeb86a5,null));};exports[_0x845c('0x47')]=function(_0x380b74,_0xde0287){if(_0x380b74[_0x845c('0x46')]['id']){delete _0x380b74[_0x845c('0x46')]['id'];}return db[_0x845c('0x29')][_0x845c('0x44')]({'where':{'id':_0x380b74[_0x845c('0x43')]['id']}})[_0x845c('0x22')](handleEntityNotFound(_0xde0287,null))[_0x845c('0x22')](saveUpdates(_0x380b74[_0x845c('0x46')],null))[_0x845c('0x22')](respondWithResult(_0xde0287,null))['catch'](handleError(_0xde0287,null));};exports[_0x845c('0x23')]=function(_0x1f2f80,_0x41a4c9){return db[_0x845c('0x29')][_0x845c('0x44')]({'where':{'id':_0x1f2f80[_0x845c('0x43')]['id']}})[_0x845c('0x22')](handleEntityNotFound(_0x41a4c9,null))['then'](removeEntity(_0x41a4c9,null))['catch'](handleError(_0x41a4c9,null));};exports[_0x845c('0x48')]=function(_0x3b5059,_0x3a8a67,_0x526dba){var _0x4766f2={};var _0xed4ab2={};var _0x369ff6;var _0x4b582c;return db['FreshdeskAccount'][_0x845c('0x49')]({'where':{'id':_0x3b5059[_0x845c('0x43')]['id']}})['then'](handleEntityNotFound(_0x3a8a67,null))[_0x845c('0x22')](function(_0x5f39a7){if(_0x5f39a7){_0x369ff6=_0x5f39a7;_0xed4ab2[_0x845c('0x2e')]=_[_0x845c('0x30')](db[_0x845c('0x4a')][_0x845c('0x2a')]);_0xed4ab2[_0x845c('0x2f')]=_['keys'](_0x3b5059['query']);_0xed4ab2[_0x845c('0x31')]=_['intersection'](_0xed4ab2[_0x845c('0x2e')],_0xed4ab2[_0x845c('0x2f')]);_0x4766f2[_0x845c('0x33')]=_[_0x845c('0x32')](_0xed4ab2['model'],qs[_0x845c('0x34')](_0x3b5059[_0x845c('0x2f')][_0x845c('0x34')]));_0x4766f2[_0x845c('0x33')]=_0x4766f2['attributes'][_0x845c('0x35')]?_0x4766f2[_0x845c('0x33')]:_0xed4ab2[_0x845c('0x2e')];_0x4766f2[_0x845c('0x4b')]=qs[_0x845c('0x37')](_0x3b5059[_0x845c('0x2f')]['sort']);_0x4766f2['where']=qs['filters'](_['pick'](_0x3b5059[_0x845c('0x2f')],_0xed4ab2[_0x845c('0x31')]));if(_0x3b5059[_0x845c('0x2f')][_0x845c('0x3d')]){_0x4766f2['where']=_[_0x845c('0x3a')](_0x4766f2[_0x845c('0x38')],{'$or':_['map'](_0x4766f2[_0x845c('0x33')],function(_0x540dda){var _0x5e0ded={};_0x5e0ded[_0x540dda]={'$like':'%'+_0x3b5059[_0x845c('0x2f')][_0x845c('0x3d')]+'%'};return _0x5e0ded;})});}_0x4766f2=_[_0x845c('0x3a')]({},_0x4766f2,_0x3b5059[_0x845c('0x3e')]);return _0x369ff6['getConfigurations'](_0x4766f2);}})['then'](function(_0x30017d){if(_0x30017d){_0x4b582c=_0x30017d[_0x845c('0x35')];if(!_0x3b5059[_0x845c('0x2f')]['hasOwnProperty'](_0x845c('0x36'))){_0x4766f2[_0x845c('0x1b')]=qs[_0x845c('0x1b')](_0x3b5059['query'][_0x845c('0x1b')]);_0x4766f2[_0x845c('0x1d')]=qs[_0x845c('0x1d')](_0x3b5059['query'][_0x845c('0x1d')]);}return _0x369ff6['getConfigurations'](_0x4766f2);}})[_0x845c('0x22')](function(_0x463f09){if(_0x463f09){return _0x463f09?{'count':_0x4b582c,'rows':_0x463f09}:null;}})[_0x845c('0x22')](respondWithResult(_0x3a8a67,null))[_0x845c('0x42')](handleError(_0x3a8a67,null));};exports[_0x845c('0x4c')]=function(_0x709945,_0x413ddc,_0xb3e7f){if(_0x709945[_0x845c('0x46')]['id']){delete _0x709945[_0x845c('0x46')]['id'];}return db[_0x845c('0x29')][_0x845c('0x49')]({'where':{'id':_0x709945[_0x845c('0x43')]['id']}})['then'](handleEntityNotFound(_0x413ddc,null))[_0x845c('0x22')](function(_0x439e2c){if(_0x439e2c){_0x709945['body'][_0x845c('0x4d')]=_0x439e2c['id'];_0x709945[_0x845c('0x46')][_0x845c('0x4e')]=integrations[_0x845c('0x4f')](_0x709945['body']['channel'],_0x709945[_0x845c('0x46')][_0x845c('0x2c')]);_0x709945[_0x845c('0x46')]['Descriptions']=integrations[_0x845c('0x50')](_0x709945[_0x845c('0x46')]['channel'],_0x709945[_0x845c('0x46')][_0x845c('0x2c')]);return db[_0x845c('0x4a')][_0x845c('0x45')](_0x709945[_0x845c('0x46')],{'include':[{'model':db[_0x845c('0x51')],'as':_0x845c('0x4e')},{'model':db[_0x845c('0x51')],'as':_0x845c('0x52')}]});}return null;})[_0x845c('0x22')](respondWithResult(_0x413ddc,null))[_0x845c('0x42')](handleError(_0x413ddc,null));};exports[_0x845c('0x53')]=function(_0x2eda3e,_0x1a50f9,_0x25bcc0){var _0x41c577='';return db[_0x845c('0x29')][_0x845c('0x49')]({'where':{'id':_0x2eda3e[_0x845c('0x43')]['id']},'attributes':['id',_0x845c('0x54'),'apiKey']})[_0x845c('0x22')](handleEntityNotFound(_0x1a50f9,null))[_0x845c('0x22')](function(_0x321574){if(_0x321574){_0x41c577=_0x321574[_0x845c('0x54')];var _0x248dff=_0x41c577[_0x845c('0x55')](-0x1);if(_0x248dff==='/'){_0x41c577=_0x41c577['substring'](0x0,_0x41c577['lastIndexOf'](_0x248dff));}return rp({'method':_0x845c('0x56'),'uri':util[_0x845c('0x57')](_0x845c('0x58'),_0x41c577,_0x845c('0x59')),'headers':{'Authorization':util[_0x845c('0x57')](_0x845c('0x5a'),new Buffer(util[_0x845c('0x57')](_0x845c('0x5b'),_0x321574[_0x845c('0x5c')]))['toString'](_0x845c('0x5d')))},'json':!![]});}})['then'](function(_0x457036){if(_0x457036){var _0x1f340e=[_0x845c('0x5e'),_0x845c('0x5f'),_0x845c('0x60'),_0x845c('0x61'),_0x845c('0x17'),'priority','group',_0x845c('0x62'),'ticket_type',_0x845c('0x63'),'company'];_[_0x845c('0x64')](_0x457036,function(_0x4ddde7){return _0x1f340e['includes'](_0x4ddde7['name'])||!_0x4ddde7[_0x845c('0x65')]&&_0x4ddde7[_0x845c('0x2c')]!==_0x845c('0x66')&&_0x4ddde7[_0x845c('0x2c')]!==_0x845c('0x67');});return{'count':_0x457036[_0x845c('0x35')],'rows':_[_0x845c('0x3b')](_0x457036,function(_0x2b4aab){return{'id':_0x2b4aab[_0x845c('0x26')],'name':_0x2b4aab[_0x845c('0x68')],'custom':!_0x2b4aab['default'],'options':_0x2b4aab['choices']?_['map'](_0x2b4aab[_0x845c('0x69')],function(_0x240ddb){return{'name':_['capitalize'](_0x240ddb),'value':_0x240ddb};}):[]};})};}})[_0x845c('0x22')](respondWithResult(_0x1a50f9,null))[_0x845c('0x42')](function(_0x1a4e34){var _0x10b298=_0x2eda3e['query'][_0x845c('0x6a')]?0x1f4:_0x1a4e34[_0x845c('0x6b')]||0x1f4;logger[_0x845c('0x6c')](_0x845c('0x6d'),_0x845c('0x53'),_0x10b298,JSON['stringify'](_0x1a4e34));delete _0x1a4e34['name'];if(_0x10b298===0x191){_0x10b298=0x190;}_0x1a50f9[_0x845c('0x17')](_0x10b298)[_0x845c('0x27')](_0x2eda3e[_0x845c('0x2f')][_0x845c('0x6a')]?{'message':_0x845c('0x6e'),'statusCode':_0x1a4e34[_0x845c('0x6b')]}:_0x1a4e34);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 552b4f4..c70c531 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 _0x8e60=['rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','moment','path'];(function(_0x41ffe4,_0x3a04ae){var _0x1ba9f3=function(_0x53a6b5){while(--_0x53a6b5){_0x41ffe4['push'](_0x41ffe4['shift']());}};_0x1ba9f3(++_0x3a04ae);}(_0x8e60,0x74));var _0x08e6=function(_0x1ad0d0,_0x3e4614){_0x1ad0d0=_0x1ad0d0-0x0;var _0xa5e9ae=_0x8e60[_0x1ad0d0];return _0xa5e9ae;};'use strict';var _=require('lodash');var util=require(_0x08e6('0x0'));var logger=require(_0x08e6('0x1'))('api');var moment=require(_0x08e6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x08e6('0x3'));var rimraf=require(_0x08e6('0x4'));var config=require(_0x08e6('0x5'));var attributes=require(_0x08e6('0x6'));var integrations=require(_0x08e6('0x7'));module[_0x08e6('0x8')]=function(_0xd87670,_0x189442){return _0xd87670[_0x08e6('0x9')](_0x08e6('0xa'),attributes,{'tableName':_0x08e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x946d=['FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x946d,0x154));var _0xd946=function(_0x4cd866,_0x3c92ad){_0x4cd866=_0x4cd866-0x0;var _0x268fd6=_0x946d[_0x4cd866];return _0x268fd6;};'use strict';var _=require(_0xd946('0x0'));var util=require(_0xd946('0x1'));var logger=require(_0xd946('0x2'))(_0xd946('0x3'));var moment=require('moment');var BPromise=require(_0xd946('0x4'));var rp=require(_0xd946('0x5'));var fs=require('fs');var path=require(_0xd946('0x6'));var rimraf=require(_0xd946('0x7'));var config=require('../../config/environment');var attributes=require(_0xd946('0x8'));var integrations=require(_0xd946('0x9'));module['exports']=function(_0x4fe63b,_0x1f1431){return _0x4fe63b[_0xd946('0xa')](_0xd946('0xb'),attributes,{'tableName':_0xd946('0xc'),'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 03d74fe..ea95855 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 _0x95db=['options','raw','where','attributes','include','map','model','GetFreshdeskAccount','ShowFreshdeskAccount','find','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','FreshdeskAccount','findAll'];(function(_0x30faee,_0x1c3794){var _0x3a90ab=function(_0x11129b){while(--_0x11129b){_0x30faee['push'](_0x30faee['shift']());}};_0x3a90ab(++_0x1c3794);}(_0x95db,0x1a2));var _0xb95d=function(_0x599315,_0x433c25){_0x599315=_0x599315-0x0;var _0x730a79=_0x95db[_0x599315];return _0x730a79;};'use strict';var _=require(_0xb95d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb95d('0x1'));var fs=require('fs');var Redis=require(_0xb95d('0x2'));var db=require(_0xb95d('0x3'))['db'];var utils=require(_0xb95d('0x4'));var logger=require(_0xb95d('0x5'))(_0xb95d('0x6'));var config=require('../../config/environment');var jayson=require(_0xb95d('0x7'));var client=jayson['client'][_0xb95d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38cdb3,_0x2060e5,_0x493be2){return new BPromise(function(_0x5bdb83,_0x37df4a){return client[_0xb95d('0x9')](_0x38cdb3,_0x493be2)[_0xb95d('0xa')](function(_0x808f8f){logger['info'](_0xb95d('0xb'),_0x2060e5,_0xb95d('0xc'));logger[_0xb95d('0xd')](_0xb95d('0xe'),_0x2060e5,'request\x20sent',JSON[_0xb95d('0xf')](_0x808f8f));if(_0x808f8f['error']){if(_0x808f8f[_0xb95d('0x10')][_0xb95d('0x11')]===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x2060e5,_0x808f8f['error'][_0xb95d('0x12')]);return _0x37df4a(_0x808f8f[_0xb95d('0x10')][_0xb95d('0x12')]);}logger[_0xb95d('0x10')](_0xb95d('0xb'),_0x2060e5,_0x808f8f[_0xb95d('0x10')][_0xb95d('0x12')]);return _0x5bdb83(_0x808f8f[_0xb95d('0x10')]['message']);}else{logger[_0xb95d('0x13')](_0xb95d('0xb'),_0x2060e5,'request\x20sent');_0x5bdb83(_0x808f8f[_0xb95d('0x14')][_0xb95d('0x12')]);}})[_0xb95d('0x15')](function(_0x19fd54){logger['error'](_0xb95d('0xb'),_0x2060e5,_0x19fd54);_0x37df4a(_0x19fd54);});});}exports['GetFreshdeskAccount']=function(_0x37e512){var _0xaec168=this;return new Promise(function(_0x40737f,_0x2e0735){return db[_0xb95d('0x16')][_0xb95d('0x17')]({'raw':_0x37e512['options']?_0x37e512[_0xb95d('0x18')][_0xb95d('0x19')]===undefined?!![]:![]:!![],'where':_0x37e512['options']?_0x37e512[_0xb95d('0x18')][_0xb95d('0x1a')]||null:null,'attributes':_0x37e512[_0xb95d('0x18')]?_0x37e512[_0xb95d('0x18')][_0xb95d('0x1b')]||null:null,'limit':_0x37e512[_0xb95d('0x18')]?_0x37e512['options']['limit']||null:null,'include':_0x37e512[_0xb95d('0x18')]?_0x37e512[_0xb95d('0x18')][_0xb95d('0x1c')]?_[_0xb95d('0x1d')](_0x37e512[_0xb95d('0x18')][_0xb95d('0x1c')],function(_0x579911){return{'model':db[_0x579911['model']],'as':_0x579911['as'],'attributes':_0x579911[_0xb95d('0x1b')],'include':_0x579911[_0xb95d('0x1c')]?_[_0xb95d('0x1d')](_0x579911[_0xb95d('0x1c')],function(_0x1e0fd8){return{'model':db[_0x1e0fd8[_0xb95d('0x1e')]],'as':_0x1e0fd8['as'],'attributes':_0x1e0fd8['attributes'],'include':_0x1e0fd8[_0xb95d('0x1c')]?_['map'](_0x1e0fd8[_0xb95d('0x1c')],function(_0x1a98c1){return{'model':db[_0x1a98c1[_0xb95d('0x1e')]],'as':_0x1a98c1['as'],'attributes':_0x1a98c1['attributes']};}):[]};}):[]};}):[]:[]})[_0xb95d('0xa')](function(_0x3a7239){logger['info'](_0xb95d('0x1f'),_0x37e512);logger['debug'](_0xb95d('0x1f'),_0x37e512,JSON['stringify'](_0x3a7239));_0x40737f(_0x3a7239);})[_0xb95d('0x15')](function(_0x4633e2){logger[_0xb95d('0x10')](_0xb95d('0x1f'),_0x4633e2['message'],_0x37e512);_0x2e0735(_0xaec168[_0xb95d('0x10')](0x1f4,_0x4633e2[_0xb95d('0x12')]));});});};exports[_0xb95d('0x20')]=function(_0x4404e6){var _0x15b621=this;return new Promise(function(_0x193a3f,_0x17578e){return db[_0xb95d('0x16')][_0xb95d('0x21')]({'raw':_0x4404e6[_0xb95d('0x18')]?_0x4404e6[_0xb95d('0x18')][_0xb95d('0x19')]===undefined?!![]:![]:!![],'where':_0x4404e6[_0xb95d('0x18')]?_0x4404e6[_0xb95d('0x18')][_0xb95d('0x1a')]||null:null,'attributes':_0x4404e6[_0xb95d('0x18')]?_0x4404e6[_0xb95d('0x18')][_0xb95d('0x1b')]||null:null,'include':_0x4404e6[_0xb95d('0x18')]?_0x4404e6[_0xb95d('0x18')][_0xb95d('0x1c')]?_[_0xb95d('0x1d')](_0x4404e6[_0xb95d('0x18')][_0xb95d('0x1c')],function(_0xd75ae0){return{'model':db[_0xd75ae0[_0xb95d('0x1e')]],'as':_0xd75ae0['as'],'attributes':_0xd75ae0['attributes'],'include':_0xd75ae0['include']?_['map'](_0xd75ae0['include'],function(_0x57885e){return{'model':db[_0x57885e['model']],'as':_0x57885e['as'],'attributes':_0x57885e[_0xb95d('0x1b')],'include':_0x57885e[_0xb95d('0x1c')]?_['map'](_0x57885e[_0xb95d('0x1c')],function(_0x43cea8){return{'model':db[_0x43cea8[_0xb95d('0x1e')]],'as':_0x43cea8['as'],'attributes':_0x43cea8['attributes']};}):[]};}):[]};}):[]:[]})[_0xb95d('0xa')](function(_0x15eaf6){logger[_0xb95d('0x13')](_0xb95d('0x20'),_0x4404e6);logger[_0xb95d('0xd')](_0xb95d('0x20'),_0x4404e6,JSON['stringify'](_0x15eaf6));_0x193a3f(_0x15eaf6);})['catch'](function(_0x3b2fff){logger[_0xb95d('0x10')](_0xb95d('0x20'),_0x3b2fff[_0xb95d('0x12')],_0x4404e6);_0x17578e(_0x15b621[_0xb95d('0x10')](0x1f4,_0x3b2fff[_0xb95d('0x12')]));});});}; \ No newline at end of file +var _0xbcbe=['GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xbcbe,0x1bd));var _0xebcb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcbe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xebcb('0x0'));var util=require(_0xebcb('0x1'));var moment=require(_0xebcb('0x2'));var BPromise=require(_0xebcb('0x3'));var rs=require(_0xebcb('0x4'));var fs=require('fs');var Redis=require(_0xebcb('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xebcb('0x6'))(_0xebcb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xebcb('0x8')][_0xebcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x347133,_0x25c27a,_0x2430d6){return new BPromise(function(_0x59f4b9,_0x205143){return client[_0xebcb('0xa')](_0x347133,_0x2430d6)[_0xebcb('0xb')](function(_0x1ec7b6){logger[_0xebcb('0xc')](_0xebcb('0xd'),_0x25c27a,_0xebcb('0xe'));logger[_0xebcb('0xf')](_0xebcb('0x10'),_0x25c27a,'request\x20sent',JSON[_0xebcb('0x11')](_0x1ec7b6));if(_0x1ec7b6['error']){if(_0x1ec7b6[_0xebcb('0x12')][_0xebcb('0x13')]===0x1f4){logger['error'](_0xebcb('0xd'),_0x25c27a,_0x1ec7b6[_0xebcb('0x12')]['message']);return _0x205143(_0x1ec7b6[_0xebcb('0x12')][_0xebcb('0x14')]);}logger[_0xebcb('0x12')](_0xebcb('0xd'),_0x25c27a,_0x1ec7b6[_0xebcb('0x12')][_0xebcb('0x14')]);return _0x59f4b9(_0x1ec7b6[_0xebcb('0x12')][_0xebcb('0x14')]);}else{logger[_0xebcb('0xc')](_0xebcb('0xd'),_0x25c27a,_0xebcb('0xe'));_0x59f4b9(_0x1ec7b6[_0xebcb('0x15')][_0xebcb('0x14')]);}})[_0xebcb('0x16')](function(_0x287292){logger[_0xebcb('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x25c27a,_0x287292);_0x205143(_0x287292);});});}exports[_0xebcb('0x17')]=function(_0x1e12f0){var _0x29c256=this;return new Promise(function(_0x4e33d1,_0x17c9b6){return db[_0xebcb('0x18')][_0xebcb('0x19')]({'raw':_0x1e12f0[_0xebcb('0x1a')]?_0x1e12f0[_0xebcb('0x1a')][_0xebcb('0x1b')]===undefined?!![]:![]:!![],'where':_0x1e12f0[_0xebcb('0x1a')]?_0x1e12f0[_0xebcb('0x1a')][_0xebcb('0x1c')]||null:null,'attributes':_0x1e12f0[_0xebcb('0x1a')]?_0x1e12f0[_0xebcb('0x1a')][_0xebcb('0x1d')]||null:null,'limit':_0x1e12f0[_0xebcb('0x1a')]?_0x1e12f0[_0xebcb('0x1a')][_0xebcb('0x1e')]||null:null,'include':_0x1e12f0[_0xebcb('0x1a')]?_0x1e12f0['options'][_0xebcb('0x1f')]?_[_0xebcb('0x20')](_0x1e12f0[_0xebcb('0x1a')]['include'],function(_0x1e086c){return{'model':db[_0x1e086c[_0xebcb('0x21')]],'as':_0x1e086c['as'],'attributes':_0x1e086c[_0xebcb('0x1d')],'include':_0x1e086c[_0xebcb('0x1f')]?_[_0xebcb('0x20')](_0x1e086c[_0xebcb('0x1f')],function(_0x3804dd){return{'model':db[_0x3804dd[_0xebcb('0x21')]],'as':_0x3804dd['as'],'attributes':_0x3804dd[_0xebcb('0x1d')],'include':_0x3804dd['include']?_[_0xebcb('0x20')](_0x3804dd['include'],function(_0xd84aad){return{'model':db[_0xd84aad[_0xebcb('0x21')]],'as':_0xd84aad['as'],'attributes':_0xd84aad[_0xebcb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xebcb('0xb')](function(_0x250761){logger[_0xebcb('0xc')](_0xebcb('0x17'),_0x1e12f0);logger[_0xebcb('0xf')]('GetFreshdeskAccount',_0x1e12f0,JSON[_0xebcb('0x11')](_0x250761));_0x4e33d1(_0x250761);})[_0xebcb('0x16')](function(_0x2fe175){logger[_0xebcb('0x12')](_0xebcb('0x17'),_0x2fe175[_0xebcb('0x14')],_0x1e12f0);_0x17c9b6(_0x29c256[_0xebcb('0x12')](0x1f4,_0x2fe175[_0xebcb('0x14')]));});});};exports[_0xebcb('0x22')]=function(_0x3e8b28){var _0x5c75b2=this;return new Promise(function(_0x18e554,_0x4cf24c){return db[_0xebcb('0x18')][_0xebcb('0x23')]({'raw':_0x3e8b28[_0xebcb('0x1a')]?_0x3e8b28[_0xebcb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3e8b28[_0xebcb('0x1a')]?_0x3e8b28[_0xebcb('0x1a')]['where']||null:null,'attributes':_0x3e8b28['options']?_0x3e8b28[_0xebcb('0x1a')][_0xebcb('0x1d')]||null:null,'include':_0x3e8b28['options']?_0x3e8b28[_0xebcb('0x1a')][_0xebcb('0x1f')]?_[_0xebcb('0x20')](_0x3e8b28[_0xebcb('0x1a')][_0xebcb('0x1f')],function(_0x35e80f){return{'model':db[_0x35e80f['model']],'as':_0x35e80f['as'],'attributes':_0x35e80f[_0xebcb('0x1d')],'include':_0x35e80f[_0xebcb('0x1f')]?_[_0xebcb('0x20')](_0x35e80f[_0xebcb('0x1f')],function(_0x207fce){return{'model':db[_0x207fce[_0xebcb('0x21')]],'as':_0x207fce['as'],'attributes':_0x207fce[_0xebcb('0x1d')],'include':_0x207fce[_0xebcb('0x1f')]?_['map'](_0x207fce['include'],function(_0x178a80){return{'model':db[_0x178a80['model']],'as':_0x178a80['as'],'attributes':_0x178a80['attributes']};}):[]};}):[]};}):[]:[]})[_0xebcb('0xb')](function(_0x44d9c9){logger[_0xebcb('0xc')](_0xebcb('0x22'),_0x3e8b28);logger[_0xebcb('0xf')](_0xebcb('0x22'),_0x3e8b28,JSON[_0xebcb('0x11')](_0x44d9c9));_0x18e554(_0x44d9c9);})['catch'](function(_0x4b34d9){logger[_0xebcb('0x12')]('ShowFreshdeskAccount',_0x4b34d9['message'],_0x3e8b28);_0x4cf24c(_0x5c75b2[_0xebcb('0x12')](0x1f4,_0x4b34d9[_0xebcb('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 9082ca6..9a01406 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 _0xa123=['update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','setTags','put'];(function(_0x3fbd8e,_0x3f056a){var _0x408741=function(_0xe4091f){while(--_0xe4091f){_0x3fbd8e['push'](_0x3fbd8e['shift']());}};_0x408741(++_0x3f056a);}(_0xa123,0x1f2));var _0x3a12=function(_0x192876,_0x1dcf2e){_0x192876=_0x192876-0x0;var _0xa2915d=_0xa123[_0x192876];return _0xa2915d;};'use strict';var multer=require(_0x3a12('0x0'));var util=require(_0x3a12('0x1'));var path=require(_0x3a12('0x2'));var timeout=require('connect-timeout');var express=require(_0x3a12('0x3'));var router=express[_0x3a12('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3a12('0x5'));var interaction=require(_0x3a12('0x6'));var config=require('../../config/environment');var controller=require(_0x3a12('0x7'));router['get']('/',auth[_0x3a12('0x8')](),controller[_0x3a12('0x9')]);router[_0x3a12('0xa')](_0x3a12('0xb'),auth[_0x3a12('0x8')](),controller[_0x3a12('0xc')]);router[_0x3a12('0xa')]('/:id/fields',auth[_0x3a12('0x8')](),controller['getFields']);router[_0x3a12('0xa')](_0x3a12('0xd'),auth['isAuthenticated'](),controller[_0x3a12('0xe')]);router['get'](_0x3a12('0xf'),auth[_0x3a12('0x8')](),controller['getDescriptions']);router[_0x3a12('0xa')](_0x3a12('0x10'),auth[_0x3a12('0x8')](),controller[_0x3a12('0x11')]);router[_0x3a12('0x12')]('/',auth[_0x3a12('0x8')](),controller[_0x3a12('0x13')]);router['post'](_0x3a12('0x10'),auth['isAuthenticated'](),controller[_0x3a12('0x14')]);router[_0x3a12('0x15')](_0x3a12('0xb'),auth[_0x3a12('0x8')](),controller[_0x3a12('0x16')]);router[_0x3a12('0x17')](_0x3a12('0xb'),auth[_0x3a12('0x8')](),controller[_0x3a12('0x18')]);module[_0x3a12('0x19')]=router; \ No newline at end of file +var _0x8c0e=['delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/descriptions','/:id/tags','getTags','post','setTags','/:id','update'];(function(_0x59616b,_0x38e534){var _0x5c4523=function(_0x166f2e){while(--_0x166f2e){_0x59616b['push'](_0x59616b['shift']());}};_0x5c4523(++_0x38e534);}(_0x8c0e,0xa4));var _0xe8c0=function(_0x544bed,_0x268e03){_0x544bed=_0x544bed-0x0;var _0x392435=_0x8c0e[_0x544bed];return _0x392435;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe8c0('0x0'));var timeout=require(_0xe8c0('0x1'));var express=require(_0xe8c0('0x2'));var router=express[_0xe8c0('0x3')]();var fs_extra=require(_0xe8c0('0x4'));var auth=require(_0xe8c0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe8c0('0x6'));var controller=require(_0xe8c0('0x7'));router[_0xe8c0('0x8')]('/',auth[_0xe8c0('0x9')](),controller[_0xe8c0('0xa')]);router[_0xe8c0('0x8')]('/:id',auth[_0xe8c0('0x9')](),controller[_0xe8c0('0xb')]);router[_0xe8c0('0x8')](_0xe8c0('0xc'),auth[_0xe8c0('0x9')](),controller['getFields']);router[_0xe8c0('0x8')]('/:id/subjects',auth[_0xe8c0('0x9')](),controller['getSubjects']);router[_0xe8c0('0x8')](_0xe8c0('0xd'),auth[_0xe8c0('0x9')](),controller['getDescriptions']);router['get'](_0xe8c0('0xe'),auth['isAuthenticated'](),controller[_0xe8c0('0xf')]);router[_0xe8c0('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe8c0('0x10')]('/:id/tags',auth[_0xe8c0('0x9')](),controller[_0xe8c0('0x11')]);router['put'](_0xe8c0('0x12'),auth[_0xe8c0('0x9')](),controller[_0xe8c0('0x13')]);router[_0xe8c0('0x14')](_0xe8c0('0x12'),auth['isAuthenticated'](),controller[_0xe8c0('0x15')]);module[_0xe8c0('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 6214da5..0a6fba8 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 _0xa29d=['sequelize','exports','STRING'];(function(_0x41c5b1,_0x504209){var _0x4ace18=function(_0x6fdf9b){while(--_0x6fdf9b){_0x41c5b1['push'](_0x41c5b1['shift']());}};_0x4ace18(++_0x504209);}(_0xa29d,0xb4));var _0xda29=function(_0x95fdb8,_0x389264){_0x95fdb8=_0x95fdb8-0x0;var _0x2f12b1=_0xa29d[_0x95fdb8];return _0x2f12b1;};'use strict';var Sequelize=require(_0xda29('0x0'));module[_0xda29('0x1')]={'name':{'type':Sequelize[_0xda29('0x2')]},'description':{'type':Sequelize[_0xda29('0x2')]}}; \ No newline at end of file +var _0x2149=['sequelize','STRING'];(function(_0x3f6df7,_0x96774d){var _0x59254e=function(_0x32d740){while(--_0x32d740){_0x3f6df7['push'](_0x3f6df7['shift']());}};_0x59254e(++_0x96774d);}(_0x2149,0x108));var _0x9214=function(_0x4be226,_0x3dbffc){_0x4be226=_0x4be226-0x0;var _0x148768=_0x2149[_0x4be226];return _0x148768;};'use strict';var Sequelize=require(_0x9214('0x0'));module['exports']={'name':{'type':Sequelize[_0x9214('0x1')]},'description':{'type':Sequelize[_0x9214('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 324925a..51bc899 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 _0x00e3=['getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','includeAll','include','FreshdeskConfiguration','findAll','rows','params','keys','merge','options','find','catch','create','body','getFields','findOne','FreshdeskField','order','getSubjects','getDescriptions'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x00e3,0xf1));var _0x300e=function(_0x25656f,_0x4cf8be){_0x25656f=_0x25656f-0x0;var _0x6e703f=_0x00e3[_0x25656f];return _0x6e703f;};'use strict';var emlformat=require(_0x300e('0x0'));var rimraf=require(_0x300e('0x1'));var zipdir=require(_0x300e('0x2'));var jsonpatch=require(_0x300e('0x3'));var rp=require(_0x300e('0x4'));var moment=require(_0x300e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x300e('0x6'));var path=require(_0x300e('0x7'));var sox=require(_0x300e('0x8'));var csv=require(_0x300e('0x9'));var ejs=require(_0x300e('0xa'));var fs=require('fs');var fs_extra=require(_0x300e('0xb'));var _=require(_0x300e('0xc'));var squel=require(_0x300e('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x300e('0xe'));var toCsv=require(_0x300e('0x9'));var querystring=require(_0x300e('0xf'));var Papa=require('papaparse');var Redis=require(_0x300e('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x300e('0x11'));var hardwareService=require(_0x300e('0x12'));var logger=require('../../config/logger')(_0x300e('0x13'));var utils=require(_0x300e('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x300e('0x15'))['db'];function respondWithStatusCode(_0x5edbb4,_0x43d6eb){_0x43d6eb=_0x43d6eb||0xcc;return function(_0x278b9e){if(_0x278b9e){return _0x5edbb4[_0x300e('0x16')](_0x43d6eb);}return _0x5edbb4[_0x300e('0x17')](_0x43d6eb)['end']();};}function respondWithResult(_0x2b21d1,_0x27e182){_0x27e182=_0x27e182||0xc8;return function(_0xc33be9){if(_0xc33be9){return _0x2b21d1['status'](_0x27e182)[_0x300e('0x18')](_0xc33be9);}};}function respondWithFilteredResult(_0x558071,_0x3604d3){return function(_0x14d033){if(_0x14d033){var _0x81fa06=typeof _0x3604d3[_0x300e('0x19')]===_0x300e('0x1a')&&typeof _0x3604d3[_0x300e('0x1b')]==='undefined';var _0x3a93ea=_0x14d033[_0x300e('0x1c')];var _0x4f27fe=_0x81fa06?0x0:_0x3604d3['offset'];var _0x3861b1=_0x81fa06?_0x14d033[_0x300e('0x1c')]:_0x3604d3[_0x300e('0x19')]+_0x3604d3[_0x300e('0x1b')];var _0x415b50;if(_0x3861b1>=_0x3a93ea){_0x3861b1=_0x3a93ea;_0x415b50=0xc8;}else{_0x415b50=0xce;}_0x558071[_0x300e('0x17')](_0x415b50);return _0x558071['set'](_0x300e('0x1d'),_0x4f27fe+'-'+_0x3861b1+'/'+_0x3a93ea)[_0x300e('0x18')](_0x14d033);}return null;};}function patchUpdates(_0x5bb4e1){return function(_0x951b15){try{jsonpatch['apply'](_0x951b15,_0x5bb4e1,!![]);}catch(_0x2c328a){return BPromise[_0x300e('0x1e')](_0x2c328a);}return _0x951b15['save']();};}function saveUpdates(_0x14df99,_0x5d6bd7){return function(_0x20b934){if(_0x20b934){return _0x20b934[_0x300e('0x1f')](_0x14df99)[_0x300e('0x20')](function(_0x46e93b){return _0x46e93b;});}return null;};}function removeEntity(_0x4ac6aa,_0x35f9e1){return function(_0x5e94df){if(_0x5e94df){return _0x5e94df[_0x300e('0x21')]()[_0x300e('0x20')](function(){_0x4ac6aa[_0x300e('0x17')](0xcc)[_0x300e('0x22')]();});}};}function handleEntityNotFound(_0x3c05ac,_0x198b82){return function(_0x5209a9){if(!_0x5209a9){_0x3c05ac['sendStatus'](0x194);}return _0x5209a9;};}function handleError(_0x46fd6b,_0x47257d){_0x47257d=_0x47257d||0x1f4;return function(_0x27562c){logger[_0x300e('0x23')](_0x27562c[_0x300e('0x24')]);if(_0x27562c[_0x300e('0x25')]){delete _0x27562c['name'];}_0x46fd6b[_0x300e('0x17')](_0x47257d)['send'](_0x27562c);};}exports[_0x300e('0x26')]=function(_0x2059a1,_0x572c83){var _0x5600d0={},_0x451c4f={},_0x2fa360={'count':0x0,'rows':[]};var _0x2db657=_[_0x300e('0x27')](db['FreshdeskConfiguration'][_0x300e('0x28')],function(_0x4ff294){return{'name':_0x4ff294[_0x300e('0x29')],'type':_0x4ff294[_0x300e('0x2a')]['key']};});_0x451c4f[_0x300e('0x2b')]=_[_0x300e('0x27')](_0x2db657,_0x300e('0x25'));_0x451c4f[_0x300e('0x2c')]=_['keys'](_0x2059a1[_0x300e('0x2c')]);_0x451c4f[_0x300e('0x2d')]=_[_0x300e('0x2e')](_0x451c4f[_0x300e('0x2b')],_0x451c4f['query']);_0x5600d0['attributes']=_[_0x300e('0x2e')](_0x451c4f[_0x300e('0x2b')],qs[_0x300e('0x2f')](_0x2059a1[_0x300e('0x2c')]['fields']));_0x5600d0[_0x300e('0x30')]=_0x5600d0[_0x300e('0x30')][_0x300e('0x31')]?_0x5600d0[_0x300e('0x30')]:_0x451c4f['model'];if(!_0x2059a1[_0x300e('0x2c')][_0x300e('0x32')](_0x300e('0x33'))){_0x5600d0[_0x300e('0x1b')]=qs[_0x300e('0x1b')](_0x2059a1[_0x300e('0x2c')][_0x300e('0x1b')]);_0x5600d0[_0x300e('0x19')]=qs[_0x300e('0x19')](_0x2059a1[_0x300e('0x2c')][_0x300e('0x19')]);}_0x5600d0['order']=qs[_0x300e('0x34')](_0x2059a1['query'][_0x300e('0x34')]);_0x5600d0['where']=qs[_0x300e('0x2d')](_[_0x300e('0x35')](_0x2059a1[_0x300e('0x2c')],_0x451c4f[_0x300e('0x2d')]),_0x2db657);if(_0x2059a1['query'][_0x300e('0x36')]){_0x5600d0[_0x300e('0x37')]=_['merge'](_0x5600d0[_0x300e('0x37')],{'$or':_[_0x300e('0x27')](_0x2db657,function(_0x49829f){if(_0x49829f['type']!=='VIRTUAL'){var _0x65be4c={};_0x65be4c[_0x49829f['name']]={'$like':'%'+_0x2059a1[_0x300e('0x2c')][_0x300e('0x36')]+'%'};return _0x65be4c;}})});}_0x5600d0=_['merge']({},_0x5600d0,_0x2059a1['options']);var _0x4a77dc={'where':_0x5600d0[_0x300e('0x37')]};return db['FreshdeskConfiguration']['count'](_0x4a77dc)[_0x300e('0x20')](function(_0xc037e8){_0x2fa360['count']=_0xc037e8;if(_0x2059a1[_0x300e('0x2c')][_0x300e('0x38')]){_0x5600d0[_0x300e('0x39')]=[{'all':!![]}];}return db[_0x300e('0x3a')][_0x300e('0x3b')](_0x5600d0);})[_0x300e('0x20')](function(_0x25062d){_0x2fa360[_0x300e('0x3c')]=_0x25062d;return _0x2fa360;})['then'](respondWithFilteredResult(_0x572c83,_0x5600d0))['catch'](handleError(_0x572c83,null));};exports['show']=function(_0x5d1049,_0x5ec620){var _0x11d5c8={'raw':![],'where':{'id':_0x5d1049[_0x300e('0x3d')]['id']}},_0x4dbdd1={};_0x4dbdd1[_0x300e('0x2b')]=_[_0x300e('0x3e')](db[_0x300e('0x3a')][_0x300e('0x28')]);_0x4dbdd1[_0x300e('0x2c')]=_['keys'](_0x5d1049[_0x300e('0x2c')]);_0x4dbdd1[_0x300e('0x2d')]=_[_0x300e('0x2e')](_0x4dbdd1[_0x300e('0x2b')],_0x4dbdd1[_0x300e('0x2c')]);_0x11d5c8['attributes']=_[_0x300e('0x2e')](_0x4dbdd1[_0x300e('0x2b')],qs[_0x300e('0x2f')](_0x5d1049[_0x300e('0x2c')]['fields']));_0x11d5c8['attributes']=_0x11d5c8[_0x300e('0x30')][_0x300e('0x31')]?_0x11d5c8[_0x300e('0x30')]:_0x4dbdd1[_0x300e('0x2b')];if(_0x5d1049[_0x300e('0x2c')][_0x300e('0x38')]){_0x11d5c8[_0x300e('0x39')]=[{'all':!![]}];}_0x11d5c8=_[_0x300e('0x3f')]({},_0x11d5c8,_0x5d1049[_0x300e('0x40')]);return db['FreshdeskConfiguration'][_0x300e('0x41')](_0x11d5c8)[_0x300e('0x20')](handleEntityNotFound(_0x5ec620,null))[_0x300e('0x20')](respondWithResult(_0x5ec620,null))[_0x300e('0x42')](handleError(_0x5ec620,null));};exports[_0x300e('0x43')]=function(_0xab5e36,_0x1aae6f){return db[_0x300e('0x3a')][_0x300e('0x43')](_0xab5e36[_0x300e('0x44')],{})[_0x300e('0x20')](respondWithResult(_0x1aae6f,0xc9))[_0x300e('0x42')](handleError(_0x1aae6f,null));};exports[_0x300e('0x1f')]=function(_0x44ce7b,_0x35b377){if(_0x44ce7b[_0x300e('0x44')]['id']){delete _0x44ce7b[_0x300e('0x44')]['id'];}return db[_0x300e('0x3a')][_0x300e('0x41')]({'where':{'id':_0x44ce7b[_0x300e('0x3d')]['id']}})[_0x300e('0x20')](handleEntityNotFound(_0x35b377,null))[_0x300e('0x20')](saveUpdates(_0x44ce7b[_0x300e('0x44')],null))[_0x300e('0x20')](respondWithResult(_0x35b377,null))['catch'](handleError(_0x35b377,null));};exports[_0x300e('0x21')]=function(_0x2d27e4,_0x11d654){return db[_0x300e('0x3a')][_0x300e('0x41')]({'where':{'id':_0x2d27e4[_0x300e('0x3d')]['id']}})[_0x300e('0x20')](handleEntityNotFound(_0x11d654,null))['then'](removeEntity(_0x11d654,null))[_0x300e('0x42')](handleError(_0x11d654,null));};exports[_0x300e('0x45')]=function(_0x472eab,_0x48f536,_0x117731){var _0x511bd0={};var _0xef9ebf={};var _0x3a68f5;var _0x5cacda;return db[_0x300e('0x3a')][_0x300e('0x46')]({'where':{'id':_0x472eab[_0x300e('0x3d')]['id']}})[_0x300e('0x20')](handleEntityNotFound(_0x48f536,null))['then'](function(_0x2d1177){if(_0x2d1177){_0x3a68f5=_0x2d1177;_0xef9ebf[_0x300e('0x2b')]=_['keys'](db[_0x300e('0x47')]['rawAttributes']);_0xef9ebf[_0x300e('0x2c')]=_[_0x300e('0x3e')](_0x472eab[_0x300e('0x2c')]);_0xef9ebf[_0x300e('0x2d')]=_[_0x300e('0x2e')](_0xef9ebf[_0x300e('0x2b')],_0xef9ebf['query']);_0x511bd0[_0x300e('0x30')]=_[_0x300e('0x2e')](_0xef9ebf[_0x300e('0x2b')],qs[_0x300e('0x2f')](_0x472eab['query']['fields']));_0x511bd0[_0x300e('0x30')]=_0x511bd0['attributes'][_0x300e('0x31')]?_0x511bd0['attributes']:_0xef9ebf['model'];_0x511bd0[_0x300e('0x48')]=qs['sort'](_0x472eab[_0x300e('0x2c')][_0x300e('0x34')]);_0x511bd0[_0x300e('0x37')]=qs[_0x300e('0x2d')](_[_0x300e('0x35')](_0x472eab[_0x300e('0x2c')],_0xef9ebf[_0x300e('0x2d')]));if(_0x472eab['query'][_0x300e('0x36')]){_0x511bd0[_0x300e('0x37')]=_[_0x300e('0x3f')](_0x511bd0[_0x300e('0x37')],{'$or':_[_0x300e('0x27')](_0x511bd0[_0x300e('0x30')],function(_0x3f1d44){var _0x93d144={};_0x93d144[_0x3f1d44]={'$like':'%'+_0x472eab[_0x300e('0x2c')][_0x300e('0x36')]+'%'};return _0x93d144;})});}_0x511bd0=_[_0x300e('0x3f')]({},_0x511bd0,_0x472eab[_0x300e('0x40')]);return _0x3a68f5[_0x300e('0x45')](_0x511bd0);}})['then'](function(_0x1d30d9){if(_0x1d30d9){_0x5cacda=_0x1d30d9['length'];if(!_0x472eab[_0x300e('0x2c')][_0x300e('0x32')](_0x300e('0x33'))){_0x511bd0['limit']=qs['limit'](_0x472eab[_0x300e('0x2c')][_0x300e('0x1b')]);_0x511bd0[_0x300e('0x19')]=qs[_0x300e('0x19')](_0x472eab[_0x300e('0x2c')][_0x300e('0x19')]);}return _0x3a68f5['getFields'](_0x511bd0);}})[_0x300e('0x20')](function(_0x4be4b8){if(_0x4be4b8){return _0x4be4b8?{'count':_0x5cacda,'rows':_0x4be4b8}:null;}})[_0x300e('0x20')](respondWithResult(_0x48f536,null))[_0x300e('0x42')](handleError(_0x48f536,null));};exports[_0x300e('0x49')]=function(_0x989089,_0x40ce77,_0x1dd791){var _0x10aa42={};var _0x4ac080={};var _0x4c5b90;var _0x1eb288;return db[_0x300e('0x3a')]['findOne']({'where':{'id':_0x989089[_0x300e('0x3d')]['id']}})[_0x300e('0x20')](handleEntityNotFound(_0x40ce77,null))['then'](function(_0x5d02b5){if(_0x5d02b5){_0x4c5b90=_0x5d02b5;_0x4ac080[_0x300e('0x2b')]=_[_0x300e('0x3e')](db[_0x300e('0x47')][_0x300e('0x28')]);_0x4ac080['query']=_[_0x300e('0x3e')](_0x989089[_0x300e('0x2c')]);_0x4ac080[_0x300e('0x2d')]=_[_0x300e('0x2e')](_0x4ac080[_0x300e('0x2b')],_0x4ac080[_0x300e('0x2c')]);_0x10aa42[_0x300e('0x30')]=_[_0x300e('0x2e')](_0x4ac080[_0x300e('0x2b')],qs[_0x300e('0x2f')](_0x989089[_0x300e('0x2c')][_0x300e('0x2f')]));_0x10aa42[_0x300e('0x30')]=_0x10aa42[_0x300e('0x30')][_0x300e('0x31')]?_0x10aa42[_0x300e('0x30')]:_0x4ac080['model'];_0x10aa42[_0x300e('0x48')]=qs[_0x300e('0x34')](_0x989089[_0x300e('0x2c')][_0x300e('0x34')]);_0x10aa42[_0x300e('0x37')]=qs['filters'](_['pick'](_0x989089[_0x300e('0x2c')],_0x4ac080[_0x300e('0x2d')]));if(_0x989089['query'][_0x300e('0x36')]){_0x10aa42['where']=_[_0x300e('0x3f')](_0x10aa42[_0x300e('0x37')],{'$or':_[_0x300e('0x27')](_0x10aa42[_0x300e('0x30')],function(_0x5c2163){var _0x5176bb={};_0x5176bb[_0x5c2163]={'$like':'%'+_0x989089[_0x300e('0x2c')]['filter']+'%'};return _0x5176bb;})});}_0x10aa42=_[_0x300e('0x3f')]({},_0x10aa42,_0x989089['options']);return _0x4c5b90[_0x300e('0x49')](_0x10aa42);}})[_0x300e('0x20')](function(_0x4b3cf1){if(_0x4b3cf1){_0x1eb288=_0x4b3cf1[_0x300e('0x31')];if(!_0x989089[_0x300e('0x2c')][_0x300e('0x32')](_0x300e('0x33'))){_0x10aa42[_0x300e('0x1b')]=qs[_0x300e('0x1b')](_0x989089['query']['limit']);_0x10aa42[_0x300e('0x19')]=qs[_0x300e('0x19')](_0x989089[_0x300e('0x2c')][_0x300e('0x19')]);}return _0x4c5b90[_0x300e('0x49')](_0x10aa42);}})[_0x300e('0x20')](function(_0x5074e5){if(_0x5074e5){return _0x5074e5?{'count':_0x1eb288,'rows':_0x5074e5}:null;}})[_0x300e('0x20')](respondWithResult(_0x40ce77,null))[_0x300e('0x42')](handleError(_0x40ce77,null));};exports[_0x300e('0x4a')]=function(_0x57189a,_0x7298ed,_0x54de11){var _0x18389d={};var _0x3ba475={};var _0x279174;var _0x6d720c;return db[_0x300e('0x3a')][_0x300e('0x46')]({'where':{'id':_0x57189a[_0x300e('0x3d')]['id']}})[_0x300e('0x20')](handleEntityNotFound(_0x7298ed,null))[_0x300e('0x20')](function(_0x31d7e4){if(_0x31d7e4){_0x279174=_0x31d7e4;_0x3ba475['model']=_[_0x300e('0x3e')](db[_0x300e('0x47')]['rawAttributes']);_0x3ba475[_0x300e('0x2c')]=_['keys'](_0x57189a['query']);_0x3ba475[_0x300e('0x2d')]=_[_0x300e('0x2e')](_0x3ba475[_0x300e('0x2b')],_0x3ba475['query']);_0x18389d['attributes']=_[_0x300e('0x2e')](_0x3ba475[_0x300e('0x2b')],qs[_0x300e('0x2f')](_0x57189a['query'][_0x300e('0x2f')]));_0x18389d[_0x300e('0x30')]=_0x18389d[_0x300e('0x30')][_0x300e('0x31')]?_0x18389d[_0x300e('0x30')]:_0x3ba475['model'];_0x18389d[_0x300e('0x48')]=qs[_0x300e('0x34')](_0x57189a['query'][_0x300e('0x34')]);_0x18389d['where']=qs['filters'](_[_0x300e('0x35')](_0x57189a[_0x300e('0x2c')],_0x3ba475[_0x300e('0x2d')]));if(_0x57189a[_0x300e('0x2c')][_0x300e('0x36')]){_0x18389d['where']=_[_0x300e('0x3f')](_0x18389d['where'],{'$or':_[_0x300e('0x27')](_0x18389d[_0x300e('0x30')],function(_0x56392f){var _0x4271ec={};_0x4271ec[_0x56392f]={'$like':'%'+_0x57189a[_0x300e('0x2c')]['filter']+'%'};return _0x4271ec;})});}_0x18389d=_[_0x300e('0x3f')]({},_0x18389d,_0x57189a[_0x300e('0x40')]);return _0x279174['getDescriptions'](_0x18389d);}})[_0x300e('0x20')](function(_0x23d51f){if(_0x23d51f){_0x6d720c=_0x23d51f['length'];if(!_0x57189a[_0x300e('0x2c')][_0x300e('0x32')]('nolimit')){_0x18389d[_0x300e('0x1b')]=qs[_0x300e('0x1b')](_0x57189a['query'][_0x300e('0x1b')]);_0x18389d['offset']=qs['offset'](_0x57189a[_0x300e('0x2c')][_0x300e('0x19')]);}return _0x279174['getDescriptions'](_0x18389d);}})[_0x300e('0x20')](function(_0x5f59d6){if(_0x5f59d6){return _0x5f59d6?{'count':_0x6d720c,'rows':_0x5f59d6}:null;}})[_0x300e('0x20')](respondWithResult(_0x7298ed,null))[_0x300e('0x42')](handleError(_0x7298ed,null));};exports[_0x300e('0x4b')]=function(_0x580545,_0x1ead08,_0x197027){var _0x3fbe47={};var _0x16b1f9={};var _0x4f01c1;var _0x344541;return db[_0x300e('0x3a')][_0x300e('0x46')]({'where':{'id':_0x580545['params']['id']}})[_0x300e('0x20')](handleEntityNotFound(_0x1ead08,null))[_0x300e('0x20')](function(_0x483d95){if(_0x483d95){_0x4f01c1=_0x483d95;_0x16b1f9[_0x300e('0x2b')]=_[_0x300e('0x3e')](db[_0x300e('0x4c')]['rawAttributes']);_0x16b1f9[_0x300e('0x2c')]=_[_0x300e('0x3e')](_0x580545[_0x300e('0x2c')]);_0x16b1f9[_0x300e('0x2d')]=_[_0x300e('0x2e')](_0x16b1f9[_0x300e('0x2b')],_0x16b1f9[_0x300e('0x2c')]);_0x3fbe47[_0x300e('0x30')]=_[_0x300e('0x2e')](_0x16b1f9[_0x300e('0x2b')],qs['fields'](_0x580545['query'][_0x300e('0x2f')]));_0x3fbe47[_0x300e('0x30')]=_0x3fbe47['attributes'][_0x300e('0x31')]?_0x3fbe47[_0x300e('0x30')]:_0x16b1f9[_0x300e('0x2b')];_0x3fbe47[_0x300e('0x48')]=qs[_0x300e('0x34')](_0x580545[_0x300e('0x2c')][_0x300e('0x34')]);_0x3fbe47[_0x300e('0x37')]=qs[_0x300e('0x2d')](_[_0x300e('0x35')](_0x580545['query'],_0x16b1f9[_0x300e('0x2d')]));if(_0x580545[_0x300e('0x2c')][_0x300e('0x36')]){_0x3fbe47['where']=_[_0x300e('0x3f')](_0x3fbe47[_0x300e('0x37')],{'$or':_[_0x300e('0x27')](_0x3fbe47[_0x300e('0x30')],function(_0xdb53c9){var _0x1d9bc1={};_0x1d9bc1[_0xdb53c9]={'$like':'%'+_0x580545[_0x300e('0x2c')][_0x300e('0x36')]+'%'};return _0x1d9bc1;})});}_0x3fbe47=_[_0x300e('0x3f')]({},_0x3fbe47,_0x580545[_0x300e('0x40')]);return _0x4f01c1['getTags'](_0x3fbe47);}})['then'](function(_0x3d9334){if(_0x3d9334){_0x344541=_0x3d9334[_0x300e('0x31')];if(!_0x580545[_0x300e('0x2c')][_0x300e('0x32')](_0x300e('0x33'))){_0x3fbe47['limit']=qs[_0x300e('0x1b')](_0x580545[_0x300e('0x2c')][_0x300e('0x1b')]);_0x3fbe47[_0x300e('0x19')]=qs[_0x300e('0x19')](_0x580545[_0x300e('0x2c')][_0x300e('0x19')]);}return _0x4f01c1['getTags'](_0x3fbe47);}})['then'](function(_0x47d272){if(_0x47d272){return _0x47d272?{'count':_0x344541,'rows':_0x47d272}:null;}})[_0x300e('0x20')](respondWithResult(_0x1ead08,null))['catch'](handleError(_0x1ead08,null));};exports['setTags']=function(_0x1bfea8,_0x13551a,_0x8f1bf6){if(_0x1bfea8[_0x300e('0x44')]['id']){delete _0x1bfea8[_0x300e('0x44')]['id'];}return db['FreshdeskConfiguration'][_0x300e('0x46')]({'where':{'id':_0x1bfea8[_0x300e('0x3d')]['id']}})[_0x300e('0x20')](handleEntityNotFound(_0x13551a,null))[_0x300e('0x20')](function(_0x28be21){if(_0x28be21){return _0x28be21[_0x300e('0x4d')](_0x1bfea8[_0x300e('0x44')][_0x300e('0x4e')]||[]);}return null;})[_0x300e('0x20')](respondWithResult(_0x13551a,null))[_0x300e('0x42')](handleError(_0x13551a,null));}; \ No newline at end of file +var _0xea42=['getTags','Tag','setTags','ids','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','apply','reject','update','then','error','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','body','destroy','getFields','findOne','FreshdeskField','filter','getSubjects','getDescriptions'];(function(_0x566c6d,_0x2de2bc){var _0x1e995a=function(_0x1e4c72){while(--_0x1e4c72){_0x566c6d['push'](_0x566c6d['shift']());}};_0x1e995a(++_0x2de2bc);}(_0xea42,0x150));var _0x2ea4=function(_0x162ef3,_0x1f5c07){_0x162ef3=_0x162ef3-0x0;var _0x2c8f27=_0xea42[_0x162ef3];return _0x2c8f27;};'use strict';var emlformat=require(_0x2ea4('0x0'));var rimraf=require(_0x2ea4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2ea4('0x2'));var moment=require(_0x2ea4('0x3'));var BPromise=require(_0x2ea4('0x4'));var Mustache=require(_0x2ea4('0x5'));var util=require(_0x2ea4('0x6'));var path=require('path');var sox=require(_0x2ea4('0x7'));var csv=require(_0x2ea4('0x8'));var ejs=require(_0x2ea4('0x9'));var fs=require('fs');var fs_extra=require(_0x2ea4('0xa'));var _=require(_0x2ea4('0xb'));var squel=require('squel');var crypto=require(_0x2ea4('0xc'));var jsforce=require(_0x2ea4('0xd'));var deskjs=require(_0x2ea4('0xe'));var toCsv=require(_0x2ea4('0x8'));var querystring=require(_0x2ea4('0xf'));var Papa=require(_0x2ea4('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(_0x2ea4('0x11'));var logger=require(_0x2ea4('0x12'))(_0x2ea4('0x13'));var utils=require(_0x2ea4('0x14'));var config=require(_0x2ea4('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2ea4('0x16'))['db'];function respondWithStatusCode(_0x282d3a,_0x4834c3){_0x4834c3=_0x4834c3||0xcc;return function(_0x160985){if(_0x160985){return _0x282d3a[_0x2ea4('0x17')](_0x4834c3);}return _0x282d3a[_0x2ea4('0x18')](_0x4834c3)[_0x2ea4('0x19')]();};}function respondWithResult(_0x25af9f,_0x5f5845){_0x5f5845=_0x5f5845||0xc8;return function(_0x130e99){if(_0x130e99){return _0x25af9f[_0x2ea4('0x18')](_0x5f5845)[_0x2ea4('0x1a')](_0x130e99);}};}function respondWithFilteredResult(_0x25003e,_0x2af2f4){return function(_0x467170){if(_0x467170){var _0x37b1c5=typeof _0x2af2f4['offset']===_0x2ea4('0x1b')&&typeof _0x2af2f4[_0x2ea4('0x1c')]===_0x2ea4('0x1b');var _0x255920=_0x467170[_0x2ea4('0x1d')];var _0x3a99f3=_0x37b1c5?0x0:_0x2af2f4['offset'];var _0xd63d12=_0x37b1c5?_0x467170[_0x2ea4('0x1d')]:_0x2af2f4['offset']+_0x2af2f4[_0x2ea4('0x1c')];var _0x276820;if(_0xd63d12>=_0x255920){_0xd63d12=_0x255920;_0x276820=0xc8;}else{_0x276820=0xce;}_0x25003e['status'](_0x276820);return _0x25003e[_0x2ea4('0x1e')]('Content-Range',_0x3a99f3+'-'+_0xd63d12+'/'+_0x255920)[_0x2ea4('0x1a')](_0x467170);}return null;};}function patchUpdates(_0x51099c){return function(_0x3e58d){try{jsonpatch[_0x2ea4('0x1f')](_0x3e58d,_0x51099c,!![]);}catch(_0x3ed077){return BPromise[_0x2ea4('0x20')](_0x3ed077);}return _0x3e58d['save']();};}function saveUpdates(_0x470dd3,_0x38c9fa){return function(_0x1fc8ed){if(_0x1fc8ed){return _0x1fc8ed[_0x2ea4('0x21')](_0x470dd3)[_0x2ea4('0x22')](function(_0x437b62){return _0x437b62;});}return null;};}function removeEntity(_0x55a92a,_0x3ed702){return function(_0x5800fb){if(_0x5800fb){return _0x5800fb['destroy']()[_0x2ea4('0x22')](function(){_0x55a92a[_0x2ea4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49ca36,_0x54fb3a){return function(_0x329573){if(!_0x329573){_0x49ca36[_0x2ea4('0x17')](0x194);}return _0x329573;};}function handleError(_0x32d783,_0x49a3d8){_0x49a3d8=_0x49a3d8||0x1f4;return function(_0x5ce7a8){logger[_0x2ea4('0x23')](_0x5ce7a8['stack']);if(_0x5ce7a8[_0x2ea4('0x24')]){delete _0x5ce7a8[_0x2ea4('0x24')];}_0x32d783[_0x2ea4('0x18')](_0x49a3d8)[_0x2ea4('0x25')](_0x5ce7a8);};}exports[_0x2ea4('0x26')]=function(_0x247c7c,_0x5018a8){var _0x1ca2c6={},_0x354f5e={},_0x325628={'count':0x0,'rows':[]};var _0x261f7b=_['map'](db[_0x2ea4('0x27')][_0x2ea4('0x28')],function(_0x443147){return{'name':_0x443147[_0x2ea4('0x29')],'type':_0x443147['type'][_0x2ea4('0x2a')]};});_0x354f5e[_0x2ea4('0x2b')]=_[_0x2ea4('0x2c')](_0x261f7b,_0x2ea4('0x24'));_0x354f5e[_0x2ea4('0x2d')]=_[_0x2ea4('0x2e')](_0x247c7c['query']);_0x354f5e['filters']=_[_0x2ea4('0x2f')](_0x354f5e[_0x2ea4('0x2b')],_0x354f5e[_0x2ea4('0x2d')]);_0x1ca2c6[_0x2ea4('0x30')]=_[_0x2ea4('0x2f')](_0x354f5e[_0x2ea4('0x2b')],qs[_0x2ea4('0x31')](_0x247c7c['query'][_0x2ea4('0x31')]));_0x1ca2c6[_0x2ea4('0x30')]=_0x1ca2c6[_0x2ea4('0x30')][_0x2ea4('0x32')]?_0x1ca2c6[_0x2ea4('0x30')]:_0x354f5e[_0x2ea4('0x2b')];if(!_0x247c7c['query'][_0x2ea4('0x33')](_0x2ea4('0x34'))){_0x1ca2c6['limit']=qs[_0x2ea4('0x1c')](_0x247c7c['query'][_0x2ea4('0x1c')]);_0x1ca2c6[_0x2ea4('0x35')]=qs['offset'](_0x247c7c['query'][_0x2ea4('0x35')]);}_0x1ca2c6[_0x2ea4('0x36')]=qs[_0x2ea4('0x37')](_0x247c7c[_0x2ea4('0x2d')]['sort']);_0x1ca2c6[_0x2ea4('0x38')]=qs[_0x2ea4('0x39')](_[_0x2ea4('0x3a')](_0x247c7c['query'],_0x354f5e[_0x2ea4('0x39')]),_0x261f7b);if(_0x247c7c[_0x2ea4('0x2d')]['filter']){_0x1ca2c6[_0x2ea4('0x38')]=_[_0x2ea4('0x3b')](_0x1ca2c6['where'],{'$or':_[_0x2ea4('0x2c')](_0x261f7b,function(_0x5a632c){if(_0x5a632c[_0x2ea4('0x3c')]!==_0x2ea4('0x3d')){var _0x3a2761={};_0x3a2761[_0x5a632c[_0x2ea4('0x24')]]={'$like':'%'+_0x247c7c[_0x2ea4('0x2d')]['filter']+'%'};return _0x3a2761;}})});}_0x1ca2c6=_[_0x2ea4('0x3b')]({},_0x1ca2c6,_0x247c7c[_0x2ea4('0x3e')]);var _0x17ddd1={'where':_0x1ca2c6[_0x2ea4('0x38')]};return db[_0x2ea4('0x27')][_0x2ea4('0x1d')](_0x17ddd1)['then'](function(_0x9af476){_0x325628['count']=_0x9af476;if(_0x247c7c[_0x2ea4('0x2d')][_0x2ea4('0x3f')]){_0x1ca2c6[_0x2ea4('0x40')]=[{'all':!![]}];}return db[_0x2ea4('0x27')][_0x2ea4('0x41')](_0x1ca2c6);})['then'](function(_0x48276){_0x325628[_0x2ea4('0x42')]=_0x48276;return _0x325628;})['then'](respondWithFilteredResult(_0x5018a8,_0x1ca2c6))['catch'](handleError(_0x5018a8,null));};exports[_0x2ea4('0x43')]=function(_0x23b6c9,_0x49c670){var _0x460a67={'raw':![],'where':{'id':_0x23b6c9[_0x2ea4('0x44')]['id']}},_0x13082f={};_0x13082f[_0x2ea4('0x2b')]=_[_0x2ea4('0x2e')](db[_0x2ea4('0x27')]['rawAttributes']);_0x13082f[_0x2ea4('0x2d')]=_['keys'](_0x23b6c9[_0x2ea4('0x2d')]);_0x13082f['filters']=_[_0x2ea4('0x2f')](_0x13082f[_0x2ea4('0x2b')],_0x13082f[_0x2ea4('0x2d')]);_0x460a67[_0x2ea4('0x30')]=_['intersection'](_0x13082f['model'],qs[_0x2ea4('0x31')](_0x23b6c9[_0x2ea4('0x2d')][_0x2ea4('0x31')]));_0x460a67[_0x2ea4('0x30')]=_0x460a67[_0x2ea4('0x30')][_0x2ea4('0x32')]?_0x460a67['attributes']:_0x13082f[_0x2ea4('0x2b')];if(_0x23b6c9['query']['includeAll']){_0x460a67[_0x2ea4('0x40')]=[{'all':!![]}];}_0x460a67=_[_0x2ea4('0x3b')]({},_0x460a67,_0x23b6c9[_0x2ea4('0x3e')]);return db[_0x2ea4('0x27')][_0x2ea4('0x45')](_0x460a67)[_0x2ea4('0x22')](handleEntityNotFound(_0x49c670,null))['then'](respondWithResult(_0x49c670,null))[_0x2ea4('0x46')](handleError(_0x49c670,null));};exports['create']=function(_0x1397d6,_0x1cc56e){return db[_0x2ea4('0x27')]['create'](_0x1397d6[_0x2ea4('0x47')],{})['then'](respondWithResult(_0x1cc56e,0xc9))[_0x2ea4('0x46')](handleError(_0x1cc56e,null));};exports[_0x2ea4('0x21')]=function(_0x17bd14,_0x105b24){if(_0x17bd14['body']['id']){delete _0x17bd14['body']['id'];}return db[_0x2ea4('0x27')]['find']({'where':{'id':_0x17bd14[_0x2ea4('0x44')]['id']}})[_0x2ea4('0x22')](handleEntityNotFound(_0x105b24,null))['then'](saveUpdates(_0x17bd14[_0x2ea4('0x47')],null))[_0x2ea4('0x22')](respondWithResult(_0x105b24,null))[_0x2ea4('0x46')](handleError(_0x105b24,null));};exports[_0x2ea4('0x48')]=function(_0x434da2,_0x256980){return db[_0x2ea4('0x27')]['find']({'where':{'id':_0x434da2[_0x2ea4('0x44')]['id']}})['then'](handleEntityNotFound(_0x256980,null))['then'](removeEntity(_0x256980,null))[_0x2ea4('0x46')](handleError(_0x256980,null));};exports[_0x2ea4('0x49')]=function(_0x3e8d87,_0x58b395,_0x25b11e){var _0x20fe4c={};var _0x18c7d1={};var _0x525b19;var _0x4bac1d;return db[_0x2ea4('0x27')][_0x2ea4('0x4a')]({'where':{'id':_0x3e8d87[_0x2ea4('0x44')]['id']}})[_0x2ea4('0x22')](handleEntityNotFound(_0x58b395,null))[_0x2ea4('0x22')](function(_0x4a0422){if(_0x4a0422){_0x525b19=_0x4a0422;_0x18c7d1[_0x2ea4('0x2b')]=_['keys'](db[_0x2ea4('0x4b')][_0x2ea4('0x28')]);_0x18c7d1[_0x2ea4('0x2d')]=_['keys'](_0x3e8d87[_0x2ea4('0x2d')]);_0x18c7d1['filters']=_[_0x2ea4('0x2f')](_0x18c7d1[_0x2ea4('0x2b')],_0x18c7d1[_0x2ea4('0x2d')]);_0x20fe4c[_0x2ea4('0x30')]=_[_0x2ea4('0x2f')](_0x18c7d1[_0x2ea4('0x2b')],qs['fields'](_0x3e8d87[_0x2ea4('0x2d')]['fields']));_0x20fe4c[_0x2ea4('0x30')]=_0x20fe4c[_0x2ea4('0x30')][_0x2ea4('0x32')]?_0x20fe4c['attributes']:_0x18c7d1[_0x2ea4('0x2b')];_0x20fe4c[_0x2ea4('0x36')]=qs[_0x2ea4('0x37')](_0x3e8d87[_0x2ea4('0x2d')]['sort']);_0x20fe4c[_0x2ea4('0x38')]=qs['filters'](_[_0x2ea4('0x3a')](_0x3e8d87[_0x2ea4('0x2d')],_0x18c7d1[_0x2ea4('0x39')]));if(_0x3e8d87['query'][_0x2ea4('0x4c')]){_0x20fe4c['where']=_[_0x2ea4('0x3b')](_0x20fe4c[_0x2ea4('0x38')],{'$or':_[_0x2ea4('0x2c')](_0x20fe4c[_0x2ea4('0x30')],function(_0x35a532){var _0x49321c={};_0x49321c[_0x35a532]={'$like':'%'+_0x3e8d87[_0x2ea4('0x2d')][_0x2ea4('0x4c')]+'%'};return _0x49321c;})});}_0x20fe4c=_[_0x2ea4('0x3b')]({},_0x20fe4c,_0x3e8d87[_0x2ea4('0x3e')]);return _0x525b19[_0x2ea4('0x49')](_0x20fe4c);}})['then'](function(_0xfb7bb9){if(_0xfb7bb9){_0x4bac1d=_0xfb7bb9[_0x2ea4('0x32')];if(!_0x3e8d87[_0x2ea4('0x2d')][_0x2ea4('0x33')]('nolimit')){_0x20fe4c[_0x2ea4('0x1c')]=qs[_0x2ea4('0x1c')](_0x3e8d87[_0x2ea4('0x2d')][_0x2ea4('0x1c')]);_0x20fe4c[_0x2ea4('0x35')]=qs['offset'](_0x3e8d87[_0x2ea4('0x2d')][_0x2ea4('0x35')]);}return _0x525b19['getFields'](_0x20fe4c);}})[_0x2ea4('0x22')](function(_0x100323){if(_0x100323){return _0x100323?{'count':_0x4bac1d,'rows':_0x100323}:null;}})['then'](respondWithResult(_0x58b395,null))[_0x2ea4('0x46')](handleError(_0x58b395,null));};exports[_0x2ea4('0x4d')]=function(_0x493f25,_0x4406b1,_0x1c545d){var _0x39b100={};var _0x532921={};var _0x3d5398;var _0x1b129f;return db[_0x2ea4('0x27')][_0x2ea4('0x4a')]({'where':{'id':_0x493f25[_0x2ea4('0x44')]['id']}})['then'](handleEntityNotFound(_0x4406b1,null))[_0x2ea4('0x22')](function(_0x3c5d02){if(_0x3c5d02){_0x3d5398=_0x3c5d02;_0x532921[_0x2ea4('0x2b')]=_[_0x2ea4('0x2e')](db[_0x2ea4('0x4b')][_0x2ea4('0x28')]);_0x532921['query']=_['keys'](_0x493f25['query']);_0x532921['filters']=_[_0x2ea4('0x2f')](_0x532921[_0x2ea4('0x2b')],_0x532921[_0x2ea4('0x2d')]);_0x39b100[_0x2ea4('0x30')]=_['intersection'](_0x532921[_0x2ea4('0x2b')],qs[_0x2ea4('0x31')](_0x493f25[_0x2ea4('0x2d')][_0x2ea4('0x31')]));_0x39b100[_0x2ea4('0x30')]=_0x39b100[_0x2ea4('0x30')][_0x2ea4('0x32')]?_0x39b100[_0x2ea4('0x30')]:_0x532921['model'];_0x39b100[_0x2ea4('0x36')]=qs[_0x2ea4('0x37')](_0x493f25[_0x2ea4('0x2d')]['sort']);_0x39b100[_0x2ea4('0x38')]=qs[_0x2ea4('0x39')](_[_0x2ea4('0x3a')](_0x493f25[_0x2ea4('0x2d')],_0x532921[_0x2ea4('0x39')]));if(_0x493f25[_0x2ea4('0x2d')][_0x2ea4('0x4c')]){_0x39b100[_0x2ea4('0x38')]=_[_0x2ea4('0x3b')](_0x39b100[_0x2ea4('0x38')],{'$or':_[_0x2ea4('0x2c')](_0x39b100[_0x2ea4('0x30')],function(_0x41fbb5){var _0x27d700={};_0x27d700[_0x41fbb5]={'$like':'%'+_0x493f25[_0x2ea4('0x2d')][_0x2ea4('0x4c')]+'%'};return _0x27d700;})});}_0x39b100=_['merge']({},_0x39b100,_0x493f25[_0x2ea4('0x3e')]);return _0x3d5398[_0x2ea4('0x4d')](_0x39b100);}})[_0x2ea4('0x22')](function(_0x3fd63c){if(_0x3fd63c){_0x1b129f=_0x3fd63c[_0x2ea4('0x32')];if(!_0x493f25[_0x2ea4('0x2d')][_0x2ea4('0x33')](_0x2ea4('0x34'))){_0x39b100[_0x2ea4('0x1c')]=qs[_0x2ea4('0x1c')](_0x493f25[_0x2ea4('0x2d')][_0x2ea4('0x1c')]);_0x39b100[_0x2ea4('0x35')]=qs[_0x2ea4('0x35')](_0x493f25[_0x2ea4('0x2d')][_0x2ea4('0x35')]);}return _0x3d5398[_0x2ea4('0x4d')](_0x39b100);}})[_0x2ea4('0x22')](function(_0xd7faae){if(_0xd7faae){return _0xd7faae?{'count':_0x1b129f,'rows':_0xd7faae}:null;}})['then'](respondWithResult(_0x4406b1,null))[_0x2ea4('0x46')](handleError(_0x4406b1,null));};exports[_0x2ea4('0x4e')]=function(_0x1ea7f3,_0x32bcdc,_0x588c52){var _0x5c8144={};var _0x1bbfb8={};var _0x28041f;var _0x75110c;return db['FreshdeskConfiguration'][_0x2ea4('0x4a')]({'where':{'id':_0x1ea7f3[_0x2ea4('0x44')]['id']}})[_0x2ea4('0x22')](handleEntityNotFound(_0x32bcdc,null))[_0x2ea4('0x22')](function(_0x436ca5){if(_0x436ca5){_0x28041f=_0x436ca5;_0x1bbfb8[_0x2ea4('0x2b')]=_['keys'](db[_0x2ea4('0x4b')]['rawAttributes']);_0x1bbfb8[_0x2ea4('0x2d')]=_[_0x2ea4('0x2e')](_0x1ea7f3[_0x2ea4('0x2d')]);_0x1bbfb8[_0x2ea4('0x39')]=_[_0x2ea4('0x2f')](_0x1bbfb8[_0x2ea4('0x2b')],_0x1bbfb8['query']);_0x5c8144[_0x2ea4('0x30')]=_[_0x2ea4('0x2f')](_0x1bbfb8[_0x2ea4('0x2b')],qs[_0x2ea4('0x31')](_0x1ea7f3[_0x2ea4('0x2d')]['fields']));_0x5c8144[_0x2ea4('0x30')]=_0x5c8144[_0x2ea4('0x30')][_0x2ea4('0x32')]?_0x5c8144[_0x2ea4('0x30')]:_0x1bbfb8[_0x2ea4('0x2b')];_0x5c8144['order']=qs[_0x2ea4('0x37')](_0x1ea7f3[_0x2ea4('0x2d')][_0x2ea4('0x37')]);_0x5c8144['where']=qs['filters'](_['pick'](_0x1ea7f3[_0x2ea4('0x2d')],_0x1bbfb8[_0x2ea4('0x39')]));if(_0x1ea7f3[_0x2ea4('0x2d')][_0x2ea4('0x4c')]){_0x5c8144[_0x2ea4('0x38')]=_[_0x2ea4('0x3b')](_0x5c8144[_0x2ea4('0x38')],{'$or':_[_0x2ea4('0x2c')](_0x5c8144[_0x2ea4('0x30')],function(_0x4a6503){var _0x2a39c6={};_0x2a39c6[_0x4a6503]={'$like':'%'+_0x1ea7f3['query'][_0x2ea4('0x4c')]+'%'};return _0x2a39c6;})});}_0x5c8144=_[_0x2ea4('0x3b')]({},_0x5c8144,_0x1ea7f3[_0x2ea4('0x3e')]);return _0x28041f['getDescriptions'](_0x5c8144);}})[_0x2ea4('0x22')](function(_0x5eed95){if(_0x5eed95){_0x75110c=_0x5eed95[_0x2ea4('0x32')];if(!_0x1ea7f3['query'][_0x2ea4('0x33')](_0x2ea4('0x34'))){_0x5c8144[_0x2ea4('0x1c')]=qs[_0x2ea4('0x1c')](_0x1ea7f3[_0x2ea4('0x2d')]['limit']);_0x5c8144['offset']=qs[_0x2ea4('0x35')](_0x1ea7f3[_0x2ea4('0x2d')][_0x2ea4('0x35')]);}return _0x28041f['getDescriptions'](_0x5c8144);}})['then'](function(_0x28a839){if(_0x28a839){return _0x28a839?{'count':_0x75110c,'rows':_0x28a839}:null;}})['then'](respondWithResult(_0x32bcdc,null))[_0x2ea4('0x46')](handleError(_0x32bcdc,null));};exports[_0x2ea4('0x4f')]=function(_0x59af4f,_0x19b15a,_0x12f7e6){var _0x544f9d={};var _0x30653c={};var _0x642600;var _0x35dea1;return db[_0x2ea4('0x27')]['findOne']({'where':{'id':_0x59af4f['params']['id']}})[_0x2ea4('0x22')](handleEntityNotFound(_0x19b15a,null))[_0x2ea4('0x22')](function(_0x19093d){if(_0x19093d){_0x642600=_0x19093d;_0x30653c[_0x2ea4('0x2b')]=_[_0x2ea4('0x2e')](db[_0x2ea4('0x50')][_0x2ea4('0x28')]);_0x30653c[_0x2ea4('0x2d')]=_[_0x2ea4('0x2e')](_0x59af4f['query']);_0x30653c['filters']=_[_0x2ea4('0x2f')](_0x30653c[_0x2ea4('0x2b')],_0x30653c[_0x2ea4('0x2d')]);_0x544f9d[_0x2ea4('0x30')]=_[_0x2ea4('0x2f')](_0x30653c[_0x2ea4('0x2b')],qs[_0x2ea4('0x31')](_0x59af4f['query'][_0x2ea4('0x31')]));_0x544f9d[_0x2ea4('0x30')]=_0x544f9d[_0x2ea4('0x30')][_0x2ea4('0x32')]?_0x544f9d[_0x2ea4('0x30')]:_0x30653c[_0x2ea4('0x2b')];_0x544f9d[_0x2ea4('0x36')]=qs[_0x2ea4('0x37')](_0x59af4f['query'][_0x2ea4('0x37')]);_0x544f9d['where']=qs[_0x2ea4('0x39')](_[_0x2ea4('0x3a')](_0x59af4f[_0x2ea4('0x2d')],_0x30653c[_0x2ea4('0x39')]));if(_0x59af4f[_0x2ea4('0x2d')]['filter']){_0x544f9d[_0x2ea4('0x38')]=_[_0x2ea4('0x3b')](_0x544f9d[_0x2ea4('0x38')],{'$or':_[_0x2ea4('0x2c')](_0x544f9d['attributes'],function(_0x2c0e5e){var _0x40958b={};_0x40958b[_0x2c0e5e]={'$like':'%'+_0x59af4f[_0x2ea4('0x2d')][_0x2ea4('0x4c')]+'%'};return _0x40958b;})});}_0x544f9d=_[_0x2ea4('0x3b')]({},_0x544f9d,_0x59af4f[_0x2ea4('0x3e')]);return _0x642600[_0x2ea4('0x4f')](_0x544f9d);}})[_0x2ea4('0x22')](function(_0x3831c7){if(_0x3831c7){_0x35dea1=_0x3831c7[_0x2ea4('0x32')];if(!_0x59af4f[_0x2ea4('0x2d')][_0x2ea4('0x33')](_0x2ea4('0x34'))){_0x544f9d[_0x2ea4('0x1c')]=qs['limit'](_0x59af4f[_0x2ea4('0x2d')][_0x2ea4('0x1c')]);_0x544f9d[_0x2ea4('0x35')]=qs[_0x2ea4('0x35')](_0x59af4f[_0x2ea4('0x2d')]['offset']);}return _0x642600[_0x2ea4('0x4f')](_0x544f9d);}})['then'](function(_0x455277){if(_0x455277){return _0x455277?{'count':_0x35dea1,'rows':_0x455277}:null;}})[_0x2ea4('0x22')](respondWithResult(_0x19b15a,null))[_0x2ea4('0x46')](handleError(_0x19b15a,null));};exports[_0x2ea4('0x51')]=function(_0x2af5b7,_0x3950c9,_0xb7ba23){if(_0x2af5b7['body']['id']){delete _0x2af5b7[_0x2ea4('0x47')]['id'];}return db[_0x2ea4('0x27')][_0x2ea4('0x4a')]({'where':{'id':_0x2af5b7[_0x2ea4('0x44')]['id']}})[_0x2ea4('0x22')](handleEntityNotFound(_0x3950c9,null))[_0x2ea4('0x22')](function(_0x5830e6){if(_0x5830e6){return _0x5830e6[_0x2ea4('0x51')](_0x2af5b7[_0x2ea4('0x47')][_0x2ea4('0x52')]||[]);}return null;})[_0x2ea4('0x22')](respondWithResult(_0x3950c9,null))[_0x2ea4('0x46')](handleError(_0x3950c9,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 9cc6d2e..2a512b4 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 _0x8c86=['FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports'];(function(_0x4f7964,_0x554439){var _0x2b2d33=function(_0x3191e4){while(--_0x3191e4){_0x4f7964['push'](_0x4f7964['shift']());}};_0x2b2d33(++_0x554439);}(_0x8c86,0xc5));var _0x68c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8c86[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x68c8('0x0'));var util=require(_0x68c8('0x1'));var logger=require('../../config/logger')(_0x68c8('0x2'));var moment=require(_0x68c8('0x3'));var BPromise=require(_0x68c8('0x4'));var rp=require(_0x68c8('0x5'));var fs=require('fs');var path=require(_0x68c8('0x6'));var rimraf=require(_0x68c8('0x7'));var config=require(_0x68c8('0x8'));var attributes=require(_0x68c8('0x9'));module[_0x68c8('0xa')]=function(_0x35b387,_0x3922fe){return _0x35b387['define'](_0x68c8('0xb'),attributes,{'tableName':_0x68c8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4e8=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','FreshdeskConfiguration'];(function(_0x3e0fab,_0x285e29){var _0x36cde8=function(_0x124a10){while(--_0x124a10){_0x3e0fab['push'](_0x3e0fab['shift']());}};_0x36cde8(++_0x285e29);}(_0xc4e8,0x17c));var _0x8c4e=function(_0x5c95a2,_0xf62064){_0x5c95a2=_0x5c95a2-0x0;var _0x345fc6=_0xc4e8[_0x5c95a2];return _0x345fc6;};'use strict';var _=require('lodash');var util=require(_0x8c4e('0x0'));var logger=require(_0x8c4e('0x1'))(_0x8c4e('0x2'));var moment=require(_0x8c4e('0x3'));var BPromise=require('bluebird');var rp=require(_0x8c4e('0x4'));var fs=require('fs');var path=require(_0x8c4e('0x5'));var rimraf=require(_0x8c4e('0x6'));var config=require(_0x8c4e('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x8c4e('0x8')]=function(_0x10fb98,_0x3f5e4c){return _0x10fb98['define'](_0x8c4e('0x9'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 9685478..1f5983f 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 _0x2e18=['then','debug','error','code','message','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x2ed0fc,_0x236151){var _0x5f353b=function(_0x38a440){while(--_0x38a440){_0x2ed0fc['push'](_0x2ed0fc['shift']());}};_0x5f353b(++_0x236151);}(_0x2e18,0xf0));var _0x82e1=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x2e18[_0x4c445a];return _0x2f611c;};'use strict';var _=require(_0x82e1('0x0'));var util=require(_0x82e1('0x1'));var moment=require(_0x82e1('0x2'));var BPromise=require(_0x82e1('0x3'));var rs=require(_0x82e1('0x4'));var fs=require('fs');var Redis=require(_0x82e1('0x5'));var db=require(_0x82e1('0x6'))['db'];var utils=require(_0x82e1('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x82e1('0x8'));var jayson=require(_0x82e1('0x9'));var client=jayson[_0x82e1('0xa')][_0x82e1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5df070,_0x55043c,_0x55a5d6){return new BPromise(function(_0x106b7a,_0xce4cc9){return client['request'](_0x5df070,_0x55a5d6)[_0x82e1('0xc')](function(_0x4176ed){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x55043c,'request\x20sent');logger[_0x82e1('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x55043c,'request\x20sent',JSON['stringify'](_0x4176ed));if(_0x4176ed[_0x82e1('0xe')]){if(_0x4176ed[_0x82e1('0xe')][_0x82e1('0xf')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x55043c,_0x4176ed[_0x82e1('0xe')][_0x82e1('0x10')]);return _0xce4cc9(_0x4176ed[_0x82e1('0xe')][_0x82e1('0x10')]);}logger[_0x82e1('0xe')](_0x82e1('0x11'),_0x55043c,_0x4176ed[_0x82e1('0xe')][_0x82e1('0x10')]);return _0x106b7a(_0x4176ed[_0x82e1('0xe')]['message']);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x55043c,_0x82e1('0x12'));_0x106b7a(_0x4176ed[_0x82e1('0x13')][_0x82e1('0x10')]);}})[_0x82e1('0x14')](function(_0x50f7b5){logger[_0x82e1('0xe')](_0x82e1('0x11'),_0x55043c,_0x50f7b5);_0xce4cc9(_0x50f7b5);});});} \ No newline at end of file +var _0xcde4=['info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x4b0a13,_0x9f30e0){var _0x4d11bf=function(_0x1cc6cc){while(--_0x1cc6cc){_0x4b0a13['push'](_0x4b0a13['shift']());}};_0x4d11bf(++_0x9f30e0);}(_0xcde4,0x1ab));var _0x4cde=function(_0x5f5cce,_0x138cc5){_0x5f5cce=_0x5f5cce-0x0;var _0x705ecf=_0xcde4[_0x5f5cce];return _0x705ecf;};'use strict';var _=require(_0x4cde('0x0'));var util=require(_0x4cde('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4cde('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4cde('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4cde('0x4'))(_0x4cde('0x5'));var config=require(_0x4cde('0x6'));var jayson=require(_0x4cde('0x7'));var client=jayson['client'][_0x4cde('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2db154,_0x15e961,_0x2ea5ed){return new BPromise(function(_0x4d658b,_0x22bff5){return client[_0x4cde('0x9')](_0x2db154,_0x2ea5ed)['then'](function(_0x33c3d0){logger[_0x4cde('0xa')](_0x4cde('0xb'),_0x15e961,_0x4cde('0xc'));logger[_0x4cde('0xd')](_0x4cde('0xe'),_0x15e961,_0x4cde('0xc'),JSON['stringify'](_0x33c3d0));if(_0x33c3d0['error']){if(_0x33c3d0[_0x4cde('0xf')][_0x4cde('0x10')]===0x1f4){logger[_0x4cde('0xf')](_0x4cde('0xb'),_0x15e961,_0x33c3d0[_0x4cde('0xf')]['message']);return _0x22bff5(_0x33c3d0[_0x4cde('0xf')][_0x4cde('0x11')]);}logger[_0x4cde('0xf')](_0x4cde('0xb'),_0x15e961,_0x33c3d0['error']['message']);return _0x4d658b(_0x33c3d0[_0x4cde('0xf')][_0x4cde('0x11')]);}else{logger[_0x4cde('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x15e961,_0x4cde('0xc'));_0x4d658b(_0x33c3d0['result']['message']);}})[_0x4cde('0x12')](function(_0xbcb7b6){logger[_0x4cde('0xf')](_0x4cde('0xb'),_0x15e961,_0xbcb7b6);_0x22bff5(_0xbcb7b6);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 5b354d3..db340b4 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 _0x55cc=['create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','post'];(function(_0x3d7fd0,_0x377f94){var _0x5bb6d1=function(_0x112a35){while(--_0x112a35){_0x3d7fd0['push'](_0x3d7fd0['shift']());}};_0x5bb6d1(++_0x377f94);}(_0x55cc,0x1a7));var _0xc55c=function(_0x4bf7ff,_0x53004b){_0x4bf7ff=_0x4bf7ff-0x0;var _0x35ffb3=_0x55cc[_0x4bf7ff];return _0x35ffb3;};'use strict';var multer=require(_0xc55c('0x0'));var util=require(_0xc55c('0x1'));var path=require('path');var timeout=require(_0xc55c('0x2'));var express=require(_0xc55c('0x3'));var router=express[_0xc55c('0x4')]();var fs_extra=require(_0xc55c('0x5'));var auth=require(_0xc55c('0x6'));var interaction=require(_0xc55c('0x7'));var config=require('../../config/environment');var controller=require(_0xc55c('0x8'));router[_0xc55c('0x9')]('/',auth[_0xc55c('0xa')](),controller[_0xc55c('0xb')]);router[_0xc55c('0x9')](_0xc55c('0xc'),auth[_0xc55c('0xa')](),controller['show']);router[_0xc55c('0xd')]('/',auth[_0xc55c('0xa')](),controller[_0xc55c('0xe')]);router[_0xc55c('0xf')](_0xc55c('0xc'),auth[_0xc55c('0xa')](),controller['update']);router[_0xc55c('0x10')](_0xc55c('0xc'),auth[_0xc55c('0xa')](),controller[_0xc55c('0x11')]);module[_0xc55c('0x12')]=router; \ No newline at end of file +var _0x4742=['/:id','show','post','create','update','delete','destroy','exports','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','get'];(function(_0x2524ec,_0x1a87a9){var _0x5150e9=function(_0x4e6312){while(--_0x4e6312){_0x2524ec['push'](_0x2524ec['shift']());}};_0x5150e9(++_0x1a87a9);}(_0x4742,0xb2));var _0x2474=function(_0x29db71,_0x43a62a){_0x29db71=_0x29db71-0x0;var _0x11f102=_0x4742[_0x29db71];return _0x11f102;};'use strict';var multer=require('multer');var util=require(_0x2474('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2474('0x1')]();var fs_extra=require(_0x2474('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x2474('0x3'));var config=require(_0x2474('0x4'));var controller=require(_0x2474('0x5'));router['get']('/',auth[_0x2474('0x6')](),controller[_0x2474('0x7')]);router[_0x2474('0x8')](_0x2474('0x9'),auth[_0x2474('0x6')](),controller[_0x2474('0xa')]);router[_0x2474('0xb')]('/',auth['isAuthenticated'](),controller[_0x2474('0xc')]);router['put'](_0x2474('0x9'),auth[_0x2474('0x6')](),controller[_0x2474('0xd')]);router[_0x2474('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x2474('0xf')]);module[_0x2474('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 3265cfd..e5ec3a5 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 _0x24ad=['STRING','BOOLEAN','sequelize','exports','string','customVariable','keyValue'];(function(_0x244a2c,_0x5eb691){var _0x1bb2db=function(_0x4c1cd7){while(--_0x4c1cd7){_0x244a2c['push'](_0x244a2c['shift']());}};_0x1bb2db(++_0x5eb691);}(_0x24ad,0x1bb));var _0xd24a=function(_0x4f0d9d,_0x70691){_0x4f0d9d=_0x4f0d9d-0x0;var _0x2fc505=_0x24ad[_0x4f0d9d];return _0x2fc505;};'use strict';var Sequelize=require(_0xd24a('0x0'));module[_0xd24a('0x1')]={'type':{'type':Sequelize['ENUM'](_0xd24a('0x2'),'variable',_0xd24a('0x3'),_0xd24a('0x4'),'picklist'),'defaultValue':_0xd24a('0x2')},'content':{'type':Sequelize[_0xd24a('0x5')]},'key':{'type':Sequelize[_0xd24a('0x5')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xd24a('0x3'))},'keyContent':{'type':Sequelize[_0xd24a('0x5')]},'idField':{'type':Sequelize[_0xd24a('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd24a('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1399=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x558b2d,_0x53e9f3){var _0x374c92=function(_0x337e61){while(--_0x337e61){_0x558b2d['push'](_0x558b2d['shift']());}};_0x374c92(++_0x53e9f3);}(_0x1399,0x19b));var _0x9139=function(_0x474f02,_0x44c5af){_0x474f02=_0x474f02-0x0;var _0x47321d=_0x1399[_0x474f02];return _0x47321d;};'use strict';var Sequelize=require(_0x9139('0x0'));module[_0x9139('0x1')]={'type':{'type':Sequelize[_0x9139('0x2')](_0x9139('0x3'),_0x9139('0x4'),_0x9139('0x5'),_0x9139('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9139('0x7')]},'keyType':{'type':Sequelize[_0x9139('0x2')](_0x9139('0x3'),'variable',_0x9139('0x5'))},'keyContent':{'type':Sequelize[_0x9139('0x7')]},'idField':{'type':Sequelize[_0x9139('0x7')]},'nameField':{'type':Sequelize[_0x9139('0x7')]},'customField':{'type':Sequelize[_0x9139('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9139('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 13eacd2..734b609 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 _0x91a7=['filter','merge','where','VIRTUAL','options','findAll','rows','catch','rawAttributes','includeAll','include','find','create','body','params','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskField','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort'];(function(_0x4ff5a2,_0xb33150){var _0xe162f6=function(_0x321cbd){while(--_0x321cbd){_0x4ff5a2['push'](_0x4ff5a2['shift']());}};_0xe162f6(++_0xb33150);}(_0x91a7,0xe7));var _0x791a=function(_0x4a36c9,_0x16a7e9){_0x4a36c9=_0x4a36c9-0x0;var _0x53c122=_0x91a7[_0x4a36c9];return _0x53c122;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x791a('0x0'));var zipdir=require(_0x791a('0x1'));var jsonpatch=require(_0x791a('0x2'));var rp=require('request-promise');var moment=require(_0x791a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x791a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x791a('0x5'));var csv=require(_0x791a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x791a('0x7'));var _=require('lodash');var squel=require(_0x791a('0x8'));var crypto=require(_0x791a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x791a('0xa'));var toCsv=require(_0x791a('0x6'));var querystring=require(_0x791a('0xb'));var Papa=require(_0x791a('0xc'));var Redis=require(_0x791a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x791a('0xe'));var as=require(_0x791a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x791a('0x10'))(_0x791a('0x11'));var utils=require(_0x791a('0x12'));var config=require(_0x791a('0x13'));var licenseUtil=require(_0x791a('0x14'));var db=require(_0x791a('0x15'))['db'];function respondWithStatusCode(_0x53dc41,_0x5daecd){_0x5daecd=_0x5daecd||0xcc;return function(_0xc92016){if(_0xc92016){return _0x53dc41[_0x791a('0x16')](_0x5daecd);}return _0x53dc41['status'](_0x5daecd)[_0x791a('0x17')]();};}function respondWithResult(_0x3a2ec6,_0x5d5b11){_0x5d5b11=_0x5d5b11||0xc8;return function(_0x2887f0){if(_0x2887f0){return _0x3a2ec6[_0x791a('0x18')](_0x5d5b11)[_0x791a('0x19')](_0x2887f0);}};}function respondWithFilteredResult(_0x5cdf2,_0x55e845){return function(_0x2ce2e0){if(_0x2ce2e0){var _0x575d11=typeof _0x55e845[_0x791a('0x1a')]===_0x791a('0x1b')&&typeof _0x55e845['limit']===_0x791a('0x1b');var _0x5bea2e=_0x2ce2e0[_0x791a('0x1c')];var _0x52941d=_0x575d11?0x0:_0x55e845['offset'];var _0x588d00=_0x575d11?_0x2ce2e0[_0x791a('0x1c')]:_0x55e845['offset']+_0x55e845['limit'];var _0x39c60b;if(_0x588d00>=_0x5bea2e){_0x588d00=_0x5bea2e;_0x39c60b=0xc8;}else{_0x39c60b=0xce;}_0x5cdf2[_0x791a('0x18')](_0x39c60b);return _0x5cdf2[_0x791a('0x1d')](_0x791a('0x1e'),_0x52941d+'-'+_0x588d00+'/'+_0x5bea2e)['json'](_0x2ce2e0);}return null;};}function patchUpdates(_0x189c0d){return function(_0xcb5e66){try{jsonpatch[_0x791a('0x1f')](_0xcb5e66,_0x189c0d,!![]);}catch(_0x280f1e){return BPromise['reject'](_0x280f1e);}return _0xcb5e66[_0x791a('0x20')]();};}function saveUpdates(_0x2054c6,_0x25bae5){return function(_0x9e17b5){if(_0x9e17b5){return _0x9e17b5[_0x791a('0x21')](_0x2054c6)[_0x791a('0x22')](function(_0x2241a0){return _0x2241a0;});}return null;};}function removeEntity(_0x45a67d,_0x323c6a){return function(_0xe8e452){if(_0xe8e452){return _0xe8e452[_0x791a('0x23')]()['then'](function(){_0x45a67d[_0x791a('0x18')](0xcc)[_0x791a('0x17')]();});}};}function handleEntityNotFound(_0x380329,_0x2966b8){return function(_0x4d748a){if(!_0x4d748a){_0x380329[_0x791a('0x16')](0x194);}return _0x4d748a;};}function handleError(_0x2db3f7,_0x51dcca){_0x51dcca=_0x51dcca||0x1f4;return function(_0xdfa84f){logger[_0x791a('0x24')](_0xdfa84f[_0x791a('0x25')]);if(_0xdfa84f['name']){delete _0xdfa84f[_0x791a('0x26')];}_0x2db3f7[_0x791a('0x18')](_0x51dcca)[_0x791a('0x27')](_0xdfa84f);};}exports[_0x791a('0x28')]=function(_0x4f423,_0x1a9c6b){var _0x628816={},_0x889534={},_0x58bbc0={'count':0x0,'rows':[]};var _0xbc3436=_[_0x791a('0x29')](db[_0x791a('0x2a')]['rawAttributes'],function(_0x1cdda9){return{'name':_0x1cdda9['fieldName'],'type':_0x1cdda9[_0x791a('0x2b')][_0x791a('0x2c')]};});_0x889534[_0x791a('0x2d')]=_[_0x791a('0x29')](_0xbc3436,_0x791a('0x26'));_0x889534[_0x791a('0x2e')]=_[_0x791a('0x2f')](_0x4f423['query']);_0x889534[_0x791a('0x30')]=_[_0x791a('0x31')](_0x889534[_0x791a('0x2d')],_0x889534[_0x791a('0x2e')]);_0x628816[_0x791a('0x32')]=_['intersection'](_0x889534[_0x791a('0x2d')],qs[_0x791a('0x33')](_0x4f423[_0x791a('0x2e')][_0x791a('0x33')]));_0x628816[_0x791a('0x32')]=_0x628816['attributes'][_0x791a('0x34')]?_0x628816[_0x791a('0x32')]:_0x889534[_0x791a('0x2d')];if(!_0x4f423[_0x791a('0x2e')][_0x791a('0x35')]('nolimit')){_0x628816[_0x791a('0x36')]=qs['limit'](_0x4f423[_0x791a('0x2e')]['limit']);_0x628816['offset']=qs[_0x791a('0x1a')](_0x4f423[_0x791a('0x2e')][_0x791a('0x1a')]);}_0x628816[_0x791a('0x37')]=qs[_0x791a('0x38')](_0x4f423[_0x791a('0x2e')][_0x791a('0x38')]);_0x628816['where']=qs[_0x791a('0x30')](_['pick'](_0x4f423[_0x791a('0x2e')],_0x889534['filters']),_0xbc3436);if(_0x4f423[_0x791a('0x2e')][_0x791a('0x39')]){_0x628816['where']=_[_0x791a('0x3a')](_0x628816[_0x791a('0x3b')],{'$or':_['map'](_0xbc3436,function(_0x45fbfa){if(_0x45fbfa[_0x791a('0x2b')]!==_0x791a('0x3c')){var _0x23db7d={};_0x23db7d[_0x45fbfa[_0x791a('0x26')]]={'$like':'%'+_0x4f423[_0x791a('0x2e')][_0x791a('0x39')]+'%'};return _0x23db7d;}})});}_0x628816=_[_0x791a('0x3a')]({},_0x628816,_0x4f423[_0x791a('0x3d')]);var _0xeafbb5={'where':_0x628816['where']};return db[_0x791a('0x2a')][_0x791a('0x1c')](_0xeafbb5)[_0x791a('0x22')](function(_0x4efbf6){_0x58bbc0[_0x791a('0x1c')]=_0x4efbf6;if(_0x4f423['query']['includeAll']){_0x628816['include']=[{'all':!![]}];}return db[_0x791a('0x2a')][_0x791a('0x3e')](_0x628816);})['then'](function(_0x415c44){_0x58bbc0[_0x791a('0x3f')]=_0x415c44;return _0x58bbc0;})[_0x791a('0x22')](respondWithFilteredResult(_0x1a9c6b,_0x628816))[_0x791a('0x40')](handleError(_0x1a9c6b,null));};exports['show']=function(_0x483336,_0x57b9ba){var _0x2f0395={'raw':!![],'where':{'id':_0x483336['params']['id']}},_0x216dd3={};_0x216dd3[_0x791a('0x2d')]=_[_0x791a('0x2f')](db[_0x791a('0x2a')][_0x791a('0x41')]);_0x216dd3['query']=_[_0x791a('0x2f')](_0x483336['query']);_0x216dd3[_0x791a('0x30')]=_[_0x791a('0x31')](_0x216dd3[_0x791a('0x2d')],_0x216dd3[_0x791a('0x2e')]);_0x2f0395[_0x791a('0x32')]=_['intersection'](_0x216dd3[_0x791a('0x2d')],qs[_0x791a('0x33')](_0x483336[_0x791a('0x2e')][_0x791a('0x33')]));_0x2f0395[_0x791a('0x32')]=_0x2f0395['attributes'][_0x791a('0x34')]?_0x2f0395[_0x791a('0x32')]:_0x216dd3['model'];if(_0x483336['query'][_0x791a('0x42')]){_0x2f0395[_0x791a('0x43')]=[{'all':!![]}];}_0x2f0395=_[_0x791a('0x3a')]({},_0x2f0395,_0x483336['options']);return db['FreshdeskField'][_0x791a('0x44')](_0x2f0395)[_0x791a('0x22')](handleEntityNotFound(_0x57b9ba,null))['then'](respondWithResult(_0x57b9ba,null))[_0x791a('0x40')](handleError(_0x57b9ba,null));};exports[_0x791a('0x45')]=function(_0x3eac77,_0x549980){return db['FreshdeskField'][_0x791a('0x45')](_0x3eac77[_0x791a('0x46')],{})[_0x791a('0x22')](respondWithResult(_0x549980,0xc9))[_0x791a('0x40')](handleError(_0x549980,null));};exports['update']=function(_0x2d7c7d,_0x9f768a){if(_0x2d7c7d[_0x791a('0x46')]['id']){delete _0x2d7c7d[_0x791a('0x46')]['id'];}return db['FreshdeskField'][_0x791a('0x44')]({'where':{'id':_0x2d7c7d[_0x791a('0x47')]['id']}})[_0x791a('0x22')](handleEntityNotFound(_0x9f768a,null))[_0x791a('0x22')](saveUpdates(_0x2d7c7d[_0x791a('0x46')],null))[_0x791a('0x22')](respondWithResult(_0x9f768a,null))[_0x791a('0x40')](handleError(_0x9f768a,null));};exports['destroy']=function(_0xdcb1b,_0x1fd826){return db['FreshdeskField'][_0x791a('0x44')]({'where':{'id':_0xdcb1b[_0x791a('0x47')]['id']}})['then'](handleEntityNotFound(_0x1fd826,null))[_0x791a('0x22')](removeEntity(_0x1fd826,null))[_0x791a('0x40')](handleError(_0x1fd826,null));}; \ No newline at end of file +var _0x878f=['key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','filter','where','type','VIRTUAL','merge','includeAll','include','FreshdeskField','rows','params','find','create','body','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName'];(function(_0x553ef3,_0x5d608b){var _0x2f0bb4=function(_0x3aac1b){while(--_0x3aac1b){_0x553ef3['push'](_0x553ef3['shift']());}};_0x2f0bb4(++_0x5d608b);}(_0x878f,0x173));var _0xf878=function(_0x568c2a,_0x31c9e6){_0x568c2a=_0x568c2a-0x0;var _0x28ae65=_0x878f[_0x568c2a];return _0x28ae65;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf878('0x0'));var zipdir=require(_0xf878('0x1'));var jsonpatch=require(_0xf878('0x2'));var rp=require(_0xf878('0x3'));var moment=require(_0xf878('0x4'));var BPromise=require(_0xf878('0x5'));var Mustache=require(_0xf878('0x6'));var util=require(_0xf878('0x7'));var path=require(_0xf878('0x8'));var sox=require(_0xf878('0x9'));var csv=require(_0xf878('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf878('0xb'));var squel=require(_0xf878('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf878('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf878('0xd'));var authService=require(_0xf878('0xe'));var qs=require(_0xf878('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf878('0x10'));var logger=require(_0xf878('0x11'))('api');var utils=require(_0xf878('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf878('0x13'));var db=require(_0xf878('0x14'))['db'];function respondWithStatusCode(_0x339c9c,_0x596fb5){_0x596fb5=_0x596fb5||0xcc;return function(_0x1ce004){if(_0x1ce004){return _0x339c9c[_0xf878('0x15')](_0x596fb5);}return _0x339c9c[_0xf878('0x16')](_0x596fb5)['end']();};}function respondWithResult(_0xe2c2de,_0x3902f7){_0x3902f7=_0x3902f7||0xc8;return function(_0x119e9e){if(_0x119e9e){return _0xe2c2de['status'](_0x3902f7)['json'](_0x119e9e);}};}function respondWithFilteredResult(_0x4c0948,_0x35ff2d){return function(_0x31d888){if(_0x31d888){var _0x6dbeca=typeof _0x35ff2d[_0xf878('0x17')]===_0xf878('0x18')&&typeof _0x35ff2d[_0xf878('0x19')]===_0xf878('0x18');var _0x3c5dee=_0x31d888[_0xf878('0x1a')];var _0x3b2e1b=_0x6dbeca?0x0:_0x35ff2d['offset'];var _0x2b2b54=_0x6dbeca?_0x31d888[_0xf878('0x1a')]:_0x35ff2d[_0xf878('0x17')]+_0x35ff2d[_0xf878('0x19')];var _0x3714f6;if(_0x2b2b54>=_0x3c5dee){_0x2b2b54=_0x3c5dee;_0x3714f6=0xc8;}else{_0x3714f6=0xce;}_0x4c0948[_0xf878('0x16')](_0x3714f6);return _0x4c0948[_0xf878('0x1b')]('Content-Range',_0x3b2e1b+'-'+_0x2b2b54+'/'+_0x3c5dee)[_0xf878('0x1c')](_0x31d888);}return null;};}function patchUpdates(_0x140866){return function(_0x250f85){try{jsonpatch['apply'](_0x250f85,_0x140866,!![]);}catch(_0x432e5d){return BPromise[_0xf878('0x1d')](_0x432e5d);}return _0x250f85[_0xf878('0x1e')]();};}function saveUpdates(_0x392822,_0x22d884){return function(_0x442450){if(_0x442450){return _0x442450[_0xf878('0x1f')](_0x392822)[_0xf878('0x20')](function(_0x212436){return _0x212436;});}return null;};}function removeEntity(_0x1a6506,_0x45e61f){return function(_0x566995){if(_0x566995){return _0x566995[_0xf878('0x21')]()['then'](function(){_0x1a6506[_0xf878('0x16')](0xcc)[_0xf878('0x22')]();});}};}function handleEntityNotFound(_0x35b3b4,_0x280036){return function(_0x20449e){if(!_0x20449e){_0x35b3b4['sendStatus'](0x194);}return _0x20449e;};}function handleError(_0x58c713,_0x59ba7b){_0x59ba7b=_0x59ba7b||0x1f4;return function(_0x242926){logger[_0xf878('0x23')](_0x242926[_0xf878('0x24')]);if(_0x242926['name']){delete _0x242926[_0xf878('0x25')];}_0x58c713[_0xf878('0x16')](_0x59ba7b)[_0xf878('0x26')](_0x242926);};}exports[_0xf878('0x27')]=function(_0x41dd55,_0x5aff46){var _0x502322={},_0x9a127d={},_0x5d9c97={'count':0x0,'rows':[]};var _0x4a0286=_[_0xf878('0x28')](db['FreshdeskField'][_0xf878('0x29')],function(_0x51afaf){return{'name':_0x51afaf[_0xf878('0x2a')],'type':_0x51afaf['type'][_0xf878('0x2b')]};});_0x9a127d['model']=_[_0xf878('0x28')](_0x4a0286,_0xf878('0x25'));_0x9a127d[_0xf878('0x2c')]=_[_0xf878('0x2d')](_0x41dd55[_0xf878('0x2c')]);_0x9a127d[_0xf878('0x2e')]=_['intersection'](_0x9a127d[_0xf878('0x2f')],_0x9a127d[_0xf878('0x2c')]);_0x502322[_0xf878('0x30')]=_[_0xf878('0x31')](_0x9a127d[_0xf878('0x2f')],qs['fields'](_0x41dd55[_0xf878('0x2c')][_0xf878('0x32')]));_0x502322['attributes']=_0x502322[_0xf878('0x30')][_0xf878('0x33')]?_0x502322[_0xf878('0x30')]:_0x9a127d[_0xf878('0x2f')];if(!_0x41dd55[_0xf878('0x2c')]['hasOwnProperty'](_0xf878('0x34'))){_0x502322[_0xf878('0x19')]=qs[_0xf878('0x19')](_0x41dd55[_0xf878('0x2c')]['limit']);_0x502322[_0xf878('0x17')]=qs['offset'](_0x41dd55['query'][_0xf878('0x17')]);}_0x502322[_0xf878('0x35')]=qs[_0xf878('0x36')](_0x41dd55[_0xf878('0x2c')][_0xf878('0x36')]);_0x502322['where']=qs[_0xf878('0x2e')](_['pick'](_0x41dd55[_0xf878('0x2c')],_0x9a127d[_0xf878('0x2e')]),_0x4a0286);if(_0x41dd55['query'][_0xf878('0x37')]){_0x502322[_0xf878('0x38')]=_['merge'](_0x502322[_0xf878('0x38')],{'$or':_[_0xf878('0x28')](_0x4a0286,function(_0x5b4098){if(_0x5b4098[_0xf878('0x39')]!==_0xf878('0x3a')){var _0x34731d={};_0x34731d[_0x5b4098[_0xf878('0x25')]]={'$like':'%'+_0x41dd55[_0xf878('0x2c')][_0xf878('0x37')]+'%'};return _0x34731d;}})});}_0x502322=_[_0xf878('0x3b')]({},_0x502322,_0x41dd55['options']);var _0x1179fb={'where':_0x502322[_0xf878('0x38')]};return db['FreshdeskField'][_0xf878('0x1a')](_0x1179fb)['then'](function(_0x489964){_0x5d9c97[_0xf878('0x1a')]=_0x489964;if(_0x41dd55[_0xf878('0x2c')][_0xf878('0x3c')]){_0x502322[_0xf878('0x3d')]=[{'all':!![]}];}return db[_0xf878('0x3e')]['findAll'](_0x502322);})[_0xf878('0x20')](function(_0x4c4ae4){_0x5d9c97[_0xf878('0x3f')]=_0x4c4ae4;return _0x5d9c97;})[_0xf878('0x20')](respondWithFilteredResult(_0x5aff46,_0x502322))['catch'](handleError(_0x5aff46,null));};exports['show']=function(_0x180594,_0x2a66c1){var _0x13fcd3={'raw':!![],'where':{'id':_0x180594[_0xf878('0x40')]['id']}},_0x2f6ee5={};_0x2f6ee5[_0xf878('0x2f')]=_[_0xf878('0x2d')](db[_0xf878('0x3e')][_0xf878('0x29')]);_0x2f6ee5['query']=_[_0xf878('0x2d')](_0x180594[_0xf878('0x2c')]);_0x2f6ee5[_0xf878('0x2e')]=_[_0xf878('0x31')](_0x2f6ee5[_0xf878('0x2f')],_0x2f6ee5[_0xf878('0x2c')]);_0x13fcd3['attributes']=_[_0xf878('0x31')](_0x2f6ee5[_0xf878('0x2f')],qs[_0xf878('0x32')](_0x180594[_0xf878('0x2c')][_0xf878('0x32')]));_0x13fcd3['attributes']=_0x13fcd3[_0xf878('0x30')][_0xf878('0x33')]?_0x13fcd3[_0xf878('0x30')]:_0x2f6ee5[_0xf878('0x2f')];if(_0x180594['query'][_0xf878('0x3c')]){_0x13fcd3[_0xf878('0x3d')]=[{'all':!![]}];}_0x13fcd3=_[_0xf878('0x3b')]({},_0x13fcd3,_0x180594['options']);return db['FreshdeskField'][_0xf878('0x41')](_0x13fcd3)['then'](handleEntityNotFound(_0x2a66c1,null))['then'](respondWithResult(_0x2a66c1,null))['catch'](handleError(_0x2a66c1,null));};exports[_0xf878('0x42')]=function(_0x49e719,_0x156fdb){return db[_0xf878('0x3e')][_0xf878('0x42')](_0x49e719[_0xf878('0x43')],{})[_0xf878('0x20')](respondWithResult(_0x156fdb,0xc9))[_0xf878('0x44')](handleError(_0x156fdb,null));};exports[_0xf878('0x1f')]=function(_0x526c89,_0xb0bf4c){if(_0x526c89[_0xf878('0x43')]['id']){delete _0x526c89[_0xf878('0x43')]['id'];}return db[_0xf878('0x3e')][_0xf878('0x41')]({'where':{'id':_0x526c89['params']['id']}})['then'](handleEntityNotFound(_0xb0bf4c,null))[_0xf878('0x20')](saveUpdates(_0x526c89[_0xf878('0x43')],null))['then'](respondWithResult(_0xb0bf4c,null))[_0xf878('0x44')](handleError(_0xb0bf4c,null));};exports['destroy']=function(_0x1ce6b9,_0x31adde){return db[_0xf878('0x3e')][_0xf878('0x41')]({'where':{'id':_0x1ce6b9['params']['id']}})[_0xf878('0x20')](handleEntityNotFound(_0x31adde,null))[_0xf878('0x20')](removeEntity(_0x31adde,null))[_0xf878('0x44')](handleError(_0x31adde,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 1b26e08..ab476ba 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 _0xab04=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields','idField','FieldId','lodash'];(function(_0x6b9bb6,_0x504b76){var _0x1992ff=function(_0x5d7e69){while(--_0x5d7e69){_0x6b9bb6['push'](_0x6b9bb6['shift']());}};_0x1992ff(++_0x504b76);}(_0xab04,0x194));var _0x4ab0=function(_0x181728,_0x471cc4){_0x181728=_0x181728-0x0;var _0x3525db=_0xab04[_0x181728];return _0x3525db;};'use strict';var _=require(_0x4ab0('0x0'));var util=require(_0x4ab0('0x1'));var logger=require(_0x4ab0('0x2'))(_0x4ab0('0x3'));var moment=require(_0x4ab0('0x4'));var BPromise=require(_0x4ab0('0x5'));var rp=require(_0x4ab0('0x6'));var fs=require('fs');var path=require(_0x4ab0('0x7'));var rimraf=require('rimraf');var config=require(_0x4ab0('0x8'));var attributes=require('./intFreshdeskField.attributes');module[_0x4ab0('0x9')]=function(_0x506aa6,_0x4058e7){return _0x506aa6[_0x4ab0('0xa')](_0x4ab0('0xb'),attributes,{'tableName':_0x4ab0('0xc'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x4ab0('0xd'),_0x4ab0('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe444=['bluebird','request-promise','path','rimraf','exports','define','FieldId','util','../../config/logger','api','moment'];(function(_0x14f849,_0x4d13e5){var _0xcef4c4=function(_0x5e4fbc){while(--_0x5e4fbc){_0x14f849['push'](_0x14f849['shift']());}};_0xcef4c4(++_0x4d13e5);}(_0xe444,0x1bf));var _0x4e44=function(_0x5442e0,_0x5515e2){_0x5442e0=_0x5442e0-0x0;var _0x3987aa=_0xe444[_0x5442e0];return _0x3987aa;};'use strict';var _=require('lodash');var util=require(_0x4e44('0x0'));var logger=require(_0x4e44('0x1'))(_0x4e44('0x2'));var moment=require(_0x4e44('0x3'));var BPromise=require(_0x4e44('0x4'));var rp=require(_0x4e44('0x5'));var fs=require('fs');var path=require(_0x4e44('0x6'));var rimraf=require(_0x4e44('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshdeskField.attributes');module[_0x4e44('0x8')]=function(_0x377323,_0x1acd2f){return _0x377323[_0x4e44('0x9')]('FreshdeskField',attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0x4e44('0xa')],'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 ef4a6a0..aa53b4b 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 _0x7a02=['then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2975f1,_0x453f49){var _0x2c08d5=function(_0x2cf9c5){while(--_0x2cf9c5){_0x2975f1['push'](_0x2975f1['shift']());}};_0x2c08d5(++_0x453f49);}(_0x7a02,0x14d));var _0x27a0=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x7a02[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x27a0('0x0'));var util=require(_0x27a0('0x1'));var moment=require('moment');var BPromise=require(_0x27a0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x27a0('0x3'));var db=require(_0x27a0('0x4'))['db'];var utils=require(_0x27a0('0x5'));var logger=require(_0x27a0('0x6'))(_0x27a0('0x7'));var config=require(_0x27a0('0x8'));var jayson=require(_0x27a0('0x9'));var client=jayson['client'][_0x27a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28fe44,_0x2ecab6,_0x12294c){return new BPromise(function(_0x2efab3,_0x358ca7){return client[_0x27a0('0xb')](_0x28fe44,_0x12294c)[_0x27a0('0xc')](function(_0x1b3f65){logger[_0x27a0('0xd')](_0x27a0('0xe'),_0x2ecab6,_0x27a0('0xf'));logger['debug'](_0x27a0('0x10'),_0x2ecab6,_0x27a0('0xf'),JSON[_0x27a0('0x11')](_0x1b3f65));if(_0x1b3f65['error']){if(_0x1b3f65[_0x27a0('0x12')][_0x27a0('0x13')]===0x1f4){logger[_0x27a0('0x12')](_0x27a0('0xe'),_0x2ecab6,_0x1b3f65[_0x27a0('0x12')][_0x27a0('0x14')]);return _0x358ca7(_0x1b3f65[_0x27a0('0x12')]['message']);}logger[_0x27a0('0x12')](_0x27a0('0xe'),_0x2ecab6,_0x1b3f65[_0x27a0('0x12')][_0x27a0('0x14')]);return _0x2efab3(_0x1b3f65[_0x27a0('0x12')][_0x27a0('0x14')]);}else{logger[_0x27a0('0xd')](_0x27a0('0xe'),_0x2ecab6,_0x27a0('0xf'));_0x2efab3(_0x1b3f65[_0x27a0('0x15')]['message']);}})[_0x27a0('0x16')](function(_0x41a21f){logger[_0x27a0('0x12')](_0x27a0('0xe'),_0x2ecab6,_0x41a21f);_0x358ca7(_0x41a21f);});});} \ No newline at end of file +var _0x1ee0=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','info','result','moment','bluebird','randomstring'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x1ee0,0x156));var _0x01ee=function(_0x44d545,_0x4ab65e){_0x44d545=_0x44d545-0x0;var _0x24702e=_0x1ee0[_0x44d545];return _0x24702e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x01ee('0x0'));var BPromise=require(_0x01ee('0x1'));var rs=require(_0x01ee('0x2'));var fs=require('fs');var Redis=require(_0x01ee('0x3'));var db=require(_0x01ee('0x4'))['db'];var utils=require(_0x01ee('0x5'));var logger=require(_0x01ee('0x6'))(_0x01ee('0x7'));var config=require(_0x01ee('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x01ee('0x9')][_0x01ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5acf84,_0x498eda,_0x5a66a4){return new BPromise(function(_0x30e58a,_0x494ade){return client[_0x01ee('0xb')](_0x5acf84,_0x5a66a4)[_0x01ee('0xc')](function(_0x11a3cf){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x498eda,_0x01ee('0xd'));logger[_0x01ee('0xe')](_0x01ee('0xf'),_0x498eda,_0x01ee('0xd'),JSON[_0x01ee('0x10')](_0x11a3cf));if(_0x11a3cf[_0x01ee('0x11')]){if(_0x11a3cf[_0x01ee('0x11')][_0x01ee('0x12')]===0x1f4){logger[_0x01ee('0x11')](_0x01ee('0x13'),_0x498eda,_0x11a3cf['error']['message']);return _0x494ade(_0x11a3cf[_0x01ee('0x11')]['message']);}logger[_0x01ee('0x11')](_0x01ee('0x13'),_0x498eda,_0x11a3cf[_0x01ee('0x11')]['message']);return _0x30e58a(_0x11a3cf['error'][_0x01ee('0x14')]);}else{logger[_0x01ee('0x15')](_0x01ee('0x13'),_0x498eda,_0x01ee('0xd'));_0x30e58a(_0x11a3cf[_0x01ee('0x16')][_0x01ee('0x14')]);}})['catch'](function(_0x321c51){logger[_0x01ee('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x498eda,_0x321c51);_0x494ade(_0x321c51);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 579bbb4..97294dc 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 _0x4483=['../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x49d634,_0x1f4395){var _0xae60fa=function(_0x54c458){while(--_0x54c458){_0x49d634['push'](_0x49d634['shift']());}};_0xae60fa(++_0x1f4395);}(_0x4483,0x1a3));var _0x3448=function(_0x31130b,_0x4b0766){_0x31130b=_0x31130b-0x0;var _0x55c4c5=_0x4483[_0x31130b];return _0x55c4c5;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id/configurations',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0x9')](_0x3448('0xf'),auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x11')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0x12')]);router[_0x3448('0x11')](_0x3448('0x13'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x3448('0x14')](_0x3448('0xc'),auth['isAuthenticated'](),controller[_0x3448('0x15')]);router[_0x3448('0x16')](_0x3448('0xc'),auth['isAuthenticated'](),controller[_0x3448('0x17')]);module[_0x3448('0x18')]=router; \ No newline at end of file +var _0x750a=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields','create','put','delete','destroy','exports'];(function(_0x52ddf5,_0x865610){var _0x2e1d65=function(_0x4af34e){while(--_0x4af34e){_0x52ddf5['push'](_0x52ddf5['shift']());}};_0x2e1d65(++_0x865610);}(_0x750a,0x140));var _0xa750=function(_0x340e54,_0x5821cf){_0x340e54=_0x340e54-0x0;var _0x318d83=_0x750a[_0x340e54];return _0x318d83;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['show']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0x8')]('/:id/fields',auth[_0xa750('0x9')](),controller[_0xa750('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa750('0xf')]);router['post'](_0xa750('0xc'),auth[_0xa750('0x9')](),controller['addConfiguration']);router[_0xa750('0x10')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['update']);router[_0xa750('0x11')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller[_0xa750('0x12')]);module[_0xa750('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index f466378..7be51b0 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 _0xffd6=['exports','STRING','username','sequelize'];(function(_0x51fc6b,_0x258d4f){var _0x31954d=function(_0x33d3a5){while(--_0x33d3a5){_0x51fc6b['push'](_0x51fc6b['shift']());}};_0x31954d(++_0x258d4f);}(_0xffd6,0x97));var _0x6ffd=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xffd6[_0x55abd9];return _0x3e5669;};'use strict';var Sequelize=require(_0x6ffd('0x0'));module[_0x6ffd('0x1')]={'name':{'type':Sequelize[_0x6ffd('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x6ffd('0x3')},'apiKey':{'type':Sequelize[_0x6ffd('0x2')]},'remoteUri':{'type':Sequelize[_0x6ffd('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6ffd('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x3423=['username','remoteUri','STRING'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3342('0x0')]},'description':{'type':Sequelize[_0x3342('0x0')]},'username':{'type':Sequelize[_0x3342('0x0')],'unique':_0x3342('0x1')},'apiKey':{'type':Sequelize[_0x3342('0x0')]},'remoteUri':{'type':Sequelize[_0x3342('0x0')],'unique':_0x3342('0x2')},'serverUrl':{'type':Sequelize[_0x3342('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 48a9222..395eb6e 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 _0x47c3=['FreshsalesConfiguration','FreshsalesField','Subjects','getFields','username','apiKey','remoteUri','substring','lastIndexOf','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','to-csv','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','FreshsalesAccount','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','getConfigurations','findOne','hasOwnProperty','addConfiguration','channel','Descriptions'];(function(_0x2ac980,_0x33829d){var _0x53974d=function(_0x4cd40c){while(--_0x4cd40c){_0x2ac980['push'](_0x2ac980['shift']());}};_0x53974d(++_0x33829d);}(_0x47c3,0xd4));var _0x347c=function(_0x5a145f,_0x7b8699){_0x5a145f=_0x5a145f-0x0;var _0x1d7c61=_0x47c3[_0x5a145f];return _0x1d7c61;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x347c('0x0'));var jsonpatch=require(_0x347c('0x1'));var rp=require(_0x347c('0x2'));var moment=require(_0x347c('0x3'));var BPromise=require(_0x347c('0x4'));var Mustache=require(_0x347c('0x5'));var util=require(_0x347c('0x6'));var path=require(_0x347c('0x7'));var sox=require(_0x347c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x347c('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x347c('0xa'));var jsforce=require(_0x347c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x347c('0xc'));var querystring=require('querystring');var Papa=require(_0x347c('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x347c('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x347c('0xf'));var logger=require(_0x347c('0x10'))(_0x347c('0x11'));var utils=require('../../config/utils');var config=require(_0x347c('0x12'));var licenseUtil=require(_0x347c('0x13'));var db=require(_0x347c('0x14'))['db'];var integrations=require(_0x347c('0x15'));function respondWithStatusCode(_0x49f195,_0x1a84bf){_0x1a84bf=_0x1a84bf||0xcc;return function(_0x5756ba){if(_0x5756ba){return _0x49f195['sendStatus'](_0x1a84bf);}return _0x49f195['status'](_0x1a84bf)[_0x347c('0x16')]();};}function respondWithResult(_0x1b8e15,_0x4931fb){_0x4931fb=_0x4931fb||0xc8;return function(_0x501016){if(_0x501016){return _0x1b8e15[_0x347c('0x17')](_0x4931fb)[_0x347c('0x18')](_0x501016);}};}function respondWithFilteredResult(_0x148ceb,_0x26f08d){return function(_0x4b7e73){if(_0x4b7e73){var _0x4ef578=typeof _0x26f08d[_0x347c('0x19')]==='undefined'&&typeof _0x26f08d[_0x347c('0x1a')]===_0x347c('0x1b');var _0x3498c0=_0x4b7e73[_0x347c('0x1c')];var _0x17f4fb=_0x4ef578?0x0:_0x26f08d[_0x347c('0x19')];var _0x4d76dd=_0x4ef578?_0x4b7e73[_0x347c('0x1c')]:_0x26f08d[_0x347c('0x19')]+_0x26f08d['limit'];var _0x5462a5;if(_0x4d76dd>=_0x3498c0){_0x4d76dd=_0x3498c0;_0x5462a5=0xc8;}else{_0x5462a5=0xce;}_0x148ceb['status'](_0x5462a5);return _0x148ceb[_0x347c('0x1d')](_0x347c('0x1e'),_0x17f4fb+'-'+_0x4d76dd+'/'+_0x3498c0)[_0x347c('0x18')](_0x4b7e73);}return null;};}function patchUpdates(_0x347a42){return function(_0x30f1fb){try{jsonpatch['apply'](_0x30f1fb,_0x347a42,!![]);}catch(_0xfa3a6){return BPromise[_0x347c('0x1f')](_0xfa3a6);}return _0x30f1fb[_0x347c('0x20')]();};}function saveUpdates(_0x29a929,_0xf28180){return function(_0x1d2b50){if(_0x1d2b50){return _0x1d2b50[_0x347c('0x21')](_0x29a929)[_0x347c('0x22')](function(_0x16b0a6){return _0x16b0a6;});}return null;};}function removeEntity(_0x5346b1,_0x198cfe){return function(_0x4a2223){if(_0x4a2223){return _0x4a2223[_0x347c('0x23')]()[_0x347c('0x22')](function(){_0x5346b1[_0x347c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51f503,_0x441d05){return function(_0x36e2a5){if(!_0x36e2a5){_0x51f503[_0x347c('0x24')](0x194);}return _0x36e2a5;};}function handleError(_0x22d1fc,_0x33acd8){_0x33acd8=_0x33acd8||0x1f4;return function(_0x4fa133){logger[_0x347c('0x25')](_0x4fa133[_0x347c('0x26')]);if(_0x4fa133[_0x347c('0x27')]){delete _0x4fa133['name'];}_0x22d1fc[_0x347c('0x17')](_0x33acd8)['send'](_0x4fa133);};}exports[_0x347c('0x28')]=function(_0x119d87,_0x181094){var _0x52b2f5={},_0xd90a4a={},_0x42e2ba={'count':0x0,'rows':[]};var _0x9e6f0b=_[_0x347c('0x29')](db[_0x347c('0x2a')][_0x347c('0x2b')],function(_0x5bbc4d){return{'name':_0x5bbc4d[_0x347c('0x2c')],'type':_0x5bbc4d['type']['key']};});_0xd90a4a['model']=_[_0x347c('0x29')](_0x9e6f0b,_0x347c('0x27'));_0xd90a4a[_0x347c('0x2d')]=_[_0x347c('0x2e')](_0x119d87[_0x347c('0x2d')]);_0xd90a4a[_0x347c('0x2f')]=_[_0x347c('0x30')](_0xd90a4a[_0x347c('0x31')],_0xd90a4a[_0x347c('0x2d')]);_0x52b2f5[_0x347c('0x32')]=_[_0x347c('0x30')](_0xd90a4a[_0x347c('0x31')],qs['fields'](_0x119d87[_0x347c('0x2d')][_0x347c('0x33')]));_0x52b2f5['attributes']=_0x52b2f5[_0x347c('0x32')][_0x347c('0x34')]?_0x52b2f5[_0x347c('0x32')]:_0xd90a4a[_0x347c('0x31')];if(!_0x119d87[_0x347c('0x2d')]['hasOwnProperty'](_0x347c('0x35'))){_0x52b2f5['limit']=qs[_0x347c('0x1a')](_0x119d87[_0x347c('0x2d')][_0x347c('0x1a')]);_0x52b2f5[_0x347c('0x19')]=qs[_0x347c('0x19')](_0x119d87['query'][_0x347c('0x19')]);}_0x52b2f5[_0x347c('0x36')]=qs['sort'](_0x119d87[_0x347c('0x2d')][_0x347c('0x37')]);_0x52b2f5['where']=qs[_0x347c('0x2f')](_[_0x347c('0x38')](_0x119d87[_0x347c('0x2d')],_0xd90a4a[_0x347c('0x2f')]),_0x9e6f0b);if(_0x119d87[_0x347c('0x2d')][_0x347c('0x39')]){_0x52b2f5['where']=_['merge'](_0x52b2f5[_0x347c('0x3a')],{'$or':_[_0x347c('0x29')](_0x9e6f0b,function(_0x1e53dd){if(_0x1e53dd[_0x347c('0x3b')]!==_0x347c('0x3c')){var _0x169dff={};_0x169dff[_0x1e53dd[_0x347c('0x27')]]={'$like':'%'+_0x119d87[_0x347c('0x2d')][_0x347c('0x39')]+'%'};return _0x169dff;}})});}_0x52b2f5=_[_0x347c('0x3d')]({},_0x52b2f5,_0x119d87[_0x347c('0x3e')]);var _0x3d51ba={'where':_0x52b2f5['where']};return db[_0x347c('0x2a')][_0x347c('0x1c')](_0x3d51ba)[_0x347c('0x22')](function(_0x58a4c7){_0x42e2ba['count']=_0x58a4c7;if(_0x119d87[_0x347c('0x2d')][_0x347c('0x3f')]){_0x52b2f5['include']=[{'all':!![]}];}return db[_0x347c('0x2a')][_0x347c('0x40')](_0x52b2f5);})[_0x347c('0x22')](function(_0x387152){_0x42e2ba[_0x347c('0x41')]=_0x387152;return _0x42e2ba;})[_0x347c('0x22')](respondWithFilteredResult(_0x181094,_0x52b2f5))[_0x347c('0x42')](handleError(_0x181094,null));};exports[_0x347c('0x43')]=function(_0x1e157e,_0x5a8c11){var _0x2b8a42={'raw':![],'where':{'id':_0x1e157e[_0x347c('0x44')]['id']}},_0x4c122={};_0x4c122['model']=_[_0x347c('0x2e')](db[_0x347c('0x2a')][_0x347c('0x2b')]);_0x4c122[_0x347c('0x2d')]=_[_0x347c('0x2e')](_0x1e157e[_0x347c('0x2d')]);_0x4c122[_0x347c('0x2f')]=_['intersection'](_0x4c122[_0x347c('0x31')],_0x4c122[_0x347c('0x2d')]);_0x2b8a42['attributes']=_[_0x347c('0x30')](_0x4c122['model'],qs[_0x347c('0x33')](_0x1e157e['query'][_0x347c('0x33')]));_0x2b8a42['attributes']=_0x2b8a42[_0x347c('0x32')][_0x347c('0x34')]?_0x2b8a42[_0x347c('0x32')]:_0x4c122['model'];if(_0x1e157e['query']['includeAll']){_0x2b8a42[_0x347c('0x45')]=[{'all':!![]}];}_0x2b8a42=_[_0x347c('0x3d')]({},_0x2b8a42,_0x1e157e[_0x347c('0x3e')]);return db[_0x347c('0x2a')][_0x347c('0x46')](_0x2b8a42)[_0x347c('0x22')](handleEntityNotFound(_0x5a8c11,null))[_0x347c('0x22')](respondWithResult(_0x5a8c11,null))['catch'](handleError(_0x5a8c11,null));};exports[_0x347c('0x47')]=function(_0x87f952,_0x5bc4cb){return db[_0x347c('0x2a')]['create'](_0x87f952[_0x347c('0x48')],{})[_0x347c('0x22')](respondWithResult(_0x5bc4cb,0xc9))['catch'](handleError(_0x5bc4cb,null));};exports['update']=function(_0x378347,_0x261426){if(_0x378347[_0x347c('0x48')]['id']){delete _0x378347['body']['id'];}return db['FreshsalesAccount'][_0x347c('0x46')]({'where':{'id':_0x378347[_0x347c('0x44')]['id']}})[_0x347c('0x22')](handleEntityNotFound(_0x261426,null))[_0x347c('0x22')](saveUpdates(_0x378347[_0x347c('0x48')],null))[_0x347c('0x22')](respondWithResult(_0x261426,null))['catch'](handleError(_0x261426,null));};exports[_0x347c('0x23')]=function(_0x8d8523,_0x332196){return db['FreshsalesAccount'][_0x347c('0x46')]({'where':{'id':_0x8d8523['params']['id']}})[_0x347c('0x22')](handleEntityNotFound(_0x332196,null))[_0x347c('0x22')](removeEntity(_0x332196,null))[_0x347c('0x42')](handleError(_0x332196,null));};exports[_0x347c('0x49')]=function(_0x379a2a,_0x451793,_0x5b08eb){var _0x268ad7={};var _0x3ce8c0={};var _0x35c949;var _0x36c007;return db['FreshsalesAccount'][_0x347c('0x4a')]({'where':{'id':_0x379a2a[_0x347c('0x44')]['id']}})[_0x347c('0x22')](handleEntityNotFound(_0x451793,null))[_0x347c('0x22')](function(_0x25258c){if(_0x25258c){_0x35c949=_0x25258c;_0x3ce8c0['model']=_['keys'](db['FreshsalesConfiguration'][_0x347c('0x2b')]);_0x3ce8c0[_0x347c('0x2d')]=_['keys'](_0x379a2a['query']);_0x3ce8c0[_0x347c('0x2f')]=_[_0x347c('0x30')](_0x3ce8c0[_0x347c('0x31')],_0x3ce8c0[_0x347c('0x2d')]);_0x268ad7[_0x347c('0x32')]=_['intersection'](_0x3ce8c0[_0x347c('0x31')],qs[_0x347c('0x33')](_0x379a2a[_0x347c('0x2d')][_0x347c('0x33')]));_0x268ad7[_0x347c('0x32')]=_0x268ad7['attributes']['length']?_0x268ad7['attributes']:_0x3ce8c0[_0x347c('0x31')];_0x268ad7[_0x347c('0x36')]=qs['sort'](_0x379a2a[_0x347c('0x2d')][_0x347c('0x37')]);_0x268ad7[_0x347c('0x3a')]=qs['filters'](_[_0x347c('0x38')](_0x379a2a[_0x347c('0x2d')],_0x3ce8c0[_0x347c('0x2f')]));if(_0x379a2a['query'][_0x347c('0x39')]){_0x268ad7[_0x347c('0x3a')]=_[_0x347c('0x3d')](_0x268ad7[_0x347c('0x3a')],{'$or':_['map'](_0x268ad7[_0x347c('0x32')],function(_0x38ba19){var _0x4fece5={};_0x4fece5[_0x38ba19]={'$like':'%'+_0x379a2a['query'][_0x347c('0x39')]+'%'};return _0x4fece5;})});}_0x268ad7=_[_0x347c('0x3d')]({},_0x268ad7,_0x379a2a[_0x347c('0x3e')]);return _0x35c949[_0x347c('0x49')](_0x268ad7);}})[_0x347c('0x22')](function(_0x2fd468){if(_0x2fd468){_0x36c007=_0x2fd468[_0x347c('0x34')];if(!_0x379a2a['query'][_0x347c('0x4b')](_0x347c('0x35'))){_0x268ad7[_0x347c('0x1a')]=qs[_0x347c('0x1a')](_0x379a2a[_0x347c('0x2d')][_0x347c('0x1a')]);_0x268ad7[_0x347c('0x19')]=qs[_0x347c('0x19')](_0x379a2a[_0x347c('0x2d')][_0x347c('0x19')]);}return _0x35c949[_0x347c('0x49')](_0x268ad7);}})[_0x347c('0x22')](function(_0x1b68ff){if(_0x1b68ff){return _0x1b68ff?{'count':_0x36c007,'rows':_0x1b68ff}:null;}})[_0x347c('0x22')](respondWithResult(_0x451793,null))[_0x347c('0x42')](handleError(_0x451793,null));};exports[_0x347c('0x4c')]=function(_0x22e867,_0xba780e,_0x6950d0){if(_0x22e867['body']['id']){delete _0x22e867[_0x347c('0x48')]['id'];}return db['FreshsalesAccount'][_0x347c('0x4a')]({'where':{'id':_0x22e867[_0x347c('0x44')]['id']}})[_0x347c('0x22')](handleEntityNotFound(_0xba780e,null))[_0x347c('0x22')](function(_0x50d62a){if(_0x50d62a){_0x22e867[_0x347c('0x48')]['AccountId']=_0x50d62a['id'];_0x22e867[_0x347c('0x48')]['Subjects']=integrations['getSubjects'](_0x22e867[_0x347c('0x48')][_0x347c('0x4d')],_0x22e867[_0x347c('0x48')][_0x347c('0x3b')]);_0x22e867[_0x347c('0x48')][_0x347c('0x4e')]=integrations['getDescriptions'](_0x22e867['body'][_0x347c('0x4d')],_0x22e867[_0x347c('0x48')][_0x347c('0x3b')]);return db[_0x347c('0x4f')][_0x347c('0x47')](_0x22e867['body'],{'include':[{'model':db[_0x347c('0x50')],'as':_0x347c('0x51')},{'model':db[_0x347c('0x50')],'as':'Descriptions'}]});}return null;})[_0x347c('0x22')](respondWithResult(_0xba780e,null))[_0x347c('0x42')](handleError(_0xba780e,null));};exports[_0x347c('0x52')]=function(_0x854ec9,_0x33fc1d,_0x46e31f){var _0x9dd646='';var _0x452d58='';return db[_0x347c('0x2a')][_0x347c('0x4a')]({'where':{'id':_0x854ec9[_0x347c('0x44')]['id']},'attributes':['id',_0x347c('0x53'),'remoteUri',_0x347c('0x54')]})[_0x347c('0x22')](handleEntityNotFound(_0x33fc1d,null))[_0x347c('0x22')](function(_0x9faf51){if(_0x9faf51){_0x452d58=_0x9faf51['username'];_0x9dd646=_0x9faf51['remoteUri'];var _0x35d8e2=_0x9faf51[_0x347c('0x55')]['slice'](-0x1);if(_0x35d8e2==='/'){_0x9dd646=_0x9dd646[_0x347c('0x56')](0x0,_0x9dd646[_0x347c('0x57')](_0x35d8e2));}return rp({'method':'GET','uri':util['format']('%s%s',_0x9dd646,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x9faf51['apiKey']},'json':!![]});}})[_0x347c('0x22')](function(_0x5c72fe){if(_0x5c72fe){var _0x14a712=_0x5c72fe[_0x347c('0x58')];var _0x6a23c4=![];var _0x59c8b4=null;for(_0x59c8b4=0x0;_0x59c8b4<_0x14a712[_0x347c('0x34')];_0x59c8b4++){if(_0x14a712[_0x59c8b4][_0x347c('0x59')]===_0x452d58){_0x6a23c4=!![];}}if(_0x6a23c4){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x347c('0x5a')});}}})['then'](respondWithResult(_0x33fc1d,null))[_0x347c('0x42')](function(_0x21a1b2){var _0x4a5906=_0x854ec9['query'][_0x347c('0x5b')]?0x1f4:_0x21a1b2[_0x347c('0x5c')]||0x1f4;logger['error'](_0x347c('0x5d'),_0x347c('0x52'),_0x4a5906,JSON[_0x347c('0x5e')](_0x21a1b2));delete _0x21a1b2['name'];if(_0x4a5906===0x191){_0x4a5906=0x190;}_0x33fc1d[_0x347c('0x17')](_0x4a5906)[_0x347c('0x5f')](_0x854ec9['query'][_0x347c('0x5b')]?{'message':_0x347c('0x60'),'statusCode':_0x21a1b2[_0x347c('0x5c')]}:_0x21a1b2);});}; \ No newline at end of file +var _0xc8e6=['then','end','error','stack','name','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','FreshsalesAccount','includeAll','include','findAll','catch','show','params','options','find','create','body','findOne','FreshsalesConfiguration','fields','getConfigurations','Subjects','getSubjects','channel','FreshsalesField','Descriptions','getFields','apiKey','username','remoteUri','slice','substring','GET','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','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','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc8e6,0xa6));var _0x6c8e=function(_0x1745b1,_0x2e6a46){_0x1745b1=_0x1745b1-0x0;var _0x25bf24=_0xc8e6[_0x1745b1];return _0x25bf24;};'use strict';var emlformat=require(_0x6c8e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6c8e('0x1'));var rp=require(_0x6c8e('0x2'));var moment=require('moment');var BPromise=require(_0x6c8e('0x3'));var Mustache=require(_0x6c8e('0x4'));var util=require('util');var path=require(_0x6c8e('0x5'));var sox=require(_0x6c8e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c8e('0x7'));var _=require('lodash');var squel=require(_0x6c8e('0x8'));var crypto=require(_0x6c8e('0x9'));var jsforce=require(_0x6c8e('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6c8e('0xb'));var querystring=require(_0x6c8e('0xc'));var Papa=require(_0x6c8e('0xd'));var Redis=require(_0x6c8e('0xe'));var authService=require(_0x6c8e('0xf'));var qs=require(_0x6c8e('0x10'));var as=require(_0x6c8e('0x11'));var hardwareService=require(_0x6c8e('0x12'));var logger=require(_0x6c8e('0x13'))(_0x6c8e('0x14'));var utils=require(_0x6c8e('0x15'));var config=require(_0x6c8e('0x16'));var licenseUtil=require(_0x6c8e('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6c8e('0x18'));function respondWithStatusCode(_0x217b6a,_0x392dce){_0x392dce=_0x392dce||0xcc;return function(_0x48b989){if(_0x48b989){return _0x217b6a[_0x6c8e('0x19')](_0x392dce);}return _0x217b6a['status'](_0x392dce)['end']();};}function respondWithResult(_0x40259a,_0x143ec1){_0x143ec1=_0x143ec1||0xc8;return function(_0x30292f){if(_0x30292f){return _0x40259a[_0x6c8e('0x1a')](_0x143ec1)[_0x6c8e('0x1b')](_0x30292f);}};}function respondWithFilteredResult(_0x206781,_0x3698d5){return function(_0x591f05){if(_0x591f05){var _0x578179=typeof _0x3698d5[_0x6c8e('0x1c')]===_0x6c8e('0x1d')&&typeof _0x3698d5['limit']===_0x6c8e('0x1d');var _0x110122=_0x591f05[_0x6c8e('0x1e')];var _0x3e441b=_0x578179?0x0:_0x3698d5[_0x6c8e('0x1c')];var _0x20c854=_0x578179?_0x591f05[_0x6c8e('0x1e')]:_0x3698d5[_0x6c8e('0x1c')]+_0x3698d5[_0x6c8e('0x1f')];var _0xe085e0;if(_0x20c854>=_0x110122){_0x20c854=_0x110122;_0xe085e0=0xc8;}else{_0xe085e0=0xce;}_0x206781[_0x6c8e('0x1a')](_0xe085e0);return _0x206781['set'](_0x6c8e('0x20'),_0x3e441b+'-'+_0x20c854+'/'+_0x110122)[_0x6c8e('0x1b')](_0x591f05);}return null;};}function patchUpdates(_0x371d95){return function(_0x3f7782){try{jsonpatch[_0x6c8e('0x21')](_0x3f7782,_0x371d95,!![]);}catch(_0x19b8d6){return BPromise[_0x6c8e('0x22')](_0x19b8d6);}return _0x3f7782[_0x6c8e('0x23')]();};}function saveUpdates(_0xf91181,_0x1c89f3){return function(_0x130811){if(_0x130811){return _0x130811[_0x6c8e('0x24')](_0xf91181)['then'](function(_0x316d12){return _0x316d12;});}return null;};}function removeEntity(_0x3e23b4,_0x34fbe1){return function(_0x131b59){if(_0x131b59){return _0x131b59[_0x6c8e('0x25')]()[_0x6c8e('0x26')](function(){_0x3e23b4[_0x6c8e('0x1a')](0xcc)[_0x6c8e('0x27')]();});}};}function handleEntityNotFound(_0x3b7acf,_0x42b780){return function(_0x132719){if(!_0x132719){_0x3b7acf[_0x6c8e('0x19')](0x194);}return _0x132719;};}function handleError(_0x20ac1d,_0x49ff53){_0x49ff53=_0x49ff53||0x1f4;return function(_0x15ae8d){logger[_0x6c8e('0x28')](_0x15ae8d[_0x6c8e('0x29')]);if(_0x15ae8d[_0x6c8e('0x2a')]){delete _0x15ae8d[_0x6c8e('0x2a')];}_0x20ac1d[_0x6c8e('0x1a')](_0x49ff53)['send'](_0x15ae8d);};}exports[_0x6c8e('0x2b')]=function(_0x3c2e04,_0x18a7af){var _0x1af5b0={},_0x1c3acc={},_0x32c40d={'count':0x0,'rows':[]};var _0x1cf52d=_['map'](db['FreshsalesAccount'][_0x6c8e('0x2c')],function(_0x257bb2){return{'name':_0x257bb2['fieldName'],'type':_0x257bb2[_0x6c8e('0x2d')][_0x6c8e('0x2e')]};});_0x1c3acc[_0x6c8e('0x2f')]=_[_0x6c8e('0x30')](_0x1cf52d,'name');_0x1c3acc[_0x6c8e('0x31')]=_[_0x6c8e('0x32')](_0x3c2e04['query']);_0x1c3acc[_0x6c8e('0x33')]=_[_0x6c8e('0x34')](_0x1c3acc[_0x6c8e('0x2f')],_0x1c3acc[_0x6c8e('0x31')]);_0x1af5b0[_0x6c8e('0x35')]=_['intersection'](_0x1c3acc[_0x6c8e('0x2f')],qs['fields'](_0x3c2e04[_0x6c8e('0x31')]['fields']));_0x1af5b0[_0x6c8e('0x35')]=_0x1af5b0['attributes'][_0x6c8e('0x36')]?_0x1af5b0[_0x6c8e('0x35')]:_0x1c3acc[_0x6c8e('0x2f')];if(!_0x3c2e04['query']['hasOwnProperty'](_0x6c8e('0x37'))){_0x1af5b0[_0x6c8e('0x1f')]=qs['limit'](_0x3c2e04[_0x6c8e('0x31')]['limit']);_0x1af5b0[_0x6c8e('0x1c')]=qs[_0x6c8e('0x1c')](_0x3c2e04[_0x6c8e('0x31')]['offset']);}_0x1af5b0[_0x6c8e('0x38')]=qs[_0x6c8e('0x39')](_0x3c2e04[_0x6c8e('0x31')][_0x6c8e('0x39')]);_0x1af5b0[_0x6c8e('0x3a')]=qs[_0x6c8e('0x33')](_[_0x6c8e('0x3b')](_0x3c2e04[_0x6c8e('0x31')],_0x1c3acc['filters']),_0x1cf52d);if(_0x3c2e04[_0x6c8e('0x31')][_0x6c8e('0x3c')]){_0x1af5b0[_0x6c8e('0x3a')]=_['merge'](_0x1af5b0[_0x6c8e('0x3a')],{'$or':_[_0x6c8e('0x30')](_0x1cf52d,function(_0x9bc6bf){if(_0x9bc6bf[_0x6c8e('0x2d')]!==_0x6c8e('0x3d')){var _0x44851b={};_0x44851b[_0x9bc6bf[_0x6c8e('0x2a')]]={'$like':'%'+_0x3c2e04[_0x6c8e('0x31')][_0x6c8e('0x3c')]+'%'};return _0x44851b;}})});}_0x1af5b0=_[_0x6c8e('0x3e')]({},_0x1af5b0,_0x3c2e04['options']);var _0x34c7d0={'where':_0x1af5b0[_0x6c8e('0x3a')]};return db[_0x6c8e('0x3f')][_0x6c8e('0x1e')](_0x34c7d0)[_0x6c8e('0x26')](function(_0x504c24){_0x32c40d[_0x6c8e('0x1e')]=_0x504c24;if(_0x3c2e04[_0x6c8e('0x31')][_0x6c8e('0x40')]){_0x1af5b0[_0x6c8e('0x41')]=[{'all':!![]}];}return db[_0x6c8e('0x3f')][_0x6c8e('0x42')](_0x1af5b0);})['then'](function(_0x45013d){_0x32c40d['rows']=_0x45013d;return _0x32c40d;})[_0x6c8e('0x26')](respondWithFilteredResult(_0x18a7af,_0x1af5b0))[_0x6c8e('0x43')](handleError(_0x18a7af,null));};exports[_0x6c8e('0x44')]=function(_0x5dfe03,_0x1bfb1b){var _0x4c1f60={'raw':![],'where':{'id':_0x5dfe03[_0x6c8e('0x45')]['id']}},_0x1174fc={};_0x1174fc[_0x6c8e('0x2f')]=_[_0x6c8e('0x32')](db[_0x6c8e('0x3f')][_0x6c8e('0x2c')]);_0x1174fc[_0x6c8e('0x31')]=_[_0x6c8e('0x32')](_0x5dfe03['query']);_0x1174fc[_0x6c8e('0x33')]=_[_0x6c8e('0x34')](_0x1174fc[_0x6c8e('0x2f')],_0x1174fc[_0x6c8e('0x31')]);_0x4c1f60[_0x6c8e('0x35')]=_['intersection'](_0x1174fc[_0x6c8e('0x2f')],qs['fields'](_0x5dfe03[_0x6c8e('0x31')]['fields']));_0x4c1f60[_0x6c8e('0x35')]=_0x4c1f60[_0x6c8e('0x35')][_0x6c8e('0x36')]?_0x4c1f60[_0x6c8e('0x35')]:_0x1174fc[_0x6c8e('0x2f')];if(_0x5dfe03[_0x6c8e('0x31')][_0x6c8e('0x40')]){_0x4c1f60[_0x6c8e('0x41')]=[{'all':!![]}];}_0x4c1f60=_[_0x6c8e('0x3e')]({},_0x4c1f60,_0x5dfe03[_0x6c8e('0x46')]);return db[_0x6c8e('0x3f')][_0x6c8e('0x47')](_0x4c1f60)[_0x6c8e('0x26')](handleEntityNotFound(_0x1bfb1b,null))[_0x6c8e('0x26')](respondWithResult(_0x1bfb1b,null))[_0x6c8e('0x43')](handleError(_0x1bfb1b,null));};exports[_0x6c8e('0x48')]=function(_0xbd0eec,_0x4f79f3){return db[_0x6c8e('0x3f')]['create'](_0xbd0eec[_0x6c8e('0x49')],{})[_0x6c8e('0x26')](respondWithResult(_0x4f79f3,0xc9))['catch'](handleError(_0x4f79f3,null));};exports[_0x6c8e('0x24')]=function(_0x2c957f,_0x3b8ccd){if(_0x2c957f['body']['id']){delete _0x2c957f['body']['id'];}return db[_0x6c8e('0x3f')][_0x6c8e('0x47')]({'where':{'id':_0x2c957f[_0x6c8e('0x45')]['id']}})[_0x6c8e('0x26')](handleEntityNotFound(_0x3b8ccd,null))[_0x6c8e('0x26')](saveUpdates(_0x2c957f[_0x6c8e('0x49')],null))['then'](respondWithResult(_0x3b8ccd,null))['catch'](handleError(_0x3b8ccd,null));};exports['destroy']=function(_0x286788,_0x322e2e){return db[_0x6c8e('0x3f')][_0x6c8e('0x47')]({'where':{'id':_0x286788[_0x6c8e('0x45')]['id']}})[_0x6c8e('0x26')](handleEntityNotFound(_0x322e2e,null))[_0x6c8e('0x26')](removeEntity(_0x322e2e,null))['catch'](handleError(_0x322e2e,null));};exports['getConfigurations']=function(_0x3637d6,_0x2232e8,_0x287db1){var _0x4aa7f7={};var _0x6a858e={};var _0x4f768a;var _0x40bba6;return db[_0x6c8e('0x3f')][_0x6c8e('0x4a')]({'where':{'id':_0x3637d6[_0x6c8e('0x45')]['id']}})[_0x6c8e('0x26')](handleEntityNotFound(_0x2232e8,null))['then'](function(_0x416d02){if(_0x416d02){_0x4f768a=_0x416d02;_0x6a858e['model']=_['keys'](db[_0x6c8e('0x4b')][_0x6c8e('0x2c')]);_0x6a858e[_0x6c8e('0x31')]=_[_0x6c8e('0x32')](_0x3637d6[_0x6c8e('0x31')]);_0x6a858e['filters']=_['intersection'](_0x6a858e[_0x6c8e('0x2f')],_0x6a858e['query']);_0x4aa7f7[_0x6c8e('0x35')]=_[_0x6c8e('0x34')](_0x6a858e[_0x6c8e('0x2f')],qs[_0x6c8e('0x4c')](_0x3637d6[_0x6c8e('0x31')][_0x6c8e('0x4c')]));_0x4aa7f7[_0x6c8e('0x35')]=_0x4aa7f7[_0x6c8e('0x35')][_0x6c8e('0x36')]?_0x4aa7f7[_0x6c8e('0x35')]:_0x6a858e[_0x6c8e('0x2f')];_0x4aa7f7[_0x6c8e('0x38')]=qs[_0x6c8e('0x39')](_0x3637d6[_0x6c8e('0x31')][_0x6c8e('0x39')]);_0x4aa7f7['where']=qs['filters'](_['pick'](_0x3637d6[_0x6c8e('0x31')],_0x6a858e[_0x6c8e('0x33')]));if(_0x3637d6[_0x6c8e('0x31')][_0x6c8e('0x3c')]){_0x4aa7f7[_0x6c8e('0x3a')]=_[_0x6c8e('0x3e')](_0x4aa7f7[_0x6c8e('0x3a')],{'$or':_[_0x6c8e('0x30')](_0x4aa7f7['attributes'],function(_0x4f7719){var _0xa2eaef={};_0xa2eaef[_0x4f7719]={'$like':'%'+_0x3637d6[_0x6c8e('0x31')][_0x6c8e('0x3c')]+'%'};return _0xa2eaef;})});}_0x4aa7f7=_['merge']({},_0x4aa7f7,_0x3637d6[_0x6c8e('0x46')]);return _0x4f768a['getConfigurations'](_0x4aa7f7);}})[_0x6c8e('0x26')](function(_0x282403){if(_0x282403){_0x40bba6=_0x282403[_0x6c8e('0x36')];if(!_0x3637d6[_0x6c8e('0x31')]['hasOwnProperty']('nolimit')){_0x4aa7f7[_0x6c8e('0x1f')]=qs['limit'](_0x3637d6[_0x6c8e('0x31')][_0x6c8e('0x1f')]);_0x4aa7f7[_0x6c8e('0x1c')]=qs['offset'](_0x3637d6[_0x6c8e('0x31')][_0x6c8e('0x1c')]);}return _0x4f768a[_0x6c8e('0x4d')](_0x4aa7f7);}})[_0x6c8e('0x26')](function(_0x444372){if(_0x444372){return _0x444372?{'count':_0x40bba6,'rows':_0x444372}:null;}})[_0x6c8e('0x26')](respondWithResult(_0x2232e8,null))[_0x6c8e('0x43')](handleError(_0x2232e8,null));};exports['addConfiguration']=function(_0x36b042,_0x233c6d,_0x410513){if(_0x36b042[_0x6c8e('0x49')]['id']){delete _0x36b042[_0x6c8e('0x49')]['id'];}return db[_0x6c8e('0x3f')][_0x6c8e('0x4a')]({'where':{'id':_0x36b042[_0x6c8e('0x45')]['id']}})[_0x6c8e('0x26')](handleEntityNotFound(_0x233c6d,null))['then'](function(_0x37c55f){if(_0x37c55f){_0x36b042['body']['AccountId']=_0x37c55f['id'];_0x36b042[_0x6c8e('0x49')][_0x6c8e('0x4e')]=integrations[_0x6c8e('0x4f')](_0x36b042['body'][_0x6c8e('0x50')],_0x36b042[_0x6c8e('0x49')]['type']);_0x36b042[_0x6c8e('0x49')]['Descriptions']=integrations['getDescriptions'](_0x36b042['body'][_0x6c8e('0x50')],_0x36b042['body']['type']);return db[_0x6c8e('0x4b')][_0x6c8e('0x48')](_0x36b042[_0x6c8e('0x49')],{'include':[{'model':db[_0x6c8e('0x51')],'as':'Subjects'},{'model':db[_0x6c8e('0x51')],'as':_0x6c8e('0x52')}]});}return null;})[_0x6c8e('0x26')](respondWithResult(_0x233c6d,null))['catch'](handleError(_0x233c6d,null));};exports[_0x6c8e('0x53')]=function(_0x34955e,_0x3d0f19,_0x2d1ef2){var _0x2cad0e='';var _0x3c6e79='';return db[_0x6c8e('0x3f')][_0x6c8e('0x4a')]({'where':{'id':_0x34955e[_0x6c8e('0x45')]['id']},'attributes':['id','username','remoteUri',_0x6c8e('0x54')]})[_0x6c8e('0x26')](handleEntityNotFound(_0x3d0f19,null))[_0x6c8e('0x26')](function(_0xfe93c4){if(_0xfe93c4){_0x3c6e79=_0xfe93c4[_0x6c8e('0x55')];_0x2cad0e=_0xfe93c4[_0x6c8e('0x56')];var _0x20c75d=_0xfe93c4[_0x6c8e('0x56')][_0x6c8e('0x57')](-0x1);if(_0x20c75d==='/'){_0x2cad0e=_0x2cad0e[_0x6c8e('0x58')](0x0,_0x2cad0e['lastIndexOf'](_0x20c75d));}return rp({'method':_0x6c8e('0x59'),'uri':util['format'](_0x6c8e('0x5a'),_0x2cad0e,_0x6c8e('0x5b')),'headers':{'Authorization':_0x6c8e('0x5c')+_0xfe93c4[_0x6c8e('0x54')]},'json':!![]});}})[_0x6c8e('0x26')](function(_0x4bcb8a){if(_0x4bcb8a){var _0x59ae46=_0x4bcb8a[_0x6c8e('0x5d')];var _0x396edd=![];var _0x20a98a=null;for(_0x20a98a=0x0;_0x20a98a<_0x59ae46[_0x6c8e('0x36')];_0x20a98a++){if(_0x59ae46[_0x20a98a][_0x6c8e('0x5e')]===_0x3c6e79){_0x396edd=!![];}}if(_0x396edd){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x6c8e('0x5f')});}}})['then'](respondWithResult(_0x3d0f19,null))[_0x6c8e('0x43')](function(_0x2c4f28){var _0x1c22f4=_0x34955e[_0x6c8e('0x31')][_0x6c8e('0x60')]?0x1f4:_0x2c4f28['statusCode']||0x1f4;logger['error'](_0x6c8e('0x61'),_0x6c8e('0x53'),_0x1c22f4,JSON[_0x6c8e('0x62')](_0x2c4f28));delete _0x2c4f28[_0x6c8e('0x2a')];if(_0x1c22f4===0x191){_0x1c22f4=0x190;}_0x3d0f19[_0x6c8e('0x1a')](_0x1c22f4)[_0x6c8e('0x63')](_0x34955e[_0x6c8e('0x31')][_0x6c8e('0x60')]?{'message':_0x6c8e('0x64'),'statusCode':_0x2c4f28[_0x6c8e('0x65')]}:_0x2c4f28);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index fc9ff0e..962d616 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 _0xed1c=['path','rimraf','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','request-promise'];(function(_0x1cb30c,_0x1bd163){var _0x339065=function(_0x3804f3){while(--_0x3804f3){_0x1cb30c['push'](_0x1cb30c['shift']());}};_0x339065(++_0x1bd163);}(_0xed1c,0xe4));var _0xced1=function(_0x22b5e2,_0x2b567f){_0x22b5e2=_0x22b5e2-0x0;var _0x31d942=_0xed1c[_0x22b5e2];return _0x31d942;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xced1('0x2'));var fs=require('fs');var path=require(_0xced1('0x3'));var rimraf=require(_0xced1('0x4'));var config=require('../../config/environment');var attributes=require(_0xced1('0x5'));var integrations=require(_0xced1('0x6'));module[_0xced1('0x7')]=function(_0x37b22b,_0x59399e){return _0x37b22b[_0xced1('0x8')](_0xced1('0x9'),attributes,{'tableName':_0xced1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6b0=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2be50b,_0x466654){var _0x2884d5=function(_0xf7ebc0){while(--_0xf7ebc0){_0x2be50b['push'](_0x2be50b['shift']());}};_0x2884d5(++_0x466654);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x43b64b,_0xb9080f){_0x43b64b=_0x43b64b-0x0;var _0x48f864=_0xa6b0[_0x43b64b];return _0x48f864;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a6b('0x2'));var BPromise=require(_0x0a6b('0x3'));var rp=require(_0x0a6b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var attributes=require(_0x0a6b('0x7'));var integrations=require(_0x0a6b('0x8'));module[_0x0a6b('0x9')]=function(_0x3b6967,_0x1b5fb5){return _0x3b6967[_0x0a6b('0xa')](_0x0a6b('0xb'),attributes,{'tableName':_0x0a6b('0xc'),'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 cc52579..bc5224f 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 _0x5fdc=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesAccount,\x20%s,\x20%s','info','GetFreshsalesAccount','FreshsalesAccount','options','raw','attributes','include','map','model','ShowFreshsalesAccount','find','where','catch','lodash'];(function(_0x27f39d,_0x5efee5){var _0x355e1e=function(_0x55afce){while(--_0x55afce){_0x27f39d['push'](_0x27f39d['shift']());}};_0x355e1e(++_0x5efee5);}(_0x5fdc,0x127));var _0xc5fd=function(_0x4386e0,_0x15c5f1){_0x4386e0=_0x4386e0-0x0;var _0x40338b=_0x5fdc[_0x4386e0];return _0x40338b;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var moment=require(_0xc5fd('0x2'));var BPromise=require(_0xc5fd('0x3'));var rs=require(_0xc5fd('0x4'));var fs=require('fs');var Redis=require(_0xc5fd('0x5'));var db=require(_0xc5fd('0x6'))['db'];var utils=require(_0xc5fd('0x7'));var logger=require(_0xc5fd('0x8'))(_0xc5fd('0x9'));var config=require(_0xc5fd('0xa'));var jayson=require(_0xc5fd('0xb'));var client=jayson[_0xc5fd('0xc')][_0xc5fd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x15ffe7,_0x5a2eb4,_0x5d86e5){return new BPromise(function(_0x493389,_0x224801){return client[_0xc5fd('0xe')](_0x15ffe7,_0x5d86e5)[_0xc5fd('0xf')](function(_0x45c91f){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x5a2eb4,_0xc5fd('0x10'));logger[_0xc5fd('0x11')](_0xc5fd('0x12'),_0x5a2eb4,_0xc5fd('0x10'),JSON[_0xc5fd('0x13')](_0x45c91f));if(_0x45c91f[_0xc5fd('0x14')]){if(_0x45c91f['error'][_0xc5fd('0x15')]===0x1f4){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x224801(_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);}logger[_0xc5fd('0x14')](_0xc5fd('0x17'),_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x493389(_0x45c91f['error'][_0xc5fd('0x16')]);}else{logger[_0xc5fd('0x18')](_0xc5fd('0x17'),_0x5a2eb4,_0xc5fd('0x10'));_0x493389(_0x45c91f['result']['message']);}})['catch'](function(_0x5529b3){logger['error'](_0xc5fd('0x17'),_0x5a2eb4,_0x5529b3);_0x224801(_0x5529b3);});});}exports[_0xc5fd('0x19')]=function(_0x27f611){var _0xd0a9f1=this;return new Promise(function(_0x2ee392,_0x3f981f){return db[_0xc5fd('0x1a')]['findAll']({'raw':_0x27f611[_0xc5fd('0x1b')]?_0x27f611[_0xc5fd('0x1b')][_0xc5fd('0x1c')]===undefined?!![]:![]:!![],'where':_0x27f611[_0xc5fd('0x1b')]?_0x27f611[_0xc5fd('0x1b')]['where']||null:null,'attributes':_0x27f611[_0xc5fd('0x1b')]?_0x27f611[_0xc5fd('0x1b')][_0xc5fd('0x1d')]||null:null,'limit':_0x27f611[_0xc5fd('0x1b')]?_0x27f611['options']['limit']||null:null,'include':_0x27f611[_0xc5fd('0x1b')]?_0x27f611[_0xc5fd('0x1b')][_0xc5fd('0x1e')]?_[_0xc5fd('0x1f')](_0x27f611[_0xc5fd('0x1b')][_0xc5fd('0x1e')],function(_0x56d473){return{'model':db[_0x56d473[_0xc5fd('0x20')]],'as':_0x56d473['as'],'attributes':_0x56d473[_0xc5fd('0x1d')],'include':_0x56d473[_0xc5fd('0x1e')]?_[_0xc5fd('0x1f')](_0x56d473[_0xc5fd('0x1e')],function(_0x4020af){return{'model':db[_0x4020af[_0xc5fd('0x20')]],'as':_0x4020af['as'],'attributes':_0x4020af['attributes'],'include':_0x4020af[_0xc5fd('0x1e')]?_['map'](_0x4020af[_0xc5fd('0x1e')],function(_0x231368){return{'model':db[_0x231368[_0xc5fd('0x20')]],'as':_0x231368['as'],'attributes':_0x231368[_0xc5fd('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x176313){logger[_0xc5fd('0x18')](_0xc5fd('0x19'),_0x27f611);logger[_0xc5fd('0x11')](_0xc5fd('0x19'),_0x27f611,JSON[_0xc5fd('0x13')](_0x176313));_0x2ee392(_0x176313);})['catch'](function(_0x412ef7){logger['error']('GetFreshsalesAccount',_0x412ef7[_0xc5fd('0x16')],_0x27f611);_0x3f981f(_0xd0a9f1[_0xc5fd('0x14')](0x1f4,_0x412ef7[_0xc5fd('0x16')]));});});};exports[_0xc5fd('0x21')]=function(_0x7693c4){var _0x85fa81=this;return new Promise(function(_0x2a891d,_0x321eea){return db['FreshsalesAccount'][_0xc5fd('0x22')]({'raw':_0x7693c4[_0xc5fd('0x1b')]?_0x7693c4[_0xc5fd('0x1b')][_0xc5fd('0x1c')]===undefined?!![]:![]:!![],'where':_0x7693c4[_0xc5fd('0x1b')]?_0x7693c4[_0xc5fd('0x1b')][_0xc5fd('0x23')]||null:null,'attributes':_0x7693c4[_0xc5fd('0x1b')]?_0x7693c4[_0xc5fd('0x1b')][_0xc5fd('0x1d')]||null:null,'include':_0x7693c4[_0xc5fd('0x1b')]?_0x7693c4[_0xc5fd('0x1b')]['include']?_[_0xc5fd('0x1f')](_0x7693c4[_0xc5fd('0x1b')][_0xc5fd('0x1e')],function(_0x1fa329){return{'model':db[_0x1fa329[_0xc5fd('0x20')]],'as':_0x1fa329['as'],'attributes':_0x1fa329[_0xc5fd('0x1d')],'include':_0x1fa329[_0xc5fd('0x1e')]?_[_0xc5fd('0x1f')](_0x1fa329[_0xc5fd('0x1e')],function(_0x545bfc){return{'model':db[_0x545bfc[_0xc5fd('0x20')]],'as':_0x545bfc['as'],'attributes':_0x545bfc[_0xc5fd('0x1d')],'include':_0x545bfc[_0xc5fd('0x1e')]?_[_0xc5fd('0x1f')](_0x545bfc[_0xc5fd('0x1e')],function(_0x52267e){return{'model':db[_0x52267e[_0xc5fd('0x20')]],'as':_0x52267e['as'],'attributes':_0x52267e['attributes']};}):[]};}):[]};}):[]:[]})[_0xc5fd('0xf')](function(_0xac7c40){logger['info'](_0xc5fd('0x21'),_0x7693c4);logger['debug'](_0xc5fd('0x21'),_0x7693c4,JSON[_0xc5fd('0x13')](_0xac7c40));_0x2a891d(_0xac7c40);})[_0xc5fd('0x24')](function(_0x4cafb1){logger[_0xc5fd('0x14')](_0xc5fd('0x21'),_0x4cafb1['message'],_0x7693c4);_0x321eea(_0x85fa81[_0xc5fd('0x14')](0x1f4,_0x4cafb1[_0xc5fd('0x16')]));});});}; \ No newline at end of file +var _0x5c3c=['find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','limit','include','map','model','attributes','debug','catch','ShowFreshsalesAccount'];(function(_0xb179b5,_0x3601bf){var _0x4088a7=function(_0x41a21f){while(--_0x41a21f){_0xb179b5['push'](_0xb179b5['shift']());}};_0x4088a7(++_0x3601bf);}(_0x5c3c,0x132));var _0xc5c3=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x5c3c[_0x5d80de];return _0x1c7556;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a392b,_0x4b8404,_0x591f7d){return new BPromise(function(_0x723c31,_0x522be1){return client['request'](_0x5a392b,_0x591f7d)[_0xc5c3('0xd')](function(_0x46e2c1){logger['info'](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));logger['debug'](_0xc5c3('0x10'),_0x4b8404,_0xc5c3('0xf'),JSON[_0xc5c3('0x11')](_0x46e2c1));if(_0x46e2c1['error']){if(_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x13')]===0x1f4){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x522be1(_0x46e2c1['error'][_0xc5c3('0x14')]);}logger[_0xc5c3('0x12')](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x723c31(_0x46e2c1['error']['message']);}else{logger[_0xc5c3('0x15')](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));_0x723c31(_0x46e2c1[_0xc5c3('0x16')]['message']);}})['catch'](function(_0x467ba9){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x467ba9);_0x522be1(_0x467ba9);});});}exports[_0xc5c3('0x17')]=function(_0x2ff158){var _0x13c867=this;return new Promise(function(_0x28bae6,_0x5e11d5){return db[_0xc5c3('0x18')][_0xc5c3('0x19')]({'raw':_0x2ff158[_0xc5c3('0x1a')]?_0x2ff158[_0xc5c3('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2ff158[_0xc5c3('0x1a')]?_0x2ff158[_0xc5c3('0x1a')][_0xc5c3('0x1b')]||null:null,'attributes':_0x2ff158[_0xc5c3('0x1a')]?_0x2ff158[_0xc5c3('0x1a')]['attributes']||null:null,'limit':_0x2ff158[_0xc5c3('0x1a')]?_0x2ff158[_0xc5c3('0x1a')][_0xc5c3('0x1c')]||null:null,'include':_0x2ff158[_0xc5c3('0x1a')]?_0x2ff158[_0xc5c3('0x1a')][_0xc5c3('0x1d')]?_[_0xc5c3('0x1e')](_0x2ff158['options']['include'],function(_0x45affe){return{'model':db[_0x45affe[_0xc5c3('0x1f')]],'as':_0x45affe['as'],'attributes':_0x45affe['attributes'],'include':_0x45affe['include']?_[_0xc5c3('0x1e')](_0x45affe[_0xc5c3('0x1d')],function(_0x38a3df){return{'model':db[_0x38a3df['model']],'as':_0x38a3df['as'],'attributes':_0x38a3df['attributes'],'include':_0x38a3df[_0xc5c3('0x1d')]?_[_0xc5c3('0x1e')](_0x38a3df[_0xc5c3('0x1d')],function(_0x29791c){return{'model':db[_0x29791c['model']],'as':_0x29791c['as'],'attributes':_0x29791c[_0xc5c3('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2eacec){logger['info'](_0xc5c3('0x17'),_0x2ff158);logger[_0xc5c3('0x21')](_0xc5c3('0x17'),_0x2ff158,JSON[_0xc5c3('0x11')](_0x2eacec));_0x28bae6(_0x2eacec);})[_0xc5c3('0x22')](function(_0x2d07e1){logger[_0xc5c3('0x12')]('GetFreshsalesAccount',_0x2d07e1[_0xc5c3('0x14')],_0x2ff158);_0x5e11d5(_0x13c867['error'](0x1f4,_0x2d07e1[_0xc5c3('0x14')]));});});};exports[_0xc5c3('0x23')]=function(_0x5b26e9){var _0x4daa8b=this;return new Promise(function(_0x2e648f,_0x46f149){return db[_0xc5c3('0x18')][_0xc5c3('0x24')]({'raw':_0x5b26e9['options']?_0x5b26e9[_0xc5c3('0x1a')][_0xc5c3('0x25')]===undefined?!![]:![]:!![],'where':_0x5b26e9[_0xc5c3('0x1a')]?_0x5b26e9[_0xc5c3('0x1a')][_0xc5c3('0x1b')]||null:null,'attributes':_0x5b26e9[_0xc5c3('0x1a')]?_0x5b26e9[_0xc5c3('0x1a')][_0xc5c3('0x20')]||null:null,'include':_0x5b26e9[_0xc5c3('0x1a')]?_0x5b26e9['options'][_0xc5c3('0x1d')]?_[_0xc5c3('0x1e')](_0x5b26e9[_0xc5c3('0x1a')][_0xc5c3('0x1d')],function(_0x330391){return{'model':db[_0x330391[_0xc5c3('0x1f')]],'as':_0x330391['as'],'attributes':_0x330391[_0xc5c3('0x20')],'include':_0x330391['include']?_['map'](_0x330391[_0xc5c3('0x1d')],function(_0x55fccf){return{'model':db[_0x55fccf[_0xc5c3('0x1f')]],'as':_0x55fccf['as'],'attributes':_0x55fccf[_0xc5c3('0x20')],'include':_0x55fccf[_0xc5c3('0x1d')]?_[_0xc5c3('0x1e')](_0x55fccf[_0xc5c3('0x1d')],function(_0x498677){return{'model':db[_0x498677[_0xc5c3('0x1f')]],'as':_0x498677['as'],'attributes':_0x498677[_0xc5c3('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29f57d){logger[_0xc5c3('0x15')](_0xc5c3('0x23'),_0x5b26e9);logger[_0xc5c3('0x21')](_0xc5c3('0x23'),_0x5b26e9,JSON[_0xc5c3('0x11')](_0x29f57d));_0x2e648f(_0x29f57d);})[_0xc5c3('0x22')](function(_0x2ad440){logger[_0xc5c3('0x12')](_0xc5c3('0x23'),_0x2ad440['message'],_0x5b26e9);_0x46f149(_0x4daa8b[_0xc5c3('0x12')](0x1f4,_0x2ad440['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 117c6c2..fe169f0 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 _0x2775=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','/:id','isAuthenticated','show','get','/:id/subjects','/:id/descriptions','getDescriptions','getFields','post','create','put'];(function(_0xaec248,_0x48317a){var _0x50b7d2=function(_0x4bdeea){while(--_0x4bdeea){_0xaec248['push'](_0xaec248['shift']());}};_0x50b7d2(++_0x48317a);}(_0x2775,0xab));var _0x5277=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0x2775[_0x2a56ad];return _0x425175;};'use strict';var multer=require(_0x5277('0x0'));var util=require(_0x5277('0x1'));var path=require(_0x5277('0x2'));var timeout=require(_0x5277('0x3'));var express=require(_0x5277('0x4'));var router=express[_0x5277('0x5')]();var fs_extra=require(_0x5277('0x6'));var auth=require(_0x5277('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5277('0x8'));var controller=require(_0x5277('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x5277('0xa'),auth[_0x5277('0xb')](),controller[_0x5277('0xc')]);router[_0x5277('0xd')](_0x5277('0xe'),auth[_0x5277('0xb')](),controller['getSubjects']);router[_0x5277('0xd')](_0x5277('0xf'),auth[_0x5277('0xb')](),controller[_0x5277('0x10')]);router[_0x5277('0xd')]('/:id/fields',auth[_0x5277('0xb')](),controller[_0x5277('0x11')]);router[_0x5277('0x12')]('/',auth[_0x5277('0xb')](),controller[_0x5277('0x13')]);router[_0x5277('0x14')](_0x5277('0xa'),auth['isAuthenticated'](),controller[_0x5277('0x15')]);router['delete'](_0x5277('0xa'),auth[_0x5277('0xb')](),controller[_0x5277('0x16')]);module[_0x5277('0x17')]=router; \ No newline at end of file +var _0x05af=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','update','exports'];(function(_0x1ad2d5,_0x26ce2f){var _0x35153c=function(_0x369264){while(--_0x369264){_0x1ad2d5['push'](_0x1ad2d5['shift']());}};_0x35153c(++_0x26ce2f);}(_0x05af,0x1a2));var _0xf05a=function(_0x4bb2b9,_0x459c78){_0x4bb2b9=_0x4bb2b9-0x0;var _0x40e2a2=_0x05af[_0x4bb2b9];return _0x40e2a2;};'use strict';var multer=require('multer');var util=require(_0xf05a('0x0'));var path=require(_0xf05a('0x1'));var timeout=require(_0xf05a('0x2'));var express=require(_0xf05a('0x3'));var router=express[_0xf05a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf05a('0x5'));var interaction=require(_0xf05a('0x6'));var config=require('../../config/environment');var controller=require(_0xf05a('0x7'));router[_0xf05a('0x8')]('/',auth[_0xf05a('0x9')](),controller[_0xf05a('0xa')]);router[_0xf05a('0x8')](_0xf05a('0xb'),auth[_0xf05a('0x9')](),controller['show']);router[_0xf05a('0x8')](_0xf05a('0xc'),auth[_0xf05a('0x9')](),controller['getSubjects']);router['get'](_0xf05a('0xd'),auth[_0xf05a('0x9')](),controller[_0xf05a('0xe')]);router['get'](_0xf05a('0xf'),auth[_0xf05a('0x9')](),controller[_0xf05a('0x10')]);router[_0xf05a('0x11')]('/',auth[_0xf05a('0x9')](),controller[_0xf05a('0x12')]);router[_0xf05a('0x13')]('/:id',auth[_0xf05a('0x9')](),controller[_0xf05a('0x14')]);router['delete'](_0xf05a('0xb'),auth[_0xf05a('0x9')](),controller['destroy']);module[_0xf05a('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 910acd8..641c6fe 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 _0x2773=['sequelize','exports','STRING'];(function(_0x1c384f,_0x5c4bbe){var _0x4976f1=function(_0x319310){while(--_0x319310){_0x1c384f['push'](_0x1c384f['shift']());}};_0x4976f1(++_0x5c4bbe);}(_0x2773,0x171));var _0x3277=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x2773[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x3277('0x0'));module[_0x3277('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3277('0x2')]}}; \ No newline at end of file +var _0x8d14=['exports','STRING','sequelize'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x8d14,0x17c));var _0x48d1=function(_0x36d4b4,_0x26a350){_0x36d4b4=_0x36d4b4-0x0;var _0x32f134=_0x8d14[_0x36d4b4];return _0x32f134;};'use strict';var Sequelize=require(_0x48d1('0x0'));module[_0x48d1('0x1')]={'name':{'type':Sequelize[_0x48d1('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 59e4de0..5c2c2ec 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 _0xcdac=['nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','getSubjects','findOne','FreshsalesField','rawAttributes','sort','getDescriptions','getFields','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','FreshsalesConfiguration','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x16e0c8,_0x4861eb){var _0xe4b5af=function(_0x5248bc){while(--_0x5248bc){_0x16e0c8['push'](_0x16e0c8['shift']());}};_0xe4b5af(++_0x4861eb);}(_0xcdac,0x6c));var _0xccda=function(_0x34ce7f,_0x562d37){_0x34ce7f=_0x34ce7f-0x0;var _0x58c02e=_0xcdac[_0x34ce7f];return _0x58c02e;};'use strict';var emlformat=require(_0xccda('0x0'));var rimraf=require(_0xccda('0x1'));var zipdir=require(_0xccda('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xccda('0x3'));var moment=require('moment');var BPromise=require(_0xccda('0x4'));var Mustache=require(_0xccda('0x5'));var util=require(_0xccda('0x6'));var path=require(_0xccda('0x7'));var sox=require(_0xccda('0x8'));var csv=require(_0xccda('0x9'));var ejs=require(_0xccda('0xa'));var fs=require('fs');var fs_extra=require(_0xccda('0xb'));var _=require('lodash');var squel=require(_0xccda('0xc'));var crypto=require(_0xccda('0xd'));var jsforce=require(_0xccda('0xe'));var deskjs=require(_0xccda('0xf'));var toCsv=require(_0xccda('0x9'));var querystring=require(_0xccda('0x10'));var Papa=require(_0xccda('0x11'));var Redis=require('ioredis');var authService=require(_0xccda('0x12'));var qs=require(_0xccda('0x13'));var as=require(_0xccda('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xccda('0x15'));var utils=require(_0xccda('0x16'));var config=require(_0xccda('0x17'));var licenseUtil=require(_0xccda('0x18'));var db=require(_0xccda('0x19'))['db'];function respondWithStatusCode(_0x139bc8,_0x5bb35d){_0x5bb35d=_0x5bb35d||0xcc;return function(_0x42404d){if(_0x42404d){return _0x139bc8['sendStatus'](_0x5bb35d);}return _0x139bc8['status'](_0x5bb35d)[_0xccda('0x1a')]();};}function respondWithResult(_0x1b89a1,_0xa2b88b){_0xa2b88b=_0xa2b88b||0xc8;return function(_0x1e14ce){if(_0x1e14ce){return _0x1b89a1[_0xccda('0x1b')](_0xa2b88b)[_0xccda('0x1c')](_0x1e14ce);}};}function respondWithFilteredResult(_0x1e2162,_0x38db37){return function(_0xaef5a6){if(_0xaef5a6){var _0x4416d6=typeof _0x38db37[_0xccda('0x1d')]===_0xccda('0x1e')&&typeof _0x38db37[_0xccda('0x1f')]===_0xccda('0x1e');var _0x3959a2=_0xaef5a6[_0xccda('0x20')];var _0x21d98a=_0x4416d6?0x0:_0x38db37[_0xccda('0x1d')];var _0x4a1def=_0x4416d6?_0xaef5a6[_0xccda('0x20')]:_0x38db37[_0xccda('0x1d')]+_0x38db37['limit'];var _0x3b1b2e;if(_0x4a1def>=_0x3959a2){_0x4a1def=_0x3959a2;_0x3b1b2e=0xc8;}else{_0x3b1b2e=0xce;}_0x1e2162[_0xccda('0x1b')](_0x3b1b2e);return _0x1e2162['set'](_0xccda('0x21'),_0x21d98a+'-'+_0x4a1def+'/'+_0x3959a2)[_0xccda('0x1c')](_0xaef5a6);}return null;};}function patchUpdates(_0x32c003){return function(_0x464d82){try{jsonpatch[_0xccda('0x22')](_0x464d82,_0x32c003,!![]);}catch(_0x9cde84){return BPromise[_0xccda('0x23')](_0x9cde84);}return _0x464d82['save']();};}function saveUpdates(_0x3be681,_0x49c5b7){return function(_0x3d2400){if(_0x3d2400){return _0x3d2400[_0xccda('0x24')](_0x3be681)[_0xccda('0x25')](function(_0x1f0466){return _0x1f0466;});}return null;};}function removeEntity(_0x3606be,_0xd9b326){return function(_0x542360){if(_0x542360){return _0x542360[_0xccda('0x26')]()[_0xccda('0x25')](function(){_0x3606be['status'](0xcc)[_0xccda('0x1a')]();});}};}function handleEntityNotFound(_0x1442ed,_0x4cae3a){return function(_0x1285a3){if(!_0x1285a3){_0x1442ed[_0xccda('0x27')](0x194);}return _0x1285a3;};}function handleError(_0x9eab1a,_0x39e93a){_0x39e93a=_0x39e93a||0x1f4;return function(_0x90b9fd){logger[_0xccda('0x28')](_0x90b9fd[_0xccda('0x29')]);if(_0x90b9fd[_0xccda('0x2a')]){delete _0x90b9fd[_0xccda('0x2a')];}_0x9eab1a[_0xccda('0x1b')](_0x39e93a)['send'](_0x90b9fd);};}exports[_0xccda('0x2b')]=function(_0x3df554,_0x14e352){var _0x6b9362={},_0x334b50={},_0x7ce8a2={'count':0x0,'rows':[]};var _0x2f6853=_[_0xccda('0x2c')](db[_0xccda('0x2d')]['rawAttributes'],function(_0x5cbc4d){return{'name':_0x5cbc4d[_0xccda('0x2e')],'type':_0x5cbc4d['type'][_0xccda('0x2f')]};});_0x334b50[_0xccda('0x30')]=_[_0xccda('0x2c')](_0x2f6853,_0xccda('0x2a'));_0x334b50[_0xccda('0x31')]=_[_0xccda('0x32')](_0x3df554[_0xccda('0x31')]);_0x334b50['filters']=_[_0xccda('0x33')](_0x334b50[_0xccda('0x30')],_0x334b50[_0xccda('0x31')]);_0x6b9362[_0xccda('0x34')]=_[_0xccda('0x33')](_0x334b50['model'],qs[_0xccda('0x35')](_0x3df554['query'][_0xccda('0x35')]));_0x6b9362[_0xccda('0x34')]=_0x6b9362[_0xccda('0x34')][_0xccda('0x36')]?_0x6b9362[_0xccda('0x34')]:_0x334b50[_0xccda('0x30')];if(!_0x3df554[_0xccda('0x31')][_0xccda('0x37')](_0xccda('0x38'))){_0x6b9362[_0xccda('0x1f')]=qs['limit'](_0x3df554[_0xccda('0x31')]['limit']);_0x6b9362[_0xccda('0x1d')]=qs[_0xccda('0x1d')](_0x3df554['query'][_0xccda('0x1d')]);}_0x6b9362[_0xccda('0x39')]=qs['sort'](_0x3df554[_0xccda('0x31')]['sort']);_0x6b9362[_0xccda('0x3a')]=qs[_0xccda('0x3b')](_[_0xccda('0x3c')](_0x3df554[_0xccda('0x31')],_0x334b50[_0xccda('0x3b')]),_0x2f6853);if(_0x3df554[_0xccda('0x31')][_0xccda('0x3d')]){_0x6b9362[_0xccda('0x3a')]=_[_0xccda('0x3e')](_0x6b9362[_0xccda('0x3a')],{'$or':_[_0xccda('0x2c')](_0x2f6853,function(_0x5ce4dc){if(_0x5ce4dc['type']!==_0xccda('0x3f')){var _0x582186={};_0x582186[_0x5ce4dc[_0xccda('0x2a')]]={'$like':'%'+_0x3df554['query'][_0xccda('0x3d')]+'%'};return _0x582186;}})});}_0x6b9362=_[_0xccda('0x3e')]({},_0x6b9362,_0x3df554[_0xccda('0x40')]);var _0x159c6e={'where':_0x6b9362[_0xccda('0x3a')]};return db[_0xccda('0x2d')]['count'](_0x159c6e)[_0xccda('0x25')](function(_0x2bd76c){_0x7ce8a2[_0xccda('0x20')]=_0x2bd76c;if(_0x3df554['query'][_0xccda('0x41')]){_0x6b9362['include']=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0xccda('0x42')](_0x6b9362);})[_0xccda('0x25')](function(_0x1dec78){_0x7ce8a2[_0xccda('0x43')]=_0x1dec78;return _0x7ce8a2;})['then'](respondWithFilteredResult(_0x14e352,_0x6b9362))[_0xccda('0x44')](handleError(_0x14e352,null));};exports[_0xccda('0x45')]=function(_0x40cb91,_0x48df31){var _0x45b033={'raw':![],'where':{'id':_0x40cb91[_0xccda('0x46')]['id']}},_0x152f3f={};_0x152f3f[_0xccda('0x30')]=_['keys'](db[_0xccda('0x2d')]['rawAttributes']);_0x152f3f[_0xccda('0x31')]=_[_0xccda('0x32')](_0x40cb91[_0xccda('0x31')]);_0x152f3f[_0xccda('0x3b')]=_['intersection'](_0x152f3f[_0xccda('0x30')],_0x152f3f['query']);_0x45b033['attributes']=_['intersection'](_0x152f3f['model'],qs['fields'](_0x40cb91[_0xccda('0x31')][_0xccda('0x35')]));_0x45b033['attributes']=_0x45b033['attributes'][_0xccda('0x36')]?_0x45b033['attributes']:_0x152f3f['model'];if(_0x40cb91['query']['includeAll']){_0x45b033[_0xccda('0x47')]=[{'all':!![]}];}_0x45b033=_['merge']({},_0x45b033,_0x40cb91[_0xccda('0x40')]);return db[_0xccda('0x2d')]['find'](_0x45b033)[_0xccda('0x25')](handleEntityNotFound(_0x48df31,null))[_0xccda('0x25')](respondWithResult(_0x48df31,null))[_0xccda('0x44')](handleError(_0x48df31,null));};exports[_0xccda('0x48')]=function(_0x37efb0,_0x3c1578){return db[_0xccda('0x2d')][_0xccda('0x48')](_0x37efb0[_0xccda('0x49')],{})[_0xccda('0x25')](respondWithResult(_0x3c1578,0xc9))[_0xccda('0x44')](handleError(_0x3c1578,null));};exports[_0xccda('0x24')]=function(_0x151188,_0x373a50){if(_0x151188[_0xccda('0x49')]['id']){delete _0x151188[_0xccda('0x49')]['id'];}return db['FreshsalesConfiguration'][_0xccda('0x4a')]({'where':{'id':_0x151188[_0xccda('0x46')]['id']}})['then'](handleEntityNotFound(_0x373a50,null))['then'](saveUpdates(_0x151188[_0xccda('0x49')],null))[_0xccda('0x25')](respondWithResult(_0x373a50,null))[_0xccda('0x44')](handleError(_0x373a50,null));};exports['destroy']=function(_0x4cdd51,_0x200bbf){return db[_0xccda('0x2d')][_0xccda('0x4a')]({'where':{'id':_0x4cdd51['params']['id']}})[_0xccda('0x25')](handleEntityNotFound(_0x200bbf,null))[_0xccda('0x25')](removeEntity(_0x200bbf,null))[_0xccda('0x44')](handleError(_0x200bbf,null));};exports[_0xccda('0x4b')]=function(_0x479d19,_0x358040,_0x22fb02){var _0x535c56={};var _0x10453b={};var _0x5c488c;var _0x3da0b7;return db[_0xccda('0x2d')][_0xccda('0x4c')]({'where':{'id':_0x479d19['params']['id']}})[_0xccda('0x25')](handleEntityNotFound(_0x358040,null))[_0xccda('0x25')](function(_0x1101b8){if(_0x1101b8){_0x5c488c=_0x1101b8;_0x10453b[_0xccda('0x30')]=_[_0xccda('0x32')](db[_0xccda('0x4d')][_0xccda('0x4e')]);_0x10453b['query']=_[_0xccda('0x32')](_0x479d19[_0xccda('0x31')]);_0x10453b[_0xccda('0x3b')]=_[_0xccda('0x33')](_0x10453b[_0xccda('0x30')],_0x10453b[_0xccda('0x31')]);_0x535c56[_0xccda('0x34')]=_[_0xccda('0x33')](_0x10453b[_0xccda('0x30')],qs[_0xccda('0x35')](_0x479d19['query'][_0xccda('0x35')]));_0x535c56[_0xccda('0x34')]=_0x535c56[_0xccda('0x34')][_0xccda('0x36')]?_0x535c56[_0xccda('0x34')]:_0x10453b[_0xccda('0x30')];_0x535c56[_0xccda('0x39')]=qs[_0xccda('0x4f')](_0x479d19[_0xccda('0x31')][_0xccda('0x4f')]);_0x535c56[_0xccda('0x3a')]=qs['filters'](_[_0xccda('0x3c')](_0x479d19[_0xccda('0x31')],_0x10453b[_0xccda('0x3b')]));if(_0x479d19[_0xccda('0x31')]['filter']){_0x535c56[_0xccda('0x3a')]=_[_0xccda('0x3e')](_0x535c56[_0xccda('0x3a')],{'$or':_[_0xccda('0x2c')](_0x535c56[_0xccda('0x34')],function(_0x40fd81){var _0x5bb389={};_0x5bb389[_0x40fd81]={'$like':'%'+_0x479d19[_0xccda('0x31')]['filter']+'%'};return _0x5bb389;})});}_0x535c56=_[_0xccda('0x3e')]({},_0x535c56,_0x479d19[_0xccda('0x40')]);return _0x5c488c[_0xccda('0x4b')](_0x535c56);}})[_0xccda('0x25')](function(_0x223fae){if(_0x223fae){_0x3da0b7=_0x223fae['length'];if(!_0x479d19['query']['hasOwnProperty']('nolimit')){_0x535c56[_0xccda('0x1f')]=qs[_0xccda('0x1f')](_0x479d19['query'][_0xccda('0x1f')]);_0x535c56[_0xccda('0x1d')]=qs[_0xccda('0x1d')](_0x479d19[_0xccda('0x31')][_0xccda('0x1d')]);}return _0x5c488c[_0xccda('0x4b')](_0x535c56);}})[_0xccda('0x25')](function(_0x107a6e){if(_0x107a6e){return _0x107a6e?{'count':_0x3da0b7,'rows':_0x107a6e}:null;}})[_0xccda('0x25')](respondWithResult(_0x358040,null))['catch'](handleError(_0x358040,null));};exports['getDescriptions']=function(_0x10fcfa,_0x56bdf4,_0x1087b0){var _0x1fd569={};var _0x12ff35={};var _0x5549f3;var _0x40c54b;return db[_0xccda('0x2d')][_0xccda('0x4c')]({'where':{'id':_0x10fcfa[_0xccda('0x46')]['id']}})[_0xccda('0x25')](handleEntityNotFound(_0x56bdf4,null))[_0xccda('0x25')](function(_0x269862){if(_0x269862){_0x5549f3=_0x269862;_0x12ff35[_0xccda('0x30')]=_[_0xccda('0x32')](db[_0xccda('0x4d')][_0xccda('0x4e')]);_0x12ff35[_0xccda('0x31')]=_[_0xccda('0x32')](_0x10fcfa[_0xccda('0x31')]);_0x12ff35[_0xccda('0x3b')]=_[_0xccda('0x33')](_0x12ff35['model'],_0x12ff35[_0xccda('0x31')]);_0x1fd569[_0xccda('0x34')]=_[_0xccda('0x33')](_0x12ff35[_0xccda('0x30')],qs['fields'](_0x10fcfa[_0xccda('0x31')]['fields']));_0x1fd569[_0xccda('0x34')]=_0x1fd569[_0xccda('0x34')]['length']?_0x1fd569[_0xccda('0x34')]:_0x12ff35['model'];_0x1fd569[_0xccda('0x39')]=qs[_0xccda('0x4f')](_0x10fcfa['query']['sort']);_0x1fd569[_0xccda('0x3a')]=qs[_0xccda('0x3b')](_[_0xccda('0x3c')](_0x10fcfa[_0xccda('0x31')],_0x12ff35[_0xccda('0x3b')]));if(_0x10fcfa[_0xccda('0x31')]['filter']){_0x1fd569[_0xccda('0x3a')]=_[_0xccda('0x3e')](_0x1fd569[_0xccda('0x3a')],{'$or':_[_0xccda('0x2c')](_0x1fd569[_0xccda('0x34')],function(_0x4b0d87){var _0x9cba61={};_0x9cba61[_0x4b0d87]={'$like':'%'+_0x10fcfa['query'][_0xccda('0x3d')]+'%'};return _0x9cba61;})});}_0x1fd569=_['merge']({},_0x1fd569,_0x10fcfa[_0xccda('0x40')]);return _0x5549f3[_0xccda('0x50')](_0x1fd569);}})[_0xccda('0x25')](function(_0x210b30){if(_0x210b30){_0x40c54b=_0x210b30['length'];if(!_0x10fcfa[_0xccda('0x31')]['hasOwnProperty']('nolimit')){_0x1fd569[_0xccda('0x1f')]=qs[_0xccda('0x1f')](_0x10fcfa['query'][_0xccda('0x1f')]);_0x1fd569[_0xccda('0x1d')]=qs[_0xccda('0x1d')](_0x10fcfa[_0xccda('0x31')]['offset']);}return _0x5549f3['getDescriptions'](_0x1fd569);}})[_0xccda('0x25')](function(_0x5cbb7d){if(_0x5cbb7d){return _0x5cbb7d?{'count':_0x40c54b,'rows':_0x5cbb7d}:null;}})['then'](respondWithResult(_0x56bdf4,null))['catch'](handleError(_0x56bdf4,null));};exports[_0xccda('0x51')]=function(_0x120c21,_0x2d38df,_0x4bfa41){var _0x2b26f3={};var _0x3eb5f8={};var _0x38dd04;var _0x54f46a;return db[_0xccda('0x2d')][_0xccda('0x4c')]({'where':{'id':_0x120c21[_0xccda('0x46')]['id']}})[_0xccda('0x25')](handleEntityNotFound(_0x2d38df,null))[_0xccda('0x25')](function(_0x334e8e){if(_0x334e8e){_0x38dd04=_0x334e8e;_0x3eb5f8['model']=_['keys'](db['FreshsalesField'][_0xccda('0x4e')]);_0x3eb5f8[_0xccda('0x31')]=_[_0xccda('0x32')](_0x120c21[_0xccda('0x31')]);_0x3eb5f8[_0xccda('0x3b')]=_[_0xccda('0x33')](_0x3eb5f8[_0xccda('0x30')],_0x3eb5f8[_0xccda('0x31')]);_0x2b26f3[_0xccda('0x34')]=_[_0xccda('0x33')](_0x3eb5f8[_0xccda('0x30')],qs[_0xccda('0x35')](_0x120c21[_0xccda('0x31')][_0xccda('0x35')]));_0x2b26f3[_0xccda('0x34')]=_0x2b26f3[_0xccda('0x34')]['length']?_0x2b26f3['attributes']:_0x3eb5f8[_0xccda('0x30')];_0x2b26f3[_0xccda('0x39')]=qs[_0xccda('0x4f')](_0x120c21[_0xccda('0x31')][_0xccda('0x4f')]);_0x2b26f3[_0xccda('0x3a')]=qs[_0xccda('0x3b')](_['pick'](_0x120c21[_0xccda('0x31')],_0x3eb5f8[_0xccda('0x3b')]));if(_0x120c21['query'][_0xccda('0x3d')]){_0x2b26f3[_0xccda('0x3a')]=_['merge'](_0x2b26f3[_0xccda('0x3a')],{'$or':_['map'](_0x2b26f3[_0xccda('0x34')],function(_0x3f93c8){var _0x56a0d0={};_0x56a0d0[_0x3f93c8]={'$like':'%'+_0x120c21[_0xccda('0x31')][_0xccda('0x3d')]+'%'};return _0x56a0d0;})});}_0x2b26f3=_[_0xccda('0x3e')]({},_0x2b26f3,_0x120c21[_0xccda('0x40')]);return _0x38dd04[_0xccda('0x51')](_0x2b26f3);}})[_0xccda('0x25')](function(_0x24a329){if(_0x24a329){_0x54f46a=_0x24a329[_0xccda('0x36')];if(!_0x120c21[_0xccda('0x31')][_0xccda('0x37')](_0xccda('0x38'))){_0x2b26f3[_0xccda('0x1f')]=qs['limit'](_0x120c21[_0xccda('0x31')][_0xccda('0x1f')]);_0x2b26f3[_0xccda('0x1d')]=qs['offset'](_0x120c21['query'][_0xccda('0x1d')]);}return _0x38dd04['getFields'](_0x2b26f3);}})['then'](function(_0x1ef5f0){if(_0x1ef5f0){return _0x1ef5f0?{'count':_0x54f46a,'rows':_0x1ef5f0}:null;}})[_0xccda('0x25')](respondWithResult(_0x2d38df,null))[_0xccda('0x44')](handleError(_0x2d38df,null));}; \ No newline at end of file +var _0xbee2=['keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','FreshsalesConfiguration','includeAll','findAll','rows','catch','show','params','include','find','create','body','getSubjects','findOne','FreshsalesField','rawAttributes','length','getDescriptions','getFields','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../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','error','name','send','map','fieldName','type','model','query'];(function(_0x5d7b92,_0x5b040c){var _0x4d6d29=function(_0x1fae07){while(--_0x1fae07){_0x5d7b92['push'](_0x5d7b92['shift']());}};_0x4d6d29(++_0x5b040c);}(_0xbee2,0x1ef));var _0x2bee=function(_0x42e4d7,_0x4bd202){_0x42e4d7=_0x42e4d7-0x0;var _0x346cd8=_0xbee2[_0x42e4d7];return _0x346cd8;};'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(_0x2bee('0x0'));var moment=require(_0x2bee('0x1'));var BPromise=require(_0x2bee('0x2'));var Mustache=require(_0x2bee('0x3'));var util=require(_0x2bee('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x2bee('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2bee('0x6'));var squel=require(_0x2bee('0x7'));var crypto=require(_0x2bee('0x8'));var jsforce=require(_0x2bee('0x9'));var deskjs=require(_0x2bee('0xa'));var toCsv=require(_0x2bee('0x5'));var querystring=require(_0x2bee('0xb'));var Papa=require(_0x2bee('0xc'));var Redis=require(_0x2bee('0xd'));var authService=require(_0x2bee('0xe'));var qs=require(_0x2bee('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2bee('0x10'));var logger=require(_0x2bee('0x11'))('api');var utils=require(_0x2bee('0x12'));var config=require(_0x2bee('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2bee('0x14'))['db'];function respondWithStatusCode(_0x1cfbb8,_0xad3435){_0xad3435=_0xad3435||0xcc;return function(_0x4e0a47){if(_0x4e0a47){return _0x1cfbb8[_0x2bee('0x15')](_0xad3435);}return _0x1cfbb8['status'](_0xad3435)[_0x2bee('0x16')]();};}function respondWithResult(_0x12584e,_0x1922b0){_0x1922b0=_0x1922b0||0xc8;return function(_0x57ed43){if(_0x57ed43){return _0x12584e[_0x2bee('0x17')](_0x1922b0)[_0x2bee('0x18')](_0x57ed43);}};}function respondWithFilteredResult(_0x4db27d,_0x371ac6){return function(_0xca7b0a){if(_0xca7b0a){var _0x259151=typeof _0x371ac6[_0x2bee('0x19')]===_0x2bee('0x1a')&&typeof _0x371ac6[_0x2bee('0x1b')]===_0x2bee('0x1a');var _0x24c2a7=_0xca7b0a[_0x2bee('0x1c')];var _0x27ba9a=_0x259151?0x0:_0x371ac6[_0x2bee('0x19')];var _0x1ca11d=_0x259151?_0xca7b0a[_0x2bee('0x1c')]:_0x371ac6[_0x2bee('0x19')]+_0x371ac6[_0x2bee('0x1b')];var _0xbdf3fc;if(_0x1ca11d>=_0x24c2a7){_0x1ca11d=_0x24c2a7;_0xbdf3fc=0xc8;}else{_0xbdf3fc=0xce;}_0x4db27d['status'](_0xbdf3fc);return _0x4db27d[_0x2bee('0x1d')](_0x2bee('0x1e'),_0x27ba9a+'-'+_0x1ca11d+'/'+_0x24c2a7)[_0x2bee('0x18')](_0xca7b0a);}return null;};}function patchUpdates(_0x57cd2c){return function(_0x33915a){try{jsonpatch['apply'](_0x33915a,_0x57cd2c,!![]);}catch(_0x11b053){return BPromise[_0x2bee('0x1f')](_0x11b053);}return _0x33915a[_0x2bee('0x20')]();};}function saveUpdates(_0x54255,_0xb72599){return function(_0x5bbf34){if(_0x5bbf34){return _0x5bbf34[_0x2bee('0x21')](_0x54255)[_0x2bee('0x22')](function(_0x8d73e4){return _0x8d73e4;});}return null;};}function removeEntity(_0x4f00d5,_0x4d32fe){return function(_0x5bf677){if(_0x5bf677){return _0x5bf677[_0x2bee('0x23')]()[_0x2bee('0x22')](function(){_0x4f00d5[_0x2bee('0x17')](0xcc)[_0x2bee('0x16')]();});}};}function handleEntityNotFound(_0x33357d,_0xbff29){return function(_0x18d397){if(!_0x18d397){_0x33357d[_0x2bee('0x15')](0x194);}return _0x18d397;};}function handleError(_0x2eb177,_0x5226bd){_0x5226bd=_0x5226bd||0x1f4;return function(_0x13fec6){logger[_0x2bee('0x24')](_0x13fec6['stack']);if(_0x13fec6[_0x2bee('0x25')]){delete _0x13fec6[_0x2bee('0x25')];}_0x2eb177['status'](_0x5226bd)[_0x2bee('0x26')](_0x13fec6);};}exports['index']=function(_0x346bfc,_0x59149a){var _0x5a24a6={},_0x46ff15={},_0x3ac144={'count':0x0,'rows':[]};var _0x1d2536=_[_0x2bee('0x27')](db['FreshsalesConfiguration']['rawAttributes'],function(_0x5760ef){return{'name':_0x5760ef[_0x2bee('0x28')],'type':_0x5760ef[_0x2bee('0x29')]['key']};});_0x46ff15[_0x2bee('0x2a')]=_[_0x2bee('0x27')](_0x1d2536,_0x2bee('0x25'));_0x46ff15[_0x2bee('0x2b')]=_[_0x2bee('0x2c')](_0x346bfc[_0x2bee('0x2b')]);_0x46ff15['filters']=_['intersection'](_0x46ff15[_0x2bee('0x2a')],_0x46ff15['query']);_0x5a24a6[_0x2bee('0x2d')]=_[_0x2bee('0x2e')](_0x46ff15[_0x2bee('0x2a')],qs[_0x2bee('0x2f')](_0x346bfc['query'][_0x2bee('0x2f')]));_0x5a24a6[_0x2bee('0x2d')]=_0x5a24a6['attributes']['length']?_0x5a24a6['attributes']:_0x46ff15[_0x2bee('0x2a')];if(!_0x346bfc[_0x2bee('0x2b')][_0x2bee('0x30')](_0x2bee('0x31'))){_0x5a24a6[_0x2bee('0x1b')]=qs['limit'](_0x346bfc[_0x2bee('0x2b')][_0x2bee('0x1b')]);_0x5a24a6[_0x2bee('0x19')]=qs[_0x2bee('0x19')](_0x346bfc['query'][_0x2bee('0x19')]);}_0x5a24a6[_0x2bee('0x32')]=qs['sort'](_0x346bfc['query'][_0x2bee('0x33')]);_0x5a24a6[_0x2bee('0x34')]=qs[_0x2bee('0x35')](_[_0x2bee('0x36')](_0x346bfc[_0x2bee('0x2b')],_0x46ff15['filters']),_0x1d2536);if(_0x346bfc[_0x2bee('0x2b')][_0x2bee('0x37')]){_0x5a24a6[_0x2bee('0x34')]=_[_0x2bee('0x38')](_0x5a24a6['where'],{'$or':_[_0x2bee('0x27')](_0x1d2536,function(_0x4fd6d5){if(_0x4fd6d5[_0x2bee('0x29')]!==_0x2bee('0x39')){var _0x12918e={};_0x12918e[_0x4fd6d5['name']]={'$like':'%'+_0x346bfc[_0x2bee('0x2b')][_0x2bee('0x37')]+'%'};return _0x12918e;}})});}_0x5a24a6=_[_0x2bee('0x38')]({},_0x5a24a6,_0x346bfc[_0x2bee('0x3a')]);var _0x164d35={'where':_0x5a24a6[_0x2bee('0x34')]};return db[_0x2bee('0x3b')]['count'](_0x164d35)[_0x2bee('0x22')](function(_0x54a35a){_0x3ac144[_0x2bee('0x1c')]=_0x54a35a;if(_0x346bfc[_0x2bee('0x2b')][_0x2bee('0x3c')]){_0x5a24a6['include']=[{'all':!![]}];}return db[_0x2bee('0x3b')][_0x2bee('0x3d')](_0x5a24a6);})['then'](function(_0x137ef1){_0x3ac144[_0x2bee('0x3e')]=_0x137ef1;return _0x3ac144;})['then'](respondWithFilteredResult(_0x59149a,_0x5a24a6))[_0x2bee('0x3f')](handleError(_0x59149a,null));};exports[_0x2bee('0x40')]=function(_0x598ce9,_0x2eb1a8){var _0x280fcb={'raw':![],'where':{'id':_0x598ce9[_0x2bee('0x41')]['id']}},_0x26ec8c={};_0x26ec8c[_0x2bee('0x2a')]=_[_0x2bee('0x2c')](db[_0x2bee('0x3b')]['rawAttributes']);_0x26ec8c['query']=_['keys'](_0x598ce9[_0x2bee('0x2b')]);_0x26ec8c[_0x2bee('0x35')]=_['intersection'](_0x26ec8c[_0x2bee('0x2a')],_0x26ec8c[_0x2bee('0x2b')]);_0x280fcb['attributes']=_[_0x2bee('0x2e')](_0x26ec8c['model'],qs[_0x2bee('0x2f')](_0x598ce9[_0x2bee('0x2b')][_0x2bee('0x2f')]));_0x280fcb[_0x2bee('0x2d')]=_0x280fcb[_0x2bee('0x2d')]['length']?_0x280fcb['attributes']:_0x26ec8c[_0x2bee('0x2a')];if(_0x598ce9[_0x2bee('0x2b')]['includeAll']){_0x280fcb[_0x2bee('0x42')]=[{'all':!![]}];}_0x280fcb=_[_0x2bee('0x38')]({},_0x280fcb,_0x598ce9[_0x2bee('0x3a')]);return db[_0x2bee('0x3b')][_0x2bee('0x43')](_0x280fcb)[_0x2bee('0x22')](handleEntityNotFound(_0x2eb1a8,null))[_0x2bee('0x22')](respondWithResult(_0x2eb1a8,null))['catch'](handleError(_0x2eb1a8,null));};exports[_0x2bee('0x44')]=function(_0x3aaa3a,_0x3173fa){return db[_0x2bee('0x3b')][_0x2bee('0x44')](_0x3aaa3a[_0x2bee('0x45')],{})['then'](respondWithResult(_0x3173fa,0xc9))['catch'](handleError(_0x3173fa,null));};exports[_0x2bee('0x21')]=function(_0x3e5543,_0xed9c2){if(_0x3e5543[_0x2bee('0x45')]['id']){delete _0x3e5543[_0x2bee('0x45')]['id'];}return db[_0x2bee('0x3b')][_0x2bee('0x43')]({'where':{'id':_0x3e5543[_0x2bee('0x41')]['id']}})['then'](handleEntityNotFound(_0xed9c2,null))['then'](saveUpdates(_0x3e5543[_0x2bee('0x45')],null))[_0x2bee('0x22')](respondWithResult(_0xed9c2,null))[_0x2bee('0x3f')](handleError(_0xed9c2,null));};exports[_0x2bee('0x23')]=function(_0x4983e1,_0xa66feb){return db[_0x2bee('0x3b')]['find']({'where':{'id':_0x4983e1[_0x2bee('0x41')]['id']}})[_0x2bee('0x22')](handleEntityNotFound(_0xa66feb,null))['then'](removeEntity(_0xa66feb,null))[_0x2bee('0x3f')](handleError(_0xa66feb,null));};exports[_0x2bee('0x46')]=function(_0x377980,_0x3be2f9,_0x6ace50){var _0x5ee2fe={};var _0x43d2a3={};var _0x16ddfd;var _0xa8bc0e;return db[_0x2bee('0x3b')][_0x2bee('0x47')]({'where':{'id':_0x377980[_0x2bee('0x41')]['id']}})[_0x2bee('0x22')](handleEntityNotFound(_0x3be2f9,null))[_0x2bee('0x22')](function(_0x54d564){if(_0x54d564){_0x16ddfd=_0x54d564;_0x43d2a3['model']=_[_0x2bee('0x2c')](db[_0x2bee('0x48')][_0x2bee('0x49')]);_0x43d2a3[_0x2bee('0x2b')]=_[_0x2bee('0x2c')](_0x377980[_0x2bee('0x2b')]);_0x43d2a3[_0x2bee('0x35')]=_[_0x2bee('0x2e')](_0x43d2a3[_0x2bee('0x2a')],_0x43d2a3[_0x2bee('0x2b')]);_0x5ee2fe['attributes']=_[_0x2bee('0x2e')](_0x43d2a3['model'],qs[_0x2bee('0x2f')](_0x377980[_0x2bee('0x2b')][_0x2bee('0x2f')]));_0x5ee2fe['attributes']=_0x5ee2fe[_0x2bee('0x2d')][_0x2bee('0x4a')]?_0x5ee2fe[_0x2bee('0x2d')]:_0x43d2a3[_0x2bee('0x2a')];_0x5ee2fe[_0x2bee('0x32')]=qs[_0x2bee('0x33')](_0x377980['query'][_0x2bee('0x33')]);_0x5ee2fe[_0x2bee('0x34')]=qs[_0x2bee('0x35')](_['pick'](_0x377980['query'],_0x43d2a3['filters']));if(_0x377980[_0x2bee('0x2b')][_0x2bee('0x37')]){_0x5ee2fe[_0x2bee('0x34')]=_[_0x2bee('0x38')](_0x5ee2fe[_0x2bee('0x34')],{'$or':_[_0x2bee('0x27')](_0x5ee2fe[_0x2bee('0x2d')],function(_0x1346d5){var _0x12d8a2={};_0x12d8a2[_0x1346d5]={'$like':'%'+_0x377980[_0x2bee('0x2b')]['filter']+'%'};return _0x12d8a2;})});}_0x5ee2fe=_[_0x2bee('0x38')]({},_0x5ee2fe,_0x377980[_0x2bee('0x3a')]);return _0x16ddfd['getSubjects'](_0x5ee2fe);}})[_0x2bee('0x22')](function(_0x12f5cb){if(_0x12f5cb){_0xa8bc0e=_0x12f5cb['length'];if(!_0x377980[_0x2bee('0x2b')][_0x2bee('0x30')](_0x2bee('0x31'))){_0x5ee2fe[_0x2bee('0x1b')]=qs['limit'](_0x377980[_0x2bee('0x2b')][_0x2bee('0x1b')]);_0x5ee2fe[_0x2bee('0x19')]=qs[_0x2bee('0x19')](_0x377980['query'][_0x2bee('0x19')]);}return _0x16ddfd[_0x2bee('0x46')](_0x5ee2fe);}})[_0x2bee('0x22')](function(_0x38f79e){if(_0x38f79e){return _0x38f79e?{'count':_0xa8bc0e,'rows':_0x38f79e}:null;}})[_0x2bee('0x22')](respondWithResult(_0x3be2f9,null))[_0x2bee('0x3f')](handleError(_0x3be2f9,null));};exports[_0x2bee('0x4b')]=function(_0x380728,_0x14308f,_0x5be0e7){var _0x241c5d={};var _0xd836a3={};var _0x33367f;var _0x1c0032;return db[_0x2bee('0x3b')][_0x2bee('0x47')]({'where':{'id':_0x380728[_0x2bee('0x41')]['id']}})[_0x2bee('0x22')](handleEntityNotFound(_0x14308f,null))[_0x2bee('0x22')](function(_0x483013){if(_0x483013){_0x33367f=_0x483013;_0xd836a3[_0x2bee('0x2a')]=_['keys'](db[_0x2bee('0x48')][_0x2bee('0x49')]);_0xd836a3[_0x2bee('0x2b')]=_[_0x2bee('0x2c')](_0x380728[_0x2bee('0x2b')]);_0xd836a3[_0x2bee('0x35')]=_[_0x2bee('0x2e')](_0xd836a3[_0x2bee('0x2a')],_0xd836a3[_0x2bee('0x2b')]);_0x241c5d[_0x2bee('0x2d')]=_[_0x2bee('0x2e')](_0xd836a3[_0x2bee('0x2a')],qs['fields'](_0x380728[_0x2bee('0x2b')][_0x2bee('0x2f')]));_0x241c5d[_0x2bee('0x2d')]=_0x241c5d[_0x2bee('0x2d')][_0x2bee('0x4a')]?_0x241c5d[_0x2bee('0x2d')]:_0xd836a3[_0x2bee('0x2a')];_0x241c5d[_0x2bee('0x32')]=qs[_0x2bee('0x33')](_0x380728[_0x2bee('0x2b')][_0x2bee('0x33')]);_0x241c5d[_0x2bee('0x34')]=qs['filters'](_['pick'](_0x380728[_0x2bee('0x2b')],_0xd836a3[_0x2bee('0x35')]));if(_0x380728['query'][_0x2bee('0x37')]){_0x241c5d[_0x2bee('0x34')]=_[_0x2bee('0x38')](_0x241c5d[_0x2bee('0x34')],{'$or':_[_0x2bee('0x27')](_0x241c5d[_0x2bee('0x2d')],function(_0x209e69){var _0x4ff02f={};_0x4ff02f[_0x209e69]={'$like':'%'+_0x380728[_0x2bee('0x2b')]['filter']+'%'};return _0x4ff02f;})});}_0x241c5d=_[_0x2bee('0x38')]({},_0x241c5d,_0x380728[_0x2bee('0x3a')]);return _0x33367f['getDescriptions'](_0x241c5d);}})[_0x2bee('0x22')](function(_0x227ecb){if(_0x227ecb){_0x1c0032=_0x227ecb[_0x2bee('0x4a')];if(!_0x380728[_0x2bee('0x2b')][_0x2bee('0x30')](_0x2bee('0x31'))){_0x241c5d[_0x2bee('0x1b')]=qs['limit'](_0x380728[_0x2bee('0x2b')][_0x2bee('0x1b')]);_0x241c5d[_0x2bee('0x19')]=qs['offset'](_0x380728['query'][_0x2bee('0x19')]);}return _0x33367f[_0x2bee('0x4b')](_0x241c5d);}})[_0x2bee('0x22')](function(_0x32d125){if(_0x32d125){return _0x32d125?{'count':_0x1c0032,'rows':_0x32d125}:null;}})[_0x2bee('0x22')](respondWithResult(_0x14308f,null))[_0x2bee('0x3f')](handleError(_0x14308f,null));};exports[_0x2bee('0x4c')]=function(_0x4d3a3,_0x14f15b,_0x4bf9c5){var _0x3aa72a={};var _0x2dc211={};var _0x36323a;var _0x8c786b;return db['FreshsalesConfiguration'][_0x2bee('0x47')]({'where':{'id':_0x4d3a3['params']['id']}})[_0x2bee('0x22')](handleEntityNotFound(_0x14f15b,null))['then'](function(_0x3a425f){if(_0x3a425f){_0x36323a=_0x3a425f;_0x2dc211[_0x2bee('0x2a')]=_[_0x2bee('0x2c')](db[_0x2bee('0x48')][_0x2bee('0x49')]);_0x2dc211[_0x2bee('0x2b')]=_['keys'](_0x4d3a3['query']);_0x2dc211[_0x2bee('0x35')]=_[_0x2bee('0x2e')](_0x2dc211[_0x2bee('0x2a')],_0x2dc211[_0x2bee('0x2b')]);_0x3aa72a[_0x2bee('0x2d')]=_[_0x2bee('0x2e')](_0x2dc211['model'],qs[_0x2bee('0x2f')](_0x4d3a3[_0x2bee('0x2b')][_0x2bee('0x2f')]));_0x3aa72a[_0x2bee('0x2d')]=_0x3aa72a['attributes'][_0x2bee('0x4a')]?_0x3aa72a[_0x2bee('0x2d')]:_0x2dc211['model'];_0x3aa72a[_0x2bee('0x32')]=qs[_0x2bee('0x33')](_0x4d3a3[_0x2bee('0x2b')][_0x2bee('0x33')]);_0x3aa72a[_0x2bee('0x34')]=qs[_0x2bee('0x35')](_[_0x2bee('0x36')](_0x4d3a3[_0x2bee('0x2b')],_0x2dc211[_0x2bee('0x35')]));if(_0x4d3a3[_0x2bee('0x2b')][_0x2bee('0x37')]){_0x3aa72a['where']=_[_0x2bee('0x38')](_0x3aa72a['where'],{'$or':_[_0x2bee('0x27')](_0x3aa72a[_0x2bee('0x2d')],function(_0x2ac59a){var _0x24ff28={};_0x24ff28[_0x2ac59a]={'$like':'%'+_0x4d3a3[_0x2bee('0x2b')][_0x2bee('0x37')]+'%'};return _0x24ff28;})});}_0x3aa72a=_[_0x2bee('0x38')]({},_0x3aa72a,_0x4d3a3['options']);return _0x36323a[_0x2bee('0x4c')](_0x3aa72a);}})[_0x2bee('0x22')](function(_0x377175){if(_0x377175){_0x8c786b=_0x377175[_0x2bee('0x4a')];if(!_0x4d3a3[_0x2bee('0x2b')][_0x2bee('0x30')](_0x2bee('0x31'))){_0x3aa72a[_0x2bee('0x1b')]=qs[_0x2bee('0x1b')](_0x4d3a3[_0x2bee('0x2b')][_0x2bee('0x1b')]);_0x3aa72a['offset']=qs[_0x2bee('0x19')](_0x4d3a3[_0x2bee('0x2b')]['offset']);}return _0x36323a[_0x2bee('0x4c')](_0x3aa72a);}})[_0x2bee('0x22')](function(_0x5da3b7){if(_0x5da3b7){return _0x5da3b7?{'count':_0x8c786b,'rows':_0x5da3b7}:null;}})[_0x2bee('0x22')](respondWithResult(_0x14f15b,null))['catch'](handleError(_0x14f15b,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 2d1979c..0d15d3f 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 _0xea1c=['./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','lodash','util','api','moment','request-promise','rimraf'];(function(_0x1a3d7c,_0x4741e2){var _0x146026=function(_0x3c07cb){while(--_0x3c07cb){_0x1a3d7c['push'](_0x1a3d7c['shift']());}};_0x146026(++_0x4741e2);}(_0xea1c,0x150));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcea1('0x0'));var util=require(_0xcea1('0x1'));var logger=require('../../config/logger')(_0xcea1('0x2'));var moment=require(_0xcea1('0x3'));var BPromise=require('bluebird');var rp=require(_0xcea1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcea1('0x5'));var config=require('../../config/environment');var attributes=require(_0xcea1('0x6'));module[_0xcea1('0x7')]=function(_0x43a197,_0x52cebc){return _0x43a197['define'](_0xcea1('0x8'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b34=['request-promise','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','api','moment'];(function(_0x1e2aae,_0x2349e3){var _0x4d8a43=function(_0x305d4c){while(--_0x305d4c){_0x1e2aae['push'](_0x1e2aae['shift']());}};_0x4d8a43(++_0x2349e3);}(_0x4b34,0x13b));var _0x44b3=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x4b34[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0x44b3('0x0'));var util=require(_0x44b3('0x1'));var logger=require('../../config/logger')(_0x44b3('0x2'));var moment=require(_0x44b3('0x3'));var BPromise=require('bluebird');var rp=require(_0x44b3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44b3('0x5'));var config=require(_0x44b3('0x6'));var attributes=require(_0x44b3('0x7'));module['exports']=function(_0x28ffcb,_0x17568f){return _0x28ffcb[_0x44b3('0x8')](_0x44b3('0x9'),attributes,{'tableName':_0x44b3('0xa'),'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 7e355e3..8962f03 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 _0x3afd=['../../config/environment','jayson/promise','client','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x3b5c60,_0x36555d){var _0x5cf06e=function(_0x40a550){while(--_0x40a550){_0x3b5c60['push'](_0x3b5c60['shift']());}};_0x5cf06e(++_0x36555d);}(_0x3afd,0x19c));var _0xd3af=function(_0x587dd0,_0x273922){_0x587dd0=_0x587dd0-0x0;var _0x56f153=_0x3afd[_0x587dd0];return _0x56f153;};'use strict';var _=require(_0xd3af('0x0'));var util=require(_0xd3af('0x1'));var moment=require(_0xd3af('0x2'));var BPromise=require(_0xd3af('0x3'));var rs=require(_0xd3af('0x4'));var fs=require('fs');var Redis=require(_0xd3af('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd3af('0x6'))(_0xd3af('0x7'));var config=require(_0xd3af('0x8'));var jayson=require(_0xd3af('0x9'));var client=jayson[_0xd3af('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58e45d,_0x3dc259,_0x2fb1d5){return new BPromise(function(_0x500ba5,_0x3da5ed){return client[_0xd3af('0xb')](_0x58e45d,_0x2fb1d5)[_0xd3af('0xc')](function(_0x450775){logger[_0xd3af('0xd')](_0xd3af('0xe'),_0x3dc259,_0xd3af('0xf'));logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x3dc259,'request\x20sent',JSON[_0xd3af('0x10')](_0x450775));if(_0x450775['error']){if(_0x450775[_0xd3af('0x11')]['code']===0x1f4){logger[_0xd3af('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3dc259,_0x450775['error'][_0xd3af('0x12')]);return _0x3da5ed(_0x450775[_0xd3af('0x11')][_0xd3af('0x12')]);}logger[_0xd3af('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3dc259,_0x450775['error'][_0xd3af('0x12')]);return _0x500ba5(_0x450775[_0xd3af('0x11')][_0xd3af('0x12')]);}else{logger[_0xd3af('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3dc259,_0xd3af('0xf'));_0x500ba5(_0x450775['result']['message']);}})[_0xd3af('0x13')](function(_0x1ca5f5){logger[_0xd3af('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3dc259,_0x1ca5f5);_0x3da5ed(_0x1ca5f5);});});} \ No newline at end of file +var _0xad61=['FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then'];(function(_0xbdcb5e,_0x289b93){var _0x1edfd4=function(_0x133001){while(--_0x133001){_0xbdcb5e['push'](_0xbdcb5e['shift']());}};_0x1edfd4(++_0x289b93);}(_0xad61,0xce));var _0x1ad6=function(_0x54d30f,_0x50f4de){_0x54d30f=_0x54d30f-0x0;var _0x461289=_0xad61[_0x54d30f];return _0x461289;};'use strict';var _=require(_0x1ad6('0x0'));var util=require(_0x1ad6('0x1'));var moment=require(_0x1ad6('0x2'));var BPromise=require(_0x1ad6('0x3'));var rs=require(_0x1ad6('0x4'));var fs=require('fs');var Redis=require(_0x1ad6('0x5'));var db=require(_0x1ad6('0x6'))['db'];var utils=require(_0x1ad6('0x7'));var logger=require(_0x1ad6('0x8'))(_0x1ad6('0x9'));var config=require(_0x1ad6('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1ad6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x333fd7,_0x722907,_0x24cf8a){return new BPromise(function(_0x283290,_0x2aa44f){return client[_0x1ad6('0xc')](_0x333fd7,_0x24cf8a)[_0x1ad6('0xd')](function(_0x596ae5){logger['info'](_0x1ad6('0xe'),_0x722907,_0x1ad6('0xf'));logger[_0x1ad6('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x722907,'request\x20sent',JSON[_0x1ad6('0x11')](_0x596ae5));if(_0x596ae5[_0x1ad6('0x12')]){if(_0x596ae5[_0x1ad6('0x12')]['code']===0x1f4){logger['error'](_0x1ad6('0xe'),_0x722907,_0x596ae5[_0x1ad6('0x12')][_0x1ad6('0x13')]);return _0x2aa44f(_0x596ae5[_0x1ad6('0x12')]['message']);}logger[_0x1ad6('0x12')](_0x1ad6('0xe'),_0x722907,_0x596ae5[_0x1ad6('0x12')][_0x1ad6('0x13')]);return _0x283290(_0x596ae5[_0x1ad6('0x12')]['message']);}else{logger['info'](_0x1ad6('0xe'),_0x722907,_0x1ad6('0xf'));_0x283290(_0x596ae5[_0x1ad6('0x14')][_0x1ad6('0x13')]);}})[_0x1ad6('0x15')](function(_0x281d3f){logger[_0x1ad6('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x722907,_0x281d3f);_0x2aa44f(_0x281d3f);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 6709c75..8dd28a7 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 _0x33a4=['delete','util','connect-timeout','express','Router','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','update'];(function(_0x38fbc2,_0x641aa1){var _0x43c7d4=function(_0x45d3b9){while(--_0x45d3b9){_0x38fbc2['push'](_0x38fbc2['shift']());}};_0x43c7d4(++_0x641aa1);}(_0x33a4,0x88));var _0x433a=function(_0x283719,_0x47b8cb){_0x283719=_0x283719-0x0;var _0x3558d2=_0x33a4[_0x283719];return _0x3558d2;};'use strict';var multer=require('multer');var util=require(_0x433a('0x0'));var path=require('path');var timeout=require(_0x433a('0x1'));var express=require(_0x433a('0x2'));var router=express[_0x433a('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x433a('0x4'));var controller=require(_0x433a('0x5'));router[_0x433a('0x6')]('/',auth[_0x433a('0x7')](),controller[_0x433a('0x8')]);router['get'](_0x433a('0x9'),auth['isAuthenticated'](),controller[_0x433a('0xa')]);router[_0x433a('0xb')]('/',auth[_0x433a('0x7')](),controller[_0x433a('0xc')]);router['put']('/:id',auth[_0x433a('0x7')](),controller[_0x433a('0xd')]);router[_0x433a('0xe')](_0x433a('0x9'),auth[_0x433a('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x6737=['delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','post','create','put','update'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x6737,0xe2));var _0x7673=function(_0x5f15b3,_0x18df4c){_0x5f15b3=_0x5f15b3-0x0;var _0x516bc2=_0x6737[_0x5f15b3];return _0x516bc2;};'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')]('/',auth['isAuthenticated'](),controller[_0x7673('0xb')]);router[_0x7673('0xc')]('/:id',auth[_0x7673('0x8')](),controller[_0x7673('0xd')]);router[_0x7673('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x7673('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 91687d6..a59fa24 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 _0xcf7a=['customVariable','sequelize','exports','ENUM','variable','keyValue','string','STRING'];(function(_0x50ef7a,_0x3db97f){var _0x1ffba2=function(_0x235eb0){while(--_0x235eb0){_0x50ef7a['push'](_0x50ef7a['shift']());}};_0x1ffba2(++_0x3db97f);}(_0xcf7a,0x91));var _0xacf7=function(_0x581d11,_0x30fce6){_0x581d11=_0x581d11-0x0;var _0x4074b7=_0xcf7a[_0x581d11];return _0x4074b7;};'use strict';var Sequelize=require(_0xacf7('0x0'));module[_0xacf7('0x1')]={'type':{'type':Sequelize[_0xacf7('0x2')]('string',_0xacf7('0x3'),'customVariable',_0xacf7('0x4'),'picklist'),'defaultValue':_0xacf7('0x5')},'content':{'type':Sequelize[_0xacf7('0x6')]},'key':{'type':Sequelize[_0xacf7('0x6')]},'keyType':{'type':Sequelize[_0xacf7('0x2')](_0xacf7('0x5'),_0xacf7('0x3'),_0xacf7('0x7'))},'keyContent':{'type':Sequelize[_0xacf7('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xacf7('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xacf7('0x6')]}}; \ No newline at end of file +var _0xd817=['STRING','variable','exports','ENUM','string','customVariable','keyValue'];(function(_0x374ccf,_0xa945c4){var _0x443cde=function(_0x27ff10){while(--_0x27ff10){_0x374ccf['push'](_0x374ccf['shift']());}};_0x443cde(++_0xa945c4);}(_0xd817,0x14b));var _0x7d81=function(_0x2d6197,_0x82ebfb){_0x2d6197=_0x2d6197-0x0;var _0x4d0e75=_0xd817[_0x2d6197];return _0x4d0e75;};'use strict';var Sequelize=require('sequelize');module[_0x7d81('0x0')]={'type':{'type':Sequelize[_0x7d81('0x1')](_0x7d81('0x2'),'variable',_0x7d81('0x3'),_0x7d81('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x7d81('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7d81('0x1')](_0x7d81('0x2'),_0x7d81('0x6'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7d81('0x5')]},'nameField':{'type':Sequelize[_0x7d81('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'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 89c1370..bce6f80 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 _0x724b=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','query','keys','filters','model','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','FreshsalesField','rows','then','catch','show','fields','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','jsforce','to-csv'];(function(_0x2f4ad7,_0x3c86a7){var _0x239fbb=function(_0x2cca5e){while(--_0x2cca5e){_0x2f4ad7['push'](_0x2f4ad7['shift']());}};_0x239fbb(++_0x3c86a7);}(_0x724b,0x7f));var _0xb724=function(_0x3f94f6,_0x470973){_0x3f94f6=_0x3f94f6-0x0;var _0x1c85c8=_0x724b[_0x3f94f6];return _0x1c85c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb724('0x0'));var zipdir=require(_0xb724('0x1'));var jsonpatch=require(_0xb724('0x2'));var rp=require(_0xb724('0x3'));var moment=require(_0xb724('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb724('0x5'));var util=require(_0xb724('0x6'));var path=require('path');var sox=require(_0xb724('0x7'));var csv=require('to-csv');var ejs=require(_0xb724('0x8'));var fs=require('fs');var fs_extra=require(_0xb724('0x9'));var _=require(_0xb724('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb724('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb724('0xc'));var querystring=require('querystring');var Papa=require(_0xb724('0xd'));var Redis=require(_0xb724('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb724('0xf'));var as=require(_0xb724('0x10'));var hardwareService=require(_0xb724('0x11'));var logger=require(_0xb724('0x12'))('api');var utils=require(_0xb724('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb724('0x14'))['db'];function respondWithStatusCode(_0x7be2ee,_0x579223){_0x579223=_0x579223||0xcc;return function(_0x82c74c){if(_0x82c74c){return _0x7be2ee[_0xb724('0x15')](_0x579223);}return _0x7be2ee[_0xb724('0x16')](_0x579223)[_0xb724('0x17')]();};}function respondWithResult(_0x176995,_0x54b929){_0x54b929=_0x54b929||0xc8;return function(_0x4d3bba){if(_0x4d3bba){return _0x176995[_0xb724('0x16')](_0x54b929)['json'](_0x4d3bba);}};}function respondWithFilteredResult(_0x5bb632,_0x4d1505){return function(_0x1f5614){if(_0x1f5614){var _0x276039=typeof _0x4d1505[_0xb724('0x18')]===_0xb724('0x19')&&typeof _0x4d1505[_0xb724('0x1a')]==='undefined';var _0x3e3d0c=_0x1f5614[_0xb724('0x1b')];var _0x1588e9=_0x276039?0x0:_0x4d1505['offset'];var _0x318758=_0x276039?_0x1f5614[_0xb724('0x1b')]:_0x4d1505[_0xb724('0x18')]+_0x4d1505[_0xb724('0x1a')];var _0x19d02d;if(_0x318758>=_0x3e3d0c){_0x318758=_0x3e3d0c;_0x19d02d=0xc8;}else{_0x19d02d=0xce;}_0x5bb632[_0xb724('0x16')](_0x19d02d);return _0x5bb632['set']('Content-Range',_0x1588e9+'-'+_0x318758+'/'+_0x3e3d0c)[_0xb724('0x1c')](_0x1f5614);}return null;};}function patchUpdates(_0x1347a4){return function(_0x4ede85){try{jsonpatch[_0xb724('0x1d')](_0x4ede85,_0x1347a4,!![]);}catch(_0x57650e){return BPromise[_0xb724('0x1e')](_0x57650e);}return _0x4ede85[_0xb724('0x1f')]();};}function saveUpdates(_0xcb7f16,_0x1c81d5){return function(_0x2b0952){if(_0x2b0952){return _0x2b0952[_0xb724('0x20')](_0xcb7f16)['then'](function(_0x2ed041){return _0x2ed041;});}return null;};}function removeEntity(_0x2e0c74,_0x586724){return function(_0x1af3ba){if(_0x1af3ba){return _0x1af3ba[_0xb724('0x21')]()['then'](function(){_0x2e0c74['status'](0xcc)[_0xb724('0x17')]();});}};}function handleEntityNotFound(_0x8aac69,_0x8f97a5){return function(_0x3c7819){if(!_0x3c7819){_0x8aac69[_0xb724('0x15')](0x194);}return _0x3c7819;};}function handleError(_0x184c14,_0x17fb1c){_0x17fb1c=_0x17fb1c||0x1f4;return function(_0x268aed){logger[_0xb724('0x22')](_0x268aed[_0xb724('0x23')]);if(_0x268aed[_0xb724('0x24')]){delete _0x268aed['name'];}_0x184c14['status'](_0x17fb1c)[_0xb724('0x25')](_0x268aed);};}exports['index']=function(_0x17f513,_0x4a772b){var _0x215af9={},_0x1f9197={},_0xdebfdd={'count':0x0,'rows':[]};var _0x2d8eb0=_[_0xb724('0x26')](db['FreshsalesField'][_0xb724('0x27')],function(_0x573637){return{'name':_0x573637[_0xb724('0x28')],'type':_0x573637[_0xb724('0x29')]['key']};});_0x1f9197['model']=_['map'](_0x2d8eb0,_0xb724('0x24'));_0x1f9197[_0xb724('0x2a')]=_[_0xb724('0x2b')](_0x17f513[_0xb724('0x2a')]);_0x1f9197[_0xb724('0x2c')]=_['intersection'](_0x1f9197[_0xb724('0x2d')],_0x1f9197['query']);_0x215af9['attributes']=_[_0xb724('0x2e')](_0x1f9197[_0xb724('0x2d')],qs['fields'](_0x17f513[_0xb724('0x2a')]['fields']));_0x215af9[_0xb724('0x2f')]=_0x215af9[_0xb724('0x2f')][_0xb724('0x30')]?_0x215af9[_0xb724('0x2f')]:_0x1f9197[_0xb724('0x2d')];if(!_0x17f513[_0xb724('0x2a')]['hasOwnProperty'](_0xb724('0x31'))){_0x215af9[_0xb724('0x1a')]=qs['limit'](_0x17f513[_0xb724('0x2a')]['limit']);_0x215af9[_0xb724('0x18')]=qs['offset'](_0x17f513[_0xb724('0x2a')]['offset']);}_0x215af9[_0xb724('0x32')]=qs[_0xb724('0x33')](_0x17f513[_0xb724('0x2a')]['sort']);_0x215af9[_0xb724('0x34')]=qs[_0xb724('0x2c')](_[_0xb724('0x35')](_0x17f513['query'],_0x1f9197['filters']),_0x2d8eb0);if(_0x17f513[_0xb724('0x2a')][_0xb724('0x36')]){_0x215af9[_0xb724('0x34')]=_[_0xb724('0x37')](_0x215af9[_0xb724('0x34')],{'$or':_[_0xb724('0x26')](_0x2d8eb0,function(_0x54d00c){if(_0x54d00c[_0xb724('0x29')]!==_0xb724('0x38')){var _0x369812={};_0x369812[_0x54d00c[_0xb724('0x24')]]={'$like':'%'+_0x17f513[_0xb724('0x2a')]['filter']+'%'};return _0x369812;}})});}_0x215af9=_['merge']({},_0x215af9,_0x17f513[_0xb724('0x39')]);var _0xfcd0ff={'where':_0x215af9[_0xb724('0x34')]};return db['FreshsalesField'][_0xb724('0x1b')](_0xfcd0ff)['then'](function(_0x11395e){_0xdebfdd['count']=_0x11395e;if(_0x17f513['query'][_0xb724('0x3a')]){_0x215af9[_0xb724('0x3b')]=[{'all':!![]}];}return db[_0xb724('0x3c')]['findAll'](_0x215af9);})['then'](function(_0x17faf1){_0xdebfdd[_0xb724('0x3d')]=_0x17faf1;return _0xdebfdd;})[_0xb724('0x3e')](respondWithFilteredResult(_0x4a772b,_0x215af9))[_0xb724('0x3f')](handleError(_0x4a772b,null));};exports[_0xb724('0x40')]=function(_0x57eef8,_0x5444d6){var _0x4c9d75={'raw':!![],'where':{'id':_0x57eef8['params']['id']}},_0x4475e1={};_0x4475e1[_0xb724('0x2d')]=_[_0xb724('0x2b')](db[_0xb724('0x3c')][_0xb724('0x27')]);_0x4475e1['query']=_[_0xb724('0x2b')](_0x57eef8[_0xb724('0x2a')]);_0x4475e1['filters']=_[_0xb724('0x2e')](_0x4475e1['model'],_0x4475e1[_0xb724('0x2a')]);_0x4c9d75[_0xb724('0x2f')]=_['intersection'](_0x4475e1[_0xb724('0x2d')],qs['fields'](_0x57eef8[_0xb724('0x2a')][_0xb724('0x41')]));_0x4c9d75['attributes']=_0x4c9d75[_0xb724('0x2f')][_0xb724('0x30')]?_0x4c9d75['attributes']:_0x4475e1[_0xb724('0x2d')];if(_0x57eef8['query'][_0xb724('0x3a')]){_0x4c9d75[_0xb724('0x3b')]=[{'all':!![]}];}_0x4c9d75=_[_0xb724('0x37')]({},_0x4c9d75,_0x57eef8[_0xb724('0x39')]);return db[_0xb724('0x3c')][_0xb724('0x42')](_0x4c9d75)[_0xb724('0x3e')](handleEntityNotFound(_0x5444d6,null))[_0xb724('0x3e')](respondWithResult(_0x5444d6,null))[_0xb724('0x3f')](handleError(_0x5444d6,null));};exports[_0xb724('0x43')]=function(_0x21ce9b,_0x150f7f){return db[_0xb724('0x3c')][_0xb724('0x43')](_0x21ce9b[_0xb724('0x44')],{})[_0xb724('0x3e')](respondWithResult(_0x150f7f,0xc9))[_0xb724('0x3f')](handleError(_0x150f7f,null));};exports[_0xb724('0x20')]=function(_0x191b0a,_0x2d46b9){if(_0x191b0a[_0xb724('0x44')]['id']){delete _0x191b0a[_0xb724('0x44')]['id'];}return db[_0xb724('0x3c')][_0xb724('0x42')]({'where':{'id':_0x191b0a[_0xb724('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d46b9,null))[_0xb724('0x3e')](saveUpdates(_0x191b0a['body'],null))['then'](respondWithResult(_0x2d46b9,null))[_0xb724('0x3f')](handleError(_0x2d46b9,null));};exports[_0xb724('0x21')]=function(_0x566fa1,_0x1ce079){return db[_0xb724('0x3c')][_0xb724('0x42')]({'where':{'id':_0x566fa1[_0xb724('0x45')]['id']}})['then'](handleEntityNotFound(_0x1ce079,null))[_0xb724('0x3e')](removeEntity(_0x1ce079,null))[_0xb724('0x3f')](handleError(_0x1ce079,null));}; \ No newline at end of file +var _0xf702=['body','find','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','create'];(function(_0x86e7e7,_0x26b91d){var _0x45284b=function(_0x457b19){while(--_0x457b19){_0x86e7e7['push'](_0x86e7e7['shift']());}};_0x45284b(++_0x26b91d);}(_0xf702,0x1b3));var _0x2f70=function(_0x5c2589,_0x346944){_0x5c2589=_0x5c2589-0x0;var _0x27669b=_0xf702[_0x5c2589];return _0x27669b;};'use strict';var emlformat=require(_0x2f70('0x0'));var rimraf=require(_0x2f70('0x1'));var zipdir=require(_0x2f70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2f70('0x3'));var moment=require(_0x2f70('0x4'));var BPromise=require(_0x2f70('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2f70('0x6'));var sox=require(_0x2f70('0x7'));var csv=require(_0x2f70('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f70('0x9'));var squel=require('squel');var crypto=require(_0x2f70('0xa'));var jsforce=require(_0x2f70('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2f70('0x8'));var querystring=require(_0x2f70('0xc'));var Papa=require(_0x2f70('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2f70('0xe'));var hardwareService=require(_0x2f70('0xf'));var logger=require(_0x2f70('0x10'))(_0x2f70('0x11'));var utils=require(_0x2f70('0x12'));var config=require(_0x2f70('0x13'));var licenseUtil=require(_0x2f70('0x14'));var db=require(_0x2f70('0x15'))['db'];function respondWithStatusCode(_0x89e117,_0x42d277){_0x42d277=_0x42d277||0xcc;return function(_0x5d54e8){if(_0x5d54e8){return _0x89e117[_0x2f70('0x16')](_0x42d277);}return _0x89e117[_0x2f70('0x17')](_0x42d277)[_0x2f70('0x18')]();};}function respondWithResult(_0x5364eb,_0x234d3f){_0x234d3f=_0x234d3f||0xc8;return function(_0x1a0ac6){if(_0x1a0ac6){return _0x5364eb[_0x2f70('0x17')](_0x234d3f)[_0x2f70('0x19')](_0x1a0ac6);}};}function respondWithFilteredResult(_0x5948c0,_0x260cac){return function(_0x246acb){if(_0x246acb){var _0x2a8fdf=typeof _0x260cac[_0x2f70('0x1a')]===_0x2f70('0x1b')&&typeof _0x260cac[_0x2f70('0x1c')]==='undefined';var _0x43ad46=_0x246acb[_0x2f70('0x1d')];var _0xa1cb6e=_0x2a8fdf?0x0:_0x260cac[_0x2f70('0x1a')];var _0x197af6=_0x2a8fdf?_0x246acb[_0x2f70('0x1d')]:_0x260cac[_0x2f70('0x1a')]+_0x260cac[_0x2f70('0x1c')];var _0x3b2652;if(_0x197af6>=_0x43ad46){_0x197af6=_0x43ad46;_0x3b2652=0xc8;}else{_0x3b2652=0xce;}_0x5948c0[_0x2f70('0x17')](_0x3b2652);return _0x5948c0['set'](_0x2f70('0x1e'),_0xa1cb6e+'-'+_0x197af6+'/'+_0x43ad46)[_0x2f70('0x19')](_0x246acb);}return null;};}function patchUpdates(_0x552a11){return function(_0x1331d5){try{jsonpatch[_0x2f70('0x1f')](_0x1331d5,_0x552a11,!![]);}catch(_0x1729ad){return BPromise[_0x2f70('0x20')](_0x1729ad);}return _0x1331d5[_0x2f70('0x21')]();};}function saveUpdates(_0x587afc,_0x25eaa2){return function(_0x4c5a72){if(_0x4c5a72){return _0x4c5a72[_0x2f70('0x22')](_0x587afc)[_0x2f70('0x23')](function(_0x5980ca){return _0x5980ca;});}return null;};}function removeEntity(_0x4552b8,_0x5b517b){return function(_0x1231a7){if(_0x1231a7){return _0x1231a7['destroy']()[_0x2f70('0x23')](function(){_0x4552b8[_0x2f70('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57692b,_0x366e7c){return function(_0x4a4cff){if(!_0x4a4cff){_0x57692b[_0x2f70('0x16')](0x194);}return _0x4a4cff;};}function handleError(_0x314090,_0x2e41a8){_0x2e41a8=_0x2e41a8||0x1f4;return function(_0x24220f){logger[_0x2f70('0x24')](_0x24220f[_0x2f70('0x25')]);if(_0x24220f['name']){delete _0x24220f[_0x2f70('0x26')];}_0x314090[_0x2f70('0x17')](_0x2e41a8)[_0x2f70('0x27')](_0x24220f);};}exports[_0x2f70('0x28')]=function(_0x3bda08,_0x126823){var _0x11b361={},_0x47699d={},_0x49e902={'count':0x0,'rows':[]};var _0x297d02=_[_0x2f70('0x29')](db[_0x2f70('0x2a')][_0x2f70('0x2b')],function(_0x166325){return{'name':_0x166325[_0x2f70('0x2c')],'type':_0x166325[_0x2f70('0x2d')][_0x2f70('0x2e')]};});_0x47699d[_0x2f70('0x2f')]=_['map'](_0x297d02,_0x2f70('0x26'));_0x47699d['query']=_['keys'](_0x3bda08[_0x2f70('0x30')]);_0x47699d['filters']=_[_0x2f70('0x31')](_0x47699d[_0x2f70('0x2f')],_0x47699d['query']);_0x11b361['attributes']=_[_0x2f70('0x31')](_0x47699d['model'],qs[_0x2f70('0x32')](_0x3bda08['query'][_0x2f70('0x32')]));_0x11b361[_0x2f70('0x33')]=_0x11b361[_0x2f70('0x33')][_0x2f70('0x34')]?_0x11b361[_0x2f70('0x33')]:_0x47699d['model'];if(!_0x3bda08[_0x2f70('0x30')][_0x2f70('0x35')](_0x2f70('0x36'))){_0x11b361[_0x2f70('0x1c')]=qs[_0x2f70('0x1c')](_0x3bda08[_0x2f70('0x30')]['limit']);_0x11b361[_0x2f70('0x1a')]=qs[_0x2f70('0x1a')](_0x3bda08[_0x2f70('0x30')]['offset']);}_0x11b361['order']=qs[_0x2f70('0x37')](_0x3bda08[_0x2f70('0x30')][_0x2f70('0x37')]);_0x11b361[_0x2f70('0x38')]=qs[_0x2f70('0x39')](_[_0x2f70('0x3a')](_0x3bda08['query'],_0x47699d['filters']),_0x297d02);if(_0x3bda08['query'][_0x2f70('0x3b')]){_0x11b361[_0x2f70('0x38')]=_[_0x2f70('0x3c')](_0x11b361[_0x2f70('0x38')],{'$or':_[_0x2f70('0x29')](_0x297d02,function(_0x34ec8f){if(_0x34ec8f['type']!==_0x2f70('0x3d')){var _0x4c3370={};_0x4c3370[_0x34ec8f['name']]={'$like':'%'+_0x3bda08[_0x2f70('0x30')][_0x2f70('0x3b')]+'%'};return _0x4c3370;}})});}_0x11b361=_[_0x2f70('0x3c')]({},_0x11b361,_0x3bda08[_0x2f70('0x3e')]);var _0x26ebb8={'where':_0x11b361[_0x2f70('0x38')]};return db[_0x2f70('0x2a')][_0x2f70('0x1d')](_0x26ebb8)[_0x2f70('0x23')](function(_0x3e0f37){_0x49e902[_0x2f70('0x1d')]=_0x3e0f37;if(_0x3bda08['query'][_0x2f70('0x3f')]){_0x11b361['include']=[{'all':!![]}];}return db[_0x2f70('0x2a')][_0x2f70('0x40')](_0x11b361);})[_0x2f70('0x23')](function(_0x527f00){_0x49e902['rows']=_0x527f00;return _0x49e902;})[_0x2f70('0x23')](respondWithFilteredResult(_0x126823,_0x11b361))[_0x2f70('0x41')](handleError(_0x126823,null));};exports[_0x2f70('0x42')]=function(_0x5cf6c4,_0x28f6ed){var _0x32e2d5={'raw':!![],'where':{'id':_0x5cf6c4[_0x2f70('0x43')]['id']}},_0x442308={};_0x442308['model']=_['keys'](db[_0x2f70('0x2a')][_0x2f70('0x2b')]);_0x442308[_0x2f70('0x30')]=_['keys'](_0x5cf6c4[_0x2f70('0x30')]);_0x442308[_0x2f70('0x39')]=_[_0x2f70('0x31')](_0x442308['model'],_0x442308[_0x2f70('0x30')]);_0x32e2d5[_0x2f70('0x33')]=_['intersection'](_0x442308['model'],qs[_0x2f70('0x32')](_0x5cf6c4[_0x2f70('0x30')][_0x2f70('0x32')]));_0x32e2d5[_0x2f70('0x33')]=_0x32e2d5[_0x2f70('0x33')]['length']?_0x32e2d5['attributes']:_0x442308[_0x2f70('0x2f')];if(_0x5cf6c4[_0x2f70('0x30')][_0x2f70('0x3f')]){_0x32e2d5['include']=[{'all':!![]}];}_0x32e2d5=_[_0x2f70('0x3c')]({},_0x32e2d5,_0x5cf6c4[_0x2f70('0x3e')]);return db[_0x2f70('0x2a')]['find'](_0x32e2d5)['then'](handleEntityNotFound(_0x28f6ed,null))[_0x2f70('0x23')](respondWithResult(_0x28f6ed,null))[_0x2f70('0x41')](handleError(_0x28f6ed,null));};exports[_0x2f70('0x44')]=function(_0xd1c624,_0x4aed30){return db[_0x2f70('0x2a')][_0x2f70('0x44')](_0xd1c624['body'],{})['then'](respondWithResult(_0x4aed30,0xc9))[_0x2f70('0x41')](handleError(_0x4aed30,null));};exports['update']=function(_0x4730b3,_0x53e1a9){if(_0x4730b3[_0x2f70('0x45')]['id']){delete _0x4730b3[_0x2f70('0x45')]['id'];}return db[_0x2f70('0x2a')][_0x2f70('0x46')]({'where':{'id':_0x4730b3[_0x2f70('0x43')]['id']}})[_0x2f70('0x23')](handleEntityNotFound(_0x53e1a9,null))[_0x2f70('0x23')](saveUpdates(_0x4730b3[_0x2f70('0x45')],null))[_0x2f70('0x23')](respondWithResult(_0x53e1a9,null))[_0x2f70('0x41')](handleError(_0x53e1a9,null));};exports[_0x2f70('0x47')]=function(_0x5dc3ab,_0x1c26b0){return db[_0x2f70('0x2a')]['find']({'where':{'id':_0x5dc3ab[_0x2f70('0x43')]['id']}})['then'](handleEntityNotFound(_0x1c26b0,null))['then'](removeEntity(_0x1c26b0,null))[_0x2f70('0x41')](handleError(_0x1c26b0,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 29a9d6d..aadc527 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 _0x1280=['FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesField.attributes','exports'];(function(_0x1cd9a9,_0x226b55){var _0x15795d=function(_0x238793){while(--_0x238793){_0x1cd9a9['push'](_0x1cd9a9['shift']());}};_0x15795d(++_0x226b55);}(_0x1280,0xac));var _0x0128=function(_0x502036,_0x502686){_0x502036=_0x502036-0x0;var _0x485247=_0x1280[_0x502036];return _0x485247;};'use strict';var _=require(_0x0128('0x0'));var util=require('util');var logger=require(_0x0128('0x1'))(_0x0128('0x2'));var moment=require(_0x0128('0x3'));var BPromise=require(_0x0128('0x4'));var rp=require(_0x0128('0x5'));var fs=require('fs');var path=require(_0x0128('0x6'));var rimraf=require('rimraf');var config=require(_0x0128('0x7'));var attributes=require(_0x0128('0x8'));module[_0x0128('0x9')]=function(_0x2631a2,_0x4aa391){return _0x2631a2['define'](_0x0128('0xa'),attributes,{'tableName':_0x0128('0xb'),'paranoid':![],'indexes':[{'name':_0x0128('0xc'),'fields':[_0x0128('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x34bd=['int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','FreshsalesField'];(function(_0x37ca90,_0x97f42){var _0x293428=function(_0x79b7c3){while(--_0x79b7c3){_0x37ca90['push'](_0x37ca90['shift']());}};_0x293428(++_0x97f42);}(_0x34bd,0x1d2));var _0xd34b=function(_0x8f270,_0x2f435f){_0x8f270=_0x8f270-0x0;var _0x5446cb=_0x34bd[_0x8f270];return _0x5446cb;};'use strict';var _=require(_0xd34b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd34b('0x1'));var moment=require(_0xd34b('0x2'));var BPromise=require(_0xd34b('0x3'));var rp=require(_0xd34b('0x4'));var fs=require('fs');var path=require(_0xd34b('0x5'));var rimraf=require(_0xd34b('0x6'));var config=require(_0xd34b('0x7'));var attributes=require('./intFreshsalesField.attributes');module[_0xd34b('0x8')]=function(_0x5d161e,_0x4e6e94){return _0x5d161e['define'](_0xd34b('0x9'),attributes,{'tableName':_0xd34b('0xa'),'paranoid':![],'indexes':[{'name':_0xd34b('0xb'),'fields':[_0xd34b('0xc'),_0xd34b('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 336290a..2cb7143 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 _0xf61e=['info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x587a4d,_0x181931){var _0x10d22b=function(_0xcbaf5e){while(--_0xcbaf5e){_0x587a4d['push'](_0x587a4d['shift']());}};_0x10d22b(++_0x181931);}(_0xf61e,0x191));var _0xef61=function(_0x4f7ae1,_0x19c166){_0x4f7ae1=_0x4f7ae1-0x0;var _0x973cc5=_0xf61e[_0x4f7ae1];return _0x973cc5;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e2f79,_0x4f0cc5,_0x2242a7){return new BPromise(function(_0x277fa1,_0x106e7f){return client['request'](_0x3e2f79,_0x2242a7)['then'](function(_0x188894){logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));logger[_0xef61('0x10')](_0xef61('0x11'),_0x4f0cc5,_0xef61('0xf'),JSON[_0xef61('0x12')](_0x188894));if(_0x188894[_0xef61('0x13')]){if(_0x188894[_0xef61('0x13')][_0xef61('0x14')]===0x1f4){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')]['message']);return _0x106e7f(_0x188894[_0xef61('0x13')]['message']);}logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')][_0xef61('0x15')]);return _0x277fa1(_0x188894['error'][_0xef61('0x15')]);}else{logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));_0x277fa1(_0x188894['result'][_0xef61('0x15')]);}})[_0xef61('0x16')](function(_0x4f7a62){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x4f7a62);_0x106e7f(_0x4f7a62);});});} \ No newline at end of file +var _0x6f47=['request\x20sent','debug','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x6f47,0xc7));var _0x76f4=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x6f47[_0x39e84d];return _0x1991bc;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var moment=require(_0x76f4('0x1'));var BPromise=require('bluebird');var rs=require(_0x76f4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x76f4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x76f4('0x4'))(_0x76f4('0x5'));var config=require(_0x76f4('0x6'));var jayson=require(_0x76f4('0x7'));var client=jayson['client'][_0x76f4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xfc2405,_0x2176a7,_0x497f99){return new BPromise(function(_0x1a3172,_0x25656d){return client[_0x76f4('0x9')](_0xfc2405,_0x497f99)[_0x76f4('0xa')](function(_0x101f55){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x2176a7,_0x76f4('0xb'));logger[_0x76f4('0xc')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x2176a7,'request\x20sent',JSON[_0x76f4('0xd')](_0x101f55));if(_0x101f55[_0x76f4('0xe')]){if(_0x101f55[_0x76f4('0xe')][_0x76f4('0xf')]===0x1f4){logger[_0x76f4('0xe')](_0x76f4('0x10'),_0x2176a7,_0x101f55[_0x76f4('0xe')][_0x76f4('0x11')]);return _0x25656d(_0x101f55[_0x76f4('0xe')]['message']);}logger[_0x76f4('0xe')](_0x76f4('0x10'),_0x2176a7,_0x101f55['error']['message']);return _0x1a3172(_0x101f55['error'][_0x76f4('0x11')]);}else{logger[_0x76f4('0x12')](_0x76f4('0x10'),_0x2176a7,_0x76f4('0xb'));_0x1a3172(_0x101f55[_0x76f4('0x13')][_0x76f4('0x11')]);}})[_0x76f4('0x14')](function(_0x981a87){logger[_0x76f4('0xe')](_0x76f4('0x10'),_0x2176a7,_0x981a87);_0x25656d(_0x981a87);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 22a074d..d5ffc20 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x37f61a,_0x36a617){var _0x4cee77=function(_0x4bfcdb){while(--_0x4bfcdb){_0x37f61a['push'](_0x37f61a['shift']());}};_0x4cee77(++_0x36a617);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x46184e,_0x44e304){var _0x492c69=function(_0x3a865c){while(--_0x3a865c){_0x46184e['push'](_0x46184e['shift']());}};_0x492c69(++_0x44e304);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 26fd72a..2831706 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 _0x46cb=['sequelize','exports','STRING','username','ENUM','newTab'];(function(_0x3c5334,_0x9ae4f5){var _0x2dcad7=function(_0x25f67d){while(--_0x25f67d){_0x3c5334['push'](_0x3c5334['shift']());}};_0x2dcad7(++_0x9ae4f5);}(_0x46cb,0x84));var _0xb46c=function(_0x1be994,_0x267018){_0x1be994=_0x1be994-0x0;var _0x365952=_0x46cb[_0x1be994];return _0x365952;};'use strict';var Sequelize=require(_0xb46c('0x0'));module[_0xb46c('0x1')]={'name':{'type':Sequelize[_0xb46c('0x2')]},'description':{'type':Sequelize[_0xb46c('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xb46c('0x3')},'remoteUri':{'type':Sequelize[_0xb46c('0x2')]},'password':{'type':Sequelize[_0xb46c('0x2')]},'clientId':{'type':Sequelize[_0xb46c('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xb46c('0x2')]},'serverUrl':{'type':Sequelize[_0xb46c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb46c('0x4')]('integrationTab',_0xb46c('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x61d0=['newTab','sequelize','STRING','username','ENUM','integrationTab'];(function(_0x5cbace,_0x33943c){var _0x6de5b8=function(_0x5aae38){while(--_0x5aae38){_0x5cbace['push'](_0x5cbace['shift']());}};_0x6de5b8(++_0x33943c);}(_0x61d0,0x187));var _0x061d=function(_0x21b762,_0xc8ef11){_0x21b762=_0x21b762-0x0;var _0x2ea6d4=_0x61d0[_0x21b762];return _0x2ea6d4;};'use strict';var Sequelize=require(_0x061d('0x0'));module['exports']={'name':{'type':Sequelize[_0x061d('0x1')]},'description':{'type':Sequelize[_0x061d('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x061d('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x061d('0x1')]},'clientId':{'type':Sequelize[_0x061d('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x061d('0x1')]},'serverUrl':{'type':Sequelize[_0x061d('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x061d('0x3')](_0x061d('0x4'),_0x061d('0x5')),'defaultValue':_0x061d('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 9005494..33a801f 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 _0x5204=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','update','then','stack','name','send','index','map','rawAttributes','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','SalesforceAccount','includeAll','include','findAll','rows','params','find','create','body','catch','destroy','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','SalesforceField','getFields','Task','remoteUri','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','concat','isNil','ticketType','sobject','describe','IsRecurrence','Subject','Description','int','picklist','email','textarea','remove','includes','label','value','true','false','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x4710ae,_0x67ab63){var _0x10c5f8=function(_0x3c04bc){while(--_0x3c04bc){_0x4710ae['push'](_0x4710ae['shift']());}};_0x10c5f8(++_0x67ab63);}(_0x5204,0xd8));var _0x4520=function(_0x1795df,_0xcb261e){_0x1795df=_0x1795df-0x0;var _0x3f13c0=_0x5204[_0x1795df];return _0x3f13c0;};'use strict';var emlformat=require(_0x4520('0x0'));var rimraf=require(_0x4520('0x1'));var zipdir=require(_0x4520('0x2'));var jsonpatch=require(_0x4520('0x3'));var rp=require(_0x4520('0x4'));var moment=require(_0x4520('0x5'));var BPromise=require(_0x4520('0x6'));var Mustache=require(_0x4520('0x7'));var util=require(_0x4520('0x8'));var path=require(_0x4520('0x9'));var sox=require(_0x4520('0xa'));var csv=require(_0x4520('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4520('0xc'));var squel=require(_0x4520('0xd'));var crypto=require(_0x4520('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4520('0xf'));var toCsv=require(_0x4520('0xb'));var querystring=require(_0x4520('0x10'));var Papa=require(_0x4520('0x11'));var Redis=require(_0x4520('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4520('0x13'));var as=require(_0x4520('0x14'));var hardwareService=require(_0x4520('0x15'));var logger=require(_0x4520('0x16'))(_0x4520('0x17'));var utils=require('../../config/utils');var config=require(_0x4520('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4520('0x19'))['db'];var integrations=require(_0x4520('0x1a'));function respondWithStatusCode(_0x249b6f,_0x577c6e){_0x577c6e=_0x577c6e||0xcc;return function(_0x5e34ff){if(_0x5e34ff){return _0x249b6f[_0x4520('0x1b')](_0x577c6e);}return _0x249b6f[_0x4520('0x1c')](_0x577c6e)['end']();};}function respondWithResult(_0x298402,_0x4ac599){_0x4ac599=_0x4ac599||0xc8;return function(_0x5b665d){if(_0x5b665d){return _0x298402[_0x4520('0x1c')](_0x4ac599)['json'](_0x5b665d);}};}function respondWithFilteredResult(_0xe6758c,_0x399c09){return function(_0xb52dee){if(_0xb52dee){var _0x4e0a1b=typeof _0x399c09[_0x4520('0x1d')]===_0x4520('0x1e')&&typeof _0x399c09['limit']===_0x4520('0x1e');var _0x3c53ec=_0xb52dee[_0x4520('0x1f')];var _0x430d4b=_0x4e0a1b?0x0:_0x399c09['offset'];var _0x1d806f=_0x4e0a1b?_0xb52dee[_0x4520('0x1f')]:_0x399c09['offset']+_0x399c09[_0x4520('0x20')];var _0x112c0f;if(_0x1d806f>=_0x3c53ec){_0x1d806f=_0x3c53ec;_0x112c0f=0xc8;}else{_0x112c0f=0xce;}_0xe6758c[_0x4520('0x1c')](_0x112c0f);return _0xe6758c[_0x4520('0x21')]('Content-Range',_0x430d4b+'-'+_0x1d806f+'/'+_0x3c53ec)[_0x4520('0x22')](_0xb52dee);}return null;};}function patchUpdates(_0x1c673d){return function(_0x1cd4a5){try{jsonpatch[_0x4520('0x23')](_0x1cd4a5,_0x1c673d,!![]);}catch(_0x548c7d){return BPromise[_0x4520('0x24')](_0x548c7d);}return _0x1cd4a5['save']();};}function saveUpdates(_0x13c753,_0xba21b5){return function(_0x5e69e8){if(_0x5e69e8){return _0x5e69e8[_0x4520('0x25')](_0x13c753)[_0x4520('0x26')](function(_0x3379b5){return _0x3379b5;});}return null;};}function removeEntity(_0x57a2f7,_0xb146d4){return function(_0x1e56cc){if(_0x1e56cc){return _0x1e56cc['destroy']()['then'](function(){_0x57a2f7[_0x4520('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1875a0,_0x438cd6){return function(_0x8c4e1f){if(!_0x8c4e1f){_0x1875a0[_0x4520('0x1b')](0x194);}return _0x8c4e1f;};}function handleError(_0x42ce4b,_0xeb54fd){_0xeb54fd=_0xeb54fd||0x1f4;return function(_0x46e18b){logger['error'](_0x46e18b[_0x4520('0x27')]);if(_0x46e18b[_0x4520('0x28')]){delete _0x46e18b[_0x4520('0x28')];}_0x42ce4b['status'](_0xeb54fd)[_0x4520('0x29')](_0x46e18b);};}exports[_0x4520('0x2a')]=function(_0x1c5927,_0x504a36){var _0x52f2fc={},_0x5d6974={},_0x3280ac={'count':0x0,'rows':[]};var _0x22e9d5=_[_0x4520('0x2b')](db['SalesforceAccount'][_0x4520('0x2c')],function(_0x5242bb){return{'name':_0x5242bb['fieldName'],'type':_0x5242bb['type']['key']};});_0x5d6974[_0x4520('0x2d')]=_[_0x4520('0x2b')](_0x22e9d5,_0x4520('0x28'));_0x5d6974[_0x4520('0x2e')]=_[_0x4520('0x2f')](_0x1c5927['query']);_0x5d6974['filters']=_['intersection'](_0x5d6974[_0x4520('0x2d')],_0x5d6974[_0x4520('0x2e')]);_0x52f2fc[_0x4520('0x30')]=_[_0x4520('0x31')](_0x5d6974[_0x4520('0x2d')],qs[_0x4520('0x32')](_0x1c5927[_0x4520('0x2e')][_0x4520('0x32')]));_0x52f2fc['attributes']=_0x52f2fc[_0x4520('0x30')][_0x4520('0x33')]?_0x52f2fc[_0x4520('0x30')]:_0x5d6974['model'];if(!_0x1c5927[_0x4520('0x2e')][_0x4520('0x34')](_0x4520('0x35'))){_0x52f2fc[_0x4520('0x20')]=qs[_0x4520('0x20')](_0x1c5927[_0x4520('0x2e')][_0x4520('0x20')]);_0x52f2fc['offset']=qs[_0x4520('0x1d')](_0x1c5927[_0x4520('0x2e')][_0x4520('0x1d')]);}_0x52f2fc[_0x4520('0x36')]=qs[_0x4520('0x37')](_0x1c5927[_0x4520('0x2e')][_0x4520('0x37')]);_0x52f2fc[_0x4520('0x38')]=qs[_0x4520('0x39')](_[_0x4520('0x3a')](_0x1c5927['query'],_0x5d6974['filters']),_0x22e9d5);if(_0x1c5927['query'][_0x4520('0x3b')]){_0x52f2fc[_0x4520('0x38')]=_[_0x4520('0x3c')](_0x52f2fc[_0x4520('0x38')],{'$or':_[_0x4520('0x2b')](_0x22e9d5,function(_0x131fe7){if(_0x131fe7['type']!=='VIRTUAL'){var _0x5a7832={};_0x5a7832[_0x131fe7[_0x4520('0x28')]]={'$like':'%'+_0x1c5927[_0x4520('0x2e')]['filter']+'%'};return _0x5a7832;}})});}_0x52f2fc=_[_0x4520('0x3c')]({},_0x52f2fc,_0x1c5927[_0x4520('0x3d')]);var _0x2b6939={'where':_0x52f2fc['where']};return db[_0x4520('0x3e')][_0x4520('0x1f')](_0x2b6939)['then'](function(_0x2e414d){_0x3280ac['count']=_0x2e414d;if(_0x1c5927[_0x4520('0x2e')][_0x4520('0x3f')]){_0x52f2fc[_0x4520('0x40')]=[{'all':!![]}];}return db[_0x4520('0x3e')][_0x4520('0x41')](_0x52f2fc);})[_0x4520('0x26')](function(_0x499849){_0x3280ac[_0x4520('0x42')]=_0x499849;return _0x3280ac;})[_0x4520('0x26')](respondWithFilteredResult(_0x504a36,_0x52f2fc))['catch'](handleError(_0x504a36,null));};exports['show']=function(_0x38247b,_0x1bdb25){var _0x564462={'raw':![],'where':{'id':_0x38247b[_0x4520('0x43')]['id']}},_0x277da6={};_0x277da6['model']=_['keys'](db[_0x4520('0x3e')][_0x4520('0x2c')]);_0x277da6[_0x4520('0x2e')]=_['keys'](_0x38247b[_0x4520('0x2e')]);_0x277da6[_0x4520('0x39')]=_[_0x4520('0x31')](_0x277da6[_0x4520('0x2d')],_0x277da6[_0x4520('0x2e')]);_0x564462['attributes']=_[_0x4520('0x31')](_0x277da6[_0x4520('0x2d')],qs[_0x4520('0x32')](_0x38247b[_0x4520('0x2e')][_0x4520('0x32')]));_0x564462[_0x4520('0x30')]=_0x564462['attributes'][_0x4520('0x33')]?_0x564462[_0x4520('0x30')]:_0x277da6[_0x4520('0x2d')];if(_0x38247b['query'][_0x4520('0x3f')]){_0x564462[_0x4520('0x40')]=[{'all':!![]}];}_0x564462=_[_0x4520('0x3c')]({},_0x564462,_0x38247b[_0x4520('0x3d')]);return db[_0x4520('0x3e')][_0x4520('0x44')](_0x564462)[_0x4520('0x26')](handleEntityNotFound(_0x1bdb25,null))[_0x4520('0x26')](respondWithResult(_0x1bdb25,null))['catch'](handleError(_0x1bdb25,null));};exports['create']=function(_0x4444c8,_0x2e35aa){return db['SalesforceAccount'][_0x4520('0x45')](_0x4444c8[_0x4520('0x46')],{})['then'](respondWithResult(_0x2e35aa,0xc9))[_0x4520('0x47')](handleError(_0x2e35aa,null));};exports['update']=function(_0x1bded3,_0x577aa9){if(_0x1bded3[_0x4520('0x46')]['id']){delete _0x1bded3[_0x4520('0x46')]['id'];}return db[_0x4520('0x3e')][_0x4520('0x44')]({'where':{'id':_0x1bded3[_0x4520('0x43')]['id']}})[_0x4520('0x26')](handleEntityNotFound(_0x577aa9,null))[_0x4520('0x26')](saveUpdates(_0x1bded3[_0x4520('0x46')],null))[_0x4520('0x26')](respondWithResult(_0x577aa9,null))[_0x4520('0x47')](handleError(_0x577aa9,null));};exports[_0x4520('0x48')]=function(_0x3dbc04,_0x163fa9){return db[_0x4520('0x3e')][_0x4520('0x44')]({'where':{'id':_0x3dbc04['params']['id']}})[_0x4520('0x26')](handleEntityNotFound(_0x163fa9,null))[_0x4520('0x26')](removeEntity(_0x163fa9,null))[_0x4520('0x47')](handleError(_0x163fa9,null));};exports[_0x4520('0x49')]=function(_0x123423,_0x1afee4,_0x1e9f00){var _0x4e27a1={};var _0x1b5303={};var _0x21c4d5;var _0x5e3f67;return db['SalesforceAccount'][_0x4520('0x4a')]({'where':{'id':_0x123423[_0x4520('0x43')]['id']}})[_0x4520('0x26')](handleEntityNotFound(_0x1afee4,null))[_0x4520('0x26')](function(_0x3c48b8){if(_0x3c48b8){_0x21c4d5=_0x3c48b8;_0x1b5303[_0x4520('0x2d')]=_[_0x4520('0x2f')](db[_0x4520('0x4b')][_0x4520('0x2c')]);_0x1b5303['query']=_[_0x4520('0x2f')](_0x123423['query']);_0x1b5303[_0x4520('0x39')]=_[_0x4520('0x31')](_0x1b5303[_0x4520('0x2d')],_0x1b5303[_0x4520('0x2e')]);_0x4e27a1['attributes']=_['intersection'](_0x1b5303[_0x4520('0x2d')],qs[_0x4520('0x32')](_0x123423[_0x4520('0x2e')][_0x4520('0x32')]));_0x4e27a1['attributes']=_0x4e27a1[_0x4520('0x30')][_0x4520('0x33')]?_0x4e27a1[_0x4520('0x30')]:_0x1b5303[_0x4520('0x2d')];_0x4e27a1[_0x4520('0x36')]=qs[_0x4520('0x37')](_0x123423[_0x4520('0x2e')]['sort']);_0x4e27a1[_0x4520('0x38')]=qs['filters'](_['pick'](_0x123423[_0x4520('0x2e')],_0x1b5303[_0x4520('0x39')]));if(_0x123423['query']['filter']){_0x4e27a1[_0x4520('0x38')]=_[_0x4520('0x3c')](_0x4e27a1[_0x4520('0x38')],{'$or':_[_0x4520('0x2b')](_0x4e27a1[_0x4520('0x30')],function(_0x1dd6d9){var _0x49354a={};_0x49354a[_0x1dd6d9]={'$like':'%'+_0x123423[_0x4520('0x2e')][_0x4520('0x3b')]+'%'};return _0x49354a;})});}_0x4e27a1=_[_0x4520('0x3c')]({},_0x4e27a1,_0x123423['options']);return _0x21c4d5[_0x4520('0x49')](_0x4e27a1);}})[_0x4520('0x26')](function(_0x328bb4){if(_0x328bb4){_0x5e3f67=_0x328bb4[_0x4520('0x33')];if(!_0x123423[_0x4520('0x2e')][_0x4520('0x34')](_0x4520('0x35'))){_0x4e27a1[_0x4520('0x20')]=qs[_0x4520('0x20')](_0x123423[_0x4520('0x2e')][_0x4520('0x20')]);_0x4e27a1['offset']=qs[_0x4520('0x1d')](_0x123423[_0x4520('0x2e')][_0x4520('0x1d')]);}return _0x21c4d5[_0x4520('0x49')](_0x4e27a1);}})['then'](function(_0x4a7c5a){if(_0x4a7c5a){return _0x4a7c5a?{'count':_0x5e3f67,'rows':_0x4a7c5a}:null;}})[_0x4520('0x26')](respondWithResult(_0x1afee4,null))[_0x4520('0x47')](handleError(_0x1afee4,null));};exports[_0x4520('0x4c')]=function(_0x22eaf2,_0x511e42,_0x4d80b3){if(_0x22eaf2['body']['id']){delete _0x22eaf2[_0x4520('0x46')]['id'];}return db[_0x4520('0x3e')][_0x4520('0x4a')]({'where':{'id':_0x22eaf2[_0x4520('0x43')]['id']}})[_0x4520('0x26')](handleEntityNotFound(_0x511e42,null))[_0x4520('0x26')](function(_0x244182){if(_0x244182){_0x22eaf2['body'][_0x4520('0x4d')]=_0x244182['id'];_0x22eaf2[_0x4520('0x46')][_0x4520('0x4e')]=integrations[_0x4520('0x4f')](_0x22eaf2['body'][_0x4520('0x50')],_0x22eaf2[_0x4520('0x46')][_0x4520('0x51')]);_0x22eaf2[_0x4520('0x46')][_0x4520('0x52')]=integrations['getDescriptions'](_0x22eaf2[_0x4520('0x46')][_0x4520('0x50')],_0x22eaf2[_0x4520('0x46')][_0x4520('0x51')]);return db[_0x4520('0x4b')]['create'](_0x22eaf2[_0x4520('0x46')],{'include':[{'model':db[_0x4520('0x53')],'as':_0x4520('0x4e')},{'model':db['SalesforceField'],'as':_0x4520('0x52')}]});}return null;})[_0x4520('0x26')](respondWithResult(_0x511e42,null))[_0x4520('0x47')](handleError(_0x511e42,null));};exports[_0x4520('0x54')]=function(_0x11fdc2,_0x1e120e,_0x4794a3){var _0x337bff;var _0x1d3027='';var _0x3128cc=_0x4520('0x55');return db['SalesforceAccount'][_0x4520('0x4a')]({'where':{'id':_0x11fdc2[_0x4520('0x43')]['id']},'attributes':['id',_0x4520('0x56'),'clientId',_0x4520('0x57'),_0x4520('0x58'),_0x4520('0x59'),_0x4520('0x5a')]})[_0x4520('0x26')](handleEntityNotFound(_0x1e120e,null))[_0x4520('0x26')](function(_0x559757){if(_0x559757){_0x1d3027=_0x559757[_0x4520('0x56')];var _0x2aa95f=_0x1d3027[_0x4520('0x5b')](-0x1);if(_0x2aa95f==='/'){_0x1d3027=_0x1d3027[_0x4520('0x5c')](0x0,_0x1d3027[_0x4520('0x5d')](_0x2aa95f));}_0x337bff=new jsforce[(_0x4520('0x5e'))]({'oauth2':{'loginUrl':_0x1d3027,'clientId':_0x559757['clientId'],'clientSecret':_0x559757[_0x4520('0x57')]}});return _0x337bff['login'](_0x559757['username'],_0x559757[_0x4520('0x59')][_0x4520('0x5f')](_0x559757[_0x4520('0x5a')]));}})[_0x4520('0x26')](function(_0x159b7c){if(_0x159b7c){if(!_[_0x4520('0x60')](_0x11fdc2[_0x4520('0x2e')][_0x4520('0x61')])){_0x3128cc=_0x11fdc2[_0x4520('0x2e')][_0x4520('0x61')];}return _0x337bff[_0x4520('0x62')](_0x3128cc)[_0x4520('0x63')]();}})[_0x4520('0x26')](function(_0x467a70){var _0x412fe1=['OwnerId','ActivityDate','IsReminderSet',_0x4520('0x64'),_0x4520('0x65'),_0x4520('0x66')];var _0x2638ad=['string',_0x4520('0x67'),_0x4520('0x68'),'boolean',_0x4520('0x69'),_0x4520('0x6a'),'phone'];if(_0x467a70){_[_0x4520('0x6b')](_0x467a70[_0x4520('0x32')],function(_0x124fae){return _0x412fe1[_0x4520('0x6c')](_0x124fae[_0x4520('0x28')])||!_0x2638ad[_0x4520('0x6c')](_0x124fae[_0x4520('0x51')]);});return{'count':_0x467a70[_0x4520('0x32')][_0x4520('0x33')],'rows':_[_0x4520('0x2b')](_0x467a70[_0x4520('0x32')],function(_0x164241){return{'id':_0x164241[_0x4520('0x28')],'name':_0x164241[_0x4520('0x6d')],'custom':_0x164241['custom'],'options':_0x164241['picklistValues'][_0x4520('0x33')]>0x0?_[_0x4520('0x2b')](_0x164241['picklistValues'],function(_0x564459){return{'name':_0x564459['label'],'value':_0x564459[_0x4520('0x6e')]};}):_0x164241[_0x4520('0x51')]=='boolean'?[{'name':'True','value':_0x4520('0x6f')},{'name':'False','value':_0x4520('0x70')}]:[]};})};}})['then'](respondWithResult(_0x1e120e,null))[_0x4520('0x47')](function(_0x379b8f){var _0x4849d7=_0x11fdc2[_0x4520('0x2e')]['test']?0x1f4:_0x379b8f[_0x4520('0x71')]||0x1f4;logger[_0x4520('0x72')](_0x4520('0x73'),_0x4520('0x54'),_0x4849d7,JSON[_0x4520('0x74')](_0x379b8f));delete _0x379b8f[_0x4520('0x28')];if(_0x4849d7===0x191){_0x4849d7=0x190;}_0x1e120e[_0x4520('0x1c')](_0x4849d7)[_0x4520('0x29')](_0x11fdc2[_0x4520('0x2e')][_0x4520('0x75')]?{'message':'Wrong\x20credentials','statusCode':_0x379b8f['statusCode']}:_0x379b8f);});}; \ No newline at end of file +var _0xde18=['pick','hasOwnProperty','addConfiguration','findOne','getSubjects','channel','create','Subjects','Descriptions','getFields','Task','remoteUri','clientId','username','password','securityToken','slice','lastIndexOf','Connection','clientSecret','login','concat','isNil','ticketType','sobject','describe','OwnerId','IsReminderSet','IsRecurrence','Subject','Description','string','picklist','boolean','email','textarea','phone','remove','includes','type','label','custom','picklistValues','value','True','true','False','false','test','statusCode','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','key','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','SalesforceAccount','includeAll','include','findAll','rows','show','params','rawAttributes','length','catch','body','find','getConfigurations','SalesforceConfiguration'];(function(_0x1526e1,_0x5ed5a5){var _0x249a1e=function(_0x4a7c12){while(--_0x4a7c12){_0x1526e1['push'](_0x1526e1['shift']());}};_0x249a1e(++_0x5ed5a5);}(_0xde18,0x1b6));var _0x8de1=function(_0x55f64c,_0x361c1e){_0x55f64c=_0x55f64c-0x0;var _0x44f551=_0xde18[_0x55f64c];return _0x44f551;};'use strict';var emlformat=require(_0x8de1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8de1('0x1'));var jsonpatch=require(_0x8de1('0x2'));var rp=require(_0x8de1('0x3'));var moment=require(_0x8de1('0x4'));var BPromise=require(_0x8de1('0x5'));var Mustache=require(_0x8de1('0x6'));var util=require(_0x8de1('0x7'));var path=require(_0x8de1('0x8'));var sox=require(_0x8de1('0x9'));var csv=require(_0x8de1('0xa'));var ejs=require(_0x8de1('0xb'));var fs=require('fs');var fs_extra=require(_0x8de1('0xc'));var _=require('lodash');var squel=require(_0x8de1('0xd'));var crypto=require(_0x8de1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8de1('0xf'));var toCsv=require(_0x8de1('0xa'));var querystring=require(_0x8de1('0x10'));var Papa=require(_0x8de1('0x11'));var Redis=require(_0x8de1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8de1('0x13'));var as=require(_0x8de1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8de1('0x15'))(_0x8de1('0x16'));var utils=require(_0x8de1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8de1('0x18'));var db=require(_0x8de1('0x19'))['db'];var integrations=require(_0x8de1('0x1a'));function respondWithStatusCode(_0x3ecb9e,_0x5db8d4){_0x5db8d4=_0x5db8d4||0xcc;return function(_0x200481){if(_0x200481){return _0x3ecb9e[_0x8de1('0x1b')](_0x5db8d4);}return _0x3ecb9e[_0x8de1('0x1c')](_0x5db8d4)[_0x8de1('0x1d')]();};}function respondWithResult(_0x6c9615,_0x198db8){_0x198db8=_0x198db8||0xc8;return function(_0x40a142){if(_0x40a142){return _0x6c9615[_0x8de1('0x1c')](_0x198db8)[_0x8de1('0x1e')](_0x40a142);}};}function respondWithFilteredResult(_0x1a7697,_0x314db4){return function(_0xb88024){if(_0xb88024){var _0x319131=typeof _0x314db4[_0x8de1('0x1f')]===_0x8de1('0x20')&&typeof _0x314db4[_0x8de1('0x21')]===_0x8de1('0x20');var _0x1ce198=_0xb88024[_0x8de1('0x22')];var _0x496cf7=_0x319131?0x0:_0x314db4[_0x8de1('0x1f')];var _0x1f90b7=_0x319131?_0xb88024['count']:_0x314db4[_0x8de1('0x1f')]+_0x314db4[_0x8de1('0x21')];var _0x1855f4;if(_0x1f90b7>=_0x1ce198){_0x1f90b7=_0x1ce198;_0x1855f4=0xc8;}else{_0x1855f4=0xce;}_0x1a7697[_0x8de1('0x1c')](_0x1855f4);return _0x1a7697[_0x8de1('0x23')](_0x8de1('0x24'),_0x496cf7+'-'+_0x1f90b7+'/'+_0x1ce198)['json'](_0xb88024);}return null;};}function patchUpdates(_0x13ce31){return function(_0x93b08c){try{jsonpatch[_0x8de1('0x25')](_0x93b08c,_0x13ce31,!![]);}catch(_0x56a042){return BPromise['reject'](_0x56a042);}return _0x93b08c[_0x8de1('0x26')]();};}function saveUpdates(_0x33ff3f,_0xbb110){return function(_0x4092b0){if(_0x4092b0){return _0x4092b0[_0x8de1('0x27')](_0x33ff3f)['then'](function(_0x769067){return _0x769067;});}return null;};}function removeEntity(_0x1909cf,_0x3e24cf){return function(_0x4cd0f1){if(_0x4cd0f1){return _0x4cd0f1[_0x8de1('0x28')]()[_0x8de1('0x29')](function(){_0x1909cf[_0x8de1('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c9f48,_0x43f8b7){return function(_0x1961dd){if(!_0x1961dd){_0x4c9f48[_0x8de1('0x1b')](0x194);}return _0x1961dd;};}function handleError(_0x2e72bd,_0xcbc409){_0xcbc409=_0xcbc409||0x1f4;return function(_0x4425ac){logger[_0x8de1('0x2a')](_0x4425ac[_0x8de1('0x2b')]);if(_0x4425ac[_0x8de1('0x2c')]){delete _0x4425ac[_0x8de1('0x2c')];}_0x2e72bd[_0x8de1('0x1c')](_0xcbc409)[_0x8de1('0x2d')](_0x4425ac);};}exports[_0x8de1('0x2e')]=function(_0x377192,_0x3ecdab){var _0x3b372d={},_0x1ba20e={},_0x498a73={'count':0x0,'rows':[]};var _0x1365fe=_[_0x8de1('0x2f')](db['SalesforceAccount']['rawAttributes'],function(_0x796dac){return{'name':_0x796dac['fieldName'],'type':_0x796dac['type'][_0x8de1('0x30')]};});_0x1ba20e[_0x8de1('0x31')]=_[_0x8de1('0x2f')](_0x1365fe,'name');_0x1ba20e['query']=_[_0x8de1('0x32')](_0x377192[_0x8de1('0x33')]);_0x1ba20e[_0x8de1('0x34')]=_[_0x8de1('0x35')](_0x1ba20e[_0x8de1('0x31')],_0x1ba20e[_0x8de1('0x33')]);_0x3b372d[_0x8de1('0x36')]=_[_0x8de1('0x35')](_0x1ba20e[_0x8de1('0x31')],qs[_0x8de1('0x37')](_0x377192['query'][_0x8de1('0x37')]));_0x3b372d[_0x8de1('0x36')]=_0x3b372d[_0x8de1('0x36')]['length']?_0x3b372d['attributes']:_0x1ba20e['model'];if(!_0x377192[_0x8de1('0x33')]['hasOwnProperty'](_0x8de1('0x38'))){_0x3b372d['limit']=qs['limit'](_0x377192[_0x8de1('0x33')][_0x8de1('0x21')]);_0x3b372d['offset']=qs[_0x8de1('0x1f')](_0x377192[_0x8de1('0x33')][_0x8de1('0x1f')]);}_0x3b372d[_0x8de1('0x39')]=qs[_0x8de1('0x3a')](_0x377192[_0x8de1('0x33')][_0x8de1('0x3a')]);_0x3b372d[_0x8de1('0x3b')]=qs[_0x8de1('0x34')](_['pick'](_0x377192['query'],_0x1ba20e[_0x8de1('0x34')]),_0x1365fe);if(_0x377192[_0x8de1('0x33')][_0x8de1('0x3c')]){_0x3b372d[_0x8de1('0x3b')]=_[_0x8de1('0x3d')](_0x3b372d[_0x8de1('0x3b')],{'$or':_[_0x8de1('0x2f')](_0x1365fe,function(_0x18fc47){if(_0x18fc47['type']!==_0x8de1('0x3e')){var _0x126ce8={};_0x126ce8[_0x18fc47['name']]={'$like':'%'+_0x377192[_0x8de1('0x33')][_0x8de1('0x3c')]+'%'};return _0x126ce8;}})});}_0x3b372d=_['merge']({},_0x3b372d,_0x377192[_0x8de1('0x3f')]);var _0x105518={'where':_0x3b372d['where']};return db[_0x8de1('0x40')][_0x8de1('0x22')](_0x105518)['then'](function(_0xa44397){_0x498a73[_0x8de1('0x22')]=_0xa44397;if(_0x377192['query'][_0x8de1('0x41')]){_0x3b372d[_0x8de1('0x42')]=[{'all':!![]}];}return db[_0x8de1('0x40')][_0x8de1('0x43')](_0x3b372d);})[_0x8de1('0x29')](function(_0x554680){_0x498a73[_0x8de1('0x44')]=_0x554680;return _0x498a73;})['then'](respondWithFilteredResult(_0x3ecdab,_0x3b372d))['catch'](handleError(_0x3ecdab,null));};exports[_0x8de1('0x45')]=function(_0x5c476b,_0x4f8eea){var _0x3edb78={'raw':![],'where':{'id':_0x5c476b[_0x8de1('0x46')]['id']}},_0x2e6689={};_0x2e6689[_0x8de1('0x31')]=_[_0x8de1('0x32')](db[_0x8de1('0x40')][_0x8de1('0x47')]);_0x2e6689[_0x8de1('0x33')]=_[_0x8de1('0x32')](_0x5c476b[_0x8de1('0x33')]);_0x2e6689[_0x8de1('0x34')]=_[_0x8de1('0x35')](_0x2e6689[_0x8de1('0x31')],_0x2e6689[_0x8de1('0x33')]);_0x3edb78[_0x8de1('0x36')]=_[_0x8de1('0x35')](_0x2e6689['model'],qs[_0x8de1('0x37')](_0x5c476b[_0x8de1('0x33')][_0x8de1('0x37')]));_0x3edb78[_0x8de1('0x36')]=_0x3edb78[_0x8de1('0x36')][_0x8de1('0x48')]?_0x3edb78[_0x8de1('0x36')]:_0x2e6689[_0x8de1('0x31')];if(_0x5c476b['query']['includeAll']){_0x3edb78[_0x8de1('0x42')]=[{'all':!![]}];}_0x3edb78=_[_0x8de1('0x3d')]({},_0x3edb78,_0x5c476b[_0x8de1('0x3f')]);return db[_0x8de1('0x40')]['find'](_0x3edb78)[_0x8de1('0x29')](handleEntityNotFound(_0x4f8eea,null))['then'](respondWithResult(_0x4f8eea,null))[_0x8de1('0x49')](handleError(_0x4f8eea,null));};exports['create']=function(_0x5169cf,_0x57bc81){return db[_0x8de1('0x40')]['create'](_0x5169cf[_0x8de1('0x4a')],{})[_0x8de1('0x29')](respondWithResult(_0x57bc81,0xc9))[_0x8de1('0x49')](handleError(_0x57bc81,null));};exports[_0x8de1('0x27')]=function(_0x47d1af,_0x439d54){if(_0x47d1af['body']['id']){delete _0x47d1af[_0x8de1('0x4a')]['id'];}return db[_0x8de1('0x40')][_0x8de1('0x4b')]({'where':{'id':_0x47d1af[_0x8de1('0x46')]['id']}})[_0x8de1('0x29')](handleEntityNotFound(_0x439d54,null))[_0x8de1('0x29')](saveUpdates(_0x47d1af[_0x8de1('0x4a')],null))[_0x8de1('0x29')](respondWithResult(_0x439d54,null))['catch'](handleError(_0x439d54,null));};exports[_0x8de1('0x28')]=function(_0xb1af20,_0x105859){return db['SalesforceAccount'][_0x8de1('0x4b')]({'where':{'id':_0xb1af20[_0x8de1('0x46')]['id']}})['then'](handleEntityNotFound(_0x105859,null))['then'](removeEntity(_0x105859,null))[_0x8de1('0x49')](handleError(_0x105859,null));};exports[_0x8de1('0x4c')]=function(_0x6e7f67,_0x5e0ced,_0xa8fa79){var _0x44e378={};var _0x2094d0={};var _0x27c020;var _0x411fbf;return db[_0x8de1('0x40')]['findOne']({'where':{'id':_0x6e7f67[_0x8de1('0x46')]['id']}})[_0x8de1('0x29')](handleEntityNotFound(_0x5e0ced,null))[_0x8de1('0x29')](function(_0x234485){if(_0x234485){_0x27c020=_0x234485;_0x2094d0[_0x8de1('0x31')]=_[_0x8de1('0x32')](db[_0x8de1('0x4d')][_0x8de1('0x47')]);_0x2094d0[_0x8de1('0x33')]=_[_0x8de1('0x32')](_0x6e7f67['query']);_0x2094d0[_0x8de1('0x34')]=_[_0x8de1('0x35')](_0x2094d0[_0x8de1('0x31')],_0x2094d0['query']);_0x44e378[_0x8de1('0x36')]=_[_0x8de1('0x35')](_0x2094d0[_0x8de1('0x31')],qs[_0x8de1('0x37')](_0x6e7f67[_0x8de1('0x33')][_0x8de1('0x37')]));_0x44e378['attributes']=_0x44e378[_0x8de1('0x36')][_0x8de1('0x48')]?_0x44e378[_0x8de1('0x36')]:_0x2094d0['model'];_0x44e378[_0x8de1('0x39')]=qs[_0x8de1('0x3a')](_0x6e7f67[_0x8de1('0x33')][_0x8de1('0x3a')]);_0x44e378[_0x8de1('0x3b')]=qs['filters'](_[_0x8de1('0x4e')](_0x6e7f67[_0x8de1('0x33')],_0x2094d0['filters']));if(_0x6e7f67[_0x8de1('0x33')][_0x8de1('0x3c')]){_0x44e378[_0x8de1('0x3b')]=_['merge'](_0x44e378[_0x8de1('0x3b')],{'$or':_[_0x8de1('0x2f')](_0x44e378[_0x8de1('0x36')],function(_0x2d1881){var _0x18528d={};_0x18528d[_0x2d1881]={'$like':'%'+_0x6e7f67[_0x8de1('0x33')][_0x8de1('0x3c')]+'%'};return _0x18528d;})});}_0x44e378=_[_0x8de1('0x3d')]({},_0x44e378,_0x6e7f67[_0x8de1('0x3f')]);return _0x27c020[_0x8de1('0x4c')](_0x44e378);}})['then'](function(_0x5be04a){if(_0x5be04a){_0x411fbf=_0x5be04a[_0x8de1('0x48')];if(!_0x6e7f67[_0x8de1('0x33')][_0x8de1('0x4f')](_0x8de1('0x38'))){_0x44e378['limit']=qs['limit'](_0x6e7f67[_0x8de1('0x33')][_0x8de1('0x21')]);_0x44e378['offset']=qs[_0x8de1('0x1f')](_0x6e7f67[_0x8de1('0x33')]['offset']);}return _0x27c020['getConfigurations'](_0x44e378);}})[_0x8de1('0x29')](function(_0x5a89b2){if(_0x5a89b2){return _0x5a89b2?{'count':_0x411fbf,'rows':_0x5a89b2}:null;}})[_0x8de1('0x29')](respondWithResult(_0x5e0ced,null))[_0x8de1('0x49')](handleError(_0x5e0ced,null));};exports[_0x8de1('0x50')]=function(_0x5eed21,_0x3da51e,_0x5101f9){if(_0x5eed21[_0x8de1('0x4a')]['id']){delete _0x5eed21['body']['id'];}return db['SalesforceAccount'][_0x8de1('0x51')]({'where':{'id':_0x5eed21[_0x8de1('0x46')]['id']}})[_0x8de1('0x29')](handleEntityNotFound(_0x3da51e,null))['then'](function(_0x1855b1){if(_0x1855b1){_0x5eed21['body']['AccountId']=_0x1855b1['id'];_0x5eed21[_0x8de1('0x4a')]['Subjects']=integrations[_0x8de1('0x52')](_0x5eed21['body'][_0x8de1('0x53')],_0x5eed21[_0x8de1('0x4a')]['type']);_0x5eed21[_0x8de1('0x4a')]['Descriptions']=integrations['getDescriptions'](_0x5eed21['body'][_0x8de1('0x53')],_0x5eed21[_0x8de1('0x4a')]['type']);return db[_0x8de1('0x4d')][_0x8de1('0x54')](_0x5eed21[_0x8de1('0x4a')],{'include':[{'model':db['SalesforceField'],'as':_0x8de1('0x55')},{'model':db['SalesforceField'],'as':_0x8de1('0x56')}]});}return null;})[_0x8de1('0x29')](respondWithResult(_0x3da51e,null))[_0x8de1('0x49')](handleError(_0x3da51e,null));};exports[_0x8de1('0x57')]=function(_0x218413,_0x42db4d,_0x1c05ff){var _0x32d6fc;var _0x43e495='';var _0xebe00b=_0x8de1('0x58');return db['SalesforceAccount'][_0x8de1('0x51')]({'where':{'id':_0x218413['params']['id']},'attributes':['id',_0x8de1('0x59'),_0x8de1('0x5a'),'clientSecret',_0x8de1('0x5b'),_0x8de1('0x5c'),_0x8de1('0x5d')]})[_0x8de1('0x29')](handleEntityNotFound(_0x42db4d,null))[_0x8de1('0x29')](function(_0x1b391a){if(_0x1b391a){_0x43e495=_0x1b391a[_0x8de1('0x59')];var _0x3a99f5=_0x43e495[_0x8de1('0x5e')](-0x1);if(_0x3a99f5==='/'){_0x43e495=_0x43e495['substring'](0x0,_0x43e495[_0x8de1('0x5f')](_0x3a99f5));}_0x32d6fc=new jsforce[(_0x8de1('0x60'))]({'oauth2':{'loginUrl':_0x43e495,'clientId':_0x1b391a[_0x8de1('0x5a')],'clientSecret':_0x1b391a[_0x8de1('0x61')]}});return _0x32d6fc[_0x8de1('0x62')](_0x1b391a[_0x8de1('0x5b')],_0x1b391a[_0x8de1('0x5c')][_0x8de1('0x63')](_0x1b391a['securityToken']));}})['then'](function(_0x1b83ad){if(_0x1b83ad){if(!_[_0x8de1('0x64')](_0x218413['query'][_0x8de1('0x65')])){_0xebe00b=_0x218413[_0x8de1('0x33')][_0x8de1('0x65')];}return _0x32d6fc[_0x8de1('0x66')](_0xebe00b)[_0x8de1('0x67')]();}})[_0x8de1('0x29')](function(_0x3f830e){var _0x599b73=[_0x8de1('0x68'),'ActivityDate',_0x8de1('0x69'),_0x8de1('0x6a'),_0x8de1('0x6b'),_0x8de1('0x6c')];var _0x31b168=[_0x8de1('0x6d'),'int',_0x8de1('0x6e'),_0x8de1('0x6f'),_0x8de1('0x70'),_0x8de1('0x71'),_0x8de1('0x72')];if(_0x3f830e){_[_0x8de1('0x73')](_0x3f830e[_0x8de1('0x37')],function(_0x1aa13f){return _0x599b73['includes'](_0x1aa13f[_0x8de1('0x2c')])||!_0x31b168[_0x8de1('0x74')](_0x1aa13f[_0x8de1('0x75')]);});return{'count':_0x3f830e[_0x8de1('0x37')][_0x8de1('0x48')],'rows':_[_0x8de1('0x2f')](_0x3f830e[_0x8de1('0x37')],function(_0x54592f){return{'id':_0x54592f[_0x8de1('0x2c')],'name':_0x54592f[_0x8de1('0x76')],'custom':_0x54592f[_0x8de1('0x77')],'options':_0x54592f['picklistValues'][_0x8de1('0x48')]>0x0?_['map'](_0x54592f[_0x8de1('0x78')],function(_0x851e98){return{'name':_0x851e98[_0x8de1('0x76')],'value':_0x851e98[_0x8de1('0x79')]};}):_0x54592f[_0x8de1('0x75')]==_0x8de1('0x6f')?[{'name':_0x8de1('0x7a'),'value':_0x8de1('0x7b')},{'name':_0x8de1('0x7c'),'value':_0x8de1('0x7d')}]:[]};})};}})['then'](respondWithResult(_0x42db4d,null))[_0x8de1('0x49')](function(_0xba4d11){var _0x940701=_0x218413[_0x8de1('0x33')][_0x8de1('0x7e')]?0x1f4:_0xba4d11[_0x8de1('0x7f')]||0x1f4;logger[_0x8de1('0x2a')]('getFields,\x20%s,\x20%s,\x20%s',_0x8de1('0x57'),_0x940701,JSON['stringify'](_0xba4d11));delete _0xba4d11[_0x8de1('0x2c')];if(_0x940701===0x191){_0x940701=0x190;}_0x42db4d[_0x8de1('0x1c')](_0x940701)[_0x8de1('0x2d')](_0x218413[_0x8de1('0x33')]['test']?{'message':_0x8de1('0x80'),'statusCode':_0xba4d11[_0x8de1('0x7f')]}:_0xba4d11);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 2c73cd9..68788bb 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 _0x867f=['api','moment','bluebird','request-promise','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0x867f,0x7f));var _0xf867=function(_0x5c8a11,_0x10805f){_0x5c8a11=_0x5c8a11-0x0;var _0x116b22=_0x867f[_0x5c8a11];return _0x116b22;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var logger=require(_0xf867('0x2'))(_0xf867('0x3'));var moment=require(_0xf867('0x4'));var BPromise=require(_0xf867('0x5'));var rp=require(_0xf867('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf867('0x7'));var integrations=require(_0xf867('0x8'));module[_0xf867('0x9')]=function(_0x254e82,_0x5a1a44){return _0x254e82[_0xf867('0xa')](_0xf867('0xb'),attributes,{'tableName':_0xf867('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b21=['../../config/logger','moment','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','util'];(function(_0x419825,_0x409143){var _0xde8890=function(_0x44f679){while(--_0x44f679){_0x419825['push'](_0x419825['shift']());}};_0xde8890(++_0x409143);}(_0x0b21,0x6d));var _0x10b2=function(_0x3fa93,_0x3750a1){_0x3fa93=_0x3fa93-0x0;var _0x476e37=_0x0b21[_0x3fa93];return _0x476e37;};'use strict';var _=require('lodash');var util=require(_0x10b2('0x0'));var logger=require(_0x10b2('0x1'))('api');var moment=require(_0x10b2('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x10b2('0x3'));var rimraf=require(_0x10b2('0x4'));var config=require('../../config/environment');var attributes=require(_0x10b2('0x5'));var integrations=require(_0x10b2('0x6'));module[_0x10b2('0x7')]=function(_0x2cba34,_0x3137c4){return _0x2cba34[_0x10b2('0x8')](_0x10b2('0x9'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 724315f..5ee181f 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 _0x6aaa=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','raw','options','where','include','map','model','attributes','debug','find','ShowSalesforceAccount'];(function(_0x489812,_0x16bc1b){var _0x21468f=function(_0x115431){while(--_0x115431){_0x489812['push'](_0x489812['shift']());}};_0x21468f(++_0x16bc1b);}(_0x6aaa,0xd8));var _0xa6aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6aaa[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa6aa('0x0'));var util=require(_0xa6aa('0x1'));var moment=require(_0xa6aa('0x2'));var BPromise=require(_0xa6aa('0x3'));var rs=require(_0xa6aa('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa6aa('0x5'))['db'];var utils=require(_0xa6aa('0x6'));var logger=require(_0xa6aa('0x7'))(_0xa6aa('0x8'));var config=require('../../config/environment');var jayson=require(_0xa6aa('0x9'));var client=jayson[_0xa6aa('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1267d8,_0x4b691a,_0x1700f8){return new BPromise(function(_0xddfe17,_0x1972ef){return client[_0xa6aa('0xb')](_0x1267d8,_0x1700f8)[_0xa6aa('0xc')](function(_0x17d2b5){logger['info'](_0xa6aa('0xd'),_0x4b691a,_0xa6aa('0xe'));logger['debug'](_0xa6aa('0xf'),_0x4b691a,_0xa6aa('0xe'),JSON[_0xa6aa('0x10')](_0x17d2b5));if(_0x17d2b5[_0xa6aa('0x11')]){if(_0x17d2b5[_0xa6aa('0x11')][_0xa6aa('0x12')]===0x1f4){logger['error'](_0xa6aa('0xd'),_0x4b691a,_0x17d2b5[_0xa6aa('0x11')]['message']);return _0x1972ef(_0x17d2b5[_0xa6aa('0x11')]['message']);}logger[_0xa6aa('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x4b691a,_0x17d2b5[_0xa6aa('0x11')][_0xa6aa('0x13')]);return _0xddfe17(_0x17d2b5[_0xa6aa('0x11')]['message']);}else{logger[_0xa6aa('0x14')](_0xa6aa('0xd'),_0x4b691a,_0xa6aa('0xe'));_0xddfe17(_0x17d2b5[_0xa6aa('0x15')][_0xa6aa('0x13')]);}})[_0xa6aa('0x16')](function(_0x40db7e){logger[_0xa6aa('0x11')](_0xa6aa('0xd'),_0x4b691a,_0x40db7e);_0x1972ef(_0x40db7e);});});}exports[_0xa6aa('0x17')]=function(_0x3d99a3){var _0x12eba3=this;return new Promise(function(_0x56f64a,_0x533129){return db[_0xa6aa('0x18')][_0xa6aa('0x19')]({'raw':_0x3d99a3['options']?_0x3d99a3['options'][_0xa6aa('0x1a')]===undefined?!![]:![]:!![],'where':_0x3d99a3[_0xa6aa('0x1b')]?_0x3d99a3[_0xa6aa('0x1b')][_0xa6aa('0x1c')]||null:null,'attributes':_0x3d99a3[_0xa6aa('0x1b')]?_0x3d99a3[_0xa6aa('0x1b')]['attributes']||null:null,'limit':_0x3d99a3[_0xa6aa('0x1b')]?_0x3d99a3[_0xa6aa('0x1b')]['limit']||null:null,'include':_0x3d99a3[_0xa6aa('0x1b')]?_0x3d99a3[_0xa6aa('0x1b')][_0xa6aa('0x1d')]?_[_0xa6aa('0x1e')](_0x3d99a3[_0xa6aa('0x1b')][_0xa6aa('0x1d')],function(_0x38aaa9){return{'model':db[_0x38aaa9[_0xa6aa('0x1f')]],'as':_0x38aaa9['as'],'attributes':_0x38aaa9[_0xa6aa('0x20')],'include':_0x38aaa9[_0xa6aa('0x1d')]?_['map'](_0x38aaa9[_0xa6aa('0x1d')],function(_0x2f4c9b){return{'model':db[_0x2f4c9b['model']],'as':_0x2f4c9b['as'],'attributes':_0x2f4c9b[_0xa6aa('0x20')],'include':_0x2f4c9b[_0xa6aa('0x1d')]?_[_0xa6aa('0x1e')](_0x2f4c9b['include'],function(_0x1914c5){return{'model':db[_0x1914c5['model']],'as':_0x1914c5['as'],'attributes':_0x1914c5['attributes']};}):[]};}):[]};}):[]:[]})[_0xa6aa('0xc')](function(_0x494426){logger[_0xa6aa('0x14')](_0xa6aa('0x17'),_0x3d99a3);logger[_0xa6aa('0x21')](_0xa6aa('0x17'),_0x3d99a3,JSON[_0xa6aa('0x10')](_0x494426));_0x56f64a(_0x494426);})[_0xa6aa('0x16')](function(_0x102986){logger[_0xa6aa('0x11')](_0xa6aa('0x17'),_0x102986[_0xa6aa('0x13')],_0x3d99a3);_0x533129(_0x12eba3[_0xa6aa('0x11')](0x1f4,_0x102986[_0xa6aa('0x13')]));});});};exports['ShowSalesforceAccount']=function(_0x430fe3){var _0x1d1a12=this;return new Promise(function(_0x49ab2b,_0x43e5c6){return db[_0xa6aa('0x18')][_0xa6aa('0x22')]({'raw':_0x430fe3['options']?_0x430fe3[_0xa6aa('0x1b')][_0xa6aa('0x1a')]===undefined?!![]:![]:!![],'where':_0x430fe3['options']?_0x430fe3[_0xa6aa('0x1b')][_0xa6aa('0x1c')]||null:null,'attributes':_0x430fe3[_0xa6aa('0x1b')]?_0x430fe3[_0xa6aa('0x1b')]['attributes']||null:null,'include':_0x430fe3[_0xa6aa('0x1b')]?_0x430fe3['options'][_0xa6aa('0x1d')]?_[_0xa6aa('0x1e')](_0x430fe3[_0xa6aa('0x1b')][_0xa6aa('0x1d')],function(_0x522fbe){return{'model':db[_0x522fbe[_0xa6aa('0x1f')]],'as':_0x522fbe['as'],'attributes':_0x522fbe[_0xa6aa('0x20')],'include':_0x522fbe['include']?_[_0xa6aa('0x1e')](_0x522fbe[_0xa6aa('0x1d')],function(_0x489727){return{'model':db[_0x489727[_0xa6aa('0x1f')]],'as':_0x489727['as'],'attributes':_0x489727['attributes'],'include':_0x489727[_0xa6aa('0x1d')]?_[_0xa6aa('0x1e')](_0x489727[_0xa6aa('0x1d')],function(_0x3f3138){return{'model':db[_0x3f3138[_0xa6aa('0x1f')]],'as':_0x3f3138['as'],'attributes':_0x3f3138[_0xa6aa('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa6aa('0xc')](function(_0x26c24e){logger[_0xa6aa('0x14')](_0xa6aa('0x23'),_0x430fe3);logger[_0xa6aa('0x21')](_0xa6aa('0x23'),_0x430fe3,JSON[_0xa6aa('0x10')](_0x26c24e));_0x49ab2b(_0x26c24e);})[_0xa6aa('0x16')](function(_0x1f0f06){logger['error'](_0xa6aa('0x23'),_0x1f0f06[_0xa6aa('0x13')],_0x430fe3);_0x43e5c6(_0x1d1a12[_0xa6aa('0x11')](0x1f4,_0x1f0f06[_0xa6aa('0x13')]));});});}; \ No newline at end of file +var _0x0c6c=['then','ShowSalesforceAccount','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetSalesforceAccount','findAll','options','raw','where','limit','map','attributes','include','model','debug','stringify','SalesforceAccount','find'];(function(_0x19a49f,_0x444d74){var _0x5351ae=function(_0x58b1ed){while(--_0x58b1ed){_0x19a49f['push'](_0x19a49f['shift']());}};_0x5351ae(++_0x444d74);}(_0x0c6c,0x1e2));var _0xc0c6=function(_0x5871f9,_0x28ccb7){_0x5871f9=_0x5871f9-0x0;var _0x8fd1c0=_0x0c6c[_0x5871f9];return _0x8fd1c0;};'use strict';var _=require(_0xc0c6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc0c6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc0c6('0x2'));var db=require(_0xc0c6('0x3'))['db'];var utils=require(_0xc0c6('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc0c6('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xc0c6('0x6')][_0xc0c6('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x12dc5f,_0x389944,_0x1ea381){return new BPromise(function(_0x13da87,_0x5e3f6c){return client['request'](_0x12dc5f,_0x1ea381)['then'](function(_0x323706){logger[_0xc0c6('0x8')](_0xc0c6('0x9'),_0x389944,_0xc0c6('0xa'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x389944,_0xc0c6('0xa'),JSON['stringify'](_0x323706));if(_0x323706[_0xc0c6('0xb')]){if(_0x323706[_0xc0c6('0xb')][_0xc0c6('0xc')]===0x1f4){logger[_0xc0c6('0xb')](_0xc0c6('0x9'),_0x389944,_0x323706[_0xc0c6('0xb')][_0xc0c6('0xd')]);return _0x5e3f6c(_0x323706['error'][_0xc0c6('0xd')]);}logger[_0xc0c6('0xb')](_0xc0c6('0x9'),_0x389944,_0x323706[_0xc0c6('0xb')][_0xc0c6('0xd')]);return _0x13da87(_0x323706[_0xc0c6('0xb')][_0xc0c6('0xd')]);}else{logger[_0xc0c6('0x8')](_0xc0c6('0x9'),_0x389944,'request\x20sent');_0x13da87(_0x323706[_0xc0c6('0xe')]['message']);}})[_0xc0c6('0xf')](function(_0x4152a2){logger[_0xc0c6('0xb')](_0xc0c6('0x9'),_0x389944,_0x4152a2);_0x5e3f6c(_0x4152a2);});});}exports[_0xc0c6('0x10')]=function(_0x557385){var _0x74b15f=this;return new Promise(function(_0x377fef,_0xfb4afa){return db['SalesforceAccount'][_0xc0c6('0x11')]({'raw':_0x557385[_0xc0c6('0x12')]?_0x557385['options'][_0xc0c6('0x13')]===undefined?!![]:![]:!![],'where':_0x557385[_0xc0c6('0x12')]?_0x557385[_0xc0c6('0x12')][_0xc0c6('0x14')]||null:null,'attributes':_0x557385[_0xc0c6('0x12')]?_0x557385[_0xc0c6('0x12')]['attributes']||null:null,'limit':_0x557385[_0xc0c6('0x12')]?_0x557385[_0xc0c6('0x12')][_0xc0c6('0x15')]||null:null,'include':_0x557385[_0xc0c6('0x12')]?_0x557385[_0xc0c6('0x12')]['include']?_[_0xc0c6('0x16')](_0x557385[_0xc0c6('0x12')]['include'],function(_0x5e00f3){return{'model':db[_0x5e00f3['model']],'as':_0x5e00f3['as'],'attributes':_0x5e00f3[_0xc0c6('0x17')],'include':_0x5e00f3[_0xc0c6('0x18')]?_[_0xc0c6('0x16')](_0x5e00f3[_0xc0c6('0x18')],function(_0x5712be){return{'model':db[_0x5712be['model']],'as':_0x5712be['as'],'attributes':_0x5712be[_0xc0c6('0x17')],'include':_0x5712be['include']?_[_0xc0c6('0x16')](_0x5712be[_0xc0c6('0x18')],function(_0x148570){return{'model':db[_0x148570[_0xc0c6('0x19')]],'as':_0x148570['as'],'attributes':_0x148570[_0xc0c6('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e9996){logger[_0xc0c6('0x8')](_0xc0c6('0x10'),_0x557385);logger[_0xc0c6('0x1a')](_0xc0c6('0x10'),_0x557385,JSON[_0xc0c6('0x1b')](_0x5e9996));_0x377fef(_0x5e9996);})[_0xc0c6('0xf')](function(_0x39ea06){logger[_0xc0c6('0xb')]('GetSalesforceAccount',_0x39ea06[_0xc0c6('0xd')],_0x557385);_0xfb4afa(_0x74b15f[_0xc0c6('0xb')](0x1f4,_0x39ea06['message']));});});};exports['ShowSalesforceAccount']=function(_0x11529d){var _0x5a5a0c=this;return new Promise(function(_0x9799fa,_0x306deb){return db[_0xc0c6('0x1c')][_0xc0c6('0x1d')]({'raw':_0x11529d[_0xc0c6('0x12')]?_0x11529d[_0xc0c6('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x11529d[_0xc0c6('0x12')]?_0x11529d[_0xc0c6('0x12')][_0xc0c6('0x14')]||null:null,'attributes':_0x11529d[_0xc0c6('0x12')]?_0x11529d['options'][_0xc0c6('0x17')]||null:null,'include':_0x11529d['options']?_0x11529d['options'][_0xc0c6('0x18')]?_[_0xc0c6('0x16')](_0x11529d['options'][_0xc0c6('0x18')],function(_0x5cb777){return{'model':db[_0x5cb777[_0xc0c6('0x19')]],'as':_0x5cb777['as'],'attributes':_0x5cb777[_0xc0c6('0x17')],'include':_0x5cb777['include']?_[_0xc0c6('0x16')](_0x5cb777[_0xc0c6('0x18')],function(_0x250243){return{'model':db[_0x250243[_0xc0c6('0x19')]],'as':_0x250243['as'],'attributes':_0x250243[_0xc0c6('0x17')],'include':_0x250243[_0xc0c6('0x18')]?_[_0xc0c6('0x16')](_0x250243['include'],function(_0x3fcf5e){return{'model':db[_0x3fcf5e[_0xc0c6('0x19')]],'as':_0x3fcf5e['as'],'attributes':_0x3fcf5e[_0xc0c6('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc0c6('0x1e')](function(_0x423fcb){logger[_0xc0c6('0x8')]('ShowSalesforceAccount',_0x11529d);logger[_0xc0c6('0x1a')](_0xc0c6('0x1f'),_0x11529d,JSON['stringify'](_0x423fcb));_0x9799fa(_0x423fcb);})[_0xc0c6('0xf')](function(_0x282707){logger['error'](_0xc0c6('0x1f'),_0x282707[_0xc0c6('0xd')],_0x11529d);_0x306deb(_0x5a5a0c[_0xc0c6('0xb')](0x1f4,_0x282707[_0xc0c6('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 0ff05e1..54a6012 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 _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x82010,_0x12d992){var _0x51942d=function(_0x965b50){while(--_0x965b50){_0x82010['push'](_0x82010['shift']());}};_0x51942d(++_0x12d992);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5f66[_0x3947c9];return _0x2e7871;};'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('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file +var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x89f1ae,_0x15cc30){var _0xc85802=function(_0x3eb8a3){while(--_0x3eb8a3){_0x89f1ae['push'](_0x89f1ae['shift']());}};_0xc85802(++_0x15cc30);}(_0x5f2f,0x73));var _0xf5f2=function(_0x582974,_0x5968cb){_0x582974=_0x582974-0x0;var _0x364d64=_0x5f2f[_0x582974];return _0x364d64;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('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 a653303..52ca175 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 _0x3a79=['account_contact_lead','nothing','lead','account','exports','STRING','ENUM','Task','Case','contact_lead','contact'];(function(_0x1dc24d,_0x541fa4){var _0x5d7fb2=function(_0x7ccd26){while(--_0x7ccd26){_0x1dc24d['push'](_0x1dc24d['shift']());}};_0x5d7fb2(++_0x541fa4);}(_0x3a79,0xca));var _0x93a7=function(_0x175893,_0x1c0d91){_0x175893=_0x175893-0x0;var _0x53c92f=_0x3a79[_0x175893];return _0x53c92f;};'use strict';var Sequelize=require('sequelize');module[_0x93a7('0x0')]={'name':{'type':Sequelize[_0x93a7('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x93a7('0x2')](_0x93a7('0x3'),_0x93a7('0x4')),'defaultValue':_0x93a7('0x3')},'moduleSearch':{'type':Sequelize[_0x93a7('0x2')](_0x93a7('0x5'),_0x93a7('0x6'),'lead',_0x93a7('0x7'),'account'),'defaultValue':_0x93a7('0x5')},'moduleCreate':{'type':Sequelize[_0x93a7('0x2')](_0x93a7('0x8'),_0x93a7('0x6'),_0x93a7('0x9'),_0x93a7('0xa')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x93a7('0x1')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x93a7('0x1')]}}; \ No newline at end of file +var _0xd672=['Task','contact_lead','contact','lead','account_contact_lead','nothing','STRING','ENUM','Case'];(function(_0x1b4561,_0x481c55){var _0x5d232e=function(_0x187a9c){while(--_0x187a9c){_0x1b4561['push'](_0x1b4561['shift']());}};_0x5d232e(++_0x481c55);}(_0xd672,0x96));var _0x2d67=function(_0xf60a6b,_0x3a9645){_0xf60a6b=_0xf60a6b-0x0;var _0x5a89a3=_0xd672[_0xf60a6b];return _0x5a89a3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2d67('0x0')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x2d67('0x1')]('Task',_0x2d67('0x2')),'defaultValue':_0x2d67('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x2d67('0x4'),_0x2d67('0x5'),_0x2d67('0x6'),_0x2d67('0x7'),'account'),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x2d67('0x1')](_0x2d67('0x8'),_0x2d67('0x5'),_0x2d67('0x6'),'account'),'defaultValue':_0x2d67('0x6')},'leadId':{'type':Sequelize[_0x2d67('0x0')]},'additionalSearchAccount':{'type':Sequelize[_0x2d67('0x0')]},'additionalSearchContact':{'type':Sequelize[_0x2d67('0x0')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 149ec62..b67eb4f 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 _0xff16=['apply','reject','save','then','destroy','stack','name','send','map','SalesforceConfiguration','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','update','getFields','SalesforceField','order','filter','getSubjects','findOne','pick','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set'];(function(_0x52193c,_0x16ab99){var _0x293ef1=function(_0x37af70){while(--_0x37af70){_0x52193c['push'](_0x52193c['shift']());}};_0x293ef1(++_0x16ab99);}(_0xff16,0x7f));var _0x6ff1=function(_0x1c61c3,_0x140c4c){_0x1c61c3=_0x1c61c3-0x0;var _0x5c2db2=_0xff16[_0x1c61c3];return _0x5c2db2;};'use strict';var emlformat=require(_0x6ff1('0x0'));var rimraf=require(_0x6ff1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6ff1('0x2'));var rp=require(_0x6ff1('0x3'));var moment=require(_0x6ff1('0x4'));var BPromise=require(_0x6ff1('0x5'));var Mustache=require(_0x6ff1('0x6'));var util=require(_0x6ff1('0x7'));var path=require(_0x6ff1('0x8'));var sox=require(_0x6ff1('0x9'));var csv=require('to-csv');var ejs=require(_0x6ff1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ff1('0xb'));var squel=require(_0x6ff1('0xc'));var crypto=require(_0x6ff1('0xd'));var jsforce=require(_0x6ff1('0xe'));var deskjs=require(_0x6ff1('0xf'));var toCsv=require(_0x6ff1('0x10'));var querystring=require(_0x6ff1('0x11'));var Papa=require(_0x6ff1('0x12'));var Redis=require('ioredis');var authService=require(_0x6ff1('0x13'));var qs=require(_0x6ff1('0x14'));var as=require(_0x6ff1('0x15'));var hardwareService=require(_0x6ff1('0x16'));var logger=require(_0x6ff1('0x17'))(_0x6ff1('0x18'));var utils=require(_0x6ff1('0x19'));var config=require(_0x6ff1('0x1a'));var licenseUtil=require(_0x6ff1('0x1b'));var db=require(_0x6ff1('0x1c'))['db'];function respondWithStatusCode(_0x4e8484,_0x5cf649){_0x5cf649=_0x5cf649||0xcc;return function(_0x5dacd6){if(_0x5dacd6){return _0x4e8484['sendStatus'](_0x5cf649);}return _0x4e8484[_0x6ff1('0x1d')](_0x5cf649)[_0x6ff1('0x1e')]();};}function respondWithResult(_0x1451af,_0x543e07){_0x543e07=_0x543e07||0xc8;return function(_0x58952d){if(_0x58952d){return _0x1451af['status'](_0x543e07)[_0x6ff1('0x1f')](_0x58952d);}};}function respondWithFilteredResult(_0x1ec8e9,_0x23112d){return function(_0x29e6c7){if(_0x29e6c7){var _0x36fa15=typeof _0x23112d[_0x6ff1('0x20')]==='undefined'&&typeof _0x23112d[_0x6ff1('0x21')]===_0x6ff1('0x22');var _0x4751b9=_0x29e6c7[_0x6ff1('0x23')];var _0xe5d26e=_0x36fa15?0x0:_0x23112d[_0x6ff1('0x20')];var _0x5041d7=_0x36fa15?_0x29e6c7[_0x6ff1('0x23')]:_0x23112d[_0x6ff1('0x20')]+_0x23112d[_0x6ff1('0x21')];var _0x256457;if(_0x5041d7>=_0x4751b9){_0x5041d7=_0x4751b9;_0x256457=0xc8;}else{_0x256457=0xce;}_0x1ec8e9[_0x6ff1('0x1d')](_0x256457);return _0x1ec8e9[_0x6ff1('0x24')]('Content-Range',_0xe5d26e+'-'+_0x5041d7+'/'+_0x4751b9)[_0x6ff1('0x1f')](_0x29e6c7);}return null;};}function patchUpdates(_0x54c961){return function(_0x328325){try{jsonpatch[_0x6ff1('0x25')](_0x328325,_0x54c961,!![]);}catch(_0x2d3131){return BPromise[_0x6ff1('0x26')](_0x2d3131);}return _0x328325[_0x6ff1('0x27')]();};}function saveUpdates(_0x47fd1f,_0x56027f){return function(_0x561bcd){if(_0x561bcd){return _0x561bcd['update'](_0x47fd1f)[_0x6ff1('0x28')](function(_0xbdd73e){return _0xbdd73e;});}return null;};}function removeEntity(_0x4b3d22,_0x41b160){return function(_0x1ec4f1){if(_0x1ec4f1){return _0x1ec4f1[_0x6ff1('0x29')]()[_0x6ff1('0x28')](function(){_0x4b3d22[_0x6ff1('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13acb3,_0x324645){return function(_0x13ff47){if(!_0x13ff47){_0x13acb3['sendStatus'](0x194);}return _0x13ff47;};}function handleError(_0x512759,_0x17036d){_0x17036d=_0x17036d||0x1f4;return function(_0x2705d4){logger['error'](_0x2705d4[_0x6ff1('0x2a')]);if(_0x2705d4[_0x6ff1('0x2b')]){delete _0x2705d4['name'];}_0x512759[_0x6ff1('0x1d')](_0x17036d)[_0x6ff1('0x2c')](_0x2705d4);};}exports['index']=function(_0x3cc69e,_0x3597c6){var _0x2f7006={},_0x193c09={},_0x4bf689={'count':0x0,'rows':[]};var _0x23df55=_[_0x6ff1('0x2d')](db[_0x6ff1('0x2e')][_0x6ff1('0x2f')],function(_0x224967){return{'name':_0x224967['fieldName'],'type':_0x224967[_0x6ff1('0x30')][_0x6ff1('0x31')]};});_0x193c09[_0x6ff1('0x32')]=_['map'](_0x23df55,_0x6ff1('0x2b'));_0x193c09['query']=_[_0x6ff1('0x33')](_0x3cc69e[_0x6ff1('0x34')]);_0x193c09[_0x6ff1('0x35')]=_[_0x6ff1('0x36')](_0x193c09[_0x6ff1('0x32')],_0x193c09[_0x6ff1('0x34')]);_0x2f7006[_0x6ff1('0x37')]=_['intersection'](_0x193c09['model'],qs[_0x6ff1('0x38')](_0x3cc69e[_0x6ff1('0x34')][_0x6ff1('0x38')]));_0x2f7006[_0x6ff1('0x37')]=_0x2f7006[_0x6ff1('0x37')][_0x6ff1('0x39')]?_0x2f7006['attributes']:_0x193c09[_0x6ff1('0x32')];if(!_0x3cc69e[_0x6ff1('0x34')][_0x6ff1('0x3a')]('nolimit')){_0x2f7006[_0x6ff1('0x21')]=qs['limit'](_0x3cc69e[_0x6ff1('0x34')]['limit']);_0x2f7006[_0x6ff1('0x20')]=qs[_0x6ff1('0x20')](_0x3cc69e['query']['offset']);}_0x2f7006['order']=qs[_0x6ff1('0x3b')](_0x3cc69e[_0x6ff1('0x34')][_0x6ff1('0x3b')]);_0x2f7006[_0x6ff1('0x3c')]=qs[_0x6ff1('0x35')](_['pick'](_0x3cc69e[_0x6ff1('0x34')],_0x193c09['filters']),_0x23df55);if(_0x3cc69e[_0x6ff1('0x34')]['filter']){_0x2f7006['where']=_[_0x6ff1('0x3d')](_0x2f7006[_0x6ff1('0x3c')],{'$or':_[_0x6ff1('0x2d')](_0x23df55,function(_0x91ddc7){if(_0x91ddc7[_0x6ff1('0x30')]!==_0x6ff1('0x3e')){var _0x4a18cf={};_0x4a18cf[_0x91ddc7[_0x6ff1('0x2b')]]={'$like':'%'+_0x3cc69e[_0x6ff1('0x34')]['filter']+'%'};return _0x4a18cf;}})});}_0x2f7006=_['merge']({},_0x2f7006,_0x3cc69e[_0x6ff1('0x3f')]);var _0x4c41b9={'where':_0x2f7006[_0x6ff1('0x3c')]};return db[_0x6ff1('0x2e')][_0x6ff1('0x23')](_0x4c41b9)[_0x6ff1('0x28')](function(_0x3baaba){_0x4bf689[_0x6ff1('0x23')]=_0x3baaba;if(_0x3cc69e['query'][_0x6ff1('0x40')]){_0x2f7006[_0x6ff1('0x41')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x2f7006);})['then'](function(_0xc8ae37){_0x4bf689[_0x6ff1('0x42')]=_0xc8ae37;return _0x4bf689;})[_0x6ff1('0x28')](respondWithFilteredResult(_0x3597c6,_0x2f7006))[_0x6ff1('0x43')](handleError(_0x3597c6,null));};exports[_0x6ff1('0x44')]=function(_0x36f9a9,_0x259fbb){var _0x5afce5={'raw':![],'where':{'id':_0x36f9a9[_0x6ff1('0x45')]['id']}},_0x3f76c6={};_0x3f76c6[_0x6ff1('0x32')]=_[_0x6ff1('0x33')](db[_0x6ff1('0x2e')]['rawAttributes']);_0x3f76c6[_0x6ff1('0x34')]=_[_0x6ff1('0x33')](_0x36f9a9[_0x6ff1('0x34')]);_0x3f76c6[_0x6ff1('0x35')]=_[_0x6ff1('0x36')](_0x3f76c6[_0x6ff1('0x32')],_0x3f76c6['query']);_0x5afce5[_0x6ff1('0x37')]=_[_0x6ff1('0x36')](_0x3f76c6['model'],qs[_0x6ff1('0x38')](_0x36f9a9['query'][_0x6ff1('0x38')]));_0x5afce5[_0x6ff1('0x37')]=_0x5afce5[_0x6ff1('0x37')][_0x6ff1('0x39')]?_0x5afce5['attributes']:_0x3f76c6['model'];if(_0x36f9a9[_0x6ff1('0x34')]['includeAll']){_0x5afce5[_0x6ff1('0x41')]=[{'all':!![]}];}_0x5afce5=_['merge']({},_0x5afce5,_0x36f9a9['options']);return db[_0x6ff1('0x2e')][_0x6ff1('0x46')](_0x5afce5)[_0x6ff1('0x28')](handleEntityNotFound(_0x259fbb,null))[_0x6ff1('0x28')](respondWithResult(_0x259fbb,null))['catch'](handleError(_0x259fbb,null));};exports[_0x6ff1('0x47')]=function(_0x59a001,_0x5d500b){return db[_0x6ff1('0x2e')][_0x6ff1('0x47')](_0x59a001[_0x6ff1('0x48')],{})[_0x6ff1('0x28')](respondWithResult(_0x5d500b,0xc9))[_0x6ff1('0x43')](handleError(_0x5d500b,null));};exports[_0x6ff1('0x49')]=function(_0x5b0e81,_0x143492){if(_0x5b0e81['body']['id']){delete _0x5b0e81[_0x6ff1('0x48')]['id'];}return db[_0x6ff1('0x2e')][_0x6ff1('0x46')]({'where':{'id':_0x5b0e81[_0x6ff1('0x45')]['id']}})['then'](handleEntityNotFound(_0x143492,null))['then'](saveUpdates(_0x5b0e81['body'],null))[_0x6ff1('0x28')](respondWithResult(_0x143492,null))[_0x6ff1('0x43')](handleError(_0x143492,null));};exports[_0x6ff1('0x29')]=function(_0x44271d,_0x1521c8){return db[_0x6ff1('0x2e')]['find']({'where':{'id':_0x44271d['params']['id']}})['then'](handleEntityNotFound(_0x1521c8,null))[_0x6ff1('0x28')](removeEntity(_0x1521c8,null))[_0x6ff1('0x43')](handleError(_0x1521c8,null));};exports[_0x6ff1('0x4a')]=function(_0x880490,_0x5947a7,_0x2275ff){var _0x40a53a={};var _0x33a32f={};var _0x5cec60;var _0x2b62d6;return db[_0x6ff1('0x2e')]['findOne']({'where':{'id':_0x880490[_0x6ff1('0x45')]['id']}})[_0x6ff1('0x28')](handleEntityNotFound(_0x5947a7,null))['then'](function(_0x124653){if(_0x124653){_0x5cec60=_0x124653;_0x33a32f['model']=_[_0x6ff1('0x33')](db[_0x6ff1('0x4b')]['rawAttributes']);_0x33a32f['query']=_[_0x6ff1('0x33')](_0x880490[_0x6ff1('0x34')]);_0x33a32f['filters']=_[_0x6ff1('0x36')](_0x33a32f['model'],_0x33a32f[_0x6ff1('0x34')]);_0x40a53a[_0x6ff1('0x37')]=_[_0x6ff1('0x36')](_0x33a32f['model'],qs[_0x6ff1('0x38')](_0x880490[_0x6ff1('0x34')][_0x6ff1('0x38')]));_0x40a53a[_0x6ff1('0x37')]=_0x40a53a[_0x6ff1('0x37')]['length']?_0x40a53a[_0x6ff1('0x37')]:_0x33a32f[_0x6ff1('0x32')];_0x40a53a[_0x6ff1('0x4c')]=qs[_0x6ff1('0x3b')](_0x880490[_0x6ff1('0x34')][_0x6ff1('0x3b')]);_0x40a53a['where']=qs['filters'](_['pick'](_0x880490['query'],_0x33a32f[_0x6ff1('0x35')]));if(_0x880490[_0x6ff1('0x34')][_0x6ff1('0x4d')]){_0x40a53a[_0x6ff1('0x3c')]=_['merge'](_0x40a53a['where'],{'$or':_[_0x6ff1('0x2d')](_0x40a53a[_0x6ff1('0x37')],function(_0x5fb5d5){var _0x3bc400={};_0x3bc400[_0x5fb5d5]={'$like':'%'+_0x880490[_0x6ff1('0x34')][_0x6ff1('0x4d')]+'%'};return _0x3bc400;})});}_0x40a53a=_[_0x6ff1('0x3d')]({},_0x40a53a,_0x880490['options']);return _0x5cec60[_0x6ff1('0x4a')](_0x40a53a);}})['then'](function(_0x21e621){if(_0x21e621){_0x2b62d6=_0x21e621[_0x6ff1('0x39')];if(!_0x880490['query'][_0x6ff1('0x3a')]('nolimit')){_0x40a53a[_0x6ff1('0x21')]=qs[_0x6ff1('0x21')](_0x880490[_0x6ff1('0x34')]['limit']);_0x40a53a[_0x6ff1('0x20')]=qs[_0x6ff1('0x20')](_0x880490[_0x6ff1('0x34')][_0x6ff1('0x20')]);}return _0x5cec60[_0x6ff1('0x4a')](_0x40a53a);}})[_0x6ff1('0x28')](function(_0x2d2d41){if(_0x2d2d41){return _0x2d2d41?{'count':_0x2b62d6,'rows':_0x2d2d41}:null;}})[_0x6ff1('0x28')](respondWithResult(_0x5947a7,null))['catch'](handleError(_0x5947a7,null));};exports[_0x6ff1('0x4e')]=function(_0x2cd1f9,_0x40b24e,_0xa4fe61){var _0x3b2ac1={};var _0xcdbb07={};var _0x38d32e;var _0x1b78ee;return db[_0x6ff1('0x2e')][_0x6ff1('0x4f')]({'where':{'id':_0x2cd1f9['params']['id']}})[_0x6ff1('0x28')](handleEntityNotFound(_0x40b24e,null))['then'](function(_0x12252a){if(_0x12252a){_0x38d32e=_0x12252a;_0xcdbb07[_0x6ff1('0x32')]=_['keys'](db['SalesforceField'][_0x6ff1('0x2f')]);_0xcdbb07[_0x6ff1('0x34')]=_[_0x6ff1('0x33')](_0x2cd1f9[_0x6ff1('0x34')]);_0xcdbb07[_0x6ff1('0x35')]=_[_0x6ff1('0x36')](_0xcdbb07[_0x6ff1('0x32')],_0xcdbb07[_0x6ff1('0x34')]);_0x3b2ac1[_0x6ff1('0x37')]=_[_0x6ff1('0x36')](_0xcdbb07[_0x6ff1('0x32')],qs[_0x6ff1('0x38')](_0x2cd1f9['query'][_0x6ff1('0x38')]));_0x3b2ac1[_0x6ff1('0x37')]=_0x3b2ac1['attributes']['length']?_0x3b2ac1[_0x6ff1('0x37')]:_0xcdbb07['model'];_0x3b2ac1[_0x6ff1('0x4c')]=qs[_0x6ff1('0x3b')](_0x2cd1f9[_0x6ff1('0x34')][_0x6ff1('0x3b')]);_0x3b2ac1[_0x6ff1('0x3c')]=qs['filters'](_[_0x6ff1('0x50')](_0x2cd1f9[_0x6ff1('0x34')],_0xcdbb07[_0x6ff1('0x35')]));if(_0x2cd1f9['query'][_0x6ff1('0x4d')]){_0x3b2ac1['where']=_[_0x6ff1('0x3d')](_0x3b2ac1[_0x6ff1('0x3c')],{'$or':_['map'](_0x3b2ac1[_0x6ff1('0x37')],function(_0x1a9ff5){var _0x225aa0={};_0x225aa0[_0x1a9ff5]={'$like':'%'+_0x2cd1f9['query'][_0x6ff1('0x4d')]+'%'};return _0x225aa0;})});}_0x3b2ac1=_[_0x6ff1('0x3d')]({},_0x3b2ac1,_0x2cd1f9[_0x6ff1('0x3f')]);return _0x38d32e[_0x6ff1('0x4e')](_0x3b2ac1);}})[_0x6ff1('0x28')](function(_0x53c625){if(_0x53c625){_0x1b78ee=_0x53c625[_0x6ff1('0x39')];if(!_0x2cd1f9[_0x6ff1('0x34')][_0x6ff1('0x3a')]('nolimit')){_0x3b2ac1[_0x6ff1('0x21')]=qs[_0x6ff1('0x21')](_0x2cd1f9[_0x6ff1('0x34')][_0x6ff1('0x21')]);_0x3b2ac1[_0x6ff1('0x20')]=qs['offset'](_0x2cd1f9[_0x6ff1('0x34')][_0x6ff1('0x20')]);}return _0x38d32e[_0x6ff1('0x4e')](_0x3b2ac1);}})[_0x6ff1('0x28')](function(_0x4b2473){if(_0x4b2473){return _0x4b2473?{'count':_0x1b78ee,'rows':_0x4b2473}:null;}})[_0x6ff1('0x28')](respondWithResult(_0x40b24e,null))['catch'](handleError(_0x40b24e,null));};exports[_0x6ff1('0x51')]=function(_0x5103e3,_0x3ab05b,_0x2661ed){var _0x157db7={};var _0x4d6f81={};var _0x7ded5c;var _0x473db3;return db[_0x6ff1('0x2e')][_0x6ff1('0x4f')]({'where':{'id':_0x5103e3[_0x6ff1('0x45')]['id']}})['then'](handleEntityNotFound(_0x3ab05b,null))[_0x6ff1('0x28')](function(_0x518d65){if(_0x518d65){_0x7ded5c=_0x518d65;_0x4d6f81[_0x6ff1('0x32')]=_[_0x6ff1('0x33')](db['SalesforceField'][_0x6ff1('0x2f')]);_0x4d6f81[_0x6ff1('0x34')]=_[_0x6ff1('0x33')](_0x5103e3[_0x6ff1('0x34')]);_0x4d6f81['filters']=_[_0x6ff1('0x36')](_0x4d6f81[_0x6ff1('0x32')],_0x4d6f81['query']);_0x157db7[_0x6ff1('0x37')]=_[_0x6ff1('0x36')](_0x4d6f81[_0x6ff1('0x32')],qs[_0x6ff1('0x38')](_0x5103e3[_0x6ff1('0x34')][_0x6ff1('0x38')]));_0x157db7[_0x6ff1('0x37')]=_0x157db7[_0x6ff1('0x37')][_0x6ff1('0x39')]?_0x157db7[_0x6ff1('0x37')]:_0x4d6f81[_0x6ff1('0x32')];_0x157db7[_0x6ff1('0x4c')]=qs[_0x6ff1('0x3b')](_0x5103e3[_0x6ff1('0x34')][_0x6ff1('0x3b')]);_0x157db7[_0x6ff1('0x3c')]=qs[_0x6ff1('0x35')](_[_0x6ff1('0x50')](_0x5103e3[_0x6ff1('0x34')],_0x4d6f81['filters']));if(_0x5103e3[_0x6ff1('0x34')][_0x6ff1('0x4d')]){_0x157db7[_0x6ff1('0x3c')]=_[_0x6ff1('0x3d')](_0x157db7[_0x6ff1('0x3c')],{'$or':_[_0x6ff1('0x2d')](_0x157db7[_0x6ff1('0x37')],function(_0x1c47a5){var _0x6c22d={};_0x6c22d[_0x1c47a5]={'$like':'%'+_0x5103e3[_0x6ff1('0x34')][_0x6ff1('0x4d')]+'%'};return _0x6c22d;})});}_0x157db7=_[_0x6ff1('0x3d')]({},_0x157db7,_0x5103e3[_0x6ff1('0x3f')]);return _0x7ded5c['getDescriptions'](_0x157db7);}})[_0x6ff1('0x28')](function(_0x3c8e1e){if(_0x3c8e1e){_0x473db3=_0x3c8e1e[_0x6ff1('0x39')];if(!_0x5103e3['query'][_0x6ff1('0x3a')]('nolimit')){_0x157db7[_0x6ff1('0x21')]=qs[_0x6ff1('0x21')](_0x5103e3[_0x6ff1('0x34')][_0x6ff1('0x21')]);_0x157db7[_0x6ff1('0x20')]=qs[_0x6ff1('0x20')](_0x5103e3[_0x6ff1('0x34')][_0x6ff1('0x20')]);}return _0x7ded5c['getDescriptions'](_0x157db7);}})['then'](function(_0x533312){if(_0x533312){return _0x533312?{'count':_0x473db3,'rows':_0x533312}:null;}})[_0x6ff1('0x28')](respondWithResult(_0x3ab05b,null))[_0x6ff1('0x43')](handleError(_0x3ab05b,null));}; \ No newline at end of file +var _0x30e9=['order','sort','where','filters','pick','filter','merge','options','findAll','rows','show','params','keys','intersection','includeAll','find','create','body','catch','getFields','findOne','SalesforceField','getSubjects','getDescriptions','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','sendStatus','error','stack','name','map','SalesforceConfiguration','rawAttributes','type','model','query','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x17d0ca,_0x4214f7){var _0x382af5=function(_0x23737f){while(--_0x23737f){_0x17d0ca['push'](_0x17d0ca['shift']());}};_0x382af5(++_0x4214f7);}(_0x30e9,0x158));var _0x930e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x30e9[_0x30ae5e];return _0x1f2e93;};'use strict';var emlformat=require(_0x930e('0x0'));var rimraf=require(_0x930e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x930e('0x2'));var moment=require(_0x930e('0x3'));var BPromise=require(_0x930e('0x4'));var Mustache=require(_0x930e('0x5'));var util=require(_0x930e('0x6'));var path=require(_0x930e('0x7'));var sox=require(_0x930e('0x8'));var csv=require(_0x930e('0x9'));var ejs=require(_0x930e('0xa'));var fs=require('fs');var fs_extra=require(_0x930e('0xb'));var _=require(_0x930e('0xc'));var squel=require(_0x930e('0xd'));var crypto=require(_0x930e('0xe'));var jsforce=require(_0x930e('0xf'));var deskjs=require(_0x930e('0x10'));var toCsv=require(_0x930e('0x9'));var querystring=require(_0x930e('0x11'));var Papa=require(_0x930e('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x930e('0x13'));var as=require(_0x930e('0x14'));var hardwareService=require(_0x930e('0x15'));var logger=require(_0x930e('0x16'))(_0x930e('0x17'));var utils=require(_0x930e('0x18'));var config=require(_0x930e('0x19'));var licenseUtil=require(_0x930e('0x1a'));var db=require(_0x930e('0x1b'))['db'];function respondWithStatusCode(_0x37292c,_0x20fbb4){_0x20fbb4=_0x20fbb4||0xcc;return function(_0x367fe7){if(_0x367fe7){return _0x37292c['sendStatus'](_0x20fbb4);}return _0x37292c['status'](_0x20fbb4)[_0x930e('0x1c')]();};}function respondWithResult(_0x5d6c84,_0x44cb60){_0x44cb60=_0x44cb60||0xc8;return function(_0x5a5a99){if(_0x5a5a99){return _0x5d6c84[_0x930e('0x1d')](_0x44cb60)[_0x930e('0x1e')](_0x5a5a99);}};}function respondWithFilteredResult(_0x5a894c,_0x48b80d){return function(_0x44ebc0){if(_0x44ebc0){var _0x4afbbd=typeof _0x48b80d[_0x930e('0x1f')]===_0x930e('0x20')&&typeof _0x48b80d[_0x930e('0x21')]==='undefined';var _0x44d972=_0x44ebc0[_0x930e('0x22')];var _0xc1e33b=_0x4afbbd?0x0:_0x48b80d[_0x930e('0x1f')];var _0x3f9291=_0x4afbbd?_0x44ebc0[_0x930e('0x22')]:_0x48b80d[_0x930e('0x1f')]+_0x48b80d[_0x930e('0x21')];var _0x2d5614;if(_0x3f9291>=_0x44d972){_0x3f9291=_0x44d972;_0x2d5614=0xc8;}else{_0x2d5614=0xce;}_0x5a894c['status'](_0x2d5614);return _0x5a894c[_0x930e('0x23')](_0x930e('0x24'),_0xc1e33b+'-'+_0x3f9291+'/'+_0x44d972)[_0x930e('0x1e')](_0x44ebc0);}return null;};}function patchUpdates(_0x363d9a){return function(_0x44a430){try{jsonpatch['apply'](_0x44a430,_0x363d9a,!![]);}catch(_0x384178){return BPromise[_0x930e('0x25')](_0x384178);}return _0x44a430['save']();};}function saveUpdates(_0x4a19f7,_0x385ee8){return function(_0x19302c){if(_0x19302c){return _0x19302c[_0x930e('0x26')](_0x4a19f7)['then'](function(_0x1586f9){return _0x1586f9;});}return null;};}function removeEntity(_0x3c28e2,_0x2d0390){return function(_0x5ca6d2){if(_0x5ca6d2){return _0x5ca6d2[_0x930e('0x27')]()[_0x930e('0x28')](function(){_0x3c28e2[_0x930e('0x1d')](0xcc)[_0x930e('0x1c')]();});}};}function handleEntityNotFound(_0x2b26df,_0x5c804c){return function(_0x25fa2a){if(!_0x25fa2a){_0x2b26df[_0x930e('0x29')](0x194);}return _0x25fa2a;};}function handleError(_0x223d91,_0x55090f){_0x55090f=_0x55090f||0x1f4;return function(_0x75ed2a){logger[_0x930e('0x2a')](_0x75ed2a[_0x930e('0x2b')]);if(_0x75ed2a[_0x930e('0x2c')]){delete _0x75ed2a[_0x930e('0x2c')];}_0x223d91[_0x930e('0x1d')](_0x55090f)['send'](_0x75ed2a);};}exports['index']=function(_0x3ddea5,_0x19ba88){var _0x17fae8={},_0x546598={},_0x190505={'count':0x0,'rows':[]};var _0x31acc2=_[_0x930e('0x2d')](db[_0x930e('0x2e')][_0x930e('0x2f')],function(_0x1a864e){return{'name':_0x1a864e['fieldName'],'type':_0x1a864e[_0x930e('0x30')]['key']};});_0x546598[_0x930e('0x31')]=_[_0x930e('0x2d')](_0x31acc2,_0x930e('0x2c'));_0x546598['query']=_['keys'](_0x3ddea5[_0x930e('0x32')]);_0x546598['filters']=_['intersection'](_0x546598[_0x930e('0x31')],_0x546598[_0x930e('0x32')]);_0x17fae8[_0x930e('0x33')]=_['intersection'](_0x546598[_0x930e('0x31')],qs['fields'](_0x3ddea5[_0x930e('0x32')][_0x930e('0x34')]));_0x17fae8[_0x930e('0x33')]=_0x17fae8[_0x930e('0x33')][_0x930e('0x35')]?_0x17fae8[_0x930e('0x33')]:_0x546598[_0x930e('0x31')];if(!_0x3ddea5[_0x930e('0x32')][_0x930e('0x36')](_0x930e('0x37'))){_0x17fae8[_0x930e('0x21')]=qs[_0x930e('0x21')](_0x3ddea5[_0x930e('0x32')][_0x930e('0x21')]);_0x17fae8[_0x930e('0x1f')]=qs[_0x930e('0x1f')](_0x3ddea5[_0x930e('0x32')][_0x930e('0x1f')]);}_0x17fae8[_0x930e('0x38')]=qs[_0x930e('0x39')](_0x3ddea5[_0x930e('0x32')][_0x930e('0x39')]);_0x17fae8[_0x930e('0x3a')]=qs[_0x930e('0x3b')](_[_0x930e('0x3c')](_0x3ddea5[_0x930e('0x32')],_0x546598[_0x930e('0x3b')]),_0x31acc2);if(_0x3ddea5[_0x930e('0x32')][_0x930e('0x3d')]){_0x17fae8[_0x930e('0x3a')]=_[_0x930e('0x3e')](_0x17fae8[_0x930e('0x3a')],{'$or':_[_0x930e('0x2d')](_0x31acc2,function(_0x28ee78){if(_0x28ee78[_0x930e('0x30')]!=='VIRTUAL'){var _0x2b488b={};_0x2b488b[_0x28ee78[_0x930e('0x2c')]]={'$like':'%'+_0x3ddea5[_0x930e('0x32')][_0x930e('0x3d')]+'%'};return _0x2b488b;}})});}_0x17fae8=_['merge']({},_0x17fae8,_0x3ddea5[_0x930e('0x3f')]);var _0x8ed8ce={'where':_0x17fae8[_0x930e('0x3a')]};return db[_0x930e('0x2e')]['count'](_0x8ed8ce)[_0x930e('0x28')](function(_0x35cae6){_0x190505['count']=_0x35cae6;if(_0x3ddea5[_0x930e('0x32')]['includeAll']){_0x17fae8['include']=[{'all':!![]}];}return db[_0x930e('0x2e')][_0x930e('0x40')](_0x17fae8);})[_0x930e('0x28')](function(_0x44282a){_0x190505[_0x930e('0x41')]=_0x44282a;return _0x190505;})[_0x930e('0x28')](respondWithFilteredResult(_0x19ba88,_0x17fae8))['catch'](handleError(_0x19ba88,null));};exports[_0x930e('0x42')]=function(_0x4f0c85,_0xcb2881){var _0x49dce3={'raw':![],'where':{'id':_0x4f0c85[_0x930e('0x43')]['id']}},_0x3ae6ee={};_0x3ae6ee[_0x930e('0x31')]=_[_0x930e('0x44')](db['SalesforceConfiguration']['rawAttributes']);_0x3ae6ee[_0x930e('0x32')]=_[_0x930e('0x44')](_0x4f0c85['query']);_0x3ae6ee[_0x930e('0x3b')]=_[_0x930e('0x45')](_0x3ae6ee[_0x930e('0x31')],_0x3ae6ee[_0x930e('0x32')]);_0x49dce3[_0x930e('0x33')]=_[_0x930e('0x45')](_0x3ae6ee[_0x930e('0x31')],qs[_0x930e('0x34')](_0x4f0c85[_0x930e('0x32')][_0x930e('0x34')]));_0x49dce3[_0x930e('0x33')]=_0x49dce3[_0x930e('0x33')][_0x930e('0x35')]?_0x49dce3[_0x930e('0x33')]:_0x3ae6ee['model'];if(_0x4f0c85['query'][_0x930e('0x46')]){_0x49dce3['include']=[{'all':!![]}];}_0x49dce3=_[_0x930e('0x3e')]({},_0x49dce3,_0x4f0c85[_0x930e('0x3f')]);return db[_0x930e('0x2e')][_0x930e('0x47')](_0x49dce3)[_0x930e('0x28')](handleEntityNotFound(_0xcb2881,null))[_0x930e('0x28')](respondWithResult(_0xcb2881,null))['catch'](handleError(_0xcb2881,null));};exports[_0x930e('0x48')]=function(_0x39a377,_0x567dc0){return db[_0x930e('0x2e')][_0x930e('0x48')](_0x39a377[_0x930e('0x49')],{})[_0x930e('0x28')](respondWithResult(_0x567dc0,0xc9))[_0x930e('0x4a')](handleError(_0x567dc0,null));};exports[_0x930e('0x26')]=function(_0x5e9adf,_0x33869d){if(_0x5e9adf[_0x930e('0x49')]['id']){delete _0x5e9adf[_0x930e('0x49')]['id'];}return db[_0x930e('0x2e')][_0x930e('0x47')]({'where':{'id':_0x5e9adf[_0x930e('0x43')]['id']}})[_0x930e('0x28')](handleEntityNotFound(_0x33869d,null))['then'](saveUpdates(_0x5e9adf[_0x930e('0x49')],null))['then'](respondWithResult(_0x33869d,null))[_0x930e('0x4a')](handleError(_0x33869d,null));};exports['destroy']=function(_0x5a8031,_0x36a437){return db[_0x930e('0x2e')][_0x930e('0x47')]({'where':{'id':_0x5a8031[_0x930e('0x43')]['id']}})[_0x930e('0x28')](handleEntityNotFound(_0x36a437,null))[_0x930e('0x28')](removeEntity(_0x36a437,null))[_0x930e('0x4a')](handleError(_0x36a437,null));};exports[_0x930e('0x4b')]=function(_0xa69140,_0x905f0c,_0x2763fd){var _0x340513={};var _0x2f87dd={};var _0x3ec429;var _0x4c22a9;return db[_0x930e('0x2e')][_0x930e('0x4c')]({'where':{'id':_0xa69140[_0x930e('0x43')]['id']}})[_0x930e('0x28')](handleEntityNotFound(_0x905f0c,null))[_0x930e('0x28')](function(_0x302126){if(_0x302126){_0x3ec429=_0x302126;_0x2f87dd['model']=_[_0x930e('0x44')](db[_0x930e('0x4d')]['rawAttributes']);_0x2f87dd['query']=_[_0x930e('0x44')](_0xa69140[_0x930e('0x32')]);_0x2f87dd[_0x930e('0x3b')]=_[_0x930e('0x45')](_0x2f87dd[_0x930e('0x31')],_0x2f87dd['query']);_0x340513[_0x930e('0x33')]=_['intersection'](_0x2f87dd[_0x930e('0x31')],qs['fields'](_0xa69140[_0x930e('0x32')][_0x930e('0x34')]));_0x340513[_0x930e('0x33')]=_0x340513[_0x930e('0x33')]['length']?_0x340513['attributes']:_0x2f87dd[_0x930e('0x31')];_0x340513[_0x930e('0x38')]=qs[_0x930e('0x39')](_0xa69140[_0x930e('0x32')][_0x930e('0x39')]);_0x340513['where']=qs['filters'](_[_0x930e('0x3c')](_0xa69140[_0x930e('0x32')],_0x2f87dd[_0x930e('0x3b')]));if(_0xa69140[_0x930e('0x32')]['filter']){_0x340513[_0x930e('0x3a')]=_['merge'](_0x340513[_0x930e('0x3a')],{'$or':_[_0x930e('0x2d')](_0x340513[_0x930e('0x33')],function(_0x1d93f9){var _0x55503a={};_0x55503a[_0x1d93f9]={'$like':'%'+_0xa69140[_0x930e('0x32')]['filter']+'%'};return _0x55503a;})});}_0x340513=_['merge']({},_0x340513,_0xa69140[_0x930e('0x3f')]);return _0x3ec429[_0x930e('0x4b')](_0x340513);}})[_0x930e('0x28')](function(_0x5c054a){if(_0x5c054a){_0x4c22a9=_0x5c054a[_0x930e('0x35')];if(!_0xa69140['query'][_0x930e('0x36')](_0x930e('0x37'))){_0x340513[_0x930e('0x21')]=qs[_0x930e('0x21')](_0xa69140[_0x930e('0x32')][_0x930e('0x21')]);_0x340513['offset']=qs[_0x930e('0x1f')](_0xa69140['query'][_0x930e('0x1f')]);}return _0x3ec429[_0x930e('0x4b')](_0x340513);}})[_0x930e('0x28')](function(_0x442c1e){if(_0x442c1e){return _0x442c1e?{'count':_0x4c22a9,'rows':_0x442c1e}:null;}})[_0x930e('0x28')](respondWithResult(_0x905f0c,null))[_0x930e('0x4a')](handleError(_0x905f0c,null));};exports[_0x930e('0x4e')]=function(_0x12c62f,_0x3e2f7b,_0x22773f){var _0x45681b={};var _0x41f6c6={};var _0x14c9f3;var _0x469233;return db[_0x930e('0x2e')][_0x930e('0x4c')]({'where':{'id':_0x12c62f['params']['id']}})[_0x930e('0x28')](handleEntityNotFound(_0x3e2f7b,null))[_0x930e('0x28')](function(_0x497488){if(_0x497488){_0x14c9f3=_0x497488;_0x41f6c6[_0x930e('0x31')]=_['keys'](db[_0x930e('0x4d')][_0x930e('0x2f')]);_0x41f6c6[_0x930e('0x32')]=_[_0x930e('0x44')](_0x12c62f[_0x930e('0x32')]);_0x41f6c6['filters']=_[_0x930e('0x45')](_0x41f6c6[_0x930e('0x31')],_0x41f6c6['query']);_0x45681b['attributes']=_['intersection'](_0x41f6c6[_0x930e('0x31')],qs[_0x930e('0x34')](_0x12c62f[_0x930e('0x32')][_0x930e('0x34')]));_0x45681b[_0x930e('0x33')]=_0x45681b[_0x930e('0x33')]['length']?_0x45681b[_0x930e('0x33')]:_0x41f6c6['model'];_0x45681b[_0x930e('0x38')]=qs[_0x930e('0x39')](_0x12c62f[_0x930e('0x32')][_0x930e('0x39')]);_0x45681b['where']=qs[_0x930e('0x3b')](_[_0x930e('0x3c')](_0x12c62f[_0x930e('0x32')],_0x41f6c6['filters']));if(_0x12c62f[_0x930e('0x32')][_0x930e('0x3d')]){_0x45681b[_0x930e('0x3a')]=_[_0x930e('0x3e')](_0x45681b[_0x930e('0x3a')],{'$or':_[_0x930e('0x2d')](_0x45681b[_0x930e('0x33')],function(_0x4f9821){var _0x35378c={};_0x35378c[_0x4f9821]={'$like':'%'+_0x12c62f[_0x930e('0x32')][_0x930e('0x3d')]+'%'};return _0x35378c;})});}_0x45681b=_[_0x930e('0x3e')]({},_0x45681b,_0x12c62f[_0x930e('0x3f')]);return _0x14c9f3[_0x930e('0x4e')](_0x45681b);}})[_0x930e('0x28')](function(_0x1ba779){if(_0x1ba779){_0x469233=_0x1ba779[_0x930e('0x35')];if(!_0x12c62f['query'][_0x930e('0x36')]('nolimit')){_0x45681b[_0x930e('0x21')]=qs[_0x930e('0x21')](_0x12c62f[_0x930e('0x32')][_0x930e('0x21')]);_0x45681b['offset']=qs[_0x930e('0x1f')](_0x12c62f[_0x930e('0x32')][_0x930e('0x1f')]);}return _0x14c9f3['getSubjects'](_0x45681b);}})[_0x930e('0x28')](function(_0x333fb6){if(_0x333fb6){return _0x333fb6?{'count':_0x469233,'rows':_0x333fb6}:null;}})[_0x930e('0x28')](respondWithResult(_0x3e2f7b,null))['catch'](handleError(_0x3e2f7b,null));};exports[_0x930e('0x4f')]=function(_0x352dd7,_0x2a2aba,_0x2976df){var _0x47f6b0={};var _0xb5847b={};var _0x4e3aaf;var _0x90111b;return db[_0x930e('0x2e')][_0x930e('0x4c')]({'where':{'id':_0x352dd7['params']['id']}})[_0x930e('0x28')](handleEntityNotFound(_0x2a2aba,null))[_0x930e('0x28')](function(_0x464b21){if(_0x464b21){_0x4e3aaf=_0x464b21;_0xb5847b[_0x930e('0x31')]=_[_0x930e('0x44')](db['SalesforceField'][_0x930e('0x2f')]);_0xb5847b[_0x930e('0x32')]=_[_0x930e('0x44')](_0x352dd7['query']);_0xb5847b['filters']=_['intersection'](_0xb5847b[_0x930e('0x31')],_0xb5847b['query']);_0x47f6b0[_0x930e('0x33')]=_[_0x930e('0x45')](_0xb5847b['model'],qs[_0x930e('0x34')](_0x352dd7['query'][_0x930e('0x34')]));_0x47f6b0['attributes']=_0x47f6b0['attributes']['length']?_0x47f6b0['attributes']:_0xb5847b[_0x930e('0x31')];_0x47f6b0[_0x930e('0x38')]=qs['sort'](_0x352dd7[_0x930e('0x32')][_0x930e('0x39')]);_0x47f6b0[_0x930e('0x3a')]=qs[_0x930e('0x3b')](_['pick'](_0x352dd7[_0x930e('0x32')],_0xb5847b[_0x930e('0x3b')]));if(_0x352dd7[_0x930e('0x32')][_0x930e('0x3d')]){_0x47f6b0['where']=_[_0x930e('0x3e')](_0x47f6b0[_0x930e('0x3a')],{'$or':_[_0x930e('0x2d')](_0x47f6b0[_0x930e('0x33')],function(_0x12e419){var _0x211969={};_0x211969[_0x12e419]={'$like':'%'+_0x352dd7[_0x930e('0x32')][_0x930e('0x3d')]+'%'};return _0x211969;})});}_0x47f6b0=_[_0x930e('0x3e')]({},_0x47f6b0,_0x352dd7['options']);return _0x4e3aaf[_0x930e('0x4f')](_0x47f6b0);}})['then'](function(_0x325d42){if(_0x325d42){_0x90111b=_0x325d42[_0x930e('0x35')];if(!_0x352dd7[_0x930e('0x32')]['hasOwnProperty'](_0x930e('0x37'))){_0x47f6b0[_0x930e('0x21')]=qs[_0x930e('0x21')](_0x352dd7['query'][_0x930e('0x21')]);_0x47f6b0[_0x930e('0x1f')]=qs[_0x930e('0x1f')](_0x352dd7[_0x930e('0x32')]['offset']);}return _0x4e3aaf[_0x930e('0x4f')](_0x47f6b0);}})[_0x930e('0x28')](function(_0x140f35){if(_0x140f35){return _0x140f35?{'count':_0x90111b,'rows':_0x140f35}:null;}})[_0x930e('0x28')](respondWithResult(_0x2a2aba,null))[_0x930e('0x4a')](handleError(_0x2a2aba,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 3910033..13e4333 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 _0x7722=['../../config/environment','./intSalesforceConfiguration.attributes','SalesforceConfiguration','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4c0db0,_0x46ed38){var _0x5690fa=function(_0x4783db){while(--_0x4783db){_0x4c0db0['push'](_0x4c0db0['shift']());}};_0x5690fa(++_0x46ed38);}(_0x7722,0x125));var _0x2772=function(_0x23e8d1,_0x1dd2ed){_0x23e8d1=_0x23e8d1-0x0;var _0x5a5384=_0x7722[_0x23e8d1];return _0x5a5384;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2772('0x0'))(_0x2772('0x1'));var moment=require(_0x2772('0x2'));var BPromise=require(_0x2772('0x3'));var rp=require(_0x2772('0x4'));var fs=require('fs');var path=require(_0x2772('0x5'));var rimraf=require(_0x2772('0x6'));var config=require(_0x2772('0x7'));var attributes=require(_0x2772('0x8'));module['exports']=function(_0x1b1f71,_0x25c906){return _0x1b1f71['define'](_0x2772('0x9'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a49=['int_salesforce_configurations','lodash','util','api','moment','bluebird','request-promise','path','exports','define','SalesforceConfiguration'];(function(_0x2dd7d2,_0xe80bc1){var _0x2a234b=function(_0x40ed34){while(--_0x40ed34){_0x2dd7d2['push'](_0x2dd7d2['shift']());}};_0x2a234b(++_0xe80bc1);}(_0x0a49,0x1c4));var _0x90a4=function(_0x93942f,_0xb48547){_0x93942f=_0x93942f-0x0;var _0x23fcd8=_0x0a49[_0x93942f];return _0x23fcd8;};'use strict';var _=require(_0x90a4('0x0'));var util=require(_0x90a4('0x1'));var logger=require('../../config/logger')(_0x90a4('0x2'));var moment=require(_0x90a4('0x3'));var BPromise=require(_0x90a4('0x4'));var rp=require(_0x90a4('0x5'));var fs=require('fs');var path=require(_0x90a4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0x90a4('0x7')]=function(_0x247ae8,_0x3a1e8c){return _0x247ae8[_0x90a4('0x8')](_0x90a4('0x9'),attributes,{'tableName':_0x90a4('0xa'),'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 a1c3f63..13acf3b 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 _0xe6a1=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x35237e,_0x5bc6fc){var _0x509a04=function(_0x5d34fd){while(--_0x5d34fd){_0x35237e['push'](_0x35237e['shift']());}};_0x509a04(++_0x5bc6fc);}(_0xe6a1,0x1b8));var _0x1e6a=function(_0x2093d9,_0x5c8113){_0x2093d9=_0x2093d9-0x0;var _0x3404e8=_0xe6a1[_0x2093d9];return _0x3404e8;};'use strict';var _=require('lodash');var util=require(_0x1e6a('0x0'));var moment=require(_0x1e6a('0x1'));var BPromise=require(_0x1e6a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e6a('0x3'))['db'];var utils=require(_0x1e6a('0x4'));var logger=require(_0x1e6a('0x5'))(_0x1e6a('0x6'));var config=require(_0x1e6a('0x7'));var jayson=require(_0x1e6a('0x8'));var client=jayson['client'][_0x1e6a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19c96a,_0x438702,_0x34bd01){return new BPromise(function(_0xf01210,_0x50985c){return client[_0x1e6a('0xa')](_0x19c96a,_0x34bd01)[_0x1e6a('0xb')](function(_0x2d20ca){logger[_0x1e6a('0xc')](_0x1e6a('0xd'),_0x438702,_0x1e6a('0xe'));logger[_0x1e6a('0xf')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x438702,'request\x20sent',JSON[_0x1e6a('0x10')](_0x2d20ca));if(_0x2d20ca[_0x1e6a('0x11')]){if(_0x2d20ca[_0x1e6a('0x11')][_0x1e6a('0x12')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x438702,_0x2d20ca['error'][_0x1e6a('0x13')]);return _0x50985c(_0x2d20ca[_0x1e6a('0x11')][_0x1e6a('0x13')]);}logger[_0x1e6a('0x11')](_0x1e6a('0xd'),_0x438702,_0x2d20ca[_0x1e6a('0x11')][_0x1e6a('0x13')]);return _0xf01210(_0x2d20ca[_0x1e6a('0x11')]['message']);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x438702,'request\x20sent');_0xf01210(_0x2d20ca[_0x1e6a('0x14')][_0x1e6a('0x13')]);}})[_0x1e6a('0x15')](function(_0x24908c){logger[_0x1e6a('0x11')](_0x1e6a('0xd'),_0x438702,_0x24908c);_0x50985c(_0x24908c);});});} \ No newline at end of file +var _0x0383=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment'];(function(_0x2ff297,_0x3554f9){var _0x104f48=function(_0xa1d95b){while(--_0xa1d95b){_0x2ff297['push'](_0x2ff297['shift']());}};_0x104f48(++_0x3554f9);}(_0x0383,0x14d));var _0x3038=function(_0x18bb67,_0x5eff3d){_0x18bb67=_0x18bb67-0x0;var _0x149f9a=_0x0383[_0x18bb67];return _0x149f9a;};'use strict';var _=require(_0x3038('0x0'));var util=require(_0x3038('0x1'));var moment=require(_0x3038('0x2'));var BPromise=require(_0x3038('0x3'));var rs=require(_0x3038('0x4'));var fs=require('fs');var Redis=require(_0x3038('0x5'));var db=require(_0x3038('0x6'))['db'];var utils=require(_0x3038('0x7'));var logger=require(_0x3038('0x8'))(_0x3038('0x9'));var config=require(_0x3038('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3038('0xb')][_0x3038('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2bd611,_0x1a337f,_0x127e9a){return new BPromise(function(_0x20948b,_0x429fd6){return client[_0x3038('0xd')](_0x2bd611,_0x127e9a)[_0x3038('0xe')](function(_0x5a7517){logger[_0x3038('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x1a337f,_0x3038('0x10'));logger['debug'](_0x3038('0x11'),_0x1a337f,_0x3038('0x10'),JSON[_0x3038('0x12')](_0x5a7517));if(_0x5a7517[_0x3038('0x13')]){if(_0x5a7517[_0x3038('0x13')][_0x3038('0x14')]===0x1f4){logger[_0x3038('0x13')](_0x3038('0x15'),_0x1a337f,_0x5a7517[_0x3038('0x13')][_0x3038('0x16')]);return _0x429fd6(_0x5a7517['error'][_0x3038('0x16')]);}logger[_0x3038('0x13')](_0x3038('0x15'),_0x1a337f,_0x5a7517[_0x3038('0x13')][_0x3038('0x16')]);return _0x20948b(_0x5a7517[_0x3038('0x13')][_0x3038('0x16')]);}else{logger[_0x3038('0xf')](_0x3038('0x15'),_0x1a337f,_0x3038('0x10'));_0x20948b(_0x5a7517['result'][_0x3038('0x16')]);}})[_0x3038('0x17')](function(_0x9d278f){logger[_0x3038('0x13')](_0x3038('0x15'),_0x1a337f,_0x9d278f);_0x429fd6(_0x9d278f);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index d945f78..027d6a6 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 _0x6407=['show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id'];(function(_0x34fe6d,_0x1e08ba){var _0x3e0568=function(_0x1de6a3){while(--_0x1de6a3){_0x34fe6d['push'](_0x34fe6d['shift']());}};_0x3e0568(++_0x1e08ba);}(_0x6407,0x1a5));var _0x7640=function(_0x13f5d1,_0x12e3f7){_0x13f5d1=_0x13f5d1-0x0;var _0x5621f3=_0x6407[_0x13f5d1];return _0x5621f3;};'use strict';var multer=require(_0x7640('0x0'));var util=require('util');var path=require(_0x7640('0x1'));var timeout=require(_0x7640('0x2'));var express=require(_0x7640('0x3'));var router=express['Router']();var fs_extra=require(_0x7640('0x4'));var auth=require(_0x7640('0x5'));var interaction=require(_0x7640('0x6'));var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router[_0x7640('0x7')]('/',auth[_0x7640('0x8')](),controller[_0x7640('0x9')]);router[_0x7640('0x7')](_0x7640('0xa'),auth[_0x7640('0x8')](),controller[_0x7640('0xb')]);router[_0x7640('0xc')]('/',auth['isAuthenticated'](),controller[_0x7640('0xd')]);router[_0x7640('0xe')](_0x7640('0xa'),auth[_0x7640('0x8')](),controller['update']);router[_0x7640('0xf')](_0x7640('0xa'),auth[_0x7640('0x8')](),controller[_0x7640('0x10')]);module[_0x7640('0x11')]=router; \ No newline at end of file +var _0x4286=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports'];(function(_0x4b744a,_0x308bef){var _0x4572fc=function(_0x53f5c4){while(--_0x53f5c4){_0x4b744a['push'](_0x4b744a['shift']());}};_0x4572fc(++_0x308bef);}(_0x4286,0xbd));var _0x6428=function(_0x4922a4,_0x49fbc2){_0x4922a4=_0x4922a4-0x0;var _0x1fef26=_0x4286[_0x4922a4];return _0x1fef26;};'use strict';var multer=require(_0x6428('0x0'));var util=require(_0x6428('0x1'));var path=require(_0x6428('0x2'));var timeout=require(_0x6428('0x3'));var express=require(_0x6428('0x4'));var router=express[_0x6428('0x5')]();var fs_extra=require(_0x6428('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6428('0x7'));var config=require(_0x6428('0x8'));var controller=require(_0x6428('0x9'));router[_0x6428('0xa')]('/',auth[_0x6428('0xb')](),controller[_0x6428('0xc')]);router[_0x6428('0xa')](_0x6428('0xd'),auth[_0x6428('0xb')](),controller[_0x6428('0xe')]);router[_0x6428('0xf')]('/',auth['isAuthenticated'](),controller[_0x6428('0x10')]);router[_0x6428('0x11')](_0x6428('0xd'),auth['isAuthenticated'](),controller[_0x6428('0x12')]);router['delete'](_0x6428('0xd'),auth['isAuthenticated'](),controller[_0x6428('0x13')]);module[_0x6428('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index ab41f76..42e704b 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 _0x41f7=['STRING','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x2ea2d9,_0x4b76cb){var _0x3e5448=function(_0x16433c){while(--_0x16433c){_0x2ea2d9['push'](_0x2ea2d9['shift']());}};_0x3e5448(++_0x4b76cb);}(_0x41f7,0x14b));var _0x741f=function(_0x3c10d6,_0x2c26d2){_0x3c10d6=_0x3c10d6-0x0;var _0x395015=_0x41f7[_0x3c10d6];return _0x395015;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x741f('0x0'),_0x741f('0x1'),_0x741f('0x2'),_0x741f('0x3'),_0x741f('0x4')),'defaultValue':_0x741f('0x0')},'content':{'type':Sequelize[_0x741f('0x5')]},'key':{'type':Sequelize[_0x741f('0x5')]},'keyType':{'type':Sequelize[_0x741f('0x6')](_0x741f('0x0'),_0x741f('0x1'),_0x741f('0x2'))},'keyContent':{'type':Sequelize[_0x741f('0x5')]},'idField':{'type':Sequelize[_0x741f('0x5')]},'variableName':{'type':Sequelize[_0x741f('0x5')]}}; \ No newline at end of file +var _0x8361=['string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM'];(function(_0x1bd8fd,_0x526cee){var _0x36f371=function(_0x14b14e){while(--_0x14b14e){_0x1bd8fd['push'](_0x1bd8fd['shift']());}};_0x36f371(++_0x526cee);}(_0x8361,0x138));var _0x1836=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x8361[_0x19b3f9];return _0x18c3f6;};'use strict';var Sequelize=require(_0x1836('0x0'));module[_0x1836('0x1')]={'type':{'type':Sequelize[_0x1836('0x2')](_0x1836('0x3'),_0x1836('0x4'),_0x1836('0x5'),_0x1836('0x6'),_0x1836('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1836('0x8')]},'key':{'type':Sequelize[_0x1836('0x8')]},'keyType':{'type':Sequelize[_0x1836('0x2')](_0x1836('0x3'),_0x1836('0x4'),_0x1836('0x5'))},'keyContent':{'type':Sequelize[_0x1836('0x8')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x1836('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index f956e71..164ce7a 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 _0x18b8=['offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','status','error','stack','name','send','map','SalesforceField','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','includeAll','findAll','catch','show','rawAttributes','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','undefined','count'];(function(_0x5b2263,_0x2df183){var _0x487cbe=function(_0x5240ff){while(--_0x5240ff){_0x5b2263['push'](_0x5b2263['shift']());}};_0x487cbe(++_0x2df183);}(_0x18b8,0x189));var _0x818b=function(_0x26f0c7,_0x18bbe3){_0x26f0c7=_0x26f0c7-0x0;var _0xd33206=_0x18b8[_0x26f0c7];return _0xd33206;};'use strict';var emlformat=require(_0x818b('0x0'));var rimraf=require(_0x818b('0x1'));var zipdir=require(_0x818b('0x2'));var jsonpatch=require(_0x818b('0x3'));var rp=require(_0x818b('0x4'));var moment=require(_0x818b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x818b('0x6'));var util=require(_0x818b('0x7'));var path=require('path');var sox=require(_0x818b('0x8'));var csv=require(_0x818b('0x9'));var ejs=require(_0x818b('0xa'));var fs=require('fs');var fs_extra=require(_0x818b('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x818b('0xc'));var jsforce=require(_0x818b('0xd'));var deskjs=require(_0x818b('0xe'));var toCsv=require(_0x818b('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x818b('0xf'));var authService=require(_0x818b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x818b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x818b('0x12'))(_0x818b('0x13'));var utils=require(_0x818b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x818b('0x15'));var db=require(_0x818b('0x16'))['db'];function respondWithStatusCode(_0x4c02c9,_0x1bed92){_0x1bed92=_0x1bed92||0xcc;return function(_0x52470f){if(_0x52470f){return _0x4c02c9[_0x818b('0x17')](_0x1bed92);}return _0x4c02c9['status'](_0x1bed92)[_0x818b('0x18')]();};}function respondWithResult(_0xf5de4b,_0x11d5dd){_0x11d5dd=_0x11d5dd||0xc8;return function(_0x391ae2){if(_0x391ae2){return _0xf5de4b['status'](_0x11d5dd)['json'](_0x391ae2);}};}function respondWithFilteredResult(_0x4ff0ff,_0x4cdfd0){return function(_0x3a6eb8){if(_0x3a6eb8){var _0x2b6af7=typeof _0x4cdfd0['offset']===_0x818b('0x19')&&typeof _0x4cdfd0['limit']===_0x818b('0x19');var _0x48498c=_0x3a6eb8[_0x818b('0x1a')];var _0x575057=_0x2b6af7?0x0:_0x4cdfd0['offset'];var _0x173d6e=_0x2b6af7?_0x3a6eb8[_0x818b('0x1a')]:_0x4cdfd0[_0x818b('0x1b')]+_0x4cdfd0[_0x818b('0x1c')];var _0x196438;if(_0x173d6e>=_0x48498c){_0x173d6e=_0x48498c;_0x196438=0xc8;}else{_0x196438=0xce;}_0x4ff0ff['status'](_0x196438);return _0x4ff0ff[_0x818b('0x1d')](_0x818b('0x1e'),_0x575057+'-'+_0x173d6e+'/'+_0x48498c)['json'](_0x3a6eb8);}return null;};}function patchUpdates(_0x203fd8){return function(_0x1e85a7){try{jsonpatch[_0x818b('0x1f')](_0x1e85a7,_0x203fd8,!![]);}catch(_0x1ff555){return BPromise[_0x818b('0x20')](_0x1ff555);}return _0x1e85a7[_0x818b('0x21')]();};}function saveUpdates(_0x34bef4,_0x25fc59){return function(_0x36a0e7){if(_0x36a0e7){return _0x36a0e7[_0x818b('0x22')](_0x34bef4)[_0x818b('0x23')](function(_0x404d55){return _0x404d55;});}return null;};}function removeEntity(_0x337127,_0x15ac90){return function(_0x304567){if(_0x304567){return _0x304567[_0x818b('0x24')]()['then'](function(){_0x337127[_0x818b('0x25')](0xcc)[_0x818b('0x18')]();});}};}function handleEntityNotFound(_0x4aac7e,_0x1fc8a5){return function(_0x2820b2){if(!_0x2820b2){_0x4aac7e[_0x818b('0x17')](0x194);}return _0x2820b2;};}function handleError(_0x2531b2,_0xf10e58){_0xf10e58=_0xf10e58||0x1f4;return function(_0x1074a0){logger[_0x818b('0x26')](_0x1074a0[_0x818b('0x27')]);if(_0x1074a0[_0x818b('0x28')]){delete _0x1074a0[_0x818b('0x28')];}_0x2531b2[_0x818b('0x25')](_0xf10e58)[_0x818b('0x29')](_0x1074a0);};}exports['index']=function(_0x49a7ac,_0x412c3f){var _0x23700b={},_0x1c4897={},_0x3bcd58={'count':0x0,'rows':[]};var _0x463e8d=_[_0x818b('0x2a')](db[_0x818b('0x2b')]['rawAttributes'],function(_0x483e90){return{'name':_0x483e90[_0x818b('0x2c')],'type':_0x483e90[_0x818b('0x2d')]['key']};});_0x1c4897['model']=_[_0x818b('0x2a')](_0x463e8d,_0x818b('0x28'));_0x1c4897[_0x818b('0x2e')]=_[_0x818b('0x2f')](_0x49a7ac[_0x818b('0x2e')]);_0x1c4897['filters']=_[_0x818b('0x30')](_0x1c4897[_0x818b('0x31')],_0x1c4897[_0x818b('0x2e')]);_0x23700b[_0x818b('0x32')]=_[_0x818b('0x30')](_0x1c4897['model'],qs[_0x818b('0x33')](_0x49a7ac[_0x818b('0x2e')][_0x818b('0x33')]));_0x23700b[_0x818b('0x32')]=_0x23700b['attributes'][_0x818b('0x34')]?_0x23700b[_0x818b('0x32')]:_0x1c4897[_0x818b('0x31')];if(!_0x49a7ac[_0x818b('0x2e')][_0x818b('0x35')]('nolimit')){_0x23700b[_0x818b('0x1c')]=qs[_0x818b('0x1c')](_0x49a7ac[_0x818b('0x2e')][_0x818b('0x1c')]);_0x23700b[_0x818b('0x1b')]=qs[_0x818b('0x1b')](_0x49a7ac[_0x818b('0x2e')]['offset']);}_0x23700b['order']=qs['sort'](_0x49a7ac['query'][_0x818b('0x36')]);_0x23700b[_0x818b('0x37')]=qs[_0x818b('0x38')](_[_0x818b('0x39')](_0x49a7ac[_0x818b('0x2e')],_0x1c4897[_0x818b('0x38')]),_0x463e8d);if(_0x49a7ac[_0x818b('0x2e')][_0x818b('0x3a')]){_0x23700b[_0x818b('0x37')]=_[_0x818b('0x3b')](_0x23700b[_0x818b('0x37')],{'$or':_['map'](_0x463e8d,function(_0x24565e){if(_0x24565e['type']!=='VIRTUAL'){var _0x3dc4fe={};_0x3dc4fe[_0x24565e[_0x818b('0x28')]]={'$like':'%'+_0x49a7ac[_0x818b('0x2e')][_0x818b('0x3a')]+'%'};return _0x3dc4fe;}})});}_0x23700b=_[_0x818b('0x3b')]({},_0x23700b,_0x49a7ac[_0x818b('0x3c')]);var _0x45452b={'where':_0x23700b['where']};return db[_0x818b('0x2b')][_0x818b('0x1a')](_0x45452b)[_0x818b('0x23')](function(_0x379d32){_0x3bcd58[_0x818b('0x1a')]=_0x379d32;if(_0x49a7ac[_0x818b('0x2e')][_0x818b('0x3d')]){_0x23700b['include']=[{'all':!![]}];}return db[_0x818b('0x2b')][_0x818b('0x3e')](_0x23700b);})[_0x818b('0x23')](function(_0x272e04){_0x3bcd58['rows']=_0x272e04;return _0x3bcd58;})[_0x818b('0x23')](respondWithFilteredResult(_0x412c3f,_0x23700b))[_0x818b('0x3f')](handleError(_0x412c3f,null));};exports[_0x818b('0x40')]=function(_0xa6dac0,_0x3ddc79){var _0x4cb2eb={'raw':!![],'where':{'id':_0xa6dac0['params']['id']}},_0x333950={};_0x333950['model']=_[_0x818b('0x2f')](db['SalesforceField'][_0x818b('0x41')]);_0x333950[_0x818b('0x2e')]=_[_0x818b('0x2f')](_0xa6dac0[_0x818b('0x2e')]);_0x333950[_0x818b('0x38')]=_[_0x818b('0x30')](_0x333950['model'],_0x333950[_0x818b('0x2e')]);_0x4cb2eb[_0x818b('0x32')]=_[_0x818b('0x30')](_0x333950[_0x818b('0x31')],qs['fields'](_0xa6dac0[_0x818b('0x2e')][_0x818b('0x33')]));_0x4cb2eb[_0x818b('0x32')]=_0x4cb2eb[_0x818b('0x32')][_0x818b('0x34')]?_0x4cb2eb[_0x818b('0x32')]:_0x333950[_0x818b('0x31')];if(_0xa6dac0[_0x818b('0x2e')][_0x818b('0x3d')]){_0x4cb2eb[_0x818b('0x42')]=[{'all':!![]}];}_0x4cb2eb=_[_0x818b('0x3b')]({},_0x4cb2eb,_0xa6dac0['options']);return db['SalesforceField']['find'](_0x4cb2eb)[_0x818b('0x23')](handleEntityNotFound(_0x3ddc79,null))[_0x818b('0x23')](respondWithResult(_0x3ddc79,null))['catch'](handleError(_0x3ddc79,null));};exports[_0x818b('0x43')]=function(_0x5eee8a,_0x8f2e8d){return db[_0x818b('0x2b')]['create'](_0x5eee8a[_0x818b('0x44')],{})['then'](respondWithResult(_0x8f2e8d,0xc9))[_0x818b('0x3f')](handleError(_0x8f2e8d,null));};exports[_0x818b('0x22')]=function(_0x6c7531,_0x3745aa){if(_0x6c7531[_0x818b('0x44')]['id']){delete _0x6c7531[_0x818b('0x44')]['id'];}return db['SalesforceField'][_0x818b('0x45')]({'where':{'id':_0x6c7531['params']['id']}})[_0x818b('0x23')](handleEntityNotFound(_0x3745aa,null))['then'](saveUpdates(_0x6c7531[_0x818b('0x44')],null))[_0x818b('0x23')](respondWithResult(_0x3745aa,null))['catch'](handleError(_0x3745aa,null));};exports[_0x818b('0x24')]=function(_0x2301fc,_0x535434){return db[_0x818b('0x2b')]['find']({'where':{'id':_0x2301fc['params']['id']}})[_0x818b('0x23')](handleEntityNotFound(_0x535434,null))[_0x818b('0x23')](removeEntity(_0x535434,null))[_0x818b('0x3f')](handleError(_0x535434,null));}; \ No newline at end of file +var _0x2328=['end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','SalesforceField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status'];(function(_0x387583,_0x127b08){var _0x45d2f9=function(_0x1d82ac){while(--_0x1d82ac){_0x387583['push'](_0x387583['shift']());}};_0x45d2f9(++_0x127b08);}(_0x2328,0x157));var _0x8232=function(_0x4c5b96,_0x3b5217){_0x4c5b96=_0x4c5b96-0x0;var _0x2d8d25=_0x2328[_0x4c5b96];return _0x2d8d25;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8232('0x0'));var zipdir=require(_0x8232('0x1'));var jsonpatch=require(_0x8232('0x2'));var rp=require(_0x8232('0x3'));var moment=require(_0x8232('0x4'));var BPromise=require(_0x8232('0x5'));var Mustache=require('mustache');var util=require(_0x8232('0x6'));var path=require('path');var sox=require(_0x8232('0x7'));var csv=require(_0x8232('0x8'));var ejs=require(_0x8232('0x9'));var fs=require('fs');var fs_extra=require(_0x8232('0xa'));var _=require('lodash');var squel=require(_0x8232('0xb'));var crypto=require('crypto');var jsforce=require(_0x8232('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8232('0x8'));var querystring=require(_0x8232('0xd'));var Papa=require(_0x8232('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8232('0xf'));var hardwareService=require(_0x8232('0x10'));var logger=require('../../config/logger')(_0x8232('0x11'));var utils=require(_0x8232('0x12'));var config=require(_0x8232('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x8232('0x14'))['db'];function respondWithStatusCode(_0x1e4d0e,_0xd1f938){_0xd1f938=_0xd1f938||0xcc;return function(_0x47d3d6){if(_0x47d3d6){return _0x1e4d0e['sendStatus'](_0xd1f938);}return _0x1e4d0e[_0x8232('0x15')](_0xd1f938)[_0x8232('0x16')]();};}function respondWithResult(_0x7e04f6,_0x1552c7){_0x1552c7=_0x1552c7||0xc8;return function(_0x40a763){if(_0x40a763){return _0x7e04f6[_0x8232('0x15')](_0x1552c7)[_0x8232('0x17')](_0x40a763);}};}function respondWithFilteredResult(_0xf399c7,_0x5a6eec){return function(_0x136474){if(_0x136474){var _0x2a26a9=typeof _0x5a6eec['offset']===_0x8232('0x18')&&typeof _0x5a6eec[_0x8232('0x19')]===_0x8232('0x18');var _0x40e204=_0x136474['count'];var _0x3769f7=_0x2a26a9?0x0:_0x5a6eec[_0x8232('0x1a')];var _0x5c3400=_0x2a26a9?_0x136474[_0x8232('0x1b')]:_0x5a6eec[_0x8232('0x1a')]+_0x5a6eec[_0x8232('0x19')];var _0x3391af;if(_0x5c3400>=_0x40e204){_0x5c3400=_0x40e204;_0x3391af=0xc8;}else{_0x3391af=0xce;}_0xf399c7[_0x8232('0x15')](_0x3391af);return _0xf399c7[_0x8232('0x1c')](_0x8232('0x1d'),_0x3769f7+'-'+_0x5c3400+'/'+_0x40e204)['json'](_0x136474);}return null;};}function patchUpdates(_0x273749){return function(_0x3d50e8){try{jsonpatch[_0x8232('0x1e')](_0x3d50e8,_0x273749,!![]);}catch(_0x244974){return BPromise[_0x8232('0x1f')](_0x244974);}return _0x3d50e8[_0x8232('0x20')]();};}function saveUpdates(_0x324525,_0x5253c6){return function(_0x13d69c){if(_0x13d69c){return _0x13d69c[_0x8232('0x21')](_0x324525)[_0x8232('0x22')](function(_0xf8db56){return _0xf8db56;});}return null;};}function removeEntity(_0x444995,_0x40d24f){return function(_0x454ef1){if(_0x454ef1){return _0x454ef1[_0x8232('0x23')]()['then'](function(){_0x444995[_0x8232('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14f29e,_0x83d304){return function(_0x55ae64){if(!_0x55ae64){_0x14f29e[_0x8232('0x24')](0x194);}return _0x55ae64;};}function handleError(_0x2d980f,_0x4653c8){_0x4653c8=_0x4653c8||0x1f4;return function(_0x57c5dd){logger[_0x8232('0x25')](_0x57c5dd[_0x8232('0x26')]);if(_0x57c5dd[_0x8232('0x27')]){delete _0x57c5dd['name'];}_0x2d980f[_0x8232('0x15')](_0x4653c8)[_0x8232('0x28')](_0x57c5dd);};}exports['index']=function(_0x3f94c7,_0x14c9c3){var _0x194596={},_0x442629={},_0x27d165={'count':0x0,'rows':[]};var _0x5783c2=_[_0x8232('0x29')](db[_0x8232('0x2a')][_0x8232('0x2b')],function(_0x176650){return{'name':_0x176650[_0x8232('0x2c')],'type':_0x176650[_0x8232('0x2d')]['key']};});_0x442629[_0x8232('0x2e')]=_[_0x8232('0x29')](_0x5783c2,_0x8232('0x27'));_0x442629[_0x8232('0x2f')]=_[_0x8232('0x30')](_0x3f94c7[_0x8232('0x2f')]);_0x442629[_0x8232('0x31')]=_[_0x8232('0x32')](_0x442629[_0x8232('0x2e')],_0x442629[_0x8232('0x2f')]);_0x194596[_0x8232('0x33')]=_['intersection'](_0x442629[_0x8232('0x2e')],qs['fields'](_0x3f94c7[_0x8232('0x2f')][_0x8232('0x34')]));_0x194596[_0x8232('0x33')]=_0x194596['attributes']['length']?_0x194596['attributes']:_0x442629[_0x8232('0x2e')];if(!_0x3f94c7[_0x8232('0x2f')][_0x8232('0x35')](_0x8232('0x36'))){_0x194596[_0x8232('0x19')]=qs['limit'](_0x3f94c7[_0x8232('0x2f')][_0x8232('0x19')]);_0x194596[_0x8232('0x1a')]=qs[_0x8232('0x1a')](_0x3f94c7[_0x8232('0x2f')][_0x8232('0x1a')]);}_0x194596[_0x8232('0x37')]=qs[_0x8232('0x38')](_0x3f94c7[_0x8232('0x2f')][_0x8232('0x38')]);_0x194596[_0x8232('0x39')]=qs['filters'](_[_0x8232('0x3a')](_0x3f94c7[_0x8232('0x2f')],_0x442629[_0x8232('0x31')]),_0x5783c2);if(_0x3f94c7[_0x8232('0x2f')]['filter']){_0x194596[_0x8232('0x39')]=_[_0x8232('0x3b')](_0x194596[_0x8232('0x39')],{'$or':_[_0x8232('0x29')](_0x5783c2,function(_0x1d8a7f){if(_0x1d8a7f[_0x8232('0x2d')]!==_0x8232('0x3c')){var _0x1e2fa4={};_0x1e2fa4[_0x1d8a7f[_0x8232('0x27')]]={'$like':'%'+_0x3f94c7['query']['filter']+'%'};return _0x1e2fa4;}})});}_0x194596=_[_0x8232('0x3b')]({},_0x194596,_0x3f94c7[_0x8232('0x3d')]);var _0x582995={'where':_0x194596['where']};return db[_0x8232('0x2a')][_0x8232('0x1b')](_0x582995)[_0x8232('0x22')](function(_0x3512b7){_0x27d165['count']=_0x3512b7;if(_0x3f94c7['query']['includeAll']){_0x194596[_0x8232('0x3e')]=[{'all':!![]}];}return db[_0x8232('0x2a')][_0x8232('0x3f')](_0x194596);})[_0x8232('0x22')](function(_0x525d72){_0x27d165[_0x8232('0x40')]=_0x525d72;return _0x27d165;})[_0x8232('0x22')](respondWithFilteredResult(_0x14c9c3,_0x194596))[_0x8232('0x41')](handleError(_0x14c9c3,null));};exports[_0x8232('0x42')]=function(_0x56f19b,_0x39bfd7){var _0xf58046={'raw':!![],'where':{'id':_0x56f19b[_0x8232('0x43')]['id']}},_0x46b93f={};_0x46b93f[_0x8232('0x2e')]=_['keys'](db['SalesforceField']['rawAttributes']);_0x46b93f[_0x8232('0x2f')]=_[_0x8232('0x30')](_0x56f19b['query']);_0x46b93f[_0x8232('0x31')]=_['intersection'](_0x46b93f[_0x8232('0x2e')],_0x46b93f['query']);_0xf58046['attributes']=_[_0x8232('0x32')](_0x46b93f[_0x8232('0x2e')],qs[_0x8232('0x34')](_0x56f19b[_0x8232('0x2f')][_0x8232('0x34')]));_0xf58046['attributes']=_0xf58046[_0x8232('0x33')][_0x8232('0x44')]?_0xf58046[_0x8232('0x33')]:_0x46b93f[_0x8232('0x2e')];if(_0x56f19b['query'][_0x8232('0x45')]){_0xf58046[_0x8232('0x3e')]=[{'all':!![]}];}_0xf58046=_[_0x8232('0x3b')]({},_0xf58046,_0x56f19b['options']);return db['SalesforceField'][_0x8232('0x46')](_0xf58046)[_0x8232('0x22')](handleEntityNotFound(_0x39bfd7,null))[_0x8232('0x22')](respondWithResult(_0x39bfd7,null))[_0x8232('0x41')](handleError(_0x39bfd7,null));};exports[_0x8232('0x47')]=function(_0x51cbf1,_0x2b1138){return db['SalesforceField']['create'](_0x51cbf1[_0x8232('0x48')],{})[_0x8232('0x22')](respondWithResult(_0x2b1138,0xc9))[_0x8232('0x41')](handleError(_0x2b1138,null));};exports[_0x8232('0x21')]=function(_0x1ccb51,_0x2cd8ae){if(_0x1ccb51[_0x8232('0x48')]['id']){delete _0x1ccb51[_0x8232('0x48')]['id'];}return db['SalesforceField'][_0x8232('0x46')]({'where':{'id':_0x1ccb51[_0x8232('0x43')]['id']}})[_0x8232('0x22')](handleEntityNotFound(_0x2cd8ae,null))['then'](saveUpdates(_0x1ccb51[_0x8232('0x48')],null))[_0x8232('0x22')](respondWithResult(_0x2cd8ae,null))['catch'](handleError(_0x2cd8ae,null));};exports[_0x8232('0x23')]=function(_0x776ddd,_0x13ccf9){return db['SalesforceField'][_0x8232('0x46')]({'where':{'id':_0x776ddd[_0x8232('0x43')]['id']}})[_0x8232('0x22')](handleEntityNotFound(_0x13ccf9,null))[_0x8232('0x22')](removeEntity(_0x13ccf9,null))[_0x8232('0x41')](handleError(_0x13ccf9,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 5d62c8b..1893265 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 _0xdc34=['moment','request-promise','rimraf','../../config/environment','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x467c9c,_0x2c4181){var _0x1c3ecc=function(_0xf908d1){while(--_0xf908d1){_0x467c9c['push'](_0x467c9c['shift']());}};_0x1c3ecc(++_0x2c4181);}(_0xdc34,0x6c));var _0x4dc3=function(_0x25a46f,_0x1f5006){_0x25a46f=_0x25a46f-0x0;var _0x64f318=_0xdc34[_0x25a46f];return _0x64f318;};'use strict';var _=require(_0x4dc3('0x0'));var util=require(_0x4dc3('0x1'));var logger=require(_0x4dc3('0x2'))(_0x4dc3('0x3'));var moment=require(_0x4dc3('0x4'));var BPromise=require('bluebird');var rp=require(_0x4dc3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4dc3('0x6'));var config=require(_0x4dc3('0x7'));var attributes=require('./intSalesforceField.attributes');module[_0x4dc3('0x8')]=function(_0x1ac987,_0x44e366){return _0x1ac987['define'](_0x4dc3('0x9'),attributes,{'tableName':_0x4dc3('0xa'),'paranoid':![],'indexes':[{'name':_0x4dc3('0xb'),'fields':[_0x4dc3('0xc'),_0x4dc3('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0408=['./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x162ee0,_0x291661){var _0x48fc5e=function(_0x297a35){while(--_0x297a35){_0x162ee0['push'](_0x162ee0['shift']());}};_0x48fc5e(++_0x291661);}(_0x0408,0xe9));var _0x8040=function(_0x1f0a91,_0x1223d4){_0x1f0a91=_0x1f0a91-0x0;var _0x157daa=_0x0408[_0x1f0a91];return _0x157daa;};'use strict';var _=require(_0x8040('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8040('0x1'));var moment=require(_0x8040('0x2'));var BPromise=require(_0x8040('0x3'));var rp=require(_0x8040('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8040('0x5'));var config=require(_0x8040('0x6'));var attributes=require(_0x8040('0x7'));module[_0x8040('0x8')]=function(_0x13a3e3,_0x877484){return _0x13a3e3[_0x8040('0x9')](_0x8040('0xa'),attributes,{'tableName':_0x8040('0xb'),'paranoid':![],'indexes':[{'name':_0x8040('0xc'),'fields':[_0x8040('0xd'),_0x8040('0xe')],'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 75ea3b5..eef3781 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 _0xccf9=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request','then','info','debug','request\x20sent','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','bluebird'];(function(_0x269aac,_0x426352){var _0x52f530=function(_0xc9a6e0){while(--_0xc9a6e0){_0x269aac['push'](_0x269aac['shift']());}};_0x52f530(++_0x426352);}(_0xccf9,0x1d9));var _0x9ccf=function(_0x3ef521,_0x43a044){_0x3ef521=_0x3ef521-0x0;var _0x3cc8b0=_0xccf9[_0x3ef521];return _0x3cc8b0;};'use strict';var _=require(_0x9ccf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9ccf('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ccf('0x2'));var db=require(_0x9ccf('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9ccf('0x4'));var config=require(_0x9ccf('0x5'));var jayson=require(_0x9ccf('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x428c7b,_0x3a706d,_0x2d243a){return new BPromise(function(_0x11b886,_0x58108f){return client[_0x9ccf('0x7')](_0x428c7b,_0x2d243a)[_0x9ccf('0x8')](function(_0x4e2033){logger[_0x9ccf('0x9')]('SalesforceField,\x20%s,\x20%s',_0x3a706d,'request\x20sent');logger[_0x9ccf('0xa')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x3a706d,_0x9ccf('0xb'),JSON[_0x9ccf('0xc')](_0x4e2033));if(_0x4e2033[_0x9ccf('0xd')]){if(_0x4e2033[_0x9ccf('0xd')][_0x9ccf('0xe')]===0x1f4){logger[_0x9ccf('0xd')](_0x9ccf('0xf'),_0x3a706d,_0x4e2033[_0x9ccf('0xd')][_0x9ccf('0x10')]);return _0x58108f(_0x4e2033[_0x9ccf('0xd')][_0x9ccf('0x10')]);}logger[_0x9ccf('0xd')](_0x9ccf('0xf'),_0x3a706d,_0x4e2033[_0x9ccf('0xd')][_0x9ccf('0x10')]);return _0x11b886(_0x4e2033[_0x9ccf('0xd')][_0x9ccf('0x10')]);}else{logger[_0x9ccf('0x9')](_0x9ccf('0xf'),_0x3a706d,_0x9ccf('0xb'));_0x11b886(_0x4e2033[_0x9ccf('0x11')][_0x9ccf('0x10')]);}})[_0x9ccf('0x12')](function(_0x12d5fa){logger[_0x9ccf('0xd')](_0x9ccf('0xf'),_0x3a706d,_0x12d5fa);_0x58108f(_0x12d5fa);});});} \ No newline at end of file +var _0x15ca=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x50bf57,_0x4dcb09){var _0x4c9753=function(_0x403824){while(--_0x403824){_0x50bf57['push'](_0x50bf57['shift']());}};_0x4c9753(++_0x4dcb09);}(_0x15ca,0x108));var _0xa15c=function(_0x1ef0c5,_0xfbc02e){_0x1ef0c5=_0x1ef0c5-0x0;var _0x5c21d2=_0x15ca[_0x1ef0c5];return _0x5c21d2;};'use strict';var _=require(_0xa15c('0x0'));var util=require(_0xa15c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa15c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa15c('0x3'))['db'];var utils=require(_0xa15c('0x4'));var logger=require(_0xa15c('0x5'))(_0xa15c('0x6'));var config=require(_0xa15c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa15c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14eee5,_0x121403,_0x2bbaab){return new BPromise(function(_0x40d0ab,_0x37e2e7){return client['request'](_0x14eee5,_0x2bbaab)['then'](function(_0x367ec0){logger[_0xa15c('0x9')](_0xa15c('0xa'),_0x121403,_0xa15c('0xb'));logger[_0xa15c('0xc')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x121403,_0xa15c('0xb'),JSON[_0xa15c('0xd')](_0x367ec0));if(_0x367ec0[_0xa15c('0xe')]){if(_0x367ec0[_0xa15c('0xe')][_0xa15c('0xf')]===0x1f4){logger[_0xa15c('0xe')](_0xa15c('0xa'),_0x121403,_0x367ec0[_0xa15c('0xe')]['message']);return _0x37e2e7(_0x367ec0[_0xa15c('0xe')][_0xa15c('0x10')]);}logger[_0xa15c('0xe')](_0xa15c('0xa'),_0x121403,_0x367ec0['error'][_0xa15c('0x10')]);return _0x40d0ab(_0x367ec0['error'][_0xa15c('0x10')]);}else{logger[_0xa15c('0x9')](_0xa15c('0xa'),_0x121403,_0xa15c('0xb'));_0x40d0ab(_0x367ec0[_0xa15c('0x11')][_0xa15c('0x10')]);}})[_0xa15c('0x12')](function(_0x4c55d7){logger[_0xa15c('0xe')](_0xa15c('0xa'),_0x121403,_0x4c55d7);_0x37e2e7(_0x4c55d7);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index c2d2e40..236e431 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 _0x5ab4=['getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations'];(function(_0x3da860,_0x2eef2d){var _0x4d0bf3=function(_0x15e77b){while(--_0x15e77b){_0x3da860['push'](_0x3da860['shift']());}};_0x4d0bf3(++_0x2eef2d);}(_0x5ab4,0x9f));var _0x45ab=function(_0x8a4bbc,_0x603716){_0x8a4bbc=_0x8a4bbc-0x0;var _0x464349=_0x5ab4[_0x8a4bbc];return _0x464349;};'use strict';var multer=require(_0x45ab('0x0'));var util=require(_0x45ab('0x1'));var path=require(_0x45ab('0x2'));var timeout=require(_0x45ab('0x3'));var express=require(_0x45ab('0x4'));var router=express['Router']();var fs_extra=require(_0x45ab('0x5'));var auth=require(_0x45ab('0x6'));var interaction=require(_0x45ab('0x7'));var config=require(_0x45ab('0x8'));var controller=require(_0x45ab('0x9'));router[_0x45ab('0xa')]('/',auth['isAuthenticated'](),controller[_0x45ab('0xb')]);router[_0x45ab('0xa')](_0x45ab('0xc'),auth[_0x45ab('0xd')](),controller[_0x45ab('0xe')]);router[_0x45ab('0xa')](_0x45ab('0xf'),auth[_0x45ab('0xd')](),controller[_0x45ab('0x10')]);router[_0x45ab('0xa')](_0x45ab('0x11'),auth[_0x45ab('0xd')](),controller[_0x45ab('0x12')]);router['post']('/',auth[_0x45ab('0xd')](),controller[_0x45ab('0x13')]);router[_0x45ab('0x14')](_0x45ab('0xf'),auth[_0x45ab('0xd')](),controller[_0x45ab('0x15')]);router[_0x45ab('0x16')](_0x45ab('0xc'),auth[_0x45ab('0xd')](),controller['update']);router['delete'](_0x45ab('0xc'),auth[_0x45ab('0xd')](),controller[_0x45ab('0x17')]);module[_0x45ab('0x18')]=router; \ No newline at end of file +var _0xf756=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','util'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0xf756,0x1ae));var _0x6f75=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xf756[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x6f75('0x0'));var util=require(_0x6f75('0x1'));var path=require('path');var timeout=require(_0x6f75('0x2'));var express=require(_0x6f75('0x3'));var router=express['Router']();var fs_extra=require(_0x6f75('0x4'));var auth=require(_0x6f75('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6f75('0x6'));var controller=require(_0x6f75('0x7'));router[_0x6f75('0x8')]('/',auth[_0x6f75('0x9')](),controller[_0x6f75('0xa')]);router[_0x6f75('0x8')](_0x6f75('0xb'),auth[_0x6f75('0x9')](),controller[_0x6f75('0xc')]);router[_0x6f75('0x8')](_0x6f75('0xd'),auth[_0x6f75('0x9')](),controller[_0x6f75('0xe')]);router[_0x6f75('0x8')](_0x6f75('0xf'),auth[_0x6f75('0x9')](),controller[_0x6f75('0x10')]);router[_0x6f75('0x11')]('/',auth[_0x6f75('0x9')](),controller[_0x6f75('0x12')]);router[_0x6f75('0x11')](_0x6f75('0xd'),auth[_0x6f75('0x9')](),controller[_0x6f75('0x13')]);router['put'](_0x6f75('0xb'),auth[_0x6f75('0x9')](),controller[_0x6f75('0x14')]);router[_0x6f75('0x15')](_0x6f75('0xb'),auth[_0x6f75('0x9')](),controller[_0x6f75('0x16')]);module[_0x6f75('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 3543d84..56abfc2 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 _0x9ac6=['exports','STRING','username','remoteUri','sequelize'];(function(_0x4c11e4,_0x5cf3ba){var _0x5b43dd=function(_0x53eece){while(--_0x53eece){_0x4c11e4['push'](_0x4c11e4['shift']());}};_0x5b43dd(++_0x5cf3ba);}(_0x9ac6,0x10d));var _0x69ac=function(_0x30d859,_0x2c9398){_0x30d859=_0x30d859-0x0;var _0x51d750=_0x9ac6[_0x30d859];return _0x51d750;};'use strict';var Sequelize=require(_0x69ac('0x0'));module[_0x69ac('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x69ac('0x2')]},'username':{'type':Sequelize[_0x69ac('0x2')],'unique':_0x69ac('0x3')},'password':{'type':Sequelize[_0x69ac('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x69ac('0x2')],'unique':_0x69ac('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xcd68=['remoteUri','STRING'];(function(_0x22bdca,_0x4edf96){var _0xfa6309=function(_0x307633){while(--_0x307633){_0x22bdca['push'](_0x22bdca['shift']());}};_0xfa6309(++_0x4edf96);}(_0xcd68,0xbb));var _0x8cd6=function(_0x2f5a22,_0x5e9f03){_0x2f5a22=_0x2f5a22-0x0;var _0x326b70=_0xcd68[_0x2f5a22];return _0x326b70;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8cd6('0x0')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x8cd6('0x0')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x8cd6('0x0')]},'remoteUri':{'type':Sequelize[_0x8cd6('0x0')],'unique':_0x8cd6('0x1')},'serverUrl':{'type':Sequelize[_0x8cd6('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 0373b0a..33c2f54 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 _0x786d=['attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','ServicenowAccount','includeAll','include','rows','keys','find','create','catch','body','params','findOne','ServicenowConfiguration','order','getConfigurations','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','parent','caused_by','sys_updated_on','approval_history','number','sys_updated_by','opened_by','sys_created_on','state','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','work_notes_list','business_service','sys_domain_path','time_worked','expected_start','group_list','work_end','resolved_at','caller_id','approval_set','work_notes','short_description','delivery_task','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','severity','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','category','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','internalType','push','all','TCL:\x20_object','remove','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','label','concat','test','statusCode','Wrong\x20credentials','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields'];(function(_0x36d25e,_0x1a047d){var _0x4b95b8=function(_0x74da3){while(--_0x74da3){_0x36d25e['push'](_0x36d25e['shift']());}};_0x4b95b8(++_0x1a047d);}(_0x786d,0x84));var _0xd786=function(_0xe0829c,_0x263827){_0xe0829c=_0xe0829c-0x0;var _0x246b53=_0x786d[_0xe0829c];return _0x246b53;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd786('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd786('0x1'));var moment=require('moment');var BPromise=require(_0xd786('0x2'));var Mustache=require(_0xd786('0x3'));var util=require(_0xd786('0x4'));var path=require(_0xd786('0x5'));var sox=require(_0xd786('0x6'));var csv=require(_0xd786('0x7'));var ejs=require(_0xd786('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd786('0x9'));var squel=require('squel');var crypto=require(_0xd786('0xa'));var jsforce=require(_0xd786('0xb'));var deskjs=require(_0xd786('0xc'));var toCsv=require(_0xd786('0x7'));var querystring=require('querystring');var Papa=require(_0xd786('0xd'));var Redis=require(_0xd786('0xe'));var authService=require(_0xd786('0xf'));var qs=require(_0xd786('0x10'));var as=require(_0xd786('0x11'));var hardwareService=require(_0xd786('0x12'));var logger=require(_0xd786('0x13'))('api');var utils=require(_0xd786('0x14'));var config=require(_0xd786('0x15'));var licenseUtil=require(_0xd786('0x16'));var db=require(_0xd786('0x17'))['db'];var integrations=require(_0xd786('0x18'));function respondWithStatusCode(_0x27516b,_0x5df632){_0x5df632=_0x5df632||0xcc;return function(_0x3fbeaf){if(_0x3fbeaf){return _0x27516b[_0xd786('0x19')](_0x5df632);}return _0x27516b[_0xd786('0x1a')](_0x5df632)[_0xd786('0x1b')]();};}function respondWithResult(_0x59fae7,_0x553f28){_0x553f28=_0x553f28||0xc8;return function(_0xd763e7){if(_0xd763e7){return _0x59fae7[_0xd786('0x1a')](_0x553f28)['json'](_0xd763e7);}};}function respondWithFilteredResult(_0x1652b9,_0x850d99){return function(_0x3c05b8){if(_0x3c05b8){var _0x12fe1e=typeof _0x850d99[_0xd786('0x1c')]===_0xd786('0x1d')&&typeof _0x850d99[_0xd786('0x1e')]===_0xd786('0x1d');var _0x2e0812=_0x3c05b8[_0xd786('0x1f')];var _0x392102=_0x12fe1e?0x0:_0x850d99['offset'];var _0x2a2cbc=_0x12fe1e?_0x3c05b8[_0xd786('0x1f')]:_0x850d99[_0xd786('0x1c')]+_0x850d99[_0xd786('0x1e')];var _0x299412;if(_0x2a2cbc>=_0x2e0812){_0x2a2cbc=_0x2e0812;_0x299412=0xc8;}else{_0x299412=0xce;}_0x1652b9[_0xd786('0x1a')](_0x299412);return _0x1652b9['set']('Content-Range',_0x392102+'-'+_0x2a2cbc+'/'+_0x2e0812)[_0xd786('0x20')](_0x3c05b8);}return null;};}function patchUpdates(_0x43fa38){return function(_0x1e1da5){try{jsonpatch[_0xd786('0x21')](_0x1e1da5,_0x43fa38,!![]);}catch(_0x4ea05c){return BPromise[_0xd786('0x22')](_0x4ea05c);}return _0x1e1da5[_0xd786('0x23')]();};}function saveUpdates(_0x1a2bf8,_0x228e68){return function(_0x4db897){if(_0x4db897){return _0x4db897[_0xd786('0x24')](_0x1a2bf8)[_0xd786('0x25')](function(_0x125514){return _0x125514;});}return null;};}function removeEntity(_0x2efc39,_0x1f11e7){return function(_0x5dee53){if(_0x5dee53){return _0x5dee53[_0xd786('0x26')]()[_0xd786('0x25')](function(){_0x2efc39[_0xd786('0x1a')](0xcc)[_0xd786('0x1b')]();});}};}function handleEntityNotFound(_0x384e03,_0x1b1ff2){return function(_0x28edc8){if(!_0x28edc8){_0x384e03[_0xd786('0x19')](0x194);}return _0x28edc8;};}function handleError(_0x4dbd82,_0x4c6e44){_0x4c6e44=_0x4c6e44||0x1f4;return function(_0x1aaaef){logger[_0xd786('0x27')](_0x1aaaef[_0xd786('0x28')]);if(_0x1aaaef[_0xd786('0x29')]){delete _0x1aaaef[_0xd786('0x29')];}_0x4dbd82[_0xd786('0x1a')](_0x4c6e44)[_0xd786('0x2a')](_0x1aaaef);};}exports[_0xd786('0x2b')]=function(_0x408aaa,_0x1a75c2){var _0x72030a={},_0x39e531={},_0x2227cb={'count':0x0,'rows':[]};var _0x6a1a73=_[_0xd786('0x2c')](db['ServicenowAccount'][_0xd786('0x2d')],function(_0x1f23b1){return{'name':_0x1f23b1[_0xd786('0x2e')],'type':_0x1f23b1[_0xd786('0x2f')][_0xd786('0x30')]};});_0x39e531[_0xd786('0x31')]=_['map'](_0x6a1a73,_0xd786('0x29'));_0x39e531[_0xd786('0x32')]=_['keys'](_0x408aaa[_0xd786('0x32')]);_0x39e531[_0xd786('0x33')]=_[_0xd786('0x34')](_0x39e531[_0xd786('0x31')],_0x39e531[_0xd786('0x32')]);_0x72030a['attributes']=_[_0xd786('0x34')](_0x39e531['model'],qs[_0xd786('0x35')](_0x408aaa[_0xd786('0x32')][_0xd786('0x35')]));_0x72030a[_0xd786('0x36')]=_0x72030a['attributes'][_0xd786('0x37')]?_0x72030a[_0xd786('0x36')]:_0x39e531[_0xd786('0x31')];if(!_0x408aaa['query'][_0xd786('0x38')](_0xd786('0x39'))){_0x72030a[_0xd786('0x1e')]=qs[_0xd786('0x1e')](_0x408aaa[_0xd786('0x32')][_0xd786('0x1e')]);_0x72030a[_0xd786('0x1c')]=qs[_0xd786('0x1c')](_0x408aaa[_0xd786('0x32')][_0xd786('0x1c')]);}_0x72030a['order']=qs[_0xd786('0x3a')](_0x408aaa[_0xd786('0x32')]['sort']);_0x72030a[_0xd786('0x3b')]=qs[_0xd786('0x33')](_[_0xd786('0x3c')](_0x408aaa[_0xd786('0x32')],_0x39e531['filters']),_0x6a1a73);if(_0x408aaa['query'][_0xd786('0x3d')]){_0x72030a[_0xd786('0x3b')]=_[_0xd786('0x3e')](_0x72030a[_0xd786('0x3b')],{'$or':_[_0xd786('0x2c')](_0x6a1a73,function(_0x32f3d2){if(_0x32f3d2[_0xd786('0x2f')]!=='VIRTUAL'){var _0x4278e4={};_0x4278e4[_0x32f3d2['name']]={'$like':'%'+_0x408aaa[_0xd786('0x32')][_0xd786('0x3d')]+'%'};return _0x4278e4;}})});}_0x72030a=_[_0xd786('0x3e')]({},_0x72030a,_0x408aaa[_0xd786('0x3f')]);var _0x411575={'where':_0x72030a['where']};return db[_0xd786('0x40')][_0xd786('0x1f')](_0x411575)[_0xd786('0x25')](function(_0x1d963a){_0x2227cb[_0xd786('0x1f')]=_0x1d963a;if(_0x408aaa[_0xd786('0x32')][_0xd786('0x41')]){_0x72030a[_0xd786('0x42')]=[{'all':!![]}];}return db[_0xd786('0x40')]['findAll'](_0x72030a);})[_0xd786('0x25')](function(_0x4cba3b){_0x2227cb[_0xd786('0x43')]=_0x4cba3b;return _0x2227cb;})[_0xd786('0x25')](respondWithFilteredResult(_0x1a75c2,_0x72030a))['catch'](handleError(_0x1a75c2,null));};exports['show']=function(_0x20b13c,_0x1c1c47){var _0x1cb197={'raw':![],'where':{'id':_0x20b13c['params']['id']}},_0x59929c={};_0x59929c[_0xd786('0x31')]=_['keys'](db[_0xd786('0x40')][_0xd786('0x2d')]);_0x59929c['query']=_[_0xd786('0x44')](_0x20b13c['query']);_0x59929c[_0xd786('0x33')]=_[_0xd786('0x34')](_0x59929c[_0xd786('0x31')],_0x59929c[_0xd786('0x32')]);_0x1cb197[_0xd786('0x36')]=_[_0xd786('0x34')](_0x59929c[_0xd786('0x31')],qs[_0xd786('0x35')](_0x20b13c[_0xd786('0x32')]['fields']));_0x1cb197[_0xd786('0x36')]=_0x1cb197[_0xd786('0x36')][_0xd786('0x37')]?_0x1cb197['attributes']:_0x59929c['model'];if(_0x20b13c[_0xd786('0x32')][_0xd786('0x41')]){_0x1cb197['include']=[{'all':!![]}];}_0x1cb197=_[_0xd786('0x3e')]({},_0x1cb197,_0x20b13c['options']);return db[_0xd786('0x40')][_0xd786('0x45')](_0x1cb197)[_0xd786('0x25')](handleEntityNotFound(_0x1c1c47,null))['then'](respondWithResult(_0x1c1c47,null))['catch'](handleError(_0x1c1c47,null));};exports[_0xd786('0x46')]=function(_0x3a5434,_0x2ed98d){return db[_0xd786('0x40')][_0xd786('0x46')](_0x3a5434['body'],{})[_0xd786('0x25')](respondWithResult(_0x2ed98d,0xc9))[_0xd786('0x47')](handleError(_0x2ed98d,null));};exports['update']=function(_0x3512b6,_0x21087e){if(_0x3512b6[_0xd786('0x48')]['id']){delete _0x3512b6['body']['id'];}return db['ServicenowAccount'][_0xd786('0x45')]({'where':{'id':_0x3512b6[_0xd786('0x49')]['id']}})[_0xd786('0x25')](handleEntityNotFound(_0x21087e,null))['then'](saveUpdates(_0x3512b6[_0xd786('0x48')],null))[_0xd786('0x25')](respondWithResult(_0x21087e,null))[_0xd786('0x47')](handleError(_0x21087e,null));};exports[_0xd786('0x26')]=function(_0x56a56d,_0x5ea8af){return db['ServicenowAccount'][_0xd786('0x45')]({'where':{'id':_0x56a56d[_0xd786('0x49')]['id']}})[_0xd786('0x25')](handleEntityNotFound(_0x5ea8af,null))[_0xd786('0x25')](removeEntity(_0x5ea8af,null))[_0xd786('0x47')](handleError(_0x5ea8af,null));};exports['getConfigurations']=function(_0x1cf09f,_0x16dd84,_0xa9d82){var _0x4125b8={};var _0x457d86={};var _0x4ef044;var _0x3ed4e5;return db['ServicenowAccount'][_0xd786('0x4a')]({'where':{'id':_0x1cf09f[_0xd786('0x49')]['id']}})[_0xd786('0x25')](handleEntityNotFound(_0x16dd84,null))[_0xd786('0x25')](function(_0xa64751){if(_0xa64751){_0x4ef044=_0xa64751;_0x457d86[_0xd786('0x31')]=_[_0xd786('0x44')](db[_0xd786('0x4b')]['rawAttributes']);_0x457d86[_0xd786('0x32')]=_[_0xd786('0x44')](_0x1cf09f[_0xd786('0x32')]);_0x457d86[_0xd786('0x33')]=_[_0xd786('0x34')](_0x457d86[_0xd786('0x31')],_0x457d86[_0xd786('0x32')]);_0x4125b8['attributes']=_[_0xd786('0x34')](_0x457d86[_0xd786('0x31')],qs['fields'](_0x1cf09f[_0xd786('0x32')][_0xd786('0x35')]));_0x4125b8[_0xd786('0x36')]=_0x4125b8[_0xd786('0x36')][_0xd786('0x37')]?_0x4125b8[_0xd786('0x36')]:_0x457d86[_0xd786('0x31')];_0x4125b8[_0xd786('0x4c')]=qs[_0xd786('0x3a')](_0x1cf09f['query'][_0xd786('0x3a')]);_0x4125b8[_0xd786('0x3b')]=qs[_0xd786('0x33')](_[_0xd786('0x3c')](_0x1cf09f['query'],_0x457d86[_0xd786('0x33')]));if(_0x1cf09f[_0xd786('0x32')][_0xd786('0x3d')]){_0x4125b8['where']=_[_0xd786('0x3e')](_0x4125b8[_0xd786('0x3b')],{'$or':_[_0xd786('0x2c')](_0x4125b8[_0xd786('0x36')],function(_0x370ee1){var _0x3c011a={};_0x3c011a[_0x370ee1]={'$like':'%'+_0x1cf09f[_0xd786('0x32')][_0xd786('0x3d')]+'%'};return _0x3c011a;})});}_0x4125b8=_[_0xd786('0x3e')]({},_0x4125b8,_0x1cf09f[_0xd786('0x3f')]);return _0x4ef044[_0xd786('0x4d')](_0x4125b8);}})[_0xd786('0x25')](function(_0xad952){if(_0xad952){_0x3ed4e5=_0xad952[_0xd786('0x37')];if(!_0x1cf09f[_0xd786('0x32')][_0xd786('0x38')](_0xd786('0x39'))){_0x4125b8[_0xd786('0x1e')]=qs[_0xd786('0x1e')](_0x1cf09f[_0xd786('0x32')][_0xd786('0x1e')]);_0x4125b8[_0xd786('0x1c')]=qs[_0xd786('0x1c')](_0x1cf09f[_0xd786('0x32')]['offset']);}return _0x4ef044[_0xd786('0x4d')](_0x4125b8);}})[_0xd786('0x25')](function(_0x3604ee){if(_0x3604ee){return _0x3604ee?{'count':_0x3ed4e5,'rows':_0x3604ee}:null;}})[_0xd786('0x25')](respondWithResult(_0x16dd84,null))['catch'](handleError(_0x16dd84,null));};exports['addConfiguration']=function(_0x1c3eea,_0x2a9f98,_0xc78c7f){if(_0x1c3eea[_0xd786('0x48')]['id']){delete _0x1c3eea['body']['id'];}return db[_0xd786('0x40')][_0xd786('0x4a')]({'where':{'id':_0x1c3eea[_0xd786('0x49')]['id']}})[_0xd786('0x25')](handleEntityNotFound(_0x2a9f98,null))['then'](function(_0x193a59){if(_0x193a59){_0x1c3eea[_0xd786('0x48')]['AccountId']=_0x193a59['id'];_0x1c3eea['body'][_0xd786('0x4e')]=integrations[_0xd786('0x4f')](_0x1c3eea[_0xd786('0x48')][_0xd786('0x50')],_0x1c3eea[_0xd786('0x48')]['type']);_0x1c3eea[_0xd786('0x48')][_0xd786('0x51')]=integrations[_0xd786('0x52')](_0x1c3eea[_0xd786('0x48')][_0xd786('0x50')],_0x1c3eea['body']['type']);return db[_0xd786('0x4b')][_0xd786('0x46')](_0x1c3eea[_0xd786('0x48')],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db[_0xd786('0x53')],'as':'Descriptions'}]});}return null;})[_0xd786('0x25')](respondWithResult(_0x2a9f98,null))['catch'](handleError(_0x2a9f98,null));};exports[_0xd786('0x54')]=function(_0x16388d,_0x48dd1b,_0x75f7c){var _0x47b406=[_0xd786('0x55'),_0xd786('0x56'),_0xd786('0x57'),_0xd786('0x58'),_0xd786('0x59'),_0xd786('0x5a'),'incident_state','severity','category'];var _0x480ff2=[_0xd786('0x5b'),_0xd786('0x55'),_0xd786('0x5c'),'watch_list','upon_reject',_0xd786('0x5d'),'child_incidents',_0xd786('0x56'),_0xd786('0x5e'),_0xd786('0x5f'),'resolved_by',_0xd786('0x60'),_0xd786('0x61'),'user_input',_0xd786('0x62'),'sys_domain',_0xd786('0x63'),_0xd786('0x64'),_0xd786('0x57'),_0xd786('0x4c'),_0xd786('0x65'),_0xd786('0x66'),'cmdb_ci',_0xd786('0x67'),_0xd786('0x68'),'active',_0xd786('0x69'),_0xd786('0x6a'),'priority',_0xd786('0x6b'),'rfc',_0xd786('0x6c'),_0xd786('0x6d'),'opened_at','business_duration',_0xd786('0x6e'),_0xd786('0x6f'),'reopened_time',_0xd786('0x70'),_0xd786('0x71'),_0xd786('0x72'),'subcategory',_0xd786('0x73'),_0xd786('0x74'),_0xd786('0x59'),'correlation_display',_0xd786('0x75'),'work_start',_0xd786('0x76'),_0xd786('0x77'),_0xd786('0x78'),_0xd786('0x79'),_0xd786('0x7a'),'notify','sys_class_name',_0xd786('0x7b'),_0xd786('0x7c'),_0xd786('0x7d'),_0xd786('0x7e'),_0xd786('0x7f'),'contact_type',_0xd786('0x80'),_0xd786('0x81'),_0xd786('0x82'),_0xd786('0x83'),_0xd786('0x84'),_0xd786('0x85'),_0xd786('0x86'),_0xd786('0x87'),_0xd786('0x88'),_0xd786('0x89'),_0xd786('0x8a'),_0xd786('0x8b'),_0xd786('0x8c'),_0xd786('0x8d'),_0xd786('0x8e'),_0xd786('0x8f'),_0xd786('0x90'),_0xd786('0x91'),_0xd786('0x92'),_0xd786('0x93'),_0xd786('0x94'),_0xd786('0x95')];var _0x442780='';var _0x2de059='';var _0x125496=[];var _0x28aee8='';var _0x1c904a='';var _0x110e12=[];var _0x5a6f27='';var _0x309b03='';var _0x57bf31={};var _0x575027='';return db[_0xd786('0x40')]['findOne']({'where':{'id':_0x16388d[_0xd786('0x49')]['id']},'attributes':['id','username',_0xd786('0x96'),_0xd786('0x97'),_0xd786('0x98'),_0xd786('0x99')]})[_0xd786('0x25')](handleEntityNotFound(_0x48dd1b,null))[_0xd786('0x25')](function(_0x2053e7){if(_0x2053e7){_0x575027=_0x2053e7[_0xd786('0x98')];var _0x2f7960=_0x575027[_0xd786('0x9a')](-0x1);if(_0x2f7960==='/'){_0x575027=_0x575027[_0xd786('0x9b')](0x0,_0x575027[_0xd786('0x9c')](_0x2f7960));}_0x309b03=util[_0xd786('0x9d')]('%s/api/now/doc/table/schema/',_0x575027);_0x5a6f27=util[_0xd786('0x9d')](_0xd786('0x9e'),_0x575027);_0x57bf31={'user':_0x2053e7[_0xd786('0x9f')],'pass':_0x2053e7['password']};var _0xed713e={'method':_0xd786('0xa0'),'uri':_0x309b03+_0xd786('0xa1'),'auth':_0x57bf31,'json':!![]};return rp(_0xed713e);}})[_0xd786('0x25')](function(_0x5ece31){if(_0x5ece31[_0xd786('0xa2')]['length']>0x0){_0x442780=_0x5ece31[_0xd786('0xa2')];}console[_0xd786('0xa3')](_0xd786('0xa4'),_0x442780);_0x110e12=[];_0x2de059=Object[_0xd786('0xa5')]([],_0x442780);_['remove'](_0x2de059,function(_0x4708e1){return!_0x47b406['includes'](_0x4708e1['name']);});_0x2de059['forEach'](function(_0xd4ea04){var _0x12934e=createFieldObject(_0x5a6f27,_0x57bf31,_0xd4ea04[_0xd786('0xa6')],_0xd4ea04[_0xd786('0x29')],_0xd4ea04['label'],![]);_0x110e12[_0xd786('0xa7')](_0x12934e);});return Promise[_0xd786('0xa8')](_0x110e12);})[_0xd786('0x25')](function(_0x3fe0a3){_0x125496=_0x3fe0a3;_0x28aee8=Object[_0xd786('0xa5')]([],_0x442780);console[_0xd786('0xa3')](_0xd786('0xa9'),_0x442780);_[_0xd786('0xaa')](_0x28aee8,function(_0x22417f){return _0x480ff2[_0xd786('0xab')](_0x22417f[_0xd786('0x29')]);});console['log'](_0xd786('0xac'),_0x28aee8);_0x110e12=[];_0x28aee8[_0xd786('0xad')](function(_0xd45632){var _0x13106d=createFieldObject(_0x5a6f27,_0x57bf31,_0xd45632[_0xd786('0xa6')],_0xd45632[_0xd786('0x29')],_0xd45632[_0xd786('0xae')],!![]);_0x110e12[_0xd786('0xa7')](_0x13106d);});return Promise[_0xd786('0xa8')](_0x110e12);})[_0xd786('0x25')](function(_0x4508be){_0x1c904a=_0x4508be;var _0x5cfe39=_0x125496[_0xd786('0xaf')](_0x1c904a);return{'count':_0x5cfe39['length'],'rows':_0x5cfe39};})[_0xd786('0x25')](respondWithResult(_0x48dd1b,null))[_0xd786('0x47')](function(_0x30a98c){console[_0xd786('0xa3')]('ServiceNow\x20error:\x20'+_0x30a98c);var _0x1aa3d8=_0x16388d[_0xd786('0x32')][_0xd786('0xb0')]?0x1f4:_0x30a98c[_0xd786('0xb1')]||0x1f4;logger[_0xd786('0x27')](_0x30a98c[_0xd786('0x28')]);delete _0x30a98c[_0xd786('0x29')];if(_0x1aa3d8===0x191){_0x1aa3d8=0x190;}_0x48dd1b[_0xd786('0x1a')](_0x1aa3d8)['send'](_0x16388d[_0xd786('0x32')]['test']?{'message':_0xd786('0xb2'),'statusCode':_0x30a98c[_0xd786('0xb1')]}:_0x30a98c);});};function createFieldObject(_0x29d5d9,_0x13c2c4,_0x4e0cd1,_0x38327a,_0x43ae45,_0x332d85){return new Promise(function(_0x581619,_0x4e51d3){var _0x3276c2={'id':_0x38327a,'name':_0x43ae45,'custom':_0x332d85};if(_0x4e0cd1==='boolean'){_0x3276c2['options']=[{'name':_0xd786('0xb3'),'value':_0xd786('0xb4')},{'name':_0xd786('0xb5'),'value':_0xd786('0xb6')}];_0x581619(_0x3276c2);}else{var _0x3c4dfa={'method':_0xd786('0xa0'),'uri':_0x29d5d9+_0xd786('0xb7')+_0x38327a,'auth':_0x13c2c4,'json':!![]};return rp(_0x3c4dfa)[_0xd786('0x25')](function(_0x26df1f){var _0x1aa25d=[];if(_0x26df1f['result'][_0xd786('0x37')]>0x0){_0x26df1f['result'][_0xd786('0xad')](function(_0x2b50f5){if(_0x2b50f5[_0xd786('0xb8')]===_0xd786('0xb6')){var _0x515764={'name':_0x2b50f5[_0xd786('0xae')],'value':_0x2b50f5[_0xd786('0xb9')]};_0x1aa25d['push'](_0x515764);}});}_0x3276c2[_0xd786('0x3f')]=_0x1aa25d;if(_0x3276c2['options'][_0xd786('0x37')]>0x0){_0x581619(_0x3276c2);}else{if(_0x332d85==![]){_0x581619();}else{_0x581619(_0x3276c2);}}});}});} \ No newline at end of file +var _0x4934=['sla_due','approval','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','category','username','password','email','serverUrl','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','forEach','internalType','label','push','all','log','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','boolean','True','true','false','inactive','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','map','ServicenowAccount','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','create','body','find','ServicenowConfiguration','getConfigurations','addConfiguration','findOne','Subjects','getSubjects','channel','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','resolved_by','sys_updated_by','user_input','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','delivery_task','assignment_group','business_stc','description','sys_class_name','close_notes','closed_by','parent_incident','contact_type','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments'];(function(_0x3fd831,_0x51ae7f){var _0xe51f1e=function(_0x3f41e2){while(--_0x3f41e2){_0x3fd831['push'](_0x3fd831['shift']());}};_0xe51f1e(++_0x51ae7f);}(_0x4934,0x19b));var _0x4493=function(_0x1834eb,_0x41d5f8){_0x1834eb=_0x1834eb-0x0;var _0x50ea19=_0x4934[_0x1834eb];return _0x50ea19;};'use strict';var emlformat=require(_0x4493('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4493('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4493('0x2'));var moment=require(_0x4493('0x3'));var BPromise=require(_0x4493('0x4'));var Mustache=require(_0x4493('0x5'));var util=require(_0x4493('0x6'));var path=require('path');var sox=require(_0x4493('0x7'));var csv=require(_0x4493('0x8'));var ejs=require(_0x4493('0x9'));var fs=require('fs');var fs_extra=require(_0x4493('0xa'));var _=require(_0x4493('0xb'));var squel=require('squel');var crypto=require(_0x4493('0xc'));var jsforce=require(_0x4493('0xd'));var deskjs=require(_0x4493('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4493('0xf'));var Papa=require(_0x4493('0x10'));var Redis=require('ioredis');var authService=require(_0x4493('0x11'));var qs=require(_0x4493('0x12'));var as=require(_0x4493('0x13'));var hardwareService=require(_0x4493('0x14'));var logger=require(_0x4493('0x15'))('api');var utils=require(_0x4493('0x16'));var config=require(_0x4493('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x4493('0x18'))['db'];var integrations=require(_0x4493('0x19'));function respondWithStatusCode(_0x181b08,_0x30491d){_0x30491d=_0x30491d||0xcc;return function(_0xd2018){if(_0xd2018){return _0x181b08[_0x4493('0x1a')](_0x30491d);}return _0x181b08[_0x4493('0x1b')](_0x30491d)['end']();};}function respondWithResult(_0xc7b404,_0x12285d){_0x12285d=_0x12285d||0xc8;return function(_0x8b83fb){if(_0x8b83fb){return _0xc7b404[_0x4493('0x1b')](_0x12285d)[_0x4493('0x1c')](_0x8b83fb);}};}function respondWithFilteredResult(_0x2c32e0,_0x1f9f41){return function(_0x23cd63){if(_0x23cd63){var _0x215570=typeof _0x1f9f41[_0x4493('0x1d')]===_0x4493('0x1e')&&typeof _0x1f9f41[_0x4493('0x1f')]===_0x4493('0x1e');var _0x5c81ff=_0x23cd63[_0x4493('0x20')];var _0x1c51f4=_0x215570?0x0:_0x1f9f41[_0x4493('0x1d')];var _0x28df09=_0x215570?_0x23cd63[_0x4493('0x20')]:_0x1f9f41['offset']+_0x1f9f41['limit'];var _0x4ce426;if(_0x28df09>=_0x5c81ff){_0x28df09=_0x5c81ff;_0x4ce426=0xc8;}else{_0x4ce426=0xce;}_0x2c32e0['status'](_0x4ce426);return _0x2c32e0[_0x4493('0x21')](_0x4493('0x22'),_0x1c51f4+'-'+_0x28df09+'/'+_0x5c81ff)[_0x4493('0x1c')](_0x23cd63);}return null;};}function patchUpdates(_0x2980c6){return function(_0x11c161){try{jsonpatch['apply'](_0x11c161,_0x2980c6,!![]);}catch(_0x392b6d){return BPromise[_0x4493('0x23')](_0x392b6d);}return _0x11c161[_0x4493('0x24')]();};}function saveUpdates(_0x28a84f,_0x366a11){return function(_0x2fbe08){if(_0x2fbe08){return _0x2fbe08[_0x4493('0x25')](_0x28a84f)[_0x4493('0x26')](function(_0x5545c7){return _0x5545c7;});}return null;};}function removeEntity(_0x294f09,_0x1b252a){return function(_0x20feed){if(_0x20feed){return _0x20feed[_0x4493('0x27')]()['then'](function(){_0x294f09[_0x4493('0x1b')](0xcc)[_0x4493('0x28')]();});}};}function handleEntityNotFound(_0x49e85e,_0x1673ca){return function(_0x4550da){if(!_0x4550da){_0x49e85e['sendStatus'](0x194);}return _0x4550da;};}function handleError(_0x431262,_0x49c2e2){_0x49c2e2=_0x49c2e2||0x1f4;return function(_0x434280){logger[_0x4493('0x29')](_0x434280[_0x4493('0x2a')]);if(_0x434280[_0x4493('0x2b')]){delete _0x434280[_0x4493('0x2b')];}_0x431262[_0x4493('0x1b')](_0x49c2e2)[_0x4493('0x2c')](_0x434280);};}exports['index']=function(_0x312a1d,_0x1dec4d){var _0x507fdb={},_0x3c107a={},_0x2330c0={'count':0x0,'rows':[]};var _0x14c02e=_[_0x4493('0x2d')](db[_0x4493('0x2e')]['rawAttributes'],function(_0x349ef4){return{'name':_0x349ef4[_0x4493('0x2f')],'type':_0x349ef4['type'][_0x4493('0x30')]};});_0x3c107a[_0x4493('0x31')]=_[_0x4493('0x2d')](_0x14c02e,_0x4493('0x2b'));_0x3c107a[_0x4493('0x32')]=_[_0x4493('0x33')](_0x312a1d[_0x4493('0x32')]);_0x3c107a['filters']=_[_0x4493('0x34')](_0x3c107a['model'],_0x3c107a['query']);_0x507fdb[_0x4493('0x35')]=_['intersection'](_0x3c107a[_0x4493('0x31')],qs[_0x4493('0x36')](_0x312a1d[_0x4493('0x32')]['fields']));_0x507fdb[_0x4493('0x35')]=_0x507fdb[_0x4493('0x35')][_0x4493('0x37')]?_0x507fdb[_0x4493('0x35')]:_0x3c107a['model'];if(!_0x312a1d[_0x4493('0x32')][_0x4493('0x38')](_0x4493('0x39'))){_0x507fdb['limit']=qs[_0x4493('0x1f')](_0x312a1d[_0x4493('0x32')][_0x4493('0x1f')]);_0x507fdb['offset']=qs[_0x4493('0x1d')](_0x312a1d[_0x4493('0x32')][_0x4493('0x1d')]);}_0x507fdb[_0x4493('0x3a')]=qs['sort'](_0x312a1d[_0x4493('0x32')][_0x4493('0x3b')]);_0x507fdb[_0x4493('0x3c')]=qs[_0x4493('0x3d')](_[_0x4493('0x3e')](_0x312a1d[_0x4493('0x32')],_0x3c107a[_0x4493('0x3d')]),_0x14c02e);if(_0x312a1d[_0x4493('0x32')][_0x4493('0x3f')]){_0x507fdb['where']=_[_0x4493('0x40')](_0x507fdb[_0x4493('0x3c')],{'$or':_['map'](_0x14c02e,function(_0x3d1ddb){if(_0x3d1ddb[_0x4493('0x41')]!==_0x4493('0x42')){var _0x107a6a={};_0x107a6a[_0x3d1ddb[_0x4493('0x2b')]]={'$like':'%'+_0x312a1d['query'][_0x4493('0x3f')]+'%'};return _0x107a6a;}})});}_0x507fdb=_['merge']({},_0x507fdb,_0x312a1d[_0x4493('0x43')]);var _0x18f70b={'where':_0x507fdb[_0x4493('0x3c')]};return db[_0x4493('0x2e')][_0x4493('0x20')](_0x18f70b)['then'](function(_0x186c2d){_0x2330c0[_0x4493('0x20')]=_0x186c2d;if(_0x312a1d[_0x4493('0x32')][_0x4493('0x44')]){_0x507fdb[_0x4493('0x45')]=[{'all':!![]}];}return db[_0x4493('0x2e')]['findAll'](_0x507fdb);})[_0x4493('0x26')](function(_0x1ed7e9){_0x2330c0[_0x4493('0x46')]=_0x1ed7e9;return _0x2330c0;})['then'](respondWithFilteredResult(_0x1dec4d,_0x507fdb))[_0x4493('0x47')](handleError(_0x1dec4d,null));};exports['show']=function(_0x50eb42,_0x395664){var _0x40c920={'raw':![],'where':{'id':_0x50eb42[_0x4493('0x48')]['id']}},_0x12935e={};_0x12935e['model']=_[_0x4493('0x33')](db['ServicenowAccount'][_0x4493('0x49')]);_0x12935e['query']=_[_0x4493('0x33')](_0x50eb42[_0x4493('0x32')]);_0x12935e[_0x4493('0x3d')]=_[_0x4493('0x34')](_0x12935e[_0x4493('0x31')],_0x12935e[_0x4493('0x32')]);_0x40c920['attributes']=_[_0x4493('0x34')](_0x12935e[_0x4493('0x31')],qs[_0x4493('0x36')](_0x50eb42[_0x4493('0x32')][_0x4493('0x36')]));_0x40c920['attributes']=_0x40c920[_0x4493('0x35')]['length']?_0x40c920[_0x4493('0x35')]:_0x12935e[_0x4493('0x31')];if(_0x50eb42[_0x4493('0x32')]['includeAll']){_0x40c920[_0x4493('0x45')]=[{'all':!![]}];}_0x40c920=_['merge']({},_0x40c920,_0x50eb42[_0x4493('0x43')]);return db['ServicenowAccount']['find'](_0x40c920)['then'](handleEntityNotFound(_0x395664,null))[_0x4493('0x26')](respondWithResult(_0x395664,null))[_0x4493('0x47')](handleError(_0x395664,null));};exports[_0x4493('0x4a')]=function(_0x132294,_0xb85d67){return db[_0x4493('0x2e')][_0x4493('0x4a')](_0x132294[_0x4493('0x4b')],{})['then'](respondWithResult(_0xb85d67,0xc9))[_0x4493('0x47')](handleError(_0xb85d67,null));};exports[_0x4493('0x25')]=function(_0x54b374,_0x3ebd36){if(_0x54b374['body']['id']){delete _0x54b374['body']['id'];}return db['ServicenowAccount'][_0x4493('0x4c')]({'where':{'id':_0x54b374[_0x4493('0x48')]['id']}})[_0x4493('0x26')](handleEntityNotFound(_0x3ebd36,null))[_0x4493('0x26')](saveUpdates(_0x54b374['body'],null))[_0x4493('0x26')](respondWithResult(_0x3ebd36,null))[_0x4493('0x47')](handleError(_0x3ebd36,null));};exports[_0x4493('0x27')]=function(_0x502dcc,_0x54359e){return db[_0x4493('0x2e')]['find']({'where':{'id':_0x502dcc[_0x4493('0x48')]['id']}})['then'](handleEntityNotFound(_0x54359e,null))[_0x4493('0x26')](removeEntity(_0x54359e,null))[_0x4493('0x47')](handleError(_0x54359e,null));};exports['getConfigurations']=function(_0x4a8bee,_0x2bc96c,_0x53a02e){var _0x46d9de={};var _0x15da18={};var _0x5a507e;var _0x4c97b8;return db[_0x4493('0x2e')]['findOne']({'where':{'id':_0x4a8bee[_0x4493('0x48')]['id']}})[_0x4493('0x26')](handleEntityNotFound(_0x2bc96c,null))[_0x4493('0x26')](function(_0xa248c8){if(_0xa248c8){_0x5a507e=_0xa248c8;_0x15da18[_0x4493('0x31')]=_[_0x4493('0x33')](db[_0x4493('0x4d')][_0x4493('0x49')]);_0x15da18[_0x4493('0x32')]=_['keys'](_0x4a8bee[_0x4493('0x32')]);_0x15da18[_0x4493('0x3d')]=_[_0x4493('0x34')](_0x15da18['model'],_0x15da18[_0x4493('0x32')]);_0x46d9de[_0x4493('0x35')]=_[_0x4493('0x34')](_0x15da18['model'],qs['fields'](_0x4a8bee[_0x4493('0x32')][_0x4493('0x36')]));_0x46d9de['attributes']=_0x46d9de['attributes'][_0x4493('0x37')]?_0x46d9de[_0x4493('0x35')]:_0x15da18[_0x4493('0x31')];_0x46d9de['order']=qs[_0x4493('0x3b')](_0x4a8bee[_0x4493('0x32')][_0x4493('0x3b')]);_0x46d9de[_0x4493('0x3c')]=qs['filters'](_[_0x4493('0x3e')](_0x4a8bee[_0x4493('0x32')],_0x15da18[_0x4493('0x3d')]));if(_0x4a8bee[_0x4493('0x32')][_0x4493('0x3f')]){_0x46d9de[_0x4493('0x3c')]=_['merge'](_0x46d9de['where'],{'$or':_[_0x4493('0x2d')](_0x46d9de[_0x4493('0x35')],function(_0x43d444){var _0x972c72={};_0x972c72[_0x43d444]={'$like':'%'+_0x4a8bee[_0x4493('0x32')][_0x4493('0x3f')]+'%'};return _0x972c72;})});}_0x46d9de=_[_0x4493('0x40')]({},_0x46d9de,_0x4a8bee[_0x4493('0x43')]);return _0x5a507e[_0x4493('0x4e')](_0x46d9de);}})[_0x4493('0x26')](function(_0x5901f4){if(_0x5901f4){_0x4c97b8=_0x5901f4['length'];if(!_0x4a8bee['query'][_0x4493('0x38')]('nolimit')){_0x46d9de[_0x4493('0x1f')]=qs['limit'](_0x4a8bee[_0x4493('0x32')][_0x4493('0x1f')]);_0x46d9de[_0x4493('0x1d')]=qs['offset'](_0x4a8bee[_0x4493('0x32')][_0x4493('0x1d')]);}return _0x5a507e[_0x4493('0x4e')](_0x46d9de);}})[_0x4493('0x26')](function(_0x4440b1){if(_0x4440b1){return _0x4440b1?{'count':_0x4c97b8,'rows':_0x4440b1}:null;}})[_0x4493('0x26')](respondWithResult(_0x2bc96c,null))[_0x4493('0x47')](handleError(_0x2bc96c,null));};exports[_0x4493('0x4f')]=function(_0x280442,_0x3960e4,_0x27eb39){if(_0x280442[_0x4493('0x4b')]['id']){delete _0x280442[_0x4493('0x4b')]['id'];}return db[_0x4493('0x2e')][_0x4493('0x50')]({'where':{'id':_0x280442[_0x4493('0x48')]['id']}})['then'](handleEntityNotFound(_0x3960e4,null))['then'](function(_0x41b510){if(_0x41b510){_0x280442[_0x4493('0x4b')]['AccountId']=_0x41b510['id'];_0x280442[_0x4493('0x4b')][_0x4493('0x51')]=integrations[_0x4493('0x52')](_0x280442['body'][_0x4493('0x53')],_0x280442[_0x4493('0x4b')][_0x4493('0x41')]);_0x280442[_0x4493('0x4b')]['Descriptions']=integrations['getDescriptions'](_0x280442[_0x4493('0x4b')][_0x4493('0x53')],_0x280442[_0x4493('0x4b')][_0x4493('0x41')]);return db['ServicenowConfiguration']['create'](_0x280442[_0x4493('0x4b')],{'include':[{'model':db[_0x4493('0x54')],'as':_0x4493('0x51')},{'model':db[_0x4493('0x54')],'as':'Descriptions'}]});}return null;})[_0x4493('0x26')](respondWithResult(_0x3960e4,null))[_0x4493('0x47')](handleError(_0x3960e4,null));};exports[_0x4493('0x55')]=function(_0x535900,_0x28ff99,_0xea6b85){var _0xde29f3=[_0x4493('0x56'),_0x4493('0x57'),_0x4493('0x58'),_0x4493('0x59'),_0x4493('0x5a'),_0x4493('0x5b'),_0x4493('0x5c'),_0x4493('0x5d'),'category'];var _0x3602b1=['parent',_0x4493('0x56'),_0x4493('0x5e'),_0x4493('0x5f'),_0x4493('0x60'),_0x4493('0x61'),_0x4493('0x62'),_0x4493('0x57'),_0x4493('0x63'),'number',_0x4493('0x64'),_0x4493('0x65'),'opened_by',_0x4493('0x66'),'sys_created_on',_0x4493('0x67'),'state',_0x4493('0x68'),_0x4493('0x58'),_0x4493('0x3a'),_0x4493('0x69'),_0x4493('0x6a'),_0x4493('0x6b'),'delivery_plan',_0x4493('0x6c'),_0x4493('0x6d'),_0x4493('0x6e'),_0x4493('0x6f'),'priority',_0x4493('0x70'),_0x4493('0x71'),_0x4493('0x72'),_0x4493('0x73'),_0x4493('0x74'),'business_duration',_0x4493('0x75'),_0x4493('0x76'),_0x4493('0x77'),_0x4493('0x78'),_0x4493('0x79'),_0x4493('0x7a'),_0x4493('0x59'),_0x4493('0x7b'),_0x4493('0x7c'),_0x4493('0x5a'),'correlation_display',_0x4493('0x7d'),'work_start',_0x4493('0x7e'),_0x4493('0x7f'),'additional_assignee_list',_0x4493('0x80'),'calendar_duration',_0x4493('0x5b'),_0x4493('0x81'),_0x4493('0x82'),_0x4493('0x83'),'follow_up',_0x4493('0x84'),'sys_id',_0x4493('0x85'),'reopened_by','incident_state',_0x4493('0x86'),_0x4493('0x87'),_0x4493('0x88'),_0x4493('0x89'),_0x4493('0x8a'),_0x4493('0x8b'),'severity',_0x4493('0x8c'),_0x4493('0x8d'),_0x4493('0x8e'),'comments_and_work_notes','due_date',_0x4493('0x8f'),'reopen_count',_0x4493('0x90'),_0x4493('0x91'),_0x4493('0x92'),_0x4493('0x93'),_0x4493('0x94'),_0x4493('0x95')];var _0x47872b='';var _0x21a229='';var _0x5171e4=[];var _0xe5211a='';var _0x31dcad='';var _0x50ec72=[];var _0x1f12ff='';var _0x20b19b='';var _0x366acc={};var _0x9c6a26='';return db[_0x4493('0x2e')][_0x4493('0x50')]({'where':{'id':_0x535900[_0x4493('0x48')]['id']},'attributes':['id',_0x4493('0x96'),_0x4493('0x97'),_0x4493('0x98'),'remoteUri',_0x4493('0x99')]})[_0x4493('0x26')](handleEntityNotFound(_0x28ff99,null))['then'](function(_0xc32e19){if(_0xc32e19){_0x9c6a26=_0xc32e19[_0x4493('0x9a')];var _0x118b72=_0x9c6a26[_0x4493('0x9b')](-0x1);if(_0x118b72==='/'){_0x9c6a26=_0x9c6a26[_0x4493('0x9c')](0x0,_0x9c6a26[_0x4493('0x9d')](_0x118b72));}_0x20b19b=util[_0x4493('0x9e')](_0x4493('0x9f'),_0x9c6a26);_0x1f12ff=util[_0x4493('0x9e')](_0x4493('0xa0'),_0x9c6a26);_0x366acc={'user':_0xc32e19['username'],'pass':_0xc32e19[_0x4493('0x97')]};var _0x5b39a9={'method':_0x4493('0xa1'),'uri':_0x20b19b+_0x4493('0xa2'),'auth':_0x366acc,'json':!![]};return rp(_0x5b39a9);}})[_0x4493('0x26')](function(_0x3e407c){if(_0x3e407c[_0x4493('0xa3')][_0x4493('0x37')]>0x0){_0x47872b=_0x3e407c[_0x4493('0xa3')];}console['log'](_0x4493('0xa4'),_0x47872b);_0x50ec72=[];_0x21a229=Object[_0x4493('0xa5')]([],_0x47872b);_[_0x4493('0xa6')](_0x21a229,function(_0x2552f0){return!_0xde29f3['includes'](_0x2552f0[_0x4493('0x2b')]);});_0x21a229[_0x4493('0xa7')](function(_0x342cd1){var _0x1d89d2=createFieldObject(_0x1f12ff,_0x366acc,_0x342cd1[_0x4493('0xa8')],_0x342cd1['name'],_0x342cd1[_0x4493('0xa9')],![]);_0x50ec72[_0x4493('0xaa')](_0x1d89d2);});return Promise[_0x4493('0xab')](_0x50ec72);})['then'](function(_0x19ef73){_0x5171e4=_0x19ef73;_0xe5211a=Object[_0x4493('0xa5')]([],_0x47872b);console[_0x4493('0xac')](_0x4493('0xad'),_0x47872b);_[_0x4493('0xa6')](_0xe5211a,function(_0x5c5f16){return _0x3602b1[_0x4493('0xae')](_0x5c5f16['name']);});console[_0x4493('0xac')](_0x4493('0xaf'),_0xe5211a);_0x50ec72=[];_0xe5211a[_0x4493('0xa7')](function(_0x431589){var _0x1e2274=createFieldObject(_0x1f12ff,_0x366acc,_0x431589[_0x4493('0xa8')],_0x431589[_0x4493('0x2b')],_0x431589[_0x4493('0xa9')],!![]);_0x50ec72[_0x4493('0xaa')](_0x1e2274);});return Promise[_0x4493('0xab')](_0x50ec72);})['then'](function(_0x1f75df){_0x31dcad=_0x1f75df;var _0x3d077d=_0x5171e4[_0x4493('0xb0')](_0x31dcad);return{'count':_0x3d077d[_0x4493('0x37')],'rows':_0x3d077d};})['then'](respondWithResult(_0x28ff99,null))[_0x4493('0x47')](function(_0x12b664){console['log'](_0x4493('0xb1')+_0x12b664);var _0x488e39=_0x535900[_0x4493('0x32')]['test']?0x1f4:_0x12b664['statusCode']||0x1f4;logger[_0x4493('0x29')](_0x12b664[_0x4493('0x2a')]);delete _0x12b664[_0x4493('0x2b')];if(_0x488e39===0x191){_0x488e39=0x190;}_0x28ff99[_0x4493('0x1b')](_0x488e39)[_0x4493('0x2c')](_0x535900['query'][_0x4493('0xb2')]?{'message':'Wrong\x20credentials','statusCode':_0x12b664['statusCode']}:_0x12b664);});};function createFieldObject(_0x46df99,_0x5636a3,_0x9aff64,_0x29c263,_0xcb8a,_0x3e38f0){return new Promise(function(_0x11e5ca,_0x227a5c){var _0x39c613={'id':_0x29c263,'name':_0xcb8a,'custom':_0x3e38f0};if(_0x9aff64===_0x4493('0xb3')){_0x39c613['options']=[{'name':_0x4493('0xb4'),'value':_0x4493('0xb5')},{'name':'False','value':_0x4493('0xb6')}];_0x11e5ca(_0x39c613);}else{var _0x49c19b={'method':_0x4493('0xa1'),'uri':_0x46df99+'sys_choice?sysparm_query=name=incident^element='+_0x29c263,'auth':_0x5636a3,'json':!![]};return rp(_0x49c19b)['then'](function(_0x28c4c7){var _0x2498b9=[];if(_0x28c4c7[_0x4493('0xa3')][_0x4493('0x37')]>0x0){_0x28c4c7[_0x4493('0xa3')][_0x4493('0xa7')](function(_0x15726e){if(_0x15726e[_0x4493('0xb7')]==='false'){var _0x1b59bd={'name':_0x15726e[_0x4493('0xa9')],'value':_0x15726e['value']};_0x2498b9[_0x4493('0xaa')](_0x1b59bd);}});}_0x39c613[_0x4493('0x43')]=_0x2498b9;if(_0x39c613[_0x4493('0x43')][_0x4493('0x37')]>0x0){_0x11e5ca(_0x39c613);}else{if(_0x3e38f0==![]){_0x11e5ca();}else{_0x11e5ca(_0x39c613);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 79e3d4e..4429739 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 _0x687b=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0xbb0aea,_0x5a38cb){var _0x47a163=function(_0x10b151){while(--_0x10b151){_0xbb0aea['push'](_0xbb0aea['shift']());}};_0x47a163(++_0x5a38cb);}(_0x687b,0x14a));var _0xb687=function(_0x1bfe44,_0x4e410e){_0x1bfe44=_0x1bfe44-0x0;var _0x1103cb=_0x687b[_0x1bfe44];return _0x1103cb;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));var integrations=require(_0xb687('0x9'));module[_0xb687('0xa')]=function(_0xf43a1f,_0x47ffea){return _0xf43a1f[_0xb687('0xb')]('ServicenowAccount',attributes,{'tableName':_0xb687('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x31f0=['./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xdb50b8,_0x24515f){var _0x2e2c2b=function(_0x3896c7){while(--_0x3896c7){_0xdb50b8['push'](_0xdb50b8['shift']());}};_0x2e2c2b(++_0x24515f);}(_0x31f0,0xb7));var _0x031f=function(_0x53efc5,_0x480085){_0x53efc5=_0x53efc5-0x0;var _0x1f6aba=_0x31f0[_0x53efc5];return _0x1f6aba;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var logger=require(_0x031f('0x1'))('api');var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rp=require(_0x031f('0x4'));var fs=require('fs');var path=require(_0x031f('0x5'));var rimraf=require('rimraf');var config=require(_0x031f('0x6'));var attributes=require(_0x031f('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x56328c,_0x3dc98e){return _0x56328c['define'](_0x031f('0x8'),attributes,{'tableName':_0x031f('0x9'),'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 612d46b..efe48d8 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 _0xab70=['raw','where','attributes','include','map','model','then','find','ShowServicenowAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','message','ServicenowAccount,\x20%s,\x20%s','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options'];(function(_0x192e1a,_0x55c355){var _0x534ea1=function(_0x3cc6ea){while(--_0x3cc6ea){_0x192e1a['push'](_0x192e1a['shift']());}};_0x534ea1(++_0x55c355);}(_0xab70,0xfe));var _0x0ab7=function(_0x49000b,_0x46c351){_0x49000b=_0x49000b-0x0;var _0x2145ef=_0xab70[_0x49000b];return _0x2145ef;};'use strict';var _=require(_0x0ab7('0x0'));var util=require(_0x0ab7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0ab7('0x2'));var fs=require('fs');var Redis=require(_0x0ab7('0x3'));var db=require(_0x0ab7('0x4'))['db'];var utils=require(_0x0ab7('0x5'));var logger=require(_0x0ab7('0x6'))(_0x0ab7('0x7'));var config=require(_0x0ab7('0x8'));var jayson=require(_0x0ab7('0x9'));var client=jayson[_0x0ab7('0xa')][_0x0ab7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29e5d9,_0x1ea9d8,_0x249254){return new BPromise(function(_0xe19ae3,_0x468fa9){return client[_0x0ab7('0xc')](_0x29e5d9,_0x249254)['then'](function(_0x1db9f8){logger[_0x0ab7('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x1ea9d8,_0x0ab7('0xe'));logger[_0x0ab7('0xf')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x1ea9d8,_0x0ab7('0xe'),JSON[_0x0ab7('0x10')](_0x1db9f8));if(_0x1db9f8[_0x0ab7('0x11')]){if(_0x1db9f8[_0x0ab7('0x11')]['code']===0x1f4){logger[_0x0ab7('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x1ea9d8,_0x1db9f8[_0x0ab7('0x11')][_0x0ab7('0x12')]);return _0x468fa9(_0x1db9f8[_0x0ab7('0x11')][_0x0ab7('0x12')]);}logger['error'](_0x0ab7('0x13'),_0x1ea9d8,_0x1db9f8[_0x0ab7('0x11')][_0x0ab7('0x12')]);return _0xe19ae3(_0x1db9f8['error'][_0x0ab7('0x12')]);}else{logger[_0x0ab7('0xd')](_0x0ab7('0x13'),_0x1ea9d8,'request\x20sent');_0xe19ae3(_0x1db9f8[_0x0ab7('0x14')][_0x0ab7('0x12')]);}})[_0x0ab7('0x15')](function(_0x2469c9){logger['error'](_0x0ab7('0x13'),_0x1ea9d8,_0x2469c9);_0x468fa9(_0x2469c9);});});}exports[_0x0ab7('0x16')]=function(_0x45d79e){var _0x5df28e=this;return new Promise(function(_0xbb1cc6,_0x56dec7){return db[_0x0ab7('0x17')][_0x0ab7('0x18')]({'raw':_0x45d79e[_0x0ab7('0x19')]?_0x45d79e[_0x0ab7('0x19')][_0x0ab7('0x1a')]===undefined?!![]:![]:!![],'where':_0x45d79e[_0x0ab7('0x19')]?_0x45d79e[_0x0ab7('0x19')][_0x0ab7('0x1b')]||null:null,'attributes':_0x45d79e['options']?_0x45d79e['options'][_0x0ab7('0x1c')]||null:null,'limit':_0x45d79e[_0x0ab7('0x19')]?_0x45d79e['options']['limit']||null:null,'include':_0x45d79e[_0x0ab7('0x19')]?_0x45d79e[_0x0ab7('0x19')][_0x0ab7('0x1d')]?_[_0x0ab7('0x1e')](_0x45d79e[_0x0ab7('0x19')][_0x0ab7('0x1d')],function(_0x838be6){return{'model':db[_0x838be6[_0x0ab7('0x1f')]],'as':_0x838be6['as'],'attributes':_0x838be6['attributes'],'include':_0x838be6[_0x0ab7('0x1d')]?_[_0x0ab7('0x1e')](_0x838be6[_0x0ab7('0x1d')],function(_0x3835b0){return{'model':db[_0x3835b0['model']],'as':_0x3835b0['as'],'attributes':_0x3835b0[_0x0ab7('0x1c')],'include':_0x3835b0[_0x0ab7('0x1d')]?_['map'](_0x3835b0[_0x0ab7('0x1d')],function(_0x8b1234){return{'model':db[_0x8b1234[_0x0ab7('0x1f')]],'as':_0x8b1234['as'],'attributes':_0x8b1234['attributes']};}):[]};}):[]};}):[]:[]})[_0x0ab7('0x20')](function(_0x139e73){logger[_0x0ab7('0xd')]('GetServicenowAccount',_0x45d79e);logger[_0x0ab7('0xf')](_0x0ab7('0x16'),_0x45d79e,JSON[_0x0ab7('0x10')](_0x139e73));_0xbb1cc6(_0x139e73);})[_0x0ab7('0x15')](function(_0x22b7c1){logger[_0x0ab7('0x11')](_0x0ab7('0x16'),_0x22b7c1[_0x0ab7('0x12')],_0x45d79e);_0x56dec7(_0x5df28e[_0x0ab7('0x11')](0x1f4,_0x22b7c1[_0x0ab7('0x12')]));});});};exports['ShowServicenowAccount']=function(_0x2c2b71){var _0x120fd9=this;return new Promise(function(_0x4a9a23,_0x26fdf2){return db['ServicenowAccount'][_0x0ab7('0x21')]({'raw':_0x2c2b71['options']?_0x2c2b71[_0x0ab7('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2c2b71[_0x0ab7('0x19')]?_0x2c2b71[_0x0ab7('0x19')][_0x0ab7('0x1b')]||null:null,'attributes':_0x2c2b71[_0x0ab7('0x19')]?_0x2c2b71['options'][_0x0ab7('0x1c')]||null:null,'include':_0x2c2b71[_0x0ab7('0x19')]?_0x2c2b71['options'][_0x0ab7('0x1d')]?_['map'](_0x2c2b71['options'][_0x0ab7('0x1d')],function(_0x1702ec){return{'model':db[_0x1702ec[_0x0ab7('0x1f')]],'as':_0x1702ec['as'],'attributes':_0x1702ec[_0x0ab7('0x1c')],'include':_0x1702ec[_0x0ab7('0x1d')]?_[_0x0ab7('0x1e')](_0x1702ec[_0x0ab7('0x1d')],function(_0xf93d5){return{'model':db[_0xf93d5[_0x0ab7('0x1f')]],'as':_0xf93d5['as'],'attributes':_0xf93d5['attributes'],'include':_0xf93d5[_0x0ab7('0x1d')]?_['map'](_0xf93d5['include'],function(_0x15792f){return{'model':db[_0x15792f[_0x0ab7('0x1f')]],'as':_0x15792f['as'],'attributes':_0x15792f[_0x0ab7('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb33b2d){logger['info'](_0x0ab7('0x22'),_0x2c2b71);logger[_0x0ab7('0xf')]('ShowServicenowAccount',_0x2c2b71,JSON[_0x0ab7('0x10')](_0xb33b2d));_0x4a9a23(_0xb33b2d);})[_0x0ab7('0x15')](function(_0x30b156){logger[_0x0ab7('0x11')]('ShowServicenowAccount',_0x30b156['message'],_0x2c2b71);_0x26fdf2(_0x120fd9[_0x0ab7('0x11')](0x1f4,_0x30b156['message']));});});}; \ No newline at end of file +var _0x5ad2=['error','message','result','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','include','map','model','catch','ShowServicenowAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20a50a,_0x5a8224){var _0x14b9f7=function(_0x288d78){while(--_0x288d78){_0x20a50a['push'](_0x20a50a['shift']());}};_0x14b9f7(++_0x5a8224);}(_0x5ad2,0xe2));var _0x25ad=function(_0x2ea6f5,_0x4adfc4){_0x2ea6f5=_0x2ea6f5-0x0;var _0x2a88b5=_0x5ad2[_0x2ea6f5];return _0x2a88b5;};'use strict';var _=require('lodash');var util=require(_0x25ad('0x0'));var moment=require(_0x25ad('0x1'));var BPromise=require(_0x25ad('0x2'));var rs=require(_0x25ad('0x3'));var fs=require('fs');var Redis=require(_0x25ad('0x4'));var db=require(_0x25ad('0x5'))['db'];var utils=require(_0x25ad('0x6'));var logger=require(_0x25ad('0x7'))(_0x25ad('0x8'));var config=require(_0x25ad('0x9'));var jayson=require(_0x25ad('0xa'));var client=jayson[_0x25ad('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x242e97,_0x32e518,_0x263135){return new BPromise(function(_0x27daa1,_0x41f49c){return client['request'](_0x242e97,_0x263135)[_0x25ad('0xc')](function(_0x59e353){logger[_0x25ad('0xd')](_0x25ad('0xe'),_0x32e518,_0x25ad('0xf'));logger[_0x25ad('0x10')](_0x25ad('0x11'),_0x32e518,'request\x20sent',JSON[_0x25ad('0x12')](_0x59e353));if(_0x59e353[_0x25ad('0x13')]){if(_0x59e353['error']['code']===0x1f4){logger['error'](_0x25ad('0xe'),_0x32e518,_0x59e353[_0x25ad('0x13')][_0x25ad('0x14')]);return _0x41f49c(_0x59e353['error'][_0x25ad('0x14')]);}logger[_0x25ad('0x13')](_0x25ad('0xe'),_0x32e518,_0x59e353[_0x25ad('0x13')][_0x25ad('0x14')]);return _0x27daa1(_0x59e353['error'][_0x25ad('0x14')]);}else{logger['info'](_0x25ad('0xe'),_0x32e518,_0x25ad('0xf'));_0x27daa1(_0x59e353[_0x25ad('0x15')][_0x25ad('0x14')]);}})['catch'](function(_0x5a0007){logger['error'](_0x25ad('0xe'),_0x32e518,_0x5a0007);_0x41f49c(_0x5a0007);});});}exports[_0x25ad('0x16')]=function(_0x5e4045){var _0x1f9214=this;return new Promise(function(_0x2eeda1,_0x3befa2){return db[_0x25ad('0x17')][_0x25ad('0x18')]({'raw':_0x5e4045['options']?_0x5e4045[_0x25ad('0x19')][_0x25ad('0x1a')]===undefined?!![]:![]:!![],'where':_0x5e4045['options']?_0x5e4045[_0x25ad('0x19')][_0x25ad('0x1b')]||null:null,'attributes':_0x5e4045[_0x25ad('0x19')]?_0x5e4045[_0x25ad('0x19')][_0x25ad('0x1c')]||null:null,'limit':_0x5e4045[_0x25ad('0x19')]?_0x5e4045['options']['limit']||null:null,'include':_0x5e4045[_0x25ad('0x19')]?_0x5e4045['options'][_0x25ad('0x1d')]?_[_0x25ad('0x1e')](_0x5e4045[_0x25ad('0x19')][_0x25ad('0x1d')],function(_0x16e3fb){return{'model':db[_0x16e3fb[_0x25ad('0x1f')]],'as':_0x16e3fb['as'],'attributes':_0x16e3fb[_0x25ad('0x1c')],'include':_0x16e3fb[_0x25ad('0x1d')]?_[_0x25ad('0x1e')](_0x16e3fb[_0x25ad('0x1d')],function(_0x3b94e3){return{'model':db[_0x3b94e3[_0x25ad('0x1f')]],'as':_0x3b94e3['as'],'attributes':_0x3b94e3[_0x25ad('0x1c')],'include':_0x3b94e3[_0x25ad('0x1d')]?_[_0x25ad('0x1e')](_0x3b94e3['include'],function(_0x35c199){return{'model':db[_0x35c199['model']],'as':_0x35c199['as'],'attributes':_0x35c199[_0x25ad('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x25ad('0xc')](function(_0x1f5575){logger[_0x25ad('0xd')](_0x25ad('0x16'),_0x5e4045);logger[_0x25ad('0x10')](_0x25ad('0x16'),_0x5e4045,JSON[_0x25ad('0x12')](_0x1f5575));_0x2eeda1(_0x1f5575);})[_0x25ad('0x20')](function(_0x5515c1){logger['error'](_0x25ad('0x16'),_0x5515c1[_0x25ad('0x14')],_0x5e4045);_0x3befa2(_0x1f9214[_0x25ad('0x13')](0x1f4,_0x5515c1[_0x25ad('0x14')]));});});};exports[_0x25ad('0x21')]=function(_0xc05bc6){var _0x11a018=this;return new Promise(function(_0x3ab11,_0x12e08b){return db[_0x25ad('0x17')][_0x25ad('0x22')]({'raw':_0xc05bc6[_0x25ad('0x19')]?_0xc05bc6[_0x25ad('0x19')][_0x25ad('0x1a')]===undefined?!![]:![]:!![],'where':_0xc05bc6['options']?_0xc05bc6[_0x25ad('0x19')][_0x25ad('0x1b')]||null:null,'attributes':_0xc05bc6[_0x25ad('0x19')]?_0xc05bc6[_0x25ad('0x19')][_0x25ad('0x1c')]||null:null,'include':_0xc05bc6[_0x25ad('0x19')]?_0xc05bc6[_0x25ad('0x19')][_0x25ad('0x1d')]?_[_0x25ad('0x1e')](_0xc05bc6[_0x25ad('0x19')][_0x25ad('0x1d')],function(_0x320649){return{'model':db[_0x320649[_0x25ad('0x1f')]],'as':_0x320649['as'],'attributes':_0x320649[_0x25ad('0x1c')],'include':_0x320649[_0x25ad('0x1d')]?_[_0x25ad('0x1e')](_0x320649[_0x25ad('0x1d')],function(_0x320a69){return{'model':db[_0x320a69['model']],'as':_0x320a69['as'],'attributes':_0x320a69[_0x25ad('0x1c')],'include':_0x320a69[_0x25ad('0x1d')]?_[_0x25ad('0x1e')](_0x320a69[_0x25ad('0x1d')],function(_0x1ad8e3){return{'model':db[_0x1ad8e3[_0x25ad('0x1f')]],'as':_0x1ad8e3['as'],'attributes':_0x1ad8e3[_0x25ad('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x25ad('0xc')](function(_0x1a783e){logger[_0x25ad('0xd')](_0x25ad('0x21'),_0xc05bc6);logger['debug'](_0x25ad('0x21'),_0xc05bc6,JSON[_0x25ad('0x12')](_0x1a783e));_0x3ab11(_0x1a783e);})[_0x25ad('0x20')](function(_0x5cdec8){logger[_0x25ad('0x13')](_0x25ad('0x21'),_0x5cdec8[_0x25ad('0x14')],_0xc05bc6);_0x12e08b(_0x11a018['error'](0x1f4,_0x5cdec8['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index e4db0c1..10edb6f 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 _0x90d8=['exports','util','path','connect-timeout','fs-extra','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy'];(function(_0x4313cf,_0x3a750b){var _0x47c49a=function(_0x23eb38){while(--_0x23eb38){_0x4313cf['push'](_0x4313cf['shift']());}};_0x47c49a(++_0x3a750b);}(_0x90d8,0x112));var _0x890d=function(_0x473738,_0x15ea31){_0x473738=_0x473738-0x0;var _0x1df4ae=_0x90d8[_0x473738];return _0x1df4ae;};'use strict';var multer=require('multer');var util=require(_0x890d('0x0'));var path=require(_0x890d('0x1'));var timeout=require(_0x890d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x890d('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x890d('0x4'));var controller=require(_0x890d('0x5'));router[_0x890d('0x6')]('/',auth[_0x890d('0x7')](),controller['index']);router['get'](_0x890d('0x8'),auth['isAuthenticated'](),controller[_0x890d('0x9')]);router[_0x890d('0x6')](_0x890d('0xa'),auth[_0x890d('0x7')](),controller['getFields']);router[_0x890d('0x6')]('/:id/subjects',auth[_0x890d('0x7')](),controller[_0x890d('0xb')]);router[_0x890d('0x6')](_0x890d('0xc'),auth[_0x890d('0x7')](),controller[_0x890d('0xd')]);router[_0x890d('0xe')]('/',auth[_0x890d('0x7')](),controller[_0x890d('0xf')]);router[_0x890d('0x10')](_0x890d('0x8'),auth[_0x890d('0x7')](),controller[_0x890d('0x11')]);router[_0x890d('0x12')](_0x890d('0x8'),auth[_0x890d('0x7')](),controller[_0x890d('0x13')]);module[_0x890d('0x14')]=router; \ No newline at end of file +var _0x3fb9=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','/:id','exports','multer','util','path'];(function(_0x23c81c,_0x17311e){var _0xa77d11=function(_0x5b975b){while(--_0x5b975b){_0x23c81c['push'](_0x23c81c['shift']());}};_0xa77d11(++_0x17311e);}(_0x3fb9,0x162));var _0x93fb=function(_0x272d08,_0x13e0be){_0x272d08=_0x272d08-0x0;var _0xbb1d61=_0x3fb9[_0x272d08];return _0xbb1d61;};'use strict';var multer=require(_0x93fb('0x0'));var util=require(_0x93fb('0x1'));var path=require(_0x93fb('0x2'));var timeout=require(_0x93fb('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x93fb('0x4'));var auth=require(_0x93fb('0x5'));var interaction=require(_0x93fb('0x6'));var config=require(_0x93fb('0x7'));var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth[_0x93fb('0x8')](),controller[_0x93fb('0x9')]);router[_0x93fb('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x93fb('0xb')]);router[_0x93fb('0xa')](_0x93fb('0xc'),auth[_0x93fb('0x8')](),controller[_0x93fb('0xd')]);router[_0x93fb('0xa')](_0x93fb('0xe'),auth[_0x93fb('0x8')](),controller[_0x93fb('0xf')]);router[_0x93fb('0xa')](_0x93fb('0x10'),auth[_0x93fb('0x8')](),controller[_0x93fb('0x11')]);router['post']('/',auth[_0x93fb('0x8')](),controller['create']);router[_0x93fb('0x12')](_0x93fb('0x13'),auth[_0x93fb('0x8')](),controller['update']);router['delete'](_0x93fb('0x13'),auth[_0x93fb('0x8')](),controller['destroy']);module[_0x93fb('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 6d941c3..2a6b355 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 _0xfebd=['sequelize','exports','STRING'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xfebd,0x12c));var _0xdfeb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfebd[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xdfeb('0x0'));module[_0xdfeb('0x1')]={'name':{'type':Sequelize[_0xdfeb('0x2')]},'description':{'type':Sequelize[_0xdfeb('0x2')]}}; \ No newline at end of file +var _0x7c1a=['exports','STRING','sequelize'];(function(_0x40ba6c,_0x5e4c8f){var _0x2237a9=function(_0x3a438e){while(--_0x3a438e){_0x40ba6c['push'](_0x40ba6c['shift']());}};_0x2237a9(++_0x5e4c8f);}(_0x7c1a,0xbf));var _0xa7c1=function(_0x116d46,_0x572745){_0x116d46=_0x116d46-0x0;var _0x12118e=_0x7c1a[_0x116d46];return _0x12118e;};'use strict';var Sequelize=require(_0xa7c1('0x0'));module[_0xa7c1('0x1')]={'name':{'type':Sequelize[_0xa7c1('0x2')]},'description':{'type':Sequelize[_0xa7c1('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index b8bc444..be86f82 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 _0x23f0=['params','intersection','find','catch','create','body','update','findOne','ServicenowField','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','then','destroy','sendStatus','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show'];(function(_0x3ae516,_0x4b97c5){var _0x2b257a=function(_0x1aa718){while(--_0x1aa718){_0x3ae516['push'](_0x3ae516['shift']());}};_0x2b257a(++_0x4b97c5);}(_0x23f0,0x139));var _0x023f=function(_0x140157,_0x29b06f){_0x140157=_0x140157-0x0;var _0x3f8e46=_0x23f0[_0x140157];return _0x3f8e46;};'use strict';var emlformat=require(_0x023f('0x0'));var rimraf=require(_0x023f('0x1'));var zipdir=require(_0x023f('0x2'));var jsonpatch=require(_0x023f('0x3'));var rp=require('request-promise');var moment=require(_0x023f('0x4'));var BPromise=require(_0x023f('0x5'));var Mustache=require(_0x023f('0x6'));var util=require('util');var path=require('path');var sox=require(_0x023f('0x7'));var csv=require(_0x023f('0x8'));var ejs=require(_0x023f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x023f('0xa'));var squel=require('squel');var crypto=require(_0x023f('0xb'));var jsforce=require(_0x023f('0xc'));var deskjs=require(_0x023f('0xd'));var toCsv=require(_0x023f('0x8'));var querystring=require('querystring');var Papa=require(_0x023f('0xe'));var Redis=require(_0x023f('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x023f('0x10'));var hardwareService=require(_0x023f('0x11'));var logger=require('../../config/logger')(_0x023f('0x12'));var utils=require(_0x023f('0x13'));var config=require(_0x023f('0x14'));var licenseUtil=require(_0x023f('0x15'));var db=require(_0x023f('0x16'))['db'];function respondWithStatusCode(_0x451f1d,_0x3f677e){_0x3f677e=_0x3f677e||0xcc;return function(_0x2564a2){if(_0x2564a2){return _0x451f1d['sendStatus'](_0x3f677e);}return _0x451f1d['status'](_0x3f677e)[_0x023f('0x17')]();};}function respondWithResult(_0x588981,_0x7e80d1){_0x7e80d1=_0x7e80d1||0xc8;return function(_0x4f72dc){if(_0x4f72dc){return _0x588981[_0x023f('0x18')](_0x7e80d1)[_0x023f('0x19')](_0x4f72dc);}};}function respondWithFilteredResult(_0x372693,_0x338350){return function(_0x318892){if(_0x318892){var _0x129b50=typeof _0x338350[_0x023f('0x1a')]===_0x023f('0x1b')&&typeof _0x338350[_0x023f('0x1c')]===_0x023f('0x1b');var _0x1b6be9=_0x318892[_0x023f('0x1d')];var _0x2232ee=_0x129b50?0x0:_0x338350[_0x023f('0x1a')];var _0x3955df=_0x129b50?_0x318892[_0x023f('0x1d')]:_0x338350['offset']+_0x338350['limit'];var _0x460680;if(_0x3955df>=_0x1b6be9){_0x3955df=_0x1b6be9;_0x460680=0xc8;}else{_0x460680=0xce;}_0x372693['status'](_0x460680);return _0x372693['set']('Content-Range',_0x2232ee+'-'+_0x3955df+'/'+_0x1b6be9)[_0x023f('0x19')](_0x318892);}return null;};}function patchUpdates(_0x417d9d){return function(_0x1aebca){try{jsonpatch['apply'](_0x1aebca,_0x417d9d,!![]);}catch(_0x317aef){return BPromise['reject'](_0x317aef);}return _0x1aebca['save']();};}function saveUpdates(_0x497ece,_0x1f1a99){return function(_0x5d1706){if(_0x5d1706){return _0x5d1706['update'](_0x497ece)[_0x023f('0x1e')](function(_0x4fcad8){return _0x4fcad8;});}return null;};}function removeEntity(_0x46a892,_0x939a7f){return function(_0x46dbab){if(_0x46dbab){return _0x46dbab[_0x023f('0x1f')]()[_0x023f('0x1e')](function(){_0x46a892[_0x023f('0x18')](0xcc)[_0x023f('0x17')]();});}};}function handleEntityNotFound(_0x34cd4f,_0x1c66e5){return function(_0x3fbfda){if(!_0x3fbfda){_0x34cd4f[_0x023f('0x20')](0x194);}return _0x3fbfda;};}function handleError(_0x35cda2,_0x508465){_0x508465=_0x508465||0x1f4;return function(_0x41c60c){logger['error'](_0x41c60c[_0x023f('0x21')]);if(_0x41c60c['name']){delete _0x41c60c[_0x023f('0x22')];}_0x35cda2['status'](_0x508465)[_0x023f('0x23')](_0x41c60c);};}exports[_0x023f('0x24')]=function(_0x3dbd23,_0x36942f){var _0xb3d7c4={},_0xca06e5={},_0x588f5c={'count':0x0,'rows':[]};var _0x3539a0=_[_0x023f('0x25')](db[_0x023f('0x26')][_0x023f('0x27')],function(_0x1b002b){return{'name':_0x1b002b['fieldName'],'type':_0x1b002b[_0x023f('0x28')][_0x023f('0x29')]};});_0xca06e5['model']=_['map'](_0x3539a0,'name');_0xca06e5[_0x023f('0x2a')]=_[_0x023f('0x2b')](_0x3dbd23[_0x023f('0x2a')]);_0xca06e5[_0x023f('0x2c')]=_['intersection'](_0xca06e5[_0x023f('0x2d')],_0xca06e5[_0x023f('0x2a')]);_0xb3d7c4['attributes']=_['intersection'](_0xca06e5['model'],qs[_0x023f('0x2e')](_0x3dbd23['query'][_0x023f('0x2e')]));_0xb3d7c4['attributes']=_0xb3d7c4[_0x023f('0x2f')][_0x023f('0x30')]?_0xb3d7c4[_0x023f('0x2f')]:_0xca06e5[_0x023f('0x2d')];if(!_0x3dbd23[_0x023f('0x2a')][_0x023f('0x31')]('nolimit')){_0xb3d7c4[_0x023f('0x1c')]=qs[_0x023f('0x1c')](_0x3dbd23[_0x023f('0x2a')][_0x023f('0x1c')]);_0xb3d7c4[_0x023f('0x1a')]=qs['offset'](_0x3dbd23[_0x023f('0x2a')][_0x023f('0x1a')]);}_0xb3d7c4[_0x023f('0x32')]=qs['sort'](_0x3dbd23[_0x023f('0x2a')][_0x023f('0x33')]);_0xb3d7c4[_0x023f('0x34')]=qs['filters'](_[_0x023f('0x35')](_0x3dbd23[_0x023f('0x2a')],_0xca06e5['filters']),_0x3539a0);if(_0x3dbd23[_0x023f('0x2a')][_0x023f('0x36')]){_0xb3d7c4[_0x023f('0x34')]=_['merge'](_0xb3d7c4[_0x023f('0x34')],{'$or':_[_0x023f('0x25')](_0x3539a0,function(_0x11a00b){if(_0x11a00b[_0x023f('0x28')]!==_0x023f('0x37')){var _0x5b44b0={};_0x5b44b0[_0x11a00b[_0x023f('0x22')]]={'$like':'%'+_0x3dbd23[_0x023f('0x2a')][_0x023f('0x36')]+'%'};return _0x5b44b0;}})});}_0xb3d7c4=_[_0x023f('0x38')]({},_0xb3d7c4,_0x3dbd23[_0x023f('0x39')]);var _0x58ae58={'where':_0xb3d7c4['where']};return db[_0x023f('0x26')][_0x023f('0x1d')](_0x58ae58)['then'](function(_0x135bf8){_0x588f5c[_0x023f('0x1d')]=_0x135bf8;if(_0x3dbd23['query'][_0x023f('0x3a')]){_0xb3d7c4['include']=[{'all':!![]}];}return db[_0x023f('0x26')][_0x023f('0x3b')](_0xb3d7c4);})[_0x023f('0x1e')](function(_0x57391f){_0x588f5c[_0x023f('0x3c')]=_0x57391f;return _0x588f5c;})[_0x023f('0x1e')](respondWithFilteredResult(_0x36942f,_0xb3d7c4))['catch'](handleError(_0x36942f,null));};exports[_0x023f('0x3d')]=function(_0x25a8ac,_0x1a6eee){var _0x4fa6f7={'raw':![],'where':{'id':_0x25a8ac[_0x023f('0x3e')]['id']}},_0x44823a={};_0x44823a[_0x023f('0x2d')]=_[_0x023f('0x2b')](db[_0x023f('0x26')][_0x023f('0x27')]);_0x44823a[_0x023f('0x2a')]=_[_0x023f('0x2b')](_0x25a8ac[_0x023f('0x2a')]);_0x44823a[_0x023f('0x2c')]=_['intersection'](_0x44823a[_0x023f('0x2d')],_0x44823a[_0x023f('0x2a')]);_0x4fa6f7[_0x023f('0x2f')]=_[_0x023f('0x3f')](_0x44823a[_0x023f('0x2d')],qs['fields'](_0x25a8ac[_0x023f('0x2a')][_0x023f('0x2e')]));_0x4fa6f7[_0x023f('0x2f')]=_0x4fa6f7[_0x023f('0x2f')][_0x023f('0x30')]?_0x4fa6f7[_0x023f('0x2f')]:_0x44823a[_0x023f('0x2d')];if(_0x25a8ac[_0x023f('0x2a')][_0x023f('0x3a')]){_0x4fa6f7['include']=[{'all':!![]}];}_0x4fa6f7=_[_0x023f('0x38')]({},_0x4fa6f7,_0x25a8ac[_0x023f('0x39')]);return db['ServicenowConfiguration'][_0x023f('0x40')](_0x4fa6f7)['then'](handleEntityNotFound(_0x1a6eee,null))[_0x023f('0x1e')](respondWithResult(_0x1a6eee,null))[_0x023f('0x41')](handleError(_0x1a6eee,null));};exports[_0x023f('0x42')]=function(_0x191e69,_0x2c5691){return db[_0x023f('0x26')][_0x023f('0x42')](_0x191e69[_0x023f('0x43')],{})[_0x023f('0x1e')](respondWithResult(_0x2c5691,0xc9))[_0x023f('0x41')](handleError(_0x2c5691,null));};exports[_0x023f('0x44')]=function(_0x381c1a,_0x29291b){if(_0x381c1a[_0x023f('0x43')]['id']){delete _0x381c1a['body']['id'];}return db[_0x023f('0x26')][_0x023f('0x40')]({'where':{'id':_0x381c1a['params']['id']}})[_0x023f('0x1e')](handleEntityNotFound(_0x29291b,null))['then'](saveUpdates(_0x381c1a[_0x023f('0x43')],null))[_0x023f('0x1e')](respondWithResult(_0x29291b,null))[_0x023f('0x41')](handleError(_0x29291b,null));};exports[_0x023f('0x1f')]=function(_0x3d8c89,_0x29efcb){return db[_0x023f('0x26')][_0x023f('0x40')]({'where':{'id':_0x3d8c89[_0x023f('0x3e')]['id']}})[_0x023f('0x1e')](handleEntityNotFound(_0x29efcb,null))[_0x023f('0x1e')](removeEntity(_0x29efcb,null))[_0x023f('0x41')](handleError(_0x29efcb,null));};exports['getFields']=function(_0x1a79fb,_0x13b0ec,_0x25200d){var _0x2566c5={};var _0x7cfcab={};var _0x5bb505;var _0x51cc6a;return db[_0x023f('0x26')][_0x023f('0x45')]({'where':{'id':_0x1a79fb[_0x023f('0x3e')]['id']}})['then'](handleEntityNotFound(_0x13b0ec,null))[_0x023f('0x1e')](function(_0x32dd0b){if(_0x32dd0b){_0x5bb505=_0x32dd0b;_0x7cfcab['model']=_[_0x023f('0x2b')](db[_0x023f('0x46')][_0x023f('0x27')]);_0x7cfcab[_0x023f('0x2a')]=_[_0x023f('0x2b')](_0x1a79fb['query']);_0x7cfcab[_0x023f('0x2c')]=_[_0x023f('0x3f')](_0x7cfcab[_0x023f('0x2d')],_0x7cfcab[_0x023f('0x2a')]);_0x2566c5['attributes']=_[_0x023f('0x3f')](_0x7cfcab[_0x023f('0x2d')],qs['fields'](_0x1a79fb[_0x023f('0x2a')][_0x023f('0x2e')]));_0x2566c5[_0x023f('0x2f')]=_0x2566c5[_0x023f('0x2f')][_0x023f('0x30')]?_0x2566c5[_0x023f('0x2f')]:_0x7cfcab[_0x023f('0x2d')];_0x2566c5[_0x023f('0x32')]=qs[_0x023f('0x33')](_0x1a79fb[_0x023f('0x2a')][_0x023f('0x33')]);_0x2566c5['where']=qs['filters'](_[_0x023f('0x35')](_0x1a79fb[_0x023f('0x2a')],_0x7cfcab[_0x023f('0x2c')]));if(_0x1a79fb[_0x023f('0x2a')]['filter']){_0x2566c5['where']=_['merge'](_0x2566c5[_0x023f('0x34')],{'$or':_[_0x023f('0x25')](_0x2566c5[_0x023f('0x2f')],function(_0x33d01b){var _0x45c208={};_0x45c208[_0x33d01b]={'$like':'%'+_0x1a79fb['query'][_0x023f('0x36')]+'%'};return _0x45c208;})});}_0x2566c5=_[_0x023f('0x38')]({},_0x2566c5,_0x1a79fb[_0x023f('0x39')]);return _0x5bb505[_0x023f('0x47')](_0x2566c5);}})['then'](function(_0x54ca0c){if(_0x54ca0c){_0x51cc6a=_0x54ca0c[_0x023f('0x30')];if(!_0x1a79fb[_0x023f('0x2a')][_0x023f('0x31')](_0x023f('0x48'))){_0x2566c5[_0x023f('0x1c')]=qs['limit'](_0x1a79fb[_0x023f('0x2a')][_0x023f('0x1c')]);_0x2566c5[_0x023f('0x1a')]=qs[_0x023f('0x1a')](_0x1a79fb[_0x023f('0x2a')][_0x023f('0x1a')]);}return _0x5bb505[_0x023f('0x47')](_0x2566c5);}})[_0x023f('0x1e')](function(_0x153cf3){if(_0x153cf3){return _0x153cf3?{'count':_0x51cc6a,'rows':_0x153cf3}:null;}})['then'](respondWithResult(_0x13b0ec,null))['catch'](handleError(_0x13b0ec,null));};exports[_0x023f('0x49')]=function(_0x58e406,_0x2ea5e9,_0x47cd11){var _0x2b0587={};var _0x2e6fde={};var _0x4fd3a4;var _0x9331e1;return db[_0x023f('0x26')][_0x023f('0x45')]({'where':{'id':_0x58e406[_0x023f('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2ea5e9,null))[_0x023f('0x1e')](function(_0x3f1f1e){if(_0x3f1f1e){_0x4fd3a4=_0x3f1f1e;_0x2e6fde[_0x023f('0x2d')]=_[_0x023f('0x2b')](db[_0x023f('0x46')][_0x023f('0x27')]);_0x2e6fde[_0x023f('0x2a')]=_[_0x023f('0x2b')](_0x58e406['query']);_0x2e6fde[_0x023f('0x2c')]=_[_0x023f('0x3f')](_0x2e6fde[_0x023f('0x2d')],_0x2e6fde['query']);_0x2b0587[_0x023f('0x2f')]=_[_0x023f('0x3f')](_0x2e6fde[_0x023f('0x2d')],qs['fields'](_0x58e406[_0x023f('0x2a')][_0x023f('0x2e')]));_0x2b0587[_0x023f('0x2f')]=_0x2b0587[_0x023f('0x2f')][_0x023f('0x30')]?_0x2b0587[_0x023f('0x2f')]:_0x2e6fde['model'];_0x2b0587['order']=qs[_0x023f('0x33')](_0x58e406[_0x023f('0x2a')][_0x023f('0x33')]);_0x2b0587[_0x023f('0x34')]=qs[_0x023f('0x2c')](_[_0x023f('0x35')](_0x58e406[_0x023f('0x2a')],_0x2e6fde[_0x023f('0x2c')]));if(_0x58e406[_0x023f('0x2a')][_0x023f('0x36')]){_0x2b0587[_0x023f('0x34')]=_[_0x023f('0x38')](_0x2b0587[_0x023f('0x34')],{'$or':_[_0x023f('0x25')](_0x2b0587[_0x023f('0x2f')],function(_0x2303fb){var _0x1955c3={};_0x1955c3[_0x2303fb]={'$like':'%'+_0x58e406[_0x023f('0x2a')][_0x023f('0x36')]+'%'};return _0x1955c3;})});}_0x2b0587=_['merge']({},_0x2b0587,_0x58e406[_0x023f('0x39')]);return _0x4fd3a4['getSubjects'](_0x2b0587);}})[_0x023f('0x1e')](function(_0x431795){if(_0x431795){_0x9331e1=_0x431795[_0x023f('0x30')];if(!_0x58e406[_0x023f('0x2a')]['hasOwnProperty'](_0x023f('0x48'))){_0x2b0587['limit']=qs[_0x023f('0x1c')](_0x58e406[_0x023f('0x2a')][_0x023f('0x1c')]);_0x2b0587[_0x023f('0x1a')]=qs['offset'](_0x58e406[_0x023f('0x2a')][_0x023f('0x1a')]);}return _0x4fd3a4[_0x023f('0x49')](_0x2b0587);}})[_0x023f('0x1e')](function(_0x3a9643){if(_0x3a9643){return _0x3a9643?{'count':_0x9331e1,'rows':_0x3a9643}:null;}})[_0x023f('0x1e')](respondWithResult(_0x2ea5e9,null))[_0x023f('0x41')](handleError(_0x2ea5e9,null));};exports['getDescriptions']=function(_0x5a1c96,_0x483bc8,_0x58b6df){var _0x1d30fb={};var _0x14092d={};var _0x4a5ce7;var _0x1dbb4a;return db[_0x023f('0x26')][_0x023f('0x45')]({'where':{'id':_0x5a1c96[_0x023f('0x3e')]['id']}})[_0x023f('0x1e')](handleEntityNotFound(_0x483bc8,null))[_0x023f('0x1e')](function(_0x582017){if(_0x582017){_0x4a5ce7=_0x582017;_0x14092d['model']=_[_0x023f('0x2b')](db[_0x023f('0x46')][_0x023f('0x27')]);_0x14092d[_0x023f('0x2a')]=_[_0x023f('0x2b')](_0x5a1c96[_0x023f('0x2a')]);_0x14092d['filters']=_['intersection'](_0x14092d[_0x023f('0x2d')],_0x14092d[_0x023f('0x2a')]);_0x1d30fb['attributes']=_['intersection'](_0x14092d['model'],qs['fields'](_0x5a1c96[_0x023f('0x2a')]['fields']));_0x1d30fb[_0x023f('0x2f')]=_0x1d30fb[_0x023f('0x2f')][_0x023f('0x30')]?_0x1d30fb[_0x023f('0x2f')]:_0x14092d[_0x023f('0x2d')];_0x1d30fb[_0x023f('0x32')]=qs[_0x023f('0x33')](_0x5a1c96['query'][_0x023f('0x33')]);_0x1d30fb['where']=qs['filters'](_[_0x023f('0x35')](_0x5a1c96['query'],_0x14092d[_0x023f('0x2c')]));if(_0x5a1c96[_0x023f('0x2a')]['filter']){_0x1d30fb[_0x023f('0x34')]=_[_0x023f('0x38')](_0x1d30fb[_0x023f('0x34')],{'$or':_[_0x023f('0x25')](_0x1d30fb['attributes'],function(_0x5a1983){var _0x5a7ce3={};_0x5a7ce3[_0x5a1983]={'$like':'%'+_0x5a1c96[_0x023f('0x2a')][_0x023f('0x36')]+'%'};return _0x5a7ce3;})});}_0x1d30fb=_['merge']({},_0x1d30fb,_0x5a1c96['options']);return _0x4a5ce7[_0x023f('0x4a')](_0x1d30fb);}})[_0x023f('0x1e')](function(_0x207f38){if(_0x207f38){_0x1dbb4a=_0x207f38[_0x023f('0x30')];if(!_0x5a1c96[_0x023f('0x2a')][_0x023f('0x31')]('nolimit')){_0x1d30fb[_0x023f('0x1c')]=qs['limit'](_0x5a1c96[_0x023f('0x2a')][_0x023f('0x1c')]);_0x1d30fb[_0x023f('0x1a')]=qs[_0x023f('0x1a')](_0x5a1c96['query'][_0x023f('0x1a')]);}return _0x4a5ce7[_0x023f('0x4a')](_0x1d30fb);}})[_0x023f('0x1e')](function(_0x2564b7){if(_0x2564b7){return _0x2564b7?{'count':_0x1dbb4a,'rows':_0x2564b7}:null;}})[_0x023f('0x1e')](respondWithResult(_0x483bc8,null))['catch'](handleError(_0x483bc8,null));}; \ No newline at end of file +var _0x63d4=['json','undefined','limit','count','offset','set','apply','save','update','then','destroy','error','name','map','ServicenowConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','merge','find','create','body','getFields','findOne','ServicenowField','getSubjects','hasOwnProperty','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x3a7331,_0x9c95f8){var _0x537dce=function(_0x2589a7){while(--_0x2589a7){_0x3a7331['push'](_0x3a7331['shift']());}};_0x537dce(++_0x9c95f8);}(_0x63d4,0x126));var _0x463d=function(_0xfa67d5,_0x3c6e48){_0xfa67d5=_0xfa67d5-0x0;var _0x1c8923=_0x63d4[_0xfa67d5];return _0x1c8923;};'use strict';var emlformat=require(_0x463d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x463d('0x1'));var jsonpatch=require(_0x463d('0x2'));var rp=require(_0x463d('0x3'));var moment=require(_0x463d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x463d('0x5'));var util=require(_0x463d('0x6'));var path=require(_0x463d('0x7'));var sox=require(_0x463d('0x8'));var csv=require(_0x463d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x463d('0xa'));var _=require('lodash');var squel=require(_0x463d('0xb'));var crypto=require(_0x463d('0xc'));var jsforce=require(_0x463d('0xd'));var deskjs=require(_0x463d('0xe'));var toCsv=require(_0x463d('0x9'));var querystring=require(_0x463d('0xf'));var Papa=require(_0x463d('0x10'));var Redis=require(_0x463d('0x11'));var authService=require(_0x463d('0x12'));var qs=require(_0x463d('0x13'));var as=require(_0x463d('0x14'));var hardwareService=require(_0x463d('0x15'));var logger=require(_0x463d('0x16'))(_0x463d('0x17'));var utils=require('../../config/utils');var config=require(_0x463d('0x18'));var licenseUtil=require(_0x463d('0x19'));var db=require(_0x463d('0x1a'))['db'];function respondWithStatusCode(_0x5727a8,_0x5bbe33){_0x5bbe33=_0x5bbe33||0xcc;return function(_0x133d52){if(_0x133d52){return _0x5727a8[_0x463d('0x1b')](_0x5bbe33);}return _0x5727a8['status'](_0x5bbe33)[_0x463d('0x1c')]();};}function respondWithResult(_0x1d78ca,_0x49a364){_0x49a364=_0x49a364||0xc8;return function(_0x210095){if(_0x210095){return _0x1d78ca[_0x463d('0x1d')](_0x49a364)[_0x463d('0x1e')](_0x210095);}};}function respondWithFilteredResult(_0x10a12c,_0xbdbf9f){return function(_0x22d74c){if(_0x22d74c){var _0x1ff186=typeof _0xbdbf9f['offset']===_0x463d('0x1f')&&typeof _0xbdbf9f[_0x463d('0x20')]===_0x463d('0x1f');var _0x54a3bf=_0x22d74c[_0x463d('0x21')];var _0x57ae96=_0x1ff186?0x0:_0xbdbf9f[_0x463d('0x22')];var _0x34c931=_0x1ff186?_0x22d74c[_0x463d('0x21')]:_0xbdbf9f['offset']+_0xbdbf9f['limit'];var _0x3ac6ec;if(_0x34c931>=_0x54a3bf){_0x34c931=_0x54a3bf;_0x3ac6ec=0xc8;}else{_0x3ac6ec=0xce;}_0x10a12c[_0x463d('0x1d')](_0x3ac6ec);return _0x10a12c[_0x463d('0x23')]('Content-Range',_0x57ae96+'-'+_0x34c931+'/'+_0x54a3bf)['json'](_0x22d74c);}return null;};}function patchUpdates(_0x441daf){return function(_0x498f24){try{jsonpatch[_0x463d('0x24')](_0x498f24,_0x441daf,!![]);}catch(_0x1ff75b){return BPromise['reject'](_0x1ff75b);}return _0x498f24[_0x463d('0x25')]();};}function saveUpdates(_0x4f7f4d,_0x1bb6ff){return function(_0x37df5b){if(_0x37df5b){return _0x37df5b[_0x463d('0x26')](_0x4f7f4d)[_0x463d('0x27')](function(_0x6c133c){return _0x6c133c;});}return null;};}function removeEntity(_0x45ff3c,_0x4096fd){return function(_0xdfd45b){if(_0xdfd45b){return _0xdfd45b[_0x463d('0x28')]()[_0x463d('0x27')](function(){_0x45ff3c['status'](0xcc)[_0x463d('0x1c')]();});}};}function handleEntityNotFound(_0x45715f,_0x535930){return function(_0x5a7bdb){if(!_0x5a7bdb){_0x45715f[_0x463d('0x1b')](0x194);}return _0x5a7bdb;};}function handleError(_0x48f760,_0xf8175b){_0xf8175b=_0xf8175b||0x1f4;return function(_0x1f1181){logger[_0x463d('0x29')](_0x1f1181['stack']);if(_0x1f1181[_0x463d('0x2a')]){delete _0x1f1181['name'];}_0x48f760[_0x463d('0x1d')](_0xf8175b)['send'](_0x1f1181);};}exports['index']=function(_0x56f3f6,_0x2197af){var _0x3a9bc0={},_0x498226={},_0x41c6f6={'count':0x0,'rows':[]};var _0x2b1eaa=_[_0x463d('0x2b')](db[_0x463d('0x2c')][_0x463d('0x2d')],function(_0x1fb6b6){return{'name':_0x1fb6b6[_0x463d('0x2e')],'type':_0x1fb6b6[_0x463d('0x2f')]['key']};});_0x498226[_0x463d('0x30')]=_[_0x463d('0x2b')](_0x2b1eaa,'name');_0x498226[_0x463d('0x31')]=_[_0x463d('0x32')](_0x56f3f6['query']);_0x498226[_0x463d('0x33')]=_['intersection'](_0x498226[_0x463d('0x30')],_0x498226['query']);_0x3a9bc0[_0x463d('0x34')]=_[_0x463d('0x35')](_0x498226[_0x463d('0x30')],qs['fields'](_0x56f3f6[_0x463d('0x31')]['fields']));_0x3a9bc0[_0x463d('0x34')]=_0x3a9bc0[_0x463d('0x34')][_0x463d('0x36')]?_0x3a9bc0[_0x463d('0x34')]:_0x498226[_0x463d('0x30')];if(!_0x56f3f6['query']['hasOwnProperty'](_0x463d('0x37'))){_0x3a9bc0[_0x463d('0x20')]=qs[_0x463d('0x20')](_0x56f3f6[_0x463d('0x31')][_0x463d('0x20')]);_0x3a9bc0[_0x463d('0x22')]=qs[_0x463d('0x22')](_0x56f3f6[_0x463d('0x31')][_0x463d('0x22')]);}_0x3a9bc0[_0x463d('0x38')]=qs[_0x463d('0x39')](_0x56f3f6[_0x463d('0x31')][_0x463d('0x39')]);_0x3a9bc0[_0x463d('0x3a')]=qs['filters'](_[_0x463d('0x3b')](_0x56f3f6[_0x463d('0x31')],_0x498226[_0x463d('0x33')]),_0x2b1eaa);if(_0x56f3f6[_0x463d('0x31')][_0x463d('0x3c')]){_0x3a9bc0[_0x463d('0x3a')]=_['merge'](_0x3a9bc0[_0x463d('0x3a')],{'$or':_[_0x463d('0x2b')](_0x2b1eaa,function(_0x3f2c58){if(_0x3f2c58['type']!==_0x463d('0x3d')){var _0x2c4f23={};_0x2c4f23[_0x3f2c58[_0x463d('0x2a')]]={'$like':'%'+_0x56f3f6[_0x463d('0x31')][_0x463d('0x3c')]+'%'};return _0x2c4f23;}})});}_0x3a9bc0=_['merge']({},_0x3a9bc0,_0x56f3f6[_0x463d('0x3e')]);var _0x59f0ef={'where':_0x3a9bc0[_0x463d('0x3a')]};return db[_0x463d('0x2c')][_0x463d('0x21')](_0x59f0ef)[_0x463d('0x27')](function(_0x4a3bee){_0x41c6f6[_0x463d('0x21')]=_0x4a3bee;if(_0x56f3f6[_0x463d('0x31')][_0x463d('0x3f')]){_0x3a9bc0[_0x463d('0x40')]=[{'all':!![]}];}return db[_0x463d('0x2c')][_0x463d('0x41')](_0x3a9bc0);})[_0x463d('0x27')](function(_0x9cd6a0){_0x41c6f6[_0x463d('0x42')]=_0x9cd6a0;return _0x41c6f6;})[_0x463d('0x27')](respondWithFilteredResult(_0x2197af,_0x3a9bc0))[_0x463d('0x43')](handleError(_0x2197af,null));};exports[_0x463d('0x44')]=function(_0x1aa1c5,_0x588d53){var _0x2f3950={'raw':![],'where':{'id':_0x1aa1c5[_0x463d('0x45')]['id']}},_0x1e0bad={};_0x1e0bad[_0x463d('0x30')]=_[_0x463d('0x32')](db['ServicenowConfiguration'][_0x463d('0x2d')]);_0x1e0bad[_0x463d('0x31')]=_[_0x463d('0x32')](_0x1aa1c5['query']);_0x1e0bad[_0x463d('0x33')]=_[_0x463d('0x35')](_0x1e0bad[_0x463d('0x30')],_0x1e0bad[_0x463d('0x31')]);_0x2f3950[_0x463d('0x34')]=_[_0x463d('0x35')](_0x1e0bad[_0x463d('0x30')],qs['fields'](_0x1aa1c5[_0x463d('0x31')][_0x463d('0x46')]));_0x2f3950['attributes']=_0x2f3950[_0x463d('0x34')][_0x463d('0x36')]?_0x2f3950[_0x463d('0x34')]:_0x1e0bad[_0x463d('0x30')];if(_0x1aa1c5[_0x463d('0x31')][_0x463d('0x3f')]){_0x2f3950['include']=[{'all':!![]}];}_0x2f3950=_[_0x463d('0x47')]({},_0x2f3950,_0x1aa1c5[_0x463d('0x3e')]);return db[_0x463d('0x2c')][_0x463d('0x48')](_0x2f3950)[_0x463d('0x27')](handleEntityNotFound(_0x588d53,null))['then'](respondWithResult(_0x588d53,null))[_0x463d('0x43')](handleError(_0x588d53,null));};exports['create']=function(_0x1eeeb4,_0x1a06dd){return db[_0x463d('0x2c')][_0x463d('0x49')](_0x1eeeb4[_0x463d('0x4a')],{})['then'](respondWithResult(_0x1a06dd,0xc9))[_0x463d('0x43')](handleError(_0x1a06dd,null));};exports[_0x463d('0x26')]=function(_0x348fa1,_0x362199){if(_0x348fa1[_0x463d('0x4a')]['id']){delete _0x348fa1[_0x463d('0x4a')]['id'];}return db[_0x463d('0x2c')][_0x463d('0x48')]({'where':{'id':_0x348fa1[_0x463d('0x45')]['id']}})[_0x463d('0x27')](handleEntityNotFound(_0x362199,null))[_0x463d('0x27')](saveUpdates(_0x348fa1['body'],null))[_0x463d('0x27')](respondWithResult(_0x362199,null))[_0x463d('0x43')](handleError(_0x362199,null));};exports['destroy']=function(_0x56b0e2,_0x212681){return db[_0x463d('0x2c')][_0x463d('0x48')]({'where':{'id':_0x56b0e2[_0x463d('0x45')]['id']}})['then'](handleEntityNotFound(_0x212681,null))[_0x463d('0x27')](removeEntity(_0x212681,null))[_0x463d('0x43')](handleError(_0x212681,null));};exports[_0x463d('0x4b')]=function(_0x1c298b,_0x2f7e75,_0x46f70b){var _0x331fd6={};var _0x1f37ef={};var _0x281c28;var _0x4509eb;return db[_0x463d('0x2c')][_0x463d('0x4c')]({'where':{'id':_0x1c298b[_0x463d('0x45')]['id']}})['then'](handleEntityNotFound(_0x2f7e75,null))[_0x463d('0x27')](function(_0x5e4fe8){if(_0x5e4fe8){_0x281c28=_0x5e4fe8;_0x1f37ef['model']=_[_0x463d('0x32')](db[_0x463d('0x4d')][_0x463d('0x2d')]);_0x1f37ef[_0x463d('0x31')]=_['keys'](_0x1c298b[_0x463d('0x31')]);_0x1f37ef[_0x463d('0x33')]=_['intersection'](_0x1f37ef[_0x463d('0x30')],_0x1f37ef[_0x463d('0x31')]);_0x331fd6[_0x463d('0x34')]=_['intersection'](_0x1f37ef[_0x463d('0x30')],qs['fields'](_0x1c298b[_0x463d('0x31')][_0x463d('0x46')]));_0x331fd6[_0x463d('0x34')]=_0x331fd6['attributes'][_0x463d('0x36')]?_0x331fd6[_0x463d('0x34')]:_0x1f37ef['model'];_0x331fd6[_0x463d('0x38')]=qs[_0x463d('0x39')](_0x1c298b['query'][_0x463d('0x39')]);_0x331fd6[_0x463d('0x3a')]=qs[_0x463d('0x33')](_['pick'](_0x1c298b[_0x463d('0x31')],_0x1f37ef[_0x463d('0x33')]));if(_0x1c298b[_0x463d('0x31')][_0x463d('0x3c')]){_0x331fd6[_0x463d('0x3a')]=_[_0x463d('0x47')](_0x331fd6[_0x463d('0x3a')],{'$or':_['map'](_0x331fd6['attributes'],function(_0x24c011){var _0x12a05d={};_0x12a05d[_0x24c011]={'$like':'%'+_0x1c298b[_0x463d('0x31')][_0x463d('0x3c')]+'%'};return _0x12a05d;})});}_0x331fd6=_['merge']({},_0x331fd6,_0x1c298b[_0x463d('0x3e')]);return _0x281c28[_0x463d('0x4b')](_0x331fd6);}})[_0x463d('0x27')](function(_0x18f6fc){if(_0x18f6fc){_0x4509eb=_0x18f6fc[_0x463d('0x36')];if(!_0x1c298b['query']['hasOwnProperty'](_0x463d('0x37'))){_0x331fd6[_0x463d('0x20')]=qs[_0x463d('0x20')](_0x1c298b['query'][_0x463d('0x20')]);_0x331fd6[_0x463d('0x22')]=qs['offset'](_0x1c298b[_0x463d('0x31')][_0x463d('0x22')]);}return _0x281c28[_0x463d('0x4b')](_0x331fd6);}})['then'](function(_0x4c8037){if(_0x4c8037){return _0x4c8037?{'count':_0x4509eb,'rows':_0x4c8037}:null;}})[_0x463d('0x27')](respondWithResult(_0x2f7e75,null))[_0x463d('0x43')](handleError(_0x2f7e75,null));};exports[_0x463d('0x4e')]=function(_0x31eeca,_0x3b5f1a,_0xc4be42){var _0x167820={};var _0x164722={};var _0x4a7c56;var _0x205fe6;return db['ServicenowConfiguration'][_0x463d('0x4c')]({'where':{'id':_0x31eeca[_0x463d('0x45')]['id']}})['then'](handleEntityNotFound(_0x3b5f1a,null))[_0x463d('0x27')](function(_0x7b298f){if(_0x7b298f){_0x4a7c56=_0x7b298f;_0x164722[_0x463d('0x30')]=_[_0x463d('0x32')](db[_0x463d('0x4d')][_0x463d('0x2d')]);_0x164722[_0x463d('0x31')]=_[_0x463d('0x32')](_0x31eeca[_0x463d('0x31')]);_0x164722[_0x463d('0x33')]=_[_0x463d('0x35')](_0x164722[_0x463d('0x30')],_0x164722[_0x463d('0x31')]);_0x167820[_0x463d('0x34')]=_[_0x463d('0x35')](_0x164722[_0x463d('0x30')],qs[_0x463d('0x46')](_0x31eeca[_0x463d('0x31')][_0x463d('0x46')]));_0x167820[_0x463d('0x34')]=_0x167820[_0x463d('0x34')][_0x463d('0x36')]?_0x167820[_0x463d('0x34')]:_0x164722['model'];_0x167820[_0x463d('0x38')]=qs[_0x463d('0x39')](_0x31eeca[_0x463d('0x31')][_0x463d('0x39')]);_0x167820[_0x463d('0x3a')]=qs[_0x463d('0x33')](_['pick'](_0x31eeca[_0x463d('0x31')],_0x164722[_0x463d('0x33')]));if(_0x31eeca[_0x463d('0x31')][_0x463d('0x3c')]){_0x167820[_0x463d('0x3a')]=_[_0x463d('0x47')](_0x167820[_0x463d('0x3a')],{'$or':_['map'](_0x167820['attributes'],function(_0x3154e4){var _0x128d0e={};_0x128d0e[_0x3154e4]={'$like':'%'+_0x31eeca['query'][_0x463d('0x3c')]+'%'};return _0x128d0e;})});}_0x167820=_[_0x463d('0x47')]({},_0x167820,_0x31eeca['options']);return _0x4a7c56['getSubjects'](_0x167820);}})[_0x463d('0x27')](function(_0x4f9cbc){if(_0x4f9cbc){_0x205fe6=_0x4f9cbc['length'];if(!_0x31eeca[_0x463d('0x31')][_0x463d('0x4f')](_0x463d('0x37'))){_0x167820[_0x463d('0x20')]=qs[_0x463d('0x20')](_0x31eeca[_0x463d('0x31')][_0x463d('0x20')]);_0x167820['offset']=qs[_0x463d('0x22')](_0x31eeca[_0x463d('0x31')][_0x463d('0x22')]);}return _0x4a7c56[_0x463d('0x4e')](_0x167820);}})['then'](function(_0x1169bf){if(_0x1169bf){return _0x1169bf?{'count':_0x205fe6,'rows':_0x1169bf}:null;}})[_0x463d('0x27')](respondWithResult(_0x3b5f1a,null))['catch'](handleError(_0x3b5f1a,null));};exports[_0x463d('0x50')]=function(_0x3a5a37,_0x31d4fb,_0x31b85b){var _0x8b1305={};var _0x50e8c0={};var _0x4b7546;var _0x25b471;return db[_0x463d('0x2c')]['findOne']({'where':{'id':_0x3a5a37[_0x463d('0x45')]['id']}})[_0x463d('0x27')](handleEntityNotFound(_0x31d4fb,null))[_0x463d('0x27')](function(_0x5e7a19){if(_0x5e7a19){_0x4b7546=_0x5e7a19;_0x50e8c0[_0x463d('0x30')]=_[_0x463d('0x32')](db[_0x463d('0x4d')][_0x463d('0x2d')]);_0x50e8c0[_0x463d('0x31')]=_[_0x463d('0x32')](_0x3a5a37[_0x463d('0x31')]);_0x50e8c0['filters']=_['intersection'](_0x50e8c0[_0x463d('0x30')],_0x50e8c0[_0x463d('0x31')]);_0x8b1305['attributes']=_['intersection'](_0x50e8c0[_0x463d('0x30')],qs[_0x463d('0x46')](_0x3a5a37[_0x463d('0x31')][_0x463d('0x46')]));_0x8b1305['attributes']=_0x8b1305['attributes'][_0x463d('0x36')]?_0x8b1305[_0x463d('0x34')]:_0x50e8c0[_0x463d('0x30')];_0x8b1305['order']=qs[_0x463d('0x39')](_0x3a5a37[_0x463d('0x31')]['sort']);_0x8b1305[_0x463d('0x3a')]=qs['filters'](_[_0x463d('0x3b')](_0x3a5a37[_0x463d('0x31')],_0x50e8c0[_0x463d('0x33')]));if(_0x3a5a37[_0x463d('0x31')][_0x463d('0x3c')]){_0x8b1305['where']=_[_0x463d('0x47')](_0x8b1305['where'],{'$or':_[_0x463d('0x2b')](_0x8b1305[_0x463d('0x34')],function(_0xc2496b){var _0x246189={};_0x246189[_0xc2496b]={'$like':'%'+_0x3a5a37[_0x463d('0x31')][_0x463d('0x3c')]+'%'};return _0x246189;})});}_0x8b1305=_[_0x463d('0x47')]({},_0x8b1305,_0x3a5a37[_0x463d('0x3e')]);return _0x4b7546['getDescriptions'](_0x8b1305);}})['then'](function(_0x26ec39){if(_0x26ec39){_0x25b471=_0x26ec39['length'];if(!_0x3a5a37[_0x463d('0x31')]['hasOwnProperty'](_0x463d('0x37'))){_0x8b1305[_0x463d('0x20')]=qs[_0x463d('0x20')](_0x3a5a37['query'][_0x463d('0x20')]);_0x8b1305[_0x463d('0x22')]=qs['offset'](_0x3a5a37[_0x463d('0x31')][_0x463d('0x22')]);}return _0x4b7546[_0x463d('0x50')](_0x8b1305);}})[_0x463d('0x27')](function(_0x50d9f1){if(_0x50d9f1){return _0x50d9f1?{'count':_0x25b471,'rows':_0x50d9f1}:null;}})[_0x463d('0x27')](respondWithResult(_0x31d4fb,null))[_0x463d('0x43')](handleError(_0x31d4fb,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 0de050e..fe778c0 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 _0xa1aa=['moment','bluebird','rimraf','../../config/environment','exports','ServicenowConfiguration','util','../../config/logger','api'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xa1aa,0x19b));var _0xaa1a=function(_0x708e3b,_0x2d54b3){_0x708e3b=_0x708e3b-0x0;var _0x4353ed=_0xa1aa[_0x708e3b];return _0x4353ed;};'use strict';var _=require('lodash');var util=require(_0xaa1a('0x0'));var logger=require(_0xaa1a('0x1'))(_0xaa1a('0x2'));var moment=require(_0xaa1a('0x3'));var BPromise=require(_0xaa1a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaa1a('0x5'));var config=require(_0xaa1a('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xaa1a('0x7')]=function(_0x370a4e,_0x243c15){return _0x370a4e['define'](_0xaa1a('0x8'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8130=['ServicenowConfiguration','int_servicenow_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./intServicenowConfiguration.attributes','define'];(function(_0x55ec7a,_0x29f08a){var _0x589980=function(_0x2eb8b2){while(--_0x2eb8b2){_0x55ec7a['push'](_0x55ec7a['shift']());}};_0x589980(++_0x29f08a);}(_0x8130,0x146));var _0x0813=function(_0x5d9c81,_0x348326){_0x5d9c81=_0x5d9c81-0x0;var _0x46a464=_0x8130[_0x5d9c81];return _0x46a464;};'use strict';var _=require(_0x0813('0x0'));var util=require(_0x0813('0x1'));var logger=require('../../config/logger')(_0x0813('0x2'));var moment=require(_0x0813('0x3'));var BPromise=require(_0x0813('0x4'));var rp=require(_0x0813('0x5'));var fs=require('fs');var path=require(_0x0813('0x6'));var rimraf=require(_0x0813('0x7'));var config=require('../../config/environment');var attributes=require(_0x0813('0x8'));module['exports']=function(_0x563ee2,_0x306454){return _0x563ee2[_0x0813('0x9')](_0x0813('0xa'),attributes,{'tableName':_0x0813('0xb'),'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 d8fb735..b71813c 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 _0xde4e=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','ServicenowConfiguration,\x20%s,\x20%s','result','lodash'];(function(_0x35485a,_0x91cdd4){var _0x5148e6=function(_0x27ed1d){while(--_0x27ed1d){_0x35485a['push'](_0x35485a['shift']());}};_0x5148e6(++_0x91cdd4);}(_0xde4e,0x18e));var _0xede4=function(_0x3100eb,_0x3edfa9){_0x3100eb=_0x3100eb-0x0;var _0x21daf9=_0xde4e[_0x3100eb];return _0x21daf9;};'use strict';var _=require(_0xede4('0x0'));var util=require(_0xede4('0x1'));var moment=require('moment');var BPromise=require(_0xede4('0x2'));var rs=require(_0xede4('0x3'));var fs=require('fs');var Redis=require(_0xede4('0x4'));var db=require(_0xede4('0x5'))['db'];var utils=require(_0xede4('0x6'));var logger=require(_0xede4('0x7'))(_0xede4('0x8'));var config=require(_0xede4('0x9'));var jayson=require(_0xede4('0xa'));var client=jayson['client'][_0xede4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c2bdf,_0x227bd0,_0x387be8){return new BPromise(function(_0x22b2e6,_0x30a970){return client['request'](_0x2c2bdf,_0x387be8)['then'](function(_0x46ac85){logger[_0xede4('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x227bd0,_0xede4('0xd'));logger[_0xede4('0xe')](_0xede4('0xf'),_0x227bd0,_0xede4('0xd'),JSON[_0xede4('0x10')](_0x46ac85));if(_0x46ac85[_0xede4('0x11')]){if(_0x46ac85[_0xede4('0x11')]['code']===0x1f4){logger[_0xede4('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x227bd0,_0x46ac85['error'][_0xede4('0x12')]);return _0x30a970(_0x46ac85['error'][_0xede4('0x12')]);}logger[_0xede4('0x11')](_0xede4('0x13'),_0x227bd0,_0x46ac85['error'][_0xede4('0x12')]);return _0x22b2e6(_0x46ac85[_0xede4('0x11')][_0xede4('0x12')]);}else{logger[_0xede4('0xc')](_0xede4('0x13'),_0x227bd0,_0xede4('0xd'));_0x22b2e6(_0x46ac85[_0xede4('0x14')][_0xede4('0x12')]);}})['catch'](function(_0x53f95b){logger[_0xede4('0x11')](_0xede4('0x13'),_0x227bd0,_0x53f95b);_0x30a970(_0x53f95b);});});} \ No newline at end of file +var _0x5556=['client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x5556,0x138));var _0x6555=function(_0x323f13,_0x5975ae){_0x323f13=_0x323f13-0x0;var _0x755a38=_0x5556[_0x323f13];return _0x755a38;};'use strict';var _=require(_0x6555('0x0'));var util=require(_0x6555('0x1'));var moment=require(_0x6555('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6555('0x3'))['db'];var utils=require(_0x6555('0x4'));var logger=require('../../config/logger')(_0x6555('0x5'));var config=require(_0x6555('0x6'));var jayson=require(_0x6555('0x7'));var client=jayson[_0x6555('0x8')][_0x6555('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcc76cc,_0x126950,_0x1c4b95){return new BPromise(function(_0xc9540f,_0x56886a){return client[_0x6555('0xa')](_0xcc76cc,_0x1c4b95)[_0x6555('0xb')](function(_0xd605bc){logger[_0x6555('0xc')](_0x6555('0xd'),_0x126950,'request\x20sent');logger[_0x6555('0xe')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x126950,_0x6555('0xf'),JSON[_0x6555('0x10')](_0xd605bc));if(_0xd605bc[_0x6555('0x11')]){if(_0xd605bc['error'][_0x6555('0x12')]===0x1f4){logger[_0x6555('0x11')](_0x6555('0xd'),_0x126950,_0xd605bc['error']['message']);return _0x56886a(_0xd605bc[_0x6555('0x11')][_0x6555('0x13')]);}logger[_0x6555('0x11')](_0x6555('0xd'),_0x126950,_0xd605bc[_0x6555('0x11')][_0x6555('0x13')]);return _0xc9540f(_0xd605bc['error'][_0x6555('0x13')]);}else{logger[_0x6555('0xc')](_0x6555('0xd'),_0x126950,_0x6555('0xf'));_0xc9540f(_0xd605bc['result'][_0x6555('0x13')]);}})['catch'](function(_0x311e18){logger[_0x6555('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x126950,_0x311e18);_0x56886a(_0x311e18);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index d125a35..0312c98 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 _0xcdb2=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller'];(function(_0x50a635,_0x158de3){var _0x15fcdf=function(_0x16342e){while(--_0x16342e){_0x50a635['push'](_0x50a635['shift']());}};_0x15fcdf(++_0x158de3);}(_0xcdb2,0x182));var _0x2cdb=function(_0x311265,_0x3e5c66){_0x311265=_0x311265-0x0;var _0x8f5b7d=_0xcdb2[_0x311265];return _0x8f5b7d;};'use strict';var multer=require(_0x2cdb('0x0'));var util=require(_0x2cdb('0x1'));var path=require(_0x2cdb('0x2'));var timeout=require(_0x2cdb('0x3'));var express=require(_0x2cdb('0x4'));var router=express[_0x2cdb('0x5')]();var fs_extra=require(_0x2cdb('0x6'));var auth=require(_0x2cdb('0x7'));var interaction=require(_0x2cdb('0x8'));var config=require('../../config/environment');var controller=require(_0x2cdb('0x9'));router[_0x2cdb('0xa')]('/',auth[_0x2cdb('0xb')](),controller[_0x2cdb('0xc')]);router[_0x2cdb('0xa')](_0x2cdb('0xd'),auth[_0x2cdb('0xb')](),controller[_0x2cdb('0xe')]);router[_0x2cdb('0xf')]('/',auth['isAuthenticated'](),controller[_0x2cdb('0x10')]);router[_0x2cdb('0x11')](_0x2cdb('0xd'),auth[_0x2cdb('0xb')](),controller[_0x2cdb('0x12')]);router[_0x2cdb('0x13')](_0x2cdb('0xd'),auth[_0x2cdb('0xb')](),controller[_0x2cdb('0x14')]);module[_0x2cdb('0x15')]=router; \ No newline at end of file +var _0x007c=['show','post','put','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','index','/:id','isAuthenticated'];(function(_0x2ccc86,_0x5bc5f9){var _0x2cc3d9=function(_0x3df903){while(--_0x3df903){_0x2ccc86['push'](_0x2ccc86['shift']());}};_0x2cc3d9(++_0x5bc5f9);}(_0x007c,0xb1));var _0xc007=function(_0x1e3115,_0x588a94){_0x1e3115=_0x1e3115-0x0;var _0x57dc4c=_0x007c[_0x1e3115];return _0x57dc4c;};'use strict';var multer=require('multer');var util=require(_0xc007('0x0'));var path=require(_0xc007('0x1'));var timeout=require(_0xc007('0x2'));var express=require('express');var router=express[_0xc007('0x3')]();var fs_extra=require(_0xc007('0x4'));var auth=require(_0xc007('0x5'));var interaction=require(_0xc007('0x6'));var config=require(_0xc007('0x7'));var controller=require(_0xc007('0x8'));router[_0xc007('0x9')]('/',auth['isAuthenticated'](),controller[_0xc007('0xa')]);router[_0xc007('0x9')](_0xc007('0xb'),auth[_0xc007('0xc')](),controller[_0xc007('0xd')]);router[_0xc007('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc007('0xf')](_0xc007('0xb'),auth[_0xc007('0xc')](),controller[_0xc007('0x10')]);router['delete'](_0xc007('0xb'),auth[_0xc007('0xc')](),controller[_0xc007('0x11')]);module[_0xc007('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 1e09801..c964f9d 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 _0xf781=['picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable'];(function(_0x1457b5,_0x14a58f){var _0x3e08e1=function(_0x48ef58){while(--_0x48ef58){_0x1457b5['push'](_0x1457b5['shift']());}};_0x3e08e1(++_0x14a58f);}(_0xf781,0x1cb));var _0x1f78=function(_0x3fdc00,_0x22d02e){_0x3fdc00=_0x3fdc00-0x0;var _0x443d76=_0xf781[_0x3fdc00];return _0x443d76;};'use strict';var Sequelize=require('sequelize');module[_0x1f78('0x0')]={'type':{'type':Sequelize[_0x1f78('0x1')](_0x1f78('0x2'),_0x1f78('0x3'),_0x1f78('0x4'),'keyValue',_0x1f78('0x5')),'defaultValue':_0x1f78('0x2')},'content':{'type':Sequelize[_0x1f78('0x6')]},'key':{'type':Sequelize[_0x1f78('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x1f78('0x2'),_0x1f78('0x3'),_0x1f78('0x4'))},'keyContent':{'type':Sequelize[_0x1f78('0x6')]},'idField':{'type':Sequelize[_0x1f78('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1f78('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1f78('0x6')]}}; \ No newline at end of file +var _0x4939=['BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM'];(function(_0x35d1c2,_0x1e9697){var _0x363605=function(_0x12e94a){while(--_0x12e94a){_0x35d1c2['push'](_0x35d1c2['shift']());}};_0x363605(++_0x1e9697);}(_0x4939,0x79));var _0x9493=function(_0x2dd126,_0x1b8fca){_0x2dd126=_0x2dd126-0x0;var _0x24ab18=_0x4939[_0x2dd126];return _0x24ab18;};'use strict';var Sequelize=require(_0x9493('0x0'));module[_0x9493('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9493('0x2'),_0x9493('0x3'),_0x9493('0x4'),_0x9493('0x5'),_0x9493('0x6')),'defaultValue':_0x9493('0x2')},'content':{'type':Sequelize[_0x9493('0x7')]},'key':{'type':Sequelize[_0x9493('0x7')]},'keyType':{'type':Sequelize[_0x9493('0x8')]('string',_0x9493('0x3'),_0x9493('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9493('0x7')]},'customField':{'type':Sequelize[_0x9493('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index faaeec4..5d1c72b 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 _0xb15a=['lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ServicenowField','findAll','rows','catch','params','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x19a92e,_0x18cbfa){var _0x3600b5=function(_0x52651c){while(--_0x52651c){_0x19a92e['push'](_0x19a92e['shift']());}};_0x3600b5(++_0x18cbfa);}(_0xb15a,0x8e));var _0xab15=function(_0x12e073,_0x4d43db){_0x12e073=_0x12e073-0x0;var _0x267748=_0xb15a[_0x12e073];return _0x267748;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab15('0x0'));var zipdir=require(_0xab15('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab15('0x2'));var moment=require(_0xab15('0x3'));var BPromise=require(_0xab15('0x4'));var Mustache=require(_0xab15('0x5'));var util=require(_0xab15('0x6'));var path=require(_0xab15('0x7'));var sox=require(_0xab15('0x8'));var csv=require(_0xab15('0x9'));var ejs=require(_0xab15('0xa'));var fs=require('fs');var fs_extra=require(_0xab15('0xb'));var _=require(_0xab15('0xc'));var squel=require(_0xab15('0xd'));var crypto=require(_0xab15('0xe'));var jsforce=require(_0xab15('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xab15('0x10'));var Papa=require('papaparse');var Redis=require(_0xab15('0x11'));var authService=require(_0xab15('0x12'));var qs=require(_0xab15('0x13'));var as=require(_0xab15('0x14'));var hardwareService=require(_0xab15('0x15'));var logger=require(_0xab15('0x16'))('api');var utils=require(_0xab15('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xab15('0x18'));var db=require(_0xab15('0x19'))['db'];function respondWithStatusCode(_0x245a53,_0x595b9b){_0x595b9b=_0x595b9b||0xcc;return function(_0x81d513){if(_0x81d513){return _0x245a53['sendStatus'](_0x595b9b);}return _0x245a53[_0xab15('0x1a')](_0x595b9b)[_0xab15('0x1b')]();};}function respondWithResult(_0x5d356a,_0x438cfa){_0x438cfa=_0x438cfa||0xc8;return function(_0xd87f44){if(_0xd87f44){return _0x5d356a[_0xab15('0x1a')](_0x438cfa)[_0xab15('0x1c')](_0xd87f44);}};}function respondWithFilteredResult(_0x2638bf,_0x167319){return function(_0x228546){if(_0x228546){var _0x508cf3=typeof _0x167319[_0xab15('0x1d')]==='undefined'&&typeof _0x167319['limit']===_0xab15('0x1e');var _0x27d0bb=_0x228546[_0xab15('0x1f')];var _0x3f8a0a=_0x508cf3?0x0:_0x167319['offset'];var _0x15fade=_0x508cf3?_0x228546['count']:_0x167319[_0xab15('0x1d')]+_0x167319[_0xab15('0x20')];var _0x5747d1;if(_0x15fade>=_0x27d0bb){_0x15fade=_0x27d0bb;_0x5747d1=0xc8;}else{_0x5747d1=0xce;}_0x2638bf[_0xab15('0x1a')](_0x5747d1);return _0x2638bf[_0xab15('0x21')](_0xab15('0x22'),_0x3f8a0a+'-'+_0x15fade+'/'+_0x27d0bb)[_0xab15('0x1c')](_0x228546);}return null;};}function patchUpdates(_0x331abe){return function(_0x93f0ed){try{jsonpatch['apply'](_0x93f0ed,_0x331abe,!![]);}catch(_0x804583){return BPromise[_0xab15('0x23')](_0x804583);}return _0x93f0ed['save']();};}function saveUpdates(_0x536b1a,_0x571ab5){return function(_0xd51fe9){if(_0xd51fe9){return _0xd51fe9[_0xab15('0x24')](_0x536b1a)[_0xab15('0x25')](function(_0x17a228){return _0x17a228;});}return null;};}function removeEntity(_0x3ccb17,_0x590494){return function(_0x4745ad){if(_0x4745ad){return _0x4745ad[_0xab15('0x26')]()[_0xab15('0x25')](function(){_0x3ccb17['status'](0xcc)[_0xab15('0x1b')]();});}};}function handleEntityNotFound(_0x4dc161,_0x1e4e0d){return function(_0x4df9cc){if(!_0x4df9cc){_0x4dc161['sendStatus'](0x194);}return _0x4df9cc;};}function handleError(_0x2642c5,_0x26d51a){_0x26d51a=_0x26d51a||0x1f4;return function(_0x1b5680){logger[_0xab15('0x27')](_0x1b5680[_0xab15('0x28')]);if(_0x1b5680[_0xab15('0x29')]){delete _0x1b5680[_0xab15('0x29')];}_0x2642c5[_0xab15('0x1a')](_0x26d51a)[_0xab15('0x2a')](_0x1b5680);};}exports[_0xab15('0x2b')]=function(_0x1a6bd6,_0x579a45){var _0x11d680={},_0x1d4a6c={},_0x599ec3={'count':0x0,'rows':[]};var _0x4df74c=_[_0xab15('0x2c')](db['ServicenowField'][_0xab15('0x2d')],function(_0x181b34){return{'name':_0x181b34[_0xab15('0x2e')],'type':_0x181b34[_0xab15('0x2f')][_0xab15('0x30')]};});_0x1d4a6c['model']=_[_0xab15('0x2c')](_0x4df74c,_0xab15('0x29'));_0x1d4a6c[_0xab15('0x31')]=_[_0xab15('0x32')](_0x1a6bd6[_0xab15('0x31')]);_0x1d4a6c[_0xab15('0x33')]=_[_0xab15('0x34')](_0x1d4a6c[_0xab15('0x35')],_0x1d4a6c[_0xab15('0x31')]);_0x11d680[_0xab15('0x36')]=_[_0xab15('0x34')](_0x1d4a6c[_0xab15('0x35')],qs[_0xab15('0x37')](_0x1a6bd6['query'][_0xab15('0x37')]));_0x11d680['attributes']=_0x11d680[_0xab15('0x36')][_0xab15('0x38')]?_0x11d680[_0xab15('0x36')]:_0x1d4a6c[_0xab15('0x35')];if(!_0x1a6bd6[_0xab15('0x31')][_0xab15('0x39')](_0xab15('0x3a'))){_0x11d680[_0xab15('0x20')]=qs['limit'](_0x1a6bd6[_0xab15('0x31')][_0xab15('0x20')]);_0x11d680[_0xab15('0x1d')]=qs[_0xab15('0x1d')](_0x1a6bd6[_0xab15('0x31')][_0xab15('0x1d')]);}_0x11d680[_0xab15('0x3b')]=qs[_0xab15('0x3c')](_0x1a6bd6[_0xab15('0x31')]['sort']);_0x11d680[_0xab15('0x3d')]=qs[_0xab15('0x33')](_[_0xab15('0x3e')](_0x1a6bd6['query'],_0x1d4a6c[_0xab15('0x33')]),_0x4df74c);if(_0x1a6bd6[_0xab15('0x31')][_0xab15('0x3f')]){_0x11d680[_0xab15('0x3d')]=_[_0xab15('0x40')](_0x11d680[_0xab15('0x3d')],{'$or':_[_0xab15('0x2c')](_0x4df74c,function(_0x152a42){if(_0x152a42['type']!==_0xab15('0x41')){var _0x3b74a5={};_0x3b74a5[_0x152a42[_0xab15('0x29')]]={'$like':'%'+_0x1a6bd6['query']['filter']+'%'};return _0x3b74a5;}})});}_0x11d680=_['merge']({},_0x11d680,_0x1a6bd6[_0xab15('0x42')]);var _0x5a6dbf={'where':_0x11d680[_0xab15('0x3d')]};return db['ServicenowField'][_0xab15('0x1f')](_0x5a6dbf)[_0xab15('0x25')](function(_0x538f3e){_0x599ec3['count']=_0x538f3e;if(_0x1a6bd6[_0xab15('0x31')][_0xab15('0x43')]){_0x11d680[_0xab15('0x44')]=[{'all':!![]}];}return db[_0xab15('0x45')][_0xab15('0x46')](_0x11d680);})[_0xab15('0x25')](function(_0x2e2cb2){_0x599ec3[_0xab15('0x47')]=_0x2e2cb2;return _0x599ec3;})[_0xab15('0x25')](respondWithFilteredResult(_0x579a45,_0x11d680))[_0xab15('0x48')](handleError(_0x579a45,null));};exports['show']=function(_0x10e717,_0x5261db){var _0xb4865={'raw':!![],'where':{'id':_0x10e717[_0xab15('0x49')]['id']}},_0x132b36={};_0x132b36[_0xab15('0x35')]=_['keys'](db[_0xab15('0x45')]['rawAttributes']);_0x132b36[_0xab15('0x31')]=_[_0xab15('0x32')](_0x10e717[_0xab15('0x31')]);_0x132b36['filters']=_[_0xab15('0x34')](_0x132b36[_0xab15('0x35')],_0x132b36[_0xab15('0x31')]);_0xb4865[_0xab15('0x36')]=_[_0xab15('0x34')](_0x132b36['model'],qs[_0xab15('0x37')](_0x10e717['query'][_0xab15('0x37')]));_0xb4865[_0xab15('0x36')]=_0xb4865[_0xab15('0x36')][_0xab15('0x38')]?_0xb4865['attributes']:_0x132b36[_0xab15('0x35')];if(_0x10e717['query']['includeAll']){_0xb4865[_0xab15('0x44')]=[{'all':!![]}];}_0xb4865=_['merge']({},_0xb4865,_0x10e717['options']);return db[_0xab15('0x45')][_0xab15('0x4a')](_0xb4865)[_0xab15('0x25')](handleEntityNotFound(_0x5261db,null))['then'](respondWithResult(_0x5261db,null))[_0xab15('0x48')](handleError(_0x5261db,null));};exports[_0xab15('0x4b')]=function(_0x124e48,_0x590b83){return db['ServicenowField'][_0xab15('0x4b')](_0x124e48[_0xab15('0x4c')],{})['then'](respondWithResult(_0x590b83,0xc9))['catch'](handleError(_0x590b83,null));};exports['update']=function(_0x2797b5,_0x1aa9ec){if(_0x2797b5[_0xab15('0x4c')]['id']){delete _0x2797b5[_0xab15('0x4c')]['id'];}return db[_0xab15('0x45')]['find']({'where':{'id':_0x2797b5[_0xab15('0x49')]['id']}})['then'](handleEntityNotFound(_0x1aa9ec,null))[_0xab15('0x25')](saveUpdates(_0x2797b5[_0xab15('0x4c')],null))[_0xab15('0x25')](respondWithResult(_0x1aa9ec,null))[_0xab15('0x48')](handleError(_0x1aa9ec,null));};exports['destroy']=function(_0x3e1c02,_0x55906b){return db['ServicenowField'][_0xab15('0x4a')]({'where':{'id':_0x3e1c02['params']['id']}})[_0xab15('0x25')](handleEntityNotFound(_0x55906b,null))[_0xab15('0x25')](removeEntity(_0x55906b,null))[_0xab15('0x48')](handleError(_0x55906b,null));}; \ No newline at end of file +var _0xcdaa=['findAll','rows','catch','show','params','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include'];(function(_0x57d740,_0x50be99){var _0x6607ef=function(_0x908bd0){while(--_0x908bd0){_0x57d740['push'](_0x57d740['shift']());}};_0x6607ef(++_0x50be99);}(_0xcdaa,0x93));var _0xacda=function(_0xb028ea,_0x362e7e){_0xb028ea=_0xb028ea-0x0;var _0x50899a=_0xcdaa[_0xb028ea];return _0x50899a;};'use strict';var emlformat=require(_0xacda('0x0'));var rimraf=require(_0xacda('0x1'));var zipdir=require(_0xacda('0x2'));var jsonpatch=require(_0xacda('0x3'));var rp=require(_0xacda('0x4'));var moment=require(_0xacda('0x5'));var BPromise=require(_0xacda('0x6'));var Mustache=require(_0xacda('0x7'));var util=require('util');var path=require(_0xacda('0x8'));var sox=require('sox');var csv=require(_0xacda('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xacda('0xa'));var _=require(_0xacda('0xb'));var squel=require(_0xacda('0xc'));var crypto=require('crypto');var jsforce=require(_0xacda('0xd'));var deskjs=require(_0xacda('0xe'));var toCsv=require(_0xacda('0x9'));var querystring=require(_0xacda('0xf'));var Papa=require(_0xacda('0x10'));var Redis=require(_0xacda('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xacda('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xacda('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xacda('0x14'));var licenseUtil=require(_0xacda('0x15'));var db=require(_0xacda('0x16'))['db'];function respondWithStatusCode(_0x493b90,_0x4e456c){_0x4e456c=_0x4e456c||0xcc;return function(_0x35129e){if(_0x35129e){return _0x493b90['sendStatus'](_0x4e456c);}return _0x493b90[_0xacda('0x17')](_0x4e456c)[_0xacda('0x18')]();};}function respondWithResult(_0x16a5ec,_0x67af5b){_0x67af5b=_0x67af5b||0xc8;return function(_0x5eef26){if(_0x5eef26){return _0x16a5ec['status'](_0x67af5b)[_0xacda('0x19')](_0x5eef26);}};}function respondWithFilteredResult(_0x4ddcd8,_0x1f2813){return function(_0x1f6ec0){if(_0x1f6ec0){var _0x1a5dda=typeof _0x1f2813[_0xacda('0x1a')]===_0xacda('0x1b')&&typeof _0x1f2813[_0xacda('0x1c')]===_0xacda('0x1b');var _0x35fe91=_0x1f6ec0[_0xacda('0x1d')];var _0x174907=_0x1a5dda?0x0:_0x1f2813[_0xacda('0x1a')];var _0x19a7b5=_0x1a5dda?_0x1f6ec0[_0xacda('0x1d')]:_0x1f2813[_0xacda('0x1a')]+_0x1f2813[_0xacda('0x1c')];var _0x38e11c;if(_0x19a7b5>=_0x35fe91){_0x19a7b5=_0x35fe91;_0x38e11c=0xc8;}else{_0x38e11c=0xce;}_0x4ddcd8[_0xacda('0x17')](_0x38e11c);return _0x4ddcd8['set']('Content-Range',_0x174907+'-'+_0x19a7b5+'/'+_0x35fe91)[_0xacda('0x19')](_0x1f6ec0);}return null;};}function patchUpdates(_0x22985a){return function(_0x46aaf7){try{jsonpatch['apply'](_0x46aaf7,_0x22985a,!![]);}catch(_0x272d12){return BPromise[_0xacda('0x1e')](_0x272d12);}return _0x46aaf7[_0xacda('0x1f')]();};}function saveUpdates(_0x207af2,_0x3a3205){return function(_0x2a27d1){if(_0x2a27d1){return _0x2a27d1[_0xacda('0x20')](_0x207af2)[_0xacda('0x21')](function(_0x2cc96d){return _0x2cc96d;});}return null;};}function removeEntity(_0x3e5a1b,_0x2f9100){return function(_0x2091d4){if(_0x2091d4){return _0x2091d4[_0xacda('0x22')]()['then'](function(){_0x3e5a1b[_0xacda('0x17')](0xcc)[_0xacda('0x18')]();});}};}function handleEntityNotFound(_0x48028e,_0x5501eb){return function(_0x414886){if(!_0x414886){_0x48028e['sendStatus'](0x194);}return _0x414886;};}function handleError(_0x391b86,_0xde129d){_0xde129d=_0xde129d||0x1f4;return function(_0x321810){logger[_0xacda('0x23')](_0x321810[_0xacda('0x24')]);if(_0x321810[_0xacda('0x25')]){delete _0x321810[_0xacda('0x25')];}_0x391b86['status'](_0xde129d)[_0xacda('0x26')](_0x321810);};}exports[_0xacda('0x27')]=function(_0x3f55c8,_0xefb0c2){var _0x1aeed6={},_0x4c0c41={},_0x133376={'count':0x0,'rows':[]};var _0x593696=_[_0xacda('0x28')](db[_0xacda('0x29')][_0xacda('0x2a')],function(_0x22d088){return{'name':_0x22d088[_0xacda('0x2b')],'type':_0x22d088['type']['key']};});_0x4c0c41[_0xacda('0x2c')]=_[_0xacda('0x28')](_0x593696,'name');_0x4c0c41[_0xacda('0x2d')]=_[_0xacda('0x2e')](_0x3f55c8[_0xacda('0x2d')]);_0x4c0c41[_0xacda('0x2f')]=_[_0xacda('0x30')](_0x4c0c41['model'],_0x4c0c41['query']);_0x1aeed6[_0xacda('0x31')]=_[_0xacda('0x30')](_0x4c0c41[_0xacda('0x2c')],qs[_0xacda('0x32')](_0x3f55c8[_0xacda('0x2d')][_0xacda('0x32')]));_0x1aeed6[_0xacda('0x31')]=_0x1aeed6['attributes'][_0xacda('0x33')]?_0x1aeed6[_0xacda('0x31')]:_0x4c0c41[_0xacda('0x2c')];if(!_0x3f55c8[_0xacda('0x2d')][_0xacda('0x34')]('nolimit')){_0x1aeed6['limit']=qs['limit'](_0x3f55c8[_0xacda('0x2d')][_0xacda('0x1c')]);_0x1aeed6[_0xacda('0x1a')]=qs[_0xacda('0x1a')](_0x3f55c8[_0xacda('0x2d')][_0xacda('0x1a')]);}_0x1aeed6[_0xacda('0x35')]=qs[_0xacda('0x36')](_0x3f55c8['query'][_0xacda('0x36')]);_0x1aeed6[_0xacda('0x37')]=qs[_0xacda('0x2f')](_[_0xacda('0x38')](_0x3f55c8[_0xacda('0x2d')],_0x4c0c41[_0xacda('0x2f')]),_0x593696);if(_0x3f55c8[_0xacda('0x2d')]['filter']){_0x1aeed6[_0xacda('0x37')]=_[_0xacda('0x39')](_0x1aeed6[_0xacda('0x37')],{'$or':_[_0xacda('0x28')](_0x593696,function(_0x37b286){if(_0x37b286[_0xacda('0x3a')]!==_0xacda('0x3b')){var _0xa268bc={};_0xa268bc[_0x37b286[_0xacda('0x25')]]={'$like':'%'+_0x3f55c8[_0xacda('0x2d')]['filter']+'%'};return _0xa268bc;}})});}_0x1aeed6=_['merge']({},_0x1aeed6,_0x3f55c8[_0xacda('0x3c')]);var _0x3d8785={'where':_0x1aeed6[_0xacda('0x37')]};return db[_0xacda('0x29')][_0xacda('0x1d')](_0x3d8785)[_0xacda('0x21')](function(_0x56b873){_0x133376[_0xacda('0x1d')]=_0x56b873;if(_0x3f55c8[_0xacda('0x2d')][_0xacda('0x3d')]){_0x1aeed6[_0xacda('0x3e')]=[{'all':!![]}];}return db['ServicenowField'][_0xacda('0x3f')](_0x1aeed6);})[_0xacda('0x21')](function(_0x539641){_0x133376[_0xacda('0x40')]=_0x539641;return _0x133376;})['then'](respondWithFilteredResult(_0xefb0c2,_0x1aeed6))[_0xacda('0x41')](handleError(_0xefb0c2,null));};exports[_0xacda('0x42')]=function(_0x3ef40d,_0x170f54){var _0x2d2733={'raw':!![],'where':{'id':_0x3ef40d[_0xacda('0x43')]['id']}},_0x5c1da1={};_0x5c1da1[_0xacda('0x2c')]=_[_0xacda('0x2e')](db['ServicenowField']['rawAttributes']);_0x5c1da1[_0xacda('0x2d')]=_['keys'](_0x3ef40d[_0xacda('0x2d')]);_0x5c1da1[_0xacda('0x2f')]=_[_0xacda('0x30')](_0x5c1da1[_0xacda('0x2c')],_0x5c1da1['query']);_0x2d2733[_0xacda('0x31')]=_[_0xacda('0x30')](_0x5c1da1[_0xacda('0x2c')],qs[_0xacda('0x32')](_0x3ef40d[_0xacda('0x2d')][_0xacda('0x32')]));_0x2d2733[_0xacda('0x31')]=_0x2d2733[_0xacda('0x31')][_0xacda('0x33')]?_0x2d2733[_0xacda('0x31')]:_0x5c1da1[_0xacda('0x2c')];if(_0x3ef40d[_0xacda('0x2d')][_0xacda('0x3d')]){_0x2d2733[_0xacda('0x3e')]=[{'all':!![]}];}_0x2d2733=_['merge']({},_0x2d2733,_0x3ef40d[_0xacda('0x3c')]);return db['ServicenowField']['find'](_0x2d2733)[_0xacda('0x21')](handleEntityNotFound(_0x170f54,null))[_0xacda('0x21')](respondWithResult(_0x170f54,null))[_0xacda('0x41')](handleError(_0x170f54,null));};exports['create']=function(_0x27d75b,_0x4d324d){return db[_0xacda('0x29')]['create'](_0x27d75b[_0xacda('0x44')],{})[_0xacda('0x21')](respondWithResult(_0x4d324d,0xc9))[_0xacda('0x41')](handleError(_0x4d324d,null));};exports['update']=function(_0x1d0f9b,_0x5e9989){if(_0x1d0f9b[_0xacda('0x44')]['id']){delete _0x1d0f9b[_0xacda('0x44')]['id'];}return db[_0xacda('0x29')][_0xacda('0x45')]({'where':{'id':_0x1d0f9b[_0xacda('0x43')]['id']}})[_0xacda('0x21')](handleEntityNotFound(_0x5e9989,null))[_0xacda('0x21')](saveUpdates(_0x1d0f9b[_0xacda('0x44')],null))[_0xacda('0x21')](respondWithResult(_0x5e9989,null))[_0xacda('0x41')](handleError(_0x5e9989,null));};exports[_0xacda('0x22')]=function(_0x13e3d2,_0x5e86f8){return db[_0xacda('0x29')][_0xacda('0x45')]({'where':{'id':_0x13e3d2[_0xacda('0x43')]['id']}})['then'](handleEntityNotFound(_0x5e86f8,null))[_0xacda('0x21')](removeEntity(_0x5e86f8,null))[_0xacda('0x41')](handleError(_0x5e86f8,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index e113c8b..ff475f6 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 _0xfc89=['moment','bluebird','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index','util','api'];(function(_0x56d216,_0x8a4b80){var _0x2275e3=function(_0x410268){while(--_0x410268){_0x56d216['push'](_0x56d216['shift']());}};_0x2275e3(++_0x8a4b80);}(_0xfc89,0x1c6));var _0x9fc8=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xfc89[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x9fc8('0x0'));var logger=require('../../config/logger')(_0x9fc8('0x1'));var moment=require(_0x9fc8('0x2'));var BPromise=require(_0x9fc8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9fc8('0x4'));var rimraf=require(_0x9fc8('0x5'));var config=require(_0x9fc8('0x6'));var attributes=require(_0x9fc8('0x7'));module[_0x9fc8('0x8')]=function(_0x2c76f5,_0x4562b0){return _0x2c76f5['define'](_0x9fc8('0x9'),attributes,{'tableName':_0x9fc8('0xa'),'paranoid':![],'indexes':[{'name':_0x9fc8('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc303=['request-promise','path','rimraf','../../config/environment','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','util','api','moment','bluebird'];(function(_0x577077,_0x52f056){var _0x370769=function(_0x34d109){while(--_0x34d109){_0x577077['push'](_0x577077['shift']());}};_0x370769(++_0x52f056);}(_0xc303,0x1cd));var _0x3c30=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0xc303[_0x5416db];return _0x243e35;};'use strict';var _=require('lodash');var util=require(_0x3c30('0x0'));var logger=require('../../config/logger')(_0x3c30('0x1'));var moment=require(_0x3c30('0x2'));var BPromise=require(_0x3c30('0x3'));var rp=require(_0x3c30('0x4'));var fs=require('fs');var path=require(_0x3c30('0x5'));var rimraf=require(_0x3c30('0x6'));var config=require(_0x3c30('0x7'));var attributes=require('./intServicenowField.attributes');module[_0x3c30('0x8')]=function(_0x5dda58,_0x4f32e2){return _0x5dda58[_0x3c30('0x9')](_0x3c30('0xa'),attributes,{'tableName':_0x3c30('0xb'),'paranoid':![],'indexes':[{'name':_0x3c30('0xc'),'fields':[_0x3c30('0xd'),_0x3c30('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 8f11369..ef4b24c 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 _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x53a0ce,_0x5eaa86){var _0x491112=function(_0xb4b450){while(--_0xb4b450){_0x53a0ce['push'](_0x53a0ce['shift']());}};_0x491112(++_0x5eaa86);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2879ae,_0x36aab4){_0x2879ae=_0x2879ae-0x0;var _0x2e79df=_0xf4eb[_0x2879ae];return _0x2e79df;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0xac4a=['ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xac4a,0x13f));var _0xaac4=function(_0x14d107,_0x3b15a8){_0x14d107=_0x14d107-0x0;var _0x512f0e=_0xac4a[_0x14d107];return _0x512f0e;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 1e2d24f..00dd1e9 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 _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(_0x105a8a,_0x15a3a2){var _0x105a0e=function(_0x3beeb1){while(--_0x3beeb1){_0x105a8a['push'](_0x105a8a['shift']());}};_0x105a0e(++_0x15a3a2);}(_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 +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(_0x3b55c4,_0x2ceb45){var _0x2b9c51=function(_0x670a96){while(--_0x670a96){_0x3b55c4['push'](_0x3b55c4['shift']());}};_0x2b9c51(++_0x2ceb45);}(_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 diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 181a7be..6d7217e 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(_0x5af41d,_0x544603){var _0x57309d=function(_0x21a119){while(--_0x21a119){_0x5af41d['push'](_0x5af41d['shift']());}};_0x57309d(++_0x544603);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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(_0x4f041a,_0xf43df9){var _0x521405=function(_0x30216f){while(--_0x30216f){_0x4f041a['push'](_0x4f041a['shift']());}};_0x521405(++_0xf43df9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 984040b..c0bb244 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 _0xe489=['date_start','duration_hours','duration_minutes','parent_id','direction','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','login','JSON','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','Calls','module_fields','remove','includes','label','endsWith','values','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','SugarcrmAccount','rawAttributes','fieldName','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','type','filter','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','SugarcrmConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','description'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe489,0x9e));var _0x9e48=function(_0x5ac332,_0x3ff8f8){_0x5ac332=_0x5ac332-0x0;var _0x4ebfa9=_0xe489[_0x5ac332];return _0x4ebfa9;};'use strict';var emlformat=require(_0x9e48('0x0'));var rimraf=require(_0x9e48('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9e48('0x2'));var rp=require(_0x9e48('0x3'));var moment=require(_0x9e48('0x4'));var BPromise=require(_0x9e48('0x5'));var Mustache=require(_0x9e48('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9e48('0x7'));var csv=require('to-csv');var ejs=require(_0x9e48('0x8'));var fs=require('fs');var fs_extra=require(_0x9e48('0x9'));var _=require(_0x9e48('0xa'));var squel=require(_0x9e48('0xb'));var crypto=require('crypto');var jsforce=require(_0x9e48('0xc'));var deskjs=require(_0x9e48('0xd'));var toCsv=require(_0x9e48('0xe'));var querystring=require(_0x9e48('0xf'));var Papa=require(_0x9e48('0x10'));var Redis=require('ioredis');var authService=require(_0x9e48('0x11'));var qs=require(_0x9e48('0x12'));var as=require(_0x9e48('0x13'));var hardwareService=require(_0x9e48('0x14'));var logger=require('../../config/logger')(_0x9e48('0x15'));var utils=require(_0x9e48('0x16'));var config=require(_0x9e48('0x17'));var licenseUtil=require(_0x9e48('0x18'));var db=require(_0x9e48('0x19'))['db'];var integrations=require(_0x9e48('0x1a'));function respondWithStatusCode(_0x1527de,_0xa94def){_0xa94def=_0xa94def||0xcc;return function(_0x438ff5){if(_0x438ff5){return _0x1527de['sendStatus'](_0xa94def);}return _0x1527de['status'](_0xa94def)[_0x9e48('0x1b')]();};}function respondWithResult(_0x4613d0,_0x52bdba){_0x52bdba=_0x52bdba||0xc8;return function(_0x5eb2c7){if(_0x5eb2c7){return _0x4613d0[_0x9e48('0x1c')](_0x52bdba)['json'](_0x5eb2c7);}};}function respondWithFilteredResult(_0x260121,_0x5ac1ef){return function(_0x346e50){if(_0x346e50){var _0x4239b2=typeof _0x5ac1ef[_0x9e48('0x1d')]===_0x9e48('0x1e')&&typeof _0x5ac1ef['limit']===_0x9e48('0x1e');var _0x3f333d=_0x346e50['count'];var _0x12c133=_0x4239b2?0x0:_0x5ac1ef[_0x9e48('0x1d')];var _0x18a632=_0x4239b2?_0x346e50['count']:_0x5ac1ef['offset']+_0x5ac1ef[_0x9e48('0x1f')];var _0x462d4d;if(_0x18a632>=_0x3f333d){_0x18a632=_0x3f333d;_0x462d4d=0xc8;}else{_0x462d4d=0xce;}_0x260121[_0x9e48('0x1c')](_0x462d4d);return _0x260121['set'](_0x9e48('0x20'),_0x12c133+'-'+_0x18a632+'/'+_0x3f333d)['json'](_0x346e50);}return null;};}function patchUpdates(_0x4eae65){return function(_0x1d7436){try{jsonpatch[_0x9e48('0x21')](_0x1d7436,_0x4eae65,!![]);}catch(_0x134ddc){return BPromise[_0x9e48('0x22')](_0x134ddc);}return _0x1d7436[_0x9e48('0x23')]();};}function saveUpdates(_0x572a63,_0x1a8eca){return function(_0x42ceab){if(_0x42ceab){return _0x42ceab[_0x9e48('0x24')](_0x572a63)[_0x9e48('0x25')](function(_0x43e733){return _0x43e733;});}return null;};}function removeEntity(_0x58c54d,_0x4a22d7){return function(_0x1060bc){if(_0x1060bc){return _0x1060bc[_0x9e48('0x26')]()[_0x9e48('0x25')](function(){_0x58c54d[_0x9e48('0x1c')](0xcc)[_0x9e48('0x1b')]();});}};}function handleEntityNotFound(_0x5733d4,_0x2ce08c){return function(_0x5f199a){if(!_0x5f199a){_0x5733d4[_0x9e48('0x27')](0x194);}return _0x5f199a;};}function handleError(_0x32e3c5,_0x164f3a){_0x164f3a=_0x164f3a||0x1f4;return function(_0xe0a0b8){logger['error'](_0xe0a0b8[_0x9e48('0x28')]);if(_0xe0a0b8[_0x9e48('0x29')]){delete _0xe0a0b8[_0x9e48('0x29')];}_0x32e3c5[_0x9e48('0x1c')](_0x164f3a)[_0x9e48('0x2a')](_0xe0a0b8);};}exports[_0x9e48('0x2b')]=function(_0x3857b8,_0x2ffde1){var _0x41cafc={},_0xa7d768={},_0x20d224={'count':0x0,'rows':[]};var _0x32957a=_['map'](db[_0x9e48('0x2c')][_0x9e48('0x2d')],function(_0x3e2351){return{'name':_0x3e2351[_0x9e48('0x2e')],'type':_0x3e2351['type']['key']};});_0xa7d768[_0x9e48('0x2f')]=_[_0x9e48('0x30')](_0x32957a,_0x9e48('0x29'));_0xa7d768[_0x9e48('0x31')]=_[_0x9e48('0x32')](_0x3857b8[_0x9e48('0x31')]);_0xa7d768['filters']=_[_0x9e48('0x33')](_0xa7d768[_0x9e48('0x2f')],_0xa7d768[_0x9e48('0x31')]);_0x41cafc[_0x9e48('0x34')]=_[_0x9e48('0x33')](_0xa7d768[_0x9e48('0x2f')],qs[_0x9e48('0x35')](_0x3857b8['query'][_0x9e48('0x35')]));_0x41cafc[_0x9e48('0x34')]=_0x41cafc[_0x9e48('0x34')][_0x9e48('0x36')]?_0x41cafc['attributes']:_0xa7d768[_0x9e48('0x2f')];if(!_0x3857b8['query']['hasOwnProperty'](_0x9e48('0x37'))){_0x41cafc[_0x9e48('0x1f')]=qs['limit'](_0x3857b8[_0x9e48('0x31')][_0x9e48('0x1f')]);_0x41cafc[_0x9e48('0x1d')]=qs['offset'](_0x3857b8[_0x9e48('0x31')][_0x9e48('0x1d')]);}_0x41cafc[_0x9e48('0x38')]=qs[_0x9e48('0x39')](_0x3857b8['query'][_0x9e48('0x39')]);_0x41cafc[_0x9e48('0x3a')]=qs[_0x9e48('0x3b')](_[_0x9e48('0x3c')](_0x3857b8['query'],_0xa7d768[_0x9e48('0x3b')]),_0x32957a);if(_0x3857b8[_0x9e48('0x31')]['filter']){_0x41cafc['where']=_[_0x9e48('0x3d')](_0x41cafc[_0x9e48('0x3a')],{'$or':_['map'](_0x32957a,function(_0x474e06){if(_0x474e06[_0x9e48('0x3e')]!=='VIRTUAL'){var _0x5952d0={};_0x5952d0[_0x474e06[_0x9e48('0x29')]]={'$like':'%'+_0x3857b8[_0x9e48('0x31')][_0x9e48('0x3f')]+'%'};return _0x5952d0;}})});}_0x41cafc=_[_0x9e48('0x3d')]({},_0x41cafc,_0x3857b8[_0x9e48('0x40')]);var _0x56555b={'where':_0x41cafc[_0x9e48('0x3a')]};return db[_0x9e48('0x2c')][_0x9e48('0x41')](_0x56555b)[_0x9e48('0x25')](function(_0x592132){_0x20d224[_0x9e48('0x41')]=_0x592132;if(_0x3857b8[_0x9e48('0x31')][_0x9e48('0x42')]){_0x41cafc[_0x9e48('0x43')]=[{'all':!![]}];}return db[_0x9e48('0x2c')][_0x9e48('0x44')](_0x41cafc);})['then'](function(_0x8c6999){_0x20d224[_0x9e48('0x45')]=_0x8c6999;return _0x20d224;})['then'](respondWithFilteredResult(_0x2ffde1,_0x41cafc))[_0x9e48('0x46')](handleError(_0x2ffde1,null));};exports[_0x9e48('0x47')]=function(_0x56748a,_0x2a2bbc){var _0x4dcd69={'raw':![],'where':{'id':_0x56748a[_0x9e48('0x48')]['id']}},_0x2d426e={};_0x2d426e[_0x9e48('0x2f')]=_[_0x9e48('0x32')](db[_0x9e48('0x2c')][_0x9e48('0x2d')]);_0x2d426e[_0x9e48('0x31')]=_['keys'](_0x56748a['query']);_0x2d426e[_0x9e48('0x3b')]=_[_0x9e48('0x33')](_0x2d426e[_0x9e48('0x2f')],_0x2d426e['query']);_0x4dcd69[_0x9e48('0x34')]=_['intersection'](_0x2d426e[_0x9e48('0x2f')],qs[_0x9e48('0x35')](_0x56748a[_0x9e48('0x31')]['fields']));_0x4dcd69[_0x9e48('0x34')]=_0x4dcd69['attributes']['length']?_0x4dcd69[_0x9e48('0x34')]:_0x2d426e[_0x9e48('0x2f')];if(_0x56748a[_0x9e48('0x31')][_0x9e48('0x42')]){_0x4dcd69[_0x9e48('0x43')]=[{'all':!![]}];}_0x4dcd69=_[_0x9e48('0x3d')]({},_0x4dcd69,_0x56748a['options']);return db['SugarcrmAccount'][_0x9e48('0x49')](_0x4dcd69)['then'](handleEntityNotFound(_0x2a2bbc,null))[_0x9e48('0x25')](respondWithResult(_0x2a2bbc,null))[_0x9e48('0x46')](handleError(_0x2a2bbc,null));};exports['create']=function(_0x5682d8,_0x2f13f0){return db['SugarcrmAccount'][_0x9e48('0x4a')](_0x5682d8[_0x9e48('0x4b')],{})[_0x9e48('0x25')](respondWithResult(_0x2f13f0,0xc9))[_0x9e48('0x46')](handleError(_0x2f13f0,null));};exports[_0x9e48('0x24')]=function(_0x24c92b,_0x4507cd){if(_0x24c92b[_0x9e48('0x4b')]['id']){delete _0x24c92b[_0x9e48('0x4b')]['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x24c92b[_0x9e48('0x48')]['id']}})[_0x9e48('0x25')](handleEntityNotFound(_0x4507cd,null))['then'](saveUpdates(_0x24c92b['body'],null))[_0x9e48('0x25')](respondWithResult(_0x4507cd,null))[_0x9e48('0x46')](handleError(_0x4507cd,null));};exports[_0x9e48('0x26')]=function(_0x5b85eb,_0x15ca72){return db[_0x9e48('0x2c')][_0x9e48('0x49')]({'where':{'id':_0x5b85eb[_0x9e48('0x48')]['id']}})[_0x9e48('0x25')](handleEntityNotFound(_0x15ca72,null))[_0x9e48('0x25')](removeEntity(_0x15ca72,null))['catch'](handleError(_0x15ca72,null));};exports['getConfigurations']=function(_0x282b7a,_0x571e52,_0x149cf3){var _0xb61180={};var _0x1789a6={};var _0x224859;var _0xf6a3f;return db['SugarcrmAccount'][_0x9e48('0x4c')]({'where':{'id':_0x282b7a['params']['id']}})[_0x9e48('0x25')](handleEntityNotFound(_0x571e52,null))[_0x9e48('0x25')](function(_0x5bd254){if(_0x5bd254){_0x224859=_0x5bd254;_0x1789a6[_0x9e48('0x2f')]=_['keys'](db[_0x9e48('0x4d')]['rawAttributes']);_0x1789a6[_0x9e48('0x31')]=_['keys'](_0x282b7a[_0x9e48('0x31')]);_0x1789a6[_0x9e48('0x3b')]=_[_0x9e48('0x33')](_0x1789a6[_0x9e48('0x2f')],_0x1789a6[_0x9e48('0x31')]);_0xb61180[_0x9e48('0x34')]=_[_0x9e48('0x33')](_0x1789a6[_0x9e48('0x2f')],qs[_0x9e48('0x35')](_0x282b7a['query']['fields']));_0xb61180[_0x9e48('0x34')]=_0xb61180[_0x9e48('0x34')][_0x9e48('0x36')]?_0xb61180[_0x9e48('0x34')]:_0x1789a6['model'];_0xb61180[_0x9e48('0x38')]=qs[_0x9e48('0x39')](_0x282b7a[_0x9e48('0x31')]['sort']);_0xb61180[_0x9e48('0x3a')]=qs[_0x9e48('0x3b')](_[_0x9e48('0x3c')](_0x282b7a[_0x9e48('0x31')],_0x1789a6['filters']));if(_0x282b7a[_0x9e48('0x31')][_0x9e48('0x3f')]){_0xb61180[_0x9e48('0x3a')]=_[_0x9e48('0x3d')](_0xb61180['where'],{'$or':_[_0x9e48('0x30')](_0xb61180[_0x9e48('0x34')],function(_0x1be46d){var _0x27ebcf={};_0x27ebcf[_0x1be46d]={'$like':'%'+_0x282b7a[_0x9e48('0x31')]['filter']+'%'};return _0x27ebcf;})});}_0xb61180=_[_0x9e48('0x3d')]({},_0xb61180,_0x282b7a[_0x9e48('0x40')]);return _0x224859['getConfigurations'](_0xb61180);}})[_0x9e48('0x25')](function(_0x1f8430){if(_0x1f8430){_0xf6a3f=_0x1f8430[_0x9e48('0x36')];if(!_0x282b7a['query']['hasOwnProperty']('nolimit')){_0xb61180['limit']=qs[_0x9e48('0x1f')](_0x282b7a['query'][_0x9e48('0x1f')]);_0xb61180[_0x9e48('0x1d')]=qs[_0x9e48('0x1d')](_0x282b7a[_0x9e48('0x31')][_0x9e48('0x1d')]);}return _0x224859['getConfigurations'](_0xb61180);}})[_0x9e48('0x25')](function(_0x319a8b){if(_0x319a8b){return _0x319a8b?{'count':_0xf6a3f,'rows':_0x319a8b}:null;}})[_0x9e48('0x25')](respondWithResult(_0x571e52,null))['catch'](handleError(_0x571e52,null));};exports[_0x9e48('0x4e')]=function(_0x3bcdd7,_0x1dc9e5,_0x44b1e4){if(_0x3bcdd7[_0x9e48('0x4b')]['id']){delete _0x3bcdd7[_0x9e48('0x4b')]['id'];}return db[_0x9e48('0x2c')][_0x9e48('0x4c')]({'where':{'id':_0x3bcdd7['params']['id']}})[_0x9e48('0x25')](handleEntityNotFound(_0x1dc9e5,null))[_0x9e48('0x25')](function(_0x58ac1d){if(_0x58ac1d){_0x3bcdd7['body']['AccountId']=_0x58ac1d['id'];_0x3bcdd7['body'][_0x9e48('0x4f')]=integrations[_0x9e48('0x50')](_0x3bcdd7[_0x9e48('0x4b')][_0x9e48('0x51')],_0x3bcdd7[_0x9e48('0x4b')][_0x9e48('0x3e')]);_0x3bcdd7[_0x9e48('0x4b')][_0x9e48('0x52')]=integrations[_0x9e48('0x53')](_0x3bcdd7[_0x9e48('0x4b')]['channel'],_0x3bcdd7['body'][_0x9e48('0x3e')]);return db[_0x9e48('0x4d')]['create'](_0x3bcdd7[_0x9e48('0x4b')],{'include':[{'model':db[_0x9e48('0x54')],'as':'Subjects'},{'model':db[_0x9e48('0x54')],'as':_0x9e48('0x52')}]});}return null;})[_0x9e48('0x25')](respondWithResult(_0x1dc9e5,null))[_0x9e48('0x46')](handleError(_0x1dc9e5,null));};exports[_0x9e48('0x55')]=function(_0x20ac0c,_0x2e6416,_0x40dccc){var _0x1da04c='';var _0x569124=['id','name',_0x9e48('0x56'),'created_by',_0x9e48('0x57'),_0x9e48('0x58'),_0x9e48('0x59'),_0x9e48('0x5a'),_0x9e48('0x5b'),'parent_type','parent_name',_0x9e48('0x5c')];return db['SugarcrmAccount'][_0x9e48('0x4c')]({'where':{'id':_0x20ac0c[_0x9e48('0x48')]['id']},'attributes':['id','username',_0x9e48('0x5d'),_0x9e48('0x5e')]})[_0x9e48('0x25')](handleEntityNotFound(_0x2e6416,null))['then'](function(_0x5c646e){if(_0x5c646e){_0x1da04c=_0x5c646e['remoteUri'];var _0x4efa4c=_0x1da04c[_0x9e48('0x5f')](-0x1);if(_0x4efa4c==='/'){_0x1da04c=_0x1da04c[_0x9e48('0x60')](0x0,_0x1da04c[_0x9e48('0x61')](_0x4efa4c));}return rp({'method':_0x9e48('0x62'),'uri':util[_0x9e48('0x63')](_0x9e48('0x64'),_0x1da04c,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x9e48('0x65'),'input_type':_0x9e48('0x66'),'response_type':_0x9e48('0x66'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5c646e[_0x9e48('0x67')],'password':_0x5c646e[_0x9e48('0x5d')],'encryption':_0x9e48('0x68')},'application':_0x9e48('0x69')})}});}})[_0x9e48('0x25')](function(_0x5aeb84){if(_0x5aeb84&&_0x5aeb84['name']!==_0x9e48('0x6a')&&_0x5aeb84[_0x9e48('0x29')]!==_0x9e48('0x6b')){return rp({'method':'POST','uri':util[_0x9e48('0x63')]('%s%s',_0x1da04c,_0x9e48('0x6c')),'json':!![],'form':{'method':_0x9e48('0x6d'),'input_type':_0x9e48('0x66'),'response_type':_0x9e48('0x66'),'rest_data':JSON['stringify']({'session':_0x5aeb84['id'],'module_name':_0x9e48('0x6e')})}})[_0x9e48('0x25')](function(_0x26f302){if(_0x26f302){var _0x309789=_['values'](_0x26f302[_0x9e48('0x6f')]);_[_0x9e48('0x70')](_0x309789,function(_0x175808){return _0x569124[_0x9e48('0x71')](_0x175808[_0x9e48('0x29')]);});return{'count':_0x309789[_0x9e48('0x36')],'rows':_[_0x9e48('0x30')](_0x309789,function(_0x161c17){return{'id':_0x161c17[_0x9e48('0x29')],'name':_0x161c17[_0x9e48('0x72')],'custom':_[_0x9e48('0x73')](_0x161c17[_0x9e48('0x29')],'_c')?!![]:![],'options':_0x161c17[_0x9e48('0x40')]?_['map'](_[_0x9e48('0x74')](_0x161c17[_0x9e48('0x40')]),function(_0x3d35ee){return{'name':_0x3d35ee['value'],'value':_0x3d35ee[_0x9e48('0x29')]};}):[]};})};}})[_0x9e48('0x25')](respondWithResult(_0x2e6416,null))[_0x9e48('0x46')](function(_0x4decee){var _0x367fbb=_0x20ac0c[_0x9e48('0x31')][_0x9e48('0x75')]?0x1f4:_0x4decee[_0x9e48('0x76')]||0x1f4;logger[_0x9e48('0x77')](_0x9e48('0x78'),_0x9e48('0x55'),_0x367fbb,JSON[_0x9e48('0x79')](_0x4decee));delete _0x4decee[_0x9e48('0x29')];if(_0x367fbb===0x191){_0x367fbb=0x190;}_0x2e6416[_0x9e48('0x1c')](_0x367fbb)[_0x9e48('0x2a')](_0x20ac0c['query'][_0x9e48('0x75')]?{'message':'Wrong\x20credentials','statusCode':_0x4decee['statusCode']}:_0x4decee);});}else{var _0x5969c8=0x1f4;_0x2e6416[_0x9e48('0x1c')](_0x5969c8)[_0x9e48('0x2a')]({'message':_0x9e48('0x7a'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xde0f=['query','attributes','length','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','catch','show','params','keys','fields','create','body','find','getConfigurations','findOne','SugarcrmConfiguration','order','hasOwnProperty','nolimit','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','Subjects','getFields','assigned_user_id','created_by','description','date_start','parent_id','parent_name','direction','username','remoteUri','substring','POST','%s%s','login','JSON','stringify','password','PLAIN','Invalid\x20Login','format','/service/v4_1/rest.php','get_module_fields','values','module_fields','remove','includes','label','endsWith','value','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','test','eml-format','fast-json-patch','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','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','stack','name','index','SugarcrmAccount','rawAttributes','fieldName','type','model','map','filters','intersection'];(function(_0x45f45d,_0x2f2893){var _0x2ea58d=function(_0x36c7d2){while(--_0x36c7d2){_0x45f45d['push'](_0x45f45d['shift']());}};_0x2ea58d(++_0x2f2893);}(_0xde0f,0x1ab));var _0xfde0=function(_0xae277d,_0xc1a1f4){_0xae277d=_0xae277d-0x0;var _0x39381b=_0xde0f[_0xae277d];return _0x39381b;};'use strict';var emlformat=require(_0xfde0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfde0('0x1'));var rp=require('request-promise');var moment=require(_0xfde0('0x2'));var BPromise=require(_0xfde0('0x3'));var Mustache=require(_0xfde0('0x4'));var util=require('util');var path=require(_0xfde0('0x5'));var sox=require(_0xfde0('0x6'));var csv=require(_0xfde0('0x7'));var ejs=require(_0xfde0('0x8'));var fs=require('fs');var fs_extra=require(_0xfde0('0x9'));var _=require(_0xfde0('0xa'));var squel=require(_0xfde0('0xb'));var crypto=require(_0xfde0('0xc'));var jsforce=require(_0xfde0('0xd'));var deskjs=require(_0xfde0('0xe'));var toCsv=require(_0xfde0('0x7'));var querystring=require(_0xfde0('0xf'));var Papa=require(_0xfde0('0x10'));var Redis=require(_0xfde0('0x11'));var authService=require(_0xfde0('0x12'));var qs=require(_0xfde0('0x13'));var as=require(_0xfde0('0x14'));var hardwareService=require(_0xfde0('0x15'));var logger=require(_0xfde0('0x16'))('api');var utils=require(_0xfde0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xfde0('0x18'));var db=require(_0xfde0('0x19'))['db'];var integrations=require(_0xfde0('0x1a'));function respondWithStatusCode(_0x35237e,_0x28b312){_0x28b312=_0x28b312||0xcc;return function(_0x1e0c8e){if(_0x1e0c8e){return _0x35237e[_0xfde0('0x1b')](_0x28b312);}return _0x35237e['status'](_0x28b312)[_0xfde0('0x1c')]();};}function respondWithResult(_0x1a5ab9,_0x23e16c){_0x23e16c=_0x23e16c||0xc8;return function(_0x149be6){if(_0x149be6){return _0x1a5ab9['status'](_0x23e16c)[_0xfde0('0x1d')](_0x149be6);}};}function respondWithFilteredResult(_0x45661f,_0x2396fb){return function(_0x1f2619){if(_0x1f2619){var _0x2ea1f2=typeof _0x2396fb[_0xfde0('0x1e')]===_0xfde0('0x1f')&&typeof _0x2396fb[_0xfde0('0x20')]===_0xfde0('0x1f');var _0x14cc3c=_0x1f2619[_0xfde0('0x21')];var _0x6509ad=_0x2ea1f2?0x0:_0x2396fb[_0xfde0('0x1e')];var _0x57ada6=_0x2ea1f2?_0x1f2619[_0xfde0('0x21')]:_0x2396fb[_0xfde0('0x1e')]+_0x2396fb[_0xfde0('0x20')];var _0x4edac8;if(_0x57ada6>=_0x14cc3c){_0x57ada6=_0x14cc3c;_0x4edac8=0xc8;}else{_0x4edac8=0xce;}_0x45661f[_0xfde0('0x22')](_0x4edac8);return _0x45661f[_0xfde0('0x23')]('Content-Range',_0x6509ad+'-'+_0x57ada6+'/'+_0x14cc3c)[_0xfde0('0x1d')](_0x1f2619);}return null;};}function patchUpdates(_0x37b307){return function(_0x2200cc){try{jsonpatch[_0xfde0('0x24')](_0x2200cc,_0x37b307,!![]);}catch(_0x10b8d9){return BPromise[_0xfde0('0x25')](_0x10b8d9);}return _0x2200cc[_0xfde0('0x26')]();};}function saveUpdates(_0x4ccf42,_0x45e629){return function(_0x109dff){if(_0x109dff){return _0x109dff[_0xfde0('0x27')](_0x4ccf42)[_0xfde0('0x28')](function(_0x3b1dd7){return _0x3b1dd7;});}return null;};}function removeEntity(_0x19e5a0,_0x481d40){return function(_0x1da73f){if(_0x1da73f){return _0x1da73f[_0xfde0('0x29')]()[_0xfde0('0x28')](function(){_0x19e5a0[_0xfde0('0x22')](0xcc)[_0xfde0('0x1c')]();});}};}function handleEntityNotFound(_0x35fa36,_0x6906f2){return function(_0x303c23){if(!_0x303c23){_0x35fa36[_0xfde0('0x1b')](0x194);}return _0x303c23;};}function handleError(_0x40fdf5,_0x5ed9d8){_0x5ed9d8=_0x5ed9d8||0x1f4;return function(_0x2f5710){logger['error'](_0x2f5710[_0xfde0('0x2a')]);if(_0x2f5710[_0xfde0('0x2b')]){delete _0x2f5710[_0xfde0('0x2b')];}_0x40fdf5[_0xfde0('0x22')](_0x5ed9d8)['send'](_0x2f5710);};}exports[_0xfde0('0x2c')]=function(_0x2d4d1f,_0x911d11){var _0x3f683d={},_0x44f338={},_0x383a84={'count':0x0,'rows':[]};var _0x285933=_['map'](db[_0xfde0('0x2d')][_0xfde0('0x2e')],function(_0x219c11){return{'name':_0x219c11[_0xfde0('0x2f')],'type':_0x219c11[_0xfde0('0x30')]['key']};});_0x44f338[_0xfde0('0x31')]=_[_0xfde0('0x32')](_0x285933,_0xfde0('0x2b'));_0x44f338['query']=_['keys'](_0x2d4d1f['query']);_0x44f338[_0xfde0('0x33')]=_[_0xfde0('0x34')](_0x44f338['model'],_0x44f338[_0xfde0('0x35')]);_0x3f683d[_0xfde0('0x36')]=_[_0xfde0('0x34')](_0x44f338[_0xfde0('0x31')],qs['fields'](_0x2d4d1f[_0xfde0('0x35')]['fields']));_0x3f683d['attributes']=_0x3f683d[_0xfde0('0x36')][_0xfde0('0x37')]?_0x3f683d[_0xfde0('0x36')]:_0x44f338[_0xfde0('0x31')];if(!_0x2d4d1f['query']['hasOwnProperty']('nolimit')){_0x3f683d[_0xfde0('0x20')]=qs[_0xfde0('0x20')](_0x2d4d1f[_0xfde0('0x35')][_0xfde0('0x20')]);_0x3f683d[_0xfde0('0x1e')]=qs[_0xfde0('0x1e')](_0x2d4d1f[_0xfde0('0x35')]['offset']);}_0x3f683d['order']=qs['sort'](_0x2d4d1f[_0xfde0('0x35')][_0xfde0('0x38')]);_0x3f683d['where']=qs[_0xfde0('0x33')](_[_0xfde0('0x39')](_0x2d4d1f['query'],_0x44f338[_0xfde0('0x33')]),_0x285933);if(_0x2d4d1f[_0xfde0('0x35')]['filter']){_0x3f683d[_0xfde0('0x3a')]=_[_0xfde0('0x3b')](_0x3f683d['where'],{'$or':_[_0xfde0('0x32')](_0x285933,function(_0x4f0916){if(_0x4f0916[_0xfde0('0x30')]!==_0xfde0('0x3c')){var _0x2e09ac={};_0x2e09ac[_0x4f0916[_0xfde0('0x2b')]]={'$like':'%'+_0x2d4d1f[_0xfde0('0x35')][_0xfde0('0x3d')]+'%'};return _0x2e09ac;}})});}_0x3f683d=_[_0xfde0('0x3b')]({},_0x3f683d,_0x2d4d1f[_0xfde0('0x3e')]);var _0x5b35ee={'where':_0x3f683d[_0xfde0('0x3a')]};return db[_0xfde0('0x2d')]['count'](_0x5b35ee)[_0xfde0('0x28')](function(_0x32bf92){_0x383a84[_0xfde0('0x21')]=_0x32bf92;if(_0x2d4d1f[_0xfde0('0x35')][_0xfde0('0x3f')]){_0x3f683d[_0xfde0('0x40')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x3f683d);})[_0xfde0('0x28')](function(_0x568b63){_0x383a84['rows']=_0x568b63;return _0x383a84;})[_0xfde0('0x28')](respondWithFilteredResult(_0x911d11,_0x3f683d))[_0xfde0('0x41')](handleError(_0x911d11,null));};exports[_0xfde0('0x42')]=function(_0x2f0afe,_0x2804ef){var _0x3e6178={'raw':![],'where':{'id':_0x2f0afe[_0xfde0('0x43')]['id']}},_0x2ce365={};_0x2ce365[_0xfde0('0x31')]=_[_0xfde0('0x44')](db['SugarcrmAccount']['rawAttributes']);_0x2ce365[_0xfde0('0x35')]=_[_0xfde0('0x44')](_0x2f0afe[_0xfde0('0x35')]);_0x2ce365[_0xfde0('0x33')]=_[_0xfde0('0x34')](_0x2ce365[_0xfde0('0x31')],_0x2ce365['query']);_0x3e6178[_0xfde0('0x36')]=_[_0xfde0('0x34')](_0x2ce365[_0xfde0('0x31')],qs[_0xfde0('0x45')](_0x2f0afe[_0xfde0('0x35')][_0xfde0('0x45')]));_0x3e6178[_0xfde0('0x36')]=_0x3e6178[_0xfde0('0x36')][_0xfde0('0x37')]?_0x3e6178['attributes']:_0x2ce365['model'];if(_0x2f0afe['query']['includeAll']){_0x3e6178['include']=[{'all':!![]}];}_0x3e6178=_[_0xfde0('0x3b')]({},_0x3e6178,_0x2f0afe[_0xfde0('0x3e')]);return db['SugarcrmAccount']['find'](_0x3e6178)[_0xfde0('0x28')](handleEntityNotFound(_0x2804ef,null))[_0xfde0('0x28')](respondWithResult(_0x2804ef,null))[_0xfde0('0x41')](handleError(_0x2804ef,null));};exports[_0xfde0('0x46')]=function(_0x1652a7,_0x5c9fe0){return db[_0xfde0('0x2d')]['create'](_0x1652a7[_0xfde0('0x47')],{})[_0xfde0('0x28')](respondWithResult(_0x5c9fe0,0xc9))[_0xfde0('0x41')](handleError(_0x5c9fe0,null));};exports[_0xfde0('0x27')]=function(_0x3c3168,_0x3f7a31){if(_0x3c3168[_0xfde0('0x47')]['id']){delete _0x3c3168[_0xfde0('0x47')]['id'];}return db[_0xfde0('0x2d')][_0xfde0('0x48')]({'where':{'id':_0x3c3168[_0xfde0('0x43')]['id']}})[_0xfde0('0x28')](handleEntityNotFound(_0x3f7a31,null))[_0xfde0('0x28')](saveUpdates(_0x3c3168[_0xfde0('0x47')],null))[_0xfde0('0x28')](respondWithResult(_0x3f7a31,null))[_0xfde0('0x41')](handleError(_0x3f7a31,null));};exports[_0xfde0('0x29')]=function(_0x34329a,_0x3edd9b){return db[_0xfde0('0x2d')][_0xfde0('0x48')]({'where':{'id':_0x34329a[_0xfde0('0x43')]['id']}})[_0xfde0('0x28')](handleEntityNotFound(_0x3edd9b,null))[_0xfde0('0x28')](removeEntity(_0x3edd9b,null))[_0xfde0('0x41')](handleError(_0x3edd9b,null));};exports[_0xfde0('0x49')]=function(_0x4d4535,_0x20c6c2,_0x3aecae){var _0x4ecf49={};var _0x41c395={};var _0x63c6bc;var _0x497509;return db[_0xfde0('0x2d')][_0xfde0('0x4a')]({'where':{'id':_0x4d4535[_0xfde0('0x43')]['id']}})[_0xfde0('0x28')](handleEntityNotFound(_0x20c6c2,null))[_0xfde0('0x28')](function(_0x170bb7){if(_0x170bb7){_0x63c6bc=_0x170bb7;_0x41c395[_0xfde0('0x31')]=_[_0xfde0('0x44')](db[_0xfde0('0x4b')][_0xfde0('0x2e')]);_0x41c395[_0xfde0('0x35')]=_[_0xfde0('0x44')](_0x4d4535[_0xfde0('0x35')]);_0x41c395['filters']=_[_0xfde0('0x34')](_0x41c395[_0xfde0('0x31')],_0x41c395[_0xfde0('0x35')]);_0x4ecf49[_0xfde0('0x36')]=_[_0xfde0('0x34')](_0x41c395['model'],qs['fields'](_0x4d4535[_0xfde0('0x35')][_0xfde0('0x45')]));_0x4ecf49['attributes']=_0x4ecf49[_0xfde0('0x36')][_0xfde0('0x37')]?_0x4ecf49[_0xfde0('0x36')]:_0x41c395[_0xfde0('0x31')];_0x4ecf49[_0xfde0('0x4c')]=qs[_0xfde0('0x38')](_0x4d4535[_0xfde0('0x35')][_0xfde0('0x38')]);_0x4ecf49[_0xfde0('0x3a')]=qs[_0xfde0('0x33')](_['pick'](_0x4d4535[_0xfde0('0x35')],_0x41c395['filters']));if(_0x4d4535['query'][_0xfde0('0x3d')]){_0x4ecf49[_0xfde0('0x3a')]=_['merge'](_0x4ecf49[_0xfde0('0x3a')],{'$or':_[_0xfde0('0x32')](_0x4ecf49[_0xfde0('0x36')],function(_0x1c2543){var _0x53a080={};_0x53a080[_0x1c2543]={'$like':'%'+_0x4d4535[_0xfde0('0x35')][_0xfde0('0x3d')]+'%'};return _0x53a080;})});}_0x4ecf49=_['merge']({},_0x4ecf49,_0x4d4535[_0xfde0('0x3e')]);return _0x63c6bc[_0xfde0('0x49')](_0x4ecf49);}})[_0xfde0('0x28')](function(_0x144ef6){if(_0x144ef6){_0x497509=_0x144ef6[_0xfde0('0x37')];if(!_0x4d4535[_0xfde0('0x35')][_0xfde0('0x4d')](_0xfde0('0x4e'))){_0x4ecf49['limit']=qs['limit'](_0x4d4535[_0xfde0('0x35')]['limit']);_0x4ecf49[_0xfde0('0x1e')]=qs['offset'](_0x4d4535[_0xfde0('0x35')]['offset']);}return _0x63c6bc[_0xfde0('0x49')](_0x4ecf49);}})[_0xfde0('0x28')](function(_0x43c65c){if(_0x43c65c){return _0x43c65c?{'count':_0x497509,'rows':_0x43c65c}:null;}})['then'](respondWithResult(_0x20c6c2,null))[_0xfde0('0x41')](handleError(_0x20c6c2,null));};exports['addConfiguration']=function(_0x40a968,_0x1400f5,_0x3ec93d){if(_0x40a968[_0xfde0('0x47')]['id']){delete _0x40a968[_0xfde0('0x47')]['id'];}return db[_0xfde0('0x2d')][_0xfde0('0x4a')]({'where':{'id':_0x40a968[_0xfde0('0x43')]['id']}})[_0xfde0('0x28')](handleEntityNotFound(_0x1400f5,null))[_0xfde0('0x28')](function(_0x45d60e){if(_0x45d60e){_0x40a968['body'][_0xfde0('0x4f')]=_0x45d60e['id'];_0x40a968[_0xfde0('0x47')]['Subjects']=integrations[_0xfde0('0x50')](_0x40a968[_0xfde0('0x47')][_0xfde0('0x51')],_0x40a968[_0xfde0('0x47')][_0xfde0('0x30')]);_0x40a968[_0xfde0('0x47')][_0xfde0('0x52')]=integrations[_0xfde0('0x53')](_0x40a968[_0xfde0('0x47')][_0xfde0('0x51')],_0x40a968[_0xfde0('0x47')]['type']);return db['SugarcrmConfiguration'][_0xfde0('0x46')](_0x40a968['body'],{'include':[{'model':db[_0xfde0('0x54')],'as':_0xfde0('0x55')},{'model':db[_0xfde0('0x54')],'as':_0xfde0('0x52')}]});}return null;})['then'](respondWithResult(_0x1400f5,null))[_0xfde0('0x41')](handleError(_0x1400f5,null));};exports[_0xfde0('0x56')]=function(_0x44f155,_0x3c9d28,_0x50b126){var _0x597d13='';var _0x3d75e8=['id',_0xfde0('0x2b'),_0xfde0('0x57'),_0xfde0('0x58'),_0xfde0('0x59'),_0xfde0('0x5a'),'duration_hours','duration_minutes',_0xfde0('0x5b'),'parent_type',_0xfde0('0x5c'),_0xfde0('0x5d')];return db[_0xfde0('0x2d')]['findOne']({'where':{'id':_0x44f155[_0xfde0('0x43')]['id']},'attributes':['id',_0xfde0('0x5e'),'password','remoteUri']})[_0xfde0('0x28')](handleEntityNotFound(_0x3c9d28,null))[_0xfde0('0x28')](function(_0x449397){if(_0x449397){_0x597d13=_0x449397[_0xfde0('0x5f')];var _0x3ec99b=_0x597d13['slice'](-0x1);if(_0x3ec99b==='/'){_0x597d13=_0x597d13[_0xfde0('0x60')](0x0,_0x597d13['lastIndexOf'](_0x3ec99b));}return rp({'method':_0xfde0('0x61'),'uri':util['format'](_0xfde0('0x62'),_0x597d13,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xfde0('0x63'),'input_type':_0xfde0('0x64'),'response_type':_0xfde0('0x64'),'rest_data':JSON[_0xfde0('0x65')]({'user_auth':{'user_name':_0x449397[_0xfde0('0x5e')],'password':_0x449397[_0xfde0('0x66')],'encryption':_0xfde0('0x67')},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x15c343){if(_0x15c343&&_0x15c343[_0xfde0('0x2b')]!==_0xfde0('0x68')&&_0x15c343[_0xfde0('0x2b')]!=='Password\x20Expired'){return rp({'method':_0xfde0('0x61'),'uri':util[_0xfde0('0x69')](_0xfde0('0x62'),_0x597d13,_0xfde0('0x6a')),'json':!![],'form':{'method':_0xfde0('0x6b'),'input_type':_0xfde0('0x64'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x15c343['id'],'module_name':'Calls'})}})[_0xfde0('0x28')](function(_0x2cbf7b){if(_0x2cbf7b){var _0x2a0e57=_[_0xfde0('0x6c')](_0x2cbf7b[_0xfde0('0x6d')]);_[_0xfde0('0x6e')](_0x2a0e57,function(_0x15260e){return _0x3d75e8[_0xfde0('0x6f')](_0x15260e[_0xfde0('0x2b')]);});return{'count':_0x2a0e57['length'],'rows':_[_0xfde0('0x32')](_0x2a0e57,function(_0x30f0d3){return{'id':_0x30f0d3[_0xfde0('0x2b')],'name':_0x30f0d3[_0xfde0('0x70')],'custom':_[_0xfde0('0x71')](_0x30f0d3[_0xfde0('0x2b')],'_c')?!![]:![],'options':_0x30f0d3[_0xfde0('0x3e')]?_[_0xfde0('0x32')](_[_0xfde0('0x6c')](_0x30f0d3[_0xfde0('0x3e')]),function(_0x3c239e){return{'name':_0x3c239e[_0xfde0('0x72')],'value':_0x3c239e[_0xfde0('0x2b')]};}):[]};})};}})[_0xfde0('0x28')](respondWithResult(_0x3c9d28,null))['catch'](function(_0x5a704f){var _0x1163b6=_0x44f155['query']['test']?0x1f4:_0x5a704f[_0xfde0('0x73')]||0x1f4;logger[_0xfde0('0x74')](_0xfde0('0x75'),_0xfde0('0x56'),_0x1163b6,JSON[_0xfde0('0x65')](_0x5a704f));delete _0x5a704f[_0xfde0('0x2b')];if(_0x1163b6===0x191){_0x1163b6=0x190;}_0x3c9d28['status'](_0x1163b6)[_0xfde0('0x76')](_0x44f155['query'][_0xfde0('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x5a704f[_0xfde0('0x73')]}:_0x5a704f);});}else{var _0x48e42a=0x1f4;_0x3c9d28[_0xfde0('0x22')](_0x48e42a)[_0xfde0('0x76')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index 37d22b5..9732e16 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 _0xc8b4=['../../config/environment','./intSugarcrmAccount.attributes','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x283a09,_0xfc7d31){var _0x8dbb36=function(_0x35d5d0){while(--_0x35d5d0){_0x283a09['push'](_0x283a09['shift']());}};_0x8dbb36(++_0xfc7d31);}(_0xc8b4,0x13d));var _0x4c8b=function(_0x1e4443,_0x1b447b){_0x1e4443=_0x1e4443-0x0;var _0x4a7cd0=_0xc8b4[_0x1e4443];return _0x4a7cd0;};'use strict';var _=require(_0x4c8b('0x0'));var util=require(_0x4c8b('0x1'));var logger=require(_0x4c8b('0x2'))(_0x4c8b('0x3'));var moment=require(_0x4c8b('0x4'));var BPromise=require(_0x4c8b('0x5'));var rp=require(_0x4c8b('0x6'));var fs=require('fs');var path=require(_0x4c8b('0x7'));var rimraf=require('rimraf');var config=require(_0x4c8b('0x8'));var attributes=require(_0x4c8b('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x4c8b('0xa')]=function(_0x3e5d0a,_0x348e34){return _0x3e5d0a['define'](_0x4c8b('0xb'),attributes,{'tableName':_0x4c8b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9540=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util'];(function(_0x1e3b12,_0x3438b0){var _0x9fb495=function(_0x5bee10){while(--_0x5bee10){_0x1e3b12['push'](_0x1e3b12['shift']());}};_0x9fb495(++_0x3438b0);}(_0x9540,0xdb));var _0x0954=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9540[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0954('0x0'));var util=require(_0x0954('0x1'));var logger=require(_0x0954('0x2'))(_0x0954('0x3'));var moment=require('moment');var BPromise=require(_0x0954('0x4'));var rp=require(_0x0954('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0954('0x6'));var config=require(_0x0954('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x0954('0x8'));module[_0x0954('0x9')]=function(_0x5be3f7,_0x1970a5){return _0x5be3f7[_0x0954('0xa')](_0x0954('0xb'),attributes,{'tableName':_0x0954('0xc'),'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 45d3534..5cc2b11 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 _0xc3b4=['model','attributes','then','ShowSugarcrmAccount','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetSugarcrmAccount','SugarcrmAccount','options','raw','where','include','map'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0xc3b4,0x1cc));var _0x4c3b=function(_0x1273bb,_0x193a23){_0x1273bb=_0x1273bb-0x0;var _0x107662=_0xc3b4[_0x1273bb];return _0x107662;};'use strict';var _=require('lodash');var util=require(_0x4c3b('0x0'));var moment=require(_0x4c3b('0x1'));var BPromise=require(_0x4c3b('0x2'));var rs=require(_0x4c3b('0x3'));var fs=require('fs');var Redis=require(_0x4c3b('0x4'));var db=require(_0x4c3b('0x5'))['db'];var utils=require(_0x4c3b('0x6'));var logger=require(_0x4c3b('0x7'))(_0x4c3b('0x8'));var config=require(_0x4c3b('0x9'));var jayson=require(_0x4c3b('0xa'));var client=jayson[_0x4c3b('0xb')][_0x4c3b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b3b48,_0x4ea673,_0x16bc55){return new BPromise(function(_0x2719dc,_0x759fda){return client[_0x4c3b('0xd')](_0x1b3b48,_0x16bc55)['then'](function(_0x3bdfbf){logger[_0x4c3b('0xe')](_0x4c3b('0xf'),_0x4ea673,_0x4c3b('0x10'));logger[_0x4c3b('0x11')](_0x4c3b('0x12'),_0x4ea673,_0x4c3b('0x10'),JSON[_0x4c3b('0x13')](_0x3bdfbf));if(_0x3bdfbf[_0x4c3b('0x14')]){if(_0x3bdfbf['error'][_0x4c3b('0x15')]===0x1f4){logger[_0x4c3b('0x14')](_0x4c3b('0xf'),_0x4ea673,_0x3bdfbf[_0x4c3b('0x14')][_0x4c3b('0x16')]);return _0x759fda(_0x3bdfbf[_0x4c3b('0x14')][_0x4c3b('0x16')]);}logger[_0x4c3b('0x14')](_0x4c3b('0xf'),_0x4ea673,_0x3bdfbf[_0x4c3b('0x14')]['message']);return _0x2719dc(_0x3bdfbf[_0x4c3b('0x14')][_0x4c3b('0x16')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x4ea673,'request\x20sent');_0x2719dc(_0x3bdfbf['result'][_0x4c3b('0x16')]);}})['catch'](function(_0x21b275){logger[_0x4c3b('0x14')](_0x4c3b('0xf'),_0x4ea673,_0x21b275);_0x759fda(_0x21b275);});});}exports[_0x4c3b('0x17')]=function(_0x58e545){var _0x24b920=this;return new Promise(function(_0x49fc22,_0x1590ca){return db[_0x4c3b('0x18')]['findAll']({'raw':_0x58e545[_0x4c3b('0x19')]?_0x58e545[_0x4c3b('0x19')][_0x4c3b('0x1a')]===undefined?!![]:![]:!![],'where':_0x58e545['options']?_0x58e545['options'][_0x4c3b('0x1b')]||null:null,'attributes':_0x58e545['options']?_0x58e545[_0x4c3b('0x19')]['attributes']||null:null,'limit':_0x58e545['options']?_0x58e545[_0x4c3b('0x19')]['limit']||null:null,'include':_0x58e545[_0x4c3b('0x19')]?_0x58e545[_0x4c3b('0x19')][_0x4c3b('0x1c')]?_[_0x4c3b('0x1d')](_0x58e545[_0x4c3b('0x19')][_0x4c3b('0x1c')],function(_0x4c9670){return{'model':db[_0x4c9670[_0x4c3b('0x1e')]],'as':_0x4c9670['as'],'attributes':_0x4c9670[_0x4c3b('0x1f')],'include':_0x4c9670[_0x4c3b('0x1c')]?_[_0x4c3b('0x1d')](_0x4c9670[_0x4c3b('0x1c')],function(_0x425258){return{'model':db[_0x425258[_0x4c3b('0x1e')]],'as':_0x425258['as'],'attributes':_0x425258[_0x4c3b('0x1f')],'include':_0x425258['include']?_[_0x4c3b('0x1d')](_0x425258[_0x4c3b('0x1c')],function(_0x1d6389){return{'model':db[_0x1d6389[_0x4c3b('0x1e')]],'as':_0x1d6389['as'],'attributes':_0x1d6389[_0x4c3b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4c3b('0x20')](function(_0x18f150){logger[_0x4c3b('0xe')](_0x4c3b('0x17'),_0x58e545);logger['debug'](_0x4c3b('0x17'),_0x58e545,JSON[_0x4c3b('0x13')](_0x18f150));_0x49fc22(_0x18f150);})['catch'](function(_0x117856){logger[_0x4c3b('0x14')]('GetSugarcrmAccount',_0x117856[_0x4c3b('0x16')],_0x58e545);_0x1590ca(_0x24b920[_0x4c3b('0x14')](0x1f4,_0x117856['message']));});});};exports['ShowSugarcrmAccount']=function(_0x5f2388){var _0x3578f4=this;return new Promise(function(_0x1bed90,_0x96c75f){return db[_0x4c3b('0x18')]['find']({'raw':_0x5f2388[_0x4c3b('0x19')]?_0x5f2388[_0x4c3b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5f2388['options']?_0x5f2388['options'][_0x4c3b('0x1b')]||null:null,'attributes':_0x5f2388['options']?_0x5f2388[_0x4c3b('0x19')]['attributes']||null:null,'include':_0x5f2388[_0x4c3b('0x19')]?_0x5f2388['options'][_0x4c3b('0x1c')]?_[_0x4c3b('0x1d')](_0x5f2388[_0x4c3b('0x19')]['include'],function(_0x8be7ea){return{'model':db[_0x8be7ea[_0x4c3b('0x1e')]],'as':_0x8be7ea['as'],'attributes':_0x8be7ea[_0x4c3b('0x1f')],'include':_0x8be7ea['include']?_['map'](_0x8be7ea[_0x4c3b('0x1c')],function(_0x447e26){return{'model':db[_0x447e26[_0x4c3b('0x1e')]],'as':_0x447e26['as'],'attributes':_0x447e26[_0x4c3b('0x1f')],'include':_0x447e26[_0x4c3b('0x1c')]?_[_0x4c3b('0x1d')](_0x447e26['include'],function(_0xa51a8a){return{'model':db[_0xa51a8a['model']],'as':_0xa51a8a['as'],'attributes':_0xa51a8a[_0x4c3b('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2677c0){logger[_0x4c3b('0xe')](_0x4c3b('0x21'),_0x5f2388);logger[_0x4c3b('0x11')]('ShowSugarcrmAccount',_0x5f2388,JSON[_0x4c3b('0x13')](_0x2677c0));_0x1bed90(_0x2677c0);})[_0x4c3b('0x22')](function(_0xa2b0b4){logger[_0x4c3b('0x14')](_0x4c3b('0x21'),_0xa2b0b4[_0x4c3b('0x16')],_0x5f2388);_0x96c75f(_0x3578f4[_0x4c3b('0x14')](0x1f4,_0xa2b0b4[_0x4c3b('0x16')]));});});}; \ No newline at end of file +var _0xc32e=['SugarcrmAccount','options','limit','include','map','model','attributes','GetSugarcrmAccount','catch','ShowSugarcrmAccount','find','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc32e,0x9c));var _0xec32=function(_0x40aac0,_0x158e55){_0x40aac0=_0x40aac0-0x0;var _0x41e568=_0xc32e[_0x40aac0];return _0x41e568;};'use strict';var _=require(_0xec32('0x0'));var util=require(_0xec32('0x1'));var moment=require('moment');var BPromise=require(_0xec32('0x2'));var rs=require(_0xec32('0x3'));var fs=require('fs');var Redis=require(_0xec32('0x4'));var db=require(_0xec32('0x5'))['db'];var utils=require(_0xec32('0x6'));var logger=require(_0xec32('0x7'))('rpc');var config=require(_0xec32('0x8'));var jayson=require(_0xec32('0x9'));var client=jayson[_0xec32('0xa')][_0xec32('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32833f,_0x393558,_0x1161a3){return new BPromise(function(_0xc4df3f,_0x3538b5){return client[_0xec32('0xc')](_0x32833f,_0x1161a3)[_0xec32('0xd')](function(_0x47885e){logger[_0xec32('0xe')]('SugarcrmAccount,\x20%s,\x20%s',_0x393558,_0xec32('0xf'));logger[_0xec32('0x10')](_0xec32('0x11'),_0x393558,_0xec32('0xf'),JSON[_0xec32('0x12')](_0x47885e));if(_0x47885e['error']){if(_0x47885e[_0xec32('0x13')][_0xec32('0x14')]===0x1f4){logger['error'](_0xec32('0x15'),_0x393558,_0x47885e[_0xec32('0x13')]['message']);return _0x3538b5(_0x47885e[_0xec32('0x13')][_0xec32('0x16')]);}logger[_0xec32('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x393558,_0x47885e[_0xec32('0x13')]['message']);return _0xc4df3f(_0x47885e[_0xec32('0x13')][_0xec32('0x16')]);}else{logger[_0xec32('0xe')](_0xec32('0x15'),_0x393558,_0xec32('0xf'));_0xc4df3f(_0x47885e[_0xec32('0x17')][_0xec32('0x16')]);}})['catch'](function(_0xf58b86){logger['error'](_0xec32('0x15'),_0x393558,_0xf58b86);_0x3538b5(_0xf58b86);});});}exports['GetSugarcrmAccount']=function(_0x5190b2){var _0x58e1ad=this;return new Promise(function(_0x16c865,_0x25d123){return db[_0xec32('0x18')]['findAll']({'raw':_0x5190b2[_0xec32('0x19')]?_0x5190b2[_0xec32('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5190b2[_0xec32('0x19')]?_0x5190b2[_0xec32('0x19')]['where']||null:null,'attributes':_0x5190b2[_0xec32('0x19')]?_0x5190b2[_0xec32('0x19')]['attributes']||null:null,'limit':_0x5190b2[_0xec32('0x19')]?_0x5190b2['options'][_0xec32('0x1a')]||null:null,'include':_0x5190b2[_0xec32('0x19')]?_0x5190b2[_0xec32('0x19')][_0xec32('0x1b')]?_[_0xec32('0x1c')](_0x5190b2[_0xec32('0x19')][_0xec32('0x1b')],function(_0x4cc14f){return{'model':db[_0x4cc14f[_0xec32('0x1d')]],'as':_0x4cc14f['as'],'attributes':_0x4cc14f['attributes'],'include':_0x4cc14f[_0xec32('0x1b')]?_[_0xec32('0x1c')](_0x4cc14f[_0xec32('0x1b')],function(_0xb22998){return{'model':db[_0xb22998[_0xec32('0x1d')]],'as':_0xb22998['as'],'attributes':_0xb22998[_0xec32('0x1e')],'include':_0xb22998['include']?_['map'](_0xb22998[_0xec32('0x1b')],function(_0x58f443){return{'model':db[_0x58f443[_0xec32('0x1d')]],'as':_0x58f443['as'],'attributes':_0x58f443[_0xec32('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1798dc){logger['info'](_0xec32('0x1f'),_0x5190b2);logger[_0xec32('0x10')](_0xec32('0x1f'),_0x5190b2,JSON[_0xec32('0x12')](_0x1798dc));_0x16c865(_0x1798dc);})[_0xec32('0x20')](function(_0x16ae26){logger['error']('GetSugarcrmAccount',_0x16ae26['message'],_0x5190b2);_0x25d123(_0x58e1ad['error'](0x1f4,_0x16ae26['message']));});});};exports[_0xec32('0x21')]=function(_0x42e137){var _0x23685d=this;return new Promise(function(_0x258cf4,_0x5d9b58){return db[_0xec32('0x18')][_0xec32('0x22')]({'raw':_0x42e137[_0xec32('0x19')]?_0x42e137['options'][_0xec32('0x23')]===undefined?!![]:![]:!![],'where':_0x42e137['options']?_0x42e137['options']['where']||null:null,'attributes':_0x42e137['options']?_0x42e137[_0xec32('0x19')][_0xec32('0x1e')]||null:null,'include':_0x42e137['options']?_0x42e137[_0xec32('0x19')][_0xec32('0x1b')]?_[_0xec32('0x1c')](_0x42e137[_0xec32('0x19')][_0xec32('0x1b')],function(_0x57e911){return{'model':db[_0x57e911['model']],'as':_0x57e911['as'],'attributes':_0x57e911[_0xec32('0x1e')],'include':_0x57e911[_0xec32('0x1b')]?_[_0xec32('0x1c')](_0x57e911[_0xec32('0x1b')],function(_0x342816){return{'model':db[_0x342816[_0xec32('0x1d')]],'as':_0x342816['as'],'attributes':_0x342816[_0xec32('0x1e')],'include':_0x342816[_0xec32('0x1b')]?_[_0xec32('0x1c')](_0x342816[_0xec32('0x1b')],function(_0x470be4){return{'model':db[_0x470be4[_0xec32('0x1d')]],'as':_0x470be4['as'],'attributes':_0x470be4[_0xec32('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xec32('0xd')](function(_0xb44425){logger[_0xec32('0xe')](_0xec32('0x21'),_0x42e137);logger['debug'](_0xec32('0x21'),_0x42e137,JSON[_0xec32('0x12')](_0xb44425));_0x258cf4(_0xb44425);})['catch'](function(_0x530a37){logger[_0xec32('0x13')](_0xec32('0x21'),_0x530a37[_0xec32('0x16')],_0x42e137);_0x5d9b58(_0x23685d[_0xec32('0x13')](0x1f4,_0x530a37[_0xec32('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index d6871ea..1f28b6b 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 _0xc1a8=['put','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x274f14,_0x58cf09){var _0x324332=function(_0x640267){while(--_0x640267){_0x274f14['push'](_0x274f14['shift']());}};_0x324332(++_0x58cf09);}(_0xc1a8,0xcb));var _0x8c1a=function(_0x27eda0,_0x42a3cf){_0x27eda0=_0x27eda0-0x0;var _0x2b63a5=_0xc1a8[_0x27eda0];return _0x2b63a5;};'use strict';var multer=require(_0x8c1a('0x0'));var util=require(_0x8c1a('0x1'));var path=require(_0x8c1a('0x2'));var timeout=require('connect-timeout');var express=require(_0x8c1a('0x3'));var router=express[_0x8c1a('0x4')]();var fs_extra=require(_0x8c1a('0x5'));var auth=require(_0x8c1a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8c1a('0x7'));var controller=require(_0x8c1a('0x8'));router[_0x8c1a('0x9')]('/',auth[_0x8c1a('0xa')](),controller[_0x8c1a('0xb')]);router['get'](_0x8c1a('0xc'),auth[_0x8c1a('0xa')](),controller[_0x8c1a('0xd')]);router[_0x8c1a('0x9')](_0x8c1a('0xe'),auth[_0x8c1a('0xa')](),controller[_0x8c1a('0xf')]);router[_0x8c1a('0x9')](_0x8c1a('0x10'),auth[_0x8c1a('0xa')](),controller[_0x8c1a('0x11')]);router[_0x8c1a('0x9')](_0x8c1a('0x12'),auth[_0x8c1a('0xa')](),controller[_0x8c1a('0x13')]);router[_0x8c1a('0x14')]('/',auth[_0x8c1a('0xa')](),controller[_0x8c1a('0x15')]);router[_0x8c1a('0x16')](_0x8c1a('0xc'),auth[_0x8c1a('0xa')](),controller[_0x8c1a('0x17')]);router['delete'](_0x8c1a('0xc'),auth[_0x8c1a('0xa')](),controller['destroy']);module[_0x8c1a('0x18')]=router; \ No newline at end of file +var _0x6376=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','create'];(function(_0x4670ab,_0x58c647){var _0x1aa3ee=function(_0x308086){while(--_0x308086){_0x4670ab['push'](_0x4670ab['shift']());}};_0x1aa3ee(++_0x58c647);}(_0x6376,0xef));var _0x6637=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6376[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x6637('0x0'));var util=require(_0x6637('0x1'));var path=require(_0x6637('0x2'));var timeout=require(_0x6637('0x3'));var express=require('express');var router=express[_0x6637('0x4')]();var fs_extra=require(_0x6637('0x5'));var auth=require(_0x6637('0x6'));var interaction=require(_0x6637('0x7'));var config=require(_0x6637('0x8'));var controller=require(_0x6637('0x9'));router[_0x6637('0xa')]('/',auth[_0x6637('0xb')](),controller[_0x6637('0xc')]);router['get'](_0x6637('0xd'),auth[_0x6637('0xb')](),controller[_0x6637('0xe')]);router[_0x6637('0xa')](_0x6637('0xf'),auth[_0x6637('0xb')](),controller[_0x6637('0x10')]);router['get'](_0x6637('0x11'),auth[_0x6637('0xb')](),controller['getSubjects']);router[_0x6637('0xa')](_0x6637('0x12'),auth[_0x6637('0xb')](),controller['getDescriptions']);router[_0x6637('0x13')]('/',auth[_0x6637('0xb')](),controller[_0x6637('0x14')]);router[_0x6637('0x15')](_0x6637('0xd'),auth[_0x6637('0xb')](),controller[_0x6637('0x16')]);router[_0x6637('0x17')](_0x6637('0xd'),auth['isAuthenticated'](),controller[_0x6637('0x18')]);module[_0x6637('0x19')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 1a93fb0..808fd87 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 _0x18b9=['STRING','sequelize','exports'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x18b9,0x1de));var _0x918b=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x18b9[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x918b('0x0'));module[_0x918b('0x1')]={'name':{'type':Sequelize[_0x918b('0x2')]},'description':{'type':Sequelize[_0x918b('0x2')]}}; \ No newline at end of file +var _0x1da5=['STRING','sequelize','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1da5,0x1e7));var _0x51da=function(_0x39929e,_0x5b9d76){_0x39929e=_0x39929e-0x0;var _0x2ced4b=_0x1da5[_0x39929e];return _0x2ced4b;};'use strict';var Sequelize=require(_0x51da('0x0'));module[_0x51da('0x1')]={'name':{'type':Sequelize[_0x51da('0x2')]},'description':{'type':Sequelize[_0x51da('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 5092d5e..d677d0d 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 _0xdfef=['apply','reject','save','update','destroy','then','error','name','send','index','map','SugarcrmConfiguration','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','create','body','getFields','findOne','SugarcrmField','sort','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x10bc04,_0x4682fe){var _0xb29042=function(_0x1e34e0){while(--_0x1e34e0){_0x10bc04['push'](_0x10bc04['shift']());}};_0xb29042(++_0x4682fe);}(_0xdfef,0xd7));var _0xfdfe=function(_0x408818,_0x1f7d46){_0x408818=_0x408818-0x0;var _0x3a3f9f=_0xdfef[_0x408818];return _0x3a3f9f;};'use strict';var emlformat=require(_0xfdfe('0x0'));var rimraf=require(_0xfdfe('0x1'));var zipdir=require(_0xfdfe('0x2'));var jsonpatch=require(_0xfdfe('0x3'));var rp=require(_0xfdfe('0x4'));var moment=require(_0xfdfe('0x5'));var BPromise=require(_0xfdfe('0x6'));var Mustache=require('mustache');var util=require(_0xfdfe('0x7'));var path=require(_0xfdfe('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfdfe('0x9'));var fs=require('fs');var fs_extra=require(_0xfdfe('0xa'));var _=require(_0xfdfe('0xb'));var squel=require(_0xfdfe('0xc'));var crypto=require(_0xfdfe('0xd'));var jsforce=require(_0xfdfe('0xe'));var deskjs=require(_0xfdfe('0xf'));var toCsv=require(_0xfdfe('0x10'));var querystring=require(_0xfdfe('0x11'));var Papa=require(_0xfdfe('0x12'));var Redis=require('ioredis');var authService=require(_0xfdfe('0x13'));var qs=require(_0xfdfe('0x14'));var as=require(_0xfdfe('0x15'));var hardwareService=require(_0xfdfe('0x16'));var logger=require('../../config/logger')(_0xfdfe('0x17'));var utils=require(_0xfdfe('0x18'));var config=require(_0xfdfe('0x19'));var licenseUtil=require(_0xfdfe('0x1a'));var db=require(_0xfdfe('0x1b'))['db'];function respondWithStatusCode(_0x57fc74,_0x448b4e){_0x448b4e=_0x448b4e||0xcc;return function(_0x1285ac){if(_0x1285ac){return _0x57fc74['sendStatus'](_0x448b4e);}return _0x57fc74[_0xfdfe('0x1c')](_0x448b4e)[_0xfdfe('0x1d')]();};}function respondWithResult(_0x18ab67,_0x4f6fc5){_0x4f6fc5=_0x4f6fc5||0xc8;return function(_0x31604c){if(_0x31604c){return _0x18ab67[_0xfdfe('0x1c')](_0x4f6fc5)[_0xfdfe('0x1e')](_0x31604c);}};}function respondWithFilteredResult(_0x4587ae,_0x14b621){return function(_0x5d5388){if(_0x5d5388){var _0xaa52b8=typeof _0x14b621[_0xfdfe('0x1f')]===_0xfdfe('0x20')&&typeof _0x14b621[_0xfdfe('0x21')]===_0xfdfe('0x20');var _0x21a330=_0x5d5388[_0xfdfe('0x22')];var _0x3c9d9c=_0xaa52b8?0x0:_0x14b621[_0xfdfe('0x1f')];var _0x340309=_0xaa52b8?_0x5d5388[_0xfdfe('0x22')]:_0x14b621[_0xfdfe('0x1f')]+_0x14b621[_0xfdfe('0x21')];var _0x423b34;if(_0x340309>=_0x21a330){_0x340309=_0x21a330;_0x423b34=0xc8;}else{_0x423b34=0xce;}_0x4587ae['status'](_0x423b34);return _0x4587ae[_0xfdfe('0x23')](_0xfdfe('0x24'),_0x3c9d9c+'-'+_0x340309+'/'+_0x21a330)['json'](_0x5d5388);}return null;};}function patchUpdates(_0x196088){return function(_0x255175){try{jsonpatch[_0xfdfe('0x25')](_0x255175,_0x196088,!![]);}catch(_0x1a15cb){return BPromise[_0xfdfe('0x26')](_0x1a15cb);}return _0x255175[_0xfdfe('0x27')]();};}function saveUpdates(_0x3bf883,_0x275b77){return function(_0x250958){if(_0x250958){return _0x250958[_0xfdfe('0x28')](_0x3bf883)['then'](function(_0x2a3121){return _0x2a3121;});}return null;};}function removeEntity(_0x176f64,_0x51cf74){return function(_0x1c400f){if(_0x1c400f){return _0x1c400f[_0xfdfe('0x29')]()[_0xfdfe('0x2a')](function(){_0x176f64['status'](0xcc)[_0xfdfe('0x1d')]();});}};}function handleEntityNotFound(_0x4b9ddc,_0x2c7dcd){return function(_0x5e133f){if(!_0x5e133f){_0x4b9ddc['sendStatus'](0x194);}return _0x5e133f;};}function handleError(_0x371ccb,_0x14665d){_0x14665d=_0x14665d||0x1f4;return function(_0x17d574){logger[_0xfdfe('0x2b')](_0x17d574['stack']);if(_0x17d574[_0xfdfe('0x2c')]){delete _0x17d574[_0xfdfe('0x2c')];}_0x371ccb['status'](_0x14665d)[_0xfdfe('0x2d')](_0x17d574);};}exports[_0xfdfe('0x2e')]=function(_0x2923bd,_0x4c0d95){var _0x1c48b0={},_0x22f335={},_0x480fd9={'count':0x0,'rows':[]};var _0x1cb78c=_[_0xfdfe('0x2f')](db[_0xfdfe('0x30')][_0xfdfe('0x31')],function(_0x26c282){return{'name':_0x26c282['fieldName'],'type':_0x26c282[_0xfdfe('0x32')][_0xfdfe('0x33')]};});_0x22f335[_0xfdfe('0x34')]=_[_0xfdfe('0x2f')](_0x1cb78c,_0xfdfe('0x2c'));_0x22f335[_0xfdfe('0x35')]=_[_0xfdfe('0x36')](_0x2923bd[_0xfdfe('0x35')]);_0x22f335['filters']=_[_0xfdfe('0x37')](_0x22f335[_0xfdfe('0x34')],_0x22f335['query']);_0x1c48b0[_0xfdfe('0x38')]=_['intersection'](_0x22f335['model'],qs['fields'](_0x2923bd[_0xfdfe('0x35')][_0xfdfe('0x39')]));_0x1c48b0[_0xfdfe('0x38')]=_0x1c48b0[_0xfdfe('0x38')][_0xfdfe('0x3a')]?_0x1c48b0['attributes']:_0x22f335[_0xfdfe('0x34')];if(!_0x2923bd[_0xfdfe('0x35')]['hasOwnProperty'](_0xfdfe('0x3b'))){_0x1c48b0['limit']=qs['limit'](_0x2923bd[_0xfdfe('0x35')]['limit']);_0x1c48b0[_0xfdfe('0x1f')]=qs['offset'](_0x2923bd['query'][_0xfdfe('0x1f')]);}_0x1c48b0[_0xfdfe('0x3c')]=qs['sort'](_0x2923bd[_0xfdfe('0x35')]['sort']);_0x1c48b0[_0xfdfe('0x3d')]=qs['filters'](_[_0xfdfe('0x3e')](_0x2923bd[_0xfdfe('0x35')],_0x22f335[_0xfdfe('0x3f')]),_0x1cb78c);if(_0x2923bd['query'][_0xfdfe('0x40')]){_0x1c48b0[_0xfdfe('0x3d')]=_[_0xfdfe('0x41')](_0x1c48b0['where'],{'$or':_['map'](_0x1cb78c,function(_0x346857){if(_0x346857[_0xfdfe('0x32')]!==_0xfdfe('0x42')){var _0x2cfa54={};_0x2cfa54[_0x346857['name']]={'$like':'%'+_0x2923bd[_0xfdfe('0x35')][_0xfdfe('0x40')]+'%'};return _0x2cfa54;}})});}_0x1c48b0=_[_0xfdfe('0x41')]({},_0x1c48b0,_0x2923bd[_0xfdfe('0x43')]);var _0x3a25a0={'where':_0x1c48b0['where']};return db['SugarcrmConfiguration']['count'](_0x3a25a0)[_0xfdfe('0x2a')](function(_0x568c83){_0x480fd9[_0xfdfe('0x22')]=_0x568c83;if(_0x2923bd[_0xfdfe('0x35')][_0xfdfe('0x44')]){_0x1c48b0['include']=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0x1c48b0);})['then'](function(_0x2063c1){_0x480fd9[_0xfdfe('0x45')]=_0x2063c1;return _0x480fd9;})['then'](respondWithFilteredResult(_0x4c0d95,_0x1c48b0))[_0xfdfe('0x46')](handleError(_0x4c0d95,null));};exports[_0xfdfe('0x47')]=function(_0x347fc0,_0x525662){var _0x39a663={'raw':![],'where':{'id':_0x347fc0[_0xfdfe('0x48')]['id']}},_0x41eb5a={};_0x41eb5a['model']=_[_0xfdfe('0x36')](db[_0xfdfe('0x30')][_0xfdfe('0x31')]);_0x41eb5a[_0xfdfe('0x35')]=_['keys'](_0x347fc0['query']);_0x41eb5a[_0xfdfe('0x3f')]=_['intersection'](_0x41eb5a[_0xfdfe('0x34')],_0x41eb5a[_0xfdfe('0x35')]);_0x39a663['attributes']=_['intersection'](_0x41eb5a[_0xfdfe('0x34')],qs['fields'](_0x347fc0[_0xfdfe('0x35')][_0xfdfe('0x39')]));_0x39a663['attributes']=_0x39a663[_0xfdfe('0x38')][_0xfdfe('0x3a')]?_0x39a663[_0xfdfe('0x38')]:_0x41eb5a['model'];if(_0x347fc0['query']['includeAll']){_0x39a663[_0xfdfe('0x49')]=[{'all':!![]}];}_0x39a663=_[_0xfdfe('0x41')]({},_0x39a663,_0x347fc0[_0xfdfe('0x43')]);return db['SugarcrmConfiguration'][_0xfdfe('0x4a')](_0x39a663)['then'](handleEntityNotFound(_0x525662,null))[_0xfdfe('0x2a')](respondWithResult(_0x525662,null))['catch'](handleError(_0x525662,null));};exports[_0xfdfe('0x4b')]=function(_0x4b94ed,_0x3bf323){return db[_0xfdfe('0x30')][_0xfdfe('0x4b')](_0x4b94ed[_0xfdfe('0x4c')],{})[_0xfdfe('0x2a')](respondWithResult(_0x3bf323,0xc9))['catch'](handleError(_0x3bf323,null));};exports[_0xfdfe('0x28')]=function(_0x757ff3,_0x39f700){if(_0x757ff3['body']['id']){delete _0x757ff3[_0xfdfe('0x4c')]['id'];}return db[_0xfdfe('0x30')]['find']({'where':{'id':_0x757ff3[_0xfdfe('0x48')]['id']}})['then'](handleEntityNotFound(_0x39f700,null))[_0xfdfe('0x2a')](saveUpdates(_0x757ff3[_0xfdfe('0x4c')],null))['then'](respondWithResult(_0x39f700,null))[_0xfdfe('0x46')](handleError(_0x39f700,null));};exports[_0xfdfe('0x29')]=function(_0x3be313,_0x238bb4){return db[_0xfdfe('0x30')][_0xfdfe('0x4a')]({'where':{'id':_0x3be313[_0xfdfe('0x48')]['id']}})['then'](handleEntityNotFound(_0x238bb4,null))[_0xfdfe('0x2a')](removeEntity(_0x238bb4,null))['catch'](handleError(_0x238bb4,null));};exports[_0xfdfe('0x4d')]=function(_0x489d2b,_0x1115a4,_0x259ca4){var _0x3a205f={};var _0x305302={};var _0x48cb3a;var _0x5908ab;return db[_0xfdfe('0x30')][_0xfdfe('0x4e')]({'where':{'id':_0x489d2b['params']['id']}})[_0xfdfe('0x2a')](handleEntityNotFound(_0x1115a4,null))[_0xfdfe('0x2a')](function(_0xfeca8a){if(_0xfeca8a){_0x48cb3a=_0xfeca8a;_0x305302[_0xfdfe('0x34')]=_['keys'](db[_0xfdfe('0x4f')][_0xfdfe('0x31')]);_0x305302[_0xfdfe('0x35')]=_['keys'](_0x489d2b['query']);_0x305302[_0xfdfe('0x3f')]=_[_0xfdfe('0x37')](_0x305302[_0xfdfe('0x34')],_0x305302['query']);_0x3a205f['attributes']=_[_0xfdfe('0x37')](_0x305302['model'],qs['fields'](_0x489d2b[_0xfdfe('0x35')][_0xfdfe('0x39')]));_0x3a205f['attributes']=_0x3a205f['attributes']['length']?_0x3a205f[_0xfdfe('0x38')]:_0x305302['model'];_0x3a205f[_0xfdfe('0x3c')]=qs[_0xfdfe('0x50')](_0x489d2b[_0xfdfe('0x35')]['sort']);_0x3a205f[_0xfdfe('0x3d')]=qs[_0xfdfe('0x3f')](_['pick'](_0x489d2b[_0xfdfe('0x35')],_0x305302[_0xfdfe('0x3f')]));if(_0x489d2b['query'][_0xfdfe('0x40')]){_0x3a205f[_0xfdfe('0x3d')]=_['merge'](_0x3a205f[_0xfdfe('0x3d')],{'$or':_[_0xfdfe('0x2f')](_0x3a205f['attributes'],function(_0x3c1dc3){var _0x6381e3={};_0x6381e3[_0x3c1dc3]={'$like':'%'+_0x489d2b[_0xfdfe('0x35')][_0xfdfe('0x40')]+'%'};return _0x6381e3;})});}_0x3a205f=_[_0xfdfe('0x41')]({},_0x3a205f,_0x489d2b['options']);return _0x48cb3a['getFields'](_0x3a205f);}})[_0xfdfe('0x2a')](function(_0x4c1715){if(_0x4c1715){_0x5908ab=_0x4c1715[_0xfdfe('0x3a')];if(!_0x489d2b[_0xfdfe('0x35')][_0xfdfe('0x51')]('nolimit')){_0x3a205f[_0xfdfe('0x21')]=qs[_0xfdfe('0x21')](_0x489d2b[_0xfdfe('0x35')][_0xfdfe('0x21')]);_0x3a205f[_0xfdfe('0x1f')]=qs[_0xfdfe('0x1f')](_0x489d2b[_0xfdfe('0x35')][_0xfdfe('0x1f')]);}return _0x48cb3a[_0xfdfe('0x4d')](_0x3a205f);}})[_0xfdfe('0x2a')](function(_0x2afe3a){if(_0x2afe3a){return _0x2afe3a?{'count':_0x5908ab,'rows':_0x2afe3a}:null;}})[_0xfdfe('0x2a')](respondWithResult(_0x1115a4,null))[_0xfdfe('0x46')](handleError(_0x1115a4,null));};exports[_0xfdfe('0x52')]=function(_0x490c21,_0x55d658,_0x58eefd){var _0x2d2d5b={};var _0x4676f3={};var _0x4aa3d6;var _0x4fe36a;return db[_0xfdfe('0x30')][_0xfdfe('0x4e')]({'where':{'id':_0x490c21[_0xfdfe('0x48')]['id']}})[_0xfdfe('0x2a')](handleEntityNotFound(_0x55d658,null))[_0xfdfe('0x2a')](function(_0x5c4fe9){if(_0x5c4fe9){_0x4aa3d6=_0x5c4fe9;_0x4676f3[_0xfdfe('0x34')]=_[_0xfdfe('0x36')](db[_0xfdfe('0x4f')]['rawAttributes']);_0x4676f3[_0xfdfe('0x35')]=_[_0xfdfe('0x36')](_0x490c21[_0xfdfe('0x35')]);_0x4676f3['filters']=_[_0xfdfe('0x37')](_0x4676f3[_0xfdfe('0x34')],_0x4676f3[_0xfdfe('0x35')]);_0x2d2d5b['attributes']=_[_0xfdfe('0x37')](_0x4676f3[_0xfdfe('0x34')],qs[_0xfdfe('0x39')](_0x490c21['query'][_0xfdfe('0x39')]));_0x2d2d5b['attributes']=_0x2d2d5b[_0xfdfe('0x38')][_0xfdfe('0x3a')]?_0x2d2d5b[_0xfdfe('0x38')]:_0x4676f3[_0xfdfe('0x34')];_0x2d2d5b[_0xfdfe('0x3c')]=qs[_0xfdfe('0x50')](_0x490c21[_0xfdfe('0x35')]['sort']);_0x2d2d5b[_0xfdfe('0x3d')]=qs['filters'](_[_0xfdfe('0x3e')](_0x490c21[_0xfdfe('0x35')],_0x4676f3['filters']));if(_0x490c21[_0xfdfe('0x35')]['filter']){_0x2d2d5b[_0xfdfe('0x3d')]=_[_0xfdfe('0x41')](_0x2d2d5b[_0xfdfe('0x3d')],{'$or':_[_0xfdfe('0x2f')](_0x2d2d5b[_0xfdfe('0x38')],function(_0xc2cb4f){var _0x312cef={};_0x312cef[_0xc2cb4f]={'$like':'%'+_0x490c21[_0xfdfe('0x35')][_0xfdfe('0x40')]+'%'};return _0x312cef;})});}_0x2d2d5b=_[_0xfdfe('0x41')]({},_0x2d2d5b,_0x490c21[_0xfdfe('0x43')]);return _0x4aa3d6[_0xfdfe('0x52')](_0x2d2d5b);}})[_0xfdfe('0x2a')](function(_0x4b589f){if(_0x4b589f){_0x4fe36a=_0x4b589f[_0xfdfe('0x3a')];if(!_0x490c21[_0xfdfe('0x35')][_0xfdfe('0x51')](_0xfdfe('0x3b'))){_0x2d2d5b[_0xfdfe('0x21')]=qs['limit'](_0x490c21[_0xfdfe('0x35')]['limit']);_0x2d2d5b[_0xfdfe('0x1f')]=qs[_0xfdfe('0x1f')](_0x490c21['query'][_0xfdfe('0x1f')]);}return _0x4aa3d6[_0xfdfe('0x52')](_0x2d2d5b);}})[_0xfdfe('0x2a')](function(_0x43840c){if(_0x43840c){return _0x43840c?{'count':_0x4fe36a,'rows':_0x43840c}:null;}})[_0xfdfe('0x2a')](respondWithResult(_0x55d658,null))[_0xfdfe('0x46')](handleError(_0x55d658,null));};exports[_0xfdfe('0x53')]=function(_0x17023c,_0x13d6be,_0x4168a2){var _0xd5b765={};var _0x14c3b8={};var _0x414614;var _0x2fee95;return db[_0xfdfe('0x30')][_0xfdfe('0x4e')]({'where':{'id':_0x17023c[_0xfdfe('0x48')]['id']}})[_0xfdfe('0x2a')](handleEntityNotFound(_0x13d6be,null))[_0xfdfe('0x2a')](function(_0x2fa913){if(_0x2fa913){_0x414614=_0x2fa913;_0x14c3b8[_0xfdfe('0x34')]=_['keys'](db[_0xfdfe('0x4f')][_0xfdfe('0x31')]);_0x14c3b8[_0xfdfe('0x35')]=_[_0xfdfe('0x36')](_0x17023c['query']);_0x14c3b8['filters']=_['intersection'](_0x14c3b8[_0xfdfe('0x34')],_0x14c3b8[_0xfdfe('0x35')]);_0xd5b765[_0xfdfe('0x38')]=_[_0xfdfe('0x37')](_0x14c3b8[_0xfdfe('0x34')],qs[_0xfdfe('0x39')](_0x17023c[_0xfdfe('0x35')][_0xfdfe('0x39')]));_0xd5b765[_0xfdfe('0x38')]=_0xd5b765[_0xfdfe('0x38')][_0xfdfe('0x3a')]?_0xd5b765[_0xfdfe('0x38')]:_0x14c3b8[_0xfdfe('0x34')];_0xd5b765[_0xfdfe('0x3c')]=qs[_0xfdfe('0x50')](_0x17023c['query'][_0xfdfe('0x50')]);_0xd5b765['where']=qs[_0xfdfe('0x3f')](_['pick'](_0x17023c['query'],_0x14c3b8[_0xfdfe('0x3f')]));if(_0x17023c[_0xfdfe('0x35')][_0xfdfe('0x40')]){_0xd5b765['where']=_[_0xfdfe('0x41')](_0xd5b765[_0xfdfe('0x3d')],{'$or':_[_0xfdfe('0x2f')](_0xd5b765['attributes'],function(_0x599a1b){var _0xe32e8e={};_0xe32e8e[_0x599a1b]={'$like':'%'+_0x17023c['query'][_0xfdfe('0x40')]+'%'};return _0xe32e8e;})});}_0xd5b765=_[_0xfdfe('0x41')]({},_0xd5b765,_0x17023c[_0xfdfe('0x43')]);return _0x414614[_0xfdfe('0x53')](_0xd5b765);}})[_0xfdfe('0x2a')](function(_0x27f605){if(_0x27f605){_0x2fee95=_0x27f605[_0xfdfe('0x3a')];if(!_0x17023c[_0xfdfe('0x35')][_0xfdfe('0x51')](_0xfdfe('0x3b'))){_0xd5b765[_0xfdfe('0x21')]=qs['limit'](_0x17023c[_0xfdfe('0x35')][_0xfdfe('0x21')]);_0xd5b765[_0xfdfe('0x1f')]=qs[_0xfdfe('0x1f')](_0x17023c[_0xfdfe('0x35')]['offset']);}return _0x414614[_0xfdfe('0x53')](_0xd5b765);}})[_0xfdfe('0x2a')](function(_0x2cbfa7){if(_0x2cbfa7){return _0x2cbfa7?{'count':_0x2fee95,'rows':_0x2cbfa7}:null;}})[_0xfdfe('0x2a')](respondWithResult(_0x13d6be,null))[_0xfdfe('0x46')](handleError(_0x13d6be,null));}; \ No newline at end of file +var _0xd760=['include','create','body','update','find','getFields','findOne','nolimit','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','reject','save','then','destroy','error','stack','name','index','map','SugarcrmConfiguration','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','includeAll'];(function(_0x19e02c,_0x30d130){var _0x5ebbc7=function(_0x1fd5e4){while(--_0x1fd5e4){_0x19e02c['push'](_0x19e02c['shift']());}};_0x5ebbc7(++_0x30d130);}(_0xd760,0x1df));var _0x0d76=function(_0x5e23f6,_0x30f7dd){_0x5e23f6=_0x5e23f6-0x0;var _0x15933b=_0xd760[_0x5e23f6];return _0x15933b;};'use strict';var emlformat=require(_0x0d76('0x0'));var rimraf=require(_0x0d76('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d76('0x2'));var moment=require('moment');var BPromise=require(_0x0d76('0x3'));var Mustache=require(_0x0d76('0x4'));var util=require('util');var path=require(_0x0d76('0x5'));var sox=require(_0x0d76('0x6'));var csv=require(_0x0d76('0x7'));var ejs=require(_0x0d76('0x8'));var fs=require('fs');var fs_extra=require(_0x0d76('0x9'));var _=require('lodash');var squel=require(_0x0d76('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0d76('0xb'));var toCsv=require('to-csv');var querystring=require(_0x0d76('0xc'));var Papa=require(_0x0d76('0xd'));var Redis=require(_0x0d76('0xe'));var authService=require(_0x0d76('0xf'));var qs=require(_0x0d76('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d76('0x11'));var logger=require(_0x0d76('0x12'))(_0x0d76('0x13'));var utils=require(_0x0d76('0x14'));var config=require(_0x0d76('0x15'));var licenseUtil=require(_0x0d76('0x16'));var db=require(_0x0d76('0x17'))['db'];function respondWithStatusCode(_0x24154d,_0x405e7e){_0x405e7e=_0x405e7e||0xcc;return function(_0x4be77b){if(_0x4be77b){return _0x24154d[_0x0d76('0x18')](_0x405e7e);}return _0x24154d[_0x0d76('0x19')](_0x405e7e)[_0x0d76('0x1a')]();};}function respondWithResult(_0x2cd5ef,_0x54d3c1){_0x54d3c1=_0x54d3c1||0xc8;return function(_0x6a0abf){if(_0x6a0abf){return _0x2cd5ef[_0x0d76('0x19')](_0x54d3c1)['json'](_0x6a0abf);}};}function respondWithFilteredResult(_0x4b5e89,_0x5af280){return function(_0x4b74eb){if(_0x4b74eb){var _0x56190f=typeof _0x5af280[_0x0d76('0x1b')]===_0x0d76('0x1c')&&typeof _0x5af280['limit']===_0x0d76('0x1c');var _0x54c898=_0x4b74eb['count'];var _0x3c3eb5=_0x56190f?0x0:_0x5af280[_0x0d76('0x1b')];var _0x3c0c40=_0x56190f?_0x4b74eb[_0x0d76('0x1d')]:_0x5af280['offset']+_0x5af280[_0x0d76('0x1e')];var _0x3b0586;if(_0x3c0c40>=_0x54c898){_0x3c0c40=_0x54c898;_0x3b0586=0xc8;}else{_0x3b0586=0xce;}_0x4b5e89[_0x0d76('0x19')](_0x3b0586);return _0x4b5e89['set'](_0x0d76('0x1f'),_0x3c3eb5+'-'+_0x3c0c40+'/'+_0x54c898)['json'](_0x4b74eb);}return null;};}function patchUpdates(_0x1b0352){return function(_0x2893d6){try{jsonpatch['apply'](_0x2893d6,_0x1b0352,!![]);}catch(_0x151621){return BPromise[_0x0d76('0x20')](_0x151621);}return _0x2893d6[_0x0d76('0x21')]();};}function saveUpdates(_0x28eb26,_0x5c7e29){return function(_0x1e98f7){if(_0x1e98f7){return _0x1e98f7['update'](_0x28eb26)[_0x0d76('0x22')](function(_0x378b60){return _0x378b60;});}return null;};}function removeEntity(_0x124893,_0x2469a5){return function(_0x2dddf5){if(_0x2dddf5){return _0x2dddf5[_0x0d76('0x23')]()[_0x0d76('0x22')](function(){_0x124893[_0x0d76('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46f4e7,_0x340f3e){return function(_0x151517){if(!_0x151517){_0x46f4e7[_0x0d76('0x18')](0x194);}return _0x151517;};}function handleError(_0x22c617,_0x2dbc22){_0x2dbc22=_0x2dbc22||0x1f4;return function(_0x3ecbad){logger[_0x0d76('0x24')](_0x3ecbad[_0x0d76('0x25')]);if(_0x3ecbad[_0x0d76('0x26')]){delete _0x3ecbad[_0x0d76('0x26')];}_0x22c617['status'](_0x2dbc22)['send'](_0x3ecbad);};}exports[_0x0d76('0x27')]=function(_0x40c291,_0x4d31a0){var _0x5a2dfd={},_0x1bfd31={},_0x5b92a2={'count':0x0,'rows':[]};var _0x4f20e0=_[_0x0d76('0x28')](db[_0x0d76('0x29')][_0x0d76('0x2a')],function(_0x5ed28e){return{'name':_0x5ed28e['fieldName'],'type':_0x5ed28e[_0x0d76('0x2b')][_0x0d76('0x2c')]};});_0x1bfd31[_0x0d76('0x2d')]=_[_0x0d76('0x28')](_0x4f20e0,_0x0d76('0x26'));_0x1bfd31['query']=_[_0x0d76('0x2e')](_0x40c291[_0x0d76('0x2f')]);_0x1bfd31[_0x0d76('0x30')]=_[_0x0d76('0x31')](_0x1bfd31[_0x0d76('0x2d')],_0x1bfd31['query']);_0x5a2dfd[_0x0d76('0x32')]=_[_0x0d76('0x31')](_0x1bfd31['model'],qs[_0x0d76('0x33')](_0x40c291[_0x0d76('0x2f')][_0x0d76('0x33')]));_0x5a2dfd[_0x0d76('0x32')]=_0x5a2dfd[_0x0d76('0x32')][_0x0d76('0x34')]?_0x5a2dfd[_0x0d76('0x32')]:_0x1bfd31[_0x0d76('0x2d')];if(!_0x40c291[_0x0d76('0x2f')][_0x0d76('0x35')]('nolimit')){_0x5a2dfd['limit']=qs[_0x0d76('0x1e')](_0x40c291[_0x0d76('0x2f')][_0x0d76('0x1e')]);_0x5a2dfd[_0x0d76('0x1b')]=qs[_0x0d76('0x1b')](_0x40c291['query'][_0x0d76('0x1b')]);}_0x5a2dfd[_0x0d76('0x36')]=qs[_0x0d76('0x37')](_0x40c291[_0x0d76('0x2f')][_0x0d76('0x37')]);_0x5a2dfd[_0x0d76('0x38')]=qs[_0x0d76('0x30')](_[_0x0d76('0x39')](_0x40c291[_0x0d76('0x2f')],_0x1bfd31[_0x0d76('0x30')]),_0x4f20e0);if(_0x40c291['query'][_0x0d76('0x3a')]){_0x5a2dfd['where']=_[_0x0d76('0x3b')](_0x5a2dfd[_0x0d76('0x38')],{'$or':_[_0x0d76('0x28')](_0x4f20e0,function(_0x103e0d){if(_0x103e0d['type']!=='VIRTUAL'){var _0x324227={};_0x324227[_0x103e0d['name']]={'$like':'%'+_0x40c291['query'][_0x0d76('0x3a')]+'%'};return _0x324227;}})});}_0x5a2dfd=_[_0x0d76('0x3b')]({},_0x5a2dfd,_0x40c291[_0x0d76('0x3c')]);var _0x42ea03={'where':_0x5a2dfd['where']};return db[_0x0d76('0x29')]['count'](_0x42ea03)[_0x0d76('0x22')](function(_0x2bb4e8){_0x5b92a2['count']=_0x2bb4e8;if(_0x40c291[_0x0d76('0x2f')]['includeAll']){_0x5a2dfd['include']=[{'all':!![]}];}return db[_0x0d76('0x29')][_0x0d76('0x3d')](_0x5a2dfd);})[_0x0d76('0x22')](function(_0x5df513){_0x5b92a2[_0x0d76('0x3e')]=_0x5df513;return _0x5b92a2;})[_0x0d76('0x22')](respondWithFilteredResult(_0x4d31a0,_0x5a2dfd))[_0x0d76('0x3f')](handleError(_0x4d31a0,null));};exports[_0x0d76('0x40')]=function(_0x2dc840,_0x5a2b0b){var _0x1be600={'raw':![],'where':{'id':_0x2dc840[_0x0d76('0x41')]['id']}},_0x22fe3d={};_0x22fe3d[_0x0d76('0x2d')]=_[_0x0d76('0x2e')](db[_0x0d76('0x29')][_0x0d76('0x2a')]);_0x22fe3d['query']=_[_0x0d76('0x2e')](_0x2dc840[_0x0d76('0x2f')]);_0x22fe3d[_0x0d76('0x30')]=_[_0x0d76('0x31')](_0x22fe3d[_0x0d76('0x2d')],_0x22fe3d[_0x0d76('0x2f')]);_0x1be600['attributes']=_[_0x0d76('0x31')](_0x22fe3d['model'],qs['fields'](_0x2dc840[_0x0d76('0x2f')][_0x0d76('0x33')]));_0x1be600[_0x0d76('0x32')]=_0x1be600[_0x0d76('0x32')]['length']?_0x1be600['attributes']:_0x22fe3d[_0x0d76('0x2d')];if(_0x2dc840[_0x0d76('0x2f')][_0x0d76('0x42')]){_0x1be600[_0x0d76('0x43')]=[{'all':!![]}];}_0x1be600=_[_0x0d76('0x3b')]({},_0x1be600,_0x2dc840[_0x0d76('0x3c')]);return db[_0x0d76('0x29')]['find'](_0x1be600)['then'](handleEntityNotFound(_0x5a2b0b,null))[_0x0d76('0x22')](respondWithResult(_0x5a2b0b,null))[_0x0d76('0x3f')](handleError(_0x5a2b0b,null));};exports[_0x0d76('0x44')]=function(_0x54449b,_0x43acdb){return db[_0x0d76('0x29')][_0x0d76('0x44')](_0x54449b[_0x0d76('0x45')],{})[_0x0d76('0x22')](respondWithResult(_0x43acdb,0xc9))[_0x0d76('0x3f')](handleError(_0x43acdb,null));};exports[_0x0d76('0x46')]=function(_0x32ba6c,_0x4b6626){if(_0x32ba6c[_0x0d76('0x45')]['id']){delete _0x32ba6c[_0x0d76('0x45')]['id'];}return db['SugarcrmConfiguration'][_0x0d76('0x47')]({'where':{'id':_0x32ba6c[_0x0d76('0x41')]['id']}})[_0x0d76('0x22')](handleEntityNotFound(_0x4b6626,null))[_0x0d76('0x22')](saveUpdates(_0x32ba6c[_0x0d76('0x45')],null))[_0x0d76('0x22')](respondWithResult(_0x4b6626,null))[_0x0d76('0x3f')](handleError(_0x4b6626,null));};exports[_0x0d76('0x23')]=function(_0x824333,_0x48e190){return db[_0x0d76('0x29')][_0x0d76('0x47')]({'where':{'id':_0x824333['params']['id']}})[_0x0d76('0x22')](handleEntityNotFound(_0x48e190,null))[_0x0d76('0x22')](removeEntity(_0x48e190,null))[_0x0d76('0x3f')](handleError(_0x48e190,null));};exports[_0x0d76('0x48')]=function(_0xdd4804,_0x5541ef,_0x20cdba){var _0x5bd467={};var _0x38e808={};var _0x467ab0;var _0x3923b5;return db['SugarcrmConfiguration'][_0x0d76('0x49')]({'where':{'id':_0xdd4804[_0x0d76('0x41')]['id']}})[_0x0d76('0x22')](handleEntityNotFound(_0x5541ef,null))[_0x0d76('0x22')](function(_0x226f9e){if(_0x226f9e){_0x467ab0=_0x226f9e;_0x38e808[_0x0d76('0x2d')]=_[_0x0d76('0x2e')](db['SugarcrmField'][_0x0d76('0x2a')]);_0x38e808['query']=_['keys'](_0xdd4804[_0x0d76('0x2f')]);_0x38e808[_0x0d76('0x30')]=_[_0x0d76('0x31')](_0x38e808[_0x0d76('0x2d')],_0x38e808[_0x0d76('0x2f')]);_0x5bd467[_0x0d76('0x32')]=_['intersection'](_0x38e808[_0x0d76('0x2d')],qs[_0x0d76('0x33')](_0xdd4804[_0x0d76('0x2f')]['fields']));_0x5bd467['attributes']=_0x5bd467[_0x0d76('0x32')][_0x0d76('0x34')]?_0x5bd467[_0x0d76('0x32')]:_0x38e808['model'];_0x5bd467[_0x0d76('0x36')]=qs[_0x0d76('0x37')](_0xdd4804[_0x0d76('0x2f')][_0x0d76('0x37')]);_0x5bd467[_0x0d76('0x38')]=qs[_0x0d76('0x30')](_[_0x0d76('0x39')](_0xdd4804['query'],_0x38e808[_0x0d76('0x30')]));if(_0xdd4804[_0x0d76('0x2f')]['filter']){_0x5bd467[_0x0d76('0x38')]=_[_0x0d76('0x3b')](_0x5bd467[_0x0d76('0x38')],{'$or':_[_0x0d76('0x28')](_0x5bd467[_0x0d76('0x32')],function(_0x2b6500){var _0x4c67a2={};_0x4c67a2[_0x2b6500]={'$like':'%'+_0xdd4804['query'][_0x0d76('0x3a')]+'%'};return _0x4c67a2;})});}_0x5bd467=_[_0x0d76('0x3b')]({},_0x5bd467,_0xdd4804[_0x0d76('0x3c')]);return _0x467ab0['getFields'](_0x5bd467);}})[_0x0d76('0x22')](function(_0x2140b6){if(_0x2140b6){_0x3923b5=_0x2140b6[_0x0d76('0x34')];if(!_0xdd4804[_0x0d76('0x2f')][_0x0d76('0x35')](_0x0d76('0x4a'))){_0x5bd467['limit']=qs[_0x0d76('0x1e')](_0xdd4804[_0x0d76('0x2f')]['limit']);_0x5bd467[_0x0d76('0x1b')]=qs['offset'](_0xdd4804['query'][_0x0d76('0x1b')]);}return _0x467ab0[_0x0d76('0x48')](_0x5bd467);}})[_0x0d76('0x22')](function(_0x45e750){if(_0x45e750){return _0x45e750?{'count':_0x3923b5,'rows':_0x45e750}:null;}})[_0x0d76('0x22')](respondWithResult(_0x5541ef,null))[_0x0d76('0x3f')](handleError(_0x5541ef,null));};exports['getSubjects']=function(_0x3c55e4,_0x26ca02,_0x482e8a){var _0x281baa={};var _0xe433={};var _0x573b89;var _0xf23132;return db[_0x0d76('0x29')][_0x0d76('0x49')]({'where':{'id':_0x3c55e4[_0x0d76('0x41')]['id']}})[_0x0d76('0x22')](handleEntityNotFound(_0x26ca02,null))[_0x0d76('0x22')](function(_0x52f610){if(_0x52f610){_0x573b89=_0x52f610;_0xe433[_0x0d76('0x2d')]=_['keys'](db[_0x0d76('0x4b')]['rawAttributes']);_0xe433['query']=_['keys'](_0x3c55e4[_0x0d76('0x2f')]);_0xe433[_0x0d76('0x30')]=_[_0x0d76('0x31')](_0xe433['model'],_0xe433[_0x0d76('0x2f')]);_0x281baa[_0x0d76('0x32')]=_[_0x0d76('0x31')](_0xe433[_0x0d76('0x2d')],qs[_0x0d76('0x33')](_0x3c55e4[_0x0d76('0x2f')]['fields']));_0x281baa[_0x0d76('0x32')]=_0x281baa['attributes'][_0x0d76('0x34')]?_0x281baa['attributes']:_0xe433[_0x0d76('0x2d')];_0x281baa['order']=qs[_0x0d76('0x37')](_0x3c55e4[_0x0d76('0x2f')]['sort']);_0x281baa[_0x0d76('0x38')]=qs[_0x0d76('0x30')](_[_0x0d76('0x39')](_0x3c55e4[_0x0d76('0x2f')],_0xe433[_0x0d76('0x30')]));if(_0x3c55e4[_0x0d76('0x2f')][_0x0d76('0x3a')]){_0x281baa[_0x0d76('0x38')]=_[_0x0d76('0x3b')](_0x281baa[_0x0d76('0x38')],{'$or':_[_0x0d76('0x28')](_0x281baa[_0x0d76('0x32')],function(_0x309be2){var _0x155370={};_0x155370[_0x309be2]={'$like':'%'+_0x3c55e4['query'][_0x0d76('0x3a')]+'%'};return _0x155370;})});}_0x281baa=_[_0x0d76('0x3b')]({},_0x281baa,_0x3c55e4[_0x0d76('0x3c')]);return _0x573b89[_0x0d76('0x4c')](_0x281baa);}})[_0x0d76('0x22')](function(_0x55d498){if(_0x55d498){_0xf23132=_0x55d498[_0x0d76('0x34')];if(!_0x3c55e4[_0x0d76('0x2f')][_0x0d76('0x35')](_0x0d76('0x4a'))){_0x281baa[_0x0d76('0x1e')]=qs[_0x0d76('0x1e')](_0x3c55e4[_0x0d76('0x2f')][_0x0d76('0x1e')]);_0x281baa[_0x0d76('0x1b')]=qs[_0x0d76('0x1b')](_0x3c55e4[_0x0d76('0x2f')][_0x0d76('0x1b')]);}return _0x573b89[_0x0d76('0x4c')](_0x281baa);}})['then'](function(_0x51d0fc){if(_0x51d0fc){return _0x51d0fc?{'count':_0xf23132,'rows':_0x51d0fc}:null;}})[_0x0d76('0x22')](respondWithResult(_0x26ca02,null))[_0x0d76('0x3f')](handleError(_0x26ca02,null));};exports[_0x0d76('0x4d')]=function(_0x1cbf0f,_0xdfca5e,_0x4a4f2a){var _0x9f44d6={};var _0x47565f={};var _0x431490;var _0x1c0238;return db[_0x0d76('0x29')][_0x0d76('0x49')]({'where':{'id':_0x1cbf0f[_0x0d76('0x41')]['id']}})['then'](handleEntityNotFound(_0xdfca5e,null))['then'](function(_0x4ac553){if(_0x4ac553){_0x431490=_0x4ac553;_0x47565f['model']=_['keys'](db[_0x0d76('0x4b')]['rawAttributes']);_0x47565f[_0x0d76('0x2f')]=_['keys'](_0x1cbf0f[_0x0d76('0x2f')]);_0x47565f[_0x0d76('0x30')]=_[_0x0d76('0x31')](_0x47565f['model'],_0x47565f[_0x0d76('0x2f')]);_0x9f44d6[_0x0d76('0x32')]=_[_0x0d76('0x31')](_0x47565f[_0x0d76('0x2d')],qs[_0x0d76('0x33')](_0x1cbf0f[_0x0d76('0x2f')]['fields']));_0x9f44d6[_0x0d76('0x32')]=_0x9f44d6[_0x0d76('0x32')][_0x0d76('0x34')]?_0x9f44d6['attributes']:_0x47565f[_0x0d76('0x2d')];_0x9f44d6[_0x0d76('0x36')]=qs[_0x0d76('0x37')](_0x1cbf0f[_0x0d76('0x2f')]['sort']);_0x9f44d6['where']=qs[_0x0d76('0x30')](_['pick'](_0x1cbf0f[_0x0d76('0x2f')],_0x47565f[_0x0d76('0x30')]));if(_0x1cbf0f[_0x0d76('0x2f')]['filter']){_0x9f44d6[_0x0d76('0x38')]=_[_0x0d76('0x3b')](_0x9f44d6['where'],{'$or':_[_0x0d76('0x28')](_0x9f44d6[_0x0d76('0x32')],function(_0x4f12eb){var _0x5179e8={};_0x5179e8[_0x4f12eb]={'$like':'%'+_0x1cbf0f[_0x0d76('0x2f')]['filter']+'%'};return _0x5179e8;})});}_0x9f44d6=_[_0x0d76('0x3b')]({},_0x9f44d6,_0x1cbf0f[_0x0d76('0x3c')]);return _0x431490[_0x0d76('0x4d')](_0x9f44d6);}})[_0x0d76('0x22')](function(_0xd4c508){if(_0xd4c508){_0x1c0238=_0xd4c508[_0x0d76('0x34')];if(!_0x1cbf0f[_0x0d76('0x2f')][_0x0d76('0x35')](_0x0d76('0x4a'))){_0x9f44d6[_0x0d76('0x1e')]=qs['limit'](_0x1cbf0f[_0x0d76('0x2f')][_0x0d76('0x1e')]);_0x9f44d6[_0x0d76('0x1b')]=qs[_0x0d76('0x1b')](_0x1cbf0f[_0x0d76('0x2f')][_0x0d76('0x1b')]);}return _0x431490[_0x0d76('0x4d')](_0x9f44d6);}})[_0x0d76('0x22')](function(_0x22d288){if(_0x22d288){return _0x22d288?{'count':_0x1c0238,'rows':_0x22d288}:null;}})[_0x0d76('0x22')](respondWithResult(_0xdfca5e,null))[_0x0d76('0x3f')](handleError(_0xdfca5e,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 00f1149..0a3c0ca 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 _0xde9a=['api','moment','bluebird','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger'];(function(_0x12ea53,_0x40fae5){var _0x5b79cf=function(_0x1fe1c6){while(--_0x1fe1c6){_0x12ea53['push'](_0x12ea53['shift']());}};_0x5b79cf(++_0x40fae5);}(_0xde9a,0x72));var _0xade9=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xde9a[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xade9('0x0'));var util=require(_0xade9('0x1'));var logger=require(_0xade9('0x2'))(_0xade9('0x3'));var moment=require(_0xade9('0x4'));var BPromise=require(_0xade9('0x5'));var rp=require(_0xade9('0x6'));var fs=require('fs');var path=require(_0xade9('0x7'));var rimraf=require(_0xade9('0x8'));var config=require('../../config/environment');var attributes=require(_0xade9('0x9'));module['exports']=function(_0x19ad89,_0x20f226){return _0x19ad89[_0xade9('0xa')](_0xade9('0xb'),attributes,{'tableName':_0xade9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4380=['path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','lodash','../../config/logger','api','moment','request-promise'];(function(_0x4fdaba,_0x5ba5de){var _0x4ead6a=function(_0x360617){while(--_0x360617){_0x4fdaba['push'](_0x4fdaba['shift']());}};_0x4ead6a(++_0x5ba5de);}(_0x4380,0xb6));var _0x0438=function(_0x20e6ba,_0x36bea0){_0x20e6ba=_0x20e6ba-0x0;var _0x248243=_0x4380[_0x20e6ba];return _0x248243;};'use strict';var _=require(_0x0438('0x0'));var util=require('util');var logger=require(_0x0438('0x1'))(_0x0438('0x2'));var moment=require(_0x0438('0x3'));var BPromise=require('bluebird');var rp=require(_0x0438('0x4'));var fs=require('fs');var path=require(_0x0438('0x5'));var rimraf=require(_0x0438('0x6'));var config=require(_0x0438('0x7'));var attributes=require(_0x0438('0x8'));module[_0x0438('0x9')]=function(_0x439287,_0x370ac0){return _0x439287[_0x0438('0xa')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index fe2141c..1e9dffa 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 _0x661c=['SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x41e8c4,_0x30d9ff){var _0x54ffbe=function(_0x4131af){while(--_0x4131af){_0x41e8c4['push'](_0x41e8c4['shift']());}};_0x54ffbe(++_0x30d9ff);}(_0x661c,0x16d));var _0xc661=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x661c[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xc661('0x0'));var util=require('util');var moment=require(_0xc661('0x1'));var BPromise=require(_0xc661('0x2'));var rs=require(_0xc661('0x3'));var fs=require('fs');var Redis=require(_0xc661('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc661('0x5'));var logger=require(_0xc661('0x6'))(_0xc661('0x7'));var config=require(_0xc661('0x8'));var jayson=require(_0xc661('0x9'));var client=jayson[_0xc661('0xa')][_0xc661('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x520620,_0x59a807,_0xc4cba0){return new BPromise(function(_0xebd7,_0x1ef21b){return client['request'](_0x520620,_0xc4cba0)[_0xc661('0xc')](function(_0x483a4b){logger['info'](_0xc661('0xd'),_0x59a807,'request\x20sent');logger[_0xc661('0xe')](_0xc661('0xf'),_0x59a807,_0xc661('0x10'),JSON[_0xc661('0x11')](_0x483a4b));if(_0x483a4b['error']){if(_0x483a4b[_0xc661('0x12')]['code']===0x1f4){logger[_0xc661('0x12')](_0xc661('0xd'),_0x59a807,_0x483a4b['error'][_0xc661('0x13')]);return _0x1ef21b(_0x483a4b[_0xc661('0x12')][_0xc661('0x13')]);}logger[_0xc661('0x12')](_0xc661('0xd'),_0x59a807,_0x483a4b['error'][_0xc661('0x13')]);return _0xebd7(_0x483a4b[_0xc661('0x12')][_0xc661('0x13')]);}else{logger['info'](_0xc661('0xd'),_0x59a807,'request\x20sent');_0xebd7(_0x483a4b['result'][_0xc661('0x13')]);}})[_0xc661('0x14')](function(_0x349fbd){logger['error'](_0xc661('0xd'),_0x59a807,_0x349fbd);_0x1ef21b(_0x349fbd);});});} \ No newline at end of file +var _0x4964=['catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message'];(function(_0x3e56f6,_0xa7a02d){var _0x3a32f=function(_0xb83e52){while(--_0xb83e52){_0x3e56f6['push'](_0x3e56f6['shift']());}};_0x3a32f(++_0xa7a02d);}(_0x4964,0x166));var _0x4496=function(_0x250393,_0x1f7ae1){_0x250393=_0x250393-0x0;var _0x2c1dc5=_0x4964[_0x250393];return _0x2c1dc5;};'use strict';var _=require('lodash');var util=require(_0x4496('0x0'));var moment=require('moment');var BPromise=require(_0x4496('0x1'));var rs=require(_0x4496('0x2'));var fs=require('fs');var Redis=require(_0x4496('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4496('0x4'));var logger=require(_0x4496('0x5'))(_0x4496('0x6'));var config=require('../../config/environment');var jayson=require(_0x4496('0x7'));var client=jayson['client'][_0x4496('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8b1293,_0x438754,_0x55386c){return new BPromise(function(_0x57a8e3,_0x40f2be){return client[_0x4496('0x9')](_0x8b1293,_0x55386c)[_0x4496('0xa')](function(_0x4fa972){logger[_0x4496('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x438754,'request\x20sent');logger[_0x4496('0xc')](_0x4496('0xd'),_0x438754,_0x4496('0xe'),JSON[_0x4496('0xf')](_0x4fa972));if(_0x4fa972[_0x4496('0x10')]){if(_0x4fa972['error'][_0x4496('0x11')]===0x1f4){logger[_0x4496('0x10')](_0x4496('0x12'),_0x438754,_0x4fa972['error'][_0x4496('0x13')]);return _0x40f2be(_0x4fa972['error']['message']);}logger[_0x4496('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x438754,_0x4fa972[_0x4496('0x10')][_0x4496('0x13')]);return _0x57a8e3(_0x4fa972[_0x4496('0x10')][_0x4496('0x13')]);}else{logger[_0x4496('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x438754,'request\x20sent');_0x57a8e3(_0x4fa972['result'][_0x4496('0x13')]);}})[_0x4496('0x14')](function(_0x27f196){logger['error'](_0x4496('0x12'),_0x438754,_0x27f196);_0x40f2be(_0x27f196);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index af9cfa8..a29062b 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 _0x3930=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','get','/:id','show','post'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3930,0x180));var _0x0393=function(_0x508dc5,_0x1aa23c){_0x508dc5=_0x508dc5-0x0;var _0x403554=_0x3930[_0x508dc5];return _0x403554;};'use strict';var multer=require(_0x0393('0x0'));var util=require(_0x0393('0x1'));var path=require(_0x0393('0x2'));var timeout=require(_0x0393('0x3'));var express=require(_0x0393('0x4'));var router=express[_0x0393('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0393('0x6'));var interaction=require(_0x0393('0x7'));var config=require(_0x0393('0x8'));var controller=require(_0x0393('0x9'));router['get']('/',auth[_0x0393('0xa')](),controller['index']);router[_0x0393('0xb')](_0x0393('0xc'),auth[_0x0393('0xa')](),controller[_0x0393('0xd')]);router[_0x0393('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0393('0xf')](_0x0393('0xc'),auth[_0x0393('0xa')](),controller[_0x0393('0x10')]);router[_0x0393('0x11')]('/:id',auth[_0x0393('0xa')](),controller[_0x0393('0x12')]);module['exports']=router; \ No newline at end of file +var _0x8ea9=['delete','destroy','exports','multer','util','path','express','Router','../../config/environment','./intSugarcrmField.controller','get','index','isAuthenticated','post','create','put','/:id'];(function(_0x4303d0,_0x39c397){var _0x46a875=function(_0x3609ae){while(--_0x3609ae){_0x4303d0['push'](_0x4303d0['shift']());}};_0x46a875(++_0x39c397);}(_0x8ea9,0x7a));var _0x98ea=function(_0x3999d6,_0x419279){_0x3999d6=_0x3999d6-0x0;var _0x3c66d5=_0x8ea9[_0x3999d6];return _0x3c66d5;};'use strict';var multer=require(_0x98ea('0x0'));var util=require(_0x98ea('0x1'));var path=require(_0x98ea('0x2'));var timeout=require('connect-timeout');var express=require(_0x98ea('0x3'));var router=express[_0x98ea('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x98ea('0x5'));var controller=require(_0x98ea('0x6'));router[_0x98ea('0x7')]('/',auth['isAuthenticated'](),controller[_0x98ea('0x8')]);router[_0x98ea('0x7')]('/:id',auth[_0x98ea('0x9')](),controller['show']);router[_0x98ea('0xa')]('/',auth[_0x98ea('0x9')](),controller[_0x98ea('0xb')]);router[_0x98ea('0xc')](_0x98ea('0xd'),auth[_0x98ea('0x9')](),controller['update']);router[_0x98ea('0xe')](_0x98ea('0xd'),auth[_0x98ea('0x9')](),controller[_0x98ea('0xf')]);module[_0x98ea('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 9bc494d..907b614 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 _0x2582=['variable','STRING','BOOLEAN','sequelize','ENUM','string','picklist'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x2582,0x1d1));var _0x2258=function(_0x13453e,_0x409732){_0x13453e=_0x13453e-0x0;var _0x19d7ce=_0x2582[_0x13453e];return _0x19d7ce;};'use strict';var Sequelize=require(_0x2258('0x0'));module['exports']={'type':{'type':Sequelize[_0x2258('0x1')](_0x2258('0x2'),'variable','customVariable','keyValue',_0x2258('0x3')),'defaultValue':_0x2258('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2258('0x1')]('string',_0x2258('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2258('0x5')]},'nameField':{'type':Sequelize[_0x2258('0x5')]},'customField':{'type':Sequelize[_0x2258('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2258('0x5')]}}; \ No newline at end of file +var _0x1657=['customVariable','keyValue','picklist','STRING','sequelize','ENUM','string','variable'];(function(_0x2e41e2,_0x4e7250){var _0x2844d6=function(_0x28ce24){while(--_0x28ce24){_0x2e41e2['push'](_0x2e41e2['shift']());}};_0x2844d6(++_0x4e7250);}(_0x1657,0x1cc));var _0x7165=function(_0x37507d,_0x378385){_0x37507d=_0x37507d-0x0;var _0x1cd9ca=_0x1657[_0x37507d];return _0x1cd9ca;};'use strict';var Sequelize=require(_0x7165('0x0'));module['exports']={'type':{'type':Sequelize[_0x7165('0x1')](_0x7165('0x2'),_0x7165('0x3'),_0x7165('0x4'),_0x7165('0x5'),_0x7165('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x7165('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x7165('0x2'),_0x7165('0x3'),_0x7165('0x4'))},'keyContent':{'type':Sequelize[_0x7165('0x7')]},'idField':{'type':Sequelize[_0x7165('0x7')]},'nameField':{'type':Sequelize[_0x7165('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7165('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 1b28220..dbebfa4 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 _0xe449=['ejs','fs-extra','squel','crypto','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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','name','send','index','SugarcrmField','rawAttributes','fieldName','type','key','map','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','params','find','catch','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x483e77,_0x433e9b){var _0x359df0=function(_0x3c3d57){while(--_0x3c3d57){_0x483e77['push'](_0x483e77['shift']());}};_0x359df0(++_0x433e9b);}(_0xe449,0x11b));var _0x9e44=function(_0x18ae8a,_0x247fb8){_0x18ae8a=_0x18ae8a-0x0;var _0x43886e=_0xe449[_0x18ae8a];return _0x43886e;};'use strict';var emlformat=require(_0x9e44('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9e44('0x1'));var rp=require(_0x9e44('0x2'));var moment=require(_0x9e44('0x3'));var BPromise=require(_0x9e44('0x4'));var Mustache=require(_0x9e44('0x5'));var util=require(_0x9e44('0x6'));var path=require(_0x9e44('0x7'));var sox=require('sox');var csv=require(_0x9e44('0x8'));var ejs=require(_0x9e44('0x9'));var fs=require('fs');var fs_extra=require(_0x9e44('0xa'));var _=require('lodash');var squel=require(_0x9e44('0xb'));var crypto=require(_0x9e44('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9e44('0xd'));var toCsv=require(_0x9e44('0x8'));var querystring=require(_0x9e44('0xe'));var Papa=require(_0x9e44('0xf'));var Redis=require(_0x9e44('0x10'));var authService=require(_0x9e44('0x11'));var qs=require(_0x9e44('0x12'));var as=require(_0x9e44('0x13'));var hardwareService=require(_0x9e44('0x14'));var logger=require('../../config/logger')(_0x9e44('0x15'));var utils=require(_0x9e44('0x16'));var config=require(_0x9e44('0x17'));var licenseUtil=require(_0x9e44('0x18'));var db=require(_0x9e44('0x19'))['db'];function respondWithStatusCode(_0x46be93,_0x402b59){_0x402b59=_0x402b59||0xcc;return function(_0x2550dc){if(_0x2550dc){return _0x46be93['sendStatus'](_0x402b59);}return _0x46be93[_0x9e44('0x1a')](_0x402b59)[_0x9e44('0x1b')]();};}function respondWithResult(_0xd4487,_0x2b497e){_0x2b497e=_0x2b497e||0xc8;return function(_0x13aea9){if(_0x13aea9){return _0xd4487[_0x9e44('0x1a')](_0x2b497e)[_0x9e44('0x1c')](_0x13aea9);}};}function respondWithFilteredResult(_0x10b85e,_0x4fb55a){return function(_0x35c086){if(_0x35c086){var _0x27ab6c=typeof _0x4fb55a[_0x9e44('0x1d')]===_0x9e44('0x1e')&&typeof _0x4fb55a[_0x9e44('0x1f')]===_0x9e44('0x1e');var _0x43f570=_0x35c086[_0x9e44('0x20')];var _0x1fc1e6=_0x27ab6c?0x0:_0x4fb55a[_0x9e44('0x1d')];var _0x14c8eb=_0x27ab6c?_0x35c086[_0x9e44('0x20')]:_0x4fb55a['offset']+_0x4fb55a[_0x9e44('0x1f')];var _0x14f358;if(_0x14c8eb>=_0x43f570){_0x14c8eb=_0x43f570;_0x14f358=0xc8;}else{_0x14f358=0xce;}_0x10b85e[_0x9e44('0x1a')](_0x14f358);return _0x10b85e[_0x9e44('0x21')](_0x9e44('0x22'),_0x1fc1e6+'-'+_0x14c8eb+'/'+_0x43f570)[_0x9e44('0x1c')](_0x35c086);}return null;};}function patchUpdates(_0x2f3ce2){return function(_0x3677d9){try{jsonpatch[_0x9e44('0x23')](_0x3677d9,_0x2f3ce2,!![]);}catch(_0x550b74){return BPromise['reject'](_0x550b74);}return _0x3677d9[_0x9e44('0x24')]();};}function saveUpdates(_0x4d7d84,_0x2e0e98){return function(_0x35cbca){if(_0x35cbca){return _0x35cbca[_0x9e44('0x25')](_0x4d7d84)[_0x9e44('0x26')](function(_0x117576){return _0x117576;});}return null;};}function removeEntity(_0x20fcbd,_0x414b1d){return function(_0x132160){if(_0x132160){return _0x132160['destroy']()[_0x9e44('0x26')](function(){_0x20fcbd[_0x9e44('0x1a')](0xcc)[_0x9e44('0x1b')]();});}};}function handleEntityNotFound(_0x37a99d,_0x5f54e3){return function(_0x8149ed){if(!_0x8149ed){_0x37a99d['sendStatus'](0x194);}return _0x8149ed;};}function handleError(_0xce8b3,_0x3c98f1){_0x3c98f1=_0x3c98f1||0x1f4;return function(_0x2109aa){logger['error'](_0x2109aa['stack']);if(_0x2109aa[_0x9e44('0x27')]){delete _0x2109aa[_0x9e44('0x27')];}_0xce8b3[_0x9e44('0x1a')](_0x3c98f1)[_0x9e44('0x28')](_0x2109aa);};}exports[_0x9e44('0x29')]=function(_0x3c4071,_0x295c06){var _0x385926={},_0x4e3ef2={},_0x2785f2={'count':0x0,'rows':[]};var _0x5152b9=_['map'](db[_0x9e44('0x2a')][_0x9e44('0x2b')],function(_0x3f5f63){return{'name':_0x3f5f63[_0x9e44('0x2c')],'type':_0x3f5f63[_0x9e44('0x2d')][_0x9e44('0x2e')]};});_0x4e3ef2['model']=_[_0x9e44('0x2f')](_0x5152b9,_0x9e44('0x27'));_0x4e3ef2['query']=_[_0x9e44('0x30')](_0x3c4071[_0x9e44('0x31')]);_0x4e3ef2['filters']=_[_0x9e44('0x32')](_0x4e3ef2[_0x9e44('0x33')],_0x4e3ef2[_0x9e44('0x31')]);_0x385926['attributes']=_[_0x9e44('0x32')](_0x4e3ef2[_0x9e44('0x33')],qs[_0x9e44('0x34')](_0x3c4071[_0x9e44('0x31')][_0x9e44('0x34')]));_0x385926['attributes']=_0x385926[_0x9e44('0x35')][_0x9e44('0x36')]?_0x385926[_0x9e44('0x35')]:_0x4e3ef2[_0x9e44('0x33')];if(!_0x3c4071['query'][_0x9e44('0x37')](_0x9e44('0x38'))){_0x385926['limit']=qs[_0x9e44('0x1f')](_0x3c4071[_0x9e44('0x31')][_0x9e44('0x1f')]);_0x385926['offset']=qs['offset'](_0x3c4071['query'][_0x9e44('0x1d')]);}_0x385926['order']=qs[_0x9e44('0x39')](_0x3c4071[_0x9e44('0x31')][_0x9e44('0x39')]);_0x385926['where']=qs[_0x9e44('0x3a')](_[_0x9e44('0x3b')](_0x3c4071[_0x9e44('0x31')],_0x4e3ef2['filters']),_0x5152b9);if(_0x3c4071[_0x9e44('0x31')]['filter']){_0x385926[_0x9e44('0x3c')]=_[_0x9e44('0x3d')](_0x385926[_0x9e44('0x3c')],{'$or':_['map'](_0x5152b9,function(_0x10fdc3){if(_0x10fdc3[_0x9e44('0x2d')]!==_0x9e44('0x3e')){var _0xbf4a3e={};_0xbf4a3e[_0x10fdc3[_0x9e44('0x27')]]={'$like':'%'+_0x3c4071[_0x9e44('0x31')][_0x9e44('0x3f')]+'%'};return _0xbf4a3e;}})});}_0x385926=_[_0x9e44('0x3d')]({},_0x385926,_0x3c4071[_0x9e44('0x40')]);var _0x35fa8a={'where':_0x385926[_0x9e44('0x3c')]};return db[_0x9e44('0x2a')]['count'](_0x35fa8a)[_0x9e44('0x26')](function(_0x13658c){_0x2785f2[_0x9e44('0x20')]=_0x13658c;if(_0x3c4071[_0x9e44('0x31')][_0x9e44('0x41')]){_0x385926[_0x9e44('0x42')]=[{'all':!![]}];}return db[_0x9e44('0x2a')][_0x9e44('0x43')](_0x385926);})[_0x9e44('0x26')](function(_0x5430d3){_0x2785f2['rows']=_0x5430d3;return _0x2785f2;})[_0x9e44('0x26')](respondWithFilteredResult(_0x295c06,_0x385926))['catch'](handleError(_0x295c06,null));};exports['show']=function(_0x46a5ef,_0x12ceca){var _0xecf3f7={'raw':!![],'where':{'id':_0x46a5ef[_0x9e44('0x44')]['id']}},_0x1639b8={};_0x1639b8[_0x9e44('0x33')]=_[_0x9e44('0x30')](db[_0x9e44('0x2a')][_0x9e44('0x2b')]);_0x1639b8[_0x9e44('0x31')]=_[_0x9e44('0x30')](_0x46a5ef[_0x9e44('0x31')]);_0x1639b8[_0x9e44('0x3a')]=_['intersection'](_0x1639b8[_0x9e44('0x33')],_0x1639b8[_0x9e44('0x31')]);_0xecf3f7['attributes']=_[_0x9e44('0x32')](_0x1639b8[_0x9e44('0x33')],qs[_0x9e44('0x34')](_0x46a5ef['query'][_0x9e44('0x34')]));_0xecf3f7['attributes']=_0xecf3f7[_0x9e44('0x35')]['length']?_0xecf3f7['attributes']:_0x1639b8['model'];if(_0x46a5ef[_0x9e44('0x31')][_0x9e44('0x41')]){_0xecf3f7[_0x9e44('0x42')]=[{'all':!![]}];}_0xecf3f7=_[_0x9e44('0x3d')]({},_0xecf3f7,_0x46a5ef[_0x9e44('0x40')]);return db[_0x9e44('0x2a')][_0x9e44('0x45')](_0xecf3f7)[_0x9e44('0x26')](handleEntityNotFound(_0x12ceca,null))['then'](respondWithResult(_0x12ceca,null))[_0x9e44('0x46')](handleError(_0x12ceca,null));};exports[_0x9e44('0x47')]=function(_0x7b6f18,_0x396736){return db[_0x9e44('0x2a')][_0x9e44('0x47')](_0x7b6f18['body'],{})[_0x9e44('0x26')](respondWithResult(_0x396736,0xc9))['catch'](handleError(_0x396736,null));};exports[_0x9e44('0x25')]=function(_0x313e95,_0x2f491f){if(_0x313e95[_0x9e44('0x48')]['id']){delete _0x313e95[_0x9e44('0x48')]['id'];}return db[_0x9e44('0x2a')]['find']({'where':{'id':_0x313e95[_0x9e44('0x44')]['id']}})[_0x9e44('0x26')](handleEntityNotFound(_0x2f491f,null))[_0x9e44('0x26')](saveUpdates(_0x313e95[_0x9e44('0x48')],null))[_0x9e44('0x26')](respondWithResult(_0x2f491f,null))['catch'](handleError(_0x2f491f,null));};exports['destroy']=function(_0x361800,_0x599f1b){return db[_0x9e44('0x2a')]['find']({'where':{'id':_0x361800['params']['id']}})[_0x9e44('0x26')](handleEntityNotFound(_0x599f1b,null))['then'](removeEntity(_0x599f1b,null))['catch'](handleError(_0x599f1b,null));}; \ No newline at end of file +var _0x05b3=['intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','SugarcrmField','include','findAll','rows','catch','show','params','keys','options','find','create','body','update','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','reject','save','destroy','then','end','error','name','send','index','map','rawAttributes','fieldName','key','model','query','filters'];(function(_0x1e6b59,_0x5eca5d){var _0x40d7c5=function(_0x2dd544){while(--_0x2dd544){_0x1e6b59['push'](_0x1e6b59['shift']());}};_0x40d7c5(++_0x5eca5d);}(_0x05b3,0x1d0));var _0x305b=function(_0x4eaa4c,_0x2f7422){_0x4eaa4c=_0x4eaa4c-0x0;var _0x15aec6=_0x05b3[_0x4eaa4c];return _0x15aec6;};'use strict';var emlformat=require(_0x305b('0x0'));var rimraf=require(_0x305b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x305b('0x2'));var moment=require('moment');var BPromise=require(_0x305b('0x3'));var Mustache=require(_0x305b('0x4'));var util=require(_0x305b('0x5'));var path=require(_0x305b('0x6'));var sox=require(_0x305b('0x7'));var csv=require(_0x305b('0x8'));var ejs=require(_0x305b('0x9'));var fs=require('fs');var fs_extra=require(_0x305b('0xa'));var _=require(_0x305b('0xb'));var squel=require(_0x305b('0xc'));var crypto=require(_0x305b('0xd'));var jsforce=require(_0x305b('0xe'));var deskjs=require(_0x305b('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x305b('0x10'));var Redis=require(_0x305b('0x11'));var authService=require(_0x305b('0x12'));var qs=require(_0x305b('0x13'));var as=require(_0x305b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x305b('0x15'));var utils=require(_0x305b('0x16'));var config=require(_0x305b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29fd24,_0x5d0798){_0x5d0798=_0x5d0798||0xcc;return function(_0x31b1f8){if(_0x31b1f8){return _0x29fd24[_0x305b('0x18')](_0x5d0798);}return _0x29fd24[_0x305b('0x19')](_0x5d0798)['end']();};}function respondWithResult(_0x5def36,_0x153fd1){_0x153fd1=_0x153fd1||0xc8;return function(_0x14d97f){if(_0x14d97f){return _0x5def36[_0x305b('0x19')](_0x153fd1)[_0x305b('0x1a')](_0x14d97f);}};}function respondWithFilteredResult(_0x279d2a,_0x270bd8){return function(_0x3ce981){if(_0x3ce981){var _0x3f0eda=typeof _0x270bd8['offset']===_0x305b('0x1b')&&typeof _0x270bd8[_0x305b('0x1c')]==='undefined';var _0x44fb41=_0x3ce981[_0x305b('0x1d')];var _0x216a34=_0x3f0eda?0x0:_0x270bd8[_0x305b('0x1e')];var _0x5afe72=_0x3f0eda?_0x3ce981[_0x305b('0x1d')]:_0x270bd8[_0x305b('0x1e')]+_0x270bd8['limit'];var _0x3d6afc;if(_0x5afe72>=_0x44fb41){_0x5afe72=_0x44fb41;_0x3d6afc=0xc8;}else{_0x3d6afc=0xce;}_0x279d2a['status'](_0x3d6afc);return _0x279d2a['set']('Content-Range',_0x216a34+'-'+_0x5afe72+'/'+_0x44fb41)[_0x305b('0x1a')](_0x3ce981);}return null;};}function patchUpdates(_0x31ddf6){return function(_0x15af42){try{jsonpatch['apply'](_0x15af42,_0x31ddf6,!![]);}catch(_0x10d1c4){return BPromise[_0x305b('0x1f')](_0x10d1c4);}return _0x15af42[_0x305b('0x20')]();};}function saveUpdates(_0x45bf62,_0x231d96){return function(_0x4d981c){if(_0x4d981c){return _0x4d981c['update'](_0x45bf62)['then'](function(_0x5952ed){return _0x5952ed;});}return null;};}function removeEntity(_0x35820a,_0x104051){return function(_0x2bb629){if(_0x2bb629){return _0x2bb629[_0x305b('0x21')]()[_0x305b('0x22')](function(){_0x35820a[_0x305b('0x19')](0xcc)[_0x305b('0x23')]();});}};}function handleEntityNotFound(_0x3f5e62,_0xeda069){return function(_0xa47b24){if(!_0xa47b24){_0x3f5e62[_0x305b('0x18')](0x194);}return _0xa47b24;};}function handleError(_0x554c2b,_0x489c2e){_0x489c2e=_0x489c2e||0x1f4;return function(_0x2a754a){logger[_0x305b('0x24')](_0x2a754a['stack']);if(_0x2a754a[_0x305b('0x25')]){delete _0x2a754a[_0x305b('0x25')];}_0x554c2b[_0x305b('0x19')](_0x489c2e)[_0x305b('0x26')](_0x2a754a);};}exports[_0x305b('0x27')]=function(_0x190383,_0x671c6f){var _0x4fe828={},_0x4a809f={},_0x143e95={'count':0x0,'rows':[]};var _0x2b4d0d=_[_0x305b('0x28')](db['SugarcrmField'][_0x305b('0x29')],function(_0x59595a){return{'name':_0x59595a[_0x305b('0x2a')],'type':_0x59595a['type'][_0x305b('0x2b')]};});_0x4a809f[_0x305b('0x2c')]=_[_0x305b('0x28')](_0x2b4d0d,_0x305b('0x25'));_0x4a809f[_0x305b('0x2d')]=_['keys'](_0x190383[_0x305b('0x2d')]);_0x4a809f[_0x305b('0x2e')]=_[_0x305b('0x2f')](_0x4a809f[_0x305b('0x2c')],_0x4a809f['query']);_0x4fe828['attributes']=_[_0x305b('0x2f')](_0x4a809f[_0x305b('0x2c')],qs[_0x305b('0x30')](_0x190383[_0x305b('0x2d')][_0x305b('0x30')]));_0x4fe828[_0x305b('0x31')]=_0x4fe828[_0x305b('0x31')][_0x305b('0x32')]?_0x4fe828[_0x305b('0x31')]:_0x4a809f[_0x305b('0x2c')];if(!_0x190383['query']['hasOwnProperty'](_0x305b('0x33'))){_0x4fe828['limit']=qs[_0x305b('0x1c')](_0x190383[_0x305b('0x2d')]['limit']);_0x4fe828[_0x305b('0x1e')]=qs[_0x305b('0x1e')](_0x190383[_0x305b('0x2d')][_0x305b('0x1e')]);}_0x4fe828[_0x305b('0x34')]=qs[_0x305b('0x35')](_0x190383[_0x305b('0x2d')][_0x305b('0x35')]);_0x4fe828[_0x305b('0x36')]=qs[_0x305b('0x2e')](_[_0x305b('0x37')](_0x190383[_0x305b('0x2d')],_0x4a809f[_0x305b('0x2e')]),_0x2b4d0d);if(_0x190383[_0x305b('0x2d')][_0x305b('0x38')]){_0x4fe828['where']=_[_0x305b('0x39')](_0x4fe828[_0x305b('0x36')],{'$or':_[_0x305b('0x28')](_0x2b4d0d,function(_0x48c8b4){if(_0x48c8b4[_0x305b('0x3a')]!==_0x305b('0x3b')){var _0x4a2a22={};_0x4a2a22[_0x48c8b4[_0x305b('0x25')]]={'$like':'%'+_0x190383[_0x305b('0x2d')][_0x305b('0x38')]+'%'};return _0x4a2a22;}})});}_0x4fe828=_[_0x305b('0x39')]({},_0x4fe828,_0x190383['options']);var _0x125e69={'where':_0x4fe828[_0x305b('0x36')]};return db[_0x305b('0x3c')]['count'](_0x125e69)['then'](function(_0x4ea489){_0x143e95[_0x305b('0x1d')]=_0x4ea489;if(_0x190383['query']['includeAll']){_0x4fe828[_0x305b('0x3d')]=[{'all':!![]}];}return db[_0x305b('0x3c')][_0x305b('0x3e')](_0x4fe828);})[_0x305b('0x22')](function(_0x1c6dc1){_0x143e95[_0x305b('0x3f')]=_0x1c6dc1;return _0x143e95;})[_0x305b('0x22')](respondWithFilteredResult(_0x671c6f,_0x4fe828))[_0x305b('0x40')](handleError(_0x671c6f,null));};exports[_0x305b('0x41')]=function(_0x1f481b,_0x478420){var _0x52787c={'raw':!![],'where':{'id':_0x1f481b[_0x305b('0x42')]['id']}},_0x49be92={};_0x49be92['model']=_[_0x305b('0x43')](db[_0x305b('0x3c')][_0x305b('0x29')]);_0x49be92['query']=_[_0x305b('0x43')](_0x1f481b[_0x305b('0x2d')]);_0x49be92[_0x305b('0x2e')]=_[_0x305b('0x2f')](_0x49be92['model'],_0x49be92[_0x305b('0x2d')]);_0x52787c[_0x305b('0x31')]=_['intersection'](_0x49be92[_0x305b('0x2c')],qs[_0x305b('0x30')](_0x1f481b[_0x305b('0x2d')]['fields']));_0x52787c['attributes']=_0x52787c[_0x305b('0x31')][_0x305b('0x32')]?_0x52787c['attributes']:_0x49be92[_0x305b('0x2c')];if(_0x1f481b[_0x305b('0x2d')]['includeAll']){_0x52787c[_0x305b('0x3d')]=[{'all':!![]}];}_0x52787c=_[_0x305b('0x39')]({},_0x52787c,_0x1f481b[_0x305b('0x44')]);return db[_0x305b('0x3c')][_0x305b('0x45')](_0x52787c)[_0x305b('0x22')](handleEntityNotFound(_0x478420,null))['then'](respondWithResult(_0x478420,null))[_0x305b('0x40')](handleError(_0x478420,null));};exports[_0x305b('0x46')]=function(_0x438d3a,_0x103056){return db['SugarcrmField'][_0x305b('0x46')](_0x438d3a[_0x305b('0x47')],{})[_0x305b('0x22')](respondWithResult(_0x103056,0xc9))[_0x305b('0x40')](handleError(_0x103056,null));};exports[_0x305b('0x48')]=function(_0x329397,_0x393b0f){if(_0x329397[_0x305b('0x47')]['id']){delete _0x329397[_0x305b('0x47')]['id'];}return db[_0x305b('0x3c')]['find']({'where':{'id':_0x329397[_0x305b('0x42')]['id']}})[_0x305b('0x22')](handleEntityNotFound(_0x393b0f,null))[_0x305b('0x22')](saveUpdates(_0x329397['body'],null))[_0x305b('0x22')](respondWithResult(_0x393b0f,null))['catch'](handleError(_0x393b0f,null));};exports[_0x305b('0x21')]=function(_0x41b838,_0x837b31){return db[_0x305b('0x3c')][_0x305b('0x45')]({'where':{'id':_0x41b838['params']['id']}})[_0x305b('0x22')](handleEntityNotFound(_0x837b31,null))[_0x305b('0x22')](removeEntity(_0x837b31,null))[_0x305b('0x40')](handleError(_0x837b31,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 55b644d..d897db2 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 _0x85d4=['api','bluebird','request-promise','path','../../config/environment','exports','define','SugarcrmField','FieldId','lodash','util','../../config/logger'];(function(_0x393fbf,_0x3edc9a){var _0x108b09=function(_0x1c9ceb){while(--_0x1c9ceb){_0x393fbf['push'](_0x393fbf['shift']());}};_0x108b09(++_0x3edc9a);}(_0x85d4,0x17d));var _0x485d=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x85d4[_0x1d9aa0];return _0x226868;};'use strict';var _=require(_0x485d('0x0'));var util=require(_0x485d('0x1'));var logger=require(_0x485d('0x2'))(_0x485d('0x3'));var moment=require('moment');var BPromise=require(_0x485d('0x4'));var rp=require(_0x485d('0x5'));var fs=require('fs');var path=require(_0x485d('0x6'));var rimraf=require('rimraf');var config=require(_0x485d('0x7'));var attributes=require('./intSugarcrmField.attributes');module[_0x485d('0x8')]=function(_0x5d5e6c,_0xc94e2c){return _0x5d5e6c[_0x485d('0x9')](_0x485d('0xa'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0x485d('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc31b=['idField','FieldId','lodash','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField'];(function(_0x2bb57b,_0x502999){var _0x14c763=function(_0x4c11e6){while(--_0x4c11e6){_0x2bb57b['push'](_0x2bb57b['shift']());}};_0x14c763(++_0x502999);}(_0xc31b,0x9e));var _0xbc31=function(_0x1a932a,_0x32363c){_0x1a932a=_0x1a932a-0x0;var _0x41ce15=_0xc31b[_0x1a932a];return _0x41ce15;};'use strict';var _=require(_0xbc31('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbc31('0x1'));var rp=require(_0xbc31('0x2'));var fs=require('fs');var path=require(_0xbc31('0x3'));var rimraf=require(_0xbc31('0x4'));var config=require(_0xbc31('0x5'));var attributes=require(_0xbc31('0x6'));module[_0xbc31('0x7')]=function(_0x39cb7d,_0x1c4432){return _0x39cb7d[_0xbc31('0x8')](_0xbc31('0x9'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xbc31('0xa'),_0xbc31('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 67a9390..f5f83c8 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 _0x302d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x2f15be,_0x111590){var _0x38fbda=function(_0x232912){while(--_0x232912){_0x2f15be['push'](_0x2f15be['shift']());}};_0x38fbda(++_0x111590);}(_0x302d,0x158));var _0xd302=function(_0x32062d,_0x2fa92b){_0x32062d=_0x32062d-0x0;var _0x45ba71=_0x302d[_0x32062d];return _0x45ba71;};'use strict';var _=require(_0xd302('0x0'));var util=require('util');var moment=require(_0xd302('0x1'));var BPromise=require(_0xd302('0x2'));var rs=require(_0xd302('0x3'));var fs=require('fs');var Redis=require(_0xd302('0x4'));var db=require(_0xd302('0x5'))['db'];var utils=require(_0xd302('0x6'));var logger=require(_0xd302('0x7'))(_0xd302('0x8'));var config=require(_0xd302('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd302('0xa')][_0xd302('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b3c49,_0x170341,_0x1aa1b2){return new BPromise(function(_0x2f8faa,_0x3bf832){return client['request'](_0x1b3c49,_0x1aa1b2)[_0xd302('0xc')](function(_0x88046e){logger[_0xd302('0xd')](_0xd302('0xe'),_0x170341,'request\x20sent');logger[_0xd302('0xf')](_0xd302('0x10'),_0x170341,_0xd302('0x11'),JSON[_0xd302('0x12')](_0x88046e));if(_0x88046e[_0xd302('0x13')]){if(_0x88046e[_0xd302('0x13')][_0xd302('0x14')]===0x1f4){logger[_0xd302('0x13')](_0xd302('0xe'),_0x170341,_0x88046e[_0xd302('0x13')][_0xd302('0x15')]);return _0x3bf832(_0x88046e['error'][_0xd302('0x15')]);}logger[_0xd302('0x13')](_0xd302('0xe'),_0x170341,_0x88046e[_0xd302('0x13')][_0xd302('0x15')]);return _0x2f8faa(_0x88046e[_0xd302('0x13')]['message']);}else{logger[_0xd302('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x170341,_0xd302('0x11'));_0x2f8faa(_0x88046e['result'][_0xd302('0x15')]);}})[_0xd302('0x16')](function(_0x4e7513){logger[_0xd302('0x13')](_0xd302('0xe'),_0x170341,_0x4e7513);_0x3bf832(_0x4e7513);});});} \ No newline at end of file +var _0xc49d=['../../config/environment','jayson/promise','http','then','info','SugarcrmField,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4812c9,_0x154b76){var _0x4de61f=function(_0x42cd33){while(--_0x42cd33){_0x4812c9['push'](_0x4812c9['shift']());}};_0x4de61f(++_0x154b76);}(_0xc49d,0x1b1));var _0xdc49=function(_0x3427e8,_0xdef4b1){_0x3427e8=_0x3427e8-0x0;var _0xe29f55=_0xc49d[_0x3427e8];return _0xe29f55;};'use strict';var _=require(_0xdc49('0x0'));var util=require(_0xdc49('0x1'));var moment=require(_0xdc49('0x2'));var BPromise=require(_0xdc49('0x3'));var rs=require(_0xdc49('0x4'));var fs=require('fs');var Redis=require(_0xdc49('0x5'));var db=require(_0xdc49('0x6'))['db'];var utils=require(_0xdc49('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xdc49('0x8'));var jayson=require(_0xdc49('0x9'));var client=jayson['client'][_0xdc49('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x546bb9,_0x90207d,_0x588fba){return new BPromise(function(_0x40bb20,_0x3ac71c){return client['request'](_0x546bb9,_0x588fba)[_0xdc49('0xb')](function(_0x28e322){logger[_0xdc49('0xc')](_0xdc49('0xd'),_0x90207d,'request\x20sent');logger[_0xdc49('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x90207d,'request\x20sent',JSON['stringify'](_0x28e322));if(_0x28e322[_0xdc49('0xf')]){if(_0x28e322[_0xdc49('0xf')][_0xdc49('0x10')]===0x1f4){logger[_0xdc49('0xf')](_0xdc49('0xd'),_0x90207d,_0x28e322[_0xdc49('0xf')][_0xdc49('0x11')]);return _0x3ac71c(_0x28e322['error'][_0xdc49('0x11')]);}logger[_0xdc49('0xf')](_0xdc49('0xd'),_0x90207d,_0x28e322['error'][_0xdc49('0x11')]);return _0x40bb20(_0x28e322[_0xdc49('0xf')]['message']);}else{logger[_0xdc49('0xc')](_0xdc49('0xd'),_0x90207d,_0xdc49('0x12'));_0x40bb20(_0x28e322[_0xdc49('0x13')][_0xdc49('0x11')]);}})[_0xdc49('0x14')](function(_0x5c3a05){logger[_0xdc49('0xf')](_0xdc49('0xd'),_0x90207d,_0x5c3a05);_0x3ac71c(_0x5c3a05);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 5b04553..51c7850 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 _0x579c=['delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id'];(function(_0x514563,_0x1cf4a9){var _0x47dab5=function(_0x3db341){while(--_0x3db341){_0x514563['push'](_0x514563['shift']());}};_0x47dab5(++_0x1cf4a9);}(_0x579c,0xda));var _0xc579=function(_0x3ce250,_0x25bed7){_0x3ce250=_0x3ce250-0x0;var _0xc9244a=_0x579c[_0x3ce250];return _0xc9244a;};'use strict';var multer=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var path=require(_0xc579('0x2'));var timeout=require(_0xc579('0x3'));var express=require(_0xc579('0x4'));var router=express['Router']();var fs_extra=require(_0xc579('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc579('0x6'));var config=require(_0xc579('0x7'));var controller=require(_0xc579('0x8'));router[_0xc579('0x9')]('/',auth[_0xc579('0xa')](),controller[_0xc579('0xb')]);router[_0xc579('0x9')]('/:id',auth[_0xc579('0xa')](),controller[_0xc579('0xc')]);router[_0xc579('0x9')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0xe')]);router[_0xc579('0x9')](_0xc579('0xf'),auth['isAuthenticated'](),controller[_0xc579('0x10')]);router[_0xc579('0x11')]('/',auth[_0xc579('0xa')](),controller[_0xc579('0x12')]);router[_0xc579('0x11')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0x13')]);router[_0xc579('0x14')](_0xc579('0x15'),auth[_0xc579('0xa')](),controller['update']);router[_0xc579('0x16')]('/:id',auth[_0xc579('0xa')](),controller['destroy']);module[_0xc579('0x17')]=router; \ No newline at end of file +var _0x4d33=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','util','connect-timeout'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x4d33,0x1cc));var _0x34d3=function(_0x4d08b8,_0x34c445){_0x4d08b8=_0x4d08b8-0x0;var _0x70214a=_0x4d33[_0x4d08b8];return _0x70214a;};'use strict';var multer=require('multer');var util=require(_0x34d3('0x0'));var path=require('path');var timeout=require(_0x34d3('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x34d3('0x2'));var auth=require(_0x34d3('0x3'));var interaction=require(_0x34d3('0x4'));var config=require(_0x34d3('0x5'));var controller=require(_0x34d3('0x6'));router[_0x34d3('0x7')]('/',auth[_0x34d3('0x8')](),controller['index']);router[_0x34d3('0x7')](_0x34d3('0x9'),auth[_0x34d3('0x8')](),controller[_0x34d3('0xa')]);router['get']('/:id/configurations',auth[_0x34d3('0x8')](),controller['getConfigurations']);router[_0x34d3('0x7')](_0x34d3('0xb'),auth['isAuthenticated'](),controller[_0x34d3('0xc')]);router[_0x34d3('0xd')]('/',auth[_0x34d3('0x8')](),controller[_0x34d3('0xe')]);router[_0x34d3('0xd')](_0x34d3('0xf'),auth['isAuthenticated'](),controller[_0x34d3('0x10')]);router[_0x34d3('0x11')](_0x34d3('0x9'),auth[_0x34d3('0x8')](),controller[_0x34d3('0x12')]);router[_0x34d3('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x34d3('0x14')]);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 abc6d98..837fe92 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 _0x35a8=['STRING','HelpDesk','exports'];(function(_0x5664f8,_0x101e46){var _0x2383f2=function(_0x51c9d2){while(--_0x51c9d2){_0x5664f8['push'](_0x5664f8['shift']());}};_0x2383f2(++_0x101e46);}(_0x35a8,0xa4));var _0x835a=function(_0x447c74,_0x133a19){_0x447c74=_0x447c74-0x0;var _0x380241=_0x35a8[_0x447c74];return _0x380241;};'use strict';var Sequelize=require('sequelize');module[_0x835a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x835a('0x1')]},'username':{'type':Sequelize[_0x835a('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x835a('0x1')],'allowNull':![],'defaultValue':_0x835a('0x2')},'remoteUri':{'type':Sequelize[_0x835a('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x835a('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x835a('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x50a4=['STRING','HelpDesk','sequelize','exports'];(function(_0x2db93c,_0x3bc582){var _0x3c3bb4=function(_0x3f66a3){while(--_0x3f66a3){_0x2db93c['push'](_0x2db93c['shift']());}};_0x3c3bb4(++_0x3bc582);}(_0x50a4,0x156));var _0x450a=function(_0xe3487d,_0x357db7){_0xe3487d=_0xe3487d-0x0;var _0x584936=_0x50a4[_0xe3487d];return _0x584936;};'use strict';var Sequelize=require(_0x450a('0x0'));module[_0x450a('0x1')]={'name':{'type':Sequelize[_0x450a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x450a('0x2')]},'username':{'type':Sequelize[_0x450a('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x450a('0x2')],'allowNull':![],'defaultValue':_0x450a('0x3')},'remoteUri':{'type':Sequelize[_0x450a('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x450a('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x450a('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 45dad50..50ae43b 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 _0xd303=['includes','editable','label','startsWith','picklistValues','value','log','vTiger\x20error:\x20','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','stack','name','send','map','VtigerAccount','rawAttributes','key','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','include','findAll','rows','catch','show','params','model','fields','includeAll','find','create','body','update','destroy','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','moduleName','serverUrl','accessKey','remoteUri','slice','substring','lastIndexOf','format','GET','getchallenge','success','POST','login','token','describe','result','sessionName','autogenerated','reference','owner','remove'];(function(_0x164ef5,_0xba6238){var _0x2d60c5=function(_0x34deca){while(--_0x34deca){_0x164ef5['push'](_0x164ef5['shift']());}};_0x2d60c5(++_0xba6238);}(_0xd303,0x181));var _0x3d30=function(_0x4fb122,_0x38df6a){_0x4fb122=_0x4fb122-0x0;var _0x78527=_0xd303[_0x4fb122];return _0x78527;};'use strict';var emlformat=require(_0x3d30('0x0'));var rimraf=require(_0x3d30('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3d30('0x2'));var rp=require(_0x3d30('0x3'));var moment=require(_0x3d30('0x4'));var BPromise=require(_0x3d30('0x5'));var Mustache=require('mustache');var util=require(_0x3d30('0x6'));var path=require(_0x3d30('0x7'));var sox=require(_0x3d30('0x8'));var csv=require(_0x3d30('0x9'));var ejs=require(_0x3d30('0xa'));var fs=require('fs');var fs_extra=require(_0x3d30('0xb'));var _=require(_0x3d30('0xc'));var squel=require('squel');var crypto=require(_0x3d30('0xd'));var jsforce=require(_0x3d30('0xe'));var deskjs=require(_0x3d30('0xf'));var toCsv=require(_0x3d30('0x9'));var querystring=require('querystring');var Papa=require(_0x3d30('0x10'));var Redis=require('ioredis');var authService=require(_0x3d30('0x11'));var qs=require(_0x3d30('0x12'));var as=require(_0x3d30('0x13'));var hardwareService=require(_0x3d30('0x14'));var logger=require('../../config/logger')(_0x3d30('0x15'));var utils=require(_0x3d30('0x16'));var config=require(_0x3d30('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d30('0x18'))['db'];var integrations=require(_0x3d30('0x19'));function respondWithStatusCode(_0xb86803,_0x189a6e){_0x189a6e=_0x189a6e||0xcc;return function(_0x5b7a50){if(_0x5b7a50){return _0xb86803[_0x3d30('0x1a')](_0x189a6e);}return _0xb86803['status'](_0x189a6e)[_0x3d30('0x1b')]();};}function respondWithResult(_0x24cbdc,_0x13500c){_0x13500c=_0x13500c||0xc8;return function(_0x3d6cc7){if(_0x3d6cc7){return _0x24cbdc[_0x3d30('0x1c')](_0x13500c)[_0x3d30('0x1d')](_0x3d6cc7);}};}function respondWithFilteredResult(_0x5aca34,_0x24a293){return function(_0x1d7fb1){if(_0x1d7fb1){var _0x4a2006=typeof _0x24a293[_0x3d30('0x1e')]===_0x3d30('0x1f')&&typeof _0x24a293['limit']===_0x3d30('0x1f');var _0x51f7bc=_0x1d7fb1[_0x3d30('0x20')];var _0x2ec625=_0x4a2006?0x0:_0x24a293[_0x3d30('0x1e')];var _0x393e93=_0x4a2006?_0x1d7fb1[_0x3d30('0x20')]:_0x24a293[_0x3d30('0x1e')]+_0x24a293[_0x3d30('0x21')];var _0x5b7e73;if(_0x393e93>=_0x51f7bc){_0x393e93=_0x51f7bc;_0x5b7e73=0xc8;}else{_0x5b7e73=0xce;}_0x5aca34['status'](_0x5b7e73);return _0x5aca34[_0x3d30('0x22')](_0x3d30('0x23'),_0x2ec625+'-'+_0x393e93+'/'+_0x51f7bc)[_0x3d30('0x1d')](_0x1d7fb1);}return null;};}function patchUpdates(_0x4b8799){return function(_0x35c8e0){try{jsonpatch[_0x3d30('0x24')](_0x35c8e0,_0x4b8799,!![]);}catch(_0x3cdbb8){return BPromise[_0x3d30('0x25')](_0x3cdbb8);}return _0x35c8e0[_0x3d30('0x26')]();};}function saveUpdates(_0x698e0f,_0x421987){return function(_0x2feb42){if(_0x2feb42){return _0x2feb42['update'](_0x698e0f)[_0x3d30('0x27')](function(_0xa1ffb2){return _0xa1ffb2;});}return null;};}function removeEntity(_0x11d389,_0x29bee8){return function(_0x394839){if(_0x394839){return _0x394839['destroy']()[_0x3d30('0x27')](function(){_0x11d389[_0x3d30('0x1c')](0xcc)[_0x3d30('0x1b')]();});}};}function handleEntityNotFound(_0x49b75d,_0xa81ebb){return function(_0x6fb75c){if(!_0x6fb75c){_0x49b75d[_0x3d30('0x1a')](0x194);}return _0x6fb75c;};}function handleError(_0x16327c,_0x2dfdb3){_0x2dfdb3=_0x2dfdb3||0x1f4;return function(_0x243dc5){logger['error'](_0x243dc5[_0x3d30('0x28')]);if(_0x243dc5['name']){delete _0x243dc5[_0x3d30('0x29')];}_0x16327c[_0x3d30('0x1c')](_0x2dfdb3)[_0x3d30('0x2a')](_0x243dc5);};}exports['index']=function(_0x4aa882,_0x3db689){var _0x14a963={},_0x15487f={},_0x30db3e={'count':0x0,'rows':[]};var _0x41c31d=_[_0x3d30('0x2b')](db[_0x3d30('0x2c')][_0x3d30('0x2d')],function(_0x51d463){return{'name':_0x51d463['fieldName'],'type':_0x51d463['type'][_0x3d30('0x2e')]};});_0x15487f['model']=_[_0x3d30('0x2b')](_0x41c31d,'name');_0x15487f[_0x3d30('0x2f')]=_[_0x3d30('0x30')](_0x4aa882[_0x3d30('0x2f')]);_0x15487f[_0x3d30('0x31')]=_[_0x3d30('0x32')](_0x15487f['model'],_0x15487f[_0x3d30('0x2f')]);_0x14a963[_0x3d30('0x33')]=_[_0x3d30('0x32')](_0x15487f['model'],qs['fields'](_0x4aa882[_0x3d30('0x2f')]['fields']));_0x14a963['attributes']=_0x14a963[_0x3d30('0x33')][_0x3d30('0x34')]?_0x14a963['attributes']:_0x15487f['model'];if(!_0x4aa882[_0x3d30('0x2f')][_0x3d30('0x35')](_0x3d30('0x36'))){_0x14a963['limit']=qs[_0x3d30('0x21')](_0x4aa882[_0x3d30('0x2f')]['limit']);_0x14a963[_0x3d30('0x1e')]=qs[_0x3d30('0x1e')](_0x4aa882[_0x3d30('0x2f')][_0x3d30('0x1e')]);}_0x14a963[_0x3d30('0x37')]=qs[_0x3d30('0x38')](_0x4aa882[_0x3d30('0x2f')][_0x3d30('0x38')]);_0x14a963['where']=qs[_0x3d30('0x31')](_[_0x3d30('0x39')](_0x4aa882[_0x3d30('0x2f')],_0x15487f[_0x3d30('0x31')]),_0x41c31d);if(_0x4aa882[_0x3d30('0x2f')][_0x3d30('0x3a')]){_0x14a963[_0x3d30('0x3b')]=_[_0x3d30('0x3c')](_0x14a963[_0x3d30('0x3b')],{'$or':_[_0x3d30('0x2b')](_0x41c31d,function(_0x8918b2){if(_0x8918b2[_0x3d30('0x3d')]!=='VIRTUAL'){var _0x1b9821={};_0x1b9821[_0x8918b2[_0x3d30('0x29')]]={'$like':'%'+_0x4aa882['query']['filter']+'%'};return _0x1b9821;}})});}_0x14a963=_['merge']({},_0x14a963,_0x4aa882[_0x3d30('0x3e')]);var _0x4d2aa6={'where':_0x14a963[_0x3d30('0x3b')]};return db['VtigerAccount'][_0x3d30('0x20')](_0x4d2aa6)['then'](function(_0xcd229){_0x30db3e[_0x3d30('0x20')]=_0xcd229;if(_0x4aa882[_0x3d30('0x2f')]['includeAll']){_0x14a963[_0x3d30('0x3f')]=[{'all':!![]}];}return db[_0x3d30('0x2c')][_0x3d30('0x40')](_0x14a963);})['then'](function(_0x1af060){_0x30db3e[_0x3d30('0x41')]=_0x1af060;return _0x30db3e;})[_0x3d30('0x27')](respondWithFilteredResult(_0x3db689,_0x14a963))[_0x3d30('0x42')](handleError(_0x3db689,null));};exports[_0x3d30('0x43')]=function(_0x4bc34a,_0x53cf5b){var _0x4d5541={'raw':![],'where':{'id':_0x4bc34a[_0x3d30('0x44')]['id']}},_0x2054b1={};_0x2054b1[_0x3d30('0x45')]=_[_0x3d30('0x30')](db[_0x3d30('0x2c')][_0x3d30('0x2d')]);_0x2054b1[_0x3d30('0x2f')]=_[_0x3d30('0x30')](_0x4bc34a[_0x3d30('0x2f')]);_0x2054b1[_0x3d30('0x31')]=_[_0x3d30('0x32')](_0x2054b1['model'],_0x2054b1[_0x3d30('0x2f')]);_0x4d5541[_0x3d30('0x33')]=_[_0x3d30('0x32')](_0x2054b1[_0x3d30('0x45')],qs[_0x3d30('0x46')](_0x4bc34a[_0x3d30('0x2f')][_0x3d30('0x46')]));_0x4d5541[_0x3d30('0x33')]=_0x4d5541[_0x3d30('0x33')][_0x3d30('0x34')]?_0x4d5541[_0x3d30('0x33')]:_0x2054b1[_0x3d30('0x45')];if(_0x4bc34a[_0x3d30('0x2f')][_0x3d30('0x47')]){_0x4d5541[_0x3d30('0x3f')]=[{'all':!![]}];}_0x4d5541=_[_0x3d30('0x3c')]({},_0x4d5541,_0x4bc34a[_0x3d30('0x3e')]);return db[_0x3d30('0x2c')][_0x3d30('0x48')](_0x4d5541)[_0x3d30('0x27')](handleEntityNotFound(_0x53cf5b,null))['then'](respondWithResult(_0x53cf5b,null))[_0x3d30('0x42')](handleError(_0x53cf5b,null));};exports[_0x3d30('0x49')]=function(_0x80f43b,_0x2fa82b){return db[_0x3d30('0x2c')][_0x3d30('0x49')](_0x80f43b[_0x3d30('0x4a')],{})['then'](respondWithResult(_0x2fa82b,0xc9))[_0x3d30('0x42')](handleError(_0x2fa82b,null));};exports[_0x3d30('0x4b')]=function(_0x41b02c,_0x72a507){if(_0x41b02c[_0x3d30('0x4a')]['id']){delete _0x41b02c[_0x3d30('0x4a')]['id'];}return db[_0x3d30('0x2c')]['find']({'where':{'id':_0x41b02c[_0x3d30('0x44')]['id']}})[_0x3d30('0x27')](handleEntityNotFound(_0x72a507,null))['then'](saveUpdates(_0x41b02c[_0x3d30('0x4a')],null))[_0x3d30('0x27')](respondWithResult(_0x72a507,null))[_0x3d30('0x42')](handleError(_0x72a507,null));};exports[_0x3d30('0x4c')]=function(_0x1e64e4,_0x50ea53){return db[_0x3d30('0x2c')][_0x3d30('0x48')]({'where':{'id':_0x1e64e4[_0x3d30('0x44')]['id']}})['then'](handleEntityNotFound(_0x50ea53,null))[_0x3d30('0x27')](removeEntity(_0x50ea53,null))[_0x3d30('0x42')](handleError(_0x50ea53,null));};exports[_0x3d30('0x4d')]=function(_0x5d8a06,_0x3f3a90,_0x1ebab8){var _0x23b044={};var _0x22814b={};var _0x26548a;var _0xd7252b;return db[_0x3d30('0x2c')]['findOne']({'where':{'id':_0x5d8a06[_0x3d30('0x44')]['id']}})['then'](handleEntityNotFound(_0x3f3a90,null))[_0x3d30('0x27')](function(_0x1ebca5){if(_0x1ebca5){_0x26548a=_0x1ebca5;_0x22814b[_0x3d30('0x45')]=_[_0x3d30('0x30')](db['VtigerConfiguration'][_0x3d30('0x2d')]);_0x22814b[_0x3d30('0x2f')]=_[_0x3d30('0x30')](_0x5d8a06[_0x3d30('0x2f')]);_0x22814b['filters']=_[_0x3d30('0x32')](_0x22814b['model'],_0x22814b[_0x3d30('0x2f')]);_0x23b044['attributes']=_['intersection'](_0x22814b[_0x3d30('0x45')],qs['fields'](_0x5d8a06[_0x3d30('0x2f')]['fields']));_0x23b044['attributes']=_0x23b044['attributes'][_0x3d30('0x34')]?_0x23b044[_0x3d30('0x33')]:_0x22814b[_0x3d30('0x45')];_0x23b044[_0x3d30('0x37')]=qs['sort'](_0x5d8a06[_0x3d30('0x2f')][_0x3d30('0x38')]);_0x23b044[_0x3d30('0x3b')]=qs['filters'](_[_0x3d30('0x39')](_0x5d8a06['query'],_0x22814b[_0x3d30('0x31')]));if(_0x5d8a06[_0x3d30('0x2f')]['filter']){_0x23b044['where']=_[_0x3d30('0x3c')](_0x23b044['where'],{'$or':_[_0x3d30('0x2b')](_0x23b044[_0x3d30('0x33')],function(_0x27d7e5){var _0x3139eb={};_0x3139eb[_0x27d7e5]={'$like':'%'+_0x5d8a06['query']['filter']+'%'};return _0x3139eb;})});}_0x23b044=_[_0x3d30('0x3c')]({},_0x23b044,_0x5d8a06[_0x3d30('0x3e')]);return _0x26548a[_0x3d30('0x4d')](_0x23b044);}})['then'](function(_0x35cf03){if(_0x35cf03){_0xd7252b=_0x35cf03[_0x3d30('0x34')];if(!_0x5d8a06[_0x3d30('0x2f')][_0x3d30('0x35')](_0x3d30('0x36'))){_0x23b044[_0x3d30('0x21')]=qs[_0x3d30('0x21')](_0x5d8a06[_0x3d30('0x2f')][_0x3d30('0x21')]);_0x23b044[_0x3d30('0x1e')]=qs['offset'](_0x5d8a06[_0x3d30('0x2f')][_0x3d30('0x1e')]);}return _0x26548a[_0x3d30('0x4d')](_0x23b044);}})['then'](function(_0x53def0){if(_0x53def0){return _0x53def0?{'count':_0xd7252b,'rows':_0x53def0}:null;}})[_0x3d30('0x27')](respondWithResult(_0x3f3a90,null))[_0x3d30('0x42')](handleError(_0x3f3a90,null));};exports[_0x3d30('0x4e')]=function(_0x1fbd47,_0x3b2fee,_0x36713c){if(_0x1fbd47[_0x3d30('0x4a')]['id']){delete _0x1fbd47[_0x3d30('0x4a')]['id'];}return db[_0x3d30('0x2c')][_0x3d30('0x4f')]({'where':{'id':_0x1fbd47[_0x3d30('0x44')]['id']}})[_0x3d30('0x27')](handleEntityNotFound(_0x3b2fee,null))[_0x3d30('0x27')](function(_0x54bf54){if(_0x54bf54){_0x1fbd47[_0x3d30('0x4a')][_0x3d30('0x50')]=_0x54bf54['id'];_0x1fbd47['body'][_0x3d30('0x51')]=integrations[_0x3d30('0x52')](_0x1fbd47[_0x3d30('0x4a')][_0x3d30('0x53')],_0x1fbd47[_0x3d30('0x4a')][_0x3d30('0x3d')]);_0x1fbd47[_0x3d30('0x4a')][_0x3d30('0x54')]=integrations[_0x3d30('0x55')](_0x1fbd47[_0x3d30('0x4a')][_0x3d30('0x53')],_0x1fbd47['body'][_0x3d30('0x3d')]);return db['VtigerConfiguration']['create'](_0x1fbd47['body'],{'include':[{'model':db['VtigerField'],'as':_0x3d30('0x51')},{'model':db[_0x3d30('0x56')],'as':_0x3d30('0x54')}]});}return null;})[_0x3d30('0x27')](respondWithResult(_0x3b2fee,null))[_0x3d30('0x42')](handleError(_0x3b2fee,null));};var md5=require(_0x3d30('0x57'));exports[_0x3d30('0x58')]=function(_0x333f42,_0x213134,_0x2b3277){var _0x5656ab=null;var _0x561715=null;var _0x5c2006=null;var _0x39a8b2=null;var _0x32624a='';return db[_0x3d30('0x2c')][_0x3d30('0x4f')]({'where':{'id':_0x333f42[_0x3d30('0x44')]['id']},'attributes':['id',_0x3d30('0x29'),_0x3d30('0x59'),'description',_0x3d30('0x5a'),'remoteUri',_0x3d30('0x5b'),_0x3d30('0x5c')]})[_0x3d30('0x27')](handleEntityNotFound(_0x213134,null))[_0x3d30('0x27')](function(_0xc34053){if(_0xc34053){_0x5656ab=_0xc34053['username'];_0x561715=_0xc34053['accessKey'];_0x5c2006=_0xc34053[_0x3d30('0x5a')];_0x32624a=_0xc34053[_0x3d30('0x5d')];var _0x2799c1=_0x32624a[_0x3d30('0x5e')](-0x1);if(_0x2799c1==='/'){_0x32624a=_0x32624a[_0x3d30('0x5f')](0x0,_0x32624a[_0x3d30('0x60')](_0x2799c1));}_0x39a8b2=util[_0x3d30('0x61')]('%s/webservice.php',_0x32624a);var _0x374c4f={'method':_0x3d30('0x62'),'uri':_0x39a8b2,'qs':{'operation':_0x3d30('0x63'),'username':_0xc34053['username']},'json':!![]};return rp(_0x374c4f);}})[_0x3d30('0x27')](function(_0x40f759){if(_0x40f759[_0x3d30('0x64')]){var _0x3c2f44={'method':_0x3d30('0x65'),'uri':_0x39a8b2,'form':{'operation':_0x3d30('0x66'),'username':_0x5656ab,'accessKey':md5(_0x40f759['result'][_0x3d30('0x67')]+_0x561715)},'json':!![]};return rp(_0x3c2f44);}})[_0x3d30('0x27')](function(_0x2d697c){if(_0x2d697c['success']){var _0x22f5db={'method':_0x3d30('0x62'),'uri':_0x39a8b2,'qs':{'operation':_0x3d30('0x68'),'username':_0x5656ab,'sessionName':_0x2d697c[_0x3d30('0x69')][_0x3d30('0x6a')],'elementType':_0x5c2006},'json':!![]};return rp(_0x22f5db);}})[_0x3d30('0x27')](function(_0x567b5d){if(_0x567b5d['success']){var _0x3d12b4=[_0x3d30('0x6b'),_0x3d30('0x6c'),_0x3d30('0x6d')];_[_0x3d30('0x6e')](_0x567b5d['result']['fields'],function(_0x530bac){return _0x3d12b4[_0x3d30('0x6f')](_0x530bac[_0x3d30('0x3d')][_0x3d30('0x29')]);});_['remove'](_0x567b5d['result'][_0x3d30('0x46')],function(_0x5f31a2){return _0x5f31a2[_0x3d30('0x70')]==='false';});return{'count':_0x567b5d[_0x3d30('0x69')][_0x3d30('0x46')][_0x3d30('0x34')],'rows':_[_0x3d30('0x2b')](_0x567b5d[_0x3d30('0x69')][_0x3d30('0x46')],function(_0x20ece6){return{'id':_0x20ece6[_0x3d30('0x29')],'name':_0x20ece6[_0x3d30('0x71')],'custom':_[_0x3d30('0x72')](_0x20ece6[_0x3d30('0x29')],'cf_')?!![]:![],'options':_0x20ece6[_0x3d30('0x3d')][_0x3d30('0x29')]==='picklist'&&_0x20ece6['type'][_0x3d30('0x73')]['length']>0x0?_[_0x3d30('0x2b')](_0x20ece6['type'][_0x3d30('0x73')],function(_0x1e8bfb){return{'name':_0x1e8bfb[_0x3d30('0x71')],'value':_0x1e8bfb[_0x3d30('0x74')]};}):[]};})};}})[_0x3d30('0x27')](respondWithResult(_0x213134,null))[_0x3d30('0x42')](function(_0x5c0565){console[_0x3d30('0x75')](_0x3d30('0x76')+_0x5c0565);var _0x26c0ea=_0x333f42['query']['test']?0x1f4:_0x5c0565[_0x3d30('0x77')]||0x1f4;logger[_0x3d30('0x78')](_0x3d30('0x79'),'getFields',_0x26c0ea,JSON[_0x3d30('0x7a')](_0x5c0565));delete _0x5c0565[_0x3d30('0x29')];if(_0x26c0ea===0x191){_0x26c0ea=0x190;}_0x213134['status'](_0x26c0ea)[_0x3d30('0x2a')](_0x333f42[_0x3d30('0x2f')][_0x3d30('0x7b')]?{'message':'Wrong\x20credentials','statusCode':_0x5c0565['statusCode']}:_0x5c0565);});}; \ No newline at end of file +var _0xfdf1=['destroy','end','sendStatus','name','send','index','map','VtigerAccount','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','create','body','update','find','getConfigurations','findOne','keys','VtigerConfiguration','filter','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerField','getFields','username','description','moduleName','serverUrl','accessKey','remoteUri','slice','substring','%s/webservice.php','getchallenge','success','login','result','token','GET','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','false','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','reject','then'];(function(_0x325539,_0x36ad8f){var _0x47401d=function(_0x7ed46c){while(--_0x7ed46c){_0x325539['push'](_0x325539['shift']());}};_0x47401d(++_0x36ad8f);}(_0xfdf1,0x14a));var _0x1fdf=function(_0x1e1411,_0x545c3a){_0x1e1411=_0x1e1411-0x0;var _0x5920f1=_0xfdf1[_0x1e1411];return _0x5920f1;};'use strict';var emlformat=require(_0x1fdf('0x0'));var rimraf=require(_0x1fdf('0x1'));var zipdir=require(_0x1fdf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1fdf('0x3'));var moment=require(_0x1fdf('0x4'));var BPromise=require(_0x1fdf('0x5'));var Mustache=require(_0x1fdf('0x6'));var util=require(_0x1fdf('0x7'));var path=require(_0x1fdf('0x8'));var sox=require(_0x1fdf('0x9'));var csv=require(_0x1fdf('0xa'));var ejs=require(_0x1fdf('0xb'));var fs=require('fs');var fs_extra=require(_0x1fdf('0xc'));var _=require(_0x1fdf('0xd'));var squel=require(_0x1fdf('0xe'));var crypto=require(_0x1fdf('0xf'));var jsforce=require(_0x1fdf('0x10'));var deskjs=require(_0x1fdf('0x11'));var toCsv=require(_0x1fdf('0xa'));var querystring=require(_0x1fdf('0x12'));var Papa=require('papaparse');var Redis=require(_0x1fdf('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x1fdf('0x14'));var as=require(_0x1fdf('0x15'));var hardwareService=require(_0x1fdf('0x16'));var logger=require(_0x1fdf('0x17'))(_0x1fdf('0x18'));var utils=require(_0x1fdf('0x19'));var config=require(_0x1fdf('0x1a'));var licenseUtil=require(_0x1fdf('0x1b'));var db=require(_0x1fdf('0x1c'))['db'];var integrations=require(_0x1fdf('0x1d'));function respondWithStatusCode(_0xf66176,_0x2e556a){_0x2e556a=_0x2e556a||0xcc;return function(_0xc39816){if(_0xc39816){return _0xf66176['sendStatus'](_0x2e556a);}return _0xf66176[_0x1fdf('0x1e')](_0x2e556a)['end']();};}function respondWithResult(_0x3346d2,_0x2c5d3d){_0x2c5d3d=_0x2c5d3d||0xc8;return function(_0x85856a){if(_0x85856a){return _0x3346d2[_0x1fdf('0x1e')](_0x2c5d3d)[_0x1fdf('0x1f')](_0x85856a);}};}function respondWithFilteredResult(_0x254a24,_0x50f1ba){return function(_0x538383){if(_0x538383){var _0x46529a=typeof _0x50f1ba[_0x1fdf('0x20')]===_0x1fdf('0x21')&&typeof _0x50f1ba[_0x1fdf('0x22')]===_0x1fdf('0x21');var _0x32c906=_0x538383[_0x1fdf('0x23')];var _0x5d8e23=_0x46529a?0x0:_0x50f1ba[_0x1fdf('0x20')];var _0x5a791a=_0x46529a?_0x538383[_0x1fdf('0x23')]:_0x50f1ba[_0x1fdf('0x20')]+_0x50f1ba[_0x1fdf('0x22')];var _0x16d561;if(_0x5a791a>=_0x32c906){_0x5a791a=_0x32c906;_0x16d561=0xc8;}else{_0x16d561=0xce;}_0x254a24['status'](_0x16d561);return _0x254a24[_0x1fdf('0x24')]('Content-Range',_0x5d8e23+'-'+_0x5a791a+'/'+_0x32c906)[_0x1fdf('0x1f')](_0x538383);}return null;};}function patchUpdates(_0x5733d4){return function(_0x2d6df2){try{jsonpatch['apply'](_0x2d6df2,_0x5733d4,!![]);}catch(_0x1100e2){return BPromise[_0x1fdf('0x25')](_0x1100e2);}return _0x2d6df2['save']();};}function saveUpdates(_0x4f3c75,_0x471081){return function(_0x2e3ed2){if(_0x2e3ed2){return _0x2e3ed2['update'](_0x4f3c75)[_0x1fdf('0x26')](function(_0x4ec686){return _0x4ec686;});}return null;};}function removeEntity(_0xb5947b,_0x38cfa4){return function(_0xbfad16){if(_0xbfad16){return _0xbfad16[_0x1fdf('0x27')]()[_0x1fdf('0x26')](function(){_0xb5947b[_0x1fdf('0x1e')](0xcc)[_0x1fdf('0x28')]();});}};}function handleEntityNotFound(_0x3ec701,_0x2337f2){return function(_0x4d6c95){if(!_0x4d6c95){_0x3ec701[_0x1fdf('0x29')](0x194);}return _0x4d6c95;};}function handleError(_0xdff439,_0x1f7f93){_0x1f7f93=_0x1f7f93||0x1f4;return function(_0x416aee){logger['error'](_0x416aee['stack']);if(_0x416aee[_0x1fdf('0x2a')]){delete _0x416aee[_0x1fdf('0x2a')];}_0xdff439['status'](_0x1f7f93)[_0x1fdf('0x2b')](_0x416aee);};}exports[_0x1fdf('0x2c')]=function(_0x38b76a,_0x4486fb){var _0x1b70de={},_0x25f9ca={},_0x32ae45={'count':0x0,'rows':[]};var _0x3a5a35=_[_0x1fdf('0x2d')](db[_0x1fdf('0x2e')]['rawAttributes'],function(_0x31d335){return{'name':_0x31d335[_0x1fdf('0x2f')],'type':_0x31d335[_0x1fdf('0x30')][_0x1fdf('0x31')]};});_0x25f9ca[_0x1fdf('0x32')]=_['map'](_0x3a5a35,_0x1fdf('0x2a'));_0x25f9ca[_0x1fdf('0x33')]=_['keys'](_0x38b76a[_0x1fdf('0x33')]);_0x25f9ca['filters']=_[_0x1fdf('0x34')](_0x25f9ca['model'],_0x25f9ca[_0x1fdf('0x33')]);_0x1b70de[_0x1fdf('0x35')]=_[_0x1fdf('0x34')](_0x25f9ca[_0x1fdf('0x32')],qs[_0x1fdf('0x36')](_0x38b76a[_0x1fdf('0x33')][_0x1fdf('0x36')]));_0x1b70de[_0x1fdf('0x35')]=_0x1b70de['attributes'][_0x1fdf('0x37')]?_0x1b70de[_0x1fdf('0x35')]:_0x25f9ca[_0x1fdf('0x32')];if(!_0x38b76a[_0x1fdf('0x33')][_0x1fdf('0x38')](_0x1fdf('0x39'))){_0x1b70de[_0x1fdf('0x22')]=qs[_0x1fdf('0x22')](_0x38b76a['query'][_0x1fdf('0x22')]);_0x1b70de[_0x1fdf('0x20')]=qs['offset'](_0x38b76a[_0x1fdf('0x33')]['offset']);}_0x1b70de[_0x1fdf('0x3a')]=qs[_0x1fdf('0x3b')](_0x38b76a[_0x1fdf('0x33')]['sort']);_0x1b70de[_0x1fdf('0x3c')]=qs['filters'](_[_0x1fdf('0x3d')](_0x38b76a[_0x1fdf('0x33')],_0x25f9ca[_0x1fdf('0x3e')]),_0x3a5a35);if(_0x38b76a[_0x1fdf('0x33')]['filter']){_0x1b70de[_0x1fdf('0x3c')]=_[_0x1fdf('0x3f')](_0x1b70de[_0x1fdf('0x3c')],{'$or':_['map'](_0x3a5a35,function(_0xd27e1c){if(_0xd27e1c[_0x1fdf('0x30')]!=='VIRTUAL'){var _0x528b35={};_0x528b35[_0xd27e1c['name']]={'$like':'%'+_0x38b76a['query']['filter']+'%'};return _0x528b35;}})});}_0x1b70de=_[_0x1fdf('0x3f')]({},_0x1b70de,_0x38b76a[_0x1fdf('0x40')]);var _0x45e69f={'where':_0x1b70de[_0x1fdf('0x3c')]};return db[_0x1fdf('0x2e')][_0x1fdf('0x23')](_0x45e69f)[_0x1fdf('0x26')](function(_0x30a8ba){_0x32ae45[_0x1fdf('0x23')]=_0x30a8ba;if(_0x38b76a[_0x1fdf('0x33')][_0x1fdf('0x41')]){_0x1b70de[_0x1fdf('0x42')]=[{'all':!![]}];}return db[_0x1fdf('0x2e')][_0x1fdf('0x43')](_0x1b70de);})[_0x1fdf('0x26')](function(_0x3aa0fb){_0x32ae45[_0x1fdf('0x44')]=_0x3aa0fb;return _0x32ae45;})['then'](respondWithFilteredResult(_0x4486fb,_0x1b70de))[_0x1fdf('0x45')](handleError(_0x4486fb,null));};exports['show']=function(_0x5367ae,_0x35f176){var _0x2a7884={'raw':![],'where':{'id':_0x5367ae[_0x1fdf('0x46')]['id']}},_0x34a841={};_0x34a841['model']=_['keys'](db['VtigerAccount'][_0x1fdf('0x47')]);_0x34a841['query']=_['keys'](_0x5367ae[_0x1fdf('0x33')]);_0x34a841['filters']=_[_0x1fdf('0x34')](_0x34a841[_0x1fdf('0x32')],_0x34a841['query']);_0x2a7884[_0x1fdf('0x35')]=_['intersection'](_0x34a841[_0x1fdf('0x32')],qs[_0x1fdf('0x36')](_0x5367ae['query'][_0x1fdf('0x36')]));_0x2a7884[_0x1fdf('0x35')]=_0x2a7884[_0x1fdf('0x35')][_0x1fdf('0x37')]?_0x2a7884[_0x1fdf('0x35')]:_0x34a841[_0x1fdf('0x32')];if(_0x5367ae[_0x1fdf('0x33')]['includeAll']){_0x2a7884[_0x1fdf('0x42')]=[{'all':!![]}];}_0x2a7884=_['merge']({},_0x2a7884,_0x5367ae['options']);return db[_0x1fdf('0x2e')]['find'](_0x2a7884)[_0x1fdf('0x26')](handleEntityNotFound(_0x35f176,null))['then'](respondWithResult(_0x35f176,null))[_0x1fdf('0x45')](handleError(_0x35f176,null));};exports[_0x1fdf('0x48')]=function(_0x4031ed,_0x2a349c){return db[_0x1fdf('0x2e')][_0x1fdf('0x48')](_0x4031ed[_0x1fdf('0x49')],{})[_0x1fdf('0x26')](respondWithResult(_0x2a349c,0xc9))[_0x1fdf('0x45')](handleError(_0x2a349c,null));};exports[_0x1fdf('0x4a')]=function(_0x31db01,_0x281045){if(_0x31db01[_0x1fdf('0x49')]['id']){delete _0x31db01['body']['id'];}return db['VtigerAccount'][_0x1fdf('0x4b')]({'where':{'id':_0x31db01[_0x1fdf('0x46')]['id']}})[_0x1fdf('0x26')](handleEntityNotFound(_0x281045,null))[_0x1fdf('0x26')](saveUpdates(_0x31db01[_0x1fdf('0x49')],null))[_0x1fdf('0x26')](respondWithResult(_0x281045,null))[_0x1fdf('0x45')](handleError(_0x281045,null));};exports['destroy']=function(_0x2f5ffd,_0x136728){return db[_0x1fdf('0x2e')][_0x1fdf('0x4b')]({'where':{'id':_0x2f5ffd['params']['id']}})['then'](handleEntityNotFound(_0x136728,null))[_0x1fdf('0x26')](removeEntity(_0x136728,null))['catch'](handleError(_0x136728,null));};exports[_0x1fdf('0x4c')]=function(_0x5085f0,_0x59eb27,_0x5f4365){var _0x1ad5a8={};var _0x404d4b={};var _0x2708a8;var _0x4cf99b;return db[_0x1fdf('0x2e')][_0x1fdf('0x4d')]({'where':{'id':_0x5085f0['params']['id']}})[_0x1fdf('0x26')](handleEntityNotFound(_0x59eb27,null))[_0x1fdf('0x26')](function(_0x27f4b9){if(_0x27f4b9){_0x2708a8=_0x27f4b9;_0x404d4b['model']=_[_0x1fdf('0x4e')](db[_0x1fdf('0x4f')][_0x1fdf('0x47')]);_0x404d4b[_0x1fdf('0x33')]=_[_0x1fdf('0x4e')](_0x5085f0[_0x1fdf('0x33')]);_0x404d4b[_0x1fdf('0x3e')]=_[_0x1fdf('0x34')](_0x404d4b[_0x1fdf('0x32')],_0x404d4b[_0x1fdf('0x33')]);_0x1ad5a8[_0x1fdf('0x35')]=_[_0x1fdf('0x34')](_0x404d4b[_0x1fdf('0x32')],qs[_0x1fdf('0x36')](_0x5085f0[_0x1fdf('0x33')][_0x1fdf('0x36')]));_0x1ad5a8[_0x1fdf('0x35')]=_0x1ad5a8[_0x1fdf('0x35')][_0x1fdf('0x37')]?_0x1ad5a8[_0x1fdf('0x35')]:_0x404d4b[_0x1fdf('0x32')];_0x1ad5a8['order']=qs['sort'](_0x5085f0[_0x1fdf('0x33')][_0x1fdf('0x3b')]);_0x1ad5a8[_0x1fdf('0x3c')]=qs[_0x1fdf('0x3e')](_[_0x1fdf('0x3d')](_0x5085f0[_0x1fdf('0x33')],_0x404d4b[_0x1fdf('0x3e')]));if(_0x5085f0['query'][_0x1fdf('0x50')]){_0x1ad5a8[_0x1fdf('0x3c')]=_[_0x1fdf('0x3f')](_0x1ad5a8['where'],{'$or':_[_0x1fdf('0x2d')](_0x1ad5a8[_0x1fdf('0x35')],function(_0x583524){var _0x397365={};_0x397365[_0x583524]={'$like':'%'+_0x5085f0['query'][_0x1fdf('0x50')]+'%'};return _0x397365;})});}_0x1ad5a8=_[_0x1fdf('0x3f')]({},_0x1ad5a8,_0x5085f0[_0x1fdf('0x40')]);return _0x2708a8[_0x1fdf('0x4c')](_0x1ad5a8);}})[_0x1fdf('0x26')](function(_0x42c469){if(_0x42c469){_0x4cf99b=_0x42c469[_0x1fdf('0x37')];if(!_0x5085f0[_0x1fdf('0x33')][_0x1fdf('0x38')]('nolimit')){_0x1ad5a8[_0x1fdf('0x22')]=qs['limit'](_0x5085f0[_0x1fdf('0x33')]['limit']);_0x1ad5a8[_0x1fdf('0x20')]=qs['offset'](_0x5085f0[_0x1fdf('0x33')][_0x1fdf('0x20')]);}return _0x2708a8[_0x1fdf('0x4c')](_0x1ad5a8);}})['then'](function(_0x134f64){if(_0x134f64){return _0x134f64?{'count':_0x4cf99b,'rows':_0x134f64}:null;}})[_0x1fdf('0x26')](respondWithResult(_0x59eb27,null))[_0x1fdf('0x45')](handleError(_0x59eb27,null));};exports[_0x1fdf('0x51')]=function(_0x194281,_0x18f070,_0x592c4d){if(_0x194281['body']['id']){delete _0x194281[_0x1fdf('0x49')]['id'];}return db[_0x1fdf('0x2e')][_0x1fdf('0x4d')]({'where':{'id':_0x194281[_0x1fdf('0x46')]['id']}})[_0x1fdf('0x26')](handleEntityNotFound(_0x18f070,null))[_0x1fdf('0x26')](function(_0x5ec2a3){if(_0x5ec2a3){_0x194281[_0x1fdf('0x49')][_0x1fdf('0x52')]=_0x5ec2a3['id'];_0x194281[_0x1fdf('0x49')][_0x1fdf('0x53')]=integrations[_0x1fdf('0x54')](_0x194281['body'][_0x1fdf('0x55')],_0x194281[_0x1fdf('0x49')][_0x1fdf('0x30')]);_0x194281[_0x1fdf('0x49')]['Descriptions']=integrations[_0x1fdf('0x56')](_0x194281[_0x1fdf('0x49')][_0x1fdf('0x55')],_0x194281['body'][_0x1fdf('0x30')]);return db[_0x1fdf('0x4f')][_0x1fdf('0x48')](_0x194281[_0x1fdf('0x49')],{'include':[{'model':db[_0x1fdf('0x57')],'as':_0x1fdf('0x53')},{'model':db[_0x1fdf('0x57')],'as':'Descriptions'}]});}return null;})[_0x1fdf('0x26')](respondWithResult(_0x18f070,null))[_0x1fdf('0x45')](handleError(_0x18f070,null));};var md5=require('md5');exports[_0x1fdf('0x58')]=function(_0x5954ed,_0x3ef3c8,_0x3616d7){var _0x241a9f=null;var _0x30a5d1=null;var _0x101059=null;var _0x1b6ac7=null;var _0x41afdd='';return db['VtigerAccount'][_0x1fdf('0x4d')]({'where':{'id':_0x5954ed['params']['id']},'attributes':['id','name',_0x1fdf('0x59'),_0x1fdf('0x5a'),_0x1fdf('0x5b'),'remoteUri',_0x1fdf('0x5c'),_0x1fdf('0x5d')]})['then'](handleEntityNotFound(_0x3ef3c8,null))[_0x1fdf('0x26')](function(_0x45aa5f){if(_0x45aa5f){_0x241a9f=_0x45aa5f['username'];_0x30a5d1=_0x45aa5f[_0x1fdf('0x5d')];_0x101059=_0x45aa5f[_0x1fdf('0x5b')];_0x41afdd=_0x45aa5f[_0x1fdf('0x5e')];var _0x4edacd=_0x41afdd[_0x1fdf('0x5f')](-0x1);if(_0x4edacd==='/'){_0x41afdd=_0x41afdd[_0x1fdf('0x60')](0x0,_0x41afdd['lastIndexOf'](_0x4edacd));}_0x1b6ac7=util['format'](_0x1fdf('0x61'),_0x41afdd);var _0x43965f={'method':'GET','uri':_0x1b6ac7,'qs':{'operation':_0x1fdf('0x62'),'username':_0x45aa5f[_0x1fdf('0x59')]},'json':!![]};return rp(_0x43965f);}})['then'](function(_0x187cf7){if(_0x187cf7[_0x1fdf('0x63')]){var _0x212f99={'method':'POST','uri':_0x1b6ac7,'form':{'operation':_0x1fdf('0x64'),'username':_0x241a9f,'accessKey':md5(_0x187cf7[_0x1fdf('0x65')][_0x1fdf('0x66')]+_0x30a5d1)},'json':!![]};return rp(_0x212f99);}})['then'](function(_0x42b93c){if(_0x42b93c[_0x1fdf('0x63')]){var _0x439539={'method':_0x1fdf('0x67'),'uri':_0x1b6ac7,'qs':{'operation':_0x1fdf('0x68'),'username':_0x241a9f,'sessionName':_0x42b93c['result'][_0x1fdf('0x69')],'elementType':_0x101059},'json':!![]};return rp(_0x439539);}})[_0x1fdf('0x26')](function(_0x1e29be){if(_0x1e29be[_0x1fdf('0x63')]){var _0x5b6f87=[_0x1fdf('0x6a'),_0x1fdf('0x6b'),_0x1fdf('0x6c')];_[_0x1fdf('0x6d')](_0x1e29be[_0x1fdf('0x65')][_0x1fdf('0x36')],function(_0x561bbd){return _0x5b6f87[_0x1fdf('0x6e')](_0x561bbd[_0x1fdf('0x30')][_0x1fdf('0x2a')]);});_[_0x1fdf('0x6d')](_0x1e29be[_0x1fdf('0x65')][_0x1fdf('0x36')],function(_0x178ae0){return _0x178ae0[_0x1fdf('0x6f')]===_0x1fdf('0x70');});return{'count':_0x1e29be[_0x1fdf('0x65')][_0x1fdf('0x36')][_0x1fdf('0x37')],'rows':_[_0x1fdf('0x2d')](_0x1e29be[_0x1fdf('0x65')]['fields'],function(_0x3c732a){return{'id':_0x3c732a[_0x1fdf('0x2a')],'name':_0x3c732a['label'],'custom':_['startsWith'](_0x3c732a['name'],'cf_')?!![]:![],'options':_0x3c732a[_0x1fdf('0x30')][_0x1fdf('0x2a')]===_0x1fdf('0x71')&&_0x3c732a[_0x1fdf('0x30')][_0x1fdf('0x72')][_0x1fdf('0x37')]>0x0?_[_0x1fdf('0x2d')](_0x3c732a[_0x1fdf('0x30')][_0x1fdf('0x72')],function(_0xe021d9){return{'name':_0xe021d9['label'],'value':_0xe021d9[_0x1fdf('0x73')]};}):[]};})};}})[_0x1fdf('0x26')](respondWithResult(_0x3ef3c8,null))[_0x1fdf('0x45')](function(_0x210310){console[_0x1fdf('0x74')](_0x1fdf('0x75')+_0x210310);var _0xc46e9f=_0x5954ed[_0x1fdf('0x33')][_0x1fdf('0x76')]?0x1f4:_0x210310[_0x1fdf('0x77')]||0x1f4;logger['error'](_0x1fdf('0x78'),_0x1fdf('0x58'),_0xc46e9f,JSON[_0x1fdf('0x79')](_0x210310));delete _0x210310['name'];if(_0xc46e9f===0x191){_0xc46e9f=0x190;}_0x3ef3c8['status'](_0xc46e9f)[_0x1fdf('0x2b')](_0x5954ed['query'][_0x1fdf('0x76')]?{'message':_0x1fdf('0x7a'),'statusCode':_0x210310[_0x1fdf('0x77')]}:_0x210310);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 3524518..822cb77 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 _0xdd02=['define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./intVtigerAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x56f98d,_0x19a7a7){var _0x4a4108=function(_0x45bb3a){while(--_0x45bb3a){_0x56f98d['push'](_0x56f98d['shift']());}};_0x4a4108(++_0x19a7a7);}(_0xdd02,0x1d1));var _0x2dd0=function(_0x5cab28,_0x169dfe){_0x5cab28=_0x5cab28-0x0;var _0x279423=_0xdd02[_0x5cab28];return _0x279423;};'use strict';var _=require(_0x2dd0('0x0'));var util=require(_0x2dd0('0x1'));var logger=require(_0x2dd0('0x2'))(_0x2dd0('0x3'));var moment=require(_0x2dd0('0x4'));var BPromise=require(_0x2dd0('0x5'));var rp=require(_0x2dd0('0x6'));var fs=require('fs');var path=require(_0x2dd0('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2dd0('0x8'));var integrations=require(_0x2dd0('0x9'));module[_0x2dd0('0xa')]=function(_0x4dd002,_0x5c2969){return _0x4dd002[_0x2dd0('0xb')](_0x2dd0('0xc'),attributes,{'tableName':_0x2dd0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06a9=['int_vtiger_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define'];(function(_0x5f24d5,_0xc1ee18){var _0x21701c=function(_0x12d3ff){while(--_0x12d3ff){_0x5f24d5['push'](_0x5f24d5['shift']());}};_0x21701c(++_0xc1ee18);}(_0x06a9,0xb7));var _0x906a=function(_0x26a815,_0xcde2b9){_0x26a815=_0x26a815-0x0;var _0x539ed1=_0x06a9[_0x26a815];return _0x539ed1;};'use strict';var _=require(_0x906a('0x0'));var util=require(_0x906a('0x1'));var logger=require(_0x906a('0x2'))(_0x906a('0x3'));var moment=require('moment');var BPromise=require(_0x906a('0x4'));var rp=require(_0x906a('0x5'));var fs=require('fs');var path=require(_0x906a('0x6'));var rimraf=require(_0x906a('0x7'));var config=require(_0x906a('0x8'));var attributes=require(_0x906a('0x9'));var integrations=require(_0x906a('0xa'));module['exports']=function(_0x3bf133,_0x2c633c){return _0x3bf133[_0x906a('0xb')]('VtigerAccount',attributes,{'tableName':_0x906a('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 12584c5..a61f293 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 _0x1339=['stringify','error','code','message','result','catch','VtigerAccount','findAll','options','attributes','map','include','model','GetVtigerAccount','debug','raw','ShowVtigerAccount','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s'];(function(_0x4c67e1,_0xbfa4f){var _0x53ef74=function(_0x3fc9b2){while(--_0x3fc9b2){_0x4c67e1['push'](_0x4c67e1['shift']());}};_0x53ef74(++_0xbfa4f);}(_0x1339,0x1ed));var _0x9133=function(_0x31ea0e,_0x2bf19b){_0x31ea0e=_0x31ea0e-0x0;var _0x475789=_0x1339[_0x31ea0e];return _0x475789;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9133('0x0'));var BPromise=require(_0x9133('0x1'));var rs=require(_0x9133('0x2'));var fs=require('fs');var Redis=require(_0x9133('0x3'));var db=require(_0x9133('0x4'))['db'];var utils=require(_0x9133('0x5'));var logger=require(_0x9133('0x6'))(_0x9133('0x7'));var config=require('../../config/environment');var jayson=require(_0x9133('0x8'));var client=jayson[_0x9133('0x9')][_0x9133('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x539af6,_0x2758e2,_0x334dcd){return new BPromise(function(_0x3059c4,_0x431a55){return client[_0x9133('0xb')](_0x539af6,_0x334dcd)[_0x9133('0xc')](function(_0x4294b7){logger[_0x9133('0xd')](_0x9133('0xe'),_0x2758e2,_0x9133('0xf'));logger['debug'](_0x9133('0x10'),_0x2758e2,_0x9133('0xf'),JSON[_0x9133('0x11')](_0x4294b7));if(_0x4294b7[_0x9133('0x12')]){if(_0x4294b7[_0x9133('0x12')][_0x9133('0x13')]===0x1f4){logger['error'](_0x9133('0xe'),_0x2758e2,_0x4294b7[_0x9133('0x12')]['message']);return _0x431a55(_0x4294b7['error'][_0x9133('0x14')]);}logger['error'](_0x9133('0xe'),_0x2758e2,_0x4294b7[_0x9133('0x12')][_0x9133('0x14')]);return _0x3059c4(_0x4294b7[_0x9133('0x12')][_0x9133('0x14')]);}else{logger[_0x9133('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x2758e2,_0x9133('0xf'));_0x3059c4(_0x4294b7[_0x9133('0x15')]['message']);}})[_0x9133('0x16')](function(_0xa46eb1){logger[_0x9133('0x12')](_0x9133('0xe'),_0x2758e2,_0xa46eb1);_0x431a55(_0xa46eb1);});});}exports['GetVtigerAccount']=function(_0x1f3484){var _0x573998=this;return new Promise(function(_0x3c48ef,_0x5d4a77){return db[_0x9133('0x17')][_0x9133('0x18')]({'raw':_0x1f3484['options']?_0x1f3484[_0x9133('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1f3484[_0x9133('0x19')]?_0x1f3484['options']['where']||null:null,'attributes':_0x1f3484[_0x9133('0x19')]?_0x1f3484['options'][_0x9133('0x1a')]||null:null,'limit':_0x1f3484['options']?_0x1f3484['options']['limit']||null:null,'include':_0x1f3484[_0x9133('0x19')]?_0x1f3484[_0x9133('0x19')]['include']?_[_0x9133('0x1b')](_0x1f3484[_0x9133('0x19')][_0x9133('0x1c')],function(_0x26190c){return{'model':db[_0x26190c['model']],'as':_0x26190c['as'],'attributes':_0x26190c[_0x9133('0x1a')],'include':_0x26190c['include']?_[_0x9133('0x1b')](_0x26190c[_0x9133('0x1c')],function(_0x3f278d){return{'model':db[_0x3f278d[_0x9133('0x1d')]],'as':_0x3f278d['as'],'attributes':_0x3f278d[_0x9133('0x1a')],'include':_0x3f278d[_0x9133('0x1c')]?_[_0x9133('0x1b')](_0x3f278d[_0x9133('0x1c')],function(_0x1b6b3e){return{'model':db[_0x1b6b3e[_0x9133('0x1d')]],'as':_0x1b6b3e['as'],'attributes':_0x1b6b3e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x477bf1){logger[_0x9133('0xd')](_0x9133('0x1e'),_0x1f3484);logger[_0x9133('0x1f')]('GetVtigerAccount',_0x1f3484,JSON['stringify'](_0x477bf1));_0x3c48ef(_0x477bf1);})[_0x9133('0x16')](function(_0x45966d){logger[_0x9133('0x12')](_0x9133('0x1e'),_0x45966d[_0x9133('0x14')],_0x1f3484);_0x5d4a77(_0x573998[_0x9133('0x12')](0x1f4,_0x45966d['message']));});});};exports['ShowVtigerAccount']=function(_0x5a27c1){var _0x1ad222=this;return new Promise(function(_0x4a4a8e,_0x43b5f3){return db[_0x9133('0x17')]['find']({'raw':_0x5a27c1[_0x9133('0x19')]?_0x5a27c1['options'][_0x9133('0x20')]===undefined?!![]:![]:!![],'where':_0x5a27c1[_0x9133('0x19')]?_0x5a27c1[_0x9133('0x19')]['where']||null:null,'attributes':_0x5a27c1[_0x9133('0x19')]?_0x5a27c1[_0x9133('0x19')][_0x9133('0x1a')]||null:null,'include':_0x5a27c1['options']?_0x5a27c1[_0x9133('0x19')][_0x9133('0x1c')]?_[_0x9133('0x1b')](_0x5a27c1['options'][_0x9133('0x1c')],function(_0x20da68){return{'model':db[_0x20da68[_0x9133('0x1d')]],'as':_0x20da68['as'],'attributes':_0x20da68[_0x9133('0x1a')],'include':_0x20da68['include']?_[_0x9133('0x1b')](_0x20da68[_0x9133('0x1c')],function(_0x56719e){return{'model':db[_0x56719e[_0x9133('0x1d')]],'as':_0x56719e['as'],'attributes':_0x56719e[_0x9133('0x1a')],'include':_0x56719e[_0x9133('0x1c')]?_[_0x9133('0x1b')](_0x56719e[_0x9133('0x1c')],function(_0x2db377){return{'model':db[_0x2db377[_0x9133('0x1d')]],'as':_0x2db377['as'],'attributes':_0x2db377[_0x9133('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9133('0xc')](function(_0x335217){logger[_0x9133('0xd')]('ShowVtigerAccount',_0x5a27c1);logger[_0x9133('0x1f')](_0x9133('0x21'),_0x5a27c1,JSON['stringify'](_0x335217));_0x4a4a8e(_0x335217);})[_0x9133('0x16')](function(_0x3a2d1f){logger[_0x9133('0x12')](_0x9133('0x21'),_0x3a2d1f[_0x9133('0x14')],_0x5a27c1);_0x43b5f3(_0x1ad222[_0x9133('0x12')](0x1f4,_0x3a2d1f['message']));});});}; \ No newline at end of file +var _0x7af2=['ShowVtigerAccount','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','error','message','VtigerAccount,\x20%s,\x20%s','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','limit','include','map','model','debug','stringify','find','raw'];(function(_0x2c48b9,_0x5d7612){var _0x45023d=function(_0x36c2b3){while(--_0x36c2b3){_0x2c48b9['push'](_0x2c48b9['shift']());}};_0x45023d(++_0x5d7612);}(_0x7af2,0x119));var _0x27af=function(_0x60dc6f,_0x2c22a1){_0x60dc6f=_0x60dc6f-0x0;var _0x36bba0=_0x7af2[_0x60dc6f];return _0x36bba0;};'use strict';var _=require('lodash');var util=require(_0x27af('0x0'));var moment=require(_0x27af('0x1'));var BPromise=require(_0x27af('0x2'));var rs=require(_0x27af('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x27af('0x4'))['db'];var utils=require(_0x27af('0x5'));var logger=require(_0x27af('0x6'))(_0x27af('0x7'));var config=require(_0x27af('0x8'));var jayson=require(_0x27af('0x9'));var client=jayson[_0x27af('0xa')][_0x27af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2193c6,_0x572219,_0x1e2509){return new BPromise(function(_0x366868,_0x389e97){return client['request'](_0x2193c6,_0x1e2509)[_0x27af('0xc')](function(_0xfa1882){logger[_0x27af('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x572219,_0x27af('0xe'));logger['debug']('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x572219,_0x27af('0xe'),JSON['stringify'](_0xfa1882));if(_0xfa1882['error']){if(_0xfa1882[_0x27af('0xf')]['code']===0x1f4){logger[_0x27af('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x572219,_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);return _0x389e97(_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);}logger[_0x27af('0xf')](_0x27af('0x11'),_0x572219,_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);return _0x366868(_0xfa1882[_0x27af('0xf')][_0x27af('0x10')]);}else{logger[_0x27af('0xd')](_0x27af('0x11'),_0x572219,_0x27af('0xe'));_0x366868(_0xfa1882[_0x27af('0x12')][_0x27af('0x10')]);}})[_0x27af('0x13')](function(_0x13f8ed){logger[_0x27af('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x572219,_0x13f8ed);_0x389e97(_0x13f8ed);});});}exports[_0x27af('0x14')]=function(_0x31d702){var _0x5997ae=this;return new Promise(function(_0x4e6e2f,_0x20a6d7){return db[_0x27af('0x15')][_0x27af('0x16')]({'raw':_0x31d702[_0x27af('0x17')]?_0x31d702[_0x27af('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x31d702[_0x27af('0x17')]?_0x31d702[_0x27af('0x17')][_0x27af('0x18')]||null:null,'attributes':_0x31d702['options']?_0x31d702[_0x27af('0x17')][_0x27af('0x19')]||null:null,'limit':_0x31d702[_0x27af('0x17')]?_0x31d702['options'][_0x27af('0x1a')]||null:null,'include':_0x31d702[_0x27af('0x17')]?_0x31d702[_0x27af('0x17')][_0x27af('0x1b')]?_[_0x27af('0x1c')](_0x31d702[_0x27af('0x17')][_0x27af('0x1b')],function(_0x35b36d){return{'model':db[_0x35b36d[_0x27af('0x1d')]],'as':_0x35b36d['as'],'attributes':_0x35b36d['attributes'],'include':_0x35b36d['include']?_['map'](_0x35b36d[_0x27af('0x1b')],function(_0x4feaf1){return{'model':db[_0x4feaf1[_0x27af('0x1d')]],'as':_0x4feaf1['as'],'attributes':_0x4feaf1[_0x27af('0x19')],'include':_0x4feaf1['include']?_[_0x27af('0x1c')](_0x4feaf1[_0x27af('0x1b')],function(_0x463e36){return{'model':db[_0x463e36[_0x27af('0x1d')]],'as':_0x463e36['as'],'attributes':_0x463e36[_0x27af('0x19')]};}):[]};}):[]};}):[]:[]})[_0x27af('0xc')](function(_0x775d4e){logger['info'](_0x27af('0x14'),_0x31d702);logger[_0x27af('0x1e')](_0x27af('0x14'),_0x31d702,JSON[_0x27af('0x1f')](_0x775d4e));_0x4e6e2f(_0x775d4e);})[_0x27af('0x13')](function(_0xa08dd9){logger[_0x27af('0xf')](_0x27af('0x14'),_0xa08dd9[_0x27af('0x10')],_0x31d702);_0x20a6d7(_0x5997ae[_0x27af('0xf')](0x1f4,_0xa08dd9[_0x27af('0x10')]));});});};exports['ShowVtigerAccount']=function(_0x15e867){var _0x14b2e7=this;return new Promise(function(_0x3800a1,_0x575887){return db[_0x27af('0x15')][_0x27af('0x20')]({'raw':_0x15e867['options']?_0x15e867['options'][_0x27af('0x21')]===undefined?!![]:![]:!![],'where':_0x15e867[_0x27af('0x17')]?_0x15e867['options'][_0x27af('0x18')]||null:null,'attributes':_0x15e867[_0x27af('0x17')]?_0x15e867[_0x27af('0x17')][_0x27af('0x19')]||null:null,'include':_0x15e867[_0x27af('0x17')]?_0x15e867[_0x27af('0x17')][_0x27af('0x1b')]?_[_0x27af('0x1c')](_0x15e867[_0x27af('0x17')][_0x27af('0x1b')],function(_0x13c97d){return{'model':db[_0x13c97d['model']],'as':_0x13c97d['as'],'attributes':_0x13c97d['attributes'],'include':_0x13c97d[_0x27af('0x1b')]?_[_0x27af('0x1c')](_0x13c97d['include'],function(_0x2dd799){return{'model':db[_0x2dd799[_0x27af('0x1d')]],'as':_0x2dd799['as'],'attributes':_0x2dd799['attributes'],'include':_0x2dd799[_0x27af('0x1b')]?_[_0x27af('0x1c')](_0x2dd799[_0x27af('0x1b')],function(_0x329d06){return{'model':db[_0x329d06[_0x27af('0x1d')]],'as':_0x329d06['as'],'attributes':_0x329d06['attributes']};}):[]};}):[]};}):[]:[]})[_0x27af('0xc')](function(_0x468cea){logger['info']('ShowVtigerAccount',_0x15e867);logger[_0x27af('0x1e')](_0x27af('0x22'),_0x15e867,JSON[_0x27af('0x1f')](_0x468cea));_0x3800a1(_0x468cea);})[_0x27af('0x13')](function(_0x467891){logger[_0x27af('0xf')]('ShowVtigerAccount',_0x467891[_0x27af('0x10')],_0x15e867);_0x575887(_0x14b2e7['error'](0x1f4,_0x467891[_0x27af('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 2c7169e..3daa2ab 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 _0x4ef9=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','isAuthenticated','/:id','show','get','/:id/fields','/:id/subjects','getDescriptions','post','create'];(function(_0x49a8d1,_0x44c4cb){var _0x31909f=function(_0x190418){while(--_0x190418){_0x49a8d1['push'](_0x49a8d1['shift']());}};_0x31909f(++_0x44c4cb);}(_0x4ef9,0x10c));var _0x94ef=function(_0x2a7066,_0x279e23){_0x2a7066=_0x2a7066-0x0;var _0x21814e=_0x4ef9[_0x2a7066];return _0x21814e;};'use strict';var multer=require(_0x94ef('0x0'));var util=require(_0x94ef('0x1'));var path=require(_0x94ef('0x2'));var timeout=require(_0x94ef('0x3'));var express=require('express');var router=express[_0x94ef('0x4')]();var fs_extra=require(_0x94ef('0x5'));var auth=require(_0x94ef('0x6'));var interaction=require(_0x94ef('0x7'));var config=require('../../config/environment');var controller=require(_0x94ef('0x8'));router['get']('/',auth[_0x94ef('0x9')](),controller['index']);router['get'](_0x94ef('0xa'),auth[_0x94ef('0x9')](),controller[_0x94ef('0xb')]);router[_0x94ef('0xc')](_0x94ef('0xd'),auth[_0x94ef('0x9')](),controller['getFields']);router[_0x94ef('0xc')](_0x94ef('0xe'),auth[_0x94ef('0x9')](),controller['getSubjects']);router[_0x94ef('0xc')]('/:id/descriptions',auth[_0x94ef('0x9')](),controller[_0x94ef('0xf')]);router[_0x94ef('0x10')]('/',auth[_0x94ef('0x9')](),controller[_0x94ef('0x11')]);router[_0x94ef('0x12')](_0x94ef('0xa'),auth['isAuthenticated'](),controller[_0x94ef('0x13')]);router['delete'](_0x94ef('0xa'),auth[_0x94ef('0x9')](),controller[_0x94ef('0x14')]);module[_0x94ef('0x15')]=router; \ No newline at end of file +var _0x47a0=['getDescriptions','post','create','/:id','update','exports','multer','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0xfb42e6,_0x5f5d4b){var _0x27265b=function(_0x163e81){while(--_0x163e81){_0xfb42e6['push'](_0xfb42e6['shift']());}};_0x27265b(++_0x5f5d4b);}(_0x47a0,0x1d4));var _0x047a=function(_0x76a521,_0x4d5fc6){_0x76a521=_0x76a521-0x0;var _0x1a2121=_0x47a0[_0x76a521];return _0x1a2121;};'use strict';var multer=require(_0x047a('0x0'));var util=require('util');var path=require(_0x047a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x047a('0x2')]();var fs_extra=require(_0x047a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x047a('0x4'));var config=require(_0x047a('0x5'));var controller=require(_0x047a('0x6'));router[_0x047a('0x7')]('/',auth[_0x047a('0x8')](),controller[_0x047a('0x9')]);router['get']('/:id',auth[_0x047a('0x8')](),controller[_0x047a('0xa')]);router['get'](_0x047a('0xb'),auth[_0x047a('0x8')](),controller[_0x047a('0xc')]);router[_0x047a('0x7')](_0x047a('0xd'),auth[_0x047a('0x8')](),controller[_0x047a('0xe')]);router[_0x047a('0x7')](_0x047a('0xf'),auth[_0x047a('0x8')](),controller[_0x047a('0x10')]);router[_0x047a('0x11')]('/',auth['isAuthenticated'](),controller[_0x047a('0x12')]);router['put'](_0x047a('0x13'),auth[_0x047a('0x8')](),controller[_0x047a('0x14')]);router['delete']('/:id',auth[_0x047a('0x8')](),controller['destroy']);module[_0x047a('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index d05c9cd..188af9c 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 _0xfb75=['STRING','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xfb75,0xf7));var _0x5fb7=function(_0xe85fc5,_0x2b163b){_0xe85fc5=_0xe85fc5-0x0;var _0x2dd759=_0xfb75[_0xe85fc5];return _0x2dd759;};'use strict';var Sequelize=require('sequelize');module[_0x5fb7('0x0')]={'name':{'type':Sequelize[_0x5fb7('0x1')]},'description':{'type':Sequelize[_0x5fb7('0x1')]}}; \ No newline at end of file +var _0xd725=['sequelize','exports','STRING'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xd725,0x1d7));var _0x5d72=function(_0x558582,_0x40faf0){_0x558582=_0x558582-0x0;var _0x32f611=_0xd725[_0x558582];return _0x32f611;};'use strict';var Sequelize=require(_0x5d72('0x0'));module[_0x5d72('0x1')]={'name':{'type':Sequelize[_0x5d72('0x2')]},'description':{'type':Sequelize[_0x5d72('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 4a46485..766d640 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 _0x04cc=['hasOwnProperty','nolimit','order','sort','where','pick','filters','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','Content-Range','reject','save','update','then','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','model','query','intersection','attributes','fields','length'];(function(_0x388a72,_0x360390){var _0x2e0326=function(_0x93b95f){while(--_0x93b95f){_0x388a72['push'](_0x388a72['shift']());}};_0x2e0326(++_0x360390);}(_0x04cc,0x10d));var _0xc04c=function(_0x4b0830,_0x2e3b0a){_0x4b0830=_0x4b0830-0x0;var _0x1f53a7=_0x04cc[_0x4b0830];return _0x1f53a7;};'use strict';var emlformat=require(_0xc04c('0x0'));var rimraf=require(_0xc04c('0x1'));var zipdir=require(_0xc04c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc04c('0x3'));var moment=require(_0xc04c('0x4'));var BPromise=require(_0xc04c('0x5'));var Mustache=require(_0xc04c('0x6'));var util=require(_0xc04c('0x7'));var path=require('path');var sox=require(_0xc04c('0x8'));var csv=require('to-csv');var ejs=require(_0xc04c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc04c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc04c('0xb'));var deskjs=require(_0xc04c('0xc'));var toCsv=require(_0xc04c('0xd'));var querystring=require(_0xc04c('0xe'));var Papa=require(_0xc04c('0xf'));var Redis=require(_0xc04c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc04c('0x11'));var as=require(_0xc04c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc04c('0x13'))('api');var utils=require(_0xc04c('0x14'));var config=require(_0xc04c('0x15'));var licenseUtil=require(_0xc04c('0x16'));var db=require(_0xc04c('0x17'))['db'];function respondWithStatusCode(_0x2017b8,_0x47170c){_0x47170c=_0x47170c||0xcc;return function(_0x3c751d){if(_0x3c751d){return _0x2017b8[_0xc04c('0x18')](_0x47170c);}return _0x2017b8['status'](_0x47170c)[_0xc04c('0x19')]();};}function respondWithResult(_0x1ab9c5,_0x300305){_0x300305=_0x300305||0xc8;return function(_0x33e121){if(_0x33e121){return _0x1ab9c5['status'](_0x300305)[_0xc04c('0x1a')](_0x33e121);}};}function respondWithFilteredResult(_0x4904a9,_0x42c342){return function(_0x3a8681){if(_0x3a8681){var _0x49a51d=typeof _0x42c342[_0xc04c('0x1b')]==='undefined'&&typeof _0x42c342[_0xc04c('0x1c')]===_0xc04c('0x1d');var _0x777fd6=_0x3a8681[_0xc04c('0x1e')];var _0x34757a=_0x49a51d?0x0:_0x42c342['offset'];var _0x14d60e=_0x49a51d?_0x3a8681[_0xc04c('0x1e')]:_0x42c342[_0xc04c('0x1b')]+_0x42c342[_0xc04c('0x1c')];var _0xd2f90a;if(_0x14d60e>=_0x777fd6){_0x14d60e=_0x777fd6;_0xd2f90a=0xc8;}else{_0xd2f90a=0xce;}_0x4904a9[_0xc04c('0x1f')](_0xd2f90a);return _0x4904a9['set'](_0xc04c('0x20'),_0x34757a+'-'+_0x14d60e+'/'+_0x777fd6)[_0xc04c('0x1a')](_0x3a8681);}return null;};}function patchUpdates(_0x4e4bea){return function(_0x4521d8){try{jsonpatch['apply'](_0x4521d8,_0x4e4bea,!![]);}catch(_0x34198f){return BPromise[_0xc04c('0x21')](_0x34198f);}return _0x4521d8[_0xc04c('0x22')]();};}function saveUpdates(_0x40ee57,_0xb312da){return function(_0x249279){if(_0x249279){return _0x249279[_0xc04c('0x23')](_0x40ee57)[_0xc04c('0x24')](function(_0x391dd8){return _0x391dd8;});}return null;};}function removeEntity(_0x2dac80,_0x5a847a){return function(_0x51ad1d){if(_0x51ad1d){return _0x51ad1d['destroy']()[_0xc04c('0x24')](function(){_0x2dac80[_0xc04c('0x1f')](0xcc)[_0xc04c('0x19')]();});}};}function handleEntityNotFound(_0x2d72c6,_0x1bfe35){return function(_0x398253){if(!_0x398253){_0x2d72c6[_0xc04c('0x18')](0x194);}return _0x398253;};}function handleError(_0x5db434,_0x3cf428){_0x3cf428=_0x3cf428||0x1f4;return function(_0xa467a0){logger['error'](_0xa467a0[_0xc04c('0x25')]);if(_0xa467a0[_0xc04c('0x26')]){delete _0xa467a0['name'];}_0x5db434[_0xc04c('0x1f')](_0x3cf428)[_0xc04c('0x27')](_0xa467a0);};}exports[_0xc04c('0x28')]=function(_0x31f038,_0x321c98){var _0x24d70a={},_0x2eb512={},_0x9597d6={'count':0x0,'rows':[]};var _0xefaabb=_[_0xc04c('0x29')](db[_0xc04c('0x2a')][_0xc04c('0x2b')],function(_0x440904){return{'name':_0x440904[_0xc04c('0x2c')],'type':_0x440904['type']['key']};});_0x2eb512[_0xc04c('0x2d')]=_[_0xc04c('0x29')](_0xefaabb,_0xc04c('0x26'));_0x2eb512[_0xc04c('0x2e')]=_['keys'](_0x31f038['query']);_0x2eb512['filters']=_[_0xc04c('0x2f')](_0x2eb512[_0xc04c('0x2d')],_0x2eb512[_0xc04c('0x2e')]);_0x24d70a[_0xc04c('0x30')]=_[_0xc04c('0x2f')](_0x2eb512['model'],qs['fields'](_0x31f038['query'][_0xc04c('0x31')]));_0x24d70a['attributes']=_0x24d70a[_0xc04c('0x30')][_0xc04c('0x32')]?_0x24d70a[_0xc04c('0x30')]:_0x2eb512['model'];if(!_0x31f038[_0xc04c('0x2e')][_0xc04c('0x33')](_0xc04c('0x34'))){_0x24d70a[_0xc04c('0x1c')]=qs['limit'](_0x31f038['query'][_0xc04c('0x1c')]);_0x24d70a[_0xc04c('0x1b')]=qs[_0xc04c('0x1b')](_0x31f038[_0xc04c('0x2e')]['offset']);}_0x24d70a[_0xc04c('0x35')]=qs[_0xc04c('0x36')](_0x31f038[_0xc04c('0x2e')][_0xc04c('0x36')]);_0x24d70a[_0xc04c('0x37')]=qs['filters'](_[_0xc04c('0x38')](_0x31f038[_0xc04c('0x2e')],_0x2eb512[_0xc04c('0x39')]),_0xefaabb);if(_0x31f038['query']['filter']){_0x24d70a['where']=_['merge'](_0x24d70a[_0xc04c('0x37')],{'$or':_[_0xc04c('0x29')](_0xefaabb,function(_0xd5ddb2){if(_0xd5ddb2[_0xc04c('0x3a')]!==_0xc04c('0x3b')){var _0x2b2381={};_0x2b2381[_0xd5ddb2['name']]={'$like':'%'+_0x31f038['query'][_0xc04c('0x3c')]+'%'};return _0x2b2381;}})});}_0x24d70a=_[_0xc04c('0x3d')]({},_0x24d70a,_0x31f038[_0xc04c('0x3e')]);var _0x2d134b={'where':_0x24d70a[_0xc04c('0x37')]};return db[_0xc04c('0x2a')]['count'](_0x2d134b)[_0xc04c('0x24')](function(_0x112341){_0x9597d6[_0xc04c('0x1e')]=_0x112341;if(_0x31f038[_0xc04c('0x2e')][_0xc04c('0x3f')]){_0x24d70a[_0xc04c('0x40')]=[{'all':!![]}];}return db[_0xc04c('0x2a')][_0xc04c('0x41')](_0x24d70a);})[_0xc04c('0x24')](function(_0x2cc841){_0x9597d6[_0xc04c('0x42')]=_0x2cc841;return _0x9597d6;})['then'](respondWithFilteredResult(_0x321c98,_0x24d70a))[_0xc04c('0x43')](handleError(_0x321c98,null));};exports[_0xc04c('0x44')]=function(_0x5001a8,_0x56867c){var _0x50acc0={'raw':![],'where':{'id':_0x5001a8[_0xc04c('0x45')]['id']}},_0x2fd562={};_0x2fd562[_0xc04c('0x2d')]=_[_0xc04c('0x46')](db[_0xc04c('0x2a')][_0xc04c('0x2b')]);_0x2fd562[_0xc04c('0x2e')]=_[_0xc04c('0x46')](_0x5001a8[_0xc04c('0x2e')]);_0x2fd562[_0xc04c('0x39')]=_['intersection'](_0x2fd562['model'],_0x2fd562[_0xc04c('0x2e')]);_0x50acc0[_0xc04c('0x30')]=_[_0xc04c('0x2f')](_0x2fd562['model'],qs[_0xc04c('0x31')](_0x5001a8[_0xc04c('0x2e')][_0xc04c('0x31')]));_0x50acc0[_0xc04c('0x30')]=_0x50acc0[_0xc04c('0x30')][_0xc04c('0x32')]?_0x50acc0[_0xc04c('0x30')]:_0x2fd562[_0xc04c('0x2d')];if(_0x5001a8['query'][_0xc04c('0x3f')]){_0x50acc0['include']=[{'all':!![]}];}_0x50acc0=_[_0xc04c('0x3d')]({},_0x50acc0,_0x5001a8[_0xc04c('0x3e')]);return db[_0xc04c('0x2a')][_0xc04c('0x47')](_0x50acc0)[_0xc04c('0x24')](handleEntityNotFound(_0x56867c,null))[_0xc04c('0x24')](respondWithResult(_0x56867c,null))['catch'](handleError(_0x56867c,null));};exports[_0xc04c('0x48')]=function(_0x39d6c5,_0x2e9558){return db[_0xc04c('0x2a')][_0xc04c('0x48')](_0x39d6c5[_0xc04c('0x49')],{})['then'](respondWithResult(_0x2e9558,0xc9))['catch'](handleError(_0x2e9558,null));};exports[_0xc04c('0x23')]=function(_0x540bfb,_0xa5f3f){if(_0x540bfb[_0xc04c('0x49')]['id']){delete _0x540bfb[_0xc04c('0x49')]['id'];}return db[_0xc04c('0x2a')][_0xc04c('0x47')]({'where':{'id':_0x540bfb[_0xc04c('0x45')]['id']}})[_0xc04c('0x24')](handleEntityNotFound(_0xa5f3f,null))[_0xc04c('0x24')](saveUpdates(_0x540bfb[_0xc04c('0x49')],null))[_0xc04c('0x24')](respondWithResult(_0xa5f3f,null))['catch'](handleError(_0xa5f3f,null));};exports[_0xc04c('0x4a')]=function(_0x4dc174,_0x407cc3){return db['VtigerConfiguration'][_0xc04c('0x47')]({'where':{'id':_0x4dc174[_0xc04c('0x45')]['id']}})['then'](handleEntityNotFound(_0x407cc3,null))[_0xc04c('0x24')](removeEntity(_0x407cc3,null))[_0xc04c('0x43')](handleError(_0x407cc3,null));};exports[_0xc04c('0x4b')]=function(_0x619fe3,_0x168252,_0xf8ad5b){var _0x52edd1={};var _0x3fac3b={};var _0x3801ed;var _0x19dd09;return db[_0xc04c('0x2a')][_0xc04c('0x4c')]({'where':{'id':_0x619fe3[_0xc04c('0x45')]['id']}})[_0xc04c('0x24')](handleEntityNotFound(_0x168252,null))['then'](function(_0x395100){if(_0x395100){_0x3801ed=_0x395100;_0x3fac3b[_0xc04c('0x2d')]=_['keys'](db[_0xc04c('0x4d')][_0xc04c('0x2b')]);_0x3fac3b[_0xc04c('0x2e')]=_[_0xc04c('0x46')](_0x619fe3[_0xc04c('0x2e')]);_0x3fac3b[_0xc04c('0x39')]=_[_0xc04c('0x2f')](_0x3fac3b[_0xc04c('0x2d')],_0x3fac3b[_0xc04c('0x2e')]);_0x52edd1[_0xc04c('0x30')]=_['intersection'](_0x3fac3b['model'],qs[_0xc04c('0x31')](_0x619fe3[_0xc04c('0x2e')]['fields']));_0x52edd1[_0xc04c('0x30')]=_0x52edd1[_0xc04c('0x30')][_0xc04c('0x32')]?_0x52edd1['attributes']:_0x3fac3b[_0xc04c('0x2d')];_0x52edd1['order']=qs[_0xc04c('0x36')](_0x619fe3[_0xc04c('0x2e')][_0xc04c('0x36')]);_0x52edd1['where']=qs[_0xc04c('0x39')](_['pick'](_0x619fe3[_0xc04c('0x2e')],_0x3fac3b[_0xc04c('0x39')]));if(_0x619fe3['query'][_0xc04c('0x3c')]){_0x52edd1[_0xc04c('0x37')]=_['merge'](_0x52edd1[_0xc04c('0x37')],{'$or':_[_0xc04c('0x29')](_0x52edd1[_0xc04c('0x30')],function(_0x2e7209){var _0x33d90a={};_0x33d90a[_0x2e7209]={'$like':'%'+_0x619fe3['query']['filter']+'%'};return _0x33d90a;})});}_0x52edd1=_[_0xc04c('0x3d')]({},_0x52edd1,_0x619fe3[_0xc04c('0x3e')]);return _0x3801ed[_0xc04c('0x4b')](_0x52edd1);}})[_0xc04c('0x24')](function(_0x341213){if(_0x341213){_0x19dd09=_0x341213[_0xc04c('0x32')];if(!_0x619fe3[_0xc04c('0x2e')]['hasOwnProperty'](_0xc04c('0x34'))){_0x52edd1[_0xc04c('0x1c')]=qs[_0xc04c('0x1c')](_0x619fe3[_0xc04c('0x2e')][_0xc04c('0x1c')]);_0x52edd1[_0xc04c('0x1b')]=qs[_0xc04c('0x1b')](_0x619fe3[_0xc04c('0x2e')][_0xc04c('0x1b')]);}return _0x3801ed[_0xc04c('0x4b')](_0x52edd1);}})[_0xc04c('0x24')](function(_0x64372d){if(_0x64372d){return _0x64372d?{'count':_0x19dd09,'rows':_0x64372d}:null;}})[_0xc04c('0x24')](respondWithResult(_0x168252,null))[_0xc04c('0x43')](handleError(_0x168252,null));};exports[_0xc04c('0x4e')]=function(_0x337537,_0x187776,_0x24b06c){var _0xeae454={};var _0x3b892a={};var _0x51a25c;var _0x56cbae;return db['VtigerConfiguration'][_0xc04c('0x4c')]({'where':{'id':_0x337537[_0xc04c('0x45')]['id']}})['then'](handleEntityNotFound(_0x187776,null))[_0xc04c('0x24')](function(_0x3e6c09){if(_0x3e6c09){_0x51a25c=_0x3e6c09;_0x3b892a['model']=_[_0xc04c('0x46')](db[_0xc04c('0x4d')]['rawAttributes']);_0x3b892a[_0xc04c('0x2e')]=_['keys'](_0x337537[_0xc04c('0x2e')]);_0x3b892a[_0xc04c('0x39')]=_[_0xc04c('0x2f')](_0x3b892a['model'],_0x3b892a[_0xc04c('0x2e')]);_0xeae454[_0xc04c('0x30')]=_[_0xc04c('0x2f')](_0x3b892a['model'],qs[_0xc04c('0x31')](_0x337537['query'][_0xc04c('0x31')]));_0xeae454['attributes']=_0xeae454['attributes'][_0xc04c('0x32')]?_0xeae454[_0xc04c('0x30')]:_0x3b892a[_0xc04c('0x2d')];_0xeae454[_0xc04c('0x35')]=qs[_0xc04c('0x36')](_0x337537[_0xc04c('0x2e')][_0xc04c('0x36')]);_0xeae454['where']=qs[_0xc04c('0x39')](_[_0xc04c('0x38')](_0x337537[_0xc04c('0x2e')],_0x3b892a[_0xc04c('0x39')]));if(_0x337537[_0xc04c('0x2e')][_0xc04c('0x3c')]){_0xeae454['where']=_['merge'](_0xeae454[_0xc04c('0x37')],{'$or':_['map'](_0xeae454[_0xc04c('0x30')],function(_0x34a018){var _0x55e983={};_0x55e983[_0x34a018]={'$like':'%'+_0x337537['query'][_0xc04c('0x3c')]+'%'};return _0x55e983;})});}_0xeae454=_[_0xc04c('0x3d')]({},_0xeae454,_0x337537[_0xc04c('0x3e')]);return _0x51a25c[_0xc04c('0x4e')](_0xeae454);}})[_0xc04c('0x24')](function(_0x4d85a2){if(_0x4d85a2){_0x56cbae=_0x4d85a2[_0xc04c('0x32')];if(!_0x337537['query'][_0xc04c('0x33')](_0xc04c('0x34'))){_0xeae454[_0xc04c('0x1c')]=qs['limit'](_0x337537[_0xc04c('0x2e')][_0xc04c('0x1c')]);_0xeae454[_0xc04c('0x1b')]=qs[_0xc04c('0x1b')](_0x337537['query'][_0xc04c('0x1b')]);}return _0x51a25c['getSubjects'](_0xeae454);}})['then'](function(_0x580cd7){if(_0x580cd7){return _0x580cd7?{'count':_0x56cbae,'rows':_0x580cd7}:null;}})['then'](respondWithResult(_0x187776,null))[_0xc04c('0x43')](handleError(_0x187776,null));};exports[_0xc04c('0x4f')]=function(_0x4af904,_0x2b7edd,_0x28aabb){var _0x96a9ee={};var _0x498858={};var _0xdf64aa;var _0x38b4c0;return db[_0xc04c('0x2a')][_0xc04c('0x4c')]({'where':{'id':_0x4af904[_0xc04c('0x45')]['id']}})[_0xc04c('0x24')](handleEntityNotFound(_0x2b7edd,null))[_0xc04c('0x24')](function(_0x3c3abf){if(_0x3c3abf){_0xdf64aa=_0x3c3abf;_0x498858['model']=_[_0xc04c('0x46')](db['VtigerField']['rawAttributes']);_0x498858[_0xc04c('0x2e')]=_['keys'](_0x4af904[_0xc04c('0x2e')]);_0x498858[_0xc04c('0x39')]=_[_0xc04c('0x2f')](_0x498858[_0xc04c('0x2d')],_0x498858['query']);_0x96a9ee[_0xc04c('0x30')]=_[_0xc04c('0x2f')](_0x498858['model'],qs['fields'](_0x4af904[_0xc04c('0x2e')]['fields']));_0x96a9ee[_0xc04c('0x30')]=_0x96a9ee[_0xc04c('0x30')][_0xc04c('0x32')]?_0x96a9ee[_0xc04c('0x30')]:_0x498858[_0xc04c('0x2d')];_0x96a9ee[_0xc04c('0x35')]=qs[_0xc04c('0x36')](_0x4af904[_0xc04c('0x2e')][_0xc04c('0x36')]);_0x96a9ee['where']=qs['filters'](_[_0xc04c('0x38')](_0x4af904[_0xc04c('0x2e')],_0x498858[_0xc04c('0x39')]));if(_0x4af904[_0xc04c('0x2e')][_0xc04c('0x3c')]){_0x96a9ee[_0xc04c('0x37')]=_[_0xc04c('0x3d')](_0x96a9ee['where'],{'$or':_[_0xc04c('0x29')](_0x96a9ee['attributes'],function(_0x38f1a7){var _0x3b7eb4={};_0x3b7eb4[_0x38f1a7]={'$like':'%'+_0x4af904['query'][_0xc04c('0x3c')]+'%'};return _0x3b7eb4;})});}_0x96a9ee=_[_0xc04c('0x3d')]({},_0x96a9ee,_0x4af904['options']);return _0xdf64aa['getDescriptions'](_0x96a9ee);}})[_0xc04c('0x24')](function(_0x5d35ce){if(_0x5d35ce){_0x38b4c0=_0x5d35ce['length'];if(!_0x4af904[_0xc04c('0x2e')][_0xc04c('0x33')]('nolimit')){_0x96a9ee['limit']=qs[_0xc04c('0x1c')](_0x4af904[_0xc04c('0x2e')][_0xc04c('0x1c')]);_0x96a9ee['offset']=qs['offset'](_0x4af904[_0xc04c('0x2e')][_0xc04c('0x1b')]);}return _0xdf64aa[_0xc04c('0x4f')](_0x96a9ee);}})[_0xc04c('0x24')](function(_0x3bad8e){if(_0x3bad8e){return _0x3bad8e?{'count':_0x38b4c0,'rows':_0x3bad8e}:null;}})['then'](respondWithResult(_0x2b7edd,null))[_0xc04c('0x43')](handleError(_0x2b7edd,null));}; \ No newline at end of file +var _0x9946=['offset','set','Content-Range','apply','reject','update','then','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','VtigerConfiguration','count','include','rows','params','rawAttributes','includeAll','find','catch','create','body','destroy','getFields','hasOwnProperty','nolimit','getSubjects','findOne','VtigerField','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit'];(function(_0x228f53,_0x2622f4){var _0x3b799a=function(_0x4ae919){while(--_0x4ae919){_0x228f53['push'](_0x228f53['shift']());}};_0x3b799a(++_0x2622f4);}(_0x9946,0x82));var _0x6994=function(_0x19d751,_0x21938e){_0x19d751=_0x19d751-0x0;var _0x337c88=_0x9946[_0x19d751];return _0x337c88;};'use strict';var emlformat=require(_0x6994('0x0'));var rimraf=require(_0x6994('0x1'));var zipdir=require(_0x6994('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6994('0x3'));var moment=require(_0x6994('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x6994('0x5'));var sox=require(_0x6994('0x6'));var csv=require('to-csv');var ejs=require(_0x6994('0x7'));var fs=require('fs');var fs_extra=require(_0x6994('0x8'));var _=require(_0x6994('0x9'));var squel=require(_0x6994('0xa'));var crypto=require(_0x6994('0xb'));var jsforce=require(_0x6994('0xc'));var deskjs=require(_0x6994('0xd'));var toCsv=require(_0x6994('0xe'));var querystring=require(_0x6994('0xf'));var Papa=require('papaparse');var Redis=require(_0x6994('0x10'));var authService=require(_0x6994('0x11'));var qs=require(_0x6994('0x12'));var as=require(_0x6994('0x13'));var hardwareService=require(_0x6994('0x14'));var logger=require('../../config/logger')(_0x6994('0x15'));var utils=require(_0x6994('0x16'));var config=require(_0x6994('0x17'));var licenseUtil=require(_0x6994('0x18'));var db=require(_0x6994('0x19'))['db'];function respondWithStatusCode(_0x3ef3fc,_0x403118){_0x403118=_0x403118||0xcc;return function(_0x3c5d47){if(_0x3c5d47){return _0x3ef3fc[_0x6994('0x1a')](_0x403118);}return _0x3ef3fc[_0x6994('0x1b')](_0x403118)[_0x6994('0x1c')]();};}function respondWithResult(_0x519022,_0xd717e6){_0xd717e6=_0xd717e6||0xc8;return function(_0x3cd12f){if(_0x3cd12f){return _0x519022[_0x6994('0x1b')](_0xd717e6)[_0x6994('0x1d')](_0x3cd12f);}};}function respondWithFilteredResult(_0x10093b,_0x46f498){return function(_0x26e13c){if(_0x26e13c){var _0x16e005=typeof _0x46f498['offset']===_0x6994('0x1e')&&typeof _0x46f498[_0x6994('0x1f')]==='undefined';var _0x37d4c1=_0x26e13c['count'];var _0x423c48=_0x16e005?0x0:_0x46f498[_0x6994('0x20')];var _0x356c20=_0x16e005?_0x26e13c['count']:_0x46f498['offset']+_0x46f498[_0x6994('0x1f')];var _0x59f171;if(_0x356c20>=_0x37d4c1){_0x356c20=_0x37d4c1;_0x59f171=0xc8;}else{_0x59f171=0xce;}_0x10093b['status'](_0x59f171);return _0x10093b[_0x6994('0x21')](_0x6994('0x22'),_0x423c48+'-'+_0x356c20+'/'+_0x37d4c1)[_0x6994('0x1d')](_0x26e13c);}return null;};}function patchUpdates(_0x11a5a6){return function(_0x29d2f0){try{jsonpatch[_0x6994('0x23')](_0x29d2f0,_0x11a5a6,!![]);}catch(_0x5b3dac){return BPromise[_0x6994('0x24')](_0x5b3dac);}return _0x29d2f0['save']();};}function saveUpdates(_0x2cda43,_0x239a20){return function(_0x2ed294){if(_0x2ed294){return _0x2ed294[_0x6994('0x25')](_0x2cda43)[_0x6994('0x26')](function(_0x38e869){return _0x38e869;});}return null;};}function removeEntity(_0x2ab7a5,_0x1e647c){return function(_0x2f512a){if(_0x2f512a){return _0x2f512a['destroy']()[_0x6994('0x26')](function(){_0x2ab7a5[_0x6994('0x1b')](0xcc)[_0x6994('0x1c')]();});}};}function handleEntityNotFound(_0x374006,_0x1cd07c){return function(_0x5f06cf){if(!_0x5f06cf){_0x374006[_0x6994('0x1a')](0x194);}return _0x5f06cf;};}function handleError(_0x179f60,_0x3f744c){_0x3f744c=_0x3f744c||0x1f4;return function(_0x50b7fb){logger['error'](_0x50b7fb[_0x6994('0x27')]);if(_0x50b7fb[_0x6994('0x28')]){delete _0x50b7fb['name'];}_0x179f60['status'](_0x3f744c)['send'](_0x50b7fb);};}exports[_0x6994('0x29')]=function(_0x4c7eb4,_0x550197){var _0x128da3={},_0x45c590={},_0xbd265a={'count':0x0,'rows':[]};var _0x5b714f=_[_0x6994('0x2a')](db['VtigerConfiguration']['rawAttributes'],function(_0x16891f){return{'name':_0x16891f[_0x6994('0x2b')],'type':_0x16891f[_0x6994('0x2c')][_0x6994('0x2d')]};});_0x45c590[_0x6994('0x2e')]=_['map'](_0x5b714f,_0x6994('0x28'));_0x45c590[_0x6994('0x2f')]=_[_0x6994('0x30')](_0x4c7eb4['query']);_0x45c590[_0x6994('0x31')]=_[_0x6994('0x32')](_0x45c590[_0x6994('0x2e')],_0x45c590[_0x6994('0x2f')]);_0x128da3[_0x6994('0x33')]=_[_0x6994('0x32')](_0x45c590[_0x6994('0x2e')],qs[_0x6994('0x34')](_0x4c7eb4[_0x6994('0x2f')][_0x6994('0x34')]));_0x128da3[_0x6994('0x33')]=_0x128da3[_0x6994('0x33')][_0x6994('0x35')]?_0x128da3[_0x6994('0x33')]:_0x45c590[_0x6994('0x2e')];if(!_0x4c7eb4[_0x6994('0x2f')]['hasOwnProperty']('nolimit')){_0x128da3[_0x6994('0x1f')]=qs[_0x6994('0x1f')](_0x4c7eb4[_0x6994('0x2f')][_0x6994('0x1f')]);_0x128da3['offset']=qs[_0x6994('0x20')](_0x4c7eb4[_0x6994('0x2f')][_0x6994('0x20')]);}_0x128da3[_0x6994('0x36')]=qs['sort'](_0x4c7eb4[_0x6994('0x2f')][_0x6994('0x37')]);_0x128da3[_0x6994('0x38')]=qs[_0x6994('0x31')](_[_0x6994('0x39')](_0x4c7eb4['query'],_0x45c590[_0x6994('0x31')]),_0x5b714f);if(_0x4c7eb4[_0x6994('0x2f')][_0x6994('0x3a')]){_0x128da3[_0x6994('0x38')]=_['merge'](_0x128da3['where'],{'$or':_['map'](_0x5b714f,function(_0xfc6a6d){if(_0xfc6a6d[_0x6994('0x2c')]!==_0x6994('0x3b')){var _0x129c41={};_0x129c41[_0xfc6a6d[_0x6994('0x28')]]={'$like':'%'+_0x4c7eb4[_0x6994('0x2f')]['filter']+'%'};return _0x129c41;}})});}_0x128da3=_[_0x6994('0x3c')]({},_0x128da3,_0x4c7eb4[_0x6994('0x3d')]);var _0x4a47f7={'where':_0x128da3['where']};return db[_0x6994('0x3e')][_0x6994('0x3f')](_0x4a47f7)[_0x6994('0x26')](function(_0x3206e0){_0xbd265a[_0x6994('0x3f')]=_0x3206e0;if(_0x4c7eb4[_0x6994('0x2f')]['includeAll']){_0x128da3[_0x6994('0x40')]=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x128da3);})[_0x6994('0x26')](function(_0x2d355c){_0xbd265a[_0x6994('0x41')]=_0x2d355c;return _0xbd265a;})[_0x6994('0x26')](respondWithFilteredResult(_0x550197,_0x128da3))['catch'](handleError(_0x550197,null));};exports['show']=function(_0xa70551,_0x2e0c79){var _0x24d149={'raw':![],'where':{'id':_0xa70551[_0x6994('0x42')]['id']}},_0x2c0cd={};_0x2c0cd[_0x6994('0x2e')]=_[_0x6994('0x30')](db[_0x6994('0x3e')][_0x6994('0x43')]);_0x2c0cd[_0x6994('0x2f')]=_[_0x6994('0x30')](_0xa70551[_0x6994('0x2f')]);_0x2c0cd[_0x6994('0x31')]=_[_0x6994('0x32')](_0x2c0cd['model'],_0x2c0cd[_0x6994('0x2f')]);_0x24d149[_0x6994('0x33')]=_[_0x6994('0x32')](_0x2c0cd[_0x6994('0x2e')],qs[_0x6994('0x34')](_0xa70551['query']['fields']));_0x24d149['attributes']=_0x24d149['attributes'][_0x6994('0x35')]?_0x24d149[_0x6994('0x33')]:_0x2c0cd[_0x6994('0x2e')];if(_0xa70551['query'][_0x6994('0x44')]){_0x24d149[_0x6994('0x40')]=[{'all':!![]}];}_0x24d149=_[_0x6994('0x3c')]({},_0x24d149,_0xa70551[_0x6994('0x3d')]);return db[_0x6994('0x3e')][_0x6994('0x45')](_0x24d149)[_0x6994('0x26')](handleEntityNotFound(_0x2e0c79,null))[_0x6994('0x26')](respondWithResult(_0x2e0c79,null))[_0x6994('0x46')](handleError(_0x2e0c79,null));};exports[_0x6994('0x47')]=function(_0x31fe62,_0xdde8d2){return db[_0x6994('0x3e')][_0x6994('0x47')](_0x31fe62[_0x6994('0x48')],{})['then'](respondWithResult(_0xdde8d2,0xc9))['catch'](handleError(_0xdde8d2,null));};exports[_0x6994('0x25')]=function(_0x85a9e2,_0x28dd27){if(_0x85a9e2[_0x6994('0x48')]['id']){delete _0x85a9e2[_0x6994('0x48')]['id'];}return db['VtigerConfiguration'][_0x6994('0x45')]({'where':{'id':_0x85a9e2[_0x6994('0x42')]['id']}})[_0x6994('0x26')](handleEntityNotFound(_0x28dd27,null))[_0x6994('0x26')](saveUpdates(_0x85a9e2['body'],null))[_0x6994('0x26')](respondWithResult(_0x28dd27,null))[_0x6994('0x46')](handleError(_0x28dd27,null));};exports[_0x6994('0x49')]=function(_0x2646f3,_0x3120b3){return db[_0x6994('0x3e')][_0x6994('0x45')]({'where':{'id':_0x2646f3['params']['id']}})[_0x6994('0x26')](handleEntityNotFound(_0x3120b3,null))[_0x6994('0x26')](removeEntity(_0x3120b3,null))[_0x6994('0x46')](handleError(_0x3120b3,null));};exports[_0x6994('0x4a')]=function(_0x30f074,_0x20d0f9,_0x8b4e3c){var _0x4346dd={};var _0x3b1ee7={};var _0x181c0d;var _0x4a3870;return db[_0x6994('0x3e')]['findOne']({'where':{'id':_0x30f074[_0x6994('0x42')]['id']}})[_0x6994('0x26')](handleEntityNotFound(_0x20d0f9,null))[_0x6994('0x26')](function(_0x236b23){if(_0x236b23){_0x181c0d=_0x236b23;_0x3b1ee7['model']=_[_0x6994('0x30')](db['VtigerField']['rawAttributes']);_0x3b1ee7[_0x6994('0x2f')]=_['keys'](_0x30f074[_0x6994('0x2f')]);_0x3b1ee7['filters']=_['intersection'](_0x3b1ee7[_0x6994('0x2e')],_0x3b1ee7['query']);_0x4346dd[_0x6994('0x33')]=_[_0x6994('0x32')](_0x3b1ee7[_0x6994('0x2e')],qs[_0x6994('0x34')](_0x30f074[_0x6994('0x2f')][_0x6994('0x34')]));_0x4346dd[_0x6994('0x33')]=_0x4346dd[_0x6994('0x33')]['length']?_0x4346dd['attributes']:_0x3b1ee7[_0x6994('0x2e')];_0x4346dd[_0x6994('0x36')]=qs['sort'](_0x30f074[_0x6994('0x2f')][_0x6994('0x37')]);_0x4346dd['where']=qs['filters'](_[_0x6994('0x39')](_0x30f074['query'],_0x3b1ee7[_0x6994('0x31')]));if(_0x30f074[_0x6994('0x2f')][_0x6994('0x3a')]){_0x4346dd[_0x6994('0x38')]=_[_0x6994('0x3c')](_0x4346dd[_0x6994('0x38')],{'$or':_['map'](_0x4346dd[_0x6994('0x33')],function(_0x3fed25){var _0xc2a7de={};_0xc2a7de[_0x3fed25]={'$like':'%'+_0x30f074[_0x6994('0x2f')][_0x6994('0x3a')]+'%'};return _0xc2a7de;})});}_0x4346dd=_['merge']({},_0x4346dd,_0x30f074[_0x6994('0x3d')]);return _0x181c0d[_0x6994('0x4a')](_0x4346dd);}})[_0x6994('0x26')](function(_0x48068d){if(_0x48068d){_0x4a3870=_0x48068d[_0x6994('0x35')];if(!_0x30f074['query'][_0x6994('0x4b')](_0x6994('0x4c'))){_0x4346dd['limit']=qs[_0x6994('0x1f')](_0x30f074[_0x6994('0x2f')][_0x6994('0x1f')]);_0x4346dd['offset']=qs[_0x6994('0x20')](_0x30f074[_0x6994('0x2f')]['offset']);}return _0x181c0d[_0x6994('0x4a')](_0x4346dd);}})['then'](function(_0x3afcaf){if(_0x3afcaf){return _0x3afcaf?{'count':_0x4a3870,'rows':_0x3afcaf}:null;}})[_0x6994('0x26')](respondWithResult(_0x20d0f9,null))['catch'](handleError(_0x20d0f9,null));};exports[_0x6994('0x4d')]=function(_0xcc9646,_0x76247f,_0x2fde4c){var _0x1dcd4a={};var _0x5671b8={};var _0x4fa337;var _0x439a75;return db[_0x6994('0x3e')][_0x6994('0x4e')]({'where':{'id':_0xcc9646[_0x6994('0x42')]['id']}})[_0x6994('0x26')](handleEntityNotFound(_0x76247f,null))['then'](function(_0x2dd842){if(_0x2dd842){_0x4fa337=_0x2dd842;_0x5671b8[_0x6994('0x2e')]=_[_0x6994('0x30')](db[_0x6994('0x4f')]['rawAttributes']);_0x5671b8['query']=_[_0x6994('0x30')](_0xcc9646[_0x6994('0x2f')]);_0x5671b8['filters']=_[_0x6994('0x32')](_0x5671b8[_0x6994('0x2e')],_0x5671b8['query']);_0x1dcd4a[_0x6994('0x33')]=_['intersection'](_0x5671b8['model'],qs['fields'](_0xcc9646['query'][_0x6994('0x34')]));_0x1dcd4a['attributes']=_0x1dcd4a[_0x6994('0x33')][_0x6994('0x35')]?_0x1dcd4a[_0x6994('0x33')]:_0x5671b8['model'];_0x1dcd4a[_0x6994('0x36')]=qs[_0x6994('0x37')](_0xcc9646[_0x6994('0x2f')]['sort']);_0x1dcd4a[_0x6994('0x38')]=qs[_0x6994('0x31')](_['pick'](_0xcc9646[_0x6994('0x2f')],_0x5671b8[_0x6994('0x31')]));if(_0xcc9646['query'][_0x6994('0x3a')]){_0x1dcd4a[_0x6994('0x38')]=_[_0x6994('0x3c')](_0x1dcd4a[_0x6994('0x38')],{'$or':_[_0x6994('0x2a')](_0x1dcd4a[_0x6994('0x33')],function(_0x4e7e6e){var _0x1a59fb={};_0x1a59fb[_0x4e7e6e]={'$like':'%'+_0xcc9646['query'][_0x6994('0x3a')]+'%'};return _0x1a59fb;})});}_0x1dcd4a=_[_0x6994('0x3c')]({},_0x1dcd4a,_0xcc9646['options']);return _0x4fa337[_0x6994('0x4d')](_0x1dcd4a);}})[_0x6994('0x26')](function(_0xa51bc2){if(_0xa51bc2){_0x439a75=_0xa51bc2[_0x6994('0x35')];if(!_0xcc9646[_0x6994('0x2f')][_0x6994('0x4b')](_0x6994('0x4c'))){_0x1dcd4a[_0x6994('0x1f')]=qs[_0x6994('0x1f')](_0xcc9646['query'][_0x6994('0x1f')]);_0x1dcd4a[_0x6994('0x20')]=qs[_0x6994('0x20')](_0xcc9646['query'][_0x6994('0x20')]);}return _0x4fa337[_0x6994('0x4d')](_0x1dcd4a);}})[_0x6994('0x26')](function(_0x35e60f){if(_0x35e60f){return _0x35e60f?{'count':_0x439a75,'rows':_0x35e60f}:null;}})[_0x6994('0x26')](respondWithResult(_0x76247f,null))[_0x6994('0x46')](handleError(_0x76247f,null));};exports[_0x6994('0x50')]=function(_0x48b6ba,_0x4587af,_0x47ed66){var _0x33ad40={};var _0x338076={};var _0x26fd16;var _0x1d3977;return db[_0x6994('0x3e')]['findOne']({'where':{'id':_0x48b6ba[_0x6994('0x42')]['id']}})['then'](handleEntityNotFound(_0x4587af,null))[_0x6994('0x26')](function(_0x1b6179){if(_0x1b6179){_0x26fd16=_0x1b6179;_0x338076[_0x6994('0x2e')]=_[_0x6994('0x30')](db['VtigerField'][_0x6994('0x43')]);_0x338076['query']=_[_0x6994('0x30')](_0x48b6ba[_0x6994('0x2f')]);_0x338076[_0x6994('0x31')]=_[_0x6994('0x32')](_0x338076[_0x6994('0x2e')],_0x338076[_0x6994('0x2f')]);_0x33ad40[_0x6994('0x33')]=_[_0x6994('0x32')](_0x338076[_0x6994('0x2e')],qs['fields'](_0x48b6ba[_0x6994('0x2f')]['fields']));_0x33ad40[_0x6994('0x33')]=_0x33ad40[_0x6994('0x33')][_0x6994('0x35')]?_0x33ad40[_0x6994('0x33')]:_0x338076['model'];_0x33ad40['order']=qs['sort'](_0x48b6ba[_0x6994('0x2f')][_0x6994('0x37')]);_0x33ad40[_0x6994('0x38')]=qs['filters'](_[_0x6994('0x39')](_0x48b6ba['query'],_0x338076[_0x6994('0x31')]));if(_0x48b6ba['query']['filter']){_0x33ad40[_0x6994('0x38')]=_[_0x6994('0x3c')](_0x33ad40[_0x6994('0x38')],{'$or':_[_0x6994('0x2a')](_0x33ad40[_0x6994('0x33')],function(_0x58a6ba){var _0x3c908c={};_0x3c908c[_0x58a6ba]={'$like':'%'+_0x48b6ba[_0x6994('0x2f')][_0x6994('0x3a')]+'%'};return _0x3c908c;})});}_0x33ad40=_[_0x6994('0x3c')]({},_0x33ad40,_0x48b6ba[_0x6994('0x3d')]);return _0x26fd16[_0x6994('0x50')](_0x33ad40);}})[_0x6994('0x26')](function(_0x350107){if(_0x350107){_0x1d3977=_0x350107[_0x6994('0x35')];if(!_0x48b6ba[_0x6994('0x2f')][_0x6994('0x4b')](_0x6994('0x4c'))){_0x33ad40[_0x6994('0x1f')]=qs['limit'](_0x48b6ba[_0x6994('0x2f')]['limit']);_0x33ad40['offset']=qs['offset'](_0x48b6ba[_0x6994('0x2f')][_0x6994('0x20')]);}return _0x26fd16[_0x6994('0x50')](_0x33ad40);}})[_0x6994('0x26')](function(_0x47e868){if(_0x47e868){return _0x47e868?{'count':_0x1d3977,'rows':_0x47e868}:null;}})[_0x6994('0x26')](respondWithResult(_0x4587af,null))[_0x6994('0x46')](handleError(_0x4587af,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 89fdd18..195c5e4 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 _0x3909=['rimraf','exports','VtigerConfiguration','int_vtiger_configurations','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3909,0x11c));var _0x9390=function(_0x10d8c7,_0xa80d12){_0x10d8c7=_0x10d8c7-0x0;var _0x4105b9=_0x3909[_0x10d8c7];return _0x4105b9;};'use strict';var _=require(_0x9390('0x0'));var util=require(_0x9390('0x1'));var logger=require('../../config/logger')(_0x9390('0x2'));var moment=require(_0x9390('0x3'));var BPromise=require(_0x9390('0x4'));var rp=require(_0x9390('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9390('0x6'));var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module[_0x9390('0x7')]=function(_0x249041,_0x449fc3){return _0x249041['define'](_0x9390('0x8'),attributes,{'tableName':_0x9390('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc65a=['define','VtigerConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0xc0e2c4,_0xa4c81e){var _0x3e378c=function(_0x18bc29){while(--_0x18bc29){_0xc0e2c4['push'](_0xc0e2c4['shift']());}};_0x3e378c(++_0xa4c81e);}(_0xc65a,0x6e));var _0xac65=function(_0x483ded,_0x120b5e){_0x483ded=_0x483ded-0x0;var _0x364c4f=_0xc65a[_0x483ded];return _0x364c4f;};'use strict';var _=require(_0xac65('0x0'));var util=require(_0xac65('0x1'));var logger=require(_0xac65('0x2'))(_0xac65('0x3'));var moment=require(_0xac65('0x4'));var BPromise=require(_0xac65('0x5'));var rp=require(_0xac65('0x6'));var fs=require('fs');var path=require(_0xac65('0x7'));var rimraf=require('rimraf');var config=require(_0xac65('0x8'));var attributes=require(_0xac65('0x9'));module['exports']=function(_0x35ebf1,_0x5215d6){return _0x35ebf1[_0xac65('0xa')](_0xac65('0xb'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 40f7f74..a9b905e 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 _0x17f2=['stringify','code','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x15fd73,_0x4b68b3){var _0x54f633=function(_0x1f8003){while(--_0x1f8003){_0x15fd73['push'](_0x15fd73['shift']());}};_0x54f633(++_0x4b68b3);}(_0x17f2,0x17c));var _0x217f=function(_0x3dea7d,_0x2cd4ea){_0x3dea7d=_0x3dea7d-0x0;var _0x53919a=_0x17f2[_0x3dea7d];return _0x53919a;};'use strict';var _=require(_0x217f('0x0'));var util=require(_0x217f('0x1'));var moment=require('moment');var BPromise=require(_0x217f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x217f('0x3'));var db=require(_0x217f('0x4'))['db'];var utils=require(_0x217f('0x5'));var logger=require(_0x217f('0x6'))(_0x217f('0x7'));var config=require(_0x217f('0x8'));var jayson=require(_0x217f('0x9'));var client=jayson[_0x217f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x366df2,_0x25a493,_0x3b3709){return new BPromise(function(_0x498857,_0x20385e){return client['request'](_0x366df2,_0x3b3709)[_0x217f('0xb')](function(_0x24dbd7){logger[_0x217f('0xc')](_0x217f('0xd'),_0x25a493,'request\x20sent');logger[_0x217f('0xe')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x25a493,_0x217f('0xf'),JSON[_0x217f('0x10')](_0x24dbd7));if(_0x24dbd7['error']){if(_0x24dbd7['error'][_0x217f('0x11')]===0x1f4){logger[_0x217f('0x12')](_0x217f('0xd'),_0x25a493,_0x24dbd7[_0x217f('0x12')][_0x217f('0x13')]);return _0x20385e(_0x24dbd7['error'][_0x217f('0x13')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x25a493,_0x24dbd7[_0x217f('0x12')][_0x217f('0x13')]);return _0x498857(_0x24dbd7['error'][_0x217f('0x13')]);}else{logger[_0x217f('0xc')](_0x217f('0xd'),_0x25a493,'request\x20sent');_0x498857(_0x24dbd7[_0x217f('0x14')][_0x217f('0x13')]);}})[_0x217f('0x15')](function(_0x1ebe1d){logger[_0x217f('0x12')](_0x217f('0xd'),_0x25a493,_0x1ebe1d);_0x20385e(_0x1ebe1d);});});} \ No newline at end of file +var _0xb66a=['info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x321f13,_0x33f309){var _0x5f1dc8=function(_0x7355cb){while(--_0x7355cb){_0x321f13['push'](_0x321f13['shift']());}};_0x5f1dc8(++_0x33f309);}(_0xb66a,0xda));var _0xab66=function(_0x3aff01,_0x5c3868){_0x3aff01=_0x3aff01-0x0;var _0x5426dc=_0xb66a[_0x3aff01];return _0x5426dc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab66('0x0'));var BPromise=require(_0xab66('0x1'));var rs=require(_0xab66('0x2'));var fs=require('fs');var Redis=require(_0xab66('0x3'));var db=require(_0xab66('0x4'))['db'];var utils=require(_0xab66('0x5'));var logger=require(_0xab66('0x6'))(_0xab66('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xab66('0x8')][_0xab66('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c222a,_0x23fe30,_0x2d6d75){return new BPromise(function(_0x3b900c,_0x21ebbc){return client['request'](_0x2c222a,_0x2d6d75)['then'](function(_0x165643){logger[_0xab66('0xa')](_0xab66('0xb'),_0x23fe30,_0xab66('0xc'));logger['debug'](_0xab66('0xd'),_0x23fe30,_0xab66('0xc'),JSON[_0xab66('0xe')](_0x165643));if(_0x165643[_0xab66('0xf')]){if(_0x165643[_0xab66('0xf')]['code']===0x1f4){logger[_0xab66('0xf')](_0xab66('0xb'),_0x23fe30,_0x165643[_0xab66('0xf')][_0xab66('0x10')]);return _0x21ebbc(_0x165643[_0xab66('0xf')][_0xab66('0x10')]);}logger['error'](_0xab66('0xb'),_0x23fe30,_0x165643['error'][_0xab66('0x10')]);return _0x3b900c(_0x165643['error'][_0xab66('0x10')]);}else{logger[_0xab66('0xa')]('VtigerConfiguration,\x20%s,\x20%s',_0x23fe30,_0xab66('0xc'));_0x3b900c(_0x165643[_0xab66('0x11')][_0xab66('0x10')]);}})[_0xab66('0x12')](function(_0x18a415){logger[_0xab66('0xf')](_0xab66('0xb'),_0x23fe30,_0x18a415);_0x21ebbc(_0x18a415);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 969b2ff..3335202 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 _0xa1d1=['index','show','post','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated'];(function(_0x1fb509,_0x16185c){var _0x1899d0=function(_0xfb6f6f){while(--_0xfb6f6f){_0x1fb509['push'](_0x1fb509['shift']());}};_0x1899d0(++_0x16185c);}(_0xa1d1,0x67));var _0x1a1d=function(_0x525279,_0x4092f8){_0x525279=_0x525279-0x0;var _0x1b1f05=_0xa1d1[_0x525279];return _0x1b1f05;};'use strict';var multer=require(_0x1a1d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1a1d('0x1'));var express=require(_0x1a1d('0x2'));var router=express[_0x1a1d('0x3')]();var fs_extra=require(_0x1a1d('0x4'));var auth=require(_0x1a1d('0x5'));var interaction=require(_0x1a1d('0x6'));var config=require(_0x1a1d('0x7'));var controller=require(_0x1a1d('0x8'));router[_0x1a1d('0x9')]('/',auth[_0x1a1d('0xa')](),controller[_0x1a1d('0xb')]);router['get']('/:id',auth[_0x1a1d('0xa')](),controller[_0x1a1d('0xc')]);router[_0x1a1d('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1a1d('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x1a1d('0xf')]);router[_0x1a1d('0x10')]('/:id',auth[_0x1a1d('0xa')](),controller[_0x1a1d('0x11')]);module[_0x1a1d('0x12')]=router; \ No newline at end of file +var _0xcb06=['post','create','put','update','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','index','get','/:id','show'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcb06,0x1a4));var _0x6cb0=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0xcb06[_0x52e363];return _0x3fc2b5;};'use strict';var multer=require('multer');var util=require(_0x6cb0('0x0'));var path=require('path');var timeout=require(_0x6cb0('0x1'));var express=require('express');var router=express[_0x6cb0('0x2')]();var fs_extra=require(_0x6cb0('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6cb0('0x4'));var config=require(_0x6cb0('0x5'));var controller=require(_0x6cb0('0x6'));router['get']('/',auth[_0x6cb0('0x7')](),controller[_0x6cb0('0x8')]);router[_0x6cb0('0x9')](_0x6cb0('0xa'),auth['isAuthenticated'](),controller[_0x6cb0('0xb')]);router[_0x6cb0('0xc')]('/',auth['isAuthenticated'](),controller[_0x6cb0('0xd')]);router[_0x6cb0('0xe')](_0x6cb0('0xa'),auth[_0x6cb0('0x7')](),controller[_0x6cb0('0xf')]);router[_0x6cb0('0x10')]('/:id',auth[_0x6cb0('0x7')](),controller[_0x6cb0('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 0ce0fbd..7557891 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 _0x005a=['customVariable','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x005a,0x17c));var _0xa005=function(_0x234ac0,_0x44f8f1){_0x234ac0=_0x234ac0-0x0;var _0x882e83=_0x005a[_0x234ac0];return _0x882e83;};'use strict';var Sequelize=require(_0xa005('0x0'));module[_0xa005('0x1')]={'type':{'type':Sequelize[_0xa005('0x2')](_0xa005('0x3'),'variable',_0xa005('0x4'),'keyValue','picklist'),'defaultValue':_0xa005('0x3')},'content':{'type':Sequelize[_0xa005('0x5')]},'key':{'type':Sequelize[_0xa005('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xa005('0x3'),_0xa005('0x6'),_0xa005('0x4'))},'keyContent':{'type':Sequelize[_0xa005('0x5')]},'idField':{'type':Sequelize[_0xa005('0x5')]},'nameField':{'type':Sequelize[_0xa005('0x5')]},'customField':{'type':Sequelize[_0xa005('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa005('0x5')]}}; \ No newline at end of file +var _0x9ff0=['customVariable','keyValue','STRING','string','BOOLEAN','sequelize','ENUM','variable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ff0,0x19d));var _0x09ff=function(_0x3febbd,_0x68809d){_0x3febbd=_0x3febbd-0x0;var _0x257320=_0x9ff0[_0x3febbd];return _0x257320;};'use strict';var Sequelize=require(_0x09ff('0x0'));module['exports']={'type':{'type':Sequelize[_0x09ff('0x1')]('string',_0x09ff('0x2'),_0x09ff('0x3'),_0x09ff('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x09ff('0x5')]},'keyType':{'type':Sequelize[_0x09ff('0x1')](_0x09ff('0x6'),_0x09ff('0x2'),_0x09ff('0x3'))},'keyContent':{'type':Sequelize[_0x09ff('0x5')]},'idField':{'type':Sequelize[_0x09ff('0x5')]},'nameField':{'type':Sequelize[_0x09ff('0x5')]},'customField':{'type':Sequelize[_0x09ff('0x7')],'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 d322f43..8de84e3 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 _0xb1f6=['util','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','stack','name','VtigerField','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','show','params','find','catch','create','update','body','destroy','rimraf','zip-dir'];(function(_0x1556ff,_0x4fd2ef){var _0x357e2e=function(_0xea81a7){while(--_0xea81a7){_0x1556ff['push'](_0x1556ff['shift']());}};_0x357e2e(++_0x4fd2ef);}(_0xb1f6,0x14d));var _0x6b1f=function(_0x226cd0,_0x4dab3b){_0x226cd0=_0x226cd0-0x0;var _0x2fcbfe=_0xb1f6[_0x226cd0];return _0x2fcbfe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6b1f('0x0'));var zipdir=require(_0x6b1f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6b1f('0x2'));var path=require('path');var sox=require('sox');var csv=require(_0x6b1f('0x3'));var ejs=require(_0x6b1f('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6b1f('0x5'));var squel=require(_0x6b1f('0x6'));var crypto=require('crypto');var jsforce=require(_0x6b1f('0x7'));var deskjs=require('desk.js');var toCsv=require(_0x6b1f('0x3'));var querystring=require(_0x6b1f('0x8'));var Papa=require(_0x6b1f('0x9'));var Redis=require(_0x6b1f('0xa'));var authService=require('../../components/auth/service');var qs=require(_0x6b1f('0xb'));var as=require(_0x6b1f('0xc'));var hardwareService=require(_0x6b1f('0xd'));var logger=require('../../config/logger')(_0x6b1f('0xe'));var utils=require('../../config/utils');var config=require(_0x6b1f('0xf'));var licenseUtil=require(_0x6b1f('0x10'));var db=require(_0x6b1f('0x11'))['db'];function respondWithStatusCode(_0x5a8713,_0x4ce08d){_0x4ce08d=_0x4ce08d||0xcc;return function(_0x2bafa0){if(_0x2bafa0){return _0x5a8713[_0x6b1f('0x12')](_0x4ce08d);}return _0x5a8713['status'](_0x4ce08d)[_0x6b1f('0x13')]();};}function respondWithResult(_0x281582,_0x379430){_0x379430=_0x379430||0xc8;return function(_0xe1b7fd){if(_0xe1b7fd){return _0x281582[_0x6b1f('0x14')](_0x379430)[_0x6b1f('0x15')](_0xe1b7fd);}};}function respondWithFilteredResult(_0x1101df,_0x363638){return function(_0x24b042){if(_0x24b042){var _0x4a0f12=typeof _0x363638[_0x6b1f('0x16')]===_0x6b1f('0x17')&&typeof _0x363638['limit']==='undefined';var _0x5ed174=_0x24b042[_0x6b1f('0x18')];var _0x35d88b=_0x4a0f12?0x0:_0x363638[_0x6b1f('0x16')];var _0x34efc5=_0x4a0f12?_0x24b042['count']:_0x363638['offset']+_0x363638['limit'];var _0x41bd5e;if(_0x34efc5>=_0x5ed174){_0x34efc5=_0x5ed174;_0x41bd5e=0xc8;}else{_0x41bd5e=0xce;}_0x1101df[_0x6b1f('0x14')](_0x41bd5e);return _0x1101df[_0x6b1f('0x19')](_0x6b1f('0x1a'),_0x35d88b+'-'+_0x34efc5+'/'+_0x5ed174)['json'](_0x24b042);}return null;};}function patchUpdates(_0x4aa63a){return function(_0x4e5341){try{jsonpatch[_0x6b1f('0x1b')](_0x4e5341,_0x4aa63a,!![]);}catch(_0x4f1a9f){return BPromise[_0x6b1f('0x1c')](_0x4f1a9f);}return _0x4e5341[_0x6b1f('0x1d')]();};}function saveUpdates(_0x456a20,_0xbcb827){return function(_0x2c4b1b){if(_0x2c4b1b){return _0x2c4b1b['update'](_0x456a20)[_0x6b1f('0x1e')](function(_0x4a5b6a){return _0x4a5b6a;});}return null;};}function removeEntity(_0x5cdebb,_0x10a6d1){return function(_0x20495f){if(_0x20495f){return _0x20495f['destroy']()[_0x6b1f('0x1e')](function(){_0x5cdebb[_0x6b1f('0x14')](0xcc)[_0x6b1f('0x13')]();});}};}function handleEntityNotFound(_0xffb7e8,_0x16e384){return function(_0x53bba0){if(!_0x53bba0){_0xffb7e8[_0x6b1f('0x12')](0x194);}return _0x53bba0;};}function handleError(_0xef457a,_0x548115){_0x548115=_0x548115||0x1f4;return function(_0x31c27c){logger['error'](_0x31c27c[_0x6b1f('0x1f')]);if(_0x31c27c[_0x6b1f('0x20')]){delete _0x31c27c[_0x6b1f('0x20')];}_0xef457a[_0x6b1f('0x14')](_0x548115)['send'](_0x31c27c);};}exports['index']=function(_0x227f6f,_0x5e0472){var _0x901780={},_0xcf2e25={},_0x82a35={'count':0x0,'rows':[]};var _0x3a5741=_['map'](db[_0x6b1f('0x21')][_0x6b1f('0x22')],function(_0x3726c6){return{'name':_0x3726c6[_0x6b1f('0x23')],'type':_0x3726c6['type'][_0x6b1f('0x24')]};});_0xcf2e25[_0x6b1f('0x25')]=_[_0x6b1f('0x26')](_0x3a5741,'name');_0xcf2e25['query']=_[_0x6b1f('0x27')](_0x227f6f[_0x6b1f('0x28')]);_0xcf2e25[_0x6b1f('0x29')]=_[_0x6b1f('0x2a')](_0xcf2e25[_0x6b1f('0x25')],_0xcf2e25[_0x6b1f('0x28')]);_0x901780[_0x6b1f('0x2b')]=_[_0x6b1f('0x2a')](_0xcf2e25[_0x6b1f('0x25')],qs[_0x6b1f('0x2c')](_0x227f6f[_0x6b1f('0x28')][_0x6b1f('0x2c')]));_0x901780[_0x6b1f('0x2b')]=_0x901780[_0x6b1f('0x2b')][_0x6b1f('0x2d')]?_0x901780[_0x6b1f('0x2b')]:_0xcf2e25[_0x6b1f('0x25')];if(!_0x227f6f[_0x6b1f('0x28')]['hasOwnProperty'](_0x6b1f('0x2e'))){_0x901780[_0x6b1f('0x2f')]=qs['limit'](_0x227f6f[_0x6b1f('0x28')]['limit']);_0x901780[_0x6b1f('0x16')]=qs[_0x6b1f('0x16')](_0x227f6f[_0x6b1f('0x28')][_0x6b1f('0x16')]);}_0x901780[_0x6b1f('0x30')]=qs[_0x6b1f('0x31')](_0x227f6f[_0x6b1f('0x28')][_0x6b1f('0x31')]);_0x901780[_0x6b1f('0x32')]=qs['filters'](_[_0x6b1f('0x33')](_0x227f6f['query'],_0xcf2e25[_0x6b1f('0x29')]),_0x3a5741);if(_0x227f6f[_0x6b1f('0x28')][_0x6b1f('0x34')]){_0x901780[_0x6b1f('0x32')]=_[_0x6b1f('0x35')](_0x901780['where'],{'$or':_[_0x6b1f('0x26')](_0x3a5741,function(_0x219de1){if(_0x219de1[_0x6b1f('0x36')]!==_0x6b1f('0x37')){var _0x5d702b={};_0x5d702b[_0x219de1[_0x6b1f('0x20')]]={'$like':'%'+_0x227f6f[_0x6b1f('0x28')]['filter']+'%'};return _0x5d702b;}})});}_0x901780=_['merge']({},_0x901780,_0x227f6f[_0x6b1f('0x38')]);var _0x29c364={'where':_0x901780[_0x6b1f('0x32')]};return db[_0x6b1f('0x21')][_0x6b1f('0x18')](_0x29c364)[_0x6b1f('0x1e')](function(_0x27f8cd){_0x82a35[_0x6b1f('0x18')]=_0x27f8cd;if(_0x227f6f['query'][_0x6b1f('0x39')]){_0x901780[_0x6b1f('0x3a')]=[{'all':!![]}];}return db[_0x6b1f('0x21')]['findAll'](_0x901780);})['then'](function(_0x1cd4ba){_0x82a35['rows']=_0x1cd4ba;return _0x82a35;})[_0x6b1f('0x1e')](respondWithFilteredResult(_0x5e0472,_0x901780))['catch'](handleError(_0x5e0472,null));};exports[_0x6b1f('0x3b')]=function(_0x3d13b8,_0x2e74c4){var _0xfbfa56={'raw':!![],'where':{'id':_0x3d13b8[_0x6b1f('0x3c')]['id']}},_0x15b7d5={};_0x15b7d5[_0x6b1f('0x25')]=_[_0x6b1f('0x27')](db[_0x6b1f('0x21')][_0x6b1f('0x22')]);_0x15b7d5[_0x6b1f('0x28')]=_[_0x6b1f('0x27')](_0x3d13b8[_0x6b1f('0x28')]);_0x15b7d5[_0x6b1f('0x29')]=_[_0x6b1f('0x2a')](_0x15b7d5[_0x6b1f('0x25')],_0x15b7d5['query']);_0xfbfa56[_0x6b1f('0x2b')]=_[_0x6b1f('0x2a')](_0x15b7d5[_0x6b1f('0x25')],qs[_0x6b1f('0x2c')](_0x3d13b8[_0x6b1f('0x28')]['fields']));_0xfbfa56['attributes']=_0xfbfa56[_0x6b1f('0x2b')][_0x6b1f('0x2d')]?_0xfbfa56['attributes']:_0x15b7d5[_0x6b1f('0x25')];if(_0x3d13b8[_0x6b1f('0x28')][_0x6b1f('0x39')]){_0xfbfa56[_0x6b1f('0x3a')]=[{'all':!![]}];}_0xfbfa56=_['merge']({},_0xfbfa56,_0x3d13b8['options']);return db[_0x6b1f('0x21')][_0x6b1f('0x3d')](_0xfbfa56)[_0x6b1f('0x1e')](handleEntityNotFound(_0x2e74c4,null))[_0x6b1f('0x1e')](respondWithResult(_0x2e74c4,null))[_0x6b1f('0x3e')](handleError(_0x2e74c4,null));};exports[_0x6b1f('0x3f')]=function(_0x27ea30,_0x2b9cad){return db[_0x6b1f('0x21')][_0x6b1f('0x3f')](_0x27ea30['body'],{})[_0x6b1f('0x1e')](respondWithResult(_0x2b9cad,0xc9))[_0x6b1f('0x3e')](handleError(_0x2b9cad,null));};exports[_0x6b1f('0x40')]=function(_0x1c943d,_0x25c836){if(_0x1c943d['body']['id']){delete _0x1c943d[_0x6b1f('0x41')]['id'];}return db['VtigerField']['find']({'where':{'id':_0x1c943d['params']['id']}})['then'](handleEntityNotFound(_0x25c836,null))[_0x6b1f('0x1e')](saveUpdates(_0x1c943d['body'],null))[_0x6b1f('0x1e')](respondWithResult(_0x25c836,null))[_0x6b1f('0x3e')](handleError(_0x25c836,null));};exports[_0x6b1f('0x42')]=function(_0x384fe3,_0x6dfe13){return db['VtigerField'][_0x6b1f('0x3d')]({'where':{'id':_0x384fe3['params']['id']}})[_0x6b1f('0x1e')](handleEntityNotFound(_0x6dfe13,null))[_0x6b1f('0x1e')](removeEntity(_0x6dfe13,null))['catch'](handleError(_0x6dfe13,null));}; \ No newline at end of file +var _0x8702=['save','update','then','destroy','error','name','send','map','VtigerField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','order','where','pick','merge','VIRTUAL','filter','findAll','rows','catch','params','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','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','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0x8702,0x134));var _0x2870=function(_0x1158cc,_0x4c0c07){_0x1158cc=_0x1158cc-0x0;var _0x4ad316=_0x8702[_0x1158cc];return _0x4ad316;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2870('0x0'));var zipdir=require(_0x2870('0x1'));var jsonpatch=require(_0x2870('0x2'));var rp=require(_0x2870('0x3'));var moment=require(_0x2870('0x4'));var BPromise=require(_0x2870('0x5'));var Mustache=require(_0x2870('0x6'));var util=require(_0x2870('0x7'));var path=require('path');var sox=require(_0x2870('0x8'));var csv=require(_0x2870('0x9'));var ejs=require(_0x2870('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2870('0xb'));var crypto=require(_0x2870('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2870('0xd'));var toCsv=require(_0x2870('0x9'));var querystring=require(_0x2870('0xe'));var Papa=require(_0x2870('0xf'));var Redis=require(_0x2870('0x10'));var authService=require(_0x2870('0x11'));var qs=require(_0x2870('0x12'));var as=require(_0x2870('0x13'));var hardwareService=require(_0x2870('0x14'));var logger=require(_0x2870('0x15'))('api');var utils=require(_0x2870('0x16'));var config=require(_0x2870('0x17'));var licenseUtil=require(_0x2870('0x18'));var db=require(_0x2870('0x19'))['db'];function respondWithStatusCode(_0x379548,_0x194a60){_0x194a60=_0x194a60||0xcc;return function(_0x1657f0){if(_0x1657f0){return _0x379548[_0x2870('0x1a')](_0x194a60);}return _0x379548[_0x2870('0x1b')](_0x194a60)[_0x2870('0x1c')]();};}function respondWithResult(_0x361ad8,_0x1c16be){_0x1c16be=_0x1c16be||0xc8;return function(_0x3d28d1){if(_0x3d28d1){return _0x361ad8[_0x2870('0x1b')](_0x1c16be)[_0x2870('0x1d')](_0x3d28d1);}};}function respondWithFilteredResult(_0x2b003f,_0x568f56){return function(_0x548ed){if(_0x548ed){var _0x283300=typeof _0x568f56[_0x2870('0x1e')]===_0x2870('0x1f')&&typeof _0x568f56[_0x2870('0x20')]==='undefined';var _0x3a30b8=_0x548ed[_0x2870('0x21')];var _0x2fcbb3=_0x283300?0x0:_0x568f56['offset'];var _0x14b9fa=_0x283300?_0x548ed['count']:_0x568f56[_0x2870('0x1e')]+_0x568f56[_0x2870('0x20')];var _0x25351a;if(_0x14b9fa>=_0x3a30b8){_0x14b9fa=_0x3a30b8;_0x25351a=0xc8;}else{_0x25351a=0xce;}_0x2b003f[_0x2870('0x1b')](_0x25351a);return _0x2b003f['set'](_0x2870('0x22'),_0x2fcbb3+'-'+_0x14b9fa+'/'+_0x3a30b8)[_0x2870('0x1d')](_0x548ed);}return null;};}function patchUpdates(_0x2a842e){return function(_0x20b480){try{jsonpatch[_0x2870('0x23')](_0x20b480,_0x2a842e,!![]);}catch(_0x24bddf){return BPromise[_0x2870('0x24')](_0x24bddf);}return _0x20b480[_0x2870('0x25')]();};}function saveUpdates(_0x313fa0,_0x3ba0ce){return function(_0x5b1393){if(_0x5b1393){return _0x5b1393[_0x2870('0x26')](_0x313fa0)[_0x2870('0x27')](function(_0x1a96cc){return _0x1a96cc;});}return null;};}function removeEntity(_0x20239d,_0x4ef1f7){return function(_0xe089dd){if(_0xe089dd){return _0xe089dd[_0x2870('0x28')]()[_0x2870('0x27')](function(){_0x20239d[_0x2870('0x1b')](0xcc)[_0x2870('0x1c')]();});}};}function handleEntityNotFound(_0x1fd405,_0x334b28){return function(_0x1ad2b6){if(!_0x1ad2b6){_0x1fd405['sendStatus'](0x194);}return _0x1ad2b6;};}function handleError(_0x16c951,_0x5f4c35){_0x5f4c35=_0x5f4c35||0x1f4;return function(_0x407296){logger[_0x2870('0x29')](_0x407296['stack']);if(_0x407296[_0x2870('0x2a')]){delete _0x407296['name'];}_0x16c951[_0x2870('0x1b')](_0x5f4c35)[_0x2870('0x2b')](_0x407296);};}exports['index']=function(_0xc4368b,_0x4b6fbc){var _0x16ea93={},_0x8a0a39={},_0x34d70a={'count':0x0,'rows':[]};var _0x2a5bd6=_[_0x2870('0x2c')](db[_0x2870('0x2d')][_0x2870('0x2e')],function(_0x398d20){return{'name':_0x398d20['fieldName'],'type':_0x398d20['type']['key']};});_0x8a0a39[_0x2870('0x2f')]=_['map'](_0x2a5bd6,_0x2870('0x2a'));_0x8a0a39['query']=_[_0x2870('0x30')](_0xc4368b[_0x2870('0x31')]);_0x8a0a39[_0x2870('0x32')]=_[_0x2870('0x33')](_0x8a0a39[_0x2870('0x2f')],_0x8a0a39[_0x2870('0x31')]);_0x16ea93[_0x2870('0x34')]=_[_0x2870('0x33')](_0x8a0a39['model'],qs[_0x2870('0x35')](_0xc4368b[_0x2870('0x31')][_0x2870('0x35')]));_0x16ea93[_0x2870('0x34')]=_0x16ea93[_0x2870('0x34')]['length']?_0x16ea93[_0x2870('0x34')]:_0x8a0a39[_0x2870('0x2f')];if(!_0xc4368b[_0x2870('0x31')]['hasOwnProperty'](_0x2870('0x36'))){_0x16ea93[_0x2870('0x20')]=qs[_0x2870('0x20')](_0xc4368b['query']['limit']);_0x16ea93[_0x2870('0x1e')]=qs['offset'](_0xc4368b[_0x2870('0x31')][_0x2870('0x1e')]);}_0x16ea93[_0x2870('0x37')]=qs['sort'](_0xc4368b['query']['sort']);_0x16ea93[_0x2870('0x38')]=qs[_0x2870('0x32')](_[_0x2870('0x39')](_0xc4368b[_0x2870('0x31')],_0x8a0a39['filters']),_0x2a5bd6);if(_0xc4368b[_0x2870('0x31')]['filter']){_0x16ea93[_0x2870('0x38')]=_[_0x2870('0x3a')](_0x16ea93[_0x2870('0x38')],{'$or':_[_0x2870('0x2c')](_0x2a5bd6,function(_0xbfd624){if(_0xbfd624['type']!==_0x2870('0x3b')){var _0x29cff5={};_0x29cff5[_0xbfd624[_0x2870('0x2a')]]={'$like':'%'+_0xc4368b['query'][_0x2870('0x3c')]+'%'};return _0x29cff5;}})});}_0x16ea93=_[_0x2870('0x3a')]({},_0x16ea93,_0xc4368b['options']);var _0x1a3856={'where':_0x16ea93[_0x2870('0x38')]};return db[_0x2870('0x2d')][_0x2870('0x21')](_0x1a3856)['then'](function(_0x30fa11){_0x34d70a[_0x2870('0x21')]=_0x30fa11;if(_0xc4368b[_0x2870('0x31')]['includeAll']){_0x16ea93['include']=[{'all':!![]}];}return db[_0x2870('0x2d')][_0x2870('0x3d')](_0x16ea93);})[_0x2870('0x27')](function(_0x3009ef){_0x34d70a[_0x2870('0x3e')]=_0x3009ef;return _0x34d70a;})[_0x2870('0x27')](respondWithFilteredResult(_0x4b6fbc,_0x16ea93))[_0x2870('0x3f')](handleError(_0x4b6fbc,null));};exports['show']=function(_0x1d28ec,_0x58f63b){var _0x3b1731={'raw':!![],'where':{'id':_0x1d28ec[_0x2870('0x40')]['id']}},_0x20b6ce={};_0x20b6ce['model']=_[_0x2870('0x30')](db['VtigerField'][_0x2870('0x2e')]);_0x20b6ce['query']=_[_0x2870('0x30')](_0x1d28ec['query']);_0x20b6ce[_0x2870('0x32')]=_[_0x2870('0x33')](_0x20b6ce[_0x2870('0x2f')],_0x20b6ce['query']);_0x3b1731[_0x2870('0x34')]=_['intersection'](_0x20b6ce[_0x2870('0x2f')],qs[_0x2870('0x35')](_0x1d28ec[_0x2870('0x31')][_0x2870('0x35')]));_0x3b1731[_0x2870('0x34')]=_0x3b1731[_0x2870('0x34')]['length']?_0x3b1731['attributes']:_0x20b6ce[_0x2870('0x2f')];if(_0x1d28ec['query'][_0x2870('0x41')]){_0x3b1731['include']=[{'all':!![]}];}_0x3b1731=_[_0x2870('0x3a')]({},_0x3b1731,_0x1d28ec['options']);return db[_0x2870('0x2d')][_0x2870('0x42')](_0x3b1731)[_0x2870('0x27')](handleEntityNotFound(_0x58f63b,null))['then'](respondWithResult(_0x58f63b,null))[_0x2870('0x3f')](handleError(_0x58f63b,null));};exports['create']=function(_0x4eb451,_0x1c9031){return db[_0x2870('0x2d')][_0x2870('0x43')](_0x4eb451['body'],{})['then'](respondWithResult(_0x1c9031,0xc9))[_0x2870('0x3f')](handleError(_0x1c9031,null));};exports[_0x2870('0x26')]=function(_0x7ac813,_0x417b43){if(_0x7ac813[_0x2870('0x44')]['id']){delete _0x7ac813[_0x2870('0x44')]['id'];}return db[_0x2870('0x2d')]['find']({'where':{'id':_0x7ac813['params']['id']}})[_0x2870('0x27')](handleEntityNotFound(_0x417b43,null))['then'](saveUpdates(_0x7ac813[_0x2870('0x44')],null))['then'](respondWithResult(_0x417b43,null))['catch'](handleError(_0x417b43,null));};exports[_0x2870('0x28')]=function(_0x3bfbe0,_0x15344d){return db['VtigerField']['find']({'where':{'id':_0x3bfbe0['params']['id']}})['then'](handleEntityNotFound(_0x15344d,null))['then'](removeEntity(_0x15344d,null))[_0x2870('0x3f')](handleError(_0x15344d,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index ce803ab..c8ec4d0 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 _0x9677=['path','rimraf','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','bluebird'];(function(_0x41ccec,_0x273430){var _0x5c3eb2=function(_0x217238){while(--_0x217238){_0x41ccec['push'](_0x41ccec['shift']());}};_0x5c3eb2(++_0x273430);}(_0x9677,0x1ea));var _0x7967=function(_0x34c825,_0x44cad4){_0x34c825=_0x34c825-0x0;var _0x2fde13=_0x9677[_0x34c825];return _0x2fde13;};'use strict';var _=require(_0x7967('0x0'));var util=require(_0x7967('0x1'));var logger=require(_0x7967('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7967('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7967('0x4'));var rimraf=require(_0x7967('0x5'));var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module[_0x7967('0x6')]=function(_0x1db010,_0x4df0ed){return _0x1db010[_0x7967('0x7')](_0x7967('0x8'),attributes,{'tableName':_0x7967('0x9'),'paranoid':![],'indexes':[{'name':_0x7967('0xa'),'fields':[_0x7967('0xb'),_0x7967('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0d77=['define','int_vtiger_fields','vtiger_unique_index','idField','FieldId','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes'];(function(_0x1f885e,_0x83ce8){var _0xb76bca=function(_0xca25c0){while(--_0xca25c0){_0x1f885e['push'](_0x1f885e['shift']());}};_0xb76bca(++_0x83ce8);}(_0x0d77,0x18d));var _0x70d7=function(_0x52103c,_0x2c3630){_0x52103c=_0x52103c-0x0;var _0x575c0e=_0x0d77[_0x52103c];return _0x575c0e;};'use strict';var _=require('lodash');var util=require(_0x70d7('0x0'));var logger=require(_0x70d7('0x1'))('api');var moment=require(_0x70d7('0x2'));var BPromise=require(_0x70d7('0x3'));var rp=require(_0x70d7('0x4'));var fs=require('fs');var path=require(_0x70d7('0x5'));var rimraf=require(_0x70d7('0x6'));var config=require(_0x70d7('0x7'));var attributes=require(_0x70d7('0x8'));module['exports']=function(_0x320921,_0x15d3bd){return _0x320921[_0x70d7('0x9')]('VtigerField',attributes,{'tableName':_0x70d7('0xa'),'paranoid':![],'indexes':[{'name':_0x70d7('0xb'),'fields':[_0x70d7('0xc'),_0x70d7('0xd')],'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 b50d20e..b83ed01 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 _0x257b=['../../config/environment','jayson/promise','client','request','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x257b,0xbf));var _0xb257=function(_0x4d6266,_0x5b32bc){_0x4d6266=_0x4d6266-0x0;var _0x3118c8=_0x257b[_0x4d6266];return _0x3118c8;};'use strict';var _=require(_0xb257('0x0'));var util=require(_0xb257('0x1'));var moment=require(_0xb257('0x2'));var BPromise=require(_0xb257('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb257('0x4'));var db=require(_0xb257('0x5'))['db'];var utils=require(_0xb257('0x6'));var logger=require(_0xb257('0x7'))(_0xb257('0x8'));var config=require(_0xb257('0x9'));var jayson=require(_0xb257('0xa'));var client=jayson[_0xb257('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8338bf,_0x1b0043,_0x3b3178){return new BPromise(function(_0x3afb63,_0x595a7c){return client[_0xb257('0xc')](_0x8338bf,_0x3b3178)[_0xb257('0xd')](function(_0x5f54aa){logger[_0xb257('0xe')](_0xb257('0xf'),_0x1b0043,'request\x20sent');logger[_0xb257('0x10')](_0xb257('0x11'),_0x1b0043,_0xb257('0x12'),JSON[_0xb257('0x13')](_0x5f54aa));if(_0x5f54aa[_0xb257('0x14')]){if(_0x5f54aa[_0xb257('0x14')][_0xb257('0x15')]===0x1f4){logger['error'](_0xb257('0xf'),_0x1b0043,_0x5f54aa['error'][_0xb257('0x16')]);return _0x595a7c(_0x5f54aa[_0xb257('0x14')][_0xb257('0x16')]);}logger['error'](_0xb257('0xf'),_0x1b0043,_0x5f54aa['error'][_0xb257('0x16')]);return _0x3afb63(_0x5f54aa[_0xb257('0x14')][_0xb257('0x16')]);}else{logger[_0xb257('0xe')](_0xb257('0xf'),_0x1b0043,'request\x20sent');_0x3afb63(_0x5f54aa[_0xb257('0x17')][_0xb257('0x16')]);}})[_0xb257('0x18')](function(_0x264711){logger[_0xb257('0x14')](_0xb257('0xf'),_0x1b0043,_0x264711);_0x595a7c(_0x264711);});});} \ No newline at end of file +var _0x9897=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x490726,_0x4728a6){var _0x55d52e=function(_0x451e19){while(--_0x451e19){_0x490726['push'](_0x490726['shift']());}};_0x55d52e(++_0x4728a6);}(_0x9897,0x104));var _0x7989=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x9897[_0x432fca];return _0x3adba4;};'use strict';var _=require(_0x7989('0x0'));var util=require(_0x7989('0x1'));var moment=require(_0x7989('0x2'));var BPromise=require('bluebird');var rs=require(_0x7989('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7989('0x4'))['db'];var utils=require(_0x7989('0x5'));var logger=require(_0x7989('0x6'))(_0x7989('0x7'));var config=require(_0x7989('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1a3dcb,_0x788483,_0x5b3d39){return new BPromise(function(_0x5da8f7,_0x4214ca){return client[_0x7989('0x9')](_0x1a3dcb,_0x5b3d39)[_0x7989('0xa')](function(_0x271c43){logger[_0x7989('0xb')](_0x7989('0xc'),_0x788483,_0x7989('0xd'));logger[_0x7989('0xe')](_0x7989('0xf'),_0x788483,'request\x20sent',JSON[_0x7989('0x10')](_0x271c43));if(_0x271c43['error']){if(_0x271c43[_0x7989('0x11')][_0x7989('0x12')]===0x1f4){logger[_0x7989('0x11')]('VtigerField,\x20%s,\x20%s',_0x788483,_0x271c43[_0x7989('0x11')]['message']);return _0x4214ca(_0x271c43[_0x7989('0x11')]['message']);}logger[_0x7989('0x11')]('VtigerField,\x20%s,\x20%s',_0x788483,_0x271c43[_0x7989('0x11')][_0x7989('0x13')]);return _0x5da8f7(_0x271c43[_0x7989('0x11')][_0x7989('0x13')]);}else{logger['info'](_0x7989('0xc'),_0x788483,_0x7989('0xd'));_0x5da8f7(_0x271c43[_0x7989('0x14')][_0x7989('0x13')]);}})[_0x7989('0x15')](function(_0x784424){logger['error']('VtigerField,\x20%s,\x20%s',_0x788483,_0x784424);_0x4214ca(_0x784424);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 672682e..91481bb 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 _0xa543=['put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','post','/:id/configurations','addConfiguration'];(function(_0x1e4c19,_0x495a1a){var _0x1e1b9a=function(_0x586424){while(--_0x586424){_0x1e4c19['push'](_0x1e4c19['shift']());}};_0x1e1b9a(++_0x495a1a);}(_0xa543,0x101));var _0x3a54=function(_0x79007a,_0x249837){_0x79007a=_0x79007a-0x0;var _0x1a18b4=_0xa543[_0x79007a];return _0x1a18b4;};'use strict';var multer=require('multer');var util=require(_0x3a54('0x0'));var path=require(_0x3a54('0x1'));var timeout=require('connect-timeout');var express=require(_0x3a54('0x2'));var router=express[_0x3a54('0x3')]();var fs_extra=require(_0x3a54('0x4'));var auth=require(_0x3a54('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3a54('0x6'));var controller=require(_0x3a54('0x7'));router[_0x3a54('0x8')]('/',auth[_0x3a54('0x9')](),controller['index']);router[_0x3a54('0x8')](_0x3a54('0xa'),auth[_0x3a54('0x9')](),controller[_0x3a54('0xb')]);router[_0x3a54('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x3a54('0xc')]);router[_0x3a54('0x8')]('/:id/fields',auth[_0x3a54('0x9')](),controller['getFields']);router[_0x3a54('0xd')]('/',auth[_0x3a54('0x9')](),controller['create']);router[_0x3a54('0xd')](_0x3a54('0xe'),auth[_0x3a54('0x9')](),controller[_0x3a54('0xf')]);router[_0x3a54('0x10')](_0x3a54('0xa'),auth[_0x3a54('0x9')](),controller[_0x3a54('0x11')]);router[_0x3a54('0x12')](_0x3a54('0xa'),auth['isAuthenticated'](),controller[_0x3a54('0x13')]);module[_0x3a54('0x14')]=router; \ No newline at end of file +var _0x8bf3=['/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put'];(function(_0x39c127,_0x24c1a2){var _0x37f7d7=function(_0x42fe99){while(--_0x42fe99){_0x39c127['push'](_0x39c127['shift']());}};_0x37f7d7(++_0x24c1a2);}(_0x8bf3,0x130));var _0x38bf=function(_0x2eea86,_0x121981){_0x2eea86=_0x2eea86-0x0;var _0x3fcb89=_0x8bf3[_0x2eea86];return _0x3fcb89;};'use strict';var multer=require(_0x38bf('0x0'));var util=require(_0x38bf('0x1'));var path=require(_0x38bf('0x2'));var timeout=require(_0x38bf('0x3'));var express=require(_0x38bf('0x4'));var router=express[_0x38bf('0x5')]();var fs_extra=require(_0x38bf('0x6'));var auth=require(_0x38bf('0x7'));var interaction=require(_0x38bf('0x8'));var config=require('../../config/environment');var controller=require(_0x38bf('0x9'));router[_0x38bf('0xa')]('/',auth[_0x38bf('0xb')](),controller['index']);router[_0x38bf('0xa')]('/:id',auth[_0x38bf('0xb')](),controller[_0x38bf('0xc')]);router[_0x38bf('0xa')](_0x38bf('0xd'),auth[_0x38bf('0xb')](),controller[_0x38bf('0xe')]);router[_0x38bf('0xa')](_0x38bf('0xf'),auth[_0x38bf('0xb')](),controller[_0x38bf('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x38bf('0x11')]);router[_0x38bf('0x12')](_0x38bf('0xd'),auth[_0x38bf('0xb')](),controller[_0x38bf('0x13')]);router[_0x38bf('0x14')](_0x38bf('0x15'),auth[_0x38bf('0xb')](),controller[_0x38bf('0x16')]);router['delete'](_0x38bf('0x15'),auth[_0x38bf('0xb')](),controller[_0x38bf('0x17')]);module[_0x38bf('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 7e72127..b9c82d5 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 _0x4888=['password','token','exports','STRING','username','remoteUri','ENUM'];(function(_0x3403bb,_0x28398b){var _0x1ae5c5=function(_0x545098){while(--_0x545098){_0x3403bb['push'](_0x3403bb['shift']());}};_0x1ae5c5(++_0x28398b);}(_0x4888,0x198));var _0x8488=function(_0x2786ea,_0x16c3c3){_0x2786ea=_0x2786ea-0x0;var _0x5c38e5=_0x4888[_0x2786ea];return _0x5c38e5;};'use strict';var Sequelize=require('sequelize');module[_0x8488('0x0')]={'name':{'type':Sequelize[_0x8488('0x1')]},'description':{'type':Sequelize[_0x8488('0x1')]},'username':{'type':Sequelize[_0x8488('0x1')],'unique':_0x8488('0x2')},'password':{'type':Sequelize[_0x8488('0x1')]},'token':{'type':Sequelize[_0x8488('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8488('0x3')},'authType':{'type':Sequelize[_0x8488('0x4')](_0x8488('0x5'),_0x8488('0x6')),'defaultValue':_0x8488('0x5')},'serverUrl':{'type':Sequelize[_0x8488('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab','newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x1472=['STRING','username','ENUM','password','token','newTab','integrationTab','sequelize','exports'];(function(_0x3ab75e,_0x5abf0d){var _0xc1cfce=function(_0x900176){while(--_0x900176){_0x3ab75e['push'](_0x3ab75e['shift']());}};_0xc1cfce(++_0x5abf0d);}(_0x1472,0x166));var _0x2147=function(_0x4667b2,_0x135b67){_0x4667b2=_0x4667b2-0x0;var _0x1070f2=_0x1472[_0x4667b2];return _0x1070f2;};'use strict';var Sequelize=require(_0x2147('0x0'));module[_0x2147('0x1')]={'name':{'type':Sequelize[_0x2147('0x2')]},'description':{'type':Sequelize[_0x2147('0x2')]},'username':{'type':Sequelize[_0x2147('0x2')],'unique':_0x2147('0x3')},'password':{'type':Sequelize[_0x2147('0x2')]},'token':{'type':Sequelize[_0x2147('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x2147('0x4')](_0x2147('0x5'),_0x2147('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2147('0x4')]('integrationTab',_0x2147('0x7')),'defaultValue':_0x2147('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 5eecd33..ec08804 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 _0xb9a7=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','ZendeskAccount','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getDescriptions','ZendeskConfiguration','getFields','password','token','authType','substring','lastIndexOf','format','%s/%s','ticket_fields','Basic\x20%s','username','toString','headers','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection'];(function(_0x3ea27c,_0xdfcd4f){var _0x1c0d43=function(_0x4160ea){while(--_0x4160ea){_0x3ea27c['push'](_0x3ea27c['shift']());}};_0x1c0d43(++_0xdfcd4f);}(_0xb9a7,0x112));var _0x7b9a=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xb9a7[_0x1694f5];return _0x5b4321;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b9a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b9a('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x7b9a('0x2'));var util=require(_0x7b9a('0x3'));var path=require(_0x7b9a('0x4'));var sox=require(_0x7b9a('0x5'));var csv=require(_0x7b9a('0x6'));var ejs=require(_0x7b9a('0x7'));var fs=require('fs');var fs_extra=require(_0x7b9a('0x8'));var _=require(_0x7b9a('0x9'));var squel=require(_0x7b9a('0xa'));var crypto=require(_0x7b9a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b9a('0xc'));var toCsv=require(_0x7b9a('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7b9a('0xd'));var qs=require(_0x7b9a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b9a('0xf'));var logger=require('../../config/logger')(_0x7b9a('0x10'));var utils=require('../../config/utils');var config=require(_0x7b9a('0x11'));var licenseUtil=require(_0x7b9a('0x12'));var db=require(_0x7b9a('0x13'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x32f616,_0xec5949){_0xec5949=_0xec5949||0xcc;return function(_0x5e3875){if(_0x5e3875){return _0x32f616[_0x7b9a('0x14')](_0xec5949);}return _0x32f616[_0x7b9a('0x15')](_0xec5949)['end']();};}function respondWithResult(_0xb157e5,_0xde180d){_0xde180d=_0xde180d||0xc8;return function(_0x6fa16a){if(_0x6fa16a){return _0xb157e5[_0x7b9a('0x15')](_0xde180d)[_0x7b9a('0x16')](_0x6fa16a);}};}function respondWithFilteredResult(_0x346daa,_0x22a7e4){return function(_0x35e602){if(_0x35e602){var _0x2f1899=typeof _0x22a7e4['offset']===_0x7b9a('0x17')&&typeof _0x22a7e4['limit']===_0x7b9a('0x17');var _0xa217cb=_0x35e602[_0x7b9a('0x18')];var _0x169d16=_0x2f1899?0x0:_0x22a7e4[_0x7b9a('0x19')];var _0x180a67=_0x2f1899?_0x35e602[_0x7b9a('0x18')]:_0x22a7e4[_0x7b9a('0x19')]+_0x22a7e4[_0x7b9a('0x1a')];var _0x588c48;if(_0x180a67>=_0xa217cb){_0x180a67=_0xa217cb;_0x588c48=0xc8;}else{_0x588c48=0xce;}_0x346daa[_0x7b9a('0x15')](_0x588c48);return _0x346daa[_0x7b9a('0x1b')](_0x7b9a('0x1c'),_0x169d16+'-'+_0x180a67+'/'+_0xa217cb)['json'](_0x35e602);}return null;};}function patchUpdates(_0x993048){return function(_0x59a64d){try{jsonpatch[_0x7b9a('0x1d')](_0x59a64d,_0x993048,!![]);}catch(_0x517e93){return BPromise[_0x7b9a('0x1e')](_0x517e93);}return _0x59a64d[_0x7b9a('0x1f')]();};}function saveUpdates(_0x23d812,_0x54fda7){return function(_0x411eea){if(_0x411eea){return _0x411eea[_0x7b9a('0x20')](_0x23d812)['then'](function(_0x35aca7){return _0x35aca7;});}return null;};}function removeEntity(_0x374dca,_0x269c07){return function(_0x2f7d34){if(_0x2f7d34){return _0x2f7d34[_0x7b9a('0x21')]()['then'](function(){_0x374dca[_0x7b9a('0x15')](0xcc)[_0x7b9a('0x22')]();});}};}function handleEntityNotFound(_0x5809f5,_0x39b7ec){return function(_0x4fa111){if(!_0x4fa111){_0x5809f5[_0x7b9a('0x14')](0x194);}return _0x4fa111;};}function handleError(_0x3091ab,_0x4c2271){_0x4c2271=_0x4c2271||0x1f4;return function(_0x55d01c){logger[_0x7b9a('0x23')](_0x55d01c['stack']);if(_0x55d01c['name']){delete _0x55d01c[_0x7b9a('0x24')];}_0x3091ab['status'](_0x4c2271)['send'](_0x55d01c);};}exports[_0x7b9a('0x25')]=function(_0x4d5880,_0x5c89b6){var _0x314b6d={},_0x4fee38={},_0x1553ae={'count':0x0,'rows':[]};var _0x2e6144=_[_0x7b9a('0x26')](db['ZendeskAccount'][_0x7b9a('0x27')],function(_0x2ce78b){return{'name':_0x2ce78b[_0x7b9a('0x28')],'type':_0x2ce78b[_0x7b9a('0x29')][_0x7b9a('0x2a')]};});_0x4fee38[_0x7b9a('0x2b')]=_['map'](_0x2e6144,'name');_0x4fee38[_0x7b9a('0x2c')]=_[_0x7b9a('0x2d')](_0x4d5880[_0x7b9a('0x2c')]);_0x4fee38['filters']=_[_0x7b9a('0x2e')](_0x4fee38[_0x7b9a('0x2b')],_0x4fee38['query']);_0x314b6d['attributes']=_[_0x7b9a('0x2e')](_0x4fee38[_0x7b9a('0x2b')],qs['fields'](_0x4d5880[_0x7b9a('0x2c')][_0x7b9a('0x2f')]));_0x314b6d[_0x7b9a('0x30')]=_0x314b6d[_0x7b9a('0x30')][_0x7b9a('0x31')]?_0x314b6d['attributes']:_0x4fee38[_0x7b9a('0x2b')];if(!_0x4d5880[_0x7b9a('0x2c')][_0x7b9a('0x32')](_0x7b9a('0x33'))){_0x314b6d[_0x7b9a('0x1a')]=qs[_0x7b9a('0x1a')](_0x4d5880['query']['limit']);_0x314b6d[_0x7b9a('0x19')]=qs[_0x7b9a('0x19')](_0x4d5880['query'][_0x7b9a('0x19')]);}_0x314b6d[_0x7b9a('0x34')]=qs[_0x7b9a('0x35')](_0x4d5880['query'][_0x7b9a('0x35')]);_0x314b6d[_0x7b9a('0x36')]=qs['filters'](_['pick'](_0x4d5880[_0x7b9a('0x2c')],_0x4fee38[_0x7b9a('0x37')]),_0x2e6144);if(_0x4d5880[_0x7b9a('0x2c')][_0x7b9a('0x38')]){_0x314b6d[_0x7b9a('0x36')]=_[_0x7b9a('0x39')](_0x314b6d[_0x7b9a('0x36')],{'$or':_[_0x7b9a('0x26')](_0x2e6144,function(_0x4af212){if(_0x4af212[_0x7b9a('0x29')]!=='VIRTUAL'){var _0x213370={};_0x213370[_0x4af212[_0x7b9a('0x24')]]={'$like':'%'+_0x4d5880[_0x7b9a('0x2c')][_0x7b9a('0x38')]+'%'};return _0x213370;}})});}_0x314b6d=_[_0x7b9a('0x39')]({},_0x314b6d,_0x4d5880[_0x7b9a('0x3a')]);var _0x5e504f={'where':_0x314b6d[_0x7b9a('0x36')]};return db[_0x7b9a('0x3b')][_0x7b9a('0x18')](_0x5e504f)[_0x7b9a('0x3c')](function(_0x5af103){_0x1553ae[_0x7b9a('0x18')]=_0x5af103;if(_0x4d5880[_0x7b9a('0x2c')][_0x7b9a('0x3d')]){_0x314b6d[_0x7b9a('0x3e')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x7b9a('0x3f')](_0x314b6d);})['then'](function(_0x1ee576){_0x1553ae[_0x7b9a('0x40')]=_0x1ee576;return _0x1553ae;})[_0x7b9a('0x3c')](respondWithFilteredResult(_0x5c89b6,_0x314b6d))[_0x7b9a('0x41')](handleError(_0x5c89b6,null));};exports[_0x7b9a('0x42')]=function(_0x41f541,_0x56e274){var _0x33edc6={'raw':![],'where':{'id':_0x41f541[_0x7b9a('0x43')]['id']}},_0x85770={};_0x85770['model']=_['keys'](db[_0x7b9a('0x3b')][_0x7b9a('0x27')]);_0x85770[_0x7b9a('0x2c')]=_[_0x7b9a('0x2d')](_0x41f541[_0x7b9a('0x2c')]);_0x85770[_0x7b9a('0x37')]=_['intersection'](_0x85770['model'],_0x85770['query']);_0x33edc6[_0x7b9a('0x30')]=_[_0x7b9a('0x2e')](_0x85770['model'],qs[_0x7b9a('0x2f')](_0x41f541[_0x7b9a('0x2c')][_0x7b9a('0x2f')]));_0x33edc6['attributes']=_0x33edc6[_0x7b9a('0x30')]['length']?_0x33edc6[_0x7b9a('0x30')]:_0x85770[_0x7b9a('0x2b')];if(_0x41f541[_0x7b9a('0x2c')][_0x7b9a('0x3d')]){_0x33edc6[_0x7b9a('0x3e')]=[{'all':!![]}];}_0x33edc6=_['merge']({},_0x33edc6,_0x41f541[_0x7b9a('0x3a')]);return db['ZendeskAccount'][_0x7b9a('0x44')](_0x33edc6)['then'](handleEntityNotFound(_0x56e274,null))['then'](respondWithResult(_0x56e274,null))[_0x7b9a('0x41')](handleError(_0x56e274,null));};exports[_0x7b9a('0x45')]=function(_0x717d08,_0x43cba){return db[_0x7b9a('0x3b')][_0x7b9a('0x45')](_0x717d08[_0x7b9a('0x46')],{})[_0x7b9a('0x3c')](respondWithResult(_0x43cba,0xc9))[_0x7b9a('0x41')](handleError(_0x43cba,null));};exports['update']=function(_0x1d7957,_0x4044ba){if(_0x1d7957['body']['id']){delete _0x1d7957['body']['id'];}return db['ZendeskAccount'][_0x7b9a('0x44')]({'where':{'id':_0x1d7957[_0x7b9a('0x43')]['id']}})[_0x7b9a('0x3c')](handleEntityNotFound(_0x4044ba,null))[_0x7b9a('0x3c')](saveUpdates(_0x1d7957['body'],null))[_0x7b9a('0x3c')](respondWithResult(_0x4044ba,null))[_0x7b9a('0x41')](handleError(_0x4044ba,null));};exports[_0x7b9a('0x21')]=function(_0x33b200,_0x2d083b){return db['ZendeskAccount'][_0x7b9a('0x44')]({'where':{'id':_0x33b200['params']['id']}})[_0x7b9a('0x3c')](handleEntityNotFound(_0x2d083b,null))[_0x7b9a('0x3c')](removeEntity(_0x2d083b,null))[_0x7b9a('0x41')](handleError(_0x2d083b,null));};exports[_0x7b9a('0x47')]=function(_0x52f2ca,_0xd42491,_0x2d353f){var _0x354a87={};var _0x28855a={};var _0x2b0db5;var _0x3e2f1b;return db[_0x7b9a('0x3b')]['findOne']({'where':{'id':_0x52f2ca['params']['id']}})['then'](handleEntityNotFound(_0xd42491,null))[_0x7b9a('0x3c')](function(_0x2f8929){if(_0x2f8929){_0x2b0db5=_0x2f8929;_0x28855a['model']=_['keys'](db['ZendeskConfiguration']['rawAttributes']);_0x28855a[_0x7b9a('0x2c')]=_[_0x7b9a('0x2d')](_0x52f2ca[_0x7b9a('0x2c')]);_0x28855a[_0x7b9a('0x37')]=_[_0x7b9a('0x2e')](_0x28855a[_0x7b9a('0x2b')],_0x28855a[_0x7b9a('0x2c')]);_0x354a87[_0x7b9a('0x30')]=_['intersection'](_0x28855a[_0x7b9a('0x2b')],qs['fields'](_0x52f2ca[_0x7b9a('0x2c')][_0x7b9a('0x2f')]));_0x354a87[_0x7b9a('0x30')]=_0x354a87[_0x7b9a('0x30')][_0x7b9a('0x31')]?_0x354a87['attributes']:_0x28855a[_0x7b9a('0x2b')];_0x354a87['order']=qs[_0x7b9a('0x35')](_0x52f2ca[_0x7b9a('0x2c')][_0x7b9a('0x35')]);_0x354a87['where']=qs['filters'](_['pick'](_0x52f2ca['query'],_0x28855a[_0x7b9a('0x37')]));if(_0x52f2ca[_0x7b9a('0x2c')][_0x7b9a('0x38')]){_0x354a87['where']=_[_0x7b9a('0x39')](_0x354a87[_0x7b9a('0x36')],{'$or':_[_0x7b9a('0x26')](_0x354a87[_0x7b9a('0x30')],function(_0xea7b37){var _0x4c3939={};_0x4c3939[_0xea7b37]={'$like':'%'+_0x52f2ca[_0x7b9a('0x2c')][_0x7b9a('0x38')]+'%'};return _0x4c3939;})});}_0x354a87=_[_0x7b9a('0x39')]({},_0x354a87,_0x52f2ca['options']);return _0x2b0db5['getConfigurations'](_0x354a87);}})['then'](function(_0x14e2d5){if(_0x14e2d5){_0x3e2f1b=_0x14e2d5[_0x7b9a('0x31')];if(!_0x52f2ca[_0x7b9a('0x2c')]['hasOwnProperty'](_0x7b9a('0x33'))){_0x354a87[_0x7b9a('0x1a')]=qs['limit'](_0x52f2ca[_0x7b9a('0x2c')]['limit']);_0x354a87[_0x7b9a('0x19')]=qs['offset'](_0x52f2ca[_0x7b9a('0x2c')][_0x7b9a('0x19')]);}return _0x2b0db5[_0x7b9a('0x47')](_0x354a87);}})[_0x7b9a('0x3c')](function(_0x5d45ae){if(_0x5d45ae){return _0x5d45ae?{'count':_0x3e2f1b,'rows':_0x5d45ae}:null;}})[_0x7b9a('0x3c')](respondWithResult(_0xd42491,null))[_0x7b9a('0x41')](handleError(_0xd42491,null));};exports[_0x7b9a('0x48')]=function(_0x273134,_0x567328,_0x239b62){if(_0x273134['body']['id']){delete _0x273134[_0x7b9a('0x46')]['id'];}return db['ZendeskAccount'][_0x7b9a('0x49')]({'where':{'id':_0x273134['params']['id']}})['then'](handleEntityNotFound(_0x567328,null))['then'](function(_0x48442a){if(_0x48442a){_0x273134[_0x7b9a('0x46')][_0x7b9a('0x4a')]=_0x48442a['id'];_0x273134[_0x7b9a('0x46')][_0x7b9a('0x4b')]=integrations['getSubjects'](_0x273134[_0x7b9a('0x46')]['channel'],_0x273134['body'][_0x7b9a('0x29')]);_0x273134['body']['Descriptions']=integrations[_0x7b9a('0x4c')](_0x273134[_0x7b9a('0x46')]['channel'],_0x273134[_0x7b9a('0x46')]['type']);return db[_0x7b9a('0x4d')][_0x7b9a('0x45')](_0x273134[_0x7b9a('0x46')],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0x7b9a('0x3c')](respondWithResult(_0x567328,null))[_0x7b9a('0x41')](handleError(_0x567328,null));};exports[_0x7b9a('0x4e')]=function(_0x2092b6,_0x261a43,_0x147d23){var _0x45014b='';return db['ZendeskAccount'][_0x7b9a('0x49')]({'where':{'id':_0x2092b6[_0x7b9a('0x43')]['id']},'attributes':['id','username',_0x7b9a('0x4f'),_0x7b9a('0x50'),_0x7b9a('0x51'),'remoteUri']})['then'](handleEntityNotFound(_0x261a43,null))[_0x7b9a('0x3c')](function(_0x8a3d84){if(_0x8a3d84){_0x45014b=_0x8a3d84['remoteUri'];var _0xc64c42=_0x45014b['slice'](-0x1);if(_0xc64c42==='/'){_0x45014b=_0x45014b[_0x7b9a('0x52')](0x0,_0x45014b[_0x7b9a('0x53')](_0xc64c42));}var _0x3a46e9={'method':'GET','uri':util[_0x7b9a('0x54')](_0x7b9a('0x55'),_0x45014b,_0x7b9a('0x56')),'json':!![]};switch(_0x8a3d84[_0x7b9a('0x51')]){case _0x7b9a('0x4f'):_0x3a46e9['headers']={'Authorization':util['format'](_0x7b9a('0x57'),new Buffer(util[_0x7b9a('0x54')]('%s:%s',_0x8a3d84[_0x7b9a('0x58')],_0x8a3d84[_0x7b9a('0x4f')]))[_0x7b9a('0x59')]('base64'))};break;case'token':_0x3a46e9[_0x7b9a('0x5a')]={'Authorization':util[_0x7b9a('0x54')](_0x7b9a('0x57'),new Buffer(util[_0x7b9a('0x54')]('%s/token:%s',_0x8a3d84[_0x7b9a('0x58')],_0x8a3d84[_0x7b9a('0x50')]))[_0x7b9a('0x59')]('base64'))};break;default:throw new db['Sequelize'][(_0x7b9a('0x5b'))](_0x7b9a('0x5c'));}return rp(_0x3a46e9);}})[_0x7b9a('0x3c')](function(_0x1934e2){if(_0x1934e2){var _0x48e5dd=[_0x7b9a('0x5d'),_0x7b9a('0x5e'),'group',_0x7b9a('0x5f')];_[_0x7b9a('0x60')](_0x1934e2[_0x7b9a('0x56')],function(_0x34f229){return _0x48e5dd[_0x7b9a('0x61')](_0x34f229[_0x7b9a('0x29')]);});return{'count':_0x1934e2[_0x7b9a('0x56')][_0x7b9a('0x31')],'rows':_[_0x7b9a('0x26')](_0x1934e2[_0x7b9a('0x56')],function(_0x4c41dc){return{'id':_0x4c41dc['id'],'name':_0x4c41dc['position']>0x7?_0x4c41dc['title']:_0x4c41dc[_0x7b9a('0x29')],'custom':_0x4c41dc[_0x7b9a('0x62')]>0x7?!![]:![],'options':_0x4c41dc['system_field_options']?_0x4c41dc[_0x7b9a('0x63')]:_0x4c41dc[_0x7b9a('0x64')]?_0x4c41dc['custom_field_options']:[]};})};}})[_0x7b9a('0x3c')](respondWithResult(_0x261a43,null))[_0x7b9a('0x41')](function(_0x3774e1){var _0x20c427=_0x2092b6[_0x7b9a('0x2c')][_0x7b9a('0x65')]?0x1f4:_0x3774e1[_0x7b9a('0x66')]||0x1f4;logger[_0x7b9a('0x23')](_0x7b9a('0x67'),'getFields',_0x20c427,JSON[_0x7b9a('0x68')](_0x3774e1));delete _0x3774e1[_0x7b9a('0x24')];if(_0x20c427===0x191){_0x20c427=0x190;}_0x261a43[_0x7b9a('0x15')](_0x20c427)[_0x7b9a('0x69')](_0x2092b6[_0x7b9a('0x2c')][_0x7b9a('0x65')]?{'message':_0x7b9a('0x6a'),'statusCode':_0x3774e1[_0x7b9a('0x66')]}:_0x3774e1);});}; \ No newline at end of file +var _0x5423=['Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../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','save','then','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','model','map','query','keys','filters','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','intersection','length','find','create','body','destroy','ZendeskConfiguration','nolimit','findOne','AccountId','getSubjects','channel','type','Descriptions','ZendeskField','getFields','username','password','token','remoteUri','slice','lastIndexOf','ticket_fields','headers','Basic\x20%s','format','%s:%s','base64','%s/token:%s','toString','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2867d8,_0xef3ee0){var _0x3b8176=function(_0x2b9eb8){while(--_0x2b9eb8){_0x2867d8['push'](_0x2867d8['shift']());}};_0x3b8176(++_0xef3ee0);}(_0x5423,0xe3));var _0x3542=function(_0x4c0b90,_0xcfcec9){_0x4c0b90=_0x4c0b90-0x0;var _0x17451e=_0x5423[_0x4c0b90];return _0x17451e;};'use strict';var emlformat=require(_0x3542('0x0'));var rimraf=require(_0x3542('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3542('0x2'));var rp=require(_0x3542('0x3'));var moment=require('moment');var BPromise=require(_0x3542('0x4'));var Mustache=require(_0x3542('0x5'));var util=require(_0x3542('0x6'));var path=require(_0x3542('0x7'));var sox=require('sox');var csv=require(_0x3542('0x8'));var ejs=require(_0x3542('0x9'));var fs=require('fs');var fs_extra=require(_0x3542('0xa'));var _=require(_0x3542('0xb'));var squel=require(_0x3542('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3542('0xd'));var toCsv=require(_0x3542('0x8'));var querystring=require('querystring');var Papa=require(_0x3542('0xe'));var Redis=require(_0x3542('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3542('0x10'));var as=require(_0x3542('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3542('0x12'))(_0x3542('0x13'));var utils=require(_0x3542('0x14'));var config=require(_0x3542('0x15'));var licenseUtil=require(_0x3542('0x16'));var db=require(_0x3542('0x17'))['db'];var integrations=require(_0x3542('0x18'));function respondWithStatusCode(_0x43e977,_0x4ee86){_0x4ee86=_0x4ee86||0xcc;return function(_0x1a9062){if(_0x1a9062){return _0x43e977[_0x3542('0x19')](_0x4ee86);}return _0x43e977[_0x3542('0x1a')](_0x4ee86)[_0x3542('0x1b')]();};}function respondWithResult(_0x4bac5b,_0x14fe57){_0x14fe57=_0x14fe57||0xc8;return function(_0x4fb366){if(_0x4fb366){return _0x4bac5b[_0x3542('0x1a')](_0x14fe57)[_0x3542('0x1c')](_0x4fb366);}};}function respondWithFilteredResult(_0xc33d42,_0x546fbd){return function(_0x270312){if(_0x270312){var _0x177fb9=typeof _0x546fbd[_0x3542('0x1d')]==='undefined'&&typeof _0x546fbd[_0x3542('0x1e')]===_0x3542('0x1f');var _0x116859=_0x270312[_0x3542('0x20')];var _0x493d95=_0x177fb9?0x0:_0x546fbd[_0x3542('0x1d')];var _0x53d4aa=_0x177fb9?_0x270312[_0x3542('0x20')]:_0x546fbd[_0x3542('0x1d')]+_0x546fbd['limit'];var _0x1c6403;if(_0x53d4aa>=_0x116859){_0x53d4aa=_0x116859;_0x1c6403=0xc8;}else{_0x1c6403=0xce;}_0xc33d42[_0x3542('0x1a')](_0x1c6403);return _0xc33d42[_0x3542('0x21')](_0x3542('0x22'),_0x493d95+'-'+_0x53d4aa+'/'+_0x116859)[_0x3542('0x1c')](_0x270312);}return null;};}function patchUpdates(_0x4a7695){return function(_0x4a74b0){try{jsonpatch['apply'](_0x4a74b0,_0x4a7695,!![]);}catch(_0x17e3cf){return BPromise['reject'](_0x17e3cf);}return _0x4a74b0[_0x3542('0x23')]();};}function saveUpdates(_0x551645,_0x1d5f1e){return function(_0x55774d){if(_0x55774d){return _0x55774d['update'](_0x551645)[_0x3542('0x24')](function(_0xe3f983){return _0xe3f983;});}return null;};}function removeEntity(_0x5ae097,_0x5d05b2){return function(_0x3fc964){if(_0x3fc964){return _0x3fc964['destroy']()[_0x3542('0x24')](function(){_0x5ae097[_0x3542('0x1a')](0xcc)[_0x3542('0x1b')]();});}};}function handleEntityNotFound(_0x2f2e63,_0x298763){return function(_0xf1f7d0){if(!_0xf1f7d0){_0x2f2e63[_0x3542('0x19')](0x194);}return _0xf1f7d0;};}function handleError(_0x1e156e,_0x18dc6c){_0x18dc6c=_0x18dc6c||0x1f4;return function(_0x2841a1){logger[_0x3542('0x25')](_0x2841a1[_0x3542('0x26')]);if(_0x2841a1[_0x3542('0x27')]){delete _0x2841a1[_0x3542('0x27')];}_0x1e156e[_0x3542('0x1a')](_0x18dc6c)[_0x3542('0x28')](_0x2841a1);};}exports[_0x3542('0x29')]=function(_0x20eda1,_0x3bd666){var _0x5590a2={},_0x31ad47={},_0x35bbc9={'count':0x0,'rows':[]};var _0x2aec76=_['map'](db[_0x3542('0x2a')][_0x3542('0x2b')],function(_0x2e883a){return{'name':_0x2e883a[_0x3542('0x2c')],'type':_0x2e883a['type']['key']};});_0x31ad47[_0x3542('0x2d')]=_[_0x3542('0x2e')](_0x2aec76,_0x3542('0x27'));_0x31ad47[_0x3542('0x2f')]=_[_0x3542('0x30')](_0x20eda1[_0x3542('0x2f')]);_0x31ad47[_0x3542('0x31')]=_['intersection'](_0x31ad47['model'],_0x31ad47[_0x3542('0x2f')]);_0x5590a2['attributes']=_['intersection'](_0x31ad47[_0x3542('0x2d')],qs['fields'](_0x20eda1['query'][_0x3542('0x32')]));_0x5590a2[_0x3542('0x33')]=_0x5590a2[_0x3542('0x33')]['length']?_0x5590a2[_0x3542('0x33')]:_0x31ad47['model'];if(!_0x20eda1[_0x3542('0x2f')][_0x3542('0x34')]('nolimit')){_0x5590a2[_0x3542('0x1e')]=qs['limit'](_0x20eda1[_0x3542('0x2f')][_0x3542('0x1e')]);_0x5590a2[_0x3542('0x1d')]=qs['offset'](_0x20eda1[_0x3542('0x2f')]['offset']);}_0x5590a2[_0x3542('0x35')]=qs[_0x3542('0x36')](_0x20eda1[_0x3542('0x2f')][_0x3542('0x36')]);_0x5590a2[_0x3542('0x37')]=qs[_0x3542('0x31')](_[_0x3542('0x38')](_0x20eda1[_0x3542('0x2f')],_0x31ad47[_0x3542('0x31')]),_0x2aec76);if(_0x20eda1[_0x3542('0x2f')][_0x3542('0x39')]){_0x5590a2[_0x3542('0x37')]=_[_0x3542('0x3a')](_0x5590a2['where'],{'$or':_[_0x3542('0x2e')](_0x2aec76,function(_0x4a80ea){if(_0x4a80ea['type']!==_0x3542('0x3b')){var _0x3ffccc={};_0x3ffccc[_0x4a80ea[_0x3542('0x27')]]={'$like':'%'+_0x20eda1[_0x3542('0x2f')][_0x3542('0x39')]+'%'};return _0x3ffccc;}})});}_0x5590a2=_[_0x3542('0x3a')]({},_0x5590a2,_0x20eda1[_0x3542('0x3c')]);var _0x42e87a={'where':_0x5590a2['where']};return db[_0x3542('0x2a')]['count'](_0x42e87a)[_0x3542('0x24')](function(_0x2baa01){_0x35bbc9['count']=_0x2baa01;if(_0x20eda1[_0x3542('0x2f')][_0x3542('0x3d')]){_0x5590a2['include']=[{'all':!![]}];}return db[_0x3542('0x2a')][_0x3542('0x3e')](_0x5590a2);})['then'](function(_0x2682d0){_0x35bbc9[_0x3542('0x3f')]=_0x2682d0;return _0x35bbc9;})[_0x3542('0x24')](respondWithFilteredResult(_0x3bd666,_0x5590a2))[_0x3542('0x40')](handleError(_0x3bd666,null));};exports[_0x3542('0x41')]=function(_0xb12441,_0x2b54b9){var _0x4bf45a={'raw':![],'where':{'id':_0xb12441[_0x3542('0x42')]['id']}},_0x542e0c={};_0x542e0c[_0x3542('0x2d')]=_[_0x3542('0x30')](db[_0x3542('0x2a')][_0x3542('0x2b')]);_0x542e0c['query']=_[_0x3542('0x30')](_0xb12441['query']);_0x542e0c[_0x3542('0x31')]=_[_0x3542('0x43')](_0x542e0c[_0x3542('0x2d')],_0x542e0c['query']);_0x4bf45a[_0x3542('0x33')]=_[_0x3542('0x43')](_0x542e0c['model'],qs[_0x3542('0x32')](_0xb12441[_0x3542('0x2f')][_0x3542('0x32')]));_0x4bf45a[_0x3542('0x33')]=_0x4bf45a[_0x3542('0x33')][_0x3542('0x44')]?_0x4bf45a[_0x3542('0x33')]:_0x542e0c[_0x3542('0x2d')];if(_0xb12441['query']['includeAll']){_0x4bf45a['include']=[{'all':!![]}];}_0x4bf45a=_[_0x3542('0x3a')]({},_0x4bf45a,_0xb12441[_0x3542('0x3c')]);return db[_0x3542('0x2a')][_0x3542('0x45')](_0x4bf45a)[_0x3542('0x24')](handleEntityNotFound(_0x2b54b9,null))[_0x3542('0x24')](respondWithResult(_0x2b54b9,null))[_0x3542('0x40')](handleError(_0x2b54b9,null));};exports['create']=function(_0x157683,_0x14b960){return db[_0x3542('0x2a')][_0x3542('0x46')](_0x157683['body'],{})[_0x3542('0x24')](respondWithResult(_0x14b960,0xc9))[_0x3542('0x40')](handleError(_0x14b960,null));};exports['update']=function(_0x528f8c,_0x1fb253){if(_0x528f8c[_0x3542('0x47')]['id']){delete _0x528f8c[_0x3542('0x47')]['id'];}return db[_0x3542('0x2a')][_0x3542('0x45')]({'where':{'id':_0x528f8c[_0x3542('0x42')]['id']}})[_0x3542('0x24')](handleEntityNotFound(_0x1fb253,null))['then'](saveUpdates(_0x528f8c[_0x3542('0x47')],null))[_0x3542('0x24')](respondWithResult(_0x1fb253,null))[_0x3542('0x40')](handleError(_0x1fb253,null));};exports[_0x3542('0x48')]=function(_0x1ebc82,_0x28be34){return db[_0x3542('0x2a')][_0x3542('0x45')]({'where':{'id':_0x1ebc82[_0x3542('0x42')]['id']}})['then'](handleEntityNotFound(_0x28be34,null))['then'](removeEntity(_0x28be34,null))[_0x3542('0x40')](handleError(_0x28be34,null));};exports['getConfigurations']=function(_0x5a798a,_0x572e7a,_0x286222){var _0xd5c5c3={};var _0x381885={};var _0x48cfc4;var _0x2db495;return db[_0x3542('0x2a')]['findOne']({'where':{'id':_0x5a798a[_0x3542('0x42')]['id']}})[_0x3542('0x24')](handleEntityNotFound(_0x572e7a,null))[_0x3542('0x24')](function(_0x196c59){if(_0x196c59){_0x48cfc4=_0x196c59;_0x381885[_0x3542('0x2d')]=_['keys'](db[_0x3542('0x49')][_0x3542('0x2b')]);_0x381885[_0x3542('0x2f')]=_[_0x3542('0x30')](_0x5a798a[_0x3542('0x2f')]);_0x381885['filters']=_['intersection'](_0x381885[_0x3542('0x2d')],_0x381885[_0x3542('0x2f')]);_0xd5c5c3[_0x3542('0x33')]=_['intersection'](_0x381885[_0x3542('0x2d')],qs[_0x3542('0x32')](_0x5a798a[_0x3542('0x2f')][_0x3542('0x32')]));_0xd5c5c3[_0x3542('0x33')]=_0xd5c5c3['attributes']['length']?_0xd5c5c3[_0x3542('0x33')]:_0x381885['model'];_0xd5c5c3[_0x3542('0x35')]=qs[_0x3542('0x36')](_0x5a798a['query'][_0x3542('0x36')]);_0xd5c5c3[_0x3542('0x37')]=qs[_0x3542('0x31')](_[_0x3542('0x38')](_0x5a798a[_0x3542('0x2f')],_0x381885['filters']));if(_0x5a798a['query'][_0x3542('0x39')]){_0xd5c5c3['where']=_[_0x3542('0x3a')](_0xd5c5c3[_0x3542('0x37')],{'$or':_[_0x3542('0x2e')](_0xd5c5c3['attributes'],function(_0xd9c90c){var _0x1f8ddb={};_0x1f8ddb[_0xd9c90c]={'$like':'%'+_0x5a798a[_0x3542('0x2f')][_0x3542('0x39')]+'%'};return _0x1f8ddb;})});}_0xd5c5c3=_[_0x3542('0x3a')]({},_0xd5c5c3,_0x5a798a[_0x3542('0x3c')]);return _0x48cfc4['getConfigurations'](_0xd5c5c3);}})[_0x3542('0x24')](function(_0x3ee446){if(_0x3ee446){_0x2db495=_0x3ee446[_0x3542('0x44')];if(!_0x5a798a[_0x3542('0x2f')][_0x3542('0x34')](_0x3542('0x4a'))){_0xd5c5c3['limit']=qs[_0x3542('0x1e')](_0x5a798a[_0x3542('0x2f')][_0x3542('0x1e')]);_0xd5c5c3[_0x3542('0x1d')]=qs['offset'](_0x5a798a[_0x3542('0x2f')][_0x3542('0x1d')]);}return _0x48cfc4['getConfigurations'](_0xd5c5c3);}})['then'](function(_0x2908e5){if(_0x2908e5){return _0x2908e5?{'count':_0x2db495,'rows':_0x2908e5}:null;}})['then'](respondWithResult(_0x572e7a,null))[_0x3542('0x40')](handleError(_0x572e7a,null));};exports['addConfiguration']=function(_0x484204,_0x42a34a,_0x471408){if(_0x484204[_0x3542('0x47')]['id']){delete _0x484204[_0x3542('0x47')]['id'];}return db[_0x3542('0x2a')][_0x3542('0x4b')]({'where':{'id':_0x484204[_0x3542('0x42')]['id']}})['then'](handleEntityNotFound(_0x42a34a,null))[_0x3542('0x24')](function(_0xf1cf57){if(_0xf1cf57){_0x484204[_0x3542('0x47')][_0x3542('0x4c')]=_0xf1cf57['id'];_0x484204[_0x3542('0x47')]['Subjects']=integrations[_0x3542('0x4d')](_0x484204[_0x3542('0x47')][_0x3542('0x4e')],_0x484204[_0x3542('0x47')][_0x3542('0x4f')]);_0x484204[_0x3542('0x47')][_0x3542('0x50')]=integrations['getDescriptions'](_0x484204[_0x3542('0x47')]['channel'],_0x484204[_0x3542('0x47')][_0x3542('0x4f')]);return db[_0x3542('0x49')][_0x3542('0x46')](_0x484204['body'],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db[_0x3542('0x51')],'as':_0x3542('0x50')}]});}return null;})[_0x3542('0x24')](respondWithResult(_0x42a34a,null))[_0x3542('0x40')](handleError(_0x42a34a,null));};exports[_0x3542('0x52')]=function(_0x2afc71,_0x3c84fa,_0x77f0af){var _0x2b0de0='';return db['ZendeskAccount'][_0x3542('0x4b')]({'where':{'id':_0x2afc71[_0x3542('0x42')]['id']},'attributes':['id',_0x3542('0x53'),_0x3542('0x54'),_0x3542('0x55'),'authType','remoteUri']})[_0x3542('0x24')](handleEntityNotFound(_0x3c84fa,null))[_0x3542('0x24')](function(_0x52c26d){if(_0x52c26d){_0x2b0de0=_0x52c26d[_0x3542('0x56')];var _0x4b5327=_0x2b0de0[_0x3542('0x57')](-0x1);if(_0x4b5327==='/'){_0x2b0de0=_0x2b0de0['substring'](0x0,_0x2b0de0[_0x3542('0x58')](_0x4b5327));}var _0x153e1b={'method':'GET','uri':util['format']('%s/%s',_0x2b0de0,_0x3542('0x59')),'json':!![]};switch(_0x52c26d['authType']){case _0x3542('0x54'):_0x153e1b[_0x3542('0x5a')]={'Authorization':util['format'](_0x3542('0x5b'),new Buffer(util[_0x3542('0x5c')](_0x3542('0x5d'),_0x52c26d['username'],_0x52c26d[_0x3542('0x54')]))['toString'](_0x3542('0x5e')))};break;case'token':_0x153e1b[_0x3542('0x5a')]={'Authorization':util[_0x3542('0x5c')](_0x3542('0x5b'),new Buffer(util['format'](_0x3542('0x5f'),_0x52c26d[_0x3542('0x53')],_0x52c26d[_0x3542('0x55')]))[_0x3542('0x60')]('base64'))};break;default:throw new db['Sequelize'][(_0x3542('0x61'))](_0x3542('0x62'));}return rp(_0x153e1b);}})[_0x3542('0x24')](function(_0xaa97d5){if(_0xaa97d5){var _0x191fdd=[_0x3542('0x63'),_0x3542('0x64'),_0x3542('0x65'),_0x3542('0x66')];_[_0x3542('0x67')](_0xaa97d5[_0x3542('0x59')],function(_0x1c318c){return _0x191fdd[_0x3542('0x68')](_0x1c318c[_0x3542('0x4f')]);});return{'count':_0xaa97d5[_0x3542('0x59')][_0x3542('0x44')],'rows':_[_0x3542('0x2e')](_0xaa97d5[_0x3542('0x59')],function(_0x4e04b6){return{'id':_0x4e04b6['id'],'name':_0x4e04b6[_0x3542('0x69')]>0x7?_0x4e04b6[_0x3542('0x6a')]:_0x4e04b6['type'],'custom':_0x4e04b6['position']>0x7?!![]:![],'options':_0x4e04b6[_0x3542('0x6b')]?_0x4e04b6[_0x3542('0x6b')]:_0x4e04b6[_0x3542('0x6c')]?_0x4e04b6[_0x3542('0x6c')]:[]};})};}})['then'](respondWithResult(_0x3c84fa,null))[_0x3542('0x40')](function(_0x2d17ce){var _0x54e723=_0x2afc71[_0x3542('0x2f')]['test']?0x1f4:_0x2d17ce[_0x3542('0x6d')]||0x1f4;logger['error'](_0x3542('0x6e'),_0x3542('0x52'),_0x54e723,JSON[_0x3542('0x6f')](_0x2d17ce));delete _0x2d17ce[_0x3542('0x27')];if(_0x54e723===0x191){_0x54e723=0x190;}_0x3c84fa[_0x3542('0x1a')](_0x54e723)[_0x3542('0x28')](_0x2afc71[_0x3542('0x2f')]['test']?{'message':_0x3542('0x70'),'statusCode':_0x2d17ce['statusCode']}:_0x2d17ce);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 75b696d..80cff3f 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 _0xd3e7=['api','bluebird','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','../../config/logger'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xd3e7,0xa7));var _0x7d3e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd3e7[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7d3e('0x0'))(_0x7d3e('0x1'));var moment=require('moment');var BPromise=require(_0x7d3e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d3e('0x3'));var rimraf=require(_0x7d3e('0x4'));var config=require(_0x7d3e('0x5'));var attributes=require(_0x7d3e('0x6'));var integrations=require(_0x7d3e('0x7'));module[_0x7d3e('0x8')]=function(_0x414b9d,_0x27f48a){return _0x414b9d[_0x7d3e('0x9')](_0x7d3e('0xa'),attributes,{'tableName':_0x7d3e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6da=['path','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x1478fd,_0x4bfa47){var _0x2ab0b7=function(_0x42c0b3){while(--_0x42c0b3){_0x1478fd['push'](_0x1478fd['shift']());}};_0x2ab0b7(++_0x4bfa47);}(_0xe6da,0x1ab));var _0xae6d=function(_0x36277e,_0x417b0a){_0x36277e=_0x36277e-0x0;var _0x551c2f=_0xe6da[_0x36277e];return _0x551c2f;};'use strict';var _=require(_0xae6d('0x0'));var util=require('util');var logger=require(_0xae6d('0x1'))(_0xae6d('0x2'));var moment=require('moment');var BPromise=require(_0xae6d('0x3'));var rp=require(_0xae6d('0x4'));var fs=require('fs');var path=require(_0xae6d('0x5'));var rimraf=require(_0xae6d('0x6'));var config=require(_0xae6d('0x7'));var attributes=require(_0xae6d('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xae6d('0x9')]=function(_0x4606c0,_0x3e60f9){return _0x4606c0['define'](_0xae6d('0xa'),attributes,{'tableName':_0xae6d('0xb'),'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 b0f105c..d715555 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 _0x0e76=['client','http','request','then','info','request\x20sent','debug','error','ZendeskAccount,\x20%s,\x20%s','message','result','GetZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','ShowZendeskAccount','ZendeskAccount','find','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x574e1f,_0x22cf78){var _0x2c226a=function(_0x593f0d){while(--_0x593f0d){_0x574e1f['push'](_0x574e1f['shift']());}};_0x2c226a(++_0x22cf78);}(_0x0e76,0xc4));var _0x60e7=function(_0x845505,_0x19e5f3){_0x845505=_0x845505-0x0;var _0x2513b9=_0x0e76[_0x845505];return _0x2513b9;};'use strict';var _=require(_0x60e7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x60e7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x60e7('0x2'));var db=require(_0x60e7('0x3'))['db'];var utils=require(_0x60e7('0x4'));var logger=require(_0x60e7('0x5'))(_0x60e7('0x6'));var config=require('../../config/environment');var jayson=require(_0x60e7('0x7'));var client=jayson[_0x60e7('0x8')][_0x60e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xba29ef,_0xa2d5cb,_0x194535){return new BPromise(function(_0x4a15f2,_0xddad15){return client[_0x60e7('0xa')](_0xba29ef,_0x194535)[_0x60e7('0xb')](function(_0x51fff8){logger[_0x60e7('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0xa2d5cb,_0x60e7('0xd'));logger[_0x60e7('0xe')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0xa2d5cb,_0x60e7('0xd'),JSON['stringify'](_0x51fff8));if(_0x51fff8[_0x60e7('0xf')]){if(_0x51fff8[_0x60e7('0xf')]['code']===0x1f4){logger['error'](_0x60e7('0x10'),_0xa2d5cb,_0x51fff8[_0x60e7('0xf')][_0x60e7('0x11')]);return _0xddad15(_0x51fff8[_0x60e7('0xf')]['message']);}logger[_0x60e7('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0xa2d5cb,_0x51fff8[_0x60e7('0xf')][_0x60e7('0x11')]);return _0x4a15f2(_0x51fff8['error'][_0x60e7('0x11')]);}else{logger['info'](_0x60e7('0x10'),_0xa2d5cb,_0x60e7('0xd'));_0x4a15f2(_0x51fff8[_0x60e7('0x12')]['message']);}})['catch'](function(_0x376fde){logger['error'](_0x60e7('0x10'),_0xa2d5cb,_0x376fde);_0xddad15(_0x376fde);});});}exports[_0x60e7('0x13')]=function(_0x2a136a){var _0x29625d=this;return new Promise(function(_0x54a701,_0x676b92){return db['ZendeskAccount'][_0x60e7('0x14')]({'raw':_0x2a136a[_0x60e7('0x15')]?_0x2a136a[_0x60e7('0x15')][_0x60e7('0x16')]===undefined?!![]:![]:!![],'where':_0x2a136a[_0x60e7('0x15')]?_0x2a136a[_0x60e7('0x15')][_0x60e7('0x17')]||null:null,'attributes':_0x2a136a[_0x60e7('0x15')]?_0x2a136a['options'][_0x60e7('0x18')]||null:null,'limit':_0x2a136a[_0x60e7('0x15')]?_0x2a136a['options'][_0x60e7('0x19')]||null:null,'include':_0x2a136a['options']?_0x2a136a[_0x60e7('0x15')][_0x60e7('0x1a')]?_[_0x60e7('0x1b')](_0x2a136a[_0x60e7('0x15')][_0x60e7('0x1a')],function(_0x4258a2){return{'model':db[_0x4258a2['model']],'as':_0x4258a2['as'],'attributes':_0x4258a2[_0x60e7('0x18')],'include':_0x4258a2[_0x60e7('0x1a')]?_[_0x60e7('0x1b')](_0x4258a2['include'],function(_0x4a0605){return{'model':db[_0x4a0605[_0x60e7('0x1c')]],'as':_0x4a0605['as'],'attributes':_0x4a0605[_0x60e7('0x18')],'include':_0x4a0605[_0x60e7('0x1a')]?_[_0x60e7('0x1b')](_0x4a0605['include'],function(_0x3c8084){return{'model':db[_0x3c8084[_0x60e7('0x1c')]],'as':_0x3c8084['as'],'attributes':_0x3c8084[_0x60e7('0x18')]};}):[]};}):[]};}):[]:[]})[_0x60e7('0xb')](function(_0x4063dc){logger['info'](_0x60e7('0x13'),_0x2a136a);logger[_0x60e7('0xe')](_0x60e7('0x13'),_0x2a136a,JSON[_0x60e7('0x1d')](_0x4063dc));_0x54a701(_0x4063dc);})[_0x60e7('0x1e')](function(_0x311c17){logger['error'](_0x60e7('0x13'),_0x311c17['message'],_0x2a136a);_0x676b92(_0x29625d[_0x60e7('0xf')](0x1f4,_0x311c17['message']));});});};exports[_0x60e7('0x1f')]=function(_0x1c0efb){var _0x3f3d5d=this;return new Promise(function(_0x3d7a48,_0x2a9151){return db[_0x60e7('0x20')][_0x60e7('0x21')]({'raw':_0x1c0efb['options']?_0x1c0efb[_0x60e7('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1c0efb[_0x60e7('0x15')]?_0x1c0efb[_0x60e7('0x15')][_0x60e7('0x17')]||null:null,'attributes':_0x1c0efb[_0x60e7('0x15')]?_0x1c0efb[_0x60e7('0x15')][_0x60e7('0x18')]||null:null,'include':_0x1c0efb[_0x60e7('0x15')]?_0x1c0efb[_0x60e7('0x15')]['include']?_[_0x60e7('0x1b')](_0x1c0efb['options'][_0x60e7('0x1a')],function(_0x495a70){return{'model':db[_0x495a70['model']],'as':_0x495a70['as'],'attributes':_0x495a70['attributes'],'include':_0x495a70['include']?_['map'](_0x495a70['include'],function(_0x5e252d){return{'model':db[_0x5e252d[_0x60e7('0x1c')]],'as':_0x5e252d['as'],'attributes':_0x5e252d['attributes'],'include':_0x5e252d[_0x60e7('0x1a')]?_[_0x60e7('0x1b')](_0x5e252d[_0x60e7('0x1a')],function(_0x1d2113){return{'model':db[_0x1d2113[_0x60e7('0x1c')]],'as':_0x1d2113['as'],'attributes':_0x1d2113[_0x60e7('0x18')]};}):[]};}):[]};}):[]:[]})[_0x60e7('0xb')](function(_0x22dd70){logger[_0x60e7('0xc')]('ShowZendeskAccount',_0x1c0efb);logger[_0x60e7('0xe')]('ShowZendeskAccount',_0x1c0efb,JSON[_0x60e7('0x1d')](_0x22dd70));_0x3d7a48(_0x22dd70);})[_0x60e7('0x1e')](function(_0x28a857){logger[_0x60e7('0xf')]('ShowZendeskAccount',_0x28a857[_0x60e7('0x11')],_0x1c0efb);_0x2a9151(_0x3f3d5d[_0x60e7('0xf')](0x1f4,_0x28a857[_0x60e7('0x11')]));});});}; \ No newline at end of file +var _0x6838=['find','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZendeskAccount'];(function(_0x56ba4c,_0x454663){var _0x2c43ce=function(_0x356105){while(--_0x356105){_0x56ba4c['push'](_0x56ba4c['shift']());}};_0x2c43ce(++_0x454663);}(_0x6838,0x67));var _0x8683=function(_0x5a1cc9,_0x28f54d){_0x5a1cc9=_0x5a1cc9-0x0;var _0x471761=_0x6838[_0x5a1cc9];return _0x471761;};'use strict';var _=require('lodash');var util=require(_0x8683('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8683('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8683('0x2'));var logger=require(_0x8683('0x3'))(_0x8683('0x4'));var config=require(_0x8683('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x8683('0x6')][_0x8683('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32680b,_0x592de9,_0x1ec478){return new BPromise(function(_0x135151,_0x19f4cd){return client[_0x8683('0x8')](_0x32680b,_0x1ec478)[_0x8683('0x9')](function(_0x13f7c6){logger[_0x8683('0xa')](_0x8683('0xb'),_0x592de9,_0x8683('0xc'));logger[_0x8683('0xd')](_0x8683('0xe'),_0x592de9,'request\x20sent',JSON[_0x8683('0xf')](_0x13f7c6));if(_0x13f7c6['error']){if(_0x13f7c6[_0x8683('0x10')][_0x8683('0x11')]===0x1f4){logger['error'](_0x8683('0xb'),_0x592de9,_0x13f7c6[_0x8683('0x10')][_0x8683('0x12')]);return _0x19f4cd(_0x13f7c6[_0x8683('0x10')][_0x8683('0x12')]);}logger[_0x8683('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x592de9,_0x13f7c6[_0x8683('0x10')][_0x8683('0x12')]);return _0x135151(_0x13f7c6['error']['message']);}else{logger[_0x8683('0xa')](_0x8683('0xb'),_0x592de9,_0x8683('0xc'));_0x135151(_0x13f7c6[_0x8683('0x13')]['message']);}})[_0x8683('0x14')](function(_0x24f81e){logger[_0x8683('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x592de9,_0x24f81e);_0x19f4cd(_0x24f81e);});});}exports[_0x8683('0x15')]=function(_0x2af054){var _0x1a7f81=this;return new Promise(function(_0x453795,_0x35abc2){return db[_0x8683('0x16')][_0x8683('0x17')]({'raw':_0x2af054[_0x8683('0x18')]?_0x2af054[_0x8683('0x18')][_0x8683('0x19')]===undefined?!![]:![]:!![],'where':_0x2af054['options']?_0x2af054[_0x8683('0x18')][_0x8683('0x1a')]||null:null,'attributes':_0x2af054[_0x8683('0x18')]?_0x2af054[_0x8683('0x18')][_0x8683('0x1b')]||null:null,'limit':_0x2af054['options']?_0x2af054[_0x8683('0x18')][_0x8683('0x1c')]||null:null,'include':_0x2af054['options']?_0x2af054[_0x8683('0x18')][_0x8683('0x1d')]?_[_0x8683('0x1e')](_0x2af054[_0x8683('0x18')][_0x8683('0x1d')],function(_0x8ca91a){return{'model':db[_0x8ca91a[_0x8683('0x1f')]],'as':_0x8ca91a['as'],'attributes':_0x8ca91a[_0x8683('0x1b')],'include':_0x8ca91a[_0x8683('0x1d')]?_[_0x8683('0x1e')](_0x8ca91a[_0x8683('0x1d')],function(_0x30244d){return{'model':db[_0x30244d[_0x8683('0x1f')]],'as':_0x30244d['as'],'attributes':_0x30244d[_0x8683('0x1b')],'include':_0x30244d[_0x8683('0x1d')]?_[_0x8683('0x1e')](_0x30244d['include'],function(_0x474d71){return{'model':db[_0x474d71['model']],'as':_0x474d71['as'],'attributes':_0x474d71[_0x8683('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ce588){logger[_0x8683('0xa')](_0x8683('0x15'),_0x2af054);logger[_0x8683('0xd')](_0x8683('0x15'),_0x2af054,JSON[_0x8683('0xf')](_0x4ce588));_0x453795(_0x4ce588);})[_0x8683('0x14')](function(_0x216153){logger['error'](_0x8683('0x15'),_0x216153['message'],_0x2af054);_0x35abc2(_0x1a7f81[_0x8683('0x10')](0x1f4,_0x216153[_0x8683('0x12')]));});});};exports[_0x8683('0x20')]=function(_0x19454d){var _0xb95cb6=this;return new Promise(function(_0x33e8c8,_0x55b227){return db[_0x8683('0x16')][_0x8683('0x21')]({'raw':_0x19454d['options']?_0x19454d[_0x8683('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x19454d[_0x8683('0x18')]?_0x19454d[_0x8683('0x18')][_0x8683('0x1a')]||null:null,'attributes':_0x19454d[_0x8683('0x18')]?_0x19454d['options'][_0x8683('0x1b')]||null:null,'include':_0x19454d[_0x8683('0x18')]?_0x19454d[_0x8683('0x18')][_0x8683('0x1d')]?_[_0x8683('0x1e')](_0x19454d[_0x8683('0x18')]['include'],function(_0x5db4b4){return{'model':db[_0x5db4b4[_0x8683('0x1f')]],'as':_0x5db4b4['as'],'attributes':_0x5db4b4[_0x8683('0x1b')],'include':_0x5db4b4[_0x8683('0x1d')]?_[_0x8683('0x1e')](_0x5db4b4[_0x8683('0x1d')],function(_0x56b653){return{'model':db[_0x56b653[_0x8683('0x1f')]],'as':_0x56b653['as'],'attributes':_0x56b653[_0x8683('0x1b')],'include':_0x56b653[_0x8683('0x1d')]?_[_0x8683('0x1e')](_0x56b653[_0x8683('0x1d')],function(_0xfdce7a){return{'model':db[_0xfdce7a[_0x8683('0x1f')]],'as':_0xfdce7a['as'],'attributes':_0xfdce7a[_0x8683('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8683('0x9')](function(_0x10e68e){logger[_0x8683('0xa')](_0x8683('0x20'),_0x19454d);logger[_0x8683('0xd')](_0x8683('0x20'),_0x19454d,JSON[_0x8683('0xf')](_0x10e68e));_0x33e8c8(_0x10e68e);})[_0x8683('0x14')](function(_0x46b3ce){logger[_0x8683('0x10')]('ShowZendeskAccount',_0x46b3ce['message'],_0x19454d);_0x55b227(_0xb95cb6[_0x8683('0x10')](0x1f4,_0x46b3ce['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index aab72be..d9e6e56 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 _0x4fc2=['get','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','/:id','show'];(function(_0x28669b,_0x5e10c2){var _0xd8b7ba=function(_0x4fb22d){while(--_0x4fb22d){_0x28669b['push'](_0x28669b['shift']());}};_0xd8b7ba(++_0x5e10c2);}(_0x4fc2,0x111));var _0x24fc=function(_0x2f4ea9,_0x195a39){_0x2f4ea9=_0x2f4ea9-0x0;var _0x2b1b8d=_0x4fc2[_0x2f4ea9];return _0x2b1b8d;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['getFields']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0xd')](_0x24fc('0x11'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x12')]);router['get'](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['getTags']);router[_0x24fc('0x14')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0x15')]);router[_0x24fc('0x14')](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['setTags']);router[_0x24fc('0x16')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x17')]);router['delete'](_0x24fc('0xb'),auth['isAuthenticated'](),controller[_0x24fc('0x18')]);module[_0x24fc('0x19')]=router; \ No newline at end of file +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0x151bb5,_0x397a52){var _0x4d8495=function(_0x4c6bdb){while(--_0x4c6bdb){_0x151bb5['push'](_0x151bb5['shift']());}};_0x4d8495(++_0x397a52);}(_0xe706,0xa3));var _0x6e70=function(_0x335e51,_0x3c63fb){_0x335e51=_0x335e51-0x0;var _0x11637f=_0xe706[_0x335e51];return _0x11637f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0xa')](_0x6e70('0x13'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6e70('0xa')](_0x6e70('0x14'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0x6e70('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x6e70('0x19')]);router[_0x6e70('0x1a')]('/:id',auth[_0x6e70('0xb')](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 28ce366..d72d496 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 _0x5955=['sequelize','exports','STRING'];(function(_0x673722,_0x275d7e){var _0x21249c=function(_0x25b4e7){while(--_0x25b4e7){_0x673722['push'](_0x673722['shift']());}};_0x21249c(++_0x275d7e);}(_0x5955,0x123));var _0x5595=function(_0x208d75,_0x92d742){_0x208d75=_0x208d75-0x0;var _0x382d27=_0x5955[_0x208d75];return _0x382d27;};'use strict';var Sequelize=require(_0x5595('0x0'));module[_0x5595('0x1')]={'name':{'type':Sequelize[_0x5595('0x2')]},'description':{'type':Sequelize[_0x5595('0x2')]}}; \ No newline at end of file +var _0xc11c=['sequelize','exports','STRING'];(function(_0xb9c266,_0x55f8ce){var _0xfef148=function(_0x3865bc){while(--_0x3865bc){_0xb9c266['push'](_0xb9c266['shift']());}};_0xfef148(++_0x55f8ce);}(_0xc11c,0x69));var _0xcc11=function(_0xd9df21,_0x2350b3){_0xd9df21=_0xd9df21-0x0;var _0x40c634=_0xc11c[_0xd9df21];return _0x40c634;};'use strict';var Sequelize=require(_0xcc11('0x0'));module[_0xcc11('0x1')]={'name':{'type':Sequelize[_0xcc11('0x2')]},'description':{'type':Sequelize[_0xcc11('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index aa2c001..912b480 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 _0xd3b7=['status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','error','stack','name','send','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','length','include','find','catch','create','body','getFields','ZendeskField','order','pick','getSubjects','findOne','nolimit','getDescriptions','Tag','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus'];(function(_0x5235af,_0x428a33){var _0x3469c6=function(_0x2d7e93){while(--_0x2d7e93){_0x5235af['push'](_0x5235af['shift']());}};_0x3469c6(++_0x428a33);}(_0xd3b7,0x1d6));var _0x7d3b=function(_0x1f653b,_0x448456){_0x1f653b=_0x1f653b-0x0;var _0x14051e=_0xd3b7[_0x1f653b];return _0x14051e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d3b('0x0'));var zipdir=require(_0x7d3b('0x1'));var jsonpatch=require(_0x7d3b('0x2'));var rp=require(_0x7d3b('0x3'));var moment=require('moment');var BPromise=require(_0x7d3b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7d3b('0x5'));var sox=require(_0x7d3b('0x6'));var csv=require(_0x7d3b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d3b('0x8'));var squel=require(_0x7d3b('0x9'));var crypto=require(_0x7d3b('0xa'));var jsforce=require(_0x7d3b('0xb'));var deskjs=require(_0x7d3b('0xc'));var toCsv=require(_0x7d3b('0x7'));var querystring=require(_0x7d3b('0xd'));var Papa=require('papaparse');var Redis=require(_0x7d3b('0xe'));var authService=require(_0x7d3b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7d3b('0x10'));var hardwareService=require(_0x7d3b('0x11'));var logger=require('../../config/logger')(_0x7d3b('0x12'));var utils=require(_0x7d3b('0x13'));var config=require(_0x7d3b('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25d0ca,_0x1b9bc5){_0x1b9bc5=_0x1b9bc5||0xcc;return function(_0x4d0e3c){if(_0x4d0e3c){return _0x25d0ca[_0x7d3b('0x15')](_0x1b9bc5);}return _0x25d0ca[_0x7d3b('0x16')](_0x1b9bc5)[_0x7d3b('0x17')]();};}function respondWithResult(_0x4f3651,_0x375ad6){_0x375ad6=_0x375ad6||0xc8;return function(_0x5c3e58){if(_0x5c3e58){return _0x4f3651[_0x7d3b('0x16')](_0x375ad6)['json'](_0x5c3e58);}};}function respondWithFilteredResult(_0x4da621,_0x591e69){return function(_0x129131){if(_0x129131){var _0x1a029c=typeof _0x591e69[_0x7d3b('0x18')]===_0x7d3b('0x19')&&typeof _0x591e69[_0x7d3b('0x1a')]===_0x7d3b('0x19');var _0x31126f=_0x129131['count'];var _0x1fa65d=_0x1a029c?0x0:_0x591e69[_0x7d3b('0x18')];var _0x17c4e7=_0x1a029c?_0x129131[_0x7d3b('0x1b')]:_0x591e69[_0x7d3b('0x18')]+_0x591e69['limit'];var _0x49d121;if(_0x17c4e7>=_0x31126f){_0x17c4e7=_0x31126f;_0x49d121=0xc8;}else{_0x49d121=0xce;}_0x4da621[_0x7d3b('0x16')](_0x49d121);return _0x4da621[_0x7d3b('0x1c')](_0x7d3b('0x1d'),_0x1fa65d+'-'+_0x17c4e7+'/'+_0x31126f)[_0x7d3b('0x1e')](_0x129131);}return null;};}function patchUpdates(_0x3c8cbc){return function(_0x3f6079){try{jsonpatch['apply'](_0x3f6079,_0x3c8cbc,!![]);}catch(_0x417476){return BPromise['reject'](_0x417476);}return _0x3f6079[_0x7d3b('0x1f')]();};}function saveUpdates(_0xe1f410,_0xbb9f0){return function(_0x7cf9b4){if(_0x7cf9b4){return _0x7cf9b4[_0x7d3b('0x20')](_0xe1f410)[_0x7d3b('0x21')](function(_0x246018){return _0x246018;});}return null;};}function removeEntity(_0xf5753f,_0x1b6d65){return function(_0x370801){if(_0x370801){return _0x370801[_0x7d3b('0x22')]()[_0x7d3b('0x21')](function(){_0xf5753f[_0x7d3b('0x16')](0xcc)[_0x7d3b('0x17')]();});}};}function handleEntityNotFound(_0xeccfb0,_0xb46ae){return function(_0x4b105b){if(!_0x4b105b){_0xeccfb0[_0x7d3b('0x15')](0x194);}return _0x4b105b;};}function handleError(_0x3fbe22,_0x60a8ca){_0x60a8ca=_0x60a8ca||0x1f4;return function(_0x10d0d2){logger[_0x7d3b('0x23')](_0x10d0d2[_0x7d3b('0x24')]);if(_0x10d0d2[_0x7d3b('0x25')]){delete _0x10d0d2[_0x7d3b('0x25')];}_0x3fbe22['status'](_0x60a8ca)[_0x7d3b('0x26')](_0x10d0d2);};}exports['index']=function(_0x5664eb,_0x503a41){var _0x1792a5={},_0x33413b={},_0x5db3cd={'count':0x0,'rows':[]};var _0x154231=_['map'](db[_0x7d3b('0x27')][_0x7d3b('0x28')],function(_0x61e80){return{'name':_0x61e80[_0x7d3b('0x29')],'type':_0x61e80[_0x7d3b('0x2a')][_0x7d3b('0x2b')]};});_0x33413b[_0x7d3b('0x2c')]=_[_0x7d3b('0x2d')](_0x154231,_0x7d3b('0x25'));_0x33413b[_0x7d3b('0x2e')]=_[_0x7d3b('0x2f')](_0x5664eb[_0x7d3b('0x2e')]);_0x33413b[_0x7d3b('0x30')]=_[_0x7d3b('0x31')](_0x33413b['model'],_0x33413b[_0x7d3b('0x2e')]);_0x1792a5[_0x7d3b('0x32')]=_[_0x7d3b('0x31')](_0x33413b[_0x7d3b('0x2c')],qs[_0x7d3b('0x33')](_0x5664eb['query'][_0x7d3b('0x33')]));_0x1792a5[_0x7d3b('0x32')]=_0x1792a5[_0x7d3b('0x32')]['length']?_0x1792a5[_0x7d3b('0x32')]:_0x33413b[_0x7d3b('0x2c')];if(!_0x5664eb[_0x7d3b('0x2e')][_0x7d3b('0x34')]('nolimit')){_0x1792a5[_0x7d3b('0x1a')]=qs['limit'](_0x5664eb[_0x7d3b('0x2e')][_0x7d3b('0x1a')]);_0x1792a5['offset']=qs[_0x7d3b('0x18')](_0x5664eb['query'][_0x7d3b('0x18')]);}_0x1792a5['order']=qs[_0x7d3b('0x35')](_0x5664eb['query'][_0x7d3b('0x35')]);_0x1792a5[_0x7d3b('0x36')]=qs[_0x7d3b('0x30')](_['pick'](_0x5664eb[_0x7d3b('0x2e')],_0x33413b[_0x7d3b('0x30')]),_0x154231);if(_0x5664eb[_0x7d3b('0x2e')]['filter']){_0x1792a5[_0x7d3b('0x36')]=_[_0x7d3b('0x37')](_0x1792a5['where'],{'$or':_['map'](_0x154231,function(_0x282bea){if(_0x282bea['type']!==_0x7d3b('0x38')){var _0x4d1567={};_0x4d1567[_0x282bea[_0x7d3b('0x25')]]={'$like':'%'+_0x5664eb[_0x7d3b('0x2e')][_0x7d3b('0x39')]+'%'};return _0x4d1567;}})});}_0x1792a5=_['merge']({},_0x1792a5,_0x5664eb[_0x7d3b('0x3a')]);var _0x5657b5={'where':_0x1792a5[_0x7d3b('0x36')]};return db[_0x7d3b('0x27')][_0x7d3b('0x1b')](_0x5657b5)[_0x7d3b('0x21')](function(_0x47dae8){_0x5db3cd['count']=_0x47dae8;if(_0x5664eb[_0x7d3b('0x2e')][_0x7d3b('0x3b')]){_0x1792a5['include']=[{'all':!![]}];}return db[_0x7d3b('0x27')][_0x7d3b('0x3c')](_0x1792a5);})[_0x7d3b('0x21')](function(_0xccfe17){_0x5db3cd[_0x7d3b('0x3d')]=_0xccfe17;return _0x5db3cd;})[_0x7d3b('0x21')](respondWithFilteredResult(_0x503a41,_0x1792a5))['catch'](handleError(_0x503a41,null));};exports[_0x7d3b('0x3e')]=function(_0x103150,_0x1172ad){var _0x20e017={'raw':![],'where':{'id':_0x103150[_0x7d3b('0x3f')]['id']}},_0x3c56e9={};_0x3c56e9[_0x7d3b('0x2c')]=_[_0x7d3b('0x2f')](db[_0x7d3b('0x27')]['rawAttributes']);_0x3c56e9['query']=_[_0x7d3b('0x2f')](_0x103150[_0x7d3b('0x2e')]);_0x3c56e9[_0x7d3b('0x30')]=_[_0x7d3b('0x31')](_0x3c56e9[_0x7d3b('0x2c')],_0x3c56e9[_0x7d3b('0x2e')]);_0x20e017['attributes']=_['intersection'](_0x3c56e9['model'],qs[_0x7d3b('0x33')](_0x103150[_0x7d3b('0x2e')][_0x7d3b('0x33')]));_0x20e017[_0x7d3b('0x32')]=_0x20e017['attributes'][_0x7d3b('0x40')]?_0x20e017['attributes']:_0x3c56e9[_0x7d3b('0x2c')];if(_0x103150[_0x7d3b('0x2e')]['includeAll']){_0x20e017[_0x7d3b('0x41')]=[{'all':!![]}];}_0x20e017=_[_0x7d3b('0x37')]({},_0x20e017,_0x103150['options']);return db[_0x7d3b('0x27')][_0x7d3b('0x42')](_0x20e017)['then'](handleEntityNotFound(_0x1172ad,null))[_0x7d3b('0x21')](respondWithResult(_0x1172ad,null))[_0x7d3b('0x43')](handleError(_0x1172ad,null));};exports[_0x7d3b('0x44')]=function(_0x4b76e1,_0xc1af0e){return db[_0x7d3b('0x27')][_0x7d3b('0x44')](_0x4b76e1[_0x7d3b('0x45')],{})['then'](respondWithResult(_0xc1af0e,0xc9))[_0x7d3b('0x43')](handleError(_0xc1af0e,null));};exports['update']=function(_0x41b6f3,_0x13bc8c){if(_0x41b6f3[_0x7d3b('0x45')]['id']){delete _0x41b6f3['body']['id'];}return db[_0x7d3b('0x27')]['find']({'where':{'id':_0x41b6f3[_0x7d3b('0x3f')]['id']}})[_0x7d3b('0x21')](handleEntityNotFound(_0x13bc8c,null))[_0x7d3b('0x21')](saveUpdates(_0x41b6f3[_0x7d3b('0x45')],null))[_0x7d3b('0x21')](respondWithResult(_0x13bc8c,null))[_0x7d3b('0x43')](handleError(_0x13bc8c,null));};exports[_0x7d3b('0x22')]=function(_0xb7f8ee,_0x2d403a){return db[_0x7d3b('0x27')][_0x7d3b('0x42')]({'where':{'id':_0xb7f8ee['params']['id']}})[_0x7d3b('0x21')](handleEntityNotFound(_0x2d403a,null))['then'](removeEntity(_0x2d403a,null))['catch'](handleError(_0x2d403a,null));};exports[_0x7d3b('0x46')]=function(_0x55f238,_0x55f498,_0x3777b6){var _0x11d2d8={};var _0x4dbf8c={};var _0x41636d;var _0x2a29c6;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x55f238[_0x7d3b('0x3f')]['id']}})[_0x7d3b('0x21')](handleEntityNotFound(_0x55f498,null))[_0x7d3b('0x21')](function(_0xed799d){if(_0xed799d){_0x41636d=_0xed799d;_0x4dbf8c['model']=_[_0x7d3b('0x2f')](db[_0x7d3b('0x47')][_0x7d3b('0x28')]);_0x4dbf8c[_0x7d3b('0x2e')]=_['keys'](_0x55f238[_0x7d3b('0x2e')]);_0x4dbf8c['filters']=_[_0x7d3b('0x31')](_0x4dbf8c[_0x7d3b('0x2c')],_0x4dbf8c[_0x7d3b('0x2e')]);_0x11d2d8['attributes']=_[_0x7d3b('0x31')](_0x4dbf8c[_0x7d3b('0x2c')],qs['fields'](_0x55f238[_0x7d3b('0x2e')][_0x7d3b('0x33')]));_0x11d2d8[_0x7d3b('0x32')]=_0x11d2d8[_0x7d3b('0x32')][_0x7d3b('0x40')]?_0x11d2d8[_0x7d3b('0x32')]:_0x4dbf8c[_0x7d3b('0x2c')];_0x11d2d8[_0x7d3b('0x48')]=qs['sort'](_0x55f238[_0x7d3b('0x2e')][_0x7d3b('0x35')]);_0x11d2d8['where']=qs['filters'](_[_0x7d3b('0x49')](_0x55f238[_0x7d3b('0x2e')],_0x4dbf8c[_0x7d3b('0x30')]));if(_0x55f238[_0x7d3b('0x2e')][_0x7d3b('0x39')]){_0x11d2d8[_0x7d3b('0x36')]=_[_0x7d3b('0x37')](_0x11d2d8[_0x7d3b('0x36')],{'$or':_[_0x7d3b('0x2d')](_0x11d2d8[_0x7d3b('0x32')],function(_0x5f5d69){var _0x320a2b={};_0x320a2b[_0x5f5d69]={'$like':'%'+_0x55f238['query'][_0x7d3b('0x39')]+'%'};return _0x320a2b;})});}_0x11d2d8=_['merge']({},_0x11d2d8,_0x55f238[_0x7d3b('0x3a')]);return _0x41636d['getFields'](_0x11d2d8);}})['then'](function(_0x48b41a){if(_0x48b41a){_0x2a29c6=_0x48b41a[_0x7d3b('0x40')];if(!_0x55f238[_0x7d3b('0x2e')][_0x7d3b('0x34')]('nolimit')){_0x11d2d8[_0x7d3b('0x1a')]=qs[_0x7d3b('0x1a')](_0x55f238[_0x7d3b('0x2e')][_0x7d3b('0x1a')]);_0x11d2d8[_0x7d3b('0x18')]=qs[_0x7d3b('0x18')](_0x55f238[_0x7d3b('0x2e')]['offset']);}return _0x41636d['getFields'](_0x11d2d8);}})['then'](function(_0x1550df){if(_0x1550df){return _0x1550df?{'count':_0x2a29c6,'rows':_0x1550df}:null;}})[_0x7d3b('0x21')](respondWithResult(_0x55f498,null))[_0x7d3b('0x43')](handleError(_0x55f498,null));};exports[_0x7d3b('0x4a')]=function(_0x1c5cd0,_0x1bef77,_0x8a7fbe){var _0x671bc8={};var _0x12560d={};var _0x3e83f8;var _0x550296;return db[_0x7d3b('0x27')][_0x7d3b('0x4b')]({'where':{'id':_0x1c5cd0[_0x7d3b('0x3f')]['id']}})[_0x7d3b('0x21')](handleEntityNotFound(_0x1bef77,null))['then'](function(_0x2b3ae4){if(_0x2b3ae4){_0x3e83f8=_0x2b3ae4;_0x12560d[_0x7d3b('0x2c')]=_[_0x7d3b('0x2f')](db['ZendeskField']['rawAttributes']);_0x12560d[_0x7d3b('0x2e')]=_[_0x7d3b('0x2f')](_0x1c5cd0[_0x7d3b('0x2e')]);_0x12560d[_0x7d3b('0x30')]=_['intersection'](_0x12560d[_0x7d3b('0x2c')],_0x12560d[_0x7d3b('0x2e')]);_0x671bc8[_0x7d3b('0x32')]=_['intersection'](_0x12560d[_0x7d3b('0x2c')],qs[_0x7d3b('0x33')](_0x1c5cd0[_0x7d3b('0x2e')]['fields']));_0x671bc8[_0x7d3b('0x32')]=_0x671bc8[_0x7d3b('0x32')]['length']?_0x671bc8[_0x7d3b('0x32')]:_0x12560d[_0x7d3b('0x2c')];_0x671bc8['order']=qs[_0x7d3b('0x35')](_0x1c5cd0[_0x7d3b('0x2e')][_0x7d3b('0x35')]);_0x671bc8[_0x7d3b('0x36')]=qs[_0x7d3b('0x30')](_[_0x7d3b('0x49')](_0x1c5cd0['query'],_0x12560d[_0x7d3b('0x30')]));if(_0x1c5cd0[_0x7d3b('0x2e')][_0x7d3b('0x39')]){_0x671bc8[_0x7d3b('0x36')]=_[_0x7d3b('0x37')](_0x671bc8[_0x7d3b('0x36')],{'$or':_[_0x7d3b('0x2d')](_0x671bc8[_0x7d3b('0x32')],function(_0x343ec7){var _0x1cdc6a={};_0x1cdc6a[_0x343ec7]={'$like':'%'+_0x1c5cd0[_0x7d3b('0x2e')][_0x7d3b('0x39')]+'%'};return _0x1cdc6a;})});}_0x671bc8=_[_0x7d3b('0x37')]({},_0x671bc8,_0x1c5cd0[_0x7d3b('0x3a')]);return _0x3e83f8['getSubjects'](_0x671bc8);}})[_0x7d3b('0x21')](function(_0x227027){if(_0x227027){_0x550296=_0x227027['length'];if(!_0x1c5cd0[_0x7d3b('0x2e')][_0x7d3b('0x34')](_0x7d3b('0x4c'))){_0x671bc8[_0x7d3b('0x1a')]=qs[_0x7d3b('0x1a')](_0x1c5cd0[_0x7d3b('0x2e')][_0x7d3b('0x1a')]);_0x671bc8[_0x7d3b('0x18')]=qs[_0x7d3b('0x18')](_0x1c5cd0[_0x7d3b('0x2e')][_0x7d3b('0x18')]);}return _0x3e83f8[_0x7d3b('0x4a')](_0x671bc8);}})['then'](function(_0xffe31){if(_0xffe31){return _0xffe31?{'count':_0x550296,'rows':_0xffe31}:null;}})[_0x7d3b('0x21')](respondWithResult(_0x1bef77,null))[_0x7d3b('0x43')](handleError(_0x1bef77,null));};exports['getDescriptions']=function(_0x74c258,_0x148e3a,_0x16c6dd){var _0x5c63e5={};var _0xc544ad={};var _0x14344f;var _0x25deda;return db[_0x7d3b('0x27')][_0x7d3b('0x4b')]({'where':{'id':_0x74c258['params']['id']}})['then'](handleEntityNotFound(_0x148e3a,null))[_0x7d3b('0x21')](function(_0x1ec8f9){if(_0x1ec8f9){_0x14344f=_0x1ec8f9;_0xc544ad[_0x7d3b('0x2c')]=_[_0x7d3b('0x2f')](db[_0x7d3b('0x47')][_0x7d3b('0x28')]);_0xc544ad['query']=_[_0x7d3b('0x2f')](_0x74c258[_0x7d3b('0x2e')]);_0xc544ad[_0x7d3b('0x30')]=_[_0x7d3b('0x31')](_0xc544ad[_0x7d3b('0x2c')],_0xc544ad['query']);_0x5c63e5['attributes']=_[_0x7d3b('0x31')](_0xc544ad[_0x7d3b('0x2c')],qs['fields'](_0x74c258[_0x7d3b('0x2e')][_0x7d3b('0x33')]));_0x5c63e5[_0x7d3b('0x32')]=_0x5c63e5[_0x7d3b('0x32')][_0x7d3b('0x40')]?_0x5c63e5[_0x7d3b('0x32')]:_0xc544ad['model'];_0x5c63e5[_0x7d3b('0x48')]=qs[_0x7d3b('0x35')](_0x74c258['query'][_0x7d3b('0x35')]);_0x5c63e5[_0x7d3b('0x36')]=qs[_0x7d3b('0x30')](_[_0x7d3b('0x49')](_0x74c258[_0x7d3b('0x2e')],_0xc544ad[_0x7d3b('0x30')]));if(_0x74c258[_0x7d3b('0x2e')][_0x7d3b('0x39')]){_0x5c63e5[_0x7d3b('0x36')]=_[_0x7d3b('0x37')](_0x5c63e5[_0x7d3b('0x36')],{'$or':_[_0x7d3b('0x2d')](_0x5c63e5[_0x7d3b('0x32')],function(_0x37eca6){var _0x31d1e4={};_0x31d1e4[_0x37eca6]={'$like':'%'+_0x74c258[_0x7d3b('0x2e')][_0x7d3b('0x39')]+'%'};return _0x31d1e4;})});}_0x5c63e5=_['merge']({},_0x5c63e5,_0x74c258[_0x7d3b('0x3a')]);return _0x14344f[_0x7d3b('0x4d')](_0x5c63e5);}})[_0x7d3b('0x21')](function(_0x169304){if(_0x169304){_0x25deda=_0x169304[_0x7d3b('0x40')];if(!_0x74c258['query']['hasOwnProperty'](_0x7d3b('0x4c'))){_0x5c63e5[_0x7d3b('0x1a')]=qs[_0x7d3b('0x1a')](_0x74c258[_0x7d3b('0x2e')][_0x7d3b('0x1a')]);_0x5c63e5['offset']=qs[_0x7d3b('0x18')](_0x74c258[_0x7d3b('0x2e')][_0x7d3b('0x18')]);}return _0x14344f['getDescriptions'](_0x5c63e5);}})[_0x7d3b('0x21')](function(_0x4b5bbc){if(_0x4b5bbc){return _0x4b5bbc?{'count':_0x25deda,'rows':_0x4b5bbc}:null;}})[_0x7d3b('0x21')](respondWithResult(_0x148e3a,null))[_0x7d3b('0x43')](handleError(_0x148e3a,null));};exports['getTags']=function(_0x375a7f,_0x744f0d,_0x4ce4f4){var _0x33a771={};var _0x412792={};var _0x2d3c93;var _0x178a91;return db[_0x7d3b('0x27')][_0x7d3b('0x4b')]({'where':{'id':_0x375a7f['params']['id']}})[_0x7d3b('0x21')](handleEntityNotFound(_0x744f0d,null))['then'](function(_0x252484){if(_0x252484){_0x2d3c93=_0x252484;_0x412792[_0x7d3b('0x2c')]=_[_0x7d3b('0x2f')](db[_0x7d3b('0x4e')][_0x7d3b('0x28')]);_0x412792['query']=_['keys'](_0x375a7f[_0x7d3b('0x2e')]);_0x412792[_0x7d3b('0x30')]=_[_0x7d3b('0x31')](_0x412792['model'],_0x412792['query']);_0x33a771[_0x7d3b('0x32')]=_[_0x7d3b('0x31')](_0x412792[_0x7d3b('0x2c')],qs['fields'](_0x375a7f['query'][_0x7d3b('0x33')]));_0x33a771['attributes']=_0x33a771['attributes'][_0x7d3b('0x40')]?_0x33a771[_0x7d3b('0x32')]:_0x412792[_0x7d3b('0x2c')];_0x33a771[_0x7d3b('0x48')]=qs[_0x7d3b('0x35')](_0x375a7f[_0x7d3b('0x2e')]['sort']);_0x33a771[_0x7d3b('0x36')]=qs[_0x7d3b('0x30')](_[_0x7d3b('0x49')](_0x375a7f['query'],_0x412792['filters']));if(_0x375a7f[_0x7d3b('0x2e')][_0x7d3b('0x39')]){_0x33a771['where']=_[_0x7d3b('0x37')](_0x33a771[_0x7d3b('0x36')],{'$or':_[_0x7d3b('0x2d')](_0x33a771['attributes'],function(_0x38c2af){var _0x4afbf5={};_0x4afbf5[_0x38c2af]={'$like':'%'+_0x375a7f[_0x7d3b('0x2e')]['filter']+'%'};return _0x4afbf5;})});}_0x33a771=_[_0x7d3b('0x37')]({},_0x33a771,_0x375a7f[_0x7d3b('0x3a')]);return _0x2d3c93[_0x7d3b('0x4f')](_0x33a771);}})[_0x7d3b('0x21')](function(_0x3088ac){if(_0x3088ac){_0x178a91=_0x3088ac[_0x7d3b('0x40')];if(!_0x375a7f[_0x7d3b('0x2e')][_0x7d3b('0x34')](_0x7d3b('0x4c'))){_0x33a771[_0x7d3b('0x1a')]=qs['limit'](_0x375a7f[_0x7d3b('0x2e')][_0x7d3b('0x1a')]);_0x33a771[_0x7d3b('0x18')]=qs[_0x7d3b('0x18')](_0x375a7f[_0x7d3b('0x2e')][_0x7d3b('0x18')]);}return _0x2d3c93[_0x7d3b('0x4f')](_0x33a771);}})[_0x7d3b('0x21')](function(_0x1b621e){if(_0x1b621e){return _0x1b621e?{'count':_0x178a91,'rows':_0x1b621e}:null;}})[_0x7d3b('0x21')](respondWithResult(_0x744f0d,null))[_0x7d3b('0x43')](handleError(_0x744f0d,null));};exports[_0x7d3b('0x50')]=function(_0x1dad7e,_0x218664,_0x1e233a){if(_0x1dad7e['body']['id']){delete _0x1dad7e[_0x7d3b('0x45')]['id'];}return db['ZendeskConfiguration'][_0x7d3b('0x4b')]({'where':{'id':_0x1dad7e[_0x7d3b('0x3f')]['id']}})[_0x7d3b('0x21')](handleEntityNotFound(_0x218664,null))[_0x7d3b('0x21')](function(_0x4b15c8){if(_0x4b15c8){return _0x4b15c8[_0x7d3b('0x50')](_0x1dad7e['body'][_0x7d3b('0x51')]||[]);}return null;})[_0x7d3b('0x21')](respondWithResult(_0x218664,null))['catch'](handleError(_0x218664,null));}; \ No newline at end of file +var _0xe5d7=['where','filter','merge','includeAll','include','ZendeskConfiguration','findAll','rows','show','params','create','catch','body','find','getFields','findOne','pick','options','getSubjects','ZendeskField','getDescriptions','getTags','Tag','setTags','ids','rimraf','fast-json-patch','request-promise','bluebird','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/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','name','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x198a6c,_0x1e1175){var _0x23f19c=function(_0x4c5b30){while(--_0x4c5b30){_0x198a6c['push'](_0x198a6c['shift']());}};_0x23f19c(++_0x1e1175);}(_0xe5d7,0x67));var _0x7e5d=function(_0x2e65dc,_0x33adfa){_0x2e65dc=_0x2e65dc-0x0;var _0x4c2a94=_0xe5d7[_0x2e65dc];return _0x4c2a94;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7e5d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7e5d('0x1'));var rp=require(_0x7e5d('0x2'));var moment=require('moment');var BPromise=require(_0x7e5d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7e5d('0x4'));var ejs=require(_0x7e5d('0x5'));var fs=require('fs');var fs_extra=require(_0x7e5d('0x6'));var _=require(_0x7e5d('0x7'));var squel=require(_0x7e5d('0x8'));var crypto=require(_0x7e5d('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x7e5d('0xa'));var toCsv=require(_0x7e5d('0x4'));var querystring=require(_0x7e5d('0xb'));var Papa=require(_0x7e5d('0xc'));var Redis=require('ioredis');var authService=require(_0x7e5d('0xd'));var qs=require(_0x7e5d('0xe'));var as=require(_0x7e5d('0xf'));var hardwareService=require(_0x7e5d('0x10'));var logger=require(_0x7e5d('0x11'))('api');var utils=require(_0x7e5d('0x12'));var config=require(_0x7e5d('0x13'));var licenseUtil=require(_0x7e5d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x196e5d,_0x1d500f){_0x1d500f=_0x1d500f||0xcc;return function(_0x43e3da){if(_0x43e3da){return _0x196e5d[_0x7e5d('0x15')](_0x1d500f);}return _0x196e5d[_0x7e5d('0x16')](_0x1d500f)[_0x7e5d('0x17')]();};}function respondWithResult(_0x8e470a,_0x493802){_0x493802=_0x493802||0xc8;return function(_0x447117){if(_0x447117){return _0x8e470a[_0x7e5d('0x16')](_0x493802)[_0x7e5d('0x18')](_0x447117);}};}function respondWithFilteredResult(_0x37136a,_0x1cd473){return function(_0x24a87f){if(_0x24a87f){var _0xca37d8=typeof _0x1cd473[_0x7e5d('0x19')]===_0x7e5d('0x1a')&&typeof _0x1cd473[_0x7e5d('0x1b')]===_0x7e5d('0x1a');var _0x21f293=_0x24a87f[_0x7e5d('0x1c')];var _0x347324=_0xca37d8?0x0:_0x1cd473['offset'];var _0x2f75d8=_0xca37d8?_0x24a87f[_0x7e5d('0x1c')]:_0x1cd473['offset']+_0x1cd473[_0x7e5d('0x1b')];var _0x2d0df6;if(_0x2f75d8>=_0x21f293){_0x2f75d8=_0x21f293;_0x2d0df6=0xc8;}else{_0x2d0df6=0xce;}_0x37136a[_0x7e5d('0x16')](_0x2d0df6);return _0x37136a[_0x7e5d('0x1d')](_0x7e5d('0x1e'),_0x347324+'-'+_0x2f75d8+'/'+_0x21f293)[_0x7e5d('0x18')](_0x24a87f);}return null;};}function patchUpdates(_0x2e1ce4){return function(_0x516827){try{jsonpatch[_0x7e5d('0x1f')](_0x516827,_0x2e1ce4,!![]);}catch(_0x4d8079){return BPromise[_0x7e5d('0x20')](_0x4d8079);}return _0x516827['save']();};}function saveUpdates(_0x423299,_0x4a6d98){return function(_0x12ca25){if(_0x12ca25){return _0x12ca25['update'](_0x423299)[_0x7e5d('0x21')](function(_0xaec3ae){return _0xaec3ae;});}return null;};}function removeEntity(_0x2677dd,_0x5c8ae4){return function(_0x4d51a0){if(_0x4d51a0){return _0x4d51a0[_0x7e5d('0x22')]()[_0x7e5d('0x21')](function(){_0x2677dd[_0x7e5d('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30614e,_0x5c8b1f){return function(_0x1ef5fd){if(!_0x1ef5fd){_0x30614e['sendStatus'](0x194);}return _0x1ef5fd;};}function handleError(_0x1b1657,_0x38bf85){_0x38bf85=_0x38bf85||0x1f4;return function(_0x2fa30f){logger[_0x7e5d('0x23')](_0x2fa30f['stack']);if(_0x2fa30f[_0x7e5d('0x24')]){delete _0x2fa30f['name'];}_0x1b1657[_0x7e5d('0x16')](_0x38bf85)['send'](_0x2fa30f);};}exports['index']=function(_0x31298a,_0x7c123e){var _0xfbe895={},_0x2c4a70={},_0x54a35e={'count':0x0,'rows':[]};var _0x32c0a1=_[_0x7e5d('0x25')](db['ZendeskConfiguration'][_0x7e5d('0x26')],function(_0x338e28){return{'name':_0x338e28[_0x7e5d('0x27')],'type':_0x338e28[_0x7e5d('0x28')]['key']};});_0x2c4a70[_0x7e5d('0x29')]=_[_0x7e5d('0x25')](_0x32c0a1,_0x7e5d('0x24'));_0x2c4a70[_0x7e5d('0x2a')]=_[_0x7e5d('0x2b')](_0x31298a[_0x7e5d('0x2a')]);_0x2c4a70[_0x7e5d('0x2c')]=_[_0x7e5d('0x2d')](_0x2c4a70['model'],_0x2c4a70['query']);_0xfbe895['attributes']=_[_0x7e5d('0x2d')](_0x2c4a70[_0x7e5d('0x29')],qs[_0x7e5d('0x2e')](_0x31298a[_0x7e5d('0x2a')][_0x7e5d('0x2e')]));_0xfbe895[_0x7e5d('0x2f')]=_0xfbe895['attributes'][_0x7e5d('0x30')]?_0xfbe895[_0x7e5d('0x2f')]:_0x2c4a70[_0x7e5d('0x29')];if(!_0x31298a[_0x7e5d('0x2a')][_0x7e5d('0x31')](_0x7e5d('0x32'))){_0xfbe895[_0x7e5d('0x1b')]=qs[_0x7e5d('0x1b')](_0x31298a[_0x7e5d('0x2a')][_0x7e5d('0x1b')]);_0xfbe895[_0x7e5d('0x19')]=qs[_0x7e5d('0x19')](_0x31298a[_0x7e5d('0x2a')][_0x7e5d('0x19')]);}_0xfbe895[_0x7e5d('0x33')]=qs[_0x7e5d('0x34')](_0x31298a[_0x7e5d('0x2a')][_0x7e5d('0x34')]);_0xfbe895[_0x7e5d('0x35')]=qs['filters'](_['pick'](_0x31298a['query'],_0x2c4a70['filters']),_0x32c0a1);if(_0x31298a[_0x7e5d('0x2a')][_0x7e5d('0x36')]){_0xfbe895[_0x7e5d('0x35')]=_[_0x7e5d('0x37')](_0xfbe895[_0x7e5d('0x35')],{'$or':_[_0x7e5d('0x25')](_0x32c0a1,function(_0x294a2b){if(_0x294a2b['type']!=='VIRTUAL'){var _0x169b9c={};_0x169b9c[_0x294a2b[_0x7e5d('0x24')]]={'$like':'%'+_0x31298a[_0x7e5d('0x2a')][_0x7e5d('0x36')]+'%'};return _0x169b9c;}})});}_0xfbe895=_['merge']({},_0xfbe895,_0x31298a['options']);var _0x587c1a={'where':_0xfbe895['where']};return db['ZendeskConfiguration'][_0x7e5d('0x1c')](_0x587c1a)[_0x7e5d('0x21')](function(_0x702ab4){_0x54a35e[_0x7e5d('0x1c')]=_0x702ab4;if(_0x31298a[_0x7e5d('0x2a')][_0x7e5d('0x38')]){_0xfbe895[_0x7e5d('0x39')]=[{'all':!![]}];}return db[_0x7e5d('0x3a')][_0x7e5d('0x3b')](_0xfbe895);})[_0x7e5d('0x21')](function(_0x30e4ac){_0x54a35e[_0x7e5d('0x3c')]=_0x30e4ac;return _0x54a35e;})[_0x7e5d('0x21')](respondWithFilteredResult(_0x7c123e,_0xfbe895))['catch'](handleError(_0x7c123e,null));};exports[_0x7e5d('0x3d')]=function(_0x543181,_0x330597){var _0x17b291={'raw':![],'where':{'id':_0x543181[_0x7e5d('0x3e')]['id']}},_0x249caa={};_0x249caa['model']=_[_0x7e5d('0x2b')](db['ZendeskConfiguration']['rawAttributes']);_0x249caa[_0x7e5d('0x2a')]=_[_0x7e5d('0x2b')](_0x543181[_0x7e5d('0x2a')]);_0x249caa[_0x7e5d('0x2c')]=_[_0x7e5d('0x2d')](_0x249caa[_0x7e5d('0x29')],_0x249caa[_0x7e5d('0x2a')]);_0x17b291[_0x7e5d('0x2f')]=_['intersection'](_0x249caa[_0x7e5d('0x29')],qs[_0x7e5d('0x2e')](_0x543181[_0x7e5d('0x2a')][_0x7e5d('0x2e')]));_0x17b291[_0x7e5d('0x2f')]=_0x17b291[_0x7e5d('0x2f')][_0x7e5d('0x30')]?_0x17b291[_0x7e5d('0x2f')]:_0x249caa['model'];if(_0x543181[_0x7e5d('0x2a')][_0x7e5d('0x38')]){_0x17b291['include']=[{'all':!![]}];}_0x17b291=_[_0x7e5d('0x37')]({},_0x17b291,_0x543181['options']);return db[_0x7e5d('0x3a')]['find'](_0x17b291)[_0x7e5d('0x21')](handleEntityNotFound(_0x330597,null))[_0x7e5d('0x21')](respondWithResult(_0x330597,null))['catch'](handleError(_0x330597,null));};exports[_0x7e5d('0x3f')]=function(_0x3d9ba6,_0x28ad5c){return db['ZendeskConfiguration'][_0x7e5d('0x3f')](_0x3d9ba6['body'],{})[_0x7e5d('0x21')](respondWithResult(_0x28ad5c,0xc9))[_0x7e5d('0x40')](handleError(_0x28ad5c,null));};exports['update']=function(_0xd13727,_0x429297){if(_0xd13727['body']['id']){delete _0xd13727[_0x7e5d('0x41')]['id'];}return db[_0x7e5d('0x3a')][_0x7e5d('0x42')]({'where':{'id':_0xd13727[_0x7e5d('0x3e')]['id']}})[_0x7e5d('0x21')](handleEntityNotFound(_0x429297,null))[_0x7e5d('0x21')](saveUpdates(_0xd13727[_0x7e5d('0x41')],null))[_0x7e5d('0x21')](respondWithResult(_0x429297,null))[_0x7e5d('0x40')](handleError(_0x429297,null));};exports[_0x7e5d('0x22')]=function(_0x2e080f,_0x399572){return db['ZendeskConfiguration'][_0x7e5d('0x42')]({'where':{'id':_0x2e080f[_0x7e5d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x399572,null))[_0x7e5d('0x21')](removeEntity(_0x399572,null))[_0x7e5d('0x40')](handleError(_0x399572,null));};exports[_0x7e5d('0x43')]=function(_0x111ba3,_0x5f44e1,_0x5b9c10){var _0x3b1004={};var _0x3476d1={};var _0x5aff51;var _0x21725b;return db[_0x7e5d('0x3a')][_0x7e5d('0x44')]({'where':{'id':_0x111ba3[_0x7e5d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5f44e1,null))['then'](function(_0x3d4f04){if(_0x3d4f04){_0x5aff51=_0x3d4f04;_0x3476d1[_0x7e5d('0x29')]=_[_0x7e5d('0x2b')](db['ZendeskField'][_0x7e5d('0x26')]);_0x3476d1[_0x7e5d('0x2a')]=_[_0x7e5d('0x2b')](_0x111ba3['query']);_0x3476d1['filters']=_[_0x7e5d('0x2d')](_0x3476d1[_0x7e5d('0x29')],_0x3476d1[_0x7e5d('0x2a')]);_0x3b1004[_0x7e5d('0x2f')]=_[_0x7e5d('0x2d')](_0x3476d1['model'],qs[_0x7e5d('0x2e')](_0x111ba3[_0x7e5d('0x2a')]['fields']));_0x3b1004[_0x7e5d('0x2f')]=_0x3b1004['attributes'][_0x7e5d('0x30')]?_0x3b1004['attributes']:_0x3476d1[_0x7e5d('0x29')];_0x3b1004[_0x7e5d('0x33')]=qs['sort'](_0x111ba3[_0x7e5d('0x2a')][_0x7e5d('0x34')]);_0x3b1004['where']=qs['filters'](_[_0x7e5d('0x45')](_0x111ba3[_0x7e5d('0x2a')],_0x3476d1[_0x7e5d('0x2c')]));if(_0x111ba3[_0x7e5d('0x2a')][_0x7e5d('0x36')]){_0x3b1004[_0x7e5d('0x35')]=_[_0x7e5d('0x37')](_0x3b1004[_0x7e5d('0x35')],{'$or':_[_0x7e5d('0x25')](_0x3b1004[_0x7e5d('0x2f')],function(_0x17461a){var _0x4193db={};_0x4193db[_0x17461a]={'$like':'%'+_0x111ba3[_0x7e5d('0x2a')][_0x7e5d('0x36')]+'%'};return _0x4193db;})});}_0x3b1004=_[_0x7e5d('0x37')]({},_0x3b1004,_0x111ba3[_0x7e5d('0x46')]);return _0x5aff51[_0x7e5d('0x43')](_0x3b1004);}})['then'](function(_0x1d81d8){if(_0x1d81d8){_0x21725b=_0x1d81d8[_0x7e5d('0x30')];if(!_0x111ba3[_0x7e5d('0x2a')][_0x7e5d('0x31')](_0x7e5d('0x32'))){_0x3b1004[_0x7e5d('0x1b')]=qs[_0x7e5d('0x1b')](_0x111ba3[_0x7e5d('0x2a')][_0x7e5d('0x1b')]);_0x3b1004['offset']=qs[_0x7e5d('0x19')](_0x111ba3[_0x7e5d('0x2a')][_0x7e5d('0x19')]);}return _0x5aff51[_0x7e5d('0x43')](_0x3b1004);}})[_0x7e5d('0x21')](function(_0x4b5506){if(_0x4b5506){return _0x4b5506?{'count':_0x21725b,'rows':_0x4b5506}:null;}})[_0x7e5d('0x21')](respondWithResult(_0x5f44e1,null))[_0x7e5d('0x40')](handleError(_0x5f44e1,null));};exports[_0x7e5d('0x47')]=function(_0x5148bc,_0x53fd94,_0x47444c){var _0x171258={};var _0x5b2d6b={};var _0x4ef57a;var _0x410eed;return db[_0x7e5d('0x3a')]['findOne']({'where':{'id':_0x5148bc['params']['id']}})[_0x7e5d('0x21')](handleEntityNotFound(_0x53fd94,null))[_0x7e5d('0x21')](function(_0x36fa2f){if(_0x36fa2f){_0x4ef57a=_0x36fa2f;_0x5b2d6b[_0x7e5d('0x29')]=_[_0x7e5d('0x2b')](db[_0x7e5d('0x48')][_0x7e5d('0x26')]);_0x5b2d6b[_0x7e5d('0x2a')]=_[_0x7e5d('0x2b')](_0x5148bc[_0x7e5d('0x2a')]);_0x5b2d6b['filters']=_[_0x7e5d('0x2d')](_0x5b2d6b[_0x7e5d('0x29')],_0x5b2d6b[_0x7e5d('0x2a')]);_0x171258['attributes']=_[_0x7e5d('0x2d')](_0x5b2d6b[_0x7e5d('0x29')],qs[_0x7e5d('0x2e')](_0x5148bc[_0x7e5d('0x2a')][_0x7e5d('0x2e')]));_0x171258[_0x7e5d('0x2f')]=_0x171258['attributes'][_0x7e5d('0x30')]?_0x171258[_0x7e5d('0x2f')]:_0x5b2d6b[_0x7e5d('0x29')];_0x171258['order']=qs['sort'](_0x5148bc[_0x7e5d('0x2a')][_0x7e5d('0x34')]);_0x171258[_0x7e5d('0x35')]=qs[_0x7e5d('0x2c')](_[_0x7e5d('0x45')](_0x5148bc['query'],_0x5b2d6b[_0x7e5d('0x2c')]));if(_0x5148bc[_0x7e5d('0x2a')]['filter']){_0x171258['where']=_[_0x7e5d('0x37')](_0x171258[_0x7e5d('0x35')],{'$or':_['map'](_0x171258['attributes'],function(_0x3673bd){var _0x5c06c1={};_0x5c06c1[_0x3673bd]={'$like':'%'+_0x5148bc[_0x7e5d('0x2a')][_0x7e5d('0x36')]+'%'};return _0x5c06c1;})});}_0x171258=_[_0x7e5d('0x37')]({},_0x171258,_0x5148bc['options']);return _0x4ef57a[_0x7e5d('0x47')](_0x171258);}})[_0x7e5d('0x21')](function(_0x5d47df){if(_0x5d47df){_0x410eed=_0x5d47df[_0x7e5d('0x30')];if(!_0x5148bc['query']['hasOwnProperty'](_0x7e5d('0x32'))){_0x171258[_0x7e5d('0x1b')]=qs['limit'](_0x5148bc[_0x7e5d('0x2a')][_0x7e5d('0x1b')]);_0x171258[_0x7e5d('0x19')]=qs[_0x7e5d('0x19')](_0x5148bc[_0x7e5d('0x2a')][_0x7e5d('0x19')]);}return _0x4ef57a[_0x7e5d('0x47')](_0x171258);}})['then'](function(_0x614778){if(_0x614778){return _0x614778?{'count':_0x410eed,'rows':_0x614778}:null;}})[_0x7e5d('0x21')](respondWithResult(_0x53fd94,null))[_0x7e5d('0x40')](handleError(_0x53fd94,null));};exports['getDescriptions']=function(_0x109d32,_0x2242de,_0x4a7f94){var _0xe5c9d6={};var _0xdab6db={};var _0x447fa5;var _0x42a3b8;return db[_0x7e5d('0x3a')][_0x7e5d('0x44')]({'where':{'id':_0x109d32[_0x7e5d('0x3e')]['id']}})[_0x7e5d('0x21')](handleEntityNotFound(_0x2242de,null))[_0x7e5d('0x21')](function(_0x41466a){if(_0x41466a){_0x447fa5=_0x41466a;_0xdab6db[_0x7e5d('0x29')]=_[_0x7e5d('0x2b')](db[_0x7e5d('0x48')][_0x7e5d('0x26')]);_0xdab6db[_0x7e5d('0x2a')]=_[_0x7e5d('0x2b')](_0x109d32[_0x7e5d('0x2a')]);_0xdab6db[_0x7e5d('0x2c')]=_[_0x7e5d('0x2d')](_0xdab6db[_0x7e5d('0x29')],_0xdab6db[_0x7e5d('0x2a')]);_0xe5c9d6[_0x7e5d('0x2f')]=_[_0x7e5d('0x2d')](_0xdab6db[_0x7e5d('0x29')],qs[_0x7e5d('0x2e')](_0x109d32[_0x7e5d('0x2a')][_0x7e5d('0x2e')]));_0xe5c9d6[_0x7e5d('0x2f')]=_0xe5c9d6[_0x7e5d('0x2f')][_0x7e5d('0x30')]?_0xe5c9d6[_0x7e5d('0x2f')]:_0xdab6db[_0x7e5d('0x29')];_0xe5c9d6[_0x7e5d('0x33')]=qs['sort'](_0x109d32['query']['sort']);_0xe5c9d6['where']=qs[_0x7e5d('0x2c')](_[_0x7e5d('0x45')](_0x109d32[_0x7e5d('0x2a')],_0xdab6db[_0x7e5d('0x2c')]));if(_0x109d32['query'][_0x7e5d('0x36')]){_0xe5c9d6[_0x7e5d('0x35')]=_['merge'](_0xe5c9d6[_0x7e5d('0x35')],{'$or':_[_0x7e5d('0x25')](_0xe5c9d6[_0x7e5d('0x2f')],function(_0x230505){var _0x521542={};_0x521542[_0x230505]={'$like':'%'+_0x109d32['query']['filter']+'%'};return _0x521542;})});}_0xe5c9d6=_[_0x7e5d('0x37')]({},_0xe5c9d6,_0x109d32[_0x7e5d('0x46')]);return _0x447fa5[_0x7e5d('0x49')](_0xe5c9d6);}})[_0x7e5d('0x21')](function(_0xa1b680){if(_0xa1b680){_0x42a3b8=_0xa1b680['length'];if(!_0x109d32[_0x7e5d('0x2a')][_0x7e5d('0x31')](_0x7e5d('0x32'))){_0xe5c9d6[_0x7e5d('0x1b')]=qs[_0x7e5d('0x1b')](_0x109d32['query']['limit']);_0xe5c9d6['offset']=qs['offset'](_0x109d32[_0x7e5d('0x2a')]['offset']);}return _0x447fa5[_0x7e5d('0x49')](_0xe5c9d6);}})[_0x7e5d('0x21')](function(_0xd01665){if(_0xd01665){return _0xd01665?{'count':_0x42a3b8,'rows':_0xd01665}:null;}})[_0x7e5d('0x21')](respondWithResult(_0x2242de,null))[_0x7e5d('0x40')](handleError(_0x2242de,null));};exports[_0x7e5d('0x4a')]=function(_0x4c3b83,_0x1e10ed,_0x4c34ab){var _0x36d6bd={};var _0x2b1f23={};var _0x5db48f;var _0x1ce0a6;return db[_0x7e5d('0x3a')]['findOne']({'where':{'id':_0x4c3b83[_0x7e5d('0x3e')]['id']}})[_0x7e5d('0x21')](handleEntityNotFound(_0x1e10ed,null))['then'](function(_0x2df309){if(_0x2df309){_0x5db48f=_0x2df309;_0x2b1f23[_0x7e5d('0x29')]=_[_0x7e5d('0x2b')](db[_0x7e5d('0x4b')][_0x7e5d('0x26')]);_0x2b1f23['query']=_['keys'](_0x4c3b83['query']);_0x2b1f23[_0x7e5d('0x2c')]=_[_0x7e5d('0x2d')](_0x2b1f23[_0x7e5d('0x29')],_0x2b1f23[_0x7e5d('0x2a')]);_0x36d6bd[_0x7e5d('0x2f')]=_[_0x7e5d('0x2d')](_0x2b1f23[_0x7e5d('0x29')],qs['fields'](_0x4c3b83[_0x7e5d('0x2a')][_0x7e5d('0x2e')]));_0x36d6bd[_0x7e5d('0x2f')]=_0x36d6bd[_0x7e5d('0x2f')][_0x7e5d('0x30')]?_0x36d6bd[_0x7e5d('0x2f')]:_0x2b1f23[_0x7e5d('0x29')];_0x36d6bd['order']=qs[_0x7e5d('0x34')](_0x4c3b83[_0x7e5d('0x2a')][_0x7e5d('0x34')]);_0x36d6bd[_0x7e5d('0x35')]=qs[_0x7e5d('0x2c')](_['pick'](_0x4c3b83[_0x7e5d('0x2a')],_0x2b1f23['filters']));if(_0x4c3b83[_0x7e5d('0x2a')][_0x7e5d('0x36')]){_0x36d6bd['where']=_[_0x7e5d('0x37')](_0x36d6bd[_0x7e5d('0x35')],{'$or':_[_0x7e5d('0x25')](_0x36d6bd['attributes'],function(_0x4a5223){var _0xfb7071={};_0xfb7071[_0x4a5223]={'$like':'%'+_0x4c3b83[_0x7e5d('0x2a')][_0x7e5d('0x36')]+'%'};return _0xfb7071;})});}_0x36d6bd=_['merge']({},_0x36d6bd,_0x4c3b83['options']);return _0x5db48f[_0x7e5d('0x4a')](_0x36d6bd);}})[_0x7e5d('0x21')](function(_0x1dd5d9){if(_0x1dd5d9){_0x1ce0a6=_0x1dd5d9['length'];if(!_0x4c3b83[_0x7e5d('0x2a')][_0x7e5d('0x31')](_0x7e5d('0x32'))){_0x36d6bd['limit']=qs[_0x7e5d('0x1b')](_0x4c3b83[_0x7e5d('0x2a')]['limit']);_0x36d6bd[_0x7e5d('0x19')]=qs[_0x7e5d('0x19')](_0x4c3b83['query'][_0x7e5d('0x19')]);}return _0x5db48f['getTags'](_0x36d6bd);}})[_0x7e5d('0x21')](function(_0x399b3e){if(_0x399b3e){return _0x399b3e?{'count':_0x1ce0a6,'rows':_0x399b3e}:null;}})[_0x7e5d('0x21')](respondWithResult(_0x1e10ed,null))[_0x7e5d('0x40')](handleError(_0x1e10ed,null));};exports[_0x7e5d('0x4c')]=function(_0x218049,_0x161fdd,_0x421b45){if(_0x218049[_0x7e5d('0x41')]['id']){delete _0x218049[_0x7e5d('0x41')]['id'];}return db[_0x7e5d('0x3a')][_0x7e5d('0x44')]({'where':{'id':_0x218049[_0x7e5d('0x3e')]['id']}})[_0x7e5d('0x21')](handleEntityNotFound(_0x161fdd,null))['then'](function(_0x2cb340){if(_0x2cb340){return _0x2cb340[_0x7e5d('0x4c')](_0x218049['body'][_0x7e5d('0x4d')]||[]);}return null;})[_0x7e5d('0x21')](respondWithResult(_0x161fdd,null))[_0x7e5d('0x40')](handleError(_0x161fdd,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index c889eeb..80ea914 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 _0xb688=['exports','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes'];(function(_0x1304ad,_0x3857f4){var _0x4655f0=function(_0x5e0c78){while(--_0x5e0c78){_0x1304ad['push'](_0x1304ad['shift']());}};_0x4655f0(++_0x3857f4);}(_0xb688,0xcf));var _0x8b68=function(_0x429869,_0x5ca6df){_0x429869=_0x429869-0x0;var _0x3c2f89=_0xb688[_0x429869];return _0x3c2f89;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var logger=require(_0x8b68('0x1'))(_0x8b68('0x2'));var moment=require(_0x8b68('0x3'));var BPromise=require(_0x8b68('0x4'));var rp=require(_0x8b68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var attributes=require(_0x8b68('0x8'));module[_0x8b68('0x9')]=function(_0x583d16,_0x34314e){return _0x583d16['define'](_0x8b68('0xa'),attributes,{'tableName':_0x8b68('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e2e=['exports','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x3aea40,_0x3aeb6e){_0x3aea40=_0x3aea40-0x0;var _0x4f5daf=_0x4e2e[_0x3aea40];return _0x4f5daf;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var logger=require(_0xe4e2('0x1'))(_0xe4e2('0x2'));var moment=require(_0xe4e2('0x3'));var BPromise=require(_0xe4e2('0x4'));var rp=require(_0xe4e2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe4e2('0x6'));var config=require(_0xe4e2('0x7'));var attributes=require(_0xe4e2('0x8'));module[_0xe4e2('0x9')]=function(_0x48e83d,_0x322295){return _0x48e83d[_0xe4e2('0xa')](_0xe4e2('0xb'),attributes,{'tableName':_0xe4e2('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 0db12d2..81ca3eb 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 _0x4581=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x2905ab,_0x215005){var _0x24f2eb=function(_0x7e3da6){while(--_0x7e3da6){_0x2905ab['push'](_0x2905ab['shift']());}};_0x24f2eb(++_0x215005);}(_0x4581,0x1a0));var _0x1458=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4581[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1458('0x0'));var util=require(_0x1458('0x1'));var moment=require(_0x1458('0x2'));var BPromise=require(_0x1458('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1458('0x4'));var db=require(_0x1458('0x5'))['db'];var utils=require(_0x1458('0x6'));var logger=require(_0x1458('0x7'))(_0x1458('0x8'));var config=require(_0x1458('0x9'));var jayson=require(_0x1458('0xa'));var client=jayson[_0x1458('0xb')][_0x1458('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x419645,_0x4d72b5,_0x26c762){return new BPromise(function(_0x13932e,_0x27887a){return client[_0x1458('0xd')](_0x419645,_0x26c762)[_0x1458('0xe')](function(_0x2c1952){logger['info'](_0x1458('0xf'),_0x4d72b5,_0x1458('0x10'));logger['debug'](_0x1458('0x11'),_0x4d72b5,_0x1458('0x10'),JSON['stringify'](_0x2c1952));if(_0x2c1952[_0x1458('0x12')]){if(_0x2c1952[_0x1458('0x12')][_0x1458('0x13')]===0x1f4){logger['error'](_0x1458('0xf'),_0x4d72b5,_0x2c1952[_0x1458('0x12')][_0x1458('0x14')]);return _0x27887a(_0x2c1952[_0x1458('0x12')]['message']);}logger[_0x1458('0x12')](_0x1458('0xf'),_0x4d72b5,_0x2c1952[_0x1458('0x12')]['message']);return _0x13932e(_0x2c1952[_0x1458('0x12')][_0x1458('0x14')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x4d72b5,_0x1458('0x10'));_0x13932e(_0x2c1952[_0x1458('0x15')][_0x1458('0x14')]);}})[_0x1458('0x16')](function(_0x53210a){logger['error'](_0x1458('0xf'),_0x4d72b5,_0x53210a);_0x27887a(_0x53210a);});});} \ No newline at end of file +var _0xfa15=['debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x3b1620,_0x51a4c4){var _0x454681=function(_0x55aa83){while(--_0x55aa83){_0x3b1620['push'](_0x3b1620['shift']());}};_0x454681(++_0x51a4c4);}(_0xfa15,0xef));var _0x5fa1=function(_0xac39d3,_0x5da282){_0xac39d3=_0xac39d3-0x0;var _0x1ec7fa=_0xfa15[_0xac39d3];return _0x1ec7fa;};'use strict';var _=require('lodash');var util=require(_0x5fa1('0x0'));var moment=require(_0x5fa1('0x1'));var BPromise=require('bluebird');var rs=require(_0x5fa1('0x2'));var fs=require('fs');var Redis=require(_0x5fa1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5fa1('0x4'));var logger=require(_0x5fa1('0x5'))(_0x5fa1('0x6'));var config=require(_0x5fa1('0x7'));var jayson=require(_0x5fa1('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3b48a9,_0x30487d,_0x1d3cff){return new BPromise(function(_0x3a0624,_0x2cf9ef){return client['request'](_0x3b48a9,_0x1d3cff)[_0x5fa1('0x9')](function(_0x575c63){logger[_0x5fa1('0xa')](_0x5fa1('0xb'),_0x30487d,_0x5fa1('0xc'));logger[_0x5fa1('0xd')](_0x5fa1('0xe'),_0x30487d,'request\x20sent',JSON[_0x5fa1('0xf')](_0x575c63));if(_0x575c63[_0x5fa1('0x10')]){if(_0x575c63['error'][_0x5fa1('0x11')]===0x1f4){logger[_0x5fa1('0x10')](_0x5fa1('0xb'),_0x30487d,_0x575c63[_0x5fa1('0x10')]['message']);return _0x2cf9ef(_0x575c63[_0x5fa1('0x10')]['message']);}logger[_0x5fa1('0x10')](_0x5fa1('0xb'),_0x30487d,_0x575c63[_0x5fa1('0x10')]['message']);return _0x3a0624(_0x575c63['error'][_0x5fa1('0x12')]);}else{logger[_0x5fa1('0xa')](_0x5fa1('0xb'),_0x30487d,_0x5fa1('0xc'));_0x3a0624(_0x575c63[_0x5fa1('0x13')][_0x5fa1('0x12')]);}})[_0x5fa1('0x14')](function(_0x4b13fc){logger[_0x5fa1('0x10')](_0x5fa1('0xb'),_0x30487d,_0x4b13fc);_0x2cf9ef(_0x4b13fc);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index b6a5300..c86aa3a 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 _0x48b0=['path','express','fs-extra','../../components/auth/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','util'];(function(_0x1cfb2f,_0x2a2030){var _0x53d73e=function(_0x1826ec){while(--_0x1826ec){_0x1cfb2f['push'](_0x1cfb2f['shift']());}};_0x53d73e(++_0x2a2030);}(_0x48b0,0xf5));var _0x048b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x48b0[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x048b('0x0'));var util=require(_0x048b('0x1'));var path=require(_0x048b('0x2'));var timeout=require('connect-timeout');var express=require(_0x048b('0x3'));var router=express['Router']();var fs_extra=require(_0x048b('0x4'));var auth=require(_0x048b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x048b('0x6'));var controller=require(_0x048b('0x7'));router[_0x048b('0x8')]('/',auth[_0x048b('0x9')](),controller[_0x048b('0xa')]);router['get'](_0x048b('0xb'),auth[_0x048b('0x9')](),controller[_0x048b('0xc')]);router[_0x048b('0xd')]('/',auth[_0x048b('0x9')](),controller[_0x048b('0xe')]);router[_0x048b('0xf')]('/:id',auth[_0x048b('0x9')](),controller['update']);router[_0x048b('0x10')](_0x048b('0xb'),auth[_0x048b('0x9')](),controller[_0x048b('0x11')]);module[_0x048b('0x12')]=router; \ No newline at end of file +var _0xdb3e=['create','put','update','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show'];(function(_0x34520d,_0x31419e){var _0x8b8eb=function(_0x406750){while(--_0x406750){_0x34520d['push'](_0x34520d['shift']());}};_0x8b8eb(++_0x31419e);}(_0xdb3e,0x65));var _0xedb3=function(_0x331ff7,_0x5d5258){_0x331ff7=_0x331ff7-0x0;var _0xc6cb36=_0xdb3e[_0x331ff7];return _0xc6cb36;};'use strict';var multer=require('multer');var util=require(_0xedb3('0x0'));var path=require('path');var timeout=require(_0xedb3('0x1'));var express=require('express');var router=express[_0xedb3('0x2')]();var fs_extra=require(_0xedb3('0x3'));var auth=require(_0xedb3('0x4'));var interaction=require(_0xedb3('0x5'));var config=require('../../config/environment');var controller=require('./intZendeskField.controller');router[_0xedb3('0x6')]('/',auth[_0xedb3('0x7')](),controller[_0xedb3('0x8')]);router[_0xedb3('0x6')](_0xedb3('0x9'),auth[_0xedb3('0x7')](),controller[_0xedb3('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xedb3('0xb')]);router[_0xedb3('0xc')](_0xedb3('0x9'),auth[_0xedb3('0x7')](),controller[_0xedb3('0xd')]);router[_0xedb3('0xe')](_0xedb3('0x9'),auth[_0xedb3('0x7')](),controller['destroy']);module[_0xedb3('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index b6e6df0..55f92a2 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 _0x634c=['picklist','STRING','variable','customVariable','exports','ENUM','string','keyValue'];(function(_0x5c30c4,_0x472b42){var _0x11b348=function(_0x3e56e4){while(--_0x3e56e4){_0x5c30c4['push'](_0x5c30c4['shift']());}};_0x11b348(++_0x472b42);}(_0x634c,0xd4));var _0xc634=function(_0x31be94,_0x5e7476){_0x31be94=_0x31be94-0x0;var _0x25ebb8=_0x634c[_0x31be94];return _0x25ebb8;};'use strict';var Sequelize=require('sequelize');module[_0xc634('0x0')]={'type':{'type':Sequelize[_0xc634('0x1')](_0xc634('0x2'),'variable','customVariable',_0xc634('0x3'),_0xc634('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc634('0x5')]},'key':{'type':Sequelize[_0xc634('0x5')]},'keyType':{'type':Sequelize[_0xc634('0x1')](_0xc634('0x2'),_0xc634('0x6'),_0xc634('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc634('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc634('0x5')]}}; \ No newline at end of file +var _0x8000=['picklist','string','STRING','BOOLEAN','exports','ENUM','variable','customVariable','keyValue'];(function(_0x43e1e6,_0x399da){var _0x58753d=function(_0x260aba){while(--_0x260aba){_0x43e1e6['push'](_0x43e1e6['shift']());}};_0x58753d(++_0x399da);}(_0x8000,0x8b));var _0x0800=function(_0x55dd06,_0x2dcf4b){_0x55dd06=_0x55dd06-0x0;var _0x4e8156=_0x8000[_0x55dd06];return _0x4e8156;};'use strict';var Sequelize=require('sequelize');module[_0x0800('0x0')]={'type':{'type':Sequelize[_0x0800('0x1')]('string',_0x0800('0x2'),_0x0800('0x3'),_0x0800('0x4'),_0x0800('0x5')),'defaultValue':_0x0800('0x6')},'content':{'type':Sequelize[_0x0800('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0800('0x1')](_0x0800('0x6'),_0x0800('0x2'),_0x0800('0x3'))},'keyContent':{'type':Sequelize[_0x0800('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0800('0x7')]},'customField':{'type':Sequelize[_0x0800('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0800('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index b0771a9..b2977b7 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 _0x63ce=['save','update','then','destroy','end','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','type','VIRTUAL','filter','include','catch','params','keys','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject'];(function(_0x5823aa,_0x15603c){var _0x4d7c56=function(_0x332eb0){while(--_0x332eb0){_0x5823aa['push'](_0x5823aa['shift']());}};_0x4d7c56(++_0x15603c);}(_0x63ce,0x147));var _0xe63c=function(_0x590b61,_0x4c4335){_0x590b61=_0x590b61-0x0;var _0x1a14dc=_0x63ce[_0x590b61];return _0x1a14dc;};'use strict';var emlformat=require(_0xe63c('0x0'));var rimraf=require(_0xe63c('0x1'));var zipdir=require(_0xe63c('0x2'));var jsonpatch=require(_0xe63c('0x3'));var rp=require(_0xe63c('0x4'));var moment=require(_0xe63c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe63c('0x6'));var util=require(_0xe63c('0x7'));var path=require(_0xe63c('0x8'));var sox=require(_0xe63c('0x9'));var csv=require('to-csv');var ejs=require(_0xe63c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe63c('0xb'));var jsforce=require(_0xe63c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe63c('0xd'));var querystring=require(_0xe63c('0xe'));var Papa=require('papaparse');var Redis=require(_0xe63c('0xf'));var authService=require(_0xe63c('0x10'));var qs=require(_0xe63c('0x11'));var as=require(_0xe63c('0x12'));var hardwareService=require(_0xe63c('0x13'));var logger=require('../../config/logger')(_0xe63c('0x14'));var utils=require(_0xe63c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe63c('0x16'))['db'];function respondWithStatusCode(_0x2e4cbf,_0x5f0c6c){_0x5f0c6c=_0x5f0c6c||0xcc;return function(_0xa24a15){if(_0xa24a15){return _0x2e4cbf[_0xe63c('0x17')](_0x5f0c6c);}return _0x2e4cbf['status'](_0x5f0c6c)['end']();};}function respondWithResult(_0x5786e0,_0x558aa9){_0x558aa9=_0x558aa9||0xc8;return function(_0xf3046a){if(_0xf3046a){return _0x5786e0[_0xe63c('0x18')](_0x558aa9)[_0xe63c('0x19')](_0xf3046a);}};}function respondWithFilteredResult(_0x1cef6e,_0x1e541b){return function(_0x9738da){if(_0x9738da){var _0x420b74=typeof _0x1e541b[_0xe63c('0x1a')]===_0xe63c('0x1b')&&typeof _0x1e541b[_0xe63c('0x1c')]==='undefined';var _0x49ab54=_0x9738da['count'];var _0x3e02c3=_0x420b74?0x0:_0x1e541b[_0xe63c('0x1a')];var _0x59d3c1=_0x420b74?_0x9738da[_0xe63c('0x1d')]:_0x1e541b[_0xe63c('0x1a')]+_0x1e541b['limit'];var _0xfc20ab;if(_0x59d3c1>=_0x49ab54){_0x59d3c1=_0x49ab54;_0xfc20ab=0xc8;}else{_0xfc20ab=0xce;}_0x1cef6e[_0xe63c('0x18')](_0xfc20ab);return _0x1cef6e[_0xe63c('0x1e')](_0xe63c('0x1f'),_0x3e02c3+'-'+_0x59d3c1+'/'+_0x49ab54)['json'](_0x9738da);}return null;};}function patchUpdates(_0x309c21){return function(_0x5a8982){try{jsonpatch['apply'](_0x5a8982,_0x309c21,!![]);}catch(_0x19fc7e){return BPromise[_0xe63c('0x20')](_0x19fc7e);}return _0x5a8982[_0xe63c('0x21')]();};}function saveUpdates(_0x5c9ffc,_0x4afad0){return function(_0x54b1a7){if(_0x54b1a7){return _0x54b1a7[_0xe63c('0x22')](_0x5c9ffc)[_0xe63c('0x23')](function(_0xfed799){return _0xfed799;});}return null;};}function removeEntity(_0x2125aa,_0x3cf4b9){return function(_0x51b31){if(_0x51b31){return _0x51b31[_0xe63c('0x24')]()[_0xe63c('0x23')](function(){_0x2125aa[_0xe63c('0x18')](0xcc)[_0xe63c('0x25')]();});}};}function handleEntityNotFound(_0x3ad4b6,_0x8f585){return function(_0x19a190){if(!_0x19a190){_0x3ad4b6[_0xe63c('0x17')](0x194);}return _0x19a190;};}function handleError(_0x4d26f2,_0x27d4a1){_0x27d4a1=_0x27d4a1||0x1f4;return function(_0x10d0fd){logger['error'](_0x10d0fd[_0xe63c('0x26')]);if(_0x10d0fd[_0xe63c('0x27')]){delete _0x10d0fd['name'];}_0x4d26f2['status'](_0x27d4a1)[_0xe63c('0x28')](_0x10d0fd);};}exports[_0xe63c('0x29')]=function(_0x1afbdd,_0x27519d){var _0x51569a={},_0x5dd3a9={},_0x2dfbc7={'count':0x0,'rows':[]};var _0x52fc38=_[_0xe63c('0x2a')](db[_0xe63c('0x2b')][_0xe63c('0x2c')],function(_0x16b52e){return{'name':_0x16b52e[_0xe63c('0x2d')],'type':_0x16b52e['type'][_0xe63c('0x2e')]};});_0x5dd3a9[_0xe63c('0x2f')]=_[_0xe63c('0x2a')](_0x52fc38,'name');_0x5dd3a9[_0xe63c('0x30')]=_['keys'](_0x1afbdd[_0xe63c('0x30')]);_0x5dd3a9[_0xe63c('0x31')]=_[_0xe63c('0x32')](_0x5dd3a9[_0xe63c('0x2f')],_0x5dd3a9[_0xe63c('0x30')]);_0x51569a['attributes']=_['intersection'](_0x5dd3a9[_0xe63c('0x2f')],qs[_0xe63c('0x33')](_0x1afbdd['query'][_0xe63c('0x33')]));_0x51569a[_0xe63c('0x34')]=_0x51569a[_0xe63c('0x34')][_0xe63c('0x35')]?_0x51569a[_0xe63c('0x34')]:_0x5dd3a9[_0xe63c('0x2f')];if(!_0x1afbdd[_0xe63c('0x30')][_0xe63c('0x36')](_0xe63c('0x37'))){_0x51569a[_0xe63c('0x1c')]=qs['limit'](_0x1afbdd[_0xe63c('0x30')][_0xe63c('0x1c')]);_0x51569a[_0xe63c('0x1a')]=qs[_0xe63c('0x1a')](_0x1afbdd[_0xe63c('0x30')][_0xe63c('0x1a')]);}_0x51569a[_0xe63c('0x38')]=qs[_0xe63c('0x39')](_0x1afbdd[_0xe63c('0x30')][_0xe63c('0x39')]);_0x51569a['where']=qs[_0xe63c('0x31')](_[_0xe63c('0x3a')](_0x1afbdd[_0xe63c('0x30')],_0x5dd3a9[_0xe63c('0x31')]),_0x52fc38);if(_0x1afbdd[_0xe63c('0x30')]['filter']){_0x51569a['where']=_[_0xe63c('0x3b')](_0x51569a[_0xe63c('0x3c')],{'$or':_[_0xe63c('0x2a')](_0x52fc38,function(_0x4950da){if(_0x4950da[_0xe63c('0x3d')]!==_0xe63c('0x3e')){var _0x59f4b6={};_0x59f4b6[_0x4950da['name']]={'$like':'%'+_0x1afbdd[_0xe63c('0x30')][_0xe63c('0x3f')]+'%'};return _0x59f4b6;}})});}_0x51569a=_[_0xe63c('0x3b')]({},_0x51569a,_0x1afbdd['options']);var _0x4c9427={'where':_0x51569a[_0xe63c('0x3c')]};return db['ZendeskField'][_0xe63c('0x1d')](_0x4c9427)['then'](function(_0x349785){_0x2dfbc7['count']=_0x349785;if(_0x1afbdd[_0xe63c('0x30')]['includeAll']){_0x51569a[_0xe63c('0x40')]=[{'all':!![]}];}return db[_0xe63c('0x2b')]['findAll'](_0x51569a);})['then'](function(_0x4a9187){_0x2dfbc7['rows']=_0x4a9187;return _0x2dfbc7;})['then'](respondWithFilteredResult(_0x27519d,_0x51569a))[_0xe63c('0x41')](handleError(_0x27519d,null));};exports['show']=function(_0x3b78a7,_0x1bb940){var _0x3b6572={'raw':!![],'where':{'id':_0x3b78a7[_0xe63c('0x42')]['id']}},_0x3dae11={};_0x3dae11[_0xe63c('0x2f')]=_[_0xe63c('0x43')](db[_0xe63c('0x2b')]['rawAttributes']);_0x3dae11[_0xe63c('0x30')]=_['keys'](_0x3b78a7[_0xe63c('0x30')]);_0x3dae11[_0xe63c('0x31')]=_[_0xe63c('0x32')](_0x3dae11['model'],_0x3dae11[_0xe63c('0x30')]);_0x3b6572[_0xe63c('0x34')]=_[_0xe63c('0x32')](_0x3dae11['model'],qs[_0xe63c('0x33')](_0x3b78a7[_0xe63c('0x30')][_0xe63c('0x33')]));_0x3b6572[_0xe63c('0x34')]=_0x3b6572['attributes'][_0xe63c('0x35')]?_0x3b6572['attributes']:_0x3dae11[_0xe63c('0x2f')];if(_0x3b78a7[_0xe63c('0x30')]['includeAll']){_0x3b6572[_0xe63c('0x40')]=[{'all':!![]}];}_0x3b6572=_[_0xe63c('0x3b')]({},_0x3b6572,_0x3b78a7[_0xe63c('0x44')]);return db[_0xe63c('0x2b')][_0xe63c('0x45')](_0x3b6572)['then'](handleEntityNotFound(_0x1bb940,null))['then'](respondWithResult(_0x1bb940,null))['catch'](handleError(_0x1bb940,null));};exports[_0xe63c('0x46')]=function(_0x2555ae,_0x481b91){return db[_0xe63c('0x2b')][_0xe63c('0x46')](_0x2555ae[_0xe63c('0x47')],{})[_0xe63c('0x23')](respondWithResult(_0x481b91,0xc9))[_0xe63c('0x41')](handleError(_0x481b91,null));};exports[_0xe63c('0x22')]=function(_0x297e80,_0x592fb8){if(_0x297e80[_0xe63c('0x47')]['id']){delete _0x297e80[_0xe63c('0x47')]['id'];}return db[_0xe63c('0x2b')]['find']({'where':{'id':_0x297e80[_0xe63c('0x42')]['id']}})[_0xe63c('0x23')](handleEntityNotFound(_0x592fb8,null))[_0xe63c('0x23')](saveUpdates(_0x297e80[_0xe63c('0x47')],null))['then'](respondWithResult(_0x592fb8,null))[_0xe63c('0x41')](handleError(_0x592fb8,null));};exports[_0xe63c('0x24')]=function(_0x330af5,_0x46de9b){return db['ZendeskField'][_0xe63c('0x45')]({'where':{'id':_0x330af5[_0xe63c('0x42')]['id']}})[_0xe63c('0x23')](handleEntityNotFound(_0x46de9b,null))[_0xe63c('0x23')](removeEntity(_0x46de9b,null))['catch'](handleError(_0x46de9b,null));}; \ No newline at end of file +var _0x6838=['rawAttributes','fieldName','key','query','filters','intersection','attributes','model','fields','where','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','params','keys','include','find','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','ZendeskField'];(function(_0x4a006a,_0x28fb65){var _0x1c7d1c=function(_0x359ec2){while(--_0x359ec2){_0x4a006a['push'](_0x4a006a['shift']());}};_0x1c7d1c(++_0x28fb65);}(_0x6838,0xa8));var _0x8683=function(_0x53d816,_0x1d1594){_0x53d816=_0x53d816-0x0;var _0x17c9ed=_0x6838[_0x53d816];return _0x17c9ed;};'use strict';var emlformat=require(_0x8683('0x0'));var rimraf=require(_0x8683('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8683('0x2'));var moment=require(_0x8683('0x3'));var BPromise=require(_0x8683('0x4'));var Mustache=require(_0x8683('0x5'));var util=require(_0x8683('0x6'));var path=require(_0x8683('0x7'));var sox=require(_0x8683('0x8'));var csv=require(_0x8683('0x9'));var ejs=require(_0x8683('0xa'));var fs=require('fs');var fs_extra=require(_0x8683('0xb'));var _=require('lodash');var squel=require(_0x8683('0xc'));var crypto=require(_0x8683('0xd'));var jsforce=require(_0x8683('0xe'));var deskjs=require(_0x8683('0xf'));var toCsv=require(_0x8683('0x9'));var querystring=require(_0x8683('0x10'));var Papa=require(_0x8683('0x11'));var Redis=require('ioredis');var authService=require(_0x8683('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8683('0x13'));var hardwareService=require(_0x8683('0x14'));var logger=require(_0x8683('0x15'))(_0x8683('0x16'));var utils=require(_0x8683('0x17'));var config=require(_0x8683('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30c57a,_0x4dbd93){_0x4dbd93=_0x4dbd93||0xcc;return function(_0x558b43){if(_0x558b43){return _0x30c57a['sendStatus'](_0x4dbd93);}return _0x30c57a[_0x8683('0x19')](_0x4dbd93)['end']();};}function respondWithResult(_0x250d92,_0x5695d1){_0x5695d1=_0x5695d1||0xc8;return function(_0x13bbbb){if(_0x13bbbb){return _0x250d92[_0x8683('0x19')](_0x5695d1)[_0x8683('0x1a')](_0x13bbbb);}};}function respondWithFilteredResult(_0x5b9b6c,_0x3cb57f){return function(_0x18da91){if(_0x18da91){var _0x4385c7=typeof _0x3cb57f[_0x8683('0x1b')]===_0x8683('0x1c')&&typeof _0x3cb57f[_0x8683('0x1d')]===_0x8683('0x1c');var _0x5de2f7=_0x18da91['count'];var _0x2669a4=_0x4385c7?0x0:_0x3cb57f[_0x8683('0x1b')];var _0x4ffaf4=_0x4385c7?_0x18da91[_0x8683('0x1e')]:_0x3cb57f[_0x8683('0x1b')]+_0x3cb57f[_0x8683('0x1d')];var _0x36bcb3;if(_0x4ffaf4>=_0x5de2f7){_0x4ffaf4=_0x5de2f7;_0x36bcb3=0xc8;}else{_0x36bcb3=0xce;}_0x5b9b6c[_0x8683('0x19')](_0x36bcb3);return _0x5b9b6c[_0x8683('0x1f')](_0x8683('0x20'),_0x2669a4+'-'+_0x4ffaf4+'/'+_0x5de2f7)[_0x8683('0x1a')](_0x18da91);}return null;};}function patchUpdates(_0x2bd2fb){return function(_0x58f49f){try{jsonpatch[_0x8683('0x21')](_0x58f49f,_0x2bd2fb,!![]);}catch(_0x48800f){return BPromise[_0x8683('0x22')](_0x48800f);}return _0x58f49f[_0x8683('0x23')]();};}function saveUpdates(_0x292699,_0x42b57a){return function(_0x14b792){if(_0x14b792){return _0x14b792[_0x8683('0x24')](_0x292699)[_0x8683('0x25')](function(_0x4b4b94){return _0x4b4b94;});}return null;};}function removeEntity(_0x112f15,_0x4a50db){return function(_0x223332){if(_0x223332){return _0x223332[_0x8683('0x26')]()[_0x8683('0x25')](function(){_0x112f15[_0x8683('0x19')](0xcc)[_0x8683('0x27')]();});}};}function handleEntityNotFound(_0x2b22fd,_0x1c228d){return function(_0x5c7cfa){if(!_0x5c7cfa){_0x2b22fd[_0x8683('0x28')](0x194);}return _0x5c7cfa;};}function handleError(_0x538359,_0x295098){_0x295098=_0x295098||0x1f4;return function(_0x7a3552){logger[_0x8683('0x29')](_0x7a3552[_0x8683('0x2a')]);if(_0x7a3552[_0x8683('0x2b')]){delete _0x7a3552[_0x8683('0x2b')];}_0x538359[_0x8683('0x19')](_0x295098)[_0x8683('0x2c')](_0x7a3552);};}exports[_0x8683('0x2d')]=function(_0x53f339,_0xae93a2){var _0x555c8f={},_0x5cd2be={},_0x4e7040={'count':0x0,'rows':[]};var _0x5e6c97=_[_0x8683('0x2e')](db[_0x8683('0x2f')][_0x8683('0x30')],function(_0x4821f3){return{'name':_0x4821f3[_0x8683('0x31')],'type':_0x4821f3['type'][_0x8683('0x32')]};});_0x5cd2be['model']=_['map'](_0x5e6c97,_0x8683('0x2b'));_0x5cd2be[_0x8683('0x33')]=_['keys'](_0x53f339[_0x8683('0x33')]);_0x5cd2be[_0x8683('0x34')]=_[_0x8683('0x35')](_0x5cd2be['model'],_0x5cd2be['query']);_0x555c8f[_0x8683('0x36')]=_[_0x8683('0x35')](_0x5cd2be[_0x8683('0x37')],qs[_0x8683('0x38')](_0x53f339[_0x8683('0x33')]['fields']));_0x555c8f[_0x8683('0x36')]=_0x555c8f[_0x8683('0x36')]['length']?_0x555c8f[_0x8683('0x36')]:_0x5cd2be[_0x8683('0x37')];if(!_0x53f339[_0x8683('0x33')]['hasOwnProperty']('nolimit')){_0x555c8f[_0x8683('0x1d')]=qs['limit'](_0x53f339['query'][_0x8683('0x1d')]);_0x555c8f['offset']=qs[_0x8683('0x1b')](_0x53f339[_0x8683('0x33')][_0x8683('0x1b')]);}_0x555c8f['order']=qs['sort'](_0x53f339[_0x8683('0x33')]['sort']);_0x555c8f[_0x8683('0x39')]=qs[_0x8683('0x34')](_['pick'](_0x53f339[_0x8683('0x33')],_0x5cd2be[_0x8683('0x34')]),_0x5e6c97);if(_0x53f339[_0x8683('0x33')][_0x8683('0x3a')]){_0x555c8f[_0x8683('0x39')]=_[_0x8683('0x3b')](_0x555c8f[_0x8683('0x39')],{'$or':_[_0x8683('0x2e')](_0x5e6c97,function(_0x20e4af){if(_0x20e4af[_0x8683('0x3c')]!==_0x8683('0x3d')){var _0xe66616={};_0xe66616[_0x20e4af[_0x8683('0x2b')]]={'$like':'%'+_0x53f339[_0x8683('0x33')][_0x8683('0x3a')]+'%'};return _0xe66616;}})});}_0x555c8f=_[_0x8683('0x3b')]({},_0x555c8f,_0x53f339[_0x8683('0x3e')]);var _0x590eb1={'where':_0x555c8f[_0x8683('0x39')]};return db[_0x8683('0x2f')][_0x8683('0x1e')](_0x590eb1)[_0x8683('0x25')](function(_0x85127c){_0x4e7040[_0x8683('0x1e')]=_0x85127c;if(_0x53f339[_0x8683('0x33')][_0x8683('0x3f')]){_0x555c8f['include']=[{'all':!![]}];}return db[_0x8683('0x2f')]['findAll'](_0x555c8f);})[_0x8683('0x25')](function(_0x347251){_0x4e7040[_0x8683('0x40')]=_0x347251;return _0x4e7040;})[_0x8683('0x25')](respondWithFilteredResult(_0xae93a2,_0x555c8f))[_0x8683('0x41')](handleError(_0xae93a2,null));};exports['show']=function(_0x344f67,_0x5c0163){var _0x2c4757={'raw':!![],'where':{'id':_0x344f67[_0x8683('0x42')]['id']}},_0xef887b={};_0xef887b['model']=_['keys'](db[_0x8683('0x2f')]['rawAttributes']);_0xef887b[_0x8683('0x33')]=_[_0x8683('0x43')](_0x344f67[_0x8683('0x33')]);_0xef887b[_0x8683('0x34')]=_['intersection'](_0xef887b[_0x8683('0x37')],_0xef887b[_0x8683('0x33')]);_0x2c4757[_0x8683('0x36')]=_['intersection'](_0xef887b[_0x8683('0x37')],qs[_0x8683('0x38')](_0x344f67[_0x8683('0x33')][_0x8683('0x38')]));_0x2c4757[_0x8683('0x36')]=_0x2c4757[_0x8683('0x36')]['length']?_0x2c4757[_0x8683('0x36')]:_0xef887b['model'];if(_0x344f67[_0x8683('0x33')][_0x8683('0x3f')]){_0x2c4757[_0x8683('0x44')]=[{'all':!![]}];}_0x2c4757=_[_0x8683('0x3b')]({},_0x2c4757,_0x344f67['options']);return db[_0x8683('0x2f')][_0x8683('0x45')](_0x2c4757)['then'](handleEntityNotFound(_0x5c0163,null))['then'](respondWithResult(_0x5c0163,null))['catch'](handleError(_0x5c0163,null));};exports[_0x8683('0x46')]=function(_0x2b7065,_0x5d755f){return db[_0x8683('0x2f')][_0x8683('0x46')](_0x2b7065['body'],{})[_0x8683('0x25')](respondWithResult(_0x5d755f,0xc9))[_0x8683('0x41')](handleError(_0x5d755f,null));};exports[_0x8683('0x24')]=function(_0x453560,_0x4bcb14){if(_0x453560[_0x8683('0x47')]['id']){delete _0x453560[_0x8683('0x47')]['id'];}return db[_0x8683('0x2f')][_0x8683('0x45')]({'where':{'id':_0x453560['params']['id']}})[_0x8683('0x25')](handleEntityNotFound(_0x4bcb14,null))[_0x8683('0x25')](saveUpdates(_0x453560[_0x8683('0x47')],null))[_0x8683('0x25')](respondWithResult(_0x4bcb14,null))[_0x8683('0x41')](handleError(_0x4bcb14,null));};exports[_0x8683('0x26')]=function(_0x46576f,_0x28fd26){return db[_0x8683('0x2f')][_0x8683('0x45')]({'where':{'id':_0x46576f[_0x8683('0x42')]['id']}})[_0x8683('0x25')](handleEntityNotFound(_0x28fd26,null))[_0x8683('0x25')](removeEntity(_0x28fd26,null))[_0x8683('0x41')](handleError(_0x28fd26,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 1178ae5..e91da8d 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 _0xa01a=['lodash','util','../../config/logger','moment','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId'];(function(_0x4da7e4,_0x4e7569){var _0x310fc1=function(_0x4d18a5){while(--_0x4d18a5){_0x4da7e4['push'](_0x4da7e4['shift']());}};_0x310fc1(++_0x4e7569);}(_0xa01a,0xbe));var _0xaa01=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xa01a[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0xaa01('0x0'));var util=require(_0xaa01('0x1'));var logger=require(_0xaa01('0x2'))('api');var moment=require(_0xaa01('0x3'));var BPromise=require('bluebird');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('./intZendeskField.attributes');module[_0xaa01('0x4')]=function(_0x3cf9f2,_0x1c049f){return _0x3cf9f2[_0xaa01('0x5')](_0xaa01('0x6'),attributes,{'tableName':_0xaa01('0x7'),'paranoid':![],'indexes':[{'name':_0xaa01('0x8'),'fields':['idField',_0xaa01('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe72a=['exports','ZendeskField','int_zendesk_fields','idField','FieldId','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes'];(function(_0x34a346,_0x1d7d06){var _0x8a564b=function(_0x21004f){while(--_0x21004f){_0x34a346['push'](_0x34a346['shift']());}};_0x8a564b(++_0x1d7d06);}(_0xe72a,0x1e1));var _0xae72=function(_0x3ea15e,_0x12e75b){_0x3ea15e=_0x3ea15e-0x0;var _0x47285b=_0xe72a[_0x3ea15e];return _0x47285b;};'use strict';var _=require('lodash');var util=require(_0xae72('0x0'));var logger=require(_0xae72('0x1'))(_0xae72('0x2'));var moment=require('moment');var BPromise=require(_0xae72('0x3'));var rp=require(_0xae72('0x4'));var fs=require('fs');var path=require(_0xae72('0x5'));var rimraf=require(_0xae72('0x6'));var config=require(_0xae72('0x7'));var attributes=require(_0xae72('0x8'));module[_0xae72('0x9')]=function(_0x21cb96,_0xed10b5){return _0x21cb96['define'](_0xae72('0xa'),attributes,{'tableName':_0xae72('0xb'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xae72('0xc'),_0xae72('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 f29b08b..7442367 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 _0x75fe=['info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x5ebecc,_0x540051){var _0x52673d=function(_0x258cfb){while(--_0x258cfb){_0x5ebecc['push'](_0x5ebecc['shift']());}};_0x52673d(++_0x540051);}(_0x75fe,0x1d7));var _0xe75f=function(_0x3eea50,_0x43721e){_0x3eea50=_0x3eea50-0x0;var _0xd423da=_0x75fe[_0x3eea50];return _0xd423da;};'use strict';var _=require(_0xe75f('0x0'));var util=require(_0xe75f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe75f('0x2'));var fs=require('fs');var Redis=require(_0xe75f('0x3'));var db=require(_0xe75f('0x4'))['db'];var utils=require(_0xe75f('0x5'));var logger=require(_0xe75f('0x6'))(_0xe75f('0x7'));var config=require(_0xe75f('0x8'));var jayson=require(_0xe75f('0x9'));var client=jayson[_0xe75f('0xa')][_0xe75f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34916d,_0x18ce15,_0x257c0a){return new BPromise(function(_0x2f8f03,_0x3abf8f){return client['request'](_0x34916d,_0x257c0a)[_0xe75f('0xc')](function(_0x12b125){logger[_0xe75f('0xd')](_0xe75f('0xe'),_0x18ce15,_0xe75f('0xf'));logger['debug'](_0xe75f('0x10'),_0x18ce15,'request\x20sent',JSON['stringify'](_0x12b125));if(_0x12b125['error']){if(_0x12b125[_0xe75f('0x11')][_0xe75f('0x12')]===0x1f4){logger[_0xe75f('0x11')](_0xe75f('0xe'),_0x18ce15,_0x12b125[_0xe75f('0x11')]['message']);return _0x3abf8f(_0x12b125[_0xe75f('0x11')][_0xe75f('0x13')]);}logger['error'](_0xe75f('0xe'),_0x18ce15,_0x12b125[_0xe75f('0x11')][_0xe75f('0x13')]);return _0x2f8f03(_0x12b125[_0xe75f('0x11')][_0xe75f('0x13')]);}else{logger[_0xe75f('0xd')]('ZendeskField,\x20%s,\x20%s',_0x18ce15,'request\x20sent');_0x2f8f03(_0x12b125[_0xe75f('0x14')][_0xe75f('0x13')]);}})[_0xe75f('0x15')](function(_0x1b856a){logger['error']('ZendeskField,\x20%s,\x20%s',_0x18ce15,_0x1b856a);_0x3abf8f(_0x1b856a);});});} \ No newline at end of file +var _0xea63=['http','then','info','ZendeskField,\x20%s,\x20%s','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client'];(function(_0xea35d1,_0x302471){var _0x1d7a7c=function(_0x1bc101){while(--_0x1bc101){_0xea35d1['push'](_0xea35d1['shift']());}};_0x1d7a7c(++_0x302471);}(_0xea63,0x14d));var _0x3ea6=function(_0x1a8f4d,_0x41d5ff){_0x1a8f4d=_0x1a8f4d-0x0;var _0x2a7b91=_0xea63[_0x1a8f4d];return _0x2a7b91;};'use strict';var _=require(_0x3ea6('0x0'));var util=require(_0x3ea6('0x1'));var moment=require(_0x3ea6('0x2'));var BPromise=require(_0x3ea6('0x3'));var rs=require(_0x3ea6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3ea6('0x5'));var config=require(_0x3ea6('0x6'));var jayson=require(_0x3ea6('0x7'));var client=jayson[_0x3ea6('0x8')][_0x3ea6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e67f4,_0x57b978,_0x364fff){return new BPromise(function(_0x148228,_0x74e5f8){return client['request'](_0x3e67f4,_0x364fff)[_0x3ea6('0xa')](function(_0x179861){logger[_0x3ea6('0xb')](_0x3ea6('0xc'),_0x57b978,'request\x20sent');logger['debug'](_0x3ea6('0xd'),_0x57b978,'request\x20sent',JSON[_0x3ea6('0xe')](_0x179861));if(_0x179861[_0x3ea6('0xf')]){if(_0x179861[_0x3ea6('0xf')][_0x3ea6('0x10')]===0x1f4){logger[_0x3ea6('0xf')]('ZendeskField,\x20%s,\x20%s',_0x57b978,_0x179861[_0x3ea6('0xf')][_0x3ea6('0x11')]);return _0x74e5f8(_0x179861[_0x3ea6('0xf')]['message']);}logger[_0x3ea6('0xf')]('ZendeskField,\x20%s,\x20%s',_0x57b978,_0x179861[_0x3ea6('0xf')][_0x3ea6('0x11')]);return _0x148228(_0x179861['error'][_0x3ea6('0x11')]);}else{logger[_0x3ea6('0xb')](_0x3ea6('0xc'),_0x57b978,'request\x20sent');_0x148228(_0x179861['result'][_0x3ea6('0x11')]);}})['catch'](function(_0x447daf){logger[_0x3ea6('0xf')](_0x3ea6('0xc'),_0x57b978,_0x447daf);_0x74e5f8(_0x447daf);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 41acfdf..f382a87 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 _0x11e4=['/:id/fields','getFields','post','put','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id/configurations','get'];(function(_0x49d103,_0x1af355){var _0x54250a=function(_0xc7aab6){while(--_0xc7aab6){_0x49d103['push'](_0x49d103['shift']());}};_0x54250a(++_0x1af355);}(_0x11e4,0xf7));var _0x411e=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x11e4[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require(_0x411e('0x0'));var util=require(_0x411e('0x1'));var path=require('path');var timeout=require(_0x411e('0x2'));var express=require(_0x411e('0x3'));var router=express[_0x411e('0x4')]();var fs_extra=require(_0x411e('0x5'));var auth=require(_0x411e('0x6'));var interaction=require(_0x411e('0x7'));var config=require(_0x411e('0x8'));var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0x411e('0x9')](),controller[_0x411e('0xa')]);router['get']('/:id',auth[_0x411e('0x9')](),controller['show']);router['get'](_0x411e('0xb'),auth[_0x411e('0x9')](),controller['getConfigurations']);router[_0x411e('0xc')](_0x411e('0xd'),auth['isAuthenticated'](),controller[_0x411e('0xe')]);router[_0x411e('0xf')]('/',auth[_0x411e('0x9')](),controller['create']);router[_0x411e('0xf')](_0x411e('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x411e('0x10')](_0x411e('0x11'),auth[_0x411e('0x9')](),controller['update']);router['delete'](_0x411e('0x11'),auth[_0x411e('0x9')](),controller[_0x411e('0x12')]);module[_0x411e('0x13')]=router; \ No newline at end of file +var _0xcca7=['/:id','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x514daf,_0x5422d0){var _0x53a711=function(_0xc6bf62){while(--_0xc6bf62){_0x514daf['push'](_0x514daf['shift']());}};_0x53a711(++_0x5422d0);}(_0xcca7,0x15b));var _0x7cca=function(_0x194058,_0x5c6092){_0x194058=_0x194058-0x0;var _0x2c76a1=_0xcca7[_0x194058];return _0x2c76a1;};'use strict';var multer=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var path=require('path');var timeout=require(_0x7cca('0x2'));var express=require(_0x7cca('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7cca('0x4'));var interaction=require(_0x7cca('0x5'));var config=require(_0x7cca('0x6'));var controller=require('./intZohoAccount.controller');router[_0x7cca('0x7')]('/',auth[_0x7cca('0x8')](),controller[_0x7cca('0x9')]);router[_0x7cca('0x7')](_0x7cca('0xa'),auth[_0x7cca('0x8')](),controller['show']);router['get'](_0x7cca('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x7cca('0xc'),auth[_0x7cca('0x8')](),controller[_0x7cca('0xd')]);router[_0x7cca('0xe')]('/',auth[_0x7cca('0x8')](),controller[_0x7cca('0xf')]);router[_0x7cca('0xe')](_0x7cca('0xb'),auth[_0x7cca('0x8')](),controller[_0x7cca('0x10')]);router[_0x7cca('0x11')](_0x7cca('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x7cca('0x12')](_0x7cca('0xa'),auth[_0x7cca('0x8')](),controller[_0x7cca('0x13')]);module[_0x7cca('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 1277a81..9cd8544 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 _0xa75b=['sequelize','STRING'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xa75b,0x170));var _0xba75=function(_0x2b8820,_0x2fff8d){_0x2b8820=_0x2b8820-0x0;var _0x331b47=_0xa75b[_0x2b8820];return _0x331b47;};'use strict';var Sequelize=require(_0xba75('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xba75('0x1')]},'host':{'type':Sequelize[_0xba75('0x1')]},'zone':{'type':Sequelize[_0xba75('0x1')]},'clientId':{'type':Sequelize[_0xba75('0x1')]},'clientSecret':{'type':Sequelize[_0xba75('0x1')]},'serverUrl':{'type':Sequelize[_0xba75('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xba75('0x1')]},'refreshToken':{'type':Sequelize[_0xba75('0x1')]}}; \ No newline at end of file +var _0x00bb=['STRING','sequelize','exports'];(function(_0x33a9ae,_0x2fa819){var _0x5e9f84=function(_0x496fe9){while(--_0x496fe9){_0x33a9ae['push'](_0x33a9ae['shift']());}};_0x5e9f84(++_0x2fa819);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x00bb[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0xb00b('0x0'));module[_0xb00b('0x1')]={'name':{'type':Sequelize[_0xb00b('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xb00b('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb00b('0x2')]},'clientSecret':{'type':Sequelize[_0xb00b('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0xb00b('0x2')]},'refreshToken':{'type':Sequelize[_0xb00b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 2d77f1d..b39649d 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 _0x45d3=['include','findAll','rows','catch','show','keys','length','find','create','body','params','findOne','ZohoConfiguration','order','filter','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','zone','serverUrl','code','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','Owner','Subject','Description','Call_Duration','Call_Type','remove','includes','api_name','system_mandatory','push','data_type','picklist','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','nolimit','limit','sort','where','pick','merge','type','VIRTUAL','options','ZohoAccount'];(function(_0x279753,_0x505f8a){var _0x18fc9d=function(_0xa9da25){while(--_0xa9da25){_0x279753['push'](_0x279753['shift']());}};_0x18fc9d(++_0x505f8a);}(_0x45d3,0x148));var _0x345d=function(_0x1a2254,_0xeffd13){_0x1a2254=_0x1a2254-0x0;var _0x4e940f=_0x45d3[_0x1a2254];return _0x4e940f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x345d('0x0'));var zipdir=require(_0x345d('0x1'));var jsonpatch=require(_0x345d('0x2'));var rp=require(_0x345d('0x3'));var moment=require(_0x345d('0x4'));var BPromise=require(_0x345d('0x5'));var Mustache=require(_0x345d('0x6'));var util=require(_0x345d('0x7'));var path=require(_0x345d('0x8'));var sox=require(_0x345d('0x9'));var csv=require(_0x345d('0xa'));var ejs=require(_0x345d('0xb'));var fs=require('fs');var fs_extra=require(_0x345d('0xc'));var _=require(_0x345d('0xd'));var squel=require(_0x345d('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x345d('0xf'));var toCsv=require(_0x345d('0xa'));var querystring=require('querystring');var Papa=require(_0x345d('0x10'));var Redis=require(_0x345d('0x11'));var authService=require(_0x345d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x345d('0x13'));var hardwareService=require(_0x345d('0x14'));var logger=require(_0x345d('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x345d('0x16'));var licenseUtil=require(_0x345d('0x17'));var db=require(_0x345d('0x18'))['db'];var integrations=require(_0x345d('0x19'));function respondWithStatusCode(_0x365b5e,_0x49e432){_0x49e432=_0x49e432||0xcc;return function(_0x3fbc69){if(_0x3fbc69){return _0x365b5e[_0x345d('0x1a')](_0x49e432);}return _0x365b5e[_0x345d('0x1b')](_0x49e432)[_0x345d('0x1c')]();};}function respondWithResult(_0x173b82,_0xb923e6){_0xb923e6=_0xb923e6||0xc8;return function(_0x299e29){if(_0x299e29){return _0x173b82[_0x345d('0x1b')](_0xb923e6)[_0x345d('0x1d')](_0x299e29);}};}function respondWithFilteredResult(_0x1cd08d,_0x611d5f){return function(_0x220f9e){if(_0x220f9e){var _0x2cff0f=typeof _0x611d5f[_0x345d('0x1e')]===_0x345d('0x1f')&&typeof _0x611d5f['limit']===_0x345d('0x1f');var _0x133a19=_0x220f9e['count'];var _0x5dc083=_0x2cff0f?0x0:_0x611d5f[_0x345d('0x1e')];var _0x53a80b=_0x2cff0f?_0x220f9e[_0x345d('0x20')]:_0x611d5f[_0x345d('0x1e')]+_0x611d5f['limit'];var _0x3d1c18;if(_0x53a80b>=_0x133a19){_0x53a80b=_0x133a19;_0x3d1c18=0xc8;}else{_0x3d1c18=0xce;}_0x1cd08d['status'](_0x3d1c18);return _0x1cd08d[_0x345d('0x21')](_0x345d('0x22'),_0x5dc083+'-'+_0x53a80b+'/'+_0x133a19)[_0x345d('0x1d')](_0x220f9e);}return null;};}function patchUpdates(_0x1cb7a1){return function(_0x31d0d7){try{jsonpatch[_0x345d('0x23')](_0x31d0d7,_0x1cb7a1,!![]);}catch(_0x5c42a9){return BPromise[_0x345d('0x24')](_0x5c42a9);}return _0x31d0d7[_0x345d('0x25')]();};}function saveUpdates(_0x427e90,_0x4a2207){return function(_0x23e3f7){if(_0x23e3f7){return _0x23e3f7[_0x345d('0x26')](_0x427e90)[_0x345d('0x27')](function(_0x4cc23d){return _0x4cc23d;});}return null;};}function removeEntity(_0x247391,_0xdfc0e3){return function(_0x3e22b7){if(_0x3e22b7){return _0x3e22b7[_0x345d('0x28')]()[_0x345d('0x27')](function(){_0x247391[_0x345d('0x1b')](0xcc)[_0x345d('0x1c')]();});}};}function handleEntityNotFound(_0x9e1d85,_0x8dacec){return function(_0x2e0914){if(!_0x2e0914){_0x9e1d85[_0x345d('0x1a')](0x194);}return _0x2e0914;};}function handleError(_0x290c59,_0x20feef){_0x20feef=_0x20feef||0x1f4;return function(_0x4c8b89){logger[_0x345d('0x29')](_0x4c8b89[_0x345d('0x2a')]);if(_0x4c8b89[_0x345d('0x2b')]){delete _0x4c8b89[_0x345d('0x2b')];}_0x290c59[_0x345d('0x1b')](_0x20feef)[_0x345d('0x2c')](_0x4c8b89);};}exports['index']=function(_0xa3a686,_0xaca25d){var _0x240682={},_0x4e2cbe={},_0x54e363={'count':0x0,'rows':[]};var _0x43bcea=_[_0x345d('0x2d')](db['ZohoAccount'][_0x345d('0x2e')],function(_0x43d501){return{'name':_0x43d501[_0x345d('0x2f')],'type':_0x43d501['type'][_0x345d('0x30')]};});_0x4e2cbe[_0x345d('0x31')]=_[_0x345d('0x2d')](_0x43bcea,_0x345d('0x2b'));_0x4e2cbe['query']=_['keys'](_0xa3a686[_0x345d('0x32')]);_0x4e2cbe[_0x345d('0x33')]=_[_0x345d('0x34')](_0x4e2cbe['model'],_0x4e2cbe[_0x345d('0x32')]);_0x240682['attributes']=_[_0x345d('0x34')](_0x4e2cbe['model'],qs[_0x345d('0x35')](_0xa3a686[_0x345d('0x32')][_0x345d('0x35')]));_0x240682[_0x345d('0x36')]=_0x240682[_0x345d('0x36')]['length']?_0x240682[_0x345d('0x36')]:_0x4e2cbe[_0x345d('0x31')];if(!_0xa3a686[_0x345d('0x32')]['hasOwnProperty'](_0x345d('0x37'))){_0x240682[_0x345d('0x38')]=qs['limit'](_0xa3a686[_0x345d('0x32')]['limit']);_0x240682[_0x345d('0x1e')]=qs['offset'](_0xa3a686[_0x345d('0x32')]['offset']);}_0x240682['order']=qs[_0x345d('0x39')](_0xa3a686[_0x345d('0x32')][_0x345d('0x39')]);_0x240682[_0x345d('0x3a')]=qs[_0x345d('0x33')](_[_0x345d('0x3b')](_0xa3a686[_0x345d('0x32')],_0x4e2cbe[_0x345d('0x33')]),_0x43bcea);if(_0xa3a686[_0x345d('0x32')]['filter']){_0x240682[_0x345d('0x3a')]=_[_0x345d('0x3c')](_0x240682[_0x345d('0x3a')],{'$or':_[_0x345d('0x2d')](_0x43bcea,function(_0x3a2d85){if(_0x3a2d85[_0x345d('0x3d')]!==_0x345d('0x3e')){var _0x798b38={};_0x798b38[_0x3a2d85['name']]={'$like':'%'+_0xa3a686[_0x345d('0x32')]['filter']+'%'};return _0x798b38;}})});}_0x240682=_[_0x345d('0x3c')]({},_0x240682,_0xa3a686[_0x345d('0x3f')]);var _0x135e94={'where':_0x240682[_0x345d('0x3a')]};return db[_0x345d('0x40')][_0x345d('0x20')](_0x135e94)[_0x345d('0x27')](function(_0xbf35c5){_0x54e363[_0x345d('0x20')]=_0xbf35c5;if(_0xa3a686['query']['includeAll']){_0x240682[_0x345d('0x41')]=[{'all':!![]}];}return db[_0x345d('0x40')][_0x345d('0x42')](_0x240682);})['then'](function(_0x20ff8f){_0x54e363[_0x345d('0x43')]=_0x20ff8f;return _0x54e363;})[_0x345d('0x27')](respondWithFilteredResult(_0xaca25d,_0x240682))[_0x345d('0x44')](handleError(_0xaca25d,null));};exports[_0x345d('0x45')]=function(_0x3e45e8,_0x26c33f){var _0x48961d={'raw':![],'where':{'id':_0x3e45e8['params']['id']}},_0xaab990={};_0xaab990[_0x345d('0x31')]=_[_0x345d('0x46')](db[_0x345d('0x40')][_0x345d('0x2e')]);_0xaab990[_0x345d('0x32')]=_['keys'](_0x3e45e8[_0x345d('0x32')]);_0xaab990[_0x345d('0x33')]=_[_0x345d('0x34')](_0xaab990[_0x345d('0x31')],_0xaab990[_0x345d('0x32')]);_0x48961d[_0x345d('0x36')]=_['intersection'](_0xaab990[_0x345d('0x31')],qs[_0x345d('0x35')](_0x3e45e8[_0x345d('0x32')][_0x345d('0x35')]));_0x48961d[_0x345d('0x36')]=_0x48961d[_0x345d('0x36')][_0x345d('0x47')]?_0x48961d[_0x345d('0x36')]:_0xaab990[_0x345d('0x31')];if(_0x3e45e8[_0x345d('0x32')]['includeAll']){_0x48961d['include']=[{'all':!![]}];}_0x48961d=_['merge']({},_0x48961d,_0x3e45e8[_0x345d('0x3f')]);return db['ZohoAccount'][_0x345d('0x48')](_0x48961d)[_0x345d('0x27')](handleEntityNotFound(_0x26c33f,null))[_0x345d('0x27')](respondWithResult(_0x26c33f,null))['catch'](handleError(_0x26c33f,null));};exports[_0x345d('0x49')]=function(_0x3e446d,_0x163f9e){return db[_0x345d('0x40')][_0x345d('0x49')](_0x3e446d[_0x345d('0x4a')],{})[_0x345d('0x27')](respondWithResult(_0x163f9e,0xc9))[_0x345d('0x44')](handleError(_0x163f9e,null));};exports[_0x345d('0x26')]=function(_0x415bbf,_0x1c5a21){if(_0x415bbf[_0x345d('0x4a')]['id']){delete _0x415bbf[_0x345d('0x4a')]['id'];}return db[_0x345d('0x40')][_0x345d('0x48')]({'where':{'id':_0x415bbf['params']['id']}})[_0x345d('0x27')](handleEntityNotFound(_0x1c5a21,null))[_0x345d('0x27')](saveUpdates(_0x415bbf[_0x345d('0x4a')],null))['then'](respondWithResult(_0x1c5a21,null))[_0x345d('0x44')](handleError(_0x1c5a21,null));};exports[_0x345d('0x28')]=function(_0x2f5ef8,_0x3c02c3){return db['ZohoAccount'][_0x345d('0x48')]({'where':{'id':_0x2f5ef8[_0x345d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3c02c3,null))['then'](removeEntity(_0x3c02c3,null))['catch'](handleError(_0x3c02c3,null));};exports['getConfigurations']=function(_0x5846d2,_0x373f21,_0x12f5ce){var _0x22c645={};var _0x3f8ef2={};var _0x5e6703;var _0x188232;return db['ZohoAccount'][_0x345d('0x4c')]({'where':{'id':_0x5846d2[_0x345d('0x4b')]['id']}})[_0x345d('0x27')](handleEntityNotFound(_0x373f21,null))[_0x345d('0x27')](function(_0x179da3){if(_0x179da3){_0x5e6703=_0x179da3;_0x3f8ef2['model']=_[_0x345d('0x46')](db[_0x345d('0x4d')][_0x345d('0x2e')]);_0x3f8ef2[_0x345d('0x32')]=_[_0x345d('0x46')](_0x5846d2[_0x345d('0x32')]);_0x3f8ef2[_0x345d('0x33')]=_[_0x345d('0x34')](_0x3f8ef2[_0x345d('0x31')],_0x3f8ef2[_0x345d('0x32')]);_0x22c645[_0x345d('0x36')]=_['intersection'](_0x3f8ef2['model'],qs[_0x345d('0x35')](_0x5846d2[_0x345d('0x32')][_0x345d('0x35')]));_0x22c645[_0x345d('0x36')]=_0x22c645[_0x345d('0x36')][_0x345d('0x47')]?_0x22c645[_0x345d('0x36')]:_0x3f8ef2['model'];_0x22c645[_0x345d('0x4e')]=qs[_0x345d('0x39')](_0x5846d2[_0x345d('0x32')]['sort']);_0x22c645['where']=qs[_0x345d('0x33')](_[_0x345d('0x3b')](_0x5846d2[_0x345d('0x32')],_0x3f8ef2[_0x345d('0x33')]));if(_0x5846d2['query'][_0x345d('0x4f')]){_0x22c645[_0x345d('0x3a')]=_[_0x345d('0x3c')](_0x22c645[_0x345d('0x3a')],{'$or':_[_0x345d('0x2d')](_0x22c645[_0x345d('0x36')],function(_0xe11432){var _0xdf50f={};_0xdf50f[_0xe11432]={'$like':'%'+_0x5846d2[_0x345d('0x32')][_0x345d('0x4f')]+'%'};return _0xdf50f;})});}_0x22c645=_[_0x345d('0x3c')]({},_0x22c645,_0x5846d2[_0x345d('0x3f')]);return _0x5e6703[_0x345d('0x50')](_0x22c645);}})[_0x345d('0x27')](function(_0x3a5e64){if(_0x3a5e64){_0x188232=_0x3a5e64[_0x345d('0x47')];if(!_0x5846d2[_0x345d('0x32')][_0x345d('0x51')](_0x345d('0x37'))){_0x22c645[_0x345d('0x38')]=qs['limit'](_0x5846d2[_0x345d('0x32')][_0x345d('0x38')]);_0x22c645[_0x345d('0x1e')]=qs[_0x345d('0x1e')](_0x5846d2[_0x345d('0x32')][_0x345d('0x1e')]);}return _0x5e6703[_0x345d('0x50')](_0x22c645);}})[_0x345d('0x27')](function(_0x52ad0a){if(_0x52ad0a){return _0x52ad0a?{'count':_0x188232,'rows':_0x52ad0a}:null;}})[_0x345d('0x27')](respondWithResult(_0x373f21,null))[_0x345d('0x44')](handleError(_0x373f21,null));};exports[_0x345d('0x52')]=function(_0x1d13a7,_0x2f8c66,_0x292932){if(_0x1d13a7[_0x345d('0x4a')]['id']){delete _0x1d13a7[_0x345d('0x4a')]['id'];}return db[_0x345d('0x40')]['findOne']({'where':{'id':_0x1d13a7[_0x345d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2f8c66,null))[_0x345d('0x27')](function(_0x396c82){if(_0x396c82){_0x1d13a7[_0x345d('0x4a')][_0x345d('0x53')]=_0x396c82['id'];_0x1d13a7['body'][_0x345d('0x54')]=integrations[_0x345d('0x55')](_0x1d13a7[_0x345d('0x4a')][_0x345d('0x56')],_0x1d13a7[_0x345d('0x4a')]['type']);_0x1d13a7[_0x345d('0x4a')][_0x345d('0x57')]=integrations[_0x345d('0x58')](_0x1d13a7['body'][_0x345d('0x56')],_0x1d13a7['body'][_0x345d('0x3d')]);return db[_0x345d('0x4d')]['create'](_0x1d13a7[_0x345d('0x4a')],{'include':[{'model':db['ZohoField'],'as':_0x345d('0x54')},{'model':db[_0x345d('0x59')],'as':'Descriptions'}]});}return null;})[_0x345d('0x27')](respondWithResult(_0x2f8c66,null))[_0x345d('0x44')](handleError(_0x2f8c66,null));};function getAccessToken(_0x263d51){return new Promise(function(_0x469786,_0x26715e){var _0x555309;switch(_0x263d51['zone']){case'US':_0x555309=_0x345d('0x5a');break;case'AU':_0x555309='https://accounts.zoho.com.au';break;case'EU':_0x555309=_0x345d('0x5b');break;case'IN':_0x555309='https://accounts.zoho.in';break;case'CN':_0x555309=_0x345d('0x5c');break;default:_0x555309=_0x345d('0x5b');break;}var _0x3782ca={'method':_0x345d('0x5d'),'uri':_0x555309+_0x345d('0x5e'),'qs':{'refresh_token':_0x263d51['refreshToken'],'client_id':_0x263d51[_0x345d('0x5f')],'client_secret':_0x263d51[_0x345d('0x60')],'grant_type':_0x345d('0x61')},'json':!![]};return rp(_0x3782ca)[_0x345d('0x27')](function(_0x46f906){if(_0x46f906['access_token']){_0x469786(_0x46f906[_0x345d('0x62')]);}else{_0x26715e(_0x345d('0x63'));}})[_0x345d('0x44')](function(_0x14eb44){_0x26715e(_0x14eb44);});});}exports['getFields']=function(_0x51084e,_0x20b7bb,_0x134ad0){var _0x564a7c,_0x317b1c,_0x1738ff,_0xa90f7c,_0x520bfe;return db[_0x345d('0x40')][_0x345d('0x4c')]({'where':{'id':_0x51084e[_0x345d('0x4b')]['id']},'attributes':['id',_0x345d('0x64'),_0x345d('0x65'),_0x345d('0x5f'),'clientSecret',_0x345d('0x66'),_0x345d('0x67'),'refreshToken']})[_0x345d('0x27')](handleEntityNotFound(_0x20b7bb,null))[_0x345d('0x27')](function(_0x395a4c){_0x520bfe=_0x395a4c;_0x564a7c=_0x520bfe[_0x345d('0x64')];_0x317b1c=_0x564a7c===_0x345d('0x68')?'eu':_0x345d('0x69');_0x1738ff=_0x520bfe[_0x345d('0x66')];var _0x967040=_0x1738ff[_0x345d('0x6a')](-0x1);if(_0x967040==='/'||_0x967040==='\x5c'||_0x967040===':'){_0x1738ff=_0x1738ff[_0x345d('0x6b')](0x0,_0x1738ff[_0x345d('0x6c')](_0x967040));}if(!_0x520bfe['refreshToken']){throw new Error(_0x345d('0x6d'));}return getAccessToken(_0x520bfe);})[_0x345d('0x27')](function(_0x25b14b){if(_0x25b14b){return rp({'method':'GET','uri':util[_0x345d('0x6e')](_0x345d('0x6f'),_0x317b1c),'qs':{'module':'Calls'},'headers':{'Authorization':_0x345d('0x70')+_0x25b14b},'json':!![]});}})[_0x345d('0x27')](function(_0x42273b){if(_0x42273b){if(_0x42273b[_0x345d('0x71')]&&_0x42273b[_0x345d('0x71')][_0x345d('0x29')]){throw new Error(_0x42273b['response'][_0x345d('0x29')]['message']);}var _0x183ebf=[];var _0x1eaf2f=[];var _0x41a592=[_0x345d('0x72'),_0x345d('0x73'),_0x345d('0x74'),'WhoId',_0x345d('0x75'),'Call_Result','Call_Start_Time',_0x345d('0x76')];_0x1eaf2f=_[_0x345d('0x77')](_0x42273b[_0x345d('0x35')],function(_0x418658){return _0x41a592[_0x345d('0x78')](_0x418658[_0x345d('0x79')]);});for(var _0x1f187e=0x0;_0x1f187e<_0x1eaf2f[_0x345d('0x47')];_0x1f187e++){if(_0x1eaf2f[_0x1f187e][_0x345d('0x7a')]===![]){_0x183ebf[_0x345d('0x7b')]({'id':_0x1eaf2f[_0x1f187e]['id'],'name':_0x1eaf2f[_0x1f187e]['display_label'],'custom':_0x1eaf2f[_0x1f187e]['custom_field'],'options':_0x1eaf2f[_0x1f187e][_0x345d('0x7c')]===_0x345d('0x7d')&&_0x1eaf2f[_0x1f187e]['pick_list_values'][_0x345d('0x47')]>-0x1?_[_0x345d('0x2d')](_0x1eaf2f[_0x1f187e]['pick_list_values'],function(_0x5e2ead){return{'name':_0x5e2ead,'value':_0x5e2ead};}):[]});}}return{'count':_0x183ebf[_0x345d('0x47')],'rows':_0x183ebf};}else{return{'count':0x0,'rows':[]};}})[_0x345d('0x27')](respondWithResult(_0x20b7bb,null))[_0x345d('0x44')](function(_0x4a50f0){var _0x401cfb=_0x51084e[_0x345d('0x32')]['test']?0x1f4:_0x4a50f0['statusCode']||0x1f4;logger[_0x345d('0x29')](_0x345d('0x7e'),_0x345d('0x7f'),_0x401cfb,JSON[_0x345d('0x80')](_0x4a50f0));delete _0x4a50f0['name'];if(_0x401cfb===0x191){_0x401cfb=0x190;}_0x20b7bb[_0x345d('0x1b')](_0x401cfb)[_0x345d('0x2c')](_0x51084e[_0x345d('0x32')][_0x345d('0x81')]?{'message':'Wrong\x20credentials','statusCode':_0x4a50f0[_0x345d('0x82')]}:_0x4a50f0);});}; \ No newline at end of file +var _0xb060=['pick','filter','merge','ZohoAccount','includeAll','findAll','rows','catch','show','params','keys','options','find','create','body','getConfigurations','findOne','ZohoConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','/oauth/v2/token','clientId','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','clientSecret','serverUrl','code','refreshToken','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','Calls','Zoho-oauthtoken\x20','response','message','Owner','Description','WhoId','Call_Duration','Call_Result','Call_Type','remove','api_name','system_mandatory','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where'];(function(_0x596669,_0x3f3def){var _0x5e7cc6=function(_0x4e005a){while(--_0x4e005a){_0x596669['push'](_0x596669['shift']());}};_0x5e7cc6(++_0x3f3def);}(_0xb060,0xca));var _0x0b06=function(_0x504b29,_0x45ac3d){_0x504b29=_0x504b29-0x0;var _0x19d838=_0xb060[_0x504b29];return _0x19d838;};'use strict';var emlformat=require(_0x0b06('0x0'));var rimraf=require(_0x0b06('0x1'));var zipdir=require(_0x0b06('0x2'));var jsonpatch=require(_0x0b06('0x3'));var rp=require(_0x0b06('0x4'));var moment=require(_0x0b06('0x5'));var BPromise=require(_0x0b06('0x6'));var Mustache=require(_0x0b06('0x7'));var util=require(_0x0b06('0x8'));var path=require(_0x0b06('0x9'));var sox=require(_0x0b06('0xa'));var csv=require(_0x0b06('0xb'));var ejs=require(_0x0b06('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0b06('0xd'));var squel=require(_0x0b06('0xe'));var crypto=require(_0x0b06('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x0b06('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0b06('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0b06('0x12'));var qs=require(_0x0b06('0x13'));var as=require(_0x0b06('0x14'));var hardwareService=require(_0x0b06('0x15'));var logger=require(_0x0b06('0x16'))('api');var utils=require(_0x0b06('0x17'));var config=require(_0x0b06('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x0b06('0x19'));function respondWithStatusCode(_0x59775a,_0x269d2b){_0x269d2b=_0x269d2b||0xcc;return function(_0x2ce6d6){if(_0x2ce6d6){return _0x59775a['sendStatus'](_0x269d2b);}return _0x59775a[_0x0b06('0x1a')](_0x269d2b)[_0x0b06('0x1b')]();};}function respondWithResult(_0x2c9bd7,_0x4b1da2){_0x4b1da2=_0x4b1da2||0xc8;return function(_0x18e41d){if(_0x18e41d){return _0x2c9bd7[_0x0b06('0x1a')](_0x4b1da2)['json'](_0x18e41d);}};}function respondWithFilteredResult(_0x3c84d6,_0xf698c4){return function(_0x209ce1){if(_0x209ce1){var _0x5efd59=typeof _0xf698c4[_0x0b06('0x1c')]===_0x0b06('0x1d')&&typeof _0xf698c4[_0x0b06('0x1e')]==='undefined';var _0x2f1c29=_0x209ce1[_0x0b06('0x1f')];var _0x4327a4=_0x5efd59?0x0:_0xf698c4[_0x0b06('0x1c')];var _0xe47f67=_0x5efd59?_0x209ce1[_0x0b06('0x1f')]:_0xf698c4[_0x0b06('0x1c')]+_0xf698c4['limit'];var _0x745f8b;if(_0xe47f67>=_0x2f1c29){_0xe47f67=_0x2f1c29;_0x745f8b=0xc8;}else{_0x745f8b=0xce;}_0x3c84d6[_0x0b06('0x1a')](_0x745f8b);return _0x3c84d6[_0x0b06('0x20')](_0x0b06('0x21'),_0x4327a4+'-'+_0xe47f67+'/'+_0x2f1c29)['json'](_0x209ce1);}return null;};}function patchUpdates(_0xdb408a){return function(_0xcc2326){try{jsonpatch[_0x0b06('0x22')](_0xcc2326,_0xdb408a,!![]);}catch(_0x3a3ff2){return BPromise[_0x0b06('0x23')](_0x3a3ff2);}return _0xcc2326[_0x0b06('0x24')]();};}function saveUpdates(_0xd0c2ce,_0x359c15){return function(_0x3d9db8){if(_0x3d9db8){return _0x3d9db8[_0x0b06('0x25')](_0xd0c2ce)[_0x0b06('0x26')](function(_0x21424a){return _0x21424a;});}return null;};}function removeEntity(_0x25b1ad,_0x413133){return function(_0x1df942){if(_0x1df942){return _0x1df942[_0x0b06('0x27')]()[_0x0b06('0x26')](function(){_0x25b1ad['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ee50c,_0x11761d){return function(_0x4a96f8){if(!_0x4a96f8){_0x1ee50c[_0x0b06('0x28')](0x194);}return _0x4a96f8;};}function handleError(_0x129c3b,_0x31cd4c){_0x31cd4c=_0x31cd4c||0x1f4;return function(_0x59fbbb){logger[_0x0b06('0x29')](_0x59fbbb['stack']);if(_0x59fbbb[_0x0b06('0x2a')]){delete _0x59fbbb[_0x0b06('0x2a')];}_0x129c3b[_0x0b06('0x1a')](_0x31cd4c)[_0x0b06('0x2b')](_0x59fbbb);};}exports[_0x0b06('0x2c')]=function(_0x468e11,_0x2822ba){var _0x36d996={},_0x4b907c={},_0x3cf9f2={'count':0x0,'rows':[]};var _0x139f38=_[_0x0b06('0x2d')](db['ZohoAccount'][_0x0b06('0x2e')],function(_0x46dd5f){return{'name':_0x46dd5f[_0x0b06('0x2f')],'type':_0x46dd5f[_0x0b06('0x30')]['key']};});_0x4b907c[_0x0b06('0x31')]=_[_0x0b06('0x2d')](_0x139f38,_0x0b06('0x2a'));_0x4b907c[_0x0b06('0x32')]=_['keys'](_0x468e11[_0x0b06('0x32')]);_0x4b907c[_0x0b06('0x33')]=_[_0x0b06('0x34')](_0x4b907c[_0x0b06('0x31')],_0x4b907c[_0x0b06('0x32')]);_0x36d996[_0x0b06('0x35')]=_[_0x0b06('0x34')](_0x4b907c['model'],qs[_0x0b06('0x36')](_0x468e11[_0x0b06('0x32')][_0x0b06('0x36')]));_0x36d996[_0x0b06('0x35')]=_0x36d996[_0x0b06('0x35')][_0x0b06('0x37')]?_0x36d996[_0x0b06('0x35')]:_0x4b907c[_0x0b06('0x31')];if(!_0x468e11[_0x0b06('0x32')]['hasOwnProperty'](_0x0b06('0x38'))){_0x36d996['limit']=qs[_0x0b06('0x1e')](_0x468e11[_0x0b06('0x32')][_0x0b06('0x1e')]);_0x36d996[_0x0b06('0x1c')]=qs['offset'](_0x468e11[_0x0b06('0x32')][_0x0b06('0x1c')]);}_0x36d996[_0x0b06('0x39')]=qs['sort'](_0x468e11[_0x0b06('0x32')][_0x0b06('0x3a')]);_0x36d996[_0x0b06('0x3b')]=qs[_0x0b06('0x33')](_[_0x0b06('0x3c')](_0x468e11[_0x0b06('0x32')],_0x4b907c[_0x0b06('0x33')]),_0x139f38);if(_0x468e11[_0x0b06('0x32')][_0x0b06('0x3d')]){_0x36d996['where']=_[_0x0b06('0x3e')](_0x36d996[_0x0b06('0x3b')],{'$or':_[_0x0b06('0x2d')](_0x139f38,function(_0x2134d3){if(_0x2134d3[_0x0b06('0x30')]!=='VIRTUAL'){var _0x38c190={};_0x38c190[_0x2134d3[_0x0b06('0x2a')]]={'$like':'%'+_0x468e11[_0x0b06('0x32')][_0x0b06('0x3d')]+'%'};return _0x38c190;}})});}_0x36d996=_['merge']({},_0x36d996,_0x468e11['options']);var _0x473abc={'where':_0x36d996['where']};return db[_0x0b06('0x3f')][_0x0b06('0x1f')](_0x473abc)[_0x0b06('0x26')](function(_0x25b4e6){_0x3cf9f2[_0x0b06('0x1f')]=_0x25b4e6;if(_0x468e11[_0x0b06('0x32')][_0x0b06('0x40')]){_0x36d996['include']=[{'all':!![]}];}return db[_0x0b06('0x3f')][_0x0b06('0x41')](_0x36d996);})['then'](function(_0x45b655){_0x3cf9f2[_0x0b06('0x42')]=_0x45b655;return _0x3cf9f2;})[_0x0b06('0x26')](respondWithFilteredResult(_0x2822ba,_0x36d996))[_0x0b06('0x43')](handleError(_0x2822ba,null));};exports[_0x0b06('0x44')]=function(_0x3bda86,_0x5daf45){var _0x1c310a={'raw':![],'where':{'id':_0x3bda86[_0x0b06('0x45')]['id']}},_0x40f088={};_0x40f088[_0x0b06('0x31')]=_[_0x0b06('0x46')](db[_0x0b06('0x3f')][_0x0b06('0x2e')]);_0x40f088['query']=_[_0x0b06('0x46')](_0x3bda86[_0x0b06('0x32')]);_0x40f088[_0x0b06('0x33')]=_['intersection'](_0x40f088[_0x0b06('0x31')],_0x40f088['query']);_0x1c310a[_0x0b06('0x35')]=_[_0x0b06('0x34')](_0x40f088[_0x0b06('0x31')],qs[_0x0b06('0x36')](_0x3bda86[_0x0b06('0x32')][_0x0b06('0x36')]));_0x1c310a[_0x0b06('0x35')]=_0x1c310a[_0x0b06('0x35')][_0x0b06('0x37')]?_0x1c310a[_0x0b06('0x35')]:_0x40f088[_0x0b06('0x31')];if(_0x3bda86[_0x0b06('0x32')][_0x0b06('0x40')]){_0x1c310a['include']=[{'all':!![]}];}_0x1c310a=_[_0x0b06('0x3e')]({},_0x1c310a,_0x3bda86[_0x0b06('0x47')]);return db[_0x0b06('0x3f')][_0x0b06('0x48')](_0x1c310a)[_0x0b06('0x26')](handleEntityNotFound(_0x5daf45,null))[_0x0b06('0x26')](respondWithResult(_0x5daf45,null))[_0x0b06('0x43')](handleError(_0x5daf45,null));};exports[_0x0b06('0x49')]=function(_0xd63168,_0x5101fd){return db[_0x0b06('0x3f')][_0x0b06('0x49')](_0xd63168['body'],{})['then'](respondWithResult(_0x5101fd,0xc9))[_0x0b06('0x43')](handleError(_0x5101fd,null));};exports[_0x0b06('0x25')]=function(_0x486254,_0x5d5006){if(_0x486254['body']['id']){delete _0x486254[_0x0b06('0x4a')]['id'];}return db['ZohoAccount'][_0x0b06('0x48')]({'where':{'id':_0x486254[_0x0b06('0x45')]['id']}})[_0x0b06('0x26')](handleEntityNotFound(_0x5d5006,null))[_0x0b06('0x26')](saveUpdates(_0x486254[_0x0b06('0x4a')],null))[_0x0b06('0x26')](respondWithResult(_0x5d5006,null))[_0x0b06('0x43')](handleError(_0x5d5006,null));};exports[_0x0b06('0x27')]=function(_0x26e0dc,_0x3b8f29){return db[_0x0b06('0x3f')][_0x0b06('0x48')]({'where':{'id':_0x26e0dc[_0x0b06('0x45')]['id']}})[_0x0b06('0x26')](handleEntityNotFound(_0x3b8f29,null))[_0x0b06('0x26')](removeEntity(_0x3b8f29,null))['catch'](handleError(_0x3b8f29,null));};exports[_0x0b06('0x4b')]=function(_0x59dce1,_0x3d7aff,_0x1e9884){var _0x4f326a={};var _0x518771={};var _0x93d62d;var _0x3cf851;return db[_0x0b06('0x3f')][_0x0b06('0x4c')]({'where':{'id':_0x59dce1[_0x0b06('0x45')]['id']}})['then'](handleEntityNotFound(_0x3d7aff,null))[_0x0b06('0x26')](function(_0x5e2b86){if(_0x5e2b86){_0x93d62d=_0x5e2b86;_0x518771[_0x0b06('0x31')]=_['keys'](db[_0x0b06('0x4d')]['rawAttributes']);_0x518771[_0x0b06('0x32')]=_[_0x0b06('0x46')](_0x59dce1[_0x0b06('0x32')]);_0x518771['filters']=_[_0x0b06('0x34')](_0x518771[_0x0b06('0x31')],_0x518771[_0x0b06('0x32')]);_0x4f326a['attributes']=_[_0x0b06('0x34')](_0x518771[_0x0b06('0x31')],qs[_0x0b06('0x36')](_0x59dce1[_0x0b06('0x32')][_0x0b06('0x36')]));_0x4f326a[_0x0b06('0x35')]=_0x4f326a[_0x0b06('0x35')][_0x0b06('0x37')]?_0x4f326a[_0x0b06('0x35')]:_0x518771[_0x0b06('0x31')];_0x4f326a[_0x0b06('0x39')]=qs[_0x0b06('0x3a')](_0x59dce1[_0x0b06('0x32')]['sort']);_0x4f326a[_0x0b06('0x3b')]=qs[_0x0b06('0x33')](_['pick'](_0x59dce1[_0x0b06('0x32')],_0x518771[_0x0b06('0x33')]));if(_0x59dce1['query'][_0x0b06('0x3d')]){_0x4f326a[_0x0b06('0x3b')]=_[_0x0b06('0x3e')](_0x4f326a[_0x0b06('0x3b')],{'$or':_[_0x0b06('0x2d')](_0x4f326a[_0x0b06('0x35')],function(_0x526874){var _0x3dc13={};_0x3dc13[_0x526874]={'$like':'%'+_0x59dce1[_0x0b06('0x32')][_0x0b06('0x3d')]+'%'};return _0x3dc13;})});}_0x4f326a=_['merge']({},_0x4f326a,_0x59dce1[_0x0b06('0x47')]);return _0x93d62d[_0x0b06('0x4b')](_0x4f326a);}})[_0x0b06('0x26')](function(_0x5d15fb){if(_0x5d15fb){_0x3cf851=_0x5d15fb[_0x0b06('0x37')];if(!_0x59dce1[_0x0b06('0x32')][_0x0b06('0x4e')]('nolimit')){_0x4f326a[_0x0b06('0x1e')]=qs[_0x0b06('0x1e')](_0x59dce1[_0x0b06('0x32')][_0x0b06('0x1e')]);_0x4f326a[_0x0b06('0x1c')]=qs[_0x0b06('0x1c')](_0x59dce1[_0x0b06('0x32')]['offset']);}return _0x93d62d['getConfigurations'](_0x4f326a);}})[_0x0b06('0x26')](function(_0x21ccc3){if(_0x21ccc3){return _0x21ccc3?{'count':_0x3cf851,'rows':_0x21ccc3}:null;}})[_0x0b06('0x26')](respondWithResult(_0x3d7aff,null))[_0x0b06('0x43')](handleError(_0x3d7aff,null));};exports[_0x0b06('0x4f')]=function(_0x488b4d,_0x1a94b0,_0x4010fa){if(_0x488b4d[_0x0b06('0x4a')]['id']){delete _0x488b4d[_0x0b06('0x4a')]['id'];}return db[_0x0b06('0x3f')][_0x0b06('0x4c')]({'where':{'id':_0x488b4d['params']['id']}})['then'](handleEntityNotFound(_0x1a94b0,null))[_0x0b06('0x26')](function(_0x471f57){if(_0x471f57){_0x488b4d[_0x0b06('0x4a')][_0x0b06('0x50')]=_0x471f57['id'];_0x488b4d[_0x0b06('0x4a')][_0x0b06('0x51')]=integrations[_0x0b06('0x52')](_0x488b4d['body'][_0x0b06('0x53')],_0x488b4d['body']['type']);_0x488b4d[_0x0b06('0x4a')][_0x0b06('0x54')]=integrations[_0x0b06('0x55')](_0x488b4d['body'][_0x0b06('0x53')],_0x488b4d[_0x0b06('0x4a')][_0x0b06('0x30')]);return db[_0x0b06('0x4d')]['create'](_0x488b4d[_0x0b06('0x4a')],{'include':[{'model':db[_0x0b06('0x56')],'as':_0x0b06('0x51')},{'model':db[_0x0b06('0x56')],'as':'Descriptions'}]});}return null;})[_0x0b06('0x26')](respondWithResult(_0x1a94b0,null))[_0x0b06('0x43')](handleError(_0x1a94b0,null));};function getAccessToken(_0x511211){return new Promise(function(_0x2713bd,_0x581cb1){var _0x1f49b2;switch(_0x511211[_0x0b06('0x57')]){case'US':_0x1f49b2=_0x0b06('0x58');break;case'AU':_0x1f49b2=_0x0b06('0x59');break;case'EU':_0x1f49b2=_0x0b06('0x5a');break;case'IN':_0x1f49b2='https://accounts.zoho.in';break;case'CN':_0x1f49b2=_0x0b06('0x5b');break;default:_0x1f49b2=_0x0b06('0x5a');break;}var _0x1fcf32={'method':'POST','uri':_0x1f49b2+_0x0b06('0x5c'),'qs':{'refresh_token':_0x511211['refreshToken'],'client_id':_0x511211[_0x0b06('0x5d')],'client_secret':_0x511211['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x1fcf32)[_0x0b06('0x26')](function(_0x58d497){if(_0x58d497[_0x0b06('0x5e')]){_0x2713bd(_0x58d497[_0x0b06('0x5e')]);}else{_0x581cb1(_0x0b06('0x5f'));}})[_0x0b06('0x43')](function(_0x53c502){_0x581cb1(_0x53c502);});});}exports['getFields']=function(_0x79f6cb,_0x242f6b,_0x4b3572){var _0xb854a8,_0x4ebfc3,_0x4f83ad,_0x374b0f,_0xf7e564;return db[_0x0b06('0x3f')][_0x0b06('0x4c')]({'where':{'id':_0x79f6cb[_0x0b06('0x45')]['id']},'attributes':['id',_0x0b06('0x60'),_0x0b06('0x57'),_0x0b06('0x5d'),_0x0b06('0x61'),_0x0b06('0x62'),_0x0b06('0x63'),_0x0b06('0x64')]})[_0x0b06('0x26')](handleEntityNotFound(_0x242f6b,null))[_0x0b06('0x26')](function(_0x175db3){_0xf7e564=_0x175db3;_0xb854a8=_0xf7e564['host'];_0x4ebfc3=_0xb854a8===_0x0b06('0x65')?'eu':_0x0b06('0x66');_0x4f83ad=_0xf7e564['serverUrl'];var _0x2cc7c6=_0x4f83ad[_0x0b06('0x67')](-0x1);if(_0x2cc7c6==='/'||_0x2cc7c6==='\x5c'||_0x2cc7c6===':'){_0x4f83ad=_0x4f83ad[_0x0b06('0x68')](0x0,_0x4f83ad[_0x0b06('0x69')](_0x2cc7c6));}if(!_0xf7e564[_0x0b06('0x64')]){throw new Error(_0x0b06('0x6a'));}return getAccessToken(_0xf7e564);})[_0x0b06('0x26')](function(_0x581228){if(_0x581228){return rp({'method':'GET','uri':util[_0x0b06('0x6b')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x4ebfc3),'qs':{'module':_0x0b06('0x6c')},'headers':{'Authorization':_0x0b06('0x6d')+_0x581228},'json':!![]});}})['then'](function(_0x3b01ed){if(_0x3b01ed){if(_0x3b01ed[_0x0b06('0x6e')]&&_0x3b01ed[_0x0b06('0x6e')][_0x0b06('0x29')]){throw new Error(_0x3b01ed[_0x0b06('0x6e')][_0x0b06('0x29')][_0x0b06('0x6f')]);}var _0xa3255a=[];var _0x1f66af=[];var _0x1ca96c=[_0x0b06('0x70'),'Subject',_0x0b06('0x71'),_0x0b06('0x72'),_0x0b06('0x73'),_0x0b06('0x74'),'Call_Start_Time',_0x0b06('0x75')];_0x1f66af=_[_0x0b06('0x76')](_0x3b01ed[_0x0b06('0x36')],function(_0x4caa9e){return _0x1ca96c['includes'](_0x4caa9e[_0x0b06('0x77')]);});for(var _0x559055=0x0;_0x559055<_0x1f66af['length'];_0x559055++){if(_0x1f66af[_0x559055][_0x0b06('0x78')]===![]){_0xa3255a['push']({'id':_0x1f66af[_0x559055]['id'],'name':_0x1f66af[_0x559055][_0x0b06('0x79')],'custom':_0x1f66af[_0x559055][_0x0b06('0x7a')],'options':_0x1f66af[_0x559055][_0x0b06('0x7b')]===_0x0b06('0x7c')&&_0x1f66af[_0x559055][_0x0b06('0x7d')]['length']>-0x1?_[_0x0b06('0x2d')](_0x1f66af[_0x559055][_0x0b06('0x7d')],function(_0x2d59f3){return{'name':_0x2d59f3,'value':_0x2d59f3};}):[]});}}return{'count':_0xa3255a['length'],'rows':_0xa3255a};}else{return{'count':0x0,'rows':[]};}})[_0x0b06('0x26')](respondWithResult(_0x242f6b,null))['catch'](function(_0x5b6d6d){var _0x2714bc=_0x79f6cb[_0x0b06('0x32')][_0x0b06('0x7e')]?0x1f4:_0x5b6d6d[_0x0b06('0x7f')]||0x1f4;logger[_0x0b06('0x29')](_0x0b06('0x80'),'getFields',_0x2714bc,JSON[_0x0b06('0x81')](_0x5b6d6d));delete _0x5b6d6d['name'];if(_0x2714bc===0x191){_0x2714bc=0x190;}_0x242f6b[_0x0b06('0x1a')](_0x2714bc)[_0x0b06('0x2b')](_0x79f6cb['query'][_0x0b06('0x7e')]?{'message':_0x0b06('0x82'),'statusCode':_0x5b6d6d['statusCode']}:_0x5b6d6d);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index d1b8526..14eedc3 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 _0x9345=['then','parse','refresh_token','refreshToken','info','format','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','name','zone','clientId','code','https://accounts.zoho.com','https://accounts.zoho.com.au','POST','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientSecret','slice','substring','lastIndexOf','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded'];(function(_0x44d928,_0xf3a195){var _0x526e3d=function(_0x1b6ec4){while(--_0x1b6ec4){_0x44d928['push'](_0x44d928['shift']());}};_0x526e3d(++_0xf3a195);}(_0x9345,0x90));var _0x5934=function(_0x1faaa1,_0x1568dd){_0x1faaa1=_0x1faaa1-0x0;var _0x994ec=_0x9345[_0x1faaa1];return _0x994ec;};'use strict';var _=require(_0x5934('0x0'));var util=require(_0x5934('0x1'));var logger=require(_0x5934('0x2'))(_0x5934('0x3'));var moment=require(_0x5934('0x4'));var BPromise=require(_0x5934('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5934('0x6'));var rimraf=require(_0x5934('0x7'));var config=require(_0x5934('0x8'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x5934('0x9'));module['exports']=function(_0xa980c4,_0x373350){return _0xa980c4[_0x5934('0xa')](_0x5934('0xb'),attributes,{'tableName':_0x5934('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2299c2,_0x3bee21,_0x40840c){if(_0x2299c2[_0x5934('0xd')]('zone')||_0x2299c2[_0x5934('0xd')](_0x5934('0xe'))||_0x2299c2[_0x5934('0xd')]('clientId')||_0x2299c2[_0x5934('0xd')](_0x5934('0xf'))||_0x2299c2[_0x5934('0xd')]('code')||_0x2299c2['changed']('host')){var _0x407238,_0x4e4323;_0x407238=_0x2299c2[_0x5934('0xe')];var _0x47a2ff=_0x407238[_0x5934('0x10')](-0x1);if(_0x47a2ff==='/'||_0x47a2ff==='\x5c'||_0x47a2ff===':'){_0x407238=_0x407238[_0x5934('0x11')](0x0,_0x407238[_0x5934('0x12')](_0x47a2ff));}switch(_0x2299c2['zone']){case'US':_0x4e4323='https://accounts.zoho.com';break;case'AU':_0x4e4323='https://accounts.zoho.com.au';break;case'IN':_0x4e4323=_0x5934('0x13');break;case'CN':_0x4e4323=_0x5934('0x14');break;default:_0x4e4323='https://accounts.zoho.eu';break;}var _0x2b9c15={'method':'POST','uri':_0x4e4323+_0x5934('0x15'),'form':{'grant_type':_0x5934('0x16'),'client_id':_0x2299c2['clientId'],'client_secret':_0x2299c2[_0x5934('0xf')],'redirect_uri':_0x2299c2[_0x5934('0xe')],'code':_0x2299c2['code']},'headers':{'Content-Type':_0x5934('0x17')}};return rp(_0x2b9c15)[_0x5934('0x18')](function(_0x3c7ab7){var _0xe25624=JSON[_0x5934('0x19')](_0x3c7ab7);if(_0xe25624[_0x5934('0x1a')]){_0x2299c2[_0x5934('0x1b')]=_0xe25624[_0x5934('0x1a')];logger[_0x5934('0x1c')](util[_0x5934('0x1d')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2299c2['name'],_0x2299c2['id']));}else{logger[_0x5934('0x1e')](util[_0x5934('0x1d')](_0x5934('0x1f'),_0x2299c2['name'],_0x2299c2['id']),util[_0x5934('0x20')](_0xe25624,{'showHidden':![],'depth':null}));}return _0x40840c(null,_0x3bee21);})[_0x5934('0x21')](function(_0x38add2){logger[_0x5934('0x1e')](util[_0x5934('0x1d')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2299c2[_0x5934('0x22')],_0x2299c2['id']),util[_0x5934('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x40840c(_0x38add2);});}else{return _0x40840c(null,_0x3bee21);}},'beforeUpdate':function(_0x503012,_0x4b23dd,_0x1263f4){if(_0x503012[_0x5934('0xd')](_0x5934('0x23'))||_0x503012[_0x5934('0xd')]('serverUrl')||_0x503012['changed'](_0x5934('0x24'))||_0x503012[_0x5934('0xd')](_0x5934('0xf'))||_0x503012[_0x5934('0xd')](_0x5934('0x25'))||_0x503012[_0x5934('0xd')]('host')){var _0x49b4c1,_0x424590;_0x49b4c1=_0x503012[_0x5934('0xe')];var _0x1543de=_0x49b4c1['slice'](-0x1);if(_0x1543de==='/'||_0x1543de==='\x5c'||_0x1543de===':'){_0x49b4c1=_0x49b4c1['substring'](0x0,_0x49b4c1[_0x5934('0x12')](_0x1543de));}switch(_0x503012[_0x5934('0x23')]){case'US':_0x424590=_0x5934('0x26');break;case'AU':_0x424590=_0x5934('0x27');break;case'IN':_0x424590='https://accounts.zoho.in';break;case'CN':_0x424590=_0x5934('0x14');break;default:_0x424590='https://accounts.zoho.eu';break;}var _0x48ddad={'method':_0x5934('0x28'),'uri':_0x424590+'/oauth/v2/token','form':{'grant_type':_0x5934('0x16'),'client_id':_0x503012[_0x5934('0x24')],'client_secret':_0x503012['clientSecret'],'redirect_uri':_0x503012[_0x5934('0xe')],'code':_0x503012[_0x5934('0x25')]},'headers':{'Content-Type':_0x5934('0x17')}};return rp(_0x48ddad)[_0x5934('0x18')](function(_0xaa190e){var _0x544ccd=JSON[_0x5934('0x19')](_0xaa190e);if(_0x544ccd[_0x5934('0x1a')]){_0x503012[_0x5934('0x1b')]=_0x544ccd[_0x5934('0x1a')];logger[_0x5934('0x1c')](util[_0x5934('0x1d')](_0x5934('0x29'),_0x503012[_0x5934('0x22')],_0x503012['id']));}else{logger['error'](util[_0x5934('0x1d')](_0x5934('0x1f'),_0x503012[_0x5934('0x22')],_0x503012['id']),util[_0x5934('0x20')](_0x544ccd,{'showHidden':![],'depth':null}));}return _0x1263f4(null,_0x4b23dd);})['catch'](function(_0x22885a){logger[_0x5934('0x1e')](util[_0x5934('0x1d')](_0x5934('0x1f'),_0x503012[_0x5934('0x22')],_0x503012['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1263f4(_0x22885a);});}else{return _0x1263f4(null,_0x4b23dd);}}}});}; \ No newline at end of file +var _0x5618=['error','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','ZohoAccount','changed','zone','serverUrl','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5618,0x1ae));var _0x8561=function(_0x34804e,_0x44b678){_0x34804e=_0x34804e-0x0;var _0x3ba8a3=_0x5618[_0x34804e];return _0x3ba8a3;};'use strict';var _=require('lodash');var util=require(_0x8561('0x0'));var logger=require(_0x8561('0x1'))(_0x8561('0x2'));var moment=require(_0x8561('0x3'));var BPromise=require(_0x8561('0x4'));var rp=require(_0x8561('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8561('0x6'));var config=require(_0x8561('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x8561('0x8'));module[_0x8561('0x9')]=function(_0x4dd8d1,_0x206ed6){return _0x4dd8d1['define'](_0x8561('0xa'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xca8b26,_0xdb5379,_0x3a1c46){if(_0xca8b26[_0x8561('0xb')](_0x8561('0xc'))||_0xca8b26[_0x8561('0xb')](_0x8561('0xd'))||_0xca8b26[_0x8561('0xb')]('clientId')||_0xca8b26['changed'](_0x8561('0xe'))||_0xca8b26[_0x8561('0xb')](_0x8561('0xf'))||_0xca8b26[_0x8561('0xb')](_0x8561('0x10'))){var _0xcc7b16,_0x3523ba;_0xcc7b16=_0xca8b26[_0x8561('0xd')];var _0x30d602=_0xcc7b16[_0x8561('0x11')](-0x1);if(_0x30d602==='/'||_0x30d602==='\x5c'||_0x30d602===':'){_0xcc7b16=_0xcc7b16[_0x8561('0x12')](0x0,_0xcc7b16[_0x8561('0x13')](_0x30d602));}switch(_0xca8b26[_0x8561('0xc')]){case'US':_0x3523ba=_0x8561('0x14');break;case'AU':_0x3523ba='https://accounts.zoho.com.au';break;case'IN':_0x3523ba=_0x8561('0x15');break;case'CN':_0x3523ba=_0x8561('0x16');break;default:_0x3523ba='https://accounts.zoho.eu';break;}var _0x337d67={'method':_0x8561('0x17'),'uri':_0x3523ba+_0x8561('0x18'),'form':{'grant_type':'authorization_code','client_id':_0xca8b26[_0x8561('0x19')],'client_secret':_0xca8b26['clientSecret'],'redirect_uri':_0xca8b26[_0x8561('0xd')],'code':_0xca8b26[_0x8561('0xf')]},'headers':{'Content-Type':_0x8561('0x1a')}};return rp(_0x337d67)[_0x8561('0x1b')](function(_0x36e9c8){var _0x200870=JSON[_0x8561('0x1c')](_0x36e9c8);if(_0x200870[_0x8561('0x1d')]){_0xca8b26[_0x8561('0x1e')]=_0x200870['refresh_token'];logger[_0x8561('0x1f')](util[_0x8561('0x20')](_0x8561('0x21'),_0xca8b26[_0x8561('0x22')],_0xca8b26['id']));}else{logger['error'](util[_0x8561('0x20')](_0x8561('0x23'),_0xca8b26['name'],_0xca8b26['id']),util[_0x8561('0x24')](_0x200870,{'showHidden':![],'depth':null}));}return _0x3a1c46(null,_0xdb5379);})[_0x8561('0x25')](function(_0x3836dc){logger['error'](util['format'](_0x8561('0x23'),_0xca8b26['name'],_0xca8b26['id']),util[_0x8561('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x3a1c46(_0x3836dc);});}else{return _0x3a1c46(null,_0xdb5379);}},'beforeUpdate':function(_0x2cad70,_0x3aa0eb,_0x3ce896){if(_0x2cad70[_0x8561('0xb')]('zone')||_0x2cad70[_0x8561('0xb')](_0x8561('0xd'))||_0x2cad70[_0x8561('0xb')](_0x8561('0x19'))||_0x2cad70[_0x8561('0xb')](_0x8561('0xe'))||_0x2cad70[_0x8561('0xb')](_0x8561('0xf'))||_0x2cad70[_0x8561('0xb')]('host')){var _0x1443f4,_0x17733f;_0x1443f4=_0x2cad70[_0x8561('0xd')];var _0x1aa791=_0x1443f4[_0x8561('0x11')](-0x1);if(_0x1aa791==='/'||_0x1aa791==='\x5c'||_0x1aa791===':'){_0x1443f4=_0x1443f4[_0x8561('0x12')](0x0,_0x1443f4[_0x8561('0x13')](_0x1aa791));}switch(_0x2cad70[_0x8561('0xc')]){case'US':_0x17733f=_0x8561('0x14');break;case'AU':_0x17733f='https://accounts.zoho.com.au';break;case'IN':_0x17733f=_0x8561('0x15');break;case'CN':_0x17733f=_0x8561('0x16');break;default:_0x17733f='https://accounts.zoho.eu';break;}var _0x48c840={'method':'POST','uri':_0x17733f+_0x8561('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x2cad70[_0x8561('0x19')],'client_secret':_0x2cad70[_0x8561('0xe')],'redirect_uri':_0x2cad70[_0x8561('0xd')],'code':_0x2cad70[_0x8561('0xf')]},'headers':{'Content-Type':_0x8561('0x1a')}};return rp(_0x48c840)[_0x8561('0x1b')](function(_0x3bf4f0){var _0x1ed359=JSON[_0x8561('0x1c')](_0x3bf4f0);if(_0x1ed359[_0x8561('0x1d')]){_0x2cad70[_0x8561('0x1e')]=_0x1ed359[_0x8561('0x1d')];logger['info'](util[_0x8561('0x20')](_0x8561('0x21'),_0x2cad70[_0x8561('0x22')],_0x2cad70['id']));}else{logger[_0x8561('0x26')](util[_0x8561('0x20')](_0x8561('0x23'),_0x2cad70[_0x8561('0x22')],_0x2cad70['id']),util[_0x8561('0x24')](_0x1ed359,{'showHidden':![],'depth':null}));}return _0x3ce896(null,_0x3aa0eb);})[_0x8561('0x25')](function(_0x26849c){logger[_0x8561('0x26')](util[_0x8561('0x20')](_0x8561('0x23'),_0x2cad70['name'],_0x2cad70['id']),util[_0x8561('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x3ce896(_0x26849c);});}else{return _0x3ce896(null,_0x3aa0eb);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 52b2a34..7de9244 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 _0xa7db=['../../config/environment','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZohoAccount','find','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5a62d3,_0xe1b696){var _0x36d159=function(_0x240c33){while(--_0x240c33){_0x5a62d3['push'](_0x5a62d3['shift']());}};_0x36d159(++_0xe1b696);}(_0xa7db,0xbf));var _0xba7d=function(_0x1d3ece,_0x556172){_0x1d3ece=_0x1d3ece-0x0;var _0x2feba1=_0xa7db[_0x1d3ece];return _0x2feba1;};'use strict';var _=require(_0xba7d('0x0'));var util=require(_0xba7d('0x1'));var moment=require(_0xba7d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba7d('0x3'))['db'];var utils=require(_0xba7d('0x4'));var logger=require(_0xba7d('0x5'))(_0xba7d('0x6'));var config=require(_0xba7d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba7d('0x8')][_0xba7d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c089b,_0x1d891c,_0x4178b7){return new BPromise(function(_0x23a3b3,_0x52b290){return client[_0xba7d('0xa')](_0x3c089b,_0x4178b7)[_0xba7d('0xb')](function(_0x2b4c99){logger[_0xba7d('0xc')](_0xba7d('0xd'),_0x1d891c,'request\x20sent');logger[_0xba7d('0xe')](_0xba7d('0xf'),_0x1d891c,'request\x20sent',JSON[_0xba7d('0x10')](_0x2b4c99));if(_0x2b4c99[_0xba7d('0x11')]){if(_0x2b4c99[_0xba7d('0x11')][_0xba7d('0x12')]===0x1f4){logger['error'](_0xba7d('0xd'),_0x1d891c,_0x2b4c99[_0xba7d('0x11')][_0xba7d('0x13')]);return _0x52b290(_0x2b4c99[_0xba7d('0x11')]['message']);}logger[_0xba7d('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x1d891c,_0x2b4c99[_0xba7d('0x11')][_0xba7d('0x13')]);return _0x23a3b3(_0x2b4c99[_0xba7d('0x11')][_0xba7d('0x13')]);}else{logger['info'](_0xba7d('0xd'),_0x1d891c,'request\x20sent');_0x23a3b3(_0x2b4c99['result'][_0xba7d('0x13')]);}})['catch'](function(_0x428246){logger[_0xba7d('0x11')](_0xba7d('0xd'),_0x1d891c,_0x428246);_0x52b290(_0x428246);});});}exports[_0xba7d('0x14')]=function(_0x4298eb){var _0x198166=this;return new Promise(function(_0xd2ae5c,_0x699ae9){return db[_0xba7d('0x15')][_0xba7d('0x16')]({'raw':_0x4298eb[_0xba7d('0x17')]?_0x4298eb[_0xba7d('0x17')][_0xba7d('0x18')]===undefined?!![]:![]:!![],'where':_0x4298eb[_0xba7d('0x17')]?_0x4298eb[_0xba7d('0x17')][_0xba7d('0x19')]||null:null,'attributes':_0x4298eb['options']?_0x4298eb[_0xba7d('0x17')][_0xba7d('0x1a')]||null:null,'limit':_0x4298eb[_0xba7d('0x17')]?_0x4298eb[_0xba7d('0x17')][_0xba7d('0x1b')]||null:null,'include':_0x4298eb[_0xba7d('0x17')]?_0x4298eb[_0xba7d('0x17')][_0xba7d('0x1c')]?_[_0xba7d('0x1d')](_0x4298eb[_0xba7d('0x17')][_0xba7d('0x1c')],function(_0x395c77){return{'model':db[_0x395c77[_0xba7d('0x1e')]],'as':_0x395c77['as'],'attributes':_0x395c77[_0xba7d('0x1a')],'include':_0x395c77['include']?_[_0xba7d('0x1d')](_0x395c77['include'],function(_0x337c24){return{'model':db[_0x337c24[_0xba7d('0x1e')]],'as':_0x337c24['as'],'attributes':_0x337c24[_0xba7d('0x1a')],'include':_0x337c24[_0xba7d('0x1c')]?_[_0xba7d('0x1d')](_0x337c24[_0xba7d('0x1c')],function(_0x136889){return{'model':db[_0x136889[_0xba7d('0x1e')]],'as':_0x136889['as'],'attributes':_0x136889[_0xba7d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c6681){logger[_0xba7d('0xc')](_0xba7d('0x14'),_0x4298eb);logger[_0xba7d('0xe')](_0xba7d('0x14'),_0x4298eb,JSON[_0xba7d('0x10')](_0x4c6681));_0xd2ae5c(_0x4c6681);})['catch'](function(_0x244233){logger['error'](_0xba7d('0x14'),_0x244233[_0xba7d('0x13')],_0x4298eb);_0x699ae9(_0x198166[_0xba7d('0x11')](0x1f4,_0x244233['message']));});});};exports[_0xba7d('0x1f')]=function(_0x32d090){var _0x3298db=this;return new Promise(function(_0x4958a9,_0x2479b0){return db[_0xba7d('0x15')][_0xba7d('0x20')]({'raw':_0x32d090[_0xba7d('0x17')]?_0x32d090['options']['raw']===undefined?!![]:![]:!![],'where':_0x32d090[_0xba7d('0x17')]?_0x32d090['options']['where']||null:null,'attributes':_0x32d090[_0xba7d('0x17')]?_0x32d090[_0xba7d('0x17')][_0xba7d('0x1a')]||null:null,'include':_0x32d090[_0xba7d('0x17')]?_0x32d090[_0xba7d('0x17')][_0xba7d('0x1c')]?_[_0xba7d('0x1d')](_0x32d090[_0xba7d('0x17')][_0xba7d('0x1c')],function(_0x40f26a){return{'model':db[_0x40f26a[_0xba7d('0x1e')]],'as':_0x40f26a['as'],'attributes':_0x40f26a[_0xba7d('0x1a')],'include':_0x40f26a[_0xba7d('0x1c')]?_[_0xba7d('0x1d')](_0x40f26a[_0xba7d('0x1c')],function(_0x22d462){return{'model':db[_0x22d462[_0xba7d('0x1e')]],'as':_0x22d462['as'],'attributes':_0x22d462[_0xba7d('0x1a')],'include':_0x22d462['include']?_[_0xba7d('0x1d')](_0x22d462[_0xba7d('0x1c')],function(_0x3f8bdf){return{'model':db[_0x3f8bdf[_0xba7d('0x1e')]],'as':_0x3f8bdf['as'],'attributes':_0x3f8bdf[_0xba7d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ad460){logger[_0xba7d('0xc')](_0xba7d('0x1f'),_0x32d090);logger[_0xba7d('0xe')](_0xba7d('0x1f'),_0x32d090,JSON[_0xba7d('0x10')](_0x4ad460));_0x4958a9(_0x4ad460);})['catch'](function(_0x4dfdc2){logger[_0xba7d('0x11')](_0xba7d('0x1f'),_0x4dfdc2['message'],_0x32d090);_0x2479b0(_0x3298db[_0xba7d('0x11')](0x1f4,_0x4dfdc2[_0xba7d('0x13')]));});});}; \ No newline at end of file +var _0x4991=['where','attributes','limit','include','map','model','catch','ShowZohoAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetZohoAccount','findAll','options','raw'];(function(_0x4e6abf,_0x94a679){var _0x3317ad=function(_0x551b18){while(--_0x551b18){_0x4e6abf['push'](_0x4e6abf['shift']());}};_0x3317ad(++_0x94a679);}(_0x4991,0xf7));var _0x1499=function(_0x1e1504,_0x5cc64f){_0x1e1504=_0x1e1504-0x0;var _0x2575c0=_0x4991[_0x1e1504];return _0x2575c0;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var moment=require(_0x1499('0x1'));var BPromise=require('bluebird');var rs=require(_0x1499('0x2'));var fs=require('fs');var Redis=require(_0x1499('0x3'));var db=require(_0x1499('0x4'))['db'];var utils=require(_0x1499('0x5'));var logger=require(_0x1499('0x6'))(_0x1499('0x7'));var config=require(_0x1499('0x8'));var jayson=require(_0x1499('0x9'));var client=jayson['client'][_0x1499('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c3bd7,_0x1c65c3,_0x33b261){return new BPromise(function(_0x133bae,_0x380e48){return client[_0x1499('0xb')](_0x1c3bd7,_0x33b261)[_0x1499('0xc')](function(_0x48d2ca){logger[_0x1499('0xd')](_0x1499('0xe'),_0x1c65c3,'request\x20sent');logger[_0x1499('0xf')](_0x1499('0x10'),_0x1c65c3,'request\x20sent',JSON[_0x1499('0x11')](_0x48d2ca));if(_0x48d2ca[_0x1499('0x12')]){if(_0x48d2ca['error']['code']===0x1f4){logger['error'](_0x1499('0xe'),_0x1c65c3,_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);return _0x380e48(_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x1c65c3,_0x48d2ca[_0x1499('0x12')]['message']);return _0x133bae(_0x48d2ca[_0x1499('0x12')][_0x1499('0x13')]);}else{logger[_0x1499('0xd')](_0x1499('0xe'),_0x1c65c3,'request\x20sent');_0x133bae(_0x48d2ca[_0x1499('0x14')][_0x1499('0x13')]);}})['catch'](function(_0x25164c){logger[_0x1499('0x12')](_0x1499('0xe'),_0x1c65c3,_0x25164c);_0x380e48(_0x25164c);});});}exports[_0x1499('0x15')]=function(_0x1e45a9){var _0x27e533=this;return new Promise(function(_0x5b9859,_0x541477){return db['ZohoAccount'][_0x1499('0x16')]({'raw':_0x1e45a9[_0x1499('0x17')]?_0x1e45a9['options'][_0x1499('0x18')]===undefined?!![]:![]:!![],'where':_0x1e45a9[_0x1499('0x17')]?_0x1e45a9[_0x1499('0x17')][_0x1499('0x19')]||null:null,'attributes':_0x1e45a9[_0x1499('0x17')]?_0x1e45a9[_0x1499('0x17')][_0x1499('0x1a')]||null:null,'limit':_0x1e45a9[_0x1499('0x17')]?_0x1e45a9[_0x1499('0x17')][_0x1499('0x1b')]||null:null,'include':_0x1e45a9[_0x1499('0x17')]?_0x1e45a9[_0x1499('0x17')][_0x1499('0x1c')]?_[_0x1499('0x1d')](_0x1e45a9[_0x1499('0x17')][_0x1499('0x1c')],function(_0x2c7f57){return{'model':db[_0x2c7f57['model']],'as':_0x2c7f57['as'],'attributes':_0x2c7f57[_0x1499('0x1a')],'include':_0x2c7f57[_0x1499('0x1c')]?_[_0x1499('0x1d')](_0x2c7f57[_0x1499('0x1c')],function(_0x3968e0){return{'model':db[_0x3968e0[_0x1499('0x1e')]],'as':_0x3968e0['as'],'attributes':_0x3968e0['attributes'],'include':_0x3968e0['include']?_[_0x1499('0x1d')](_0x3968e0[_0x1499('0x1c')],function(_0x3b9259){return{'model':db[_0x3b9259[_0x1499('0x1e')]],'as':_0x3b9259['as'],'attributes':_0x3b9259[_0x1499('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e5ed1){logger['info']('GetZohoAccount',_0x1e45a9);logger['debug'](_0x1499('0x15'),_0x1e45a9,JSON[_0x1499('0x11')](_0x3e5ed1));_0x5b9859(_0x3e5ed1);})[_0x1499('0x1f')](function(_0x1b460b){logger[_0x1499('0x12')](_0x1499('0x15'),_0x1b460b[_0x1499('0x13')],_0x1e45a9);_0x541477(_0x27e533['error'](0x1f4,_0x1b460b[_0x1499('0x13')]));});});};exports[_0x1499('0x20')]=function(_0x39995b){var _0x5b59ea=this;return new Promise(function(_0x2dae84,_0x16466c){return db['ZohoAccount'][_0x1499('0x21')]({'raw':_0x39995b[_0x1499('0x17')]?_0x39995b['options'][_0x1499('0x18')]===undefined?!![]:![]:!![],'where':_0x39995b[_0x1499('0x17')]?_0x39995b[_0x1499('0x17')][_0x1499('0x19')]||null:null,'attributes':_0x39995b[_0x1499('0x17')]?_0x39995b[_0x1499('0x17')][_0x1499('0x1a')]||null:null,'include':_0x39995b[_0x1499('0x17')]?_0x39995b[_0x1499('0x17')][_0x1499('0x1c')]?_[_0x1499('0x1d')](_0x39995b[_0x1499('0x17')][_0x1499('0x1c')],function(_0x3f4c1a){return{'model':db[_0x3f4c1a[_0x1499('0x1e')]],'as':_0x3f4c1a['as'],'attributes':_0x3f4c1a[_0x1499('0x1a')],'include':_0x3f4c1a[_0x1499('0x1c')]?_[_0x1499('0x1d')](_0x3f4c1a[_0x1499('0x1c')],function(_0x29e89e){return{'model':db[_0x29e89e['model']],'as':_0x29e89e['as'],'attributes':_0x29e89e[_0x1499('0x1a')],'include':_0x29e89e[_0x1499('0x1c')]?_[_0x1499('0x1d')](_0x29e89e[_0x1499('0x1c')],function(_0x31251c){return{'model':db[_0x31251c[_0x1499('0x1e')]],'as':_0x31251c['as'],'attributes':_0x31251c[_0x1499('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1499('0xc')](function(_0x12cf93){logger[_0x1499('0xd')](_0x1499('0x20'),_0x39995b);logger['debug']('ShowZohoAccount',_0x39995b,JSON[_0x1499('0x11')](_0x12cf93));_0x2dae84(_0x12cf93);})['catch'](function(_0x29bb8f){logger['error'](_0x1499('0x20'),_0x29bb8f[_0x1499('0x13')],_0x39995b);_0x16466c(_0x5b59ea[_0x1499('0x12')](0x1f4,_0x29bb8f[_0x1499('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 95f83fa..aa7009f 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 _0x5f2c=['post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x5f2c,0x156));var _0xc5f2=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x5f2c[_0x580576];return _0x3f55a0;};'use strict';var multer=require(_0xc5f2('0x0'));var util=require(_0xc5f2('0x1'));var path=require('path');var timeout=require(_0xc5f2('0x2'));var express=require(_0xc5f2('0x3'));var router=express['Router']();var fs_extra=require(_0xc5f2('0x4'));var auth=require(_0xc5f2('0x5'));var interaction=require(_0xc5f2('0x6'));var config=require(_0xc5f2('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0xc5f2('0x8')]('/',auth['isAuthenticated'](),controller[_0xc5f2('0x9')]);router[_0xc5f2('0x8')](_0xc5f2('0xa'),auth[_0xc5f2('0xb')](),controller['show']);router[_0xc5f2('0x8')](_0xc5f2('0xc'),auth[_0xc5f2('0xb')](),controller[_0xc5f2('0xd')]);router['get'](_0xc5f2('0xe'),auth[_0xc5f2('0xb')](),controller['getSubjects']);router[_0xc5f2('0x8')]('/:id/descriptions',auth[_0xc5f2('0xb')](),controller['getDescriptions']);router[_0xc5f2('0xf')]('/',auth[_0xc5f2('0xb')](),controller[_0xc5f2('0x10')]);router[_0xc5f2('0x11')]('/:id',auth[_0xc5f2('0xb')](),controller['update']);router[_0xc5f2('0x12')]('/:id',auth[_0xc5f2('0xb')](),controller[_0xc5f2('0x13')]);module[_0xc5f2('0x14')]=router; \ No newline at end of file +var _0x9add=['multer','util','path','express','fs-extra','../../components/interaction/service','get','index','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports'];(function(_0x2046ee,_0x5c974d){var _0x5e447a=function(_0x4e3fce){while(--_0x4e3fce){_0x2046ee['push'](_0x2046ee['shift']());}};_0x5e447a(++_0x5c974d);}(_0x9add,0x8a));var _0xd9ad=function(_0x1444ea,_0x7ac298){_0x1444ea=_0x1444ea-0x0;var _0xb2333c=_0x9add[_0x1444ea];return _0xb2333c;};'use strict';var multer=require(_0xd9ad('0x0'));var util=require(_0xd9ad('0x1'));var path=require(_0xd9ad('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ad('0x3'));var router=express['Router']();var fs_extra=require(_0xd9ad('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd9ad('0x5'));var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router[_0xd9ad('0x6')]('/',auth['isAuthenticated'](),controller[_0xd9ad('0x7')]);router[_0xd9ad('0x6')](_0xd9ad('0x8'),auth[_0xd9ad('0x9')](),controller[_0xd9ad('0xa')]);router[_0xd9ad('0x6')]('/:id/fields',auth[_0xd9ad('0x9')](),controller[_0xd9ad('0xb')]);router['get'](_0xd9ad('0xc'),auth['isAuthenticated'](),controller[_0xd9ad('0xd')]);router[_0xd9ad('0x6')](_0xd9ad('0xe'),auth[_0xd9ad('0x9')](),controller[_0xd9ad('0xf')]);router[_0xd9ad('0x10')]('/',auth[_0xd9ad('0x9')](),controller[_0xd9ad('0x11')]);router[_0xd9ad('0x12')](_0xd9ad('0x8'),auth[_0xd9ad('0x9')](),controller[_0xd9ad('0x13')]);router[_0xd9ad('0x14')](_0xd9ad('0x8'),auth[_0xd9ad('0x9')](),controller[_0xd9ad('0x15')]);module[_0xd9ad('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 9ceded5..b1f0d6c 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 _0xee1f=['contact_lead','STRING','sequelize','ENUM','lead','contact','nothing'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee1f,0x198));var _0xfee1=function(_0x541c3f,_0x26f15f){_0x541c3f=_0x541c3f-0x0;var _0x1c4b8a=_0xee1f[_0x541c3f];return _0x1c4b8a;};'use strict';var Sequelize=require(_0xfee1('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xfee1('0x1')](_0xfee1('0x2'),_0xfee1('0x3'),_0xfee1('0x4')),'defaultValue':_0xfee1('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0xfee1('0x5'),_0xfee1('0x3'),_0xfee1('0x2')),'defaultValue':_0xfee1('0x5')},'description':{'type':Sequelize[_0xfee1('0x6')]}}; \ No newline at end of file +var _0x1377=['contact_lead','sequelize','exports','STRING','ENUM','lead'];(function(_0x20229e,_0xa59f8a){var _0x317377=function(_0x290697){while(--_0x290697){_0x20229e['push'](_0x20229e['shift']());}};_0x317377(++_0xa59f8a);}(_0x1377,0x15d));var _0x7137=function(_0x159251,_0x6b6873){_0x159251=_0x159251-0x0;var _0x4ee30c=_0x1377[_0x159251];return _0x4ee30c;};'use strict';var Sequelize=require(_0x7137('0x0'));module[_0x7137('0x1')]={'name':{'type':Sequelize[_0x7137('0x2')]},'moduleCreate':{'type':Sequelize[_0x7137('0x3')](_0x7137('0x4'),'contact','nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x7137('0x3')](_0x7137('0x5'),'contact','lead'),'defaultValue':_0x7137('0x5')},'description':{'type':Sequelize[_0x7137('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 210a29a..a83364c 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 _0x1cb3=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','ZohoConfiguration','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','destroy','findOne','ZohoField','options','getFields','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','save','update','then','end','name','index','map','fieldName','type','key','model','query','filters'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1cb3,0x6b));var _0x31cb=function(_0xd274d5,_0x250e77){_0xd274d5=_0xd274d5-0x0;var _0x2188be=_0x1cb3[_0xd274d5];return _0x2188be;};'use strict';var emlformat=require(_0x31cb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x31cb('0x1'));var rp=require(_0x31cb('0x2'));var moment=require(_0x31cb('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x31cb('0x4'));var sox=require(_0x31cb('0x5'));var csv=require(_0x31cb('0x6'));var ejs=require(_0x31cb('0x7'));var fs=require('fs');var fs_extra=require(_0x31cb('0x8'));var _=require('lodash');var squel=require(_0x31cb('0x9'));var crypto=require(_0x31cb('0xa'));var jsforce=require(_0x31cb('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x31cb('0x6'));var querystring=require(_0x31cb('0xc'));var Papa=require(_0x31cb('0xd'));var Redis=require(_0x31cb('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x31cb('0xf'));var as=require(_0x31cb('0x10'));var hardwareService=require(_0x31cb('0x11'));var logger=require('../../config/logger')(_0x31cb('0x12'));var utils=require('../../config/utils');var config=require(_0x31cb('0x13'));var licenseUtil=require(_0x31cb('0x14'));var db=require(_0x31cb('0x15'))['db'];function respondWithStatusCode(_0x2de9bd,_0x343550){_0x343550=_0x343550||0xcc;return function(_0x1b59bc){if(_0x1b59bc){return _0x2de9bd[_0x31cb('0x16')](_0x343550);}return _0x2de9bd[_0x31cb('0x17')](_0x343550)['end']();};}function respondWithResult(_0x917f4d,_0x2f86cf){_0x2f86cf=_0x2f86cf||0xc8;return function(_0x1eecef){if(_0x1eecef){return _0x917f4d[_0x31cb('0x17')](_0x2f86cf)['json'](_0x1eecef);}};}function respondWithFilteredResult(_0x1802da,_0x2a4c91){return function(_0x5a60ac){if(_0x5a60ac){var _0x1a90b8=typeof _0x2a4c91[_0x31cb('0x18')]===_0x31cb('0x19')&&typeof _0x2a4c91[_0x31cb('0x1a')]===_0x31cb('0x19');var _0x476fcd=_0x5a60ac['count'];var _0x475f64=_0x1a90b8?0x0:_0x2a4c91['offset'];var _0x5026ee=_0x1a90b8?_0x5a60ac[_0x31cb('0x1b')]:_0x2a4c91[_0x31cb('0x18')]+_0x2a4c91[_0x31cb('0x1a')];var _0x11295e;if(_0x5026ee>=_0x476fcd){_0x5026ee=_0x476fcd;_0x11295e=0xc8;}else{_0x11295e=0xce;}_0x1802da[_0x31cb('0x17')](_0x11295e);return _0x1802da[_0x31cb('0x1c')]('Content-Range',_0x475f64+'-'+_0x5026ee+'/'+_0x476fcd)['json'](_0x5a60ac);}return null;};}function patchUpdates(_0xda301d){return function(_0x1f9462){try{jsonpatch[_0x31cb('0x1d')](_0x1f9462,_0xda301d,!![]);}catch(_0x234bbb){return BPromise['reject'](_0x234bbb);}return _0x1f9462[_0x31cb('0x1e')]();};}function saveUpdates(_0x5949f3,_0x4619d4){return function(_0x1bb246){if(_0x1bb246){return _0x1bb246[_0x31cb('0x1f')](_0x5949f3)[_0x31cb('0x20')](function(_0x4d1abe){return _0x4d1abe;});}return null;};}function removeEntity(_0x4ff8fd,_0x38baa6){return function(_0x28bef2){if(_0x28bef2){return _0x28bef2['destroy']()[_0x31cb('0x20')](function(){_0x4ff8fd[_0x31cb('0x17')](0xcc)[_0x31cb('0x21')]();});}};}function handleEntityNotFound(_0x2c5389,_0x564fb4){return function(_0x3591a6){if(!_0x3591a6){_0x2c5389[_0x31cb('0x16')](0x194);}return _0x3591a6;};}function handleError(_0x349cd0,_0x2ed650){_0x2ed650=_0x2ed650||0x1f4;return function(_0x2549b3){logger['error'](_0x2549b3['stack']);if(_0x2549b3[_0x31cb('0x22')]){delete _0x2549b3[_0x31cb('0x22')];}_0x349cd0[_0x31cb('0x17')](_0x2ed650)['send'](_0x2549b3);};}exports[_0x31cb('0x23')]=function(_0x448e93,_0x59e7fd){var _0xa41ed9={},_0x11324c={},_0x32f646={'count':0x0,'rows':[]};var _0x46588a=_[_0x31cb('0x24')](db['ZohoConfiguration']['rawAttributes'],function(_0x25fde9){return{'name':_0x25fde9[_0x31cb('0x25')],'type':_0x25fde9[_0x31cb('0x26')][_0x31cb('0x27')]};});_0x11324c[_0x31cb('0x28')]=_[_0x31cb('0x24')](_0x46588a,_0x31cb('0x22'));_0x11324c[_0x31cb('0x29')]=_['keys'](_0x448e93[_0x31cb('0x29')]);_0x11324c[_0x31cb('0x2a')]=_[_0x31cb('0x2b')](_0x11324c[_0x31cb('0x28')],_0x11324c[_0x31cb('0x29')]);_0xa41ed9[_0x31cb('0x2c')]=_[_0x31cb('0x2b')](_0x11324c[_0x31cb('0x28')],qs[_0x31cb('0x2d')](_0x448e93['query'][_0x31cb('0x2d')]));_0xa41ed9['attributes']=_0xa41ed9[_0x31cb('0x2c')][_0x31cb('0x2e')]?_0xa41ed9[_0x31cb('0x2c')]:_0x11324c[_0x31cb('0x28')];if(!_0x448e93[_0x31cb('0x29')][_0x31cb('0x2f')](_0x31cb('0x30'))){_0xa41ed9[_0x31cb('0x1a')]=qs[_0x31cb('0x1a')](_0x448e93[_0x31cb('0x29')][_0x31cb('0x1a')]);_0xa41ed9[_0x31cb('0x18')]=qs[_0x31cb('0x18')](_0x448e93[_0x31cb('0x29')][_0x31cb('0x18')]);}_0xa41ed9[_0x31cb('0x31')]=qs[_0x31cb('0x32')](_0x448e93[_0x31cb('0x29')][_0x31cb('0x32')]);_0xa41ed9[_0x31cb('0x33')]=qs[_0x31cb('0x2a')](_[_0x31cb('0x34')](_0x448e93[_0x31cb('0x29')],_0x11324c[_0x31cb('0x2a')]),_0x46588a);if(_0x448e93[_0x31cb('0x29')][_0x31cb('0x35')]){_0xa41ed9[_0x31cb('0x33')]=_[_0x31cb('0x36')](_0xa41ed9['where'],{'$or':_[_0x31cb('0x24')](_0x46588a,function(_0x6e5173){if(_0x6e5173[_0x31cb('0x26')]!=='VIRTUAL'){var _0x513c62={};_0x513c62[_0x6e5173[_0x31cb('0x22')]]={'$like':'%'+_0x448e93[_0x31cb('0x29')][_0x31cb('0x35')]+'%'};return _0x513c62;}})});}_0xa41ed9=_[_0x31cb('0x36')]({},_0xa41ed9,_0x448e93['options']);var _0x36b548={'where':_0xa41ed9[_0x31cb('0x33')]};return db[_0x31cb('0x37')][_0x31cb('0x1b')](_0x36b548)[_0x31cb('0x20')](function(_0x4703d5){_0x32f646[_0x31cb('0x1b')]=_0x4703d5;if(_0x448e93[_0x31cb('0x29')][_0x31cb('0x38')]){_0xa41ed9[_0x31cb('0x39')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x31cb('0x3a')](_0xa41ed9);})['then'](function(_0x2ad653){_0x32f646[_0x31cb('0x3b')]=_0x2ad653;return _0x32f646;})[_0x31cb('0x20')](respondWithFilteredResult(_0x59e7fd,_0xa41ed9))[_0x31cb('0x3c')](handleError(_0x59e7fd,null));};exports[_0x31cb('0x3d')]=function(_0x42c9ce,_0x237c8f){var _0x4cae82={'raw':![],'where':{'id':_0x42c9ce[_0x31cb('0x3e')]['id']}},_0x43b163={};_0x43b163[_0x31cb('0x28')]=_[_0x31cb('0x3f')](db[_0x31cb('0x37')][_0x31cb('0x40')]);_0x43b163[_0x31cb('0x29')]=_[_0x31cb('0x3f')](_0x42c9ce['query']);_0x43b163[_0x31cb('0x2a')]=_[_0x31cb('0x2b')](_0x43b163[_0x31cb('0x28')],_0x43b163[_0x31cb('0x29')]);_0x4cae82[_0x31cb('0x2c')]=_[_0x31cb('0x2b')](_0x43b163['model'],qs[_0x31cb('0x2d')](_0x42c9ce['query'][_0x31cb('0x2d')]));_0x4cae82[_0x31cb('0x2c')]=_0x4cae82[_0x31cb('0x2c')][_0x31cb('0x2e')]?_0x4cae82['attributes']:_0x43b163[_0x31cb('0x28')];if(_0x42c9ce[_0x31cb('0x29')][_0x31cb('0x38')]){_0x4cae82['include']=[{'all':!![]}];}_0x4cae82=_[_0x31cb('0x36')]({},_0x4cae82,_0x42c9ce['options']);return db[_0x31cb('0x37')][_0x31cb('0x41')](_0x4cae82)[_0x31cb('0x20')](handleEntityNotFound(_0x237c8f,null))['then'](respondWithResult(_0x237c8f,null))[_0x31cb('0x3c')](handleError(_0x237c8f,null));};exports['create']=function(_0x26fef3,_0x3b47c4){return db[_0x31cb('0x37')][_0x31cb('0x42')](_0x26fef3['body'],{})[_0x31cb('0x20')](respondWithResult(_0x3b47c4,0xc9))[_0x31cb('0x3c')](handleError(_0x3b47c4,null));};exports['update']=function(_0x2290bc,_0x87e2be){if(_0x2290bc[_0x31cb('0x43')]['id']){delete _0x2290bc[_0x31cb('0x43')]['id'];}return db[_0x31cb('0x37')]['find']({'where':{'id':_0x2290bc[_0x31cb('0x3e')]['id']}})['then'](handleEntityNotFound(_0x87e2be,null))[_0x31cb('0x20')](saveUpdates(_0x2290bc['body'],null))[_0x31cb('0x20')](respondWithResult(_0x87e2be,null))[_0x31cb('0x3c')](handleError(_0x87e2be,null));};exports[_0x31cb('0x44')]=function(_0x8db683,_0x9e6507){return db[_0x31cb('0x37')][_0x31cb('0x41')]({'where':{'id':_0x8db683[_0x31cb('0x3e')]['id']}})[_0x31cb('0x20')](handleEntityNotFound(_0x9e6507,null))[_0x31cb('0x20')](removeEntity(_0x9e6507,null))[_0x31cb('0x3c')](handleError(_0x9e6507,null));};exports['getFields']=function(_0x316471,_0x142662,_0x4bae98){var _0x112db2={};var _0x46516b={};var _0x7e7aeb;var _0x39dd15;return db['ZohoConfiguration'][_0x31cb('0x45')]({'where':{'id':_0x316471[_0x31cb('0x3e')]['id']}})['then'](handleEntityNotFound(_0x142662,null))['then'](function(_0x506e7d){if(_0x506e7d){_0x7e7aeb=_0x506e7d;_0x46516b['model']=_[_0x31cb('0x3f')](db[_0x31cb('0x46')]['rawAttributes']);_0x46516b[_0x31cb('0x29')]=_[_0x31cb('0x3f')](_0x316471[_0x31cb('0x29')]);_0x46516b['filters']=_[_0x31cb('0x2b')](_0x46516b[_0x31cb('0x28')],_0x46516b[_0x31cb('0x29')]);_0x112db2['attributes']=_['intersection'](_0x46516b[_0x31cb('0x28')],qs[_0x31cb('0x2d')](_0x316471[_0x31cb('0x29')][_0x31cb('0x2d')]));_0x112db2[_0x31cb('0x2c')]=_0x112db2[_0x31cb('0x2c')][_0x31cb('0x2e')]?_0x112db2[_0x31cb('0x2c')]:_0x46516b['model'];_0x112db2[_0x31cb('0x31')]=qs[_0x31cb('0x32')](_0x316471[_0x31cb('0x29')][_0x31cb('0x32')]);_0x112db2[_0x31cb('0x33')]=qs[_0x31cb('0x2a')](_[_0x31cb('0x34')](_0x316471[_0x31cb('0x29')],_0x46516b[_0x31cb('0x2a')]));if(_0x316471[_0x31cb('0x29')][_0x31cb('0x35')]){_0x112db2[_0x31cb('0x33')]=_['merge'](_0x112db2[_0x31cb('0x33')],{'$or':_['map'](_0x112db2[_0x31cb('0x2c')],function(_0x59e65a){var _0x411926={};_0x411926[_0x59e65a]={'$like':'%'+_0x316471[_0x31cb('0x29')]['filter']+'%'};return _0x411926;})});}_0x112db2=_['merge']({},_0x112db2,_0x316471[_0x31cb('0x47')]);return _0x7e7aeb[_0x31cb('0x48')](_0x112db2);}})['then'](function(_0x41789c){if(_0x41789c){_0x39dd15=_0x41789c['length'];if(!_0x316471[_0x31cb('0x29')]['hasOwnProperty'](_0x31cb('0x30'))){_0x112db2['limit']=qs[_0x31cb('0x1a')](_0x316471[_0x31cb('0x29')]['limit']);_0x112db2['offset']=qs[_0x31cb('0x18')](_0x316471[_0x31cb('0x29')][_0x31cb('0x18')]);}return _0x7e7aeb[_0x31cb('0x48')](_0x112db2);}})[_0x31cb('0x20')](function(_0x18ba73){if(_0x18ba73){return _0x18ba73?{'count':_0x39dd15,'rows':_0x18ba73}:null;}})[_0x31cb('0x20')](respondWithResult(_0x142662,null))[_0x31cb('0x3c')](handleError(_0x142662,null));};exports[_0x31cb('0x49')]=function(_0xec7315,_0x310ffc,_0x41829c){var _0x51da05={};var _0x3e3916={};var _0x45ed94;var _0x541623;return db[_0x31cb('0x37')]['findOne']({'where':{'id':_0xec7315[_0x31cb('0x3e')]['id']}})[_0x31cb('0x20')](handleEntityNotFound(_0x310ffc,null))[_0x31cb('0x20')](function(_0x10acd4){if(_0x10acd4){_0x45ed94=_0x10acd4;_0x3e3916[_0x31cb('0x28')]=_[_0x31cb('0x3f')](db[_0x31cb('0x46')][_0x31cb('0x40')]);_0x3e3916[_0x31cb('0x29')]=_[_0x31cb('0x3f')](_0xec7315[_0x31cb('0x29')]);_0x3e3916['filters']=_[_0x31cb('0x2b')](_0x3e3916[_0x31cb('0x28')],_0x3e3916['query']);_0x51da05['attributes']=_[_0x31cb('0x2b')](_0x3e3916[_0x31cb('0x28')],qs['fields'](_0xec7315[_0x31cb('0x29')][_0x31cb('0x2d')]));_0x51da05['attributes']=_0x51da05['attributes'][_0x31cb('0x2e')]?_0x51da05[_0x31cb('0x2c')]:_0x3e3916[_0x31cb('0x28')];_0x51da05['order']=qs['sort'](_0xec7315['query'][_0x31cb('0x32')]);_0x51da05[_0x31cb('0x33')]=qs[_0x31cb('0x2a')](_[_0x31cb('0x34')](_0xec7315[_0x31cb('0x29')],_0x3e3916[_0x31cb('0x2a')]));if(_0xec7315[_0x31cb('0x29')][_0x31cb('0x35')]){_0x51da05[_0x31cb('0x33')]=_[_0x31cb('0x36')](_0x51da05[_0x31cb('0x33')],{'$or':_[_0x31cb('0x24')](_0x51da05[_0x31cb('0x2c')],function(_0x58eca1){var _0x242288={};_0x242288[_0x58eca1]={'$like':'%'+_0xec7315[_0x31cb('0x29')][_0x31cb('0x35')]+'%'};return _0x242288;})});}_0x51da05=_[_0x31cb('0x36')]({},_0x51da05,_0xec7315[_0x31cb('0x47')]);return _0x45ed94[_0x31cb('0x49')](_0x51da05);}})[_0x31cb('0x20')](function(_0x3a2162){if(_0x3a2162){_0x541623=_0x3a2162[_0x31cb('0x2e')];if(!_0xec7315[_0x31cb('0x29')][_0x31cb('0x2f')](_0x31cb('0x30'))){_0x51da05[_0x31cb('0x1a')]=qs[_0x31cb('0x1a')](_0xec7315['query'][_0x31cb('0x1a')]);_0x51da05['offset']=qs[_0x31cb('0x18')](_0xec7315[_0x31cb('0x29')][_0x31cb('0x18')]);}return _0x45ed94['getSubjects'](_0x51da05);}})[_0x31cb('0x20')](function(_0x1a296f){if(_0x1a296f){return _0x1a296f?{'count':_0x541623,'rows':_0x1a296f}:null;}})[_0x31cb('0x20')](respondWithResult(_0x310ffc,null))[_0x31cb('0x3c')](handleError(_0x310ffc,null));};exports['getDescriptions']=function(_0x3bdcef,_0x34021e,_0x2816b7){var _0x4569df={};var _0x33bbd3={};var _0x5d699d;var _0x8b8a9d;return db[_0x31cb('0x37')][_0x31cb('0x45')]({'where':{'id':_0x3bdcef[_0x31cb('0x3e')]['id']}})[_0x31cb('0x20')](handleEntityNotFound(_0x34021e,null))[_0x31cb('0x20')](function(_0x1d1f35){if(_0x1d1f35){_0x5d699d=_0x1d1f35;_0x33bbd3[_0x31cb('0x28')]=_[_0x31cb('0x3f')](db[_0x31cb('0x46')][_0x31cb('0x40')]);_0x33bbd3[_0x31cb('0x29')]=_[_0x31cb('0x3f')](_0x3bdcef[_0x31cb('0x29')]);_0x33bbd3[_0x31cb('0x2a')]=_[_0x31cb('0x2b')](_0x33bbd3[_0x31cb('0x28')],_0x33bbd3['query']);_0x4569df[_0x31cb('0x2c')]=_['intersection'](_0x33bbd3[_0x31cb('0x28')],qs[_0x31cb('0x2d')](_0x3bdcef[_0x31cb('0x29')][_0x31cb('0x2d')]));_0x4569df[_0x31cb('0x2c')]=_0x4569df[_0x31cb('0x2c')][_0x31cb('0x2e')]?_0x4569df[_0x31cb('0x2c')]:_0x33bbd3[_0x31cb('0x28')];_0x4569df[_0x31cb('0x31')]=qs[_0x31cb('0x32')](_0x3bdcef[_0x31cb('0x29')][_0x31cb('0x32')]);_0x4569df[_0x31cb('0x33')]=qs[_0x31cb('0x2a')](_[_0x31cb('0x34')](_0x3bdcef[_0x31cb('0x29')],_0x33bbd3[_0x31cb('0x2a')]));if(_0x3bdcef[_0x31cb('0x29')][_0x31cb('0x35')]){_0x4569df[_0x31cb('0x33')]=_[_0x31cb('0x36')](_0x4569df['where'],{'$or':_[_0x31cb('0x24')](_0x4569df['attributes'],function(_0x30c349){var _0x367ac1={};_0x367ac1[_0x30c349]={'$like':'%'+_0x3bdcef[_0x31cb('0x29')][_0x31cb('0x35')]+'%'};return _0x367ac1;})});}_0x4569df=_[_0x31cb('0x36')]({},_0x4569df,_0x3bdcef['options']);return _0x5d699d[_0x31cb('0x4a')](_0x4569df);}})['then'](function(_0x59bf4d){if(_0x59bf4d){_0x8b8a9d=_0x59bf4d[_0x31cb('0x2e')];if(!_0x3bdcef['query']['hasOwnProperty'](_0x31cb('0x30'))){_0x4569df[_0x31cb('0x1a')]=qs['limit'](_0x3bdcef[_0x31cb('0x29')][_0x31cb('0x1a')]);_0x4569df[_0x31cb('0x18')]=qs[_0x31cb('0x18')](_0x3bdcef[_0x31cb('0x29')][_0x31cb('0x18')]);}return _0x5d699d[_0x31cb('0x4a')](_0x4569df);}})[_0x31cb('0x20')](function(_0x1fd6e4){if(_0x1fd6e4){return _0x1fd6e4?{'count':_0x8b8a9d,'rows':_0x1fd6e4}:null;}})['then'](respondWithResult(_0x34021e,null))['catch'](handleError(_0x34021e,null));}; \ No newline at end of file +var _0xebe3=['mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','map','rawAttributes','fieldName','type','key','model','name','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ZohoConfiguration','includeAll','include','findAll','catch','show','params','find','create','body','getFields','findOne','ZohoField','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','bluebird'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xebe3,0xe4));var _0x3ebe=function(_0x2b9a3a,_0x5c67f9){_0x2b9a3a=_0x2b9a3a-0x0;var _0x572644=_0xebe3[_0x2b9a3a];return _0x572644;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3ebe('0x0'));var zipdir=require(_0x3ebe('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3ebe('0x2'));var Mustache=require(_0x3ebe('0x3'));var util=require(_0x3ebe('0x4'));var path=require(_0x3ebe('0x5'));var sox=require(_0x3ebe('0x6'));var csv=require('to-csv');var ejs=require(_0x3ebe('0x7'));var fs=require('fs');var fs_extra=require(_0x3ebe('0x8'));var _=require(_0x3ebe('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3ebe('0xa'));var deskjs=require(_0x3ebe('0xb'));var toCsv=require(_0x3ebe('0xc'));var querystring=require(_0x3ebe('0xd'));var Papa=require('papaparse');var Redis=require(_0x3ebe('0xe'));var authService=require(_0x3ebe('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3ebe('0x10'));var hardwareService=require(_0x3ebe('0x11'));var logger=require('../../config/logger')(_0x3ebe('0x12'));var utils=require(_0x3ebe('0x13'));var config=require(_0x3ebe('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x3ebe('0x15'))['db'];function respondWithStatusCode(_0x56a096,_0x4b7221){_0x4b7221=_0x4b7221||0xcc;return function(_0x903803){if(_0x903803){return _0x56a096[_0x3ebe('0x16')](_0x4b7221);}return _0x56a096[_0x3ebe('0x17')](_0x4b7221)[_0x3ebe('0x18')]();};}function respondWithResult(_0x10a442,_0x2ea8b0){_0x2ea8b0=_0x2ea8b0||0xc8;return function(_0x2da43f){if(_0x2da43f){return _0x10a442['status'](_0x2ea8b0)[_0x3ebe('0x19')](_0x2da43f);}};}function respondWithFilteredResult(_0x3792a0,_0x44548c){return function(_0x476223){if(_0x476223){var _0x3e5193=typeof _0x44548c['offset']==='undefined'&&typeof _0x44548c['limit']===_0x3ebe('0x1a');var _0x3b6292=_0x476223[_0x3ebe('0x1b')];var _0x1b1668=_0x3e5193?0x0:_0x44548c[_0x3ebe('0x1c')];var _0x27e85b=_0x3e5193?_0x476223[_0x3ebe('0x1b')]:_0x44548c['offset']+_0x44548c[_0x3ebe('0x1d')];var _0x4225fd;if(_0x27e85b>=_0x3b6292){_0x27e85b=_0x3b6292;_0x4225fd=0xc8;}else{_0x4225fd=0xce;}_0x3792a0['status'](_0x4225fd);return _0x3792a0[_0x3ebe('0x1e')](_0x3ebe('0x1f'),_0x1b1668+'-'+_0x27e85b+'/'+_0x3b6292)[_0x3ebe('0x19')](_0x476223);}return null;};}function patchUpdates(_0x4de837){return function(_0x23c6e7){try{jsonpatch[_0x3ebe('0x20')](_0x23c6e7,_0x4de837,!![]);}catch(_0x482c09){return BPromise['reject'](_0x482c09);}return _0x23c6e7['save']();};}function saveUpdates(_0x4701b2,_0x38e4bc){return function(_0x1667f8){if(_0x1667f8){return _0x1667f8[_0x3ebe('0x21')](_0x4701b2)[_0x3ebe('0x22')](function(_0x19e8cc){return _0x19e8cc;});}return null;};}function removeEntity(_0x5172c2,_0x47489d){return function(_0x65e50d){if(_0x65e50d){return _0x65e50d[_0x3ebe('0x23')]()[_0x3ebe('0x22')](function(){_0x5172c2['status'](0xcc)[_0x3ebe('0x18')]();});}};}function handleEntityNotFound(_0x2456fe,_0x3ed513){return function(_0x249ed9){if(!_0x249ed9){_0x2456fe[_0x3ebe('0x16')](0x194);}return _0x249ed9;};}function handleError(_0x136d75,_0xe4a934){_0xe4a934=_0xe4a934||0x1f4;return function(_0x43c3bc){logger[_0x3ebe('0x24')](_0x43c3bc[_0x3ebe('0x25')]);if(_0x43c3bc['name']){delete _0x43c3bc['name'];}_0x136d75[_0x3ebe('0x17')](_0xe4a934)['send'](_0x43c3bc);};}exports['index']=function(_0x4090f2,_0x4da024){var _0x42a00d={},_0x3dad29={},_0x454769={'count':0x0,'rows':[]};var _0x3e0fcf=_[_0x3ebe('0x26')](db['ZohoConfiguration'][_0x3ebe('0x27')],function(_0x4e3ae8){return{'name':_0x4e3ae8[_0x3ebe('0x28')],'type':_0x4e3ae8[_0x3ebe('0x29')][_0x3ebe('0x2a')]};});_0x3dad29[_0x3ebe('0x2b')]=_[_0x3ebe('0x26')](_0x3e0fcf,_0x3ebe('0x2c'));_0x3dad29['query']=_[_0x3ebe('0x2d')](_0x4090f2[_0x3ebe('0x2e')]);_0x3dad29['filters']=_[_0x3ebe('0x2f')](_0x3dad29['model'],_0x3dad29['query']);_0x42a00d[_0x3ebe('0x30')]=_[_0x3ebe('0x2f')](_0x3dad29['model'],qs[_0x3ebe('0x31')](_0x4090f2[_0x3ebe('0x2e')][_0x3ebe('0x31')]));_0x42a00d[_0x3ebe('0x30')]=_0x42a00d[_0x3ebe('0x30')][_0x3ebe('0x32')]?_0x42a00d[_0x3ebe('0x30')]:_0x3dad29[_0x3ebe('0x2b')];if(!_0x4090f2[_0x3ebe('0x2e')]['hasOwnProperty'](_0x3ebe('0x33'))){_0x42a00d[_0x3ebe('0x1d')]=qs[_0x3ebe('0x1d')](_0x4090f2[_0x3ebe('0x2e')][_0x3ebe('0x1d')]);_0x42a00d['offset']=qs['offset'](_0x4090f2[_0x3ebe('0x2e')][_0x3ebe('0x1c')]);}_0x42a00d[_0x3ebe('0x34')]=qs[_0x3ebe('0x35')](_0x4090f2['query'][_0x3ebe('0x35')]);_0x42a00d[_0x3ebe('0x36')]=qs[_0x3ebe('0x37')](_[_0x3ebe('0x38')](_0x4090f2[_0x3ebe('0x2e')],_0x3dad29[_0x3ebe('0x37')]),_0x3e0fcf);if(_0x4090f2[_0x3ebe('0x2e')][_0x3ebe('0x39')]){_0x42a00d[_0x3ebe('0x36')]=_[_0x3ebe('0x3a')](_0x42a00d[_0x3ebe('0x36')],{'$or':_[_0x3ebe('0x26')](_0x3e0fcf,function(_0x10958e){if(_0x10958e['type']!==_0x3ebe('0x3b')){var _0xb9cc99={};_0xb9cc99[_0x10958e[_0x3ebe('0x2c')]]={'$like':'%'+_0x4090f2[_0x3ebe('0x2e')][_0x3ebe('0x39')]+'%'};return _0xb9cc99;}})});}_0x42a00d=_[_0x3ebe('0x3a')]({},_0x42a00d,_0x4090f2[_0x3ebe('0x3c')]);var _0x46d1b2={'where':_0x42a00d[_0x3ebe('0x36')]};return db[_0x3ebe('0x3d')][_0x3ebe('0x1b')](_0x46d1b2)[_0x3ebe('0x22')](function(_0x1a2b97){_0x454769[_0x3ebe('0x1b')]=_0x1a2b97;if(_0x4090f2['query'][_0x3ebe('0x3e')]){_0x42a00d[_0x3ebe('0x3f')]=[{'all':!![]}];}return db[_0x3ebe('0x3d')][_0x3ebe('0x40')](_0x42a00d);})[_0x3ebe('0x22')](function(_0x5c7ed4){_0x454769['rows']=_0x5c7ed4;return _0x454769;})['then'](respondWithFilteredResult(_0x4da024,_0x42a00d))[_0x3ebe('0x41')](handleError(_0x4da024,null));};exports[_0x3ebe('0x42')]=function(_0x1df7ae,_0x3be58d){var _0x4ae92b={'raw':![],'where':{'id':_0x1df7ae[_0x3ebe('0x43')]['id']}},_0x43d011={};_0x43d011[_0x3ebe('0x2b')]=_[_0x3ebe('0x2d')](db[_0x3ebe('0x3d')][_0x3ebe('0x27')]);_0x43d011[_0x3ebe('0x2e')]=_['keys'](_0x1df7ae[_0x3ebe('0x2e')]);_0x43d011[_0x3ebe('0x37')]=_['intersection'](_0x43d011['model'],_0x43d011[_0x3ebe('0x2e')]);_0x4ae92b[_0x3ebe('0x30')]=_[_0x3ebe('0x2f')](_0x43d011[_0x3ebe('0x2b')],qs[_0x3ebe('0x31')](_0x1df7ae[_0x3ebe('0x2e')]['fields']));_0x4ae92b[_0x3ebe('0x30')]=_0x4ae92b[_0x3ebe('0x30')][_0x3ebe('0x32')]?_0x4ae92b['attributes']:_0x43d011[_0x3ebe('0x2b')];if(_0x1df7ae[_0x3ebe('0x2e')][_0x3ebe('0x3e')]){_0x4ae92b[_0x3ebe('0x3f')]=[{'all':!![]}];}_0x4ae92b=_[_0x3ebe('0x3a')]({},_0x4ae92b,_0x1df7ae[_0x3ebe('0x3c')]);return db[_0x3ebe('0x3d')][_0x3ebe('0x44')](_0x4ae92b)[_0x3ebe('0x22')](handleEntityNotFound(_0x3be58d,null))[_0x3ebe('0x22')](respondWithResult(_0x3be58d,null))['catch'](handleError(_0x3be58d,null));};exports[_0x3ebe('0x45')]=function(_0x21f8d9,_0xbe78e2){return db['ZohoConfiguration'][_0x3ebe('0x45')](_0x21f8d9[_0x3ebe('0x46')],{})[_0x3ebe('0x22')](respondWithResult(_0xbe78e2,0xc9))[_0x3ebe('0x41')](handleError(_0xbe78e2,null));};exports[_0x3ebe('0x21')]=function(_0x2599fe,_0x5e4978){if(_0x2599fe[_0x3ebe('0x46')]['id']){delete _0x2599fe[_0x3ebe('0x46')]['id'];}return db[_0x3ebe('0x3d')][_0x3ebe('0x44')]({'where':{'id':_0x2599fe[_0x3ebe('0x43')]['id']}})[_0x3ebe('0x22')](handleEntityNotFound(_0x5e4978,null))[_0x3ebe('0x22')](saveUpdates(_0x2599fe[_0x3ebe('0x46')],null))[_0x3ebe('0x22')](respondWithResult(_0x5e4978,null))[_0x3ebe('0x41')](handleError(_0x5e4978,null));};exports['destroy']=function(_0xbd0117,_0x1ac982){return db['ZohoConfiguration'][_0x3ebe('0x44')]({'where':{'id':_0xbd0117['params']['id']}})[_0x3ebe('0x22')](handleEntityNotFound(_0x1ac982,null))[_0x3ebe('0x22')](removeEntity(_0x1ac982,null))['catch'](handleError(_0x1ac982,null));};exports[_0x3ebe('0x47')]=function(_0xea141e,_0x235a93,_0x230d80){var _0xf3485={};var _0x94e5d5={};var _0x7a8c70;var _0x29c92a;return db[_0x3ebe('0x3d')][_0x3ebe('0x48')]({'where':{'id':_0xea141e[_0x3ebe('0x43')]['id']}})['then'](handleEntityNotFound(_0x235a93,null))[_0x3ebe('0x22')](function(_0x2118f2){if(_0x2118f2){_0x7a8c70=_0x2118f2;_0x94e5d5[_0x3ebe('0x2b')]=_[_0x3ebe('0x2d')](db[_0x3ebe('0x49')]['rawAttributes']);_0x94e5d5['query']=_[_0x3ebe('0x2d')](_0xea141e[_0x3ebe('0x2e')]);_0x94e5d5[_0x3ebe('0x37')]=_['intersection'](_0x94e5d5[_0x3ebe('0x2b')],_0x94e5d5[_0x3ebe('0x2e')]);_0xf3485[_0x3ebe('0x30')]=_['intersection'](_0x94e5d5[_0x3ebe('0x2b')],qs['fields'](_0xea141e[_0x3ebe('0x2e')]['fields']));_0xf3485[_0x3ebe('0x30')]=_0xf3485[_0x3ebe('0x30')][_0x3ebe('0x32')]?_0xf3485[_0x3ebe('0x30')]:_0x94e5d5[_0x3ebe('0x2b')];_0xf3485[_0x3ebe('0x34')]=qs['sort'](_0xea141e[_0x3ebe('0x2e')][_0x3ebe('0x35')]);_0xf3485[_0x3ebe('0x36')]=qs['filters'](_[_0x3ebe('0x38')](_0xea141e[_0x3ebe('0x2e')],_0x94e5d5[_0x3ebe('0x37')]));if(_0xea141e[_0x3ebe('0x2e')][_0x3ebe('0x39')]){_0xf3485['where']=_['merge'](_0xf3485['where'],{'$or':_[_0x3ebe('0x26')](_0xf3485[_0x3ebe('0x30')],function(_0x10cb57){var _0x2e728a={};_0x2e728a[_0x10cb57]={'$like':'%'+_0xea141e['query'][_0x3ebe('0x39')]+'%'};return _0x2e728a;})});}_0xf3485=_[_0x3ebe('0x3a')]({},_0xf3485,_0xea141e['options']);return _0x7a8c70[_0x3ebe('0x47')](_0xf3485);}})['then'](function(_0x48bd0a){if(_0x48bd0a){_0x29c92a=_0x48bd0a[_0x3ebe('0x32')];if(!_0xea141e[_0x3ebe('0x2e')][_0x3ebe('0x4a')](_0x3ebe('0x33'))){_0xf3485[_0x3ebe('0x1d')]=qs[_0x3ebe('0x1d')](_0xea141e[_0x3ebe('0x2e')][_0x3ebe('0x1d')]);_0xf3485[_0x3ebe('0x1c')]=qs['offset'](_0xea141e[_0x3ebe('0x2e')][_0x3ebe('0x1c')]);}return _0x7a8c70[_0x3ebe('0x47')](_0xf3485);}})[_0x3ebe('0x22')](function(_0x5e452a){if(_0x5e452a){return _0x5e452a?{'count':_0x29c92a,'rows':_0x5e452a}:null;}})[_0x3ebe('0x22')](respondWithResult(_0x235a93,null))[_0x3ebe('0x41')](handleError(_0x235a93,null));};exports[_0x3ebe('0x4b')]=function(_0x252a33,_0xfb965d,_0x1de665){var _0x4aa154={};var _0x10a021={};var _0x11491b;var _0x3ab86d;return db[_0x3ebe('0x3d')]['findOne']({'where':{'id':_0x252a33[_0x3ebe('0x43')]['id']}})[_0x3ebe('0x22')](handleEntityNotFound(_0xfb965d,null))['then'](function(_0x1b7210){if(_0x1b7210){_0x11491b=_0x1b7210;_0x10a021[_0x3ebe('0x2b')]=_[_0x3ebe('0x2d')](db['ZohoField'][_0x3ebe('0x27')]);_0x10a021['query']=_['keys'](_0x252a33['query']);_0x10a021[_0x3ebe('0x37')]=_[_0x3ebe('0x2f')](_0x10a021[_0x3ebe('0x2b')],_0x10a021[_0x3ebe('0x2e')]);_0x4aa154[_0x3ebe('0x30')]=_[_0x3ebe('0x2f')](_0x10a021[_0x3ebe('0x2b')],qs[_0x3ebe('0x31')](_0x252a33[_0x3ebe('0x2e')]['fields']));_0x4aa154[_0x3ebe('0x30')]=_0x4aa154['attributes'][_0x3ebe('0x32')]?_0x4aa154[_0x3ebe('0x30')]:_0x10a021[_0x3ebe('0x2b')];_0x4aa154[_0x3ebe('0x34')]=qs[_0x3ebe('0x35')](_0x252a33[_0x3ebe('0x2e')][_0x3ebe('0x35')]);_0x4aa154[_0x3ebe('0x36')]=qs[_0x3ebe('0x37')](_[_0x3ebe('0x38')](_0x252a33[_0x3ebe('0x2e')],_0x10a021[_0x3ebe('0x37')]));if(_0x252a33[_0x3ebe('0x2e')][_0x3ebe('0x39')]){_0x4aa154['where']=_['merge'](_0x4aa154['where'],{'$or':_['map'](_0x4aa154[_0x3ebe('0x30')],function(_0x13f85c){var _0x547538={};_0x547538[_0x13f85c]={'$like':'%'+_0x252a33[_0x3ebe('0x2e')][_0x3ebe('0x39')]+'%'};return _0x547538;})});}_0x4aa154=_[_0x3ebe('0x3a')]({},_0x4aa154,_0x252a33['options']);return _0x11491b['getSubjects'](_0x4aa154);}})[_0x3ebe('0x22')](function(_0x32a461){if(_0x32a461){_0x3ab86d=_0x32a461[_0x3ebe('0x32')];if(!_0x252a33[_0x3ebe('0x2e')][_0x3ebe('0x4a')](_0x3ebe('0x33'))){_0x4aa154[_0x3ebe('0x1d')]=qs[_0x3ebe('0x1d')](_0x252a33[_0x3ebe('0x2e')][_0x3ebe('0x1d')]);_0x4aa154[_0x3ebe('0x1c')]=qs[_0x3ebe('0x1c')](_0x252a33[_0x3ebe('0x2e')]['offset']);}return _0x11491b[_0x3ebe('0x4b')](_0x4aa154);}})[_0x3ebe('0x22')](function(_0x10c94f){if(_0x10c94f){return _0x10c94f?{'count':_0x3ab86d,'rows':_0x10c94f}:null;}})[_0x3ebe('0x22')](respondWithResult(_0xfb965d,null))[_0x3ebe('0x41')](handleError(_0xfb965d,null));};exports[_0x3ebe('0x4c')]=function(_0xa59fa,_0x23970b,_0x5607e7){var _0x21ba28={};var _0x41c3d5={};var _0x297c70;var _0xffd702;return db[_0x3ebe('0x3d')]['findOne']({'where':{'id':_0xa59fa[_0x3ebe('0x43')]['id']}})[_0x3ebe('0x22')](handleEntityNotFound(_0x23970b,null))[_0x3ebe('0x22')](function(_0x40fc09){if(_0x40fc09){_0x297c70=_0x40fc09;_0x41c3d5[_0x3ebe('0x2b')]=_['keys'](db[_0x3ebe('0x49')][_0x3ebe('0x27')]);_0x41c3d5[_0x3ebe('0x2e')]=_[_0x3ebe('0x2d')](_0xa59fa[_0x3ebe('0x2e')]);_0x41c3d5[_0x3ebe('0x37')]=_[_0x3ebe('0x2f')](_0x41c3d5[_0x3ebe('0x2b')],_0x41c3d5[_0x3ebe('0x2e')]);_0x21ba28[_0x3ebe('0x30')]=_[_0x3ebe('0x2f')](_0x41c3d5['model'],qs[_0x3ebe('0x31')](_0xa59fa[_0x3ebe('0x2e')][_0x3ebe('0x31')]));_0x21ba28[_0x3ebe('0x30')]=_0x21ba28[_0x3ebe('0x30')][_0x3ebe('0x32')]?_0x21ba28[_0x3ebe('0x30')]:_0x41c3d5[_0x3ebe('0x2b')];_0x21ba28[_0x3ebe('0x34')]=qs['sort'](_0xa59fa['query']['sort']);_0x21ba28[_0x3ebe('0x36')]=qs['filters'](_[_0x3ebe('0x38')](_0xa59fa[_0x3ebe('0x2e')],_0x41c3d5[_0x3ebe('0x37')]));if(_0xa59fa[_0x3ebe('0x2e')]['filter']){_0x21ba28[_0x3ebe('0x36')]=_[_0x3ebe('0x3a')](_0x21ba28[_0x3ebe('0x36')],{'$or':_['map'](_0x21ba28[_0x3ebe('0x30')],function(_0x524793){var _0x24752b={};_0x24752b[_0x524793]={'$like':'%'+_0xa59fa[_0x3ebe('0x2e')][_0x3ebe('0x39')]+'%'};return _0x24752b;})});}_0x21ba28=_[_0x3ebe('0x3a')]({},_0x21ba28,_0xa59fa[_0x3ebe('0x3c')]);return _0x297c70[_0x3ebe('0x4c')](_0x21ba28);}})['then'](function(_0x4085b3){if(_0x4085b3){_0xffd702=_0x4085b3[_0x3ebe('0x32')];if(!_0xa59fa[_0x3ebe('0x2e')][_0x3ebe('0x4a')]('nolimit')){_0x21ba28[_0x3ebe('0x1d')]=qs[_0x3ebe('0x1d')](_0xa59fa['query'][_0x3ebe('0x1d')]);_0x21ba28['offset']=qs[_0x3ebe('0x1c')](_0xa59fa[_0x3ebe('0x2e')]['offset']);}return _0x297c70[_0x3ebe('0x4c')](_0x21ba28);}})['then'](function(_0x2299c8){if(_0x2299c8){return _0x2299c8?{'count':_0xffd702,'rows':_0x2299c8}:null;}})['then'](respondWithResult(_0x23970b,null))[_0x3ebe('0x41')](handleError(_0x23970b,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 7a927e5..6e22bca 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 _0x7780=['int_zoho_configurations','../../config/logger','moment','bluebird','path','./intZohoConfiguration.attributes','exports','define'];(function(_0x41a76c,_0x3c97a1){var _0x338ff8=function(_0x1c6c99){while(--_0x1c6c99){_0x41a76c['push'](_0x41a76c['shift']());}};_0x338ff8(++_0x3c97a1);}(_0x7780,0x139));var _0x0778=function(_0x88281e,_0x502f0b){_0x88281e=_0x88281e-0x0;var _0x4c8edf=_0x7780[_0x88281e];return _0x4c8edf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0778('0x0'))('api');var moment=require(_0x0778('0x1'));var BPromise=require(_0x0778('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0778('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0778('0x4'));module[_0x0778('0x5')]=function(_0x52ae93,_0x2bf33a){return _0x52ae93[_0x0778('0x6')]('ZohoConfiguration',attributes,{'tableName':_0x0778('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf04b=['./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x7feb90,_0x28e700){var _0x3c5b33=function(_0x113cfa){while(--_0x113cfa){_0x7feb90['push'](_0x7feb90['shift']());}};_0x3c5b33(++_0x28e700);}(_0xf04b,0x88));var _0xbf04=function(_0x4a5a9f,_0xb63223){_0x4a5a9f=_0x4a5a9f-0x0;var _0x1b086e=_0xf04b[_0x4a5a9f];return _0x1b086e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbf04('0x0'))(_0xbf04('0x1'));var moment=require(_0xbf04('0x2'));var BPromise=require(_0xbf04('0x3'));var rp=require(_0xbf04('0x4'));var fs=require('fs');var path=require(_0xbf04('0x5'));var rimraf=require(_0xbf04('0x6'));var config=require(_0xbf04('0x7'));var attributes=require(_0xbf04('0x8'));module[_0xbf04('0x9')]=function(_0x308762,_0x1d2d53){return _0x308762['define'](_0xbf04('0xa'),attributes,{'tableName':_0xbf04('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 29db328..8117ed3 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 _0x29e1=['bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util'];(function(_0x5c2bcf,_0x50fe61){var _0x3819d0=function(_0x1d2261){while(--_0x1d2261){_0x5c2bcf['push'](_0x5c2bcf['shift']());}};_0x3819d0(++_0x50fe61);}(_0x29e1,0x12a));var _0x129e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29e1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x129e('0x0'));var util=require(_0x129e('0x1'));var moment=require('moment');var BPromise=require(_0x129e('0x2'));var rs=require(_0x129e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x129e('0x4'))(_0x129e('0x5'));var config=require(_0x129e('0x6'));var jayson=require(_0x129e('0x7'));var client=jayson['client'][_0x129e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x778e35,_0x140795,_0x5cd6bd){return new BPromise(function(_0xcff0aa,_0xf2ac83){return client[_0x129e('0x9')](_0x778e35,_0x5cd6bd)[_0x129e('0xa')](function(_0xe4efb3){logger[_0x129e('0xb')](_0x129e('0xc'),_0x140795,'request\x20sent');logger[_0x129e('0xd')](_0x129e('0xe'),_0x140795,_0x129e('0xf'),JSON['stringify'](_0xe4efb3));if(_0xe4efb3[_0x129e('0x10')]){if(_0xe4efb3[_0x129e('0x10')]['code']===0x1f4){logger[_0x129e('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x140795,_0xe4efb3[_0x129e('0x10')][_0x129e('0x11')]);return _0xf2ac83(_0xe4efb3[_0x129e('0x10')]['message']);}logger[_0x129e('0x10')](_0x129e('0xc'),_0x140795,_0xe4efb3[_0x129e('0x10')][_0x129e('0x11')]);return _0xcff0aa(_0xe4efb3[_0x129e('0x10')][_0x129e('0x11')]);}else{logger[_0x129e('0xb')](_0x129e('0xc'),_0x140795,'request\x20sent');_0xcff0aa(_0xe4efb3[_0x129e('0x12')][_0x129e('0x11')]);}})[_0x129e('0x13')](function(_0x1d5adf){logger[_0x129e('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x140795,_0x1d5adf);_0xf2ac83(_0x1d5adf);});});} \ No newline at end of file +var _0xe3ac=['randomstring','ioredis','../../mysqldb','rpc','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xe3ac,0x1a0));var _0xce3a=function(_0x5f102e,_0x9fe29c){_0x5f102e=_0x5f102e-0x0;var _0x51d157=_0xe3ac[_0x5f102e];return _0x51d157;};'use strict';var _=require(_0xce3a('0x0'));var util=require(_0xce3a('0x1'));var moment=require(_0xce3a('0x2'));var BPromise=require(_0xce3a('0x3'));var rs=require(_0xce3a('0x4'));var fs=require('fs');var Redis=require(_0xce3a('0x5'));var db=require(_0xce3a('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xce3a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xce3a('0x8')][_0xce3a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bcd69,_0x3caf1a,_0x46fe59){return new BPromise(function(_0x468382,_0x26f5a2){return client[_0xce3a('0xa')](_0x2bcd69,_0x46fe59)[_0xce3a('0xb')](function(_0x374d26){logger[_0xce3a('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x3caf1a,'request\x20sent');logger['debug'](_0xce3a('0xd'),_0x3caf1a,_0xce3a('0xe'),JSON['stringify'](_0x374d26));if(_0x374d26[_0xce3a('0xf')]){if(_0x374d26[_0xce3a('0xf')]['code']===0x1f4){logger[_0xce3a('0xf')](_0xce3a('0x10'),_0x3caf1a,_0x374d26[_0xce3a('0xf')][_0xce3a('0x11')]);return _0x26f5a2(_0x374d26['error'][_0xce3a('0x11')]);}logger[_0xce3a('0xf')](_0xce3a('0x10'),_0x3caf1a,_0x374d26[_0xce3a('0xf')]['message']);return _0x468382(_0x374d26[_0xce3a('0xf')][_0xce3a('0x11')]);}else{logger[_0xce3a('0xc')](_0xce3a('0x10'),_0x3caf1a,'request\x20sent');_0x468382(_0x374d26[_0xce3a('0x12')][_0xce3a('0x11')]);}})[_0xce3a('0x13')](function(_0x5a8e34){logger['error'](_0xce3a('0x10'),_0x3caf1a,_0x5a8e34);_0x26f5a2(_0x5a8e34);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 52a9426..72ca88b 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 _0xec93=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xec93,0x138));var _0x3ec9=function(_0x4c2406,_0x1de04d){_0x4c2406=_0x4c2406-0x0;var _0x344f78=_0xec93[_0x4c2406];return _0x344f78;};'use strict';var multer=require(_0x3ec9('0x0'));var util=require(_0x3ec9('0x1'));var path=require('path');var timeout=require(_0x3ec9('0x2'));var express=require(_0x3ec9('0x3'));var router=express[_0x3ec9('0x4')]();var fs_extra=require(_0x3ec9('0x5'));var auth=require(_0x3ec9('0x6'));var interaction=require(_0x3ec9('0x7'));var config=require(_0x3ec9('0x8'));var controller=require('./intZohoField.controller');router[_0x3ec9('0x9')]('/',auth[_0x3ec9('0xa')](),controller[_0x3ec9('0xb')]);router[_0x3ec9('0x9')](_0x3ec9('0xc'),auth[_0x3ec9('0xa')](),controller[_0x3ec9('0xd')]);router[_0x3ec9('0xe')]('/',auth[_0x3ec9('0xa')](),controller[_0x3ec9('0xf')]);router[_0x3ec9('0x10')]('/:id',auth[_0x3ec9('0xa')](),controller[_0x3ec9('0x11')]);router[_0x3ec9('0x12')](_0x3ec9('0xc'),auth[_0x3ec9('0xa')](),controller[_0x3ec9('0x13')]);module[_0x3ec9('0x14')]=router; \ No newline at end of file +var _0xf742=['isAuthenticated','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','/:id','show','create','put'];(function(_0x4d0918,_0x5c085e){var _0x59c6ac=function(_0x543396){while(--_0x543396){_0x4d0918['push'](_0x4d0918['shift']());}};_0x59c6ac(++_0x5c085e);}(_0xf742,0x1a6));var _0x2f74=function(_0xa90159,_0x56bb62){_0xa90159=_0xa90159-0x0;var _0x5bbe39=_0xf742[_0xa90159];return _0x5bbe39;};'use strict';var multer=require(_0x2f74('0x0'));var util=require(_0x2f74('0x1'));var path=require(_0x2f74('0x2'));var timeout=require('connect-timeout');var express=require(_0x2f74('0x3'));var router=express[_0x2f74('0x4')]();var fs_extra=require(_0x2f74('0x5'));var auth=require(_0x2f74('0x6'));var interaction=require(_0x2f74('0x7'));var config=require(_0x2f74('0x8'));var controller=require(_0x2f74('0x9'));router[_0x2f74('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2f74('0xa')](_0x2f74('0xb'),auth['isAuthenticated'](),controller[_0x2f74('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2f74('0xd')]);router[_0x2f74('0xe')]('/:id',auth[_0x2f74('0xf')](),controller['update']);router[_0x2f74('0x10')](_0x2f74('0xb'),auth[_0x2f74('0xf')](),controller[_0x2f74('0x11')]);module[_0x2f74('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 2b560bf..4ecc171 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 _0x3014=['string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x87f63d,_0x2f42ff){var _0xd17f15=function(_0xd834b2){while(--_0xd834b2){_0x87f63d['push'](_0x87f63d['shift']());}};_0xd17f15(++_0x2f42ff);}(_0x3014,0x1b5));var _0x4301=function(_0x54bd74,_0x34bce1){_0x54bd74=_0x54bd74-0x0;var _0x3e22a9=_0x3014[_0x54bd74];return _0x3e22a9;};'use strict';var Sequelize=require(_0x4301('0x0'));module[_0x4301('0x1')]={'type':{'type':Sequelize[_0x4301('0x2')](_0x4301('0x3'),'variable',_0x4301('0x4'),_0x4301('0x5'),_0x4301('0x6')),'defaultValue':_0x4301('0x3')},'content':{'type':Sequelize[_0x4301('0x7')]},'key':{'type':Sequelize[_0x4301('0x7')]},'keyType':{'type':Sequelize[_0x4301('0x2')]('string',_0x4301('0x8'),_0x4301('0x4'))},'keyContent':{'type':Sequelize[_0x4301('0x7')]},'idField':{'type':Sequelize[_0x4301('0x7')]},'nameField':{'type':Sequelize[_0x4301('0x7')]},'customField':{'type':Sequelize[_0x4301('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4301('0x7')]}}; \ No newline at end of file +var _0xdbf4=['customVariable','BOOLEAN','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0x507458,_0x1096bf){var _0x5f43ad=function(_0x36cfb1){while(--_0x36cfb1){_0x507458['push'](_0x507458['shift']());}};_0x5f43ad(++_0x1096bf);}(_0xdbf4,0xaa));var _0x4dbf=function(_0x487199,_0x2f010a){_0x487199=_0x487199-0x0;var _0x25a55c=_0xdbf4[_0x487199];return _0x25a55c;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x4dbf('0x0')](_0x4dbf('0x1'),_0x4dbf('0x2'),'customVariable',_0x4dbf('0x3'),_0x4dbf('0x4')),'defaultValue':_0x4dbf('0x1')},'content':{'type':Sequelize[_0x4dbf('0x5')]},'key':{'type':Sequelize[_0x4dbf('0x5')]},'keyType':{'type':Sequelize[_0x4dbf('0x0')](_0x4dbf('0x1'),_0x4dbf('0x2'),_0x4dbf('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4dbf('0x5')]},'customField':{'type':Sequelize[_0x4dbf('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4dbf('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index d6068eb..c627b82 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 _0xb991=['ZohoField','fieldName','key','model','query','intersection','attributes','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','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','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map'];(function(_0x591413,_0x1a2950){var _0x5155ea=function(_0x31f5de){while(--_0x31f5de){_0x591413['push'](_0x591413['shift']());}};_0x5155ea(++_0x1a2950);}(_0xb991,0x69));var _0x1b99=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0xb991[_0x4914e2];return _0x2dcd07;};'use strict';var emlformat=require(_0x1b99('0x0'));var rimraf=require(_0x1b99('0x1'));var zipdir=require(_0x1b99('0x2'));var jsonpatch=require(_0x1b99('0x3'));var rp=require(_0x1b99('0x4'));var moment=require(_0x1b99('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1b99('0x6'));var util=require(_0x1b99('0x7'));var path=require(_0x1b99('0x8'));var sox=require(_0x1b99('0x9'));var csv=require(_0x1b99('0xa'));var ejs=require(_0x1b99('0xb'));var fs=require('fs');var fs_extra=require(_0x1b99('0xc'));var _=require(_0x1b99('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1b99('0xe'));var deskjs=require(_0x1b99('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1b99('0x10'));var Redis=require(_0x1b99('0x11'));var authService=require(_0x1b99('0x12'));var qs=require(_0x1b99('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b99('0x14'));var logger=require(_0x1b99('0x15'))(_0x1b99('0x16'));var utils=require(_0x1b99('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1b99('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x117a73,_0x269d98){_0x269d98=_0x269d98||0xcc;return function(_0x16b793){if(_0x16b793){return _0x117a73[_0x1b99('0x19')](_0x269d98);}return _0x117a73[_0x1b99('0x1a')](_0x269d98)[_0x1b99('0x1b')]();};}function respondWithResult(_0x1919cb,_0x574b69){_0x574b69=_0x574b69||0xc8;return function(_0x3079d9){if(_0x3079d9){return _0x1919cb['status'](_0x574b69)[_0x1b99('0x1c')](_0x3079d9);}};}function respondWithFilteredResult(_0x1f2945,_0x41b7e2){return function(_0x4a3a65){if(_0x4a3a65){var _0x15cbcc=typeof _0x41b7e2['offset']===_0x1b99('0x1d')&&typeof _0x41b7e2[_0x1b99('0x1e')]===_0x1b99('0x1d');var _0x1af21c=_0x4a3a65[_0x1b99('0x1f')];var _0x4e219e=_0x15cbcc?0x0:_0x41b7e2[_0x1b99('0x20')];var _0x480e94=_0x15cbcc?_0x4a3a65[_0x1b99('0x1f')]:_0x41b7e2[_0x1b99('0x20')]+_0x41b7e2[_0x1b99('0x1e')];var _0xe00fd0;if(_0x480e94>=_0x1af21c){_0x480e94=_0x1af21c;_0xe00fd0=0xc8;}else{_0xe00fd0=0xce;}_0x1f2945[_0x1b99('0x1a')](_0xe00fd0);return _0x1f2945[_0x1b99('0x21')](_0x1b99('0x22'),_0x4e219e+'-'+_0x480e94+'/'+_0x1af21c)[_0x1b99('0x1c')](_0x4a3a65);}return null;};}function patchUpdates(_0x392a9a){return function(_0x2641e6){try{jsonpatch['apply'](_0x2641e6,_0x392a9a,!![]);}catch(_0x5974a8){return BPromise[_0x1b99('0x23')](_0x5974a8);}return _0x2641e6[_0x1b99('0x24')]();};}function saveUpdates(_0x20d838,_0x558d7b){return function(_0x496d2d){if(_0x496d2d){return _0x496d2d[_0x1b99('0x25')](_0x20d838)[_0x1b99('0x26')](function(_0x1b8cf7){return _0x1b8cf7;});}return null;};}function removeEntity(_0x460d6c,_0x10406b){return function(_0x419937){if(_0x419937){return _0x419937[_0x1b99('0x27')]()[_0x1b99('0x26')](function(){_0x460d6c['status'](0xcc)[_0x1b99('0x1b')]();});}};}function handleEntityNotFound(_0x77db4a,_0x5a74c2){return function(_0x347251){if(!_0x347251){_0x77db4a[_0x1b99('0x19')](0x194);}return _0x347251;};}function handleError(_0x2cddb0,_0x51a923){_0x51a923=_0x51a923||0x1f4;return function(_0x176389){logger[_0x1b99('0x28')](_0x176389['stack']);if(_0x176389[_0x1b99('0x29')]){delete _0x176389['name'];}_0x2cddb0[_0x1b99('0x1a')](_0x51a923)[_0x1b99('0x2a')](_0x176389);};}exports[_0x1b99('0x2b')]=function(_0x394916,_0x5052cc){var _0x440778={},_0x19373b={},_0x2afc5b={'count':0x0,'rows':[]};var _0x3262f7=_[_0x1b99('0x2c')](db[_0x1b99('0x2d')]['rawAttributes'],function(_0x13988a){return{'name':_0x13988a[_0x1b99('0x2e')],'type':_0x13988a['type'][_0x1b99('0x2f')]};});_0x19373b[_0x1b99('0x30')]=_[_0x1b99('0x2c')](_0x3262f7,_0x1b99('0x29'));_0x19373b[_0x1b99('0x31')]=_['keys'](_0x394916[_0x1b99('0x31')]);_0x19373b['filters']=_['intersection'](_0x19373b[_0x1b99('0x30')],_0x19373b['query']);_0x440778['attributes']=_[_0x1b99('0x32')](_0x19373b['model'],qs['fields'](_0x394916['query']['fields']));_0x440778['attributes']=_0x440778[_0x1b99('0x33')]['length']?_0x440778[_0x1b99('0x33')]:_0x19373b[_0x1b99('0x30')];if(!_0x394916['query'][_0x1b99('0x34')](_0x1b99('0x35'))){_0x440778[_0x1b99('0x1e')]=qs[_0x1b99('0x1e')](_0x394916['query'][_0x1b99('0x1e')]);_0x440778[_0x1b99('0x20')]=qs[_0x1b99('0x20')](_0x394916[_0x1b99('0x31')][_0x1b99('0x20')]);}_0x440778['order']=qs[_0x1b99('0x36')](_0x394916[_0x1b99('0x31')][_0x1b99('0x36')]);_0x440778[_0x1b99('0x37')]=qs[_0x1b99('0x38')](_['pick'](_0x394916[_0x1b99('0x31')],_0x19373b[_0x1b99('0x38')]),_0x3262f7);if(_0x394916[_0x1b99('0x31')][_0x1b99('0x39')]){_0x440778[_0x1b99('0x37')]=_[_0x1b99('0x3a')](_0x440778[_0x1b99('0x37')],{'$or':_['map'](_0x3262f7,function(_0x701498){if(_0x701498[_0x1b99('0x3b')]!==_0x1b99('0x3c')){var _0x3367c1={};_0x3367c1[_0x701498['name']]={'$like':'%'+_0x394916['query'][_0x1b99('0x39')]+'%'};return _0x3367c1;}})});}_0x440778=_[_0x1b99('0x3a')]({},_0x440778,_0x394916[_0x1b99('0x3d')]);var _0x5236e3={'where':_0x440778[_0x1b99('0x37')]};return db['ZohoField']['count'](_0x5236e3)[_0x1b99('0x26')](function(_0x41b1b6){_0x2afc5b['count']=_0x41b1b6;if(_0x394916[_0x1b99('0x31')][_0x1b99('0x3e')]){_0x440778[_0x1b99('0x3f')]=[{'all':!![]}];}return db[_0x1b99('0x2d')][_0x1b99('0x40')](_0x440778);})['then'](function(_0x555960){_0x2afc5b[_0x1b99('0x41')]=_0x555960;return _0x2afc5b;})[_0x1b99('0x26')](respondWithFilteredResult(_0x5052cc,_0x440778))[_0x1b99('0x42')](handleError(_0x5052cc,null));};exports[_0x1b99('0x43')]=function(_0x27c48b,_0x1240ae){var _0x23dcee={'raw':!![],'where':{'id':_0x27c48b[_0x1b99('0x44')]['id']}},_0x12db83={};_0x12db83[_0x1b99('0x30')]=_[_0x1b99('0x45')](db[_0x1b99('0x2d')]['rawAttributes']);_0x12db83[_0x1b99('0x31')]=_['keys'](_0x27c48b[_0x1b99('0x31')]);_0x12db83[_0x1b99('0x38')]=_[_0x1b99('0x32')](_0x12db83[_0x1b99('0x30')],_0x12db83[_0x1b99('0x31')]);_0x23dcee[_0x1b99('0x33')]=_[_0x1b99('0x32')](_0x12db83[_0x1b99('0x30')],qs[_0x1b99('0x46')](_0x27c48b[_0x1b99('0x31')][_0x1b99('0x46')]));_0x23dcee[_0x1b99('0x33')]=_0x23dcee['attributes'][_0x1b99('0x47')]?_0x23dcee[_0x1b99('0x33')]:_0x12db83[_0x1b99('0x30')];if(_0x27c48b[_0x1b99('0x31')][_0x1b99('0x3e')]){_0x23dcee[_0x1b99('0x3f')]=[{'all':!![]}];}_0x23dcee=_[_0x1b99('0x3a')]({},_0x23dcee,_0x27c48b[_0x1b99('0x3d')]);return db[_0x1b99('0x2d')][_0x1b99('0x48')](_0x23dcee)[_0x1b99('0x26')](handleEntityNotFound(_0x1240ae,null))[_0x1b99('0x26')](respondWithResult(_0x1240ae,null))[_0x1b99('0x42')](handleError(_0x1240ae,null));};exports['create']=function(_0x4ac2a0,_0x31cf34){return db['ZohoField'][_0x1b99('0x49')](_0x4ac2a0[_0x1b99('0x4a')],{})['then'](respondWithResult(_0x31cf34,0xc9))['catch'](handleError(_0x31cf34,null));};exports['update']=function(_0x1992e5,_0x5f2e8a){if(_0x1992e5[_0x1b99('0x4a')]['id']){delete _0x1992e5[_0x1b99('0x4a')]['id'];}return db['ZohoField'][_0x1b99('0x48')]({'where':{'id':_0x1992e5[_0x1b99('0x44')]['id']}})[_0x1b99('0x26')](handleEntityNotFound(_0x5f2e8a,null))[_0x1b99('0x26')](saveUpdates(_0x1992e5['body'],null))[_0x1b99('0x26')](respondWithResult(_0x5f2e8a,null))['catch'](handleError(_0x5f2e8a,null));};exports[_0x1b99('0x27')]=function(_0x5e0d8d,_0x751245){return db[_0x1b99('0x2d')][_0x1b99('0x48')]({'where':{'id':_0x5e0d8d['params']['id']}})[_0x1b99('0x26')](handleEntityNotFound(_0x751245,null))['then'](removeEntity(_0x751245,null))[_0x1b99('0x42')](handleError(_0x751245,null));}; \ No newline at end of file +var _0x16af=['lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','stack','name','index','map','ZohoField','rawAttributes','type','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','options','includeAll','include','findAll','catch','show','intersection','merge','find','create','body','params','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0x16af,0x121));var _0xf16a=function(_0x5d1d2,_0x1fee47){_0x5d1d2=_0x5d1d2-0x0;var _0x5558f3=_0x16af[_0x5d1d2];return _0x5558f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf16a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf16a('0x1'));var rp=require(_0xf16a('0x2'));var moment=require(_0xf16a('0x3'));var BPromise=require(_0xf16a('0x4'));var Mustache=require(_0xf16a('0x5'));var util=require(_0xf16a('0x6'));var path=require(_0xf16a('0x7'));var sox=require(_0xf16a('0x8'));var csv=require('to-csv');var ejs=require(_0xf16a('0x9'));var fs=require('fs');var fs_extra=require(_0xf16a('0xa'));var _=require(_0xf16a('0xb'));var squel=require(_0xf16a('0xc'));var crypto=require(_0xf16a('0xd'));var jsforce=require(_0xf16a('0xe'));var deskjs=require(_0xf16a('0xf'));var toCsv=require(_0xf16a('0x10'));var querystring=require(_0xf16a('0x11'));var Papa=require(_0xf16a('0x12'));var Redis=require(_0xf16a('0x13'));var authService=require(_0xf16a('0x14'));var qs=require(_0xf16a('0x15'));var as=require(_0xf16a('0x16'));var hardwareService=require(_0xf16a('0x17'));var logger=require(_0xf16a('0x18'))('api');var utils=require(_0xf16a('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xf16a('0x1a'));var db=require(_0xf16a('0x1b'))['db'];function respondWithStatusCode(_0x229278,_0x4a526d){_0x4a526d=_0x4a526d||0xcc;return function(_0x49c509){if(_0x49c509){return _0x229278[_0xf16a('0x1c')](_0x4a526d);}return _0x229278[_0xf16a('0x1d')](_0x4a526d)[_0xf16a('0x1e')]();};}function respondWithResult(_0x168301,_0x29bfd8){_0x29bfd8=_0x29bfd8||0xc8;return function(_0x2ffcfc){if(_0x2ffcfc){return _0x168301[_0xf16a('0x1d')](_0x29bfd8)[_0xf16a('0x1f')](_0x2ffcfc);}};}function respondWithFilteredResult(_0x456f22,_0x308a86){return function(_0x3df552){if(_0x3df552){var _0x2fb675=typeof _0x308a86[_0xf16a('0x20')]===_0xf16a('0x21')&&typeof _0x308a86[_0xf16a('0x22')]===_0xf16a('0x21');var _0x39bb5d=_0x3df552[_0xf16a('0x23')];var _0x54358c=_0x2fb675?0x0:_0x308a86[_0xf16a('0x20')];var _0x4fa94d=_0x2fb675?_0x3df552['count']:_0x308a86[_0xf16a('0x20')]+_0x308a86['limit'];var _0x11cc54;if(_0x4fa94d>=_0x39bb5d){_0x4fa94d=_0x39bb5d;_0x11cc54=0xc8;}else{_0x11cc54=0xce;}_0x456f22['status'](_0x11cc54);return _0x456f22[_0xf16a('0x24')](_0xf16a('0x25'),_0x54358c+'-'+_0x4fa94d+'/'+_0x39bb5d)['json'](_0x3df552);}return null;};}function patchUpdates(_0x2bc8ea){return function(_0x24f5db){try{jsonpatch['apply'](_0x24f5db,_0x2bc8ea,!![]);}catch(_0x5ea6b6){return BPromise['reject'](_0x5ea6b6);}return _0x24f5db[_0xf16a('0x26')]();};}function saveUpdates(_0x29df80,_0x229bce){return function(_0x166e5c){if(_0x166e5c){return _0x166e5c[_0xf16a('0x27')](_0x29df80)[_0xf16a('0x28')](function(_0x4e5b8){return _0x4e5b8;});}return null;};}function removeEntity(_0x122055,_0x4e8ece){return function(_0x2f4333){if(_0x2f4333){return _0x2f4333['destroy']()[_0xf16a('0x28')](function(){_0x122055[_0xf16a('0x1d')](0xcc)[_0xf16a('0x1e')]();});}};}function handleEntityNotFound(_0x5a3c24,_0x5e2651){return function(_0x330b2a){if(!_0x330b2a){_0x5a3c24[_0xf16a('0x1c')](0x194);}return _0x330b2a;};}function handleError(_0x2b00d0,_0x35ffdf){_0x35ffdf=_0x35ffdf||0x1f4;return function(_0x20560e){logger[_0xf16a('0x29')](_0x20560e[_0xf16a('0x2a')]);if(_0x20560e[_0xf16a('0x2b')]){delete _0x20560e[_0xf16a('0x2b')];}_0x2b00d0['status'](_0x35ffdf)['send'](_0x20560e);};}exports[_0xf16a('0x2c')]=function(_0x856055,_0x52e77c){var _0x39b422={},_0x2b959e={},_0x52e666={'count':0x0,'rows':[]};var _0x46d9ff=_[_0xf16a('0x2d')](db[_0xf16a('0x2e')][_0xf16a('0x2f')],function(_0x2c8099){return{'name':_0x2c8099['fieldName'],'type':_0x2c8099[_0xf16a('0x30')]['key']};});_0x2b959e[_0xf16a('0x31')]=_[_0xf16a('0x2d')](_0x46d9ff,_0xf16a('0x2b'));_0x2b959e['query']=_[_0xf16a('0x32')](_0x856055[_0xf16a('0x33')]);_0x2b959e['filters']=_['intersection'](_0x2b959e['model'],_0x2b959e['query']);_0x39b422[_0xf16a('0x34')]=_['intersection'](_0x2b959e[_0xf16a('0x31')],qs['fields'](_0x856055[_0xf16a('0x33')][_0xf16a('0x35')]));_0x39b422[_0xf16a('0x34')]=_0x39b422[_0xf16a('0x34')][_0xf16a('0x36')]?_0x39b422[_0xf16a('0x34')]:_0x2b959e['model'];if(!_0x856055[_0xf16a('0x33')][_0xf16a('0x37')](_0xf16a('0x38'))){_0x39b422[_0xf16a('0x22')]=qs[_0xf16a('0x22')](_0x856055[_0xf16a('0x33')][_0xf16a('0x22')]);_0x39b422[_0xf16a('0x20')]=qs[_0xf16a('0x20')](_0x856055[_0xf16a('0x33')]['offset']);}_0x39b422[_0xf16a('0x39')]=qs['sort'](_0x856055[_0xf16a('0x33')][_0xf16a('0x3a')]);_0x39b422[_0xf16a('0x3b')]=qs[_0xf16a('0x3c')](_[_0xf16a('0x3d')](_0x856055[_0xf16a('0x33')],_0x2b959e[_0xf16a('0x3c')]),_0x46d9ff);if(_0x856055[_0xf16a('0x33')]['filter']){_0x39b422[_0xf16a('0x3b')]=_['merge'](_0x39b422[_0xf16a('0x3b')],{'$or':_[_0xf16a('0x2d')](_0x46d9ff,function(_0x2b6b56){if(_0x2b6b56['type']!=='VIRTUAL'){var _0x1854fb={};_0x1854fb[_0x2b6b56['name']]={'$like':'%'+_0x856055[_0xf16a('0x33')]['filter']+'%'};return _0x1854fb;}})});}_0x39b422=_['merge']({},_0x39b422,_0x856055[_0xf16a('0x3e')]);var _0x26aac3={'where':_0x39b422[_0xf16a('0x3b')]};return db[_0xf16a('0x2e')]['count'](_0x26aac3)[_0xf16a('0x28')](function(_0x1a44af){_0x52e666[_0xf16a('0x23')]=_0x1a44af;if(_0x856055[_0xf16a('0x33')][_0xf16a('0x3f')]){_0x39b422[_0xf16a('0x40')]=[{'all':!![]}];}return db[_0xf16a('0x2e')][_0xf16a('0x41')](_0x39b422);})[_0xf16a('0x28')](function(_0x519083){_0x52e666['rows']=_0x519083;return _0x52e666;})[_0xf16a('0x28')](respondWithFilteredResult(_0x52e77c,_0x39b422))[_0xf16a('0x42')](handleError(_0x52e77c,null));};exports[_0xf16a('0x43')]=function(_0x3a506b,_0x1e5003){var _0x50cc74={'raw':!![],'where':{'id':_0x3a506b['params']['id']}},_0x3197f8={};_0x3197f8['model']=_['keys'](db[_0xf16a('0x2e')]['rawAttributes']);_0x3197f8['query']=_['keys'](_0x3a506b[_0xf16a('0x33')]);_0x3197f8['filters']=_['intersection'](_0x3197f8['model'],_0x3197f8[_0xf16a('0x33')]);_0x50cc74[_0xf16a('0x34')]=_[_0xf16a('0x44')](_0x3197f8['model'],qs[_0xf16a('0x35')](_0x3a506b[_0xf16a('0x33')][_0xf16a('0x35')]));_0x50cc74[_0xf16a('0x34')]=_0x50cc74[_0xf16a('0x34')][_0xf16a('0x36')]?_0x50cc74['attributes']:_0x3197f8[_0xf16a('0x31')];if(_0x3a506b[_0xf16a('0x33')]['includeAll']){_0x50cc74[_0xf16a('0x40')]=[{'all':!![]}];}_0x50cc74=_[_0xf16a('0x45')]({},_0x50cc74,_0x3a506b['options']);return db['ZohoField'][_0xf16a('0x46')](_0x50cc74)[_0xf16a('0x28')](handleEntityNotFound(_0x1e5003,null))['then'](respondWithResult(_0x1e5003,null))[_0xf16a('0x42')](handleError(_0x1e5003,null));};exports[_0xf16a('0x47')]=function(_0x4df4c1,_0x3a486e){return db[_0xf16a('0x2e')][_0xf16a('0x47')](_0x4df4c1[_0xf16a('0x48')],{})[_0xf16a('0x28')](respondWithResult(_0x3a486e,0xc9))[_0xf16a('0x42')](handleError(_0x3a486e,null));};exports[_0xf16a('0x27')]=function(_0x1479d2,_0x14fd44){if(_0x1479d2['body']['id']){delete _0x1479d2[_0xf16a('0x48')]['id'];}return db[_0xf16a('0x2e')][_0xf16a('0x46')]({'where':{'id':_0x1479d2[_0xf16a('0x49')]['id']}})[_0xf16a('0x28')](handleEntityNotFound(_0x14fd44,null))[_0xf16a('0x28')](saveUpdates(_0x1479d2[_0xf16a('0x48')],null))[_0xf16a('0x28')](respondWithResult(_0x14fd44,null))[_0xf16a('0x42')](handleError(_0x14fd44,null));};exports[_0xf16a('0x4a')]=function(_0x49c47d,_0x18f922){return db[_0xf16a('0x2e')]['find']({'where':{'id':_0x49c47d[_0xf16a('0x49')]['id']}})[_0xf16a('0x28')](handleEntityNotFound(_0x18f922,null))['then'](removeEntity(_0x18f922,null))['catch'](handleError(_0x18f922,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 3ce70e2..bef1fcf 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 _0x8aad=['request-promise','../../config/environment','define','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','api','bluebird'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x8aad,0x146));var _0xd8aa=function(_0x12a2d2,_0x2f7630){_0x12a2d2=_0x12a2d2-0x0;var _0x3df1f6=_0x8aad[_0x12a2d2];return _0x3df1f6;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var logger=require('../../config/logger')(_0xd8aa('0x2'));var moment=require('moment');var BPromise=require(_0xd8aa('0x3'));var rp=require(_0xd8aa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd8aa('0x5'));var attributes=require('./intZohoField.attributes');module['exports']=function(_0x16b648,_0x43ddeb){return _0x16b648[_0xd8aa('0x6')]('ZohoField',attributes,{'tableName':_0xd8aa('0x7'),'paranoid':![],'indexes':[{'name':_0xd8aa('0x8'),'fields':[_0xd8aa('0x9'),_0xd8aa('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0120=['rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3b9007,_0x482404){var _0xfe01e7=function(_0x199ebf){while(--_0x199ebf){_0x3b9007['push'](_0x3b9007['shift']());}};_0xfe01e7(++_0x482404);}(_0x0120,0x6f));var _0x0012=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0120[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var logger=require(_0x0012('0x2'))(_0x0012('0x3'));var moment=require(_0x0012('0x4'));var BPromise=require(_0x0012('0x5'));var rp=require(_0x0012('0x6'));var fs=require('fs');var path=require(_0x0012('0x7'));var rimraf=require(_0x0012('0x8'));var config=require(_0x0012('0x9'));var attributes=require(_0x0012('0xa'));module[_0x0012('0xb')]=function(_0x4eaa5b,_0x4b396c){return _0x4eaa5b['define'](_0x0012('0xc'),attributes,{'tableName':_0x0012('0xd'),'paranoid':![],'indexes':[{'name':_0x0012('0xe'),'fields':[_0x0012('0xf'),_0x0012('0x10')],'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 5051610..ed4d557 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 _0x01c6=['debug','stringify','error','ZohoField,\x20%s,\x20%s','message','info','catch','lodash','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent'];(function(_0x590ebe,_0x1b2a98){var _0x3ffe78=function(_0x222409){while(--_0x222409){_0x590ebe['push'](_0x590ebe['shift']());}};_0x3ffe78(++_0x1b2a98);}(_0x01c6,0x17d));var _0x601c=function(_0x334599,_0x4b1cfa){_0x334599=_0x334599-0x0;var _0x4cdff2=_0x01c6[_0x334599];return _0x4cdff2;};'use strict';var _=require(_0x601c('0x0'));var util=require('util');var moment=require(_0x601c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x601c('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x601c('0x3'))(_0x601c('0x4'));var config=require('../../config/environment');var jayson=require(_0x601c('0x5'));var client=jayson[_0x601c('0x6')][_0x601c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16aa20,_0x34d8a3,_0x2d958c){return new BPromise(function(_0x1334fc,_0x280f32){return client[_0x601c('0x8')](_0x16aa20,_0x2d958c)['then'](function(_0x20f3f8){logger['info']('ZohoField,\x20%s,\x20%s',_0x34d8a3,_0x601c('0x9'));logger[_0x601c('0xa')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x34d8a3,'request\x20sent',JSON[_0x601c('0xb')](_0x20f3f8));if(_0x20f3f8['error']){if(_0x20f3f8[_0x601c('0xc')]['code']===0x1f4){logger['error'](_0x601c('0xd'),_0x34d8a3,_0x20f3f8[_0x601c('0xc')][_0x601c('0xe')]);return _0x280f32(_0x20f3f8[_0x601c('0xc')][_0x601c('0xe')]);}logger[_0x601c('0xc')](_0x601c('0xd'),_0x34d8a3,_0x20f3f8['error'][_0x601c('0xe')]);return _0x1334fc(_0x20f3f8['error'][_0x601c('0xe')]);}else{logger[_0x601c('0xf')](_0x601c('0xd'),_0x34d8a3,_0x601c('0x9'));_0x1334fc(_0x20f3f8['result'][_0x601c('0xe')]);}})[_0x601c('0x10')](function(_0x444e55){logger[_0x601c('0xc')](_0x601c('0xd'),_0x34d8a3,_0x444e55);_0x280f32(_0x444e55);});});} \ No newline at end of file +var _0x883e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring'];(function(_0x3c04ef,_0x9d110c){var _0x6a3a69=function(_0x333514){while(--_0x333514){_0x3c04ef['push'](_0x3c04ef['shift']());}};_0x6a3a69(++_0x9d110c);}(_0x883e,0x74));var _0xe883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe883('0x0'));var util=require('util');var moment=require(_0xe883('0x1'));var BPromise=require(_0xe883('0x2'));var rs=require(_0xe883('0x3'));var fs=require('fs');var Redis=require(_0xe883('0x4'));var db=require(_0xe883('0x5'))['db'];var utils=require(_0xe883('0x6'));var logger=require(_0xe883('0x7'))('rpc');var config=require(_0xe883('0x8'));var jayson=require(_0xe883('0x9'));var client=jayson[_0xe883('0xa')][_0xe883('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x147e72,_0x38dc95,_0x57b651){return new BPromise(function(_0x4b80db,_0xf2be38){return client[_0xe883('0xc')](_0x147e72,_0x57b651)[_0xe883('0xd')](function(_0x5e69ff){logger[_0xe883('0xe')](_0xe883('0xf'),_0x38dc95,'request\x20sent');logger[_0xe883('0x10')](_0xe883('0x11'),_0x38dc95,_0xe883('0x12'),JSON[_0xe883('0x13')](_0x5e69ff));if(_0x5e69ff[_0xe883('0x14')]){if(_0x5e69ff['error'][_0xe883('0x15')]===0x1f4){logger['error'](_0xe883('0xf'),_0x38dc95,_0x5e69ff[_0xe883('0x14')]['message']);return _0xf2be38(_0x5e69ff[_0xe883('0x14')][_0xe883('0x16')]);}logger[_0xe883('0x14')](_0xe883('0xf'),_0x38dc95,_0x5e69ff[_0xe883('0x14')][_0xe883('0x16')]);return _0x4b80db(_0x5e69ff[_0xe883('0x14')][_0xe883('0x16')]);}else{logger[_0xe883('0xe')]('ZohoField,\x20%s,\x20%s',_0x38dc95,_0xe883('0x12'));_0x4b80db(_0x5e69ff['result'][_0xe883('0x16')]);}})[_0xe883('0x17')](function(_0x193b4f){logger[_0xe883('0x14')](_0xe883('0xf'),_0x38dc95,_0x193b4f);_0xf2be38(_0x193b4f);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 39e92d7..37f871d 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5d0c25,_0x5b6e7c){var _0x12328e=function(_0x483940){while(--_0x483940){_0x5d0c25['push'](_0x5d0c25['shift']());}};_0x12328e(++_0x5b6e7c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x16b1a5,_0x318267){_0x16b1a5=_0x16b1a5-0x0;var _0x475e25=_0xcb91[_0x16b1a5];return _0x475e25;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1e7526,_0x4bcb67){var _0x95a89b=function(_0x4e0c67){while(--_0x4e0c67){_0x1e7526['push'](_0x1e7526['shift']());}};_0x95a89b(++_0x4bcb67);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index cb93257..e879c7c 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 _0xe1d2=['unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize','exports','STRING'];(function(_0x17a689,_0x2e9a6f){var _0x5cadd9=function(_0x2b58c2){while(--_0x2b58c2){_0x17a689['push'](_0x17a689['shift']());}};_0x5cadd9(++_0x2e9a6f);}(_0xe1d2,0x19d));var _0x2e1d=function(_0x392817,_0x40b23c){_0x392817=_0x392817-0x0;var _0x3e6fe8=_0xe1d2[_0x392817];return _0x3e6fe8;};'use strict';var Sequelize=require(_0x2e1d('0x0'));module[_0x2e1d('0x1')]={'name':{'type':Sequelize[_0x2e1d('0x2')],'allowNull':![],'unique':_0x2e1d('0x3')},'version':{'type':Sequelize[_0x2e1d('0x2')],'allowNull':![],'unique':_0x2e1d('0x3')},'main':{'type':Sequelize[_0x2e1d('0x2')],'defaultValue':_0x2e1d('0x4')},'filename':{'type':Sequelize[_0x2e1d('0x2')]},'path':{'type':Sequelize[_0x2e1d('0x2')]},'type':{'type':Sequelize[_0x2e1d('0x2')]},'size':{'type':Sequelize[_0x2e1d('0x5')]},'active':{'type':Sequelize[_0x2e1d('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x2e1d('0x2')]},'state':{'type':Sequelize[_0x2e1d('0x2')],'unique':_0x2e1d('0x7')},'description':{'type':Sequelize[_0x2e1d('0x2')]},'title':{'type':Sequelize[_0x2e1d('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x2e1d('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0xa883=['sequelize','exports','STRING','unique_name_and_version','BOOLEAN','state'];(function(_0x4a691f,_0x1994dd){var _0xb33bb8=function(_0x45e016){while(--_0x45e016){_0x4a691f['push'](_0x4a691f['shift']());}};_0xb33bb8(++_0x1994dd);}(_0xa883,0x1f2));var _0x3a88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa883[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3a88('0x0'));module[_0x3a88('0x1')]={'name':{'type':Sequelize[_0x3a88('0x2')],'allowNull':![],'unique':_0x3a88('0x3')},'version':{'type':Sequelize[_0x3a88('0x2')],'allowNull':![],'unique':_0x3a88('0x3')},'main':{'type':Sequelize[_0x3a88('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x3a88('0x2')]},'type':{'type':Sequelize[_0x3a88('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x3a88('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x3a88('0x2')]},'logo':{'type':Sequelize[_0x3a88('0x2')]},'state':{'type':Sequelize[_0x3a88('0x2')],'unique':_0x3a88('0x5')},'description':{'type':Sequelize[_0x3a88('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3a88('0x2')]},'link':{'type':Sequelize[_0x3a88('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index b6a8877..ab394e3 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 _0x2542=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','error','stack','name','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x3d9dc2,_0x4d0f69){var _0x9f75a0=function(_0x23d927){while(--_0x23d927){_0x3d9dc2['push'](_0x3d9dc2['shift']());}};_0x9f75a0(++_0x4d0f69);}(_0x2542,0x169));var _0x2254=function(_0x3b46de,_0x2ea1a6){_0x3b46de=_0x3b46de-0x0;var _0xcc3190=_0x2542[_0x3b46de];return _0xcc3190;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];function respondWithStatusCode(_0x116b70,_0xdcb670){_0xdcb670=_0xdcb670||0xcc;return function(_0x3c326b){if(_0x3c326b){return _0x116b70[_0x2254('0x1a')](_0xdcb670);}return _0x116b70['status'](_0xdcb670)[_0x2254('0x1b')]();};}function respondWithResult(_0x7c7ab0,_0x504749){_0x504749=_0x504749||0xc8;return function(_0x2f4de){if(_0x2f4de){return _0x7c7ab0[_0x2254('0x1c')](_0x504749)[_0x2254('0x1d')](_0x2f4de);}};}function respondWithFilteredResult(_0x145272,_0x26285a){return function(_0xbc5548){if(_0xbc5548){var _0x50f137=typeof _0x26285a[_0x2254('0x1e')]==='undefined'&&typeof _0x26285a[_0x2254('0x1f')]===_0x2254('0x20');var _0x170ffa=_0xbc5548[_0x2254('0x21')];var _0x1ae11e=_0x50f137?0x0:_0x26285a[_0x2254('0x1e')];var _0x497724=_0x50f137?_0xbc5548['count']:_0x26285a['offset']+_0x26285a[_0x2254('0x1f')];var _0x3a79f8;if(_0x497724>=_0x170ffa){_0x497724=_0x170ffa;_0x3a79f8=0xc8;}else{_0x3a79f8=0xce;}_0x145272[_0x2254('0x1c')](_0x3a79f8);return _0x145272[_0x2254('0x22')](_0x2254('0x23'),_0x1ae11e+'-'+_0x497724+'/'+_0x170ffa)[_0x2254('0x1d')](_0xbc5548);}return null;};}function patchUpdates(_0x487f72){return function(_0x28381e){try{jsonpatch[_0x2254('0x24')](_0x28381e,_0x487f72,!![]);}catch(_0x906cde){return BPromise['reject'](_0x906cde);}return _0x28381e['save']();};}function saveUpdates(_0x5bd982,_0x1e8a98){return function(_0x559af4){if(_0x559af4){return _0x559af4[_0x2254('0x25')](_0x5bd982)['then'](function(_0x5713e4){return _0x5713e4;});}return null;};}function removeEntity(_0x4d8faf,_0x540020){return function(_0x5e5edb){if(_0x5e5edb){return _0x5e5edb['destroy']()[_0x2254('0x26')](function(){_0x4d8faf[_0x2254('0x1c')](0xcc)[_0x2254('0x1b')]();});}};}function handleEntityNotFound(_0x265467,_0x13522d){return function(_0x1349c9){if(!_0x1349c9){_0x265467['sendStatus'](0x194);}return _0x1349c9;};}function handleError(_0x4a8274,_0x1ada42){_0x1ada42=_0x1ada42||0x1f4;return function(_0x4f6877){logger[_0x2254('0x27')](_0x4f6877[_0x2254('0x28')]);if(_0x4f6877[_0x2254('0x29')]){delete _0x4f6877[_0x2254('0x29')];}_0x4a8274[_0x2254('0x1c')](_0x1ada42)['send'](_0x4f6877);};}exports[_0x2254('0x2a')]=function(_0x2a789b,_0x21285d){var _0x37af8b={},_0x13366a={},_0x377c41={'count':0x0,'rows':[]};var _0x3214a7=_[_0x2254('0x2b')](db[_0x2254('0x2c')][_0x2254('0x2d')],function(_0x21c641){return{'name':_0x21c641[_0x2254('0x2e')],'type':_0x21c641[_0x2254('0x2f')][_0x2254('0x30')]};});_0x13366a[_0x2254('0x31')]=_[_0x2254('0x2b')](_0x3214a7,_0x2254('0x29'));_0x13366a[_0x2254('0x32')]=_[_0x2254('0x33')](_0x2a789b['query']);_0x13366a[_0x2254('0x34')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],_0x13366a[_0x2254('0x32')]);_0x37af8b[_0x2254('0x36')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],qs[_0x2254('0x37')](_0x2a789b[_0x2254('0x32')]['fields']));_0x37af8b[_0x2254('0x36')]=_0x37af8b[_0x2254('0x36')]['length']?_0x37af8b[_0x2254('0x36')]:_0x13366a[_0x2254('0x31')];if(!_0x2a789b[_0x2254('0x32')][_0x2254('0x38')]('nolimit')){_0x37af8b['limit']=qs[_0x2254('0x1f')](_0x2a789b['query'][_0x2254('0x1f')]);_0x37af8b[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0x2a789b[_0x2254('0x32')][_0x2254('0x1e')]);}_0x37af8b[_0x2254('0x39')]=qs[_0x2254('0x3a')](_0x2a789b['query'][_0x2254('0x3a')]);_0x37af8b[_0x2254('0x3b')]=qs[_0x2254('0x34')](_[_0x2254('0x3c')](_0x2a789b[_0x2254('0x32')],_0x13366a[_0x2254('0x34')]),_0x3214a7);if(_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]){_0x37af8b[_0x2254('0x3b')]=_[_0x2254('0x3e')](_0x37af8b['where'],{'$or':_[_0x2254('0x2b')](_0x3214a7,function(_0xde3e4a){if(_0xde3e4a[_0x2254('0x2f')]!==_0x2254('0x3f')){var _0x4c7cc3={};_0x4c7cc3[_0xde3e4a[_0x2254('0x29')]]={'$like':'%'+_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]+'%'};return _0x4c7cc3;}})});}_0x37af8b=_[_0x2254('0x3e')]({},_0x37af8b,_0x2a789b[_0x2254('0x40')]);var _0x2602db={'where':_0x37af8b[_0x2254('0x3b')]};return db[_0x2254('0x2c')]['count'](_0x2602db)[_0x2254('0x26')](function(_0x5c15d7){_0x377c41[_0x2254('0x21')]=_0x5c15d7;if(_0x2a789b[_0x2254('0x32')][_0x2254('0x41')]){_0x37af8b[_0x2254('0x42')]=[{'all':!![]}];}return db[_0x2254('0x2c')][_0x2254('0x43')](_0x37af8b);})[_0x2254('0x26')](function(_0x568ec9){_0x377c41[_0x2254('0x44')]=_0x568ec9;return _0x377c41;})[_0x2254('0x26')](respondWithFilteredResult(_0x21285d,_0x37af8b))[_0x2254('0x45')](handleError(_0x21285d,null));};exports[_0x2254('0x46')]=function(_0x40d4da,_0x57cda2){var _0x22bb98={'raw':![],'where':{'id':_0x40d4da[_0x2254('0x47')]['id']}},_0x1dec43={};_0x1dec43[_0x2254('0x31')]=_[_0x2254('0x33')](db['Integration'][_0x2254('0x2d')]);_0x1dec43['query']=_[_0x2254('0x33')](_0x40d4da[_0x2254('0x32')]);_0x1dec43[_0x2254('0x34')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],_0x1dec43[_0x2254('0x32')]);_0x22bb98[_0x2254('0x36')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],qs[_0x2254('0x37')](_0x40d4da[_0x2254('0x32')][_0x2254('0x37')]));_0x22bb98[_0x2254('0x36')]=_0x22bb98['attributes'][_0x2254('0x48')]?_0x22bb98[_0x2254('0x36')]:_0x1dec43[_0x2254('0x31')];if(_0x40d4da['query'][_0x2254('0x41')]){_0x22bb98[_0x2254('0x42')]=[{'all':!![]}];}_0x22bb98=_[_0x2254('0x3e')]({},_0x22bb98,_0x40d4da[_0x2254('0x40')]);return db[_0x2254('0x2c')][_0x2254('0x49')](_0x22bb98)[_0x2254('0x26')](handleEntityNotFound(_0x57cda2,null))[_0x2254('0x26')](respondWithResult(_0x57cda2,null))[_0x2254('0x45')](handleError(_0x57cda2,null));};exports['create']=function(_0x239ba0,_0x405eb2){return db[_0x2254('0x2c')][_0x2254('0x4a')](_0x239ba0[_0x2254('0x4b')],{})[_0x2254('0x26')](respondWithResult(_0x405eb2,0xc9))[_0x2254('0x45')](handleError(_0x405eb2,null));};exports[_0x2254('0x25')]=function(_0x3ac691,_0xa103ea){if(_0x3ac691['body']['id']){delete _0x3ac691[_0x2254('0x4b')]['id'];}return db[_0x2254('0x2c')]['find']({'where':{'id':_0x3ac691[_0x2254('0x47')]['id']}})[_0x2254('0x26')](handleEntityNotFound(_0xa103ea,null))[_0x2254('0x26')](saveUpdates(_0x3ac691[_0x2254('0x4b')],null))['then'](respondWithResult(_0xa103ea,null))[_0x2254('0x45')](handleError(_0xa103ea,null));};exports[_0x2254('0x4c')]=function(_0x4d2c96,_0x26d01a){return db[_0x2254('0x2c')][_0x2254('0x49')]({'where':{'id':_0x4d2c96[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x26d01a,null))[_0x2254('0x26')](removeEntity(_0x26d01a,null))[_0x2254('0x45')](handleError(_0x26d01a,null));}; \ No newline at end of file +var _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','Integration','fieldName','type','key'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xadb5,0xad));var _0x5adb=function(_0x13d37e,_0x4ad02f){_0x13d37e=_0x13d37e-0x0;var _0x1deb39=_0xadb5[_0x13d37e];return _0x1deb39;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['Integration']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['Integration'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['Integration'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 5bb8eab..2ca03a4 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 _0x12a3=['util','../../config/logger','bluebird','request-promise','rimraf','exports','define','Integration','integrations','lodash'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0x12a3,0x171));var _0x312a=function(_0x1c0292,_0x23bf85){_0x1c0292=_0x1c0292-0x0;var _0x30eab1=_0x12a3[_0x1c0292];return _0x30eab1;};'use strict';var _=require(_0x312a('0x0'));var util=require(_0x312a('0x1'));var logger=require(_0x312a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x312a('0x3'));var rp=require(_0x312a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x312a('0x5'));var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0x312a('0x6')]=function(_0x4ef554,_0x24661e){return _0x4ef554[_0x312a('0x7')](_0x312a('0x8'),attributes,{'tableName':_0x312a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf6ad=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./integration.attributes','define','Integration'];(function(_0x30c39d,_0x4f95dc){var _0x54213e=function(_0x29d94f){while(--_0x29d94f){_0x30c39d['push'](_0x30c39d['shift']());}};_0x54213e(++_0x4f95dc);}(_0xf6ad,0xb0));var _0xdf6a=function(_0x2452ff,_0x3b8868){_0x2452ff=_0x2452ff-0x0;var _0x4111f8=_0xf6ad[_0x2452ff];return _0x4111f8;};'use strict';var _=require(_0xdf6a('0x0'));var util=require(_0xdf6a('0x1'));var logger=require(_0xdf6a('0x2'))(_0xdf6a('0x3'));var moment=require(_0xdf6a('0x4'));var BPromise=require('bluebird');var rp=require(_0xdf6a('0x5'));var fs=require('fs');var path=require(_0xdf6a('0x6'));var rimraf=require(_0xdf6a('0x7'));var config=require('../../config/environment');var attributes=require(_0xdf6a('0x8'));module['exports']=function(_0x3c811b,_0x3634a2){return _0x3c811b[_0xdf6a('0x9')](_0xdf6a('0xa'),attributes,{'tableName':'integrations','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 2fd6713..56addeb 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 _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Integration,\x20%s,\x20%s','message','catch','lodash'];(function(_0x1833f6,_0x251ed7){var _0x2d3244=function(_0x1f6789){while(--_0x1f6789){_0x1833f6['push'](_0x1833f6['shift']());}};_0x2d3244(++_0x251ed7);}(_0x66fa,0x117));var _0xa66f=function(_0x136b76,_0x112e4a){_0x136b76=_0x136b76-0x0;var _0x18a5ae=_0x66fa[_0x136b76];return _0x18a5ae;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('Integration,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('Integration,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});} \ No newline at end of file +var _0x7a54=['info','Integration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x44d5a2,_0x2b1a6b){_0x44d5a2=_0x44d5a2-0x0;var _0x5243e4=_0x7a54[_0x44d5a2];return _0x5243e4;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Integration,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 1fad03f..62e6787 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f0e=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x9f0e,0x116));var _0xe9f0=function(_0x402d9e,_0x3928da){_0x402d9e=_0x402d9e-0x0;var _0xe13b73=_0x9f0e[_0x402d9e];return _0xe13b73;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var timeout=require(_0xe9f0('0x3'));var express=require(_0xe9f0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe9f0('0x5'));var interaction=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var controller=require(_0xe9f0('0x8'));router[_0xe9f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe9f0('0x9')](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller['describe']);router[_0xe9f0('0x9')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0xe')]('/',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x10')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x11')]);router[_0xe9f0('0x12')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x13')]);module['exports']=router; \ No newline at end of file +var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x2c40bf,_0x5ce37a){var _0x31ab19=function(_0x56303){while(--_0x56303){_0x2c40bf['push'](_0x2c40bf['shift']());}};_0x31ab19(++_0x5ce37a);}(_0x4975,0x86));var _0x5497=function(_0x12af2d,_0x443f9c){_0x12af2d=_0x12af2d-0x0;var _0x44d294=_0x4975[_0x12af2d];return _0x44d294;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('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 ca2f226..bc651af 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 _0xb204=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','FAILED','STRING'];(function(_0x265519,_0x116ebb){var _0x4c14cb=function(_0x377406){while(--_0x377406){_0x265519['push'](_0x265519['shift']());}};_0x4c14cb(++_0x116ebb);}(_0xb204,0xaa));var _0x4b20=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xb204[_0x4709c0];return _0x13348b;};'use strict';var Sequelize=require('sequelize');module['exports']={'integration':{'type':Sequelize[_0x4b20('0x0')]},'eventChannel':{'type':Sequelize[_0x4b20('0x0')]},'exitStatus':{'type':Sequelize[_0x4b20('0x0')]},'ticketId':{'type':Sequelize[_0x4b20('0x0')]},'integrationId':{'type':Sequelize[_0x4b20('0x1')]},'contacts':{'type':Sequelize[_0x4b20('0x0')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4b20('0x0')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x4b20('0x0')]},'interface':{'type':Sequelize[_0x4b20('0x0')]},'membername':{'type':Sequelize[_0x4b20('0x0')]},'agentcalledAt':{'type':Sequelize[_0x4b20('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x4b20('0x1')]},'agentcomplete':{'type':Sequelize[_0x4b20('0x3')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x4b20('0x2')]},'talktime':{'type':Sequelize[_0x4b20('0x1')]},'agentacw':{'type':Sequelize[_0x4b20('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4b20('0x1')]},'reason':{'type':Sequelize[_0x4b20('0x0')]},'agentringnoanswer':{'type':Sequelize[_0x4b20('0x3')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x4b20('0x2')]},'lastevent':{'type':Sequelize[_0x4b20('0x0')]},'channel':{'type':Sequelize[_0x4b20('0x0')]},'channelstate':{'type':Sequelize[_0x4b20('0x1')]},'channelstatedesc':{'type':Sequelize[_0x4b20('0x0')]},'connectedlinenum':{'type':Sequelize[_0x4b20('0x0')]},'connectedlinename':{'type':Sequelize[_0x4b20('0x0')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4b20('0x0')]},'context':{'type':Sequelize[_0x4b20('0x0')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x4b20('0x0')]},'destchannelstate':{'type':Sequelize[_0x4b20('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x4b20('0x0')]},'destcalleridnum':{'type':Sequelize[_0x4b20('0x0')]},'destcalleridname':{'type':Sequelize[_0x4b20('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0x4b20('0x0')]},'destconnectedlinename':{'type':Sequelize[_0x4b20('0x0')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x4b20('0x0')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x4b20('0x0')]},'destuniqueid':{'type':Sequelize[_0x4b20('0x0')]},'messageId':{'type':Sequelize[_0x4b20('0x0')]},'inReplyTo':{'type':Sequelize[_0x4b20('0x0')]},'subject':{'type':Sequelize[_0x4b20('0x0')]},'from':{'type':Sequelize[_0x4b20('0x0')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x4b20('0x4')]},'html':{'type':Sequelize[_0x4b20('0x4')]},'text':{'type':Sequelize[_0x4b20('0x4')]},'status':{'type':Sequelize[_0x4b20('0x5')](_0x4b20('0x6'),_0x4b20('0x7'),'RECEIVED',_0x4b20('0x8'))},'url':{'type':Sequelize[_0x4b20('0x0')]},'app':{'type':Sequelize[_0x4b20('0x0')]},'appdata':{'type':Sequelize[_0x4b20('0x0')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x71b1=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x71b1,0x1d4));var _0x171b=function(_0x333195,_0x366608){_0x333195=_0x333195-0x0;var _0x2e44de=_0x71b1[_0x333195];return _0x2e44de;};'use strict';var Sequelize=require(_0x171b('0x0'));module[_0x171b('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x171b('0x2')]},'exitStatus':{'type':Sequelize[_0x171b('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x171b('0x3')]},'contacts':{'type':Sequelize[_0x171b('0x2')]},'uniqueid':{'type':Sequelize[_0x171b('0x2')]},'calleridnum':{'type':Sequelize[_0x171b('0x2')]},'calleridname':{'type':Sequelize[_0x171b('0x2')]},'queue':{'type':Sequelize[_0x171b('0x2')]},'interface':{'type':Sequelize[_0x171b('0x2')]},'membername':{'type':Sequelize[_0x171b('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x171b('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x171b('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x171b('0x3')]},'agentacw':{'type':Sequelize[_0x171b('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x171b('0x3')]},'reason':{'type':Sequelize[_0x171b('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x171b('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x171b('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x171b('0x4')]},'lastevent':{'type':Sequelize[_0x171b('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x171b('0x2')]},'connectedlinenum':{'type':Sequelize[_0x171b('0x2')]},'connectedlinename':{'type':Sequelize[_0x171b('0x2')]},'language':{'type':Sequelize[_0x171b('0x2')]},'accountcode':{'type':Sequelize[_0x171b('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x171b('0x2')]},'priority':{'type':Sequelize[_0x171b('0x2')]},'destchannel':{'type':Sequelize[_0x171b('0x2')]},'destchannelstate':{'type':Sequelize[_0x171b('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x171b('0x2')]},'destcalleridnum':{'type':Sequelize[_0x171b('0x2')]},'destcalleridname':{'type':Sequelize[_0x171b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x171b('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x171b('0x2')]},'destcontext':{'type':Sequelize[_0x171b('0x2')]},'destexten':{'type':Sequelize[_0x171b('0x2')]},'destpriority':{'type':Sequelize[_0x171b('0x2')]},'destuniqueid':{'type':Sequelize[_0x171b('0x2')]},'messageId':{'type':Sequelize[_0x171b('0x2')]},'inReplyTo':{'type':Sequelize[_0x171b('0x2')]},'subject':{'type':Sequelize[_0x171b('0x2')]},'from':{'type':Sequelize[_0x171b('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x171b('0x6')]},'html':{'type':Sequelize[_0x171b('0x6')]},'text':{'type':Sequelize[_0x171b('0x6')]},'status':{'type':Sequelize[_0x171b('0x7')](_0x171b('0x8'),_0x171b('0x9'),_0x171b('0xa'),_0x171b('0xb'))},'url':{'type':Sequelize[_0x171b('0x2')]},'app':{'type':Sequelize[_0x171b('0x2')]},'appdata':{'type':Sequelize[_0x171b('0x2')]},'projectId':{'type':Sequelize[_0x171b('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index f41af88..68b1c62 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 _0xf580=['update','then','end','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','count','includeAll','IntegrationReport','findAll','rows','catch','show','params','length','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save'];(function(_0x271f70,_0x57f428){var _0x4859f5=function(_0x1a063e){while(--_0x1a063e){_0x271f70['push'](_0x271f70['shift']());}};_0x4859f5(++_0x57f428);}(_0xf580,0x19e));var _0x0f58=function(_0x58dc18,_0x334df1){_0x58dc18=_0x58dc18-0x0;var _0xa469f6=_0xf580[_0x58dc18];return _0xa469f6;};'use strict';var emlformat=require(_0x0f58('0x0'));var rimraf=require(_0x0f58('0x1'));var zipdir=require(_0x0f58('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f58('0x3'));var moment=require(_0x0f58('0x4'));var BPromise=require(_0x0f58('0x5'));var Mustache=require(_0x0f58('0x6'));var util=require(_0x0f58('0x7'));var path=require('path');var sox=require(_0x0f58('0x8'));var csv=require(_0x0f58('0x9'));var ejs=require(_0x0f58('0xa'));var fs=require('fs');var fs_extra=require(_0x0f58('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0f58('0xc'));var deskjs=require(_0x0f58('0xd'));var toCsv=require(_0x0f58('0x9'));var querystring=require(_0x0f58('0xe'));var Papa=require(_0x0f58('0xf'));var Redis=require(_0x0f58('0x10'));var authService=require(_0x0f58('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f58('0x12'));var logger=require(_0x0f58('0x13'))(_0x0f58('0x14'));var utils=require(_0x0f58('0x15'));var config=require(_0x0f58('0x16'));var licenseUtil=require(_0x0f58('0x17'));var db=require(_0x0f58('0x18'))['db'];function respondWithStatusCode(_0x38ebac,_0x18c867){_0x18c867=_0x18c867||0xcc;return function(_0x594282){if(_0x594282){return _0x38ebac[_0x0f58('0x19')](_0x18c867);}return _0x38ebac[_0x0f58('0x1a')](_0x18c867)['end']();};}function respondWithResult(_0x2d4b77,_0x34eb0c){_0x34eb0c=_0x34eb0c||0xc8;return function(_0x5d09e2){if(_0x5d09e2){return _0x2d4b77['status'](_0x34eb0c)[_0x0f58('0x1b')](_0x5d09e2);}};}function respondWithFilteredResult(_0xc0801,_0x460cd2){return function(_0x2d331b){if(_0x2d331b){var _0x51703d=typeof _0x460cd2[_0x0f58('0x1c')]===_0x0f58('0x1d')&&typeof _0x460cd2[_0x0f58('0x1e')]===_0x0f58('0x1d');var _0x3fc699=_0x2d331b['count'];var _0x38db53=_0x51703d?0x0:_0x460cd2['offset'];var _0x2e360b=_0x51703d?_0x2d331b['count']:_0x460cd2[_0x0f58('0x1c')]+_0x460cd2[_0x0f58('0x1e')];var _0x23345b;if(_0x2e360b>=_0x3fc699){_0x2e360b=_0x3fc699;_0x23345b=0xc8;}else{_0x23345b=0xce;}_0xc0801['status'](_0x23345b);return _0xc0801[_0x0f58('0x1f')](_0x0f58('0x20'),_0x38db53+'-'+_0x2e360b+'/'+_0x3fc699)['json'](_0x2d331b);}return null;};}function patchUpdates(_0x12f2d0){return function(_0x3098f0){try{jsonpatch[_0x0f58('0x21')](_0x3098f0,_0x12f2d0,!![]);}catch(_0x2e1905){return BPromise[_0x0f58('0x22')](_0x2e1905);}return _0x3098f0[_0x0f58('0x23')]();};}function saveUpdates(_0x1d1dd8,_0x24ad1b){return function(_0x1e7b9c){if(_0x1e7b9c){return _0x1e7b9c[_0x0f58('0x24')](_0x1d1dd8)['then'](function(_0x405ab8){return _0x405ab8;});}return null;};}function removeEntity(_0x48e2af,_0x4863be){return function(_0x18bbfb){if(_0x18bbfb){return _0x18bbfb['destroy']()[_0x0f58('0x25')](function(){_0x48e2af[_0x0f58('0x1a')](0xcc)[_0x0f58('0x26')]();});}};}function handleEntityNotFound(_0xbae2cd,_0x2e1599){return function(_0x48509b){if(!_0x48509b){_0xbae2cd[_0x0f58('0x19')](0x194);}return _0x48509b;};}function handleError(_0x1898fd,_0x5ce2c3){_0x5ce2c3=_0x5ce2c3||0x1f4;return function(_0xb0a32d){logger['error'](_0xb0a32d['stack']);if(_0xb0a32d['name']){delete _0xb0a32d[_0x0f58('0x27')];}_0x1898fd[_0x0f58('0x1a')](_0x5ce2c3)[_0x0f58('0x28')](_0xb0a32d);};}exports[_0x0f58('0x29')]=function(_0x454e10,_0x36d115){var _0x5db203={},_0x48fa5f={},_0x5deb9c={'count':0x0,'rows':[]};var _0x1c41ae=_[_0x0f58('0x2a')](db['IntegrationReport'][_0x0f58('0x2b')],function(_0x270721){return{'name':_0x270721[_0x0f58('0x2c')],'type':_0x270721[_0x0f58('0x2d')]['key']};});_0x48fa5f[_0x0f58('0x2e')]=_[_0x0f58('0x2a')](_0x1c41ae,_0x0f58('0x27'));_0x48fa5f[_0x0f58('0x2f')]=_[_0x0f58('0x30')](_0x454e10['query']);_0x48fa5f['filters']=_['intersection'](_0x48fa5f[_0x0f58('0x2e')],_0x48fa5f[_0x0f58('0x2f')]);_0x5db203[_0x0f58('0x31')]=_[_0x0f58('0x32')](_0x48fa5f['model'],qs[_0x0f58('0x33')](_0x454e10['query'][_0x0f58('0x33')]));_0x5db203[_0x0f58('0x31')]=_0x5db203[_0x0f58('0x31')]['length']?_0x5db203[_0x0f58('0x31')]:_0x48fa5f[_0x0f58('0x2e')];if(!_0x454e10[_0x0f58('0x2f')][_0x0f58('0x34')](_0x0f58('0x35'))){_0x5db203[_0x0f58('0x1e')]=qs['limit'](_0x454e10[_0x0f58('0x2f')][_0x0f58('0x1e')]);_0x5db203[_0x0f58('0x1c')]=qs[_0x0f58('0x1c')](_0x454e10[_0x0f58('0x2f')][_0x0f58('0x1c')]);}_0x5db203['order']=qs[_0x0f58('0x36')](_0x454e10[_0x0f58('0x2f')][_0x0f58('0x36')]);_0x5db203[_0x0f58('0x37')]=qs[_0x0f58('0x38')](_['pick'](_0x454e10['query'],_0x48fa5f[_0x0f58('0x38')]),_0x1c41ae);if(_0x454e10[_0x0f58('0x2f')][_0x0f58('0x39')]){_0x5db203['where']=_['merge'](_0x5db203[_0x0f58('0x37')],{'$or':_[_0x0f58('0x2a')](_0x1c41ae,function(_0xbacb9a){if(_0xbacb9a[_0x0f58('0x2d')]!=='VIRTUAL'){var _0x403794={};_0x403794[_0xbacb9a[_0x0f58('0x27')]]={'$like':'%'+_0x454e10['query'][_0x0f58('0x39')]+'%'};return _0x403794;}})});}_0x5db203=_[_0x0f58('0x3a')]({},_0x5db203,_0x454e10[_0x0f58('0x3b')]);var _0x4d881={'where':_0x5db203[_0x0f58('0x37')]};return db['IntegrationReport']['count'](_0x4d881)[_0x0f58('0x25')](function(_0x5138ea){_0x5deb9c[_0x0f58('0x3c')]=_0x5138ea;if(_0x454e10['query'][_0x0f58('0x3d')]){_0x5db203['include']=[{'all':!![]}];}return db[_0x0f58('0x3e')][_0x0f58('0x3f')](_0x5db203);})['then'](function(_0x28daaa){_0x5deb9c[_0x0f58('0x40')]=_0x28daaa;return _0x5deb9c;})[_0x0f58('0x25')](respondWithFilteredResult(_0x36d115,_0x5db203))[_0x0f58('0x41')](handleError(_0x36d115,null));};exports[_0x0f58('0x42')]=function(_0xc3f2f2,_0x1c9ce1){var _0x581d86={'raw':![],'where':{'id':_0xc3f2f2[_0x0f58('0x43')]['id']}},_0x49e087={};_0x49e087[_0x0f58('0x2e')]=_[_0x0f58('0x30')](db[_0x0f58('0x3e')][_0x0f58('0x2b')]);_0x49e087['query']=_[_0x0f58('0x30')](_0xc3f2f2['query']);_0x49e087[_0x0f58('0x38')]=_['intersection'](_0x49e087['model'],_0x49e087['query']);_0x581d86[_0x0f58('0x31')]=_[_0x0f58('0x32')](_0x49e087[_0x0f58('0x2e')],qs[_0x0f58('0x33')](_0xc3f2f2[_0x0f58('0x2f')][_0x0f58('0x33')]));_0x581d86[_0x0f58('0x31')]=_0x581d86[_0x0f58('0x31')][_0x0f58('0x44')]?_0x581d86[_0x0f58('0x31')]:_0x49e087[_0x0f58('0x2e')];if(_0xc3f2f2[_0x0f58('0x2f')][_0x0f58('0x3d')]){_0x581d86[_0x0f58('0x45')]=[{'all':!![]}];}_0x581d86=_[_0x0f58('0x3a')]({},_0x581d86,_0xc3f2f2[_0x0f58('0x3b')]);return db['IntegrationReport'][_0x0f58('0x46')](_0x581d86)[_0x0f58('0x25')](handleEntityNotFound(_0x1c9ce1,null))[_0x0f58('0x25')](respondWithResult(_0x1c9ce1,null))[_0x0f58('0x41')](handleError(_0x1c9ce1,null));};exports[_0x0f58('0x47')]=function(_0x530bdf,_0x2e991d){return db[_0x0f58('0x3e')]['create'](_0x530bdf[_0x0f58('0x48')],{})[_0x0f58('0x25')](respondWithResult(_0x2e991d,0xc9))[_0x0f58('0x41')](handleError(_0x2e991d,null));};exports['update']=function(_0x5113c4,_0x41f723){if(_0x5113c4[_0x0f58('0x48')]['id']){delete _0x5113c4[_0x0f58('0x48')]['id'];}return db[_0x0f58('0x3e')]['find']({'where':{'id':_0x5113c4[_0x0f58('0x43')]['id']}})['then'](handleEntityNotFound(_0x41f723,null))[_0x0f58('0x25')](saveUpdates(_0x5113c4[_0x0f58('0x48')],null))[_0x0f58('0x25')](respondWithResult(_0x41f723,null))[_0x0f58('0x41')](handleError(_0x41f723,null));};exports[_0x0f58('0x49')]=function(_0x244b6b,_0x21149c){return db['IntegrationReport'][_0x0f58('0x46')]({'where':{'id':_0x244b6b['params']['id']}})['then'](handleEntityNotFound(_0x21149c,null))[_0x0f58('0x25')](removeEntity(_0x21149c,null))[_0x0f58('0x41')](handleError(_0x21149c,null));};exports[_0x0f58('0x4a')]=function(_0x7ff75c,_0x32ef09){return db[_0x0f58('0x3e')][_0x0f58('0x4a')]()[_0x0f58('0x25')](respondWithResult(_0x32ef09,null))[_0x0f58('0x41')](handleError(_0x32ef09,null));}; \ No newline at end of file +var _0x5704=['filter','merge','options','includeAll','include','findAll','params','find','catch','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','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/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','error','name','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x2cffc9,_0x5dc809){var _0x150c20=function(_0x18a609){while(--_0x18a609){_0x2cffc9['push'](_0x2cffc9['shift']());}};_0x150c20(++_0x5dc809);}(_0x5704,0x175));var _0x4570=function(_0x2b45b5,_0x474458){_0x2b45b5=_0x2b45b5-0x0;var _0x1d9c06=_0x5704[_0x2b45b5];return _0x1d9c06;};'use strict';var emlformat=require(_0x4570('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4570('0x1'));var jsonpatch=require(_0x4570('0x2'));var rp=require(_0x4570('0x3'));var moment=require(_0x4570('0x4'));var BPromise=require(_0x4570('0x5'));var Mustache=require(_0x4570('0x6'));var util=require('util');var path=require(_0x4570('0x7'));var sox=require(_0x4570('0x8'));var csv=require(_0x4570('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4570('0xa'));var _=require(_0x4570('0xb'));var squel=require(_0x4570('0xc'));var crypto=require('crypto');var jsforce=require(_0x4570('0xd'));var deskjs=require(_0x4570('0xe'));var toCsv=require(_0x4570('0x9'));var querystring=require(_0x4570('0xf'));var Papa=require('papaparse');var Redis=require(_0x4570('0x10'));var authService=require(_0x4570('0x11'));var qs=require(_0x4570('0x12'));var as=require(_0x4570('0x13'));var hardwareService=require(_0x4570('0x14'));var logger=require(_0x4570('0x15'))(_0x4570('0x16'));var utils=require(_0x4570('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4570('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45c22d,_0x18e9cf){_0x18e9cf=_0x18e9cf||0xcc;return function(_0x1c7f41){if(_0x1c7f41){return _0x45c22d[_0x4570('0x19')](_0x18e9cf);}return _0x45c22d['status'](_0x18e9cf)[_0x4570('0x1a')]();};}function respondWithResult(_0x57793f,_0x301daa){_0x301daa=_0x301daa||0xc8;return function(_0xd8c256){if(_0xd8c256){return _0x57793f[_0x4570('0x1b')](_0x301daa)[_0x4570('0x1c')](_0xd8c256);}};}function respondWithFilteredResult(_0x317d3b,_0x42f99b){return function(_0x456428){if(_0x456428){var _0x40fc1e=typeof _0x42f99b[_0x4570('0x1d')]===_0x4570('0x1e')&&typeof _0x42f99b['limit']===_0x4570('0x1e');var _0x32bb2f=_0x456428[_0x4570('0x1f')];var _0x14ecce=_0x40fc1e?0x0:_0x42f99b[_0x4570('0x1d')];var _0x1b0830=_0x40fc1e?_0x456428[_0x4570('0x1f')]:_0x42f99b['offset']+_0x42f99b[_0x4570('0x20')];var _0x563917;if(_0x1b0830>=_0x32bb2f){_0x1b0830=_0x32bb2f;_0x563917=0xc8;}else{_0x563917=0xce;}_0x317d3b['status'](_0x563917);return _0x317d3b[_0x4570('0x21')]('Content-Range',_0x14ecce+'-'+_0x1b0830+'/'+_0x32bb2f)['json'](_0x456428);}return null;};}function patchUpdates(_0x34751c){return function(_0x236b50){try{jsonpatch[_0x4570('0x22')](_0x236b50,_0x34751c,!![]);}catch(_0x45086b){return BPromise[_0x4570('0x23')](_0x45086b);}return _0x236b50[_0x4570('0x24')]();};}function saveUpdates(_0x4a437c,_0x1446fc){return function(_0x195f88){if(_0x195f88){return _0x195f88['update'](_0x4a437c)[_0x4570('0x25')](function(_0xfc3926){return _0xfc3926;});}return null;};}function removeEntity(_0x13ba1a,_0x380415){return function(_0x1bc982){if(_0x1bc982){return _0x1bc982[_0x4570('0x26')]()[_0x4570('0x25')](function(){_0x13ba1a[_0x4570('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f992d,_0x533b41){return function(_0x26c932){if(!_0x26c932){_0x3f992d[_0x4570('0x19')](0x194);}return _0x26c932;};}function handleError(_0x4c60cd,_0x47db61){_0x47db61=_0x47db61||0x1f4;return function(_0x52291b){logger[_0x4570('0x27')](_0x52291b['stack']);if(_0x52291b['name']){delete _0x52291b[_0x4570('0x28')];}_0x4c60cd[_0x4570('0x1b')](_0x47db61)['send'](_0x52291b);};}exports[_0x4570('0x29')]=function(_0x5c330a,_0x1dfd73){var _0x2c94c3={},_0x2b1232={},_0x13b636={'count':0x0,'rows':[]};var _0x39c7a6=_[_0x4570('0x2a')](db[_0x4570('0x2b')][_0x4570('0x2c')],function(_0x123ccc){return{'name':_0x123ccc[_0x4570('0x2d')],'type':_0x123ccc[_0x4570('0x2e')][_0x4570('0x2f')]};});_0x2b1232[_0x4570('0x30')]=_['map'](_0x39c7a6,_0x4570('0x28'));_0x2b1232[_0x4570('0x31')]=_['keys'](_0x5c330a[_0x4570('0x31')]);_0x2b1232[_0x4570('0x32')]=_['intersection'](_0x2b1232['model'],_0x2b1232[_0x4570('0x31')]);_0x2c94c3[_0x4570('0x33')]=_[_0x4570('0x34')](_0x2b1232[_0x4570('0x30')],qs[_0x4570('0x35')](_0x5c330a[_0x4570('0x31')][_0x4570('0x35')]));_0x2c94c3[_0x4570('0x33')]=_0x2c94c3[_0x4570('0x33')][_0x4570('0x36')]?_0x2c94c3[_0x4570('0x33')]:_0x2b1232[_0x4570('0x30')];if(!_0x5c330a[_0x4570('0x31')][_0x4570('0x37')]('nolimit')){_0x2c94c3[_0x4570('0x20')]=qs[_0x4570('0x20')](_0x5c330a[_0x4570('0x31')][_0x4570('0x20')]);_0x2c94c3['offset']=qs[_0x4570('0x1d')](_0x5c330a[_0x4570('0x31')][_0x4570('0x1d')]);}_0x2c94c3[_0x4570('0x38')]=qs[_0x4570('0x39')](_0x5c330a[_0x4570('0x31')][_0x4570('0x39')]);_0x2c94c3[_0x4570('0x3a')]=qs['filters'](_['pick'](_0x5c330a['query'],_0x2b1232['filters']),_0x39c7a6);if(_0x5c330a[_0x4570('0x31')][_0x4570('0x3b')]){_0x2c94c3['where']=_[_0x4570('0x3c')](_0x2c94c3['where'],{'$or':_[_0x4570('0x2a')](_0x39c7a6,function(_0x5cbccf){if(_0x5cbccf[_0x4570('0x2e')]!=='VIRTUAL'){var _0x2e3380={};_0x2e3380[_0x5cbccf['name']]={'$like':'%'+_0x5c330a[_0x4570('0x31')]['filter']+'%'};return _0x2e3380;}})});}_0x2c94c3=_[_0x4570('0x3c')]({},_0x2c94c3,_0x5c330a[_0x4570('0x3d')]);var _0x807d82={'where':_0x2c94c3[_0x4570('0x3a')]};return db['IntegrationReport'][_0x4570('0x1f')](_0x807d82)[_0x4570('0x25')](function(_0x3cfa74){_0x13b636[_0x4570('0x1f')]=_0x3cfa74;if(_0x5c330a[_0x4570('0x31')][_0x4570('0x3e')]){_0x2c94c3[_0x4570('0x3f')]=[{'all':!![]}];}return db[_0x4570('0x2b')][_0x4570('0x40')](_0x2c94c3);})[_0x4570('0x25')](function(_0x248bda){_0x13b636['rows']=_0x248bda;return _0x13b636;})[_0x4570('0x25')](respondWithFilteredResult(_0x1dfd73,_0x2c94c3))['catch'](handleError(_0x1dfd73,null));};exports['show']=function(_0x3a8171,_0x1a38b3){var _0x956409={'raw':![],'where':{'id':_0x3a8171[_0x4570('0x41')]['id']}},_0x5e9ddb={};_0x5e9ddb[_0x4570('0x30')]=_['keys'](db[_0x4570('0x2b')][_0x4570('0x2c')]);_0x5e9ddb[_0x4570('0x31')]=_['keys'](_0x3a8171[_0x4570('0x31')]);_0x5e9ddb[_0x4570('0x32')]=_[_0x4570('0x34')](_0x5e9ddb[_0x4570('0x30')],_0x5e9ddb[_0x4570('0x31')]);_0x956409[_0x4570('0x33')]=_[_0x4570('0x34')](_0x5e9ddb['model'],qs[_0x4570('0x35')](_0x3a8171['query'][_0x4570('0x35')]));_0x956409[_0x4570('0x33')]=_0x956409[_0x4570('0x33')][_0x4570('0x36')]?_0x956409[_0x4570('0x33')]:_0x5e9ddb[_0x4570('0x30')];if(_0x3a8171[_0x4570('0x31')][_0x4570('0x3e')]){_0x956409[_0x4570('0x3f')]=[{'all':!![]}];}_0x956409=_[_0x4570('0x3c')]({},_0x956409,_0x3a8171[_0x4570('0x3d')]);return db['IntegrationReport'][_0x4570('0x42')](_0x956409)['then'](handleEntityNotFound(_0x1a38b3,null))['then'](respondWithResult(_0x1a38b3,null))[_0x4570('0x43')](handleError(_0x1a38b3,null));};exports['create']=function(_0x4c7350,_0x594ebd){return db[_0x4570('0x2b')][_0x4570('0x44')](_0x4c7350[_0x4570('0x45')],{})[_0x4570('0x25')](respondWithResult(_0x594ebd,0xc9))[_0x4570('0x43')](handleError(_0x594ebd,null));};exports[_0x4570('0x46')]=function(_0x521fa0,_0x377924){if(_0x521fa0['body']['id']){delete _0x521fa0['body']['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x521fa0['params']['id']}})['then'](handleEntityNotFound(_0x377924,null))['then'](saveUpdates(_0x521fa0[_0x4570('0x45')],null))[_0x4570('0x25')](respondWithResult(_0x377924,null))[_0x4570('0x43')](handleError(_0x377924,null));};exports['destroy']=function(_0x3ed63b,_0x1a33db){return db['IntegrationReport']['find']({'where':{'id':_0x3ed63b['params']['id']}})[_0x4570('0x25')](handleEntityNotFound(_0x1a33db,null))['then'](removeEntity(_0x1a33db,null))[_0x4570('0x43')](handleError(_0x1a33db,null));};exports[_0x4570('0x47')]=function(_0xffff5a,_0x28cf91){return db['IntegrationReport'][_0x4570('0x47')]()[_0x4570('0x25')](respondWithResult(_0x28cf91,null))[_0x4570('0x43')](handleError(_0x28cf91,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index cc9669c..637801b 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 _0x48df=['rimraf','../../config/environment','./integrationReport.attributes','exports','define','report_integration','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x48df,0xd2));var _0xf48d=function(_0x137d1d,_0x35c663){_0x137d1d=_0x137d1d-0x0;var _0x485108=_0x48df[_0x137d1d];return _0x485108;};'use strict';var _=require(_0xf48d('0x0'));var util=require('util');var logger=require(_0xf48d('0x1'))('api');var moment=require(_0xf48d('0x2'));var BPromise=require(_0xf48d('0x3'));var rp=require(_0xf48d('0x4'));var fs=require('fs');var path=require(_0xf48d('0x5'));var rimraf=require(_0xf48d('0x6'));var config=require(_0xf48d('0x7'));var attributes=require(_0xf48d('0x8'));module[_0xf48d('0x9')]=function(_0xdb6283,_0x42294e){return _0xdb6283[_0xf48d('0xa')]('IntegrationReport',attributes,{'tableName':_0xf48d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedc8=['define','IntegrationReport','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2a5549,_0x5b6508){var _0x205be7=function(_0x45d2d3){while(--_0x45d2d3){_0x2a5549['push'](_0x2a5549['shift']());}};_0x205be7(++_0x5b6508);}(_0xedc8,0xca));var _0x8edc=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xedc8[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x8edc('0x0'));var util=require('util');var logger=require(_0x8edc('0x1'))(_0x8edc('0x2'));var moment=require(_0x8edc('0x3'));var BPromise=require(_0x8edc('0x4'));var rp=require(_0x8edc('0x5'));var fs=require('fs');var path=require(_0x8edc('0x6'));var rimraf=require(_0x8edc('0x7'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module['exports']=function(_0xffb8ef,_0x47caca){return _0xffb8ef[_0x8edc('0x8')](_0x8edc('0x9'),attributes,{'tableName':'report_integration','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 52c18ec..bb412b1 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 _0x1261=['then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x3cb194,_0x356817){var _0x36bfe5=function(_0x123ff1){while(--_0x123ff1){_0x3cb194['push'](_0x3cb194['shift']());}};_0x36bfe5(++_0x356817);}(_0x1261,0x144));var _0x1126=function(_0x40292e,_0xaa2a7b){_0x40292e=_0x40292e-0x0;var _0x1ed986=_0x1261[_0x40292e];return _0x1ed986;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});} \ No newline at end of file +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(_0x1ad453,_0x79af8f){var _0x2f2761=function(_0x21df85){while(--_0x21df85){_0x1ad453['push'](_0x1ad453['shift']());}};_0x2f2761(++_0x79af8f);}(_0x2675,0x75));var _0x5267=function(_0x1af69b,_0x5578e4){_0x1af69b=_0x1af69b-0x0;var _0x3b37b4=_0x2675[_0x1af69b];return _0x3b37b4;};'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 6418de0..841d867 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 _0x22ca=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','index','get','/:id','/:id/sub_intervals','isAuthenticated','getIntervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','delete','destroy','exports','multer','util'];(function(_0x55d829,_0x43f06c){var _0x52163b=function(_0x493cd8){while(--_0x493cd8){_0x55d829['push'](_0x55d829['shift']());}};_0x52163b(++_0x43f06c);}(_0x22ca,0x1d9));var _0xa22c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x22ca[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xa22c('0x0'));var util=require(_0xa22c('0x1'));var path=require(_0xa22c('0x2'));var timeout=require(_0xa22c('0x3'));var express=require(_0xa22c('0x4'));var router=express[_0xa22c('0x5')]();var fs_extra=require(_0xa22c('0x6'));var auth=require(_0xa22c('0x7'));var interaction=require(_0xa22c('0x8'));var config=require(_0xa22c('0x9'));var controller=require(_0xa22c('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xa22c('0xb')]);router[_0xa22c('0xc')](_0xa22c('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0xa22c('0xe'),auth[_0xa22c('0xf')](),controller[_0xa22c('0x10')]);router[_0xa22c('0x11')]('/',auth[_0xa22c('0xf')](),controller['create']);router[_0xa22c('0x11')](_0xa22c('0xe'),auth['isAuthenticated'](),controller[_0xa22c('0x12')]);router[_0xa22c('0x11')](_0xa22c('0x13'),auth[_0xa22c('0xf')](),controller[_0xa22c('0x14')]);router[_0xa22c('0x15')](_0xa22c('0xd'),auth[_0xa22c('0xf')](),controller['update']);router[_0xa22c('0x16')](_0xa22c('0xd'),auth['isAuthenticated'](),controller[_0xa22c('0x17')]);module[_0xa22c('0x18')]=router; \ No newline at end of file +var _0x85d3=['put','/:id','update','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','/:id/sub_intervals','getIntervals','create','post','addInterval','/:id/sub_intervals/create_many','addIntervals'];(function(_0x4c6bb3,_0x11fcd7){var _0x238d5d=function(_0x5f29eb){while(--_0x5f29eb){_0x4c6bb3['push'](_0x4c6bb3['shift']());}};_0x238d5d(++_0x11fcd7);}(_0x85d3,0x1a9));var _0x385d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x85d3[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x385d('0x0'));var path=require(_0x385d('0x1'));var timeout=require(_0x385d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x385d('0x3'));var auth=require(_0x385d('0x4'));var interaction=require(_0x385d('0x5'));var config=require('../../config/environment');var controller=require(_0x385d('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x385d('0x7')]('/:id',auth[_0x385d('0x8')](),controller['show']);router[_0x385d('0x7')](_0x385d('0x9'),auth['isAuthenticated'](),controller[_0x385d('0xa')]);router['post']('/',auth[_0x385d('0x8')](),controller[_0x385d('0xb')]);router[_0x385d('0xc')]('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0x385d('0xd')]);router[_0x385d('0xc')](_0x385d('0xe'),auth[_0x385d('0x8')](),controller[_0x385d('0xf')]);router[_0x385d('0x10')](_0x385d('0x11'),auth[_0x385d('0x8')](),controller[_0x385d('0x12')]);router['delete'](_0x385d('0x11'),auth[_0x385d('0x8')](),controller[_0x385d('0x13')]);module[_0x385d('0x14')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 251ff2b..a347762 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 _0x796a=['sequelize','exports','STRING'];(function(_0x43c435,_0x10a7e6){var _0x9b076f=function(_0x5c3dc6){while(--_0x5c3dc6){_0x43c435['push'](_0x43c435['shift']());}};_0x9b076f(++_0x10a7e6);}(_0x796a,0xa5));var _0xa796=function(_0x5baadf,_0x1bb942){_0x5baadf=_0x5baadf-0x0;var _0x3cd985=_0x796a[_0x5baadf];return _0x3cd985;};'use strict';var Sequelize=require(_0xa796('0x0'));module[_0xa796('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa796('0x2')]},'interval':{'type':Sequelize[_0xa796('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x7032=['sequelize','exports','STRING'];(function(_0x515297,_0x84277){var _0x3c9e66=function(_0x1e1955){while(--_0x1e1955){_0x515297['push'](_0x515297['shift']());}};_0x3c9e66(++_0x84277);}(_0x7032,0x162));var _0x2703=function(_0x13e758,_0x317d23){_0x13e758=_0x13e758-0x0;var _0x5b53c3=_0x7032[_0x13e758];return _0x5b53c3;};'use strict';var Sequelize=require(_0x2703('0x0'));module[_0x2703('0x1')]={'name':{'type':Sequelize[_0x2703('0x2')]},'description':{'type':Sequelize[_0x2703('0x2')]},'interval':{'type':Sequelize[_0x2703('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 00f7c9a..f0570e5 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 _0x2c11=['hasOwnProperty','sort','where','filters','filter','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','order','nolimit','addIntervals','transaction','bulkCreate','findAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','Intervals','then','name','send','map','Interval','rawAttributes','fieldName','type','query','model','attributes','intersection','fields','length'];(function(_0x2a1f5c,_0x49b13f){var _0x43ce3d=function(_0x66f0bd){while(--_0x66f0bd){_0x2a1f5c['push'](_0x2a1f5c['shift']());}};_0x43ce3d(++_0x49b13f);}(_0x2c11,0xd2));var _0x12c1=function(_0x306106,_0x7dc50d){_0x306106=_0x306106-0x0;var _0x4d6083=_0x2c11[_0x306106];return _0x4d6083;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x12c1('0x0'));var zipdir=require(_0x12c1('0x1'));var jsonpatch=require(_0x12c1('0x2'));var rp=require(_0x12c1('0x3'));var moment=require(_0x12c1('0x4'));var BPromise=require(_0x12c1('0x5'));var Mustache=require('mustache');var util=require(_0x12c1('0x6'));var path=require('path');var sox=require(_0x12c1('0x7'));var csv=require(_0x12c1('0x8'));var ejs=require(_0x12c1('0x9'));var fs=require('fs');var fs_extra=require(_0x12c1('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x12c1('0xb'));var jsforce=require(_0x12c1('0xc'));var deskjs=require(_0x12c1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x12c1('0xe'));var Papa=require(_0x12c1('0xf'));var Redis=require('ioredis');var authService=require(_0x12c1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x12c1('0x11'));var hardwareService=require(_0x12c1('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x12c1('0x13'));var licenseUtil=require(_0x12c1('0x14'));var db=require(_0x12c1('0x15'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x1ad8f6,_0x516377){_0x516377=_0x516377||0xcc;return function(_0x34ff8d){if(_0x34ff8d){return _0x1ad8f6[_0x12c1('0x16')](_0x516377);}return _0x1ad8f6[_0x12c1('0x17')](_0x516377)[_0x12c1('0x18')]();};}function respondWithResult(_0xa85b81,_0x7b1888){_0x7b1888=_0x7b1888||0xc8;return function(_0x43d514){if(_0x43d514){return _0xa85b81[_0x12c1('0x17')](_0x7b1888)[_0x12c1('0x19')](_0x43d514);}};}function respondWithFilteredResult(_0x13ed22,_0x3a3d7d){return function(_0x453f7b){if(_0x453f7b){var _0x192897=typeof _0x3a3d7d[_0x12c1('0x1a')]===_0x12c1('0x1b')&&typeof _0x3a3d7d[_0x12c1('0x1c')]===_0x12c1('0x1b');var _0x2b537b=_0x453f7b[_0x12c1('0x1d')];var _0x5bad03=_0x192897?0x0:_0x3a3d7d[_0x12c1('0x1a')];var _0x270670=_0x192897?_0x453f7b[_0x12c1('0x1d')]:_0x3a3d7d[_0x12c1('0x1a')]+_0x3a3d7d['limit'];var _0x55ac9c;if(_0x270670>=_0x2b537b){_0x270670=_0x2b537b;_0x55ac9c=0xc8;}else{_0x55ac9c=0xce;}_0x13ed22['status'](_0x55ac9c);return _0x13ed22[_0x12c1('0x1e')](_0x12c1('0x1f'),_0x5bad03+'-'+_0x270670+'/'+_0x2b537b)[_0x12c1('0x19')](_0x453f7b);}return null;};}function patchUpdates(_0x3630ea){return function(_0x3268c2){try{jsonpatch['apply'](_0x3268c2,_0x3630ea,!![]);}catch(_0x29e007){return BPromise[_0x12c1('0x20')](_0x29e007);}return _0x3268c2[_0x12c1('0x21')]();};}function saveUpdates(_0x22ae29,_0x5885d2){return function(_0x836082){if(_0x836082){return _0x836082[_0x12c1('0x22')](_0x22ae29)['then'](function(_0x207c9e){return _0x207c9e;});}return null;};}function removeEntity(_0x3bd7af,_0x5e0114){return function(_0x175b22){if(_0x175b22){return _0x175b22[_0x12c1('0x23')]()['then'](function(){var _0x4292a4=_0x175b22['get']({'plain':!![]});var _0x2d0436=_0x12c1('0x24');return db['UserProfileResource'][_0x12c1('0x23')]({'where':{'type':_0x2d0436,'resourceId':_0x4292a4['id']}})[_0x12c1('0x25')](function(){return _0x175b22;});})[_0x12c1('0x25')](function(){_0x3bd7af[_0x12c1('0x17')](0xcc)[_0x12c1('0x18')]();});}};}function handleEntityNotFound(_0x4e0fda,_0x8d778c){return function(_0x5edc80){if(!_0x5edc80){_0x4e0fda[_0x12c1('0x16')](0x194);}return _0x5edc80;};}function handleError(_0x46497d,_0x411862){_0x411862=_0x411862||0x1f4;return function(_0x1623a5){logger['error'](_0x1623a5['stack']);if(_0x1623a5[_0x12c1('0x26')]){delete _0x1623a5[_0x12c1('0x26')];}_0x46497d[_0x12c1('0x17')](_0x411862)[_0x12c1('0x27')](_0x1623a5);};}exports['index']=function(_0x118f70,_0x8eb76c){var _0x1d4dfa={},_0x12a721={},_0x5b5fe7={'count':0x0,'rows':[]};var _0x2cd57e=_[_0x12c1('0x28')](db[_0x12c1('0x29')][_0x12c1('0x2a')],function(_0x316c2e){return{'name':_0x316c2e[_0x12c1('0x2b')],'type':_0x316c2e[_0x12c1('0x2c')]['key']};});_0x12a721['model']=_[_0x12c1('0x28')](_0x2cd57e,_0x12c1('0x26'));_0x12a721[_0x12c1('0x2d')]=_['keys'](_0x118f70['query']);_0x12a721['filters']=_['intersection'](_0x12a721[_0x12c1('0x2e')],_0x12a721[_0x12c1('0x2d')]);_0x1d4dfa[_0x12c1('0x2f')]=_[_0x12c1('0x30')](_0x12a721['model'],qs[_0x12c1('0x31')](_0x118f70[_0x12c1('0x2d')][_0x12c1('0x31')]));_0x1d4dfa['attributes']=_0x1d4dfa[_0x12c1('0x2f')][_0x12c1('0x32')]?_0x1d4dfa[_0x12c1('0x2f')]:_0x12a721[_0x12c1('0x2e')];if(!_0x118f70['query'][_0x12c1('0x33')]('nolimit')){_0x1d4dfa['limit']=qs[_0x12c1('0x1c')](_0x118f70[_0x12c1('0x2d')]['limit']);_0x1d4dfa[_0x12c1('0x1a')]=qs[_0x12c1('0x1a')](_0x118f70['query'][_0x12c1('0x1a')]);}_0x1d4dfa['order']=qs[_0x12c1('0x34')](_0x118f70[_0x12c1('0x2d')][_0x12c1('0x34')]);_0x1d4dfa[_0x12c1('0x35')]=qs[_0x12c1('0x36')](_['pick'](_0x118f70['query'],_0x12a721[_0x12c1('0x36')]),_0x2cd57e);if(_0x118f70['query'][_0x12c1('0x37')]){_0x1d4dfa[_0x12c1('0x35')]=_[_0x12c1('0x38')](_0x1d4dfa[_0x12c1('0x35')],{'$or':_[_0x12c1('0x28')](_0x2cd57e,function(_0x1b7c99){if(_0x1b7c99['type']!=='VIRTUAL'){var _0x4e012b={};_0x4e012b[_0x1b7c99[_0x12c1('0x26')]]={'$like':'%'+_0x118f70[_0x12c1('0x2d')][_0x12c1('0x37')]+'%'};return _0x4e012b;}})});}_0x1d4dfa=_[_0x12c1('0x38')]({},_0x1d4dfa,_0x118f70[_0x12c1('0x39')]);var _0x2d4e6b={'where':_0x1d4dfa[_0x12c1('0x35')]};return db[_0x12c1('0x29')][_0x12c1('0x1d')](_0x2d4e6b)[_0x12c1('0x25')](function(_0x581689){_0x5b5fe7[_0x12c1('0x1d')]=_0x581689;if(_0x118f70['query'][_0x12c1('0x3a')]){_0x1d4dfa[_0x12c1('0x3b')]=[{'all':!![]}];}return db[_0x12c1('0x29')]['findAll'](_0x1d4dfa);})[_0x12c1('0x25')](function(_0x259ed5){_0x5b5fe7[_0x12c1('0x3c')]=_0x259ed5;return _0x5b5fe7;})[_0x12c1('0x25')](respondWithFilteredResult(_0x8eb76c,_0x1d4dfa))[_0x12c1('0x3d')](handleError(_0x8eb76c,null));};exports[_0x12c1('0x3e')]=function(_0x56b4ce,_0x5d210c){var _0x5485a2={'raw':!![],'where':{'id':_0x56b4ce[_0x12c1('0x3f')]['id']}},_0x281bd8={};_0x281bd8[_0x12c1('0x2e')]=_[_0x12c1('0x40')](db['Interval']['rawAttributes']);_0x281bd8['query']=_[_0x12c1('0x40')](_0x56b4ce[_0x12c1('0x2d')]);_0x281bd8['filters']=_[_0x12c1('0x30')](_0x281bd8[_0x12c1('0x2e')],_0x281bd8[_0x12c1('0x2d')]);_0x5485a2[_0x12c1('0x2f')]=_[_0x12c1('0x30')](_0x281bd8['model'],qs[_0x12c1('0x31')](_0x56b4ce[_0x12c1('0x2d')][_0x12c1('0x31')]));_0x5485a2[_0x12c1('0x2f')]=_0x5485a2[_0x12c1('0x2f')][_0x12c1('0x32')]?_0x5485a2[_0x12c1('0x2f')]:_0x281bd8[_0x12c1('0x2e')];if(_0x56b4ce[_0x12c1('0x2d')]['includeAll']){_0x5485a2[_0x12c1('0x3b')]=[{'all':!![]}];}_0x5485a2=_[_0x12c1('0x38')]({},_0x5485a2,_0x56b4ce[_0x12c1('0x39')]);return db[_0x12c1('0x29')][_0x12c1('0x41')](_0x5485a2)[_0x12c1('0x25')](handleEntityNotFound(_0x5d210c,null))[_0x12c1('0x25')](respondWithResult(_0x5d210c,null))['catch'](handleError(_0x5d210c,null));};exports[_0x12c1('0x42')]=function(_0x3fdf90,_0x299c6a){return db[_0x12c1('0x29')][_0x12c1('0x42')](_0x3fdf90[_0x12c1('0x43')],{})[_0x12c1('0x25')](function(_0x1afe94){var _0x596e93=_0x3fdf90['user']['get']({'plain':!![]});if(!_0x596e93)throw new Error(_0x12c1('0x44'));if(_0x596e93[_0x12c1('0x45')]===_0x12c1('0x46')){var _0xff59d1=_0x1afe94[_0x12c1('0x47')]({'plain':!![]});var _0x13908e=_0x12c1('0x24');return db[_0x12c1('0x48')]['find']({'where':{'name':_0x13908e,'userProfileId':_0x596e93[_0x12c1('0x49')]},'raw':!![]})[_0x12c1('0x25')](function(_0x30cc6e){if(_0x30cc6e&&_0x30cc6e['autoAssociation']===0x0){return db[_0x12c1('0x4a')]['create']({'name':_0xff59d1['name'],'resourceId':_0xff59d1['id'],'type':_0x30cc6e[_0x12c1('0x26')],'sectionId':_0x30cc6e['id']},{})[_0x12c1('0x25')](function(){return _0x1afe94;});}else{return _0x1afe94;}})[_0x12c1('0x3d')](function(_0x4aa483){logger[_0x12c1('0x4b')](_0x12c1('0x4c'),_0x4aa483);throw _0x4aa483;});}return _0x1afe94;})[_0x12c1('0x25')](respondWithResult(_0x299c6a,0xc9))['catch'](handleError(_0x299c6a,null));};exports[_0x12c1('0x22')]=function(_0x14651e,_0x3b94c7){if(_0x14651e['body']['id']){delete _0x14651e[_0x12c1('0x43')]['id'];}return db[_0x12c1('0x29')][_0x12c1('0x41')]({'where':{'id':_0x14651e['params']['id']}})[_0x12c1('0x25')](handleEntityNotFound(_0x3b94c7,null))[_0x12c1('0x25')](saveUpdates(_0x14651e[_0x12c1('0x43')],null))[_0x12c1('0x25')](respondWithResult(_0x3b94c7,null))['catch'](handleError(_0x3b94c7,null));};exports[_0x12c1('0x23')]=function(_0x2b2864,_0x5c0fd4){return db[_0x12c1('0x29')][_0x12c1('0x41')]({'where':{'id':_0x2b2864[_0x12c1('0x3f')]['id']}})[_0x12c1('0x25')](handleEntityNotFound(_0x5c0fd4,null))[_0x12c1('0x25')](removeEntity(_0x5c0fd4,null))[_0x12c1('0x3d')](handleError(_0x5c0fd4,null));};exports[_0x12c1('0x4d')]=function(_0x14a257,_0x52c023,_0x1346e6){if(_0x14a257[_0x12c1('0x43')]['id']){delete _0x14a257['body']['id'];}return db[_0x12c1('0x29')]['find']({'where':{'id':_0x14a257[_0x12c1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x52c023,null))[_0x12c1('0x25')](function(_0x4b0356){if(_0x4b0356){_0x14a257[_0x12c1('0x43')][_0x12c1('0x4e')]=_0x4b0356['id'];return db[_0x12c1('0x29')][_0x12c1('0x42')](_0x14a257[_0x12c1('0x43')]);}})[_0x12c1('0x25')](respondWithResult(_0x52c023,null))['catch'](handleError(_0x52c023,null));};exports[_0x12c1('0x4f')]=function(_0x2800ed,_0x7ac4b7,_0x437313){var _0x2ecd4f={};var _0x4b6171={};var _0x21fc9c;var _0x4cca65;return db[_0x12c1('0x29')][_0x12c1('0x50')]({'where':{'id':_0x2800ed[_0x12c1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x7ac4b7,null))[_0x12c1('0x25')](function(_0x43b51a){if(_0x43b51a){_0x21fc9c=_0x43b51a;_0x4b6171[_0x12c1('0x2e')]=_[_0x12c1('0x40')](db[_0x12c1('0x29')][_0x12c1('0x2a')]);_0x4b6171['query']=_[_0x12c1('0x40')](_0x2800ed[_0x12c1('0x2d')]);_0x4b6171[_0x12c1('0x36')]=_['intersection'](_0x4b6171[_0x12c1('0x2e')],_0x4b6171[_0x12c1('0x2d')]);_0x2ecd4f[_0x12c1('0x2f')]=_[_0x12c1('0x30')](_0x4b6171[_0x12c1('0x2e')],qs['fields'](_0x2800ed[_0x12c1('0x2d')][_0x12c1('0x31')]));_0x2ecd4f[_0x12c1('0x2f')]=_0x2ecd4f['attributes'][_0x12c1('0x32')]?_0x2ecd4f[_0x12c1('0x2f')]:_0x4b6171['model'];_0x2ecd4f[_0x12c1('0x51')]=qs['sort'](_0x2800ed[_0x12c1('0x2d')][_0x12c1('0x34')]);_0x2ecd4f[_0x12c1('0x35')]=qs[_0x12c1('0x36')](_['pick'](_0x2800ed[_0x12c1('0x2d')],_0x4b6171[_0x12c1('0x36')]));if(_0x2800ed[_0x12c1('0x2d')][_0x12c1('0x37')]){_0x2ecd4f['where']=_[_0x12c1('0x38')](_0x2ecd4f[_0x12c1('0x35')],{'$or':_[_0x12c1('0x28')](_0x2ecd4f[_0x12c1('0x2f')],function(_0x490db4){var _0x331f2b={};_0x331f2b[_0x490db4]={'$like':'%'+_0x2800ed['query']['filter']+'%'};return _0x331f2b;})});}_0x2ecd4f=_[_0x12c1('0x38')]({},_0x2ecd4f,_0x2800ed[_0x12c1('0x39')]);return _0x21fc9c[_0x12c1('0x4f')](_0x2ecd4f);}})[_0x12c1('0x25')](function(_0x1ad014){if(_0x1ad014){_0x4cca65=_0x1ad014[_0x12c1('0x32')];if(!_0x2800ed[_0x12c1('0x2d')]['hasOwnProperty'](_0x12c1('0x52'))){_0x2ecd4f[_0x12c1('0x1c')]=qs['limit'](_0x2800ed[_0x12c1('0x2d')][_0x12c1('0x1c')]);_0x2ecd4f[_0x12c1('0x1a')]=qs[_0x12c1('0x1a')](_0x2800ed[_0x12c1('0x2d')][_0x12c1('0x1a')]);}return _0x21fc9c[_0x12c1('0x4f')](_0x2ecd4f);}})[_0x12c1('0x25')](function(_0x3bebe1){if(_0x3bebe1){return _0x3bebe1?{'count':_0x4cca65,'rows':_0x3bebe1}:null;}})[_0x12c1('0x25')](respondWithResult(_0x7ac4b7,null))[_0x12c1('0x3d')](handleError(_0x7ac4b7,null));};exports[_0x12c1('0x53')]=function(_0x899bc1,_0xb89118,_0x3e3006){return db['Interval'][_0x12c1('0x50')]({'where':{'id':_0x899bc1[_0x12c1('0x3f')]['id']}})[_0x12c1('0x25')](handleEntityNotFound(_0xb89118,null))[_0x12c1('0x25')](function(_0x182558){if(_0x182558){return db['sequelize'][_0x12c1('0x54')](function(_0x57394c){return db[_0x12c1('0x29')]['destroy']({'where':{'IntervalId':_0x899bc1[_0x12c1('0x3f')]['id']},'transaction':_0x57394c})[_0x12c1('0x25')](function(_0x27fb12){var _0x48e493=_[_0x12c1('0x28')](_0x899bc1[_0x12c1('0x43')],function(_0x4f2115){delete _0x4f2115['id'];_0x4f2115[_0x12c1('0x4e')]=_0x899bc1[_0x12c1('0x3f')]['id'];return _0x4f2115;});return db[_0x12c1('0x29')][_0x12c1('0x55')](_0x48e493,{'transaction':_0x57394c});});})['then'](function(){return db[_0x12c1('0x29')][_0x12c1('0x56')]({'where':{'IntervalId':_0x899bc1[_0x12c1('0x3f')]['id']}});});}})[_0x12c1('0x25')](respondWithResult(_0xb89118,null))[_0x12c1('0x3d')](handleError(_0xb89118,null));}; \ No newline at end of file +var _0xcff0=['fields','attributes','hasOwnProperty','order','sort','pick','where','VIRTUAL','filter','merge','options','Interval','include','rows','catch','show','params','length','includeAll','find','create','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','nolimit','addIntervals','sequelize','transaction','bulkCreate','findAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','Intervals','end','error','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection'];(function(_0x3624e5,_0x512229){var _0x48cc24=function(_0xa89771){while(--_0xa89771){_0x3624e5['push'](_0x3624e5['shift']());}};_0x48cc24(++_0x512229);}(_0xcff0,0xd8));var _0x0cff=function(_0x4a344d,_0x2fec13){_0x4a344d=_0x4a344d-0x0;var _0x1b155c=_0xcff0[_0x4a344d];return _0x1b155c;};'use strict';var emlformat=require(_0x0cff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0cff('0x1'));var jsonpatch=require(_0x0cff('0x2'));var rp=require(_0x0cff('0x3'));var moment=require(_0x0cff('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0cff('0x5'));var util=require(_0x0cff('0x6'));var path=require(_0x0cff('0x7'));var sox=require(_0x0cff('0x8'));var csv=require('to-csv');var ejs=require(_0x0cff('0x9'));var fs=require('fs');var fs_extra=require(_0x0cff('0xa'));var _=require(_0x0cff('0xb'));var squel=require(_0x0cff('0xc'));var crypto=require(_0x0cff('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0cff('0xe'));var Papa=require(_0x0cff('0xf'));var Redis=require('ioredis');var authService=require(_0x0cff('0x10'));var qs=require(_0x0cff('0x11'));var as=require(_0x0cff('0x12'));var hardwareService=require(_0x0cff('0x13'));var logger=require(_0x0cff('0x14'))(_0x0cff('0x15'));var utils=require(_0x0cff('0x16'));var config=require(_0x0cff('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0cff('0x18'))['db'];var extensions=require(_0x0cff('0x19'));function respondWithStatusCode(_0x14ee2a,_0x4b6e15){_0x4b6e15=_0x4b6e15||0xcc;return function(_0x17653f){if(_0x17653f){return _0x14ee2a['sendStatus'](_0x4b6e15);}return _0x14ee2a[_0x0cff('0x1a')](_0x4b6e15)['end']();};}function respondWithResult(_0x1bfe73,_0x17ac3a){_0x17ac3a=_0x17ac3a||0xc8;return function(_0x338d92){if(_0x338d92){return _0x1bfe73['status'](_0x17ac3a)[_0x0cff('0x1b')](_0x338d92);}};}function respondWithFilteredResult(_0x403baa,_0x28da6d){return function(_0x2be041){if(_0x2be041){var _0x1dce0a=typeof _0x28da6d[_0x0cff('0x1c')]===_0x0cff('0x1d')&&typeof _0x28da6d[_0x0cff('0x1e')]===_0x0cff('0x1d');var _0x338179=_0x2be041[_0x0cff('0x1f')];var _0x58686d=_0x1dce0a?0x0:_0x28da6d[_0x0cff('0x1c')];var _0x64bba4=_0x1dce0a?_0x2be041[_0x0cff('0x1f')]:_0x28da6d[_0x0cff('0x1c')]+_0x28da6d['limit'];var _0x16fb01;if(_0x64bba4>=_0x338179){_0x64bba4=_0x338179;_0x16fb01=0xc8;}else{_0x16fb01=0xce;}_0x403baa['status'](_0x16fb01);return _0x403baa[_0x0cff('0x20')](_0x0cff('0x21'),_0x58686d+'-'+_0x64bba4+'/'+_0x338179)[_0x0cff('0x1b')](_0x2be041);}return null;};}function patchUpdates(_0x5911de){return function(_0x2734d8){try{jsonpatch['apply'](_0x2734d8,_0x5911de,!![]);}catch(_0x1aad61){return BPromise[_0x0cff('0x22')](_0x1aad61);}return _0x2734d8['save']();};}function saveUpdates(_0x58c1b8,_0x4c9849){return function(_0x389497){if(_0x389497){return _0x389497[_0x0cff('0x23')](_0x58c1b8)[_0x0cff('0x24')](function(_0x355231){return _0x355231;});}return null;};}function removeEntity(_0x3f63aa,_0x5bccdd){return function(_0x117043){if(_0x117043){return _0x117043[_0x0cff('0x25')]()[_0x0cff('0x24')](function(){var _0x515c78=_0x117043[_0x0cff('0x26')]({'plain':!![]});var _0x21ce8e=_0x0cff('0x27');return db['UserProfileResource'][_0x0cff('0x25')]({'where':{'type':_0x21ce8e,'resourceId':_0x515c78['id']}})[_0x0cff('0x24')](function(){return _0x117043;});})[_0x0cff('0x24')](function(){_0x3f63aa[_0x0cff('0x1a')](0xcc)[_0x0cff('0x28')]();});}};}function handleEntityNotFound(_0x563794,_0x59cffc){return function(_0x9c45b9){if(!_0x9c45b9){_0x563794['sendStatus'](0x194);}return _0x9c45b9;};}function handleError(_0x3494bd,_0x55cbe4){_0x55cbe4=_0x55cbe4||0x1f4;return function(_0x51f934){logger[_0x0cff('0x29')](_0x51f934['stack']);if(_0x51f934[_0x0cff('0x2a')]){delete _0x51f934[_0x0cff('0x2a')];}_0x3494bd[_0x0cff('0x1a')](_0x55cbe4)['send'](_0x51f934);};}exports[_0x0cff('0x2b')]=function(_0x1e52a1,_0x23b76c){var _0x33310d={},_0x4f6b01={},_0x25b228={'count':0x0,'rows':[]};var _0x4c603b=_['map'](db['Interval'][_0x0cff('0x2c')],function(_0x9bf11e){return{'name':_0x9bf11e[_0x0cff('0x2d')],'type':_0x9bf11e[_0x0cff('0x2e')][_0x0cff('0x2f')]};});_0x4f6b01[_0x0cff('0x30')]=_[_0x0cff('0x31')](_0x4c603b,_0x0cff('0x2a'));_0x4f6b01[_0x0cff('0x32')]=_[_0x0cff('0x33')](_0x1e52a1[_0x0cff('0x32')]);_0x4f6b01[_0x0cff('0x34')]=_[_0x0cff('0x35')](_0x4f6b01[_0x0cff('0x30')],_0x4f6b01['query']);_0x33310d['attributes']=_['intersection'](_0x4f6b01['model'],qs[_0x0cff('0x36')](_0x1e52a1[_0x0cff('0x32')][_0x0cff('0x36')]));_0x33310d[_0x0cff('0x37')]=_0x33310d['attributes']['length']?_0x33310d[_0x0cff('0x37')]:_0x4f6b01['model'];if(!_0x1e52a1[_0x0cff('0x32')][_0x0cff('0x38')]('nolimit')){_0x33310d['limit']=qs[_0x0cff('0x1e')](_0x1e52a1[_0x0cff('0x32')][_0x0cff('0x1e')]);_0x33310d['offset']=qs[_0x0cff('0x1c')](_0x1e52a1[_0x0cff('0x32')][_0x0cff('0x1c')]);}_0x33310d[_0x0cff('0x39')]=qs[_0x0cff('0x3a')](_0x1e52a1[_0x0cff('0x32')][_0x0cff('0x3a')]);_0x33310d['where']=qs[_0x0cff('0x34')](_[_0x0cff('0x3b')](_0x1e52a1[_0x0cff('0x32')],_0x4f6b01[_0x0cff('0x34')]),_0x4c603b);if(_0x1e52a1[_0x0cff('0x32')]['filter']){_0x33310d[_0x0cff('0x3c')]=_['merge'](_0x33310d['where'],{'$or':_['map'](_0x4c603b,function(_0x26b12a){if(_0x26b12a[_0x0cff('0x2e')]!==_0x0cff('0x3d')){var _0x1183d5={};_0x1183d5[_0x26b12a[_0x0cff('0x2a')]]={'$like':'%'+_0x1e52a1[_0x0cff('0x32')][_0x0cff('0x3e')]+'%'};return _0x1183d5;}})});}_0x33310d=_[_0x0cff('0x3f')]({},_0x33310d,_0x1e52a1[_0x0cff('0x40')]);var _0x2271c1={'where':_0x33310d['where']};return db[_0x0cff('0x41')][_0x0cff('0x1f')](_0x2271c1)[_0x0cff('0x24')](function(_0x1d5a78){_0x25b228[_0x0cff('0x1f')]=_0x1d5a78;if(_0x1e52a1['query']['includeAll']){_0x33310d[_0x0cff('0x42')]=[{'all':!![]}];}return db['Interval']['findAll'](_0x33310d);})[_0x0cff('0x24')](function(_0x37b565){_0x25b228[_0x0cff('0x43')]=_0x37b565;return _0x25b228;})[_0x0cff('0x24')](respondWithFilteredResult(_0x23b76c,_0x33310d))[_0x0cff('0x44')](handleError(_0x23b76c,null));};exports[_0x0cff('0x45')]=function(_0x406553,_0x1802e0){var _0xb7a041={'raw':!![],'where':{'id':_0x406553[_0x0cff('0x46')]['id']}},_0x69607f={};_0x69607f[_0x0cff('0x30')]=_[_0x0cff('0x33')](db['Interval'][_0x0cff('0x2c')]);_0x69607f[_0x0cff('0x32')]=_[_0x0cff('0x33')](_0x406553[_0x0cff('0x32')]);_0x69607f[_0x0cff('0x34')]=_[_0x0cff('0x35')](_0x69607f[_0x0cff('0x30')],_0x69607f[_0x0cff('0x32')]);_0xb7a041[_0x0cff('0x37')]=_[_0x0cff('0x35')](_0x69607f[_0x0cff('0x30')],qs[_0x0cff('0x36')](_0x406553[_0x0cff('0x32')][_0x0cff('0x36')]));_0xb7a041[_0x0cff('0x37')]=_0xb7a041[_0x0cff('0x37')][_0x0cff('0x47')]?_0xb7a041[_0x0cff('0x37')]:_0x69607f[_0x0cff('0x30')];if(_0x406553[_0x0cff('0x32')][_0x0cff('0x48')]){_0xb7a041['include']=[{'all':!![]}];}_0xb7a041=_['merge']({},_0xb7a041,_0x406553[_0x0cff('0x40')]);return db['Interval'][_0x0cff('0x49')](_0xb7a041)[_0x0cff('0x24')](handleEntityNotFound(_0x1802e0,null))[_0x0cff('0x24')](respondWithResult(_0x1802e0,null))[_0x0cff('0x44')](handleError(_0x1802e0,null));};exports[_0x0cff('0x4a')]=function(_0x48f965,_0x496a28){return db[_0x0cff('0x41')][_0x0cff('0x4a')](_0x48f965['body'],{})[_0x0cff('0x24')](function(_0x43976a){var _0x54aeae=_0x48f965[_0x0cff('0x4b')][_0x0cff('0x26')]({'plain':!![]});if(!_0x54aeae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54aeae['role']===_0x0cff('0x4b')){var _0x273d02=_0x43976a[_0x0cff('0x26')]({'plain':!![]});var _0x1f0aa7=_0x0cff('0x27');return db[_0x0cff('0x4c')][_0x0cff('0x49')]({'where':{'name':_0x1f0aa7,'userProfileId':_0x54aeae['userProfileId']},'raw':!![]})[_0x0cff('0x24')](function(_0x319ca9){if(_0x319ca9&&_0x319ca9[_0x0cff('0x4d')]===0x0){return db[_0x0cff('0x4e')][_0x0cff('0x4a')]({'name':_0x273d02[_0x0cff('0x2a')],'resourceId':_0x273d02['id'],'type':_0x319ca9[_0x0cff('0x2a')],'sectionId':_0x319ca9['id']},{})[_0x0cff('0x24')](function(){return _0x43976a;});}else{return _0x43976a;}})[_0x0cff('0x44')](function(_0x2638a9){logger[_0x0cff('0x29')](_0x0cff('0x4f'),_0x2638a9);throw _0x2638a9;});}return _0x43976a;})[_0x0cff('0x24')](respondWithResult(_0x496a28,0xc9))[_0x0cff('0x44')](handleError(_0x496a28,null));};exports[_0x0cff('0x23')]=function(_0x5e2d24,_0x59065c){if(_0x5e2d24[_0x0cff('0x50')]['id']){delete _0x5e2d24['body']['id'];}return db['Interval'][_0x0cff('0x49')]({'where':{'id':_0x5e2d24[_0x0cff('0x46')]['id']}})[_0x0cff('0x24')](handleEntityNotFound(_0x59065c,null))[_0x0cff('0x24')](saveUpdates(_0x5e2d24[_0x0cff('0x50')],null))['then'](respondWithResult(_0x59065c,null))[_0x0cff('0x44')](handleError(_0x59065c,null));};exports[_0x0cff('0x25')]=function(_0x575a4f,_0x2ede13){return db[_0x0cff('0x41')]['find']({'where':{'id':_0x575a4f[_0x0cff('0x46')]['id']}})[_0x0cff('0x24')](handleEntityNotFound(_0x2ede13,null))[_0x0cff('0x24')](removeEntity(_0x2ede13,null))[_0x0cff('0x44')](handleError(_0x2ede13,null));};exports[_0x0cff('0x51')]=function(_0x18d75a,_0x48ec07,_0x981cc6){if(_0x18d75a['body']['id']){delete _0x18d75a['body']['id'];}return db[_0x0cff('0x41')][_0x0cff('0x49')]({'where':{'id':_0x18d75a[_0x0cff('0x46')]['id']}})[_0x0cff('0x24')](handleEntityNotFound(_0x48ec07,null))[_0x0cff('0x24')](function(_0x2c1c42){if(_0x2c1c42){_0x18d75a[_0x0cff('0x50')][_0x0cff('0x52')]=_0x2c1c42['id'];return db['Interval'][_0x0cff('0x4a')](_0x18d75a[_0x0cff('0x50')]);}})[_0x0cff('0x24')](respondWithResult(_0x48ec07,null))[_0x0cff('0x44')](handleError(_0x48ec07,null));};exports[_0x0cff('0x53')]=function(_0x55e39e,_0x37e9e0,_0x40ab84){var _0x3af6e3={};var _0x42a5b0={};var _0x48d3df;var _0x15ab59;return db['Interval']['findOne']({'where':{'id':_0x55e39e[_0x0cff('0x46')]['id']}})[_0x0cff('0x24')](handleEntityNotFound(_0x37e9e0,null))[_0x0cff('0x24')](function(_0x3b8887){if(_0x3b8887){_0x48d3df=_0x3b8887;_0x42a5b0[_0x0cff('0x30')]=_['keys'](db[_0x0cff('0x41')]['rawAttributes']);_0x42a5b0[_0x0cff('0x32')]=_[_0x0cff('0x33')](_0x55e39e[_0x0cff('0x32')]);_0x42a5b0['filters']=_['intersection'](_0x42a5b0['model'],_0x42a5b0[_0x0cff('0x32')]);_0x3af6e3[_0x0cff('0x37')]=_[_0x0cff('0x35')](_0x42a5b0[_0x0cff('0x30')],qs[_0x0cff('0x36')](_0x55e39e['query'][_0x0cff('0x36')]));_0x3af6e3[_0x0cff('0x37')]=_0x3af6e3[_0x0cff('0x37')]['length']?_0x3af6e3[_0x0cff('0x37')]:_0x42a5b0[_0x0cff('0x30')];_0x3af6e3[_0x0cff('0x39')]=qs[_0x0cff('0x3a')](_0x55e39e['query'][_0x0cff('0x3a')]);_0x3af6e3[_0x0cff('0x3c')]=qs['filters'](_[_0x0cff('0x3b')](_0x55e39e[_0x0cff('0x32')],_0x42a5b0[_0x0cff('0x34')]));if(_0x55e39e[_0x0cff('0x32')][_0x0cff('0x3e')]){_0x3af6e3['where']=_[_0x0cff('0x3f')](_0x3af6e3[_0x0cff('0x3c')],{'$or':_['map'](_0x3af6e3[_0x0cff('0x37')],function(_0x40f145){var _0x2fb44e={};_0x2fb44e[_0x40f145]={'$like':'%'+_0x55e39e[_0x0cff('0x32')][_0x0cff('0x3e')]+'%'};return _0x2fb44e;})});}_0x3af6e3=_[_0x0cff('0x3f')]({},_0x3af6e3,_0x55e39e['options']);return _0x48d3df[_0x0cff('0x53')](_0x3af6e3);}})[_0x0cff('0x24')](function(_0x597a70){if(_0x597a70){_0x15ab59=_0x597a70['length'];if(!_0x55e39e['query'][_0x0cff('0x38')](_0x0cff('0x54'))){_0x3af6e3[_0x0cff('0x1e')]=qs['limit'](_0x55e39e[_0x0cff('0x32')][_0x0cff('0x1e')]);_0x3af6e3[_0x0cff('0x1c')]=qs[_0x0cff('0x1c')](_0x55e39e[_0x0cff('0x32')][_0x0cff('0x1c')]);}return _0x48d3df['getIntervals'](_0x3af6e3);}})[_0x0cff('0x24')](function(_0xff916d){if(_0xff916d){return _0xff916d?{'count':_0x15ab59,'rows':_0xff916d}:null;}})[_0x0cff('0x24')](respondWithResult(_0x37e9e0,null))[_0x0cff('0x44')](handleError(_0x37e9e0,null));};exports[_0x0cff('0x55')]=function(_0x59f7b8,_0x2b749e,_0x2adaf1){return db['Interval']['findOne']({'where':{'id':_0x59f7b8['params']['id']}})[_0x0cff('0x24')](handleEntityNotFound(_0x2b749e,null))[_0x0cff('0x24')](function(_0x410cf6){if(_0x410cf6){return db[_0x0cff('0x56')][_0x0cff('0x57')](function(_0x21c776){return db[_0x0cff('0x41')][_0x0cff('0x25')]({'where':{'IntervalId':_0x59f7b8[_0x0cff('0x46')]['id']},'transaction':_0x21c776})[_0x0cff('0x24')](function(_0x4fd25c){var _0x48d4a0=_[_0x0cff('0x31')](_0x59f7b8[_0x0cff('0x50')],function(_0x48554d){delete _0x48554d['id'];_0x48554d[_0x0cff('0x52')]=_0x59f7b8[_0x0cff('0x46')]['id'];return _0x48554d;});return db[_0x0cff('0x41')][_0x0cff('0x58')](_0x48d4a0,{'transaction':_0x21c776});});})['then'](function(){return db[_0x0cff('0x41')][_0x0cff('0x59')]({'where':{'IntervalId':_0x59f7b8[_0x0cff('0x46')]['id']}});});}})[_0x0cff('0x24')](respondWithResult(_0x2b749e,null))[_0x0cff('0x44')](handleError(_0x2b749e,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index d5f0369..baa5db9 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 _0xa6a8=['tools_intervals','rewrite','interval','string','getIntervals','then','all','map','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','exports','Interval'];(function(_0x116415,_0x51b04c){var _0x196009=function(_0x34a8f3){while(--_0x34a8f3){_0x116415['push'](_0x116415['shift']());}};_0x196009(++_0x51b04c);}(_0xa6a8,0xc0));var _0x8a6a=function(_0x372f43,_0x49e943){_0x372f43=_0x372f43-0x0;var _0x1eec4c=_0xa6a8[_0x372f43];return _0x1eec4c;};'use strict';var attributes=require(_0x8a6a('0x0'));var extensions=require(_0x8a6a('0x1'));var iftime=require('../../utils/iftime')['iftime'];module[_0x8a6a('0x2')]=function(_0x35d93f){return _0x35d93f['define'](_0x8a6a('0x3'),attributes,{'tableName':_0x8a6a('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5f0d35){extensions['rewrite'](_0x35d93f,_0x5f0d35);},'afterBulkCreate':function(_0x248946,_0xcd065c,_0x5b3a92){_0x5b3a92();extensions[_0x8a6a('0x5')](_0x35d93f,_0x248946[0x0]);},'afterUpdate':function(_0x1888f){extensions[_0x8a6a('0x5')](_0x35d93f,_0x1888f);},'afterDestroy':function(_0x5ce0be){extensions['rewrite'](_0x35d93f,_0x5ce0be);}},'instanceMethods':{'ifTime':function(_0xb069e7=undefined,_0x3aa150=new Date()){if(typeof this[_0x8a6a('0x6')]===_0x8a6a('0x7')){return iftime(this[_0x8a6a('0x6')],_0xb069e7,_0x3aa150);}else{return this[_0x8a6a('0x8')]()[_0x8a6a('0x9')](function(_0x29bd0e){return Promise[_0x8a6a('0xa')](_0x29bd0e[_0x8a6a('0xb')](function(_0x1b9c44){return _0x1b9c44[_0x8a6a('0xc')](_0xb069e7,_0x3aa150);}));})['then'](function(_0x12d0dc){return _0x12d0dc[_0x8a6a('0xd')](function(_0x48f86f,_0x4bfd51){return _0x48f86f||_0x4bfd51;},![]);});}}}});}; \ No newline at end of file +var _0x05a4=['then','ifTime','reduce','../../components/extensions/rewrite','../../utils/iftime','iftime','Interval','rewrite','string','interval','getIntervals'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x05a4,0x12c));var _0x405a=function(_0x222a68,_0x22090d){_0x222a68=_0x222a68-0x0;var _0x3d8bbc=_0x05a4[_0x222a68];return _0x3d8bbc;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0x405a('0x0'));var iftime=require(_0x405a('0x1'))[_0x405a('0x2')];module['exports']=function(_0x2c5e50){return _0x2c5e50['define'](_0x405a('0x3'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x271772){extensions[_0x405a('0x4')](_0x2c5e50,_0x271772);},'afterBulkCreate':function(_0x15670f,_0x4f8404,_0x342f59){_0x342f59();extensions[_0x405a('0x4')](_0x2c5e50,_0x15670f[0x0]);},'afterUpdate':function(_0x5472a9){extensions[_0x405a('0x4')](_0x2c5e50,_0x5472a9);},'afterDestroy':function(_0x327c97){extensions[_0x405a('0x4')](_0x2c5e50,_0x327c97);}},'instanceMethods':{'ifTime':function(_0x43535b=undefined,_0xfc07a7=new Date()){if(typeof this['interval']===_0x405a('0x5')){return iftime(this[_0x405a('0x6')],_0x43535b,_0xfc07a7);}else{return this[_0x405a('0x7')]()[_0x405a('0x8')](function(_0x28c9f1){return Promise['all'](_0x28c9f1['map'](function(_0x31fded){return _0x31fded[_0x405a('0x9')](_0x43535b,_0xfc07a7);}));})[_0x405a('0x8')](function(_0x26946d){return _0x26946d[_0x405a('0xa')](function(_0x81a7e5,_0x56c0cb){return _0x81a7e5||_0x56c0cb;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 9baa8cf..10e0e76 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 _0xa0f1=['timezone','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','lodash','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','raw','where','attributes','limit','include','model','map','debug','stringify','catch','message','error','find','then','info','ShowInterval','all','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','ifTime','IntervalIftime','isArray','intervals','string'];(function(_0x169600,_0x1d1346){var _0x3bee22=function(_0x19639b){while(--_0x19639b){_0x169600['push'](_0x169600['shift']());}};_0x3bee22(++_0x1d1346);}(_0xa0f1,0x1d2));var _0x1a0f=function(_0x41ffd9,_0x1c8414){_0x41ffd9=_0x41ffd9-0x0;var _0x225e4c=_0xa0f1[_0x41ffd9];return _0x225e4c;};'use strict';var _=require(_0x1a0f('0x0'));var util=require(_0x1a0f('0x1'));var db=require(_0x1a0f('0x2'))['db'];var iftime=require(_0x1a0f('0x3'))[_0x1a0f('0x4')];var logger=require(_0x1a0f('0x5'))(_0x1a0f('0x6'));exports[_0x1a0f('0x7')]=function(_0x571dd4){var _0x595714=this;return new Promise(function(_0x4aa751,_0x29bfac){return db[_0x1a0f('0x8')][_0x1a0f('0x9')]({'raw':_0x571dd4[_0x1a0f('0xa')]?_0x571dd4[_0x1a0f('0xa')][_0x1a0f('0xb')]===undefined?!![]:![]:!![],'where':_0x571dd4[_0x1a0f('0xa')]?_0x571dd4['options'][_0x1a0f('0xc')]||null:null,'attributes':_0x571dd4[_0x1a0f('0xa')]?_0x571dd4[_0x1a0f('0xa')][_0x1a0f('0xd')]||null:null,'limit':_0x571dd4[_0x1a0f('0xa')]?_0x571dd4[_0x1a0f('0xa')][_0x1a0f('0xe')]||null:null,'include':_0x571dd4[_0x1a0f('0xa')]?_0x571dd4['options'][_0x1a0f('0xf')]?_['map'](_0x571dd4[_0x1a0f('0xa')][_0x1a0f('0xf')],function(_0x302e23){return{'model':db[_0x302e23[_0x1a0f('0x10')]],'as':_0x302e23['as'],'attributes':_0x302e23[_0x1a0f('0xd')],'include':_0x302e23[_0x1a0f('0xf')]?_[_0x1a0f('0x11')](_0x302e23[_0x1a0f('0xf')],function(_0x4f6ad4){return{'model':db[_0x4f6ad4[_0x1a0f('0x10')]],'as':_0x4f6ad4['as'],'attributes':_0x4f6ad4[_0x1a0f('0xd')],'include':_0x4f6ad4[_0x1a0f('0xf')]?_[_0x1a0f('0x11')](_0x4f6ad4[_0x1a0f('0xf')],function(_0x1e35bf){return{'model':db[_0x1e35bf['model']],'as':_0x1e35bf['as'],'attributes':_0x1e35bf[_0x1a0f('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30c5f4){logger['info']('GetInterval',_0x571dd4);logger[_0x1a0f('0x12')]('GetInterval',_0x571dd4,JSON[_0x1a0f('0x13')](_0x30c5f4));_0x4aa751(_0x30c5f4);})[_0x1a0f('0x14')](function(_0xf39655){logger['error'](_0x1a0f('0x7'),_0xf39655[_0x1a0f('0x15')],_0x571dd4);_0x29bfac(_0x595714[_0x1a0f('0x16')](0x1f4,_0xf39655[_0x1a0f('0x15')]));});});};exports['ShowInterval']=function(_0x1c3d41){var _0x39a296=this;return new Promise(function(_0x5943ac,_0xa50141){return db[_0x1a0f('0x8')][_0x1a0f('0x17')]({'raw':_0x1c3d41['options']?_0x1c3d41[_0x1a0f('0xa')][_0x1a0f('0xb')]===undefined?!![]:![]:!![],'where':_0x1c3d41[_0x1a0f('0xa')]?_0x1c3d41[_0x1a0f('0xa')][_0x1a0f('0xc')]||null:null,'attributes':_0x1c3d41[_0x1a0f('0xa')]?_0x1c3d41[_0x1a0f('0xa')]['attributes']||null:null,'include':_0x1c3d41['options']?_0x1c3d41[_0x1a0f('0xa')][_0x1a0f('0xf')]?_[_0x1a0f('0x11')](_0x1c3d41[_0x1a0f('0xa')][_0x1a0f('0xf')],function(_0x1efb27){return{'model':db[_0x1efb27['model']],'as':_0x1efb27['as'],'attributes':_0x1efb27['attributes'],'include':_0x1efb27['include']?_['map'](_0x1efb27[_0x1a0f('0xf')],function(_0xea5f2e){return{'model':db[_0xea5f2e[_0x1a0f('0x10')]],'as':_0xea5f2e['as'],'attributes':_0xea5f2e[_0x1a0f('0xd')],'include':_0xea5f2e[_0x1a0f('0xf')]?_[_0x1a0f('0x11')](_0xea5f2e['include'],function(_0x46f738){return{'model':db[_0x46f738[_0x1a0f('0x10')]],'as':_0x46f738['as'],'attributes':_0x46f738['attributes']};}):[]};}):[]};}):[]:[]})[_0x1a0f('0x18')](function(_0x3c2b14){logger[_0x1a0f('0x19')](_0x1a0f('0x1a'),_0x1c3d41);logger[_0x1a0f('0x12')](_0x1a0f('0x1a'),_0x1c3d41,JSON[_0x1a0f('0x13')](_0x3c2b14));_0x5943ac(_0x3c2b14);})['catch'](function(_0x11704d){logger['error']('ShowInterval',_0x11704d[_0x1a0f('0x15')],_0x1c3d41);_0xa50141(_0x39a296[_0x1a0f('0x16')](0x1f4,_0x11704d[_0x1a0f('0x15')]));});});};function checkArrayOfIntervals(_0x36a2a3,_0x37a0e5){var _0x2bc1ba=[];return db[_0x1a0f('0x8')][_0x1a0f('0x9')]({'where':{'id':_0x36a2a3}})['then'](function(_0xf75c2d){_0x2bc1ba=_0xf75c2d;return Promise[_0x1a0f('0x1b')](_0x2bc1ba[_0x1a0f('0x11')](function(_0x382e05){return _0x382e05['ifTime'](_0x37a0e5);}));})[_0x1a0f('0x18')](function(_0x21cefa){var _0x44b153=_0x21cefa[_0x1a0f('0x1c')](function(_0x3c003f,_0x3d0ea7){return _0x3c003f||_0x3d0ea7;},![]);logger['info'](util[_0x1a0f('0x1d')](_0x1a0f('0x1e'),_0x2bc1ba[_0x1a0f('0x11')](function(_0x5e6824){return _0x5e6824[_0x1a0f('0x1f')];})['join'](',\x20'),_0x2bc1ba[_0x1a0f('0x11')](function(_0x3e6587){return _0x3e6587['id'];})[_0x1a0f('0x20')](',\x20')));return _0x44b153;});}function checkSingleInterval(_0x273a45,_0x23cac4){return db[_0x1a0f('0x8')][_0x1a0f('0x21')](_0x273a45)['then'](function(_0x538cd1){if(_0x538cd1){logger['info'](util[_0x1a0f('0x1d')](_0x1a0f('0x22'),_0x538cd1[_0x1a0f('0x1f')],_0x538cd1['id']));return _0x538cd1[_0x1a0f('0x23')](_0x23cac4);}});}exports[_0x1a0f('0x24')]=function(_0x41e944){var _0x2fd99f=_0x41e944['intervalIds'];var _0x9c0b45=Array[_0x1a0f('0x25')](_0x41e944[_0x1a0f('0x26')])?_0x41e944[_0x1a0f('0x26')]:typeof _0x41e944[_0x1a0f('0x26')]===_0x1a0f('0x27')?[_0x41e944['intervals']]:[];var _0x122add=_0x41e944[_0x1a0f('0x28')]||undefined;var _0x17eec2=![];if(_0x9c0b45['length']){logger[_0x1a0f('0x19')](util[_0x1a0f('0x1d')](_0x1a0f('0x29'),_0x9c0b45['join'](';\x20')));}if(_0x122add){logger[_0x1a0f('0x19')](util[_0x1a0f('0x1d')](_0x1a0f('0x2a'),_0x122add));}logger[_0x1a0f('0x12')](_0x1a0f('0x2b'),_0x17eec2);logger[_0x1a0f('0x2c')](_0x1a0f('0x24'),_0x41e944);return Promise[_0x1a0f('0x2d')]()[_0x1a0f('0x18')](function(){if(Array['isArray'](_0x2fd99f)){return checkArrayOfIntervals(_0x2fd99f,_0x122add);}else if(_0x2fd99f){return checkSingleInterval(_0x2fd99f,_0x122add);}})[_0x1a0f('0x18')](function(_0x190632){var _0x826ed5=_0x9c0b45[_0x1a0f('0x1c')](function(_0x12aae1,_0x29cd44){return _0x12aae1||iftime(_0x29cd44,_0x122add);},![]);_0x17eec2=_0x190632||_0x826ed5;return _0x17eec2;})[_0x1a0f('0x14')](function(_0x4ca67c){logger[_0x1a0f('0x16')](_0x1a0f('0x24'),_0x41e944,_0x4ca67c);throw this[_0x1a0f('0x16')](0x1f4,_0x4ca67c[_0x1a0f('0x15')]);});}; \ No newline at end of file +var _0x1432=['debug','all','ifTime','reduce','format','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','intervals','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','silly','resolve','isArray','util','../../mysqldb','../../utils/iftime','iftime','rpc','GetInterval','Interval','findAll','options','raw','attributes','limit','map','include','model','then','stringify','catch','message','error','ShowInterval','find','where','info'];(function(_0x3d075a,_0x507f04){var _0x418be1=function(_0x19c75b){while(--_0x19c75b){_0x3d075a['push'](_0x3d075a['shift']());}};_0x418be1(++_0x507f04);}(_0x1432,0xea));var _0x2143=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0x1432[_0xb24a3e];return _0x4038d7;};'use strict';var _=require('lodash');var util=require(_0x2143('0x0'));var db=require(_0x2143('0x1'))['db'];var iftime=require(_0x2143('0x2'))[_0x2143('0x3')];var logger=require('../../config/logger')(_0x2143('0x4'));exports[_0x2143('0x5')]=function(_0x366b87){var _0x47d4fe=this;return new Promise(function(_0x1d7bfb,_0x92596){return db[_0x2143('0x6')][_0x2143('0x7')]({'raw':_0x366b87[_0x2143('0x8')]?_0x366b87[_0x2143('0x8')][_0x2143('0x9')]===undefined?!![]:![]:!![],'where':_0x366b87[_0x2143('0x8')]?_0x366b87['options']['where']||null:null,'attributes':_0x366b87[_0x2143('0x8')]?_0x366b87[_0x2143('0x8')][_0x2143('0xa')]||null:null,'limit':_0x366b87[_0x2143('0x8')]?_0x366b87['options'][_0x2143('0xb')]||null:null,'include':_0x366b87[_0x2143('0x8')]?_0x366b87[_0x2143('0x8')]['include']?_[_0x2143('0xc')](_0x366b87['options'][_0x2143('0xd')],function(_0x55e07f){return{'model':db[_0x55e07f[_0x2143('0xe')]],'as':_0x55e07f['as'],'attributes':_0x55e07f['attributes'],'include':_0x55e07f[_0x2143('0xd')]?_[_0x2143('0xc')](_0x55e07f[_0x2143('0xd')],function(_0x232d72){return{'model':db[_0x232d72[_0x2143('0xe')]],'as':_0x232d72['as'],'attributes':_0x232d72[_0x2143('0xa')],'include':_0x232d72[_0x2143('0xd')]?_[_0x2143('0xc')](_0x232d72['include'],function(_0x4ebf14){return{'model':db[_0x4ebf14[_0x2143('0xe')]],'as':_0x4ebf14['as'],'attributes':_0x4ebf14['attributes']};}):[]};}):[]};}):[]:[]})[_0x2143('0xf')](function(_0x70314c){logger['info']('GetInterval',_0x366b87);logger['debug']('GetInterval',_0x366b87,JSON[_0x2143('0x10')](_0x70314c));_0x1d7bfb(_0x70314c);})[_0x2143('0x11')](function(_0x1b5d60){logger['error'](_0x2143('0x5'),_0x1b5d60[_0x2143('0x12')],_0x366b87);_0x92596(_0x47d4fe[_0x2143('0x13')](0x1f4,_0x1b5d60[_0x2143('0x12')]));});});};exports[_0x2143('0x14')]=function(_0x16edaf){var _0xb55c22=this;return new Promise(function(_0x22152b,_0x202ed3){return db[_0x2143('0x6')][_0x2143('0x15')]({'raw':_0x16edaf[_0x2143('0x8')]?_0x16edaf[_0x2143('0x8')][_0x2143('0x9')]===undefined?!![]:![]:!![],'where':_0x16edaf['options']?_0x16edaf[_0x2143('0x8')][_0x2143('0x16')]||null:null,'attributes':_0x16edaf[_0x2143('0x8')]?_0x16edaf[_0x2143('0x8')][_0x2143('0xa')]||null:null,'include':_0x16edaf['options']?_0x16edaf[_0x2143('0x8')][_0x2143('0xd')]?_[_0x2143('0xc')](_0x16edaf[_0x2143('0x8')][_0x2143('0xd')],function(_0x2faac1){return{'model':db[_0x2faac1[_0x2143('0xe')]],'as':_0x2faac1['as'],'attributes':_0x2faac1[_0x2143('0xa')],'include':_0x2faac1[_0x2143('0xd')]?_['map'](_0x2faac1[_0x2143('0xd')],function(_0x7ddd9a){return{'model':db[_0x7ddd9a[_0x2143('0xe')]],'as':_0x7ddd9a['as'],'attributes':_0x7ddd9a[_0x2143('0xa')],'include':_0x7ddd9a['include']?_['map'](_0x7ddd9a[_0x2143('0xd')],function(_0x174803){return{'model':db[_0x174803['model']],'as':_0x174803['as'],'attributes':_0x174803[_0x2143('0xa')]};}):[]};}):[]};}):[]:[]})[_0x2143('0xf')](function(_0x2f937c){logger[_0x2143('0x17')](_0x2143('0x14'),_0x16edaf);logger[_0x2143('0x18')](_0x2143('0x14'),_0x16edaf,JSON[_0x2143('0x10')](_0x2f937c));_0x22152b(_0x2f937c);})[_0x2143('0x11')](function(_0x4d4cc9){logger[_0x2143('0x13')](_0x2143('0x14'),_0x4d4cc9[_0x2143('0x12')],_0x16edaf);_0x202ed3(_0xb55c22['error'](0x1f4,_0x4d4cc9[_0x2143('0x12')]));});});};function checkArrayOfIntervals(_0x1262f4,_0x3db03e){var _0xaac560=[];return db['Interval']['findAll']({'where':{'id':_0x1262f4}})[_0x2143('0xf')](function(_0x50c793){_0xaac560=_0x50c793;return Promise[_0x2143('0x19')](_0xaac560['map'](function(_0x34d5c9){return _0x34d5c9[_0x2143('0x1a')](_0x3db03e);}));})[_0x2143('0xf')](function(_0x56f890){var _0xc50d36=_0x56f890[_0x2143('0x1b')](function(_0x7eb7d6,_0x4f3bc9){return _0x7eb7d6||_0x4f3bc9;},![]);logger['info'](util[_0x2143('0x1c')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0xaac560['map'](function(_0x1d547f){return _0x1d547f[_0x2143('0x1d')];})[_0x2143('0x1e')](',\x20'),_0xaac560[_0x2143('0xc')](function(_0x12e40b){return _0x12e40b['id'];})[_0x2143('0x1e')](',\x20')));return _0xc50d36;});}function checkSingleInterval(_0x5f503d,_0x1dd153){return db[_0x2143('0x6')][_0x2143('0x1f')](_0x5f503d)[_0x2143('0xf')](function(_0x4779a2){if(_0x4779a2){logger[_0x2143('0x17')](util['format'](_0x2143('0x20'),_0x4779a2['name'],_0x4779a2['id']));return _0x4779a2['ifTime'](_0x1dd153);}});}exports[_0x2143('0x21')]=function(_0x418807){var _0x52dba6=_0x418807[_0x2143('0x22')];var _0x5ad2d2=Array['isArray'](_0x418807['intervals'])?_0x418807['intervals']:typeof _0x418807[_0x2143('0x23')]==='string'?[_0x418807[_0x2143('0x23')]]:[];var _0xac5598=_0x418807[_0x2143('0x24')]||undefined;var _0x538d74=![];if(_0x5ad2d2[_0x2143('0x25')]){logger[_0x2143('0x17')](util['format'](_0x2143('0x26'),_0x5ad2d2[_0x2143('0x1e')](';\x20')));}if(_0xac5598){logger[_0x2143('0x17')](util[_0x2143('0x1c')](_0x2143('0x27'),_0xac5598));}logger[_0x2143('0x18')]('Iftime',_0x538d74);logger[_0x2143('0x28')](_0x2143('0x21'),_0x418807);return Promise[_0x2143('0x29')]()[_0x2143('0xf')](function(){if(Array[_0x2143('0x2a')](_0x52dba6)){return checkArrayOfIntervals(_0x52dba6,_0xac5598);}else if(_0x52dba6){return checkSingleInterval(_0x52dba6,_0xac5598);}})['then'](function(_0x3ddf91){var _0x243f9d=_0x5ad2d2[_0x2143('0x1b')](function(_0x26533a,_0x16cfff){return _0x26533a||iftime(_0x16cfff,_0xac5598);},![]);_0x538d74=_0x3ddf91||_0x243f9d;return _0x538d74;})[_0x2143('0x11')](function(_0x28132f){logger[_0x2143('0x13')](_0x2143('0x21'),_0x418807,_0x28132f);throw this[_0x2143('0x13')](0x1f4,_0x28132f[_0x2143('0x12')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 9bd10cb..5a17ef7 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(_0x404d98,_0x362ba9){var _0x4c3664=function(_0x9cfe64){while(--_0x9cfe64){_0x404d98['push'](_0x404d98['shift']());}};_0x4c3664(++_0x362ba9);}(_0xadb5,0xad));var _0x5adb=function(_0x461c72,_0x566f9f){_0x461c72=_0x461c72-0x0;var _0x53a747=_0xadb5[_0x461c72];return _0x53a747;};'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 _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x359220,_0x209673){var _0x188aa0=function(_0x5361a3){while(--_0x5361a3){_0x359220['push'](_0x359220['shift']());}};_0x188aa0(++_0x209673);}(_0x2ef3,0xba));var _0x32ef=function(_0x1ac8f5,_0x212f8c){_0x1ac8f5=_0x1ac8f5-0x0;var _0x21a869=_0x2ef3[_0x1ac8f5];return _0x21a869;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 23a406d..1e18bf2 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 _0x9beb=['x-forwarded-for','connection','remoteAddress','bluebird','https','api','support','MOTGUI','\x20from\x20','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','Basic\x20','toString','stringify','setEncoding','utf8','statusCode','json','api.jira','write','end','body','headers'];(function(_0x2c692f,_0x25cab4){var _0x194ce3=function(_0x37c53f){while(--_0x37c53f){_0x2c692f['push'](_0x2c692f['shift']());}};_0x194ce3(++_0x25cab4);}(_0x9beb,0x106));var _0xb9be=function(_0x9eb20f,_0x4ff05f){_0x9eb20f=_0x9eb20f-0x0;var _0x300d18=_0x9beb[_0x9eb20f];return _0x300d18;};'use strict';var BPromise=require(_0xb9be('0x0'));var https=require(_0xb9be('0x1'));var logger=require('../../config/logger')(_0xb9be('0x2'));var USERNAME=_0xb9be('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x523750,_0x15ca1d){var _0x412f73={'fields':{'project':{'key':_0x523750['key']||_0xb9be('0x4')},'summary':(_0x523750['summary']||'Report')+_0xb9be('0x5')+_0x523750['ip'],'description':_0x523750['description']||JSON['stringify'](_0x523750),'issuetype':{'name':_0x523750['issuetype']||_0xb9be('0x6')}}};_0x412f73[_0xb9be('0x7')][_0xb9be('0x8')]=_0x523750[_0xb9be('0x9')];_0x412f73['fields'][_0xb9be('0xa')]=_0x523750[_0xb9be('0xb')];_0x412f73[_0xb9be('0x7')][_0xb9be('0xc')]=_0x523750[_0xb9be('0xd')];_0x412f73['fields'][_0xb9be('0xe')]=_0x523750[_0xb9be('0xf')];_0x412f73[_0xb9be('0x7')][_0xb9be('0x10')]=_0x523750[_0xb9be('0x11')];_0x412f73[_0xb9be('0x7')][_0xb9be('0x12')]=_0x523750['ip'];var _0x23e389={'host':_0xb9be('0x13'),'port':0x1bb,'path':_0xb9be('0x14'),'method':_0xb9be('0x15'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xb9be('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0xb9be('0x17')]('base64')}};var _0x465664=JSON[_0xb9be('0x18')](_0x412f73);var _0x530bad=https['request'](_0x23e389,function(_0x18fccd){_0x18fccd[_0xb9be('0x19')](_0xb9be('0x1a'));var _0x4df305='';_0x18fccd['on']('data',function(_0xaa4d59){_0x4df305+=_0xaa4d59;});_0x18fccd['on']('end',function(){if(_0x15ca1d){return _0x15ca1d['status'](_0x18fccd[_0xb9be('0x1b')])[_0xb9be('0x1c')](JSON['parse'](_0x4df305));}});});_0x530bad['on']('error',function(_0x28827c){if(_0x15ca1d){return _0x15ca1d['status'](0x1f4)[_0xb9be('0x1c')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xb9be('0x1d')}]});}});_0x530bad[_0xb9be('0x1e')](_0x465664);_0x530bad[_0xb9be('0x1f')]();}exports['openIssue']=openIssue;exports['send']=function(_0x178ca8,_0x23469e){_0x178ca8[_0xb9be('0x20')]['ip']=_0x178ca8[_0xb9be('0x21')][_0xb9be('0x22')]||_0x178ca8[_0xb9be('0x23')][_0xb9be('0x24')]||_0x178ca8['socket']['remoteAddress']||_0x178ca8[_0xb9be('0x23')]['socket']['remoteAddress'];return openIssue(_0x178ca8['body'],_0x23469e);}; \ No newline at end of file +var _0xbdd2=['json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','body','remoteAddress','connection','bluebird','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','fields','email','customfield_11501','oldToken','customfield_11502','customfield_11504','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','setEncoding','utf8','data','end','status','statusCode'];(function(_0x32fefc,_0x1700f5){var _0x70a3a7=function(_0x24954e){while(--_0x24954e){_0x32fefc['push'](_0x32fefc['shift']());}};_0x70a3a7(++_0x1700f5);}(_0xbdd2,0x150));var _0x2bdd=function(_0x175941,_0x2e476a){_0x175941=_0x175941-0x0;var _0x2f5dff=_0xbdd2[_0x175941];return _0x2f5dff;};'use strict';var BPromise=require(_0x2bdd('0x0'));var https=require('https');var logger=require(_0x2bdd('0x1'))(_0x2bdd('0x2'));var USERNAME=_0x2bdd('0x3');var PASSWORD=_0x2bdd('0x4');function openIssue(_0x424b69,_0x48e6fe){var _0x412e67={'fields':{'project':{'key':_0x424b69[_0x2bdd('0x5')]||_0x2bdd('0x6')},'summary':(_0x424b69[_0x2bdd('0x7')]||_0x2bdd('0x8'))+_0x2bdd('0x9')+_0x424b69['ip'],'description':_0x424b69[_0x2bdd('0xa')]||JSON[_0x2bdd('0xb')](_0x424b69),'issuetype':{'name':_0x424b69[_0x2bdd('0xc')]||'Bug'}}};_0x412e67[_0x2bdd('0xd')]['customfield_11500']=_0x424b69[_0x2bdd('0xe')];_0x412e67[_0x2bdd('0xd')][_0x2bdd('0xf')]=_0x424b69[_0x2bdd('0x10')];_0x412e67[_0x2bdd('0xd')][_0x2bdd('0x11')]=_0x424b69['newToken'];_0x412e67[_0x2bdd('0xd')]['customfield_11503']=_0x424b69['name'];_0x412e67[_0x2bdd('0xd')][_0x2bdd('0x12')]=_0x424b69['reason'];_0x412e67[_0x2bdd('0xd')][_0x2bdd('0x13')]=_0x424b69['ip'];var _0x59625d={'host':_0x2bdd('0x14'),'port':0x1bb,'path':_0x2bdd('0x15'),'method':_0x2bdd('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x2bdd('0x17'),'Authorization':_0x2bdd('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x2bdd('0x19')](_0x2bdd('0x1a'))}};var _0x519629=JSON[_0x2bdd('0xb')](_0x412e67);var _0x37336a=https['request'](_0x59625d,function(_0x122cab){_0x122cab[_0x2bdd('0x1b')](_0x2bdd('0x1c'));var _0x4b4c51='';_0x122cab['on'](_0x2bdd('0x1d'),function(_0x1c53cc){_0x4b4c51+=_0x1c53cc;});_0x122cab['on'](_0x2bdd('0x1e'),function(){if(_0x48e6fe){return _0x48e6fe[_0x2bdd('0x1f')](_0x122cab[_0x2bdd('0x20')])[_0x2bdd('0x21')](JSON['parse'](_0x4b4c51));}});});_0x37336a['on'](_0x2bdd('0x22'),function(_0x3d8318){if(_0x48e6fe){return _0x48e6fe[_0x2bdd('0x1f')](0x1f4)[_0x2bdd('0x21')]({'errors':[{'message':_0x2bdd('0x23'),'type':_0x2bdd('0x24')}]});}});_0x37336a['write'](_0x519629);_0x37336a[_0x2bdd('0x1e')]();}exports[_0x2bdd('0x25')]=openIssue;exports['send']=function(_0x1b654d,_0x31a780){_0x1b654d[_0x2bdd('0x26')]['ip']=_0x1b654d['headers']['x-forwarded-for']||_0x1b654d['connection'][_0x2bdd('0x27')]||_0x1b654d['socket'][_0x2bdd('0x27')]||_0x1b654d[_0x2bdd('0x28')]['socket'][_0x2bdd('0x27')];return openIssue(_0x1b654d[_0x2bdd('0x26')],_0x31a780);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 9f28c40..b13e13f 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 _0xa74f=['/describe','isAuthenticated','describe','show','post','put','/:id','update','delete','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','index','get'];(function(_0x47764b,_0x3bf238){var _0x10d86e=function(_0x51a5a1){while(--_0x51a5a1){_0x47764b['push'](_0x47764b['shift']());}};_0x10d86e(++_0x3bf238);}(_0xa74f,0x9a));var _0xfa74=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0xa74f[_0x59d0cc];return _0x2ae79f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfa74('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfa74('0x1')]();var fs_extra=require(_0xfa74('0x2'));var auth=require(_0xfa74('0x3'));var interaction=require(_0xfa74('0x4'));var config=require('../../config/environment');var controller=require(_0xfa74('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xfa74('0x6')]);router[_0xfa74('0x7')](_0xfa74('0x8'),auth[_0xfa74('0x9')](),controller[_0xfa74('0xa')]);router[_0xfa74('0x7')]('/:id',auth[_0xfa74('0x9')](),controller[_0xfa74('0xb')]);router[_0xfa74('0xc')]('/',auth[_0xfa74('0x9')](),controller['create']);router[_0xfa74('0xd')](_0xfa74('0xe'),auth['isAuthenticated'](),controller[_0xfa74('0xf')]);router[_0xfa74('0x10')](_0xfa74('0xe'),auth[_0xfa74('0x9')](),controller['destroy']);module[_0xfa74('0x11')]=router; \ No newline at end of file +var _0xd2ea=['./jscriptyAnswerReport.controller','get','isAuthenticated','/describe','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4ea339,_0x405389){var _0x3be506=function(_0x455c4a){while(--_0x455c4a){_0x4ea339['push'](_0x4ea339['shift']());}};_0x3be506(++_0x405389);}(_0xd2ea,0x15f));var _0xad2e=function(_0x39f353,_0x152e28){_0x39f353=_0x39f353-0x0;var _0x5f4feb=_0xd2ea[_0x39f353];return _0x5f4feb;};'use strict';var multer=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var path=require(_0xad2e('0x2'));var timeout=require(_0xad2e('0x3'));var express=require(_0xad2e('0x4'));var router=express['Router']();var fs_extra=require(_0xad2e('0x5'));var auth=require(_0xad2e('0x6'));var interaction=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var controller=require(_0xad2e('0x9'));router[_0xad2e('0xa')]('/',auth[_0xad2e('0xb')](),controller['index']);router[_0xad2e('0xa')](_0xad2e('0xc'),auth[_0xad2e('0xb')](),controller['describe']);router[_0xad2e('0xa')](_0xad2e('0xd'),auth['isAuthenticated'](),controller[_0xad2e('0xe')]);router['post']('/',auth[_0xad2e('0xb')](),controller[_0xad2e('0xf')]);router[_0xad2e('0x10')](_0xad2e('0xd'),auth['isAuthenticated'](),controller[_0xad2e('0x11')]);router['delete'](_0xad2e('0xd'),auth[_0xad2e('0xb')](),controller[_0xad2e('0x12')]);module[_0xad2e('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 9162bd7..3833261 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7a54,0x106));var _0x47a5=function(_0x10945b,_0x535fbc){_0x10945b=_0x10945b-0x0;var _0x25ed9f=_0x7a54[_0x10945b];return _0x25ed9f;};'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(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x7a54,0x106));var _0x47a5=function(_0x5ed466,_0x19c023){_0x5ed466=_0x5ed466-0x0;var _0x2b8ee8=_0x7a54[_0x5ed466];return _0x2b8ee8;};'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 b02b8c2..655432c 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 _0x1501=['update','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','then','stack','name','send','index','map','JscriptyAnswerReport','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','body'];(function(_0x27b75d,_0x2e427f){var _0x45ef46=function(_0x55c93e){while(--_0x55c93e){_0x27b75d['push'](_0x27b75d['shift']());}};_0x45ef46(++_0x2e427f);}(_0x1501,0x126));var _0x1150=function(_0x5b701c,_0x23458a){_0x5b701c=_0x5b701c-0x0;var _0x580ad3=_0x1501[_0x5b701c];return _0x580ad3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1150('0x0'));var zipdir=require(_0x1150('0x1'));var jsonpatch=require(_0x1150('0x2'));var rp=require('request-promise');var moment=require(_0x1150('0x3'));var BPromise=require(_0x1150('0x4'));var Mustache=require(_0x1150('0x5'));var util=require(_0x1150('0x6'));var path=require('path');var sox=require(_0x1150('0x7'));var csv=require('to-csv');var ejs=require(_0x1150('0x8'));var fs=require('fs');var fs_extra=require(_0x1150('0x9'));var _=require(_0x1150('0xa'));var squel=require(_0x1150('0xb'));var crypto=require(_0x1150('0xc'));var jsforce=require(_0x1150('0xd'));var deskjs=require(_0x1150('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1150('0xf'));var Redis=require(_0x1150('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1150('0x11'));var hardwareService=require(_0x1150('0x12'));var logger=require(_0x1150('0x13'))(_0x1150('0x14'));var utils=require('../../config/utils');var config=require(_0x1150('0x15'));var licenseUtil=require(_0x1150('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bcf2e,_0x4ca5ef){_0x4ca5ef=_0x4ca5ef||0xcc;return function(_0x1d2549){if(_0x1d2549){return _0x3bcf2e[_0x1150('0x17')](_0x4ca5ef);}return _0x3bcf2e[_0x1150('0x18')](_0x4ca5ef)[_0x1150('0x19')]();};}function respondWithResult(_0x787aac,_0x18f378){_0x18f378=_0x18f378||0xc8;return function(_0x474069){if(_0x474069){return _0x787aac[_0x1150('0x18')](_0x18f378)['json'](_0x474069);}};}function respondWithFilteredResult(_0x498bab,_0x3cc5e7){return function(_0x146d70){if(_0x146d70){var _0x54df42=typeof _0x3cc5e7[_0x1150('0x1a')]===_0x1150('0x1b')&&typeof _0x3cc5e7[_0x1150('0x1c')]===_0x1150('0x1b');var _0x378eb8=_0x146d70[_0x1150('0x1d')];var _0x35664d=_0x54df42?0x0:_0x3cc5e7['offset'];var _0x517569=_0x54df42?_0x146d70[_0x1150('0x1d')]:_0x3cc5e7[_0x1150('0x1a')]+_0x3cc5e7['limit'];var _0x1bac5b;if(_0x517569>=_0x378eb8){_0x517569=_0x378eb8;_0x1bac5b=0xc8;}else{_0x1bac5b=0xce;}_0x498bab['status'](_0x1bac5b);return _0x498bab[_0x1150('0x1e')]('Content-Range',_0x35664d+'-'+_0x517569+'/'+_0x378eb8)[_0x1150('0x1f')](_0x146d70);}return null;};}function patchUpdates(_0x4bdae2){return function(_0x5a96f8){try{jsonpatch[_0x1150('0x20')](_0x5a96f8,_0x4bdae2,!![]);}catch(_0x2f4fec){return BPromise[_0x1150('0x21')](_0x2f4fec);}return _0x5a96f8[_0x1150('0x22')]();};}function saveUpdates(_0xd10701,_0x3e25da){return function(_0x3f5fcf){if(_0x3f5fcf){return _0x3f5fcf['update'](_0xd10701)['then'](function(_0x30ca9c){return _0x30ca9c;});}return null;};}function removeEntity(_0x28b396,_0x37da51){return function(_0x440b93){if(_0x440b93){return _0x440b93['destroy']()[_0x1150('0x23')](function(){_0x28b396[_0x1150('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b82ba,_0x497ef2){return function(_0x39b1bd){if(!_0x39b1bd){_0x4b82ba[_0x1150('0x17')](0x194);}return _0x39b1bd;};}function handleError(_0x5707ce,_0x2fbda8){_0x2fbda8=_0x2fbda8||0x1f4;return function(_0x1ebf83){logger['error'](_0x1ebf83[_0x1150('0x24')]);if(_0x1ebf83[_0x1150('0x25')]){delete _0x1ebf83[_0x1150('0x25')];}_0x5707ce[_0x1150('0x18')](_0x2fbda8)[_0x1150('0x26')](_0x1ebf83);};}exports[_0x1150('0x27')]=function(_0x213e81,_0x3a88df){var _0x4ad8f3={},_0x32c245={},_0x3b67f9={'count':0x0,'rows':[]};var _0x26f6dd=_[_0x1150('0x28')](db[_0x1150('0x29')]['rawAttributes'],function(_0x1e3691){return{'name':_0x1e3691[_0x1150('0x2a')],'type':_0x1e3691[_0x1150('0x2b')]['key']};});_0x32c245['model']=_[_0x1150('0x28')](_0x26f6dd,_0x1150('0x25'));_0x32c245[_0x1150('0x2c')]=_[_0x1150('0x2d')](_0x213e81[_0x1150('0x2c')]);_0x32c245[_0x1150('0x2e')]=_[_0x1150('0x2f')](_0x32c245['model'],_0x32c245[_0x1150('0x2c')]);_0x4ad8f3[_0x1150('0x30')]=_['intersection'](_0x32c245[_0x1150('0x31')],qs['fields'](_0x213e81['query'][_0x1150('0x32')]));_0x4ad8f3[_0x1150('0x30')]=_0x4ad8f3[_0x1150('0x30')][_0x1150('0x33')]?_0x4ad8f3['attributes']:_0x32c245[_0x1150('0x31')];if(!_0x213e81[_0x1150('0x2c')][_0x1150('0x34')](_0x1150('0x35'))){_0x4ad8f3[_0x1150('0x1c')]=qs[_0x1150('0x1c')](_0x213e81[_0x1150('0x2c')]['limit']);_0x4ad8f3[_0x1150('0x1a')]=qs[_0x1150('0x1a')](_0x213e81[_0x1150('0x2c')]['offset']);}_0x4ad8f3[_0x1150('0x36')]=qs[_0x1150('0x37')](_0x213e81[_0x1150('0x2c')]['sort']);_0x4ad8f3['where']=qs[_0x1150('0x2e')](_[_0x1150('0x38')](_0x213e81[_0x1150('0x2c')],_0x32c245['filters']),_0x26f6dd);if(_0x213e81['query'][_0x1150('0x39')]){_0x4ad8f3[_0x1150('0x3a')]=_['merge'](_0x4ad8f3[_0x1150('0x3a')],{'$or':_[_0x1150('0x28')](_0x26f6dd,function(_0x1435d3){if(_0x1435d3['type']!=='VIRTUAL'){var _0x10572e={};_0x10572e[_0x1435d3[_0x1150('0x25')]]={'$like':'%'+_0x213e81['query'][_0x1150('0x39')]+'%'};return _0x10572e;}})});}_0x4ad8f3=_[_0x1150('0x3b')]({},_0x4ad8f3,_0x213e81[_0x1150('0x3c')]);var _0x51e2cf={'where':_0x4ad8f3[_0x1150('0x3a')]};return db[_0x1150('0x29')][_0x1150('0x1d')](_0x51e2cf)[_0x1150('0x23')](function(_0x10429c){_0x3b67f9[_0x1150('0x1d')]=_0x10429c;if(_0x213e81[_0x1150('0x2c')][_0x1150('0x3d')]){_0x4ad8f3['include']=[{'all':!![]}];}return db[_0x1150('0x29')][_0x1150('0x3e')](_0x4ad8f3);})['then'](function(_0x3e56b6){_0x3b67f9[_0x1150('0x3f')]=_0x3e56b6;return _0x3b67f9;})[_0x1150('0x23')](respondWithFilteredResult(_0x3a88df,_0x4ad8f3))[_0x1150('0x40')](handleError(_0x3a88df,null));};exports[_0x1150('0x41')]=function(_0x15e483,_0x539cff){var _0x11a7ed={'raw':!![],'where':{'id':_0x15e483[_0x1150('0x42')]['id']}},_0x4db1cf={};_0x4db1cf['model']=_[_0x1150('0x2d')](db['JscriptyAnswerReport'][_0x1150('0x43')]);_0x4db1cf[_0x1150('0x2c')]=_[_0x1150('0x2d')](_0x15e483['query']);_0x4db1cf['filters']=_[_0x1150('0x2f')](_0x4db1cf[_0x1150('0x31')],_0x4db1cf['query']);_0x11a7ed[_0x1150('0x30')]=_[_0x1150('0x2f')](_0x4db1cf[_0x1150('0x31')],qs[_0x1150('0x32')](_0x15e483[_0x1150('0x2c')][_0x1150('0x32')]));_0x11a7ed[_0x1150('0x30')]=_0x11a7ed['attributes'][_0x1150('0x33')]?_0x11a7ed[_0x1150('0x30')]:_0x4db1cf[_0x1150('0x31')];if(_0x15e483['query'][_0x1150('0x3d')]){_0x11a7ed[_0x1150('0x44')]=[{'all':!![]}];}_0x11a7ed=_['merge']({},_0x11a7ed,_0x15e483['options']);return db[_0x1150('0x29')]['find'](_0x11a7ed)[_0x1150('0x23')](handleEntityNotFound(_0x539cff,null))[_0x1150('0x23')](respondWithResult(_0x539cff,null))[_0x1150('0x40')](handleError(_0x539cff,null));};exports['create']=function(_0x2160a0,_0x41f1eb){return db[_0x1150('0x29')][_0x1150('0x45')](_0x2160a0[_0x1150('0x46')],{})[_0x1150('0x23')](respondWithResult(_0x41f1eb,0xc9))[_0x1150('0x40')](handleError(_0x41f1eb,null));};exports[_0x1150('0x47')]=function(_0xedd0b7,_0x4f10a1){if(_0xedd0b7[_0x1150('0x46')]['id']){delete _0xedd0b7[_0x1150('0x46')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0xedd0b7[_0x1150('0x42')]['id']}})['then'](handleEntityNotFound(_0x4f10a1,null))['then'](saveUpdates(_0xedd0b7['body'],null))[_0x1150('0x23')](respondWithResult(_0x4f10a1,null))[_0x1150('0x40')](handleError(_0x4f10a1,null));};exports['destroy']=function(_0x18bf8b,_0x3e77f1){return db[_0x1150('0x29')]['find']({'where':{'id':_0x18bf8b[_0x1150('0x42')]['id']}})[_0x1150('0x23')](handleEntityNotFound(_0x3e77f1,null))['then'](removeEntity(_0x3e77f1,null))[_0x1150('0x40')](handleError(_0x3e77f1,null));};exports[_0x1150('0x48')]=function(_0x1f9062,_0x357854){return db[_0x1150('0x29')]['describe']()['then'](respondWithResult(_0x357854,null))[_0x1150('0x40')](handleError(_0x357854,null));}; \ No newline at end of file +var _0xcca7=['count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','offset','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','findAll','catch','show','params','includeAll','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','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','end','status','json','limit','undefined'];(function(_0xd7445f,_0x4401a4){var _0x37b719=function(_0x6e9ae2){while(--_0x6e9ae2){_0xd7445f['push'](_0xd7445f['shift']());}};_0x37b719(++_0x4401a4);}(_0xcca7,0x1aa));var _0x7cca=function(_0x19cbac,_0x4a7597){_0x19cbac=_0x19cbac-0x0;var _0x180da3=_0xcca7[_0x19cbac];return _0x180da3;};'use strict';var emlformat=require(_0x7cca('0x0'));var rimraf=require(_0x7cca('0x1'));var zipdir=require(_0x7cca('0x2'));var jsonpatch=require(_0x7cca('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7cca('0x4'));var Mustache=require('mustache');var util=require(_0x7cca('0x5'));var path=require(_0x7cca('0x6'));var sox=require(_0x7cca('0x7'));var csv=require(_0x7cca('0x8'));var ejs=require(_0x7cca('0x9'));var fs=require('fs');var fs_extra=require(_0x7cca('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7cca('0xb'));var jsforce=require(_0x7cca('0xc'));var deskjs=require(_0x7cca('0xd'));var toCsv=require(_0x7cca('0x8'));var querystring=require(_0x7cca('0xe'));var Papa=require(_0x7cca('0xf'));var Redis=require(_0x7cca('0x10'));var authService=require(_0x7cca('0x11'));var qs=require(_0x7cca('0x12'));var as=require(_0x7cca('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7cca('0x14'))(_0x7cca('0x15'));var utils=require(_0x7cca('0x16'));var config=require(_0x7cca('0x17'));var licenseUtil=require(_0x7cca('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a14cc,_0x41e0a2){_0x41e0a2=_0x41e0a2||0xcc;return function(_0x2854c7){if(_0x2854c7){return _0x2a14cc['sendStatus'](_0x41e0a2);}return _0x2a14cc['status'](_0x41e0a2)[_0x7cca('0x19')]();};}function respondWithResult(_0x20c1b2,_0x27d671){_0x27d671=_0x27d671||0xc8;return function(_0x847cce){if(_0x847cce){return _0x20c1b2[_0x7cca('0x1a')](_0x27d671)[_0x7cca('0x1b')](_0x847cce);}};}function respondWithFilteredResult(_0x45143d,_0x5a357d){return function(_0x216d4b){if(_0x216d4b){var _0x533608=typeof _0x5a357d['offset']==='undefined'&&typeof _0x5a357d[_0x7cca('0x1c')]===_0x7cca('0x1d');var _0x1dd043=_0x216d4b[_0x7cca('0x1e')];var _0x44294b=_0x533608?0x0:_0x5a357d['offset'];var _0xb35e1d=_0x533608?_0x216d4b['count']:_0x5a357d['offset']+_0x5a357d['limit'];var _0x370469;if(_0xb35e1d>=_0x1dd043){_0xb35e1d=_0x1dd043;_0x370469=0xc8;}else{_0x370469=0xce;}_0x45143d[_0x7cca('0x1a')](_0x370469);return _0x45143d[_0x7cca('0x1f')](_0x7cca('0x20'),_0x44294b+'-'+_0xb35e1d+'/'+_0x1dd043)[_0x7cca('0x1b')](_0x216d4b);}return null;};}function patchUpdates(_0x45db2f){return function(_0x2e023c){try{jsonpatch[_0x7cca('0x21')](_0x2e023c,_0x45db2f,!![]);}catch(_0x4d7804){return BPromise[_0x7cca('0x22')](_0x4d7804);}return _0x2e023c[_0x7cca('0x23')]();};}function saveUpdates(_0x165d13,_0x4343a3){return function(_0x55b689){if(_0x55b689){return _0x55b689[_0x7cca('0x24')](_0x165d13)[_0x7cca('0x25')](function(_0x4367f9){return _0x4367f9;});}return null;};}function removeEntity(_0x119d76,_0x823d7d){return function(_0x3fc157){if(_0x3fc157){return _0x3fc157[_0x7cca('0x26')]()[_0x7cca('0x25')](function(){_0x119d76['status'](0xcc)[_0x7cca('0x19')]();});}};}function handleEntityNotFound(_0x1dd3b3,_0x1774fc){return function(_0xdaf07f){if(!_0xdaf07f){_0x1dd3b3[_0x7cca('0x27')](0x194);}return _0xdaf07f;};}function handleError(_0x21da68,_0x35ebe8){_0x35ebe8=_0x35ebe8||0x1f4;return function(_0x40ac86){logger['error'](_0x40ac86[_0x7cca('0x28')]);if(_0x40ac86['name']){delete _0x40ac86[_0x7cca('0x29')];}_0x21da68[_0x7cca('0x1a')](_0x35ebe8)['send'](_0x40ac86);};}exports[_0x7cca('0x2a')]=function(_0x3d91b1,_0x5533fb){var _0x249442={},_0x1cd53a={},_0x100061={'count':0x0,'rows':[]};var _0x52fb40=_['map'](db[_0x7cca('0x2b')][_0x7cca('0x2c')],function(_0x3797f4){return{'name':_0x3797f4[_0x7cca('0x2d')],'type':_0x3797f4[_0x7cca('0x2e')][_0x7cca('0x2f')]};});_0x1cd53a[_0x7cca('0x30')]=_['map'](_0x52fb40,'name');_0x1cd53a[_0x7cca('0x31')]=_[_0x7cca('0x32')](_0x3d91b1[_0x7cca('0x31')]);_0x1cd53a['filters']=_[_0x7cca('0x33')](_0x1cd53a['model'],_0x1cd53a[_0x7cca('0x31')]);_0x249442[_0x7cca('0x34')]=_[_0x7cca('0x33')](_0x1cd53a[_0x7cca('0x30')],qs['fields'](_0x3d91b1[_0x7cca('0x31')][_0x7cca('0x35')]));_0x249442[_0x7cca('0x34')]=_0x249442['attributes']['length']?_0x249442['attributes']:_0x1cd53a[_0x7cca('0x30')];if(!_0x3d91b1[_0x7cca('0x31')]['hasOwnProperty'](_0x7cca('0x36'))){_0x249442[_0x7cca('0x1c')]=qs[_0x7cca('0x1c')](_0x3d91b1[_0x7cca('0x31')][_0x7cca('0x1c')]);_0x249442[_0x7cca('0x37')]=qs[_0x7cca('0x37')](_0x3d91b1['query'][_0x7cca('0x37')]);}_0x249442[_0x7cca('0x38')]=qs[_0x7cca('0x39')](_0x3d91b1[_0x7cca('0x31')]['sort']);_0x249442[_0x7cca('0x3a')]=qs[_0x7cca('0x3b')](_[_0x7cca('0x3c')](_0x3d91b1['query'],_0x1cd53a[_0x7cca('0x3b')]),_0x52fb40);if(_0x3d91b1['query'][_0x7cca('0x3d')]){_0x249442[_0x7cca('0x3a')]=_[_0x7cca('0x3e')](_0x249442[_0x7cca('0x3a')],{'$or':_[_0x7cca('0x3f')](_0x52fb40,function(_0x25b3a9){if(_0x25b3a9[_0x7cca('0x2e')]!==_0x7cca('0x40')){var _0x3617b8={};_0x3617b8[_0x25b3a9['name']]={'$like':'%'+_0x3d91b1['query'][_0x7cca('0x3d')]+'%'};return _0x3617b8;}})});}_0x249442=_[_0x7cca('0x3e')]({},_0x249442,_0x3d91b1['options']);var _0x48d87f={'where':_0x249442[_0x7cca('0x3a')]};return db[_0x7cca('0x2b')][_0x7cca('0x1e')](_0x48d87f)[_0x7cca('0x25')](function(_0x371c67){_0x100061['count']=_0x371c67;if(_0x3d91b1[_0x7cca('0x31')]['includeAll']){_0x249442['include']=[{'all':!![]}];}return db[_0x7cca('0x2b')][_0x7cca('0x41')](_0x249442);})['then'](function(_0x3b120b){_0x100061['rows']=_0x3b120b;return _0x100061;})[_0x7cca('0x25')](respondWithFilteredResult(_0x5533fb,_0x249442))[_0x7cca('0x42')](handleError(_0x5533fb,null));};exports[_0x7cca('0x43')]=function(_0x47e2e6,_0xb966da){var _0x207250={'raw':!![],'where':{'id':_0x47e2e6[_0x7cca('0x44')]['id']}},_0x2e8d97={};_0x2e8d97['model']=_[_0x7cca('0x32')](db[_0x7cca('0x2b')][_0x7cca('0x2c')]);_0x2e8d97[_0x7cca('0x31')]=_[_0x7cca('0x32')](_0x47e2e6[_0x7cca('0x31')]);_0x2e8d97['filters']=_['intersection'](_0x2e8d97['model'],_0x2e8d97['query']);_0x207250[_0x7cca('0x34')]=_['intersection'](_0x2e8d97['model'],qs[_0x7cca('0x35')](_0x47e2e6[_0x7cca('0x31')][_0x7cca('0x35')]));_0x207250[_0x7cca('0x34')]=_0x207250[_0x7cca('0x34')]['length']?_0x207250[_0x7cca('0x34')]:_0x2e8d97[_0x7cca('0x30')];if(_0x47e2e6[_0x7cca('0x31')][_0x7cca('0x45')]){_0x207250[_0x7cca('0x46')]=[{'all':!![]}];}_0x207250=_[_0x7cca('0x3e')]({},_0x207250,_0x47e2e6[_0x7cca('0x47')]);return db[_0x7cca('0x2b')][_0x7cca('0x48')](_0x207250)[_0x7cca('0x25')](handleEntityNotFound(_0xb966da,null))[_0x7cca('0x25')](respondWithResult(_0xb966da,null))['catch'](handleError(_0xb966da,null));};exports['create']=function(_0x36f12f,_0x5913eb){return db[_0x7cca('0x2b')][_0x7cca('0x49')](_0x36f12f[_0x7cca('0x4a')],{})[_0x7cca('0x25')](respondWithResult(_0x5913eb,0xc9))[_0x7cca('0x42')](handleError(_0x5913eb,null));};exports[_0x7cca('0x24')]=function(_0x184b56,_0xe0059e){if(_0x184b56[_0x7cca('0x4a')]['id']){delete _0x184b56[_0x7cca('0x4a')]['id'];}return db['JscriptyAnswerReport'][_0x7cca('0x48')]({'where':{'id':_0x184b56[_0x7cca('0x44')]['id']}})[_0x7cca('0x25')](handleEntityNotFound(_0xe0059e,null))[_0x7cca('0x25')](saveUpdates(_0x184b56[_0x7cca('0x4a')],null))[_0x7cca('0x25')](respondWithResult(_0xe0059e,null))[_0x7cca('0x42')](handleError(_0xe0059e,null));};exports[_0x7cca('0x26')]=function(_0x218114,_0x43c581){return db[_0x7cca('0x2b')][_0x7cca('0x48')]({'where':{'id':_0x218114[_0x7cca('0x44')]['id']}})[_0x7cca('0x25')](handleEntityNotFound(_0x43c581,null))[_0x7cca('0x25')](removeEntity(_0x43c581,null))[_0x7cca('0x42')](handleError(_0x43c581,null));};exports[_0x7cca('0x4b')]=function(_0x27c527,_0x343a64){return db[_0x7cca('0x2b')][_0x7cca('0x4b')]()[_0x7cca('0x25')](respondWithResult(_0x343a64,null))[_0x7cca('0x42')](handleError(_0x343a64,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 65512c2..6051533 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 _0xa57c=['../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x3d8493,_0x1c1a97){var _0x68c1f6=function(_0x1abc8a){while(--_0x1abc8a){_0x3d8493['push'](_0x3d8493['shift']());}};_0x68c1f6(++_0x1c1a97);}(_0xa57c,0x95));var _0xca57=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xa57c[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0xca57('0x0'));var util=require(_0xca57('0x1'));var logger=require(_0xca57('0x2'))(_0xca57('0x3'));var moment=require(_0xca57('0x4'));var BPromise=require('bluebird');var rp=require(_0xca57('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xca57('0x6'));var config=require(_0xca57('0x7'));var attributes=require(_0xca57('0x8'));module[_0xca57('0x9')]=function(_0x5c7500,_0x15f646){return _0x5c7500[_0xca57('0xa')](_0xca57('0xb'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1667=['rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers','lodash','util','api','bluebird','request-promise','path'];(function(_0x3ac0d3,_0x519874){var _0x4c1b30=function(_0x69029a){while(--_0x69029a){_0x3ac0d3['push'](_0x3ac0d3['shift']());}};_0x4c1b30(++_0x519874);}(_0x1667,0x126));var _0x7166=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x1667[_0x411017];return _0x2adeea;};'use strict';var _=require(_0x7166('0x0'));var util=require(_0x7166('0x1'));var logger=require('../../config/logger')(_0x7166('0x2'));var moment=require('moment');var BPromise=require(_0x7166('0x3'));var rp=require(_0x7166('0x4'));var fs=require('fs');var path=require(_0x7166('0x5'));var rimraf=require(_0x7166('0x6'));var config=require(_0x7166('0x7'));var attributes=require(_0x7166('0x8'));module[_0x7166('0x9')]=function(_0x523f4c,_0x402df2){return _0x523f4c['define'](_0x7166('0xa'),attributes,{'tableName':_0x7166('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 9774c6c..001ba59 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 _0x5934=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptyAnswerReport,\x20%s,\x20%s','message','catch'];(function(_0x33e55a,_0x3d5690){var _0x542283=function(_0x4eba1d){while(--_0x4eba1d){_0x33e55a['push'](_0x33e55a['shift']());}};_0x542283(++_0x3d5690);}(_0x5934,0x84));var _0x4593=function(_0x1fb97c,_0x294b0e){_0x1fb97c=_0x1fb97c-0x0;var _0x1af5e2=_0x5934[_0x1fb97c];return _0x1af5e2;};'use strict';var _=require(_0x4593('0x0'));var util=require(_0x4593('0x1'));var moment=require(_0x4593('0x2'));var BPromise=require(_0x4593('0x3'));var rs=require(_0x4593('0x4'));var fs=require('fs');var Redis=require(_0x4593('0x5'));var db=require(_0x4593('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4593('0x7'))(_0x4593('0x8'));var config=require(_0x4593('0x9'));var jayson=require(_0x4593('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8586,_0x5d8a36,_0x36e97d){return new BPromise(function(_0xc42541,_0x68b016){return client[_0x4593('0xb')](_0x5a8586,_0x36e97d)[_0x4593('0xc')](function(_0x4e1342){logger[_0x4593('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5d8a36,_0x4593('0xe'));logger[_0x4593('0xf')](_0x4593('0x10'),_0x5d8a36,'request\x20sent',JSON[_0x4593('0x11')](_0x4e1342));if(_0x4e1342['error']){if(_0x4e1342[_0x4593('0x12')]['code']===0x1f4){logger[_0x4593('0x12')](_0x4593('0x13'),_0x5d8a36,_0x4e1342[_0x4593('0x12')][_0x4593('0x14')]);return _0x68b016(_0x4e1342[_0x4593('0x12')]['message']);}logger['error'](_0x4593('0x13'),_0x5d8a36,_0x4e1342[_0x4593('0x12')]['message']);return _0xc42541(_0x4e1342[_0x4593('0x12')][_0x4593('0x14')]);}else{logger[_0x4593('0xd')](_0x4593('0x13'),_0x5d8a36,_0x4593('0xe'));_0xc42541(_0x4e1342['result'][_0x4593('0x14')]);}})[_0x4593('0x15')](function(_0x5c4b10){logger[_0x4593('0x12')](_0x4593('0x13'),_0x5d8a36,_0x5c4b10);_0x68b016(_0x5c4b10);});});} \ No newline at end of file +var _0xabd7=['jayson/promise','client','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x53a0ce,_0x5eaa86){var _0x491112=function(_0xb4b450){while(--_0xb4b450){_0x53a0ce['push'](_0x53a0ce['shift']());}};_0x491112(++_0x5eaa86);}(_0xabd7,0x12d));var _0x7abd=function(_0x489510,_0x5dc266){_0x489510=_0x489510-0x0;var _0x5e6742=_0xabd7[_0x489510];return _0x5e6742;};'use strict';var _=require(_0x7abd('0x0'));var util=require(_0x7abd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7abd('0x2'));var fs=require('fs');var Redis=require(_0x7abd('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7abd('0x4'))(_0x7abd('0x5'));var config=require(_0x7abd('0x6'));var jayson=require(_0x7abd('0x7'));var client=jayson[_0x7abd('0x8')][_0x7abd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd7487b,_0x3ccb11,_0x20442a){return new BPromise(function(_0x4fd1be,_0x59cded){return client['request'](_0xd7487b,_0x20442a)[_0x7abd('0xa')](function(_0x554bb9){logger[_0x7abd('0xb')](_0x7abd('0xc'),_0x3ccb11,_0x7abd('0xd'));logger[_0x7abd('0xe')](_0x7abd('0xf'),_0x3ccb11,_0x7abd('0xd'),JSON[_0x7abd('0x10')](_0x554bb9));if(_0x554bb9[_0x7abd('0x11')]){if(_0x554bb9[_0x7abd('0x11')][_0x7abd('0x12')]===0x1f4){logger[_0x7abd('0x11')](_0x7abd('0xc'),_0x3ccb11,_0x554bb9[_0x7abd('0x11')][_0x7abd('0x13')]);return _0x59cded(_0x554bb9[_0x7abd('0x11')][_0x7abd('0x13')]);}logger[_0x7abd('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3ccb11,_0x554bb9[_0x7abd('0x11')]['message']);return _0x4fd1be(_0x554bb9['error'][_0x7abd('0x13')]);}else{logger[_0x7abd('0xb')](_0x7abd('0xc'),_0x3ccb11,'request\x20sent');_0x4fd1be(_0x554bb9[_0x7abd('0x14')][_0x7abd('0x13')]);}})[_0x7abd('0x15')](function(_0x33413f){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x3ccb11,_0x33413f);_0x59cded(_0x33413f);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index c9bf0c0..83cae9b 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 _0xf342=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','/:id/summary','30s','post','/:id/clone','put'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xf342,0xd3));var _0x2f34=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf342[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x2f34('0x0'));var util=require(_0x2f34('0x1'));var path=require(_0x2f34('0x2'));var timeout=require(_0x2f34('0x3'));var express=require(_0x2f34('0x4'));var router=express[_0x2f34('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2f34('0x6'));var interaction=require(_0x2f34('0x7'));var config=require(_0x2f34('0x8'));var controller=require(_0x2f34('0x9'));router[_0x2f34('0xa')]('/',auth[_0x2f34('0xb')](),controller[_0x2f34('0xc')]);router[_0x2f34('0xa')](_0x2f34('0xd'),auth['isAuthenticated'](),controller[_0x2f34('0xe')]);router[_0x2f34('0xa')](_0x2f34('0xf'),auth['isAuthenticated'](),controller[_0x2f34('0x10')]);router[_0x2f34('0xa')](_0x2f34('0x11'),auth[_0x2f34('0xb')](),controller['getAnswers']);router['get'](_0x2f34('0x12'),auth[_0x2f34('0xb')](),timeout(_0x2f34('0x13')),controller['getSummary']);router[_0x2f34('0x14')]('/',auth[_0x2f34('0xb')](),controller['create']);router[_0x2f34('0x14')](_0x2f34('0x15'),auth['isAuthenticated'](),controller['clone']);router[_0x2f34('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x2f34('0x17')]);router[_0x2f34('0x18')]('/:id',auth[_0x2f34('0xb')](),controller[_0x2f34('0x19')]);module['exports']=router; \ No newline at end of file +var _0x0647=['clone','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','getSessions','getAnswers','30s','getSummary','post','create'];(function(_0x45ea51,_0x1d49d2){var _0x55a569=function(_0x2b539b){while(--_0x2b539b){_0x45ea51['push'](_0x45ea51['shift']());}};_0x55a569(++_0x1d49d2);}(_0x0647,0x10e));var _0x7064=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x0647[_0x45b034];return _0x509cb0;};'use strict';var multer=require(_0x7064('0x0'));var util=require('util');var path=require(_0x7064('0x1'));var timeout=require(_0x7064('0x2'));var express=require(_0x7064('0x3'));var router=express[_0x7064('0x4')]();var fs_extra=require(_0x7064('0x5'));var auth=require(_0x7064('0x6'));var interaction=require(_0x7064('0x7'));var config=require(_0x7064('0x8'));var controller=require('./jscriptyProject.controller');router[_0x7064('0x9')]('/',auth[_0x7064('0xa')](),controller['index']);router[_0x7064('0x9')]('/:id',auth[_0x7064('0xa')](),controller[_0x7064('0xb')]);router[_0x7064('0x9')]('/:id/sessions',auth[_0x7064('0xa')](),controller[_0x7064('0xc')]);router[_0x7064('0x9')]('/:id/answers',auth[_0x7064('0xa')](),controller[_0x7064('0xd')]);router[_0x7064('0x9')]('/:id/summary',auth[_0x7064('0xa')](),timeout(_0x7064('0xe')),controller[_0x7064('0xf')]);router[_0x7064('0x10')]('/',auth['isAuthenticated'](),controller[_0x7064('0x11')]);router[_0x7064('0x10')]('/:id/clone',auth[_0x7064('0xa')](),controller[_0x7064('0x12')]);router[_0x7064('0x13')](_0x7064('0x14'),auth['isAuthenticated'](),controller[_0x7064('0x15')]);router['delete'](_0x7064('0x14'),auth[_0x7064('0xa')](),controller[_0x7064('0x16')]);module[_0x7064('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 63580b4..f036be6 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 _0xaf91=['exports','name','STRING','TEXT','long','isObjectLike','formData','stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','util'];(function(_0x156854,_0x1a7e34){var _0x10c4fb=function(_0x56e121){while(--_0x56e121){_0x156854['push'](_0x156854['shift']());}};_0x10c4fb(++_0x1a7e34);}(_0xaf91,0xb9));var _0x1af9=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0xaf91[_0x8dc04d];return _0x2f5f28;};'use strict';var Sequelize=require(_0x1af9('0x0'));var _=require('lodash');var util=require(_0x1af9('0x1'));module[_0x1af9('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x1af9('0x3')},'description':{'type':Sequelize[_0x1af9('0x4')]},'formData':{'type':Sequelize[_0x1af9('0x5')](_0x1af9('0x6')),'set':function(_0x4ed45c){if(_[_0x1af9('0x7')](_0x4ed45c)){this['setDataValue'](_0x1af9('0x8'),JSON[_0x1af9('0x9')](_0x4ed45c));}else if(_[_0x1af9('0xa')](_0x4ed45c)){this[_0x1af9('0xb')]('formData',_0x4ed45c);}else{this[_0x1af9('0xb')](_0x1af9('0x8'),util[_0x1af9('0xc')](_0x1af9('0xd'),this['getDataValue']('name')||'',this[_0x1af9('0xe')](_0x1af9('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x1af9('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0x3a8a=['sequelize','util','STRING','name','TEXT','long','isObjectLike','setDataValue','stringify','isString','formData','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN'];(function(_0x233bd4,_0x9235fa){var _0x5e834b=function(_0x3e12de){while(--_0x3e12de){_0x233bd4['push'](_0x233bd4['shift']());}};_0x5e834b(++_0x9235fa);}(_0x3a8a,0xff));var _0xa3a8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3a8a[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xa3a8('0x0'));var _=require('lodash');var util=require(_0xa3a8('0x1'));module['exports']={'name':{'type':Sequelize[_0xa3a8('0x2')],'unique':_0xa3a8('0x3')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xa3a8('0x4')](_0xa3a8('0x5')),'set':function(_0x45ab46){if(_[_0xa3a8('0x6')](_0x45ab46)){this[_0xa3a8('0x7')]('formData',JSON[_0xa3a8('0x8')](_0x45ab46));}else if(_[_0xa3a8('0x9')](_0x45ab46)){this[_0xa3a8('0x7')](_0xa3a8('0xa'),_0x45ab46);}else{this[_0xa3a8('0x7')]('formData',util['format'](_0xa3a8('0xb'),this[_0xa3a8('0xc')]('name')||'',this[_0xa3a8('0xc')](_0xa3a8('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xa3a8('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 7047555..8eb0002 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 _0x9354=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','UserProfileSection','findOne','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','writeFileSync','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','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','sendStatus','status','end','json','undefined','limit','count','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','error','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','map','VIRTUAL','filter','merge','options','JscriptyProject','include','findAll','catch','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x545a8a,_0x43d2ea){var _0x54b049=function(_0x424533){while(--_0x424533){_0x545a8a['push'](_0x545a8a['shift']());}};_0x54b049(++_0x43d2ea);}(_0x9354,0x96));var _0x4935=function(_0xc2b4c8,_0x756a49){_0xc2b4c8=_0xc2b4c8-0x0;var _0x402443=_0x9354[_0xc2b4c8];return _0x402443;};'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'];function respondWithStatusCode(_0x32916f,_0x3bb388){_0x3bb388=_0x3bb388||0xcc;return function(_0x1c6c22){if(_0x1c6c22){return _0x32916f[_0x4935('0x17')](_0x3bb388);}return _0x32916f[_0x4935('0x18')](_0x3bb388)[_0x4935('0x19')]();};}function respondWithResult(_0x3a7c30,_0x57549f){_0x57549f=_0x57549f||0xc8;return function(_0x237e28){if(_0x237e28){return _0x3a7c30[_0x4935('0x18')](_0x57549f)[_0x4935('0x1a')](_0x237e28);}};}function respondWithFilteredResult(_0xa41961,_0x3652c4){return function(_0x24cc99){if(_0x24cc99){var _0x395a43=typeof _0x3652c4['offset']===_0x4935('0x1b')&&typeof _0x3652c4[_0x4935('0x1c')]===_0x4935('0x1b');var _0x123300=_0x24cc99[_0x4935('0x1d')];var _0x429ef3=_0x395a43?0x0:_0x3652c4['offset'];var _0xd70eff=_0x395a43?_0x24cc99[_0x4935('0x1d')]:_0x3652c4['offset']+_0x3652c4[_0x4935('0x1c')];var _0x10407f;if(_0xd70eff>=_0x123300){_0xd70eff=_0x123300;_0x10407f=0xc8;}else{_0x10407f=0xce;}_0xa41961[_0x4935('0x18')](_0x10407f);return _0xa41961['set']('Content-Range',_0x429ef3+'-'+_0xd70eff+'/'+_0x123300)[_0x4935('0x1a')](_0x24cc99);}return null;};}function patchUpdates(_0x6b849f){return function(_0x1ae059){try{jsonpatch[_0x4935('0x1e')](_0x1ae059,_0x6b849f,!![]);}catch(_0x41d76e){return BPromise[_0x4935('0x1f')](_0x41d76e);}return _0x1ae059[_0x4935('0x20')]();};}function saveUpdates(_0xe482a5,_0x58b2f3){return function(_0x2f520a){if(_0x2f520a){return _0x2f520a[_0x4935('0x21')](_0xe482a5)[_0x4935('0x22')](function(_0x2c701f){return _0x2c701f;});}return null;};}function removeEntity(_0x52c65a,_0x53530f){return function(_0x4dc1f5){if(_0x4dc1f5){return _0x4dc1f5[_0x4935('0x23')]()[_0x4935('0x22')](function(){var _0x3786ff=_0x4dc1f5[_0x4935('0x24')]({'plain':!![]});var _0x344e51=_0x4935('0x25');return db[_0x4935('0x26')][_0x4935('0x23')]({'where':{'type':_0x344e51,'resourceId':_0x3786ff['id']}})[_0x4935('0x22')](function(){return _0x4dc1f5;});})[_0x4935('0x22')](function(){_0x52c65a[_0x4935('0x18')](0xcc)[_0x4935('0x19')]();});}};}function handleEntityNotFound(_0x2c47ab,_0xbb00d6){return function(_0x359522){if(!_0x359522){_0x2c47ab['sendStatus'](0x194);}return _0x359522;};}function handleError(_0x5c3aaa,_0x5cec4d){_0x5cec4d=_0x5cec4d||0x1f4;return function(_0x1fc218){logger[_0x4935('0x27')](_0x1fc218['stack']);if(_0x1fc218[_0x4935('0x28')]){delete _0x1fc218[_0x4935('0x28')];}_0x5c3aaa[_0x4935('0x18')](_0x5cec4d)[_0x4935('0x29')](_0x1fc218);};}exports[_0x4935('0x2a')]=function(_0x24262e,_0x28afc2){var _0x2fe6da={},_0x5b3c8e={},_0xb7fe2a={'count':0x0,'rows':[]};var _0x2dcb0b=_['map'](db['JscriptyProject'][_0x4935('0x2b')],function(_0x479d28){return{'name':_0x479d28[_0x4935('0x2c')],'type':_0x479d28[_0x4935('0x2d')][_0x4935('0x2e')]};});_0x5b3c8e['model']=_['map'](_0x2dcb0b,_0x4935('0x28'));_0x5b3c8e[_0x4935('0x2f')]=_['keys'](_0x24262e[_0x4935('0x2f')]);_0x5b3c8e[_0x4935('0x30')]=_[_0x4935('0x31')](_0x5b3c8e[_0x4935('0x32')],_0x5b3c8e[_0x4935('0x2f')]);_0x2fe6da['attributes']=_['intersection'](_0x5b3c8e[_0x4935('0x32')],qs[_0x4935('0x33')](_0x24262e['query']['fields']));_0x2fe6da[_0x4935('0x34')]=_0x2fe6da['attributes'][_0x4935('0x35')]?_0x2fe6da[_0x4935('0x34')]:_0x5b3c8e[_0x4935('0x32')];if(!_0x24262e[_0x4935('0x2f')][_0x4935('0x36')](_0x4935('0x37'))){_0x2fe6da['limit']=qs[_0x4935('0x1c')](_0x24262e['query'][_0x4935('0x1c')]);_0x2fe6da['offset']=qs[_0x4935('0x38')](_0x24262e['query'][_0x4935('0x38')]);}_0x2fe6da[_0x4935('0x39')]=qs[_0x4935('0x3a')](_0x24262e[_0x4935('0x2f')][_0x4935('0x3a')]);_0x2fe6da[_0x4935('0x3b')]=qs[_0x4935('0x30')](_['pick'](_0x24262e['query'],_0x5b3c8e[_0x4935('0x30')]),_0x2dcb0b);if(_0x24262e['query']['filter']){_0x2fe6da[_0x4935('0x3b')]=_['merge'](_0x2fe6da[_0x4935('0x3b')],{'$or':_[_0x4935('0x3c')](_0x2dcb0b,function(_0x2d67e3){if(_0x2d67e3[_0x4935('0x2d')]!==_0x4935('0x3d')){var _0x53aac5={};_0x53aac5[_0x2d67e3['name']]={'$like':'%'+_0x24262e[_0x4935('0x2f')][_0x4935('0x3e')]+'%'};return _0x53aac5;}})});}_0x2fe6da=_[_0x4935('0x3f')]({},_0x2fe6da,_0x24262e[_0x4935('0x40')]);var _0x4d9436={'where':_0x2fe6da[_0x4935('0x3b')]};return db[_0x4935('0x41')][_0x4935('0x1d')](_0x4d9436)['then'](function(_0x4e94f6){_0xb7fe2a[_0x4935('0x1d')]=_0x4e94f6;if(_0x24262e[_0x4935('0x2f')]['includeAll']){_0x2fe6da[_0x4935('0x42')]=[{'all':!![]}];}return db[_0x4935('0x41')][_0x4935('0x43')](_0x2fe6da);})[_0x4935('0x22')](function(_0x52ab0c){_0xb7fe2a['rows']=_0x52ab0c;return _0xb7fe2a;})[_0x4935('0x22')](respondWithFilteredResult(_0x28afc2,_0x2fe6da))[_0x4935('0x44')](handleError(_0x28afc2,null));};exports['show']=function(_0x1eaa47,_0x40f5ff){var _0x2195da={'raw':![],'where':{'id':_0x1eaa47[_0x4935('0x45')]['id']}},_0x5135fd={};_0x5135fd[_0x4935('0x32')]=_[_0x4935('0x46')](db[_0x4935('0x41')][_0x4935('0x2b')]);_0x5135fd[_0x4935('0x2f')]=_[_0x4935('0x46')](_0x1eaa47[_0x4935('0x2f')]);_0x5135fd[_0x4935('0x30')]=_[_0x4935('0x31')](_0x5135fd[_0x4935('0x32')],_0x5135fd[_0x4935('0x2f')]);_0x2195da[_0x4935('0x34')]=_[_0x4935('0x31')](_0x5135fd[_0x4935('0x32')],qs[_0x4935('0x33')](_0x1eaa47[_0x4935('0x2f')][_0x4935('0x33')]));_0x2195da['attributes']=_0x2195da[_0x4935('0x34')]['length']?_0x2195da[_0x4935('0x34')]:_0x5135fd[_0x4935('0x32')];if(_0x1eaa47[_0x4935('0x2f')][_0x4935('0x47')]){_0x2195da['include']=[{'all':!![]}];}_0x2195da=_[_0x4935('0x3f')]({},_0x2195da,_0x1eaa47[_0x4935('0x40')]);return db[_0x4935('0x41')][_0x4935('0x48')](_0x2195da)[_0x4935('0x22')](handleEntityNotFound(_0x40f5ff,null))[_0x4935('0x22')](respondWithResult(_0x40f5ff,null))[_0x4935('0x44')](handleError(_0x40f5ff,null));};exports[_0x4935('0x49')]=function(_0x29b932,_0x392cba){return db['JscriptyProject'][_0x4935('0x49')](_0x29b932[_0x4935('0x4a')],{})['then'](function(_0x447a64){var _0x2636f4=_0x29b932[_0x4935('0x4b')][_0x4935('0x24')]({'plain':!![]});if(!_0x2636f4)throw new Error(_0x4935('0x4c'));if(_0x2636f4[_0x4935('0x4d')]===_0x4935('0x4b')){var _0x471fb1=_0x447a64['get']({'plain':!![]});var _0x57d0d9='Projects';return db['UserProfileSection'][_0x4935('0x48')]({'where':{'name':_0x57d0d9,'userProfileId':_0x2636f4[_0x4935('0x4e')]},'raw':!![]})[_0x4935('0x22')](function(_0x2072df){if(_0x2072df&&_0x2072df[_0x4935('0x4f')]===0x0){return db['UserProfileResource'][_0x4935('0x49')]({'name':_0x471fb1[_0x4935('0x28')],'resourceId':_0x471fb1['id'],'type':_0x2072df[_0x4935('0x28')],'sectionId':_0x2072df['id']},{})[_0x4935('0x22')](function(){return _0x447a64;});}else{return _0x447a64;}})[_0x4935('0x44')](function(_0x8196b4){logger[_0x4935('0x27')](_0x4935('0x50'),_0x8196b4);throw _0x8196b4;});}return _0x447a64;})[_0x4935('0x22')](respondWithResult(_0x392cba,0xc9))[_0x4935('0x44')](handleError(_0x392cba,null));};exports['clone']=function(_0x24b83b,_0x4e99bb){var _0x3ad7a6={'where':{'id':_0x24b83b['params']['id']}},_0xe08e62={};_0xe08e62[_0x4935('0x32')]=_['keys'](db['JscriptyProject']['rawAttributes']);_0x3ad7a6[_0x4935('0x34')]=_[_0x4935('0x31')](_0xe08e62[_0x4935('0x32')],qs[_0x4935('0x33')](_0x24b83b[_0x4935('0x2f')]['fields']));_0x3ad7a6['attributes']=_0x3ad7a6[_0x4935('0x34')][_0x4935('0x35')]?_0x3ad7a6[_0x4935('0x34')]:_0xe08e62['model'];if(_0x24b83b[_0x4935('0x2f')][_0x4935('0x47')]){_0x3ad7a6[_0x4935('0x42')]=[{'all':!![]}];}_0x3ad7a6=_[_0x4935('0x3f')]({},_0x3ad7a6,_0x24b83b['options']);return db[_0x4935('0x41')]['find'](_0x3ad7a6)['then'](handleEntityNotFound(_0x4e99bb,null))['then'](function(_0x24d870){if(_0x24d870){var _0x10cd78=_0x24d870['get']({'plain':!![]});_0x10cd78=qs[_0x4935('0x51')](_0x10cd78,['id',_0x4935('0x52'),'updatedAt']);_0x24b83b[_0x4935('0x4a')]=_[_0x4935('0x51')](_0x24b83b[_0x4935('0x4a')],['id',_0x4935('0x52'),_0x4935('0x53')]);return db[_0x4935('0x41')][_0x4935('0x49')](_['merge'](_0x10cd78,_0x24b83b[_0x4935('0x4a')]),{'include':_0x24b83b['query']['includeAll']?[{'all':!![]}]:undefined})[_0x4935('0x22')](function(_0xc3fb8f){var _0x4f7dc2=_0x24b83b['user'][_0x4935('0x24')]({'plain':!![]});if(!_0x4f7dc2)throw new Error(_0x4935('0x4c'));if(_0x4f7dc2[_0x4935('0x4d')]==='user'){var _0xf52dea=_0xc3fb8f['get']({'plain':!![]});var _0x3003a6=_0x4935('0x25');return db[_0x4935('0x54')][_0x4935('0x48')]({'where':{'name':_0x3003a6,'userProfileId':_0x4f7dc2[_0x4935('0x4e')]},'raw':!![]})['then'](function(_0x1eb15d){if(_0x1eb15d&&_0x1eb15d[_0x4935('0x4f')]===0x0){return db['UserProfileResource'][_0x4935('0x49')]({'name':_0xf52dea[_0x4935('0x28')],'resourceId':_0xf52dea['id'],'type':_0x1eb15d[_0x4935('0x28')],'sectionId':_0x1eb15d['id']},{})[_0x4935('0x22')](function(){return _0xc3fb8f;});}else{return _0xc3fb8f;}})[_0x4935('0x44')](function(_0x48e793){logger[_0x4935('0x27')](_0x4935('0x50'),_0x48e793);throw _0x48e793;});}return _0xc3fb8f;});}})[_0x4935('0x22')](respondWithResult(_0x4e99bb,0xc9))[_0x4935('0x44')](handleError(_0x4e99bb,null));};exports[_0x4935('0x21')]=function(_0x5d4435,_0xa5380a){if(_0x5d4435[_0x4935('0x4a')]['id']){delete _0x5d4435[_0x4935('0x4a')]['id'];}return db[_0x4935('0x41')][_0x4935('0x48')]({'where':{'id':_0x5d4435[_0x4935('0x45')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0xa5380a,null))[_0x4935('0x22')](saveUpdates(_0x5d4435[_0x4935('0x4a')],null))[_0x4935('0x22')](respondWithResult(_0xa5380a,null))[_0x4935('0x44')](handleError(_0xa5380a,null));};exports[_0x4935('0x23')]=function(_0x3a427c,_0x4824fd){return db['JscriptyProject'][_0x4935('0x48')]({'where':{'id':_0x3a427c[_0x4935('0x45')]['id']}})['then'](handleEntityNotFound(_0x4824fd,null))[_0x4935('0x22')](removeEntity(_0x4824fd,null))[_0x4935('0x44')](handleError(_0x4824fd,null));};exports['getSessions']=function(_0x4c5cdc,_0x1a7f52,_0xa4fa28){var _0x304d73={'raw':!![],'where':{}};var _0x2abd63={};var _0x105e38={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x4935('0x55')]({'where':{'id':_0x4c5cdc[_0x4935('0x45')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x1a7f52,null))[_0x4935('0x22')](function(_0x583964){if(_0x583964){_0x2abd63[_0x4935('0x32')]=_['keys'](db['JscriptySessionReport'][_0x4935('0x2b')]);_0x2abd63[_0x4935('0x2f')]=_['keys'](_0x4c5cdc[_0x4935('0x2f')]);_0x2abd63[_0x4935('0x30')]=_[_0x4935('0x31')](_0x2abd63['model'],_0x2abd63[_0x4935('0x2f')]);_0x304d73['attributes']=_['intersection'](_0x2abd63[_0x4935('0x32')],qs[_0x4935('0x33')](_0x4c5cdc[_0x4935('0x2f')][_0x4935('0x33')]));_0x304d73[_0x4935('0x34')]=_0x304d73[_0x4935('0x34')][_0x4935('0x35')]?_0x304d73[_0x4935('0x34')]:_0x2abd63['model'];if(!_0x4c5cdc[_0x4935('0x2f')][_0x4935('0x36')](_0x4935('0x37'))){_0x304d73['limit']=qs['limit'](_0x4c5cdc[_0x4935('0x2f')][_0x4935('0x1c')]);_0x304d73['offset']=qs[_0x4935('0x38')](_0x4c5cdc['query']['offset']);}_0x304d73[_0x4935('0x39')]=qs[_0x4935('0x3a')](_0x4c5cdc[_0x4935('0x2f')]['sort']);_0x304d73['where']=qs[_0x4935('0x30')](_['pick'](_0x4c5cdc[_0x4935('0x2f')],_0x2abd63['filters']));_0x304d73[_0x4935('0x3b')][_0x4935('0x56')]=_0x583964['id'];if(_0x4c5cdc[_0x4935('0x2f')][_0x4935('0x3e')]){_0x304d73[_0x4935('0x3b')]=_[_0x4935('0x3f')](_0x304d73[_0x4935('0x3b')],{'$or':_['map'](_0x304d73[_0x4935('0x34')],function(_0x493392){var _0x2f2faf={};_0x2f2faf[_0x493392]={'$like':'%'+_0x4c5cdc[_0x4935('0x2f')]['filter']+'%'};return _0x2f2faf;})});}_0x304d73=_[_0x4935('0x3f')]({},_0x304d73,_0x4c5cdc['options']);return db[_0x4935('0x57')][_0x4935('0x1d')]({'where':_0x304d73['where']})['then'](function(_0x530e9f){_0x105e38[_0x4935('0x1d')]=_0x530e9f;if(_0x4c5cdc['query']['includeAll']){_0x304d73[_0x4935('0x42')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x4935('0x43')](_0x304d73);})['then'](function(_0x497246){_0x105e38['rows']=_0x497246;return _0x105e38;});}})[_0x4935('0x22')](respondWithFilteredResult(_0x1a7f52,_0x304d73))['catch'](handleError(_0x1a7f52,null));};exports[_0x4935('0x58')]=function(_0x29dfcf,_0x22aa42,_0x41efae){var _0x32495e={'raw':!![],'where':{}};var _0x4a240b={};var _0x415c24={'count':0x0,'rows':[]};return db[_0x4935('0x41')]['findOne']({'where':{'id':_0x29dfcf[_0x4935('0x45')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x22aa42,null))['then'](function(_0x1ffef1){if(_0x1ffef1){_0x4a240b[_0x4935('0x32')]=_['keys'](db[_0x4935('0x59')]['rawAttributes']);_0x4a240b[_0x4935('0x2f')]=_[_0x4935('0x46')](_0x29dfcf['query']);_0x4a240b[_0x4935('0x30')]=_[_0x4935('0x31')](_0x4a240b['model'],_0x4a240b['query']);_0x32495e[_0x4935('0x34')]=_[_0x4935('0x31')](_0x4a240b['model'],qs[_0x4935('0x33')](_0x29dfcf[_0x4935('0x2f')][_0x4935('0x33')]));_0x32495e[_0x4935('0x34')]=_0x32495e['attributes'][_0x4935('0x35')]?_0x32495e[_0x4935('0x34')]:_0x4a240b['model'];if(!_0x29dfcf[_0x4935('0x2f')][_0x4935('0x36')](_0x4935('0x37'))){_0x32495e[_0x4935('0x1c')]=qs[_0x4935('0x1c')](_0x29dfcf[_0x4935('0x2f')][_0x4935('0x1c')]);_0x32495e[_0x4935('0x38')]=qs[_0x4935('0x38')](_0x29dfcf[_0x4935('0x2f')][_0x4935('0x38')]);}_0x32495e['order']=qs[_0x4935('0x3a')](_0x29dfcf[_0x4935('0x2f')][_0x4935('0x3a')]);_0x32495e[_0x4935('0x3b')]=qs[_0x4935('0x30')](_['pick'](_0x29dfcf[_0x4935('0x2f')],_0x4a240b[_0x4935('0x30')]));_0x32495e['where'][_0x4935('0x56')]=_0x1ffef1['id'];if(_0x29dfcf[_0x4935('0x2f')]['filter']){_0x32495e[_0x4935('0x3b')]=_[_0x4935('0x3f')](_0x32495e[_0x4935('0x3b')],{'$or':_['map'](_0x32495e[_0x4935('0x34')],function(_0x23165d){var _0x7240af={};_0x7240af[_0x23165d]={'$like':'%'+_0x29dfcf[_0x4935('0x2f')][_0x4935('0x3e')]+'%'};return _0x7240af;})});}_0x32495e=_['merge']({},_0x32495e,_0x29dfcf[_0x4935('0x40')]);return db[_0x4935('0x59')][_0x4935('0x1d')]({'where':_0x32495e[_0x4935('0x3b')]})[_0x4935('0x22')](function(_0x44f9fc){_0x415c24['count']=_0x44f9fc;if(_0x29dfcf[_0x4935('0x2f')][_0x4935('0x47')]){_0x32495e[_0x4935('0x42')]=[{'all':!![]}];}return db[_0x4935('0x59')][_0x4935('0x43')](_0x32495e);})[_0x4935('0x22')](function(_0x23fd89){_0x415c24['rows']=_0x23fd89;return _0x415c24;});}})[_0x4935('0x22')](respondWithFilteredResult(_0x22aa42,_0x32495e))[_0x4935('0x44')](handleError(_0x22aa42,null));};function char(_0x42bdf0){return _0x4935('0x5a')===typeof _0x42bdf0?String[_0x4935('0x5b')]['apply'](null,arguments):_0x42bdf0;}function needsEncapsulation(_0x550728){return!!_0x550728&&(_0x550728[_0x4935('0x5c')]()[_0x4935('0x5d')](char(0xd))>=0x0||_0x550728[_0x4935('0x5c')]()[_0x4935('0x5d')](char(0xa))>=0x0||_0x550728[_0x4935('0x5c')]()['indexOf'](char(0x2c))>=0x0||_0x550728[_0x4935('0x5c')]()[_0x4935('0x5d')](char(0x22))>=0x0);}function encapsulate(_0xd682c5){var _0x478ef6=char(0x22),_0x5ccc66='\x5c'+char(0x22),_0xfab40=_0xd682c5[_0x4935('0x5c')]()[_0x4935('0x5e')](new RegExp(_0x478ef6,'g'),_0x5ccc66);return _0x478ef6+_0xfab40+_0x478ef6;}exports[_0x4935('0x5f')]=function(_0x38eb00,_0xe60fe,_0x47e1dd){var _0x1e91a8,_0x5e4177;var _0x44af25={'where':{'ProjectId':_0x38eb00['params']['id']}};if(_0x38eb00['query'][_0x4935('0x60')]){_0x44af25['where']['starttime']=JSON[_0x4935('0x61')](_0x38eb00[_0x4935('0x2f')]['startTime']);}return db[_0x4935('0x57')]['findAll'](_0x44af25)[_0x4935('0x22')](handleEntityNotFound(_0xe60fe,null))[_0x4935('0x22')](function(_0x338d0e){if(_0x338d0e){_0x1e91a8=_0x338d0e;return db[_0x4935('0x62')][_0x4935('0x43')]({'where':{'SessionId':{'$in':_[_0x4935('0x3c')](_0x1e91a8,'id')},'ProjectId':_0x38eb00['params']['id']},'order':_0x4935('0x63')});}})[_0x4935('0x22')](handleEntityNotFound(_0xe60fe,null))[_0x4935('0x22')](function(_0x5d53e6){if(_0x5d53e6){_0x5e4177=_0x5d53e6;var _0x2f3d51={};for(var _0xea6cf6=0x0,_0xf55e5f=_0x5e4177['length'];_0xea6cf6<_0xf55e5f;_0xea6cf6++){if(!_0x2f3d51[_0x4935('0x36')](_0x5e4177[_0xea6cf6][_0x4935('0x64')])){_0x2f3d51[_0x5e4177[_0xea6cf6][_0x4935('0x64')]]=needsEncapsulation(_0x5e4177[_0xea6cf6][_0x4935('0x65')])?encapsulate(_0x5e4177[_0xea6cf6][_0x4935('0x65')]):_0x5e4177[_0xea6cf6]['question'];}}var _0x3fa0e0=[],_0x490c7d={};for(var _0x19fe30=0x0,_0x4bc3e7=_0x1e91a8[_0x4935('0x35')];_0x19fe30<_0x4bc3e7;_0x19fe30++){_0x490c7d={'ProjectId':_0x38eb00['params']['id'],'SessionId':_0x1e91a8[_0x19fe30]['id'],'StartTime':moment(_0x1e91a8[_0x19fe30][_0x4935('0x66')])[_0x4935('0x67')](_0x4935('0x68'))};for(var _0x5d9398=0x0,_0x31d209=_0x5e4177[_0x4935('0x35')];_0x5d9398<_0x31d209;_0x5d9398++){if(_0x5e4177[_0x5d9398][_0x4935('0x69')]==_0x1e91a8[_0x19fe30]['id']&&_0x2f3d51[_0x4935('0x36')](_0x5e4177[_0x5d9398][_0x4935('0x64')])){_0x490c7d[_0x2f3d51[_0x5e4177[_0x5d9398][_0x4935('0x64')]]]=_0x5e4177[_0x5d9398][_0x4935('0x6a')];}}for(var _0x1fc18e in _0x2f3d51){if(!_0x490c7d[_0x4935('0x36')](_0x2f3d51[_0x1fc18e])){_0x490c7d[_0x2f3d51[_0x1fc18e]]=null;}}_0x3fa0e0['push'](_0x490c7d);}return _0x3fa0e0;}})[_0x4935('0x22')](function(_0x395908){if(!_[_0x4935('0x6b')](_0x395908)){var _0x1c1f95=toCsv(_0x395908);var _0x2df4fc=Date[_0x4935('0x6c')]();fs[_0x4935('0x6d')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x38eb00[_0x4935('0x45')]['id'],_0x2df4fc),_0x1c1f95);_0xe60fe['setHeader']('Content-disposition',_0x4935('0x6e')+util[_0x4935('0x67')](_0x4935('0x6f'),_0x38eb00[_0x4935('0x45')]['id'],_0x2df4fc));_0xe60fe['setHeader'](_0x4935('0x70'),_0x4935('0x71'));return _0xe60fe['download'](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x38eb00['params']['id'],_0x2df4fc));}else{return _0xe60fe['sendStatus'](0xcc);}})[_0x4935('0x44')](handleError(_0xe60fe,null));}; \ No newline at end of file +var _0x82ee=['attachment;\x20filename=','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','map','JscriptyProject','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','merge','VIRTUAL','filter','where','includeAll','include','findAll','rows','catch','show','params','options','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','omit','createdAt','UserProfileSection','create','getSessions','findOne','pick','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','order','apply','indexOf','toString','getSummary','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','setHeader','Content-disposition'];(function(_0x5b35ee,_0x5b142e){var _0x2bb1fa=function(_0xd58aa8){while(--_0xd58aa8){_0x5b35ee['push'](_0x5b35ee['shift']());}};_0x2bb1fa(++_0x5b142e);}(_0x82ee,0xeb));var _0xe82e=function(_0x220eba,_0x27000b){_0x220eba=_0x220eba-0x0;var _0x2fc662=_0x82ee[_0x220eba];return _0x2fc662;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe82e('0x0'));var zipdir=require(_0xe82e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe82e('0x2'));var moment=require(_0xe82e('0x3'));var BPromise=require(_0xe82e('0x4'));var Mustache=require(_0xe82e('0x5'));var util=require(_0xe82e('0x6'));var path=require(_0xe82e('0x7'));var sox=require(_0xe82e('0x8'));var csv=require(_0xe82e('0x9'));var ejs=require(_0xe82e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe82e('0xb'));var squel=require(_0xe82e('0xc'));var crypto=require(_0xe82e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe82e('0xe'));var toCsv=require(_0xe82e('0x9'));var querystring=require(_0xe82e('0xf'));var Papa=require('papaparse');var Redis=require(_0xe82e('0x10'));var authService=require(_0xe82e('0x11'));var qs=require(_0xe82e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe82e('0x13'));var logger=require('../../config/logger')(_0xe82e('0x14'));var utils=require('../../config/utils');var config=require(_0xe82e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe82e('0x16'))['db'];function respondWithStatusCode(_0x9a6a02,_0x8e23db){_0x8e23db=_0x8e23db||0xcc;return function(_0x4cc146){if(_0x4cc146){return _0x9a6a02[_0xe82e('0x17')](_0x8e23db);}return _0x9a6a02[_0xe82e('0x18')](_0x8e23db)[_0xe82e('0x19')]();};}function respondWithResult(_0xa35c58,_0x2901a1){_0x2901a1=_0x2901a1||0xc8;return function(_0x2799e4){if(_0x2799e4){return _0xa35c58[_0xe82e('0x18')](_0x2901a1)[_0xe82e('0x1a')](_0x2799e4);}};}function respondWithFilteredResult(_0xe1fefa,_0x4e7dde){return function(_0x12d640){if(_0x12d640){var _0x4ade4b=typeof _0x4e7dde[_0xe82e('0x1b')]===_0xe82e('0x1c')&&typeof _0x4e7dde[_0xe82e('0x1d')]==='undefined';var _0x4e6b3f=_0x12d640['count'];var _0x19d95d=_0x4ade4b?0x0:_0x4e7dde[_0xe82e('0x1b')];var _0x17c355=_0x4ade4b?_0x12d640[_0xe82e('0x1e')]:_0x4e7dde[_0xe82e('0x1b')]+_0x4e7dde[_0xe82e('0x1d')];var _0x3b518b;if(_0x17c355>=_0x4e6b3f){_0x17c355=_0x4e6b3f;_0x3b518b=0xc8;}else{_0x3b518b=0xce;}_0xe1fefa[_0xe82e('0x18')](_0x3b518b);return _0xe1fefa['set'](_0xe82e('0x1f'),_0x19d95d+'-'+_0x17c355+'/'+_0x4e6b3f)[_0xe82e('0x1a')](_0x12d640);}return null;};}function patchUpdates(_0x1435e1){return function(_0x529fbf){try{jsonpatch['apply'](_0x529fbf,_0x1435e1,!![]);}catch(_0x41ccb6){return BPromise[_0xe82e('0x20')](_0x41ccb6);}return _0x529fbf['save']();};}function saveUpdates(_0x3cc4be,_0x8dfd0){return function(_0x298ee6){if(_0x298ee6){return _0x298ee6['update'](_0x3cc4be)[_0xe82e('0x21')](function(_0x437f58){return _0x437f58;});}return null;};}function removeEntity(_0x58b026,_0x4f5baf){return function(_0x5694b0){if(_0x5694b0){return _0x5694b0[_0xe82e('0x22')]()[_0xe82e('0x21')](function(){var _0x47b767=_0x5694b0[_0xe82e('0x23')]({'plain':!![]});var _0x24f76b=_0xe82e('0x24');return db[_0xe82e('0x25')][_0xe82e('0x22')]({'where':{'type':_0x24f76b,'resourceId':_0x47b767['id']}})[_0xe82e('0x21')](function(){return _0x5694b0;});})[_0xe82e('0x21')](function(){_0x58b026[_0xe82e('0x18')](0xcc)[_0xe82e('0x19')]();});}};}function handleEntityNotFound(_0x4d67cc,_0x5999ba){return function(_0x2e96b8){if(!_0x2e96b8){_0x4d67cc[_0xe82e('0x17')](0x194);}return _0x2e96b8;};}function handleError(_0x2e2aa5,_0x2a6e6e){_0x2a6e6e=_0x2a6e6e||0x1f4;return function(_0x320be1){logger[_0xe82e('0x26')](_0x320be1[_0xe82e('0x27')]);if(_0x320be1[_0xe82e('0x28')]){delete _0x320be1[_0xe82e('0x28')];}_0x2e2aa5['status'](_0x2a6e6e)[_0xe82e('0x29')](_0x320be1);};}exports['index']=function(_0x514d26,_0x231436){var _0x18f629={},_0x5da25b={},_0x49e066={'count':0x0,'rows':[]};var _0x4928fd=_[_0xe82e('0x2a')](db[_0xe82e('0x2b')][_0xe82e('0x2c')],function(_0x27fcfb){return{'name':_0x27fcfb[_0xe82e('0x2d')],'type':_0x27fcfb[_0xe82e('0x2e')]['key']};});_0x5da25b['model']=_[_0xe82e('0x2a')](_0x4928fd,_0xe82e('0x28'));_0x5da25b[_0xe82e('0x2f')]=_[_0xe82e('0x30')](_0x514d26[_0xe82e('0x2f')]);_0x5da25b[_0xe82e('0x31')]=_[_0xe82e('0x32')](_0x5da25b['model'],_0x5da25b['query']);_0x18f629[_0xe82e('0x33')]=_['intersection'](_0x5da25b[_0xe82e('0x34')],qs['fields'](_0x514d26[_0xe82e('0x2f')][_0xe82e('0x35')]));_0x18f629['attributes']=_0x18f629['attributes'][_0xe82e('0x36')]?_0x18f629[_0xe82e('0x33')]:_0x5da25b[_0xe82e('0x34')];if(!_0x514d26[_0xe82e('0x2f')][_0xe82e('0x37')](_0xe82e('0x38'))){_0x18f629['limit']=qs[_0xe82e('0x1d')](_0x514d26[_0xe82e('0x2f')]['limit']);_0x18f629['offset']=qs[_0xe82e('0x1b')](_0x514d26[_0xe82e('0x2f')][_0xe82e('0x1b')]);}_0x18f629['order']=qs[_0xe82e('0x39')](_0x514d26['query']['sort']);_0x18f629['where']=qs[_0xe82e('0x31')](_['pick'](_0x514d26['query'],_0x5da25b[_0xe82e('0x31')]),_0x4928fd);if(_0x514d26['query']['filter']){_0x18f629['where']=_[_0xe82e('0x3a')](_0x18f629['where'],{'$or':_[_0xe82e('0x2a')](_0x4928fd,function(_0x4428f0){if(_0x4428f0['type']!==_0xe82e('0x3b')){var _0x12dbd5={};_0x12dbd5[_0x4428f0[_0xe82e('0x28')]]={'$like':'%'+_0x514d26[_0xe82e('0x2f')][_0xe82e('0x3c')]+'%'};return _0x12dbd5;}})});}_0x18f629=_['merge']({},_0x18f629,_0x514d26['options']);var _0x5add74={'where':_0x18f629[_0xe82e('0x3d')]};return db[_0xe82e('0x2b')][_0xe82e('0x1e')](_0x5add74)[_0xe82e('0x21')](function(_0x8c1ee){_0x49e066[_0xe82e('0x1e')]=_0x8c1ee;if(_0x514d26[_0xe82e('0x2f')][_0xe82e('0x3e')]){_0x18f629[_0xe82e('0x3f')]=[{'all':!![]}];}return db[_0xe82e('0x2b')][_0xe82e('0x40')](_0x18f629);})[_0xe82e('0x21')](function(_0x36e20d){_0x49e066[_0xe82e('0x41')]=_0x36e20d;return _0x49e066;})[_0xe82e('0x21')](respondWithFilteredResult(_0x231436,_0x18f629))[_0xe82e('0x42')](handleError(_0x231436,null));};exports[_0xe82e('0x43')]=function(_0x540839,_0xe0e5b7){var _0x238bbc={'raw':![],'where':{'id':_0x540839[_0xe82e('0x44')]['id']}},_0x248b23={};_0x248b23[_0xe82e('0x34')]=_['keys'](db[_0xe82e('0x2b')][_0xe82e('0x2c')]);_0x248b23[_0xe82e('0x2f')]=_['keys'](_0x540839['query']);_0x248b23[_0xe82e('0x31')]=_[_0xe82e('0x32')](_0x248b23['model'],_0x248b23[_0xe82e('0x2f')]);_0x238bbc['attributes']=_[_0xe82e('0x32')](_0x248b23[_0xe82e('0x34')],qs[_0xe82e('0x35')](_0x540839['query'][_0xe82e('0x35')]));_0x238bbc['attributes']=_0x238bbc[_0xe82e('0x33')][_0xe82e('0x36')]?_0x238bbc[_0xe82e('0x33')]:_0x248b23[_0xe82e('0x34')];if(_0x540839[_0xe82e('0x2f')]['includeAll']){_0x238bbc['include']=[{'all':!![]}];}_0x238bbc=_[_0xe82e('0x3a')]({},_0x238bbc,_0x540839[_0xe82e('0x45')]);return db['JscriptyProject'][_0xe82e('0x46')](_0x238bbc)['then'](handleEntityNotFound(_0xe0e5b7,null))['then'](respondWithResult(_0xe0e5b7,null))[_0xe82e('0x42')](handleError(_0xe0e5b7,null));};exports['create']=function(_0x1a4ee5,_0x4081b5){return db[_0xe82e('0x2b')]['create'](_0x1a4ee5[_0xe82e('0x47')],{})[_0xe82e('0x21')](function(_0x5421b6){var _0x4e3e69=_0x1a4ee5['user'][_0xe82e('0x23')]({'plain':!![]});if(!_0x4e3e69)throw new Error(_0xe82e('0x48'));if(_0x4e3e69[_0xe82e('0x49')]===_0xe82e('0x4a')){var _0x2da452=_0x5421b6['get']({'plain':!![]});var _0x133400='Projects';return db['UserProfileSection'][_0xe82e('0x46')]({'where':{'name':_0x133400,'userProfileId':_0x4e3e69[_0xe82e('0x4b')]},'raw':!![]})[_0xe82e('0x21')](function(_0x13eabd){if(_0x13eabd&&_0x13eabd[_0xe82e('0x4c')]===0x0){return db['UserProfileResource']['create']({'name':_0x2da452[_0xe82e('0x28')],'resourceId':_0x2da452['id'],'type':_0x13eabd[_0xe82e('0x28')],'sectionId':_0x13eabd['id']},{})[_0xe82e('0x21')](function(){return _0x5421b6;});}else{return _0x5421b6;}})[_0xe82e('0x42')](function(_0x3130a3){logger[_0xe82e('0x26')](_0xe82e('0x4d'),_0x3130a3);throw _0x3130a3;});}return _0x5421b6;})[_0xe82e('0x21')](respondWithResult(_0x4081b5,0xc9))['catch'](handleError(_0x4081b5,null));};exports[_0xe82e('0x4e')]=function(_0x4460ff,_0x2a8986){var _0x238e10={'where':{'id':_0x4460ff[_0xe82e('0x44')]['id']}},_0x524f9c={};_0x524f9c[_0xe82e('0x34')]=_[_0xe82e('0x30')](db[_0xe82e('0x2b')]['rawAttributes']);_0x238e10[_0xe82e('0x33')]=_[_0xe82e('0x32')](_0x524f9c[_0xe82e('0x34')],qs[_0xe82e('0x35')](_0x4460ff[_0xe82e('0x2f')][_0xe82e('0x35')]));_0x238e10[_0xe82e('0x33')]=_0x238e10[_0xe82e('0x33')][_0xe82e('0x36')]?_0x238e10[_0xe82e('0x33')]:_0x524f9c[_0xe82e('0x34')];if(_0x4460ff['query']['includeAll']){_0x238e10[_0xe82e('0x3f')]=[{'all':!![]}];}_0x238e10=_['merge']({},_0x238e10,_0x4460ff[_0xe82e('0x45')]);return db[_0xe82e('0x2b')]['find'](_0x238e10)[_0xe82e('0x21')](handleEntityNotFound(_0x2a8986,null))[_0xe82e('0x21')](function(_0xc82755){if(_0xc82755){var _0x3fc0cc=_0xc82755['get']({'plain':!![]});_0x3fc0cc=qs['omit'](_0x3fc0cc,['id','createdAt',_0xe82e('0x4f')]);_0x4460ff[_0xe82e('0x47')]=_[_0xe82e('0x50')](_0x4460ff[_0xe82e('0x47')],['id',_0xe82e('0x51'),_0xe82e('0x4f')]);return db[_0xe82e('0x2b')]['create'](_['merge'](_0x3fc0cc,_0x4460ff['body']),{'include':_0x4460ff[_0xe82e('0x2f')][_0xe82e('0x3e')]?[{'all':!![]}]:undefined})[_0xe82e('0x21')](function(_0x3b86cd){var _0x1d47cf=_0x4460ff[_0xe82e('0x4a')]['get']({'plain':!![]});if(!_0x1d47cf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d47cf[_0xe82e('0x49')]===_0xe82e('0x4a')){var _0x324f86=_0x3b86cd[_0xe82e('0x23')]({'plain':!![]});var _0xa3b19e=_0xe82e('0x24');return db[_0xe82e('0x52')]['find']({'where':{'name':_0xa3b19e,'userProfileId':_0x1d47cf[_0xe82e('0x4b')]},'raw':!![]})[_0xe82e('0x21')](function(_0x14dc59){if(_0x14dc59&&_0x14dc59[_0xe82e('0x4c')]===0x0){return db[_0xe82e('0x25')][_0xe82e('0x53')]({'name':_0x324f86[_0xe82e('0x28')],'resourceId':_0x324f86['id'],'type':_0x14dc59[_0xe82e('0x28')],'sectionId':_0x14dc59['id']},{})['then'](function(){return _0x3b86cd;});}else{return _0x3b86cd;}})[_0xe82e('0x42')](function(_0x103652){logger[_0xe82e('0x26')](_0xe82e('0x4d'),_0x103652);throw _0x103652;});}return _0x3b86cd;});}})['then'](respondWithResult(_0x2a8986,0xc9))['catch'](handleError(_0x2a8986,null));};exports['update']=function(_0x2b4f31,_0x2524ec){if(_0x2b4f31[_0xe82e('0x47')]['id']){delete _0x2b4f31['body']['id'];}return db[_0xe82e('0x2b')][_0xe82e('0x46')]({'where':{'id':_0x2b4f31['params']['id']}})[_0xe82e('0x21')](handleEntityNotFound(_0x2524ec,null))['then'](saveUpdates(_0x2b4f31[_0xe82e('0x47')],null))[_0xe82e('0x21')](respondWithResult(_0x2524ec,null))['catch'](handleError(_0x2524ec,null));};exports[_0xe82e('0x22')]=function(_0x299a22,_0x50df93){return db[_0xe82e('0x2b')][_0xe82e('0x46')]({'where':{'id':_0x299a22[_0xe82e('0x44')]['id']}})[_0xe82e('0x21')](handleEntityNotFound(_0x50df93,null))[_0xe82e('0x21')](removeEntity(_0x50df93,null))[_0xe82e('0x42')](handleError(_0x50df93,null));};exports[_0xe82e('0x54')]=function(_0x19eb60,_0x509ca8,_0x3de60d){var _0x5b7c6f={'raw':!![],'where':{}};var _0x5da2e0={};var _0x3d9e3a={'count':0x0,'rows':[]};return db[_0xe82e('0x2b')][_0xe82e('0x55')]({'where':{'id':_0x19eb60['params']['id']}})[_0xe82e('0x21')](handleEntityNotFound(_0x509ca8,null))[_0xe82e('0x21')](function(_0x13c923){if(_0x13c923){_0x5da2e0[_0xe82e('0x34')]=_[_0xe82e('0x30')](db['JscriptySessionReport'][_0xe82e('0x2c')]);_0x5da2e0[_0xe82e('0x2f')]=_['keys'](_0x19eb60[_0xe82e('0x2f')]);_0x5da2e0[_0xe82e('0x31')]=_[_0xe82e('0x32')](_0x5da2e0[_0xe82e('0x34')],_0x5da2e0[_0xe82e('0x2f')]);_0x5b7c6f['attributes']=_[_0xe82e('0x32')](_0x5da2e0[_0xe82e('0x34')],qs[_0xe82e('0x35')](_0x19eb60['query'][_0xe82e('0x35')]));_0x5b7c6f[_0xe82e('0x33')]=_0x5b7c6f[_0xe82e('0x33')][_0xe82e('0x36')]?_0x5b7c6f[_0xe82e('0x33')]:_0x5da2e0[_0xe82e('0x34')];if(!_0x19eb60[_0xe82e('0x2f')][_0xe82e('0x37')](_0xe82e('0x38'))){_0x5b7c6f[_0xe82e('0x1d')]=qs['limit'](_0x19eb60[_0xe82e('0x2f')][_0xe82e('0x1d')]);_0x5b7c6f[_0xe82e('0x1b')]=qs[_0xe82e('0x1b')](_0x19eb60[_0xe82e('0x2f')]['offset']);}_0x5b7c6f['order']=qs['sort'](_0x19eb60[_0xe82e('0x2f')][_0xe82e('0x39')]);_0x5b7c6f[_0xe82e('0x3d')]=qs[_0xe82e('0x31')](_[_0xe82e('0x56')](_0x19eb60['query'],_0x5da2e0[_0xe82e('0x31')]));_0x5b7c6f[_0xe82e('0x3d')][_0xe82e('0x57')]=_0x13c923['id'];if(_0x19eb60[_0xe82e('0x2f')][_0xe82e('0x3c')]){_0x5b7c6f['where']=_['merge'](_0x5b7c6f[_0xe82e('0x3d')],{'$or':_[_0xe82e('0x2a')](_0x5b7c6f[_0xe82e('0x33')],function(_0x1d8b11){var _0x52b16e={};_0x52b16e[_0x1d8b11]={'$like':'%'+_0x19eb60[_0xe82e('0x2f')][_0xe82e('0x3c')]+'%'};return _0x52b16e;})});}_0x5b7c6f=_[_0xe82e('0x3a')]({},_0x5b7c6f,_0x19eb60[_0xe82e('0x45')]);return db[_0xe82e('0x58')][_0xe82e('0x1e')]({'where':_0x5b7c6f[_0xe82e('0x3d')]})[_0xe82e('0x21')](function(_0x5db1a9){_0x3d9e3a['count']=_0x5db1a9;if(_0x19eb60[_0xe82e('0x2f')][_0xe82e('0x3e')]){_0x5b7c6f[_0xe82e('0x3f')]=[{'all':!![]}];}return db[_0xe82e('0x58')][_0xe82e('0x40')](_0x5b7c6f);})['then'](function(_0x591c27){_0x3d9e3a[_0xe82e('0x41')]=_0x591c27;return _0x3d9e3a;});}})[_0xe82e('0x21')](respondWithFilteredResult(_0x509ca8,_0x5b7c6f))[_0xe82e('0x42')](handleError(_0x509ca8,null));};exports[_0xe82e('0x59')]=function(_0x3b79c3,_0x5ad7a7,_0x3b5404){var _0x3fc6a1={'raw':!![],'where':{}};var _0x2a1529={};var _0x555c1e={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xe82e('0x55')]({'where':{'id':_0x3b79c3[_0xe82e('0x44')]['id']}})[_0xe82e('0x21')](handleEntityNotFound(_0x5ad7a7,null))[_0xe82e('0x21')](function(_0x4b5699){if(_0x4b5699){_0x2a1529[_0xe82e('0x34')]=_[_0xe82e('0x30')](db[_0xe82e('0x5a')][_0xe82e('0x2c')]);_0x2a1529[_0xe82e('0x2f')]=_[_0xe82e('0x30')](_0x3b79c3['query']);_0x2a1529[_0xe82e('0x31')]=_[_0xe82e('0x32')](_0x2a1529[_0xe82e('0x34')],_0x2a1529[_0xe82e('0x2f')]);_0x3fc6a1[_0xe82e('0x33')]=_[_0xe82e('0x32')](_0x2a1529[_0xe82e('0x34')],qs[_0xe82e('0x35')](_0x3b79c3[_0xe82e('0x2f')][_0xe82e('0x35')]));_0x3fc6a1['attributes']=_0x3fc6a1[_0xe82e('0x33')][_0xe82e('0x36')]?_0x3fc6a1[_0xe82e('0x33')]:_0x2a1529[_0xe82e('0x34')];if(!_0x3b79c3[_0xe82e('0x2f')][_0xe82e('0x37')](_0xe82e('0x38'))){_0x3fc6a1[_0xe82e('0x1d')]=qs[_0xe82e('0x1d')](_0x3b79c3[_0xe82e('0x2f')][_0xe82e('0x1d')]);_0x3fc6a1[_0xe82e('0x1b')]=qs['offset'](_0x3b79c3[_0xe82e('0x2f')][_0xe82e('0x1b')]);}_0x3fc6a1[_0xe82e('0x5b')]=qs[_0xe82e('0x39')](_0x3b79c3[_0xe82e('0x2f')][_0xe82e('0x39')]);_0x3fc6a1['where']=qs[_0xe82e('0x31')](_[_0xe82e('0x56')](_0x3b79c3[_0xe82e('0x2f')],_0x2a1529[_0xe82e('0x31')]));_0x3fc6a1[_0xe82e('0x3d')][_0xe82e('0x57')]=_0x4b5699['id'];if(_0x3b79c3[_0xe82e('0x2f')][_0xe82e('0x3c')]){_0x3fc6a1[_0xe82e('0x3d')]=_[_0xe82e('0x3a')](_0x3fc6a1['where'],{'$or':_[_0xe82e('0x2a')](_0x3fc6a1[_0xe82e('0x33')],function(_0x31eb87){var _0x3f4375={};_0x3f4375[_0x31eb87]={'$like':'%'+_0x3b79c3[_0xe82e('0x2f')][_0xe82e('0x3c')]+'%'};return _0x3f4375;})});}_0x3fc6a1=_[_0xe82e('0x3a')]({},_0x3fc6a1,_0x3b79c3['options']);return db[_0xe82e('0x5a')][_0xe82e('0x1e')]({'where':_0x3fc6a1[_0xe82e('0x3d')]})[_0xe82e('0x21')](function(_0x13953f){_0x555c1e['count']=_0x13953f;if(_0x3b79c3['query']['includeAll']){_0x3fc6a1[_0xe82e('0x3f')]=[{'all':!![]}];}return db[_0xe82e('0x5a')]['findAll'](_0x3fc6a1);})['then'](function(_0xfff4aa){_0x555c1e[_0xe82e('0x41')]=_0xfff4aa;return _0x555c1e;});}})[_0xe82e('0x21')](respondWithFilteredResult(_0x5ad7a7,_0x3fc6a1))[_0xe82e('0x42')](handleError(_0x5ad7a7,null));};function char(_0x3ee3e0){return'number'===typeof _0x3ee3e0?String['fromCharCode'][_0xe82e('0x5c')](null,arguments):_0x3ee3e0;}function needsEncapsulation(_0x54fe77){return!!_0x54fe77&&(_0x54fe77['toString']()[_0xe82e('0x5d')](char(0xd))>=0x0||_0x54fe77[_0xe82e('0x5e')]()['indexOf'](char(0xa))>=0x0||_0x54fe77['toString']()[_0xe82e('0x5d')](char(0x2c))>=0x0||_0x54fe77[_0xe82e('0x5e')]()[_0xe82e('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x57cc07){var _0x488098=char(0x22),_0x4b00de='\x5c'+char(0x22),_0x543b27=_0x57cc07['toString']()['replace'](new RegExp(_0x488098,'g'),_0x4b00de);return _0x488098+_0x543b27+_0x488098;}exports[_0xe82e('0x5f')]=function(_0x2ef30d,_0x1baf57,_0x280cd1){var _0x13183e,_0xd6aa32;var _0x121ccf={'where':{'ProjectId':_0x2ef30d['params']['id']}};if(_0x2ef30d[_0xe82e('0x2f')]['startTime']){_0x121ccf[_0xe82e('0x3d')]['starttime']=JSON[_0xe82e('0x60')](_0x2ef30d['query']['startTime']);}return db['JscriptySessionReport'][_0xe82e('0x40')](_0x121ccf)[_0xe82e('0x21')](handleEntityNotFound(_0x1baf57,null))[_0xe82e('0x21')](function(_0x6e3bd6){if(_0x6e3bd6){_0x13183e=_0x6e3bd6;return db[_0xe82e('0x61')][_0xe82e('0x40')]({'where':{'SessionId':{'$in':_['map'](_0x13183e,'id')},'ProjectId':_0x2ef30d[_0xe82e('0x44')]['id']},'order':'-createdAt'});}})[_0xe82e('0x21')](handleEntityNotFound(_0x1baf57,null))[_0xe82e('0x21')](function(_0x58ad25){if(_0x58ad25){_0xd6aa32=_0x58ad25;var _0x2048db={};for(var _0x2725ac=0x0,_0x1ee5ab=_0xd6aa32[_0xe82e('0x36')];_0x2725ac<_0x1ee5ab;_0x2725ac++){if(!_0x2048db[_0xe82e('0x37')](_0xd6aa32[_0x2725ac][_0xe82e('0x62')])){_0x2048db[_0xd6aa32[_0x2725ac][_0xe82e('0x62')]]=needsEncapsulation(_0xd6aa32[_0x2725ac]['question'])?encapsulate(_0xd6aa32[_0x2725ac]['question']):_0xd6aa32[_0x2725ac][_0xe82e('0x63')];}}var _0x1297b6=[],_0x3231ae={};for(var _0x5657f5=0x0,_0x466295=_0x13183e[_0xe82e('0x36')];_0x5657f5<_0x466295;_0x5657f5++){_0x3231ae={'ProjectId':_0x2ef30d[_0xe82e('0x44')]['id'],'SessionId':_0x13183e[_0x5657f5]['id'],'StartTime':moment(_0x13183e[_0x5657f5]['starttime'])[_0xe82e('0x64')](_0xe82e('0x65'))};for(var _0x209d1e=0x0,_0x53adcd=_0xd6aa32[_0xe82e('0x36')];_0x209d1e<_0x53adcd;_0x209d1e++){if(_0xd6aa32[_0x209d1e][_0xe82e('0x66')]==_0x13183e[_0x5657f5]['id']&&_0x2048db[_0xe82e('0x37')](_0xd6aa32[_0x209d1e]['questionId'])){_0x3231ae[_0x2048db[_0xd6aa32[_0x209d1e][_0xe82e('0x62')]]]=_0xd6aa32[_0x209d1e][_0xe82e('0x67')];}}for(var _0x1f4680 in _0x2048db){if(!_0x3231ae['hasOwnProperty'](_0x2048db[_0x1f4680])){_0x3231ae[_0x2048db[_0x1f4680]]=null;}}_0x1297b6[_0xe82e('0x68')](_0x3231ae);}return _0x1297b6;}})[_0xe82e('0x21')](function(_0xf13131){if(!_[_0xe82e('0x69')](_0xf13131)){var _0x397efb=toCsv(_0xf13131);var _0x4ad8f0=Date[_0xe82e('0x6a')]();fs[_0xe82e('0x6b')](util[_0xe82e('0x64')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x2ef30d['params']['id'],_0x4ad8f0),_0x397efb);_0x1baf57[_0xe82e('0x6c')](_0xe82e('0x6d'),_0xe82e('0x6e')+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x2ef30d['params']['id'],_0x4ad8f0));_0x1baf57[_0xe82e('0x6c')](_0xe82e('0x6f'),_0xe82e('0x70'));return _0x1baf57[_0xe82e('0x71')](util[_0xe82e('0x64')](_0xe82e('0x72'),_0x2ef30d['params']['id'],_0x4ad8f0));}else{return _0x1baf57[_0xe82e('0x17')](0xcc);}})[_0xe82e('0x42')](handleError(_0x1baf57,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 4fb2933..047729f 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 _0xb6f1=['lodash','../../config/logger','moment','bluebird','request-promise','rimraf','./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb6f1,0x118));var _0x1b6f=function(_0x5a26db,_0x2c5ccd){_0x5a26db=_0x5a26db-0x0;var _0x4619dd=_0xb6f1[_0x5a26db];return _0x4619dd;};'use strict';var _=require(_0x1b6f('0x0'));var util=require('util');var logger=require(_0x1b6f('0x1'))('api');var moment=require(_0x1b6f('0x2'));var BPromise=require(_0x1b6f('0x3'));var rp=require(_0x1b6f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1b6f('0x5'));var config=require('../../config/environment');var attributes=require(_0x1b6f('0x6'));module[_0x1b6f('0x7')]=function(_0xd4703b,_0x493c91){return _0xd4703b['define'](_0x1b6f('0x8'),attributes,{'tableName':_0x1b6f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3379=['exports','JscriptyProject','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./jscriptyProject.attributes'];(function(_0x4d185b,_0x50a597){var _0x26e7fe=function(_0x38f06f){while(--_0x38f06f){_0x4d185b['push'](_0x4d185b['shift']());}};_0x26e7fe(++_0x50a597);}(_0x3379,0x115));var _0x9337=function(_0x524f44,_0x5b64cd){_0x524f44=_0x524f44-0x0;var _0x575a66=_0x3379[_0x524f44];return _0x575a66;};'use strict';var _=require(_0x9337('0x0'));var util=require(_0x9337('0x1'));var logger=require(_0x9337('0x2'))(_0x9337('0x3'));var moment=require('moment');var BPromise=require(_0x9337('0x4'));var rp=require(_0x9337('0x5'));var fs=require('fs');var path=require(_0x9337('0x6'));var rimraf=require(_0x9337('0x7'));var config=require('../../config/environment');var attributes=require(_0x9337('0x8'));module[_0x9337('0x9')]=function(_0x390772,_0x677c38){return _0x390772['define'](_0x9337('0xa'),attributes,{'tableName':'jscripty_projects','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 3d774e2..b82440c 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 _0x9bde=['code','message','JscriptyProject,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x302411,_0x3c5147){var _0x3ddd54=function(_0x5425d8){while(--_0x5425d8){_0x302411['push'](_0x302411['shift']());}};_0x3ddd54(++_0x3c5147);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5a62b0,_0x531680){_0x5a62b0=_0x5a62b0-0x0;var _0xe2ca09=_0x9bde[_0x5a62b0];return _0xe2ca09;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file +var _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5ba9ff,_0x1a8955){var _0x415b2d=function(_0x2b67bf){while(--_0x2b67bf){_0x5ba9ff['push'](_0x5ba9ff['shift']());}};_0x415b2d(++_0x1a8955);}(_0xf4eb,0xec));var _0xbf4e=function(_0xbce318,_0x44fb96){_0xbce318=_0xbce318-0x0;var _0x4e2a00=_0xf4eb[_0xbce318];return _0x4e2a00;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index dd0f5d6..2dafd98 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 _0xa3d0=['update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','post'];(function(_0x358e83,_0x1db30d){var _0x3da745=function(_0x48fcec){while(--_0x48fcec){_0x358e83['push'](_0x358e83['shift']());}};_0x3da745(++_0x1db30d);}(_0xa3d0,0x169));var _0x0a3d=function(_0x5ab8ae,_0x17821a){_0x5ab8ae=_0x5ab8ae-0x0;var _0x129f8a=_0xa3d0[_0x5ab8ae];return _0x129f8a;};'use strict';var multer=require(_0x0a3d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0a3d('0x1'));var express=require(_0x0a3d('0x2'));var router=express[_0x0a3d('0x3')]();var fs_extra=require(_0x0a3d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0a3d('0x5'));var config=require(_0x0a3d('0x6'));var controller=require('./jscriptyQuestionReport.controller');router[_0x0a3d('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a3d('0x8')]);router[_0x0a3d('0x7')](_0x0a3d('0x9'),auth[_0x0a3d('0xa')](),controller['describe']);router[_0x0a3d('0x7')](_0x0a3d('0xb'),auth[_0x0a3d('0xa')](),controller['show']);router[_0x0a3d('0xc')]('/',auth[_0x0a3d('0xa')](),controller['create']);router['put']('/:id',auth[_0x0a3d('0xa')](),controller[_0x0a3d('0xd')]);router[_0x0a3d('0xe')](_0x0a3d('0xb'),auth[_0x0a3d('0xa')](),controller[_0x0a3d('0xf')]);module[_0x0a3d('0x10')]=router; \ No newline at end of file +var _0x6d68=['express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout'];(function(_0x2fa5e5,_0x520b3f){var _0x46e512=function(_0x54303f){while(--_0x54303f){_0x2fa5e5['push'](_0x2fa5e5['shift']());}};_0x46e512(++_0x520b3f);}(_0x6d68,0xa8));var _0x86d6=function(_0x3595bf,_0x5b0a83){_0x3595bf=_0x3595bf-0x0;var _0x19c9fc=_0x6d68[_0x3595bf];return _0x19c9fc;};'use strict';var multer=require(_0x86d6('0x0'));var util=require('util');var path=require(_0x86d6('0x1'));var timeout=require(_0x86d6('0x2'));var express=require(_0x86d6('0x3'));var router=express[_0x86d6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x86d6('0x5'));var interaction=require(_0x86d6('0x6'));var config=require('../../config/environment');var controller=require(_0x86d6('0x7'));router[_0x86d6('0x8')]('/',auth[_0x86d6('0x9')](),controller['index']);router[_0x86d6('0x8')]('/describe',auth[_0x86d6('0x9')](),controller[_0x86d6('0xa')]);router[_0x86d6('0x8')](_0x86d6('0xb'),auth[_0x86d6('0x9')](),controller[_0x86d6('0xc')]);router[_0x86d6('0xd')]('/',auth[_0x86d6('0x9')](),controller[_0x86d6('0xe')]);router[_0x86d6('0xf')](_0x86d6('0xb'),auth[_0x86d6('0x9')](),controller[_0x86d6('0x10')]);router['delete'](_0x86d6('0xb'),auth[_0x86d6('0x9')](),controller[_0x86d6('0x11')]);module[_0x86d6('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 0709499..dc0e10f 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(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x7a54,0x106));var _0x47a5=function(_0x4353c0,_0x512d64){_0x4353c0=_0x4353c0-0x0;var _0x88cbb6=_0x7a54[_0x4353c0];return _0x88cbb6;};'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(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x7a54,0x106));var _0x47a5=function(_0x4ef59c,_0x2011dd){_0x4ef59c=_0x4ef59c-0x0;var _0x46b1d5=_0x7a54[_0x4ef59c];return _0x46b1d5;};'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 79a7d1a..c9068cc 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 _0x46b4=['sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','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','update','then','destroy','stack','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','type','model','map','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','filters','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path'];(function(_0x35b195,_0x8893d5){var _0x2433bf=function(_0x22be07){while(--_0x22be07){_0x35b195['push'](_0x35b195['shift']());}};_0x2433bf(++_0x8893d5);}(_0x46b4,0x8b));var _0x446b=function(_0x1e87b3,_0x4b48b1){_0x1e87b3=_0x1e87b3-0x0;var _0x2a5ccf=_0x46b4[_0x1e87b3];return _0x2a5ccf;};'use strict';var emlformat=require(_0x446b('0x0'));var rimraf=require(_0x446b('0x1'));var zipdir=require(_0x446b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x446b('0x3'));var moment=require(_0x446b('0x4'));var BPromise=require(_0x446b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x446b('0x6'));var sox=require(_0x446b('0x7'));var csv=require(_0x446b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x446b('0x9'));var _=require(_0x446b('0xa'));var squel=require(_0x446b('0xb'));var crypto=require(_0x446b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x446b('0xd'));var toCsv=require(_0x446b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x446b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x446b('0xf'));var as=require(_0x446b('0x10'));var hardwareService=require(_0x446b('0x11'));var logger=require(_0x446b('0x12'))('api');var utils=require(_0x446b('0x13'));var config=require(_0x446b('0x14'));var licenseUtil=require(_0x446b('0x15'));var db=require(_0x446b('0x16'))['db'];function respondWithStatusCode(_0x2d6573,_0x2c0037){_0x2c0037=_0x2c0037||0xcc;return function(_0x3c3907){if(_0x3c3907){return _0x2d6573[_0x446b('0x17')](_0x2c0037);}return _0x2d6573[_0x446b('0x18')](_0x2c0037)[_0x446b('0x19')]();};}function respondWithResult(_0x384c78,_0x4330b5){_0x4330b5=_0x4330b5||0xc8;return function(_0x2436dd){if(_0x2436dd){return _0x384c78[_0x446b('0x18')](_0x4330b5)[_0x446b('0x1a')](_0x2436dd);}};}function respondWithFilteredResult(_0x22b5c3,_0x24df04){return function(_0x3c7dfc){if(_0x3c7dfc){var _0x35cead=typeof _0x24df04[_0x446b('0x1b')]===_0x446b('0x1c')&&typeof _0x24df04[_0x446b('0x1d')]==='undefined';var _0x2c164a=_0x3c7dfc[_0x446b('0x1e')];var _0x59a413=_0x35cead?0x0:_0x24df04[_0x446b('0x1b')];var _0x4e989c=_0x35cead?_0x3c7dfc[_0x446b('0x1e')]:_0x24df04[_0x446b('0x1b')]+_0x24df04['limit'];var _0x18b36e;if(_0x4e989c>=_0x2c164a){_0x4e989c=_0x2c164a;_0x18b36e=0xc8;}else{_0x18b36e=0xce;}_0x22b5c3[_0x446b('0x18')](_0x18b36e);return _0x22b5c3[_0x446b('0x1f')]('Content-Range',_0x59a413+'-'+_0x4e989c+'/'+_0x2c164a)[_0x446b('0x1a')](_0x3c7dfc);}return null;};}function patchUpdates(_0x3d9fe6){return function(_0xbefb76){try{jsonpatch['apply'](_0xbefb76,_0x3d9fe6,!![]);}catch(_0x212ed1){return BPromise['reject'](_0x212ed1);}return _0xbefb76[_0x446b('0x20')]();};}function saveUpdates(_0x270b05,_0x3d1438){return function(_0x38994f){if(_0x38994f){return _0x38994f[_0x446b('0x21')](_0x270b05)[_0x446b('0x22')](function(_0x582eec){return _0x582eec;});}return null;};}function removeEntity(_0x38262f,_0x2cebdd){return function(_0x1060de){if(_0x1060de){return _0x1060de[_0x446b('0x23')]()[_0x446b('0x22')](function(){_0x38262f[_0x446b('0x18')](0xcc)[_0x446b('0x19')]();});}};}function handleEntityNotFound(_0xdf817b,_0x6167d0){return function(_0x732da5){if(!_0x732da5){_0xdf817b[_0x446b('0x17')](0x194);}return _0x732da5;};}function handleError(_0x385415,_0x33ac80){_0x33ac80=_0x33ac80||0x1f4;return function(_0x26ba2f){logger['error'](_0x26ba2f[_0x446b('0x24')]);if(_0x26ba2f[_0x446b('0x25')]){delete _0x26ba2f[_0x446b('0x25')];}_0x385415[_0x446b('0x18')](_0x33ac80)[_0x446b('0x26')](_0x26ba2f);};}exports[_0x446b('0x27')]=function(_0x1a7999,_0x5c47ae){var _0x37ecea={},_0x2f8a7d={},_0x253474={'count':0x0,'rows':[]};var _0x378ac4=_['map'](db[_0x446b('0x28')][_0x446b('0x29')],function(_0x287b19){return{'name':_0x287b19[_0x446b('0x2a')],'type':_0x287b19[_0x446b('0x2b')]['key']};});_0x2f8a7d[_0x446b('0x2c')]=_[_0x446b('0x2d')](_0x378ac4,_0x446b('0x25'));_0x2f8a7d[_0x446b('0x2e')]=_['keys'](_0x1a7999[_0x446b('0x2e')]);_0x2f8a7d['filters']=_['intersection'](_0x2f8a7d[_0x446b('0x2c')],_0x2f8a7d[_0x446b('0x2e')]);_0x37ecea[_0x446b('0x2f')]=_[_0x446b('0x30')](_0x2f8a7d[_0x446b('0x2c')],qs['fields'](_0x1a7999['query'][_0x446b('0x31')]));_0x37ecea[_0x446b('0x2f')]=_0x37ecea['attributes']['length']?_0x37ecea[_0x446b('0x2f')]:_0x2f8a7d[_0x446b('0x2c')];if(!_0x1a7999[_0x446b('0x2e')][_0x446b('0x32')](_0x446b('0x33'))){_0x37ecea[_0x446b('0x1d')]=qs[_0x446b('0x1d')](_0x1a7999[_0x446b('0x2e')]['limit']);_0x37ecea[_0x446b('0x1b')]=qs[_0x446b('0x1b')](_0x1a7999[_0x446b('0x2e')][_0x446b('0x1b')]);}_0x37ecea[_0x446b('0x34')]=qs[_0x446b('0x35')](_0x1a7999[_0x446b('0x2e')][_0x446b('0x35')]);_0x37ecea[_0x446b('0x36')]=qs['filters'](_[_0x446b('0x37')](_0x1a7999[_0x446b('0x2e')],_0x2f8a7d['filters']),_0x378ac4);if(_0x1a7999[_0x446b('0x2e')][_0x446b('0x38')]){_0x37ecea[_0x446b('0x36')]=_[_0x446b('0x39')](_0x37ecea['where'],{'$or':_['map'](_0x378ac4,function(_0x5c9325){if(_0x5c9325['type']!==_0x446b('0x3a')){var _0x5d1758={};_0x5d1758[_0x5c9325[_0x446b('0x25')]]={'$like':'%'+_0x1a7999[_0x446b('0x2e')][_0x446b('0x38')]+'%'};return _0x5d1758;}})});}_0x37ecea=_[_0x446b('0x39')]({},_0x37ecea,_0x1a7999[_0x446b('0x3b')]);var _0x2e1987={'where':_0x37ecea[_0x446b('0x36')]};return db[_0x446b('0x28')]['count'](_0x2e1987)[_0x446b('0x22')](function(_0x10c489){_0x253474[_0x446b('0x1e')]=_0x10c489;if(_0x1a7999[_0x446b('0x2e')][_0x446b('0x3c')]){_0x37ecea[_0x446b('0x3d')]=[{'all':!![]}];}return db[_0x446b('0x28')][_0x446b('0x3e')](_0x37ecea);})['then'](function(_0x2c2e76){_0x253474[_0x446b('0x3f')]=_0x2c2e76;return _0x253474;})[_0x446b('0x22')](respondWithFilteredResult(_0x5c47ae,_0x37ecea))[_0x446b('0x40')](handleError(_0x5c47ae,null));};exports['show']=function(_0x201206,_0x713661){var _0x1141f9={'raw':!![],'where':{'id':_0x201206['params']['id']}},_0x3bbeba={};_0x3bbeba[_0x446b('0x2c')]=_[_0x446b('0x41')](db[_0x446b('0x28')][_0x446b('0x29')]);_0x3bbeba[_0x446b('0x2e')]=_[_0x446b('0x41')](_0x201206[_0x446b('0x2e')]);_0x3bbeba[_0x446b('0x42')]=_[_0x446b('0x30')](_0x3bbeba[_0x446b('0x2c')],_0x3bbeba[_0x446b('0x2e')]);_0x1141f9[_0x446b('0x2f')]=_[_0x446b('0x30')](_0x3bbeba['model'],qs[_0x446b('0x31')](_0x201206[_0x446b('0x2e')][_0x446b('0x31')]));_0x1141f9[_0x446b('0x2f')]=_0x1141f9[_0x446b('0x2f')][_0x446b('0x43')]?_0x1141f9['attributes']:_0x3bbeba[_0x446b('0x2c')];if(_0x201206['query'][_0x446b('0x3c')]){_0x1141f9['include']=[{'all':!![]}];}_0x1141f9=_[_0x446b('0x39')]({},_0x1141f9,_0x201206[_0x446b('0x3b')]);return db[_0x446b('0x28')][_0x446b('0x44')](_0x1141f9)[_0x446b('0x22')](handleEntityNotFound(_0x713661,null))['then'](respondWithResult(_0x713661,null))[_0x446b('0x40')](handleError(_0x713661,null));};exports[_0x446b('0x45')]=function(_0x101386,_0x2f9e89){return db[_0x446b('0x28')][_0x446b('0x45')](_0x101386[_0x446b('0x46')],{})[_0x446b('0x22')](respondWithResult(_0x2f9e89,0xc9))[_0x446b('0x40')](handleError(_0x2f9e89,null));};exports['update']=function(_0x341aa3,_0x487e4b){if(_0x341aa3[_0x446b('0x46')]['id']){delete _0x341aa3[_0x446b('0x46')]['id'];}return db['JscriptyQuestionReport'][_0x446b('0x44')]({'where':{'id':_0x341aa3[_0x446b('0x47')]['id']}})['then'](handleEntityNotFound(_0x487e4b,null))['then'](saveUpdates(_0x341aa3[_0x446b('0x46')],null))['then'](respondWithResult(_0x487e4b,null))[_0x446b('0x40')](handleError(_0x487e4b,null));};exports[_0x446b('0x23')]=function(_0x2b0c51,_0x1c1795){return db['JscriptyQuestionReport'][_0x446b('0x44')]({'where':{'id':_0x2b0c51[_0x446b('0x47')]['id']}})[_0x446b('0x22')](handleEntityNotFound(_0x1c1795,null))[_0x446b('0x22')](removeEntity(_0x1c1795,null))[_0x446b('0x40')](handleError(_0x1c1795,null));};exports[_0x446b('0x48')]=function(_0x28e958,_0x326857){return db[_0x446b('0x28')]['describe']()[_0x446b('0x22')](respondWithResult(_0x326857,null))[_0x446b('0x40')](handleError(_0x326857,null));}; \ No newline at end of file +var _0xb818=['sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','end','error','stack','name','send','index','map','JscriptyQuestionReport','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','intersection','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xb818,0x174));var _0x8b81=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xb818[_0x173441];return _0x2423a8;};'use strict';var emlformat=require(_0x8b81('0x0'));var rimraf=require(_0x8b81('0x1'));var zipdir=require(_0x8b81('0x2'));var jsonpatch=require(_0x8b81('0x3'));var rp=require(_0x8b81('0x4'));var moment=require(_0x8b81('0x5'));var BPromise=require(_0x8b81('0x6'));var Mustache=require('mustache');var util=require(_0x8b81('0x7'));var path=require('path');var sox=require(_0x8b81('0x8'));var csv=require('to-csv');var ejs=require(_0x8b81('0x9'));var fs=require('fs');var fs_extra=require(_0x8b81('0xa'));var _=require(_0x8b81('0xb'));var squel=require(_0x8b81('0xc'));var crypto=require(_0x8b81('0xd'));var jsforce=require(_0x8b81('0xe'));var deskjs=require(_0x8b81('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8b81('0x10'));var Papa=require(_0x8b81('0x11'));var Redis=require(_0x8b81('0x12'));var authService=require(_0x8b81('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b81('0x14'));var logger=require(_0x8b81('0x15'))(_0x8b81('0x16'));var utils=require(_0x8b81('0x17'));var config=require(_0x8b81('0x18'));var licenseUtil=require(_0x8b81('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xde7b9f,_0x287a79){_0x287a79=_0x287a79||0xcc;return function(_0x3c51d4){if(_0x3c51d4){return _0xde7b9f[_0x8b81('0x1a')](_0x287a79);}return _0xde7b9f[_0x8b81('0x1b')](_0x287a79)['end']();};}function respondWithResult(_0x653529,_0x21f736){_0x21f736=_0x21f736||0xc8;return function(_0x5a4d86){if(_0x5a4d86){return _0x653529[_0x8b81('0x1b')](_0x21f736)[_0x8b81('0x1c')](_0x5a4d86);}};}function respondWithFilteredResult(_0x4ef5ba,_0x50e18c){return function(_0x3f0210){if(_0x3f0210){var _0x6f368=typeof _0x50e18c[_0x8b81('0x1d')]===_0x8b81('0x1e')&&typeof _0x50e18c[_0x8b81('0x1f')]==='undefined';var _0x82b9c6=_0x3f0210[_0x8b81('0x20')];var _0x3c37b7=_0x6f368?0x0:_0x50e18c[_0x8b81('0x1d')];var _0x1e814e=_0x6f368?_0x3f0210[_0x8b81('0x20')]:_0x50e18c['offset']+_0x50e18c['limit'];var _0x34ce62;if(_0x1e814e>=_0x82b9c6){_0x1e814e=_0x82b9c6;_0x34ce62=0xc8;}else{_0x34ce62=0xce;}_0x4ef5ba['status'](_0x34ce62);return _0x4ef5ba[_0x8b81('0x21')](_0x8b81('0x22'),_0x3c37b7+'-'+_0x1e814e+'/'+_0x82b9c6)[_0x8b81('0x1c')](_0x3f0210);}return null;};}function patchUpdates(_0x2cc0cd){return function(_0x44fc6e){try{jsonpatch['apply'](_0x44fc6e,_0x2cc0cd,!![]);}catch(_0x5603c5){return BPromise['reject'](_0x5603c5);}return _0x44fc6e['save']();};}function saveUpdates(_0x47c9b7,_0x3c528e){return function(_0x2f7ad5){if(_0x2f7ad5){return _0x2f7ad5['update'](_0x47c9b7)[_0x8b81('0x23')](function(_0x13f2f8){return _0x13f2f8;});}return null;};}function removeEntity(_0x27ce6d,_0x544ba0){return function(_0x693bee){if(_0x693bee){return _0x693bee[_0x8b81('0x24')]()[_0x8b81('0x23')](function(){_0x27ce6d['status'](0xcc)[_0x8b81('0x25')]();});}};}function handleEntityNotFound(_0x39f69c,_0xb0484d){return function(_0x517ddc){if(!_0x517ddc){_0x39f69c[_0x8b81('0x1a')](0x194);}return _0x517ddc;};}function handleError(_0x34ccea,_0x5f30a9){_0x5f30a9=_0x5f30a9||0x1f4;return function(_0x4392c8){logger[_0x8b81('0x26')](_0x4392c8[_0x8b81('0x27')]);if(_0x4392c8[_0x8b81('0x28')]){delete _0x4392c8[_0x8b81('0x28')];}_0x34ccea[_0x8b81('0x1b')](_0x5f30a9)[_0x8b81('0x29')](_0x4392c8);};}exports[_0x8b81('0x2a')]=function(_0xfa3d7b,_0x48e364){var _0x3ca98c={},_0x5a3291={},_0x41a732={'count':0x0,'rows':[]};var _0x6f04b5=_[_0x8b81('0x2b')](db[_0x8b81('0x2c')]['rawAttributes'],function(_0x4ef0b5){return{'name':_0x4ef0b5['fieldName'],'type':_0x4ef0b5['type'][_0x8b81('0x2d')]};});_0x5a3291[_0x8b81('0x2e')]=_['map'](_0x6f04b5,_0x8b81('0x28'));_0x5a3291[_0x8b81('0x2f')]=_[_0x8b81('0x30')](_0xfa3d7b[_0x8b81('0x2f')]);_0x5a3291[_0x8b81('0x31')]=_['intersection'](_0x5a3291['model'],_0x5a3291[_0x8b81('0x2f')]);_0x3ca98c[_0x8b81('0x32')]=_['intersection'](_0x5a3291['model'],qs[_0x8b81('0x33')](_0xfa3d7b[_0x8b81('0x2f')][_0x8b81('0x33')]));_0x3ca98c[_0x8b81('0x32')]=_0x3ca98c[_0x8b81('0x32')][_0x8b81('0x34')]?_0x3ca98c[_0x8b81('0x32')]:_0x5a3291['model'];if(!_0xfa3d7b['query'][_0x8b81('0x35')](_0x8b81('0x36'))){_0x3ca98c[_0x8b81('0x1f')]=qs['limit'](_0xfa3d7b[_0x8b81('0x2f')][_0x8b81('0x1f')]);_0x3ca98c[_0x8b81('0x1d')]=qs['offset'](_0xfa3d7b[_0x8b81('0x2f')][_0x8b81('0x1d')]);}_0x3ca98c[_0x8b81('0x37')]=qs[_0x8b81('0x38')](_0xfa3d7b[_0x8b81('0x2f')]['sort']);_0x3ca98c[_0x8b81('0x39')]=qs[_0x8b81('0x31')](_[_0x8b81('0x3a')](_0xfa3d7b[_0x8b81('0x2f')],_0x5a3291[_0x8b81('0x31')]),_0x6f04b5);if(_0xfa3d7b[_0x8b81('0x2f')][_0x8b81('0x3b')]){_0x3ca98c[_0x8b81('0x39')]=_[_0x8b81('0x3c')](_0x3ca98c['where'],{'$or':_[_0x8b81('0x2b')](_0x6f04b5,function(_0x1c3197){if(_0x1c3197[_0x8b81('0x3d')]!==_0x8b81('0x3e')){var _0x4ecccb={};_0x4ecccb[_0x1c3197[_0x8b81('0x28')]]={'$like':'%'+_0xfa3d7b[_0x8b81('0x2f')][_0x8b81('0x3b')]+'%'};return _0x4ecccb;}})});}_0x3ca98c=_[_0x8b81('0x3c')]({},_0x3ca98c,_0xfa3d7b[_0x8b81('0x3f')]);var _0x3eaf6c={'where':_0x3ca98c[_0x8b81('0x39')]};return db[_0x8b81('0x2c')][_0x8b81('0x20')](_0x3eaf6c)[_0x8b81('0x23')](function(_0x162f99){_0x41a732[_0x8b81('0x20')]=_0x162f99;if(_0xfa3d7b[_0x8b81('0x2f')][_0x8b81('0x40')]){_0x3ca98c[_0x8b81('0x41')]=[{'all':!![]}];}return db[_0x8b81('0x2c')][_0x8b81('0x42')](_0x3ca98c);})[_0x8b81('0x23')](function(_0x1775ef){_0x41a732[_0x8b81('0x43')]=_0x1775ef;return _0x41a732;})[_0x8b81('0x23')](respondWithFilteredResult(_0x48e364,_0x3ca98c))['catch'](handleError(_0x48e364,null));};exports[_0x8b81('0x44')]=function(_0x31eaea,_0x1d90db){var _0x631db3={'raw':!![],'where':{'id':_0x31eaea['params']['id']}},_0x39c273={};_0x39c273[_0x8b81('0x2e')]=_[_0x8b81('0x30')](db['JscriptyQuestionReport'][_0x8b81('0x45')]);_0x39c273[_0x8b81('0x2f')]=_[_0x8b81('0x30')](_0x31eaea[_0x8b81('0x2f')]);_0x39c273[_0x8b81('0x31')]=_[_0x8b81('0x46')](_0x39c273[_0x8b81('0x2e')],_0x39c273[_0x8b81('0x2f')]);_0x631db3[_0x8b81('0x32')]=_[_0x8b81('0x46')](_0x39c273[_0x8b81('0x2e')],qs[_0x8b81('0x33')](_0x31eaea['query'][_0x8b81('0x33')]));_0x631db3[_0x8b81('0x32')]=_0x631db3[_0x8b81('0x32')][_0x8b81('0x34')]?_0x631db3['attributes']:_0x39c273['model'];if(_0x31eaea['query']['includeAll']){_0x631db3[_0x8b81('0x41')]=[{'all':!![]}];}_0x631db3=_[_0x8b81('0x3c')]({},_0x631db3,_0x31eaea[_0x8b81('0x3f')]);return db['JscriptyQuestionReport'][_0x8b81('0x47')](_0x631db3)[_0x8b81('0x23')](handleEntityNotFound(_0x1d90db,null))['then'](respondWithResult(_0x1d90db,null))[_0x8b81('0x48')](handleError(_0x1d90db,null));};exports[_0x8b81('0x49')]=function(_0xc3d587,_0x3fe345){return db['JscriptyQuestionReport'][_0x8b81('0x49')](_0xc3d587[_0x8b81('0x4a')],{})[_0x8b81('0x23')](respondWithResult(_0x3fe345,0xc9))[_0x8b81('0x48')](handleError(_0x3fe345,null));};exports['update']=function(_0x4c9bf6,_0x1b2455){if(_0x4c9bf6[_0x8b81('0x4a')]['id']){delete _0x4c9bf6[_0x8b81('0x4a')]['id'];}return db['JscriptyQuestionReport'][_0x8b81('0x47')]({'where':{'id':_0x4c9bf6['params']['id']}})[_0x8b81('0x23')](handleEntityNotFound(_0x1b2455,null))[_0x8b81('0x23')](saveUpdates(_0x4c9bf6[_0x8b81('0x4a')],null))[_0x8b81('0x23')](respondWithResult(_0x1b2455,null))[_0x8b81('0x48')](handleError(_0x1b2455,null));};exports[_0x8b81('0x24')]=function(_0x2e43ee,_0x630818){return db[_0x8b81('0x2c')][_0x8b81('0x47')]({'where':{'id':_0x2e43ee['params']['id']}})[_0x8b81('0x23')](handleEntityNotFound(_0x630818,null))[_0x8b81('0x23')](removeEntity(_0x630818,null))[_0x8b81('0x48')](handleError(_0x630818,null));};exports[_0x8b81('0x4b')]=function(_0x4d1eea,_0x214f52){return db[_0x8b81('0x2c')][_0x8b81('0x4b')]()[_0x8b81('0x23')](respondWithResult(_0x214f52,null))[_0x8b81('0x48')](handleError(_0x214f52,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index b712182..849b1f7 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 _0x3d5e=['api','moment','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','util','../../config/logger'];(function(_0x307c60,_0x5c7d49){var _0x590f7b=function(_0x499bce){while(--_0x499bce){_0x307c60['push'](_0x307c60['shift']());}};_0x590f7b(++_0x5c7d49);}(_0x3d5e,0x106));var _0xe3d5=function(_0x5260f6,_0x56d10b){_0x5260f6=_0x5260f6-0x0;var _0x46ecb8=_0x3d5e[_0x5260f6];return _0x46ecb8;};'use strict';var _=require('lodash');var util=require(_0xe3d5('0x0'));var logger=require(_0xe3d5('0x1'))(_0xe3d5('0x2'));var moment=require(_0xe3d5('0x3'));var BPromise=require(_0xe3d5('0x4'));var rp=require(_0xe3d5('0x5'));var fs=require('fs');var path=require(_0xe3d5('0x6'));var rimraf=require('rimraf');var config=require(_0xe3d5('0x7'));var attributes=require(_0xe3d5('0x8'));module[_0xe3d5('0x9')]=function(_0x58658e,_0x20f03f){return _0x58658e[_0xe3d5('0xa')](_0xe3d5('0xb'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43c2=['report_jscripty_questions','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0x43c2,0x169));var _0x243c=function(_0x2cef1a,_0x5e3ac4){_0x2cef1a=_0x2cef1a-0x0;var _0x360818=_0x43c2[_0x2cef1a];return _0x360818;};'use strict';var _=require(_0x243c('0x0'));var util=require(_0x243c('0x1'));var logger=require(_0x243c('0x2'))(_0x243c('0x3'));var moment=require(_0x243c('0x4'));var BPromise=require('bluebird');var rp=require(_0x243c('0x5'));var fs=require('fs');var path=require(_0x243c('0x6'));var rimraf=require(_0x243c('0x7'));var config=require(_0x243c('0x8'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0x243c('0x9')]=function(_0x9a0e9a,_0x1164e2){return _0x9a0e9a[_0x243c('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0x243c('0xb'),'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 b04bd02..2ecdfc8 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 _0x0be1=['code','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x8a917c,_0x19c5f6){var _0x2c704e=function(_0x342f3a){while(--_0x342f3a){_0x8a917c['push'](_0x8a917c['shift']());}};_0x2c704e(++_0x19c5f6);}(_0x0be1,0x139));var _0x10be=function(_0x510b98,_0x4c4cbb){_0x510b98=_0x510b98-0x0;var _0x45e775=_0x0be1[_0x510b98];return _0x45e775;};'use strict';var _=require('lodash');var util=require(_0x10be('0x0'));var moment=require('moment');var BPromise=require(_0x10be('0x1'));var rs=require(_0x10be('0x2'));var fs=require('fs');var Redis=require(_0x10be('0x3'));var db=require(_0x10be('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x10be('0x5'))(_0x10be('0x6'));var config=require(_0x10be('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x10be('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x262fba,_0x49da3e,_0x5634bd){return new BPromise(function(_0xa6c2db,_0x5849a5){return client[_0x10be('0x9')](_0x262fba,_0x5634bd)[_0x10be('0xa')](function(_0x3d196a){logger[_0x10be('0xb')](_0x10be('0xc'),_0x49da3e,_0x10be('0xd'));logger[_0x10be('0xe')](_0x10be('0xf'),_0x49da3e,_0x10be('0xd'),JSON[_0x10be('0x10')](_0x3d196a));if(_0x3d196a['error']){if(_0x3d196a['error'][_0x10be('0x11')]===0x1f4){logger['error'](_0x10be('0xc'),_0x49da3e,_0x3d196a[_0x10be('0x12')][_0x10be('0x13')]);return _0x5849a5(_0x3d196a[_0x10be('0x12')][_0x10be('0x13')]);}logger[_0x10be('0x12')](_0x10be('0xc'),_0x49da3e,_0x3d196a['error'][_0x10be('0x13')]);return _0xa6c2db(_0x3d196a[_0x10be('0x12')][_0x10be('0x13')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x49da3e,_0x10be('0xd'));_0xa6c2db(_0x3d196a[_0x10be('0x14')]['message']);}})[_0x10be('0x15')](function(_0x2d99fa){logger[_0x10be('0x12')](_0x10be('0xc'),_0x49da3e,_0x2d99fa);_0x5849a5(_0x2d99fa);});});} \ No newline at end of file +var _0x61cd=['result','catch','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0x61cd,0x1ba));var _0xd61c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x61cd[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xd61c('0x0'));var moment=require(_0xd61c('0x1'));var BPromise=require('bluebird');var rs=require(_0xd61c('0x2'));var fs=require('fs');var Redis=require(_0xd61c('0x3'));var db=require(_0xd61c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd61c('0x5'));var config=require(_0xd61c('0x6'));var jayson=require(_0xd61c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x268a74,_0x4e0d49,_0x329293){return new BPromise(function(_0x2fb891,_0x1cde8a){return client[_0xd61c('0x8')](_0x268a74,_0x329293)['then'](function(_0x30a499){logger[_0xd61c('0x9')](_0xd61c('0xa'),_0x4e0d49,_0xd61c('0xb'));logger[_0xd61c('0xc')](_0xd61c('0xd'),_0x4e0d49,_0xd61c('0xb'),JSON[_0xd61c('0xe')](_0x30a499));if(_0x30a499['error']){if(_0x30a499[_0xd61c('0xf')][_0xd61c('0x10')]===0x1f4){logger[_0xd61c('0xf')](_0xd61c('0xa'),_0x4e0d49,_0x30a499['error'][_0xd61c('0x11')]);return _0x1cde8a(_0x30a499['error'][_0xd61c('0x11')]);}logger[_0xd61c('0xf')](_0xd61c('0xa'),_0x4e0d49,_0x30a499[_0xd61c('0xf')][_0xd61c('0x11')]);return _0x2fb891(_0x30a499[_0xd61c('0xf')]['message']);}else{logger[_0xd61c('0x9')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4e0d49,'request\x20sent');_0x2fb891(_0x30a499[_0xd61c('0x12')][_0xd61c('0x11')]);}})[_0xd61c('0x13')](function(_0x3bf317){logger[_0xd61c('0xf')](_0xd61c('0xa'),_0x4e0d49,_0x3bf317);_0x1cde8a(_0x3bf317);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index f9d8a4a..f2db9e0 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 _0x7112=['multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete','destroy'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x7112,0xdc));var _0x2711=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7112[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x2711('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2711('0x1'));var express=require(_0x2711('0x2'));var router=express[_0x2711('0x3')]();var fs_extra=require(_0x2711('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2711('0x5'));var config=require(_0x2711('0x6'));var controller=require(_0x2711('0x7'));router[_0x2711('0x8')]('/',auth[_0x2711('0x9')](),controller[_0x2711('0xa')]);router['get'](_0x2711('0xb'),auth[_0x2711('0x9')](),controller['describe']);router[_0x2711('0x8')](_0x2711('0xc'),auth['isAuthenticated'](),controller[_0x2711('0xd')]);router['get'](_0x2711('0xe'),auth[_0x2711('0x9')](),controller[_0x2711('0xf')]);router[_0x2711('0x10')]('/',auth['isAuthenticated'](),controller[_0x2711('0x11')]);router[_0x2711('0x12')](_0x2711('0xc'),auth[_0x2711('0x9')](),controller[_0x2711('0x13')]);router[_0x2711('0x14')]('/:id',auth[_0x2711('0x9')](),controller[_0x2711('0x15')]);module['exports']=router; \ No newline at end of file +var _0x0a35=['post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','index','isAuthenticated','describe','/:id','/:id/questions','getQuestions'];(function(_0x438b92,_0x15bbdd){var _0x522dad=function(_0x52baa1){while(--_0x52baa1){_0x438b92['push'](_0x438b92['shift']());}};_0x522dad(++_0x15bbdd);}(_0x0a35,0x1ab));var _0x50a3=function(_0x54ea7a,_0x19df9b){_0x54ea7a=_0x54ea7a-0x0;var _0x65a10d=_0x0a35[_0x54ea7a];return _0x65a10d;};'use strict';var multer=require(_0x50a3('0x0'));var util=require(_0x50a3('0x1'));var path=require('path');var timeout=require(_0x50a3('0x2'));var express=require(_0x50a3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x50a3('0x4'));var config=require(_0x50a3('0x5'));var controller=require(_0x50a3('0x6'));router[_0x50a3('0x7')]('/',auth['isAuthenticated'](),controller[_0x50a3('0x8')]);router[_0x50a3('0x7')]('/describe',auth[_0x50a3('0x9')](),controller[_0x50a3('0xa')]);router[_0x50a3('0x7')](_0x50a3('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x50a3('0xc'),auth[_0x50a3('0x9')](),controller[_0x50a3('0xd')]);router[_0x50a3('0xe')]('/',auth[_0x50a3('0x9')](),controller[_0x50a3('0xf')]);router[_0x50a3('0x10')]('/:id',auth[_0x50a3('0x9')](),controller[_0x50a3('0x11')]);router[_0x50a3('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x50a3('0x13')]);module[_0x50a3('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 fea4e90..677703e 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 _0x9136=['sequelize','exports','DATE','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN'];(function(_0x47f4c2,_0x134e7b){var _0x22c63e=function(_0x5b8572){while(--_0x5b8572){_0x47f4c2['push'](_0x47f4c2['shift']());}};_0x22c63e(++_0x134e7b);}(_0x9136,0x138));var _0x6913=function(_0x5c7d50,_0x142570){_0x5c7d50=_0x5c7d50-0x0;var _0x803884=_0x9136[_0x5c7d50];return _0x803884;};'use strict';var moment=require('moment');var Sequelize=require(_0x6913('0x0'));module[_0x6913('0x1')]={'starttime':{'type':Sequelize[_0x6913('0x2')],'set':function(_0x381faa){this[_0x6913('0x3')]('starttime',_0x381faa);this[_0x6913('0x3')](_0x6913('0x4'),moment()['format'](_0x6913('0x5')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x6913('0x6')]},'projectname':{'type':Sequelize[_0x6913('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x6913('0x6')]},'calleridname':{'type':Sequelize[_0x6913('0x6')]},'calleridnum':{'type':Sequelize[_0x6913('0x6')]},'completed':{'type':Sequelize[_0x6913('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x2c24=['endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','DATE','setDataValue','starttime'];(function(_0x588639,_0x266b61){var _0x692bea=function(_0x46db86){while(--_0x46db86){_0x588639['push'](_0x588639['shift']());}};_0x692bea(++_0x266b61);}(_0x2c24,0x190));var _0x42c2=function(_0x4efe95,_0x15caee){_0x4efe95=_0x4efe95-0x0;var _0xcbc576=_0x2c24[_0x4efe95];return _0xcbc576;};'use strict';var moment=require(_0x42c2('0x0'));var Sequelize=require(_0x42c2('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x42c2('0x2')],'set':function(_0x3d7d21){this[_0x42c2('0x3')](_0x42c2('0x4'),_0x3d7d21);this['setDataValue'](_0x42c2('0x5'),moment()['format'](_0x42c2('0x6')));}},'endtime':{'type':Sequelize[_0x42c2('0x2')]},'membername':{'type':Sequelize[_0x42c2('0x7')]},'projectname':{'type':Sequelize[_0x42c2('0x7')]},'queue':{'type':Sequelize[_0x42c2('0x7')]},'uniqueid':{'type':Sequelize[_0x42c2('0x7')]},'calleridname':{'type':Sequelize[_0x42c2('0x7')]},'calleridnum':{'type':Sequelize[_0x42c2('0x7')]},'completed':{'type':Sequelize[_0x42c2('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 118dc64..46949e3 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 _0x0f45=['merge','options','includeAll','findAll','rows','catch','show','params','include','create','body','destroy','describe','getQuestions','findOne','pick','SessionId','JscriptyQuestionReport','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','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','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','VIRTUAL'];(function(_0x64e2ec,_0x14692d){var _0x28f791=function(_0x3aff1c){while(--_0x3aff1c){_0x64e2ec['push'](_0x64e2ec['shift']());}};_0x28f791(++_0x14692d);}(_0x0f45,0x1a7));var _0x50f4=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x0f45[_0x11ce46];return _0x368a1e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x50f4('0x0'));var jsonpatch=require(_0x50f4('0x1'));var rp=require(_0x50f4('0x2'));var moment=require(_0x50f4('0x3'));var BPromise=require(_0x50f4('0x4'));var Mustache=require(_0x50f4('0x5'));var util=require('util');var path=require(_0x50f4('0x6'));var sox=require(_0x50f4('0x7'));var csv=require(_0x50f4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x50f4('0x9'));var _=require(_0x50f4('0xa'));var squel=require(_0x50f4('0xb'));var crypto=require(_0x50f4('0xc'));var jsforce=require(_0x50f4('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x50f4('0xe'));var Redis=require(_0x50f4('0xf'));var authService=require(_0x50f4('0x10'));var qs=require(_0x50f4('0x11'));var as=require(_0x50f4('0x12'));var hardwareService=require(_0x50f4('0x13'));var logger=require(_0x50f4('0x14'))(_0x50f4('0x15'));var utils=require('../../config/utils');var config=require(_0x50f4('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x68d315,_0x585ada){_0x585ada=_0x585ada||0xcc;return function(_0x21ec33){if(_0x21ec33){return _0x68d315[_0x50f4('0x17')](_0x585ada);}return _0x68d315[_0x50f4('0x18')](_0x585ada)[_0x50f4('0x19')]();};}function respondWithResult(_0x348f0a,_0x3ba3bd){_0x3ba3bd=_0x3ba3bd||0xc8;return function(_0x1b7b02){if(_0x1b7b02){return _0x348f0a[_0x50f4('0x18')](_0x3ba3bd)[_0x50f4('0x1a')](_0x1b7b02);}};}function respondWithFilteredResult(_0x36b44f,_0x46156b){return function(_0x4dfd0b){if(_0x4dfd0b){var _0x24a10c=typeof _0x46156b[_0x50f4('0x1b')]===_0x50f4('0x1c')&&typeof _0x46156b['limit']===_0x50f4('0x1c');var _0x989f7=_0x4dfd0b[_0x50f4('0x1d')];var _0x5dab71=_0x24a10c?0x0:_0x46156b['offset'];var _0x2e73e1=_0x24a10c?_0x4dfd0b[_0x50f4('0x1d')]:_0x46156b['offset']+_0x46156b['limit'];var _0x26b9d2;if(_0x2e73e1>=_0x989f7){_0x2e73e1=_0x989f7;_0x26b9d2=0xc8;}else{_0x26b9d2=0xce;}_0x36b44f['status'](_0x26b9d2);return _0x36b44f[_0x50f4('0x1e')](_0x50f4('0x1f'),_0x5dab71+'-'+_0x2e73e1+'/'+_0x989f7)['json'](_0x4dfd0b);}return null;};}function patchUpdates(_0x3685ad){return function(_0x4dfaaf){try{jsonpatch[_0x50f4('0x20')](_0x4dfaaf,_0x3685ad,!![]);}catch(_0x51d772){return BPromise[_0x50f4('0x21')](_0x51d772);}return _0x4dfaaf[_0x50f4('0x22')]();};}function saveUpdates(_0x301480,_0x5c4a52){return function(_0x4fafb3){if(_0x4fafb3){return _0x4fafb3[_0x50f4('0x23')](_0x301480)[_0x50f4('0x24')](function(_0x150ce4){return _0x150ce4;});}return null;};}function removeEntity(_0xba347b,_0x24ffd9){return function(_0x2c69bd){if(_0x2c69bd){return _0x2c69bd['destroy']()[_0x50f4('0x24')](function(){_0xba347b['status'](0xcc)[_0x50f4('0x19')]();});}};}function handleEntityNotFound(_0x2c411b,_0x2b37a4){return function(_0x4265c2){if(!_0x4265c2){_0x2c411b[_0x50f4('0x17')](0x194);}return _0x4265c2;};}function handleError(_0x3d3ff9,_0x1f99b5){_0x1f99b5=_0x1f99b5||0x1f4;return function(_0x32b524){logger[_0x50f4('0x25')](_0x32b524[_0x50f4('0x26')]);if(_0x32b524[_0x50f4('0x27')]){delete _0x32b524[_0x50f4('0x27')];}_0x3d3ff9[_0x50f4('0x18')](_0x1f99b5)['send'](_0x32b524);};}exports[_0x50f4('0x28')]=function(_0x336e6b,_0x52622f){var _0x1b5d49={},_0x179259={},_0x4b6297={'count':0x0,'rows':[]};var _0x296b22=_[_0x50f4('0x29')](db[_0x50f4('0x2a')][_0x50f4('0x2b')],function(_0x4564c1){return{'name':_0x4564c1[_0x50f4('0x2c')],'type':_0x4564c1[_0x50f4('0x2d')][_0x50f4('0x2e')]};});_0x179259['model']=_[_0x50f4('0x29')](_0x296b22,_0x50f4('0x27'));_0x179259['query']=_[_0x50f4('0x2f')](_0x336e6b[_0x50f4('0x30')]);_0x179259[_0x50f4('0x31')]=_['intersection'](_0x179259[_0x50f4('0x32')],_0x179259[_0x50f4('0x30')]);_0x1b5d49[_0x50f4('0x33')]=_[_0x50f4('0x34')](_0x179259[_0x50f4('0x32')],qs[_0x50f4('0x35')](_0x336e6b[_0x50f4('0x30')][_0x50f4('0x35')]));_0x1b5d49[_0x50f4('0x33')]=_0x1b5d49[_0x50f4('0x33')][_0x50f4('0x36')]?_0x1b5d49[_0x50f4('0x33')]:_0x179259[_0x50f4('0x32')];if(!_0x336e6b[_0x50f4('0x30')][_0x50f4('0x37')](_0x50f4('0x38'))){_0x1b5d49[_0x50f4('0x39')]=qs['limit'](_0x336e6b[_0x50f4('0x30')][_0x50f4('0x39')]);_0x1b5d49[_0x50f4('0x1b')]=qs[_0x50f4('0x1b')](_0x336e6b[_0x50f4('0x30')][_0x50f4('0x1b')]);}_0x1b5d49[_0x50f4('0x3a')]=qs[_0x50f4('0x3b')](_0x336e6b[_0x50f4('0x30')][_0x50f4('0x3b')]);_0x1b5d49['where']=qs[_0x50f4('0x31')](_['pick'](_0x336e6b['query'],_0x179259[_0x50f4('0x31')]),_0x296b22);if(_0x336e6b[_0x50f4('0x30')][_0x50f4('0x3c')]){_0x1b5d49[_0x50f4('0x3d')]=_['merge'](_0x1b5d49[_0x50f4('0x3d')],{'$or':_['map'](_0x296b22,function(_0x35ce91){if(_0x35ce91[_0x50f4('0x2d')]!==_0x50f4('0x3e')){var _0x45bb2f={};_0x45bb2f[_0x35ce91[_0x50f4('0x27')]]={'$like':'%'+_0x336e6b[_0x50f4('0x30')][_0x50f4('0x3c')]+'%'};return _0x45bb2f;}})});}_0x1b5d49=_[_0x50f4('0x3f')]({},_0x1b5d49,_0x336e6b[_0x50f4('0x40')]);var _0x535261={'where':_0x1b5d49[_0x50f4('0x3d')]};return db[_0x50f4('0x2a')][_0x50f4('0x1d')](_0x535261)[_0x50f4('0x24')](function(_0x76a142){_0x4b6297['count']=_0x76a142;if(_0x336e6b[_0x50f4('0x30')][_0x50f4('0x41')]){_0x1b5d49['include']=[{'all':!![]}];}return db[_0x50f4('0x2a')][_0x50f4('0x42')](_0x1b5d49);})[_0x50f4('0x24')](function(_0x35bdf4){_0x4b6297[_0x50f4('0x43')]=_0x35bdf4;return _0x4b6297;})['then'](respondWithFilteredResult(_0x52622f,_0x1b5d49))[_0x50f4('0x44')](handleError(_0x52622f,null));};exports[_0x50f4('0x45')]=function(_0x9e6106,_0x294e3d){var _0x11eb99={'raw':!![],'where':{'id':_0x9e6106[_0x50f4('0x46')]['id']}},_0x49ac36={};_0x49ac36[_0x50f4('0x32')]=_[_0x50f4('0x2f')](db[_0x50f4('0x2a')][_0x50f4('0x2b')]);_0x49ac36[_0x50f4('0x30')]=_[_0x50f4('0x2f')](_0x9e6106[_0x50f4('0x30')]);_0x49ac36[_0x50f4('0x31')]=_[_0x50f4('0x34')](_0x49ac36[_0x50f4('0x32')],_0x49ac36[_0x50f4('0x30')]);_0x11eb99[_0x50f4('0x33')]=_[_0x50f4('0x34')](_0x49ac36['model'],qs['fields'](_0x9e6106['query'][_0x50f4('0x35')]));_0x11eb99[_0x50f4('0x33')]=_0x11eb99[_0x50f4('0x33')][_0x50f4('0x36')]?_0x11eb99[_0x50f4('0x33')]:_0x49ac36[_0x50f4('0x32')];if(_0x9e6106[_0x50f4('0x30')][_0x50f4('0x41')]){_0x11eb99[_0x50f4('0x47')]=[{'all':!![]}];}_0x11eb99=_[_0x50f4('0x3f')]({},_0x11eb99,_0x9e6106['options']);return db[_0x50f4('0x2a')]['find'](_0x11eb99)[_0x50f4('0x24')](handleEntityNotFound(_0x294e3d,null))[_0x50f4('0x24')](respondWithResult(_0x294e3d,null))[_0x50f4('0x44')](handleError(_0x294e3d,null));};exports[_0x50f4('0x48')]=function(_0x363b23,_0x34bfa3){return db['JscriptySessionReport'][_0x50f4('0x48')](_0x363b23['body'],{})[_0x50f4('0x24')](respondWithResult(_0x34bfa3,0xc9))['catch'](handleError(_0x34bfa3,null));};exports[_0x50f4('0x23')]=function(_0x3bf1bd,_0x53f4fc){if(_0x3bf1bd[_0x50f4('0x49')]['id']){delete _0x3bf1bd[_0x50f4('0x49')]['id'];}return db[_0x50f4('0x2a')]['find']({'where':{'id':_0x3bf1bd[_0x50f4('0x46')]['id']}})[_0x50f4('0x24')](handleEntityNotFound(_0x53f4fc,null))['then'](saveUpdates(_0x3bf1bd[_0x50f4('0x49')],null))[_0x50f4('0x24')](respondWithResult(_0x53f4fc,null))[_0x50f4('0x44')](handleError(_0x53f4fc,null));};exports[_0x50f4('0x4a')]=function(_0x5ea305,_0x370c61){return db[_0x50f4('0x2a')]['find']({'where':{'id':_0x5ea305[_0x50f4('0x46')]['id']}})[_0x50f4('0x24')](handleEntityNotFound(_0x370c61,null))[_0x50f4('0x24')](removeEntity(_0x370c61,null))[_0x50f4('0x44')](handleError(_0x370c61,null));};exports[_0x50f4('0x4b')]=function(_0x1fb54d,_0x4c81f6){return db[_0x50f4('0x2a')][_0x50f4('0x4b')]()[_0x50f4('0x24')](respondWithResult(_0x4c81f6,null))['catch'](handleError(_0x4c81f6,null));};exports[_0x50f4('0x4c')]=function(_0x424c59,_0x377f7c,_0x32cb17){var _0x5b444b={'raw':!![],'where':{}};var _0x49f3dd={};var _0x2b05ca={'count':0x0,'rows':[]};return db[_0x50f4('0x2a')][_0x50f4('0x4d')]({'where':{'id':_0x424c59['params']['id']}})[_0x50f4('0x24')](handleEntityNotFound(_0x377f7c,null))[_0x50f4('0x24')](function(_0x1e5265){if(_0x1e5265){_0x49f3dd['model']=_[_0x50f4('0x2f')](db['JscriptyQuestionReport']['rawAttributes']);_0x49f3dd[_0x50f4('0x30')]=_[_0x50f4('0x2f')](_0x424c59['query']);_0x49f3dd[_0x50f4('0x31')]=_['intersection'](_0x49f3dd[_0x50f4('0x32')],_0x49f3dd[_0x50f4('0x30')]);_0x5b444b[_0x50f4('0x33')]=_[_0x50f4('0x34')](_0x49f3dd['model'],qs['fields'](_0x424c59[_0x50f4('0x30')][_0x50f4('0x35')]));_0x5b444b[_0x50f4('0x33')]=_0x5b444b[_0x50f4('0x33')][_0x50f4('0x36')]?_0x5b444b['attributes']:_0x49f3dd['model'];if(!_0x424c59['query']['hasOwnProperty']('nolimit')){_0x5b444b[_0x50f4('0x39')]=qs[_0x50f4('0x39')](_0x424c59[_0x50f4('0x30')]['limit']);_0x5b444b['offset']=qs[_0x50f4('0x1b')](_0x424c59[_0x50f4('0x30')][_0x50f4('0x1b')]);}_0x5b444b[_0x50f4('0x3a')]=qs[_0x50f4('0x3b')](_0x424c59[_0x50f4('0x30')][_0x50f4('0x3b')]);_0x5b444b[_0x50f4('0x3d')]=qs['filters'](_[_0x50f4('0x4e')](_0x424c59[_0x50f4('0x30')],_0x49f3dd[_0x50f4('0x31')]));_0x5b444b[_0x50f4('0x3d')][_0x50f4('0x4f')]=_0x1e5265['id'];if(_0x424c59[_0x50f4('0x30')][_0x50f4('0x3c')]){_0x5b444b[_0x50f4('0x3d')]=_[_0x50f4('0x3f')](_0x5b444b['where'],{'$or':_[_0x50f4('0x29')](_0x5b444b['attributes'],function(_0x2aae2f){var _0x278b9c={};_0x278b9c[_0x2aae2f]={'$like':'%'+_0x424c59[_0x50f4('0x30')][_0x50f4('0x3c')]+'%'};return _0x278b9c;})});}_0x5b444b=_[_0x50f4('0x3f')]({},_0x5b444b,_0x424c59[_0x50f4('0x40')]);return db[_0x50f4('0x50')][_0x50f4('0x1d')]({'where':_0x5b444b[_0x50f4('0x3d')]})[_0x50f4('0x24')](function(_0x385837){_0x2b05ca['count']=_0x385837;if(_0x424c59[_0x50f4('0x30')]['includeAll']){_0x5b444b['include']=[{'all':!![]}];}return db[_0x50f4('0x50')][_0x50f4('0x42')](_0x5b444b);})[_0x50f4('0x24')](function(_0x2ccd33){_0x2b05ca[_0x50f4('0x43')]=_0x2ccd33;return _0x2b05ca;});}})[_0x50f4('0x24')](respondWithFilteredResult(_0x377f7c,_0x5b444b))[_0x50f4('0x44')](handleError(_0x377f7c,null));}; \ No newline at end of file +var _0x87bb=['nolimit','limit','sort','pick','filter','where','merge','map','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','create','body','find','destroy','describe','JscriptyQuestionReport','hasOwnProperty','order','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','offset','undefined','count','set','Content-Range','json','apply','reject','update','then','end','sendStatus','error','stack','name','send','index','JscriptySessionReport','rawAttributes','fieldName','type','model','keys','filters','intersection','attributes','fields','length','query'];(function(_0xe4e1d,_0x50a9ff){var _0x5e35f3=function(_0x17112f){while(--_0x17112f){_0xe4e1d['push'](_0xe4e1d['shift']());}};_0x5e35f3(++_0x50a9ff);}(_0x87bb,0x107));var _0xb87b=function(_0x154a40,_0x26dd2e){_0x154a40=_0x154a40-0x0;var _0x7e98d3=_0x87bb[_0x154a40];return _0x7e98d3;};'use strict';var emlformat=require(_0xb87b('0x0'));var rimraf=require(_0xb87b('0x1'));var zipdir=require(_0xb87b('0x2'));var jsonpatch=require(_0xb87b('0x3'));var rp=require('request-promise');var moment=require(_0xb87b('0x4'));var BPromise=require(_0xb87b('0x5'));var Mustache=require('mustache');var util=require(_0xb87b('0x6'));var path=require(_0xb87b('0x7'));var sox=require('sox');var csv=require(_0xb87b('0x8'));var ejs=require(_0xb87b('0x9'));var fs=require('fs');var fs_extra=require(_0xb87b('0xa'));var _=require(_0xb87b('0xb'));var squel=require(_0xb87b('0xc'));var crypto=require(_0xb87b('0xd'));var jsforce=require(_0xb87b('0xe'));var deskjs=require(_0xb87b('0xf'));var toCsv=require(_0xb87b('0x8'));var querystring=require(_0xb87b('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb87b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb87b('0x12'));var logger=require(_0xb87b('0x13'))(_0xb87b('0x14'));var utils=require('../../config/utils');var config=require(_0xb87b('0x15'));var licenseUtil=require(_0xb87b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13906c,_0x3a7934){_0x3a7934=_0x3a7934||0xcc;return function(_0x452f0e){if(_0x452f0e){return _0x13906c['sendStatus'](_0x3a7934);}return _0x13906c[_0xb87b('0x17')](_0x3a7934)['end']();};}function respondWithResult(_0x1a9768,_0x3cff8f){_0x3cff8f=_0x3cff8f||0xc8;return function(_0x49669c){if(_0x49669c){return _0x1a9768[_0xb87b('0x17')](_0x3cff8f)['json'](_0x49669c);}};}function respondWithFilteredResult(_0x12ae30,_0x16950f){return function(_0x19a3f2){if(_0x19a3f2){var _0x48d6b9=typeof _0x16950f[_0xb87b('0x18')]===_0xb87b('0x19')&&typeof _0x16950f['limit']==='undefined';var _0x16fd78=_0x19a3f2[_0xb87b('0x1a')];var _0x539e60=_0x48d6b9?0x0:_0x16950f[_0xb87b('0x18')];var _0x34b1cd=_0x48d6b9?_0x19a3f2[_0xb87b('0x1a')]:_0x16950f[_0xb87b('0x18')]+_0x16950f['limit'];var _0x317a65;if(_0x34b1cd>=_0x16fd78){_0x34b1cd=_0x16fd78;_0x317a65=0xc8;}else{_0x317a65=0xce;}_0x12ae30[_0xb87b('0x17')](_0x317a65);return _0x12ae30[_0xb87b('0x1b')](_0xb87b('0x1c'),_0x539e60+'-'+_0x34b1cd+'/'+_0x16fd78)[_0xb87b('0x1d')](_0x19a3f2);}return null;};}function patchUpdates(_0x47eeba){return function(_0x33c812){try{jsonpatch[_0xb87b('0x1e')](_0x33c812,_0x47eeba,!![]);}catch(_0x1e126e){return BPromise[_0xb87b('0x1f')](_0x1e126e);}return _0x33c812['save']();};}function saveUpdates(_0x556976,_0x7d2ad0){return function(_0x55423e){if(_0x55423e){return _0x55423e[_0xb87b('0x20')](_0x556976)[_0xb87b('0x21')](function(_0x4864b9){return _0x4864b9;});}return null;};}function removeEntity(_0x14ce94,_0x3fde30){return function(_0x5b3527){if(_0x5b3527){return _0x5b3527['destroy']()[_0xb87b('0x21')](function(){_0x14ce94[_0xb87b('0x17')](0xcc)[_0xb87b('0x22')]();});}};}function handleEntityNotFound(_0x1a5fba,_0x3875a5){return function(_0xf8265f){if(!_0xf8265f){_0x1a5fba[_0xb87b('0x23')](0x194);}return _0xf8265f;};}function handleError(_0x1ea5ce,_0x55e720){_0x55e720=_0x55e720||0x1f4;return function(_0x511823){logger[_0xb87b('0x24')](_0x511823[_0xb87b('0x25')]);if(_0x511823[_0xb87b('0x26')]){delete _0x511823[_0xb87b('0x26')];}_0x1ea5ce[_0xb87b('0x17')](_0x55e720)[_0xb87b('0x27')](_0x511823);};}exports[_0xb87b('0x28')]=function(_0x36b4c0,_0x2e8834){var _0x39230a={},_0x46de62={},_0x32838d={'count':0x0,'rows':[]};var _0x55dead=_['map'](db[_0xb87b('0x29')][_0xb87b('0x2a')],function(_0x1185a3){return{'name':_0x1185a3[_0xb87b('0x2b')],'type':_0x1185a3[_0xb87b('0x2c')]['key']};});_0x46de62[_0xb87b('0x2d')]=_['map'](_0x55dead,_0xb87b('0x26'));_0x46de62['query']=_[_0xb87b('0x2e')](_0x36b4c0['query']);_0x46de62[_0xb87b('0x2f')]=_[_0xb87b('0x30')](_0x46de62['model'],_0x46de62['query']);_0x39230a[_0xb87b('0x31')]=_[_0xb87b('0x30')](_0x46de62[_0xb87b('0x2d')],qs[_0xb87b('0x32')](_0x36b4c0['query']['fields']));_0x39230a[_0xb87b('0x31')]=_0x39230a[_0xb87b('0x31')][_0xb87b('0x33')]?_0x39230a['attributes']:_0x46de62['model'];if(!_0x36b4c0[_0xb87b('0x34')]['hasOwnProperty'](_0xb87b('0x35'))){_0x39230a['limit']=qs[_0xb87b('0x36')](_0x36b4c0[_0xb87b('0x34')]['limit']);_0x39230a['offset']=qs['offset'](_0x36b4c0[_0xb87b('0x34')]['offset']);}_0x39230a['order']=qs['sort'](_0x36b4c0[_0xb87b('0x34')][_0xb87b('0x37')]);_0x39230a['where']=qs[_0xb87b('0x2f')](_[_0xb87b('0x38')](_0x36b4c0[_0xb87b('0x34')],_0x46de62[_0xb87b('0x2f')]),_0x55dead);if(_0x36b4c0[_0xb87b('0x34')][_0xb87b('0x39')]){_0x39230a[_0xb87b('0x3a')]=_[_0xb87b('0x3b')](_0x39230a['where'],{'$or':_[_0xb87b('0x3c')](_0x55dead,function(_0xfd1060){if(_0xfd1060[_0xb87b('0x2c')]!==_0xb87b('0x3d')){var _0x2bb141={};_0x2bb141[_0xfd1060[_0xb87b('0x26')]]={'$like':'%'+_0x36b4c0[_0xb87b('0x34')][_0xb87b('0x39')]+'%'};return _0x2bb141;}})});}_0x39230a=_[_0xb87b('0x3b')]({},_0x39230a,_0x36b4c0['options']);var _0x617c6={'where':_0x39230a[_0xb87b('0x3a')]};return db['JscriptySessionReport'][_0xb87b('0x1a')](_0x617c6)[_0xb87b('0x21')](function(_0x38980e){_0x32838d[_0xb87b('0x1a')]=_0x38980e;if(_0x36b4c0[_0xb87b('0x34')][_0xb87b('0x3e')]){_0x39230a['include']=[{'all':!![]}];}return db[_0xb87b('0x29')][_0xb87b('0x3f')](_0x39230a);})['then'](function(_0x1afdad){_0x32838d[_0xb87b('0x40')]=_0x1afdad;return _0x32838d;})[_0xb87b('0x21')](respondWithFilteredResult(_0x2e8834,_0x39230a))[_0xb87b('0x41')](handleError(_0x2e8834,null));};exports[_0xb87b('0x42')]=function(_0x1bb1eb,_0x5fae14){var _0x249cd8={'raw':!![],'where':{'id':_0x1bb1eb[_0xb87b('0x43')]['id']}},_0x5b9586={};_0x5b9586[_0xb87b('0x2d')]=_[_0xb87b('0x2e')](db[_0xb87b('0x29')][_0xb87b('0x2a')]);_0x5b9586['query']=_[_0xb87b('0x2e')](_0x1bb1eb[_0xb87b('0x34')]);_0x5b9586['filters']=_[_0xb87b('0x30')](_0x5b9586[_0xb87b('0x2d')],_0x5b9586[_0xb87b('0x34')]);_0x249cd8[_0xb87b('0x31')]=_['intersection'](_0x5b9586[_0xb87b('0x2d')],qs[_0xb87b('0x32')](_0x1bb1eb[_0xb87b('0x34')][_0xb87b('0x32')]));_0x249cd8[_0xb87b('0x31')]=_0x249cd8[_0xb87b('0x31')][_0xb87b('0x33')]?_0x249cd8['attributes']:_0x5b9586[_0xb87b('0x2d')];if(_0x1bb1eb[_0xb87b('0x34')][_0xb87b('0x3e')]){_0x249cd8[_0xb87b('0x44')]=[{'all':!![]}];}_0x249cd8=_[_0xb87b('0x3b')]({},_0x249cd8,_0x1bb1eb[_0xb87b('0x45')]);return db[_0xb87b('0x29')]['find'](_0x249cd8)[_0xb87b('0x21')](handleEntityNotFound(_0x5fae14,null))[_0xb87b('0x21')](respondWithResult(_0x5fae14,null))[_0xb87b('0x41')](handleError(_0x5fae14,null));};exports[_0xb87b('0x46')]=function(_0x1f0a91,_0x5dfa41){return db[_0xb87b('0x29')][_0xb87b('0x46')](_0x1f0a91['body'],{})[_0xb87b('0x21')](respondWithResult(_0x5dfa41,0xc9))[_0xb87b('0x41')](handleError(_0x5dfa41,null));};exports[_0xb87b('0x20')]=function(_0x3192f6,_0x4b3e7d){if(_0x3192f6[_0xb87b('0x47')]['id']){delete _0x3192f6[_0xb87b('0x47')]['id'];}return db[_0xb87b('0x29')][_0xb87b('0x48')]({'where':{'id':_0x3192f6[_0xb87b('0x43')]['id']}})['then'](handleEntityNotFound(_0x4b3e7d,null))[_0xb87b('0x21')](saveUpdates(_0x3192f6[_0xb87b('0x47')],null))[_0xb87b('0x21')](respondWithResult(_0x4b3e7d,null))['catch'](handleError(_0x4b3e7d,null));};exports[_0xb87b('0x49')]=function(_0x5bc792,_0x518921){return db[_0xb87b('0x29')][_0xb87b('0x48')]({'where':{'id':_0x5bc792['params']['id']}})[_0xb87b('0x21')](handleEntityNotFound(_0x518921,null))['then'](removeEntity(_0x518921,null))['catch'](handleError(_0x518921,null));};exports[_0xb87b('0x4a')]=function(_0x4d18c6,_0x953282){return db[_0xb87b('0x29')][_0xb87b('0x4a')]()[_0xb87b('0x21')](respondWithResult(_0x953282,null))['catch'](handleError(_0x953282,null));};exports['getQuestions']=function(_0x45ab88,_0x14b161,_0x307b4d){var _0xe2f2b3={'raw':!![],'where':{}};var _0x5abf7b={};var _0x22302a={'count':0x0,'rows':[]};return db[_0xb87b('0x29')]['findOne']({'where':{'id':_0x45ab88[_0xb87b('0x43')]['id']}})['then'](handleEntityNotFound(_0x14b161,null))[_0xb87b('0x21')](function(_0x4a9657){if(_0x4a9657){_0x5abf7b[_0xb87b('0x2d')]=_[_0xb87b('0x2e')](db[_0xb87b('0x4b')][_0xb87b('0x2a')]);_0x5abf7b[_0xb87b('0x34')]=_[_0xb87b('0x2e')](_0x45ab88[_0xb87b('0x34')]);_0x5abf7b[_0xb87b('0x2f')]=_['intersection'](_0x5abf7b[_0xb87b('0x2d')],_0x5abf7b[_0xb87b('0x34')]);_0xe2f2b3['attributes']=_['intersection'](_0x5abf7b['model'],qs[_0xb87b('0x32')](_0x45ab88[_0xb87b('0x34')][_0xb87b('0x32')]));_0xe2f2b3[_0xb87b('0x31')]=_0xe2f2b3[_0xb87b('0x31')]['length']?_0xe2f2b3[_0xb87b('0x31')]:_0x5abf7b['model'];if(!_0x45ab88['query'][_0xb87b('0x4c')](_0xb87b('0x35'))){_0xe2f2b3[_0xb87b('0x36')]=qs['limit'](_0x45ab88[_0xb87b('0x34')][_0xb87b('0x36')]);_0xe2f2b3[_0xb87b('0x18')]=qs['offset'](_0x45ab88['query'][_0xb87b('0x18')]);}_0xe2f2b3[_0xb87b('0x4d')]=qs[_0xb87b('0x37')](_0x45ab88[_0xb87b('0x34')][_0xb87b('0x37')]);_0xe2f2b3['where']=qs[_0xb87b('0x2f')](_['pick'](_0x45ab88[_0xb87b('0x34')],_0x5abf7b['filters']));_0xe2f2b3[_0xb87b('0x3a')][_0xb87b('0x4e')]=_0x4a9657['id'];if(_0x45ab88[_0xb87b('0x34')]['filter']){_0xe2f2b3[_0xb87b('0x3a')]=_[_0xb87b('0x3b')](_0xe2f2b3[_0xb87b('0x3a')],{'$or':_['map'](_0xe2f2b3['attributes'],function(_0x274600){var _0x178521={};_0x178521[_0x274600]={'$like':'%'+_0x45ab88[_0xb87b('0x34')][_0xb87b('0x39')]+'%'};return _0x178521;})});}_0xe2f2b3=_['merge']({},_0xe2f2b3,_0x45ab88[_0xb87b('0x45')]);return db[_0xb87b('0x4b')][_0xb87b('0x1a')]({'where':_0xe2f2b3[_0xb87b('0x3a')]})[_0xb87b('0x21')](function(_0x230bed){_0x22302a['count']=_0x230bed;if(_0x45ab88[_0xb87b('0x34')][_0xb87b('0x3e')]){_0xe2f2b3[_0xb87b('0x44')]=[{'all':!![]}];}return db[_0xb87b('0x4b')][_0xb87b('0x3f')](_0xe2f2b3);})['then'](function(_0x2e2764){_0x22302a[_0xb87b('0x40')]=_0x2e2764;return _0x22302a;});}})[_0xb87b('0x21')](respondWithFilteredResult(_0x14b161,_0xe2f2b3))['catch'](handleError(_0x14b161,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 27db10e..dfe5bf9 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 _0x3831=['define','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./jscriptySessionReport.attributes'];(function(_0x5bf174,_0x52067d){var _0x56c4da=function(_0x449f74){while(--_0x449f74){_0x5bf174['push'](_0x5bf174['shift']());}};_0x56c4da(++_0x52067d);}(_0x3831,0x14c));var _0x1383=function(_0x40f9a0,_0x3458cc){_0x40f9a0=_0x40f9a0-0x0;var _0x3e3144=_0x3831[_0x40f9a0];return _0x3e3144;};'use strict';var _=require(_0x1383('0x0'));var util=require('util');var logger=require(_0x1383('0x1'))(_0x1383('0x2'));var moment=require(_0x1383('0x3'));var BPromise=require(_0x1383('0x4'));var rp=require(_0x1383('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1383('0x6'));var config=require('../../config/environment');var attributes=require(_0x1383('0x7'));module['exports']=function(_0x5b64b1,_0x5eb4d8){return _0x5b64b1[_0x1383('0x8')]('JscriptySessionReport',attributes,{'tableName':_0x1383('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81c6=['JscriptySessionReport','util','bluebird','request-promise','path','../../config/environment','./jscriptySessionReport.attributes','exports','define'];(function(_0x43edcf,_0x21f0fa){var _0x424c24=function(_0xdd83df){while(--_0xdd83df){_0x43edcf['push'](_0x43edcf['shift']());}};_0x424c24(++_0x21f0fa);}(_0x81c6,0x1d5));var _0x681c=function(_0x511b76,_0x4727fa){_0x511b76=_0x511b76-0x0;var _0x5424ff=_0x81c6[_0x511b76];return _0x5424ff;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x681c('0x1'));var rp=require(_0x681c('0x2'));var fs=require('fs');var path=require(_0x681c('0x3'));var rimraf=require('rimraf');var config=require(_0x681c('0x4'));var attributes=require(_0x681c('0x5'));module[_0x681c('0x6')]=function(_0x1d31c8,_0x4ea522){return _0x1d31c8[_0x681c('0x7')](_0x681c('0x8'),attributes,{'tableName':'report_jscripty_sessions','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 087b14a..debc431 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 _0x32b6=['JscriptySessionReport,\x20%s,\x20%s','message','info','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code'];(function(_0x3e9313,_0x59beba){var _0x4e5fa2=function(_0x4b5ae7){while(--_0x4b5ae7){_0x3e9313['push'](_0x3e9313['shift']());}};_0x4e5fa2(++_0x59beba);}(_0x32b6,0x1d1));var _0x632b=function(_0x55ef0c,_0x53f23a){_0x55ef0c=_0x55ef0c-0x0;var _0x14b174=_0x32b6[_0x55ef0c];return _0x14b174;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require('moment');var BPromise=require(_0x632b('0x2'));var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x4'));var logger=require(_0x632b('0x5'))(_0x632b('0x6'));var config=require(_0x632b('0x7'));var jayson=require(_0x632b('0x8'));var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10458a,_0x3bbf43,_0x43d6c7){return new BPromise(function(_0x5128f5,_0x33d711){return client[_0x632b('0xb')](_0x10458a,_0x43d6c7)[_0x632b('0xc')](function(_0x174201){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x3bbf43,'request\x20sent');logger[_0x632b('0xd')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x3bbf43,_0x632b('0xe'),JSON[_0x632b('0xf')](_0x174201));if(_0x174201[_0x632b('0x10')]){if(_0x174201[_0x632b('0x10')][_0x632b('0x11')]===0x1f4){logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201[_0x632b('0x10')][_0x632b('0x13')]);return _0x33d711(_0x174201['error'][_0x632b('0x13')]);}logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201['error'][_0x632b('0x13')]);return _0x5128f5(_0x174201[_0x632b('0x10')][_0x632b('0x13')]);}else{logger[_0x632b('0x14')](_0x632b('0x12'),_0x3bbf43,_0x632b('0xe'));_0x5128f5(_0x174201['result'][_0x632b('0x13')]);}})['catch'](function(_0x4fdef2){logger[_0x632b('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x3bbf43,_0x4fdef2);_0x33d711(_0x4fdef2);});});} \ No newline at end of file +var _0xacf4=['message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xacf4,0xe7));var _0x4acf=function(_0x29d205,_0x4ddfb0){_0x29d205=_0x29d205-0x0;var _0x7794c1=_0xacf4[_0x29d205];return _0x7794c1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acf('0x0'));var BPromise=require(_0x4acf('0x1'));var rs=require(_0x4acf('0x2'));var fs=require('fs');var Redis=require(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var utils=require(_0x4acf('0x5'));var logger=require(_0x4acf('0x6'))('rpc');var config=require(_0x4acf('0x7'));var jayson=require(_0x4acf('0x8'));var client=jayson['client'][_0x4acf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba08a,_0x649ad2,_0x45a5a4){return new BPromise(function(_0x25d345,_0x50f5f4){return client['request'](_0x2ba08a,_0x45a5a4)[_0x4acf('0xa')](function(_0x59f559){logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x649ad2,_0x4acf('0xd'));logger['debug'](_0x4acf('0xe'),_0x649ad2,_0x4acf('0xd'),JSON['stringify'](_0x59f559));if(_0x59f559['error']){if(_0x59f559[_0x4acf('0xf')]['code']===0x1f4){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x50f5f4(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}logger[_0x4acf('0xf')](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x25d345(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}else{logger['info'](_0x4acf('0xc'),_0x649ad2,'request\x20sent');_0x25d345(_0x59f559[_0x4acf('0x11')][_0x4acf('0x10')]);}})[_0x4acf('0x12')](function(_0x5d934a){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x5d934a);_0x50f5f4(_0x5d934a);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index cdb7591..c9459dc 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 _0x848a=['fs-extra','../../components/interaction/service','../../config/environment','./license.controller','index','put','/:id','update','get','/download_log_file','isAuthenticated','exports','multer','util','express','Router'];(function(_0x596ed9,_0x22bb78){var _0x584f5b=function(_0x486516){while(--_0x486516){_0x596ed9['push'](_0x596ed9['shift']());}};_0x584f5b(++_0x22bb78);}(_0x848a,0x18c));var _0xa848=function(_0x343090,_0x433a80){_0x343090=_0x343090-0x0;var _0x3ff3e8=_0x848a[_0x343090];return _0x3ff3e8;};'use strict';var multer=require(_0xa848('0x0'));var util=require(_0xa848('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa848('0x2'));var router=express[_0xa848('0x3')]();var fs_extra=require(_0xa848('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa848('0x5'));var config=require(_0xa848('0x6'));var controller=require(_0xa848('0x7'));router['get']('/',controller[_0xa848('0x8')]);router[_0xa848('0x9')](_0xa848('0xa'),auth['isAuthenticated'](),controller[_0xa848('0xb')]);router[_0xa848('0xc')](_0xa848('0xd'),auth[_0xa848('0xe')](),controller['downloadLogFile']);module[_0xa848('0xf')]=router; \ No newline at end of file +var _0x4f08=['../../components/auth/service','get','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x31e025,_0x2c063e){var _0x75044f=function(_0xe7b48b){while(--_0xe7b48b){_0x31e025['push'](_0x31e025['shift']());}};_0x75044f(++_0x2c063e);}(_0x4f08,0x1bc));var _0x84f0=function(_0x39c047,_0x567fc6){_0x39c047=_0x39c047-0x0;var _0x3713ce=_0x4f08[_0x39c047];return _0x3713ce;};'use strict';var multer=require(_0x84f0('0x0'));var util=require(_0x84f0('0x1'));var path=require('path');var timeout=require(_0x84f0('0x2'));var express=require(_0x84f0('0x3'));var router=express[_0x84f0('0x4')]();var fs_extra=require(_0x84f0('0x5'));var auth=require(_0x84f0('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./license.controller');router[_0x84f0('0x7')]('/',controller['index']);router[_0x84f0('0x8')](_0x84f0('0x9'),auth[_0x84f0('0xa')](),controller[_0x84f0('0xb')]);router[_0x84f0('0x7')](_0x84f0('0xc'),auth['isAuthenticated'](),controller[_0x84f0('0xd')]);module[_0x84f0('0xe')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index f893ed3..8ecbba1 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 _0x290e=['sequelize','exports','TEXT','STRING','INTEGER'];(function(_0x95e7a2,_0x104957){var _0x5b387c=function(_0x225274){while(--_0x225274){_0x95e7a2['push'](_0x95e7a2['shift']());}};_0x5b387c(++_0x104957);}(_0x290e,0x82));var _0xe290=function(_0x424d75,_0x135168){_0x424d75=_0x424d75-0x0;var _0x3f1ecb=_0x290e[_0x424d75];return _0x3f1ecb;};'use strict';var Sequelize=require(_0xe290('0x0'));module[_0xe290('0x1')]={'license':{'type':Sequelize[_0xe290('0x2')]},'data1':{'type':Sequelize[_0xe290('0x3')]},'data2':{'type':Sequelize[_0xe290('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xe290('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x837d=['INTEGER','sequelize','exports','STRING'];(function(_0x51f1c7,_0x2f527f){var _0x4c51a5=function(_0x539ad1){while(--_0x539ad1){_0x51f1c7['push'](_0x51f1c7['shift']());}};_0x4c51a5(++_0x2f527f);}(_0x837d,0x165));var _0xd837=function(_0x563881,_0x5dacec){_0x563881=_0x563881-0x0;var _0xd565b2=_0x837d[_0x563881];return _0xd565b2;};'use strict';var Sequelize=require(_0xd837('0x0'));module[_0xd837('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xd837('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xd837('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 4e5c0c2..8864061 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 _0xdc52=['status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','model','keys','rawAttributes','query','intersection','fields','attributes','length','merge','getLicense','catch','body','License','find','get','checkLicense','key','license-info.log','join','/var','log','xcally','setHeader','Content-Type','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5ec501,_0x2c2b66){var _0x54a0ce=function(_0x4a3bd6){while(--_0x4a3bd6){_0x5ec501['push'](_0x5ec501['shift']());}};_0x54a0ce(++_0x2c2b66);}(_0xdc52,0x1bd));var _0x2dc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc52[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2dc5('0x0'));var rimraf=require(_0x2dc5('0x1'));var zipdir=require(_0x2dc5('0x2'));var jsonpatch=require(_0x2dc5('0x3'));var rp=require(_0x2dc5('0x4'));var moment=require(_0x2dc5('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2dc5('0x6'));var path=require('path');var sox=require(_0x2dc5('0x7'));var csv=require('to-csv');var ejs=require(_0x2dc5('0x8'));var fs=require('fs');var fs_extra=require(_0x2dc5('0x9'));var _=require('lodash');var squel=require(_0x2dc5('0xa'));var crypto=require('crypto');var jsforce=require(_0x2dc5('0xb'));var deskjs=require(_0x2dc5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2dc5('0xd'));var Papa=require(_0x2dc5('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2dc5('0xf'));var as=require(_0x2dc5('0x10'));var hardwareService=require(_0x2dc5('0x11'));var logger=require('../../config/logger')(_0x2dc5('0x12'));var utils=require(_0x2dc5('0x13'));var config=require(_0x2dc5('0x14'));var licenseUtil=require(_0x2dc5('0x15'));var db=require(_0x2dc5('0x16'))['db'];function respondWithStatusCode(_0x27ab7f,_0x5ddf7d){_0x5ddf7d=_0x5ddf7d||0xcc;return function(_0x10d57f){if(_0x10d57f){return _0x27ab7f[_0x2dc5('0x17')](_0x5ddf7d);}return _0x27ab7f[_0x2dc5('0x18')](_0x5ddf7d)[_0x2dc5('0x19')]();};}function respondWithResult(_0x36bda0,_0x582714){_0x582714=_0x582714||0xc8;return function(_0x545497){if(_0x545497){return _0x36bda0[_0x2dc5('0x18')](_0x582714)[_0x2dc5('0x1a')](_0x545497);}};}function respondWithFilteredResult(_0x4dbe17,_0x1f66b1){return function(_0x213f97){if(_0x213f97){var _0x208ba5=typeof _0x1f66b1[_0x2dc5('0x1b')]===_0x2dc5('0x1c')&&typeof _0x1f66b1['limit']==='undefined';var _0x44d183=_0x213f97['count'];var _0x3008b8=_0x208ba5?0x0:_0x1f66b1['offset'];var _0x1463bd=_0x208ba5?_0x213f97[_0x2dc5('0x1d')]:_0x1f66b1['offset']+_0x1f66b1[_0x2dc5('0x1e')];var _0x151b59;if(_0x1463bd>=_0x44d183){_0x1463bd=_0x44d183;_0x151b59=0xc8;}else{_0x151b59=0xce;}_0x4dbe17[_0x2dc5('0x18')](_0x151b59);return _0x4dbe17[_0x2dc5('0x1f')](_0x2dc5('0x20'),_0x3008b8+'-'+_0x1463bd+'/'+_0x44d183)['json'](_0x213f97);}return null;};}function patchUpdates(_0x4ee437){return function(_0x23ea94){try{jsonpatch[_0x2dc5('0x21')](_0x23ea94,_0x4ee437,!![]);}catch(_0x2eeeae){return BPromise['reject'](_0x2eeeae);}return _0x23ea94[_0x2dc5('0x22')]();};}function saveUpdates(_0x59780a,_0x218f32){return function(_0x1f63f7){if(_0x1f63f7){return _0x1f63f7[_0x2dc5('0x23')](_0x59780a)[_0x2dc5('0x24')](function(_0x1b2490){return _0x1b2490;});}return null;};}function removeEntity(_0x2a5887,_0x5ee204){return function(_0x32bad6){if(_0x32bad6){return _0x32bad6[_0x2dc5('0x25')]()[_0x2dc5('0x24')](function(){_0x2a5887['status'](0xcc)[_0x2dc5('0x19')]();});}};}function handleEntityNotFound(_0x38d12b,_0x47f730){return function(_0x42458a){if(!_0x42458a){_0x38d12b[_0x2dc5('0x17')](0x194);}return _0x42458a;};}function handleError(_0x16ac3e,_0x5b51a0){_0x5b51a0=_0x5b51a0||0x1f4;return function(_0x4b9e93){logger[_0x2dc5('0x26')](_0x4b9e93[_0x2dc5('0x27')]);if(_0x4b9e93[_0x2dc5('0x28')]){delete _0x4b9e93[_0x2dc5('0x28')];}_0x16ac3e['status'](_0x5b51a0)[_0x2dc5('0x29')](_0x4b9e93);};}var utilLicense=require(_0x2dc5('0x15'));exports[_0x2dc5('0x2a')]=function(_0x178800,_0x1e0170){var _0x5957e3={'raw':!![],'where':{'id':0x1}},_0x4acd1e={};_0x4acd1e[_0x2dc5('0x2b')]=_[_0x2dc5('0x2c')](db['License'][_0x2dc5('0x2d')]);_0x4acd1e[_0x2dc5('0x2e')]=_[_0x2dc5('0x2c')](_0x178800[_0x2dc5('0x2e')]);_0x4acd1e['filters']=_[_0x2dc5('0x2f')](_0x4acd1e['model'],_0x4acd1e[_0x2dc5('0x2e')]);_0x5957e3['attributes']=_['intersection'](_0x4acd1e[_0x2dc5('0x2b')],qs[_0x2dc5('0x30')](_0x178800['query'][_0x2dc5('0x30')]));_0x5957e3[_0x2dc5('0x31')]=_0x5957e3['attributes'][_0x2dc5('0x32')]?_0x5957e3[_0x2dc5('0x31')]:_0x4acd1e[_0x2dc5('0x2b')];_0x5957e3=_[_0x2dc5('0x33')]({},_0x5957e3,_0x178800['options']);return utilLicense[_0x2dc5('0x34')](_0x5957e3)[_0x2dc5('0x24')](respondWithResult(_0x1e0170,null))[_0x2dc5('0x35')](handleError(_0x1e0170,null));};exports[_0x2dc5('0x23')]=function(_0x56e503,_0x5461b0){if(_0x56e503['body']['id']){delete _0x56e503[_0x2dc5('0x36')]['id'];}return db[_0x2dc5('0x37')][_0x2dc5('0x38')]({'where':{'id':_0x56e503['params']['id']}})[_0x2dc5('0x24')](handleEntityNotFound(_0x5461b0,null))[_0x2dc5('0x24')](function(_0x265068){var _0x5ce671=_0x265068[_0x2dc5('0x39')]({'plain':!![]});return utilLicense[_0x2dc5('0x3a')](_0x5ce671,_0x56e503[_0x2dc5('0x36')][_0x2dc5('0x3b')]);})[_0x2dc5('0x24')](function(_0x4ba712){if(!_0x4ba712['demo']){return saveUpdates(_0x56e503['body'],null);}return _0x4ba712;})[_0x2dc5('0x24')](respondWithResult(_0x5461b0,null))[_0x2dc5('0x35')](handleError(_0x5461b0,null));};exports['downloadLogFile']=function(_0x6b8efc,_0x3d8ea9){var _0x3da773=_0x2dc5('0x3c');var _0x5cf6d0=path[_0x2dc5('0x3d')](_0x2dc5('0x3e'),_0x2dc5('0x3f'),_0x2dc5('0x40'),_0x3da773);_0x3d8ea9[_0x2dc5('0x41')]('Content-disposition','attachment;\x20filename='+_0x3da773);_0x3d8ea9['set'](_0x2dc5('0x42'),'text/plain');_0x3d8ea9['download'](_0x5cf6d0);}; \ No newline at end of file +var _0xdc38=['undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','name','index','License','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','merge','options','getLicense','catch','body','params','get','checkLicense','key','demo','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','Content-Type','text/plain','download','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','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','end','status','json','offset'];(function(_0x36a254,_0x120f26){var _0x55ac3a=function(_0x1c44cc){while(--_0x1c44cc){_0x36a254['push'](_0x36a254['shift']());}};_0x55ac3a(++_0x120f26);}(_0xdc38,0x188));var _0x8dc3=function(_0x8e3a84,_0x406e90){_0x8e3a84=_0x8e3a84-0x0;var _0x1ed36e=_0xdc38[_0x8e3a84];return _0x1ed36e;};'use strict';var emlformat=require(_0x8dc3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8dc3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8dc3('0x2'));var moment=require('moment');var BPromise=require(_0x8dc3('0x3'));var Mustache=require(_0x8dc3('0x4'));var util=require(_0x8dc3('0x5'));var path=require('path');var sox=require(_0x8dc3('0x6'));var csv=require(_0x8dc3('0x7'));var ejs=require(_0x8dc3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8dc3('0x9'));var crypto=require(_0x8dc3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8dc3('0xb'));var toCsv=require(_0x8dc3('0x7'));var querystring=require(_0x8dc3('0xc'));var Papa=require(_0x8dc3('0xd'));var Redis=require(_0x8dc3('0xe'));var authService=require(_0x8dc3('0xf'));var qs=require(_0x8dc3('0x10'));var as=require(_0x8dc3('0x11'));var hardwareService=require(_0x8dc3('0x12'));var logger=require('../../config/logger')(_0x8dc3('0x13'));var utils=require(_0x8dc3('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8dc3('0x15'));var db=require(_0x8dc3('0x16'))['db'];function respondWithStatusCode(_0x4c2366,_0x20aea0){_0x20aea0=_0x20aea0||0xcc;return function(_0x282f3a){if(_0x282f3a){return _0x4c2366[_0x8dc3('0x17')](_0x20aea0);}return _0x4c2366['status'](_0x20aea0)[_0x8dc3('0x18')]();};}function respondWithResult(_0x43e20b,_0x375fd5){_0x375fd5=_0x375fd5||0xc8;return function(_0x2f99c9){if(_0x2f99c9){return _0x43e20b[_0x8dc3('0x19')](_0x375fd5)[_0x8dc3('0x1a')](_0x2f99c9);}};}function respondWithFilteredResult(_0x2ee13b,_0x1d3a70){return function(_0x143a63){if(_0x143a63){var _0x4ce4b7=typeof _0x1d3a70[_0x8dc3('0x1b')]===_0x8dc3('0x1c')&&typeof _0x1d3a70[_0x8dc3('0x1d')]===_0x8dc3('0x1c');var _0x3b99c6=_0x143a63[_0x8dc3('0x1e')];var _0x419e45=_0x4ce4b7?0x0:_0x1d3a70[_0x8dc3('0x1b')];var _0x22b069=_0x4ce4b7?_0x143a63[_0x8dc3('0x1e')]:_0x1d3a70[_0x8dc3('0x1b')]+_0x1d3a70[_0x8dc3('0x1d')];var _0x2f5149;if(_0x22b069>=_0x3b99c6){_0x22b069=_0x3b99c6;_0x2f5149=0xc8;}else{_0x2f5149=0xce;}_0x2ee13b[_0x8dc3('0x19')](_0x2f5149);return _0x2ee13b[_0x8dc3('0x1f')](_0x8dc3('0x20'),_0x419e45+'-'+_0x22b069+'/'+_0x3b99c6)[_0x8dc3('0x1a')](_0x143a63);}return null;};}function patchUpdates(_0x3d4359){return function(_0x5373fc){try{jsonpatch['apply'](_0x5373fc,_0x3d4359,!![]);}catch(_0x540a89){return BPromise[_0x8dc3('0x21')](_0x540a89);}return _0x5373fc['save']();};}function saveUpdates(_0x2ea3c6,_0x679687){return function(_0x4a28f8){if(_0x4a28f8){return _0x4a28f8[_0x8dc3('0x22')](_0x2ea3c6)[_0x8dc3('0x23')](function(_0xcd6ee1){return _0xcd6ee1;});}return null;};}function removeEntity(_0x53f29a,_0x27391d){return function(_0x4a0dab){if(_0x4a0dab){return _0x4a0dab[_0x8dc3('0x24')]()[_0x8dc3('0x23')](function(){_0x53f29a[_0x8dc3('0x19')](0xcc)[_0x8dc3('0x18')]();});}};}function handleEntityNotFound(_0x106c72,_0x35b865){return function(_0x55ffe2){if(!_0x55ffe2){_0x106c72[_0x8dc3('0x17')](0x194);}return _0x55ffe2;};}function handleError(_0x25b076,_0x3821bb){_0x3821bb=_0x3821bb||0x1f4;return function(_0x42a58c){logger[_0x8dc3('0x25')](_0x42a58c['stack']);if(_0x42a58c[_0x8dc3('0x26')]){delete _0x42a58c['name'];}_0x25b076[_0x8dc3('0x19')](_0x3821bb)['send'](_0x42a58c);};}var utilLicense=require('../../config/license/util');exports[_0x8dc3('0x27')]=function(_0x15e90f,_0x76ec8a){var _0x1f93d2={'raw':!![],'where':{'id':0x1}},_0x40528c={};_0x40528c['model']=_['keys'](db[_0x8dc3('0x28')][_0x8dc3('0x29')]);_0x40528c[_0x8dc3('0x2a')]=_[_0x8dc3('0x2b')](_0x15e90f[_0x8dc3('0x2a')]);_0x40528c[_0x8dc3('0x2c')]=_[_0x8dc3('0x2d')](_0x40528c[_0x8dc3('0x2e')],_0x40528c[_0x8dc3('0x2a')]);_0x1f93d2[_0x8dc3('0x2f')]=_['intersection'](_0x40528c[_0x8dc3('0x2e')],qs['fields'](_0x15e90f[_0x8dc3('0x2a')][_0x8dc3('0x30')]));_0x1f93d2[_0x8dc3('0x2f')]=_0x1f93d2[_0x8dc3('0x2f')][_0x8dc3('0x31')]?_0x1f93d2[_0x8dc3('0x2f')]:_0x40528c[_0x8dc3('0x2e')];_0x1f93d2=_[_0x8dc3('0x32')]({},_0x1f93d2,_0x15e90f[_0x8dc3('0x33')]);return utilLicense[_0x8dc3('0x34')](_0x1f93d2)[_0x8dc3('0x23')](respondWithResult(_0x76ec8a,null))[_0x8dc3('0x35')](handleError(_0x76ec8a,null));};exports[_0x8dc3('0x22')]=function(_0x3d2a92,_0x3346d5){if(_0x3d2a92[_0x8dc3('0x36')]['id']){delete _0x3d2a92[_0x8dc3('0x36')]['id'];}return db[_0x8dc3('0x28')]['find']({'where':{'id':_0x3d2a92[_0x8dc3('0x37')]['id']}})['then'](handleEntityNotFound(_0x3346d5,null))[_0x8dc3('0x23')](function(_0x27a0f9){var _0x58540f=_0x27a0f9[_0x8dc3('0x38')]({'plain':!![]});return utilLicense[_0x8dc3('0x39')](_0x58540f,_0x3d2a92[_0x8dc3('0x36')][_0x8dc3('0x3a')]);})['then'](function(_0x44f6f6){if(!_0x44f6f6[_0x8dc3('0x3b')]){return saveUpdates(_0x3d2a92[_0x8dc3('0x36')],null);}return _0x44f6f6;})['then'](respondWithResult(_0x3346d5,null))['catch'](handleError(_0x3346d5,null));};exports[_0x8dc3('0x3c')]=function(_0x57b975,_0xc8a6fa){var _0x3cb0da=_0x8dc3('0x3d');var _0x23cf9a=path[_0x8dc3('0x3e')](_0x8dc3('0x3f'),_0x8dc3('0x40'),_0x8dc3('0x41'),_0x3cb0da);_0xc8a6fa[_0x8dc3('0x42')]('Content-disposition','attachment;\x20filename='+_0x3cb0da);_0xc8a6fa[_0x8dc3('0x1f')](_0x8dc3('0x43'),_0x8dc3('0x44'));_0xc8a6fa[_0x8dc3('0x45')](_0x23cf9a);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 83f179d..fbaae25 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 _0xa901=['License','license','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','define'];(function(_0x121df7,_0x207e61){var _0x227c4e=function(_0xafce7d){while(--_0xafce7d){_0x121df7['push'](_0x121df7['shift']());}};_0x227c4e(++_0x207e61);}(_0xa901,0xfe));var _0x1a90=function(_0x2c0409,_0x5cb4ef){_0x2c0409=_0x2c0409-0x0;var _0x551c0b=_0xa901[_0x2c0409];return _0x551c0b;};'use strict';var _=require('lodash');var util=require(_0x1a90('0x0'));var logger=require(_0x1a90('0x1'))(_0x1a90('0x2'));var moment=require('moment');var BPromise=require(_0x1a90('0x3'));var rp=require(_0x1a90('0x4'));var fs=require('fs');var path=require(_0x1a90('0x5'));var rimraf=require(_0x1a90('0x6'));var config=require(_0x1a90('0x7'));var attributes=require(_0x1a90('0x8'));module['exports']=function(_0x55acbd,_0x35d3b3){return _0x55acbd[_0x1a90('0x9')](_0x1a90('0xa'),attributes,{'tableName':_0x1a90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a11=['../../config/environment','./license.attributes','exports','define','License','license','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x5252e3,_0x35c80e){var _0x5ceb44=function(_0x757362){while(--_0x757362){_0x5252e3['push'](_0x5252e3['shift']());}};_0x5ceb44(++_0x35c80e);}(_0x4a11,0xfd));var _0x14a1=function(_0x5e4e54,_0x22683c){_0x5e4e54=_0x5e4e54-0x0;var _0x20b557=_0x4a11[_0x5e4e54];return _0x20b557;};'use strict';var _=require(_0x14a1('0x0'));var util=require('util');var logger=require(_0x14a1('0x1'))('api');var moment=require(_0x14a1('0x2'));var BPromise=require(_0x14a1('0x3'));var rp=require(_0x14a1('0x4'));var fs=require('fs');var path=require(_0x14a1('0x5'));var rimraf=require(_0x14a1('0x6'));var config=require(_0x14a1('0x7'));var attributes=require(_0x14a1('0x8'));module[_0x14a1('0x9')]=function(_0x1d3bd0,_0x56c6cc){return _0x1d3bd0[_0x14a1('0xa')](_0x14a1('0xb'),attributes,{'tableName':_0x14a1('0xc'),'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 5160b09..1706a23 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 _0xeafb=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code','License,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x31dfde,_0x521d49){var _0x42965b=function(_0x551d11){while(--_0x551d11){_0x31dfde['push'](_0x31dfde['shift']());}};_0x42965b(++_0x521d49);}(_0xeafb,0x13c));var _0xbeaf=function(_0x1707f0,_0x23f136){_0x1707f0=_0x1707f0-0x0;var _0xccacd1=_0xeafb[_0x1707f0];return _0xccacd1;};'use strict';var _=require('lodash');var util=require(_0xbeaf('0x0'));var moment=require(_0xbeaf('0x1'));var BPromise=require(_0xbeaf('0x2'));var rs=require(_0xbeaf('0x3'));var fs=require('fs');var Redis=require(_0xbeaf('0x4'));var db=require(_0xbeaf('0x5'))['db'];var utils=require(_0xbeaf('0x6'));var logger=require(_0xbeaf('0x7'))('rpc');var config=require(_0xbeaf('0x8'));var jayson=require(_0xbeaf('0x9'));var client=jayson[_0xbeaf('0xa')][_0xbeaf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5aee71,_0x28700f,_0xee5d8c){return new BPromise(function(_0x5eab68,_0x44eb8a){return client[_0xbeaf('0xc')](_0x5aee71,_0xee5d8c)['then'](function(_0x36ec2d){logger['info']('License,\x20%s,\x20%s',_0x28700f,_0xbeaf('0xd'));logger[_0xbeaf('0xe')]('License,\x20%s,\x20%s,\x20%s',_0x28700f,'request\x20sent',JSON[_0xbeaf('0xf')](_0x36ec2d));if(_0x36ec2d[_0xbeaf('0x10')]){if(_0x36ec2d[_0xbeaf('0x10')][_0xbeaf('0x11')]===0x1f4){logger[_0xbeaf('0x10')](_0xbeaf('0x12'),_0x28700f,_0x36ec2d[_0xbeaf('0x10')][_0xbeaf('0x13')]);return _0x44eb8a(_0x36ec2d[_0xbeaf('0x10')]['message']);}logger[_0xbeaf('0x10')]('License,\x20%s,\x20%s',_0x28700f,_0x36ec2d['error']['message']);return _0x5eab68(_0x36ec2d[_0xbeaf('0x10')][_0xbeaf('0x13')]);}else{logger[_0xbeaf('0x14')]('License,\x20%s,\x20%s',_0x28700f,'request\x20sent');_0x5eab68(_0x36ec2d[_0xbeaf('0x15')][_0xbeaf('0x13')]);}})[_0xbeaf('0x16')](function(_0x481ecb){logger[_0xbeaf('0x10')]('License,\x20%s,\x20%s',_0x28700f,_0x481ecb);_0x44eb8a(_0x481ecb);});});} \ No newline at end of file +var _0x0a51=['debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','then','info','License,\x20%s,\x20%s','request\x20sent'];(function(_0x28407a,_0x2a7269){var _0x8bd6ef=function(_0x3c886f){while(--_0x3c886f){_0x28407a['push'](_0x28407a['shift']());}};_0x8bd6ef(++_0x2a7269);}(_0x0a51,0x1aa));var _0x10a5=function(_0x1e28b6,_0x58cf17){_0x1e28b6=_0x1e28b6-0x0;var _0x22070a=_0x0a51[_0x1e28b6];return _0x22070a;};'use strict';var _=require(_0x10a5('0x0'));var util=require(_0x10a5('0x1'));var moment=require(_0x10a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x10a5('0x3'));var fs=require('fs');var Redis=require(_0x10a5('0x4'));var db=require(_0x10a5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x10a5('0x6'));var config=require('../../config/environment');var jayson=require(_0x10a5('0x7'));var client=jayson[_0x10a5('0x8')][_0x10a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e7bc2,_0x439198,_0x43be8d){return new BPromise(function(_0x1499ab,_0x43a249){return client['request'](_0x2e7bc2,_0x43be8d)[_0x10a5('0xa')](function(_0x3cdfb0){logger[_0x10a5('0xb')](_0x10a5('0xc'),_0x439198,_0x10a5('0xd'));logger[_0x10a5('0xe')](_0x10a5('0xf'),_0x439198,_0x10a5('0xd'),JSON[_0x10a5('0x10')](_0x3cdfb0));if(_0x3cdfb0[_0x10a5('0x11')]){if(_0x3cdfb0[_0x10a5('0x11')][_0x10a5('0x12')]===0x1f4){logger['error'](_0x10a5('0xc'),_0x439198,_0x3cdfb0['error']['message']);return _0x43a249(_0x3cdfb0['error']['message']);}logger[_0x10a5('0x11')]('License,\x20%s,\x20%s',_0x439198,_0x3cdfb0[_0x10a5('0x11')][_0x10a5('0x13')]);return _0x1499ab(_0x3cdfb0[_0x10a5('0x11')]['message']);}else{logger['info'](_0x10a5('0xc'),_0x439198,_0x10a5('0xd'));_0x1499ab(_0x3cdfb0[_0x10a5('0x14')][_0x10a5('0x13')]);}})[_0x10a5('0x15')](function(_0x14a36b){logger['error'](_0x10a5('0xc'),_0x439198,_0x14a36b);_0x43a249(_0x14a36b);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 56cfed4..d629a54 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 _0x7757=['removeDispositions','removeAnswers','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','getImap','getInteractions','/:id/messages','getMessages','/:id/verify','verifySmtp','post','addDisposition','addAnswer','create','/:id/in_servers','addImap','/:id/out_servers','addSmtp','addInteraction','/:id/applications','addApplications','send','update','delete'];(function(_0x4b9bf3,_0x26741b){var _0xcb4197=function(_0x4c79bf){while(--_0x4c79bf){_0x4b9bf3['push'](_0x4b9bf3['shift']());}};_0xcb4197(++_0x26741b);}(_0x7757,0x1aa));var _0x7775=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x7757[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0x7775('0x0'));var util=require(_0x7775('0x1'));var path=require(_0x7775('0x2'));var timeout=require(_0x7775('0x3'));var express=require('express');var router=express[_0x7775('0x4')]();var fs_extra=require(_0x7775('0x5'));var auth=require(_0x7775('0x6'));var interaction=require(_0x7775('0x7'));var config=require('../../config/environment');var controller=require('./mailAccount.controller');router[_0x7775('0x8')]('/',auth[_0x7775('0x9')](),controller[_0x7775('0xa')]);router[_0x7775('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x7775('0xb')]);router[_0x7775('0x8')](_0x7775('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x7775('0x8')](_0x7775('0xd'),auth[_0x7775('0x9')](),controller['getDispositions']);router[_0x7775('0x8')](_0x7775('0xe'),auth['isAuthenticated'](),controller[_0x7775('0xf')]);router[_0x7775('0x8')]('/:id/in_servers',auth[_0x7775('0x9')](),controller[_0x7775('0x10')]);router[_0x7775('0x8')]('/:id/out_servers',auth[_0x7775('0x9')](),controller['getSmtp']);router[_0x7775('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x7775('0x11')]);router[_0x7775('0x8')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x7775('0x8')](_0x7775('0x12'),auth[_0x7775('0x9')](),controller[_0x7775('0x13')]);router[_0x7775('0x8')](_0x7775('0x14'),auth[_0x7775('0x9')](),controller[_0x7775('0x15')]);router[_0x7775('0x8')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x7775('0x16')]('/:id/dispositions',auth[_0x7775('0x9')](),controller[_0x7775('0x17')]);router[_0x7775('0x16')](_0x7775('0xe'),auth[_0x7775('0x9')](),controller[_0x7775('0x18')]);router[_0x7775('0x16')]('/',auth[_0x7775('0x9')](),controller[_0x7775('0x19')]);router[_0x7775('0x16')](_0x7775('0x1a'),auth['isAuthenticated'](),controller[_0x7775('0x1b')]);router['post'](_0x7775('0x1c'),auth['isAuthenticated'](),controller[_0x7775('0x1d')]);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0x7775('0x1e')]);router[_0x7775('0x16')](_0x7775('0x1f'),auth[_0x7775('0x9')](),controller[_0x7775('0x20')]);router[_0x7775('0x16')]('/:id/send',auth[_0x7775('0x9')](),controller[_0x7775('0x21')]);router['post']('/:id/users',auth[_0x7775('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7775('0x9')](),controller[_0x7775('0x22')]);router[_0x7775('0x23')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x7775('0x24')]);router[_0x7775('0x23')](_0x7775('0xe'),auth[_0x7775('0x9')](),controller[_0x7775('0x25')]);router[_0x7775('0x23')](_0x7775('0x1a'),auth[_0x7775('0x9')](),controller['removeImap']);router['delete'](_0x7775('0x1c'),auth[_0x7775('0x9')](),controller[_0x7775('0x26')]);router[_0x7775('0x23')](_0x7775('0xc'),auth['isAuthenticated'](),controller[_0x7775('0x27')]);router['delete']('/:id/users',auth[_0x7775('0x9')](),controller[_0x7775('0x28')]);module[_0x7775('0x29')]=router; \ No newline at end of file +var _0x5c85=['./mailAccount.controller','isAuthenticated','get','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','/:id/interactions','addInteraction','addApplications','/:id/send','send','delete','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x5c85,0x1e5));var _0x55c8=function(_0x1e715d,_0x58077a){_0x1e715d=_0x1e715d-0x0;var _0x3938d1=_0x5c85[_0x1e715d];return _0x3938d1;};'use strict';var multer=require(_0x55c8('0x0'));var util=require(_0x55c8('0x1'));var path=require(_0x55c8('0x2'));var timeout=require(_0x55c8('0x3'));var express=require(_0x55c8('0x4'));var router=express[_0x55c8('0x5')]();var fs_extra=require(_0x55c8('0x6'));var auth=require(_0x55c8('0x7'));var interaction=require(_0x55c8('0x8'));var config=require(_0x55c8('0x9'));var controller=require(_0x55c8('0xa'));router['get']('/',auth[_0x55c8('0xb')](),controller['index']);router[_0x55c8('0xc')]('/describe',auth[_0x55c8('0xb')](),controller[_0x55c8('0xd')]);router['get'](_0x55c8('0xe'),auth[_0x55c8('0xb')](),controller['show']);router[_0x55c8('0xc')](_0x55c8('0xf'),auth[_0x55c8('0xb')](),controller['getDispositions']);router['get'](_0x55c8('0x10'),auth[_0x55c8('0xb')](),controller[_0x55c8('0x11')]);router['get'](_0x55c8('0x12'),auth['isAuthenticated'](),controller[_0x55c8('0x13')]);router[_0x55c8('0xc')](_0x55c8('0x14'),auth[_0x55c8('0xb')](),controller['getSmtp']);router[_0x55c8('0xc')]('/:id/interactions',auth[_0x55c8('0xb')](),controller[_0x55c8('0x15')]);router[_0x55c8('0xc')](_0x55c8('0x16'),auth[_0x55c8('0xb')](),controller[_0x55c8('0x17')]);router[_0x55c8('0xc')](_0x55c8('0x18'),auth[_0x55c8('0xb')](),controller[_0x55c8('0x19')]);router[_0x55c8('0xc')]('/:id/verify',auth['isAuthenticated'](),controller[_0x55c8('0x1a')]);router[_0x55c8('0xc')](_0x55c8('0x1b'),auth[_0x55c8('0xb')](),controller[_0x55c8('0x1c')]);router[_0x55c8('0x1d')](_0x55c8('0xf'),auth[_0x55c8('0xb')](),controller[_0x55c8('0x1e')]);router[_0x55c8('0x1d')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x55c8('0x1f')]);router[_0x55c8('0x1d')]('/',auth[_0x55c8('0xb')](),controller[_0x55c8('0x20')]);router['post'](_0x55c8('0x12'),auth['isAuthenticated'](),controller[_0x55c8('0x21')]);router['post']('/:id/out_servers',auth['isAuthenticated'](),controller['addSmtp']);router[_0x55c8('0x1d')](_0x55c8('0x22'),auth[_0x55c8('0xb')](),controller[_0x55c8('0x23')]);router[_0x55c8('0x1d')](_0x55c8('0x16'),auth[_0x55c8('0xb')](),controller[_0x55c8('0x24')]);router['post'](_0x55c8('0x25'),auth[_0x55c8('0xb')](),controller[_0x55c8('0x26')]);router[_0x55c8('0x1d')]('/:id/users',auth[_0x55c8('0xb')](),controller['addAgents']);router['put'](_0x55c8('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x55c8('0x27')](_0x55c8('0xf'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x55c8('0xb')](),controller['removeAnswers']);router[_0x55c8('0x27')](_0x55c8('0x12'),auth['isAuthenticated'](),controller[_0x55c8('0x28')]);router[_0x55c8('0x27')]('/:id/out_servers',auth[_0x55c8('0xb')](),controller[_0x55c8('0x29')]);router['delete'](_0x55c8('0xe'),auth[_0x55c8('0xb')](),controller[_0x55c8('0x2a')]);router[_0x55c8('0x27')](_0x55c8('0x1b'),auth[_0x55c8('0xb')](),controller[_0x55c8('0x2b')]);module[_0x55c8('0x2c')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 1666a7e..db575ab 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 _0x7dfb=['INTEGER','UNSIGNED','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','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','gmail','hotmail','yahoo','outlook365','custom','getDataValue','provider','sequelize','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif'];(function(_0x355af4,_0x138b6d){var _0x5e0477=function(_0x4dd267){while(--_0x4dd267){_0x355af4['push'](_0x355af4['shift']());}};_0x5e0477(++_0x138b6d);}(_0x7dfb,0x19d));var _0xb7df=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x7dfb[_0x4709c0];return _0x13348b;};'use strict';var Sequelize=require(_0xb7df('0x0'));module[_0xb7df('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xb7df('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xb7df('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xb7df('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xb7df('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xb7df('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xb7df('0x2')],'allowNull':![],'defaultValue':_0xb7df('0x4')},'fontSize':{'type':Sequelize[_0xb7df('0x5')](0x2)[_0xb7df('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb7df('0x7');}},'notificationSound':{'type':Sequelize[_0xb7df('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb7df('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb7df('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb7df('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb7df('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb7df('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xb7df('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xb7df('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x30cc7c){if(!_0x30cc7c)this[_0xb7df('0x9')](_0xb7df('0xa'),null);this[_0xb7df('0x9')](_0xb7df('0xb'),_0x30cc7c);}},'provider':{'type':Sequelize['ENUM'](_0xb7df('0xc'),_0xb7df('0xd'),_0xb7df('0xe'),_0xb7df('0xf')),'defaultValue':null,'get':function(){if(!this['getDataValue']('provider'))return _0xb7df('0x10');return this[_0xb7df('0x11')](_0xb7df('0x12'));},'set':function(_0x839a91){if(_0x839a91===_0xb7df('0x10'))_0x839a91=null;return this[_0xb7df('0x9')](_0xb7df('0x12'),_0x839a91);}}}; \ No newline at end of file +var _0x1f70=['mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','outlook365','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x151fcc,_0x3a8b62){var _0x3dc1e7=function(_0x33c208){while(--_0x33c208){_0x151fcc['push'](_0x151fcc['shift']());}};_0x3dc1e7(++_0x3a8b62);}(_0x1f70,0x1c2));var _0x01f7=function(_0x5b78ec,_0x283236){_0x5b78ec=_0x5b78ec-0x0;var _0x132564=_0x1f70[_0x5b78ec];return _0x132564;};'use strict';var Sequelize=require(_0x01f7('0x0'));module[_0x01f7('0x1')]={'description':{'type':Sequelize[_0x01f7('0x2')]},'name':{'type':Sequelize[_0x01f7('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x01f7('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x01f7('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x01f7('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x01f7('0x4')]},'markAsUnread':{'type':Sequelize[_0x01f7('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x01f7('0x2')],'allowNull':![],'defaultValue':_0x01f7('0x5')},'fontSize':{'type':Sequelize[_0x01f7('0x6')](0x2)[_0x01f7('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x01f7('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x01f7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x01f7('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x01f7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x01f7('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x01f7('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x01f7('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x01f7('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x01f7('0x3')],'defaultValue':![],'comment':_0x01f7('0xa'),'set':function(_0x1f9578){if(!_0x1f9578)this[_0x01f7('0xb')](_0x01f7('0xc'),null);this[_0x01f7('0xb')](_0x01f7('0xd'),_0x1f9578);}},'provider':{'type':Sequelize[_0x01f7('0xe')](_0x01f7('0xf'),_0x01f7('0x10'),'yahoo',_0x01f7('0x11')),'defaultValue':null,'get':function(){if(!this[_0x01f7('0x12')](_0x01f7('0x13')))return _0x01f7('0x14');return this['getDataValue'](_0x01f7('0x13'));},'set':function(_0x4d29c9){if(_0x4d29c9===_0x01f7('0x14'))_0x4d29c9=null;return this['setDataValue']('provider',_0x4d29c9);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 9f38286..89b7b2e 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 _0xc165=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','sendStatus','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','DESC','CloudProvider','from','%s\x20<%s>','attachments','join','root','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','Contacts','messageId','subject','out','Interaction','verifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','bluebird','path','lodash','juice','../../components/parsers/qs','api','../../mysqldb','localhost','socket.io-emitter','redis','./mailAccount.socket','register','jayson/promise','client','request','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','MailAccounts','UserProfileResource','end','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','smtp.office365.com','user','username','password','modernAuthentication','CloudProviderId','pass','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','Pause','mandatoryDispositionPause','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','MailAccount','include','findAll','rows','show','params','MailServerOut','length','find','update','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','create','getDispositions','findOne','nolimit','pick','Disposition','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','isNil','active','description','get'];(function(_0x27fc6c,_0x5d3fc8){var _0x28e8fa=function(_0x450e6c){while(--_0x450e6c){_0x27fc6c['push'](_0x27fc6c['shift']());}};_0x28e8fa(++_0x5d3fc8);}(_0xc165,0x1c6));var _0x5c16=function(_0x492b1c,_0x58840e){_0x492b1c=_0x492b1c-0x0;var _0xfd2d4c=_0xc165[_0x492b1c];return _0xfd2d4c;};'use strict';var moment=require(_0x5c16('0x0'));var BPromise=require(_0x5c16('0x1'));var util=require('util');var path=require(_0x5c16('0x2'));var _=require(_0x5c16('0x3'));var juice=require(_0x5c16('0x4'));var Redis=require('ioredis');var qs=require(_0x5c16('0x5'));var logger=require('../../config/logger')(_0x5c16('0x6'));var config=require('../../config/environment');var db=require(_0x5c16('0x7'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x5c16('0x8'),'port':0x18eb});var socket=require(_0x5c16('0x9'))(new Redis(config[_0x5c16('0xa')]));require(_0x5c16('0xb'))[_0x5c16('0xc')](socket);var jayson=require(_0x5c16('0xd'));var client=jayson[_0x5c16('0xe')]['http']({'port':0x232b});function respondWithRpcPromise(_0x199b7c,_0x557612,_0x25cc60,_0x360d75){return new BPromise(function(_0x53d9d9,_0x89cf2d){var _0x5e7bdd=_0x360d75||client;return _0x5e7bdd[_0x5c16('0xf')](_0x199b7c,_0x25cc60)['then'](function(_0xf98000){logger['info'](_0x5c16('0x10'),_0x557612,_0x5c16('0x11'));logger[_0x5c16('0x12')](_0x5c16('0x13'),_0x557612,_0x5c16('0x11'),JSON[_0x5c16('0x14')](_0xf98000));if(_0xf98000['error']){if(_0xf98000[_0x5c16('0x15')]['code']===0x1f4){logger['error'](_0x5c16('0x10'),_0x557612,_0xf98000[_0x5c16('0x15')][_0x5c16('0x16')]);return _0x89cf2d(_0xf98000['error'][_0x5c16('0x16')]);}logger[_0x5c16('0x15')](_0x5c16('0x10'),_0x557612,_0xf98000[_0x5c16('0x15')][_0x5c16('0x16')]);return _0x53d9d9(_0xf98000[_0x5c16('0x15')][_0x5c16('0x16')]);}else{logger[_0x5c16('0x17')](_0x5c16('0x10'),_0x557612,_0x5c16('0x11'));_0x53d9d9(_0xf98000[_0x5c16('0x18')]['message']);}})[_0x5c16('0x19')](function(_0x4bc044){logger['error']('MailAccount,\x20%s,\x20%s',_0x557612,_0x4bc044);_0x89cf2d(_0x4bc044);});});}function respondWithStatusCode(_0x1b9482,_0x4a3b2d){_0x4a3b2d=_0x4a3b2d||0xcc;return function(_0x237522){if(_0x237522){return _0x1b9482['sendStatus'](_0x4a3b2d);}return _0x1b9482[_0x5c16('0x1a')](_0x4a3b2d)['end']();};}function respondWithResult(_0x8e00b5,_0x15e83f){_0x15e83f=_0x15e83f||0xc8;return function(_0x9df3ff){if(_0x9df3ff){return _0x8e00b5[_0x5c16('0x1a')](_0x15e83f)[_0x5c16('0x1b')](_0x9df3ff);}};}function respondWithFilteredResult(_0x1168f8,_0x1550eb){return function(_0x369ba2){if(_0x369ba2){var _0x1527c2=typeof _0x1550eb[_0x5c16('0x1c')]===_0x5c16('0x1d')&&typeof _0x1550eb[_0x5c16('0x1e')]===_0x5c16('0x1d');var _0x3c90cc=_0x369ba2['count'];var _0x3eb20a=_0x1527c2?0x0:_0x1550eb[_0x5c16('0x1c')];var _0x3ac505=_0x1527c2?_0x369ba2[_0x5c16('0x1f')]:_0x1550eb[_0x5c16('0x1c')]+_0x1550eb[_0x5c16('0x1e')];var _0x2f98f7;if(_0x3ac505>=_0x3c90cc){_0x3ac505=_0x3c90cc;_0x2f98f7=0xc8;}else{_0x2f98f7=0xce;}_0x1168f8[_0x5c16('0x1a')](_0x2f98f7);return _0x1168f8[_0x5c16('0x20')](_0x5c16('0x21'),_0x3eb20a+'-'+_0x3ac505+'/'+_0x3c90cc)[_0x5c16('0x1b')](_0x369ba2);}return null;};}function saveUpdates(_0x515c30){return function(_0x58227f){if(_0x58227f){return _0x58227f['update'](_0x515c30)[_0x5c16('0x22')](function(_0x16006e){return _0x16006e;});}return null;};}function removeEntity(_0x5f4be5){return function(_0x4774a8){if(_0x4774a8){return _0x4774a8[_0x5c16('0x23')]()[_0x5c16('0x22')](function(){var _0xbb783=_0x4774a8['get']({'plain':!![]});var _0x15a9df=_0x5c16('0x24');return db[_0x5c16('0x25')][_0x5c16('0x23')]({'where':{'type':_0x15a9df,'resourceId':_0xbb783['id']}})[_0x5c16('0x22')](function(){return _0x4774a8;});})[_0x5c16('0x22')](function(){_0x5f4be5[_0x5c16('0x1a')](0xcc)[_0x5c16('0x26')]();});}};}function handleEntityNotFound(_0x312f85){return function(_0x2e02db){if(!_0x2e02db){_0x312f85['sendStatus'](0x194);}return _0x2e02db;};}function handleError(_0x41c308,_0x39a837){_0x39a837=_0x39a837||0x1f4;return function(_0x3cc10d){logger[_0x5c16('0x15')](_0x3cc10d[_0x5c16('0x27')]);if(_0x3cc10d[_0x5c16('0x28')]){delete _0x3cc10d[_0x5c16('0x28')];}_0x41c308[_0x5c16('0x1a')](_0x39a837)[_0x5c16('0x29')](_0x3cc10d);};}function getImapHost(_0x2f99c9){switch(_0x2f99c9){case _0x5c16('0x2a'):return _0x5c16('0x2b');case _0x5c16('0x2c'):return _0x5c16('0x2d');case _0x5c16('0x2e'):return _0x5c16('0x2f');case'outlook365':return'outlook.office365.com';}throw new Error(_0x5c16('0x30'),_0x2f99c9);}function getSmtpHost(_0x102864){switch(_0x102864){case _0x5c16('0x2a'):return'smtp.gmail.com';case _0x5c16('0x2c'):return _0x5c16('0x31');case _0x5c16('0x2e'):return _0x5c16('0x32');case _0x5c16('0x33'):return _0x5c16('0x34');}throw new Error(_0x5c16('0x30'),_0x102864);}function getAuthenticationOptions(_0x5d6cd6,_0x245c06){var _0x4ad80f={};var _0x19e50e={};if(_0x5d6cd6){_0x4ad80f[_0x5c16('0x35')]=_0x19e50e[_0x5c16('0x35')]=_0x245c06[_0x5c16('0x36')];_0x4ad80f[_0x5c16('0x37')]=_0x19e50e['pass']=_0x245c06['password'];if(_0x245c06[_0x5c16('0x38')]){_0x4ad80f['modernAuthentication']=_0x19e50e[_0x5c16('0x38')]=!![];_0x4ad80f['CloudProviderId']=_0x19e50e[_0x5c16('0x39')]=_0x245c06[_0x5c16('0x39')];_0x4ad80f['password']=_0x19e50e[_0x5c16('0x3a')]=null;}else{_0x4ad80f[_0x5c16('0x39')]=_0x19e50e[_0x5c16('0x39')]=null;}_0x4ad80f[_0x5c16('0x3b')]=getImapHost(_0x5d6cd6);_0x4ad80f['port']=0x3e1;_0x19e50e['host']=getSmtpHost(_0x5d6cd6);_0x19e50e[_0x5c16('0x3c')]=0x24b;_0x19e50e[_0x5c16('0x3d')]=![];_0x4ad80f[_0x5c16('0x3e')]=_0x19e50e['service']=null;}else{if(_0x245c06[_0x5c16('0x3f')]){_0x4ad80f[_0x5c16('0x35')]=_0x19e50e[_0x5c16('0x35')]=_0x245c06[_0x5c16('0x36')];_0x4ad80f[_0x5c16('0x37')]=_0x19e50e[_0x5c16('0x3a')]=_0x245c06[_0x5c16('0x37')];}else{_0x4ad80f[_0x5c16('0x3f')]=_0x19e50e['authentication']=![];_0x4ad80f[_0x5c16('0x35')]=_0x19e50e[_0x5c16('0x35')]=null;_0x4ad80f['password']=_0x19e50e[_0x5c16('0x3a')]=null;}_0x4ad80f[_0x5c16('0x3b')]=_0x245c06['Imap'][_0x5c16('0x3b')];_0x4ad80f[_0x5c16('0x3c')]=_0x245c06[_0x5c16('0x40')]['port'];_0x19e50e['host']=_0x245c06['Smtp'][_0x5c16('0x3b')];_0x19e50e[_0x5c16('0x3c')]=_0x245c06[_0x5c16('0x41')][_0x5c16('0x3c')];}return{'Imap':_0x4ad80f,'Smtp':_0x19e50e};}exports[_0x5c16('0x42')]=function(_0x4cc04a,_0x395347){var _0x40c23b={'include':[{'model':db[_0x5c16('0x43')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x5c16('0x41')},{'model':db[_0x5c16('0x44')],'as':_0x5c16('0x45')}]},_0x2574e9={},_0x215de4={'count':0x0,'rows':[]};var _0x4b4cff=_[_0x5c16('0x46')](db['MailAccount'][_0x5c16('0x47')],function(_0x28d58d){return{'name':_0x28d58d['fieldName'],'type':_0x28d58d['type'][_0x5c16('0x48')]};});_0x2574e9[_0x5c16('0x49')]=_['map'](_0x4b4cff,'name');_0x2574e9[_0x5c16('0x4a')]=_[_0x5c16('0x4b')](_0x4cc04a[_0x5c16('0x4a')]);_0x2574e9[_0x5c16('0x4c')]=_[_0x5c16('0x4d')](_0x2574e9[_0x5c16('0x49')],_0x2574e9[_0x5c16('0x4a')]);_0x40c23b[_0x5c16('0x4e')]=_[_0x5c16('0x4d')](_0x2574e9['model'],qs[_0x5c16('0x4f')](_0x4cc04a[_0x5c16('0x4a')]['fields']));_0x40c23b[_0x5c16('0x4e')]=_0x40c23b[_0x5c16('0x4e')]['length']?_0x40c23b[_0x5c16('0x4e')]:_0x2574e9[_0x5c16('0x49')];if(!_0x4cc04a[_0x5c16('0x4a')][_0x5c16('0x50')]('nolimit')){_0x40c23b[_0x5c16('0x1e')]=qs[_0x5c16('0x1e')](_0x4cc04a[_0x5c16('0x4a')][_0x5c16('0x1e')]);_0x40c23b[_0x5c16('0x1c')]=qs[_0x5c16('0x1c')](_0x4cc04a[_0x5c16('0x4a')]['offset']);}_0x40c23b[_0x5c16('0x51')]=qs[_0x5c16('0x52')](_0x4cc04a[_0x5c16('0x4a')]['sort']);_0x40c23b[_0x5c16('0x53')]=qs[_0x5c16('0x4c')](_['pick'](_0x4cc04a[_0x5c16('0x4a')],_0x2574e9[_0x5c16('0x4c')]),_0x4b4cff);if(_0x4cc04a[_0x5c16('0x4a')][_0x5c16('0x54')]){_0x40c23b['where']=_[_0x5c16('0x55')](_0x40c23b[_0x5c16('0x53')],{'$or':_['map'](_0x4b4cff,function(_0x363d03){if(_0x363d03[_0x5c16('0x56')]!==_0x5c16('0x57')){var _0x162e0c={};_0x162e0c[_0x363d03[_0x5c16('0x28')]]={'$like':'%'+_0x4cc04a['query'][_0x5c16('0x54')]+'%'};return _0x162e0c;}})});}_0x40c23b=_['merge']({},_0x40c23b,_0x4cc04a[_0x5c16('0x58')]);var _0x59b314={'where':_0x40c23b[_0x5c16('0x53')]};return db[_0x5c16('0x59')][_0x5c16('0x1f')](_0x59b314)['then'](function(_0x5dc6d5){_0x215de4[_0x5c16('0x1f')]=_0x5dc6d5;if(_0x4cc04a['query']['includeAll']){_0x40c23b[_0x5c16('0x5a')]=[{'all':!![]}];}return db[_0x5c16('0x59')][_0x5c16('0x5b')](_0x40c23b);})[_0x5c16('0x22')](function(_0x397541){_0x215de4[_0x5c16('0x5c')]=_0x397541;return _0x215de4;})[_0x5c16('0x22')](respondWithFilteredResult(_0x395347,_0x40c23b))[_0x5c16('0x19')](handleError(_0x395347,null));};exports[_0x5c16('0x5d')]=function(_0x7a8dbb,_0x32323d){var _0x433859={'raw':![],'where':{'id':_0x7a8dbb[_0x5c16('0x5e')]['id']},'include':[{'model':db[_0x5c16('0x43')],'as':_0x5c16('0x40')},{'model':db[_0x5c16('0x5f')],'as':_0x5c16('0x41')},{'model':db[_0x5c16('0x44')],'as':_0x5c16('0x45')}]},_0x5bec6e={};_0x5bec6e[_0x5c16('0x49')]=_[_0x5c16('0x4b')](db['MailAccount'][_0x5c16('0x47')]);_0x5bec6e[_0x5c16('0x4a')]=_[_0x5c16('0x4b')](_0x7a8dbb[_0x5c16('0x4a')]);_0x5bec6e[_0x5c16('0x4c')]=_[_0x5c16('0x4d')](_0x5bec6e[_0x5c16('0x49')],_0x5bec6e[_0x5c16('0x4a')]);_0x433859[_0x5c16('0x4e')]=_[_0x5c16('0x4d')](_0x5bec6e[_0x5c16('0x49')],qs[_0x5c16('0x4f')](_0x7a8dbb[_0x5c16('0x4a')][_0x5c16('0x4f')]));_0x433859['attributes']=_0x433859[_0x5c16('0x4e')][_0x5c16('0x60')]?_0x433859[_0x5c16('0x4e')]:_0x5bec6e[_0x5c16('0x49')];if(_0x7a8dbb[_0x5c16('0x4a')]['includeAll']){_0x433859[_0x5c16('0x5a')]=[{'all':!![]}];}_0x433859=_[_0x5c16('0x55')]({},_0x433859,_0x7a8dbb['options']);return db[_0x5c16('0x59')][_0x5c16('0x61')](_0x433859)[_0x5c16('0x22')](handleEntityNotFound(_0x32323d,null))[_0x5c16('0x22')](respondWithResult(_0x32323d,null))[_0x5c16('0x19')](handleError(_0x32323d,null));};exports[_0x5c16('0x62')]=function(_0x3bb5c9,_0x41bb15){if(_0x3bb5c9['body']['id']){delete _0x3bb5c9[_0x5c16('0x63')]['id'];}var _0x48e43c=_0x3bb5c9[_0x5c16('0x63')][_0x5c16('0x64')]===_0x5c16('0x65')?null:_0x3bb5c9['body'][_0x5c16('0x64')];var _0x287b4e=_0x3bb5c9['body']['Imap']||{};var _0x45451d=_0x3bb5c9[_0x5c16('0x63')][_0x5c16('0x41')]||{};if(_0x48e43c){_0x287b4e['host']=getImapHost(_0x48e43c);_0x287b4e[_0x5c16('0x3c')]=0x3e1;_0x45451d[_0x5c16('0x3b')]=getSmtpHost(_0x48e43c);_0x45451d[_0x5c16('0x3c')]=0x24b;_0x45451d[_0x5c16('0x3d')]=![];}if(_0x45451d[_0x5c16('0x38')]){_0x45451d[_0x5c16('0x3d')]=![];}else{_0x45451d[_0x5c16('0x39')]=null;}if(!_0x287b4e[_0x5c16('0x38')])_0x287b4e['CloudProviderId']=null;_0x3bb5c9[_0x5c16('0x63')][_0x5c16('0x40')]=_0x287b4e;_0x3bb5c9[_0x5c16('0x63')][_0x5c16('0x41')]=_0x45451d;return db[_0x5c16('0x59')][_0x5c16('0x61')]({'where':{'id':_0x3bb5c9[_0x5c16('0x5e')]['id']},'include':[{'model':db[_0x5c16('0x43')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x5c16('0x41')},{'model':db['Pause'],'as':_0x5c16('0x45')}]})[_0x5c16('0x22')](handleEntityNotFound(_0x41bb15,null))[_0x5c16('0x22')](function(_0x31b64e){if(!_0x31b64e)throw new Error(_0x5c16('0x66'));if(_0x31b64e[_0x5c16('0x3e')])delete _0x3bb5c9[_0x5c16('0x63')]['Imap'];return _0x31b64e;})[_0x5c16('0x22')](saveUpdates(_0x3bb5c9[_0x5c16('0x63')],null))[_0x5c16('0x22')](function(_0x4125e8){if(!_0x3bb5c9[_0x5c16('0x63')]['Imap'])return _0x4125e8;return db[_0x5c16('0x43')][_0x5c16('0x62')](_0x3bb5c9[_0x5c16('0x63')]['Imap'],{'where':{'MailAccountId':_0x4125e8['id']}})[_0x5c16('0x22')](function(){return _0x4125e8;});})[_0x5c16('0x22')](function(_0x589cb4){if(!_0x3bb5c9['body'][_0x5c16('0x41')])return _0x589cb4;return db[_0x5c16('0x5f')][_0x5c16('0x62')](_0x3bb5c9[_0x5c16('0x63')][_0x5c16('0x41')],{'where':{'MailAccountId':_0x589cb4['id']}})[_0x5c16('0x22')](function(){return _0x589cb4;});})[_0x5c16('0x22')](respondWithResult(_0x41bb15,null))[_0x5c16('0x19')](handleError(_0x41bb15,null));};exports[_0x5c16('0x67')]=function(_0x561db5,_0xc5e9fb){return db[_0x5c16('0x59')][_0x5c16('0x67')]()['then'](respondWithResult(_0xc5e9fb,null))[_0x5c16('0x19')](handleError(_0xc5e9fb,null));};exports[_0x5c16('0x68')]=function(_0xb4cb83,_0x439fd6){if(_0xb4cb83['body']['id']){delete _0xb4cb83[_0x5c16('0x63')]['id'];}return db[_0x5c16('0x59')][_0x5c16('0x61')]({'where':{'id':_0xb4cb83[_0x5c16('0x5e')]['id']}})['then'](handleEntityNotFound(_0x439fd6,null))[_0x5c16('0x22')](function(_0x46c39a){if(_0x46c39a){_0xb4cb83[_0x5c16('0x63')][_0x5c16('0x69')]=_0x46c39a['id'];return db['Disposition'][_0x5c16('0x6a')](_0xb4cb83['body']);}})['then'](respondWithResult(_0x439fd6,null))[_0x5c16('0x19')](handleError(_0x439fd6,null));};exports[_0x5c16('0x6b')]=function(_0xc1eee,_0x166ef8){var _0x55bfe4={'raw':![],'where':{}};var _0x3ff07d={};var _0x2f0f97={'count':0x0,'rows':[]};return db[_0x5c16('0x59')][_0x5c16('0x6c')]({'where':{'id':_0xc1eee['params']['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x166ef8,null))[_0x5c16('0x22')](function(_0x1db050){if(_0x1db050){_0x3ff07d[_0x5c16('0x49')]=_[_0x5c16('0x4b')](db['Disposition'][_0x5c16('0x47')]);_0x3ff07d[_0x5c16('0x4a')]=_[_0x5c16('0x4b')](_0xc1eee['query']);_0x3ff07d[_0x5c16('0x4c')]=_[_0x5c16('0x4d')](_0x3ff07d[_0x5c16('0x49')],_0x3ff07d[_0x5c16('0x4a')]);_0x55bfe4['attributes']=_[_0x5c16('0x4d')](_0x3ff07d[_0x5c16('0x49')],qs[_0x5c16('0x4f')](_0xc1eee['query'][_0x5c16('0x4f')]));_0x55bfe4[_0x5c16('0x4e')]=_0x55bfe4[_0x5c16('0x4e')][_0x5c16('0x60')]?_0x55bfe4[_0x5c16('0x4e')]:_0x3ff07d[_0x5c16('0x49')];if(!_0xc1eee['query'][_0x5c16('0x50')](_0x5c16('0x6d'))){_0x55bfe4[_0x5c16('0x1e')]=qs['limit'](_0xc1eee[_0x5c16('0x4a')]['limit']);_0x55bfe4['offset']=qs[_0x5c16('0x1c')](_0xc1eee[_0x5c16('0x4a')][_0x5c16('0x1c')]);}_0x55bfe4[_0x5c16('0x51')]=qs[_0x5c16('0x52')](_0xc1eee['query'][_0x5c16('0x52')]);_0x55bfe4[_0x5c16('0x53')]=qs['filters'](_[_0x5c16('0x6e')](_0xc1eee[_0x5c16('0x4a')],_0x3ff07d[_0x5c16('0x4c')]));_0x55bfe4[_0x5c16('0x53')]['MailAccountId']=_0x1db050['id'];if(_0xc1eee['query'][_0x5c16('0x54')]){_0x55bfe4[_0x5c16('0x53')]=_[_0x5c16('0x55')](_0x55bfe4[_0x5c16('0x53')],{'$or':_[_0x5c16('0x46')](_0x55bfe4['attributes'],function(_0xb8d214){var _0x4a8050={};_0x4a8050[_0xb8d214]={'$like':'%'+_0xc1eee[_0x5c16('0x4a')][_0x5c16('0x54')]+'%'};return _0x4a8050;})});}_0x55bfe4=_[_0x5c16('0x55')]({},_0x55bfe4,_0xc1eee[_0x5c16('0x58')]);return db[_0x5c16('0x6f')]['count']({'where':_0x55bfe4[_0x5c16('0x53')]})[_0x5c16('0x22')](function(_0x5351a8){_0x2f0f97[_0x5c16('0x1f')]=_0x5351a8;if(_0xc1eee[_0x5c16('0x4a')][_0x5c16('0x70')]){_0x55bfe4[_0x5c16('0x5a')]=[{'all':!![]}];}return db['Disposition'][_0x5c16('0x5b')](_0x55bfe4);})[_0x5c16('0x22')](function(_0x46418f){_0x2f0f97['rows']=_0x46418f;return _0x2f0f97;});}})[_0x5c16('0x22')](respondWithFilteredResult(_0x166ef8,_0x55bfe4))[_0x5c16('0x19')](handleError(_0x166ef8,null));};exports[_0x5c16('0x71')]=function(_0x493c97,_0x9c8d50){return db[_0x5c16('0x59')][_0x5c16('0x61')]({'where':{'id':_0x493c97['params']['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x9c8d50,null))[_0x5c16('0x22')](function(_0x349281){if(_0x349281){return _0x349281[_0x5c16('0x71')](_0x493c97[_0x5c16('0x4a')][_0x5c16('0x72')]);}})[_0x5c16('0x22')](respondWithStatusCode(_0x9c8d50,null))['catch'](handleError(_0x9c8d50,null));};exports[_0x5c16('0x73')]=function(_0x1d7380,_0x56b113){if(_0x1d7380[_0x5c16('0x63')]['id']){delete _0x1d7380[_0x5c16('0x63')]['id'];}return db[_0x5c16('0x59')][_0x5c16('0x61')]({'where':{'id':_0x1d7380[_0x5c16('0x5e')]['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x56b113,null))[_0x5c16('0x22')](function(_0x1741b4){if(_0x1741b4){_0x1d7380[_0x5c16('0x63')][_0x5c16('0x69')]=_0x1741b4['id'];return db[_0x5c16('0x74')][_0x5c16('0x6a')](_0x1d7380[_0x5c16('0x63')]);}})[_0x5c16('0x22')](respondWithResult(_0x56b113,null))[_0x5c16('0x19')](handleError(_0x56b113,null));};exports[_0x5c16('0x75')]=function(_0x33f568,_0x1f8b54){var _0x288a24={'raw':![],'where':{}};var _0x371bc3={};var _0xf65d83={'count':0x0,'rows':[]};return db[_0x5c16('0x59')][_0x5c16('0x6c')]({'where':{'id':_0x33f568[_0x5c16('0x5e')]['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x1f8b54,null))[_0x5c16('0x22')](function(_0x510b3a){if(_0x510b3a){_0x371bc3['model']=_['keys'](db['CannedAnswer'][_0x5c16('0x47')]);_0x371bc3['query']=_[_0x5c16('0x4b')](_0x33f568['query']);_0x371bc3[_0x5c16('0x4c')]=_['intersection'](_0x371bc3[_0x5c16('0x49')],_0x371bc3[_0x5c16('0x4a')]);_0x288a24[_0x5c16('0x4e')]=_[_0x5c16('0x4d')](_0x371bc3[_0x5c16('0x49')],qs['fields'](_0x33f568[_0x5c16('0x4a')][_0x5c16('0x4f')]));_0x288a24[_0x5c16('0x4e')]=_0x288a24[_0x5c16('0x4e')][_0x5c16('0x60')]?_0x288a24[_0x5c16('0x4e')]:_0x371bc3[_0x5c16('0x49')];if(!_0x33f568['query'][_0x5c16('0x50')](_0x5c16('0x6d'))){_0x288a24[_0x5c16('0x1e')]=qs[_0x5c16('0x1e')](_0x33f568[_0x5c16('0x4a')]['limit']);_0x288a24[_0x5c16('0x1c')]=qs['offset'](_0x33f568['query'][_0x5c16('0x1c')]);}_0x288a24[_0x5c16('0x51')]=qs['sort'](_0x33f568[_0x5c16('0x4a')][_0x5c16('0x52')]);_0x288a24[_0x5c16('0x53')]=qs[_0x5c16('0x4c')](_[_0x5c16('0x6e')](_0x33f568[_0x5c16('0x4a')],_0x371bc3['filters']));_0x288a24[_0x5c16('0x53')][_0x5c16('0x69')]=_0x510b3a['id'];if(_0x33f568[_0x5c16('0x4a')][_0x5c16('0x54')]){_0x288a24['where']=_[_0x5c16('0x55')](_0x288a24[_0x5c16('0x53')],{'$or':_[_0x5c16('0x46')](_0x288a24[_0x5c16('0x4e')],function(_0x33a123){var _0x367187={};_0x367187[_0x33a123]={'$like':'%'+_0x33f568['query'][_0x5c16('0x54')]+'%'};return _0x367187;})});}_0x288a24=_[_0x5c16('0x55')]({},_0x288a24,_0x33f568[_0x5c16('0x58')]);return db['CannedAnswer'][_0x5c16('0x1f')]({'where':_0x288a24[_0x5c16('0x53')]})[_0x5c16('0x22')](function(_0x446515){_0xf65d83['count']=_0x446515;if(_0x33f568[_0x5c16('0x4a')][_0x5c16('0x70')]){_0x288a24[_0x5c16('0x5a')]=[{'all':!![]}];}return db[_0x5c16('0x74')][_0x5c16('0x5b')](_0x288a24);})[_0x5c16('0x22')](function(_0x53cbce){_0xf65d83[_0x5c16('0x5c')]=_0x53cbce;return _0xf65d83;});}})[_0x5c16('0x22')](respondWithFilteredResult(_0x1f8b54,_0x288a24))[_0x5c16('0x19')](handleError(_0x1f8b54,null));};exports['removeAnswers']=function(_0x2d2e40,_0x42e735){return db[_0x5c16('0x59')][_0x5c16('0x61')]({'where':{'id':_0x2d2e40[_0x5c16('0x5e')]['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x42e735,null))[_0x5c16('0x22')](function(_0xb21b85){if(_0xb21b85){return _0xb21b85[_0x5c16('0x76')](_0x2d2e40[_0x5c16('0x4a')]['ids']);}})[_0x5c16('0x22')](respondWithStatusCode(_0x42e735,null))[_0x5c16('0x19')](handleError(_0x42e735,null));};exports[_0x5c16('0x6a')]=function(_0x20fdba,_0x11ea2e){var _0x199e19={'name':_0x20fdba['body'][_0x5c16('0x28')],'key':_0x20fdba['body'][_0x5c16('0x48')],'provider':_0x20fdba[_0x5c16('0x63')]['provider']==='custom'?null:_0x20fdba[_0x5c16('0x63')]['provider'],'email':_0x20fdba[_0x5c16('0x63')][_0x5c16('0x77')],'ListId':_0x20fdba[_0x5c16('0x63')][_0x5c16('0x78')],'active':!_[_0x5c16('0x79')](_0x20fdba[_0x5c16('0x63')][_0x5c16('0x7a')])?_0x20fdba['body'][_0x5c16('0x7a')]:!![],'description':_0x20fdba[_0x5c16('0x63')][_0x5c16('0x7b')]||null};var _0x20f761=getAuthenticationOptions(_0x199e19[_0x5c16('0x64')],_0x20fdba[_0x5c16('0x63')]);_0x199e19[_0x5c16('0x40')]=_0x20f761['Imap'];_0x199e19[_0x5c16('0x41')]=_0x20f761[_0x5c16('0x41')];return db[_0x5c16('0x59')]['create'](_0x199e19,{'include':[{'model':db[_0x5c16('0x5f')],'as':_0x5c16('0x41')},{'model':db[_0x5c16('0x43')],'as':_0x5c16('0x40')}]})['then'](function(_0x5f48e1){var _0x41e51e=_0x20fdba[_0x5c16('0x35')][_0x5c16('0x7c')]({'plain':!![]});if(!_0x41e51e)throw new Error(_0x5c16('0x7d'));if(_0x41e51e[_0x5c16('0x7e')]===_0x5c16('0x35')){var _0x5003b8=_0x5f48e1[_0x5c16('0x7c')]({'plain':!![]});return db['UserProfileSection'][_0x5c16('0x61')]({'where':{'name':_0x5c16('0x24'),'userProfileId':_0x41e51e[_0x5c16('0x7f')]},'raw':!![]})[_0x5c16('0x22')](function(_0x3dc562){if(_0x3dc562&&_0x3dc562[_0x5c16('0x80')]===0x0){return db[_0x5c16('0x25')][_0x5c16('0x6a')]({'name':_0x5003b8[_0x5c16('0x28')],'resourceId':_0x5003b8['id'],'type':_0x3dc562[_0x5c16('0x28')],'sectionId':_0x3dc562['id']},{})[_0x5c16('0x22')](function(){return _0x5f48e1;});}else{return _0x5f48e1;}})[_0x5c16('0x19')](function(_0x15553b){logger[_0x5c16('0x15')](_0x5c16('0x81'),_0x15553b);throw _0x15553b;});}return _0x5f48e1;})[_0x5c16('0x22')](respondWithResult(_0x11ea2e,0xc9))['catch'](handleError(_0x11ea2e,null));};exports['getImap']=function(_0x1b6d2f,_0x5524ed){return db[_0x5c16('0x59')][_0x5c16('0x6c')]({'where':{'id':_0x1b6d2f[_0x5c16('0x5e')]['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x5524ed,null))['then'](function(_0x4d08df){if(_0x4d08df){return _0x4d08df[_0x5c16('0x82')]();}return null;})[_0x5c16('0x22')](respondWithResult(_0x5524ed,null))['catch'](handleError(_0x5524ed,null));};exports[_0x5c16('0x83')]=function(_0x2c8e8c,_0x16c596){if(_0x2c8e8c[_0x5c16('0x63')]['id']){delete _0x2c8e8c[_0x5c16('0x63')]['id'];}return db[_0x5c16('0x59')][_0x5c16('0x61')]({'where':{'id':_0x2c8e8c[_0x5c16('0x5e')]['id']}})['then'](handleEntityNotFound(_0x16c596,null))['then'](function(_0x33f367){if(_0x33f367){_0x2c8e8c[_0x5c16('0x63')][_0x5c16('0x69')]=_0x33f367['id'];return db['MailServerIn']['create'](_0x2c8e8c[_0x5c16('0x63')]);}})[_0x5c16('0x22')](respondWithResult(_0x16c596,null))[_0x5c16('0x19')](handleError(_0x16c596,null));};exports[_0x5c16('0x84')]=function(_0x180d11,_0x5801c5){return db[_0x5c16('0x59')][_0x5c16('0x6c')]({'where':{'id':_0x180d11[_0x5c16('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5801c5,null))[_0x5c16('0x22')](function(_0x274844){if(_0x274844){return _0x274844['setImap'](null);}return null;})[_0x5c16('0x22')](respondWithStatusCode(_0x5801c5,null))[_0x5c16('0x19')](handleError(_0x5801c5,null));};exports[_0x5c16('0x85')]=function(_0x1a5f0b,_0x5a7942){return db[_0x5c16('0x59')][_0x5c16('0x6c')]({'where':{'id':_0x1a5f0b[_0x5c16('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5a7942,null))[_0x5c16('0x22')](function(_0x2f183f){if(_0x2f183f){return _0x2f183f['getSmtp']();}return null;})['then'](respondWithResult(_0x5a7942,null))['catch'](handleError(_0x5a7942,null));};exports['addSmtp']=function(_0xa8d15a,_0x46621e){if(_0xa8d15a['body']['id']){delete _0xa8d15a[_0x5c16('0x63')]['id'];}return db[_0x5c16('0x59')]['find']({'where':{'id':_0xa8d15a[_0x5c16('0x5e')]['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x46621e,null))['then'](function(_0x491fa8){if(_0x491fa8){_0xa8d15a[_0x5c16('0x63')][_0x5c16('0x69')]=_0x491fa8['id'];return db[_0x5c16('0x5f')]['create'](_0xa8d15a[_0x5c16('0x63')]);}})[_0x5c16('0x22')](respondWithResult(_0x46621e,null))[_0x5c16('0x19')](handleError(_0x46621e,null));};exports['removeSmtp']=function(_0x1b5b08,_0x52fdbd){return db[_0x5c16('0x59')][_0x5c16('0x6c')]({'where':{'id':_0x1b5b08[_0x5c16('0x5e')]['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x52fdbd,null))['then'](function(_0x56f01d){if(_0x56f01d){return _0x56f01d[_0x5c16('0x86')](null);}return null;})['then'](respondWithStatusCode(_0x52fdbd,null))['catch'](handleError(_0x52fdbd,null));};exports[_0x5c16('0x87')]=function(_0x4b2853,_0x3cbe59){return db[_0x5c16('0x88')][_0x5c16('0x61')]({'where':{'id':_0x4b2853[_0x5c16('0x5e')]['id']}})['then'](handleEntityNotFound(_0x3cbe59,null))['then'](function(_0x48b526){if(_0x48b526){return _0x48b526[_0x5c16('0x87')](_0x4b2853[_0x5c16('0x63')][_0x5c16('0x72')],_[_0x5c16('0x89')](_0x4b2853[_0x5c16('0x63')],[_0x5c16('0x72'),'id'])||{});}})[_0x5c16('0x22')](respondWithResult(_0x3cbe59,null))[_0x5c16('0x19')](handleError(_0x3cbe59,null));};exports[_0x5c16('0x8a')]=function(_0x246b55,_0x38e375){var _0x71ab28={'raw':![],'where':{}};var _0x1d9b68={};var _0x4fa9e3={'count':0x0,'rows':[]};return db['MailAccount'][_0x5c16('0x6c')]({'where':{'id':_0x246b55['params']['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x38e375,null))[_0x5c16('0x22')](function(_0x532e08){if(_0x532e08){_0x1d9b68['model']=_[_0x5c16('0x4b')](db[_0x5c16('0x88')]['rawAttributes']);_0x1d9b68[_0x5c16('0x4a')]=_[_0x5c16('0x4b')](_0x246b55[_0x5c16('0x4a')]);_0x1d9b68[_0x5c16('0x4c')]=_[_0x5c16('0x4d')](_0x1d9b68['model'],_0x1d9b68[_0x5c16('0x4a')]);_0x71ab28[_0x5c16('0x4e')]=_['intersection'](_0x1d9b68[_0x5c16('0x49')],qs[_0x5c16('0x4f')](_0x246b55['query'][_0x5c16('0x4f')]));_0x71ab28['attributes']=_0x71ab28['attributes']['length']?_0x71ab28[_0x5c16('0x4e')]:_0x1d9b68[_0x5c16('0x49')];if(!_0x246b55[_0x5c16('0x4a')][_0x5c16('0x50')](_0x5c16('0x6d'))){_0x71ab28[_0x5c16('0x1e')]=qs[_0x5c16('0x1e')](_0x246b55['query']['limit']);_0x71ab28['offset']=qs['offset'](_0x246b55[_0x5c16('0x4a')]['offset']);}_0x71ab28['order']=qs['sort'](_0x246b55[_0x5c16('0x4a')][_0x5c16('0x52')]);_0x71ab28['where']=qs['filters'](_[_0x5c16('0x6e')](_0x246b55[_0x5c16('0x4a')],_0x1d9b68[_0x5c16('0x4c')]));_0x71ab28[_0x5c16('0x53')]['MailAccountId']=_0x532e08['id'];if(_0x246b55[_0x5c16('0x4a')][_0x5c16('0x54')]){_0x71ab28[_0x5c16('0x53')]=_[_0x5c16('0x55')](_0x71ab28[_0x5c16('0x53')],{'$or':_[_0x5c16('0x46')](_0x71ab28[_0x5c16('0x4e')],function(_0x484cb8){var _0x5f4881={};_0x5f4881[_0x484cb8]={'$like':'%'+_0x246b55[_0x5c16('0x4a')][_0x5c16('0x54')]+'%'};return _0x5f4881;})});}_0x71ab28=_[_0x5c16('0x55')]({},_0x71ab28,_0x246b55[_0x5c16('0x58')]);return db[_0x5c16('0x88')][_0x5c16('0x1f')]({'where':_0x71ab28['where']})[_0x5c16('0x22')](function(_0x439187){_0x4fa9e3['count']=_0x439187;if(_0x246b55[_0x5c16('0x4a')][_0x5c16('0x70')]){_0x71ab28['include']=[{'model':db['CmContact'],'as':_0x5c16('0x8b'),'required':![]},{'model':db[_0x5c16('0x8c')],'as':_0x5c16('0x8d'),'attributes':[_0x5c16('0x28'),_0x5c16('0x8e'),'internal'],'required':![]},{'model':db[_0x5c16('0x8f')],'as':_0x5c16('0x90'),'attributes':['id',_0x5c16('0x28'),_0x5c16('0x91')],'where':_0x246b55[_0x5c16('0x4a')][_0x5c16('0x92')]?{'id':_0x246b55[_0x5c16('0x4a')][_0x5c16('0x92')]}:undefined,'required':_0x246b55[_0x5c16('0x4a')][_0x5c16('0x92')]?!![]:![]}];}return db[_0x5c16('0x88')][_0x5c16('0x5b')](_0x71ab28);})[_0x5c16('0x22')](function(_0x5cdbe4){_0x4fa9e3['rows']=_0x5cdbe4;return _0x4fa9e3;});}})['then'](respondWithFilteredResult(_0x38e375,_0x71ab28))['catch'](handleError(_0x38e375,null));};exports[_0x5c16('0x93')]=function addApplications(_0x487f71,_0x162471){var _0x252e60=_0x487f71['params']['id'];var _0x3966d6=_0x487f71[_0x5c16('0x63')];var _0x5c854b=0xc8;var _0x78aa78=null;return db[_0x5c16('0x94')][_0x5c16('0x95')]({'isolationLevel':db[_0x5c16('0x94')][_0x5c16('0x96')]['ISOLATION_LEVELS'][_0x5c16('0x97')]},function(_0x248e15){return db[_0x5c16('0x59')][_0x5c16('0x6c')]({'where':{'id':_0x252e60},'transaction':_0x248e15})[_0x5c16('0x22')](function(_0x44d49c){if(_0x44d49c){return db['MailApplication'][_0x5c16('0x23')]({'where':{'MailAccountId':_0x252e60},'transaction':_0x248e15})[_0x5c16('0x22')](function(){var _0xd200e=_[_0x5c16('0x46')](_0x3966d6,function(_0x2cd40){_0x2cd40[_0x5c16('0x69')]=_0x252e60;return _0x2cd40;});return db[_0x5c16('0x98')][_0x5c16('0x99')](_0xd200e,{'transaction':_0x248e15});});}else{_0x5c854b=0x194;_0x78aa78=[];}});})[_0x5c16('0x22')](function(){if(_0x5c854b!==0x194){return db[_0x5c16('0x98')][_0x5c16('0x9a')]({'where':{'MailAccountId':_0x252e60},'order':_0x5c16('0x9b')})[_0x5c16('0x22')](function(_0xc64041){_0x78aa78=_0xc64041;});}})[_0x5c16('0x19')](function(_0x3c18fa){_0x5c854b=0x1f4;logger[_0x5c16('0x15')](_0x3c18fa[_0x5c16('0x27')]);if(_0x3c18fa['name']){delete _0x3c18fa[_0x5c16('0x28')];}_0x78aa78=_0x3c18fa;})[_0x5c16('0x9c')](function(){if(_0x78aa78===null){_0x162471[_0x5c16('0x9d')](_0x5c854b);}else{if(_0x5c854b===0x1f4){_0x162471[_0x5c16('0x1a')](_0x5c854b)['send'](_0x78aa78);}else{_0x162471['status'](_0x5c854b)[_0x5c16('0x1b')](_0x78aa78);}}});};exports[_0x5c16('0x9e')]=function(_0x16c498,_0x412dd9){var _0x1439bd={};var _0x254989={};var _0x31a32a;var _0xbfcf46;return db[_0x5c16('0x59')][_0x5c16('0x6c')]({'where':{'id':_0x16c498[_0x5c16('0x5e')]['id']}})['then'](handleEntityNotFound(_0x412dd9,null))['then'](function(_0xe27c3){if(_0xe27c3){_0x31a32a=_0xe27c3;_0x254989['model']=_[_0x5c16('0x4b')](db[_0x5c16('0x98')][_0x5c16('0x47')]);_0x254989[_0x5c16('0x4a')]=_[_0x5c16('0x4b')](_0x16c498['query']);_0x254989[_0x5c16('0x4c')]=_['intersection'](_0x254989[_0x5c16('0x49')],_0x254989['query']);_0x1439bd[_0x5c16('0x4e')]=_['intersection'](_0x254989['model'],qs['fields'](_0x16c498[_0x5c16('0x4a')][_0x5c16('0x4f')]));_0x1439bd[_0x5c16('0x4e')]=_0x1439bd['attributes'][_0x5c16('0x60')]?_0x1439bd[_0x5c16('0x4e')]:_0x254989[_0x5c16('0x49')];_0x1439bd['order']=qs[_0x5c16('0x52')](_0x16c498['query']['sort']);_0x1439bd['where']=qs[_0x5c16('0x4c')](_['pick'](_0x16c498[_0x5c16('0x4a')],_0x254989[_0x5c16('0x4c')]));if(_0x16c498[_0x5c16('0x4a')][_0x5c16('0x54')]){_0x1439bd[_0x5c16('0x53')]=_[_0x5c16('0x55')](_0x1439bd[_0x5c16('0x53')],{'$or':_['map'](_0x1439bd[_0x5c16('0x4e')],function(_0x21e0f2){var _0x4e00f1={};_0x4e00f1[_0x21e0f2]={'$like':'%'+_0x16c498[_0x5c16('0x4a')][_0x5c16('0x54')]+'%'};return _0x4e00f1;})});}_0x1439bd=_[_0x5c16('0x55')]({},_0x1439bd,_0x16c498['options']);return _0x31a32a[_0x5c16('0x9e')](_0x1439bd);}})[_0x5c16('0x22')](function(_0x85a8e8){if(_0x85a8e8){_0xbfcf46=_0x85a8e8['length'];if(!_0x16c498['query'][_0x5c16('0x50')]('nolimit')){_0x1439bd[_0x5c16('0x1e')]=qs[_0x5c16('0x1e')](_0x16c498[_0x5c16('0x4a')][_0x5c16('0x1e')]);_0x1439bd['offset']=qs[_0x5c16('0x1c')](_0x16c498[_0x5c16('0x4a')][_0x5c16('0x1c')]);}return _0x31a32a['getApplications'](_0x1439bd);}})[_0x5c16('0x22')](function(_0x19de9b){if(_0x19de9b){return _0x19de9b?{'count':_0xbfcf46,'rows':_0x19de9b}:null;}})['then'](respondWithResult(_0x412dd9,null))[_0x5c16('0x19')](handleError(_0x412dd9,null));};exports[_0x5c16('0x9f')]=function(_0x55538b,_0x54264e){var _0x16089d={'raw':!![],'where':{}};var _0x4b35ff={};var _0x551dfe={'count':0x0,'rows':[]};return db[_0x5c16('0x59')][_0x5c16('0x6c')]({'where':{'id':_0x55538b[_0x5c16('0x5e')]['id']}})['then'](handleEntityNotFound(_0x54264e,null))[_0x5c16('0x22')](function(_0x25529d){if(_0x25529d){_0x4b35ff[_0x5c16('0x49')]=_[_0x5c16('0x4b')](db[_0x5c16('0xa0')]['rawAttributes']);_0x4b35ff[_0x5c16('0x4a')]=_[_0x5c16('0x4b')](_0x55538b[_0x5c16('0x4a')]);_0x4b35ff['filters']=_[_0x5c16('0x4d')](_0x4b35ff[_0x5c16('0x49')],_0x4b35ff[_0x5c16('0x4a')]);_0x16089d['attributes']=_['intersection'](_0x4b35ff[_0x5c16('0x49')],qs['fields'](_0x55538b[_0x5c16('0x4a')][_0x5c16('0x4f')]));_0x16089d[_0x5c16('0x4e')]=_0x16089d[_0x5c16('0x4e')]['length']?_0x16089d['attributes']:_0x4b35ff['model'];if(!_0x55538b['query'][_0x5c16('0x50')](_0x5c16('0x6d'))){_0x16089d[_0x5c16('0x1e')]=qs[_0x5c16('0x1e')](_0x55538b[_0x5c16('0x4a')][_0x5c16('0x1e')]);_0x16089d[_0x5c16('0x1c')]=qs['offset'](_0x55538b['query']['offset']);}_0x16089d[_0x5c16('0x51')]=qs['sort'](_0x55538b[_0x5c16('0x4a')]['sort']);_0x16089d['where']=qs['filters'](_[_0x5c16('0x6e')](_0x55538b[_0x5c16('0x4a')],_0x4b35ff[_0x5c16('0x4c')]));_0x16089d[_0x5c16('0x53')][_0x5c16('0x69')]=_0x25529d['id'];if(_0x55538b[_0x5c16('0x4a')]['filter']){_0x16089d[_0x5c16('0x53')]=_[_0x5c16('0x55')](_0x16089d[_0x5c16('0x53')],{'$or':_[_0x5c16('0x46')](_0x16089d[_0x5c16('0x4e')],function(_0x1cd61b){var _0x3a0baf={};_0x3a0baf[_0x1cd61b]={'$like':'%'+_0x55538b['query']['filter']+'%'};return _0x3a0baf;})});}if(_0x55538b['query'][_0x5c16('0xa1')]){var _0x4f66e9=_0x55538b[_0x5c16('0x4a')][_0x5c16('0xa1')][_0x5c16('0xa2')](',');var _0x54ee37={};_0x54ee37[_0x4f66e9[0x0]]={'$gte':moment(_0x4f66e9[0x1])[_0x5c16('0xa3')](_0x5c16('0xa4'))};_0x16089d[_0x5c16('0x53')]=_[_0x5c16('0x55')](_0x16089d[_0x5c16('0x53')],_0x54ee37);}_0x16089d=_[_0x5c16('0x55')]({},_0x16089d,_0x55538b[_0x5c16('0x58')]);return db[_0x5c16('0xa0')][_0x5c16('0x1f')]({'where':_0x16089d[_0x5c16('0x53')]})[_0x5c16('0x22')](function(_0x4582d8){_0x551dfe[_0x5c16('0x1f')]=_0x4582d8;if(_0x55538b[_0x5c16('0x4a')][_0x5c16('0x70')]){_0x16089d[_0x5c16('0x5a')]=[{'all':!![]}];}return db[_0x5c16('0xa0')]['findAll'](_0x16089d);})[_0x5c16('0x22')](function(_0x43fb4c){if(_0x55538b[_0x5c16('0x4a')]['inlineCss']==='true'){for(var _0x1299b2=0x0;_0x1299b2<_0x43fb4c[_0x5c16('0x60')];_0x1299b2++){_0x43fb4c[_0x1299b2][_0x5c16('0x63')]=juice(_0x43fb4c[_0x1299b2][_0x5c16('0x63')]);}}_0x551dfe[_0x5c16('0x5c')]=_0x43fb4c;return _0x551dfe;});}})['then'](respondWithFilteredResult(_0x54264e,_0x16089d))['catch'](handleError(_0x54264e,null));};exports[_0x5c16('0x29')]=function(_0x1dbd66,_0x17a581){var _0x3aad14,_0x2cf4a6={},_0x37d04a;if(_0x1dbd66[_0x5c16('0x63')]['to']){_0x37d04a=_0x1dbd66[_0x5c16('0x63')]['to']['split'](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x1dbd66[_0x5c16('0x5e')]['id']},'include':[{'model':db[_0x5c16('0xa5')],'as':_0x5c16('0xa6'),'include':[{'model':db[_0x5c16('0xa7')],'as':'Contacts','where':{'email':_0x37d04a},'limit':0x1,'order':[['updatedAt',_0x5c16('0xa8')]]}]},{'model':db['MailServerOut'],'as':_0x5c16('0x41'),'raw':!![],'include':[{'model':db[_0x5c16('0xa9')],'as':'CloudProvider','raw':!![]}]}]})[_0x5c16('0x22')](handleEntityNotFound(_0x17a581,null))['then'](function(_0x19497a){if(!_0x19497a)return;_0x3aad14=_0x19497a;if(!_0x19497a[_0x5c16('0x41')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x5c16('0x79')](_0x1dbd66[_0x5c16('0x63')][_0x5c16('0xaa')])){_0x1dbd66[_0x5c16('0x63')][_0x5c16('0xaa')]=util['format'](_0x5c16('0xab'),_0x19497a['name'],_0x19497a[_0x5c16('0x77')]||_0x19497a[_0x5c16('0x41')]['user']);}if(_0x1dbd66[_0x5c16('0x63')]['attachments']&&_0x1dbd66[_0x5c16('0x63')][_0x5c16('0xac')]['length']){for(var _0x39a0d1=0x0;_0x39a0d1<_0x1dbd66['body'][_0x5c16('0xac')][_0x5c16('0x60')];_0x39a0d1+=0x1){_0x1dbd66[_0x5c16('0x63')][_0x5c16('0xac')][_0x39a0d1]={'filename':_0x1dbd66[_0x5c16('0x63')]['attachments'][_0x39a0d1][_0x5c16('0x28')],'path':path[_0x5c16('0xad')](config[_0x5c16('0xae')],'server/files/attachments',_0x1dbd66[_0x5c16('0x63')][_0x5c16('0xac')][_0x39a0d1]['basename'])};}}var _0x36d60e=_0x19497a[_0x5c16('0xaf')]();return respondWithRpcPromise(_0x5c16('0xb0'),_0x5c16('0xb1'),{'account':_0x36d60e,'message':_0x1dbd66[_0x5c16('0x63')]});})[_0x5c16('0x22')](function(_0x5d6fc3){if(!_0x5d6fc3)return;_0x2cf4a6=_0x5d6fc3;if(!_0x3aad14[_0x5c16('0xa6')])throw new Error(_0x5c16('0xb2'));if(_0x3aad14[_0x5c16('0xa6')][_0x5c16('0xb3')][_0x5c16('0x60')])return _0x3aad14[_0x5c16('0xa6')][_0x5c16('0xb3')][0x0];return db[_0x5c16('0xa7')][_0x5c16('0x6a')](_['defaults'](_0x1dbd66['body'],{'firstName':_0x1dbd66['body']['to'],'email':_0x1dbd66[_0x5c16('0x63')]['to'],'phone':_0x1dbd66[_0x5c16('0x63')]['to'],'ListId':_0x3aad14[_0x5c16('0x78')]}));})[_0x5c16('0x22')](function(_0x1c90a2){if(!_0x1c90a2)return;var _0x21baa0={'UserId':_0x1dbd66[_0x5c16('0x35')]['id'],'ContactId':_0x1c90a2['id'],'MailAccountId':_0x3aad14['id'],'inReplyTo':_0x2cf4a6[_0x5c16('0xb4')],'to':_0x1dbd66[_0x5c16('0x63')][_0x5c16('0xaa')],'cc':_0x1dbd66[_0x5c16('0x63')]['cc'],'subject':_0x1dbd66[_0x5c16('0x63')][_0x5c16('0xb5')],'attach':_0x1dbd66['body']['attach'],'firstMsgDirection':'out','lastMsgAt':moment()[_0x5c16('0xa3')](_0x5c16('0xa4')),'lastMsgDirection':_0x5c16('0xb6'),'Messages':[_['merge'](_0x1dbd66['body'],{'messageId':_0x2cf4a6[_0x5c16('0xb4')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x3aad14['id'],'UserId':_0x1dbd66[_0x5c16('0x35')]['id'],'ContactId':_0x1c90a2['id']})]};if(_0x1dbd66[_0x5c16('0x63')][_0x5c16('0xb7')]){_0x21baa0=_[_0x5c16('0x55')](_0x21baa0,_0x1dbd66[_0x5c16('0x63')][_0x5c16('0xb7')]);}return db['MailInteraction']['create'](_0x21baa0,{'include':[{'model':db[_0x5c16('0xa0')],'as':'Messages'}]});})[_0x5c16('0x22')](respondWithResult(_0x17a581,null))[_0x5c16('0x19')](handleError(_0x17a581,null));};exports[_0x5c16('0xb8')]=function(_0x157eff,_0xc51bd){return db[_0x5c16('0x59')][_0x5c16('0x61')]({'where':{'id':_0x157eff[_0x5c16('0x5e')]['id']},'include':[{'model':db[_0x5c16('0x5f')],'as':_0x5c16('0x41'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x5c16('0xa9'),'raw':!![]}]}]})[_0x5c16('0x22')](handleEntityNotFound(_0xc51bd,null))[_0x5c16('0x22')](function(_0x4603b0){if(!_0x4603b0[_0x5c16('0x41')])return;var _0x1c049a=_0x4603b0[_0x5c16('0xaf')]();return respondWithRpcPromise('VerifySmtp',_0x5c16('0xb8'),{'account':_0x1c049a});})['then'](respondWithResult(_0xc51bd,null))[_0x5c16('0x19')](handleError(_0xc51bd,null));};exports[_0x5c16('0x23')]=function(_0x4af299,_0x580b15){return db[_0x5c16('0x59')][_0x5c16('0x61')]({'where':{'id':_0x4af299[_0x5c16('0x5e')]['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x580b15,null))['then'](function(_0x5ddb51){if(_0x5ddb51&&_0x5ddb51[_0x5c16('0x3e')]){throw new db['Sequelize']['ValidationError'](_0x5c16('0xb9'));}return _0x5ddb51;})[_0x5c16('0x22')](removeEntity(_0x580b15,null))['catch'](handleError(_0x580b15,null));};exports['addAgents']=function(_0x58ccc8,_0x5f0a63){return db[_0x5c16('0x59')]['find']({'where':{'id':_0x58ccc8[_0x5c16('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5f0a63,null))[_0x5c16('0x22')](function(_0x1442e0){if(_0x1442e0){return _0x1442e0[_0x5c16('0xba')](_0x58ccc8[_0x5c16('0x63')][_0x5c16('0x72')],_[_0x5c16('0x89')](_0x58ccc8[_0x5c16('0x63')],[_0x5c16('0x72'),'id'])||{})[_0x5c16('0xbb')](function(_0xaa4726){for(var _0x115e52=0x0;_0x115e52<_0x58ccc8['body'][_0x5c16('0x72')]['length'];_0x115e52+=0x1){socket[_0x5c16('0xbc')](_0x5c16('0xbd'),{'UserId':Number(_0x58ccc8[_0x5c16('0x63')]['ids'][_0x115e52]),'MailAccountId':Number(_0x58ccc8[_0x5c16('0x5e')]['id'])});}return _0xaa4726;});}})[_0x5c16('0x22')](respondWithResult(_0x5f0a63,null))[_0x5c16('0x19')](handleError(_0x5f0a63,null));};exports['removeAgents']=function(_0x48b836,_0x2b7047){return db[_0x5c16('0x59')][_0x5c16('0x61')]({'where':{'id':_0x48b836[_0x5c16('0x5e')]['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x2b7047,null))['then'](function(_0x3158c3){if(_0x3158c3){return _0x3158c3[_0x5c16('0xbe')](_0x48b836[_0x5c16('0x4a')]['ids'])[_0x5c16('0x22')](function(){if(_['isArray'](_0x48b836['query']['ids'])){for(var _0x247d50=0x0;_0x247d50<_0x48b836['query'][_0x5c16('0x72')][_0x5c16('0x60')];_0x247d50+=0x1){socket['emit'](_0x5c16('0xbf'),{'UserId':Number(_0x48b836[_0x5c16('0x4a')]['ids'][_0x247d50]),'MailAccountId':Number(_0x48b836[_0x5c16('0x5e')]['id'])});}}else{socket[_0x5c16('0xbc')](_0x5c16('0xbf'),{'UserId':Number(_0x48b836[_0x5c16('0x4a')][_0x5c16('0x72')]),'MailAccountId':Number(_0x48b836[_0x5c16('0x5e')]['id'])});}});}})[_0x5c16('0x22')](respondWithStatusCode(_0x2b7047,null))[_0x5c16('0x19')](handleError(_0x2b7047,null));};exports[_0x5c16('0xc0')]=function(_0x380248,_0x477c1e){var _0x31b752={};var _0x22671e={};var _0x1766a3;var _0x50139e;return db[_0x5c16('0x59')]['findOne']({'where':{'id':_0x380248[_0x5c16('0x5e')]['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x477c1e,null))['then'](function(_0x439e2e){if(_0x439e2e){_0x1766a3=_0x439e2e;_0x22671e[_0x5c16('0x49')]=_['keys'](db[_0x5c16('0x8c')][_0x5c16('0x47')]);_0x22671e['query']=_[_0x5c16('0x4b')](_0x380248[_0x5c16('0x4a')]);_0x22671e[_0x5c16('0x4c')]=_[_0x5c16('0x4d')](_0x22671e['model'],_0x22671e[_0x5c16('0x4a')]);_0x31b752[_0x5c16('0x4e')]=_[_0x5c16('0x4d')](_0x22671e[_0x5c16('0x49')],qs[_0x5c16('0x4f')](_0x380248[_0x5c16('0x4a')][_0x5c16('0x4f')]));_0x31b752['attributes']=_0x31b752[_0x5c16('0x4e')][_0x5c16('0x60')]?_0x31b752['attributes']:_0x22671e[_0x5c16('0x49')];_0x31b752[_0x5c16('0x51')]=qs[_0x5c16('0x52')](_0x380248[_0x5c16('0x4a')]['sort']);_0x31b752[_0x5c16('0x53')]=qs[_0x5c16('0x4c')](_[_0x5c16('0x6e')](_0x380248['query'],_0x22671e[_0x5c16('0x4c')]));if(_0x380248['query'][_0x5c16('0x54')]){_0x31b752[_0x5c16('0x53')]=_[_0x5c16('0x55')](_0x31b752[_0x5c16('0x53')],{'$or':_[_0x5c16('0x46')](_0x31b752[_0x5c16('0x4e')],function(_0x2b4e85){var _0x1e0664={};_0x1e0664[_0x2b4e85]={'$like':'%'+_0x380248[_0x5c16('0x4a')][_0x5c16('0x54')]+'%'};return _0x1e0664;})});}_0x31b752=_[_0x5c16('0x55')]({},_0x31b752,_0x380248[_0x5c16('0x58')]);return _0x1766a3[_0x5c16('0xc0')](_0x31b752);}})[_0x5c16('0x22')](function(_0x213f97){if(_0x213f97){_0x50139e=_0x213f97[_0x5c16('0x60')];if(!_0x380248[_0x5c16('0x4a')][_0x5c16('0x50')](_0x5c16('0x6d'))){_0x31b752[_0x5c16('0x1e')]=qs[_0x5c16('0x1e')](_0x380248[_0x5c16('0x4a')][_0x5c16('0x1e')]);_0x31b752[_0x5c16('0x1c')]=qs[_0x5c16('0x1c')](_0x380248[_0x5c16('0x4a')]['offset']);}return _0x1766a3['getAgents'](_0x31b752);}})[_0x5c16('0x22')](function(_0x359eb8){if(_0x359eb8){return _0x359eb8?{'count':_0x50139e,'rows':_0x359eb8}:null;}})['then'](respondWithResult(_0x477c1e,null))['catch'](handleError(_0x477c1e,null));}; \ No newline at end of file +var _0x4029=['authentication','user','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','map','MailAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','includeAll','findAll','rows','show','mandatoryDispositionPause','rawAttributes','include','options','find','body','provider','params','describe','MailAccountId','Disposition','create','getDispositions','findOne','order','removeDispositions','addAnswer','CannedAnswer','getAnswers','pick','ids','ListId','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','MailApplication','findAndCountAll','priority','finally','send','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','%s\x20<%s>','email','attachments','join','server/files/attachments','basename','sendMail','List\x20not\x20found','List','messageId','subject','attach','out','Interaction','Messages','getSmtpOptions','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','MailAccounts','stack','name','gmail','hotmail','imap-mail.outlook.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp.office365.com','password','modernAuthentication','CloudProviderId','pass','host','port','secure','service'];(function(_0xd2f4ac,_0x5aa8e5){var _0x9757b2=function(_0x442ced){while(--_0x442ced){_0xd2f4ac['push'](_0xd2f4ac['shift']());}};_0x9757b2(++_0x5aa8e5);}(_0x4029,0x13f));var _0x9402=function(_0x2bfdde,_0x400692){_0x2bfdde=_0x2bfdde-0x0;var _0x38c564=_0x4029[_0x2bfdde];return _0x38c564;};'use strict';var moment=require(_0x9402('0x0'));var BPromise=require('bluebird');var util=require(_0x9402('0x1'));var path=require(_0x9402('0x2'));var _=require(_0x9402('0x3'));var juice=require(_0x9402('0x4'));var Redis=require(_0x9402('0x5'));var qs=require(_0x9402('0x6'));var logger=require(_0x9402('0x7'))(_0x9402('0x8'));var config=require(_0x9402('0x9'));var db=require('../../mysqldb')['db'];config[_0x9402('0xa')]=_[_0x9402('0xb')](config[_0x9402('0xa')],{'host':_0x9402('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9402('0xa')]));require(_0x9402('0xd'))[_0x9402('0xe')](socket);var jayson=require(_0x9402('0xf'));var client=jayson[_0x9402('0x10')][_0x9402('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x4a3caf,_0x5a45aa,_0x2091ae,_0x4e82ae){return new BPromise(function(_0x549466,_0xf3f7be){var _0x3b9c88=_0x4e82ae||client;return _0x3b9c88[_0x9402('0x12')](_0x4a3caf,_0x2091ae)[_0x9402('0x13')](function(_0x1586be){logger[_0x9402('0x14')]('MailAccount,\x20%s,\x20%s',_0x5a45aa,_0x9402('0x15'));logger[_0x9402('0x16')](_0x9402('0x17'),_0x5a45aa,_0x9402('0x15'),JSON[_0x9402('0x18')](_0x1586be));if(_0x1586be[_0x9402('0x19')]){if(_0x1586be[_0x9402('0x19')]['code']===0x1f4){logger[_0x9402('0x19')](_0x9402('0x1a'),_0x5a45aa,_0x1586be['error'][_0x9402('0x1b')]);return _0xf3f7be(_0x1586be[_0x9402('0x19')][_0x9402('0x1b')]);}logger['error'](_0x9402('0x1a'),_0x5a45aa,_0x1586be[_0x9402('0x19')][_0x9402('0x1b')]);return _0x549466(_0x1586be[_0x9402('0x19')][_0x9402('0x1b')]);}else{logger[_0x9402('0x14')](_0x9402('0x1a'),_0x5a45aa,'request\x20sent');_0x549466(_0x1586be[_0x9402('0x1c')][_0x9402('0x1b')]);}})[_0x9402('0x1d')](function(_0x120a32){logger[_0x9402('0x19')]('MailAccount,\x20%s,\x20%s',_0x5a45aa,_0x120a32);_0xf3f7be(_0x120a32);});});}function respondWithStatusCode(_0x187764,_0x9101ec){_0x9101ec=_0x9101ec||0xcc;return function(_0x3cf50e){if(_0x3cf50e){return _0x187764[_0x9402('0x1e')](_0x9101ec);}return _0x187764[_0x9402('0x1f')](_0x9101ec)[_0x9402('0x20')]();};}function respondWithResult(_0x307124,_0x177b25){_0x177b25=_0x177b25||0xc8;return function(_0x810bb8){if(_0x810bb8){return _0x307124[_0x9402('0x1f')](_0x177b25)[_0x9402('0x21')](_0x810bb8);}};}function respondWithFilteredResult(_0x118495,_0x3c0366){return function(_0x730a00){if(_0x730a00){var _0x2efb0a=typeof _0x3c0366[_0x9402('0x22')]===_0x9402('0x23')&&typeof _0x3c0366[_0x9402('0x24')]===_0x9402('0x23');var _0x3b4134=_0x730a00[_0x9402('0x25')];var _0xff0bcd=_0x2efb0a?0x0:_0x3c0366[_0x9402('0x22')];var _0x1ad42d=_0x2efb0a?_0x730a00[_0x9402('0x25')]:_0x3c0366[_0x9402('0x22')]+_0x3c0366[_0x9402('0x24')];var _0x1a3c32;if(_0x1ad42d>=_0x3b4134){_0x1ad42d=_0x3b4134;_0x1a3c32=0xc8;}else{_0x1a3c32=0xce;}_0x118495['status'](_0x1a3c32);return _0x118495[_0x9402('0x26')](_0x9402('0x27'),_0xff0bcd+'-'+_0x1ad42d+'/'+_0x3b4134)[_0x9402('0x21')](_0x730a00);}return null;};}function saveUpdates(_0x2bc913){return function(_0x27a4bd){if(_0x27a4bd){return _0x27a4bd['update'](_0x2bc913)[_0x9402('0x13')](function(_0x1b26b8){return _0x1b26b8;});}return null;};}function removeEntity(_0x381a6b){return function(_0x112313){if(_0x112313){return _0x112313[_0x9402('0x28')]()['then'](function(){var _0x4a8dff=_0x112313['get']({'plain':!![]});var _0x9e82b5=_0x9402('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x9e82b5,'resourceId':_0x4a8dff['id']}})[_0x9402('0x13')](function(){return _0x112313;});})[_0x9402('0x13')](function(){_0x381a6b[_0x9402('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0xeb9cd9){return function(_0xb7a692){if(!_0xb7a692){_0xeb9cd9[_0x9402('0x1e')](0x194);}return _0xb7a692;};}function handleError(_0x373a11,_0x5d5dbd){_0x5d5dbd=_0x5d5dbd||0x1f4;return function(_0x298c14){logger[_0x9402('0x19')](_0x298c14[_0x9402('0x2a')]);if(_0x298c14['name']){delete _0x298c14[_0x9402('0x2b')];}_0x373a11[_0x9402('0x1f')](_0x5d5dbd)['send'](_0x298c14);};}function getImapHost(_0x3ad23d){switch(_0x3ad23d){case _0x9402('0x2c'):return'imap.gmail.com';case'yahoo':return'imap.mail.yahoo.com';case _0x9402('0x2d'):return _0x9402('0x2e');case'outlook365':return'outlook.office365.com';}throw new Error(_0x9402('0x2f'),_0x3ad23d);}function getSmtpHost(_0x2f1a56){switch(_0x2f1a56){case _0x9402('0x2c'):return _0x9402('0x30');case'yahoo':return _0x9402('0x31');case _0x9402('0x2d'):return'smtp-mail.outlook.com';case'outlook365':return _0x9402('0x32');}throw new Error(_0x9402('0x2f'),_0x2f1a56);}function getAuthenticationOptions(_0x31b1dc,_0xf1b569){var _0x162ff2={};var _0x65d705={};if(_0x31b1dc){_0x162ff2['user']=_0x65d705['user']=_0xf1b569['username'];_0x162ff2['password']=_0x65d705['pass']=_0xf1b569[_0x9402('0x33')];if(_0xf1b569[_0x9402('0x34')]){_0x162ff2[_0x9402('0x34')]=_0x65d705[_0x9402('0x34')]=!![];_0x162ff2[_0x9402('0x35')]=_0x65d705[_0x9402('0x35')]=_0xf1b569[_0x9402('0x35')];_0x162ff2[_0x9402('0x33')]=_0x65d705[_0x9402('0x36')]=null;}else{_0x162ff2[_0x9402('0x35')]=_0x65d705[_0x9402('0x35')]=null;}_0x162ff2[_0x9402('0x37')]=getImapHost(_0x31b1dc);_0x162ff2[_0x9402('0x38')]=0x3e1;_0x65d705[_0x9402('0x37')]=getSmtpHost(_0x31b1dc);_0x65d705[_0x9402('0x38')]=0x24b;_0x65d705[_0x9402('0x39')]=![];_0x162ff2[_0x9402('0x3a')]=_0x65d705[_0x9402('0x3a')]=null;}else{if(_0xf1b569[_0x9402('0x3b')]){_0x162ff2[_0x9402('0x3c')]=_0x65d705[_0x9402('0x3c')]=_0xf1b569['username'];_0x162ff2[_0x9402('0x33')]=_0x65d705[_0x9402('0x36')]=_0xf1b569['password'];}else{_0x162ff2[_0x9402('0x3b')]=_0x65d705[_0x9402('0x3b')]=![];_0x162ff2[_0x9402('0x3c')]=_0x65d705[_0x9402('0x3c')]=null;_0x162ff2[_0x9402('0x33')]=_0x65d705[_0x9402('0x36')]=null;}_0x162ff2['host']=_0xf1b569[_0x9402('0x3d')]['host'];_0x162ff2[_0x9402('0x38')]=_0xf1b569[_0x9402('0x3d')][_0x9402('0x38')];_0x65d705['host']=_0xf1b569['Smtp']['host'];_0x65d705['port']=_0xf1b569[_0x9402('0x3e')][_0x9402('0x38')];}return{'Imap':_0x162ff2,'Smtp':_0x65d705};}exports[_0x9402('0x3f')]=function(_0x21e9ea,_0x47fa44){var _0x4d427f={'include':[{'model':db[_0x9402('0x40')],'as':_0x9402('0x3d')},{'model':db[_0x9402('0x41')],'as':_0x9402('0x3e')},{'model':db[_0x9402('0x42')],'as':'mandatoryDispositionPause'}]},_0x298e78={},_0x482b27={'count':0x0,'rows':[]};var _0x11782b=_[_0x9402('0x43')](db[_0x9402('0x44')]['rawAttributes'],function(_0x115348){return{'name':_0x115348[_0x9402('0x45')],'type':_0x115348[_0x9402('0x46')][_0x9402('0x47')]};});_0x298e78[_0x9402('0x48')]=_[_0x9402('0x43')](_0x11782b,'name');_0x298e78[_0x9402('0x49')]=_[_0x9402('0x4a')](_0x21e9ea[_0x9402('0x49')]);_0x298e78[_0x9402('0x4b')]=_[_0x9402('0x4c')](_0x298e78[_0x9402('0x48')],_0x298e78['query']);_0x4d427f[_0x9402('0x4d')]=_['intersection'](_0x298e78[_0x9402('0x48')],qs[_0x9402('0x4e')](_0x21e9ea[_0x9402('0x49')][_0x9402('0x4e')]));_0x4d427f[_0x9402('0x4d')]=_0x4d427f[_0x9402('0x4d')][_0x9402('0x4f')]?_0x4d427f[_0x9402('0x4d')]:_0x298e78[_0x9402('0x48')];if(!_0x21e9ea['query'][_0x9402('0x50')](_0x9402('0x51'))){_0x4d427f[_0x9402('0x24')]=qs[_0x9402('0x24')](_0x21e9ea[_0x9402('0x49')][_0x9402('0x24')]);_0x4d427f[_0x9402('0x22')]=qs[_0x9402('0x22')](_0x21e9ea[_0x9402('0x49')]['offset']);}_0x4d427f['order']=qs[_0x9402('0x52')](_0x21e9ea[_0x9402('0x49')][_0x9402('0x52')]);_0x4d427f[_0x9402('0x53')]=qs['filters'](_['pick'](_0x21e9ea[_0x9402('0x49')],_0x298e78[_0x9402('0x4b')]),_0x11782b);if(_0x21e9ea[_0x9402('0x49')][_0x9402('0x54')]){_0x4d427f[_0x9402('0x53')]=_['merge'](_0x4d427f[_0x9402('0x53')],{'$or':_['map'](_0x11782b,function(_0x42f2d6){if(_0x42f2d6[_0x9402('0x46')]!==_0x9402('0x55')){var _0x4c08c7={};_0x4c08c7[_0x42f2d6['name']]={'$like':'%'+_0x21e9ea['query'][_0x9402('0x54')]+'%'};return _0x4c08c7;}})});}_0x4d427f=_[_0x9402('0x56')]({},_0x4d427f,_0x21e9ea['options']);var _0x90575b={'where':_0x4d427f[_0x9402('0x53')]};return db['MailAccount']['count'](_0x90575b)[_0x9402('0x13')](function(_0x403e0e){_0x482b27[_0x9402('0x25')]=_0x403e0e;if(_0x21e9ea[_0x9402('0x49')][_0x9402('0x57')]){_0x4d427f['include']=[{'all':!![]}];}return db[_0x9402('0x44')][_0x9402('0x58')](_0x4d427f);})[_0x9402('0x13')](function(_0x5a0267){_0x482b27[_0x9402('0x59')]=_0x5a0267;return _0x482b27;})[_0x9402('0x13')](respondWithFilteredResult(_0x47fa44,_0x4d427f))['catch'](handleError(_0x47fa44,null));};exports[_0x9402('0x5a')]=function(_0x2806d6,_0x2be544){var _0x4e4b3e={'raw':![],'where':{'id':_0x2806d6['params']['id']},'include':[{'model':db[_0x9402('0x40')],'as':_0x9402('0x3d')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x9402('0x42')],'as':_0x9402('0x5b')}]},_0x44ee23={};_0x44ee23['model']=_[_0x9402('0x4a')](db[_0x9402('0x44')][_0x9402('0x5c')]);_0x44ee23[_0x9402('0x49')]=_[_0x9402('0x4a')](_0x2806d6[_0x9402('0x49')]);_0x44ee23[_0x9402('0x4b')]=_[_0x9402('0x4c')](_0x44ee23[_0x9402('0x48')],_0x44ee23[_0x9402('0x49')]);_0x4e4b3e[_0x9402('0x4d')]=_['intersection'](_0x44ee23[_0x9402('0x48')],qs['fields'](_0x2806d6[_0x9402('0x49')]['fields']));_0x4e4b3e['attributes']=_0x4e4b3e[_0x9402('0x4d')][_0x9402('0x4f')]?_0x4e4b3e[_0x9402('0x4d')]:_0x44ee23[_0x9402('0x48')];if(_0x2806d6['query']['includeAll']){_0x4e4b3e[_0x9402('0x5d')]=[{'all':!![]}];}_0x4e4b3e=_[_0x9402('0x56')]({},_0x4e4b3e,_0x2806d6[_0x9402('0x5e')]);return db[_0x9402('0x44')][_0x9402('0x5f')](_0x4e4b3e)[_0x9402('0x13')](handleEntityNotFound(_0x2be544,null))[_0x9402('0x13')](respondWithResult(_0x2be544,null))[_0x9402('0x1d')](handleError(_0x2be544,null));};exports['update']=function(_0x10f437,_0xf651f9){if(_0x10f437[_0x9402('0x60')]['id']){delete _0x10f437['body']['id'];}var _0x5c1482=_0x10f437[_0x9402('0x60')][_0x9402('0x61')]==='custom'?null:_0x10f437['body']['provider'];var _0x377632=_0x10f437['body']['Imap']||{};var _0x3c114e=_0x10f437[_0x9402('0x60')]['Smtp']||{};if(_0x5c1482){_0x377632[_0x9402('0x37')]=getImapHost(_0x5c1482);_0x377632['port']=0x3e1;_0x3c114e['host']=getSmtpHost(_0x5c1482);_0x3c114e[_0x9402('0x38')]=0x24b;_0x3c114e[_0x9402('0x39')]=![];}if(_0x3c114e[_0x9402('0x34')]){_0x3c114e[_0x9402('0x39')]=![];}else{_0x3c114e[_0x9402('0x35')]=null;}if(!_0x377632['modernAuthentication'])_0x377632[_0x9402('0x35')]=null;_0x10f437[_0x9402('0x60')]['Imap']=_0x377632;_0x10f437[_0x9402('0x60')][_0x9402('0x3e')]=_0x3c114e;return db[_0x9402('0x44')][_0x9402('0x5f')]({'where':{'id':_0x10f437[_0x9402('0x62')]['id']},'include':[{'model':db[_0x9402('0x40')],'as':_0x9402('0x3d')},{'model':db[_0x9402('0x41')],'as':'Smtp'},{'model':db[_0x9402('0x42')],'as':_0x9402('0x5b')}]})[_0x9402('0x13')](handleEntityNotFound(_0xf651f9,null))[_0x9402('0x13')](function(_0x2d0a42){if(!_0x2d0a42)throw new Error('Mail\x20Account\x20not\x20found');if(_0x2d0a42[_0x9402('0x3a')])delete _0x10f437[_0x9402('0x60')][_0x9402('0x3d')];return _0x2d0a42;})[_0x9402('0x13')](saveUpdates(_0x10f437[_0x9402('0x60')],null))['then'](function(_0x24ece3){if(!_0x10f437[_0x9402('0x60')][_0x9402('0x3d')])return _0x24ece3;return db[_0x9402('0x40')]['update'](_0x10f437['body']['Imap'],{'where':{'MailAccountId':_0x24ece3['id']}})['then'](function(){return _0x24ece3;});})[_0x9402('0x13')](function(_0x576bd9){if(!_0x10f437[_0x9402('0x60')][_0x9402('0x3e')])return _0x576bd9;return db[_0x9402('0x41')]['update'](_0x10f437['body'][_0x9402('0x3e')],{'where':{'MailAccountId':_0x576bd9['id']}})['then'](function(){return _0x576bd9;});})[_0x9402('0x13')](respondWithResult(_0xf651f9,null))[_0x9402('0x1d')](handleError(_0xf651f9,null));};exports[_0x9402('0x63')]=function(_0x552b73,_0x2858c6){return db[_0x9402('0x44')][_0x9402('0x63')]()[_0x9402('0x13')](respondWithResult(_0x2858c6,null))[_0x9402('0x1d')](handleError(_0x2858c6,null));};exports['addDisposition']=function(_0x59820f,_0x15a84a){if(_0x59820f[_0x9402('0x60')]['id']){delete _0x59820f['body']['id'];}return db[_0x9402('0x44')][_0x9402('0x5f')]({'where':{'id':_0x59820f[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x15a84a,null))[_0x9402('0x13')](function(_0xb0814a){if(_0xb0814a){_0x59820f[_0x9402('0x60')][_0x9402('0x64')]=_0xb0814a['id'];return db[_0x9402('0x65')][_0x9402('0x66')](_0x59820f[_0x9402('0x60')]);}})[_0x9402('0x13')](respondWithResult(_0x15a84a,null))['catch'](handleError(_0x15a84a,null));};exports[_0x9402('0x67')]=function(_0x1f71ff,_0x6b9111){var _0x3db21d={'raw':![],'where':{}};var _0x3940e3={};var _0x2e37be={'count':0x0,'rows':[]};return db[_0x9402('0x44')][_0x9402('0x68')]({'where':{'id':_0x1f71ff['params']['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x6b9111,null))[_0x9402('0x13')](function(_0x37eca3){if(_0x37eca3){_0x3940e3[_0x9402('0x48')]=_[_0x9402('0x4a')](db[_0x9402('0x65')][_0x9402('0x5c')]);_0x3940e3[_0x9402('0x49')]=_[_0x9402('0x4a')](_0x1f71ff[_0x9402('0x49')]);_0x3940e3[_0x9402('0x4b')]=_[_0x9402('0x4c')](_0x3940e3[_0x9402('0x48')],_0x3940e3['query']);_0x3db21d['attributes']=_[_0x9402('0x4c')](_0x3940e3['model'],qs[_0x9402('0x4e')](_0x1f71ff[_0x9402('0x49')][_0x9402('0x4e')]));_0x3db21d['attributes']=_0x3db21d['attributes'][_0x9402('0x4f')]?_0x3db21d['attributes']:_0x3940e3[_0x9402('0x48')];if(!_0x1f71ff[_0x9402('0x49')][_0x9402('0x50')](_0x9402('0x51'))){_0x3db21d[_0x9402('0x24')]=qs[_0x9402('0x24')](_0x1f71ff[_0x9402('0x49')][_0x9402('0x24')]);_0x3db21d[_0x9402('0x22')]=qs[_0x9402('0x22')](_0x1f71ff[_0x9402('0x49')]['offset']);}_0x3db21d[_0x9402('0x69')]=qs[_0x9402('0x52')](_0x1f71ff[_0x9402('0x49')][_0x9402('0x52')]);_0x3db21d[_0x9402('0x53')]=qs['filters'](_['pick'](_0x1f71ff[_0x9402('0x49')],_0x3940e3[_0x9402('0x4b')]));_0x3db21d['where'][_0x9402('0x64')]=_0x37eca3['id'];if(_0x1f71ff[_0x9402('0x49')]['filter']){_0x3db21d['where']=_[_0x9402('0x56')](_0x3db21d[_0x9402('0x53')],{'$or':_[_0x9402('0x43')](_0x3db21d[_0x9402('0x4d')],function(_0xa8fbb1){var _0x481401={};_0x481401[_0xa8fbb1]={'$like':'%'+_0x1f71ff['query'][_0x9402('0x54')]+'%'};return _0x481401;})});}_0x3db21d=_[_0x9402('0x56')]({},_0x3db21d,_0x1f71ff[_0x9402('0x5e')]);return db[_0x9402('0x65')][_0x9402('0x25')]({'where':_0x3db21d[_0x9402('0x53')]})[_0x9402('0x13')](function(_0xb6afad){_0x2e37be[_0x9402('0x25')]=_0xb6afad;if(_0x1f71ff['query'][_0x9402('0x57')]){_0x3db21d[_0x9402('0x5d')]=[{'all':!![]}];}return db[_0x9402('0x65')]['findAll'](_0x3db21d);})[_0x9402('0x13')](function(_0x47ef23){_0x2e37be[_0x9402('0x59')]=_0x47ef23;return _0x2e37be;});}})[_0x9402('0x13')](respondWithFilteredResult(_0x6b9111,_0x3db21d))['catch'](handleError(_0x6b9111,null));};exports[_0x9402('0x6a')]=function(_0x1cf6ef,_0x8c26c4){return db[_0x9402('0x44')][_0x9402('0x5f')]({'where':{'id':_0x1cf6ef[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x8c26c4,null))[_0x9402('0x13')](function(_0x138453){if(_0x138453){return _0x138453[_0x9402('0x6a')](_0x1cf6ef[_0x9402('0x49')]['ids']);}})[_0x9402('0x13')](respondWithStatusCode(_0x8c26c4,null))[_0x9402('0x1d')](handleError(_0x8c26c4,null));};exports[_0x9402('0x6b')]=function(_0x2785db,_0x141901){if(_0x2785db['body']['id']){delete _0x2785db['body']['id'];}return db[_0x9402('0x44')][_0x9402('0x5f')]({'where':{'id':_0x2785db[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x141901,null))[_0x9402('0x13')](function(_0x183f09){if(_0x183f09){_0x2785db[_0x9402('0x60')][_0x9402('0x64')]=_0x183f09['id'];return db[_0x9402('0x6c')][_0x9402('0x66')](_0x2785db[_0x9402('0x60')]);}})['then'](respondWithResult(_0x141901,null))[_0x9402('0x1d')](handleError(_0x141901,null));};exports[_0x9402('0x6d')]=function(_0x234090,_0x39e4d3){var _0x32e9b0={'raw':![],'where':{}};var _0x13a4cf={};var _0xbc38ef={'count':0x0,'rows':[]};return db[_0x9402('0x44')][_0x9402('0x68')]({'where':{'id':_0x234090[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x39e4d3,null))['then'](function(_0x19ed64){if(_0x19ed64){_0x13a4cf[_0x9402('0x48')]=_[_0x9402('0x4a')](db[_0x9402('0x6c')][_0x9402('0x5c')]);_0x13a4cf[_0x9402('0x49')]=_[_0x9402('0x4a')](_0x234090['query']);_0x13a4cf['filters']=_[_0x9402('0x4c')](_0x13a4cf[_0x9402('0x48')],_0x13a4cf[_0x9402('0x49')]);_0x32e9b0[_0x9402('0x4d')]=_[_0x9402('0x4c')](_0x13a4cf[_0x9402('0x48')],qs[_0x9402('0x4e')](_0x234090[_0x9402('0x49')][_0x9402('0x4e')]));_0x32e9b0['attributes']=_0x32e9b0[_0x9402('0x4d')][_0x9402('0x4f')]?_0x32e9b0['attributes']:_0x13a4cf['model'];if(!_0x234090['query'][_0x9402('0x50')](_0x9402('0x51'))){_0x32e9b0[_0x9402('0x24')]=qs[_0x9402('0x24')](_0x234090['query'][_0x9402('0x24')]);_0x32e9b0['offset']=qs[_0x9402('0x22')](_0x234090['query'][_0x9402('0x22')]);}_0x32e9b0['order']=qs[_0x9402('0x52')](_0x234090['query']['sort']);_0x32e9b0[_0x9402('0x53')]=qs[_0x9402('0x4b')](_[_0x9402('0x6e')](_0x234090[_0x9402('0x49')],_0x13a4cf[_0x9402('0x4b')]));_0x32e9b0[_0x9402('0x53')][_0x9402('0x64')]=_0x19ed64['id'];if(_0x234090['query'][_0x9402('0x54')]){_0x32e9b0[_0x9402('0x53')]=_['merge'](_0x32e9b0[_0x9402('0x53')],{'$or':_[_0x9402('0x43')](_0x32e9b0[_0x9402('0x4d')],function(_0x1f47ba){var _0x4d2a7b={};_0x4d2a7b[_0x1f47ba]={'$like':'%'+_0x234090[_0x9402('0x49')]['filter']+'%'};return _0x4d2a7b;})});}_0x32e9b0=_[_0x9402('0x56')]({},_0x32e9b0,_0x234090[_0x9402('0x5e')]);return db['CannedAnswer'][_0x9402('0x25')]({'where':_0x32e9b0[_0x9402('0x53')]})[_0x9402('0x13')](function(_0x488804){_0xbc38ef[_0x9402('0x25')]=_0x488804;if(_0x234090[_0x9402('0x49')][_0x9402('0x57')]){_0x32e9b0[_0x9402('0x5d')]=[{'all':!![]}];}return db[_0x9402('0x6c')]['findAll'](_0x32e9b0);})[_0x9402('0x13')](function(_0x1e781e){_0xbc38ef[_0x9402('0x59')]=_0x1e781e;return _0xbc38ef;});}})['then'](respondWithFilteredResult(_0x39e4d3,_0x32e9b0))[_0x9402('0x1d')](handleError(_0x39e4d3,null));};exports['removeAnswers']=function(_0x255e23,_0x38b2d7){return db[_0x9402('0x44')][_0x9402('0x5f')]({'where':{'id':_0x255e23[_0x9402('0x62')]['id']}})['then'](handleEntityNotFound(_0x38b2d7,null))[_0x9402('0x13')](function(_0x373a1d){if(_0x373a1d){return _0x373a1d['removeAnswers'](_0x255e23['query'][_0x9402('0x6f')]);}})[_0x9402('0x13')](respondWithStatusCode(_0x38b2d7,null))[_0x9402('0x1d')](handleError(_0x38b2d7,null));};exports[_0x9402('0x66')]=function(_0xe5981f,_0xd8ac9){var _0xe1993e={'name':_0xe5981f[_0x9402('0x60')][_0x9402('0x2b')],'key':_0xe5981f[_0x9402('0x60')][_0x9402('0x47')],'provider':_0xe5981f['body']['provider']==='custom'?null:_0xe5981f['body']['provider'],'email':_0xe5981f[_0x9402('0x60')]['email'],'ListId':_0xe5981f[_0x9402('0x60')][_0x9402('0x70')],'active':!_['isNil'](_0xe5981f['body'][_0x9402('0x71')])?_0xe5981f[_0x9402('0x60')]['active']:!![],'description':_0xe5981f['body']['description']||null};var _0x45edeb=getAuthenticationOptions(_0xe1993e[_0x9402('0x61')],_0xe5981f[_0x9402('0x60')]);_0xe1993e[_0x9402('0x3d')]=_0x45edeb['Imap'];_0xe1993e[_0x9402('0x3e')]=_0x45edeb[_0x9402('0x3e')];return db[_0x9402('0x44')][_0x9402('0x66')](_0xe1993e,{'include':[{'model':db[_0x9402('0x41')],'as':_0x9402('0x3e')},{'model':db['MailServerIn'],'as':_0x9402('0x3d')}]})['then'](function(_0x3bd1c8){var _0x5274fe=_0xe5981f['user']['get']({'plain':!![]});if(!_0x5274fe)throw new Error(_0x9402('0x72'));if(_0x5274fe['role']===_0x9402('0x3c')){var _0x34fe95=_0x3bd1c8['get']({'plain':!![]});return db[_0x9402('0x73')][_0x9402('0x5f')]({'where':{'name':_0x9402('0x29'),'userProfileId':_0x5274fe[_0x9402('0x74')]},'raw':!![]})[_0x9402('0x13')](function(_0x3d0754){if(_0x3d0754&&_0x3d0754[_0x9402('0x75')]===0x0){return db['UserProfileResource']['create']({'name':_0x34fe95[_0x9402('0x2b')],'resourceId':_0x34fe95['id'],'type':_0x3d0754[_0x9402('0x2b')],'sectionId':_0x3d0754['id']},{})['then'](function(){return _0x3bd1c8;});}else{return _0x3bd1c8;}})[_0x9402('0x1d')](function(_0x29996e){logger[_0x9402('0x19')](_0x9402('0x76'),_0x29996e);throw _0x29996e;});}return _0x3bd1c8;})['then'](respondWithResult(_0xd8ac9,0xc9))[_0x9402('0x1d')](handleError(_0xd8ac9,null));};exports[_0x9402('0x77')]=function(_0x2b4f04,_0xffd4d){return db[_0x9402('0x44')]['findOne']({'where':{'id':_0x2b4f04[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0xffd4d,null))['then'](function(_0x43f494){if(_0x43f494){return _0x43f494['getImap']();}return null;})[_0x9402('0x13')](respondWithResult(_0xffd4d,null))[_0x9402('0x1d')](handleError(_0xffd4d,null));};exports['addImap']=function(_0x3d2ee1,_0x44b5f7){if(_0x3d2ee1[_0x9402('0x60')]['id']){delete _0x3d2ee1[_0x9402('0x60')]['id'];}return db[_0x9402('0x44')][_0x9402('0x5f')]({'where':{'id':_0x3d2ee1['params']['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x44b5f7,null))[_0x9402('0x13')](function(_0x1f0b3d){if(_0x1f0b3d){_0x3d2ee1[_0x9402('0x60')][_0x9402('0x64')]=_0x1f0b3d['id'];return db['MailServerIn']['create'](_0x3d2ee1[_0x9402('0x60')]);}})[_0x9402('0x13')](respondWithResult(_0x44b5f7,null))['catch'](handleError(_0x44b5f7,null));};exports[_0x9402('0x78')]=function(_0x42443c,_0x5e15a1){return db[_0x9402('0x44')]['findOne']({'where':{'id':_0x42443c[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x5e15a1,null))[_0x9402('0x13')](function(_0x129bd6){if(_0x129bd6){return _0x129bd6[_0x9402('0x79')](null);}return null;})[_0x9402('0x13')](respondWithStatusCode(_0x5e15a1,null))[_0x9402('0x1d')](handleError(_0x5e15a1,null));};exports[_0x9402('0x7a')]=function(_0x18d0fa,_0x516c92){return db['MailAccount'][_0x9402('0x68')]({'where':{'id':_0x18d0fa[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x516c92,null))[_0x9402('0x13')](function(_0x2c33a3){if(_0x2c33a3){return _0x2c33a3[_0x9402('0x7a')]();}return null;})[_0x9402('0x13')](respondWithResult(_0x516c92,null))[_0x9402('0x1d')](handleError(_0x516c92,null));};exports['addSmtp']=function(_0x45788a,_0x5a351a){if(_0x45788a['body']['id']){delete _0x45788a['body']['id'];}return db['MailAccount'][_0x9402('0x5f')]({'where':{'id':_0x45788a[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x5a351a,null))[_0x9402('0x13')](function(_0x185275){if(_0x185275){_0x45788a[_0x9402('0x60')][_0x9402('0x64')]=_0x185275['id'];return db['MailServerOut'][_0x9402('0x66')](_0x45788a[_0x9402('0x60')]);}})[_0x9402('0x13')](respondWithResult(_0x5a351a,null))[_0x9402('0x1d')](handleError(_0x5a351a,null));};exports[_0x9402('0x7b')]=function(_0x3fef93,_0x69b1c8){return db[_0x9402('0x44')][_0x9402('0x68')]({'where':{'id':_0x3fef93[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x69b1c8,null))[_0x9402('0x13')](function(_0x3fc571){if(_0x3fc571){return _0x3fc571[_0x9402('0x7c')](null);}return null;})['then'](respondWithStatusCode(_0x69b1c8,null))[_0x9402('0x1d')](handleError(_0x69b1c8,null));};exports[_0x9402('0x7d')]=function(_0x30a730,_0x31cf2d){return db[_0x9402('0x7e')][_0x9402('0x5f')]({'where':{'id':_0x30a730[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x31cf2d,null))[_0x9402('0x13')](function(_0x2ec7a1){if(_0x2ec7a1){return _0x2ec7a1[_0x9402('0x7d')](_0x30a730['body'][_0x9402('0x6f')],_[_0x9402('0x7f')](_0x30a730['body'],[_0x9402('0x6f'),'id'])||{});}})[_0x9402('0x13')](respondWithResult(_0x31cf2d,null))[_0x9402('0x1d')](handleError(_0x31cf2d,null));};exports['getInteractions']=function(_0x48d582,_0x244219){var _0x22d7ce={'raw':![],'where':{}};var _0x1fb8cd={};var _0x3cac65={'count':0x0,'rows':[]};return db[_0x9402('0x44')][_0x9402('0x68')]({'where':{'id':_0x48d582[_0x9402('0x62')]['id']}})['then'](handleEntityNotFound(_0x244219,null))[_0x9402('0x13')](function(_0x39c592){if(_0x39c592){_0x1fb8cd['model']=_[_0x9402('0x4a')](db[_0x9402('0x7e')]['rawAttributes']);_0x1fb8cd[_0x9402('0x49')]=_[_0x9402('0x4a')](_0x48d582[_0x9402('0x49')]);_0x1fb8cd[_0x9402('0x4b')]=_[_0x9402('0x4c')](_0x1fb8cd[_0x9402('0x48')],_0x1fb8cd[_0x9402('0x49')]);_0x22d7ce[_0x9402('0x4d')]=_['intersection'](_0x1fb8cd['model'],qs[_0x9402('0x4e')](_0x48d582['query']['fields']));_0x22d7ce[_0x9402('0x4d')]=_0x22d7ce[_0x9402('0x4d')][_0x9402('0x4f')]?_0x22d7ce[_0x9402('0x4d')]:_0x1fb8cd[_0x9402('0x48')];if(!_0x48d582[_0x9402('0x49')]['hasOwnProperty']('nolimit')){_0x22d7ce[_0x9402('0x24')]=qs[_0x9402('0x24')](_0x48d582[_0x9402('0x49')][_0x9402('0x24')]);_0x22d7ce['offset']=qs[_0x9402('0x22')](_0x48d582['query'][_0x9402('0x22')]);}_0x22d7ce[_0x9402('0x69')]=qs[_0x9402('0x52')](_0x48d582[_0x9402('0x49')]['sort']);_0x22d7ce['where']=qs['filters'](_[_0x9402('0x6e')](_0x48d582['query'],_0x1fb8cd[_0x9402('0x4b')]));_0x22d7ce['where'][_0x9402('0x64')]=_0x39c592['id'];if(_0x48d582[_0x9402('0x49')][_0x9402('0x54')]){_0x22d7ce['where']=_[_0x9402('0x56')](_0x22d7ce[_0x9402('0x53')],{'$or':_[_0x9402('0x43')](_0x22d7ce[_0x9402('0x4d')],function(_0x2acd2d){var _0x1185db={};_0x1185db[_0x2acd2d]={'$like':'%'+_0x48d582[_0x9402('0x49')][_0x9402('0x54')]+'%'};return _0x1185db;})});}_0x22d7ce=_['merge']({},_0x22d7ce,_0x48d582['options']);return db[_0x9402('0x7e')][_0x9402('0x25')]({'where':_0x22d7ce[_0x9402('0x53')]})[_0x9402('0x13')](function(_0x5de355){_0x3cac65[_0x9402('0x25')]=_0x5de355;if(_0x48d582[_0x9402('0x49')]['includeAll']){_0x22d7ce[_0x9402('0x5d')]=[{'model':db[_0x9402('0x80')],'as':_0x9402('0x81'),'required':![]},{'model':db[_0x9402('0x82')],'as':_0x9402('0x83'),'attributes':[_0x9402('0x2b'),_0x9402('0x84'),_0x9402('0x85')],'required':![]},{'model':db['Tag'],'as':_0x9402('0x86'),'attributes':['id',_0x9402('0x2b'),_0x9402('0x87')],'where':_0x48d582[_0x9402('0x49')][_0x9402('0x88')]?{'id':_0x48d582[_0x9402('0x49')][_0x9402('0x88')]}:undefined,'required':_0x48d582[_0x9402('0x49')][_0x9402('0x88')]?!![]:![]}];}return db[_0x9402('0x7e')][_0x9402('0x58')](_0x22d7ce);})[_0x9402('0x13')](function(_0x35dc53){_0x3cac65[_0x9402('0x59')]=_0x35dc53;return _0x3cac65;});}})[_0x9402('0x13')](respondWithFilteredResult(_0x244219,_0x22d7ce))[_0x9402('0x1d')](handleError(_0x244219,null));};exports[_0x9402('0x89')]=function addApplications(_0x285a67,_0x169259){var _0x155522=_0x285a67[_0x9402('0x62')]['id'];var _0x80f840=_0x285a67['body'];var _0x577e35=0xc8;var _0x72a709=null;return db[_0x9402('0x8a')][_0x9402('0x8b')]({'isolationLevel':db['sequelize'][_0x9402('0x8c')][_0x9402('0x8d')]['READ_COMMITTED']},function(_0x3bf9e3){return db['MailAccount'][_0x9402('0x68')]({'where':{'id':_0x155522},'transaction':_0x3bf9e3})[_0x9402('0x13')](function(_0x5d2f9d){if(_0x5d2f9d){return db[_0x9402('0x8e')][_0x9402('0x28')]({'where':{'MailAccountId':_0x155522},'transaction':_0x3bf9e3})[_0x9402('0x13')](function(){var _0x4ef87e=_[_0x9402('0x43')](_0x80f840,function(_0x56f47c){_0x56f47c[_0x9402('0x64')]=_0x155522;return _0x56f47c;});return db[_0x9402('0x8e')]['bulkCreate'](_0x4ef87e,{'transaction':_0x3bf9e3});});}else{_0x577e35=0x194;_0x72a709=[];}});})[_0x9402('0x13')](function(){if(_0x577e35!==0x194){return db[_0x9402('0x8e')][_0x9402('0x8f')]({'where':{'MailAccountId':_0x155522},'order':_0x9402('0x90')})[_0x9402('0x13')](function(_0x4ac4e6){_0x72a709=_0x4ac4e6;});}})[_0x9402('0x1d')](function(_0x172511){_0x577e35=0x1f4;logger[_0x9402('0x19')](_0x172511[_0x9402('0x2a')]);if(_0x172511[_0x9402('0x2b')]){delete _0x172511[_0x9402('0x2b')];}_0x72a709=_0x172511;})[_0x9402('0x91')](function(){if(_0x72a709===null){_0x169259[_0x9402('0x1e')](_0x577e35);}else{if(_0x577e35===0x1f4){_0x169259['status'](_0x577e35)[_0x9402('0x92')](_0x72a709);}else{_0x169259[_0x9402('0x1f')](_0x577e35)[_0x9402('0x21')](_0x72a709);}}});};exports[_0x9402('0x93')]=function(_0x2ec874,_0x3f3b37){var _0x35164b={};var _0x11b834={};var _0x1c92d1;var _0x4c47f5;return db[_0x9402('0x44')][_0x9402('0x68')]({'where':{'id':_0x2ec874[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x3f3b37,null))[_0x9402('0x13')](function(_0x341df3){if(_0x341df3){_0x1c92d1=_0x341df3;_0x11b834[_0x9402('0x48')]=_['keys'](db[_0x9402('0x8e')][_0x9402('0x5c')]);_0x11b834[_0x9402('0x49')]=_[_0x9402('0x4a')](_0x2ec874[_0x9402('0x49')]);_0x11b834[_0x9402('0x4b')]=_['intersection'](_0x11b834[_0x9402('0x48')],_0x11b834[_0x9402('0x49')]);_0x35164b[_0x9402('0x4d')]=_[_0x9402('0x4c')](_0x11b834[_0x9402('0x48')],qs[_0x9402('0x4e')](_0x2ec874[_0x9402('0x49')][_0x9402('0x4e')]));_0x35164b['attributes']=_0x35164b[_0x9402('0x4d')][_0x9402('0x4f')]?_0x35164b[_0x9402('0x4d')]:_0x11b834[_0x9402('0x48')];_0x35164b[_0x9402('0x69')]=qs[_0x9402('0x52')](_0x2ec874[_0x9402('0x49')][_0x9402('0x52')]);_0x35164b[_0x9402('0x53')]=qs[_0x9402('0x4b')](_[_0x9402('0x6e')](_0x2ec874['query'],_0x11b834[_0x9402('0x4b')]));if(_0x2ec874[_0x9402('0x49')][_0x9402('0x54')]){_0x35164b[_0x9402('0x53')]=_[_0x9402('0x56')](_0x35164b[_0x9402('0x53')],{'$or':_['map'](_0x35164b[_0x9402('0x4d')],function(_0x2ca78){var _0xdbb9e3={};_0xdbb9e3[_0x2ca78]={'$like':'%'+_0x2ec874[_0x9402('0x49')][_0x9402('0x54')]+'%'};return _0xdbb9e3;})});}_0x35164b=_[_0x9402('0x56')]({},_0x35164b,_0x2ec874[_0x9402('0x5e')]);return _0x1c92d1[_0x9402('0x93')](_0x35164b);}})[_0x9402('0x13')](function(_0x3d9c87){if(_0x3d9c87){_0x4c47f5=_0x3d9c87[_0x9402('0x4f')];if(!_0x2ec874[_0x9402('0x49')][_0x9402('0x50')](_0x9402('0x51'))){_0x35164b[_0x9402('0x24')]=qs[_0x9402('0x24')](_0x2ec874[_0x9402('0x49')][_0x9402('0x24')]);_0x35164b['offset']=qs['offset'](_0x2ec874['query'][_0x9402('0x22')]);}return _0x1c92d1['getApplications'](_0x35164b);}})[_0x9402('0x13')](function(_0x4d7baa){if(_0x4d7baa){return _0x4d7baa?{'count':_0x4c47f5,'rows':_0x4d7baa}:null;}})['then'](respondWithResult(_0x3f3b37,null))['catch'](handleError(_0x3f3b37,null));};exports['getMessages']=function(_0x559898,_0xc58c69){var _0x2dc725={'raw':!![],'where':{}};var _0x303dd5={};var _0xca9702={'count':0x0,'rows':[]};return db['MailAccount'][_0x9402('0x68')]({'where':{'id':_0x559898[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0xc58c69,null))[_0x9402('0x13')](function(_0x14d711){if(_0x14d711){_0x303dd5['model']=_[_0x9402('0x4a')](db[_0x9402('0x94')][_0x9402('0x5c')]);_0x303dd5['query']=_[_0x9402('0x4a')](_0x559898[_0x9402('0x49')]);_0x303dd5['filters']=_[_0x9402('0x4c')](_0x303dd5['model'],_0x303dd5[_0x9402('0x49')]);_0x2dc725[_0x9402('0x4d')]=_['intersection'](_0x303dd5[_0x9402('0x48')],qs[_0x9402('0x4e')](_0x559898['query']['fields']));_0x2dc725[_0x9402('0x4d')]=_0x2dc725[_0x9402('0x4d')][_0x9402('0x4f')]?_0x2dc725[_0x9402('0x4d')]:_0x303dd5[_0x9402('0x48')];if(!_0x559898[_0x9402('0x49')][_0x9402('0x50')](_0x9402('0x51'))){_0x2dc725[_0x9402('0x24')]=qs[_0x9402('0x24')](_0x559898['query'][_0x9402('0x24')]);_0x2dc725[_0x9402('0x22')]=qs[_0x9402('0x22')](_0x559898[_0x9402('0x49')]['offset']);}_0x2dc725[_0x9402('0x69')]=qs[_0x9402('0x52')](_0x559898['query']['sort']);_0x2dc725['where']=qs[_0x9402('0x4b')](_[_0x9402('0x6e')](_0x559898[_0x9402('0x49')],_0x303dd5[_0x9402('0x4b')]));_0x2dc725['where']['MailAccountId']=_0x14d711['id'];if(_0x559898[_0x9402('0x49')][_0x9402('0x54')]){_0x2dc725[_0x9402('0x53')]=_[_0x9402('0x56')](_0x2dc725[_0x9402('0x53')],{'$or':_[_0x9402('0x43')](_0x2dc725[_0x9402('0x4d')],function(_0x580ea5){var _0x37c0ef={};_0x37c0ef[_0x580ea5]={'$like':'%'+_0x559898[_0x9402('0x49')][_0x9402('0x54')]+'%'};return _0x37c0ef;})});}if(_0x559898[_0x9402('0x49')][_0x9402('0x95')]){var _0x22f568=_0x559898[_0x9402('0x49')][_0x9402('0x95')][_0x9402('0x96')](',');var _0x28471f={};_0x28471f[_0x22f568[0x0]]={'$gte':moment(_0x22f568[0x1])[_0x9402('0x97')](_0x9402('0x98'))};_0x2dc725[_0x9402('0x53')]=_['merge'](_0x2dc725[_0x9402('0x53')],_0x28471f);}_0x2dc725=_['merge']({},_0x2dc725,_0x559898['options']);return db[_0x9402('0x94')][_0x9402('0x25')]({'where':_0x2dc725[_0x9402('0x53')]})[_0x9402('0x13')](function(_0x3f6948){_0xca9702[_0x9402('0x25')]=_0x3f6948;if(_0x559898[_0x9402('0x49')][_0x9402('0x57')]){_0x2dc725[_0x9402('0x5d')]=[{'all':!![]}];}return db[_0x9402('0x94')][_0x9402('0x58')](_0x2dc725);})[_0x9402('0x13')](function(_0x3b1fd4){if(_0x559898[_0x9402('0x49')][_0x9402('0x99')]===_0x9402('0x9a')){for(var _0x23eeb4=0x0;_0x23eeb4<_0x3b1fd4[_0x9402('0x4f')];_0x23eeb4++){_0x3b1fd4[_0x23eeb4][_0x9402('0x60')]=juice(_0x3b1fd4[_0x23eeb4][_0x9402('0x60')]);}}_0xca9702[_0x9402('0x59')]=_0x3b1fd4;return _0xca9702;});}})[_0x9402('0x13')](respondWithFilteredResult(_0xc58c69,_0x2dc725))[_0x9402('0x1d')](handleError(_0xc58c69,null));};exports[_0x9402('0x92')]=function(_0x3ba939,_0x11a647){var _0x438ccc,_0x1a640a={},_0x5c2ff7;if(_0x3ba939['body']['to']){_0x5c2ff7=_0x3ba939[_0x9402('0x60')]['to'][_0x9402('0x96')](',')[0x0];}return db[_0x9402('0x44')]['find']({'where':{'id':_0x3ba939[_0x9402('0x62')]['id']},'include':[{'model':db[_0x9402('0x9b')],'as':'List','include':[{'model':db[_0x9402('0x80')],'as':_0x9402('0x9c'),'where':{'email':_0x5c2ff7},'limit':0x1,'order':[[_0x9402('0x9d'),_0x9402('0x9e')]]}]},{'model':db['MailServerOut'],'as':_0x9402('0x3e'),'raw':!![],'include':[{'model':db[_0x9402('0x9f')],'as':_0x9402('0x9f'),'raw':!![]}]}]})[_0x9402('0x13')](handleEntityNotFound(_0x11a647,null))[_0x9402('0x13')](function(_0x288d11){if(!_0x288d11)return;_0x438ccc=_0x288d11;if(!_0x288d11[_0x9402('0x3e')])throw new Error(_0x9402('0xa0'));if(_[_0x9402('0xa1')](_0x3ba939[_0x9402('0x60')][_0x9402('0xa2')])){_0x3ba939['body'][_0x9402('0xa2')]=util['format'](_0x9402('0xa3'),_0x288d11['name'],_0x288d11[_0x9402('0xa4')]||_0x288d11[_0x9402('0x3e')][_0x9402('0x3c')]);}if(_0x3ba939[_0x9402('0x60')]['attachments']&&_0x3ba939['body'][_0x9402('0xa5')][_0x9402('0x4f')]){for(var _0x12eac9=0x0;_0x12eac9<_0x3ba939[_0x9402('0x60')][_0x9402('0xa5')]['length'];_0x12eac9+=0x1){_0x3ba939[_0x9402('0x60')][_0x9402('0xa5')][_0x12eac9]={'filename':_0x3ba939[_0x9402('0x60')][_0x9402('0xa5')][_0x12eac9][_0x9402('0x2b')],'path':path[_0x9402('0xa6')](config['root'],_0x9402('0xa7'),_0x3ba939[_0x9402('0x60')]['attachments'][_0x12eac9][_0x9402('0xa8')])};}}var _0x5e0acd=_0x288d11['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0x9402('0xa9'),{'account':_0x5e0acd,'message':_0x3ba939[_0x9402('0x60')]});})[_0x9402('0x13')](function(_0x37e55e){if(!_0x37e55e)return;_0x1a640a=_0x37e55e;if(!_0x438ccc['List'])throw new Error(_0x9402('0xaa'));if(_0x438ccc[_0x9402('0xab')][_0x9402('0x9c')][_0x9402('0x4f')])return _0x438ccc[_0x9402('0xab')][_0x9402('0x9c')][0x0];return db[_0x9402('0x80')][_0x9402('0x66')](_['defaults'](_0x3ba939[_0x9402('0x60')],{'firstName':_0x3ba939[_0x9402('0x60')]['to'],'email':_0x3ba939['body']['to'],'phone':_0x3ba939[_0x9402('0x60')]['to'],'ListId':_0x438ccc['ListId']}));})[_0x9402('0x13')](function(_0x2c36f4){if(!_0x2c36f4)return;var _0x1a1b30={'UserId':_0x3ba939['user']['id'],'ContactId':_0x2c36f4['id'],'MailAccountId':_0x438ccc['id'],'inReplyTo':_0x1a640a[_0x9402('0xac')],'to':_0x3ba939[_0x9402('0x60')][_0x9402('0xa2')],'cc':_0x3ba939[_0x9402('0x60')]['cc'],'subject':_0x3ba939[_0x9402('0x60')][_0x9402('0xad')],'attach':_0x3ba939['body'][_0x9402('0xae')],'firstMsgDirection':_0x9402('0xaf'),'lastMsgAt':moment()[_0x9402('0x97')](_0x9402('0x98')),'lastMsgDirection':_0x9402('0xaf'),'Messages':[_['merge'](_0x3ba939['body'],{'messageId':_0x1a640a[_0x9402('0xac')],'sentAt':moment()[_0x9402('0x97')](_0x9402('0x98')),'read':!![],'MailAccountId':_0x438ccc['id'],'UserId':_0x3ba939[_0x9402('0x3c')]['id'],'ContactId':_0x2c36f4['id']})]};if(_0x3ba939['body']['Interaction']){_0x1a1b30=_[_0x9402('0x56')](_0x1a1b30,_0x3ba939['body'][_0x9402('0xb0')]);}return db[_0x9402('0x7e')][_0x9402('0x66')](_0x1a1b30,{'include':[{'model':db[_0x9402('0x94')],'as':_0x9402('0xb1')}]});})[_0x9402('0x13')](respondWithResult(_0x11a647,null))[_0x9402('0x1d')](handleError(_0x11a647,null));};exports['verifySmtp']=function(_0x1257b4,_0x486260){return db['MailAccount'][_0x9402('0x5f')]({'where':{'id':_0x1257b4[_0x9402('0x62')]['id']},'include':[{'model':db[_0x9402('0x41')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x9402('0x9f'),'raw':!![]}]}]})[_0x9402('0x13')](handleEntityNotFound(_0x486260,null))[_0x9402('0x13')](function(_0xa79a1e){if(!_0xa79a1e['Smtp'])return;var _0x17cefa=_0xa79a1e[_0x9402('0xb2')]();return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x17cefa});})[_0x9402('0x13')](respondWithResult(_0x486260,null))[_0x9402('0x1d')](handleError(_0x486260,null));};exports[_0x9402('0x28')]=function(_0x15a737,_0x223599){return db['MailAccount']['find']({'where':{'id':_0x15a737['params']['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x223599,null))[_0x9402('0x13')](function(_0x3825f0){if(_0x3825f0&&_0x3825f0[_0x9402('0x3a')]){throw new db[(_0x9402('0xb3'))][(_0x9402('0xb4'))](_0x9402('0xb5'));}return _0x3825f0;})[_0x9402('0x13')](removeEntity(_0x223599,null))[_0x9402('0x1d')](handleError(_0x223599,null));};exports[_0x9402('0xb6')]=function(_0x1bd809,_0x240169){return db[_0x9402('0x44')][_0x9402('0x5f')]({'where':{'id':_0x1bd809[_0x9402('0x62')]['id']}})[_0x9402('0x13')](handleEntityNotFound(_0x240169,null))[_0x9402('0x13')](function(_0x46973b){if(_0x46973b){return _0x46973b['addAgents'](_0x1bd809[_0x9402('0x60')][_0x9402('0x6f')],_[_0x9402('0x7f')](_0x1bd809[_0x9402('0x60')],['ids','id'])||{})[_0x9402('0xb7')](function(_0x114d65){for(var _0x45d966=0x0;_0x45d966<_0x1bd809[_0x9402('0x60')][_0x9402('0x6f')][_0x9402('0x4f')];_0x45d966+=0x1){socket[_0x9402('0xb8')](_0x9402('0xb9'),{'UserId':Number(_0x1bd809['body'][_0x9402('0x6f')][_0x45d966]),'MailAccountId':Number(_0x1bd809[_0x9402('0x62')]['id'])});}return _0x114d65;});}})['then'](respondWithResult(_0x240169,null))[_0x9402('0x1d')](handleError(_0x240169,null));};exports[_0x9402('0xba')]=function(_0x44e64e,_0x28dc96){return db[_0x9402('0x44')][_0x9402('0x5f')]({'where':{'id':_0x44e64e[_0x9402('0x62')]['id']}})['then'](handleEntityNotFound(_0x28dc96,null))['then'](function(_0x5b6a9b){if(_0x5b6a9b){return _0x5b6a9b[_0x9402('0xba')](_0x44e64e['query'][_0x9402('0x6f')])['then'](function(){if(_['isArray'](_0x44e64e[_0x9402('0x49')][_0x9402('0x6f')])){for(var _0x4cdf59=0x0;_0x4cdf59<_0x44e64e[_0x9402('0x49')][_0x9402('0x6f')][_0x9402('0x4f')];_0x4cdf59+=0x1){socket[_0x9402('0xb8')]('userMailAccount:remove',{'UserId':Number(_0x44e64e[_0x9402('0x49')][_0x9402('0x6f')][_0x4cdf59]),'MailAccountId':Number(_0x44e64e['params']['id'])});}}else{socket['emit'](_0x9402('0xbb'),{'UserId':Number(_0x44e64e['query'][_0x9402('0x6f')]),'MailAccountId':Number(_0x44e64e[_0x9402('0x62')]['id'])});}});}})[_0x9402('0x13')](respondWithStatusCode(_0x28dc96,null))['catch'](handleError(_0x28dc96,null));};exports[_0x9402('0xbc')]=function(_0x3d4beb,_0x5ac8bc){var _0x395b67={};var _0x466477={};var _0x12508d;var _0x1c1988;return db['MailAccount'][_0x9402('0x68')]({'where':{'id':_0x3d4beb[_0x9402('0x62')]['id']}})['then'](handleEntityNotFound(_0x5ac8bc,null))[_0x9402('0x13')](function(_0x411eed){if(_0x411eed){_0x12508d=_0x411eed;_0x466477[_0x9402('0x48')]=_[_0x9402('0x4a')](db[_0x9402('0x82')]['rawAttributes']);_0x466477['query']=_['keys'](_0x3d4beb['query']);_0x466477[_0x9402('0x4b')]=_['intersection'](_0x466477[_0x9402('0x48')],_0x466477['query']);_0x395b67[_0x9402('0x4d')]=_[_0x9402('0x4c')](_0x466477[_0x9402('0x48')],qs[_0x9402('0x4e')](_0x3d4beb[_0x9402('0x49')][_0x9402('0x4e')]));_0x395b67[_0x9402('0x4d')]=_0x395b67['attributes'][_0x9402('0x4f')]?_0x395b67[_0x9402('0x4d')]:_0x466477['model'];_0x395b67[_0x9402('0x69')]=qs[_0x9402('0x52')](_0x3d4beb[_0x9402('0x49')][_0x9402('0x52')]);_0x395b67[_0x9402('0x53')]=qs[_0x9402('0x4b')](_[_0x9402('0x6e')](_0x3d4beb[_0x9402('0x49')],_0x466477[_0x9402('0x4b')]));if(_0x3d4beb[_0x9402('0x49')][_0x9402('0x54')]){_0x395b67['where']=_[_0x9402('0x56')](_0x395b67[_0x9402('0x53')],{'$or':_[_0x9402('0x43')](_0x395b67[_0x9402('0x4d')],function(_0x433209){var _0x1ad8ce={};_0x1ad8ce[_0x433209]={'$like':'%'+_0x3d4beb[_0x9402('0x49')]['filter']+'%'};return _0x1ad8ce;})});}_0x395b67=_[_0x9402('0x56')]({},_0x395b67,_0x3d4beb[_0x9402('0x5e')]);return _0x12508d[_0x9402('0xbc')](_0x395b67);}})[_0x9402('0x13')](function(_0x1b6987){if(_0x1b6987){_0x1c1988=_0x1b6987[_0x9402('0x4f')];if(!_0x3d4beb['query']['hasOwnProperty'](_0x9402('0x51'))){_0x395b67[_0x9402('0x24')]=qs[_0x9402('0x24')](_0x3d4beb[_0x9402('0x49')]['limit']);_0x395b67[_0x9402('0x22')]=qs[_0x9402('0x22')](_0x3d4beb[_0x9402('0x49')][_0x9402('0x22')]);}return _0x12508d['getAgents'](_0x395b67);}})['then'](function(_0x6b51cc){if(_0x6b51cc){return _0x6b51cc?{'count':_0x1c1988,'rows':_0x6b51cc}:null;}})[_0x9402('0x13')](respondWithResult(_0x5ac8bc,null))['catch'](handleError(_0x5ac8bc,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index b5666d7..ee6bd32 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 _0x0733=['emit','hasOwnProperty','hook','exports','MailAccount','setMaxListeners','save','remove'];(function(_0x35783b,_0x1be2fa){var _0x19e19b=function(_0x3fd261){while(--_0x3fd261){_0x35783b['push'](_0x35783b['shift']());}};_0x19e19b(++_0x1be2fa);}(_0x0733,0xc4));var _0x3073=function(_0x4e044a,_0x2ebb39){_0x4e044a=_0x4e044a-0x0;var _0x52be17=_0x0733[_0x4e044a];return _0x52be17;};'use strict';var EventEmitter=require('events');var MailAccount=require('../../mysqldb')['db'][_0x3073('0x0')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x3073('0x1')](0x0);var events={'afterCreate':_0x3073('0x2'),'afterUpdate':'update','afterDestroy':_0x3073('0x3')};function emitEvent(_0x441cd2){return function(_0x5f2625,_0x322391,_0xfcabfd){MailAccountEvents[_0x3073('0x4')](_0x441cd2+':'+_0x5f2625['id'],_0x5f2625);MailAccountEvents[_0x3073('0x4')](_0x441cd2,_0x5f2625);_0xfcabfd(null);};}for(var e in events){if(events[_0x3073('0x5')](e)){var event=events[e];MailAccount[_0x3073('0x6')](e,emitEvent(event));}}module[_0x3073('0x7')]=MailAccountEvents; \ No newline at end of file +var _0x077e=['events','../../mysqldb','MailAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4f3ce9,_0x4dcaa5){var _0x3d0be1=function(_0x56b278){while(--_0x56b278){_0x4f3ce9['push'](_0x4f3ce9['shift']());}};_0x3d0be1(++_0x4dcaa5);}(_0x077e,0x14a));var _0xe077=function(_0x2d78ef,_0xa7575b){_0x2d78ef=_0x2d78ef-0x0;var _0x39e29c=_0x077e[_0x2d78ef];return _0x39e29c;};'use strict';var EventEmitter=require(_0xe077('0x0'));var MailAccount=require(_0xe077('0x1'))['db'][_0xe077('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xe077('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe077('0x4'),'afterDestroy':_0xe077('0x5')};function emitEvent(_0x434a74){return function(_0x4a203d,_0x391340,_0x333f7f){MailAccountEvents[_0xe077('0x6')](_0x434a74+':'+_0x4a203d['id'],_0x4a203d);MailAccountEvents[_0xe077('0x6')](_0x434a74,_0x4a203d);_0x333f7f(null);};}for(var e in events){if(events[_0xe077('0x7')](e)){var event=events[e];MailAccount[_0xe077('0x8')](e,emitEvent(event));}}module[_0xe077('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 2f0cae2..5622397 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 _0x8933=['./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','host','port','secure','Smtp','authentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','pass'];(function(_0x2fca4b,_0x6da735){var _0x36b2e1=function(_0x5e3fa8){while(--_0x5e3fa8){_0x2fca4b['push'](_0x2fca4b['shift']());}};_0x36b2e1(++_0x6da735);}(_0x8933,0x110));var _0x3893=function(_0x4a6eb7,_0x38b7fb){_0x4a6eb7=_0x4a6eb7-0x0;var _0x278ba7=_0x8933[_0x4a6eb7];return _0x278ba7;};'use strict';var attributes=require(_0x3893('0x0'));module[_0x3893('0x1')]=function(_0x54a231){return _0x54a231[_0x3893('0x2')](_0x3893('0x3'),attributes,{'tableName':_0x3893('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x6a46e0=this;var _0x3e7dd3={'id':_0x6a46e0['id'],'tls':{'rejectUnauthorized':![]}};if(_0x6a46e0[_0x3893('0x5')]!=='custom'){_0x3e7dd3['service']=_0x6a46e0[_0x3893('0x5')];}else{_0x3e7dd3['host']=_0x6a46e0['Smtp'][_0x3893('0x6')];_0x3e7dd3[_0x3893('0x7')]=_0x6a46e0['Smtp']['port'];_0x3e7dd3[_0x3893('0x8')]=_0x6a46e0[_0x3893('0x9')]['secure'];}if(_0x6a46e0['Smtp'][_0x3893('0xa')]){if(_0x6a46e0['Smtp']['modernAuthentication']){if(!_0x6a46e0[_0x3893('0x9')][_0x3893('0xb')])throw new Error(_0x3893('0xc'));_0x3e7dd3['auth']={'type':_0x3893('0xd'),'user':_0x6a46e0[_0x3893('0x9')][_0x3893('0xe')],'accessToken':_0x6a46e0[_0x3893('0x9')][_0x3893('0xb')]['data5']};}else{_0x3e7dd3['auth']={'user':_0x6a46e0[_0x3893('0x9')][_0x3893('0xe')],'pass':_0x6a46e0[_0x3893('0x9')][_0x3893('0xf')]};}}return _0x3e7dd3;}}});}; \ No newline at end of file +var _0x1896=['data5','auth','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','custom','host','Smtp','port','secure','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','user'];(function(_0x5e2799,_0x2432bb){var _0x1aa60b=function(_0x92a0ac){while(--_0x92a0ac){_0x5e2799['push'](_0x5e2799['shift']());}};_0x1aa60b(++_0x2432bb);}(_0x1896,0xc9));var _0x6189=function(_0x4924ec,_0x1b217f){_0x4924ec=_0x4924ec-0x0;var _0x588c39=_0x1896[_0x4924ec];return _0x588c39;};'use strict';var attributes=require(_0x6189('0x0'));module[_0x6189('0x1')]=function(_0x57352a){return _0x57352a[_0x6189('0x2')](_0x6189('0x3'),attributes,{'tableName':_0x6189('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3a5391=this;var _0x376866={'id':_0x3a5391['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3a5391[_0x6189('0x5')]!==_0x6189('0x6')){_0x376866['service']=_0x3a5391[_0x6189('0x5')];}else{_0x376866[_0x6189('0x7')]=_0x3a5391[_0x6189('0x8')][_0x6189('0x7')];_0x376866[_0x6189('0x9')]=_0x3a5391[_0x6189('0x8')][_0x6189('0x9')];_0x376866[_0x6189('0xa')]=_0x3a5391['Smtp'][_0x6189('0xa')];}if(_0x3a5391[_0x6189('0x8')]['authentication']){if(_0x3a5391[_0x6189('0x8')][_0x6189('0xb')]){if(!_0x3a5391[_0x6189('0x8')][_0x6189('0xc')])throw new Error(_0x6189('0xd'));_0x376866['auth']={'type':'OAuth2','user':_0x3a5391['Smtp'][_0x6189('0xe')],'accessToken':_0x3a5391[_0x6189('0x8')]['CloudProvider'][_0x6189('0xf')]};}else{_0x376866[_0x6189('0x10')]={'user':_0x3a5391[_0x6189('0x8')][_0x6189('0xe')],'pass':_0x3a5391[_0x6189('0x8')][_0x6189('0x11')]};}}return _0x376866;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 716815b..59e98b3 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 _0x687b=['originTo','originCc','ChatWebsiteId','originChannel','Attachment','Attachments','UserId','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailAccount.socket','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','ShowMailAccount','find','smtp','setDataValue','getSmtpOptions','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','body','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','account','Contacts','updatedAt','DESC','Applications','MailServerOut','Smtp','CloudProvider','List','omit','applications','list','orderBy','asc','length','close','autoclose','*,*,*,*','ListId','List\x20not\x20found','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','create','spread','update','interaction','get','created','contact'];(function(_0x1944c9,_0x1903c0){var _0x9a7545=function(_0x199b8b){while(--_0x199b8b){_0x1944c9['push'](_0x1944c9['shift']());}};_0x9a7545(++_0x1903c0);}(_0x687b,0x14a));var _0xb687=function(_0xbdf091,_0x35a06c){_0xbdf091=_0xbdf091-0x0;var _0x129fd5=_0x687b[_0xbdf091];return _0x129fd5;};'use strict';var _=require(_0xb687('0x0'));var moment=require(_0xb687('0x1'));var BPromise=require(_0xb687('0x2'));var rs=require(_0xb687('0x3'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0xb687('0x4'))(_0xb687('0x5'));var config=require(_0xb687('0x6'));var jayson=require(_0xb687('0x7'));var client=jayson[_0xb687('0x8')][_0xb687('0x9')]({'port':0x232c});config[_0xb687('0xa')]=_[_0xb687('0xb')](config[_0xb687('0xa')],{'host':_0xb687('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb687('0xa')]));require(_0xb687('0xd'))['register'](socket);function respondWithRpcPromise(_0x1a99c5,_0x21e3ab,_0x825ad){return new BPromise(function(_0x15dc9a,_0x404fdb){return client[_0xb687('0xe')](_0x1a99c5,_0x825ad)[_0xb687('0xf')](function(_0xaf4727){logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));logger[_0xb687('0x12')](_0xb687('0x13'),_0x21e3ab,_0xb687('0x11'),JSON['stringify'](_0xaf4727));if(_0xaf4727['error']){if(_0xaf4727[_0xb687('0x14')][_0xb687('0x15')]===0x1f4){logger['error'](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x404fdb(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x15dc9a(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}else{logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));_0x15dc9a(_0xaf4727[_0xb687('0x18')][_0xb687('0x17')]);}})['catch'](function(_0x48958d){logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0x48958d);_0x404fdb(_0x48958d);});});}exports[_0xb687('0x19')]=function(_0x4b593b){var _0x42cdd2=this;return new Promise(function(_0x481f1d,_0x1bd2bf){return db[_0xb687('0x1a')][_0xb687('0x1b')]({'raw':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b593b['options']?_0x4b593b[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1f')]||null:null,'limit':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x20')]||null:null,'include':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x21')]?_[_0xb687('0x22')](_0x4b593b['options'][_0xb687('0x21')],function(_0x129347){return{'model':db[_0x129347[_0xb687('0x23')]],'as':_0x129347['as'],'attributes':_0x129347[_0xb687('0x1f')],'include':_0x129347[_0xb687('0x21')]?_[_0xb687('0x22')](_0x129347[_0xb687('0x21')],function(_0x3cb2f2){return{'model':db[_0x3cb2f2[_0xb687('0x23')]],'as':_0x3cb2f2['as'],'attributes':_0x3cb2f2[_0xb687('0x1f')],'include':_0x3cb2f2['include']?_[_0xb687('0x22')](_0x3cb2f2[_0xb687('0x21')],function(_0x392721){return{'model':db[_0x392721[_0xb687('0x23')]],'as':_0x392721['as'],'attributes':_0x392721[_0xb687('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x4e9a06){logger[_0xb687('0x10')]('GetMailAccount',_0x4b593b);logger[_0xb687('0x12')](_0xb687('0x19'),_0x4b593b,JSON[_0xb687('0x24')](_0x4e9a06));_0x481f1d(_0x4e9a06);})[_0xb687('0x25')](function(_0x1ad3ef){logger[_0xb687('0x14')](_0xb687('0x19'),_0x1ad3ef['message'],_0x4b593b);_0x1bd2bf(_0x42cdd2[_0xb687('0x14')](0x1f4,_0x1ad3ef[_0xb687('0x17')]));});});};exports[_0xb687('0x26')]=function(_0x22cd1d){var _0xa18fec=this;return new Promise(function(_0x263834,_0x44be88){return db[_0xb687('0x1a')][_0xb687('0x27')]({'raw':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['attributes']||null:null,'include':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')]?_['map'](_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')],function(_0x548b83){return{'model':db[_0x548b83[_0xb687('0x23')]],'as':_0x548b83['as'],'attributes':_0x548b83['attributes'],'include':_0x548b83[_0xb687('0x21')]?_[_0xb687('0x22')](_0x548b83[_0xb687('0x21')],function(_0x3e146a){return{'model':db[_0x3e146a[_0xb687('0x23')]],'as':_0x3e146a['as'],'attributes':_0x3e146a[_0xb687('0x1f')],'include':_0x3e146a['include']?_[_0xb687('0x22')](_0x3e146a[_0xb687('0x21')],function(_0x2a73df){return{'model':db[_0x2a73df[_0xb687('0x23')]],'as':_0x2a73df['as'],'attributes':_0x2a73df['attributes']};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x100f4a){if(_0x22cd1d[_0xb687('0x1c')][_0xb687('0x28')]===!![])_0x100f4a[_0xb687('0x29')]('smtpOptions',_0x100f4a[_0xb687('0x2a')]());logger[_0xb687('0x10')](_0xb687('0x26'),_0x22cd1d);logger[_0xb687('0x12')](_0xb687('0x26'),_0x22cd1d,JSON[_0xb687('0x24')](_0x100f4a));_0x263834(_0x100f4a);})['catch'](function(_0x5ad577){logger[_0xb687('0x14')]('ShowMailAccount',_0x5ad577[_0xb687('0x17')],_0x22cd1d);_0x44be88(_0xa18fec[_0xb687('0x14')](0x1f4,_0x5ad577['message']));});});};exports[_0xb687('0x2b')]=function(_0x2ce07a){var _0x57776b=this;return new Promise(function(_0x394b56,_0x28031e){var _0x127b25={'body':_0x2ce07a['body'],'channel':_0xb687('0x2c')};var _0x9cffb2=_[_0xb687('0x2d')](_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')]),[_0xb687('0x31'),'updatedAt',_0xb687('0x32'),'ListId']);var _0x50fdb7=![];if(_0x2ce07a[_0xb687('0x33')]['id']){delete _0x2ce07a[_0xb687('0x33')]['id'];}if(_['isNil'](_0x2ce07a[_0xb687('0x33')]['from'])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x34')));}if(_['isNil'](_0x2ce07a[_0xb687('0x33')][_0xb687('0x33')])||_0x2ce07a['body'][_0xb687('0x33')]===''){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x35')));}if(_[_0xb687('0x36')](_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x38')+_0x9cffb2));}if(!_[_0xb687('0x39')](_0x9cffb2,_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x9cffb2));}var _0x1ac373={};_0x1ac373[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')];return db[_0xb687('0x1a')][_0xb687('0x27')]({'where':{'id':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xb687('0x2f')],'as':_0xb687('0x3c'),'where':_0x1ac373,'limit':0x1,'order':[[_0xb687('0x3d'),_0xb687('0x3e')]]}]},{'model':db['MailApplication'],'as':_0xb687('0x3f')},{'model':db[_0xb687('0x40')],'as':_0xb687('0x41'),'include':[{'model':db[_0xb687('0x42')],'as':'CloudProvider'}]}]})[_0xb687('0xf')](function(_0xfc4c5f){if(_0xfc4c5f&&_0xfc4c5f[_0xb687('0x43')]){var _0x401b99=_0xfc4c5f['get']({'plain':!![]});_0x127b25['account']=_[_0xb687('0x44')](_0x401b99,[_0xb687('0x3f'),_0xb687('0x43')]);_0x127b25['account']['smtpOptions']=_0xfc4c5f[_0xb687('0x2a')]();_0x127b25[_0xb687('0x45')]=_0x401b99[_0xb687('0x3f')];_0x127b25[_0xb687('0x46')]=_0x401b99[_0xb687('0x43')];_0x127b25[_0xb687('0x45')]=_[_0xb687('0x47')](_0x127b25[_0xb687('0x45')],['priority'],[_0xb687('0x48')]);if(_0x127b25[_0xb687('0x3b')]&&_0x127b25[_0xb687('0x3b')]['autoclose']){_0x127b25['applications']['push']({'id':0x0,'priority':_0x127b25['applications'][_0xb687('0x49')]+0x1,'app':_0xb687('0x4a'),'appdata':_0xb687('0x4b'),'interval':_0xb687('0x4c')});}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x3f')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x3f')];}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x43')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x43')];}if(_0x401b99[_0xb687('0x43')][_0xb687('0x3c')][_0xb687('0x49')]){return _0x401b99[_0xb687('0x43')][_0xb687('0x3c')][0x0];}var _0x4dca01=_['defaults'](_0x2ce07a[_0xb687('0x33')],{'firstName':_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')],'ListId':_0x401b99[_0xb687('0x4d')]});_0x4dca01[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')]['from'];return db[_0xb687('0x2f')]['create'](_0x4dca01);}else{throw new Error(_0xb687('0x4e'));}})[_0xb687('0xf')](function(_0x50fb31){_0x127b25['contact']=_0x50fb31;if(_0x50fb31){if(!_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId']){_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')]=rs['generate']()+'\x20'+_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')];}var _0x1a31f6={'ContactId':_0x50fb31['id'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId'],'to':_0x2ce07a['body'][_0xb687('0x17')]['from'],'cc':_0x2ce07a['body']['message']['cc'],'subject':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x50')],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'};return db[_0xb687('0x54')][_0xb687('0x27')]({'where':{'closed':![],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db[_0xb687('0x55')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x56')]}}]})[_0xb687('0xf')](function(_0x1c031f){if(_0x1c031f){return[_0x1c031f,![]];}return db[_0xb687('0x54')][_0xb687('0x57')](_0x1a31f6)['then'](function(_0x22da49){return[_0x22da49,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xb687('0x58')](function(_0x293281,_0x18993a){if(_0x293281){_0x50fdb7=_0x18993a;if(!_0x18993a){return _0x293281[_0xb687('0x59')]({'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')],'to':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x3a')],'cc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['cc'],'subject':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x50')],'attach':_0x293281[_0xb687('0x51')]?_0x293281[_0xb687('0x51')]:_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'substatus':null,'substatusAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'});}else{return _0x293281;}}})[_0xb687('0xf')](function(_0x48838a){_0x127b25[_0xb687('0x5a')]=_0x48838a[_0xb687('0x5b')]({'plain':!![]});_0x127b25[_0xb687('0x5a')][_0xb687('0x5c')]=_0x50fdb7;return db['MailMessage'][_0xb687('0x57')]({'body':_0x2ce07a[_0xb687('0x33')]['body'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'MailInteractionId':_0x48838a['id'],'direction':'in','ContactId':_0x127b25[_0xb687('0x5d')]['id'],'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x4f')],'from':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')],'to':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['to'],'cc':_0x2ce07a[_0xb687('0x33')]['message']['cc'],'subject':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['subject'],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['attach'],'Attachments':_0x2ce07a['body'][_0xb687('0x17')]['attachments'],'originTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5e')],'originCc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5f')],'bcc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['bcc'],'ChatWebsiteId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x60')]||null,'originChannel':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x61')]||'Email','ChatOfflineMessageId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xb687('0x62')],'as':_0xb687('0x63')}]});})[_0xb687('0xf')](function(_0x1227fe){_0x127b25['message']=_0x1227fe;if(_0x127b25[_0xb687('0x5a')]['UserId']){return db['User'][_0xb687('0x27')]({'attributes':['id','name'],'where':{'id':_0x127b25['interaction'][_0xb687('0x64')]}})['then'](function(_0x137631){if(_0x137631){_0x127b25[_0xb687('0x45')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb687('0x65'),'appdata':_0x137631[_0xb687('0x66')]+','+(_0x127b25['account'][_0xb687('0x67')]||0xa),'interval':_0xb687('0x4c')});}return respondWithRpcPromise(_0xb687('0x68'),_0xb687('0x69'),_0x127b25);});}return respondWithRpcPromise(_0xb687('0x68'),_0xb687('0x69'),_0x127b25);})[_0xb687('0xf')](function(_0x2ce516){_0x394b56(_0x2ce516);})[_0xb687('0x25')](function(_0x4092a0){_0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0x4092a0['message']));});});}; \ No newline at end of file +var _0xc6ac=['update','interaction','created','contact','attachments','originTo','bcc','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','limit','include','map','attributes','model','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','get','omit','applications','list','orderBy','priority','asc','autoclose','length','*,*,*,*','Contacts','create','List\x20not\x20found','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread'];(function(_0x47f523,_0x14cca3){var _0x14d606=function(_0x42ebfb){while(--_0x42ebfb){_0x47f523['push'](_0x47f523['shift']());}};_0x14d606(++_0x14cca3);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x50fabe,_0x273b35){_0x50fabe=_0x50fabe-0x0;var _0x40b874=_0xc6ac[_0x50fabe];return _0x40b874;};'use strict';var _=require(_0xcc6a('0x0'));var moment=require(_0xcc6a('0x1'));var BPromise=require(_0xcc6a('0x2'));var rs=require(_0xcc6a('0x3'));var Redis=require(_0xcc6a('0x4'));var db=require(_0xcc6a('0x5'))['db'];var logger=require(_0xcc6a('0x6'))(_0xcc6a('0x7'));var config=require(_0xcc6a('0x8'));var jayson=require(_0xcc6a('0x9'));var client=jayson[_0xcc6a('0xa')][_0xcc6a('0xb')]({'port':0x232c});config[_0xcc6a('0xc')]=_[_0xcc6a('0xd')](config['redis'],{'host':_0xcc6a('0xe'),'port':0x18eb});var socket=require(_0xcc6a('0xf'))(new Redis(config[_0xcc6a('0xc')]));require('./mailAccount.socket')[_0xcc6a('0x10')](socket);function respondWithRpcPromise(_0x210f63,_0x7806a0,_0x463ebb){return new BPromise(function(_0x3eb04a,_0x5e91a2){return client[_0xcc6a('0x11')](_0x210f63,_0x463ebb)[_0xcc6a('0x12')](function(_0x109693){logger['info'](_0xcc6a('0x13'),_0x7806a0,_0xcc6a('0x14'));logger[_0xcc6a('0x15')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x7806a0,'request\x20sent',JSON[_0xcc6a('0x16')](_0x109693));if(_0x109693[_0xcc6a('0x17')]){if(_0x109693[_0xcc6a('0x17')]['code']===0x1f4){logger['error'](_0xcc6a('0x13'),_0x7806a0,_0x109693[_0xcc6a('0x17')][_0xcc6a('0x18')]);return _0x5e91a2(_0x109693[_0xcc6a('0x17')][_0xcc6a('0x18')]);}logger[_0xcc6a('0x17')](_0xcc6a('0x13'),_0x7806a0,_0x109693[_0xcc6a('0x17')]['message']);return _0x3eb04a(_0x109693['error']['message']);}else{logger[_0xcc6a('0x19')](_0xcc6a('0x13'),_0x7806a0,_0xcc6a('0x14'));_0x3eb04a(_0x109693[_0xcc6a('0x1a')][_0xcc6a('0x18')]);}})[_0xcc6a('0x1b')](function(_0x2d9585){logger[_0xcc6a('0x17')](_0xcc6a('0x13'),_0x7806a0,_0x2d9585);_0x5e91a2(_0x2d9585);});});}exports[_0xcc6a('0x1c')]=function(_0x1d20a3){var _0x5b657e=this;return new Promise(function(_0xfec60f,_0x3e1fda){return db[_0xcc6a('0x1d')][_0xcc6a('0x1e')]({'raw':_0x1d20a3[_0xcc6a('0x1f')]?_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x20')]===undefined?!![]:![]:!![],'where':_0x1d20a3[_0xcc6a('0x1f')]?_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x21')]||null:null,'attributes':_0x1d20a3[_0xcc6a('0x1f')]?_0x1d20a3[_0xcc6a('0x1f')]['attributes']||null:null,'limit':_0x1d20a3[_0xcc6a('0x1f')]?_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x22')]||null:null,'include':_0x1d20a3['options']?_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x23')]?_[_0xcc6a('0x24')](_0x1d20a3[_0xcc6a('0x1f')][_0xcc6a('0x23')],function(_0x5fc697){return{'model':db[_0x5fc697['model']],'as':_0x5fc697['as'],'attributes':_0x5fc697[_0xcc6a('0x25')],'include':_0x5fc697[_0xcc6a('0x23')]?_[_0xcc6a('0x24')](_0x5fc697['include'],function(_0x3afb3a){return{'model':db[_0x3afb3a[_0xcc6a('0x26')]],'as':_0x3afb3a['as'],'attributes':_0x3afb3a['attributes'],'include':_0x3afb3a[_0xcc6a('0x23')]?_[_0xcc6a('0x24')](_0x3afb3a[_0xcc6a('0x23')],function(_0x473f88){return{'model':db[_0x473f88['model']],'as':_0x473f88['as'],'attributes':_0x473f88[_0xcc6a('0x25')]};}):[]};}):[]};}):[]:[]})[_0xcc6a('0x12')](function(_0x2c6d88){logger['info'](_0xcc6a('0x1c'),_0x1d20a3);logger['debug']('GetMailAccount',_0x1d20a3,JSON[_0xcc6a('0x16')](_0x2c6d88));_0xfec60f(_0x2c6d88);})[_0xcc6a('0x1b')](function(_0x3aa315){logger[_0xcc6a('0x17')](_0xcc6a('0x1c'),_0x3aa315[_0xcc6a('0x18')],_0x1d20a3);_0x3e1fda(_0x5b657e['error'](0x1f4,_0x3aa315[_0xcc6a('0x18')]));});});};exports[_0xcc6a('0x27')]=function(_0x147aff){var _0x2faeb5=this;return new Promise(function(_0x211a8c,_0x152ebd){return db[_0xcc6a('0x1d')][_0xcc6a('0x28')]({'raw':_0x147aff['options']?_0x147aff[_0xcc6a('0x1f')][_0xcc6a('0x20')]===undefined?!![]:![]:!![],'where':_0x147aff[_0xcc6a('0x1f')]?_0x147aff[_0xcc6a('0x1f')][_0xcc6a('0x21')]||null:null,'attributes':_0x147aff[_0xcc6a('0x1f')]?_0x147aff[_0xcc6a('0x1f')]['attributes']||null:null,'include':_0x147aff[_0xcc6a('0x1f')]?_0x147aff['options']['include']?_['map'](_0x147aff[_0xcc6a('0x1f')][_0xcc6a('0x23')],function(_0x1101ec){return{'model':db[_0x1101ec[_0xcc6a('0x26')]],'as':_0x1101ec['as'],'attributes':_0x1101ec[_0xcc6a('0x25')],'include':_0x1101ec['include']?_['map'](_0x1101ec[_0xcc6a('0x23')],function(_0x11173a){return{'model':db[_0x11173a[_0xcc6a('0x26')]],'as':_0x11173a['as'],'attributes':_0x11173a['attributes'],'include':_0x11173a[_0xcc6a('0x23')]?_[_0xcc6a('0x24')](_0x11173a[_0xcc6a('0x23')],function(_0xa326b2){return{'model':db[_0xa326b2[_0xcc6a('0x26')]],'as':_0xa326b2['as'],'attributes':_0xa326b2[_0xcc6a('0x25')]};}):[]};}):[]};}):[]:[]})[_0xcc6a('0x12')](function(_0x18a252){if(_0x147aff[_0xcc6a('0x1f')][_0xcc6a('0x29')]===!![])_0x18a252[_0xcc6a('0x2a')](_0xcc6a('0x2b'),_0x18a252[_0xcc6a('0x2c')]());logger[_0xcc6a('0x19')](_0xcc6a('0x27'),_0x147aff);logger[_0xcc6a('0x15')](_0xcc6a('0x27'),_0x147aff,JSON[_0xcc6a('0x16')](_0x18a252));_0x211a8c(_0x18a252);})['catch'](function(_0x553e66){logger[_0xcc6a('0x17')](_0xcc6a('0x27'),_0x553e66[_0xcc6a('0x18')],_0x147aff);_0x152ebd(_0x2faeb5[_0xcc6a('0x17')](0x1f4,_0x553e66[_0xcc6a('0x18')]));});});};exports[_0xcc6a('0x2d')]=function(_0x3273bc){var _0x1199f1=this;return new Promise(function(_0x49b65c,_0x56bc7d){var _0x470e3b={'body':_0x3273bc['body'],'channel':'mail'};var _0x5cf1ba=_[_0xcc6a('0x2e')](_[_0xcc6a('0x2f')](db[_0xcc6a('0x30')][_0xcc6a('0x31')]),[_0xcc6a('0x32'),'updatedAt',_0xcc6a('0x33'),_0xcc6a('0x34')]);var _0x17e5a0=![];if(_0x3273bc[_0xcc6a('0x35')]['id']){delete _0x3273bc[_0xcc6a('0x35')]['id'];}if(_[_0xcc6a('0x36')](_0x3273bc['body'][_0xcc6a('0x37')])){return _0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,_0xcc6a('0x38')));}if(_[_0xcc6a('0x36')](_0x3273bc['body'][_0xcc6a('0x35')])||_0x3273bc['body'][_0xcc6a('0x35')]===''){return _0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,_0xcc6a('0x39')));}if(_['isNil'](_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x3a')])){return _0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5cf1ba));}if(!_['includes'](_0x5cf1ba,_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x3a')])){return _0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,_0xcc6a('0x3b')+_0x5cf1ba));}var _0x345e94={};_0x345e94[_0x3273bc['body'][_0xcc6a('0x3a')]]=_0x3273bc[_0xcc6a('0x35')]['from'];return db[_0xcc6a('0x1d')][_0xcc6a('0x28')]({'where':{'id':_0x3273bc[_0xcc6a('0x3c')]['id']},'include':[{'model':db[_0xcc6a('0x3d')],'as':_0xcc6a('0x3e'),'include':[{'model':db[_0xcc6a('0x30')],'as':'Contacts','where':_0x345e94,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xcc6a('0x3f')],'as':_0xcc6a('0x40')},{'model':db[_0xcc6a('0x41')],'as':_0xcc6a('0x42'),'include':[{'model':db['CloudProvider'],'as':_0xcc6a('0x43')}]}]})['then'](function(_0x3aa7dd){if(_0x3aa7dd&&_0x3aa7dd[_0xcc6a('0x3e')]){var _0xcfc540=_0x3aa7dd[_0xcc6a('0x44')]({'plain':!![]});_0x470e3b[_0xcc6a('0x3c')]=_[_0xcc6a('0x45')](_0xcfc540,['Applications',_0xcc6a('0x3e')]);_0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x2b')]=_0x3aa7dd[_0xcc6a('0x2c')]();_0x470e3b[_0xcc6a('0x46')]=_0xcfc540[_0xcc6a('0x40')];_0x470e3b[_0xcc6a('0x47')]=_0xcfc540[_0xcc6a('0x3e')];_0x470e3b[_0xcc6a('0x46')]=_[_0xcc6a('0x48')](_0x470e3b['applications'],[_0xcc6a('0x49')],[_0xcc6a('0x4a')]);if(_0x470e3b[_0xcc6a('0x3c')]&&_0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x4b')]){_0x470e3b[_0xcc6a('0x46')]['push']({'id':0x0,'priority':_0x470e3b['applications'][_0xcc6a('0x4c')]+0x1,'app':'close','appdata':_0xcc6a('0x4b'),'interval':_0xcc6a('0x4d')});}if(_0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x40')]){delete _0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x40')];}if(_0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x3e')]){delete _0x470e3b[_0xcc6a('0x3c')][_0xcc6a('0x3e')];}if(_0xcfc540[_0xcc6a('0x3e')]['Contacts'][_0xcc6a('0x4c')]){return _0xcfc540['List'][_0xcc6a('0x4e')][0x0];}var _0x1570fe=_[_0xcc6a('0xd')](_0x3273bc['body'],{'firstName':_0x3273bc[_0xcc6a('0x35')]['from'],'ListId':_0xcfc540[_0xcc6a('0x34')]});_0x1570fe[_0x3273bc['body'][_0xcc6a('0x3a')]]=_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x37')];return db[_0xcc6a('0x30')][_0xcc6a('0x4f')](_0x1570fe);}else{throw new Error(_0xcc6a('0x50'));}})[_0xcc6a('0x12')](function(_0x11459f){_0x470e3b['contact']=_0x11459f;if(_0x11459f){if(!_0x3273bc[_0xcc6a('0x35')]['message'][_0xcc6a('0x51')]){_0x3273bc['body'][_0xcc6a('0x18')][_0xcc6a('0x51')]=rs[_0xcc6a('0x52')]()+'\x20'+_0x3273bc['body'][_0xcc6a('0x18')]['from'];}var _0x5e53e4={'ContactId':_0x11459f['id'],'MailAccountId':_0x3273bc[_0xcc6a('0x3c')]['id'],'inReplyTo':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x51')],'to':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x37')],'cc':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['cc'],'subject':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x53')],'attach':_0x3273bc[_0xcc6a('0x35')]['message'][_0xcc6a('0x54')],'lastMsgAt':moment()[_0xcc6a('0x55')](_0xcc6a('0x56')),'lastMsgDirection':'in'};return db[_0xcc6a('0x57')]['find']({'where':{'closed':![],'MailAccountId':_0x3273bc[_0xcc6a('0x3c')]['id']},'include':[{'model':db[_0xcc6a('0x58')],'as':_0xcc6a('0x59'),'attributes':[_0xcc6a('0x51')],'where':{'messageId':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x5a')]}}]})[_0xcc6a('0x12')](function(_0x2686c8){if(_0x2686c8){return[_0x2686c8,![]];}return db[_0xcc6a('0x57')]['create'](_0x5e53e4)['then'](function(_0x4fe041){return[_0x4fe041,!![]];});});}else{throw new Error(_0xcc6a('0x5b'));}})[_0xcc6a('0x5c')](function(_0x9c444,_0x4a9f34){if(_0x9c444){_0x17e5a0=_0x4a9f34;if(!_0x4a9f34){return _0x9c444[_0xcc6a('0x5d')]({'inReplyTo':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x51')],'to':_0x3273bc['body']['message'][_0xcc6a('0x37')],'cc':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['cc'],'subject':_0x3273bc[_0xcc6a('0x35')]['message'][_0xcc6a('0x53')],'attach':_0x9c444[_0xcc6a('0x54')]?_0x9c444[_0xcc6a('0x54')]:_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['attach'],'substatus':null,'substatusAt':moment()['format'](_0xcc6a('0x56')),'lastMsgAt':moment()[_0xcc6a('0x55')](_0xcc6a('0x56')),'lastMsgDirection':'in'});}else{return _0x9c444;}}})[_0xcc6a('0x12')](function(_0x56a3a0){_0x470e3b['interaction']=_0x56a3a0[_0xcc6a('0x44')]({'plain':!![]});_0x470e3b[_0xcc6a('0x5e')][_0xcc6a('0x5f')]=_0x17e5a0;return db[_0xcc6a('0x58')]['create']({'body':_0x3273bc['body']['body'],'MailAccountId':_0x3273bc[_0xcc6a('0x3c')]['id'],'MailInteractionId':_0x56a3a0['id'],'direction':'in','ContactId':_0x470e3b[_0xcc6a('0x60')]['id'],'messageId':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['messageId'],'from':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['from'],'to':_0x3273bc[_0xcc6a('0x35')]['message']['to'],'cc':_0x3273bc[_0xcc6a('0x35')]['message']['cc'],'subject':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x53')],'attach':_0x3273bc['body'][_0xcc6a('0x18')]['attach'],'Attachments':_0x3273bc[_0xcc6a('0x35')]['message'][_0xcc6a('0x61')],'originTo':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x62')],'originCc':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['originCc'],'bcc':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x63')],'ChatWebsiteId':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['ChatWebsiteId']||null,'originChannel':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')]['originChannel']||'Email','ChatOfflineMessageId':_0x3273bc[_0xcc6a('0x35')][_0xcc6a('0x18')][_0xcc6a('0x64')]||null},{'include':[{'model':db[_0xcc6a('0x65')],'as':_0xcc6a('0x66')}]});})[_0xcc6a('0x12')](function(_0x598833){_0x470e3b[_0xcc6a('0x18')]=_0x598833;if(_0x470e3b[_0xcc6a('0x5e')][_0xcc6a('0x67')]){return db[_0xcc6a('0x68')][_0xcc6a('0x28')]({'attributes':['id',_0xcc6a('0x69')],'where':{'id':_0x470e3b['interaction']['UserId']}})[_0xcc6a('0x12')](function(_0x43cbee){if(_0x43cbee){_0x470e3b[_0xcc6a('0x46')][_0xcc6a('0x6a')]({'id':0x0,'priority':0x0,'app':_0xcc6a('0x6b'),'appdata':_0x43cbee[_0xcc6a('0x69')]+','+(_0x470e3b[_0xcc6a('0x3c')]['waitForTheAssignedAgent']||0xa),'interval':_0xcc6a('0x4d')});}return respondWithRpcPromise(_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0x470e3b);});}return respondWithRpcPromise(_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0x470e3b);})[_0xcc6a('0x12')](function(_0x5e8e19){_0x49b65c(_0x5e8e19);})[_0xcc6a('0x1b')](function(_0x4688d3){_0x56bc7d(_0x1199f1[_0xcc6a('0x17')](0x1f4,_0x4688d3['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index aec9099..05be3a0 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 _0x97db=['length','mailAccount:','./mailAccount.events','save','remove','emit','register'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x97db,0x1b4));var _0xb97d=function(_0x39e182,_0x3b1020){_0x39e182=_0x39e182-0x0;var _0x225a2f=_0x97db[_0x39e182];return _0x225a2f;};'use strict';var MailAccountEvents=require(_0xb97d('0x0'));var events=[_0xb97d('0x1'),_0xb97d('0x2'),'update'];function createListener(_0x5dd79c,_0x3770f4){return function(_0xb18d5a){_0x3770f4[_0xb97d('0x3')](_0x5dd79c,_0xb18d5a);};}function removeListener(_0x4382d1,_0x536ee5){return function(){MailAccountEvents['removeListener'](_0x4382d1,_0x536ee5);};}exports[_0xb97d('0x4')]=function(_0x1f59dd){for(var _0x4a5902=0x0,_0x533149=events[_0xb97d('0x5')];_0x4a5902<_0x533149;_0x4a5902++){var _0x57cbd4=events[_0x4a5902];var _0x20f1e1=createListener(_0xb97d('0x6')+_0x57cbd4,_0x1f59dd);MailAccountEvents['on'](_0x57cbd4,_0x20f1e1);}}; \ No newline at end of file +var _0x2d18=['update','emit','removeListener','register','mailAccount:','./mailAccount.events','save','remove'];(function(_0x20463f,_0x4cc37a){var _0x143ee4=function(_0x30bc31){while(--_0x30bc31){_0x20463f['push'](_0x20463f['shift']());}};_0x143ee4(++_0x4cc37a);}(_0x2d18,0xd5));var _0x82d1=function(_0x562123,_0x6a113b){_0x562123=_0x562123-0x0;var _0x349925=_0x2d18[_0x562123];return _0x349925;};'use strict';var MailAccountEvents=require(_0x82d1('0x0'));var events=[_0x82d1('0x1'),_0x82d1('0x2'),_0x82d1('0x3')];function createListener(_0x5d1b04,_0x4a5c61){return function(_0x358b33){_0x4a5c61[_0x82d1('0x4')](_0x5d1b04,_0x358b33);};}function removeListener(_0x3a552e,_0x4667a0){return function(){MailAccountEvents[_0x82d1('0x5')](_0x3a552e,_0x4667a0);};}exports[_0x82d1('0x6')]=function(_0x32b9c8){for(var _0x3e36a0=0x0,_0x295cd5=events['length'];_0x3e36a0<_0x295cd5;_0x3e36a0++){var _0x5b8f24=events[_0x3e36a0];var _0x2d5eca=createListener(_0x82d1('0x7')+_0x5b8f24,_0x32b9c8);MailAccountEvents['on'](_0x5b8f24,_0x2d5eca);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 892111d..9e5a7e2 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 _0xc9fa=['isAuthenticated','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get'];(function(_0x31e0d3,_0x35eed4){var _0x830cb6=function(_0x3b5076){while(--_0x3b5076){_0x31e0d3['push'](_0x31e0d3['shift']());}};_0x830cb6(++_0x35eed4);}(_0xc9fa,0x77));var _0xac9f=function(_0xa74d52,_0x430427){_0xa74d52=_0xa74d52-0x0;var _0x1e1247=_0xc9fa[_0xa74d52];return _0x1e1247;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xac9f('0x0'));var timeout=require(_0xac9f('0x1'));var express=require(_0xac9f('0x2'));var router=express[_0xac9f('0x3')]();var fs_extra=require(_0xac9f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xac9f('0x5'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router[_0xac9f('0x6')]('/:id',auth[_0xac9f('0x7')](),controller['show']);router[_0xac9f('0x8')](_0xac9f('0x9'),auth[_0xac9f('0x7')](),controller[_0xac9f('0xa')]);router[_0xac9f('0xb')](_0xac9f('0x9'),auth[_0xac9f('0x7')](),controller[_0xac9f('0xc')]);module[_0xac9f('0xd')]=router; \ No newline at end of file +var _0x2a57=['put','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x19904b,_0x4c79f5){var _0x2726ad=function(_0x3477d4){while(--_0x3477d4){_0x19904b['push'](_0x19904b['shift']());}};_0x2726ad(++_0x4c79f5);}(_0x2a57,0x1ae));var _0x72a5=function(_0x545b71,_0x4f44eb){_0x545b71=_0x545b71-0x0;var _0x26e587=_0x2a57[_0x545b71];return _0x26e587;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x72a5('0x0'));var express=require(_0x72a5('0x1'));var router=express[_0x72a5('0x2')]();var fs_extra=require(_0x72a5('0x3'));var auth=require(_0x72a5('0x4'));var interaction=require(_0x72a5('0x5'));var config=require(_0x72a5('0x6'));var controller=require(_0x72a5('0x7'));router[_0x72a5('0x8')](_0x72a5('0x9'),auth[_0x72a5('0xa')](),controller[_0x72a5('0xb')]);router[_0x72a5('0xc')](_0x72a5('0x9'),auth[_0x72a5('0xa')](),controller[_0x72a5('0xd')]);router[_0x72a5('0xe')](_0x72a5('0x9'),auth[_0x72a5('0xa')](),controller[_0x72a5('0xf')]);module[_0x72a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 8bb339c..7392e50 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 _0x2fe7=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x25ad66,_0x46e4dc){var _0x141bc4=function(_0x3a7f8e){while(--_0x3a7f8e){_0x25ad66['push'](_0x25ad66['shift']());}};_0x141bc4(++_0x46e4dc);}(_0x2fe7,0x136));var _0x72fe=function(_0x19117c,_0x26dae2){_0x19117c=_0x19117c-0x0;var _0x4370de=_0x2fe7[_0x19117c];return _0x4370de;};'use strict';var Sequelize=require(_0x72fe('0x0'));module['exports']={'priority':{'type':Sequelize[_0x72fe('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x72fe('0x2')],'allowNull':![],'defaultValue':_0x72fe('0x3')},'appdata':{'type':Sequelize[_0x72fe('0x4')]()},'description':{'type':Sequelize[_0x72fe('0x2')]},'interval':{'type':Sequelize[_0x72fe('0x2')],'defaultValue':_0x72fe('0x5')}}; \ No newline at end of file +var _0xc9e0=['sequelize','exports','INTEGER','STRING','*,*,*,*'];(function(_0xdeffe6,_0x198150){var _0x5baeb=function(_0x51e1c5){while(--_0x51e1c5){_0xdeffe6['push'](_0xdeffe6['shift']());}};_0x5baeb(++_0x198150);}(_0xc9e0,0x172));var _0x0c9e=function(_0x11c6a1,_0x3ae8ab){_0x11c6a1=_0x11c6a1-0x0;var _0x27d5cf=_0xc9e0[_0x11c6a1];return _0x27d5cf;};'use strict';var Sequelize=require(_0x0c9e('0x0'));module[_0x0c9e('0x1')]={'priority':{'type':Sequelize[_0x0c9e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0c9e('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0c9e('0x3')],'defaultValue':_0x0c9e('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 0722568..e31b737 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 _0xbdb7=['update','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','attributes','length','includeAll','merge','find','then','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save'];(function(_0x5cab28,_0x307622){var _0xa3554d=function(_0x330139){while(--_0x330139){_0x5cab28['push'](_0x5cab28['shift']());}};_0xa3554d(++_0x307622);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x33a61a,_0x106e32){_0x33a61a=_0x33a61a-0x0;var _0x7c2dfd=_0xbdb7[_0x33a61a];return _0x7c2dfd;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47abaf,_0x4a9e02){return function(_0x2abef6){if(!_0x2abef6){_0x47abaf['sendStatus'](0x194);}return _0x2abef6;};}function handleError(_0x2b14bc,_0x72ba69){_0x72ba69=_0x72ba69||0x1f4;return function(_0x3ec129){logger[_0x7bdb('0x23')](_0x3ec129[_0x7bdb('0x24')]);if(_0x3ec129['name']){delete _0x3ec129[_0x7bdb('0x25')];}_0x2b14bc[_0x7bdb('0x1d')](_0x72ba69)[_0x7bdb('0x26')](_0x3ec129);};}exports[_0x7bdb('0x27')]=function(_0x371e8a,_0x2e8e65){var _0x1e9996={'raw':!![],'where':{'id':_0x371e8a[_0x7bdb('0x28')]['id']}},_0xd2d7be={};_0xd2d7be[_0x7bdb('0x29')]=_[_0x7bdb('0x2a')](db[_0x7bdb('0x2b')]['rawAttributes']);_0xd2d7be[_0x7bdb('0x2c')]=_[_0x7bdb('0x2a')](_0x371e8a[_0x7bdb('0x2c')]);_0xd2d7be[_0x7bdb('0x2d')]=_[_0x7bdb('0x2e')](_0xd2d7be['model'],_0xd2d7be[_0x7bdb('0x2c')]);_0x1e9996[_0x7bdb('0x2f')]=_[_0x7bdb('0x2e')](_0xd2d7be[_0x7bdb('0x29')],qs['fields'](_0x371e8a['query']['fields']));_0x1e9996[_0x7bdb('0x2f')]=_0x1e9996['attributes'][_0x7bdb('0x30')]?_0x1e9996['attributes']:_0xd2d7be[_0x7bdb('0x29')];if(_0x371e8a[_0x7bdb('0x2c')][_0x7bdb('0x31')]){_0x1e9996['include']=[{'all':!![]}];}_0x1e9996=_[_0x7bdb('0x32')]({},_0x1e9996,_0x371e8a['options']);return db['MailApplication'][_0x7bdb('0x33')](_0x1e9996)['then'](handleEntityNotFound(_0x2e8e65,null))[_0x7bdb('0x34')](respondWithResult(_0x2e8e65,null))['catch'](handleError(_0x2e8e65,null));};exports['update']=function(_0x206c26,_0x353b26){if(_0x206c26[_0x7bdb('0x35')]['id']){delete _0x206c26[_0x7bdb('0x35')]['id'];}return db[_0x7bdb('0x2b')][_0x7bdb('0x33')]({'where':{'id':_0x206c26['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x353b26,null))[_0x7bdb('0x34')](saveUpdates(_0x206c26[_0x7bdb('0x35')],null))[_0x7bdb('0x34')](respondWithResult(_0x353b26,null))[_0x7bdb('0x36')](handleError(_0x353b26,null));};exports[_0x7bdb('0x37')]=function(_0x228340,_0x2587af){return db[_0x7bdb('0x2b')]['find']({'where':{'id':_0x228340['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x2587af,null))[_0x7bdb('0x34')](removeEntity(_0x2587af,null))[_0x7bdb('0x36')](handleError(_0x2587af,null));}; \ No newline at end of file +var _0xa9e0=['includeAll','merge','options','find','catch','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x459391,_0x5c702a){var _0x528c39=function(_0x31fbeb){while(--_0x31fbeb){_0x459391['push'](_0x459391['shift']());}};_0x528c39(++_0x5c702a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 42dad65..222e853 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 _0x5173=['request-promise','path','./mailApplication.attributes','define','MailApplication','utf8mb4','../../config/logger','api','moment','bluebird'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0x5173,0x178));var _0x3517=function(_0x5a22e8,_0x329992){_0x5a22e8=_0x5a22e8-0x0;var _0x389674=_0x5173[_0x5a22e8];return _0x389674;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3517('0x0'))(_0x3517('0x1'));var moment=require(_0x3517('0x2'));var BPromise=require(_0x3517('0x3'));var rp=require(_0x3517('0x4'));var fs=require('fs');var path=require(_0x3517('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3517('0x6'));module['exports']=function(_0x213bdb,_0xbb5a16){return _0x213bdb[_0x3517('0x7')](_0x3517('0x8'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3517('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x22fd=['./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x24ae72,_0x1442cc){var _0x29423e=function(_0x1b833a){while(--_0x1b833a){_0x24ae72['push'](_0x24ae72['shift']());}};_0x29423e(++_0x1442cc);}(_0x22fd,0x1a7));var _0xd22f=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x22fd[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require('lodash');var util=require(_0xd22f('0x0'));var logger=require(_0xd22f('0x1'))(_0xd22f('0x2'));var moment=require(_0xd22f('0x3'));var BPromise=require(_0xd22f('0x4'));var rp=require(_0xd22f('0x5'));var fs=require('fs');var path=require(_0xd22f('0x6'));var rimraf=require(_0xd22f('0x7'));var config=require(_0xd22f('0x8'));var attributes=require(_0xd22f('0x9'));module[_0xd22f('0xa')]=function(_0x2db232,_0x4643e0){return _0x2db232[_0xd22f('0xb')](_0xd22f('0xc'),attributes,{'tableName':_0xd22f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd22f('0xe'),'collate':_0xd22f('0xf')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index dd1a34e..f15bbd5 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 _0x805b=['UpdateMailApplication','MailApplication','body','options','raw','limit','info','stringify','catch','util','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x2e8660,_0x5ca0c2){var _0x3dc331=function(_0x20f7c1){while(--_0x20f7c1){_0x2e8660['push'](_0x2e8660['shift']());}};_0x3dc331(++_0x5ca0c2);}(_0x805b,0x159));var _0xb805=function(_0x23b4ab,_0x5e64e9){_0x23b4ab=_0x23b4ab-0x0;var _0x1f0537=_0x805b[_0x23b4ab];return _0x1f0537;};'use strict';var _=require('lodash');var util=require(_0xb805('0x0'));var moment=require('moment');var BPromise=require(_0xb805('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb805('0x2'));var logger=require('../../config/logger')(_0xb805('0x3'));var config=require(_0xb805('0x4'));var jayson=require(_0xb805('0x5'));var client=jayson[_0xb805('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x390759,_0x4fbd33,_0xfd0bd9){return new BPromise(function(_0x228b2e,_0x411c5d){return client['request'](_0x390759,_0xfd0bd9)[_0xb805('0x7')](function(_0x5b4583){logger['info'](_0xb805('0x8'),_0x4fbd33,_0xb805('0x9'));logger[_0xb805('0xa')](_0xb805('0xb'),_0x4fbd33,'request\x20sent',JSON['stringify'](_0x5b4583));if(_0x5b4583['error']){if(_0x5b4583[_0xb805('0xc')]['code']===0x1f4){logger['error'](_0xb805('0x8'),_0x4fbd33,_0x5b4583[_0xb805('0xc')][_0xb805('0xd')]);return _0x411c5d(_0x5b4583[_0xb805('0xc')]['message']);}logger[_0xb805('0xc')](_0xb805('0x8'),_0x4fbd33,_0x5b4583[_0xb805('0xc')]['message']);return _0x228b2e(_0x5b4583[_0xb805('0xc')][_0xb805('0xd')]);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x4fbd33,_0xb805('0x9'));_0x228b2e(_0x5b4583[_0xb805('0xe')][_0xb805('0xd')]);}})['catch'](function(_0xd221ae){logger[_0xb805('0xc')]('MailApplication,\x20%s,\x20%s',_0x4fbd33,_0xd221ae);_0x411c5d(_0xd221ae);});});}exports[_0xb805('0xf')]=function(_0x195ba2){var _0x4091e4=this;return new Promise(function(_0x467a0e,_0x5ec00f){return db[_0xb805('0x10')]['update'](_0x195ba2[_0xb805('0x11')],{'raw':_0x195ba2[_0xb805('0x12')]?_0x195ba2['options'][_0xb805('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x195ba2[_0xb805('0x12')]?_0x195ba2[_0xb805('0x12')]['where']||null:null,'attributes':_0x195ba2[_0xb805('0x12')]?_0x195ba2[_0xb805('0x12')]['attributes']||null:null,'limit':_0x195ba2['options']?_0x195ba2[_0xb805('0x12')][_0xb805('0x14')]||null:null})[_0xb805('0x7')](function(_0x2e27b5){logger[_0xb805('0x15')](_0xb805('0xf'),_0x195ba2);logger[_0xb805('0xa')]('UpdateMailApplication',_0x195ba2,JSON[_0xb805('0x16')](_0x2e27b5));_0x467a0e(_0x2e27b5);})[_0xb805('0x17')](function(_0x32cdb9){logger[_0xb805('0xc')](_0xb805('0xf'),_0x32cdb9[_0xb805('0xd')],_0x195ba2);_0x5ec00f(_0x4091e4[_0xb805('0xc')](0x1f4,_0x32cdb9[_0xb805('0xd')]));});});}; \ No newline at end of file +var _0x05b1=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailApplication','body','options','raw','attributes','UpdateMailApplication','debug'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x05b1,0x188));var _0x105b=function(_0x11e02d,_0x5d4f13){_0x11e02d=_0x11e02d-0x0;var _0x23722d=_0x05b1[_0x11e02d];return _0x23722d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x105b('0x0'));var BPromise=require(_0x105b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x105b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x105b('0x3'));var logger=require(_0x105b('0x4'))(_0x105b('0x5'));var config=require(_0x105b('0x6'));var jayson=require(_0x105b('0x7'));var client=jayson[_0x105b('0x8')][_0x105b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c078a,_0x55315c,_0xd4e437){return new BPromise(function(_0xd0ca10,_0x5b8d92){return client['request'](_0x4c078a,_0xd4e437)[_0x105b('0xa')](function(_0x1a0f75){logger[_0x105b('0xb')](_0x105b('0xc'),_0x55315c,_0x105b('0xd'));logger['debug'](_0x105b('0xe'),_0x55315c,_0x105b('0xd'),JSON[_0x105b('0xf')](_0x1a0f75));if(_0x1a0f75[_0x105b('0x10')]){if(_0x1a0f75[_0x105b('0x10')][_0x105b('0x11')]===0x1f4){logger[_0x105b('0x10')](_0x105b('0xc'),_0x55315c,_0x1a0f75['error'][_0x105b('0x12')]);return _0x5b8d92(_0x1a0f75[_0x105b('0x10')][_0x105b('0x12')]);}logger[_0x105b('0x10')]('MailApplication,\x20%s,\x20%s',_0x55315c,_0x1a0f75['error'][_0x105b('0x12')]);return _0xd0ca10(_0x1a0f75[_0x105b('0x10')][_0x105b('0x12')]);}else{logger['info'](_0x105b('0xc'),_0x55315c,_0x105b('0xd'));_0xd0ca10(_0x1a0f75[_0x105b('0x13')][_0x105b('0x12')]);}})[_0x105b('0x14')](function(_0x43a46f){logger[_0x105b('0x10')](_0x105b('0xc'),_0x55315c,_0x43a46f);_0x5b8d92(_0x43a46f);});});}exports['UpdateMailApplication']=function(_0x41ca53){var _0x197bf2=this;return new Promise(function(_0x423e4f,_0x5e555c){return db[_0x105b('0x15')]['update'](_0x41ca53[_0x105b('0x16')],{'raw':_0x41ca53[_0x105b('0x17')]?_0x41ca53['options'][_0x105b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41ca53[_0x105b('0x17')]?_0x41ca53['options']['where']||null:null,'attributes':_0x41ca53[_0x105b('0x17')]?_0x41ca53[_0x105b('0x17')][_0x105b('0x19')]||null:null,'limit':_0x41ca53['options']?_0x41ca53[_0x105b('0x17')]['limit']||null:null})[_0x105b('0xa')](function(_0x2ab97f){logger[_0x105b('0xb')](_0x105b('0x1a'),_0x41ca53);logger[_0x105b('0x1b')](_0x105b('0x1a'),_0x41ca53,JSON[_0x105b('0xf')](_0x2ab97f));_0x423e4f(_0x2ab97f);})['catch'](function(_0x256219){logger[_0x105b('0x10')](_0x105b('0x1a'),_0x256219[_0x105b('0x12')],_0x41ca53);_0x5e555c(_0x197bf2[_0x105b('0x10')](0x1f4,_0x256219[_0x105b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index d9c1cac..9f26d75 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 _0xe580=['delete','removeTags','exports','express','Router','get','index','/describe','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','mail','addTags','update','mailinteraction:destroy','destroy'];(function(_0x4d1ee2,_0x37b3d4){var _0x22aca9=function(_0x10fc9c){while(--_0x10fc9c){_0x4d1ee2['push'](_0x4d1ee2['shift']());}};_0x22aca9(++_0x37b3d4);}(_0xe580,0x1cb));var _0x0e58=function(_0x1007da,_0x4faa60){_0x1007da=_0x1007da-0x0;var _0x4bbfcc=_0xe580[_0x1007da];return _0x4bbfcc;};'use strict';var express=require(_0x0e58('0x0'));var router=express[_0x0e58('0x1')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var controller=require('./mailInteraction.controller');router[_0x0e58('0x2')]('/',auth['isAuthenticated'](),controller[_0x0e58('0x3')]);router['get'](_0x0e58('0x4'),auth[_0x0e58('0x5')](),controller[_0x0e58('0x6')]);router[_0x0e58('0x2')](_0x0e58('0x7'),auth[_0x0e58('0x5')](),controller['show']);router[_0x0e58('0x2')](_0x0e58('0x8'),auth[_0x0e58('0x5')](),controller[_0x0e58('0x9')]);router[_0x0e58('0x2')](_0x0e58('0xa'),auth[_0x0e58('0x5')](),controller[_0x0e58('0xb')]);router[_0x0e58('0xc')]('/',auth[_0x0e58('0x5')](),controller['create']);router['post'](_0x0e58('0x8'),auth[_0x0e58('0x5')](),controller[_0x0e58('0xd')]);router[_0x0e58('0xc')](_0x0e58('0xe'),auth['isAuthenticated'](),interaction[_0x0e58('0xf')](_0x0e58('0x10'),'mailinteraction:addtags'),controller[_0x0e58('0x11')]);router['put'](_0x0e58('0x7'),auth[_0x0e58('0x5')](),interaction[_0x0e58('0xf')](_0x0e58('0x10'),'mailinteraction:update'),controller[_0x0e58('0x12')]);router['delete'](_0x0e58('0x7'),auth[_0x0e58('0x5')](),interaction[_0x0e58('0xf')](_0x0e58('0x10'),_0x0e58('0x13')),controller[_0x0e58('0x14')]);router[_0x0e58('0x15')](_0x0e58('0xe'),auth[_0x0e58('0x5')](),controller[_0x0e58('0x16')]);module[_0x0e58('0x17')]=router; \ No newline at end of file +var _0x2599=['destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','mailinteraction:addtags','addTags','put','tracked','mail','update','delete'];(function(_0x4663cf,_0x4045b2){var _0x5e7f76=function(_0x1e01ae){while(--_0x1e01ae){_0x4663cf['push'](_0x4663cf['shift']());}};_0x5e7f76(++_0x4045b2);}(_0x2599,0xc7));var _0x9259=function(_0x163530,_0x50c8a7){_0x163530=_0x163530-0x0;var _0x15df78=_0x2599[_0x163530];return _0x15df78;};'use strict';var express=require(_0x9259('0x0'));var router=express[_0x9259('0x1')]();var auth=require(_0x9259('0x2'));var interaction=require(_0x9259('0x3'));var controller=require(_0x9259('0x4'));router[_0x9259('0x5')]('/',auth[_0x9259('0x6')](),controller[_0x9259('0x7')]);router['get'](_0x9259('0x8'),auth[_0x9259('0x6')](),controller[_0x9259('0x9')]);router[_0x9259('0x5')](_0x9259('0xa'),auth[_0x9259('0x6')](),controller[_0x9259('0xb')]);router['get'](_0x9259('0xc'),auth[_0x9259('0x6')](),controller[_0x9259('0xd')]);router[_0x9259('0x5')](_0x9259('0xe'),auth[_0x9259('0x6')](),controller['download']);router[_0x9259('0xf')]('/',auth[_0x9259('0x6')](),controller[_0x9259('0x10')]);router[_0x9259('0xf')](_0x9259('0xc'),auth[_0x9259('0x6')](),controller[_0x9259('0x11')]);router['post']('/:id/tags',auth['isAuthenticated'](),interaction['tracked']('mail',_0x9259('0x12')),controller[_0x9259('0x13')]);router[_0x9259('0x14')](_0x9259('0xa'),auth['isAuthenticated'](),interaction[_0x9259('0x15')](_0x9259('0x16'),'mailinteraction:update'),controller[_0x9259('0x17')]);router[_0x9259('0x18')](_0x9259('0xa'),auth['isAuthenticated'](),interaction[_0x9259('0x15')](_0x9259('0x16'),'mailinteraction:destroy'),controller[_0x9259('0x19')]);router[_0x9259('0x18')]('/:id/tags',auth[_0x9259('0x6')](),controller[_0x9259('0x1a')]);module[_0x9259('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index a708dfc..c97756f 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 _0x1f27=['BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv','exports'];(function(_0x52d1eb,_0x1c4851){var _0x5ae68c=function(_0x21f800){while(--_0x21f800){_0x52d1eb['push'](_0x52d1eb['shift']());}};_0x5ae68c(++_0x1c4851);}(_0x1f27,0x13d));var _0x71f2=function(_0x391ed9,_0x2eb822){_0x391ed9=_0x391ed9-0x0;var _0xf7734d=_0x1f27[_0x391ed9];return _0xf7734d;};'use strict';var Sequelize=require(_0x71f2('0x0'));var iconv=require(_0x71f2('0x1'));module[_0x71f2('0x2')]={'closed':{'type':Sequelize[_0x71f2('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x71f2('0x4')]},'disposition':{'type':Sequelize[_0x71f2('0x5')]},'secondDisposition':{'type':Sequelize[_0x71f2('0x5')]},'thirdDisposition':{'type':Sequelize[_0x71f2('0x5')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x71f2('0x5')]},'cc':{'type':Sequelize[_0x71f2('0x6')](_0x71f2('0x7'))},'subject':{'type':Sequelize[_0x71f2('0x6')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x71f2('0x4')]},'substatus':{'type':Sequelize[_0x71f2('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x71f2('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x71f2('0x8')]('in',_0x71f2('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x71f2('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x71f2('0x8')]('in',_0x71f2('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x71f2('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x65ff=['STRING','long','DATE','ENUM','out','iconv','exports','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x65ff,0x1dd));var _0xf65f=function(_0x24c178,_0x2e588b){_0x24c178=_0x24c178-0x0;var _0x35a2d8=_0x65ff[_0x24c178];return _0x35a2d8;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0xf65f('0x0'));module[_0xf65f('0x1')]={'closed':{'type':Sequelize[_0xf65f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf65f('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf65f('0x3')]},'note':{'type':Sequelize[_0xf65f('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xf65f('0x3')]},'cc':{'type':Sequelize['TEXT'](_0xf65f('0x4'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0xf65f('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xf65f('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0xf65f('0x5')]},'firstMsgDirection':{'type':Sequelize[_0xf65f('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf65f('0x5')]},'lastMsgDirection':{'type':Sequelize[_0xf65f('0x6')]('in',_0xf65f('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf65f('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 603abeb..24892c1 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 _0x61a6=['spread','Tag','color','emit','mailInteractionTags:save','removeTags','download','toString','root','files','tmp','attachments','join','transcript-%d-%s.zip','push','Attachment','Messages','from','bcc','subject','createdAt','get','each','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','build','writeFileSync','message%d.eml','unlinkSync','sendStatus','eml-format','moment','bluebird','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','end','json','undefined','limit','count','offset','status','Content-Range','update','then','error','stack','name','send','index','map','MailInteraction','type','key','findAll','mail','query','user','show','params','model','keys','intersection','attributes','fields','length','includeAll','merge','options','find','catch','body','destroy','describe','addMessage','MailMessage','ids','getMessages','findOne','rawAttributes','filters','nolimit','order','sort','where','MailInteractionId','filter','$gte','split','format','true','rows','addTags','omit'];(function(_0x1628b3,_0x5f1805){var _0x4bad95=function(_0x1afa12){while(--_0x1afa12){_0x1628b3['push'](_0x1628b3['shift']());}};_0x4bad95(++_0x5f1805);}(_0x61a6,0x1e8));var _0x661a=function(_0x5d51be,_0x2d1764){_0x5d51be=_0x5d51be-0x0;var _0x5e899d=_0x61a6[_0x5d51be];return _0x5e899d;};'use strict';var emlformat=require(_0x661a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x661a('0x1'));var BPromise=require(_0x661a('0x2'));var util=require(_0x661a('0x3'));var path=require(_0x661a('0x4'));var fs=require('fs');var _=require('lodash');var juice=require('juice');var Redis=require(_0x661a('0x5'));var interaction=require(_0x661a('0x6'));var qs=require(_0x661a('0x7'));var logger=require(_0x661a('0x8'))(_0x661a('0x9'));var config=require(_0x661a('0xa'));var db=require(_0x661a('0xb'))['db'];var htmlEntities=require(_0x661a('0xc'));config['redis']=_[_0x661a('0xd')](config[_0x661a('0xe')],{'host':_0x661a('0xf'),'port':0x18eb});var socket=require(_0x661a('0x10'))(new Redis(config[_0x661a('0xe')]));require(_0x661a('0x11'))['register'](socket);function respondWithStatusCode(_0x285d28,_0x537b13){_0x537b13=_0x537b13||0xcc;return function(_0x3e41de){if(_0x3e41de){return _0x285d28['sendStatus'](_0x537b13);}return _0x285d28['status'](_0x537b13)[_0x661a('0x12')]();};}function respondWithResult(_0x1ef032,_0x2d2960){_0x2d2960=_0x2d2960||0xc8;return function(_0x3c303a){if(_0x3c303a){return _0x1ef032['status'](_0x2d2960)[_0x661a('0x13')](_0x3c303a);}};}function respondWithFilteredResult(_0x2212e0,_0x511d8f){return function(_0x1eb85c){if(_0x1eb85c){var _0x5a2cff=typeof _0x511d8f['offset']===_0x661a('0x14')&&typeof _0x511d8f[_0x661a('0x15')]===_0x661a('0x14');var _0x37beea=_0x1eb85c[_0x661a('0x16')];var _0x545855=_0x5a2cff?0x0:_0x511d8f[_0x661a('0x17')];var _0x1c9030=_0x5a2cff?_0x1eb85c[_0x661a('0x16')]:_0x511d8f[_0x661a('0x17')]+_0x511d8f[_0x661a('0x15')];var _0x1233f;if(_0x1c9030>=_0x37beea){_0x1c9030=_0x37beea;_0x1233f=0xc8;}else{_0x1233f=0xce;}_0x2212e0[_0x661a('0x18')](_0x1233f);return _0x2212e0['set'](_0x661a('0x19'),_0x545855+'-'+_0x1c9030+'/'+_0x37beea)['json'](_0x1eb85c);}return null;};}function saveUpdates(_0x372293){return function(_0x4d1a25){if(_0x4d1a25){return _0x4d1a25[_0x661a('0x1a')](_0x372293)[_0x661a('0x1b')](function(_0x1f1ec9){return _0x1f1ec9;});}return null;};}function removeEntity(_0x2abc3f){return function(_0x586663){if(_0x586663){return _0x586663['destroy']()[_0x661a('0x1b')](function(){_0x2abc3f[_0x661a('0x18')](0xcc)[_0x661a('0x12')]();});}};}function handleEntityNotFound(_0x11b04c){return function(_0x5cad3f){if(!_0x5cad3f){_0x11b04c['sendStatus'](0x194);}return _0x5cad3f;};}function handleError(_0x47a267,_0x3bca59){_0x3bca59=_0x3bca59||0x1f4;return function(_0x439777){logger[_0x661a('0x1c')](_0x439777[_0x661a('0x1d')]);if(_0x439777[_0x661a('0x1e')]){delete _0x439777['name'];}_0x47a267['status'](_0x3bca59)[_0x661a('0x1f')](_0x439777);};}exports[_0x661a('0x20')]=function(_0x1546b0,_0x4a5729){var _0x402330={};var _0x220fed=_[_0x661a('0x21')](db[_0x661a('0x22')]['rawAttributes'],function(_0x4dd609){return{'name':_0x4dd609['fieldName'],'type':_0x4dd609[_0x661a('0x23')][_0x661a('0x24')]};});_0x402330=qs['getOptions'](_0x220fed,_0x1546b0);return interaction[_0x661a('0x25')](_0x661a('0x26'),_0x1546b0[_0x661a('0x27')],_0x1546b0[_0x661a('0x28')],_0x402330,_0x220fed)[_0x661a('0x1b')](respondWithFilteredResult(_0x4a5729,_0x402330))['catch'](handleError(_0x4a5729,null));};exports[_0x661a('0x29')]=function(_0x530932,_0x2951e5){var _0x5ec98f={'raw':![],'where':{'id':_0x530932[_0x661a('0x2a')]['id']}},_0x53cc23={};_0x53cc23[_0x661a('0x2b')]=_[_0x661a('0x2c')](db['MailInteraction']['rawAttributes']);_0x53cc23[_0x661a('0x27')]=_['keys'](_0x530932[_0x661a('0x27')]);_0x53cc23['filters']=_[_0x661a('0x2d')](_0x53cc23[_0x661a('0x2b')],_0x53cc23['query']);_0x5ec98f[_0x661a('0x2e')]=_[_0x661a('0x2d')](_0x53cc23[_0x661a('0x2b')],qs[_0x661a('0x2f')](_0x530932[_0x661a('0x27')][_0x661a('0x2f')]));_0x5ec98f[_0x661a('0x2e')]=_0x5ec98f[_0x661a('0x2e')][_0x661a('0x30')]?_0x5ec98f[_0x661a('0x2e')]:_0x53cc23['model'];if(_0x530932[_0x661a('0x27')][_0x661a('0x31')]){_0x5ec98f['include']=[{'all':!![]}];}_0x5ec98f=_[_0x661a('0x32')]({},_0x5ec98f,_0x530932[_0x661a('0x33')]);return db[_0x661a('0x22')][_0x661a('0x34')](_0x5ec98f)[_0x661a('0x1b')](handleEntityNotFound(_0x2951e5,null))[_0x661a('0x1b')](respondWithResult(_0x2951e5,null))[_0x661a('0x35')](handleError(_0x2951e5,null));};exports['create']=function(_0x545708,_0x8398e4){return db[_0x661a('0x22')]['create'](_0x545708[_0x661a('0x36')],{})[_0x661a('0x1b')](respondWithResult(_0x8398e4,0xc9))[_0x661a('0x35')](handleError(_0x8398e4,null));};exports[_0x661a('0x1a')]=function(_0x158bdf,_0x1437c9){if(_0x158bdf[_0x661a('0x36')]['id']){delete _0x158bdf[_0x661a('0x36')]['id'];}return db['MailInteraction'][_0x661a('0x34')]({'where':{'id':_0x158bdf[_0x661a('0x2a')]['id']}})[_0x661a('0x1b')](handleEntityNotFound(_0x1437c9,null))[_0x661a('0x1b')](saveUpdates(_0x158bdf['body'],null))[_0x661a('0x1b')](respondWithResult(_0x1437c9,null))[_0x661a('0x35')](handleError(_0x1437c9,null));};exports[_0x661a('0x37')]=function(_0x4428fd,_0x518275){return db['MailInteraction'][_0x661a('0x34')]({'where':{'id':_0x4428fd[_0x661a('0x2a')]['id']}})[_0x661a('0x1b')](handleEntityNotFound(_0x518275,null))['then'](removeEntity(_0x518275,null))[_0x661a('0x35')](handleError(_0x518275,null));};exports['describe']=function(_0x3ac0e3,_0x3ff16b){return db[_0x661a('0x22')][_0x661a('0x38')]()['then'](respondWithResult(_0x3ff16b,null))[_0x661a('0x35')](handleError(_0x3ff16b,null));};exports[_0x661a('0x39')]=function(_0x52430f,_0x227b57){return db[_0x661a('0x3a')][_0x661a('0x34')]({'where':{'id':_0x52430f['params']['id']}})['then'](handleEntityNotFound(_0x227b57,null))[_0x661a('0x1b')](function(_0x27e9ce){if(_0x27e9ce){return _0x27e9ce['addMessage'](_0x52430f['body'][_0x661a('0x3b')],_['omit'](_0x52430f[_0x661a('0x36')],[_0x661a('0x3b'),'id'])||{});}})['then'](respondWithResult(_0x227b57,null))[_0x661a('0x35')](handleError(_0x227b57,null));};exports[_0x661a('0x3c')]=function(_0x1ef6e5,_0x2c6977){var _0x2891f9={'raw':![],'where':{}};var _0x47ae63={};var _0x338258={'count':0x0,'rows':[]};return db['MailInteraction'][_0x661a('0x3d')]({'where':{'id':_0x1ef6e5[_0x661a('0x2a')]['id']}})[_0x661a('0x1b')](handleEntityNotFound(_0x2c6977,null))[_0x661a('0x1b')](function(_0x17a139){if(_0x17a139){_0x47ae63[_0x661a('0x2b')]=_[_0x661a('0x2c')](db['MailMessage'][_0x661a('0x3e')]);_0x47ae63['query']=_['keys'](_0x1ef6e5[_0x661a('0x27')]);_0x47ae63[_0x661a('0x3f')]=_['intersection'](_0x47ae63[_0x661a('0x2b')],_0x47ae63[_0x661a('0x27')]);_0x2891f9[_0x661a('0x2e')]=_[_0x661a('0x2d')](_0x47ae63[_0x661a('0x2b')],qs[_0x661a('0x2f')](_0x1ef6e5[_0x661a('0x27')][_0x661a('0x2f')]));_0x2891f9[_0x661a('0x2e')]=_0x2891f9['attributes']['length']?_0x2891f9['attributes']:_0x47ae63[_0x661a('0x2b')];if(!_0x1ef6e5[_0x661a('0x27')]['hasOwnProperty'](_0x661a('0x40'))){_0x2891f9[_0x661a('0x15')]=qs[_0x661a('0x15')](_0x1ef6e5[_0x661a('0x27')]['limit']);_0x2891f9[_0x661a('0x17')]=qs['offset'](_0x1ef6e5[_0x661a('0x27')][_0x661a('0x17')]);}_0x2891f9[_0x661a('0x41')]=qs[_0x661a('0x42')](_0x1ef6e5[_0x661a('0x27')][_0x661a('0x42')]);_0x2891f9['where']=qs['filters'](_['pick'](_0x1ef6e5[_0x661a('0x27')],_0x47ae63[_0x661a('0x3f')]));_0x2891f9[_0x661a('0x43')][_0x661a('0x44')]=_0x17a139['id'];if(_0x1ef6e5[_0x661a('0x27')][_0x661a('0x45')]){_0x2891f9[_0x661a('0x43')]=_[_0x661a('0x32')](_0x2891f9[_0x661a('0x43')],{'$or':_[_0x661a('0x21')](_0x2891f9[_0x661a('0x2e')],function(_0x158f55){var _0x3bf441={};_0x3bf441[_0x158f55]={'$like':'%'+_0x1ef6e5[_0x661a('0x27')][_0x661a('0x45')]+'%'};return _0x3bf441;})});}if(_0x1ef6e5[_0x661a('0x27')][_0x661a('0x46')]){var _0x5db005=_0x1ef6e5[_0x661a('0x27')][_0x661a('0x46')][_0x661a('0x47')](',');var _0x240d4e={};_0x240d4e[_0x5db005[0x0]]={'$gte':moment(_0x5db005[0x1])[_0x661a('0x48')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2891f9[_0x661a('0x43')]=_['merge'](_0x2891f9[_0x661a('0x43')],_0x240d4e);}_0x2891f9=_['merge']({},_0x2891f9,_0x1ef6e5['options']);return db['MailMessage'][_0x661a('0x16')]({'where':_0x2891f9[_0x661a('0x43')]})[_0x661a('0x1b')](function(_0x56e13d){_0x338258[_0x661a('0x16')]=_0x56e13d;if(_0x1ef6e5['query'][_0x661a('0x31')]){_0x2891f9['include']=[{'all':!![]}];}return db[_0x661a('0x3a')]['findAll'](_0x2891f9);})[_0x661a('0x1b')](function(_0x165705){if(_0x1ef6e5[_0x661a('0x27')]['inlineCss']===_0x661a('0x49')){for(var _0x5d7b71=0x0;_0x5d7b71<_0x165705[_0x661a('0x30')];_0x5d7b71++){_0x165705[_0x5d7b71][_0x661a('0x36')]=juice(_0x165705[_0x5d7b71]['body']);}}_0x338258[_0x661a('0x4a')]=_0x165705;return _0x338258;});}})['then'](respondWithFilteredResult(_0x2c6977,_0x2891f9))['catch'](handleError(_0x2c6977,null));};exports[_0x661a('0x4b')]=function(_0x25864d,_0x5c289d){return db[_0x661a('0x22')][_0x661a('0x34')]({'where':{'id':_0x25864d[_0x661a('0x2a')]['id']}})[_0x661a('0x1b')](handleEntityNotFound(_0x5c289d,null))[_0x661a('0x1b')](function(_0x565267){if(_0x565267){return _0x565267['setTags'](_0x25864d[_0x661a('0x36')][_0x661a('0x3b')],_[_0x661a('0x4c')](_0x25864d[_0x661a('0x36')],[_0x661a('0x3b'),'id'])||{})[_0x661a('0x4d')](function(){return db[_0x661a('0x4e')][_0x661a('0x25')]({'attributes':['id',_0x661a('0x1e'),_0x661a('0x4f')],'where':{'id':_0x25864d[_0x661a('0x36')][_0x661a('0x3b')]}});})[_0x661a('0x1b')](function(_0x4725c0){socket[_0x661a('0x50')](_0x661a('0x51'),{'id':Number(_0x25864d[_0x661a('0x2a')]['id']),'tags':_0x4725c0||[]});return{'id':Number(_0x25864d[_0x661a('0x2a')]['id']),'tags':_0x4725c0||[]};});}})[_0x661a('0x1b')](respondWithResult(_0x5c289d,null))['catch'](handleError(_0x5c289d,null));};exports[_0x661a('0x52')]=function(_0x45e213,_0x50ddb0){return db[_0x661a('0x22')]['find']({'where':{'id':_0x45e213['params']['id']}})['then'](handleEntityNotFound(_0x50ddb0,null))[_0x661a('0x1b')](function(_0x48911f){if(_0x48911f){return _0x48911f['removeTags'](_0x45e213['query'][_0x661a('0x3b')]);}})[_0x661a('0x1b')](respondWithStatusCode(_0x50ddb0,null))[_0x661a('0x35')](handleError(_0x50ddb0,null));};exports[_0x661a('0x53')]=function(_0x207c97,_0x331158){var _0x27d835=moment()['unix']()[_0x661a('0x54')]();var _0x572ef0=path['join'](config[_0x661a('0x55')],'server',_0x661a('0x56'),_0x661a('0x57'));var _0x152094=path['join'](config[_0x661a('0x55')],'server',_0x661a('0x56'),_0x661a('0x58'));var _0x26fa75=path[_0x661a('0x59')](_0x572ef0,_0x27d835);var _0x256ef6=util[_0x661a('0x48')](_0x661a('0x5a'),_0x207c97[_0x661a('0x2a')]['id'],_0x27d835);var _0x543b48=path['join'](_0x572ef0,_0x256ef6);var _0x86f12b=[];if(_0x207c97[_0x661a('0x27')][_0x661a('0x58')]){_0x86f12b[_0x661a('0x5b')]({'model':db[_0x661a('0x5c')],'as':'Attachments','raw':!![]});}var _0x3b142d=[{'model':db[_0x661a('0x3a')],'as':_0x661a('0x5d'),'attributes':['id',_0x661a('0x36'),_0x661a('0x5e'),'to','cc',_0x661a('0x5f'),_0x661a('0x60'),_0x661a('0x61')],'where':{'secret':![]},'order':qs[_0x661a('0x42')]('id'),'include':_0x86f12b}];return db[_0x661a('0x22')][_0x661a('0x34')]({'where':{'id':_0x207c97[_0x661a('0x2a')]['id']},'include':_0x3b142d})[_0x661a('0x1b')](handleEntityNotFound(_0x331158,null))[_0x661a('0x1b')](function(_0x2a3d68){if(_0x2a3d68&&_0x2a3d68[_0x661a('0x5d')]){var _0x441aab=_0x2a3d68[_0x661a('0x62')]({'plain':!![]});fs['mkdirSync'](_0x26fa75);return BPromise[_0x661a('0x63')](_0x441aab[_0x661a('0x5d')],function(_0x2e3645,_0x56ba97){var _0x288b1a={'from':_0x2e3645[_0x661a('0x5e')],'to':_0x2e3645['to']||_0x661a('0x64'),'subject':_0x2e3645[_0x661a('0x60')],'html':htmlEntities[_0x661a('0x65')](_0x2e3645[_0x661a('0x36')]),'headers':{'Date':moment(_0x2e3645[_0x661a('0x61')])[_0x661a('0x48')](_0x661a('0x66'))},'attachments':[]};if(_0x2e3645['cc']){_0x288b1a[_0x661a('0x67')]['Cc']=_0x2e3645['cc'];}if(_0x2e3645['bcc']){_0x288b1a['headers'][_0x661a('0x68')]=_0x2e3645['bcc'];}return new BPromise(function(_0x240d11,_0x4b9472){if(_0x2e3645['Attachments']){for(var _0x283f6c=0x0;_0x283f6c<_0x2e3645[_0x661a('0x69')]['length'];_0x283f6c++){var _0x332fa5=_0x2e3645[_0x661a('0x69')][_0x283f6c];var _0x248cbf=path[_0x661a('0x59')](_0x152094,_0x332fa5[_0x661a('0x6a')]);if(fs[_0x661a('0x6b')](_0x248cbf)){_0x288b1a[_0x661a('0x58')][_0x661a('0x5b')]({'name':_0x332fa5[_0x661a('0x1e')],'contentType':_0x332fa5[_0x661a('0x23')],'data':fs['readFileSync'](_0x248cbf)});}}}emlformat[_0x661a('0x6c')](_0x288b1a,function(_0x316910,_0x248292){if(_0x316910)return _0x4b9472(_0x316910);fs[_0x661a('0x6d')](path[_0x661a('0x59')](_0x26fa75,util[_0x661a('0x48')](_0x661a('0x6e'),_0x56ba97)),_0x248292);return _0x240d11(_0x248292);});});})[_0x661a('0x1b')](function(){return new BPromise(function(_0x333b6a,_0x44d758){zipdir(_0x26fa75,{'saveTo':_0x543b48},function(_0x3e0099,_0x17e1d2){if(_0x3e0099)return _0x44d758(_0x3e0099);return _0x333b6a(_0x17e1d2);});})[_0x661a('0x1b')](function(){return new BPromise(function(_0x1b7d66,_0x4dd282){rimraf(_0x26fa75,function(_0x61bee){if(_0x61bee)_0x4dd282(_0x61bee);return _0x1b7d66();});});})[_0x661a('0x1b')](function(){return _0x331158[_0x661a('0x53')](_0x543b48,_0x256ef6,function(_0x5d7292){if(!_0x5d7292)fs[_0x661a('0x6f')](_0x543b48);});});});}else{return _0x331158[_0x661a('0x70')](0xc8);}})[_0x661a('0x35')](handleError(_0x331158,null));}; \ No newline at end of file +var _0x12d3=['destroy','error','stack','name','send','fieldName','type','key','getOptions','mail','query','user','catch','show','params','model','keys','MailInteraction','attributes','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','MailMessage','omit','ids','getMessages','findOne','filters','intersection','nolimit','order','sort','where','pick','MailInteractionId','filter','split','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','rows','addTags','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','unix','toString','root','server','tmp','join','files','attachments','format','transcript-%d-%s.zip','Attachment','Attachments','from','bcc','subject','createdAt','Messages','get','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','writeFileSync','download','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','path','juice','ioredis','../../components/interaction/service','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','update','then'];(function(_0x4f7103,_0xb22e71){var _0x269a36=function(_0x450117){while(--_0x450117){_0x4f7103['push'](_0x4f7103['shift']());}};_0x269a36(++_0xb22e71);}(_0x12d3,0xca));var _0x312d=function(_0x2111f5,_0x1e707a){_0x2111f5=_0x2111f5-0x0;var _0x5c0bdc=_0x12d3[_0x2111f5];return _0x5c0bdc;};'use strict';var emlformat=require(_0x312d('0x0'));var rimraf=require(_0x312d('0x1'));var zipdir=require(_0x312d('0x2'));var moment=require(_0x312d('0x3'));var BPromise=require(_0x312d('0x4'));var util=require(_0x312d('0x5'));var path=require(_0x312d('0x6'));var fs=require('fs');var _=require('lodash');var juice=require(_0x312d('0x7'));var Redis=require(_0x312d('0x8'));var interaction=require(_0x312d('0x9'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0x312d('0xa'));var db=require(_0x312d('0xb'))['db'];var htmlEntities=require(_0x312d('0xc'));config[_0x312d('0xd')]=_[_0x312d('0xe')](config[_0x312d('0xd')],{'host':_0x312d('0xf'),'port':0x18eb});var socket=require(_0x312d('0x10'))(new Redis(config[_0x312d('0xd')]));require(_0x312d('0x11'))['register'](socket);function respondWithStatusCode(_0x24c8c4,_0x28c974){_0x28c974=_0x28c974||0xcc;return function(_0x191084){if(_0x191084){return _0x24c8c4[_0x312d('0x12')](_0x28c974);}return _0x24c8c4['status'](_0x28c974)[_0x312d('0x13')]();};}function respondWithResult(_0x4959f3,_0x4f1cf1){_0x4f1cf1=_0x4f1cf1||0xc8;return function(_0x39c935){if(_0x39c935){return _0x4959f3['status'](_0x4f1cf1)[_0x312d('0x14')](_0x39c935);}};}function respondWithFilteredResult(_0x37b126,_0x1d2c7d){return function(_0xc66400){if(_0xc66400){var _0xaa83e2=typeof _0x1d2c7d[_0x312d('0x15')]==='undefined'&&typeof _0x1d2c7d[_0x312d('0x16')]===_0x312d('0x17');var _0x562f19=_0xc66400[_0x312d('0x18')];var _0x12ce76=_0xaa83e2?0x0:_0x1d2c7d['offset'];var _0x47ceea=_0xaa83e2?_0xc66400['count']:_0x1d2c7d[_0x312d('0x15')]+_0x1d2c7d[_0x312d('0x16')];var _0x474118;if(_0x47ceea>=_0x562f19){_0x47ceea=_0x562f19;_0x474118=0xc8;}else{_0x474118=0xce;}_0x37b126[_0x312d('0x19')](_0x474118);return _0x37b126[_0x312d('0x1a')](_0x312d('0x1b'),_0x12ce76+'-'+_0x47ceea+'/'+_0x562f19)['json'](_0xc66400);}return null;};}function saveUpdates(_0x5569ed){return function(_0x34eef3){if(_0x34eef3){return _0x34eef3[_0x312d('0x1c')](_0x5569ed)[_0x312d('0x1d')](function(_0x42d418){return _0x42d418;});}return null;};}function removeEntity(_0x180c28){return function(_0x256253){if(_0x256253){return _0x256253[_0x312d('0x1e')]()[_0x312d('0x1d')](function(){_0x180c28['status'](0xcc)[_0x312d('0x13')]();});}};}function handleEntityNotFound(_0x4a1d82){return function(_0x24081a){if(!_0x24081a){_0x4a1d82[_0x312d('0x12')](0x194);}return _0x24081a;};}function handleError(_0x20fa79,_0x3febac){_0x3febac=_0x3febac||0x1f4;return function(_0x549f7f){logger[_0x312d('0x1f')](_0x549f7f[_0x312d('0x20')]);if(_0x549f7f[_0x312d('0x21')]){delete _0x549f7f[_0x312d('0x21')];}_0x20fa79[_0x312d('0x19')](_0x3febac)[_0x312d('0x22')](_0x549f7f);};}exports['index']=function(_0xc2cde9,_0xf97a9a){var _0x1cbdf6={};var _0x1fff8b=_['map'](db['MailInteraction']['rawAttributes'],function(_0x1090ff){return{'name':_0x1090ff[_0x312d('0x23')],'type':_0x1090ff[_0x312d('0x24')][_0x312d('0x25')]};});_0x1cbdf6=qs[_0x312d('0x26')](_0x1fff8b,_0xc2cde9);return interaction['findAll'](_0x312d('0x27'),_0xc2cde9[_0x312d('0x28')],_0xc2cde9[_0x312d('0x29')],_0x1cbdf6,_0x1fff8b)['then'](respondWithFilteredResult(_0xf97a9a,_0x1cbdf6))[_0x312d('0x2a')](handleError(_0xf97a9a,null));};exports[_0x312d('0x2b')]=function(_0x452a5c,_0x9c9796){var _0x1ed3fc={'raw':![],'where':{'id':_0x452a5c[_0x312d('0x2c')]['id']}},_0xb74adb={};_0xb74adb[_0x312d('0x2d')]=_[_0x312d('0x2e')](db[_0x312d('0x2f')]['rawAttributes']);_0xb74adb[_0x312d('0x28')]=_[_0x312d('0x2e')](_0x452a5c[_0x312d('0x28')]);_0xb74adb['filters']=_['intersection'](_0xb74adb[_0x312d('0x2d')],_0xb74adb[_0x312d('0x28')]);_0x1ed3fc[_0x312d('0x30')]=_['intersection'](_0xb74adb[_0x312d('0x2d')],qs[_0x312d('0x31')](_0x452a5c['query'][_0x312d('0x31')]));_0x1ed3fc[_0x312d('0x30')]=_0x1ed3fc[_0x312d('0x30')][_0x312d('0x32')]?_0x1ed3fc[_0x312d('0x30')]:_0xb74adb[_0x312d('0x2d')];if(_0x452a5c[_0x312d('0x28')][_0x312d('0x33')]){_0x1ed3fc[_0x312d('0x34')]=[{'all':!![]}];}_0x1ed3fc=_[_0x312d('0x35')]({},_0x1ed3fc,_0x452a5c[_0x312d('0x36')]);return db[_0x312d('0x2f')][_0x312d('0x37')](_0x1ed3fc)[_0x312d('0x1d')](handleEntityNotFound(_0x9c9796,null))['then'](respondWithResult(_0x9c9796,null))[_0x312d('0x2a')](handleError(_0x9c9796,null));};exports[_0x312d('0x38')]=function(_0x23f85b,_0x102f07){return db['MailInteraction'][_0x312d('0x38')](_0x23f85b['body'],{})['then'](respondWithResult(_0x102f07,0xc9))[_0x312d('0x2a')](handleError(_0x102f07,null));};exports['update']=function(_0x3f7aef,_0x4533fc){if(_0x3f7aef[_0x312d('0x39')]['id']){delete _0x3f7aef[_0x312d('0x39')]['id'];}return db['MailInteraction'][_0x312d('0x37')]({'where':{'id':_0x3f7aef[_0x312d('0x2c')]['id']}})[_0x312d('0x1d')](handleEntityNotFound(_0x4533fc,null))[_0x312d('0x1d')](saveUpdates(_0x3f7aef['body'],null))[_0x312d('0x1d')](respondWithResult(_0x4533fc,null))['catch'](handleError(_0x4533fc,null));};exports[_0x312d('0x1e')]=function(_0x4448fe,_0x2ab1a5){return db[_0x312d('0x2f')]['find']({'where':{'id':_0x4448fe['params']['id']}})[_0x312d('0x1d')](handleEntityNotFound(_0x2ab1a5,null))[_0x312d('0x1d')](removeEntity(_0x2ab1a5,null))[_0x312d('0x2a')](handleError(_0x2ab1a5,null));};exports[_0x312d('0x3a')]=function(_0x369155,_0x1958aa){return db[_0x312d('0x2f')][_0x312d('0x3a')]()['then'](respondWithResult(_0x1958aa,null))[_0x312d('0x2a')](handleError(_0x1958aa,null));};exports[_0x312d('0x3b')]=function(_0x2b9a0b,_0x54ec96){return db[_0x312d('0x3c')][_0x312d('0x37')]({'where':{'id':_0x2b9a0b[_0x312d('0x2c')]['id']}})[_0x312d('0x1d')](handleEntityNotFound(_0x54ec96,null))['then'](function(_0xba69ec){if(_0xba69ec){return _0xba69ec['addMessage'](_0x2b9a0b[_0x312d('0x39')]['ids'],_[_0x312d('0x3d')](_0x2b9a0b[_0x312d('0x39')],[_0x312d('0x3e'),'id'])||{});}})[_0x312d('0x1d')](respondWithResult(_0x54ec96,null))[_0x312d('0x2a')](handleError(_0x54ec96,null));};exports[_0x312d('0x3f')]=function(_0x55cc42,_0x3013c0){var _0x52869c={'raw':![],'where':{}};var _0x1e3542={};var _0x495c29={'count':0x0,'rows':[]};return db['MailInteraction'][_0x312d('0x40')]({'where':{'id':_0x55cc42[_0x312d('0x2c')]['id']}})[_0x312d('0x1d')](handleEntityNotFound(_0x3013c0,null))[_0x312d('0x1d')](function(_0xeb7f6){if(_0xeb7f6){_0x1e3542[_0x312d('0x2d')]=_['keys'](db[_0x312d('0x3c')]['rawAttributes']);_0x1e3542[_0x312d('0x28')]=_[_0x312d('0x2e')](_0x55cc42[_0x312d('0x28')]);_0x1e3542[_0x312d('0x41')]=_[_0x312d('0x42')](_0x1e3542[_0x312d('0x2d')],_0x1e3542[_0x312d('0x28')]);_0x52869c[_0x312d('0x30')]=_[_0x312d('0x42')](_0x1e3542[_0x312d('0x2d')],qs[_0x312d('0x31')](_0x55cc42[_0x312d('0x28')][_0x312d('0x31')]));_0x52869c[_0x312d('0x30')]=_0x52869c[_0x312d('0x30')][_0x312d('0x32')]?_0x52869c[_0x312d('0x30')]:_0x1e3542[_0x312d('0x2d')];if(!_0x55cc42[_0x312d('0x28')]['hasOwnProperty'](_0x312d('0x43'))){_0x52869c[_0x312d('0x16')]=qs['limit'](_0x55cc42[_0x312d('0x28')]['limit']);_0x52869c[_0x312d('0x15')]=qs[_0x312d('0x15')](_0x55cc42[_0x312d('0x28')]['offset']);}_0x52869c[_0x312d('0x44')]=qs[_0x312d('0x45')](_0x55cc42[_0x312d('0x28')][_0x312d('0x45')]);_0x52869c[_0x312d('0x46')]=qs['filters'](_[_0x312d('0x47')](_0x55cc42[_0x312d('0x28')],_0x1e3542['filters']));_0x52869c[_0x312d('0x46')][_0x312d('0x48')]=_0xeb7f6['id'];if(_0x55cc42[_0x312d('0x28')][_0x312d('0x49')]){_0x52869c[_0x312d('0x46')]=_['merge'](_0x52869c[_0x312d('0x46')],{'$or':_['map'](_0x52869c[_0x312d('0x30')],function(_0x4eb5b6){var _0x5da70a={};_0x5da70a[_0x4eb5b6]={'$like':'%'+_0x55cc42[_0x312d('0x28')][_0x312d('0x49')]+'%'};return _0x5da70a;})});}if(_0x55cc42[_0x312d('0x28')]['$gte']){var _0x310e33=_0x55cc42[_0x312d('0x28')]['$gte'][_0x312d('0x4a')](',');var _0x586474={};_0x586474[_0x310e33[0x0]]={'$gte':moment(_0x310e33[0x1])['format'](_0x312d('0x4b'))};_0x52869c[_0x312d('0x46')]=_[_0x312d('0x35')](_0x52869c[_0x312d('0x46')],_0x586474);}_0x52869c=_[_0x312d('0x35')]({},_0x52869c,_0x55cc42[_0x312d('0x36')]);return db[_0x312d('0x3c')][_0x312d('0x18')]({'where':_0x52869c[_0x312d('0x46')]})[_0x312d('0x1d')](function(_0xcd58e6){_0x495c29['count']=_0xcd58e6;if(_0x55cc42['query'][_0x312d('0x33')]){_0x52869c['include']=[{'all':!![]}];}return db[_0x312d('0x3c')][_0x312d('0x4c')](_0x52869c);})[_0x312d('0x1d')](function(_0x48c179){if(_0x55cc42[_0x312d('0x28')][_0x312d('0x4d')]===_0x312d('0x4e')){for(var _0x2d4aab=0x0;_0x2d4aab<_0x48c179[_0x312d('0x32')];_0x2d4aab++){_0x48c179[_0x2d4aab]['body']=juice(_0x48c179[_0x2d4aab][_0x312d('0x39')]);}}_0x495c29[_0x312d('0x4f')]=_0x48c179;return _0x495c29;});}})[_0x312d('0x1d')](respondWithFilteredResult(_0x3013c0,_0x52869c))[_0x312d('0x2a')](handleError(_0x3013c0,null));};exports[_0x312d('0x50')]=function(_0x3feee1,_0x4e99ac){return db[_0x312d('0x2f')][_0x312d('0x37')]({'where':{'id':_0x3feee1[_0x312d('0x2c')]['id']}})[_0x312d('0x1d')](handleEntityNotFound(_0x4e99ac,null))[_0x312d('0x1d')](function(_0x8c17e1){if(_0x8c17e1){return _0x8c17e1[_0x312d('0x51')](_0x3feee1[_0x312d('0x39')][_0x312d('0x3e')],_['omit'](_0x3feee1[_0x312d('0x39')],[_0x312d('0x3e'),'id'])||{})[_0x312d('0x52')](function(){return db[_0x312d('0x53')]['findAll']({'attributes':['id','name',_0x312d('0x54')],'where':{'id':_0x3feee1[_0x312d('0x39')]['ids']}});})[_0x312d('0x1d')](function(_0xbad5b3){socket[_0x312d('0x55')](_0x312d('0x56'),{'id':Number(_0x3feee1[_0x312d('0x2c')]['id']),'tags':_0xbad5b3||[]});return{'id':Number(_0x3feee1['params']['id']),'tags':_0xbad5b3||[]};});}})['then'](respondWithResult(_0x4e99ac,null))[_0x312d('0x2a')](handleError(_0x4e99ac,null));};exports[_0x312d('0x57')]=function(_0x56a4c1,_0x23ae19){return db[_0x312d('0x2f')][_0x312d('0x37')]({'where':{'id':_0x56a4c1['params']['id']}})['then'](handleEntityNotFound(_0x23ae19,null))[_0x312d('0x1d')](function(_0x15883e){if(_0x15883e){return _0x15883e[_0x312d('0x57')](_0x56a4c1[_0x312d('0x28')][_0x312d('0x3e')]);}})[_0x312d('0x1d')](respondWithStatusCode(_0x23ae19,null))[_0x312d('0x2a')](handleError(_0x23ae19,null));};exports['download']=function(_0xe4b968,_0x1d46f4){var _0x37cf45=moment()[_0x312d('0x58')]()[_0x312d('0x59')]();var _0x34b768=path['join'](config[_0x312d('0x5a')],_0x312d('0x5b'),'files',_0x312d('0x5c'));var _0xd2a695=path[_0x312d('0x5d')](config[_0x312d('0x5a')],_0x312d('0x5b'),_0x312d('0x5e'),_0x312d('0x5f'));var _0x4d559b=path[_0x312d('0x5d')](_0x34b768,_0x37cf45);var _0x243ffc=util[_0x312d('0x60')](_0x312d('0x61'),_0xe4b968[_0x312d('0x2c')]['id'],_0x37cf45);var _0x3d4864=path[_0x312d('0x5d')](_0x34b768,_0x243ffc);var _0x4b6cb6=[];if(_0xe4b968[_0x312d('0x28')][_0x312d('0x5f')]){_0x4b6cb6['push']({'model':db[_0x312d('0x62')],'as':_0x312d('0x63'),'raw':!![]});}var _0x18bb1f=[{'model':db[_0x312d('0x3c')],'as':'Messages','attributes':['id',_0x312d('0x39'),_0x312d('0x64'),'to','cc',_0x312d('0x65'),_0x312d('0x66'),_0x312d('0x67')],'where':{'secret':![]},'order':qs[_0x312d('0x45')]('id'),'include':_0x4b6cb6}];return db['MailInteraction'][_0x312d('0x37')]({'where':{'id':_0xe4b968[_0x312d('0x2c')]['id']},'include':_0x18bb1f})[_0x312d('0x1d')](handleEntityNotFound(_0x1d46f4,null))[_0x312d('0x1d')](function(_0x32d983){if(_0x32d983&&_0x32d983[_0x312d('0x68')]){var _0x1ac414=_0x32d983[_0x312d('0x69')]({'plain':!![]});fs['mkdirSync'](_0x4d559b);return BPromise[_0x312d('0x6a')](_0x1ac414[_0x312d('0x68')],function(_0x2054c5,_0x1a0fac){var _0x483f36={'from':_0x2054c5[_0x312d('0x64')],'to':_0x2054c5['to']||'missing.recipient@your.company.com','subject':_0x2054c5[_0x312d('0x66')],'html':htmlEntities[_0x312d('0x6b')](_0x2054c5['body']),'headers':{'Date':moment(_0x2054c5['createdAt'])[_0x312d('0x60')](_0x312d('0x6c'))},'attachments':[]};if(_0x2054c5['cc']){_0x483f36[_0x312d('0x6d')]['Cc']=_0x2054c5['cc'];}if(_0x2054c5[_0x312d('0x65')]){_0x483f36[_0x312d('0x6d')][_0x312d('0x6e')]=_0x2054c5['bcc'];}return new BPromise(function(_0x289fb3,_0x26970d){if(_0x2054c5[_0x312d('0x63')]){for(var _0x4ce131=0x0;_0x4ce131<_0x2054c5[_0x312d('0x63')][_0x312d('0x32')];_0x4ce131++){var _0x559d81=_0x2054c5[_0x312d('0x63')][_0x4ce131];var _0x240171=path[_0x312d('0x5d')](_0xd2a695,_0x559d81[_0x312d('0x6f')]);if(fs[_0x312d('0x70')](_0x240171)){_0x483f36[_0x312d('0x5f')]['push']({'name':_0x559d81[_0x312d('0x21')],'contentType':_0x559d81['type'],'data':fs['readFileSync'](_0x240171)});}}}emlformat['build'](_0x483f36,function(_0x1831fc,_0x2ec9f0){if(_0x1831fc)return _0x26970d(_0x1831fc);fs[_0x312d('0x71')](path[_0x312d('0x5d')](_0x4d559b,util[_0x312d('0x60')]('message%d.eml',_0x1a0fac)),_0x2ec9f0);return _0x289fb3(_0x2ec9f0);});});})[_0x312d('0x1d')](function(){return new BPromise(function(_0x2190f4,_0x1253f9){zipdir(_0x4d559b,{'saveTo':_0x3d4864},function(_0x29048d,_0x231ce3){if(_0x29048d)return _0x1253f9(_0x29048d);return _0x2190f4(_0x231ce3);});})[_0x312d('0x1d')](function(){return new BPromise(function(_0x41e06f,_0x2291d5){rimraf(_0x4d559b,function(_0x504d96){if(_0x504d96)_0x2291d5(_0x504d96);return _0x41e06f();});});})['then'](function(){return _0x1d46f4[_0x312d('0x72')](_0x3d4864,_0x243ffc,function(_0x1ff52b){if(!_0x1ff52b)fs[_0x312d('0x73')](_0x3d4864);});});});}else{return _0x1d46f4[_0x312d('0x12')](0xc8);}})[_0x312d('0x2a')](handleError(_0x1d46f4,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index c43f7c5..4d191a3 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 _0xbe1d=['getUsers','Users','map','findAll','then','setDataValue','emit','hasOwnProperty','hook','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe1d,0xcc));var _0xdbe1=function(_0x386408,_0x584c61){_0x386408=_0x386408-0x0;var _0xedb599=_0xbe1d[_0x386408];return _0xedb599;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xdbe1('0x0'))['db'][_0xdbe1('0x1')];var MailMessage=require(_0xdbe1('0x0'))['db'][_0xdbe1('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xdbe1('0x3')](0x0);var events={'afterCreate':_0xdbe1('0x4'),'afterUpdate':_0xdbe1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x50f79e){return function(_0x204bee,_0x31cb66,_0x303bd0){_0x204bee[_0xdbe1('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0xafee6c){_0x204bee['setDataValue'](_0xdbe1('0x7'),_0xafee6c[_0xdbe1('0x8')](function(_0x3d4a1c){return{'id':_0x3d4a1c['id']};}));return MailMessage[_0xdbe1('0x9')]({'where':{'MailInteractionId':_0x204bee['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdbe1('0xa')](function(_0x1405be){_0x204bee[_0xdbe1('0xb')]('unreadMessages',_0x1405be['length']);MailInteractionEvents[_0xdbe1('0xc')](_0x50f79e+':'+_0x204bee['id'],_0x204bee);MailInteractionEvents[_0xdbe1('0xc')](_0x50f79e,_0x204bee);_0x303bd0(null);})['catch'](_0x303bd0(null));};}for(var e in events){if(events[_0xdbe1('0xd')](e)){var event=events[e];MailInteraction[_0xdbe1('0xe')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0x35b6=['MailInteraction','MailMessage','setMaxListeners','save','update','getUsers','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x1ab1bf,_0x144262){var _0x2a00a5=function(_0x42f0bd){while(--_0x42f0bd){_0x1ab1bf['push'](_0x1ab1bf['shift']());}};_0x2a00a5(++_0x144262);}(_0x35b6,0x8e));var _0x635b=function(_0x5bb588,_0x3b6df4){_0x5bb588=_0x5bb588-0x0;var _0x5c5d55=_0x35b6[_0x5bb588];return _0x5c5d55;};'use strict';var EventEmitter=require(_0x635b('0x0'));var MailInteraction=require(_0x635b('0x1'))['db'][_0x635b('0x2')];var MailMessage=require('../../mysqldb')['db'][_0x635b('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x635b('0x4')](0x0);var events={'afterCreate':_0x635b('0x5'),'afterUpdate':_0x635b('0x6'),'afterDestroy':'remove'};function emitEvent(_0x48237e){return function(_0x502d36,_0x96c69f,_0x5091fd){_0x502d36[_0x635b('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2ce5de){_0x502d36['setDataValue']('Users',_0x2ce5de['map'](function(_0x195008){return{'id':_0x195008['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x502d36['id'],'direction':'in','read':![]},'raw':!![]});})[_0x635b('0x8')](function(_0xebaff0){_0x502d36[_0x635b('0x9')](_0x635b('0xa'),_0xebaff0[_0x635b('0xb')]);MailInteractionEvents[_0x635b('0xc')](_0x48237e+':'+_0x502d36['id'],_0x502d36);MailInteractionEvents[_0x635b('0xc')](_0x48237e,_0x502d36);_0x5091fd(null);})[_0x635b('0xd')](_0x5091fd(null));};}for(var e in events){if(events[_0x635b('0xe')](e)){var event=events[e];MailInteraction[_0x635b('0xf')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index b6b72ef..82943f8 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 _0xe32b=['define','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','substatusAt','changed','models','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','request-promise','path','rimraf','./mailInteraction.attributes','exports'];(function(_0xeb53a2,_0x1f3b36){var _0x33fa4e=function(_0x5366a4){while(--_0x5366a4){_0xeb53a2['push'](_0xeb53a2['shift']());}};_0x33fa4e(++_0x1f3b36);}(_0xe32b,0x16f));var _0xbe32=function(_0x18089b,_0x5ca656){_0x18089b=_0x18089b-0x0;var _0xad8fdd=_0xe32b[_0x18089b];return _0xad8fdd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbe32('0x0'))(_0xbe32('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbe32('0x2'));var fs=require('fs');var path=require(_0xbe32('0x3'));var rimraf=require(_0xbe32('0x4'));var config=require('../../config/environment');var attributes=require(_0xbe32('0x5'));module[_0xbe32('0x6')]=function(_0x3bb5b8,_0x5b68c0){return _0x3bb5b8[_0xbe32('0x7')]('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0xbe32('0x8')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5e0680,_0x1a8225,_0x128d3b){if(_0x5e0680[_0xbe32('0x9')]){_0x5e0680['substatusAt']=moment()[_0xbe32('0xa')](_0xbe32('0xb'));}if(_0x5e0680[_0xbe32('0xc')]){_0x5e0680[_0xbe32('0xd')]=moment()[_0xbe32('0xa')](_0xbe32('0xb'));}_0x128d3b(null,_0x1a8225);},'beforeUpdate':function(_0x11a481,_0x347227,_0x5f2ad6){if(_0x11a481['changed'](_0xbe32('0x9'))){_0x11a481[_0xbe32('0xe')]=_0x11a481[_0xbe32('0x9')]?moment()[_0xbe32('0xa')](_0xbe32('0xb')):null;}if(_0x11a481[_0xbe32('0xf')](_0xbe32('0xc'))){_0x11a481[_0xbe32('0xd')]=moment()['format'](_0xbe32('0xb'));_0x11a481[_0xbe32('0x9')]=null;_0x11a481[_0xbe32('0xe')]=null;}_0x5f2ad6(null,_0x11a481);},'afterUpdate':function(_0x270a62,_0x1912af,_0x1e7b42){var _0x5dffeb=_0x3bb5b8[_0xbe32('0x10')];var _0x4a1a07=_0x270a62['get']({'plain':!![]});if(_0x4a1a07[_0xbe32('0xc')]){return _0x5dffeb[_0xbe32('0x11')][_0xbe32('0x12')]({'read':!![]},{'where':{'MailInteractionId':_0x4a1a07['id']}})['then'](function(){_0x1e7b42();})[_0xbe32('0x13')](function(_0x296de9){_0x1e7b42(_0x296de9);});}else{_0x1e7b42();}}},'charset':_0xbe32('0x14'),'collate':_0xbe32('0x15')});}; \ No newline at end of file +var _0xdd5e=['rimraf','../../config/environment','exports','define','MailInteraction','FULLTEXT','substatus','substatusAt','format','closed','closedAt','changed','YYYY-MM-DD\x20HH:mm:ss','models','get','then','catch','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0xdd5e,0x157));var _0xedd5=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xdd5e[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0xedd5('0x0'));var util=require(_0xedd5('0x1'));var logger=require('../../config/logger')(_0xedd5('0x2'));var moment=require(_0xedd5('0x3'));var BPromise=require(_0xedd5('0x4'));var rp=require(_0xedd5('0x5'));var fs=require('fs');var path=require(_0xedd5('0x6'));var rimraf=require(_0xedd5('0x7'));var config=require(_0xedd5('0x8'));var attributes=require('./mailInteraction.attributes');module[_0xedd5('0x9')]=function(_0x2d3052,_0x50a331){return _0x2d3052[_0xedd5('0xa')](_0xedd5('0xb'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0xedd5('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2b9eb3,_0x3f3792,_0x15e9e5){if(_0x2b9eb3[_0xedd5('0xd')]){_0x2b9eb3[_0xedd5('0xe')]=moment()[_0xedd5('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2b9eb3[_0xedd5('0x10')]){_0x2b9eb3[_0xedd5('0x11')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x15e9e5(null,_0x3f3792);},'beforeUpdate':function(_0x32b2bb,_0x52a2a4,_0x46d29){if(_0x32b2bb[_0xedd5('0x12')]('substatus')){_0x32b2bb[_0xedd5('0xe')]=_0x32b2bb[_0xedd5('0xd')]?moment()[_0xedd5('0xf')](_0xedd5('0x13')):null;}if(_0x32b2bb[_0xedd5('0x12')]('closed')){_0x32b2bb[_0xedd5('0x11')]=moment()['format'](_0xedd5('0x13'));_0x32b2bb[_0xedd5('0xd')]=null;_0x32b2bb[_0xedd5('0xe')]=null;}_0x46d29(null,_0x32b2bb);},'afterUpdate':function(_0x4cc292,_0xaefe79,_0x47177d){var _0x2a8664=_0x2d3052[_0xedd5('0x14')];var _0x17648a=_0x4cc292[_0xedd5('0x15')]({'plain':!![]});if(_0x17648a[_0xedd5('0x10')]){return _0x2a8664['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x17648a['id']}})[_0xedd5('0x16')](function(){_0x47177d();})[_0xedd5('0x17')](function(_0x584c2c){_0x47177d(_0x584c2c);});}else{_0x47177d();}}},'charset':'utf8mb4','collate':_0xedd5('0x18')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index bdf2f05..20ced18 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 _0x6011=['catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','AddTagsToMailInteraction','find','where','then','addTags','ids','omit','spread','AddTags','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x212fcc,_0x1a8867){var _0x4d8190=function(_0x347f7b){while(--_0x347f7b){_0x212fcc['push'](_0x212fcc['shift']());}};_0x4d8190(++_0x1a8867);}(_0x6011,0x196));var _0x1601=function(_0x49fdcb,_0x15df2d){_0x49fdcb=_0x49fdcb-0x0;var _0x5f463b=_0x6011[_0x49fdcb];return _0x5f463b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1601('0x0'));var db=require(_0x1601('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x1601('0x2'))(_0x1601('0x3'));var config=require(_0x1601('0x4'));var jayson=require(_0x1601('0x5'));var client=jayson[_0x1601('0x6')][_0x1601('0x7')]({'port':0x232a});config[_0x1601('0x8')]=_[_0x1601('0x9')](config[_0x1601('0x8')],{'host':_0x1601('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1601('0x8')]));require(_0x1601('0xb'))[_0x1601('0xc')](socket);function respondWithRpcPromise(_0x25b02d,_0x33def1,_0x58f45f){return new BPromise(function(_0x4dc693,_0x57e18a){return client[_0x1601('0xd')](_0x25b02d,_0x58f45f)['then'](function(_0x1d42b1){logger[_0x1601('0xe')](_0x1601('0xf'),_0x33def1,_0x1601('0x10'));logger[_0x1601('0x11')](_0x1601('0x12'),_0x33def1,_0x1601('0x10'),JSON[_0x1601('0x13')](_0x1d42b1));if(_0x1d42b1['error']){if(_0x1d42b1[_0x1601('0x14')]['code']===0x1f4){logger[_0x1601('0x14')]('MailInteraction,\x20%s,\x20%s',_0x33def1,_0x1d42b1[_0x1601('0x14')][_0x1601('0x15')]);return _0x57e18a(_0x1d42b1['error'][_0x1601('0x15')]);}logger[_0x1601('0x14')](_0x1601('0xf'),_0x33def1,_0x1d42b1['error']['message']);return _0x4dc693(_0x1d42b1[_0x1601('0x14')][_0x1601('0x15')]);}else{logger[_0x1601('0xe')](_0x1601('0xf'),_0x33def1,_0x1601('0x10'));_0x4dc693(_0x1d42b1[_0x1601('0x16')][_0x1601('0x15')]);}})[_0x1601('0x17')](function(_0x1ce2b2){logger['error']('MailInteraction,\x20%s,\x20%s',_0x33def1,_0x1ce2b2);_0x57e18a(_0x1ce2b2);});});}exports[_0x1601('0x18')]=function(_0x1ce486){var _0xb09057=this;return new Promise(function(_0x5bd8fb,_0x2c3b5d){return db[_0x1601('0x19')][_0x1601('0x1a')](_0x1ce486[_0x1601('0x1b')],{'raw':_0x1ce486[_0x1601('0x1c')]?_0x1ce486['options'][_0x1601('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ce486[_0x1601('0x1c')]?_0x1ce486[_0x1601('0x1c')]['where']||null:null,'attributes':_0x1ce486[_0x1601('0x1c')]?_0x1ce486[_0x1601('0x1c')]['attributes']||null:null,'limit':_0x1ce486[_0x1601('0x1c')]?_0x1ce486[_0x1601('0x1c')]['limit']||null:null})['then'](function(_0x65fb4f){logger[_0x1601('0xe')](_0x1601('0x18'),_0x1ce486);logger['debug'](_0x1601('0x18'),_0x1ce486,JSON[_0x1601('0x13')](_0x65fb4f));_0x5bd8fb(_0x65fb4f);})[_0x1601('0x17')](function(_0x250fcc){logger[_0x1601('0x14')]('UpdateMailInteraction',_0x250fcc['message'],_0x1ce486);_0x2c3b5d(_0xb09057[_0x1601('0x14')](0x1f4,_0x250fcc[_0x1601('0x15')]));});});};exports[_0x1601('0x1e')]=function(_0x4ee7b1){return new Promise(function(_0x2b55e1,_0x57eb42){return db[_0x1601('0x19')][_0x1601('0x1f')]({'where':_0x4ee7b1[_0x1601('0x1c')]?_0x4ee7b1['options'][_0x1601('0x20')]||null:null})[_0x1601('0x21')](function(_0x33b358){if(_0x33b358){return _0x33b358[_0x1601('0x22')](_0x4ee7b1['body'][_0x1601('0x23')],_[_0x1601('0x24')](_0x4ee7b1[_0x1601('0x1b')],[_0x1601('0x23'),'id'])||{});}})[_0x1601('0x25')](function(_0x2ad13d){logger[_0x1601('0xe')](_0x1601('0x26'),_0x4ee7b1);logger[_0x1601('0x11')](_0x1601('0x26'),_0x4ee7b1,JSON[_0x1601('0x13')](_0x2ad13d));_0x2b55e1(_0x2ad13d);})[_0x1601('0x17')](function(_0x274da8){logger['error'](_0x1601('0x26'),_0x274da8[_0x1601('0x15')],_0x4ee7b1);_0x57eb42(_this[_0x1601('0x14')](0x1f4,_0x274da8[_0x1601('0x15')]));});});}; \ No newline at end of file +var _0x0b78=['defaults','localhost','socket.io-emitter','request','then','info','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','limit','AddTagsToMailInteraction','find','addTags','ids','omit','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis'];(function(_0x2acb37,_0xfc8066){var _0x4809d6=function(_0x2219b0){while(--_0x2219b0){_0x2acb37['push'](_0x2acb37['shift']());}};_0x4809d6(++_0xfc8066);}(_0x0b78,0x1d6));var _0x80b7=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x0b78[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0x80b7('0x0'));var moment=require(_0x80b7('0x1'));var BPromise=require(_0x80b7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x80b7('0x3'));var db=require(_0x80b7('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x80b7('0x5'));var jayson=require(_0x80b7('0x6'));var client=jayson[_0x80b7('0x7')][_0x80b7('0x8')]({'port':0x232a});config[_0x80b7('0x9')]=_[_0x80b7('0xa')](config['redis'],{'host':_0x80b7('0xb'),'port':0x18eb});var socket=require(_0x80b7('0xc'))(new Redis(config[_0x80b7('0x9')]));require('./mailInteraction.socket')['register'](socket);function respondWithRpcPromise(_0xf705da,_0x5169e9,_0x475976){return new BPromise(function(_0x273f5a,_0x47910c){return client[_0x80b7('0xd')](_0xf705da,_0x475976)[_0x80b7('0xe')](function(_0x1e8046){logger[_0x80b7('0xf')]('MailInteraction,\x20%s,\x20%s',_0x5169e9,'request\x20sent');logger[_0x80b7('0x10')](_0x80b7('0x11'),_0x5169e9,_0x80b7('0x12'),JSON[_0x80b7('0x13')](_0x1e8046));if(_0x1e8046[_0x80b7('0x14')]){if(_0x1e8046[_0x80b7('0x14')][_0x80b7('0x15')]===0x1f4){logger[_0x80b7('0x14')](_0x80b7('0x16'),_0x5169e9,_0x1e8046['error']['message']);return _0x47910c(_0x1e8046['error']['message']);}logger[_0x80b7('0x14')](_0x80b7('0x16'),_0x5169e9,_0x1e8046[_0x80b7('0x14')][_0x80b7('0x17')]);return _0x273f5a(_0x1e8046[_0x80b7('0x14')][_0x80b7('0x17')]);}else{logger[_0x80b7('0xf')](_0x80b7('0x16'),_0x5169e9,_0x80b7('0x12'));_0x273f5a(_0x1e8046[_0x80b7('0x18')][_0x80b7('0x17')]);}})[_0x80b7('0x19')](function(_0x196948){logger['error'](_0x80b7('0x16'),_0x5169e9,_0x196948);_0x47910c(_0x196948);});});}exports[_0x80b7('0x1a')]=function(_0x1c6e24){var _0x5d816c=this;return new Promise(function(_0x1524be,_0x3ebdd6){return db[_0x80b7('0x1b')][_0x80b7('0x1c')](_0x1c6e24[_0x80b7('0x1d')],{'raw':_0x1c6e24[_0x80b7('0x1e')]?_0x1c6e24[_0x80b7('0x1e')][_0x80b7('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c6e24['options']?_0x1c6e24['options'][_0x80b7('0x20')]||null:null,'attributes':_0x1c6e24[_0x80b7('0x1e')]?_0x1c6e24[_0x80b7('0x1e')]['attributes']||null:null,'limit':_0x1c6e24[_0x80b7('0x1e')]?_0x1c6e24[_0x80b7('0x1e')][_0x80b7('0x21')]||null:null})[_0x80b7('0xe')](function(_0x45d558){logger[_0x80b7('0xf')](_0x80b7('0x1a'),_0x1c6e24);logger[_0x80b7('0x10')](_0x80b7('0x1a'),_0x1c6e24,JSON[_0x80b7('0x13')](_0x45d558));_0x1524be(_0x45d558);})[_0x80b7('0x19')](function(_0x4cb8c9){logger[_0x80b7('0x14')](_0x80b7('0x1a'),_0x4cb8c9[_0x80b7('0x17')],_0x1c6e24);_0x3ebdd6(_0x5d816c[_0x80b7('0x14')](0x1f4,_0x4cb8c9[_0x80b7('0x17')]));});});};exports[_0x80b7('0x22')]=function(_0x3a5f27){return new Promise(function(_0x14044d,_0x479335){return db[_0x80b7('0x1b')][_0x80b7('0x23')]({'where':_0x3a5f27[_0x80b7('0x1e')]?_0x3a5f27[_0x80b7('0x1e')][_0x80b7('0x20')]||null:null})['then'](function(_0x472090){if(_0x472090){return _0x472090[_0x80b7('0x24')](_0x3a5f27[_0x80b7('0x1d')][_0x80b7('0x25')],_[_0x80b7('0x26')](_0x3a5f27[_0x80b7('0x1d')],[_0x80b7('0x25'),'id'])||{});}})['spread'](function(_0x977d25){logger[_0x80b7('0xf')]('AddTags',_0x3a5f27);logger[_0x80b7('0x10')](_0x80b7('0x27'),_0x3a5f27,JSON[_0x80b7('0x13')](_0x977d25));_0x14044d(_0x977d25);})[_0x80b7('0x19')](function(_0x6f23ef){logger[_0x80b7('0x14')]('AddTags',_0x6f23ef[_0x80b7('0x17')],_0x3a5f27);_0x479335(_this[_0x80b7('0x14')](0x1f4,_0x6f23ef[_0x80b7('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 5b9a7ad..b151948 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 _0xdec3=['remove','update','emit','register','length','mailInteraction:','./mailInteraction.events','save'];(function(_0x36b400,_0x277ec5){var _0x4d47bf=function(_0x55372b){while(--_0x55372b){_0x36b400['push'](_0x36b400['shift']());}};_0x4d47bf(++_0x277ec5);}(_0xdec3,0x1b6));var _0x3dec=function(_0x50844d,_0x586c1e){_0x50844d=_0x50844d-0x0;var _0x1aef1c=_0xdec3[_0x50844d];return _0x1aef1c;};'use strict';var MailInteractionEvents=require(_0x3dec('0x0'));var events=[_0x3dec('0x1'),_0x3dec('0x2'),_0x3dec('0x3')];function createListener(_0x58776e,_0xaff333){return function(_0x2833f1){_0xaff333[_0x3dec('0x4')](_0x58776e,_0x2833f1);};}function removeListener(_0x553c23,_0x1f9386){return function(){MailInteractionEvents['removeListener'](_0x553c23,_0x1f9386);};}exports[_0x3dec('0x5')]=function(_0x2ce66e){for(var _0x9b2e46=0x0,_0x5389f4=events[_0x3dec('0x6')];_0x9b2e46<_0x5389f4;_0x9b2e46++){var _0x78f402=events[_0x9b2e46];var _0x26faf6=createListener(_0x3dec('0x7')+_0x78f402,_0x2ce66e);MailInteractionEvents['on'](_0x78f402,_0x26faf6);}}; \ No newline at end of file +var _0x0df7=['mailInteraction:','./mailInteraction.events','save','remove','removeListener','register','length'];(function(_0x42ca15,_0x193ccb){var _0x1c6ded=function(_0x40989a){while(--_0x40989a){_0x42ca15['push'](_0x42ca15['shift']());}};_0x1c6ded(++_0x193ccb);}(_0x0df7,0x16d));var _0x70df=function(_0x4bb1a0,_0x532425){_0x4bb1a0=_0x4bb1a0-0x0;var _0xff27b1=_0x0df7[_0x4bb1a0];return _0xff27b1;};'use strict';var MailInteractionEvents=require(_0x70df('0x0'));var events=[_0x70df('0x1'),_0x70df('0x2'),'update'];function createListener(_0x26e89c,_0x521b1b){return function(_0x51553f){_0x521b1b['emit'](_0x26e89c,_0x51553f);};}function removeListener(_0x408bc4,_0x310b03){return function(){MailInteractionEvents[_0x70df('0x3')](_0x408bc4,_0x310b03);};}exports[_0x70df('0x4')]=function(_0x1d9d7d){for(var _0x3f10f7=0x0,_0x3365b8=events[_0x70df('0x5')];_0x3f10f7<_0x3365b8;_0x3f10f7++){var _0x127b79=events[_0x3f10f7];var _0x55eff0=createListener(_0x70df('0x6')+_0x127b79,_0x1d9d7d);MailInteractionEvents['on'](_0x127b79,_0x55eff0);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 8957eb5..9a7b515 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 _0x128f=['reject','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','/:id','/:id/accept','accept','/:id/reject'];(function(_0x560f55,_0x1372c1){var _0x499fa4=function(_0x871916){while(--_0x871916){_0x560f55['push'](_0x560f55['shift']());}};_0x499fa4(++_0x1372c1);}(_0x128f,0xff));var _0xf128=function(_0x269b2c,_0x215c0d){_0x269b2c=_0x269b2c-0x0;var _0x499bbf=_0x128f[_0x269b2c];return _0x499bbf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf128('0x0'));var timeout=require(_0xf128('0x1'));var express=require(_0xf128('0x2'));var router=express[_0xf128('0x3')]();var fs_extra=require(_0xf128('0x4'));var auth=require(_0xf128('0x5'));var interaction=require(_0xf128('0x6'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0xf128('0x7')]('/',auth[_0xf128('0x8')](),controller[_0xf128('0x9')]);router[_0xf128('0x7')](_0xf128('0xa'),auth[_0xf128('0x8')](),controller[_0xf128('0xb')]);router[_0xf128('0x7')]('/:id',auth[_0xf128('0x8')](),controller[_0xf128('0xc')]);router[_0xf128('0x7')](_0xf128('0xd'),auth[_0xf128('0x8')](),controller[_0xf128('0xe')]);router[_0xf128('0xf')]('/',auth[_0xf128('0x8')](),interaction[_0xf128('0x10')](_0xf128('0x11'),_0xf128('0x12')),controller[_0xf128('0x13')]);router[_0xf128('0x14')](_0xf128('0x15'),auth['isAuthenticated'](),controller['update']);router[_0xf128('0x14')](_0xf128('0x16'),auth[_0xf128('0x8')](),controller[_0xf128('0x17')]);router['put'](_0xf128('0x18'),auth[_0xf128('0x8')](),controller[_0xf128('0x19')]);router['delete'](_0xf128('0x15'),auth[_0xf128('0x8')](),controller[_0xf128('0x1a')]);module[_0xf128('0x1b')]=router; \ No newline at end of file +var _0x5d40=['/:id/reject','reject','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','get','index','isAuthenticated','describe','/:id','show','/:id/download','tracked','mailmessage:create','create','put','/:id/accept','accept'];(function(_0x292dd1,_0x1495e7){var _0x5536cb=function(_0x3a43b5){while(--_0x3a43b5){_0x292dd1['push'](_0x292dd1['shift']());}};_0x5536cb(++_0x1495e7);}(_0x5d40,0x1a2));var _0x05d4=function(_0x59fea3,_0x418bb6){_0x59fea3=_0x59fea3-0x0;var _0x1cdc53=_0x5d40[_0x59fea3];return _0x1cdc53;};'use strict';var multer=require(_0x05d4('0x0'));var util=require(_0x05d4('0x1'));var path=require('path');var timeout=require(_0x05d4('0x2'));var express=require('express');var router=express[_0x05d4('0x3')]();var fs_extra=require(_0x05d4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x05d4('0x5'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0x05d4('0x6')]('/',auth['isAuthenticated'](),controller[_0x05d4('0x7')]);router['get']('/describe',auth[_0x05d4('0x8')](),controller[_0x05d4('0x9')]);router[_0x05d4('0x6')](_0x05d4('0xa'),auth['isAuthenticated'](),controller[_0x05d4('0xb')]);router[_0x05d4('0x6')](_0x05d4('0xc'),auth[_0x05d4('0x8')](),controller['download']);router['post']('/',auth['isAuthenticated'](),interaction[_0x05d4('0xd')]('mail',_0x05d4('0xe')),controller[_0x05d4('0xf')]);router[_0x05d4('0x10')](_0x05d4('0xa'),auth[_0x05d4('0x8')](),controller['update']);router[_0x05d4('0x10')](_0x05d4('0x11'),auth['isAuthenticated'](),controller[_0x05d4('0x12')]);router[_0x05d4('0x10')](_0x05d4('0x13'),auth[_0x05d4('0x8')](),controller[_0x05d4('0x14')]);router[_0x05d4('0x15')]('/:id',auth[_0x05d4('0x8')](),controller[_0x05d4('0x16')]);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 e62c3ed..6124675 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 _0x8592=['TEXT','long','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email','sequelize','lodash','exports'];(function(_0x49ed67,_0x290989){var _0x1523d5=function(_0x34a179){while(--_0x34a179){_0x49ed67['push'](_0x49ed67['shift']());}};_0x1523d5(++_0x290989);}(_0x8592,0xd5));var _0x2859=function(_0x20845e,_0x211e78){_0x20845e=_0x20845e-0x0;var _0x28cf2b=_0x8592[_0x20845e];return _0x28cf2b;};'use strict';var Sequelize=require(_0x2859('0x0'));var _=require(_0x2859('0x1'));module[_0x2859('0x2')]={'body':{'type':Sequelize[_0x2859('0x3')](_0x2859('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize[_0x2859('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2859('0x6')]('in',_0x2859('0x7')),'defaultValue':_0x2859('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x2859('0x8')](0x1fe)},'from':{'type':Sequelize[_0x2859('0x8')]},'to':{'type':Sequelize[_0x2859('0x3')](_0x2859('0x4'))},'cc':{'type':Sequelize['TEXT'](_0x2859('0x4'))},'bcc':{'type':Sequelize[_0x2859('0x3')](_0x2859('0x4'))},'subject':{'type':Sequelize[_0x2859('0x3')]},'sentAt':{'type':Sequelize[_0x2859('0x9')]},'attach':{'type':Sequelize[_0x2859('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x2859('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x2859('0x3')]('long')},'originCc':{'type':Sequelize[_0x2859('0x3')](_0x2859('0x4'))},'originChannel':{'type':Sequelize['ENUM']('Email','Chat'),'defaultValue':_0x2859('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x1003=['TEXT','long','medium','BOOLEAN','ENUM','STRING','INTEGER','Email','Chat','sequelize','lodash','exports'];(function(_0x352e75,_0x169660){var _0x2c0af6=function(_0x5dae7f){while(--_0x5dae7f){_0x352e75['push'](_0x352e75['shift']());}};_0x2c0af6(++_0x169660);}(_0x1003,0x81));var _0x3100=function(_0x3fe65b,_0x13ac2e){_0x3fe65b=_0x3fe65b-0x0;var _0x32de12=_0x1003[_0x3fe65b];return _0x32de12;};'use strict';var Sequelize=require(_0x3100('0x0'));var _=require(_0x3100('0x1'));module[_0x3100('0x2')]={'body':{'type':Sequelize[_0x3100('0x3')](_0x3100('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x3100('0x3')](_0x3100('0x5'))},'read':{'type':Sequelize[_0x3100('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3100('0x7')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x3100('0x8')](0x1fe)},'from':{'type':Sequelize[_0x3100('0x8')]},'to':{'type':Sequelize[_0x3100('0x3')]('long')},'cc':{'type':Sequelize[_0x3100('0x3')](_0x3100('0x4'))},'bcc':{'type':Sequelize[_0x3100('0x3')](_0x3100('0x4'))},'subject':{'type':Sequelize[_0x3100('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x3100('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x3100('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0x3100('0x3')](_0x3100('0x4'))},'originChannel':{'type':Sequelize[_0x3100('0x7')](_0x3100('0xa'),_0x3100('0xb')),'defaultValue':_0x3100('0xa'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 374bd3d..2d18ccd 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 _0x279c=['ListId','sendMail','messageId','mail','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','email','internal','manual','interface','channel','event','fromString','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','fullname','SIP/%s','EventManager','rejectmessage','download','unix','join','server','files','tmp','message-%s.eml','subject','Attachment','Attachments','from','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','existsSync','push','build','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','redis','localhost','socket.io-emitter','./mailMessage.socket','register','client','http','request','then','info','MailMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','merge','VIRTUAL','options','include','MailMessage','findAll','rows','catch','show','includeAll','find','body','params','direction','out','secret','split','findOne','MailAccountId','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','getSmtpOptions','attachments','root','server/files/attachments','basename','CmContact','create','defaults'];(function(_0x13f7eb,_0x84be3e){var _0x1d33a1=function(_0x41d342){while(--_0x41d342){_0x13f7eb['push'](_0x13f7eb['shift']());}};_0x1d33a1(++_0x84be3e);}(_0x279c,0xe6));var _0xc279=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x279c[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0xc279('0x0'));var moment=require(_0xc279('0x1'));var BPromise=require(_0xc279('0x2'));var util=require(_0xc279('0x3'));var path=require(_0xc279('0x4'));var fs=require('fs');var _=require(_0xc279('0x5'));var Redis=require(_0xc279('0x6'));var htmlToText=require(_0xc279('0x7'));var qs=require(_0xc279('0x8'));var logger=require(_0xc279('0x9'))(_0xc279('0xa'));var interaction_log=require(_0xc279('0x9'))(_0xc279('0xb'));var config=require(_0xc279('0xc'));var db=require('../../mysqldb')['db'];config[_0xc279('0xd')]=_['defaults'](config[_0xc279('0xd')],{'host':_0xc279('0xe'),'port':0x18eb});var socket=require(_0xc279('0xf'))(new Redis(config[_0xc279('0xd')]));var htmlEntities=require('html-entities');require(_0xc279('0x10'))[_0xc279('0x11')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc279('0x12')][_0xc279('0x13')]({'port':0x232c});var client9003=jayson[_0xc279('0x12')][_0xc279('0x13')]({'port':0x232b});var client9002=jayson[_0xc279('0x12')][_0xc279('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x3db417,_0x25795b,_0x50dc5d,_0x56d21b){return new BPromise(function(_0xc573ca,_0x37509c){var _0x2e5750=_0x56d21b||client;return _0x2e5750[_0xc279('0x14')](_0x3db417,_0x50dc5d)[_0xc279('0x15')](function(_0x273b8f){logger[_0xc279('0x16')](_0xc279('0x17'),_0x25795b,'request\x20sent');logger[_0xc279('0x18')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x25795b,'request\x20sent',JSON[_0xc279('0x19')](_0x273b8f));if(_0x273b8f['error']){if(_0x273b8f[_0xc279('0x1a')][_0xc279('0x1b')]===0x1f4){logger['error'](_0xc279('0x17'),_0x25795b,_0x273b8f[_0xc279('0x1a')][_0xc279('0x1c')]);return _0x37509c(_0x273b8f[_0xc279('0x1a')][_0xc279('0x1c')]);}logger[_0xc279('0x1a')](_0xc279('0x17'),_0x25795b,_0x273b8f['error'][_0xc279('0x1c')]);return _0xc573ca(_0x273b8f[_0xc279('0x1a')][_0xc279('0x1c')]);}else{logger[_0xc279('0x16')](_0xc279('0x17'),_0x25795b,_0xc279('0x1d'));_0xc573ca(_0x273b8f[_0xc279('0x1e')][_0xc279('0x1c')]);}})['catch'](function(_0x1ad880){logger['error'](_0xc279('0x17'),_0x25795b,_0x1ad880);_0x37509c(_0x1ad880);});});}function respondWithResult(_0x55d447,_0x45cc10){_0x45cc10=_0x45cc10||0xc8;return function(_0x18b0a0){if(_0x18b0a0){return _0x55d447[_0xc279('0x1f')](_0x45cc10)[_0xc279('0x20')](_0x18b0a0);}};}function respondWithFilteredResult(_0x56c2fc,_0x3ceefb){return function(_0x38bda1){if(_0x38bda1){var _0x218fe8=typeof _0x3ceefb[_0xc279('0x21')]===_0xc279('0x22')&&typeof _0x3ceefb[_0xc279('0x23')]===_0xc279('0x22');var _0x404cda=_0x38bda1[_0xc279('0x24')];var _0x43e493=_0x218fe8?0x0:_0x3ceefb[_0xc279('0x21')];var _0x5bb8b1=_0x218fe8?_0x38bda1[_0xc279('0x24')]:_0x3ceefb['offset']+_0x3ceefb[_0xc279('0x23')];var _0x205bda;if(_0x5bb8b1>=_0x404cda){_0x5bb8b1=_0x404cda;_0x205bda=0xc8;}else{_0x205bda=0xce;}_0x56c2fc[_0xc279('0x1f')](_0x205bda);return _0x56c2fc[_0xc279('0x25')](_0xc279('0x26'),_0x43e493+'-'+_0x5bb8b1+'/'+_0x404cda)[_0xc279('0x20')](_0x38bda1);}return null;};}function saveUpdates(_0x6629fa){return function(_0x3befab){if(_0x3befab){return _0x3befab[_0xc279('0x27')](_0x6629fa)[_0xc279('0x15')](function(_0x2b33ec){return _0x2b33ec;});}return null;};}function removeEntity(_0x52c508){return function(_0x24f965){if(_0x24f965){return _0x24f965[_0xc279('0x28')]()[_0xc279('0x15')](function(){_0x52c508[_0xc279('0x1f')](0xcc)[_0xc279('0x29')]();});}};}function handleEntityNotFound(_0x2d5b33){return function(_0x1a6f33){if(!_0x1a6f33){_0x2d5b33[_0xc279('0x2a')](0x194);}return _0x1a6f33;};}function handleError(_0x29759d,_0x3be520){_0x3be520=_0x3be520||0x1f4;return function(_0x2dde18){logger[_0xc279('0x1a')](_0x2dde18[_0xc279('0x2b')]);if(_0x2dde18[_0xc279('0x2c')]){delete _0x2dde18[_0xc279('0x2c')];}_0x29759d[_0xc279('0x1f')](_0x3be520)[_0xc279('0x2d')](_0x2dde18);};}exports[_0xc279('0x2e')]=function(_0x16dc22,_0x169888){var _0x1b2619={},_0x4b2089={},_0x5381e7={'count':0x0,'rows':[]};var _0x1f734d=_[_0xc279('0x2f')](db['MailMessage'][_0xc279('0x30')],function(_0x61afed){return{'name':_0x61afed[_0xc279('0x31')],'type':_0x61afed[_0xc279('0x32')][_0xc279('0x33')]};});_0x4b2089[_0xc279('0x34')]=_[_0xc279('0x2f')](_0x1f734d,_0xc279('0x2c'));_0x4b2089[_0xc279('0x35')]=_[_0xc279('0x36')](_0x16dc22['query']);_0x4b2089[_0xc279('0x37')]=_['intersection'](_0x4b2089['model'],_0x4b2089[_0xc279('0x35')]);_0x1b2619[_0xc279('0x38')]=_[_0xc279('0x39')](_0x4b2089[_0xc279('0x34')],qs[_0xc279('0x3a')](_0x16dc22[_0xc279('0x35')][_0xc279('0x3a')]));_0x1b2619['attributes']=_0x1b2619['attributes'][_0xc279('0x3b')]?_0x1b2619[_0xc279('0x38')]:_0x4b2089['model'];if(!_0x16dc22[_0xc279('0x35')]['hasOwnProperty'](_0xc279('0x3c'))){_0x1b2619[_0xc279('0x23')]=qs['limit'](_0x16dc22[_0xc279('0x35')]['limit']);_0x1b2619[_0xc279('0x21')]=qs[_0xc279('0x21')](_0x16dc22[_0xc279('0x35')]['offset']);}_0x1b2619[_0xc279('0x3d')]=qs['sort'](_0x16dc22[_0xc279('0x35')][_0xc279('0x3e')]);_0x1b2619[_0xc279('0x3f')]=qs[_0xc279('0x37')](_['pick'](_0x16dc22[_0xc279('0x35')],_0x4b2089[_0xc279('0x37')]),_0x1f734d);if(_0x16dc22[_0xc279('0x35')]['filter']){_0x1b2619[_0xc279('0x3f')]=_[_0xc279('0x40')](_0x1b2619[_0xc279('0x3f')],{'$or':_[_0xc279('0x2f')](_0x1f734d,function(_0x295881){if(_0x295881[_0xc279('0x32')]!==_0xc279('0x41')){var _0x105e49={};_0x105e49[_0x295881[_0xc279('0x2c')]]={'$like':'%'+_0x16dc22[_0xc279('0x35')]['filter']+'%'};return _0x105e49;}})});}_0x1b2619=_[_0xc279('0x40')]({},_0x1b2619,_0x16dc22[_0xc279('0x42')]);var _0x24248e={'where':_0x1b2619[_0xc279('0x3f')]};return db['MailMessage'][_0xc279('0x24')](_0x24248e)[_0xc279('0x15')](function(_0xb797ff){_0x5381e7['count']=_0xb797ff;if(_0x16dc22[_0xc279('0x35')]['includeAll']){_0x1b2619[_0xc279('0x43')]=[{'all':!![]}];}return db[_0xc279('0x44')][_0xc279('0x45')](_0x1b2619);})[_0xc279('0x15')](function(_0x4513c1){_0x5381e7[_0xc279('0x46')]=_0x4513c1;return _0x5381e7;})[_0xc279('0x15')](respondWithFilteredResult(_0x169888,_0x1b2619))[_0xc279('0x47')](handleError(_0x169888,null));};exports[_0xc279('0x48')]=function(_0x33d2cb,_0x41d387){var _0x546f89={'raw':!![],'where':{'id':_0x33d2cb['params']['id']}},_0x325bb1={};_0x325bb1['model']=_[_0xc279('0x36')](db['MailMessage']['rawAttributes']);_0x325bb1[_0xc279('0x35')]=_[_0xc279('0x36')](_0x33d2cb[_0xc279('0x35')]);_0x325bb1['filters']=_[_0xc279('0x39')](_0x325bb1[_0xc279('0x34')],_0x325bb1[_0xc279('0x35')]);_0x546f89['attributes']=_[_0xc279('0x39')](_0x325bb1[_0xc279('0x34')],qs[_0xc279('0x3a')](_0x33d2cb[_0xc279('0x35')][_0xc279('0x3a')]));_0x546f89[_0xc279('0x38')]=_0x546f89[_0xc279('0x38')]['length']?_0x546f89['attributes']:_0x325bb1['model'];if(_0x33d2cb[_0xc279('0x35')][_0xc279('0x49')]){_0x546f89['include']=[{'all':!![]}];}_0x546f89=_['merge']({},_0x546f89,_0x33d2cb[_0xc279('0x42')]);return db[_0xc279('0x44')][_0xc279('0x4a')](_0x546f89)['then'](handleEntityNotFound(_0x41d387,null))[_0xc279('0x15')](respondWithResult(_0x41d387,null))[_0xc279('0x47')](handleError(_0x41d387,null));};exports[_0xc279('0x27')]=function(_0x230576,_0x5c5799){if(_0x230576[_0xc279('0x4b')]['id']){delete _0x230576[_0xc279('0x4b')]['id'];}return db[_0xc279('0x44')][_0xc279('0x4a')]({'where':{'id':_0x230576['params']['id']}})['then'](handleEntityNotFound(_0x5c5799,null))['then'](saveUpdates(_0x230576[_0xc279('0x4b')],null))[_0xc279('0x15')](respondWithResult(_0x5c5799,null))[_0xc279('0x47')](handleError(_0x5c5799,null));};exports[_0xc279('0x28')]=function(_0x531406,_0x4139c6){return db[_0xc279('0x44')][_0xc279('0x4a')]({'where':{'id':_0x531406[_0xc279('0x4c')]['id']}})[_0xc279('0x15')](handleEntityNotFound(_0x4139c6,null))[_0xc279('0x15')](removeEntity(_0x4139c6,null))[_0xc279('0x47')](handleError(_0x4139c6,null));};exports['describe']=function(_0x33690c,_0x887fb6){return db['MailMessage']['describe']()[_0xc279('0x15')](respondWithResult(_0x887fb6,null))[_0xc279('0x47')](handleError(_0x887fb6,null));};exports['create']=function(_0x181244,_0x38ee42){return db[_0xc279('0x44')]['create'](_0x181244['body'])[_0xc279('0x15')](function(_0x4bb8ef){if(_0x4bb8ef){if(_0x4bb8ef[_0xc279('0x4d')]===_0xc279('0x4e')&&!_0x4bb8ef[_0xc279('0x4f')]){var _0x463949,_0x43517f,_0x1b36d2;if(_0x181244[_0xc279('0x4b')]['to']){_0x43517f=_0x181244[_0xc279('0x4b')]['to'][_0xc279('0x50')](',')[0x0];}return db['MailAccount'][_0xc279('0x51')]({'where':{'id':_0x4bb8ef[_0xc279('0x52')]},'include':[{'model':db[_0xc279('0x53')],'as':_0xc279('0x54'),'include':[{'model':db['CmContact'],'as':_0xc279('0x55'),'where':{'email':_0x43517f},'limit':0x1,'order':[[_0xc279('0x56'),_0xc279('0x57')]]}]},{'model':db[_0xc279('0x58')],'as':_0xc279('0x59'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})['then'](function(_0x50b76b){_0x463949=_0x50b76b;if(!_0x463949||!_0x463949[_0xc279('0x59')])return;var _0x1f6719=_0x463949[_0xc279('0x5a')]();if(_0x181244[_0xc279('0x4b')][_0xc279('0x5b')]&&_0x181244[_0xc279('0x4b')][_0xc279('0x5b')]['length']){for(var _0xc2b943=0x0;_0xc2b943<_0x181244[_0xc279('0x4b')][_0xc279('0x5b')][_0xc279('0x3b')];_0xc2b943+=0x1){_0x181244['body']['attachments'][_0xc2b943]={'filename':_0x181244['body'][_0xc279('0x5b')][_0xc2b943][_0xc279('0x2c')],'path':path['join'](config[_0xc279('0x5c')],_0xc279('0x5d'),_0x181244[_0xc279('0x4b')]['attachments'][_0xc2b943][_0xc279('0x5e')])};}}_0x1b36d2={'account':_0x1f6719,'message':_0x181244['body']};return;})['then'](function(){if(_0x463949['List']){if(_0x463949[_0xc279('0x54')][_0xc279('0x55')][_0xc279('0x3b')]){return _0x463949['List']['Contacts'][0x0];}else{return db[_0xc279('0x5f')][_0xc279('0x60')](_[_0xc279('0x61')](_0x181244[_0xc279('0x4b')],{'firstName':_0x181244['body']['to'],'email':_0x181244[_0xc279('0x4b')]['to'],'phone':_0x181244[_0xc279('0x4b')]['to'],'ListId':_0x463949[_0xc279('0x62')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xc279('0x15')](function(){if(_0x1b36d2){return respondWithRpcPromise('SendMail',_0xc279('0x63'),_0x1b36d2,client9003)[_0xc279('0x15')](function(_0x5d5e48){return _0x4bb8ef[_0xc279('0x27')]({'read':!![],'messageId':_0x5d5e48[_0xc279('0x64')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0xc279('0x47')](function(_0x28a888){logger[_0xc279('0x1a')]('%s',JSON[_0xc279('0x19')](_0x28a888));return _0x4bb8ef;});}return _0x4bb8ef;});}return _0x4bb8ef;}})[_0xc279('0x15')](respondWithResult(_0x38ee42,0xc9))['catch'](handleError(_0x38ee42,null));};exports['accept']=function(_0x447774,_0x23a972){var _0x39e99d={'agent':{},'channel':_0xc279('0x65')};if(_0x447774[_0xc279('0x4b')]['id']){delete _0x447774['body']['id'];}_0x447774[_0xc279('0x4b')][_0xc279('0x66')]=!![];_0x447774[_0xc279('0x4b')][_0xc279('0x67')]=moment()[_0xc279('0x68')](_0xc279('0x69'));_0x447774[_0xc279('0x4b')][_0xc279('0x6a')]=_0x447774['body'][_0xc279('0x6a')]||_0x447774[_0xc279('0x6b')]['id'];_0x39e99d[_0xc279('0x6c')]['id']=_0x447774['body'][_0xc279('0x6a')];return db[_0xc279('0x44')][_0xc279('0x4a')]({'where':{'id':_0x447774['params']['id'],'UserId':null}})[_0xc279('0x15')](handleEntityNotFound(_0x23a972,null))[_0xc279('0x15')](saveUpdates(_0x447774[_0xc279('0x4b')],null))[_0xc279('0x15')](function(_0x4c6e5f){if(_0x4c6e5f){_0x39e99d[_0xc279('0x1c')]=_0x4c6e5f[_0xc279('0x6d')]({'plain':!![]});return db[_0xc279('0x6e')]['find']({'where':{'id':_0x4c6e5f[_0xc279('0x6f')]}});}return null;})['then'](handleEntityNotFound(_0x23a972,null))['then'](function(_0x29cdd1){if(_0x29cdd1){return _0x29cdd1['update']({'UserId':_0x447774[_0xc279('0x4b')][_0xc279('0x6a')],'read1stAt':_[_0xc279('0x70')](_0x29cdd1[_0xc279('0x71')])?moment()[_0xc279('0x68')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xc279('0x15')](function(_0x341ece){if(_0x341ece){_0x39e99d[_0xc279('0x72')]=_0x341ece[_0xc279('0x6d')]({'plain':!![]});interaction_log['info'](_0xc279('0x73'),_0x447774[_0xc279('0x6b')]['id'],_0x447774[_0xc279('0x6b')][_0xc279('0x2c')],_0x447774[_0xc279('0x6b')][_0xc279('0x74')],_0x39e99d[_0xc279('0x72')]['id'],_0x447774[_0xc279('0x4b')]?JSON[_0xc279('0x19')](_0x447774['body']):_0xc279('0x75'));return respondWithRpcPromise(_0xc279('0x76'),_0xc279('0x77'),_0x39e99d);}return null;})[_0xc279('0x15')](function(_0x387521){var _0x48f167=_0xc279('0x78')+_0x387521[_0xc279('0x1c')][_0xc279('0x79')];return db[_0xc279('0x7a')][_0xc279('0x35')](_0x48f167,{'type':db[_0xc279('0x7b')]['QueryTypes'][_0xc279('0x7c')],'raw':!![]})[_0xc279('0x15')](function(_0x14b95a){return _0x14b95a;});})['then'](function(_0x2100bf){if(_0x2100bf){_0x39e99d[_0xc279('0x1c')][_0xc279('0x7d')]=_0x2100bf[0x0];if(!_0x447774[_0xc279('0x4b')][_0xc279('0x6a')])return;return db[_0xc279('0x7e')][_0xc279('0x4a')]({'where':{'id':_0x447774[_0xc279('0x4b')][_0xc279('0x6a')],'role':'agent'},'attributes':['id',_0xc279('0x2c'),'fullname',_0xc279('0x7f'),_0xc279('0x80')],'raw':!![]});}return null;})['then'](function(_0x2f7676){if(!_0x2f7676)return null;_0x39e99d[_0xc279('0x1c')][_0xc279('0x6c')]=_0x2f7676;return _0x39e99d;})[_0xc279('0x15')](function(_0x26d97a){if(_0x26d97a){if(_0x447774[_0xc279('0x4b')][_0xc279('0x81')]){_0x39e99d[_0xc279('0x1c')][_0xc279('0x82')]=util[_0xc279('0x68')]('SIP/%s',_0x447774[_0xc279('0x6b')][_0xc279('0x2c')]);_0x39e99d['message']['channel']=_0x39e99d[_0xc279('0x83')];_0x39e99d['message']['motionChannel']=_0x39e99d[_0xc279('0x83')];_0x39e99d['message'][_0xc279('0x84')]='accept';_0x39e99d['message'][_0xc279('0x4b')]=htmlToText[_0xc279('0x85')](_0x39e99d[_0xc279('0x1c')][_0xc279('0x4b')]);return respondWithRpcPromise('EventManager','EventManager',{'event':_0xc279('0x86'),'message':_0x39e99d[_0xc279('0x1c')]},client9002)[_0xc279('0x15')](function(){return _0x39e99d;});}return _0x39e99d;}return null;})['then'](respondWithResult(_0x23a972,null))['catch'](handleError(_0x23a972,null));};exports[_0xc279('0x87')]=function(_0x5e8996,_0x10f1de){var _0x2b2b53={'agent':{},'channel':_0xc279('0x65')};if(_0x5e8996[_0xc279('0x4b')]['id']){delete _0x5e8996[_0xc279('0x4b')]['id'];}_0x5e8996[_0xc279('0x4b')][_0xc279('0x6a')]=_0x5e8996[_0xc279('0x4b')]['UserId']||_0x5e8996[_0xc279('0x6b')]['id'];_0x2b2b53['agent']['id']=_0x5e8996[_0xc279('0x4b')][_0xc279('0x6a')];return db[_0xc279('0x44')][_0xc279('0x4a')]({'where':{'id':_0x5e8996[_0xc279('0x4c')]['id'],'UserId':null}})[_0xc279('0x15')](handleEntityNotFound(_0x10f1de,null))[_0xc279('0x15')](function(_0x35fc02){if(_0x35fc02){_0x2b2b53[_0xc279('0x1c')]=_0x35fc02[_0xc279('0x6d')]({'plain':!![]});return db[_0xc279('0x6e')][_0xc279('0x4a')]({'where':{'id':_0x35fc02[_0xc279('0x6f')]}});}return null;})[_0xc279('0x15')](handleEntityNotFound(_0x10f1de,null))['then'](function(_0x4b88a8){if(_0x4b88a8){_0x2b2b53['interaction']=_0x4b88a8['get']({'plain':!![]});interaction_log[_0xc279('0x16')](_0xc279('0x88'),_0x5e8996[_0xc279('0x6b')]['id'],_0x5e8996[_0xc279('0x6b')][_0xc279('0x2c')],_0x5e8996[_0xc279('0x6b')][_0xc279('0x74')],_0x2b2b53[_0xc279('0x72')]['id'],_0x5e8996['body']?JSON['stringify'](_0x5e8996[_0xc279('0x4b')]):_0xc279('0x75'));return respondWithRpcPromise(_0xc279('0x89'),_0xc279('0x8a'),_0x2b2b53);}return null;})[_0xc279('0x15')](function(_0xfb4c82){var _0x50ac87=_0xc279('0x78')+_0xfb4c82['message'][_0xc279('0x79')];return db[_0xc279('0x7a')]['query'](_0x50ac87,{'type':db[_0xc279('0x7b')][_0xc279('0x8b')][_0xc279('0x7c')],'raw':!![]})[_0xc279('0x15')](function(_0x37f4f0){return _0x37f4f0;});})['then'](function(_0x135d42){if(_0x135d42){_0x2b2b53['message']['contact']=_0x135d42[0x0];if(!_0x5e8996['body']['UserId'])return;return db[_0xc279('0x7e')][_0xc279('0x4a')]({'where':{'id':_0x5e8996[_0xc279('0x4b')][_0xc279('0x6a')],'role':_0xc279('0x6c')},'attributes':['id',_0xc279('0x2c'),_0xc279('0x8c'),_0xc279('0x7f'),_0xc279('0x80')],'raw':!![]});}return null;})[_0xc279('0x15')](function(_0x45bb50){if(!_0x45bb50)return null;_0x2b2b53[_0xc279('0x1c')][_0xc279('0x6c')]=_0x45bb50;return _0x2b2b53;})[_0xc279('0x15')](function(_0x16869c){if(_0x16869c){_0x16869c[_0xc279('0x1c')][_0xc279('0x82')]=util[_0xc279('0x68')](_0xc279('0x8d'),_0x5e8996[_0xc279('0x6b')]['name']);_0x16869c[_0xc279('0x1c')][_0xc279('0x83')]=_0x2b2b53[_0xc279('0x83')];_0x16869c[_0xc279('0x1c')]['motionChannel']=_0x2b2b53[_0xc279('0x83')];_0x16869c[_0xc279('0x1c')][_0xc279('0x84')]=_0xc279('0x87');_0x16869c[_0xc279('0x1c')][_0xc279('0x4b')]=htmlToText[_0xc279('0x85')](_0x2b2b53[_0xc279('0x1c')][_0xc279('0x4b')]);respondWithRpcPromise(_0xc279('0x8e'),_0xc279('0x8e'),{'event':_0xc279('0x8f'),'message':_0x16869c['message']},client9002);return _0x2b2b53;}return null;})[_0xc279('0x15')](respondWithResult(_0x10f1de,null))['catch'](handleError(_0x10f1de,null));};exports[_0xc279('0x90')]=function(_0x40bd5a,_0x2b3e50){var _0x5ccb52=moment()[_0xc279('0x91')]()['toString']();var _0x24aa37=path[_0xc279('0x92')](config[_0xc279('0x5c')],_0xc279('0x93'),_0xc279('0x94'),_0xc279('0x95'));var _0x24de86=path[_0xc279('0x92')](config[_0xc279('0x5c')],_0xc279('0x93'),'files',_0xc279('0x5b'));var _0xac0f40=util['format'](_0xc279('0x96'),_0x5ccb52);return db[_0xc279('0x44')][_0xc279('0x4a')]({'where':{'id':_0x40bd5a[_0xc279('0x4c')]['id']},'attributes':['id',_0xc279('0x4b'),'from','to','cc','bcc',_0xc279('0x97'),'createdAt'],'include':_0x40bd5a[_0xc279('0x35')]['attachments']?[{'model':db[_0xc279('0x98')],'as':_0xc279('0x99')}]:undefined})[_0xc279('0x15')](handleEntityNotFound(_0x2b3e50,null))[_0xc279('0x15')](function(_0x379b63){if(_0x379b63){var _0x11fc5e=_0x379b63;var _0x16b68f={'from':_0x11fc5e[_0xc279('0x9a')],'to':_0x11fc5e['to'],'subject':_0x11fc5e['subject'],'html':htmlEntities[_0xc279('0x9b')](_0x11fc5e[_0xc279('0x4b')]),'headers':{'Date':moment(_0x11fc5e[_0xc279('0x9c')])[_0xc279('0x68')](_0xc279('0x9d'))},'attachments':[]};if(_0x379b63['cc']){_0x16b68f[_0xc279('0x9e')]['Cc']=_0x379b63['cc'];}if(_0x379b63[_0xc279('0x9f')]){_0x16b68f[_0xc279('0x9e')]['Bcc']=_0x379b63[_0xc279('0x9f')];}return new BPromise(function(_0x4a6b62,_0x42a1d4){if(_0x379b63[_0xc279('0x99')]){for(var _0xa139ba=0x0;_0xa139ba<_0x379b63[_0xc279('0x99')][_0xc279('0x3b')];_0xa139ba++){var _0x473f8e=_0x379b63[_0xc279('0x99')][_0xa139ba];var _0x562da9=path[_0xc279('0x92')](_0x24de86,_0x473f8e['basename']);if(fs[_0xc279('0xa0')](_0x562da9)){_0x16b68f[_0xc279('0x5b')][_0xc279('0xa1')]({'name':_0x473f8e[_0xc279('0x2c')],'contentType':_0x473f8e[_0xc279('0x32')],'data':fs['readFileSync'](_0x562da9)});}}}emlformat[_0xc279('0xa2')](_0x16b68f,function(_0x54ac2f,_0x3231d0){if(_0x54ac2f)return _0x42a1d4(_0x54ac2f);fs['writeFileSync'](path[_0xc279('0x92')](_0x24aa37,_0xac0f40),_0x3231d0);return _0x4a6b62(_0x3231d0);});});}})[_0xc279('0x15')](function(_0xc32ed6){if(_0xc32ed6){return _0x2b3e50[_0xc279('0x90')](path['join'](_0x24aa37,_0xac0f40),_0xac0f40,function(_0x336c72){if(!_0x336c72)fs[_0xc279('0xa3')](path[_0xc279('0x92')](_0x24aa37,_0xac0f40));});}})[_0xc279('0x47')](handleError(_0x2b3e50,null));}; \ No newline at end of file +var _0x31f8=['fromString','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','reject','rejectmessage','unix','toString','root','server','files','tmp','message-%s.eml','bcc','subject','createdAt','Attachments','headers','Bcc','push','readFileSync','writeFileSync','download','unlinkSync','eml-format','moment','path','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../mysqldb','defaults','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','status','offset','undefined','limit','Content-Range','json','update','end','sendStatus','stack','name','send','MailMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','show','params','find','body','describe','create','direction','out','secret','split','MailAccount','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','CloudProvider','Smtp','getSmtpOptions','attachments','join','server/files/attachments','basename','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','read','readAt','UserId','user','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','info','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x31f8,0x153));var _0x831f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x31f8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x831f('0x0'));var moment=require(_0x831f('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x831f('0x2'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x831f('0x3'));var htmlToText=require(_0x831f('0x4'));var qs=require(_0x831f('0x5'));var logger=require('../../config/logger')(_0x831f('0x6'));var interaction_log=require(_0x831f('0x7'))(_0x831f('0x8'));var config=require('../../config/environment');var db=require(_0x831f('0x9'))['db'];config['redis']=_[_0x831f('0xa')](config[_0x831f('0xb')],{'host':_0x831f('0xc'),'port':0x18eb});var socket=require(_0x831f('0xd'))(new Redis(config['redis']));var htmlEntities=require(_0x831f('0xe'));require(_0x831f('0xf'))[_0x831f('0x10')](socket);var jayson=require(_0x831f('0x11'));var client=jayson[_0x831f('0x12')][_0x831f('0x13')]({'port':0x232c});var client9003=jayson[_0x831f('0x12')][_0x831f('0x13')]({'port':0x232b});var client9002=jayson[_0x831f('0x12')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a770e,_0x654722,_0x3ba5f9,_0x39a640){return new BPromise(function(_0x32e344,_0x119b8e){var _0x20313b=_0x39a640||client;return _0x20313b['request'](_0x4a770e,_0x3ba5f9)[_0x831f('0x14')](function(_0x5be06a){logger['info'](_0x831f('0x15'),_0x654722,_0x831f('0x16'));logger[_0x831f('0x17')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x654722,'request\x20sent',JSON['stringify'](_0x5be06a));if(_0x5be06a[_0x831f('0x18')]){if(_0x5be06a[_0x831f('0x18')]['code']===0x1f4){logger[_0x831f('0x18')](_0x831f('0x15'),_0x654722,_0x5be06a[_0x831f('0x18')][_0x831f('0x19')]);return _0x119b8e(_0x5be06a[_0x831f('0x18')]['message']);}logger['error'](_0x831f('0x15'),_0x654722,_0x5be06a[_0x831f('0x18')]['message']);return _0x32e344(_0x5be06a[_0x831f('0x18')]['message']);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x654722,'request\x20sent');_0x32e344(_0x5be06a[_0x831f('0x1a')][_0x831f('0x19')]);}})[_0x831f('0x1b')](function(_0x27cbe9){logger[_0x831f('0x18')]('MailMessage,\x20%s,\x20%s',_0x654722,_0x27cbe9);_0x119b8e(_0x27cbe9);});});}function respondWithResult(_0x2a1c9f,_0xf9cc87){_0xf9cc87=_0xf9cc87||0xc8;return function(_0x264d19){if(_0x264d19){return _0x2a1c9f[_0x831f('0x1c')](_0xf9cc87)['json'](_0x264d19);}};}function respondWithFilteredResult(_0x48d2a3,_0x5d733e){return function(_0x2cb3ff){if(_0x2cb3ff){var _0x52959f=typeof _0x5d733e[_0x831f('0x1d')]===_0x831f('0x1e')&&typeof _0x5d733e[_0x831f('0x1f')]===_0x831f('0x1e');var _0x31552f=_0x2cb3ff['count'];var _0x5731f1=_0x52959f?0x0:_0x5d733e['offset'];var _0x5f09fb=_0x52959f?_0x2cb3ff['count']:_0x5d733e[_0x831f('0x1d')]+_0x5d733e['limit'];var _0x34f252;if(_0x5f09fb>=_0x31552f){_0x5f09fb=_0x31552f;_0x34f252=0xc8;}else{_0x34f252=0xce;}_0x48d2a3[_0x831f('0x1c')](_0x34f252);return _0x48d2a3['set'](_0x831f('0x20'),_0x5731f1+'-'+_0x5f09fb+'/'+_0x31552f)[_0x831f('0x21')](_0x2cb3ff);}return null;};}function saveUpdates(_0x355022){return function(_0x106737){if(_0x106737){return _0x106737[_0x831f('0x22')](_0x355022)[_0x831f('0x14')](function(_0x5cfde0){return _0x5cfde0;});}return null;};}function removeEntity(_0x4add65){return function(_0x4e9847){if(_0x4e9847){return _0x4e9847['destroy']()[_0x831f('0x14')](function(){_0x4add65['status'](0xcc)[_0x831f('0x23')]();});}};}function handleEntityNotFound(_0x22d20c){return function(_0x2cdeeb){if(!_0x2cdeeb){_0x22d20c[_0x831f('0x24')](0x194);}return _0x2cdeeb;};}function handleError(_0x3f168a,_0x39130d){_0x39130d=_0x39130d||0x1f4;return function(_0xe2beb0){logger['error'](_0xe2beb0[_0x831f('0x25')]);if(_0xe2beb0[_0x831f('0x26')]){delete _0xe2beb0[_0x831f('0x26')];}_0x3f168a['status'](_0x39130d)[_0x831f('0x27')](_0xe2beb0);};}exports['index']=function(_0x38f2d8,_0x32e743){var _0x1f869b={},_0x28d4ab={},_0x132f1f={'count':0x0,'rows':[]};var _0x2f0d72=_['map'](db[_0x831f('0x28')][_0x831f('0x29')],function(_0x5780f8){return{'name':_0x5780f8['fieldName'],'type':_0x5780f8[_0x831f('0x2a')][_0x831f('0x2b')]};});_0x28d4ab[_0x831f('0x2c')]=_[_0x831f('0x2d')](_0x2f0d72,'name');_0x28d4ab[_0x831f('0x2e')]=_[_0x831f('0x2f')](_0x38f2d8[_0x831f('0x2e')]);_0x28d4ab[_0x831f('0x30')]=_[_0x831f('0x31')](_0x28d4ab['model'],_0x28d4ab[_0x831f('0x2e')]);_0x1f869b[_0x831f('0x32')]=_[_0x831f('0x31')](_0x28d4ab['model'],qs[_0x831f('0x33')](_0x38f2d8[_0x831f('0x2e')][_0x831f('0x33')]));_0x1f869b[_0x831f('0x32')]=_0x1f869b[_0x831f('0x32')][_0x831f('0x34')]?_0x1f869b['attributes']:_0x28d4ab[_0x831f('0x2c')];if(!_0x38f2d8[_0x831f('0x2e')]['hasOwnProperty'](_0x831f('0x35'))){_0x1f869b['limit']=qs[_0x831f('0x1f')](_0x38f2d8[_0x831f('0x2e')][_0x831f('0x1f')]);_0x1f869b[_0x831f('0x1d')]=qs[_0x831f('0x1d')](_0x38f2d8['query']['offset']);}_0x1f869b[_0x831f('0x36')]=qs[_0x831f('0x37')](_0x38f2d8[_0x831f('0x2e')]['sort']);_0x1f869b[_0x831f('0x38')]=qs[_0x831f('0x30')](_[_0x831f('0x39')](_0x38f2d8['query'],_0x28d4ab[_0x831f('0x30')]),_0x2f0d72);if(_0x38f2d8['query'][_0x831f('0x3a')]){_0x1f869b[_0x831f('0x38')]=_[_0x831f('0x3b')](_0x1f869b[_0x831f('0x38')],{'$or':_[_0x831f('0x2d')](_0x2f0d72,function(_0x4ee9f5){if(_0x4ee9f5[_0x831f('0x2a')]!==_0x831f('0x3c')){var _0x433f7a={};_0x433f7a[_0x4ee9f5[_0x831f('0x26')]]={'$like':'%'+_0x38f2d8[_0x831f('0x2e')][_0x831f('0x3a')]+'%'};return _0x433f7a;}})});}_0x1f869b=_[_0x831f('0x3b')]({},_0x1f869b,_0x38f2d8[_0x831f('0x3d')]);var _0xd0d1ae={'where':_0x1f869b[_0x831f('0x38')]};return db[_0x831f('0x28')][_0x831f('0x3e')](_0xd0d1ae)['then'](function(_0x13ddf1){_0x132f1f[_0x831f('0x3e')]=_0x13ddf1;if(_0x38f2d8[_0x831f('0x2e')][_0x831f('0x3f')]){_0x1f869b['include']=[{'all':!![]}];}return db[_0x831f('0x28')][_0x831f('0x40')](_0x1f869b);})['then'](function(_0x37f2e9){_0x132f1f['rows']=_0x37f2e9;return _0x132f1f;})['then'](respondWithFilteredResult(_0x32e743,_0x1f869b))[_0x831f('0x1b')](handleError(_0x32e743,null));};exports[_0x831f('0x41')]=function(_0x1586c2,_0x487cde){var _0x57c9e0={'raw':!![],'where':{'id':_0x1586c2[_0x831f('0x42')]['id']}},_0x365198={};_0x365198[_0x831f('0x2c')]=_[_0x831f('0x2f')](db['MailMessage']['rawAttributes']);_0x365198['query']=_[_0x831f('0x2f')](_0x1586c2[_0x831f('0x2e')]);_0x365198[_0x831f('0x30')]=_[_0x831f('0x31')](_0x365198[_0x831f('0x2c')],_0x365198[_0x831f('0x2e')]);_0x57c9e0[_0x831f('0x32')]=_[_0x831f('0x31')](_0x365198[_0x831f('0x2c')],qs['fields'](_0x1586c2[_0x831f('0x2e')]['fields']));_0x57c9e0['attributes']=_0x57c9e0[_0x831f('0x32')]['length']?_0x57c9e0[_0x831f('0x32')]:_0x365198[_0x831f('0x2c')];if(_0x1586c2['query'][_0x831f('0x3f')]){_0x57c9e0['include']=[{'all':!![]}];}_0x57c9e0=_[_0x831f('0x3b')]({},_0x57c9e0,_0x1586c2[_0x831f('0x3d')]);return db[_0x831f('0x28')][_0x831f('0x43')](_0x57c9e0)[_0x831f('0x14')](handleEntityNotFound(_0x487cde,null))[_0x831f('0x14')](respondWithResult(_0x487cde,null))[_0x831f('0x1b')](handleError(_0x487cde,null));};exports['update']=function(_0x4b9622,_0xc40ef4){if(_0x4b9622[_0x831f('0x44')]['id']){delete _0x4b9622[_0x831f('0x44')]['id'];}return db[_0x831f('0x28')][_0x831f('0x43')]({'where':{'id':_0x4b9622[_0x831f('0x42')]['id']}})['then'](handleEntityNotFound(_0xc40ef4,null))[_0x831f('0x14')](saveUpdates(_0x4b9622[_0x831f('0x44')],null))['then'](respondWithResult(_0xc40ef4,null))[_0x831f('0x1b')](handleError(_0xc40ef4,null));};exports['destroy']=function(_0x1372fb,_0x375843){return db[_0x831f('0x28')][_0x831f('0x43')]({'where':{'id':_0x1372fb[_0x831f('0x42')]['id']}})['then'](handleEntityNotFound(_0x375843,null))[_0x831f('0x14')](removeEntity(_0x375843,null))[_0x831f('0x1b')](handleError(_0x375843,null));};exports[_0x831f('0x45')]=function(_0x362439,_0x45778d){return db['MailMessage'][_0x831f('0x45')]()['then'](respondWithResult(_0x45778d,null))[_0x831f('0x1b')](handleError(_0x45778d,null));};exports[_0x831f('0x46')]=function(_0x45ce27,_0x478218){return db[_0x831f('0x28')][_0x831f('0x46')](_0x45ce27[_0x831f('0x44')])[_0x831f('0x14')](function(_0xb96b2c){if(_0xb96b2c){if(_0xb96b2c[_0x831f('0x47')]===_0x831f('0x48')&&!_0xb96b2c[_0x831f('0x49')]){var _0x1c8de2,_0x5252b5,_0x513e3f;if(_0x45ce27[_0x831f('0x44')]['to']){_0x5252b5=_0x45ce27[_0x831f('0x44')]['to'][_0x831f('0x4a')](',')[0x0];}return db[_0x831f('0x4b')]['findOne']({'where':{'id':_0xb96b2c[_0x831f('0x4c')]},'include':[{'model':db[_0x831f('0x4d')],'as':_0x831f('0x4e'),'include':[{'model':db[_0x831f('0x4f')],'as':_0x831f('0x50'),'where':{'email':_0x5252b5},'limit':0x1,'order':[[_0x831f('0x51'),'DESC']]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x831f('0x52'),'raw':!![]}]}]})[_0x831f('0x14')](function(_0x34e64f){_0x1c8de2=_0x34e64f;if(!_0x1c8de2||!_0x1c8de2[_0x831f('0x53')])return;var _0x23e8ea=_0x1c8de2[_0x831f('0x54')]();if(_0x45ce27[_0x831f('0x44')][_0x831f('0x55')]&&_0x45ce27[_0x831f('0x44')]['attachments']['length']){for(var _0x4def2c=0x0;_0x4def2c<_0x45ce27[_0x831f('0x44')][_0x831f('0x55')][_0x831f('0x34')];_0x4def2c+=0x1){_0x45ce27['body'][_0x831f('0x55')][_0x4def2c]={'filename':_0x45ce27[_0x831f('0x44')]['attachments'][_0x4def2c][_0x831f('0x26')],'path':path[_0x831f('0x56')](config['root'],_0x831f('0x57'),_0x45ce27[_0x831f('0x44')][_0x831f('0x55')][_0x4def2c][_0x831f('0x58')])};}}_0x513e3f={'account':_0x23e8ea,'message':_0x45ce27[_0x831f('0x44')]};return;})['then'](function(){if(_0x1c8de2[_0x831f('0x4e')]){if(_0x1c8de2[_0x831f('0x4e')][_0x831f('0x50')][_0x831f('0x34')]){return _0x1c8de2[_0x831f('0x4e')]['Contacts'][0x0];}else{return db[_0x831f('0x4f')][_0x831f('0x46')](_[_0x831f('0xa')](_0x45ce27['body'],{'firstName':_0x45ce27[_0x831f('0x44')]['to'],'email':_0x45ce27[_0x831f('0x44')]['to'],'phone':_0x45ce27[_0x831f('0x44')]['to'],'ListId':_0x1c8de2['ListId']}));}}else{throw new Error(_0x831f('0x59'));}})[_0x831f('0x14')](function(){if(_0x513e3f){return respondWithRpcPromise('SendMail',_0x831f('0x5a'),_0x513e3f,client9003)[_0x831f('0x14')](function(_0xec1966){return _0xb96b2c[_0x831f('0x22')]({'read':!![],'messageId':_0xec1966[_0x831f('0x5b')],'sentAt':moment()[_0x831f('0x5c')](_0x831f('0x5d'))});})[_0x831f('0x1b')](function(_0x14502a){logger[_0x831f('0x18')]('%s',JSON[_0x831f('0x5e')](_0x14502a));return _0xb96b2c;});}return _0xb96b2c;});}return _0xb96b2c;}})[_0x831f('0x14')](respondWithResult(_0x478218,0xc9))['catch'](handleError(_0x478218,null));};exports[_0x831f('0x5f')]=function(_0x34f781,_0x1229d4){var _0x16ed67={'agent':{},'channel':_0x831f('0x60')};if(_0x34f781['body']['id']){delete _0x34f781[_0x831f('0x44')]['id'];}_0x34f781[_0x831f('0x44')][_0x831f('0x61')]=!![];_0x34f781[_0x831f('0x44')][_0x831f('0x62')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x34f781['body'][_0x831f('0x63')]=_0x34f781[_0x831f('0x44')]['UserId']||_0x34f781[_0x831f('0x64')]['id'];_0x16ed67['agent']['id']=_0x34f781[_0x831f('0x44')][_0x831f('0x63')];return db[_0x831f('0x28')][_0x831f('0x43')]({'where':{'id':_0x34f781[_0x831f('0x42')]['id'],'UserId':null}})[_0x831f('0x14')](handleEntityNotFound(_0x1229d4,null))[_0x831f('0x14')](saveUpdates(_0x34f781[_0x831f('0x44')],null))['then'](function(_0x519845){if(_0x519845){_0x16ed67[_0x831f('0x19')]=_0x519845[_0x831f('0x65')]({'plain':!![]});return db[_0x831f('0x66')][_0x831f('0x43')]({'where':{'id':_0x519845[_0x831f('0x67')]}});}return null;})[_0x831f('0x14')](handleEntityNotFound(_0x1229d4,null))[_0x831f('0x14')](function(_0x3ad555){if(_0x3ad555){return _0x3ad555[_0x831f('0x22')]({'UserId':_0x34f781['body'][_0x831f('0x63')],'read1stAt':_[_0x831f('0x68')](_0x3ad555[_0x831f('0x69')])?moment()[_0x831f('0x5c')](_0x831f('0x5d')):undefined});}return null;})[_0x831f('0x14')](function(_0x28ea4c){if(_0x28ea4c){_0x16ed67[_0x831f('0x6a')]=_0x28ea4c[_0x831f('0x65')]({'plain':!![]});interaction_log[_0x831f('0x6b')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x34f781[_0x831f('0x64')]['id'],_0x34f781[_0x831f('0x64')][_0x831f('0x26')],_0x34f781[_0x831f('0x64')][_0x831f('0x6c')],_0x16ed67['interaction']['id'],_0x34f781[_0x831f('0x44')]?JSON[_0x831f('0x5e')](_0x34f781[_0x831f('0x44')]):_0x831f('0x6d'));return respondWithRpcPromise(_0x831f('0x6e'),_0x831f('0x6f'),_0x16ed67);}return null;})[_0x831f('0x14')](function(_0x4eca90){var _0x85547e=_0x831f('0x70')+_0x4eca90['message'][_0x831f('0x71')];return db[_0x831f('0x72')][_0x831f('0x2e')](_0x85547e,{'type':db[_0x831f('0x73')][_0x831f('0x74')][_0x831f('0x75')],'raw':!![]})[_0x831f('0x14')](function(_0x5eb230){return _0x5eb230;});})[_0x831f('0x14')](function(_0x1e15a2){if(_0x1e15a2){_0x16ed67[_0x831f('0x19')]['contact']=_0x1e15a2[0x0];if(!_0x34f781[_0x831f('0x44')][_0x831f('0x63')])return;return db[_0x831f('0x76')][_0x831f('0x43')]({'where':{'id':_0x34f781[_0x831f('0x44')][_0x831f('0x63')],'role':_0x831f('0x77')},'attributes':['id',_0x831f('0x26'),_0x831f('0x78'),_0x831f('0x79'),_0x831f('0x7a')],'raw':!![]});}return null;})[_0x831f('0x14')](function(_0x105dcc){if(!_0x105dcc)return null;_0x16ed67[_0x831f('0x19')][_0x831f('0x77')]=_0x105dcc;return _0x16ed67;})[_0x831f('0x14')](function(_0x4a747f){if(_0x4a747f){if(_0x34f781['body'][_0x831f('0x7b')]){_0x16ed67[_0x831f('0x19')][_0x831f('0x7c')]=util['format'](_0x831f('0x7d'),_0x34f781[_0x831f('0x64')][_0x831f('0x26')]);_0x16ed67[_0x831f('0x19')][_0x831f('0x7e')]=_0x16ed67[_0x831f('0x7e')];_0x16ed67['message'][_0x831f('0x7f')]=_0x16ed67[_0x831f('0x7e')];_0x16ed67[_0x831f('0x19')][_0x831f('0x80')]=_0x831f('0x5f');_0x16ed67['message'][_0x831f('0x44')]=htmlToText[_0x831f('0x81')](_0x16ed67['message'][_0x831f('0x44')]);return respondWithRpcPromise(_0x831f('0x82'),'EventManager',{'event':_0x831f('0x83'),'message':_0x16ed67['message']},client9002)[_0x831f('0x14')](function(){return _0x16ed67;});}return _0x16ed67;}return null;})['then'](respondWithResult(_0x1229d4,null))['catch'](handleError(_0x1229d4,null));};exports['reject']=function(_0x1ac80c,_0x25011d){var _0x55bcda={'agent':{},'channel':_0x831f('0x60')};if(_0x1ac80c[_0x831f('0x44')]['id']){delete _0x1ac80c['body']['id'];}_0x1ac80c[_0x831f('0x44')][_0x831f('0x63')]=_0x1ac80c[_0x831f('0x44')][_0x831f('0x63')]||_0x1ac80c['user']['id'];_0x55bcda[_0x831f('0x77')]['id']=_0x1ac80c[_0x831f('0x44')][_0x831f('0x63')];return db[_0x831f('0x28')][_0x831f('0x43')]({'where':{'id':_0x1ac80c[_0x831f('0x42')]['id'],'UserId':null}})[_0x831f('0x14')](handleEntityNotFound(_0x25011d,null))[_0x831f('0x14')](function(_0x4602c3){if(_0x4602c3){_0x55bcda[_0x831f('0x19')]=_0x4602c3[_0x831f('0x65')]({'plain':!![]});return db[_0x831f('0x66')][_0x831f('0x43')]({'where':{'id':_0x4602c3[_0x831f('0x67')]}});}return null;})[_0x831f('0x14')](handleEntityNotFound(_0x25011d,null))['then'](function(_0x5c8247){if(_0x5c8247){_0x55bcda[_0x831f('0x6a')]=_0x5c8247[_0x831f('0x65')]({'plain':!![]});interaction_log[_0x831f('0x6b')](_0x831f('0x84'),_0x1ac80c[_0x831f('0x64')]['id'],_0x1ac80c['user'][_0x831f('0x26')],_0x1ac80c[_0x831f('0x64')][_0x831f('0x6c')],_0x55bcda[_0x831f('0x6a')]['id'],_0x1ac80c[_0x831f('0x44')]?JSON[_0x831f('0x5e')](_0x1ac80c[_0x831f('0x44')]):_0x831f('0x6d'));return respondWithRpcPromise(_0x831f('0x85'),_0x831f('0x86'),_0x55bcda);}return null;})['then'](function(_0x3df2a3){var _0x408e1d=_0x831f('0x70')+_0x3df2a3['message'][_0x831f('0x71')];return db[_0x831f('0x72')][_0x831f('0x2e')](_0x408e1d,{'type':db[_0x831f('0x73')]['QueryTypes'][_0x831f('0x75')],'raw':!![]})[_0x831f('0x14')](function(_0x3c4fea){return _0x3c4fea;});})[_0x831f('0x14')](function(_0x28a1e5){if(_0x28a1e5){_0x55bcda[_0x831f('0x19')][_0x831f('0x87')]=_0x28a1e5[0x0];if(!_0x1ac80c['body'][_0x831f('0x63')])return;return db[_0x831f('0x76')][_0x831f('0x43')]({'where':{'id':_0x1ac80c[_0x831f('0x44')][_0x831f('0x63')],'role':_0x831f('0x77')},'attributes':['id',_0x831f('0x26'),'fullname',_0x831f('0x79'),_0x831f('0x7a')],'raw':!![]});}return null;})[_0x831f('0x14')](function(_0x1d1d82){if(!_0x1d1d82)return null;_0x55bcda['message'][_0x831f('0x77')]=_0x1d1d82;return _0x55bcda;})[_0x831f('0x14')](function(_0x510686){if(_0x510686){_0x510686[_0x831f('0x19')]['interface']=util['format'](_0x831f('0x7d'),_0x1ac80c[_0x831f('0x64')]['name']);_0x510686[_0x831f('0x19')][_0x831f('0x7e')]=_0x55bcda[_0x831f('0x7e')];_0x510686[_0x831f('0x19')][_0x831f('0x7f')]=_0x55bcda['channel'];_0x510686[_0x831f('0x19')][_0x831f('0x80')]=_0x831f('0x88');_0x510686[_0x831f('0x19')]['body']=htmlToText[_0x831f('0x81')](_0x55bcda[_0x831f('0x19')]['body']);respondWithRpcPromise(_0x831f('0x82'),'EventManager',{'event':_0x831f('0x89'),'message':_0x510686[_0x831f('0x19')]},client9002);return _0x55bcda;}return null;})['then'](respondWithResult(_0x25011d,null))[_0x831f('0x1b')](handleError(_0x25011d,null));};exports['download']=function(_0x34acf2,_0x17f9be){var _0x1179a8=moment()[_0x831f('0x8a')]()[_0x831f('0x8b')]();var _0x15a0e3=path[_0x831f('0x56')](config[_0x831f('0x8c')],_0x831f('0x8d'),_0x831f('0x8e'),_0x831f('0x8f'));var _0x39d043=path[_0x831f('0x56')](config[_0x831f('0x8c')],_0x831f('0x8d'),'files',_0x831f('0x55'));var _0x44a9ef=util[_0x831f('0x5c')](_0x831f('0x90'),_0x1179a8);return db[_0x831f('0x28')][_0x831f('0x43')]({'where':{'id':_0x34acf2[_0x831f('0x42')]['id']},'attributes':['id',_0x831f('0x44'),'from','to','cc',_0x831f('0x91'),_0x831f('0x92'),_0x831f('0x93')],'include':_0x34acf2[_0x831f('0x2e')]['attachments']?[{'model':db['Attachment'],'as':_0x831f('0x94')}]:undefined})[_0x831f('0x14')](handleEntityNotFound(_0x17f9be,null))[_0x831f('0x14')](function(_0x2b9c28){if(_0x2b9c28){var _0x8920fa=_0x2b9c28;var _0x27df64={'from':_0x8920fa['from'],'to':_0x8920fa['to'],'subject':_0x8920fa[_0x831f('0x92')],'html':htmlEntities['decode'](_0x8920fa['body']),'headers':{'Date':moment(_0x8920fa['createdAt'])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x2b9c28['cc']){_0x27df64[_0x831f('0x95')]['Cc']=_0x2b9c28['cc'];}if(_0x2b9c28[_0x831f('0x91')]){_0x27df64['headers'][_0x831f('0x96')]=_0x2b9c28[_0x831f('0x91')];}return new BPromise(function(_0x4b6056,_0x355238){if(_0x2b9c28[_0x831f('0x94')]){for(var _0x4467d7=0x0;_0x4467d7<_0x2b9c28['Attachments'][_0x831f('0x34')];_0x4467d7++){var _0x3471ec=_0x2b9c28[_0x831f('0x94')][_0x4467d7];var _0x316d60=path[_0x831f('0x56')](_0x39d043,_0x3471ec['basename']);if(fs['existsSync'](_0x316d60)){_0x27df64[_0x831f('0x55')][_0x831f('0x97')]({'name':_0x3471ec['name'],'contentType':_0x3471ec[_0x831f('0x2a')],'data':fs[_0x831f('0x98')](_0x316d60)});}}}emlformat['build'](_0x27df64,function(_0x1a6b60,_0x484562){if(_0x1a6b60)return _0x355238(_0x1a6b60);fs[_0x831f('0x99')](path[_0x831f('0x56')](_0x15a0e3,_0x44a9ef),_0x484562);return _0x4b6056(_0x484562);});});}})['then'](function(_0x5c6a77){if(_0x5c6a77){return _0x17f9be[_0x831f('0x9a')](path[_0x831f('0x56')](_0x15a0e3,_0x44a9ef),_0x44a9ef,function(_0xad019f){if(!_0xad019f)fs[_0x831f('0x9b')](path[_0x831f('0x56')](_0x15a0e3,_0x44a9ef));});}})[_0x831f('0x1b')](handleError(_0x17f9be,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 0bd010e..bf80bac 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 _0xd65e=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2497a9,_0x682249){var _0x19a2e9=function(_0x42955f){while(--_0x42955f){_0x2497a9['push'](_0x2497a9['shift']());}};_0x19a2e9(++_0x682249);}(_0xd65e,0x15f));var _0xed65=function(_0x53348c,_0x2a725d){_0x53348c=_0x53348c-0x0;var _0x45cdb4=_0xd65e[_0x53348c];return _0x45cdb4;};'use strict';var EventEmitter=require(_0xed65('0x0'));var MailMessage=require(_0xed65('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xed65('0x2')](0x0);var events={'afterCreate':_0xed65('0x3'),'afterUpdate':'update','afterDestroy':_0xed65('0x4')};function emitEvent(_0x416128){return function(_0x34ed9b,_0x33965a,_0x1a077b){MailMessageEvents[_0xed65('0x5')](_0x416128+':'+_0x34ed9b['id'],_0x34ed9b);MailMessageEvents[_0xed65('0x5')](_0x416128,_0x34ed9b);_0x1a077b(null);};}for(var e in events){if(events[_0xed65('0x6')](e)){var event=events[e];MailMessage[_0xed65('0x7')](e,emitEvent(event));}}module[_0xed65('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x75e8=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x2f4e8a,_0x114fd8){var _0x45eb5e=function(_0x209f28){while(--_0x209f28){_0x2f4e8a['push'](_0x2f4e8a['shift']());}};_0x45eb5e(++_0x114fd8);}(_0x75e8,0xff));var _0x875e=function(_0x3ffc55,_0x46e18f){_0x3ffc55=_0x3ffc55-0x0;var _0x1f8a93=_0x75e8[_0x3ffc55];return _0x1f8a93;};'use strict';var EventEmitter=require(_0x875e('0x0'));var MailMessage=require(_0x875e('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x875e('0x2')](0x0);var events={'afterCreate':_0x875e('0x3'),'afterUpdate':'update','afterDestroy':_0x875e('0x4')};function emitEvent(_0x13362e){return function(_0x47707b,_0x19dfc3,_0x5a338e){MailMessageEvents['emit'](_0x13362e+':'+_0x47707b['id'],_0x47707b);MailMessageEvents[_0x875e('0x5')](_0x13362e,_0x47707b);_0x5a338e(null);};}for(var e in events){if(events[_0x875e('0x6')](e)){var event=events[e];MailMessage[_0x875e('0x7')](e,emitEvent(event));}}module[_0x875e('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 5ffbeab..445b6e4 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 _0x7b11=['subject','body','fromString','models','get','direction','toLowerCase','secret','isNil','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes','exports','messageId','fti_mail_messages','plainBody'];(function(_0x3b9d5f,_0x2e9039){var _0x39924e=function(_0x5752ee){while(--_0x5752ee){_0x3b9d5f['push'](_0x3b9d5f['shift']());}};_0x39924e(++_0x2e9039);}(_0x7b11,0x6e));var _0x17b1=function(_0x465740,_0x2b33df){_0x465740=_0x465740-0x0;var _0xee6a3e=_0x7b11[_0x465740];return _0xee6a3e;};'use strict';var _=require('lodash');var util=require(_0x17b1('0x0'));var logger=require(_0x17b1('0x1'))(_0x17b1('0x2'));var moment=require(_0x17b1('0x3'));var BPromise=require(_0x17b1('0x4'));var rp=require(_0x17b1('0x5'));var htmlToText=require(_0x17b1('0x6'));var fs=require('fs');var path=require(_0x17b1('0x7'));var rimraf=require('rimraf');var config=require(_0x17b1('0x8'));var attributes=require(_0x17b1('0x9'));module[_0x17b1('0xa')]=function(_0x1ae055,_0x1eef24){return _0x1ae055['define']('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x17b1('0xb'),'fields':[_0x17b1('0xb')]},{'name':_0x17b1('0xc'),'fields':[_0x17b1('0xd'),_0x17b1('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xbdce5b,_0x5ca330,_0x4e2154){if(_0xbdce5b[_0x17b1('0xf')]){_0xbdce5b[_0x17b1('0xd')]=htmlToText[_0x17b1('0x10')](_0xbdce5b['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4e2154(null,_0x5ca330);},'afterCreate':function(_0x30eacf,_0x552c73,_0x4a20b8){var _0x523d01=_0x1ae055[_0x17b1('0x11')];var _0x29db0d=_0x30eacf[_0x17b1('0x12')]({'plain':!![]});if(_0x29db0d[_0x17b1('0x13')][_0x17b1('0x14')]()==='in'||_0x29db0d[_0x17b1('0x13')][_0x17b1('0x14')]()==='out'&&!_0x29db0d[_0x17b1('0x15')]&&!_[_0x17b1('0x16')](_0x29db0d['UserId'])){_0x523d01[_0x17b1('0x17')][_0x17b1('0x18')]({'where':{'id':_0x29db0d[_0x17b1('0x19')]}})[_0x17b1('0x1a')](function(_0x32f039){if(_0x32f039){_0x32f039[_0x17b1('0x1b')]({'lastMsgAt':_0x29db0d[_0x17b1('0x1c')],'lastMsgDirection':_0x29db0d[_0x17b1('0x13')]['toLowerCase']()});}})[_0x17b1('0x1d')](function(_0xf88e2e){console[_0x17b1('0x1e')](_0xf88e2e);});}_0x4a20b8();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x47fd=['toLowerCase','out','secret','UserId','MailInteraction','findOne','MailInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','body','plainBody','fromString','models','get','direction'];(function(_0x5932b3,_0x20e226){var _0x8168ac=function(_0x120c5f){while(--_0x120c5f){_0x5932b3['push'](_0x5932b3['shift']());}};_0x8168ac(++_0x20e226);}(_0x47fd,0xe5));var _0xd47f=function(_0x2a6596,_0x8eb727){_0x2a6596=_0x2a6596-0x0;var _0x5778bb=_0x47fd[_0x2a6596];return _0x5778bb;};'use strict';var _=require(_0xd47f('0x0'));var util=require(_0xd47f('0x1'));var logger=require(_0xd47f('0x2'))('api');var moment=require(_0xd47f('0x3'));var BPromise=require('bluebird');var rp=require(_0xd47f('0x4'));var htmlToText=require(_0xd47f('0x5'));var fs=require('fs');var path=require(_0xd47f('0x6'));var rimraf=require('rimraf');var config=require(_0xd47f('0x7'));var attributes=require(_0xd47f('0x8'));module[_0xd47f('0x9')]=function(_0x53a11b,_0xc68be){return _0x53a11b[_0xd47f('0xa')](_0xd47f('0xb'),attributes,{'tableName':_0xd47f('0xc'),'paranoid':![],'indexes':[{'name':_0xd47f('0xd'),'fields':[_0xd47f('0xd')]},{'name':_0xd47f('0xe'),'fields':['plainBody',_0xd47f('0xf')],'type':_0xd47f('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x147135,_0x218653,_0x8b3901){if(_0x147135[_0xd47f('0x11')]){_0x147135[_0xd47f('0x12')]=htmlToText[_0xd47f('0x13')](_0x147135[_0xd47f('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x8b3901(null,_0x218653);},'afterCreate':function(_0xdac25b,_0x52c2d1,_0x100109){var _0x451fbc=_0x53a11b[_0xd47f('0x14')];var _0x2d30cc=_0xdac25b[_0xd47f('0x15')]({'plain':!![]});if(_0x2d30cc[_0xd47f('0x16')][_0xd47f('0x17')]()==='in'||_0x2d30cc[_0xd47f('0x16')]['toLowerCase']()===_0xd47f('0x18')&&!_0x2d30cc[_0xd47f('0x19')]&&!_['isNil'](_0x2d30cc[_0xd47f('0x1a')])){_0x451fbc[_0xd47f('0x1b')][_0xd47f('0x1c')]({'where':{'id':_0x2d30cc[_0xd47f('0x1d')]}})['then'](function(_0x19143e){if(_0x19143e){_0x19143e[_0xd47f('0x1e')]({'lastMsgAt':_0x2d30cc[_0xd47f('0x1f')],'lastMsgDirection':_0x2d30cc[_0xd47f('0x16')][_0xd47f('0x17')]()});}})[_0xd47f('0x20')](function(_0x5831ba){console[_0xd47f('0x21')](_0x5831ba);});}_0x100109();}},'charset':_0xd47f('0x22'),'collate':_0xd47f('0x23')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 61b31c4..72de3de 100644 --- a/server/api/mailMessage/mailMessage.rpc.js +++ b/server/api/mailMessage/mailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd4f4=['CreateMailMessage','create','body','options','raw','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x87620d,_0x15d8b8){var _0x12f8a1=function(_0x4e37a6){while(--_0x4e37a6){_0x87620d['push'](_0x87620d['shift']());}};_0x12f8a1(++_0x15d8b8);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x190cc4,_0x5ba234){_0x190cc4=_0x190cc4-0x0;var _0x1cce5c=_0xd4f4[_0x190cc4];return _0x1cce5c;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var moment=require(_0x4d4f('0x2'));var BPromise=require(_0x4d4f('0x3'));var rs=require(_0x4d4f('0x4'));var fs=require('fs');var Redis=require(_0x4d4f('0x5'));var db=require(_0x4d4f('0x6'))['db'];var utils=require(_0x4d4f('0x7'));var logger=require(_0x4d4f('0x8'))(_0x4d4f('0x9'));var config=require(_0x4d4f('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x4d4f('0xb')]=_[_0x4d4f('0xc')](config[_0x4d4f('0xb')],{'host':_0x4d4f('0xd'),'port':0x18eb});var socket=require(_0x4d4f('0xe'))(new Redis(config[_0x4d4f('0xb')]));require(_0x4d4f('0xf'))[_0x4d4f('0x10')](socket);function respondWithRpcPromise(_0x385597,_0xba5200,_0x20db50){return new BPromise(function(_0x88b592,_0x128d39){return client[_0x4d4f('0x11')](_0x385597,_0x20db50)[_0x4d4f('0x12')](function(_0x28fb3e){logger[_0x4d4f('0x13')](_0x4d4f('0x14'),_0xba5200,'request\x20sent');logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0xba5200,_0x4d4f('0x15'),JSON[_0x4d4f('0x16')](_0x28fb3e));if(_0x28fb3e['error']){if(_0x28fb3e[_0x4d4f('0x17')][_0x4d4f('0x18')]===0x1f4){logger[_0x4d4f('0x17')]('MailMessage,\x20%s,\x20%s',_0xba5200,_0x28fb3e[_0x4d4f('0x17')][_0x4d4f('0x19')]);return _0x128d39(_0x28fb3e[_0x4d4f('0x17')]['message']);}logger[_0x4d4f('0x17')]('MailMessage,\x20%s,\x20%s',_0xba5200,_0x28fb3e[_0x4d4f('0x17')][_0x4d4f('0x19')]);return _0x88b592(_0x28fb3e[_0x4d4f('0x17')]['message']);}else{logger[_0x4d4f('0x13')](_0x4d4f('0x14'),_0xba5200,'request\x20sent');_0x88b592(_0x28fb3e['result']['message']);}})['catch'](function(_0x5eebec){logger[_0x4d4f('0x17')](_0x4d4f('0x14'),_0xba5200,_0x5eebec);_0x128d39(_0x5eebec);});});}exports[_0x4d4f('0x1a')]=function(_0x3566a5){var _0x5d7b1f=this;return new Promise(function(_0x5b2863,_0x1e1ae2){return db['MailMessage'][_0x4d4f('0x1b')](_0x3566a5[_0x4d4f('0x1c')],{'raw':_0x3566a5[_0x4d4f('0x1d')]?_0x3566a5[_0x4d4f('0x1d')][_0x4d4f('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x570520){logger[_0x4d4f('0x13')]('CreateMailMessage',_0x3566a5);logger[_0x4d4f('0x1f')](_0x4d4f('0x1a'),_0x3566a5,JSON[_0x4d4f('0x16')](_0x570520));_0x5b2863(_0x570520);})[_0x4d4f('0x20')](function(_0xf3f7a4){logger['error'](_0x4d4f('0x1a'),_0xf3f7a4[_0x4d4f('0x19')],_0x3566a5);_0x1e1ae2(_0x5d7b1f[_0x4d4f('0x17')](0x1f4,_0xf3f7a4[_0x4d4f('0x19')]));});});}; \ No newline at end of file +var _0x8603=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','./mailMessage.socket','register','request','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','catch','CreateMailMessage','MailMessage','create','body','options','raw','then','util','moment','bluebird'];(function(_0x4b3aed,_0x36baba){var _0x5cf88b=function(_0x58da6e){while(--_0x58da6e){_0x4b3aed['push'](_0x4b3aed['shift']());}};_0x5cf88b(++_0x36baba);}(_0x8603,0x190));var _0x3860=function(_0x1690f9,_0x2a9858){_0x1690f9=_0x1690f9-0x0;var _0x460e19=_0x8603[_0x1690f9];return _0x460e19;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var moment=require(_0x3860('0x1'));var BPromise=require(_0x3860('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3860('0x3'))['db'];var utils=require(_0x3860('0x4'));var logger=require(_0x3860('0x5'))('rpc');var config=require(_0x3860('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3860('0x7')][_0x3860('0x8')]({'port':0x232a});config[_0x3860('0x9')]=_[_0x3860('0xa')](config[_0x3860('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3860('0xb'))[_0x3860('0xc')](socket);function respondWithRpcPromise(_0x52c277,_0x2fb169,_0x38737e){return new BPromise(function(_0x5909b8,_0x101263){return client[_0x3860('0xd')](_0x52c277,_0x38737e)['then'](function(_0x365579){logger[_0x3860('0xe')]('MailMessage,\x20%s,\x20%s',_0x2fb169,_0x3860('0xf'));logger[_0x3860('0x10')](_0x3860('0x11'),_0x2fb169,_0x3860('0xf'),JSON[_0x3860('0x12')](_0x365579));if(_0x365579[_0x3860('0x13')]){if(_0x365579[_0x3860('0x13')][_0x3860('0x14')]===0x1f4){logger[_0x3860('0x13')](_0x3860('0x15'),_0x2fb169,_0x365579['error'][_0x3860('0x16')]);return _0x101263(_0x365579[_0x3860('0x13')][_0x3860('0x16')]);}logger[_0x3860('0x13')](_0x3860('0x15'),_0x2fb169,_0x365579[_0x3860('0x13')][_0x3860('0x16')]);return _0x5909b8(_0x365579[_0x3860('0x13')][_0x3860('0x16')]);}else{logger[_0x3860('0xe')](_0x3860('0x15'),_0x2fb169,_0x3860('0xf'));_0x5909b8(_0x365579['result']['message']);}})[_0x3860('0x17')](function(_0x41ce59){logger[_0x3860('0x13')]('MailMessage,\x20%s,\x20%s',_0x2fb169,_0x41ce59);_0x101263(_0x41ce59);});});}exports[_0x3860('0x18')]=function(_0x145b26){var _0x22e873=this;return new Promise(function(_0x3af33a,_0x20a5b0){return db[_0x3860('0x19')][_0x3860('0x1a')](_0x145b26[_0x3860('0x1b')],{'raw':_0x145b26[_0x3860('0x1c')]?_0x145b26[_0x3860('0x1c')][_0x3860('0x1d')]===undefined?!![]:![]:!![]})[_0x3860('0x1e')](function(_0x280ea9){logger[_0x3860('0xe')](_0x3860('0x18'),_0x145b26);logger['debug'](_0x3860('0x18'),_0x145b26,JSON[_0x3860('0x12')](_0x280ea9));_0x3af33a(_0x280ea9);})[_0x3860('0x17')](function(_0x301e03){logger[_0x3860('0x13')]('CreateMailMessage',_0x301e03[_0x3860('0x16')],_0x145b26);_0x20a5b0(_0x22e873['error'](0x1f4,_0x301e03['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 876f2aa..efd9042 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 _0x5dd6=['./mailMessage.events','update','emit','removeListener','mailMessage:'];(function(_0x1f97e8,_0x445a4a){var _0x1ed77c=function(_0x1c990d){while(--_0x1c990d){_0x1f97e8['push'](_0x1f97e8['shift']());}};_0x1ed77c(++_0x445a4a);}(_0x5dd6,0x140));var _0x65dd=function(_0x56b540,_0x37f450){_0x56b540=_0x56b540-0x0;var _0xf62ffc=_0x5dd6[_0x56b540];return _0xf62ffc;};'use strict';var MailMessageEvents=require(_0x65dd('0x0'));var events=['save','remove',_0x65dd('0x1')];function createListener(_0x14f7c1,_0x5b2d39){return function(_0x256276){_0x5b2d39[_0x65dd('0x2')](_0x14f7c1,_0x256276);};}function removeListener(_0x3e0a98,_0x23d754){return function(){MailMessageEvents[_0x65dd('0x3')](_0x3e0a98,_0x23d754);};}exports['register']=function(_0x5b4580){for(var _0x3317e2=0x0,_0x6b180f=events['length'];_0x3317e2<_0x6b180f;_0x3317e2++){var _0x5cf2a6=events[_0x3317e2];var _0x45cec0=createListener(_0x65dd('0x4')+_0x5cf2a6,_0x5b4580);MailMessageEvents['on'](_0x5cf2a6,_0x45cec0);}}; \ No newline at end of file +var _0xb717=['removeListener','register','length','mailMessage:','./mailMessage.events','remove'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xb717,0x1b4));var _0x7b71=function(_0x334bc7,_0x45c813){_0x334bc7=_0x334bc7-0x0;var _0x433e15=_0xb717[_0x334bc7];return _0x433e15;};'use strict';var MailMessageEvents=require(_0x7b71('0x0'));var events=['save',_0x7b71('0x1'),'update'];function createListener(_0x42a694,_0xf3e061){return function(_0x42d36c){_0xf3e061['emit'](_0x42a694,_0x42d36c);};}function removeListener(_0x238319,_0x2e583f){return function(){MailMessageEvents[_0x7b71('0x2')](_0x238319,_0x2e583f);};}exports[_0x7b71('0x3')]=function(_0x3d3643){for(var _0x593c15=0x0,_0x217efe=events[_0x7b71('0x4')];_0x593c15<_0x217efe;_0x593c15++){var _0xd81a5c=events[_0x593c15];var _0x4238f6=createListener(_0x7b71('0x5')+_0xd81a5c,_0x3d3643);MailMessageEvents['on'](_0xd81a5c,_0x4238f6);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 3e18c31..a2f6ffb 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 _0xce37=['removeTeams','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addAgents','put','update','delete'];(function(_0x5c8871,_0x275ce9){var _0x4a505d=function(_0x48ec7b){while(--_0x48ec7b){_0x5c8871['push'](_0x5c8871['shift']());}};_0x4a505d(++_0x275ce9);}(_0xce37,0x8e));var _0x7ce3=function(_0x58cdfa,_0x4a0ac2){_0x58cdfa=_0x58cdfa-0x0;var _0x3139a6=_0xce37[_0x58cdfa];return _0x3139a6;};'use strict';var multer=require(_0x7ce3('0x0'));var util=require(_0x7ce3('0x1'));var path=require(_0x7ce3('0x2'));var timeout=require('connect-timeout');var express=require(_0x7ce3('0x3'));var router=express[_0x7ce3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7ce3('0x5'));var interaction=require(_0x7ce3('0x6'));var config=require(_0x7ce3('0x7'));var controller=require('./mailQueue.controller');router['get']('/',auth[_0x7ce3('0x8')](),controller[_0x7ce3('0x9')]);router[_0x7ce3('0xa')](_0x7ce3('0xb'),auth[_0x7ce3('0x8')](),controller[_0x7ce3('0xc')]);router['get'](_0x7ce3('0xd'),auth[_0x7ce3('0x8')](),controller[_0x7ce3('0xe')]);router['get'](_0x7ce3('0xf'),auth[_0x7ce3('0x8')](),controller[_0x7ce3('0x10')]);router[_0x7ce3('0xa')](_0x7ce3('0x11'),auth[_0x7ce3('0x8')](),controller[_0x7ce3('0x12')]);router[_0x7ce3('0xa')](_0x7ce3('0x13'),auth[_0x7ce3('0x8')](),controller[_0x7ce3('0x14')]);router[_0x7ce3('0x15')]('/',auth[_0x7ce3('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0x7ce3('0x8')](),controller['addTeams']);router[_0x7ce3('0x15')](_0x7ce3('0x13'),auth[_0x7ce3('0x8')](),controller[_0x7ce3('0x16')]);router[_0x7ce3('0x17')](_0x7ce3('0xd'),auth[_0x7ce3('0x8')](),controller[_0x7ce3('0x18')]);router[_0x7ce3('0x19')](_0x7ce3('0xd'),auth[_0x7ce3('0x8')](),controller['destroy']);router[_0x7ce3('0x19')](_0x7ce3('0x11'),auth['isAuthenticated'](),controller[_0x7ce3('0x1a')]);router[_0x7ce3('0x19')](_0x7ce3('0x13'),auth[_0x7ce3('0x8')](),controller['removeAgents']);module[_0x7ce3('0x1b')]=router; \ No newline at end of file +var _0xf923=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout'];(function(_0x3cf56f,_0x528a41){var _0x3f6703=function(_0x3e6d44){while(--_0x3e6d44){_0x3cf56f['push'](_0x3cf56f['shift']());}};_0x3f6703(++_0x528a41);}(_0xf923,0xbc));var _0x3f92=function(_0x39f34f,_0x298f45){_0x39f34f=_0x39f34f-0x0;var _0x59fee1=_0xf923[_0x39f34f];return _0x59fee1;};'use strict';var multer=require(_0x3f92('0x0'));var util=require(_0x3f92('0x1'));var path=require(_0x3f92('0x2'));var timeout=require(_0x3f92('0x3'));var express=require(_0x3f92('0x4'));var router=express[_0x3f92('0x5')]();var fs_extra=require(_0x3f92('0x6'));var auth=require(_0x3f92('0x7'));var interaction=require(_0x3f92('0x8'));var config=require(_0x3f92('0x9'));var controller=require(_0x3f92('0xa'));router[_0x3f92('0xb')]('/',auth[_0x3f92('0xc')](),controller[_0x3f92('0xd')]);router[_0x3f92('0xb')]('/describe',auth[_0x3f92('0xc')](),controller[_0x3f92('0xe')]);router[_0x3f92('0xb')](_0x3f92('0xf'),auth[_0x3f92('0xc')](),controller[_0x3f92('0x10')]);router[_0x3f92('0xb')](_0x3f92('0x11'),auth[_0x3f92('0xc')](),controller[_0x3f92('0x12')]);router[_0x3f92('0xb')](_0x3f92('0x13'),auth[_0x3f92('0xc')](),controller[_0x3f92('0x14')]);router[_0x3f92('0xb')](_0x3f92('0x15'),auth[_0x3f92('0xc')](),controller[_0x3f92('0x16')]);router['post']('/',auth[_0x3f92('0xc')](),controller[_0x3f92('0x17')]);router[_0x3f92('0x18')](_0x3f92('0x13'),auth[_0x3f92('0xc')](),controller[_0x3f92('0x19')]);router[_0x3f92('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x3f92('0x1a')]);router[_0x3f92('0x1b')](_0x3f92('0xf'),auth[_0x3f92('0xc')](),controller[_0x3f92('0x1c')]);router[_0x3f92('0x1d')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x3f92('0x1d')](_0x3f92('0x13'),auth['isAuthenticated'](),controller[_0x3f92('0x1e')]);router[_0x3f92('0x1d')](_0x3f92('0x15'),auth[_0x3f92('0xc')](),controller[_0x3f92('0x1f')]);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 5e03a5d..c4be0a0 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 _0x2049=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING','name'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x2049,0x1cc));var _0x9204=function(_0x300334,_0x539b1e){_0x300334=_0x300334-0x0;var _0x57ff5d=_0x2049[_0x300334];return _0x57ff5d;};'use strict';var Sequelize=require(_0x9204('0x0'));module[_0x9204('0x1')]={'name':{'type':Sequelize[_0x9204('0x2')],'unique':_0x9204('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9204('0x2')]},'timeout':{'type':Sequelize[_0x9204('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9204('0x5')](_0x9204('0x6'),_0x9204('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x558e=['beepall','roundrobin','INTEGER','ENUM','rrmemory'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x558e,0x19c));var _0xe558=function(_0x4cd21c,_0x35fa45){_0x4cd21c=_0x4cd21c-0x0;var _0x5d8e5e=_0x558e[_0x4cd21c];return _0x5d8e5e;};'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[_0xe558('0x0')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe558('0x1')](_0xe558('0x2'),_0xe558('0x3'),_0xe558('0x4'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 4a60543..5f4f3fa 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 _0x404b=['limit','offset','Content-Range','save','update','then','get','MailQueues','UserProfileResource','destroy','error','name','send','index','map','type','key','keys','filters','intersection','query','attributes','model','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','MailQueue','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','userProfileId','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','nolimit','options','User','agent','mailPause','createdAt','format','SIP','updatedAt','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','findOrCreate','forEach','emit','userMailQueue:save','Team','select','field','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','transaction','ids','isEmpty','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json'];(function(_0x5a3ac7,_0xa2bf9b){var _0x11678a=function(_0x36469f){while(--_0x36469f){_0x5a3ac7['push'](_0x5a3ac7['shift']());}};_0x11678a(++_0xa2bf9b);}(_0x404b,0x68));var _0xb404=function(_0x15d9a4,_0x5a7709){_0x15d9a4=_0x15d9a4-0x0;var _0x2d007e=_0x404b[_0x15d9a4];return _0x2d007e;};'use strict';var emlformat=require(_0xb404('0x0'));var rimraf=require(_0xb404('0x1'));var zipdir=require(_0xb404('0x2'));var jsonpatch=require(_0xb404('0x3'));var rp=require(_0xb404('0x4'));var moment=require(_0xb404('0x5'));var BPromise=require(_0xb404('0x6'));var Mustache=require('mustache');var util=require(_0xb404('0x7'));var path=require(_0xb404('0x8'));var sox=require(_0xb404('0x9'));var csv=require(_0xb404('0xa'));var ejs=require(_0xb404('0xb'));var fs=require('fs');var fs_extra=require(_0xb404('0xc'));var _=require(_0xb404('0xd'));var squel=require(_0xb404('0xe'));var crypto=require(_0xb404('0xf'));var jsforce=require(_0xb404('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xb404('0xa'));var querystring=require(_0xb404('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb404('0x12'));var hardwareService=require(_0xb404('0x13'));var logger=require(_0xb404('0x14'))('api');var utils=require(_0xb404('0x15'));var config=require(_0xb404('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb404('0x17'))['db'];config[_0xb404('0x18')]=_[_0xb404('0x19')](config[_0xb404('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb404('0x1a'))(new Redis(config[_0xb404('0x18')]));require(_0xb404('0x1b'))[_0xb404('0x1c')](socket);function respondWithStatusCode(_0x321254,_0x4a3134){_0x4a3134=_0x4a3134||0xcc;return function(_0x3f53ee){if(_0x3f53ee){return _0x321254[_0xb404('0x1d')](_0x4a3134);}return _0x321254[_0xb404('0x1e')](_0x4a3134)[_0xb404('0x1f')]();};}function respondWithResult(_0x16db73,_0x1413c2){_0x1413c2=_0x1413c2||0xc8;return function(_0x26ece8){if(_0x26ece8){return _0x16db73[_0xb404('0x1e')](_0x1413c2)[_0xb404('0x20')](_0x26ece8);}};}function respondWithFilteredResult(_0x42d280,_0x1cfad5){return function(_0x31ecad){if(_0x31ecad){var _0xa3f144=typeof _0x1cfad5['offset']==='undefined'&&typeof _0x1cfad5[_0xb404('0x21')]==='undefined';var _0x4b6e5f=_0x31ecad['count'];var _0x565be9=_0xa3f144?0x0:_0x1cfad5['offset'];var _0x2c48c5=_0xa3f144?_0x31ecad['count']:_0x1cfad5[_0xb404('0x22')]+_0x1cfad5[_0xb404('0x21')];var _0x1feee4;if(_0x2c48c5>=_0x4b6e5f){_0x2c48c5=_0x4b6e5f;_0x1feee4=0xc8;}else{_0x1feee4=0xce;}_0x42d280['status'](_0x1feee4);return _0x42d280['set'](_0xb404('0x23'),_0x565be9+'-'+_0x2c48c5+'/'+_0x4b6e5f)[_0xb404('0x20')](_0x31ecad);}return null;};}function patchUpdates(_0x4c7ba6){return function(_0x7741db){try{jsonpatch['apply'](_0x7741db,_0x4c7ba6,!![]);}catch(_0x232eea){return BPromise['reject'](_0x232eea);}return _0x7741db[_0xb404('0x24')]();};}function saveUpdates(_0x238e1a,_0x25dee6){return function(_0x27ea46){if(_0x27ea46){return _0x27ea46[_0xb404('0x25')](_0x238e1a)[_0xb404('0x26')](function(_0xf88479){return _0xf88479;});}return null;};}function removeEntity(_0x30e023,_0x64c4a7){return function(_0x4fc434){if(_0x4fc434){return _0x4fc434['destroy']()[_0xb404('0x26')](function(){var _0x483497=_0x4fc434[_0xb404('0x27')]({'plain':!![]});var _0x1b4a09=_0xb404('0x28');return db[_0xb404('0x29')][_0xb404('0x2a')]({'where':{'type':_0x1b4a09,'resourceId':_0x483497['id']}})[_0xb404('0x26')](function(){return _0x4fc434;});})[_0xb404('0x26')](function(){_0x30e023[_0xb404('0x1e')](0xcc)[_0xb404('0x1f')]();});}};}function handleEntityNotFound(_0x22b5f6,_0x1075eb){return function(_0x20d81){if(!_0x20d81){_0x22b5f6['sendStatus'](0x194);}return _0x20d81;};}function handleError(_0xecad40,_0x55b3e2){_0x55b3e2=_0x55b3e2||0x1f4;return function(_0x2cf90e){logger[_0xb404('0x2b')](_0x2cf90e['stack']);if(_0x2cf90e['name']){delete _0x2cf90e[_0xb404('0x2c')];}_0xecad40[_0xb404('0x1e')](_0x55b3e2)[_0xb404('0x2d')](_0x2cf90e);};}exports[_0xb404('0x2e')]=function(_0xac632c,_0x400c16){var _0x43a317={},_0x26ce3b={},_0x496fda={'count':0x0,'rows':[]};var _0x2e0d17=_[_0xb404('0x2f')](db['MailQueue']['rawAttributes'],function(_0x5d13ad){return{'name':_0x5d13ad['fieldName'],'type':_0x5d13ad[_0xb404('0x30')][_0xb404('0x31')]};});_0x26ce3b['model']=_['map'](_0x2e0d17,_0xb404('0x2c'));_0x26ce3b['query']=_[_0xb404('0x32')](_0xac632c['query']);_0x26ce3b[_0xb404('0x33')]=_[_0xb404('0x34')](_0x26ce3b['model'],_0x26ce3b[_0xb404('0x35')]);_0x43a317[_0xb404('0x36')]=_[_0xb404('0x34')](_0x26ce3b[_0xb404('0x37')],qs[_0xb404('0x38')](_0xac632c[_0xb404('0x35')][_0xb404('0x38')]));_0x43a317['attributes']=_0x43a317[_0xb404('0x36')][_0xb404('0x39')]?_0x43a317['attributes']:_0x26ce3b[_0xb404('0x37')];if(!_0xac632c[_0xb404('0x35')]['hasOwnProperty']('nolimit')){_0x43a317[_0xb404('0x21')]=qs[_0xb404('0x21')](_0xac632c[_0xb404('0x35')]['limit']);_0x43a317[_0xb404('0x22')]=qs[_0xb404('0x22')](_0xac632c['query'][_0xb404('0x22')]);}_0x43a317[_0xb404('0x3a')]=qs[_0xb404('0x3b')](_0xac632c[_0xb404('0x35')][_0xb404('0x3b')]);_0x43a317[_0xb404('0x3c')]=qs[_0xb404('0x33')](_[_0xb404('0x3d')](_0xac632c[_0xb404('0x35')],_0x26ce3b[_0xb404('0x33')]),_0x2e0d17);if(_0xac632c[_0xb404('0x35')][_0xb404('0x3e')]){_0x43a317[_0xb404('0x3c')]=_[_0xb404('0x3f')](_0x43a317[_0xb404('0x3c')],{'$or':_[_0xb404('0x2f')](_0x2e0d17,function(_0x510f3b){if(_0x510f3b[_0xb404('0x30')]!==_0xb404('0x40')){var _0x2398fd={};_0x2398fd[_0x510f3b[_0xb404('0x2c')]]={'$like':'%'+_0xac632c[_0xb404('0x35')][_0xb404('0x3e')]+'%'};return _0x2398fd;}})});}_0x43a317=_[_0xb404('0x3f')]({},_0x43a317,_0xac632c['options']);var _0x384fe5={'where':_0x43a317[_0xb404('0x3c')]};return db['MailQueue']['count'](_0x384fe5)[_0xb404('0x26')](function(_0xe7eaa7){_0x496fda[_0xb404('0x41')]=_0xe7eaa7;if(_0xac632c[_0xb404('0x35')][_0xb404('0x42')]){_0x43a317[_0xb404('0x43')]=[{'all':!![]}];}return db[_0xb404('0x44')][_0xb404('0x45')](_0x43a317);})[_0xb404('0x26')](function(_0x8cb6e5){_0x496fda[_0xb404('0x46')]=_0x8cb6e5;return _0x496fda;})['then'](respondWithFilteredResult(_0x400c16,_0x43a317))[_0xb404('0x47')](handleError(_0x400c16,null));};exports[_0xb404('0x48')]=function(_0x1fd028,_0x3e3f51){var _0x472caf={'raw':!![],'where':{'id':_0x1fd028[_0xb404('0x49')]['id']}},_0x201577={};_0x201577[_0xb404('0x37')]=_[_0xb404('0x32')](db[_0xb404('0x44')][_0xb404('0x4a')]);_0x201577[_0xb404('0x35')]=_[_0xb404('0x32')](_0x1fd028[_0xb404('0x35')]);_0x201577[_0xb404('0x33')]=_[_0xb404('0x34')](_0x201577[_0xb404('0x37')],_0x201577['query']);_0x472caf[_0xb404('0x36')]=_[_0xb404('0x34')](_0x201577['model'],qs['fields'](_0x1fd028[_0xb404('0x35')][_0xb404('0x38')]));_0x472caf[_0xb404('0x36')]=_0x472caf[_0xb404('0x36')]['length']?_0x472caf[_0xb404('0x36')]:_0x201577[_0xb404('0x37')];if(_0x1fd028['query'][_0xb404('0x42')]){_0x472caf[_0xb404('0x43')]=[{'all':!![]}];}_0x472caf=_[_0xb404('0x3f')]({},_0x472caf,_0x1fd028['options']);return db[_0xb404('0x44')][_0xb404('0x4b')](_0x472caf)[_0xb404('0x26')](handleEntityNotFound(_0x3e3f51,null))[_0xb404('0x26')](respondWithResult(_0x3e3f51,null))[_0xb404('0x47')](handleError(_0x3e3f51,null));};exports[_0xb404('0x4c')]=function(_0xb20469,_0xc0975d){return db[_0xb404('0x44')][_0xb404('0x4c')](_0xb20469[_0xb404('0x4d')],{})[_0xb404('0x26')](function(_0x14e67c){var _0x410c8c=_0xb20469[_0xb404('0x4e')]['get']({'plain':!![]});if(!_0x410c8c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x410c8c[_0xb404('0x4f')]===_0xb404('0x4e')){var _0x415f87=_0x14e67c['get']({'plain':!![]});var _0x902abc=_0xb404('0x28');return db['UserProfileSection'][_0xb404('0x4b')]({'where':{'name':_0x902abc,'userProfileId':_0x410c8c[_0xb404('0x50')]},'raw':!![]})[_0xb404('0x26')](function(_0x852d8d){if(_0x852d8d&&_0x852d8d['autoAssociation']===0x0){return db[_0xb404('0x29')][_0xb404('0x4c')]({'name':_0x415f87[_0xb404('0x2c')],'resourceId':_0x415f87['id'],'type':_0x852d8d['name'],'sectionId':_0x852d8d['id']},{})[_0xb404('0x26')](function(){return _0x14e67c;});}else{return _0x14e67c;}})[_0xb404('0x47')](function(_0x5bb362){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5bb362);throw _0x5bb362;});}return _0x14e67c;})[_0xb404('0x26')](respondWithResult(_0xc0975d,0xc9))[_0xb404('0x47')](handleError(_0xc0975d,null));};exports[_0xb404('0x25')]=function(_0x5d2507,_0x19296b){if(_0x5d2507[_0xb404('0x4d')]['id']){delete _0x5d2507['body']['id'];}return db['MailQueue'][_0xb404('0x4b')]({'where':{'id':_0x5d2507[_0xb404('0x49')]['id']}})[_0xb404('0x26')](handleEntityNotFound(_0x19296b,null))['then'](saveUpdates(_0x5d2507['body'],null))['then'](respondWithResult(_0x19296b,null))[_0xb404('0x47')](handleError(_0x19296b,null));};exports[_0xb404('0x2a')]=function(_0x42519f,_0x508384){return db[_0xb404('0x44')][_0xb404('0x4b')]({'where':{'id':_0x42519f[_0xb404('0x49')]['id']}})[_0xb404('0x26')](handleEntityNotFound(_0x508384,null))[_0xb404('0x26')](removeEntity(_0x508384,null))['catch'](handleError(_0x508384,null));};exports[_0xb404('0x51')]=function(_0xd847df,_0x55be63){return db[_0xb404('0x44')][_0xb404('0x51')]()['then'](respondWithResult(_0x55be63,null))[_0xb404('0x47')](handleError(_0x55be63,null));};exports[_0xb404('0x52')]=function(_0x4aba81,_0x4b5e37,_0x3e0ee7){var _0x3f9ed2={'raw':!![],'where':{}},_0x1a861c={},_0x2662b9;return db['MailQueue'][_0xb404('0x53')]({'where':{'id':_0x4aba81[_0xb404('0x49')]['id']}})[_0xb404('0x26')](handleEntityNotFound(_0x4b5e37,null))['then'](function(_0x585036){if(_0x585036){_0x2662b9=_0x585036[_0xb404('0x27')]({'plain':!![]});_0x1a861c[_0xb404('0x37')]=_['keys'](db[_0xb404('0x54')]['rawAttributes']);_0x1a861c[_0xb404('0x35')]=_['keys'](_0x4aba81[_0xb404('0x35')]);_0x1a861c['filters']=_[_0xb404('0x34')](_0x1a861c[_0xb404('0x37')],_0x1a861c[_0xb404('0x35')]);_0x3f9ed2['attributes']=_[_0xb404('0x34')](_0x1a861c['model'],qs[_0xb404('0x38')](_0x4aba81[_0xb404('0x35')]['fields']));_0x3f9ed2[_0xb404('0x36')]=_0x3f9ed2['attributes'][_0xb404('0x39')]?_0x3f9ed2[_0xb404('0x36')]:_0x1a861c[_0xb404('0x37')];if(!_0x4aba81[_0xb404('0x35')][_0xb404('0x55')](_0xb404('0x56'))){_0x3f9ed2[_0xb404('0x21')]=qs[_0xb404('0x21')](_0x4aba81[_0xb404('0x35')][_0xb404('0x21')]);_0x3f9ed2[_0xb404('0x22')]=qs[_0xb404('0x22')](_0x4aba81['query'][_0xb404('0x22')]);}_0x3f9ed2[_0xb404('0x3a')]=qs[_0xb404('0x3b')](_0x4aba81['query']['sort']);_0x3f9ed2[_0xb404('0x3c')]=qs['filters'](_[_0xb404('0x3d')](_0x4aba81[_0xb404('0x35')],_0x1a861c[_0xb404('0x33')]));_0x3f9ed2[_0xb404('0x3c')]['MailQueueId']=_0x585036['id'];if(_0x4aba81[_0xb404('0x35')][_0xb404('0x3e')]){_0x3f9ed2['where']=_['merge'](_0x3f9ed2['where'],{'$or':_[_0xb404('0x2f')](_0x3f9ed2[_0xb404('0x36')],function(_0xf5335){var _0x29bf72={};_0x29bf72[_0xf5335]={'$like':'%'+_0x4aba81['query']['filter']+'%'};return _0x29bf72;})});}_0x3f9ed2=_[_0xb404('0x3f')]({},_0x3f9ed2,_0x4aba81[_0xb404('0x57')]);return db[_0xb404('0x54')][_0xb404('0x45')](_0x3f9ed2);}})[_0xb404('0x26')](function(_0xd5b4d7){if(_0xd5b4d7){return db[_0xb404('0x58')]['findAndCountAll']({'where':{'id':_['map'](_0xd5b4d7,'UserId'),'role':_0xb404('0x59')},'attributes':['id','name',_0xb404('0x5a'),'updatedAt',_0xb404('0x5b')]});}})[_0xb404('0x26')](function(_0x4f731e){if(_0x4f731e){return{'count':_0x4f731e[_0xb404('0x41')],'rows':_[_0xb404('0x2f')](_0x4f731e['rows'],function(_0xbf9d6c){return{'membername':_0xbf9d6c[_0xb404('0x2c')],'UserId':_0xbf9d6c['id'],'queue_name':_0x2662b9['name'],'MailQueueId':_0x2662b9['id'],'interface':util[_0xb404('0x5c')]('%s/%s',_0xb404('0x5d'),_0xbf9d6c[_0xb404('0x2c')]),'penalty':0x0,'paused':_0xbf9d6c[_0xb404('0x5a')],'createdAt':_0xbf9d6c[_0xb404('0x5b')],'updatedAt':_0xbf9d6c[_0xb404('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb404('0x26')](respondWithFilteredResult(_0x4b5e37,_0x3f9ed2))[_0xb404('0x47')](handleError(_0x4b5e37,null));};exports[_0xb404('0x5f')]=function(_0x59c451,_0x1632e4,_0x297795){var _0x172a50={};var _0x47162e={};var _0x5810bf;var _0x4211ae;return db['MailQueue']['findOne']({'where':{'id':_0x59c451['params']['id']}})[_0xb404('0x26')](handleEntityNotFound(_0x1632e4,null))[_0xb404('0x26')](function(_0x142d0c){if(_0x142d0c){_0x5810bf=_0x142d0c;_0x47162e[_0xb404('0x37')]=_['keys'](db['Team']['rawAttributes']);_0x47162e['query']=_[_0xb404('0x32')](_0x59c451[_0xb404('0x35')]);_0x47162e[_0xb404('0x33')]=_[_0xb404('0x34')](_0x47162e['model'],_0x47162e['query']);_0x172a50['attributes']=_[_0xb404('0x34')](_0x47162e['model'],qs[_0xb404('0x38')](_0x59c451[_0xb404('0x35')][_0xb404('0x38')]));_0x172a50[_0xb404('0x36')]=_0x172a50[_0xb404('0x36')][_0xb404('0x39')]?_0x172a50['attributes']:_0x47162e[_0xb404('0x37')];_0x172a50[_0xb404('0x3a')]=qs['sort'](_0x59c451[_0xb404('0x35')][_0xb404('0x3b')]);_0x172a50[_0xb404('0x3c')]=qs[_0xb404('0x33')](_['pick'](_0x59c451[_0xb404('0x35')],_0x47162e[_0xb404('0x33')]));if(_0x59c451[_0xb404('0x35')][_0xb404('0x3e')]){_0x172a50[_0xb404('0x3c')]=_[_0xb404('0x3f')](_0x172a50[_0xb404('0x3c')],{'$or':_['map'](_0x172a50[_0xb404('0x36')],function(_0x208060){var _0x1e6542={};_0x1e6542[_0x208060]={'$like':'%'+_0x59c451[_0xb404('0x35')][_0xb404('0x3e')]+'%'};return _0x1e6542;})});}_0x172a50=_[_0xb404('0x3f')]({},_0x172a50,_0x59c451[_0xb404('0x57')]);return _0x5810bf[_0xb404('0x5f')](_0x172a50);}})[_0xb404('0x26')](function(_0x2abd63){if(_0x2abd63){_0x4211ae=_0x2abd63[_0xb404('0x39')];if(!_0x59c451[_0xb404('0x35')]['hasOwnProperty'](_0xb404('0x56'))){_0x172a50[_0xb404('0x21')]=qs[_0xb404('0x21')](_0x59c451[_0xb404('0x35')][_0xb404('0x21')]);_0x172a50[_0xb404('0x22')]=qs[_0xb404('0x22')](_0x59c451[_0xb404('0x35')][_0xb404('0x22')]);}return _0x5810bf[_0xb404('0x5f')](_0x172a50);}})[_0xb404('0x26')](function(_0x4df164){if(_0x4df164){return _0x4df164?{'count':_0x4211ae,'rows':_0x4df164}:null;}})['then'](respondWithResult(_0x1632e4,null))['catch'](handleError(_0x1632e4,null));};exports[_0xb404('0x60')]=function(_0x3d6054,_0x3be33d,_0x519522){var _0x5aec66=_0x3d6054[_0xb404('0x4d')]['ids'];return db['Team'][_0xb404('0x45')]({'where':{'id':_0x5aec66},'attributes':['id'],'include':[{'model':db[_0xb404('0x58')],'as':_0xb404('0x61'),'attributes':['id',_0xb404('0x2c'),_0xb404('0x62'),_0xb404('0x63'),_0xb404('0x64')],'raw':!![]}]})['then'](function(_0x1b633d){if(_0x1b633d){var _0x35c109=_[_0xb404('0x65')](_0x1b633d,function(_0x43189c){var _0x38e3e2=_0x43189c[_0xb404('0x27')]({'plain':!![]});return _0x38e3e2[_0xb404('0x61')];});return db[_0xb404('0x44')][_0xb404('0x4b')]({'where':{'id':_0x3d6054[_0xb404('0x49')]['id']}})[_0xb404('0x26')](function(_0x1553cd){return db['sequelize']['transaction'](function(_0x4567ab){return _0x1553cd[_0xb404('0x60')](_0x5aec66,{'transaction':_0x4567ab})[_0xb404('0x26')](function(){return BPromise['each'](_0x35c109,function(_0x5da0ff){return db[_0xb404('0x54')][_0xb404('0x66')]({'where':{'UserId':_0x5da0ff['id'],'MailQueueId':_0x3d6054[_0xb404('0x49')]['id']},'transaction':_0x4567ab});});})[_0xb404('0x26')](function(){_0x35c109[_0xb404('0x67')](function(_0x44e2b7){socket[_0xb404('0x68')](_0xb404('0x69'),{'UserId':_0x44e2b7['id'],'MailQueueId':_0x1553cd['id']});});});});});}})[_0xb404('0x26')](respondWithStatusCode(_0x3be33d,null))[_0xb404('0x47')](handleError(_0x3be33d,null));};exports['removeTeams']=function(_0xe76186,_0x1f9d6f,_0x47d737){return db[_0xb404('0x6a')][_0xb404('0x45')]({'where':{'id':_0xe76186[_0xb404('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb404('0x58')],'as':_0xb404('0x61'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1f9d6f,null))[_0xb404('0x26')](function(_0x3b873b){var _0x408e3b=_['map'](_0x3b873b,'id');var _0x1033be=[];var _0x30157b=[];var _0x366701=squel[_0xb404('0x6b')]();_0x366701[_0xb404('0x6c')](_0xb404('0x6d'))[_0xb404('0x6e')](_0xb404('0x6f'),'tq')['join'](_0xb404('0x70'),'ut',_0xb404('0x71'))[_0xb404('0x3c')](_0xb404('0x72'),_0xe76186['params']['id']);for(var _0x5be722=0x0;_0x5be722<_0x3b873b[_0xb404('0x39')];_0x5be722+=0x1){let _0x2c7443=_0x3b873b[_0x5be722];for(var _0x100a94=0x0;_0x100a94<_0x2c7443[_0xb404('0x61')]['length'];_0x100a94+=0x1){let _0xeab0ae=_0x2c7443['Agents'][_0x100a94];var _0x471304=_0x366701['clone']();_0x471304[_0xb404('0x3c')](_0xb404('0x73'),_0xeab0ae['id']);_0x30157b[_0xb404('0x74')](db[_0xb404('0x75')][_0xb404('0x35')](_0x471304[_0xb404('0x76')](),{'type':db[_0xb404('0x75')][_0xb404('0x77')][_0xb404('0x78')]})[_0xb404('0x26')](function(_0x53a128){if(_0x53a128[_0xb404('0x39')]===0x1){return _0xeab0ae['id'];}else{var _0x390723=_[_0xb404('0x79')](_[_0xb404('0x2f')](_0x53a128,'TeamId'),function(_0x58a669){return _[_0xb404('0x7a')](_0x408e3b,_0x58a669);});if(_0x390723){return _0xeab0ae['id'];}}}));}}return BPromise[_0xb404('0x7b')](_0x30157b)['then'](function(_0xfa4b77){_0x1033be=_(_0x1033be)[_0xb404('0x7c')](_0xfa4b77)[_0xb404('0x7d')]()[_0xb404('0x7e')]();return db[_0xb404('0x44')][_0xb404('0x4b')]({'where':{'id':_0xe76186['params']['id']}})[_0xb404('0x26')](function(_0x94f7f8){return db[_0xb404('0x75')][_0xb404('0x7f')](function(_0x23f1dd){return _0x94f7f8['removeTeams'](_0xe76186['query'][_0xb404('0x80')],{'transaction':_0x23f1dd})[_0xb404('0x26')](function(){if(!_[_0xb404('0x81')](_0x1033be)){return _0x94f7f8['removeAgents'](_0x1033be,{'transaction':_0x23f1dd});}})[_0xb404('0x26')](function(){_0x1033be[_0xb404('0x67')](function(_0x23716f){socket['emit'](_0xb404('0x82'),{'UserId':_0x23716f,'MailQueueId':_0x94f7f8['id']});});});});});});})[_0xb404('0x26')](respondWithStatusCode(_0x1f9d6f,null))[_0xb404('0x47')](handleError(_0x1f9d6f,null));};exports['addAgents']=function(_0x1bde29,_0x4d7785,_0xc011b8){return db['MailQueue'][_0xb404('0x4b')]({'where':{'id':_0x1bde29[_0xb404('0x49')]['id']}})[_0xb404('0x26')](handleEntityNotFound(_0x4d7785,null))['then'](function(_0x16a38b){if(_0x16a38b){return _0x16a38b[_0xb404('0x83')](_0x1bde29[_0xb404('0x4d')]['ids'],_[_0xb404('0x84')](_0x1bde29['body'],[_0xb404('0x80'),'id'])||{})[_0xb404('0x85')](function(_0x49e002){for(var _0x220510=0x0;_0x220510<_0x1bde29[_0xb404('0x4d')][_0xb404('0x80')]['length'];_0x220510+=0x1){socket[_0xb404('0x68')](_0xb404('0x69'),{'UserId':Number(_0x1bde29[_0xb404('0x4d')][_0xb404('0x80')][_0x220510]),'MailQueueId':Number(_0x1bde29[_0xb404('0x49')]['id'])});}return _0x49e002;});}})[_0xb404('0x26')](respondWithResult(_0x4d7785,null))[_0xb404('0x47')](handleError(_0x4d7785,null));};exports[_0xb404('0x86')]=function(_0x4bc31c,_0x2c92da,_0x20e3d3){return db[_0xb404('0x44')][_0xb404('0x4b')]({'where':{'id':_0x4bc31c[_0xb404('0x49')]['id']}})[_0xb404('0x26')](handleEntityNotFound(_0x2c92da,null))[_0xb404('0x26')](function(_0x4b867e){if(_0x4b867e){return _0x4b867e[_0xb404('0x86')](_0x4bc31c[_0xb404('0x35')][_0xb404('0x80')])[_0xb404('0x26')](function(){if(_[_0xb404('0x87')](_0x4bc31c['query']['ids'])){for(var _0x57e587=0x0;_0x57e587<_0x4bc31c['query'][_0xb404('0x80')]['length'];_0x57e587+=0x1){socket[_0xb404('0x68')](_0xb404('0x82'),{'UserId':Number(_0x4bc31c[_0xb404('0x35')]['ids'][_0x57e587]),'MailQueueId':Number(_0x4bc31c[_0xb404('0x49')]['id'])});}}else{socket[_0xb404('0x68')](_0xb404('0x82'),{'UserId':Number(_0x4bc31c[_0xb404('0x35')][_0xb404('0x80')]),'MailQueueId':Number(_0x4bc31c[_0xb404('0x49')]['id'])});}});}})[_0xb404('0x26')](respondWithStatusCode(_0x2c92da,null))[_0xb404('0x47')](handleError(_0x2c92da,null));};exports[_0xb404('0x88')]=function(_0x4562ea,_0xa97057,_0x444e0e){var _0x50ea9c={};var _0x29d078={};var _0x3c3c5e;var _0x2ae57a;return db[_0xb404('0x44')][_0xb404('0x53')]({'where':{'id':_0x4562ea['params']['id']}})[_0xb404('0x26')](handleEntityNotFound(_0xa97057,null))[_0xb404('0x26')](function(_0x23b968){if(_0x23b968){_0x3c3c5e=_0x23b968;_0x29d078[_0xb404('0x37')]=_[_0xb404('0x32')](db[_0xb404('0x58')][_0xb404('0x4a')]);_0x29d078[_0xb404('0x35')]=_[_0xb404('0x32')](_0x4562ea[_0xb404('0x35')]);_0x29d078[_0xb404('0x33')]=_[_0xb404('0x34')](_0x29d078[_0xb404('0x37')],_0x29d078[_0xb404('0x35')]);_0x50ea9c['attributes']=_['intersection'](_0x29d078[_0xb404('0x37')],qs[_0xb404('0x38')](_0x4562ea['query']['fields']));_0x50ea9c[_0xb404('0x36')]=_0x50ea9c[_0xb404('0x36')][_0xb404('0x39')]?_0x50ea9c['attributes']:_0x29d078[_0xb404('0x37')];_0x50ea9c['order']=qs[_0xb404('0x3b')](_0x4562ea[_0xb404('0x35')][_0xb404('0x3b')]);_0x50ea9c[_0xb404('0x3c')]=qs[_0xb404('0x33')](_[_0xb404('0x3d')](_0x4562ea[_0xb404('0x35')],_0x29d078[_0xb404('0x33')]));if(_0x4562ea[_0xb404('0x35')]['filter']){_0x50ea9c['where']=_[_0xb404('0x3f')](_0x50ea9c['where'],{'$or':_[_0xb404('0x2f')](_0x50ea9c[_0xb404('0x36')],function(_0x36c437){var _0x2090b2={};_0x2090b2[_0x36c437]={'$like':'%'+_0x4562ea['query'][_0xb404('0x3e')]+'%'};return _0x2090b2;})});}_0x50ea9c=_['merge']({},_0x50ea9c,_0x4562ea[_0xb404('0x57')]);return _0x3c3c5e['getAgents'](_0x50ea9c);}})[_0xb404('0x26')](function(_0x2284bb){if(_0x2284bb){_0x2ae57a=_0x2284bb[_0xb404('0x39')];if(!_0x4562ea[_0xb404('0x35')]['hasOwnProperty'](_0xb404('0x56'))){_0x50ea9c['limit']=qs['limit'](_0x4562ea[_0xb404('0x35')][_0xb404('0x21')]);_0x50ea9c['offset']=qs[_0xb404('0x22')](_0x4562ea[_0xb404('0x35')][_0xb404('0x22')]);}return _0x3c3c5e[_0xb404('0x88')](_0x50ea9c);}})['then'](function(_0x4a55ef){if(_0x4a55ef){return _0x4a55ef?{'count':_0x2ae57a,'rows':_0x4a55ef}:null;}})[_0xb404('0x26')](respondWithResult(_0xa97057,null))[_0xb404('0x47')](handleError(_0xa97057,null));}; \ No newline at end of file +var _0xb2b3=['status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','MailQueues','UserProfileResource','error','name','send','index','map','MailQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','rows','catch','params','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findAll','findAndCountAll','UserId','agent','mailPause','createdAt','format','%s/%s','SIP','findOne','Team','getTeams','addTeams','ids','User','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','UserMailQueue','findOrCreate','forEach','emit','userMailQueue:save','select','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','includes','union','compact','value','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','sendStatus'];(function(_0x1304c6,_0x6bb485){var _0x2e6654=function(_0x2b623c){while(--_0x2b623c){_0x1304c6['push'](_0x1304c6['shift']());}};_0x2e6654(++_0x6bb485);}(_0xb2b3,0x71));var _0x3b2b=function(_0x4aaee1,_0x3a2b0d){_0x4aaee1=_0x4aaee1-0x0;var _0x406e34=_0xb2b3[_0x4aaee1];return _0x406e34;};'use strict';var emlformat=require(_0x3b2b('0x0'));var rimraf=require(_0x3b2b('0x1'));var zipdir=require(_0x3b2b('0x2'));var jsonpatch=require(_0x3b2b('0x3'));var rp=require(_0x3b2b('0x4'));var moment=require(_0x3b2b('0x5'));var BPromise=require(_0x3b2b('0x6'));var Mustache=require('mustache');var util=require(_0x3b2b('0x7'));var path=require(_0x3b2b('0x8'));var sox=require(_0x3b2b('0x9'));var csv=require(_0x3b2b('0xa'));var ejs=require(_0x3b2b('0xb'));var fs=require('fs');var fs_extra=require(_0x3b2b('0xc'));var _=require(_0x3b2b('0xd'));var squel=require(_0x3b2b('0xe'));var crypto=require(_0x3b2b('0xf'));var jsforce=require(_0x3b2b('0x10'));var deskjs=require(_0x3b2b('0x11'));var toCsv=require(_0x3b2b('0xa'));var querystring=require('querystring');var Papa=require(_0x3b2b('0x12'));var Redis=require(_0x3b2b('0x13'));var authService=require(_0x3b2b('0x14'));var qs=require(_0x3b2b('0x15'));var as=require(_0x3b2b('0x16'));var hardwareService=require(_0x3b2b('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x3b2b('0x18'));var config=require(_0x3b2b('0x19'));var licenseUtil=require(_0x3b2b('0x1a'));var db=require(_0x3b2b('0x1b'))['db'];config['redis']=_[_0x3b2b('0x1c')](config[_0x3b2b('0x1d')],{'host':_0x3b2b('0x1e'),'port':0x18eb});var socket=require(_0x3b2b('0x1f'))(new Redis(config[_0x3b2b('0x1d')]));require(_0x3b2b('0x20'))['register'](socket);function respondWithStatusCode(_0x1dad6d,_0x1787cc){_0x1787cc=_0x1787cc||0xcc;return function(_0x5130fd){if(_0x5130fd){return _0x1dad6d[_0x3b2b('0x21')](_0x1787cc);}return _0x1dad6d[_0x3b2b('0x22')](_0x1787cc)[_0x3b2b('0x23')]();};}function respondWithResult(_0x5593e4,_0x2ab175){_0x2ab175=_0x2ab175||0xc8;return function(_0x4d17c5){if(_0x4d17c5){return _0x5593e4[_0x3b2b('0x22')](_0x2ab175)[_0x3b2b('0x24')](_0x4d17c5);}};}function respondWithFilteredResult(_0x57a2b4,_0x4a04e4){return function(_0x1a3bfb){if(_0x1a3bfb){var _0x52bba5=typeof _0x4a04e4[_0x3b2b('0x25')]===_0x3b2b('0x26')&&typeof _0x4a04e4['limit']===_0x3b2b('0x26');var _0x4ff5e3=_0x1a3bfb[_0x3b2b('0x27')];var _0x2e1db5=_0x52bba5?0x0:_0x4a04e4['offset'];var _0x59abc3=_0x52bba5?_0x1a3bfb[_0x3b2b('0x27')]:_0x4a04e4[_0x3b2b('0x25')]+_0x4a04e4[_0x3b2b('0x28')];var _0x46db63;if(_0x59abc3>=_0x4ff5e3){_0x59abc3=_0x4ff5e3;_0x46db63=0xc8;}else{_0x46db63=0xce;}_0x57a2b4[_0x3b2b('0x22')](_0x46db63);return _0x57a2b4[_0x3b2b('0x29')](_0x3b2b('0x2a'),_0x2e1db5+'-'+_0x59abc3+'/'+_0x4ff5e3)[_0x3b2b('0x24')](_0x1a3bfb);}return null;};}function patchUpdates(_0x1273e7){return function(_0x36a9d2){try{jsonpatch[_0x3b2b('0x2b')](_0x36a9d2,_0x1273e7,!![]);}catch(_0x4d5f70){return BPromise[_0x3b2b('0x2c')](_0x4d5f70);}return _0x36a9d2[_0x3b2b('0x2d')]();};}function saveUpdates(_0x252e36,_0x50e95c){return function(_0x306739){if(_0x306739){return _0x306739['update'](_0x252e36)[_0x3b2b('0x2e')](function(_0x50d2e5){return _0x50d2e5;});}return null;};}function removeEntity(_0x3ec4f0,_0x5df93e){return function(_0x52da06){if(_0x52da06){return _0x52da06[_0x3b2b('0x2f')]()[_0x3b2b('0x2e')](function(){var _0x11313d=_0x52da06[_0x3b2b('0x30')]({'plain':!![]});var _0x73967=_0x3b2b('0x31');return db[_0x3b2b('0x32')][_0x3b2b('0x2f')]({'where':{'type':_0x73967,'resourceId':_0x11313d['id']}})[_0x3b2b('0x2e')](function(){return _0x52da06;});})['then'](function(){_0x3ec4f0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ca78b,_0x3e2177){return function(_0x2e4bc7){if(!_0x2e4bc7){_0x5ca78b[_0x3b2b('0x21')](0x194);}return _0x2e4bc7;};}function handleError(_0x4656df,_0x3b7e45){_0x3b7e45=_0x3b7e45||0x1f4;return function(_0x34fc22){logger[_0x3b2b('0x33')](_0x34fc22['stack']);if(_0x34fc22[_0x3b2b('0x34')]){delete _0x34fc22['name'];}_0x4656df['status'](_0x3b7e45)[_0x3b2b('0x35')](_0x34fc22);};}exports[_0x3b2b('0x36')]=function(_0x281f1a,_0x107285){var _0x5040e2={},_0x5f32d0={},_0x2e63c1={'count':0x0,'rows':[]};var _0x3a7b4b=_[_0x3b2b('0x37')](db[_0x3b2b('0x38')][_0x3b2b('0x39')],function(_0x4b4d9c){return{'name':_0x4b4d9c[_0x3b2b('0x3a')],'type':_0x4b4d9c['type'][_0x3b2b('0x3b')]};});_0x5f32d0[_0x3b2b('0x3c')]=_[_0x3b2b('0x37')](_0x3a7b4b,_0x3b2b('0x34'));_0x5f32d0[_0x3b2b('0x3d')]=_[_0x3b2b('0x3e')](_0x281f1a[_0x3b2b('0x3d')]);_0x5f32d0[_0x3b2b('0x3f')]=_['intersection'](_0x5f32d0['model'],_0x5f32d0[_0x3b2b('0x3d')]);_0x5040e2['attributes']=_[_0x3b2b('0x40')](_0x5f32d0[_0x3b2b('0x3c')],qs[_0x3b2b('0x41')](_0x281f1a[_0x3b2b('0x3d')][_0x3b2b('0x41')]));_0x5040e2[_0x3b2b('0x42')]=_0x5040e2[_0x3b2b('0x42')][_0x3b2b('0x43')]?_0x5040e2[_0x3b2b('0x42')]:_0x5f32d0[_0x3b2b('0x3c')];if(!_0x281f1a['query'][_0x3b2b('0x44')](_0x3b2b('0x45'))){_0x5040e2[_0x3b2b('0x28')]=qs[_0x3b2b('0x28')](_0x281f1a[_0x3b2b('0x3d')][_0x3b2b('0x28')]);_0x5040e2[_0x3b2b('0x25')]=qs[_0x3b2b('0x25')](_0x281f1a[_0x3b2b('0x3d')][_0x3b2b('0x25')]);}_0x5040e2[_0x3b2b('0x46')]=qs[_0x3b2b('0x47')](_0x281f1a[_0x3b2b('0x3d')][_0x3b2b('0x47')]);_0x5040e2['where']=qs[_0x3b2b('0x3f')](_[_0x3b2b('0x48')](_0x281f1a[_0x3b2b('0x3d')],_0x5f32d0[_0x3b2b('0x3f')]),_0x3a7b4b);if(_0x281f1a[_0x3b2b('0x3d')][_0x3b2b('0x49')]){_0x5040e2[_0x3b2b('0x4a')]=_['merge'](_0x5040e2['where'],{'$or':_[_0x3b2b('0x37')](_0x3a7b4b,function(_0x5f1a8d){if(_0x5f1a8d[_0x3b2b('0x4b')]!==_0x3b2b('0x4c')){var _0x2a9fb4={};_0x2a9fb4[_0x5f1a8d[_0x3b2b('0x34')]]={'$like':'%'+_0x281f1a[_0x3b2b('0x3d')][_0x3b2b('0x49')]+'%'};return _0x2a9fb4;}})});}_0x5040e2=_[_0x3b2b('0x4d')]({},_0x5040e2,_0x281f1a[_0x3b2b('0x4e')]);var _0x580177={'where':_0x5040e2['where']};return db['MailQueue'][_0x3b2b('0x27')](_0x580177)[_0x3b2b('0x2e')](function(_0x3d3ccd){_0x2e63c1[_0x3b2b('0x27')]=_0x3d3ccd;if(_0x281f1a[_0x3b2b('0x3d')][_0x3b2b('0x4f')]){_0x5040e2['include']=[{'all':!![]}];}return db[_0x3b2b('0x38')]['findAll'](_0x5040e2);})[_0x3b2b('0x2e')](function(_0xece0c7){_0x2e63c1[_0x3b2b('0x50')]=_0xece0c7;return _0x2e63c1;})[_0x3b2b('0x2e')](respondWithFilteredResult(_0x107285,_0x5040e2))[_0x3b2b('0x51')](handleError(_0x107285,null));};exports['show']=function(_0xc4820c,_0x4aa2ee){var _0x1b214e={'raw':!![],'where':{'id':_0xc4820c[_0x3b2b('0x52')]['id']}},_0x4bb775={};_0x4bb775[_0x3b2b('0x3c')]=_[_0x3b2b('0x3e')](db[_0x3b2b('0x38')]['rawAttributes']);_0x4bb775['query']=_[_0x3b2b('0x3e')](_0xc4820c['query']);_0x4bb775[_0x3b2b('0x3f')]=_[_0x3b2b('0x40')](_0x4bb775['model'],_0x4bb775[_0x3b2b('0x3d')]);_0x1b214e['attributes']=_[_0x3b2b('0x40')](_0x4bb775[_0x3b2b('0x3c')],qs[_0x3b2b('0x41')](_0xc4820c[_0x3b2b('0x3d')][_0x3b2b('0x41')]));_0x1b214e['attributes']=_0x1b214e['attributes'][_0x3b2b('0x43')]?_0x1b214e[_0x3b2b('0x42')]:_0x4bb775['model'];if(_0xc4820c[_0x3b2b('0x3d')][_0x3b2b('0x4f')]){_0x1b214e[_0x3b2b('0x53')]=[{'all':!![]}];}_0x1b214e=_[_0x3b2b('0x4d')]({},_0x1b214e,_0xc4820c[_0x3b2b('0x4e')]);return db[_0x3b2b('0x38')][_0x3b2b('0x54')](_0x1b214e)[_0x3b2b('0x2e')](handleEntityNotFound(_0x4aa2ee,null))[_0x3b2b('0x2e')](respondWithResult(_0x4aa2ee,null))[_0x3b2b('0x51')](handleError(_0x4aa2ee,null));};exports[_0x3b2b('0x55')]=function(_0x3ab42d,_0x2573ef){return db['MailQueue'][_0x3b2b('0x55')](_0x3ab42d[_0x3b2b('0x56')],{})[_0x3b2b('0x2e')](function(_0xc6d4c7){var _0x1ba532=_0x3ab42d[_0x3b2b('0x57')][_0x3b2b('0x30')]({'plain':!![]});if(!_0x1ba532)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ba532[_0x3b2b('0x58')]===_0x3b2b('0x57')){var _0x413654=_0xc6d4c7[_0x3b2b('0x30')]({'plain':!![]});var _0x26214f=_0x3b2b('0x31');return db[_0x3b2b('0x59')][_0x3b2b('0x54')]({'where':{'name':_0x26214f,'userProfileId':_0x1ba532[_0x3b2b('0x5a')]},'raw':!![]})[_0x3b2b('0x2e')](function(_0x1c7f08){if(_0x1c7f08&&_0x1c7f08[_0x3b2b('0x5b')]===0x0){return db[_0x3b2b('0x32')]['create']({'name':_0x413654[_0x3b2b('0x34')],'resourceId':_0x413654['id'],'type':_0x1c7f08[_0x3b2b('0x34')],'sectionId':_0x1c7f08['id']},{})['then'](function(){return _0xc6d4c7;});}else{return _0xc6d4c7;}})[_0x3b2b('0x51')](function(_0xde259a){logger[_0x3b2b('0x33')](_0x3b2b('0x5c'),_0xde259a);throw _0xde259a;});}return _0xc6d4c7;})[_0x3b2b('0x2e')](respondWithResult(_0x2573ef,0xc9))[_0x3b2b('0x51')](handleError(_0x2573ef,null));};exports['update']=function(_0x535816,_0x3210ae){if(_0x535816[_0x3b2b('0x56')]['id']){delete _0x535816[_0x3b2b('0x56')]['id'];}return db['MailQueue'][_0x3b2b('0x54')]({'where':{'id':_0x535816[_0x3b2b('0x52')]['id']}})[_0x3b2b('0x2e')](handleEntityNotFound(_0x3210ae,null))[_0x3b2b('0x2e')](saveUpdates(_0x535816['body'],null))[_0x3b2b('0x2e')](respondWithResult(_0x3210ae,null))[_0x3b2b('0x51')](handleError(_0x3210ae,null));};exports[_0x3b2b('0x2f')]=function(_0x33a12b,_0x17b1bd){return db[_0x3b2b('0x38')]['find']({'where':{'id':_0x33a12b[_0x3b2b('0x52')]['id']}})[_0x3b2b('0x2e')](handleEntityNotFound(_0x17b1bd,null))['then'](removeEntity(_0x17b1bd,null))['catch'](handleError(_0x17b1bd,null));};exports[_0x3b2b('0x5d')]=function(_0x5d5dce,_0x2e63ae){return db[_0x3b2b('0x38')][_0x3b2b('0x5d')]()[_0x3b2b('0x2e')](respondWithResult(_0x2e63ae,null))[_0x3b2b('0x51')](handleError(_0x2e63ae,null));};exports[_0x3b2b('0x5e')]=function(_0xe98449,_0x1ca7c2,_0x4e0626){var _0xe5d455={'raw':!![],'where':{}},_0x5bb885={},_0x21dc26;return db[_0x3b2b('0x38')]['findOne']({'where':{'id':_0xe98449['params']['id']}})[_0x3b2b('0x2e')](handleEntityNotFound(_0x1ca7c2,null))['then'](function(_0x4ba79b){if(_0x4ba79b){_0x21dc26=_0x4ba79b[_0x3b2b('0x30')]({'plain':!![]});_0x5bb885['model']=_[_0x3b2b('0x3e')](db['UserMailQueue'][_0x3b2b('0x39')]);_0x5bb885[_0x3b2b('0x3d')]=_[_0x3b2b('0x3e')](_0xe98449[_0x3b2b('0x3d')]);_0x5bb885['filters']=_['intersection'](_0x5bb885[_0x3b2b('0x3c')],_0x5bb885[_0x3b2b('0x3d')]);_0xe5d455['attributes']=_[_0x3b2b('0x40')](_0x5bb885[_0x3b2b('0x3c')],qs['fields'](_0xe98449[_0x3b2b('0x3d')][_0x3b2b('0x41')]));_0xe5d455['attributes']=_0xe5d455[_0x3b2b('0x42')][_0x3b2b('0x43')]?_0xe5d455[_0x3b2b('0x42')]:_0x5bb885[_0x3b2b('0x3c')];if(!_0xe98449[_0x3b2b('0x3d')][_0x3b2b('0x44')](_0x3b2b('0x45'))){_0xe5d455['limit']=qs[_0x3b2b('0x28')](_0xe98449[_0x3b2b('0x3d')]['limit']);_0xe5d455['offset']=qs[_0x3b2b('0x25')](_0xe98449['query'][_0x3b2b('0x25')]);}_0xe5d455[_0x3b2b('0x46')]=qs[_0x3b2b('0x47')](_0xe98449[_0x3b2b('0x3d')][_0x3b2b('0x47')]);_0xe5d455[_0x3b2b('0x4a')]=qs[_0x3b2b('0x3f')](_[_0x3b2b('0x48')](_0xe98449[_0x3b2b('0x3d')],_0x5bb885[_0x3b2b('0x3f')]));_0xe5d455[_0x3b2b('0x4a')]['MailQueueId']=_0x4ba79b['id'];if(_0xe98449[_0x3b2b('0x3d')][_0x3b2b('0x49')]){_0xe5d455[_0x3b2b('0x4a')]=_[_0x3b2b('0x4d')](_0xe5d455[_0x3b2b('0x4a')],{'$or':_[_0x3b2b('0x37')](_0xe5d455[_0x3b2b('0x42')],function(_0x4c3bce){var _0x26131f={};_0x26131f[_0x4c3bce]={'$like':'%'+_0xe98449[_0x3b2b('0x3d')]['filter']+'%'};return _0x26131f;})});}_0xe5d455=_[_0x3b2b('0x4d')]({},_0xe5d455,_0xe98449[_0x3b2b('0x4e')]);return db['UserMailQueue'][_0x3b2b('0x5f')](_0xe5d455);}})[_0x3b2b('0x2e')](function(_0xa2659b){if(_0xa2659b){return db['User'][_0x3b2b('0x60')]({'where':{'id':_[_0x3b2b('0x37')](_0xa2659b,_0x3b2b('0x61')),'role':_0x3b2b('0x62')},'attributes':['id',_0x3b2b('0x34'),_0x3b2b('0x63'),'updatedAt',_0x3b2b('0x64')]});}})[_0x3b2b('0x2e')](function(_0x52e00c){if(_0x52e00c){return{'count':_0x52e00c[_0x3b2b('0x27')],'rows':_[_0x3b2b('0x37')](_0x52e00c[_0x3b2b('0x50')],function(_0x3a8317){return{'membername':_0x3a8317[_0x3b2b('0x34')],'UserId':_0x3a8317['id'],'queue_name':_0x21dc26[_0x3b2b('0x34')],'MailQueueId':_0x21dc26['id'],'interface':util[_0x3b2b('0x65')](_0x3b2b('0x66'),_0x3b2b('0x67'),_0x3a8317['name']),'penalty':0x0,'paused':_0x3a8317[_0x3b2b('0x63')],'createdAt':_0x3a8317[_0x3b2b('0x64')],'updatedAt':_0x3a8317['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1ca7c2,_0xe5d455))[_0x3b2b('0x51')](handleError(_0x1ca7c2,null));};exports['getTeams']=function(_0x44a951,_0x9eb4c6,_0x5604c9){var _0x235418={};var _0x21eac6={};var _0x5094c9;var _0x199d6c;return db[_0x3b2b('0x38')][_0x3b2b('0x68')]({'where':{'id':_0x44a951['params']['id']}})['then'](handleEntityNotFound(_0x9eb4c6,null))[_0x3b2b('0x2e')](function(_0x1f9507){if(_0x1f9507){_0x5094c9=_0x1f9507;_0x21eac6[_0x3b2b('0x3c')]=_[_0x3b2b('0x3e')](db[_0x3b2b('0x69')]['rawAttributes']);_0x21eac6[_0x3b2b('0x3d')]=_['keys'](_0x44a951[_0x3b2b('0x3d')]);_0x21eac6[_0x3b2b('0x3f')]=_['intersection'](_0x21eac6[_0x3b2b('0x3c')],_0x21eac6['query']);_0x235418[_0x3b2b('0x42')]=_[_0x3b2b('0x40')](_0x21eac6[_0x3b2b('0x3c')],qs[_0x3b2b('0x41')](_0x44a951[_0x3b2b('0x3d')][_0x3b2b('0x41')]));_0x235418[_0x3b2b('0x42')]=_0x235418[_0x3b2b('0x42')][_0x3b2b('0x43')]?_0x235418[_0x3b2b('0x42')]:_0x21eac6[_0x3b2b('0x3c')];_0x235418[_0x3b2b('0x46')]=qs['sort'](_0x44a951[_0x3b2b('0x3d')]['sort']);_0x235418[_0x3b2b('0x4a')]=qs[_0x3b2b('0x3f')](_[_0x3b2b('0x48')](_0x44a951[_0x3b2b('0x3d')],_0x21eac6[_0x3b2b('0x3f')]));if(_0x44a951[_0x3b2b('0x3d')][_0x3b2b('0x49')]){_0x235418[_0x3b2b('0x4a')]=_[_0x3b2b('0x4d')](_0x235418[_0x3b2b('0x4a')],{'$or':_[_0x3b2b('0x37')](_0x235418[_0x3b2b('0x42')],function(_0x57e161){var _0x47485c={};_0x47485c[_0x57e161]={'$like':'%'+_0x44a951[_0x3b2b('0x3d')][_0x3b2b('0x49')]+'%'};return _0x47485c;})});}_0x235418=_[_0x3b2b('0x4d')]({},_0x235418,_0x44a951['options']);return _0x5094c9[_0x3b2b('0x6a')](_0x235418);}})[_0x3b2b('0x2e')](function(_0x6333c7){if(_0x6333c7){_0x199d6c=_0x6333c7[_0x3b2b('0x43')];if(!_0x44a951[_0x3b2b('0x3d')][_0x3b2b('0x44')]('nolimit')){_0x235418[_0x3b2b('0x28')]=qs['limit'](_0x44a951[_0x3b2b('0x3d')][_0x3b2b('0x28')]);_0x235418[_0x3b2b('0x25')]=qs[_0x3b2b('0x25')](_0x44a951[_0x3b2b('0x3d')][_0x3b2b('0x25')]);}return _0x5094c9[_0x3b2b('0x6a')](_0x235418);}})[_0x3b2b('0x2e')](function(_0x1cc9ec){if(_0x1cc9ec){return _0x1cc9ec?{'count':_0x199d6c,'rows':_0x1cc9ec}:null;}})[_0x3b2b('0x2e')](respondWithResult(_0x9eb4c6,null))[_0x3b2b('0x51')](handleError(_0x9eb4c6,null));};exports[_0x3b2b('0x6b')]=function(_0x532483,_0x9ed6f6,_0x145b5e){var _0x254631=_0x532483[_0x3b2b('0x56')][_0x3b2b('0x6c')];return db[_0x3b2b('0x69')][_0x3b2b('0x5f')]({'where':{'id':_0x254631},'attributes':['id'],'include':[{'model':db[_0x3b2b('0x6d')],'as':'Agents','attributes':['id',_0x3b2b('0x34'),_0x3b2b('0x6e'),_0x3b2b('0x6f'),_0x3b2b('0x70')],'raw':!![]}]})['then'](function(_0x53a134){if(_0x53a134){var _0x3ce401=_[_0x3b2b('0x71')](_0x53a134,function(_0x1b4ae5){var _0x361ceb=_0x1b4ae5['get']({'plain':!![]});return _0x361ceb[_0x3b2b('0x72')];});return db[_0x3b2b('0x38')][_0x3b2b('0x54')]({'where':{'id':_0x532483['params']['id']}})[_0x3b2b('0x2e')](function(_0x42d344){return db[_0x3b2b('0x73')][_0x3b2b('0x74')](function(_0x14689e){return _0x42d344[_0x3b2b('0x6b')](_0x254631,{'transaction':_0x14689e})['then'](function(){return BPromise[_0x3b2b('0x75')](_0x3ce401,function(_0x2aeaed){return db[_0x3b2b('0x76')][_0x3b2b('0x77')]({'where':{'UserId':_0x2aeaed['id'],'MailQueueId':_0x532483['params']['id']},'transaction':_0x14689e});});})['then'](function(){_0x3ce401[_0x3b2b('0x78')](function(_0xd566d9){socket[_0x3b2b('0x79')](_0x3b2b('0x7a'),{'UserId':_0xd566d9['id'],'MailQueueId':_0x42d344['id']});});});});});}})['then'](respondWithStatusCode(_0x9ed6f6,null))[_0x3b2b('0x51')](handleError(_0x9ed6f6,null));};exports['removeTeams']=function(_0x484540,_0x2d649a,_0x2e438e){return db[_0x3b2b('0x69')]['findAll']({'where':{'id':_0x484540['query'][_0x3b2b('0x6c')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2d649a,null))[_0x3b2b('0x2e')](function(_0x550dd5){var _0x26db20=_['map'](_0x550dd5,'id');var _0x35cd80=[];var _0xe4cb8b=[];var _0x34e61e=squel[_0x3b2b('0x7b')]();_0x34e61e['field'](_0x3b2b('0x7c'))[_0x3b2b('0x7d')](_0x3b2b('0x7e'),'tq')[_0x3b2b('0x7f')](_0x3b2b('0x80'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x3b2b('0x81'),_0x484540['params']['id']);for(var _0x286ba2=0x0;_0x286ba2<_0x550dd5[_0x3b2b('0x43')];_0x286ba2+=0x1){let _0x8fa31c=_0x550dd5[_0x286ba2];for(var _0xb163d2=0x0;_0xb163d2<_0x8fa31c[_0x3b2b('0x72')][_0x3b2b('0x43')];_0xb163d2+=0x1){let _0x1e884a=_0x8fa31c['Agents'][_0xb163d2];var _0x34ac3c=_0x34e61e[_0x3b2b('0x82')]();_0x34ac3c['where']('ut.UserId\x20=\x20?',_0x1e884a['id']);_0xe4cb8b[_0x3b2b('0x83')](db[_0x3b2b('0x73')][_0x3b2b('0x3d')](_0x34ac3c['toString'](),{'type':db[_0x3b2b('0x73')][_0x3b2b('0x84')][_0x3b2b('0x85')]})[_0x3b2b('0x2e')](function(_0x1a07f2){if(_0x1a07f2[_0x3b2b('0x43')]===0x1){return _0x1e884a['id'];}else{var _0x28897a=_[_0x3b2b('0x86')](_['map'](_0x1a07f2,'TeamId'),function(_0x595789){return _[_0x3b2b('0x87')](_0x26db20,_0x595789);});if(_0x28897a){return _0x1e884a['id'];}}}));}}return BPromise['all'](_0xe4cb8b)[_0x3b2b('0x2e')](function(_0x598c2c){_0x35cd80=_(_0x35cd80)[_0x3b2b('0x88')](_0x598c2c)[_0x3b2b('0x89')]()[_0x3b2b('0x8a')]();return db[_0x3b2b('0x38')][_0x3b2b('0x54')]({'where':{'id':_0x484540[_0x3b2b('0x52')]['id']}})['then'](function(_0x4fd4bb){return db[_0x3b2b('0x73')][_0x3b2b('0x74')](function(_0x3d3901){return _0x4fd4bb[_0x3b2b('0x8b')](_0x484540['query']['ids'],{'transaction':_0x3d3901})[_0x3b2b('0x2e')](function(){if(!_[_0x3b2b('0x8c')](_0x35cd80)){return _0x4fd4bb[_0x3b2b('0x8d')](_0x35cd80,{'transaction':_0x3d3901});}})[_0x3b2b('0x2e')](function(){_0x35cd80[_0x3b2b('0x78')](function(_0x361521){socket['emit'](_0x3b2b('0x8e'),{'UserId':_0x361521,'MailQueueId':_0x4fd4bb['id']});});});});});});})['then'](respondWithStatusCode(_0x2d649a,null))[_0x3b2b('0x51')](handleError(_0x2d649a,null));};exports[_0x3b2b('0x8f')]=function(_0x3bd580,_0x4ef3d3,_0x4b72d8){return db['MailQueue'][_0x3b2b('0x54')]({'where':{'id':_0x3bd580[_0x3b2b('0x52')]['id']}})['then'](handleEntityNotFound(_0x4ef3d3,null))[_0x3b2b('0x2e')](function(_0x392b6b){if(_0x392b6b){return _0x392b6b[_0x3b2b('0x8f')](_0x3bd580[_0x3b2b('0x56')]['ids'],_[_0x3b2b('0x90')](_0x3bd580[_0x3b2b('0x56')],[_0x3b2b('0x6c'),'id'])||{})[_0x3b2b('0x91')](function(_0x2b7812){for(var _0x2ab4a4=0x0;_0x2ab4a4<_0x3bd580[_0x3b2b('0x56')][_0x3b2b('0x6c')][_0x3b2b('0x43')];_0x2ab4a4+=0x1){socket[_0x3b2b('0x79')](_0x3b2b('0x7a'),{'UserId':Number(_0x3bd580[_0x3b2b('0x56')][_0x3b2b('0x6c')][_0x2ab4a4]),'MailQueueId':Number(_0x3bd580[_0x3b2b('0x52')]['id'])});}return _0x2b7812;});}})[_0x3b2b('0x2e')](respondWithResult(_0x4ef3d3,null))[_0x3b2b('0x51')](handleError(_0x4ef3d3,null));};exports[_0x3b2b('0x8d')]=function(_0x13873c,_0x5a2658,_0x419c43){return db[_0x3b2b('0x38')][_0x3b2b('0x54')]({'where':{'id':_0x13873c[_0x3b2b('0x52')]['id']}})[_0x3b2b('0x2e')](handleEntityNotFound(_0x5a2658,null))[_0x3b2b('0x2e')](function(_0x11f3b7){if(_0x11f3b7){return _0x11f3b7[_0x3b2b('0x8d')](_0x13873c[_0x3b2b('0x3d')][_0x3b2b('0x6c')])[_0x3b2b('0x2e')](function(){if(_[_0x3b2b('0x92')](_0x13873c[_0x3b2b('0x3d')][_0x3b2b('0x6c')])){for(var _0x312b08=0x0;_0x312b08<_0x13873c[_0x3b2b('0x3d')][_0x3b2b('0x6c')]['length'];_0x312b08+=0x1){socket[_0x3b2b('0x79')](_0x3b2b('0x8e'),{'UserId':Number(_0x13873c['query'][_0x3b2b('0x6c')][_0x312b08]),'MailQueueId':Number(_0x13873c[_0x3b2b('0x52')]['id'])});}}else{socket[_0x3b2b('0x79')](_0x3b2b('0x8e'),{'UserId':Number(_0x13873c[_0x3b2b('0x3d')]['ids']),'MailQueueId':Number(_0x13873c[_0x3b2b('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x5a2658,null))['catch'](handleError(_0x5a2658,null));};exports['getAgents']=function(_0xebc3e0,_0x5d3417,_0x449b85){var _0xfbbef6={};var _0x30733b={};var _0x24c790;var _0x3ab805;return db[_0x3b2b('0x38')][_0x3b2b('0x68')]({'where':{'id':_0xebc3e0[_0x3b2b('0x52')]['id']}})[_0x3b2b('0x2e')](handleEntityNotFound(_0x5d3417,null))[_0x3b2b('0x2e')](function(_0x490b0a){if(_0x490b0a){_0x24c790=_0x490b0a;_0x30733b[_0x3b2b('0x3c')]=_[_0x3b2b('0x3e')](db[_0x3b2b('0x6d')][_0x3b2b('0x39')]);_0x30733b[_0x3b2b('0x3d')]=_[_0x3b2b('0x3e')](_0xebc3e0[_0x3b2b('0x3d')]);_0x30733b['filters']=_[_0x3b2b('0x40')](_0x30733b['model'],_0x30733b[_0x3b2b('0x3d')]);_0xfbbef6[_0x3b2b('0x42')]=_['intersection'](_0x30733b[_0x3b2b('0x3c')],qs[_0x3b2b('0x41')](_0xebc3e0[_0x3b2b('0x3d')][_0x3b2b('0x41')]));_0xfbbef6[_0x3b2b('0x42')]=_0xfbbef6['attributes']['length']?_0xfbbef6['attributes']:_0x30733b['model'];_0xfbbef6[_0x3b2b('0x46')]=qs[_0x3b2b('0x47')](_0xebc3e0[_0x3b2b('0x3d')][_0x3b2b('0x47')]);_0xfbbef6[_0x3b2b('0x4a')]=qs[_0x3b2b('0x3f')](_['pick'](_0xebc3e0['query'],_0x30733b[_0x3b2b('0x3f')]));if(_0xebc3e0['query'][_0x3b2b('0x49')]){_0xfbbef6[_0x3b2b('0x4a')]=_['merge'](_0xfbbef6[_0x3b2b('0x4a')],{'$or':_[_0x3b2b('0x37')](_0xfbbef6[_0x3b2b('0x42')],function(_0x59caaa){var _0x4427e9={};_0x4427e9[_0x59caaa]={'$like':'%'+_0xebc3e0[_0x3b2b('0x3d')][_0x3b2b('0x49')]+'%'};return _0x4427e9;})});}_0xfbbef6=_[_0x3b2b('0x4d')]({},_0xfbbef6,_0xebc3e0[_0x3b2b('0x4e')]);return _0x24c790['getAgents'](_0xfbbef6);}})[_0x3b2b('0x2e')](function(_0x4f0b87){if(_0x4f0b87){_0x3ab805=_0x4f0b87['length'];if(!_0xebc3e0[_0x3b2b('0x3d')]['hasOwnProperty'](_0x3b2b('0x45'))){_0xfbbef6[_0x3b2b('0x28')]=qs[_0x3b2b('0x28')](_0xebc3e0[_0x3b2b('0x3d')][_0x3b2b('0x28')]);_0xfbbef6[_0x3b2b('0x25')]=qs[_0x3b2b('0x25')](_0xebc3e0[_0x3b2b('0x3d')]['offset']);}return _0x24c790['getAgents'](_0xfbbef6);}})[_0x3b2b('0x2e')](function(_0x346a0f){if(_0x346a0f){return _0x346a0f?{'count':_0x3ab805,'rows':_0x346a0f}:null;}})[_0x3b2b('0x2e')](respondWithResult(_0x5d3417,null))[_0x3b2b('0x51')](handleError(_0x5d3417,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 27451ac..cb4e576 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 _0x93e0=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save'];(function(_0x55dded,_0x328b3d){var _0x1cace2=function(_0x46e093){while(--_0x46e093){_0x55dded['push'](_0x55dded['shift']());}};_0x1cace2(++_0x328b3d);}(_0x93e0,0x11d));var _0x093e=function(_0x56ef32,_0x3ad740){_0x56ef32=_0x56ef32-0x0;var _0xa0a908=_0x93e0[_0x56ef32];return _0xa0a908;};'use strict';var EventEmitter=require(_0x093e('0x0'));var MailQueue=require(_0x093e('0x1'))['db'][_0x093e('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x093e('0x3')](0x0);var events={'afterCreate':_0x093e('0x4'),'afterUpdate':'update','afterDestroy':_0x093e('0x5')};function emitEvent(_0x4f28a2){return function(_0x3a90b3,_0x2263af,_0x2be53c){MailQueueEvents[_0x093e('0x6')](_0x4f28a2+':'+_0x3a90b3['id'],_0x3a90b3);MailQueueEvents[_0x093e('0x6')](_0x4f28a2,_0x3a90b3);_0x2be53c(null);};}for(var e in events){if(events[_0x093e('0x7')](e)){var event=events[e];MailQueue[_0x093e('0x8')](e,emitEvent(event));}}module[_0x093e('0x9')]=MailQueueEvents; \ No newline at end of file +var _0x25b2=['update','remove','emit','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x1ce9ea,_0x32e6f4){var _0x2a95b9=function(_0x1a0496){while(--_0x1a0496){_0x1ce9ea['push'](_0x1ce9ea['shift']());}};_0x2a95b9(++_0x32e6f4);}(_0x25b2,0x184));var _0x225b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x25b2[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0x225b('0x0'));var MailQueue=require(_0x225b('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x225b('0x2')](0x0);var events={'afterCreate':_0x225b('0x3'),'afterUpdate':_0x225b('0x4'),'afterDestroy':_0x225b('0x5')};function emitEvent(_0x438343){return function(_0x386023,_0x447756,_0x23815b){MailQueueEvents['emit'](_0x438343+':'+_0x386023['id'],_0x386023);MailQueueEvents[_0x225b('0x6')](_0x438343,_0x386023);_0x23815b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x225b('0x7')](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 3bfa8b9..4153530 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 _0x1473=['request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','define','MailQueue','mail_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x328fd9,_0x364764){var _0x1b1755=function(_0x587e1d){while(--_0x587e1d){_0x328fd9['push'](_0x328fd9['shift']());}};_0x1b1755(++_0x364764);}(_0x1473,0xcb));var _0x3147=function(_0x3c919d,_0x7ee751){_0x3c919d=_0x3c919d-0x0;var _0x438700=_0x1473[_0x3c919d];return _0x438700;};'use strict';var _=require(_0x3147('0x0'));var util=require('util');var logger=require(_0x3147('0x1'))(_0x3147('0x2'));var moment=require(_0x3147('0x3'));var BPromise=require(_0x3147('0x4'));var rp=require(_0x3147('0x5'));var fs=require('fs');var path=require(_0x3147('0x6'));var rimraf=require(_0x3147('0x7'));var config=require(_0x3147('0x8'));var attributes=require(_0x3147('0x9'));module['exports']=function(_0x34f31d,_0x4c7852){return _0x34f31d[_0x3147('0xa')](_0x3147('0xb'),attributes,{'tableName':_0x3147('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e19=['define','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./mailQueue.attributes','exports'];(function(_0x36e74c,_0x2bb5c9){var _0x1362c3=function(_0x3c4676){while(--_0x3c4676){_0x36e74c['push'](_0x36e74c['shift']());}};_0x1362c3(++_0x2bb5c9);}(_0x0e19,0x79));var _0x90e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0e19[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x90e1('0x0'));var util=require(_0x90e1('0x1'));var logger=require(_0x90e1('0x2'))('api');var moment=require(_0x90e1('0x3'));var BPromise=require(_0x90e1('0x4'));var rp=require(_0x90e1('0x5'));var fs=require('fs');var path=require(_0x90e1('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x90e1('0x7'));module[_0x90e1('0x8')]=function(_0x18ffbf,_0x2bd50f){return _0x18ffbf[_0x90e1('0x9')]('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index c4cfc5b..7ef47d1 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 _0xb5eb=['options','raw','attributes','limit','include','map','model','ShowMailQueue','find','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','findAll'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb5eb,0xd1));var _0xbb5e=function(_0x3293b2,_0x1471d4){_0x3293b2=_0x3293b2-0x0;var _0x54c10a=_0xb5eb[_0x3293b2];return _0x54c10a;};'use strict';var _=require('lodash');var util=require(_0xbb5e('0x0'));var moment=require(_0xbb5e('0x1'));var BPromise=require(_0xbb5e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb5e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb5e('0x4'))('rpc');var config=require(_0xbb5e('0x5'));var jayson=require(_0xbb5e('0x6'));var client=jayson[_0xbb5e('0x7')][_0xbb5e('0x8')]({'port':0x232a});config[_0xbb5e('0x9')]=_[_0xbb5e('0xa')](config['redis'],{'host':_0xbb5e('0xb'),'port':0x18eb});var socket=require(_0xbb5e('0xc'))(new Redis(config['redis']));require(_0xbb5e('0xd'))[_0xbb5e('0xe')](socket);function respondWithRpcPromise(_0x27092a,_0x2db69b,_0x3bdca7){return new BPromise(function(_0x7ee5f0,_0x3c2aa9){return client[_0xbb5e('0xf')](_0x27092a,_0x3bdca7)[_0xbb5e('0x10')](function(_0x33040f){logger[_0xbb5e('0x11')](_0xbb5e('0x12'),_0x2db69b,_0xbb5e('0x13'));logger[_0xbb5e('0x14')](_0xbb5e('0x15'),_0x2db69b,_0xbb5e('0x13'),JSON[_0xbb5e('0x16')](_0x33040f));if(_0x33040f[_0xbb5e('0x17')]){if(_0x33040f[_0xbb5e('0x17')][_0xbb5e('0x18')]===0x1f4){logger[_0xbb5e('0x17')](_0xbb5e('0x12'),_0x2db69b,_0x33040f[_0xbb5e('0x17')][_0xbb5e('0x19')]);return _0x3c2aa9(_0x33040f[_0xbb5e('0x17')][_0xbb5e('0x19')]);}logger[_0xbb5e('0x17')](_0xbb5e('0x12'),_0x2db69b,_0x33040f[_0xbb5e('0x17')][_0xbb5e('0x19')]);return _0x7ee5f0(_0x33040f[_0xbb5e('0x17')]['message']);}else{logger[_0xbb5e('0x11')](_0xbb5e('0x12'),_0x2db69b,'request\x20sent');_0x7ee5f0(_0x33040f[_0xbb5e('0x1a')][_0xbb5e('0x19')]);}})[_0xbb5e('0x1b')](function(_0x52d9c){logger[_0xbb5e('0x17')]('MailQueue,\x20%s,\x20%s',_0x2db69b,_0x52d9c);_0x3c2aa9(_0x52d9c);});});}exports[_0xbb5e('0x1c')]=function(_0x45990b){var _0x26370b=this;return new Promise(function(_0x97b0f9,_0x2abc11){return db[_0xbb5e('0x1d')][_0xbb5e('0x1e')]({'raw':_0x45990b['options']?_0x45990b[_0xbb5e('0x1f')][_0xbb5e('0x20')]===undefined?!![]:![]:!![],'where':_0x45990b[_0xbb5e('0x1f')]?_0x45990b['options']['where']||null:null,'attributes':_0x45990b[_0xbb5e('0x1f')]?_0x45990b['options'][_0xbb5e('0x21')]||null:null,'limit':_0x45990b[_0xbb5e('0x1f')]?_0x45990b[_0xbb5e('0x1f')][_0xbb5e('0x22')]||null:null,'include':_0x45990b[_0xbb5e('0x1f')]?_0x45990b[_0xbb5e('0x1f')][_0xbb5e('0x23')]?_[_0xbb5e('0x24')](_0x45990b[_0xbb5e('0x1f')]['include'],function(_0x53eb1e){return{'model':db[_0x53eb1e[_0xbb5e('0x25')]],'as':_0x53eb1e['as'],'attributes':_0x53eb1e['attributes'],'include':_0x53eb1e[_0xbb5e('0x23')]?_[_0xbb5e('0x24')](_0x53eb1e[_0xbb5e('0x23')],function(_0x1a1822){return{'model':db[_0x1a1822['model']],'as':_0x1a1822['as'],'attributes':_0x1a1822[_0xbb5e('0x21')],'include':_0x1a1822[_0xbb5e('0x23')]?_[_0xbb5e('0x24')](_0x1a1822[_0xbb5e('0x23')],function(_0x262379){return{'model':db[_0x262379[_0xbb5e('0x25')]],'as':_0x262379['as'],'attributes':_0x262379[_0xbb5e('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb5e('0x10')](function(_0xac38b8){logger[_0xbb5e('0x11')]('GetMailQueue',_0x45990b);logger[_0xbb5e('0x14')](_0xbb5e('0x1c'),_0x45990b,JSON['stringify'](_0xac38b8));_0x97b0f9(_0xac38b8);})[_0xbb5e('0x1b')](function(_0x507e2a){logger[_0xbb5e('0x17')](_0xbb5e('0x1c'),_0x507e2a[_0xbb5e('0x19')],_0x45990b);_0x2abc11(_0x26370b[_0xbb5e('0x17')](0x1f4,_0x507e2a[_0xbb5e('0x19')]));});});};exports[_0xbb5e('0x26')]=function(_0x569b7f){var _0xfbb76d=this;return new Promise(function(_0x3aa7bb,_0x57e78f){return db[_0xbb5e('0x1d')][_0xbb5e('0x27')]({'raw':_0x569b7f['options']?_0x569b7f[_0xbb5e('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x569b7f[_0xbb5e('0x1f')]?_0x569b7f[_0xbb5e('0x1f')]['where']||null:null,'attributes':_0x569b7f['options']?_0x569b7f[_0xbb5e('0x1f')][_0xbb5e('0x21')]||null:null,'include':_0x569b7f['options']?_0x569b7f['options'][_0xbb5e('0x23')]?_['map'](_0x569b7f[_0xbb5e('0x1f')][_0xbb5e('0x23')],function(_0x3282b9){return{'model':db[_0x3282b9['model']],'as':_0x3282b9['as'],'attributes':_0x3282b9['attributes'],'include':_0x3282b9[_0xbb5e('0x23')]?_[_0xbb5e('0x24')](_0x3282b9[_0xbb5e('0x23')],function(_0x355767){return{'model':db[_0x355767['model']],'as':_0x355767['as'],'attributes':_0x355767[_0xbb5e('0x21')],'include':_0x355767['include']?_[_0xbb5e('0x24')](_0x355767[_0xbb5e('0x23')],function(_0x330649){return{'model':db[_0x330649[_0xbb5e('0x25')]],'as':_0x330649['as'],'attributes':_0x330649[_0xbb5e('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb5e('0x10')](function(_0x526501){logger[_0xbb5e('0x11')]('ShowMailQueue',_0x569b7f);logger[_0xbb5e('0x14')](_0xbb5e('0x26'),_0x569b7f,JSON[_0xbb5e('0x16')](_0x526501));_0x3aa7bb(_0x526501);})[_0xbb5e('0x1b')](function(_0x315a9c){logger[_0xbb5e('0x17')](_0xbb5e('0x26'),_0x315a9c[_0xbb5e('0x19')],_0x569b7f);_0x57e78f(_0xfbb76d[_0xbb5e('0x17')](0x1f4,_0x315a9c[_0xbb5e('0x19')]));});});}; \ No newline at end of file +var _0xe563=['map','model','ShowMailQueue','MailQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailQueue','options','raw','attributes','include'];(function(_0x3e5e03,_0x2fac27){var _0x45279e=function(_0xb0f1c8){while(--_0xb0f1c8){_0x3e5e03['push'](_0x3e5e03['shift']());}};_0x45279e(++_0x2fac27);}(_0xe563,0x125));var _0x3e56=function(_0x4b310e,_0x2079b3){_0x4b310e=_0x4b310e-0x0;var _0x2836be=_0xe563[_0x4b310e];return _0x2836be;};'use strict';var _=require(_0x3e56('0x0'));var util=require(_0x3e56('0x1'));var moment=require(_0x3e56('0x2'));var BPromise=require(_0x3e56('0x3'));var rs=require(_0x3e56('0x4'));var fs=require('fs');var Redis=require(_0x3e56('0x5'));var db=require(_0x3e56('0x6'))['db'];var utils=require(_0x3e56('0x7'));var logger=require(_0x3e56('0x8'))(_0x3e56('0x9'));var config=require('../../config/environment');var jayson=require(_0x3e56('0xa'));var client=jayson['client'][_0x3e56('0xb')]({'port':0x232a});config[_0x3e56('0xc')]=_[_0x3e56('0xd')](config[_0x3e56('0xc')],{'host':_0x3e56('0xe'),'port':0x18eb});var socket=require(_0x3e56('0xf'))(new Redis(config[_0x3e56('0xc')]));require(_0x3e56('0x10'))[_0x3e56('0x11')](socket);function respondWithRpcPromise(_0xf6db69,_0xac076d,_0x4b3a69){return new BPromise(function(_0x3d5dfc,_0x43d0c1){return client[_0x3e56('0x12')](_0xf6db69,_0x4b3a69)[_0x3e56('0x13')](function(_0x35e7d6){logger[_0x3e56('0x14')](_0x3e56('0x15'),_0xac076d,_0x3e56('0x16'));logger[_0x3e56('0x17')](_0x3e56('0x18'),_0xac076d,_0x3e56('0x16'),JSON[_0x3e56('0x19')](_0x35e7d6));if(_0x35e7d6['error']){if(_0x35e7d6[_0x3e56('0x1a')][_0x3e56('0x1b')]===0x1f4){logger['error'](_0x3e56('0x15'),_0xac076d,_0x35e7d6[_0x3e56('0x1a')][_0x3e56('0x1c')]);return _0x43d0c1(_0x35e7d6[_0x3e56('0x1a')][_0x3e56('0x1c')]);}logger[_0x3e56('0x1a')](_0x3e56('0x15'),_0xac076d,_0x35e7d6[_0x3e56('0x1a')]['message']);return _0x3d5dfc(_0x35e7d6[_0x3e56('0x1a')][_0x3e56('0x1c')]);}else{logger['info'](_0x3e56('0x15'),_0xac076d,_0x3e56('0x16'));_0x3d5dfc(_0x35e7d6['result'][_0x3e56('0x1c')]);}})[_0x3e56('0x1d')](function(_0x5984e4){logger[_0x3e56('0x1a')](_0x3e56('0x15'),_0xac076d,_0x5984e4);_0x43d0c1(_0x5984e4);});});}exports[_0x3e56('0x1e')]=function(_0x27893f){var _0x15fe0c=this;return new Promise(function(_0x42c6d4,_0x1d2ec7){return db['MailQueue']['findAll']({'raw':_0x27893f[_0x3e56('0x1f')]?_0x27893f[_0x3e56('0x1f')][_0x3e56('0x20')]===undefined?!![]:![]:!![],'where':_0x27893f['options']?_0x27893f[_0x3e56('0x1f')]['where']||null:null,'attributes':_0x27893f[_0x3e56('0x1f')]?_0x27893f[_0x3e56('0x1f')][_0x3e56('0x21')]||null:null,'limit':_0x27893f[_0x3e56('0x1f')]?_0x27893f[_0x3e56('0x1f')]['limit']||null:null,'include':_0x27893f[_0x3e56('0x1f')]?_0x27893f[_0x3e56('0x1f')][_0x3e56('0x22')]?_[_0x3e56('0x23')](_0x27893f[_0x3e56('0x1f')][_0x3e56('0x22')],function(_0x3bfdcc){return{'model':db[_0x3bfdcc[_0x3e56('0x24')]],'as':_0x3bfdcc['as'],'attributes':_0x3bfdcc[_0x3e56('0x21')],'include':_0x3bfdcc[_0x3e56('0x22')]?_['map'](_0x3bfdcc['include'],function(_0x3614c9){return{'model':db[_0x3614c9[_0x3e56('0x24')]],'as':_0x3614c9['as'],'attributes':_0x3614c9['attributes'],'include':_0x3614c9[_0x3e56('0x22')]?_['map'](_0x3614c9[_0x3e56('0x22')],function(_0x2aafab){return{'model':db[_0x2aafab[_0x3e56('0x24')]],'as':_0x2aafab['as'],'attributes':_0x2aafab[_0x3e56('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3e56('0x13')](function(_0x1dd9f1){logger['info'](_0x3e56('0x1e'),_0x27893f);logger[_0x3e56('0x17')](_0x3e56('0x1e'),_0x27893f,JSON['stringify'](_0x1dd9f1));_0x42c6d4(_0x1dd9f1);})[_0x3e56('0x1d')](function(_0x54587b){logger[_0x3e56('0x1a')](_0x3e56('0x1e'),_0x54587b[_0x3e56('0x1c')],_0x27893f);_0x1d2ec7(_0x15fe0c[_0x3e56('0x1a')](0x1f4,_0x54587b[_0x3e56('0x1c')]));});});};exports[_0x3e56('0x25')]=function(_0x49a77c){var _0x479b2b=this;return new Promise(function(_0x5b85bf,_0x44ee41){return db[_0x3e56('0x26')][_0x3e56('0x27')]({'raw':_0x49a77c[_0x3e56('0x1f')]?_0x49a77c['options'][_0x3e56('0x20')]===undefined?!![]:![]:!![],'where':_0x49a77c[_0x3e56('0x1f')]?_0x49a77c[_0x3e56('0x1f')][_0x3e56('0x28')]||null:null,'attributes':_0x49a77c['options']?_0x49a77c[_0x3e56('0x1f')][_0x3e56('0x21')]||null:null,'include':_0x49a77c[_0x3e56('0x1f')]?_0x49a77c[_0x3e56('0x1f')]['include']?_[_0x3e56('0x23')](_0x49a77c[_0x3e56('0x1f')][_0x3e56('0x22')],function(_0x3bb84c){return{'model':db[_0x3bb84c[_0x3e56('0x24')]],'as':_0x3bb84c['as'],'attributes':_0x3bb84c[_0x3e56('0x21')],'include':_0x3bb84c['include']?_[_0x3e56('0x23')](_0x3bb84c['include'],function(_0xeacc06){return{'model':db[_0xeacc06[_0x3e56('0x24')]],'as':_0xeacc06['as'],'attributes':_0xeacc06[_0x3e56('0x21')],'include':_0xeacc06[_0x3e56('0x22')]?_[_0x3e56('0x23')](_0xeacc06[_0x3e56('0x22')],function(_0x4f71c1){return{'model':db[_0x4f71c1[_0x3e56('0x24')]],'as':_0x4f71c1['as'],'attributes':_0x4f71c1['attributes']};}):[]};}):[]};}):[]:[]})[_0x3e56('0x13')](function(_0x4675bf){logger[_0x3e56('0x14')](_0x3e56('0x25'),_0x49a77c);logger[_0x3e56('0x17')](_0x3e56('0x25'),_0x49a77c,JSON[_0x3e56('0x19')](_0x4675bf));_0x5b85bf(_0x4675bf);})[_0x3e56('0x1d')](function(_0x51d207){logger[_0x3e56('0x1a')](_0x3e56('0x25'),_0x51d207[_0x3e56('0x1c')],_0x49a77c);_0x44ee41(_0x479b2b['error'](0x1f4,_0x51d207['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 47ebbc4..f4964eb 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 _0xb574=['update','emit','removeListener','mailQueue:','./mailQueue.events','save'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xb574,0x106));var _0x4b57=function(_0xb39c8b,_0x380979){_0xb39c8b=_0xb39c8b-0x0;var _0x556ec1=_0xb574[_0xb39c8b];return _0x556ec1;};'use strict';var MailQueueEvents=require(_0x4b57('0x0'));var events=[_0x4b57('0x1'),'remove',_0x4b57('0x2')];function createListener(_0x3d351b,_0x5a4911){return function(_0x413f1d){_0x5a4911[_0x4b57('0x3')](_0x3d351b,_0x413f1d);};}function removeListener(_0x168524,_0x919851){return function(){MailQueueEvents[_0x4b57('0x4')](_0x168524,_0x919851);};}exports['register']=function(_0x4eb019){for(var _0x1c97e5=0x0,_0x4a4a0f=events['length'];_0x1c97e5<_0x4a4a0f;_0x1c97e5++){var _0x4b2d65=events[_0x1c97e5];var _0x548ee8=createListener(_0x4b57('0x5')+_0x4b2d65,_0x4eb019);MailQueueEvents['on'](_0x4b2d65,_0x548ee8);}}; \ No newline at end of file +var _0x2357=['./mailQueue.events','save','update','emit','removeListener','register','length','mailQueue:'];(function(_0xb61562,_0x1c8d99){var _0x4f73c0=function(_0x2445bd){while(--_0x2445bd){_0xb61562['push'](_0xb61562['shift']());}};_0x4f73c0(++_0x1c8d99);}(_0x2357,0x68));var _0x7235=function(_0x2b7c3c,_0x5cb659){_0x2b7c3c=_0x2b7c3c-0x0;var _0x59166c=_0x2357[_0x2b7c3c];return _0x59166c;};'use strict';var MailQueueEvents=require(_0x7235('0x0'));var events=[_0x7235('0x1'),'remove',_0x7235('0x2')];function createListener(_0x218b79,_0xdff686){return function(_0x5e3532){_0xdff686[_0x7235('0x3')](_0x218b79,_0x5e3532);};}function removeListener(_0x5be8ce,_0x3b710f){return function(){MailQueueEvents[_0x7235('0x4')](_0x5be8ce,_0x3b710f);};}exports[_0x7235('0x5')]=function(_0x34202b){for(var _0x3d601c=0x0,_0x31aecb=events[_0x7235('0x6')];_0x3d601c<_0x31aecb;_0x3d601c++){var _0xa9e1a8=events[_0x3d601c];var _0x9c6989=createListener(_0x7235('0x7')+_0xa9e1a8,_0x34202b);MailQueueEvents['on'](_0xa9e1a8,_0x9c6989);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 4b506ab..6b5aa0a 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 _0xfa7a=['show','post','create','put','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x4fe7e9,_0x8fdd7e){var _0x5eec06=function(_0x335639){while(--_0x335639){_0x4fe7e9['push'](_0x4fe7e9['shift']());}};_0x5eec06(++_0x8fdd7e);}(_0xfa7a,0xee));var _0xafa7=function(_0x5cfdae,_0x1104e0){_0x5cfdae=_0x5cfdae-0x0;var _0x4170bb=_0xfa7a[_0x5cfdae];return _0x4170bb;};'use strict';var multer=require(_0xafa7('0x0'));var util=require(_0xafa7('0x1'));var path=require(_0xafa7('0x2'));var timeout=require('connect-timeout');var express=require(_0xafa7('0x3'));var router=express['Router']();var fs_extra=require(_0xafa7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xafa7('0x5'));var config=require(_0xafa7('0x6'));var controller=require(_0xafa7('0x7'));router[_0xafa7('0x8')]('/',auth[_0xafa7('0x9')](),controller[_0xafa7('0xa')]);router[_0xafa7('0x8')](_0xafa7('0xb'),auth[_0xafa7('0x9')](),controller[_0xafa7('0xc')]);router[_0xafa7('0x8')](_0xafa7('0xd'),auth[_0xafa7('0x9')](),controller[_0xafa7('0xe')]);router[_0xafa7('0xf')]('/',auth[_0xafa7('0x9')](),controller[_0xafa7('0x10')]);router[_0xafa7('0x11')]('/:id',auth[_0xafa7('0x9')](),controller['update']);router[_0xafa7('0x12')](_0xafa7('0xd'),auth[_0xafa7('0x9')](),controller[_0xafa7('0x13')]);module[_0xafa7('0x14')]=router; \ No newline at end of file +var _0xd61b=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x502a1c,_0x3c8a0f){var _0xf4aef7=function(_0x5a15f7){while(--_0x5a15f7){_0x502a1c['push'](_0x502a1c['shift']());}};_0xf4aef7(++_0x3c8a0f);}(_0xd61b,0x13d));var _0xbd61=function(_0x6b23f3,_0x4189c9){_0x6b23f3=_0x6b23f3-0x0;var _0x473e8f=_0xd61b[_0x6b23f3];return _0x473e8f;};'use strict';var multer=require(_0xbd61('0x0'));var util=require(_0xbd61('0x1'));var path=require(_0xbd61('0x2'));var timeout=require(_0xbd61('0x3'));var express=require(_0xbd61('0x4'));var router=express[_0xbd61('0x5')]();var fs_extra=require(_0xbd61('0x6'));var auth=require(_0xbd61('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xbd61('0x8'));var controller=require('./mailQueueReport.controller');router[_0xbd61('0x9')]('/',auth[_0xbd61('0xa')](),controller[_0xbd61('0xb')]);router[_0xbd61('0x9')](_0xbd61('0xc'),auth[_0xbd61('0xa')](),controller[_0xbd61('0xd')]);router[_0xbd61('0x9')]('/:id',auth[_0xbd61('0xa')](),controller[_0xbd61('0xe')]);router[_0xbd61('0xf')]('/',auth['isAuthenticated'](),controller[_0xbd61('0x10')]);router[_0xbd61('0x11')](_0xbd61('0x12'),auth[_0xbd61('0xa')](),controller[_0xbd61('0x13')]);router[_0xbd61('0x14')](_0xbd61('0x12'),auth[_0xbd61('0xa')](),controller[_0xbd61('0x15')]);module[_0xbd61('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 0a79b84..e3119cb 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 _0x4725=['moment','sequelize','exports','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4725,0xdc));var _0x5472=function(_0x498e42,_0x2dee3c){_0x498e42=_0x498e42-0x0;var _0x1abbcf=_0x4725[_0x498e42];return _0x1abbcf;};'use strict';var moment=require(_0x5472('0x0'));var Sequelize=require(_0x5472('0x1'));module[_0x5472('0x2')]={'uniqueid':{'type':Sequelize[_0x5472('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x5472('0x3')]},'joinAt':{'type':Sequelize[_0x5472('0x4')]},'leaveAt':{'type':Sequelize[_0x5472('0x4')]},'acceptAt':{'type':Sequelize[_0x5472('0x4')]},'exitAt':{'type':Sequelize[_0x5472('0x4')]},'reason':{'type':Sequelize[_0x5472('0x3')]}}; \ No newline at end of file +var _0x7627=['DATE','exports','STRING'];(function(_0x55ba5b,_0x18ca7e){var _0x2fe85f=function(_0x33fdd3){while(--_0x33fdd3){_0x55ba5b['push'](_0x55ba5b['shift']());}};_0x2fe85f(++_0x18ca7e);}(_0x7627,0x172));var _0x7762=function(_0x9e368,_0x5c4a23){_0x9e368=_0x9e368-0x0;var _0x360b8c=_0x7627[_0x9e368];return _0x360b8c;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x7762('0x0')]={'uniqueid':{'type':Sequelize[_0x7762('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x7762('0x1')]},'joinAt':{'type':Sequelize[_0x7762('0x2')]},'leaveAt':{'type':Sequelize[_0x7762('0x2')]},'acceptAt':{'type':Sequelize[_0x7762('0x2')]},'exitAt':{'type':Sequelize[_0x7762('0x2')]},'reason':{'type':Sequelize[_0x7762('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 20436c2..b4f4167 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 _0xba34=['../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','MailQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x303064,_0x12f0c2){var _0x5a1d3d=function(_0x5b9d81){while(--_0x5b9d81){_0x303064['push'](_0x303064['shift']());}};_0x5a1d3d(++_0x12f0c2);}(_0xba34,0x119));var _0x4ba3=function(_0x3699b0,_0x15eddf){_0x3699b0=_0x3699b0-0x0;var _0x50d016=_0xba34[_0x3699b0];return _0x50d016;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1073d4,_0x52f55c){_0x52f55c=_0x52f55c||0xcc;return function(_0x256f02){if(_0x256f02){return _0x1073d4[_0x4ba3('0x19')](_0x52f55c);}return _0x1073d4[_0x4ba3('0x1a')](_0x52f55c)[_0x4ba3('0x1b')]();};}function respondWithResult(_0x2bc796,_0x3d2ace){_0x3d2ace=_0x3d2ace||0xc8;return function(_0x3a74f7){if(_0x3a74f7){return _0x2bc796[_0x4ba3('0x1a')](_0x3d2ace)[_0x4ba3('0x1c')](_0x3a74f7);}};}function respondWithFilteredResult(_0x401366,_0x36638b){return function(_0x301359){if(_0x301359){var _0x29a9d1=typeof _0x36638b[_0x4ba3('0x1d')]===_0x4ba3('0x1e')&&typeof _0x36638b[_0x4ba3('0x1f')]==='undefined';var _0x382fd0=_0x301359[_0x4ba3('0x20')];var _0x5ff7ce=_0x29a9d1?0x0:_0x36638b[_0x4ba3('0x1d')];var _0x556290=_0x29a9d1?_0x301359[_0x4ba3('0x20')]:_0x36638b[_0x4ba3('0x1d')]+_0x36638b[_0x4ba3('0x1f')];var _0x1e2ce5;if(_0x556290>=_0x382fd0){_0x556290=_0x382fd0;_0x1e2ce5=0xc8;}else{_0x1e2ce5=0xce;}_0x401366[_0x4ba3('0x1a')](_0x1e2ce5);return _0x401366[_0x4ba3('0x21')]('Content-Range',_0x5ff7ce+'-'+_0x556290+'/'+_0x382fd0)['json'](_0x301359);}return null;};}function patchUpdates(_0x2278b0){return function(_0x579d9f){try{jsonpatch[_0x4ba3('0x22')](_0x579d9f,_0x2278b0,!![]);}catch(_0x163967){return BPromise[_0x4ba3('0x23')](_0x163967);}return _0x579d9f[_0x4ba3('0x24')]();};}function saveUpdates(_0x46f1f5,_0x278a23){return function(_0x4a0823){if(_0x4a0823){return _0x4a0823[_0x4ba3('0x25')](_0x46f1f5)[_0x4ba3('0x26')](function(_0x5c28f9){return _0x5c28f9;});}return null;};}function removeEntity(_0x28bb3d,_0x4ffe39){return function(_0x1ae4de){if(_0x1ae4de){return _0x1ae4de[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){_0x28bb3d[_0x4ba3('0x1a')](0xcc)[_0x4ba3('0x1b')]();});}};}function handleEntityNotFound(_0xe29a49,_0x159596){return function(_0xe1f7d2){if(!_0xe1f7d2){_0xe29a49[_0x4ba3('0x19')](0x194);}return _0xe1f7d2;};}function handleError(_0x2e67a0,_0x50c729){_0x50c729=_0x50c729||0x1f4;return function(_0x252f37){logger[_0x4ba3('0x28')](_0x252f37[_0x4ba3('0x29')]);if(_0x252f37['name']){delete _0x252f37[_0x4ba3('0x2a')];}_0x2e67a0[_0x4ba3('0x1a')](_0x50c729)[_0x4ba3('0x2b')](_0x252f37);};}exports['index']=function(_0x10cae6,_0x843276){var _0x34ecb4={},_0x22394d={},_0x4a339e={'count':0x0,'rows':[]};var _0x590108=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2d')][_0x4ba3('0x2e')],function(_0x19f039){return{'name':_0x19f039[_0x4ba3('0x2f')],'type':_0x19f039[_0x4ba3('0x30')]['key']};});_0x22394d[_0x4ba3('0x31')]=_[_0x4ba3('0x2c')](_0x590108,_0x4ba3('0x2a'));_0x22394d[_0x4ba3('0x32')]=_[_0x4ba3('0x33')](_0x10cae6[_0x4ba3('0x32')]);_0x22394d[_0x4ba3('0x34')]=_[_0x4ba3('0x35')](_0x22394d[_0x4ba3('0x31')],_0x22394d[_0x4ba3('0x32')]);_0x34ecb4['attributes']=_['intersection'](_0x22394d['model'],qs[_0x4ba3('0x36')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x36')]));_0x34ecb4[_0x4ba3('0x37')]=_0x34ecb4[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x34ecb4[_0x4ba3('0x37')]:_0x22394d[_0x4ba3('0x31')];if(!_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x39')](_0x4ba3('0x3a'))){_0x34ecb4[_0x4ba3('0x1f')]=qs['limit'](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x1f')]);_0x34ecb4[_0x4ba3('0x1d')]=qs['offset'](_0x10cae6[_0x4ba3('0x32')]['offset']);}_0x34ecb4[_0x4ba3('0x3b')]=qs[_0x4ba3('0x3c')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x3c')]);_0x34ecb4[_0x4ba3('0x3d')]=qs[_0x4ba3('0x34')](_['pick'](_0x10cae6[_0x4ba3('0x32')],_0x22394d[_0x4ba3('0x34')]),_0x590108);if(_0x10cae6[_0x4ba3('0x32')]['filter']){_0x34ecb4[_0x4ba3('0x3d')]=_[_0x4ba3('0x3e')](_0x34ecb4['where'],{'$or':_[_0x4ba3('0x2c')](_0x590108,function(_0x503777){if(_0x503777['type']!==_0x4ba3('0x3f')){var _0x1acc74={};_0x1acc74[_0x503777[_0x4ba3('0x2a')]]={'$like':'%'+_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x40')]+'%'};return _0x1acc74;}})});}_0x34ecb4=_['merge']({},_0x34ecb4,_0x10cae6[_0x4ba3('0x41')]);var _0x10e4b5={'where':_0x34ecb4[_0x4ba3('0x3d')]};return db[_0x4ba3('0x2d')][_0x4ba3('0x20')](_0x10e4b5)[_0x4ba3('0x26')](function(_0x349af4){_0x4a339e[_0x4ba3('0x20')]=_0x349af4;if(_0x10cae6['query'][_0x4ba3('0x42')]){_0x34ecb4[_0x4ba3('0x43')]=[{'all':!![]}];}return db[_0x4ba3('0x2d')][_0x4ba3('0x44')](_0x34ecb4);})[_0x4ba3('0x26')](function(_0x25b2c9){_0x4a339e[_0x4ba3('0x45')]=_0x25b2c9;return _0x4a339e;})[_0x4ba3('0x26')](respondWithFilteredResult(_0x843276,_0x34ecb4))[_0x4ba3('0x46')](handleError(_0x843276,null));};exports[_0x4ba3('0x47')]=function(_0x3b9a0a,_0x1c58d2){var _0x1d031b={'raw':!![],'where':{'id':_0x3b9a0a['params']['id']}},_0x28b649={};_0x28b649['model']=_['keys'](db['MailQueueReport']['rawAttributes']);_0x28b649[_0x4ba3('0x32')]=_['keys'](_0x3b9a0a[_0x4ba3('0x32')]);_0x28b649['filters']=_[_0x4ba3('0x35')](_0x28b649[_0x4ba3('0x31')],_0x28b649[_0x4ba3('0x32')]);_0x1d031b[_0x4ba3('0x37')]=_[_0x4ba3('0x35')](_0x28b649['model'],qs[_0x4ba3('0x36')](_0x3b9a0a['query'][_0x4ba3('0x36')]));_0x1d031b['attributes']=_0x1d031b[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x1d031b[_0x4ba3('0x37')]:_0x28b649[_0x4ba3('0x31')];if(_0x3b9a0a[_0x4ba3('0x32')][_0x4ba3('0x42')]){_0x1d031b[_0x4ba3('0x43')]=[{'all':!![]}];}_0x1d031b=_['merge']({},_0x1d031b,_0x3b9a0a[_0x4ba3('0x41')]);return db[_0x4ba3('0x2d')][_0x4ba3('0x48')](_0x1d031b)[_0x4ba3('0x26')](handleEntityNotFound(_0x1c58d2,null))[_0x4ba3('0x26')](respondWithResult(_0x1c58d2,null))['catch'](handleError(_0x1c58d2,null));};exports['create']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2d')]['create'](_0xa4bbb2[_0x4ba3('0x49')],{})[_0x4ba3('0x26')](respondWithResult(_0x1fe115,0xc9))[_0x4ba3('0x46')](handleError(_0x1fe115,null));};exports['update']=function(_0x47f588,_0x34dc04){if(_0x47f588['body']['id']){delete _0x47f588[_0x4ba3('0x49')]['id'];}return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x47f588[_0x4ba3('0x4a')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x34dc04,null))[_0x4ba3('0x26')](saveUpdates(_0x47f588['body'],null))[_0x4ba3('0x26')](respondWithResult(_0x34dc04,null))[_0x4ba3('0x46')](handleError(_0x34dc04,null));};exports['destroy']=function(_0x325475,_0x12ae6f){return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x325475[_0x4ba3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12ae6f,null))[_0x4ba3('0x26')](removeEntity(_0x12ae6f,null))[_0x4ba3('0x46')](handleError(_0x12ae6f,null));};exports['describe']=function(_0x43f820,_0x19d70f){return db[_0x4ba3('0x2d')][_0x4ba3('0x4b')]()[_0x4ba3('0x26')](respondWithResult(_0x19d70f,null))[_0x4ba3('0x46')](handleError(_0x19d70f,null));}; \ No newline at end of file +var _0x4325=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','MailQueueReport','findAll','catch','show','params','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x4325,0x1da));var _0x5432=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4325[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x5432('0x0'));var rimraf=require(_0x5432('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5432('0x2'));var rp=require(_0x5432('0x3'));var moment=require(_0x5432('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5432('0x5'));var path=require(_0x5432('0x6'));var sox=require(_0x5432('0x7'));var csv=require('to-csv');var ejs=require(_0x5432('0x8'));var fs=require('fs');var fs_extra=require(_0x5432('0x9'));var _=require('lodash');var squel=require(_0x5432('0xa'));var crypto=require('crypto');var jsforce=require(_0x5432('0xb'));var deskjs=require(_0x5432('0xc'));var toCsv=require(_0x5432('0xd'));var querystring=require(_0x5432('0xe'));var Papa=require(_0x5432('0xf'));var Redis=require('ioredis');var authService=require(_0x5432('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5432('0x11'));var hardwareService=require(_0x5432('0x12'));var logger=require(_0x5432('0x13'))(_0x5432('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5432('0x15'));var db=require(_0x5432('0x16'))['db'];function respondWithStatusCode(_0x5366a0,_0x10a289){_0x10a289=_0x10a289||0xcc;return function(_0x111c54){if(_0x111c54){return _0x5366a0[_0x5432('0x17')](_0x10a289);}return _0x5366a0[_0x5432('0x18')](_0x10a289)[_0x5432('0x19')]();};}function respondWithResult(_0x1a084d,_0x54f41a){_0x54f41a=_0x54f41a||0xc8;return function(_0x5617ce){if(_0x5617ce){return _0x1a084d[_0x5432('0x18')](_0x54f41a)[_0x5432('0x1a')](_0x5617ce);}};}function respondWithFilteredResult(_0x3859d1,_0x364152){return function(_0x9d2023){if(_0x9d2023){var _0x11db3c=typeof _0x364152['offset']===_0x5432('0x1b')&&typeof _0x364152['limit']===_0x5432('0x1b');var _0x3de07a=_0x9d2023[_0x5432('0x1c')];var _0x32fe60=_0x11db3c?0x0:_0x364152[_0x5432('0x1d')];var _0x5f011f=_0x11db3c?_0x9d2023[_0x5432('0x1c')]:_0x364152[_0x5432('0x1d')]+_0x364152[_0x5432('0x1e')];var _0x2bfe04;if(_0x5f011f>=_0x3de07a){_0x5f011f=_0x3de07a;_0x2bfe04=0xc8;}else{_0x2bfe04=0xce;}_0x3859d1[_0x5432('0x18')](_0x2bfe04);return _0x3859d1[_0x5432('0x1f')](_0x5432('0x20'),_0x32fe60+'-'+_0x5f011f+'/'+_0x3de07a)['json'](_0x9d2023);}return null;};}function patchUpdates(_0x66911a){return function(_0x29cde7){try{jsonpatch[_0x5432('0x21')](_0x29cde7,_0x66911a,!![]);}catch(_0xa6c864){return BPromise[_0x5432('0x22')](_0xa6c864);}return _0x29cde7['save']();};}function saveUpdates(_0x5901e2,_0x4d09cd){return function(_0x61827e){if(_0x61827e){return _0x61827e[_0x5432('0x23')](_0x5901e2)[_0x5432('0x24')](function(_0x1f4870){return _0x1f4870;});}return null;};}function removeEntity(_0x4af9f6,_0x4af5f4){return function(_0x3e0b66){if(_0x3e0b66){return _0x3e0b66[_0x5432('0x25')]()['then'](function(){_0x4af9f6[_0x5432('0x18')](0xcc)[_0x5432('0x19')]();});}};}function handleEntityNotFound(_0x637582,_0x4b6ea5){return function(_0xd9928a){if(!_0xd9928a){_0x637582[_0x5432('0x17')](0x194);}return _0xd9928a;};}function handleError(_0xe7eda2,_0x520da1){_0x520da1=_0x520da1||0x1f4;return function(_0x4ab09d){logger[_0x5432('0x26')](_0x4ab09d[_0x5432('0x27')]);if(_0x4ab09d['name']){delete _0x4ab09d[_0x5432('0x28')];}_0xe7eda2[_0x5432('0x18')](_0x520da1)[_0x5432('0x29')](_0x4ab09d);};}exports['index']=function(_0x29dc15,_0x5be867){var _0x4821be={},_0x6fc7f5={},_0x4a52ba={'count':0x0,'rows':[]};var _0x428141=_['map'](db['MailQueueReport'][_0x5432('0x2a')],function(_0x21735e){return{'name':_0x21735e[_0x5432('0x2b')],'type':_0x21735e['type'][_0x5432('0x2c')]};});_0x6fc7f5[_0x5432('0x2d')]=_[_0x5432('0x2e')](_0x428141,_0x5432('0x28'));_0x6fc7f5[_0x5432('0x2f')]=_[_0x5432('0x30')](_0x29dc15[_0x5432('0x2f')]);_0x6fc7f5[_0x5432('0x31')]=_[_0x5432('0x32')](_0x6fc7f5['model'],_0x6fc7f5['query']);_0x4821be[_0x5432('0x33')]=_[_0x5432('0x32')](_0x6fc7f5[_0x5432('0x2d')],qs[_0x5432('0x34')](_0x29dc15[_0x5432('0x2f')]['fields']));_0x4821be[_0x5432('0x33')]=_0x4821be['attributes'][_0x5432('0x35')]?_0x4821be[_0x5432('0x33')]:_0x6fc7f5[_0x5432('0x2d')];if(!_0x29dc15[_0x5432('0x2f')][_0x5432('0x36')](_0x5432('0x37'))){_0x4821be['limit']=qs[_0x5432('0x1e')](_0x29dc15[_0x5432('0x2f')][_0x5432('0x1e')]);_0x4821be[_0x5432('0x1d')]=qs['offset'](_0x29dc15[_0x5432('0x2f')][_0x5432('0x1d')]);}_0x4821be[_0x5432('0x38')]=qs[_0x5432('0x39')](_0x29dc15[_0x5432('0x2f')][_0x5432('0x39')]);_0x4821be[_0x5432('0x3a')]=qs[_0x5432('0x31')](_[_0x5432('0x3b')](_0x29dc15[_0x5432('0x2f')],_0x6fc7f5[_0x5432('0x31')]),_0x428141);if(_0x29dc15[_0x5432('0x2f')][_0x5432('0x3c')]){_0x4821be[_0x5432('0x3a')]=_['merge'](_0x4821be[_0x5432('0x3a')],{'$or':_['map'](_0x428141,function(_0x6f5006){if(_0x6f5006[_0x5432('0x3d')]!==_0x5432('0x3e')){var _0x1a5561={};_0x1a5561[_0x6f5006['name']]={'$like':'%'+_0x29dc15['query']['filter']+'%'};return _0x1a5561;}})});}_0x4821be=_[_0x5432('0x3f')]({},_0x4821be,_0x29dc15[_0x5432('0x40')]);var _0x139d0a={'where':_0x4821be[_0x5432('0x3a')]};return db['MailQueueReport'][_0x5432('0x1c')](_0x139d0a)[_0x5432('0x24')](function(_0x3cd343){_0x4a52ba['count']=_0x3cd343;if(_0x29dc15[_0x5432('0x2f')][_0x5432('0x41')]){_0x4821be['include']=[{'all':!![]}];}return db[_0x5432('0x42')][_0x5432('0x43')](_0x4821be);})['then'](function(_0x23f8f4){_0x4a52ba['rows']=_0x23f8f4;return _0x4a52ba;})[_0x5432('0x24')](respondWithFilteredResult(_0x5be867,_0x4821be))[_0x5432('0x44')](handleError(_0x5be867,null));};exports[_0x5432('0x45')]=function(_0x11c7f2,_0x5cf59a){var _0x9cfb8b={'raw':!![],'where':{'id':_0x11c7f2[_0x5432('0x46')]['id']}},_0x4b93b4={};_0x4b93b4[_0x5432('0x2d')]=_[_0x5432('0x30')](db[_0x5432('0x42')][_0x5432('0x2a')]);_0x4b93b4[_0x5432('0x2f')]=_[_0x5432('0x30')](_0x11c7f2['query']);_0x4b93b4[_0x5432('0x31')]=_[_0x5432('0x32')](_0x4b93b4[_0x5432('0x2d')],_0x4b93b4[_0x5432('0x2f')]);_0x9cfb8b[_0x5432('0x33')]=_[_0x5432('0x32')](_0x4b93b4[_0x5432('0x2d')],qs['fields'](_0x11c7f2[_0x5432('0x2f')][_0x5432('0x34')]));_0x9cfb8b[_0x5432('0x33')]=_0x9cfb8b[_0x5432('0x33')][_0x5432('0x35')]?_0x9cfb8b['attributes']:_0x4b93b4[_0x5432('0x2d')];if(_0x11c7f2['query'][_0x5432('0x41')]){_0x9cfb8b[_0x5432('0x47')]=[{'all':!![]}];}_0x9cfb8b=_['merge']({},_0x9cfb8b,_0x11c7f2[_0x5432('0x40')]);return db['MailQueueReport'][_0x5432('0x48')](_0x9cfb8b)[_0x5432('0x24')](handleEntityNotFound(_0x5cf59a,null))['then'](respondWithResult(_0x5cf59a,null))['catch'](handleError(_0x5cf59a,null));};exports[_0x5432('0x49')]=function(_0xa971bd,_0x3718be){return db[_0x5432('0x42')][_0x5432('0x49')](_0xa971bd[_0x5432('0x4a')],{})[_0x5432('0x24')](respondWithResult(_0x3718be,0xc9))['catch'](handleError(_0x3718be,null));};exports[_0x5432('0x23')]=function(_0x14763c,_0x429da8){if(_0x14763c['body']['id']){delete _0x14763c['body']['id'];}return db['MailQueueReport']['find']({'where':{'id':_0x14763c[_0x5432('0x46')]['id']}})[_0x5432('0x24')](handleEntityNotFound(_0x429da8,null))[_0x5432('0x24')](saveUpdates(_0x14763c[_0x5432('0x4a')],null))[_0x5432('0x24')](respondWithResult(_0x429da8,null))['catch'](handleError(_0x429da8,null));};exports[_0x5432('0x25')]=function(_0xce691b,_0x7937f9){return db['MailQueueReport'][_0x5432('0x48')]({'where':{'id':_0xce691b[_0x5432('0x46')]['id']}})[_0x5432('0x24')](handleEntityNotFound(_0x7937f9,null))[_0x5432('0x24')](removeEntity(_0x7937f9,null))[_0x5432('0x44')](handleError(_0x7937f9,null));};exports['describe']=function(_0xbcf523,_0x5bbedb){return db[_0x5432('0x42')]['describe']()[_0x5432('0x24')](respondWithResult(_0x5bbedb,null))[_0x5432('0x44')](handleError(_0x5bbedb,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 1e2d572..b670062 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 _0xd8a5=['report_mail_queue','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport'];(function(_0x2b2c53,_0x4bcf9b){var _0x311ec2=function(_0x4a8e72){while(--_0x4a8e72){_0x2b2c53['push'](_0x2b2c53['shift']());}};_0x311ec2(++_0x4bcf9b);}(_0xd8a5,0x160));var _0x5d8a=function(_0x3ba508,_0x4991d7){_0x3ba508=_0x3ba508-0x0;var _0x55fcf5=_0xd8a5[_0x3ba508];return _0x55fcf5;};'use strict';var _=require(_0x5d8a('0x0'));var util=require('util');var logger=require(_0x5d8a('0x1'))(_0x5d8a('0x2'));var moment=require('moment');var BPromise=require(_0x5d8a('0x3'));var rp=require(_0x5d8a('0x4'));var fs=require('fs');var path=require(_0x5d8a('0x5'));var rimraf=require(_0x5d8a('0x6'));var config=require(_0x5d8a('0x7'));var attributes=require(_0x5d8a('0x8'));module[_0x5d8a('0x9')]=function(_0x38eaa5,_0x1ef405){return _0x38eaa5[_0x5d8a('0xa')](_0x5d8a('0xb'),attributes,{'tableName':_0x5d8a('0xc'),'paranoid':![],'indexes':[{'name':_0x5d8a('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5914=['report_mail_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport'];(function(_0x2181b1,_0x569637){var _0x530548=function(_0x4b31f1){while(--_0x4b31f1){_0x2181b1['push'](_0x2181b1['shift']());}};_0x530548(++_0x569637);}(_0x5914,0x198));var _0x4591=function(_0x1f0805,_0x913381){_0x1f0805=_0x1f0805-0x0;var _0x530750=_0x5914[_0x1f0805];return _0x530750;};'use strict';var _=require(_0x4591('0x0'));var util=require('util');var logger=require(_0x4591('0x1'))(_0x4591('0x2'));var moment=require(_0x4591('0x3'));var BPromise=require(_0x4591('0x4'));var rp=require(_0x4591('0x5'));var fs=require('fs');var path=require(_0x4591('0x6'));var rimraf=require(_0x4591('0x7'));var config=require('../../config/environment');var attributes=require(_0x4591('0x8'));module[_0x4591('0x9')]=function(_0x558d8d,_0x1e6bed){return _0x558d8d[_0x4591('0xa')](_0x4591('0xb'),attributes,{'tableName':_0x4591('0xc'),'paranoid':![],'indexes':[{'name':_0x4591('0xd'),'fields':[_0x4591('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 0f93af8..954c450 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4f517f,_0x397c41){var _0x3d1586=function(_0x1df0a8){while(--_0x1df0a8){_0x4f517f['push'](_0x4f517f['shift']());}};_0x3d1586(++_0x397c41);}(_0x1261,0x144));var _0x1126=function(_0xd27ded,_0x1164e2){_0xd27ded=_0xd27ded-0x0;var _0x5ef850=_0x1261[_0xd27ded];return _0x5ef850;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ 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(_0x15fab0,_0x416c7d){var _0x1b41a8=function(_0x30d165){while(--_0x30d165){_0x15fab0['push'](_0x15fab0['shift']());}};_0x1b41a8(++_0x416c7d);}(_0x2ef3,0xba));var _0x32ef=function(_0x590aaa,_0x4c22b3){_0x590aaa=_0x590aaa-0x0;var _0x1c6a84=_0x2ef3[_0x590aaa];return _0x1c6a84;};'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 665ce1b..f5e9726 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x361e06,_0x209107){var _0x40591e=function(_0x56d733){while(--_0x56d733){_0x361e06['push'](_0x361e06['shift']());}};_0x40591e(++_0x209107);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x122633,_0x22057b){var _0x2d02e5=function(_0x420024){while(--_0x420024){_0x122633['push'](_0x122633['shift']());}};_0x2d02e5(++_0x22057b);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index e6e8b86..379dc2a 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 _0x75a9=['sequelize','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x2b4379,_0x43f502){var _0xb9a7f=function(_0x5ad58d){while(--_0x5ad58d){_0x2b4379['push'](_0x2b4379['shift']());}};_0xb9a7f(++_0x43f502);}(_0x75a9,0x1ef));var _0x975a=function(_0x2400df,_0x389337){_0x2400df=_0x2400df-0x0;var _0x1ee6d6=_0x75a9[_0x2400df];return _0x1ee6d6;};'use strict';var Sequelize=require(_0x975a('0x0'));module['exports']={'description':{'type':Sequelize[_0x975a('0x1')]},'host':{'type':Sequelize[_0x975a('0x1')]},'authentication':{'type':Sequelize[_0x975a('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x975a('0x1')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x975a('0x3')]},'tls':{'type':Sequelize[_0x975a('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x975a('0x1')],'defaultValue':_0x975a('0x4')},'connTimeout':{'type':Sequelize[_0x975a('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x975a('0x1')]},'modernAuthentication':{'type':Sequelize[_0x975a('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xbeec=['STRING','INTEGER','BOOLEAN','INBOX','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbeec,0xa6));var _0xcbee=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbeec[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xcbee('0x0'));module[_0xcbee('0x1')]={'description':{'type':Sequelize[_0xcbee('0x2')]},'host':{'type':Sequelize[_0xcbee('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xcbee('0x2')]},'password':{'type':Sequelize[_0xcbee('0x2')]},'port':{'type':Sequelize[_0xcbee('0x3')]},'tls':{'type':Sequelize[_0xcbee('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xcbee('0x2')],'defaultValue':_0xcbee('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xcbee('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xcbee('0x2')]},'modernAuthentication':{'type':Sequelize[_0xcbee('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 3885943..d92e549 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 _0xb22d=['path','../../config/environment','exports','mail_servers_in','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0xe5b435,_0x568337){var _0x34d5de=function(_0x47bd9d){while(--_0x47bd9d){_0xe5b435['push'](_0xe5b435['shift']());}};_0x34d5de(++_0x568337);}(_0xb22d,0x13a));var _0xdb22=function(_0x596c43,_0x28647a){_0x596c43=_0x596c43-0x0;var _0x4e1315=_0xb22d[_0x596c43];return _0x4e1315;};'use strict';var _=require(_0xdb22('0x0'));var util=require(_0xdb22('0x1'));var logger=require(_0xdb22('0x2'))(_0xdb22('0x3'));var moment=require('moment');var BPromise=require(_0xdb22('0x4'));var rp=require(_0xdb22('0x5'));var fs=require('fs');var path=require(_0xdb22('0x6'));var rimraf=require('rimraf');var config=require(_0xdb22('0x7'));var attributes=require('./mailServerIn.attributes');module[_0xdb22('0x8')]=function(_0x5a94c6,_0x2a95f4){return _0x5a94c6['define']('MailServerIn',attributes,{'tableName':_0xdb22('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x663a=['exports','define','MailServerIn','mail_servers_in','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x4f5108,_0x46a54b){var _0x2d56ca=function(_0x5b3c1e){while(--_0x5b3c1e){_0x4f5108['push'](_0x4f5108['shift']());}};_0x2d56ca(++_0x46a54b);}(_0x663a,0x16c));var _0xa663=function(_0x377c36,_0x44d617){_0x377c36=_0x377c36-0x0;var _0x2300d0=_0x663a[_0x377c36];return _0x2300d0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa663('0x0'))(_0xa663('0x1'));var moment=require(_0xa663('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa663('0x3'));var rimraf=require(_0xa663('0x4'));var config=require(_0xa663('0x5'));var attributes=require('./mailServerIn.attributes');module[_0xa663('0x6')]=function(_0x3cd073,_0x583b19){return _0x3cd073[_0xa663('0x7')](_0xa663('0x8'),attributes,{'tableName':_0xa663('0x9'),'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 e1af6b4..525fa1a 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 _0xfb70=['result','catch','MailServerIn','options','raw','where','limit','map','include','model','attributes','GetMailServerIn','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5d9a8c,_0x3ab82f){var _0x4100c0=function(_0x4f79a1){while(--_0x4f79a1){_0x5d9a8c['push'](_0x5d9a8c['shift']());}};_0x4100c0(++_0x3ab82f);}(_0xfb70,0x150));var _0x0fb7=function(_0x1b0842,_0x210f4){_0x1b0842=_0x1b0842-0x0;var _0x5b5d98=_0xfb70[_0x1b0842];return _0x5b5d98;};'use strict';var _=require(_0x0fb7('0x0'));var util=require(_0x0fb7('0x1'));var moment=require(_0x0fb7('0x2'));var BPromise=require(_0x0fb7('0x3'));var rs=require(_0x0fb7('0x4'));var fs=require('fs');var Redis=require(_0x0fb7('0x5'));var db=require(_0x0fb7('0x6'))['db'];var utils=require(_0x0fb7('0x7'));var logger=require('../../config/logger')(_0x0fb7('0x8'));var config=require(_0x0fb7('0x9'));var jayson=require(_0x0fb7('0xa'));var client=jayson[_0x0fb7('0xb')][_0x0fb7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1737d1,_0x172099,_0x48643b){return new BPromise(function(_0xaca131,_0x3039b3){return client[_0x0fb7('0xd')](_0x1737d1,_0x48643b)[_0x0fb7('0xe')](function(_0x14db52){logger[_0x0fb7('0xf')](_0x0fb7('0x10'),_0x172099,_0x0fb7('0x11'));logger[_0x0fb7('0x12')](_0x0fb7('0x13'),_0x172099,_0x0fb7('0x11'),JSON[_0x0fb7('0x14')](_0x14db52));if(_0x14db52[_0x0fb7('0x15')]){if(_0x14db52[_0x0fb7('0x15')][_0x0fb7('0x16')]===0x1f4){logger[_0x0fb7('0x15')](_0x0fb7('0x10'),_0x172099,_0x14db52[_0x0fb7('0x15')][_0x0fb7('0x17')]);return _0x3039b3(_0x14db52[_0x0fb7('0x15')][_0x0fb7('0x17')]);}logger['error'](_0x0fb7('0x10'),_0x172099,_0x14db52[_0x0fb7('0x15')][_0x0fb7('0x17')]);return _0xaca131(_0x14db52[_0x0fb7('0x15')][_0x0fb7('0x17')]);}else{logger[_0x0fb7('0xf')](_0x0fb7('0x10'),_0x172099,'request\x20sent');_0xaca131(_0x14db52[_0x0fb7('0x18')][_0x0fb7('0x17')]);}})[_0x0fb7('0x19')](function(_0x44c80f){logger[_0x0fb7('0x15')](_0x0fb7('0x10'),_0x172099,_0x44c80f);_0x3039b3(_0x44c80f);});});}exports['GetMailServerIn']=function(_0x17eaf5){var _0x4ace36=this;return new Promise(function(_0x22d9f3,_0x5d0035){return db[_0x0fb7('0x1a')]['findAll']({'raw':_0x17eaf5[_0x0fb7('0x1b')]?_0x17eaf5[_0x0fb7('0x1b')][_0x0fb7('0x1c')]===undefined?!![]:![]:!![],'where':_0x17eaf5['options']?_0x17eaf5[_0x0fb7('0x1b')][_0x0fb7('0x1d')]||null:null,'attributes':_0x17eaf5[_0x0fb7('0x1b')]?_0x17eaf5[_0x0fb7('0x1b')]['attributes']||null:null,'limit':_0x17eaf5[_0x0fb7('0x1b')]?_0x17eaf5[_0x0fb7('0x1b')][_0x0fb7('0x1e')]||null:null,'include':_0x17eaf5[_0x0fb7('0x1b')]?_0x17eaf5[_0x0fb7('0x1b')]['include']?_[_0x0fb7('0x1f')](_0x17eaf5[_0x0fb7('0x1b')]['include'],function(_0x1e193a){return{'model':db[_0x1e193a['model']],'as':_0x1e193a['as'],'attributes':_0x1e193a['attributes'],'include':_0x1e193a['include']?_[_0x0fb7('0x1f')](_0x1e193a[_0x0fb7('0x20')],function(_0x5035a1){return{'model':db[_0x5035a1[_0x0fb7('0x21')]],'as':_0x5035a1['as'],'attributes':_0x5035a1[_0x0fb7('0x22')],'include':_0x5035a1[_0x0fb7('0x20')]?_[_0x0fb7('0x1f')](_0x5035a1[_0x0fb7('0x20')],function(_0x54024d){return{'model':db[_0x54024d['model']],'as':_0x54024d['as'],'attributes':_0x54024d[_0x0fb7('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0fb7('0xe')](function(_0x52eea9){logger[_0x0fb7('0xf')](_0x0fb7('0x23'),_0x17eaf5);logger[_0x0fb7('0x12')](_0x0fb7('0x23'),_0x17eaf5,JSON[_0x0fb7('0x14')](_0x52eea9));_0x22d9f3(_0x52eea9);})[_0x0fb7('0x19')](function(_0x159f21){logger[_0x0fb7('0x15')](_0x0fb7('0x23'),_0x159f21[_0x0fb7('0x17')],_0x17eaf5);_0x5d0035(_0x4ace36[_0x0fb7('0x15')](0x1f4,_0x159f21[_0x0fb7('0x17')]));});});}; \ No newline at end of file +var _0xec1c=['debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','catch','MailServerIn','findAll','options','where','attributes','include','map','model','GetMailServerIn','stringify','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent'];(function(_0x2f4926,_0x1b1087){var _0x5aefaf=function(_0x2819c2){while(--_0x2819c2){_0x2f4926['push'](_0x2f4926['shift']());}};_0x5aefaf(++_0x1b1087);}(_0xec1c,0x1c3));var _0xcec1=function(_0x115621,_0x341cde){_0x115621=_0x115621-0x0;var _0x5ef5ce=_0xec1c[_0x115621];return _0x5ef5ce;};'use strict';var _=require('lodash');var util=require(_0xcec1('0x0'));var moment=require(_0xcec1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcec1('0x2'));var db=require(_0xcec1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcec1('0x4'))('rpc');var config=require(_0xcec1('0x5'));var jayson=require(_0xcec1('0x6'));var client=jayson['client'][_0xcec1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x40682b,_0x2dac8e,_0x40c3dd){return new BPromise(function(_0x139832,_0x112347){return client[_0xcec1('0x8')](_0x40682b,_0x40c3dd)[_0xcec1('0x9')](function(_0x549f4a){logger[_0xcec1('0xa')](_0xcec1('0xb'),_0x2dac8e,_0xcec1('0xc'));logger[_0xcec1('0xd')](_0xcec1('0xe'),_0x2dac8e,'request\x20sent',JSON['stringify'](_0x549f4a));if(_0x549f4a[_0xcec1('0xf')]){if(_0x549f4a['error'][_0xcec1('0x10')]===0x1f4){logger['error'](_0xcec1('0xb'),_0x2dac8e,_0x549f4a[_0xcec1('0xf')][_0xcec1('0x11')]);return _0x112347(_0x549f4a[_0xcec1('0xf')][_0xcec1('0x11')]);}logger[_0xcec1('0xf')](_0xcec1('0xb'),_0x2dac8e,_0x549f4a[_0xcec1('0xf')][_0xcec1('0x11')]);return _0x139832(_0x549f4a['error'][_0xcec1('0x11')]);}else{logger['info'](_0xcec1('0xb'),_0x2dac8e,_0xcec1('0xc'));_0x139832(_0x549f4a['result']['message']);}})[_0xcec1('0x12')](function(_0x24ce7d){logger[_0xcec1('0xf')]('MailServerIn,\x20%s,\x20%s',_0x2dac8e,_0x24ce7d);_0x112347(_0x24ce7d);});});}exports['GetMailServerIn']=function(_0x2b741f){var _0x436fb9=this;return new Promise(function(_0x1f523c,_0x344a9b){return db[_0xcec1('0x13')][_0xcec1('0x14')]({'raw':_0x2b741f[_0xcec1('0x15')]?_0x2b741f[_0xcec1('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2b741f['options']?_0x2b741f[_0xcec1('0x15')][_0xcec1('0x16')]||null:null,'attributes':_0x2b741f[_0xcec1('0x15')]?_0x2b741f[_0xcec1('0x15')][_0xcec1('0x17')]||null:null,'limit':_0x2b741f[_0xcec1('0x15')]?_0x2b741f[_0xcec1('0x15')]['limit']||null:null,'include':_0x2b741f['options']?_0x2b741f[_0xcec1('0x15')][_0xcec1('0x18')]?_[_0xcec1('0x19')](_0x2b741f['options'][_0xcec1('0x18')],function(_0x1e5528){return{'model':db[_0x1e5528[_0xcec1('0x1a')]],'as':_0x1e5528['as'],'attributes':_0x1e5528[_0xcec1('0x17')],'include':_0x1e5528['include']?_[_0xcec1('0x19')](_0x1e5528['include'],function(_0x21d6fb){return{'model':db[_0x21d6fb['model']],'as':_0x21d6fb['as'],'attributes':_0x21d6fb[_0xcec1('0x17')],'include':_0x21d6fb[_0xcec1('0x18')]?_['map'](_0x21d6fb[_0xcec1('0x18')],function(_0x5329b4){return{'model':db[_0x5329b4[_0xcec1('0x1a')]],'as':_0x5329b4['as'],'attributes':_0x5329b4[_0xcec1('0x17')]};}):[]};}):[]};}):[]:[]})[_0xcec1('0x9')](function(_0x48717a){logger[_0xcec1('0xa')](_0xcec1('0x1b'),_0x2b741f);logger['debug'](_0xcec1('0x1b'),_0x2b741f,JSON[_0xcec1('0x1c')](_0x48717a));_0x1f523c(_0x48717a);})['catch'](function(_0x171c05){logger[_0xcec1('0xf')](_0xcec1('0x1b'),_0x171c05['message'],_0x2b741f);_0x344a9b(_0x436fb9[_0xcec1('0xf')](0x1f4,_0x171c05['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 02e4750..d808653 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 _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +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(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x7a54,0x106));var _0x47a5=function(_0x6ee1cc,_0x476a8c){_0x6ee1cc=_0x6ee1cc-0x0;var _0x890792=_0x7a54[_0x6ee1cc];return _0x890792;};'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 bd83b0d..5967030 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 _0xbaf0=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x3bc0d4,_0x120707){var _0x5534a7=function(_0x32dd01){while(--_0x32dd01){_0x3bc0d4['push'](_0x3bc0d4['shift']());}};_0x5534a7(++_0x120707);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'description':{'type':Sequelize[_0x0baf('0x1')]},'host':{'type':Sequelize[_0x0baf('0x1')]},'user':{'type':Sequelize[_0x0baf('0x1')]},'pass':{'type':Sequelize[_0x0baf('0x1')]},'port':{'type':Sequelize[_0x0baf('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x0baf('0x1')]},'authentication':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xda3f=['exports','STRING','INTEGER','BOOLEAN'];(function(_0x3cbe3a,_0x78bfce){var _0x24ffc1=function(_0x103ae4){while(--_0x103ae4){_0x3cbe3a['push'](_0x3cbe3a['shift']());}};_0x24ffc1(++_0x78bfce);}(_0xda3f,0xec));var _0xfda3=function(_0xbdb315,_0x45d19e){_0xbdb315=_0xbdb315-0x0;var _0x36b339=_0xda3f[_0xbdb315];return _0x36b339;};'use strict';var Sequelize=require('sequelize');module[_0xfda3('0x0')]={'description':{'type':Sequelize[_0xfda3('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xfda3('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xfda3('0x1')]},'authentication':{'type':Sequelize[_0xfda3('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 92838ef..d4e3f05 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 _0x7624=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../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','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','MailServerOut','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','keys','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x1a9cff,_0x42c896){var _0x33f7f0=function(_0x462db4){while(--_0x462db4){_0x1a9cff['push'](_0x1a9cff['shift']());}};_0x33f7f0(++_0x42c896);}(_0x7624,0x180));var _0x4762=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7624[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x4762('0x0'));var rimraf=require(_0x4762('0x1'));var zipdir=require(_0x4762('0x2'));var jsonpatch=require(_0x4762('0x3'));var rp=require(_0x4762('0x4'));var moment=require(_0x4762('0x5'));var BPromise=require(_0x4762('0x6'));var Mustache=require(_0x4762('0x7'));var util=require('util');var path=require(_0x4762('0x8'));var sox=require(_0x4762('0x9'));var csv=require(_0x4762('0xa'));var ejs=require(_0x4762('0xb'));var fs=require('fs');var fs_extra=require(_0x4762('0xc'));var _=require(_0x4762('0xd'));var squel=require(_0x4762('0xe'));var crypto=require(_0x4762('0xf'));var jsforce=require(_0x4762('0x10'));var deskjs=require(_0x4762('0x11'));var toCsv=require(_0x4762('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4762('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4762('0x13'));var as=require(_0x4762('0x14'));var hardwareService=require(_0x4762('0x15'));var logger=require(_0x4762('0x16'))(_0x4762('0x17'));var utils=require(_0x4762('0x18'));var config=require(_0x4762('0x19'));var licenseUtil=require(_0x4762('0x1a'));var db=require(_0x4762('0x1b'))['db'];function respondWithStatusCode(_0x199558,_0x580c52){_0x580c52=_0x580c52||0xcc;return function(_0x9e0989){if(_0x9e0989){return _0x199558['sendStatus'](_0x580c52);}return _0x199558['status'](_0x580c52)[_0x4762('0x1c')]();};}function respondWithResult(_0x333e6c,_0x179280){_0x179280=_0x179280||0xc8;return function(_0x465ca7){if(_0x465ca7){return _0x333e6c['status'](_0x179280)[_0x4762('0x1d')](_0x465ca7);}};}function respondWithFilteredResult(_0x5ea7b1,_0x18c7d9){return function(_0x10dd70){if(_0x10dd70){var _0x3c0318=typeof _0x18c7d9[_0x4762('0x1e')]===_0x4762('0x1f')&&typeof _0x18c7d9[_0x4762('0x20')]==='undefined';var _0x170966=_0x10dd70['count'];var _0x44887e=_0x3c0318?0x0:_0x18c7d9[_0x4762('0x1e')];var _0x3681be=_0x3c0318?_0x10dd70[_0x4762('0x21')]:_0x18c7d9['offset']+_0x18c7d9[_0x4762('0x20')];var _0x1c5d1d;if(_0x3681be>=_0x170966){_0x3681be=_0x170966;_0x1c5d1d=0xc8;}else{_0x1c5d1d=0xce;}_0x5ea7b1[_0x4762('0x22')](_0x1c5d1d);return _0x5ea7b1[_0x4762('0x23')](_0x4762('0x24'),_0x44887e+'-'+_0x3681be+'/'+_0x170966)[_0x4762('0x1d')](_0x10dd70);}return null;};}function patchUpdates(_0x16f003){return function(_0x219a85){try{jsonpatch[_0x4762('0x25')](_0x219a85,_0x16f003,!![]);}catch(_0x573054){return BPromise[_0x4762('0x26')](_0x573054);}return _0x219a85[_0x4762('0x27')]();};}function saveUpdates(_0x12c4f0,_0x30cfd9){return function(_0x4cf13f){if(_0x4cf13f){return _0x4cf13f[_0x4762('0x28')](_0x12c4f0)[_0x4762('0x29')](function(_0x4cc7a8){return _0x4cc7a8;});}return null;};}function removeEntity(_0x1677d0,_0x377b26){return function(_0x2a87f5){if(_0x2a87f5){return _0x2a87f5[_0x4762('0x2a')]()[_0x4762('0x29')](function(){_0x1677d0['status'](0xcc)[_0x4762('0x1c')]();});}};}function handleEntityNotFound(_0x5a2079,_0x734a8f){return function(_0x1602c6){if(!_0x1602c6){_0x5a2079[_0x4762('0x2b')](0x194);}return _0x1602c6;};}function handleError(_0x287652,_0x5a2820){_0x5a2820=_0x5a2820||0x1f4;return function(_0x55ad9c){logger['error'](_0x55ad9c[_0x4762('0x2c')]);if(_0x55ad9c[_0x4762('0x2d')]){delete _0x55ad9c['name'];}_0x287652[_0x4762('0x22')](_0x5a2820)[_0x4762('0x2e')](_0x55ad9c);};}exports[_0x4762('0x2f')]=function(_0x249211,_0x35e08b){var _0x4d81de={},_0x379f89={},_0x119355={'count':0x0,'rows':[]};var _0x5a1c96=_['map'](db[_0x4762('0x30')][_0x4762('0x31')],function(_0x1be233){return{'name':_0x1be233['fieldName'],'type':_0x1be233[_0x4762('0x32')][_0x4762('0x33')]};});_0x379f89[_0x4762('0x34')]=_[_0x4762('0x35')](_0x5a1c96,_0x4762('0x2d'));_0x379f89['query']=_['keys'](_0x249211[_0x4762('0x36')]);_0x379f89[_0x4762('0x37')]=_[_0x4762('0x38')](_0x379f89[_0x4762('0x34')],_0x379f89[_0x4762('0x36')]);_0x4d81de[_0x4762('0x39')]=_[_0x4762('0x38')](_0x379f89[_0x4762('0x34')],qs[_0x4762('0x3a')](_0x249211[_0x4762('0x36')]['fields']));_0x4d81de[_0x4762('0x39')]=_0x4d81de[_0x4762('0x39')][_0x4762('0x3b')]?_0x4d81de[_0x4762('0x39')]:_0x379f89[_0x4762('0x34')];if(!_0x249211[_0x4762('0x36')][_0x4762('0x3c')](_0x4762('0x3d'))){_0x4d81de[_0x4762('0x20')]=qs[_0x4762('0x20')](_0x249211[_0x4762('0x36')][_0x4762('0x20')]);_0x4d81de['offset']=qs[_0x4762('0x1e')](_0x249211['query'][_0x4762('0x1e')]);}_0x4d81de[_0x4762('0x3e')]=qs[_0x4762('0x3f')](_0x249211[_0x4762('0x36')]['sort']);_0x4d81de[_0x4762('0x40')]=qs[_0x4762('0x37')](_['pick'](_0x249211[_0x4762('0x36')],_0x379f89[_0x4762('0x37')]),_0x5a1c96);if(_0x249211[_0x4762('0x36')]['filter']){_0x4d81de[_0x4762('0x40')]=_[_0x4762('0x41')](_0x4d81de[_0x4762('0x40')],{'$or':_[_0x4762('0x35')](_0x5a1c96,function(_0x19d6e3){if(_0x19d6e3[_0x4762('0x32')]!==_0x4762('0x42')){var _0x402d3b={};_0x402d3b[_0x19d6e3['name']]={'$like':'%'+_0x249211[_0x4762('0x36')][_0x4762('0x43')]+'%'};return _0x402d3b;}})});}_0x4d81de=_[_0x4762('0x41')]({},_0x4d81de,_0x249211[_0x4762('0x44')]);var _0x3c8cb8={'where':_0x4d81de[_0x4762('0x40')]};return db[_0x4762('0x30')][_0x4762('0x21')](_0x3c8cb8)[_0x4762('0x29')](function(_0x4c7118){_0x119355['count']=_0x4c7118;if(_0x249211['query'][_0x4762('0x45')]){_0x4d81de[_0x4762('0x46')]=[{'all':!![]}];}return db[_0x4762('0x30')][_0x4762('0x47')](_0x4d81de);})['then'](function(_0x3fa3cc){_0x119355[_0x4762('0x48')]=_0x3fa3cc;return _0x119355;})[_0x4762('0x29')](respondWithFilteredResult(_0x35e08b,_0x4d81de))['catch'](handleError(_0x35e08b,null));};exports[_0x4762('0x49')]=function(_0x132aa8,_0x53de09){var _0x29e8fb={'raw':!![],'where':{'id':_0x132aa8['params']['id']}},_0x1ce828={};_0x1ce828['model']=_['keys'](db[_0x4762('0x30')][_0x4762('0x31')]);_0x1ce828[_0x4762('0x36')]=_[_0x4762('0x4a')](_0x132aa8['query']);_0x1ce828[_0x4762('0x37')]=_[_0x4762('0x38')](_0x1ce828[_0x4762('0x34')],_0x1ce828[_0x4762('0x36')]);_0x29e8fb[_0x4762('0x39')]=_[_0x4762('0x38')](_0x1ce828[_0x4762('0x34')],qs[_0x4762('0x3a')](_0x132aa8[_0x4762('0x36')][_0x4762('0x3a')]));_0x29e8fb['attributes']=_0x29e8fb[_0x4762('0x39')][_0x4762('0x3b')]?_0x29e8fb[_0x4762('0x39')]:_0x1ce828['model'];if(_0x132aa8[_0x4762('0x36')][_0x4762('0x45')]){_0x29e8fb[_0x4762('0x46')]=[{'all':!![]}];}_0x29e8fb=_['merge']({},_0x29e8fb,_0x132aa8[_0x4762('0x44')]);return db[_0x4762('0x30')][_0x4762('0x4b')](_0x29e8fb)['then'](handleEntityNotFound(_0x53de09,null))[_0x4762('0x29')](respondWithResult(_0x53de09,null))['catch'](handleError(_0x53de09,null));};exports[_0x4762('0x4c')]=function(_0x5837e9,_0x7b3eb6){return db['MailServerOut'][_0x4762('0x4c')](_0x5837e9[_0x4762('0x4d')],{})[_0x4762('0x29')](respondWithResult(_0x7b3eb6,0xc9))['catch'](handleError(_0x7b3eb6,null));};exports['update']=function(_0x5eee03,_0x1aa017){if(_0x5eee03[_0x4762('0x4d')]['id']){delete _0x5eee03[_0x4762('0x4d')]['id'];}return db[_0x4762('0x30')][_0x4762('0x4b')]({'where':{'id':_0x5eee03[_0x4762('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1aa017,null))[_0x4762('0x29')](saveUpdates(_0x5eee03['body'],null))[_0x4762('0x29')](respondWithResult(_0x1aa017,null))['catch'](handleError(_0x1aa017,null));};exports[_0x4762('0x2a')]=function(_0xfd47b,_0x1b9a50){return db[_0x4762('0x30')][_0x4762('0x4b')]({'where':{'id':_0xfd47b[_0x4762('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1b9a50,null))['then'](removeEntity(_0x1b9a50,null))['catch'](handleError(_0x1b9a50,null));}; \ No newline at end of file +var _0x5951=['error','stack','name','send','index','MailServerOut','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','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','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x3203c9,_0x1a3086){var _0x446beb=function(_0x3afb5e){while(--_0x3afb5e){_0x3203c9['push'](_0x3203c9['shift']());}};_0x446beb(++_0x1a3086);}(_0x5951,0x1b0));var _0x1595=function(_0x2bd1a7,_0x473d24){_0x2bd1a7=_0x2bd1a7-0x0;var _0x526bb4=_0x5951[_0x2bd1a7];return _0x526bb4;};'use strict';var emlformat=require(_0x1595('0x0'));var rimraf=require(_0x1595('0x1'));var zipdir=require(_0x1595('0x2'));var jsonpatch=require(_0x1595('0x3'));var rp=require('request-promise');var moment=require(_0x1595('0x4'));var BPromise=require(_0x1595('0x5'));var Mustache=require(_0x1595('0x6'));var util=require(_0x1595('0x7'));var path=require(_0x1595('0x8'));var sox=require('sox');var csv=require(_0x1595('0x9'));var ejs=require(_0x1595('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1595('0xb'));var squel=require(_0x1595('0xc'));var crypto=require(_0x1595('0xd'));var jsforce=require(_0x1595('0xe'));var deskjs=require(_0x1595('0xf'));var toCsv=require(_0x1595('0x9'));var querystring=require(_0x1595('0x10'));var Papa=require(_0x1595('0x11'));var Redis=require('ioredis');var authService=require(_0x1595('0x12'));var qs=require(_0x1595('0x13'));var as=require(_0x1595('0x14'));var hardwareService=require(_0x1595('0x15'));var logger=require(_0x1595('0x16'))(_0x1595('0x17'));var utils=require(_0x1595('0x18'));var config=require(_0x1595('0x19'));var licenseUtil=require(_0x1595('0x1a'));var db=require(_0x1595('0x1b'))['db'];function respondWithStatusCode(_0x3ef5fc,_0x425d78){_0x425d78=_0x425d78||0xcc;return function(_0x395107){if(_0x395107){return _0x3ef5fc['sendStatus'](_0x425d78);}return _0x3ef5fc[_0x1595('0x1c')](_0x425d78)[_0x1595('0x1d')]();};}function respondWithResult(_0x415f65,_0x144889){_0x144889=_0x144889||0xc8;return function(_0x33cc07){if(_0x33cc07){return _0x415f65[_0x1595('0x1c')](_0x144889)[_0x1595('0x1e')](_0x33cc07);}};}function respondWithFilteredResult(_0xd70777,_0x103fce){return function(_0x1804cb){if(_0x1804cb){var _0x4d9653=typeof _0x103fce[_0x1595('0x1f')]===_0x1595('0x20')&&typeof _0x103fce[_0x1595('0x21')]==='undefined';var _0x30c8cc=_0x1804cb[_0x1595('0x22')];var _0x2f5ead=_0x4d9653?0x0:_0x103fce[_0x1595('0x1f')];var _0x4f242c=_0x4d9653?_0x1804cb[_0x1595('0x22')]:_0x103fce[_0x1595('0x1f')]+_0x103fce[_0x1595('0x21')];var _0xe6492f;if(_0x4f242c>=_0x30c8cc){_0x4f242c=_0x30c8cc;_0xe6492f=0xc8;}else{_0xe6492f=0xce;}_0xd70777[_0x1595('0x1c')](_0xe6492f);return _0xd70777['set'](_0x1595('0x23'),_0x2f5ead+'-'+_0x4f242c+'/'+_0x30c8cc)[_0x1595('0x1e')](_0x1804cb);}return null;};}function patchUpdates(_0x31f1db){return function(_0x227db3){try{jsonpatch[_0x1595('0x24')](_0x227db3,_0x31f1db,!![]);}catch(_0x2de79d){return BPromise[_0x1595('0x25')](_0x2de79d);}return _0x227db3[_0x1595('0x26')]();};}function saveUpdates(_0x3d91d6,_0x53cffe){return function(_0x27a753){if(_0x27a753){return _0x27a753[_0x1595('0x27')](_0x3d91d6)[_0x1595('0x28')](function(_0x1bbbc6){return _0x1bbbc6;});}return null;};}function removeEntity(_0x5ee860,_0x30bd30){return function(_0x1e9695){if(_0x1e9695){return _0x1e9695[_0x1595('0x29')]()[_0x1595('0x28')](function(){_0x5ee860[_0x1595('0x1c')](0xcc)[_0x1595('0x1d')]();});}};}function handleEntityNotFound(_0x2901d8,_0x324bd2){return function(_0x58c3c9){if(!_0x58c3c9){_0x2901d8['sendStatus'](0x194);}return _0x58c3c9;};}function handleError(_0x5d2647,_0x4bf3ff){_0x4bf3ff=_0x4bf3ff||0x1f4;return function(_0x48a8de){logger[_0x1595('0x2a')](_0x48a8de[_0x1595('0x2b')]);if(_0x48a8de[_0x1595('0x2c')]){delete _0x48a8de[_0x1595('0x2c')];}_0x5d2647[_0x1595('0x1c')](_0x4bf3ff)[_0x1595('0x2d')](_0x48a8de);};}exports[_0x1595('0x2e')]=function(_0x2f7041,_0x21d83d){var _0x22fe18={},_0x4a0b5d={},_0x356da3={'count':0x0,'rows':[]};var _0x32757e=_['map'](db[_0x1595('0x2f')][_0x1595('0x30')],function(_0x1ba66f){return{'name':_0x1ba66f[_0x1595('0x31')],'type':_0x1ba66f[_0x1595('0x32')]['key']};});_0x4a0b5d[_0x1595('0x33')]=_[_0x1595('0x34')](_0x32757e,_0x1595('0x2c'));_0x4a0b5d[_0x1595('0x35')]=_[_0x1595('0x36')](_0x2f7041[_0x1595('0x35')]);_0x4a0b5d[_0x1595('0x37')]=_['intersection'](_0x4a0b5d[_0x1595('0x33')],_0x4a0b5d[_0x1595('0x35')]);_0x22fe18[_0x1595('0x38')]=_[_0x1595('0x39')](_0x4a0b5d[_0x1595('0x33')],qs[_0x1595('0x3a')](_0x2f7041[_0x1595('0x35')][_0x1595('0x3a')]));_0x22fe18['attributes']=_0x22fe18['attributes'][_0x1595('0x3b')]?_0x22fe18[_0x1595('0x38')]:_0x4a0b5d['model'];if(!_0x2f7041[_0x1595('0x35')][_0x1595('0x3c')](_0x1595('0x3d'))){_0x22fe18[_0x1595('0x21')]=qs[_0x1595('0x21')](_0x2f7041[_0x1595('0x35')][_0x1595('0x21')]);_0x22fe18[_0x1595('0x1f')]=qs[_0x1595('0x1f')](_0x2f7041[_0x1595('0x35')]['offset']);}_0x22fe18[_0x1595('0x3e')]=qs[_0x1595('0x3f')](_0x2f7041[_0x1595('0x35')]['sort']);_0x22fe18[_0x1595('0x40')]=qs['filters'](_[_0x1595('0x41')](_0x2f7041[_0x1595('0x35')],_0x4a0b5d[_0x1595('0x37')]),_0x32757e);if(_0x2f7041[_0x1595('0x35')]['filter']){_0x22fe18['where']=_[_0x1595('0x42')](_0x22fe18['where'],{'$or':_[_0x1595('0x34')](_0x32757e,function(_0x307654){if(_0x307654[_0x1595('0x32')]!==_0x1595('0x43')){var _0x4f8a13={};_0x4f8a13[_0x307654[_0x1595('0x2c')]]={'$like':'%'+_0x2f7041[_0x1595('0x35')][_0x1595('0x44')]+'%'};return _0x4f8a13;}})});}_0x22fe18=_[_0x1595('0x42')]({},_0x22fe18,_0x2f7041['options']);var _0x3b4294={'where':_0x22fe18[_0x1595('0x40')]};return db[_0x1595('0x2f')]['count'](_0x3b4294)['then'](function(_0x55c9e7){_0x356da3[_0x1595('0x22')]=_0x55c9e7;if(_0x2f7041[_0x1595('0x35')][_0x1595('0x45')]){_0x22fe18[_0x1595('0x46')]=[{'all':!![]}];}return db[_0x1595('0x2f')]['findAll'](_0x22fe18);})[_0x1595('0x28')](function(_0x2dc079){_0x356da3[_0x1595('0x47')]=_0x2dc079;return _0x356da3;})['then'](respondWithFilteredResult(_0x21d83d,_0x22fe18))[_0x1595('0x48')](handleError(_0x21d83d,null));};exports[_0x1595('0x49')]=function(_0xfebdb9,_0x3f4aa5){var _0x33c409={'raw':!![],'where':{'id':_0xfebdb9[_0x1595('0x4a')]['id']}},_0x5e1bd5={};_0x5e1bd5['model']=_[_0x1595('0x36')](db['MailServerOut'][_0x1595('0x30')]);_0x5e1bd5[_0x1595('0x35')]=_[_0x1595('0x36')](_0xfebdb9['query']);_0x5e1bd5['filters']=_[_0x1595('0x39')](_0x5e1bd5['model'],_0x5e1bd5[_0x1595('0x35')]);_0x33c409[_0x1595('0x38')]=_[_0x1595('0x39')](_0x5e1bd5['model'],qs[_0x1595('0x3a')](_0xfebdb9['query'][_0x1595('0x3a')]));_0x33c409[_0x1595('0x38')]=_0x33c409[_0x1595('0x38')]['length']?_0x33c409[_0x1595('0x38')]:_0x5e1bd5[_0x1595('0x33')];if(_0xfebdb9[_0x1595('0x35')][_0x1595('0x45')]){_0x33c409[_0x1595('0x46')]=[{'all':!![]}];}_0x33c409=_[_0x1595('0x42')]({},_0x33c409,_0xfebdb9[_0x1595('0x4b')]);return db['MailServerOut']['find'](_0x33c409)['then'](handleEntityNotFound(_0x3f4aa5,null))['then'](respondWithResult(_0x3f4aa5,null))[_0x1595('0x48')](handleError(_0x3f4aa5,null));};exports['create']=function(_0xab0135,_0x189014){return db[_0x1595('0x2f')][_0x1595('0x4c')](_0xab0135[_0x1595('0x4d')],{})[_0x1595('0x28')](respondWithResult(_0x189014,0xc9))[_0x1595('0x48')](handleError(_0x189014,null));};exports['update']=function(_0x3f8c58,_0x596625){if(_0x3f8c58[_0x1595('0x4d')]['id']){delete _0x3f8c58[_0x1595('0x4d')]['id'];}return db[_0x1595('0x2f')][_0x1595('0x4e')]({'where':{'id':_0x3f8c58[_0x1595('0x4a')]['id']}})[_0x1595('0x28')](handleEntityNotFound(_0x596625,null))[_0x1595('0x28')](saveUpdates(_0x3f8c58[_0x1595('0x4d')],null))[_0x1595('0x28')](respondWithResult(_0x596625,null))[_0x1595('0x48')](handleError(_0x596625,null));};exports['destroy']=function(_0x15e4b4,_0x2fdbd2){return db[_0x1595('0x2f')][_0x1595('0x4e')]({'where':{'id':_0x15e4b4[_0x1595('0x4a')]['id']}})[_0x1595('0x28')](handleEntityNotFound(_0x2fdbd2,null))[_0x1595('0x28')](removeEntity(_0x2fdbd2,null))['catch'](handleError(_0x2fdbd2,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 12a50b3..4903cf1 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 _0x5c54=['bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','lodash','util','../../config/logger','api','moment'];(function(_0x1fe966,_0x2735b9){var _0x3f4fd2=function(_0x3633a5){while(--_0x3633a5){_0x1fe966['push'](_0x1fe966['shift']());}};_0x3f4fd2(++_0x2735b9);}(_0x5c54,0xa3));var _0x45c5=function(_0x3225fc,_0x20dfd9){_0x3225fc=_0x3225fc-0x0;var _0x5bfe37=_0x5c54[_0x3225fc];return _0x5bfe37;};'use strict';var _=require(_0x45c5('0x0'));var util=require(_0x45c5('0x1'));var logger=require(_0x45c5('0x2'))(_0x45c5('0x3'));var moment=require(_0x45c5('0x4'));var BPromise=require(_0x45c5('0x5'));var rp=require(_0x45c5('0x6'));var fs=require('fs');var path=require(_0x45c5('0x7'));var rimraf=require(_0x45c5('0x8'));var config=require(_0x45c5('0x9'));var attributes=require(_0x45c5('0xa'));module[_0x45c5('0xb')]=function(_0x30314d,_0x22c937){return _0x30314d[_0x45c5('0xc')](_0x45c5('0xd'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06d0=['MailServerOut','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','define'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x06d0,0x1ef));var _0x006d=function(_0x16722c,_0x4b554c){_0x16722c=_0x16722c-0x0;var _0x20f59c=_0x06d0[_0x16722c];return _0x20f59c;};'use strict';var _=require(_0x006d('0x0'));var util=require(_0x006d('0x1'));var logger=require(_0x006d('0x2'))(_0x006d('0x3'));var moment=require(_0x006d('0x4'));var BPromise=require(_0x006d('0x5'));var rp=require(_0x006d('0x6'));var fs=require('fs');var path=require(_0x006d('0x7'));var rimraf=require(_0x006d('0x8'));var config=require(_0x006d('0x9'));var attributes=require(_0x006d('0xa'));module['exports']=function(_0x1b1645,_0x413ddb){return _0x1b1645[_0x006d('0xb')](_0x006d('0xc'),attributes,{'tableName':'mail_servers_out','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 79eee10..cffb136 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2cb984,_0x365f50){var _0x2f73e6=function(_0x315369){while(--_0x315369){_0x2cb984['push'](_0x2cb984['shift']());}};_0x2f73e6(++_0x365f50);}(_0xadb5,0xad));var _0x5adb=function(_0x154e5e,_0x35c6f0){_0x154e5e=_0x154e5e-0x0;var _0x1b63dc=_0xadb5[_0x154e5e];return _0x1b63dc;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x5249b6,_0x2f9fb8){_0x5249b6=_0x5249b6-0x0;var _0x4bffe3=_0x7a54[_0x5249b6];return _0x4bffe3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 16a0498..62bae3e 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 _0xee65=['update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','create','put'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xee65,0x145));var _0x5ee6=function(_0x3b6359,_0x373e86){_0x3b6359=_0x3b6359-0x0;var _0x18cdc4=_0xee65[_0x3b6359];return _0x18cdc4;};'use strict';var multer=require(_0x5ee6('0x0'));var util=require('util');var path=require(_0x5ee6('0x1'));var timeout=require(_0x5ee6('0x2'));var express=require(_0x5ee6('0x3'));var router=express['Router']();var fs_extra=require(_0x5ee6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5ee6('0x5'));var config=require(_0x5ee6('0x6'));var controller=require(_0x5ee6('0x7'));router['get']('/',auth[_0x5ee6('0x8')](),controller[_0x5ee6('0x9')]);router[_0x5ee6('0xa')](_0x5ee6('0xb'),auth[_0x5ee6('0x8')](),controller[_0x5ee6('0xc')]);router[_0x5ee6('0xa')]('/:id',auth[_0x5ee6('0x8')](),controller['show']);router['post']('/',auth[_0x5ee6('0x8')](),controller[_0x5ee6('0xd')]);router[_0x5ee6('0xe')]('/:id',auth[_0x5ee6('0x8')](),controller[_0x5ee6('0xf')]);router[_0x5ee6('0x10')](_0x5ee6('0x11'),auth[_0x5ee6('0x8')](),controller[_0x5ee6('0x12')]);module[_0x5ee6('0x13')]=router; \ No newline at end of file +var _0x07bd=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','Router'];(function(_0x5f0a64,_0x11207b){var _0x1aae31=function(_0x5a6d51){while(--_0x5a6d51){_0x5f0a64['push'](_0x5f0a64['shift']());}};_0x1aae31(++_0x11207b);}(_0x07bd,0x13c));var _0xd07b=function(_0x2fe0b9,_0x1a62fc){_0x2fe0b9=_0x2fe0b9-0x0;var _0x494c7a=_0x07bd[_0x2fe0b9];return _0x494c7a;};'use strict';var multer=require(_0xd07b('0x0'));var util=require(_0xd07b('0x1'));var path=require(_0xd07b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd07b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd07b('0x4'));var interaction=require(_0xd07b('0x5'));var config=require(_0xd07b('0x6'));var controller=require(_0xd07b('0x7'));router[_0xd07b('0x8')]('/',auth[_0xd07b('0x9')](),controller[_0xd07b('0xa')]);router[_0xd07b('0x8')]('/describe',auth[_0xd07b('0x9')](),controller[_0xd07b('0xb')]);router['get'](_0xd07b('0xc'),auth[_0xd07b('0x9')](),controller['show']);router[_0xd07b('0xd')]('/',auth[_0xd07b('0x9')](),controller[_0xd07b('0xe')]);router[_0xd07b('0xf')](_0xd07b('0xc'),auth[_0xd07b('0x9')](),controller[_0xd07b('0x10')]);router[_0xd07b('0x11')]('/:id',auth[_0xd07b('0x9')](),controller[_0xd07b('0x12')]);module[_0xd07b('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 5b2e610..56f7904 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 _0xc359=['name','STRING','exports'];(function(_0x2f5ee4,_0x584180){var _0x4ec263=function(_0x3ec7bd){while(--_0x3ec7bd){_0x2f5ee4['push'](_0x2f5ee4['shift']());}};_0x4ec263(++_0x584180);}(_0xc359,0x1d9));var _0x9c35=function(_0x5e2489,_0x2fd8be){_0x5e2489=_0x5e2489-0x0;var _0xa87596=_0xc359[_0x5e2489];return _0xa87596;};'use strict';var Sequelize=require('sequelize');module[_0x9c35('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x9c35('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9c35('0x2')]}}; \ No newline at end of file +var _0x8ace=['sequelize','exports','STRING','name'];(function(_0x5b32e4,_0x3572ae){var _0x5ced34=function(_0x16dda1){while(--_0x16dda1){_0x5b32e4['push'](_0x5b32e4['shift']());}};_0x5ced34(++_0x3572ae);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x3937b6,_0xd53d2b){_0x3937b6=_0x3937b6-0x0;var _0x1ba356=_0x8ace[_0x3937b6];return _0x1ba356;};'use strict';var Sequelize=require(_0xe8ac('0x0'));module[_0xe8ac('0x1')]={'name':{'type':Sequelize[_0xe8ac('0x2')],'unique':_0xe8ac('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe8ac('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 4fb95b5..55a448a 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 _0x52d2=['limit','count','set','Content-Range','apply','reject','save','then','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','fields','find','catch','create','body','update','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset'];(function(_0x45dfde,_0x597ea9){var _0x26ca3b=function(_0x35598a){while(--_0x35598a){_0x45dfde['push'](_0x45dfde['shift']());}};_0x26ca3b(++_0x597ea9);}(_0x52d2,0xbd));var _0x252d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x52d2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x252d('0x0'));var rimraf=require(_0x252d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x252d('0x2'));var rp=require(_0x252d('0x3'));var moment=require(_0x252d('0x4'));var BPromise=require(_0x252d('0x5'));var Mustache=require(_0x252d('0x6'));var util=require(_0x252d('0x7'));var path=require('path');var sox=require(_0x252d('0x8'));var csv=require(_0x252d('0x9'));var ejs=require(_0x252d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x252d('0xb'));var squel=require(_0x252d('0xc'));var crypto=require(_0x252d('0xd'));var jsforce=require(_0x252d('0xe'));var deskjs=require(_0x252d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x252d('0x10'));var Redis=require(_0x252d('0x11'));var authService=require(_0x252d('0x12'));var qs=require(_0x252d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x252d('0x14'))(_0x252d('0x15'));var utils=require(_0x252d('0x16'));var config=require(_0x252d('0x17'));var licenseUtil=require(_0x252d('0x18'));var db=require(_0x252d('0x19'))['db'];function respondWithStatusCode(_0x56fd23,_0xdf9322){_0xdf9322=_0xdf9322||0xcc;return function(_0x49ab6e){if(_0x49ab6e){return _0x56fd23[_0x252d('0x1a')](_0xdf9322);}return _0x56fd23[_0x252d('0x1b')](_0xdf9322)['end']();};}function respondWithResult(_0x3dffb4,_0x1cdded){_0x1cdded=_0x1cdded||0xc8;return function(_0x2cd7e2){if(_0x2cd7e2){return _0x3dffb4[_0x252d('0x1b')](_0x1cdded)[_0x252d('0x1c')](_0x2cd7e2);}};}function respondWithFilteredResult(_0x1620eb,_0x3a8c9f){return function(_0x586c3d){if(_0x586c3d){var _0x38f493=typeof _0x3a8c9f[_0x252d('0x1d')]==='undefined'&&typeof _0x3a8c9f[_0x252d('0x1e')]==='undefined';var _0x3e9f5f=_0x586c3d[_0x252d('0x1f')];var _0x587237=_0x38f493?0x0:_0x3a8c9f['offset'];var _0x4b4071=_0x38f493?_0x586c3d[_0x252d('0x1f')]:_0x3a8c9f['offset']+_0x3a8c9f[_0x252d('0x1e')];var _0x449809;if(_0x4b4071>=_0x3e9f5f){_0x4b4071=_0x3e9f5f;_0x449809=0xc8;}else{_0x449809=0xce;}_0x1620eb[_0x252d('0x1b')](_0x449809);return _0x1620eb[_0x252d('0x20')](_0x252d('0x21'),_0x587237+'-'+_0x4b4071+'/'+_0x3e9f5f)['json'](_0x586c3d);}return null;};}function patchUpdates(_0x230dc4){return function(_0x13ed2d){try{jsonpatch[_0x252d('0x22')](_0x13ed2d,_0x230dc4,!![]);}catch(_0x3df25a){return BPromise[_0x252d('0x23')](_0x3df25a);}return _0x13ed2d[_0x252d('0x24')]();};}function saveUpdates(_0x20120e,_0x3fdabd){return function(_0x276d64){if(_0x276d64){return _0x276d64['update'](_0x20120e)[_0x252d('0x25')](function(_0x470505){return _0x470505;});}return null;};}function removeEntity(_0x5aa8e3,_0x34c7d3){return function(_0x2f52de){if(_0x2f52de){return _0x2f52de['destroy']()[_0x252d('0x25')](function(){_0x5aa8e3[_0x252d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31392d,_0xb810f0){return function(_0x5369b7){if(!_0x5369b7){_0x31392d[_0x252d('0x1a')](0x194);}return _0x5369b7;};}function handleError(_0x453d13,_0x3afadf){_0x3afadf=_0x3afadf||0x1f4;return function(_0x39baa6){logger['error'](_0x39baa6['stack']);if(_0x39baa6['name']){delete _0x39baa6[_0x252d('0x26')];}_0x453d13[_0x252d('0x1b')](_0x3afadf)[_0x252d('0x27')](_0x39baa6);};}exports[_0x252d('0x28')]=function(_0x5a9012,_0x52a964){var _0x126ab4={},_0x417fd3={},_0x5d3d7c={'count':0x0,'rows':[]};var _0x5d0804=_[_0x252d('0x29')](db[_0x252d('0x2a')][_0x252d('0x2b')],function(_0x44da5d){return{'name':_0x44da5d[_0x252d('0x2c')],'type':_0x44da5d[_0x252d('0x2d')][_0x252d('0x2e')]};});_0x417fd3[_0x252d('0x2f')]=_[_0x252d('0x29')](_0x5d0804,_0x252d('0x26'));_0x417fd3['query']=_[_0x252d('0x30')](_0x5a9012[_0x252d('0x31')]);_0x417fd3[_0x252d('0x32')]=_[_0x252d('0x33')](_0x417fd3[_0x252d('0x2f')],_0x417fd3[_0x252d('0x31')]);_0x126ab4[_0x252d('0x34')]=_[_0x252d('0x33')](_0x417fd3['model'],qs['fields'](_0x5a9012[_0x252d('0x31')]['fields']));_0x126ab4[_0x252d('0x34')]=_0x126ab4[_0x252d('0x34')][_0x252d('0x35')]?_0x126ab4[_0x252d('0x34')]:_0x417fd3[_0x252d('0x2f')];if(!_0x5a9012[_0x252d('0x31')][_0x252d('0x36')]('nolimit')){_0x126ab4[_0x252d('0x1e')]=qs[_0x252d('0x1e')](_0x5a9012[_0x252d('0x31')]['limit']);_0x126ab4[_0x252d('0x1d')]=qs['offset'](_0x5a9012['query'][_0x252d('0x1d')]);}_0x126ab4[_0x252d('0x37')]=qs[_0x252d('0x38')](_0x5a9012[_0x252d('0x31')][_0x252d('0x38')]);_0x126ab4[_0x252d('0x39')]=qs[_0x252d('0x32')](_[_0x252d('0x3a')](_0x5a9012['query'],_0x417fd3[_0x252d('0x32')]),_0x5d0804);if(_0x5a9012['query'][_0x252d('0x3b')]){_0x126ab4[_0x252d('0x39')]=_[_0x252d('0x3c')](_0x126ab4[_0x252d('0x39')],{'$or':_[_0x252d('0x29')](_0x5d0804,function(_0xcecce5){if(_0xcecce5['type']!==_0x252d('0x3d')){var _0x362759={};_0x362759[_0xcecce5[_0x252d('0x26')]]={'$like':'%'+_0x5a9012[_0x252d('0x31')][_0x252d('0x3b')]+'%'};return _0x362759;}})});}_0x126ab4=_['merge']({},_0x126ab4,_0x5a9012[_0x252d('0x3e')]);var _0x2e69c3={'where':_0x126ab4[_0x252d('0x39')]};return db[_0x252d('0x2a')][_0x252d('0x1f')](_0x2e69c3)[_0x252d('0x25')](function(_0x5e45e9){_0x5d3d7c['count']=_0x5e45e9;if(_0x5a9012[_0x252d('0x31')][_0x252d('0x3f')]){_0x126ab4[_0x252d('0x40')]=[{'all':!![]}];}return db[_0x252d('0x2a')][_0x252d('0x41')](_0x126ab4);})['then'](function(_0x364051){_0x5d3d7c['rows']=_0x364051;return _0x5d3d7c;})[_0x252d('0x25')](respondWithFilteredResult(_0x52a964,_0x126ab4))['catch'](handleError(_0x52a964,null));};exports['show']=function(_0x41e02d,_0x4eb110){var _0x164ca2={'raw':!![],'where':{'id':_0x41e02d['params']['id']}},_0xb6916d={};_0xb6916d[_0x252d('0x2f')]=_['keys'](db[_0x252d('0x2a')]['rawAttributes']);_0xb6916d['query']=_[_0x252d('0x30')](_0x41e02d['query']);_0xb6916d['filters']=_[_0x252d('0x33')](_0xb6916d[_0x252d('0x2f')],_0xb6916d[_0x252d('0x31')]);_0x164ca2['attributes']=_[_0x252d('0x33')](_0xb6916d[_0x252d('0x2f')],qs[_0x252d('0x42')](_0x41e02d[_0x252d('0x31')]['fields']));_0x164ca2[_0x252d('0x34')]=_0x164ca2[_0x252d('0x34')][_0x252d('0x35')]?_0x164ca2['attributes']:_0xb6916d[_0x252d('0x2f')];if(_0x41e02d[_0x252d('0x31')][_0x252d('0x3f')]){_0x164ca2[_0x252d('0x40')]=[{'all':!![]}];}_0x164ca2=_[_0x252d('0x3c')]({},_0x164ca2,_0x41e02d['options']);return db[_0x252d('0x2a')][_0x252d('0x43')](_0x164ca2)['then'](handleEntityNotFound(_0x4eb110,null))['then'](respondWithResult(_0x4eb110,null))[_0x252d('0x44')](handleError(_0x4eb110,null));};exports[_0x252d('0x45')]=function(_0x54be44,_0x425154){return db[_0x252d('0x2a')]['create'](_0x54be44[_0x252d('0x46')],{})[_0x252d('0x25')](respondWithResult(_0x425154,0xc9))[_0x252d('0x44')](handleError(_0x425154,null));};exports[_0x252d('0x47')]=function(_0x3eb6ec,_0x3ad791){if(_0x3eb6ec[_0x252d('0x46')]['id']){delete _0x3eb6ec[_0x252d('0x46')]['id'];}return db[_0x252d('0x2a')][_0x252d('0x43')]({'where':{'id':_0x3eb6ec[_0x252d('0x48')]['id']}})[_0x252d('0x25')](handleEntityNotFound(_0x3ad791,null))['then'](saveUpdates(_0x3eb6ec[_0x252d('0x46')],null))[_0x252d('0x25')](respondWithResult(_0x3ad791,null))['catch'](handleError(_0x3ad791,null));};exports['destroy']=function(_0x11b240,_0x16984f){return db[_0x252d('0x2a')][_0x252d('0x43')]({'where':{'id':_0x11b240[_0x252d('0x48')]['id']}})[_0x252d('0x25')](handleEntityNotFound(_0x16984f,null))['then'](removeEntity(_0x16984f,null))[_0x252d('0x44')](handleError(_0x16984f,null));};exports['describe']=function(_0x45e2d4,_0x163f4f){return db[_0x252d('0x2a')]['describe']()['then'](respondWithResult(_0x163f4f,null))[_0x252d('0x44')](handleError(_0x163f4f,null));}; \ No newline at end of file +var _0x2444=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','then','includeAll','include','findAll','rows','show','params','merge','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','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/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','end','sendStatus','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x2444,0x153));var _0x4244=function(_0x304487,_0x58f5ea){_0x304487=_0x304487-0x0;var _0xfd14db=_0x2444[_0x304487];return _0xfd14db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4244('0x0'));var zipdir=require(_0x4244('0x1'));var jsonpatch=require(_0x4244('0x2'));var rp=require(_0x4244('0x3'));var moment=require(_0x4244('0x4'));var BPromise=require(_0x4244('0x5'));var Mustache=require(_0x4244('0x6'));var util=require('util');var path=require(_0x4244('0x7'));var sox=require(_0x4244('0x8'));var csv=require(_0x4244('0x9'));var ejs=require(_0x4244('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4244('0xb'));var squel=require(_0x4244('0xc'));var crypto=require(_0x4244('0xd'));var jsforce=require(_0x4244('0xe'));var deskjs=require(_0x4244('0xf'));var toCsv=require(_0x4244('0x9'));var querystring=require(_0x4244('0x10'));var Papa=require(_0x4244('0x11'));var Redis=require(_0x4244('0x12'));var authService=require(_0x4244('0x13'));var qs=require(_0x4244('0x14'));var as=require(_0x4244('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4244('0x16'))(_0x4244('0x17'));var utils=require(_0x4244('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4244('0x19'));var db=require(_0x4244('0x1a'))['db'];function respondWithStatusCode(_0x401b79,_0x1af793){_0x1af793=_0x1af793||0xcc;return function(_0x2a5e3b){if(_0x2a5e3b){return _0x401b79['sendStatus'](_0x1af793);}return _0x401b79[_0x4244('0x1b')](_0x1af793)['end']();};}function respondWithResult(_0xb34aad,_0x5d86ae){_0x5d86ae=_0x5d86ae||0xc8;return function(_0x3b6f09){if(_0x3b6f09){return _0xb34aad['status'](_0x5d86ae)[_0x4244('0x1c')](_0x3b6f09);}};}function respondWithFilteredResult(_0x3749c3,_0x16b1f0){return function(_0x2de618){if(_0x2de618){var _0x4379f2=typeof _0x16b1f0[_0x4244('0x1d')]===_0x4244('0x1e')&&typeof _0x16b1f0['limit']===_0x4244('0x1e');var _0x127744=_0x2de618[_0x4244('0x1f')];var _0x5625ed=_0x4379f2?0x0:_0x16b1f0['offset'];var _0x2f0b10=_0x4379f2?_0x2de618[_0x4244('0x1f')]:_0x16b1f0[_0x4244('0x1d')]+_0x16b1f0[_0x4244('0x20')];var _0x49fdf1;if(_0x2f0b10>=_0x127744){_0x2f0b10=_0x127744;_0x49fdf1=0xc8;}else{_0x49fdf1=0xce;}_0x3749c3[_0x4244('0x1b')](_0x49fdf1);return _0x3749c3[_0x4244('0x21')]('Content-Range',_0x5625ed+'-'+_0x2f0b10+'/'+_0x127744)['json'](_0x2de618);}return null;};}function patchUpdates(_0xfc2587){return function(_0x5edfd2){try{jsonpatch[_0x4244('0x22')](_0x5edfd2,_0xfc2587,!![]);}catch(_0x1a2685){return BPromise[_0x4244('0x23')](_0x1a2685);}return _0x5edfd2[_0x4244('0x24')]();};}function saveUpdates(_0x5ec463,_0x6539cf){return function(_0x201f06){if(_0x201f06){return _0x201f06[_0x4244('0x25')](_0x5ec463)['then'](function(_0x386e83){return _0x386e83;});}return null;};}function removeEntity(_0x390f46,_0x12801f){return function(_0x45271a){if(_0x45271a){return _0x45271a[_0x4244('0x26')]()['then'](function(){_0x390f46[_0x4244('0x1b')](0xcc)[_0x4244('0x27')]();});}};}function handleEntityNotFound(_0x136c6c,_0x1a0b34){return function(_0x4f79d1){if(!_0x4f79d1){_0x136c6c[_0x4244('0x28')](0x194);}return _0x4f79d1;};}function handleError(_0x29db24,_0x2e14d1){_0x2e14d1=_0x2e14d1||0x1f4;return function(_0x4b358f){logger['error'](_0x4b358f[_0x4244('0x29')]);if(_0x4b358f['name']){delete _0x4b358f[_0x4244('0x2a')];}_0x29db24[_0x4244('0x1b')](_0x2e14d1)[_0x4244('0x2b')](_0x4b358f);};}exports[_0x4244('0x2c')]=function(_0x35f139,_0x2c66c7){var _0x1b9b6f={},_0x22d2b1={},_0x559545={'count':0x0,'rows':[]};var _0x4f06e7=_[_0x4244('0x2d')](db[_0x4244('0x2e')][_0x4244('0x2f')],function(_0x318d21){return{'name':_0x318d21[_0x4244('0x30')],'type':_0x318d21[_0x4244('0x31')]['key']};});_0x22d2b1['model']=_['map'](_0x4f06e7,_0x4244('0x2a'));_0x22d2b1[_0x4244('0x32')]=_[_0x4244('0x33')](_0x35f139['query']);_0x22d2b1[_0x4244('0x34')]=_[_0x4244('0x35')](_0x22d2b1[_0x4244('0x36')],_0x22d2b1[_0x4244('0x32')]);_0x1b9b6f['attributes']=_[_0x4244('0x35')](_0x22d2b1[_0x4244('0x36')],qs[_0x4244('0x37')](_0x35f139[_0x4244('0x32')][_0x4244('0x37')]));_0x1b9b6f[_0x4244('0x38')]=_0x1b9b6f[_0x4244('0x38')][_0x4244('0x39')]?_0x1b9b6f[_0x4244('0x38')]:_0x22d2b1['model'];if(!_0x35f139[_0x4244('0x32')][_0x4244('0x3a')](_0x4244('0x3b'))){_0x1b9b6f[_0x4244('0x20')]=qs[_0x4244('0x20')](_0x35f139[_0x4244('0x32')][_0x4244('0x20')]);_0x1b9b6f[_0x4244('0x1d')]=qs[_0x4244('0x1d')](_0x35f139[_0x4244('0x32')][_0x4244('0x1d')]);}_0x1b9b6f[_0x4244('0x3c')]=qs[_0x4244('0x3d')](_0x35f139['query'][_0x4244('0x3d')]);_0x1b9b6f[_0x4244('0x3e')]=qs[_0x4244('0x34')](_[_0x4244('0x3f')](_0x35f139[_0x4244('0x32')],_0x22d2b1['filters']),_0x4f06e7);if(_0x35f139[_0x4244('0x32')][_0x4244('0x40')]){_0x1b9b6f[_0x4244('0x3e')]=_['merge'](_0x1b9b6f[_0x4244('0x3e')],{'$or':_[_0x4244('0x2d')](_0x4f06e7,function(_0x439b00){if(_0x439b00['type']!==_0x4244('0x41')){var _0x1dad55={};_0x1dad55[_0x439b00['name']]={'$like':'%'+_0x35f139[_0x4244('0x32')][_0x4244('0x40')]+'%'};return _0x1dad55;}})});}_0x1b9b6f=_['merge']({},_0x1b9b6f,_0x35f139[_0x4244('0x42')]);var _0x23d9c9={'where':_0x1b9b6f[_0x4244('0x3e')]};return db['MailSubstatus'][_0x4244('0x1f')](_0x23d9c9)[_0x4244('0x43')](function(_0x2bd32c){_0x559545[_0x4244('0x1f')]=_0x2bd32c;if(_0x35f139['query'][_0x4244('0x44')]){_0x1b9b6f[_0x4244('0x45')]=[{'all':!![]}];}return db['MailSubstatus'][_0x4244('0x46')](_0x1b9b6f);})[_0x4244('0x43')](function(_0x3ef801){_0x559545[_0x4244('0x47')]=_0x3ef801;return _0x559545;})[_0x4244('0x43')](respondWithFilteredResult(_0x2c66c7,_0x1b9b6f))['catch'](handleError(_0x2c66c7,null));};exports[_0x4244('0x48')]=function(_0x3bc38f,_0x1b6bbb){var _0x17f962={'raw':!![],'where':{'id':_0x3bc38f[_0x4244('0x49')]['id']}},_0x44c3ed={};_0x44c3ed[_0x4244('0x36')]=_[_0x4244('0x33')](db[_0x4244('0x2e')][_0x4244('0x2f')]);_0x44c3ed['query']=_[_0x4244('0x33')](_0x3bc38f['query']);_0x44c3ed[_0x4244('0x34')]=_[_0x4244('0x35')](_0x44c3ed[_0x4244('0x36')],_0x44c3ed['query']);_0x17f962[_0x4244('0x38')]=_['intersection'](_0x44c3ed[_0x4244('0x36')],qs['fields'](_0x3bc38f[_0x4244('0x32')][_0x4244('0x37')]));_0x17f962[_0x4244('0x38')]=_0x17f962[_0x4244('0x38')][_0x4244('0x39')]?_0x17f962[_0x4244('0x38')]:_0x44c3ed[_0x4244('0x36')];if(_0x3bc38f['query'][_0x4244('0x44')]){_0x17f962[_0x4244('0x45')]=[{'all':!![]}];}_0x17f962=_[_0x4244('0x4a')]({},_0x17f962,_0x3bc38f[_0x4244('0x42')]);return db[_0x4244('0x2e')][_0x4244('0x4b')](_0x17f962)[_0x4244('0x43')](handleEntityNotFound(_0x1b6bbb,null))[_0x4244('0x43')](respondWithResult(_0x1b6bbb,null))[_0x4244('0x4c')](handleError(_0x1b6bbb,null));};exports[_0x4244('0x4d')]=function(_0x300f02,_0x2caa21){return db[_0x4244('0x2e')][_0x4244('0x4d')](_0x300f02[_0x4244('0x4e')],{})[_0x4244('0x43')](respondWithResult(_0x2caa21,0xc9))['catch'](handleError(_0x2caa21,null));};exports[_0x4244('0x25')]=function(_0x2b4251,_0x38462c){if(_0x2b4251['body']['id']){delete _0x2b4251[_0x4244('0x4e')]['id'];}return db[_0x4244('0x2e')][_0x4244('0x4b')]({'where':{'id':_0x2b4251['params']['id']}})[_0x4244('0x43')](handleEntityNotFound(_0x38462c,null))[_0x4244('0x43')](saveUpdates(_0x2b4251[_0x4244('0x4e')],null))[_0x4244('0x43')](respondWithResult(_0x38462c,null))['catch'](handleError(_0x38462c,null));};exports['destroy']=function(_0x18150e,_0x43863e){return db['MailSubstatus'][_0x4244('0x4b')]({'where':{'id':_0x18150e[_0x4244('0x49')]['id']}})[_0x4244('0x43')](handleEntityNotFound(_0x43863e,null))[_0x4244('0x43')](removeEntity(_0x43863e,null))[_0x4244('0x4c')](handleError(_0x43863e,null));};exports['describe']=function(_0x32442e,_0x3bdeae){return db[_0x4244('0x2e')]['describe']()['then'](respondWithResult(_0x3bdeae,null))[_0x4244('0x4c')](handleError(_0x3bdeae,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index ea023ef..475d8e6 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 _0x63b8=['update','emit','hook','events','MailSubstatus','setMaxListeners'];(function(_0x474857,_0x271c2a){var _0x37a55e=function(_0x15bb11){while(--_0x15bb11){_0x474857['push'](_0x474857['shift']());}};_0x37a55e(++_0x271c2a);}(_0x63b8,0x17d));var _0x863b=function(_0x4674c3,_0x48f787){_0x4674c3=_0x4674c3-0x0;var _0x95024c=_0x63b8[_0x4674c3];return _0x95024c;};'use strict';var EventEmitter=require(_0x863b('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x863b('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x863b('0x2')](0x0);var events={'afterUpdate':_0x863b('0x3')};function emitEvent(_0x505c39){return function(_0x32ee58,_0x5dd080,_0x4d37af){MailSubstatusEvents[_0x863b('0x4')](_0x505c39+':'+_0x32ee58['id'],_0x32ee58);MailSubstatusEvents['emit'](_0x505c39,_0x32ee58);_0x4d37af(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x863b('0x5')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0x435e=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','MailSubstatus','setMaxListeners'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x435e,0x1b5));var _0xe435=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x435e[_0x51c819];return _0x15c5d2;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0xe435('0x0'))['db'][_0xe435('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xe435('0x2')](0x0);var events={'afterUpdate':_0xe435('0x3')};function emitEvent(_0x1caf01){return function(_0x1b4f9b,_0x273e7b,_0x88616e){MailSubstatusEvents[_0xe435('0x4')](_0x1caf01+':'+_0x1b4f9b['id'],_0x1b4f9b);MailSubstatusEvents[_0xe435('0x4')](_0x1caf01,_0x1b4f9b);_0x88616e(null);};}for(var e in events){if(events[_0xe435('0x5')](e)){var event=events[e];MailSubstatus[_0xe435('0x6')](e,emitEvent(event));}}module[_0xe435('0x7')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index a80d140..26c67b6 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 _0x22e4=['MailSubstatus','Condition','_previousDataValues','name','then','catch','./mailSubstatus.attributes','exports','models','define'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x22e4,0x150));var _0x422e=function(_0x47b30e,_0x281c63){_0x47b30e=_0x47b30e-0x0;var _0x4466b6=_0x22e4[_0x47b30e];return _0x4466b6;};'use strict';var attributes=require(_0x422e('0x0'));module[_0x422e('0x1')]=function(_0x45d05e){var _0x31a469=_0x45d05e[_0x422e('0x2')];return _0x45d05e[_0x422e('0x3')](_0x422e('0x4'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x2083f0,_0x22c639,_0x254af5){return _0x31a469[_0x422e('0x5')]['update']({'value':_0x2083f0['name']},{'where':{'field':'mailSubstatus','value':_0x2083f0[_0x422e('0x6')][_0x422e('0x7')]}})[_0x422e('0x8')](function(){_0x254af5();})[_0x422e('0x9')](function(_0x1c69a6){_0x254af5(_0x1c69a6);});}}});}; \ No newline at end of file +var _0x3110=['name','mailSubstatus','_previousDataValues','then','catch','exports','define','mail_substatuses','Condition','update'];(function(_0x2bbce4,_0x3fd360){var _0x25aab8=function(_0x187925){while(--_0x187925){_0x2bbce4['push'](_0x2bbce4['shift']());}};_0x25aab8(++_0x3fd360);}(_0x3110,0xf5));var _0x0311=function(_0x3cfd2a,_0x18f938){_0x3cfd2a=_0x3cfd2a-0x0;var _0x19f061=_0x3110[_0x3cfd2a];return _0x19f061;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x0311('0x0')]=function(_0x76cf94){var _0x231c41=_0x76cf94['models'];return _0x76cf94[_0x0311('0x1')]('MailSubstatus',attributes,{'tableName':_0x0311('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x347d06,_0x147038,_0x198b53){return _0x231c41[_0x0311('0x3')][_0x0311('0x4')]({'value':_0x347d06[_0x0311('0x5')]},{'where':{'field':_0x0311('0x6'),'value':_0x347d06[_0x0311('0x7')][_0x0311('0x5')]}})[_0x0311('0x8')](function(){_0x198b53();})[_0x0311('0x9')](function(_0x2a9681){_0x198b53(_0x2a9681);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index ee9eb75..7708eba 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 _0x1b2b=['rpc','jayson/promise','client','http','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x50f112,_0xd38e53){var _0x4ecf28=function(_0x62b75){while(--_0x62b75){_0x50f112['push'](_0x50f112['shift']());}};_0x4ecf28(++_0xd38e53);}(_0x1b2b,0xde));var _0xb1b2=function(_0x165194,_0x31a93e){_0x165194=_0x165194-0x0;var _0x2975f0=_0x1b2b[_0x165194];return _0x2975f0;};'use strict';var _=require(_0xb1b2('0x0'));var util=require(_0xb1b2('0x1'));var moment=require(_0xb1b2('0x2'));var BPromise=require(_0xb1b2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb1b2('0x4'));var db=require(_0xb1b2('0x5'))['db'];var utils=require(_0xb1b2('0x6'));var logger=require(_0xb1b2('0x7'))(_0xb1b2('0x8'));var config=require('../../config/environment');var jayson=require(_0xb1b2('0x9'));var client=jayson[_0xb1b2('0xa')][_0xb1b2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x513b78,_0x81810f,_0x19aff3){return new BPromise(function(_0x4f76b8,_0x302a95){return client['request'](_0x513b78,_0x19aff3)['then'](function(_0x4e718a){logger[_0xb1b2('0xc')](_0xb1b2('0xd'),_0x81810f,_0xb1b2('0xe'));logger[_0xb1b2('0xf')](_0xb1b2('0x10'),_0x81810f,_0xb1b2('0xe'),JSON[_0xb1b2('0x11')](_0x4e718a));if(_0x4e718a[_0xb1b2('0x12')]){if(_0x4e718a[_0xb1b2('0x12')][_0xb1b2('0x13')]===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x81810f,_0x4e718a[_0xb1b2('0x12')][_0xb1b2('0x14')]);return _0x302a95(_0x4e718a['error'][_0xb1b2('0x14')]);}logger[_0xb1b2('0x12')](_0xb1b2('0xd'),_0x81810f,_0x4e718a[_0xb1b2('0x12')]['message']);return _0x4f76b8(_0x4e718a['error'][_0xb1b2('0x14')]);}else{logger[_0xb1b2('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x81810f,_0xb1b2('0xe'));_0x4f76b8(_0x4e718a[_0xb1b2('0x15')][_0xb1b2('0x14')]);}})[_0xb1b2('0x16')](function(_0x1e4b34){logger['error'](_0xb1b2('0xd'),_0x81810f,_0x1e4b34);_0x302a95(_0x1e4b34);});});} \ No newline at end of file +var _0xe806=['code','MailSubstatus,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4b1e60,_0x4a2e1c){var _0x27f958=function(_0x3570d2){while(--_0x3570d2){_0x4b1e60['push'](_0x4b1e60['shift']());}};_0x27f958(++_0x4a2e1c);}(_0xe806,0x15c));var _0x6e80=function(_0x2aa062,_0x246881){_0x2aa062=_0x2aa062-0x0;var _0x1e352e=_0xe806[_0x2aa062];return _0x1e352e;};'use strict';var _=require(_0x6e80('0x0'));var util=require(_0x6e80('0x1'));var moment=require(_0x6e80('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6e80('0x3'))['db'];var utils=require(_0x6e80('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x6e80('0x5'));var jayson=require(_0x6e80('0x6'));var client=jayson[_0x6e80('0x7')][_0x6e80('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1856d8,_0x1c1940,_0x2e622c){return new BPromise(function(_0x292351,_0x1d5f52){return client[_0x6e80('0x9')](_0x1856d8,_0x2e622c)['then'](function(_0x2a0853){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x1c1940,'request\x20sent');logger['debug'](_0x6e80('0xa'),_0x1c1940,'request\x20sent',JSON[_0x6e80('0xb')](_0x2a0853));if(_0x2a0853['error']){if(_0x2a0853[_0x6e80('0xc')][_0x6e80('0xd')]===0x1f4){logger[_0x6e80('0xc')](_0x6e80('0xe'),_0x1c1940,_0x2a0853['error'][_0x6e80('0xf')]);return _0x1d5f52(_0x2a0853[_0x6e80('0xc')][_0x6e80('0xf')]);}logger[_0x6e80('0xc')](_0x6e80('0xe'),_0x1c1940,_0x2a0853[_0x6e80('0xc')]['message']);return _0x292351(_0x2a0853['error'][_0x6e80('0xf')]);}else{logger[_0x6e80('0x10')](_0x6e80('0xe'),_0x1c1940,'request\x20sent');_0x292351(_0x2a0853[_0x6e80('0x11')][_0x6e80('0xf')]);}})[_0x6e80('0x12')](function(_0x45d57f){logger[_0x6e80('0xc')](_0x6e80('0xe'),_0x1c1940,_0x45d57f);_0x1d5f52(_0x45d57f);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 4bbfe85..62b1afd 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 _0x69e7=['isAuthenticated','get','/describe','describe','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x390143,_0x2b54ac){var _0x11361b=function(_0x3666c3){while(--_0x3666c3){_0x390143['push'](_0x390143['shift']());}};_0x11361b(++_0x2b54ac);}(_0x69e7,0xdc));var _0x769e=function(_0x45a48f,_0x64e6af){_0x45a48f=_0x45a48f-0x0;var _0x27b4c3=_0x69e7[_0x45a48f];return _0x27b4c3;};'use strict';var multer=require(_0x769e('0x0'));var util=require(_0x769e('0x1'));var path=require(_0x769e('0x2'));var timeout=require(_0x769e('0x3'));var express=require(_0x769e('0x4'));var router=express[_0x769e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x769e('0x6'));var interaction=require(_0x769e('0x7'));var config=require('../../config/environment');var controller=require('./mailTransferReport.controller');router['get']('/',auth[_0x769e('0x8')](),controller['index']);router[_0x769e('0x9')](_0x769e('0xa'),auth[_0x769e('0x8')](),controller[_0x769e('0xb')]);router['get'](_0x769e('0xc'),auth[_0x769e('0x8')](),controller[_0x769e('0xd')]);router[_0x769e('0xe')]('/',auth[_0x769e('0x8')](),controller['create']);router[_0x769e('0xf')](_0x769e('0xc'),auth[_0x769e('0x8')](),controller[_0x769e('0x10')]);router['delete'](_0x769e('0xc'),auth['isAuthenticated'](),controller[_0x769e('0x11')]);module[_0x769e('0x12')]=router; \ No newline at end of file +var _0x5604=['/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0x167984,_0x32db58){var _0x4ab4f6=function(_0x3cc892){while(--_0x3cc892){_0x167984['push'](_0x167984['shift']());}};_0x4ab4f6(++_0x32db58);}(_0x5604,0x93));var _0x4560=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0x5604[_0x251d9c];return _0x16ae64;};'use strict';var multer=require(_0x4560('0x0'));var util=require(_0x4560('0x1'));var path=require(_0x4560('0x2'));var timeout=require(_0x4560('0x3'));var express=require(_0x4560('0x4'));var router=express['Router']();var fs_extra=require(_0x4560('0x5'));var auth=require(_0x4560('0x6'));var interaction=require(_0x4560('0x7'));var config=require(_0x4560('0x8'));var controller=require('./mailTransferReport.controller');router[_0x4560('0x9')]('/',auth[_0x4560('0xa')](),controller[_0x4560('0xb')]);router[_0x4560('0x9')]('/describe',auth[_0x4560('0xa')](),controller[_0x4560('0xc')]);router[_0x4560('0x9')](_0x4560('0xd'),auth[_0x4560('0xa')](),controller['show']);router[_0x4560('0xe')]('/',auth[_0x4560('0xa')](),controller[_0x4560('0xf')]);router[_0x4560('0x10')](_0x4560('0xd'),auth[_0x4560('0xa')](),controller['update']);router[_0x4560('0x11')](_0x4560('0xd'),auth[_0x4560('0xa')](),controller[_0x4560('0x12')]);module[_0x4560('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index a8f9f64..326ebf5 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x1ce71c,_0x1f2369){var _0x38c215=function(_0x2777b7){while(--_0x2777b7){_0x1ce71c['push'](_0x1ce71c['shift']());}};_0x38c215(++_0x1f2369);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x3e25d4,_0x1333ba){var _0x26d077=function(_0x2dcd59){while(--_0x2dcd59){_0x3e25d4['push'](_0x3e25d4['shift']());}};_0x26d077(++_0x1333ba);}(_0xedd9,0xfc));var _0x9edd=function(_0x2f4139,_0x115369){_0x2f4139=_0x2f4139-0x0;var _0x4f5aa9=_0xedd9[_0x2f4139];return _0x4f5aa9;};'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 diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 1858056..087cb8e 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 _0x5a84=['sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','reject','save','update','then','destroy','error','name','send','map','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','MailTransferReport','includeAll','include','params','rawAttributes','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path'];(function(_0x1c3d0b,_0x6a0247){var _0x47ce7a=function(_0x32f700){while(--_0x32f700){_0x1c3d0b['push'](_0x1c3d0b['shift']());}};_0x47ce7a(++_0x6a0247);}(_0x5a84,0x197));var _0x45a8=function(_0x417c2a,_0x16470e){_0x417c2a=_0x417c2a-0x0;var _0x284423=_0x5a84[_0x417c2a];return _0x284423;};'use strict';var emlformat=require(_0x45a8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x45a8('0x1'));var jsonpatch=require(_0x45a8('0x2'));var rp=require(_0x45a8('0x3'));var moment=require('moment');var BPromise=require(_0x45a8('0x4'));var Mustache=require('mustache');var util=require(_0x45a8('0x5'));var path=require(_0x45a8('0x6'));var sox=require(_0x45a8('0x7'));var csv=require(_0x45a8('0x8'));var ejs=require(_0x45a8('0x9'));var fs=require('fs');var fs_extra=require(_0x45a8('0xa'));var _=require(_0x45a8('0xb'));var squel=require('squel');var crypto=require(_0x45a8('0xc'));var jsforce=require(_0x45a8('0xd'));var deskjs=require(_0x45a8('0xe'));var toCsv=require(_0x45a8('0x8'));var querystring=require('querystring');var Papa=require(_0x45a8('0xf'));var Redis=require(_0x45a8('0x10'));var authService=require(_0x45a8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x45a8('0x12'));var hardwareService=require(_0x45a8('0x13'));var logger=require(_0x45a8('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x45a8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x45a8('0x16'))['db'];function respondWithStatusCode(_0x339e6b,_0x4e75dd){_0x4e75dd=_0x4e75dd||0xcc;return function(_0x27a257){if(_0x27a257){return _0x339e6b['sendStatus'](_0x4e75dd);}return _0x339e6b[_0x45a8('0x17')](_0x4e75dd)[_0x45a8('0x18')]();};}function respondWithResult(_0x28878a,_0x53d8f6){_0x53d8f6=_0x53d8f6||0xc8;return function(_0x21d94c){if(_0x21d94c){return _0x28878a[_0x45a8('0x17')](_0x53d8f6)['json'](_0x21d94c);}};}function respondWithFilteredResult(_0x3a6561,_0x398bfa){return function(_0x3ee57a){if(_0x3ee57a){var _0x492d3c=typeof _0x398bfa[_0x45a8('0x19')]===_0x45a8('0x1a')&&typeof _0x398bfa[_0x45a8('0x1b')]===_0x45a8('0x1a');var _0x1ddf5f=_0x3ee57a[_0x45a8('0x1c')];var _0x540330=_0x492d3c?0x0:_0x398bfa[_0x45a8('0x19')];var _0x198bcb=_0x492d3c?_0x3ee57a[_0x45a8('0x1c')]:_0x398bfa['offset']+_0x398bfa['limit'];var _0x44f867;if(_0x198bcb>=_0x1ddf5f){_0x198bcb=_0x1ddf5f;_0x44f867=0xc8;}else{_0x44f867=0xce;}_0x3a6561[_0x45a8('0x17')](_0x44f867);return _0x3a6561['set']('Content-Range',_0x540330+'-'+_0x198bcb+'/'+_0x1ddf5f)['json'](_0x3ee57a);}return null;};}function patchUpdates(_0x5a8293){return function(_0x47bf3e){try{jsonpatch['apply'](_0x47bf3e,_0x5a8293,!![]);}catch(_0x297415){return BPromise[_0x45a8('0x1d')](_0x297415);}return _0x47bf3e[_0x45a8('0x1e')]();};}function saveUpdates(_0x18a6b2,_0x116114){return function(_0x31eb5c){if(_0x31eb5c){return _0x31eb5c[_0x45a8('0x1f')](_0x18a6b2)[_0x45a8('0x20')](function(_0x196dce){return _0x196dce;});}return null;};}function removeEntity(_0x553706,_0x2cd7f5){return function(_0x414e6b){if(_0x414e6b){return _0x414e6b[_0x45a8('0x21')]()[_0x45a8('0x20')](function(){_0x553706[_0x45a8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12fea9,_0x581d06){return function(_0x55eefa){if(!_0x55eefa){_0x12fea9['sendStatus'](0x194);}return _0x55eefa;};}function handleError(_0x282478,_0x2111d5){_0x2111d5=_0x2111d5||0x1f4;return function(_0x1ac007){logger[_0x45a8('0x22')](_0x1ac007['stack']);if(_0x1ac007[_0x45a8('0x23')]){delete _0x1ac007[_0x45a8('0x23')];}_0x282478[_0x45a8('0x17')](_0x2111d5)[_0x45a8('0x24')](_0x1ac007);};}exports['index']=function(_0x36e905,_0xea1e2a){var _0x347467={},_0x19c7f6={},_0x97ec1f={'count':0x0,'rows':[]};var _0x1bbaf4=_[_0x45a8('0x25')](db['MailTransferReport']['rawAttributes'],function(_0x272083){return{'name':_0x272083[_0x45a8('0x26')],'type':_0x272083['type'][_0x45a8('0x27')]};});_0x19c7f6[_0x45a8('0x28')]=_[_0x45a8('0x25')](_0x1bbaf4,_0x45a8('0x23'));_0x19c7f6['query']=_[_0x45a8('0x29')](_0x36e905[_0x45a8('0x2a')]);_0x19c7f6[_0x45a8('0x2b')]=_[_0x45a8('0x2c')](_0x19c7f6[_0x45a8('0x28')],_0x19c7f6[_0x45a8('0x2a')]);_0x347467['attributes']=_[_0x45a8('0x2c')](_0x19c7f6['model'],qs[_0x45a8('0x2d')](_0x36e905[_0x45a8('0x2a')][_0x45a8('0x2d')]));_0x347467[_0x45a8('0x2e')]=_0x347467[_0x45a8('0x2e')][_0x45a8('0x2f')]?_0x347467[_0x45a8('0x2e')]:_0x19c7f6[_0x45a8('0x28')];if(!_0x36e905[_0x45a8('0x2a')][_0x45a8('0x30')](_0x45a8('0x31'))){_0x347467[_0x45a8('0x1b')]=qs[_0x45a8('0x1b')](_0x36e905[_0x45a8('0x2a')][_0x45a8('0x1b')]);_0x347467[_0x45a8('0x19')]=qs[_0x45a8('0x19')](_0x36e905['query'][_0x45a8('0x19')]);}_0x347467[_0x45a8('0x32')]=qs[_0x45a8('0x33')](_0x36e905['query'][_0x45a8('0x33')]);_0x347467[_0x45a8('0x34')]=qs['filters'](_[_0x45a8('0x35')](_0x36e905[_0x45a8('0x2a')],_0x19c7f6[_0x45a8('0x2b')]),_0x1bbaf4);if(_0x36e905[_0x45a8('0x2a')]['filter']){_0x347467[_0x45a8('0x34')]=_[_0x45a8('0x36')](_0x347467['where'],{'$or':_['map'](_0x1bbaf4,function(_0x45c0ca){if(_0x45c0ca[_0x45a8('0x37')]!==_0x45a8('0x38')){var _0x2b47dd={};_0x2b47dd[_0x45c0ca['name']]={'$like':'%'+_0x36e905[_0x45a8('0x2a')][_0x45a8('0x39')]+'%'};return _0x2b47dd;}})});}_0x347467=_['merge']({},_0x347467,_0x36e905[_0x45a8('0x3a')]);var _0x14a9d8={'where':_0x347467[_0x45a8('0x34')]};return db[_0x45a8('0x3b')]['count'](_0x14a9d8)['then'](function(_0x3cd335){_0x97ec1f[_0x45a8('0x1c')]=_0x3cd335;if(_0x36e905[_0x45a8('0x2a')][_0x45a8('0x3c')]){_0x347467[_0x45a8('0x3d')]=[{'all':!![]}];}return db[_0x45a8('0x3b')]['findAll'](_0x347467);})[_0x45a8('0x20')](function(_0x9a8300){_0x97ec1f['rows']=_0x9a8300;return _0x97ec1f;})[_0x45a8('0x20')](respondWithFilteredResult(_0xea1e2a,_0x347467))['catch'](handleError(_0xea1e2a,null));};exports['show']=function(_0x3f6d3f,_0x4afa40){var _0x1dcccf={'raw':!![],'where':{'id':_0x3f6d3f[_0x45a8('0x3e')]['id']}},_0x524d7f={};_0x524d7f[_0x45a8('0x28')]=_[_0x45a8('0x29')](db['MailTransferReport'][_0x45a8('0x3f')]);_0x524d7f[_0x45a8('0x2a')]=_[_0x45a8('0x29')](_0x3f6d3f[_0x45a8('0x2a')]);_0x524d7f[_0x45a8('0x2b')]=_['intersection'](_0x524d7f[_0x45a8('0x28')],_0x524d7f[_0x45a8('0x2a')]);_0x1dcccf['attributes']=_[_0x45a8('0x2c')](_0x524d7f[_0x45a8('0x28')],qs[_0x45a8('0x2d')](_0x3f6d3f['query'][_0x45a8('0x2d')]));_0x1dcccf[_0x45a8('0x2e')]=_0x1dcccf[_0x45a8('0x2e')][_0x45a8('0x2f')]?_0x1dcccf[_0x45a8('0x2e')]:_0x524d7f[_0x45a8('0x28')];if(_0x3f6d3f[_0x45a8('0x2a')]['includeAll']){_0x1dcccf[_0x45a8('0x3d')]=[{'all':!![]}];}_0x1dcccf=_['merge']({},_0x1dcccf,_0x3f6d3f[_0x45a8('0x3a')]);return db[_0x45a8('0x3b')][_0x45a8('0x40')](_0x1dcccf)[_0x45a8('0x20')](handleEntityNotFound(_0x4afa40,null))[_0x45a8('0x20')](respondWithResult(_0x4afa40,null))[_0x45a8('0x41')](handleError(_0x4afa40,null));};exports[_0x45a8('0x42')]=function(_0x4b4f97,_0x344ba3){return db[_0x45a8('0x3b')]['create'](_0x4b4f97[_0x45a8('0x43')],{})[_0x45a8('0x20')](respondWithResult(_0x344ba3,0xc9))[_0x45a8('0x41')](handleError(_0x344ba3,null));};exports[_0x45a8('0x1f')]=function(_0x3303db,_0x2d62f1){if(_0x3303db[_0x45a8('0x43')]['id']){delete _0x3303db[_0x45a8('0x43')]['id'];}return db['MailTransferReport'][_0x45a8('0x40')]({'where':{'id':_0x3303db[_0x45a8('0x3e')]['id']}})[_0x45a8('0x20')](handleEntityNotFound(_0x2d62f1,null))['then'](saveUpdates(_0x3303db['body'],null))['then'](respondWithResult(_0x2d62f1,null))[_0x45a8('0x41')](handleError(_0x2d62f1,null));};exports[_0x45a8('0x21')]=function(_0x2a08fe,_0x241b5a){return db[_0x45a8('0x3b')][_0x45a8('0x40')]({'where':{'id':_0x2a08fe[_0x45a8('0x3e')]['id']}})['then'](handleEntityNotFound(_0x241b5a,null))['then'](removeEntity(_0x241b5a,null))[_0x45a8('0x41')](handleError(_0x241b5a,null));};exports[_0x45a8('0x44')]=function(_0x1f867f,_0x2e6251){return db['MailTransferReport']['describe']()[_0x45a8('0x20')](respondWithResult(_0x2e6251,null))[_0x45a8('0x41')](handleError(_0x2e6251,null));}; \ No newline at end of file +var _0xeceb=['count','Content-Range','reject','save','update','then','end','sendStatus','error','name','send','index','rawAttributes','fieldName','map','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','MailTransferReport','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit'];(function(_0x3ed335,_0x38eabd){var _0x54f7fa=function(_0x32e0d8){while(--_0x32e0d8){_0x3ed335['push'](_0x3ed335['shift']());}};_0x54f7fa(++_0x38eabd);}(_0xeceb,0x10c));var _0xbece=function(_0x58b6b9,_0x49baad){_0x58b6b9=_0x58b6b9-0x0;var _0x1a5c8c=_0xeceb[_0x58b6b9];return _0x1a5c8c;};'use strict';var emlformat=require(_0xbece('0x0'));var rimraf=require(_0xbece('0x1'));var zipdir=require(_0xbece('0x2'));var jsonpatch=require(_0xbece('0x3'));var rp=require(_0xbece('0x4'));var moment=require('moment');var BPromise=require(_0xbece('0x5'));var Mustache=require(_0xbece('0x6'));var util=require('util');var path=require(_0xbece('0x7'));var sox=require(_0xbece('0x8'));var csv=require(_0xbece('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbece('0xa'));var squel=require(_0xbece('0xb'));var crypto=require(_0xbece('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbece('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbece('0xe'));var Papa=require('papaparse');var Redis=require(_0xbece('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbece('0x10'));var as=require(_0xbece('0x11'));var hardwareService=require(_0xbece('0x12'));var logger=require(_0xbece('0x13'))(_0xbece('0x14'));var utils=require('../../config/utils');var config=require(_0xbece('0x15'));var licenseUtil=require(_0xbece('0x16'));var db=require(_0xbece('0x17'))['db'];function respondWithStatusCode(_0x38d62f,_0x5609de){_0x5609de=_0x5609de||0xcc;return function(_0x1e8a3b){if(_0x1e8a3b){return _0x38d62f['sendStatus'](_0x5609de);}return _0x38d62f[_0xbece('0x18')](_0x5609de)['end']();};}function respondWithResult(_0x58c106,_0x25386d){_0x25386d=_0x25386d||0xc8;return function(_0x33635e){if(_0x33635e){return _0x58c106[_0xbece('0x18')](_0x25386d)[_0xbece('0x19')](_0x33635e);}};}function respondWithFilteredResult(_0x27c91e,_0x57d420){return function(_0x2344e4){if(_0x2344e4){var _0x52875a=typeof _0x57d420[_0xbece('0x1a')]==='undefined'&&typeof _0x57d420[_0xbece('0x1b')]==='undefined';var _0x85b262=_0x2344e4[_0xbece('0x1c')];var _0x281074=_0x52875a?0x0:_0x57d420[_0xbece('0x1a')];var _0x5c8e21=_0x52875a?_0x2344e4[_0xbece('0x1c')]:_0x57d420['offset']+_0x57d420['limit'];var _0x324425;if(_0x5c8e21>=_0x85b262){_0x5c8e21=_0x85b262;_0x324425=0xc8;}else{_0x324425=0xce;}_0x27c91e[_0xbece('0x18')](_0x324425);return _0x27c91e['set'](_0xbece('0x1d'),_0x281074+'-'+_0x5c8e21+'/'+_0x85b262)['json'](_0x2344e4);}return null;};}function patchUpdates(_0xe9677a){return function(_0xd162c9){try{jsonpatch['apply'](_0xd162c9,_0xe9677a,!![]);}catch(_0x4c83b0){return BPromise[_0xbece('0x1e')](_0x4c83b0);}return _0xd162c9[_0xbece('0x1f')]();};}function saveUpdates(_0x5ec8c0,_0x2f0e1a){return function(_0x300f7c){if(_0x300f7c){return _0x300f7c[_0xbece('0x20')](_0x5ec8c0)[_0xbece('0x21')](function(_0x516544){return _0x516544;});}return null;};}function removeEntity(_0x5b3355,_0x400eda){return function(_0x64a35d){if(_0x64a35d){return _0x64a35d['destroy']()[_0xbece('0x21')](function(){_0x5b3355['status'](0xcc)[_0xbece('0x22')]();});}};}function handleEntityNotFound(_0x3bf7f4,_0x26707e){return function(_0x5634ec){if(!_0x5634ec){_0x3bf7f4[_0xbece('0x23')](0x194);}return _0x5634ec;};}function handleError(_0x4c1f1e,_0x1cb9af){_0x1cb9af=_0x1cb9af||0x1f4;return function(_0x4e569c){logger[_0xbece('0x24')](_0x4e569c['stack']);if(_0x4e569c['name']){delete _0x4e569c[_0xbece('0x25')];}_0x4c1f1e['status'](_0x1cb9af)[_0xbece('0x26')](_0x4e569c);};}exports[_0xbece('0x27')]=function(_0x378f5a,_0x1e10d9){var _0x376aec={},_0x3076d5={},_0x7f2d43={'count':0x0,'rows':[]};var _0x408fae=_['map'](db['MailTransferReport'][_0xbece('0x28')],function(_0x4e7ed2){return{'name':_0x4e7ed2[_0xbece('0x29')],'type':_0x4e7ed2['type']['key']};});_0x3076d5['model']=_[_0xbece('0x2a')](_0x408fae,_0xbece('0x25'));_0x3076d5['query']=_[_0xbece('0x2b')](_0x378f5a[_0xbece('0x2c')]);_0x3076d5[_0xbece('0x2d')]=_[_0xbece('0x2e')](_0x3076d5[_0xbece('0x2f')],_0x3076d5[_0xbece('0x2c')]);_0x376aec['attributes']=_[_0xbece('0x2e')](_0x3076d5[_0xbece('0x2f')],qs[_0xbece('0x30')](_0x378f5a[_0xbece('0x2c')][_0xbece('0x30')]));_0x376aec[_0xbece('0x31')]=_0x376aec[_0xbece('0x31')][_0xbece('0x32')]?_0x376aec[_0xbece('0x31')]:_0x3076d5['model'];if(!_0x378f5a[_0xbece('0x2c')][_0xbece('0x33')](_0xbece('0x34'))){_0x376aec[_0xbece('0x1b')]=qs[_0xbece('0x1b')](_0x378f5a[_0xbece('0x2c')][_0xbece('0x1b')]);_0x376aec[_0xbece('0x1a')]=qs['offset'](_0x378f5a[_0xbece('0x2c')][_0xbece('0x1a')]);}_0x376aec[_0xbece('0x35')]=qs['sort'](_0x378f5a[_0xbece('0x2c')][_0xbece('0x36')]);_0x376aec[_0xbece('0x37')]=qs[_0xbece('0x2d')](_[_0xbece('0x38')](_0x378f5a['query'],_0x3076d5[_0xbece('0x2d')]),_0x408fae);if(_0x378f5a[_0xbece('0x2c')]['filter']){_0x376aec[_0xbece('0x37')]=_['merge'](_0x376aec[_0xbece('0x37')],{'$or':_['map'](_0x408fae,function(_0xf25440){if(_0xf25440[_0xbece('0x39')]!==_0xbece('0x3a')){var _0x427e12={};_0x427e12[_0xf25440['name']]={'$like':'%'+_0x378f5a[_0xbece('0x2c')][_0xbece('0x3b')]+'%'};return _0x427e12;}})});}_0x376aec=_[_0xbece('0x3c')]({},_0x376aec,_0x378f5a[_0xbece('0x3d')]);var _0x246a41={'where':_0x376aec[_0xbece('0x37')]};return db[_0xbece('0x3e')]['count'](_0x246a41)[_0xbece('0x21')](function(_0x5052a2){_0x7f2d43[_0xbece('0x1c')]=_0x5052a2;if(_0x378f5a[_0xbece('0x2c')]['includeAll']){_0x376aec[_0xbece('0x3f')]=[{'all':!![]}];}return db['MailTransferReport'][_0xbece('0x40')](_0x376aec);})['then'](function(_0xda0038){_0x7f2d43[_0xbece('0x41')]=_0xda0038;return _0x7f2d43;})[_0xbece('0x21')](respondWithFilteredResult(_0x1e10d9,_0x376aec))[_0xbece('0x42')](handleError(_0x1e10d9,null));};exports[_0xbece('0x43')]=function(_0x4c7e44,_0x2d7a66){var _0x3218c4={'raw':!![],'where':{'id':_0x4c7e44[_0xbece('0x44')]['id']}},_0x5a8bbc={};_0x5a8bbc[_0xbece('0x2f')]=_[_0xbece('0x2b')](db['MailTransferReport']['rawAttributes']);_0x5a8bbc[_0xbece('0x2c')]=_[_0xbece('0x2b')](_0x4c7e44[_0xbece('0x2c')]);_0x5a8bbc['filters']=_[_0xbece('0x2e')](_0x5a8bbc[_0xbece('0x2f')],_0x5a8bbc[_0xbece('0x2c')]);_0x3218c4[_0xbece('0x31')]=_[_0xbece('0x2e')](_0x5a8bbc[_0xbece('0x2f')],qs['fields'](_0x4c7e44[_0xbece('0x2c')]['fields']));_0x3218c4[_0xbece('0x31')]=_0x3218c4[_0xbece('0x31')]['length']?_0x3218c4[_0xbece('0x31')]:_0x5a8bbc[_0xbece('0x2f')];if(_0x4c7e44['query']['includeAll']){_0x3218c4[_0xbece('0x3f')]=[{'all':!![]}];}_0x3218c4=_[_0xbece('0x3c')]({},_0x3218c4,_0x4c7e44[_0xbece('0x3d')]);return db[_0xbece('0x3e')][_0xbece('0x45')](_0x3218c4)[_0xbece('0x21')](handleEntityNotFound(_0x2d7a66,null))['then'](respondWithResult(_0x2d7a66,null))[_0xbece('0x42')](handleError(_0x2d7a66,null));};exports[_0xbece('0x46')]=function(_0x5d9748,_0x1aed17){return db[_0xbece('0x3e')][_0xbece('0x46')](_0x5d9748[_0xbece('0x47')],{})['then'](respondWithResult(_0x1aed17,0xc9))[_0xbece('0x42')](handleError(_0x1aed17,null));};exports[_0xbece('0x20')]=function(_0x1d9d28,_0x3b54a5){if(_0x1d9d28[_0xbece('0x47')]['id']){delete _0x1d9d28[_0xbece('0x47')]['id'];}return db[_0xbece('0x3e')]['find']({'where':{'id':_0x1d9d28[_0xbece('0x44')]['id']}})[_0xbece('0x21')](handleEntityNotFound(_0x3b54a5,null))[_0xbece('0x21')](saveUpdates(_0x1d9d28[_0xbece('0x47')],null))['then'](respondWithResult(_0x3b54a5,null))[_0xbece('0x42')](handleError(_0x3b54a5,null));};exports[_0xbece('0x48')]=function(_0x1bf2a3,_0x1e4781){return db[_0xbece('0x3e')][_0xbece('0x45')]({'where':{'id':_0x1bf2a3[_0xbece('0x44')]['id']}})[_0xbece('0x21')](handleEntityNotFound(_0x1e4781,null))[_0xbece('0x21')](removeEntity(_0x1e4781,null))['catch'](handleError(_0x1e4781,null));};exports[_0xbece('0x49')]=function(_0x1389ca,_0xa75355){return db[_0xbece('0x3e')][_0xbece('0x49')]()[_0xbece('0x21')](respondWithResult(_0xa75355,null))['catch'](handleError(_0xa75355,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 1e526c8..4ea42d6 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 _0xd307=['../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd307,0x110));var _0x7d30=function(_0xaf69f,_0x49063f){_0xaf69f=_0xaf69f-0x0;var _0x1cadef=_0xd307[_0xaf69f];return _0x1cadef;};'use strict';var _=require(_0x7d30('0x0'));var util=require(_0x7d30('0x1'));var logger=require(_0x7d30('0x2'))(_0x7d30('0x3'));var moment=require(_0x7d30('0x4'));var BPromise=require(_0x7d30('0x5'));var rp=require(_0x7d30('0x6'));var fs=require('fs');var path=require(_0x7d30('0x7'));var rimraf=require('rimraf');var config=require(_0x7d30('0x8'));var attributes=require(_0x7d30('0x9'));module['exports']=function(_0x400916,_0x449938){return _0x400916[_0x7d30('0xa')](_0x7d30('0xb'),attributes,{'tableName':_0x7d30('0xc'),'paranoid':![],'indexes':[{'name':_0x7d30('0xd'),'fields':[_0x7d30('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x57cf=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','report_mail_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x46a31b,_0x11be27){var _0x386557=function(_0x6b1e64){while(--_0x6b1e64){_0x46a31b['push'](_0x46a31b['shift']());}};_0x386557(++_0x11be27);}(_0x57cf,0x11b));var _0xf57c=function(_0x43371b,_0x1cb4cf){_0x43371b=_0x43371b-0x0;var _0x19cd26=_0x57cf[_0x43371b];return _0x19cd26;};'use strict';var _=require(_0xf57c('0x0'));var util=require(_0xf57c('0x1'));var logger=require(_0xf57c('0x2'))(_0xf57c('0x3'));var moment=require(_0xf57c('0x4'));var BPromise=require(_0xf57c('0x5'));var rp=require(_0xf57c('0x6'));var fs=require('fs');var path=require(_0xf57c('0x7'));var rimraf=require(_0xf57c('0x8'));var config=require(_0xf57c('0x9'));var attributes=require('./mailTransferReport.attributes');module[_0xf57c('0xa')]=function(_0x4a5d1d,_0x12b00f){return _0x4a5d1d['define']('MailTransferReport',attributes,{'tableName':_0xf57c('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf57c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index c735ce5..64a7752 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 _0x31ce=['message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x31ce,0x192));var _0xe31c=function(_0x788a54,_0x12450b){_0x788a54=_0x788a54-0x0;var _0x8b73a4=_0x31ce[_0x788a54];return _0x8b73a4;};'use strict';var _=require(_0xe31c('0x0'));var util=require('util');var moment=require(_0xe31c('0x1'));var BPromise=require(_0xe31c('0x2'));var rs=require(_0xe31c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe31c('0x4'))['db'];var utils=require(_0xe31c('0x5'));var logger=require(_0xe31c('0x6'))(_0xe31c('0x7'));var config=require(_0xe31c('0x8'));var jayson=require(_0xe31c('0x9'));var client=jayson[_0xe31c('0xa')][_0xe31c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13f33c,_0x4bb807,_0x1f1df6){return new BPromise(function(_0x2caa83,_0x284dd5){return client['request'](_0x13f33c,_0x1f1df6)['then'](function(_0x2d6d28){logger['info'](_0xe31c('0xc'),_0x4bb807,_0xe31c('0xd'));logger[_0xe31c('0xe')](_0xe31c('0xf'),_0x4bb807,'request\x20sent',JSON['stringify'](_0x2d6d28));if(_0x2d6d28['error']){if(_0x2d6d28[_0xe31c('0x10')][_0xe31c('0x11')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x4bb807,_0x2d6d28[_0xe31c('0x10')][_0xe31c('0x12')]);return _0x284dd5(_0x2d6d28['error'][_0xe31c('0x12')]);}logger[_0xe31c('0x10')](_0xe31c('0xc'),_0x4bb807,_0x2d6d28[_0xe31c('0x10')][_0xe31c('0x12')]);return _0x2caa83(_0x2d6d28[_0xe31c('0x10')][_0xe31c('0x12')]);}else{logger['info'](_0xe31c('0xc'),_0x4bb807,_0xe31c('0xd'));_0x2caa83(_0x2d6d28['result'][_0xe31c('0x12')]);}})[_0xe31c('0x13')](function(_0x5b5604){logger[_0xe31c('0x10')](_0xe31c('0xc'),_0x4bb807,_0x5b5604);_0x284dd5(_0x5b5604);});});} \ No newline at end of file +var _0x3d86=['http','request','then','info','debug','request\x20sent','stringify','code','error','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x5b0675,_0x21cf5b){var _0x5ae435=function(_0xd67cc0){while(--_0xd67cc0){_0x5b0675['push'](_0x5b0675['shift']());}};_0x5ae435(++_0x21cf5b);}(_0x3d86,0x1a5));var _0x63d8=function(_0x29905b,_0x43b256){_0x29905b=_0x29905b-0x0;var _0xf73f6d=_0x3d86[_0x29905b];return _0xf73f6d;};'use strict';var _=require(_0x63d8('0x0'));var util=require(_0x63d8('0x1'));var moment=require(_0x63d8('0x2'));var BPromise=require(_0x63d8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x63d8('0x4'));var db=require(_0x63d8('0x5'))['db'];var utils=require(_0x63d8('0x6'));var logger=require(_0x63d8('0x7'))(_0x63d8('0x8'));var config=require(_0x63d8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x63d8('0xa')][_0x63d8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d66e0,_0x1dfa0c,_0x4435b7){return new BPromise(function(_0x5907bc,_0x250f17){return client[_0x63d8('0xc')](_0x2d66e0,_0x4435b7)[_0x63d8('0xd')](function(_0x44cc9e){logger[_0x63d8('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x1dfa0c,'request\x20sent');logger[_0x63d8('0xf')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x1dfa0c,_0x63d8('0x10'),JSON[_0x63d8('0x11')](_0x44cc9e));if(_0x44cc9e['error']){if(_0x44cc9e['error'][_0x63d8('0x12')]===0x1f4){logger[_0x63d8('0x13')](_0x63d8('0x14'),_0x1dfa0c,_0x44cc9e[_0x63d8('0x13')][_0x63d8('0x15')]);return _0x250f17(_0x44cc9e['error'][_0x63d8('0x15')]);}logger['error'](_0x63d8('0x14'),_0x1dfa0c,_0x44cc9e['error'][_0x63d8('0x15')]);return _0x5907bc(_0x44cc9e[_0x63d8('0x13')]['message']);}else{logger[_0x63d8('0xe')](_0x63d8('0x14'),_0x1dfa0c,_0x63d8('0x10'));_0x5907bc(_0x44cc9e[_0x63d8('0x16')][_0x63d8('0x15')]);}})[_0x63d8('0x17')](function(_0xfe892e){logger[_0x63d8('0x13')](_0x63d8('0x14'),_0x1dfa0c,_0xfe892e);_0x250f17(_0xfe892e);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 63b7a54..516816c 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 _0xc4a0=['fs-extra','../../components/auth/service','./memberReport.controller','index','/describe','isAuthenticated','describe','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x5cfadd,_0xef3204){var _0x467ec6=function(_0x3d7720){while(--_0x3d7720){_0x5cfadd['push'](_0x5cfadd['shift']());}};_0x467ec6(++_0xef3204);}(_0xc4a0,0x19d));var _0x0c4a=function(_0x589ede,_0x140064){_0x589ede=_0x589ede-0x0;var _0x5c6280=_0xc4a0[_0x589ede];return _0x5c6280;};'use strict';var multer=require(_0x0c4a('0x0'));var util=require('util');var path=require(_0x0c4a('0x1'));var timeout=require(_0x0c4a('0x2'));var express=require(_0x0c4a('0x3'));var router=express[_0x0c4a('0x4')]();var fs_extra=require(_0x0c4a('0x5'));var auth=require(_0x0c4a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0c4a('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x0c4a('0x8')]);router['get'](_0x0c4a('0x9'),auth[_0x0c4a('0xa')](),controller[_0x0c4a('0xb')]);router[_0x0c4a('0xc')](_0x0c4a('0xd'),auth[_0x0c4a('0xa')](),controller[_0x0c4a('0xe')]);router[_0x0c4a('0xf')]('/',auth[_0x0c4a('0xa')](),controller[_0x0c4a('0x10')]);router[_0x0c4a('0x11')]('/:id',auth[_0x0c4a('0xa')](),controller[_0x0c4a('0x12')]);router[_0x0c4a('0x13')](_0x0c4a('0xd'),auth[_0x0c4a('0xa')](),controller[_0x0c4a('0x14')]);module[_0x0c4a('0x15')]=router; \ No newline at end of file +var _0x9d43=['./memberReport.controller','get','index','/describe','describe','show','isAuthenticated','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x155442,_0xda4bf3){var _0x4ff73b=function(_0x168001){while(--_0x168001){_0x155442['push'](_0x155442['shift']());}};_0x4ff73b(++_0xda4bf3);}(_0x9d43,0x15d));var _0x39d4=function(_0x265a84,_0x271161){_0x265a84=_0x265a84-0x0;var _0x15df74=_0x9d43[_0x265a84];return _0x15df74;};'use strict';var multer=require(_0x39d4('0x0'));var util=require(_0x39d4('0x1'));var path=require(_0x39d4('0x2'));var timeout=require(_0x39d4('0x3'));var express=require(_0x39d4('0x4'));var router=express[_0x39d4('0x5')]();var fs_extra=require(_0x39d4('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x39d4('0x7'));var controller=require(_0x39d4('0x8'));router[_0x39d4('0x9')]('/',auth['isAuthenticated'](),controller[_0x39d4('0xa')]);router[_0x39d4('0x9')](_0x39d4('0xb'),auth['isAuthenticated'](),controller[_0x39d4('0xc')]);router[_0x39d4('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x39d4('0xd')]);router['post']('/',auth[_0x39d4('0xe')](),controller[_0x39d4('0xf')]);router[_0x39d4('0x10')](_0x39d4('0x11'),auth[_0x39d4('0xe')](),controller[_0x39d4('0x12')]);router[_0x39d4('0x13')](_0x39d4('0x11'),auth[_0x39d4('0xe')](),controller['destroy']);module[_0x39d4('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index a87ead3..503d7aa 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 _0x86bd=['LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE'];(function(_0x5ec454,_0xfcd77e){var _0x5ebf50=function(_0x29de85){while(--_0x29de85){_0x5ec454['push'](_0x5ec454['shift']());}};_0x5ebf50(++_0xfcd77e);}(_0x86bd,0x172));var _0xd86b=function(_0x31e4cd,_0x2c4dbb){_0x31e4cd=_0x31e4cd-0x0;var _0x3a521d=_0x86bd[_0x31e4cd];return _0x3a521d;};'use strict';var Sequelize=require(_0xd86b('0x0'));var moment=require(_0xd86b('0x1'));module['exports']={'channel':{'type':Sequelize[_0xd86b('0x2')]},'membername':{'type':Sequelize[_0xd86b('0x2')]},'interface':{'type':Sequelize[_0xd86b('0x2')]},'type':{'type':Sequelize[_0xd86b('0x2')],'defaultValue':_0xd86b('0x3'),'comment':_0xd86b('0x4')},'duration':{'type':Sequelize[_0xd86b('0x5')]},'enterAt':{'type':Sequelize[_0xd86b('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x2c2c17){var _0x1bc528=moment(_0x2c2c17);var _0xa3d612=moment(this[_0xd86b('0x7')](_0xd86b('0x8')));var _0x1b1ea9=_0x1bc528[_0xd86b('0x9')](_0xa3d612,_0xd86b('0xa'));this[_0xd86b('0xb')](_0xd86b('0xc'),_0x2c2c17);this[_0xd86b('0xb')]('duration',_0x1b1ea9>=0x0?_0x1b1ea9:null);}},'data1':{'type':Sequelize[_0xd86b('0x2')],'comment':_0xd86b('0xd')},'data2':{'type':Sequelize[_0xd86b('0x2')],'comment':_0xd86b('0xe')},'data3':{'type':Sequelize['STRING'],'comment':_0xd86b('0xf')},'data4':{'type':Sequelize[_0xd86b('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xd86b('0x2')],'comment':_0xd86b('0x10')},'role':{'type':Sequelize[_0xd86b('0x2')]},'internal':{'type':Sequelize[_0xd86b('0x5')]},'uniqueid':{'type':Sequelize[_0xd86b('0x2')]}}; \ No newline at end of file +var _0xfa30=['setDataValue','exitAt','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt'];(function(_0x44ca6e,_0x5e2c91){var _0x2edab2=function(_0x3afa91){while(--_0x3afa91){_0x44ca6e['push'](_0x44ca6e['shift']());}};_0x2edab2(++_0x5e2c91);}(_0xfa30,0x117));var _0x0fa3=function(_0x16e3b2,_0x1d4dac){_0x16e3b2=_0x16e3b2-0x0;var _0x560034=_0xfa30[_0x16e3b2];return _0x560034;};'use strict';var Sequelize=require(_0x0fa3('0x0'));var moment=require('moment');module[_0x0fa3('0x1')]={'channel':{'type':Sequelize[_0x0fa3('0x2')]},'membername':{'type':Sequelize[_0x0fa3('0x2')]},'interface':{'type':Sequelize[_0x0fa3('0x2')]},'type':{'type':Sequelize[_0x0fa3('0x2')],'defaultValue':_0x0fa3('0x3'),'comment':_0x0fa3('0x4')},'duration':{'type':Sequelize[_0x0fa3('0x5')]},'enterAt':{'type':Sequelize[_0x0fa3('0x6')]},'exitAt':{'type':Sequelize[_0x0fa3('0x6')],'set':function(_0x185109){var _0x5a5688=moment(_0x185109);var _0x3b4e09=moment(this[_0x0fa3('0x7')](_0x0fa3('0x8')));var _0x1eb318=_0x5a5688['diff'](_0x3b4e09,'seconds');this[_0x0fa3('0x9')](_0x0fa3('0xa'),_0x185109);this[_0x0fa3('0x9')](_0x0fa3('0xb'),_0x1eb318>=0x0?_0x1eb318:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x0fa3('0x2')],'comment':_0x0fa3('0xc')},'data3':{'type':Sequelize[_0x0fa3('0x2')],'comment':_0x0fa3('0xd')},'data4':{'type':Sequelize[_0x0fa3('0x2')],'comment':_0x0fa3('0xe')},'data5':{'type':Sequelize[_0x0fa3('0x2')],'comment':_0x0fa3('0xf')},'role':{'type':Sequelize[_0x0fa3('0x2')]},'internal':{'type':Sequelize[_0x0fa3('0x5')]},'uniqueid':{'type':Sequelize[_0x0fa3('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 8d785d8..cf4c4ac 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(_0x320b67,_0x5e2e48){var _0x5667d4=function(_0x20ee6c){while(--_0x20ee6c){_0x320b67['push'](_0x320b67['shift']());}};_0x5667d4(++_0x5e2e48);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file +var _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x4941ab,_0x2380a9){var _0x2658c0=function(_0x1cca1f){while(--_0x1cca1f){_0x4941ab['push'](_0x4941ab['shift']());}};_0x2658c0(++_0x2380a9);}(_0x9c44,0x178));var _0x49c4=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x9c44[_0x23e7c1];return _0x1add43;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index dcca725..394b816 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 _0x3885=['rimraf','../../config/environment','./memberReport.attributes','exports','define','report_member','membername_interface','membername','lodash','../../config/logger','api','bluebird','path'];(function(_0xa15bef,_0x1106f4){var _0x25f4c7=function(_0x139bdc){while(--_0x139bdc){_0xa15bef['push'](_0xa15bef['shift']());}};_0x25f4c7(++_0x1106f4);}(_0x3885,0x1c2));var _0x5388=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x3885[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x5388('0x0'));var util=require('util');var logger=require(_0x5388('0x1'))(_0x5388('0x2'));var moment=require('moment');var BPromise=require(_0x5388('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5388('0x4'));var rimraf=require(_0x5388('0x5'));var config=require(_0x5388('0x6'));var attributes=require(_0x5388('0x7'));module[_0x5388('0x8')]=function(_0x5d292d,_0x396f11){return _0x5d292d[_0x5388('0x9')]('MemberReport',attributes,{'tableName':_0x5388('0xa'),'paranoid':![],'indexes':[{'name':_0x5388('0xb'),'fields':[_0x5388('0xc'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe2ea=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','define','MemberReport','report_member','membername_interface','interface'];(function(_0x18472e,_0x3076d9){var _0x18e16d=function(_0x4a4ec7){while(--_0x4a4ec7){_0x18472e['push'](_0x18472e['shift']());}};_0x18e16d(++_0x3076d9);}(_0xe2ea,0xc3));var _0xae2e=function(_0xac5a33,_0x32272a){_0xac5a33=_0xac5a33-0x0;var _0x41d78c=_0xe2ea[_0xac5a33];return _0x41d78c;};'use strict';var _=require(_0xae2e('0x0'));var util=require(_0xae2e('0x1'));var logger=require(_0xae2e('0x2'))(_0xae2e('0x3'));var moment=require(_0xae2e('0x4'));var BPromise=require(_0xae2e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xae2e('0x6'));var rimraf=require(_0xae2e('0x7'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module['exports']=function(_0x228fcb,_0x646000){return _0x228fcb[_0xae2e('0x8')](_0xae2e('0x9'),attributes,{'tableName':_0xae2e('0xa'),'paranoid':![],'indexes':[{'name':_0xae2e('0xb'),'fields':['membername',_0xae2e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 371e9c2..20a092a 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 _0x869e=['debug','create','CreateMemberReport','UpdateMemberReport','MemberReport','body','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','options','raw','where','attributes','limit','include','map','model','GetMemberReport'];(function(_0x4d180c,_0x45c68e){var _0x49b57e=function(_0x264741){while(--_0x264741){_0x4d180c['push'](_0x4d180c['shift']());}};_0x49b57e(++_0x45c68e);}(_0x869e,0x15c));var _0xe869=function(_0x364a86,_0x39eab3){_0x364a86=_0x364a86-0x0;var _0x1605ca=_0x869e[_0x364a86];return _0x1605ca;};'use strict';var _=require(_0xe869('0x0'));var util=require(_0xe869('0x1'));var moment=require(_0xe869('0x2'));var BPromise=require('bluebird');var rs=require(_0xe869('0x3'));var fs=require('fs');var Redis=require(_0xe869('0x4'));var db=require(_0xe869('0x5'))['db'];var utils=require(_0xe869('0x6'));var logger=require(_0xe869('0x7'))('rpc');var config=require(_0xe869('0x8'));var jayson=require(_0xe869('0x9'));var client=jayson[_0xe869('0xa')][_0xe869('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x587ead,_0x4e201a,_0xb3936){return new BPromise(function(_0x296feb,_0x2fcf82){return client[_0xe869('0xc')](_0x587ead,_0xb3936)[_0xe869('0xd')](function(_0x3a0162){logger[_0xe869('0xe')](_0xe869('0xf'),_0x4e201a,'request\x20sent');logger['debug'](_0xe869('0x10'),_0x4e201a,_0xe869('0x11'),JSON[_0xe869('0x12')](_0x3a0162));if(_0x3a0162[_0xe869('0x13')]){if(_0x3a0162['error']['code']===0x1f4){logger[_0xe869('0x13')]('MemberReport,\x20%s,\x20%s',_0x4e201a,_0x3a0162[_0xe869('0x13')][_0xe869('0x14')]);return _0x2fcf82(_0x3a0162['error'][_0xe869('0x14')]);}logger[_0xe869('0x13')](_0xe869('0xf'),_0x4e201a,_0x3a0162[_0xe869('0x13')][_0xe869('0x14')]);return _0x296feb(_0x3a0162['error']['message']);}else{logger['info'](_0xe869('0xf'),_0x4e201a,'request\x20sent');_0x296feb(_0x3a0162[_0xe869('0x15')][_0xe869('0x14')]);}})[_0xe869('0x16')](function(_0x51c4c1){logger[_0xe869('0x13')](_0xe869('0xf'),_0x4e201a,_0x51c4c1);_0x2fcf82(_0x51c4c1);});});}exports['GetMemberReport']=function(_0x33f5a7){var _0x4fa1f2=this;return new Promise(function(_0x26c67c,_0x2c61d1){return db['MemberReport']['findAll']({'raw':_0x33f5a7[_0xe869('0x17')]?_0x33f5a7['options'][_0xe869('0x18')]===undefined?!![]:![]:!![],'where':_0x33f5a7[_0xe869('0x17')]?_0x33f5a7[_0xe869('0x17')][_0xe869('0x19')]||null:null,'attributes':_0x33f5a7[_0xe869('0x17')]?_0x33f5a7[_0xe869('0x17')][_0xe869('0x1a')]||null:null,'limit':_0x33f5a7[_0xe869('0x17')]?_0x33f5a7[_0xe869('0x17')][_0xe869('0x1b')]||null:null,'include':_0x33f5a7['options']?_0x33f5a7[_0xe869('0x17')][_0xe869('0x1c')]?_[_0xe869('0x1d')](_0x33f5a7[_0xe869('0x17')][_0xe869('0x1c')],function(_0x4ddc31){return{'model':db[_0x4ddc31[_0xe869('0x1e')]],'as':_0x4ddc31['as'],'attributes':_0x4ddc31[_0xe869('0x1a')],'include':_0x4ddc31[_0xe869('0x1c')]?_[_0xe869('0x1d')](_0x4ddc31[_0xe869('0x1c')],function(_0x42320b){return{'model':db[_0x42320b[_0xe869('0x1e')]],'as':_0x42320b['as'],'attributes':_0x42320b[_0xe869('0x1a')],'include':_0x42320b[_0xe869('0x1c')]?_[_0xe869('0x1d')](_0x42320b[_0xe869('0x1c')],function(_0x31fec7){return{'model':db[_0x31fec7[_0xe869('0x1e')]],'as':_0x31fec7['as'],'attributes':_0x31fec7['attributes']};}):[]};}):[]};}):[]:[]})[_0xe869('0xd')](function(_0x2be430){logger[_0xe869('0xe')](_0xe869('0x1f'),_0x33f5a7);logger[_0xe869('0x20')](_0xe869('0x1f'),_0x33f5a7,JSON['stringify'](_0x2be430));_0x26c67c(_0x2be430);})[_0xe869('0x16')](function(_0x3f3574){logger['error']('GetMemberReport',_0x3f3574[_0xe869('0x14')],_0x33f5a7);_0x2c61d1(_0x4fa1f2['error'](0x1f4,_0x3f3574[_0xe869('0x14')]));});});};exports['CreateMemberReport']=function(_0x538717){var _0xfdfacd=this;return new Promise(function(_0x42df51,_0x239a56){return db['MemberReport'][_0xe869('0x21')](_0x538717['body'],{'raw':_0x538717[_0xe869('0x17')]?_0x538717[_0xe869('0x17')][_0xe869('0x18')]===undefined?!![]:![]:!![]})[_0xe869('0xd')](function(_0x17a0fa){logger[_0xe869('0xe')](_0xe869('0x22'),_0x538717);logger['debug'](_0xe869('0x22'),_0x538717,JSON[_0xe869('0x12')](_0x17a0fa));_0x42df51(_0x17a0fa);})[_0xe869('0x16')](function(_0x5da05a){logger['error'](_0xe869('0x22'),_0x5da05a['message'],_0x538717);_0x239a56(_0xfdfacd['error'](0x1f4,_0x5da05a[_0xe869('0x14')]));});});};exports[_0xe869('0x23')]=function(_0x4db04b){var _0xd2763f=this;return new Promise(function(_0x453e5f,_0x168703){return db[_0xe869('0x24')]['update'](_0x4db04b[_0xe869('0x25')],{'raw':_0x4db04b[_0xe869('0x17')]?_0x4db04b[_0xe869('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4db04b[_0xe869('0x17')]?_0x4db04b[_0xe869('0x17')]['where']||null:null,'attributes':_0x4db04b[_0xe869('0x17')]?_0x4db04b[_0xe869('0x17')]['attributes']||null:null,'limit':_0x4db04b[_0xe869('0x17')]?_0x4db04b['options'][_0xe869('0x1b')]||null:null})[_0xe869('0xd')](function(_0x4ff975){logger[_0xe869('0xe')](_0xe869('0x23'),_0x4db04b);logger[_0xe869('0x20')](_0xe869('0x23'),_0x4db04b,JSON[_0xe869('0x12')](_0x4ff975));_0x453e5f(_0x4ff975);})['catch'](function(_0x3e3f5f){logger[_0xe869('0x13')](_0xe869('0x23'),_0x3e3f5f['message'],_0x4db04b);_0x168703(_0xd2763f[_0xe869('0x13')](0x1f4,_0x3e3f5f[_0xe869('0x14')]));});});}; \ No newline at end of file +var _0xb091=['CreateMemberReport','create','UpdateMemberReport','MemberReport','update','body','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMemberReport','options','raw','where','attributes','limit','include','map','model'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb091,0x16e));var _0x1b09=function(_0x14a0aa,_0x513190){_0x14a0aa=_0x14a0aa-0x0;var _0x20052a=_0xb091[_0x14a0aa];return _0x20052a;};'use strict';var _=require('lodash');var util=require(_0x1b09('0x0'));var moment=require(_0x1b09('0x1'));var BPromise=require(_0x1b09('0x2'));var rs=require(_0x1b09('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b09('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1b09('0x5'));var config=require(_0x1b09('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1b09('0x7')][_0x1b09('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2bf4f6,_0x5ce726,_0x142c33){return new BPromise(function(_0x8c26a5,_0x2f359f){return client[_0x1b09('0x9')](_0x2bf4f6,_0x142c33)[_0x1b09('0xa')](function(_0x3362e4){logger[_0x1b09('0xb')](_0x1b09('0xc'),_0x5ce726,_0x1b09('0xd'));logger[_0x1b09('0xe')](_0x1b09('0xf'),_0x5ce726,'request\x20sent',JSON[_0x1b09('0x10')](_0x3362e4));if(_0x3362e4[_0x1b09('0x11')]){if(_0x3362e4['error']['code']===0x1f4){logger[_0x1b09('0x11')](_0x1b09('0xc'),_0x5ce726,_0x3362e4[_0x1b09('0x11')][_0x1b09('0x12')]);return _0x2f359f(_0x3362e4[_0x1b09('0x11')][_0x1b09('0x12')]);}logger[_0x1b09('0x11')]('MemberReport,\x20%s,\x20%s',_0x5ce726,_0x3362e4[_0x1b09('0x11')]['message']);return _0x8c26a5(_0x3362e4[_0x1b09('0x11')][_0x1b09('0x12')]);}else{logger[_0x1b09('0xb')](_0x1b09('0xc'),_0x5ce726,_0x1b09('0xd'));_0x8c26a5(_0x3362e4[_0x1b09('0x13')][_0x1b09('0x12')]);}})[_0x1b09('0x14')](function(_0x1196b2){logger[_0x1b09('0x11')](_0x1b09('0xc'),_0x5ce726,_0x1196b2);_0x2f359f(_0x1196b2);});});}exports[_0x1b09('0x15')]=function(_0x646575){var _0x4c64e1=this;return new Promise(function(_0x214c6b,_0x1c1ef9){return db['MemberReport']['findAll']({'raw':_0x646575[_0x1b09('0x16')]?_0x646575['options'][_0x1b09('0x17')]===undefined?!![]:![]:!![],'where':_0x646575['options']?_0x646575[_0x1b09('0x16')][_0x1b09('0x18')]||null:null,'attributes':_0x646575[_0x1b09('0x16')]?_0x646575[_0x1b09('0x16')][_0x1b09('0x19')]||null:null,'limit':_0x646575[_0x1b09('0x16')]?_0x646575[_0x1b09('0x16')][_0x1b09('0x1a')]||null:null,'include':_0x646575['options']?_0x646575['options'][_0x1b09('0x1b')]?_[_0x1b09('0x1c')](_0x646575['options'][_0x1b09('0x1b')],function(_0x11d0d5){return{'model':db[_0x11d0d5[_0x1b09('0x1d')]],'as':_0x11d0d5['as'],'attributes':_0x11d0d5[_0x1b09('0x19')],'include':_0x11d0d5['include']?_[_0x1b09('0x1c')](_0x11d0d5[_0x1b09('0x1b')],function(_0x4936d0){return{'model':db[_0x4936d0[_0x1b09('0x1d')]],'as':_0x4936d0['as'],'attributes':_0x4936d0[_0x1b09('0x19')],'include':_0x4936d0['include']?_[_0x1b09('0x1c')](_0x4936d0[_0x1b09('0x1b')],function(_0xa71272){return{'model':db[_0xa71272[_0x1b09('0x1d')]],'as':_0xa71272['as'],'attributes':_0xa71272['attributes']};}):[]};}):[]};}):[]:[]})[_0x1b09('0xa')](function(_0x3cdbc5){logger['info'](_0x1b09('0x15'),_0x646575);logger[_0x1b09('0xe')](_0x1b09('0x15'),_0x646575,JSON[_0x1b09('0x10')](_0x3cdbc5));_0x214c6b(_0x3cdbc5);})[_0x1b09('0x14')](function(_0x1aa179){logger[_0x1b09('0x11')]('GetMemberReport',_0x1aa179[_0x1b09('0x12')],_0x646575);_0x1c1ef9(_0x4c64e1[_0x1b09('0x11')](0x1f4,_0x1aa179['message']));});});};exports[_0x1b09('0x1e')]=function(_0x1a6130){var _0x1b98da=this;return new Promise(function(_0x122b1c,_0x62a96b){return db['MemberReport'][_0x1b09('0x1f')](_0x1a6130['body'],{'raw':_0x1a6130[_0x1b09('0x16')]?_0x1a6130['options'][_0x1b09('0x17')]===undefined?!![]:![]:!![]})[_0x1b09('0xa')](function(_0x381e76){logger[_0x1b09('0xb')](_0x1b09('0x1e'),_0x1a6130);logger[_0x1b09('0xe')](_0x1b09('0x1e'),_0x1a6130,JSON[_0x1b09('0x10')](_0x381e76));_0x122b1c(_0x381e76);})[_0x1b09('0x14')](function(_0x33bca2){logger['error'](_0x1b09('0x1e'),_0x33bca2[_0x1b09('0x12')],_0x1a6130);_0x62a96b(_0x1b98da[_0x1b09('0x11')](0x1f4,_0x33bca2['message']));});});};exports[_0x1b09('0x20')]=function(_0x339b66){var _0x4662d6=this;return new Promise(function(_0x3ce2a9,_0x12a720){return db[_0x1b09('0x21')][_0x1b09('0x22')](_0x339b66[_0x1b09('0x23')],{'raw':_0x339b66['options']?_0x339b66[_0x1b09('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x339b66[_0x1b09('0x16')]?_0x339b66['options'][_0x1b09('0x18')]||null:null,'attributes':_0x339b66[_0x1b09('0x16')]?_0x339b66[_0x1b09('0x16')][_0x1b09('0x19')]||null:null,'limit':_0x339b66[_0x1b09('0x16')]?_0x339b66[_0x1b09('0x16')][_0x1b09('0x1a')]||null:null})[_0x1b09('0xa')](function(_0x43032f){logger[_0x1b09('0xb')](_0x1b09('0x20'),_0x339b66);logger[_0x1b09('0xe')](_0x1b09('0x20'),_0x339b66,JSON['stringify'](_0x43032f));_0x3ce2a9(_0x43032f);})['catch'](function(_0x23ce9a){logger[_0x1b09('0x11')](_0x1b09('0x20'),_0x23ce9a[_0x1b09('0x12')],_0x339b66);_0x12a720(_0x4662d6[_0x1b09('0x11')](0x1f4,_0x23ce9a[_0x1b09('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index a72b82c..3919a51 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 _0x8994=['exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index'];(function(_0x1ab8c7,_0x28db6d){var _0x1b951f=function(_0x6c0e7a){while(--_0x6c0e7a){_0x1ab8c7['push'](_0x1ab8c7['shift']());}};_0x1b951f(++_0x28db6d);}(_0x8994,0x121));var _0x4899=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x8994[_0x82129b];return _0x2ae5dc;};'use strict';var multer=require(_0x4899('0x0'));var util=require(_0x4899('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4899('0x2'));var router=express[_0x4899('0x3')]();var fs_extra=require(_0x4899('0x4'));var auth=require(_0x4899('0x5'));var interaction=require(_0x4899('0x6'));var config=require(_0x4899('0x7'));var controller=require(_0x4899('0x8'));router[_0x4899('0x9')]('/',controller[_0x4899('0xa')]);module[_0x4899('0xb')]=router; \ No newline at end of file +var _0x7ef7=['../../config/environment','./migration.controller','get','index','exports','util','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2baca1,_0x2f3557){var _0x9aa62a=function(_0x5c47d5){while(--_0x5c47d5){_0x2baca1['push'](_0x2baca1['shift']());}};_0x9aa62a(++_0x2f3557);}(_0x7ef7,0x91));var _0x77ef=function(_0x335b20,_0x317d09){_0x335b20=_0x335b20-0x0;var _0x3f8ac6=_0x7ef7[_0x335b20];return _0x3f8ac6;};'use strict';var multer=require('multer');var util=require(_0x77ef('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x77ef('0x1'));var router=express['Router']();var fs_extra=require(_0x77ef('0x2'));var auth=require(_0x77ef('0x3'));var interaction=require(_0x77ef('0x4'));var config=require(_0x77ef('0x5'));var controller=require(_0x77ef('0x6'));router[_0x77ef('0x7')]('/',controller[_0x77ef('0x8')]);module[_0x77ef('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 4150244..6d051d7 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 _0x53eb=['version'];(function(_0x441305,_0x2e1483){var _0x581096=function(_0x40c78a){while(--_0x40c78a){_0x441305['push'](_0x441305['shift']());}};_0x581096(++_0x2e1483);}(_0x53eb,0x1ce));var _0xb53e=function(_0x29a24a,_0x258090){_0x29a24a=_0x29a24a-0x0;var _0x16c8f6=_0x53eb[_0x29a24a];return _0x16c8f6;};'use strict';var Sequelize=require('sequelize');module['exports']={'version':{'type':Sequelize['STRING'],'unique':_0xb53e('0x0')}}; \ No newline at end of file +var _0xbbfe=['exports','version'];(function(_0x4e8db9,_0x15ff81){var _0x1fc3be=function(_0x1cc230){while(--_0x1cc230){_0x4e8db9['push'](_0x4e8db9['shift']());}};_0x1fc3be(++_0x15ff81);}(_0xbbfe,0x76));var _0xebbf=function(_0x675da0,_0x2d6823){_0x675da0=_0x675da0-0x0;var _0x2eeb20=_0xbbfe[_0x675da0];return _0x2eeb20;};'use strict';var Sequelize=require('sequelize');module[_0xebbf('0x0')]={'version':{'type':Sequelize['STRING'],'unique':_0xebbf('0x1')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 3604900..6705467 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 _0xac81=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','Migration','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x4b087d,_0xb57eb0){var _0x122d6d=function(_0x1d4b3c){while(--_0x1d4b3c){_0x4b087d['push'](_0x4b087d['shift']());}};_0x122d6d(++_0xb57eb0);}(_0xac81,0x1c8));var _0x1ac8=function(_0x107aa2,_0x75b949){_0x107aa2=_0x107aa2-0x0;var _0x33d933=_0xac81[_0x107aa2];return _0x33d933;};'use strict';var emlformat=require(_0x1ac8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1ac8('0x1'));var rp=require(_0x1ac8('0x2'));var moment=require('moment');var BPromise=require(_0x1ac8('0x3'));var Mustache=require(_0x1ac8('0x4'));var util=require(_0x1ac8('0x5'));var path=require(_0x1ac8('0x6'));var sox=require(_0x1ac8('0x7'));var csv=require(_0x1ac8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ac8('0x9'));var _=require(_0x1ac8('0xa'));var squel=require(_0x1ac8('0xb'));var crypto=require(_0x1ac8('0xc'));var jsforce=require(_0x1ac8('0xd'));var deskjs=require(_0x1ac8('0xe'));var toCsv=require(_0x1ac8('0x8'));var querystring=require(_0x1ac8('0xf'));var Papa=require(_0x1ac8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1ac8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ac8('0x12'));var logger=require(_0x1ac8('0x13'))('api');var utils=require(_0x1ac8('0x14'));var config=require(_0x1ac8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1ac8('0x16'))['db'];function respondWithStatusCode(_0x55ea22,_0x5923c5){_0x5923c5=_0x5923c5||0xcc;return function(_0x57a30a){if(_0x57a30a){return _0x55ea22[_0x1ac8('0x17')](_0x5923c5);}return _0x55ea22[_0x1ac8('0x18')](_0x5923c5)[_0x1ac8('0x19')]();};}function respondWithResult(_0x5ece70,_0x5d28dd){_0x5d28dd=_0x5d28dd||0xc8;return function(_0x5149e3){if(_0x5149e3){return _0x5ece70[_0x1ac8('0x18')](_0x5d28dd)[_0x1ac8('0x1a')](_0x5149e3);}};}function respondWithFilteredResult(_0x2d69c6,_0x1db691){return function(_0x4714f4){if(_0x4714f4){var _0x512e0f=typeof _0x1db691[_0x1ac8('0x1b')]==='undefined'&&typeof _0x1db691[_0x1ac8('0x1c')]===_0x1ac8('0x1d');var _0x25d1a8=_0x4714f4['count'];var _0x455747=_0x512e0f?0x0:_0x1db691[_0x1ac8('0x1b')];var _0x31e35f=_0x512e0f?_0x4714f4[_0x1ac8('0x1e')]:_0x1db691[_0x1ac8('0x1b')]+_0x1db691[_0x1ac8('0x1c')];var _0x55e89a;if(_0x31e35f>=_0x25d1a8){_0x31e35f=_0x25d1a8;_0x55e89a=0xc8;}else{_0x55e89a=0xce;}_0x2d69c6[_0x1ac8('0x18')](_0x55e89a);return _0x2d69c6[_0x1ac8('0x1f')](_0x1ac8('0x20'),_0x455747+'-'+_0x31e35f+'/'+_0x25d1a8)[_0x1ac8('0x1a')](_0x4714f4);}return null;};}function patchUpdates(_0xd9405){return function(_0x1ee896){try{jsonpatch[_0x1ac8('0x21')](_0x1ee896,_0xd9405,!![]);}catch(_0xb278df){return BPromise[_0x1ac8('0x22')](_0xb278df);}return _0x1ee896['save']();};}function saveUpdates(_0x3eee25,_0x3f5ac2){return function(_0xec9d29){if(_0xec9d29){return _0xec9d29[_0x1ac8('0x23')](_0x3eee25)[_0x1ac8('0x24')](function(_0x3b8c44){return _0x3b8c44;});}return null;};}function removeEntity(_0x4da88e,_0x3fcb15){return function(_0x575f8f){if(_0x575f8f){return _0x575f8f[_0x1ac8('0x25')]()[_0x1ac8('0x24')](function(){_0x4da88e['status'](0xcc)[_0x1ac8('0x19')]();});}};}function handleEntityNotFound(_0x4bee5b,_0x4ac3fa){return function(_0x50464d){if(!_0x50464d){_0x4bee5b[_0x1ac8('0x17')](0x194);}return _0x50464d;};}function handleError(_0xa8bf3f,_0x5343fb){_0x5343fb=_0x5343fb||0x1f4;return function(_0x55f38e){logger[_0x1ac8('0x26')](_0x55f38e[_0x1ac8('0x27')]);if(_0x55f38e[_0x1ac8('0x28')]){delete _0x55f38e[_0x1ac8('0x28')];}_0xa8bf3f[_0x1ac8('0x18')](_0x5343fb)['send'](_0x55f38e);};}exports[_0x1ac8('0x29')]=function(_0x34c974,_0x24932f){var _0x4ac5ee={},_0x33ed76={},_0x279c32={'count':0x0,'rows':[]};var _0x229908=_[_0x1ac8('0x2a')](db[_0x1ac8('0x2b')][_0x1ac8('0x2c')],function(_0x5d736e){return{'name':_0x5d736e[_0x1ac8('0x2d')],'type':_0x5d736e[_0x1ac8('0x2e')][_0x1ac8('0x2f')]};});_0x33ed76['model']=_[_0x1ac8('0x2a')](_0x229908,_0x1ac8('0x28'));_0x33ed76[_0x1ac8('0x30')]=_[_0x1ac8('0x31')](_0x34c974[_0x1ac8('0x30')]);_0x33ed76[_0x1ac8('0x32')]=_['intersection'](_0x33ed76[_0x1ac8('0x33')],_0x33ed76[_0x1ac8('0x30')]);_0x4ac5ee['attributes']=_['intersection'](_0x33ed76[_0x1ac8('0x33')],qs[_0x1ac8('0x34')](_0x34c974[_0x1ac8('0x30')][_0x1ac8('0x34')]));_0x4ac5ee[_0x1ac8('0x35')]=_0x4ac5ee['attributes'][_0x1ac8('0x36')]?_0x4ac5ee[_0x1ac8('0x35')]:_0x33ed76[_0x1ac8('0x33')];if(!_0x34c974[_0x1ac8('0x30')][_0x1ac8('0x37')](_0x1ac8('0x38'))){_0x4ac5ee[_0x1ac8('0x1c')]=qs[_0x1ac8('0x1c')](_0x34c974[_0x1ac8('0x30')][_0x1ac8('0x1c')]);_0x4ac5ee[_0x1ac8('0x1b')]=qs[_0x1ac8('0x1b')](_0x34c974[_0x1ac8('0x30')][_0x1ac8('0x1b')]);}_0x4ac5ee[_0x1ac8('0x39')]=qs[_0x1ac8('0x3a')](_0x34c974['query'][_0x1ac8('0x3a')]);_0x4ac5ee[_0x1ac8('0x3b')]=qs[_0x1ac8('0x32')](_[_0x1ac8('0x3c')](_0x34c974['query'],_0x33ed76[_0x1ac8('0x32')]),_0x229908);if(_0x34c974[_0x1ac8('0x30')][_0x1ac8('0x3d')]){_0x4ac5ee[_0x1ac8('0x3b')]=_[_0x1ac8('0x3e')](_0x4ac5ee[_0x1ac8('0x3b')],{'$or':_['map'](_0x229908,function(_0x2242b9){if(_0x2242b9[_0x1ac8('0x2e')]!=='VIRTUAL'){var _0x5dfcd3={};_0x5dfcd3[_0x2242b9[_0x1ac8('0x28')]]={'$like':'%'+_0x34c974[_0x1ac8('0x30')][_0x1ac8('0x3d')]+'%'};return _0x5dfcd3;}})});}_0x4ac5ee=_['merge']({},_0x4ac5ee,_0x34c974[_0x1ac8('0x3f')]);var _0x370594={'where':_0x4ac5ee['where']};return db[_0x1ac8('0x2b')][_0x1ac8('0x1e')](_0x370594)[_0x1ac8('0x24')](function(_0x4f0ace){_0x279c32[_0x1ac8('0x1e')]=_0x4f0ace;if(_0x34c974[_0x1ac8('0x30')]['includeAll']){_0x4ac5ee[_0x1ac8('0x40')]=[{'all':!![]}];}return db[_0x1ac8('0x2b')][_0x1ac8('0x41')](_0x4ac5ee);})['then'](function(_0x2cf6b1){_0x279c32[_0x1ac8('0x42')]=_0x2cf6b1;return _0x279c32;})[_0x1ac8('0x24')](respondWithFilteredResult(_0x24932f,_0x4ac5ee))[_0x1ac8('0x43')](handleError(_0x24932f,null));}; \ No newline at end of file +var _0xc02d=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','send','map','Migration','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','include','rows','catch'];(function(_0x4a599b,_0x1d2125){var _0x2d53d3=function(_0x5e7982){while(--_0x5e7982){_0x4a599b['push'](_0x4a599b['shift']());}};_0x2d53d3(++_0x1d2125);}(_0xc02d,0x1f0));var _0xdc02=function(_0x597d5d,_0x35ed74){_0x597d5d=_0x597d5d-0x0;var _0x336289=_0xc02d[_0x597d5d];return _0x336289;};'use strict';var emlformat=require(_0xdc02('0x0'));var rimraf=require(_0xdc02('0x1'));var zipdir=require(_0xdc02('0x2'));var jsonpatch=require(_0xdc02('0x3'));var rp=require(_0xdc02('0x4'));var moment=require('moment');var BPromise=require(_0xdc02('0x5'));var Mustache=require(_0xdc02('0x6'));var util=require(_0xdc02('0x7'));var path=require(_0xdc02('0x8'));var sox=require(_0xdc02('0x9'));var csv=require(_0xdc02('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc02('0xb'));var squel=require(_0xdc02('0xc'));var crypto=require(_0xdc02('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdc02('0xa'));var querystring=require(_0xdc02('0xe'));var Papa=require(_0xdc02('0xf'));var Redis=require(_0xdc02('0x10'));var authService=require(_0xdc02('0x11'));var qs=require(_0xdc02('0x12'));var as=require(_0xdc02('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdc02('0x14'))(_0xdc02('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17266f,_0x30ff99){_0x30ff99=_0x30ff99||0xcc;return function(_0x17dbb2){if(_0x17dbb2){return _0x17266f['sendStatus'](_0x30ff99);}return _0x17266f[_0xdc02('0x16')](_0x30ff99)[_0xdc02('0x17')]();};}function respondWithResult(_0x140b6f,_0x3c41b0){_0x3c41b0=_0x3c41b0||0xc8;return function(_0x3eddad){if(_0x3eddad){return _0x140b6f[_0xdc02('0x16')](_0x3c41b0)[_0xdc02('0x18')](_0x3eddad);}};}function respondWithFilteredResult(_0x55a285,_0x25a229){return function(_0x3900e4){if(_0x3900e4){var _0x4faa5c=typeof _0x25a229[_0xdc02('0x19')]===_0xdc02('0x1a')&&typeof _0x25a229[_0xdc02('0x1b')]==='undefined';var _0x564d01=_0x3900e4[_0xdc02('0x1c')];var _0x2d166f=_0x4faa5c?0x0:_0x25a229['offset'];var _0x55df1d=_0x4faa5c?_0x3900e4[_0xdc02('0x1c')]:_0x25a229['offset']+_0x25a229['limit'];var _0x1ae94f;if(_0x55df1d>=_0x564d01){_0x55df1d=_0x564d01;_0x1ae94f=0xc8;}else{_0x1ae94f=0xce;}_0x55a285[_0xdc02('0x16')](_0x1ae94f);return _0x55a285[_0xdc02('0x1d')](_0xdc02('0x1e'),_0x2d166f+'-'+_0x55df1d+'/'+_0x564d01)['json'](_0x3900e4);}return null;};}function patchUpdates(_0x5609ce){return function(_0x4fa07b){try{jsonpatch['apply'](_0x4fa07b,_0x5609ce,!![]);}catch(_0x23f947){return BPromise[_0xdc02('0x1f')](_0x23f947);}return _0x4fa07b[_0xdc02('0x20')]();};}function saveUpdates(_0x1d6cc5,_0x55522c){return function(_0x6cf636){if(_0x6cf636){return _0x6cf636['update'](_0x1d6cc5)[_0xdc02('0x21')](function(_0x1c5c76){return _0x1c5c76;});}return null;};}function removeEntity(_0xbe144c,_0x5eb8fe){return function(_0xfd1a0e){if(_0xfd1a0e){return _0xfd1a0e[_0xdc02('0x22')]()[_0xdc02('0x21')](function(){_0xbe144c[_0xdc02('0x16')](0xcc)[_0xdc02('0x17')]();});}};}function handleEntityNotFound(_0x53d920,_0x2f7071){return function(_0x103bb9){if(!_0x103bb9){_0x53d920[_0xdc02('0x23')](0x194);}return _0x103bb9;};}function handleError(_0x40985d,_0x1cd0bd){_0x1cd0bd=_0x1cd0bd||0x1f4;return function(_0x3adf3d){logger[_0xdc02('0x24')](_0x3adf3d[_0xdc02('0x25')]);if(_0x3adf3d[_0xdc02('0x26')]){delete _0x3adf3d[_0xdc02('0x26')];}_0x40985d[_0xdc02('0x16')](_0x1cd0bd)[_0xdc02('0x27')](_0x3adf3d);};}exports['index']=function(_0x476331,_0x98f8e5){var _0x73cccc={},_0x57be4b={},_0x5ebb56={'count':0x0,'rows':[]};var _0x352972=_[_0xdc02('0x28')](db[_0xdc02('0x29')][_0xdc02('0x2a')],function(_0x1eb4de){return{'name':_0x1eb4de[_0xdc02('0x2b')],'type':_0x1eb4de[_0xdc02('0x2c')][_0xdc02('0x2d')]};});_0x57be4b[_0xdc02('0x2e')]=_[_0xdc02('0x28')](_0x352972,_0xdc02('0x26'));_0x57be4b[_0xdc02('0x2f')]=_['keys'](_0x476331[_0xdc02('0x2f')]);_0x57be4b[_0xdc02('0x30')]=_['intersection'](_0x57be4b[_0xdc02('0x2e')],_0x57be4b[_0xdc02('0x2f')]);_0x73cccc['attributes']=_[_0xdc02('0x31')](_0x57be4b[_0xdc02('0x2e')],qs[_0xdc02('0x32')](_0x476331[_0xdc02('0x2f')][_0xdc02('0x32')]));_0x73cccc[_0xdc02('0x33')]=_0x73cccc[_0xdc02('0x33')][_0xdc02('0x34')]?_0x73cccc[_0xdc02('0x33')]:_0x57be4b['model'];if(!_0x476331[_0xdc02('0x2f')][_0xdc02('0x35')]('nolimit')){_0x73cccc[_0xdc02('0x1b')]=qs['limit'](_0x476331[_0xdc02('0x2f')][_0xdc02('0x1b')]);_0x73cccc[_0xdc02('0x19')]=qs['offset'](_0x476331[_0xdc02('0x2f')][_0xdc02('0x19')]);}_0x73cccc['order']=qs[_0xdc02('0x36')](_0x476331[_0xdc02('0x2f')][_0xdc02('0x36')]);_0x73cccc[_0xdc02('0x37')]=qs[_0xdc02('0x30')](_[_0xdc02('0x38')](_0x476331[_0xdc02('0x2f')],_0x57be4b[_0xdc02('0x30')]),_0x352972);if(_0x476331[_0xdc02('0x2f')][_0xdc02('0x39')]){_0x73cccc[_0xdc02('0x37')]=_[_0xdc02('0x3a')](_0x73cccc[_0xdc02('0x37')],{'$or':_[_0xdc02('0x28')](_0x352972,function(_0x1963fd){if(_0x1963fd[_0xdc02('0x2c')]!=='VIRTUAL'){var _0x424d2e={};_0x424d2e[_0x1963fd['name']]={'$like':'%'+_0x476331[_0xdc02('0x2f')][_0xdc02('0x39')]+'%'};return _0x424d2e;}})});}_0x73cccc=_[_0xdc02('0x3a')]({},_0x73cccc,_0x476331['options']);var _0x421338={'where':_0x73cccc[_0xdc02('0x37')]};return db[_0xdc02('0x29')][_0xdc02('0x1c')](_0x421338)[_0xdc02('0x21')](function(_0x19f950){_0x5ebb56[_0xdc02('0x1c')]=_0x19f950;if(_0x476331['query']['includeAll']){_0x73cccc[_0xdc02('0x3b')]=[{'all':!![]}];}return db[_0xdc02('0x29')]['findAll'](_0x73cccc);})[_0xdc02('0x21')](function(_0x1fa14f){_0x5ebb56[_0xdc02('0x3c')]=_0x1fa14f;return _0x5ebb56;})[_0xdc02('0x21')](respondWithFilteredResult(_0x98f8e5,_0x73cccc))[_0xdc02('0x3d')](handleError(_0x98f8e5,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 7426386..2eed9a6 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 _0x9719=['path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','util','../../config/logger','api','request-promise'];(function(_0x149a9b,_0x5bb275){var _0x2c2bf6=function(_0xfe0c14){while(--_0xfe0c14){_0x149a9b['push'](_0x149a9b['shift']());}};_0x2c2bf6(++_0x5bb275);}(_0x9719,0xec));var _0x9971=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9719[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x9971('0x0'));var logger=require(_0x9971('0x1'))(_0x9971('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9971('0x3'));var fs=require('fs');var path=require(_0x9971('0x4'));var rimraf=require(_0x9971('0x5'));var config=require(_0x9971('0x6'));var attributes=require(_0x9971('0x7'));module[_0x9971('0x8')]=function(_0x7cf920,_0x35fe55){return _0x7cf920[_0x9971('0x9')](_0x9971('0xa'),attributes,{'tableName':_0x9971('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2fc2=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./migration.attributes','define','migrations','lodash'];(function(_0x40f178,_0xcbf05b){var _0x2898f3=function(_0x2e18a5){while(--_0x2e18a5){_0x40f178['push'](_0x40f178['shift']());}};_0x2898f3(++_0xcbf05b);}(_0x2fc2,0x185));var _0x22fc=function(_0x3f7069,_0x4f6440){_0x3f7069=_0x3f7069-0x0;var _0x5472f7=_0x2fc2[_0x3f7069];return _0x5472f7;};'use strict';var _=require(_0x22fc('0x0'));var util=require('util');var logger=require(_0x22fc('0x1'))('api');var moment=require(_0x22fc('0x2'));var BPromise=require('bluebird');var rp=require(_0x22fc('0x3'));var fs=require('fs');var path=require(_0x22fc('0x4'));var rimraf=require(_0x22fc('0x5'));var config=require(_0x22fc('0x6'));var attributes=require(_0x22fc('0x7'));module['exports']=function(_0x17423e,_0xe3ba73){return _0x17423e[_0x22fc('0x8')]('Migration',attributes,{'tableName':_0x22fc('0x9'),'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 e6b2782..90e1bfa 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 _0x0c5d=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x0c5d,0x6c));var _0xd0c5=function(_0x5a593b,_0x280c1e){_0x5a593b=_0x5a593b-0x0;var _0x200973=_0x0c5d[_0x5a593b];return _0x200973;};'use strict';var _=require(_0xd0c5('0x0'));var util=require(_0xd0c5('0x1'));var moment=require('moment');var BPromise=require(_0xd0c5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd0c5('0x3'));var db=require(_0xd0c5('0x4'))['db'];var utils=require(_0xd0c5('0x5'));var logger=require(_0xd0c5('0x6'))(_0xd0c5('0x7'));var config=require(_0xd0c5('0x8'));var jayson=require(_0xd0c5('0x9'));var client=jayson[_0xd0c5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ef2f6,_0x518801,_0x47f0f4){return new BPromise(function(_0x365e04,_0x4be307){return client['request'](_0x2ef2f6,_0x47f0f4)[_0xd0c5('0xb')](function(_0x227cb7){logger['info'](_0xd0c5('0xc'),_0x518801,_0xd0c5('0xd'));logger['debug'](_0xd0c5('0xe'),_0x518801,_0xd0c5('0xd'),JSON[_0xd0c5('0xf')](_0x227cb7));if(_0x227cb7[_0xd0c5('0x10')]){if(_0x227cb7[_0xd0c5('0x10')][_0xd0c5('0x11')]===0x1f4){logger[_0xd0c5('0x10')](_0xd0c5('0xc'),_0x518801,_0x227cb7[_0xd0c5('0x10')][_0xd0c5('0x12')]);return _0x4be307(_0x227cb7[_0xd0c5('0x10')][_0xd0c5('0x12')]);}logger['error'](_0xd0c5('0xc'),_0x518801,_0x227cb7[_0xd0c5('0x10')][_0xd0c5('0x12')]);return _0x365e04(_0x227cb7[_0xd0c5('0x10')]['message']);}else{logger[_0xd0c5('0x13')](_0xd0c5('0xc'),_0x518801,_0xd0c5('0xd'));_0x365e04(_0x227cb7[_0xd0c5('0x14')]['message']);}})[_0xd0c5('0x15')](function(_0x5809ba){logger[_0xd0c5('0x10')]('Migration,\x20%s,\x20%s',_0x518801,_0x5809ba);_0x4be307(_0x5809ba);});});} \ No newline at end of file +var _0xadcc=['debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','Migration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3b1733,_0x24d019){var _0x8e528=function(_0x39c739){while(--_0x39c739){_0x3b1733['push'](_0x3b1733['shift']());}};_0x8e528(++_0x24d019);}(_0xadcc,0x76));var _0xcadc=function(_0x9e32fd,_0x50e17c){_0x9e32fd=_0x9e32fd-0x0;var _0x329b24=_0xadcc[_0x9e32fd];return _0x329b24;};'use strict';var _=require(_0xcadc('0x0'));var util=require('util');var moment=require(_0xcadc('0x1'));var BPromise=require(_0xcadc('0x2'));var rs=require(_0xcadc('0x3'));var fs=require('fs');var Redis=require(_0xcadc('0x4'));var db=require(_0xcadc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcadc('0x6'));var config=require(_0xcadc('0x7'));var jayson=require(_0xcadc('0x8'));var client=jayson[_0xcadc('0x9')][_0xcadc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x294977,_0x4a0567,_0x346f54){return new BPromise(function(_0x1d3edf,_0x204f2b){return client[_0xcadc('0xb')](_0x294977,_0x346f54)[_0xcadc('0xc')](function(_0x22268c){logger[_0xcadc('0xd')]('Migration,\x20%s,\x20%s',_0x4a0567,'request\x20sent');logger[_0xcadc('0xe')](_0xcadc('0xf'),_0x4a0567,'request\x20sent',JSON[_0xcadc('0x10')](_0x22268c));if(_0x22268c[_0xcadc('0x11')]){if(_0x22268c[_0xcadc('0x11')]['code']===0x1f4){logger['error'](_0xcadc('0x12'),_0x4a0567,_0x22268c[_0xcadc('0x11')][_0xcadc('0x13')]);return _0x204f2b(_0x22268c[_0xcadc('0x11')]['message']);}logger[_0xcadc('0x11')]('Migration,\x20%s,\x20%s',_0x4a0567,_0x22268c[_0xcadc('0x11')][_0xcadc('0x13')]);return _0x1d3edf(_0x22268c[_0xcadc('0x11')]['message']);}else{logger[_0xcadc('0xd')](_0xcadc('0x12'),_0x4a0567,'request\x20sent');_0x1d3edf(_0x22268c[_0xcadc('0x14')]['message']);}})[_0xcadc('0x15')](function(_0x36d544){logger[_0xcadc('0x11')](_0xcadc('0x12'),_0x4a0567,_0x36d544);_0x204f2b(_0x36d544);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 4de4e15..ba324b6 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 _0x2340=['./network.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x34b3f5,_0x573f9f){var _0x39146b=function(_0x339f7c){while(--_0x339f7c){_0x34b3f5['push'](_0x34b3f5['shift']());}};_0x39146b(++_0x573f9f);}(_0x2340,0x1e6));var _0x0234=function(_0x8eadaa,_0x37c691){_0x8eadaa=_0x8eadaa-0x0;var _0x18b161=_0x2340[_0x8eadaa];return _0x18b161;};'use strict';var multer=require(_0x0234('0x0'));var util=require(_0x0234('0x1'));var path=require(_0x0234('0x2'));var timeout=require(_0x0234('0x3'));var express=require('express');var router=express[_0x0234('0x4')]();var fs_extra=require(_0x0234('0x5'));var auth=require(_0x0234('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0234('0x7'));var controller=require(_0x0234('0x8'));router[_0x0234('0x9')]('/',auth[_0x0234('0xa')](),controller[_0x0234('0xb')]);router[_0x0234('0x9')](_0x0234('0xc'),auth[_0x0234('0xa')](),controller[_0x0234('0xd')]);router[_0x0234('0xe')]('/',auth[_0x0234('0xa')](),controller['create']);router['put']('/:id',auth[_0x0234('0xa')](),controller[_0x0234('0xf')]);router[_0x0234('0x10')](_0x0234('0xc'),auth[_0x0234('0xa')](),controller[_0x0234('0x11')]);module[_0x0234('0x12')]=router; \ No newline at end of file +var _0xaf30=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller'];(function(_0x18e087,_0x243e98){var _0x4b5206=function(_0x52d8a4){while(--_0x52d8a4){_0x18e087['push'](_0x18e087['shift']());}};_0x4b5206(++_0x243e98);}(_0xaf30,0xd0));var _0x0af3=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xaf30[_0x525c7b];return _0x27b33e;};'use strict';var multer=require('multer');var util=require(_0x0af3('0x0'));var path=require('path');var timeout=require(_0x0af3('0x1'));var express=require(_0x0af3('0x2'));var router=express[_0x0af3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0af3('0x4'));var interaction=require(_0x0af3('0x5'));var config=require(_0x0af3('0x6'));var controller=require(_0x0af3('0x7'));router[_0x0af3('0x8')]('/',auth[_0x0af3('0x9')](),controller[_0x0af3('0xa')]);router[_0x0af3('0x8')](_0x0af3('0xb'),auth[_0x0af3('0x9')](),controller[_0x0af3('0xc')]);router[_0x0af3('0xd')]('/',auth[_0x0af3('0x9')](),controller[_0x0af3('0xe')]);router[_0x0af3('0xf')](_0x0af3('0xb'),auth[_0x0af3('0x9')](),controller[_0x0af3('0x10')]);router[_0x0af3('0x11')](_0x0af3('0xb'),auth['isAuthenticated'](),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 509828d..b08320c 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 _0x5a83=['ENUM','localnet','externip','stun','STRING','sequelize'];(function(_0x2740ea,_0x319d1d){var _0x124b89=function(_0x535774){while(--_0x535774){_0x2740ea['push'](_0x2740ea['shift']());}};_0x124b89(++_0x319d1d);}(_0x5a83,0xb3));var _0x35a8=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5a83[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x35a8('0x0'));module['exports']={'type':{'type':Sequelize[_0x35a8('0x1')](_0x35a8('0x2'),_0x35a8('0x3'),_0x35a8('0x4'),'turn')},'value':{'type':Sequelize[_0x35a8('0x5')]},'username':{'type':Sequelize[_0x35a8('0x5')]},'password':{'type':Sequelize[_0x35a8('0x5')]}}; \ No newline at end of file +var _0xfad7=['turn','STRING','sequelize','ENUM','externip','stun'];(function(_0x1a7e2d,_0x5dcfab){var _0x13c756=function(_0x4a57f1){while(--_0x4a57f1){_0x1a7e2d['push'](_0x1a7e2d['shift']());}};_0x13c756(++_0x5dcfab);}(_0xfad7,0x14c));var _0x7fad=function(_0x264507,_0xad96ec){_0x264507=_0x264507-0x0;var _0x2a6b60=_0xfad7[_0x264507];return _0x2a6b60;};'use strict';var Sequelize=require(_0x7fad('0x0'));module['exports']={'type':{'type':Sequelize[_0x7fad('0x1')]('localnet',_0x7fad('0x2'),_0x7fad('0x3'),_0x7fad('0x4'))},'value':{'type':Sequelize[_0x7fad('0x5')]},'username':{'type':Sequelize[_0x7fad('0x5')]},'password':{'type':Sequelize[_0x7fad('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 3634a10..046a06e 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 _0xbe13=['readFileSync','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','TURN','/etc/asterisk/turn_xcally.conf','/etc/asterisk/sip_xcally_%s.conf','util','path','ejs','lodash','api','../../config/environment','../../mysqldb','client','http','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','json','offset','undefined','limit','count','status','set','Content-Range','update','destroy','sendStatus','stack','name','send','index','Network','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','type','options','includeAll','findAll','rows','show','params','find','create','body','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase'];(function(_0x36326d,_0x2bac19){var _0x495c5e=function(_0xe8dbb2){while(--_0xe8dbb2){_0x36326d['push'](_0x36326d['shift']());}};_0x495c5e(++_0x2bac19);}(_0xbe13,0x151));var _0x3be1=function(_0x55d8c7,_0x593fb7){_0x55d8c7=_0x55d8c7-0x0;var _0x11d663=_0xbe13[_0x55d8c7];return _0x11d663;};'use strict';var util=require(_0x3be1('0x0'));var path=require(_0x3be1('0x1'));var ejs=require(_0x3be1('0x2'));var fs=require('fs');var _=require(_0x3be1('0x3'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x3be1('0x4'));var config=require(_0x3be1('0x5'));var db=require(_0x3be1('0x6'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x3be1('0x7')][_0x3be1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d49cd,_0x147a07,_0x20479a,_0x37ff68){return new Promise(function(_0x399a97,_0x447593){var _0x2e3311=_0x37ff68||client;return _0x2e3311['request'](_0x4d49cd,_0x20479a)[_0x3be1('0x9')](function(_0x2fe5f0){logger['info'](_0x3be1('0xa'),_0x147a07,_0x3be1('0xb'));logger[_0x3be1('0xc')](_0x3be1('0xd'),_0x147a07,'request\x20sent',JSON[_0x3be1('0xe')](_0x2fe5f0));if(_0x2fe5f0[_0x3be1('0xf')]){if(_0x2fe5f0[_0x3be1('0xf')][_0x3be1('0x10')]===0x1f4){logger[_0x3be1('0xf')](_0x3be1('0xa'),_0x147a07,_0x2fe5f0[_0x3be1('0xf')]['message']);return _0x447593(_0x2fe5f0[_0x3be1('0xf')][_0x3be1('0x11')]);}logger[_0x3be1('0xf')](_0x3be1('0xa'),_0x147a07,_0x2fe5f0['error']['message']);return _0x399a97(_0x2fe5f0[_0x3be1('0xf')][_0x3be1('0x11')]);}else{logger['info'](_0x3be1('0xa'),_0x147a07,_0x3be1('0xb'));_0x399a97(_0x2fe5f0['result']['message']);}})[_0x3be1('0x12')](function(_0xc2a37c){logger[_0x3be1('0xf')]('Network,\x20%s,\x20%s',_0x147a07,_0xc2a37c);_0x447593(_0xc2a37c);});});}function respondWithResult(_0x33fbc4,_0x3d6ce8){_0x3d6ce8=_0x3d6ce8||0xc8;return function(_0x2bb697){if(_0x2bb697){return _0x33fbc4['status'](_0x3d6ce8)[_0x3be1('0x13')](_0x2bb697);}};}function respondWithFilteredResult(_0x7b587a,_0x292977){return function(_0x31c62d){if(_0x31c62d){var _0x2fc652=typeof _0x292977[_0x3be1('0x14')]===_0x3be1('0x15')&&typeof _0x292977[_0x3be1('0x16')]===_0x3be1('0x15');var _0x32e5a6=_0x31c62d['count'];var _0x1333ec=_0x2fc652?0x0:_0x292977[_0x3be1('0x14')];var _0x48e2cc=_0x2fc652?_0x31c62d[_0x3be1('0x17')]:_0x292977[_0x3be1('0x14')]+_0x292977[_0x3be1('0x16')];var _0x355258;if(_0x48e2cc>=_0x32e5a6){_0x48e2cc=_0x32e5a6;_0x355258=0xc8;}else{_0x355258=0xce;}_0x7b587a[_0x3be1('0x18')](_0x355258);return _0x7b587a[_0x3be1('0x19')](_0x3be1('0x1a'),_0x1333ec+'-'+_0x48e2cc+'/'+_0x32e5a6)[_0x3be1('0x13')](_0x31c62d);}return null;};}function saveUpdates(_0x1e4623){return function(_0x2164bc){if(_0x2164bc){return _0x2164bc[_0x3be1('0x1b')](_0x1e4623)[_0x3be1('0x9')](function(_0x36a52d){return _0x36a52d;});}return null;};}function removeEntity(_0x55566b){return function(_0x4ff59d){if(_0x4ff59d){return _0x4ff59d[_0x3be1('0x1c')]()['then'](function(){_0x55566b[_0x3be1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f4eff){return function(_0x12ebeb){if(!_0x12ebeb){_0x3f4eff[_0x3be1('0x1d')](0x194);}return _0x12ebeb;};}function handleError(_0x203225,_0x3041d4){_0x3041d4=_0x3041d4||0x1f4;return function(_0x2bd08f){logger[_0x3be1('0xf')](_0x2bd08f[_0x3be1('0x1e')]);if(_0x2bd08f[_0x3be1('0x1f')]){delete _0x2bd08f[_0x3be1('0x1f')];}_0x203225[_0x3be1('0x18')](_0x3041d4)[_0x3be1('0x20')](_0x2bd08f);};}exports[_0x3be1('0x21')]=function(_0x156c96,_0x2c0c01){var _0x6ec0eb={},_0x554744={},_0x5c4aba={'count':0x0,'rows':[]};var _0x2a6ece=_['map'](db[_0x3be1('0x22')][_0x3be1('0x23')],function(_0x46a955){return{'name':_0x46a955[_0x3be1('0x24')],'type':_0x46a955['type']['key']};});_0x554744[_0x3be1('0x25')]=_[_0x3be1('0x26')](_0x2a6ece,_0x3be1('0x1f'));_0x554744[_0x3be1('0x27')]=_[_0x3be1('0x28')](_0x156c96[_0x3be1('0x27')]);_0x554744[_0x3be1('0x29')]=_[_0x3be1('0x2a')](_0x554744[_0x3be1('0x25')],_0x554744[_0x3be1('0x27')]);_0x6ec0eb[_0x3be1('0x2b')]=_[_0x3be1('0x2a')](_0x554744['model'],qs[_0x3be1('0x2c')](_0x156c96[_0x3be1('0x27')]['fields']));_0x6ec0eb[_0x3be1('0x2b')]=_0x6ec0eb['attributes'][_0x3be1('0x2d')]?_0x6ec0eb['attributes']:_0x554744[_0x3be1('0x25')];if(!_0x156c96[_0x3be1('0x27')]['hasOwnProperty'](_0x3be1('0x2e'))){_0x6ec0eb[_0x3be1('0x16')]=qs[_0x3be1('0x16')](_0x156c96[_0x3be1('0x27')][_0x3be1('0x16')]);_0x6ec0eb[_0x3be1('0x14')]=qs['offset'](_0x156c96[_0x3be1('0x27')][_0x3be1('0x14')]);}_0x6ec0eb[_0x3be1('0x2f')]=qs[_0x3be1('0x30')](_0x156c96['query'][_0x3be1('0x30')]);_0x6ec0eb['where']=qs[_0x3be1('0x29')](_['pick'](_0x156c96['query'],_0x554744['filters']),_0x2a6ece);if(_0x156c96[_0x3be1('0x27')][_0x3be1('0x31')]){_0x6ec0eb[_0x3be1('0x32')]=_[_0x3be1('0x33')](_0x6ec0eb[_0x3be1('0x32')],{'$or':_[_0x3be1('0x26')](_0x2a6ece,function(_0x5233e5){if(_0x5233e5[_0x3be1('0x34')]!=='VIRTUAL'){var _0x3ea43e={};_0x3ea43e[_0x5233e5[_0x3be1('0x1f')]]={'$like':'%'+_0x156c96[_0x3be1('0x27')][_0x3be1('0x31')]+'%'};return _0x3ea43e;}})});}_0x6ec0eb=_[_0x3be1('0x33')]({},_0x6ec0eb,_0x156c96[_0x3be1('0x35')]);var _0x5bcd36={'where':_0x6ec0eb[_0x3be1('0x32')]};return db[_0x3be1('0x22')]['count'](_0x5bcd36)['then'](function(_0x7bd0b4){_0x5c4aba[_0x3be1('0x17')]=_0x7bd0b4;if(_0x156c96[_0x3be1('0x27')][_0x3be1('0x36')]){_0x6ec0eb['include']=[{'all':!![]}];}return db[_0x3be1('0x22')][_0x3be1('0x37')](_0x6ec0eb);})[_0x3be1('0x9')](function(_0xd27c60){_0x5c4aba[_0x3be1('0x38')]=_0xd27c60;return _0x5c4aba;})[_0x3be1('0x9')](respondWithFilteredResult(_0x2c0c01,_0x6ec0eb))['catch'](handleError(_0x2c0c01,null));};exports[_0x3be1('0x39')]=function(_0x2497e1,_0x45c8d1){var _0x13d2b7={'raw':!![],'where':{'id':_0x2497e1[_0x3be1('0x3a')]['id']}},_0x2d046d={};_0x2d046d['model']=_[_0x3be1('0x28')](db[_0x3be1('0x22')]['rawAttributes']);_0x2d046d['query']=_[_0x3be1('0x28')](_0x2497e1['query']);_0x2d046d[_0x3be1('0x29')]=_['intersection'](_0x2d046d[_0x3be1('0x25')],_0x2d046d[_0x3be1('0x27')]);_0x13d2b7[_0x3be1('0x2b')]=_[_0x3be1('0x2a')](_0x2d046d[_0x3be1('0x25')],qs[_0x3be1('0x2c')](_0x2497e1['query'][_0x3be1('0x2c')]));_0x13d2b7[_0x3be1('0x2b')]=_0x13d2b7[_0x3be1('0x2b')][_0x3be1('0x2d')]?_0x13d2b7[_0x3be1('0x2b')]:_0x2d046d['model'];if(_0x2497e1[_0x3be1('0x27')][_0x3be1('0x36')]){_0x13d2b7['include']=[{'all':!![]}];}_0x13d2b7=_[_0x3be1('0x33')]({},_0x13d2b7,_0x2497e1[_0x3be1('0x35')]);return db[_0x3be1('0x22')][_0x3be1('0x3b')](_0x13d2b7)['then'](handleEntityNotFound(_0x45c8d1,null))[_0x3be1('0x9')](respondWithResult(_0x45c8d1,null))['catch'](handleError(_0x45c8d1,null));};exports['create']=function(_0x4b791e,_0x3d5975){var _0x16c7aa;return db['Network'][_0x3be1('0x3c')](_0x4b791e[_0x3be1('0x3d')],{'raw':!![]})[_0x3be1('0x9')](function(_0x232585){_0x16c7aa=_0x232585;return db[_0x3be1('0x22')][_0x3be1('0x37')]({'where':{'type':_0x4b791e[_0x3be1('0x3d')]['type']},'raw':!![]});})[_0x3be1('0x9')](function(_0x388642){if(_0x16c7aa['type']['toUpperCase']()==_0x3be1('0x3e')){var _0x3c0d8a=fs['readFileSync'](path[_0x3be1('0x3f')](config[_0x3be1('0x40')],_0x3be1('0x41')),_0x3be1('0x42'));var _0x509556=ejs[_0x3be1('0x43')](_0x3c0d8a,{'networks':_0x388642||[]});fs[_0x3be1('0x44')](_0x3be1('0x45'),_0x509556);return respondWithRpcPromise(_0x3be1('0x46'),'create',{'module':_0x3be1('0x47')});}else if(_0x16c7aa['type'][_0x3be1('0x48')]()=='TURN'){var _0x42f13a=fs[_0x3be1('0x49')](path[_0x3be1('0x3f')](config[_0x3be1('0x40')],_0x3be1('0x4a')),_0x3be1('0x42'));var _0x411f10=ejs[_0x3be1('0x43')](_0x42f13a,{'networks':_0x388642||[]});fs[_0x3be1('0x44')]('/etc/asterisk/turn_xcally.conf',_0x411f10);return respondWithRpcPromise(_0x3be1('0x46'),'create',{'module':_0x3be1('0x47')});}else{var _0x1c2dca=fs[_0x3be1('0x49')](path[_0x3be1('0x3f')](config['root'],_0x3be1('0x4b')),_0x3be1('0x42'));var _0xab0555=ejs[_0x3be1('0x43')](_0x1c2dca,{'networks':_0x388642||[]});fs['writeFileSync'](util[_0x3be1('0x4c')]('/etc/asterisk/sip_xcally_%s.conf',_0x4b791e[_0x3be1('0x3d')][_0x3be1('0x34')][_0x3be1('0x4d')]()),_0xab0555);return respondWithRpcPromise(_0x3be1('0x46'),_0x3be1('0x3c'),{'module':_0x3be1('0x4e')});}})[_0x3be1('0x9')](function(){return _0x16c7aa;})['then'](respondWithResult(_0x3d5975,0xc9))[_0x3be1('0x12')](handleError(_0x3d5975,null));};exports['update']=function(_0x29ad13,_0x3e83dd){var _0x289df8;return db['Network']['find']({'where':{'id':_0x29ad13[_0x3be1('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3e83dd,null))[_0x3be1('0x9')](saveUpdates(_0x29ad13['body'],null))['then'](function(_0x1caa5b){if(_0x1caa5b){_0x289df8=_0x1caa5b;return db[_0x3be1('0x22')][_0x3be1('0x37')]({'where':{'type':_0x289df8[_0x3be1('0x34')]},'raw':!![]});}return null;})['then'](function(_0x5c3bde){if(_0x289df8[_0x3be1('0x34')]['toUpperCase']()=='STUN'){var _0x2f55dc=fs[_0x3be1('0x49')](path[_0x3be1('0x3f')](config['root'],_0x3be1('0x41')),_0x3be1('0x42'));var _0x1cb495=ejs['render'](_0x2f55dc,{'networks':_0x5c3bde||[]});fs['writeFileSync'](_0x3be1('0x45'),_0x1cb495);return respondWithRpcPromise(_0x3be1('0x46'),'update',{'module':_0x3be1('0x47')});}else if(_0x289df8[_0x3be1('0x34')][_0x3be1('0x48')]()==_0x3be1('0x4f')){var _0x508541=fs['readFileSync'](path[_0x3be1('0x3f')](config['root'],_0x3be1('0x4a')),'utf8');var _0x402421=ejs[_0x3be1('0x43')](_0x508541,{'networks':_0x5c3bde||[]});fs['writeFileSync'](_0x3be1('0x50'),_0x402421);return respondWithRpcPromise(_0x3be1('0x46'),_0x3be1('0x1b'),{'module':_0x3be1('0x47')});}else{var _0x5893cc=fs[_0x3be1('0x49')](path[_0x3be1('0x3f')](config['root'],_0x3be1('0x4b')),_0x3be1('0x42'));var _0x43427b=ejs[_0x3be1('0x43')](_0x5893cc,{'networks':_0x5c3bde||[]});fs[_0x3be1('0x44')](util[_0x3be1('0x4c')](_0x3be1('0x51'),_0x29ad13[_0x3be1('0x3d')]['type']['toLowerCase']()),_0x43427b);return respondWithRpcPromise(_0x3be1('0x46'),'update',{'module':'chan_sip.so'});}})[_0x3be1('0x9')](function(_0x4159c7){if(_0x4159c7){return _0x289df8;}return null;})['then'](respondWithResult(_0x3e83dd,null))['catch'](handleError(_0x3e83dd,null));};exports[_0x3be1('0x1c')]=function(_0x32ec3d,_0x3ebd5d){var _0x38fafb;return db[_0x3be1('0x22')]['find']({'where':{'id':_0x32ec3d[_0x3be1('0x3a')]['id']}})['then'](function(_0x19674d){_0x38fafb=_0x19674d;return _0x19674d;})[_0x3be1('0x9')](handleEntityNotFound(_0x3ebd5d,null))[_0x3be1('0x9')](removeEntity(_0x3ebd5d,null))['then'](function(){if(_0x38fafb){return db[_0x3be1('0x22')]['findAll']({'where':{'type':_0x38fafb['type']},'raw':!![]});}})[_0x3be1('0x9')](function(_0x192459){if(_0x38fafb[_0x3be1('0x34')]['toUpperCase']()==_0x3be1('0x3e')){var _0x39886c=fs['readFileSync'](path[_0x3be1('0x3f')](config[_0x3be1('0x40')],_0x3be1('0x41')),_0x3be1('0x42'));var _0x334c47=ejs[_0x3be1('0x43')](_0x39886c,{'networks':_0x192459||[]});fs[_0x3be1('0x44')](_0x3be1('0x45'),_0x334c47);return respondWithRpcPromise(_0x3be1('0x46'),_0x3be1('0x1c'),{'module':_0x3be1('0x47')});}else if(_0x38fafb[_0x3be1('0x34')][_0x3be1('0x48')]()==_0x3be1('0x4f')){var _0xb0f02d=fs[_0x3be1('0x49')](path['join'](config['root'],_0x3be1('0x4a')),_0x3be1('0x42'));var _0x110e2c=ejs[_0x3be1('0x43')](_0xb0f02d,{'networks':_0x192459||[]});fs[_0x3be1('0x44')](_0x3be1('0x50'),_0x110e2c);return respondWithRpcPromise('Reload',_0x3be1('0x1c'),{'module':_0x3be1('0x47')});}else{var _0x1f58ff=fs[_0x3be1('0x49')](path['join'](config[_0x3be1('0x40')],'server/files/templates/network.ejs'),_0x3be1('0x42'));var _0x1e8c87=ejs['render'](_0x1f58ff,{'networks':_0x192459||[]});fs['writeFileSync'](util[_0x3be1('0x4c')]('/etc/asterisk/sip_xcally_%s.conf',_0x38fafb['type']['toLowerCase']()),_0x1e8c87);return respondWithRpcPromise(_0x3be1('0x46'),_0x3be1('0x1c'),{'module':_0x3be1('0x4e')});}})['catch'](handleError(_0x3ebd5d,null));}; \ No newline at end of file +var _0x4086=['/etc/asterisk/stun_xcally.conf','Reload','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','lodash','../../components/parsers/qs','../../config/environment','../../mysqldb','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','offset','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','Network','findAll','rows','catch','show','params','find','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync'];(function(_0xfe0803,_0x3fa7ce){var _0x22a309=function(_0x3298d7){while(--_0x3298d7){_0xfe0803['push'](_0xfe0803['shift']());}};_0x22a309(++_0x3fa7ce);}(_0x4086,0x157));var _0x6408=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4086[_0x122ef9];return _0x42fba0;};'use strict';var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6408('0x0'));var qs=require(_0x6408('0x1'));var logger=require('../../config/logger')('api');var config=require(_0x6408('0x2'));var db=require(_0x6408('0x3'))['db'];var jayson=require(_0x6408('0x4'));var client=jayson[_0x6408('0x5')][_0x6408('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x31bd15,_0x2149dc,_0x31b6c6,_0x4f00c9){return new Promise(function(_0x19b5c3,_0x43ef21){var _0xc277d0=_0x4f00c9||client;return _0xc277d0['request'](_0x31bd15,_0x31b6c6)[_0x6408('0x7')](function(_0x28591c){logger[_0x6408('0x8')](_0x6408('0x9'),_0x2149dc,_0x6408('0xa'));logger[_0x6408('0xb')](_0x6408('0xc'),_0x2149dc,_0x6408('0xa'),JSON[_0x6408('0xd')](_0x28591c));if(_0x28591c[_0x6408('0xe')]){if(_0x28591c[_0x6408('0xe')][_0x6408('0xf')]===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x2149dc,_0x28591c[_0x6408('0xe')][_0x6408('0x10')]);return _0x43ef21(_0x28591c[_0x6408('0xe')][_0x6408('0x10')]);}logger[_0x6408('0xe')]('Network,\x20%s,\x20%s',_0x2149dc,_0x28591c[_0x6408('0xe')][_0x6408('0x10')]);return _0x19b5c3(_0x28591c[_0x6408('0xe')][_0x6408('0x10')]);}else{logger[_0x6408('0x8')]('Network,\x20%s,\x20%s',_0x2149dc,_0x6408('0xa'));_0x19b5c3(_0x28591c[_0x6408('0x11')]['message']);}})['catch'](function(_0x52b0ab){logger[_0x6408('0xe')](_0x6408('0x9'),_0x2149dc,_0x52b0ab);_0x43ef21(_0x52b0ab);});});}function respondWithResult(_0x394062,_0x4e8deb){_0x4e8deb=_0x4e8deb||0xc8;return function(_0x4bbeba){if(_0x4bbeba){return _0x394062[_0x6408('0x12')](_0x4e8deb)[_0x6408('0x13')](_0x4bbeba);}};}function respondWithFilteredResult(_0x1b62fe,_0x3c93ce){return function(_0x1dde2d){if(_0x1dde2d){var _0x42f39a=typeof _0x3c93ce[_0x6408('0x14')]==='undefined'&&typeof _0x3c93ce['limit']==='undefined';var _0x29cdc1=_0x1dde2d['count'];var _0x435060=_0x42f39a?0x0:_0x3c93ce[_0x6408('0x14')];var _0x5574dc=_0x42f39a?_0x1dde2d[_0x6408('0x15')]:_0x3c93ce['offset']+_0x3c93ce['limit'];var _0x252f5a;if(_0x5574dc>=_0x29cdc1){_0x5574dc=_0x29cdc1;_0x252f5a=0xc8;}else{_0x252f5a=0xce;}_0x1b62fe[_0x6408('0x12')](_0x252f5a);return _0x1b62fe[_0x6408('0x16')](_0x6408('0x17'),_0x435060+'-'+_0x5574dc+'/'+_0x29cdc1)[_0x6408('0x13')](_0x1dde2d);}return null;};}function saveUpdates(_0x19c114){return function(_0x316de0){if(_0x316de0){return _0x316de0[_0x6408('0x18')](_0x19c114)['then'](function(_0x46a9f1){return _0x46a9f1;});}return null;};}function removeEntity(_0x3763a1){return function(_0x4ba8f1){if(_0x4ba8f1){return _0x4ba8f1[_0x6408('0x19')]()['then'](function(){_0x3763a1['status'](0xcc)[_0x6408('0x1a')]();});}};}function handleEntityNotFound(_0x254700){return function(_0x115ba8){if(!_0x115ba8){_0x254700[_0x6408('0x1b')](0x194);}return _0x115ba8;};}function handleError(_0x5f0016,_0x438924){_0x438924=_0x438924||0x1f4;return function(_0x427394){logger[_0x6408('0xe')](_0x427394[_0x6408('0x1c')]);if(_0x427394[_0x6408('0x1d')]){delete _0x427394['name'];}_0x5f0016[_0x6408('0x12')](_0x438924)['send'](_0x427394);};}exports[_0x6408('0x1e')]=function(_0x88b202,_0x342167){var _0x57e762={},_0x24a208={},_0x2d0d8c={'count':0x0,'rows':[]};var _0x25957a=_[_0x6408('0x1f')](db['Network'][_0x6408('0x20')],function(_0x567ff0){return{'name':_0x567ff0['fieldName'],'type':_0x567ff0[_0x6408('0x21')][_0x6408('0x22')]};});_0x24a208[_0x6408('0x23')]=_[_0x6408('0x1f')](_0x25957a,_0x6408('0x1d'));_0x24a208[_0x6408('0x24')]=_[_0x6408('0x25')](_0x88b202[_0x6408('0x24')]);_0x24a208[_0x6408('0x26')]=_['intersection'](_0x24a208[_0x6408('0x23')],_0x24a208['query']);_0x57e762[_0x6408('0x27')]=_[_0x6408('0x28')](_0x24a208['model'],qs[_0x6408('0x29')](_0x88b202[_0x6408('0x24')][_0x6408('0x29')]));_0x57e762[_0x6408('0x27')]=_0x57e762[_0x6408('0x27')][_0x6408('0x2a')]?_0x57e762[_0x6408('0x27')]:_0x24a208[_0x6408('0x23')];if(!_0x88b202[_0x6408('0x24')]['hasOwnProperty'](_0x6408('0x2b'))){_0x57e762[_0x6408('0x2c')]=qs[_0x6408('0x2c')](_0x88b202['query'][_0x6408('0x2c')]);_0x57e762[_0x6408('0x14')]=qs['offset'](_0x88b202[_0x6408('0x24')][_0x6408('0x14')]);}_0x57e762[_0x6408('0x2d')]=qs[_0x6408('0x2e')](_0x88b202[_0x6408('0x24')][_0x6408('0x2e')]);_0x57e762[_0x6408('0x2f')]=qs['filters'](_[_0x6408('0x30')](_0x88b202['query'],_0x24a208[_0x6408('0x26')]),_0x25957a);if(_0x88b202['query'][_0x6408('0x31')]){_0x57e762['where']=_[_0x6408('0x32')](_0x57e762[_0x6408('0x2f')],{'$or':_[_0x6408('0x1f')](_0x25957a,function(_0x4d8ab2){if(_0x4d8ab2[_0x6408('0x21')]!==_0x6408('0x33')){var _0x1ae7d2={};_0x1ae7d2[_0x4d8ab2[_0x6408('0x1d')]]={'$like':'%'+_0x88b202[_0x6408('0x24')]['filter']+'%'};return _0x1ae7d2;}})});}_0x57e762=_[_0x6408('0x32')]({},_0x57e762,_0x88b202[_0x6408('0x34')]);var _0x25f9c3={'where':_0x57e762['where']};return db['Network'][_0x6408('0x15')](_0x25f9c3)[_0x6408('0x7')](function(_0x13458f){_0x2d0d8c[_0x6408('0x15')]=_0x13458f;if(_0x88b202[_0x6408('0x24')]['includeAll']){_0x57e762[_0x6408('0x35')]=[{'all':!![]}];}return db[_0x6408('0x36')][_0x6408('0x37')](_0x57e762);})[_0x6408('0x7')](function(_0x11a4e9){_0x2d0d8c[_0x6408('0x38')]=_0x11a4e9;return _0x2d0d8c;})[_0x6408('0x7')](respondWithFilteredResult(_0x342167,_0x57e762))[_0x6408('0x39')](handleError(_0x342167,null));};exports[_0x6408('0x3a')]=function(_0x464124,_0x235fec){var _0x78f4e7={'raw':!![],'where':{'id':_0x464124[_0x6408('0x3b')]['id']}},_0x2ca56d={};_0x2ca56d[_0x6408('0x23')]=_['keys'](db[_0x6408('0x36')]['rawAttributes']);_0x2ca56d['query']=_[_0x6408('0x25')](_0x464124[_0x6408('0x24')]);_0x2ca56d['filters']=_[_0x6408('0x28')](_0x2ca56d[_0x6408('0x23')],_0x2ca56d[_0x6408('0x24')]);_0x78f4e7[_0x6408('0x27')]=_[_0x6408('0x28')](_0x2ca56d[_0x6408('0x23')],qs[_0x6408('0x29')](_0x464124[_0x6408('0x24')][_0x6408('0x29')]));_0x78f4e7[_0x6408('0x27')]=_0x78f4e7[_0x6408('0x27')][_0x6408('0x2a')]?_0x78f4e7['attributes']:_0x2ca56d[_0x6408('0x23')];if(_0x464124[_0x6408('0x24')]['includeAll']){_0x78f4e7[_0x6408('0x35')]=[{'all':!![]}];}_0x78f4e7=_[_0x6408('0x32')]({},_0x78f4e7,_0x464124['options']);return db[_0x6408('0x36')][_0x6408('0x3c')](_0x78f4e7)['then'](handleEntityNotFound(_0x235fec,null))[_0x6408('0x7')](respondWithResult(_0x235fec,null))[_0x6408('0x39')](handleError(_0x235fec,null));};exports['create']=function(_0x5d5782,_0xc2a18){var _0x399b9d;return db[_0x6408('0x36')][_0x6408('0x3d')](_0x5d5782[_0x6408('0x3e')],{'raw':!![]})[_0x6408('0x7')](function(_0x5bad7d){_0x399b9d=_0x5bad7d;return db[_0x6408('0x36')][_0x6408('0x37')]({'where':{'type':_0x5d5782[_0x6408('0x3e')]['type']},'raw':!![]});})[_0x6408('0x7')](function(_0x2e669e){if(_0x399b9d[_0x6408('0x21')][_0x6408('0x3f')]()==_0x6408('0x40')){var _0x8bae63=fs[_0x6408('0x41')](path[_0x6408('0x42')](config[_0x6408('0x43')],_0x6408('0x44')),_0x6408('0x45'));var _0x567710=ejs[_0x6408('0x46')](_0x8bae63,{'networks':_0x2e669e||[]});fs[_0x6408('0x47')](_0x6408('0x48'),_0x567710);return respondWithRpcPromise(_0x6408('0x49'),_0x6408('0x3d'),{'module':'res_stun_monitor.so'});}else if(_0x399b9d[_0x6408('0x21')][_0x6408('0x3f')]()==_0x6408('0x4a')){var _0x2268dc=fs[_0x6408('0x41')](path[_0x6408('0x42')](config[_0x6408('0x43')],_0x6408('0x4b')),_0x6408('0x45'));var _0x587a67=ejs[_0x6408('0x46')](_0x2268dc,{'networks':_0x2e669e||[]});fs['writeFileSync'](_0x6408('0x4c'),_0x587a67);return respondWithRpcPromise(_0x6408('0x49'),'create',{'module':_0x6408('0x4d')});}else{var _0x220537=fs[_0x6408('0x41')](path['join'](config[_0x6408('0x43')],_0x6408('0x4e')),'utf8');var _0x587950=ejs['render'](_0x220537,{'networks':_0x2e669e||[]});fs['writeFileSync'](util[_0x6408('0x4f')](_0x6408('0x50'),_0x5d5782['body']['type'][_0x6408('0x51')]()),_0x587950);return respondWithRpcPromise(_0x6408('0x49'),_0x6408('0x3d'),{'module':_0x6408('0x52')});}})[_0x6408('0x7')](function(){return _0x399b9d;})[_0x6408('0x7')](respondWithResult(_0xc2a18,0xc9))[_0x6408('0x39')](handleError(_0xc2a18,null));};exports['update']=function(_0xe7ac3f,_0x511692){var _0x3910e7;return db[_0x6408('0x36')][_0x6408('0x3c')]({'where':{'id':_0xe7ac3f['params']['id']}})[_0x6408('0x7')](handleEntityNotFound(_0x511692,null))['then'](saveUpdates(_0xe7ac3f['body'],null))[_0x6408('0x7')](function(_0x13afdb){if(_0x13afdb){_0x3910e7=_0x13afdb;return db[_0x6408('0x36')][_0x6408('0x37')]({'where':{'type':_0x3910e7[_0x6408('0x21')]},'raw':!![]});}return null;})[_0x6408('0x7')](function(_0x467f1c){if(_0x3910e7[_0x6408('0x21')][_0x6408('0x3f')]()==_0x6408('0x40')){var _0x119f2d=fs['readFileSync'](path['join'](config['root'],_0x6408('0x44')),'utf8');var _0x216c07=ejs[_0x6408('0x46')](_0x119f2d,{'networks':_0x467f1c||[]});fs[_0x6408('0x47')](_0x6408('0x48'),_0x216c07);return respondWithRpcPromise(_0x6408('0x49'),_0x6408('0x18'),{'module':_0x6408('0x4d')});}else if(_0x3910e7[_0x6408('0x21')]['toUpperCase']()==_0x6408('0x4a')){var _0x117b68=fs[_0x6408('0x41')](path[_0x6408('0x42')](config[_0x6408('0x43')],_0x6408('0x4b')),'utf8');var _0x2f915c=ejs['render'](_0x117b68,{'networks':_0x467f1c||[]});fs[_0x6408('0x47')](_0x6408('0x4c'),_0x2f915c);return respondWithRpcPromise(_0x6408('0x49'),_0x6408('0x18'),{'module':_0x6408('0x4d')});}else{var _0x24d24e=fs[_0x6408('0x41')](path[_0x6408('0x42')](config[_0x6408('0x43')],_0x6408('0x4e')),'utf8');var _0x59af4f=ejs[_0x6408('0x46')](_0x24d24e,{'networks':_0x467f1c||[]});fs[_0x6408('0x47')](util[_0x6408('0x4f')](_0x6408('0x50'),_0xe7ac3f[_0x6408('0x3e')][_0x6408('0x21')][_0x6408('0x51')]()),_0x59af4f);return respondWithRpcPromise('Reload',_0x6408('0x18'),{'module':'chan_sip.so'});}})[_0x6408('0x7')](function(_0xec61dd){if(_0xec61dd){return _0x3910e7;}return null;})['then'](respondWithResult(_0x511692,null))[_0x6408('0x39')](handleError(_0x511692,null));};exports[_0x6408('0x19')]=function(_0x460a55,_0x4bb32f){var _0x461526;return db[_0x6408('0x36')][_0x6408('0x3c')]({'where':{'id':_0x460a55[_0x6408('0x3b')]['id']}})[_0x6408('0x7')](function(_0x42db26){_0x461526=_0x42db26;return _0x42db26;})[_0x6408('0x7')](handleEntityNotFound(_0x4bb32f,null))[_0x6408('0x7')](removeEntity(_0x4bb32f,null))[_0x6408('0x7')](function(){if(_0x461526){return db[_0x6408('0x36')][_0x6408('0x37')]({'where':{'type':_0x461526[_0x6408('0x21')]},'raw':!![]});}})[_0x6408('0x7')](function(_0x45cd34){if(_0x461526[_0x6408('0x21')]['toUpperCase']()=='STUN'){var _0xd9d79d=fs[_0x6408('0x41')](path['join'](config[_0x6408('0x43')],_0x6408('0x44')),_0x6408('0x45'));var _0x289369=ejs[_0x6408('0x46')](_0xd9d79d,{'networks':_0x45cd34||[]});fs['writeFileSync'](_0x6408('0x48'),_0x289369);return respondWithRpcPromise(_0x6408('0x49'),_0x6408('0x19'),{'module':_0x6408('0x4d')});}else if(_0x461526[_0x6408('0x21')]['toUpperCase']()==_0x6408('0x4a')){var _0x1ffc4b=fs[_0x6408('0x41')](path[_0x6408('0x42')](config[_0x6408('0x43')],_0x6408('0x4b')),_0x6408('0x45'));var _0x1b6ad6=ejs[_0x6408('0x46')](_0x1ffc4b,{'networks':_0x45cd34||[]});fs[_0x6408('0x47')](_0x6408('0x4c'),_0x1b6ad6);return respondWithRpcPromise(_0x6408('0x49'),_0x6408('0x19'),{'module':_0x6408('0x4d')});}else{var _0x18d0d3=fs[_0x6408('0x41')](path[_0x6408('0x42')](config[_0x6408('0x43')],'server/files/templates/network.ejs'),'utf8');var _0x6ec088=ejs[_0x6408('0x46')](_0x18d0d3,{'networks':_0x45cd34||[]});fs[_0x6408('0x47')](util[_0x6408('0x4f')](_0x6408('0x50'),_0x461526[_0x6408('0x21')][_0x6408('0x51')]()),_0x6ec088);return respondWithRpcPromise('Reload',_0x6408('0x19'),{'module':_0x6408('0x52')});}})[_0x6408('0x39')](handleError(_0x4bb32f,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index e9c41b8..49c3e7f 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 _0xcb91=['rimraf','./network.attributes','exports','define','network','../../config/logger','api','moment','bluebird','path'];(function(_0xd4245d,_0x420ff3){var _0x4efb29=function(_0x127898){while(--_0x127898){_0xd4245d['push'](_0xd4245d['shift']());}};_0x4efb29(++_0x420ff3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3ba924,_0x3b99f0){_0x3ba924=_0x3ba924-0x0;var _0x4cc1df=_0xcb91[_0x3ba924];return _0x4cc1df;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('Network',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda55=['util','moment','bluebird','request-promise','path','rimraf','./network.attributes','define','Network','network','lodash'];(function(_0x48eb30,_0x3cc6a8){var _0x353653=function(_0x41cfab){while(--_0x41cfab){_0x48eb30['push'](_0x48eb30['shift']());}};_0x353653(++_0x3cc6a8);}(_0xda55,0x6d));var _0x5da5=function(_0xb3bbc8,_0x2a3635){_0xb3bbc8=_0xb3bbc8-0x0;var _0x3254b7=_0xda55[_0xb3bbc8];return _0x3254b7;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5da5('0x2'));var BPromise=require(_0x5da5('0x3'));var rp=require(_0x5da5('0x4'));var fs=require('fs');var path=require(_0x5da5('0x5'));var rimraf=require(_0x5da5('0x6'));var config=require('../../config/environment');var attributes=require(_0x5da5('0x7'));module['exports']=function(_0x356a37,_0x58e7b3){return _0x356a37[_0x5da5('0x8')](_0x5da5('0x9'),attributes,{'tableName':_0x5da5('0xa'),'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 5d36df5..d55aa49 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1cec08,_0xaeb34a){var _0x31535e=function(_0x393276){while(--_0x393276){_0x1cec08['push'](_0x1cec08['shift']());}};_0x31535e(++_0xaeb34a);}(_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 db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x34b1d6,_0x5ccbca){_0x34b1d6=_0x34b1d6-0x0;var _0x27ad8f=_0x7a54[_0x34b1d6];return _0x27ad8f;};'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 6b8f5b3..097e8f0 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 _0x59c8=['addApplications','addAgents','/:id/send','send','update','delete','removeDispositions','removeAnswers','removeAgents','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','/describe','describe','get','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/interactions','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','/:id/applications'];(function(_0x3e5752,_0x4ff7d6){var _0x4abbc9=function(_0x3218ee){while(--_0x3218ee){_0x3e5752['push'](_0x3e5752['shift']());}};_0x4abbc9(++_0x4ff7d6);}(_0x59c8,0x99));var _0x859c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x59c8[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x859c('0x0'));var path=require('path');var timeout=require(_0x859c('0x1'));var express=require(_0x859c('0x2'));var router=express[_0x859c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x859c('0x4'));var interaction=require(_0x859c('0x5'));var config=require(_0x859c('0x6'));var controller=require(_0x859c('0x7'));router['get']('/',auth[_0x859c('0x8')](),controller['index']);router['get'](_0x859c('0x9'),auth[_0x859c('0x8')](),controller[_0x859c('0xa')]);router[_0x859c('0xb')](_0x859c('0xc'),auth[_0x859c('0x8')](),controller[_0x859c('0xd')]);router[_0x859c('0xb')](_0x859c('0xe'),auth[_0x859c('0x8')](),controller['getDispositions']);router[_0x859c('0xb')](_0x859c('0xf'),auth[_0x859c('0x8')](),controller[_0x859c('0x10')]);router[_0x859c('0xb')]('/:id/applications',auth[_0x859c('0x8')](),controller['getApplications']);router['get'](_0x859c('0x11'),auth[_0x859c('0x8')](),controller['getInteractions']);router['get'](_0x859c('0x12'),auth[_0x859c('0x8')](),controller[_0x859c('0x13')]);router[_0x859c('0x14')]('/',auth['isAuthenticated'](),controller[_0x859c('0x15')]);router[_0x859c('0x14')](_0x859c('0xe'),auth[_0x859c('0x8')](),controller[_0x859c('0x16')]);router[_0x859c('0x14')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x859c('0x17')]);router['post'](_0x859c('0x18'),controller[_0x859c('0x19')]);router[_0x859c('0x14')](_0x859c('0x1a'),auth[_0x859c('0x8')](),controller[_0x859c('0x1b')]);router[_0x859c('0x14')]('/:id/users',auth[_0x859c('0x8')](),controller[_0x859c('0x1c')]);router[_0x859c('0x14')](_0x859c('0x1d'),auth['isAuthenticated'](),controller[_0x859c('0x1e')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x859c('0x1f')]);router[_0x859c('0x20')](_0x859c('0xc'),auth[_0x859c('0x8')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0x859c('0x8')](),controller[_0x859c('0x21')]);router[_0x859c('0x20')]('/:id/canned_answers',auth[_0x859c('0x8')](),controller[_0x859c('0x22')]);router[_0x859c('0x20')](_0x859c('0x12'),auth['isAuthenticated'](),controller[_0x859c('0x23')]);module['exports']=router; \ No newline at end of file +var _0xdd97=['destroy','delete','removeAnswers','removeAgents','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','getDispositions','getApplications','getInteractions','/:id/users','post','create','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','update'];(function(_0x336dbd,_0x21b342){var _0x5bcb06=function(_0xb46113){while(--_0xb46113){_0x336dbd['push'](_0x336dbd['shift']());}};_0x5bcb06(++_0x21b342);}(_0xdd97,0x1ef));var _0x7dd9=function(_0x3a0ebd,_0x47f368){_0x3a0ebd=_0x3a0ebd-0x0;var _0x51a660=_0xdd97[_0x3a0ebd];return _0x51a660;};'use strict';var multer=require(_0x7dd9('0x0'));var util=require(_0x7dd9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7dd9('0x2'));var router=express[_0x7dd9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7dd9('0x4'));var interaction=require(_0x7dd9('0x5'));var config=require(_0x7dd9('0x6'));var controller=require('./openchannelAccount.controller');router['get']('/',auth[_0x7dd9('0x7')](),controller[_0x7dd9('0x8')]);router[_0x7dd9('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x7dd9('0xa')]);router[_0x7dd9('0x9')](_0x7dd9('0xb'),auth[_0x7dd9('0x7')](),controller[_0x7dd9('0xc')]);router[_0x7dd9('0x9')]('/:id/dispositions',auth[_0x7dd9('0x7')](),controller[_0x7dd9('0xd')]);router[_0x7dd9('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0x7dd9('0x9')]('/:id/applications',auth[_0x7dd9('0x7')](),controller[_0x7dd9('0xe')]);router[_0x7dd9('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x7dd9('0xf')]);router[_0x7dd9('0x9')](_0x7dd9('0x10'),auth[_0x7dd9('0x7')](),controller['getAgents']);router[_0x7dd9('0x11')]('/',auth[_0x7dd9('0x7')](),controller[_0x7dd9('0x12')]);router[_0x7dd9('0x11')](_0x7dd9('0x13'),auth[_0x7dd9('0x7')](),controller[_0x7dd9('0x14')]);router[_0x7dd9('0x11')](_0x7dd9('0x15'),auth[_0x7dd9('0x7')](),controller[_0x7dd9('0x16')]);router[_0x7dd9('0x11')](_0x7dd9('0x17'),controller[_0x7dd9('0x18')]);router[_0x7dd9('0x11')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7dd9('0x19')]);router[_0x7dd9('0x11')](_0x7dd9('0x10'),auth['isAuthenticated'](),controller[_0x7dd9('0x1a')]);router[_0x7dd9('0x11')](_0x7dd9('0x1b'),auth[_0x7dd9('0x7')](),controller[_0x7dd9('0x1c')]);router['put']('/:id',auth[_0x7dd9('0x7')](),controller[_0x7dd9('0x1d')]);router['delete'](_0x7dd9('0xb'),auth[_0x7dd9('0x7')](),controller[_0x7dd9('0x1e')]);router[_0x7dd9('0x1f')](_0x7dd9('0x13'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0x7dd9('0x15'),auth[_0x7dd9('0x7')](),controller[_0x7dd9('0x20')]);router[_0x7dd9('0x1f')](_0x7dd9('0x10'),auth[_0x7dd9('0x7')](),controller[_0x7dd9('0x21')]);module[_0x7dd9('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 5eb83bf..9446cfe 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 _0x83ef=['setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x221ba2,_0x79208){var _0x47d08e=function(_0xaf14ee){while(--_0xaf14ee){_0x221ba2['push'](_0x221ba2['shift']());}};_0x47d08e(++_0x79208);}(_0x83ef,0x1e3));var _0xf83e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x83ef[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xf83e('0x0'));var rs=require(_0xf83e('0x1'));module[_0xf83e('0x2')]={'name':{'type':Sequelize[_0xf83e('0x3')],'unique':_0xf83e('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xf83e('0x3')]},'token':{'type':Sequelize[_0xf83e('0x3')],'defaultValue':function(){return rs[_0xf83e('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xf83e('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf83e('0x6')],'defaultValue':function(){return _0xf83e('0x7');}},'notificationSound':{'type':Sequelize[_0xf83e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xf83e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf83e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf83e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf83e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf83e('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0xf83e('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xf83e('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1eedda){if(!_0x1eedda)this[_0xf83e('0xb')](_0xf83e('0xc'),null);this['setDataValue']('mandatoryDisposition',_0x1eedda);}}}; \ No newline at end of file +var _0xe184=['INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x583db1,_0xa9af30){var _0xa6b378=function(_0x1c0421){while(--_0x1c0421){_0x583db1['push'](_0x583db1['shift']());}};_0xa6b378(++_0xa9af30);}(_0xe184,0x1cc));var _0x4e18=function(_0x54aba0,_0x403d1f){_0x54aba0=_0x54aba0-0x0;var _0x17686c=_0xe184[_0x54aba0];return _0x17686c;};'use strict';var Sequelize=require(_0x4e18('0x0'));var rs=require(_0x4e18('0x1'));module['exports']={'name':{'type':Sequelize[_0x4e18('0x2')],'unique':_0x4e18('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x4e18('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x4e18('0x4')]();}},'replyUri':{'type':Sequelize[_0x4e18('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4e18('0x5')],'defaultValue':function(){return _0x4e18('0x6');}},'notificationSound':{'type':Sequelize[_0x4e18('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4e18('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4e18('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4e18('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4e18('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4e18('0x8')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4e18('0x7')],'defaultValue':![],'comment':_0x4e18('0x9'),'set':function(_0x13f768){if(!_0x13f768)this[_0x4e18('0xa')]('mandatoryDispositionPauseId',null);this[_0x4e18('0xa')](_0x4e18('0xb'),_0x13f768);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 19f39ba..a915bf5 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 _0xd863=['asc','account','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','update','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','OpenchannelAccountId','Disposition','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','OpenchannelApplication','Applications','applications','list','priority'];(function(_0x7e122b,_0x4665bd){var _0x5558c7=function(_0x22daa4){while(--_0x22daa4){_0x7e122b['push'](_0x7e122b['shift']());}};_0x5558c7(++_0x4665bd);}(_0xd863,0x1c7));var _0x3d86=function(_0xeae1a,_0x18b5cb){_0xeae1a=_0xeae1a-0x0;var _0x56573a=_0xd863[_0xeae1a];return _0x56573a;};'use strict';var emlformat=require(_0x3d86('0x0'));var rimraf=require(_0x3d86('0x1'));var zipdir=require(_0x3d86('0x2'));var jsonpatch=require(_0x3d86('0x3'));var rp=require(_0x3d86('0x4'));var moment=require('moment');var BPromise=require(_0x3d86('0x5'));var Mustache=require(_0x3d86('0x6'));var util=require(_0x3d86('0x7'));var path=require(_0x3d86('0x8'));var sox=require('sox');var csv=require(_0x3d86('0x9'));var ejs=require(_0x3d86('0xa'));var fs=require('fs');var fs_extra=require(_0x3d86('0xb'));var _=require(_0x3d86('0xc'));var squel=require(_0x3d86('0xd'));var crypto=require(_0x3d86('0xe'));var jsforce=require(_0x3d86('0xf'));var deskjs=require(_0x3d86('0x10'));var toCsv=require(_0x3d86('0x9'));var querystring=require(_0x3d86('0x11'));var Papa=require(_0x3d86('0x12'));var Redis=require(_0x3d86('0x13'));var authService=require(_0x3d86('0x14'));var qs=require(_0x3d86('0x15'));var as=require(_0x3d86('0x16'));var hardwareService=require(_0x3d86('0x17'));var logger=require('../../config/logger')(_0x3d86('0x18'));var utils=require(_0x3d86('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x3d86('0x1a'));var db=require(_0x3d86('0x1b'))['db'];config[_0x3d86('0x1c')]=_[_0x3d86('0x1d')](config[_0x3d86('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x3d86('0x1e'))(new Redis(config[_0x3d86('0x1c')]));require(_0x3d86('0x1f'))[_0x3d86('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3d86('0x21')][_0x3d86('0x22')]({'port':0x232c});var client9002=jayson[_0x3d86('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a8ae3,_0x22c597,_0x15fb30,_0x2e81b2){return new BPromise(function(_0x19505e,_0x52c6cd){var _0x3216b2=_0x2e81b2||client;return _0x3216b2[_0x3d86('0x23')](_0x4a8ae3,_0x15fb30)['then'](function(_0x4ae735){logger[_0x3d86('0x24')](_0x3d86('0x25'),_0x22c597,'request\x20sent');logger['debug'](_0x3d86('0x26'),_0x22c597,_0x3d86('0x27'),JSON['stringify'](_0x4ae735));if(_0x4ae735[_0x3d86('0x28')]){if(_0x4ae735[_0x3d86('0x28')][_0x3d86('0x29')]===0x1f4){logger[_0x3d86('0x28')](_0x3d86('0x25'),_0x22c597,_0x4ae735[_0x3d86('0x28')]['message']);return _0x52c6cd(_0x4ae735['error'][_0x3d86('0x2a')]);}logger[_0x3d86('0x28')](_0x3d86('0x25'),_0x22c597,_0x4ae735[_0x3d86('0x28')][_0x3d86('0x2a')]);return _0x19505e(_0x4ae735[_0x3d86('0x28')][_0x3d86('0x2a')]);}else{logger[_0x3d86('0x24')](_0x3d86('0x25'),_0x22c597,_0x3d86('0x27'));_0x19505e(_0x4ae735[_0x3d86('0x2b')][_0x3d86('0x2a')]);}})[_0x3d86('0x2c')](function(_0x1d1899){logger[_0x3d86('0x28')](_0x3d86('0x25'),_0x22c597,_0x1d1899);_0x52c6cd(_0x1d1899);});});}function respondWithStatusCode(_0x496f19,_0x4d2255){_0x4d2255=_0x4d2255||0xcc;return function(_0x28a233){if(_0x28a233){return _0x496f19[_0x3d86('0x2d')](_0x4d2255);}return _0x496f19[_0x3d86('0x2e')](_0x4d2255)[_0x3d86('0x2f')]();};}function respondWithResult(_0x30407f,_0x45cf57){_0x45cf57=_0x45cf57||0xc8;return function(_0x10cf57){if(_0x10cf57){return _0x30407f[_0x3d86('0x2e')](_0x45cf57)[_0x3d86('0x30')](_0x10cf57);}};}function respondWithFilteredResult(_0x1e5b1f,_0x5c8d75){return function(_0x44fd02){if(_0x44fd02){var _0x520730=typeof _0x5c8d75['offset']===_0x3d86('0x31')&&typeof _0x5c8d75[_0x3d86('0x32')]===_0x3d86('0x31');var _0x32a671=_0x44fd02['count'];var _0x386bea=_0x520730?0x0:_0x5c8d75['offset'];var _0x307652=_0x520730?_0x44fd02[_0x3d86('0x33')]:_0x5c8d75[_0x3d86('0x34')]+_0x5c8d75[_0x3d86('0x32')];var _0x92b3f7;if(_0x307652>=_0x32a671){_0x307652=_0x32a671;_0x92b3f7=0xc8;}else{_0x92b3f7=0xce;}_0x1e5b1f[_0x3d86('0x2e')](_0x92b3f7);return _0x1e5b1f[_0x3d86('0x35')](_0x3d86('0x36'),_0x386bea+'-'+_0x307652+'/'+_0x32a671)[_0x3d86('0x30')](_0x44fd02);}return null;};}function patchUpdates(_0x360328){return function(_0x1a4fae){try{jsonpatch[_0x3d86('0x37')](_0x1a4fae,_0x360328,!![]);}catch(_0x356acc){return BPromise[_0x3d86('0x38')](_0x356acc);}return _0x1a4fae[_0x3d86('0x39')]();};}function saveUpdates(_0x47e133,_0x2f7697){return function(_0xd5c301){if(_0xd5c301){return _0xd5c301['update'](_0x47e133)[_0x3d86('0x3a')](function(_0x585ff0){return _0x585ff0;});}return null;};}function removeEntity(_0x61cfb2,_0x5bc300){return function(_0x3db8a2){if(_0x3db8a2){return _0x3db8a2[_0x3d86('0x3b')]()[_0x3d86('0x3a')](function(){var _0x3970b3=_0x3db8a2[_0x3d86('0x3c')]({'plain':!![]});var _0x4016f2=_0x3d86('0x3d');return db[_0x3d86('0x3e')][_0x3d86('0x3b')]({'where':{'type':_0x4016f2,'resourceId':_0x3970b3['id']}})[_0x3d86('0x3a')](function(){return _0x3db8a2;});})[_0x3d86('0x3a')](function(){_0x61cfb2[_0x3d86('0x2e')](0xcc)[_0x3d86('0x2f')]();});}};}function handleEntityNotFound(_0x446cfc,_0x3f5201){return function(_0x56e12c){if(!_0x56e12c){_0x446cfc[_0x3d86('0x2d')](0x194);}return _0x56e12c;};}function handleError(_0x2d1758,_0x3cc3c3){_0x3cc3c3=_0x3cc3c3||0x1f4;return function(_0x1a7abb){logger[_0x3d86('0x28')](_0x1a7abb[_0x3d86('0x3f')]);if(_0x1a7abb[_0x3d86('0x40')]){delete _0x1a7abb['name'];}_0x2d1758[_0x3d86('0x2e')](_0x3cc3c3)[_0x3d86('0x41')](_0x1a7abb);};}exports[_0x3d86('0x42')]=function(_0x1d1979,_0x1cdf6e){var _0x2bb53f={'include':[{'model':db[_0x3d86('0x43')],'as':_0x3d86('0x44')}]},_0x13231d={},_0x76dc01={'count':0x0,'rows':[]};var _0x2dc617=_[_0x3d86('0x45')](db[_0x3d86('0x46')][_0x3d86('0x47')],function(_0x36d181){return{'name':_0x36d181['fieldName'],'type':_0x36d181['type'][_0x3d86('0x48')]};});_0x13231d['model']=_['map'](_0x2dc617,_0x3d86('0x40'));_0x13231d[_0x3d86('0x49')]=_[_0x3d86('0x4a')](_0x1d1979['query']);_0x13231d[_0x3d86('0x4b')]=_['intersection'](_0x13231d[_0x3d86('0x4c')],_0x13231d[_0x3d86('0x49')]);_0x2bb53f['attributes']=_[_0x3d86('0x4d')](_0x13231d[_0x3d86('0x4c')],qs[_0x3d86('0x4e')](_0x1d1979[_0x3d86('0x49')][_0x3d86('0x4e')]));_0x2bb53f['attributes']=_0x2bb53f[_0x3d86('0x4f')][_0x3d86('0x50')]?_0x2bb53f[_0x3d86('0x4f')]:_0x13231d[_0x3d86('0x4c')];if(!_0x1d1979[_0x3d86('0x49')][_0x3d86('0x51')](_0x3d86('0x52'))){_0x2bb53f[_0x3d86('0x32')]=qs[_0x3d86('0x32')](_0x1d1979[_0x3d86('0x49')]['limit']);_0x2bb53f[_0x3d86('0x34')]=qs[_0x3d86('0x34')](_0x1d1979[_0x3d86('0x49')][_0x3d86('0x34')]);}_0x2bb53f[_0x3d86('0x53')]=qs[_0x3d86('0x54')](_0x1d1979[_0x3d86('0x49')][_0x3d86('0x54')]);_0x2bb53f[_0x3d86('0x55')]=qs[_0x3d86('0x4b')](_[_0x3d86('0x56')](_0x1d1979[_0x3d86('0x49')],_0x13231d[_0x3d86('0x4b')]),_0x2dc617);if(_0x1d1979[_0x3d86('0x49')][_0x3d86('0x57')]){_0x2bb53f[_0x3d86('0x55')]=_[_0x3d86('0x58')](_0x2bb53f['where'],{'$or':_['map'](_0x2dc617,function(_0x3437f7){if(_0x3437f7[_0x3d86('0x59')]!==_0x3d86('0x5a')){var _0x7764f9={};_0x7764f9[_0x3437f7[_0x3d86('0x40')]]={'$like':'%'+_0x1d1979[_0x3d86('0x49')]['filter']+'%'};return _0x7764f9;}})});}_0x2bb53f=_[_0x3d86('0x58')]({},_0x2bb53f,_0x1d1979[_0x3d86('0x5b')]);var _0x313864={'where':_0x2bb53f[_0x3d86('0x55')]};return db[_0x3d86('0x46')]['count'](_0x313864)[_0x3d86('0x3a')](function(_0x67d1a0){_0x76dc01[_0x3d86('0x33')]=_0x67d1a0;if(_0x1d1979['query'][_0x3d86('0x5c')]){_0x2bb53f[_0x3d86('0x5d')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x3d86('0x5e')](_0x2bb53f);})[_0x3d86('0x3a')](function(_0x2feade){_0x76dc01[_0x3d86('0x5f')]=_0x2feade;return _0x76dc01;})[_0x3d86('0x3a')](respondWithFilteredResult(_0x1cdf6e,_0x2bb53f))['catch'](handleError(_0x1cdf6e,null));};exports[_0x3d86('0x60')]=function(_0x57c4d4,_0x3771bb){var _0x4401f5={'raw':![],'where':{'id':_0x57c4d4['params']['id']},'include':[{'model':db[_0x3d86('0x43')],'as':_0x3d86('0x44')}]},_0x416ea5={};_0x416ea5[_0x3d86('0x4c')]=_[_0x3d86('0x4a')](db['OpenchannelAccount'][_0x3d86('0x47')]);_0x416ea5['query']=_[_0x3d86('0x4a')](_0x57c4d4['query']);_0x416ea5[_0x3d86('0x4b')]=_[_0x3d86('0x4d')](_0x416ea5[_0x3d86('0x4c')],_0x416ea5['query']);_0x4401f5[_0x3d86('0x4f')]=_[_0x3d86('0x4d')](_0x416ea5[_0x3d86('0x4c')],qs[_0x3d86('0x4e')](_0x57c4d4[_0x3d86('0x49')]['fields']));_0x4401f5[_0x3d86('0x4f')]=_0x4401f5[_0x3d86('0x4f')][_0x3d86('0x50')]?_0x4401f5[_0x3d86('0x4f')]:_0x416ea5[_0x3d86('0x4c')];if(_0x57c4d4[_0x3d86('0x49')][_0x3d86('0x5c')]){_0x4401f5['include']=[{'all':!![]}];}_0x4401f5=_['merge']({},_0x4401f5,_0x57c4d4[_0x3d86('0x5b')]);return db[_0x3d86('0x46')][_0x3d86('0x61')](_0x4401f5)[_0x3d86('0x3a')](handleEntityNotFound(_0x3771bb,null))[_0x3d86('0x3a')](respondWithResult(_0x3771bb,null))['catch'](handleError(_0x3771bb,null));};exports[_0x3d86('0x62')]=function(_0x2503f9,_0xed6856){return db[_0x3d86('0x46')][_0x3d86('0x62')](_0x2503f9[_0x3d86('0x63')],{})[_0x3d86('0x3a')](function(_0x1f6750){var _0x2be8f3=_0x2503f9['user'][_0x3d86('0x3c')]({'plain':!![]});if(!_0x2be8f3)throw new Error(_0x3d86('0x64'));if(_0x2be8f3['role']===_0x3d86('0x65')){var _0x38697a=_0x1f6750[_0x3d86('0x3c')]({'plain':!![]});var _0x268f2f=_0x3d86('0x3d');return db[_0x3d86('0x66')]['find']({'where':{'name':_0x268f2f,'userProfileId':_0x2be8f3[_0x3d86('0x67')]},'raw':!![]})[_0x3d86('0x3a')](function(_0x37b087){if(_0x37b087&&_0x37b087[_0x3d86('0x68')]===0x0){return db[_0x3d86('0x3e')]['create']({'name':_0x38697a[_0x3d86('0x40')],'resourceId':_0x38697a['id'],'type':_0x37b087[_0x3d86('0x40')],'sectionId':_0x37b087['id']},{})[_0x3d86('0x3a')](function(){return _0x1f6750;});}else{return _0x1f6750;}})[_0x3d86('0x2c')](function(_0xdeddce){logger['error'](_0x3d86('0x69'),_0xdeddce);throw _0xdeddce;});}return _0x1f6750;})[_0x3d86('0x3a')](respondWithResult(_0xed6856,0xc9))[_0x3d86('0x2c')](handleError(_0xed6856,null));};exports['update']=function(_0x4cfdae,_0x4da549){if(_0x4cfdae[_0x3d86('0x63')]['id']){delete _0x4cfdae[_0x3d86('0x63')]['id'];}return db[_0x3d86('0x46')][_0x3d86('0x61')]({'where':{'id':_0x4cfdae[_0x3d86('0x6a')]['id']},'include':[{'model':db[_0x3d86('0x43')],'as':_0x3d86('0x44')}]})[_0x3d86('0x3a')](handleEntityNotFound(_0x4da549,null))[_0x3d86('0x3a')](saveUpdates(_0x4cfdae[_0x3d86('0x63')],null))[_0x3d86('0x3a')](respondWithResult(_0x4da549,null))[_0x3d86('0x2c')](handleError(_0x4da549,null));};exports['destroy']=function(_0x2a32a7,_0x227cfe){return db[_0x3d86('0x46')][_0x3d86('0x61')]({'where':{'id':_0x2a32a7[_0x3d86('0x6a')]['id']}})['then'](handleEntityNotFound(_0x227cfe,null))[_0x3d86('0x3a')](removeEntity(_0x227cfe,null))[_0x3d86('0x2c')](handleError(_0x227cfe,null));};exports[_0x3d86('0x6b')]=function(_0xf5058e,_0x2cb256){return db[_0x3d86('0x46')][_0x3d86('0x6b')]()[_0x3d86('0x3a')](respondWithResult(_0x2cb256,null))[_0x3d86('0x2c')](handleError(_0x2cb256,null));};exports['addDisposition']=function(_0x3a0536,_0x489453,_0x33cc18){if(_0x3a0536[_0x3d86('0x63')]['id']){delete _0x3a0536[_0x3d86('0x63')]['id'];}return db['OpenchannelAccount'][_0x3d86('0x61')]({'where':{'id':_0x3a0536[_0x3d86('0x6a')]['id']}})[_0x3d86('0x3a')](handleEntityNotFound(_0x489453,null))['then'](function(_0x4136de){if(_0x4136de){_0x3a0536[_0x3d86('0x63')][_0x3d86('0x6c')]=_0x4136de['id'];return db[_0x3d86('0x6d')]['create'](_0x3a0536['body']);}})[_0x3d86('0x3a')](respondWithResult(_0x489453,null))[_0x3d86('0x2c')](handleError(_0x489453,null));};exports['getDispositions']=function(_0x5310f1,_0x104fc5,_0x46be7e){var _0xd4e5ed={'raw':![],'where':{}};var _0x5e45c2={};var _0x3e485c={'count':0x0,'rows':[]};return db[_0x3d86('0x46')][_0x3d86('0x6e')]({'where':{'id':_0x5310f1[_0x3d86('0x6a')]['id']}})[_0x3d86('0x3a')](handleEntityNotFound(_0x104fc5,null))[_0x3d86('0x3a')](function(_0x2a6f3b){if(_0x2a6f3b){_0x5e45c2[_0x3d86('0x4c')]=_['keys'](db[_0x3d86('0x6d')]['rawAttributes']);_0x5e45c2['query']=_[_0x3d86('0x4a')](_0x5310f1[_0x3d86('0x49')]);_0x5e45c2[_0x3d86('0x4b')]=_[_0x3d86('0x4d')](_0x5e45c2[_0x3d86('0x4c')],_0x5e45c2[_0x3d86('0x49')]);_0xd4e5ed[_0x3d86('0x4f')]=_[_0x3d86('0x4d')](_0x5e45c2['model'],qs[_0x3d86('0x4e')](_0x5310f1[_0x3d86('0x49')][_0x3d86('0x4e')]));_0xd4e5ed['attributes']=_0xd4e5ed[_0x3d86('0x4f')][_0x3d86('0x50')]?_0xd4e5ed[_0x3d86('0x4f')]:_0x5e45c2[_0x3d86('0x4c')];if(!_0x5310f1[_0x3d86('0x49')]['hasOwnProperty'](_0x3d86('0x52'))){_0xd4e5ed['limit']=qs[_0x3d86('0x32')](_0x5310f1[_0x3d86('0x49')][_0x3d86('0x32')]);_0xd4e5ed['offset']=qs['offset'](_0x5310f1['query'][_0x3d86('0x34')]);}_0xd4e5ed[_0x3d86('0x53')]=qs[_0x3d86('0x54')](_0x5310f1[_0x3d86('0x49')][_0x3d86('0x54')]);_0xd4e5ed[_0x3d86('0x55')]=qs['filters'](_[_0x3d86('0x56')](_0x5310f1[_0x3d86('0x49')],_0x5e45c2[_0x3d86('0x4b')]));_0xd4e5ed['where'][_0x3d86('0x6c')]=_0x2a6f3b['id'];if(_0x5310f1[_0x3d86('0x49')][_0x3d86('0x57')]){_0xd4e5ed[_0x3d86('0x55')]=_['merge'](_0xd4e5ed['where'],{'$or':_['map'](_0xd4e5ed[_0x3d86('0x4f')],function(_0x5167e6){var _0x3209d3={};_0x3209d3[_0x5167e6]={'$like':'%'+_0x5310f1['query']['filter']+'%'};return _0x3209d3;})});}_0xd4e5ed=_[_0x3d86('0x58')]({},_0xd4e5ed,_0x5310f1[_0x3d86('0x5b')]);return db[_0x3d86('0x6d')][_0x3d86('0x33')]({'where':_0xd4e5ed['where']})[_0x3d86('0x3a')](function(_0x3c9c37){_0x3e485c[_0x3d86('0x33')]=_0x3c9c37;if(_0x5310f1[_0x3d86('0x49')]['includeAll']){_0xd4e5ed[_0x3d86('0x5d')]=[{'all':!![]}];}return db[_0x3d86('0x6d')]['findAll'](_0xd4e5ed);})[_0x3d86('0x3a')](function(_0x46371f){_0x3e485c[_0x3d86('0x5f')]=_0x46371f;return _0x3e485c;});}})[_0x3d86('0x3a')](respondWithFilteredResult(_0x104fc5,_0xd4e5ed))[_0x3d86('0x2c')](handleError(_0x104fc5,null));};exports[_0x3d86('0x6f')]=function(_0x2251de,_0x332c94,_0x5ec376){return db['OpenchannelAccount'][_0x3d86('0x61')]({'where':{'id':_0x2251de['params']['id']}})[_0x3d86('0x3a')](handleEntityNotFound(_0x332c94,null))[_0x3d86('0x3a')](function(_0x3c4096){if(_0x3c4096){return _0x3c4096[_0x3d86('0x6f')](_0x2251de['query'][_0x3d86('0x70')]);}})[_0x3d86('0x3a')](respondWithStatusCode(_0x332c94,null))[_0x3d86('0x2c')](handleError(_0x332c94,null));};exports[_0x3d86('0x71')]=function(_0x5ef71e,_0x5bd84c,_0x108794){if(_0x5ef71e[_0x3d86('0x63')]['id']){delete _0x5ef71e[_0x3d86('0x63')]['id'];}return db['OpenchannelAccount'][_0x3d86('0x61')]({'where':{'id':_0x5ef71e['params']['id']}})['then'](handleEntityNotFound(_0x5bd84c,null))['then'](function(_0x3ce839){if(_0x3ce839){_0x5ef71e['body']['OpenchannelAccountId']=_0x3ce839['id'];return db['CannedAnswer'][_0x3d86('0x62')](_0x5ef71e[_0x3d86('0x63')]);}})[_0x3d86('0x3a')](respondWithResult(_0x5bd84c,null))['catch'](handleError(_0x5bd84c,null));};exports[_0x3d86('0x72')]=function(_0x6f648c,_0x498971,_0x459a19){var _0x3009d2={'raw':![],'where':{}};var _0x5647da={};var _0x176f02={'count':0x0,'rows':[]};return db[_0x3d86('0x46')][_0x3d86('0x6e')]({'where':{'id':_0x6f648c['params']['id']}})[_0x3d86('0x3a')](handleEntityNotFound(_0x498971,null))[_0x3d86('0x3a')](function(_0x108792){if(_0x108792){_0x5647da[_0x3d86('0x4c')]=_[_0x3d86('0x4a')](db['CannedAnswer']['rawAttributes']);_0x5647da[_0x3d86('0x49')]=_[_0x3d86('0x4a')](_0x6f648c['query']);_0x5647da[_0x3d86('0x4b')]=_['intersection'](_0x5647da[_0x3d86('0x4c')],_0x5647da[_0x3d86('0x49')]);_0x3009d2[_0x3d86('0x4f')]=_[_0x3d86('0x4d')](_0x5647da['model'],qs[_0x3d86('0x4e')](_0x6f648c[_0x3d86('0x49')][_0x3d86('0x4e')]));_0x3009d2[_0x3d86('0x4f')]=_0x3009d2['attributes'][_0x3d86('0x50')]?_0x3009d2[_0x3d86('0x4f')]:_0x5647da[_0x3d86('0x4c')];if(!_0x6f648c[_0x3d86('0x49')]['hasOwnProperty'](_0x3d86('0x52'))){_0x3009d2[_0x3d86('0x32')]=qs['limit'](_0x6f648c[_0x3d86('0x49')]['limit']);_0x3009d2['offset']=qs[_0x3d86('0x34')](_0x6f648c[_0x3d86('0x49')][_0x3d86('0x34')]);}_0x3009d2[_0x3d86('0x53')]=qs[_0x3d86('0x54')](_0x6f648c[_0x3d86('0x49')]['sort']);_0x3009d2['where']=qs[_0x3d86('0x4b')](_[_0x3d86('0x56')](_0x6f648c[_0x3d86('0x49')],_0x5647da[_0x3d86('0x4b')]));_0x3009d2[_0x3d86('0x55')]['OpenchannelAccountId']=_0x108792['id'];if(_0x6f648c['query'][_0x3d86('0x57')]){_0x3009d2[_0x3d86('0x55')]=_[_0x3d86('0x58')](_0x3009d2['where'],{'$or':_[_0x3d86('0x45')](_0x3009d2[_0x3d86('0x4f')],function(_0x5e25bf){var _0x1cf430={};_0x1cf430[_0x5e25bf]={'$like':'%'+_0x6f648c[_0x3d86('0x49')][_0x3d86('0x57')]+'%'};return _0x1cf430;})});}_0x3009d2=_[_0x3d86('0x58')]({},_0x3009d2,_0x6f648c[_0x3d86('0x5b')]);return db[_0x3d86('0x73')][_0x3d86('0x33')]({'where':_0x3009d2[_0x3d86('0x55')]})[_0x3d86('0x3a')](function(_0x29ff5d){_0x176f02[_0x3d86('0x33')]=_0x29ff5d;if(_0x6f648c['query'][_0x3d86('0x5c')]){_0x3009d2[_0x3d86('0x5d')]=[{'all':!![]}];}return db[_0x3d86('0x73')][_0x3d86('0x5e')](_0x3009d2);})[_0x3d86('0x3a')](function(_0x431045){_0x176f02[_0x3d86('0x5f')]=_0x431045;return _0x176f02;});}})['then'](respondWithFilteredResult(_0x498971,_0x3009d2))[_0x3d86('0x2c')](handleError(_0x498971,null));};exports[_0x3d86('0x74')]=function(_0x16e2ad,_0x17c1ba,_0x330a9b){return db[_0x3d86('0x46')][_0x3d86('0x61')]({'where':{'id':_0x16e2ad['params']['id']}})[_0x3d86('0x3a')](handleEntityNotFound(_0x17c1ba,null))[_0x3d86('0x3a')](function(_0x2bed55){if(_0x2bed55){return _0x2bed55[_0x3d86('0x74')](_0x16e2ad[_0x3d86('0x49')][_0x3d86('0x70')]);}})[_0x3d86('0x3a')](respondWithStatusCode(_0x17c1ba,null))[_0x3d86('0x2c')](handleError(_0x17c1ba,null));};exports['notify']=function(_0x1a9e7f,_0x85a338,_0x3e6c5c){var _0x1a6b9d={'body':_0x1a9e7f[_0x3d86('0x63')],'channel':_0x3d86('0x75')};var _0x30961f=[];var _0x2712d8=[];var _0x18e215={};var _0x2d26a2=![];return db[_0x3d86('0x76')]['describe']()[_0x3d86('0x3a')](function(_0x3f999b){if(!_0x3f999b){throw new db[(_0x3d86('0x77'))][(_0x3d86('0x78'))](_0x3d86('0x79'));}_0x30961f=_[_0x3d86('0x7a')](_[_0x3d86('0x4a')](_0x3f999b),[_0x3d86('0x7b'),'updatedAt']);_0x2712d8=_['difference'](_['keys'](_0x3f999b),['createdAt',_0x3d86('0x7c'),_0x3d86('0x7d'),_0x3d86('0x7e')]);if(_0x1a9e7f[_0x3d86('0x63')]['id']){delete _0x1a9e7f[_0x3d86('0x63')]['id'];}if(_[_0x3d86('0x7f')](_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x80')])){throw new db[(_0x3d86('0x77'))]['ValidationError'](_0x3d86('0x81'));}if(_[_0x3d86('0x7f')](_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x63')])||_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x63')]===''){throw new db[(_0x3d86('0x77'))][(_0x3d86('0x78'))](_0x3d86('0x82'));}if(_[_0x3d86('0x7f')](_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x83')])){throw new db['Sequelize']['ValidationError'](_0x3d86('0x84')+_0x2712d8);}if(!_['includes'](_0x2712d8,_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x83')])){throw new db['Sequelize']['ValidationError'](_0x3d86('0x85')+_0x2712d8);}_0x18e215[_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x83')]]=_0x1a9e7f[_0x3d86('0x63')]['from'];})[_0x3d86('0x3a')](function(){return db[_0x3d86('0x46')][_0x3d86('0x61')]({'where':{'id':_0x1a9e7f[_0x3d86('0x6a')]['id']},'include':[{'model':db['CmList'],'as':_0x3d86('0x86'),'include':[{'model':db[_0x3d86('0x76')],'as':_0x3d86('0x87'),'where':_0x18e215,'limit':0x1,'order':[[_0x3d86('0x7c'),_0x3d86('0x88')]]}]},{'model':db[_0x3d86('0x89')],'as':_0x3d86('0x8a')}]});})[_0x3d86('0x3a')](handleEntityNotFound(_0x85a338,null))[_0x3d86('0x3a')](function(_0x5005e7){if(_0x5005e7&&_0x5005e7[_0x3d86('0x86')]){_0x1a6b9d['account']=_0x5005e7;_0x1a6b9d[_0x3d86('0x8b')]=_0x5005e7['Applications'];_0x1a6b9d[_0x3d86('0x8c')]=_0x5005e7[_0x3d86('0x86')];_0x1a6b9d[_0x3d86('0x8b')]=_['orderBy'](_0x1a6b9d['applications'],[_0x3d86('0x8d')],[_0x3d86('0x8e')]);if(_0x1a6b9d[_0x3d86('0x8f')][_0x3d86('0x8a')]){delete _0x1a6b9d[_0x3d86('0x8f')]['Applications'];}if(_0x1a6b9d['account'][_0x3d86('0x86')]&&_0x1a6b9d[_0x3d86('0x8f')][_0x3d86('0x86')][_0x3d86('0x87')][_0x3d86('0x50')]){return _0x1a6b9d[_0x3d86('0x8f')]['List']['Contacts'][0x0];}var _0xf1e841=_[_0x3d86('0x1d')](_0x1a9e7f[_0x3d86('0x63')],{'firstName':_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x80')],'ListId':_0x5005e7[_0x3d86('0x7e')]});_0xf1e841[_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x83')]]=_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x80')];return db[_0x3d86('0x76')]['create'](_0xf1e841,{'fields':_0x30961f,'raw':!![]});}})[_0x3d86('0x3a')](handleEntityNotFound(_0x85a338,null))[_0x3d86('0x3a')](function(_0x368f2e){_0x1a6b9d[_0x3d86('0x90')]=_0x368f2e;if(_0x368f2e){var _0x2f4d9a={'ContactId':_0x368f2e['id'],'OpenchannelAccountId':_0x1a9e7f[_0x3d86('0x6a')]['id'],'from':(_0x368f2e[_0x3d86('0x91')]||'')+'\x20'+(_0x368f2e[_0x3d86('0x92')]||'')};var _0x102bcc={'OpenchannelAccountId':_0x1a9e7f[_0x3d86('0x6a')]['id'],'closed':![]};if(_0x1a9e7f[_0x3d86('0x63')]['threadId']){_0x102bcc[_0x3d86('0x93')]=_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x93')];return db[_0x3d86('0x94')][_0x3d86('0x61')]({'where':_0x102bcc})[_0x3d86('0x3a')](function(_0x273b8f){if(_0x273b8f){return[_0x273b8f,![]];}_0x2f4d9a[_0x3d86('0x93')]=_0x1a9e7f[_0x3d86('0x63')]['threadId'];_0x2f4d9a[_0x3d86('0x95')]=_0x1a9e7f['body']['externalUrl'];return db[_0x3d86('0x94')][_0x3d86('0x62')](_0x2f4d9a)['then'](function(_0x356b06){return[_0x356b06,!![]];});});}else{_0x102bcc['threadId']=null;}_0x102bcc[_0x3d86('0x96')]=_0x368f2e['id'];return db[_0x3d86('0x94')][_0x3d86('0x61')]({'where':_0x102bcc})[_0x3d86('0x3a')](function(_0x5896e4){if(_0x5896e4){return[_0x5896e4,![]];}return db[_0x3d86('0x94')][_0x3d86('0x62')](_0x2f4d9a)[_0x3d86('0x3a')](function(_0x18a64c){return[_0x18a64c,!![]];});});}})[_0x3d86('0x97')](function(_0x52f309,_0x3eeb95){if(_0x52f309){_0x2d26a2=_0x3eeb95;if(!_0x3eeb95){var _0x4633a2={'from':(_0x1a6b9d[_0x3d86('0x90')]['firstName']||'')+'\x20'+(_0x1a6b9d[_0x3d86('0x90')][_0x3d86('0x92')]||'')};if(_0x1a9e7f['body'][_0x3d86('0x93')]&&_0x1a9e7f[_0x3d86('0x63')]['messageId']&&_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x93')]!=_0x1a9e7f['body'][_0x3d86('0x98')]){_0x4633a2[_0x3d86('0x93')]=_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x98')];}return _0x52f309[_0x3d86('0x99')](_0x4633a2);}else{return _0x52f309;}}})[_0x3d86('0x3a')](function(_0x4c25fa){_0x1a6b9d[_0x3d86('0x9a')]=_0x4c25fa[_0x3d86('0x3c')]({'plain':!![]});_0x1a6b9d['interaction'][_0x3d86('0x9b')]=_0x2d26a2;if(_0x1a6b9d[_0x3d86('0x9a')][_0x3d86('0x9b')]){if(_0x1a6b9d['account'][_0x3d86('0x9c')]){_0x1a6b9d['applications']['push']({'id':0x0,'priority':_0x1a6b9d[_0x3d86('0x8b')]['length']+0x1,'app':_0x3d86('0x9d'),'appdata':_0x3d86('0x9e'),'interval':_0x3d86('0x9f')});}}return db[_0x3d86('0xa0')]['create']({'body':_0x1a9e7f[_0x3d86('0x63')]['body'],'OpenchannelAccountId':_0x1a9e7f['params']['id'],'OpenchannelInteractionId':_0x4c25fa['id'],'direction':'in','ContactId':_0x1a6b9d[_0x3d86('0x90')]['id'],'AttachmentId':_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0xa1')]});})[_0x3d86('0x3a')](function(_0xcde7e8){_0x1a6b9d[_0x3d86('0x2a')]=_0xcde7e8;if(_0x1a6b9d['interaction']['UserId']){return db[_0x3d86('0xa2')][_0x3d86('0x61')]({'attributes':['id',_0x3d86('0x40')],'where':{'id':_0x1a6b9d[_0x3d86('0x9a')][_0x3d86('0xa3')]}})[_0x3d86('0x3a')](function(_0x2d746d){if(_0x2d746d){_0x1a6b9d['applications'][_0x3d86('0xa4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2d746d[_0x3d86('0x40')]+','+(_0x1a6b9d[_0x3d86('0x8f')][_0x3d86('0xa5')]||0xa),'interval':'*,*,*,*'});_0x1a6b9d[_0x3d86('0xa6')]=![];}return respondWithRpcPromise(_0x3d86('0xa7'),_0x3d86('0xa8'),_0x1a6b9d);});}return respondWithRpcPromise('Start',_0x3d86('0xa8'),_0x1a6b9d);})[_0x3d86('0x3a')](function(_0x448398){respondWithRpcPromise(_0x3d86('0xa9'),_0x3d86('0xa9'),{'event':_0x3d86('0xaa'),'message':_0x448398},client9002);return _0x448398;})[_0x3d86('0x3a')](respondWithResult(_0x85a338,null))['catch'](handleError(_0x85a338,null));};exports[_0x3d86('0xab')]=function(_0x1a10a2,_0x52cfd0){var _0x1dd729=_0x1a10a2[_0x3d86('0x6a')]['id'];var _0x27af37=_0x1a10a2[_0x3d86('0x63')];var _0x24dc15=0xc8;var _0x549e31=null;return db['sequelize'][_0x3d86('0xac')]({'isolationLevel':db[_0x3d86('0xad')][_0x3d86('0xae')]['ISOLATION_LEVELS'][_0x3d86('0xaf')]},function(_0x37f2ea){return db['OpenchannelAccount'][_0x3d86('0x6e')]({'where':{'id':_0x1dd729},'transaction':_0x37f2ea})['then'](function(_0x4cc811){if(_0x4cc811){return db[_0x3d86('0x89')][_0x3d86('0x3b')]({'where':{'OpenchannelAccountId':_0x1dd729},'transaction':_0x37f2ea})[_0x3d86('0x3a')](function(){var _0x3cf8b9=_[_0x3d86('0x45')](_0x27af37,function(_0x4c27ef){_0x4c27ef[_0x3d86('0x6c')]=_0x1dd729;return _0x4c27ef;});return db[_0x3d86('0x89')][_0x3d86('0xb0')](_0x3cf8b9,{'transaction':_0x37f2ea});});}else{_0x24dc15=0x194;_0x549e31=[];}});})[_0x3d86('0x3a')](function(){if(_0x24dc15!==0x194){return db[_0x3d86('0x89')][_0x3d86('0xb1')]({'where':{'OpenchannelAccountId':_0x1dd729},'order':_0x3d86('0x8d')})[_0x3d86('0x3a')](function(_0x68dd2e){_0x549e31=_0x68dd2e;});}})[_0x3d86('0x2c')](function(_0x30b8e7){_0x24dc15=0x1f4;logger[_0x3d86('0x28')](_0x30b8e7[_0x3d86('0x3f')]);if(_0x30b8e7[_0x3d86('0x40')]){delete _0x30b8e7['name'];}_0x549e31=_0x30b8e7;})[_0x3d86('0xb2')](function(){if(_0x549e31===null){_0x52cfd0['sendStatus'](_0x24dc15);}else{if(_0x24dc15===0x1f4){_0x52cfd0[_0x3d86('0x2e')](_0x24dc15)[_0x3d86('0x41')](_0x549e31);}else{_0x52cfd0[_0x3d86('0x2e')](_0x24dc15)[_0x3d86('0x30')](_0x549e31);}}});};exports[_0x3d86('0xb3')]=function(_0x709714,_0x1bffd6,_0x154984){var _0x5a8a41={};var _0x2636ad={};var _0x560730;var _0x59a8fe;return db[_0x3d86('0x46')][_0x3d86('0x6e')]({'where':{'id':_0x709714['params']['id']}})[_0x3d86('0x3a')](handleEntityNotFound(_0x1bffd6,null))[_0x3d86('0x3a')](function(_0xb6bc9f){if(_0xb6bc9f){_0x560730=_0xb6bc9f;_0x2636ad[_0x3d86('0x4c')]=_[_0x3d86('0x4a')](db[_0x3d86('0x89')][_0x3d86('0x47')]);_0x2636ad['query']=_['keys'](_0x709714['query']);_0x2636ad[_0x3d86('0x4b')]=_[_0x3d86('0x4d')](_0x2636ad['model'],_0x2636ad['query']);_0x5a8a41[_0x3d86('0x4f')]=_[_0x3d86('0x4d')](_0x2636ad[_0x3d86('0x4c')],qs['fields'](_0x709714[_0x3d86('0x49')]['fields']));_0x5a8a41['attributes']=_0x5a8a41[_0x3d86('0x4f')][_0x3d86('0x50')]?_0x5a8a41[_0x3d86('0x4f')]:_0x2636ad[_0x3d86('0x4c')];_0x5a8a41[_0x3d86('0x53')]=qs[_0x3d86('0x54')](_0x709714[_0x3d86('0x49')][_0x3d86('0x54')]);_0x5a8a41['where']=qs[_0x3d86('0x4b')](_[_0x3d86('0x56')](_0x709714[_0x3d86('0x49')],_0x2636ad[_0x3d86('0x4b')]));if(_0x709714[_0x3d86('0x49')]['filter']){_0x5a8a41[_0x3d86('0x55')]=_['merge'](_0x5a8a41['where'],{'$or':_[_0x3d86('0x45')](_0x5a8a41[_0x3d86('0x4f')],function(_0x49b308){var _0x1e3ff2={};_0x1e3ff2[_0x49b308]={'$like':'%'+_0x709714[_0x3d86('0x49')][_0x3d86('0x57')]+'%'};return _0x1e3ff2;})});}_0x5a8a41=_[_0x3d86('0x58')]({},_0x5a8a41,_0x709714[_0x3d86('0x5b')]);return _0x560730[_0x3d86('0xb3')](_0x5a8a41);}})[_0x3d86('0x3a')](function(_0x2fb5e8){if(_0x2fb5e8){_0x59a8fe=_0x2fb5e8[_0x3d86('0x50')];if(!_0x709714['query'][_0x3d86('0x51')]('nolimit')){_0x5a8a41[_0x3d86('0x32')]=qs[_0x3d86('0x32')](_0x709714[_0x3d86('0x49')]['limit']);_0x5a8a41['offset']=qs['offset'](_0x709714['query'][_0x3d86('0x34')]);}return _0x560730[_0x3d86('0xb3')](_0x5a8a41);}})['then'](function(_0x5040f9){if(_0x5040f9){return _0x5040f9?{'count':_0x59a8fe,'rows':_0x5040f9}:null;}})['then'](respondWithResult(_0x1bffd6,null))[_0x3d86('0x2c')](handleError(_0x1bffd6,null));};exports[_0x3d86('0xb4')]=function(_0x2b673e,_0x417420,_0x3c41bd){var _0x3fd491={'raw':![],'where':{}};var _0x5e73f8={};var _0x2f1132={'count':0x0,'rows':[]};return db[_0x3d86('0x46')][_0x3d86('0x6e')]({'where':{'id':_0x2b673e[_0x3d86('0x6a')]['id']}})['then'](handleEntityNotFound(_0x417420,null))[_0x3d86('0x3a')](function(_0x2d8001){if(_0x2d8001){_0x5e73f8['model']=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x5e73f8[_0x3d86('0x49')]=_['keys'](_0x2b673e[_0x3d86('0x49')]);_0x5e73f8[_0x3d86('0x4b')]=_['intersection'](_0x5e73f8[_0x3d86('0x4c')],_0x5e73f8[_0x3d86('0x49')]);_0x3fd491[_0x3d86('0x4f')]=_[_0x3d86('0x4d')](_0x5e73f8[_0x3d86('0x4c')],qs[_0x3d86('0x4e')](_0x2b673e[_0x3d86('0x49')][_0x3d86('0x4e')]));_0x3fd491[_0x3d86('0x4f')]=_0x3fd491['attributes']['length']?_0x3fd491[_0x3d86('0x4f')]:_0x5e73f8['model'];if(!_0x2b673e[_0x3d86('0x49')][_0x3d86('0x51')]('nolimit')){_0x3fd491['limit']=qs[_0x3d86('0x32')](_0x2b673e[_0x3d86('0x49')][_0x3d86('0x32')]);_0x3fd491[_0x3d86('0x34')]=qs['offset'](_0x2b673e[_0x3d86('0x49')][_0x3d86('0x34')]);}_0x3fd491[_0x3d86('0x53')]=qs[_0x3d86('0x54')](_0x2b673e[_0x3d86('0x49')][_0x3d86('0x54')]);_0x3fd491['where']=qs['filters'](_[_0x3d86('0x56')](_0x2b673e[_0x3d86('0x49')],_0x5e73f8[_0x3d86('0x4b')]));_0x3fd491[_0x3d86('0x55')][_0x3d86('0x6c')]=_0x2d8001['id'];if(_0x2b673e[_0x3d86('0x49')][_0x3d86('0x57')]){_0x3fd491[_0x3d86('0x55')]=_[_0x3d86('0x58')](_0x3fd491[_0x3d86('0x55')],{'$or':_[_0x3d86('0x45')](_0x3fd491['attributes'],function(_0x408713){var _0xb9c1a7={};_0xb9c1a7[_0x408713]={'$like':'%'+_0x2b673e[_0x3d86('0x49')][_0x3d86('0x57')]+'%'};return _0xb9c1a7;})});}_0x3fd491=_[_0x3d86('0x58')]({},_0x3fd491,_0x2b673e['options']);return db[_0x3d86('0x94')]['count']({'where':_0x3fd491[_0x3d86('0x55')]})['then'](function(_0x553200){_0x2f1132[_0x3d86('0x33')]=_0x553200;if(_0x2b673e[_0x3d86('0x49')][_0x3d86('0x5c')]){_0x3fd491[_0x3d86('0x5d')]=[{'model':db[_0x3d86('0x76')],'as':_0x3d86('0xb5'),'required':![]},{'model':db['User'],'as':_0x3d86('0xb6'),'attributes':[_0x3d86('0x40'),'fullname','internal'],'required':![]},{'model':db[_0x3d86('0xb7')],'as':_0x3d86('0xb8'),'attributes':['id',_0x3d86('0x40'),_0x3d86('0xb9')],'where':_0x2b673e['query']['tag']?{'id':_0x2b673e[_0x3d86('0x49')][_0x3d86('0xba')]}:undefined,'required':_0x2b673e[_0x3d86('0x49')][_0x3d86('0xba')]?!![]:![]}];}return db[_0x3d86('0x94')][_0x3d86('0x5e')](_0x3fd491);})[_0x3d86('0x3a')](function(_0x5584b9){_0x2f1132[_0x3d86('0x5f')]=_0x5584b9;return _0x2f1132;});}})[_0x3d86('0x3a')](respondWithFilteredResult(_0x417420,_0x3fd491))[_0x3d86('0x2c')](handleError(_0x417420,null));};exports['addAgents']=function(_0x24f674,_0x4c2130,_0x5d1b16){return db[_0x3d86('0x46')][_0x3d86('0x61')]({'where':{'id':_0x24f674[_0x3d86('0x6a')]['id']}})[_0x3d86('0x3a')](handleEntityNotFound(_0x4c2130,null))[_0x3d86('0x3a')](function(_0x39b71d){if(_0x39b71d){return _0x39b71d[_0x3d86('0xbb')](_0x24f674['body'][_0x3d86('0x70')],_[_0x3d86('0xbc')](_0x24f674[_0x3d86('0x63')],[_0x3d86('0x70'),'id'])||{})[_0x3d86('0x97')](function(_0x4d65aa){for(var _0x464ce6=0x0;_0x464ce6<_0x24f674[_0x3d86('0x63')]['ids'][_0x3d86('0x50')];_0x464ce6+=0x1){socket[_0x3d86('0xbd')](_0x3d86('0xbe'),{'UserId':Number(_0x24f674[_0x3d86('0x63')][_0x3d86('0x70')][_0x464ce6]),'OpenchannelAccountId':Number(_0x24f674[_0x3d86('0x6a')]['id'])});}return _0x4d65aa;});}})[_0x3d86('0x3a')](respondWithResult(_0x4c2130,null))[_0x3d86('0x2c')](handleError(_0x4c2130,null));};exports[_0x3d86('0xbf')]=function(_0x408e0b,_0x5ae975,_0x1dbe16){return db['OpenchannelAccount'][_0x3d86('0x61')]({'where':{'id':_0x408e0b[_0x3d86('0x6a')]['id']}})[_0x3d86('0x3a')](handleEntityNotFound(_0x5ae975,null))[_0x3d86('0x3a')](function(_0x48a567){if(_0x48a567){return _0x48a567['removeAgents'](_0x408e0b['query']['ids'])[_0x3d86('0x3a')](function(){if(_[_0x3d86('0xc0')](_0x408e0b[_0x3d86('0x49')][_0x3d86('0x70')])){for(var _0x449a16=0x0;_0x449a16<_0x408e0b[_0x3d86('0x49')]['ids'][_0x3d86('0x50')];_0x449a16+=0x1){socket[_0x3d86('0xbd')](_0x3d86('0xc1'),{'UserId':Number(_0x408e0b[_0x3d86('0x49')][_0x3d86('0x70')][_0x449a16]),'OpenchannelAccountId':Number(_0x408e0b[_0x3d86('0x6a')]['id'])});}}else{socket[_0x3d86('0xbd')](_0x3d86('0xc1'),{'UserId':Number(_0x408e0b[_0x3d86('0x49')][_0x3d86('0x70')]),'OpenchannelAccountId':Number(_0x408e0b['params']['id'])});}});}})[_0x3d86('0x3a')](respondWithStatusCode(_0x5ae975,null))['catch'](handleError(_0x5ae975,null));};exports[_0x3d86('0xc2')]=function(_0x19b447,_0x34a9db,_0x5c35d4){var _0x25fdcb={};var _0x288da={};var _0x12f74d;var _0x4301fb;return db[_0x3d86('0x46')][_0x3d86('0x6e')]({'where':{'id':_0x19b447['params']['id']}})[_0x3d86('0x3a')](handleEntityNotFound(_0x34a9db,null))['then'](function(_0x5346df){if(_0x5346df){_0x12f74d=_0x5346df;_0x288da[_0x3d86('0x4c')]=_[_0x3d86('0x4a')](db[_0x3d86('0xa2')][_0x3d86('0x47')]);_0x288da[_0x3d86('0x49')]=_['keys'](_0x19b447['query']);_0x288da[_0x3d86('0x4b')]=_[_0x3d86('0x4d')](_0x288da[_0x3d86('0x4c')],_0x288da[_0x3d86('0x49')]);_0x25fdcb[_0x3d86('0x4f')]=_['intersection'](_0x288da['model'],qs['fields'](_0x19b447[_0x3d86('0x49')][_0x3d86('0x4e')]));_0x25fdcb[_0x3d86('0x4f')]=_0x25fdcb[_0x3d86('0x4f')][_0x3d86('0x50')]?_0x25fdcb[_0x3d86('0x4f')]:_0x288da[_0x3d86('0x4c')];_0x25fdcb[_0x3d86('0x53')]=qs['sort'](_0x19b447[_0x3d86('0x49')][_0x3d86('0x54')]);_0x25fdcb[_0x3d86('0x55')]=qs[_0x3d86('0x4b')](_[_0x3d86('0x56')](_0x19b447[_0x3d86('0x49')],_0x288da[_0x3d86('0x4b')]));if(_0x19b447[_0x3d86('0x49')][_0x3d86('0x57')]){_0x25fdcb[_0x3d86('0x55')]=_[_0x3d86('0x58')](_0x25fdcb['where'],{'$or':_[_0x3d86('0x45')](_0x25fdcb[_0x3d86('0x4f')],function(_0x3b6980){var _0x5600fa={};_0x5600fa[_0x3b6980]={'$like':'%'+_0x19b447[_0x3d86('0x49')][_0x3d86('0x57')]+'%'};return _0x5600fa;})});}_0x25fdcb=_[_0x3d86('0x58')]({},_0x25fdcb,_0x19b447[_0x3d86('0x5b')]);return _0x12f74d['getAgents'](_0x25fdcb);}})['then'](function(_0x19cffd){if(_0x19cffd){_0x4301fb=_0x19cffd['length'];if(!_0x19b447['query'][_0x3d86('0x51')]('nolimit')){_0x25fdcb['limit']=qs[_0x3d86('0x32')](_0x19b447[_0x3d86('0x49')][_0x3d86('0x32')]);_0x25fdcb[_0x3d86('0x34')]=qs[_0x3d86('0x34')](_0x19b447[_0x3d86('0x49')]['offset']);}return _0x12f74d[_0x3d86('0xc2')](_0x25fdcb);}})['then'](function(_0x446d76){if(_0x446d76){return _0x446d76?{'count':_0x4301fb,'rows':_0x446d76}:null;}})[_0x3d86('0x3a')](respondWithResult(_0x34a9db,null))[_0x3d86('0x2c')](handleError(_0x34a9db,null));};exports['send']=function(_0x36bc0e,_0x795dde,_0x1267e0){var _0x24b8bf,_0x3f1a8c,_0x3dd450;if(_[_0x3d86('0x7f')](_0x36bc0e[_0x3d86('0x63')]['body'])||_0x36bc0e['body'][_0x3d86('0x63')]===''){throw new db['Sequelize'][(_0x3d86('0x78'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x36bc0e[_0x3d86('0x63')]['to'])){}_0x24b8bf=_0x36bc0e[_0x3d86('0x63')]['to'];return db[_0x3d86('0x46')][_0x3d86('0x6e')]({'where':{'id':_0x36bc0e[_0x3d86('0x6a')]['id']}})[_0x3d86('0x3a')](handleEntityNotFound(_0x795dde,null))[_0x3d86('0x3a')](function(_0x25ce91){if(_0x25ce91){return db[_0x3d86('0x46')][_0x3d86('0x61')]({'where':{'id':_0x25ce91['id']},'include':[{'model':db[_0x3d86('0xc3')],'as':_0x3d86('0x86'),'include':[{'model':db[_0x3d86('0x76')],'as':'Contacts','where':{[_0x25ce91['mapKey']]:_0x24b8bf},'limit':0x1,'order':[[_0x3d86('0x7c'),_0x3d86('0x88')]]}]}]})[_0x3d86('0x3a')](handleEntityNotFound(_0x795dde,null))[_0x3d86('0x3a')](function(_0x131da8){if(_0x131da8&&_0x131da8['List']){_0x3f1a8c=_0x131da8['get']({'plain':!![]});if(_0x3f1a8c[_0x3d86('0x86')]&&_0x3f1a8c[_0x3d86('0x86')][_0x3d86('0x87')][_0x3d86('0x50')]){return _0x3f1a8c[_0x3d86('0x86')][_0x3d86('0x87')][0x0];}return db[_0x3d86('0x76')]['create'](_['defaults'](_0x36bc0e[_0x3d86('0x63')],{'firstName':_0x24b8bf,[_0x131da8[_0x3d86('0x83')]]:_0x24b8bf,'phone':_0x24b8bf,'ListId':_0x3f1a8c[_0x3d86('0x7e')]}));}})[_0x3d86('0x3a')](handleEntityNotFound(_0x795dde,null))[_0x3d86('0x3a')](function(_0x1b053){if(_0x1b053){_0x3dd450=_0x1b053;return db[_0x3d86('0x94')]['find']({'where':{'ContactId':_0x3dd450['id'],'closed':![],'OpenchannelAccountId':_0x3f1a8c['id']}})[_0x3d86('0x3a')](function(_0x3809fd){if(_0x3809fd){return[_0x3809fd,![]];}return db[_0x3d86('0x94')]['create']({'UserId':_0x36bc0e['user']['id'],'ContactId':_0x3dd450['id'],'OpenchannelAccountId':_0x3f1a8c['id'],'lastMsgDirection':'out','firstMsgDirection':_0x3d86('0xc4'),'Messages':[_[_0x3d86('0x58')](_0x36bc0e[_0x3d86('0x63')],{'read':![],'body':_0x36bc0e['body'][_0x3d86('0x63')],'OpenchannelAccountId':_0x3f1a8c['id'],'UserId':_0x36bc0e[_0x3d86('0x65')]['id'],'ContactId':_0x3dd450['id']})]},{'include':[{'model':db[_0x3d86('0xa0')],'as':_0x3d86('0xc5')}]})[_0x3d86('0x3a')](function(_0x4fd560){return[_0x4fd560,!![]];});});}})['spread'](function(_0x15c05e,_0x32341c){if(_0x32341c){return _0x15c05e;}return db[_0x3d86('0xa0')][_0x3d86('0x62')](_['merge'](_0x36bc0e[_0x3d86('0x63')],{'read':![],'body':_0x36bc0e[_0x3d86('0x63')]['body'],'OpenchannelAccountId':_0x3f1a8c['id'],'OpenchannelInteractionId':_0x15c05e['id'],'UserId':_0x36bc0e[_0x3d86('0x65')]['id'],'ContactId':_0x3dd450['id']}))[_0x3d86('0x3a')](function(_0x2e3828){_0x15c05e[_0x3d86('0xc6')]['Messages']=[];_0x15c05e[_0x3d86('0xc6')][_0x3d86('0xc5')]['push'](_0x2e3828[_0x3d86('0xc6')]);return _0x15c05e;});});}})[_0x3d86('0x3a')](respondWithResult(_0x795dde,null))[_0x3d86('0x2c')](handleError(_0x795dde,null));}; \ No newline at end of file +var _0xaa7c=['includeAll','include','findAll','rows','show','params','rawAttributes','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','OpenchannelAccountId','Disposition','findOne','filter','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','orderBy','priority','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Tag','color','tag','addAgents','ids','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','http','client','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','OpenchannelAccounts','stack','name','send','Pause','mandatoryDispositionPause','OpenchannelAccount','type','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','options'];(function(_0x44ae0b,_0x3e9865){var _0x69232a=function(_0x5ae588){while(--_0x5ae588){_0x44ae0b['push'](_0x44ae0b['shift']());}};_0x69232a(++_0x3e9865);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x1c4325,_0x51d2c4){_0x1c4325=_0x1c4325-0x0;var _0x1416b8=_0xaa7c[_0x1c4325];return _0x1416b8;};'use strict';var emlformat=require(_0xcaa7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcaa7('0x1'));var BPromise=require(_0xcaa7('0x2'));var Mustache=require('mustache');var util=require(_0xcaa7('0x3'));var path=require(_0xcaa7('0x4'));var sox=require(_0xcaa7('0x5'));var csv=require(_0xcaa7('0x6'));var ejs=require(_0xcaa7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcaa7('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcaa7('0x9'));var deskjs=require(_0xcaa7('0xa'));var toCsv=require(_0xcaa7('0x6'));var querystring=require('querystring');var Papa=require(_0xcaa7('0xb'));var Redis=require(_0xcaa7('0xc'));var authService=require(_0xcaa7('0xd'));var qs=require(_0xcaa7('0xe'));var as=require(_0xcaa7('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcaa7('0x10'))(_0xcaa7('0x11'));var utils=require(_0xcaa7('0x12'));var config=require(_0xcaa7('0x13'));var licenseUtil=require(_0xcaa7('0x14'));var db=require(_0xcaa7('0x15'))['db'];config['redis']=_[_0xcaa7('0x16')](config[_0xcaa7('0x17')],{'host':_0xcaa7('0x18'),'port':0x18eb});var socket=require(_0xcaa7('0x19'))(new Redis(config[_0xcaa7('0x17')]));require(_0xcaa7('0x1a'))[_0xcaa7('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xcaa7('0x1c')]({'port':0x232c});var client9002=jayson[_0xcaa7('0x1d')][_0xcaa7('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1b2c4f,_0x49a218,_0x98c3e2,_0x13f970){return new BPromise(function(_0x23c8f3,_0x32b8af){var _0x46d9b4=_0x13f970||client;return _0x46d9b4[_0xcaa7('0x1e')](_0x1b2c4f,_0x98c3e2)[_0xcaa7('0x1f')](function(_0x5c2a74){logger['info'](_0xcaa7('0x20'),_0x49a218,_0xcaa7('0x21'));logger[_0xcaa7('0x22')](_0xcaa7('0x23'),_0x49a218,_0xcaa7('0x21'),JSON[_0xcaa7('0x24')](_0x5c2a74));if(_0x5c2a74[_0xcaa7('0x25')]){if(_0x5c2a74['error'][_0xcaa7('0x26')]===0x1f4){logger[_0xcaa7('0x25')](_0xcaa7('0x20'),_0x49a218,_0x5c2a74[_0xcaa7('0x25')][_0xcaa7('0x27')]);return _0x32b8af(_0x5c2a74[_0xcaa7('0x25')][_0xcaa7('0x27')]);}logger[_0xcaa7('0x25')](_0xcaa7('0x20'),_0x49a218,_0x5c2a74[_0xcaa7('0x25')][_0xcaa7('0x27')]);return _0x23c8f3(_0x5c2a74[_0xcaa7('0x25')][_0xcaa7('0x27')]);}else{logger['info'](_0xcaa7('0x20'),_0x49a218,_0xcaa7('0x21'));_0x23c8f3(_0x5c2a74['result'][_0xcaa7('0x27')]);}})[_0xcaa7('0x28')](function(_0x146e6f){logger[_0xcaa7('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x49a218,_0x146e6f);_0x32b8af(_0x146e6f);});});}function respondWithStatusCode(_0x5d4e7e,_0x3c0b15){_0x3c0b15=_0x3c0b15||0xcc;return function(_0x3e1f78){if(_0x3e1f78){return _0x5d4e7e[_0xcaa7('0x29')](_0x3c0b15);}return _0x5d4e7e[_0xcaa7('0x2a')](_0x3c0b15)[_0xcaa7('0x2b')]();};}function respondWithResult(_0x4ec9e9,_0x1a2577){_0x1a2577=_0x1a2577||0xc8;return function(_0x4c6e87){if(_0x4c6e87){return _0x4ec9e9['status'](_0x1a2577)[_0xcaa7('0x2c')](_0x4c6e87);}};}function respondWithFilteredResult(_0x492362,_0x34a30d){return function(_0x623f17){if(_0x623f17){var _0x748bda=typeof _0x34a30d[_0xcaa7('0x2d')]===_0xcaa7('0x2e')&&typeof _0x34a30d[_0xcaa7('0x2f')]===_0xcaa7('0x2e');var _0x3b9cea=_0x623f17['count'];var _0x19d02c=_0x748bda?0x0:_0x34a30d[_0xcaa7('0x2d')];var _0x24b192=_0x748bda?_0x623f17[_0xcaa7('0x30')]:_0x34a30d[_0xcaa7('0x2d')]+_0x34a30d['limit'];var _0x25c847;if(_0x24b192>=_0x3b9cea){_0x24b192=_0x3b9cea;_0x25c847=0xc8;}else{_0x25c847=0xce;}_0x492362[_0xcaa7('0x2a')](_0x25c847);return _0x492362[_0xcaa7('0x31')](_0xcaa7('0x32'),_0x19d02c+'-'+_0x24b192+'/'+_0x3b9cea)[_0xcaa7('0x2c')](_0x623f17);}return null;};}function patchUpdates(_0x483b44){return function(_0x149e02){try{jsonpatch['apply'](_0x149e02,_0x483b44,!![]);}catch(_0xea24c0){return BPromise[_0xcaa7('0x33')](_0xea24c0);}return _0x149e02[_0xcaa7('0x34')]();};}function saveUpdates(_0x59f2c7,_0x289e29){return function(_0xf67857){if(_0xf67857){return _0xf67857[_0xcaa7('0x35')](_0x59f2c7)[_0xcaa7('0x1f')](function(_0x473aee){return _0x473aee;});}return null;};}function removeEntity(_0x27be59,_0x49ccb8){return function(_0x24695f){if(_0x24695f){return _0x24695f[_0xcaa7('0x36')]()['then'](function(){var _0x455f6e=_0x24695f[_0xcaa7('0x37')]({'plain':!![]});var _0x444add=_0xcaa7('0x38');return db['UserProfileResource'][_0xcaa7('0x36')]({'where':{'type':_0x444add,'resourceId':_0x455f6e['id']}})[_0xcaa7('0x1f')](function(){return _0x24695f;});})[_0xcaa7('0x1f')](function(){_0x27be59[_0xcaa7('0x2a')](0xcc)[_0xcaa7('0x2b')]();});}};}function handleEntityNotFound(_0x42d5fb,_0xcb5439){return function(_0x1a5cda){if(!_0x1a5cda){_0x42d5fb[_0xcaa7('0x29')](0x194);}return _0x1a5cda;};}function handleError(_0x45c8f8,_0xf55432){_0xf55432=_0xf55432||0x1f4;return function(_0x266d5f){logger['error'](_0x266d5f[_0xcaa7('0x39')]);if(_0x266d5f[_0xcaa7('0x3a')]){delete _0x266d5f[_0xcaa7('0x3a')];}_0x45c8f8[_0xcaa7('0x2a')](_0xf55432)[_0xcaa7('0x3b')](_0x266d5f);};}exports['index']=function(_0x3d3c13,_0x32637a){var _0x387b12={'include':[{'model':db[_0xcaa7('0x3c')],'as':_0xcaa7('0x3d')}]},_0x49fa92={},_0x10f8c7={'count':0x0,'rows':[]};var _0x1138a6=_['map'](db[_0xcaa7('0x3e')]['rawAttributes'],function(_0x2f6d18){return{'name':_0x2f6d18['fieldName'],'type':_0x2f6d18[_0xcaa7('0x3f')]['key']};});_0x49fa92['model']=_[_0xcaa7('0x40')](_0x1138a6,_0xcaa7('0x3a'));_0x49fa92['query']=_[_0xcaa7('0x41')](_0x3d3c13[_0xcaa7('0x42')]);_0x49fa92[_0xcaa7('0x43')]=_[_0xcaa7('0x44')](_0x49fa92[_0xcaa7('0x45')],_0x49fa92[_0xcaa7('0x42')]);_0x387b12[_0xcaa7('0x46')]=_[_0xcaa7('0x44')](_0x49fa92['model'],qs[_0xcaa7('0x47')](_0x3d3c13[_0xcaa7('0x42')][_0xcaa7('0x47')]));_0x387b12[_0xcaa7('0x46')]=_0x387b12[_0xcaa7('0x46')][_0xcaa7('0x48')]?_0x387b12['attributes']:_0x49fa92[_0xcaa7('0x45')];if(!_0x3d3c13[_0xcaa7('0x42')][_0xcaa7('0x49')](_0xcaa7('0x4a'))){_0x387b12[_0xcaa7('0x2f')]=qs['limit'](_0x3d3c13[_0xcaa7('0x42')][_0xcaa7('0x2f')]);_0x387b12[_0xcaa7('0x2d')]=qs['offset'](_0x3d3c13[_0xcaa7('0x42')]['offset']);}_0x387b12[_0xcaa7('0x4b')]=qs[_0xcaa7('0x4c')](_0x3d3c13[_0xcaa7('0x42')][_0xcaa7('0x4c')]);_0x387b12[_0xcaa7('0x4d')]=qs[_0xcaa7('0x43')](_[_0xcaa7('0x4e')](_0x3d3c13['query'],_0x49fa92['filters']),_0x1138a6);if(_0x3d3c13[_0xcaa7('0x42')]['filter']){_0x387b12[_0xcaa7('0x4d')]=_['merge'](_0x387b12[_0xcaa7('0x4d')],{'$or':_['map'](_0x1138a6,function(_0x3ef608){if(_0x3ef608[_0xcaa7('0x3f')]!==_0xcaa7('0x4f')){var _0x32ec2d={};_0x32ec2d[_0x3ef608[_0xcaa7('0x3a')]]={'$like':'%'+_0x3d3c13[_0xcaa7('0x42')]['filter']+'%'};return _0x32ec2d;}})});}_0x387b12=_['merge']({},_0x387b12,_0x3d3c13[_0xcaa7('0x50')]);var _0x3a5f1f={'where':_0x387b12['where']};return db[_0xcaa7('0x3e')][_0xcaa7('0x30')](_0x3a5f1f)[_0xcaa7('0x1f')](function(_0x4237ee){_0x10f8c7[_0xcaa7('0x30')]=_0x4237ee;if(_0x3d3c13[_0xcaa7('0x42')][_0xcaa7('0x51')]){_0x387b12[_0xcaa7('0x52')]=[{'all':!![]}];}return db[_0xcaa7('0x3e')][_0xcaa7('0x53')](_0x387b12);})[_0xcaa7('0x1f')](function(_0x3cc7ae){_0x10f8c7[_0xcaa7('0x54')]=_0x3cc7ae;return _0x10f8c7;})[_0xcaa7('0x1f')](respondWithFilteredResult(_0x32637a,_0x387b12))[_0xcaa7('0x28')](handleError(_0x32637a,null));};exports[_0xcaa7('0x55')]=function(_0x5dcc42,_0x19e91b){var _0x47b88e={'raw':![],'where':{'id':_0x5dcc42[_0xcaa7('0x56')]['id']},'include':[{'model':db[_0xcaa7('0x3c')],'as':_0xcaa7('0x3d')}]},_0x3e1828={};_0x3e1828[_0xcaa7('0x45')]=_[_0xcaa7('0x41')](db[_0xcaa7('0x3e')][_0xcaa7('0x57')]);_0x3e1828[_0xcaa7('0x42')]=_[_0xcaa7('0x41')](_0x5dcc42[_0xcaa7('0x42')]);_0x3e1828['filters']=_[_0xcaa7('0x44')](_0x3e1828[_0xcaa7('0x45')],_0x3e1828[_0xcaa7('0x42')]);_0x47b88e['attributes']=_[_0xcaa7('0x44')](_0x3e1828['model'],qs[_0xcaa7('0x47')](_0x5dcc42[_0xcaa7('0x42')][_0xcaa7('0x47')]));_0x47b88e[_0xcaa7('0x46')]=_0x47b88e['attributes'][_0xcaa7('0x48')]?_0x47b88e[_0xcaa7('0x46')]:_0x3e1828[_0xcaa7('0x45')];if(_0x5dcc42[_0xcaa7('0x42')][_0xcaa7('0x51')]){_0x47b88e[_0xcaa7('0x52')]=[{'all':!![]}];}_0x47b88e=_[_0xcaa7('0x58')]({},_0x47b88e,_0x5dcc42[_0xcaa7('0x50')]);return db['OpenchannelAccount'][_0xcaa7('0x59')](_0x47b88e)[_0xcaa7('0x1f')](handleEntityNotFound(_0x19e91b,null))[_0xcaa7('0x1f')](respondWithResult(_0x19e91b,null))[_0xcaa7('0x28')](handleError(_0x19e91b,null));};exports[_0xcaa7('0x5a')]=function(_0xb7a21b,_0x4fde27){return db[_0xcaa7('0x3e')][_0xcaa7('0x5a')](_0xb7a21b['body'],{})[_0xcaa7('0x1f')](function(_0x1a4a4c){var _0x39558c=_0xb7a21b['user'][_0xcaa7('0x37')]({'plain':!![]});if(!_0x39558c)throw new Error(_0xcaa7('0x5b'));if(_0x39558c['role']===_0xcaa7('0x5c')){var _0x1a7959=_0x1a4a4c[_0xcaa7('0x37')]({'plain':!![]});var _0x172cd7=_0xcaa7('0x38');return db[_0xcaa7('0x5d')][_0xcaa7('0x59')]({'where':{'name':_0x172cd7,'userProfileId':_0x39558c[_0xcaa7('0x5e')]},'raw':!![]})[_0xcaa7('0x1f')](function(_0x143bcf){if(_0x143bcf&&_0x143bcf[_0xcaa7('0x5f')]===0x0){return db[_0xcaa7('0x60')][_0xcaa7('0x5a')]({'name':_0x1a7959[_0xcaa7('0x3a')],'resourceId':_0x1a7959['id'],'type':_0x143bcf[_0xcaa7('0x3a')],'sectionId':_0x143bcf['id']},{})[_0xcaa7('0x1f')](function(){return _0x1a4a4c;});}else{return _0x1a4a4c;}})[_0xcaa7('0x28')](function(_0x145444){logger['error'](_0xcaa7('0x61'),_0x145444);throw _0x145444;});}return _0x1a4a4c;})['then'](respondWithResult(_0x4fde27,0xc9))[_0xcaa7('0x28')](handleError(_0x4fde27,null));};exports[_0xcaa7('0x35')]=function(_0xae7ce3,_0x5accbd){if(_0xae7ce3[_0xcaa7('0x62')]['id']){delete _0xae7ce3[_0xcaa7('0x62')]['id'];}return db[_0xcaa7('0x3e')][_0xcaa7('0x59')]({'where':{'id':_0xae7ce3[_0xcaa7('0x56')]['id']},'include':[{'model':db[_0xcaa7('0x3c')],'as':_0xcaa7('0x3d')}]})[_0xcaa7('0x1f')](handleEntityNotFound(_0x5accbd,null))[_0xcaa7('0x1f')](saveUpdates(_0xae7ce3[_0xcaa7('0x62')],null))['then'](respondWithResult(_0x5accbd,null))[_0xcaa7('0x28')](handleError(_0x5accbd,null));};exports[_0xcaa7('0x36')]=function(_0x545708,_0x5ce1e9){return db[_0xcaa7('0x3e')]['find']({'where':{'id':_0x545708[_0xcaa7('0x56')]['id']}})['then'](handleEntityNotFound(_0x5ce1e9,null))[_0xcaa7('0x1f')](removeEntity(_0x5ce1e9,null))['catch'](handleError(_0x5ce1e9,null));};exports[_0xcaa7('0x63')]=function(_0x143d06,_0x1645f2){return db[_0xcaa7('0x3e')][_0xcaa7('0x63')]()[_0xcaa7('0x1f')](respondWithResult(_0x1645f2,null))[_0xcaa7('0x28')](handleError(_0x1645f2,null));};exports[_0xcaa7('0x64')]=function(_0x129d45,_0x34d5df,_0x54c4a4){if(_0x129d45[_0xcaa7('0x62')]['id']){delete _0x129d45[_0xcaa7('0x62')]['id'];}return db[_0xcaa7('0x3e')][_0xcaa7('0x59')]({'where':{'id':_0x129d45[_0xcaa7('0x56')]['id']}})[_0xcaa7('0x1f')](handleEntityNotFound(_0x34d5df,null))[_0xcaa7('0x1f')](function(_0x5825d9){if(_0x5825d9){_0x129d45[_0xcaa7('0x62')][_0xcaa7('0x65')]=_0x5825d9['id'];return db[_0xcaa7('0x66')][_0xcaa7('0x5a')](_0x129d45[_0xcaa7('0x62')]);}})['then'](respondWithResult(_0x34d5df,null))[_0xcaa7('0x28')](handleError(_0x34d5df,null));};exports['getDispositions']=function(_0x4df5ab,_0xd62907,_0xd7a048){var _0x2d32da={'raw':![],'where':{}};var _0x5889f7={};var _0xdc6a83={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xcaa7('0x67')]({'where':{'id':_0x4df5ab[_0xcaa7('0x56')]['id']}})['then'](handleEntityNotFound(_0xd62907,null))[_0xcaa7('0x1f')](function(_0x1a55c9){if(_0x1a55c9){_0x5889f7[_0xcaa7('0x45')]=_[_0xcaa7('0x41')](db[_0xcaa7('0x66')]['rawAttributes']);_0x5889f7['query']=_[_0xcaa7('0x41')](_0x4df5ab[_0xcaa7('0x42')]);_0x5889f7[_0xcaa7('0x43')]=_[_0xcaa7('0x44')](_0x5889f7[_0xcaa7('0x45')],_0x5889f7['query']);_0x2d32da[_0xcaa7('0x46')]=_[_0xcaa7('0x44')](_0x5889f7['model'],qs[_0xcaa7('0x47')](_0x4df5ab[_0xcaa7('0x42')][_0xcaa7('0x47')]));_0x2d32da[_0xcaa7('0x46')]=_0x2d32da[_0xcaa7('0x46')][_0xcaa7('0x48')]?_0x2d32da['attributes']:_0x5889f7[_0xcaa7('0x45')];if(!_0x4df5ab[_0xcaa7('0x42')][_0xcaa7('0x49')](_0xcaa7('0x4a'))){_0x2d32da[_0xcaa7('0x2f')]=qs['limit'](_0x4df5ab['query'][_0xcaa7('0x2f')]);_0x2d32da[_0xcaa7('0x2d')]=qs[_0xcaa7('0x2d')](_0x4df5ab[_0xcaa7('0x42')][_0xcaa7('0x2d')]);}_0x2d32da['order']=qs[_0xcaa7('0x4c')](_0x4df5ab[_0xcaa7('0x42')][_0xcaa7('0x4c')]);_0x2d32da[_0xcaa7('0x4d')]=qs['filters'](_[_0xcaa7('0x4e')](_0x4df5ab[_0xcaa7('0x42')],_0x5889f7[_0xcaa7('0x43')]));_0x2d32da['where'][_0xcaa7('0x65')]=_0x1a55c9['id'];if(_0x4df5ab['query']['filter']){_0x2d32da[_0xcaa7('0x4d')]=_[_0xcaa7('0x58')](_0x2d32da[_0xcaa7('0x4d')],{'$or':_[_0xcaa7('0x40')](_0x2d32da['attributes'],function(_0x8cff93){var _0x2de7b7={};_0x2de7b7[_0x8cff93]={'$like':'%'+_0x4df5ab['query'][_0xcaa7('0x68')]+'%'};return _0x2de7b7;})});}_0x2d32da=_[_0xcaa7('0x58')]({},_0x2d32da,_0x4df5ab[_0xcaa7('0x50')]);return db['Disposition'][_0xcaa7('0x30')]({'where':_0x2d32da[_0xcaa7('0x4d')]})['then'](function(_0x3307c5){_0xdc6a83['count']=_0x3307c5;if(_0x4df5ab[_0xcaa7('0x42')][_0xcaa7('0x51')]){_0x2d32da['include']=[{'all':!![]}];}return db[_0xcaa7('0x66')][_0xcaa7('0x53')](_0x2d32da);})[_0xcaa7('0x1f')](function(_0x5b7d87){_0xdc6a83[_0xcaa7('0x54')]=_0x5b7d87;return _0xdc6a83;});}})[_0xcaa7('0x1f')](respondWithFilteredResult(_0xd62907,_0x2d32da))[_0xcaa7('0x28')](handleError(_0xd62907,null));};exports[_0xcaa7('0x69')]=function(_0x550f28,_0x28a295,_0x209341){return db[_0xcaa7('0x3e')]['find']({'where':{'id':_0x550f28[_0xcaa7('0x56')]['id']}})[_0xcaa7('0x1f')](handleEntityNotFound(_0x28a295,null))[_0xcaa7('0x1f')](function(_0xaaf82c){if(_0xaaf82c){return _0xaaf82c[_0xcaa7('0x69')](_0x550f28[_0xcaa7('0x42')]['ids']);}})[_0xcaa7('0x1f')](respondWithStatusCode(_0x28a295,null))[_0xcaa7('0x28')](handleError(_0x28a295,null));};exports[_0xcaa7('0x6a')]=function(_0x3f65de,_0x58249a,_0x3e74be){if(_0x3f65de[_0xcaa7('0x62')]['id']){delete _0x3f65de[_0xcaa7('0x62')]['id'];}return db[_0xcaa7('0x3e')][_0xcaa7('0x59')]({'where':{'id':_0x3f65de[_0xcaa7('0x56')]['id']}})[_0xcaa7('0x1f')](handleEntityNotFound(_0x58249a,null))['then'](function(_0x212f63){if(_0x212f63){_0x3f65de[_0xcaa7('0x62')]['OpenchannelAccountId']=_0x212f63['id'];return db['CannedAnswer'][_0xcaa7('0x5a')](_0x3f65de[_0xcaa7('0x62')]);}})[_0xcaa7('0x1f')](respondWithResult(_0x58249a,null))['catch'](handleError(_0x58249a,null));};exports[_0xcaa7('0x6b')]=function(_0x2e07c1,_0x28cfa4,_0x239130){var _0x1fc298={'raw':![],'where':{}};var _0x2ff351={};var _0x1ef4f1={'count':0x0,'rows':[]};return db[_0xcaa7('0x3e')][_0xcaa7('0x67')]({'where':{'id':_0x2e07c1['params']['id']}})['then'](handleEntityNotFound(_0x28cfa4,null))[_0xcaa7('0x1f')](function(_0x48ebcb){if(_0x48ebcb){_0x2ff351[_0xcaa7('0x45')]=_[_0xcaa7('0x41')](db[_0xcaa7('0x6c')][_0xcaa7('0x57')]);_0x2ff351['query']=_[_0xcaa7('0x41')](_0x2e07c1['query']);_0x2ff351[_0xcaa7('0x43')]=_[_0xcaa7('0x44')](_0x2ff351[_0xcaa7('0x45')],_0x2ff351[_0xcaa7('0x42')]);_0x1fc298[_0xcaa7('0x46')]=_[_0xcaa7('0x44')](_0x2ff351[_0xcaa7('0x45')],qs['fields'](_0x2e07c1[_0xcaa7('0x42')][_0xcaa7('0x47')]));_0x1fc298['attributes']=_0x1fc298[_0xcaa7('0x46')][_0xcaa7('0x48')]?_0x1fc298['attributes']:_0x2ff351['model'];if(!_0x2e07c1[_0xcaa7('0x42')][_0xcaa7('0x49')](_0xcaa7('0x4a'))){_0x1fc298[_0xcaa7('0x2f')]=qs['limit'](_0x2e07c1[_0xcaa7('0x42')][_0xcaa7('0x2f')]);_0x1fc298[_0xcaa7('0x2d')]=qs[_0xcaa7('0x2d')](_0x2e07c1[_0xcaa7('0x42')]['offset']);}_0x1fc298[_0xcaa7('0x4b')]=qs[_0xcaa7('0x4c')](_0x2e07c1['query'][_0xcaa7('0x4c')]);_0x1fc298[_0xcaa7('0x4d')]=qs[_0xcaa7('0x43')](_[_0xcaa7('0x4e')](_0x2e07c1[_0xcaa7('0x42')],_0x2ff351[_0xcaa7('0x43')]));_0x1fc298[_0xcaa7('0x4d')][_0xcaa7('0x65')]=_0x48ebcb['id'];if(_0x2e07c1[_0xcaa7('0x42')][_0xcaa7('0x68')]){_0x1fc298[_0xcaa7('0x4d')]=_[_0xcaa7('0x58')](_0x1fc298[_0xcaa7('0x4d')],{'$or':_[_0xcaa7('0x40')](_0x1fc298[_0xcaa7('0x46')],function(_0x49ee2e){var _0x5bd482={};_0x5bd482[_0x49ee2e]={'$like':'%'+_0x2e07c1['query'][_0xcaa7('0x68')]+'%'};return _0x5bd482;})});}_0x1fc298=_[_0xcaa7('0x58')]({},_0x1fc298,_0x2e07c1[_0xcaa7('0x50')]);return db[_0xcaa7('0x6c')][_0xcaa7('0x30')]({'where':_0x1fc298[_0xcaa7('0x4d')]})[_0xcaa7('0x1f')](function(_0x3ae09c){_0x1ef4f1['count']=_0x3ae09c;if(_0x2e07c1[_0xcaa7('0x42')][_0xcaa7('0x51')]){_0x1fc298[_0xcaa7('0x52')]=[{'all':!![]}];}return db['CannedAnswer'][_0xcaa7('0x53')](_0x1fc298);})[_0xcaa7('0x1f')](function(_0x4031a2){_0x1ef4f1[_0xcaa7('0x54')]=_0x4031a2;return _0x1ef4f1;});}})['then'](respondWithFilteredResult(_0x28cfa4,_0x1fc298))[_0xcaa7('0x28')](handleError(_0x28cfa4,null));};exports[_0xcaa7('0x6d')]=function(_0x2e3832,_0x2a87e9,_0x32c833){return db[_0xcaa7('0x3e')][_0xcaa7('0x59')]({'where':{'id':_0x2e3832['params']['id']}})[_0xcaa7('0x1f')](handleEntityNotFound(_0x2a87e9,null))[_0xcaa7('0x1f')](function(_0x46135a){if(_0x46135a){return _0x46135a[_0xcaa7('0x6d')](_0x2e3832[_0xcaa7('0x42')]['ids']);}})[_0xcaa7('0x1f')](respondWithStatusCode(_0x2a87e9,null))['catch'](handleError(_0x2a87e9,null));};exports[_0xcaa7('0x6e')]=function(_0x1ef7d0,_0xaea727,_0x39e80e){var _0x304412={'body':_0x1ef7d0[_0xcaa7('0x62')],'channel':_0xcaa7('0x6f')};var _0x22691f=[];var _0x2a169d=[];var _0x4c91b1={};var _0xdbf722=![];return db[_0xcaa7('0x70')][_0xcaa7('0x63')]()[_0xcaa7('0x1f')](function(_0x4d24a0){if(!_0x4d24a0){throw new db[(_0xcaa7('0x71'))][(_0xcaa7('0x72'))](_0xcaa7('0x73'));}_0x22691f=_[_0xcaa7('0x74')](_['keys'](_0x4d24a0),[_0xcaa7('0x75'),_0xcaa7('0x76')]);_0x2a169d=_['difference'](_[_0xcaa7('0x41')](_0x4d24a0),[_0xcaa7('0x75'),_0xcaa7('0x76'),'CompanyId',_0xcaa7('0x77')]);if(_0x1ef7d0['body']['id']){delete _0x1ef7d0[_0xcaa7('0x62')]['id'];}if(_[_0xcaa7('0x78')](_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x79')])){throw new db[(_0xcaa7('0x71'))][(_0xcaa7('0x72'))]('from\x20is\x20mandatory');}if(_[_0xcaa7('0x78')](_0x1ef7d0['body'][_0xcaa7('0x62')])||_0x1ef7d0['body'][_0xcaa7('0x62')]===''){throw new db[(_0xcaa7('0x71'))][(_0xcaa7('0x72'))](_0xcaa7('0x7a'));}if(_[_0xcaa7('0x78')](_0x1ef7d0['body'][_0xcaa7('0x7b')])){throw new db[(_0xcaa7('0x71'))][(_0xcaa7('0x72'))](_0xcaa7('0x7c')+_0x2a169d);}if(!_[_0xcaa7('0x7d')](_0x2a169d,_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x7b')])){throw new db['Sequelize'][(_0xcaa7('0x72'))](_0xcaa7('0x7e')+_0x2a169d);}_0x4c91b1[_0x1ef7d0[_0xcaa7('0x62')]['mapKey']]=_0x1ef7d0['body'][_0xcaa7('0x79')];})[_0xcaa7('0x1f')](function(){return db['OpenchannelAccount'][_0xcaa7('0x59')]({'where':{'id':_0x1ef7d0[_0xcaa7('0x56')]['id']},'include':[{'model':db[_0xcaa7('0x7f')],'as':_0xcaa7('0x80'),'include':[{'model':db['CmContact'],'as':_0xcaa7('0x81'),'where':_0x4c91b1,'limit':0x1,'order':[[_0xcaa7('0x76'),_0xcaa7('0x82')]]}]},{'model':db[_0xcaa7('0x83')],'as':_0xcaa7('0x84')}]});})[_0xcaa7('0x1f')](handleEntityNotFound(_0xaea727,null))[_0xcaa7('0x1f')](function(_0x8a57d4){if(_0x8a57d4&&_0x8a57d4[_0xcaa7('0x80')]){_0x304412[_0xcaa7('0x85')]=_0x8a57d4;_0x304412[_0xcaa7('0x86')]=_0x8a57d4[_0xcaa7('0x84')];_0x304412['list']=_0x8a57d4['List'];_0x304412['applications']=_[_0xcaa7('0x87')](_0x304412[_0xcaa7('0x86')],[_0xcaa7('0x88')],['asc']);if(_0x304412[_0xcaa7('0x85')][_0xcaa7('0x84')]){delete _0x304412[_0xcaa7('0x85')][_0xcaa7('0x84')];}if(_0x304412['account'][_0xcaa7('0x80')]&&_0x304412[_0xcaa7('0x85')][_0xcaa7('0x80')][_0xcaa7('0x81')]['length']){return _0x304412['account'][_0xcaa7('0x80')][_0xcaa7('0x81')][0x0];}var _0x49c4b1=_['defaults'](_0x1ef7d0[_0xcaa7('0x62')],{'firstName':_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x79')],'ListId':_0x8a57d4[_0xcaa7('0x77')]});_0x49c4b1[_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x7b')]]=_0x1ef7d0[_0xcaa7('0x62')]['from'];return db[_0xcaa7('0x70')][_0xcaa7('0x5a')](_0x49c4b1,{'fields':_0x22691f,'raw':!![]});}})['then'](handleEntityNotFound(_0xaea727,null))[_0xcaa7('0x1f')](function(_0x2e96d2){_0x304412[_0xcaa7('0x89')]=_0x2e96d2;if(_0x2e96d2){var _0x36691a={'ContactId':_0x2e96d2['id'],'OpenchannelAccountId':_0x1ef7d0[_0xcaa7('0x56')]['id'],'from':(_0x2e96d2[_0xcaa7('0x8a')]||'')+'\x20'+(_0x2e96d2[_0xcaa7('0x8b')]||'')};var _0x5eb838={'OpenchannelAccountId':_0x1ef7d0[_0xcaa7('0x56')]['id'],'closed':![]};if(_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x8c')]){_0x5eb838[_0xcaa7('0x8c')]=_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x8c')];return db['OpenchannelInteraction'][_0xcaa7('0x59')]({'where':_0x5eb838})[_0xcaa7('0x1f')](function(_0x1e736b){if(_0x1e736b){return[_0x1e736b,![]];}_0x36691a['threadId']=_0x1ef7d0['body']['threadId'];_0x36691a[_0xcaa7('0x8d')]=_0x1ef7d0[_0xcaa7('0x62')]['externalUrl'];return db[_0xcaa7('0x8e')][_0xcaa7('0x5a')](_0x36691a)[_0xcaa7('0x1f')](function(_0x3ee7f2){return[_0x3ee7f2,!![]];});});}else{_0x5eb838[_0xcaa7('0x8c')]=null;}_0x5eb838[_0xcaa7('0x8f')]=_0x2e96d2['id'];return db['OpenchannelInteraction'][_0xcaa7('0x59')]({'where':_0x5eb838})['then'](function(_0x4c7e28){if(_0x4c7e28){return[_0x4c7e28,![]];}return db[_0xcaa7('0x8e')][_0xcaa7('0x5a')](_0x36691a)['then'](function(_0x18bc1a){return[_0x18bc1a,!![]];});});}})[_0xcaa7('0x90')](function(_0x14cdcc,_0x44c251){if(_0x14cdcc){_0xdbf722=_0x44c251;if(!_0x44c251){var _0x14bb56={'from':(_0x304412[_0xcaa7('0x89')][_0xcaa7('0x8a')]||'')+'\x20'+(_0x304412[_0xcaa7('0x89')][_0xcaa7('0x8b')]||'')};if(_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x8c')]&&_0x1ef7d0['body'][_0xcaa7('0x91')]&&_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x8c')]!=_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x91')]){_0x14bb56['threadId']=_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x91')];}return _0x14cdcc[_0xcaa7('0x35')](_0x14bb56);}else{return _0x14cdcc;}}})['then'](function(_0x589771){_0x304412[_0xcaa7('0x92')]=_0x589771['get']({'plain':!![]});_0x304412[_0xcaa7('0x92')][_0xcaa7('0x93')]=_0xdbf722;if(_0x304412[_0xcaa7('0x92')]['created']){if(_0x304412[_0xcaa7('0x85')][_0xcaa7('0x94')]){_0x304412[_0xcaa7('0x86')][_0xcaa7('0x95')]({'id':0x0,'priority':_0x304412[_0xcaa7('0x86')][_0xcaa7('0x48')]+0x1,'app':_0xcaa7('0x96'),'appdata':_0xcaa7('0x97'),'interval':_0xcaa7('0x98')});}}return db[_0xcaa7('0x99')][_0xcaa7('0x5a')]({'body':_0x1ef7d0['body'][_0xcaa7('0x62')],'OpenchannelAccountId':_0x1ef7d0['params']['id'],'OpenchannelInteractionId':_0x589771['id'],'direction':'in','ContactId':_0x304412['contact']['id'],'AttachmentId':_0x1ef7d0[_0xcaa7('0x62')][_0xcaa7('0x9a')]});})[_0xcaa7('0x1f')](function(_0x59fdd6){_0x304412['message']=_0x59fdd6;if(_0x304412[_0xcaa7('0x92')][_0xcaa7('0x9b')]){return db[_0xcaa7('0x9c')][_0xcaa7('0x59')]({'attributes':['id',_0xcaa7('0x3a')],'where':{'id':_0x304412[_0xcaa7('0x92')][_0xcaa7('0x9b')]}})[_0xcaa7('0x1f')](function(_0x429ffb){if(_0x429ffb){_0x304412[_0xcaa7('0x86')][_0xcaa7('0x9d')]({'id':0x0,'priority':0x0,'app':_0xcaa7('0x9e'),'appdata':_0x429ffb[_0xcaa7('0x3a')]+','+(_0x304412[_0xcaa7('0x85')][_0xcaa7('0x9f')]||0xa),'interval':_0xcaa7('0x98')});_0x304412[_0xcaa7('0xa0')]=![];}return respondWithRpcPromise(_0xcaa7('0xa1'),'startRouting',_0x304412);});}return respondWithRpcPromise(_0xcaa7('0xa1'),_0xcaa7('0xa2'),_0x304412);})[_0xcaa7('0x1f')](function(_0x294e55){respondWithRpcPromise(_0xcaa7('0xa3'),'EventManager',{'event':_0xcaa7('0x6e'),'message':_0x294e55},client9002);return _0x294e55;})[_0xcaa7('0x1f')](respondWithResult(_0xaea727,null))[_0xcaa7('0x28')](handleError(_0xaea727,null));};exports[_0xcaa7('0xa4')]=function(_0x53a51f,_0x4fae70){var _0x28c347=_0x53a51f[_0xcaa7('0x56')]['id'];var _0x3f7a3d=_0x53a51f['body'];var _0x2102bc=0xc8;var _0x1c3eda=null;return db[_0xcaa7('0xa5')][_0xcaa7('0xa6')]({'isolationLevel':db['sequelize'][_0xcaa7('0xa7')][_0xcaa7('0xa8')][_0xcaa7('0xa9')]},function(_0x2985c4){return db[_0xcaa7('0x3e')][_0xcaa7('0x67')]({'where':{'id':_0x28c347},'transaction':_0x2985c4})[_0xcaa7('0x1f')](function(_0x39d225){if(_0x39d225){return db[_0xcaa7('0x83')]['destroy']({'where':{'OpenchannelAccountId':_0x28c347},'transaction':_0x2985c4})[_0xcaa7('0x1f')](function(){var _0x1ad140=_[_0xcaa7('0x40')](_0x3f7a3d,function(_0xb400c5){_0xb400c5['OpenchannelAccountId']=_0x28c347;return _0xb400c5;});return db[_0xcaa7('0x83')][_0xcaa7('0xaa')](_0x1ad140,{'transaction':_0x2985c4});});}else{_0x2102bc=0x194;_0x1c3eda=[];}});})[_0xcaa7('0x1f')](function(){if(_0x2102bc!==0x194){return db[_0xcaa7('0x83')][_0xcaa7('0xab')]({'where':{'OpenchannelAccountId':_0x28c347},'order':_0xcaa7('0x88')})['then'](function(_0x3f428a){_0x1c3eda=_0x3f428a;});}})['catch'](function(_0x2ed2fb){_0x2102bc=0x1f4;logger[_0xcaa7('0x25')](_0x2ed2fb[_0xcaa7('0x39')]);if(_0x2ed2fb[_0xcaa7('0x3a')]){delete _0x2ed2fb['name'];}_0x1c3eda=_0x2ed2fb;})[_0xcaa7('0xac')](function(){if(_0x1c3eda===null){_0x4fae70['sendStatus'](_0x2102bc);}else{if(_0x2102bc===0x1f4){_0x4fae70[_0xcaa7('0x2a')](_0x2102bc)[_0xcaa7('0x3b')](_0x1c3eda);}else{_0x4fae70['status'](_0x2102bc)[_0xcaa7('0x2c')](_0x1c3eda);}}});};exports['getApplications']=function(_0xa5e98f,_0x19efbe,_0x413c3a){var _0xdc415a={};var _0x2a433c={};var _0x49afc5;var _0x206567;return db[_0xcaa7('0x3e')][_0xcaa7('0x67')]({'where':{'id':_0xa5e98f[_0xcaa7('0x56')]['id']}})[_0xcaa7('0x1f')](handleEntityNotFound(_0x19efbe,null))[_0xcaa7('0x1f')](function(_0x4d62e3){if(_0x4d62e3){_0x49afc5=_0x4d62e3;_0x2a433c['model']=_[_0xcaa7('0x41')](db['OpenchannelApplication'][_0xcaa7('0x57')]);_0x2a433c[_0xcaa7('0x42')]=_[_0xcaa7('0x41')](_0xa5e98f['query']);_0x2a433c[_0xcaa7('0x43')]=_[_0xcaa7('0x44')](_0x2a433c[_0xcaa7('0x45')],_0x2a433c['query']);_0xdc415a['attributes']=_[_0xcaa7('0x44')](_0x2a433c['model'],qs['fields'](_0xa5e98f[_0xcaa7('0x42')][_0xcaa7('0x47')]));_0xdc415a[_0xcaa7('0x46')]=_0xdc415a[_0xcaa7('0x46')][_0xcaa7('0x48')]?_0xdc415a['attributes']:_0x2a433c['model'];_0xdc415a[_0xcaa7('0x4b')]=qs[_0xcaa7('0x4c')](_0xa5e98f['query']['sort']);_0xdc415a[_0xcaa7('0x4d')]=qs['filters'](_[_0xcaa7('0x4e')](_0xa5e98f[_0xcaa7('0x42')],_0x2a433c[_0xcaa7('0x43')]));if(_0xa5e98f[_0xcaa7('0x42')][_0xcaa7('0x68')]){_0xdc415a[_0xcaa7('0x4d')]=_[_0xcaa7('0x58')](_0xdc415a[_0xcaa7('0x4d')],{'$or':_[_0xcaa7('0x40')](_0xdc415a[_0xcaa7('0x46')],function(_0x1855a5){var _0x2ac627={};_0x2ac627[_0x1855a5]={'$like':'%'+_0xa5e98f[_0xcaa7('0x42')][_0xcaa7('0x68')]+'%'};return _0x2ac627;})});}_0xdc415a=_[_0xcaa7('0x58')]({},_0xdc415a,_0xa5e98f[_0xcaa7('0x50')]);return _0x49afc5[_0xcaa7('0xad')](_0xdc415a);}})['then'](function(_0x3e86fd){if(_0x3e86fd){_0x206567=_0x3e86fd[_0xcaa7('0x48')];if(!_0xa5e98f[_0xcaa7('0x42')][_0xcaa7('0x49')](_0xcaa7('0x4a'))){_0xdc415a[_0xcaa7('0x2f')]=qs[_0xcaa7('0x2f')](_0xa5e98f[_0xcaa7('0x42')][_0xcaa7('0x2f')]);_0xdc415a[_0xcaa7('0x2d')]=qs[_0xcaa7('0x2d')](_0xa5e98f[_0xcaa7('0x42')]['offset']);}return _0x49afc5['getApplications'](_0xdc415a);}})[_0xcaa7('0x1f')](function(_0x323934){if(_0x323934){return _0x323934?{'count':_0x206567,'rows':_0x323934}:null;}})[_0xcaa7('0x1f')](respondWithResult(_0x19efbe,null))[_0xcaa7('0x28')](handleError(_0x19efbe,null));};exports[_0xcaa7('0xae')]=function(_0x362ecf,_0x23705d,_0x11621a){var _0x9c701f={'raw':![],'where':{}};var _0x2675b1={};var _0x297157={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x362ecf[_0xcaa7('0x56')]['id']}})[_0xcaa7('0x1f')](handleEntityNotFound(_0x23705d,null))[_0xcaa7('0x1f')](function(_0x120074){if(_0x120074){_0x2675b1[_0xcaa7('0x45')]=_[_0xcaa7('0x41')](db[_0xcaa7('0x8e')][_0xcaa7('0x57')]);_0x2675b1['query']=_['keys'](_0x362ecf[_0xcaa7('0x42')]);_0x2675b1[_0xcaa7('0x43')]=_[_0xcaa7('0x44')](_0x2675b1[_0xcaa7('0x45')],_0x2675b1[_0xcaa7('0x42')]);_0x9c701f[_0xcaa7('0x46')]=_[_0xcaa7('0x44')](_0x2675b1[_0xcaa7('0x45')],qs[_0xcaa7('0x47')](_0x362ecf['query'][_0xcaa7('0x47')]));_0x9c701f[_0xcaa7('0x46')]=_0x9c701f[_0xcaa7('0x46')][_0xcaa7('0x48')]?_0x9c701f['attributes']:_0x2675b1[_0xcaa7('0x45')];if(!_0x362ecf[_0xcaa7('0x42')][_0xcaa7('0x49')](_0xcaa7('0x4a'))){_0x9c701f['limit']=qs[_0xcaa7('0x2f')](_0x362ecf[_0xcaa7('0x42')][_0xcaa7('0x2f')]);_0x9c701f[_0xcaa7('0x2d')]=qs['offset'](_0x362ecf[_0xcaa7('0x42')][_0xcaa7('0x2d')]);}_0x9c701f[_0xcaa7('0x4b')]=qs[_0xcaa7('0x4c')](_0x362ecf['query'][_0xcaa7('0x4c')]);_0x9c701f[_0xcaa7('0x4d')]=qs['filters'](_[_0xcaa7('0x4e')](_0x362ecf[_0xcaa7('0x42')],_0x2675b1[_0xcaa7('0x43')]));_0x9c701f[_0xcaa7('0x4d')][_0xcaa7('0x65')]=_0x120074['id'];if(_0x362ecf[_0xcaa7('0x42')][_0xcaa7('0x68')]){_0x9c701f['where']=_['merge'](_0x9c701f[_0xcaa7('0x4d')],{'$or':_[_0xcaa7('0x40')](_0x9c701f[_0xcaa7('0x46')],function(_0x4405d7){var _0x2a0d6e={};_0x2a0d6e[_0x4405d7]={'$like':'%'+_0x362ecf[_0xcaa7('0x42')][_0xcaa7('0x68')]+'%'};return _0x2a0d6e;})});}_0x9c701f=_[_0xcaa7('0x58')]({},_0x9c701f,_0x362ecf['options']);return db[_0xcaa7('0x8e')][_0xcaa7('0x30')]({'where':_0x9c701f[_0xcaa7('0x4d')]})['then'](function(_0x1d4701){_0x297157[_0xcaa7('0x30')]=_0x1d4701;if(_0x362ecf[_0xcaa7('0x42')]['includeAll']){_0x9c701f['include']=[{'model':db[_0xcaa7('0x70')],'as':_0xcaa7('0xaf'),'required':![]},{'model':db[_0xcaa7('0x9c')],'as':'Owner','attributes':[_0xcaa7('0x3a'),'fullname','internal'],'required':![]},{'model':db[_0xcaa7('0xb0')],'as':'Tags','attributes':['id',_0xcaa7('0x3a'),_0xcaa7('0xb1')],'where':_0x362ecf[_0xcaa7('0x42')][_0xcaa7('0xb2')]?{'id':_0x362ecf[_0xcaa7('0x42')][_0xcaa7('0xb2')]}:undefined,'required':_0x362ecf['query'][_0xcaa7('0xb2')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xcaa7('0x53')](_0x9c701f);})[_0xcaa7('0x1f')](function(_0x464d01){_0x297157['rows']=_0x464d01;return _0x297157;});}})['then'](respondWithFilteredResult(_0x23705d,_0x9c701f))[_0xcaa7('0x28')](handleError(_0x23705d,null));};exports['addAgents']=function(_0xd98c8d,_0x3fab53,_0x4722ec){return db[_0xcaa7('0x3e')][_0xcaa7('0x59')]({'where':{'id':_0xd98c8d[_0xcaa7('0x56')]['id']}})[_0xcaa7('0x1f')](handleEntityNotFound(_0x3fab53,null))['then'](function(_0x5bd7f6){if(_0x5bd7f6){return _0x5bd7f6[_0xcaa7('0xb3')](_0xd98c8d[_0xcaa7('0x62')][_0xcaa7('0xb4')],_[_0xcaa7('0xb5')](_0xd98c8d[_0xcaa7('0x62')],[_0xcaa7('0xb4'),'id'])||{})[_0xcaa7('0x90')](function(_0x433ac7){for(var _0x58f0a7=0x0;_0x58f0a7<_0xd98c8d[_0xcaa7('0x62')]['ids'][_0xcaa7('0x48')];_0x58f0a7+=0x1){socket[_0xcaa7('0xb6')](_0xcaa7('0xb7'),{'UserId':Number(_0xd98c8d[_0xcaa7('0x62')]['ids'][_0x58f0a7]),'OpenchannelAccountId':Number(_0xd98c8d[_0xcaa7('0x56')]['id'])});}return _0x433ac7;});}})[_0xcaa7('0x1f')](respondWithResult(_0x3fab53,null))[_0xcaa7('0x28')](handleError(_0x3fab53,null));};exports[_0xcaa7('0xb8')]=function(_0x29b9f1,_0x3ac859,_0x31a57c){return db[_0xcaa7('0x3e')][_0xcaa7('0x59')]({'where':{'id':_0x29b9f1[_0xcaa7('0x56')]['id']}})['then'](handleEntityNotFound(_0x3ac859,null))['then'](function(_0x2e9cf8){if(_0x2e9cf8){return _0x2e9cf8[_0xcaa7('0xb8')](_0x29b9f1[_0xcaa7('0x42')][_0xcaa7('0xb4')])[_0xcaa7('0x1f')](function(){if(_[_0xcaa7('0xb9')](_0x29b9f1[_0xcaa7('0x42')][_0xcaa7('0xb4')])){for(var _0x9d8a8f=0x0;_0x9d8a8f<_0x29b9f1[_0xcaa7('0x42')]['ids'][_0xcaa7('0x48')];_0x9d8a8f+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x29b9f1['query'][_0xcaa7('0xb4')][_0x9d8a8f]),'OpenchannelAccountId':Number(_0x29b9f1[_0xcaa7('0x56')]['id'])});}}else{socket[_0xcaa7('0xb6')](_0xcaa7('0xba'),{'UserId':Number(_0x29b9f1['query'][_0xcaa7('0xb4')]),'OpenchannelAccountId':Number(_0x29b9f1[_0xcaa7('0x56')]['id'])});}});}})[_0xcaa7('0x1f')](respondWithStatusCode(_0x3ac859,null))[_0xcaa7('0x28')](handleError(_0x3ac859,null));};exports['getAgents']=function(_0x456fb5,_0x2add4b,_0x440638){var _0x2d0fab={};var _0x2c82b5={};var _0x40664f;var _0x318c5b;return db[_0xcaa7('0x3e')]['findOne']({'where':{'id':_0x456fb5['params']['id']}})['then'](handleEntityNotFound(_0x2add4b,null))[_0xcaa7('0x1f')](function(_0x3f11de){if(_0x3f11de){_0x40664f=_0x3f11de;_0x2c82b5[_0xcaa7('0x45')]=_[_0xcaa7('0x41')](db[_0xcaa7('0x9c')][_0xcaa7('0x57')]);_0x2c82b5[_0xcaa7('0x42')]=_['keys'](_0x456fb5[_0xcaa7('0x42')]);_0x2c82b5[_0xcaa7('0x43')]=_[_0xcaa7('0x44')](_0x2c82b5['model'],_0x2c82b5[_0xcaa7('0x42')]);_0x2d0fab[_0xcaa7('0x46')]=_[_0xcaa7('0x44')](_0x2c82b5[_0xcaa7('0x45')],qs['fields'](_0x456fb5[_0xcaa7('0x42')][_0xcaa7('0x47')]));_0x2d0fab[_0xcaa7('0x46')]=_0x2d0fab[_0xcaa7('0x46')][_0xcaa7('0x48')]?_0x2d0fab[_0xcaa7('0x46')]:_0x2c82b5[_0xcaa7('0x45')];_0x2d0fab[_0xcaa7('0x4b')]=qs[_0xcaa7('0x4c')](_0x456fb5[_0xcaa7('0x42')][_0xcaa7('0x4c')]);_0x2d0fab[_0xcaa7('0x4d')]=qs[_0xcaa7('0x43')](_[_0xcaa7('0x4e')](_0x456fb5['query'],_0x2c82b5[_0xcaa7('0x43')]));if(_0x456fb5[_0xcaa7('0x42')][_0xcaa7('0x68')]){_0x2d0fab[_0xcaa7('0x4d')]=_['merge'](_0x2d0fab[_0xcaa7('0x4d')],{'$or':_[_0xcaa7('0x40')](_0x2d0fab[_0xcaa7('0x46')],function(_0x2bb8b7){var _0x5601bc={};_0x5601bc[_0x2bb8b7]={'$like':'%'+_0x456fb5[_0xcaa7('0x42')][_0xcaa7('0x68')]+'%'};return _0x5601bc;})});}_0x2d0fab=_['merge']({},_0x2d0fab,_0x456fb5[_0xcaa7('0x50')]);return _0x40664f[_0xcaa7('0xbb')](_0x2d0fab);}})[_0xcaa7('0x1f')](function(_0x25737b){if(_0x25737b){_0x318c5b=_0x25737b[_0xcaa7('0x48')];if(!_0x456fb5[_0xcaa7('0x42')][_0xcaa7('0x49')](_0xcaa7('0x4a'))){_0x2d0fab[_0xcaa7('0x2f')]=qs[_0xcaa7('0x2f')](_0x456fb5[_0xcaa7('0x42')]['limit']);_0x2d0fab['offset']=qs[_0xcaa7('0x2d')](_0x456fb5[_0xcaa7('0x42')][_0xcaa7('0x2d')]);}return _0x40664f['getAgents'](_0x2d0fab);}})[_0xcaa7('0x1f')](function(_0x1bbc97){if(_0x1bbc97){return _0x1bbc97?{'count':_0x318c5b,'rows':_0x1bbc97}:null;}})[_0xcaa7('0x1f')](respondWithResult(_0x2add4b,null))[_0xcaa7('0x28')](handleError(_0x2add4b,null));};exports[_0xcaa7('0x3b')]=function(_0x3e5ad3,_0x5a5da9,_0x5ca1a7){var _0x33dcd9,_0x8c4e20,_0x3d70c3;if(_[_0xcaa7('0x78')](_0x3e5ad3[_0xcaa7('0x62')][_0xcaa7('0x62')])||_0x3e5ad3['body'][_0xcaa7('0x62')]===''){throw new db[(_0xcaa7('0x71'))][(_0xcaa7('0x72'))](_0xcaa7('0x7a'));}if(_[_0xcaa7('0x78')](_0x3e5ad3[_0xcaa7('0x62')]['to'])){}_0x33dcd9=_0x3e5ad3[_0xcaa7('0x62')]['to'];return db[_0xcaa7('0x3e')][_0xcaa7('0x67')]({'where':{'id':_0x3e5ad3[_0xcaa7('0x56')]['id']}})['then'](handleEntityNotFound(_0x5a5da9,null))[_0xcaa7('0x1f')](function(_0x5d4d29){if(_0x5d4d29){return db[_0xcaa7('0x3e')][_0xcaa7('0x59')]({'where':{'id':_0x5d4d29['id']},'include':[{'model':db[_0xcaa7('0x7f')],'as':_0xcaa7('0x80'),'include':[{'model':db[_0xcaa7('0x70')],'as':_0xcaa7('0x81'),'where':{[_0x5d4d29[_0xcaa7('0x7b')]]:_0x33dcd9},'limit':0x1,'order':[[_0xcaa7('0x76'),_0xcaa7('0x82')]]}]}]})['then'](handleEntityNotFound(_0x5a5da9,null))['then'](function(_0x51607b){if(_0x51607b&&_0x51607b[_0xcaa7('0x80')]){_0x8c4e20=_0x51607b[_0xcaa7('0x37')]({'plain':!![]});if(_0x8c4e20['List']&&_0x8c4e20[_0xcaa7('0x80')]['Contacts']['length']){return _0x8c4e20[_0xcaa7('0x80')]['Contacts'][0x0];}return db[_0xcaa7('0x70')][_0xcaa7('0x5a')](_[_0xcaa7('0x16')](_0x3e5ad3[_0xcaa7('0x62')],{'firstName':_0x33dcd9,[_0x51607b[_0xcaa7('0x7b')]]:_0x33dcd9,'phone':_0x33dcd9,'ListId':_0x8c4e20[_0xcaa7('0x77')]}));}})[_0xcaa7('0x1f')](handleEntityNotFound(_0x5a5da9,null))[_0xcaa7('0x1f')](function(_0x58c58e){if(_0x58c58e){_0x3d70c3=_0x58c58e;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x3d70c3['id'],'closed':![],'OpenchannelAccountId':_0x8c4e20['id']}})[_0xcaa7('0x1f')](function(_0x39715c){if(_0x39715c){return[_0x39715c,![]];}return db[_0xcaa7('0x8e')][_0xcaa7('0x5a')]({'UserId':_0x3e5ad3[_0xcaa7('0x5c')]['id'],'ContactId':_0x3d70c3['id'],'OpenchannelAccountId':_0x8c4e20['id'],'lastMsgDirection':_0xcaa7('0xbc'),'firstMsgDirection':'out','Messages':[_[_0xcaa7('0x58')](_0x3e5ad3[_0xcaa7('0x62')],{'read':![],'body':_0x3e5ad3[_0xcaa7('0x62')][_0xcaa7('0x62')],'OpenchannelAccountId':_0x8c4e20['id'],'UserId':_0x3e5ad3['user']['id'],'ContactId':_0x3d70c3['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xcaa7('0xbd')}]})[_0xcaa7('0x1f')](function(_0x5d6cc1){return[_0x5d6cc1,!![]];});});}})[_0xcaa7('0x90')](function(_0x4e7c4b,_0x1e33b2){if(_0x1e33b2){return _0x4e7c4b;}return db[_0xcaa7('0x99')][_0xcaa7('0x5a')](_[_0xcaa7('0x58')](_0x3e5ad3[_0xcaa7('0x62')],{'read':![],'body':_0x3e5ad3['body'][_0xcaa7('0x62')],'OpenchannelAccountId':_0x8c4e20['id'],'OpenchannelInteractionId':_0x4e7c4b['id'],'UserId':_0x3e5ad3[_0xcaa7('0x5c')]['id'],'ContactId':_0x3d70c3['id']}))[_0xcaa7('0x1f')](function(_0x2bb239){_0x4e7c4b[_0xcaa7('0xbe')][_0xcaa7('0xbd')]=[];_0x4e7c4b[_0xcaa7('0xbe')]['Messages'][_0xcaa7('0x95')](_0x2bb239[_0xcaa7('0xbe')]);return _0x4e7c4b;});});}})['then'](respondWithResult(_0x5a5da9,null))[_0xcaa7('0x28')](handleError(_0x5a5da9,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index a7756b7..1a6f7d0 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 _0x2dae=['remove','emit','hasOwnProperty','hook','exports','events','OpenchannelAccount','setMaxListeners','save','update'];(function(_0x4143f6,_0x53bb83){var _0x5a7f19=function(_0x57fe20){while(--_0x57fe20){_0x4143f6['push'](_0x4143f6['shift']());}};_0x5a7f19(++_0x53bb83);}(_0x2dae,0xc3));var _0xe2da=function(_0x5d3903,_0x3d6c3e){_0x5d3903=_0x5d3903-0x0;var _0x4b8bc9=_0x2dae[_0x5d3903];return _0x4b8bc9;};'use strict';var EventEmitter=require(_0xe2da('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xe2da('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xe2da('0x2')](0x0);var events={'afterCreate':_0xe2da('0x3'),'afterUpdate':_0xe2da('0x4'),'afterDestroy':_0xe2da('0x5')};function emitEvent(_0x481d97){return function(_0x25b9f2,_0x439b5d,_0x77e45e){OpenchannelAccountEvents[_0xe2da('0x6')](_0x481d97+':'+_0x25b9f2['id'],_0x25b9f2);OpenchannelAccountEvents['emit'](_0x481d97,_0x25b9f2);_0x77e45e(null);};}for(var e in events){if(events[_0xe2da('0x7')](e)){var event=events[e];OpenchannelAccount[_0xe2da('0x8')](e,emitEvent(event));}}module[_0xe2da('0x9')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xb43b=['events','../../mysqldb','setMaxListeners','save','update','hasOwnProperty','exports'];(function(_0xeb9468,_0xf86ef1){var _0x4cfb58=function(_0xf2a286){while(--_0xf2a286){_0xeb9468['push'](_0xeb9468['shift']());}};_0x4cfb58(++_0xf86ef1);}(_0xb43b,0x1b2));var _0xbb43=function(_0x7a51b6,_0x242ade){_0x7a51b6=_0x7a51b6-0x0;var _0x592b39=_0xb43b[_0x7a51b6];return _0x592b39;};'use strict';var EventEmitter=require(_0xbb43('0x0'));var OpenchannelAccount=require(_0xbb43('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbb43('0x2')](0x0);var events={'afterCreate':_0xbb43('0x3'),'afterUpdate':_0xbb43('0x4'),'afterDestroy':'remove'};function emitEvent(_0x131e9e){return function(_0x41aff6,_0x351254,_0x16432a){OpenchannelAccountEvents['emit'](_0x131e9e+':'+_0x41aff6['id'],_0x41aff6);OpenchannelAccountEvents['emit'](_0x131e9e,_0x41aff6);_0x16432a(null);};}for(var e in events){if(events[_0xbb43('0x5')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0xbb43('0x6')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index a7a00e6..917c2c5 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(_0x15f411,_0x36d2c2){var _0x507874=function(_0x3a40c7){while(--_0x3a40c7){_0x15f411['push'](_0x15f411['shift']());}};_0x507874(++_0x36d2c2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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(_0x4a5c2a,_0x80a9b6){var _0x58bd9e=function(_0xd3dda5){while(--_0xd3dda5){_0x4a5c2a['push'](_0x4a5c2a['shift']());}};_0x58bd9e(++_0x80a9b6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 91630e9..3c7cfa6 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 _0xe605=['jayson/promise','client','http','redis','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4a51f2,_0x578f65){var _0x574a7e=function(_0x45ed43){while(--_0x45ed43){_0x4a51f2['push'](_0x4a51f2['shift']());}};_0x574a7e(++_0x578f65);}(_0xe605,0x92));var _0x5e60=function(_0x468d0,_0x49f7cf){_0x468d0=_0x468d0-0x0;var _0x31a0f2=_0xe605[_0x468d0];return _0x31a0f2;};'use strict';var _=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var moment=require('moment');var BPromise=require(_0x5e60('0x2'));var rs=require(_0x5e60('0x3'));var fs=require('fs');var Redis=require(_0x5e60('0x4'));var db=require(_0x5e60('0x5'))['db'];var utils=require(_0x5e60('0x6'));var logger=require(_0x5e60('0x7'))(_0x5e60('0x8'));var config=require(_0x5e60('0x9'));var jayson=require(_0x5e60('0xa'));var client=jayson[_0x5e60('0xb')][_0x5e60('0xc')]({'port':0x232a});config[_0x5e60('0xd')]=_['defaults'](config[_0x5e60('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5e60('0xe'))[_0x5e60('0xf')](socket);function respondWithRpcPromise(_0x150a51,_0x2c5425,_0x331b3e){return new BPromise(function(_0x2cbe4e,_0x56f05a){return client[_0x5e60('0x10')](_0x150a51,_0x331b3e)['then'](function(_0x1d2558){logger[_0x5e60('0x11')](_0x5e60('0x12'),_0x2c5425,'request\x20sent');logger[_0x5e60('0x13')](_0x5e60('0x14'),_0x2c5425,_0x5e60('0x15'),JSON[_0x5e60('0x16')](_0x1d2558));if(_0x1d2558[_0x5e60('0x17')]){if(_0x1d2558[_0x5e60('0x17')]['code']===0x1f4){logger[_0x5e60('0x17')](_0x5e60('0x12'),_0x2c5425,_0x1d2558[_0x5e60('0x17')][_0x5e60('0x18')]);return _0x56f05a(_0x1d2558['error'][_0x5e60('0x18')]);}logger['error'](_0x5e60('0x12'),_0x2c5425,_0x1d2558[_0x5e60('0x17')]['message']);return _0x2cbe4e(_0x1d2558[_0x5e60('0x17')][_0x5e60('0x18')]);}else{logger[_0x5e60('0x11')](_0x5e60('0x12'),_0x2c5425,'request\x20sent');_0x2cbe4e(_0x1d2558[_0x5e60('0x19')][_0x5e60('0x18')]);}})['catch'](function(_0x1fa0f8){logger[_0x5e60('0x17')](_0x5e60('0x12'),_0x2c5425,_0x1fa0f8);_0x56f05a(_0x1fa0f8);});});} \ No newline at end of file +var _0x57f8=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./openchannelAccount.socket','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x23704d,_0x255322){var _0x85c06e=function(_0x308723){while(--_0x308723){_0x23704d['push'](_0x23704d['shift']());}};_0x85c06e(++_0x255322);}(_0x57f8,0x198));var _0x857f=function(_0x5c0232,_0x1c449f){_0x5c0232=_0x5c0232-0x0;var _0x589366=_0x57f8[_0x5c0232];return _0x589366;};'use strict';var _=require('lodash');var util=require(_0x857f('0x0'));var moment=require(_0x857f('0x1'));var BPromise=require(_0x857f('0x2'));var rs=require(_0x857f('0x3'));var fs=require('fs');var Redis=require(_0x857f('0x4'));var db=require(_0x857f('0x5'))['db'];var utils=require(_0x857f('0x6'));var logger=require(_0x857f('0x7'))(_0x857f('0x8'));var config=require(_0x857f('0x9'));var jayson=require(_0x857f('0xa'));var client=jayson[_0x857f('0xb')]['http']({'port':0x232a});config[_0x857f('0xc')]=_[_0x857f('0xd')](config[_0x857f('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x857f('0xe'))(new Redis(config[_0x857f('0xc')]));require(_0x857f('0xf'))['register'](socket);function respondWithRpcPromise(_0x1e306e,_0x2ef315,_0x370126){return new BPromise(function(_0x5cc993,_0xefee53){return client[_0x857f('0x10')](_0x1e306e,_0x370126)[_0x857f('0x11')](function(_0x11adfd){logger[_0x857f('0x12')](_0x857f('0x13'),_0x2ef315,_0x857f('0x14'));logger['debug'](_0x857f('0x15'),_0x2ef315,_0x857f('0x14'),JSON[_0x857f('0x16')](_0x11adfd));if(_0x11adfd[_0x857f('0x17')]){if(_0x11adfd[_0x857f('0x17')]['code']===0x1f4){logger['error'](_0x857f('0x13'),_0x2ef315,_0x11adfd['error'][_0x857f('0x18')]);return _0xefee53(_0x11adfd['error'][_0x857f('0x18')]);}logger[_0x857f('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x2ef315,_0x11adfd[_0x857f('0x17')][_0x857f('0x18')]);return _0x5cc993(_0x11adfd[_0x857f('0x17')][_0x857f('0x18')]);}else{logger[_0x857f('0x12')](_0x857f('0x13'),_0x2ef315,_0x857f('0x14'));_0x5cc993(_0x11adfd[_0x857f('0x19')][_0x857f('0x18')]);}})[_0x857f('0x1a')](function(_0x8e11f1){logger['error'](_0x857f('0x13'),_0x2ef315,_0x8e11f1);_0xefee53(_0x8e11f1);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 6215c25..21568b2 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 _0xf6e8=['removeListener','register','length','openchannelAccount:','save','remove','update'];(function(_0x4ebb6b,_0x5ed2f9){var _0x56de95=function(_0x23d73f){while(--_0x23d73f){_0x4ebb6b['push'](_0x4ebb6b['shift']());}};_0x56de95(++_0x5ed2f9);}(_0xf6e8,0xc1));var _0x8f6e=function(_0x121b8b,_0x3b5324){_0x121b8b=_0x121b8b-0x0;var _0x2c0e41=_0xf6e8[_0x121b8b];return _0x2c0e41;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x8f6e('0x0'),_0x8f6e('0x1'),_0x8f6e('0x2')];function createListener(_0x1a5d5b,_0x3c2632){return function(_0x24d74f){_0x3c2632['emit'](_0x1a5d5b,_0x24d74f);};}function removeListener(_0xac263e,_0x55673a){return function(){OpenchannelAccountEvents[_0x8f6e('0x3')](_0xac263e,_0x55673a);};}exports[_0x8f6e('0x4')]=function(_0x5a5609){for(var _0x7b6df3=0x0,_0x233158=events[_0x8f6e('0x5')];_0x7b6df3<_0x233158;_0x7b6df3++){var _0x71b52c=events[_0x7b6df3];var _0x423ed4=createListener(_0x8f6e('0x6')+_0x71b52c,_0x5a5609);OpenchannelAccountEvents['on'](_0x71b52c,_0x423ed4);}}; \ No newline at end of file +var _0xc831=['save','remove','update','emit','removeListener','length','openchannelAccount:'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc831,0x103));var _0x1c83=function(_0x2fcfff,_0x268477){_0x2fcfff=_0x2fcfff-0x0;var _0x278ad1=_0xc831[_0x2fcfff];return _0x278ad1;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x1c83('0x0'),_0x1c83('0x1'),_0x1c83('0x2')];function createListener(_0x3049be,_0x444adc){return function(_0x4204fe){_0x444adc[_0x1c83('0x3')](_0x3049be,_0x4204fe);};}function removeListener(_0x28441e,_0x1a2a48){return function(){OpenchannelAccountEvents[_0x1c83('0x4')](_0x28441e,_0x1a2a48);};}exports['register']=function(_0x5682fb){for(var _0x2f52ea=0x0,_0x52ec70=events[_0x1c83('0x5')];_0x2f52ea<_0x52ec70;_0x2f52ea++){var _0x1953e5=events[_0x2f52ea];var _0x29ceee=createListener(_0x1c83('0x6')+_0x1953e5,_0x5682fb);OpenchannelAccountEvents['on'](_0x1953e5,_0x29ceee);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 952f98a..167c60c 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 _0x1f8d=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x53ad78,_0x48bdd7){var _0x2d4161=function(_0x17b58c){while(--_0x17b58c){_0x53ad78['push'](_0x53ad78['shift']());}};_0x2d4161(++_0x48bdd7);}(_0x1f8d,0x150));var _0xd1f8=function(_0xe09aaa,_0x410ee9){_0xe09aaa=_0xe09aaa-0x0;var _0x38f145=_0x1f8d[_0xe09aaa];return _0x38f145;};'use strict';var multer=require(_0xd1f8('0x0'));var util=require('util');var path=require(_0xd1f8('0x1'));var timeout=require(_0xd1f8('0x2'));var express=require(_0xd1f8('0x3'));var router=express[_0xd1f8('0x4')]();var fs_extra=require(_0xd1f8('0x5'));var auth=require(_0xd1f8('0x6'));var interaction=require(_0xd1f8('0x7'));var config=require(_0xd1f8('0x8'));var controller=require('./openchannelApplication.controller');router[_0xd1f8('0x9')]('/',auth[_0xd1f8('0xa')](),controller[_0xd1f8('0xb')]);router[_0xd1f8('0x9')](_0xd1f8('0xc'),auth[_0xd1f8('0xa')](),controller[_0xd1f8('0xd')]);router['post']('/',auth[_0xd1f8('0xa')](),controller[_0xd1f8('0xe')]);router['put'](_0xd1f8('0xc'),auth[_0xd1f8('0xa')](),controller[_0xd1f8('0xf')]);router['delete'](_0xd1f8('0xc'),auth['isAuthenticated'](),controller[_0xd1f8('0x10')]);module[_0xd1f8('0x11')]=router; \ No newline at end of file +var _0xe325=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','isAuthenticated','index','get','show','post','create','update','/:id','exports','multer'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xe325,0xcb));var _0x5e32=function(_0x151553,_0x295f9c){_0x151553=_0x151553-0x0;var _0x1a0ad6=_0xe325[_0x151553];return _0x1a0ad6;};'use strict';var multer=require(_0x5e32('0x0'));var util=require(_0x5e32('0x1'));var path=require(_0x5e32('0x2'));var timeout=require(_0x5e32('0x3'));var express=require('express');var router=express[_0x5e32('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5e32('0x5'));var interaction=require(_0x5e32('0x6'));var config=require('../../config/environment');var controller=require(_0x5e32('0x7'));router['get']('/',auth[_0x5e32('0x8')](),controller[_0x5e32('0x9')]);router[_0x5e32('0xa')]('/:id',auth[_0x5e32('0x8')](),controller[_0x5e32('0xb')]);router[_0x5e32('0xc')]('/',auth[_0x5e32('0x8')](),controller[_0x5e32('0xd')]);router['put']('/:id',auth[_0x5e32('0x8')](),controller[_0x5e32('0xe')]);router['delete'](_0x5e32('0xf'),auth[_0x5e32('0x8')](),controller['destroy']);module[_0x5e32('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 6a689e5..a5b1c8a 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 _0xc698=['INTEGER','STRING','noop','sequelize','exports'];(function(_0x50de95,_0x4ba9bc){var _0x248ce1=function(_0x224fde){while(--_0x224fde){_0x50de95['push'](_0x50de95['shift']());}};_0x248ce1(++_0x4ba9bc);}(_0xc698,0x85));var _0x8c69=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xc698[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require(_0x8c69('0x0'));module[_0x8c69('0x1')]={'priority':{'type':Sequelize[_0x8c69('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8c69('0x3')],'allowNull':![],'defaultValue':_0x8c69('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8c69('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x174d=['TEXT','STRING','sequelize','exports'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x174d,0x14a));var _0xd174=function(_0x5b37c7,_0x5cf44f){_0x5b37c7=_0x5b37c7-0x0;var _0x489c08=_0x174d[_0x5b37c7];return _0x489c08;};'use strict';var Sequelize=require(_0xd174('0x0'));module[_0xd174('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xd174('0x2')]()},'description':{'type':Sequelize[_0xd174('0x3')]},'interval':{'type':Sequelize[_0xd174('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index be87892..cd9a8fb 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 _0x7fab=['destroy','error','stack','name','send','index','rawAttributes','type','key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','VIRTUAL','options','OpenchannelApplication','count','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','Content-Range','apply','reject','save','update','then'];(function(_0x13e2fe,_0x155d6e){var _0xf11902=function(_0x22e7ad){while(--_0x22e7ad){_0x13e2fe['push'](_0x13e2fe['shift']());}};_0xf11902(++_0x155d6e);}(_0x7fab,0x19d));var _0xb7fa=function(_0x3167a8,_0x4d5006){_0x3167a8=_0x3167a8-0x0;var _0x20073f=_0x7fab[_0x3167a8];return _0x20073f;};'use strict';var emlformat=require(_0xb7fa('0x0'));var rimraf=require(_0xb7fa('0x1'));var zipdir=require(_0xb7fa('0x2'));var jsonpatch=require(_0xb7fa('0x3'));var rp=require(_0xb7fa('0x4'));var moment=require(_0xb7fa('0x5'));var BPromise=require(_0xb7fa('0x6'));var Mustache=require(_0xb7fa('0x7'));var util=require(_0xb7fa('0x8'));var path=require(_0xb7fa('0x9'));var sox=require(_0xb7fa('0xa'));var csv=require(_0xb7fa('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb7fa('0xc'));var _=require(_0xb7fa('0xd'));var squel=require(_0xb7fa('0xe'));var crypto=require('crypto');var jsforce=require(_0xb7fa('0xf'));var deskjs=require(_0xb7fa('0x10'));var toCsv=require(_0xb7fa('0xb'));var querystring=require(_0xb7fa('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb7fa('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb7fa('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb7fa('0x14'))(_0xb7fa('0x15'));var utils=require(_0xb7fa('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb7fa('0x17'))['db'];function respondWithStatusCode(_0x4ed4c8,_0x4542cc){_0x4542cc=_0x4542cc||0xcc;return function(_0x5a522d){if(_0x5a522d){return _0x4ed4c8[_0xb7fa('0x18')](_0x4542cc);}return _0x4ed4c8[_0xb7fa('0x19')](_0x4542cc)[_0xb7fa('0x1a')]();};}function respondWithResult(_0x174e59,_0x549972){_0x549972=_0x549972||0xc8;return function(_0x4556cc){if(_0x4556cc){return _0x174e59[_0xb7fa('0x19')](_0x549972)[_0xb7fa('0x1b')](_0x4556cc);}};}function respondWithFilteredResult(_0x145021,_0x20c86f){return function(_0x521c68){if(_0x521c68){var _0x33f2ab=typeof _0x20c86f['offset']===_0xb7fa('0x1c')&&typeof _0x20c86f[_0xb7fa('0x1d')]==='undefined';var _0x475022=_0x521c68['count'];var _0xf421e1=_0x33f2ab?0x0:_0x20c86f[_0xb7fa('0x1e')];var _0x4e0e91=_0x33f2ab?_0x521c68['count']:_0x20c86f['offset']+_0x20c86f[_0xb7fa('0x1d')];var _0xe6b0f1;if(_0x4e0e91>=_0x475022){_0x4e0e91=_0x475022;_0xe6b0f1=0xc8;}else{_0xe6b0f1=0xce;}_0x145021[_0xb7fa('0x19')](_0xe6b0f1);return _0x145021['set'](_0xb7fa('0x1f'),_0xf421e1+'-'+_0x4e0e91+'/'+_0x475022)[_0xb7fa('0x1b')](_0x521c68);}return null;};}function patchUpdates(_0x21e9c9){return function(_0x280b7c){try{jsonpatch[_0xb7fa('0x20')](_0x280b7c,_0x21e9c9,!![]);}catch(_0x21df1a){return BPromise[_0xb7fa('0x21')](_0x21df1a);}return _0x280b7c[_0xb7fa('0x22')]();};}function saveUpdates(_0x374f5e,_0x1592ed){return function(_0x28c1c8){if(_0x28c1c8){return _0x28c1c8[_0xb7fa('0x23')](_0x374f5e)[_0xb7fa('0x24')](function(_0x32a991){return _0x32a991;});}return null;};}function removeEntity(_0x202998,_0xbd95b0){return function(_0x59641d){if(_0x59641d){return _0x59641d[_0xb7fa('0x25')]()['then'](function(){_0x202998[_0xb7fa('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a2f9,_0x537f2a){return function(_0x391cff){if(!_0x391cff){_0x51a2f9[_0xb7fa('0x18')](0x194);}return _0x391cff;};}function handleError(_0x9e3eba,_0xa79252){_0xa79252=_0xa79252||0x1f4;return function(_0x407479){logger[_0xb7fa('0x26')](_0x407479[_0xb7fa('0x27')]);if(_0x407479['name']){delete _0x407479[_0xb7fa('0x28')];}_0x9e3eba[_0xb7fa('0x19')](_0xa79252)[_0xb7fa('0x29')](_0x407479);};}exports[_0xb7fa('0x2a')]=function(_0x1053b5,_0x48b5aa){var _0x890e5e={},_0x4ea07c={},_0x4818e1={'count':0x0,'rows':[]};var _0x2f0d8b=_['map'](db['OpenchannelApplication'][_0xb7fa('0x2b')],function(_0x2ce9ca){return{'name':_0x2ce9ca['fieldName'],'type':_0x2ce9ca[_0xb7fa('0x2c')][_0xb7fa('0x2d')]};});_0x4ea07c['model']=_[_0xb7fa('0x2e')](_0x2f0d8b,_0xb7fa('0x28'));_0x4ea07c[_0xb7fa('0x2f')]=_['keys'](_0x1053b5[_0xb7fa('0x2f')]);_0x4ea07c['filters']=_[_0xb7fa('0x30')](_0x4ea07c[_0xb7fa('0x31')],_0x4ea07c[_0xb7fa('0x2f')]);_0x890e5e[_0xb7fa('0x32')]=_[_0xb7fa('0x30')](_0x4ea07c[_0xb7fa('0x31')],qs[_0xb7fa('0x33')](_0x1053b5['query'][_0xb7fa('0x33')]));_0x890e5e[_0xb7fa('0x32')]=_0x890e5e[_0xb7fa('0x32')][_0xb7fa('0x34')]?_0x890e5e['attributes']:_0x4ea07c['model'];if(!_0x1053b5['query'][_0xb7fa('0x35')](_0xb7fa('0x36'))){_0x890e5e[_0xb7fa('0x1d')]=qs[_0xb7fa('0x1d')](_0x1053b5[_0xb7fa('0x2f')][_0xb7fa('0x1d')]);_0x890e5e[_0xb7fa('0x1e')]=qs[_0xb7fa('0x1e')](_0x1053b5[_0xb7fa('0x2f')]['offset']);}_0x890e5e[_0xb7fa('0x37')]=qs['sort'](_0x1053b5[_0xb7fa('0x2f')]['sort']);_0x890e5e[_0xb7fa('0x38')]=qs[_0xb7fa('0x39')](_['pick'](_0x1053b5['query'],_0x4ea07c[_0xb7fa('0x39')]),_0x2f0d8b);if(_0x1053b5[_0xb7fa('0x2f')][_0xb7fa('0x3a')]){_0x890e5e[_0xb7fa('0x38')]=_[_0xb7fa('0x3b')](_0x890e5e[_0xb7fa('0x38')],{'$or':_[_0xb7fa('0x2e')](_0x2f0d8b,function(_0x39dcf5){if(_0x39dcf5[_0xb7fa('0x2c')]!==_0xb7fa('0x3c')){var _0x4d8ab9={};_0x4d8ab9[_0x39dcf5[_0xb7fa('0x28')]]={'$like':'%'+_0x1053b5['query'][_0xb7fa('0x3a')]+'%'};return _0x4d8ab9;}})});}_0x890e5e=_[_0xb7fa('0x3b')]({},_0x890e5e,_0x1053b5[_0xb7fa('0x3d')]);var _0x18d20c={'where':_0x890e5e[_0xb7fa('0x38')]};return db[_0xb7fa('0x3e')]['count'](_0x18d20c)['then'](function(_0xcaf3cf){_0x4818e1[_0xb7fa('0x3f')]=_0xcaf3cf;if(_0x1053b5[_0xb7fa('0x2f')][_0xb7fa('0x40')]){_0x890e5e[_0xb7fa('0x41')]=[{'all':!![]}];}return db[_0xb7fa('0x3e')][_0xb7fa('0x42')](_0x890e5e);})[_0xb7fa('0x24')](function(_0x1cbd77){_0x4818e1[_0xb7fa('0x43')]=_0x1cbd77;return _0x4818e1;})[_0xb7fa('0x24')](respondWithFilteredResult(_0x48b5aa,_0x890e5e))['catch'](handleError(_0x48b5aa,null));};exports[_0xb7fa('0x44')]=function(_0x89d28b,_0x1e751f){var _0xaf3e41={'raw':!![],'where':{'id':_0x89d28b[_0xb7fa('0x45')]['id']}},_0x2f1cb1={};_0x2f1cb1[_0xb7fa('0x31')]=_[_0xb7fa('0x46')](db[_0xb7fa('0x3e')][_0xb7fa('0x2b')]);_0x2f1cb1[_0xb7fa('0x2f')]=_[_0xb7fa('0x46')](_0x89d28b[_0xb7fa('0x2f')]);_0x2f1cb1[_0xb7fa('0x39')]=_['intersection'](_0x2f1cb1[_0xb7fa('0x31')],_0x2f1cb1[_0xb7fa('0x2f')]);_0xaf3e41[_0xb7fa('0x32')]=_[_0xb7fa('0x30')](_0x2f1cb1[_0xb7fa('0x31')],qs[_0xb7fa('0x33')](_0x89d28b['query'][_0xb7fa('0x33')]));_0xaf3e41[_0xb7fa('0x32')]=_0xaf3e41[_0xb7fa('0x32')][_0xb7fa('0x34')]?_0xaf3e41[_0xb7fa('0x32')]:_0x2f1cb1[_0xb7fa('0x31')];if(_0x89d28b[_0xb7fa('0x2f')][_0xb7fa('0x40')]){_0xaf3e41['include']=[{'all':!![]}];}_0xaf3e41=_['merge']({},_0xaf3e41,_0x89d28b['options']);return db[_0xb7fa('0x3e')][_0xb7fa('0x47')](_0xaf3e41)[_0xb7fa('0x24')](handleEntityNotFound(_0x1e751f,null))[_0xb7fa('0x24')](respondWithResult(_0x1e751f,null))[_0xb7fa('0x48')](handleError(_0x1e751f,null));};exports[_0xb7fa('0x49')]=function(_0x49d77c,_0x4ef917){return db[_0xb7fa('0x3e')][_0xb7fa('0x49')](_0x49d77c[_0xb7fa('0x4a')],{})[_0xb7fa('0x24')](respondWithResult(_0x4ef917,0xc9))[_0xb7fa('0x48')](handleError(_0x4ef917,null));};exports['update']=function(_0x4cf739,_0x272699){if(_0x4cf739[_0xb7fa('0x4a')]['id']){delete _0x4cf739[_0xb7fa('0x4a')]['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x4cf739[_0xb7fa('0x45')]['id']}})[_0xb7fa('0x24')](handleEntityNotFound(_0x272699,null))[_0xb7fa('0x24')](saveUpdates(_0x4cf739[_0xb7fa('0x4a')],null))['then'](respondWithResult(_0x272699,null))[_0xb7fa('0x48')](handleError(_0x272699,null));};exports[_0xb7fa('0x25')]=function(_0x536080,_0x512fac){return db[_0xb7fa('0x3e')][_0xb7fa('0x47')]({'where':{'id':_0x536080['params']['id']}})[_0xb7fa('0x24')](handleEntityNotFound(_0x512fac,null))['then'](removeEntity(_0x512fac,null))['catch'](handleError(_0x512fac,null));}; \ No newline at end of file +var _0x3042=['body','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','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','set','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','OpenchannelApplication','includeAll','include','rows','params','fields','find','catch','create'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x3042,0x97));var _0x2304=function(_0x71b765,_0x3053f8){_0x71b765=_0x71b765-0x0;var _0x34cb24=_0x3042[_0x71b765];return _0x34cb24;};'use strict';var emlformat=require(_0x2304('0x0'));var rimraf=require(_0x2304('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2304('0x2'));var moment=require('moment');var BPromise=require(_0x2304('0x3'));var Mustache=require(_0x2304('0x4'));var util=require(_0x2304('0x5'));var path=require(_0x2304('0x6'));var sox=require(_0x2304('0x7'));var csv=require('to-csv');var ejs=require(_0x2304('0x8'));var fs=require('fs');var fs_extra=require(_0x2304('0x9'));var _=require(_0x2304('0xa'));var squel=require(_0x2304('0xb'));var crypto=require(_0x2304('0xc'));var jsforce=require(_0x2304('0xd'));var deskjs=require(_0x2304('0xe'));var toCsv=require(_0x2304('0xf'));var querystring=require(_0x2304('0x10'));var Papa=require('papaparse');var Redis=require(_0x2304('0x11'));var authService=require(_0x2304('0x12'));var qs=require(_0x2304('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2304('0x14'));var logger=require(_0x2304('0x15'))(_0x2304('0x16'));var utils=require(_0x2304('0x17'));var config=require(_0x2304('0x18'));var licenseUtil=require(_0x2304('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e16d5,_0x4a632c){_0x4a632c=_0x4a632c||0xcc;return function(_0x243b3c){if(_0x243b3c){return _0x2e16d5[_0x2304('0x1a')](_0x4a632c);}return _0x2e16d5[_0x2304('0x1b')](_0x4a632c)[_0x2304('0x1c')]();};}function respondWithResult(_0x9f216f,_0x3ab69b){_0x3ab69b=_0x3ab69b||0xc8;return function(_0x47feec){if(_0x47feec){return _0x9f216f[_0x2304('0x1b')](_0x3ab69b)[_0x2304('0x1d')](_0x47feec);}};}function respondWithFilteredResult(_0x507c40,_0x1b04a0){return function(_0xbb3f6c){if(_0xbb3f6c){var _0x2ef281=typeof _0x1b04a0[_0x2304('0x1e')]===_0x2304('0x1f')&&typeof _0x1b04a0[_0x2304('0x20')]==='undefined';var _0x5833d7=_0xbb3f6c[_0x2304('0x21')];var _0x51b3b6=_0x2ef281?0x0:_0x1b04a0[_0x2304('0x1e')];var _0x2f8546=_0x2ef281?_0xbb3f6c['count']:_0x1b04a0[_0x2304('0x1e')]+_0x1b04a0[_0x2304('0x20')];var _0x54b631;if(_0x2f8546>=_0x5833d7){_0x2f8546=_0x5833d7;_0x54b631=0xc8;}else{_0x54b631=0xce;}_0x507c40['status'](_0x54b631);return _0x507c40[_0x2304('0x22')]('Content-Range',_0x51b3b6+'-'+_0x2f8546+'/'+_0x5833d7)[_0x2304('0x1d')](_0xbb3f6c);}return null;};}function patchUpdates(_0x543a4d){return function(_0xb7a21b){try{jsonpatch[_0x2304('0x23')](_0xb7a21b,_0x543a4d,!![]);}catch(_0x4c02a7){return BPromise[_0x2304('0x24')](_0x4c02a7);}return _0xb7a21b[_0x2304('0x25')]();};}function saveUpdates(_0x3f61cf,_0x51726c){return function(_0xfdc127){if(_0xfdc127){return _0xfdc127[_0x2304('0x26')](_0x3f61cf)[_0x2304('0x27')](function(_0x286dce){return _0x286dce;});}return null;};}function removeEntity(_0x55117a,_0x3f52e8){return function(_0x219a46){if(_0x219a46){return _0x219a46[_0x2304('0x28')]()[_0x2304('0x27')](function(){_0x55117a[_0x2304('0x1b')](0xcc)[_0x2304('0x1c')]();});}};}function handleEntityNotFound(_0x42b1fd,_0x4536c9){return function(_0x3e1b35){if(!_0x3e1b35){_0x42b1fd[_0x2304('0x1a')](0x194);}return _0x3e1b35;};}function handleError(_0x641532,_0x9fd78c){_0x9fd78c=_0x9fd78c||0x1f4;return function(_0x3538cc){logger[_0x2304('0x29')](_0x3538cc['stack']);if(_0x3538cc[_0x2304('0x2a')]){delete _0x3538cc[_0x2304('0x2a')];}_0x641532[_0x2304('0x1b')](_0x9fd78c)[_0x2304('0x2b')](_0x3538cc);};}exports[_0x2304('0x2c')]=function(_0x34899d,_0x4041a0){var _0x50dd98={},_0x29cc3={},_0x4583a9={'count':0x0,'rows':[]};var _0x5aecaf=_[_0x2304('0x2d')](db['OpenchannelApplication'][_0x2304('0x2e')],function(_0x2e1036){return{'name':_0x2e1036[_0x2304('0x2f')],'type':_0x2e1036['type'][_0x2304('0x30')]};});_0x29cc3[_0x2304('0x31')]=_[_0x2304('0x2d')](_0x5aecaf,_0x2304('0x2a'));_0x29cc3['query']=_[_0x2304('0x32')](_0x34899d[_0x2304('0x33')]);_0x29cc3[_0x2304('0x34')]=_[_0x2304('0x35')](_0x29cc3[_0x2304('0x31')],_0x29cc3[_0x2304('0x33')]);_0x50dd98[_0x2304('0x36')]=_[_0x2304('0x35')](_0x29cc3[_0x2304('0x31')],qs['fields'](_0x34899d[_0x2304('0x33')]['fields']));_0x50dd98[_0x2304('0x36')]=_0x50dd98[_0x2304('0x36')][_0x2304('0x37')]?_0x50dd98[_0x2304('0x36')]:_0x29cc3[_0x2304('0x31')];if(!_0x34899d[_0x2304('0x33')][_0x2304('0x38')](_0x2304('0x39'))){_0x50dd98['limit']=qs['limit'](_0x34899d[_0x2304('0x33')]['limit']);_0x50dd98[_0x2304('0x1e')]=qs[_0x2304('0x1e')](_0x34899d['query'][_0x2304('0x1e')]);}_0x50dd98[_0x2304('0x3a')]=qs[_0x2304('0x3b')](_0x34899d[_0x2304('0x33')][_0x2304('0x3b')]);_0x50dd98['where']=qs[_0x2304('0x34')](_[_0x2304('0x3c')](_0x34899d[_0x2304('0x33')],_0x29cc3['filters']),_0x5aecaf);if(_0x34899d[_0x2304('0x33')][_0x2304('0x3d')]){_0x50dd98['where']=_[_0x2304('0x3e')](_0x50dd98['where'],{'$or':_[_0x2304('0x2d')](_0x5aecaf,function(_0x1a59e9){if(_0x1a59e9['type']!==_0x2304('0x3f')){var _0x1bdd9b={};_0x1bdd9b[_0x1a59e9['name']]={'$like':'%'+_0x34899d[_0x2304('0x33')][_0x2304('0x3d')]+'%'};return _0x1bdd9b;}})});}_0x50dd98=_[_0x2304('0x3e')]({},_0x50dd98,_0x34899d[_0x2304('0x40')]);var _0x269944={'where':_0x50dd98['where']};return db[_0x2304('0x41')]['count'](_0x269944)['then'](function(_0x3c8413){_0x4583a9['count']=_0x3c8413;if(_0x34899d[_0x2304('0x33')][_0x2304('0x42')]){_0x50dd98[_0x2304('0x43')]=[{'all':!![]}];}return db[_0x2304('0x41')]['findAll'](_0x50dd98);})[_0x2304('0x27')](function(_0x2dab8f){_0x4583a9[_0x2304('0x44')]=_0x2dab8f;return _0x4583a9;})[_0x2304('0x27')](respondWithFilteredResult(_0x4041a0,_0x50dd98))['catch'](handleError(_0x4041a0,null));};exports['show']=function(_0x1356b5,_0x4af42d){var _0x66a9d9={'raw':!![],'where':{'id':_0x1356b5[_0x2304('0x45')]['id']}},_0x46c9cd={};_0x46c9cd['model']=_['keys'](db[_0x2304('0x41')][_0x2304('0x2e')]);_0x46c9cd[_0x2304('0x33')]=_[_0x2304('0x32')](_0x1356b5[_0x2304('0x33')]);_0x46c9cd[_0x2304('0x34')]=_[_0x2304('0x35')](_0x46c9cd['model'],_0x46c9cd['query']);_0x66a9d9[_0x2304('0x36')]=_[_0x2304('0x35')](_0x46c9cd[_0x2304('0x31')],qs['fields'](_0x1356b5[_0x2304('0x33')][_0x2304('0x46')]));_0x66a9d9[_0x2304('0x36')]=_0x66a9d9[_0x2304('0x36')]['length']?_0x66a9d9['attributes']:_0x46c9cd['model'];if(_0x1356b5['query']['includeAll']){_0x66a9d9['include']=[{'all':!![]}];}_0x66a9d9=_[_0x2304('0x3e')]({},_0x66a9d9,_0x1356b5[_0x2304('0x40')]);return db[_0x2304('0x41')][_0x2304('0x47')](_0x66a9d9)['then'](handleEntityNotFound(_0x4af42d,null))[_0x2304('0x27')](respondWithResult(_0x4af42d,null))[_0x2304('0x48')](handleError(_0x4af42d,null));};exports[_0x2304('0x49')]=function(_0x1fc392,_0xcc6309){return db[_0x2304('0x41')][_0x2304('0x49')](_0x1fc392[_0x2304('0x4a')],{})['then'](respondWithResult(_0xcc6309,0xc9))[_0x2304('0x48')](handleError(_0xcc6309,null));};exports[_0x2304('0x26')]=function(_0x55a2d6,_0x450fa4){if(_0x55a2d6['body']['id']){delete _0x55a2d6[_0x2304('0x4a')]['id'];}return db[_0x2304('0x41')]['find']({'where':{'id':_0x55a2d6['params']['id']}})[_0x2304('0x27')](handleEntityNotFound(_0x450fa4,null))[_0x2304('0x27')](saveUpdates(_0x55a2d6[_0x2304('0x4a')],null))[_0x2304('0x27')](respondWithResult(_0x450fa4,null))['catch'](handleError(_0x450fa4,null));};exports[_0x2304('0x28')]=function(_0x4973f0,_0x969674){return db['OpenchannelApplication']['find']({'where':{'id':_0x4973f0[_0x2304('0x45')]['id']}})[_0x2304('0x27')](handleEntityNotFound(_0x969674,null))[_0x2304('0x27')](removeEntity(_0x969674,null))[_0x2304('0x48')](handleError(_0x969674,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 2d1f604..d214620 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 _0x9b49=['lodash','util','../../config/logger','api','request-promise','rimraf','./openchannelApplication.attributes','OpenchannelApplication','openchannel_applications','utf8mb4'];(function(_0x39b82f,_0x101ffc){var _0x1cbdd9=function(_0xe80b5e){while(--_0xe80b5e){_0x39b82f['push'](_0x39b82f['shift']());}};_0x1cbdd9(++_0x101ffc);}(_0x9b49,0x82));var _0x99b4=function(_0x5a42d9,_0x2d397e){_0x5a42d9=_0x5a42d9-0x0;var _0x190cf2=_0x9b49[_0x5a42d9];return _0x190cf2;};'use strict';var _=require(_0x99b4('0x0'));var util=require(_0x99b4('0x1'));var logger=require(_0x99b4('0x2'))(_0x99b4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x99b4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x99b4('0x5'));var config=require('../../config/environment');var attributes=require(_0x99b4('0x6'));module['exports']=function(_0x5efd3f,_0x378ba1){return _0x5efd3f['define'](_0x99b4('0x7'),attributes,{'tableName':_0x99b4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x99b4('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x6b7b=['openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication'];(function(_0x4a2273,_0x270198){var _0x1bf4e3=function(_0x1613f3){while(--_0x1613f3){_0x4a2273['push'](_0x4a2273['shift']());}};_0x1bf4e3(++_0x270198);}(_0x6b7b,0xe4));var _0xb6b7=function(_0x130ad8,_0x972d43){_0x130ad8=_0x130ad8-0x0;var _0x247f62=_0x6b7b[_0x130ad8];return _0x247f62;};'use strict';var _=require(_0xb6b7('0x0'));var util=require(_0xb6b7('0x1'));var logger=require(_0xb6b7('0x2'))(_0xb6b7('0x3'));var moment=require(_0xb6b7('0x4'));var BPromise=require(_0xb6b7('0x5'));var rp=require(_0xb6b7('0x6'));var fs=require('fs');var path=require(_0xb6b7('0x7'));var rimraf=require('rimraf');var config=require(_0xb6b7('0x8'));var attributes=require(_0xb6b7('0x9'));module['exports']=function(_0x4618cb,_0x4829e6){return _0x4618cb[_0xb6b7('0xa')](_0xb6b7('0xb'),attributes,{'tableName':_0xb6b7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb6b7('0xd'),'collate':_0xb6b7('0xe')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 01eb4d3..fdb29fd 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 _0xc24c=['UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','lodash','util','randomstring','../../config/utils','../../config/environment','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x5e24ea,_0xb25510){var _0x2f8126=function(_0x45e251){while(--_0x45e251){_0x5e24ea['push'](_0x5e24ea['shift']());}};_0x2f8126(++_0xb25510);}(_0xc24c,0x13e));var _0xcc24=function(_0x39569c,_0x346f99){_0x39569c=_0x39569c-0x0;var _0x50ad3b=_0xc24c[_0x39569c];return _0x50ad3b;};'use strict';var _=require(_0xcc24('0x0'));var util=require(_0xcc24('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcc24('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcc24('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xcc24('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xcc24('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56bfac,_0x96dfa7,_0x1dccbb){return new BPromise(function(_0x5f54e7,_0x587648){return client[_0xcc24('0x6')](_0x56bfac,_0x1dccbb)[_0xcc24('0x7')](function(_0x292cd6){logger[_0xcc24('0x8')](_0xcc24('0x9'),_0x96dfa7,_0xcc24('0xa'));logger[_0xcc24('0xb')](_0xcc24('0xc'),_0x96dfa7,_0xcc24('0xa'),JSON[_0xcc24('0xd')](_0x292cd6));if(_0x292cd6['error']){if(_0x292cd6[_0xcc24('0xe')][_0xcc24('0xf')]===0x1f4){logger['error'](_0xcc24('0x9'),_0x96dfa7,_0x292cd6[_0xcc24('0xe')][_0xcc24('0x10')]);return _0x587648(_0x292cd6[_0xcc24('0xe')][_0xcc24('0x10')]);}logger[_0xcc24('0xe')](_0xcc24('0x9'),_0x96dfa7,_0x292cd6[_0xcc24('0xe')]['message']);return _0x5f54e7(_0x292cd6[_0xcc24('0xe')][_0xcc24('0x10')]);}else{logger[_0xcc24('0x8')](_0xcc24('0x9'),_0x96dfa7,_0xcc24('0xa'));_0x5f54e7(_0x292cd6['result'][_0xcc24('0x10')]);}})[_0xcc24('0x11')](function(_0x13d53c){logger[_0xcc24('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x96dfa7,_0x13d53c);_0x587648(_0x13d53c);});});}exports[_0xcc24('0x12')]=function(_0x4a4d7b){var _0x4c6c52=this;return new Promise(function(_0xfe3f96,_0x4d4645){return db[_0xcc24('0x13')][_0xcc24('0x14')](_0x4a4d7b['body'],{'raw':_0x4a4d7b[_0xcc24('0x15')]?_0x4a4d7b[_0xcc24('0x15')][_0xcc24('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a4d7b[_0xcc24('0x15')]?_0x4a4d7b['options'][_0xcc24('0x17')]||null:null,'attributes':_0x4a4d7b[_0xcc24('0x15')]?_0x4a4d7b[_0xcc24('0x15')]['attributes']||null:null,'limit':_0x4a4d7b[_0xcc24('0x15')]?_0x4a4d7b[_0xcc24('0x15')]['limit']||null:null})['then'](function(_0x4cd4de){logger[_0xcc24('0x8')](_0xcc24('0x12'),_0x4a4d7b);logger[_0xcc24('0xb')]('UpdateOpenchannelApplication',_0x4a4d7b,JSON[_0xcc24('0xd')](_0x4cd4de));_0xfe3f96(_0x4cd4de);})[_0xcc24('0x11')](function(_0x20f965){logger[_0xcc24('0xe')]('UpdateOpenchannelApplication',_0x20f965['message'],_0x4a4d7b);_0x4d4645(_0x4c6c52['error'](0x1f4,_0x20f965[_0xcc24('0x10')]));});});}; \ No newline at end of file +var _0xd08d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','update','body','options','raw','where','attributes','limit','UpdateOpenchannelApplication','catch','lodash','util'];(function(_0x3473c8,_0x2fe226){var _0x5ef960=function(_0x48ba30){while(--_0x48ba30){_0x3473c8['push'](_0x3473c8['shift']());}};_0x5ef960(++_0x2fe226);}(_0xd08d,0x130));var _0xdd08=function(_0x3a2a3c,_0x37bd31){_0x3a2a3c=_0x3a2a3c-0x0;var _0x50ac9a=_0xd08d[_0x3a2a3c];return _0x50ac9a;};'use strict';var _=require(_0xdd08('0x0'));var util=require(_0xdd08('0x1'));var moment=require(_0xdd08('0x2'));var BPromise=require(_0xdd08('0x3'));var rs=require(_0xdd08('0x4'));var fs=require('fs');var Redis=require(_0xdd08('0x5'));var db=require(_0xdd08('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdd08('0x7'))(_0xdd08('0x8'));var config=require(_0xdd08('0x9'));var jayson=require(_0xdd08('0xa'));var client=jayson[_0xdd08('0xb')][_0xdd08('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x478c78,_0x1351c2,_0x3f3ec6){return new BPromise(function(_0x2e42c7,_0x2208c3){return client[_0xdd08('0xd')](_0x478c78,_0x3f3ec6)[_0xdd08('0xe')](function(_0x3918f8){logger[_0xdd08('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x1351c2,_0xdd08('0x10'));logger[_0xdd08('0x11')](_0xdd08('0x12'),_0x1351c2,'request\x20sent',JSON[_0xdd08('0x13')](_0x3918f8));if(_0x3918f8['error']){if(_0x3918f8[_0xdd08('0x14')][_0xdd08('0x15')]===0x1f4){logger['error'](_0xdd08('0x16'),_0x1351c2,_0x3918f8[_0xdd08('0x14')][_0xdd08('0x17')]);return _0x2208c3(_0x3918f8[_0xdd08('0x14')][_0xdd08('0x17')]);}logger[_0xdd08('0x14')](_0xdd08('0x16'),_0x1351c2,_0x3918f8[_0xdd08('0x14')][_0xdd08('0x17')]);return _0x2e42c7(_0x3918f8[_0xdd08('0x14')]['message']);}else{logger['info'](_0xdd08('0x16'),_0x1351c2,_0xdd08('0x10'));_0x2e42c7(_0x3918f8[_0xdd08('0x18')][_0xdd08('0x17')]);}})['catch'](function(_0x4efb2d){logger[_0xdd08('0x14')](_0xdd08('0x16'),_0x1351c2,_0x4efb2d);_0x2208c3(_0x4efb2d);});});}exports['UpdateOpenchannelApplication']=function(_0x4917bb){var _0x588ae8=this;return new Promise(function(_0x38ef61,_0x5c2b94){return db['OpenchannelApplication'][_0xdd08('0x19')](_0x4917bb[_0xdd08('0x1a')],{'raw':_0x4917bb[_0xdd08('0x1b')]?_0x4917bb[_0xdd08('0x1b')][_0xdd08('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4917bb[_0xdd08('0x1b')]?_0x4917bb[_0xdd08('0x1b')][_0xdd08('0x1d')]||null:null,'attributes':_0x4917bb[_0xdd08('0x1b')]?_0x4917bb[_0xdd08('0x1b')][_0xdd08('0x1e')]||null:null,'limit':_0x4917bb[_0xdd08('0x1b')]?_0x4917bb[_0xdd08('0x1b')][_0xdd08('0x1f')]||null:null})[_0xdd08('0xe')](function(_0x41a2fd){logger[_0xdd08('0xf')](_0xdd08('0x20'),_0x4917bb);logger[_0xdd08('0x11')](_0xdd08('0x20'),_0x4917bb,JSON[_0xdd08('0x13')](_0x41a2fd));_0x38ef61(_0x41a2fd);})[_0xdd08('0x21')](function(_0x34af15){logger[_0xdd08('0x14')](_0xdd08('0x20'),_0x34af15[_0xdd08('0x17')],_0x4917bb);_0x5c2b94(_0x588ae8[_0xdd08('0x14')](0x1f4,_0x34af15[_0xdd08('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 83bf112..43903e6 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 _0x68ee=['openchannelinteraction:addtags','addTags','put','openchannel','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','tracked'];(function(_0x480214,_0x3b9448){var _0x3a8105=function(_0x172174){while(--_0x172174){_0x480214['push'](_0x480214['shift']());}};_0x3a8105(++_0x3b9448);}(_0x68ee,0x93));var _0xe68e=function(_0x3a80f7,_0x2cfef2){_0x3a80f7=_0x3a80f7-0x0;var _0x1e3eff=_0x68ee[_0x3a80f7];return _0x1e3eff;};'use strict';var multer=require(_0xe68e('0x0'));var util=require('util');var path=require(_0xe68e('0x1'));var timeout=require(_0xe68e('0x2'));var express=require(_0xe68e('0x3'));var router=express[_0xe68e('0x4')]();var fs_extra=require(_0xe68e('0x5'));var auth=require(_0xe68e('0x6'));var interaction=require(_0xe68e('0x7'));var config=require(_0xe68e('0x8'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth[_0xe68e('0x9')](),controller[_0xe68e('0xa')]);router[_0xe68e('0xb')](_0xe68e('0xc'),auth[_0xe68e('0x9')](),controller[_0xe68e('0xd')]);router['get'](_0xe68e('0xe'),auth[_0xe68e('0x9')](),controller[_0xe68e('0xf')]);router[_0xe68e('0xb')](_0xe68e('0x10'),auth[_0xe68e('0x9')](),controller[_0xe68e('0x11')]);router[_0xe68e('0xb')](_0xe68e('0x12'),auth[_0xe68e('0x9')](),controller[_0xe68e('0x13')]);router['post']('/',auth[_0xe68e('0x9')](),controller[_0xe68e('0x14')]);router[_0xe68e('0x15')]('/:id/messages',auth[_0xe68e('0x9')](),controller['addMessage']);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0xe68e('0x16')]('openchannel',_0xe68e('0x17')),controller[_0xe68e('0x18')]);router[_0xe68e('0x19')](_0xe68e('0xe'),auth['isAuthenticated'](),interaction[_0xe68e('0x16')](_0xe68e('0x1a'),_0xe68e('0x1b')),controller['update']);router[_0xe68e('0x1c')]('/:id',auth[_0xe68e('0x9')](),interaction[_0xe68e('0x16')](_0xe68e('0x1a'),_0xe68e('0x1d')),controller[_0xe68e('0x1e')]);router[_0xe68e('0x1c')](_0xe68e('0x1f'),auth[_0xe68e('0x9')](),controller[_0xe68e('0x20')]);module[_0xe68e('0x21')]=router; \ No newline at end of file +var _0x86f7=['index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0xf016d6,_0x28b45e){var _0x588fcb=function(_0x4f7d50){while(--_0x4f7d50){_0xf016d6['push'](_0xf016d6['shift']());}};_0x588fcb(++_0x28b45e);}(_0x86f7,0x1c6));var _0x786f=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x86f7[_0x126558];return _0x1f6d14;};'use strict';var multer=require(_0x786f('0x0'));var util=require(_0x786f('0x1'));var path=require(_0x786f('0x2'));var timeout=require('connect-timeout');var express=require(_0x786f('0x3'));var router=express[_0x786f('0x4')]();var fs_extra=require(_0x786f('0x5'));var auth=require(_0x786f('0x6'));var interaction=require(_0x786f('0x7'));var config=require(_0x786f('0x8'));var controller=require('./openchannelInteraction.controller');router[_0x786f('0x9')]('/',auth[_0x786f('0xa')](),controller[_0x786f('0xb')]);router[_0x786f('0x9')](_0x786f('0xc'),auth[_0x786f('0xa')](),controller['describe']);router[_0x786f('0x9')](_0x786f('0xd'),auth[_0x786f('0xa')](),controller[_0x786f('0xe')]);router[_0x786f('0x9')](_0x786f('0xf'),auth[_0x786f('0xa')](),controller[_0x786f('0x10')]);router[_0x786f('0x9')](_0x786f('0x11'),auth[_0x786f('0xa')](),controller[_0x786f('0x12')]);router[_0x786f('0x13')]('/',auth[_0x786f('0xa')](),controller['create']);router['post'](_0x786f('0xf'),auth[_0x786f('0xa')](),controller[_0x786f('0x14')]);router[_0x786f('0x13')](_0x786f('0x15'),auth[_0x786f('0xa')](),interaction[_0x786f('0x16')](_0x786f('0x17'),_0x786f('0x18')),controller['addTags']);router[_0x786f('0x19')]('/:id',auth['isAuthenticated'](),interaction['tracked']('openchannel',_0x786f('0x1a')),controller[_0x786f('0x1b')]);router[_0x786f('0x1c')](_0x786f('0xd'),auth[_0x786f('0xa')](),interaction[_0x786f('0x16')](_0x786f('0x17'),'openchannelinteraction:destroy'),controller[_0x786f('0x1d')]);router[_0x786f('0x1c')]('/:id/tags',auth[_0x786f('0xa')](),controller['removeTags']);module[_0x786f('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 4e3081d..3f28246 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 _0x8868=['STRING','out','ENUM','sequelize','exports','BOOLEAN','DATE'];(function(_0x1c8cc6,_0x411e5c){var _0x522936=function(_0x38d044){while(--_0x38d044){_0x1c8cc6['push'](_0x1c8cc6['shift']());}};_0x522936(++_0x411e5c);}(_0x8868,0x1ca));var _0x8886=function(_0x12cd77,_0x615b14){_0x12cd77=_0x12cd77-0x0;var _0x3dc46b=_0x8868[_0x12cd77];return _0x3dc46b;};'use strict';var Sequelize=require(_0x8886('0x0'));module[_0x8886('0x1')]={'closed':{'type':Sequelize[_0x8886('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8886('0x3')]},'disposition':{'type':Sequelize[_0x8886('0x4')]},'secondDisposition':{'type':Sequelize[_0x8886('0x4')]},'thirdDisposition':{'type':Sequelize[_0x8886('0x4')]},'note':{'type':Sequelize[_0x8886('0x4')]},'read1stAt':{'type':Sequelize[_0x8886('0x3')]},'threadId':{'type':Sequelize[_0x8886('0x4')]},'externalUrl':{'type':Sequelize[_0x8886('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x8886('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x8886('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x8886('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xab5b=['out','BOOLEAN','sequelize','exports','DATE','STRING','ENUM'];(function(_0x21cd26,_0x5b2940){var _0x4b751b=function(_0x14484f){while(--_0x14484f){_0x21cd26['push'](_0x21cd26['shift']());}};_0x4b751b(++_0x5b2940);}(_0xab5b,0x11a));var _0xbab5=function(_0x428fec,_0x2e718e){_0x428fec=_0x428fec-0x0;var _0x1d1efd=_0xab5b[_0x428fec];return _0x1d1efd;};'use strict';var Sequelize=require(_0xbab5('0x0'));module[_0xbab5('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbab5('0x2')]},'disposition':{'type':Sequelize[_0xbab5('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xbab5('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xbab5('0x3')]},'externalUrl':{'type':Sequelize[_0xbab5('0x3')]},'lastMsgAt':{'type':Sequelize[_0xbab5('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xbab5('0x4')]('in',_0xbab5('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xbab5('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xbab5('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xbab5('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 3faed0e..3401d0e 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 _0xed36=['length','merge','options','find','body','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','nolimit','offset','sort','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','removeTags','download','unix','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Owner','mkdirSync','Openchannel','Account','N.A.','createdAt','toString','disposition','threadId','Public','Private','basename','createReadStream','pipe','createWriteStream','out','System','Contact','read','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','undefined','count','limit','set','Content-Range','update','then','destroy','error','stack','name','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','query','user','catch','show','from','params','keys','filters','intersection','model','fields','attributes'];(function(_0x1d5b3d,_0x5c7145){var _0xc810b9=function(_0x2b11fa){while(--_0x2b11fa){_0x1d5b3d['push'](_0x1d5b3d['shift']());}};_0xc810b9(++_0x5c7145);}(_0xed36,0xc6));var _0x6ed3=function(_0x6696d,_0x2fb8ac){_0x6696d=_0x6696d-0x0;var _0x587a4c=_0xed36[_0x6696d];return _0x587a4c;};'use strict';var rimraf=require(_0x6ed3('0x0'));var zipdir=require(_0x6ed3('0x1'));var moment=require(_0x6ed3('0x2'));var util=require(_0x6ed3('0x3'));var path=require('path');var ejs=require(_0x6ed3('0x4'));var fs=require('fs');var _=require(_0x6ed3('0x5'));var Redis=require(_0x6ed3('0x6'));var interaction=require(_0x6ed3('0x7'));var qs=require(_0x6ed3('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0x6ed3('0x9'))(_0x6ed3('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x6ed3('0xb')]=_[_0x6ed3('0xc')](config[_0x6ed3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6ed3('0xd'))(new Redis(config['redis']));require(_0x6ed3('0xe'))[_0x6ed3('0xf')](socket);function respondWithStatusCode(_0x204ed9,_0x5d460a){_0x5d460a=_0x5d460a||0xcc;return function(_0x56ecaa){if(_0x56ecaa){return _0x204ed9[_0x6ed3('0x10')](_0x5d460a);}return _0x204ed9[_0x6ed3('0x11')](_0x5d460a)[_0x6ed3('0x12')]();};}function respondWithResult(_0x5e0f47,_0x1be238){_0x1be238=_0x1be238||0xc8;return function(_0x4eee25){if(_0x4eee25){return _0x5e0f47['status'](_0x1be238)[_0x6ed3('0x13')](_0x4eee25);}};}function respondWithFilteredResult(_0x539f59,_0x27e717){return function(_0x47a7ae){if(_0x47a7ae){var _0x43467a=typeof _0x27e717['offset']===_0x6ed3('0x14')&&typeof _0x27e717['limit']==='undefined';var _0x1c860f=_0x47a7ae[_0x6ed3('0x15')];var _0x4a049d=_0x43467a?0x0:_0x27e717['offset'];var _0x2d232e=_0x43467a?_0x47a7ae[_0x6ed3('0x15')]:_0x27e717['offset']+_0x27e717[_0x6ed3('0x16')];var _0xe01c97;if(_0x2d232e>=_0x1c860f){_0x2d232e=_0x1c860f;_0xe01c97=0xc8;}else{_0xe01c97=0xce;}_0x539f59[_0x6ed3('0x11')](_0xe01c97);return _0x539f59[_0x6ed3('0x17')](_0x6ed3('0x18'),_0x4a049d+'-'+_0x2d232e+'/'+_0x1c860f)[_0x6ed3('0x13')](_0x47a7ae);}return null;};}function saveUpdates(_0x9e81b2){return function(_0x49a953){if(_0x49a953){return _0x49a953[_0x6ed3('0x19')](_0x9e81b2)[_0x6ed3('0x1a')](function(_0x450be1){return _0x450be1;});}return null;};}function removeEntity(_0x4073d9){return function(_0x36bf90){if(_0x36bf90){return _0x36bf90[_0x6ed3('0x1b')]()[_0x6ed3('0x1a')](function(){_0x4073d9[_0x6ed3('0x11')](0xcc)[_0x6ed3('0x12')]();});}};}function handleEntityNotFound(_0x173f6d){return function(_0x460471){if(!_0x460471){_0x173f6d['sendStatus'](0x194);}return _0x460471;};}function handleError(_0x2725dd,_0x40299e){_0x40299e=_0x40299e||0x1f4;return function(_0x548b09){logger[_0x6ed3('0x1c')](_0x548b09[_0x6ed3('0x1d')]);if(_0x548b09[_0x6ed3('0x1e')]){delete _0x548b09['name'];}_0x2725dd[_0x6ed3('0x11')](_0x40299e)['send'](_0x548b09);};}exports[_0x6ed3('0x1f')]=function(_0x3fab16,_0x117499){var _0x90518e={};var _0x2b94a0=_[_0x6ed3('0x20')](db[_0x6ed3('0x21')][_0x6ed3('0x22')],function(_0x1a58cb){return{'name':_0x1a58cb[_0x6ed3('0x23')],'type':_0x1a58cb[_0x6ed3('0x24')][_0x6ed3('0x25')]};});_0x90518e=qs[_0x6ed3('0x26')](_0x2b94a0,_0x3fab16);return interaction[_0x6ed3('0x27')]('openchannel',_0x3fab16[_0x6ed3('0x28')],_0x3fab16[_0x6ed3('0x29')],_0x90518e,_0x2b94a0)['then'](respondWithFilteredResult(_0x117499,_0x90518e))[_0x6ed3('0x2a')](handleError(_0x117499,null));};exports[_0x6ed3('0x2b')]=function(_0x1aa040,_0x1fc5aa){var _0xa997d3={};if(_0x1aa040[_0x6ed3('0x28')][_0x6ed3('0x24')]&&_0x1aa040[_0x6ed3('0x28')][_0x6ed3('0x24')]==='from'){_0xa997d3[_0x6ed3('0x2c')]=_0x1aa040[_0x6ed3('0x2d')]['id'];}else{_0xa997d3['id']=_0x1aa040['params']['id'];}var _0x6f5a88={'raw':![],'where':_0xa997d3},_0x5a96d2={};_0x5a96d2['model']=_[_0x6ed3('0x2e')](db[_0x6ed3('0x21')][_0x6ed3('0x22')]);_0x5a96d2[_0x6ed3('0x28')]=_[_0x6ed3('0x2e')](_0x1aa040[_0x6ed3('0x28')]);_0x5a96d2[_0x6ed3('0x2f')]=_[_0x6ed3('0x30')](_0x5a96d2[_0x6ed3('0x31')],_0x5a96d2['query']);_0x6f5a88['attributes']=_[_0x6ed3('0x30')](_0x5a96d2[_0x6ed3('0x31')],qs[_0x6ed3('0x32')](_0x1aa040[_0x6ed3('0x28')]['fields']));_0x6f5a88[_0x6ed3('0x33')]=_0x6f5a88[_0x6ed3('0x33')][_0x6ed3('0x34')]?_0x6f5a88[_0x6ed3('0x33')]:_0x5a96d2[_0x6ed3('0x31')];if(_0x1aa040[_0x6ed3('0x28')]['includeAll']){_0x6f5a88['include']=[{'all':!![]}];}_0x6f5a88=_[_0x6ed3('0x35')]({},_0x6f5a88,_0x1aa040[_0x6ed3('0x36')]);return db['OpenchannelInteraction'][_0x6ed3('0x37')](_0x6f5a88)[_0x6ed3('0x1a')](handleEntityNotFound(_0x1fc5aa,null))[_0x6ed3('0x1a')](respondWithResult(_0x1fc5aa,null))[_0x6ed3('0x2a')](handleError(_0x1fc5aa,null));};exports['create']=function(_0x31faeb,_0x34128b){return db['OpenchannelInteraction']['create'](_0x31faeb[_0x6ed3('0x38')],{})['then'](respondWithResult(_0x34128b,0xc9))[_0x6ed3('0x2a')](handleError(_0x34128b,null));};exports[_0x6ed3('0x19')]=function(_0x2e6a4f,_0x1ed610){if(_0x2e6a4f[_0x6ed3('0x38')]['id']){delete _0x2e6a4f[_0x6ed3('0x38')]['id'];}return db[_0x6ed3('0x21')][_0x6ed3('0x37')]({'where':{'id':_0x2e6a4f[_0x6ed3('0x2d')]['id']}})['then'](handleEntityNotFound(_0x1ed610,null))['then'](saveUpdates(_0x2e6a4f[_0x6ed3('0x38')],null))[_0x6ed3('0x1a')](respondWithResult(_0x1ed610,null))[_0x6ed3('0x2a')](handleError(_0x1ed610,null));};exports['destroy']=function(_0x551087,_0x8f255a){return db[_0x6ed3('0x21')][_0x6ed3('0x37')]({'where':{'id':_0x551087[_0x6ed3('0x2d')]['id']}})['then'](handleEntityNotFound(_0x8f255a,null))[_0x6ed3('0x1a')](removeEntity(_0x8f255a,null))[_0x6ed3('0x2a')](handleError(_0x8f255a,null));};exports[_0x6ed3('0x39')]=function(_0x3dfce8,_0x296246){return db[_0x6ed3('0x21')][_0x6ed3('0x39')]()['then'](respondWithResult(_0x296246,null))['catch'](handleError(_0x296246,null));};exports[_0x6ed3('0x3a')]=function(_0x27d1b8,_0x424ef3){return db[_0x6ed3('0x3b')]['find']({'where':{'id':_0x27d1b8['params']['id']}})[_0x6ed3('0x1a')](handleEntityNotFound(_0x424ef3,null))['then'](function(_0x44b133){if(_0x44b133){return _0x44b133[_0x6ed3('0x3a')](_0x27d1b8['body'][_0x6ed3('0x3c')],_[_0x6ed3('0x3d')](_0x27d1b8[_0x6ed3('0x38')],[_0x6ed3('0x3c'),'id'])||{});}})[_0x6ed3('0x1a')](respondWithResult(_0x424ef3,null))[_0x6ed3('0x2a')](handleError(_0x424ef3,null));};exports[_0x6ed3('0x3e')]=function(_0x252e76,_0x4d419a){var _0x47e427={'raw':![],'where':{}};var _0x4bdce1={};var _0x1d79e3={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x6ed3('0x3f')]({'where':{'id':_0x252e76[_0x6ed3('0x2d')]['id']}})['then'](handleEntityNotFound(_0x4d419a,null))['then'](function(_0x4c445b){if(_0x4c445b){_0x4bdce1[_0x6ed3('0x31')]=_[_0x6ed3('0x2e')](db[_0x6ed3('0x3b')][_0x6ed3('0x22')]);_0x4bdce1['query']=_[_0x6ed3('0x2e')](_0x252e76[_0x6ed3('0x28')]);_0x4bdce1[_0x6ed3('0x2f')]=_[_0x6ed3('0x30')](_0x4bdce1[_0x6ed3('0x31')],_0x4bdce1[_0x6ed3('0x28')]);_0x47e427[_0x6ed3('0x33')]=_['intersection'](_0x4bdce1[_0x6ed3('0x31')],qs[_0x6ed3('0x32')](_0x252e76['query']['fields']));_0x47e427[_0x6ed3('0x33')]=_0x47e427[_0x6ed3('0x33')]['length']?_0x47e427[_0x6ed3('0x33')]:_0x4bdce1[_0x6ed3('0x31')];if(!_0x252e76['query']['hasOwnProperty'](_0x6ed3('0x40'))){_0x47e427[_0x6ed3('0x16')]=qs[_0x6ed3('0x16')](_0x252e76[_0x6ed3('0x28')][_0x6ed3('0x16')]);_0x47e427[_0x6ed3('0x41')]=qs['offset'](_0x252e76[_0x6ed3('0x28')][_0x6ed3('0x41')]);}_0x47e427['order']=qs[_0x6ed3('0x42')](_0x252e76[_0x6ed3('0x28')]['sort']);_0x47e427[_0x6ed3('0x43')]=qs[_0x6ed3('0x2f')](_['pick'](_0x252e76[_0x6ed3('0x28')],_0x4bdce1[_0x6ed3('0x2f')]));_0x47e427[_0x6ed3('0x43')]['OpenchannelInteractionId']=_0x4c445b['id'];if(_0x252e76[_0x6ed3('0x28')][_0x6ed3('0x44')]){_0x47e427['where']=_[_0x6ed3('0x35')](_0x47e427[_0x6ed3('0x43')],{'$or':_['map'](_0x47e427['attributes'],function(_0x1c777c){var _0x31590e={};_0x31590e[_0x1c777c]={'$like':'%'+_0x252e76[_0x6ed3('0x28')]['filter']+'%'};return _0x31590e;})});}if(_0x252e76['query'][_0x6ed3('0x45')]){var _0x56b004=_0x252e76[_0x6ed3('0x28')][_0x6ed3('0x45')][_0x6ed3('0x46')](',');var _0x1ec616={};_0x1ec616[_0x56b004[0x0]]={'$gte':moment(_0x56b004[0x1])['format'](_0x6ed3('0x47'))};_0x47e427[_0x6ed3('0x43')]=_[_0x6ed3('0x35')](_0x47e427[_0x6ed3('0x43')],_0x1ec616);}_0x47e427=_[_0x6ed3('0x35')]({},_0x47e427,_0x252e76[_0x6ed3('0x36')]);return db[_0x6ed3('0x3b')][_0x6ed3('0x15')]({'where':_0x47e427[_0x6ed3('0x43')]})['then'](function(_0xee934e){_0x1d79e3['count']=_0xee934e;if(_0x252e76[_0x6ed3('0x28')]['includeAll']){_0x47e427['include']=[{'all':!![]}];}return db[_0x6ed3('0x3b')][_0x6ed3('0x27')](_0x47e427);})['then'](function(_0x483772){_0x1d79e3[_0x6ed3('0x48')]=_0x483772;return _0x1d79e3;});}})[_0x6ed3('0x1a')](respondWithFilteredResult(_0x4d419a,_0x47e427))[_0x6ed3('0x2a')](handleError(_0x4d419a,null));};exports[_0x6ed3('0x49')]=function(_0xe47872,_0x2a6868){return db[_0x6ed3('0x21')]['find']({'where':{'id':_0xe47872[_0x6ed3('0x2d')]['id']}})[_0x6ed3('0x1a')](handleEntityNotFound(_0x2a6868,null))['then'](function(_0x3684e5){if(_0x3684e5){return _0x3684e5[_0x6ed3('0x4a')](_0xe47872[_0x6ed3('0x38')][_0x6ed3('0x3c')],_[_0x6ed3('0x3d')](_0xe47872[_0x6ed3('0x38')],['ids','id'])||{})[_0x6ed3('0x4b')](function(){return db['Tag']['findAll']({'attributes':['id','name','color'],'where':{'id':_0xe47872['body'][_0x6ed3('0x3c')]}});})['then'](function(_0x51f66a){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0xe47872[_0x6ed3('0x2d')]['id']),'tags':_0x51f66a||[]});return{'id':Number(_0xe47872['params']['id']),'tags':_0x51f66a||[]};});}})[_0x6ed3('0x1a')](respondWithResult(_0x2a6868,null))['catch'](handleError(_0x2a6868,null));};exports[_0x6ed3('0x4c')]=function(_0x3e13a6,_0x400a57){return db['OpenchannelInteraction']['find']({'where':{'id':_0x3e13a6[_0x6ed3('0x2d')]['id']}})[_0x6ed3('0x1a')](handleEntityNotFound(_0x400a57,null))[_0x6ed3('0x1a')](function(_0x136c39){if(_0x136c39){return _0x136c39[_0x6ed3('0x4c')](_0x3e13a6[_0x6ed3('0x28')][_0x6ed3('0x3c')]);}})[_0x6ed3('0x1a')](respondWithStatusCode(_0x400a57,null))[_0x6ed3('0x2a')](handleError(_0x400a57,null));};exports[_0x6ed3('0x4d')]=function(_0x5e0a9e,_0x59d0dc){var _0x1e17b4=moment()[_0x6ed3('0x4e')]()['toString']();var _0x530e31=path[_0x6ed3('0x4f')](config[_0x6ed3('0x50')],_0x6ed3('0x51'),_0x6ed3('0x52'),_0x6ed3('0x53'));var _0x5b48fe=path['join'](config[_0x6ed3('0x50')],_0x6ed3('0x51'),_0x6ed3('0x52'),_0x6ed3('0x54'));var _0x381829=path[_0x6ed3('0x4f')](_0x530e31,_0x1e17b4);var _0xe193c8=util[_0x6ed3('0x55')](_0x6ed3('0x56'),_0x5e0a9e[_0x6ed3('0x2d')]['id'],_0x1e17b4);var _0x4ee158=path[_0x6ed3('0x4f')](_0x530e31,_0xe193c8);var _0x514a46=[];_0x514a46[_0x6ed3('0x57')]({'model':db[_0x6ed3('0x58')],'as':_0x6ed3('0x58'),'attributes':['id',_0x6ed3('0x59')],'raw':!![]});_0x514a46[_0x6ed3('0x57')]({'model':db[_0x6ed3('0x5a')],'as':'Contact','attributes':['id',_0x6ed3('0x5b'),_0x6ed3('0x5c')],'raw':!![]});if(_0x5e0a9e[_0x6ed3('0x28')][_0x6ed3('0x54')]){_0x514a46[_0x6ed3('0x57')]({'model':db['Attachment'],'as':_0x6ed3('0x5d'),'raw':!![]});}var _0x372362=[{'model':db[_0x6ed3('0x3b')],'as':_0x6ed3('0x5e'),'attributes':['id',_0x6ed3('0x38'),'createdAt',_0x6ed3('0x5f'),_0x6ed3('0x60'),'read'],'include':_0x514a46}];_0x372362['push']({'model':db[_0x6ed3('0x61')],'as':'Account','attributes':['id',_0x6ed3('0x1e')]});_0x372362['push']({'model':db['User'],'as':_0x6ed3('0x62'),'attributes':['id',_0x6ed3('0x59')]});return db[_0x6ed3('0x21')][_0x6ed3('0x37')]({'where':{'id':_0x5e0a9e[_0x6ed3('0x2d')]['id']},'include':_0x372362})[_0x6ed3('0x1a')](handleEntityNotFound(_0x59d0dc,null))[_0x6ed3('0x1a')](function(_0x1e4651){if(_0x1e4651){var _0x34ad79=_0x1e4651['get']({'plain':!![]});fs[_0x6ed3('0x63')](_0x381829);var _0x140288={'channel':_0x6ed3('0x64'),'account':_0x34ad79[_0x6ed3('0x65')][_0x6ed3('0x1e')],'agent':_0x34ad79[_0x6ed3('0x62')]?_0x34ad79[_0x6ed3('0x62')][_0x6ed3('0x59')]:_0x6ed3('0x66'),'createdAt':moment(_0x34ad79[_0x6ed3('0x67')])[_0x6ed3('0x55')](_0x6ed3('0x47'))[_0x6ed3('0x68')](),'closedAt':_0x34ad79['closed']?moment(_0x34ad79['closedAt'])[_0x6ed3('0x55')](_0x6ed3('0x47'))[_0x6ed3('0x68')]():'','disposition':_0x34ad79[_0x6ed3('0x69')],'visibility':_0x34ad79[_0x6ed3('0x6a')]?_0x6ed3('0x6b'):_0x6ed3('0x6c'),'messages':_(_0x34ad79[_0x6ed3('0x5e')])[_0x6ed3('0x44')]({'secret':![]})[_0x6ed3('0x20')](function(_0x3ff62b){if(_0x3ff62b[_0x6ed3('0x5d')]){var _0x31a6d2=path[_0x6ed3('0x4f')](_0x5b48fe,_0x3ff62b[_0x6ed3('0x5d')][_0x6ed3('0x6d')]);if(fs['existsSync'](_0x31a6d2)){fs[_0x6ed3('0x6e')](_0x31a6d2)[_0x6ed3('0x6f')](fs[_0x6ed3('0x70')](path[_0x6ed3('0x4f')](_0x381829,_0x3ff62b[_0x6ed3('0x5d')][_0x6ed3('0x6d')])));}}return{'date':moment(_0x3ff62b[_0x6ed3('0x67')])[_0x6ed3('0x55')](_0x6ed3('0x47'))[_0x6ed3('0x68')](),'sender':_0x3ff62b[_0x6ed3('0x5f')]===_0x6ed3('0x71')?_0x3ff62b[_0x6ed3('0x58')]?_0x3ff62b[_0x6ed3('0x58')][_0x6ed3('0x59')]:_0x6ed3('0x72'):_0x3ff62b['Contact'][_0x6ed3('0x5b')]+(_0x3ff62b[_0x6ed3('0x73')][_0x6ed3('0x5c')]?'\x20'+_0x3ff62b['Contact'][_0x6ed3('0x5c')]:''),'body':_0x3ff62b['Attachment']?_0x3ff62b[_0x6ed3('0x5d')][_0x6ed3('0x6d')]:_0x3ff62b['body'],'direction':_0x3ff62b['direction']==='out'?'A':'C','secret':_0x3ff62b[_0x6ed3('0x60')],'read':_0x3ff62b[_0x6ed3('0x74')],'attachment':_0x3ff62b['Attachment']};})[_0x6ed3('0x75')]()};return ejs[_0x6ed3('0x76')](path[_0x6ed3('0x4f')](config[_0x6ed3('0x50')],_0x6ed3('0x51'),_0x6ed3('0x77'),'downloadInteraction.ejs'),{'interaction':_0x140288})[_0x6ed3('0x1a')](function(_0x2839a9){var _0x36f06b=path[_0x6ed3('0x4f')](_0x381829,_0x6ed3('0x78')+_0x34ad79['id']+'-'+_0x1e17b4+_0x6ed3('0x79'));var _0x57c6c8={'path':_0x36f06b,'channel':_0x6ed3('0x64'),'interactionId':_0x34ad79['id']};return pdf[_0x6ed3('0x7a')](_0x2839a9,_0x57c6c8);})['then'](function(){return new Promise(function(_0x732dd8,_0x18d802){zipdir(_0x381829,{'saveTo':_0x4ee158},function(_0x5ebdfb,_0x91ce80){if(_0x5ebdfb)return _0x18d802(_0x5ebdfb);return _0x732dd8(_0x91ce80);});})['then'](function(){return new Promise(function(_0x5860e7,_0x2034b9){rimraf(_0x381829,function(_0x29be27){if(_0x29be27)_0x2034b9(_0x29be27);return _0x5860e7();});});})[_0x6ed3('0x1a')](function(){return _0x59d0dc[_0x6ed3('0x4d')](_0x4ee158,_0xe193c8,function(_0x9acc3f){if(_0x9acc3f){logger[_0x6ed3('0x1c')](_0x6ed3('0x7b'),_0x9acc3f);}else{fs[_0x6ed3('0x7c')](_0x4ee158);}});});});}else{return _0x59d0dc['sendStatus'](0xc8);}})[_0x6ed3('0x2a')](handleError(_0x59d0dc,null));}; \ No newline at end of file +var _0xc07d=['emit','openchannelInteractionTags:save','removeTags','unix','toString','server','files','tmp','join','root','attachments','format','transcript-%d-%s.zip','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','direction','secret','push','OpenchannelAccount','Account','get','Openchannel','Owner','N.A.','createdAt','closed','threadId','Public','Private','basename','createReadStream','createWriteStream','out','System','read','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','download','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','zip-dir','moment','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','openchannel','query','user','catch','show','from','model','keys','attributes','fields','includeAll','include','options','find','create','body','params','describe','OpenchannelMessage','ids','getMessages','findOne','filters','intersection','length','hasOwnProperty','order','sort','where','OpenchannelInteractionId','merge','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','spread','Tag','findAll','color'];(function(_0x416c20,_0x93585d){var _0x2ca7ec=function(_0x1d64a7){while(--_0x1d64a7){_0x416c20['push'](_0x416c20['shift']());}};_0x2ca7ec(++_0x93585d);}(_0xc07d,0xb4));var _0xdc07=function(_0x496343,_0x1cd4cc){_0x496343=_0x496343-0x0;var _0x245e20=_0xc07d[_0x496343];return _0x245e20;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xdc07('0x0'));var moment=require(_0xdc07('0x1'));var util=require(_0xdc07('0x2'));var path=require(_0xdc07('0x3'));var ejs=require(_0xdc07('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xdc07('0x5'));var interaction=require(_0xdc07('0x6'));var qs=require(_0xdc07('0x7'));var pdf=require(_0xdc07('0x8'));var logger=require(_0xdc07('0x9'))(_0xdc07('0xa'));var config=require(_0xdc07('0xb'));var db=require(_0xdc07('0xc'))['db'];config['redis']=_[_0xdc07('0xd')](config[_0xdc07('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xdc07('0xf'))(new Redis(config['redis']));require(_0xdc07('0x10'))['register'](socket);function respondWithStatusCode(_0x388fbb,_0x3daa89){_0x3daa89=_0x3daa89||0xcc;return function(_0x5117ae){if(_0x5117ae){return _0x388fbb[_0xdc07('0x11')](_0x3daa89);}return _0x388fbb[_0xdc07('0x12')](_0x3daa89)[_0xdc07('0x13')]();};}function respondWithResult(_0x2ab50c,_0x381764){_0x381764=_0x381764||0xc8;return function(_0x42c8d2){if(_0x42c8d2){return _0x2ab50c[_0xdc07('0x12')](_0x381764)[_0xdc07('0x14')](_0x42c8d2);}};}function respondWithFilteredResult(_0x35a788,_0x4e6fc5){return function(_0x160262){if(_0x160262){var _0x2a9f56=typeof _0x4e6fc5[_0xdc07('0x15')]===_0xdc07('0x16')&&typeof _0x4e6fc5[_0xdc07('0x17')]===_0xdc07('0x16');var _0x201dc6=_0x160262[_0xdc07('0x18')];var _0x3dd71b=_0x2a9f56?0x0:_0x4e6fc5[_0xdc07('0x15')];var _0x5941a2=_0x2a9f56?_0x160262['count']:_0x4e6fc5[_0xdc07('0x15')]+_0x4e6fc5[_0xdc07('0x17')];var _0x5478b7;if(_0x5941a2>=_0x201dc6){_0x5941a2=_0x201dc6;_0x5478b7=0xc8;}else{_0x5478b7=0xce;}_0x35a788[_0xdc07('0x12')](_0x5478b7);return _0x35a788['set'](_0xdc07('0x19'),_0x3dd71b+'-'+_0x5941a2+'/'+_0x201dc6)[_0xdc07('0x14')](_0x160262);}return null;};}function saveUpdates(_0x52cd16){return function(_0x1f8788){if(_0x1f8788){return _0x1f8788[_0xdc07('0x1a')](_0x52cd16)[_0xdc07('0x1b')](function(_0x79882b){return _0x79882b;});}return null;};}function removeEntity(_0x4110d2){return function(_0x16e2e2){if(_0x16e2e2){return _0x16e2e2[_0xdc07('0x1c')]()[_0xdc07('0x1b')](function(){_0x4110d2[_0xdc07('0x12')](0xcc)[_0xdc07('0x13')]();});}};}function handleEntityNotFound(_0x1a560c){return function(_0x1338f8){if(!_0x1338f8){_0x1a560c['sendStatus'](0x194);}return _0x1338f8;};}function handleError(_0x51d104,_0x216f46){_0x216f46=_0x216f46||0x1f4;return function(_0x101de4){logger[_0xdc07('0x1d')](_0x101de4[_0xdc07('0x1e')]);if(_0x101de4[_0xdc07('0x1f')]){delete _0x101de4[_0xdc07('0x1f')];}_0x51d104[_0xdc07('0x12')](_0x216f46)[_0xdc07('0x20')](_0x101de4);};}exports[_0xdc07('0x21')]=function(_0x4be767,_0x1cc0f3){var _0x46e1a1={};var _0x25d43f=_[_0xdc07('0x22')](db[_0xdc07('0x23')][_0xdc07('0x24')],function(_0x5a948a){return{'name':_0x5a948a[_0xdc07('0x25')],'type':_0x5a948a[_0xdc07('0x26')][_0xdc07('0x27')]};});_0x46e1a1=qs[_0xdc07('0x28')](_0x25d43f,_0x4be767);return interaction['findAll'](_0xdc07('0x29'),_0x4be767[_0xdc07('0x2a')],_0x4be767[_0xdc07('0x2b')],_0x46e1a1,_0x25d43f)[_0xdc07('0x1b')](respondWithFilteredResult(_0x1cc0f3,_0x46e1a1))[_0xdc07('0x2c')](handleError(_0x1cc0f3,null));};exports[_0xdc07('0x2d')]=function(_0x331cd6,_0x30c6f7){var _0x4df80b={};if(_0x331cd6[_0xdc07('0x2a')]['type']&&_0x331cd6[_0xdc07('0x2a')]['type']===_0xdc07('0x2e')){_0x4df80b[_0xdc07('0x2e')]=_0x331cd6['params']['id'];}else{_0x4df80b['id']=_0x331cd6['params']['id'];}var _0xc41fd9={'raw':![],'where':_0x4df80b},_0xf372cd={};_0xf372cd[_0xdc07('0x2f')]=_[_0xdc07('0x30')](db[_0xdc07('0x23')]['rawAttributes']);_0xf372cd[_0xdc07('0x2a')]=_[_0xdc07('0x30')](_0x331cd6[_0xdc07('0x2a')]);_0xf372cd['filters']=_['intersection'](_0xf372cd[_0xdc07('0x2f')],_0xf372cd[_0xdc07('0x2a')]);_0xc41fd9[_0xdc07('0x31')]=_['intersection'](_0xf372cd['model'],qs[_0xdc07('0x32')](_0x331cd6['query'][_0xdc07('0x32')]));_0xc41fd9[_0xdc07('0x31')]=_0xc41fd9[_0xdc07('0x31')]['length']?_0xc41fd9['attributes']:_0xf372cd[_0xdc07('0x2f')];if(_0x331cd6[_0xdc07('0x2a')][_0xdc07('0x33')]){_0xc41fd9[_0xdc07('0x34')]=[{'all':!![]}];}_0xc41fd9=_['merge']({},_0xc41fd9,_0x331cd6[_0xdc07('0x35')]);return db[_0xdc07('0x23')][_0xdc07('0x36')](_0xc41fd9)[_0xdc07('0x1b')](handleEntityNotFound(_0x30c6f7,null))['then'](respondWithResult(_0x30c6f7,null))[_0xdc07('0x2c')](handleError(_0x30c6f7,null));};exports[_0xdc07('0x37')]=function(_0x281a78,_0x4b2dd6){return db['OpenchannelInteraction']['create'](_0x281a78[_0xdc07('0x38')],{})['then'](respondWithResult(_0x4b2dd6,0xc9))[_0xdc07('0x2c')](handleError(_0x4b2dd6,null));};exports['update']=function(_0xc270bc,_0x1ee880){if(_0xc270bc[_0xdc07('0x38')]['id']){delete _0xc270bc[_0xdc07('0x38')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0xc270bc[_0xdc07('0x39')]['id']}})[_0xdc07('0x1b')](handleEntityNotFound(_0x1ee880,null))['then'](saveUpdates(_0xc270bc[_0xdc07('0x38')],null))[_0xdc07('0x1b')](respondWithResult(_0x1ee880,null))[_0xdc07('0x2c')](handleError(_0x1ee880,null));};exports['destroy']=function(_0x59e8df,_0x153bb1){return db[_0xdc07('0x23')]['find']({'where':{'id':_0x59e8df[_0xdc07('0x39')]['id']}})[_0xdc07('0x1b')](handleEntityNotFound(_0x153bb1,null))[_0xdc07('0x1b')](removeEntity(_0x153bb1,null))[_0xdc07('0x2c')](handleError(_0x153bb1,null));};exports[_0xdc07('0x3a')]=function(_0x391c1f,_0x2d072c){return db[_0xdc07('0x23')][_0xdc07('0x3a')]()[_0xdc07('0x1b')](respondWithResult(_0x2d072c,null))[_0xdc07('0x2c')](handleError(_0x2d072c,null));};exports['addMessage']=function(_0x3a939d,_0x314ef8){return db[_0xdc07('0x3b')]['find']({'where':{'id':_0x3a939d[_0xdc07('0x39')]['id']}})[_0xdc07('0x1b')](handleEntityNotFound(_0x314ef8,null))[_0xdc07('0x1b')](function(_0xc959f){if(_0xc959f){return _0xc959f['addMessage'](_0x3a939d[_0xdc07('0x38')][_0xdc07('0x3c')],_['omit'](_0x3a939d[_0xdc07('0x38')],[_0xdc07('0x3c'),'id'])||{});}})[_0xdc07('0x1b')](respondWithResult(_0x314ef8,null))[_0xdc07('0x2c')](handleError(_0x314ef8,null));};exports[_0xdc07('0x3d')]=function(_0x1f8d25,_0x3b7cf4){var _0x1cb7cd={'raw':![],'where':{}};var _0x275f02={};var _0x3810f8={'count':0x0,'rows':[]};return db[_0xdc07('0x23')][_0xdc07('0x3e')]({'where':{'id':_0x1f8d25[_0xdc07('0x39')]['id']}})[_0xdc07('0x1b')](handleEntityNotFound(_0x3b7cf4,null))['then'](function(_0x1e6f2e){if(_0x1e6f2e){_0x275f02[_0xdc07('0x2f')]=_[_0xdc07('0x30')](db['OpenchannelMessage'][_0xdc07('0x24')]);_0x275f02[_0xdc07('0x2a')]=_[_0xdc07('0x30')](_0x1f8d25[_0xdc07('0x2a')]);_0x275f02[_0xdc07('0x3f')]=_[_0xdc07('0x40')](_0x275f02['model'],_0x275f02[_0xdc07('0x2a')]);_0x1cb7cd[_0xdc07('0x31')]=_['intersection'](_0x275f02['model'],qs[_0xdc07('0x32')](_0x1f8d25['query']['fields']));_0x1cb7cd[_0xdc07('0x31')]=_0x1cb7cd[_0xdc07('0x31')][_0xdc07('0x41')]?_0x1cb7cd[_0xdc07('0x31')]:_0x275f02[_0xdc07('0x2f')];if(!_0x1f8d25[_0xdc07('0x2a')][_0xdc07('0x42')]('nolimit')){_0x1cb7cd['limit']=qs[_0xdc07('0x17')](_0x1f8d25[_0xdc07('0x2a')][_0xdc07('0x17')]);_0x1cb7cd[_0xdc07('0x15')]=qs[_0xdc07('0x15')](_0x1f8d25[_0xdc07('0x2a')]['offset']);}_0x1cb7cd[_0xdc07('0x43')]=qs[_0xdc07('0x44')](_0x1f8d25[_0xdc07('0x2a')][_0xdc07('0x44')]);_0x1cb7cd[_0xdc07('0x45')]=qs[_0xdc07('0x3f')](_['pick'](_0x1f8d25[_0xdc07('0x2a')],_0x275f02[_0xdc07('0x3f')]));_0x1cb7cd[_0xdc07('0x45')][_0xdc07('0x46')]=_0x1e6f2e['id'];if(_0x1f8d25['query']['filter']){_0x1cb7cd[_0xdc07('0x45')]=_[_0xdc07('0x47')](_0x1cb7cd[_0xdc07('0x45')],{'$or':_[_0xdc07('0x22')](_0x1cb7cd[_0xdc07('0x31')],function(_0x23638d){var _0x534d77={};_0x534d77[_0x23638d]={'$like':'%'+_0x1f8d25['query'][_0xdc07('0x48')]+'%'};return _0x534d77;})});}if(_0x1f8d25['query'][_0xdc07('0x49')]){var _0x5bd651=_0x1f8d25[_0xdc07('0x2a')][_0xdc07('0x49')][_0xdc07('0x4a')](',');var _0x89d8f9={};_0x89d8f9[_0x5bd651[0x0]]={'$gte':moment(_0x5bd651[0x1])['format'](_0xdc07('0x4b'))};_0x1cb7cd[_0xdc07('0x45')]=_['merge'](_0x1cb7cd[_0xdc07('0x45')],_0x89d8f9);}_0x1cb7cd=_[_0xdc07('0x47')]({},_0x1cb7cd,_0x1f8d25[_0xdc07('0x35')]);return db[_0xdc07('0x3b')][_0xdc07('0x18')]({'where':_0x1cb7cd['where']})[_0xdc07('0x1b')](function(_0x3b1a67){_0x3810f8[_0xdc07('0x18')]=_0x3b1a67;if(_0x1f8d25[_0xdc07('0x2a')][_0xdc07('0x33')]){_0x1cb7cd[_0xdc07('0x34')]=[{'all':!![]}];}return db[_0xdc07('0x3b')]['findAll'](_0x1cb7cd);})['then'](function(_0x565d5d){_0x3810f8[_0xdc07('0x4c')]=_0x565d5d;return _0x3810f8;});}})[_0xdc07('0x1b')](respondWithFilteredResult(_0x3b7cf4,_0x1cb7cd))[_0xdc07('0x2c')](handleError(_0x3b7cf4,null));};exports[_0xdc07('0x4d')]=function(_0x9efe36,_0x163740){return db['OpenchannelInteraction'][_0xdc07('0x36')]({'where':{'id':_0x9efe36[_0xdc07('0x39')]['id']}})['then'](handleEntityNotFound(_0x163740,null))[_0xdc07('0x1b')](function(_0x491565){if(_0x491565){return _0x491565[_0xdc07('0x4e')](_0x9efe36[_0xdc07('0x38')][_0xdc07('0x3c')],_[_0xdc07('0x4f')](_0x9efe36['body'],[_0xdc07('0x3c'),'id'])||{})[_0xdc07('0x50')](function(){return db[_0xdc07('0x51')][_0xdc07('0x52')]({'attributes':['id',_0xdc07('0x1f'),_0xdc07('0x53')],'where':{'id':_0x9efe36[_0xdc07('0x38')]['ids']}});})[_0xdc07('0x1b')](function(_0x3114e1){socket[_0xdc07('0x54')](_0xdc07('0x55'),{'id':Number(_0x9efe36[_0xdc07('0x39')]['id']),'tags':_0x3114e1||[]});return{'id':Number(_0x9efe36[_0xdc07('0x39')]['id']),'tags':_0x3114e1||[]};});}})['then'](respondWithResult(_0x163740,null))[_0xdc07('0x2c')](handleError(_0x163740,null));};exports[_0xdc07('0x56')]=function(_0x3ff8c4,_0x42bf32){return db[_0xdc07('0x23')][_0xdc07('0x36')]({'where':{'id':_0x3ff8c4['params']['id']}})[_0xdc07('0x1b')](handleEntityNotFound(_0x42bf32,null))[_0xdc07('0x1b')](function(_0x12aced){if(_0x12aced){return _0x12aced[_0xdc07('0x56')](_0x3ff8c4[_0xdc07('0x2a')]['ids']);}})['then'](respondWithStatusCode(_0x42bf32,null))[_0xdc07('0x2c')](handleError(_0x42bf32,null));};exports['download']=function(_0x56acf3,_0xe6a00a){var _0x22667c=moment()[_0xdc07('0x57')]()[_0xdc07('0x58')]();var _0x5a5a8e=path['join'](config['root'],_0xdc07('0x59'),_0xdc07('0x5a'),_0xdc07('0x5b'));var _0xb03e74=path[_0xdc07('0x5c')](config[_0xdc07('0x5d')],_0xdc07('0x59'),_0xdc07('0x5a'),_0xdc07('0x5e'));var _0x1d0647=path['join'](_0x5a5a8e,_0x22667c);var _0x57dfd9=util[_0xdc07('0x5f')](_0xdc07('0x60'),_0x56acf3[_0xdc07('0x39')]['id'],_0x22667c);var _0xa67eb9=path['join'](_0x5a5a8e,_0x57dfd9);var _0x4f4be0=[];_0x4f4be0['push']({'model':db[_0xdc07('0x61')],'as':_0xdc07('0x61'),'attributes':['id',_0xdc07('0x62')],'raw':!![]});_0x4f4be0['push']({'model':db[_0xdc07('0x63')],'as':_0xdc07('0x64'),'attributes':['id',_0xdc07('0x65'),_0xdc07('0x66')],'raw':!![]});if(_0x56acf3[_0xdc07('0x2a')][_0xdc07('0x5e')]){_0x4f4be0['push']({'model':db[_0xdc07('0x67')],'as':_0xdc07('0x67'),'raw':!![]});}var _0x48e87a=[{'model':db['OpenchannelMessage'],'as':_0xdc07('0x68'),'attributes':['id',_0xdc07('0x38'),'createdAt',_0xdc07('0x69'),_0xdc07('0x6a'),'read'],'include':_0x4f4be0}];_0x48e87a[_0xdc07('0x6b')]({'model':db[_0xdc07('0x6c')],'as':_0xdc07('0x6d'),'attributes':['id',_0xdc07('0x1f')]});_0x48e87a[_0xdc07('0x6b')]({'model':db[_0xdc07('0x61')],'as':'Owner','attributes':['id',_0xdc07('0x62')]});return db['OpenchannelInteraction'][_0xdc07('0x36')]({'where':{'id':_0x56acf3[_0xdc07('0x39')]['id']},'include':_0x48e87a})['then'](handleEntityNotFound(_0xe6a00a,null))[_0xdc07('0x1b')](function(_0x174b9f){if(_0x174b9f){var _0x169f91=_0x174b9f[_0xdc07('0x6e')]({'plain':!![]});fs['mkdirSync'](_0x1d0647);var _0x5205be={'channel':_0xdc07('0x6f'),'account':_0x169f91[_0xdc07('0x6d')]['name'],'agent':_0x169f91[_0xdc07('0x70')]?_0x169f91[_0xdc07('0x70')][_0xdc07('0x62')]:_0xdc07('0x71'),'createdAt':moment(_0x169f91[_0xdc07('0x72')])[_0xdc07('0x5f')](_0xdc07('0x4b'))[_0xdc07('0x58')](),'closedAt':_0x169f91[_0xdc07('0x73')]?moment(_0x169f91['closedAt'])[_0xdc07('0x5f')](_0xdc07('0x4b'))[_0xdc07('0x58')]():'','disposition':_0x169f91['disposition'],'visibility':_0x169f91[_0xdc07('0x74')]?_0xdc07('0x75'):_0xdc07('0x76'),'messages':_(_0x169f91[_0xdc07('0x68')])[_0xdc07('0x48')]({'secret':![]})[_0xdc07('0x22')](function(_0x44e515){if(_0x44e515[_0xdc07('0x67')]){var _0x36cccd=path[_0xdc07('0x5c')](_0xb03e74,_0x44e515[_0xdc07('0x67')][_0xdc07('0x77')]);if(fs['existsSync'](_0x36cccd)){fs[_0xdc07('0x78')](_0x36cccd)['pipe'](fs[_0xdc07('0x79')](path[_0xdc07('0x5c')](_0x1d0647,_0x44e515[_0xdc07('0x67')][_0xdc07('0x77')])));}}return{'date':moment(_0x44e515[_0xdc07('0x72')])[_0xdc07('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')[_0xdc07('0x58')](),'sender':_0x44e515[_0xdc07('0x69')]===_0xdc07('0x7a')?_0x44e515['User']?_0x44e515[_0xdc07('0x61')][_0xdc07('0x62')]:_0xdc07('0x7b'):_0x44e515['Contact'][_0xdc07('0x65')]+(_0x44e515[_0xdc07('0x64')][_0xdc07('0x66')]?'\x20'+_0x44e515[_0xdc07('0x64')]['lastName']:''),'body':_0x44e515['Attachment']?_0x44e515[_0xdc07('0x67')][_0xdc07('0x77')]:_0x44e515[_0xdc07('0x38')],'direction':_0x44e515['direction']===_0xdc07('0x7a')?'A':'C','secret':_0x44e515[_0xdc07('0x6a')],'read':_0x44e515[_0xdc07('0x7c')],'attachment':_0x44e515[_0xdc07('0x67')]};})['value']()};return ejs[_0xdc07('0x7d')](path[_0xdc07('0x5c')](config[_0xdc07('0x5d')],_0xdc07('0x59'),'views',_0xdc07('0x7e')),{'interaction':_0x5205be})['then'](function(_0xce37b8){var _0x44bd8a=path[_0xdc07('0x5c')](_0x1d0647,'transcript-'+_0x169f91['id']+'-'+_0x22667c+_0xdc07('0x7f'));var _0x96dcfe={'path':_0x44bd8a,'channel':_0xdc07('0x6f'),'interactionId':_0x169f91['id']};return pdf[_0xdc07('0x80')](_0xce37b8,_0x96dcfe);})['then'](function(){return new Promise(function(_0x5a0b44,_0x17f212){zipdir(_0x1d0647,{'saveTo':_0xa67eb9},function(_0x304b99,_0x1c53f3){if(_0x304b99)return _0x17f212(_0x304b99);return _0x5a0b44(_0x1c53f3);});})[_0xdc07('0x1b')](function(){return new Promise(function(_0x51f9a1,_0x513e04){rimraf(_0x1d0647,function(_0x5c0573){if(_0x5c0573)_0x513e04(_0x5c0573);return _0x51f9a1();});});})[_0xdc07('0x1b')](function(){return _0xe6a00a[_0xdc07('0x81')](_0xa67eb9,_0x57dfd9,function(_0x83b842){if(_0x83b842){logger[_0xdc07('0x1d')](_0xdc07('0x82'),_0x83b842);}else{fs[_0xdc07('0x83')](_0xa67eb9);}});});});}else{return _0xe6a00a[_0xdc07('0x11')](0xc8);}})[_0xdc07('0x2c')](handleError(_0xe6a00a,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 954b837..e7af9ec 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 _0xaafc=['catch','hasOwnProperty','exports','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','update','getUsers','then','map','findAll','emit'];(function(_0x74d12d,_0x1970a1){var _0x325250=function(_0x126e57){while(--_0x126e57){_0x74d12d['push'](_0x74d12d['shift']());}};_0x325250(++_0x1970a1);}(_0xaafc,0xff));var _0xcaaf=function(_0x4ba1fe,_0x1c4c1d){_0x4ba1fe=_0x4ba1fe-0x0;var _0xa7a837=_0xaafc[_0x4ba1fe];return _0xa7a837;};'use strict';var EventEmitter=require(_0xcaaf('0x0'));var OpenchannelInteraction=require(_0xcaaf('0x1'))['db'][_0xcaaf('0x2')];var OpenchannelMessage=require(_0xcaaf('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xcaaf('0x3')](0x0);var events={'afterCreate':_0xcaaf('0x4'),'afterUpdate':_0xcaaf('0x5'),'afterDestroy':'remove'};function emitEvent(_0x36017f){return function(_0x4b89c7,_0x54ec26,_0x4168e6){_0x4b89c7[_0xcaaf('0x6')]({'attributes':['id'],'raw':!![]})[_0xcaaf('0x7')](function(_0x4ce178){_0x4b89c7['setDataValue']('Users',_0x4ce178[_0xcaaf('0x8')](function(_0x190c30){return{'id':_0x190c30['id']};}));return OpenchannelMessage[_0xcaaf('0x9')]({'where':{'OpenchannelInteractionId':_0x4b89c7['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcaaf('0x7')](function(_0x5f1fd2){_0x4b89c7['setDataValue']('unreadMessages',_0x5f1fd2['length']);OpenchannelInteractionEvents[_0xcaaf('0xa')](_0x36017f+':'+_0x4b89c7['id'],_0x4b89c7);OpenchannelInteractionEvents[_0xcaaf('0xa')](_0x36017f,_0x4b89c7);_0x4168e6(null);})[_0xcaaf('0xb')](_0x4168e6(null));};}for(var e in events){if(events[_0xcaaf('0xc')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xcaaf('0xd')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x1153=['OpenchannelInteraction','setMaxListeners','save','remove','getUsers','then','setDataValue','map','length','emit','catch','hook','exports','events','../../mysqldb'];(function(_0x3f97d8,_0x4cd760){var _0x1b5aae=function(_0xfe3849){while(--_0xfe3849){_0x3f97d8['push'](_0x3f97d8['shift']());}};_0x1b5aae(++_0x4cd760);}(_0x1153,0xfd));var _0x3115=function(_0x1bc0de,_0x427edc){_0x1bc0de=_0x1bc0de-0x0;var _0x1abb21=_0x1153[_0x1bc0de];return _0x1abb21;};'use strict';var EventEmitter=require(_0x3115('0x0'));var OpenchannelInteraction=require(_0x3115('0x1'))['db'][_0x3115('0x2')];var OpenchannelMessage=require(_0x3115('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x3115('0x3')](0x0);var events={'afterCreate':_0x3115('0x4'),'afterUpdate':'update','afterDestroy':_0x3115('0x5')};function emitEvent(_0x6318cb){return function(_0x1dceed,_0x1352ea,_0x1b0e17){_0x1dceed[_0x3115('0x6')]({'attributes':['id'],'raw':!![]})[_0x3115('0x7')](function(_0x25efd4){_0x1dceed[_0x3115('0x8')]('Users',_0x25efd4[_0x3115('0x9')](function(_0x3576f2){return{'id':_0x3576f2['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x1dceed['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3115('0x7')](function(_0x11a7b2){_0x1dceed[_0x3115('0x8')]('unreadMessages',_0x11a7b2[_0x3115('0xa')]);OpenchannelInteractionEvents[_0x3115('0xb')](_0x6318cb+':'+_0x1dceed['id'],_0x1dceed);OpenchannelInteractionEvents[_0x3115('0xb')](_0x6318cb,_0x1dceed);_0x1b0e17(null);})[_0x3115('0xc')](_0x1b0e17(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x3115('0xd')](e,emitEvent(event));}}module[_0x3115('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 2c68975..78b0fb1 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 _0x1d63=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x11a361,_0x227f16){var _0x488c43=function(_0x327c93){while(--_0x327c93){_0x11a361['push'](_0x11a361['shift']());}};_0x488c43(++_0x227f16);}(_0x1d63,0x144));var _0x31d6=function(_0x58c6b9,_0x901130){_0x58c6b9=_0x58c6b9-0x0;var _0xa03aeb=_0x1d63[_0x58c6b9];return _0xa03aeb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x31d6('0x0'))(_0x31d6('0x1'));var moment=require(_0x31d6('0x2'));var BPromise=require(_0x31d6('0x3'));var rp=require(_0x31d6('0x4'));var fs=require('fs');var path=require(_0x31d6('0x5'));var rimraf=require(_0x31d6('0x6'));var config=require(_0x31d6('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0x31d6('0x8')]=function(_0x27a344,_0xfef695){return _0x27a344[_0x31d6('0x9')](_0x31d6('0xa'),attributes,{'tableName':_0x31d6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x31d6('0xc'),'collate':_0x31d6('0xd'),'hooks':{'beforeUpdate':function(_0x5b9a1c,_0x35ec04,_0x394725){if(_0x5b9a1c[_0x31d6('0xe')]('closed')){_0x5b9a1c[_0x31d6('0xf')]=moment()[_0x31d6('0x10')](_0x31d6('0x11'));}_0x394725(null,_0x5b9a1c);}}});}; \ No newline at end of file +var _0x2ed7=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','define','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','changed','closed'];(function(_0x2609b0,_0xb15a19){var _0x454a98=function(_0x5f3abd){while(--_0x5f3abd){_0x2609b0['push'](_0x2609b0['shift']());}};_0x454a98(++_0xb15a19);}(_0x2ed7,0xdf));var _0x72ed=function(_0x267455,_0x25c3bf){_0x267455=_0x267455-0x0;var _0x20a188=_0x2ed7[_0x267455];return _0x20a188;};'use strict';var _=require(_0x72ed('0x0'));var util=require(_0x72ed('0x1'));var logger=require(_0x72ed('0x2'))(_0x72ed('0x3'));var moment=require(_0x72ed('0x4'));var BPromise=require(_0x72ed('0x5'));var rp=require(_0x72ed('0x6'));var fs=require('fs');var path=require(_0x72ed('0x7'));var rimraf=require(_0x72ed('0x8'));var config=require(_0x72ed('0x9'));var attributes=require(_0x72ed('0xa'));module['exports']=function(_0x361c78,_0x11b2a8){return _0x361c78[_0x72ed('0xb')](_0x72ed('0xc'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x72ed('0xd'),'collate':_0x72ed('0xe'),'hooks':{'beforeUpdate':function(_0x573a8d,_0x55c20d,_0x54cf7a){if(_0x573a8d[_0x72ed('0xf')](_0x72ed('0x10'))){_0x573a8d[_0x72ed('0x11')]=moment()[_0x72ed('0x12')](_0x72ed('0x13'));}_0x54cf7a(null,_0x573a8d);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index f229ea4..3f7c25f 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 _0x9cc8=['options','where','attributes','AddTagsToOpenchannelInteraction','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body'];(function(_0x5c948e,_0x237461){var _0x626fc2=function(_0x58de51){while(--_0x58de51){_0x5c948e['push'](_0x5c948e['shift']());}};_0x626fc2(++_0x237461);}(_0x9cc8,0xf2));var _0x89cc=function(_0x4e53e5,_0x27b3d0){_0x4e53e5=_0x4e53e5-0x0;var _0x287818=_0x9cc8[_0x4e53e5];return _0x287818;};'use strict';var _=require(_0x89cc('0x0'));var util=require(_0x89cc('0x1'));var moment=require(_0x89cc('0x2'));var BPromise=require(_0x89cc('0x3'));var rs=require(_0x89cc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x89cc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x89cc('0x6'))(_0x89cc('0x7'));var config=require(_0x89cc('0x8'));var jayson=require(_0x89cc('0x9'));var client=jayson[_0x89cc('0xa')][_0x89cc('0xb')]({'port':0x232a});config[_0x89cc('0xc')]=_[_0x89cc('0xd')](config[_0x89cc('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x89cc('0xe')](socket);function respondWithRpcPromise(_0x4f4b9a,_0x3d7afc,_0x119c00){return new BPromise(function(_0x4b64e4,_0x3df31b){return client[_0x89cc('0xf')](_0x4f4b9a,_0x119c00)[_0x89cc('0x10')](function(_0x55adbf){logger[_0x89cc('0x11')](_0x89cc('0x12'),_0x3d7afc,_0x89cc('0x13'));logger[_0x89cc('0x14')](_0x89cc('0x15'),_0x3d7afc,'request\x20sent',JSON[_0x89cc('0x16')](_0x55adbf));if(_0x55adbf[_0x89cc('0x17')]){if(_0x55adbf[_0x89cc('0x17')]['code']===0x1f4){logger[_0x89cc('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3d7afc,_0x55adbf[_0x89cc('0x17')][_0x89cc('0x18')]);return _0x3df31b(_0x55adbf[_0x89cc('0x17')]['message']);}logger['error'](_0x89cc('0x12'),_0x3d7afc,_0x55adbf[_0x89cc('0x17')]['message']);return _0x4b64e4(_0x55adbf['error']['message']);}else{logger[_0x89cc('0x11')](_0x89cc('0x12'),_0x3d7afc,_0x89cc('0x13'));_0x4b64e4(_0x55adbf[_0x89cc('0x19')][_0x89cc('0x18')]);}})[_0x89cc('0x1a')](function(_0x50793f){logger['error'](_0x89cc('0x12'),_0x3d7afc,_0x50793f);_0x3df31b(_0x50793f);});});}exports[_0x89cc('0x1b')]=function(_0x3bcf0c){var _0xf3aef4=this;return new Promise(function(_0x5eee79,_0x429d2d){return db[_0x89cc('0x1c')][_0x89cc('0x1d')](_0x3bcf0c[_0x89cc('0x1e')],{'raw':_0x3bcf0c['options']?_0x3bcf0c[_0x89cc('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bcf0c[_0x89cc('0x1f')]?_0x3bcf0c[_0x89cc('0x1f')][_0x89cc('0x20')]||null:null,'attributes':_0x3bcf0c[_0x89cc('0x1f')]?_0x3bcf0c['options'][_0x89cc('0x21')]||null:null,'limit':_0x3bcf0c[_0x89cc('0x1f')]?_0x3bcf0c[_0x89cc('0x1f')]['limit']||null:null})[_0x89cc('0x10')](function(_0x3aad00){logger[_0x89cc('0x11')](_0x89cc('0x1b'),_0x3bcf0c);logger[_0x89cc('0x14')](_0x89cc('0x1b'),_0x3bcf0c,JSON[_0x89cc('0x16')](_0x3aad00));_0x5eee79(_0x3aad00);})[_0x89cc('0x1a')](function(_0x5dcbba){logger[_0x89cc('0x17')]('UpdateOpenchannelInteraction',_0x5dcbba['message'],_0x3bcf0c);_0x429d2d(_0xf3aef4['error'](0x1f4,_0x5dcbba[_0x89cc('0x18')]));});});};exports[_0x89cc('0x22')]=function(_0x2ead52){return new Promise(function(_0x1d75b2,_0x44faf0){return db['OpenchannelInteraction']['find']({'where':_0x2ead52[_0x89cc('0x1f')]?_0x2ead52['options'][_0x89cc('0x20')]||null:null})[_0x89cc('0x10')](function(_0x37925a){if(_0x37925a){return _0x37925a[_0x89cc('0x23')](_0x2ead52[_0x89cc('0x1e')][_0x89cc('0x24')],_['omit'](_0x2ead52[_0x89cc('0x1e')],[_0x89cc('0x24'),'id'])||{});}})[_0x89cc('0x25')](function(_0x12ce31){logger[_0x89cc('0x11')]('AddTags',_0x2ead52);logger[_0x89cc('0x14')](_0x89cc('0x26'),_0x2ead52,JSON['stringify'](_0x12ce31));_0x1d75b2(_0x12ce31);})[_0x89cc('0x1a')](function(_0x4353f9){logger['error']('AddTags',_0x4353f9['message'],_0x2ead52);_0x44faf0(_this[_0x89cc('0x17')](0x1f4,_0x4353f9['message']));});});}; \ No newline at end of file +var _0x7d5b=['then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','attributes','limit','catch','AddTagsToOpenchannelInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./openchannelInteraction.socket','register','request'];(function(_0x3dda91,_0x5c7d75){var _0x413eab=function(_0x527a53){while(--_0x527a53){_0x3dda91['push'](_0x3dda91['shift']());}};_0x413eab(++_0x5c7d75);}(_0x7d5b,0xf0));var _0xb7d5=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x7d5b[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0xb7d5('0x0'));var util=require(_0xb7d5('0x1'));var moment=require(_0xb7d5('0x2'));var BPromise=require(_0xb7d5('0x3'));var rs=require(_0xb7d5('0x4'));var fs=require('fs');var Redis=require(_0xb7d5('0x5'));var db=require(_0xb7d5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7d5('0x7'))(_0xb7d5('0x8'));var config=require(_0xb7d5('0x9'));var jayson=require(_0xb7d5('0xa'));var client=jayson[_0xb7d5('0xb')][_0xb7d5('0xc')]({'port':0x232a});config[_0xb7d5('0xd')]=_['defaults'](config['redis'],{'host':_0xb7d5('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb7d5('0xd')]));require(_0xb7d5('0xf'))[_0xb7d5('0x10')](socket);function respondWithRpcPromise(_0x1d534a,_0x356055,_0x5ccc19){return new BPromise(function(_0x280d5a,_0x204de4){return client[_0xb7d5('0x11')](_0x1d534a,_0x5ccc19)[_0xb7d5('0x12')](function(_0x4af14b){logger[_0xb7d5('0x13')](_0xb7d5('0x14'),_0x356055,_0xb7d5('0x15'));logger[_0xb7d5('0x16')](_0xb7d5('0x17'),_0x356055,_0xb7d5('0x15'),JSON['stringify'](_0x4af14b));if(_0x4af14b[_0xb7d5('0x18')]){if(_0x4af14b['error'][_0xb7d5('0x19')]===0x1f4){logger[_0xb7d5('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x356055,_0x4af14b[_0xb7d5('0x18')]['message']);return _0x204de4(_0x4af14b[_0xb7d5('0x18')][_0xb7d5('0x1a')]);}logger[_0xb7d5('0x18')](_0xb7d5('0x14'),_0x356055,_0x4af14b['error'][_0xb7d5('0x1a')]);return _0x280d5a(_0x4af14b['error'][_0xb7d5('0x1a')]);}else{logger[_0xb7d5('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x356055,_0xb7d5('0x15'));_0x280d5a(_0x4af14b[_0xb7d5('0x1b')][_0xb7d5('0x1a')]);}})['catch'](function(_0x3a264a){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x356055,_0x3a264a);_0x204de4(_0x3a264a);});});}exports[_0xb7d5('0x1c')]=function(_0x4cdc67){var _0x1cc875=this;return new Promise(function(_0x2661fc,_0x3c586c){return db[_0xb7d5('0x1d')]['update'](_0x4cdc67[_0xb7d5('0x1e')],{'raw':_0x4cdc67['options']?_0x4cdc67[_0xb7d5('0x1f')][_0xb7d5('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cdc67[_0xb7d5('0x1f')]?_0x4cdc67[_0xb7d5('0x1f')][_0xb7d5('0x21')]||null:null,'attributes':_0x4cdc67[_0xb7d5('0x1f')]?_0x4cdc67[_0xb7d5('0x1f')][_0xb7d5('0x22')]||null:null,'limit':_0x4cdc67[_0xb7d5('0x1f')]?_0x4cdc67[_0xb7d5('0x1f')][_0xb7d5('0x23')]||null:null})['then'](function(_0x16b60a){logger[_0xb7d5('0x13')](_0xb7d5('0x1c'),_0x4cdc67);logger[_0xb7d5('0x16')](_0xb7d5('0x1c'),_0x4cdc67,JSON['stringify'](_0x16b60a));_0x2661fc(_0x16b60a);})[_0xb7d5('0x24')](function(_0x3b869f){logger[_0xb7d5('0x18')](_0xb7d5('0x1c'),_0x3b869f['message'],_0x4cdc67);_0x3c586c(_0x1cc875[_0xb7d5('0x18')](0x1f4,_0x3b869f[_0xb7d5('0x1a')]));});});};exports[_0xb7d5('0x25')]=function(_0x446fe5){return new Promise(function(_0x59c2f8,_0x54a838){return db[_0xb7d5('0x1d')]['find']({'where':_0x446fe5['options']?_0x446fe5['options'][_0xb7d5('0x21')]||null:null})['then'](function(_0x47838d){if(_0x47838d){return _0x47838d[_0xb7d5('0x26')](_0x446fe5[_0xb7d5('0x1e')][_0xb7d5('0x27')],_[_0xb7d5('0x28')](_0x446fe5[_0xb7d5('0x1e')],['ids','id'])||{});}})[_0xb7d5('0x29')](function(_0x29414d){logger[_0xb7d5('0x13')](_0xb7d5('0x2a'),_0x446fe5);logger[_0xb7d5('0x16')](_0xb7d5('0x2a'),_0x446fe5,JSON['stringify'](_0x29414d));_0x59c2f8(_0x29414d);})[_0xb7d5('0x24')](function(_0x28f672){logger[_0xb7d5('0x18')](_0xb7d5('0x2a'),_0x28f672['message'],_0x446fe5);_0x54a838(_this[_0xb7d5('0x18')](0x1f4,_0x28f672[_0xb7d5('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 1de2800..4140b4a 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 _0x699b=['register','./openchannelInteraction.events','remove','emit','removeListener'];(function(_0x3060c0,_0x1900ed){var _0x494ad2=function(_0x314783){while(--_0x314783){_0x3060c0['push'](_0x3060c0['shift']());}};_0x494ad2(++_0x1900ed);}(_0x699b,0x1cd));var _0xb699=function(_0x36bf85,_0x5f0214){_0x36bf85=_0x36bf85-0x0;var _0x42a522=_0x699b[_0x36bf85];return _0x42a522;};'use strict';var OpenchannelInteractionEvents=require(_0xb699('0x0'));var events=['save',_0xb699('0x1'),'update'];function createListener(_0x2f48ff,_0x2c36ca){return function(_0x18ea81){_0x2c36ca[_0xb699('0x2')](_0x2f48ff,_0x18ea81);};}function removeListener(_0x549082,_0x12d214){return function(){OpenchannelInteractionEvents[_0xb699('0x3')](_0x549082,_0x12d214);};}exports[_0xb699('0x4')]=function(_0x23e34d){for(var _0x6c3066=0x0,_0xfcbce7=events['length'];_0x6c3066<_0xfcbce7;_0x6c3066++){var _0x47ed8a=events[_0x6c3066];var _0x88d924=createListener('openchannelInteraction:'+_0x47ed8a,_0x23e34d);OpenchannelInteractionEvents['on'](_0x47ed8a,_0x88d924);}}; \ No newline at end of file +var _0x648c=['remove','update','removeListener','register','length','./openchannelInteraction.events','save'];(function(_0x21465b,_0x258ee2){var _0x56a515=function(_0x87d5c3){while(--_0x87d5c3){_0x21465b['push'](_0x21465b['shift']());}};_0x56a515(++_0x258ee2);}(_0x648c,0x194));var _0xc648=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x648c[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelInteractionEvents=require(_0xc648('0x0'));var events=[_0xc648('0x1'),_0xc648('0x2'),_0xc648('0x3')];function createListener(_0x792599,_0x5ed1ce){return function(_0x2b0120){_0x5ed1ce['emit'](_0x792599,_0x2b0120);};}function removeListener(_0xd7e887,_0x3b724b){return function(){OpenchannelInteractionEvents[_0xc648('0x4')](_0xd7e887,_0x3b724b);};}exports[_0xc648('0x5')]=function(_0xb57a80){for(var _0x5184a2=0x0,_0x5259d3=events[_0xc648('0x6')];_0x5184a2<_0x5259d3;_0x5184a2++){var _0x15cf3b=events[_0x5184a2];var _0x554a0d=createListener('openchannelInteraction:'+_0x15cf3b,_0xb57a80);OpenchannelInteractionEvents['on'](_0x15cf3b,_0x554a0d);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index b0459da..a779a93 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 _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x29266f,_0xbe0015){var _0x16c306=function(_0x38a7c4){while(--_0x38a7c4){_0x29266f['push'](_0x29266f['shift']());}};_0x16c306(++_0xbe0015);}(_0xe706,0xa3));var _0x6e70=function(_0x197043,_0x3ebf47){_0x197043=_0x197043-0x0;var _0x233e33=_0xe706[_0x197043];return _0x233e33;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +var _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x1d9187,_0x494ad6){var _0x25d4b0=function(_0x59a1a1){while(--_0x59a1a1){_0x1d9187['push'](_0x1d9187['shift']());}};_0x25d4b0(++_0x494ad6);}(_0x9c44,0x178));var _0x49c4=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x9c44[_0x13b02f];return _0x12e9a6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 67f23b0..72ff96c 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 _0x1775=['out','DATE','STRING','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x4e4c69,_0x5d7f1c){var _0x35def9=function(_0x1c962f){while(--_0x1c962f){_0x4e4c69['push'](_0x4e4c69['shift']());}};_0x35def9(++_0x5d7f1c);}(_0x1775,0x1db));var _0x5177=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1775[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x5177('0x0')]={'body':{'type':Sequelize[_0x5177('0x1')](_0x5177('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5177('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x5177('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5177('0x4')]('in',_0x5177('0x5')),'defaultValue':_0x5177('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x5177('0x6')]},'providerName':{'type':Sequelize[_0x5177('0x7')]},'providerResponse':{'type':Sequelize[_0x5177('0x1')]}}; \ No newline at end of file +var _0x7117=['BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT','medium'];(function(_0x214cde,_0x4d18f2){var _0x5aa4ef=function(_0x221e33){while(--_0x221e33){_0x214cde['push'](_0x214cde['shift']());}};_0x5aa4ef(++_0x4d18f2);}(_0x7117,0x1ec));var _0x7711=function(_0x31e702,_0x1cac4e){_0x31e702=_0x31e702-0x0;var _0x1d10bd=_0x7117[_0x31e702];return _0x1d10bd;};'use strict';var Sequelize=require(_0x7711('0x0'));module[_0x7711('0x1')]={'body':{'type':Sequelize[_0x7711('0x2')](_0x7711('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x7711('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7711('0x5')]('in','out'),'defaultValue':_0x7711('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x7711('0x7')]},'providerResponse':{'type':Sequelize[_0x7711('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 5220f58..8cc3c85 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 _0x03e2=['SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteractionId','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','options','OpenchannelMessage','includeAll','include','findAll','rows','show','params','find','create','body','openchannel-interactions','accept','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','isNil','read1stAt','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','acceptMessage','sequelize','Sequelize','QueryTypes'];(function(_0x206fba,_0x33dfed){var _0x5c565c=function(_0x487543){while(--_0x487543){_0x206fba['push'](_0x206fba['shift']());}};_0x5c565c(++_0x33dfed);}(_0x03e2,0x119));var _0x203e=function(_0x28d409,_0x4a42e4){_0x28d409=_0x28d409-0x0;var _0x419dc1=_0x03e2[_0x28d409];return _0x419dc1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x203e('0x0'));var zipdir=require(_0x203e('0x1'));var jsonpatch=require(_0x203e('0x2'));var rp=require(_0x203e('0x3'));var moment=require(_0x203e('0x4'));var BPromise=require(_0x203e('0x5'));var Mustache=require(_0x203e('0x6'));var util=require(_0x203e('0x7'));var path=require(_0x203e('0x8'));var sox=require('sox');var csv=require(_0x203e('0x9'));var ejs=require(_0x203e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x203e('0xb'));var squel=require(_0x203e('0xc'));var crypto=require('crypto');var jsforce=require(_0x203e('0xd'));var deskjs=require(_0x203e('0xe'));var toCsv=require(_0x203e('0x9'));var querystring=require('querystring');var Papa=require(_0x203e('0xf'));var Redis=require(_0x203e('0x10'));var authService=require(_0x203e('0x11'));var qs=require(_0x203e('0x12'));var as=require(_0x203e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x203e('0x14'))(_0x203e('0x15'));var utils=require(_0x203e('0x16'));var config=require(_0x203e('0x17'));var licenseUtil=require(_0x203e('0x18'));var db=require(_0x203e('0x19'))['db'];config['redis']=_['defaults'](config[_0x203e('0x1a')],{'host':_0x203e('0x1b'),'port':0x18eb});var socket=require(_0x203e('0x1c'))(new Redis(config[_0x203e('0x1a')]));require(_0x203e('0x1d'))[_0x203e('0x1e')](socket);var jayson=require(_0x203e('0x1f'));var client=jayson['client'][_0x203e('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x203e('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x311d5d,_0x267640,_0x4d6191,_0x47f409){return new BPromise(function(_0x3cce10,_0x14ec51){var _0x2a1d6a=_0x47f409||client;return _0x2a1d6a[_0x203e('0x21')](_0x311d5d,_0x4d6191)[_0x203e('0x22')](function(_0xe52db6){logger[_0x203e('0x23')](_0x203e('0x24'),_0x267640,_0x203e('0x25'));logger[_0x203e('0x26')](_0x203e('0x27'),_0x267640,_0x203e('0x25'),JSON['stringify'](_0xe52db6));if(_0xe52db6[_0x203e('0x28')]){if(_0xe52db6['error'][_0x203e('0x29')]===0x1f4){logger[_0x203e('0x28')](_0x203e('0x24'),_0x267640,_0xe52db6['error'][_0x203e('0x2a')]);return _0x14ec51(_0xe52db6[_0x203e('0x28')]['message']);}logger[_0x203e('0x28')](_0x203e('0x24'),_0x267640,_0xe52db6[_0x203e('0x28')][_0x203e('0x2a')]);return _0x3cce10(_0xe52db6[_0x203e('0x28')]['message']);}else{logger[_0x203e('0x23')](_0x203e('0x24'),_0x267640,'request\x20sent');_0x3cce10(_0xe52db6['result'][_0x203e('0x2a')]);}})[_0x203e('0x2b')](function(_0x47e294){logger['error'](_0x203e('0x24'),_0x267640,_0x47e294);_0x14ec51(_0x47e294);});});}function respondWithStatusCode(_0xf5f1bc,_0xcfcbb){_0xcfcbb=_0xcfcbb||0xcc;return function(_0x4f3ae5){if(_0x4f3ae5){return _0xf5f1bc['sendStatus'](_0xcfcbb);}return _0xf5f1bc[_0x203e('0x2c')](_0xcfcbb)[_0x203e('0x2d')]();};}function respondWithResult(_0x444df7,_0x12d5ab){_0x12d5ab=_0x12d5ab||0xc8;return function(_0x1b3933){if(_0x1b3933){return _0x444df7[_0x203e('0x2c')](_0x12d5ab)[_0x203e('0x2e')](_0x1b3933);}};}function respondWithFilteredResult(_0x1d870d,_0x4c3018){return function(_0x56218a){if(_0x56218a){var _0x2a5141=typeof _0x4c3018[_0x203e('0x2f')]===_0x203e('0x30')&&typeof _0x4c3018[_0x203e('0x31')]===_0x203e('0x30');var _0x4d8bd2=_0x56218a['count'];var _0x400c8f=_0x2a5141?0x0:_0x4c3018[_0x203e('0x2f')];var _0x2a10f7=_0x2a5141?_0x56218a[_0x203e('0x32')]:_0x4c3018[_0x203e('0x2f')]+_0x4c3018[_0x203e('0x31')];var _0x568193;if(_0x2a10f7>=_0x4d8bd2){_0x2a10f7=_0x4d8bd2;_0x568193=0xc8;}else{_0x568193=0xce;}_0x1d870d[_0x203e('0x2c')](_0x568193);return _0x1d870d[_0x203e('0x33')]('Content-Range',_0x400c8f+'-'+_0x2a10f7+'/'+_0x4d8bd2)['json'](_0x56218a);}return null;};}function patchUpdates(_0x33e1f5){return function(_0x4ba156){try{jsonpatch['apply'](_0x4ba156,_0x33e1f5,!![]);}catch(_0x5610dc){return BPromise[_0x203e('0x34')](_0x5610dc);}return _0x4ba156[_0x203e('0x35')]();};}function saveUpdates(_0x1f66a2,_0x35166a){return function(_0x30df80){if(_0x30df80){return _0x30df80[_0x203e('0x36')](_0x1f66a2)[_0x203e('0x22')](function(_0x400094){return _0x400094;});}return null;};}function removeEntity(_0x2a8717,_0x36eee3){return function(_0x26ae3f){if(_0x26ae3f){return _0x26ae3f[_0x203e('0x37')]()[_0x203e('0x22')](function(){_0x2a8717['status'](0xcc)[_0x203e('0x2d')]();});}};}function handleEntityNotFound(_0x368af9,_0x386f46){return function(_0x432d91){if(!_0x432d91){_0x368af9[_0x203e('0x38')](0x194);}return _0x432d91;};}function handleError(_0x343778,_0x7936c){_0x7936c=_0x7936c||0x1f4;return function(_0x6c357d){logger['error'](_0x6c357d['stack']);if(_0x6c357d[_0x203e('0x39')]){delete _0x6c357d[_0x203e('0x39')];}_0x343778['status'](_0x7936c)[_0x203e('0x3a')](_0x6c357d);};}exports[_0x203e('0x3b')]=function(_0x413972,_0x962a02){var _0x10578b={},_0xdca444={},_0x18622b={'count':0x0,'rows':[]};var _0x3954a0=_[_0x203e('0x3c')](db['OpenchannelMessage'][_0x203e('0x3d')],function(_0x1a6391){return{'name':_0x1a6391[_0x203e('0x3e')],'type':_0x1a6391[_0x203e('0x3f')]['key']};});_0xdca444['model']=_[_0x203e('0x3c')](_0x3954a0,_0x203e('0x39'));_0xdca444[_0x203e('0x40')]=_[_0x203e('0x41')](_0x413972[_0x203e('0x40')]);_0xdca444[_0x203e('0x42')]=_[_0x203e('0x43')](_0xdca444['model'],_0xdca444[_0x203e('0x40')]);_0x10578b[_0x203e('0x44')]=_[_0x203e('0x43')](_0xdca444[_0x203e('0x45')],qs[_0x203e('0x46')](_0x413972[_0x203e('0x40')][_0x203e('0x46')]));_0x10578b[_0x203e('0x44')]=_0x10578b[_0x203e('0x44')][_0x203e('0x47')]?_0x10578b[_0x203e('0x44')]:_0xdca444[_0x203e('0x45')];if(!_0x413972[_0x203e('0x40')]['hasOwnProperty'](_0x203e('0x48'))){_0x10578b[_0x203e('0x31')]=qs[_0x203e('0x31')](_0x413972[_0x203e('0x40')]['limit']);_0x10578b[_0x203e('0x2f')]=qs[_0x203e('0x2f')](_0x413972['query'][_0x203e('0x2f')]);}_0x10578b[_0x203e('0x49')]=qs['sort'](_0x413972[_0x203e('0x40')][_0x203e('0x4a')]);_0x10578b[_0x203e('0x4b')]=qs[_0x203e('0x42')](_[_0x203e('0x4c')](_0x413972[_0x203e('0x40')],_0xdca444[_0x203e('0x42')]),_0x3954a0);if(_0x413972[_0x203e('0x40')][_0x203e('0x4d')]){_0x10578b[_0x203e('0x4b')]=_['merge'](_0x10578b['where'],{'$or':_['map'](_0x3954a0,function(_0x4c93f3){if(_0x4c93f3[_0x203e('0x3f')]!=='VIRTUAL'){var _0x436a44={};_0x436a44[_0x4c93f3[_0x203e('0x39')]]={'$like':'%'+_0x413972['query'][_0x203e('0x4d')]+'%'};return _0x436a44;}})});}_0x10578b=_[_0x203e('0x4e')]({},_0x10578b,_0x413972[_0x203e('0x4f')]);var _0x1cc9d2={'where':_0x10578b[_0x203e('0x4b')]};return db[_0x203e('0x50')]['count'](_0x1cc9d2)[_0x203e('0x22')](function(_0x4a32a5){_0x18622b[_0x203e('0x32')]=_0x4a32a5;if(_0x413972[_0x203e('0x40')][_0x203e('0x51')]){_0x10578b[_0x203e('0x52')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x203e('0x53')](_0x10578b);})[_0x203e('0x22')](function(_0x430ae3){_0x18622b[_0x203e('0x54')]=_0x430ae3;return _0x18622b;})[_0x203e('0x22')](respondWithFilteredResult(_0x962a02,_0x10578b))[_0x203e('0x2b')](handleError(_0x962a02,null));};exports[_0x203e('0x55')]=function(_0x56301f,_0x49cba2){var _0x2568a7={'raw':!![],'where':{'id':_0x56301f[_0x203e('0x56')]['id']}},_0x2785a9={};_0x2785a9['model']=_[_0x203e('0x41')](db['OpenchannelMessage']['rawAttributes']);_0x2785a9[_0x203e('0x40')]=_[_0x203e('0x41')](_0x56301f['query']);_0x2785a9[_0x203e('0x42')]=_[_0x203e('0x43')](_0x2785a9[_0x203e('0x45')],_0x2785a9['query']);_0x2568a7[_0x203e('0x44')]=_[_0x203e('0x43')](_0x2785a9[_0x203e('0x45')],qs[_0x203e('0x46')](_0x56301f[_0x203e('0x40')][_0x203e('0x46')]));_0x2568a7['attributes']=_0x2568a7['attributes'][_0x203e('0x47')]?_0x2568a7[_0x203e('0x44')]:_0x2785a9['model'];if(_0x56301f[_0x203e('0x40')][_0x203e('0x51')]){_0x2568a7['include']=[{'all':!![]}];}_0x2568a7=_['merge']({},_0x2568a7,_0x56301f[_0x203e('0x4f')]);return db[_0x203e('0x50')][_0x203e('0x57')](_0x2568a7)[_0x203e('0x22')](handleEntityNotFound(_0x49cba2,null))['then'](respondWithResult(_0x49cba2,null))[_0x203e('0x2b')](handleError(_0x49cba2,null));};exports[_0x203e('0x58')]=function(_0x223ffc,_0x228cca){return db[_0x203e('0x50')][_0x203e('0x58')](_0x223ffc[_0x203e('0x59')],{})[_0x203e('0x22')](respondWithResult(_0x228cca,0xc9))['catch'](handleError(_0x228cca,null));};exports[_0x203e('0x36')]=function(_0x19157f,_0x28d1e2){if(_0x19157f[_0x203e('0x59')]['id']){delete _0x19157f['body']['id'];}return db[_0x203e('0x50')]['find']({'where':{'id':_0x19157f[_0x203e('0x56')]['id']}})[_0x203e('0x22')](handleEntityNotFound(_0x28d1e2,null))[_0x203e('0x22')](saveUpdates(_0x19157f[_0x203e('0x59')],null))[_0x203e('0x22')](respondWithResult(_0x28d1e2,null))['catch'](handleError(_0x28d1e2,null));};exports['destroy']=function(_0xa5532f,_0x432ae1){return db[_0x203e('0x50')]['find']({'where':{'id':_0xa5532f['params']['id']}})[_0x203e('0x22')](handleEntityNotFound(_0x432ae1,null))[_0x203e('0x22')](removeEntity(_0x432ae1,null))['catch'](handleError(_0x432ae1,null));};exports['describe']=function(_0x522542,_0x38d03b){return db['OpenchannelMessage']['describe']()[_0x203e('0x22')](respondWithResult(_0x38d03b,null))[_0x203e('0x2b')](handleError(_0x38d03b,null));};var interaction_log=require(_0x203e('0x14'))(_0x203e('0x5a'));exports[_0x203e('0x5b')]=function(_0x37e026,_0x73fa63,_0x20a51b){var _0x111487={'agent':{},'channel':_0x203e('0x5c')};if(_0x37e026[_0x203e('0x59')]['id']){delete _0x37e026[_0x203e('0x59')]['id'];}_0x37e026['body']['read']=!![];_0x37e026[_0x203e('0x59')][_0x203e('0x5d')]=moment()[_0x203e('0x5e')](_0x203e('0x5f'));_0x37e026[_0x203e('0x59')][_0x203e('0x60')]=_0x37e026[_0x203e('0x59')][_0x203e('0x60')]||_0x37e026[_0x203e('0x61')]['id'];_0x111487[_0x203e('0x62')]['id']=_0x37e026[_0x203e('0x59')][_0x203e('0x60')];return db[_0x203e('0x50')][_0x203e('0x57')]({'where':{'id':_0x37e026[_0x203e('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x73fa63,null))['then'](saveUpdates(_0x37e026[_0x203e('0x59')],null))['then'](function(_0x2cde04){if(_0x2cde04){_0x111487[_0x203e('0x2a')]=_0x2cde04['get']({'plain':!![]});return db[_0x203e('0x63')]['find']({'where':{'id':_0x2cde04['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x73fa63,null))[_0x203e('0x22')](function(_0x55570d){if(_0x55570d){return _0x55570d['update']({'UserId':_0x37e026[_0x203e('0x59')][_0x203e('0x60')],'read1stAt':_[_0x203e('0x64')](_0x55570d[_0x203e('0x65')])?moment()[_0x203e('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x203e('0x22')](function(_0x2e9e7a){if(_0x2e9e7a){_0x111487[_0x203e('0x66')]=_0x2e9e7a[_0x203e('0x67')]({'plain':!![]});interaction_log[_0x203e('0x23')](_0x203e('0x68'),_0x37e026[_0x203e('0x61')]['id'],_0x37e026['user'][_0x203e('0x39')],_0x37e026[_0x203e('0x61')][_0x203e('0x69')],_0x111487[_0x203e('0x66')]['id'],_0x37e026[_0x203e('0x59')]?JSON[_0x203e('0x6a')](_0x37e026['body']):_0x203e('0x6b'));return respondWithRpcPromise('AcceptMessage',_0x203e('0x6c'),_0x111487);}return null;})[_0x203e('0x22')](function(_0xd3854c){var _0x54189d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xd3854c[_0x203e('0x2a')]['ContactId'];return db[_0x203e('0x6d')][_0x203e('0x40')](_0x54189d,{'type':db[_0x203e('0x6e')][_0x203e('0x6f')][_0x203e('0x70')],'raw':!![]})['then'](function(_0x49de08){return _0x49de08;});})['then'](function(_0x5c5535){if(_0x5c5535){_0x111487[_0x203e('0x2a')][_0x203e('0x71')]=_0x5c5535[0x0];if(!_0x37e026[_0x203e('0x59')]['UserId'])return;return db[_0x203e('0x72')][_0x203e('0x57')]({'where':{'id':_0x37e026[_0x203e('0x59')][_0x203e('0x60')],'role':_0x203e('0x62')},'attributes':['id',_0x203e('0x39'),_0x203e('0x73'),_0x203e('0x74'),_0x203e('0x75')],'raw':!![]});}return null;})[_0x203e('0x22')](function(_0x2fc11a){if(!_0x2fc11a)return null;_0x111487[_0x203e('0x2a')][_0x203e('0x62')]=_0x2fc11a;return _0x111487;})[_0x203e('0x22')](function(_0x5da889){if(_0x5da889){if(_0x37e026[_0x203e('0x59')][_0x203e('0x76')]){_0x111487[_0x203e('0x2a')][_0x203e('0x77')]=util[_0x203e('0x5e')](_0x203e('0x78'),_0x37e026[_0x203e('0x61')][_0x203e('0x39')]);_0x111487[_0x203e('0x2a')]['channel']=_0x111487[_0x203e('0x79')];_0x111487[_0x203e('0x2a')][_0x203e('0x7a')]=_0x111487[_0x203e('0x79')];_0x111487[_0x203e('0x2a')][_0x203e('0x7b')]=_0x203e('0x5b');return respondWithRpcPromise(_0x203e('0x7c'),'EventManager',{'event':_0x203e('0x7d'),'message':_0x111487['message']},client9002)[_0x203e('0x22')](function(){return _0x111487;});}return _0x111487;}return null;})[_0x203e('0x22')](respondWithResult(_0x73fa63,null))[_0x203e('0x2b')](handleError(_0x73fa63,null));};var interaction_log=require(_0x203e('0x14'))(_0x203e('0x5a'));exports['reject']=function(_0xc1fdf9,_0x70ac44,_0x4edd4c){var _0x258c40={'agent':{},'channel':_0x203e('0x5c')};if(_0xc1fdf9[_0x203e('0x59')]['id']){delete _0xc1fdf9[_0x203e('0x59')]['id'];}_0xc1fdf9[_0x203e('0x59')]['UserId']=_0xc1fdf9[_0x203e('0x59')][_0x203e('0x60')]||_0xc1fdf9['user']['id'];_0x258c40[_0x203e('0x62')]['id']=_0xc1fdf9[_0x203e('0x59')]['UserId'];return db['OpenchannelMessage'][_0x203e('0x57')]({'where':{'id':_0xc1fdf9[_0x203e('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x70ac44,null))[_0x203e('0x22')](function(_0x5f3a40){if(_0x5f3a40){_0x258c40['message']=_0x5f3a40[_0x203e('0x67')]({'plain':!![]});return db['OpenchannelInteraction'][_0x203e('0x57')]({'where':{'id':_0x5f3a40[_0x203e('0x7e')]}});}return null;})[_0x203e('0x22')](handleEntityNotFound(_0x70ac44,null))[_0x203e('0x22')](function(_0x3cdf4f){if(_0x3cdf4f){_0x258c40[_0x203e('0x66')]=_0x3cdf4f[_0x203e('0x67')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xc1fdf9[_0x203e('0x61')]['id'],_0xc1fdf9[_0x203e('0x61')]['name'],_0xc1fdf9['user'][_0x203e('0x69')],_0x258c40[_0x203e('0x66')]['id'],_0xc1fdf9[_0x203e('0x59')]?JSON['stringify'](_0xc1fdf9[_0x203e('0x59')]):'null');return respondWithRpcPromise(_0x203e('0x7f'),_0x203e('0x80'),_0x258c40);}return null;})['then'](function(_0x1152bf){var _0x56114c=_0x203e('0x81')+_0x1152bf[_0x203e('0x2a')]['ContactId'];return db[_0x203e('0x6d')][_0x203e('0x40')](_0x56114c,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x203e('0x22')](function(_0x6f2170){return _0x6f2170;});})[_0x203e('0x22')](function(_0xbd3331){if(_0xbd3331){_0x258c40['message']['contact']=_0xbd3331[0x0];if(!_0xc1fdf9['body'][_0x203e('0x60')])return;return db[_0x203e('0x72')]['find']({'where':{'id':_0xc1fdf9[_0x203e('0x59')][_0x203e('0x60')],'role':_0x203e('0x62')},'attributes':['id','name',_0x203e('0x73'),'email',_0x203e('0x75')],'raw':!![]});}return null;})[_0x203e('0x22')](function(_0x17fdfb){if(!_0x17fdfb)return null;_0x258c40[_0x203e('0x2a')][_0x203e('0x62')]=_0x17fdfb;return _0x258c40;})[_0x203e('0x22')](function(_0x4e58ab){if(_0x4e58ab){_0x4e58ab[_0x203e('0x2a')][_0x203e('0x77')]=util[_0x203e('0x5e')](_0x203e('0x78'),_0xc1fdf9[_0x203e('0x61')][_0x203e('0x39')]);_0x4e58ab[_0x203e('0x2a')][_0x203e('0x79')]=_0x258c40[_0x203e('0x79')];_0x4e58ab[_0x203e('0x2a')][_0x203e('0x7a')]=_0x258c40[_0x203e('0x79')];_0x4e58ab[_0x203e('0x2a')][_0x203e('0x7b')]='reject';respondWithRpcPromise(_0x203e('0x7c'),_0x203e('0x7c'),{'event':_0x203e('0x82'),'message':_0x4e58ab[_0x203e('0x2a')]},client9002);return _0x258c40;}return null;})[_0x203e('0x22')](respondWithResult(_0x70ac44,null))[_0x203e('0x2b')](handleError(_0x70ac44,null));}; \ No newline at end of file +var _0xd20a=['end','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body','destroy','describe','../../config/logger','openchannel-interactions','accept','openchannel','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','isNil','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','rejectMessage','QueryTypes','SELECT','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update'];(function(_0xcba4b6,_0x1ecf6a){var _0x2bd8bf=function(_0x46812a){while(--_0x46812a){_0xcba4b6['push'](_0xcba4b6['shift']());}};_0x2bd8bf(++_0x1ecf6a);}(_0xd20a,0xcb));var _0xad20=function(_0x3984e4,_0x412653){_0x3984e4=_0x3984e4-0x0;var _0x2eede7=_0xd20a[_0x3984e4];return _0x2eede7;};'use strict';var emlformat=require(_0xad20('0x0'));var rimraf=require(_0xad20('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad20('0x2'));var rp=require(_0xad20('0x3'));var moment=require(_0xad20('0x4'));var BPromise=require(_0xad20('0x5'));var Mustache=require(_0xad20('0x6'));var util=require(_0xad20('0x7'));var path=require('path');var sox=require(_0xad20('0x8'));var csv=require(_0xad20('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad20('0xa'));var _=require(_0xad20('0xb'));var squel=require('squel');var crypto=require(_0xad20('0xc'));var jsforce=require(_0xad20('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xad20('0x9'));var querystring=require(_0xad20('0xe'));var Papa=require(_0xad20('0xf'));var Redis=require(_0xad20('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xad20('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xad20('0x12'));var utils=require(_0xad20('0x13'));var config=require(_0xad20('0x14'));var licenseUtil=require(_0xad20('0x15'));var db=require(_0xad20('0x16'))['db'];config['redis']=_[_0xad20('0x17')](config[_0xad20('0x18')],{'host':_0xad20('0x19'),'port':0x18eb});var socket=require(_0xad20('0x1a'))(new Redis(config[_0xad20('0x18')]));require(_0xad20('0x1b'))[_0xad20('0x1c')](socket);var jayson=require(_0xad20('0x1d'));var client=jayson[_0xad20('0x1e')][_0xad20('0x1f')]({'port':0x232c});var client9002=jayson[_0xad20('0x1e')][_0xad20('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x54cf55,_0x35f514,_0x2d4cb2,_0x5b90e0){return new BPromise(function(_0x195c3c,_0x2caa08){var _0x37e2d9=_0x5b90e0||client;return _0x37e2d9['request'](_0x54cf55,_0x2d4cb2)[_0xad20('0x20')](function(_0x50f38c){logger[_0xad20('0x21')](_0xad20('0x22'),_0x35f514,_0xad20('0x23'));logger[_0xad20('0x24')](_0xad20('0x25'),_0x35f514,'request\x20sent',JSON[_0xad20('0x26')](_0x50f38c));if(_0x50f38c[_0xad20('0x27')]){if(_0x50f38c[_0xad20('0x27')][_0xad20('0x28')]===0x1f4){logger[_0xad20('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x35f514,_0x50f38c['error'][_0xad20('0x29')]);return _0x2caa08(_0x50f38c[_0xad20('0x27')]['message']);}logger[_0xad20('0x27')](_0xad20('0x22'),_0x35f514,_0x50f38c['error'][_0xad20('0x29')]);return _0x195c3c(_0x50f38c['error'][_0xad20('0x29')]);}else{logger[_0xad20('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x35f514,_0xad20('0x23'));_0x195c3c(_0x50f38c['result'][_0xad20('0x29')]);}})[_0xad20('0x2a')](function(_0x4a1d86){logger[_0xad20('0x27')](_0xad20('0x22'),_0x35f514,_0x4a1d86);_0x2caa08(_0x4a1d86);});});}function respondWithStatusCode(_0x5c6265,_0x4db7a3){_0x4db7a3=_0x4db7a3||0xcc;return function(_0x42dcc3){if(_0x42dcc3){return _0x5c6265[_0xad20('0x2b')](_0x4db7a3);}return _0x5c6265[_0xad20('0x2c')](_0x4db7a3)['end']();};}function respondWithResult(_0x4186e0,_0x5b53df){_0x5b53df=_0x5b53df||0xc8;return function(_0x795166){if(_0x795166){return _0x4186e0[_0xad20('0x2c')](_0x5b53df)[_0xad20('0x2d')](_0x795166);}};}function respondWithFilteredResult(_0xe2118a,_0x860552){return function(_0xf30db4){if(_0xf30db4){var _0x5a9bed=typeof _0x860552[_0xad20('0x2e')]==='undefined'&&typeof _0x860552[_0xad20('0x2f')]===_0xad20('0x30');var _0x181513=_0xf30db4[_0xad20('0x31')];var _0x2b1b50=_0x5a9bed?0x0:_0x860552[_0xad20('0x2e')];var _0x12b368=_0x5a9bed?_0xf30db4[_0xad20('0x31')]:_0x860552[_0xad20('0x2e')]+_0x860552[_0xad20('0x2f')];var _0x2b8cdf;if(_0x12b368>=_0x181513){_0x12b368=_0x181513;_0x2b8cdf=0xc8;}else{_0x2b8cdf=0xce;}_0xe2118a[_0xad20('0x2c')](_0x2b8cdf);return _0xe2118a[_0xad20('0x32')](_0xad20('0x33'),_0x2b1b50+'-'+_0x12b368+'/'+_0x181513)[_0xad20('0x2d')](_0xf30db4);}return null;};}function patchUpdates(_0x2b4622){return function(_0x4db64e){try{jsonpatch['apply'](_0x4db64e,_0x2b4622,!![]);}catch(_0x1b0156){return BPromise[_0xad20('0x34')](_0x1b0156);}return _0x4db64e[_0xad20('0x35')]();};}function saveUpdates(_0x9fa352,_0x4eb29c){return function(_0xb719bc){if(_0xb719bc){return _0xb719bc[_0xad20('0x36')](_0x9fa352)[_0xad20('0x20')](function(_0x1a5002){return _0x1a5002;});}return null;};}function removeEntity(_0x90bd97,_0x11083e){return function(_0x5a0b8b){if(_0x5a0b8b){return _0x5a0b8b['destroy']()[_0xad20('0x20')](function(){_0x90bd97[_0xad20('0x2c')](0xcc)[_0xad20('0x37')]();});}};}function handleEntityNotFound(_0x448a71,_0x544bd6){return function(_0x1bcc56){if(!_0x1bcc56){_0x448a71['sendStatus'](0x194);}return _0x1bcc56;};}function handleError(_0x291143,_0x5f3370){_0x5f3370=_0x5f3370||0x1f4;return function(_0x27aef9){logger[_0xad20('0x27')](_0x27aef9['stack']);if(_0x27aef9['name']){delete _0x27aef9[_0xad20('0x38')];}_0x291143['status'](_0x5f3370)[_0xad20('0x39')](_0x27aef9);};}exports[_0xad20('0x3a')]=function(_0x49005a,_0x347aa0){var _0x233bae={},_0x3dff29={},_0xbccfab={'count':0x0,'rows':[]};var _0x31c3cd=_[_0xad20('0x3b')](db[_0xad20('0x3c')][_0xad20('0x3d')],function(_0xf509ce){return{'name':_0xf509ce[_0xad20('0x3e')],'type':_0xf509ce[_0xad20('0x3f')][_0xad20('0x40')]};});_0x3dff29[_0xad20('0x41')]=_[_0xad20('0x3b')](_0x31c3cd,_0xad20('0x38'));_0x3dff29[_0xad20('0x42')]=_[_0xad20('0x43')](_0x49005a[_0xad20('0x42')]);_0x3dff29[_0xad20('0x44')]=_[_0xad20('0x45')](_0x3dff29[_0xad20('0x41')],_0x3dff29['query']);_0x233bae['attributes']=_[_0xad20('0x45')](_0x3dff29['model'],qs['fields'](_0x49005a[_0xad20('0x42')][_0xad20('0x46')]));_0x233bae[_0xad20('0x47')]=_0x233bae[_0xad20('0x47')][_0xad20('0x48')]?_0x233bae['attributes']:_0x3dff29[_0xad20('0x41')];if(!_0x49005a[_0xad20('0x42')][_0xad20('0x49')]('nolimit')){_0x233bae[_0xad20('0x2f')]=qs['limit'](_0x49005a['query'][_0xad20('0x2f')]);_0x233bae[_0xad20('0x2e')]=qs[_0xad20('0x2e')](_0x49005a[_0xad20('0x42')][_0xad20('0x2e')]);}_0x233bae[_0xad20('0x4a')]=qs[_0xad20('0x4b')](_0x49005a['query'][_0xad20('0x4b')]);_0x233bae[_0xad20('0x4c')]=qs[_0xad20('0x44')](_['pick'](_0x49005a[_0xad20('0x42')],_0x3dff29[_0xad20('0x44')]),_0x31c3cd);if(_0x49005a[_0xad20('0x42')][_0xad20('0x4d')]){_0x233bae[_0xad20('0x4c')]=_[_0xad20('0x4e')](_0x233bae['where'],{'$or':_[_0xad20('0x3b')](_0x31c3cd,function(_0x47c5a3){if(_0x47c5a3['type']!==_0xad20('0x4f')){var _0x51e69e={};_0x51e69e[_0x47c5a3[_0xad20('0x38')]]={'$like':'%'+_0x49005a['query'][_0xad20('0x4d')]+'%'};return _0x51e69e;}})});}_0x233bae=_[_0xad20('0x4e')]({},_0x233bae,_0x49005a['options']);var _0x4013cd={'where':_0x233bae['where']};return db[_0xad20('0x3c')][_0xad20('0x31')](_0x4013cd)[_0xad20('0x20')](function(_0x2d401a){_0xbccfab['count']=_0x2d401a;if(_0x49005a[_0xad20('0x42')][_0xad20('0x50')]){_0x233bae[_0xad20('0x51')]=[{'all':!![]}];}return db[_0xad20('0x3c')][_0xad20('0x52')](_0x233bae);})[_0xad20('0x20')](function(_0x3d7e0c){_0xbccfab[_0xad20('0x53')]=_0x3d7e0c;return _0xbccfab;})[_0xad20('0x20')](respondWithFilteredResult(_0x347aa0,_0x233bae))[_0xad20('0x2a')](handleError(_0x347aa0,null));};exports[_0xad20('0x54')]=function(_0x28ef05,_0x45c260){var _0xf4fe51={'raw':!![],'where':{'id':_0x28ef05[_0xad20('0x55')]['id']}},_0x421a52={};_0x421a52['model']=_[_0xad20('0x43')](db[_0xad20('0x3c')][_0xad20('0x3d')]);_0x421a52[_0xad20('0x42')]=_[_0xad20('0x43')](_0x28ef05['query']);_0x421a52[_0xad20('0x44')]=_[_0xad20('0x45')](_0x421a52[_0xad20('0x41')],_0x421a52['query']);_0xf4fe51[_0xad20('0x47')]=_[_0xad20('0x45')](_0x421a52[_0xad20('0x41')],qs[_0xad20('0x46')](_0x28ef05[_0xad20('0x42')][_0xad20('0x46')]));_0xf4fe51[_0xad20('0x47')]=_0xf4fe51['attributes'][_0xad20('0x48')]?_0xf4fe51[_0xad20('0x47')]:_0x421a52[_0xad20('0x41')];if(_0x28ef05[_0xad20('0x42')][_0xad20('0x50')]){_0xf4fe51[_0xad20('0x51')]=[{'all':!![]}];}_0xf4fe51=_[_0xad20('0x4e')]({},_0xf4fe51,_0x28ef05['options']);return db[_0xad20('0x3c')][_0xad20('0x56')](_0xf4fe51)['then'](handleEntityNotFound(_0x45c260,null))[_0xad20('0x20')](respondWithResult(_0x45c260,null))[_0xad20('0x2a')](handleError(_0x45c260,null));};exports[_0xad20('0x57')]=function(_0x424e12,_0x18dc32){return db[_0xad20('0x3c')]['create'](_0x424e12['body'],{})[_0xad20('0x20')](respondWithResult(_0x18dc32,0xc9))[_0xad20('0x2a')](handleError(_0x18dc32,null));};exports[_0xad20('0x36')]=function(_0xb3d44d,_0x2baece){if(_0xb3d44d[_0xad20('0x58')]['id']){delete _0xb3d44d[_0xad20('0x58')]['id'];}return db[_0xad20('0x3c')]['find']({'where':{'id':_0xb3d44d[_0xad20('0x55')]['id']}})['then'](handleEntityNotFound(_0x2baece,null))[_0xad20('0x20')](saveUpdates(_0xb3d44d['body'],null))[_0xad20('0x20')](respondWithResult(_0x2baece,null))['catch'](handleError(_0x2baece,null));};exports[_0xad20('0x59')]=function(_0x2b8042,_0x2f0536){return db[_0xad20('0x3c')][_0xad20('0x56')]({'where':{'id':_0x2b8042[_0xad20('0x55')]['id']}})[_0xad20('0x20')](handleEntityNotFound(_0x2f0536,null))['then'](removeEntity(_0x2f0536,null))[_0xad20('0x2a')](handleError(_0x2f0536,null));};exports['describe']=function(_0x179f33,_0x516788){return db[_0xad20('0x3c')][_0xad20('0x5a')]()['then'](respondWithResult(_0x516788,null))[_0xad20('0x2a')](handleError(_0x516788,null));};var interaction_log=require(_0xad20('0x5b'))(_0xad20('0x5c'));exports[_0xad20('0x5d')]=function(_0x4317e1,_0x40dd80,_0x43826a){var _0x425ce4={'agent':{},'channel':_0xad20('0x5e')};if(_0x4317e1[_0xad20('0x58')]['id']){delete _0x4317e1['body']['id'];}_0x4317e1['body']['read']=!![];_0x4317e1[_0xad20('0x58')][_0xad20('0x5f')]=moment()['format'](_0xad20('0x60'));_0x4317e1[_0xad20('0x58')][_0xad20('0x61')]=_0x4317e1[_0xad20('0x58')][_0xad20('0x61')]||_0x4317e1[_0xad20('0x62')]['id'];_0x425ce4['agent']['id']=_0x4317e1[_0xad20('0x58')][_0xad20('0x61')];return db['OpenchannelMessage'][_0xad20('0x56')]({'where':{'id':_0x4317e1[_0xad20('0x55')]['id'],'UserId':null}})[_0xad20('0x20')](handleEntityNotFound(_0x40dd80,null))[_0xad20('0x20')](saveUpdates(_0x4317e1[_0xad20('0x58')],null))[_0xad20('0x20')](function(_0x28ed49){if(_0x28ed49){_0x425ce4[_0xad20('0x29')]=_0x28ed49[_0xad20('0x63')]({'plain':!![]});return db[_0xad20('0x64')][_0xad20('0x56')]({'where':{'id':_0x28ed49['OpenchannelInteractionId']}});}return null;})[_0xad20('0x20')](handleEntityNotFound(_0x40dd80,null))['then'](function(_0xc8e201){if(_0xc8e201){return _0xc8e201['update']({'UserId':_0x4317e1[_0xad20('0x58')][_0xad20('0x61')],'read1stAt':_[_0xad20('0x65')](_0xc8e201['read1stAt'])?moment()['format'](_0xad20('0x60')):undefined});}return null;})[_0xad20('0x20')](function(_0x28a6cf){if(_0x28a6cf){_0x425ce4['interaction']=_0x28a6cf['get']({'plain':!![]});interaction_log[_0xad20('0x21')](_0xad20('0x66'),_0x4317e1[_0xad20('0x62')]['id'],_0x4317e1[_0xad20('0x62')][_0xad20('0x38')],_0x4317e1[_0xad20('0x62')][_0xad20('0x67')],_0x425ce4['interaction']['id'],_0x4317e1[_0xad20('0x58')]?JSON[_0xad20('0x26')](_0x4317e1[_0xad20('0x58')]):_0xad20('0x68'));return respondWithRpcPromise('AcceptMessage',_0xad20('0x69'),_0x425ce4);}return null;})[_0xad20('0x20')](function(_0x55593b){var _0xe7f947=_0xad20('0x6a')+_0x55593b[_0xad20('0x29')][_0xad20('0x6b')];return db[_0xad20('0x6c')][_0xad20('0x42')](_0xe7f947,{'type':db[_0xad20('0x6d')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x22c702){return _0x22c702;});})[_0xad20('0x20')](function(_0x10489e){if(_0x10489e){_0x425ce4[_0xad20('0x29')][_0xad20('0x6e')]=_0x10489e[0x0];if(!_0x4317e1[_0xad20('0x58')]['UserId'])return;return db[_0xad20('0x6f')]['find']({'where':{'id':_0x4317e1[_0xad20('0x58')][_0xad20('0x61')],'role':_0xad20('0x70')},'attributes':['id','name',_0xad20('0x71'),_0xad20('0x72'),_0xad20('0x73')],'raw':!![]});}return null;})['then'](function(_0x461474){if(!_0x461474)return null;_0x425ce4[_0xad20('0x29')]['agent']=_0x461474;return _0x425ce4;})[_0xad20('0x20')](function(_0x3ffefa){if(_0x3ffefa){if(_0x4317e1[_0xad20('0x58')][_0xad20('0x74')]){_0x425ce4[_0xad20('0x29')][_0xad20('0x75')]=util['format'](_0xad20('0x76'),_0x4317e1['user'][_0xad20('0x38')]);_0x425ce4[_0xad20('0x29')][_0xad20('0x77')]=_0x425ce4['channel'];_0x425ce4[_0xad20('0x29')][_0xad20('0x78')]=_0x425ce4[_0xad20('0x77')];_0x425ce4[_0xad20('0x29')][_0xad20('0x79')]=_0xad20('0x5d');return respondWithRpcPromise(_0xad20('0x7a'),_0xad20('0x7a'),{'event':_0xad20('0x7b'),'message':_0x425ce4['message']},client9002)[_0xad20('0x20')](function(){return _0x425ce4;});}return _0x425ce4;}return null;})[_0xad20('0x20')](respondWithResult(_0x40dd80,null))[_0xad20('0x2a')](handleError(_0x40dd80,null));};var interaction_log=require(_0xad20('0x5b'))(_0xad20('0x5c'));exports[_0xad20('0x34')]=function(_0x1946fd,_0x2d914d,_0xc059ea){var _0x5021e2={'agent':{},'channel':_0xad20('0x5e')};if(_0x1946fd[_0xad20('0x58')]['id']){delete _0x1946fd[_0xad20('0x58')]['id'];}_0x1946fd[_0xad20('0x58')]['UserId']=_0x1946fd[_0xad20('0x58')]['UserId']||_0x1946fd[_0xad20('0x62')]['id'];_0x5021e2[_0xad20('0x70')]['id']=_0x1946fd[_0xad20('0x58')]['UserId'];return db[_0xad20('0x3c')][_0xad20('0x56')]({'where':{'id':_0x1946fd[_0xad20('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2d914d,null))['then'](function(_0xe19b69){if(_0xe19b69){_0x5021e2[_0xad20('0x29')]=_0xe19b69[_0xad20('0x63')]({'plain':!![]});return db[_0xad20('0x64')][_0xad20('0x56')]({'where':{'id':_0xe19b69['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2d914d,null))[_0xad20('0x20')](function(_0x19812a){if(_0x19812a){_0x5021e2['interaction']=_0x19812a['get']({'plain':!![]});interaction_log[_0xad20('0x21')](_0xad20('0x7c'),_0x1946fd['user']['id'],_0x1946fd[_0xad20('0x62')]['name'],_0x1946fd[_0xad20('0x62')][_0xad20('0x67')],_0x5021e2[_0xad20('0x7d')]['id'],_0x1946fd[_0xad20('0x58')]?JSON[_0xad20('0x26')](_0x1946fd[_0xad20('0x58')]):_0xad20('0x68'));return respondWithRpcPromise('RejectMessage',_0xad20('0x7e'),_0x5021e2);}return null;})[_0xad20('0x20')](function(_0x540dd3){var _0x275aaa=_0xad20('0x6a')+_0x540dd3[_0xad20('0x29')]['ContactId'];return db[_0xad20('0x6c')][_0xad20('0x42')](_0x275aaa,{'type':db[_0xad20('0x6d')][_0xad20('0x7f')][_0xad20('0x80')],'raw':!![]})['then'](function(_0x240cc3){return _0x240cc3;});})[_0xad20('0x20')](function(_0x20e2d2){if(_0x20e2d2){_0x5021e2['message'][_0xad20('0x6e')]=_0x20e2d2[0x0];if(!_0x1946fd[_0xad20('0x58')][_0xad20('0x61')])return;return db['User'][_0xad20('0x56')]({'where':{'id':_0x1946fd[_0xad20('0x58')]['UserId'],'role':'agent'},'attributes':['id','name','fullname',_0xad20('0x72'),'internal'],'raw':!![]});}return null;})[_0xad20('0x20')](function(_0x23b7e1){if(!_0x23b7e1)return null;_0x5021e2[_0xad20('0x29')]['agent']=_0x23b7e1;return _0x5021e2;})[_0xad20('0x20')](function(_0x5c506a){if(_0x5c506a){_0x5c506a['message'][_0xad20('0x75')]=util['format'](_0xad20('0x76'),_0x1946fd[_0xad20('0x62')]['name']);_0x5c506a[_0xad20('0x29')][_0xad20('0x77')]=_0x5021e2[_0xad20('0x77')];_0x5c506a['message'][_0xad20('0x78')]=_0x5021e2[_0xad20('0x77')];_0x5c506a['message']['event']=_0xad20('0x34');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x5c506a[_0xad20('0x29')]},client9002);return _0x5021e2;}return null;})[_0xad20('0x20')](respondWithResult(_0x2d914d,null))[_0xad20('0x2a')](handleError(_0x2d914d,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index accbfc3..ba4a2d0 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 _0x64f7=['OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x405541,_0x2945cc){var _0x194a1e=function(_0x46fffe){while(--_0x46fffe){_0x405541['push'](_0x405541['shift']());}};_0x194a1e(++_0x2945cc);}(_0x64f7,0xe5));var _0x764f=function(_0x1cb930,_0x55a2f4){_0x1cb930=_0x1cb930-0x0;var _0x5bd112=_0x64f7[_0x1cb930];return _0x5bd112;};'use strict';var EventEmitter=require(_0x764f('0x0'));var OpenchannelMessage=require(_0x764f('0x1'))['db'][_0x764f('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x764f('0x3')](0x0);var events={'afterCreate':_0x764f('0x4'),'afterUpdate':_0x764f('0x5'),'afterDestroy':_0x764f('0x6')};function emitEvent(_0x5ce911){return function(_0x20bf2b,_0x4fed46,_0x311617){OpenchannelMessageEvents[_0x764f('0x7')](_0x5ce911+':'+_0x20bf2b['id'],_0x20bf2b);OpenchannelMessageEvents[_0x764f('0x7')](_0x5ce911,_0x20bf2b);_0x311617(null);};}for(var e in events){if(events[_0x764f('0x8')](e)){var event=events[e];OpenchannelMessage[_0x764f('0x9')](e,emitEvent(event));}}module[_0x764f('0xa')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x0e40=['../../mysqldb','update','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e40,0x159));var _0x00e4=function(_0x25ec33,_0x27a53f){_0x25ec33=_0x25ec33-0x0;var _0xf7fd08=_0x0e40[_0x25ec33];return _0xf7fd08;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x00e4('0x0'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x00e4('0x1'),'afterDestroy':'remove'};function emitEvent(_0x46f004){return function(_0x317d55,_0x34867c,_0x3e3813){OpenchannelMessageEvents[_0x00e4('0x2')](_0x46f004+':'+_0x317d55['id'],_0x317d55);OpenchannelMessageEvents['emit'](_0x46f004,_0x317d55);_0x3e3813(null);};}for(var e in events){if(events[_0x00e4('0x3')](e)){var event=events[e];OpenchannelMessage[_0x00e4('0x4')](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 9090c5a..057982b 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 _0x5ee4=['length','Interaction','omit','Contact','method','GET','body','info','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch','inspect','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','exports','define','fti_openchannel_messages','models','get','direction','toLowerCase','secret','isNil','findOne','OpenchannelInteractionId','then','update','createdAt','error','out','CmContact','describe','find','OpenchannelAccountId','OpenchannelInteraction','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Interactions'];(function(_0x46804c,_0x3eea5a){var _0x421408=function(_0x49b379){while(--_0x49b379){_0x46804c['push'](_0x46804c['shift']());}};_0x421408(++_0x3eea5a);}(_0x5ee4,0x1e4));var _0x45ee=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x5ee4[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x45ee('0x0'));var util=require(_0x45ee('0x1'));var logger=require('../../config/logger')(_0x45ee('0x2'));var moment=require(_0x45ee('0x3'));var BPromise=require('bluebird');var rp=require(_0x45ee('0x4'));var fs=require('fs');var path=require(_0x45ee('0x5'));var rimraf=require(_0x45ee('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelMessage.attributes');module[_0x45ee('0x7')]=function(_0x5b754c,_0x479821){return _0x5b754c[_0x45ee('0x8')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x45ee('0x9'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f5285,_0x24abd9,_0x3c05d2){var _0x3e0875=_0x5b754c[_0x45ee('0xa')];var _0x19f4ee=_0x3f5285[_0x45ee('0xb')]({'plain':!![]});if(_0x19f4ee[_0x45ee('0xc')][_0x45ee('0xd')]()==='in'||_0x19f4ee[_0x45ee('0xc')][_0x45ee('0xd')]()==='out'&&!_0x19f4ee[_0x45ee('0xe')]&&!_[_0x45ee('0xf')](_0x19f4ee['UserId'])){_0x3e0875['OpenchannelInteraction'][_0x45ee('0x10')]({'where':{'id':_0x19f4ee[_0x45ee('0x11')]}})[_0x45ee('0x12')](function(_0x4c74ab){if(_0x4c74ab){_0x4c74ab[_0x45ee('0x13')]({'lastMsgAt':_0x19f4ee[_0x45ee('0x14')],'lastMsgDirection':_0x19f4ee['direction'][_0x45ee('0xd')]()});}})['catch'](function(_0xb154da){console[_0x45ee('0x15')](_0xb154da);});}if(_0x19f4ee[_0x45ee('0xc')]===_0x45ee('0x16')&&!_0x19f4ee[_0x45ee('0xe')]){var _0xeef1cd;_0x3e0875[_0x45ee('0x17')][_0x45ee('0x18')]()[_0x45ee('0x12')](function(_0x4ae4b7){return _0x3e0875['OpenchannelAccount'][_0x45ee('0x19')]({'where':{'id':_0x19f4ee[_0x45ee('0x1a')]},'include':[{'model':_0x3e0875[_0x45ee('0x1b')],'as':'Interactions','where':{'id':_0x19f4ee[_0x45ee('0x11')]},'limit':0x1,'include':[{'model':_0x3e0875[_0x45ee('0x17')],'as':'Contact','attributes':_[_0x45ee('0x1c')](_0x4ae4b7)}]}]});})['then'](function(_0x339d83){_0xeef1cd=_0x339d83[_0x45ee('0xb')]({'plain':!![]});if(_0xeef1cd&&_0xeef1cd[_0x45ee('0x1d')]){logger['info'](_0x45ee('0x1e'),_0x45ee('0x1f'),util['format']('Forwarding\x20message\x20%d\x20to\x20%s',_0x19f4ee['id'],_0xeef1cd['replyUri']));if(_0xeef1cd[_0x45ee('0x20')]&&_0xeef1cd['Interactions'][_0x45ee('0x21')]){_0x19f4ee[_0x45ee('0x22')]=_[_0x45ee('0x23')](_0xeef1cd[_0x45ee('0x20')][0x0],'Contact');_0x19f4ee[_0x45ee('0x24')]=_0xeef1cd[_0x45ee('0x20')][0x0][_0x45ee('0x24')];}var _0x24abd9={'method':'POST','uri':encodeURI(_0xeef1cd[_0x45ee('0x1d')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x24abd9[_0x45ee('0x25')]){case _0x45ee('0x26'):_0x24abd9['qs']=_0x19f4ee;break;case'POST':_0x24abd9[_0x45ee('0x27')]=_0x19f4ee;break;}return rp(_0x24abd9)['then'](function(_0x24c1fc){logger[_0x45ee('0x28')](_0x45ee('0x1e'),_0x45ee('0x1f'),util[_0x45ee('0x29')](_0x45ee('0x2a'),_0x19f4ee['id'],_0xeef1cd[_0x45ee('0x1d')]));if(_0x24c1fc[_0x45ee('0x27')][_0x45ee('0x2b')]&&_0x24c1fc[_0x45ee('0x27')][_0x45ee('0x2b')]!=_0x19f4ee[_0x45ee('0x22')][_0x45ee('0x2b')]){return _0x3e0875[_0x45ee('0x1b')][_0x45ee('0x13')]({'threadId':_0x24c1fc[_0x45ee('0x27')][_0x45ee('0x2b')]},{'where':{'id':_0x19f4ee[_0x45ee('0x22')]['id']}});}else{return;}})[_0x45ee('0x12')](function(){return _0x3f5285[_0x45ee('0x13')]({'read':!![]});})[_0x45ee('0x2c')](function(_0x5298a6){logger[_0x45ee('0x15')](_0x45ee('0x1e'),'afterCreate',util[_0x45ee('0x2d')](_0x5298a6,{'showHidden':![],'depth':null}));_0x3c05d2();});}else{_0x3c05d2();}})['finally'](function(){_0x3c05d2();});}else{_0x3c05d2();}}},'charset':'utf8mb4','collate':_0x45ee('0x2e')});}; \ No newline at end of file +var _0x75f0=['catch','error','CmContact','describe','find','OpenchannelAccountId','OpenchannelInteractionId','Contact','info','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','omit','POST','method','GET','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','replyUri','threadId','Interaction','OpenchannelInteraction','inspect','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','then','update','createdAt'];(function(_0x564fd5,_0x4362ab){var _0xef1bec=function(_0x27237e){while(--_0x27237e){_0x564fd5['push'](_0x564fd5['shift']());}};_0xef1bec(++_0x4362ab);}(_0x75f0,0xb4));var _0x075f=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x75f0[_0x17b6e3];return _0x3906f3;};'use strict';var _=require('lodash');var util=require(_0x075f('0x0'));var logger=require(_0x075f('0x1'))(_0x075f('0x2'));var moment=require(_0x075f('0x3'));var BPromise=require(_0x075f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x075f('0x5'));var config=require(_0x075f('0x6'));var attributes=require(_0x075f('0x7'));module[_0x075f('0x8')]=function(_0x5f25c2,_0x3f2ae6){return _0x5f25c2[_0x075f('0x9')]('OpenchannelMessage',attributes,{'tableName':_0x075f('0xa'),'paranoid':![],'indexes':[{'name':_0x075f('0xb'),'fields':[_0x075f('0xc')],'type':_0x075f('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c697c,_0x5df203,_0x8040f7){var _0x5ea7ff=_0x5f25c2[_0x075f('0xe')];var _0x5d3500=_0x4c697c[_0x075f('0xf')]({'plain':!![]});if(_0x5d3500[_0x075f('0x10')]['toLowerCase']()==='in'||_0x5d3500['direction'][_0x075f('0x11')]()===_0x075f('0x12')&&!_0x5d3500[_0x075f('0x13')]&&!_['isNil'](_0x5d3500[_0x075f('0x14')])){_0x5ea7ff['OpenchannelInteraction']['findOne']({'where':{'id':_0x5d3500['OpenchannelInteractionId']}})[_0x075f('0x15')](function(_0x49ae53){if(_0x49ae53){_0x49ae53[_0x075f('0x16')]({'lastMsgAt':_0x5d3500[_0x075f('0x17')],'lastMsgDirection':_0x5d3500[_0x075f('0x10')]['toLowerCase']()});}})[_0x075f('0x18')](function(_0x9a3017){console[_0x075f('0x19')](_0x9a3017);});}if(_0x5d3500['direction']===_0x075f('0x12')&&!_0x5d3500['secret']){var _0x39d20d;_0x5ea7ff[_0x075f('0x1a')][_0x075f('0x1b')]()[_0x075f('0x15')](function(_0x381f56){return _0x5ea7ff['OpenchannelAccount'][_0x075f('0x1c')]({'where':{'id':_0x5d3500[_0x075f('0x1d')]},'include':[{'model':_0x5ea7ff['OpenchannelInteraction'],'as':'Interactions','where':{'id':_0x5d3500[_0x075f('0x1e')]},'limit':0x1,'include':[{'model':_0x5ea7ff['CmContact'],'as':_0x075f('0x1f'),'attributes':_['keys'](_0x381f56)}]}]});})[_0x075f('0x15')](function(_0x40d43f){_0x39d20d=_0x40d43f[_0x075f('0xf')]({'plain':!![]});if(_0x39d20d&&_0x39d20d['replyUri']){logger[_0x075f('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x075f('0x21'),util[_0x075f('0x22')](_0x075f('0x23'),_0x5d3500['id'],_0x39d20d['replyUri']));if(_0x39d20d['Interactions']&&_0x39d20d[_0x075f('0x24')]['length']){_0x5d3500['Interaction']=_[_0x075f('0x25')](_0x39d20d[_0x075f('0x24')][0x0],_0x075f('0x1f'));_0x5d3500[_0x075f('0x1f')]=_0x39d20d[_0x075f('0x24')][0x0][_0x075f('0x1f')];}var _0x5df203={'method':_0x075f('0x26'),'uri':encodeURI(_0x39d20d['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5df203[_0x075f('0x27')]){case _0x075f('0x28'):_0x5df203['qs']=_0x5d3500;break;case _0x075f('0x26'):_0x5df203[_0x075f('0xc')]=_0x5d3500;break;}return rp(_0x5df203)[_0x075f('0x15')](function(_0x6c4f86){logger[_0x075f('0x20')](_0x075f('0x29'),_0x075f('0x21'),util[_0x075f('0x22')](_0x075f('0x2a'),_0x5d3500['id'],_0x39d20d[_0x075f('0x2b')]));if(_0x6c4f86[_0x075f('0xc')][_0x075f('0x2c')]&&_0x6c4f86[_0x075f('0xc')][_0x075f('0x2c')]!=_0x5d3500[_0x075f('0x2d')][_0x075f('0x2c')]){return _0x5ea7ff[_0x075f('0x2e')]['update']({'threadId':_0x6c4f86[_0x075f('0xc')][_0x075f('0x2c')]},{'where':{'id':_0x5d3500[_0x075f('0x2d')]['id']}});}else{return;}})[_0x075f('0x15')](function(){return _0x4c697c[_0x075f('0x16')]({'read':!![]});})['catch'](function(_0x52b047){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x075f('0x21'),util[_0x075f('0x2f')](_0x52b047,{'showHidden':![],'depth':null}));_0x8040f7();});}else{_0x8040f7();}})[_0x075f('0x30')](function(){_0x8040f7();});}else{_0x8040f7();}}},'charset':_0x075f('0x31'),'collate':_0x075f('0x32')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index a7730e3..a8a7210 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 _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x20118a,_0x3dbdf3){var _0x538b5f=function(_0x31c5b4){while(--_0x31c5b4){_0x20118a['push'](_0x20118a['shift']());}};_0x538b5f(++_0x3dbdf3);}(_0xdb28,0x106));var _0x8db2=function(_0x6cba38,_0x5b872c){_0x6cba38=_0x6cba38-0x0;var _0x59582c=_0xdb28[_0x6cba38];return _0x59582c;};'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});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file +var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x3f9e48,_0xe329b){var _0x280edd=function(_0x4a9e5d){while(--_0x4a9e5d){_0x3f9e48['push'](_0x3f9e48['shift']());}};_0x280edd(++_0xe329b);}(_0x2ef3,0xba));var _0x32ef=function(_0x2088bb,_0x30ff7b){_0x2088bb=_0x2088bb-0x0;var _0xcd7d9=_0x2ef3[_0x2088bb];return _0xcd7d9;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index aaebeb9..a8be851 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 _0x2bae=['emit','register','length','openchannelMessage:','./openchannelMessage.events','save','remove','update'];(function(_0xe2c95e,_0x3e6545){var _0x42ce6f=function(_0x218482){while(--_0x218482){_0xe2c95e['push'](_0xe2c95e['shift']());}};_0x42ce6f(++_0x3e6545);}(_0x2bae,0x164));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelMessageEvents=require(_0xe2ba('0x0'));var events=[_0xe2ba('0x1'),_0xe2ba('0x2'),_0xe2ba('0x3')];function createListener(_0x3c97d7,_0x251690){return function(_0x5e0e85){_0x251690[_0xe2ba('0x4')](_0x3c97d7,_0x5e0e85);};}function removeListener(_0x52f39e,_0x442279){return function(){OpenchannelMessageEvents['removeListener'](_0x52f39e,_0x442279);};}exports[_0xe2ba('0x5')]=function(_0x129677){for(var _0x21601e=0x0,_0x4933a0=events[_0xe2ba('0x6')];_0x21601e<_0x4933a0;_0x21601e++){var _0x21076b=events[_0x21601e];var _0x12be92=createListener(_0xe2ba('0x7')+_0x21076b,_0x129677);OpenchannelMessageEvents['on'](_0x21076b,_0x12be92);}}; \ No newline at end of file +var _0xa1aa=['register','length','openchannelMessage:','remove','update','emit','removeListener'];(function(_0x2777ee,_0x470e85){var _0x1e9891=function(_0x1fc4c1){while(--_0x1fc4c1){_0x2777ee['push'](_0x2777ee['shift']());}};_0x1e9891(++_0x470e85);}(_0xa1aa,0x88));var _0xaa1a=function(_0x3ad1fa,_0x29cf81){_0x3ad1fa=_0x3ad1fa-0x0;var _0x4a25c4=_0xa1aa[_0x3ad1fa];return _0x4a25c4;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0xaa1a('0x0'),_0xaa1a('0x1')];function createListener(_0x39e955,_0x132066){return function(_0x1b5247){_0x132066[_0xaa1a('0x2')](_0x39e955,_0x1b5247);};}function removeListener(_0x34f7d0,_0x4e7869){return function(){OpenchannelMessageEvents[_0xaa1a('0x3')](_0x34f7d0,_0x4e7869);};}exports[_0xaa1a('0x4')]=function(_0x4934e6){for(var _0x3500c9=0x0,_0x15b767=events[_0xaa1a('0x5')];_0x3500c9<_0x15b767;_0x3500c9++){var _0x1a289d=events[_0x3500c9];var _0x253dc7=createListener(_0xaa1a('0x6')+_0x1a289d,_0x4934e6);OpenchannelMessageEvents['on'](_0x1a289d,_0x253dc7);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 54ad365..3b8a1af 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 _0xc410=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','post','addAgents','update','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4e6af2,_0x5b9d85){var _0x3e932a=function(_0xaf01a5){while(--_0xaf01a5){_0x4e6af2['push'](_0x4e6af2['shift']());}};_0x3e932a(++_0x5b9d85);}(_0xc410,0x106));var _0x0c41=function(_0x43941d,_0x45fd0d){_0x43941d=_0x43941d-0x0;var _0x27b82a=_0xc410[_0x43941d];return _0x27b82a;};'use strict';var multer=require(_0x0c41('0x0'));var util=require(_0x0c41('0x1'));var path=require(_0x0c41('0x2'));var timeout=require(_0x0c41('0x3'));var express=require(_0x0c41('0x4'));var router=express[_0x0c41('0x5')]();var fs_extra=require(_0x0c41('0x6'));var auth=require(_0x0c41('0x7'));var interaction=require(_0x0c41('0x8'));var config=require(_0x0c41('0x9'));var controller=require('./openchannelQueue.controller');router[_0x0c41('0xa')]('/',auth[_0x0c41('0xb')](),controller[_0x0c41('0xc')]);router[_0x0c41('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x0c41('0xd')]);router[_0x0c41('0xa')](_0x0c41('0xe'),auth[_0x0c41('0xb')](),controller[_0x0c41('0xf')]);router[_0x0c41('0xa')](_0x0c41('0x10'),auth[_0x0c41('0xb')](),controller[_0x0c41('0x11')]);router[_0x0c41('0xa')](_0x0c41('0x12'),auth[_0x0c41('0xb')](),controller[_0x0c41('0x13')]);router['get'](_0x0c41('0x14'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x0c41('0xb')](),controller[_0x0c41('0x15')]);router[_0x0c41('0x16')](_0x0c41('0x12'),auth[_0x0c41('0xb')](),controller['addTeams']);router['post'](_0x0c41('0x14'),auth[_0x0c41('0xb')](),controller[_0x0c41('0x17')]);router['put'](_0x0c41('0xe'),auth[_0x0c41('0xb')](),controller[_0x0c41('0x18')]);router['delete'](_0x0c41('0xe'),auth[_0x0c41('0xb')](),controller['destroy']);router['delete'](_0x0c41('0x12'),auth[_0x0c41('0xb')](),controller[_0x0c41('0x19')]);router['delete'](_0x0c41('0x14'),auth[_0x0c41('0xb')](),controller[_0x0c41('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x59a7=['isAuthenticated','index','/describe','/:id','/:id/members','getMembers','/:id/teams','/:id/users','post','create','addTeams','addAgents','update','delete','removeTeams','removeAgents','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x59e607,_0x2cd7b4){var _0x11f906=function(_0x466b2a){while(--_0x466b2a){_0x59e607['push'](_0x59e607['shift']());}};_0x11f906(++_0x2cd7b4);}(_0x59a7,0x1d3));var _0x759a=function(_0x1269dc,_0x5cc0bc){_0x1269dc=_0x1269dc-0x0;var _0x2a93fb=_0x59a7[_0x1269dc];return _0x2a93fb;};'use strict';var multer=require('multer');var util=require(_0x759a('0x0'));var path=require(_0x759a('0x1'));var timeout=require(_0x759a('0x2'));var express=require(_0x759a('0x3'));var router=express['Router']();var fs_extra=require(_0x759a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x759a('0x5'));var config=require(_0x759a('0x6'));var controller=require('./openchannelQueue.controller');router[_0x759a('0x7')]('/',auth[_0x759a('0x8')](),controller[_0x759a('0x9')]);router[_0x759a('0x7')](_0x759a('0xa'),auth[_0x759a('0x8')](),controller['describe']);router['get'](_0x759a('0xb'),auth[_0x759a('0x8')](),controller['show']);router[_0x759a('0x7')](_0x759a('0xc'),auth[_0x759a('0x8')](),controller[_0x759a('0xd')]);router[_0x759a('0x7')](_0x759a('0xe'),auth[_0x759a('0x8')](),controller['getTeams']);router[_0x759a('0x7')](_0x759a('0xf'),auth[_0x759a('0x8')](),controller['getAgents']);router[_0x759a('0x10')]('/',auth[_0x759a('0x8')](),controller[_0x759a('0x11')]);router[_0x759a('0x10')](_0x759a('0xe'),auth['isAuthenticated'](),controller[_0x759a('0x12')]);router[_0x759a('0x10')]('/:id/users',auth[_0x759a('0x8')](),controller[_0x759a('0x13')]);router['put']('/:id',auth[_0x759a('0x8')](),controller[_0x759a('0x14')]);router[_0x759a('0x15')](_0x759a('0xb'),auth[_0x759a('0x8')](),controller['destroy']);router[_0x759a('0x15')](_0x759a('0xe'),auth[_0x759a('0x8')](),controller[_0x759a('0x16')]);router[_0x759a('0x15')](_0x759a('0xf'),auth['isAuthenticated'](),controller[_0x759a('0x17')]);module[_0x759a('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index e80ede8..51811e9 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 _0xa17a=['sequelize','exports','STRING','name','INTEGER','ENUM','beepall','roundrobin'];(function(_0x1c3281,_0x5c69a0){var _0x27588d=function(_0x47114c){while(--_0x47114c){_0x1c3281['push'](_0x1c3281['shift']());}};_0x27588d(++_0x5c69a0);}(_0xa17a,0x1e8));var _0xaa17=function(_0x4d8789,_0x3fdff1){_0x4d8789=_0x4d8789-0x0;var _0x404e41=_0xa17a[_0x4d8789];return _0x404e41;};'use strict';var Sequelize=require(_0xaa17('0x0'));module[_0xaa17('0x1')]={'name':{'type':Sequelize[_0xaa17('0x2')],'unique':_0xaa17('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xaa17('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaa17('0x5')]('rrmemory',_0xaa17('0x6'),_0xaa17('0x7'))}}; \ No newline at end of file +var _0x961c=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','name','STRING','INTEGER'];(function(_0x3f1990,_0x595e36){var _0x7ddaca=function(_0x3ada87){while(--_0x3ada87){_0x3f1990['push'](_0x3f1990['shift']());}};_0x7ddaca(++_0x595e36);}(_0x961c,0x1a2));var _0xc961=function(_0x2104bc,_0x59fc62){_0x2104bc=_0x2104bc-0x0;var _0x5b7c69=_0x961c[_0x2104bc];return _0x5b7c69;};'use strict';var Sequelize=require(_0xc961('0x0'));module[_0xc961('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc961('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc961('0x3')]},'timeout':{'type':Sequelize[_0xc961('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc961('0x5')](_0xc961('0x6'),_0xc961('0x7'),_0xc961('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index acdabb1..c5b08bd 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 _0x7601=['from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','OpenchannelQueues','destroy','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','UserOpenchannelQueue','OpenchannelQueueId','User','agent','openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','transaction','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','field','tq.TeamId'];(function(_0x1f34d5,_0xf431f5){var _0x214491=function(_0x488a76){while(--_0x488a76){_0x1f34d5['push'](_0x1f34d5['shift']());}};_0x214491(++_0xf431f5);}(_0x7601,0x1c5));var _0x1760=function(_0x5382db,_0xb7e59b){_0x5382db=_0x5382db-0x0;var _0x2f4b39=_0x7601[_0x5382db];return _0x2f4b39;};'use strict';var emlformat=require(_0x1760('0x0'));var rimraf=require(_0x1760('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1760('0x2'));var rp=require('request-promise');var moment=require(_0x1760('0x3'));var BPromise=require(_0x1760('0x4'));var Mustache=require(_0x1760('0x5'));var util=require(_0x1760('0x6'));var path=require(_0x1760('0x7'));var sox=require(_0x1760('0x8'));var csv=require(_0x1760('0x9'));var ejs=require(_0x1760('0xa'));var fs=require('fs');var fs_extra=require(_0x1760('0xb'));var _=require(_0x1760('0xc'));var squel=require(_0x1760('0xd'));var crypto=require(_0x1760('0xe'));var jsforce=require(_0x1760('0xf'));var deskjs=require(_0x1760('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1760('0x11'));var Papa=require('papaparse');var Redis=require(_0x1760('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1760('0x13'));var hardwareService=require(_0x1760('0x14'));var logger=require(_0x1760('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x1760('0x16'));var licenseUtil=require(_0x1760('0x17'));var db=require('../../mysqldb')['db'];config[_0x1760('0x18')]=_[_0x1760('0x19')](config['redis'],{'host':_0x1760('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1760('0x18')]));require('./openchannelQueue.socket')[_0x1760('0x1b')](socket);function respondWithStatusCode(_0x3c6324,_0x35dba9){_0x35dba9=_0x35dba9||0xcc;return function(_0x5c82cf){if(_0x5c82cf){return _0x3c6324[_0x1760('0x1c')](_0x35dba9);}return _0x3c6324[_0x1760('0x1d')](_0x35dba9)['end']();};}function respondWithResult(_0x21acbc,_0x4f5763){_0x4f5763=_0x4f5763||0xc8;return function(_0x66b5c){if(_0x66b5c){return _0x21acbc['status'](_0x4f5763)[_0x1760('0x1e')](_0x66b5c);}};}function respondWithFilteredResult(_0x9385bc,_0x10f2ac){return function(_0x2304e4){if(_0x2304e4){var _0x3cab8f=typeof _0x10f2ac[_0x1760('0x1f')]===_0x1760('0x20')&&typeof _0x10f2ac[_0x1760('0x21')]===_0x1760('0x20');var _0x5e295c=_0x2304e4[_0x1760('0x22')];var _0x9bcd1a=_0x3cab8f?0x0:_0x10f2ac[_0x1760('0x1f')];var _0x214563=_0x3cab8f?_0x2304e4['count']:_0x10f2ac[_0x1760('0x1f')]+_0x10f2ac[_0x1760('0x21')];var _0x391211;if(_0x214563>=_0x5e295c){_0x214563=_0x5e295c;_0x391211=0xc8;}else{_0x391211=0xce;}_0x9385bc[_0x1760('0x1d')](_0x391211);return _0x9385bc[_0x1760('0x23')](_0x1760('0x24'),_0x9bcd1a+'-'+_0x214563+'/'+_0x5e295c)[_0x1760('0x1e')](_0x2304e4);}return null;};}function patchUpdates(_0x2ebb80){return function(_0x35d622){try{jsonpatch[_0x1760('0x25')](_0x35d622,_0x2ebb80,!![]);}catch(_0x193d67){return BPromise[_0x1760('0x26')](_0x193d67);}return _0x35d622['save']();};}function saveUpdates(_0x180192,_0x1cd81b){return function(_0x7e3f8d){if(_0x7e3f8d){return _0x7e3f8d[_0x1760('0x27')](_0x180192)[_0x1760('0x28')](function(_0x24bf68){return _0x24bf68;});}return null;};}function removeEntity(_0x1b48a9,_0x32370a){return function(_0x348a67){if(_0x348a67){return _0x348a67['destroy']()[_0x1760('0x28')](function(){var _0x247eb1=_0x348a67['get']({'plain':!![]});var _0x4a5569=_0x1760('0x29');return db['UserProfileResource'][_0x1760('0x2a')]({'where':{'type':_0x4a5569,'resourceId':_0x247eb1['id']}})[_0x1760('0x28')](function(){return _0x348a67;});})['then'](function(){_0x1b48a9[_0x1760('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46626f,_0x168940){return function(_0x56927e){if(!_0x56927e){_0x46626f[_0x1760('0x1c')](0x194);}return _0x56927e;};}function handleError(_0x4e0cb5,_0xb970ec){_0xb970ec=_0xb970ec||0x1f4;return function(_0x5c9e3d){logger[_0x1760('0x2b')](_0x5c9e3d[_0x1760('0x2c')]);if(_0x5c9e3d[_0x1760('0x2d')]){delete _0x5c9e3d['name'];}_0x4e0cb5[_0x1760('0x1d')](_0xb970ec)[_0x1760('0x2e')](_0x5c9e3d);};}exports[_0x1760('0x2f')]=function(_0x987dcb,_0x452634){var _0x5c6f90={},_0x2bf8e1={},_0x332ce8={'count':0x0,'rows':[]};var _0x3bef9d=_[_0x1760('0x30')](db[_0x1760('0x31')][_0x1760('0x32')],function(_0x5dc8cd){return{'name':_0x5dc8cd[_0x1760('0x33')],'type':_0x5dc8cd[_0x1760('0x34')][_0x1760('0x35')]};});_0x2bf8e1[_0x1760('0x36')]=_[_0x1760('0x30')](_0x3bef9d,_0x1760('0x2d'));_0x2bf8e1[_0x1760('0x37')]=_[_0x1760('0x38')](_0x987dcb[_0x1760('0x37')]);_0x2bf8e1[_0x1760('0x39')]=_[_0x1760('0x3a')](_0x2bf8e1[_0x1760('0x36')],_0x2bf8e1['query']);_0x5c6f90[_0x1760('0x3b')]=_[_0x1760('0x3a')](_0x2bf8e1[_0x1760('0x36')],qs[_0x1760('0x3c')](_0x987dcb[_0x1760('0x37')][_0x1760('0x3c')]));_0x5c6f90[_0x1760('0x3b')]=_0x5c6f90[_0x1760('0x3b')][_0x1760('0x3d')]?_0x5c6f90[_0x1760('0x3b')]:_0x2bf8e1[_0x1760('0x36')];if(!_0x987dcb[_0x1760('0x37')][_0x1760('0x3e')](_0x1760('0x3f'))){_0x5c6f90[_0x1760('0x21')]=qs[_0x1760('0x21')](_0x987dcb[_0x1760('0x37')][_0x1760('0x21')]);_0x5c6f90[_0x1760('0x1f')]=qs[_0x1760('0x1f')](_0x987dcb[_0x1760('0x37')][_0x1760('0x1f')]);}_0x5c6f90[_0x1760('0x40')]=qs[_0x1760('0x41')](_0x987dcb[_0x1760('0x37')][_0x1760('0x41')]);_0x5c6f90[_0x1760('0x42')]=qs[_0x1760('0x39')](_[_0x1760('0x43')](_0x987dcb[_0x1760('0x37')],_0x2bf8e1[_0x1760('0x39')]),_0x3bef9d);if(_0x987dcb[_0x1760('0x37')][_0x1760('0x44')]){_0x5c6f90['where']=_[_0x1760('0x45')](_0x5c6f90[_0x1760('0x42')],{'$or':_[_0x1760('0x30')](_0x3bef9d,function(_0x42ecc0){if(_0x42ecc0['type']!=='VIRTUAL'){var _0x46de32={};_0x46de32[_0x42ecc0[_0x1760('0x2d')]]={'$like':'%'+_0x987dcb['query'][_0x1760('0x44')]+'%'};return _0x46de32;}})});}_0x5c6f90=_['merge']({},_0x5c6f90,_0x987dcb[_0x1760('0x46')]);var _0x3cc6e7={'where':_0x5c6f90[_0x1760('0x42')]};return db['OpenchannelQueue'][_0x1760('0x22')](_0x3cc6e7)['then'](function(_0x81b550){_0x332ce8[_0x1760('0x22')]=_0x81b550;if(_0x987dcb['query'][_0x1760('0x47')]){_0x5c6f90[_0x1760('0x48')]=[{'all':!![]}];}return db[_0x1760('0x31')][_0x1760('0x49')](_0x5c6f90);})['then'](function(_0x2d8011){_0x332ce8[_0x1760('0x4a')]=_0x2d8011;return _0x332ce8;})[_0x1760('0x28')](respondWithFilteredResult(_0x452634,_0x5c6f90))[_0x1760('0x4b')](handleError(_0x452634,null));};exports[_0x1760('0x4c')]=function(_0x108d6a,_0x14c49b){var _0x354803={'raw':!![],'where':{'id':_0x108d6a[_0x1760('0x4d')]['id']}},_0x458df9={};_0x458df9[_0x1760('0x36')]=_[_0x1760('0x38')](db['OpenchannelQueue'][_0x1760('0x32')]);_0x458df9[_0x1760('0x37')]=_[_0x1760('0x38')](_0x108d6a['query']);_0x458df9[_0x1760('0x39')]=_[_0x1760('0x3a')](_0x458df9[_0x1760('0x36')],_0x458df9['query']);_0x354803[_0x1760('0x3b')]=_[_0x1760('0x3a')](_0x458df9[_0x1760('0x36')],qs[_0x1760('0x3c')](_0x108d6a['query'][_0x1760('0x3c')]));_0x354803[_0x1760('0x3b')]=_0x354803[_0x1760('0x3b')][_0x1760('0x3d')]?_0x354803['attributes']:_0x458df9[_0x1760('0x36')];if(_0x108d6a['query'][_0x1760('0x47')]){_0x354803[_0x1760('0x48')]=[{'all':!![]}];}_0x354803=_[_0x1760('0x45')]({},_0x354803,_0x108d6a[_0x1760('0x46')]);return db[_0x1760('0x31')][_0x1760('0x4e')](_0x354803)[_0x1760('0x28')](handleEntityNotFound(_0x14c49b,null))[_0x1760('0x28')](respondWithResult(_0x14c49b,null))[_0x1760('0x4b')](handleError(_0x14c49b,null));};exports[_0x1760('0x4f')]=function(_0x1afd2d,_0x2200ec){return db[_0x1760('0x31')]['create'](_0x1afd2d[_0x1760('0x50')],{})['then'](function(_0xe6825d){var _0x5da1bb=_0x1afd2d['user'][_0x1760('0x51')]({'plain':!![]});if(!_0x5da1bb)throw new Error(_0x1760('0x52'));if(_0x5da1bb['role']===_0x1760('0x53')){var _0x2f910f=_0xe6825d[_0x1760('0x51')]({'plain':!![]});var _0x1fa16d=_0x1760('0x29');return db[_0x1760('0x54')][_0x1760('0x4e')]({'where':{'name':_0x1fa16d,'userProfileId':_0x5da1bb['userProfileId']},'raw':!![]})[_0x1760('0x28')](function(_0x427061){if(_0x427061&&_0x427061[_0x1760('0x55')]===0x0){return db[_0x1760('0x56')]['create']({'name':_0x2f910f[_0x1760('0x2d')],'resourceId':_0x2f910f['id'],'type':_0x427061[_0x1760('0x2d')],'sectionId':_0x427061['id']},{})[_0x1760('0x28')](function(){return _0xe6825d;});}else{return _0xe6825d;}})[_0x1760('0x4b')](function(_0xa21542){logger[_0x1760('0x2b')](_0x1760('0x57'),_0xa21542);throw _0xa21542;});}return _0xe6825d;})[_0x1760('0x28')](respondWithResult(_0x2200ec,0xc9))['catch'](handleError(_0x2200ec,null));};exports['update']=function(_0x855439,_0x1761d9){if(_0x855439[_0x1760('0x50')]['id']){delete _0x855439[_0x1760('0x50')]['id'];}return db['OpenchannelQueue'][_0x1760('0x4e')]({'where':{'id':_0x855439[_0x1760('0x4d')]['id']}})[_0x1760('0x28')](handleEntityNotFound(_0x1761d9,null))[_0x1760('0x28')](saveUpdates(_0x855439[_0x1760('0x50')],null))[_0x1760('0x28')](respondWithResult(_0x1761d9,null))[_0x1760('0x4b')](handleError(_0x1761d9,null));};exports[_0x1760('0x2a')]=function(_0x20850d,_0x1ec6d0){return db[_0x1760('0x31')][_0x1760('0x4e')]({'where':{'id':_0x20850d[_0x1760('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1ec6d0,null))[_0x1760('0x28')](removeEntity(_0x1ec6d0,null))['catch'](handleError(_0x1ec6d0,null));};exports['describe']=function(_0x2da396,_0x31014d){return db['OpenchannelQueue']['describe']()[_0x1760('0x28')](respondWithResult(_0x31014d,null))[_0x1760('0x4b')](handleError(_0x31014d,null));};exports[_0x1760('0x58')]=function(_0x3c496f,_0x435a47,_0x2d056f){var _0x55c693={'raw':!![],'where':{}},_0x42e96c={},_0x1521d8;return db[_0x1760('0x31')]['findOne']({'where':{'id':_0x3c496f['params']['id']}})[_0x1760('0x28')](handleEntityNotFound(_0x435a47,null))['then'](function(_0x1d8912){if(_0x1d8912){_0x1521d8=_0x1d8912[_0x1760('0x51')]({'plain':!![]});_0x42e96c[_0x1760('0x36')]=_[_0x1760('0x38')](db[_0x1760('0x59')]['rawAttributes']);_0x42e96c[_0x1760('0x37')]=_[_0x1760('0x38')](_0x3c496f['query']);_0x42e96c['filters']=_['intersection'](_0x42e96c['model'],_0x42e96c[_0x1760('0x37')]);_0x55c693[_0x1760('0x3b')]=_[_0x1760('0x3a')](_0x42e96c[_0x1760('0x36')],qs[_0x1760('0x3c')](_0x3c496f['query']['fields']));_0x55c693[_0x1760('0x3b')]=_0x55c693[_0x1760('0x3b')][_0x1760('0x3d')]?_0x55c693[_0x1760('0x3b')]:_0x42e96c['model'];if(!_0x3c496f['query'][_0x1760('0x3e')](_0x1760('0x3f'))){_0x55c693['limit']=qs[_0x1760('0x21')](_0x3c496f[_0x1760('0x37')][_0x1760('0x21')]);_0x55c693[_0x1760('0x1f')]=qs[_0x1760('0x1f')](_0x3c496f[_0x1760('0x37')][_0x1760('0x1f')]);}_0x55c693[_0x1760('0x40')]=qs['sort'](_0x3c496f[_0x1760('0x37')]['sort']);_0x55c693[_0x1760('0x42')]=qs[_0x1760('0x39')](_[_0x1760('0x43')](_0x3c496f['query'],_0x42e96c['filters']));_0x55c693[_0x1760('0x42')][_0x1760('0x5a')]=_0x1d8912['id'];if(_0x3c496f['query'][_0x1760('0x44')]){_0x55c693['where']=_[_0x1760('0x45')](_0x55c693[_0x1760('0x42')],{'$or':_[_0x1760('0x30')](_0x55c693[_0x1760('0x3b')],function(_0x135737){var _0x1dd7c1={};_0x1dd7c1[_0x135737]={'$like':'%'+_0x3c496f['query'][_0x1760('0x44')]+'%'};return _0x1dd7c1;})});}_0x55c693=_['merge']({},_0x55c693,_0x3c496f[_0x1760('0x46')]);return db[_0x1760('0x59')][_0x1760('0x49')](_0x55c693);}})['then'](function(_0x5b93d8){if(_0x5b93d8){return db[_0x1760('0x5b')]['findAndCountAll']({'where':{'id':_[_0x1760('0x30')](_0x5b93d8,'UserId'),'role':_0x1760('0x5c')},'attributes':['id',_0x1760('0x2d'),_0x1760('0x5d'),'updatedAt',_0x1760('0x5e')]});}})[_0x1760('0x28')](function(_0x472b55){if(_0x472b55){return{'count':_0x472b55[_0x1760('0x22')],'rows':_[_0x1760('0x30')](_0x472b55[_0x1760('0x4a')],function(_0xf2351e){return{'membername':_0xf2351e[_0x1760('0x2d')],'UserId':_0xf2351e['id'],'queue_name':_0x1521d8[_0x1760('0x2d')],'OpenchannelQueueId':_0x1521d8['id'],'interface':util[_0x1760('0x5f')](_0x1760('0x60'),_0x1760('0x61'),_0xf2351e[_0x1760('0x2d')]),'penalty':0x0,'paused':_0xf2351e['openchannelPause'],'createdAt':_0xf2351e[_0x1760('0x5e')],'updatedAt':_0xf2351e[_0x1760('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1760('0x28')](respondWithFilteredResult(_0x435a47,_0x55c693))[_0x1760('0x4b')](handleError(_0x435a47,null));};exports[_0x1760('0x63')]=function(_0x3397e1,_0x369c72,_0x5c1372){var _0x72fc3c={};var _0xf79b2a={};var _0x5d7d19;var _0xbecf3e;return db['OpenchannelQueue'][_0x1760('0x64')]({'where':{'id':_0x3397e1[_0x1760('0x4d')]['id']}})[_0x1760('0x28')](handleEntityNotFound(_0x369c72,null))[_0x1760('0x28')](function(_0xb529f4){if(_0xb529f4){_0x5d7d19=_0xb529f4;_0xf79b2a[_0x1760('0x36')]=_[_0x1760('0x38')](db[_0x1760('0x65')][_0x1760('0x32')]);_0xf79b2a[_0x1760('0x37')]=_[_0x1760('0x38')](_0x3397e1['query']);_0xf79b2a[_0x1760('0x39')]=_[_0x1760('0x3a')](_0xf79b2a[_0x1760('0x36')],_0xf79b2a[_0x1760('0x37')]);_0x72fc3c['attributes']=_[_0x1760('0x3a')](_0xf79b2a[_0x1760('0x36')],qs[_0x1760('0x3c')](_0x3397e1[_0x1760('0x37')][_0x1760('0x3c')]));_0x72fc3c[_0x1760('0x3b')]=_0x72fc3c['attributes'][_0x1760('0x3d')]?_0x72fc3c[_0x1760('0x3b')]:_0xf79b2a[_0x1760('0x36')];_0x72fc3c['order']=qs[_0x1760('0x41')](_0x3397e1[_0x1760('0x37')][_0x1760('0x41')]);_0x72fc3c[_0x1760('0x42')]=qs[_0x1760('0x39')](_[_0x1760('0x43')](_0x3397e1[_0x1760('0x37')],_0xf79b2a[_0x1760('0x39')]));if(_0x3397e1[_0x1760('0x37')][_0x1760('0x44')]){_0x72fc3c[_0x1760('0x42')]=_[_0x1760('0x45')](_0x72fc3c['where'],{'$or':_[_0x1760('0x30')](_0x72fc3c[_0x1760('0x3b')],function(_0x1fe5ee){var _0x4e7c9c={};_0x4e7c9c[_0x1fe5ee]={'$like':'%'+_0x3397e1['query'][_0x1760('0x44')]+'%'};return _0x4e7c9c;})});}_0x72fc3c=_[_0x1760('0x45')]({},_0x72fc3c,_0x3397e1['options']);return _0x5d7d19['getTeams'](_0x72fc3c);}})[_0x1760('0x28')](function(_0x4f5f3b){if(_0x4f5f3b){_0xbecf3e=_0x4f5f3b[_0x1760('0x3d')];if(!_0x3397e1[_0x1760('0x37')][_0x1760('0x3e')](_0x1760('0x3f'))){_0x72fc3c[_0x1760('0x21')]=qs['limit'](_0x3397e1[_0x1760('0x37')][_0x1760('0x21')]);_0x72fc3c[_0x1760('0x1f')]=qs[_0x1760('0x1f')](_0x3397e1[_0x1760('0x37')][_0x1760('0x1f')]);}return _0x5d7d19['getTeams'](_0x72fc3c);}})[_0x1760('0x28')](function(_0x57fb05){if(_0x57fb05){return _0x57fb05?{'count':_0xbecf3e,'rows':_0x57fb05}:null;}})[_0x1760('0x28')](respondWithResult(_0x369c72,null))[_0x1760('0x4b')](handleError(_0x369c72,null));};exports[_0x1760('0x66')]=function(_0xac3b55,_0x3ecf6f,_0x2a408e){var _0x55f0d3=_0xac3b55[_0x1760('0x50')][_0x1760('0x67')];return db['Team'][_0x1760('0x49')]({'where':{'id':_0x55f0d3},'attributes':['id'],'include':[{'model':db[_0x1760('0x5b')],'as':_0x1760('0x68'),'attributes':['id',_0x1760('0x2d'),_0x1760('0x69'),_0x1760('0x6a'),'interface'],'raw':!![]}]})[_0x1760('0x28')](function(_0x30e9e7){if(_0x30e9e7){var _0xb9269e=_['flatMap'](_0x30e9e7,function(_0x3c340b){var _0x3f9d83=_0x3c340b['get']({'plain':!![]});return _0x3f9d83['Agents'];});return db[_0x1760('0x31')][_0x1760('0x4e')]({'where':{'id':_0xac3b55['params']['id']}})[_0x1760('0x28')](function(_0x1b1491){return db['sequelize'][_0x1760('0x6b')](function(_0x58f68f){return _0x1b1491['addTeams'](_0x55f0d3,{'transaction':_0x58f68f})[_0x1760('0x28')](function(){return BPromise['each'](_0xb9269e,function(_0x4c261e){return db[_0x1760('0x59')][_0x1760('0x6c')]({'where':{'UserId':_0x4c261e['id'],'OpenchannelQueueId':_0xac3b55[_0x1760('0x4d')]['id']},'transaction':_0x58f68f});});})[_0x1760('0x28')](function(){_0xb9269e[_0x1760('0x6d')](function(_0x438fb4){socket[_0x1760('0x6e')](_0x1760('0x6f'),{'UserId':_0x438fb4['id'],'OpenchannelQueueId':_0x1b1491['id']});});});});});}})[_0x1760('0x28')](respondWithStatusCode(_0x3ecf6f,null))[_0x1760('0x4b')](handleError(_0x3ecf6f,null));};exports[_0x1760('0x70')]=function(_0x3d90e8,_0x3e0700,_0x37b2da){return db[_0x1760('0x65')][_0x1760('0x49')]({'where':{'id':_0x3d90e8[_0x1760('0x37')][_0x1760('0x67')]},'attributes':['id'],'include':[{'model':db[_0x1760('0x5b')],'as':_0x1760('0x68'),'attributes':['id'],'raw':!![]}]})[_0x1760('0x28')](handleEntityNotFound(_0x3e0700,null))[_0x1760('0x28')](function(_0x5ac44a){var _0x5158a6=_[_0x1760('0x30')](_0x5ac44a,'id');var _0xf8b319=[];var _0x2525fe=[];var _0x3c8c59=squel['select']();_0x3c8c59[_0x1760('0x71')](_0x1760('0x72'))[_0x1760('0x73')](_0x1760('0x74'),'tq')[_0x1760('0x75')](_0x1760('0x76'),'ut',_0x1760('0x77'))[_0x1760('0x42')](_0x1760('0x78'),_0x3d90e8[_0x1760('0x4d')]['id']);for(var _0x5a9f95=0x0;_0x5a9f95<_0x5ac44a[_0x1760('0x3d')];_0x5a9f95+=0x1){let _0x41eeba=_0x5ac44a[_0x5a9f95];for(var _0x3ed403=0x0;_0x3ed403<_0x41eeba[_0x1760('0x68')]['length'];_0x3ed403+=0x1){let _0x4f904a=_0x41eeba[_0x1760('0x68')][_0x3ed403];var _0x1fc293=_0x3c8c59[_0x1760('0x79')]();_0x1fc293[_0x1760('0x42')](_0x1760('0x7a'),_0x4f904a['id']);_0x2525fe[_0x1760('0x7b')](db['sequelize']['query'](_0x1fc293[_0x1760('0x7c')](),{'type':db[_0x1760('0x7d')][_0x1760('0x7e')][_0x1760('0x7f')]})[_0x1760('0x28')](function(_0x53bbf3){if(_0x53bbf3[_0x1760('0x3d')]===0x1){return _0x4f904a['id'];}else{var _0x16b0c5=_['every'](_[_0x1760('0x30')](_0x53bbf3,_0x1760('0x80')),function(_0x2392d1){return _[_0x1760('0x81')](_0x5158a6,_0x2392d1);});if(_0x16b0c5){return _0x4f904a['id'];}}}));}}return BPromise[_0x1760('0x82')](_0x2525fe)[_0x1760('0x28')](function(_0x863d2a){_0xf8b319=_(_0xf8b319)[_0x1760('0x83')](_0x863d2a)[_0x1760('0x84')]()[_0x1760('0x85')]();return db['OpenchannelQueue'][_0x1760('0x4e')]({'where':{'id':_0x3d90e8[_0x1760('0x4d')]['id']}})['then'](function(_0x5446e5){return db[_0x1760('0x7d')]['transaction'](function(_0x19b9d2){return _0x5446e5[_0x1760('0x70')](_0x3d90e8[_0x1760('0x37')][_0x1760('0x67')],{'transaction':_0x19b9d2})[_0x1760('0x28')](function(){if(!_[_0x1760('0x86')](_0xf8b319)){return _0x5446e5[_0x1760('0x87')](_0xf8b319,{'transaction':_0x19b9d2});}})[_0x1760('0x28')](function(){_0xf8b319['forEach'](function(_0xf3564f){socket[_0x1760('0x6e')]('userOpenchannelQueue:remove',{'UserId':_0xf3564f,'OpenchannelQueueId':_0x5446e5['id']});});});});});});})[_0x1760('0x28')](respondWithStatusCode(_0x3e0700,null))[_0x1760('0x4b')](handleError(_0x3e0700,null));};exports[_0x1760('0x88')]=function(_0x2503c1,_0x50425b,_0x430fe6){return db[_0x1760('0x31')]['find']({'where':{'id':_0x2503c1['params']['id']}})[_0x1760('0x28')](handleEntityNotFound(_0x50425b,null))[_0x1760('0x28')](function(_0x15c447){if(_0x15c447){return _0x15c447[_0x1760('0x88')](_0x2503c1[_0x1760('0x50')][_0x1760('0x67')],_[_0x1760('0x89')](_0x2503c1[_0x1760('0x50')],[_0x1760('0x67'),'id'])||{})[_0x1760('0x8a')](function(_0x222d1f){for(var _0x5ae76c=0x0;_0x5ae76c<_0x2503c1[_0x1760('0x50')][_0x1760('0x67')][_0x1760('0x3d')];_0x5ae76c+=0x1){socket[_0x1760('0x6e')]('userOpenchannelQueue:save',{'UserId':Number(_0x2503c1['body'][_0x1760('0x67')][_0x5ae76c]),'OpenchannelQueueId':Number(_0x2503c1[_0x1760('0x4d')]['id'])});}return _0x222d1f;});}})[_0x1760('0x28')](respondWithResult(_0x50425b,null))[_0x1760('0x4b')](handleError(_0x50425b,null));};exports[_0x1760('0x87')]=function(_0x4e44a0,_0x339d02,_0x3928ed){return db[_0x1760('0x31')][_0x1760('0x4e')]({'where':{'id':_0x4e44a0[_0x1760('0x4d')]['id']}})[_0x1760('0x28')](handleEntityNotFound(_0x339d02,null))['then'](function(_0x112796){if(_0x112796){return _0x112796[_0x1760('0x87')](_0x4e44a0[_0x1760('0x37')][_0x1760('0x67')])[_0x1760('0x28')](function(){if(_[_0x1760('0x8b')](_0x4e44a0['query'][_0x1760('0x67')])){for(var _0x225145=0x0;_0x225145<_0x4e44a0['query']['ids'][_0x1760('0x3d')];_0x225145+=0x1){socket[_0x1760('0x6e')](_0x1760('0x8c'),{'UserId':Number(_0x4e44a0[_0x1760('0x37')][_0x1760('0x67')][_0x225145]),'OpenchannelQueueId':Number(_0x4e44a0[_0x1760('0x4d')]['id'])});}}else{socket[_0x1760('0x6e')]('userOpenchannelQueue:remove',{'UserId':Number(_0x4e44a0[_0x1760('0x37')][_0x1760('0x67')]),'OpenchannelQueueId':Number(_0x4e44a0[_0x1760('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x339d02,null))[_0x1760('0x4b')](handleError(_0x339d02,null));};exports[_0x1760('0x8d')]=function(_0x258eeb,_0x1aa5b8,_0x5be44c){var _0x1783bf={};var _0x234ab5={};var _0x228c8c;var _0x358e68;return db[_0x1760('0x31')][_0x1760('0x64')]({'where':{'id':_0x258eeb['params']['id']}})[_0x1760('0x28')](handleEntityNotFound(_0x1aa5b8,null))[_0x1760('0x28')](function(_0x113e0a){if(_0x113e0a){_0x228c8c=_0x113e0a;_0x234ab5[_0x1760('0x36')]=_[_0x1760('0x38')](db[_0x1760('0x5b')][_0x1760('0x32')]);_0x234ab5['query']=_['keys'](_0x258eeb['query']);_0x234ab5[_0x1760('0x39')]=_[_0x1760('0x3a')](_0x234ab5[_0x1760('0x36')],_0x234ab5[_0x1760('0x37')]);_0x1783bf['attributes']=_[_0x1760('0x3a')](_0x234ab5[_0x1760('0x36')],qs[_0x1760('0x3c')](_0x258eeb[_0x1760('0x37')][_0x1760('0x3c')]));_0x1783bf[_0x1760('0x3b')]=_0x1783bf[_0x1760('0x3b')]['length']?_0x1783bf['attributes']:_0x234ab5[_0x1760('0x36')];_0x1783bf['order']=qs['sort'](_0x258eeb['query'][_0x1760('0x41')]);_0x1783bf[_0x1760('0x42')]=qs[_0x1760('0x39')](_['pick'](_0x258eeb[_0x1760('0x37')],_0x234ab5[_0x1760('0x39')]));if(_0x258eeb[_0x1760('0x37')][_0x1760('0x44')]){_0x1783bf[_0x1760('0x42')]=_[_0x1760('0x45')](_0x1783bf[_0x1760('0x42')],{'$or':_['map'](_0x1783bf[_0x1760('0x3b')],function(_0x2c835a){var _0x221c5e={};_0x221c5e[_0x2c835a]={'$like':'%'+_0x258eeb[_0x1760('0x37')]['filter']+'%'};return _0x221c5e;})});}_0x1783bf=_[_0x1760('0x45')]({},_0x1783bf,_0x258eeb['options']);return _0x228c8c[_0x1760('0x8d')](_0x1783bf);}})['then'](function(_0x2a9c2e){if(_0x2a9c2e){_0x358e68=_0x2a9c2e[_0x1760('0x3d')];if(!_0x258eeb['query']['hasOwnProperty'](_0x1760('0x3f'))){_0x1783bf[_0x1760('0x21')]=qs[_0x1760('0x21')](_0x258eeb[_0x1760('0x37')][_0x1760('0x21')]);_0x1783bf[_0x1760('0x1f')]=qs['offset'](_0x258eeb[_0x1760('0x37')][_0x1760('0x1f')]);}return _0x228c8c[_0x1760('0x8d')](_0x1783bf);}})[_0x1760('0x28')](function(_0xad68){if(_0xad68){return _0xad68?{'count':_0x358e68,'rows':_0xad68}:null;}})[_0x1760('0x28')](respondWithResult(_0x1aa5b8,null))['catch'](handleError(_0x1aa5b8,null));}; \ No newline at end of file +var _0x2475=['includeAll','include','findAll','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','UserOpenchannelQueue','hasOwnProperty','order','OpenchannelQueueId','User','findAndCountAll','UserId','agent','createdAt','format','%s/%s','SIP','openchannelPause','getTeams','findOne','Team','pick','filter','online','flatMap','Agents','sequelize','transaction','addTeams','each','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','ids','field','tq.TeamId','from','team_has_openchannel_queues','join','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','compact','value','emit','userOpenchannelQueue:remove','addAgents','spread','removeAgents','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','options','OpenchannelQueue'];(function(_0x582e68,_0xda0a42){var _0x63bf99=function(_0x1c7173){while(--_0x1c7173){_0x582e68['push'](_0x582e68['shift']());}};_0x63bf99(++_0xda0a42);}(_0x2475,0xc6));var _0x5247=function(_0x5d4204,_0x332377){_0x5d4204=_0x5d4204-0x0;var _0x5f526a=_0x2475[_0x5d4204];return _0x5f526a;};'use strict';var emlformat=require(_0x5247('0x0'));var rimraf=require(_0x5247('0x1'));var zipdir=require(_0x5247('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5247('0x3'));var moment=require(_0x5247('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5247('0x5'));var csv=require(_0x5247('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5247('0x7'));var crypto=require(_0x5247('0x8'));var jsforce=require(_0x5247('0x9'));var deskjs=require(_0x5247('0xa'));var toCsv=require(_0x5247('0x6'));var querystring=require(_0x5247('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5247('0xc'));var qs=require(_0x5247('0xd'));var as=require(_0x5247('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5247('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5247('0x10'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x5247('0x11')](config[_0x5247('0x12')],{'host':_0x5247('0x13'),'port':0x18eb});var socket=require(_0x5247('0x14'))(new Redis(config[_0x5247('0x12')]));require('./openchannelQueue.socket')[_0x5247('0x15')](socket);function respondWithStatusCode(_0x1248b5,_0x1f85be){_0x1f85be=_0x1f85be||0xcc;return function(_0x3ea7a2){if(_0x3ea7a2){return _0x1248b5[_0x5247('0x16')](_0x1f85be);}return _0x1248b5[_0x5247('0x17')](_0x1f85be)[_0x5247('0x18')]();};}function respondWithResult(_0x14599b,_0x11c752){_0x11c752=_0x11c752||0xc8;return function(_0x271a2e){if(_0x271a2e){return _0x14599b[_0x5247('0x17')](_0x11c752)[_0x5247('0x19')](_0x271a2e);}};}function respondWithFilteredResult(_0x49f57d,_0x24a22b){return function(_0x26d8e5){if(_0x26d8e5){var _0x5b9bf0=typeof _0x24a22b[_0x5247('0x1a')]===_0x5247('0x1b')&&typeof _0x24a22b[_0x5247('0x1c')]===_0x5247('0x1b');var _0x50d152=_0x26d8e5['count'];var _0x11de71=_0x5b9bf0?0x0:_0x24a22b['offset'];var _0x3537a1=_0x5b9bf0?_0x26d8e5[_0x5247('0x1d')]:_0x24a22b[_0x5247('0x1a')]+_0x24a22b[_0x5247('0x1c')];var _0x21ab2f;if(_0x3537a1>=_0x50d152){_0x3537a1=_0x50d152;_0x21ab2f=0xc8;}else{_0x21ab2f=0xce;}_0x49f57d[_0x5247('0x17')](_0x21ab2f);return _0x49f57d['set'](_0x5247('0x1e'),_0x11de71+'-'+_0x3537a1+'/'+_0x50d152)[_0x5247('0x19')](_0x26d8e5);}return null;};}function patchUpdates(_0x38292a){return function(_0x62caf1){try{jsonpatch[_0x5247('0x1f')](_0x62caf1,_0x38292a,!![]);}catch(_0x198e05){return BPromise[_0x5247('0x20')](_0x198e05);}return _0x62caf1['save']();};}function saveUpdates(_0x48f9c7,_0x1e6b64){return function(_0x2c8b07){if(_0x2c8b07){return _0x2c8b07[_0x5247('0x21')](_0x48f9c7)[_0x5247('0x22')](function(_0x1a99cb){return _0x1a99cb;});}return null;};}function removeEntity(_0x47f2fd,_0x16c0a6){return function(_0x408bac){if(_0x408bac){return _0x408bac[_0x5247('0x23')]()[_0x5247('0x22')](function(){var _0x557153=_0x408bac[_0x5247('0x24')]({'plain':!![]});var _0x3a8157=_0x5247('0x25');return db[_0x5247('0x26')][_0x5247('0x23')]({'where':{'type':_0x3a8157,'resourceId':_0x557153['id']}})[_0x5247('0x22')](function(){return _0x408bac;});})[_0x5247('0x22')](function(){_0x47f2fd[_0x5247('0x17')](0xcc)[_0x5247('0x18')]();});}};}function handleEntityNotFound(_0xec42e6,_0x1ba5bb){return function(_0x2f00de){if(!_0x2f00de){_0xec42e6[_0x5247('0x16')](0x194);}return _0x2f00de;};}function handleError(_0x57a716,_0x3de7d3){_0x3de7d3=_0x3de7d3||0x1f4;return function(_0x29736d){logger[_0x5247('0x27')](_0x29736d[_0x5247('0x28')]);if(_0x29736d[_0x5247('0x29')]){delete _0x29736d['name'];}_0x57a716[_0x5247('0x17')](_0x3de7d3)[_0x5247('0x2a')](_0x29736d);};}exports[_0x5247('0x2b')]=function(_0x4999f6,_0x20a907){var _0x3aa635={},_0x37957d={},_0x4d5f41={'count':0x0,'rows':[]};var _0x1fac74=_[_0x5247('0x2c')](db['OpenchannelQueue'][_0x5247('0x2d')],function(_0xac2ec8){return{'name':_0xac2ec8['fieldName'],'type':_0xac2ec8[_0x5247('0x2e')]['key']};});_0x37957d[_0x5247('0x2f')]=_['map'](_0x1fac74,'name');_0x37957d[_0x5247('0x30')]=_[_0x5247('0x31')](_0x4999f6[_0x5247('0x30')]);_0x37957d[_0x5247('0x32')]=_[_0x5247('0x33')](_0x37957d[_0x5247('0x2f')],_0x37957d[_0x5247('0x30')]);_0x3aa635[_0x5247('0x34')]=_[_0x5247('0x33')](_0x37957d['model'],qs[_0x5247('0x35')](_0x4999f6['query'][_0x5247('0x35')]));_0x3aa635['attributes']=_0x3aa635['attributes'][_0x5247('0x36')]?_0x3aa635[_0x5247('0x34')]:_0x37957d[_0x5247('0x2f')];if(!_0x4999f6['query']['hasOwnProperty'](_0x5247('0x37'))){_0x3aa635['limit']=qs[_0x5247('0x1c')](_0x4999f6[_0x5247('0x30')][_0x5247('0x1c')]);_0x3aa635[_0x5247('0x1a')]=qs['offset'](_0x4999f6[_0x5247('0x30')][_0x5247('0x1a')]);}_0x3aa635['order']=qs['sort'](_0x4999f6[_0x5247('0x30')][_0x5247('0x38')]);_0x3aa635[_0x5247('0x39')]=qs[_0x5247('0x32')](_['pick'](_0x4999f6['query'],_0x37957d[_0x5247('0x32')]),_0x1fac74);if(_0x4999f6[_0x5247('0x30')]['filter']){_0x3aa635[_0x5247('0x39')]=_[_0x5247('0x3a')](_0x3aa635['where'],{'$or':_[_0x5247('0x2c')](_0x1fac74,function(_0x4e9542){if(_0x4e9542[_0x5247('0x2e')]!==_0x5247('0x3b')){var _0x8c7a88={};_0x8c7a88[_0x4e9542[_0x5247('0x29')]]={'$like':'%'+_0x4999f6[_0x5247('0x30')]['filter']+'%'};return _0x8c7a88;}})});}_0x3aa635=_[_0x5247('0x3a')]({},_0x3aa635,_0x4999f6[_0x5247('0x3c')]);var _0xa5af32={'where':_0x3aa635[_0x5247('0x39')]};return db[_0x5247('0x3d')][_0x5247('0x1d')](_0xa5af32)['then'](function(_0x1ed9e7){_0x4d5f41[_0x5247('0x1d')]=_0x1ed9e7;if(_0x4999f6[_0x5247('0x30')][_0x5247('0x3e')]){_0x3aa635[_0x5247('0x3f')]=[{'all':!![]}];}return db[_0x5247('0x3d')][_0x5247('0x40')](_0x3aa635);})[_0x5247('0x22')](function(_0x24d0b8){_0x4d5f41[_0x5247('0x41')]=_0x24d0b8;return _0x4d5f41;})[_0x5247('0x22')](respondWithFilteredResult(_0x20a907,_0x3aa635))[_0x5247('0x42')](handleError(_0x20a907,null));};exports['show']=function(_0x56fe70,_0x519751){var _0x8d2b24={'raw':!![],'where':{'id':_0x56fe70[_0x5247('0x43')]['id']}},_0xaa279a={};_0xaa279a[_0x5247('0x2f')]=_[_0x5247('0x31')](db[_0x5247('0x3d')]['rawAttributes']);_0xaa279a[_0x5247('0x30')]=_[_0x5247('0x31')](_0x56fe70[_0x5247('0x30')]);_0xaa279a[_0x5247('0x32')]=_['intersection'](_0xaa279a[_0x5247('0x2f')],_0xaa279a['query']);_0x8d2b24[_0x5247('0x34')]=_['intersection'](_0xaa279a[_0x5247('0x2f')],qs[_0x5247('0x35')](_0x56fe70['query']['fields']));_0x8d2b24[_0x5247('0x34')]=_0x8d2b24[_0x5247('0x34')][_0x5247('0x36')]?_0x8d2b24['attributes']:_0xaa279a[_0x5247('0x2f')];if(_0x56fe70[_0x5247('0x30')][_0x5247('0x3e')]){_0x8d2b24[_0x5247('0x3f')]=[{'all':!![]}];}_0x8d2b24=_[_0x5247('0x3a')]({},_0x8d2b24,_0x56fe70[_0x5247('0x3c')]);return db[_0x5247('0x3d')][_0x5247('0x44')](_0x8d2b24)[_0x5247('0x22')](handleEntityNotFound(_0x519751,null))[_0x5247('0x22')](respondWithResult(_0x519751,null))[_0x5247('0x42')](handleError(_0x519751,null));};exports[_0x5247('0x45')]=function(_0x1728ea,_0x3403ba){return db[_0x5247('0x3d')][_0x5247('0x45')](_0x1728ea[_0x5247('0x46')],{})[_0x5247('0x22')](function(_0x24b065){var _0xa6c2ab=_0x1728ea['user'][_0x5247('0x24')]({'plain':!![]});if(!_0xa6c2ab)throw new Error(_0x5247('0x47'));if(_0xa6c2ab['role']===_0x5247('0x48')){var _0x40562e=_0x24b065[_0x5247('0x24')]({'plain':!![]});var _0x555191='OpenchannelQueues';return db[_0x5247('0x49')]['find']({'where':{'name':_0x555191,'userProfileId':_0xa6c2ab[_0x5247('0x4a')]},'raw':!![]})[_0x5247('0x22')](function(_0x1e200e){if(_0x1e200e&&_0x1e200e[_0x5247('0x4b')]===0x0){return db[_0x5247('0x26')]['create']({'name':_0x40562e[_0x5247('0x29')],'resourceId':_0x40562e['id'],'type':_0x1e200e['name'],'sectionId':_0x1e200e['id']},{})['then'](function(){return _0x24b065;});}else{return _0x24b065;}})[_0x5247('0x42')](function(_0x2e9d19){logger[_0x5247('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e9d19);throw _0x2e9d19;});}return _0x24b065;})[_0x5247('0x22')](respondWithResult(_0x3403ba,0xc9))[_0x5247('0x42')](handleError(_0x3403ba,null));};exports[_0x5247('0x21')]=function(_0x416f43,_0x2db365){if(_0x416f43['body']['id']){delete _0x416f43[_0x5247('0x46')]['id'];}return db[_0x5247('0x3d')]['find']({'where':{'id':_0x416f43[_0x5247('0x43')]['id']}})[_0x5247('0x22')](handleEntityNotFound(_0x2db365,null))['then'](saveUpdates(_0x416f43[_0x5247('0x46')],null))[_0x5247('0x22')](respondWithResult(_0x2db365,null))[_0x5247('0x42')](handleError(_0x2db365,null));};exports[_0x5247('0x23')]=function(_0xc57403,_0x589a3a){return db[_0x5247('0x3d')][_0x5247('0x44')]({'where':{'id':_0xc57403[_0x5247('0x43')]['id']}})[_0x5247('0x22')](handleEntityNotFound(_0x589a3a,null))[_0x5247('0x22')](removeEntity(_0x589a3a,null))[_0x5247('0x42')](handleError(_0x589a3a,null));};exports[_0x5247('0x4c')]=function(_0x423da9,_0x1fbc3b){return db[_0x5247('0x3d')]['describe']()['then'](respondWithResult(_0x1fbc3b,null))['catch'](handleError(_0x1fbc3b,null));};exports[_0x5247('0x4d')]=function(_0x1cc2e5,_0x324b87,_0xf26c17){var _0x159611={'raw':!![],'where':{}},_0x67db67={},_0x39cbef;return db[_0x5247('0x3d')]['findOne']({'where':{'id':_0x1cc2e5['params']['id']}})[_0x5247('0x22')](handleEntityNotFound(_0x324b87,null))['then'](function(_0x5eca96){if(_0x5eca96){_0x39cbef=_0x5eca96[_0x5247('0x24')]({'plain':!![]});_0x67db67[_0x5247('0x2f')]=_[_0x5247('0x31')](db[_0x5247('0x4e')][_0x5247('0x2d')]);_0x67db67['query']=_[_0x5247('0x31')](_0x1cc2e5[_0x5247('0x30')]);_0x67db67[_0x5247('0x32')]=_[_0x5247('0x33')](_0x67db67[_0x5247('0x2f')],_0x67db67['query']);_0x159611[_0x5247('0x34')]=_['intersection'](_0x67db67[_0x5247('0x2f')],qs[_0x5247('0x35')](_0x1cc2e5['query'][_0x5247('0x35')]));_0x159611['attributes']=_0x159611[_0x5247('0x34')][_0x5247('0x36')]?_0x159611[_0x5247('0x34')]:_0x67db67[_0x5247('0x2f')];if(!_0x1cc2e5[_0x5247('0x30')][_0x5247('0x4f')](_0x5247('0x37'))){_0x159611['limit']=qs[_0x5247('0x1c')](_0x1cc2e5[_0x5247('0x30')][_0x5247('0x1c')]);_0x159611[_0x5247('0x1a')]=qs[_0x5247('0x1a')](_0x1cc2e5['query']['offset']);}_0x159611[_0x5247('0x50')]=qs['sort'](_0x1cc2e5[_0x5247('0x30')]['sort']);_0x159611[_0x5247('0x39')]=qs[_0x5247('0x32')](_['pick'](_0x1cc2e5['query'],_0x67db67['filters']));_0x159611[_0x5247('0x39')][_0x5247('0x51')]=_0x5eca96['id'];if(_0x1cc2e5[_0x5247('0x30')]['filter']){_0x159611[_0x5247('0x39')]=_[_0x5247('0x3a')](_0x159611['where'],{'$or':_[_0x5247('0x2c')](_0x159611[_0x5247('0x34')],function(_0x4b8c44){var _0x21b82e={};_0x21b82e[_0x4b8c44]={'$like':'%'+_0x1cc2e5[_0x5247('0x30')]['filter']+'%'};return _0x21b82e;})});}_0x159611=_['merge']({},_0x159611,_0x1cc2e5[_0x5247('0x3c')]);return db[_0x5247('0x4e')][_0x5247('0x40')](_0x159611);}})[_0x5247('0x22')](function(_0x5ea4bb){if(_0x5ea4bb){return db[_0x5247('0x52')][_0x5247('0x53')]({'where':{'id':_[_0x5247('0x2c')](_0x5ea4bb,_0x5247('0x54')),'role':_0x5247('0x55')},'attributes':['id','name','openchannelPause','updatedAt',_0x5247('0x56')]});}})[_0x5247('0x22')](function(_0x197c82){if(_0x197c82){return{'count':_0x197c82[_0x5247('0x1d')],'rows':_[_0x5247('0x2c')](_0x197c82[_0x5247('0x41')],function(_0x677d03){return{'membername':_0x677d03[_0x5247('0x29')],'UserId':_0x677d03['id'],'queue_name':_0x39cbef[_0x5247('0x29')],'OpenchannelQueueId':_0x39cbef['id'],'interface':util[_0x5247('0x57')](_0x5247('0x58'),_0x5247('0x59'),_0x677d03[_0x5247('0x29')]),'penalty':0x0,'paused':_0x677d03[_0x5247('0x5a')],'createdAt':_0x677d03['createdAt'],'updatedAt':_0x677d03['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x5247('0x22')](respondWithFilteredResult(_0x324b87,_0x159611))[_0x5247('0x42')](handleError(_0x324b87,null));};exports[_0x5247('0x5b')]=function(_0x20549f,_0x1b58c9,_0x42e9eb){var _0x4b5225={};var _0x4c8ab5={};var _0x559807;var _0x4c9b34;return db['OpenchannelQueue'][_0x5247('0x5c')]({'where':{'id':_0x20549f[_0x5247('0x43')]['id']}})[_0x5247('0x22')](handleEntityNotFound(_0x1b58c9,null))[_0x5247('0x22')](function(_0x422b26){if(_0x422b26){_0x559807=_0x422b26;_0x4c8ab5['model']=_[_0x5247('0x31')](db[_0x5247('0x5d')][_0x5247('0x2d')]);_0x4c8ab5[_0x5247('0x30')]=_['keys'](_0x20549f['query']);_0x4c8ab5['filters']=_[_0x5247('0x33')](_0x4c8ab5[_0x5247('0x2f')],_0x4c8ab5[_0x5247('0x30')]);_0x4b5225['attributes']=_[_0x5247('0x33')](_0x4c8ab5[_0x5247('0x2f')],qs[_0x5247('0x35')](_0x20549f[_0x5247('0x30')][_0x5247('0x35')]));_0x4b5225[_0x5247('0x34')]=_0x4b5225[_0x5247('0x34')]['length']?_0x4b5225[_0x5247('0x34')]:_0x4c8ab5[_0x5247('0x2f')];_0x4b5225[_0x5247('0x50')]=qs[_0x5247('0x38')](_0x20549f[_0x5247('0x30')][_0x5247('0x38')]);_0x4b5225[_0x5247('0x39')]=qs['filters'](_[_0x5247('0x5e')](_0x20549f[_0x5247('0x30')],_0x4c8ab5['filters']));if(_0x20549f[_0x5247('0x30')][_0x5247('0x5f')]){_0x4b5225[_0x5247('0x39')]=_[_0x5247('0x3a')](_0x4b5225[_0x5247('0x39')],{'$or':_[_0x5247('0x2c')](_0x4b5225[_0x5247('0x34')],function(_0x4765a0){var _0x1f73e1={};_0x1f73e1[_0x4765a0]={'$like':'%'+_0x20549f['query'][_0x5247('0x5f')]+'%'};return _0x1f73e1;})});}_0x4b5225=_['merge']({},_0x4b5225,_0x20549f[_0x5247('0x3c')]);return _0x559807[_0x5247('0x5b')](_0x4b5225);}})[_0x5247('0x22')](function(_0x1cc50c){if(_0x1cc50c){_0x4c9b34=_0x1cc50c[_0x5247('0x36')];if(!_0x20549f[_0x5247('0x30')]['hasOwnProperty'](_0x5247('0x37'))){_0x4b5225[_0x5247('0x1c')]=qs[_0x5247('0x1c')](_0x20549f[_0x5247('0x30')][_0x5247('0x1c')]);_0x4b5225['offset']=qs[_0x5247('0x1a')](_0x20549f[_0x5247('0x30')]['offset']);}return _0x559807[_0x5247('0x5b')](_0x4b5225);}})[_0x5247('0x22')](function(_0x5e9285){if(_0x5e9285){return _0x5e9285?{'count':_0x4c9b34,'rows':_0x5e9285}:null;}})['then'](respondWithResult(_0x1b58c9,null))['catch'](handleError(_0x1b58c9,null));};exports['addTeams']=function(_0x1184d0,_0x33f630,_0x33b350){var _0x28030a=_0x1184d0[_0x5247('0x46')]['ids'];return db['Team'][_0x5247('0x40')]({'where':{'id':_0x28030a},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x5247('0x29'),_0x5247('0x60'),'voicePause','interface'],'raw':!![]}]})[_0x5247('0x22')](function(_0x7cfe49){if(_0x7cfe49){var _0x554c61=_[_0x5247('0x61')](_0x7cfe49,function(_0x14d2b7){var _0x4dc42a=_0x14d2b7[_0x5247('0x24')]({'plain':!![]});return _0x4dc42a[_0x5247('0x62')];});return db[_0x5247('0x3d')][_0x5247('0x44')]({'where':{'id':_0x1184d0[_0x5247('0x43')]['id']}})[_0x5247('0x22')](function(_0x14247d){return db[_0x5247('0x63')][_0x5247('0x64')](function(_0x5314f6){return _0x14247d[_0x5247('0x65')](_0x28030a,{'transaction':_0x5314f6})['then'](function(){return BPromise[_0x5247('0x66')](_0x554c61,function(_0x439628){return db[_0x5247('0x4e')][_0x5247('0x67')]({'where':{'UserId':_0x439628['id'],'OpenchannelQueueId':_0x1184d0[_0x5247('0x43')]['id']},'transaction':_0x5314f6});});})['then'](function(){_0x554c61[_0x5247('0x68')](function(_0x2bd53e){socket['emit'](_0x5247('0x69'),{'UserId':_0x2bd53e['id'],'OpenchannelQueueId':_0x14247d['id']});});});});});}})[_0x5247('0x22')](respondWithStatusCode(_0x33f630,null))[_0x5247('0x42')](handleError(_0x33f630,null));};exports[_0x5247('0x6a')]=function(_0x4758a9,_0x1683f2,_0x386b0e){return db[_0x5247('0x5d')]['findAll']({'where':{'id':_0x4758a9[_0x5247('0x30')][_0x5247('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x5247('0x52')],'as':_0x5247('0x62'),'attributes':['id'],'raw':!![]}]})[_0x5247('0x22')](handleEntityNotFound(_0x1683f2,null))[_0x5247('0x22')](function(_0x389d13){var _0x2edda8=_['map'](_0x389d13,'id');var _0x55681a=[];var _0x164c38=[];var _0x152127=squel['select']();_0x152127[_0x5247('0x6c')](_0x5247('0x6d'))[_0x5247('0x6e')](_0x5247('0x6f'),'tq')[_0x5247('0x70')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x5247('0x39')](_0x5247('0x71'),_0x4758a9[_0x5247('0x43')]['id']);for(var _0x5d4e6d=0x0;_0x5d4e6d<_0x389d13['length'];_0x5d4e6d+=0x1){let _0x26466d=_0x389d13[_0x5d4e6d];for(var _0x7ef2e9=0x0;_0x7ef2e9<_0x26466d[_0x5247('0x62')][_0x5247('0x36')];_0x7ef2e9+=0x1){let _0x49bec0=_0x26466d[_0x5247('0x62')][_0x7ef2e9];var _0x474504=_0x152127[_0x5247('0x72')]();_0x474504['where'](_0x5247('0x73'),_0x49bec0['id']);_0x164c38[_0x5247('0x74')](db['sequelize']['query'](_0x474504[_0x5247('0x75')](),{'type':db[_0x5247('0x63')][_0x5247('0x76')][_0x5247('0x77')]})[_0x5247('0x22')](function(_0x2482bf){if(_0x2482bf['length']===0x1){return _0x49bec0['id'];}else{var _0x21bced=_['every'](_[_0x5247('0x2c')](_0x2482bf,_0x5247('0x78')),function(_0x100037){return _[_0x5247('0x79')](_0x2edda8,_0x100037);});if(_0x21bced){return _0x49bec0['id'];}}}));}}return BPromise['all'](_0x164c38)[_0x5247('0x22')](function(_0x25d553){_0x55681a=_(_0x55681a)['union'](_0x25d553)[_0x5247('0x7a')]()[_0x5247('0x7b')]();return db[_0x5247('0x3d')]['find']({'where':{'id':_0x4758a9['params']['id']}})[_0x5247('0x22')](function(_0x16e2e7){return db[_0x5247('0x63')]['transaction'](function(_0x545f96){return _0x16e2e7['removeTeams'](_0x4758a9['query'][_0x5247('0x6b')],{'transaction':_0x545f96})[_0x5247('0x22')](function(){if(!_['isEmpty'](_0x55681a)){return _0x16e2e7['removeAgents'](_0x55681a,{'transaction':_0x545f96});}})[_0x5247('0x22')](function(){_0x55681a[_0x5247('0x68')](function(_0x2ca1b4){socket[_0x5247('0x7c')](_0x5247('0x7d'),{'UserId':_0x2ca1b4,'OpenchannelQueueId':_0x16e2e7['id']});});});});});});})[_0x5247('0x22')](respondWithStatusCode(_0x1683f2,null))['catch'](handleError(_0x1683f2,null));};exports[_0x5247('0x7e')]=function(_0x306130,_0x591d01,_0x5e185a){return db[_0x5247('0x3d')]['find']({'where':{'id':_0x306130['params']['id']}})[_0x5247('0x22')](handleEntityNotFound(_0x591d01,null))['then'](function(_0x3a85a1){if(_0x3a85a1){return _0x3a85a1[_0x5247('0x7e')](_0x306130['body']['ids'],_['omit'](_0x306130[_0x5247('0x46')],[_0x5247('0x6b'),'id'])||{})[_0x5247('0x7f')](function(_0x4b654f){for(var _0x3062c9=0x0;_0x3062c9<_0x306130[_0x5247('0x46')][_0x5247('0x6b')]['length'];_0x3062c9+=0x1){socket['emit'](_0x5247('0x69'),{'UserId':Number(_0x306130['body'][_0x5247('0x6b')][_0x3062c9]),'OpenchannelQueueId':Number(_0x306130[_0x5247('0x43')]['id'])});}return _0x4b654f;});}})[_0x5247('0x22')](respondWithResult(_0x591d01,null))['catch'](handleError(_0x591d01,null));};exports[_0x5247('0x80')]=function(_0x26d5e6,_0x349bd7,_0x2b8e1b){return db[_0x5247('0x3d')][_0x5247('0x44')]({'where':{'id':_0x26d5e6[_0x5247('0x43')]['id']}})[_0x5247('0x22')](handleEntityNotFound(_0x349bd7,null))[_0x5247('0x22')](function(_0x213a75){if(_0x213a75){return _0x213a75['removeAgents'](_0x26d5e6[_0x5247('0x30')][_0x5247('0x6b')])[_0x5247('0x22')](function(){if(_['isArray'](_0x26d5e6[_0x5247('0x30')]['ids'])){for(var _0x4e000b=0x0;_0x4e000b<_0x26d5e6[_0x5247('0x30')]['ids'][_0x5247('0x36')];_0x4e000b+=0x1){socket[_0x5247('0x7c')]('userOpenchannelQueue:remove',{'UserId':Number(_0x26d5e6[_0x5247('0x30')][_0x5247('0x6b')][_0x4e000b]),'OpenchannelQueueId':Number(_0x26d5e6[_0x5247('0x43')]['id'])});}}else{socket[_0x5247('0x7c')](_0x5247('0x7d'),{'UserId':Number(_0x26d5e6[_0x5247('0x30')][_0x5247('0x6b')]),'OpenchannelQueueId':Number(_0x26d5e6[_0x5247('0x43')]['id'])});}});}})[_0x5247('0x22')](respondWithStatusCode(_0x349bd7,null))[_0x5247('0x42')](handleError(_0x349bd7,null));};exports[_0x5247('0x81')]=function(_0x37e2b0,_0x63ab8b,_0x8a0e92){var _0x38fc41={};var _0x93b948={};var _0x433349;var _0x1035d0;return db[_0x5247('0x3d')][_0x5247('0x5c')]({'where':{'id':_0x37e2b0['params']['id']}})[_0x5247('0x22')](handleEntityNotFound(_0x63ab8b,null))[_0x5247('0x22')](function(_0x50e8fd){if(_0x50e8fd){_0x433349=_0x50e8fd;_0x93b948[_0x5247('0x2f')]=_['keys'](db[_0x5247('0x52')]['rawAttributes']);_0x93b948[_0x5247('0x30')]=_[_0x5247('0x31')](_0x37e2b0['query']);_0x93b948['filters']=_['intersection'](_0x93b948[_0x5247('0x2f')],_0x93b948[_0x5247('0x30')]);_0x38fc41[_0x5247('0x34')]=_[_0x5247('0x33')](_0x93b948[_0x5247('0x2f')],qs[_0x5247('0x35')](_0x37e2b0[_0x5247('0x30')][_0x5247('0x35')]));_0x38fc41[_0x5247('0x34')]=_0x38fc41[_0x5247('0x34')][_0x5247('0x36')]?_0x38fc41[_0x5247('0x34')]:_0x93b948[_0x5247('0x2f')];_0x38fc41[_0x5247('0x50')]=qs[_0x5247('0x38')](_0x37e2b0[_0x5247('0x30')][_0x5247('0x38')]);_0x38fc41[_0x5247('0x39')]=qs[_0x5247('0x32')](_[_0x5247('0x5e')](_0x37e2b0[_0x5247('0x30')],_0x93b948['filters']));if(_0x37e2b0[_0x5247('0x30')]['filter']){_0x38fc41[_0x5247('0x39')]=_[_0x5247('0x3a')](_0x38fc41[_0x5247('0x39')],{'$or':_['map'](_0x38fc41[_0x5247('0x34')],function(_0x2b399e){var _0x1e27da={};_0x1e27da[_0x2b399e]={'$like':'%'+_0x37e2b0[_0x5247('0x30')][_0x5247('0x5f')]+'%'};return _0x1e27da;})});}_0x38fc41=_[_0x5247('0x3a')]({},_0x38fc41,_0x37e2b0['options']);return _0x433349[_0x5247('0x81')](_0x38fc41);}})[_0x5247('0x22')](function(_0xb4cc08){if(_0xb4cc08){_0x1035d0=_0xb4cc08[_0x5247('0x36')];if(!_0x37e2b0[_0x5247('0x30')]['hasOwnProperty'](_0x5247('0x37'))){_0x38fc41[_0x5247('0x1c')]=qs['limit'](_0x37e2b0[_0x5247('0x30')][_0x5247('0x1c')]);_0x38fc41[_0x5247('0x1a')]=qs[_0x5247('0x1a')](_0x37e2b0[_0x5247('0x30')][_0x5247('0x1a')]);}return _0x433349[_0x5247('0x81')](_0x38fc41);}})[_0x5247('0x22')](function(_0x495190){if(_0x495190){return _0x495190?{'count':_0x1035d0,'rows':_0x495190}:null;}})[_0x5247('0x22')](respondWithResult(_0x63ab8b,null))['catch'](handleError(_0x63ab8b,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 8b75b94..b90ea55 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 _0x8a6e=['OpenchannelQueue','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x5c07fb,_0x504b8e){var _0x541fe6=function(_0x5f318f){while(--_0x5f318f){_0x5c07fb['push'](_0x5c07fb['shift']());}};_0x541fe6(++_0x504b8e);}(_0x8a6e,0xfa));var _0xe8a6=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x8a6e[_0x36dfbd];return _0x4ecad9;};'use strict';var EventEmitter=require(_0xe8a6('0x0'));var OpenchannelQueue=require(_0xe8a6('0x1'))['db'][_0xe8a6('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xe8a6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe8a6('0x4'),'afterDestroy':_0xe8a6('0x5')};function emitEvent(_0x1f0046){return function(_0x44076e,_0x241ad5,_0x195ebe){OpenchannelQueueEvents[_0xe8a6('0x6')](_0x1f0046+':'+_0x44076e['id'],_0x44076e);OpenchannelQueueEvents['emit'](_0x1f0046,_0x44076e);_0x195ebe(null);};}for(var e in events){if(events[_0xe8a6('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0xe8a6('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x2079=['hook','exports','../../mysqldb','OpenchannelQueue','save','remove','emit','hasOwnProperty'];(function(_0xcd5a3d,_0x3c5b33){var _0xd43207=function(_0x17d976){while(--_0x17d976){_0xcd5a3d['push'](_0xcd5a3d['shift']());}};_0xd43207(++_0x3c5b33);}(_0x2079,0x92));var _0x9207=function(_0x441954,_0xfca410){_0x441954=_0x441954-0x0;var _0x43e739=_0x2079[_0x441954];return _0x43e739;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x9207('0x0'))['db'][_0x9207('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9207('0x2'),'afterUpdate':'update','afterDestroy':_0x9207('0x3')};function emitEvent(_0x4d3f53){return function(_0x5cbbbd,_0x4dc939,_0x18d127){OpenchannelQueueEvents[_0x9207('0x4')](_0x4d3f53+':'+_0x5cbbbd['id'],_0x5cbbbd);OpenchannelQueueEvents[_0x9207('0x4')](_0x4d3f53,_0x5cbbbd);_0x18d127(null);};}for(var e in events){if(events[_0x9207('0x5')](e)){var event=events[e];OpenchannelQueue[_0x9207('0x6')](e,emitEvent(event));}}module[_0x9207('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 4e8e8a3..dd07021 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 _0x7772=['./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment'];(function(_0x54e430,_0x2d71b9){var _0x12319c=function(_0x26a2f0){while(--_0x26a2f0){_0x54e430['push'](_0x54e430['shift']());}};_0x12319c(++_0x2d71b9);}(_0x7772,0x139));var _0x2777=function(_0x463b4a,_0x41f9fb){_0x463b4a=_0x463b4a-0x0;var _0xd87e6b=_0x7772[_0x463b4a];return _0xd87e6b;};'use strict';var _=require(_0x2777('0x0'));var util=require('util');var logger=require(_0x2777('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2777('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2777('0x3'));var rimraf=require(_0x2777('0x4'));var config=require(_0x2777('0x5'));var attributes=require(_0x2777('0x6'));module[_0x2777('0x7')]=function(_0x348154,_0x343214){return _0x348154[_0x2777('0x8')](_0x2777('0x9'),attributes,{'tableName':_0x2777('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7caf=['request-promise','path','rimraf','../../config/environment','OpenchannelQueue','util','../../config/logger','moment','bluebird'];(function(_0x26b86b,_0x496d90){var _0x499ad1=function(_0x222ebe){while(--_0x222ebe){_0x26b86b['push'](_0x26b86b['shift']());}};_0x499ad1(++_0x496d90);}(_0x7caf,0x10a));var _0xf7ca=function(_0x572ce1,_0xa27ca4){_0x572ce1=_0x572ce1-0x0;var _0x57e794=_0x7caf[_0x572ce1];return _0x57e794;};'use strict';var _=require('lodash');var util=require(_0xf7ca('0x0'));var logger=require(_0xf7ca('0x1'))('api');var moment=require(_0xf7ca('0x2'));var BPromise=require(_0xf7ca('0x3'));var rp=require(_0xf7ca('0x4'));var fs=require('fs');var path=require(_0xf7ca('0x5'));var rimraf=require(_0xf7ca('0x6'));var config=require(_0xf7ca('0x7'));var attributes=require('./openchannelQueue.attributes');module['exports']=function(_0x37974c,_0x36d769){return _0x37974c['define'](_0xf7ca('0x8'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 8a67ceb..fcf5a27 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 _0x8be6=['raw','where','attributes','map','include','model','then','find','ShowOpenchannelQueue','lodash','util','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','./openchannelQueue.socket','register','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetOpenchannelQueue','OpenchannelQueue','options'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x8be6,0x6c));var _0x68be=function(_0xf7b006,_0x18c938){_0xf7b006=_0xf7b006-0x0;var _0x3ac6e5=_0x8be6[_0xf7b006];return _0x3ac6e5;};'use strict';var _=require(_0x68be('0x0'));var util=require(_0x68be('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x68be('0x2'));var logger=require(_0x68be('0x3'))(_0x68be('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x68be('0x5')]['http']({'port':0x232a});config[_0x68be('0x6')]=_[_0x68be('0x7')](config[_0x68be('0x6')],{'host':_0x68be('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x68be('0x6')]));require(_0x68be('0x9'))[_0x68be('0xa')](socket);function respondWithRpcPromise(_0x1f99d9,_0x5bba3a,_0x5a6b72){return new BPromise(function(_0x1a2867,_0x48e281){return client['request'](_0x1f99d9,_0x5a6b72)['then'](function(_0x3f0540){logger[_0x68be('0xb')](_0x68be('0xc'),_0x5bba3a,_0x68be('0xd'));logger[_0x68be('0xe')](_0x68be('0xf'),_0x5bba3a,_0x68be('0xd'),JSON[_0x68be('0x10')](_0x3f0540));if(_0x3f0540[_0x68be('0x11')]){if(_0x3f0540[_0x68be('0x11')][_0x68be('0x12')]===0x1f4){logger[_0x68be('0x11')](_0x68be('0xc'),_0x5bba3a,_0x3f0540[_0x68be('0x11')][_0x68be('0x13')]);return _0x48e281(_0x3f0540['error'][_0x68be('0x13')]);}logger[_0x68be('0x11')](_0x68be('0xc'),_0x5bba3a,_0x3f0540[_0x68be('0x11')][_0x68be('0x13')]);return _0x1a2867(_0x3f0540[_0x68be('0x11')][_0x68be('0x13')]);}else{logger[_0x68be('0xb')](_0x68be('0xc'),_0x5bba3a,_0x68be('0xd'));_0x1a2867(_0x3f0540['result'][_0x68be('0x13')]);}})[_0x68be('0x14')](function(_0x2179aa){logger['error'](_0x68be('0xc'),_0x5bba3a,_0x2179aa);_0x48e281(_0x2179aa);});});}exports[_0x68be('0x15')]=function(_0xc56370){var _0x2014de=this;return new Promise(function(_0x6c927b,_0x43bb69){return db[_0x68be('0x16')]['findAll']({'raw':_0xc56370[_0x68be('0x17')]?_0xc56370['options'][_0x68be('0x18')]===undefined?!![]:![]:!![],'where':_0xc56370[_0x68be('0x17')]?_0xc56370[_0x68be('0x17')][_0x68be('0x19')]||null:null,'attributes':_0xc56370[_0x68be('0x17')]?_0xc56370[_0x68be('0x17')][_0x68be('0x1a')]||null:null,'limit':_0xc56370[_0x68be('0x17')]?_0xc56370[_0x68be('0x17')]['limit']||null:null,'include':_0xc56370[_0x68be('0x17')]?_0xc56370[_0x68be('0x17')]['include']?_[_0x68be('0x1b')](_0xc56370[_0x68be('0x17')][_0x68be('0x1c')],function(_0x37fa7e){return{'model':db[_0x37fa7e[_0x68be('0x1d')]],'as':_0x37fa7e['as'],'attributes':_0x37fa7e[_0x68be('0x1a')],'include':_0x37fa7e['include']?_['map'](_0x37fa7e['include'],function(_0x460042){return{'model':db[_0x460042[_0x68be('0x1d')]],'as':_0x460042['as'],'attributes':_0x460042[_0x68be('0x1a')],'include':_0x460042['include']?_[_0x68be('0x1b')](_0x460042[_0x68be('0x1c')],function(_0x426b08){return{'model':db[_0x426b08['model']],'as':_0x426b08['as'],'attributes':_0x426b08[_0x68be('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x68be('0x1e')](function(_0x338fb0){logger[_0x68be('0xb')]('GetOpenchannelQueue',_0xc56370);logger[_0x68be('0xe')]('GetOpenchannelQueue',_0xc56370,JSON['stringify'](_0x338fb0));_0x6c927b(_0x338fb0);})[_0x68be('0x14')](function(_0x2267ab){logger[_0x68be('0x11')](_0x68be('0x15'),_0x2267ab[_0x68be('0x13')],_0xc56370);_0x43bb69(_0x2014de[_0x68be('0x11')](0x1f4,_0x2267ab[_0x68be('0x13')]));});});};exports['ShowOpenchannelQueue']=function(_0x58039d){var _0xbdb4bd=this;return new Promise(function(_0x433dbb,_0x215938){return db[_0x68be('0x16')][_0x68be('0x1f')]({'raw':_0x58039d[_0x68be('0x17')]?_0x58039d['options'][_0x68be('0x18')]===undefined?!![]:![]:!![],'where':_0x58039d[_0x68be('0x17')]?_0x58039d[_0x68be('0x17')]['where']||null:null,'attributes':_0x58039d[_0x68be('0x17')]?_0x58039d[_0x68be('0x17')][_0x68be('0x1a')]||null:null,'include':_0x58039d[_0x68be('0x17')]?_0x58039d[_0x68be('0x17')][_0x68be('0x1c')]?_['map'](_0x58039d[_0x68be('0x17')][_0x68be('0x1c')],function(_0x23aa58){return{'model':db[_0x23aa58[_0x68be('0x1d')]],'as':_0x23aa58['as'],'attributes':_0x23aa58[_0x68be('0x1a')],'include':_0x23aa58[_0x68be('0x1c')]?_[_0x68be('0x1b')](_0x23aa58[_0x68be('0x1c')],function(_0x580dd9){return{'model':db[_0x580dd9[_0x68be('0x1d')]],'as':_0x580dd9['as'],'attributes':_0x580dd9['attributes'],'include':_0x580dd9[_0x68be('0x1c')]?_[_0x68be('0x1b')](_0x580dd9['include'],function(_0x1b99c6){return{'model':db[_0x1b99c6[_0x68be('0x1d')]],'as':_0x1b99c6['as'],'attributes':_0x1b99c6[_0x68be('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x68be('0x1e')](function(_0x56f30c){logger[_0x68be('0xb')](_0x68be('0x20'),_0x58039d);logger[_0x68be('0xe')](_0x68be('0x20'),_0x58039d,JSON[_0x68be('0x10')](_0x56f30c));_0x433dbb(_0x56f30c);})[_0x68be('0x14')](function(_0xeb921e){logger[_0x68be('0x11')](_0x68be('0x20'),_0xeb921e['message'],_0x58039d);_0x215938(_0xbdb4bd[_0x68be('0x11')](0x1f4,_0xeb921e[_0x68be('0x13')]));});});}; \ No newline at end of file +var _0xe413=['localhost','socket.io-emitter','./openchannelQueue.socket','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','GetOpenchannelQueue','findAll','options','raw','where','attributes','include','map','model','info','catch','find','ShowOpenchannelQueue','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x409f3a,_0x1840be){var _0xd376d2=function(_0x1c64b2){while(--_0x1c64b2){_0x409f3a['push'](_0x409f3a['shift']());}};_0xd376d2(++_0x1840be);}(_0xe413,0x1d6));var _0x3e41=function(_0x1d3824,_0x5a85da){_0x1d3824=_0x1d3824-0x0;var _0x218c7e=_0xe413[_0x1d3824];return _0x218c7e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3e41('0x0'));var BPromise=require(_0x3e41('0x1'));var rs=require(_0x3e41('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3e41('0x3'));var logger=require(_0x3e41('0x4'))(_0x3e41('0x5'));var config=require(_0x3e41('0x6'));var jayson=require(_0x3e41('0x7'));var client=jayson[_0x3e41('0x8')][_0x3e41('0x9')]({'port':0x232a});config[_0x3e41('0xa')]=_['defaults'](config[_0x3e41('0xa')],{'host':_0x3e41('0xb'),'port':0x18eb});var socket=require(_0x3e41('0xc'))(new Redis(config[_0x3e41('0xa')]));require(_0x3e41('0xd'))['register'](socket);function respondWithRpcPromise(_0x2bf274,_0x4e7703,_0x207714){return new BPromise(function(_0x4cbf9d,_0xbf00dd){return client[_0x3e41('0xe')](_0x2bf274,_0x207714)[_0x3e41('0xf')](function(_0xc2f5ea){logger['info'](_0x3e41('0x10'),_0x4e7703,_0x3e41('0x11'));logger[_0x3e41('0x12')](_0x3e41('0x13'),_0x4e7703,_0x3e41('0x11'),JSON[_0x3e41('0x14')](_0xc2f5ea));if(_0xc2f5ea['error']){if(_0xc2f5ea['error'][_0x3e41('0x15')]===0x1f4){logger['error'](_0x3e41('0x10'),_0x4e7703,_0xc2f5ea[_0x3e41('0x16')][_0x3e41('0x17')]);return _0xbf00dd(_0xc2f5ea['error']['message']);}logger[_0x3e41('0x16')](_0x3e41('0x10'),_0x4e7703,_0xc2f5ea['error'][_0x3e41('0x17')]);return _0x4cbf9d(_0xc2f5ea[_0x3e41('0x16')]['message']);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x4e7703,_0x3e41('0x11'));_0x4cbf9d(_0xc2f5ea['result'][_0x3e41('0x17')]);}})['catch'](function(_0x4cd91a){logger[_0x3e41('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x4e7703,_0x4cd91a);_0xbf00dd(_0x4cd91a);});});}exports[_0x3e41('0x18')]=function(_0x2899c6){var _0x2acfcc=this;return new Promise(function(_0x272449,_0x1107d1){return db['OpenchannelQueue'][_0x3e41('0x19')]({'raw':_0x2899c6[_0x3e41('0x1a')]?_0x2899c6[_0x3e41('0x1a')][_0x3e41('0x1b')]===undefined?!![]:![]:!![],'where':_0x2899c6[_0x3e41('0x1a')]?_0x2899c6['options'][_0x3e41('0x1c')]||null:null,'attributes':_0x2899c6['options']?_0x2899c6[_0x3e41('0x1a')][_0x3e41('0x1d')]||null:null,'limit':_0x2899c6[_0x3e41('0x1a')]?_0x2899c6[_0x3e41('0x1a')]['limit']||null:null,'include':_0x2899c6[_0x3e41('0x1a')]?_0x2899c6[_0x3e41('0x1a')][_0x3e41('0x1e')]?_[_0x3e41('0x1f')](_0x2899c6[_0x3e41('0x1a')][_0x3e41('0x1e')],function(_0x5333d6){return{'model':db[_0x5333d6[_0x3e41('0x20')]],'as':_0x5333d6['as'],'attributes':_0x5333d6[_0x3e41('0x1d')],'include':_0x5333d6['include']?_[_0x3e41('0x1f')](_0x5333d6[_0x3e41('0x1e')],function(_0x39f864){return{'model':db[_0x39f864[_0x3e41('0x20')]],'as':_0x39f864['as'],'attributes':_0x39f864[_0x3e41('0x1d')],'include':_0x39f864[_0x3e41('0x1e')]?_[_0x3e41('0x1f')](_0x39f864[_0x3e41('0x1e')],function(_0x4cd227){return{'model':db[_0x4cd227[_0x3e41('0x20')]],'as':_0x4cd227['as'],'attributes':_0x4cd227[_0x3e41('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3e41('0xf')](function(_0x4c44b8){logger[_0x3e41('0x21')]('GetOpenchannelQueue',_0x2899c6);logger[_0x3e41('0x12')](_0x3e41('0x18'),_0x2899c6,JSON['stringify'](_0x4c44b8));_0x272449(_0x4c44b8);})[_0x3e41('0x22')](function(_0x22d7f3){logger[_0x3e41('0x16')](_0x3e41('0x18'),_0x22d7f3[_0x3e41('0x17')],_0x2899c6);_0x1107d1(_0x2acfcc[_0x3e41('0x16')](0x1f4,_0x22d7f3[_0x3e41('0x17')]));});});};exports['ShowOpenchannelQueue']=function(_0x258624){var _0x33c7f4=this;return new Promise(function(_0x5fb149,_0x54aace){return db['OpenchannelQueue'][_0x3e41('0x23')]({'raw':_0x258624[_0x3e41('0x1a')]?_0x258624[_0x3e41('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x258624[_0x3e41('0x1a')]?_0x258624[_0x3e41('0x1a')][_0x3e41('0x1c')]||null:null,'attributes':_0x258624['options']?_0x258624[_0x3e41('0x1a')][_0x3e41('0x1d')]||null:null,'include':_0x258624[_0x3e41('0x1a')]?_0x258624[_0x3e41('0x1a')][_0x3e41('0x1e')]?_[_0x3e41('0x1f')](_0x258624['options'][_0x3e41('0x1e')],function(_0x2c01ba){return{'model':db[_0x2c01ba[_0x3e41('0x20')]],'as':_0x2c01ba['as'],'attributes':_0x2c01ba[_0x3e41('0x1d')],'include':_0x2c01ba[_0x3e41('0x1e')]?_[_0x3e41('0x1f')](_0x2c01ba['include'],function(_0x26c2c9){return{'model':db[_0x26c2c9[_0x3e41('0x20')]],'as':_0x26c2c9['as'],'attributes':_0x26c2c9['attributes'],'include':_0x26c2c9[_0x3e41('0x1e')]?_['map'](_0x26c2c9[_0x3e41('0x1e')],function(_0xf7279f){return{'model':db[_0xf7279f[_0x3e41('0x20')]],'as':_0xf7279f['as'],'attributes':_0xf7279f[_0x3e41('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3e41('0xf')](function(_0x2f3837){logger[_0x3e41('0x21')](_0x3e41('0x24'),_0x258624);logger['debug']('ShowOpenchannelQueue',_0x258624,JSON[_0x3e41('0x14')](_0x2f3837));_0x5fb149(_0x2f3837);})[_0x3e41('0x22')](function(_0x28573f){logger[_0x3e41('0x16')](_0x3e41('0x24'),_0x28573f[_0x3e41('0x17')],_0x258624);_0x54aace(_0x33c7f4[_0x3e41('0x16')](0x1f4,_0x28573f[_0x3e41('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index d48659f..7bdf2b4 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 _0x613a=['removeListener','register','length','openchannelQueue:','save','update','emit'];(function(_0x5d2a7d,_0x1ca06c){var _0x14e58b=function(_0x23be04){while(--_0x23be04){_0x5d2a7d['push'](_0x5d2a7d['shift']());}};_0x14e58b(++_0x1ca06c);}(_0x613a,0x89));var _0xa613=function(_0x2a8e05,_0x357e55){_0x2a8e05=_0x2a8e05-0x0;var _0x24f608=_0x613a[_0x2a8e05];return _0x24f608;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xa613('0x0'),'remove',_0xa613('0x1')];function createListener(_0x58e05d,_0x337a27){return function(_0x320e20){_0x337a27[_0xa613('0x2')](_0x58e05d,_0x320e20);};}function removeListener(_0x23d067,_0x222f1c){return function(){OpenchannelQueueEvents[_0xa613('0x3')](_0x23d067,_0x222f1c);};}exports[_0xa613('0x4')]=function(_0x4b31db){for(var _0x3f9307=0x0,_0x101425=events[_0xa613('0x5')];_0x3f9307<_0x101425;_0x3f9307++){var _0x34e444=events[_0x3f9307];var _0x64dc05=createListener(_0xa613('0x6')+_0x34e444,_0x4b31db);OpenchannelQueueEvents['on'](_0x34e444,_0x64dc05);}}; \ No newline at end of file +var _0x8a5f=['emit','length','openchannelQueue:','save','remove','update'];(function(_0x45a325,_0x2ab2a8){var _0x8c6379=function(_0x461b76){while(--_0x461b76){_0x45a325['push'](_0x45a325['shift']());}};_0x8c6379(++_0x2ab2a8);}(_0x8a5f,0x1ef));var _0xf8a5=function(_0x39fe47,_0x58e103){_0x39fe47=_0x39fe47-0x0;var _0x1f236e=_0x8a5f[_0x39fe47];return _0x1f236e;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xf8a5('0x0'),_0xf8a5('0x1'),_0xf8a5('0x2')];function createListener(_0x4ec746,_0x9dddda){return function(_0x14070b){_0x9dddda[_0xf8a5('0x3')](_0x4ec746,_0x14070b);};}function removeListener(_0x357a6a,_0x5cedf4){return function(){OpenchannelQueueEvents['removeListener'](_0x357a6a,_0x5cedf4);};}exports['register']=function(_0x252555){for(var _0x57b329=0x0,_0x2e3923=events[_0xf8a5('0x4')];_0x57b329<_0x2e3923;_0x57b329++){var _0x1e78b3=events[_0x57b329];var _0xdb44a3=createListener(_0xf8a5('0x5')+_0x1e78b3,_0x252555);OpenchannelQueueEvents['on'](_0x1e78b3,_0xdb44a3);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 6c075e8..e7ea6b6 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 _0x9fc5=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','post','create','put','delete','destroy','exports'];(function(_0x208961,_0x4a51ba){var _0xb86f35=function(_0x2dd418){while(--_0x2dd418){_0x208961['push'](_0x208961['shift']());}};_0xb86f35(++_0x4a51ba);}(_0x9fc5,0x1e4));var _0x59fc=function(_0x9a3e0f,_0x2f796d){_0x9a3e0f=_0x9a3e0f-0x0;var _0x3d2a9a=_0x9fc5[_0x9a3e0f];return _0x3d2a9a;};'use strict';var multer=require('multer');var util=require(_0x59fc('0x0'));var path=require(_0x59fc('0x1'));var timeout=require(_0x59fc('0x2'));var express=require(_0x59fc('0x3'));var router=express[_0x59fc('0x4')]();var fs_extra=require(_0x59fc('0x5'));var auth=require(_0x59fc('0x6'));var interaction=require(_0x59fc('0x7'));var config=require(_0x59fc('0x8'));var controller=require(_0x59fc('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x59fc('0xa')]);router[_0x59fc('0xb')](_0x59fc('0xc'),auth[_0x59fc('0xd')](),controller[_0x59fc('0xe')]);router[_0x59fc('0xb')](_0x59fc('0xf'),auth[_0x59fc('0xd')](),controller['show']);router[_0x59fc('0x10')]('/',auth[_0x59fc('0xd')](),controller[_0x59fc('0x11')]);router[_0x59fc('0x12')](_0x59fc('0xf'),auth[_0x59fc('0xd')](),controller['update']);router[_0x59fc('0x13')](_0x59fc('0xf'),auth[_0x59fc('0xd')](),controller[_0x59fc('0x14')]);module[_0x59fc('0x15')]=router; \ No newline at end of file +var _0xff73=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','post','create','update','delete'];(function(_0x2fc1f6,_0x51543e){var _0x7a3346=function(_0x589b08){while(--_0x589b08){_0x2fc1f6['push'](_0x2fc1f6['shift']());}};_0x7a3346(++_0x51543e);}(_0xff73,0x127));var _0x3ff7=function(_0x39df6e,_0x548a5a){_0x39df6e=_0x39df6e-0x0;var _0xcbceb6=_0xff73[_0x39df6e];return _0xcbceb6;};'use strict';var multer=require(_0x3ff7('0x0'));var util=require(_0x3ff7('0x1'));var path=require(_0x3ff7('0x2'));var timeout=require(_0x3ff7('0x3'));var express=require(_0x3ff7('0x4'));var router=express[_0x3ff7('0x5')]();var fs_extra=require(_0x3ff7('0x6'));var auth=require(_0x3ff7('0x7'));var interaction=require(_0x3ff7('0x8'));var config=require(_0x3ff7('0x9'));var controller=require('./openchannelQueueReport.controller');router[_0x3ff7('0xa')]('/',auth['isAuthenticated'](),controller[_0x3ff7('0xb')]);router[_0x3ff7('0xa')](_0x3ff7('0xc'),auth[_0x3ff7('0xd')](),controller[_0x3ff7('0xe')]);router['get'](_0x3ff7('0xf'),auth[_0x3ff7('0xd')](),controller['show']);router[_0x3ff7('0x10')]('/',auth[_0x3ff7('0xd')](),controller[_0x3ff7('0x11')]);router['put'](_0x3ff7('0xf'),auth[_0x3ff7('0xd')](),controller[_0x3ff7('0x12')]);router[_0x3ff7('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x3ff7('0x14')]);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 b5337eb..66d45d6 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 _0x025f=['STRING','DATE','moment','sequelize','exports'];(function(_0x4a3939,_0xf73af6){var _0xc9785a=function(_0x17317d){while(--_0x17317d){_0x4a3939['push'](_0x4a3939['shift']());}};_0xc9785a(++_0xf73af6);}(_0x025f,0x160));var _0xf025=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x025f[_0x4565bf];return _0x5610ba;};'use strict';var moment=require(_0xf025('0x0'));var Sequelize=require(_0xf025('0x1'));module[_0xf025('0x2')]={'uniqueid':{'type':Sequelize[_0xf025('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf025('0x3')]},'joinAt':{'type':Sequelize[_0xf025('0x4')]},'leaveAt':{'type':Sequelize[_0xf025('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf025('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8743=['exports','STRING','DATE','moment','sequelize'];(function(_0x435044,_0x36ab8e){var _0x33d4c6=function(_0x15efa0){while(--_0x15efa0){_0x435044['push'](_0x435044['shift']());}};_0x33d4c6(++_0x36ab8e);}(_0x8743,0xa3));var _0x3874=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x8743[_0x433a86];return _0x23000c;};'use strict';var moment=require(_0x3874('0x0'));var Sequelize=require(_0x3874('0x1'));module[_0x3874('0x2')]={'uniqueid':{'type':Sequelize[_0x3874('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x3874('0x3')]},'joinAt':{'type':Sequelize[_0x3874('0x4')]},'leaveAt':{'type':Sequelize[_0x3874('0x4')]},'acceptAt':{'type':Sequelize[_0x3874('0x4')]},'exitAt':{'type':Sequelize[_0x3874('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index b2f6e52..90e7304 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 _0xe7c1=['request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4fe49a,_0x49b890){var _0x537689=function(_0x2d1b25){while(--_0x2d1b25){_0x4fe49a['push'](_0x4fe49a['shift']());}};_0x537689(++_0x49b890);}(_0xe7c1,0x124));var _0x1e7c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xe7c1[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x1e7c('0x0'));var rimraf=require(_0x1e7c('0x1'));var zipdir=require(_0x1e7c('0x2'));var jsonpatch=require(_0x1e7c('0x3'));var rp=require(_0x1e7c('0x4'));var moment=require('moment');var BPromise=require(_0x1e7c('0x5'));var Mustache=require(_0x1e7c('0x6'));var util=require('util');var path=require(_0x1e7c('0x7'));var sox=require(_0x1e7c('0x8'));var csv=require(_0x1e7c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1e7c('0xa'));var squel=require(_0x1e7c('0xb'));var crypto=require(_0x1e7c('0xc'));var jsforce=require(_0x1e7c('0xd'));var deskjs=require(_0x1e7c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1e7c('0xf'));var Papa=require(_0x1e7c('0x10'));var Redis=require('ioredis');var authService=require(_0x1e7c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1e7c('0x12'));var hardwareService=require(_0x1e7c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x1e7c('0x14'));var config=require(_0x1e7c('0x15'));var licenseUtil=require(_0x1e7c('0x16'));var db=require(_0x1e7c('0x17'))['db'];function respondWithStatusCode(_0x4620d1,_0x316777){_0x316777=_0x316777||0xcc;return function(_0x5a3057){if(_0x5a3057){return _0x4620d1[_0x1e7c('0x18')](_0x316777);}return _0x4620d1[_0x1e7c('0x19')](_0x316777)[_0x1e7c('0x1a')]();};}function respondWithResult(_0x1cd60d,_0x18e0e8){_0x18e0e8=_0x18e0e8||0xc8;return function(_0xe4bcb9){if(_0xe4bcb9){return _0x1cd60d[_0x1e7c('0x19')](_0x18e0e8)['json'](_0xe4bcb9);}};}function respondWithFilteredResult(_0x4b10d8,_0x5a3228){return function(_0x3c3458){if(_0x3c3458){var _0x2c68ee=typeof _0x5a3228[_0x1e7c('0x1b')]==='undefined'&&typeof _0x5a3228[_0x1e7c('0x1c')]===_0x1e7c('0x1d');var _0x330fc0=_0x3c3458[_0x1e7c('0x1e')];var _0x6fda84=_0x2c68ee?0x0:_0x5a3228[_0x1e7c('0x1b')];var _0x37859d=_0x2c68ee?_0x3c3458[_0x1e7c('0x1e')]:_0x5a3228[_0x1e7c('0x1b')]+_0x5a3228[_0x1e7c('0x1c')];var _0x43a84f;if(_0x37859d>=_0x330fc0){_0x37859d=_0x330fc0;_0x43a84f=0xc8;}else{_0x43a84f=0xce;}_0x4b10d8[_0x1e7c('0x19')](_0x43a84f);return _0x4b10d8[_0x1e7c('0x1f')](_0x1e7c('0x20'),_0x6fda84+'-'+_0x37859d+'/'+_0x330fc0)['json'](_0x3c3458);}return null;};}function patchUpdates(_0x98b58d){return function(_0x852748){try{jsonpatch[_0x1e7c('0x21')](_0x852748,_0x98b58d,!![]);}catch(_0x229b07){return BPromise[_0x1e7c('0x22')](_0x229b07);}return _0x852748['save']();};}function saveUpdates(_0x12d269,_0x87cb65){return function(_0xb4d11d){if(_0xb4d11d){return _0xb4d11d[_0x1e7c('0x23')](_0x12d269)['then'](function(_0x57f6d2){return _0x57f6d2;});}return null;};}function removeEntity(_0x507f21,_0x840693){return function(_0x33ca56){if(_0x33ca56){return _0x33ca56[_0x1e7c('0x24')]()[_0x1e7c('0x25')](function(){_0x507f21[_0x1e7c('0x19')](0xcc)[_0x1e7c('0x1a')]();});}};}function handleEntityNotFound(_0x23f6f0,_0x8073ef){return function(_0x1b5a78){if(!_0x1b5a78){_0x23f6f0[_0x1e7c('0x18')](0x194);}return _0x1b5a78;};}function handleError(_0x1c8294,_0x35e386){_0x35e386=_0x35e386||0x1f4;return function(_0xa3491b){logger[_0x1e7c('0x26')](_0xa3491b['stack']);if(_0xa3491b[_0x1e7c('0x27')]){delete _0xa3491b[_0x1e7c('0x27')];}_0x1c8294[_0x1e7c('0x19')](_0x35e386)[_0x1e7c('0x28')](_0xa3491b);};}exports[_0x1e7c('0x29')]=function(_0x1abc37,_0x70adf3){var _0x23db14={},_0x2dd2fd={},_0x5b9abd={'count':0x0,'rows':[]};var _0x12cf2d=_[_0x1e7c('0x2a')](db[_0x1e7c('0x2b')][_0x1e7c('0x2c')],function(_0x1eb2fb){return{'name':_0x1eb2fb[_0x1e7c('0x2d')],'type':_0x1eb2fb[_0x1e7c('0x2e')][_0x1e7c('0x2f')]};});_0x2dd2fd[_0x1e7c('0x30')]=_[_0x1e7c('0x2a')](_0x12cf2d,_0x1e7c('0x27'));_0x2dd2fd[_0x1e7c('0x31')]=_[_0x1e7c('0x32')](_0x1abc37['query']);_0x2dd2fd['filters']=_[_0x1e7c('0x33')](_0x2dd2fd[_0x1e7c('0x30')],_0x2dd2fd[_0x1e7c('0x31')]);_0x23db14[_0x1e7c('0x34')]=_[_0x1e7c('0x33')](_0x2dd2fd[_0x1e7c('0x30')],qs[_0x1e7c('0x35')](_0x1abc37[_0x1e7c('0x31')][_0x1e7c('0x35')]));_0x23db14[_0x1e7c('0x34')]=_0x23db14[_0x1e7c('0x34')]['length']?_0x23db14[_0x1e7c('0x34')]:_0x2dd2fd[_0x1e7c('0x30')];if(!_0x1abc37[_0x1e7c('0x31')]['hasOwnProperty'](_0x1e7c('0x36'))){_0x23db14[_0x1e7c('0x1c')]=qs['limit'](_0x1abc37['query'][_0x1e7c('0x1c')]);_0x23db14[_0x1e7c('0x1b')]=qs[_0x1e7c('0x1b')](_0x1abc37[_0x1e7c('0x31')][_0x1e7c('0x1b')]);}_0x23db14['order']=qs[_0x1e7c('0x37')](_0x1abc37['query'][_0x1e7c('0x37')]);_0x23db14[_0x1e7c('0x38')]=qs[_0x1e7c('0x39')](_[_0x1e7c('0x3a')](_0x1abc37[_0x1e7c('0x31')],_0x2dd2fd[_0x1e7c('0x39')]),_0x12cf2d);if(_0x1abc37[_0x1e7c('0x31')][_0x1e7c('0x3b')]){_0x23db14[_0x1e7c('0x38')]=_[_0x1e7c('0x3c')](_0x23db14['where'],{'$or':_['map'](_0x12cf2d,function(_0x2b8c81){if(_0x2b8c81['type']!==_0x1e7c('0x3d')){var _0x177cf3={};_0x177cf3[_0x2b8c81[_0x1e7c('0x27')]]={'$like':'%'+_0x1abc37[_0x1e7c('0x31')][_0x1e7c('0x3b')]+'%'};return _0x177cf3;}})});}_0x23db14=_['merge']({},_0x23db14,_0x1abc37[_0x1e7c('0x3e')]);var _0x2cfe0b={'where':_0x23db14[_0x1e7c('0x38')]};return db[_0x1e7c('0x2b')]['count'](_0x2cfe0b)[_0x1e7c('0x25')](function(_0xbf5e9e){_0x5b9abd['count']=_0xbf5e9e;if(_0x1abc37[_0x1e7c('0x31')][_0x1e7c('0x3f')]){_0x23db14[_0x1e7c('0x40')]=[{'all':!![]}];}return db[_0x1e7c('0x2b')][_0x1e7c('0x41')](_0x23db14);})[_0x1e7c('0x25')](function(_0x35e619){_0x5b9abd[_0x1e7c('0x42')]=_0x35e619;return _0x5b9abd;})[_0x1e7c('0x25')](respondWithFilteredResult(_0x70adf3,_0x23db14))[_0x1e7c('0x43')](handleError(_0x70adf3,null));};exports['show']=function(_0x3307d7,_0x198a9f){var _0x452728={'raw':!![],'where':{'id':_0x3307d7[_0x1e7c('0x44')]['id']}},_0x7169ea={};_0x7169ea[_0x1e7c('0x30')]=_[_0x1e7c('0x32')](db[_0x1e7c('0x2b')][_0x1e7c('0x2c')]);_0x7169ea['query']=_[_0x1e7c('0x32')](_0x3307d7[_0x1e7c('0x31')]);_0x7169ea['filters']=_[_0x1e7c('0x33')](_0x7169ea[_0x1e7c('0x30')],_0x7169ea[_0x1e7c('0x31')]);_0x452728['attributes']=_[_0x1e7c('0x33')](_0x7169ea[_0x1e7c('0x30')],qs[_0x1e7c('0x35')](_0x3307d7[_0x1e7c('0x31')]['fields']));_0x452728[_0x1e7c('0x34')]=_0x452728['attributes'][_0x1e7c('0x45')]?_0x452728['attributes']:_0x7169ea[_0x1e7c('0x30')];if(_0x3307d7['query'][_0x1e7c('0x3f')]){_0x452728[_0x1e7c('0x40')]=[{'all':!![]}];}_0x452728=_[_0x1e7c('0x3c')]({},_0x452728,_0x3307d7[_0x1e7c('0x3e')]);return db[_0x1e7c('0x2b')]['find'](_0x452728)[_0x1e7c('0x25')](handleEntityNotFound(_0x198a9f,null))[_0x1e7c('0x25')](respondWithResult(_0x198a9f,null))[_0x1e7c('0x43')](handleError(_0x198a9f,null));};exports[_0x1e7c('0x46')]=function(_0xedce4b,_0x3d9e47){return db[_0x1e7c('0x2b')]['create'](_0xedce4b[_0x1e7c('0x47')],{})[_0x1e7c('0x25')](respondWithResult(_0x3d9e47,0xc9))[_0x1e7c('0x43')](handleError(_0x3d9e47,null));};exports[_0x1e7c('0x23')]=function(_0x2442e8,_0x5d4415){if(_0x2442e8[_0x1e7c('0x47')]['id']){delete _0x2442e8['body']['id'];}return db[_0x1e7c('0x2b')]['find']({'where':{'id':_0x2442e8[_0x1e7c('0x44')]['id']}})[_0x1e7c('0x25')](handleEntityNotFound(_0x5d4415,null))[_0x1e7c('0x25')](saveUpdates(_0x2442e8[_0x1e7c('0x47')],null))[_0x1e7c('0x25')](respondWithResult(_0x5d4415,null))[_0x1e7c('0x43')](handleError(_0x5d4415,null));};exports[_0x1e7c('0x24')]=function(_0x1b85c9,_0xbdfa8b){return db['OpenchannelQueueReport'][_0x1e7c('0x48')]({'where':{'id':_0x1b85c9[_0x1e7c('0x44')]['id']}})[_0x1e7c('0x25')](handleEntityNotFound(_0xbdfa8b,null))['then'](removeEntity(_0xbdfa8b,null))[_0x1e7c('0x43')](handleError(_0xbdfa8b,null));};exports[_0x1e7c('0x49')]=function(_0x17c243,_0x145812){return db['OpenchannelQueueReport'][_0x1e7c('0x49')]()[_0x1e7c('0x25')](respondWithResult(_0x145812,null))[_0x1e7c('0x43')](handleError(_0x145812,null));}; \ No newline at end of file +var _0x58f2=['pick','filter','type','VIRTUAL','options','includeAll','include','rows','catch','params','keys','length','merge','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','nolimit','sort','where'];(function(_0x1cbd08,_0x1eb1b8){var _0x40ae54=function(_0x2220ef){while(--_0x2220ef){_0x1cbd08['push'](_0x1cbd08['shift']());}};_0x40ae54(++_0x1eb1b8);}(_0x58f2,0x1f4));var _0x258f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x58f2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x258f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x258f('0x1'));var jsonpatch=require(_0x258f('0x2'));var rp=require('request-promise');var moment=require(_0x258f('0x3'));var BPromise=require(_0x258f('0x4'));var Mustache=require(_0x258f('0x5'));var util=require(_0x258f('0x6'));var path=require(_0x258f('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(_0x258f('0x8'));var squel=require(_0x258f('0x9'));var crypto=require(_0x258f('0xa'));var jsforce=require(_0x258f('0xb'));var deskjs=require(_0x258f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x258f('0xd'));var Papa=require(_0x258f('0xe'));var Redis=require(_0x258f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x258f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x258f('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x258f('0x12'));var db=require(_0x258f('0x13'))['db'];function respondWithStatusCode(_0x584a1f,_0x55f763){_0x55f763=_0x55f763||0xcc;return function(_0xa0c928){if(_0xa0c928){return _0x584a1f['sendStatus'](_0x55f763);}return _0x584a1f[_0x258f('0x14')](_0x55f763)[_0x258f('0x15')]();};}function respondWithResult(_0x188aa0,_0x46ec95){_0x46ec95=_0x46ec95||0xc8;return function(_0x5ba7db){if(_0x5ba7db){return _0x188aa0['status'](_0x46ec95)[_0x258f('0x16')](_0x5ba7db);}};}function respondWithFilteredResult(_0x19237c,_0x543bac){return function(_0x57170d){if(_0x57170d){var _0x5ae579=typeof _0x543bac['offset']===_0x258f('0x17')&&typeof _0x543bac[_0x258f('0x18')]===_0x258f('0x17');var _0x393479=_0x57170d[_0x258f('0x19')];var _0x304b1f=_0x5ae579?0x0:_0x543bac[_0x258f('0x1a')];var _0x437da0=_0x5ae579?_0x57170d[_0x258f('0x19')]:_0x543bac[_0x258f('0x1a')]+_0x543bac['limit'];var _0x29d62d;if(_0x437da0>=_0x393479){_0x437da0=_0x393479;_0x29d62d=0xc8;}else{_0x29d62d=0xce;}_0x19237c[_0x258f('0x14')](_0x29d62d);return _0x19237c[_0x258f('0x1b')]('Content-Range',_0x304b1f+'-'+_0x437da0+'/'+_0x393479)[_0x258f('0x16')](_0x57170d);}return null;};}function patchUpdates(_0x25db8b){return function(_0x239085){try{jsonpatch[_0x258f('0x1c')](_0x239085,_0x25db8b,!![]);}catch(_0x35f52f){return BPromise[_0x258f('0x1d')](_0x35f52f);}return _0x239085[_0x258f('0x1e')]();};}function saveUpdates(_0x579bae,_0x15a829){return function(_0x2ca6c3){if(_0x2ca6c3){return _0x2ca6c3[_0x258f('0x1f')](_0x579bae)[_0x258f('0x20')](function(_0x1dcbe4){return _0x1dcbe4;});}return null;};}function removeEntity(_0x959a2a,_0x3172fa){return function(_0x315a52){if(_0x315a52){return _0x315a52[_0x258f('0x21')]()[_0x258f('0x20')](function(){_0x959a2a[_0x258f('0x14')](0xcc)[_0x258f('0x15')]();});}};}function handleEntityNotFound(_0x165f8f,_0x40b173){return function(_0x41b557){if(!_0x41b557){_0x165f8f[_0x258f('0x22')](0x194);}return _0x41b557;};}function handleError(_0x1e241a,_0x1c3f4f){_0x1c3f4f=_0x1c3f4f||0x1f4;return function(_0x5a279b){logger['error'](_0x5a279b[_0x258f('0x23')]);if(_0x5a279b['name']){delete _0x5a279b[_0x258f('0x24')];}_0x1e241a['status'](_0x1c3f4f)['send'](_0x5a279b);};}exports[_0x258f('0x25')]=function(_0x57f531,_0x5e5d02){var _0x1adbc4={},_0x4dcf80={},_0x233c52={'count':0x0,'rows':[]};var _0x420048=_[_0x258f('0x26')](db[_0x258f('0x27')][_0x258f('0x28')],function(_0x24cfd1){return{'name':_0x24cfd1[_0x258f('0x29')],'type':_0x24cfd1['type'][_0x258f('0x2a')]};});_0x4dcf80[_0x258f('0x2b')]=_['map'](_0x420048,_0x258f('0x24'));_0x4dcf80[_0x258f('0x2c')]=_['keys'](_0x57f531[_0x258f('0x2c')]);_0x4dcf80[_0x258f('0x2d')]=_[_0x258f('0x2e')](_0x4dcf80[_0x258f('0x2b')],_0x4dcf80[_0x258f('0x2c')]);_0x1adbc4['attributes']=_['intersection'](_0x4dcf80[_0x258f('0x2b')],qs[_0x258f('0x2f')](_0x57f531[_0x258f('0x2c')][_0x258f('0x2f')]));_0x1adbc4[_0x258f('0x30')]=_0x1adbc4[_0x258f('0x30')]['length']?_0x1adbc4['attributes']:_0x4dcf80[_0x258f('0x2b')];if(!_0x57f531[_0x258f('0x2c')]['hasOwnProperty'](_0x258f('0x31'))){_0x1adbc4['limit']=qs['limit'](_0x57f531[_0x258f('0x2c')][_0x258f('0x18')]);_0x1adbc4[_0x258f('0x1a')]=qs[_0x258f('0x1a')](_0x57f531[_0x258f('0x2c')][_0x258f('0x1a')]);}_0x1adbc4['order']=qs[_0x258f('0x32')](_0x57f531[_0x258f('0x2c')][_0x258f('0x32')]);_0x1adbc4[_0x258f('0x33')]=qs[_0x258f('0x2d')](_[_0x258f('0x34')](_0x57f531[_0x258f('0x2c')],_0x4dcf80['filters']),_0x420048);if(_0x57f531[_0x258f('0x2c')][_0x258f('0x35')]){_0x1adbc4[_0x258f('0x33')]=_['merge'](_0x1adbc4[_0x258f('0x33')],{'$or':_[_0x258f('0x26')](_0x420048,function(_0x664cf9){if(_0x664cf9[_0x258f('0x36')]!==_0x258f('0x37')){var _0x44f3b3={};_0x44f3b3[_0x664cf9[_0x258f('0x24')]]={'$like':'%'+_0x57f531[_0x258f('0x2c')][_0x258f('0x35')]+'%'};return _0x44f3b3;}})});}_0x1adbc4=_['merge']({},_0x1adbc4,_0x57f531[_0x258f('0x38')]);var _0x521524={'where':_0x1adbc4[_0x258f('0x33')]};return db[_0x258f('0x27')]['count'](_0x521524)[_0x258f('0x20')](function(_0x34fc86){_0x233c52['count']=_0x34fc86;if(_0x57f531[_0x258f('0x2c')][_0x258f('0x39')]){_0x1adbc4[_0x258f('0x3a')]=[{'all':!![]}];}return db[_0x258f('0x27')]['findAll'](_0x1adbc4);})[_0x258f('0x20')](function(_0x48d330){_0x233c52[_0x258f('0x3b')]=_0x48d330;return _0x233c52;})[_0x258f('0x20')](respondWithFilteredResult(_0x5e5d02,_0x1adbc4))[_0x258f('0x3c')](handleError(_0x5e5d02,null));};exports['show']=function(_0x12ea40,_0x394820){var _0x32e97c={'raw':!![],'where':{'id':_0x12ea40[_0x258f('0x3d')]['id']}},_0x5ccd1a={};_0x5ccd1a[_0x258f('0x2b')]=_['keys'](db['OpenchannelQueueReport'][_0x258f('0x28')]);_0x5ccd1a[_0x258f('0x2c')]=_[_0x258f('0x3e')](_0x12ea40[_0x258f('0x2c')]);_0x5ccd1a[_0x258f('0x2d')]=_[_0x258f('0x2e')](_0x5ccd1a[_0x258f('0x2b')],_0x5ccd1a[_0x258f('0x2c')]);_0x32e97c[_0x258f('0x30')]=_[_0x258f('0x2e')](_0x5ccd1a['model'],qs['fields'](_0x12ea40[_0x258f('0x2c')][_0x258f('0x2f')]));_0x32e97c['attributes']=_0x32e97c[_0x258f('0x30')][_0x258f('0x3f')]?_0x32e97c[_0x258f('0x30')]:_0x5ccd1a[_0x258f('0x2b')];if(_0x12ea40['query']['includeAll']){_0x32e97c[_0x258f('0x3a')]=[{'all':!![]}];}_0x32e97c=_[_0x258f('0x40')]({},_0x32e97c,_0x12ea40[_0x258f('0x38')]);return db[_0x258f('0x27')][_0x258f('0x41')](_0x32e97c)['then'](handleEntityNotFound(_0x394820,null))[_0x258f('0x20')](respondWithResult(_0x394820,null))['catch'](handleError(_0x394820,null));};exports[_0x258f('0x42')]=function(_0x3a351c,_0x17f6c1){return db[_0x258f('0x27')]['create'](_0x3a351c[_0x258f('0x43')],{})[_0x258f('0x20')](respondWithResult(_0x17f6c1,0xc9))[_0x258f('0x3c')](handleError(_0x17f6c1,null));};exports[_0x258f('0x1f')]=function(_0x256966,_0x2afcbe){if(_0x256966['body']['id']){delete _0x256966['body']['id'];}return db[_0x258f('0x27')]['find']({'where':{'id':_0x256966[_0x258f('0x3d')]['id']}})[_0x258f('0x20')](handleEntityNotFound(_0x2afcbe,null))[_0x258f('0x20')](saveUpdates(_0x256966[_0x258f('0x43')],null))['then'](respondWithResult(_0x2afcbe,null))[_0x258f('0x3c')](handleError(_0x2afcbe,null));};exports[_0x258f('0x21')]=function(_0x43dd6f,_0x408c72){return db[_0x258f('0x27')]['find']({'where':{'id':_0x43dd6f[_0x258f('0x3d')]['id']}})[_0x258f('0x20')](handleEntityNotFound(_0x408c72,null))[_0x258f('0x20')](removeEntity(_0x408c72,null))[_0x258f('0x3c')](handleError(_0x408c72,null));};exports[_0x258f('0x44')]=function(_0x521ca7,_0x286c7a){return db[_0x258f('0x27')]['describe']()[_0x258f('0x20')](respondWithResult(_0x286c7a,null))['catch'](handleError(_0x286c7a,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 57e7c5a..ab8a06a 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x58f269,_0x285930){var _0x2524dc=function(_0x5592c0){while(--_0x5592c0){_0x58f269['push'](_0x58f269['shift']());}};_0x2524dc(++_0x285930);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xc4aa[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x30124a,_0xf2490c){var _0x1ea109=function(_0x2806fb){while(--_0x2806fb){_0x30124a['push'](_0x30124a['shift']());}};_0x1ea109(++_0xf2490c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc4aa[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index f425251..5a62c8c 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 _0x51c5=['attributes','limit','UpdateOpenchannelQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','debug','request\x20sent','stringify','error','code','message','OpenchannelQueueReport,\x20%s,\x20%s','info','catch','CreateOpenchannelQueueReport','create','options','raw','then','OpenchannelQueueReport','update','body','where'];(function(_0x1646fa,_0x4e5bd7){var _0x5a47a5=function(_0x2db820){while(--_0x2db820){_0x1646fa['push'](_0x1646fa['shift']());}};_0x5a47a5(++_0x4e5bd7);}(_0x51c5,0x8f));var _0x551c=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x51c5[_0x580647];return _0x5f0792;};'use strict';var _=require(_0x551c('0x0'));var util=require(_0x551c('0x1'));var moment=require(_0x551c('0x2'));var BPromise=require(_0x551c('0x3'));var rs=require(_0x551c('0x4'));var fs=require('fs');var Redis=require(_0x551c('0x5'));var db=require(_0x551c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x551c('0x7'))(_0x551c('0x8'));var config=require(_0x551c('0x9'));var jayson=require(_0x551c('0xa'));var client=jayson[_0x551c('0xb')][_0x551c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21dfa1,_0x196955,_0x4f3a0a){return new BPromise(function(_0x414edb,_0x15f4f8){return client[_0x551c('0xd')](_0x21dfa1,_0x4f3a0a)['then'](function(_0x17683c){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x196955,'request\x20sent');logger[_0x551c('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x196955,_0x551c('0xf'),JSON[_0x551c('0x10')](_0x17683c));if(_0x17683c[_0x551c('0x11')]){if(_0x17683c[_0x551c('0x11')][_0x551c('0x12')]===0x1f4){logger[_0x551c('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x196955,_0x17683c[_0x551c('0x11')][_0x551c('0x13')]);return _0x15f4f8(_0x17683c[_0x551c('0x11')]['message']);}logger[_0x551c('0x11')](_0x551c('0x14'),_0x196955,_0x17683c['error'][_0x551c('0x13')]);return _0x414edb(_0x17683c['error'][_0x551c('0x13')]);}else{logger[_0x551c('0x15')](_0x551c('0x14'),_0x196955,_0x551c('0xf'));_0x414edb(_0x17683c['result']['message']);}})[_0x551c('0x16')](function(_0xcdf011){logger['error'](_0x551c('0x14'),_0x196955,_0xcdf011);_0x15f4f8(_0xcdf011);});});}exports[_0x551c('0x17')]=function(_0x274432){var _0x2a0b55=this;return new Promise(function(_0x4c8dba,_0x4fcaf3){return db['OpenchannelQueueReport'][_0x551c('0x18')](_0x274432['body'],{'raw':_0x274432['options']?_0x274432[_0x551c('0x19')][_0x551c('0x1a')]===undefined?!![]:![]:!![]})[_0x551c('0x1b')](function(_0x1927e7){logger[_0x551c('0x15')](_0x551c('0x17'),_0x274432);logger['debug']('CreateOpenchannelQueueReport',_0x274432,JSON[_0x551c('0x10')](_0x1927e7));_0x4c8dba(_0x1927e7);})['catch'](function(_0x330160){logger[_0x551c('0x11')](_0x551c('0x17'),_0x330160[_0x551c('0x13')],_0x274432);_0x4fcaf3(_0x2a0b55[_0x551c('0x11')](0x1f4,_0x330160['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x194a1d){var _0x52cea5=this;return new Promise(function(_0x164343,_0x30f639){return db[_0x551c('0x1c')][_0x551c('0x1d')](_0x194a1d[_0x551c('0x1e')],{'raw':_0x194a1d[_0x551c('0x19')]?_0x194a1d[_0x551c('0x19')][_0x551c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x194a1d['options']?_0x194a1d[_0x551c('0x19')][_0x551c('0x1f')]||null:null,'attributes':_0x194a1d['options']?_0x194a1d[_0x551c('0x19')][_0x551c('0x20')]||null:null,'limit':_0x194a1d['options']?_0x194a1d[_0x551c('0x19')][_0x551c('0x21')]||null:null})[_0x551c('0x1b')](function(_0x1600b5){logger[_0x551c('0x15')]('UpdateOpenchannelQueueReport',_0x194a1d);logger[_0x551c('0xe')](_0x551c('0x22'),_0x194a1d,JSON[_0x551c('0x10')](_0x1600b5));_0x164343(_0x1600b5);})['catch'](function(_0x3aa0c0){logger[_0x551c('0x11')]('UpdateOpenchannelQueueReport',_0x3aa0c0['message'],_0x194a1d);_0x30f639(_0x52cea5[_0x551c('0x11')](0x1f4,_0x3aa0c0[_0x551c('0x13')]));});});}; \ No newline at end of file +var _0x2032=['../../config/environment','jayson/promise','client','http','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','then','stringify','UpdateOpenchannelQueueReport','update','where','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x2032,0xd9));var _0x2203=function(_0x4d20d1,_0x35fed2){_0x4d20d1=_0x4d20d1-0x0;var _0x182d58=_0x2032[_0x4d20d1];return _0x182d58;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var BPromise=require(_0x2203('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2203('0x3'));var db=require(_0x2203('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2203('0x5'))(_0x2203('0x6'));var config=require(_0x2203('0x7'));var jayson=require(_0x2203('0x8'));var client=jayson[_0x2203('0x9')][_0x2203('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e0f63,_0x2676aa,_0x18c4d6){return new BPromise(function(_0x2049ff,_0x2999ed){return client['request'](_0x2e0f63,_0x18c4d6)['then'](function(_0x10f055){logger['info'](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));logger[_0x2203('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x2676aa,_0x2203('0xc'),JSON['stringify'](_0x10f055));if(_0x10f055[_0x2203('0xe')]){if(_0x10f055['error'][_0x2203('0xf')]===0x1f4){logger[_0x2203('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2676aa,_0x10f055['error']['message']);return _0x2999ed(_0x10f055['error']['message']);}logger[_0x2203('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2676aa,_0x10f055['error'][_0x2203('0x10')]);return _0x2049ff(_0x10f055[_0x2203('0xe')][_0x2203('0x10')]);}else{logger[_0x2203('0x11')](_0x2203('0xb'),_0x2676aa,_0x2203('0xc'));_0x2049ff(_0x10f055[_0x2203('0x12')][_0x2203('0x10')]);}})[_0x2203('0x13')](function(_0x3053f3){logger['error'](_0x2203('0xb'),_0x2676aa,_0x3053f3);_0x2999ed(_0x3053f3);});});}exports[_0x2203('0x14')]=function(_0x4893ff){var _0x3f9ef6=this;return new Promise(function(_0x8906e1,_0x4aeb9f){return db[_0x2203('0x15')]['create'](_0x4893ff[_0x2203('0x16')],{'raw':_0x4893ff[_0x2203('0x17')]?_0x4893ff[_0x2203('0x17')][_0x2203('0x18')]===undefined?!![]:![]:!![]})[_0x2203('0x19')](function(_0x449039){logger['info'](_0x2203('0x14'),_0x4893ff);logger['debug']('CreateOpenchannelQueueReport',_0x4893ff,JSON[_0x2203('0x1a')](_0x449039));_0x8906e1(_0x449039);})['catch'](function(_0x3b8ef9){logger[_0x2203('0xe')]('CreateOpenchannelQueueReport',_0x3b8ef9[_0x2203('0x10')],_0x4893ff);_0x4aeb9f(_0x3f9ef6['error'](0x1f4,_0x3b8ef9['message']));});});};exports[_0x2203('0x1b')]=function(_0x2718f5){var _0x21f930=this;return new Promise(function(_0xfd0970,_0x1244f4){return db[_0x2203('0x15')][_0x2203('0x1c')](_0x2718f5[_0x2203('0x16')],{'raw':_0x2718f5['options']?_0x2718f5[_0x2203('0x17')][_0x2203('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2718f5[_0x2203('0x17')]?_0x2718f5['options'][_0x2203('0x1d')]||null:null,'attributes':_0x2718f5[_0x2203('0x17')]?_0x2718f5['options'][_0x2203('0x1e')]||null:null,'limit':_0x2718f5[_0x2203('0x17')]?_0x2718f5[_0x2203('0x17')][_0x2203('0x1f')]||null:null})[_0x2203('0x19')](function(_0x1df508){logger[_0x2203('0x11')]('UpdateOpenchannelQueueReport',_0x2718f5);logger[_0x2203('0xd')](_0x2203('0x1b'),_0x2718f5,JSON[_0x2203('0x1a')](_0x1df508));_0xfd0970(_0x1df508);})[_0x2203('0x13')](function(_0x52a426){logger[_0x2203('0xe')](_0x2203('0x1b'),_0x52a426[_0x2203('0x10')],_0x2718f5);_0x1244f4(_0x21f930[_0x2203('0xe')](0x1f4,_0x52a426['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 2d6f4dc..3a176d5 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 _0x3ce6=['multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ce6,0x118));var _0x63ce=function(_0x57206a,_0x3e9a18){_0x57206a=_0x57206a-0x0;var _0xf54af4=_0x3ce6[_0x57206a];return _0xf54af4;};'use strict';var multer=require(_0x63ce('0x0'));var util=require('util');var path=require(_0x63ce('0x1'));var timeout=require(_0x63ce('0x2'));var express=require(_0x63ce('0x3'));var router=express['Router']();var fs_extra=require(_0x63ce('0x4'));var auth=require(_0x63ce('0x5'));var interaction=require(_0x63ce('0x6'));var config=require(_0x63ce('0x7'));var controller=require(_0x63ce('0x8'));router[_0x63ce('0x9')]('/',auth[_0x63ce('0xa')](),controller[_0x63ce('0xb')]);router['get'](_0x63ce('0xc'),auth[_0x63ce('0xa')](),controller[_0x63ce('0xd')]);router[_0x63ce('0x9')](_0x63ce('0xe'),auth[_0x63ce('0xa')](),controller[_0x63ce('0xf')]);router[_0x63ce('0x10')]('/',auth[_0x63ce('0xa')](),controller['create']);router['put']('/:id',auth[_0x63ce('0xa')](),controller[_0x63ce('0x11')]);router[_0x63ce('0x12')](_0x63ce('0xe'),auth[_0x63ce('0xa')](),controller['destroy']);module[_0x63ce('0x13')]=router; \ No newline at end of file +var _0x17f9=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','put','update','delete','multer','util','connect-timeout','express','Router'];(function(_0x457d51,_0x259c93){var _0x266b92=function(_0x312151){while(--_0x312151){_0x457d51['push'](_0x457d51['shift']());}};_0x266b92(++_0x259c93);}(_0x17f9,0x121));var _0x917f=function(_0x27dba4,_0x419253){_0x27dba4=_0x27dba4-0x0;var _0x35ec9d=_0x17f9[_0x27dba4];return _0x35ec9d;};'use strict';var multer=require(_0x917f('0x0'));var util=require(_0x917f('0x1'));var path=require('path');var timeout=require(_0x917f('0x2'));var express=require(_0x917f('0x3'));var router=express[_0x917f('0x4')]();var fs_extra=require(_0x917f('0x5'));var auth=require(_0x917f('0x6'));var interaction=require(_0x917f('0x7'));var config=require(_0x917f('0x8'));var controller=require(_0x917f('0x9'));router['get']('/',auth[_0x917f('0xa')](),controller[_0x917f('0xb')]);router[_0x917f('0xc')](_0x917f('0xd'),auth[_0x917f('0xa')](),controller[_0x917f('0xe')]);router['get'](_0x917f('0xf'),auth[_0x917f('0xa')](),controller[_0x917f('0x10')]);router[_0x917f('0x11')]('/',auth[_0x917f('0xa')](),controller['create']);router[_0x917f('0x12')](_0x917f('0xf'),auth[_0x917f('0xa')](),controller[_0x917f('0x13')]);router[_0x917f('0x14')]('/:id',auth[_0x917f('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index fdccb04..7a32678 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x69752e,_0x2579f6){var _0x506a36=function(_0x1793bc){while(--_0x1793bc){_0x69752e['push'](_0x69752e['shift']());}};_0x506a36(++_0x2579f6);}(_0x54ef,0x112));var _0xf54e=function(_0x498147,_0x473ac3){_0x498147=_0x498147-0x0;var _0x53b8ce=_0x54ef[_0x498147];return _0x53b8ce;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x3408b2,_0x41cee5){var _0x244f81=function(_0x4d7e51){while(--_0x4d7e51){_0x3408b2['push'](_0x3408b2['shift']());}};_0x244f81(++_0x41cee5);}(_0x008c,0x188));var _0xc008=function(_0x4a02e9,_0x5d7b67){_0x4a02e9=_0x4a02e9-0x0;var _0x229ed7=_0x008c[_0x4a02e9];return _0x229ed7;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 68c7769..2492153 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 _0xb287=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','error','name','send','index','OpenchannelTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','fields','includeAll','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','fs-extra'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xb287,0x1a6));var _0x7b28=function(_0x43134c,_0x79bf87){_0x43134c=_0x43134c-0x0;var _0x4ded1c=_0xb287[_0x43134c];return _0x4ded1c;};'use strict';var emlformat=require(_0x7b28('0x0'));var rimraf=require(_0x7b28('0x1'));var zipdir=require(_0x7b28('0x2'));var jsonpatch=require(_0x7b28('0x3'));var rp=require('request-promise');var moment=require(_0x7b28('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7b28('0x5'));var path=require('path');var sox=require(_0x7b28('0x6'));var csv=require(_0x7b28('0x7'));var ejs=require(_0x7b28('0x8'));var fs=require('fs');var fs_extra=require(_0x7b28('0x9'));var _=require(_0x7b28('0xa'));var squel=require(_0x7b28('0xb'));var crypto=require(_0x7b28('0xc'));var jsforce=require(_0x7b28('0xd'));var deskjs=require(_0x7b28('0xe'));var toCsv=require(_0x7b28('0x7'));var querystring=require(_0x7b28('0xf'));var Papa=require(_0x7b28('0x10'));var Redis=require(_0x7b28('0x11'));var authService=require(_0x7b28('0x12'));var qs=require(_0x7b28('0x13'));var as=require(_0x7b28('0x14'));var hardwareService=require(_0x7b28('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x7b28('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7b28('0x17'));var db=require(_0x7b28('0x18'))['db'];function respondWithStatusCode(_0x1e1e12,_0x224b56){_0x224b56=_0x224b56||0xcc;return function(_0x58ceb4){if(_0x58ceb4){return _0x1e1e12[_0x7b28('0x19')](_0x224b56);}return _0x1e1e12['status'](_0x224b56)[_0x7b28('0x1a')]();};}function respondWithResult(_0x350c05,_0x409cba){_0x409cba=_0x409cba||0xc8;return function(_0x1c2139){if(_0x1c2139){return _0x350c05['status'](_0x409cba)[_0x7b28('0x1b')](_0x1c2139);}};}function respondWithFilteredResult(_0x39948a,_0x2d55db){return function(_0x29604a){if(_0x29604a){var _0x2d7cd1=typeof _0x2d55db[_0x7b28('0x1c')]===_0x7b28('0x1d')&&typeof _0x2d55db[_0x7b28('0x1e')]===_0x7b28('0x1d');var _0x522d61=_0x29604a[_0x7b28('0x1f')];var _0x274ca0=_0x2d7cd1?0x0:_0x2d55db[_0x7b28('0x1c')];var _0xdfdf2c=_0x2d7cd1?_0x29604a['count']:_0x2d55db[_0x7b28('0x1c')]+_0x2d55db['limit'];var _0x4f540c;if(_0xdfdf2c>=_0x522d61){_0xdfdf2c=_0x522d61;_0x4f540c=0xc8;}else{_0x4f540c=0xce;}_0x39948a[_0x7b28('0x20')](_0x4f540c);return _0x39948a[_0x7b28('0x21')](_0x7b28('0x22'),_0x274ca0+'-'+_0xdfdf2c+'/'+_0x522d61)['json'](_0x29604a);}return null;};}function patchUpdates(_0x567498){return function(_0x1a6dee){try{jsonpatch[_0x7b28('0x23')](_0x1a6dee,_0x567498,!![]);}catch(_0x338bdb){return BPromise[_0x7b28('0x24')](_0x338bdb);}return _0x1a6dee['save']();};}function saveUpdates(_0x66977b,_0x46a9f7){return function(_0x5a9a0f){if(_0x5a9a0f){return _0x5a9a0f[_0x7b28('0x25')](_0x66977b)[_0x7b28('0x26')](function(_0x3d256a){return _0x3d256a;});}return null;};}function removeEntity(_0x5c5385,_0x57b42f){return function(_0x57fca1){if(_0x57fca1){return _0x57fca1['destroy']()['then'](function(){_0x5c5385[_0x7b28('0x20')](0xcc)[_0x7b28('0x1a')]();});}};}function handleEntityNotFound(_0x4d3af1,_0x4b4bc6){return function(_0x5f2b51){if(!_0x5f2b51){_0x4d3af1[_0x7b28('0x19')](0x194);}return _0x5f2b51;};}function handleError(_0x2d852c,_0x1107f6){_0x1107f6=_0x1107f6||0x1f4;return function(_0x27c9d7){logger[_0x7b28('0x27')](_0x27c9d7['stack']);if(_0x27c9d7[_0x7b28('0x28')]){delete _0x27c9d7['name'];}_0x2d852c[_0x7b28('0x20')](_0x1107f6)[_0x7b28('0x29')](_0x27c9d7);};}exports[_0x7b28('0x2a')]=function(_0x150234,_0x3b758e){var _0x34fe35={},_0xf06b09={},_0x2e7386={'count':0x0,'rows':[]};var _0x406ac7=_['map'](db[_0x7b28('0x2b')]['rawAttributes'],function(_0x104777){return{'name':_0x104777[_0x7b28('0x2c')],'type':_0x104777[_0x7b28('0x2d')][_0x7b28('0x2e')]};});_0xf06b09[_0x7b28('0x2f')]=_['map'](_0x406ac7,_0x7b28('0x28'));_0xf06b09[_0x7b28('0x30')]=_[_0x7b28('0x31')](_0x150234[_0x7b28('0x30')]);_0xf06b09[_0x7b28('0x32')]=_[_0x7b28('0x33')](_0xf06b09[_0x7b28('0x2f')],_0xf06b09[_0x7b28('0x30')]);_0x34fe35[_0x7b28('0x34')]=_[_0x7b28('0x33')](_0xf06b09['model'],qs['fields'](_0x150234[_0x7b28('0x30')]['fields']));_0x34fe35[_0x7b28('0x34')]=_0x34fe35['attributes'][_0x7b28('0x35')]?_0x34fe35[_0x7b28('0x34')]:_0xf06b09[_0x7b28('0x2f')];if(!_0x150234['query']['hasOwnProperty']('nolimit')){_0x34fe35[_0x7b28('0x1e')]=qs[_0x7b28('0x1e')](_0x150234[_0x7b28('0x30')][_0x7b28('0x1e')]);_0x34fe35['offset']=qs[_0x7b28('0x1c')](_0x150234['query'][_0x7b28('0x1c')]);}_0x34fe35[_0x7b28('0x36')]=qs[_0x7b28('0x37')](_0x150234[_0x7b28('0x30')][_0x7b28('0x37')]);_0x34fe35[_0x7b28('0x38')]=qs[_0x7b28('0x32')](_[_0x7b28('0x39')](_0x150234[_0x7b28('0x30')],_0xf06b09[_0x7b28('0x32')]),_0x406ac7);if(_0x150234[_0x7b28('0x30')][_0x7b28('0x3a')]){_0x34fe35[_0x7b28('0x38')]=_[_0x7b28('0x3b')](_0x34fe35['where'],{'$or':_['map'](_0x406ac7,function(_0x4a7011){if(_0x4a7011[_0x7b28('0x2d')]!=='VIRTUAL'){var _0x137323={};_0x137323[_0x4a7011[_0x7b28('0x28')]]={'$like':'%'+_0x150234[_0x7b28('0x30')]['filter']+'%'};return _0x137323;}})});}_0x34fe35=_[_0x7b28('0x3b')]({},_0x34fe35,_0x150234[_0x7b28('0x3c')]);var _0x5e2455={'where':_0x34fe35['where']};return db[_0x7b28('0x2b')]['count'](_0x5e2455)['then'](function(_0x29f1c){_0x2e7386[_0x7b28('0x1f')]=_0x29f1c;if(_0x150234[_0x7b28('0x30')]['includeAll']){_0x34fe35[_0x7b28('0x3d')]=[{'all':!![]}];}return db[_0x7b28('0x2b')][_0x7b28('0x3e')](_0x34fe35);})['then'](function(_0x370eb1){_0x2e7386['rows']=_0x370eb1;return _0x2e7386;})[_0x7b28('0x26')](respondWithFilteredResult(_0x3b758e,_0x34fe35))[_0x7b28('0x3f')](handleError(_0x3b758e,null));};exports[_0x7b28('0x40')]=function(_0x2a053d,_0x5a6d15){var _0x316aa9={'raw':!![],'where':{'id':_0x2a053d[_0x7b28('0x41')]['id']}},_0x1c7e01={};_0x1c7e01[_0x7b28('0x2f')]=_['keys'](db[_0x7b28('0x2b')]['rawAttributes']);_0x1c7e01[_0x7b28('0x30')]=_[_0x7b28('0x31')](_0x2a053d[_0x7b28('0x30')]);_0x1c7e01[_0x7b28('0x32')]=_[_0x7b28('0x33')](_0x1c7e01[_0x7b28('0x2f')],_0x1c7e01['query']);_0x316aa9[_0x7b28('0x34')]=_[_0x7b28('0x33')](_0x1c7e01['model'],qs[_0x7b28('0x42')](_0x2a053d[_0x7b28('0x30')][_0x7b28('0x42')]));_0x316aa9['attributes']=_0x316aa9['attributes'][_0x7b28('0x35')]?_0x316aa9['attributes']:_0x1c7e01['model'];if(_0x2a053d[_0x7b28('0x30')][_0x7b28('0x43')]){_0x316aa9[_0x7b28('0x3d')]=[{'all':!![]}];}_0x316aa9=_[_0x7b28('0x3b')]({},_0x316aa9,_0x2a053d['options']);return db[_0x7b28('0x2b')]['find'](_0x316aa9)[_0x7b28('0x26')](handleEntityNotFound(_0x5a6d15,null))[_0x7b28('0x26')](respondWithResult(_0x5a6d15,null))[_0x7b28('0x3f')](handleError(_0x5a6d15,null));};exports[_0x7b28('0x44')]=function(_0x21dfce,_0xb6dc4a){return db['OpenchannelTransferReport'][_0x7b28('0x44')](_0x21dfce[_0x7b28('0x45')],{})[_0x7b28('0x26')](respondWithResult(_0xb6dc4a,0xc9))[_0x7b28('0x3f')](handleError(_0xb6dc4a,null));};exports[_0x7b28('0x25')]=function(_0x2d495c,_0x27de2b){if(_0x2d495c[_0x7b28('0x45')]['id']){delete _0x2d495c[_0x7b28('0x45')]['id'];}return db[_0x7b28('0x2b')]['find']({'where':{'id':_0x2d495c['params']['id']}})[_0x7b28('0x26')](handleEntityNotFound(_0x27de2b,null))[_0x7b28('0x26')](saveUpdates(_0x2d495c['body'],null))['then'](respondWithResult(_0x27de2b,null))[_0x7b28('0x3f')](handleError(_0x27de2b,null));};exports[_0x7b28('0x46')]=function(_0x3adfe2,_0x371674){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x3adfe2[_0x7b28('0x41')]['id']}})[_0x7b28('0x26')](handleEntityNotFound(_0x371674,null))[_0x7b28('0x26')](removeEntity(_0x371674,null))[_0x7b28('0x3f')](handleError(_0x371674,null));};exports[_0x7b28('0x47')]=function(_0x131a96,_0x291675){return db[_0x7b28('0x2b')][_0x7b28('0x47')]()[_0x7b28('0x26')](respondWithResult(_0x291675,null))[_0x7b28('0x3f')](handleError(_0x291675,null));}; \ No newline at end of file +var _0xecfd=['sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','update','then','destroy','error','name','send','index','OpenchannelTransferReport','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','rawAttributes','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x33501f,_0x2cae5){var _0x3e3713=function(_0x3278e3){while(--_0x3278e3){_0x33501f['push'](_0x33501f['shift']());}};_0x3e3713(++_0x2cae5);}(_0xecfd,0x15e));var _0xdecf=function(_0x29fc2c,_0x4ff86a){_0x29fc2c=_0x29fc2c-0x0;var _0x1adbc8=_0xecfd[_0x29fc2c];return _0x1adbc8;};'use strict';var emlformat=require(_0xdecf('0x0'));var rimraf=require(_0xdecf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdecf('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdecf('0x3'));var util=require(_0xdecf('0x4'));var path=require(_0xdecf('0x5'));var sox=require(_0xdecf('0x6'));var csv=require(_0xdecf('0x7'));var ejs=require(_0xdecf('0x8'));var fs=require('fs');var fs_extra=require(_0xdecf('0x9'));var _=require(_0xdecf('0xa'));var squel=require(_0xdecf('0xb'));var crypto=require(_0xdecf('0xc'));var jsforce=require(_0xdecf('0xd'));var deskjs=require(_0xdecf('0xe'));var toCsv=require(_0xdecf('0x7'));var querystring=require(_0xdecf('0xf'));var Papa=require('papaparse');var Redis=require(_0xdecf('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdecf('0x11'));var hardwareService=require(_0xdecf('0x12'));var logger=require(_0xdecf('0x13'))(_0xdecf('0x14'));var utils=require(_0xdecf('0x15'));var config=require(_0xdecf('0x16'));var licenseUtil=require(_0xdecf('0x17'));var db=require(_0xdecf('0x18'))['db'];function respondWithStatusCode(_0x275c9d,_0x2411f1){_0x2411f1=_0x2411f1||0xcc;return function(_0x5ecca0){if(_0x5ecca0){return _0x275c9d[_0xdecf('0x19')](_0x2411f1);}return _0x275c9d[_0xdecf('0x1a')](_0x2411f1)[_0xdecf('0x1b')]();};}function respondWithResult(_0x26fba9,_0xa14ed4){_0xa14ed4=_0xa14ed4||0xc8;return function(_0x50d74c){if(_0x50d74c){return _0x26fba9[_0xdecf('0x1a')](_0xa14ed4)['json'](_0x50d74c);}};}function respondWithFilteredResult(_0x316f89,_0x492a52){return function(_0x41b426){if(_0x41b426){var _0x23e90a=typeof _0x492a52[_0xdecf('0x1c')]===_0xdecf('0x1d')&&typeof _0x492a52['limit']==='undefined';var _0x1a03e7=_0x41b426['count'];var _0x2e4477=_0x23e90a?0x0:_0x492a52[_0xdecf('0x1c')];var _0x2e1509=_0x23e90a?_0x41b426[_0xdecf('0x1e')]:_0x492a52['offset']+_0x492a52[_0xdecf('0x1f')];var _0x31641c;if(_0x2e1509>=_0x1a03e7){_0x2e1509=_0x1a03e7;_0x31641c=0xc8;}else{_0x31641c=0xce;}_0x316f89[_0xdecf('0x1a')](_0x31641c);return _0x316f89['set'](_0xdecf('0x20'),_0x2e4477+'-'+_0x2e1509+'/'+_0x1a03e7)[_0xdecf('0x21')](_0x41b426);}return null;};}function patchUpdates(_0x8ef2a7){return function(_0x32534d){try{jsonpatch[_0xdecf('0x22')](_0x32534d,_0x8ef2a7,!![]);}catch(_0x2deae5){return BPromise[_0xdecf('0x23')](_0x2deae5);}return _0x32534d['save']();};}function saveUpdates(_0x308568,_0x165e04){return function(_0x597a54){if(_0x597a54){return _0x597a54[_0xdecf('0x24')](_0x308568)[_0xdecf('0x25')](function(_0x3b3593){return _0x3b3593;});}return null;};}function removeEntity(_0x1660b8,_0x195f5e){return function(_0x10c89f){if(_0x10c89f){return _0x10c89f[_0xdecf('0x26')]()['then'](function(){_0x1660b8[_0xdecf('0x1a')](0xcc)[_0xdecf('0x1b')]();});}};}function handleEntityNotFound(_0x3733f6,_0x50d9e4){return function(_0x4aa0a9){if(!_0x4aa0a9){_0x3733f6['sendStatus'](0x194);}return _0x4aa0a9;};}function handleError(_0x3d3eb5,_0x12fce3){_0x12fce3=_0x12fce3||0x1f4;return function(_0xeebd2e){logger[_0xdecf('0x27')](_0xeebd2e['stack']);if(_0xeebd2e[_0xdecf('0x28')]){delete _0xeebd2e[_0xdecf('0x28')];}_0x3d3eb5['status'](_0x12fce3)[_0xdecf('0x29')](_0xeebd2e);};}exports[_0xdecf('0x2a')]=function(_0x2c5be1,_0x1f50cf){var _0x40ccbb={},_0x11de2b={},_0x52d9cd={'count':0x0,'rows':[]};var _0x16499d=_['map'](db[_0xdecf('0x2b')]['rawAttributes'],function(_0x1cca6d){return{'name':_0x1cca6d[_0xdecf('0x2c')],'type':_0x1cca6d[_0xdecf('0x2d')][_0xdecf('0x2e')]};});_0x11de2b['model']=_[_0xdecf('0x2f')](_0x16499d,_0xdecf('0x28'));_0x11de2b[_0xdecf('0x30')]=_[_0xdecf('0x31')](_0x2c5be1[_0xdecf('0x30')]);_0x11de2b[_0xdecf('0x32')]=_['intersection'](_0x11de2b[_0xdecf('0x33')],_0x11de2b['query']);_0x40ccbb[_0xdecf('0x34')]=_[_0xdecf('0x35')](_0x11de2b[_0xdecf('0x33')],qs[_0xdecf('0x36')](_0x2c5be1[_0xdecf('0x30')][_0xdecf('0x36')]));_0x40ccbb['attributes']=_0x40ccbb[_0xdecf('0x34')][_0xdecf('0x37')]?_0x40ccbb[_0xdecf('0x34')]:_0x11de2b[_0xdecf('0x33')];if(!_0x2c5be1['query'][_0xdecf('0x38')](_0xdecf('0x39'))){_0x40ccbb[_0xdecf('0x1f')]=qs[_0xdecf('0x1f')](_0x2c5be1['query'][_0xdecf('0x1f')]);_0x40ccbb['offset']=qs['offset'](_0x2c5be1[_0xdecf('0x30')]['offset']);}_0x40ccbb[_0xdecf('0x3a')]=qs[_0xdecf('0x3b')](_0x2c5be1['query']['sort']);_0x40ccbb[_0xdecf('0x3c')]=qs[_0xdecf('0x32')](_['pick'](_0x2c5be1[_0xdecf('0x30')],_0x11de2b['filters']),_0x16499d);if(_0x2c5be1[_0xdecf('0x30')][_0xdecf('0x3d')]){_0x40ccbb[_0xdecf('0x3c')]=_[_0xdecf('0x3e')](_0x40ccbb[_0xdecf('0x3c')],{'$or':_['map'](_0x16499d,function(_0x43a74c){if(_0x43a74c[_0xdecf('0x2d')]!==_0xdecf('0x3f')){var _0x3fc056={};_0x3fc056[_0x43a74c['name']]={'$like':'%'+_0x2c5be1[_0xdecf('0x30')][_0xdecf('0x3d')]+'%'};return _0x3fc056;}})});}_0x40ccbb=_[_0xdecf('0x3e')]({},_0x40ccbb,_0x2c5be1[_0xdecf('0x40')]);var _0x36f91b={'where':_0x40ccbb[_0xdecf('0x3c')]};return db[_0xdecf('0x2b')]['count'](_0x36f91b)[_0xdecf('0x25')](function(_0x81f196){_0x52d9cd[_0xdecf('0x1e')]=_0x81f196;if(_0x2c5be1[_0xdecf('0x30')][_0xdecf('0x41')]){_0x40ccbb[_0xdecf('0x42')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x40ccbb);})[_0xdecf('0x25')](function(_0x2a09ee){_0x52d9cd[_0xdecf('0x43')]=_0x2a09ee;return _0x52d9cd;})[_0xdecf('0x25')](respondWithFilteredResult(_0x1f50cf,_0x40ccbb))[_0xdecf('0x44')](handleError(_0x1f50cf,null));};exports['show']=function(_0x5cc502,_0x5bd6bf){var _0x1597ff={'raw':!![],'where':{'id':_0x5cc502['params']['id']}},_0x3abc21={};_0x3abc21[_0xdecf('0x33')]=_[_0xdecf('0x31')](db[_0xdecf('0x2b')][_0xdecf('0x45')]);_0x3abc21[_0xdecf('0x30')]=_[_0xdecf('0x31')](_0x5cc502[_0xdecf('0x30')]);_0x3abc21[_0xdecf('0x32')]=_[_0xdecf('0x35')](_0x3abc21[_0xdecf('0x33')],_0x3abc21[_0xdecf('0x30')]);_0x1597ff['attributes']=_[_0xdecf('0x35')](_0x3abc21[_0xdecf('0x33')],qs[_0xdecf('0x36')](_0x5cc502[_0xdecf('0x30')][_0xdecf('0x36')]));_0x1597ff[_0xdecf('0x34')]=_0x1597ff[_0xdecf('0x34')][_0xdecf('0x37')]?_0x1597ff[_0xdecf('0x34')]:_0x3abc21[_0xdecf('0x33')];if(_0x5cc502['query'][_0xdecf('0x41')]){_0x1597ff[_0xdecf('0x42')]=[{'all':!![]}];}_0x1597ff=_[_0xdecf('0x3e')]({},_0x1597ff,_0x5cc502[_0xdecf('0x40')]);return db[_0xdecf('0x2b')][_0xdecf('0x46')](_0x1597ff)[_0xdecf('0x25')](handleEntityNotFound(_0x5bd6bf,null))['then'](respondWithResult(_0x5bd6bf,null))[_0xdecf('0x44')](handleError(_0x5bd6bf,null));};exports[_0xdecf('0x47')]=function(_0x509ac5,_0x420667){return db[_0xdecf('0x2b')][_0xdecf('0x47')](_0x509ac5[_0xdecf('0x48')],{})[_0xdecf('0x25')](respondWithResult(_0x420667,0xc9))[_0xdecf('0x44')](handleError(_0x420667,null));};exports['update']=function(_0x4c7892,_0x5280e2){if(_0x4c7892[_0xdecf('0x48')]['id']){delete _0x4c7892[_0xdecf('0x48')]['id'];}return db[_0xdecf('0x2b')]['find']({'where':{'id':_0x4c7892[_0xdecf('0x49')]['id']}})[_0xdecf('0x25')](handleEntityNotFound(_0x5280e2,null))[_0xdecf('0x25')](saveUpdates(_0x4c7892['body'],null))[_0xdecf('0x25')](respondWithResult(_0x5280e2,null))['catch'](handleError(_0x5280e2,null));};exports[_0xdecf('0x26')]=function(_0x57ccac,_0x25b6b8){return db[_0xdecf('0x2b')][_0xdecf('0x46')]({'where':{'id':_0x57ccac[_0xdecf('0x49')]['id']}})[_0xdecf('0x25')](handleEntityNotFound(_0x25b6b8,null))[_0xdecf('0x25')](removeEntity(_0x25b6b8,null))[_0xdecf('0x44')](handleError(_0x25b6b8,null));};exports[_0xdecf('0x4a')]=function(_0x549afe,_0x3d921c){return db['OpenchannelTransferReport'][_0xdecf('0x4a')]()['then'](respondWithResult(_0x3d921c,null))['catch'](handleError(_0x3d921c,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index f9f6195..990fd37 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 _0xf69a=['bluebird','request-promise','path','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','../../config/logger','api','moment'];(function(_0x338a33,_0xd61e6a){var _0x3a5225=function(_0x13beca){while(--_0x13beca){_0x338a33['push'](_0x338a33['shift']());}};_0x3a5225(++_0xd61e6a);}(_0xf69a,0xf3));var _0xaf69=function(_0x5628b8,_0x145582){_0x5628b8=_0x5628b8-0x0;var _0x3ce423=_0xf69a[_0x5628b8];return _0x3ce423;};'use strict';var _=require('lodash');var util=require(_0xaf69('0x0'));var logger=require(_0xaf69('0x1'))(_0xaf69('0x2'));var moment=require(_0xaf69('0x3'));var BPromise=require(_0xaf69('0x4'));var rp=require(_0xaf69('0x5'));var fs=require('fs');var path=require(_0xaf69('0x6'));var rimraf=require('rimraf');var config=require(_0xaf69('0x7'));var attributes=require(_0xaf69('0x8'));module['exports']=function(_0x29dca2,_0x3f1e7e){return _0x29dca2[_0xaf69('0x9')](_0xaf69('0xa'),attributes,{'tableName':_0xaf69('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xaf69('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4e5c=['exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelTransferReport.attributes'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0x4e5c,0x9f));var _0xc4e5=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x4e5c[_0x9c2427];return _0x51984f;};'use strict';var _=require('lodash');var util=require(_0xc4e5('0x0'));var logger=require(_0xc4e5('0x1'))(_0xc4e5('0x2'));var moment=require(_0xc4e5('0x3'));var BPromise=require(_0xc4e5('0x4'));var rp=require(_0xc4e5('0x5'));var fs=require('fs');var path=require(_0xc4e5('0x6'));var rimraf=require(_0xc4e5('0x7'));var config=require('../../config/environment');var attributes=require(_0xc4e5('0x8'));module[_0xc4e5('0x9')]=function(_0x1c777d,_0x1cfd06){return _0x1c777d[_0xc4e5('0xa')](_0xc4e5('0xb'),attributes,{'tableName':_0xc4e5('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc4e5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 4d6a2e1..79300f6 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 _0xd13e=['OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xa291c4,_0x44c16b){var _0x24086f=function(_0xe60e24){while(--_0xe60e24){_0xa291c4['push'](_0xa291c4['shift']());}};_0x24086f(++_0x44c16b);}(_0xd13e,0x193));var _0xed13=function(_0x3d79b7,_0x136918){_0x3d79b7=_0x3d79b7-0x0;var _0x3ad4b0=_0xd13e[_0x3d79b7];return _0x3ad4b0;};'use strict';var _=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var moment=require(_0xed13('0x2'));var BPromise=require(_0xed13('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed13('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed13('0x5'));var logger=require('../../config/logger')(_0xed13('0x6'));var config=require(_0xed13('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x95ff4c,_0x134929,_0xab0fff){return new BPromise(function(_0x3b3984,_0x369798){return client[_0xed13('0x8')](_0x95ff4c,_0xab0fff)[_0xed13('0x9')](function(_0x9bc191){logger[_0xed13('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x134929,_0xed13('0xb'));logger[_0xed13('0xc')](_0xed13('0xd'),_0x134929,_0xed13('0xb'),JSON[_0xed13('0xe')](_0x9bc191));if(_0x9bc191['error']){if(_0x9bc191[_0xed13('0xf')][_0xed13('0x10')]===0x1f4){logger[_0xed13('0xf')](_0xed13('0x11'),_0x134929,_0x9bc191[_0xed13('0xf')][_0xed13('0x12')]);return _0x369798(_0x9bc191['error'][_0xed13('0x12')]);}logger['error'](_0xed13('0x11'),_0x134929,_0x9bc191['error'][_0xed13('0x12')]);return _0x3b3984(_0x9bc191['error'][_0xed13('0x12')]);}else{logger['info'](_0xed13('0x11'),_0x134929,_0xed13('0xb'));_0x3b3984(_0x9bc191[_0xed13('0x13')][_0xed13('0x12')]);}})[_0xed13('0x14')](function(_0x1f8585){logger[_0xed13('0xf')](_0xed13('0x11'),_0x134929,_0x1f8585);_0x369798(_0x1f8585);});});} \ No newline at end of file +var _0x7b27=['../../config/logger','../../config/environment','jayson/promise','client','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x411e71,_0xf9652){var _0x226ae3=function(_0x1339f6){while(--_0x1339f6){_0x411e71['push'](_0x411e71['shift']());}};_0x226ae3(++_0xf9652);}(_0x7b27,0x186));var _0x77b2=function(_0x4eb44d,_0x487d97){_0x4eb44d=_0x4eb44d-0x0;var _0x3c5226=_0x7b27[_0x4eb44d];return _0x3c5226;};'use strict';var _=require(_0x77b2('0x0'));var util=require('util');var moment=require(_0x77b2('0x1'));var BPromise=require(_0x77b2('0x2'));var rs=require(_0x77b2('0x3'));var fs=require('fs');var Redis=require(_0x77b2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x77b2('0x5'));var logger=require(_0x77b2('0x6'))('rpc');var config=require(_0x77b2('0x7'));var jayson=require(_0x77b2('0x8'));var client=jayson[_0x77b2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22bdcf,_0x2a97d8,_0x2f01a2){return new BPromise(function(_0x1308f7,_0x5139eb){return client[_0x77b2('0xa')](_0x22bdcf,_0x2f01a2)[_0x77b2('0xb')](function(_0x734122){logger[_0x77b2('0xc')](_0x77b2('0xd'),_0x2a97d8,_0x77b2('0xe'));logger[_0x77b2('0xf')](_0x77b2('0x10'),_0x2a97d8,'request\x20sent',JSON[_0x77b2('0x11')](_0x734122));if(_0x734122[_0x77b2('0x12')]){if(_0x734122['error'][_0x77b2('0x13')]===0x1f4){logger['error'](_0x77b2('0xd'),_0x2a97d8,_0x734122[_0x77b2('0x12')]['message']);return _0x5139eb(_0x734122[_0x77b2('0x12')]['message']);}logger[_0x77b2('0x12')](_0x77b2('0xd'),_0x2a97d8,_0x734122[_0x77b2('0x12')][_0x77b2('0x14')]);return _0x1308f7(_0x734122[_0x77b2('0x12')][_0x77b2('0x14')]);}else{logger[_0x77b2('0xc')](_0x77b2('0xd'),_0x2a97d8,_0x77b2('0xe'));_0x1308f7(_0x734122['result']['message']);}})[_0x77b2('0x15')](function(_0x2a85a3){logger[_0x77b2('0x12')](_0x77b2('0xd'),_0x2a97d8,_0x2a85a3);_0x5139eb(_0x2a85a3);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 3b659f4..3b30d59 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 _0x79c6=['/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index'];(function(_0x3fb25f,_0x4b35a3){var _0x5ea642=function(_0x3ee03e){while(--_0x3ee03e){_0x3fb25f['push'](_0x3fb25f['shift']());}};_0x5ea642(++_0x4b35a3);}(_0x79c6,0x158));var _0x679c=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x79c6[_0x1da527];return _0x40fc7c;};'use strict';var multer=require(_0x679c('0x0'));var util=require(_0x679c('0x1'));var path=require(_0x679c('0x2'));var timeout=require('connect-timeout');var express=require(_0x679c('0x3'));var router=express[_0x679c('0x4')]();var fs_extra=require(_0x679c('0x5'));var auth=require(_0x679c('0x6'));var interaction=require(_0x679c('0x7'));var config=require(_0x679c('0x8'));var controller=require(_0x679c('0x9'));router[_0x679c('0xa')]('/',auth[_0x679c('0xb')](),controller[_0x679c('0xc')]);router[_0x679c('0xa')](_0x679c('0xd'),auth[_0x679c('0xb')](),controller[_0x679c('0xe')]);router[_0x679c('0xf')]('/',auth[_0x679c('0xb')](),controller[_0x679c('0x10')]);router['put'](_0x679c('0xd'),auth['isAuthenticated'](),controller[_0x679c('0x11')]);router[_0x679c('0x12')](_0x679c('0xd'),auth[_0x679c('0xb')](),controller[_0x679c('0x13')]);module[_0x679c('0x14')]=router; \ No newline at end of file +var _0x4252=['../../config/environment','./pause.controller','get','index','/:id','isAuthenticated','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4252,0x89));var _0x2425=function(_0x2adbe6,_0x50e5f2){_0x2adbe6=_0x2adbe6-0x0;var _0x25e22a=_0x4252[_0x2adbe6];return _0x25e22a;};'use strict';var multer=require(_0x2425('0x0'));var util=require(_0x2425('0x1'));var path=require(_0x2425('0x2'));var timeout=require(_0x2425('0x3'));var express=require(_0x2425('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2425('0x5'));var interaction=require(_0x2425('0x6'));var config=require(_0x2425('0x7'));var controller=require(_0x2425('0x8'));router[_0x2425('0x9')]('/',auth['isAuthenticated'](),controller[_0x2425('0xa')]);router[_0x2425('0x9')](_0x2425('0xb'),auth[_0x2425('0xc')](),controller['show']);router['post']('/',auth[_0x2425('0xc')](),controller[_0x2425('0xd')]);router[_0x2425('0xe')]('/:id',auth[_0x2425('0xc')](),controller['update']);router[_0x2425('0xf')](_0x2425('0xb'),auth[_0x2425('0xc')](),controller[_0x2425('0x10')]);module[_0x2425('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index fb1a7cd..f5b50c4 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 _0x2aff=['name','sequelize'];(function(_0x23fb07,_0xff70bc){var _0x950061=function(_0x917cb9){while(--_0x917cb9){_0x23fb07['push'](_0x23fb07['shift']());}};_0x950061(++_0xff70bc);}(_0x2aff,0x1ad));var _0xf2af=function(_0x456a88,_0x73be2f){_0x456a88=_0x456a88-0x0;var _0x28b76b=_0x2aff[_0x456a88];return _0x28b76b;};'use strict';var Sequelize=require(_0xf2af('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf2af('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8640=['STRING','exports'];(function(_0x217685,_0x469d3a){var _0x6729f5=function(_0x2ef9d5){while(--_0x2ef9d5){_0x217685['push'](_0x217685['shift']());}};_0x6729f5(++_0x469d3a);}(_0x8640,0x173));var _0x0864=function(_0x4b70a1,_0xd46827){_0x4b70a1=_0x4b70a1-0x0;var _0x2583b9=_0x8640[_0x4b70a1];return _0x2583b9;};'use strict';var Sequelize=require('sequelize');module[_0x0864('0x0')]={'name':{'type':Sequelize[_0x0864('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x0864('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 6a63c5b..22dfd04 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 _0x84e9=['index','map','Pause','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','options','includeAll','include','params','rawAttributes','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','Pauses','name'];(function(_0x641afe,_0x22d726){var _0x2dfe9a=function(_0x33a370){while(--_0x33a370){_0x641afe['push'](_0x641afe['shift']());}};_0x2dfe9a(++_0x22d726);}(_0x84e9,0x108));var _0x984e=function(_0x5ebaff,_0x27caaa){_0x5ebaff=_0x5ebaff-0x0;var _0x4b2871=_0x84e9[_0x5ebaff];return _0x4b2871;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x984e('0x0'));var jsonpatch=require(_0x984e('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x984e('0x2'));var Mustache=require(_0x984e('0x3'));var util=require('util');var path=require(_0x984e('0x4'));var sox=require(_0x984e('0x5'));var csv=require(_0x984e('0x6'));var ejs=require(_0x984e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x984e('0x8'));var crypto=require(_0x984e('0x9'));var jsforce=require(_0x984e('0xa'));var deskjs=require(_0x984e('0xb'));var toCsv=require(_0x984e('0x6'));var querystring=require(_0x984e('0xc'));var Papa=require('papaparse');var Redis=require(_0x984e('0xd'));var authService=require(_0x984e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x984e('0xf'));var hardwareService=require(_0x984e('0x10'));var logger=require(_0x984e('0x11'))(_0x984e('0x12'));var utils=require(_0x984e('0x13'));var config=require(_0x984e('0x14'));var licenseUtil=require(_0x984e('0x15'));var db=require(_0x984e('0x16'))['db'];function respondWithStatusCode(_0x7e92c8,_0xc8ebd1){_0xc8ebd1=_0xc8ebd1||0xcc;return function(_0x2d54c){if(_0x2d54c){return _0x7e92c8[_0x984e('0x17')](_0xc8ebd1);}return _0x7e92c8[_0x984e('0x18')](_0xc8ebd1)[_0x984e('0x19')]();};}function respondWithResult(_0x36fad2,_0x4835a7){_0x4835a7=_0x4835a7||0xc8;return function(_0x55537f){if(_0x55537f){return _0x36fad2[_0x984e('0x18')](_0x4835a7)[_0x984e('0x1a')](_0x55537f);}};}function respondWithFilteredResult(_0x307544,_0x2b6237){return function(_0x27efe3){if(_0x27efe3){var _0x4124a1=typeof _0x2b6237['offset']==='undefined'&&typeof _0x2b6237[_0x984e('0x1b')]==='undefined';var _0x4915f0=_0x27efe3[_0x984e('0x1c')];var _0x37a768=_0x4124a1?0x0:_0x2b6237[_0x984e('0x1d')];var _0x318c39=_0x4124a1?_0x27efe3[_0x984e('0x1c')]:_0x2b6237[_0x984e('0x1d')]+_0x2b6237['limit'];var _0x5cb608;if(_0x318c39>=_0x4915f0){_0x318c39=_0x4915f0;_0x5cb608=0xc8;}else{_0x5cb608=0xce;}_0x307544[_0x984e('0x18')](_0x5cb608);return _0x307544[_0x984e('0x1e')](_0x984e('0x1f'),_0x37a768+'-'+_0x318c39+'/'+_0x4915f0)['json'](_0x27efe3);}return null;};}function patchUpdates(_0x41e7c6){return function(_0x44d01b){try{jsonpatch[_0x984e('0x20')](_0x44d01b,_0x41e7c6,!![]);}catch(_0x3e5519){return BPromise[_0x984e('0x21')](_0x3e5519);}return _0x44d01b[_0x984e('0x22')]();};}function saveUpdates(_0x43e921,_0x1475aa){return function(_0x2d6f38){if(_0x2d6f38){return _0x2d6f38['update'](_0x43e921)[_0x984e('0x23')](function(_0x13179a){return _0x13179a;});}return null;};}function removeEntity(_0x54b935,_0x2aeab5){return function(_0x4dac1c){if(_0x4dac1c){return _0x4dac1c[_0x984e('0x24')]()[_0x984e('0x23')](function(){var _0x17dfa5=_0x4dac1c[_0x984e('0x25')]({'plain':!![]});var _0x5e2ece=_0x984e('0x26');return db['UserProfileResource'][_0x984e('0x24')]({'where':{'type':_0x5e2ece,'resourceId':_0x17dfa5['id']}})[_0x984e('0x23')](function(){return _0x4dac1c;});})[_0x984e('0x23')](function(){_0x54b935[_0x984e('0x18')](0xcc)[_0x984e('0x19')]();});}};}function handleEntityNotFound(_0x13d9fa,_0x266453){return function(_0xddb545){if(!_0xddb545){_0x13d9fa['sendStatus'](0x194);}return _0xddb545;};}function handleError(_0x238a3f,_0x17a272){_0x17a272=_0x17a272||0x1f4;return function(_0x5e5bc8){logger['error'](_0x5e5bc8['stack']);if(_0x5e5bc8['name']){delete _0x5e5bc8[_0x984e('0x27')];}_0x238a3f[_0x984e('0x18')](_0x17a272)['send'](_0x5e5bc8);};}exports[_0x984e('0x28')]=function(_0x194345,_0x59acf9){var _0x3e17b0={},_0x3b07ac={},_0x262bd2={'count':0x0,'rows':[]};var _0x42541c=_[_0x984e('0x29')](db[_0x984e('0x2a')]['rawAttributes'],function(_0x381456){return{'name':_0x381456[_0x984e('0x2b')],'type':_0x381456[_0x984e('0x2c')][_0x984e('0x2d')]};});_0x3b07ac[_0x984e('0x2e')]=_[_0x984e('0x29')](_0x42541c,_0x984e('0x27'));_0x3b07ac[_0x984e('0x2f')]=_[_0x984e('0x30')](_0x194345[_0x984e('0x2f')]);_0x3b07ac['filters']=_[_0x984e('0x31')](_0x3b07ac[_0x984e('0x2e')],_0x3b07ac[_0x984e('0x2f')]);_0x3e17b0[_0x984e('0x32')]=_[_0x984e('0x31')](_0x3b07ac[_0x984e('0x2e')],qs[_0x984e('0x33')](_0x194345[_0x984e('0x2f')][_0x984e('0x33')]));_0x3e17b0['attributes']=_0x3e17b0[_0x984e('0x32')][_0x984e('0x34')]?_0x3e17b0[_0x984e('0x32')]:_0x3b07ac[_0x984e('0x2e')];if(!_0x194345[_0x984e('0x2f')][_0x984e('0x35')]('nolimit')){_0x3e17b0[_0x984e('0x1b')]=qs[_0x984e('0x1b')](_0x194345[_0x984e('0x2f')][_0x984e('0x1b')]);_0x3e17b0[_0x984e('0x1d')]=qs[_0x984e('0x1d')](_0x194345[_0x984e('0x2f')][_0x984e('0x1d')]);}_0x3e17b0[_0x984e('0x36')]=qs[_0x984e('0x37')](_0x194345['query'][_0x984e('0x37')]);_0x3e17b0['where']=qs[_0x984e('0x38')](_[_0x984e('0x39')](_0x194345[_0x984e('0x2f')],_0x3b07ac['filters']),_0x42541c);if(_0x194345['query'][_0x984e('0x3a')]){_0x3e17b0[_0x984e('0x3b')]=_['merge'](_0x3e17b0[_0x984e('0x3b')],{'$or':_[_0x984e('0x29')](_0x42541c,function(_0x1a2f33){if(_0x1a2f33['type']!=='VIRTUAL'){var _0x43ddb6={};_0x43ddb6[_0x1a2f33[_0x984e('0x27')]]={'$like':'%'+_0x194345[_0x984e('0x2f')][_0x984e('0x3a')]+'%'};return _0x43ddb6;}})});}_0x3e17b0=_[_0x984e('0x3c')]({},_0x3e17b0,_0x194345[_0x984e('0x3d')]);var _0x5a0989={'where':_0x3e17b0[_0x984e('0x3b')]};return db[_0x984e('0x2a')]['count'](_0x5a0989)[_0x984e('0x23')](function(_0x1a69a4){_0x262bd2['count']=_0x1a69a4;if(_0x194345[_0x984e('0x2f')][_0x984e('0x3e')]){_0x3e17b0[_0x984e('0x3f')]=[{'all':!![]}];}return db[_0x984e('0x2a')]['findAll'](_0x3e17b0);})[_0x984e('0x23')](function(_0x32618d){_0x262bd2['rows']=_0x32618d;return _0x262bd2;})['then'](respondWithFilteredResult(_0x59acf9,_0x3e17b0))['catch'](handleError(_0x59acf9,null));};exports['show']=function(_0x4a9753,_0x527369){var _0x16ce3b={'raw':!![],'where':{'id':_0x4a9753[_0x984e('0x40')]['id']}},_0x1dcdb3={};_0x1dcdb3[_0x984e('0x2e')]=_[_0x984e('0x30')](db[_0x984e('0x2a')][_0x984e('0x41')]);_0x1dcdb3['query']=_[_0x984e('0x30')](_0x4a9753['query']);_0x1dcdb3[_0x984e('0x38')]=_[_0x984e('0x31')](_0x1dcdb3[_0x984e('0x2e')],_0x1dcdb3[_0x984e('0x2f')]);_0x16ce3b['attributes']=_[_0x984e('0x31')](_0x1dcdb3[_0x984e('0x2e')],qs[_0x984e('0x33')](_0x4a9753[_0x984e('0x2f')][_0x984e('0x33')]));_0x16ce3b[_0x984e('0x32')]=_0x16ce3b[_0x984e('0x32')][_0x984e('0x34')]?_0x16ce3b['attributes']:_0x1dcdb3[_0x984e('0x2e')];if(_0x4a9753[_0x984e('0x2f')][_0x984e('0x3e')]){_0x16ce3b[_0x984e('0x3f')]=[{'all':!![]}];}_0x16ce3b=_[_0x984e('0x3c')]({},_0x16ce3b,_0x4a9753[_0x984e('0x3d')]);return db[_0x984e('0x2a')][_0x984e('0x42')](_0x16ce3b)[_0x984e('0x23')](handleEntityNotFound(_0x527369,null))['then'](respondWithResult(_0x527369,null))[_0x984e('0x43')](handleError(_0x527369,null));};exports[_0x984e('0x44')]=function(_0x1b0a13,_0x278ad5){return db[_0x984e('0x2a')][_0x984e('0x44')](_0x1b0a13[_0x984e('0x45')],{})[_0x984e('0x23')](function(_0x2c2786){var _0x39ac2e=_0x1b0a13['user'][_0x984e('0x25')]({'plain':!![]});if(!_0x39ac2e)throw new Error(_0x984e('0x46'));if(_0x39ac2e['role']==='user'){var _0x5e9943=_0x2c2786[_0x984e('0x25')]({'plain':!![]});var _0x3d83e7=_0x984e('0x26');return db[_0x984e('0x47')][_0x984e('0x42')]({'where':{'name':_0x3d83e7,'userProfileId':_0x39ac2e[_0x984e('0x48')]},'raw':!![]})[_0x984e('0x23')](function(_0x582766){if(_0x582766&&_0x582766['autoAssociation']===0x0){return db[_0x984e('0x49')][_0x984e('0x44')]({'name':_0x5e9943[_0x984e('0x27')],'resourceId':_0x5e9943['id'],'type':_0x582766[_0x984e('0x27')],'sectionId':_0x582766['id']},{})[_0x984e('0x23')](function(){return _0x2c2786;});}else{return _0x2c2786;}})[_0x984e('0x43')](function(_0x4f1a1e){logger['error'](_0x984e('0x4a'),_0x4f1a1e);throw _0x4f1a1e;});}return _0x2c2786;})[_0x984e('0x23')](respondWithResult(_0x278ad5,0xc9))['catch'](handleError(_0x278ad5,null));};exports[_0x984e('0x4b')]=function(_0x2c6e9e,_0x37147a){if(_0x2c6e9e[_0x984e('0x45')]['id']){delete _0x2c6e9e[_0x984e('0x45')]['id'];}return db['Pause'][_0x984e('0x42')]({'where':{'id':_0x2c6e9e[_0x984e('0x40')]['id']}})[_0x984e('0x23')](handleEntityNotFound(_0x37147a,null))[_0x984e('0x23')](saveUpdates(_0x2c6e9e[_0x984e('0x45')],null))['then'](respondWithResult(_0x37147a,null))[_0x984e('0x43')](handleError(_0x37147a,null));};exports['destroy']=function(_0x5119b9,_0x4d18ea){return db[_0x984e('0x2a')][_0x984e('0x42')]({'where':{'id':_0x5119b9[_0x984e('0x40')]['id']}})[_0x984e('0x23')](handleEntityNotFound(_0x4d18ea,null))[_0x984e('0x23')](removeEntity(_0x4d18ea,null))[_0x984e('0x43')](handleError(_0x4d18ea,null));}; \ No newline at end of file +var _0xc69b=['sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','Pause','findAll','rows','show','params','catch','create','user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Pauses','UserProfileResource','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x705d4d,_0x18ca88){var _0x46b820=function(_0x446d45){while(--_0x446d45){_0x705d4d['push'](_0x705d4d['shift']());}};_0x46b820(++_0x18ca88);}(_0xc69b,0xc5));var _0xbc69=function(_0x4b4d43,_0x1590f7){_0x4b4d43=_0x4b4d43-0x0;var _0x5706ba=_0xc69b[_0x4b4d43];return _0x5706ba;};'use strict';var emlformat=require(_0xbc69('0x0'));var rimraf=require(_0xbc69('0x1'));var zipdir=require(_0xbc69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc69('0x3'));var moment=require(_0xbc69('0x4'));var BPromise=require(_0xbc69('0x5'));var Mustache=require(_0xbc69('0x6'));var util=require(_0xbc69('0x7'));var path=require(_0xbc69('0x8'));var sox=require('sox');var csv=require(_0xbc69('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc69('0xa'));var _=require(_0xbc69('0xb'));var squel=require(_0xbc69('0xc'));var crypto=require(_0xbc69('0xd'));var jsforce=require(_0xbc69('0xe'));var deskjs=require(_0xbc69('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbc69('0x10'));var Redis=require(_0xbc69('0x11'));var authService=require(_0xbc69('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbc69('0x13'));var hardwareService=require(_0xbc69('0x14'));var logger=require(_0xbc69('0x15'))(_0xbc69('0x16'));var utils=require(_0xbc69('0x17'));var config=require(_0xbc69('0x18'));var licenseUtil=require(_0xbc69('0x19'));var db=require(_0xbc69('0x1a'))['db'];function respondWithStatusCode(_0x338a19,_0x4e78ec){_0x4e78ec=_0x4e78ec||0xcc;return function(_0x5c6f8f){if(_0x5c6f8f){return _0x338a19[_0xbc69('0x1b')](_0x4e78ec);}return _0x338a19[_0xbc69('0x1c')](_0x4e78ec)[_0xbc69('0x1d')]();};}function respondWithResult(_0x514528,_0x2a18f6){_0x2a18f6=_0x2a18f6||0xc8;return function(_0x3685b8){if(_0x3685b8){return _0x514528[_0xbc69('0x1c')](_0x2a18f6)[_0xbc69('0x1e')](_0x3685b8);}};}function respondWithFilteredResult(_0x45a115,_0xe421bb){return function(_0x377b6a){if(_0x377b6a){var _0x301d73=typeof _0xe421bb[_0xbc69('0x1f')]===_0xbc69('0x20')&&typeof _0xe421bb[_0xbc69('0x21')]==='undefined';var _0x319e1d=_0x377b6a[_0xbc69('0x22')];var _0x4de3c7=_0x301d73?0x0:_0xe421bb['offset'];var _0x302f27=_0x301d73?_0x377b6a[_0xbc69('0x22')]:_0xe421bb[_0xbc69('0x1f')]+_0xe421bb[_0xbc69('0x21')];var _0x2481a7;if(_0x302f27>=_0x319e1d){_0x302f27=_0x319e1d;_0x2481a7=0xc8;}else{_0x2481a7=0xce;}_0x45a115[_0xbc69('0x1c')](_0x2481a7);return _0x45a115[_0xbc69('0x23')](_0xbc69('0x24'),_0x4de3c7+'-'+_0x302f27+'/'+_0x319e1d)[_0xbc69('0x1e')](_0x377b6a);}return null;};}function patchUpdates(_0x5dcb00){return function(_0x13e5a6){try{jsonpatch[_0xbc69('0x25')](_0x13e5a6,_0x5dcb00,!![]);}catch(_0x2711e2){return BPromise['reject'](_0x2711e2);}return _0x13e5a6[_0xbc69('0x26')]();};}function saveUpdates(_0x4e7efa,_0x1efa2f){return function(_0x26e934){if(_0x26e934){return _0x26e934[_0xbc69('0x27')](_0x4e7efa)[_0xbc69('0x28')](function(_0x4111d4){return _0x4111d4;});}return null;};}function removeEntity(_0x3e8b60,_0x1f27da){return function(_0x73aac0){if(_0x73aac0){return _0x73aac0[_0xbc69('0x29')]()[_0xbc69('0x28')](function(){var _0x4a3d07=_0x73aac0[_0xbc69('0x2a')]({'plain':!![]});var _0x302742=_0xbc69('0x2b');return db[_0xbc69('0x2c')][_0xbc69('0x29')]({'where':{'type':_0x302742,'resourceId':_0x4a3d07['id']}})[_0xbc69('0x28')](function(){return _0x73aac0;});})[_0xbc69('0x28')](function(){_0x3e8b60['status'](0xcc)[_0xbc69('0x1d')]();});}};}function handleEntityNotFound(_0x3ac656,_0x275913){return function(_0x598740){if(!_0x598740){_0x3ac656[_0xbc69('0x1b')](0x194);}return _0x598740;};}function handleError(_0x2bf11b,_0x37ec67){_0x37ec67=_0x37ec67||0x1f4;return function(_0x59263f){logger[_0xbc69('0x2d')](_0x59263f['stack']);if(_0x59263f[_0xbc69('0x2e')]){delete _0x59263f[_0xbc69('0x2e')];}_0x2bf11b[_0xbc69('0x1c')](_0x37ec67)['send'](_0x59263f);};}exports[_0xbc69('0x2f')]=function(_0x3d39ee,_0x41af3d){var _0x2ffcc7={},_0x376525={},_0x292e11={'count':0x0,'rows':[]};var _0x51c2cb=_[_0xbc69('0x30')](db['Pause'][_0xbc69('0x31')],function(_0x26df51){return{'name':_0x26df51[_0xbc69('0x32')],'type':_0x26df51[_0xbc69('0x33')][_0xbc69('0x34')]};});_0x376525[_0xbc69('0x35')]=_[_0xbc69('0x30')](_0x51c2cb,_0xbc69('0x2e'));_0x376525[_0xbc69('0x36')]=_[_0xbc69('0x37')](_0x3d39ee[_0xbc69('0x36')]);_0x376525[_0xbc69('0x38')]=_[_0xbc69('0x39')](_0x376525[_0xbc69('0x35')],_0x376525['query']);_0x2ffcc7[_0xbc69('0x3a')]=_[_0xbc69('0x39')](_0x376525[_0xbc69('0x35')],qs[_0xbc69('0x3b')](_0x3d39ee[_0xbc69('0x36')][_0xbc69('0x3b')]));_0x2ffcc7[_0xbc69('0x3a')]=_0x2ffcc7[_0xbc69('0x3a')][_0xbc69('0x3c')]?_0x2ffcc7['attributes']:_0x376525[_0xbc69('0x35')];if(!_0x3d39ee[_0xbc69('0x36')][_0xbc69('0x3d')](_0xbc69('0x3e'))){_0x2ffcc7[_0xbc69('0x21')]=qs[_0xbc69('0x21')](_0x3d39ee[_0xbc69('0x36')]['limit']);_0x2ffcc7['offset']=qs[_0xbc69('0x1f')](_0x3d39ee['query'][_0xbc69('0x1f')]);}_0x2ffcc7[_0xbc69('0x3f')]=qs[_0xbc69('0x40')](_0x3d39ee[_0xbc69('0x36')][_0xbc69('0x40')]);_0x2ffcc7[_0xbc69('0x41')]=qs['filters'](_[_0xbc69('0x42')](_0x3d39ee['query'],_0x376525[_0xbc69('0x38')]),_0x51c2cb);if(_0x3d39ee['query']['filter']){_0x2ffcc7[_0xbc69('0x41')]=_[_0xbc69('0x43')](_0x2ffcc7[_0xbc69('0x41')],{'$or':_[_0xbc69('0x30')](_0x51c2cb,function(_0x1fde35){if(_0x1fde35[_0xbc69('0x33')]!==_0xbc69('0x44')){var _0x10680c={};_0x10680c[_0x1fde35[_0xbc69('0x2e')]]={'$like':'%'+_0x3d39ee[_0xbc69('0x36')][_0xbc69('0x45')]+'%'};return _0x10680c;}})});}_0x2ffcc7=_['merge']({},_0x2ffcc7,_0x3d39ee[_0xbc69('0x46')]);var _0x557299={'where':_0x2ffcc7[_0xbc69('0x41')]};return db['Pause'][_0xbc69('0x22')](_0x557299)[_0xbc69('0x28')](function(_0x2743b1){_0x292e11[_0xbc69('0x22')]=_0x2743b1;if(_0x3d39ee[_0xbc69('0x36')][_0xbc69('0x47')]){_0x2ffcc7[_0xbc69('0x48')]=[{'all':!![]}];}return db[_0xbc69('0x49')][_0xbc69('0x4a')](_0x2ffcc7);})[_0xbc69('0x28')](function(_0x2f6136){_0x292e11[_0xbc69('0x4b')]=_0x2f6136;return _0x292e11;})['then'](respondWithFilteredResult(_0x41af3d,_0x2ffcc7))['catch'](handleError(_0x41af3d,null));};exports[_0xbc69('0x4c')]=function(_0x173961,_0xb792a4){var _0x38c811={'raw':!![],'where':{'id':_0x173961[_0xbc69('0x4d')]['id']}},_0x44d52d={};_0x44d52d[_0xbc69('0x35')]=_['keys'](db[_0xbc69('0x49')]['rawAttributes']);_0x44d52d[_0xbc69('0x36')]=_['keys'](_0x173961[_0xbc69('0x36')]);_0x44d52d['filters']=_[_0xbc69('0x39')](_0x44d52d[_0xbc69('0x35')],_0x44d52d[_0xbc69('0x36')]);_0x38c811[_0xbc69('0x3a')]=_['intersection'](_0x44d52d[_0xbc69('0x35')],qs[_0xbc69('0x3b')](_0x173961['query'][_0xbc69('0x3b')]));_0x38c811[_0xbc69('0x3a')]=_0x38c811[_0xbc69('0x3a')][_0xbc69('0x3c')]?_0x38c811[_0xbc69('0x3a')]:_0x44d52d[_0xbc69('0x35')];if(_0x173961[_0xbc69('0x36')][_0xbc69('0x47')]){_0x38c811[_0xbc69('0x48')]=[{'all':!![]}];}_0x38c811=_[_0xbc69('0x43')]({},_0x38c811,_0x173961['options']);return db[_0xbc69('0x49')]['find'](_0x38c811)[_0xbc69('0x28')](handleEntityNotFound(_0xb792a4,null))[_0xbc69('0x28')](respondWithResult(_0xb792a4,null))[_0xbc69('0x4e')](handleError(_0xb792a4,null));};exports[_0xbc69('0x4f')]=function(_0x24112e,_0x31217c){return db[_0xbc69('0x49')]['create'](_0x24112e['body'],{})[_0xbc69('0x28')](function(_0x21f7ab){var _0xbc6b95=_0x24112e[_0xbc69('0x50')][_0xbc69('0x2a')]({'plain':!![]});if(!_0xbc6b95)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbc6b95[_0xbc69('0x51')]===_0xbc69('0x50')){var _0x20be14=_0x21f7ab['get']({'plain':!![]});var _0x5d081d=_0xbc69('0x2b');return db[_0xbc69('0x52')][_0xbc69('0x53')]({'where':{'name':_0x5d081d,'userProfileId':_0xbc6b95[_0xbc69('0x54')]},'raw':!![]})[_0xbc69('0x28')](function(_0x4a60cc){if(_0x4a60cc&&_0x4a60cc['autoAssociation']===0x0){return db[_0xbc69('0x2c')][_0xbc69('0x4f')]({'name':_0x20be14['name'],'resourceId':_0x20be14['id'],'type':_0x4a60cc['name'],'sectionId':_0x4a60cc['id']},{})['then'](function(){return _0x21f7ab;});}else{return _0x21f7ab;}})[_0xbc69('0x4e')](function(_0x38d4b2){logger[_0xbc69('0x2d')](_0xbc69('0x55'),_0x38d4b2);throw _0x38d4b2;});}return _0x21f7ab;})[_0xbc69('0x28')](respondWithResult(_0x31217c,0xc9))[_0xbc69('0x4e')](handleError(_0x31217c,null));};exports[_0xbc69('0x27')]=function(_0x55cb46,_0x210e9f){if(_0x55cb46[_0xbc69('0x56')]['id']){delete _0x55cb46[_0xbc69('0x56')]['id'];}return db['Pause'][_0xbc69('0x53')]({'where':{'id':_0x55cb46[_0xbc69('0x4d')]['id']}})['then'](handleEntityNotFound(_0x210e9f,null))[_0xbc69('0x28')](saveUpdates(_0x55cb46[_0xbc69('0x56')],null))[_0xbc69('0x28')](respondWithResult(_0x210e9f,null))[_0xbc69('0x4e')](handleError(_0x210e9f,null));};exports[_0xbc69('0x29')]=function(_0x526843,_0x56ca6e){return db['Pause'][_0xbc69('0x53')]({'where':{'id':_0x526843[_0xbc69('0x4d')]['id']}})[_0xbc69('0x28')](handleEntityNotFound(_0x56ca6e,null))[_0xbc69('0x28')](removeEntity(_0x56ca6e,null))[_0xbc69('0x4e')](handleError(_0x56ca6e,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 02ab937..9d714eb 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 _0x814b=['define','Pause','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports'];(function(_0xe4cf0a,_0x298c16){var _0xa09b61=function(_0x2946e3){while(--_0x2946e3){_0xe4cf0a['push'](_0xe4cf0a['shift']());}};_0xa09b61(++_0x298c16);}(_0x814b,0x1a2));var _0xb814=function(_0x5016c9,_0x57cdf0){_0x5016c9=_0x5016c9-0x0;var _0x5371ee=_0x814b[_0x5016c9];return _0x5371ee;};'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':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xc4aa[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index bcba72c..aac932a 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 _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(_0x44bf35,_0x551681){var _0x2e7733=function(_0x448c84){while(--_0x448c84){_0x44bf35['push'](_0x44bf35['shift']());}};_0x2e7733(++_0x551681);}(_0xb10b,0x12a));var _0xbb10=function(_0x5c70d0,_0xfeac42){_0x5c70d0=_0x5c70d0-0x0;var _0x484491=_0xb10b[_0x5c70d0];return _0x484491;};'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 +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(_0x593c77,_0x3d2402){var _0x3a251f=function(_0x3ebbcf){while(--_0x3ebbcf){_0x593c77['push'](_0x593c77['shift']());}};_0x3a251f(++_0x3d2402);}(_0x7a54,0x106));var _0x47a5=function(_0x3a628e,_0x55e6a2){_0x3a628e=_0x3a628e-0x0;var _0x50cd40=_0x7a54[_0x3a628e];return _0x50cd40;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 90cf2c5..efc1f94 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 _0x668b=['fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','get','/webhook','webhookGet','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','webhookPost','put','update','/:id','delete','exports','multer','util','connect-timeout','express'];(function(_0xd14b9a,_0x5d0192){var _0x4fd672=function(_0x1e6afe){while(--_0x1e6afe){_0xd14b9a['push'](_0xd14b9a['shift']());}};_0x4fd672(++_0x5d0192);}(_0x668b,0x140));var _0xb668=function(_0xccf869,_0x2556a5){_0xccf869=_0xccf869-0x0;var _0x21a9db=_0x668b[_0xccf869];return _0x21a9db;};'use strict';var multer=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var path=require('path');var timeout=require(_0xb668('0x2'));var express=require(_0xb668('0x3'));var router=express['Router']();var fs_extra=require(_0xb668('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var controller=require(_0xb668('0x7'));router['get']('/',auth[_0xb668('0x8')](),controller[_0xb668('0x9')]);router[_0xb668('0xa')](_0xb668('0xb'),controller[_0xb668('0xc')]);router[_0xb668('0xa')]('/:id',auth[_0xb668('0x8')](),controller[_0xb668('0xd')]);router[_0xb668('0xa')](_0xb668('0xe'),auth[_0xb668('0x8')](),controller[_0xb668('0xf')]);var upload=multer({'storage':multer[_0xb668('0x10')]({'destination':function(_0x3616e9,_0x567ea9,_0x3b15a6){_0x3b15a6(null,path[_0xb668('0x11')](config[_0xb668('0x12')],_0xb668('0x13')));},'filename':function(_0x16ca75,_0x167057,_0x1d111a){_0x167057[_0xb668('0x14')]=_0x167057[_0xb668('0x14')][_0xb668('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1d111a(null,util[_0xb668('0x16')](_0xb668('0x17'),path[_0xb668('0x18')](_0x167057[_0xb668('0x14')],path[_0xb668('0x19')](_0x167057[_0xb668('0x14')])),Date[_0xb668('0x1a')](),path[_0xb668('0x19')](_0x167057[_0xb668('0x14')])));}})});router[_0xb668('0x1b')]('/',upload[_0xb668('0x1c')](_0xb668('0x1d')),controller['upload']);router[_0xb668('0x1b')]('/webhook',controller[_0xb668('0x1e')]);router[_0xb668('0x1f')]('/:id',auth[_0xb668('0x8')](),controller[_0xb668('0x20')]);router['delete'](_0xb668('0x21'),auth['isAuthenticated'](),controller[_0xb668('0x22')]);module[_0xb668('0x23')]=router; \ No newline at end of file +var _0xd13e=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./plugin.controller','get','/webhook','webhookGet','/:id','isAuthenticated','show','/:id/download','download','diskStorage','root','server/files/plugins','originalname','replace','%s-%s%s','extname','post','single','file','upload','webhookPost','put','update','delete'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xd13e,0x193));var _0xed13=function(_0xc8fedd,_0xa27384){_0xc8fedd=_0xc8fedd-0x0;var _0x36f617=_0xd13e[_0xc8fedd];return _0x36f617;};'use strict';var multer=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var path=require(_0xed13('0x2'));var timeout=require(_0xed13('0x3'));var express=require('express');var router=express[_0xed13('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed13('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed13('0x6'));var controller=require(_0xed13('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xed13('0x8')](_0xed13('0x9'),controller[_0xed13('0xa')]);router[_0xed13('0x8')](_0xed13('0xb'),auth[_0xed13('0xc')](),controller[_0xed13('0xd')]);router[_0xed13('0x8')](_0xed13('0xe'),auth['isAuthenticated'](),controller[_0xed13('0xf')]);var upload=multer({'storage':multer[_0xed13('0x10')]({'destination':function(_0x11adaf,_0x39575c,_0x2b290c){_0x2b290c(null,path['join'](config[_0xed13('0x11')],_0xed13('0x12')));},'filename':function(_0x2c68db,_0x3c0b22,_0x936103){_0x3c0b22[_0xed13('0x13')]=_0x3c0b22['originalname'][_0xed13('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x936103(null,util['format'](_0xed13('0x15'),path['basename'](_0x3c0b22[_0xed13('0x13')],path['extname'](_0x3c0b22[_0xed13('0x13')])),Date['now'](),path[_0xed13('0x16')](_0x3c0b22[_0xed13('0x13')])));}})});router[_0xed13('0x17')]('/',upload[_0xed13('0x18')](_0xed13('0x19')),controller[_0xed13('0x1a')]);router[_0xed13('0x17')](_0xed13('0x9'),controller[_0xed13('0x1b')]);router[_0xed13('0x1c')](_0xed13('0xb'),auth[_0xed13('0xc')](),controller[_0xed13('0x1d')]);router[_0xed13('0x1e')](_0xed13('0xb'),auth[_0xed13('0xc')](),controller['delete']);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 4b6d650..92eb47d 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 _0xb3f3=['exports','STRING','ENUM','html','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize'];(function(_0xb38a96,_0xfeb8f0){var _0x1a362a=function(_0x57d24a){while(--_0x57d24a){_0xb38a96['push'](_0xb38a96['shift']());}};_0x1a362a(++_0xfeb8f0);}(_0xb3f3,0x74));var _0x3b3f=function(_0x52bfa5,_0x42cf21){_0x52bfa5=_0x52bfa5-0x0;var _0x26f80b=_0xb3f3[_0x52bfa5];return _0x26f80b;};'use strict';var Sequelize=require(_0x3b3f('0x0'));module[_0x3b3f('0x1')]={'name':{'type':Sequelize[_0x3b3f('0x2')]},'type':{'type':Sequelize[_0x3b3f('0x3')](_0x3b3f('0x4'),_0x3b3f('0x5'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x3b3f('0x6')]},'path':{'type':Sequelize[_0x3b3f('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x3b3f('0x7')],'defaultValue':0x0,'comment':_0x3b3f('0x8')},'sidebar':{'type':Sequelize[_0x3b3f('0x3')](_0x3b3f('0x9'),_0x3b3f('0xa'),_0x3b3f('0xb'),'never'),'defaultValue':'always','comment':_0x3b3f('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x3b3f('0x2')]},'agentUrl':{'type':Sequelize[_0x3b3f('0x2')]},'scriptName':{'type':Sequelize[_0x3b3f('0x2')]},'scriptPath':{'type':Sequelize[_0x3b3f('0x2')]}}; \ No newline at end of file +var _0x479f=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','BOOLEAN','adminOnly','always'];(function(_0x2c383c,_0x4eeb61){var _0x24055e=function(_0x5aeee4){while(--_0x5aeee4){_0x2c383c['push'](_0x2c383c['shift']());}};_0x24055e(++_0x4eeb61);}(_0x479f,0x1a5));var _0xf479=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x479f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf479('0x0'));module[_0xf479('0x1')]={'name':{'type':Sequelize[_0xf479('0x2')]},'type':{'type':Sequelize[_0xf479('0x3')](_0xf479('0x4'),_0xf479('0x5'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xf479('0x6')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM'](_0xf479('0x7'),'agentOnly',_0xf479('0x8'),'never'),'defaultValue':'always','comment':_0xf479('0x9')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xf479('0x2')]},'agentUrl':{'type':Sequelize[_0xf479('0x2')]},'scriptName':{'type':Sequelize[_0xf479('0x2')]},'scriptPath':{'type':Sequelize[_0xf479('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 3d031af..13e43f5 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 _0xab27=['headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./plugin.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','name','send','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','merge','options','Plugin','includeAll','include','findAll','rows','catch','show','params','find','download','join','root','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','pipe','glob','node_modules/**/*','attachments/**/*','finalize','info','Temporary\x20file\x20removed','upload','file','filename','server/files/plugins','Plugin\x20upload\x20filepath:\x20%s','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','html','parameters','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon-apps','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Zip\x20archive\x20removed','dirname','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s'];(function(_0x2c7dc6,_0x3c4ce0){var _0x10002b=function(_0x26f390){while(--_0x26f390){_0x2c7dc6['push'](_0x2c7dc6['shift']());}};_0x10002b(++_0x3c4ce0);}(_0xab27,0x1f3));var _0x7ab2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xab27[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7ab2('0x0'));var rimraf=require(_0x7ab2('0x1'));var zipdir=require(_0x7ab2('0x2'));var jsonpatch=require(_0x7ab2('0x3'));var rp=require('request-promise');var moment=require(_0x7ab2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7ab2('0x5'));var util=require(_0x7ab2('0x6'));var path=require(_0x7ab2('0x7'));var sox=require(_0x7ab2('0x8'));var csv=require(_0x7ab2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7ab2('0xa'));var _=require('lodash');var squel=require(_0x7ab2('0xb'));var crypto=require(_0x7ab2('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7ab2('0x9'));var querystring=require(_0x7ab2('0xd'));var Papa=require(_0x7ab2('0xe'));var extract=require(_0x7ab2('0xf'));var rimraf=require('rimraf');var archiver=require(_0x7ab2('0x10'));var Redis=require('ioredis');var authService=require(_0x7ab2('0x11'));var qs=require(_0x7ab2('0x12'));var as=require(_0x7ab2('0x13'));var hardwareService=require(_0x7ab2('0x14'));var logger=require(_0x7ab2('0x15'))(_0x7ab2('0x16'));var utils=require(_0x7ab2('0x17'));var config=require(_0x7ab2('0x18'));var licenseUtil=require(_0x7ab2('0x19'));var db=require(_0x7ab2('0x1a'))['db'];config['redis']=_[_0x7ab2('0x1b')](config['redis'],{'host':_0x7ab2('0x1c'),'port':0x18eb});var socket=require(_0x7ab2('0x1d'))(new Redis(config[_0x7ab2('0x1e')]));require(_0x7ab2('0x1f'))[_0x7ab2('0x20')](socket);function respondWithStatusCode(_0x34d550,_0x4e58c6){_0x4e58c6=_0x4e58c6||0xcc;return function(_0x3c8c52){if(_0x3c8c52){return _0x34d550['sendStatus'](_0x4e58c6);}return _0x34d550[_0x7ab2('0x21')](_0x4e58c6)[_0x7ab2('0x22')]();};}function respondWithResult(_0xcf9dc5,_0x34717b){_0x34717b=_0x34717b||0xc8;return function(_0xe24169){if(_0xe24169){return _0xcf9dc5[_0x7ab2('0x21')](_0x34717b)[_0x7ab2('0x23')](_0xe24169);}};}function respondWithFilteredResult(_0x3def5e,_0x59e7ca){return function(_0x57adc1){if(_0x57adc1){var _0x5078e0=typeof _0x59e7ca[_0x7ab2('0x24')]===_0x7ab2('0x25')&&typeof _0x59e7ca[_0x7ab2('0x26')]===_0x7ab2('0x25');var _0x63344a=_0x57adc1[_0x7ab2('0x27')];var _0x1ae7a8=_0x5078e0?0x0:_0x59e7ca[_0x7ab2('0x24')];var _0x5d149c=_0x5078e0?_0x57adc1[_0x7ab2('0x27')]:_0x59e7ca[_0x7ab2('0x24')]+_0x59e7ca[_0x7ab2('0x26')];var _0x1c9e92;if(_0x5d149c>=_0x63344a){_0x5d149c=_0x63344a;_0x1c9e92=0xc8;}else{_0x1c9e92=0xce;}_0x3def5e['status'](_0x1c9e92);return _0x3def5e[_0x7ab2('0x28')](_0x7ab2('0x29'),_0x1ae7a8+'-'+_0x5d149c+'/'+_0x63344a)[_0x7ab2('0x23')](_0x57adc1);}return null;};}function patchUpdates(_0xe5577){return function(_0x11ab34){try{jsonpatch[_0x7ab2('0x2a')](_0x11ab34,_0xe5577,!![]);}catch(_0x1365d4){return BPromise[_0x7ab2('0x2b')](_0x1365d4);}return _0x11ab34[_0x7ab2('0x2c')]();};}function saveUpdates(_0x3bc248,_0x4ee499){return function(_0x3afd9f){if(_0x3afd9f){return _0x3afd9f[_0x7ab2('0x2d')](_0x3bc248)[_0x7ab2('0x2e')](function(_0x9002e2){return _0x9002e2;});}return null;};}function removeEntity(_0x3a925a,_0x5a0ac1){return function(_0x2492c0){if(_0x2492c0){return _0x2492c0[_0x7ab2('0x2f')]()[_0x7ab2('0x2e')](function(){var _0x1d76ee=_0x2492c0[_0x7ab2('0x30')]({'plain':!![]});var _0xabf657='Plugins';return db[_0x7ab2('0x31')][_0x7ab2('0x2f')]({'where':{'type':_0xabf657,'resourceId':_0x1d76ee['id']}})[_0x7ab2('0x2e')](function(){return _0x2492c0;});})['then'](function(){_0x3a925a[_0x7ab2('0x21')](0xcc)[_0x7ab2('0x22')]();});}};}function handleEntityNotFound(_0x2f4bb0,_0x3a8178){return function(_0x13c799){if(!_0x13c799){_0x2f4bb0[_0x7ab2('0x32')](0x194);}return _0x13c799;};}function handleError(_0x5dd184,_0x532f08){_0x532f08=_0x532f08||0x1f4;return function(_0x46cb6b){logger[_0x7ab2('0x33')](_0x46cb6b['stack']);if(_0x46cb6b[_0x7ab2('0x34')]){delete _0x46cb6b['name'];}_0x5dd184[_0x7ab2('0x21')](_0x532f08)[_0x7ab2('0x35')](_0x46cb6b);};}exports[_0x7ab2('0x36')]=function(_0x47ff45,_0x4ed37b){var _0x5be69a={},_0x217826={},_0x51b94c={'count':0x0,'rows':[]};var _0x309fa6=_['map'](db['Plugin'][_0x7ab2('0x37')],function(_0xf32738){return{'name':_0xf32738[_0x7ab2('0x38')],'type':_0xf32738['type'][_0x7ab2('0x39')]};});_0x217826[_0x7ab2('0x3a')]=_['map'](_0x309fa6,_0x7ab2('0x34'));_0x217826[_0x7ab2('0x3b')]=_[_0x7ab2('0x3c')](_0x47ff45[_0x7ab2('0x3b')]);_0x217826[_0x7ab2('0x3d')]=_[_0x7ab2('0x3e')](_0x217826['model'],_0x217826[_0x7ab2('0x3b')]);_0x5be69a['attributes']=_[_0x7ab2('0x3e')](_0x217826['model'],qs[_0x7ab2('0x3f')](_0x47ff45[_0x7ab2('0x3b')][_0x7ab2('0x3f')]));_0x5be69a['attributes']=_0x5be69a[_0x7ab2('0x40')][_0x7ab2('0x41')]?_0x5be69a['attributes']:_0x217826[_0x7ab2('0x3a')];if(!_0x47ff45['query'][_0x7ab2('0x42')](_0x7ab2('0x43'))){_0x5be69a[_0x7ab2('0x26')]=qs[_0x7ab2('0x26')](_0x47ff45['query'][_0x7ab2('0x26')]);_0x5be69a[_0x7ab2('0x24')]=qs['offset'](_0x47ff45[_0x7ab2('0x3b')][_0x7ab2('0x24')]);}_0x5be69a[_0x7ab2('0x44')]=qs[_0x7ab2('0x45')](_0x47ff45['query'][_0x7ab2('0x45')]);_0x5be69a[_0x7ab2('0x46')]=qs[_0x7ab2('0x3d')](_[_0x7ab2('0x47')](_0x47ff45[_0x7ab2('0x3b')],_0x217826['filters']),_0x309fa6);if(_0x47ff45[_0x7ab2('0x3b')][_0x7ab2('0x48')]){_0x5be69a[_0x7ab2('0x46')]=_['merge'](_0x5be69a[_0x7ab2('0x46')],{'$or':_[_0x7ab2('0x49')](_0x309fa6,function(_0x3c5c04){if(_0x3c5c04[_0x7ab2('0x4a')]!=='VIRTUAL'){var _0x50c834={};_0x50c834[_0x3c5c04[_0x7ab2('0x34')]]={'$like':'%'+_0x47ff45['query'][_0x7ab2('0x48')]+'%'};return _0x50c834;}})});}_0x5be69a=_[_0x7ab2('0x4b')]({},_0x5be69a,_0x47ff45[_0x7ab2('0x4c')]);var _0x1cc956={'where':_0x5be69a[_0x7ab2('0x46')]};return db[_0x7ab2('0x4d')][_0x7ab2('0x27')](_0x1cc956)[_0x7ab2('0x2e')](function(_0x44bb40){_0x51b94c['count']=_0x44bb40;if(_0x47ff45[_0x7ab2('0x3b')][_0x7ab2('0x4e')]){_0x5be69a[_0x7ab2('0x4f')]=[{'all':!![]}];}return db[_0x7ab2('0x4d')][_0x7ab2('0x50')](_0x5be69a);})[_0x7ab2('0x2e')](function(_0x44dcc6){_0x51b94c[_0x7ab2('0x51')]=_0x44dcc6;return _0x51b94c;})[_0x7ab2('0x2e')](respondWithFilteredResult(_0x4ed37b,_0x5be69a))[_0x7ab2('0x52')](handleError(_0x4ed37b,null));};exports[_0x7ab2('0x53')]=function(_0x836617,_0x3251dc){var _0x3cb9b7={'raw':!![],'where':{'id':_0x836617[_0x7ab2('0x54')]['id']}},_0x406487={};_0x406487[_0x7ab2('0x3a')]=_[_0x7ab2('0x3c')](db[_0x7ab2('0x4d')][_0x7ab2('0x37')]);_0x406487['query']=_['keys'](_0x836617[_0x7ab2('0x3b')]);_0x406487[_0x7ab2('0x3d')]=_[_0x7ab2('0x3e')](_0x406487[_0x7ab2('0x3a')],_0x406487['query']);_0x3cb9b7[_0x7ab2('0x40')]=_[_0x7ab2('0x3e')](_0x406487[_0x7ab2('0x3a')],qs[_0x7ab2('0x3f')](_0x836617[_0x7ab2('0x3b')][_0x7ab2('0x3f')]));_0x3cb9b7[_0x7ab2('0x40')]=_0x3cb9b7[_0x7ab2('0x40')]['length']?_0x3cb9b7[_0x7ab2('0x40')]:_0x406487['model'];if(_0x836617['query'][_0x7ab2('0x4e')]){_0x3cb9b7[_0x7ab2('0x4f')]=[{'all':!![]}];}_0x3cb9b7=_['merge']({},_0x3cb9b7,_0x836617['options']);return db['Plugin'][_0x7ab2('0x55')](_0x3cb9b7)[_0x7ab2('0x2e')](handleEntityNotFound(_0x3251dc,null))[_0x7ab2('0x2e')](respondWithResult(_0x3251dc,null))[_0x7ab2('0x52')](handleError(_0x3251dc,null));};exports[_0x7ab2('0x56')]=function(_0x4bb5d5,_0x539f43,_0x393fa6){return db['Plugin'][_0x7ab2('0x55')]({'where':{'id':_0x4bb5d5[_0x7ab2('0x54')]['id']},'attributes':[_0x7ab2('0x34'),_0x7ab2('0x7')],'raw':!![]})[_0x7ab2('0x2e')](handleEntityNotFound(_0x539f43,null))[_0x7ab2('0x2e')](function(_0x5f3415){if(_0x5f3415){var _0x369984=path[_0x7ab2('0x57')](config[_0x7ab2('0x58')],'server/files/plugins',util[_0x7ab2('0x59')](_0x7ab2('0x5a'),path[_0x7ab2('0x5b')](_0x5f3415[_0x7ab2('0x7')])));var _0x27b319=fs[_0x7ab2('0x5c')](_0x369984);var _0x3c0cc0=archiver(_0x7ab2('0x5d'),{'zlib':{'level':0x9}});_0x3c0cc0['on'](_0x7ab2('0x5e'),function(_0x4164d8){if(_0x4164d8[_0x7ab2('0x5f')]===_0x7ab2('0x60')){logger[_0x7ab2('0x33')](_0x4164d8);}else{throw new db[(_0x7ab2('0x61'))][(_0x7ab2('0x62'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x3c0cc0['on'](_0x7ab2('0x33'),function(_0x509588){throw new db[(_0x7ab2('0x61'))][(_0x7ab2('0x62'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x3c0cc0[_0x7ab2('0x63')](_0x27b319);_0x3c0cc0[_0x7ab2('0x64')]('**/*',{'cwd':path['join'](config[_0x7ab2('0x58')],'server/files/plugins',path['dirname'](_0x5f3415[_0x7ab2('0x7')])),'ignore':[path['join'](path['basename'](_0x5f3415[_0x7ab2('0x7')]),_0x7ab2('0x65')),path[_0x7ab2('0x57')](path[_0x7ab2('0x5b')](_0x5f3415['path']),_0x7ab2('0x66'))],'nodir':!![]})[_0x7ab2('0x67')]();_0x27b319['on']('close',function(){if(!fs['existsSync'](_0x369984)){throw new db['Sequelize']['Error']('Plugin\x20not\x20found');}return _0x539f43[_0x7ab2('0x56')](_0x369984,util[_0x7ab2('0x59')](_0x7ab2('0x5a'),path['basename'](_0x5f3415[_0x7ab2('0x7')])),function(_0x290ce9){if(_0x290ce9){throw new db['Sequelize']['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x369984);logger[_0x7ab2('0x68')]('Download\x20completed');logger[_0x7ab2('0x68')](_0x7ab2('0x69'));});});}return null;})[_0x7ab2('0x52')](handleError(_0x539f43,null));};exports[_0x7ab2('0x6a')]=function(_0xa38352,_0x3e131a,_0x3fe385){var _0x131fd6=path[_0x7ab2('0x5b')](_0xa38352[_0x7ab2('0x6b')][_0x7ab2('0x6c')],path['extname'](_0xa38352[_0x7ab2('0x6b')]['filename']));var _0x399d70=path[_0x7ab2('0x57')](config['root'],_0x7ab2('0x6d'),_0xa38352['file'][_0x7ab2('0x6c')]);var _0x4e0935=path['join'](config[_0x7ab2('0x58')],'server/files/plugins',_0x131fd6);logger[_0x7ab2('0x68')](_0x7ab2('0x6e'),_0x399d70);logger[_0x7ab2('0x68')]('Plugin\x20upload\x20destination:\x20%s',_0x4e0935);try{fs['chmodSync'](_0x399d70,parseInt(_0x7ab2('0x6f'),0x8));extract(_0x399d70,{'dir':_0x4e0935},function(_0x4f154b){if(_0x4f154b){logger[_0x7ab2('0x33')](_0x4f154b);handleError(_0x4f154b,!![]);};var _0x3817e6=fs['readdirSync'](_0x4e0935);if(_0x3817e6[_0x7ab2('0x41')]>0x1){removeReferences(_0x399d70,_0x4e0935);logger[_0x7ab2('0x33')]('Invalid\x20plugin\x20structure');return _0x3fe385(new Error(_0x7ab2('0x70')));}var _0x28247e=fs[_0x7ab2('0x71')](path[_0x7ab2('0x57')](_0x4e0935,_0x3817e6[0x0]));if(_0x28247e[_0x7ab2('0x72')]()){removeReferences(_0x399d70,_0x4e0935);logger[_0x7ab2('0x33')](_0x7ab2('0x70'));return _0x3fe385(new Error(_0x7ab2('0x70')));}if(_0x28247e[_0x7ab2('0x73')]()){var _0x483424=fs['readdirSync'](path[_0x7ab2('0x57')](_0x4e0935,_0x3817e6[0x0]));if(_0x483424[_0x7ab2('0x41')]===0x0){removeReferences(_0x399d70,_0x4e0935);logger[_0x7ab2('0x33')](_0x7ab2('0x70'));return _0x3fe385(new Error(_0x7ab2('0x70')));}var _0x304f69=_0x483424[_0x7ab2('0x74')](function(_0x416748){return _0x416748==='manifest.json';});if(!_0x304f69){return _0x3fe385(new Error('Plugin\x20manifest\x20missing'));}var _0x10ba26=fs[_0x7ab2('0x75')](path[_0x7ab2('0x57')](_0x4e0935,_0x3817e6[0x0],'manifest.json'));var _0x5d303a=JSON['parse'](_0x10ba26);if(_0x7ab2('0x25')==typeof _0x5d303a[_0x7ab2('0x34')]){return _0x3fe385(new Error(_0x7ab2('0x76')));}if(_0x7ab2('0x25')==typeof _0x5d303a['type']){return _0x3fe385(new Error(_0x7ab2('0x77')));}if('undefined'==typeof _0x5d303a[_0x7ab2('0x78')]){return _0x3fe385(new Error(_0x7ab2('0x79')));}if(_0x7ab2('0x25')==typeof _0x5d303a['parameters']){return _0x3fe385(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x5d303a[_0x7ab2('0x4a')]===_0x7ab2('0x7a')){if('undefined'==typeof _0x5d303a[_0x7ab2('0x7b')]['views']){return _0x3fe385(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x5d303a[_0x7ab2('0x7b')][_0x7ab2('0x7c')][_0x7ab2('0x7d')]&&_0x7ab2('0x25')==typeof _0x5d303a[_0x7ab2('0x7b')][_0x7ab2('0x7c')][_0x7ab2('0x7e')]){return _0x3fe385(new Error(_0x7ab2('0x7f')));}}else if(_0x5d303a[_0x7ab2('0x4a')]===_0x7ab2('0x80')){if(_0x7ab2('0x25')==typeof _0x5d303a['parameters'][_0x7ab2('0x81')]){return _0x3fe385(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x5d303a['parameters'][_0x7ab2('0x82')]){return _0x3fe385(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x3fe385(new Error(_0x7ab2('0x83')));}var _0x2d4701=_0x5d303a[_0x7ab2('0x34')];var _0x358d22=_0x5d303a[_0x7ab2('0x84')];var _0x59bc62=_0x5d303a['type'];var _0x2a5ee3=_0x5d303a[_0x7ab2('0x85')]?_0x5d303a[_0x7ab2('0x85')]:_0x7ab2('0x86');var _0x48f295=_0x5d303a['icon']?_0x5d303a['icon']:_0x7ab2('0x87');var _0x378391='';var _0x1f5f09='';var _0x26f641='';var _0xc18dce='';var _0x34dc21=_0x5d303a[_0x7ab2('0x78')];if(_0x59bc62===_0x7ab2('0x7a')){if(_0x7ab2('0x25')!=typeof _0x5d303a[_0x7ab2('0x7b')]['views'][_0x7ab2('0x7d')]){var _0x29a207=_0x5d303a[_0x7ab2('0x7b')][_0x7ab2('0x7c')][_0x7ab2('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x7ab2('0x88')](_0x29a207)){_0x378391=path[_0x7ab2('0x57')](_0x7ab2('0x89'),_0x131fd6,_0x3817e6[0x0],_0x29a207);}else{_0x378391=_0x29a207;}}else{logger[_0x7ab2('0x68')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x7ab2('0x25')!=typeof _0x5d303a[_0x7ab2('0x7b')][_0x7ab2('0x7c')][_0x7ab2('0x7e')]){var _0x40e1b5=_0x5d303a[_0x7ab2('0x7b')][_0x7ab2('0x7c')][_0x7ab2('0x7e')];if(!/^(f|ht)tps?:\/\//i['test'](_0x40e1b5)){_0x1f5f09=path['join'](_0x7ab2('0x89'),_0x131fd6,_0x3817e6[0x0],_0x40e1b5);}else{_0x1f5f09=_0x40e1b5;}}else{logger[_0x7ab2('0x68')](_0x7ab2('0x8a'));}}else if(_0x59bc62===_0x7ab2('0x80')){_0x26f641=_0x5d303a[_0x7ab2('0x7b')][_0x7ab2('0x81')];_0xc18dce=_0x5d303a['parameters'][_0x7ab2('0x82')];if(_0x7ab2('0x25')!=typeof _0x5d303a['parameters']['views']){if(_0x7ab2('0x25')!=typeof _0x5d303a[_0x7ab2('0x7b')][_0x7ab2('0x7c')][_0x7ab2('0x7d')]){var _0x29a207=_0x5d303a['parameters'][_0x7ab2('0x7c')][_0x7ab2('0x7d')];if(!/^(f|ht)tps?:\/\//i['test'](_0x29a207)){_0x378391=path[_0x7ab2('0x57')](_0x7ab2('0x89'),_0x131fd6,_0x3817e6[0x0],_0x29a207);}else{_0x378391=_0x29a207;}}if('undefined'!=typeof _0x5d303a[_0x7ab2('0x7b')][_0x7ab2('0x7c')][_0x7ab2('0x7e')]){var _0x40e1b5=_0x5d303a['parameters'][_0x7ab2('0x7c')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x7ab2('0x88')](_0x40e1b5)){_0x1f5f09=path['join'](_0x7ab2('0x89'),_0x131fd6,_0x3817e6[0x0],_0x40e1b5);}else{_0x1f5f09=_0x40e1b5;}}}}var _0x50889a={'name':_0x2d4701,'description':_0x358d22,'path':path[_0x7ab2('0x57')](_0x131fd6,_0x3817e6[0x0]),'type':_0x59bc62,'sidebar':_0x2a5ee3,'icon':_0x48f295,'adminUrl':_0x378391,'agentUrl':_0x1f5f09,'scriptName':_0x26f641,'scriptPath':_0xc18dce,'version':_0x34dc21};removeReferences(_0x399d70,null);return db[_0x7ab2('0x4d')][_0x7ab2('0x8b')](_0x50889a)[_0x7ab2('0x2e')](function(_0x27b2bc){var _0x1c70bf={'role':_0xa38352[_0x7ab2('0x8c')][_0x7ab2('0x8d')],'userProfileId':_0xa38352['body']['userProfileId']};if(!_0x1c70bf)throw new Error(_0x7ab2('0x8e'));if(_0x1c70bf[_0x7ab2('0x8d')]===_0x7ab2('0x8f')){var _0x5c17a4=_0x27b2bc[_0x7ab2('0x30')]({'plain':!![]});return db[_0x7ab2('0x90')][_0x7ab2('0x55')]({'where':{'name':'Plugins','userProfileId':_0x1c70bf[_0x7ab2('0x91')]},'raw':!![]})[_0x7ab2('0x2e')](function(_0x30b032){if(_0x30b032&&_0x30b032['autoAssociation']===0x0){return db[_0x7ab2('0x31')]['create']({'name':_0x5c17a4['name'],'resourceId':_0x5c17a4['id'],'type':_0x30b032['name'],'sectionId':_0x30b032['id']},{})[_0x7ab2('0x2e')](function(){return _0x27b2bc;});}else{return _0x27b2bc;}})[_0x7ab2('0x52')](function(_0x4c81e5){logger[_0x7ab2('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c81e5);throw _0x4c81e5;});}return _0x27b2bc;})[_0x7ab2('0x2e')](respondWithResult(_0x3e131a,null))['catch'](handleError(_0x3e131a,null));}});}catch(_0x1039e3){_0x3e131a[_0x7ab2('0x21')](0x1f4)[_0x7ab2('0x35')](_0x1039e3);}};function removeReferences(_0x163619,_0x5c05ce){try{if(_0x163619){fs['unlinkSync'](_0x163619);logger[_0x7ab2('0x68')](_0x7ab2('0x92'));}if(_0x5c05ce){rimraf(_0x5c05ce,function(){});logger[_0x7ab2('0x68')]('Extracted\x20folder\x20removed');}}catch(_0x3f87a4){logger[_0x7ab2('0x33')](_0x3f87a4);}}exports[_0x7ab2('0x2d')]=function(_0x564bc5,_0x580be4,_0x176dcb){return db[_0x7ab2('0x4d')]['find']({'where':{'id':_0x564bc5['params']['id']}})['then'](handleEntityNotFound(_0x580be4,null))[_0x7ab2('0x2e')](saveUpdates(_0x564bc5[_0x7ab2('0x8c')],null))[_0x7ab2('0x2e')](respondWithResult(_0x580be4,null))[_0x7ab2('0x52')](handleError(_0x580be4,null));};exports['delete']=function(_0x3cb115,_0x110e39,_0x5e7e21){return db[_0x7ab2('0x4d')]['find']({'where':{'id':_0x3cb115['params']['id']}})[_0x7ab2('0x2e')](function(_0x264d49){if(_0x264d49){return _0x264d49[_0x7ab2('0x2f')]();}})['then'](function(_0x2fa999){rimraf(path[_0x7ab2('0x57')](config[_0x7ab2('0x58')],_0x7ab2('0x6d'),path[_0x7ab2('0x93')](_0x2fa999['path'])),function(){});return _0x2fa999;})[_0x7ab2('0x2e')](handleEntityNotFound(_0x110e39,null))[_0x7ab2('0x2e')](respondWithStatusCode(_0x110e39,null))['catch'](handleError(_0x110e39,null));};exports[_0x7ab2('0x94')]=function(_0x440073,_0x4c36ea,_0xdec882){return BPromise['resolve']()[_0x7ab2('0x2e')](function(){if(!_0x440073['query'][_0x7ab2('0x7')]){throw new Error(_0x7ab2('0x95'));}if(!_0x440073[_0x7ab2('0x3b')][_0x7ab2('0x96')]){throw new Error(_0x7ab2('0x97'));}var _0x481599=_0x440073[_0x7ab2('0x3b')]['hostname']?_0x440073[_0x7ab2('0x3b')][_0x7ab2('0x98')]+':'+_0x440073[_0x7ab2('0x3b')][_0x7ab2('0x96')]:_0x7ab2('0x99')+_0x440073[_0x7ab2('0x3b')]['port'];var _0xebd93b=_0x440073[_0x7ab2('0x3b')]['json']?_0x440073[_0x7ab2('0x3b')][_0x7ab2('0x23')]:!![];var _0x4692db=_0x440073['query'][_0x7ab2('0x9a')]?_0x440073[_0x7ab2('0x3b')][_0x7ab2('0x9a')]:null;var _0x5d5923={'method':_0x440073[_0x7ab2('0x9b')],'uri':util[_0x7ab2('0x59')](_0x7ab2('0x9c'),_0x481599,_0x440073[_0x7ab2('0x3b')][_0x7ab2('0x7')]),'json':_0xebd93b,'resolveWithFullResponse':!![],'encoding':_0x4692db,'qs':_0x440073['query']};if(_0x440073[_0x7ab2('0x9d')]){_0x5d5923[_0x7ab2('0x9d')]=_0x440073[_0x7ab2('0x9d')];if(_0x5d5923['headers']['content-length']){delete _0x5d5923[_0x7ab2('0x9d')][_0x7ab2('0x9e')];}}if(_0x5d5923['headers'][_0x7ab2('0x9f')]){delete _0x5d5923['headers'][_0x7ab2('0x9f')];}return rp(_0x5d5923);})[_0x7ab2('0x2e')](function(_0x235117){if(_0x235117){_0x4c36ea[_0x7ab2('0x28')](_0x235117[_0x7ab2('0x9d')]);logger[_0x7ab2('0x68')](_0x235117[_0x7ab2('0x8c')]);if(_[_0x7ab2('0xa0')](_0x440073[_0x7ab2('0x3b')][_0x7ab2('0x7')],'download')&&_0x235117[_0x7ab2('0xa1')]==0x1f4){return _0x4c36ea[_0x7ab2('0x32')](_0x235117['statusCode']);}else{return _0x4c36ea[_0x7ab2('0x21')](_0x235117[_0x7ab2('0xa1')])[_0x7ab2('0x35')](_0x235117['body']);}}else{return _0x4c36ea[_0x7ab2('0x32')](0xc8);}})[_0x7ab2('0x52')](handleError(_0x4c36ea,null));};exports[_0x7ab2('0xa2')]=function(_0x5bc2ce,_0x455550,_0x45b0dc){return BPromise[_0x7ab2('0xa3')]()[_0x7ab2('0x2e')](function(){if(!_0x5bc2ce[_0x7ab2('0x3b')][_0x7ab2('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x5bc2ce[_0x7ab2('0x3b')][_0x7ab2('0x96')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x134794=_0x5bc2ce[_0x7ab2('0x3b')][_0x7ab2('0x98')]?_0x5bc2ce[_0x7ab2('0x3b')]['hostname']+':'+_0x5bc2ce[_0x7ab2('0x3b')]['port']:_0x7ab2('0x99')+_0x5bc2ce[_0x7ab2('0x3b')][_0x7ab2('0x96')];var _0x47e336=_0x5bc2ce[_0x7ab2('0x3b')][_0x7ab2('0x23')]?_0x5bc2ce[_0x7ab2('0x3b')][_0x7ab2('0x23')]:!![];var _0x446fd6=_0x5bc2ce[_0x7ab2('0x3b')][_0x7ab2('0x9a')]?_0x5bc2ce[_0x7ab2('0x3b')][_0x7ab2('0x9a')]:null;var _0x48226c={'method':_0x5bc2ce[_0x7ab2('0x9b')],'uri':util['format'](_0x7ab2('0x9c'),_0x134794,_0x5bc2ce[_0x7ab2('0x3b')][_0x7ab2('0x7')]),'json':_0x47e336,'resolveWithFullResponse':!![],'encoding':_0x446fd6,'body':_0x5bc2ce['body']};if(_0x5bc2ce[_0x7ab2('0x9d')]){_0x48226c['headers']=_0x5bc2ce[_0x7ab2('0x9d')];if(_0x48226c[_0x7ab2('0x9d')][_0x7ab2('0x9e')]){delete _0x48226c[_0x7ab2('0x9d')][_0x7ab2('0x9e')];}}if(_0x48226c[_0x7ab2('0x9d')][_0x7ab2('0x9f')]){delete _0x48226c['headers'][_0x7ab2('0x9f')];}return rp(_0x48226c);})[_0x7ab2('0x2e')](function(_0x415bd0){if(_0x415bd0){_0x455550[_0x7ab2('0x28')](_0x415bd0[_0x7ab2('0x9d')]);logger[_0x7ab2('0x68')](_0x415bd0['body']);return _0x455550[_0x7ab2('0x21')](_0x415bd0[_0x7ab2('0xa1')])[_0x7ab2('0x35')](_0x415bd0['body']);}else{return _0x455550['sendStatus'](0xc8);}})['catch'](handleError(_0x455550,null));}; \ No newline at end of file +var _0x2e0f=['moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','extract-zip','rimraf','archiver','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','Plugin','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','keys','include','find','catch','download','params','join','root','format','basename','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','node_modules/**/*','attachments/**/*','finalize','close','existsSync','%s.zip','info','Download\x20completed','Temporary\x20file\x20removed','file','extname','filename','server/files/plugins','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','admin','Warning:\x20admin\x20view\x20not\x20specified','agent','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Plugins','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','method','statusCode','eml-format','request-promise'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0x2e0f,0x160));var _0xf2e0=function(_0x40b745,_0x150414){_0x40b745=_0x40b745-0x0;var _0x41fb83=_0x2e0f[_0x40b745];return _0x41fb83;};'use strict';var emlformat=require(_0xf2e0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf2e0('0x1'));var moment=require(_0xf2e0('0x2'));var BPromise=require(_0xf2e0('0x3'));var Mustache=require(_0xf2e0('0x4'));var util=require(_0xf2e0('0x5'));var path=require(_0xf2e0('0x6'));var sox=require(_0xf2e0('0x7'));var csv=require(_0xf2e0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf2e0('0x9'));var squel=require(_0xf2e0('0xa'));var crypto=require(_0xf2e0('0xb'));var jsforce=require(_0xf2e0('0xc'));var deskjs=require(_0xf2e0('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf2e0('0xe'));var Papa=require('papaparse');var extract=require(_0xf2e0('0xf'));var rimraf=require(_0xf2e0('0x10'));var archiver=require(_0xf2e0('0x11'));var Redis=require('ioredis');var authService=require(_0xf2e0('0x12'));var qs=require(_0xf2e0('0x13'));var as=require(_0xf2e0('0x14'));var hardwareService=require(_0xf2e0('0x15'));var logger=require(_0xf2e0('0x16'))(_0xf2e0('0x17'));var utils=require(_0xf2e0('0x18'));var config=require(_0xf2e0('0x19'));var licenseUtil=require(_0xf2e0('0x1a'));var db=require(_0xf2e0('0x1b'))['db'];config[_0xf2e0('0x1c')]=_[_0xf2e0('0x1d')](config['redis'],{'host':_0xf2e0('0x1e'),'port':0x18eb});var socket=require(_0xf2e0('0x1f'))(new Redis(config['redis']));require(_0xf2e0('0x20'))['register'](socket);function respondWithStatusCode(_0x437e34,_0x365d2b){_0x365d2b=_0x365d2b||0xcc;return function(_0x53ae8e){if(_0x53ae8e){return _0x437e34[_0xf2e0('0x21')](_0x365d2b);}return _0x437e34[_0xf2e0('0x22')](_0x365d2b)[_0xf2e0('0x23')]();};}function respondWithResult(_0x458f6b,_0xc669c3){_0xc669c3=_0xc669c3||0xc8;return function(_0x226f39){if(_0x226f39){return _0x458f6b['status'](_0xc669c3)[_0xf2e0('0x24')](_0x226f39);}};}function respondWithFilteredResult(_0x570c6c,_0x10219d){return function(_0x169805){if(_0x169805){var _0x225a33=typeof _0x10219d[_0xf2e0('0x25')]===_0xf2e0('0x26')&&typeof _0x10219d['limit']===_0xf2e0('0x26');var _0x57c3cd=_0x169805[_0xf2e0('0x27')];var _0x19a877=_0x225a33?0x0:_0x10219d[_0xf2e0('0x25')];var _0x284372=_0x225a33?_0x169805[_0xf2e0('0x27')]:_0x10219d['offset']+_0x10219d[_0xf2e0('0x28')];var _0x536395;if(_0x284372>=_0x57c3cd){_0x284372=_0x57c3cd;_0x536395=0xc8;}else{_0x536395=0xce;}_0x570c6c[_0xf2e0('0x22')](_0x536395);return _0x570c6c[_0xf2e0('0x29')](_0xf2e0('0x2a'),_0x19a877+'-'+_0x284372+'/'+_0x57c3cd)[_0xf2e0('0x24')](_0x169805);}return null;};}function patchUpdates(_0x45ad60){return function(_0x22fe9f){try{jsonpatch['apply'](_0x22fe9f,_0x45ad60,!![]);}catch(_0xf9db24){return BPromise[_0xf2e0('0x2b')](_0xf9db24);}return _0x22fe9f['save']();};}function saveUpdates(_0x2a89a0,_0x20f279){return function(_0x495657){if(_0x495657){return _0x495657[_0xf2e0('0x2c')](_0x2a89a0)[_0xf2e0('0x2d')](function(_0x2f962b){return _0x2f962b;});}return null;};}function removeEntity(_0x49b965,_0x1cbee3){return function(_0x765a02){if(_0x765a02){return _0x765a02[_0xf2e0('0x2e')]()[_0xf2e0('0x2d')](function(){var _0x4e58ea=_0x765a02[_0xf2e0('0x2f')]({'plain':!![]});var _0x3fcdab='Plugins';return db[_0xf2e0('0x30')][_0xf2e0('0x2e')]({'where':{'type':_0x3fcdab,'resourceId':_0x4e58ea['id']}})['then'](function(){return _0x765a02;});})['then'](function(){_0x49b965[_0xf2e0('0x22')](0xcc)[_0xf2e0('0x23')]();});}};}function handleEntityNotFound(_0x564e21,_0x5739b5){return function(_0xc0f65a){if(!_0xc0f65a){_0x564e21[_0xf2e0('0x21')](0x194);}return _0xc0f65a;};}function handleError(_0x484ddf,_0x4c2156){_0x4c2156=_0x4c2156||0x1f4;return function(_0x2a412f){logger[_0xf2e0('0x31')](_0x2a412f[_0xf2e0('0x32')]);if(_0x2a412f[_0xf2e0('0x33')]){delete _0x2a412f['name'];}_0x484ddf[_0xf2e0('0x22')](_0x4c2156)[_0xf2e0('0x34')](_0x2a412f);};}exports['index']=function(_0x32a2ff,_0x11bd2b){var _0x3c7513={},_0x3eb55d={},_0x38d361={'count':0x0,'rows':[]};var _0x42d2e6=_[_0xf2e0('0x35')](db[_0xf2e0('0x36')][_0xf2e0('0x37')],function(_0x339855){return{'name':_0x339855[_0xf2e0('0x38')],'type':_0x339855[_0xf2e0('0x39')][_0xf2e0('0x3a')]};});_0x3eb55d['model']=_['map'](_0x42d2e6,_0xf2e0('0x33'));_0x3eb55d[_0xf2e0('0x3b')]=_['keys'](_0x32a2ff[_0xf2e0('0x3b')]);_0x3eb55d[_0xf2e0('0x3c')]=_[_0xf2e0('0x3d')](_0x3eb55d['model'],_0x3eb55d['query']);_0x3c7513[_0xf2e0('0x3e')]=_[_0xf2e0('0x3d')](_0x3eb55d[_0xf2e0('0x3f')],qs[_0xf2e0('0x40')](_0x32a2ff[_0xf2e0('0x3b')]['fields']));_0x3c7513['attributes']=_0x3c7513[_0xf2e0('0x3e')][_0xf2e0('0x41')]?_0x3c7513[_0xf2e0('0x3e')]:_0x3eb55d['model'];if(!_0x32a2ff[_0xf2e0('0x3b')][_0xf2e0('0x42')](_0xf2e0('0x43'))){_0x3c7513[_0xf2e0('0x28')]=qs['limit'](_0x32a2ff['query'][_0xf2e0('0x28')]);_0x3c7513[_0xf2e0('0x25')]=qs[_0xf2e0('0x25')](_0x32a2ff[_0xf2e0('0x3b')][_0xf2e0('0x25')]);}_0x3c7513[_0xf2e0('0x44')]=qs[_0xf2e0('0x45')](_0x32a2ff['query'][_0xf2e0('0x45')]);_0x3c7513[_0xf2e0('0x46')]=qs[_0xf2e0('0x3c')](_[_0xf2e0('0x47')](_0x32a2ff['query'],_0x3eb55d[_0xf2e0('0x3c')]),_0x42d2e6);if(_0x32a2ff[_0xf2e0('0x3b')][_0xf2e0('0x48')]){_0x3c7513[_0xf2e0('0x46')]=_[_0xf2e0('0x49')](_0x3c7513[_0xf2e0('0x46')],{'$or':_['map'](_0x42d2e6,function(_0x330270){if(_0x330270[_0xf2e0('0x39')]!==_0xf2e0('0x4a')){var _0x2e76ab={};_0x2e76ab[_0x330270['name']]={'$like':'%'+_0x32a2ff[_0xf2e0('0x3b')][_0xf2e0('0x48')]+'%'};return _0x2e76ab;}})});}_0x3c7513=_[_0xf2e0('0x49')]({},_0x3c7513,_0x32a2ff[_0xf2e0('0x4b')]);var _0x129337={'where':_0x3c7513[_0xf2e0('0x46')]};return db[_0xf2e0('0x36')][_0xf2e0('0x27')](_0x129337)[_0xf2e0('0x2d')](function(_0x5a904e){_0x38d361[_0xf2e0('0x27')]=_0x5a904e;if(_0x32a2ff[_0xf2e0('0x3b')][_0xf2e0('0x4c')]){_0x3c7513['include']=[{'all':!![]}];}return db['Plugin'][_0xf2e0('0x4d')](_0x3c7513);})[_0xf2e0('0x2d')](function(_0x288aff){_0x38d361['rows']=_0x288aff;return _0x38d361;})['then'](respondWithFilteredResult(_0x11bd2b,_0x3c7513))['catch'](handleError(_0x11bd2b,null));};exports[_0xf2e0('0x4e')]=function(_0x230667,_0x21fed6){var _0x491a55={'raw':!![],'where':{'id':_0x230667['params']['id']}},_0xccda64={};_0xccda64['model']=_['keys'](db[_0xf2e0('0x36')][_0xf2e0('0x37')]);_0xccda64[_0xf2e0('0x3b')]=_[_0xf2e0('0x4f')](_0x230667[_0xf2e0('0x3b')]);_0xccda64[_0xf2e0('0x3c')]=_[_0xf2e0('0x3d')](_0xccda64[_0xf2e0('0x3f')],_0xccda64[_0xf2e0('0x3b')]);_0x491a55[_0xf2e0('0x3e')]=_['intersection'](_0xccda64[_0xf2e0('0x3f')],qs[_0xf2e0('0x40')](_0x230667[_0xf2e0('0x3b')]['fields']));_0x491a55[_0xf2e0('0x3e')]=_0x491a55[_0xf2e0('0x3e')][_0xf2e0('0x41')]?_0x491a55[_0xf2e0('0x3e')]:_0xccda64[_0xf2e0('0x3f')];if(_0x230667[_0xf2e0('0x3b')][_0xf2e0('0x4c')]){_0x491a55[_0xf2e0('0x50')]=[{'all':!![]}];}_0x491a55=_[_0xf2e0('0x49')]({},_0x491a55,_0x230667['options']);return db['Plugin'][_0xf2e0('0x51')](_0x491a55)['then'](handleEntityNotFound(_0x21fed6,null))[_0xf2e0('0x2d')](respondWithResult(_0x21fed6,null))[_0xf2e0('0x52')](handleError(_0x21fed6,null));};exports[_0xf2e0('0x53')]=function(_0x16fef3,_0x161294,_0x7d1008){return db[_0xf2e0('0x36')][_0xf2e0('0x51')]({'where':{'id':_0x16fef3[_0xf2e0('0x54')]['id']},'attributes':[_0xf2e0('0x33'),_0xf2e0('0x6')],'raw':!![]})['then'](handleEntityNotFound(_0x161294,null))[_0xf2e0('0x2d')](function(_0xcb7d30){if(_0xcb7d30){var _0x3d8cb8=path[_0xf2e0('0x55')](config[_0xf2e0('0x56')],'server/files/plugins',util[_0xf2e0('0x57')]('%s.zip',path[_0xf2e0('0x58')](_0xcb7d30[_0xf2e0('0x6')])));var _0x5aa790=fs['createWriteStream'](_0x3d8cb8);var _0x411e95=archiver('zip',{'zlib':{'level':0x9}});_0x411e95['on'](_0xf2e0('0x59'),function(_0x5dcca1){if(_0x5dcca1[_0xf2e0('0x5a')]===_0xf2e0('0x5b')){logger[_0xf2e0('0x31')](_0x5dcca1);}else{throw new db[(_0xf2e0('0x5c'))][(_0xf2e0('0x5d'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x411e95['on'](_0xf2e0('0x31'),function(_0x5ee325){throw new db[(_0xf2e0('0x5c'))][(_0xf2e0('0x5d'))](_0xf2e0('0x5e'));});_0x411e95[_0xf2e0('0x5f')](_0x5aa790);_0x411e95[_0xf2e0('0x60')](_0xf2e0('0x61'),{'cwd':path[_0xf2e0('0x55')](config['root'],'server/files/plugins',path['dirname'](_0xcb7d30[_0xf2e0('0x6')])),'ignore':[path['join'](path[_0xf2e0('0x58')](_0xcb7d30[_0xf2e0('0x6')]),_0xf2e0('0x62')),path[_0xf2e0('0x55')](path[_0xf2e0('0x58')](_0xcb7d30[_0xf2e0('0x6')]),_0xf2e0('0x63'))],'nodir':!![]})[_0xf2e0('0x64')]();_0x5aa790['on'](_0xf2e0('0x65'),function(){if(!fs[_0xf2e0('0x66')](_0x3d8cb8)){throw new db[(_0xf2e0('0x5c'))]['Error']('Plugin\x20not\x20found');}return _0x161294[_0xf2e0('0x53')](_0x3d8cb8,util['format'](_0xf2e0('0x67'),path[_0xf2e0('0x58')](_0xcb7d30[_0xf2e0('0x6')])),function(_0x4c7c81){if(_0x4c7c81){throw new db[(_0xf2e0('0x5c'))]['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x3d8cb8);logger[_0xf2e0('0x68')](_0xf2e0('0x69'));logger[_0xf2e0('0x68')](_0xf2e0('0x6a'));});});}return null;})[_0xf2e0('0x52')](handleError(_0x161294,null));};exports['upload']=function(_0x4d730d,_0x3f98ac,_0x50e069){var _0x22f632=path['basename'](_0x4d730d[_0xf2e0('0x6b')]['filename'],path[_0xf2e0('0x6c')](_0x4d730d[_0xf2e0('0x6b')][_0xf2e0('0x6d')]));var _0x913fa9=path[_0xf2e0('0x55')](config[_0xf2e0('0x56')],'server/files/plugins',_0x4d730d[_0xf2e0('0x6b')][_0xf2e0('0x6d')]);var _0x310318=path['join'](config['root'],_0xf2e0('0x6e'),_0x22f632);logger[_0xf2e0('0x68')]('Plugin\x20upload\x20filepath:\x20%s',_0x913fa9);logger[_0xf2e0('0x68')](_0xf2e0('0x6f'),_0x310318);try{fs[_0xf2e0('0x70')](_0x913fa9,parseInt(_0xf2e0('0x71'),0x8));extract(_0x913fa9,{'dir':_0x310318},function(_0x14050f){if(_0x14050f){logger['error'](_0x14050f);handleError(_0x14050f,!![]);};var _0x40d043=fs[_0xf2e0('0x72')](_0x310318);if(_0x40d043[_0xf2e0('0x41')]>0x1){removeReferences(_0x913fa9,_0x310318);logger[_0xf2e0('0x31')](_0xf2e0('0x73'));return _0x50e069(new Error(_0xf2e0('0x73')));}var _0x326f58=fs[_0xf2e0('0x74')](path[_0xf2e0('0x55')](_0x310318,_0x40d043[0x0]));if(_0x326f58['isFile']()){removeReferences(_0x913fa9,_0x310318);logger[_0xf2e0('0x31')]('Invalid\x20plugin\x20structure');return _0x50e069(new Error(_0xf2e0('0x73')));}if(_0x326f58[_0xf2e0('0x75')]()){var _0x2104a5=fs[_0xf2e0('0x72')](path[_0xf2e0('0x55')](_0x310318,_0x40d043[0x0]));if(_0x2104a5[_0xf2e0('0x41')]===0x0){removeReferences(_0x913fa9,_0x310318);logger[_0xf2e0('0x31')]('Invalid\x20plugin\x20structure');return _0x50e069(new Error(_0xf2e0('0x73')));}var _0x2ea905=_0x2104a5[_0xf2e0('0x76')](function(_0x28b120){return _0x28b120===_0xf2e0('0x77');});if(!_0x2ea905){return _0x50e069(new Error(_0xf2e0('0x78')));}var _0x45dbd7=fs[_0xf2e0('0x79')](path[_0xf2e0('0x55')](_0x310318,_0x40d043[0x0],'manifest.json'));var _0x13133a=JSON[_0xf2e0('0x7a')](_0x45dbd7);if(_0xf2e0('0x26')==typeof _0x13133a[_0xf2e0('0x33')]){return _0x50e069(new Error(_0xf2e0('0x7b')));}if(_0xf2e0('0x26')==typeof _0x13133a['type']){return _0x50e069(new Error(_0xf2e0('0x7c')));}if(_0xf2e0('0x26')==typeof _0x13133a['version']){return _0x50e069(new Error(_0xf2e0('0x7d')));}if(_0xf2e0('0x26')==typeof _0x13133a[_0xf2e0('0x7e')]){return _0x50e069(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x13133a[_0xf2e0('0x39')]===_0xf2e0('0x7f')){if(_0xf2e0('0x26')==typeof _0x13133a['parameters'][_0xf2e0('0x80')]){return _0x50e069(new Error(_0xf2e0('0x81')));}if(_0xf2e0('0x26')==typeof _0x13133a[_0xf2e0('0x7e')][_0xf2e0('0x80')]['admin']&&_0xf2e0('0x26')==typeof _0x13133a[_0xf2e0('0x7e')]['views']['agent']){return _0x50e069(new Error(_0xf2e0('0x82')));}}else if(_0x13133a[_0xf2e0('0x39')]===_0xf2e0('0x83')){if(_0xf2e0('0x26')==typeof _0x13133a[_0xf2e0('0x7e')][_0xf2e0('0x84')]){return _0x50e069(new Error(_0xf2e0('0x85')));}if('undefined'==typeof _0x13133a[_0xf2e0('0x7e')][_0xf2e0('0x86')]){return _0x50e069(new Error(_0xf2e0('0x87')));}}else{return _0x50e069(new Error(_0xf2e0('0x88')));}var _0x145676=_0x13133a[_0xf2e0('0x33')];var _0x2d5dc6=_0x13133a['description'];var _0x5792c4=_0x13133a[_0xf2e0('0x39')];var _0xe4d6f8=_0x13133a['sidebar']?_0x13133a[_0xf2e0('0x89')]:_0xf2e0('0x8a');var _0x58891a=_0x13133a[_0xf2e0('0x8b')]?_0x13133a['icon']:_0xf2e0('0x8c');var _0x5621f1='';var _0x3d25d9='';var _0x3e359b='';var _0x570174='';var _0x3ae004=_0x13133a['version'];if(_0x5792c4==='html'){if(_0xf2e0('0x26')!=typeof _0x13133a[_0xf2e0('0x7e')][_0xf2e0('0x80')]['admin']){var _0x121625=_0x13133a['parameters'][_0xf2e0('0x80')][_0xf2e0('0x8d')];if(!/^(f|ht)tps?:\/\//i['test'](_0x121625)){_0x5621f1=path['join']('plugins',_0x22f632,_0x40d043[0x0],_0x121625);}else{_0x5621f1=_0x121625;}}else{logger[_0xf2e0('0x68')](_0xf2e0('0x8e'));}if(_0xf2e0('0x26')!=typeof _0x13133a[_0xf2e0('0x7e')]['views']['agent']){var _0x3ddc22=_0x13133a[_0xf2e0('0x7e')][_0xf2e0('0x80')][_0xf2e0('0x8f')];if(!/^(f|ht)tps?:\/\//i[_0xf2e0('0x90')](_0x3ddc22)){_0x3d25d9=path[_0xf2e0('0x55')](_0xf2e0('0x91'),_0x22f632,_0x40d043[0x0],_0x3ddc22);}else{_0x3d25d9=_0x3ddc22;}}else{logger[_0xf2e0('0x68')](_0xf2e0('0x92'));}}else if(_0x5792c4===_0xf2e0('0x83')){_0x3e359b=_0x13133a[_0xf2e0('0x7e')]['scriptName'];_0x570174=_0x13133a[_0xf2e0('0x7e')][_0xf2e0('0x86')];if('undefined'!=typeof _0x13133a[_0xf2e0('0x7e')][_0xf2e0('0x80')]){if('undefined'!=typeof _0x13133a[_0xf2e0('0x7e')][_0xf2e0('0x80')][_0xf2e0('0x8d')]){var _0x121625=_0x13133a[_0xf2e0('0x7e')]['views'][_0xf2e0('0x8d')];if(!/^(f|ht)tps?:\/\//i[_0xf2e0('0x90')](_0x121625)){_0x5621f1=path[_0xf2e0('0x55')](_0xf2e0('0x91'),_0x22f632,_0x40d043[0x0],_0x121625);}else{_0x5621f1=_0x121625;}}if('undefined'!=typeof _0x13133a[_0xf2e0('0x7e')][_0xf2e0('0x80')][_0xf2e0('0x8f')]){var _0x3ddc22=_0x13133a[_0xf2e0('0x7e')]['views'][_0xf2e0('0x8f')];if(!/^(f|ht)tps?:\/\//i[_0xf2e0('0x90')](_0x3ddc22)){_0x3d25d9=path[_0xf2e0('0x55')](_0xf2e0('0x91'),_0x22f632,_0x40d043[0x0],_0x3ddc22);}else{_0x3d25d9=_0x3ddc22;}}}}var _0x52ed86={'name':_0x145676,'description':_0x2d5dc6,'path':path['join'](_0x22f632,_0x40d043[0x0]),'type':_0x5792c4,'sidebar':_0xe4d6f8,'icon':_0x58891a,'adminUrl':_0x5621f1,'agentUrl':_0x3d25d9,'scriptName':_0x3e359b,'scriptPath':_0x570174,'version':_0x3ae004};removeReferences(_0x913fa9,null);return db[_0xf2e0('0x36')]['create'](_0x52ed86)['then'](function(_0x29cc59){var _0x41716c={'role':_0x4d730d[_0xf2e0('0x93')][_0xf2e0('0x94')],'userProfileId':_0x4d730d[_0xf2e0('0x93')][_0xf2e0('0x95')]};if(!_0x41716c)throw new Error(_0xf2e0('0x96'));if(_0x41716c[_0xf2e0('0x94')]===_0xf2e0('0x97')){var _0x28a1a4=_0x29cc59[_0xf2e0('0x2f')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xf2e0('0x98'),'userProfileId':_0x41716c['userProfileId']},'raw':!![]})[_0xf2e0('0x2d')](function(_0x31ec8f){if(_0x31ec8f&&_0x31ec8f[_0xf2e0('0x99')]===0x0){return db[_0xf2e0('0x30')][_0xf2e0('0x9a')]({'name':_0x28a1a4[_0xf2e0('0x33')],'resourceId':_0x28a1a4['id'],'type':_0x31ec8f['name'],'sectionId':_0x31ec8f['id']},{})[_0xf2e0('0x2d')](function(){return _0x29cc59;});}else{return _0x29cc59;}})[_0xf2e0('0x52')](function(_0x23fe76){logger[_0xf2e0('0x31')](_0xf2e0('0x9b'),_0x23fe76);throw _0x23fe76;});}return _0x29cc59;})[_0xf2e0('0x2d')](respondWithResult(_0x3f98ac,null))[_0xf2e0('0x52')](handleError(_0x3f98ac,null));}});}catch(_0x5debb6){_0x3f98ac[_0xf2e0('0x22')](0x1f4)['send'](_0x5debb6);}};function removeReferences(_0x2c61af,_0x54dd1d){try{if(_0x2c61af){fs[_0xf2e0('0x9c')](_0x2c61af);logger[_0xf2e0('0x68')](_0xf2e0('0x9d'));}if(_0x54dd1d){rimraf(_0x54dd1d,function(){});logger[_0xf2e0('0x68')](_0xf2e0('0x9e'));}}catch(_0x1c0815){logger[_0xf2e0('0x31')](_0x1c0815);}}exports['update']=function(_0x5e03ab,_0x4a9d47,_0x59e732){return db['Plugin'][_0xf2e0('0x51')]({'where':{'id':_0x5e03ab[_0xf2e0('0x54')]['id']}})['then'](handleEntityNotFound(_0x4a9d47,null))[_0xf2e0('0x2d')](saveUpdates(_0x5e03ab[_0xf2e0('0x93')],null))[_0xf2e0('0x2d')](respondWithResult(_0x4a9d47,null))[_0xf2e0('0x52')](handleError(_0x4a9d47,null));};exports[_0xf2e0('0x9f')]=function(_0x447db2,_0x3951e4,_0x159549){return db[_0xf2e0('0x36')][_0xf2e0('0x51')]({'where':{'id':_0x447db2[_0xf2e0('0x54')]['id']}})[_0xf2e0('0x2d')](function(_0x53fc87){if(_0x53fc87){return _0x53fc87[_0xf2e0('0x2e')]();}})[_0xf2e0('0x2d')](function(_0x7cc138){rimraf(path[_0xf2e0('0x55')](config['root'],'server/files/plugins',path[_0xf2e0('0xa0')](_0x7cc138[_0xf2e0('0x6')])),function(){});return _0x7cc138;})[_0xf2e0('0x2d')](handleEntityNotFound(_0x3951e4,null))[_0xf2e0('0x2d')](respondWithStatusCode(_0x3951e4,null))['catch'](handleError(_0x3951e4,null));};exports[_0xf2e0('0xa1')]=function(_0x26148f,_0xa36e44,_0x9f12ab){return BPromise[_0xf2e0('0xa2')]()[_0xf2e0('0x2d')](function(){if(!_0x26148f[_0xf2e0('0x3b')][_0xf2e0('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x26148f['query'][_0xf2e0('0xa3')]){throw new Error(_0xf2e0('0xa4'));}var _0x3e23a5=_0x26148f['query'][_0xf2e0('0xa5')]?_0x26148f['query']['hostname']+':'+_0x26148f[_0xf2e0('0x3b')]['port']:_0xf2e0('0xa6')+_0x26148f[_0xf2e0('0x3b')]['port'];var _0x2a9a26=_0x26148f[_0xf2e0('0x3b')][_0xf2e0('0x24')]?_0x26148f[_0xf2e0('0x3b')][_0xf2e0('0x24')]:!![];var _0x1e77ae=_0x26148f[_0xf2e0('0x3b')][_0xf2e0('0xa7')]?_0x26148f[_0xf2e0('0x3b')][_0xf2e0('0xa7')]:null;var _0x592386={'method':_0x26148f['method'],'uri':util[_0xf2e0('0x57')](_0xf2e0('0xa8'),_0x3e23a5,_0x26148f[_0xf2e0('0x3b')]['path']),'json':_0x2a9a26,'resolveWithFullResponse':!![],'encoding':_0x1e77ae,'qs':_0x26148f['query']};if(_0x26148f['headers']){_0x592386[_0xf2e0('0xa9')]=_0x26148f[_0xf2e0('0xa9')];if(_0x592386['headers'][_0xf2e0('0xaa')]){delete _0x592386[_0xf2e0('0xa9')][_0xf2e0('0xaa')];}}if(_0x592386[_0xf2e0('0xa9')][_0xf2e0('0xab')]){delete _0x592386[_0xf2e0('0xa9')][_0xf2e0('0xab')];}return rp(_0x592386);})[_0xf2e0('0x2d')](function(_0x59f071){if(_0x59f071){_0xa36e44[_0xf2e0('0x29')](_0x59f071[_0xf2e0('0xa9')]);logger[_0xf2e0('0x68')](_0x59f071[_0xf2e0('0x93')]);if(_[_0xf2e0('0xac')](_0x26148f[_0xf2e0('0x3b')][_0xf2e0('0x6')],'download')&&_0x59f071['statusCode']==0x1f4){return _0xa36e44[_0xf2e0('0x21')](_0x59f071['statusCode']);}else{return _0xa36e44[_0xf2e0('0x22')](_0x59f071['statusCode'])[_0xf2e0('0x34')](_0x59f071[_0xf2e0('0x93')]);}}else{return _0xa36e44[_0xf2e0('0x21')](0xc8);}})[_0xf2e0('0x52')](handleError(_0xa36e44,null));};exports[_0xf2e0('0xad')]=function(_0x3787ac,_0xb6e658,_0x9045e1){return BPromise[_0xf2e0('0xa2')]()[_0xf2e0('0x2d')](function(){if(!_0x3787ac[_0xf2e0('0x3b')][_0xf2e0('0x6')]){throw new Error(_0xf2e0('0xae'));}if(!_0x3787ac[_0xf2e0('0x3b')][_0xf2e0('0xa3')]){throw new Error(_0xf2e0('0xa4'));}var _0x28a536=_0x3787ac[_0xf2e0('0x3b')][_0xf2e0('0xa5')]?_0x3787ac['query']['hostname']+':'+_0x3787ac['query'][_0xf2e0('0xa3')]:_0xf2e0('0xa6')+_0x3787ac['query']['port'];var _0x517fdb=_0x3787ac[_0xf2e0('0x3b')][_0xf2e0('0x24')]?_0x3787ac['query'][_0xf2e0('0x24')]:!![];var _0x29b1ce=_0x3787ac[_0xf2e0('0x3b')][_0xf2e0('0xa7')]?_0x3787ac[_0xf2e0('0x3b')][_0xf2e0('0xa7')]:null;var _0x421878={'method':_0x3787ac[_0xf2e0('0xaf')],'uri':util[_0xf2e0('0x57')](_0xf2e0('0xa8'),_0x28a536,_0x3787ac[_0xf2e0('0x3b')][_0xf2e0('0x6')]),'json':_0x517fdb,'resolveWithFullResponse':!![],'encoding':_0x29b1ce,'body':_0x3787ac[_0xf2e0('0x93')]};if(_0x3787ac[_0xf2e0('0xa9')]){_0x421878[_0xf2e0('0xa9')]=_0x3787ac[_0xf2e0('0xa9')];if(_0x421878[_0xf2e0('0xa9')][_0xf2e0('0xaa')]){delete _0x421878[_0xf2e0('0xa9')][_0xf2e0('0xaa')];}}if(_0x421878[_0xf2e0('0xa9')][_0xf2e0('0xab')]){delete _0x421878[_0xf2e0('0xa9')][_0xf2e0('0xab')];}return rp(_0x421878);})[_0xf2e0('0x2d')](function(_0x5dd94b){if(_0x5dd94b){_0xb6e658['set'](_0x5dd94b['headers']);logger[_0xf2e0('0x68')](_0x5dd94b[_0xf2e0('0x93')]);return _0xb6e658['status'](_0x5dd94b[_0xf2e0('0xb0')])['send'](_0x5dd94b[_0xf2e0('0x93')]);}else{return _0xb6e658['sendStatus'](0xc8);}})['catch'](handleError(_0xb6e658,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 0c4d8b3..6b635a0 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 _0xe015=['update','emit','hasOwnProperty','events','../../mysqldb','Plugin'];(function(_0x41159e,_0x1e07a3){var _0x5a3d18=function(_0x21316d){while(--_0x21316d){_0x41159e['push'](_0x41159e['shift']());}};_0x5a3d18(++_0x1e07a3);}(_0xe015,0x13b));var _0x5e01=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xe015[_0x465028];return _0xb783d4;};'use strict';var EventEmitter=require(_0x5e01('0x0'));var Plugin=require(_0x5e01('0x1'))['db'][_0x5e01('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5e01('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2136cf){return function(_0x420f00,_0x7ce4b9,_0x241c0e){PluginEvents['emit'](_0x2136cf+':'+_0x420f00['id'],_0x420f00);PluginEvents[_0x5e01('0x4')](_0x2136cf,_0x420f00);_0x241c0e(null);};}for(var e in events){if(events[_0x5e01('0x5')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0xdbf5=['emit','hasOwnProperty','hook','exports','../../mysqldb','save','update','remove'];(function(_0x377a6e,_0x59b99d){var _0x37f751=function(_0x2ed25c){while(--_0x2ed25c){_0x377a6e['push'](_0x377a6e['shift']());}};_0x37f751(++_0x59b99d);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x35951b,_0x29a225){_0x35951b=_0x35951b-0x0;var _0x5d2ddd=_0xdbf5[_0x35951b];return _0x5d2ddd;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x5dbf('0x0'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5dbf('0x1'),'afterUpdate':_0x5dbf('0x2'),'afterDestroy':_0x5dbf('0x3')};function emitEvent(_0x3afe14){return function(_0x38b629,_0x1a1ea9,_0x776036){PluginEvents[_0x5dbf('0x4')](_0x3afe14+':'+_0x38b629['id'],_0x38b629);PluginEvents[_0x5dbf('0x4')](_0x3afe14,_0x38b629);_0x776036(null);};}for(var e in events){if(events[_0x5dbf('0x5')](e)){var event=events[e];Plugin[_0x5dbf('0x6')](e,emitEvent(event));}}module[_0x5dbf('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index ee90659..c1b0e42 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 _0x64a1=['../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x4cc430,_0x266e77){var _0xfaaf65=function(_0x5add12){while(--_0x5add12){_0x4cc430['push'](_0x4cc430['shift']());}};_0xfaaf65(++_0x266e77);}(_0x64a1,0x13e));var _0x164a=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x64a1[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0x164a('0x0'));var util=require(_0x164a('0x1'));var logger=require(_0x164a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x164a('0x3'));var rp=require(_0x164a('0x4'));var fs=require('fs');var path=require(_0x164a('0x5'));var rimraf=require('rimraf');var config=require(_0x164a('0x6'));var attributes=require(_0x164a('0x7'));module[_0x164a('0x8')]=function(_0x34f70e,_0x576f6f){return _0x34f70e[_0x164a('0x9')](_0x164a('0xa'),attributes,{'tableName':_0x164a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50a7=['exports','define','Plugin','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes'];(function(_0x4a289e,_0x50241f){var _0x3071dc=function(_0x40abea){while(--_0x40abea){_0x4a289e['push'](_0x4a289e['shift']());}};_0x3071dc(++_0x50241f);}(_0x50a7,0x155));var _0x750a=function(_0x50148e,_0x4c99c7){_0x50148e=_0x50148e-0x0;var _0x446e9d=_0x50a7[_0x50148e];return _0x446e9d;};'use strict';var _=require('lodash');var util=require(_0x750a('0x0'));var logger=require(_0x750a('0x1'))(_0x750a('0x2'));var moment=require(_0x750a('0x3'));var BPromise=require(_0x750a('0x4'));var rp=require(_0x750a('0x5'));var fs=require('fs');var path=require(_0x750a('0x6'));var rimraf=require(_0x750a('0x7'));var config=require(_0x750a('0x8'));var attributes=require(_0x750a('0x9'));module[_0x750a('0xa')]=function(_0x15f6bf,_0x527e3a){return _0x15f6bf[_0x750a('0xb')](_0x750a('0xc'),attributes,{'tableName':'plugins','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 c2db0f7..0123b6a 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 _0xab01=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreatePlugin','options','raw','debug','catch','util','moment'];(function(_0x2bfe52,_0x43946e){var _0x1cf649=function(_0xc8300c){while(--_0xc8300c){_0x2bfe52['push'](_0x2bfe52['shift']());}};_0x1cf649(++_0x43946e);}(_0xab01,0x99));var _0x1ab0=function(_0xa042a2,_0x59f0b9){_0xa042a2=_0xa042a2-0x0;var _0x398132=_0xab01[_0xa042a2];return _0x398132;};'use strict';var _=require('lodash');var util=require(_0x1ab0('0x0'));var moment=require(_0x1ab0('0x1'));var BPromise=require('bluebird');var rs=require(_0x1ab0('0x2'));var fs=require('fs');var Redis=require(_0x1ab0('0x3'));var db=require(_0x1ab0('0x4'))['db'];var utils=require(_0x1ab0('0x5'));var logger=require(_0x1ab0('0x6'))(_0x1ab0('0x7'));var config=require(_0x1ab0('0x8'));var jayson=require(_0x1ab0('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x1ab0('0xa')](config[_0x1ab0('0xb')],{'host':_0x1ab0('0xc'),'port':0x18eb});var socket=require(_0x1ab0('0xd'))(new Redis(config[_0x1ab0('0xb')]));require(_0x1ab0('0xe'))[_0x1ab0('0xf')](socket);function respondWithRpcPromise(_0x17f5e3,_0x31ac41,_0x54e133){return new BPromise(function(_0x1759e9,_0x55c100){return client[_0x1ab0('0x10')](_0x17f5e3,_0x54e133)[_0x1ab0('0x11')](function(_0x3a4582){logger[_0x1ab0('0x12')](_0x1ab0('0x13'),_0x31ac41,_0x1ab0('0x14'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x31ac41,'request\x20sent',JSON[_0x1ab0('0x15')](_0x3a4582));if(_0x3a4582[_0x1ab0('0x16')]){if(_0x3a4582[_0x1ab0('0x16')][_0x1ab0('0x17')]===0x1f4){logger[_0x1ab0('0x16')]('Plugin,\x20%s,\x20%s',_0x31ac41,_0x3a4582['error'][_0x1ab0('0x18')]);return _0x55c100(_0x3a4582[_0x1ab0('0x16')][_0x1ab0('0x18')]);}logger[_0x1ab0('0x16')]('Plugin,\x20%s,\x20%s',_0x31ac41,_0x3a4582[_0x1ab0('0x16')][_0x1ab0('0x18')]);return _0x1759e9(_0x3a4582[_0x1ab0('0x16')][_0x1ab0('0x18')]);}else{logger[_0x1ab0('0x12')](_0x1ab0('0x13'),_0x31ac41,_0x1ab0('0x14'));_0x1759e9(_0x3a4582[_0x1ab0('0x19')][_0x1ab0('0x18')]);}})['catch'](function(_0x22af64){logger[_0x1ab0('0x16')](_0x1ab0('0x13'),_0x31ac41,_0x22af64);_0x55c100(_0x22af64);});});}exports[_0x1ab0('0x1a')]=function(_0x3d1744){var _0xb6f234=this;return new Promise(function(_0x3f50f0,_0x59f2d6){return db['Plugin']['create'](_0x3d1744['body'],{'raw':_0x3d1744[_0x1ab0('0x1b')]?_0x3d1744['options'][_0x1ab0('0x1c')]===undefined?!![]:![]:!![]})[_0x1ab0('0x11')](function(_0x416d1d){logger[_0x1ab0('0x12')](_0x1ab0('0x1a'),_0x3d1744);logger[_0x1ab0('0x1d')]('CreatePlugin',_0x3d1744,JSON[_0x1ab0('0x15')](_0x416d1d));_0x3f50f0(_0x416d1d);})[_0x1ab0('0x1e')](function(_0x5294a4){logger[_0x1ab0('0x16')](_0x1ab0('0x1a'),_0x5294a4['message'],_0x3d1744);_0x59f2d6(_0xb6f234[_0x1ab0('0x16')](0x1f4,_0x5294a4[_0x1ab0('0x18')]));});});}; \ No newline at end of file +var _0xed3a=['localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Plugin','create','body','options','raw','CreatePlugin','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults'];(function(_0x4f3056,_0xe685f6){var _0x2b8af0=function(_0x3e04c2){while(--_0x3e04c2){_0x4f3056['push'](_0x4f3056['shift']());}};_0x2b8af0(++_0xe685f6);}(_0xed3a,0x175));var _0xaed3=function(_0x236961,_0x204ec5){_0x236961=_0x236961-0x0;var _0x1f9a93=_0xed3a[_0x236961];return _0x1f9a93;};'use strict';var _=require(_0xaed3('0x0'));var util=require(_0xaed3('0x1'));var moment=require(_0xaed3('0x2'));var BPromise=require(_0xaed3('0x3'));var rs=require(_0xaed3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaed3('0x5'));var logger=require(_0xaed3('0x6'))(_0xaed3('0x7'));var config=require(_0xaed3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaed3('0x9')]['http']({'port':0x232a});config[_0xaed3('0xa')]=_[_0xaed3('0xb')](config[_0xaed3('0xa')],{'host':_0xaed3('0xc'),'port':0x18eb});var socket=require(_0xaed3('0xd'))(new Redis(config[_0xaed3('0xa')]));require(_0xaed3('0xe'))[_0xaed3('0xf')](socket);function respondWithRpcPromise(_0x4c17e0,_0x40098d,_0x25e1ed){return new BPromise(function(_0x3beee0,_0x4db6cc){return client[_0xaed3('0x10')](_0x4c17e0,_0x25e1ed)[_0xaed3('0x11')](function(_0x1169ef){logger[_0xaed3('0x12')](_0xaed3('0x13'),_0x40098d,_0xaed3('0x14'));logger[_0xaed3('0x15')](_0xaed3('0x16'),_0x40098d,_0xaed3('0x14'),JSON[_0xaed3('0x17')](_0x1169ef));if(_0x1169ef[_0xaed3('0x18')]){if(_0x1169ef[_0xaed3('0x18')][_0xaed3('0x19')]===0x1f4){logger[_0xaed3('0x18')](_0xaed3('0x13'),_0x40098d,_0x1169ef[_0xaed3('0x18')][_0xaed3('0x1a')]);return _0x4db6cc(_0x1169ef['error'][_0xaed3('0x1a')]);}logger[_0xaed3('0x18')](_0xaed3('0x13'),_0x40098d,_0x1169ef[_0xaed3('0x18')][_0xaed3('0x1a')]);return _0x3beee0(_0x1169ef[_0xaed3('0x18')][_0xaed3('0x1a')]);}else{logger[_0xaed3('0x12')](_0xaed3('0x13'),_0x40098d,_0xaed3('0x14'));_0x3beee0(_0x1169ef[_0xaed3('0x1b')][_0xaed3('0x1a')]);}})[_0xaed3('0x1c')](function(_0x22be78){logger['error'](_0xaed3('0x13'),_0x40098d,_0x22be78);_0x4db6cc(_0x22be78);});});}exports['CreatePlugin']=function(_0x3b47bd){var _0x54b2db=this;return new Promise(function(_0x370eae,_0x164dba){return db[_0xaed3('0x1d')][_0xaed3('0x1e')](_0x3b47bd[_0xaed3('0x1f')],{'raw':_0x3b47bd[_0xaed3('0x20')]?_0x3b47bd['options'][_0xaed3('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x133c0b){logger[_0xaed3('0x12')](_0xaed3('0x22'),_0x3b47bd);logger[_0xaed3('0x15')](_0xaed3('0x22'),_0x3b47bd,JSON[_0xaed3('0x17')](_0x133c0b));_0x370eae(_0x133c0b);})['catch'](function(_0x29cc56){logger[_0xaed3('0x18')](_0xaed3('0x22'),_0x29cc56[_0xaed3('0x1a')],_0x3b47bd);_0x164dba(_0x54b2db[_0xaed3('0x18')](0x1f4,_0x29cc56[_0xaed3('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 1b3df48..1a5558d 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 _0x063a=['update','emit','removeListener','register','./plugin.events','remove'];(function(_0x271801,_0x5ea1f6){var _0x119da4=function(_0x4c9910){while(--_0x4c9910){_0x271801['push'](_0x271801['shift']());}};_0x119da4(++_0x5ea1f6);}(_0x063a,0xa6));var _0xa063=function(_0x195988,_0x3062be){_0x195988=_0x195988-0x0;var _0x2da5e4=_0x063a[_0x195988];return _0x2da5e4;};'use strict';var PluginEvents=require(_0xa063('0x0'));var events=['save',_0xa063('0x1'),_0xa063('0x2')];function createListener(_0x96272f,_0x33c241){return function(_0x44173c){_0x33c241[_0xa063('0x3')](_0x96272f,_0x44173c);};}function removeListener(_0x5cf50c,_0x18ddf0){return function(){PluginEvents[_0xa063('0x4')](_0x5cf50c,_0x18ddf0);};}exports[_0xa063('0x5')]=function(_0xd2a15d){for(var _0x49ff03=0x0,_0x4011b9=events['length'];_0x49ff03<_0x4011b9;_0x49ff03++){var _0x438cbd=events[_0x49ff03];var _0x225268=createListener('plugin:'+_0x438cbd,_0xd2a15d);PluginEvents['on'](_0x438cbd,_0x225268);}}; \ No newline at end of file +var _0xd8f8=['removeListener','register','plugin:','./plugin.events','save','remove','update','emit'];(function(_0x404d9c,_0x596b0f){var _0x289bb5=function(_0x1e41c1){while(--_0x1e41c1){_0x404d9c['push'](_0x404d9c['shift']());}};_0x289bb5(++_0x596b0f);}(_0xd8f8,0x1eb));var _0x8d8f=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xd8f8[_0x46e363];return _0x3fb059;};'use strict';var PluginEvents=require(_0x8d8f('0x0'));var events=[_0x8d8f('0x1'),_0x8d8f('0x2'),_0x8d8f('0x3')];function createListener(_0x3734c9,_0x28c35d){return function(_0x4616ad){_0x28c35d[_0x8d8f('0x4')](_0x3734c9,_0x4616ad);};}function removeListener(_0x4c54d4,_0x2d4344){return function(){PluginEvents[_0x8d8f('0x5')](_0x4c54d4,_0x2d4344);};}exports[_0x8d8f('0x6')]=function(_0x2b6abf){for(var _0x39f56e=0x0,_0xe2c9d9=events['length'];_0x39f56e<_0xe2c9d9;_0x39f56e++){var _0x2b9495=events[_0x39f56e];var _0x396f70=createListener(_0x8d8f('0x7')+_0x2b9495,_0x2b6abf);PluginEvents['on'](_0x2b9495,_0x396f70);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index cdb6e23..d5dd941 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(_0x23479d,_0x4b876c){var _0x587452=function(_0x2b7653){while(--_0x2b7653){_0x23479d['push'](_0x23479d['shift']());}};_0x587452(++_0x4b876c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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(_0x5339bd,_0x2b40ff){var _0x43a81e=function(_0x358306){while(--_0x358306){_0x5339bd['push'](_0x5339bd['shift']());}};_0x43a81e(++_0x2b40ff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 1b4db64..bdb9b39 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 _0x579c=['express','catch','show','describe','params','body','script','join','../../files/plugins','cwd','chdir','dirname','start','status','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','exec','sendStatus','json','error','stack','name','send','npm\x20install','info','index','then'];(function(_0x11b4bc,_0x5e095d){var _0x30eb89=function(_0x250bf9){while(--_0x250bf9){_0x11b4bc['push'](_0x11b4bc['shift']());}};_0x30eb89(++_0x5e095d);}(_0x579c,0xda));var _0xc579=function(_0x3079a6,_0x4c0bf2){_0x3079a6=_0x3079a6-0x0;var _0x55cc26=_0x579c[_0x3079a6];return _0x55cc26;};'use strict';var _=require(_0xc579('0x0'));var pm2=require(_0xc579('0x1'));var logger=require(_0xc579('0x2'))(_0xc579('0x3'));var path=require(_0xc579('0x4'));var exec=require('child_process')[_0xc579('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x21a0a2,_0x3b913c){return function(_0x1ce62b){if(!_0x1ce62b){_0x21a0a2[_0xc579('0x6')](0x194);;}return _0x1ce62b;};}function respondWithResult(_0x124ee5,_0x1bd276){_0x1bd276=_0x1bd276||0xc8;return function(_0x2e451b){if(_0x2e451b){return _0x124ee5['status'](_0x1bd276)[_0xc579('0x7')](_0x2e451b);}return null;};}function handleError(_0x293c4a,_0x2ce949){_0x2ce949=_0x2ce949||0x1f4;return function(_0x2361fc){logger[_0xc579('0x8')](_0x2361fc[_0xc579('0x9')]);if(_0x2361fc[_0xc579('0xa')]){delete _0x2361fc[_0xc579('0xa')];}_0x293c4a['status'](_0x2ce949)[_0xc579('0xb')](_0x2361fc);};}function execChildProcess(){return new BPromise(function(_0x2048bc,_0x17e37f){exec(_0xc579('0xc'),function(_0x9e3fd3,_0x4577a2,_0x2a8e70){logger[_0xc579('0xd')](_0x4577a2);logger[_0xc579('0xd')](_0x2a8e70);if(_0x9e3fd3){logger[_0xc579('0x8')](_0x9e3fd3);return _0x17e37f(_0x9e3fd3);}return _0x2048bc(_0x4577a2);});});}exports[_0xc579('0xe')]=function(_0x4ac675,_0x177314){return pm2['list']()[_0xc579('0xf')](function(_0x59243e){if(_0x59243e){var _0x424e15=_['reject'](_0x59243e,function(_0x44cd32){return _0x44cd32['name']===_0xc579('0x10')||_0x44cd32[_0xc579('0xa')]==='motion2';});return{'rows':_0x424e15,'count':_0x424e15['length']};}return null;})[_0xc579('0xf')](respondWithResult(_0x177314,null))[_0xc579('0x11')](handleError(_0x177314,null));};exports[_0xc579('0x12')]=function(_0x414ee7,_0x7d5865){return pm2[_0xc579('0x13')](_0x414ee7[_0xc579('0x14')]['id'])[_0xc579('0xf')](respondWithResult(_0x7d5865,null))[_0xc579('0xf')](handleEntityNotFound(_0x7d5865,null))[_0xc579('0x11')](handleError(_0x7d5865,null));};exports['create']=function(_0x463f5e,_0x2b7d74){if(_0x463f5e['body'][_0xc579('0xa')]&&_0x463f5e[_0xc579('0x15')][_0xc579('0x16')]){var _0x6501bc=path[_0xc579('0x17')](__dirname,_0xc579('0x18'),_0x463f5e[_0xc579('0x15')][_0xc579('0x16')]);var _0x55781e=process[_0xc579('0x19')]();process[_0xc579('0x1a')](path[_0xc579('0x1b')](_0x6501bc));return execChildProcess()[_0xc579('0xf')](function(_0x1da86e){process['chdir'](_0x55781e);return pm2[_0xc579('0x1c')]({'name':_0x463f5e[_0xc579('0x15')][_0xc579('0xa')],'script':_0x6501bc});})['then'](function(_0x45e1ac){pm2['dump']();return _0x45e1ac[0x0];})[_0xc579('0xf')](respondWithResult(_0x2b7d74,0xc9))[_0xc579('0x11')](handleError(_0x2b7d74,null));}else{return _0x2b7d74[_0xc579('0x1d')](0x1f4)['send']({'message':_0xc579('0x1e')});}};exports['update']=function(_0x532b33,_0x56439a){if(_0x532b33[_0xc579('0x15')]['id']){delete _0x532b33[_0xc579('0x15')]['id'];}var _0xfdbb73={'online':_0xc579('0x1f'),'stopped':_0xc579('0x20')};if(_0xfdbb73[_0xc579('0x21')](_0x532b33[_0xc579('0x15')]['status'])){return pm2[_0xfdbb73[_0x532b33['body'][_0xc579('0x1d')]]](_0x532b33['params']['id'])[_0xc579('0xf')](respondWithResult(_0x56439a,0xc8))[_0xc579('0x11')](handleError(_0x56439a,null));}else{return _0x56439a[_0xc579('0x1d')](0x1f4)[_0xc579('0xb')]({'message':_0xc579('0x22')});}};exports[_0xc579('0x23')]=function(_0x45e6a3,_0x133d08){if(_0x45e6a3['body']['id']){delete _0x45e6a3[_0xc579('0x15')]['id'];}if(_0x45e6a3[_0xc579('0x14')]['id']){return pm2[_0xc579('0x24')](_0x45e6a3[_0xc579('0x14')]['id'])['then'](function(_0x57299e){pm2[_0xc579('0x25')]();return _0x57299e[0x0];})['then'](respondWithResult(_0x133d08,null))[_0xc579('0x11')](handleError(_0x133d08,null));}else{return _0x133d08[_0xc579('0x1d')](0x1f4)[_0xc579('0xb')]({'message':_0xc579('0x26')});}}; \ No newline at end of file +var _0x9aea=['join','../../files/plugins','start','dump','Missing\x20name\x20and/or\x20path','update','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/logger','path','child_process','bluebird','sendStatus','status','error','stack','name','send','info','index','list','then','express','motion2','length','catch','show','params','create','body','script'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9aea,0xdd));var _0xa9ae=function(_0xa9b079,_0x231dca){_0xa9b079=_0xa9b079-0x0;var _0x20a579=_0x9aea[_0xa9b079];return _0x20a579;};'use strict';var _=require(_0xa9ae('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xa9ae('0x1'))('api');var path=require(_0xa9ae('0x2'));var exec=require(_0xa9ae('0x3'))['exec'];var BPromise=require(_0xa9ae('0x4'));function handleEntityNotFound(_0x115593,_0x41fb71){return function(_0x10f91d){if(!_0x10f91d){_0x115593[_0xa9ae('0x5')](0x194);;}return _0x10f91d;};}function respondWithResult(_0x56f942,_0x1aa3b9){_0x1aa3b9=_0x1aa3b9||0xc8;return function(_0x22734b){if(_0x22734b){return _0x56f942[_0xa9ae('0x6')](_0x1aa3b9)['json'](_0x22734b);}return null;};}function handleError(_0x1f2e4b,_0x3917f0){_0x3917f0=_0x3917f0||0x1f4;return function(_0x465bd2){logger[_0xa9ae('0x7')](_0x465bd2[_0xa9ae('0x8')]);if(_0x465bd2[_0xa9ae('0x9')]){delete _0x465bd2[_0xa9ae('0x9')];}_0x1f2e4b[_0xa9ae('0x6')](_0x3917f0)[_0xa9ae('0xa')](_0x465bd2);};}function execChildProcess(){return new BPromise(function(_0x5a8178,_0x3d400c){exec('npm\x20install',function(_0x2addd2,_0x226cf7,_0x112ab5){logger[_0xa9ae('0xb')](_0x226cf7);logger[_0xa9ae('0xb')](_0x112ab5);if(_0x2addd2){logger[_0xa9ae('0x7')](_0x2addd2);return _0x3d400c(_0x2addd2);}return _0x5a8178(_0x226cf7);});});}exports[_0xa9ae('0xc')]=function(_0x2b511a,_0x56de45){return pm2[_0xa9ae('0xd')]()[_0xa9ae('0xe')](function(_0x10882e){if(_0x10882e){var _0x3f7f61=_['reject'](_0x10882e,function(_0x28ce2d){return _0x28ce2d[_0xa9ae('0x9')]===_0xa9ae('0xf')||_0x28ce2d[_0xa9ae('0x9')]===_0xa9ae('0x10');});return{'rows':_0x3f7f61,'count':_0x3f7f61[_0xa9ae('0x11')]};}return null;})['then'](respondWithResult(_0x56de45,null))[_0xa9ae('0x12')](handleError(_0x56de45,null));};exports[_0xa9ae('0x13')]=function(_0x3e31d9,_0x4ac5a6){return pm2['describe'](_0x3e31d9[_0xa9ae('0x14')]['id'])['then'](respondWithResult(_0x4ac5a6,null))['then'](handleEntityNotFound(_0x4ac5a6,null))[_0xa9ae('0x12')](handleError(_0x4ac5a6,null));};exports[_0xa9ae('0x15')]=function(_0xbfd2ff,_0x42f961){if(_0xbfd2ff['body'][_0xa9ae('0x9')]&&_0xbfd2ff[_0xa9ae('0x16')][_0xa9ae('0x17')]){var _0x688153=path[_0xa9ae('0x18')](__dirname,_0xa9ae('0x19'),_0xbfd2ff[_0xa9ae('0x16')]['script']);var _0xc021cf=process['cwd']();process['chdir'](path['dirname'](_0x688153));return execChildProcess()['then'](function(_0x1afd07){process['chdir'](_0xc021cf);return pm2[_0xa9ae('0x1a')]({'name':_0xbfd2ff['body'][_0xa9ae('0x9')],'script':_0x688153});})[_0xa9ae('0xe')](function(_0x93d637){pm2[_0xa9ae('0x1b')]();return _0x93d637[0x0];})[_0xa9ae('0xe')](respondWithResult(_0x42f961,0xc9))[_0xa9ae('0x12')](handleError(_0x42f961,null));}else{return _0x42f961[_0xa9ae('0x6')](0x1f4)['send']({'message':_0xa9ae('0x1c')});}};exports[_0xa9ae('0x1d')]=function(_0x2aac9e,_0xfe9ef1){if(_0x2aac9e[_0xa9ae('0x16')]['id']){delete _0x2aac9e[_0xa9ae('0x16')]['id'];}var _0xb12fa8={'online':'restart','stopped':'stop'};if(_0xb12fa8[_0xa9ae('0x1e')](_0x2aac9e[_0xa9ae('0x16')][_0xa9ae('0x6')])){return pm2[_0xb12fa8[_0x2aac9e[_0xa9ae('0x16')][_0xa9ae('0x6')]]](_0x2aac9e['params']['id'])['then'](respondWithResult(_0xfe9ef1,0xc8))[_0xa9ae('0x12')](handleError(_0xfe9ef1,null));}else{return _0xfe9ef1[_0xa9ae('0x6')](0x1f4)[_0xa9ae('0xa')]({'message':_0xa9ae('0x1f')});}};exports[_0xa9ae('0x20')]=function(_0x36bc28,_0x5d0c84){if(_0x36bc28['body']['id']){delete _0x36bc28[_0xa9ae('0x16')]['id'];}if(_0x36bc28[_0xa9ae('0x14')]['id']){return pm2[_0xa9ae('0x21')](_0x36bc28[_0xa9ae('0x14')]['id'])[_0xa9ae('0xe')](function(_0x231152){pm2[_0xa9ae('0x1b')]();return _0x231152[0x0];})[_0xa9ae('0xe')](respondWithResult(_0x5d0c84,null))['catch'](handleError(_0x5d0c84,null));}else{return _0x5d0c84[_0xa9ae('0x6')](0x1f4)['send']({'message':_0xa9ae('0x22')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index c70c2ab..88b5b4f 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 _0x164b=['getAgents','getQueues','exports','Router','./realtime.controller','get','/agents','isAuthenticated'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x164b,0x7b));var _0xb164=function(_0x51e1d5,_0x399588){_0x51e1d5=_0x51e1d5-0x0;var _0x105666=_0x164b[_0x51e1d5];return _0x105666;};'use strict';var express=require('express');var router=express[_0xb164('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xb164('0x1'));router[_0xb164('0x2')](_0xb164('0x3'),auth[_0xb164('0x4')](),controller[_0xb164('0x5')]);router[_0xb164('0x2')]('/queues',auth[_0xb164('0x4')](),controller[_0xb164('0x6')]);module[_0xb164('0x7')]=router; \ No newline at end of file +var _0xdc6a=['getQueues','exports','express','Router','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xdc6a,0x107));var _0xadc6=function(_0x45cb3a,_0x1c902e){_0x45cb3a=_0x45cb3a-0x0;var _0x4902a5=_0xdc6a[_0x45cb3a];return _0x4902a5;};'use strict';var express=require(_0xadc6('0x0'));var router=express[_0xadc6('0x1')]();var auth=require(_0xadc6('0x2'));var controller=require(_0xadc6('0x3'));router[_0xadc6('0x4')](_0xadc6('0x5'),auth[_0xadc6('0x6')](),controller['getAgents']);router[_0xadc6('0x4')]('/queues',auth['isAuthenticated'](),controller[_0xadc6('0x7')]);module[_0xadc6('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 22a7c32..ecffd0b 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 _0x8321=['getAgentStatus','globalStatus','Status','sortAgentsByStatus','pick','catch','getQueues','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','Queue','name','voice','dialActive','dialMethod','userProfileId','outbound','QueueCampaigns','filter','UserProfile','getRealtimeQueues','initializeQueues','util','../../components/realtime/queues','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','handleError','offset','limit','undefined','count','status','set','json','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','then','format','channel','toLowerCase','sort','includes','validateSortParameter','getUpdatedSortOptions','fields','join','order','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','type','key','role','agent','online','getOptions','raw','push','sequelize','literal','FIELD(id,','forEach','Pause','merge','where','user','Agents','extraQueryConditions','getResources','findAndCountAll','find','filterAgentAttributes'];(function(_0x3d8ddb,_0x2cd68f){var _0x4010d3=function(_0x415ce5){while(--_0x415ce5){_0x3d8ddb['push'](_0x3d8ddb['shift']());}};_0x4010d3(++_0x2cd68f);}(_0x8321,0xbf));var _0x1832=function(_0x504ceb,_0xec7924){_0x504ceb=_0x504ceb-0x0;var _0x2ff29f=_0x8321[_0x504ceb];return _0x2ff29f;};'use strict';var _=require('lodash');var util=require(_0x1832('0x0'));var rta=require('../../components/realtime/agents');var rtq=require(_0x1832('0x1'));var qs=require('../../components/parsers/qs');var utils=require(_0x1832('0x2'));var db=require(_0x1832('0x3'))['db'];var APIBadRequestError=require(_0x1832('0x4'))[_0x1832('0x5')];var APIHandleError=require('../../errors/api')[_0x1832('0x6')];function respondWithFilteredResult(_0x16a33d,_0x5ab77f){return function(_0xb4f6e2){if(_0xb4f6e2){var _0x229cce=typeof _0x5ab77f[_0x1832('0x7')]==='undefined'&&typeof _0x5ab77f[_0x1832('0x8')]===_0x1832('0x9');var _0x1ad647=_0xb4f6e2['count'];var _0x1d47ef=_0x229cce?0x0:_0x5ab77f[_0x1832('0x7')];var _0x2bc069=_0x229cce?_0xb4f6e2[_0x1832('0xa')]:_0x5ab77f[_0x1832('0x7')]+_0x5ab77f['limit'];var _0x58ad6b;if(_0x2bc069>=_0x1ad647){_0x2bc069=_0x1ad647;_0x58ad6b=0xc8;}else{_0x58ad6b=0xce;}_0x16a33d[_0x1832('0xb')](_0x58ad6b);return _0x16a33d[_0x1832('0xc')]('Content-Range',_0x1d47ef+'-'+_0x2bc069+'/'+_0x1ad647)[_0x1832('0xd')](_0xb4f6e2);}return null;};}exports['getAgents']=function(_0xd5646e,_0x360baf){var _0x15d5ed={'count':0x0,'rows':[]};var _0x2804ec={};var _0x5dece4;var _0x111115=utils[_0x1832('0xe')]();var _0x538a0a;var _0x4d7f25;var _0x39fc0f=_0xd5646e[_0x1832('0xf')][_0x1832('0x10')];var _0x1590aa=_0xd5646e[_0x1832('0xf')][_0x1832('0x11')];var _0x122dba=_0xd5646e['query'][_0x1832('0x12')];var _0x5d4b94=_0x1590aa===_0x1832('0x13')||_0x1590aa===_0x1832('0x14')?!![]:![];var _0x3d6236=[];var _0x32f07f;var _0x3b61de;Promise[_0x1832('0x15')]()[_0x1832('0x16')](function(){if(_0xd5646e[_0x1832('0xf')]['channel']){if(!utils['isValidChannel'](_0xd5646e[_0x1832('0xf')]['channel'])){throw new APIBadRequestError(util[_0x1832('0x17')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0xd5646e[_0x1832('0xf')][_0x1832('0x18')]));}_0x5dece4=_0xd5646e[_0x1832('0xf')][_0x1832('0x18')][_0x1832('0x19')]();}if(!_0xd5646e[_0x1832('0xf')][_0x1832('0x1a')]||!_0xd5646e[_0x1832('0xf')]['sort'][_0x1832('0x1b')]('globalStatus')){_0xd5646e[_0x1832('0xf')][_0x1832('0x1a')]=rta[_0x1832('0x1c')](_0xd5646e[_0x1832('0xf')]['sort']);return;}var _0x636331=rta[_0x1832('0x1d')](_0xd5646e[_0x1832('0xf')][_0x1832('0x1a')]);_0xd5646e[_0x1832('0xf')][_0x1832('0x1a')]=_0x636331[_0x1832('0x1e')][_0x1832('0x1f')](',');_0x32f07f=_0x636331[_0x1832('0x20')];})[_0x1832('0x16')](function(){if(!_0x39fc0f){return[];}return rta['getAgentIdsByQueues'](_0x39fc0f,_0x5dece4);})[_0x1832('0x16')](function(_0x41f7f2){_0x3d6236=_0x41f7f2;return rta[_0x1832('0x21')]();})[_0x1832('0x16')](function(_0x30066d){_0x4d7f25=_0x30066d[_0x1832('0x22')];if((!_0x1590aa||_0x5d4b94)&&!_0x32f07f){return _0x3d6236;}if(_0x32f07f&&!_0x1590aa){return rta[_0x1832('0x23')](_0x4d7f25,_0x3d6236,_0x32f07f);}else{return rta[_0x1832('0x24')](_0x4d7f25,_0x3d6236,_0x1590aa);}})[_0x1832('0x16')](function(_0x4a7976){_0x3d6236=_0x4a7976;var _0x1fe455=![];if(_0x3d6236[_0x1832('0x25')]===0x0){if(_0x39fc0f||_0x1590aa){_0x1fe455=!![];}if(_0x5d4b94){_0x1fe455=![];}}if(_0x1fe455){return _0x15d5ed;}var _0x22f67e=_[_0x1832('0x26')](db[_0x1832('0x27')][_0x1832('0x28')],function(_0x5d3a9f){return{'name':_0x5d3a9f[_0x1832('0x29')],'type':_0x5d3a9f[_0x1832('0x2a')][_0x1832('0x2b')]};});_0xd5646e[_0x1832('0xf')][_0x1832('0x2c')]=_0x1832('0x2d');_0xd5646e['query'][_0x1832('0x2e')]=!![];_0x2804ec=qs[_0x1832('0x2f')](_0x22f67e,_0xd5646e);_0x2804ec[_0x1832('0x30')]=!![];var _0x474259=[];if(_0x3d6236['length']>0x0){_0x474259[_0x1832('0x31')]({'id':{'$in':_0x3d6236}});if(_0x32f07f&&!_0x1590aa){_0x3b61de=[db[_0x1832('0x32')][_0x1832('0x33')](_0x1832('0x34')+_0x3d6236+')')];_0x2804ec[_0x1832('0x20')]=_0x3b61de;}}if(_0x5d4b94){_0x111115[_0x1832('0x35')](function(_0x3a6048){var _0x3d10de=!![];if(_0x1590aa===_0x1832('0x14')&&_0x5dece4!==_0x3a6048){_0x3d10de=![];}_0x474259['push']({[_0x3a6048+_0x1832('0x36')]:_0x3d10de});});if(_0x122dba){_0x474259[_0x1832('0x31')]({'pauseType':_0x122dba});}}else if(_0x1590aa){_0x111115[_0x1832('0x35')](function(_0x2c9c2e){_0x474259['push']({[_0x2c9c2e+'Pause']:![]});});}_0x2804ec['where']=_[_0x1832('0x37')](_0x2804ec[_0x1832('0x38')],{'$and':_0x474259});if(_0xd5646e[_0x1832('0x39')][_0x1832('0x2c')]===_0x1832('0x39')){var _0x50b4b5={'params':{'id':_0xd5646e['user']['userProfileId']},'query':{'section':_0x1832('0x3a'),'role':'agent','online':!![],'raw':!![],'ids':_0x3d6236,'customSorting':_0x3b61de}};if(_0x5d4b94){_0x50b4b5[_0x1832('0xf')][_0x1832('0x3b')]=_0x474259;}_0x50b4b5['query']=Object['assign'](_0x50b4b5[_0x1832('0xf')],_0xd5646e['query']);delete _0x50b4b5['query']['id'];return db['UserProfile'][_0x1832('0x3c')](_0x50b4b5);}return db[_0x1832('0x27')][_0x1832('0x3d')](_0x2804ec);})[_0x1832('0x16')](function(_0x1b2b42){_0x15d5ed[_0x1832('0xa')]=_0x1b2b42[_0x1832('0xa')];_0x538a0a=_0x1b2b42[_0x1832('0x22')];return _0x538a0a[_0x1832('0x26')](function(_0x592469){var _0x3b2497=_[_0x1832('0x3e')](_0x4d7f25,['id',_0x592469['id']]);if(_0x3b2497){var _0x58982b=rta[_0x1832('0x3f')](_0x3b2497);_['merge'](_0x592469,_0x58982b);}_0x592469['globalStatus']=rta[_0x1832('0x40')](_0x592469);if(_0x592469[_0x1832('0x41')]['includes'](_0x1832('0x13'))){_0x111115['forEach'](function(_0xcadf4a){if(_0x592469[_0xcadf4a+'Pause']){_0x592469[_0xcadf4a+_0x1832('0x42')]=_0x1832('0x13');}});}return _0x592469;});})[_0x1832('0x16')](function(_0x12d2a8){if(!_0x32f07f||_0x3b61de){return _0x12d2a8;}return rta[_0x1832('0x43')](_0x12d2a8,_0x32f07f);})[_0x1832('0x16')](function(_0x279dc3){var _0x2a2a81=null;if(_0xd5646e[_0x1832('0xf')][_0x1832('0x1e')]){var _0x298dab=_0xd5646e['query']['fields']['split'](',');_0x2a2a81=_0x279dc3[_0x1832('0x26')](function(_0x593505){return _[_0x1832('0x44')](_0x593505,_0x298dab);});}_0x15d5ed[_0x1832('0x22')]=_0x2a2a81||_0x279dc3;return _0x15d5ed;})[_0x1832('0x16')](respondWithFilteredResult(_0x360baf,_0x2804ec))[_0x1832('0x45')](APIHandleError(_0x360baf));};exports[_0x1832('0x46')]=function(_0x4b58f2,_0x589dd6){var _0x4124e2={'count':0x0,'rows':[]};var _0x45d98b={};var _0x54fc24;var _0x2b1c7d;var _0x5197c5;Promise['resolve']()[_0x1832('0x16')](function(){if(_0x4b58f2[_0x1832('0xf')][_0x1832('0x18')]){if(!utils[_0x1832('0x47')](_0x4b58f2['query'][_0x1832('0x18')])){throw new APIBadRequestError(util['format'](_0x1832('0x48'),_0x4b58f2[_0x1832('0xf')][_0x1832('0x18')]));}_0x54fc24=_0x4b58f2['query'][_0x1832('0x18')][_0x1832('0x19')]();}var _0x423300=_['startCase'](_0x54fc24)+_0x1832('0x49');var _0x17e7c1=_['map'](db[_0x423300]['rawAttributes'],function(_0x497e10){return{'name':_0x497e10[_0x1832('0x29')],'type':_0x497e10[_0x1832('0x2a')][_0x1832('0x2b')]};});if(!_0x4b58f2['query'][_0x1832('0x1e')]){var _0x92132d=['id',_0x1832('0x4a')];if(_0x54fc24===_0x1832('0x4b')){_0x92132d[_0x1832('0x31')](_0x1832('0x2a'));if(_0x4b58f2[_0x1832('0xf')][_0x1832('0x2a')]==='outbound'){_0x92132d['push']([_0x1832('0x4c'),_0x1832('0x4d')]);}}_0x4b58f2['query'][_0x1832('0x1e')]=_0x92132d[_0x1832('0x1f')](',');}_0x45d98b=qs[_0x1832('0x2f')](_0x17e7c1,_0x4b58f2);if(_0x4b58f2[_0x1832('0x39')][_0x1832('0x2c')]===_0x1832('0x39')){var _0x3549a2={'params':{'id':_0x4b58f2[_0x1832('0x39')][_0x1832('0x4e')]},'query':{'section':_0x54fc24==='voice'&&_0x4b58f2[_0x1832('0xf')][_0x1832('0x2a')]===_0x1832('0x4f')?_0x1832('0x50'):_['startCase'](_0x54fc24)+'Queues','type':_0x4b58f2[_0x1832('0xf')][_0x1832('0x2a')],'nolimit':!![],'sort':_0x1832('0x4a'),'filter':_0x4b58f2['query'][_0x1832('0x51')]}};return db[_0x1832('0x52')][_0x1832('0x3c')](_0x3549a2);}return db[_0x423300][_0x1832('0x3d')](_0x45d98b);})[_0x1832('0x16')](function(_0x1039b0){_0x4124e2[_0x1832('0xa')]=_0x1039b0['count'];_0x2b1c7d=_0x1039b0[_0x1832('0x22')];return rtq[_0x1832('0x53')](_0x4b58f2,_0x54fc24);})[_0x1832('0x16')](function(_0x5ef5d0){_0x5197c5=_0x5ef5d0[_0x1832('0x22')];return rtq[_0x1832('0x54')](_0x2b1c7d,_0x5197c5,_0x54fc24,_0x4b58f2[_0x1832('0xf')][_0x1832('0x2a')]);})[_0x1832('0x16')](function(_0x4f5f53){_0x4124e2['rows']=_0x4f5f53;return _0x4124e2;})[_0x1832('0x16')](respondWithFilteredResult(_0x589dd6,_0x45d98b))['catch'](APIHandleError(_0x589dd6));}; \ No newline at end of file +var _0x6aa8=['initializeQueues','lodash','util','../../components/realtime/agents','../../mysqldb','../../errors/api','APIBadRequestError','handleError','offset','undefined','limit','count','status','set','Content-Range','getAgents','getChannels','globalQueueFilter','globalStatusFilter','query','pauseTypeFilter','pause','*pause','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','order','then','getAgentIdsByQueues','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','type','key','role','agent','online','getOptions','raw','sequelize','literal','FIELD(id,','Pause','push','forEach','where','merge','user','userProfileId','Agents','extraQueryConditions','find','getAgentStatus','includes','sortAgentsByStatus','pick','catch','getQueues','resolve','isValidChannel','startCase','Queue','voice','outbound','dialActive','dialMethod','QueueCampaigns','filter','UserProfile','getResources','findAndCountAll','getRealtimeQueues'];(function(_0x32a2b7,_0x2bbc53){var _0x35cf16=function(_0x19cc96){while(--_0x19cc96){_0x32a2b7['push'](_0x32a2b7['shift']());}};_0x35cf16(++_0x2bbc53);}(_0x6aa8,0x19b));var _0x86aa=function(_0x333eaa,_0x3be00e){_0x333eaa=_0x333eaa-0x0;var _0x4091b4=_0x6aa8[_0x333eaa];return _0x4091b4;};'use strict';var _=require(_0x86aa('0x0'));var util=require(_0x86aa('0x1'));var rta=require(_0x86aa('0x2'));var rtq=require('../../components/realtime/queues');var qs=require('../../components/parsers/qs');var utils=require('../../config/utils');var db=require(_0x86aa('0x3'))['db'];var APIBadRequestError=require(_0x86aa('0x4'))[_0x86aa('0x5')];var APIHandleError=require(_0x86aa('0x4'))[_0x86aa('0x6')];function respondWithFilteredResult(_0x766866,_0x194566){return function(_0x448ef7){if(_0x448ef7){var _0x744f57=typeof _0x194566[_0x86aa('0x7')]===_0x86aa('0x8')&&typeof _0x194566[_0x86aa('0x9')]===_0x86aa('0x8');var _0x42c484=_0x448ef7[_0x86aa('0xa')];var _0x1efd17=_0x744f57?0x0:_0x194566['offset'];var _0x2e217c=_0x744f57?_0x448ef7[_0x86aa('0xa')]:_0x194566[_0x86aa('0x7')]+_0x194566[_0x86aa('0x9')];var _0x54180b;if(_0x2e217c>=_0x42c484){_0x2e217c=_0x42c484;_0x54180b=0xc8;}else{_0x54180b=0xce;}_0x766866[_0x86aa('0xb')](_0x54180b);return _0x766866[_0x86aa('0xc')](_0x86aa('0xd'),_0x1efd17+'-'+_0x2e217c+'/'+_0x42c484)['json'](_0x448ef7);}return null;};}exports[_0x86aa('0xe')]=function(_0x2347d2,_0x40793c){var _0xfac5fe={'count':0x0,'rows':[]};var _0x14cc17={};var _0x56fe13;var _0x43f0e2=utils[_0x86aa('0xf')]();var _0x526708;var _0x1200b9;var _0x2626f7=_0x2347d2['query'][_0x86aa('0x10')];var _0x146b2e=_0x2347d2['query'][_0x86aa('0x11')];var _0x24c0c2=_0x2347d2[_0x86aa('0x12')][_0x86aa('0x13')];var _0x157b89=_0x146b2e===_0x86aa('0x14')||_0x146b2e===_0x86aa('0x15')?!![]:![];var _0x1ee9e0=[];var _0x314c1c;var _0xcecb42;Promise['resolve']()['then'](function(){if(_0x2347d2[_0x86aa('0x12')]['channel']){if(!utils['isValidChannel'](_0x2347d2[_0x86aa('0x12')][_0x86aa('0x16')])){throw new APIBadRequestError(util[_0x86aa('0x17')](_0x86aa('0x18'),_0x2347d2[_0x86aa('0x12')][_0x86aa('0x16')]));}_0x56fe13=_0x2347d2['query']['channel'][_0x86aa('0x19')]();}if(!_0x2347d2[_0x86aa('0x12')][_0x86aa('0x1a')]||!_0x2347d2[_0x86aa('0x12')][_0x86aa('0x1a')]['includes'](_0x86aa('0x1b'))){_0x2347d2[_0x86aa('0x12')]['sort']=rta[_0x86aa('0x1c')](_0x2347d2[_0x86aa('0x12')]['sort']);return;}var _0x4b879d=rta[_0x86aa('0x1d')](_0x2347d2[_0x86aa('0x12')][_0x86aa('0x1a')]);_0x2347d2['query'][_0x86aa('0x1a')]=_0x4b879d[_0x86aa('0x1e')]['join'](',');_0x314c1c=_0x4b879d[_0x86aa('0x1f')];})[_0x86aa('0x20')](function(){if(!_0x2626f7){return[];}return rta[_0x86aa('0x21')](_0x2626f7,_0x56fe13);})[_0x86aa('0x20')](function(_0x236fc1){_0x1ee9e0=_0x236fc1;return rta['getRealtimeAgents']();})[_0x86aa('0x20')](function(_0x1337db){_0x1200b9=_0x1337db[_0x86aa('0x22')];if((!_0x146b2e||_0x157b89)&&!_0x314c1c){return _0x1ee9e0;}if(_0x314c1c&&!_0x146b2e){return rta[_0x86aa('0x23')](_0x1200b9,_0x1ee9e0,_0x314c1c);}else{return rta[_0x86aa('0x24')](_0x1200b9,_0x1ee9e0,_0x146b2e);}})['then'](function(_0xa9bc62){_0x1ee9e0=_0xa9bc62;var _0x388f25=![];if(_0x1ee9e0[_0x86aa('0x25')]===0x0){if(_0x2626f7||_0x146b2e){_0x388f25=!![];}if(_0x157b89){_0x388f25=![];}}if(_0x388f25){return _0xfac5fe;}var _0x2343a4=_[_0x86aa('0x26')](db[_0x86aa('0x27')][_0x86aa('0x28')],function(_0x1b95b9){return{'name':_0x1b95b9['fieldName'],'type':_0x1b95b9[_0x86aa('0x29')][_0x86aa('0x2a')]};});_0x2347d2[_0x86aa('0x12')][_0x86aa('0x2b')]=_0x86aa('0x2c');_0x2347d2[_0x86aa('0x12')][_0x86aa('0x2d')]=!![];_0x14cc17=qs[_0x86aa('0x2e')](_0x2343a4,_0x2347d2);_0x14cc17[_0x86aa('0x2f')]=!![];var _0x1e42e=[];if(_0x1ee9e0[_0x86aa('0x25')]>0x0){_0x1e42e['push']({'id':{'$in':_0x1ee9e0}});if(_0x314c1c&&!_0x146b2e){_0xcecb42=[db[_0x86aa('0x30')][_0x86aa('0x31')](_0x86aa('0x32')+_0x1ee9e0+')')];_0x14cc17[_0x86aa('0x1f')]=_0xcecb42;}}if(_0x157b89){_0x43f0e2['forEach'](function(_0x22b2be){var _0x154a35=!![];if(_0x146b2e===_0x86aa('0x15')&&_0x56fe13!==_0x22b2be){_0x154a35=![];}_0x1e42e['push']({[_0x22b2be+_0x86aa('0x33')]:_0x154a35});});if(_0x24c0c2){_0x1e42e[_0x86aa('0x34')]({'pauseType':_0x24c0c2});}}else if(_0x146b2e){_0x43f0e2[_0x86aa('0x35')](function(_0x497d84){_0x1e42e['push']({[_0x497d84+'Pause']:![]});});}_0x14cc17[_0x86aa('0x36')]=_[_0x86aa('0x37')](_0x14cc17[_0x86aa('0x36')],{'$and':_0x1e42e});if(_0x2347d2['user'][_0x86aa('0x2b')]===_0x86aa('0x38')){var _0x4bcc13={'params':{'id':_0x2347d2[_0x86aa('0x38')][_0x86aa('0x39')]},'query':{'section':_0x86aa('0x3a'),'role':_0x86aa('0x2c'),'online':!![],'raw':!![],'ids':_0x1ee9e0,'customSorting':_0xcecb42}};if(_0x157b89){_0x4bcc13[_0x86aa('0x12')][_0x86aa('0x3b')]=_0x1e42e;}_0x4bcc13[_0x86aa('0x12')]=Object['assign'](_0x4bcc13['query'],_0x2347d2['query']);delete _0x4bcc13[_0x86aa('0x12')]['id'];return db['UserProfile']['getResources'](_0x4bcc13);}return db[_0x86aa('0x27')]['findAndCountAll'](_0x14cc17);})[_0x86aa('0x20')](function(_0xe57bd0){_0xfac5fe['count']=_0xe57bd0[_0x86aa('0xa')];_0x526708=_0xe57bd0[_0x86aa('0x22')];return _0x526708[_0x86aa('0x26')](function(_0x487a6b){var _0x517771=_[_0x86aa('0x3c')](_0x1200b9,['id',_0x487a6b['id']]);if(_0x517771){var _0x524109=rta['filterAgentAttributes'](_0x517771);_[_0x86aa('0x37')](_0x487a6b,_0x524109);}_0x487a6b['globalStatus']=rta[_0x86aa('0x3d')](_0x487a6b);if(_0x487a6b['globalStatus'][_0x86aa('0x3e')]('pause')){_0x43f0e2[_0x86aa('0x35')](function(_0x764975){if(_0x487a6b[_0x764975+'Pause']){_0x487a6b[_0x764975+'Status']=_0x86aa('0x14');}});}return _0x487a6b;});})[_0x86aa('0x20')](function(_0x2ed9d0){if(!_0x314c1c||_0xcecb42){return _0x2ed9d0;}return rta[_0x86aa('0x3f')](_0x2ed9d0,_0x314c1c);})[_0x86aa('0x20')](function(_0x43f119){var _0x4f3e33=null;if(_0x2347d2[_0x86aa('0x12')][_0x86aa('0x1e')]){var _0x1d075b=_0x2347d2[_0x86aa('0x12')][_0x86aa('0x1e')]['split'](',');_0x4f3e33=_0x43f119['map'](function(_0x466df0){return _[_0x86aa('0x40')](_0x466df0,_0x1d075b);});}_0xfac5fe['rows']=_0x4f3e33||_0x43f119;return _0xfac5fe;})['then'](respondWithFilteredResult(_0x40793c,_0x14cc17))[_0x86aa('0x41')](APIHandleError(_0x40793c));};exports[_0x86aa('0x42')]=function(_0x30937d,_0x2ed954){var _0x29f02f={'count':0x0,'rows':[]};var _0x49587e={};var _0x36174c;var _0x48c733;var _0x3301e5;Promise[_0x86aa('0x43')]()['then'](function(){if(_0x30937d[_0x86aa('0x12')][_0x86aa('0x16')]){if(!utils[_0x86aa('0x44')](_0x30937d['query'][_0x86aa('0x16')])){throw new APIBadRequestError(util[_0x86aa('0x17')](_0x86aa('0x18'),_0x30937d[_0x86aa('0x12')][_0x86aa('0x16')]));}_0x36174c=_0x30937d[_0x86aa('0x12')]['channel'][_0x86aa('0x19')]();}var _0x532c90=_[_0x86aa('0x45')](_0x36174c)+_0x86aa('0x46');var _0x187a47=_['map'](db[_0x532c90][_0x86aa('0x28')],function(_0x4e0a2e){return{'name':_0x4e0a2e['fieldName'],'type':_0x4e0a2e[_0x86aa('0x29')]['key']};});if(!_0x30937d['query'][_0x86aa('0x1e')]){var _0x2f45f6=['id','name'];if(_0x36174c===_0x86aa('0x47')){_0x2f45f6[_0x86aa('0x34')]('type');if(_0x30937d['query']['type']===_0x86aa('0x48')){_0x2f45f6[_0x86aa('0x34')]([_0x86aa('0x49'),_0x86aa('0x4a')]);}}_0x30937d['query'][_0x86aa('0x1e')]=_0x2f45f6['join'](',');}_0x49587e=qs[_0x86aa('0x2e')](_0x187a47,_0x30937d);if(_0x30937d[_0x86aa('0x38')][_0x86aa('0x2b')]===_0x86aa('0x38')){var _0x246bd2={'params':{'id':_0x30937d[_0x86aa('0x38')][_0x86aa('0x39')]},'query':{'section':_0x36174c===_0x86aa('0x47')&&_0x30937d[_0x86aa('0x12')][_0x86aa('0x29')]==='outbound'?_0x86aa('0x4b'):_[_0x86aa('0x45')](_0x36174c)+'Queues','type':_0x30937d[_0x86aa('0x12')][_0x86aa('0x29')],'nolimit':!![],'sort':'name','filter':_0x30937d[_0x86aa('0x12')][_0x86aa('0x4c')]}};return db[_0x86aa('0x4d')][_0x86aa('0x4e')](_0x246bd2);}return db[_0x532c90][_0x86aa('0x4f')](_0x49587e);})[_0x86aa('0x20')](function(_0x289591){_0x29f02f[_0x86aa('0xa')]=_0x289591[_0x86aa('0xa')];_0x48c733=_0x289591[_0x86aa('0x22')];return rtq[_0x86aa('0x50')](_0x30937d,_0x36174c);})['then'](function(_0x4d9593){_0x3301e5=_0x4d9593[_0x86aa('0x22')];return rtq[_0x86aa('0x51')](_0x48c733,_0x3301e5,_0x36174c,_0x30937d[_0x86aa('0x12')]['type']);})[_0x86aa('0x20')](function(_0x454e32){_0x29f02f['rows']=_0x454e32;return _0x29f02f;})['then'](respondWithFilteredResult(_0x2ed954,_0x49587e))[_0x86aa('0x41')](APIHandleError(_0x2ed954));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 38065f8..82aa4bf 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x1bdeba,_0x5dd8db){var _0x59028c=function(_0x7c8bd5){while(--_0x7c8bd5){_0x1bdeba['push'](_0x1bdeba['shift']());}};_0x59028c(++_0x5dd8db);}(_0xedd9,0xfc));var _0x9edd=function(_0x2a02b9,_0x110c2c){_0x2a02b9=_0x2a02b9-0x0;var _0x578f84=_0xedd9[_0x2a02b9];return _0x578f84;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x926354,_0x1552e7){var _0x1a9ec6=function(_0x318aa0){while(--_0x318aa0){_0x926354['push'](_0x926354['shift']());}};_0x1a9ec6(++_0x1552e7);}(_0xedd9,0xfc));var _0x9edd=function(_0x11324b,_0x2ab344){_0x11324b=_0x11324b-0x0;var _0x176ec1=_0xedd9[_0x11324b];return _0x176ec1;};'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 91829fa..f997c70 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 _0x872a=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x96791d,_0x16f0f1){var _0x3e2cad=function(_0x350327){while(--_0x350327){_0x96791d['push'](_0x96791d['shift']());}};_0x3e2cad(++_0x16f0f1);}(_0x872a,0x100));var _0xa872=function(_0x76c66e,_0x5c6276){_0x76c66e=_0x76c66e-0x0;var _0x1c6f1f=_0x872a[_0x76c66e];return _0x1c6f1f;};'use strict';var Sequelize=require(_0xa872('0x0'));module[_0xa872('0x1')]={'state':{'type':Sequelize[_0xa872('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xa872('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xa872('0x4')]},'ringtime':{'type':Sequelize[_0xa872('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xa872('0x3')]},'campaigntype':{'type':Sequelize[_0xa872('0x3')]},'membername':{'type':Sequelize[_0xa872('0x3')]}}; \ No newline at end of file +var _0xb242=['INTEGER','STRING','DATE','exports'];(function(_0x40571f,_0x4552d3){var _0x3fb2f9=function(_0x110d7b){while(--_0x110d7b){_0x40571f['push'](_0x40571f['shift']());}};_0x3fb2f9(++_0x4552d3);}(_0xb242,0x1f3));var _0x2b24=function(_0x57486e,_0x32283b){_0x57486e=_0x57486e-0x0;var _0x5f110b=_0xb242[_0x57486e];return _0x5f110b;};'use strict';var Sequelize=require('sequelize');module[_0x2b24('0x0')]={'state':{'type':Sequelize[_0x2b24('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x2b24('0x2')]},'scheduledat':{'type':Sequelize[_0x2b24('0x3')]},'uniqueid':{'type':Sequelize[_0x2b24('0x2')]},'starttime':{'type':Sequelize[_0x2b24('0x3')]},'responsetime':{'type':Sequelize[_0x2b24('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x2b24('0x2')]},'membername':{'type':Sequelize[_0x2b24('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 9e0da9d..0191a7c 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 _0xfcbf=['exports','define','ReportAgentPreview','report_agent_preview','util','api','moment','bluebird','request-promise','path','./reportAgentPreview.attributes'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xfcbf,0x10c));var _0xffcb=function(_0x3982d2,_0x54927f){_0x3982d2=_0x3982d2-0x0;var _0x508989=_0xfcbf[_0x3982d2];return _0x508989;};'use strict';var _=require('lodash');var util=require(_0xffcb('0x0'));var logger=require('../../config/logger')(_0xffcb('0x1'));var moment=require(_0xffcb('0x2'));var BPromise=require(_0xffcb('0x3'));var rp=require(_0xffcb('0x4'));var fs=require('fs');var path=require(_0xffcb('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xffcb('0x6'));module[_0xffcb('0x7')]=function(_0x294e25,_0x4e9ff1){return _0x294e25[_0xffcb('0x8')](_0xffcb('0x9'),attributes,{'tableName':_0xffcb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf1fd=['request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','define','ReportAgentPreview','lodash','util','api','moment','bluebird'];(function(_0x2986de,_0x156443){var _0x3ffe9b=function(_0x45222c){while(--_0x45222c){_0x2986de['push'](_0x2986de['shift']());}};_0x3ffe9b(++_0x156443);}(_0xf1fd,0x163));var _0xdf1f=function(_0x5371d7,_0x1f197e){_0x5371d7=_0x5371d7-0x0;var _0x46bc0c=_0xf1fd[_0x5371d7];return _0x46bc0c;};'use strict';var _=require(_0xdf1f('0x0'));var util=require(_0xdf1f('0x1'));var logger=require('../../config/logger')(_0xdf1f('0x2'));var moment=require(_0xdf1f('0x3'));var BPromise=require(_0xdf1f('0x4'));var rp=require(_0xdf1f('0x5'));var fs=require('fs');var path=require(_0xdf1f('0x6'));var rimraf=require(_0xdf1f('0x7'));var config=require(_0xdf1f('0x8'));var attributes=require(_0xdf1f('0x9'));module['exports']=function(_0x14b179,_0x5b0b98){return _0x14b179[_0xdf1f('0xa')](_0xdf1f('0xb'),attributes,{'tableName':'report_agent_preview','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 2bddc1c..7b5d1ae 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 _0x6111=['create','body','options','raw','debug','CreateReportAgentPreview','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch'];(function(_0x11ec6c,_0x1a8169){var _0xb59506=function(_0x58e31d){while(--_0x58e31d){_0x11ec6c['push'](_0x11ec6c['shift']());}};_0xb59506(++_0x1a8169);}(_0x6111,0x97));var _0x1611=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6111[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x1611('0x0'));var moment=require(_0x1611('0x1'));var BPromise=require(_0x1611('0x2'));var rs=require(_0x1611('0x3'));var fs=require('fs');var Redis=require(_0x1611('0x4'));var db=require(_0x1611('0x5'))['db'];var utils=require(_0x1611('0x6'));var logger=require(_0x1611('0x7'))(_0x1611('0x8'));var config=require(_0x1611('0x9'));var jayson=require(_0x1611('0xa'));var client=jayson[_0x1611('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f274d,_0x3ebdab,_0x19c562){return new BPromise(function(_0x558961,_0x2bb9a5){return client['request'](_0x3f274d,_0x19c562)[_0x1611('0xc')](function(_0xd81f46){logger['info'](_0x1611('0xd'),_0x3ebdab,'request\x20sent');logger['debug'](_0x1611('0xe'),_0x3ebdab,'request\x20sent',JSON[_0x1611('0xf')](_0xd81f46));if(_0xd81f46['error']){if(_0xd81f46[_0x1611('0x10')][_0x1611('0x11')]===0x1f4){logger[_0x1611('0x10')](_0x1611('0xd'),_0x3ebdab,_0xd81f46[_0x1611('0x10')][_0x1611('0x12')]);return _0x2bb9a5(_0xd81f46['error'][_0x1611('0x12')]);}logger[_0x1611('0x10')](_0x1611('0xd'),_0x3ebdab,_0xd81f46[_0x1611('0x10')][_0x1611('0x12')]);return _0x558961(_0xd81f46[_0x1611('0x10')][_0x1611('0x12')]);}else{logger[_0x1611('0x13')](_0x1611('0xd'),_0x3ebdab,_0x1611('0x14'));_0x558961(_0xd81f46[_0x1611('0x15')][_0x1611('0x12')]);}})[_0x1611('0x16')](function(_0x11b76e){logger[_0x1611('0x10')](_0x1611('0xd'),_0x3ebdab,_0x11b76e);_0x2bb9a5(_0x11b76e);});});}exports['CreateReportAgentPreview']=function(_0x45d72c){var _0x48e4c0=this;return new Promise(function(_0x4b5714,_0x50addb){return db['ReportAgentPreview'][_0x1611('0x17')](_0x45d72c[_0x1611('0x18')],{'raw':_0x45d72c[_0x1611('0x19')]?_0x45d72c[_0x1611('0x19')][_0x1611('0x1a')]===undefined?!![]:![]:!![]})[_0x1611('0xc')](function(_0x4e59a1){logger['info']('CreateReportAgentPreview',_0x45d72c);logger[_0x1611('0x1b')](_0x1611('0x1c'),_0x45d72c,JSON[_0x1611('0xf')](_0x4e59a1));_0x4b5714(_0x4e59a1);})['catch'](function(_0x21408a){logger[_0x1611('0x10')](_0x1611('0x1c'),_0x21408a[_0x1611('0x12')],_0x45d72c);_0x50addb(_0x48e4c0['error'](0x1f4,_0x21408a[_0x1611('0x12')]));});});}; \ No newline at end of file +var _0x2d32=['debug','stringify','error','code','message','info','result','create','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent'];(function(_0x25dd24,_0x1ed9e1){var _0x2f13eb=function(_0x4fa0d5){while(--_0x4fa0d5){_0x25dd24['push'](_0x25dd24['shift']());}};_0x2f13eb(++_0x1ed9e1);}(_0x2d32,0xf5));var _0x22d3=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x2d32[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x22d3('0x0'));var util=require(_0x22d3('0x1'));var moment=require(_0x22d3('0x2'));var BPromise=require(_0x22d3('0x3'));var rs=require(_0x22d3('0x4'));var fs=require('fs');var Redis=require(_0x22d3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x22d3('0x6'));var logger=require(_0x22d3('0x7'))('rpc');var config=require(_0x22d3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x22d3('0x9')][_0x22d3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20d7d1,_0x279a2b,_0x463800){return new BPromise(function(_0x25f94b,_0x120a12){return client[_0x22d3('0xb')](_0x20d7d1,_0x463800)[_0x22d3('0xc')](function(_0x5bfdfa){logger['info'](_0x22d3('0xd'),_0x279a2b,_0x22d3('0xe'));logger[_0x22d3('0xf')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x279a2b,_0x22d3('0xe'),JSON[_0x22d3('0x10')](_0x5bfdfa));if(_0x5bfdfa[_0x22d3('0x11')]){if(_0x5bfdfa['error'][_0x22d3('0x12')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x279a2b,_0x5bfdfa[_0x22d3('0x11')][_0x22d3('0x13')]);return _0x120a12(_0x5bfdfa[_0x22d3('0x11')]['message']);}logger[_0x22d3('0x11')](_0x22d3('0xd'),_0x279a2b,_0x5bfdfa['error'][_0x22d3('0x13')]);return _0x25f94b(_0x5bfdfa[_0x22d3('0x11')]['message']);}else{logger[_0x22d3('0x14')]('ReportAgentPreview,\x20%s,\x20%s',_0x279a2b,_0x22d3('0xe'));_0x25f94b(_0x5bfdfa[_0x22d3('0x15')][_0x22d3('0x13')]);}})['catch'](function(_0x18648f){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x279a2b,_0x18648f);_0x120a12(_0x18648f);});});}exports['CreateReportAgentPreview']=function(_0x23edbf){var _0x47639d=this;return new Promise(function(_0x2db0f9,_0x48fb5f){return db['ReportAgentPreview'][_0x22d3('0x16')](_0x23edbf['body'],{'raw':_0x23edbf[_0x22d3('0x17')]?_0x23edbf['options'][_0x22d3('0x18')]===undefined?!![]:![]:!![]})[_0x22d3('0xc')](function(_0x328a9a){logger[_0x22d3('0x14')]('CreateReportAgentPreview',_0x23edbf);logger[_0x22d3('0xf')]('CreateReportAgentPreview',_0x23edbf,JSON[_0x22d3('0x10')](_0x328a9a));_0x2db0f9(_0x328a9a);})[_0x22d3('0x19')](function(_0x6e3993){logger['error']('CreateReportAgentPreview',_0x6e3993['message'],_0x23edbf);_0x48fb5f(_0x47639d[_0x22d3('0x11')](0x1f4,_0x6e3993['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 574d3fd..0f1a82b 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 _0x47ce=['mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','./rpc.controller','get','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify'];(function(_0x1e8bdc,_0x2115d8){var _0x5a41a9=function(_0x399720){while(--_0x399720){_0x1e8bdc['push'](_0x1e8bdc['shift']());}};_0x5a41a9(++_0x2115d8);}(_0x47ce,0x165));var _0xe47c=function(_0x369e0e,_0x318c72){_0x369e0e=_0x369e0e-0x0;var _0x5a6c64=_0x47ce[_0x369e0e];return _0x5a6c64;};'use strict';var multer=require(_0xe47c('0x0'));var util=require(_0xe47c('0x1'));var path=require(_0xe47c('0x2'));var express=require(_0xe47c('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xe47c('0x4'));router[_0xe47c('0x5')]('/voice/channels',auth[_0xe47c('0x6')](),controller['voiceChannels']);router[_0xe47c('0x5')](_0xe47c('0x7'),auth['isAuthenticated'](),controller[_0xe47c('0x8')]);router[_0xe47c('0x5')](_0xe47c('0x9'),auth[_0xe47c('0x6')](),controller[_0xe47c('0xa')]);router[_0xe47c('0x5')](_0xe47c('0xb'),auth[_0xe47c('0x6')](),controller[_0xe47c('0xc')]);router['get'](_0xe47c('0xd'),auth['isAuthenticated'](),controller['chatQueues']);router[_0xe47c('0x5')]('/mail/queues',auth[_0xe47c('0x6')](),controller[_0xe47c('0xe')]);router[_0xe47c('0x5')](_0xe47c('0xf'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x10')]);router['get'](_0xe47c('0x11'),auth['isAuthenticated'](),controller[_0xe47c('0x12')]);router[_0xe47c('0x5')]('/sms/queues',auth[_0xe47c('0x6')](),controller[_0xe47c('0x13')]);router[_0xe47c('0x5')](_0xe47c('0x14'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x15')]);router['get'](_0xe47c('0x16'),auth[_0xe47c('0x6')](),controller['faxQueues']);router[_0xe47c('0x5')](_0xe47c('0x17'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x18')]);router[_0xe47c('0x5')]('/voice/queues/channels',auth[_0xe47c('0x6')](),controller[_0xe47c('0x19')]);router[_0xe47c('0x5')](_0xe47c('0x1a'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x1b')]);router[_0xe47c('0x5')](_0xe47c('0x1c'),auth[_0xe47c('0x6')](),controller['voiceQueuesChannelHangup']);router['get'](_0xe47c('0x1d'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x1e')]);router[_0xe47c('0x5')]('/voice/queues/:id',auth[_0xe47c('0x6')](),controller[_0xe47c('0x1f')]);router['put'](_0xe47c('0x20'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x21')]);router[_0xe47c('0x5')](_0xe47c('0x22'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x23')]);router['get'](_0xe47c('0x24'),auth['isAuthenticated'](),controller[_0xe47c('0x25')]);router[_0xe47c('0x5')](_0xe47c('0x26'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x27')]);router['put'](_0xe47c('0x28'),auth['isAuthenticated'](),controller[_0xe47c('0x29')]);router[_0xe47c('0x5')]('/telephones',auth[_0xe47c('0x6')](),controller[_0xe47c('0x2a')]);router[_0xe47c('0x5')](_0xe47c('0x2b'),auth['isAuthenticated'](),controller[_0xe47c('0x2c')]);router[_0xe47c('0x5')](_0xe47c('0x2d'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x2e')]);router['get'](_0xe47c('0x2f'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x30')]);router[_0xe47c('0x5')](_0xe47c('0x31'),auth['isAuthenticated'](),controller[_0xe47c('0x32')]);router['get'](_0xe47c('0x33'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x34')]);router[_0xe47c('0x5')](_0xe47c('0x35'),auth['isAuthenticated'](),controller[_0xe47c('0x36')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth[_0xe47c('0x6')](),controller[_0xe47c('0x37')]);router[_0xe47c('0x5')]('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xe47c('0x38')]);router[_0xe47c('0x5')]('/whatsapp/queues/waitinginteractions',auth[_0xe47c('0x6')](),controller[_0xe47c('0x39')]);router[_0xe47c('0x5')](_0xe47c('0x3a'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x3b')]);router[_0xe47c('0x3c')](_0xe47c('0x3d'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x3e')](_0xe47c('0x3f')));router[_0xe47c('0x5')](_0xe47c('0x40'),auth['isAuthenticated'](),controller[_0xe47c('0x41')]);router['post'](_0xe47c('0x42'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x3e')](_0xe47c('0x43')));router[_0xe47c('0x5')](_0xe47c('0x44'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x45')]);router[_0xe47c('0x3c')]('/fax/queues/:id/notify',auth[_0xe47c('0x6')](),controller[_0xe47c('0x3e')](_0xe47c('0x46')));router[_0xe47c('0x5')]('/fax/queues/:id',auth[_0xe47c('0x6')](),controller[_0xe47c('0x47')]);router[_0xe47c('0x3c')](_0xe47c('0x48'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x3e')](_0xe47c('0x49')));router[_0xe47c('0x5')](_0xe47c('0x4a'),auth[_0xe47c('0x6')](),controller['showOpenchannelQueues']);router[_0xe47c('0x3c')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0xe47c('0x3e')]('sms'));router[_0xe47c('0x3c')](_0xe47c('0x4b'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x3e')](_0xe47c('0x4c')));router[_0xe47c('0x5')](_0xe47c('0x4d'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x4e')]);router[_0xe47c('0x5')](_0xe47c('0x4f'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x50')]);router['post'](_0xe47c('0x51'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x52')]);module[_0xe47c('0x53')]=router; \ No newline at end of file +var _0x7ae6=['/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','whatsappQueues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','put','/voice/queues/:id','/outbound','/outbound/channels','outboundChannels','/agents','agents','/telephones','telephones','/trunks','trunks','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','post','sms','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','util','express','Router','../../components/auth/service','./rpc.controller','get'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x7ae6,0x94));var _0x67ae=function(_0x5ed485,_0x442036){_0x5ed485=_0x5ed485-0x0;var _0x35ff78=_0x7ae6[_0x5ed485];return _0x35ff78;};'use strict';var multer=require('multer');var util=require(_0x67ae('0x0'));var path=require('path');var express=require(_0x67ae('0x1'));var router=express[_0x67ae('0x2')]();var auth=require(_0x67ae('0x3'));var controller=require(_0x67ae('0x4'));router[_0x67ae('0x5')](_0x67ae('0x6'),auth['isAuthenticated'](),controller[_0x67ae('0x7')]);router[_0x67ae('0x5')](_0x67ae('0x8'),auth[_0x67ae('0x9')](),controller[_0x67ae('0xa')]);router['get'](_0x67ae('0xb'),auth[_0x67ae('0x9')](),controller[_0x67ae('0xc')]);router[_0x67ae('0x5')](_0x67ae('0xd'),auth[_0x67ae('0x9')](),controller[_0x67ae('0xe')]);router[_0x67ae('0x5')](_0x67ae('0xf'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x10')]);router[_0x67ae('0x5')](_0x67ae('0x11'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x12')]);router[_0x67ae('0x5')](_0x67ae('0x13'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x14')]);router[_0x67ae('0x5')](_0x67ae('0x15'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x16')]);router[_0x67ae('0x5')]('/sms/queues',auth[_0x67ae('0x9')](),controller[_0x67ae('0x17')]);router[_0x67ae('0x5')]('/whatsapp/queues',auth['isAuthenticated'](),controller[_0x67ae('0x18')]);router['get']('/fax/queues',auth[_0x67ae('0x9')](),controller[_0x67ae('0x19')]);router['get']('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0x67ae('0x1a')]);router['get'](_0x67ae('0x1b'),auth['isAuthenticated'](),controller[_0x67ae('0x1c')]);router[_0x67ae('0x5')](_0x67ae('0x1d'),auth['isAuthenticated'](),controller[_0x67ae('0x1e')]);router[_0x67ae('0x5')](_0x67ae('0x1f'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x20')]);router[_0x67ae('0x5')](_0x67ae('0x21'),auth['isAuthenticated'](),controller[_0x67ae('0x22')]);router[_0x67ae('0x5')]('/voice/queues/:id',auth['isAuthenticated'](),controller['showVoiceQueues']);router[_0x67ae('0x23')](_0x67ae('0x24'),auth[_0x67ae('0x9')](),controller['updateVoiceQueue']);router[_0x67ae('0x5')](_0x67ae('0x25'),auth['isAuthenticated'](),controller['outbound']);router[_0x67ae('0x5')](_0x67ae('0x26'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x27')]);router[_0x67ae('0x5')](_0x67ae('0x28'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x29')]);router[_0x67ae('0x23')]('/agents/:id/capacity',auth[_0x67ae('0x9')](),controller['agentCapacity']);router[_0x67ae('0x5')](_0x67ae('0x2a'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x2b')]);router[_0x67ae('0x5')](_0x67ae('0x2c'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x2d')]);router['get']('/campaigns',auth['isAuthenticated'](),controller['campaigns']);router[_0x67ae('0x5')]('/fax/accounts',auth['isAuthenticated'](),controller[_0x67ae('0x2e')]);router['get'](_0x67ae('0x2f'),auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router[_0x67ae('0x5')](_0x67ae('0x30'),auth['isAuthenticated'](),controller['mailQueuesWaitingInteractions']);router[_0x67ae('0x5')]('/openchannel/queues/waitinginteractions',auth[_0x67ae('0x9')](),controller[_0x67ae('0x31')]);router[_0x67ae('0x5')](_0x67ae('0x32'),auth[_0x67ae('0x9')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x67ae('0x5')](_0x67ae('0x33'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x34')]);router[_0x67ae('0x5')](_0x67ae('0x35'),auth['isAuthenticated'](),controller[_0x67ae('0x36')]);router['get'](_0x67ae('0x37'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x38')]);router['post'](_0x67ae('0x39'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x3a')](_0x67ae('0x3b')));router[_0x67ae('0x5')](_0x67ae('0x3c'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x3d')]);router['post'](_0x67ae('0x3e'),auth['isAuthenticated'](),controller[_0x67ae('0x3a')](_0x67ae('0x3f')));router[_0x67ae('0x5')](_0x67ae('0x40'),auth['isAuthenticated'](),controller['showChatQueues']);router['post'](_0x67ae('0x41'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x3a')]('fax'));router['get'](_0x67ae('0x42'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x43')]);router['post'](_0x67ae('0x44'),auth[_0x67ae('0x9')](),controller[_0x67ae('0x3a')]('openchannel'));router['get'](_0x67ae('0x45'),auth[_0x67ae('0x9')](),controller['showOpenchannelQueues']);router[_0x67ae('0x46')]('/sms/queues/:id/notify',auth[_0x67ae('0x9')](),controller['queueNotify'](_0x67ae('0x47')));router['post']('/whatsapp/queues/:id/notify',auth[_0x67ae('0x9')](),controller[_0x67ae('0x3a')](_0x67ae('0x48')));router[_0x67ae('0x5')](_0x67ae('0x49'),auth['isAuthenticated'](),controller[_0x67ae('0x4a')]);router[_0x67ae('0x5')]('/whatsapp/queues/:id',auth[_0x67ae('0x9')](),controller[_0x67ae('0x4b')]);router['post'](_0x67ae('0x4c'),auth[_0x67ae('0x9')](),controller['agentNotify']);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 388ee06..3c4602e 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 _0x6f47=['voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','interface','agent','internal','telephones','trunks','Trunks','Campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','User','create','moment','lodash','../../mysqldb','api','client','http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel'];(function(_0x51ed36,_0x383754){var _0x574db6=function(_0x4697cb){while(--_0x4697cb){_0x51ed36['push'](_0x51ed36['shift']());}};_0x574db6(++_0x383754);}(_0x6f47,0xc7));var _0x76f4=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x6f47[_0x173441];return _0x2423a8;};'use strict';var BPromise=require('bluebird');var moment=require(_0x76f4('0x0'));var _=require(_0x76f4('0x1'));var util=require('util');var db=require(_0x76f4('0x2'))['db'];var logger=require('../../config/logger')(_0x76f4('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x76f4('0x4')][_0x76f4('0x5')]({'port':0x232a});var mailClient=jayson[_0x76f4('0x4')][_0x76f4('0x5')]({'port':0x232b});var routingClient=jayson['client'][_0x76f4('0x5')]({'port':0x232c});function respondWithRpcPromise(_0xfc2405,_0x2176a7,_0x497f99){return new BPromise(function(_0x1a3172,_0x25656d){var _0x65d2c7=_0x497f99?_0x497f99:amiClient;return _0x65d2c7[_0x76f4('0x6')](_0xfc2405,_0x2176a7)[_0x76f4('0x7')](function(_0x4c6b5c){if(_0x4c6b5c['error']){if(_0x4c6b5c[_0x76f4('0x8')][_0x76f4('0x9')]===0x1f4){return _0x25656d(_0x4c6b5c['error']['message']);}return _0x1a3172(_0x4c6b5c[_0x76f4('0x8')][_0x76f4('0xa')]);}else{_0x1a3172(_0x4c6b5c[_0x76f4('0xb')]);}})[_0x76f4('0xc')](function(_0x1aee7f){_0x25656d(_0x1aee7f);});});}function respondWithResult(_0xafd21e,_0xf7e347){_0xf7e347=_0xf7e347||0xc8;return function(_0x3ec740){if(_0x3ec740){return _0xafd21e[_0x76f4('0xd')](_0xf7e347)['json'](_0x3ec740);}return _0xafd21e[_0x76f4('0xe')](0x194);};}function handleError(_0x30dabf,_0x5da1ff){_0x5da1ff=_0x5da1ff||0x1f4;return function(_0x4b6021){logger['error'](_0x4b6021[_0x76f4('0xf')]);if(_0x4b6021[_0x76f4('0x10')]){delete _0x4b6021[_0x76f4('0x10')];}_0x30dabf[_0x76f4('0xd')](_0x5da1ff)[_0x76f4('0x11')](_0x4b6021);};}function findById(_0x2b5e23){return function(_0x46ba51){if(!_[_0x76f4('0x12')](_0x2b5e23)&&!_[_0x76f4('0x12')](_0x46ba51)&&!_[_0x76f4('0x12')](_0x46ba51[_0x76f4('0x13')])){return _[_0x76f4('0x14')](_0x46ba51[_0x76f4('0x13')],function(_0x38450e){return _0x38450e['id']==_0x2b5e23;});}return null;};}exports[_0x76f4('0x15')]=function(_0x397360,_0xfedbe4){return respondWithRpcPromise(_0x76f4('0x16'),_0x397360[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0xfedbe4,null))[_0x76f4('0xc')](handleError(_0xfedbe4,null));};exports[_0x76f4('0x18')]=function(_0x5bf3d5,_0x262937){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x76f4('0x19')](_0x5bf3d5[_0x76f4('0x17')],_0x5bf3d5[_0x76f4('0x1a')]))['then'](respondWithResult(_0x262937,null))['catch'](handleError(_0x262937,null));};exports['voiceChannelStopMixMonitor']=function(_0x465240,_0x681d67){return respondWithRpcPromise(_0x76f4('0x1b'),_[_0x76f4('0x19')](_0x465240[_0x76f4('0x17')],_0x465240[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x681d67,null))['catch'](handleError(_0x681d67,null));};exports['voiceQueues']=function(_0x3794fa,_0x497913){return respondWithRpcPromise(_0x76f4('0x1c'),_0x3794fa['query'])['then'](respondWithResult(_0x497913,null))['catch'](handleError(_0x497913,null));};exports[_0x76f4('0x1d')]=function(_0x38300d,_0xd368a2){return respondWithRpcPromise(_0x76f4('0x1c'),_0x38300d[_0x76f4('0x17')])[_0x76f4('0x7')](findById(_0x38300d['params']['id']))[_0x76f4('0x7')](respondWithResult(_0xd368a2,null))['catch'](handleError(_0xd368a2,null));};exports['updateVoiceQueue']=function(_0x5b3f07,_0x10ddb4){return respondWithRpcPromise(_0x76f4('0x1e'),_[_0x76f4('0x19')](_0x5b3f07[_0x76f4('0x1f')],_0x5b3f07['params']))[_0x76f4('0x7')](respondWithResult(_0x10ddb4,null))['catch'](handleError(_0x10ddb4,null));};exports[_0x76f4('0x20')]=function(_0x3c7513,_0x43ac4a){return respondWithRpcPromise(_0x76f4('0x21'),_[_0x76f4('0x19')](_0x3c7513['query'],_0x3c7513['params']))[_0x76f4('0x7')](respondWithResult(_0x43ac4a,null))[_0x76f4('0xc')](handleError(_0x43ac4a,null));};exports[_0x76f4('0x22')]=function(_0x281db6,_0x1f2adf){return respondWithRpcPromise(_0x76f4('0x23'),_0x281db6[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x1f2adf,null))[_0x76f4('0xc')](handleError(_0x1f2adf,null));};exports[_0x76f4('0x24')]=function(_0x308af2,_0x2527a6){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x308af2['query'],_0x308af2['params']))[_0x76f4('0x7')](respondWithResult(_0x2527a6,null))[_0x76f4('0xc')](handleError(_0x2527a6,null));};exports[_0x76f4('0x25')]=function(_0x456b1f,_0x26fdd6){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x76f4('0x19')](_0x456b1f[_0x76f4('0x17')],_0x456b1f[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x26fdd6,null))[_0x76f4('0xc')](handleError(_0x26fdd6,null));};exports[_0x76f4('0x26')]=function(_0xb806cc,_0x28d9d6){return respondWithRpcPromise(_0x76f4('0x27'),_[_0x76f4('0x19')](_0xb806cc[_0x76f4('0x17')],_0xb806cc[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x28d9d6,null))[_0x76f4('0xc')](handleError(_0x28d9d6,null));};exports[_0x76f4('0x28')]=function(_0x88506b,_0x3308e3){return respondWithRpcPromise(_0x76f4('0x29'),_0x88506b['query'])[_0x76f4('0x7')](respondWithResult(_0x3308e3,null))[_0x76f4('0xc')](handleError(_0x3308e3,null));};exports[_0x76f4('0x2a')]=function(_0x589637,_0x597e83){return respondWithRpcPromise(_0x76f4('0x2b'),_0x589637['query'])[_0x76f4('0x7')](respondWithResult(_0x597e83,null))['catch'](handleError(_0x597e83,null));};exports[_0x76f4('0x2c')]=function(_0x16f36d,_0x312243){var _0x378675;return respondWithRpcPromise(_0x76f4('0x2d'),_0x16f36d[_0x76f4('0x17')])[_0x76f4('0x7')](function(_0x109ad9){_0x378675=_0x109ad9;return respondWithRpcPromise(_0x76f4('0x2d'),_0x16f36d[_0x76f4('0x17')],routingClient);})['then'](function(_0x5b8d2d){return _[_0x76f4('0x19')]({},_0x5b8d2d,_0x378675);})[_0x76f4('0x7')](respondWithResult(_0x312243,null))[_0x76f4('0xc')](handleError(_0x312243,null));};exports[_0x76f4('0x2e')]=function(_0x2b7dc8,_0x2d6068){if(_0x2b7dc8[_0x76f4('0x1f')]&&_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')]&&_0x2b7dc8['user']&&_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')]){for(var _0x4f0d1a in _0x2b7dc8['body'][_0x76f4('0x2f')]){if(_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x76f4('0x31')](_0x4f0d1a)){db[_0x76f4('0x32')]['findAll']({'where':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'type':_0x76f4('0x33'),'exitAt':null,'uniqueid':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a]&&_0x2b7dc8[_0x76f4('0x1f')]['interaction'][_0x4f0d1a][_0x76f4('0x34')]?{'$notIn':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a]}:{'$ne':null}}})['then'](function(_0x571261){var _0x11ea58=moment()[_0x76f4('0x35')](_0x76f4('0x36'));for(var _0x2bea6d=0x0,_0x36fa03=_0x571261['length'];_0x2bea6d<_0x36fa03;_0x2bea6d+=0x1){_0x571261[_0x2bea6d]['updateAttributes']({'exitAt':_0x11ea58});}});for(var _0x8e5b60=0x0;_0x8e5b60<_0x2b7dc8['body'][_0x76f4('0x2f')][_0x4f0d1a][_0x76f4('0x34')];_0x8e5b60+=0x1){db['MemberReport']['findOrCreate']({'where':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'type':_0x76f4('0x33'),'uniqueid':_0x2b7dc8[_0x76f4('0x1f')]['interaction'][_0x4f0d1a][_0x8e5b60],'exitAt':null},'defaults':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'interface':_[_0x76f4('0x12')](_0x2b7dc8['user'][_0x76f4('0x37')])?util[_0x76f4('0x35')]('SIP/%s',_0x2b7dc8['user'][_0x76f4('0x10')]):_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x37')],'type':_0x76f4('0x33'),'enterAt':moment()[_0x76f4('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x76f4('0x38'),'internal':_0x2b7dc8['user'][_0x76f4('0x39')],'uniqueid':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a][_0x8e5b60]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b7dc8[_0x76f4('0x1a')]['id'],'capacity':_0x2b7dc8[_0x76f4('0x1f')]['capacity']},routingClient)[_0x76f4('0x7')](respondWithResult(_0x2d6068,null))[_0x76f4('0xc')](handleError(_0x2d6068,null));};exports[_0x76f4('0x3a')]=function(_0x1c658c,_0x40ff20){return respondWithRpcPromise('Telephones',_0x1c658c[_0x76f4('0x17')])['then'](respondWithResult(_0x40ff20,null))[_0x76f4('0xc')](handleError(_0x40ff20,null));};exports[_0x76f4('0x3b')]=function(_0x154ba,_0x5121ec){return respondWithRpcPromise(_0x76f4('0x3c'),_0x154ba[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x5121ec,null))[_0x76f4('0xc')](handleError(_0x5121ec,null));};exports['campaigns']=function(_0x2028e9,_0xf11e07){return respondWithRpcPromise(_0x76f4('0x3d'),_0x2028e9[_0x76f4('0x17')])['then'](respondWithResult(_0xf11e07,null))[_0x76f4('0xc')](handleError(_0xf11e07,null));};exports['chatQueues']=function(_0x129048,_0x190c8d){return respondWithRpcPromise('ChatQueues',_0x129048['query'],routingClient)[_0x76f4('0x7')](respondWithResult(_0x190c8d,null))[_0x76f4('0xc')](handleError(_0x190c8d,null));};exports[_0x76f4('0x3e')]=function(_0x596b51,_0x27ba06){return respondWithRpcPromise(_0x76f4('0x3f'),_0x596b51[_0x76f4('0x17')],routingClient)['then'](findById(_0x596b51['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x27ba06,null))[_0x76f4('0xc')](handleError(_0x27ba06,null));};exports['mailQueues']=function(_0x490ced,_0x3f1840){return respondWithRpcPromise(_0x76f4('0x40'),_0x490ced[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x3f1840,null))[_0x76f4('0xc')](handleError(_0x3f1840,null));};exports[_0x76f4('0x41')]=function(_0x97be11,_0x36a52a){return respondWithRpcPromise(_0x76f4('0x40'),_0x97be11['query'],routingClient)['then'](findById(_0x97be11['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x36a52a,null))[_0x76f4('0xc')](handleError(_0x36a52a,null));};exports[_0x76f4('0x42')]=function(_0x3b6c16,_0x4c9d64){return respondWithRpcPromise('MailAccounts',_0x3b6c16[_0x76f4('0x17')],mailClient)['then'](respondWithResult(_0x4c9d64,null))[_0x76f4('0xc')](handleError(_0x4c9d64,null));};exports['openchannelQueues']=function(_0x4285dd,_0x25e510){return respondWithRpcPromise(_0x76f4('0x43'),_0x4285dd[_0x76f4('0x17')],routingClient)['then'](respondWithResult(_0x25e510,null))[_0x76f4('0xc')](handleError(_0x25e510,null));};exports[_0x76f4('0x44')]=function(_0x22a0cc,_0x40c170){return respondWithRpcPromise(_0x76f4('0x43'),_0x22a0cc[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](findById(_0x22a0cc['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x40c170,null))[_0x76f4('0xc')](handleError(_0x40c170,null));};exports[_0x76f4('0x45')]=function(_0x320a87,_0x28cf4c){return respondWithRpcPromise(_0x76f4('0x46'),_0x320a87[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x28cf4c,null))['catch'](handleError(_0x28cf4c,null));};exports['showSmsQueues']=function(_0xa3091a,_0x617924){return respondWithRpcPromise(_0x76f4('0x46'),_0xa3091a['query'],routingClient)[_0x76f4('0x7')](findById(_0xa3091a['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x617924,null))[_0x76f4('0xc')](handleError(_0x617924,null));};exports['whatsappQueues']=function(_0xda0ac2,_0x37b7f7){return respondWithRpcPromise(_0x76f4('0x47'),_0xda0ac2[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x37b7f7,null))[_0x76f4('0xc')](handleError(_0x37b7f7,null));};exports[_0x76f4('0x48')]=function(_0x410d83,_0x1f7257){return respondWithRpcPromise('WhatsappQueues',_0x410d83[_0x76f4('0x17')],routingClient)['then'](findById(_0x410d83[_0x76f4('0x1a')]['id']))[_0x76f4('0x7')](respondWithResult(_0x1f7257,null))[_0x76f4('0xc')](handleError(_0x1f7257,null));};exports[_0x76f4('0x49')]=function(_0xfbb52c,_0x8de630){return respondWithRpcPromise(_0x76f4('0x4a'),_0xfbb52c[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x8de630,null))[_0x76f4('0xc')](handleError(_0x8de630,null));};exports['showFaxQueues']=function(_0x30f3de,_0x6f874d){return respondWithRpcPromise('FaxQueues',_0x30f3de[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](findById(_0x30f3de[_0x76f4('0x1a')]['id']))['then'](respondWithResult(_0x6f874d,null))[_0x76f4('0xc')](handleError(_0x6f874d,null));};exports[_0x76f4('0x4b')]=function(_0x3e829f,_0x52610a){return respondWithRpcPromise(_0x76f4('0x4c'),_0x3e829f[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x52610a,null))[_0x76f4('0xc')](handleError(_0x52610a,null));};exports[_0x76f4('0x4d')]=function(_0x10ee07,_0x19b99c){return respondWithRpcPromise(_0x76f4('0x4e'),_0x10ee07[_0x76f4('0x17')],routingClient)['then'](respondWithResult(_0x19b99c,null))[_0x76f4('0xc')](handleError(_0x19b99c,null));};exports[_0x76f4('0x4f')]=function(_0x19fdc3,_0x39c9af){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x19fdc3[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x39c9af,null))[_0x76f4('0xc')](handleError(_0x39c9af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x43b44d,_0x1375d5){return respondWithRpcPromise(_0x76f4('0x50'),_0x43b44d[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x1375d5,null))['catch'](handleError(_0x1375d5,null));};exports[_0x76f4('0x51')]=function(_0x4dd41f,_0x2b8467){return respondWithRpcPromise(_0x76f4('0x50'),_0x4dd41f['query'],routingClient)['then'](function(_0x58251e){if(_0x4dd41f[_0x76f4('0x17')][_0x76f4('0x52')]!==undefined){var _0x1e7b6=_(_0x58251e[_0x76f4('0x13')])[_0x76f4('0x53')]([_0x4dd41f[_0x76f4('0x17')]['type'],_0x4dd41f[_0x76f4('0x1a')]['id']])[_0x76f4('0x54')](_0x76f4('0x55'))[_0x76f4('0x56')]()[_0x76f4('0x57')]();return _0x58251e[_0x76f4('0x13')][_0x76f4('0x53')](function(_0x202fc8){return _0x1e7b6['indexOf'](_0x202fc8[_0x76f4('0x55')])>-0x1;});}else{return _0x58251e['rows'][_0x76f4('0x53')](function(_0x30358a){return _0x30358a[_0x76f4('0x55')]===parseInt(_0x4dd41f[_0x76f4('0x1a')]['id']);});}})[_0x76f4('0x7')](respondWithResult(_0x2b8467,null))[_0x76f4('0xc')](handleError(_0x2b8467,null));};exports[_0x76f4('0x58')]=function(_0x2a0491,_0x54729b){return respondWithRpcPromise(_0x76f4('0x59'),_0x2a0491['query'],routingClient)['then'](respondWithResult(_0x54729b,null))['catch'](handleError(_0x54729b,null));};exports[_0x76f4('0x5a')]=function(_0x402209,_0x279040){return respondWithRpcPromise(_0x76f4('0x5b'),_0x402209['query'],routingClient)[_0x76f4('0x7')](respondWithResult(_0x279040,null))[_0x76f4('0xc')](handleError(_0x279040,null));};exports[_0x76f4('0x5c')]=function(_0x5f5c24,_0x12f16e){return respondWithRpcPromise(_0x76f4('0x5d'),_0x5f5c24[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x12f16e,null))[_0x76f4('0xc')](handleError(_0x12f16e,null));};exports[_0x76f4('0x5e')]=function(_0x3b5e15){return function(_0x4b562c,_0x2e991e){var _0xa49e2a,_0x4c7307;var _0x3bc914=_[_0x76f4('0x5f')](_0x3b5e15);var _0x5e6393=_0x3b5e15===_0x76f4('0x60')?_0x76f4('0x61'):_0x76f4('0x62');return db[_0x3bc914+_0x76f4('0x63')][_0x76f4('0x64')]({'raw':!![],'where':{'id':_0x4b562c[_0x76f4('0x1a')]['id']}})['then'](function(_0x2dac86){if(_[_0x76f4('0x12')](_0x2dac86)){throw new Error(_0x3bc914+_0x76f4('0x65'));}_0xa49e2a=_0x2dac86;return db[_0x3bc914+_0x76f4('0x66')]['findOne']({'where':{'id':_0x4b562c[_0x76f4('0x1f')]['messageId']},'include':[{'model':db[_0x3bc914+_0x76f4('0x67')],'as':'Interaction'},{'model':db[_0x3bc914+_0x5e6393],'as':_0x76f4('0x62')}]});})[_0x76f4('0x7')](function(_0x59e9ed){if(_['isNil'](_0x59e9ed)){throw new Error(_0x3bc914+_0x76f4('0x68'));}_0x4c7307=_0x59e9ed;return _0x59e9ed[_0x76f4('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x76f4('0x7')](function(){var _0x4a2969={'uniqueid':_0x3b5e15+'.'+_0x4c7307['id']+'.'+_0x4c7307['Interaction']['id'],'FromUserId':_0x4b562c[_0x76f4('0x30')]['id'],'type':_0x76f4('0x6a')};_0x4a2969[_0x3bc914+_0x76f4('0x6b')]=_0x4c7307['id'];_0x4a2969[_0x3bc914+_0x76f4('0x6c')]=_0x4c7307[_0x76f4('0x67')]['id'];_0x4a2969[_0x76f4('0x6d')+_0x3bc914+_0x5e6393+'Id']=_0x4c7307[_0x76f4('0x62')]['id'];_0x4a2969['To'+_0x3bc914+_0x76f4('0x6e')]=_0xa49e2a['id'];return db[_0x3bc914+'TransferReport']['create'](_0x4a2969);})[_0x76f4('0x7')](function(){return respondWithRpcPromise(_0x76f4('0x6f'),{'channel':_0x3b5e15,'interaction':_0x4c7307[_0x76f4('0x67')],'message':_0x4c7307,'account':_0x4c7307['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x76f4('0x6a'),'appdata':_0xa49e2a[_0x76f4('0x10')]+','+(_0x4c7307[_0x76f4('0x62')][_0x76f4('0x70')]||0x12c),'interval':_0x76f4('0x71')}]},routingClient);})[_0x76f4('0x7')](respondWithResult(_0x2e991e,null))[_0x76f4('0xc')](handleError(_0x2e991e,null));};};exports['agentNotify']=function(_0x13cf2a,_0x316f86){var _0x3e537b,_0x53252e;if(_[_0x76f4('0x12')](_0x13cf2a[_0x76f4('0x1f')][_0x76f4('0x72')])){throw new Error(_0x76f4('0x73'));}var _0x5080a9=_0x13cf2a[_0x76f4('0x1f')]['channel'];var _0xc80d4c=_['capitalize'](_0x5080a9);var _0x238df3=_0x5080a9===_0x76f4('0x60')?_0x76f4('0x61'):'Account';return db[_0x76f4('0x74')][_0x76f4('0x64')]({'raw':!![],'where':{'id':_0x13cf2a[_0x76f4('0x1a')]['id'],'role':'agent'}})[_0x76f4('0x7')](function(_0x460867){if(_['isNil'](_0x460867)){throw new Error('Agent\x20not\x20found');}_0x3e537b=_0x460867;return db[_0xc80d4c+_0x76f4('0x66')][_0x76f4('0x64')]({'where':{'id':_0x13cf2a['body']['messageId']},'include':[{'model':db[_0xc80d4c+_0x76f4('0x67')],'as':_0x76f4('0x67')},{'model':db[_0xc80d4c+_0x238df3],'as':'Account'}]});})[_0x76f4('0x7')](function(_0x54ae6c){if(_['isNil'](_0x54ae6c)){throw new Error(_0xc80d4c+'\x20Message\x20not\x20found');}_0x53252e=_0x54ae6c;return _0x54ae6c[_0x76f4('0x69')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x59265d={'uniqueid':_0x5080a9+'.'+_0x53252e['id']+'.'+_0x53252e[_0x76f4('0x67')]['id'],'FromUserId':_0x13cf2a['user']['id'],'type':'queue','ToUserId':_0x3e537b['id']};_0x59265d[_0xc80d4c+_0x76f4('0x6b')]=_0x53252e['id'];_0x59265d[_0xc80d4c+'InteractionId']=_0x53252e[_0x76f4('0x67')]['id'];_0x59265d[_0x76f4('0x6d')+_0xc80d4c+_0x238df3+'Id']=_0x53252e['Account']['id'];return db[_0xc80d4c+'TransferReport'][_0x76f4('0x75')](_0x59265d);})[_0x76f4('0x7')](function(){return respondWithRpcPromise(_0x76f4('0x6f'),{'channel':_0x5080a9,'interaction':_0x53252e['Interaction'],'message':_0x53252e,'account':_0x53252e[_0x76f4('0x62')],'applications':[{'id':0x0,'priority':0x1,'app':_0x76f4('0x38'),'appdata':_0x3e537b[_0x76f4('0x10')]+','+(_0x53252e[_0x76f4('0x62')]['agentTransferTimeout']||0x12c),'interval':_0x76f4('0x71')}]},routingClient);})[_0x76f4('0x7')](respondWithResult(_0x316f86,null))[_0x76f4('0xc')](handleError(_0x316f86,null));}; \ No newline at end of file +var _0x55ca=['ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','uniq','value','indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','update','MessageId','InteractionId','From','QueueId','create','Start','queue','*,*,*,*','agentNotify','channel','Website','User','Agent\x20not\x20found','Message','\x20Message\x20not\x20found','agentTransferTimeout','bluebird','moment','../../config/logger','api','client','http','request','error','code','message','result','catch','stack','name','status','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','then','voiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','params','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','outboundChannels','agents','Agents','agentCapacity','user','interaction','hasOwnProperty','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','MemberReport','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions'];(function(_0x211440,_0x4af2bc){var _0x14522b=function(_0xc16dd){while(--_0xc16dd){_0x211440['push'](_0x211440['shift']());}};_0x14522b(++_0x4af2bc);}(_0x55ca,0x126));var _0xa55c=function(_0x999b85,_0x1edc2b){_0x999b85=_0x999b85-0x0;var _0x1d7124=_0x55ca[_0x999b85];return _0x1d7124;};'use strict';var BPromise=require(_0xa55c('0x0'));var moment=require(_0xa55c('0x1'));var _=require('lodash');var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0xa55c('0x2'))(_0xa55c('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0xa55c('0x4')][_0xa55c('0x5')]({'port':0x232a});var mailClient=jayson[_0xa55c('0x4')][_0xa55c('0x5')]({'port':0x232b});var routingClient=jayson[_0xa55c('0x4')][_0xa55c('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){var _0x291996=_0x2121fd?_0x2121fd:amiClient;return _0x291996[_0xa55c('0x6')](_0x36b623,_0x4d0624)['then'](function(_0x5849ad){if(_0x5849ad[_0xa55c('0x7')]){if(_0x5849ad[_0xa55c('0x7')][_0xa55c('0x8')]===0x1f4){return _0x57e069(_0x5849ad[_0xa55c('0x7')][_0xa55c('0x9')]);}return _0x2537f0(_0x5849ad[_0xa55c('0x7')][_0xa55c('0x9')]);}else{_0x2537f0(_0x5849ad[_0xa55c('0xa')]);}})[_0xa55c('0xb')](function(_0x15eec8){_0x57e069(_0x15eec8);});});}function respondWithResult(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xc8;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['status'](_0x59d84a)['json'](_0x2a35be);}return _0x5d47ff['sendStatus'](0x194);};}function handleError(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0x1f4;return function(_0x462cd6){logger[_0xa55c('0x7')](_0x462cd6[_0xa55c('0xc')]);if(_0x462cd6[_0xa55c('0xd')]){delete _0x462cd6['name'];}_0x18ee85[_0xa55c('0xe')](_0x3930e4)[_0xa55c('0xf')](_0x462cd6);};}function findById(_0x25934f){return function(_0x31e10d){if(!_[_0xa55c('0x10')](_0x25934f)&&!_[_0xa55c('0x10')](_0x31e10d)&&!_[_0xa55c('0x10')](_0x31e10d[_0xa55c('0x11')])){return _[_0xa55c('0x12')](_0x31e10d['rows'],function(_0x3d4c9e){return _0x3d4c9e['id']==_0x25934f;});}return null;};}exports[_0xa55c('0x13')]=function(_0x461284,_0x358b61){return respondWithRpcPromise(_0xa55c('0x14'),_0x461284[_0xa55c('0x15')])['then'](respondWithResult(_0x358b61,null))['catch'](handleError(_0x358b61,null));};exports[_0xa55c('0x16')]=function(_0x3776ac,_0xade4c4){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xa55c('0x17')](_0x3776ac[_0xa55c('0x15')],_0x3776ac['params']))[_0xa55c('0x18')](respondWithResult(_0xade4c4,null))[_0xa55c('0xb')](handleError(_0xade4c4,null));};exports[_0xa55c('0x19')]=function(_0x1965f1,_0x234372){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xa55c('0x17')](_0x1965f1['query'],_0x1965f1['params']))['then'](respondWithResult(_0x234372,null))[_0xa55c('0xb')](handleError(_0x234372,null));};exports['voiceQueues']=function(_0x3ecbe7,_0x190757){return respondWithRpcPromise(_0xa55c('0x1a'),_0x3ecbe7[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x190757,null))[_0xa55c('0xb')](handleError(_0x190757,null));};exports[_0xa55c('0x1b')]=function(_0x11e7f7,_0x192df2){return respondWithRpcPromise(_0xa55c('0x1a'),_0x11e7f7[_0xa55c('0x15')])['then'](findById(_0x11e7f7[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x192df2,null))[_0xa55c('0xb')](handleError(_0x192df2,null));};exports[_0xa55c('0x1d')]=function(_0x5d940d,_0x1377b0){return respondWithRpcPromise(_0xa55c('0x1e'),_[_0xa55c('0x17')](_0x5d940d[_0xa55c('0x1f')],_0x5d940d[_0xa55c('0x1c')]))[_0xa55c('0x18')](respondWithResult(_0x1377b0,null))['catch'](handleError(_0x1377b0,null));};exports[_0xa55c('0x20')]=function(_0x490b7d,_0x35c9c2){return respondWithRpcPromise(_0xa55c('0x21'),_[_0xa55c('0x17')](_0x490b7d[_0xa55c('0x15')],_0x490b7d['params']))[_0xa55c('0x18')](respondWithResult(_0x35c9c2,null))[_0xa55c('0xb')](handleError(_0x35c9c2,null));};exports[_0xa55c('0x22')]=function(_0x20da31,_0x10f4b7){return respondWithRpcPromise(_0xa55c('0x23'),_0x20da31[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x10f4b7,null))[_0xa55c('0xb')](handleError(_0x10f4b7,null));};exports[_0xa55c('0x24')]=function(_0x197099,_0x4eb7c4){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xa55c('0x17')](_0x197099[_0xa55c('0x15')],_0x197099['params']))[_0xa55c('0x18')](respondWithResult(_0x4eb7c4,null))[_0xa55c('0xb')](handleError(_0x4eb7c4,null));};exports[_0xa55c('0x25')]=function(_0x1839ac,_0x30d4f8){return respondWithRpcPromise(_0xa55c('0x26'),_[_0xa55c('0x17')](_0x1839ac[_0xa55c('0x15')],_0x1839ac[_0xa55c('0x1c')]))['then'](respondWithResult(_0x30d4f8,null))['catch'](handleError(_0x30d4f8,null));};exports['voiceQueuesChannelRedirect']=function(_0x3fd75f,_0x18e00e){return respondWithRpcPromise(_0xa55c('0x27'),_['merge'](_0x3fd75f[_0xa55c('0x15')],_0x3fd75f['params']))[_0xa55c('0x18')](respondWithResult(_0x18e00e,null))['catch'](handleError(_0x18e00e,null));};exports[_0xa55c('0x28')]=function(_0x39267c,_0x3c0ec1){return respondWithRpcPromise('Outbound',_0x39267c[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x3c0ec1,null))['catch'](handleError(_0x3c0ec1,null));};exports[_0xa55c('0x29')]=function(_0x194e78,_0x4d9083){return respondWithRpcPromise('OutboundChannels',_0x194e78[_0xa55c('0x15')])['then'](respondWithResult(_0x4d9083,null))[_0xa55c('0xb')](handleError(_0x4d9083,null));};exports[_0xa55c('0x2a')]=function(_0x5427bf,_0x542d76){var _0x5e50b6;return respondWithRpcPromise('Agents',_0x5427bf[_0xa55c('0x15')])[_0xa55c('0x18')](function(_0x429336){_0x5e50b6=_0x429336;return respondWithRpcPromise(_0xa55c('0x2b'),_0x5427bf[_0xa55c('0x15')],routingClient);})['then'](function(_0x3d52d8){return _[_0xa55c('0x17')]({},_0x3d52d8,_0x5e50b6);})[_0xa55c('0x18')](respondWithResult(_0x542d76,null))[_0xa55c('0xb')](handleError(_0x542d76,null));};exports[_0xa55c('0x2c')]=function(_0x23cef5,_0x554620){if(_0x23cef5[_0xa55c('0x1f')]&&_0x23cef5['body']['interaction']&&_0x23cef5[_0xa55c('0x2d')]&&_0x23cef5[_0xa55c('0x2d')]['name']){for(var _0x2bd98b in _0x23cef5['body']['interaction']){if(_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x2e')][_0xa55c('0x2f')](_0x2bd98b)){db['MemberReport'][_0xa55c('0x30')]({'where':{'channel':_0x2bd98b,'membername':_0x23cef5[_0xa55c('0x2d')]['name'],'type':_0xa55c('0x31'),'exitAt':null,'uniqueid':_0x23cef5['body'][_0xa55c('0x2e')][_0x2bd98b]&&_0x23cef5[_0xa55c('0x1f')]['interaction'][_0x2bd98b][_0xa55c('0x32')]?{'$notIn':_0x23cef5[_0xa55c('0x1f')]['interaction'][_0x2bd98b]}:{'$ne':null}}})[_0xa55c('0x18')](function(_0x187e09){var _0x204767=moment()['format'](_0xa55c('0x33'));for(var _0x582901=0x0,_0x2f9717=_0x187e09[_0xa55c('0x32')];_0x582901<_0x2f9717;_0x582901+=0x1){_0x187e09[_0x582901][_0xa55c('0x34')]({'exitAt':_0x204767});}});for(var _0x51d663=0x0;_0x51d663<_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x2e')][_0x2bd98b]['length'];_0x51d663+=0x1){db[_0xa55c('0x35')][_0xa55c('0x36')]({'where':{'channel':_0x2bd98b,'membername':_0x23cef5['user'][_0xa55c('0xd')],'type':_0xa55c('0x31'),'uniqueid':_0x23cef5['body'][_0xa55c('0x2e')][_0x2bd98b][_0x51d663],'exitAt':null},'defaults':{'channel':_0x2bd98b,'membername':_0x23cef5[_0xa55c('0x2d')][_0xa55c('0xd')],'interface':_[_0xa55c('0x10')](_0x23cef5['user'][_0xa55c('0x37')])?util['format'](_0xa55c('0x38'),_0x23cef5[_0xa55c('0x2d')][_0xa55c('0xd')]):_0x23cef5['user'][_0xa55c('0x37')],'type':_0xa55c('0x31'),'enterAt':moment()['format'](_0xa55c('0x33')),'role':_0xa55c('0x39'),'internal':_0x23cef5[_0xa55c('0x2d')][_0xa55c('0x3a')],'uniqueid':_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x2e')][_0x2bd98b][_0x51d663]}});}}}}return respondWithRpcPromise(_0xa55c('0x3b'),{'id':_0x23cef5[_0xa55c('0x1c')]['id'],'capacity':_0x23cef5[_0xa55c('0x1f')][_0xa55c('0x3c')]},routingClient)['then'](respondWithResult(_0x554620,null))[_0xa55c('0xb')](handleError(_0x554620,null));};exports[_0xa55c('0x3d')]=function(_0x216de8,_0x4f73b6){return respondWithRpcPromise(_0xa55c('0x3e'),_0x216de8[_0xa55c('0x15')])['then'](respondWithResult(_0x4f73b6,null))[_0xa55c('0xb')](handleError(_0x4f73b6,null));};exports['trunks']=function(_0x2b6a0e,_0x228df4){return respondWithRpcPromise(_0xa55c('0x3f'),_0x2b6a0e[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x228df4,null))['catch'](handleError(_0x228df4,null));};exports[_0xa55c('0x40')]=function(_0x4607ca,_0x4b85cc){return respondWithRpcPromise(_0xa55c('0x41'),_0x4607ca[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x4b85cc,null))[_0xa55c('0xb')](handleError(_0x4b85cc,null));};exports['chatQueues']=function(_0x4def35,_0x267965){return respondWithRpcPromise(_0xa55c('0x42'),_0x4def35[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x267965,null))['catch'](handleError(_0x267965,null));};exports[_0xa55c('0x43')]=function(_0x5ce463,_0x2742e4){return respondWithRpcPromise(_0xa55c('0x42'),_0x5ce463[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x5ce463[_0xa55c('0x1c')]['id']))['then'](respondWithResult(_0x2742e4,null))[_0xa55c('0xb')](handleError(_0x2742e4,null));};exports['mailQueues']=function(_0x23f67f,_0x157afe){return respondWithRpcPromise(_0xa55c('0x44'),_0x23f67f[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x157afe,null))[_0xa55c('0xb')](handleError(_0x157afe,null));};exports[_0xa55c('0x45')]=function(_0x53e2be,_0x450567){return respondWithRpcPromise(_0xa55c('0x44'),_0x53e2be[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x53e2be[_0xa55c('0x1c')]['id']))['then'](respondWithResult(_0x450567,null))[_0xa55c('0xb')](handleError(_0x450567,null));};exports[_0xa55c('0x46')]=function(_0x28bac4,_0x20e53c){return respondWithRpcPromise(_0xa55c('0x47'),_0x28bac4['query'],mailClient)[_0xa55c('0x18')](respondWithResult(_0x20e53c,null))[_0xa55c('0xb')](handleError(_0x20e53c,null));};exports[_0xa55c('0x48')]=function(_0x16d9b2,_0x3ba56d){return respondWithRpcPromise('OpenchannelQueues',_0x16d9b2[_0xa55c('0x15')],routingClient)['then'](respondWithResult(_0x3ba56d,null))[_0xa55c('0xb')](handleError(_0x3ba56d,null));};exports['showOpenchannelQueues']=function(_0x3495a7,_0x5a8897){return respondWithRpcPromise(_0xa55c('0x49'),_0x3495a7[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x3495a7[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x5a8897,null))[_0xa55c('0xb')](handleError(_0x5a8897,null));};exports[_0xa55c('0x4a')]=function(_0x2f2226,_0x14b515){return respondWithRpcPromise(_0xa55c('0x4b'),_0x2f2226['query'],routingClient)[_0xa55c('0x18')](respondWithResult(_0x14b515,null))[_0xa55c('0xb')](handleError(_0x14b515,null));};exports['showSmsQueues']=function(_0x18b928,_0x2b8b88){return respondWithRpcPromise(_0xa55c('0x4b'),_0x18b928[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x18b928[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x2b8b88,null))[_0xa55c('0xb')](handleError(_0x2b8b88,null));};exports['whatsappQueues']=function(_0x1dfaf7,_0x475131){return respondWithRpcPromise(_0xa55c('0x4c'),_0x1dfaf7[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x475131,null))[_0xa55c('0xb')](handleError(_0x475131,null));};exports[_0xa55c('0x4d')]=function(_0x4249c1,_0x25d5a1){return respondWithRpcPromise('WhatsappQueues',_0x4249c1[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](findById(_0x4249c1[_0xa55c('0x1c')]['id']))[_0xa55c('0x18')](respondWithResult(_0x25d5a1,null))[_0xa55c('0xb')](handleError(_0x25d5a1,null));};exports[_0xa55c('0x4e')]=function(_0x3ea755,_0x3606b2){return respondWithRpcPromise(_0xa55c('0x4f'),_0x3ea755[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x3606b2,null))['catch'](handleError(_0x3606b2,null));};exports[_0xa55c('0x50')]=function(_0x531eee,_0x1228a4){return respondWithRpcPromise(_0xa55c('0x4f'),_0x531eee[_0xa55c('0x15')],routingClient)['then'](findById(_0x531eee['params']['id']))[_0xa55c('0x18')](respondWithResult(_0x1228a4,null))[_0xa55c('0xb')](handleError(_0x1228a4,null));};exports[_0xa55c('0x51')]=function(_0x42529f,_0x4c7ee1){return respondWithRpcPromise(_0xa55c('0x52'),_0x42529f[_0xa55c('0x15')])[_0xa55c('0x18')](respondWithResult(_0x4c7ee1,null))[_0xa55c('0xb')](handleError(_0x4c7ee1,null));};exports[_0xa55c('0x53')]=function(_0x500968,_0x4b090c){return respondWithRpcPromise(_0xa55c('0x54'),_0x500968[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x4b090c,null))[_0xa55c('0xb')](handleError(_0x4b090c,null));};exports[_0xa55c('0x55')]=function(_0x4b2032,_0x14febc){return respondWithRpcPromise(_0xa55c('0x56'),_0x4b2032['query'],routingClient)[_0xa55c('0x18')](respondWithResult(_0x14febc,null))[_0xa55c('0xb')](handleError(_0x14febc,null));};exports[_0xa55c('0x57')]=function(_0x4dcb93,_0x1521d5){return respondWithRpcPromise(_0xa55c('0x58'),_0x4dcb93[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x1521d5,null))[_0xa55c('0xb')](handleError(_0x1521d5,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x25bd5b,_0x2e2cf6){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x25bd5b['query'],routingClient)[_0xa55c('0x18')](function(_0x4e1cbd){if(_0x25bd5b[_0xa55c('0x15')][_0xa55c('0x59')]!==undefined){var _0x2f13db=_(_0x4e1cbd[_0xa55c('0x11')])[_0xa55c('0x5a')]([_0x25bd5b[_0xa55c('0x15')][_0xa55c('0x59')],_0x25bd5b[_0xa55c('0x1c')]['id']])[_0xa55c('0x5b')]('queue_id')[_0xa55c('0x5c')]()[_0xa55c('0x5d')]();return _0x4e1cbd[_0xa55c('0x11')][_0xa55c('0x5a')](function(_0x4f0a26){return _0x2f13db[_0xa55c('0x5e')](_0x4f0a26[_0xa55c('0x5f')])>-0x1;});}else{return _0x4e1cbd[_0xa55c('0x11')][_0xa55c('0x5a')](function(_0x5d766e){return _0x5d766e['queue_id']===parseInt(_0x25bd5b[_0xa55c('0x1c')]['id']);});}})[_0xa55c('0x18')](respondWithResult(_0x2e2cf6,null))[_0xa55c('0xb')](handleError(_0x2e2cf6,null));};exports[_0xa55c('0x60')]=function(_0x5e87cb,_0x55ee0d){return respondWithRpcPromise(_0xa55c('0x61'),_0x5e87cb[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x55ee0d,null))[_0xa55c('0xb')](handleError(_0x55ee0d,null));};exports[_0xa55c('0x62')]=function(_0x346060,_0x239269){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x346060[_0xa55c('0x15')],routingClient)['then'](respondWithResult(_0x239269,null))[_0xa55c('0xb')](handleError(_0x239269,null));};exports['faxQueuesWaitingInteractions']=function(_0x36ded7,_0x313cdc){return respondWithRpcPromise(_0xa55c('0x63'),_0x36ded7[_0xa55c('0x15')],routingClient)[_0xa55c('0x18')](respondWithResult(_0x313cdc,null))[_0xa55c('0xb')](handleError(_0x313cdc,null));};exports[_0xa55c('0x64')]=function(_0x2c71ca){return function(_0x576a1b,_0x59414d){var _0x14cb74,_0x2948b1;var _0xc2ad5c=_[_0xa55c('0x65')](_0x2c71ca);var _0x1622cb=_0x2c71ca===_0xa55c('0x66')?'Website':_0xa55c('0x67');return db[_0xc2ad5c+_0xa55c('0x68')][_0xa55c('0x69')]({'raw':!![],'where':{'id':_0x576a1b[_0xa55c('0x1c')]['id']}})[_0xa55c('0x18')](function(_0x3b1cd7){if(_[_0xa55c('0x10')](_0x3b1cd7)){throw new Error(_0xc2ad5c+_0xa55c('0x6a'));}_0x14cb74=_0x3b1cd7;return db[_0xc2ad5c+'Message'][_0xa55c('0x69')]({'where':{'id':_0x576a1b[_0xa55c('0x1f')][_0xa55c('0x6b')]},'include':[{'model':db[_0xc2ad5c+_0xa55c('0x6c')],'as':_0xa55c('0x6c')},{'model':db[_0xc2ad5c+_0x1622cb],'as':'Account'}]});})[_0xa55c('0x18')](function(_0x2ab1f2){if(_['isNil'](_0x2ab1f2)){throw new Error(_0xc2ad5c+'\x20Message\x20not\x20found');}_0x2948b1=_0x2ab1f2;return _0x2ab1f2[_0xa55c('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa55c('0x18')](function(){var _0x5c2229={'uniqueid':_0x2c71ca+'.'+_0x2948b1['id']+'.'+_0x2948b1['Interaction']['id'],'FromUserId':_0x576a1b['user']['id'],'type':'queue'};_0x5c2229[_0xc2ad5c+_0xa55c('0x6e')]=_0x2948b1['id'];_0x5c2229[_0xc2ad5c+_0xa55c('0x6f')]=_0x2948b1[_0xa55c('0x6c')]['id'];_0x5c2229[_0xa55c('0x70')+_0xc2ad5c+_0x1622cb+'Id']=_0x2948b1[_0xa55c('0x67')]['id'];_0x5c2229['To'+_0xc2ad5c+_0xa55c('0x71')]=_0x14cb74['id'];return db[_0xc2ad5c+'TransferReport'][_0xa55c('0x72')](_0x5c2229);})[_0xa55c('0x18')](function(){return respondWithRpcPromise(_0xa55c('0x73'),{'channel':_0x2c71ca,'interaction':_0x2948b1[_0xa55c('0x6c')],'message':_0x2948b1,'account':_0x2948b1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xa55c('0x74'),'appdata':_0x14cb74[_0xa55c('0xd')]+','+(_0x2948b1[_0xa55c('0x67')]['queueTransferTimeout']||0x12c),'interval':_0xa55c('0x75')}]},routingClient);})['then'](respondWithResult(_0x59414d,null))['catch'](handleError(_0x59414d,null));};};exports[_0xa55c('0x76')]=function(_0x413b45,_0x1e298d){var _0x249b0c,_0x2544c1;if(_[_0xa55c('0x10')](_0x413b45[_0xa55c('0x1f')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x71bd0d=_0x413b45[_0xa55c('0x1f')][_0xa55c('0x77')];var _0x1f4bc8=_[_0xa55c('0x65')](_0x71bd0d);var _0x2a0805=_0x71bd0d===_0xa55c('0x66')?_0xa55c('0x78'):_0xa55c('0x67');return db[_0xa55c('0x79')]['findOne']({'raw':!![],'where':{'id':_0x413b45[_0xa55c('0x1c')]['id'],'role':_0xa55c('0x39')}})['then'](function(_0xb9708){if(_['isNil'](_0xb9708)){throw new Error(_0xa55c('0x7a'));}_0x249b0c=_0xb9708;return db[_0x1f4bc8+_0xa55c('0x7b')][_0xa55c('0x69')]({'where':{'id':_0x413b45[_0xa55c('0x1f')][_0xa55c('0x6b')]},'include':[{'model':db[_0x1f4bc8+'Interaction'],'as':_0xa55c('0x6c')},{'model':db[_0x1f4bc8+_0x2a0805],'as':_0xa55c('0x67')}]});})[_0xa55c('0x18')](function(_0x376c1f){if(_[_0xa55c('0x10')](_0x376c1f)){throw new Error(_0x1f4bc8+_0xa55c('0x7c'));}_0x2544c1=_0x376c1f;return _0x376c1f[_0xa55c('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x49a307={'uniqueid':_0x71bd0d+'.'+_0x2544c1['id']+'.'+_0x2544c1['Interaction']['id'],'FromUserId':_0x413b45[_0xa55c('0x2d')]['id'],'type':'queue','ToUserId':_0x249b0c['id']};_0x49a307[_0x1f4bc8+_0xa55c('0x6e')]=_0x2544c1['id'];_0x49a307[_0x1f4bc8+_0xa55c('0x6f')]=_0x2544c1[_0xa55c('0x6c')]['id'];_0x49a307[_0xa55c('0x70')+_0x1f4bc8+_0x2a0805+'Id']=_0x2544c1[_0xa55c('0x67')]['id'];return db[_0x1f4bc8+'TransferReport'][_0xa55c('0x72')](_0x49a307);})['then'](function(){return respondWithRpcPromise(_0xa55c('0x73'),{'channel':_0x71bd0d,'interaction':_0x2544c1[_0xa55c('0x6c')],'message':_0x2544c1,'account':_0x2544c1[_0xa55c('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':_0xa55c('0x39'),'appdata':_0x249b0c['name']+','+(_0x2544c1[_0xa55c('0x67')][_0xa55c('0x7d')]||0x12c),'interval':_0xa55c('0x75')}]},routingClient);})[_0xa55c('0x18')](respondWithResult(_0x1e298d,null))[_0xa55c('0xb')](handleError(_0x1e298d,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index a0901ca..741c3f4 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 _0xa4d1=['post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run'];(function(_0x2d7aae,_0x41b5bd){var _0x3a3e5e=function(_0x27d878){while(--_0x27d878){_0x2d7aae['push'](_0x2d7aae['shift']());}};_0x3a3e5e(++_0x41b5bd);}(_0xa4d1,0xbf));var _0x1a4d=function(_0x1e4022,_0x2ce85a){_0x1e4022=_0x1e4022-0x0;var _0x51c0c2=_0xa4d1[_0x1e4022];return _0x51c0c2;};'use strict';var multer=require(_0x1a4d('0x0'));var util=require(_0x1a4d('0x1'));var path=require(_0x1a4d('0x2'));var timeout=require('connect-timeout');var express=require(_0x1a4d('0x3'));var router=express[_0x1a4d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1a4d('0x5'));var interaction=require(_0x1a4d('0x6'));var config=require(_0x1a4d('0x7'));var controller=require(_0x1a4d('0x8'));router[_0x1a4d('0x9')]('/',auth[_0x1a4d('0xa')](),controller[_0x1a4d('0xb')]);router[_0x1a4d('0x9')](_0x1a4d('0xc'),auth[_0x1a4d('0xa')](),controller[_0x1a4d('0xd')]);router[_0x1a4d('0x9')](_0x1a4d('0xe'),auth[_0x1a4d('0xa')](),controller[_0x1a4d('0xf')]);router[_0x1a4d('0x10')]('/',auth[_0x1a4d('0xa')](),controller[_0x1a4d('0x11')]);router[_0x1a4d('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x1a4d('0x13')]);router[_0x1a4d('0x14')]('/:id',auth[_0x1a4d('0xa')](),controller[_0x1a4d('0x15')]);module[_0x1a4d('0x16')]=router; \ No newline at end of file +var _0x7ab3=['multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./schedule.controller','get','/:id','show','/:id/run','isAuthenticated','post','put','update','delete','destroy','exports'];(function(_0x1ff7f9,_0x7f4e5d){var _0x42f261=function(_0xa4451a){while(--_0xa4451a){_0x1ff7f9['push'](_0x1ff7f9['shift']());}};_0x42f261(++_0x7f4e5d);}(_0x7ab3,0x1ee));var _0x37ab=function(_0x4a563b,_0x36f42d){_0x4a563b=_0x4a563b-0x0;var _0x2935ef=_0x7ab3[_0x4a563b];return _0x2935ef;};'use strict';var multer=require(_0x37ab('0x0'));var util=require('util');var path=require(_0x37ab('0x1'));var timeout=require('connect-timeout');var express=require(_0x37ab('0x2'));var router=express[_0x37ab('0x3')]();var fs_extra=require(_0x37ab('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x37ab('0x5'));var config=require(_0x37ab('0x6'));var controller=require(_0x37ab('0x7'));router[_0x37ab('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x37ab('0x8')](_0x37ab('0x9'),auth['isAuthenticated'](),controller[_0x37ab('0xa')]);router['get'](_0x37ab('0xb'),auth[_0x37ab('0xc')](),controller['run']);router[_0x37ab('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x37ab('0xe')](_0x37ab('0x9'),auth['isAuthenticated'](),controller[_0x37ab('0xf')]);router[_0x37ab('0x10')](_0x37ab('0x9'),auth[_0x37ab('0xc')](),controller[_0x37ab('0x11')]);module[_0x37ab('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 d577780..6d11bb7 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 _0x014b=['days','hours','minutes','csv','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','weeks'];(function(_0x14ae10,_0x5dee7c){var _0x16d6b4=function(_0xf9d956){while(--_0xf9d956){_0x14ae10['push'](_0x14ae10['shift']());}};_0x16d6b4(++_0x5dee7c);}(_0x014b,0x170));var _0xb014=function(_0x13fc45,_0x27004d){_0x13fc45=_0x13fc45-0x0;var _0x257fe7=_0x014b[_0x13fc45];return _0x257fe7;};'use strict';var Sequelize=require(_0xb014('0x0'));module[_0xb014('0x1')]={'name':{'type':Sequelize[_0xb014('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb014('0x2')]},'active':{'type':Sequelize[_0xb014('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xb014('0x2')],'allowNull':![],'defaultValue':_0xb014('0x4')},'startAt':{'type':Sequelize[_0xb014('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xb014('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xb014('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xb014('0x7')](_0xb014('0x8'),'quarters','months',_0xb014('0x9'),_0xb014('0xa'),_0xb014('0xb'),_0xb014('0xc')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xb014('0x7')](_0xb014('0xd'),'pdf',_0xb014('0xe')),'allowNull':![],'defaultValue':_0xb014('0xd')},'type':{'type':Sequelize['ENUM'](_0xb014('0xf'),_0xb014('0x10')),'allowNull':![],'defaultValue':_0xb014('0xf')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xb014('0x2')]},'cc':{'type':Sequelize[_0xb014('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xb03d=['custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','quarters','months','days','hours','csv','pdf','ENUM'];(function(_0x4598de,_0x3db5b5){var _0x2b9b8b=function(_0x5a7059){while(--_0x5a7059){_0x4598de['push'](_0x4598de['shift']());}};_0x2b9b8b(++_0x3db5b5);}(_0xb03d,0x1f0));var _0xdb03=function(_0x3ee916,_0x2aa2ed){_0x3ee916=_0x3ee916-0x0;var _0x301658=_0xb03d[_0x3ee916];return _0x301658;};'use strict';var Sequelize=require(_0xdb03('0x0'));module[_0xdb03('0x1')]={'name':{'type':Sequelize[_0xdb03('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdb03('0x2')]},'active':{'type':Sequelize[_0xdb03('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xdb03('0x2')],'allowNull':![],'defaultValue':_0xdb03('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xdb03('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xdb03('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years',_0xdb03('0x7'),_0xdb03('0x8'),'weeks',_0xdb03('0x9'),_0xdb03('0xa'),'minutes'),'allowNull':![],'defaultValue':_0xdb03('0x9')},'output':{'type':Sequelize['ENUM'](_0xdb03('0xb'),_0xdb03('0xc'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xdb03('0xd')](_0xdb03('0xe'),_0xdb03('0xf')),'allowNull':![],'defaultValue':_0xdb03('0xe')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xdb03('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xdb03('0x10')]},'sendIfEmpty':{'type':Sequelize[_0xdb03('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index a6db922..aef76c6 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 _0x2b20=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','get','Scheduler','UserProfileResource','then','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','length','attributes','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','run','../../config/schedule'];(function(_0x3a9a79,_0xb12070){var _0x2a7bd0=function(_0x374cba){while(--_0x374cba){_0x3a9a79['push'](_0x3a9a79['shift']());}};_0x2a7bd0(++_0xb12070);}(_0x2b20,0x195));var _0x02b2=function(_0x4caa6f,_0x318878){_0x4caa6f=_0x4caa6f-0x0;var _0x11432c=_0x2b20[_0x4caa6f];return _0x11432c;};'use strict';var emlformat=require(_0x02b2('0x0'));var rimraf=require(_0x02b2('0x1'));var zipdir=require(_0x02b2('0x2'));var jsonpatch=require(_0x02b2('0x3'));var rp=require(_0x02b2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x02b2('0x5'));var util=require(_0x02b2('0x6'));var path=require(_0x02b2('0x7'));var sox=require('sox');var csv=require(_0x02b2('0x8'));var ejs=require(_0x02b2('0x9'));var fs=require('fs');var fs_extra=require(_0x02b2('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x02b2('0xb'));var toCsv=require(_0x02b2('0x8'));var querystring=require('querystring');var Papa=require(_0x02b2('0xc'));var Redis=require(_0x02b2('0xd'));var authService=require(_0x02b2('0xe'));var qs=require(_0x02b2('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x02b2('0x10'));var logger=require('../../config/logger')(_0x02b2('0x11'));var utils=require('../../config/utils');var config=require(_0x02b2('0x12'));var licenseUtil=require(_0x02b2('0x13'));var db=require(_0x02b2('0x14'))['db'];function respondWithStatusCode(_0x25d4fb,_0x32f233){_0x32f233=_0x32f233||0xcc;return function(_0x2c8441){if(_0x2c8441){return _0x25d4fb[_0x02b2('0x15')](_0x32f233);}return _0x25d4fb[_0x02b2('0x16')](_0x32f233)[_0x02b2('0x17')]();};}function respondWithResult(_0x476dd6,_0x2cbf76){_0x2cbf76=_0x2cbf76||0xc8;return function(_0x490ae9){if(_0x490ae9){return _0x476dd6['status'](_0x2cbf76)['json'](_0x490ae9);}};}function respondWithFilteredResult(_0x30dba5,_0x4da923){return function(_0x5cf5d3){if(_0x5cf5d3){var _0x447020=typeof _0x4da923[_0x02b2('0x18')]===_0x02b2('0x19')&&typeof _0x4da923[_0x02b2('0x1a')]===_0x02b2('0x19');var _0x411be2=_0x5cf5d3[_0x02b2('0x1b')];var _0x4dbf94=_0x447020?0x0:_0x4da923[_0x02b2('0x18')];var _0x40218a=_0x447020?_0x5cf5d3['count']:_0x4da923[_0x02b2('0x18')]+_0x4da923['limit'];var _0x1433ff;if(_0x40218a>=_0x411be2){_0x40218a=_0x411be2;_0x1433ff=0xc8;}else{_0x1433ff=0xce;}_0x30dba5['status'](_0x1433ff);return _0x30dba5[_0x02b2('0x1c')](_0x02b2('0x1d'),_0x4dbf94+'-'+_0x40218a+'/'+_0x411be2)[_0x02b2('0x1e')](_0x5cf5d3);}return null;};}function patchUpdates(_0x4a7eba){return function(_0x515e15){try{jsonpatch[_0x02b2('0x1f')](_0x515e15,_0x4a7eba,!![]);}catch(_0xf6aad2){return BPromise[_0x02b2('0x20')](_0xf6aad2);}return _0x515e15[_0x02b2('0x21')]();};}function saveUpdates(_0x598f7f,_0x4d216a){return function(_0x402424){if(_0x402424){return _0x402424['update'](_0x598f7f)['then'](function(_0x52a0ad){return _0x52a0ad;});}return null;};}function removeEntity(_0x13adcc,_0x21efc5){return function(_0x5c2b98){if(_0x5c2b98){return _0x5c2b98[_0x02b2('0x22')]()['then'](function(){var _0x5a184c=_0x5c2b98[_0x02b2('0x23')]({'plain':!![]});var _0x480d85=_0x02b2('0x24');return db[_0x02b2('0x25')][_0x02b2('0x22')]({'where':{'type':_0x480d85,'resourceId':_0x5a184c['id']}})[_0x02b2('0x26')](function(){return _0x5c2b98;});})[_0x02b2('0x26')](function(){_0x13adcc[_0x02b2('0x16')](0xcc)[_0x02b2('0x17')]();});}};}function handleEntityNotFound(_0x536e3f,_0xcbfaae){return function(_0x154a98){if(!_0x154a98){_0x536e3f['sendStatus'](0x194);}return _0x154a98;};}function handleError(_0x269045,_0x2e3f2f){_0x2e3f2f=_0x2e3f2f||0x1f4;return function(_0x3b29b7){logger[_0x02b2('0x27')](_0x3b29b7[_0x02b2('0x28')]);if(_0x3b29b7[_0x02b2('0x29')]){delete _0x3b29b7[_0x02b2('0x29')];}_0x269045['status'](_0x2e3f2f)[_0x02b2('0x2a')](_0x3b29b7);};}exports[_0x02b2('0x2b')]=function(_0x3dc19b,_0x5ecd5e){var _0x447c93={},_0x362a1f={},_0xa03b17={'count':0x0,'rows':[]};var _0x51d5bb=_[_0x02b2('0x2c')](db[_0x02b2('0x2d')][_0x02b2('0x2e')],function(_0x2ab7c4){return{'name':_0x2ab7c4[_0x02b2('0x2f')],'type':_0x2ab7c4[_0x02b2('0x30')][_0x02b2('0x31')]};});_0x362a1f[_0x02b2('0x32')]=_[_0x02b2('0x2c')](_0x51d5bb,_0x02b2('0x29'));_0x362a1f[_0x02b2('0x33')]=_['keys'](_0x3dc19b[_0x02b2('0x33')]);_0x362a1f[_0x02b2('0x34')]=_[_0x02b2('0x35')](_0x362a1f[_0x02b2('0x32')],_0x362a1f[_0x02b2('0x33')]);_0x447c93['attributes']=_[_0x02b2('0x35')](_0x362a1f['model'],qs[_0x02b2('0x36')](_0x3dc19b[_0x02b2('0x33')][_0x02b2('0x36')]));_0x447c93['attributes']=_0x447c93['attributes'][_0x02b2('0x37')]?_0x447c93[_0x02b2('0x38')]:_0x362a1f[_0x02b2('0x32')];if(!_0x3dc19b[_0x02b2('0x33')]['hasOwnProperty']('nolimit')){_0x447c93[_0x02b2('0x1a')]=qs['limit'](_0x3dc19b['query'][_0x02b2('0x1a')]);_0x447c93[_0x02b2('0x18')]=qs[_0x02b2('0x18')](_0x3dc19b['query'][_0x02b2('0x18')]);}_0x447c93['order']=qs[_0x02b2('0x39')](_0x3dc19b['query'][_0x02b2('0x39')]);_0x447c93[_0x02b2('0x3a')]=qs[_0x02b2('0x34')](_['pick'](_0x3dc19b['query'],_0x362a1f['filters']),_0x51d5bb);if(_0x3dc19b[_0x02b2('0x33')][_0x02b2('0x3b')]){_0x447c93['where']=_[_0x02b2('0x3c')](_0x447c93['where'],{'$or':_[_0x02b2('0x2c')](_0x51d5bb,function(_0x4435b8){if(_0x4435b8['type']!==_0x02b2('0x3d')){var _0x11d434={};_0x11d434[_0x4435b8[_0x02b2('0x29')]]={'$like':'%'+_0x3dc19b[_0x02b2('0x33')][_0x02b2('0x3b')]+'%'};return _0x11d434;}})});}_0x447c93=_[_0x02b2('0x3c')]({},_0x447c93,_0x3dc19b[_0x02b2('0x3e')]);var _0x19e3a4={'where':_0x447c93['where']};return db[_0x02b2('0x2d')][_0x02b2('0x1b')](_0x19e3a4)['then'](function(_0x4e1a0d){_0xa03b17[_0x02b2('0x1b')]=_0x4e1a0d;if(_0x3dc19b[_0x02b2('0x33')][_0x02b2('0x3f')]){_0x447c93[_0x02b2('0x40')]=[{'all':!![]}];}return db[_0x02b2('0x2d')][_0x02b2('0x41')](_0x447c93);})['then'](function(_0x120057){_0xa03b17[_0x02b2('0x42')]=_0x120057;return _0xa03b17;})['then'](respondWithFilteredResult(_0x5ecd5e,_0x447c93))['catch'](handleError(_0x5ecd5e,null));};exports['show']=function(_0x2f85e0,_0x36fd3e){var _0x3b26c8={'raw':![],'where':{'id':_0x2f85e0[_0x02b2('0x43')]['id']}},_0x464144={};_0x464144['model']=_['keys'](db[_0x02b2('0x2d')]['rawAttributes']);_0x464144[_0x02b2('0x33')]=_[_0x02b2('0x44')](_0x2f85e0[_0x02b2('0x33')]);_0x464144['filters']=_[_0x02b2('0x35')](_0x464144['model'],_0x464144[_0x02b2('0x33')]);_0x3b26c8[_0x02b2('0x38')]=_[_0x02b2('0x35')](_0x464144[_0x02b2('0x32')],qs['fields'](_0x2f85e0[_0x02b2('0x33')]['fields']));_0x3b26c8['attributes']=_0x3b26c8[_0x02b2('0x38')]['length']?_0x3b26c8[_0x02b2('0x38')]:_0x464144[_0x02b2('0x32')];if(_0x2f85e0[_0x02b2('0x33')][_0x02b2('0x3f')]){_0x3b26c8[_0x02b2('0x40')]=[{'all':!![]}];}_0x3b26c8=_['merge']({},_0x3b26c8,_0x2f85e0[_0x02b2('0x3e')]);return db[_0x02b2('0x2d')][_0x02b2('0x45')](_0x3b26c8)['then'](handleEntityNotFound(_0x36fd3e,null))['then'](respondWithResult(_0x36fd3e,null))[_0x02b2('0x46')](handleError(_0x36fd3e,null));};exports[_0x02b2('0x47')]=function(_0x25591b,_0xa0c351){return db[_0x02b2('0x2d')]['create'](_0x25591b['body'],{})['then'](function(_0x3ef83a){var _0x69fe02=_0x25591b['user'][_0x02b2('0x23')]({'plain':!![]});if(!_0x69fe02)throw new Error(_0x02b2('0x48'));if(_0x69fe02['role']==='user'){var _0x45a63d=_0x3ef83a['get']({'plain':!![]});var _0x9248fc=_0x02b2('0x24');return db[_0x02b2('0x49')]['find']({'where':{'name':_0x9248fc,'userProfileId':_0x69fe02[_0x02b2('0x4a')]},'raw':!![]})[_0x02b2('0x26')](function(_0xdf4ee3){if(_0xdf4ee3&&_0xdf4ee3[_0x02b2('0x4b')]===0x0){return db[_0x02b2('0x25')][_0x02b2('0x47')]({'name':_0x45a63d[_0x02b2('0x29')],'resourceId':_0x45a63d['id'],'type':_0xdf4ee3[_0x02b2('0x29')],'sectionId':_0xdf4ee3['id']},{})[_0x02b2('0x26')](function(){return _0x3ef83a;});}else{return _0x3ef83a;}})['catch'](function(_0x401619){logger[_0x02b2('0x27')](_0x02b2('0x4c'),_0x401619);throw _0x401619;});}return _0x3ef83a;})[_0x02b2('0x26')](respondWithResult(_0xa0c351,0xc9))[_0x02b2('0x46')](handleError(_0xa0c351,null));};exports[_0x02b2('0x4d')]=function(_0x24af8a,_0x5aa09d){if(_0x24af8a[_0x02b2('0x4e')]['id']){delete _0x24af8a[_0x02b2('0x4e')]['id'];}return db['Schedule']['find']({'where':{'id':_0x24af8a[_0x02b2('0x43')]['id']}})[_0x02b2('0x26')](handleEntityNotFound(_0x5aa09d,null))[_0x02b2('0x26')](saveUpdates(_0x24af8a[_0x02b2('0x4e')],null))[_0x02b2('0x26')](respondWithResult(_0x5aa09d,null))['catch'](handleError(_0x5aa09d,null));};exports[_0x02b2('0x22')]=function(_0xda738e,_0x26c14f){return db[_0x02b2('0x2d')][_0x02b2('0x45')]({'where':{'id':_0xda738e[_0x02b2('0x43')]['id']}})['then'](handleEntityNotFound(_0x26c14f,null))['then'](removeEntity(_0x26c14f,null))['catch'](handleError(_0x26c14f,null));};exports[_0x02b2('0x4f')]=function(_0x276f84,_0x430395,_0x39e8f5){var _0xd6cc01=require(_0x02b2('0x50'));return db['Schedule'][_0x02b2('0x45')]({'where':{'id':_0x276f84[_0x02b2('0x43')]['id']},'raw':!![]})[_0x02b2('0x26')](handleEntityNotFound(_0x430395,null))[_0x02b2('0x26')](function(){_0xd6cc01[_0x02b2('0x4f')](_0x276f84[_0x02b2('0x43')]['id']);})['then'](respondWithStatusCode(_0x430395,null))['catch'](handleError(_0x430395,null));}; \ No newline at end of file +var _0xa7c3=['model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','Schedule','includeAll','findAll','catch','show','params','keys','fields','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','save','update','then','get','Scheduler','UserProfileResource','destroy','error','stack','name','send','map','rawAttributes','type','key','query','filters','intersection'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xa7c3,0x113));var _0x3a7c=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xa7c3[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0x3a7c('0x0'));var rimraf=require(_0x3a7c('0x1'));var zipdir=require(_0x3a7c('0x2'));var jsonpatch=require(_0x3a7c('0x3'));var rp=require(_0x3a7c('0x4'));var moment=require(_0x3a7c('0x5'));var BPromise=require(_0x3a7c('0x6'));var Mustache=require(_0x3a7c('0x7'));var util=require(_0x3a7c('0x8'));var path=require(_0x3a7c('0x9'));var sox=require(_0x3a7c('0xa'));var csv=require(_0x3a7c('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3a7c('0xc'));var crypto=require('crypto');var jsforce=require(_0x3a7c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3a7c('0xb'));var querystring=require(_0x3a7c('0xe'));var Papa=require('papaparse');var Redis=require(_0x3a7c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3a7c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a7c('0x11'));var logger=require(_0x3a7c('0x12'))(_0x3a7c('0x13'));var utils=require('../../config/utils');var config=require(_0x3a7c('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfb4a4,_0x513e08){_0x513e08=_0x513e08||0xcc;return function(_0x35f80b){if(_0x35f80b){return _0xfb4a4[_0x3a7c('0x15')](_0x513e08);}return _0xfb4a4[_0x3a7c('0x16')](_0x513e08)[_0x3a7c('0x17')]();};}function respondWithResult(_0x129660,_0x5d3d51){_0x5d3d51=_0x5d3d51||0xc8;return function(_0x52ead3){if(_0x52ead3){return _0x129660[_0x3a7c('0x16')](_0x5d3d51)[_0x3a7c('0x18')](_0x52ead3);}};}function respondWithFilteredResult(_0x1d8bb6,_0x1fa321){return function(_0x1d3ed5){if(_0x1d3ed5){var _0x20f24b=typeof _0x1fa321[_0x3a7c('0x19')]===_0x3a7c('0x1a')&&typeof _0x1fa321['limit']==='undefined';var _0x49305c=_0x1d3ed5['count'];var _0x1b7b33=_0x20f24b?0x0:_0x1fa321['offset'];var _0x239f11=_0x20f24b?_0x1d3ed5[_0x3a7c('0x1b')]:_0x1fa321[_0x3a7c('0x19')]+_0x1fa321[_0x3a7c('0x1c')];var _0x574697;if(_0x239f11>=_0x49305c){_0x239f11=_0x49305c;_0x574697=0xc8;}else{_0x574697=0xce;}_0x1d8bb6['status'](_0x574697);return _0x1d8bb6[_0x3a7c('0x1d')](_0x3a7c('0x1e'),_0x1b7b33+'-'+_0x239f11+'/'+_0x49305c)[_0x3a7c('0x18')](_0x1d3ed5);}return null;};}function patchUpdates(_0x45ba0f){return function(_0x2a2194){try{jsonpatch['apply'](_0x2a2194,_0x45ba0f,!![]);}catch(_0x579f4b){return BPromise['reject'](_0x579f4b);}return _0x2a2194[_0x3a7c('0x1f')]();};}function saveUpdates(_0x15eaad,_0x2c3c86){return function(_0x34697c){if(_0x34697c){return _0x34697c[_0x3a7c('0x20')](_0x15eaad)[_0x3a7c('0x21')](function(_0x39c932){return _0x39c932;});}return null;};}function removeEntity(_0x101b6c,_0x5a5b9d){return function(_0x137a68){if(_0x137a68){return _0x137a68['destroy']()[_0x3a7c('0x21')](function(){var _0xb7a0c1=_0x137a68[_0x3a7c('0x22')]({'plain':!![]});var _0x328f63=_0x3a7c('0x23');return db[_0x3a7c('0x24')][_0x3a7c('0x25')]({'where':{'type':_0x328f63,'resourceId':_0xb7a0c1['id']}})['then'](function(){return _0x137a68;});})['then'](function(){_0x101b6c[_0x3a7c('0x16')](0xcc)[_0x3a7c('0x17')]();});}};}function handleEntityNotFound(_0x2ad487,_0x378161){return function(_0x35c9cf){if(!_0x35c9cf){_0x2ad487[_0x3a7c('0x15')](0x194);}return _0x35c9cf;};}function handleError(_0x368dec,_0x35a01c){_0x35a01c=_0x35a01c||0x1f4;return function(_0x375a3a){logger[_0x3a7c('0x26')](_0x375a3a[_0x3a7c('0x27')]);if(_0x375a3a[_0x3a7c('0x28')]){delete _0x375a3a[_0x3a7c('0x28')];}_0x368dec[_0x3a7c('0x16')](_0x35a01c)[_0x3a7c('0x29')](_0x375a3a);};}exports['index']=function(_0x341338,_0x3fbf87){var _0x67bce0={},_0x21f0a2={},_0x55cd18={'count':0x0,'rows':[]};var _0x217e55=_[_0x3a7c('0x2a')](db['Schedule'][_0x3a7c('0x2b')],function(_0x353d44){return{'name':_0x353d44['fieldName'],'type':_0x353d44[_0x3a7c('0x2c')][_0x3a7c('0x2d')]};});_0x21f0a2['model']=_['map'](_0x217e55,_0x3a7c('0x28'));_0x21f0a2[_0x3a7c('0x2e')]=_['keys'](_0x341338[_0x3a7c('0x2e')]);_0x21f0a2[_0x3a7c('0x2f')]=_[_0x3a7c('0x30')](_0x21f0a2[_0x3a7c('0x31')],_0x21f0a2[_0x3a7c('0x2e')]);_0x67bce0[_0x3a7c('0x32')]=_['intersection'](_0x21f0a2[_0x3a7c('0x31')],qs['fields'](_0x341338[_0x3a7c('0x2e')]['fields']));_0x67bce0[_0x3a7c('0x32')]=_0x67bce0[_0x3a7c('0x32')][_0x3a7c('0x33')]?_0x67bce0['attributes']:_0x21f0a2[_0x3a7c('0x31')];if(!_0x341338['query'][_0x3a7c('0x34')](_0x3a7c('0x35'))){_0x67bce0[_0x3a7c('0x1c')]=qs[_0x3a7c('0x1c')](_0x341338[_0x3a7c('0x2e')][_0x3a7c('0x1c')]);_0x67bce0[_0x3a7c('0x19')]=qs[_0x3a7c('0x19')](_0x341338[_0x3a7c('0x2e')]['offset']);}_0x67bce0[_0x3a7c('0x36')]=qs[_0x3a7c('0x37')](_0x341338[_0x3a7c('0x2e')][_0x3a7c('0x37')]);_0x67bce0[_0x3a7c('0x38')]=qs['filters'](_[_0x3a7c('0x39')](_0x341338[_0x3a7c('0x2e')],_0x21f0a2[_0x3a7c('0x2f')]),_0x217e55);if(_0x341338['query']['filter']){_0x67bce0['where']=_['merge'](_0x67bce0[_0x3a7c('0x38')],{'$or':_[_0x3a7c('0x2a')](_0x217e55,function(_0x139500){if(_0x139500[_0x3a7c('0x2c')]!==_0x3a7c('0x3a')){var _0x3503da={};_0x3503da[_0x139500[_0x3a7c('0x28')]]={'$like':'%'+_0x341338[_0x3a7c('0x2e')]['filter']+'%'};return _0x3503da;}})});}_0x67bce0=_[_0x3a7c('0x3b')]({},_0x67bce0,_0x341338['options']);var _0x26c89f={'where':_0x67bce0[_0x3a7c('0x38')]};return db[_0x3a7c('0x3c')][_0x3a7c('0x1b')](_0x26c89f)[_0x3a7c('0x21')](function(_0x350c94){_0x55cd18[_0x3a7c('0x1b')]=_0x350c94;if(_0x341338[_0x3a7c('0x2e')][_0x3a7c('0x3d')]){_0x67bce0['include']=[{'all':!![]}];}return db[_0x3a7c('0x3c')][_0x3a7c('0x3e')](_0x67bce0);})[_0x3a7c('0x21')](function(_0x1eca9d){_0x55cd18['rows']=_0x1eca9d;return _0x55cd18;})[_0x3a7c('0x21')](respondWithFilteredResult(_0x3fbf87,_0x67bce0))[_0x3a7c('0x3f')](handleError(_0x3fbf87,null));};exports[_0x3a7c('0x40')]=function(_0x511ec2,_0x2153c6){var _0x4cf608={'raw':![],'where':{'id':_0x511ec2[_0x3a7c('0x41')]['id']}},_0x4e5fa5={};_0x4e5fa5['model']=_['keys'](db['Schedule']['rawAttributes']);_0x4e5fa5[_0x3a7c('0x2e')]=_[_0x3a7c('0x42')](_0x511ec2[_0x3a7c('0x2e')]);_0x4e5fa5[_0x3a7c('0x2f')]=_[_0x3a7c('0x30')](_0x4e5fa5['model'],_0x4e5fa5[_0x3a7c('0x2e')]);_0x4cf608[_0x3a7c('0x32')]=_[_0x3a7c('0x30')](_0x4e5fa5['model'],qs['fields'](_0x511ec2[_0x3a7c('0x2e')][_0x3a7c('0x43')]));_0x4cf608[_0x3a7c('0x32')]=_0x4cf608[_0x3a7c('0x32')]['length']?_0x4cf608['attributes']:_0x4e5fa5[_0x3a7c('0x31')];if(_0x511ec2[_0x3a7c('0x2e')][_0x3a7c('0x3d')]){_0x4cf608[_0x3a7c('0x44')]=[{'all':!![]}];}_0x4cf608=_['merge']({},_0x4cf608,_0x511ec2[_0x3a7c('0x45')]);return db['Schedule'][_0x3a7c('0x46')](_0x4cf608)[_0x3a7c('0x21')](handleEntityNotFound(_0x2153c6,null))[_0x3a7c('0x21')](respondWithResult(_0x2153c6,null))[_0x3a7c('0x3f')](handleError(_0x2153c6,null));};exports[_0x3a7c('0x47')]=function(_0x5ded66,_0x1f9f26){return db['Schedule'][_0x3a7c('0x47')](_0x5ded66[_0x3a7c('0x48')],{})[_0x3a7c('0x21')](function(_0x50232a){var _0xd9820=_0x5ded66[_0x3a7c('0x49')][_0x3a7c('0x22')]({'plain':!![]});if(!_0xd9820)throw new Error(_0x3a7c('0x4a'));if(_0xd9820[_0x3a7c('0x4b')]==='user'){var _0x27d64b=_0x50232a[_0x3a7c('0x22')]({'plain':!![]});var _0x9d13a1=_0x3a7c('0x23');return db[_0x3a7c('0x4c')][_0x3a7c('0x46')]({'where':{'name':_0x9d13a1,'userProfileId':_0xd9820[_0x3a7c('0x4d')]},'raw':!![]})[_0x3a7c('0x21')](function(_0x4b4f64){if(_0x4b4f64&&_0x4b4f64['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x27d64b['name'],'resourceId':_0x27d64b['id'],'type':_0x4b4f64[_0x3a7c('0x28')],'sectionId':_0x4b4f64['id']},{})[_0x3a7c('0x21')](function(){return _0x50232a;});}else{return _0x50232a;}})[_0x3a7c('0x3f')](function(_0x270024){logger['error'](_0x3a7c('0x4e'),_0x270024);throw _0x270024;});}return _0x50232a;})[_0x3a7c('0x21')](respondWithResult(_0x1f9f26,0xc9))[_0x3a7c('0x3f')](handleError(_0x1f9f26,null));};exports[_0x3a7c('0x20')]=function(_0x55168b,_0x379a26){if(_0x55168b['body']['id']){delete _0x55168b[_0x3a7c('0x48')]['id'];}return db['Schedule']['find']({'where':{'id':_0x55168b['params']['id']}})[_0x3a7c('0x21')](handleEntityNotFound(_0x379a26,null))[_0x3a7c('0x21')](saveUpdates(_0x55168b[_0x3a7c('0x48')],null))[_0x3a7c('0x21')](respondWithResult(_0x379a26,null))[_0x3a7c('0x3f')](handleError(_0x379a26,null));};exports[_0x3a7c('0x25')]=function(_0x291042,_0x2baa63){return db[_0x3a7c('0x3c')][_0x3a7c('0x46')]({'where':{'id':_0x291042[_0x3a7c('0x41')]['id']}})['then'](handleEntityNotFound(_0x2baa63,null))[_0x3a7c('0x21')](removeEntity(_0x2baa63,null))[_0x3a7c('0x3f')](handleError(_0x2baa63,null));};exports[_0x3a7c('0x4f')]=function(_0x660b50,_0x5a4238,_0x54e27a){var _0x292639=require(_0x3a7c('0x50'));return db['Schedule'][_0x3a7c('0x46')]({'where':{'id':_0x660b50[_0x3a7c('0x41')]['id']},'raw':!![]})[_0x3a7c('0x21')](handleEntityNotFound(_0x5a4238,null))[_0x3a7c('0x21')](function(){_0x292639['run'](_0x660b50[_0x3a7c('0x41')]['id']);})['then'](respondWithStatusCode(_0x5a4238,null))[_0x3a7c('0x3f')](handleError(_0x5a4238,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 8231761..02eba58 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 _0x5556=['define','Schedule','tools_schedules','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xbb2e58,_0x1fe145){var _0x2f0d91=function(_0x331b3c){while(--_0x331b3c){_0xbb2e58['push'](_0xbb2e58['shift']());}};_0x2f0d91(++_0x1fe145);}(_0x5556,0x18f));var _0x6555=function(_0x5e8fe9,_0x1d3d88){_0x5e8fe9=_0x5e8fe9-0x0;var _0x5158b9=_0x5556[_0x5e8fe9];return _0x5158b9;};'use strict';var _=require('lodash');var util=require(_0x6555('0x0'));var logger=require(_0x6555('0x1'))(_0x6555('0x2'));var moment=require(_0x6555('0x3'));var BPromise=require(_0x6555('0x4'));var rp=require(_0x6555('0x5'));var fs=require('fs');var path=require(_0x6555('0x6'));var rimraf=require(_0x6555('0x7'));var config=require(_0x6555('0x8'));var attributes=require('./schedule.attributes');module['exports']=function(_0x5fd5e7,_0x34d7e5){return _0x5fd5e7[_0x6555('0x9')](_0x6555('0xa'),attributes,{'tableName':_0x6555('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96ec=['exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./schedule.attributes'];(function(_0x288efd,_0x86ff6b){var _0x7466bb=function(_0x36d83c){while(--_0x36d83c){_0x288efd['push'](_0x288efd['shift']());}};_0x7466bb(++_0x86ff6b);}(_0x96ec,0xc4));var _0xc96e=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x96ec[_0x9dfc10];return _0x4f938a;};'use strict';var _=require(_0xc96e('0x0'));var util=require(_0xc96e('0x1'));var logger=require(_0xc96e('0x2'))('api');var moment=require(_0xc96e('0x3'));var BPromise=require(_0xc96e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc96e('0x5'));var rimraf=require('rimraf');var config=require(_0xc96e('0x6'));var attributes=require(_0xc96e('0x7'));module[_0xc96e('0x8')]=function(_0x211a56,_0x203ecf){return _0x211a56[_0xc96e('0x9')](_0xc96e('0xa'),attributes,{'tableName':_0xc96e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index a35da04..92b8d69 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 _0x9ee6=['info','Schedule,\x20%s,\x20%s','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x9ee6,0x1d8));var _0x69ee=function(_0x593d89,_0x45145f){_0x593d89=_0x593d89-0x0;var _0x4aa403=_0x9ee6[_0x593d89];return _0x4aa403;};'use strict';var _=require('lodash');var util=require(_0x69ee('0x0'));var moment=require(_0x69ee('0x1'));var BPromise=require('bluebird');var rs=require(_0x69ee('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x69ee('0x3'))['db'];var utils=require(_0x69ee('0x4'));var logger=require(_0x69ee('0x5'))(_0x69ee('0x6'));var config=require(_0x69ee('0x7'));var jayson=require(_0x69ee('0x8'));var client=jayson[_0x69ee('0x9')][_0x69ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1681b4,_0x4edbaa,_0x252c14){return new BPromise(function(_0x157338,_0x4b7a34){return client['request'](_0x1681b4,_0x252c14)[_0x69ee('0xb')](function(_0x474c35){logger[_0x69ee('0xc')](_0x69ee('0xd'),_0x4edbaa,'request\x20sent');logger['debug'](_0x69ee('0xe'),_0x4edbaa,_0x69ee('0xf'),JSON[_0x69ee('0x10')](_0x474c35));if(_0x474c35[_0x69ee('0x11')]){if(_0x474c35['error'][_0x69ee('0x12')]===0x1f4){logger[_0x69ee('0x11')](_0x69ee('0xd'),_0x4edbaa,_0x474c35['error'][_0x69ee('0x13')]);return _0x4b7a34(_0x474c35[_0x69ee('0x11')][_0x69ee('0x13')]);}logger[_0x69ee('0x11')]('Schedule,\x20%s,\x20%s',_0x4edbaa,_0x474c35['error'][_0x69ee('0x13')]);return _0x157338(_0x474c35[_0x69ee('0x11')]['message']);}else{logger[_0x69ee('0xc')](_0x69ee('0xd'),_0x4edbaa,'request\x20sent');_0x157338(_0x474c35[_0x69ee('0x14')]['message']);}})[_0x69ee('0x15')](function(_0x278246){logger[_0x69ee('0x11')](_0x69ee('0xd'),_0x4edbaa,_0x278246);_0x4b7a34(_0x278246);});});} \ No newline at end of file +var _0xa974=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','message','Schedule,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x1222ac,_0x10efcc){var _0x147e72=function(_0x26f2dc){while(--_0x26f2dc){_0x1222ac['push'](_0x1222ac['shift']());}};_0x147e72(++_0x10efcc);}(_0xa974,0x186));var _0x4a97=function(_0x1e03a6,_0xf0349){_0x1e03a6=_0x1e03a6-0x0;var _0x295b64=_0xa974[_0x1e03a6];return _0x295b64;};'use strict';var _=require(_0x4a97('0x0'));var util=require('util');var moment=require(_0x4a97('0x1'));var BPromise=require(_0x4a97('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4a97('0x3'));var db=require(_0x4a97('0x4'))['db'];var utils=require(_0x4a97('0x5'));var logger=require(_0x4a97('0x6'))(_0x4a97('0x7'));var config=require(_0x4a97('0x8'));var jayson=require(_0x4a97('0x9'));var client=jayson[_0x4a97('0xa')][_0x4a97('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12e379,_0x45b266,_0x1ff824){return new BPromise(function(_0x3720fc,_0x543112){return client[_0x4a97('0xc')](_0x12e379,_0x1ff824)[_0x4a97('0xd')](function(_0x525f51){logger[_0x4a97('0xe')]('Schedule,\x20%s,\x20%s',_0x45b266,_0x4a97('0xf'));logger[_0x4a97('0x10')]('Schedule,\x20%s,\x20%s,\x20%s',_0x45b266,_0x4a97('0xf'),JSON['stringify'](_0x525f51));if(_0x525f51[_0x4a97('0x11')]){if(_0x525f51[_0x4a97('0x11')]['code']===0x1f4){logger[_0x4a97('0x11')]('Schedule,\x20%s,\x20%s',_0x45b266,_0x525f51[_0x4a97('0x11')][_0x4a97('0x12')]);return _0x543112(_0x525f51[_0x4a97('0x11')]['message']);}logger['error'](_0x4a97('0x13'),_0x45b266,_0x525f51[_0x4a97('0x11')][_0x4a97('0x12')]);return _0x3720fc(_0x525f51[_0x4a97('0x11')][_0x4a97('0x12')]);}else{logger[_0x4a97('0xe')]('Schedule,\x20%s,\x20%s',_0x45b266,_0x4a97('0xf'));_0x3720fc(_0x525f51[_0x4a97('0x14')]['message']);}})[_0x4a97('0x15')](function(_0xdbd0c9){logger[_0x4a97('0x11')]('Schedule,\x20%s,\x20%s',_0x45b266,_0xdbd0c9);_0x543112(_0xdbd0c9);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index e2d6152..93e0707 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 _0x96d5=['download','post','create','/:id','delete','destroy','exports','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','show','/:id/download'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x96d5,0x183));var _0x596d=function(_0x151ae3,_0x3a9195){_0x151ae3=_0x151ae3-0x0;var _0x564680=_0x96d5[_0x151ae3];return _0x564680;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x596d('0x0'));var timeout=require('connect-timeout');var express=require(_0x596d('0x1'));var router=express[_0x596d('0x2')]();var fs_extra=require(_0x596d('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x596d('0x4'));var config=require(_0x596d('0x5'));var controller=require(_0x596d('0x6'));router[_0x596d('0x7')]('/',auth[_0x596d('0x8')](),controller[_0x596d('0x9')]);router[_0x596d('0x7')]('/describe',auth[_0x596d('0x8')](),controller['describe']);router[_0x596d('0x7')]('/:id',auth[_0x596d('0x8')](),controller[_0x596d('0xa')]);router[_0x596d('0x7')](_0x596d('0xb'),auth[_0x596d('0x8')](),controller[_0x596d('0xc')]);router[_0x596d('0xd')]('/',auth['isAuthenticated'](),controller[_0x596d('0xe')]);router['put'](_0x596d('0xf'),auth[_0x596d('0x8')](),controller['update']);router[_0x596d('0x10')]('/:id',auth[_0x596d('0x8')](),controller[_0x596d('0x11')]);module[_0x596d('0x12')]=router; \ No newline at end of file +var _0x6e7d=['/:id/download','download','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x402731,_0x43c115){var _0x111736=function(_0x5a7044){while(--_0x5a7044){_0x402731['push'](_0x402731['shift']());}};_0x111736(++_0x43c115);}(_0x6e7d,0x1a0));var _0xd6e7=function(_0x3126a7,_0xeab7ee){_0x3126a7=_0x3126a7-0x0;var _0x359314=_0x6e7d[_0x3126a7];return _0x359314;};'use strict';var multer=require(_0xd6e7('0x0'));var util=require(_0xd6e7('0x1'));var path=require(_0xd6e7('0x2'));var timeout=require(_0xd6e7('0x3'));var express=require(_0xd6e7('0x4'));var router=express[_0xd6e7('0x5')]();var fs_extra=require(_0xd6e7('0x6'));var auth=require(_0xd6e7('0x7'));var interaction=require(_0xd6e7('0x8'));var config=require(_0xd6e7('0x9'));var controller=require(_0xd6e7('0xa'));router[_0xd6e7('0xb')]('/',auth[_0xd6e7('0xc')](),controller[_0xd6e7('0xd')]);router[_0xd6e7('0xb')]('/describe',auth[_0xd6e7('0xc')](),controller[_0xd6e7('0xe')]);router[_0xd6e7('0xb')](_0xd6e7('0xf'),auth[_0xd6e7('0xc')](),controller['show']);router[_0xd6e7('0xb')](_0xd6e7('0x10'),auth[_0xd6e7('0xc')](),controller[_0xd6e7('0x11')]);router[_0xd6e7('0x12')]('/',auth[_0xd6e7('0xc')](),controller[_0xd6e7('0x13')]);router[_0xd6e7('0x14')](_0xd6e7('0xf'),auth[_0xd6e7('0xc')](),controller[_0xd6e7('0x15')]);router['delete'](_0xd6e7('0xf'),auth[_0xd6e7('0xc')](),controller[_0xd6e7('0x16')]);module[_0xd6e7('0x17')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 9263c77..b9470d5 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 _0x5430=['duration','DATE','getDataValue','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','extname','STRING','setDataValue','value','INTEGER','subtract'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5430,0x10c));var _0x0543=function(_0x4a9d03,_0x19351c){_0x4a9d03=_0x4a9d03-0x0;var _0x44e6ae=_0x5430[_0x4a9d03];return _0x44e6ae;};'use strict';var Sequelize=require(_0x0543('0x0'));var moment=require(_0x0543('0x1'));var path=require(_0x0543('0x2'));var config=require(_0x0543('0x3'));module[_0x0543('0x4')]={'format':{'type':Sequelize[_0x0543('0x5')],'get':function(){return this['getDataValue']('value')?path[_0x0543('0x6')](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize[_0x0543('0x7')]},'channel':{'type':Sequelize[_0x0543('0x7')]},'value':{'type':Sequelize[_0x0543('0x7')],'set':function(_0x319568){var _0x46bca7=_0x319568['replace'](/\\/g,'/');this[_0x0543('0x8')](_0x0543('0x9'),_0x46bca7);}},'rating':{'type':Sequelize[_0x0543('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x0543('0xa')],'set':function(_0x2fb723){this[_0x0543('0x8')]('startedAt',moment()[_0x0543('0xb')](_0x2fb723,'ms'));this[_0x0543('0x8')]('closedAt',moment());this[_0x0543('0x8')](_0x0543('0xc'),_0x2fb723);}},'startedAt':{'type':Sequelize[_0x0543('0xd')],'get':function(){return moment(this[_0x0543('0xe')](_0x0543('0xf')))[_0x0543('0x10')](_0x0543('0x11'))[_0x0543('0x12')]();}},'closedAt':{'type':Sequelize[_0x0543('0xd')],'get':function(){return moment(this[_0x0543('0xe')](_0x0543('0x13')))[_0x0543('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x0543('0x12')]();}},'createdAt':{'type':Sequelize[_0x0543('0xd')],'get':function(){return moment(this['getDataValue']('createdAt'))[_0x0543('0x10')](_0x0543('0x11'))[_0x0543('0x12')]();}},'updatedAt':{'type':Sequelize[_0x0543('0xd')],'get':function(){return moment(this[_0x0543('0xe')]('updatedAt'))[_0x0543('0x10')](_0x0543('0x11'))[_0x0543('0x12')]();}}}; \ No newline at end of file +var _0xa03c=['closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','path','../../config/environment','exports','getDataValue','value','extname','STRING','setDataValue','INTEGER','startedAt','subtract'];(function(_0x246cba,_0x202a2d){var _0x23ff07=function(_0x1281c3){while(--_0x1281c3){_0x246cba['push'](_0x246cba['shift']());}};_0x23ff07(++_0x202a2d);}(_0xa03c,0x94));var _0xca03=function(_0x559d23,_0x525251){_0x559d23=_0x559d23-0x0;var _0x4af75b=_0xa03c[_0x559d23];return _0x4af75b;};'use strict';var Sequelize=require(_0xca03('0x0'));var moment=require('moment');var path=require(_0xca03('0x1'));var config=require(_0xca03('0x2'));module[_0xca03('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xca03('0x4')](_0xca03('0x5'))?path[_0xca03('0x6')](this['getDataValue'](_0xca03('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0xca03('0x7')]},'channel':{'type':Sequelize[_0xca03('0x7')]},'value':{'type':Sequelize[_0xca03('0x7')],'set':function(_0x27aac6){var _0x9d2b3d=_0x27aac6['replace'](/\\/g,'/');this[_0xca03('0x8')](_0xca03('0x5'),_0x9d2b3d);}},'rating':{'type':Sequelize[_0xca03('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xca03('0x9')],'set':function(_0x31e7be){this[_0xca03('0x8')](_0xca03('0xa'),moment()[_0xca03('0xb')](_0x31e7be,'ms'));this[_0xca03('0x8')](_0xca03('0xc'),moment());this['setDataValue'](_0xca03('0xd'),_0x31e7be);}},'startedAt':{'type':Sequelize[_0xca03('0xe')],'get':function(){return moment(this[_0xca03('0x4')](_0xca03('0xa')))[_0xca03('0xf')](_0xca03('0x10'))[_0xca03('0x11')]();}},'closedAt':{'type':Sequelize[_0xca03('0xe')],'get':function(){return moment(this[_0xca03('0x4')](_0xca03('0xc')))[_0xca03('0xf')](_0xca03('0x10'))[_0xca03('0x11')]();}},'createdAt':{'type':Sequelize[_0xca03('0xe')],'get':function(){return moment(this[_0xca03('0x4')](_0xca03('0x12')))[_0xca03('0xf')](_0xca03('0x10'))[_0xca03('0x11')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xca03('0x4')](_0xca03('0x13')))[_0xca03('0xf')](_0xca03('0x10'))[_0xca03('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index da08685..16344e5 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 _0xac9d=['extname','unlink','send','Not\x20found','isNil','Entity\x20not\x20found','root','info','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','params','join','server/files/screen_recordings','%s.cypher','existsSync','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename'];(function(_0x337934,_0x5b9298){var _0x242af0=function(_0x1880f1){while(--_0x1880f1){_0x337934['push'](_0x337934['shift']());}};_0x242af0(++_0x5b9298);}(_0xac9d,0x14d));var _0xdac9=function(_0x425b19,_0x2dcf14){_0x425b19=_0x425b19-0x0;var _0x15ecab=_0xac9d[_0x425b19];return _0x15ecab;};'use strict';var emlformat=require(_0xdac9('0x0'));var rimraf=require(_0xdac9('0x1'));var zipdir=require(_0xdac9('0x2'));var jsonpatch=require(_0xdac9('0x3'));var rp=require(_0xdac9('0x4'));var moment=require(_0xdac9('0x5'));var BPromise=require(_0xdac9('0x6'));var Mustache=require(_0xdac9('0x7'));var util=require('util');var path=require(_0xdac9('0x8'));var sox=require('sox');var csv=require(_0xdac9('0x9'));var ejs=require(_0xdac9('0xa'));var fs=require('fs');var fs_extra=require(_0xdac9('0xb'));var _=require(_0xdac9('0xc'));var squel=require(_0xdac9('0xd'));var crypto=require(_0xdac9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdac9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdac9('0x10'));var Papa=require(_0xdac9('0x11'));var Redis=require(_0xdac9('0x12'));var authService=require(_0xdac9('0x13'));var qs=require(_0xdac9('0x14'));var as=require(_0xdac9('0x15'));var hardwareService=require(_0xdac9('0x16'));var logger=require(_0xdac9('0x17'))(_0xdac9('0x18'));var utils=require('../../config/utils');var config=require(_0xdac9('0x19'));var licenseUtil=require(_0xdac9('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d8e97,_0xeddbc1){_0xeddbc1=_0xeddbc1||0xcc;return function(_0xbfe6d8){if(_0xbfe6d8){return _0x3d8e97['sendStatus'](_0xeddbc1);}return _0x3d8e97[_0xdac9('0x1b')](_0xeddbc1)[_0xdac9('0x1c')]();};}function respondWithResult(_0x9e1bf6,_0x5f0bbd){_0x5f0bbd=_0x5f0bbd||0xc8;return function(_0x5dd536){if(_0x5dd536){return _0x9e1bf6[_0xdac9('0x1b')](_0x5f0bbd)[_0xdac9('0x1d')](_0x5dd536);}};}function respondWithFilteredResult(_0x50f9fe,_0x76af7a){return function(_0x36cbe4){if(_0x36cbe4){var _0x152ea5=typeof _0x76af7a[_0xdac9('0x1e')]===_0xdac9('0x1f')&&typeof _0x76af7a[_0xdac9('0x20')]===_0xdac9('0x1f');var _0xec1016=_0x36cbe4['count'];var _0x283343=_0x152ea5?0x0:_0x76af7a[_0xdac9('0x1e')];var _0x571e07=_0x152ea5?_0x36cbe4[_0xdac9('0x21')]:_0x76af7a[_0xdac9('0x1e')]+_0x76af7a[_0xdac9('0x20')];var _0x181d11;if(_0x571e07>=_0xec1016){_0x571e07=_0xec1016;_0x181d11=0xc8;}else{_0x181d11=0xce;}_0x50f9fe['status'](_0x181d11);return _0x50f9fe['set'](_0xdac9('0x22'),_0x283343+'-'+_0x571e07+'/'+_0xec1016)[_0xdac9('0x1d')](_0x36cbe4);}return null;};}function patchUpdates(_0x2b9d91){return function(_0x395ec7){try{jsonpatch['apply'](_0x395ec7,_0x2b9d91,!![]);}catch(_0x23ee5e){return BPromise[_0xdac9('0x23')](_0x23ee5e);}return _0x395ec7[_0xdac9('0x24')]();};}function saveUpdates(_0xae680a,_0xe7bd10){return function(_0x42317c){if(_0x42317c){return _0x42317c[_0xdac9('0x25')](_0xae680a)[_0xdac9('0x26')](function(_0x419f0c){return _0x419f0c;});}return null;};}function removeEntity(_0x33de5c,_0x5a0fa2){return function(_0x2943f5){if(_0x2943f5){return _0x2943f5[_0xdac9('0x27')]()[_0xdac9('0x26')](function(){_0x33de5c[_0xdac9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e631a,_0x5686db){return function(_0x3ce475){if(!_0x3ce475){_0x1e631a[_0xdac9('0x28')](0x194);}return _0x3ce475;};}function handleError(_0x566d8c,_0x433be9){_0x433be9=_0x433be9||0x1f4;return function(_0x5105f1){logger[_0xdac9('0x29')](_0x5105f1[_0xdac9('0x2a')]);if(_0x5105f1[_0xdac9('0x2b')]){delete _0x5105f1[_0xdac9('0x2b')];}_0x566d8c['status'](_0x433be9)['send'](_0x5105f1);};}exports[_0xdac9('0x2c')]=function(_0x170afd,_0x4fe3bd){var _0x4c4e21={},_0x3eed7a={},_0x3505c5={'count':0x0,'rows':[]};var _0x13efba=_[_0xdac9('0x2d')](db[_0xdac9('0x2e')][_0xdac9('0x2f')],function(_0xed99f9){return{'name':_0xed99f9[_0xdac9('0x30')],'type':_0xed99f9[_0xdac9('0x31')][_0xdac9('0x32')]};});_0x3eed7a[_0xdac9('0x33')]=_[_0xdac9('0x34')](_[_0xdac9('0x2d')](_0x13efba,_0xdac9('0x2b')),[_0xdac9('0x35')]);_0x3eed7a[_0xdac9('0x36')]=_[_0xdac9('0x37')](_0x170afd[_0xdac9('0x36')]);_0x3eed7a[_0xdac9('0x38')]=_[_0xdac9('0x39')](_0x3eed7a[_0xdac9('0x33')],_0x3eed7a['query']);_0x4c4e21['attributes']=_[_0xdac9('0x39')](_0x3eed7a[_0xdac9('0x33')],qs[_0xdac9('0x3a')](_0x170afd[_0xdac9('0x36')][_0xdac9('0x3a')]));_0x4c4e21['attributes']=_0x4c4e21[_0xdac9('0x3b')]['length']?_0x4c4e21[_0xdac9('0x3b')]:_0x3eed7a[_0xdac9('0x33')];if(!_0x170afd['query'][_0xdac9('0x3c')]('nolimit')){_0x4c4e21['limit']=qs[_0xdac9('0x20')](_0x170afd[_0xdac9('0x36')][_0xdac9('0x20')]);_0x4c4e21[_0xdac9('0x1e')]=qs[_0xdac9('0x1e')](_0x170afd[_0xdac9('0x36')]['offset']);}_0x4c4e21[_0xdac9('0x3d')]=qs[_0xdac9('0x3e')](_0x170afd['query'][_0xdac9('0x3e')]);_0x4c4e21[_0xdac9('0x3f')]=qs[_0xdac9('0x38')](_[_0xdac9('0x40')](_0x170afd[_0xdac9('0x36')],_0x3eed7a[_0xdac9('0x38')]),_0x13efba);if(_0x170afd[_0xdac9('0x36')]['filter']){_0x4c4e21[_0xdac9('0x3f')]=_[_0xdac9('0x41')](_0x4c4e21[_0xdac9('0x3f')],{'$or':_['map'](_0x13efba,function(_0x9c732e){if(_0x9c732e[_0xdac9('0x31')]!==_0xdac9('0x42')){var _0x1d6f88={};_0x1d6f88[_0x9c732e['name']]={'$like':'%'+_0x170afd['query'][_0xdac9('0x43')]+'%'};return _0x1d6f88;}})});}_0x4c4e21=_[_0xdac9('0x41')]({},_0x4c4e21,_0x170afd[_0xdac9('0x44')]);var _0x260f0e={'where':_0x4c4e21[_0xdac9('0x3f')]};return db['ScreenRecording'][_0xdac9('0x21')](_0x260f0e)['then'](function(_0xd74baf){_0x3505c5[_0xdac9('0x21')]=_0xd74baf;if(_0x170afd[_0xdac9('0x36')][_0xdac9('0x45')]){_0x4c4e21[_0xdac9('0x46')]=[{'all':!![]}];}return db[_0xdac9('0x2e')][_0xdac9('0x47')](_0x4c4e21);})[_0xdac9('0x26')](function(_0x11362d){_0x3505c5[_0xdac9('0x48')]=_0x11362d;return _0x3505c5;})[_0xdac9('0x26')](respondWithFilteredResult(_0x4fe3bd,_0x4c4e21))[_0xdac9('0x49')](handleError(_0x4fe3bd,null));};exports[_0xdac9('0x4a')]=function(_0x441676,_0x5335ae){var _0x3857cf={'raw':![],'where':{'id':_0x441676['params']['id']}},_0x272b52={};_0x272b52[_0xdac9('0x33')]=_[_0xdac9('0x37')](db[_0xdac9('0x2e')][_0xdac9('0x2f')]);_0x272b52[_0xdac9('0x36')]=_[_0xdac9('0x37')](_0x441676['query']);_0x272b52[_0xdac9('0x38')]=_['intersection'](_0x272b52[_0xdac9('0x33')],_0x272b52[_0xdac9('0x36')]);_0x3857cf[_0xdac9('0x3b')]=_[_0xdac9('0x39')](_0x272b52['model'],qs['fields'](_0x441676['query'][_0xdac9('0x3a')]));_0x3857cf['attributes']=_0x3857cf['attributes'][_0xdac9('0x4b')]?_0x3857cf[_0xdac9('0x3b')]:_0x272b52['model'];if(_0x441676['query'][_0xdac9('0x45')]){_0x3857cf[_0xdac9('0x46')]=[{'all':!![]}];}_0x3857cf=_[_0xdac9('0x41')]({},_0x3857cf,_0x441676[_0xdac9('0x44')]);return db[_0xdac9('0x2e')][_0xdac9('0x4c')](_0x3857cf)[_0xdac9('0x26')](handleEntityNotFound(_0x5335ae,null))[_0xdac9('0x26')](respondWithResult(_0x5335ae,null))['catch'](handleError(_0x5335ae,null));};exports[_0xdac9('0x4d')]=function(_0x3bd946,_0xfa104f){return db[_0xdac9('0x2e')][_0xdac9('0x4d')](_0x3bd946[_0xdac9('0x4e')],{})[_0xdac9('0x26')](respondWithResult(_0xfa104f,0xc9))[_0xdac9('0x49')](handleError(_0xfa104f,null));};exports[_0xdac9('0x25')]=function(_0x242c24,_0x257e48){if(_0x242c24[_0xdac9('0x4e')]['id']){delete _0x242c24[_0xdac9('0x4e')]['id'];}delete _0x242c24[_0xdac9('0x4e')]['duration'];delete _0x242c24['body']['createdAt'];delete _0x242c24[_0xdac9('0x4e')][_0xdac9('0x4f')];delete _0x242c24['body'][_0xdac9('0x50')];return db[_0xdac9('0x2e')][_0xdac9('0x4c')]({'where':{'id':_0x242c24['params']['id']}})[_0xdac9('0x26')](handleEntityNotFound(_0x257e48,null))[_0xdac9('0x26')](saveUpdates(_0x242c24['body'],null))['then'](respondWithResult(_0x257e48,null))[_0xdac9('0x49')](handleError(_0x257e48,null));};exports[_0xdac9('0x51')]=function(_0x222de9,_0x370532){return db[_0xdac9('0x2e')][_0xdac9('0x51')]()[_0xdac9('0x26')](respondWithResult(_0x370532,null))[_0xdac9('0x49')](handleError(_0x370532,null));};exports[_0xdac9('0x52')]=function(_0x41579a,_0x10a2cc,_0x32b5f5){var _0xecb50a=require(_0xdac9('0x53'));var _0x35a378=![];var _0x5d0b43={};if(_0x41579a[_0xdac9('0x36')][_0xdac9('0x31')]&&_0x41579a[_0xdac9('0x36')][_0xdac9('0x31')]===_0xdac9('0x54')){_0x5d0b43[_0xdac9('0x54')]=_0x41579a['params']['id'];}else{_0x5d0b43['id']=_0x41579a[_0xdac9('0x55')]['id'];}return db[_0xdac9('0x2e')][_0xdac9('0x4c')]({'where':_0x5d0b43,'attributes':['id',_0xdac9('0x50')],'raw':!![]})[_0xdac9('0x26')](handleEntityNotFound(_0x10a2cc,null))[_0xdac9('0x26')](function(_0x1eec39){if(_0x1eec39){var _0x243862=path[_0xdac9('0x56')](config['root'],_0xdac9('0x57'),_0x1eec39[_0xdac9('0x50')]);var _0x3cab26=util[_0xdac9('0x35')](_0xdac9('0x58'),_0x243862);if(fs[_0xdac9('0x59')](_0x3cab26)){_0x35a378=!![];return _0xecb50a['decryptFile'](_0x3cab26,_0x243862,config['secrets'][_0xdac9('0x5a')])[_0xdac9('0x26')](function(){return _0x1eec39;});}return _0x1eec39;}})[_0xdac9('0x26')](function(_0x46017d){if(_0x46017d){var _0x1c1f5f=path[_0xdac9('0x56')](config['root'],'server/files/screen_recordings',_0x46017d['value']);if(!fs[_0xdac9('0x59')](_0x1c1f5f)){throw new db[(_0xdac9('0x5b'))][(_0xdac9('0x5c'))](_0xdac9('0x5d'));}if(_0x46017d['filename']){return _0x10a2cc[_0xdac9('0x52')](_0x1c1f5f,_0x46017d[_0xdac9('0x5e')]+path[_0xdac9('0x5f')](_0x1c1f5f),function(){if(_0x35a378){fs[_0xdac9('0x60')](_0x1c1f5f);}});}else{return _0x10a2cc[_0xdac9('0x52')](_0x1c1f5f,function(_0x496d9c){if(_0x35a378){fs[_0xdac9('0x60')](_0x1c1f5f);}});}}})['catch'](function(_0x60b64e){if(_0x60b64e['message']===_0xdac9('0x5d')){_0x10a2cc[_0xdac9('0x1b')](0x194)[_0xdac9('0x61')](_0xdac9('0x62'));}else{return handleError(_0x10a2cc,null);}});};exports[_0xdac9('0x27')]=function(_0x40dec7,_0x232440){return db['ScreenRecording']['find']({'where':{'id':_0x40dec7['params']['id']}})[_0xdac9('0x26')](function(_0x42ba53){if(_[_0xdac9('0x63')](_0x42ba53)){throw new ReferenceError(_0xdac9('0x64'));}return _0x42ba53;})[_0xdac9('0x26')](function(_0x29df1d){var _0x288e7e=path['join'](config[_0xdac9('0x65')],'server/files/screen_recordings',_0x29df1d['value']);logger[_0xdac9('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0x288e7e);if(!_['isNil'](_0x29df1d[_0xdac9('0x50')])&&fs[_0xdac9('0x59')](_0x288e7e)){logger[_0xdac9('0x66')]('File:\x20\x22'+_0x288e7e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xdac9('0x67')](_0x288e7e);}_0x288e7e=_0x288e7e+_0xdac9('0x68');if(!_['isNil'](_0x29df1d[_0xdac9('0x50')])&&fs[_0xdac9('0x59')](_0x288e7e)){logger[_0xdac9('0x66')](_0xdac9('0x69')+_0x288e7e+_0xdac9('0x6a'));fs[_0xdac9('0x67')](_0x288e7e);}return _0x29df1d;})[_0xdac9('0x26')](function(_0xef4531){if(!_0xef4531)throw new InternalError();return _0xef4531[_0xdac9('0x27')]();})[_0xdac9('0x26')](function(){_0x232440[_0xdac9('0x1b')](0xcc)[_0xdac9('0x1c')]();})['catch'](handleError(_0x232440,null));}; \ No newline at end of file +var _0x425d=['include','findAll','rows','catch','show','params','length','includeAll','find','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','root','server/files/screen_recordings','value','%s.cypher','recording','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','destroy','Entity\x20not\x20found','info','isNil','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','zip-dir','fast-json-patch','request-promise','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options'];(function(_0xda6ad1,_0x5f09e3){var _0xedc3a5=function(_0x5459d7){while(--_0x5459d7){_0xda6ad1['push'](_0xda6ad1['shift']());}};_0xedc3a5(++_0x5f09e3);}(_0x425d,0x1e0));var _0xd425=function(_0x266df3,_0x310f44){_0x266df3=_0x266df3-0x0;var _0x36684b=_0x425d[_0x266df3];return _0x36684b;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x1908a5,_0x2afcdb){return function(_0x400dd7){if(!_0x400dd7){_0x1908a5[_0xd425('0x1d')](0x194);}return _0x400dd7;};}function handleError(_0x577e4b,_0x12f951){_0x12f951=_0x12f951||0x1f4;return function(_0x177de2){logger[_0xd425('0x2b')](_0x177de2['stack']);if(_0x177de2[_0xd425('0x2c')]){delete _0x177de2[_0xd425('0x2c')];}_0x577e4b[_0xd425('0x1f')](_0x12f951)[_0xd425('0x2d')](_0x177de2);};}exports[_0xd425('0x2e')]=function(_0x185d7e,_0x2fd17a){var _0x37b63c={},_0x24da23={},_0x1cac61={'count':0x0,'rows':[]};var _0x482ba6=_[_0xd425('0x2f')](db[_0xd425('0x30')][_0xd425('0x31')],function(_0x3695dd){return{'name':_0x3695dd[_0xd425('0x32')],'type':_0x3695dd[_0xd425('0x33')][_0xd425('0x34')]};});_0x24da23[_0xd425('0x35')]=_[_0xd425('0x36')](_[_0xd425('0x2f')](_0x482ba6,_0xd425('0x2c')),['format']);_0x24da23[_0xd425('0x37')]=_[_0xd425('0x38')](_0x185d7e[_0xd425('0x37')]);_0x24da23[_0xd425('0x39')]=_[_0xd425('0x3a')](_0x24da23['model'],_0x24da23[_0xd425('0x37')]);_0x37b63c[_0xd425('0x3b')]=_['intersection'](_0x24da23['model'],qs['fields'](_0x185d7e[_0xd425('0x37')][_0xd425('0x3c')]));_0x37b63c[_0xd425('0x3b')]=_0x37b63c[_0xd425('0x3b')]['length']?_0x37b63c[_0xd425('0x3b')]:_0x24da23[_0xd425('0x35')];if(!_0x185d7e[_0xd425('0x37')][_0xd425('0x3d')](_0xd425('0x3e'))){_0x37b63c[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x185d7e['query'][_0xd425('0x23')]);_0x37b63c['offset']=qs[_0xd425('0x21')](_0x185d7e[_0xd425('0x37')][_0xd425('0x21')]);}_0x37b63c['order']=qs[_0xd425('0x3f')](_0x185d7e[_0xd425('0x37')][_0xd425('0x3f')]);_0x37b63c[_0xd425('0x40')]=qs['filters'](_[_0xd425('0x41')](_0x185d7e[_0xd425('0x37')],_0x24da23['filters']),_0x482ba6);if(_0x185d7e['query']['filter']){_0x37b63c[_0xd425('0x40')]=_[_0xd425('0x42')](_0x37b63c[_0xd425('0x40')],{'$or':_['map'](_0x482ba6,function(_0x4f8323){if(_0x4f8323['type']!==_0xd425('0x43')){var _0x3f9090={};_0x3f9090[_0x4f8323[_0xd425('0x2c')]]={'$like':'%'+_0x185d7e[_0xd425('0x37')][_0xd425('0x44')]+'%'};return _0x3f9090;}})});}_0x37b63c=_[_0xd425('0x42')]({},_0x37b63c,_0x185d7e[_0xd425('0x45')]);var _0x4b922f={'where':_0x37b63c[_0xd425('0x40')]};return db[_0xd425('0x30')][_0xd425('0x24')](_0x4b922f)['then'](function(_0x3adc67){_0x1cac61[_0xd425('0x24')]=_0x3adc67;if(_0x185d7e[_0xd425('0x37')]['includeAll']){_0x37b63c[_0xd425('0x46')]=[{'all':!![]}];}return db[_0xd425('0x30')][_0xd425('0x47')](_0x37b63c);})[_0xd425('0x2a')](function(_0x5afd62){_0x1cac61[_0xd425('0x48')]=_0x5afd62;return _0x1cac61;})[_0xd425('0x2a')](respondWithFilteredResult(_0x2fd17a,_0x37b63c))[_0xd425('0x49')](handleError(_0x2fd17a,null));};exports[_0xd425('0x4a')]=function(_0x3f24fb,_0x2f6bf7){var _0x2d799b={'raw':![],'where':{'id':_0x3f24fb[_0xd425('0x4b')]['id']}},_0x524fad={};_0x524fad[_0xd425('0x35')]=_['keys'](db[_0xd425('0x30')]['rawAttributes']);_0x524fad['query']=_[_0xd425('0x38')](_0x3f24fb['query']);_0x524fad[_0xd425('0x39')]=_['intersection'](_0x524fad[_0xd425('0x35')],_0x524fad[_0xd425('0x37')]);_0x2d799b[_0xd425('0x3b')]=_[_0xd425('0x3a')](_0x524fad[_0xd425('0x35')],qs['fields'](_0x3f24fb[_0xd425('0x37')]['fields']));_0x2d799b[_0xd425('0x3b')]=_0x2d799b['attributes'][_0xd425('0x4c')]?_0x2d799b[_0xd425('0x3b')]:_0x524fad[_0xd425('0x35')];if(_0x3f24fb[_0xd425('0x37')][_0xd425('0x4d')]){_0x2d799b['include']=[{'all':!![]}];}_0x2d799b=_[_0xd425('0x42')]({},_0x2d799b,_0x3f24fb[_0xd425('0x45')]);return db[_0xd425('0x30')][_0xd425('0x4e')](_0x2d799b)[_0xd425('0x2a')](handleEntityNotFound(_0x2f6bf7,null))['then'](respondWithResult(_0x2f6bf7,null))[_0xd425('0x49')](handleError(_0x2f6bf7,null));};exports[_0xd425('0x4f')]=function(_0x1450f2,_0x2a2ab4){return db[_0xd425('0x30')][_0xd425('0x4f')](_0x1450f2['body'],{})[_0xd425('0x2a')](respondWithResult(_0x2a2ab4,0xc9))[_0xd425('0x49')](handleError(_0x2a2ab4,null));};exports['update']=function(_0x3f305,_0x42c084){if(_0x3f305[_0xd425('0x50')]['id']){delete _0x3f305[_0xd425('0x50')]['id'];}delete _0x3f305['body'][_0xd425('0x51')];delete _0x3f305[_0xd425('0x50')][_0xd425('0x52')];delete _0x3f305[_0xd425('0x50')][_0xd425('0x53')];delete _0x3f305['body']['value'];return db[_0xd425('0x30')]['find']({'where':{'id':_0x3f305[_0xd425('0x4b')]['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x42c084,null))['then'](saveUpdates(_0x3f305[_0xd425('0x50')],null))['then'](respondWithResult(_0x42c084,null))['catch'](handleError(_0x42c084,null));};exports[_0xd425('0x54')]=function(_0x111905,_0xe6451f){return db[_0xd425('0x30')][_0xd425('0x54')]()[_0xd425('0x2a')](respondWithResult(_0xe6451f,null))[_0xd425('0x49')](handleError(_0xe6451f,null));};exports[_0xd425('0x55')]=function(_0x54d437,_0x11ed71,_0x1c6141){var _0x1be9bb=require(_0xd425('0x56'));var _0x7b1080=![];var _0x1c80c2={};if(_0x54d437[_0xd425('0x37')][_0xd425('0x33')]&&_0x54d437['query']['type']==='uniqueid'){_0x1c80c2[_0xd425('0x57')]=_0x54d437[_0xd425('0x4b')]['id'];}else{_0x1c80c2['id']=_0x54d437[_0xd425('0x4b')]['id'];}return db[_0xd425('0x30')]['find']({'where':_0x1c80c2,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x11ed71,null))['then'](function(_0x254b8b){if(_0x254b8b){var _0x44c5e4=path['join'](config[_0xd425('0x58')],_0xd425('0x59'),_0x254b8b[_0xd425('0x5a')]);var _0x57e23e=util['format'](_0xd425('0x5b'),_0x44c5e4);if(fs['existsSync'](_0x57e23e)){_0x7b1080=!![];return _0x1be9bb['decryptFile'](_0x57e23e,_0x44c5e4,config['secrets'][_0xd425('0x5c')])[_0xd425('0x2a')](function(){return _0x254b8b;});}return _0x254b8b;}})[_0xd425('0x2a')](function(_0x5b2323){if(_0x5b2323){var _0x3395d8=path['join'](config[_0xd425('0x58')],_0xd425('0x59'),_0x5b2323[_0xd425('0x5a')]);if(!fs[_0xd425('0x5d')](_0x3395d8)){throw new db[(_0xd425('0x5e'))][(_0xd425('0x5f'))](_0xd425('0x60'));}if(_0x5b2323[_0xd425('0x61')]){return _0x11ed71[_0xd425('0x55')](_0x3395d8,_0x5b2323['filename']+path[_0xd425('0x62')](_0x3395d8),function(){if(_0x7b1080){fs[_0xd425('0x63')](_0x3395d8);}});}else{return _0x11ed71[_0xd425('0x55')](_0x3395d8,function(_0xf22906){if(_0x7b1080){fs['unlink'](_0x3395d8);}});}}})['catch'](function(_0x307e9a){if(_0x307e9a[_0xd425('0x64')]===_0xd425('0x60')){_0x11ed71[_0xd425('0x1f')](0x194)[_0xd425('0x2d')](_0xd425('0x65'));}else{return handleError(_0x11ed71,null);}});};exports[_0xd425('0x66')]=function(_0x44782a,_0x1fcde4){return db[_0xd425('0x30')][_0xd425('0x4e')]({'where':{'id':_0x44782a[_0xd425('0x4b')]['id']}})[_0xd425('0x2a')](function(_0x28979e){if(_['isNil'](_0x28979e)){throw new ReferenceError(_0xd425('0x67'));}return _0x28979e;})[_0xd425('0x2a')](function(_0xd2f2e8){var _0x4fd793=path['join'](config['root'],_0xd425('0x59'),_0xd2f2e8[_0xd425('0x5a')]);logger[_0xd425('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x4fd793);if(!_[_0xd425('0x69')](_0xd2f2e8['value'])&&fs[_0xd425('0x5d')](_0x4fd793)){logger[_0xd425('0x68')](_0xd425('0x6a')+_0x4fd793+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xd425('0x6b')](_0x4fd793);}_0x4fd793=_0x4fd793+_0xd425('0x6c');if(!_[_0xd425('0x69')](_0xd2f2e8[_0xd425('0x5a')])&&fs[_0xd425('0x5d')](_0x4fd793)){logger[_0xd425('0x68')](_0xd425('0x6a')+_0x4fd793+_0xd425('0x6d'));fs[_0xd425('0x6b')](_0x4fd793);}return _0xd2f2e8;})[_0xd425('0x2a')](function(_0x2ba77b){if(!_0x2ba77b)throw new InternalError();return _0x2ba77b[_0xd425('0x66')]();})[_0xd425('0x2a')](function(){_0x1fcde4[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();})[_0xd425('0x49')](handleError(_0x1fcde4,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 076188b..404e1be 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 _0x210f=['ScreenRecording','screen_recordings','interactionid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x375201,_0x2cdbd8){var _0x55f38f=function(_0x129187){while(--_0x129187){_0x375201['push'](_0x375201['shift']());}};_0x55f38f(++_0x2cdbd8);}(_0x210f,0xe3));var _0xf210=function(_0x153b8c,_0x16dfeb){_0x153b8c=_0x153b8c-0x0;var _0x53d528=_0x210f[_0x153b8c];return _0x53d528;};'use strict';var _=require(_0xf210('0x0'));var util=require(_0xf210('0x1'));var logger=require('../../config/logger')(_0xf210('0x2'));var moment=require(_0xf210('0x3'));var BPromise=require(_0xf210('0x4'));var rp=require(_0xf210('0x5'));var fs=require('fs');var path=require(_0xf210('0x6'));var rimraf=require(_0xf210('0x7'));var config=require(_0xf210('0x8'));var attributes=require('./screenRecording.attributes');module[_0xf210('0x9')]=function(_0x1ff621,_0x2a4fa9){return _0x1ff621[_0xf210('0xa')](_0xf210('0xb'),attributes,{'tableName':_0xf210('0xc'),'paranoid':![],'indexes':[{'name':_0xf210('0xd'),'fields':[_0xf210('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd44a=['define','screen_recordings','interactionid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes'];(function(_0x90651d,_0x39e4c2){var _0x44a0ae=function(_0x1b3ead){while(--_0x1b3ead){_0x90651d['push'](_0x90651d['shift']());}};_0x44a0ae(++_0x39e4c2);}(_0xd44a,0xff));var _0xad44=function(_0xe89d3c,_0x3abe52){_0xe89d3c=_0xe89d3c-0x0;var _0x180de9=_0xd44a[_0xe89d3c];return _0x180de9;};'use strict';var _=require('lodash');var util=require(_0xad44('0x0'));var logger=require(_0xad44('0x1'))('api');var moment=require(_0xad44('0x2'));var BPromise=require(_0xad44('0x3'));var rp=require(_0xad44('0x4'));var fs=require('fs');var path=require(_0xad44('0x5'));var rimraf=require(_0xad44('0x6'));var config=require(_0xad44('0x7'));var attributes=require(_0xad44('0x8'));module['exports']=function(_0xc75fe7,_0x468441){return _0xc75fe7[_0xad44('0x9')]('ScreenRecording',attributes,{'tableName':_0xad44('0xa'),'paranoid':![],'indexes':[{'name':_0xad44('0xb'),'fields':[_0xad44('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 4555152..c8d412e 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 _0x8930=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x8930,0x192));var _0x0893=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8930[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x0893('0x0'));var util=require(_0x0893('0x1'));var moment=require(_0x0893('0x2'));var BPromise=require(_0x0893('0x3'));var rs=require(_0x0893('0x4'));var fs=require('fs');var Redis=require(_0x0893('0x5'));var db=require(_0x0893('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0893('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0893('0x8'));var client=jayson[_0x0893('0x9')][_0x0893('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b0c30,_0xd7968,_0x375baa){return new BPromise(function(_0x56370e,_0x5064e7){return client[_0x0893('0xb')](_0x2b0c30,_0x375baa)[_0x0893('0xc')](function(_0x25ee0c){logger[_0x0893('0xd')]('ScreenRecording,\x20%s,\x20%s',_0xd7968,_0x0893('0xe'));logger[_0x0893('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0xd7968,_0x0893('0xe'),JSON[_0x0893('0x10')](_0x25ee0c));if(_0x25ee0c[_0x0893('0x11')]){if(_0x25ee0c[_0x0893('0x11')]['code']===0x1f4){logger[_0x0893('0x11')]('ScreenRecording,\x20%s,\x20%s',_0xd7968,_0x25ee0c['error'][_0x0893('0x12')]);return _0x5064e7(_0x25ee0c[_0x0893('0x11')][_0x0893('0x12')]);}logger[_0x0893('0x11')]('ScreenRecording,\x20%s,\x20%s',_0xd7968,_0x25ee0c[_0x0893('0x11')][_0x0893('0x12')]);return _0x56370e(_0x25ee0c[_0x0893('0x11')][_0x0893('0x12')]);}else{logger[_0x0893('0xd')]('ScreenRecording,\x20%s,\x20%s',_0xd7968,_0x0893('0xe'));_0x56370e(_0x25ee0c[_0x0893('0x13')][_0x0893('0x12')]);}})[_0x0893('0x14')](function(_0x3d8b76){logger[_0x0893('0x11')]('ScreenRecording,\x20%s,\x20%s',_0xd7968,_0x3d8b76);_0x5064e7(_0x3d8b76);});});} \ No newline at end of file +var _0xa2b6=['lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','ScreenRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch'];(function(_0x5e29c7,_0xc2f44e){var _0x5ba897=function(_0x650b47){while(--_0x650b47){_0x5e29c7['push'](_0x5e29c7['shift']());}};_0x5ba897(++_0xc2f44e);}(_0xa2b6,0x190));var _0x6a2b=function(_0x43a251,_0x200ab8){_0x43a251=_0x43a251-0x0;var _0x5f8789=_0xa2b6[_0x43a251];return _0x5f8789;};'use strict';var _=require(_0x6a2b('0x0'));var util=require(_0x6a2b('0x1'));var moment=require(_0x6a2b('0x2'));var BPromise=require('bluebird');var rs=require(_0x6a2b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6a2b('0x4'));var logger=require(_0x6a2b('0x5'))(_0x6a2b('0x6'));var config=require(_0x6a2b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6a2b('0x8')][_0x6a2b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x571a79,_0x53d8e4,_0x13ab89){return new BPromise(function(_0x5e23e3,_0x3c258d){return client[_0x6a2b('0xa')](_0x571a79,_0x13ab89)['then'](function(_0x25ad1e){logger['info'](_0x6a2b('0xb'),_0x53d8e4,'request\x20sent');logger[_0x6a2b('0xc')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x53d8e4,_0x6a2b('0xd'),JSON[_0x6a2b('0xe')](_0x25ad1e));if(_0x25ad1e['error']){if(_0x25ad1e['error'][_0x6a2b('0xf')]===0x1f4){logger[_0x6a2b('0x10')](_0x6a2b('0xb'),_0x53d8e4,_0x25ad1e['error'][_0x6a2b('0x11')]);return _0x3c258d(_0x25ad1e[_0x6a2b('0x10')][_0x6a2b('0x11')]);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x53d8e4,_0x25ad1e[_0x6a2b('0x10')][_0x6a2b('0x11')]);return _0x5e23e3(_0x25ad1e[_0x6a2b('0x10')][_0x6a2b('0x11')]);}else{logger['info']('ScreenRecording,\x20%s,\x20%s',_0x53d8e4,_0x6a2b('0xd'));_0x5e23e3(_0x25ad1e[_0x6a2b('0x12')][_0x6a2b('0x11')]);}})[_0x6a2b('0x13')](function(_0x5820fc){logger[_0x6a2b('0x10')](_0x6a2b('0xb'),_0x53d8e4,_0x5820fc);_0x3c258d(_0x5820fc);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 820d774..58aca7d 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 _0xfb2c=['get','isAuthenticated','index','/now','/:id','show','getLogo','/:id/logo_login','/:id/gdpr','/:id/preferred','getPreferred','getFavicon','join','root','server/files/images/logos/','%s%s','logo','originalname','/:id/logo','file','addLogo','diskStorage','format','logologin','extname','preferred','post','single','addFavicon','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x48b81e,_0x1ba337){var _0x4f05f1=function(_0xca85d5){while(--_0xca85d5){_0x48b81e['push'](_0x48b81e['shift']());}};_0x4f05f1(++_0x1ba337);}(_0xfb2c,0x102));var _0xcfb2=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xfb2c[_0x2a6809];return _0x11c371;};'use strict';var multer=require('multer');var util=require(_0xcfb2('0x0'));var path=require('path');var timeout=require(_0xcfb2('0x1'));var express=require(_0xcfb2('0x2'));var router=express[_0xcfb2('0x3')]();var fs_extra=require(_0xcfb2('0x4'));var auth=require(_0xcfb2('0x5'));var interaction=require(_0xcfb2('0x6'));var config=require(_0xcfb2('0x7'));var controller=require('./setting.controller');router[_0xcfb2('0x8')]('/',auth[_0xcfb2('0x9')](),controller[_0xcfb2('0xa')]);router[_0xcfb2('0x8')](_0xcfb2('0xb'),controller['getDate']);router['get'](_0xcfb2('0xc'),controller[_0xcfb2('0xd')]);router['get']('/:id/logo',controller[_0xcfb2('0xe')]);router[_0xcfb2('0x8')](_0xcfb2('0xf'),controller['getLogoLogin']);router[_0xcfb2('0x8')](_0xcfb2('0x10'),controller['gdpr']);router[_0xcfb2('0x8')](_0xcfb2('0x11'),controller[_0xcfb2('0x12')]);router[_0xcfb2('0x8')]('/:id/favicon',controller[_0xcfb2('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5c18e2,_0x54a0a7,_0x16b137){_0x16b137(null,path[_0xcfb2('0x14')](config[_0xcfb2('0x15')],_0xcfb2('0x16')));},'filename':function(_0x1d809a,_0x56ae34,_0x532b0c){_0x532b0c(null,util['format'](_0xcfb2('0x17'),_0xcfb2('0x18'),path['extname'](_0x56ae34[_0xcfb2('0x19')])));}})});router['post'](_0xcfb2('0x1a'),upload['single'](_0xcfb2('0x1b')),controller[_0xcfb2('0x1c')]);var upload=multer({'storage':multer[_0xcfb2('0x1d')]({'destination':function(_0x3418fa,_0xb66a58,_0x44278c){_0x44278c(null,path[_0xcfb2('0x14')](config['root'],_0xcfb2('0x16')));},'filename':function(_0x13d3bb,_0x5846d8,_0x5ed8c6){_0x5ed8c6(null,util[_0xcfb2('0x1e')](_0xcfb2('0x17'),_0xcfb2('0x1f'),path[_0xcfb2('0x20')](_0x5846d8['originalname'])));}})});router['post'](_0xcfb2('0xf'),upload['single'](_0xcfb2('0x1b')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xcfb2('0x1d')]({'destination':function(_0x5367fc,_0x1e973c,_0x5566d3){_0x5566d3(null,path[_0xcfb2('0x14')](config[_0xcfb2('0x15')],_0xcfb2('0x16')));},'filename':function(_0x456264,_0x32cc36,_0x39327b){_0x39327b(null,util[_0xcfb2('0x1e')](_0xcfb2('0x17'),_0xcfb2('0x21'),path[_0xcfb2('0x20')](_0x32cc36[_0xcfb2('0x19')])));}})});router[_0xcfb2('0x22')](_0xcfb2('0x11'),upload[_0xcfb2('0x23')](_0xcfb2('0x1b')),controller['addPreferred']);var upload=multer({'storage':multer[_0xcfb2('0x1d')]({'destination':function(_0x4f3e97,_0x5daa9e,_0x1dc65f){_0x1dc65f(null,path[_0xcfb2('0x14')](config[_0xcfb2('0x15')],_0xcfb2('0x16')));},'filename':function(_0x494976,_0x5bbe32,_0x4040a8){_0x4040a8(null,util[_0xcfb2('0x1e')]('%s%s','favicon',path['extname'](_0x5bbe32[_0xcfb2('0x19')])));}})});router[_0xcfb2('0x22')]('/:id/favicon',upload['single']('file'),controller[_0xcfb2('0x24')]);router['put'](_0xcfb2('0xc'),auth['isAuthenticated'](),controller['update']);module[_0xcfb2('0x25')]=router; \ No newline at end of file +var _0xa24e=['Router','../../components/auth/service','./setting.controller','get','isAuthenticated','index','/now','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','file','addLogo','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','update','util','path','connect-timeout'];(function(_0x928b87,_0x53480a){var _0x1e7638=function(_0x1e2184){while(--_0x1e2184){_0x928b87['push'](_0x928b87['shift']());}};_0x1e7638(++_0x53480a);}(_0xa24e,0x145));var _0xea24=function(_0x5a5bf9,_0x1179f1){_0x5a5bf9=_0x5a5bf9-0x0;var _0x221813=_0xa24e[_0x5a5bf9];return _0x221813;};'use strict';var multer=require('multer');var util=require(_0xea24('0x0'));var path=require(_0xea24('0x1'));var timeout=require(_0xea24('0x2'));var express=require('express');var router=express[_0xea24('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xea24('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xea24('0x5'));router[_0xea24('0x6')]('/',auth[_0xea24('0x7')](),controller[_0xea24('0x8')]);router[_0xea24('0x6')](_0xea24('0x9'),controller['getDate']);router[_0xea24('0x6')](_0xea24('0xa'),controller[_0xea24('0xb')]);router[_0xea24('0x6')](_0xea24('0xc'),controller[_0xea24('0xd')]);router[_0xea24('0x6')](_0xea24('0xe'),controller[_0xea24('0xf')]);router[_0xea24('0x6')]('/:id/gdpr',controller[_0xea24('0x10')]);router[_0xea24('0x6')](_0xea24('0x11'),controller[_0xea24('0x12')]);router[_0xea24('0x6')](_0xea24('0x13'),controller[_0xea24('0x14')]);var upload=multer({'storage':multer[_0xea24('0x15')]({'destination':function(_0x16f2b5,_0x3f58b1,_0x168762){_0x168762(null,path[_0xea24('0x16')](config[_0xea24('0x17')],_0xea24('0x18')));},'filename':function(_0x15821f,_0x46de3c,_0x14d624){_0x14d624(null,util[_0xea24('0x19')](_0xea24('0x1a'),_0xea24('0x1b'),path[_0xea24('0x1c')](_0x46de3c[_0xea24('0x1d')])));}})});router[_0xea24('0x1e')](_0xea24('0xc'),upload[_0xea24('0x1f')](_0xea24('0x20')),controller[_0xea24('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3a449f,_0x4d0e0d,_0x2ae4c8){_0x2ae4c8(null,path['join'](config[_0xea24('0x17')],_0xea24('0x18')));},'filename':function(_0xb3f906,_0x385791,_0x526d76){_0x526d76(null,util[_0xea24('0x19')](_0xea24('0x1a'),'logologin',path['extname'](_0x385791['originalname'])));}})});router['post']('/:id/logo_login',upload[_0xea24('0x1f')](_0xea24('0x20')),controller[_0xea24('0x22')]);var upload=multer({'storage':multer[_0xea24('0x15')]({'destination':function(_0x4a06cb,_0x361caf,_0x685478){_0x685478(null,path[_0xea24('0x16')](config[_0xea24('0x17')],_0xea24('0x18')));},'filename':function(_0x33d237,_0x16a081,_0x5ac399){_0x5ac399(null,util[_0xea24('0x19')](_0xea24('0x1a'),_0xea24('0x23'),path['extname'](_0x16a081[_0xea24('0x1d')])));}})});router[_0xea24('0x1e')](_0xea24('0x11'),upload[_0xea24('0x1f')](_0xea24('0x20')),controller[_0xea24('0x24')]);var upload=multer({'storage':multer[_0xea24('0x15')]({'destination':function(_0xf513d9,_0x25c62c,_0x592ca7){_0x592ca7(null,path[_0xea24('0x16')](config['root'],_0xea24('0x18')));},'filename':function(_0x1a2480,_0x1e0dea,_0x226854){_0x226854(null,util[_0xea24('0x19')](_0xea24('0x1a'),_0xea24('0x25'),path['extname'](_0x1e0dea['originalname'])));}})});router[_0xea24('0x1e')](_0xea24('0x13'),upload[_0xea24('0x1f')](_0xea24('0x20')),controller[_0xea24('0x26')]);router[_0xea24('0x27')](_0xea24('0xa'),auth['isAuthenticated'](),controller[_0xea24('0x28')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 7833541..de8d8ae 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(_0x129a8b,_0xa20f08){var _0x57b603=function(_0x55cc90){while(--_0x55cc90){_0x129a8b['push'](_0x129a8b['shift']());}};_0x57b603(++_0xa20f08);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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(_0x6747d0,_0x49cb8f){var _0x5d9ba9=function(_0x46c6cf){while(--_0x46c6cf){_0x6747d0['push'](_0x6747d0['shift']());}};_0x5d9ba9(++_0x49cb8f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 f5deead..570b12a 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 _0x6aa0=['attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','rawAttributes','body','params','file','filename','logo','find','addLogoLogin','loginLogo','../../config/license/util','getLogo','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','join','toLower','root','default','custom','default_logo.svg','\x20not\x20found','getLogoLogin','server/files/images/logos','getLicense','defaultPreferred','existsSync','upperFirst','default_loginLogo.svg','ValidationError','download','gdpr','securePassword','preferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','Sequelize','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','Setting','fieldName','type','key','query','keys','filters','intersection','model'];(function(_0x41cfd4,_0x1ed2cc){var _0x190f48=function(_0x4b5b1a){while(--_0x4b5b1a){_0x41cfd4['push'](_0x41cfd4['shift']());}};_0x190f48(++_0x1ed2cc);}(_0x6aa0,0xb8));var _0x06aa=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x6aa0[_0xef8146];return _0x5a6cb0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x06aa('0x0'));var zipdir=require(_0x06aa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x06aa('0x2'));var moment=require('moment');var BPromise=require(_0x06aa('0x3'));var Mustache=require(_0x06aa('0x4'));var util=require(_0x06aa('0x5'));var path=require('path');var sox=require(_0x06aa('0x6'));var csv=require(_0x06aa('0x7'));var ejs=require(_0x06aa('0x8'));var fs=require('fs');var fs_extra=require(_0x06aa('0x9'));var _=require(_0x06aa('0xa'));var squel=require('squel');var crypto=require(_0x06aa('0xb'));var jsforce=require(_0x06aa('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x06aa('0x7'));var querystring=require(_0x06aa('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x06aa('0xe'));var qs=require(_0x06aa('0xf'));var as=require(_0x06aa('0x10'));var hardwareService=require(_0x06aa('0x11'));var logger=require(_0x06aa('0x12'))(_0x06aa('0x13'));var utils=require('../../config/utils');var config=require(_0x06aa('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x06aa('0x15'))['db'];var jayson=require(_0x06aa('0x16'));var client=jayson[_0x06aa('0x17')][_0x06aa('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x1f1a64,_0x42aa88,_0xb6a1ba,_0x5d8703){return new BPromise(function(_0xb97b6,_0xc5b667){var _0x771dd3=_0x5d8703||client;return _0x771dd3[_0x06aa('0x19')](_0x1f1a64,_0xb6a1ba)[_0x06aa('0x1a')](function(_0x2ab497){logger[_0x06aa('0x1b')](_0x06aa('0x1c'),_0x42aa88,_0x06aa('0x1d'));logger[_0x06aa('0x1e')]('Setting,\x20%s,\x20%s,\x20%s',_0x42aa88,_0x06aa('0x1d'),JSON['stringify'](_0x2ab497));if(_0x2ab497['error']){if(_0x2ab497[_0x06aa('0x1f')][_0x06aa('0x20')]===0x1f4){logger[_0x06aa('0x1f')](_0x06aa('0x1c'),_0x42aa88,_0x2ab497[_0x06aa('0x1f')]['message']);return _0xc5b667(_0x2ab497['error'][_0x06aa('0x21')]);}logger[_0x06aa('0x1f')](_0x06aa('0x1c'),_0x42aa88,_0x2ab497[_0x06aa('0x1f')]['message']);return _0xb97b6(_0x2ab497[_0x06aa('0x1f')]['message']);}else{logger[_0x06aa('0x1b')]('Setting,\x20%s,\x20%s',_0x42aa88,_0x06aa('0x1d'));_0xb97b6(_0x2ab497[_0x06aa('0x22')][_0x06aa('0x21')]);}})[_0x06aa('0x23')](function(_0x26f0b6){logger[_0x06aa('0x1f')]('Setting,\x20%s,\x20%s',_0x42aa88,_0x26f0b6);_0xc5b667(_0x26f0b6);});});}function respondWithStatusCode(_0x4ce369,_0x268b85){_0x268b85=_0x268b85||0xcc;return function(_0x325cfd){if(_0x325cfd){return _0x4ce369[_0x06aa('0x24')](_0x268b85);}return _0x4ce369['status'](_0x268b85)[_0x06aa('0x25')]();};}function respondWithResult(_0x42ce50,_0x2c16f5){_0x2c16f5=_0x2c16f5||0xc8;return function(_0x109cab){if(_0x109cab){return _0x42ce50[_0x06aa('0x26')](_0x2c16f5)['json'](_0x109cab);}};}function respondWithFilteredResult(_0x4dbdc3,_0x337fa4){return function(_0x3a65a0){if(_0x3a65a0){var _0x547c9d=typeof _0x337fa4[_0x06aa('0x27')]===_0x06aa('0x28')&&typeof _0x337fa4[_0x06aa('0x29')]===_0x06aa('0x28');var _0x52fd66=_0x3a65a0[_0x06aa('0x2a')];var _0x141d06=_0x547c9d?0x0:_0x337fa4[_0x06aa('0x27')];var _0x4b7312=_0x547c9d?_0x3a65a0[_0x06aa('0x2a')]:_0x337fa4[_0x06aa('0x27')]+_0x337fa4[_0x06aa('0x29')];var _0x4fead2;if(_0x4b7312>=_0x52fd66){_0x4b7312=_0x52fd66;_0x4fead2=0xc8;}else{_0x4fead2=0xce;}_0x4dbdc3['status'](_0x4fead2);return _0x4dbdc3[_0x06aa('0x2b')](_0x06aa('0x2c'),_0x141d06+'-'+_0x4b7312+'/'+_0x52fd66)[_0x06aa('0x2d')](_0x3a65a0);}return null;};}function patchUpdates(_0x1ee71d){return function(_0x31ceec){try{jsonpatch[_0x06aa('0x2e')](_0x31ceec,_0x1ee71d,!![]);}catch(_0x1aeb4f){return BPromise[_0x06aa('0x2f')](_0x1aeb4f);}return _0x31ceec[_0x06aa('0x30')]();};}function saveUpdates(_0x31faf7,_0x10ab4c){return function(_0x3486f2){if(_0x3486f2){return _0x3486f2[_0x06aa('0x31')](_0x31faf7)[_0x06aa('0x1a')](function(_0x365c41){return _0x365c41;});}return null;};}function removeEntity(_0x5791d0,_0x441450){return function(_0x58a1b4){if(_0x58a1b4){return _0x58a1b4[_0x06aa('0x32')]()[_0x06aa('0x1a')](function(){_0x5791d0[_0x06aa('0x26')](0xcc)[_0x06aa('0x25')]();});}};}function handleEntityNotFound(_0x4e4778,_0x2ca126){return function(_0x259b74){if(!_0x259b74){_0x4e4778[_0x06aa('0x24')](0x194);}return _0x259b74;};}function handleError(_0x471f49,_0xcba1fb){_0xcba1fb=_0xcba1fb||0x1f4;return function(_0x5d2266){logger[_0x06aa('0x1f')](_0x5d2266[_0x06aa('0x33')]);if(_0x5d2266[_0x06aa('0x34')]){delete _0x5d2266[_0x06aa('0x34')];}_0x471f49[_0x06aa('0x26')](_0xcba1fb)['send'](_0x5d2266);};}exports['index']=function(_0x3d4d5c,_0x15288a){var _0x19ac90={},_0x54c459={},_0xaf0433={'count':0x0,'rows':[]};var _0x3f284a=_['map'](db[_0x06aa('0x35')]['rawAttributes'],function(_0x56c5db){return{'name':_0x56c5db[_0x06aa('0x36')],'type':_0x56c5db[_0x06aa('0x37')][_0x06aa('0x38')]};});_0x54c459['model']=_['map'](_0x3f284a,'name');_0x54c459[_0x06aa('0x39')]=_[_0x06aa('0x3a')](_0x3d4d5c[_0x06aa('0x39')]);_0x54c459[_0x06aa('0x3b')]=_[_0x06aa('0x3c')](_0x54c459[_0x06aa('0x3d')],_0x54c459[_0x06aa('0x39')]);_0x19ac90[_0x06aa('0x3e')]=_[_0x06aa('0x3c')](_0x54c459[_0x06aa('0x3d')],qs[_0x06aa('0x3f')](_0x3d4d5c[_0x06aa('0x39')][_0x06aa('0x3f')]));_0x19ac90['attributes']=_0x19ac90[_0x06aa('0x3e')][_0x06aa('0x40')]?_0x19ac90[_0x06aa('0x3e')]:_0x54c459[_0x06aa('0x3d')];if(!_0x3d4d5c['query']['hasOwnProperty'](_0x06aa('0x41'))){_0x19ac90['limit']=qs[_0x06aa('0x29')](_0x3d4d5c[_0x06aa('0x39')]['limit']);_0x19ac90['offset']=qs[_0x06aa('0x27')](_0x3d4d5c[_0x06aa('0x39')][_0x06aa('0x27')]);}_0x19ac90[_0x06aa('0x42')]=qs[_0x06aa('0x43')](_0x3d4d5c[_0x06aa('0x39')][_0x06aa('0x43')]);_0x19ac90[_0x06aa('0x44')]=qs['filters'](_[_0x06aa('0x45')](_0x3d4d5c[_0x06aa('0x39')],_0x54c459['filters']),_0x3f284a);if(_0x3d4d5c[_0x06aa('0x39')][_0x06aa('0x46')]){_0x19ac90[_0x06aa('0x44')]=_[_0x06aa('0x47')](_0x19ac90[_0x06aa('0x44')],{'$or':_[_0x06aa('0x48')](_0x3f284a,function(_0x404776){if(_0x404776['type']!==_0x06aa('0x49')){var _0xb342fd={};_0xb342fd[_0x404776[_0x06aa('0x34')]]={'$like':'%'+_0x3d4d5c[_0x06aa('0x39')][_0x06aa('0x46')]+'%'};return _0xb342fd;}})});}_0x19ac90=_[_0x06aa('0x47')]({},_0x19ac90,_0x3d4d5c[_0x06aa('0x4a')]);var _0x20f87d={'where':_0x19ac90['where']};return db[_0x06aa('0x35')]['count'](_0x20f87d)[_0x06aa('0x1a')](function(_0x4b1178){_0xaf0433[_0x06aa('0x2a')]=_0x4b1178;if(_0x3d4d5c[_0x06aa('0x39')][_0x06aa('0x4b')]){_0x19ac90[_0x06aa('0x4c')]=[{'all':!![]}];}return db[_0x06aa('0x35')][_0x06aa('0x4d')](_0x19ac90);})[_0x06aa('0x1a')](function(_0x5a4b9a){_0xaf0433[_0x06aa('0x4e')]=_0x5a4b9a;return _0xaf0433;})[_0x06aa('0x1a')](respondWithFilteredResult(_0x15288a,_0x19ac90))[_0x06aa('0x23')](handleError(_0x15288a,null));};exports['show']=function(_0x4dedb3,_0x567e1b){var _0x586cc4={'raw':![],'where':{'id':_0x4dedb3['params']['id']}},_0x147931={};_0x147931[_0x06aa('0x3d')]=_['keys'](db[_0x06aa('0x35')][_0x06aa('0x4f')]);_0x147931['query']=_[_0x06aa('0x3a')](_0x4dedb3['query']);_0x147931[_0x06aa('0x3b')]=_['intersection'](_0x147931[_0x06aa('0x3d')],_0x147931[_0x06aa('0x39')]);_0x586cc4['attributes']=_[_0x06aa('0x3c')](_0x147931[_0x06aa('0x3d')],qs[_0x06aa('0x3f')](_0x4dedb3[_0x06aa('0x39')]['fields']));_0x586cc4[_0x06aa('0x3e')]=_0x586cc4[_0x06aa('0x3e')]['length']?_0x586cc4[_0x06aa('0x3e')]:_0x147931[_0x06aa('0x3d')];if(_0x4dedb3[_0x06aa('0x39')]['includeAll']){_0x586cc4['include']=[{'all':!![]}];}_0x586cc4=_[_0x06aa('0x47')]({},_0x586cc4,_0x4dedb3[_0x06aa('0x4a')]);return db[_0x06aa('0x35')]['find'](_0x586cc4)['then'](handleEntityNotFound(_0x567e1b,null))['then'](respondWithResult(_0x567e1b,null))[_0x06aa('0x23')](handleError(_0x567e1b,null));};exports[_0x06aa('0x31')]=function(_0x14f8e9,_0x191774){if(_0x14f8e9[_0x06aa('0x50')]['id']){delete _0x14f8e9['body']['id'];}return db['Setting']['find']({'where':{'id':_0x14f8e9[_0x06aa('0x51')]['id']}})[_0x06aa('0x1a')](handleEntityNotFound(_0x191774,null))[_0x06aa('0x1a')](saveUpdates(_0x14f8e9[_0x06aa('0x50')],null))[_0x06aa('0x1a')](respondWithResult(_0x191774,null))[_0x06aa('0x23')](handleError(_0x191774,null));};exports['addLogo']=function(_0x46f7b2,_0x5d6a53,_0x44edda){if(_0x46f7b2['file']&&_0x46f7b2[_0x06aa('0x52')][_0x06aa('0x53')]){_0x46f7b2[_0x06aa('0x50')][_0x06aa('0x54')]=_0x46f7b2[_0x06aa('0x52')][_0x06aa('0x53')];}return db[_0x06aa('0x35')][_0x06aa('0x55')]({'where':{'id':_0x46f7b2[_0x06aa('0x51')]['id']}})[_0x06aa('0x1a')](handleEntityNotFound(_0x5d6a53,null))[_0x06aa('0x1a')](saveUpdates(_0x46f7b2['body'],null))[_0x06aa('0x1a')](respondWithResult(_0x5d6a53,null))[_0x06aa('0x23')](handleError(_0x5d6a53,null));};exports[_0x06aa('0x56')]=function(_0x39dfc0,_0x36bc3f,_0x585fed){if(_0x39dfc0[_0x06aa('0x52')]&&_0x39dfc0[_0x06aa('0x52')][_0x06aa('0x53')]){_0x39dfc0[_0x06aa('0x50')][_0x06aa('0x57')]=_0x39dfc0[_0x06aa('0x52')]['filename'];}return db['Setting'][_0x06aa('0x55')]({'where':{'id':_0x39dfc0[_0x06aa('0x51')]['id']}})[_0x06aa('0x1a')](handleEntityNotFound(_0x36bc3f,null))[_0x06aa('0x1a')](saveUpdates(_0x39dfc0['body'],null))[_0x06aa('0x1a')](respondWithResult(_0x36bc3f,null))['catch'](handleError(_0x36bc3f,null));};var utilLicense=require(_0x06aa('0x58'));exports[_0x06aa('0x59')]=function(_0x24077d,_0x5be514,_0x2bcf09){var _0x252468='server/files/images/logos';var _0x4c18c8={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x1f050f){if(_0x1f050f){_0x4c18c8=_0x1f050f;}return db[_0x06aa('0x35')][_0x06aa('0x55')]({'where':{'id':_0x24077d['params']['id']},'attributes':[_0x06aa('0x54'),_0x06aa('0x57'),'preferred',_0x06aa('0x5a'),_0x06aa('0x5b'),_0x06aa('0x5c'),'defaultPreferred',_0x06aa('0x5d')],'raw':!![]});})[_0x06aa('0x1a')](handleEntityNotFound(_0x5be514,null))['then'](function(_0xe46b23){if(_0xe46b23){var _0x26b172=_0xe46b23[_0x06aa('0x54')]&&fs['existsSync'](path[_0x06aa('0x5e')](config['root'],_0x252468,_[_0x06aa('0x5f')](_0xe46b23[_0x06aa('0x54')])))?path[_0x06aa('0x5e')](config[_0x06aa('0x60')],_0x252468,_[_0x06aa('0x5f')](_0xe46b23['logo'])):path[_0x06aa('0x5e')](config['root'],_0x252468,_[_0x06aa('0x5f')]('default_logo.svg'));var _0x388a03=_0x06aa('0x61')+_['upperFirst'](_0x06aa('0x54'));if(_0xe46b23[_0x388a03]||!_0x4c18c8[_0x06aa('0x62')]){_0x26b172=path[_0x06aa('0x5e')](config[_0x06aa('0x60')],_0x252468,_[_0x06aa('0x5f')](_0x06aa('0x63')));}if(!fs['existsSync'](_0x26b172)){throw new db['Sequelize']['ValidationError'](_['upperFirst'](_0x06aa('0x54'))+_0x06aa('0x64'));}return _0x5be514['download'](_0x26b172);}})['catch'](handleError(_0x5be514,null));};var utilLicense=require(_0x06aa('0x58'));exports[_0x06aa('0x65')]=function(_0x3043e1,_0x1899de,_0x2f42b8){var _0x390f3f=_0x06aa('0x66');var _0x1d2b69={'custom':![]};return utilLicense[_0x06aa('0x67')]()['then'](function(_0x8bfee9){if(_0x8bfee9){_0x1d2b69=_0x8bfee9;}return db[_0x06aa('0x35')][_0x06aa('0x55')]({'where':{'id':_0x3043e1['params']['id']},'attributes':[_0x06aa('0x54'),'loginLogo','preferred',_0x06aa('0x5a'),_0x06aa('0x5b'),_0x06aa('0x5c'),_0x06aa('0x68'),_0x06aa('0x5d')],'raw':!![]});})[_0x06aa('0x1a')](handleEntityNotFound(_0x1899de,null))[_0x06aa('0x1a')](function(_0x3d61a1){if(_0x3d61a1){var _0x547ea3=_0x3d61a1['loginLogo']&&fs[_0x06aa('0x69')](path[_0x06aa('0x5e')](config[_0x06aa('0x60')],_0x390f3f,_['toLower'](_0x3d61a1[_0x06aa('0x57')])))?path[_0x06aa('0x5e')](config[_0x06aa('0x60')],_0x390f3f,_[_0x06aa('0x5f')](_0x3d61a1[_0x06aa('0x57')])):path['join'](config[_0x06aa('0x60')],_0x390f3f,_[_0x06aa('0x5f')]('default_loginLogo.svg'));var _0x547e25=_0x06aa('0x61')+_[_0x06aa('0x6a')](_0x06aa('0x57'));if(_0x3d61a1[_0x547e25]||!_0x1d2b69['custom']){_0x547ea3=path[_0x06aa('0x5e')](config[_0x06aa('0x60')],_0x390f3f,_[_0x06aa('0x5f')](_0x06aa('0x6b')));}if(!fs[_0x06aa('0x69')](_0x547ea3)){throw new db['Sequelize'][(_0x06aa('0x6c'))](_[_0x06aa('0x6a')]('loginLogo')+_0x06aa('0x64'));}return _0x1899de[_0x06aa('0x6d')](_0x547ea3);}})[_0x06aa('0x23')](handleError(_0x1899de,null));};exports[_0x06aa('0x6e')]=function(_0x1c1da7,_0x58a053){return db[_0x06aa('0x35')]['find']({'where':{'id':_0x1c1da7[_0x06aa('0x51')]['id']},'attributes':[_0x06aa('0x6f')]})[_0x06aa('0x1a')](respondWithResult(_0x58a053,null))[_0x06aa('0x23')](handleError(_0x58a053,null));};exports['addPreferred']=function(_0x37c422,_0xa93acb,_0x3457b6){if(_0x37c422[_0x06aa('0x52')]&&_0x37c422[_0x06aa('0x52')][_0x06aa('0x53')]){_0x37c422[_0x06aa('0x50')][_0x06aa('0x70')]=_0x37c422[_0x06aa('0x52')][_0x06aa('0x53')];}return db[_0x06aa('0x35')][_0x06aa('0x55')]({'where':{'id':_0x37c422[_0x06aa('0x51')]['id']}})[_0x06aa('0x1a')](handleEntityNotFound(_0xa93acb,null))['then'](saveUpdates(_0x37c422[_0x06aa('0x50')],null))[_0x06aa('0x1a')](respondWithResult(_0xa93acb,null))[_0x06aa('0x23')](handleError(_0xa93acb,null));};var utilLicense=require(_0x06aa('0x58'));exports[_0x06aa('0x71')]=function(_0x118cb9,_0x3d884b,_0x1789c1){var _0x4fa1c2=_0x06aa('0x66');var _0x1d2edc={'custom':![]};return utilLicense[_0x06aa('0x67')]()[_0x06aa('0x1a')](function(_0x431142){if(_0x431142){_0x1d2edc=_0x431142;}return db[_0x06aa('0x35')][_0x06aa('0x55')]({'where':{'id':_0x118cb9[_0x06aa('0x51')]['id']},'attributes':[_0x06aa('0x54'),_0x06aa('0x57'),'preferred',_0x06aa('0x5a'),_0x06aa('0x5b'),'defaultLoginLogo',_0x06aa('0x68'),_0x06aa('0x5d')],'raw':!![]});})['then'](handleEntityNotFound(_0x3d884b,null))[_0x06aa('0x1a')](function(_0x258499){if(_0x258499){var _0xf30458=_0x258499[_0x06aa('0x70')]&&fs['existsSync'](path[_0x06aa('0x5e')](config[_0x06aa('0x60')],_0x4fa1c2,_[_0x06aa('0x5f')](_0x258499[_0x06aa('0x70')])))?path[_0x06aa('0x5e')](config['root'],_0x4fa1c2,_['toLower'](_0x258499[_0x06aa('0x70')])):path[_0x06aa('0x5e')](config[_0x06aa('0x60')],_0x4fa1c2,_[_0x06aa('0x5f')](_0x06aa('0x72')));var _0x4fa836=_0x06aa('0x61')+_[_0x06aa('0x6a')](_0x06aa('0x70'));if(_0x258499[_0x4fa836]||!_0x1d2edc[_0x06aa('0x62')]||!_0x1d2edc[_0x06aa('0x70')]){_0xf30458=path[_0x06aa('0x5e')](config[_0x06aa('0x60')],_0x4fa1c2,_[_0x06aa('0x5f')](_0x06aa('0x72')));}if(!fs['existsSync'](_0xf30458)){throw new db['Sequelize'][(_0x06aa('0x6c'))](_['upperFirst'](_0x06aa('0x70'))+_0x06aa('0x64'));}return _0x3d884b[_0x06aa('0x6d')](_0xf30458);}})[_0x06aa('0x23')](handleError(_0x3d884b,null));};exports[_0x06aa('0x73')]=function(_0x5ae556,_0x101d73,_0x336065){if(_0x5ae556[_0x06aa('0x52')]&&_0x5ae556[_0x06aa('0x52')][_0x06aa('0x53')]){_0x5ae556[_0x06aa('0x50')][_0x06aa('0x5a')]=_0x5ae556[_0x06aa('0x52')]['filename'];}return db[_0x06aa('0x35')][_0x06aa('0x55')]({'where':{'id':_0x5ae556['params']['id']}})['then'](handleEntityNotFound(_0x101d73,null))[_0x06aa('0x1a')](saveUpdates(_0x5ae556[_0x06aa('0x50')],null))[_0x06aa('0x1a')](respondWithResult(_0x101d73,null))['catch'](handleError(_0x101d73,null));};var utilLicense=require(_0x06aa('0x58'));exports[_0x06aa('0x74')]=function(_0x2a7ee3,_0x2df46c,_0x4e5123){var _0x264da4='server/files/images/logos';var _0x2ca83a={'custom':![]};return utilLicense['getLicense']()[_0x06aa('0x1a')](function(_0x153d06){if(_0x153d06){_0x2ca83a=_0x153d06;}return db[_0x06aa('0x35')][_0x06aa('0x55')]({'where':{'id':_0x2a7ee3[_0x06aa('0x51')]['id']},'attributes':[_0x06aa('0x54'),_0x06aa('0x57'),'preferred',_0x06aa('0x5a'),_0x06aa('0x5b'),_0x06aa('0x5c'),'defaultPreferred',_0x06aa('0x5d')],'raw':!![]});})[_0x06aa('0x1a')](handleEntityNotFound(_0x2df46c,null))[_0x06aa('0x1a')](function(_0x1ebb51){if(_0x1ebb51){var _0x2045d2=_0x1ebb51[_0x06aa('0x5a')]&&fs[_0x06aa('0x69')](path[_0x06aa('0x5e')](config[_0x06aa('0x60')],_0x264da4,_['toLower'](_0x1ebb51[_0x06aa('0x5a')])))?path['join'](config[_0x06aa('0x60')],_0x264da4,_['toLower'](_0x1ebb51['favicon'])):path[_0x06aa('0x5e')](config['root'],_0x264da4,_[_0x06aa('0x5f')](_0x06aa('0x75')));var _0x1a3cd6=_0x06aa('0x61')+_[_0x06aa('0x6a')](_0x06aa('0x5a'));if(_0x1ebb51[_0x1a3cd6]||!_0x2ca83a[_0x06aa('0x62')]){_0x2045d2=path['join'](config[_0x06aa('0x60')],_0x264da4,_[_0x06aa('0x5f')]('default_favicon.ico'));}if(!fs[_0x06aa('0x69')](_0x2045d2)){throw new db[(_0x06aa('0x76'))]['ValidationError'](_[_0x06aa('0x6a')](_0x06aa('0x5a'))+'\x20not\x20found');}return _0x2df46c[_0x06aa('0x6d')](_0x2045d2);}})[_0x06aa('0x23')](handleError(_0x2df46c,null));};exports[_0x06aa('0x77')]=function(_0x594129,_0x54c604){var _0x105f0e={'offset':moment()[_0x06aa('0x78')]()};_0x105f0e['now']=moment()[_0x06aa('0x78')](_0x105f0e[_0x06aa('0x27')])[_0x06aa('0x79')](_0x06aa('0x7a'));return _0x54c604[_0x06aa('0x26')](0xc8)['send'](_0x105f0e);}; \ No newline at end of file +var _0xe50a=['path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Setting,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','end','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','Setting','include','findAll','rows','show','params','keys','includeAll','find','update','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','defaultLogo','defaultFavicon','default_loginLogo.svg','custom','gdpr','securePassword','default_preferred.png','getFavicon','default_favicon.ico','getDate','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe50a,0xf0));var _0xae50=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xe50a[_0x138f59];return _0x3d114d;};'use strict';var emlformat=require(_0xae50('0x0'));var rimraf=require(_0xae50('0x1'));var zipdir=require(_0xae50('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xae50('0x3'));var moment=require('moment');var BPromise=require(_0xae50('0x4'));var Mustache=require(_0xae50('0x5'));var util=require('util');var path=require(_0xae50('0x6'));var sox=require(_0xae50('0x7'));var csv=require(_0xae50('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xae50('0x9'));var _=require('lodash');var squel=require(_0xae50('0xa'));var crypto=require('crypto');var jsforce=require(_0xae50('0xb'));var deskjs=require(_0xae50('0xc'));var toCsv=require(_0xae50('0x8'));var querystring=require(_0xae50('0xd'));var Papa=require(_0xae50('0xe'));var Redis=require(_0xae50('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xae50('0x10'));var as=require(_0xae50('0x11'));var hardwareService=require(_0xae50('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xae50('0x13'));var config=require(_0xae50('0x14'));var licenseUtil=require(_0xae50('0x15'));var db=require(_0xae50('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xae50('0x17')][_0xae50('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x5a6b7e,_0x360814,_0x5622fd,_0x2ac1eb){return new BPromise(function(_0x251a2b,_0x22530d){var _0x1bc426=_0x2ac1eb||client;return _0x1bc426[_0xae50('0x19')](_0x5a6b7e,_0x5622fd)[_0xae50('0x1a')](function(_0x29b0a1){logger[_0xae50('0x1b')]('Setting,\x20%s,\x20%s',_0x360814,_0xae50('0x1c'));logger[_0xae50('0x1d')](_0xae50('0x1e'),_0x360814,_0xae50('0x1c'),JSON[_0xae50('0x1f')](_0x29b0a1));if(_0x29b0a1['error']){if(_0x29b0a1[_0xae50('0x20')][_0xae50('0x21')]===0x1f4){logger[_0xae50('0x20')]('Setting,\x20%s,\x20%s',_0x360814,_0x29b0a1[_0xae50('0x20')][_0xae50('0x22')]);return _0x22530d(_0x29b0a1[_0xae50('0x20')][_0xae50('0x22')]);}logger[_0xae50('0x20')](_0xae50('0x23'),_0x360814,_0x29b0a1[_0xae50('0x20')][_0xae50('0x22')]);return _0x251a2b(_0x29b0a1[_0xae50('0x20')][_0xae50('0x22')]);}else{logger[_0xae50('0x1b')](_0xae50('0x23'),_0x360814,_0xae50('0x1c'));_0x251a2b(_0x29b0a1[_0xae50('0x24')][_0xae50('0x22')]);}})[_0xae50('0x25')](function(_0x24956f){logger[_0xae50('0x20')](_0xae50('0x23'),_0x360814,_0x24956f);_0x22530d(_0x24956f);});});}function respondWithStatusCode(_0x24970b,_0x2699c4){_0x2699c4=_0x2699c4||0xcc;return function(_0x18bcc9){if(_0x18bcc9){return _0x24970b[_0xae50('0x26')](_0x2699c4);}return _0x24970b[_0xae50('0x27')](_0x2699c4)['end']();};}function respondWithResult(_0x570126,_0x2930ac){_0x2930ac=_0x2930ac||0xc8;return function(_0x41033c){if(_0x41033c){return _0x570126['status'](_0x2930ac)[_0xae50('0x28')](_0x41033c);}};}function respondWithFilteredResult(_0x592d7f,_0x49a435){return function(_0x4b358d){if(_0x4b358d){var _0x573b2e=typeof _0x49a435[_0xae50('0x29')]===_0xae50('0x2a')&&typeof _0x49a435[_0xae50('0x2b')]===_0xae50('0x2a');var _0x4bfeb5=_0x4b358d[_0xae50('0x2c')];var _0x34b600=_0x573b2e?0x0:_0x49a435['offset'];var _0x1a9a82=_0x573b2e?_0x4b358d[_0xae50('0x2c')]:_0x49a435[_0xae50('0x29')]+_0x49a435[_0xae50('0x2b')];var _0x2d519b;if(_0x1a9a82>=_0x4bfeb5){_0x1a9a82=_0x4bfeb5;_0x2d519b=0xc8;}else{_0x2d519b=0xce;}_0x592d7f[_0xae50('0x27')](_0x2d519b);return _0x592d7f[_0xae50('0x2d')](_0xae50('0x2e'),_0x34b600+'-'+_0x1a9a82+'/'+_0x4bfeb5)[_0xae50('0x28')](_0x4b358d);}return null;};}function patchUpdates(_0x53186a){return function(_0x8d5516){try{jsonpatch[_0xae50('0x2f')](_0x8d5516,_0x53186a,!![]);}catch(_0x4dcbb4){return BPromise['reject'](_0x4dcbb4);}return _0x8d5516[_0xae50('0x30')]();};}function saveUpdates(_0x3af57d,_0x5609b5){return function(_0x21c159){if(_0x21c159){return _0x21c159['update'](_0x3af57d)[_0xae50('0x1a')](function(_0x48b709){return _0x48b709;});}return null;};}function removeEntity(_0x3cf52d,_0x48c484){return function(_0x42aec5){if(_0x42aec5){return _0x42aec5[_0xae50('0x31')]()['then'](function(){_0x3cf52d['status'](0xcc)[_0xae50('0x32')]();});}};}function handleEntityNotFound(_0x5d845d,_0x4e8d27){return function(_0x1cc441){if(!_0x1cc441){_0x5d845d[_0xae50('0x26')](0x194);}return _0x1cc441;};}function handleError(_0x21c530,_0x511146){_0x511146=_0x511146||0x1f4;return function(_0x113113){logger[_0xae50('0x20')](_0x113113[_0xae50('0x33')]);if(_0x113113[_0xae50('0x34')]){delete _0x113113[_0xae50('0x34')];}_0x21c530[_0xae50('0x27')](_0x511146)[_0xae50('0x35')](_0x113113);};}exports[_0xae50('0x36')]=function(_0x4a3f9f,_0x16f21b){var _0x52eb51={},_0x744026={},_0x2d6f46={'count':0x0,'rows':[]};var _0x562f6e=_['map'](db['Setting'][_0xae50('0x37')],function(_0xa31143){return{'name':_0xa31143[_0xae50('0x38')],'type':_0xa31143[_0xae50('0x39')]['key']};});_0x744026[_0xae50('0x3a')]=_[_0xae50('0x3b')](_0x562f6e,_0xae50('0x34'));_0x744026[_0xae50('0x3c')]=_['keys'](_0x4a3f9f[_0xae50('0x3c')]);_0x744026[_0xae50('0x3d')]=_['intersection'](_0x744026['model'],_0x744026['query']);_0x52eb51[_0xae50('0x3e')]=_[_0xae50('0x3f')](_0x744026[_0xae50('0x3a')],qs['fields'](_0x4a3f9f[_0xae50('0x3c')][_0xae50('0x40')]));_0x52eb51[_0xae50('0x3e')]=_0x52eb51[_0xae50('0x3e')][_0xae50('0x41')]?_0x52eb51[_0xae50('0x3e')]:_0x744026[_0xae50('0x3a')];if(!_0x4a3f9f[_0xae50('0x3c')][_0xae50('0x42')]('nolimit')){_0x52eb51['limit']=qs[_0xae50('0x2b')](_0x4a3f9f['query']['limit']);_0x52eb51['offset']=qs['offset'](_0x4a3f9f[_0xae50('0x3c')][_0xae50('0x29')]);}_0x52eb51['order']=qs['sort'](_0x4a3f9f['query'][_0xae50('0x43')]);_0x52eb51[_0xae50('0x44')]=qs[_0xae50('0x3d')](_[_0xae50('0x45')](_0x4a3f9f[_0xae50('0x3c')],_0x744026['filters']),_0x562f6e);if(_0x4a3f9f[_0xae50('0x3c')][_0xae50('0x46')]){_0x52eb51[_0xae50('0x44')]=_['merge'](_0x52eb51[_0xae50('0x44')],{'$or':_['map'](_0x562f6e,function(_0x4426b1){if(_0x4426b1[_0xae50('0x39')]!==_0xae50('0x47')){var _0x3de3c1={};_0x3de3c1[_0x4426b1[_0xae50('0x34')]]={'$like':'%'+_0x4a3f9f['query'][_0xae50('0x46')]+'%'};return _0x3de3c1;}})});}_0x52eb51=_[_0xae50('0x48')]({},_0x52eb51,_0x4a3f9f[_0xae50('0x49')]);var _0x36a419={'where':_0x52eb51[_0xae50('0x44')]};return db[_0xae50('0x4a')]['count'](_0x36a419)['then'](function(_0xef9590){_0x2d6f46[_0xae50('0x2c')]=_0xef9590;if(_0x4a3f9f['query']['includeAll']){_0x52eb51[_0xae50('0x4b')]=[{'all':!![]}];}return db['Setting'][_0xae50('0x4c')](_0x52eb51);})[_0xae50('0x1a')](function(_0x26fac3){_0x2d6f46[_0xae50('0x4d')]=_0x26fac3;return _0x2d6f46;})['then'](respondWithFilteredResult(_0x16f21b,_0x52eb51))[_0xae50('0x25')](handleError(_0x16f21b,null));};exports[_0xae50('0x4e')]=function(_0x3c06d4,_0xd23c47){var _0x4b8f14={'raw':![],'where':{'id':_0x3c06d4[_0xae50('0x4f')]['id']}},_0x1fa748={};_0x1fa748[_0xae50('0x3a')]=_[_0xae50('0x50')](db[_0xae50('0x4a')][_0xae50('0x37')]);_0x1fa748[_0xae50('0x3c')]=_['keys'](_0x3c06d4[_0xae50('0x3c')]);_0x1fa748[_0xae50('0x3d')]=_['intersection'](_0x1fa748[_0xae50('0x3a')],_0x1fa748[_0xae50('0x3c')]);_0x4b8f14[_0xae50('0x3e')]=_[_0xae50('0x3f')](_0x1fa748[_0xae50('0x3a')],qs[_0xae50('0x40')](_0x3c06d4[_0xae50('0x3c')]['fields']));_0x4b8f14[_0xae50('0x3e')]=_0x4b8f14[_0xae50('0x3e')]['length']?_0x4b8f14[_0xae50('0x3e')]:_0x1fa748[_0xae50('0x3a')];if(_0x3c06d4[_0xae50('0x3c')][_0xae50('0x51')]){_0x4b8f14[_0xae50('0x4b')]=[{'all':!![]}];}_0x4b8f14=_[_0xae50('0x48')]({},_0x4b8f14,_0x3c06d4['options']);return db[_0xae50('0x4a')][_0xae50('0x52')](_0x4b8f14)[_0xae50('0x1a')](handleEntityNotFound(_0xd23c47,null))[_0xae50('0x1a')](respondWithResult(_0xd23c47,null))[_0xae50('0x25')](handleError(_0xd23c47,null));};exports[_0xae50('0x53')]=function(_0x2a65c4,_0x5cbda4){if(_0x2a65c4[_0xae50('0x54')]['id']){delete _0x2a65c4[_0xae50('0x54')]['id'];}return db[_0xae50('0x4a')]['find']({'where':{'id':_0x2a65c4[_0xae50('0x4f')]['id']}})[_0xae50('0x1a')](handleEntityNotFound(_0x5cbda4,null))[_0xae50('0x1a')](saveUpdates(_0x2a65c4[_0xae50('0x54')],null))[_0xae50('0x1a')](respondWithResult(_0x5cbda4,null))[_0xae50('0x25')](handleError(_0x5cbda4,null));};exports[_0xae50('0x55')]=function(_0x113d5c,_0x1f7855,_0xdcd26f){if(_0x113d5c[_0xae50('0x56')]&&_0x113d5c[_0xae50('0x56')][_0xae50('0x57')]){_0x113d5c[_0xae50('0x54')][_0xae50('0x58')]=_0x113d5c['file'][_0xae50('0x57')];}return db[_0xae50('0x4a')][_0xae50('0x52')]({'where':{'id':_0x113d5c['params']['id']}})[_0xae50('0x1a')](handleEntityNotFound(_0x1f7855,null))[_0xae50('0x1a')](saveUpdates(_0x113d5c['body'],null))[_0xae50('0x1a')](respondWithResult(_0x1f7855,null))[_0xae50('0x25')](handleError(_0x1f7855,null));};exports[_0xae50('0x59')]=function(_0x38782f,_0x4b9edc,_0x1c09de){if(_0x38782f[_0xae50('0x56')]&&_0x38782f[_0xae50('0x56')][_0xae50('0x57')]){_0x38782f[_0xae50('0x54')][_0xae50('0x5a')]=_0x38782f['file'][_0xae50('0x57')];}return db[_0xae50('0x4a')][_0xae50('0x52')]({'where':{'id':_0x38782f[_0xae50('0x4f')]['id']}})[_0xae50('0x1a')](handleEntityNotFound(_0x4b9edc,null))[_0xae50('0x1a')](saveUpdates(_0x38782f['body'],null))[_0xae50('0x1a')](respondWithResult(_0x4b9edc,null))[_0xae50('0x25')](handleError(_0x4b9edc,null));};var utilLicense=require(_0xae50('0x15'));exports['getLogo']=function(_0x186abc,_0x2cd2b0,_0x42255b){var _0xe0b690=_0xae50('0x5b');var _0x365079={'custom':![]};return utilLicense[_0xae50('0x5c')]()[_0xae50('0x1a')](function(_0x49a550){if(_0x49a550){_0x365079=_0x49a550;}return db[_0xae50('0x4a')]['find']({'where':{'id':_0x186abc[_0xae50('0x4f')]['id']},'attributes':['logo',_0xae50('0x5a'),_0xae50('0x5d'),_0xae50('0x5e'),'defaultLogo',_0xae50('0x5f'),_0xae50('0x60'),'defaultFavicon'],'raw':!![]});})[_0xae50('0x1a')](handleEntityNotFound(_0x2cd2b0,null))['then'](function(_0x485071){if(_0x485071){var _0x3d0126=_0x485071[_0xae50('0x58')]&&fs[_0xae50('0x61')](path[_0xae50('0x62')](config['root'],_0xe0b690,_['toLower'](_0x485071[_0xae50('0x58')])))?path[_0xae50('0x62')](config[_0xae50('0x63')],_0xe0b690,_[_0xae50('0x64')](_0x485071[_0xae50('0x58')])):path[_0xae50('0x62')](config[_0xae50('0x63')],_0xe0b690,_[_0xae50('0x64')](_0xae50('0x65')));var _0x369d0c=_0xae50('0x66')+_[_0xae50('0x67')]('logo');if(_0x485071[_0x369d0c]||!_0x365079['custom']){_0x3d0126=path[_0xae50('0x62')](config[_0xae50('0x63')],_0xe0b690,_[_0xae50('0x64')](_0xae50('0x65')));}if(!fs[_0xae50('0x61')](_0x3d0126)){throw new db[(_0xae50('0x68'))][(_0xae50('0x69'))](_[_0xae50('0x67')](_0xae50('0x58'))+_0xae50('0x6a'));}return _0x2cd2b0[_0xae50('0x6b')](_0x3d0126);}})[_0xae50('0x25')](handleError(_0x2cd2b0,null));};var utilLicense=require(_0xae50('0x15'));exports[_0xae50('0x6c')]=function(_0x1f2793,_0x4ac9f5,_0x3ef787){var _0x26a4e9=_0xae50('0x5b');var _0x33a8c2={'custom':![]};return utilLicense[_0xae50('0x5c')]()[_0xae50('0x1a')](function(_0x50e7b5){if(_0x50e7b5){_0x33a8c2=_0x50e7b5;}return db[_0xae50('0x4a')][_0xae50('0x52')]({'where':{'id':_0x1f2793['params']['id']},'attributes':['logo','loginLogo',_0xae50('0x5d'),'favicon',_0xae50('0x6d'),_0xae50('0x5f'),'defaultPreferred',_0xae50('0x6e')],'raw':!![]});})[_0xae50('0x1a')](handleEntityNotFound(_0x4ac9f5,null))[_0xae50('0x1a')](function(_0x1e4f82){if(_0x1e4f82){var _0x62b33f=_0x1e4f82[_0xae50('0x5a')]&&fs[_0xae50('0x61')](path[_0xae50('0x62')](config[_0xae50('0x63')],_0x26a4e9,_['toLower'](_0x1e4f82[_0xae50('0x5a')])))?path[_0xae50('0x62')](config[_0xae50('0x63')],_0x26a4e9,_[_0xae50('0x64')](_0x1e4f82[_0xae50('0x5a')])):path['join'](config[_0xae50('0x63')],_0x26a4e9,_[_0xae50('0x64')](_0xae50('0x6f')));var _0x4841f3=_0xae50('0x66')+_[_0xae50('0x67')]('loginLogo');if(_0x1e4f82[_0x4841f3]||!_0x33a8c2[_0xae50('0x70')]){_0x62b33f=path[_0xae50('0x62')](config['root'],_0x26a4e9,_[_0xae50('0x64')]('default_loginLogo.svg'));}if(!fs[_0xae50('0x61')](_0x62b33f)){throw new db[(_0xae50('0x68'))][(_0xae50('0x69'))](_[_0xae50('0x67')](_0xae50('0x5a'))+_0xae50('0x6a'));}return _0x4ac9f5[_0xae50('0x6b')](_0x62b33f);}})[_0xae50('0x25')](handleError(_0x4ac9f5,null));};exports[_0xae50('0x71')]=function(_0x2ccef7,_0x578bcb){return db[_0xae50('0x4a')][_0xae50('0x52')]({'where':{'id':_0x2ccef7[_0xae50('0x4f')]['id']},'attributes':[_0xae50('0x72')]})[_0xae50('0x1a')](respondWithResult(_0x578bcb,null))[_0xae50('0x25')](handleError(_0x578bcb,null));};exports['addPreferred']=function(_0x5565a6,_0x420a1b,_0xd9280e){if(_0x5565a6['file']&&_0x5565a6['file'][_0xae50('0x57')]){_0x5565a6['body'][_0xae50('0x5d')]=_0x5565a6[_0xae50('0x56')][_0xae50('0x57')];}return db[_0xae50('0x4a')]['find']({'where':{'id':_0x5565a6[_0xae50('0x4f')]['id']}})[_0xae50('0x1a')](handleEntityNotFound(_0x420a1b,null))[_0xae50('0x1a')](saveUpdates(_0x5565a6['body'],null))[_0xae50('0x1a')](respondWithResult(_0x420a1b,null))[_0xae50('0x25')](handleError(_0x420a1b,null));};var utilLicense=require(_0xae50('0x15'));exports['getPreferred']=function(_0x3a832d,_0x53f18f,_0x74517a){var _0x3c4b7b=_0xae50('0x5b');var _0xc09942={'custom':![]};return utilLicense[_0xae50('0x5c')]()[_0xae50('0x1a')](function(_0x220c5b){if(_0x220c5b){_0xc09942=_0x220c5b;}return db['Setting'][_0xae50('0x52')]({'where':{'id':_0x3a832d[_0xae50('0x4f')]['id']},'attributes':[_0xae50('0x58'),_0xae50('0x5a'),_0xae50('0x5d'),_0xae50('0x5e'),_0xae50('0x6d'),_0xae50('0x5f'),_0xae50('0x60'),_0xae50('0x6e')],'raw':!![]});})[_0xae50('0x1a')](handleEntityNotFound(_0x53f18f,null))[_0xae50('0x1a')](function(_0x37523b){if(_0x37523b){var _0x137ec6=_0x37523b['preferred']&&fs[_0xae50('0x61')](path[_0xae50('0x62')](config[_0xae50('0x63')],_0x3c4b7b,_[_0xae50('0x64')](_0x37523b['preferred'])))?path[_0xae50('0x62')](config[_0xae50('0x63')],_0x3c4b7b,_[_0xae50('0x64')](_0x37523b[_0xae50('0x5d')])):path[_0xae50('0x62')](config[_0xae50('0x63')],_0x3c4b7b,_[_0xae50('0x64')]('default_preferred.png'));var _0x20af3f='default'+_[_0xae50('0x67')](_0xae50('0x5d'));if(_0x37523b[_0x20af3f]||!_0xc09942['custom']||!_0xc09942['preferred']){_0x137ec6=path[_0xae50('0x62')](config[_0xae50('0x63')],_0x3c4b7b,_[_0xae50('0x64')](_0xae50('0x73')));}if(!fs[_0xae50('0x61')](_0x137ec6)){throw new db[(_0xae50('0x68'))]['ValidationError'](_[_0xae50('0x67')](_0xae50('0x5d'))+'\x20not\x20found');}return _0x53f18f['download'](_0x137ec6);}})['catch'](handleError(_0x53f18f,null));};exports['addFavicon']=function(_0x550616,_0x1b13ba,_0xf8347){if(_0x550616[_0xae50('0x56')]&&_0x550616[_0xae50('0x56')][_0xae50('0x57')]){_0x550616[_0xae50('0x54')][_0xae50('0x5e')]=_0x550616[_0xae50('0x56')][_0xae50('0x57')];}return db[_0xae50('0x4a')]['find']({'where':{'id':_0x550616[_0xae50('0x4f')]['id']}})[_0xae50('0x1a')](handleEntityNotFound(_0x1b13ba,null))[_0xae50('0x1a')](saveUpdates(_0x550616[_0xae50('0x54')],null))[_0xae50('0x1a')](respondWithResult(_0x1b13ba,null))[_0xae50('0x25')](handleError(_0x1b13ba,null));};var utilLicense=require(_0xae50('0x15'));exports[_0xae50('0x74')]=function(_0x1161a2,_0x44f7a5,_0x4a89b9){var _0x2538f1=_0xae50('0x5b');var _0x31300d={'custom':![]};return utilLicense[_0xae50('0x5c')]()[_0xae50('0x1a')](function(_0x2b07f4){if(_0x2b07f4){_0x31300d=_0x2b07f4;}return db[_0xae50('0x4a')][_0xae50('0x52')]({'where':{'id':_0x1161a2[_0xae50('0x4f')]['id']},'attributes':[_0xae50('0x58'),'loginLogo',_0xae50('0x5d'),'favicon','defaultLogo',_0xae50('0x5f'),'defaultPreferred',_0xae50('0x6e')],'raw':!![]});})[_0xae50('0x1a')](handleEntityNotFound(_0x44f7a5,null))[_0xae50('0x1a')](function(_0x3db9d5){if(_0x3db9d5){var _0x5d8501=_0x3db9d5[_0xae50('0x5e')]&&fs[_0xae50('0x61')](path[_0xae50('0x62')](config['root'],_0x2538f1,_[_0xae50('0x64')](_0x3db9d5[_0xae50('0x5e')])))?path[_0xae50('0x62')](config[_0xae50('0x63')],_0x2538f1,_[_0xae50('0x64')](_0x3db9d5['favicon'])):path[_0xae50('0x62')](config[_0xae50('0x63')],_0x2538f1,_[_0xae50('0x64')](_0xae50('0x75')));var _0x1c2bd5=_0xae50('0x66')+_['upperFirst'](_0xae50('0x5e'));if(_0x3db9d5[_0x1c2bd5]||!_0x31300d[_0xae50('0x70')]){_0x5d8501=path[_0xae50('0x62')](config['root'],_0x2538f1,_[_0xae50('0x64')](_0xae50('0x75')));}if(!fs[_0xae50('0x61')](_0x5d8501)){throw new db['Sequelize'][(_0xae50('0x69'))](_[_0xae50('0x67')]('favicon')+_0xae50('0x6a'));}return _0x44f7a5[_0xae50('0x6b')](_0x5d8501);}})[_0xae50('0x25')](handleError(_0x44f7a5,null));};exports[_0xae50('0x76')]=function(_0x7bf745,_0x5321ca){var _0xea085a={'offset':moment()['utcOffset']()};_0xea085a[_0xae50('0x77')]=moment()[_0xae50('0x78')](_0xea085a[_0xae50('0x29')])[_0xae50('0x79')](_0xae50('0x7a'));return _0x5321ca[_0xae50('0x27')](0xc8)[_0xae50('0x35')](_0xea085a);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index b5e0aee..850aeb1 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(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0x7217,0x19e));var _0x7721=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x7217[_0x484e36];return _0xafc85d;};'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 _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x9d14e3,_0x5a6072){var _0x19bf32=function(_0x19da07){while(--_0x19da07){_0x9d14e3['push'](_0x9d14e3['shift']());}};_0x19bf32(++_0x5a6072);}(_0x7217,0x19e));var _0x7721=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x7217[_0x491a7f];return _0x3d8f44;};'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 diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index c3fce72..453ecd1 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 _0x68a1=['jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSetting','Setting','find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x56d697,_0x5cd98a){var _0x1dc372=function(_0xf90757){while(--_0xf90757){_0x56d697['push'](_0x56d697['shift']());}};_0x1dc372(++_0x5cd98a);}(_0x68a1,0x162));var _0x168a=function(_0x25f22d,_0x259c8d){_0x25f22d=_0x25f22d-0x0;var _0x7bf160=_0x68a1[_0x25f22d];return _0x7bf160;};'use strict';var _=require(_0x168a('0x0'));var util=require(_0x168a('0x1'));var moment=require(_0x168a('0x2'));var BPromise=require(_0x168a('0x3'));var rs=require(_0x168a('0x4'));var fs=require('fs');var Redis=require(_0x168a('0x5'));var db=require(_0x168a('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x168a('0x7'));var config=require(_0x168a('0x8'));var jayson=require(_0x168a('0x9'));var client=jayson[_0x168a('0xa')][_0x168a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x187d8c,_0x5b5dc4,_0x5223bc){return new BPromise(function(_0x1b7415,_0x5b5471){return client['request'](_0x187d8c,_0x5223bc)[_0x168a('0xc')](function(_0x4e37ff){logger[_0x168a('0xd')](_0x168a('0xe'),_0x5b5dc4,'request\x20sent');logger[_0x168a('0xf')](_0x168a('0x10'),_0x5b5dc4,_0x168a('0x11'),JSON[_0x168a('0x12')](_0x4e37ff));if(_0x4e37ff[_0x168a('0x13')]){if(_0x4e37ff[_0x168a('0x13')][_0x168a('0x14')]===0x1f4){logger['error'](_0x168a('0xe'),_0x5b5dc4,_0x4e37ff[_0x168a('0x13')][_0x168a('0x15')]);return _0x5b5471(_0x4e37ff[_0x168a('0x13')][_0x168a('0x15')]);}logger[_0x168a('0x13')](_0x168a('0xe'),_0x5b5dc4,_0x4e37ff['error'][_0x168a('0x15')]);return _0x1b7415(_0x4e37ff[_0x168a('0x13')][_0x168a('0x15')]);}else{logger[_0x168a('0xd')](_0x168a('0xe'),_0x5b5dc4,_0x168a('0x11'));_0x1b7415(_0x4e37ff[_0x168a('0x16')][_0x168a('0x15')]);}})[_0x168a('0x17')](function(_0x695582){logger[_0x168a('0x13')](_0x168a('0xe'),_0x5b5dc4,_0x695582);_0x5b5471(_0x695582);});});}exports[_0x168a('0x18')]=function(_0x5400a1){var _0x269810=this;return new Promise(function(_0x1de3d6,_0x5e4723){return db[_0x168a('0x19')][_0x168a('0x1a')]({'raw':_0x5400a1[_0x168a('0x1b')]?_0x5400a1[_0x168a('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5400a1[_0x168a('0x1b')]?_0x5400a1[_0x168a('0x1b')][_0x168a('0x1c')]||null:null,'attributes':_0x5400a1['options']?_0x5400a1[_0x168a('0x1b')][_0x168a('0x1d')]||null:null,'include':_0x5400a1[_0x168a('0x1b')]?_0x5400a1[_0x168a('0x1b')][_0x168a('0x1e')]?_[_0x168a('0x1f')](_0x5400a1[_0x168a('0x1b')]['include'],function(_0x1ebd38){return{'model':db[_0x1ebd38[_0x168a('0x20')]],'as':_0x1ebd38['as'],'attributes':_0x1ebd38['attributes'],'include':_0x1ebd38[_0x168a('0x1e')]?_[_0x168a('0x1f')](_0x1ebd38[_0x168a('0x1e')],function(_0x4b8130){return{'model':db[_0x4b8130[_0x168a('0x20')]],'as':_0x4b8130['as'],'attributes':_0x4b8130[_0x168a('0x1d')],'include':_0x4b8130[_0x168a('0x1e')]?_[_0x168a('0x1f')](_0x4b8130[_0x168a('0x1e')],function(_0x108146){return{'model':db[_0x108146['model']],'as':_0x108146['as'],'attributes':_0x108146['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x30e0b7){logger[_0x168a('0xd')]('ShowSetting',_0x5400a1);logger[_0x168a('0xf')](_0x168a('0x18'),_0x5400a1,JSON[_0x168a('0x12')](_0x30e0b7));_0x1de3d6(_0x30e0b7);})[_0x168a('0x17')](function(_0x3f32c4){logger[_0x168a('0x13')](_0x168a('0x18'),_0x3f32c4['message'],_0x5400a1);_0x5e4723(_0x269810[_0x168a('0x13')](0x1f4,_0x3f32c4[_0x168a('0x15')]));});});}; \ No newline at end of file +var _0x732f=['options','raw','attributes','include','model','map','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','then','info','Setting,\x20%s,\x20%s','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','ShowSetting','Setting'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x732f,0xf8));var _0xf732=function(_0x260097,_0xfd77f9){_0x260097=_0x260097-0x0;var _0x4380de=_0x732f[_0x260097];return _0x4380de;};'use strict';var _=require(_0xf732('0x0'));var util=require(_0xf732('0x1'));var moment=require(_0xf732('0x2'));var BPromise=require(_0xf732('0x3'));var rs=require(_0xf732('0x4'));var fs=require('fs');var Redis=require(_0xf732('0x5'));var db=require(_0xf732('0x6'))['db'];var utils=require(_0xf732('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xf732('0x8'));var client=jayson['client'][_0xf732('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3305fd,_0x19fcd0,_0x5dd671){return new BPromise(function(_0x383880,_0x12f89d){return client['request'](_0x3305fd,_0x5dd671)[_0xf732('0xa')](function(_0x454087){logger[_0xf732('0xb')](_0xf732('0xc'),_0x19fcd0,'request\x20sent');logger['debug'](_0xf732('0xd'),_0x19fcd0,_0xf732('0xe'),JSON[_0xf732('0xf')](_0x454087));if(_0x454087[_0xf732('0x10')]){if(_0x454087[_0xf732('0x10')][_0xf732('0x11')]===0x1f4){logger[_0xf732('0x10')](_0xf732('0xc'),_0x19fcd0,_0x454087[_0xf732('0x10')][_0xf732('0x12')]);return _0x12f89d(_0x454087['error'][_0xf732('0x12')]);}logger[_0xf732('0x10')](_0xf732('0xc'),_0x19fcd0,_0x454087[_0xf732('0x10')][_0xf732('0x12')]);return _0x383880(_0x454087['error'][_0xf732('0x12')]);}else{logger[_0xf732('0xb')](_0xf732('0xc'),_0x19fcd0,_0xf732('0xe'));_0x383880(_0x454087[_0xf732('0x13')][_0xf732('0x12')]);}})['catch'](function(_0x3daea9){logger[_0xf732('0x10')]('Setting,\x20%s,\x20%s',_0x19fcd0,_0x3daea9);_0x12f89d(_0x3daea9);});});}exports[_0xf732('0x14')]=function(_0x4204ce){var _0xdba95c=this;return new Promise(function(_0x2a5990,_0x35bf35){return db[_0xf732('0x15')]['find']({'raw':_0x4204ce[_0xf732('0x16')]?_0x4204ce[_0xf732('0x16')][_0xf732('0x17')]===undefined?!![]:![]:!![],'where':_0x4204ce[_0xf732('0x16')]?_0x4204ce[_0xf732('0x16')]['where']||null:null,'attributes':_0x4204ce['options']?_0x4204ce[_0xf732('0x16')][_0xf732('0x18')]||null:null,'include':_0x4204ce[_0xf732('0x16')]?_0x4204ce[_0xf732('0x16')][_0xf732('0x19')]?_['map'](_0x4204ce[_0xf732('0x16')][_0xf732('0x19')],function(_0x486268){return{'model':db[_0x486268[_0xf732('0x1a')]],'as':_0x486268['as'],'attributes':_0x486268['attributes'],'include':_0x486268[_0xf732('0x19')]?_[_0xf732('0x1b')](_0x486268['include'],function(_0x114e18){return{'model':db[_0x114e18[_0xf732('0x1a')]],'as':_0x114e18['as'],'attributes':_0x114e18[_0xf732('0x18')],'include':_0x114e18[_0xf732('0x19')]?_[_0xf732('0x1b')](_0x114e18[_0xf732('0x19')],function(_0x225ad6){return{'model':db[_0x225ad6['model']],'as':_0x225ad6['as'],'attributes':_0x225ad6[_0xf732('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf732('0xa')](function(_0x29817b){logger[_0xf732('0xb')](_0xf732('0x14'),_0x4204ce);logger[_0xf732('0x1c')](_0xf732('0x14'),_0x4204ce,JSON['stringify'](_0x29817b));_0x2a5990(_0x29817b);})[_0xf732('0x1d')](function(_0xa4d5a1){logger[_0xf732('0x10')](_0xf732('0x14'),_0xa4d5a1['message'],_0x4204ce);_0x35bf35(_0xdba95c['error'](0x1f4,_0xa4d5a1[_0xf732('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 7261a71..e2c05f0 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 _0x53ec=['send','status','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/send'];(function(_0x37c7ad,_0x45ada7){var _0xa2d781=function(_0x3f5617){while(--_0x3f5617){_0x37c7ad['push'](_0x37c7ad['shift']());}};_0xa2d781(++_0x45ada7);}(_0x53ec,0x192));var _0xc53e=function(_0x96a05,_0x1f4b8c){_0x96a05=_0x96a05-0x0;var _0x253e31=_0x53ec[_0x96a05];return _0x253e31;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xa')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router['get']('/:id/canned_answers',auth[_0xc53e('0x9')](),controller['getAnswers']);router['get'](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x12')]);router[_0xc53e('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xc53e('0x13')]);router[_0xc53e('0xa')](_0xc53e('0x14'),controller[_0xc53e('0x15')]);router[_0xc53e('0xa')](_0xc53e('0x16'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x17')]);router[_0xc53e('0x18')]('/',auth[_0xc53e('0x9')](),controller['create']);router[_0xc53e('0x18')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x19')]);router[_0xc53e('0x18')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1b')]);router[_0xc53e('0x18')]('/:id/notify',controller['notify']);router[_0xc53e('0x18')](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1c')]);router[_0xc53e('0x18')](_0xc53e('0x1d'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1e')]);router[_0xc53e('0x18')](_0xc53e('0x14'),controller[_0xc53e('0x1f')]);router[_0xc53e('0x18')](_0xc53e('0x16'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x20')]);router[_0xc53e('0x21')](_0xc53e('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xc53e('0x21')]('/:id/dispositions',auth[_0xc53e('0x9')](),controller[_0xc53e('0x22')]);router[_0xc53e('0x21')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller['removeAnswers']);router[_0xc53e('0x21')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xc53e('0x23')]=router; \ No newline at end of file +var _0x814b=['/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/send','status','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated'];(function(_0xdbce8,_0x550d11){var _0x4e8866=function(_0x570546){while(--_0x570546){_0xdbce8['push'](_0xdbce8['shift']());}};_0x4e8866(++_0x550d11);}(_0x814b,0x1a2));var _0xb814=function(_0x101ccf,_0x37e172){_0x101ccf=_0x101ccf-0x0;var _0x99b0f1=_0x814b[_0x101ccf];return _0x99b0f1;};'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('0xa')](_0xb814('0x16'),auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0xa')](_0xb814('0x18'),controller[_0xb814('0x19')]);router[_0xb814('0xa')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router[_0xb814('0x1c')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x1e')]);router['post'](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x1f')]);router[_0xb814('0x1c')]('/:id/notify',controller['notify']);router['post'](_0xb814('0x14'),auth['isAuthenticated'](),controller['addApplications']);router[_0xb814('0x1c')](_0xb814('0x20'),auth[_0xb814('0xb')](),controller['send']);router[_0xb814('0x1c')]('/:id/status',controller[_0xb814('0x21')]);router[_0xb814('0x1c')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x22')]);router[_0xb814('0x23')](_0xb814('0xe'),auth['isAuthenticated'](),controller[_0xb814('0x24')]);router['delete'](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x25')]);router[_0xb814('0x26')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x27')]);router['delete'](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x28')]);router[_0xb814('0x26')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x29')]);module[_0xb814('0x2a')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 5ea6da3..22d0e09 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 _0x818c=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','name','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x27766b,_0x155221){var _0x3de10e=function(_0xebc741){while(--_0xebc741){_0x27766b['push'](_0x27766b['shift']());}};_0x3de10e(++_0x155221);}(_0x818c,0x121));var _0xc818=function(_0x21ce3a,_0x2e5ffa){_0x21ce3a=_0x21ce3a-0x0;var _0x5221e0=_0x818c[_0x21ce3a];return _0x5221e0;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xc818('0x0'));module[_0xc818('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc818('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xc818('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xc818('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc818('0x5')](_0xc818('0x6'),_0xc818('0x7'),_0xc818('0x8'),_0xc818('0x9'),'plivo',_0xc818('0xa'),_0xc818('0xb'),_0xc818('0xc'),_0xc818('0xd'),_0xc818('0xe'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xc818('0x3')]},'smsMethod':{'type':Sequelize[_0xc818('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xc818('0x3')]},'password':{'type':Sequelize[_0xc818('0x3')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0xc818('0x3')]},'senderString':{'type':Sequelize[_0xc818('0x3')]},'deliveryReport':{'type':Sequelize[_0xc818('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0xc818('0x3')]},'notificationTemplate':{'type':Sequelize[_0xc818('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xc818('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc818('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc818('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc818('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc818('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc818('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xc818('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xc818('0x12')},'mandatoryDisposition':{'type':Sequelize[_0xc818('0xf')],'defaultValue':![],'comment':_0xc818('0x13'),'set':function(_0x182d5c){if(!_0x182d5c)this['setDataValue'](_0xc818('0x14'),null);this['setDataValue'](_0xc818('0x15'),_0x182d5c);}}}; \ No newline at end of file +var _0xce05=['intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','ENUM','skebby','clicksend','plivo','clickatell','csc','infobip'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xce05,0x77));var _0x5ce0=function(_0x4020eb,_0x585639){_0x4020eb=_0x4020eb-0x0;var _0x5d8d75=_0xce05[_0x4020eb];return _0x5d8d75;};'use strict';var Sequelize=require(_0x5ce0('0x0'));var rs=require(_0x5ce0('0x1'));module[_0x5ce0('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x5ce0('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x5ce0('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x5ce0('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0x5ce0('0x4')],'defaultValue':function(){return rs[_0x5ce0('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5ce0('0x6')]('twilio',_0x5ce0('0x7'),'connectel',_0x5ce0('0x8'),_0x5ce0('0x9'),_0x5ce0('0xa'),'bandwidth',_0x5ce0('0xb'),_0x5ce0('0xc'),_0x5ce0('0xd'))},'accountSid':{'type':Sequelize[_0x5ce0('0x4')]},'authId':{'type':Sequelize[_0x5ce0('0x4')]},'authToken':{'type':Sequelize[_0x5ce0('0x4')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x5ce0('0x4')]},'apiKey':{'type':Sequelize[_0x5ce0('0x4')]},'applicationId':{'type':Sequelize[_0x5ce0('0x4')]},'accountId':{'type':Sequelize[_0x5ce0('0x4')]},'senderString':{'type':Sequelize[_0x5ce0('0x4')]},'deliveryReport':{'type':Sequelize[_0x5ce0('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x5ce0('0x4')]},'notificationTemplate':{'type':Sequelize[_0x5ce0('0xf')],'defaultValue':function(){return _0x5ce0('0x10');}},'notificationSound':{'type':Sequelize[_0x5ce0('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5ce0('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5ce0('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5ce0('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5ce0('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5ce0('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5ce0('0x11')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5ce0('0xe')],'defaultValue':![],'comment':_0x5ce0('0x12'),'set':function(_0x1628f1){if(!_0x1628f1)this[_0x5ce0('0x13')](_0x5ce0('0x14'),null);this[_0x5ce0('0x13')](_0x5ce0('0x15'),_0x1628f1);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index ee21698..ac2a358 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 _0xa9ab=['../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','SmsAccounts','stack','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','include','findAll','rows','show','includeAll','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','sms','applications','Applications','priority','asc','account','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','clicksend','message_id','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','text','refid','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','CmContact','Contacts','list','omit','SmsInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','SmsMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','SmsApplication','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','tag','List','DESC','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','requestid','statusInt','status_code','DELIVERED','groupName','bandwidth','intelepeer','redif','error_code','RECEIVED_BY_RECIPIENT','ACCEPTD','statusGet','state','message-id','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa9ab,0xca));var _0xba9a=function(_0x238cbc,_0x2157f1){_0x238cbc=_0x238cbc-0x0;var _0x9ec638=_0xa9ab[_0x238cbc];return _0x9ec638;};'use strict';var emlformat=require(_0xba9a('0x0'));var rimraf=require(_0xba9a('0x1'));var zipdir=require(_0xba9a('0x2'));var jsonpatch=require(_0xba9a('0x3'));var rp=require(_0xba9a('0x4'));var moment=require(_0xba9a('0x5'));var BPromise=require(_0xba9a('0x6'));var Mustache=require(_0xba9a('0x7'));var util=require(_0xba9a('0x8'));var path=require(_0xba9a('0x9'));var sox=require('sox');var csv=require(_0xba9a('0xa'));var ejs=require(_0xba9a('0xb'));var fs=require('fs');var fs_extra=require(_0xba9a('0xc'));var _=require('lodash');var squel=require(_0xba9a('0xd'));var crypto=require(_0xba9a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xba9a('0xf'));var toCsv=require(_0xba9a('0xa'));var querystring=require(_0xba9a('0x10'));var Papa=require(_0xba9a('0x11'));var Redis=require(_0xba9a('0x12'));var authService=require(_0xba9a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xba9a('0x14'));var hardwareService=require(_0xba9a('0x15'));var logger=require(_0xba9a('0x16'))(_0xba9a('0x17'));var utils=require(_0xba9a('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xba9a('0x19'));var db=require(_0xba9a('0x1a'))['db'];config['redis']=_[_0xba9a('0x1b')](config[_0xba9a('0x1c')],{'host':_0xba9a('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba9a('0x1c')]));require('./smsAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xba9a('0x1e')][_0xba9a('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x33f820,_0x55201f,_0x108fe3,_0x14e6e0){return new BPromise(function(_0x12b13e,_0x4353b3){var _0x414331=_0x14e6e0||client;return _0x414331[_0xba9a('0x20')](_0x33f820,_0x108fe3)[_0xba9a('0x21')](function(_0xc75d6d){logger[_0xba9a('0x22')](_0xba9a('0x23'),_0x55201f,_0xba9a('0x24'));logger['debug'](_0xba9a('0x25'),_0x55201f,_0xba9a('0x24'),JSON[_0xba9a('0x26')](_0xc75d6d));if(_0xc75d6d[_0xba9a('0x27')]){if(_0xc75d6d[_0xba9a('0x27')][_0xba9a('0x28')]===0x1f4){logger[_0xba9a('0x27')](_0xba9a('0x23'),_0x55201f,_0xc75d6d[_0xba9a('0x27')][_0xba9a('0x29')]);return _0x4353b3(_0xc75d6d[_0xba9a('0x27')][_0xba9a('0x29')]);}logger[_0xba9a('0x27')](_0xba9a('0x23'),_0x55201f,_0xc75d6d['error'][_0xba9a('0x29')]);return _0x12b13e(_0xc75d6d[_0xba9a('0x27')][_0xba9a('0x29')]);}else{logger[_0xba9a('0x22')](_0xba9a('0x23'),_0x55201f,_0xba9a('0x24'));_0x12b13e(_0xc75d6d[_0xba9a('0x2a')]['message']);}})[_0xba9a('0x2b')](function(_0x5d8264){logger['error']('SmsAccount,\x20%s,\x20%s',_0x55201f,_0x5d8264);_0x4353b3(_0x5d8264);});});}function respondWithStatusCode(_0x6a7d74,_0x3234e0){_0x3234e0=_0x3234e0||0xcc;return function(_0x5a6734){if(_0x5a6734){return _0x6a7d74[_0xba9a('0x2c')](_0x3234e0);}return _0x6a7d74[_0xba9a('0x2d')](_0x3234e0)[_0xba9a('0x2e')]();};}function respondWithResult(_0x52b964,_0x41fd98){_0x41fd98=_0x41fd98||0xc8;return function(_0x23e0d6){if(_0x23e0d6){return _0x52b964[_0xba9a('0x2d')](_0x41fd98)[_0xba9a('0x2f')](_0x23e0d6);}};}function respondWithFilteredResult(_0x537f3d,_0x238e19){return function(_0x3f358d){if(_0x3f358d){var _0x638793=typeof _0x238e19[_0xba9a('0x30')]===_0xba9a('0x31')&&typeof _0x238e19[_0xba9a('0x32')]==='undefined';var _0x30c7c0=_0x3f358d['count'];var _0x3d67fc=_0x638793?0x0:_0x238e19[_0xba9a('0x30')];var _0x3f0ba3=_0x638793?_0x3f358d[_0xba9a('0x33')]:_0x238e19[_0xba9a('0x30')]+_0x238e19[_0xba9a('0x32')];var _0x1785f4;if(_0x3f0ba3>=_0x30c7c0){_0x3f0ba3=_0x30c7c0;_0x1785f4=0xc8;}else{_0x1785f4=0xce;}_0x537f3d[_0xba9a('0x2d')](_0x1785f4);return _0x537f3d[_0xba9a('0x34')](_0xba9a('0x35'),_0x3d67fc+'-'+_0x3f0ba3+'/'+_0x30c7c0)[_0xba9a('0x2f')](_0x3f358d);}return null;};}function patchUpdates(_0x336028){return function(_0x5821a1){try{jsonpatch[_0xba9a('0x36')](_0x5821a1,_0x336028,!![]);}catch(_0x23ac8e){return BPromise['reject'](_0x23ac8e);}return _0x5821a1[_0xba9a('0x37')]();};}function saveUpdates(_0x109560,_0x645dce){return function(_0x57800c){if(_0x57800c){return _0x57800c[_0xba9a('0x38')](_0x109560)['then'](function(_0x36f1e9){return _0x36f1e9;});}return null;};}function removeEntity(_0x377680,_0x3cd745){return function(_0x478ba1){if(_0x478ba1){return _0x478ba1[_0xba9a('0x39')]()[_0xba9a('0x21')](function(){var _0x5da8dc=_0x478ba1['get']({'plain':!![]});var _0x5c2c61=_0xba9a('0x3a');return db['UserProfileResource'][_0xba9a('0x39')]({'where':{'type':_0x5c2c61,'resourceId':_0x5da8dc['id']}})[_0xba9a('0x21')](function(){return _0x478ba1;});})[_0xba9a('0x21')](function(){_0x377680[_0xba9a('0x2d')](0xcc)[_0xba9a('0x2e')]();});}};}function handleEntityNotFound(_0x398b70,_0x2f661d){return function(_0x1d0632){if(!_0x1d0632){_0x398b70[_0xba9a('0x2c')](0x194);}return _0x1d0632;};}function handleError(_0xce4dc4,_0x3788cc){_0x3788cc=_0x3788cc||0x1f4;return function(_0x32f7f7){logger[_0xba9a('0x27')](_0x32f7f7[_0xba9a('0x3b')]);if(_0x32f7f7[_0xba9a('0x3c')]){delete _0x32f7f7['name'];}_0xce4dc4[_0xba9a('0x2d')](_0x3788cc)[_0xba9a('0x3d')](_0x32f7f7);};}exports['index']=function(_0x38417c,_0x222622){var _0x1a5e26={'include':[{'model':db[_0xba9a('0x3e')],'as':_0xba9a('0x3f')}]},_0x5749a3={},_0x2fbb9c={'count':0x0,'rows':[]};var _0x2de228=_[_0xba9a('0x40')](db[_0xba9a('0x41')][_0xba9a('0x42')],function(_0x562ee8){return{'name':_0x562ee8[_0xba9a('0x43')],'type':_0x562ee8[_0xba9a('0x44')][_0xba9a('0x45')]};});_0x5749a3[_0xba9a('0x46')]=_[_0xba9a('0x40')](_0x2de228,_0xba9a('0x3c'));_0x5749a3[_0xba9a('0x47')]=_[_0xba9a('0x48')](_0x38417c[_0xba9a('0x47')]);_0x5749a3['filters']=_['intersection'](_0x5749a3[_0xba9a('0x46')],_0x5749a3[_0xba9a('0x47')]);_0x1a5e26[_0xba9a('0x49')]=_[_0xba9a('0x4a')](_0x5749a3[_0xba9a('0x46')],qs[_0xba9a('0x4b')](_0x38417c['query'][_0xba9a('0x4b')]));_0x1a5e26['attributes']=_0x1a5e26[_0xba9a('0x49')][_0xba9a('0x4c')]?_0x1a5e26['attributes']:_0x5749a3['model'];if(!_0x38417c['query'][_0xba9a('0x4d')](_0xba9a('0x4e'))){_0x1a5e26[_0xba9a('0x32')]=qs[_0xba9a('0x32')](_0x38417c['query'][_0xba9a('0x32')]);_0x1a5e26[_0xba9a('0x30')]=qs[_0xba9a('0x30')](_0x38417c['query'][_0xba9a('0x30')]);}_0x1a5e26[_0xba9a('0x4f')]=qs[_0xba9a('0x50')](_0x38417c[_0xba9a('0x47')][_0xba9a('0x50')]);_0x1a5e26[_0xba9a('0x51')]=qs['filters'](_[_0xba9a('0x52')](_0x38417c[_0xba9a('0x47')],_0x5749a3[_0xba9a('0x53')]),_0x2de228);if(_0x38417c[_0xba9a('0x47')][_0xba9a('0x54')]){_0x1a5e26[_0xba9a('0x51')]=_['merge'](_0x1a5e26[_0xba9a('0x51')],{'$or':_[_0xba9a('0x40')](_0x2de228,function(_0x30ef30){if(_0x30ef30['type']!=='VIRTUAL'){var _0x70be31={};_0x70be31[_0x30ef30[_0xba9a('0x3c')]]={'$like':'%'+_0x38417c['query'][_0xba9a('0x54')]+'%'};return _0x70be31;}})});}_0x1a5e26=_[_0xba9a('0x55')]({},_0x1a5e26,_0x38417c[_0xba9a('0x56')]);var _0x5188d6={'where':_0x1a5e26[_0xba9a('0x51')]};return db['SmsAccount'][_0xba9a('0x33')](_0x5188d6)['then'](function(_0x4f4dcc){_0x2fbb9c[_0xba9a('0x33')]=_0x4f4dcc;if(_0x38417c[_0xba9a('0x47')]['includeAll']){_0x1a5e26[_0xba9a('0x57')]=[{'all':!![]}];}return db[_0xba9a('0x41')][_0xba9a('0x58')](_0x1a5e26);})[_0xba9a('0x21')](function(_0x3e1326){_0x2fbb9c[_0xba9a('0x59')]=_0x3e1326;return _0x2fbb9c;})[_0xba9a('0x21')](respondWithFilteredResult(_0x222622,_0x1a5e26))['catch'](handleError(_0x222622,null));};exports[_0xba9a('0x5a')]=function(_0x204d85,_0x52db08){var _0x2f258a={'raw':![],'where':{'id':_0x204d85['params']['id']},'include':[{'model':db[_0xba9a('0x3e')],'as':'mandatoryDispositionPause'}]},_0x2891f0={};_0x2891f0['model']=_['keys'](db[_0xba9a('0x41')][_0xba9a('0x42')]);_0x2891f0[_0xba9a('0x47')]=_[_0xba9a('0x48')](_0x204d85[_0xba9a('0x47')]);_0x2891f0[_0xba9a('0x53')]=_[_0xba9a('0x4a')](_0x2891f0[_0xba9a('0x46')],_0x2891f0[_0xba9a('0x47')]);_0x2f258a[_0xba9a('0x49')]=_[_0xba9a('0x4a')](_0x2891f0[_0xba9a('0x46')],qs['fields'](_0x204d85[_0xba9a('0x47')]['fields']));_0x2f258a['attributes']=_0x2f258a['attributes'][_0xba9a('0x4c')]?_0x2f258a[_0xba9a('0x49')]:_0x2891f0[_0xba9a('0x46')];if(_0x204d85[_0xba9a('0x47')][_0xba9a('0x5b')]){_0x2f258a[_0xba9a('0x57')]=[{'all':!![]}];}_0x2f258a=_['merge']({},_0x2f258a,_0x204d85['options']);return db[_0xba9a('0x41')][_0xba9a('0x5c')](_0x2f258a)[_0xba9a('0x21')](handleEntityNotFound(_0x52db08,null))[_0xba9a('0x21')](respondWithResult(_0x52db08,null))[_0xba9a('0x2b')](handleError(_0x52db08,null));};exports[_0xba9a('0x5d')]=function(_0x35f30d,_0x13136b){return db[_0xba9a('0x41')]['create'](_0x35f30d['body'],{})[_0xba9a('0x21')](function(_0x40dce8){var _0x229147=_0x35f30d['user'][_0xba9a('0x5e')]({'plain':!![]});if(!_0x229147)throw new Error(_0xba9a('0x5f'));if(_0x229147[_0xba9a('0x60')]===_0xba9a('0x61')){var _0x361744=_0x40dce8[_0xba9a('0x5e')]({'plain':!![]});var _0x546db2=_0xba9a('0x3a');return db['UserProfileSection'][_0xba9a('0x5c')]({'where':{'name':_0x546db2,'userProfileId':_0x229147[_0xba9a('0x62')]},'raw':!![]})[_0xba9a('0x21')](function(_0x18a01d){if(_0x18a01d&&_0x18a01d['autoAssociation']===0x0){return db['UserProfileResource'][_0xba9a('0x5d')]({'name':_0x361744[_0xba9a('0x3c')],'resourceId':_0x361744['id'],'type':_0x18a01d[_0xba9a('0x3c')],'sectionId':_0x18a01d['id']},{})[_0xba9a('0x21')](function(){return _0x40dce8;});}else{return _0x40dce8;}})[_0xba9a('0x2b')](function(_0x214967){logger[_0xba9a('0x27')](_0xba9a('0x63'),_0x214967);throw _0x214967;});}return _0x40dce8;})[_0xba9a('0x21')](respondWithResult(_0x13136b,0xc9))[_0xba9a('0x2b')](handleError(_0x13136b,null));};exports[_0xba9a('0x38')]=function(_0x57eac2,_0x39cee3){if(_0x57eac2['body']['id']){delete _0x57eac2[_0xba9a('0x64')]['id'];}return db[_0xba9a('0x41')][_0xba9a('0x5c')]({'where':{'id':_0x57eac2[_0xba9a('0x65')]['id']},'include':[{'model':db[_0xba9a('0x3e')],'as':_0xba9a('0x3f')}]})[_0xba9a('0x21')](handleEntityNotFound(_0x39cee3,null))['then'](saveUpdates(_0x57eac2[_0xba9a('0x64')],null))[_0xba9a('0x21')](respondWithResult(_0x39cee3,null))['catch'](handleError(_0x39cee3,null));};exports[_0xba9a('0x39')]=function(_0x3f4586,_0x259955){return db['SmsAccount'][_0xba9a('0x5c')]({'where':{'id':_0x3f4586['params']['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0x259955,null))[_0xba9a('0x21')](removeEntity(_0x259955,null))[_0xba9a('0x2b')](handleError(_0x259955,null));};exports[_0xba9a('0x66')]=function(_0xe10a77,_0x377b50){return db[_0xba9a('0x41')][_0xba9a('0x66')]()[_0xba9a('0x21')](respondWithResult(_0x377b50,null))['catch'](handleError(_0x377b50,null));};exports[_0xba9a('0x67')]=function(_0x2ab83c,_0x1a9ebb,_0x24e1db){if(_0x2ab83c[_0xba9a('0x64')]['id']){delete _0x2ab83c[_0xba9a('0x64')]['id'];}return db[_0xba9a('0x41')][_0xba9a('0x5c')]({'where':{'id':_0x2ab83c[_0xba9a('0x65')]['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0x1a9ebb,null))[_0xba9a('0x21')](function(_0x24b98c){if(_0x24b98c){_0x2ab83c[_0xba9a('0x64')][_0xba9a('0x68')]=_0x24b98c['id'];return db[_0xba9a('0x69')]['create'](_0x2ab83c[_0xba9a('0x64')]);}})[_0xba9a('0x21')](respondWithResult(_0x1a9ebb,null))['catch'](handleError(_0x1a9ebb,null));};exports[_0xba9a('0x6a')]=function(_0x37b513,_0x451cc5,_0x428198){var _0x4e0620={'raw':![],'where':{}};var _0x205f08={};var _0x31ffd3={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x37b513[_0xba9a('0x65')]['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0x451cc5,null))[_0xba9a('0x21')](function(_0x1c4b97){if(_0x1c4b97){_0x205f08[_0xba9a('0x46')]=_['keys'](db[_0xba9a('0x69')][_0xba9a('0x42')]);_0x205f08['query']=_[_0xba9a('0x48')](_0x37b513[_0xba9a('0x47')]);_0x205f08[_0xba9a('0x53')]=_[_0xba9a('0x4a')](_0x205f08['model'],_0x205f08[_0xba9a('0x47')]);_0x4e0620[_0xba9a('0x49')]=_['intersection'](_0x205f08[_0xba9a('0x46')],qs[_0xba9a('0x4b')](_0x37b513[_0xba9a('0x47')][_0xba9a('0x4b')]));_0x4e0620['attributes']=_0x4e0620['attributes']['length']?_0x4e0620[_0xba9a('0x49')]:_0x205f08['model'];if(!_0x37b513[_0xba9a('0x47')]['hasOwnProperty']('nolimit')){_0x4e0620[_0xba9a('0x32')]=qs[_0xba9a('0x32')](_0x37b513[_0xba9a('0x47')]['limit']);_0x4e0620[_0xba9a('0x30')]=qs[_0xba9a('0x30')](_0x37b513[_0xba9a('0x47')][_0xba9a('0x30')]);}_0x4e0620[_0xba9a('0x4f')]=qs[_0xba9a('0x50')](_0x37b513[_0xba9a('0x47')]['sort']);_0x4e0620[_0xba9a('0x51')]=qs[_0xba9a('0x53')](_[_0xba9a('0x52')](_0x37b513[_0xba9a('0x47')],_0x205f08[_0xba9a('0x53')]));_0x4e0620['where'][_0xba9a('0x68')]=_0x1c4b97['id'];if(_0x37b513[_0xba9a('0x47')][_0xba9a('0x54')]){_0x4e0620[_0xba9a('0x51')]=_[_0xba9a('0x55')](_0x4e0620[_0xba9a('0x51')],{'$or':_[_0xba9a('0x40')](_0x4e0620[_0xba9a('0x49')],function(_0x364d4a){var _0x4489e5={};_0x4489e5[_0x364d4a]={'$like':'%'+_0x37b513['query']['filter']+'%'};return _0x4489e5;})});}_0x4e0620=_['merge']({},_0x4e0620,_0x37b513[_0xba9a('0x56')]);return db[_0xba9a('0x69')]['count']({'where':_0x4e0620[_0xba9a('0x51')]})['then'](function(_0x3709b8){_0x31ffd3[_0xba9a('0x33')]=_0x3709b8;if(_0x37b513[_0xba9a('0x47')][_0xba9a('0x5b')]){_0x4e0620[_0xba9a('0x57')]=[{'all':!![]}];}return db[_0xba9a('0x69')][_0xba9a('0x58')](_0x4e0620);})[_0xba9a('0x21')](function(_0x5723ff){_0x31ffd3[_0xba9a('0x59')]=_0x5723ff;return _0x31ffd3;});}})[_0xba9a('0x21')](respondWithFilteredResult(_0x451cc5,_0x4e0620))[_0xba9a('0x2b')](handleError(_0x451cc5,null));};exports[_0xba9a('0x6b')]=function(_0x162f60,_0x470fd3,_0x1bcbb3){return db[_0xba9a('0x41')][_0xba9a('0x5c')]({'where':{'id':_0x162f60[_0xba9a('0x65')]['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0x470fd3,null))[_0xba9a('0x21')](function(_0x222fb8){if(_0x222fb8){return _0x222fb8[_0xba9a('0x6b')](_0x162f60['query'][_0xba9a('0x6c')]);}})[_0xba9a('0x21')](respondWithStatusCode(_0x470fd3,null))[_0xba9a('0x2b')](handleError(_0x470fd3,null));};exports[_0xba9a('0x6d')]=function(_0x529bb8,_0x189142,_0x15c0f6){if(_0x529bb8['body']['id']){delete _0x529bb8[_0xba9a('0x64')]['id'];}return db[_0xba9a('0x41')]['find']({'where':{'id':_0x529bb8['params']['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0x189142,null))[_0xba9a('0x21')](function(_0xef5ec4){if(_0xef5ec4){_0x529bb8[_0xba9a('0x64')][_0xba9a('0x68')]=_0xef5ec4['id'];return db[_0xba9a('0x6e')][_0xba9a('0x5d')](_0x529bb8[_0xba9a('0x64')]);}})[_0xba9a('0x21')](respondWithResult(_0x189142,null))[_0xba9a('0x2b')](handleError(_0x189142,null));};exports[_0xba9a('0x6f')]=function(_0x26d0c2,_0x58e6e0,_0x4e7d44){var _0x5d8cb0={'raw':![],'where':{}};var _0x45ebcd={};var _0x2dc3b9={'count':0x0,'rows':[]};return db[_0xba9a('0x41')][_0xba9a('0x70')]({'where':{'id':_0x26d0c2[_0xba9a('0x65')]['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0x58e6e0,null))['then'](function(_0x5357d6){if(_0x5357d6){_0x45ebcd[_0xba9a('0x46')]=_['keys'](db[_0xba9a('0x6e')]['rawAttributes']);_0x45ebcd['query']=_[_0xba9a('0x48')](_0x26d0c2['query']);_0x45ebcd[_0xba9a('0x53')]=_[_0xba9a('0x4a')](_0x45ebcd[_0xba9a('0x46')],_0x45ebcd['query']);_0x5d8cb0['attributes']=_[_0xba9a('0x4a')](_0x45ebcd[_0xba9a('0x46')],qs[_0xba9a('0x4b')](_0x26d0c2[_0xba9a('0x47')][_0xba9a('0x4b')]));_0x5d8cb0[_0xba9a('0x49')]=_0x5d8cb0[_0xba9a('0x49')][_0xba9a('0x4c')]?_0x5d8cb0[_0xba9a('0x49')]:_0x45ebcd[_0xba9a('0x46')];if(!_0x26d0c2[_0xba9a('0x47')][_0xba9a('0x4d')](_0xba9a('0x4e'))){_0x5d8cb0[_0xba9a('0x32')]=qs[_0xba9a('0x32')](_0x26d0c2[_0xba9a('0x47')][_0xba9a('0x32')]);_0x5d8cb0[_0xba9a('0x30')]=qs[_0xba9a('0x30')](_0x26d0c2[_0xba9a('0x47')][_0xba9a('0x30')]);}_0x5d8cb0[_0xba9a('0x4f')]=qs[_0xba9a('0x50')](_0x26d0c2[_0xba9a('0x47')][_0xba9a('0x50')]);_0x5d8cb0[_0xba9a('0x51')]=qs[_0xba9a('0x53')](_[_0xba9a('0x52')](_0x26d0c2['query'],_0x45ebcd[_0xba9a('0x53')]));_0x5d8cb0[_0xba9a('0x51')]['SmsAccountId']=_0x5357d6['id'];if(_0x26d0c2[_0xba9a('0x47')][_0xba9a('0x54')]){_0x5d8cb0['where']=_[_0xba9a('0x55')](_0x5d8cb0[_0xba9a('0x51')],{'$or':_[_0xba9a('0x40')](_0x5d8cb0[_0xba9a('0x49')],function(_0x3f7d1e){var _0xa24c9e={};_0xa24c9e[_0x3f7d1e]={'$like':'%'+_0x26d0c2[_0xba9a('0x47')]['filter']+'%'};return _0xa24c9e;})});}_0x5d8cb0=_[_0xba9a('0x55')]({},_0x5d8cb0,_0x26d0c2[_0xba9a('0x56')]);return db['CannedAnswer'][_0xba9a('0x33')]({'where':_0x5d8cb0[_0xba9a('0x51')]})[_0xba9a('0x21')](function(_0x531fad){_0x2dc3b9[_0xba9a('0x33')]=_0x531fad;if(_0x26d0c2['query'][_0xba9a('0x5b')]){_0x5d8cb0[_0xba9a('0x57')]=[{'all':!![]}];}return db['CannedAnswer'][_0xba9a('0x58')](_0x5d8cb0);})['then'](function(_0x296a81){_0x2dc3b9[_0xba9a('0x59')]=_0x296a81;return _0x2dc3b9;});}})[_0xba9a('0x21')](respondWithFilteredResult(_0x58e6e0,_0x5d8cb0))[_0xba9a('0x2b')](handleError(_0x58e6e0,null));};exports[_0xba9a('0x71')]=function(_0x8310cf,_0x46b1cf,_0x3ae881){return db[_0xba9a('0x41')][_0xba9a('0x5c')]({'where':{'id':_0x8310cf['params']['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0x46b1cf,null))[_0xba9a('0x21')](function(_0x5d5355){if(_0x5d5355){return _0x5d5355[_0xba9a('0x71')](_0x8310cf[_0xba9a('0x47')][_0xba9a('0x6c')]);}})[_0xba9a('0x21')](respondWithStatusCode(_0x46b1cf,null))['catch'](handleError(_0x46b1cf,null));};exports[_0xba9a('0x72')]=function(_0x456c24,_0x157842,_0x33ff9f){var _0x2d26a2={'channel':_0xba9a('0x73')};var _0x32b730=[];var _0x5dd6b6=[];var _0x251f33={};return db[_0xba9a('0x41')]['find']({'where':{'id':_0x456c24[_0xba9a('0x65')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})[_0xba9a('0x21')](handleEntityNotFound(_0x157842,null))[_0xba9a('0x21')](function(_0x105071){_0x2d26a2['account']=_0x105071;_0x2d26a2[_0xba9a('0x74')]=_['orderBy'](_0x105071[_0xba9a('0x75')],[_0xba9a('0x76')],[_0xba9a('0x77')]);if(_0x2d26a2[_0xba9a('0x78')][_0xba9a('0x75')]){delete _0x2d26a2['account']['Applications'];}return db['CmContact'][_0xba9a('0x66')]();})[_0xba9a('0x21')](function(_0x3c5427){if(!_0x3c5427){throw new db[(_0xba9a('0x79'))]['ValidationError'](_0xba9a('0x7a'));}_0x32b730=_[_0xba9a('0x7b')](_[_0xba9a('0x48')](_0x3c5427),[_0xba9a('0x7c'),_0xba9a('0x7d')]);_0x5dd6b6=_[_0xba9a('0x7b')](_[_0xba9a('0x48')](_0x3c5427),['createdAt',_0xba9a('0x7d'),'CompanyId',_0xba9a('0x7e')]);_0x2d26a2[_0xba9a('0x64')]={'mapKey':_0xba9a('0x7f')};if(_0x2d26a2[_0xba9a('0x78')][_0xba9a('0x44')]){switch(_0x2d26a2[_0xba9a('0x78')][_0xba9a('0x44')]){case _0xba9a('0x80'):_0x2d26a2['body'][_0xba9a('0x81')]=_0x456c24[_0xba9a('0x64')][_0xba9a('0x82')];_0x2d26a2[_0xba9a('0x64')]['body']=_0x456c24[_0xba9a('0x64')][_0xba9a('0x83')];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x84')]=_0x456c24[_0xba9a('0x64')][_0xba9a('0x85')];break;case _0xba9a('0x86'):_0x2d26a2[_0xba9a('0x64')]['from']='+'+_0x456c24[_0xba9a('0x64')][_0xba9a('0x87')];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x64')]=_0x456c24[_0xba9a('0x64')]['text'];break;case'connectel':_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x81')]=_0x456c24['body'][_0xba9a('0x81')];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x64')]=_0x456c24['body'][_0xba9a('0x29')];break;case _0xba9a('0x88'):_0x2d26a2['body'][_0xba9a('0x81')]=_0x456c24['body'][_0xba9a('0x81')];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x64')]=_0x456c24[_0xba9a('0x64')]['body'];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x84')]=_0x456c24[_0xba9a('0x64')][_0xba9a('0x89')];break;case'plivo':_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x81')]=_0x456c24[_0xba9a('0x64')][_0xba9a('0x82')];_0x2d26a2['body'][_0xba9a('0x64')]=_0x456c24[_0xba9a('0x64')][_0xba9a('0x8a')];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x84')]=_0x456c24[_0xba9a('0x64')][_0xba9a('0x8b')];break;case _0xba9a('0x8c'):_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x81')]='+'+_0x456c24['body']['results'][0x0][_0xba9a('0x81')];_0x2d26a2[_0xba9a('0x64')]['body']=_0x456c24[_0xba9a('0x64')][_0xba9a('0x8d')][0x0]['text'];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x84')]=_0x456c24[_0xba9a('0x64')]['results'][0x0][_0xba9a('0x84')];break;case _0xba9a('0x8e'):_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x81')]=_0x456c24['body'][_0xba9a('0x8f')];_0x2d26a2[_0xba9a('0x64')]['body']=_0x456c24[_0xba9a('0x64')][_0xba9a('0x90')][_0xba9a('0x29')];break;case _0xba9a('0x91'):_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x81')]=_0x456c24[_0xba9a('0x64')][_0xba9a('0x92')];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x64')]=_0x456c24[_0xba9a('0x64')]['text'];_0x2d26a2['body']['messageId']=_0x456c24[_0xba9a('0x64')][_0xba9a('0x93')];break;case'bandwidth':_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x84')]=_0x456c24[_0xba9a('0x64')][0x0]['message']['id'];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x81')]=_0x456c24[_0xba9a('0x64')][0x0][_0xba9a('0x29')][_0xba9a('0x81')];_0x2d26a2['body'][_0xba9a('0x64')]=_0x456c24[_0xba9a('0x64')][0x0][_0xba9a('0x29')][_0xba9a('0x94')];break;case'intelepeer':_0x2d26a2[_0xba9a('0x64')]['from']=_0x456c24['body'][_0xba9a('0x81')];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x64')]=_0x456c24[_0xba9a('0x64')][_0xba9a('0x29')];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x84')]=_0x456c24[_0xba9a('0x64')][_0xba9a('0x95')];break;}}if(_0x2d26a2[_0xba9a('0x64')]['id']){delete _0x2d26a2[_0xba9a('0x64')]['id'];}if(_[_0xba9a('0x96')](_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x81')])){throw new db[(_0xba9a('0x79'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xba9a('0x96')](_0x2d26a2[_0xba9a('0x64')]['body'])||_0x2d26a2['body'][_0xba9a('0x64')]===''){throw new db['Sequelize'][(_0xba9a('0x97'))](_0xba9a('0x98'));}if(_[_0xba9a('0x96')](_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x99')])){throw new db[(_0xba9a('0x79'))][(_0xba9a('0x97'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5dd6b6);}if(!_[_0xba9a('0x9a')](_0x5dd6b6,_0x2d26a2['body'][_0xba9a('0x99')])){throw new db[(_0xba9a('0x79'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5dd6b6);}_0x251f33[_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x99')]]=_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x81')];return db[_0xba9a('0x9b')]['find']({'where':{'id':_0x2d26a2[_0xba9a('0x78')][_0xba9a('0x7e')]},'include':[{'model':db[_0xba9a('0x9c')],'as':_0xba9a('0x9d'),'where':_0x251f33,'limit':0x1,'order':[[_0xba9a('0x7d'),'DESC']]}]});})[_0xba9a('0x21')](handleEntityNotFound(_0x157842,null))[_0xba9a('0x21')](function(_0x4ff122){if(_0x4ff122){_0x2d26a2[_0xba9a('0x9e')]=_[_0xba9a('0x9f')](_0x4ff122,[_0xba9a('0x9d')]);if(_0x4ff122[_0xba9a('0x9d')]['length']){return _0x4ff122[_0xba9a('0x9d')][0x0];}var _0x180e12=_[_0xba9a('0x1b')](_0x2d26a2[_0xba9a('0x64')],{'firstName':_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x81')],'ListId':_0x4ff122['id']});_0x180e12[_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x99')]]=_0x2d26a2[_0xba9a('0x64')]['from'];return db['CmContact'][_0xba9a('0x5d')](_0x180e12,{'fields':_0x32b730,'raw':!![]});}})[_0xba9a('0x21')](handleEntityNotFound(_0x157842,null))[_0xba9a('0x21')](function(_0x200a9e){if(_0x200a9e){_0x2d26a2['contact']=_0x200a9e;var _0xf26a73={'ContactId':_0x200a9e['id'],'phone':_0x2d26a2[_0xba9a('0x64')]['from'],'SmsAccountId':_0x456c24[_0xba9a('0x65')]['id']};var _0x45186f={'ContactId':_0x200a9e['id'],'SmsAccountId':_0x456c24[_0xba9a('0x65')]['id'],'closed':![]};return db[_0xba9a('0xa0')][_0xba9a('0x5c')]({'where':_0x45186f})[_0xba9a('0x21')](function(_0x2707ed){if(_0x2707ed){return[_0x2707ed,![]];}return db[_0xba9a('0xa0')]['create'](_0xf26a73)[_0xba9a('0x21')](function(_0x5eb76b){return[_0x5eb76b,!![]];});});}})[_0xba9a('0xa1')](function(_0x2fe51e,_0x21c59a){_0x2d26a2['interaction']=_0x2fe51e['get']({'plain':!![]});_0x2d26a2[_0xba9a('0xa2')][_0xba9a('0xa3')]=![];if(_0x21c59a){if(_0x2d26a2['account'][_0xba9a('0xa4')]){_0x2d26a2['applications'][_0xba9a('0xa5')]({'id':0x0,'priority':_0x2d26a2[_0xba9a('0x74')]['length']+0x1,'app':_0xba9a('0xa6'),'appdata':'unmanaged','interval':_0xba9a('0xa7')});}_0x2d26a2[_0xba9a('0xa2')][_0xba9a('0xa3')]=!![];}return db[_0xba9a('0xa8')][_0xba9a('0x5d')]({'phone':_0x2d26a2[_0xba9a('0x64')]['from'],'messageId':_0x2d26a2['body'][_0xba9a('0x84')],'body':_0x2d26a2['body'][_0xba9a('0x64')],'SmsAccountId':_0x456c24[_0xba9a('0x65')]['id'],'SmsInteractionId':_0x2fe51e['id'],'direction':'in','ContactId':_0x2fe51e['ContactId'],'AttachmentId':_0x2d26a2[_0xba9a('0x64')]['AttachmentId']});})['then'](function(_0x4205e1){_0x2d26a2[_0xba9a('0x29')]=_0x4205e1;if(_0x2d26a2[_0xba9a('0xa2')][_0xba9a('0xa9')]){return db[_0xba9a('0xaa')]['find']({'attributes':['id',_0xba9a('0x3c')],'where':{'id':_0x2d26a2[_0xba9a('0xa2')][_0xba9a('0xa9')]}})['then'](function(_0x4e3e8a){if(_0x4e3e8a){_0x2d26a2[_0xba9a('0x74')][_0xba9a('0xab')]({'id':0x0,'priority':0x0,'app':_0xba9a('0xac'),'appdata':_0x4e3e8a[_0xba9a('0x3c')]+','+(_0x2d26a2[_0xba9a('0x78')][_0xba9a('0xad')]||0xa),'interval':_0xba9a('0xa7')});}return respondWithRpcPromise('Start','startRouting',_0x2d26a2);});}return respondWithRpcPromise(_0xba9a('0xae'),_0xba9a('0xaf'),_0x2d26a2);})[_0xba9a('0x21')](function(_0x306398){if(_0x306398){var _0x312920=0xc8;var _0x3953f7=_0xba9a('0xb0');logger['info'](_0xba9a('0x25'),_0x3953f7,_0x312920,'entity\x20found');logger[_0xba9a('0xb1')](_0xba9a('0xb2'),_0x3953f7,_0x312920,_0xba9a('0xb3'),JSON[_0xba9a('0x26')](_0x306398));if(_0x2d26a2[_0xba9a('0x78')][_0xba9a('0x44')]===_0xba9a('0x80')){return _0x157842[_0xba9a('0x2d')](_0x312920)['set'](_0xba9a('0xb4'),_0xba9a('0xb5'))[_0xba9a('0x3d')](_0xba9a('0xb6'));}else{return _0x157842[_0xba9a('0x2d')](_0x312920)[_0xba9a('0x2f')](_0x306398);}}})[_0xba9a('0x2b')](handleError(_0x157842,null));};exports[_0xba9a('0xb7')]=function(_0x5188ca,_0x1d3e36){var _0x288da9=_0x5188ca[_0xba9a('0x65')]['id'];var _0x5c7128=_0x5188ca['body'];var _0x51e79a=0xc8;var _0x5e4574=null;return db[_0xba9a('0xb8')]['transaction']({'isolationLevel':db['sequelize'][_0xba9a('0xb9')][_0xba9a('0xba')]['READ_COMMITTED']},function(_0x1ccc32){return db[_0xba9a('0x41')][_0xba9a('0x70')]({'where':{'id':_0x288da9},'transaction':_0x1ccc32})['then'](function(_0xe59787){if(_0xe59787){return db[_0xba9a('0xbb')][_0xba9a('0x39')]({'where':{'SmsAccountId':_0x288da9},'transaction':_0x1ccc32})[_0xba9a('0x21')](function(){var _0x4f073a=_[_0xba9a('0x40')](_0x5c7128,function(_0x2c2e0b){_0x2c2e0b[_0xba9a('0x68')]=_0x288da9;return _0x2c2e0b;});return db['SmsApplication']['bulkCreate'](_0x4f073a,{'transaction':_0x1ccc32});});}else{_0x51e79a=0x194;_0x5e4574=[];}});})[_0xba9a('0x21')](function(){if(_0x51e79a!==0x194){return db[_0xba9a('0xbb')][_0xba9a('0xbc')]({'where':{'SmsAccountId':_0x288da9},'order':_0xba9a('0x76')})[_0xba9a('0x21')](function(_0x2c1a7e){_0x5e4574=_0x2c1a7e;});}})['catch'](function(_0x1ad91e){_0x51e79a=0x1f4;logger[_0xba9a('0x27')](_0x1ad91e[_0xba9a('0x3b')]);if(_0x1ad91e[_0xba9a('0x3c')]){delete _0x1ad91e[_0xba9a('0x3c')];}_0x5e4574=_0x1ad91e;})[_0xba9a('0xbd')](function(){if(_0x5e4574===null){_0x1d3e36[_0xba9a('0x2c')](_0x51e79a);}else{if(_0x51e79a===0x1f4){_0x1d3e36[_0xba9a('0x2d')](_0x51e79a)['send'](_0x5e4574);}else{_0x1d3e36[_0xba9a('0x2d')](_0x51e79a)['json'](_0x5e4574);}}});};exports[_0xba9a('0xbe')]=function(_0x3d0767,_0x5191af,_0x2aa2ec){var _0x58f071={};var _0x36174b={};var _0x4e691a;var _0x3a48e8;return db[_0xba9a('0x41')]['findOne']({'where':{'id':_0x3d0767[_0xba9a('0x65')]['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0x5191af,null))[_0xba9a('0x21')](function(_0x3e3024){if(_0x3e3024){_0x4e691a=_0x3e3024;_0x36174b[_0xba9a('0x46')]=_[_0xba9a('0x48')](db[_0xba9a('0xbb')][_0xba9a('0x42')]);_0x36174b['query']=_[_0xba9a('0x48')](_0x3d0767[_0xba9a('0x47')]);_0x36174b[_0xba9a('0x53')]=_[_0xba9a('0x4a')](_0x36174b[_0xba9a('0x46')],_0x36174b[_0xba9a('0x47')]);_0x58f071[_0xba9a('0x49')]=_[_0xba9a('0x4a')](_0x36174b[_0xba9a('0x46')],qs[_0xba9a('0x4b')](_0x3d0767['query'][_0xba9a('0x4b')]));_0x58f071[_0xba9a('0x49')]=_0x58f071[_0xba9a('0x49')][_0xba9a('0x4c')]?_0x58f071[_0xba9a('0x49')]:_0x36174b[_0xba9a('0x46')];_0x58f071[_0xba9a('0x4f')]=qs[_0xba9a('0x50')](_0x3d0767['query'][_0xba9a('0x50')]);_0x58f071[_0xba9a('0x51')]=qs[_0xba9a('0x53')](_[_0xba9a('0x52')](_0x3d0767[_0xba9a('0x47')],_0x36174b[_0xba9a('0x53')]));if(_0x3d0767[_0xba9a('0x47')][_0xba9a('0x54')]){_0x58f071[_0xba9a('0x51')]=_[_0xba9a('0x55')](_0x58f071[_0xba9a('0x51')],{'$or':_[_0xba9a('0x40')](_0x58f071[_0xba9a('0x49')],function(_0x252789){var _0x1c9137={};_0x1c9137[_0x252789]={'$like':'%'+_0x3d0767['query'][_0xba9a('0x54')]+'%'};return _0x1c9137;})});}_0x58f071=_[_0xba9a('0x55')]({},_0x58f071,_0x3d0767[_0xba9a('0x56')]);return _0x4e691a[_0xba9a('0xbe')](_0x58f071);}})[_0xba9a('0x21')](function(_0x41433f){if(_0x41433f){_0x3a48e8=_0x41433f[_0xba9a('0x4c')];if(!_0x3d0767['query'][_0xba9a('0x4d')]('nolimit')){_0x58f071[_0xba9a('0x32')]=qs[_0xba9a('0x32')](_0x3d0767[_0xba9a('0x47')][_0xba9a('0x32')]);_0x58f071[_0xba9a('0x30')]=qs['offset'](_0x3d0767['query'][_0xba9a('0x30')]);}return _0x4e691a[_0xba9a('0xbe')](_0x58f071);}})['then'](function(_0x44c26c){if(_0x44c26c){return _0x44c26c?{'count':_0x3a48e8,'rows':_0x44c26c}:null;}})[_0xba9a('0x21')](respondWithResult(_0x5191af,null))[_0xba9a('0x2b')](handleError(_0x5191af,null));};exports[_0xba9a('0xbf')]=function(_0x583ff8,_0x4eeb7e,_0x5973ff){var _0x193359={'raw':![],'where':{}};var _0x1cc0bb={};var _0x1de338={'count':0x0,'rows':[]};return db[_0xba9a('0x41')][_0xba9a('0x70')]({'where':{'id':_0x583ff8[_0xba9a('0x65')]['id']}})['then'](handleEntityNotFound(_0x4eeb7e,null))[_0xba9a('0x21')](function(_0x50d42b){if(_0x50d42b){_0x1cc0bb[_0xba9a('0x46')]=_['keys'](db['SmsInteraction'][_0xba9a('0x42')]);_0x1cc0bb[_0xba9a('0x47')]=_[_0xba9a('0x48')](_0x583ff8[_0xba9a('0x47')]);_0x1cc0bb[_0xba9a('0x53')]=_[_0xba9a('0x4a')](_0x1cc0bb[_0xba9a('0x46')],_0x1cc0bb[_0xba9a('0x47')]);_0x193359[_0xba9a('0x49')]=_[_0xba9a('0x4a')](_0x1cc0bb[_0xba9a('0x46')],qs[_0xba9a('0x4b')](_0x583ff8[_0xba9a('0x47')][_0xba9a('0x4b')]));_0x193359[_0xba9a('0x49')]=_0x193359[_0xba9a('0x49')][_0xba9a('0x4c')]?_0x193359[_0xba9a('0x49')]:_0x1cc0bb[_0xba9a('0x46')];if(!_0x583ff8[_0xba9a('0x47')]['hasOwnProperty'](_0xba9a('0x4e'))){_0x193359[_0xba9a('0x32')]=qs[_0xba9a('0x32')](_0x583ff8['query'][_0xba9a('0x32')]);_0x193359['offset']=qs[_0xba9a('0x30')](_0x583ff8[_0xba9a('0x47')][_0xba9a('0x30')]);}_0x193359['order']=qs[_0xba9a('0x50')](_0x583ff8[_0xba9a('0x47')]['sort']);_0x193359[_0xba9a('0x51')]=qs[_0xba9a('0x53')](_[_0xba9a('0x52')](_0x583ff8[_0xba9a('0x47')],_0x1cc0bb[_0xba9a('0x53')]));_0x193359[_0xba9a('0x51')][_0xba9a('0x68')]=_0x50d42b['id'];if(_0x583ff8['query'][_0xba9a('0x54')]){_0x193359[_0xba9a('0x51')]=_[_0xba9a('0x55')](_0x193359[_0xba9a('0x51')],{'$or':_[_0xba9a('0x40')](_0x193359[_0xba9a('0x49')],function(_0x29b373){var _0x3692c4={};_0x3692c4[_0x29b373]={'$like':'%'+_0x583ff8[_0xba9a('0x47')]['filter']+'%'};return _0x3692c4;})});}_0x193359=_[_0xba9a('0x55')]({},_0x193359,_0x583ff8[_0xba9a('0x56')]);return db['SmsInteraction']['count']({'where':_0x193359['where']})['then'](function(_0x1a2fea){_0x1de338[_0xba9a('0x33')]=_0x1a2fea;if(_0x583ff8[_0xba9a('0x47')]['includeAll']){_0x193359[_0xba9a('0x57')]=[{'model':db['CmContact'],'as':_0xba9a('0xc0'),'required':![]},{'model':db[_0xba9a('0xaa')],'as':_0xba9a('0xc1'),'attributes':[_0xba9a('0x3c'),'fullname',_0xba9a('0xc2')],'required':![]},{'model':db[_0xba9a('0xc3')],'as':_0xba9a('0xc4'),'attributes':['id','name','color'],'where':_0x583ff8[_0xba9a('0x47')]['tag']?{'id':_0x583ff8[_0xba9a('0x47')]['tag']}:undefined,'required':_0x583ff8[_0xba9a('0x47')][_0xba9a('0xc5')]?!![]:![]}];}return db['SmsInteraction'][_0xba9a('0x58')](_0x193359);})['then'](function(_0x563322){_0x1de338[_0xba9a('0x59')]=_0x563322;return _0x1de338;});}})[_0xba9a('0x21')](respondWithFilteredResult(_0x4eeb7e,_0x193359))[_0xba9a('0x2b')](handleError(_0x4eeb7e,null));};exports[_0xba9a('0x3d')]=function(_0x1a1c22,_0x46e4d4,_0x2291be){var _0x275aac,_0x1e198a,_0x43df43;if(_[_0xba9a('0x96')](_0x1a1c22[_0xba9a('0x64')][_0xba9a('0x64')])||_0x1a1c22[_0xba9a('0x64')][_0xba9a('0x64')]===''){throw new db[(_0xba9a('0x79'))][(_0xba9a('0x97'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x1a1c22[_0xba9a('0x64')]['to'])){throw new db[(_0xba9a('0x79'))]['ValidationError']('to\x20is\x20mandatory');}_0x275aac=_0x1a1c22['body']['to'];return db[_0xba9a('0x41')]['find']({'where':{'id':_0x1a1c22[_0xba9a('0x65')]['id']},'include':[{'model':db['CmList'],'as':_0xba9a('0xc6'),'include':[{'model':db[_0xba9a('0x9c')],'as':_0xba9a('0x9d'),'where':{'mobile':_0x275aac},'limit':0x1,'order':[[_0xba9a('0x7d'),_0xba9a('0xc7')]]}]}]})[_0xba9a('0x21')](handleEntityNotFound(_0x46e4d4,null))[_0xba9a('0x21')](function(_0x53e7b5){if(_0x53e7b5&&_0x53e7b5['List']){_0x1e198a=_0x53e7b5[_0xba9a('0x5e')]({'plain':!![]});if(_0x1e198a[_0xba9a('0xc6')]&&_0x1e198a[_0xba9a('0xc6')][_0xba9a('0x9d')][_0xba9a('0x4c')]){return _0x1e198a['List']['Contacts'][0x0];}return db[_0xba9a('0x9c')][_0xba9a('0x5d')](_[_0xba9a('0x1b')](_0x1a1c22['body'],{'firstName':_0x275aac,'mobile':_0x275aac,'phone':_0x275aac,'ListId':_0x1e198a[_0xba9a('0x7e')]}));}})[_0xba9a('0x21')](handleEntityNotFound(_0x46e4d4,null))[_0xba9a('0x21')](function(_0x21aa38){if(_0x21aa38){_0x43df43=_0x21aa38;return db[_0xba9a('0xa0')][_0xba9a('0x5c')]({'where':{'ContactId':_0x43df43['id'],'closed':![],'SmsAccountId':_0x1e198a['id']}})[_0xba9a('0x21')](function(_0x2f7a86){if(_0x2f7a86){return[_0x2f7a86,![]];}return db[_0xba9a('0xa0')][_0xba9a('0x5d')]({'UserId':_0x1a1c22[_0xba9a('0x61')]['id'],'ContactId':_0x43df43['id'],'SmsAccountId':_0x1e198a['id'],'phone':_0x275aac,'firstMsgDirection':'out','Messages':[_[_0xba9a('0x55')](_0x1a1c22['body'],{'read':![],'body':_0x1a1c22['body'][_0xba9a('0x64')],'phone':_0x275aac,'SmsAccountId':_0x1e198a['id'],'UserId':_0x1a1c22['user']['id'],'ContactId':_0x43df43['id']})]},{'include':[{'model':db[_0xba9a('0xa8')],'as':_0xba9a('0xc8')}]})['then'](function(_0x54706e){return[_0x54706e,!![]];});});}})[_0xba9a('0xa1')](function(_0x53e8ef,_0x5a92a0){if(_0x5a92a0){return _0x53e8ef;}return db[_0xba9a('0xa8')][_0xba9a('0x5d')](_['merge'](_0x1a1c22[_0xba9a('0x64')],{'read':![],'body':_0x1a1c22[_0xba9a('0x64')]['body'],'phone':_0x275aac,'SmsAccountId':_0x1e198a['id'],'SmsInteractionId':_0x53e8ef['id'],'UserId':_0x1a1c22[_0xba9a('0x61')]['id'],'ContactId':_0x43df43['id']}))[_0xba9a('0x21')](function(_0x19c3d8){_0x53e8ef[_0xba9a('0xc9')][_0xba9a('0xc8')]=[];_0x53e8ef['dataValues'][_0xba9a('0xc8')]['push'](_0x19c3d8['dataValues']);return _0x53e8ef;});})[_0xba9a('0x21')](respondWithResult(_0x46e4d4,null))[_0xba9a('0x2b')](handleError(_0x46e4d4,null));};exports[_0xba9a('0x2d')]=function(_0xb0297c,_0x5713de,_0x70ea29){if(_0xb0297c[_0xba9a('0x64')]['id']){delete _0xb0297c[_0xba9a('0x64')]['id'];}var _0xb1c4d3,_0x3b3367,_0x359a9d;return db['SmsAccount'][_0xba9a('0x5c')]({'where':{'id':_0xb0297c[_0xba9a('0x65')]['id']}})['then'](handleEntityNotFound(_0x5713de,null))[_0xba9a('0x21')](function(_0x5bfb35){if(_0x5bfb35){_0x359a9d=_0x5bfb35;logger['debug'](_0xba9a('0x25'),'status',_0xba9a('0xca'),_0x5bfb35['type'],util[_0xba9a('0xcb')](_0xb0297c[_0xba9a('0x64')],{'showHidden':![],'depth':null}));switch(_0x5bfb35[_0xba9a('0x44')]){case _0xba9a('0x86'):if(_0xb0297c[_0xba9a('0x64')][_0xba9a('0xcc')]&&_0xb0297c['body'][_0xba9a('0x2d')]){_0x3b3367=_0xb0297c[_0xba9a('0x64')][_0xba9a('0x2d')];return db[_0xba9a('0xa8')][_0xba9a('0x5c')]({'where':{'messageId':_0xb0297c[_0xba9a('0x64')][_0xba9a('0xcc')]}});}break;case _0xba9a('0xcd'):if(_0xb0297c[_0xba9a('0x64')][_0xba9a('0xce')]&&_0xb0297c[_0xba9a('0x64')][_0xba9a('0xcf')]){_0x3b3367=_0xb0297c[_0xba9a('0x64')][_0xba9a('0xcf')];return db[_0xba9a('0xa8')][_0xba9a('0x5c')]({'where':{'messageId':_0xb0297c[_0xba9a('0x64')][_0xba9a('0xce')]}});}break;case _0xba9a('0x88'):if(_0xb0297c['body']['message_id']&&_0xb0297c[_0xba9a('0x64')]['status_code']){_0x3b3367=_0xb0297c[_0xba9a('0x64')][_0xba9a('0xd0')];return db[_0xba9a('0xa8')][_0xba9a('0x5c')]({'where':{'messageId':_0xb0297c[_0xba9a('0x64')][_0xba9a('0x89')]}});}break;case _0xba9a('0x8c'):var _0xf2dd5c=_0xb0297c[_0xba9a('0x64')][_0xba9a('0x8d')][0x0];if(_0xf2dd5c[_0xba9a('0x84')]&&_0xf2dd5c[_0xba9a('0x2d')]['groupName']===_0xba9a('0xd1')){_0x3b3367=_0xf2dd5c['status'][_0xba9a('0xd2')];return db[_0xba9a('0xa8')]['find']({'where':{'messageId':_0xf2dd5c['messageId']}});}break;case _0xba9a('0x91'):if(_0xb0297c[_0xba9a('0x64')][_0xba9a('0x84')]&&_0xb0297c[_0xba9a('0x64')][_0xba9a('0x2d')]){_0x3b3367=_0xb0297c[_0xba9a('0x64')][_0xba9a('0x2d')];return db[_0xba9a('0xa8')][_0xba9a('0x5c')]({'where':{'messageId':_0xb0297c['body'][_0xba9a('0x84')]}});}break;case _0xba9a('0xd3'):if(_0xb0297c[_0xba9a('0x64')][0x0][_0xba9a('0x29')]['id']){_0x3b3367=_0xb0297c['body'][0x0][_0xba9a('0x44')];return db[_0xba9a('0xa8')]['find']({'where':{'messageId':_0xb0297c['body'][0x0][_0xba9a('0x29')]['id']}});}break;case _0xba9a('0xd4'):if(_0xb0297c['body'][_0xba9a('0xd5')]&&_0xb0297c['body'][_0xba9a('0x2d')]){_0x3b3367=_0xb0297c[_0xba9a('0x64')]['status'];return db['SmsMessage'][_0xba9a('0x5c')]({'where':{'messageId':_0xb0297c[_0xba9a('0x64')]['redif']}});}break;}}})[_0xba9a('0x21')](handleEntityNotFound(_0x5713de,null))[_0xba9a('0x21')](function(_0x12c420){if(_0x12c420){_0xb1c4d3=_0x12c420;switch(_0x359a9d[_0xba9a('0x44')]){case'skebby':if(_0x3b3367==='DELIVERED'){return _0xb1c4d3[_0xba9a('0x38')]({'read':!![]});}else{logger[_0xba9a('0x27')](_0xba9a('0x25'),'status','skebby',util[_0xba9a('0xcb')](_0xb0297c['body'],{'showHidden':![],'depth':null}));}break;case _0xba9a('0xcd'):if(_0x3b3367==='1'){return _0xb1c4d3[_0xba9a('0x38')]({'read':!![]});}else{logger[_0xba9a('0x27')](_0xba9a('0x25'),_0xba9a('0x2d'),_0xba9a('0x86'),util['inspect'](_0xb0297c['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0xb0297c[_0xba9a('0x64')][_0xba9a('0xd6')]&&_0x3b3367>=0xc8&&_0x3b3367<=0xce){return _0xb1c4d3[_0xba9a('0x38')]({'read':!![]});}else{logger['error'](_0xba9a('0x25'),_0xba9a('0x2d'),_0xba9a('0x88'),util[_0xba9a('0xcb')](_0xb0297c[_0xba9a('0x64')],{'showHidden':![],'depth':null}));}break;case _0xba9a('0x8c'):var _0x52add8=_0xb0297c[_0xba9a('0x64')][_0xba9a('0x8d')][0x0];if(_0x52add8[_0xba9a('0x2d')][_0xba9a('0xd2')]==='DELIVERED'){return _0xb1c4d3[_0xba9a('0x38')]({'read':!![]});}else{logger[_0xba9a('0x27')](_0xba9a('0x25'),_0xba9a('0x2d'),_0xba9a('0x8c'),util[_0xba9a('0xcb')](_0xb0297c[_0xba9a('0x64')],{'showHidden':![],'depth':null}));}break;case _0xba9a('0x91'):if(_0x3b3367=='DELIVERED_TO_GATEWAY'||_0x3b3367==_0xba9a('0xd7')){return _0xb1c4d3[_0xba9a('0x38')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xba9a('0x91'),util[_0xba9a('0xcb')](_0xb0297c[_0xba9a('0x64')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x3b3367=='message-delivered'){return _0xb1c4d3[_0xba9a('0x38')]({'read':!![]});}else{logger['error'](_0xba9a('0x25'),_0xba9a('0x2d'),_0xba9a('0xd3'),util[_0xba9a('0xcb')](_0xb0297c[_0xba9a('0x64')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x3b3367==='DELIVRD'||_0x3b3367===_0xba9a('0xd8')){return _0xb1c4d3[_0xba9a('0x38')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status','intelepeer',util[_0xba9a('0xcb')](_0xb0297c[_0xba9a('0x64')],{'showHidden':![],'depth':null}));}break;}return _0xb1c4d3;}})['then'](respondWithResult(_0x5713de,null))['catch'](handleError(_0x5713de,null));};exports[_0xba9a('0xd9')]=function(_0x210495,_0xecb5c1,_0x21e267){var _0x19c1be,_0x2882f3,_0x21ae15;return db[_0xba9a('0x41')][_0xba9a('0x5c')]({'where':{'id':_0x210495[_0xba9a('0x65')]['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0xecb5c1,null))[_0xba9a('0x21')](function(_0x103837){if(_0x103837){_0x21ae15=_0x103837;logger[_0xba9a('0xb1')](_0xba9a('0x25'),_0xba9a('0x2d'),_0xba9a('0xca'),_0x103837[_0xba9a('0x44')],util[_0xba9a('0xcb')](_0x210495[_0xba9a('0x47')],{'showHidden':![],'depth':null}));switch(_0x103837['type']){case'csc':if(_0x210495[_0xba9a('0x47')]['message-id']&&_0x210495['query'][_0xba9a('0xda')]){_0x2882f3=_0x210495[_0xba9a('0x47')][_0xba9a('0xda')];return db[_0xba9a('0xa8')][_0xba9a('0x5c')]({'where':{'messageId':_0x210495[_0xba9a('0x47')][_0xba9a('0xdb')]}});}break;}}})[_0xba9a('0x21')](handleEntityNotFound(_0xecb5c1,null))['then'](function(_0x12af54){if(_0x12af54){_0x19c1be=_0x12af54;switch(_0x21ae15[_0xba9a('0x44')]){case'csc':if(_0x2882f3==='2'||_0x2882f3==='6'){return _0x19c1be[_0xba9a('0x38')]({'read':!![]});}else{logger[_0xba9a('0x27')](_0xba9a('0x25'),'status',_0xba9a('0x8e'),util['inspect'](_0x210495[_0xba9a('0x47')],{'showHidden':![],'depth':null}));};break;}return _0x19c1be;}})[_0xba9a('0x21')](respondWithResult(_0xecb5c1,null))[_0xba9a('0x2b')](handleError(_0xecb5c1,null));};exports[_0xba9a('0xdc')]=function(_0x205868,_0x64a758,_0x4fecc0){return db['SmsAccount'][_0xba9a('0x5c')]({'where':{'id':_0x205868[_0xba9a('0x65')]['id']}})['then'](handleEntityNotFound(_0x64a758,null))['then'](function(_0x4e52c9){if(_0x4e52c9){return _0x4e52c9[_0xba9a('0xdc')](_0x205868['body']['ids'],_[_0xba9a('0x9f')](_0x205868['body'],[_0xba9a('0x6c'),'id'])||{})['spread'](function(_0x1a4ce6){for(var _0x1367a6=0x0;_0x1367a6<_0x205868[_0xba9a('0x64')]['ids'][_0xba9a('0x4c')];_0x1367a6+=0x1){socket[_0xba9a('0xdd')]('userSmsAccount:save',{'UserId':Number(_0x205868[_0xba9a('0x64')]['ids'][_0x1367a6]),'SmsAccountId':Number(_0x205868[_0xba9a('0x65')]['id'])});}return _0x1a4ce6;});}})[_0xba9a('0x21')](respondWithResult(_0x64a758,null))[_0xba9a('0x2b')](handleError(_0x64a758,null));};exports['removeAgents']=function(_0x459940,_0x5b5d1a,_0x1798fc){return db[_0xba9a('0x41')][_0xba9a('0x5c')]({'where':{'id':_0x459940[_0xba9a('0x65')]['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0x5b5d1a,null))[_0xba9a('0x21')](function(_0x5295b8){if(_0x5295b8){return _0x5295b8[_0xba9a('0xde')](_0x459940[_0xba9a('0x47')][_0xba9a('0x6c')])['then'](function(){if(_[_0xba9a('0xdf')](_0x459940[_0xba9a('0x47')][_0xba9a('0x6c')])){for(var _0x183297=0x0;_0x183297<_0x459940['query'][_0xba9a('0x6c')]['length'];_0x183297+=0x1){socket[_0xba9a('0xdd')]('userSmsAccount:remove',{'UserId':Number(_0x459940['query'][_0xba9a('0x6c')][_0x183297]),'SmsAccountId':Number(_0x459940[_0xba9a('0x65')]['id'])});}}else{socket[_0xba9a('0xdd')](_0xba9a('0xe0'),{'UserId':Number(_0x459940[_0xba9a('0x47')][_0xba9a('0x6c')]),'SmsAccountId':Number(_0x459940[_0xba9a('0x65')]['id'])});}});}})[_0xba9a('0x21')](respondWithStatusCode(_0x5b5d1a,null))['catch'](handleError(_0x5b5d1a,null));};exports[_0xba9a('0xe1')]=function(_0x5aa2ba,_0x262cfb,_0x3c8cf2){var _0x4f972c={};var _0x522e80={};var _0x2b5c2b;var _0x4f2335;return db[_0xba9a('0x41')][_0xba9a('0x70')]({'where':{'id':_0x5aa2ba['params']['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0x262cfb,null))['then'](function(_0x56d383){if(_0x56d383){_0x2b5c2b=_0x56d383;_0x522e80[_0xba9a('0x46')]=_[_0xba9a('0x48')](db['User']['rawAttributes']);_0x522e80[_0xba9a('0x47')]=_[_0xba9a('0x48')](_0x5aa2ba[_0xba9a('0x47')]);_0x522e80[_0xba9a('0x53')]=_[_0xba9a('0x4a')](_0x522e80['model'],_0x522e80['query']);_0x4f972c[_0xba9a('0x49')]=_[_0xba9a('0x4a')](_0x522e80[_0xba9a('0x46')],qs[_0xba9a('0x4b')](_0x5aa2ba[_0xba9a('0x47')]['fields']));_0x4f972c['attributes']=_0x4f972c[_0xba9a('0x49')]['length']?_0x4f972c[_0xba9a('0x49')]:_0x522e80[_0xba9a('0x46')];_0x4f972c[_0xba9a('0x4f')]=qs[_0xba9a('0x50')](_0x5aa2ba[_0xba9a('0x47')][_0xba9a('0x50')]);_0x4f972c[_0xba9a('0x51')]=qs[_0xba9a('0x53')](_[_0xba9a('0x52')](_0x5aa2ba[_0xba9a('0x47')],_0x522e80[_0xba9a('0x53')]));if(_0x5aa2ba[_0xba9a('0x47')][_0xba9a('0x54')]){_0x4f972c[_0xba9a('0x51')]=_[_0xba9a('0x55')](_0x4f972c['where'],{'$or':_[_0xba9a('0x40')](_0x4f972c[_0xba9a('0x49')],function(_0xdd3471){var _0x2fea25={};_0x2fea25[_0xdd3471]={'$like':'%'+_0x5aa2ba[_0xba9a('0x47')][_0xba9a('0x54')]+'%'};return _0x2fea25;})});}_0x4f972c=_[_0xba9a('0x55')]({},_0x4f972c,_0x5aa2ba[_0xba9a('0x56')]);return _0x2b5c2b[_0xba9a('0xe1')](_0x4f972c);}})[_0xba9a('0x21')](function(_0x36efee){if(_0x36efee){_0x4f2335=_0x36efee[_0xba9a('0x4c')];if(!_0x5aa2ba[_0xba9a('0x47')][_0xba9a('0x4d')](_0xba9a('0x4e'))){_0x4f972c[_0xba9a('0x32')]=qs[_0xba9a('0x32')](_0x5aa2ba[_0xba9a('0x47')]['limit']);_0x4f972c[_0xba9a('0x30')]=qs[_0xba9a('0x30')](_0x5aa2ba['query'][_0xba9a('0x30')]);}return _0x2b5c2b['getAgents'](_0x4f972c);}})[_0xba9a('0x21')](function(_0x2628d0){if(_0x2628d0){return _0x2628d0?{'count':_0x4f2335,'rows':_0x2628d0}:null;}})['then'](respondWithResult(_0x262cfb,null))[_0xba9a('0x2b')](handleError(_0x262cfb,null));}; \ No newline at end of file +var _0xea5f=['findAndCountAll','getApplications','getInteractions','Contact','User','Owner','fullname','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','Messages','spread','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','SmsMessage','statusInt','requestid','status_code','DELIVERED','groupName','clickatell','redif','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','statusGet','csc','message-id','state','omit','removeAgents','emit','userSmsAccount:remove','getAgents','rimraf','request-promise','moment','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./smsAccount.socket','register','client','http','request','then','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','message','SmsAccount,\x20%s,\x20%s','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','SmsAccount','findAll','rows','catch','Pause','mandatoryDispositionPause','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','addDisposition','SmsAccountId','getDispositions','Disposition','nolimit','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','SmsApplication','Applications','account','applications','orderBy','priority','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','From','Body','messageId','MessageSid','skebby','from','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','CmContact','Contacts','DESC','list','contact','SmsInteraction','interaction','created','autoclose','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','Content-Type','text/xml','send','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','bulkCreate'];(function(_0x6978c0,_0x1f6765){var _0x361377=function(_0x2d6cfd){while(--_0x2d6cfd){_0x6978c0['push'](_0x6978c0['shift']());}};_0x361377(++_0x1f6765);}(_0xea5f,0x1ee));var _0xfea5=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xea5f[_0x160c73];return _0xd9302;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfea5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfea5('0x1'));var moment=require(_0xfea5('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfea5('0x3'));var path=require('path');var sox=require(_0xfea5('0x4'));var csv=require(_0xfea5('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfea5('0x6'));var _=require(_0xfea5('0x7'));var squel=require(_0xfea5('0x8'));var crypto=require(_0xfea5('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xfea5('0xa'));var toCsv=require(_0xfea5('0x5'));var querystring=require(_0xfea5('0xb'));var Papa=require(_0xfea5('0xc'));var Redis=require('ioredis');var authService=require(_0xfea5('0xd'));var qs=require(_0xfea5('0xe'));var as=require(_0xfea5('0xf'));var hardwareService=require(_0xfea5('0x10'));var logger=require(_0xfea5('0x11'))(_0xfea5('0x12'));var utils=require(_0xfea5('0x13'));var config=require(_0xfea5('0x14'));var licenseUtil=require(_0xfea5('0x15'));var db=require('../../mysqldb')['db'];config[_0xfea5('0x16')]=_[_0xfea5('0x17')](config[_0xfea5('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xfea5('0x18'))(new Redis(config[_0xfea5('0x16')]));require(_0xfea5('0x19'))[_0xfea5('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfea5('0x1b')][_0xfea5('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x566d84,_0x509568,_0x4fea23,_0x3a2d39){return new BPromise(function(_0x351f84,_0x44ca82){var _0x2e552c=_0x3a2d39||client;return _0x2e552c[_0xfea5('0x1d')](_0x566d84,_0x4fea23)[_0xfea5('0x1e')](function(_0x2d58fb){logger[_0xfea5('0x1f')]('SmsAccount,\x20%s,\x20%s',_0x509568,'request\x20sent');logger[_0xfea5('0x20')](_0xfea5('0x21'),_0x509568,'request\x20sent',JSON['stringify'](_0x2d58fb));if(_0x2d58fb['error']){if(_0x2d58fb[_0xfea5('0x22')]['code']===0x1f4){logger[_0xfea5('0x22')]('SmsAccount,\x20%s,\x20%s',_0x509568,_0x2d58fb[_0xfea5('0x22')][_0xfea5('0x23')]);return _0x44ca82(_0x2d58fb[_0xfea5('0x22')][_0xfea5('0x23')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x509568,_0x2d58fb['error'][_0xfea5('0x23')]);return _0x351f84(_0x2d58fb['error']['message']);}else{logger[_0xfea5('0x1f')](_0xfea5('0x24'),_0x509568,'request\x20sent');_0x351f84(_0x2d58fb[_0xfea5('0x25')][_0xfea5('0x23')]);}})['catch'](function(_0x17e3cc){logger['error'](_0xfea5('0x24'),_0x509568,_0x17e3cc);_0x44ca82(_0x17e3cc);});});}function respondWithStatusCode(_0x5cbd10,_0x19baf2){_0x19baf2=_0x19baf2||0xcc;return function(_0xf35ef){if(_0xf35ef){return _0x5cbd10[_0xfea5('0x26')](_0x19baf2);}return _0x5cbd10['status'](_0x19baf2)[_0xfea5('0x27')]();};}function respondWithResult(_0x4db3cc,_0x539e2d){_0x539e2d=_0x539e2d||0xc8;return function(_0x448dda){if(_0x448dda){return _0x4db3cc[_0xfea5('0x28')](_0x539e2d)[_0xfea5('0x29')](_0x448dda);}};}function respondWithFilteredResult(_0x58b037,_0x2d6fcf){return function(_0x19c253){if(_0x19c253){var _0x225ad8=typeof _0x2d6fcf[_0xfea5('0x2a')]===_0xfea5('0x2b')&&typeof _0x2d6fcf[_0xfea5('0x2c')]===_0xfea5('0x2b');var _0x59408b=_0x19c253[_0xfea5('0x2d')];var _0x2b1bcf=_0x225ad8?0x0:_0x2d6fcf[_0xfea5('0x2a')];var _0x3cf230=_0x225ad8?_0x19c253[_0xfea5('0x2d')]:_0x2d6fcf['offset']+_0x2d6fcf['limit'];var _0x870f6d;if(_0x3cf230>=_0x59408b){_0x3cf230=_0x59408b;_0x870f6d=0xc8;}else{_0x870f6d=0xce;}_0x58b037['status'](_0x870f6d);return _0x58b037[_0xfea5('0x2e')](_0xfea5('0x2f'),_0x2b1bcf+'-'+_0x3cf230+'/'+_0x59408b)[_0xfea5('0x29')](_0x19c253);}return null;};}function patchUpdates(_0x8e855c){return function(_0x86791c){try{jsonpatch[_0xfea5('0x30')](_0x86791c,_0x8e855c,!![]);}catch(_0xd422da){return BPromise['reject'](_0xd422da);}return _0x86791c[_0xfea5('0x31')]();};}function saveUpdates(_0x11be00,_0x5d0b73){return function(_0x404235){if(_0x404235){return _0x404235[_0xfea5('0x32')](_0x11be00)['then'](function(_0x5cca6a){return _0x5cca6a;});}return null;};}function removeEntity(_0x1f6ef0,_0x19b963){return function(_0x203892){if(_0x203892){return _0x203892[_0xfea5('0x33')]()[_0xfea5('0x1e')](function(){var _0x83138a=_0x203892[_0xfea5('0x34')]({'plain':!![]});var _0x451a14=_0xfea5('0x35');return db[_0xfea5('0x36')][_0xfea5('0x33')]({'where':{'type':_0x451a14,'resourceId':_0x83138a['id']}})[_0xfea5('0x1e')](function(){return _0x203892;});})[_0xfea5('0x1e')](function(){_0x1f6ef0[_0xfea5('0x28')](0xcc)[_0xfea5('0x27')]();});}};}function handleEntityNotFound(_0x534f58,_0x1192a0){return function(_0x2be718){if(!_0x2be718){_0x534f58[_0xfea5('0x26')](0x194);}return _0x2be718;};}function handleError(_0x549762,_0x474555){_0x474555=_0x474555||0x1f4;return function(_0x3aa448){logger[_0xfea5('0x22')](_0x3aa448[_0xfea5('0x37')]);if(_0x3aa448[_0xfea5('0x38')]){delete _0x3aa448[_0xfea5('0x38')];}_0x549762['status'](_0x474555)['send'](_0x3aa448);};}exports[_0xfea5('0x39')]=function(_0x255618,_0x515fa3){var _0xe97a81={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1c93e3={},_0x2a7d64={'count':0x0,'rows':[]};var _0x5c2017=_[_0xfea5('0x3a')](db['SmsAccount'][_0xfea5('0x3b')],function(_0x5328ab){return{'name':_0x5328ab[_0xfea5('0x3c')],'type':_0x5328ab[_0xfea5('0x3d')][_0xfea5('0x3e')]};});_0x1c93e3[_0xfea5('0x3f')]=_[_0xfea5('0x3a')](_0x5c2017,_0xfea5('0x38'));_0x1c93e3[_0xfea5('0x40')]=_[_0xfea5('0x41')](_0x255618['query']);_0x1c93e3[_0xfea5('0x42')]=_[_0xfea5('0x43')](_0x1c93e3['model'],_0x1c93e3['query']);_0xe97a81[_0xfea5('0x44')]=_[_0xfea5('0x43')](_0x1c93e3[_0xfea5('0x3f')],qs[_0xfea5('0x45')](_0x255618[_0xfea5('0x40')][_0xfea5('0x45')]));_0xe97a81[_0xfea5('0x44')]=_0xe97a81[_0xfea5('0x44')][_0xfea5('0x46')]?_0xe97a81[_0xfea5('0x44')]:_0x1c93e3[_0xfea5('0x3f')];if(!_0x255618[_0xfea5('0x40')][_0xfea5('0x47')]('nolimit')){_0xe97a81[_0xfea5('0x2c')]=qs[_0xfea5('0x2c')](_0x255618['query'][_0xfea5('0x2c')]);_0xe97a81['offset']=qs['offset'](_0x255618[_0xfea5('0x40')][_0xfea5('0x2a')]);}_0xe97a81[_0xfea5('0x48')]=qs[_0xfea5('0x49')](_0x255618[_0xfea5('0x40')][_0xfea5('0x49')]);_0xe97a81['where']=qs['filters'](_[_0xfea5('0x4a')](_0x255618[_0xfea5('0x40')],_0x1c93e3[_0xfea5('0x42')]),_0x5c2017);if(_0x255618[_0xfea5('0x40')][_0xfea5('0x4b')]){_0xe97a81[_0xfea5('0x4c')]=_['merge'](_0xe97a81['where'],{'$or':_[_0xfea5('0x3a')](_0x5c2017,function(_0x592081){if(_0x592081[_0xfea5('0x3d')]!=='VIRTUAL'){var _0x1010b5={};_0x1010b5[_0x592081[_0xfea5('0x38')]]={'$like':'%'+_0x255618[_0xfea5('0x40')][_0xfea5('0x4b')]+'%'};return _0x1010b5;}})});}_0xe97a81=_[_0xfea5('0x4d')]({},_0xe97a81,_0x255618[_0xfea5('0x4e')]);var _0x13732a={'where':_0xe97a81['where']};return db[_0xfea5('0x4f')]['count'](_0x13732a)[_0xfea5('0x1e')](function(_0x117bfb){_0x2a7d64[_0xfea5('0x2d')]=_0x117bfb;if(_0x255618['query']['includeAll']){_0xe97a81['include']=[{'all':!![]}];}return db[_0xfea5('0x4f')][_0xfea5('0x50')](_0xe97a81);})[_0xfea5('0x1e')](function(_0x5d8e71){_0x2a7d64[_0xfea5('0x51')]=_0x5d8e71;return _0x2a7d64;})[_0xfea5('0x1e')](respondWithFilteredResult(_0x515fa3,_0xe97a81))[_0xfea5('0x52')](handleError(_0x515fa3,null));};exports['show']=function(_0x51c9de,_0x283eac){var _0x1397b0={'raw':![],'where':{'id':_0x51c9de['params']['id']},'include':[{'model':db[_0xfea5('0x53')],'as':_0xfea5('0x54')}]},_0x2be011={};_0x2be011[_0xfea5('0x3f')]=_['keys'](db[_0xfea5('0x4f')]['rawAttributes']);_0x2be011[_0xfea5('0x40')]=_['keys'](_0x51c9de[_0xfea5('0x40')]);_0x2be011[_0xfea5('0x42')]=_[_0xfea5('0x43')](_0x2be011[_0xfea5('0x3f')],_0x2be011[_0xfea5('0x40')]);_0x1397b0[_0xfea5('0x44')]=_['intersection'](_0x2be011['model'],qs[_0xfea5('0x45')](_0x51c9de[_0xfea5('0x40')][_0xfea5('0x45')]));_0x1397b0[_0xfea5('0x44')]=_0x1397b0[_0xfea5('0x44')][_0xfea5('0x46')]?_0x1397b0[_0xfea5('0x44')]:_0x2be011[_0xfea5('0x3f')];if(_0x51c9de[_0xfea5('0x40')][_0xfea5('0x55')]){_0x1397b0['include']=[{'all':!![]}];}_0x1397b0=_[_0xfea5('0x4d')]({},_0x1397b0,_0x51c9de[_0xfea5('0x4e')]);return db[_0xfea5('0x4f')]['find'](_0x1397b0)[_0xfea5('0x1e')](handleEntityNotFound(_0x283eac,null))[_0xfea5('0x1e')](respondWithResult(_0x283eac,null))['catch'](handleError(_0x283eac,null));};exports[_0xfea5('0x56')]=function(_0x7e962c,_0x1750dd){return db[_0xfea5('0x4f')][_0xfea5('0x56')](_0x7e962c[_0xfea5('0x57')],{})[_0xfea5('0x1e')](function(_0x319666){var _0x1b7c27=_0x7e962c[_0xfea5('0x58')][_0xfea5('0x34')]({'plain':!![]});if(!_0x1b7c27)throw new Error(_0xfea5('0x59'));if(_0x1b7c27[_0xfea5('0x5a')]===_0xfea5('0x58')){var _0x337596=_0x319666['get']({'plain':!![]});var _0x28c621=_0xfea5('0x35');return db[_0xfea5('0x5b')]['find']({'where':{'name':_0x28c621,'userProfileId':_0x1b7c27[_0xfea5('0x5c')]},'raw':!![]})['then'](function(_0x8a7df){if(_0x8a7df&&_0x8a7df[_0xfea5('0x5d')]===0x0){return db[_0xfea5('0x36')]['create']({'name':_0x337596[_0xfea5('0x38')],'resourceId':_0x337596['id'],'type':_0x8a7df[_0xfea5('0x38')],'sectionId':_0x8a7df['id']},{})[_0xfea5('0x1e')](function(){return _0x319666;});}else{return _0x319666;}})[_0xfea5('0x52')](function(_0x4726c6){logger[_0xfea5('0x22')](_0xfea5('0x5e'),_0x4726c6);throw _0x4726c6;});}return _0x319666;})[_0xfea5('0x1e')](respondWithResult(_0x1750dd,0xc9))[_0xfea5('0x52')](handleError(_0x1750dd,null));};exports[_0xfea5('0x32')]=function(_0x4d17a3,_0x395964){if(_0x4d17a3[_0xfea5('0x57')]['id']){delete _0x4d17a3[_0xfea5('0x57')]['id'];}return db['SmsAccount'][_0xfea5('0x5f')]({'where':{'id':_0x4d17a3['params']['id']},'include':[{'model':db[_0xfea5('0x53')],'as':_0xfea5('0x54')}]})[_0xfea5('0x1e')](handleEntityNotFound(_0x395964,null))['then'](saveUpdates(_0x4d17a3['body'],null))['then'](respondWithResult(_0x395964,null))['catch'](handleError(_0x395964,null));};exports[_0xfea5('0x33')]=function(_0x487c75,_0x5b8239){return db[_0xfea5('0x4f')][_0xfea5('0x5f')]({'where':{'id':_0x487c75[_0xfea5('0x60')]['id']}})['then'](handleEntityNotFound(_0x5b8239,null))[_0xfea5('0x1e')](removeEntity(_0x5b8239,null))[_0xfea5('0x52')](handleError(_0x5b8239,null));};exports[_0xfea5('0x61')]=function(_0x3115c3,_0x43d631){return db[_0xfea5('0x4f')][_0xfea5('0x61')]()['then'](respondWithResult(_0x43d631,null))[_0xfea5('0x52')](handleError(_0x43d631,null));};exports[_0xfea5('0x62')]=function(_0x2b25f5,_0x357dde,_0x1b2d3a){if(_0x2b25f5['body']['id']){delete _0x2b25f5['body']['id'];}return db[_0xfea5('0x4f')][_0xfea5('0x5f')]({'where':{'id':_0x2b25f5[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x357dde,null))[_0xfea5('0x1e')](function(_0x20b25e){if(_0x20b25e){_0x2b25f5[_0xfea5('0x57')][_0xfea5('0x63')]=_0x20b25e['id'];return db['Disposition'][_0xfea5('0x56')](_0x2b25f5['body']);}})[_0xfea5('0x1e')](respondWithResult(_0x357dde,null))[_0xfea5('0x52')](handleError(_0x357dde,null));};exports[_0xfea5('0x64')]=function(_0x38bc31,_0x1330ae,_0x37b631){var _0x299ed1={'raw':![],'where':{}};var _0x2117c4={};var _0x2f9e16={'count':0x0,'rows':[]};return db[_0xfea5('0x4f')]['findOne']({'where':{'id':_0x38bc31[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x1330ae,null))[_0xfea5('0x1e')](function(_0x277bdc){if(_0x277bdc){_0x2117c4[_0xfea5('0x3f')]=_[_0xfea5('0x41')](db[_0xfea5('0x65')]['rawAttributes']);_0x2117c4[_0xfea5('0x40')]=_[_0xfea5('0x41')](_0x38bc31[_0xfea5('0x40')]);_0x2117c4[_0xfea5('0x42')]=_[_0xfea5('0x43')](_0x2117c4[_0xfea5('0x3f')],_0x2117c4['query']);_0x299ed1[_0xfea5('0x44')]=_[_0xfea5('0x43')](_0x2117c4[_0xfea5('0x3f')],qs['fields'](_0x38bc31['query'][_0xfea5('0x45')]));_0x299ed1[_0xfea5('0x44')]=_0x299ed1[_0xfea5('0x44')][_0xfea5('0x46')]?_0x299ed1[_0xfea5('0x44')]:_0x2117c4[_0xfea5('0x3f')];if(!_0x38bc31[_0xfea5('0x40')][_0xfea5('0x47')](_0xfea5('0x66'))){_0x299ed1['limit']=qs[_0xfea5('0x2c')](_0x38bc31[_0xfea5('0x40')][_0xfea5('0x2c')]);_0x299ed1['offset']=qs[_0xfea5('0x2a')](_0x38bc31['query'][_0xfea5('0x2a')]);}_0x299ed1[_0xfea5('0x48')]=qs[_0xfea5('0x49')](_0x38bc31[_0xfea5('0x40')][_0xfea5('0x49')]);_0x299ed1[_0xfea5('0x4c')]=qs[_0xfea5('0x42')](_[_0xfea5('0x4a')](_0x38bc31['query'],_0x2117c4['filters']));_0x299ed1['where'][_0xfea5('0x63')]=_0x277bdc['id'];if(_0x38bc31[_0xfea5('0x40')][_0xfea5('0x4b')]){_0x299ed1[_0xfea5('0x4c')]=_[_0xfea5('0x4d')](_0x299ed1[_0xfea5('0x4c')],{'$or':_[_0xfea5('0x3a')](_0x299ed1[_0xfea5('0x44')],function(_0x30159a){var _0x2816ef={};_0x2816ef[_0x30159a]={'$like':'%'+_0x38bc31[_0xfea5('0x40')][_0xfea5('0x4b')]+'%'};return _0x2816ef;})});}_0x299ed1=_['merge']({},_0x299ed1,_0x38bc31[_0xfea5('0x4e')]);return db[_0xfea5('0x65')][_0xfea5('0x2d')]({'where':_0x299ed1['where']})[_0xfea5('0x1e')](function(_0x1d6c24){_0x2f9e16[_0xfea5('0x2d')]=_0x1d6c24;if(_0x38bc31['query'][_0xfea5('0x55')]){_0x299ed1[_0xfea5('0x67')]=[{'all':!![]}];}return db['Disposition'][_0xfea5('0x50')](_0x299ed1);})['then'](function(_0x4b4597){_0x2f9e16[_0xfea5('0x51')]=_0x4b4597;return _0x2f9e16;});}})[_0xfea5('0x1e')](respondWithFilteredResult(_0x1330ae,_0x299ed1))[_0xfea5('0x52')](handleError(_0x1330ae,null));};exports[_0xfea5('0x68')]=function(_0x3f1739,_0x2040d6,_0x28d53d){return db[_0xfea5('0x4f')]['find']({'where':{'id':_0x3f1739['params']['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x2040d6,null))[_0xfea5('0x1e')](function(_0x267857){if(_0x267857){return _0x267857[_0xfea5('0x68')](_0x3f1739[_0xfea5('0x40')][_0xfea5('0x69')]);}})['then'](respondWithStatusCode(_0x2040d6,null))['catch'](handleError(_0x2040d6,null));};exports[_0xfea5('0x6a')]=function(_0x2fdb8b,_0x1350b8,_0x4e6304){if(_0x2fdb8b['body']['id']){delete _0x2fdb8b['body']['id'];}return db[_0xfea5('0x4f')][_0xfea5('0x5f')]({'where':{'id':_0x2fdb8b[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x1350b8,null))['then'](function(_0x46fb69){if(_0x46fb69){_0x2fdb8b[_0xfea5('0x57')]['SmsAccountId']=_0x46fb69['id'];return db[_0xfea5('0x6b')][_0xfea5('0x56')](_0x2fdb8b[_0xfea5('0x57')]);}})[_0xfea5('0x1e')](respondWithResult(_0x1350b8,null))['catch'](handleError(_0x1350b8,null));};exports[_0xfea5('0x6c')]=function(_0x35cc79,_0x14bd33,_0x49559f){var _0x45a9a3={'raw':![],'where':{}};var _0x195785={};var _0x158604={'count':0x0,'rows':[]};return db['SmsAccount'][_0xfea5('0x6d')]({'where':{'id':_0x35cc79[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x14bd33,null))[_0xfea5('0x1e')](function(_0x30c342){if(_0x30c342){_0x195785['model']=_[_0xfea5('0x41')](db[_0xfea5('0x6b')][_0xfea5('0x3b')]);_0x195785['query']=_[_0xfea5('0x41')](_0x35cc79[_0xfea5('0x40')]);_0x195785[_0xfea5('0x42')]=_[_0xfea5('0x43')](_0x195785[_0xfea5('0x3f')],_0x195785[_0xfea5('0x40')]);_0x45a9a3[_0xfea5('0x44')]=_[_0xfea5('0x43')](_0x195785[_0xfea5('0x3f')],qs['fields'](_0x35cc79[_0xfea5('0x40')][_0xfea5('0x45')]));_0x45a9a3[_0xfea5('0x44')]=_0x45a9a3[_0xfea5('0x44')]['length']?_0x45a9a3[_0xfea5('0x44')]:_0x195785[_0xfea5('0x3f')];if(!_0x35cc79['query'][_0xfea5('0x47')]('nolimit')){_0x45a9a3[_0xfea5('0x2c')]=qs[_0xfea5('0x2c')](_0x35cc79['query'][_0xfea5('0x2c')]);_0x45a9a3[_0xfea5('0x2a')]=qs['offset'](_0x35cc79['query'][_0xfea5('0x2a')]);}_0x45a9a3[_0xfea5('0x48')]=qs[_0xfea5('0x49')](_0x35cc79['query'][_0xfea5('0x49')]);_0x45a9a3['where']=qs['filters'](_[_0xfea5('0x4a')](_0x35cc79[_0xfea5('0x40')],_0x195785[_0xfea5('0x42')]));_0x45a9a3['where'][_0xfea5('0x63')]=_0x30c342['id'];if(_0x35cc79[_0xfea5('0x40')][_0xfea5('0x4b')]){_0x45a9a3[_0xfea5('0x4c')]=_[_0xfea5('0x4d')](_0x45a9a3[_0xfea5('0x4c')],{'$or':_[_0xfea5('0x3a')](_0x45a9a3[_0xfea5('0x44')],function(_0x48a700){var _0x19b2bc={};_0x19b2bc[_0x48a700]={'$like':'%'+_0x35cc79['query']['filter']+'%'};return _0x19b2bc;})});}_0x45a9a3=_[_0xfea5('0x4d')]({},_0x45a9a3,_0x35cc79[_0xfea5('0x4e')]);return db['CannedAnswer']['count']({'where':_0x45a9a3[_0xfea5('0x4c')]})[_0xfea5('0x1e')](function(_0xbf24fc){_0x158604[_0xfea5('0x2d')]=_0xbf24fc;if(_0x35cc79[_0xfea5('0x40')][_0xfea5('0x55')]){_0x45a9a3[_0xfea5('0x67')]=[{'all':!![]}];}return db[_0xfea5('0x6b')][_0xfea5('0x50')](_0x45a9a3);})[_0xfea5('0x1e')](function(_0x17f658){_0x158604[_0xfea5('0x51')]=_0x17f658;return _0x158604;});}})['then'](respondWithFilteredResult(_0x14bd33,_0x45a9a3))[_0xfea5('0x52')](handleError(_0x14bd33,null));};exports[_0xfea5('0x6e')]=function(_0x3e24b1,_0x8beef9,_0x4698ca){return db[_0xfea5('0x4f')][_0xfea5('0x5f')]({'where':{'id':_0x3e24b1[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x8beef9,null))[_0xfea5('0x1e')](function(_0xca5990){if(_0xca5990){return _0xca5990[_0xfea5('0x6e')](_0x3e24b1['query'][_0xfea5('0x69')]);}})[_0xfea5('0x1e')](respondWithStatusCode(_0x8beef9,null))[_0xfea5('0x52')](handleError(_0x8beef9,null));};exports[_0xfea5('0x6f')]=function(_0x926747,_0x6dae41,_0x4121de){var _0x548e8f={'channel':'sms'};var _0x525218=[];var _0x3d4c64=[];var _0x164718={};return db[_0xfea5('0x4f')][_0xfea5('0x5f')]({'where':{'id':_0x926747[_0xfea5('0x60')]['id']},'include':[{'model':db[_0xfea5('0x70')],'as':_0xfea5('0x71')}]})[_0xfea5('0x1e')](handleEntityNotFound(_0x6dae41,null))[_0xfea5('0x1e')](function(_0x56277e){_0x548e8f[_0xfea5('0x72')]=_0x56277e;_0x548e8f[_0xfea5('0x73')]=_[_0xfea5('0x74')](_0x56277e[_0xfea5('0x71')],[_0xfea5('0x75')],['asc']);if(_0x548e8f[_0xfea5('0x72')][_0xfea5('0x71')]){delete _0x548e8f[_0xfea5('0x72')][_0xfea5('0x71')];}return db['CmContact'][_0xfea5('0x61')]();})[_0xfea5('0x1e')](function(_0x34a7ff){if(!_0x34a7ff){throw new db[(_0xfea5('0x76'))][(_0xfea5('0x77'))](_0xfea5('0x78'));}_0x525218=_[_0xfea5('0x79')](_[_0xfea5('0x41')](_0x34a7ff),[_0xfea5('0x7a'),_0xfea5('0x7b')]);_0x3d4c64=_[_0xfea5('0x79')](_[_0xfea5('0x41')](_0x34a7ff),[_0xfea5('0x7a'),_0xfea5('0x7b'),'CompanyId',_0xfea5('0x7c')]);_0x548e8f['body']={'mapKey':_0xfea5('0x7d')};if(_0x548e8f[_0xfea5('0x72')][_0xfea5('0x3d')]){switch(_0x548e8f[_0xfea5('0x72')][_0xfea5('0x3d')]){case _0xfea5('0x7e'):_0x548e8f['body']['from']=_0x926747[_0xfea5('0x57')][_0xfea5('0x7f')];_0x548e8f[_0xfea5('0x57')][_0xfea5('0x57')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x80')];_0x548e8f[_0xfea5('0x57')][_0xfea5('0x81')]=_0x926747['body'][_0xfea5('0x82')];break;case _0xfea5('0x83'):_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')]='+'+_0x926747[_0xfea5('0x57')][_0xfea5('0x85')];_0x548e8f[_0xfea5('0x57')]['body']=_0x926747[_0xfea5('0x57')][_0xfea5('0x86')];break;case _0xfea5('0x87'):_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')]=_0x926747[_0xfea5('0x57')]['from'];_0x548e8f['body'][_0xfea5('0x57')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x23')];break;case _0xfea5('0x88'):_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x84')];_0x548e8f['body']['body']=_0x926747['body']['body'];_0x548e8f[_0xfea5('0x57')][_0xfea5('0x81')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x89')];break;case _0xfea5('0x8a'):_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')]=_0x926747[_0xfea5('0x57')]['From'];_0x548e8f['body'][_0xfea5('0x57')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x8b')];_0x548e8f['body'][_0xfea5('0x81')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x8c')];break;case _0xfea5('0x8d'):_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')]='+'+_0x926747[_0xfea5('0x57')][_0xfea5('0x8e')][0x0]['from'];_0x548e8f['body']['body']=_0x926747[_0xfea5('0x57')][_0xfea5('0x8e')][0x0][_0xfea5('0x86')];_0x548e8f[_0xfea5('0x57')][_0xfea5('0x81')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x8e')][0x0]['messageId'];break;case'csc':_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x8f')];_0x548e8f[_0xfea5('0x57')][_0xfea5('0x57')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x90')][_0xfea5('0x23')];break;case'clickatell':_0x548e8f['body'][_0xfea5('0x84')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x91')];_0x548e8f[_0xfea5('0x57')][_0xfea5('0x57')]=_0x926747[_0xfea5('0x57')]['text'];_0x548e8f[_0xfea5('0x57')][_0xfea5('0x81')]=_0x926747['body'][_0xfea5('0x92')];break;case _0xfea5('0x93'):_0x548e8f[_0xfea5('0x57')][_0xfea5('0x81')]=_0x926747[_0xfea5('0x57')][0x0]['message']['id'];_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')]=_0x926747[_0xfea5('0x57')][0x0][_0xfea5('0x23')][_0xfea5('0x84')];_0x548e8f[_0xfea5('0x57')][_0xfea5('0x57')]=_0x926747[_0xfea5('0x57')][0x0][_0xfea5('0x23')][_0xfea5('0x86')];break;case _0xfea5('0x94'):_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')]=_0x926747[_0xfea5('0x57')][_0xfea5('0x84')];_0x548e8f[_0xfea5('0x57')][_0xfea5('0x57')]=_0x926747[_0xfea5('0x57')]['message'];_0x548e8f['body'][_0xfea5('0x81')]=_0x926747[_0xfea5('0x57')]['refid'];break;}}if(_0x548e8f[_0xfea5('0x57')]['id']){delete _0x548e8f[_0xfea5('0x57')]['id'];}if(_['isNil'](_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')])){throw new db[(_0xfea5('0x76'))][(_0xfea5('0x77'))](_0xfea5('0x95'));}if(_['isNil'](_0x548e8f[_0xfea5('0x57')]['body'])||_0x548e8f[_0xfea5('0x57')][_0xfea5('0x57')]===''){throw new db[(_0xfea5('0x76'))][(_0xfea5('0x77'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xfea5('0x96')](_0x548e8f[_0xfea5('0x57')][_0xfea5('0x97')])){throw new db[(_0xfea5('0x76'))]['ValidationError'](_0xfea5('0x98')+_0x3d4c64);}if(!_[_0xfea5('0x99')](_0x3d4c64,_0x548e8f[_0xfea5('0x57')][_0xfea5('0x97')])){throw new db[(_0xfea5('0x76'))][(_0xfea5('0x77'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3d4c64);}_0x164718[_0x548e8f[_0xfea5('0x57')]['mapKey']]=_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')];return db[_0xfea5('0x9a')][_0xfea5('0x5f')]({'where':{'id':_0x548e8f[_0xfea5('0x72')][_0xfea5('0x7c')]},'include':[{'model':db[_0xfea5('0x9b')],'as':_0xfea5('0x9c'),'where':_0x164718,'limit':0x1,'order':[[_0xfea5('0x7b'),_0xfea5('0x9d')]]}]});})[_0xfea5('0x1e')](handleEntityNotFound(_0x6dae41,null))[_0xfea5('0x1e')](function(_0x56bc8d){if(_0x56bc8d){_0x548e8f[_0xfea5('0x9e')]=_['omit'](_0x56bc8d,['Contacts']);if(_0x56bc8d['Contacts']['length']){return _0x56bc8d[_0xfea5('0x9c')][0x0];}var _0x4ca58f=_[_0xfea5('0x17')](_0x548e8f['body'],{'firstName':_0x548e8f['body'][_0xfea5('0x84')],'ListId':_0x56bc8d['id']});_0x4ca58f[_0x548e8f[_0xfea5('0x57')][_0xfea5('0x97')]]=_0x548e8f[_0xfea5('0x57')]['from'];return db[_0xfea5('0x9b')][_0xfea5('0x56')](_0x4ca58f,{'fields':_0x525218,'raw':!![]});}})[_0xfea5('0x1e')](handleEntityNotFound(_0x6dae41,null))[_0xfea5('0x1e')](function(_0x3a12ee){if(_0x3a12ee){_0x548e8f[_0xfea5('0x9f')]=_0x3a12ee;var _0x3dc7c6={'ContactId':_0x3a12ee['id'],'phone':_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')],'SmsAccountId':_0x926747[_0xfea5('0x60')]['id']};var _0x1e7b9c={'ContactId':_0x3a12ee['id'],'SmsAccountId':_0x926747[_0xfea5('0x60')]['id'],'closed':![]};return db[_0xfea5('0xa0')]['find']({'where':_0x1e7b9c})[_0xfea5('0x1e')](function(_0x520b44){if(_0x520b44){return[_0x520b44,![]];}return db[_0xfea5('0xa0')][_0xfea5('0x56')](_0x3dc7c6)[_0xfea5('0x1e')](function(_0x57ecd9){return[_0x57ecd9,!![]];});});}})['spread'](function(_0x563f3c,_0x1a4367){_0x548e8f['interaction']=_0x563f3c[_0xfea5('0x34')]({'plain':!![]});_0x548e8f[_0xfea5('0xa1')][_0xfea5('0xa2')]=![];if(_0x1a4367){if(_0x548e8f[_0xfea5('0x72')][_0xfea5('0xa3')]){_0x548e8f[_0xfea5('0x73')]['push']({'id':0x0,'priority':_0x548e8f[_0xfea5('0x73')][_0xfea5('0x46')]+0x1,'app':_0xfea5('0xa4'),'appdata':_0xfea5('0xa5'),'interval':_0xfea5('0xa6')});}_0x548e8f[_0xfea5('0xa1')]['created']=!![];}return db['SmsMessage']['create']({'phone':_0x548e8f[_0xfea5('0x57')][_0xfea5('0x84')],'messageId':_0x548e8f[_0xfea5('0x57')][_0xfea5('0x81')],'body':_0x548e8f[_0xfea5('0x57')][_0xfea5('0x57')],'SmsAccountId':_0x926747[_0xfea5('0x60')]['id'],'SmsInteractionId':_0x563f3c['id'],'direction':'in','ContactId':_0x563f3c[_0xfea5('0xa7')],'AttachmentId':_0x548e8f[_0xfea5('0x57')][_0xfea5('0xa8')]});})[_0xfea5('0x1e')](function(_0x1ed338){_0x548e8f[_0xfea5('0x23')]=_0x1ed338;if(_0x548e8f[_0xfea5('0xa1')][_0xfea5('0xa9')]){return db['User'][_0xfea5('0x5f')]({'attributes':['id','name'],'where':{'id':_0x548e8f[_0xfea5('0xa1')][_0xfea5('0xa9')]}})[_0xfea5('0x1e')](function(_0x51606b){if(_0x51606b){_0x548e8f[_0xfea5('0x73')][_0xfea5('0xaa')]({'id':0x0,'priority':0x0,'app':_0xfea5('0xab'),'appdata':_0x51606b[_0xfea5('0x38')]+','+(_0x548e8f['account'][_0xfea5('0xac')]||0xa),'interval':_0xfea5('0xa6')});}return respondWithRpcPromise('Start','startRouting',_0x548e8f);});}return respondWithRpcPromise(_0xfea5('0xad'),_0xfea5('0xae'),_0x548e8f);})[_0xfea5('0x1e')](function(_0x5a6bc7){if(_0x5a6bc7){var _0x77ffff=0xc8;var _0x13e777='receiveMessage';logger[_0xfea5('0x1f')](_0xfea5('0x21'),_0x13e777,_0x77ffff,'entity\x20found');logger[_0xfea5('0x20')](_0xfea5('0xaf'),_0x13e777,_0x77ffff,_0xfea5('0xb0'),JSON[_0xfea5('0xb1')](_0x5a6bc7));if(_0x548e8f['account'][_0xfea5('0x3d')]===_0xfea5('0x7e')){return _0x6dae41['status'](_0x77ffff)[_0xfea5('0x2e')](_0xfea5('0xb2'),_0xfea5('0xb3'))[_0xfea5('0xb4')](_0xfea5('0xb5'));}else{return _0x6dae41[_0xfea5('0x28')](_0x77ffff)['json'](_0x5a6bc7);}}})['catch'](handleError(_0x6dae41,null));};exports[_0xfea5('0xb6')]=function(_0xd2ae8,_0x11399a){var _0x56e74c=_0xd2ae8['params']['id'];var _0x44a98b=_0xd2ae8[_0xfea5('0x57')];var _0xfd7922=0xc8;var _0x586142=null;return db[_0xfea5('0xb7')]['transaction']({'isolationLevel':db[_0xfea5('0xb7')][_0xfea5('0xb8')][_0xfea5('0xb9')]['READ_COMMITTED']},function(_0x4537bf){return db[_0xfea5('0x4f')][_0xfea5('0x6d')]({'where':{'id':_0x56e74c},'transaction':_0x4537bf})[_0xfea5('0x1e')](function(_0x3dac5a){if(_0x3dac5a){return db[_0xfea5('0x70')][_0xfea5('0x33')]({'where':{'SmsAccountId':_0x56e74c},'transaction':_0x4537bf})[_0xfea5('0x1e')](function(){var _0x4c603f=_[_0xfea5('0x3a')](_0x44a98b,function(_0x403a15){_0x403a15[_0xfea5('0x63')]=_0x56e74c;return _0x403a15;});return db[_0xfea5('0x70')][_0xfea5('0xba')](_0x4c603f,{'transaction':_0x4537bf});});}else{_0xfd7922=0x194;_0x586142=[];}});})[_0xfea5('0x1e')](function(){if(_0xfd7922!==0x194){return db[_0xfea5('0x70')][_0xfea5('0xbb')]({'where':{'SmsAccountId':_0x56e74c},'order':_0xfea5('0x75')})[_0xfea5('0x1e')](function(_0x1bea5f){_0x586142=_0x1bea5f;});}})[_0xfea5('0x52')](function(_0x1e5eca){_0xfd7922=0x1f4;logger['error'](_0x1e5eca[_0xfea5('0x37')]);if(_0x1e5eca['name']){delete _0x1e5eca[_0xfea5('0x38')];}_0x586142=_0x1e5eca;})['finally'](function(){if(_0x586142===null){_0x11399a[_0xfea5('0x26')](_0xfd7922);}else{if(_0xfd7922===0x1f4){_0x11399a[_0xfea5('0x28')](_0xfd7922)[_0xfea5('0xb4')](_0x586142);}else{_0x11399a[_0xfea5('0x28')](_0xfd7922)[_0xfea5('0x29')](_0x586142);}}});};exports[_0xfea5('0xbc')]=function(_0x5b1e16,_0x4981a0,_0x38668c){var _0x7da3c7={};var _0xd1c19b={};var _0x2111f8;var _0x3c3e8b;return db[_0xfea5('0x4f')][_0xfea5('0x6d')]({'where':{'id':_0x5b1e16[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x4981a0,null))['then'](function(_0x3c3817){if(_0x3c3817){_0x2111f8=_0x3c3817;_0xd1c19b['model']=_[_0xfea5('0x41')](db['SmsApplication']['rawAttributes']);_0xd1c19b[_0xfea5('0x40')]=_['keys'](_0x5b1e16['query']);_0xd1c19b[_0xfea5('0x42')]=_[_0xfea5('0x43')](_0xd1c19b[_0xfea5('0x3f')],_0xd1c19b[_0xfea5('0x40')]);_0x7da3c7['attributes']=_[_0xfea5('0x43')](_0xd1c19b[_0xfea5('0x3f')],qs[_0xfea5('0x45')](_0x5b1e16[_0xfea5('0x40')][_0xfea5('0x45')]));_0x7da3c7['attributes']=_0x7da3c7[_0xfea5('0x44')]['length']?_0x7da3c7[_0xfea5('0x44')]:_0xd1c19b[_0xfea5('0x3f')];_0x7da3c7[_0xfea5('0x48')]=qs['sort'](_0x5b1e16[_0xfea5('0x40')]['sort']);_0x7da3c7[_0xfea5('0x4c')]=qs[_0xfea5('0x42')](_['pick'](_0x5b1e16[_0xfea5('0x40')],_0xd1c19b[_0xfea5('0x42')]));if(_0x5b1e16[_0xfea5('0x40')][_0xfea5('0x4b')]){_0x7da3c7[_0xfea5('0x4c')]=_['merge'](_0x7da3c7['where'],{'$or':_[_0xfea5('0x3a')](_0x7da3c7[_0xfea5('0x44')],function(_0x248c17){var _0x33293c={};_0x33293c[_0x248c17]={'$like':'%'+_0x5b1e16[_0xfea5('0x40')][_0xfea5('0x4b')]+'%'};return _0x33293c;})});}_0x7da3c7=_[_0xfea5('0x4d')]({},_0x7da3c7,_0x5b1e16[_0xfea5('0x4e')]);return _0x2111f8[_0xfea5('0xbc')](_0x7da3c7);}})[_0xfea5('0x1e')](function(_0xe1b435){if(_0xe1b435){_0x3c3e8b=_0xe1b435[_0xfea5('0x46')];if(!_0x5b1e16[_0xfea5('0x40')]['hasOwnProperty'](_0xfea5('0x66'))){_0x7da3c7[_0xfea5('0x2c')]=qs[_0xfea5('0x2c')](_0x5b1e16['query'][_0xfea5('0x2c')]);_0x7da3c7[_0xfea5('0x2a')]=qs['offset'](_0x5b1e16[_0xfea5('0x40')][_0xfea5('0x2a')]);}return _0x2111f8['getApplications'](_0x7da3c7);}})[_0xfea5('0x1e')](function(_0x411ce2){if(_0x411ce2){return _0x411ce2?{'count':_0x3c3e8b,'rows':_0x411ce2}:null;}})['then'](respondWithResult(_0x4981a0,null))[_0xfea5('0x52')](handleError(_0x4981a0,null));};exports[_0xfea5('0xbd')]=function(_0x2c31c1,_0x259ffb,_0x13592d){var _0x25a033={'raw':![],'where':{}};var _0x166d54={};var _0x234174={'count':0x0,'rows':[]};return db[_0xfea5('0x4f')][_0xfea5('0x6d')]({'where':{'id':_0x2c31c1[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x259ffb,null))[_0xfea5('0x1e')](function(_0x22fff1){if(_0x22fff1){_0x166d54['model']=_[_0xfea5('0x41')](db[_0xfea5('0xa0')]['rawAttributes']);_0x166d54['query']=_['keys'](_0x2c31c1[_0xfea5('0x40')]);_0x166d54[_0xfea5('0x42')]=_[_0xfea5('0x43')](_0x166d54[_0xfea5('0x3f')],_0x166d54[_0xfea5('0x40')]);_0x25a033['attributes']=_[_0xfea5('0x43')](_0x166d54['model'],qs['fields'](_0x2c31c1['query'][_0xfea5('0x45')]));_0x25a033[_0xfea5('0x44')]=_0x25a033[_0xfea5('0x44')][_0xfea5('0x46')]?_0x25a033[_0xfea5('0x44')]:_0x166d54[_0xfea5('0x3f')];if(!_0x2c31c1[_0xfea5('0x40')]['hasOwnProperty'](_0xfea5('0x66'))){_0x25a033[_0xfea5('0x2c')]=qs['limit'](_0x2c31c1['query'][_0xfea5('0x2c')]);_0x25a033['offset']=qs[_0xfea5('0x2a')](_0x2c31c1[_0xfea5('0x40')]['offset']);}_0x25a033['order']=qs[_0xfea5('0x49')](_0x2c31c1[_0xfea5('0x40')][_0xfea5('0x49')]);_0x25a033[_0xfea5('0x4c')]=qs[_0xfea5('0x42')](_[_0xfea5('0x4a')](_0x2c31c1[_0xfea5('0x40')],_0x166d54[_0xfea5('0x42')]));_0x25a033[_0xfea5('0x4c')][_0xfea5('0x63')]=_0x22fff1['id'];if(_0x2c31c1[_0xfea5('0x40')][_0xfea5('0x4b')]){_0x25a033['where']=_[_0xfea5('0x4d')](_0x25a033[_0xfea5('0x4c')],{'$or':_[_0xfea5('0x3a')](_0x25a033[_0xfea5('0x44')],function(_0x39dbf1){var _0x4b3c54={};_0x4b3c54[_0x39dbf1]={'$like':'%'+_0x2c31c1[_0xfea5('0x40')]['filter']+'%'};return _0x4b3c54;})});}_0x25a033=_['merge']({},_0x25a033,_0x2c31c1[_0xfea5('0x4e')]);return db['SmsInteraction'][_0xfea5('0x2d')]({'where':_0x25a033[_0xfea5('0x4c')]})[_0xfea5('0x1e')](function(_0x50ba11){_0x234174['count']=_0x50ba11;if(_0x2c31c1[_0xfea5('0x40')][_0xfea5('0x55')]){_0x25a033[_0xfea5('0x67')]=[{'model':db[_0xfea5('0x9b')],'as':_0xfea5('0xbe'),'required':![]},{'model':db[_0xfea5('0xbf')],'as':_0xfea5('0xc0'),'attributes':['name',_0xfea5('0xc1'),'internal'],'required':![]},{'model':db[_0xfea5('0xc2')],'as':_0xfea5('0xc3'),'attributes':['id','name',_0xfea5('0xc4')],'where':_0x2c31c1[_0xfea5('0x40')][_0xfea5('0xc5')]?{'id':_0x2c31c1[_0xfea5('0x40')][_0xfea5('0xc5')]}:undefined,'required':_0x2c31c1[_0xfea5('0x40')][_0xfea5('0xc5')]?!![]:![]}];}return db[_0xfea5('0xa0')]['findAll'](_0x25a033);})[_0xfea5('0x1e')](function(_0x4cb162){_0x234174['rows']=_0x4cb162;return _0x234174;});}})[_0xfea5('0x1e')](respondWithFilteredResult(_0x259ffb,_0x25a033))[_0xfea5('0x52')](handleError(_0x259ffb,null));};exports[_0xfea5('0xb4')]=function(_0x589a2d,_0x2b0c28,_0x201519){var _0x17d494,_0x51194b,_0x2502bd;if(_[_0xfea5('0x96')](_0x589a2d[_0xfea5('0x57')][_0xfea5('0x57')])||_0x589a2d[_0xfea5('0x57')][_0xfea5('0x57')]===''){throw new db[(_0xfea5('0x76'))]['ValidationError'](_0xfea5('0xc6'));}if(_[_0xfea5('0x96')](_0x589a2d['body']['to'])){throw new db['Sequelize'][(_0xfea5('0x77'))](_0xfea5('0xc7'));}_0x17d494=_0x589a2d[_0xfea5('0x57')]['to'];return db['SmsAccount']['find']({'where':{'id':_0x589a2d[_0xfea5('0x60')]['id']},'include':[{'model':db['CmList'],'as':_0xfea5('0xc8'),'include':[{'model':db[_0xfea5('0x9b')],'as':'Contacts','where':{'mobile':_0x17d494},'limit':0x1,'order':[['updatedAt',_0xfea5('0x9d')]]}]}]})['then'](handleEntityNotFound(_0x2b0c28,null))[_0xfea5('0x1e')](function(_0x1f68ce){if(_0x1f68ce&&_0x1f68ce[_0xfea5('0xc8')]){_0x51194b=_0x1f68ce[_0xfea5('0x34')]({'plain':!![]});if(_0x51194b[_0xfea5('0xc8')]&&_0x51194b[_0xfea5('0xc8')][_0xfea5('0x9c')]['length']){return _0x51194b[_0xfea5('0xc8')]['Contacts'][0x0];}return db[_0xfea5('0x9b')][_0xfea5('0x56')](_[_0xfea5('0x17')](_0x589a2d[_0xfea5('0x57')],{'firstName':_0x17d494,'mobile':_0x17d494,'phone':_0x17d494,'ListId':_0x51194b[_0xfea5('0x7c')]}));}})[_0xfea5('0x1e')](handleEntityNotFound(_0x2b0c28,null))[_0xfea5('0x1e')](function(_0x1adaeb){if(_0x1adaeb){_0x2502bd=_0x1adaeb;return db[_0xfea5('0xa0')][_0xfea5('0x5f')]({'where':{'ContactId':_0x2502bd['id'],'closed':![],'SmsAccountId':_0x51194b['id']}})['then'](function(_0x464a70){if(_0x464a70){return[_0x464a70,![]];}return db[_0xfea5('0xa0')][_0xfea5('0x56')]({'UserId':_0x589a2d[_0xfea5('0x58')]['id'],'ContactId':_0x2502bd['id'],'SmsAccountId':_0x51194b['id'],'phone':_0x17d494,'firstMsgDirection':'out','Messages':[_[_0xfea5('0x4d')](_0x589a2d[_0xfea5('0x57')],{'read':![],'body':_0x589a2d[_0xfea5('0x57')][_0xfea5('0x57')],'phone':_0x17d494,'SmsAccountId':_0x51194b['id'],'UserId':_0x589a2d[_0xfea5('0x58')]['id'],'ContactId':_0x2502bd['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xfea5('0xc9')}]})[_0xfea5('0x1e')](function(_0x131e31){return[_0x131e31,!![]];});});}})[_0xfea5('0xca')](function(_0x22613c,_0x4c6efb){if(_0x4c6efb){return _0x22613c;}return db['SmsMessage']['create'](_[_0xfea5('0x4d')](_0x589a2d[_0xfea5('0x57')],{'read':![],'body':_0x589a2d[_0xfea5('0x57')][_0xfea5('0x57')],'phone':_0x17d494,'SmsAccountId':_0x51194b['id'],'SmsInteractionId':_0x22613c['id'],'UserId':_0x589a2d[_0xfea5('0x58')]['id'],'ContactId':_0x2502bd['id']}))['then'](function(_0x1ec0b2){_0x22613c['dataValues'][_0xfea5('0xc9')]=[];_0x22613c[_0xfea5('0xcb')][_0xfea5('0xc9')]['push'](_0x1ec0b2[_0xfea5('0xcb')]);return _0x22613c;});})[_0xfea5('0x1e')](respondWithResult(_0x2b0c28,null))[_0xfea5('0x52')](handleError(_0x2b0c28,null));};exports[_0xfea5('0x28')]=function(_0x1bfe9d,_0x5e5e4c,_0x833db5){if(_0x1bfe9d['body']['id']){delete _0x1bfe9d[_0xfea5('0x57')]['id'];}var _0x40637f,_0x529ab1,_0x4cafc1;return db[_0xfea5('0x4f')][_0xfea5('0x5f')]({'where':{'id':_0x1bfe9d[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x5e5e4c,null))[_0xfea5('0x1e')](function(_0x4bf91a){if(_0x4bf91a){_0x4cafc1=_0x4bf91a;logger['debug'](_0xfea5('0x21'),_0xfea5('0x28'),_0xfea5('0xcc'),_0x4bf91a[_0xfea5('0x3d')],util[_0xfea5('0xcd')](_0x1bfe9d[_0xfea5('0x57')],{'showHidden':![],'depth':null}));switch(_0x4bf91a[_0xfea5('0x3d')]){case _0xfea5('0x83'):if(_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0xce')]&&_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0x28')]){_0x529ab1=_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0x28')];return db[_0xfea5('0xcf')][_0xfea5('0x5f')]({'where':{'messageId':_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0xce')]}});}break;case _0xfea5('0x87'):if(_0x1bfe9d['body']['requestid']&&_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0xd0')]){_0x529ab1=_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0xd0')];return db['SmsMessage'][_0xfea5('0x5f')]({'where':{'messageId':_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0xd1')]}});}break;case'clicksend':if(_0x1bfe9d['body']['message_id']&&_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0xd2')]){_0x529ab1=_0x1bfe9d['body'][_0xfea5('0xd2')];return db[_0xfea5('0xcf')][_0xfea5('0x5f')]({'where':{'messageId':_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0x89')]}});}break;case _0xfea5('0x8d'):var _0x2babfd=_0x1bfe9d[_0xfea5('0x57')]['results'][0x0];if(_0x2babfd[_0xfea5('0x81')]&&_0x2babfd[_0xfea5('0x28')]['groupName']===_0xfea5('0xd3')){_0x529ab1=_0x2babfd['status'][_0xfea5('0xd4')];return db['SmsMessage']['find']({'where':{'messageId':_0x2babfd[_0xfea5('0x81')]}});}break;case _0xfea5('0xd5'):if(_0x1bfe9d['body'][_0xfea5('0x81')]&&_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0x28')]){_0x529ab1=_0x1bfe9d['body'][_0xfea5('0x28')];return db[_0xfea5('0xcf')][_0xfea5('0x5f')]({'where':{'messageId':_0x1bfe9d['body'][_0xfea5('0x81')]}});}break;case'bandwidth':if(_0x1bfe9d[_0xfea5('0x57')][0x0][_0xfea5('0x23')]['id']){_0x529ab1=_0x1bfe9d[_0xfea5('0x57')][0x0]['type'];return db[_0xfea5('0xcf')][_0xfea5('0x5f')]({'where':{'messageId':_0x1bfe9d[_0xfea5('0x57')][0x0][_0xfea5('0x23')]['id']}});}break;case _0xfea5('0x94'):if(_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0xd6')]&&_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0x28')]){_0x529ab1=_0x1bfe9d[_0xfea5('0x57')]['status'];return db[_0xfea5('0xcf')][_0xfea5('0x5f')]({'where':{'messageId':_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0xd6')]}});}break;}}})[_0xfea5('0x1e')](handleEntityNotFound(_0x5e5e4c,null))[_0xfea5('0x1e')](function(_0x19b73e){if(_0x19b73e){_0x40637f=_0x19b73e;switch(_0x4cafc1['type']){case _0xfea5('0x83'):if(_0x529ab1===_0xfea5('0xd3')){return _0x40637f['update']({'read':!![]});}else{logger[_0xfea5('0x22')](_0xfea5('0x21'),'status',_0xfea5('0x83'),util['inspect'](_0x1bfe9d[_0xfea5('0x57')],{'showHidden':![],'depth':null}));}break;case _0xfea5('0x87'):if(_0x529ab1==='1'){return _0x40637f[_0xfea5('0x32')]({'read':!![]});}else{logger[_0xfea5('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfea5('0x28'),_0xfea5('0x83'),util[_0xfea5('0xcd')](_0x1bfe9d[_0xfea5('0x57')],{'showHidden':![],'depth':null}));}break;case _0xfea5('0x88'):if(!_0x1bfe9d[_0xfea5('0x57')]['error_code']&&_0x529ab1>=0xc8&&_0x529ab1<=0xce){return _0x40637f[_0xfea5('0x32')]({'read':!![]});}else{logger[_0xfea5('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xfea5('0x88'),util[_0xfea5('0xcd')](_0x1bfe9d['body'],{'showHidden':![],'depth':null}));}break;case _0xfea5('0x8d'):var _0x210065=_0x1bfe9d[_0xfea5('0x57')][_0xfea5('0x8e')][0x0];if(_0x210065[_0xfea5('0x28')][_0xfea5('0xd4')]==='DELIVERED'){return _0x40637f[_0xfea5('0x32')]({'read':!![]});}else{logger[_0xfea5('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfea5('0x28'),_0xfea5('0x8d'),util['inspect'](_0x1bfe9d[_0xfea5('0x57')],{'showHidden':![],'depth':null}));}break;case _0xfea5('0xd5'):if(_0x529ab1==_0xfea5('0xd7')||_0x529ab1=='RECEIVED_BY_RECIPIENT'){return _0x40637f[_0xfea5('0x32')]({'read':!![]});}else{logger[_0xfea5('0x22')](_0xfea5('0x21'),_0xfea5('0x28'),_0xfea5('0xd5'),util['inspect'](_0x1bfe9d[_0xfea5('0x57')],{'showHidden':![],'depth':null}));}break;case _0xfea5('0x93'):if(_0x529ab1==_0xfea5('0xd8')){return _0x40637f[_0xfea5('0x32')]({'read':!![]});}else{logger[_0xfea5('0x22')](_0xfea5('0x21'),_0xfea5('0x28'),_0xfea5('0x93'),util[_0xfea5('0xcd')](_0x1bfe9d[_0xfea5('0x57')],{'showHidden':![],'depth':null}));}break;case _0xfea5('0x94'):if(_0x529ab1===_0xfea5('0xd9')||_0x529ab1==='ACCEPTD'){return _0x40637f[_0xfea5('0x32')]({'read':!![]});}else{logger['error'](_0xfea5('0x21'),_0xfea5('0x28'),_0xfea5('0x94'),util[_0xfea5('0xcd')](_0x1bfe9d[_0xfea5('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x40637f;}})['then'](respondWithResult(_0x5e5e4c,null))[_0xfea5('0x52')](handleError(_0x5e5e4c,null));};exports[_0xfea5('0xda')]=function(_0x38f96d,_0x33ed19,_0x97a26f){var _0x223be8,_0x571d04,_0x17d67c;return db[_0xfea5('0x4f')]['find']({'where':{'id':_0x38f96d[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x33ed19,null))[_0xfea5('0x1e')](function(_0x16abc2){if(_0x16abc2){_0x17d67c=_0x16abc2;logger[_0xfea5('0x20')](_0xfea5('0x21'),_0xfea5('0x28'),_0xfea5('0xcc'),_0x16abc2[_0xfea5('0x3d')],util[_0xfea5('0xcd')](_0x38f96d[_0xfea5('0x40')],{'showHidden':![],'depth':null}));switch(_0x16abc2[_0xfea5('0x3d')]){case _0xfea5('0xdb'):if(_0x38f96d['query'][_0xfea5('0xdc')]&&_0x38f96d[_0xfea5('0x40')][_0xfea5('0xdd')]){_0x571d04=_0x38f96d[_0xfea5('0x40')][_0xfea5('0xdd')];return db[_0xfea5('0xcf')]['find']({'where':{'messageId':_0x38f96d[_0xfea5('0x40')]['message-id']}});}break;}}})[_0xfea5('0x1e')](handleEntityNotFound(_0x33ed19,null))[_0xfea5('0x1e')](function(_0x35c026){if(_0x35c026){_0x223be8=_0x35c026;switch(_0x17d67c[_0xfea5('0x3d')]){case _0xfea5('0xdb'):if(_0x571d04==='2'||_0x571d04==='6'){return _0x223be8[_0xfea5('0x32')]({'read':!![]});}else{logger['error'](_0xfea5('0x21'),_0xfea5('0x28'),_0xfea5('0xdb'),util[_0xfea5('0xcd')](_0x38f96d[_0xfea5('0x40')],{'showHidden':![],'depth':null}));};break;}return _0x223be8;}})[_0xfea5('0x1e')](respondWithResult(_0x33ed19,null))[_0xfea5('0x52')](handleError(_0x33ed19,null));};exports['addAgents']=function(_0x124d82,_0x4b023f,_0x12e279){return db[_0xfea5('0x4f')][_0xfea5('0x5f')]({'where':{'id':_0x124d82[_0xfea5('0x60')]['id']}})['then'](handleEntityNotFound(_0x4b023f,null))['then'](function(_0x1d9d3f){if(_0x1d9d3f){return _0x1d9d3f['addAgents'](_0x124d82['body']['ids'],_[_0xfea5('0xde')](_0x124d82[_0xfea5('0x57')],[_0xfea5('0x69'),'id'])||{})[_0xfea5('0xca')](function(_0x4bc52b){for(var _0x43194a=0x0;_0x43194a<_0x124d82[_0xfea5('0x57')]['ids'][_0xfea5('0x46')];_0x43194a+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x124d82[_0xfea5('0x57')]['ids'][_0x43194a]),'SmsAccountId':Number(_0x124d82[_0xfea5('0x60')]['id'])});}return _0x4bc52b;});}})[_0xfea5('0x1e')](respondWithResult(_0x4b023f,null))['catch'](handleError(_0x4b023f,null));};exports['removeAgents']=function(_0x1225eb,_0x477b56,_0x24966c){return db[_0xfea5('0x4f')][_0xfea5('0x5f')]({'where':{'id':_0x1225eb[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x477b56,null))['then'](function(_0x2fd0a6){if(_0x2fd0a6){return _0x2fd0a6[_0xfea5('0xdf')](_0x1225eb[_0xfea5('0x40')][_0xfea5('0x69')])[_0xfea5('0x1e')](function(){if(_['isArray'](_0x1225eb[_0xfea5('0x40')][_0xfea5('0x69')])){for(var _0x19ae23=0x0;_0x19ae23<_0x1225eb[_0xfea5('0x40')]['ids']['length'];_0x19ae23+=0x1){socket[_0xfea5('0xe0')]('userSmsAccount:remove',{'UserId':Number(_0x1225eb[_0xfea5('0x40')][_0xfea5('0x69')][_0x19ae23]),'SmsAccountId':Number(_0x1225eb[_0xfea5('0x60')]['id'])});}}else{socket['emit'](_0xfea5('0xe1'),{'UserId':Number(_0x1225eb[_0xfea5('0x40')][_0xfea5('0x69')]),'SmsAccountId':Number(_0x1225eb[_0xfea5('0x60')]['id'])});}});}})[_0xfea5('0x1e')](respondWithStatusCode(_0x477b56,null))['catch'](handleError(_0x477b56,null));};exports[_0xfea5('0xe2')]=function(_0x960053,_0x2b7183,_0xdf53dd){var _0x53021a={};var _0x417236={};var _0x2782cb;var _0x2e7cc2;return db[_0xfea5('0x4f')][_0xfea5('0x6d')]({'where':{'id':_0x960053[_0xfea5('0x60')]['id']}})[_0xfea5('0x1e')](handleEntityNotFound(_0x2b7183,null))[_0xfea5('0x1e')](function(_0xe8ded1){if(_0xe8ded1){_0x2782cb=_0xe8ded1;_0x417236['model']=_[_0xfea5('0x41')](db[_0xfea5('0xbf')][_0xfea5('0x3b')]);_0x417236[_0xfea5('0x40')]=_[_0xfea5('0x41')](_0x960053[_0xfea5('0x40')]);_0x417236['filters']=_[_0xfea5('0x43')](_0x417236[_0xfea5('0x3f')],_0x417236[_0xfea5('0x40')]);_0x53021a['attributes']=_[_0xfea5('0x43')](_0x417236[_0xfea5('0x3f')],qs[_0xfea5('0x45')](_0x960053[_0xfea5('0x40')][_0xfea5('0x45')]));_0x53021a[_0xfea5('0x44')]=_0x53021a[_0xfea5('0x44')]['length']?_0x53021a[_0xfea5('0x44')]:_0x417236[_0xfea5('0x3f')];_0x53021a[_0xfea5('0x48')]=qs[_0xfea5('0x49')](_0x960053[_0xfea5('0x40')][_0xfea5('0x49')]);_0x53021a[_0xfea5('0x4c')]=qs[_0xfea5('0x42')](_[_0xfea5('0x4a')](_0x960053[_0xfea5('0x40')],_0x417236[_0xfea5('0x42')]));if(_0x960053[_0xfea5('0x40')][_0xfea5('0x4b')]){_0x53021a[_0xfea5('0x4c')]=_[_0xfea5('0x4d')](_0x53021a[_0xfea5('0x4c')],{'$or':_[_0xfea5('0x3a')](_0x53021a[_0xfea5('0x44')],function(_0x261dfe){var _0x157f59={};_0x157f59[_0x261dfe]={'$like':'%'+_0x960053[_0xfea5('0x40')][_0xfea5('0x4b')]+'%'};return _0x157f59;})});}_0x53021a=_['merge']({},_0x53021a,_0x960053['options']);return _0x2782cb['getAgents'](_0x53021a);}})['then'](function(_0x23440b){if(_0x23440b){_0x2e7cc2=_0x23440b['length'];if(!_0x960053[_0xfea5('0x40')]['hasOwnProperty'](_0xfea5('0x66'))){_0x53021a[_0xfea5('0x2c')]=qs['limit'](_0x960053[_0xfea5('0x40')][_0xfea5('0x2c')]);_0x53021a['offset']=qs[_0xfea5('0x2a')](_0x960053['query'][_0xfea5('0x2a')]);}return _0x2782cb[_0xfea5('0xe2')](_0x53021a);}})[_0xfea5('0x1e')](function(_0x437908){if(_0x437908){return _0x437908?{'count':_0x2e7cc2,'rows':_0x437908}:null;}})['then'](respondWithResult(_0x2b7183,null))[_0xfea5('0x52')](handleError(_0x2b7183,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index b7c5b5e..7539b6b 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 _0x2c12=['emit','hasOwnProperty','hook','exports','../../mysqldb','SmsAccount','setMaxListeners','update','remove'];(function(_0x5cc3df,_0x4176eb){var _0x3a76d1=function(_0x1d5a28){while(--_0x1d5a28){_0x5cc3df['push'](_0x5cc3df['shift']());}};_0x3a76d1(++_0x4176eb);}(_0x2c12,0x109));var _0x22c1=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0x2c12[_0x126fb9];return _0xc8a3b1;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x22c1('0x0'))['db'][_0x22c1('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x22c1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x22c1('0x3'),'afterDestroy':_0x22c1('0x4')};function emitEvent(_0x491c91){return function(_0xa12832,_0x509b22,_0x58ce31){SmsAccountEvents[_0x22c1('0x5')](_0x491c91+':'+_0xa12832['id'],_0xa12832);SmsAccountEvents[_0x22c1('0x5')](_0x491c91,_0xa12832);_0x58ce31(null);};}for(var e in events){if(events[_0x22c1('0x6')](e)){var event=events[e];SmsAccount[_0x22c1('0x7')](e,emitEvent(event));}}module[_0x22c1('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x2ee6=['emit','hook','exports','events','../../mysqldb','update'];(function(_0x458f6a,_0x36796f){var _0x1b9776=function(_0x1388e4){while(--_0x1388e4){_0x458f6a['push'](_0x458f6a['shift']());}};_0x1b9776(++_0x36796f);}(_0x2ee6,0xcf));var _0x62ee=function(_0x362b6d,_0x20e7e9){_0x362b6d=_0x362b6d-0x0;var _0x11f9f1=_0x2ee6[_0x362b6d];return _0x11f9f1;};'use strict';var EventEmitter=require(_0x62ee('0x0'));var SmsAccount=require(_0x62ee('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x62ee('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3a7b1c){return function(_0x3e997d,_0x5a8b1d,_0x1b3d4c){SmsAccountEvents['emit'](_0x3a7b1c+':'+_0x3e997d['id'],_0x3e997d);SmsAccountEvents[_0x62ee('0x3')](_0x3a7b1c,_0x3e997d);_0x1b3d4c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x62ee('0x4')](e,emitEvent(event));}}module[_0x62ee('0x5')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index f1b9370..ce074fd 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 _0x19d3=['sms_accounts','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount'];(function(_0x52c95d,_0x501ed3){var _0x16c324=function(_0xa576d){while(--_0xa576d){_0x52c95d['push'](_0x52c95d['shift']());}};_0x16c324(++_0x501ed3);}(_0x19d3,0xeb));var _0x319d=function(_0x3443a3,_0x36fd61){_0x3443a3=_0x3443a3-0x0;var _0x7d2f81=_0x19d3[_0x3443a3];return _0x7d2f81;};'use strict';var _=require('lodash');var util=require(_0x319d('0x0'));var logger=require(_0x319d('0x1'))(_0x319d('0x2'));var moment=require(_0x319d('0x3'));var BPromise=require(_0x319d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x319d('0x5'));var rimraf=require(_0x319d('0x6'));var config=require(_0x319d('0x7'));var attributes=require(_0x319d('0x8'));module[_0x319d('0x9')]=function(_0x337148,_0x5b0517){return _0x337148[_0x319d('0xa')](_0x319d('0xb'),attributes,{'tableName':_0x319d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x13f7=['define','util','moment','bluebird','path','rimraf','./smsAccount.attributes','exports'];(function(_0x512d22,_0x1a525c){var _0x25e881=function(_0x4e3cf8){while(--_0x4e3cf8){_0x512d22['push'](_0x512d22['shift']());}};_0x25e881(++_0x1a525c);}(_0x13f7,0x1d1));var _0x713f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x13f7[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x713f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x713f('0x1'));var BPromise=require(_0x713f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x713f('0x3'));var rimraf=require(_0x713f('0x4'));var config=require('../../config/environment');var attributes=require(_0x713f('0x5'));module[_0x713f('0x6')]=function(_0xffc953,_0x266927){return _0xffc953[_0x713f('0x7')]('SmsAccount',attributes,{'tableName':'sms_accounts','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 d90c6dd..a856cd8 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 _0xe078=['../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','SmsAccount','options','where','attributes','include','model','map','then','ShowSmsAccount','stringify','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x1b02bb,_0x3d9fde){var _0x131245=function(_0x2fd1d8){while(--_0x2fd1d8){_0x1b02bb['push'](_0x1b02bb['shift']());}};_0x131245(++_0x3d9fde);}(_0xe078,0x11b));var _0x8e07=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xe078[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x8e07('0x0'));var util=require(_0x8e07('0x1'));var moment=require(_0x8e07('0x2'));var BPromise=require(_0x8e07('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e07('0x4'))['db'];var utils=require(_0x8e07('0x5'));var logger=require(_0x8e07('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8e07('0x7'));var client=jayson['client'][_0x8e07('0x8')]({'port':0x232a});config[_0x8e07('0x9')]=_[_0x8e07('0xa')](config[_0x8e07('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8e07('0xb'))[_0x8e07('0xc')](socket);function respondWithRpcPromise(_0x44f552,_0x46215d,_0x9ecddc){return new BPromise(function(_0x78fea6,_0x3838c4){return client[_0x8e07('0xd')](_0x44f552,_0x9ecddc)['then'](function(_0x41de9d){logger[_0x8e07('0xe')](_0x8e07('0xf'),_0x46215d,_0x8e07('0x10'));logger[_0x8e07('0x11')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x46215d,'request\x20sent',JSON['stringify'](_0x41de9d));if(_0x41de9d[_0x8e07('0x12')]){if(_0x41de9d[_0x8e07('0x12')][_0x8e07('0x13')]===0x1f4){logger[_0x8e07('0x12')](_0x8e07('0xf'),_0x46215d,_0x41de9d['error'][_0x8e07('0x14')]);return _0x3838c4(_0x41de9d[_0x8e07('0x12')][_0x8e07('0x14')]);}logger[_0x8e07('0x12')](_0x8e07('0xf'),_0x46215d,_0x41de9d[_0x8e07('0x12')]['message']);return _0x78fea6(_0x41de9d['error'][_0x8e07('0x14')]);}else{logger[_0x8e07('0xe')]('SmsAccount,\x20%s,\x20%s',_0x46215d,_0x8e07('0x10'));_0x78fea6(_0x41de9d['result'][_0x8e07('0x14')]);}})[_0x8e07('0x15')](function(_0x4b7a18){logger['error'](_0x8e07('0xf'),_0x46215d,_0x4b7a18);_0x3838c4(_0x4b7a18);});});}exports['ShowSmsAccount']=function(_0x32446b){var _0x368c15=this;return new Promise(function(_0x46f352,_0x4ecfc){return db[_0x8e07('0x16')]['find']({'raw':_0x32446b[_0x8e07('0x17')]?_0x32446b['options']['raw']===undefined?!![]:![]:!![],'where':_0x32446b[_0x8e07('0x17')]?_0x32446b['options'][_0x8e07('0x18')]||null:null,'attributes':_0x32446b[_0x8e07('0x17')]?_0x32446b['options'][_0x8e07('0x19')]||null:null,'include':_0x32446b[_0x8e07('0x17')]?_0x32446b['options'][_0x8e07('0x1a')]?_['map'](_0x32446b['options']['include'],function(_0x2c1857){return{'model':db[_0x2c1857[_0x8e07('0x1b')]],'as':_0x2c1857['as'],'attributes':_0x2c1857[_0x8e07('0x19')],'include':_0x2c1857[_0x8e07('0x1a')]?_[_0x8e07('0x1c')](_0x2c1857['include'],function(_0x43d478){return{'model':db[_0x43d478[_0x8e07('0x1b')]],'as':_0x43d478['as'],'attributes':_0x43d478['attributes'],'include':_0x43d478[_0x8e07('0x1a')]?_[_0x8e07('0x1c')](_0x43d478[_0x8e07('0x1a')],function(_0x4af580){return{'model':db[_0x4af580[_0x8e07('0x1b')]],'as':_0x4af580['as'],'attributes':_0x4af580[_0x8e07('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8e07('0x1d')](function(_0x4eb040){logger[_0x8e07('0xe')](_0x8e07('0x1e'),_0x32446b);logger[_0x8e07('0x11')](_0x8e07('0x1e'),_0x32446b,JSON[_0x8e07('0x1f')](_0x4eb040));_0x46f352(_0x4eb040);})[_0x8e07('0x15')](function(_0x4317c1){logger[_0x8e07('0x12')](_0x8e07('0x1e'),_0x4317c1['message'],_0x32446b);_0x4ecfc(_0x368c15[_0x8e07('0x12')](0x1f4,_0x4317c1[_0x8e07('0x14')]));});});}; \ No newline at end of file +var _0x194f=['debug','request\x20sent','stringify','error','code','message','catch','ShowSmsAccount','SmsAccount','find','options','raw','attributes','include','map','model','then','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','redis','defaults','./smsAccount.socket','register','info','SmsAccount,\x20%s,\x20%s'];(function(_0x16b54f,_0x462d05){var _0x44062d=function(_0x58d05f){while(--_0x58d05f){_0x16b54f['push'](_0x16b54f['shift']());}};_0x44062d(++_0x462d05);}(_0x194f,0x1f1));var _0xf194=function(_0x284857,_0x236ca6){_0x284857=_0x284857-0x0;var _0x442c47=_0x194f[_0x284857];return _0x442c47;};'use strict';var _=require('lodash');var util=require(_0xf194('0x0'));var moment=require(_0xf194('0x1'));var BPromise=require('bluebird');var rs=require(_0xf194('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf194('0x3'))['db'];var utils=require(_0xf194('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf194('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf194('0x6')]['http']({'port':0x232a});config[_0xf194('0x7')]=_[_0xf194('0x8')](config[_0xf194('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf194('0x7')]));require(_0xf194('0x9'))[_0xf194('0xa')](socket);function respondWithRpcPromise(_0x385bdb,_0x5610e3,_0xfae44f){return new BPromise(function(_0x1ec902,_0x4e6fef){return client['request'](_0x385bdb,_0xfae44f)['then'](function(_0x52b875){logger[_0xf194('0xb')](_0xf194('0xc'),_0x5610e3,'request\x20sent');logger[_0xf194('0xd')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5610e3,_0xf194('0xe'),JSON[_0xf194('0xf')](_0x52b875));if(_0x52b875[_0xf194('0x10')]){if(_0x52b875[_0xf194('0x10')][_0xf194('0x11')]===0x1f4){logger[_0xf194('0x10')]('SmsAccount,\x20%s,\x20%s',_0x5610e3,_0x52b875[_0xf194('0x10')][_0xf194('0x12')]);return _0x4e6fef(_0x52b875[_0xf194('0x10')]['message']);}logger[_0xf194('0x10')](_0xf194('0xc'),_0x5610e3,_0x52b875[_0xf194('0x10')][_0xf194('0x12')]);return _0x1ec902(_0x52b875[_0xf194('0x10')][_0xf194('0x12')]);}else{logger[_0xf194('0xb')](_0xf194('0xc'),_0x5610e3,'request\x20sent');_0x1ec902(_0x52b875['result'][_0xf194('0x12')]);}})[_0xf194('0x13')](function(_0x2ab3d7){logger[_0xf194('0x10')]('SmsAccount,\x20%s,\x20%s',_0x5610e3,_0x2ab3d7);_0x4e6fef(_0x2ab3d7);});});}exports[_0xf194('0x14')]=function(_0x13fc9d){var _0x2e4f2=this;return new Promise(function(_0x5a01aa,_0x5ee153){return db[_0xf194('0x15')][_0xf194('0x16')]({'raw':_0x13fc9d[_0xf194('0x17')]?_0x13fc9d[_0xf194('0x17')][_0xf194('0x18')]===undefined?!![]:![]:!![],'where':_0x13fc9d[_0xf194('0x17')]?_0x13fc9d['options']['where']||null:null,'attributes':_0x13fc9d[_0xf194('0x17')]?_0x13fc9d[_0xf194('0x17')][_0xf194('0x19')]||null:null,'include':_0x13fc9d[_0xf194('0x17')]?_0x13fc9d['options'][_0xf194('0x1a')]?_[_0xf194('0x1b')](_0x13fc9d[_0xf194('0x17')][_0xf194('0x1a')],function(_0x1b4c1b){return{'model':db[_0x1b4c1b[_0xf194('0x1c')]],'as':_0x1b4c1b['as'],'attributes':_0x1b4c1b[_0xf194('0x19')],'include':_0x1b4c1b[_0xf194('0x1a')]?_[_0xf194('0x1b')](_0x1b4c1b['include'],function(_0x542214){return{'model':db[_0x542214['model']],'as':_0x542214['as'],'attributes':_0x542214[_0xf194('0x19')],'include':_0x542214[_0xf194('0x1a')]?_[_0xf194('0x1b')](_0x542214[_0xf194('0x1a')],function(_0x4ecc22){return{'model':db[_0x4ecc22[_0xf194('0x1c')]],'as':_0x4ecc22['as'],'attributes':_0x4ecc22['attributes']};}):[]};}):[]};}):[]:[]})[_0xf194('0x1d')](function(_0x3a5256){logger[_0xf194('0xb')]('ShowSmsAccount',_0x13fc9d);logger[_0xf194('0xd')](_0xf194('0x14'),_0x13fc9d,JSON[_0xf194('0xf')](_0x3a5256));_0x5a01aa(_0x3a5256);})[_0xf194('0x13')](function(_0x30b68a){logger[_0xf194('0x10')](_0xf194('0x14'),_0x30b68a[_0xf194('0x12')],_0x13fc9d);_0x5ee153(_0x2e4f2[_0xf194('0x10')](0x1f4,_0x30b68a['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index b6cca1d..d88cb8b 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 c999e54..f79cafb 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 _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x2170b1,_0x5c99e9){var _0x4be2c3=function(_0x790566){while(--_0x790566){_0x2170b1['push'](_0x2170b1['shift']());}};_0x4be2c3(++_0x5c99e9);}(_0x3e74,0x175));var _0x43e7=function(_0x2e2d68,_0x5f42b3){_0x2e2d68=_0x2e2d68-0x0;var _0x1e49ae=_0x3e74[_0x2e2d68];return _0x1e49ae;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4c901d,_0x3733e4){var _0x4b7ae2=function(_0x685dfb){while(--_0x685dfb){_0x4c901d['push'](_0x4c901d['shift']());}};_0x4b7ae2(++_0x3733e4);}(_0x34e8,0x12c));var _0x834e=function(_0x12cbd8,_0x4eed4f){_0x12cbd8=_0x12cbd8-0x0;var _0x5cac1c=_0x34e8[_0x12cbd8];return _0x5cac1c;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 87a0bcd..a1a25a4 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 _0xb740=['noop','STRING','*,*,*,*','sequelize','exports'];(function(_0x28d5af,_0x1af07a){var _0x10b0c0=function(_0x2ec1f6){while(--_0x2ec1f6){_0x28d5af['push'](_0x28d5af['shift']());}};_0x10b0c0(++_0x1af07a);}(_0xb740,0x18e));var _0x0b74=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb740[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0b74('0x0'));module[_0x0b74('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0b74('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0b74('0x3')],'defaultValue':_0x0b74('0x4')}}; \ No newline at end of file +var _0x10d0=['*,*,*,*','sequelize','exports','STRING','TEXT'];(function(_0x4dbe9c,_0x1625bf){var _0x59e3d4=function(_0x219020){while(--_0x219020){_0x4dbe9c['push'](_0x4dbe9c['shift']());}};_0x59e3d4(++_0x1625bf);}(_0x10d0,0x13c));var _0x010d=function(_0x3457de,_0x19ecc5){_0x3457de=_0x3457de-0x0;var _0x30278f=_0x10d0[_0x3457de];return _0x30278f;};'use strict';var Sequelize=require(_0x010d('0x0'));module[_0x010d('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x010d('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x010d('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x010d('0x2')],'defaultValue':_0x010d('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 7a04a88..f0f6e40 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 _0xdfaf=['reject','update','then','end','error','stack','send','map','SmsApplication','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','catch','params','keys','length','options','find','create','body','destroy','eml-format','zip-dir','request-promise','moment','bluebird','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x44bb52,_0x4f6973){var _0x4204f6=function(_0x4d873e){while(--_0x4d873e){_0x44bb52['push'](_0x44bb52['shift']());}};_0x4204f6(++_0x4f6973);}(_0xdfaf,0x1ca));var _0xfdfa=function(_0x4ff97f,_0x30b261){_0x4ff97f=_0x4ff97f-0x0;var _0x3d39c2=_0xdfaf[_0x4ff97f];return _0x3d39c2;};'use strict';var emlformat=require(_0xfdfa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfdfa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfdfa('0x2'));var moment=require(_0xfdfa('0x3'));var BPromise=require(_0xfdfa('0x4'));var Mustache=require('mustache');var util=require(_0xfdfa('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfdfa('0x6'));var fs=require('fs');var fs_extra=require(_0xfdfa('0x7'));var _=require(_0xfdfa('0x8'));var squel=require(_0xfdfa('0x9'));var crypto=require(_0xfdfa('0xa'));var jsforce=require(_0xfdfa('0xb'));var deskjs=require(_0xfdfa('0xc'));var toCsv=require('to-csv');var querystring=require(_0xfdfa('0xd'));var Papa=require(_0xfdfa('0xe'));var Redis=require(_0xfdfa('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfdfa('0x10'));var logger=require(_0xfdfa('0x11'))(_0xfdfa('0x12'));var utils=require(_0xfdfa('0x13'));var config=require(_0xfdfa('0x14'));var licenseUtil=require(_0xfdfa('0x15'));var db=require(_0xfdfa('0x16'))['db'];function respondWithStatusCode(_0x1150c6,_0x15c79b){_0x15c79b=_0x15c79b||0xcc;return function(_0x4f57bb){if(_0x4f57bb){return _0x1150c6[_0xfdfa('0x17')](_0x15c79b);}return _0x1150c6[_0xfdfa('0x18')](_0x15c79b)['end']();};}function respondWithResult(_0x5a370a,_0x545803){_0x545803=_0x545803||0xc8;return function(_0x4d752d){if(_0x4d752d){return _0x5a370a[_0xfdfa('0x18')](_0x545803)[_0xfdfa('0x19')](_0x4d752d);}};}function respondWithFilteredResult(_0x130d38,_0x133b82){return function(_0x16777e){if(_0x16777e){var _0x38a304=typeof _0x133b82[_0xfdfa('0x1a')]===_0xfdfa('0x1b')&&typeof _0x133b82[_0xfdfa('0x1c')]===_0xfdfa('0x1b');var _0x219e81=_0x16777e[_0xfdfa('0x1d')];var _0x7e2735=_0x38a304?0x0:_0x133b82[_0xfdfa('0x1a')];var _0x2c4dda=_0x38a304?_0x16777e[_0xfdfa('0x1d')]:_0x133b82[_0xfdfa('0x1a')]+_0x133b82['limit'];var _0x23f67c;if(_0x2c4dda>=_0x219e81){_0x2c4dda=_0x219e81;_0x23f67c=0xc8;}else{_0x23f67c=0xce;}_0x130d38['status'](_0x23f67c);return _0x130d38[_0xfdfa('0x1e')](_0xfdfa('0x1f'),_0x7e2735+'-'+_0x2c4dda+'/'+_0x219e81)[_0xfdfa('0x19')](_0x16777e);}return null;};}function patchUpdates(_0x73d812){return function(_0xca4252){try{jsonpatch['apply'](_0xca4252,_0x73d812,!![]);}catch(_0x1f4f64){return BPromise[_0xfdfa('0x20')](_0x1f4f64);}return _0xca4252['save']();};}function saveUpdates(_0x3a8d1e,_0x7a7849){return function(_0x59131d){if(_0x59131d){return _0x59131d[_0xfdfa('0x21')](_0x3a8d1e)['then'](function(_0x5b13f4){return _0x5b13f4;});}return null;};}function removeEntity(_0x35bf58,_0x17100c){return function(_0x50003d){if(_0x50003d){return _0x50003d['destroy']()[_0xfdfa('0x22')](function(){_0x35bf58[_0xfdfa('0x18')](0xcc)[_0xfdfa('0x23')]();});}};}function handleEntityNotFound(_0x17e108,_0x1bafe9){return function(_0x2dcf8a){if(!_0x2dcf8a){_0x17e108[_0xfdfa('0x17')](0x194);}return _0x2dcf8a;};}function handleError(_0x377086,_0x5c75a7){_0x5c75a7=_0x5c75a7||0x1f4;return function(_0x285488){logger[_0xfdfa('0x24')](_0x285488[_0xfdfa('0x25')]);if(_0x285488['name']){delete _0x285488['name'];}_0x377086[_0xfdfa('0x18')](_0x5c75a7)[_0xfdfa('0x26')](_0x285488);};}exports['index']=function(_0x4efb29,_0x273511){var _0x38a7bb={},_0x4149a6={},_0x25982a={'count':0x0,'rows':[]};var _0x46156a=_[_0xfdfa('0x27')](db[_0xfdfa('0x28')][_0xfdfa('0x29')],function(_0x5f2723){return{'name':_0x5f2723[_0xfdfa('0x2a')],'type':_0x5f2723[_0xfdfa('0x2b')]['key']};});_0x4149a6[_0xfdfa('0x2c')]=_[_0xfdfa('0x27')](_0x46156a,'name');_0x4149a6['query']=_['keys'](_0x4efb29[_0xfdfa('0x2d')]);_0x4149a6[_0xfdfa('0x2e')]=_[_0xfdfa('0x2f')](_0x4149a6[_0xfdfa('0x2c')],_0x4149a6[_0xfdfa('0x2d')]);_0x38a7bb[_0xfdfa('0x30')]=_[_0xfdfa('0x2f')](_0x4149a6['model'],qs['fields'](_0x4efb29[_0xfdfa('0x2d')][_0xfdfa('0x31')]));_0x38a7bb[_0xfdfa('0x30')]=_0x38a7bb[_0xfdfa('0x30')]['length']?_0x38a7bb[_0xfdfa('0x30')]:_0x4149a6[_0xfdfa('0x2c')];if(!_0x4efb29['query'][_0xfdfa('0x32')](_0xfdfa('0x33'))){_0x38a7bb[_0xfdfa('0x1c')]=qs[_0xfdfa('0x1c')](_0x4efb29[_0xfdfa('0x2d')][_0xfdfa('0x1c')]);_0x38a7bb['offset']=qs[_0xfdfa('0x1a')](_0x4efb29[_0xfdfa('0x2d')][_0xfdfa('0x1a')]);}_0x38a7bb[_0xfdfa('0x34')]=qs['sort'](_0x4efb29[_0xfdfa('0x2d')][_0xfdfa('0x35')]);_0x38a7bb[_0xfdfa('0x36')]=qs[_0xfdfa('0x2e')](_[_0xfdfa('0x37')](_0x4efb29['query'],_0x4149a6[_0xfdfa('0x2e')]),_0x46156a);if(_0x4efb29[_0xfdfa('0x2d')]['filter']){_0x38a7bb[_0xfdfa('0x36')]=_[_0xfdfa('0x38')](_0x38a7bb[_0xfdfa('0x36')],{'$or':_[_0xfdfa('0x27')](_0x46156a,function(_0x214465){if(_0x214465[_0xfdfa('0x2b')]!==_0xfdfa('0x39')){var _0x5bc7ca={};_0x5bc7ca[_0x214465['name']]={'$like':'%'+_0x4efb29[_0xfdfa('0x2d')][_0xfdfa('0x3a')]+'%'};return _0x5bc7ca;}})});}_0x38a7bb=_['merge']({},_0x38a7bb,_0x4efb29['options']);var _0x36f4f9={'where':_0x38a7bb['where']};return db[_0xfdfa('0x28')][_0xfdfa('0x1d')](_0x36f4f9)[_0xfdfa('0x22')](function(_0x5e5fd2){_0x25982a['count']=_0x5e5fd2;if(_0x4efb29[_0xfdfa('0x2d')][_0xfdfa('0x3b')]){_0x38a7bb[_0xfdfa('0x3c')]=[{'all':!![]}];}return db[_0xfdfa('0x28')]['findAll'](_0x38a7bb);})['then'](function(_0x2ebed2){_0x25982a['rows']=_0x2ebed2;return _0x25982a;})[_0xfdfa('0x22')](respondWithFilteredResult(_0x273511,_0x38a7bb))[_0xfdfa('0x3d')](handleError(_0x273511,null));};exports['show']=function(_0x370d83,_0x546035){var _0x326f8d={'raw':!![],'where':{'id':_0x370d83[_0xfdfa('0x3e')]['id']}},_0x2f9234={};_0x2f9234[_0xfdfa('0x2c')]=_[_0xfdfa('0x3f')](db['SmsApplication']['rawAttributes']);_0x2f9234[_0xfdfa('0x2d')]=_[_0xfdfa('0x3f')](_0x370d83['query']);_0x2f9234[_0xfdfa('0x2e')]=_['intersection'](_0x2f9234[_0xfdfa('0x2c')],_0x2f9234[_0xfdfa('0x2d')]);_0x326f8d[_0xfdfa('0x30')]=_[_0xfdfa('0x2f')](_0x2f9234[_0xfdfa('0x2c')],qs[_0xfdfa('0x31')](_0x370d83[_0xfdfa('0x2d')]['fields']));_0x326f8d[_0xfdfa('0x30')]=_0x326f8d[_0xfdfa('0x30')][_0xfdfa('0x40')]?_0x326f8d[_0xfdfa('0x30')]:_0x2f9234[_0xfdfa('0x2c')];if(_0x370d83[_0xfdfa('0x2d')]['includeAll']){_0x326f8d[_0xfdfa('0x3c')]=[{'all':!![]}];}_0x326f8d=_[_0xfdfa('0x38')]({},_0x326f8d,_0x370d83[_0xfdfa('0x41')]);return db[_0xfdfa('0x28')][_0xfdfa('0x42')](_0x326f8d)[_0xfdfa('0x22')](handleEntityNotFound(_0x546035,null))[_0xfdfa('0x22')](respondWithResult(_0x546035,null))[_0xfdfa('0x3d')](handleError(_0x546035,null));};exports[_0xfdfa('0x43')]=function(_0x5db4d4,_0x5445ec){return db['SmsApplication']['create'](_0x5db4d4[_0xfdfa('0x44')],{})[_0xfdfa('0x22')](respondWithResult(_0x5445ec,0xc9))[_0xfdfa('0x3d')](handleError(_0x5445ec,null));};exports[_0xfdfa('0x21')]=function(_0xfcfdb8,_0x3969e2){if(_0xfcfdb8[_0xfdfa('0x44')]['id']){delete _0xfcfdb8[_0xfdfa('0x44')]['id'];}return db[_0xfdfa('0x28')][_0xfdfa('0x42')]({'where':{'id':_0xfcfdb8[_0xfdfa('0x3e')]['id']}})[_0xfdfa('0x22')](handleEntityNotFound(_0x3969e2,null))[_0xfdfa('0x22')](saveUpdates(_0xfcfdb8['body'],null))['then'](respondWithResult(_0x3969e2,null))[_0xfdfa('0x3d')](handleError(_0x3969e2,null));};exports[_0xfdfa('0x45')]=function(_0x28371b,_0x49b856){return db[_0xfdfa('0x28')][_0xfdfa('0x42')]({'where':{'id':_0x28371b[_0xfdfa('0x3e')]['id']}})['then'](handleEntityNotFound(_0x49b856,null))['then'](removeEntity(_0x49b856,null))[_0xfdfa('0x3d')](handleError(_0x49b856,null));}; \ No newline at end of file +var _0xfdc7=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','SmsApplication','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','rawAttributes','length','create','body','update','find','params','rimraf','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x200a7d,_0x431067){var _0x2227b2=function(_0x444eb7){while(--_0x444eb7){_0x200a7d['push'](_0x200a7d['shift']());}};_0x2227b2(++_0x431067);}(_0xfdc7,0x196));var _0x7fdc=function(_0x51af96,_0x42104c){_0x51af96=_0x51af96-0x0;var _0x2bb16b=_0xfdc7[_0x51af96];return _0x2bb16b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7fdc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7fdc('0x1'));var rp=require('request-promise');var moment=require(_0x7fdc('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7fdc('0x3'));var util=require(_0x7fdc('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x7fdc('0x5'));var ejs=require(_0x7fdc('0x6'));var fs=require('fs');var fs_extra=require(_0x7fdc('0x7'));var _=require(_0x7fdc('0x8'));var squel=require(_0x7fdc('0x9'));var crypto=require('crypto');var jsforce=require(_0x7fdc('0xa'));var deskjs=require(_0x7fdc('0xb'));var toCsv=require(_0x7fdc('0x5'));var querystring=require(_0x7fdc('0xc'));var Papa=require(_0x7fdc('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7fdc('0xe'));var as=require(_0x7fdc('0xf'));var hardwareService=require(_0x7fdc('0x10'));var logger=require('../../config/logger')(_0x7fdc('0x11'));var utils=require(_0x7fdc('0x12'));var config=require(_0x7fdc('0x13'));var licenseUtil=require(_0x7fdc('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55bf06,_0x139478){_0x139478=_0x139478||0xcc;return function(_0x3933ab){if(_0x3933ab){return _0x55bf06[_0x7fdc('0x15')](_0x139478);}return _0x55bf06['status'](_0x139478)['end']();};}function respondWithResult(_0x572072,_0x7cea19){_0x7cea19=_0x7cea19||0xc8;return function(_0x19bf07){if(_0x19bf07){return _0x572072[_0x7fdc('0x16')](_0x7cea19)[_0x7fdc('0x17')](_0x19bf07);}};}function respondWithFilteredResult(_0x38829d,_0x3d7551){return function(_0x4ae97b){if(_0x4ae97b){var _0x563858=typeof _0x3d7551[_0x7fdc('0x18')]===_0x7fdc('0x19')&&typeof _0x3d7551[_0x7fdc('0x1a')]===_0x7fdc('0x19');var _0x584e87=_0x4ae97b[_0x7fdc('0x1b')];var _0x5e13e8=_0x563858?0x0:_0x3d7551['offset'];var _0x4fb115=_0x563858?_0x4ae97b[_0x7fdc('0x1b')]:_0x3d7551[_0x7fdc('0x18')]+_0x3d7551[_0x7fdc('0x1a')];var _0x4daceb;if(_0x4fb115>=_0x584e87){_0x4fb115=_0x584e87;_0x4daceb=0xc8;}else{_0x4daceb=0xce;}_0x38829d['status'](_0x4daceb);return _0x38829d['set']('Content-Range',_0x5e13e8+'-'+_0x4fb115+'/'+_0x584e87)[_0x7fdc('0x17')](_0x4ae97b);}return null;};}function patchUpdates(_0x345236){return function(_0x115088){try{jsonpatch[_0x7fdc('0x1c')](_0x115088,_0x345236,!![]);}catch(_0x4eec07){return BPromise[_0x7fdc('0x1d')](_0x4eec07);}return _0x115088[_0x7fdc('0x1e')]();};}function saveUpdates(_0x489d31,_0x488b98){return function(_0x584025){if(_0x584025){return _0x584025['update'](_0x489d31)[_0x7fdc('0x1f')](function(_0x895822){return _0x895822;});}return null;};}function removeEntity(_0x510b46,_0x868ca1){return function(_0x19d935){if(_0x19d935){return _0x19d935[_0x7fdc('0x20')]()[_0x7fdc('0x1f')](function(){_0x510b46[_0x7fdc('0x16')](0xcc)[_0x7fdc('0x21')]();});}};}function handleEntityNotFound(_0x19a688,_0x739496){return function(_0x563070){if(!_0x563070){_0x19a688[_0x7fdc('0x15')](0x194);}return _0x563070;};}function handleError(_0x4699b1,_0xe544cf){_0xe544cf=_0xe544cf||0x1f4;return function(_0x3fa469){logger[_0x7fdc('0x22')](_0x3fa469[_0x7fdc('0x23')]);if(_0x3fa469[_0x7fdc('0x24')]){delete _0x3fa469[_0x7fdc('0x24')];}_0x4699b1['status'](_0xe544cf)[_0x7fdc('0x25')](_0x3fa469);};}exports[_0x7fdc('0x26')]=function(_0xe6e832,_0x37d042){var _0x2e382d={},_0x39e7ed={},_0x1d12f9={'count':0x0,'rows':[]};var _0x52a581=_[_0x7fdc('0x27')](db[_0x7fdc('0x28')]['rawAttributes'],function(_0x347f5e){return{'name':_0x347f5e['fieldName'],'type':_0x347f5e[_0x7fdc('0x29')][_0x7fdc('0x2a')]};});_0x39e7ed[_0x7fdc('0x2b')]=_['map'](_0x52a581,_0x7fdc('0x24'));_0x39e7ed[_0x7fdc('0x2c')]=_[_0x7fdc('0x2d')](_0xe6e832[_0x7fdc('0x2c')]);_0x39e7ed[_0x7fdc('0x2e')]=_['intersection'](_0x39e7ed[_0x7fdc('0x2b')],_0x39e7ed[_0x7fdc('0x2c')]);_0x2e382d[_0x7fdc('0x2f')]=_[_0x7fdc('0x30')](_0x39e7ed[_0x7fdc('0x2b')],qs[_0x7fdc('0x31')](_0xe6e832[_0x7fdc('0x2c')]['fields']));_0x2e382d[_0x7fdc('0x2f')]=_0x2e382d[_0x7fdc('0x2f')]['length']?_0x2e382d[_0x7fdc('0x2f')]:_0x39e7ed[_0x7fdc('0x2b')];if(!_0xe6e832[_0x7fdc('0x2c')]['hasOwnProperty'](_0x7fdc('0x32'))){_0x2e382d[_0x7fdc('0x1a')]=qs['limit'](_0xe6e832[_0x7fdc('0x2c')][_0x7fdc('0x1a')]);_0x2e382d['offset']=qs['offset'](_0xe6e832[_0x7fdc('0x2c')][_0x7fdc('0x18')]);}_0x2e382d[_0x7fdc('0x33')]=qs[_0x7fdc('0x34')](_0xe6e832['query'][_0x7fdc('0x34')]);_0x2e382d[_0x7fdc('0x35')]=qs['filters'](_[_0x7fdc('0x36')](_0xe6e832['query'],_0x39e7ed[_0x7fdc('0x2e')]),_0x52a581);if(_0xe6e832['query'][_0x7fdc('0x37')]){_0x2e382d[_0x7fdc('0x35')]=_[_0x7fdc('0x38')](_0x2e382d['where'],{'$or':_[_0x7fdc('0x27')](_0x52a581,function(_0x41a3b3){if(_0x41a3b3[_0x7fdc('0x29')]!==_0x7fdc('0x39')){var _0x345263={};_0x345263[_0x41a3b3[_0x7fdc('0x24')]]={'$like':'%'+_0xe6e832['query'][_0x7fdc('0x37')]+'%'};return _0x345263;}})});}_0x2e382d=_['merge']({},_0x2e382d,_0xe6e832[_0x7fdc('0x3a')]);var _0x574df4={'where':_0x2e382d['where']};return db['SmsApplication'][_0x7fdc('0x1b')](_0x574df4)[_0x7fdc('0x1f')](function(_0x482699){_0x1d12f9[_0x7fdc('0x1b')]=_0x482699;if(_0xe6e832[_0x7fdc('0x2c')][_0x7fdc('0x3b')]){_0x2e382d[_0x7fdc('0x3c')]=[{'all':!![]}];}return db[_0x7fdc('0x28')]['findAll'](_0x2e382d);})[_0x7fdc('0x1f')](function(_0x5cbdd4){_0x1d12f9[_0x7fdc('0x3d')]=_0x5cbdd4;return _0x1d12f9;})['then'](respondWithFilteredResult(_0x37d042,_0x2e382d))[_0x7fdc('0x3e')](handleError(_0x37d042,null));};exports['show']=function(_0x4224df,_0x3c7c0b){var _0x2e7d21={'raw':!![],'where':{'id':_0x4224df['params']['id']}},_0x70917c={};_0x70917c['model']=_[_0x7fdc('0x2d')](db['SmsApplication'][_0x7fdc('0x3f')]);_0x70917c[_0x7fdc('0x2c')]=_[_0x7fdc('0x2d')](_0x4224df[_0x7fdc('0x2c')]);_0x70917c['filters']=_['intersection'](_0x70917c['model'],_0x70917c[_0x7fdc('0x2c')]);_0x2e7d21[_0x7fdc('0x2f')]=_['intersection'](_0x70917c['model'],qs['fields'](_0x4224df[_0x7fdc('0x2c')]['fields']));_0x2e7d21[_0x7fdc('0x2f')]=_0x2e7d21[_0x7fdc('0x2f')][_0x7fdc('0x40')]?_0x2e7d21[_0x7fdc('0x2f')]:_0x70917c[_0x7fdc('0x2b')];if(_0x4224df[_0x7fdc('0x2c')][_0x7fdc('0x3b')]){_0x2e7d21[_0x7fdc('0x3c')]=[{'all':!![]}];}_0x2e7d21=_[_0x7fdc('0x38')]({},_0x2e7d21,_0x4224df[_0x7fdc('0x3a')]);return db[_0x7fdc('0x28')]['find'](_0x2e7d21)[_0x7fdc('0x1f')](handleEntityNotFound(_0x3c7c0b,null))[_0x7fdc('0x1f')](respondWithResult(_0x3c7c0b,null))[_0x7fdc('0x3e')](handleError(_0x3c7c0b,null));};exports[_0x7fdc('0x41')]=function(_0x3ba7eb,_0x1632aa){return db[_0x7fdc('0x28')]['create'](_0x3ba7eb[_0x7fdc('0x42')],{})[_0x7fdc('0x1f')](respondWithResult(_0x1632aa,0xc9))[_0x7fdc('0x3e')](handleError(_0x1632aa,null));};exports[_0x7fdc('0x43')]=function(_0x5b0994,_0x530941){if(_0x5b0994[_0x7fdc('0x42')]['id']){delete _0x5b0994[_0x7fdc('0x42')]['id'];}return db[_0x7fdc('0x28')][_0x7fdc('0x44')]({'where':{'id':_0x5b0994[_0x7fdc('0x45')]['id']}})[_0x7fdc('0x1f')](handleEntityNotFound(_0x530941,null))['then'](saveUpdates(_0x5b0994[_0x7fdc('0x42')],null))[_0x7fdc('0x1f')](respondWithResult(_0x530941,null))['catch'](handleError(_0x530941,null));};exports[_0x7fdc('0x20')]=function(_0x316d8c,_0x455236){return db[_0x7fdc('0x28')][_0x7fdc('0x44')]({'where':{'id':_0x316d8c[_0x7fdc('0x45')]['id']}})[_0x7fdc('0x1f')](handleEntityNotFound(_0x455236,null))[_0x7fdc('0x1f')](removeEntity(_0x455236,null))[_0x7fdc('0x3e')](handleError(_0x455236,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index cf7ab9a..ff503f8 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 _0x77ce=['moment','bluebird','path','rimraf','./smsApplication.attributes','exports','define','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x77ce,0x1b8));var _0xe77c=function(_0x289572,_0x1d192a){_0x289572=_0x289572-0x0;var _0x346543=_0x77ce[_0x289572];return _0x346543;};'use strict';var _=require(_0xe77c('0x0'));var util=require(_0xe77c('0x1'));var logger=require(_0xe77c('0x2'))(_0xe77c('0x3'));var moment=require(_0xe77c('0x4'));var BPromise=require(_0xe77c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe77c('0x6'));var rimraf=require(_0xe77c('0x7'));var config=require('../../config/environment');var attributes=require(_0xe77c('0x8'));module[_0xe77c('0x9')]=function(_0x39596f,_0x25a09d){return _0x39596f[_0xe77c('0xa')]('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe77c('0xb')});}; \ No newline at end of file +var _0x8f18=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsApplication','utf8mb4'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x8f18,0x1ea));var _0x88f1=function(_0x3845bb,_0x2d432c){_0x3845bb=_0x3845bb-0x0;var _0x43d93b=_0x8f18[_0x3845bb];return _0x43d93b;};'use strict';var _=require(_0x88f1('0x0'));var util=require(_0x88f1('0x1'));var logger=require(_0x88f1('0x2'))(_0x88f1('0x3'));var moment=require(_0x88f1('0x4'));var BPromise=require(_0x88f1('0x5'));var rp=require(_0x88f1('0x6'));var fs=require('fs');var path=require(_0x88f1('0x7'));var rimraf=require(_0x88f1('0x8'));var config=require(_0x88f1('0x9'));var attributes=require('./smsApplication.attributes');module[_0x88f1('0xa')]=function(_0x55d3c6,_0x3a38ae){return _0x55d3c6[_0x88f1('0xb')](_0x88f1('0xc'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x88f1('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 6073243..7673c20 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 _0x7e22=['jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x33a4ca,_0x5644b0){var _0x2183c2=function(_0x1cb45b){while(--_0x1cb45b){_0x33a4ca['push'](_0x33a4ca['shift']());}};_0x2183c2(++_0x5644b0);}(_0x7e22,0x1d8));var _0x27e2=function(_0x30a1dc,_0x10c84c){_0x30a1dc=_0x30a1dc-0x0;var _0xd76fb=_0x7e22[_0x30a1dc];return _0xd76fb;};'use strict';var _=require(_0x27e2('0x0'));var util=require('util');var moment=require(_0x27e2('0x1'));var BPromise=require(_0x27e2('0x2'));var rs=require(_0x27e2('0x3'));var fs=require('fs');var Redis=require(_0x27e2('0x4'));var db=require(_0x27e2('0x5'))['db'];var utils=require(_0x27e2('0x6'));var logger=require('../../config/logger')(_0x27e2('0x7'));var config=require('../../config/environment');var jayson=require(_0x27e2('0x8'));var client=jayson[_0x27e2('0x9')][_0x27e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8ec259,_0x54c99e,_0x207ab6){return new BPromise(function(_0x419985,_0x44cf2e){return client[_0x27e2('0xb')](_0x8ec259,_0x207ab6)[_0x27e2('0xc')](function(_0xadcc3e){logger[_0x27e2('0xd')](_0x27e2('0xe'),_0x54c99e,'request\x20sent');logger[_0x27e2('0xf')](_0x27e2('0x10'),_0x54c99e,'request\x20sent',JSON[_0x27e2('0x11')](_0xadcc3e));if(_0xadcc3e[_0x27e2('0x12')]){if(_0xadcc3e[_0x27e2('0x12')][_0x27e2('0x13')]===0x1f4){logger['error'](_0x27e2('0xe'),_0x54c99e,_0xadcc3e['error'][_0x27e2('0x14')]);return _0x44cf2e(_0xadcc3e[_0x27e2('0x12')][_0x27e2('0x14')]);}logger[_0x27e2('0x12')](_0x27e2('0xe'),_0x54c99e,_0xadcc3e['error'][_0x27e2('0x14')]);return _0x419985(_0xadcc3e['error'][_0x27e2('0x14')]);}else{logger[_0x27e2('0xd')](_0x27e2('0xe'),_0x54c99e,_0x27e2('0x15'));_0x419985(_0xadcc3e[_0x27e2('0x16')][_0x27e2('0x14')]);}})[_0x27e2('0x17')](function(_0x18a838){logger['error']('SmsApplication,\x20%s,\x20%s',_0x54c99e,_0x18a838);_0x44cf2e(_0x18a838);});});} \ No newline at end of file +var _0x7804=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','info','SmsApplication,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch'];(function(_0x1b7915,_0x2d6a3f){var _0x480d41=function(_0xd4f568){while(--_0xd4f568){_0x1b7915['push'](_0x1b7915['shift']());}};_0x480d41(++_0x2d6a3f);}(_0x7804,0xc3));var _0x4780=function(_0x10885d,_0x5baa0a){_0x10885d=_0x10885d-0x0;var _0x99235c=_0x7804[_0x10885d];return _0x99235c;};'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});function respondWithRpcPromise(_0x36df6b,_0x9cd1a1,_0x19356d){return new BPromise(function(_0x5dbc26,_0x2ba140){return client['request'](_0x36df6b,_0x19356d)['then'](function(_0x299992){logger[_0x4780('0x8')](_0x4780('0x9'),_0x9cd1a1,_0x4780('0xa'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x9cd1a1,_0x4780('0xa'),JSON[_0x4780('0xb')](_0x299992));if(_0x299992[_0x4780('0xc')]){if(_0x299992['error']['code']===0x1f4){logger[_0x4780('0xc')](_0x4780('0x9'),_0x9cd1a1,_0x299992[_0x4780('0xc')][_0x4780('0xd')]);return _0x2ba140(_0x299992[_0x4780('0xc')]['message']);}logger['error'](_0x4780('0x9'),_0x9cd1a1,_0x299992['error'][_0x4780('0xd')]);return _0x5dbc26(_0x299992[_0x4780('0xc')][_0x4780('0xd')]);}else{logger[_0x4780('0x8')]('SmsApplication,\x20%s,\x20%s',_0x9cd1a1,_0x4780('0xa'));_0x5dbc26(_0x299992['result'][_0x4780('0xd')]);}})[_0x4780('0xe')](function(_0x522b0f){logger[_0x4780('0xc')]('SmsApplication,\x20%s,\x20%s',_0x9cd1a1,_0x522b0f);_0x2ba140(_0x522b0f);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index b6d4444..c4b99c7 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 _0x4213=['download','post','create','/:id/messages','addMessage','/:id/tags','tracked','smsinteraction:addtags','put','smsinteraction:update','update','sms','smsinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4213,0x77));var _0x3421=function(_0x445020,_0x4a5fa0){_0x445020=_0x445020-0x0;var _0x3cda0a=_0x4213[_0x445020];return _0x3cda0a;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var fs_extra=require(_0x3421('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3421('0x7'));var config=require('../../config/environment');var controller=require(_0x3421('0x8'));router[_0x3421('0x9')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0xb')]);router['get'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0xd')]);router[_0x3421('0x9')](_0x3421('0xe'),auth['isAuthenticated'](),controller[_0x3421('0xf')]);router['get']('/:id/messages',auth[_0x3421('0xa')](),controller['getMessages']);router[_0x3421('0x9')](_0x3421('0x10'),auth[_0x3421('0xa')](),controller[_0x3421('0x11')]);router[_0x3421('0x12')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0x13')]);router['post'](_0x3421('0x14'),auth[_0x3421('0xa')](),controller[_0x3421('0x15')]);router[_0x3421('0x12')](_0x3421('0x16'),auth[_0x3421('0xa')](),interaction[_0x3421('0x17')]('sms',_0x3421('0x18')),controller['addTags']);router[_0x3421('0x19')](_0x3421('0xe'),auth['isAuthenticated'](),interaction[_0x3421('0x17')]('sms',_0x3421('0x1a')),controller[_0x3421('0x1b')]);router['delete'](_0x3421('0xe'),auth[_0x3421('0xa')](),interaction[_0x3421('0x17')](_0x3421('0x1c'),_0x3421('0x1d')),controller[_0x3421('0x1e')]);router[_0x3421('0x1f')](_0x3421('0x16'),auth[_0x3421('0xa')](),controller[_0x3421('0x20')]);module[_0x3421('0x21')]=router; \ No newline at end of file +var _0x0972=['tracked','sms','addTags','put','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0x5b5a8b,_0xbc5edc){var _0x33e7ce=function(_0x2d5a87){while(--_0x2d5a87){_0x5b5a8b['push'](_0x5b5a8b['shift']());}};_0x33e7ce(++_0xbc5edc);}(_0x0972,0x64));var _0x2097=function(_0x36b6b3,_0x576d07){_0x36b6b3=_0x36b6b3-0x0;var _0x53bc89=_0x0972[_0x36b6b3];return _0x53bc89;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var fs_extra=require(_0x2097('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var controller=require(_0x2097('0x6'));router[_0x2097('0x7')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x9')]);router[_0x2097('0x7')]('/describe',auth[_0x2097('0x8')](),controller[_0x2097('0xa')]);router[_0x2097('0x7')](_0x2097('0xb'),auth[_0x2097('0x8')](),controller['show']);router[_0x2097('0x7')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0xd')]);router[_0x2097('0x7')](_0x2097('0xe'),auth[_0x2097('0x8')](),controller[_0x2097('0xf')]);router[_0x2097('0x10')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x11')]);router[_0x2097('0x10')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0x12')]);router[_0x2097('0x10')](_0x2097('0x13'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')](_0x2097('0x15'),'smsinteraction:addtags'),controller[_0x2097('0x16')]);router[_0x2097('0x17')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x2097('0x15'),'smsinteraction:update'),controller[_0x2097('0x18')]);router[_0x2097('0x19')](_0x2097('0xb'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')]('sms',_0x2097('0x1a')),controller[_0x2097('0x1b')]);router[_0x2097('0x19')](_0x2097('0x13'),auth[_0x2097('0x8')](),controller[_0x2097('0x1c')]);module[_0x2097('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index b2561bc..47ec9c7 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 _0x22ed=['exports','BOOLEAN','DATE','STRING','ENUM','sequelize','moment'];(function(_0xfec81c,_0x3f7f63){var _0x5d21f6=function(_0x2a0813){while(--_0x2a0813){_0xfec81c['push'](_0xfec81c['shift']());}};_0x5d21f6(++_0x3f7f63);}(_0x22ed,0x1a9));var _0xd22e=function(_0x1a4b49,_0x37c4f9){_0x1a4b49=_0x1a4b49-0x0;var _0x5db633=_0x22ed[_0x1a4b49];return _0x5db633;};'use strict';var Sequelize=require(_0xd22e('0x0'));var moment=require(_0xd22e('0x1'));module[_0xd22e('0x2')]={'closed':{'type':Sequelize[_0xd22e('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd22e('0x4')]},'disposition':{'type':Sequelize[_0xd22e('0x5')]},'secondDisposition':{'type':Sequelize[_0xd22e('0x5')]},'thirdDisposition':{'type':Sequelize[_0xd22e('0x5')]},'note':{'type':Sequelize[_0xd22e('0x5')]},'phone':{'type':Sequelize[_0xd22e('0x5')]},'read1stAt':{'type':Sequelize[_0xd22e('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xd22e('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd22e('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xd22e('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xd22e('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x972c=['ENUM','out','exports','BOOLEAN','STRING','DATE'];(function(_0x20cf8a,_0x44cd6b){var _0x54e165=function(_0xcce1d0){while(--_0xcce1d0){_0x20cf8a['push'](_0x20cf8a['shift']());}};_0x54e165(++_0x44cd6b);}(_0x972c,0xf2));var _0xc972=function(_0x26eab2,_0xf2f9db){_0x26eab2=_0x26eab2-0x0;var _0x5953b9=_0x972c[_0x26eab2];return _0x5953b9;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xc972('0x0')]={'closed':{'type':Sequelize[_0xc972('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xc972('0x2')]},'secondDisposition':{'type':Sequelize[_0xc972('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xc972('0x2')]},'read1stAt':{'type':Sequelize[_0xc972('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xc972('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc972('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc972('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc972('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index f10535c..49f4e4b 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 _0xd4bd=['User','fullname','CmContact','Contact','lastName','Messages','createdAt','secret','read','SmsAccount','Owner','mkdirSync','Sms','Account','N.A.','closed','format','toString','disposition','out','System','firstName','direction','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','error','name','send','index','map','SmsInteraction','fieldName','type','key','getOptions','findAll','sms','query','user','show','params','model','keys','rawAttributes','intersection','fields','attributes','includeAll','include','merge','options','find','create','catch','body','describe','addMessage','SmsMessage','ids','getMessages','findOne','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','SmsInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','push'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd4bd,0x1a3));var _0xdd4b=function(_0x32665e,_0x12740e){_0x32665e=_0x32665e-0x0;var _0x10be45=_0xd4bd[_0x32665e];return _0x10be45;};'use strict';var rimraf=require(_0xdd4b('0x0'));var zipdir=require(_0xdd4b('0x1'));var moment=require(_0xdd4b('0x2'));var BPromise=require('bluebird');var util=require(_0xdd4b('0x3'));var path=require(_0xdd4b('0x4'));var ejs=require(_0xdd4b('0x5'));var fs=require('fs');var _=require(_0xdd4b('0x6'));var Redis=require(_0xdd4b('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0xdd4b('0x8'));var pdf=require(_0xdd4b('0x9'));var logger=require(_0xdd4b('0xa'))('api');var config=require(_0xdd4b('0xb'));var db=require(_0xdd4b('0xc'))['db'];config[_0xdd4b('0xd')]=_[_0xdd4b('0xe')](config[_0xdd4b('0xd')],{'host':_0xdd4b('0xf'),'port':0x18eb});var socket=require(_0xdd4b('0x10'))(new Redis(config[_0xdd4b('0xd')]));require(_0xdd4b('0x11'))[_0xdd4b('0x12')](socket);function respondWithStatusCode(_0x2796b6,_0x3d5735){_0x3d5735=_0x3d5735||0xcc;return function(_0x1052ff){if(_0x1052ff){return _0x2796b6[_0xdd4b('0x13')](_0x3d5735);}return _0x2796b6['status'](_0x3d5735)[_0xdd4b('0x14')]();};}function respondWithResult(_0x464bb7,_0x3b518a){_0x3b518a=_0x3b518a||0xc8;return function(_0x562a98){if(_0x562a98){return _0x464bb7[_0xdd4b('0x15')](_0x3b518a)[_0xdd4b('0x16')](_0x562a98);}};}function respondWithFilteredResult(_0x137b08,_0x534f0b){return function(_0x15f5b3){if(_0x15f5b3){var _0x351374=typeof _0x534f0b[_0xdd4b('0x17')]==='undefined'&&typeof _0x534f0b[_0xdd4b('0x18')]===_0xdd4b('0x19');var _0x35625d=_0x15f5b3[_0xdd4b('0x1a')];var _0x971ce7=_0x351374?0x0:_0x534f0b['offset'];var _0x35b067=_0x351374?_0x15f5b3[_0xdd4b('0x1a')]:_0x534f0b[_0xdd4b('0x17')]+_0x534f0b[_0xdd4b('0x18')];var _0x484327;if(_0x35b067>=_0x35625d){_0x35b067=_0x35625d;_0x484327=0xc8;}else{_0x484327=0xce;}_0x137b08[_0xdd4b('0x15')](_0x484327);return _0x137b08[_0xdd4b('0x1b')](_0xdd4b('0x1c'),_0x971ce7+'-'+_0x35b067+'/'+_0x35625d)[_0xdd4b('0x16')](_0x15f5b3);}return null;};}function saveUpdates(_0xdd9229){return function(_0x3d2c91){if(_0x3d2c91){return _0x3d2c91[_0xdd4b('0x1d')](_0xdd9229)[_0xdd4b('0x1e')](function(_0x1d7045){return _0x1d7045;});}return null;};}function removeEntity(_0x2f2942){return function(_0x72aa7e){if(_0x72aa7e){return _0x72aa7e[_0xdd4b('0x1f')]()['then'](function(){_0x2f2942['status'](0xcc)[_0xdd4b('0x14')]();});}};}function handleEntityNotFound(_0x233d16){return function(_0x252b5a){if(!_0x252b5a){_0x233d16[_0xdd4b('0x13')](0x194);}return _0x252b5a;};}function handleError(_0x3ff131,_0x35f334){_0x35f334=_0x35f334||0x1f4;return function(_0x39d542){logger[_0xdd4b('0x20')](_0x39d542['stack']);if(_0x39d542[_0xdd4b('0x21')]){delete _0x39d542[_0xdd4b('0x21')];}_0x3ff131['status'](_0x35f334)[_0xdd4b('0x22')](_0x39d542);};}exports[_0xdd4b('0x23')]=function(_0x268612,_0x3b2b47){var _0x4f26ff={};var _0x23b8dd=_[_0xdd4b('0x24')](db[_0xdd4b('0x25')]['rawAttributes'],function(_0x33e631){return{'name':_0x33e631[_0xdd4b('0x26')],'type':_0x33e631[_0xdd4b('0x27')][_0xdd4b('0x28')]};});_0x4f26ff=qs[_0xdd4b('0x29')](_0x23b8dd,_0x268612);return interaction[_0xdd4b('0x2a')](_0xdd4b('0x2b'),_0x268612[_0xdd4b('0x2c')],_0x268612[_0xdd4b('0x2d')],_0x4f26ff,_0x23b8dd)[_0xdd4b('0x1e')](respondWithFilteredResult(_0x3b2b47,_0x4f26ff))['catch'](handleError(_0x3b2b47,null));};exports[_0xdd4b('0x2e')]=function(_0x4017a2,_0x41bee3){var _0x3fc4f1={'raw':![],'where':{'id':_0x4017a2[_0xdd4b('0x2f')]['id']}},_0x42f306={};_0x42f306[_0xdd4b('0x30')]=_[_0xdd4b('0x31')](db['SmsInteraction'][_0xdd4b('0x32')]);_0x42f306['query']=_['keys'](_0x4017a2[_0xdd4b('0x2c')]);_0x42f306['filters']=_[_0xdd4b('0x33')](_0x42f306[_0xdd4b('0x30')],_0x42f306['query']);_0x3fc4f1['attributes']=_[_0xdd4b('0x33')](_0x42f306['model'],qs[_0xdd4b('0x34')](_0x4017a2[_0xdd4b('0x2c')]['fields']));_0x3fc4f1[_0xdd4b('0x35')]=_0x3fc4f1['attributes']['length']?_0x3fc4f1[_0xdd4b('0x35')]:_0x42f306[_0xdd4b('0x30')];if(_0x4017a2[_0xdd4b('0x2c')][_0xdd4b('0x36')]){_0x3fc4f1[_0xdd4b('0x37')]=[{'all':!![]}];}_0x3fc4f1=_[_0xdd4b('0x38')]({},_0x3fc4f1,_0x4017a2[_0xdd4b('0x39')]);return db[_0xdd4b('0x25')][_0xdd4b('0x3a')](_0x3fc4f1)[_0xdd4b('0x1e')](handleEntityNotFound(_0x41bee3,null))['then'](respondWithResult(_0x41bee3,null))['catch'](handleError(_0x41bee3,null));};exports[_0xdd4b('0x3b')]=function(_0x298e1f,_0x368ad6){return db[_0xdd4b('0x25')]['create'](_0x298e1f['body'],{})[_0xdd4b('0x1e')](respondWithResult(_0x368ad6,0xc9))[_0xdd4b('0x3c')](handleError(_0x368ad6,null));};exports['update']=function(_0x4d75bc,_0x5cf2da){if(_0x4d75bc[_0xdd4b('0x3d')]['id']){delete _0x4d75bc[_0xdd4b('0x3d')]['id'];}return db[_0xdd4b('0x25')][_0xdd4b('0x3a')]({'where':{'id':_0x4d75bc['params']['id']}})['then'](handleEntityNotFound(_0x5cf2da,null))['then'](saveUpdates(_0x4d75bc['body'],null))['then'](respondWithResult(_0x5cf2da,null))['catch'](handleError(_0x5cf2da,null));};exports[_0xdd4b('0x1f')]=function(_0x237e4c,_0x248e6b){return db[_0xdd4b('0x25')]['find']({'where':{'id':_0x237e4c[_0xdd4b('0x2f')]['id']}})['then'](handleEntityNotFound(_0x248e6b,null))[_0xdd4b('0x1e')](removeEntity(_0x248e6b,null))[_0xdd4b('0x3c')](handleError(_0x248e6b,null));};exports['describe']=function(_0x157eca,_0xa8adb0){return db[_0xdd4b('0x25')][_0xdd4b('0x3e')]()[_0xdd4b('0x1e')](respondWithResult(_0xa8adb0,null))['catch'](handleError(_0xa8adb0,null));};exports[_0xdd4b('0x3f')]=function(_0x142b6c,_0x1a1a1d){return db[_0xdd4b('0x40')][_0xdd4b('0x3a')]({'where':{'id':_0x142b6c[_0xdd4b('0x2f')]['id']}})[_0xdd4b('0x1e')](handleEntityNotFound(_0x1a1a1d,null))[_0xdd4b('0x1e')](function(_0x4ac0d7){if(_0x4ac0d7){return _0x4ac0d7[_0xdd4b('0x3f')](_0x142b6c['body'][_0xdd4b('0x41')],_['omit'](_0x142b6c[_0xdd4b('0x3d')],[_0xdd4b('0x41'),'id'])||{});}})[_0xdd4b('0x1e')](respondWithResult(_0x1a1a1d,null))[_0xdd4b('0x3c')](handleError(_0x1a1a1d,null));};exports[_0xdd4b('0x42')]=function(_0x145f17,_0x9a3eba){var _0x1f5680={'raw':![],'where':{}};var _0x292286={};var _0x475c19={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xdd4b('0x43')]({'where':{'id':_0x145f17[_0xdd4b('0x2f')]['id']}})['then'](handleEntityNotFound(_0x9a3eba,null))[_0xdd4b('0x1e')](function(_0x21e6bb){if(_0x21e6bb){_0x292286[_0xdd4b('0x30')]=_['keys'](db[_0xdd4b('0x40')][_0xdd4b('0x32')]);_0x292286[_0xdd4b('0x2c')]=_[_0xdd4b('0x31')](_0x145f17[_0xdd4b('0x2c')]);_0x292286['filters']=_[_0xdd4b('0x33')](_0x292286[_0xdd4b('0x30')],_0x292286[_0xdd4b('0x2c')]);_0x1f5680[_0xdd4b('0x35')]=_['intersection'](_0x292286[_0xdd4b('0x30')],qs[_0xdd4b('0x34')](_0x145f17[_0xdd4b('0x2c')][_0xdd4b('0x34')]));_0x1f5680['attributes']=_0x1f5680[_0xdd4b('0x35')][_0xdd4b('0x44')]?_0x1f5680['attributes']:_0x292286[_0xdd4b('0x30')];if(!_0x145f17[_0xdd4b('0x2c')][_0xdd4b('0x45')](_0xdd4b('0x46'))){_0x1f5680[_0xdd4b('0x18')]=qs[_0xdd4b('0x18')](_0x145f17[_0xdd4b('0x2c')]['limit']);_0x1f5680[_0xdd4b('0x17')]=qs[_0xdd4b('0x17')](_0x145f17[_0xdd4b('0x2c')][_0xdd4b('0x17')]);}_0x1f5680[_0xdd4b('0x47')]=qs[_0xdd4b('0x48')](_0x145f17[_0xdd4b('0x2c')][_0xdd4b('0x48')]);_0x1f5680[_0xdd4b('0x49')]=qs[_0xdd4b('0x4a')](_[_0xdd4b('0x4b')](_0x145f17[_0xdd4b('0x2c')],_0x292286[_0xdd4b('0x4a')]));_0x1f5680[_0xdd4b('0x49')][_0xdd4b('0x4c')]=_0x21e6bb['id'];if(_0x145f17[_0xdd4b('0x2c')][_0xdd4b('0x4d')]){_0x1f5680[_0xdd4b('0x49')]=_['merge'](_0x1f5680[_0xdd4b('0x49')],{'$or':_[_0xdd4b('0x24')](_0x1f5680['attributes'],function(_0x2f7768){var _0xb5eae5={};_0xb5eae5[_0x2f7768]={'$like':'%'+_0x145f17[_0xdd4b('0x2c')][_0xdd4b('0x4d')]+'%'};return _0xb5eae5;})});}if(_0x145f17[_0xdd4b('0x2c')][_0xdd4b('0x4e')]){var _0x40c396=_0x145f17['query'][_0xdd4b('0x4e')][_0xdd4b('0x4f')](',');var _0x3a6d4f={};_0x3a6d4f[_0x40c396[0x0]]={'$gte':moment(_0x40c396[0x1])['format'](_0xdd4b('0x50'))};_0x1f5680[_0xdd4b('0x49')]=_[_0xdd4b('0x38')](_0x1f5680['where'],_0x3a6d4f);}_0x1f5680=_[_0xdd4b('0x38')]({},_0x1f5680,_0x145f17[_0xdd4b('0x39')]);return db[_0xdd4b('0x40')][_0xdd4b('0x1a')]({'where':_0x1f5680[_0xdd4b('0x49')]})[_0xdd4b('0x1e')](function(_0x4cf925){_0x475c19[_0xdd4b('0x1a')]=_0x4cf925;if(_0x145f17[_0xdd4b('0x2c')][_0xdd4b('0x36')]){_0x1f5680['include']=[{'all':!![]}];}return db['SmsMessage'][_0xdd4b('0x2a')](_0x1f5680);})[_0xdd4b('0x1e')](function(_0x291845){_0x475c19['rows']=_0x291845;return _0x475c19;});}})[_0xdd4b('0x1e')](respondWithFilteredResult(_0x9a3eba,_0x1f5680))[_0xdd4b('0x3c')](handleError(_0x9a3eba,null));};exports[_0xdd4b('0x51')]=function(_0x37f487,_0x5c6e98){return db[_0xdd4b('0x25')]['find']({'where':{'id':_0x37f487['params']['id']}})['then'](handleEntityNotFound(_0x5c6e98,null))[_0xdd4b('0x1e')](function(_0x2e65c1){if(_0x2e65c1){return _0x2e65c1[_0xdd4b('0x52')](_0x37f487['body'][_0xdd4b('0x41')],_['omit'](_0x37f487['body'],[_0xdd4b('0x41'),'id'])||{})[_0xdd4b('0x53')](function(){return db[_0xdd4b('0x54')][_0xdd4b('0x2a')]({'attributes':['id','name',_0xdd4b('0x55')],'where':{'id':_0x37f487[_0xdd4b('0x3d')][_0xdd4b('0x41')]}});})[_0xdd4b('0x1e')](function(_0x3fa219){socket[_0xdd4b('0x56')](_0xdd4b('0x57'),{'id':Number(_0x37f487[_0xdd4b('0x2f')]['id']),'tags':_0x3fa219||[]});return{'id':Number(_0x37f487[_0xdd4b('0x2f')]['id']),'tags':_0x3fa219||[]};});}})[_0xdd4b('0x1e')](respondWithResult(_0x5c6e98,null))[_0xdd4b('0x3c')](handleError(_0x5c6e98,null));};exports[_0xdd4b('0x58')]=function(_0x2f4507,_0x588b9a){return db[_0xdd4b('0x25')][_0xdd4b('0x3a')]({'where':{'id':_0x2f4507[_0xdd4b('0x2f')]['id']}})[_0xdd4b('0x1e')](handleEntityNotFound(_0x588b9a,null))[_0xdd4b('0x1e')](function(_0x4498e8){if(_0x4498e8){return _0x4498e8[_0xdd4b('0x58')](_0x2f4507['query']['ids']);}})['then'](respondWithStatusCode(_0x588b9a,null))['catch'](handleError(_0x588b9a,null));};exports[_0xdd4b('0x59')]=function(_0x594363,_0x213abd){var _0x2734a4=moment()[_0xdd4b('0x5a')]()['toString']();var _0x42a393=path[_0xdd4b('0x5b')](config[_0xdd4b('0x5c')],_0xdd4b('0x5d'),_0xdd4b('0x5e'),_0xdd4b('0x5f'));var _0x9c7e8=path[_0xdd4b('0x5b')](_0x42a393,_0x2734a4);var _0x5808f7=util['format']('transcript-%d-%s.zip',_0x594363['params']['id'],_0x2734a4);var _0x397fe7=path[_0xdd4b('0x5b')](_0x42a393,_0x5808f7);var _0xc13df3=[];_0xc13df3[_0xdd4b('0x60')]({'model':db[_0xdd4b('0x61')],'as':'User','attributes':['id',_0xdd4b('0x62')],'raw':!![]});_0xc13df3['push']({'model':db[_0xdd4b('0x63')],'as':_0xdd4b('0x64'),'attributes':['id','firstName',_0xdd4b('0x65')],'raw':!![]});var _0x26f1dd=[{'model':db[_0xdd4b('0x40')],'as':_0xdd4b('0x66'),'attributes':['id',_0xdd4b('0x3d'),_0xdd4b('0x67'),'direction',_0xdd4b('0x68'),_0xdd4b('0x69')],'include':_0xc13df3}];_0x26f1dd['push']({'model':db[_0xdd4b('0x6a')],'as':'Account','attributes':['id',_0xdd4b('0x21')]});_0x26f1dd[_0xdd4b('0x60')]({'model':db[_0xdd4b('0x61')],'as':_0xdd4b('0x6b'),'attributes':['id',_0xdd4b('0x62')]});return db['SmsInteraction'][_0xdd4b('0x3a')]({'where':{'id':_0x594363[_0xdd4b('0x2f')]['id']},'include':_0x26f1dd})[_0xdd4b('0x1e')](handleEntityNotFound(_0x213abd,null))['then'](function(_0xafac08){if(_0xafac08){var _0x298be5=_0xafac08['get']({'plain':!![]});fs[_0xdd4b('0x6c')](_0x9c7e8);var _0x1ae638={'channel':_0xdd4b('0x6d'),'account':_0x298be5[_0xdd4b('0x6e')][_0xdd4b('0x21')],'agent':_0x298be5[_0xdd4b('0x6b')]?_0x298be5[_0xdd4b('0x6b')]['fullname']:_0xdd4b('0x6f'),'createdAt':moment(_0x298be5[_0xdd4b('0x67')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x298be5[_0xdd4b('0x70')]?moment(_0x298be5['closedAt'])[_0xdd4b('0x71')](_0xdd4b('0x50'))[_0xdd4b('0x72')]():'','disposition':_0x298be5[_0xdd4b('0x73')],'messages':_(_0x298be5[_0xdd4b('0x66')])['filter']({'secret':![]})[_0xdd4b('0x24')](function(_0x37c959){return{'date':moment(_0x37c959['createdAt'])[_0xdd4b('0x71')](_0xdd4b('0x50'))[_0xdd4b('0x72')](),'sender':_0x37c959['direction']===_0xdd4b('0x74')?_0x37c959[_0xdd4b('0x61')]?_0x37c959['User'][_0xdd4b('0x62')]:_0xdd4b('0x75'):_0x37c959[_0xdd4b('0x64')][_0xdd4b('0x76')]+(_0x37c959['Contact']['lastName']?'\x20'+_0x37c959['Contact'][_0xdd4b('0x65')]:''),'body':_0x37c959['body'],'direction':_0x37c959[_0xdd4b('0x77')]===_0xdd4b('0x74')?'A':'C','secret':_0x37c959['secret'],'read':_0x37c959[_0xdd4b('0x69')]};})[_0xdd4b('0x78')]()};return ejs[_0xdd4b('0x79')](path[_0xdd4b('0x5b')](config['root'],_0xdd4b('0x5d'),_0xdd4b('0x7a'),_0xdd4b('0x7b')),{'interaction':_0x1ae638})[_0xdd4b('0x1e')](function(_0x724ce2){var _0x322ac3=path[_0xdd4b('0x5b')](_0x9c7e8,_0xdd4b('0x7c')+_0x298be5['id']+'-'+_0x2734a4+_0xdd4b('0x7d'));var _0x4dcd02={'path':_0x322ac3,'channel':'Sms','interactionId':_0x298be5['id']};return pdf[_0xdd4b('0x7e')](_0x724ce2,_0x4dcd02);})[_0xdd4b('0x1e')](function(){return new BPromise(function(_0x49e6e2,_0x5159b7){zipdir(_0x9c7e8,{'saveTo':_0x397fe7},function(_0x17fecd,_0x22c5aa){if(_0x17fecd)return _0x5159b7(_0x17fecd);return _0x49e6e2(_0x22c5aa);});})['then'](function(){return new BPromise(function(_0x1862aa,_0x1d2cae){rimraf(_0x9c7e8,function(_0x4eb5ac){if(_0x4eb5ac)_0x1d2cae(_0x4eb5ac);return _0x1862aa();});});})[_0xdd4b('0x1e')](function(){return _0x213abd[_0xdd4b('0x59')](_0x397fe7,_0x5808f7,function(_0x41d993){if(_0x41d993){console['log'](_0xdd4b('0x7f'),_0x41d993);}else{fs[_0xdd4b('0x80')](_0x397fe7);}});});});}else{return _0x213abd[_0xdd4b('0x13')](0xc8);}})[_0xdd4b('0x3c')](handleError(_0x213abd,null));}; \ No newline at end of file +var _0x88dc=['filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','catch','body','describe','addMessage','ids','omit','getMessages','findOne','keys','SmsMessage','hasOwnProperty','order','sort','where','pick','SmsInteractionId','filter','map','$gte','split','format','addTags','setTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','toString','join','server','tmp','transcript-%d-%s.zip','push','User','fullname','CmContact','Messages','createdAt','direction','secret','read','SmsAccount','Owner','get','mkdirSync','Account','N.A.','closed','YYYY-MM-DD\x20HH:mm:ss','out','Contact','firstName','lastName','value','root','downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','log','err','unlinkSync','zip-dir','moment','bluebird','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','./smsInteraction.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','end','error','stack','name','send','rawAttributes','fieldName','getOptions','findAll','sms','query','show','params','model','SmsInteraction'];(function(_0x498af6,_0x3e0604){var _0x24a2b0=function(_0x5051ce){while(--_0x5051ce){_0x498af6['push'](_0x498af6['shift']());}};_0x24a2b0(++_0x3e0604);}(_0x88dc,0x140));var _0xc88d=function(_0x4380e0,_0x5db637){_0x4380e0=_0x4380e0-0x0;var _0x5baf3a=_0x88dc[_0x4380e0];return _0x5baf3a;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xc88d('0x0'));var moment=require(_0xc88d('0x1'));var BPromise=require(_0xc88d('0x2'));var util=require('util');var path=require(_0xc88d('0x3'));var ejs=require(_0xc88d('0x4'));var fs=require('fs');var _=require(_0xc88d('0x5'));var Redis=require(_0xc88d('0x6'));var interaction=require(_0xc88d('0x7'));var qs=require('../../components/parsers/qs');var pdf=require(_0xc88d('0x8'));var logger=require('../../config/logger')(_0xc88d('0x9'));var config=require(_0xc88d('0xa'));var db=require(_0xc88d('0xb'))['db'];config[_0xc88d('0xc')]=_[_0xc88d('0xd')](config[_0xc88d('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc88d('0xc')]));require(_0xc88d('0xe'))[_0xc88d('0xf')](socket);function respondWithStatusCode(_0x1b5a44,_0x9d81d7){_0x9d81d7=_0x9d81d7||0xcc;return function(_0x554a84){if(_0x554a84){return _0x1b5a44[_0xc88d('0x10')](_0x9d81d7);}return _0x1b5a44[_0xc88d('0x11')](_0x9d81d7)['end']();};}function respondWithResult(_0x5f39c9,_0x314827){_0x314827=_0x314827||0xc8;return function(_0x3f06b1){if(_0x3f06b1){return _0x5f39c9[_0xc88d('0x11')](_0x314827)[_0xc88d('0x12')](_0x3f06b1);}};}function respondWithFilteredResult(_0x597a0f,_0x404512){return function(_0x1fcc79){if(_0x1fcc79){var _0x3898af=typeof _0x404512[_0xc88d('0x13')]===_0xc88d('0x14')&&typeof _0x404512['limit']===_0xc88d('0x14');var _0x2668b5=_0x1fcc79[_0xc88d('0x15')];var _0x597c83=_0x3898af?0x0:_0x404512[_0xc88d('0x13')];var _0xddbb94=_0x3898af?_0x1fcc79[_0xc88d('0x15')]:_0x404512['offset']+_0x404512[_0xc88d('0x16')];var _0x4e3df7;if(_0xddbb94>=_0x2668b5){_0xddbb94=_0x2668b5;_0x4e3df7=0xc8;}else{_0x4e3df7=0xce;}_0x597a0f[_0xc88d('0x11')](_0x4e3df7);return _0x597a0f[_0xc88d('0x17')](_0xc88d('0x18'),_0x597c83+'-'+_0xddbb94+'/'+_0x2668b5)['json'](_0x1fcc79);}return null;};}function saveUpdates(_0x5c9249){return function(_0xd8c74b){if(_0xd8c74b){return _0xd8c74b[_0xc88d('0x19')](_0x5c9249)[_0xc88d('0x1a')](function(_0x303dae){return _0x303dae;});}return null;};}function removeEntity(_0x519813){return function(_0x13feb0){if(_0x13feb0){return _0x13feb0[_0xc88d('0x1b')]()['then'](function(){_0x519813[_0xc88d('0x11')](0xcc)[_0xc88d('0x1c')]();});}};}function handleEntityNotFound(_0x20eef1){return function(_0x484459){if(!_0x484459){_0x20eef1[_0xc88d('0x10')](0x194);}return _0x484459;};}function handleError(_0x36c7f0,_0x448fb6){_0x448fb6=_0x448fb6||0x1f4;return function(_0x4a581c){logger[_0xc88d('0x1d')](_0x4a581c[_0xc88d('0x1e')]);if(_0x4a581c[_0xc88d('0x1f')]){delete _0x4a581c[_0xc88d('0x1f')];}_0x36c7f0['status'](_0x448fb6)[_0xc88d('0x20')](_0x4a581c);};}exports['index']=function(_0x2dbc0d,_0x55c7ab){var _0x424c84={};var _0x41b7f2=_['map'](db['SmsInteraction'][_0xc88d('0x21')],function(_0x3749db){return{'name':_0x3749db[_0xc88d('0x22')],'type':_0x3749db['type']['key']};});_0x424c84=qs[_0xc88d('0x23')](_0x41b7f2,_0x2dbc0d);return interaction[_0xc88d('0x24')](_0xc88d('0x25'),_0x2dbc0d[_0xc88d('0x26')],_0x2dbc0d['user'],_0x424c84,_0x41b7f2)[_0xc88d('0x1a')](respondWithFilteredResult(_0x55c7ab,_0x424c84))['catch'](handleError(_0x55c7ab,null));};exports[_0xc88d('0x27')]=function(_0x513a81,_0x41ee6f){var _0x435e61={'raw':![],'where':{'id':_0x513a81[_0xc88d('0x28')]['id']}},_0xa6d164={};_0xa6d164[_0xc88d('0x29')]=_['keys'](db[_0xc88d('0x2a')][_0xc88d('0x21')]);_0xa6d164[_0xc88d('0x26')]=_['keys'](_0x513a81[_0xc88d('0x26')]);_0xa6d164[_0xc88d('0x2b')]=_[_0xc88d('0x2c')](_0xa6d164[_0xc88d('0x29')],_0xa6d164['query']);_0x435e61[_0xc88d('0x2d')]=_[_0xc88d('0x2c')](_0xa6d164[_0xc88d('0x29')],qs['fields'](_0x513a81['query'][_0xc88d('0x2e')]));_0x435e61[_0xc88d('0x2d')]=_0x435e61[_0xc88d('0x2d')][_0xc88d('0x2f')]?_0x435e61['attributes']:_0xa6d164['model'];if(_0x513a81[_0xc88d('0x26')][_0xc88d('0x30')]){_0x435e61[_0xc88d('0x31')]=[{'all':!![]}];}_0x435e61=_[_0xc88d('0x32')]({},_0x435e61,_0x513a81[_0xc88d('0x33')]);return db['SmsInteraction'][_0xc88d('0x34')](_0x435e61)[_0xc88d('0x1a')](handleEntityNotFound(_0x41ee6f,null))[_0xc88d('0x1a')](respondWithResult(_0x41ee6f,null))['catch'](handleError(_0x41ee6f,null));};exports[_0xc88d('0x35')]=function(_0x44bec6,_0x430bba){return db['SmsInteraction'][_0xc88d('0x35')](_0x44bec6['body'],{})['then'](respondWithResult(_0x430bba,0xc9))[_0xc88d('0x36')](handleError(_0x430bba,null));};exports[_0xc88d('0x19')]=function(_0xca67e9,_0x5efe06){if(_0xca67e9[_0xc88d('0x37')]['id']){delete _0xca67e9[_0xc88d('0x37')]['id'];}return db[_0xc88d('0x2a')][_0xc88d('0x34')]({'where':{'id':_0xca67e9['params']['id']}})[_0xc88d('0x1a')](handleEntityNotFound(_0x5efe06,null))[_0xc88d('0x1a')](saveUpdates(_0xca67e9[_0xc88d('0x37')],null))[_0xc88d('0x1a')](respondWithResult(_0x5efe06,null))[_0xc88d('0x36')](handleError(_0x5efe06,null));};exports['destroy']=function(_0x421bce,_0x3f7515){return db[_0xc88d('0x2a')][_0xc88d('0x34')]({'where':{'id':_0x421bce[_0xc88d('0x28')]['id']}})[_0xc88d('0x1a')](handleEntityNotFound(_0x3f7515,null))['then'](removeEntity(_0x3f7515,null))[_0xc88d('0x36')](handleError(_0x3f7515,null));};exports[_0xc88d('0x38')]=function(_0x21403a,_0x5a050a){return db[_0xc88d('0x2a')][_0xc88d('0x38')]()[_0xc88d('0x1a')](respondWithResult(_0x5a050a,null))[_0xc88d('0x36')](handleError(_0x5a050a,null));};exports['addMessage']=function(_0x556b3d,_0x1a775c){return db['SmsMessage'][_0xc88d('0x34')]({'where':{'id':_0x556b3d[_0xc88d('0x28')]['id']}})['then'](handleEntityNotFound(_0x1a775c,null))[_0xc88d('0x1a')](function(_0x21cccd){if(_0x21cccd){return _0x21cccd[_0xc88d('0x39')](_0x556b3d[_0xc88d('0x37')][_0xc88d('0x3a')],_[_0xc88d('0x3b')](_0x556b3d[_0xc88d('0x37')],[_0xc88d('0x3a'),'id'])||{});}})[_0xc88d('0x1a')](respondWithResult(_0x1a775c,null))['catch'](handleError(_0x1a775c,null));};exports[_0xc88d('0x3c')]=function(_0x1cbef0,_0x4c7b8c){var _0x404cab={'raw':![],'where':{}};var _0x2649d9={};var _0x4e0653={'count':0x0,'rows':[]};return db[_0xc88d('0x2a')][_0xc88d('0x3d')]({'where':{'id':_0x1cbef0[_0xc88d('0x28')]['id']}})[_0xc88d('0x1a')](handleEntityNotFound(_0x4c7b8c,null))[_0xc88d('0x1a')](function(_0x2e0a5d){if(_0x2e0a5d){_0x2649d9[_0xc88d('0x29')]=_[_0xc88d('0x3e')](db[_0xc88d('0x3f')][_0xc88d('0x21')]);_0x2649d9[_0xc88d('0x26')]=_['keys'](_0x1cbef0['query']);_0x2649d9[_0xc88d('0x2b')]=_[_0xc88d('0x2c')](_0x2649d9[_0xc88d('0x29')],_0x2649d9[_0xc88d('0x26')]);_0x404cab[_0xc88d('0x2d')]=_[_0xc88d('0x2c')](_0x2649d9[_0xc88d('0x29')],qs[_0xc88d('0x2e')](_0x1cbef0[_0xc88d('0x26')]['fields']));_0x404cab['attributes']=_0x404cab['attributes'][_0xc88d('0x2f')]?_0x404cab[_0xc88d('0x2d')]:_0x2649d9[_0xc88d('0x29')];if(!_0x1cbef0['query'][_0xc88d('0x40')]('nolimit')){_0x404cab[_0xc88d('0x16')]=qs['limit'](_0x1cbef0[_0xc88d('0x26')]['limit']);_0x404cab[_0xc88d('0x13')]=qs['offset'](_0x1cbef0[_0xc88d('0x26')][_0xc88d('0x13')]);}_0x404cab[_0xc88d('0x41')]=qs[_0xc88d('0x42')](_0x1cbef0['query'][_0xc88d('0x42')]);_0x404cab[_0xc88d('0x43')]=qs[_0xc88d('0x2b')](_[_0xc88d('0x44')](_0x1cbef0[_0xc88d('0x26')],_0x2649d9['filters']));_0x404cab[_0xc88d('0x43')][_0xc88d('0x45')]=_0x2e0a5d['id'];if(_0x1cbef0['query'][_0xc88d('0x46')]){_0x404cab['where']=_[_0xc88d('0x32')](_0x404cab[_0xc88d('0x43')],{'$or':_[_0xc88d('0x47')](_0x404cab['attributes'],function(_0x403f21){var _0x1ee011={};_0x1ee011[_0x403f21]={'$like':'%'+_0x1cbef0[_0xc88d('0x26')]['filter']+'%'};return _0x1ee011;})});}if(_0x1cbef0[_0xc88d('0x26')][_0xc88d('0x48')]){var _0x5f3f8b=_0x1cbef0[_0xc88d('0x26')][_0xc88d('0x48')][_0xc88d('0x49')](',');var _0xf3e86d={};_0xf3e86d[_0x5f3f8b[0x0]]={'$gte':moment(_0x5f3f8b[0x1])[_0xc88d('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x404cab[_0xc88d('0x43')]=_['merge'](_0x404cab[_0xc88d('0x43')],_0xf3e86d);}_0x404cab=_[_0xc88d('0x32')]({},_0x404cab,_0x1cbef0[_0xc88d('0x33')]);return db[_0xc88d('0x3f')]['count']({'where':_0x404cab[_0xc88d('0x43')]})['then'](function(_0x38a6c8){_0x4e0653['count']=_0x38a6c8;if(_0x1cbef0[_0xc88d('0x26')][_0xc88d('0x30')]){_0x404cab['include']=[{'all':!![]}];}return db['SmsMessage'][_0xc88d('0x24')](_0x404cab);})['then'](function(_0x1060c6){_0x4e0653['rows']=_0x1060c6;return _0x4e0653;});}})['then'](respondWithFilteredResult(_0x4c7b8c,_0x404cab))['catch'](handleError(_0x4c7b8c,null));};exports[_0xc88d('0x4b')]=function(_0x45c717,_0x40aa00){return db[_0xc88d('0x2a')]['find']({'where':{'id':_0x45c717['params']['id']}})[_0xc88d('0x1a')](handleEntityNotFound(_0x40aa00,null))[_0xc88d('0x1a')](function(_0xf520ea){if(_0xf520ea){return _0xf520ea[_0xc88d('0x4c')](_0x45c717[_0xc88d('0x37')][_0xc88d('0x3a')],_[_0xc88d('0x3b')](_0x45c717['body'],[_0xc88d('0x3a'),'id'])||{})[_0xc88d('0x4d')](function(){return db[_0xc88d('0x4e')]['findAll']({'attributes':['id',_0xc88d('0x1f'),_0xc88d('0x4f')],'where':{'id':_0x45c717['body'][_0xc88d('0x3a')]}});})[_0xc88d('0x1a')](function(_0x3bc098){socket[_0xc88d('0x50')](_0xc88d('0x51'),{'id':Number(_0x45c717['params']['id']),'tags':_0x3bc098||[]});return{'id':Number(_0x45c717[_0xc88d('0x28')]['id']),'tags':_0x3bc098||[]};});}})[_0xc88d('0x1a')](respondWithResult(_0x40aa00,null))[_0xc88d('0x36')](handleError(_0x40aa00,null));};exports[_0xc88d('0x52')]=function(_0x4c64fe,_0x3b5ece){return db['SmsInteraction'][_0xc88d('0x34')]({'where':{'id':_0x4c64fe['params']['id']}})[_0xc88d('0x1a')](handleEntityNotFound(_0x3b5ece,null))[_0xc88d('0x1a')](function(_0x51071a){if(_0x51071a){return _0x51071a[_0xc88d('0x52')](_0x4c64fe[_0xc88d('0x26')]['ids']);}})[_0xc88d('0x1a')](respondWithStatusCode(_0x3b5ece,null))[_0xc88d('0x36')](handleError(_0x3b5ece,null));};exports[_0xc88d('0x53')]=function(_0x49e4df,_0x454fdf){var _0x78a782=moment()[_0xc88d('0x54')]()[_0xc88d('0x55')]();var _0x210232=path[_0xc88d('0x56')](config['root'],_0xc88d('0x57'),'files',_0xc88d('0x58'));var _0x2f5ff7=path[_0xc88d('0x56')](_0x210232,_0x78a782);var _0xf7aa5f=util['format'](_0xc88d('0x59'),_0x49e4df[_0xc88d('0x28')]['id'],_0x78a782);var _0x14866f=path[_0xc88d('0x56')](_0x210232,_0xf7aa5f);var _0x2b0d5e=[];_0x2b0d5e[_0xc88d('0x5a')]({'model':db[_0xc88d('0x5b')],'as':_0xc88d('0x5b'),'attributes':['id',_0xc88d('0x5c')],'raw':!![]});_0x2b0d5e['push']({'model':db[_0xc88d('0x5d')],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});var _0x5f92ba=[{'model':db[_0xc88d('0x3f')],'as':_0xc88d('0x5e'),'attributes':['id',_0xc88d('0x37'),_0xc88d('0x5f'),_0xc88d('0x60'),_0xc88d('0x61'),_0xc88d('0x62')],'include':_0x2b0d5e}];_0x5f92ba[_0xc88d('0x5a')]({'model':db[_0xc88d('0x63')],'as':'Account','attributes':['id',_0xc88d('0x1f')]});_0x5f92ba[_0xc88d('0x5a')]({'model':db[_0xc88d('0x5b')],'as':_0xc88d('0x64'),'attributes':['id','fullname']});return db[_0xc88d('0x2a')]['find']({'where':{'id':_0x49e4df[_0xc88d('0x28')]['id']},'include':_0x5f92ba})[_0xc88d('0x1a')](handleEntityNotFound(_0x454fdf,null))[_0xc88d('0x1a')](function(_0x590da3){if(_0x590da3){var _0x3ad20f=_0x590da3[_0xc88d('0x65')]({'plain':!![]});fs[_0xc88d('0x66')](_0x2f5ff7);var _0x2fb6bc={'channel':'Sms','account':_0x3ad20f[_0xc88d('0x67')]['name'],'agent':_0x3ad20f[_0xc88d('0x64')]?_0x3ad20f[_0xc88d('0x64')][_0xc88d('0x5c')]:_0xc88d('0x68'),'createdAt':moment(_0x3ad20f[_0xc88d('0x5f')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xc88d('0x55')](),'closedAt':_0x3ad20f[_0xc88d('0x69')]?moment(_0x3ad20f['closedAt'])[_0xc88d('0x4a')](_0xc88d('0x6a'))[_0xc88d('0x55')]():'','disposition':_0x3ad20f['disposition'],'messages':_(_0x3ad20f[_0xc88d('0x5e')])[_0xc88d('0x46')]({'secret':![]})[_0xc88d('0x47')](function(_0x3b6a20){return{'date':moment(_0x3b6a20[_0xc88d('0x5f')])[_0xc88d('0x4a')](_0xc88d('0x6a'))[_0xc88d('0x55')](),'sender':_0x3b6a20[_0xc88d('0x60')]===_0xc88d('0x6b')?_0x3b6a20[_0xc88d('0x5b')]?_0x3b6a20[_0xc88d('0x5b')][_0xc88d('0x5c')]:'System':_0x3b6a20[_0xc88d('0x6c')][_0xc88d('0x6d')]+(_0x3b6a20['Contact'][_0xc88d('0x6e')]?'\x20'+_0x3b6a20[_0xc88d('0x6c')][_0xc88d('0x6e')]:''),'body':_0x3b6a20[_0xc88d('0x37')],'direction':_0x3b6a20[_0xc88d('0x60')]===_0xc88d('0x6b')?'A':'C','secret':_0x3b6a20[_0xc88d('0x61')],'read':_0x3b6a20['read']};})[_0xc88d('0x6f')]()};return ejs['renderFile'](path[_0xc88d('0x56')](config[_0xc88d('0x70')],_0xc88d('0x57'),'views',_0xc88d('0x71')),{'interaction':_0x2fb6bc})['then'](function(_0x1d3822){var _0x5ac8d6=path[_0xc88d('0x56')](_0x2f5ff7,_0xc88d('0x72')+_0x3ad20f['id']+'-'+_0x78a782+_0xc88d('0x73'));var _0x1d95fa={'path':_0x5ac8d6,'channel':_0xc88d('0x74'),'interactionId':_0x3ad20f['id']};return pdf[_0xc88d('0x75')](_0x1d3822,_0x1d95fa);})['then'](function(){return new BPromise(function(_0x12eda3,_0x54f562){zipdir(_0x2f5ff7,{'saveTo':_0x14866f},function(_0xd590d4,_0x15ce4e){if(_0xd590d4)return _0x54f562(_0xd590d4);return _0x12eda3(_0x15ce4e);});})[_0xc88d('0x1a')](function(){return new BPromise(function(_0x49b26a,_0x2809d8){rimraf(_0x2f5ff7,function(_0x5991b4){if(_0x5991b4)_0x2809d8(_0x5991b4);return _0x49b26a();});});})[_0xc88d('0x1a')](function(){return _0x454fdf[_0xc88d('0x53')](_0x14866f,_0xf7aa5f,function(_0x4cb51e){if(_0x4cb51e){console[_0xc88d('0x76')](_0xc88d('0x77'),_0x4cb51e);}else{fs[_0xc88d('0x78')](_0x14866f);}});});});}else{return _0x454fdf[_0xc88d('0x10')](0xc8);}})['catch'](handleError(_0x454fdf,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index f365bb5..24bb375 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 _0x93e9=['getUsers','then','setDataValue','map','findAll','unreadMessages','emit','hook','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save'];(function(_0x129517,_0x5863c9){var _0xa5090d=function(_0x52acce){while(--_0x52acce){_0x129517['push'](_0x129517['shift']());}};_0xa5090d(++_0x5863c9);}(_0x93e9,0xcc));var _0x993e=function(_0x29e4c0,_0xf8b14d){_0x29e4c0=_0x29e4c0-0x0;var _0x15b64b=_0x93e9[_0x29e4c0];return _0x15b64b;};'use strict';var EventEmitter=require(_0x993e('0x0'));var SmsInteraction=require(_0x993e('0x1'))['db'][_0x993e('0x2')];var SmsMessage=require(_0x993e('0x1'))['db'][_0x993e('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x993e('0x4')](0x0);var events={'afterCreate':_0x993e('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1b762e){return function(_0x255045,_0x15ce9b,_0x45f52e){_0x255045[_0x993e('0x6')]({'attributes':['id'],'raw':!![]})[_0x993e('0x7')](function(_0x12ac94){_0x255045[_0x993e('0x8')]('Users',_0x12ac94[_0x993e('0x9')](function(_0x69ff1){return{'id':_0x69ff1['id']};}));return SmsMessage[_0x993e('0xa')]({'where':{'SmsInteractionId':_0x255045['id'],'direction':'in','read':![]},'raw':!![]});})[_0x993e('0x7')](function(_0x2cd389){_0x255045[_0x993e('0x8')](_0x993e('0xb'),_0x2cd389['length']);SmsInteractionEvents[_0x993e('0xc')](_0x1b762e+':'+_0x255045['id'],_0x255045);SmsInteractionEvents[_0x993e('0xc')](_0x1b762e,_0x255045);_0x45f52e(null);})['catch'](_0x45f52e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x993e('0xd')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x7d25=['SmsMessage','setMaxListeners','save','update','then','setDataValue','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','SmsInteraction'];(function(_0x33945f,_0x3366e6){var _0x22fc99=function(_0x11640a){while(--_0x11640a){_0x33945f['push'](_0x33945f['shift']());}};_0x22fc99(++_0x3366e6);}(_0x7d25,0x8a));var _0x57d2=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x7d25[_0x25e7cb];return _0x375d92;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x57d2('0x0'))['db'][_0x57d2('0x1')];var SmsMessage=require(_0x57d2('0x0'))['db'][_0x57d2('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x57d2('0x3')](0x0);var events={'afterCreate':_0x57d2('0x4'),'afterUpdate':_0x57d2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5337ca){return function(_0x52a4f4,_0x5dea84,_0x3c5511){_0x52a4f4['getUsers']({'attributes':['id'],'raw':!![]})[_0x57d2('0x6')](function(_0x263d35){_0x52a4f4[_0x57d2('0x7')]('Users',_0x263d35['map'](function(_0xeb8b91){return{'id':_0xeb8b91['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x52a4f4['id'],'direction':'in','read':![]},'raw':!![]});})[_0x57d2('0x6')](function(_0x5153c2){_0x52a4f4[_0x57d2('0x7')]('unreadMessages',_0x5153c2[_0x57d2('0x8')]);SmsInteractionEvents[_0x57d2('0x9')](_0x5337ca+':'+_0x52a4f4['id'],_0x52a4f4);SmsInteractionEvents[_0x57d2('0x9')](_0x5337ca,_0x52a4f4);_0x3c5511(null);})[_0x57d2('0xa')](_0x3c5511(null));};}for(var e in events){if(events[_0x57d2('0xb')](e)){var event=events[e];SmsInteraction[_0x57d2('0xc')](e,emitEvent(event));}}module[_0x57d2('0xd')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 4c4fa6a..fb296fe 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 _0xfe95=['exports','define','sms_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./smsInteraction.attributes'];(function(_0x299e7b,_0x473781){var _0x27b1b0=function(_0x2dc637){while(--_0x2dc637){_0x299e7b['push'](_0x299e7b['shift']());}};_0x27b1b0(++_0x473781);}(_0xfe95,0x6f));var _0x5fe9=function(_0x8cb592,_0x1d250d){_0x8cb592=_0x8cb592-0x0;var _0x108d23=_0xfe95[_0x8cb592];return _0x108d23;};'use strict';var _=require(_0x5fe9('0x0'));var util=require(_0x5fe9('0x1'));var logger=require(_0x5fe9('0x2'))(_0x5fe9('0x3'));var moment=require(_0x5fe9('0x4'));var BPromise=require('bluebird');var rp=require(_0x5fe9('0x5'));var fs=require('fs');var path=require(_0x5fe9('0x6'));var rimraf=require('rimraf');var config=require(_0x5fe9('0x7'));var attributes=require(_0x5fe9('0x8'));module[_0x5fe9('0x9')]=function(_0x568649,_0xcf525){return _0x568649[_0x5fe9('0xa')]('SmsInteraction',attributes,{'tableName':_0x5fe9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2fed78,_0x2a6699,_0x49eb8e){if(_0x2fed78['changed'](_0x5fe9('0xc'))){_0x2fed78['closedAt']=moment()[_0x5fe9('0xd')](_0x5fe9('0xe'));}_0x49eb8e(null,_0x2fed78);}}});}; \ No newline at end of file +var _0xb764=['bluebird','../../config/environment','./smsInteraction.attributes','exports','define','sms_interactions','changed','closed','closedAt','format','lodash','../../config/logger','api','moment'];(function(_0x5552f5,_0x358a01){var _0x4249fc=function(_0x4b37bc){while(--_0x4b37bc){_0x5552f5['push'](_0x5552f5['shift']());}};_0x4249fc(++_0x358a01);}(_0xb764,0xc0));var _0x4b76=function(_0x5b2af3,_0x191b90){_0x5b2af3=_0x5b2af3-0x0;var _0x36e575=_0xb764[_0x5b2af3];return _0x36e575;};'use strict';var _=require(_0x4b76('0x0'));var util=require('util');var logger=require(_0x4b76('0x1'))(_0x4b76('0x2'));var moment=require(_0x4b76('0x3'));var BPromise=require(_0x4b76('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4b76('0x5'));var attributes=require(_0x4b76('0x6'));module[_0x4b76('0x7')]=function(_0x455887,_0x1a4da0){return _0x455887[_0x4b76('0x8')]('SmsInteraction',attributes,{'tableName':_0x4b76('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x100519,_0x4534dd,_0x3c32d2){if(_0x100519[_0x4b76('0xa')](_0x4b76('0xb'))){_0x100519[_0x4b76('0xc')]=moment()[_0x4b76('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3c32d2(null,_0x100519);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 26a2958..96164d7 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 _0xf677=['catch','AddTagsToSmsInteraction','find','omit','ids','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','stringify'];(function(_0x4ab7a9,_0x423b0e){var _0x2f0af4=function(_0x250361){while(--_0x250361){_0x4ab7a9['push'](_0x4ab7a9['shift']());}};_0x2f0af4(++_0x423b0e);}(_0xf677,0x7b));var _0x7f67=function(_0x15681d,_0x40d775){_0x15681d=_0x15681d-0x0;var _0x21f3df=_0xf677[_0x15681d];return _0x21f3df;};'use strict';var _=require(_0x7f67('0x0'));var util=require('util');var moment=require(_0x7f67('0x1'));var BPromise=require(_0x7f67('0x2'));var rs=require(_0x7f67('0x3'));var fs=require('fs');var Redis=require(_0x7f67('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f67('0x5'));var logger=require(_0x7f67('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7f67('0x7'));var client=jayson[_0x7f67('0x8')]['http']({'port':0x232a});config[_0x7f67('0x9')]=_[_0x7f67('0xa')](config[_0x7f67('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x7f67('0xb'))(new Redis(config[_0x7f67('0x9')]));require(_0x7f67('0xc'))[_0x7f67('0xd')](socket);function respondWithRpcPromise(_0xc897cb,_0x4f7f1e,_0x1279dc){return new BPromise(function(_0x4cd4d7,_0x39e148){return client['request'](_0xc897cb,_0x1279dc)[_0x7f67('0xe')](function(_0x4bae7b){logger[_0x7f67('0xf')](_0x7f67('0x10'),_0x4f7f1e,_0x7f67('0x11'));logger[_0x7f67('0x12')](_0x7f67('0x13'),_0x4f7f1e,_0x7f67('0x11'),JSON['stringify'](_0x4bae7b));if(_0x4bae7b[_0x7f67('0x14')]){if(_0x4bae7b[_0x7f67('0x14')][_0x7f67('0x15')]===0x1f4){logger['error'](_0x7f67('0x10'),_0x4f7f1e,_0x4bae7b[_0x7f67('0x14')][_0x7f67('0x16')]);return _0x39e148(_0x4bae7b[_0x7f67('0x14')][_0x7f67('0x16')]);}logger[_0x7f67('0x14')](_0x7f67('0x10'),_0x4f7f1e,_0x4bae7b[_0x7f67('0x14')][_0x7f67('0x16')]);return _0x4cd4d7(_0x4bae7b['error'][_0x7f67('0x16')]);}else{logger[_0x7f67('0xf')](_0x7f67('0x10'),_0x4f7f1e,_0x7f67('0x11'));_0x4cd4d7(_0x4bae7b['result'][_0x7f67('0x16')]);}})['catch'](function(_0x56c53b){logger[_0x7f67('0x14')](_0x7f67('0x10'),_0x4f7f1e,_0x56c53b);_0x39e148(_0x56c53b);});});}exports[_0x7f67('0x17')]=function(_0x48eae9){var _0x226d71=this;return new Promise(function(_0x5422cf,_0x34d698){return db[_0x7f67('0x18')][_0x7f67('0x19')](_0x48eae9[_0x7f67('0x1a')],{'raw':_0x48eae9[_0x7f67('0x1b')]?_0x48eae9[_0x7f67('0x1b')][_0x7f67('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48eae9[_0x7f67('0x1b')]?_0x48eae9[_0x7f67('0x1b')][_0x7f67('0x1d')]||null:null,'attributes':_0x48eae9['options']?_0x48eae9[_0x7f67('0x1b')][_0x7f67('0x1e')]||null:null,'limit':_0x48eae9[_0x7f67('0x1b')]?_0x48eae9[_0x7f67('0x1b')][_0x7f67('0x1f')]||null:null})[_0x7f67('0xe')](function(_0x32603c){logger['info'](_0x7f67('0x17'),_0x48eae9);logger['debug']('UpdateSmsInteraction',_0x48eae9,JSON[_0x7f67('0x20')](_0x32603c));_0x5422cf(_0x32603c);})[_0x7f67('0x21')](function(_0x5ec404){logger[_0x7f67('0x14')](_0x7f67('0x17'),_0x5ec404['message'],_0x48eae9);_0x34d698(_0x226d71[_0x7f67('0x14')](0x1f4,_0x5ec404[_0x7f67('0x16')]));});});};exports[_0x7f67('0x22')]=function(_0x1682bb){return new Promise(function(_0xbe9a2f,_0x34829c){return db[_0x7f67('0x18')][_0x7f67('0x23')]({'where':_0x1682bb['options']?_0x1682bb[_0x7f67('0x1b')][_0x7f67('0x1d')]||null:null})[_0x7f67('0xe')](function(_0x8f558e){if(_0x8f558e){return _0x8f558e['addTags'](_0x1682bb[_0x7f67('0x1a')]['ids'],_[_0x7f67('0x24')](_0x1682bb[_0x7f67('0x1a')],[_0x7f67('0x25'),'id'])||{});}})['spread'](function(_0x5b6d53){logger[_0x7f67('0xf')]('AddTags',_0x1682bb);logger[_0x7f67('0x12')](_0x7f67('0x26'),_0x1682bb,JSON[_0x7f67('0x20')](_0x5b6d53));_0xbe9a2f(_0x5b6d53);})[_0x7f67('0x21')](function(_0x4ecdf4){logger['error']('AddTags',_0x4ecdf4[_0x7f67('0x16')],_0x1682bb);_0x34829c(_this[_0x7f67('0x14')](0x1f4,_0x4ecdf4[_0x7f67('0x16')]));});});}; \ No newline at end of file +var _0x1920=['info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','AddTagsToSmsInteraction','find','ids','omit','spread','AddTags','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1920,0x1c6));var _0x0192=function(_0x417e4c,_0x4f3094){_0x417e4c=_0x417e4c-0x0;var _0x2bb065=_0x1920[_0x417e4c];return _0x2bb065;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0192('0x0'));var fs=require('fs');var Redis=require(_0x0192('0x1'));var db=require(_0x0192('0x2'))['db'];var utils=require(_0x0192('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x0192('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x0192('0x5')][_0x0192('0x6')]({'port':0x232a});config[_0x0192('0x7')]=_[_0x0192('0x8')](config[_0x0192('0x7')],{'host':_0x0192('0x9'),'port':0x18eb});var socket=require(_0x0192('0xa'))(new Redis(config[_0x0192('0x7')]));require('./smsInteraction.socket')[_0x0192('0xb')](socket);function respondWithRpcPromise(_0xb77b4c,_0x3ce723,_0x575804){return new BPromise(function(_0x176ae6,_0x2914f3){return client[_0x0192('0xc')](_0xb77b4c,_0x575804)[_0x0192('0xd')](function(_0x3ee79b){logger[_0x0192('0xe')](_0x0192('0xf'),_0x3ce723,_0x0192('0x10'));logger[_0x0192('0x11')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x3ce723,_0x0192('0x10'),JSON[_0x0192('0x12')](_0x3ee79b));if(_0x3ee79b[_0x0192('0x13')]){if(_0x3ee79b[_0x0192('0x13')][_0x0192('0x14')]===0x1f4){logger['error'](_0x0192('0xf'),_0x3ce723,_0x3ee79b[_0x0192('0x13')][_0x0192('0x15')]);return _0x2914f3(_0x3ee79b[_0x0192('0x13')][_0x0192('0x15')]);}logger['error'](_0x0192('0xf'),_0x3ce723,_0x3ee79b['error']['message']);return _0x176ae6(_0x3ee79b[_0x0192('0x13')]['message']);}else{logger[_0x0192('0xe')](_0x0192('0xf'),_0x3ce723,_0x0192('0x10'));_0x176ae6(_0x3ee79b[_0x0192('0x16')]['message']);}})[_0x0192('0x17')](function(_0x54f294){logger['error'](_0x0192('0xf'),_0x3ce723,_0x54f294);_0x2914f3(_0x54f294);});});}exports[_0x0192('0x18')]=function(_0x410dc2){var _0x46c43d=this;return new Promise(function(_0xe8a880,_0x32cf91){return db[_0x0192('0x19')][_0x0192('0x1a')](_0x410dc2[_0x0192('0x1b')],{'raw':_0x410dc2[_0x0192('0x1c')]?_0x410dc2[_0x0192('0x1c')][_0x0192('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x410dc2[_0x0192('0x1c')]?_0x410dc2[_0x0192('0x1c')][_0x0192('0x1e')]||null:null,'attributes':_0x410dc2[_0x0192('0x1c')]?_0x410dc2[_0x0192('0x1c')][_0x0192('0x1f')]||null:null,'limit':_0x410dc2[_0x0192('0x1c')]?_0x410dc2['options'][_0x0192('0x20')]||null:null})[_0x0192('0xd')](function(_0x2a2db0){logger[_0x0192('0xe')]('UpdateSmsInteraction',_0x410dc2);logger[_0x0192('0x11')](_0x0192('0x18'),_0x410dc2,JSON[_0x0192('0x12')](_0x2a2db0));_0xe8a880(_0x2a2db0);})[_0x0192('0x17')](function(_0x560d75){logger['error'](_0x0192('0x18'),_0x560d75[_0x0192('0x15')],_0x410dc2);_0x32cf91(_0x46c43d[_0x0192('0x13')](0x1f4,_0x560d75[_0x0192('0x15')]));});});};exports[_0x0192('0x21')]=function(_0x442aa8){return new Promise(function(_0x1ce79b,_0x20ab14){return db[_0x0192('0x19')][_0x0192('0x22')]({'where':_0x442aa8[_0x0192('0x1c')]?_0x442aa8[_0x0192('0x1c')][_0x0192('0x1e')]||null:null})['then'](function(_0x29ebda){if(_0x29ebda){return _0x29ebda['addTags'](_0x442aa8[_0x0192('0x1b')][_0x0192('0x23')],_[_0x0192('0x24')](_0x442aa8[_0x0192('0x1b')],[_0x0192('0x23'),'id'])||{});}})[_0x0192('0x25')](function(_0x144d19){logger[_0x0192('0xe')](_0x0192('0x26'),_0x442aa8);logger[_0x0192('0x11')](_0x0192('0x26'),_0x442aa8,JSON['stringify'](_0x144d19));_0x1ce79b(_0x144d19);})['catch'](function(_0x48813b){logger[_0x0192('0x13')](_0x0192('0x26'),_0x48813b['message'],_0x442aa8);_0x20ab14(_this[_0x0192('0x13')](0x1f4,_0x48813b[_0x0192('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index bff721a..4298239 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 _0x3d9a=['smsInteraction:','save','remove','emit','removeListener','register','length'];(function(_0x445c98,_0x3d0002){var _0x4768fb=function(_0x22ecc6){while(--_0x22ecc6){_0x445c98['push'](_0x445c98['shift']());}};_0x4768fb(++_0x3d0002);}(_0x3d9a,0x1ac));var _0xa3d9=function(_0x407e72,_0x16e547){_0x407e72=_0x407e72-0x0;var _0xc6f0fa=_0x3d9a[_0x407e72];return _0xc6f0fa;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xa3d9('0x0'),_0xa3d9('0x1'),'update'];function createListener(_0x18935f,_0x471aa4){return function(_0x3edcb7){_0x471aa4[_0xa3d9('0x2')](_0x18935f,_0x3edcb7);};}function removeListener(_0x5f1ef5,_0x4e6e07){return function(){SmsInteractionEvents[_0xa3d9('0x3')](_0x5f1ef5,_0x4e6e07);};}exports[_0xa3d9('0x4')]=function(_0x2b752b){for(var _0x38ff85=0x0,_0x3c302c=events[_0xa3d9('0x5')];_0x38ff85<_0x3c302c;_0x38ff85++){var _0x47ee56=events[_0x38ff85];var _0x8d1d17=createListener(_0xa3d9('0x6')+_0x47ee56,_0x2b752b);SmsInteractionEvents['on'](_0x47ee56,_0x8d1d17);}}; \ No newline at end of file +var _0x61fd=['length','smsInteraction:','remove','removeListener','register'];(function(_0x375a54,_0x248965){var _0x2fb141=function(_0x3d0761){while(--_0x3d0761){_0x375a54['push'](_0x375a54['shift']());}};_0x2fb141(++_0x248965);}(_0x61fd,0xbb));var _0xd61f=function(_0x36fd6c,_0x49cb79){_0x36fd6c=_0x36fd6c-0x0;var _0x544c9f=_0x61fd[_0x36fd6c];return _0x544c9f;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=['save',_0xd61f('0x0'),'update'];function createListener(_0x3db059,_0x4ebff7){return function(_0x494ad3){_0x4ebff7['emit'](_0x3db059,_0x494ad3);};}function removeListener(_0x53b499,_0x370201){return function(){SmsInteractionEvents[_0xd61f('0x1')](_0x53b499,_0x370201);};}exports[_0xd61f('0x2')]=function(_0x1845c1){for(var _0x53d868=0x0,_0x2ea5e7=events[_0xd61f('0x3')];_0x53d868<_0x2ea5e7;_0x53d868++){var _0x4be6e9=events[_0x53d868];var _0x36ef3c=createListener(_0xd61f('0x4')+_0x4be6e9,_0x1845c1);SmsInteractionEvents['on'](_0x4be6e9,_0x36ef3c);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index e881263..c6c18f8 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 _0xcfa5=['smsmessage:create','post','/:id/status','status','put','/:id','update','/:id/accept','reject','delete','destroy','exports','multer','util','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','index','/describe','isAuthenticated','show','tracked','sms'];(function(_0x13862a,_0x2fa0cd){var _0xb47015=function(_0x27bf35){while(--_0x27bf35){_0x13862a['push'](_0x13862a['shift']());}};_0xb47015(++_0x2fa0cd);}(_0xcfa5,0xbb));var _0x5cfa=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xcfa5[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x5cfa('0x0'));var util=require(_0x5cfa('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5cfa('0x2'));var interaction=require(_0x5cfa('0x3'));var config=require(_0x5cfa('0x4'));var controller=require(_0x5cfa('0x5'));router[_0x5cfa('0x6')]('/',auth['isAuthenticated'](),controller[_0x5cfa('0x7')]);router['get'](_0x5cfa('0x8'),auth[_0x5cfa('0x9')](),controller['describe']);router[_0x5cfa('0x6')]('/:id',auth[_0x5cfa('0x9')](),controller[_0x5cfa('0xa')]);router['post']('/',auth[_0x5cfa('0x9')](),interaction[_0x5cfa('0xb')](_0x5cfa('0xc'),_0x5cfa('0xd')),controller['create']);router[_0x5cfa('0xe')](_0x5cfa('0xf'),controller[_0x5cfa('0x10')]);router[_0x5cfa('0x11')](_0x5cfa('0x12'),auth['isAuthenticated'](),controller[_0x5cfa('0x13')]);router[_0x5cfa('0x11')](_0x5cfa('0x14'),auth['isAuthenticated'](),controller['accept']);router['put']('/:id/reject',auth[_0x5cfa('0x9')](),controller[_0x5cfa('0x15')]);router[_0x5cfa('0x16')](_0x5cfa('0x12'),auth[_0x5cfa('0x9')](),controller[_0x5cfa('0x17')]);module[_0x5cfa('0x18')]=router; \ No newline at end of file +var _0x5226=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','sms','smsmessage:create','create','post','/:id/status','put','update','accept','/:id/reject','destroy','exports'];(function(_0xbfb7c,_0x1c3f5d){var _0x2727cb=function(_0x1f49fa){while(--_0x1f49fa){_0xbfb7c['push'](_0xbfb7c['shift']());}};_0x2727cb(++_0x1c3f5d);}(_0x5226,0x16c));var _0x6522=function(_0xe15919,_0x4c1fbd){_0xe15919=_0xe15919-0x0;var _0x372688=_0x5226[_0xe15919];return _0x372688;};'use strict';var multer=require(_0x6522('0x0'));var util=require(_0x6522('0x1'));var path=require(_0x6522('0x2'));var timeout=require(_0x6522('0x3'));var express=require(_0x6522('0x4'));var router=express['Router']();var fs_extra=require(_0x6522('0x5'));var auth=require(_0x6522('0x6'));var interaction=require(_0x6522('0x7'));var config=require('../../config/environment');var controller=require(_0x6522('0x8'));router[_0x6522('0x9')]('/',auth[_0x6522('0xa')](),controller[_0x6522('0xb')]);router[_0x6522('0x9')](_0x6522('0xc'),auth[_0x6522('0xa')](),controller[_0x6522('0xd')]);router['get'](_0x6522('0xe'),auth['isAuthenticated'](),controller[_0x6522('0xf')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x6522('0x10')](_0x6522('0x11'),_0x6522('0x12')),controller[_0x6522('0x13')]);router[_0x6522('0x14')](_0x6522('0x15'),controller['status']);router[_0x6522('0x16')]('/:id',auth[_0x6522('0xa')](),controller[_0x6522('0x17')]);router[_0x6522('0x16')]('/:id/accept',auth[_0x6522('0xa')](),controller[_0x6522('0x18')]);router['put'](_0x6522('0x19'),auth[_0x6522('0xa')](),controller['reject']);router['delete']('/:id',auth[_0x6522('0xa')](),controller[_0x6522('0x1a')]);module[_0x6522('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 3a8bb7e..8d55257 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 _0x5aa7=['TEXT','sequelize','exports','out','STRING','DATE'];(function(_0x3998bd,_0x29c296){var _0x26071a=function(_0x403ac9){while(--_0x403ac9){_0x3998bd['push'](_0x3998bd['shift']());}};_0x26071a(++_0x29c296);}(_0x5aa7,0x151));var _0x75aa=function(_0x38be75,_0x5cbe73){_0x38be75=_0x38be75-0x0;var _0x5e7598=_0x5aa7[_0x38be75];return _0x5e7598;};'use strict';var Sequelize=require(_0x75aa('0x0'));module[_0x75aa('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x75aa('0x2')),'defaultValue':_0x75aa('0x2'),'allowNull':![]},'messageId':{'type':Sequelize[_0x75aa('0x3')](0xbe)},'phone':{'type':Sequelize[_0x75aa('0x3')]},'readAt':{'type':Sequelize[_0x75aa('0x4')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x75aa('0x3')]},'providerResponse':{'type':Sequelize[_0x75aa('0x5')]}}; \ No newline at end of file +var _0x3b18=['ENUM','out','STRING','DATE','exports','medium','BOOLEAN'];(function(_0x25c7fb,_0x2e4e86){var _0x214b77=function(_0x36b7c0){while(--_0x36b7c0){_0x25c7fb['push'](_0x25c7fb['shift']());}};_0x214b77(++_0x2e4e86);}(_0x3b18,0xe4));var _0x83b1=function(_0xa66538,_0x2218c4){_0xa66538=_0xa66538-0x0;var _0x5244be=_0x3b18[_0xa66538];return _0x5244be;};'use strict';var Sequelize=require('sequelize');module[_0x83b1('0x0')]={'body':{'type':Sequelize['TEXT'](_0x83b1('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x83b1('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x83b1('0x3')]('in',_0x83b1('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x83b1('0x5')]},'readAt':{'type':Sequelize[_0x83b1('0x6')]},'secret':{'type':Sequelize[_0x83b1('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x83b1('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index fa46ccf..dd388a5 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 _0xe635=['groupName','DELIVERED','eml-format','rimraf','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','api','../../config/utils','../../config/license/util','redis','defaults','localhost','register','jayson/promise','http','client','request','then','info','SmsMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','sendStatus','stack','name','send','SmsMessage','rawAttributes','fieldName','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','params','keys','create','body','destroy','describe','../../config/logger','sms-interactions','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','find','get','SmsInteraction','SmsInteractionId','isNil','interaction','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','accept','EventManager','acceptmessage','RejectMessage','rejectMessage','event','rejectmessage','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','MessageUUID','indexOf','delivered','Status','plivio','infobip','results'];(function(_0x23e9d4,_0x1063fd){var _0x4ab2b0=function(_0x3ff3e3){while(--_0x3ff3e3){_0x23e9d4['push'](_0x23e9d4['shift']());}};_0x4ab2b0(++_0x1063fd);}(_0xe635,0x1be));var _0x5e63=function(_0x3b9479,_0x59da7b){_0x3b9479=_0x3b9479-0x0;var _0x33ab54=_0xe635[_0x3b9479];return _0x33ab54;};'use strict';var emlformat=require(_0x5e63('0x0'));var rimraf=require(_0x5e63('0x1'));var zipdir=require(_0x5e63('0x2'));var jsonpatch=require(_0x5e63('0x3'));var rp=require(_0x5e63('0x4'));var moment=require(_0x5e63('0x5'));var BPromise=require(_0x5e63('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5e63('0x7'));var sox=require(_0x5e63('0x8'));var csv=require(_0x5e63('0x9'));var ejs=require(_0x5e63('0xa'));var fs=require('fs');var fs_extra=require(_0x5e63('0xb'));var _=require(_0x5e63('0xc'));var squel=require(_0x5e63('0xd'));var crypto=require(_0x5e63('0xe'));var jsforce=require(_0x5e63('0xf'));var deskjs=require(_0x5e63('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5e63('0x11'));var Papa=require(_0x5e63('0x12'));var Redis=require(_0x5e63('0x13'));var authService=require(_0x5e63('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x5e63('0x15'));var hardwareService=require(_0x5e63('0x16'));var logger=require('../../config/logger')(_0x5e63('0x17'));var utils=require(_0x5e63('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5e63('0x19'));var db=require('../../mysqldb')['db'];config[_0x5e63('0x1a')]=_[_0x5e63('0x1b')](config[_0x5e63('0x1a')],{'host':_0x5e63('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsMessage.socket')[_0x5e63('0x1d')](socket);var jayson=require(_0x5e63('0x1e'));var client=jayson['client'][_0x5e63('0x1f')]({'port':0x232c});var client9002=jayson[_0x5e63('0x20')][_0x5e63('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x491e27,_0x42a714,_0xe0b567,_0x4715f9){return new BPromise(function(_0x357f40,_0x3d7dc3){var _0x578c68=_0x4715f9||client;return _0x578c68[_0x5e63('0x21')](_0x491e27,_0xe0b567)[_0x5e63('0x22')](function(_0x264aca){logger[_0x5e63('0x23')](_0x5e63('0x24'),_0x42a714,'request\x20sent');logger[_0x5e63('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42a714,'request\x20sent',JSON[_0x5e63('0x26')](_0x264aca));if(_0x264aca[_0x5e63('0x27')]){if(_0x264aca[_0x5e63('0x27')][_0x5e63('0x28')]===0x1f4){logger[_0x5e63('0x27')](_0x5e63('0x24'),_0x42a714,_0x264aca[_0x5e63('0x27')][_0x5e63('0x29')]);return _0x3d7dc3(_0x264aca[_0x5e63('0x27')][_0x5e63('0x29')]);}logger['error'](_0x5e63('0x24'),_0x42a714,_0x264aca['error']['message']);return _0x357f40(_0x264aca[_0x5e63('0x27')][_0x5e63('0x29')]);}else{logger[_0x5e63('0x23')](_0x5e63('0x24'),_0x42a714,_0x5e63('0x2a'));_0x357f40(_0x264aca[_0x5e63('0x2b')][_0x5e63('0x29')]);}})['catch'](function(_0x275715){logger['error'](_0x5e63('0x24'),_0x42a714,_0x275715);_0x3d7dc3(_0x275715);});});}function respondWithStatusCode(_0x398e47,_0x5b468d){_0x5b468d=_0x5b468d||0xcc;return function(_0x3f9440){if(_0x3f9440){return _0x398e47['sendStatus'](_0x5b468d);}return _0x398e47[_0x5e63('0x2c')](_0x5b468d)[_0x5e63('0x2d')]();};}function respondWithResult(_0x548718,_0x4e0a86){_0x4e0a86=_0x4e0a86||0xc8;return function(_0x1f2eff){if(_0x1f2eff){return _0x548718[_0x5e63('0x2c')](_0x4e0a86)[_0x5e63('0x2e')](_0x1f2eff);}};}function respondWithFilteredResult(_0x395bb2,_0x38da60){return function(_0x25c635){if(_0x25c635){var _0x4b3e42=typeof _0x38da60[_0x5e63('0x2f')]==='undefined'&&typeof _0x38da60[_0x5e63('0x30')]===_0x5e63('0x31');var _0x3b9ce0=_0x25c635[_0x5e63('0x32')];var _0xfc4a65=_0x4b3e42?0x0:_0x38da60[_0x5e63('0x2f')];var _0x5db415=_0x4b3e42?_0x25c635[_0x5e63('0x32')]:_0x38da60[_0x5e63('0x2f')]+_0x38da60[_0x5e63('0x30')];var _0x57ecc6;if(_0x5db415>=_0x3b9ce0){_0x5db415=_0x3b9ce0;_0x57ecc6=0xc8;}else{_0x57ecc6=0xce;}_0x395bb2[_0x5e63('0x2c')](_0x57ecc6);return _0x395bb2[_0x5e63('0x33')](_0x5e63('0x34'),_0xfc4a65+'-'+_0x5db415+'/'+_0x3b9ce0)[_0x5e63('0x2e')](_0x25c635);}return null;};}function patchUpdates(_0x565ac9){return function(_0x5c3b88){try{jsonpatch['apply'](_0x5c3b88,_0x565ac9,!![]);}catch(_0x581c9e){return BPromise[_0x5e63('0x35')](_0x581c9e);}return _0x5c3b88[_0x5e63('0x36')]();};}function saveUpdates(_0x44000f,_0x4ed710){return function(_0x327f43){if(_0x327f43){return _0x327f43[_0x5e63('0x37')](_0x44000f)['then'](function(_0x298ae3){return _0x298ae3;});}return null;};}function removeEntity(_0x25aa6a,_0x311618){return function(_0x195146){if(_0x195146){return _0x195146['destroy']()[_0x5e63('0x22')](function(){_0x25aa6a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3de99f,_0x1a9ef5){return function(_0x3328df){if(!_0x3328df){_0x3de99f[_0x5e63('0x38')](0x194);}return _0x3328df;};}function handleError(_0x51e7ca,_0x1812cd){_0x1812cd=_0x1812cd||0x1f4;return function(_0x39e4b5){logger[_0x5e63('0x27')](_0x39e4b5[_0x5e63('0x39')]);if(_0x39e4b5[_0x5e63('0x3a')]){delete _0x39e4b5[_0x5e63('0x3a')];}_0x51e7ca[_0x5e63('0x2c')](_0x1812cd)[_0x5e63('0x3b')](_0x39e4b5);};}exports['index']=function(_0x1929d5,_0x582e25){var _0x115d26={},_0x5c063b={},_0x115359={'count':0x0,'rows':[]};var _0x106574=_['map'](db[_0x5e63('0x3c')][_0x5e63('0x3d')],function(_0x14a660){return{'name':_0x14a660[_0x5e63('0x3e')],'type':_0x14a660['type']['key']};});_0x5c063b[_0x5e63('0x3f')]=_[_0x5e63('0x40')](_0x106574,_0x5e63('0x3a'));_0x5c063b[_0x5e63('0x41')]=_['keys'](_0x1929d5['query']);_0x5c063b['filters']=_[_0x5e63('0x42')](_0x5c063b[_0x5e63('0x3f')],_0x5c063b[_0x5e63('0x41')]);_0x115d26[_0x5e63('0x43')]=_[_0x5e63('0x42')](_0x5c063b['model'],qs[_0x5e63('0x44')](_0x1929d5[_0x5e63('0x41')]['fields']));_0x115d26[_0x5e63('0x43')]=_0x115d26['attributes'][_0x5e63('0x45')]?_0x115d26['attributes']:_0x5c063b[_0x5e63('0x3f')];if(!_0x1929d5[_0x5e63('0x41')][_0x5e63('0x46')]('nolimit')){_0x115d26[_0x5e63('0x30')]=qs[_0x5e63('0x30')](_0x1929d5[_0x5e63('0x41')][_0x5e63('0x30')]);_0x115d26[_0x5e63('0x2f')]=qs[_0x5e63('0x2f')](_0x1929d5['query'][_0x5e63('0x2f')]);}_0x115d26[_0x5e63('0x47')]=qs[_0x5e63('0x48')](_0x1929d5[_0x5e63('0x41')][_0x5e63('0x48')]);_0x115d26['where']=qs[_0x5e63('0x49')](_[_0x5e63('0x4a')](_0x1929d5['query'],_0x5c063b['filters']),_0x106574);if(_0x1929d5[_0x5e63('0x41')]['filter']){_0x115d26[_0x5e63('0x4b')]=_['merge'](_0x115d26['where'],{'$or':_[_0x5e63('0x40')](_0x106574,function(_0x13c11e){if(_0x13c11e[_0x5e63('0x4c')]!==_0x5e63('0x4d')){var _0x7ba429={};_0x7ba429[_0x13c11e[_0x5e63('0x3a')]]={'$like':'%'+_0x1929d5[_0x5e63('0x41')][_0x5e63('0x4e')]+'%'};return _0x7ba429;}})});}_0x115d26=_[_0x5e63('0x4f')]({},_0x115d26,_0x1929d5[_0x5e63('0x50')]);var _0x2372e4={'where':_0x115d26[_0x5e63('0x4b')]};return db[_0x5e63('0x3c')]['count'](_0x2372e4)[_0x5e63('0x22')](function(_0x20b80d){_0x115359[_0x5e63('0x32')]=_0x20b80d;if(_0x1929d5[_0x5e63('0x41')][_0x5e63('0x51')]){_0x115d26[_0x5e63('0x52')]=[{'all':!![]}];}return db['SmsMessage'][_0x5e63('0x53')](_0x115d26);})['then'](function(_0x25c857){_0x115359['rows']=_0x25c857;return _0x115359;})[_0x5e63('0x22')](respondWithFilteredResult(_0x582e25,_0x115d26))[_0x5e63('0x54')](handleError(_0x582e25,null));};exports['show']=function(_0x5102c8,_0x5b6568){var _0x1507ef={'raw':!![],'where':{'id':_0x5102c8[_0x5e63('0x55')]['id']}},_0x54ecc9={};_0x54ecc9['model']=_[_0x5e63('0x56')](db[_0x5e63('0x3c')][_0x5e63('0x3d')]);_0x54ecc9['query']=_['keys'](_0x5102c8[_0x5e63('0x41')]);_0x54ecc9['filters']=_[_0x5e63('0x42')](_0x54ecc9[_0x5e63('0x3f')],_0x54ecc9[_0x5e63('0x41')]);_0x1507ef['attributes']=_[_0x5e63('0x42')](_0x54ecc9['model'],qs[_0x5e63('0x44')](_0x5102c8['query'][_0x5e63('0x44')]));_0x1507ef[_0x5e63('0x43')]=_0x1507ef[_0x5e63('0x43')][_0x5e63('0x45')]?_0x1507ef[_0x5e63('0x43')]:_0x54ecc9[_0x5e63('0x3f')];if(_0x5102c8[_0x5e63('0x41')][_0x5e63('0x51')]){_0x1507ef[_0x5e63('0x52')]=[{'all':!![]}];}_0x1507ef=_[_0x5e63('0x4f')]({},_0x1507ef,_0x5102c8[_0x5e63('0x50')]);return db[_0x5e63('0x3c')]['find'](_0x1507ef)[_0x5e63('0x22')](handleEntityNotFound(_0x5b6568,null))[_0x5e63('0x22')](respondWithResult(_0x5b6568,null))[_0x5e63('0x54')](handleError(_0x5b6568,null));};exports[_0x5e63('0x57')]=function(_0x18a1a4,_0x4bf624){return db[_0x5e63('0x3c')][_0x5e63('0x57')](_0x18a1a4['body'],{})['then'](respondWithResult(_0x4bf624,0xc9))['catch'](handleError(_0x4bf624,null));};exports['update']=function(_0x45ff6d,_0xbf67f){if(_0x45ff6d['body']['id']){delete _0x45ff6d['body']['id'];}return db[_0x5e63('0x3c')]['find']({'where':{'id':_0x45ff6d[_0x5e63('0x55')]['id']}})[_0x5e63('0x22')](handleEntityNotFound(_0xbf67f,null))[_0x5e63('0x22')](saveUpdates(_0x45ff6d[_0x5e63('0x58')],null))[_0x5e63('0x22')](respondWithResult(_0xbf67f,null))['catch'](handleError(_0xbf67f,null));};exports[_0x5e63('0x59')]=function(_0x4ee15a,_0x5483ac){return db['SmsMessage']['find']({'where':{'id':_0x4ee15a[_0x5e63('0x55')]['id']}})[_0x5e63('0x22')](handleEntityNotFound(_0x5483ac,null))['then'](removeEntity(_0x5483ac,null))[_0x5e63('0x54')](handleError(_0x5483ac,null));};exports['describe']=function(_0x5afb98,_0x2c8c8f){return db[_0x5e63('0x3c')][_0x5e63('0x5a')]()[_0x5e63('0x22')](respondWithResult(_0x2c8c8f,null))['catch'](handleError(_0x2c8c8f,null));};var interaction_log=require(_0x5e63('0x5b'))(_0x5e63('0x5c'));exports['accept']=function(_0x23d4d2,_0x2b6cc6,_0x5e57b4){var _0x287122={'agent':{},'channel':_0x5e63('0x5d')};if(_0x23d4d2[_0x5e63('0x58')]['id']){delete _0x23d4d2[_0x5e63('0x58')]['id'];}_0x23d4d2[_0x5e63('0x58')][_0x5e63('0x5e')]=!![];_0x23d4d2[_0x5e63('0x58')][_0x5e63('0x5f')]=moment()[_0x5e63('0x60')](_0x5e63('0x61'));_0x23d4d2[_0x5e63('0x58')][_0x5e63('0x62')]=_0x23d4d2[_0x5e63('0x58')][_0x5e63('0x62')]||_0x23d4d2[_0x5e63('0x63')]['id'];_0x287122[_0x5e63('0x64')]['id']=_0x23d4d2[_0x5e63('0x58')][_0x5e63('0x62')];return db['SmsMessage'][_0x5e63('0x65')]({'where':{'id':_0x23d4d2[_0x5e63('0x55')]['id'],'UserId':null}})[_0x5e63('0x22')](handleEntityNotFound(_0x2b6cc6,null))['then'](saveUpdates(_0x23d4d2[_0x5e63('0x58')],null))['then'](function(_0x2e1369){if(_0x2e1369){_0x287122[_0x5e63('0x29')]=_0x2e1369[_0x5e63('0x66')]({'plain':!![]});return db[_0x5e63('0x67')][_0x5e63('0x65')]({'where':{'id':_0x2e1369[_0x5e63('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x2b6cc6,null))[_0x5e63('0x22')](function(_0x348917){if(_0x348917){return _0x348917[_0x5e63('0x37')]({'UserId':_0x23d4d2[_0x5e63('0x58')][_0x5e63('0x62')],'read1stAt':_[_0x5e63('0x69')](_0x348917['read1stAt'])?moment()['format'](_0x5e63('0x61')):undefined});}return null;})[_0x5e63('0x22')](function(_0x5dc906){if(_0x5dc906){_0x287122[_0x5e63('0x6a')]=_0x5dc906[_0x5e63('0x66')]({'plain':!![]});interaction_log[_0x5e63('0x23')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x23d4d2[_0x5e63('0x63')]['id'],_0x23d4d2[_0x5e63('0x63')][_0x5e63('0x3a')],_0x23d4d2[_0x5e63('0x63')][_0x5e63('0x6b')],_0x287122['interaction']['id'],_0x23d4d2[_0x5e63('0x58')]?JSON[_0x5e63('0x26')](_0x23d4d2['body']):_0x5e63('0x6c'));return respondWithRpcPromise(_0x5e63('0x6d'),'acceptMessage',_0x287122);}return null;})[_0x5e63('0x22')](function(_0x1c1036){var _0x2205e2=_0x5e63('0x6e')+_0x1c1036[_0x5e63('0x29')][_0x5e63('0x6f')];return db['sequelize'][_0x5e63('0x41')](_0x2205e2,{'type':db[_0x5e63('0x70')][_0x5e63('0x71')][_0x5e63('0x72')],'raw':!![]})['then'](function(_0xe801dd){return _0xe801dd;});})[_0x5e63('0x22')](function(_0x4d6327){if(_0x4d6327){_0x287122[_0x5e63('0x29')][_0x5e63('0x73')]=_0x4d6327[0x0];if(!_0x23d4d2[_0x5e63('0x58')][_0x5e63('0x62')])return;return db[_0x5e63('0x74')][_0x5e63('0x65')]({'where':{'id':_0x23d4d2[_0x5e63('0x58')][_0x5e63('0x62')],'role':_0x5e63('0x64')},'attributes':['id','name',_0x5e63('0x75'),_0x5e63('0x76'),_0x5e63('0x77')],'raw':!![]});}return null;})[_0x5e63('0x22')](function(_0x374873){if(!_0x374873)return null;_0x287122[_0x5e63('0x29')][_0x5e63('0x64')]=_0x374873;return _0x287122;})[_0x5e63('0x22')](function(_0x5d0500){if(_0x5d0500){if(_0x23d4d2[_0x5e63('0x58')][_0x5e63('0x78')]){_0x287122[_0x5e63('0x29')][_0x5e63('0x79')]=util[_0x5e63('0x60')](_0x5e63('0x7a'),_0x23d4d2[_0x5e63('0x63')]['name']);_0x287122[_0x5e63('0x29')][_0x5e63('0x7b')]=_0x287122[_0x5e63('0x7b')];_0x287122[_0x5e63('0x29')][_0x5e63('0x7c')]=_0x287122[_0x5e63('0x7b')];_0x287122[_0x5e63('0x29')]['event']=_0x5e63('0x7d');return respondWithRpcPromise(_0x5e63('0x7e'),'EventManager',{'event':_0x5e63('0x7f'),'message':_0x287122[_0x5e63('0x29')]},client9002)[_0x5e63('0x22')](function(){return _0x287122;});}return _0x287122;}return null;})[_0x5e63('0x22')](respondWithResult(_0x2b6cc6,null))['catch'](handleError(_0x2b6cc6,null));};var interaction_log=require(_0x5e63('0x5b'))(_0x5e63('0x5c'));exports['reject']=function(_0x575c6f,_0x386448,_0x263b85){var _0x34bfa2={'agent':{},'channel':_0x5e63('0x5d')};if(_0x575c6f[_0x5e63('0x58')]['id']){delete _0x575c6f['body']['id'];}_0x575c6f[_0x5e63('0x58')][_0x5e63('0x62')]=_0x575c6f['body'][_0x5e63('0x62')]||_0x575c6f[_0x5e63('0x63')]['id'];_0x34bfa2[_0x5e63('0x64')]['id']=_0x575c6f['body'][_0x5e63('0x62')];return db['SmsMessage'][_0x5e63('0x65')]({'where':{'id':_0x575c6f['params']['id'],'UserId':null}})[_0x5e63('0x22')](handleEntityNotFound(_0x386448,null))[_0x5e63('0x22')](function(_0x4d59c8){if(_0x4d59c8){_0x34bfa2[_0x5e63('0x29')]=_0x4d59c8[_0x5e63('0x66')]({'plain':!![]});return db[_0x5e63('0x67')][_0x5e63('0x65')]({'where':{'id':_0x4d59c8[_0x5e63('0x68')]}});}return null;})[_0x5e63('0x22')](handleEntityNotFound(_0x386448,null))[_0x5e63('0x22')](function(_0x191af6){if(_0x191af6){_0x34bfa2[_0x5e63('0x6a')]=_0x191af6['get']({'plain':!![]});interaction_log[_0x5e63('0x23')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x575c6f[_0x5e63('0x63')]['id'],_0x575c6f[_0x5e63('0x63')][_0x5e63('0x3a')],_0x575c6f['user'][_0x5e63('0x6b')],_0x34bfa2[_0x5e63('0x6a')]['id'],_0x575c6f[_0x5e63('0x58')]?JSON['stringify'](_0x575c6f[_0x5e63('0x58')]):_0x5e63('0x6c'));return respondWithRpcPromise(_0x5e63('0x80'),_0x5e63('0x81'),_0x34bfa2);}return null;})[_0x5e63('0x22')](function(_0x3551af){var _0x218124=_0x5e63('0x6e')+_0x3551af[_0x5e63('0x29')]['ContactId'];return db['sequelize']['query'](_0x218124,{'type':db['Sequelize'][_0x5e63('0x71')][_0x5e63('0x72')],'raw':!![]})[_0x5e63('0x22')](function(_0xa6c091){return _0xa6c091;});})[_0x5e63('0x22')](function(_0x62d64a){if(_0x62d64a){_0x34bfa2[_0x5e63('0x29')]['contact']=_0x62d64a[0x0];if(!_0x575c6f[_0x5e63('0x58')][_0x5e63('0x62')])return;return db[_0x5e63('0x74')][_0x5e63('0x65')]({'where':{'id':_0x575c6f[_0x5e63('0x58')][_0x5e63('0x62')],'role':_0x5e63('0x64')},'attributes':['id','name',_0x5e63('0x75'),_0x5e63('0x76'),_0x5e63('0x77')],'raw':!![]});}return null;})[_0x5e63('0x22')](function(_0x179fdd){if(!_0x179fdd)return null;_0x34bfa2['message'][_0x5e63('0x64')]=_0x179fdd;return _0x34bfa2;})['then'](function(_0x2faadb){if(_0x2faadb){_0x2faadb['message'][_0x5e63('0x79')]=util[_0x5e63('0x60')]('SIP/%s',_0x575c6f[_0x5e63('0x63')][_0x5e63('0x3a')]);_0x2faadb[_0x5e63('0x29')][_0x5e63('0x7b')]=_0x34bfa2[_0x5e63('0x7b')];_0x2faadb[_0x5e63('0x29')][_0x5e63('0x7c')]=_0x34bfa2[_0x5e63('0x7b')];_0x2faadb[_0x5e63('0x29')][_0x5e63('0x82')]=_0x5e63('0x35');respondWithRpcPromise(_0x5e63('0x7e'),_0x5e63('0x7e'),{'event':_0x5e63('0x83'),'message':_0x2faadb[_0x5e63('0x29')]},client9002);return _0x34bfa2;}return null;})['then'](respondWithResult(_0x386448,null))['catch'](handleError(_0x386448,null));};exports['status']=function(_0x245c32,_0x50e157,_0x1005cf){if(_0x245c32[_0x5e63('0x58')]['id']){delete _0x245c32[_0x5e63('0x58')]['id'];}var _0x2c341f;return db[_0x5e63('0x3c')][_0x5e63('0x65')]({'where':{'id':_0x245c32[_0x5e63('0x55')]['id']}})[_0x5e63('0x22')](handleEntityNotFound(_0x50e157,null))[_0x5e63('0x22')](function(_0x53cee8){if(_0x53cee8){_0x2c341f=_0x53cee8;return db['SmsAccount'][_0x5e63('0x65')]({'where':{'id':_0x53cee8[_0x5e63('0x84')]}});}})[_0x5e63('0x22')](handleEntityNotFound(_0x50e157,null))[_0x5e63('0x22')](function(_0x5b0b9f){if(_0x5b0b9f){logger[_0x5e63('0x25')](_0x5e63('0x85'),_0x5e63('0x2c'),'received\x20delivery\x20report\x20from',_0x5b0b9f['type'],util['inspect'](_0x245c32[_0x5e63('0x58')],{'showHidden':![],'depth':null}));switch(_0x5b0b9f[_0x5e63('0x4c')]){case'twilio':if(_0x245c32[_0x5e63('0x58')]['MessageSid']&&_0x245c32[_0x5e63('0x58')][_0x5e63('0x86')]===_0x2c341f[_0x5e63('0x87')]){return _0x2c341f[_0x5e63('0x37')]({'read':!![]});}else{logger[_0x5e63('0x27')](_0x5e63('0x88'),_0x5e63('0x2c'),_0x5e63('0x89'),util[_0x5e63('0x8a')](_0x245c32[_0x5e63('0x58')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x245c32[_0x5e63('0x58')][_0x5e63('0x8b')]&&_0x245c32[_0x5e63('0x58')][_0x5e63('0x8b')]===_0x2c341f['messageId']&&_[_0x5e63('0x8c')](['sent',_0x5e63('0x8d')],_0x245c32[_0x5e63('0x58')][_0x5e63('0x8e')])>=0x0){return _0x2c341f[_0x5e63('0x37')]({'read':!![]});}else{logger[_0x5e63('0x27')](_0x5e63('0x88'),_0x5e63('0x2c'),_0x5e63('0x8f'),util['inspect'](_0x245c32[_0x5e63('0x58')],{'showHidden':![],'depth':null}));}break;case _0x5e63('0x90'):var _0x5a95dc=_0x245c32[_0x5e63('0x58')][_0x5e63('0x91')][0x0];if(_0x5a95dc['status'][_0x5e63('0x92')]===_0x5e63('0x93')){return _0x2c341f['update']({'read':!![]});}else{logger[_0x5e63('0x27')](_0x5e63('0x88'),_0x5e63('0x2c'),_0x5e63('0x90'),util[_0x5e63('0x8a')](_0x245c32['body'],{'showHidden':![],'depth':null}));}break;}return _0x2c341f;}})[_0x5e63('0x22')](respondWithResult(_0x50e157,null))[_0x5e63('0x54')](handleError(_0x50e157,null));}; \ No newline at end of file +var _0x4d07=['register','client','http','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','undefined','limit','offset','set','apply','save','update','destroy','stack','name','send','index','SmsMessage','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','filter','merge','options','count','includeAll','include','findAll','show','params','keys','intersection','fields','find','create','body','sms-interactions','sms','read','UserId','user','agent','get','SmsInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','channel','accept','EventManager','acceptmessage','SmsInteraction','RejectMessage','rejectMessage','Sequelize','event','reject','SmsAccount','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','results','DELIVERED','eml-format','zip-dir','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./smsMessage.socket'];(function(_0x139716,_0x789d39){var _0x524698=function(_0x49724d){while(--_0x49724d){_0x139716['push'](_0x139716['shift']());}};_0x524698(++_0x789d39);}(_0x4d07,0x18e));var _0x74d0=function(_0x52c4e9,_0x5412d0){_0x52c4e9=_0x52c4e9-0x0;var _0x252a03=_0x4d07[_0x52c4e9];return _0x252a03;};'use strict';var emlformat=require(_0x74d0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x74d0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x74d0('0x2'));var util=require(_0x74d0('0x3'));var path=require(_0x74d0('0x4'));var sox=require(_0x74d0('0x5'));var csv=require(_0x74d0('0x6'));var ejs=require(_0x74d0('0x7'));var fs=require('fs');var fs_extra=require(_0x74d0('0x8'));var _=require(_0x74d0('0x9'));var squel=require(_0x74d0('0xa'));var crypto=require(_0x74d0('0xb'));var jsforce=require(_0x74d0('0xc'));var deskjs=require(_0x74d0('0xd'));var toCsv=require(_0x74d0('0x6'));var querystring=require('querystring');var Papa=require(_0x74d0('0xe'));var Redis=require(_0x74d0('0xf'));var authService=require(_0x74d0('0x10'));var qs=require(_0x74d0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x74d0('0x12'));var logger=require(_0x74d0('0x13'))(_0x74d0('0x14'));var utils=require(_0x74d0('0x15'));var config=require(_0x74d0('0x16'));var licenseUtil=require(_0x74d0('0x17'));var db=require('../../mysqldb')['db'];config[_0x74d0('0x18')]=_['defaults'](config[_0x74d0('0x18')],{'host':_0x74d0('0x19'),'port':0x18eb});var socket=require(_0x74d0('0x1a'))(new Redis(config[_0x74d0('0x18')]));require(_0x74d0('0x1b'))[_0x74d0('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x74d0('0x1d')][_0x74d0('0x1e')]({'port':0x232c});var client9002=jayson[_0x74d0('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1601d5,_0x3e3dee,_0x289266,_0x5bcde9){return new BPromise(function(_0x15b452,_0x3644cb){var _0x30f605=_0x5bcde9||client;return _0x30f605[_0x74d0('0x1f')](_0x1601d5,_0x289266)[_0x74d0('0x20')](function(_0x58ba46){logger[_0x74d0('0x21')]('SmsMessage,\x20%s,\x20%s',_0x3e3dee,_0x74d0('0x22'));logger[_0x74d0('0x23')](_0x74d0('0x24'),_0x3e3dee,_0x74d0('0x22'),JSON[_0x74d0('0x25')](_0x58ba46));if(_0x58ba46[_0x74d0('0x26')]){if(_0x58ba46[_0x74d0('0x26')][_0x74d0('0x27')]===0x1f4){logger[_0x74d0('0x26')]('SmsMessage,\x20%s,\x20%s',_0x3e3dee,_0x58ba46[_0x74d0('0x26')]['message']);return _0x3644cb(_0x58ba46[_0x74d0('0x26')][_0x74d0('0x28')]);}logger[_0x74d0('0x26')](_0x74d0('0x29'),_0x3e3dee,_0x58ba46[_0x74d0('0x26')][_0x74d0('0x28')]);return _0x15b452(_0x58ba46[_0x74d0('0x26')][_0x74d0('0x28')]);}else{logger[_0x74d0('0x21')](_0x74d0('0x29'),_0x3e3dee,_0x74d0('0x22'));_0x15b452(_0x58ba46[_0x74d0('0x2a')][_0x74d0('0x28')]);}})[_0x74d0('0x2b')](function(_0x4ed251){logger[_0x74d0('0x26')](_0x74d0('0x29'),_0x3e3dee,_0x4ed251);_0x3644cb(_0x4ed251);});});}function respondWithStatusCode(_0x2e0379,_0x319156){_0x319156=_0x319156||0xcc;return function(_0x6fbcba){if(_0x6fbcba){return _0x2e0379[_0x74d0('0x2c')](_0x319156);}return _0x2e0379[_0x74d0('0x2d')](_0x319156)[_0x74d0('0x2e')]();};}function respondWithResult(_0x34df7a,_0x5a3406){_0x5a3406=_0x5a3406||0xc8;return function(_0x48c495){if(_0x48c495){return _0x34df7a[_0x74d0('0x2d')](_0x5a3406)['json'](_0x48c495);}};}function respondWithFilteredResult(_0x18b4fd,_0x261fc6){return function(_0x2d9880){if(_0x2d9880){var _0x4c18d9=typeof _0x261fc6['offset']===_0x74d0('0x2f')&&typeof _0x261fc6[_0x74d0('0x30')]===_0x74d0('0x2f');var _0x5eda40=_0x2d9880['count'];var _0x9c0ee4=_0x4c18d9?0x0:_0x261fc6[_0x74d0('0x31')];var _0x38c7f0=_0x4c18d9?_0x2d9880['count']:_0x261fc6[_0x74d0('0x31')]+_0x261fc6[_0x74d0('0x30')];var _0x39b0dd;if(_0x38c7f0>=_0x5eda40){_0x38c7f0=_0x5eda40;_0x39b0dd=0xc8;}else{_0x39b0dd=0xce;}_0x18b4fd[_0x74d0('0x2d')](_0x39b0dd);return _0x18b4fd[_0x74d0('0x32')]('Content-Range',_0x9c0ee4+'-'+_0x38c7f0+'/'+_0x5eda40)['json'](_0x2d9880);}return null;};}function patchUpdates(_0x1bb302){return function(_0x2081da){try{jsonpatch[_0x74d0('0x33')](_0x2081da,_0x1bb302,!![]);}catch(_0x1beeb1){return BPromise['reject'](_0x1beeb1);}return _0x2081da[_0x74d0('0x34')]();};}function saveUpdates(_0x4864fe,_0x1959d8){return function(_0x31f662){if(_0x31f662){return _0x31f662[_0x74d0('0x35')](_0x4864fe)[_0x74d0('0x20')](function(_0x1ecea5){return _0x1ecea5;});}return null;};}function removeEntity(_0x38e706,_0x1cec93){return function(_0x18df4b){if(_0x18df4b){return _0x18df4b[_0x74d0('0x36')]()[_0x74d0('0x20')](function(){_0x38e706[_0x74d0('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29ac7a,_0x15dc9d){return function(_0x3b2944){if(!_0x3b2944){_0x29ac7a[_0x74d0('0x2c')](0x194);}return _0x3b2944;};}function handleError(_0x4684a5,_0x30a67e){_0x30a67e=_0x30a67e||0x1f4;return function(_0x876cd2){logger[_0x74d0('0x26')](_0x876cd2[_0x74d0('0x37')]);if(_0x876cd2[_0x74d0('0x38')]){delete _0x876cd2['name'];}_0x4684a5[_0x74d0('0x2d')](_0x30a67e)[_0x74d0('0x39')](_0x876cd2);};}exports[_0x74d0('0x3a')]=function(_0x4a95a4,_0x561480){var _0x274077={},_0x1bf588={},_0x59e91c={'count':0x0,'rows':[]};var _0x463a0e=_['map'](db[_0x74d0('0x3b')][_0x74d0('0x3c')],function(_0x43c894){return{'name':_0x43c894[_0x74d0('0x3d')],'type':_0x43c894[_0x74d0('0x3e')][_0x74d0('0x3f')]};});_0x1bf588[_0x74d0('0x40')]=_[_0x74d0('0x41')](_0x463a0e,_0x74d0('0x38'));_0x1bf588[_0x74d0('0x42')]=_['keys'](_0x4a95a4[_0x74d0('0x42')]);_0x1bf588[_0x74d0('0x43')]=_['intersection'](_0x1bf588['model'],_0x1bf588['query']);_0x274077[_0x74d0('0x44')]=_['intersection'](_0x1bf588[_0x74d0('0x40')],qs['fields'](_0x4a95a4[_0x74d0('0x42')]['fields']));_0x274077[_0x74d0('0x44')]=_0x274077['attributes'][_0x74d0('0x45')]?_0x274077['attributes']:_0x1bf588[_0x74d0('0x40')];if(!_0x4a95a4[_0x74d0('0x42')][_0x74d0('0x46')](_0x74d0('0x47'))){_0x274077['limit']=qs['limit'](_0x4a95a4[_0x74d0('0x42')]['limit']);_0x274077[_0x74d0('0x31')]=qs[_0x74d0('0x31')](_0x4a95a4[_0x74d0('0x42')][_0x74d0('0x31')]);}_0x274077[_0x74d0('0x48')]=qs['sort'](_0x4a95a4[_0x74d0('0x42')][_0x74d0('0x49')]);_0x274077['where']=qs[_0x74d0('0x43')](_[_0x74d0('0x4a')](_0x4a95a4[_0x74d0('0x42')],_0x1bf588[_0x74d0('0x43')]),_0x463a0e);if(_0x4a95a4[_0x74d0('0x42')]['filter']){_0x274077['where']=_['merge'](_0x274077[_0x74d0('0x4b')],{'$or':_[_0x74d0('0x41')](_0x463a0e,function(_0x41fade){if(_0x41fade[_0x74d0('0x3e')]!=='VIRTUAL'){var _0x5f3bd8={};_0x5f3bd8[_0x41fade[_0x74d0('0x38')]]={'$like':'%'+_0x4a95a4[_0x74d0('0x42')][_0x74d0('0x4c')]+'%'};return _0x5f3bd8;}})});}_0x274077=_[_0x74d0('0x4d')]({},_0x274077,_0x4a95a4[_0x74d0('0x4e')]);var _0x3b05c9={'where':_0x274077[_0x74d0('0x4b')]};return db['SmsMessage'][_0x74d0('0x4f')](_0x3b05c9)['then'](function(_0x4f279c){_0x59e91c[_0x74d0('0x4f')]=_0x4f279c;if(_0x4a95a4['query'][_0x74d0('0x50')]){_0x274077[_0x74d0('0x51')]=[{'all':!![]}];}return db[_0x74d0('0x3b')][_0x74d0('0x52')](_0x274077);})[_0x74d0('0x20')](function(_0x47ccce){_0x59e91c['rows']=_0x47ccce;return _0x59e91c;})['then'](respondWithFilteredResult(_0x561480,_0x274077))[_0x74d0('0x2b')](handleError(_0x561480,null));};exports[_0x74d0('0x53')]=function(_0x26975e,_0x3fdd62){var _0x507f79={'raw':!![],'where':{'id':_0x26975e[_0x74d0('0x54')]['id']}},_0x1374e4={};_0x1374e4[_0x74d0('0x40')]=_[_0x74d0('0x55')](db[_0x74d0('0x3b')]['rawAttributes']);_0x1374e4[_0x74d0('0x42')]=_[_0x74d0('0x55')](_0x26975e['query']);_0x1374e4[_0x74d0('0x43')]=_[_0x74d0('0x56')](_0x1374e4[_0x74d0('0x40')],_0x1374e4[_0x74d0('0x42')]);_0x507f79[_0x74d0('0x44')]=_['intersection'](_0x1374e4[_0x74d0('0x40')],qs[_0x74d0('0x57')](_0x26975e[_0x74d0('0x42')][_0x74d0('0x57')]));_0x507f79[_0x74d0('0x44')]=_0x507f79[_0x74d0('0x44')][_0x74d0('0x45')]?_0x507f79[_0x74d0('0x44')]:_0x1374e4['model'];if(_0x26975e[_0x74d0('0x42')][_0x74d0('0x50')]){_0x507f79['include']=[{'all':!![]}];}_0x507f79=_['merge']({},_0x507f79,_0x26975e['options']);return db['SmsMessage'][_0x74d0('0x58')](_0x507f79)[_0x74d0('0x20')](handleEntityNotFound(_0x3fdd62,null))[_0x74d0('0x20')](respondWithResult(_0x3fdd62,null))[_0x74d0('0x2b')](handleError(_0x3fdd62,null));};exports[_0x74d0('0x59')]=function(_0x14584a,_0x38a767){return db['SmsMessage'][_0x74d0('0x59')](_0x14584a['body'],{})[_0x74d0('0x20')](respondWithResult(_0x38a767,0xc9))['catch'](handleError(_0x38a767,null));};exports[_0x74d0('0x35')]=function(_0x3e2baf,_0x29d836){if(_0x3e2baf[_0x74d0('0x5a')]['id']){delete _0x3e2baf[_0x74d0('0x5a')]['id'];}return db[_0x74d0('0x3b')][_0x74d0('0x58')]({'where':{'id':_0x3e2baf[_0x74d0('0x54')]['id']}})[_0x74d0('0x20')](handleEntityNotFound(_0x29d836,null))[_0x74d0('0x20')](saveUpdates(_0x3e2baf[_0x74d0('0x5a')],null))[_0x74d0('0x20')](respondWithResult(_0x29d836,null))[_0x74d0('0x2b')](handleError(_0x29d836,null));};exports[_0x74d0('0x36')]=function(_0x3f440f,_0x539b20){return db[_0x74d0('0x3b')][_0x74d0('0x58')]({'where':{'id':_0x3f440f[_0x74d0('0x54')]['id']}})[_0x74d0('0x20')](handleEntityNotFound(_0x539b20,null))[_0x74d0('0x20')](removeEntity(_0x539b20,null))[_0x74d0('0x2b')](handleError(_0x539b20,null));};exports['describe']=function(_0x1204be,_0x518ab3){return db['SmsMessage']['describe']()['then'](respondWithResult(_0x518ab3,null))['catch'](handleError(_0x518ab3,null));};var interaction_log=require(_0x74d0('0x13'))(_0x74d0('0x5b'));exports['accept']=function(_0xe2d6f9,_0x2161b3,_0x434dae){var _0x59034f={'agent':{},'channel':_0x74d0('0x5c')};if(_0xe2d6f9['body']['id']){delete _0xe2d6f9[_0x74d0('0x5a')]['id'];}_0xe2d6f9[_0x74d0('0x5a')][_0x74d0('0x5d')]=!![];_0xe2d6f9['body']['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xe2d6f9[_0x74d0('0x5a')][_0x74d0('0x5e')]=_0xe2d6f9[_0x74d0('0x5a')]['UserId']||_0xe2d6f9[_0x74d0('0x5f')]['id'];_0x59034f[_0x74d0('0x60')]['id']=_0xe2d6f9[_0x74d0('0x5a')][_0x74d0('0x5e')];return db[_0x74d0('0x3b')][_0x74d0('0x58')]({'where':{'id':_0xe2d6f9[_0x74d0('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2161b3,null))[_0x74d0('0x20')](saveUpdates(_0xe2d6f9[_0x74d0('0x5a')],null))[_0x74d0('0x20')](function(_0x212d44){if(_0x212d44){_0x59034f[_0x74d0('0x28')]=_0x212d44[_0x74d0('0x61')]({'plain':!![]});return db['SmsInteraction'][_0x74d0('0x58')]({'where':{'id':_0x212d44[_0x74d0('0x62')]}});}return null;})[_0x74d0('0x20')](handleEntityNotFound(_0x2161b3,null))[_0x74d0('0x20')](function(_0x5c2b6b){if(_0x5c2b6b){return _0x5c2b6b[_0x74d0('0x35')]({'UserId':_0xe2d6f9[_0x74d0('0x5a')]['UserId'],'read1stAt':_['isNil'](_0x5c2b6b[_0x74d0('0x63')])?moment()['format'](_0x74d0('0x64')):undefined});}return null;})['then'](function(_0x254c6f){if(_0x254c6f){_0x59034f[_0x74d0('0x65')]=_0x254c6f[_0x74d0('0x61')]({'plain':!![]});interaction_log['info'](_0x74d0('0x66'),_0xe2d6f9[_0x74d0('0x5f')]['id'],_0xe2d6f9[_0x74d0('0x5f')]['name'],_0xe2d6f9[_0x74d0('0x5f')]['role'],_0x59034f['interaction']['id'],_0xe2d6f9['body']?JSON[_0x74d0('0x25')](_0xe2d6f9[_0x74d0('0x5a')]):_0x74d0('0x67'));return respondWithRpcPromise(_0x74d0('0x68'),_0x74d0('0x69'),_0x59034f);}return null;})[_0x74d0('0x20')](function(_0x2d556c){var _0xed17bd=_0x74d0('0x6a')+_0x2d556c[_0x74d0('0x28')][_0x74d0('0x6b')];return db['sequelize'][_0x74d0('0x42')](_0xed17bd,{'type':db['Sequelize'][_0x74d0('0x6c')][_0x74d0('0x6d')],'raw':!![]})[_0x74d0('0x20')](function(_0x57f110){return _0x57f110;});})['then'](function(_0x369cf8){if(_0x369cf8){_0x59034f['message'][_0x74d0('0x6e')]=_0x369cf8[0x0];if(!_0xe2d6f9[_0x74d0('0x5a')][_0x74d0('0x5e')])return;return db[_0x74d0('0x6f')][_0x74d0('0x58')]({'where':{'id':_0xe2d6f9[_0x74d0('0x5a')]['UserId'],'role':_0x74d0('0x60')},'attributes':['id','name',_0x74d0('0x70'),_0x74d0('0x71'),_0x74d0('0x72')],'raw':!![]});}return null;})[_0x74d0('0x20')](function(_0x4aa908){if(!_0x4aa908)return null;_0x59034f[_0x74d0('0x28')]['agent']=_0x4aa908;return _0x59034f;})['then'](function(_0xccadbd){if(_0xccadbd){if(_0xe2d6f9['body'][_0x74d0('0x73')]){_0x59034f[_0x74d0('0x28')][_0x74d0('0x74')]=util['format']('SIP/%s',_0xe2d6f9[_0x74d0('0x5f')][_0x74d0('0x38')]);_0x59034f[_0x74d0('0x28')][_0x74d0('0x75')]=_0x59034f[_0x74d0('0x75')];_0x59034f['message']['motionChannel']=_0x59034f[_0x74d0('0x75')];_0x59034f[_0x74d0('0x28')]['event']=_0x74d0('0x76');return respondWithRpcPromise(_0x74d0('0x77'),'EventManager',{'event':_0x74d0('0x78'),'message':_0x59034f[_0x74d0('0x28')]},client9002)['then'](function(){return _0x59034f;});}return _0x59034f;}return null;})[_0x74d0('0x20')](respondWithResult(_0x2161b3,null))[_0x74d0('0x2b')](handleError(_0x2161b3,null));};var interaction_log=require(_0x74d0('0x13'))(_0x74d0('0x5b'));exports['reject']=function(_0x135703,_0x51b221,_0xc317b2){var _0x1fbf60={'agent':{},'channel':_0x74d0('0x5c')};if(_0x135703['body']['id']){delete _0x135703[_0x74d0('0x5a')]['id'];}_0x135703['body'][_0x74d0('0x5e')]=_0x135703[_0x74d0('0x5a')][_0x74d0('0x5e')]||_0x135703[_0x74d0('0x5f')]['id'];_0x1fbf60[_0x74d0('0x60')]['id']=_0x135703[_0x74d0('0x5a')][_0x74d0('0x5e')];return db[_0x74d0('0x3b')][_0x74d0('0x58')]({'where':{'id':_0x135703[_0x74d0('0x54')]['id'],'UserId':null}})[_0x74d0('0x20')](handleEntityNotFound(_0x51b221,null))['then'](function(_0x27496a){if(_0x27496a){_0x1fbf60[_0x74d0('0x28')]=_0x27496a[_0x74d0('0x61')]({'plain':!![]});return db[_0x74d0('0x79')][_0x74d0('0x58')]({'where':{'id':_0x27496a['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x51b221,null))[_0x74d0('0x20')](function(_0x416dd4){if(_0x416dd4){_0x1fbf60[_0x74d0('0x65')]=_0x416dd4[_0x74d0('0x61')]({'plain':!![]});interaction_log[_0x74d0('0x21')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x135703['user']['id'],_0x135703[_0x74d0('0x5f')][_0x74d0('0x38')],_0x135703[_0x74d0('0x5f')]['role'],_0x1fbf60['interaction']['id'],_0x135703[_0x74d0('0x5a')]?JSON[_0x74d0('0x25')](_0x135703[_0x74d0('0x5a')]):'null');return respondWithRpcPromise(_0x74d0('0x7a'),_0x74d0('0x7b'),_0x1fbf60);}return null;})['then'](function(_0x27c944){var _0x7a33c5=_0x74d0('0x6a')+_0x27c944[_0x74d0('0x28')]['ContactId'];return db['sequelize'][_0x74d0('0x42')](_0x7a33c5,{'type':db[_0x74d0('0x7c')]['QueryTypes'][_0x74d0('0x6d')],'raw':!![]})[_0x74d0('0x20')](function(_0x35469a){return _0x35469a;});})[_0x74d0('0x20')](function(_0x16c553){if(_0x16c553){_0x1fbf60[_0x74d0('0x28')][_0x74d0('0x6e')]=_0x16c553[0x0];if(!_0x135703[_0x74d0('0x5a')][_0x74d0('0x5e')])return;return db[_0x74d0('0x6f')][_0x74d0('0x58')]({'where':{'id':_0x135703['body'][_0x74d0('0x5e')],'role':_0x74d0('0x60')},'attributes':['id',_0x74d0('0x38'),_0x74d0('0x70'),_0x74d0('0x71'),_0x74d0('0x72')],'raw':!![]});}return null;})[_0x74d0('0x20')](function(_0x2ec125){if(!_0x2ec125)return null;_0x1fbf60[_0x74d0('0x28')]['agent']=_0x2ec125;return _0x1fbf60;})['then'](function(_0x48b3ba){if(_0x48b3ba){_0x48b3ba['message'][_0x74d0('0x74')]=util['format']('SIP/%s',_0x135703[_0x74d0('0x5f')]['name']);_0x48b3ba['message'][_0x74d0('0x75')]=_0x1fbf60[_0x74d0('0x75')];_0x48b3ba['message']['motionChannel']=_0x1fbf60['channel'];_0x48b3ba[_0x74d0('0x28')][_0x74d0('0x7d')]=_0x74d0('0x7e');respondWithRpcPromise('EventManager',_0x74d0('0x77'),{'event':'rejectmessage','message':_0x48b3ba[_0x74d0('0x28')]},client9002);return _0x1fbf60;}return null;})[_0x74d0('0x20')](respondWithResult(_0x51b221,null))[_0x74d0('0x2b')](handleError(_0x51b221,null));};exports['status']=function(_0x33bd80,_0x177be9,_0x21654e){if(_0x33bd80[_0x74d0('0x5a')]['id']){delete _0x33bd80['body']['id'];}var _0x4d5961;return db[_0x74d0('0x3b')][_0x74d0('0x58')]({'where':{'id':_0x33bd80[_0x74d0('0x54')]['id']}})[_0x74d0('0x20')](handleEntityNotFound(_0x177be9,null))[_0x74d0('0x20')](function(_0x51f6e8){if(_0x51f6e8){_0x4d5961=_0x51f6e8;return db[_0x74d0('0x7f')][_0x74d0('0x58')]({'where':{'id':_0x51f6e8['SmsAccountId']}});}})[_0x74d0('0x20')](handleEntityNotFound(_0x177be9,null))[_0x74d0('0x20')](function(_0x54e594){if(_0x54e594){logger[_0x74d0('0x23')](_0x74d0('0x24'),_0x74d0('0x2d'),'received\x20delivery\x20report\x20from',_0x54e594[_0x74d0('0x3e')],util[_0x74d0('0x80')](_0x33bd80[_0x74d0('0x5a')],{'showHidden':![],'depth':null}));switch(_0x54e594[_0x74d0('0x3e')]){case _0x74d0('0x81'):if(_0x33bd80[_0x74d0('0x5a')][_0x74d0('0x82')]&&_0x33bd80[_0x74d0('0x5a')]['MessageSid']===_0x4d5961[_0x74d0('0x83')]){return _0x4d5961[_0x74d0('0x35')]({'read':!![]});}else{logger[_0x74d0('0x26')](_0x74d0('0x84'),'status',_0x74d0('0x81'),util[_0x74d0('0x80')](_0x33bd80[_0x74d0('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x74d0('0x85'):if(_0x33bd80['body'][_0x74d0('0x86')]&&_0x33bd80[_0x74d0('0x5a')][_0x74d0('0x86')]===_0x4d5961[_0x74d0('0x83')]&&_[_0x74d0('0x87')]([_0x74d0('0x88'),_0x74d0('0x89')],_0x33bd80[_0x74d0('0x5a')][_0x74d0('0x8a')])>=0x0){return _0x4d5961[_0x74d0('0x35')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x74d0('0x8b'),util[_0x74d0('0x80')](_0x33bd80[_0x74d0('0x5a')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x13118a=_0x33bd80[_0x74d0('0x5a')][_0x74d0('0x8c')][0x0];if(_0x13118a[_0x74d0('0x2d')]['groupName']===_0x74d0('0x8d')){return _0x4d5961[_0x74d0('0x35')]({'read':!![]});}else{logger[_0x74d0('0x26')](_0x74d0('0x84'),_0x74d0('0x2d'),'infobip',util[_0x74d0('0x80')](_0x33bd80['body'],{'showHidden':![],'depth':null}));}break;}return _0x4d5961;}})[_0x74d0('0x20')](respondWithResult(_0x177be9,null))['catch'](handleError(_0x177be9,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 2f5300c..125c2f3 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 _0x64cc=['../../mysqldb','update','emit','hasOwnProperty','hook','events'];(function(_0x328069,_0x9bf0e){var _0x1ed57b=function(_0x2303f5){while(--_0x2303f5){_0x328069['push'](_0x328069['shift']());}};_0x1ed57b(++_0x9bf0e);}(_0x64cc,0x107));var _0xc64c=function(_0x4298d3,_0x22fe96){_0x4298d3=_0x4298d3-0x0;var _0x351a5c=_0x64cc[_0x4298d3];return _0x351a5c;};'use strict';var EventEmitter=require(_0xc64c('0x0'));var SmsMessage=require(_0xc64c('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc64c('0x2'),'afterDestroy':'remove'};function emitEvent(_0x8dacac){return function(_0x14e583,_0x13e846,_0x8aa7b){SmsMessageEvents[_0xc64c('0x3')](_0x8dacac+':'+_0x14e583['id'],_0x14e583);SmsMessageEvents['emit'](_0x8dacac,_0x14e583);_0x8aa7b(null);};}for(var e in events){if(events[_0xc64c('0x4')](e)){var event=events[e];SmsMessage[_0xc64c('0x5')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xf22b=['exports','events','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x25bcf5,_0x2ee817){var _0x5c22af=function(_0x6316){while(--_0x6316){_0x25bcf5['push'](_0x25bcf5['shift']());}};_0x5c22af(++_0x2ee817);}(_0xf22b,0x174));var _0xbf22=function(_0x3fa37f,_0x397f16){_0x3fa37f=_0x3fa37f-0x0;var _0x5a01d5=_0xf22b[_0x3fa37f];return _0x5a01d5;};'use strict';var EventEmitter=require(_0xbf22('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xbf22('0x1')](0x0);var events={'afterCreate':_0xbf22('0x2'),'afterUpdate':'update','afterDestroy':_0xbf22('0x3')};function emitEvent(_0x4cdf6e){return function(_0x3bc148,_0x99aa25,_0x544ebe){SmsMessageEvents[_0xbf22('0x4')](_0x4cdf6e+':'+_0x3bc148['id'],_0x3bc148);SmsMessageEvents['emit'](_0x4cdf6e,_0x3bc148);_0x544ebe(null);};}for(var e in events){if(events[_0xbf22('0x5')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xbf22('0x6')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index a5f6a42..8d6db43 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 _0x6fbe=['format','Basic\x20%s','toString','base64','http_code','data','queued_count','head','clickSend','Missing\x20parameters:\x20username,\x20password','senderString','/status?token=','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','apiKey','login','sender','text','timestamp','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','intelepeer','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','Token\x20not\x20received','finally','util','../../config/logger','api','moment','path','./smsMessage.attributes','exports','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','login?username=','&password=','GET','sms','session_key','total_sent','internal_order_id','POST','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','read','connectel','Missing\x20parameters:\x20authToken','clicksend','%s:%s'];(function(_0x436f7c,_0x260e89){var _0x2554e3=function(_0x21f5aa){while(--_0x21f5aa){_0x436f7c['push'](_0x436f7c['shift']());}};_0x2554e3(++_0x260e89);}(_0x6fbe,0x1a3));var _0xe6fb=function(_0x150122,_0x2f7e52){_0x150122=_0x150122-0x0;var _0x274f91=_0x6fbe[_0x150122];return _0x274f91;};'use strict';var _=require('lodash');var util=require(_0xe6fb('0x0'));var logger=require(_0xe6fb('0x1'))(_0xe6fb('0x2'));var moment=require(_0xe6fb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe6fb('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe6fb('0x5'));module[_0xe6fb('0x6')]=function(_0x15345e,_0x1c889a){return _0x15345e[_0xe6fb('0x7')](_0xe6fb('0x8'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xe6fb('0x9'),'fields':[_0xe6fb('0x9')]},{'name':_0xe6fb('0xa'),'fields':[_0xe6fb('0xb')],'type':_0xe6fb('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x8d28af,_0x1e2f31,_0x31a9a3){var _0x3a406a=_0x15345e[_0xe6fb('0xd')];var _0x24d90d=_0x8d28af[_0xe6fb('0xe')]({'plain':!![]});if(_0x24d90d[_0xe6fb('0xf')][_0xe6fb('0x10')]()==='in'||_0x24d90d[_0xe6fb('0xf')][_0xe6fb('0x10')]()===_0xe6fb('0x11')&&!_0x24d90d[_0xe6fb('0x12')]&&!_[_0xe6fb('0x13')](_0x24d90d[_0xe6fb('0x14')])&&!_['isNil'](_0x24d90d[_0xe6fb('0x15')])){_0x3a406a['SmsInteraction']['findOne']({'where':{'id':_0x24d90d['SmsInteractionId']}})['then'](function(_0x24f08a){if(_0x24f08a){_0x24f08a[_0xe6fb('0x16')]({'lastMsgAt':_0x24d90d[_0xe6fb('0x17')],'lastMsgDirection':_0x24d90d['direction'][_0xe6fb('0x10')]()});}})[_0xe6fb('0x18')](function(_0x223968){console[_0xe6fb('0x19')](_0x223968);});}if(_0x24d90d[_0xe6fb('0xf')]===_0xe6fb('0x11')&&!_0x24d90d[_0xe6fb('0x12')]){var _0x53e5aa;_0x3a406a[_0xe6fb('0x1a')][_0xe6fb('0x1b')]({'where':{'id':_0x24d90d[_0xe6fb('0x1c')]},'raw':!![]})[_0xe6fb('0x1d')](function(_0x36ce25){_0x53e5aa=_0x36ce25;if(_0x53e5aa&&_0x53e5aa[_0xe6fb('0x1e')]){switch(_0x53e5aa[_0xe6fb('0x1e')]){case _0xe6fb('0x1f'):var _0x272b5c=require(_0xe6fb('0x1f'));if(_0x53e5aa[_0xe6fb('0x20')]&&_0x53e5aa[_0xe6fb('0x21')]&&_0x53e5aa[_0xe6fb('0x22')]){var _0x5a1fbf=new _0x272b5c(_0x53e5aa['accountSid'],_0x53e5aa['authToken']);_0x5a1fbf[_0xe6fb('0x23')][_0xe6fb('0x24')]({'body':_0x24d90d[_0xe6fb('0xb')],'to':_0x24d90d[_0xe6fb('0x22')],'from':_0x53e5aa[_0xe6fb('0x22')],'statusCallback':_0x53e5aa[_0xe6fb('0x25')]+_0xe6fb('0x26')+_0x24d90d['id']+'/status?token='+_0x53e5aa[_0xe6fb('0x27')]})[_0xe6fb('0x1d')](function(_0x3f804e){if(_0x3f804e[_0xe6fb('0x28')]){return _0x8d28af['update']({'messageId':_0x3f804e[_0xe6fb('0x28')]});}})[_0xe6fb('0x18')](function(_0x4f39b5){logger['error'](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x1f'),util[_0xe6fb('0x2b')](_0x4f39b5,{'showHidden':![],'depth':null}));});}else{logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x1f'),_0xe6fb('0x2c'));}break;case _0xe6fb('0x2d'):var _0x3ea8aa='https://api.skebby.it/API/v1.0/REST/';if(_0x53e5aa[_0xe6fb('0x2e')]&&_0x53e5aa[_0xe6fb('0x2f')]){var _0x4a644a={'recipient':[_0x24d90d['phone']],'message':_0x24d90d[_0xe6fb('0xb')],'message_type':_0x53e5aa[_0xe6fb('0x30')]};if(_0x53e5aa['smsMethod']&&_0x53e5aa['smsMethod']!=='SI'){_0x4a644a['sender']=_0x53e5aa[_0xe6fb('0x22')];}var _0x4b9865={'url':_0x3ea8aa+_0xe6fb('0x31')+_0x53e5aa['username']+_0xe6fb('0x32')+_0x53e5aa[_0xe6fb('0x2f')],'method':_0xe6fb('0x33')};rp(_0x4b9865)[_0xe6fb('0x1d')](function(_0x5a89ed){var _0x1a5c83=_0x5a89ed['split'](';');var _0xe1d8ba={'user_key':_0x1a5c83[0x0],'session_key':_0x1a5c83[0x1]};_0x4b9865={'url':_0x3ea8aa+_0xe6fb('0x34'),'method':'POST','headers':{'user_key':_0xe1d8ba['user_key'],'Session_key':_0xe1d8ba[_0xe6fb('0x35')]},'json':!![],'body':_0x4a644a};return rp(_0x4b9865);})[_0xe6fb('0x1d')](function(_0xc9164f){if(_0xc9164f[_0xe6fb('0x36')]>=0x1){var _0x4735d2={'messageId':_0xc9164f[_0xe6fb('0x37')]};if(_0x53e5aa[_0xe6fb('0x30')]!=='GP'||!_0x53e5aa['deliveryReport']){_0x4735d2['read']=!![];}return _0x8d28af['update'](_0x4735d2);}else{return logger[_0xe6fb('0x19')](_0xe6fb('0x29'),'afterCreate',_0xe6fb('0x2d'),util[_0xe6fb('0x2b')](_0xc9164f,{'showHidden':![],'depth':null}));}})[_0xe6fb('0x18')](function(_0x54abdb){return logger[_0xe6fb('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe6fb('0x2a'),_0xe6fb('0x2d'),util['inspect'](_0x54abdb,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x2d'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x53e5aa['authToken']){var _0x23d5ed={'recipient':_0x24d90d['phone'],'message':_0x24d90d['body'],'sender':_0x53e5aa['senderString']||_0x53e5aa[_0xe6fb('0x22')],'authorization':_0x53e5aa['authToken']};var _0x1e2f31={'method':_0xe6fb('0x38'),'uri':_0xe6fb('0x39'),'body':_0x23d5ed,'json':!![]};rp(_0x1e2f31)[_0xe6fb('0x1d')](function(_0x424e57){var _0x11f095={'messageId':_0x424e57[_0xe6fb('0x3a')]};if(!_0x53e5aa[_0xe6fb('0x3b')]){_0x11f095[_0xe6fb('0x3c')]=!![];}return _0x8d28af[_0xe6fb('0x16')](_0x11f095);})['catch'](function(_0x290b96){logger['error'](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x3d'),util[_0xe6fb('0x2b')](_0x290b96,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x3d'),_0xe6fb('0x3e'));}break;case _0xe6fb('0x3f'):if(_0x53e5aa[_0xe6fb('0x2e')]&&_0x53e5aa['password']){var _0x23d5ed={'messages':[{'source':'xCALLY\x20Motion','to':_0x24d90d[_0xe6fb('0x22')],'body':_0x24d90d[_0xe6fb('0xb')],'from':_0x53e5aa['senderString']||_0x53e5aa['phone']}]};var _0x5ab03b=util['format'](_0xe6fb('0x40'),_0x53e5aa[_0xe6fb('0x2e')],_0x53e5aa[_0xe6fb('0x2f')]);var _0x1e2f31={'method':_0xe6fb('0x38'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x23d5ed,'headers':{'Authorization':util[_0xe6fb('0x41')](_0xe6fb('0x42'),new Buffer(_0x5ab03b)[_0xe6fb('0x43')](_0xe6fb('0x44')))},'json':!![]};rp(_0x1e2f31)[_0xe6fb('0x1d')](function(_0x3500cc){if(_0x3500cc['http_code']>=0xc8&&_0x3500cc[_0xe6fb('0x45')]<=0xce){if(_0x3500cc['data']&&_0x3500cc[_0xe6fb('0x46')][_0xe6fb('0x47')]>0x0){var _0x4e2267=_[_0xe6fb('0x48')](_0x3500cc['data'][_0xe6fb('0x23')]);var _0x47c45f={'messageId':_0x4e2267['message_id']};if(!_0x53e5aa[_0xe6fb('0x3b')]){_0x47c45f['read']=!![];}return _0x8d28af[_0xe6fb('0x16')](_0x47c45f);}else{logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),'clickSend',util[_0xe6fb('0x2b')](_0x3500cc,{'showHidden':![],'depth':null}));}}else{logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x49'),util[_0xe6fb('0x2b')](_0x3500cc,{'showHidden':![],'depth':null}));}})[_0xe6fb('0x18')](function(_0x52927d){logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),'clickSend',util[_0xe6fb('0x2b')](_0x52927d,{'showHidden':![],'depth':null}));});}else{logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x49'),_0xe6fb('0x4a'));}break;case'plivo':if(_0x53e5aa['authId']&&_0x53e5aa['authToken']){var _0x23d5ed={'dst':_0x24d90d[_0xe6fb('0x22')],'text':_0x24d90d[_0xe6fb('0xb')],'src':_0x53e5aa[_0xe6fb('0x4b')]||_0x53e5aa[_0xe6fb('0x22')],'url':_0x53e5aa[_0xe6fb('0x25')]+_0xe6fb('0x26')+_0x24d90d['id']+_0xe6fb('0x4c')+_0x53e5aa[_0xe6fb('0x27')]};var _0x5ab03b=util[_0xe6fb('0x41')]('%s:%s',_0x53e5aa[_0xe6fb('0x4d')],_0x53e5aa[_0xe6fb('0x21')]);var _0x1e2f31={'method':_0xe6fb('0x38'),'uri':util['format'](_0xe6fb('0x4e'),_0x53e5aa[_0xe6fb('0x4d')]),'body':_0x23d5ed,'headers':{'Authorization':util[_0xe6fb('0x41')]('Basic\x20%s',new Buffer(_0x5ab03b)[_0xe6fb('0x43')]('base64'))},'json':!![]};rp(_0x1e2f31)['then'](function(_0x198e87){var _0x3447e2={'messageId':_0x198e87[_0xe6fb('0x4f')][0x0]};return _0x8d28af['update'](_0x3447e2);})[_0xe6fb('0x18')](function(_0x3eff30){logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x50'),util['inspect'](_0x3eff30,{'showHidden':![],'depth':null}));});}else{logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x50'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x53e5aa[_0xe6fb('0x2e')]&&_0x53e5aa[_0xe6fb('0x2f')]){if(_0x53e5aa[_0xe6fb('0x51')]){var _0x3c9c0e={'method':_0xe6fb('0x38'),'uri':_0x53e5aa[_0xe6fb('0x51')]+_0xe6fb('0x52'),'body':{'username':_0x53e5aa[_0xe6fb('0x2e')],'password':_0x53e5aa[_0xe6fb('0x2f')]},'json':!![]};return rp(_0x3c9c0e)[_0xe6fb('0x1d')](function(_0x26088f){var _0xd719ce={'method':_0xe6fb('0x38'),'uri':_0x53e5aa[_0xe6fb('0x51')]+_0xe6fb('0x53'),'body':{'messages':[{'from':_0x53e5aa[_0xe6fb('0x22')],'destinations':[{'to':_0x24d90d[_0xe6fb('0x22')]}],'text':_0x24d90d[_0xe6fb('0xb')],'notifyUrl':_0x53e5aa[_0xe6fb('0x25')]+_0xe6fb('0x26')+_0x24d90d['id']+_0xe6fb('0x4c')+_0x53e5aa[_0xe6fb('0x27')],'notifyContentType':_0xe6fb('0x54'),'callbackData':_0x53e5aa[_0xe6fb('0x22')]+';'+_0x24d90d['body']}]},'headers':{'Authorization':_0xe6fb('0x55')+_0x26088f[_0xe6fb('0x27')]},'json':!![]};return rp(_0xd719ce)[_0xe6fb('0x1d')](function(_0x2ebd58){if(_0x2ebd58[_0xe6fb('0x23')]){var _0x487345={'messageId':_0x2ebd58[_0xe6fb('0x23')][0x0][_0xe6fb('0x9')]};if(!_0x53e5aa['deliveryReport']){_0x487345[_0xe6fb('0x3c')]=!![];}return _0x8d28af[_0xe6fb('0x16')](_0x487345);}else{return logger[_0xe6fb('0x19')](_0xe6fb('0x29'),'afterCreate',_0xe6fb('0x56'),util['inspect'](_0x2ebd58,{'showHidden':![],'depth':null}));}});})[_0xe6fb('0x18')](function(_0x3750ef){return logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x56'),util[_0xe6fb('0x2b')](_0x3750ef,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe6fb('0x29'),'afterCreate',_0xe6fb('0x56'),_0xe6fb('0x57'));}}else{logger[_0xe6fb('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe6fb('0x2a'),_0xe6fb('0x56'),_0xe6fb('0x4a'));}break;case'csc':var _0x23d487=require('crypto');if(_0x53e5aa[_0xe6fb('0x58')]){var _0x512ffa={};_0x512ffa[_0xe6fb('0x59')]=_0x53e5aa['username'];_0x512ffa['phone']=_0x24d90d[_0xe6fb('0x22')];_0x512ffa[_0xe6fb('0x5a')]=_0x53e5aa[_0xe6fb('0x22')];_0x512ffa[_0xe6fb('0x5b')]=_0x24d90d[_0xe6fb('0xb')];_0x512ffa[_0xe6fb('0x5c')]=+new Date();var _0x5f4d28='';var _0xf775c4='';var _0x48939c=Object['keys'](_0x512ffa);_0x48939c[_0xe6fb('0x5d')]();for(var _0x11d600=0x0;_0x11d600<_0x48939c[_0xe6fb('0x5e')];_0x11d600++){if(_0x5f4d28!=''){_0x5f4d28+='&';}_0x5f4d28+=_0x48939c[_0x11d600]+'='+encodeURIComponent(_0x512ffa[_0x48939c[_0x11d600]]);_0xf775c4+=_0x512ffa[_0x48939c[_0x11d600]];}_0xf775c4+=_0x53e5aa[_0xe6fb('0x58')];_0xf775c4=_0x23d487[_0xe6fb('0x5f')](_0xe6fb('0x60'))['update'](_0xf775c4)[_0xe6fb('0x61')](_0xe6fb('0x62'));if(_0x5f4d28!==''){_0x5f4d28+='&';}_0x5f4d28+=_0xe6fb('0x63')+_0xf775c4;var _0x4b9865={'method':_0xe6fb('0x33'),'uri':_0x53e5aa['baseUrl']+_0xe6fb('0x64')+_0x5f4d28,'json':!![]};return rp(_0x4b9865)[_0xe6fb('0x1d')](function(_0x579f64){var _0x4b2504=Object['keys'](_0x579f64);if(_0x579f64[_0x4b2504[0x0]]['error']&&parseInt(_0x579f64[_0x4b2504[0x0]][_0xe6fb('0x19')])===0x0){var _0x55b322={'messageId':_0x579f64[_0x4b2504[0x0]][_0xe6fb('0x65')]};if(!_0x53e5aa[_0xe6fb('0x3b')]){_0x55b322[_0xe6fb('0x3c')]=!![];}return _0x8d28af[_0xe6fb('0x16')](_0x55b322);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe6fb('0x66'),util[_0xe6fb('0x2b')](_0x579f64[_0xe6fb('0x19')],{'showHidden':![],'depth':null}));}})[_0xe6fb('0x18')](function(_0x599bdd){return logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x66'),util[_0xe6fb('0x2b')](_0x599bdd,{'showHidden':![],'depth':null}));});}else{logger[_0xe6fb('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe6fb('0x2a'),'csc',_0xe6fb('0x67'));}break;case _0xe6fb('0x68'):if(_0x53e5aa['apiKey']){var _0x487b3d={'method':_0xe6fb('0x38'),'uri':_0xe6fb('0x69'),'headers':{'Authorization':_0x53e5aa['apiKey']},'body':{'content':_0x24d90d['body'],'to':[_0x24d90d[_0xe6fb('0x22')]],'from':_0x53e5aa[_0xe6fb('0x22')],'binary':![],'clientMessageId':_0xe6fb('0x6a'),'charset':_0xe6fb('0x6b')},'json':!![]};rp(_0x487b3d)[_0xe6fb('0x1d')](function(_0x449e9f){if(!_0x449e9f[_0xe6fb('0x19')]){var _0x5bfb9e={'messageId':_0x449e9f[_0xe6fb('0x23')][0x0]['apiMessageId']};if(!_0x53e5aa[_0xe6fb('0x3b')]){_0x5bfb9e[_0xe6fb('0x3c')]=!![];}return _0x8d28af[_0xe6fb('0x16')](_0x5bfb9e);}else{return logger[_0xe6fb('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe6fb('0x2a'),_0xe6fb('0x68'),util[_0xe6fb('0x2b')](_0x449e9f[_0xe6fb('0x19')],{'showHidden':![],'depth':null}));}})[_0xe6fb('0x18')](function(_0x558cb8){return logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x68'),util[_0xe6fb('0x2b')](_0x558cb8,{'showHidden':![],'depth':null}));});}else{logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),'clickatell',_0xe6fb('0x67'));}break;case _0xe6fb('0x6c'):if(_0x53e5aa['username']&&_0x53e5aa[_0xe6fb('0x2f')]){var _0x5ab03b=util['format'](_0xe6fb('0x40'),_0x53e5aa[_0xe6fb('0x2e')],_0x53e5aa['password']);var _0x1e2f31={'method':_0xe6fb('0x38'),'uri':_0xe6fb('0x6d')+_0x53e5aa[_0xe6fb('0x6e')]+_0xe6fb('0x6f'),'body':{'to':[_0x24d90d[_0xe6fb('0x22')]],'text':_0x24d90d[_0xe6fb('0xb')],'from':_0x53e5aa[_0xe6fb('0x22')],'applicationId':_0x53e5aa['applicationId']},'headers':{'Authorization':util[_0xe6fb('0x41')](_0xe6fb('0x42'),new Buffer(_0x5ab03b)['toString'](_0xe6fb('0x44')))},'json':!![]};rp(_0x1e2f31)[_0xe6fb('0x1d')](function(_0x57af0){if(_0x57af0['id']){var _0x41b22f={'messageId':_0x57af0['id']};return _0x8d28af['update'](_0x41b22f);}else{logger['error'](_0xe6fb('0x29'),'afterCreate',_0xe6fb('0x6c'),util['inspect'](_0x57af0,{'showHidden':![],'depth':null}));}})[_0xe6fb('0x18')](function(_0x18a215){logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x6c'),util[_0xe6fb('0x2b')](_0x18a215,{'showHidden':![],'depth':null}));});}else{logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x6c'),_0xe6fb('0x4a'));}break;case _0xe6fb('0x70'):if(_0x53e5aa[_0xe6fb('0x58')]){var _0xea73a9={};var _0x4b9865={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xe6fb('0x71')+_0x53e5aa[_0xe6fb('0x58')],'Content-Type':_0xe6fb('0x54')},'body':{'from':_0x53e5aa[_0xe6fb('0x22')],'to':_0x24d90d[_0xe6fb('0x22')],'text':_0x24d90d['body']},'json':!![]};return rp(_0x4b9865)[_0xe6fb('0x1d')](function(_0xdf156e){if(_0xdf156e[_0xe6fb('0x72')]==0xca){_0xea73a9[_0xe6fb('0x73')]=_0xdf156e;var _0x430530={'method':_0xe6fb('0x38'),'uri':_0xe6fb('0x74'),'headers':{'Authorization':_0xe6fb('0x71')+_0x53e5aa[_0xe6fb('0x58')],'Content-Type':_0xe6fb('0x54')},'body':{'refid':_0xea73a9[_0xe6fb('0x73')]['refid']},'json':!![]};return rp(_0x430530)[_0xe6fb('0x1d')](function(_0x496fd9){_0xea73a9[_0xe6fb('0x75')]=_0x496fd9;var _0x33bcde={'messageId':_0xea73a9[_0xe6fb('0x73')][_0xe6fb('0x76')],'read':!![]};return _0x8d28af[_0xe6fb('0x16')](_0x33bcde);});}else{return logger[_0xe6fb('0x19')](_0xe6fb('0x29'),'afterCreate',_0xe6fb('0x70'),util[_0xe6fb('0x2b')](_0xdf156e,{'showHidden':![],'depth':null}));}})[_0xe6fb('0x18')](function(_0x306e80){return logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),'intelepeer',util[_0xe6fb('0x2b')](_0x306e80,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xe6fb('0x29'),_0xe6fb('0x2a'),'intelepeer',_0xe6fb('0x77'));}break;}}})[_0xe6fb('0x78')](function(){_0x31a9a3();});}else{_0x31a9a3();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xa25e=['hex','signature=','/external/get/send.php?','csc','clickatell','UTF-8','apiMessageId','bandwidth','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','application/json','code','Bearer\x20','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','sms_messages','messageId','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','catch','error','SmsAccountId','type','twilio','accountSid','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','GET','split','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','inspect','connectel','authToken','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','read','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','toString','base64','http_code','data','head','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','keys','createHash','md5'];(function(_0x1a582e,_0x567fce){var _0x704b00=function(_0x4b50be){while(--_0x4b50be){_0x1a582e['push'](_0x1a582e['shift']());}};_0x704b00(++_0x567fce);}(_0xa25e,0x1e9));var _0xea25=function(_0x1471db,_0x3c0238){_0x1471db=_0x1471db-0x0;var _0x54d6ee=_0xa25e[_0x1471db];return _0x54d6ee;};'use strict';var _=require(_0xea25('0x0'));var util=require(_0xea25('0x1'));var logger=require(_0xea25('0x2'))(_0xea25('0x3'));var moment=require(_0xea25('0x4'));var BPromise=require(_0xea25('0x5'));var rp=require(_0xea25('0x6'));var fs=require('fs');var path=require(_0xea25('0x7'));var rimraf=require(_0xea25('0x8'));var config=require(_0xea25('0x9'));var attributes=require(_0xea25('0xa'));module['exports']=function(_0x2d5457,_0x44dbc0){return _0x2d5457['define']('SmsMessage',attributes,{'tableName':_0xea25('0xb'),'paranoid':![],'indexes':[{'name':_0xea25('0xc'),'fields':[_0xea25('0xc')]},{'name':'fti_sms_messages','fields':[_0xea25('0xd')],'type':_0xea25('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x26fb6a,_0x262524,_0x5d59c4){var _0x58f5b4=_0x2d5457[_0xea25('0xf')];var _0x24145c=_0x26fb6a[_0xea25('0x10')]({'plain':!![]});if(_0x24145c['direction'][_0xea25('0x11')]()==='in'||_0x24145c[_0xea25('0x12')][_0xea25('0x11')]()===_0xea25('0x13')&&!_0x24145c[_0xea25('0x14')]&&!_[_0xea25('0x15')](_0x24145c[_0xea25('0x16')])&&!_['isNil'](_0x24145c[_0xea25('0x17')])){_0x58f5b4[_0xea25('0x18')][_0xea25('0x19')]({'where':{'id':_0x24145c[_0xea25('0x17')]}})[_0xea25('0x1a')](function(_0x29665d){if(_0x29665d){_0x29665d['update']({'lastMsgAt':_0x24145c['createdAt'],'lastMsgDirection':_0x24145c['direction']['toLowerCase']()});}})[_0xea25('0x1b')](function(_0x18565f){console[_0xea25('0x1c')](_0x18565f);});}if(_0x24145c['direction']==='out'&&!_0x24145c['secret']){var _0x2e3803;_0x58f5b4['SmsAccount']['find']({'where':{'id':_0x24145c[_0xea25('0x1d')]},'raw':!![]})['then'](function(_0x3a8344){_0x2e3803=_0x3a8344;if(_0x2e3803&&_0x2e3803[_0xea25('0x1e')]){switch(_0x2e3803[_0xea25('0x1e')]){case _0xea25('0x1f'):var _0x3ce6cb=require(_0xea25('0x1f'));if(_0x2e3803[_0xea25('0x20')]&&_0x2e3803['authToken']&&_0x2e3803[_0xea25('0x21')]){var _0x2374d4=new _0x3ce6cb(_0x2e3803[_0xea25('0x20')],_0x2e3803['authToken']);_0x2374d4[_0xea25('0x22')][_0xea25('0x23')]({'body':_0x24145c['body'],'to':_0x24145c['phone'],'from':_0x2e3803['phone'],'statusCallback':_0x2e3803[_0xea25('0x24')]+_0xea25('0x25')+_0x24145c['id']+_0xea25('0x26')+_0x2e3803[_0xea25('0x27')]})[_0xea25('0x1a')](function(_0x4927c4){if(_0x4927c4[_0xea25('0x28')]){return _0x26fb6a[_0xea25('0x29')]({'messageId':_0x4927c4[_0xea25('0x28')]});}})[_0xea25('0x1b')](function(_0x300e7e){logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),_0xea25('0x1f'),util['inspect'](_0x300e7e,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xea25('0x2a'),'afterCreate','twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xea25('0x2c'):var _0x100247=_0xea25('0x2d');if(_0x2e3803[_0xea25('0x2e')]&&_0x2e3803[_0xea25('0x2f')]){var _0x5c4bb3={'recipient':[_0x24145c[_0xea25('0x21')]],'message':_0x24145c['body'],'message_type':_0x2e3803[_0xea25('0x30')]};if(_0x2e3803[_0xea25('0x30')]&&_0x2e3803['smsMethod']!=='SI'){_0x5c4bb3[_0xea25('0x31')]=_0x2e3803[_0xea25('0x21')];}var _0x5ee688={'url':_0x100247+'login?username='+_0x2e3803[_0xea25('0x2e')]+'&password='+_0x2e3803['password'],'method':_0xea25('0x32')};rp(_0x5ee688)[_0xea25('0x1a')](function(_0x27f861){var _0x311636=_0x27f861[_0xea25('0x33')](';');var _0x3dda58={'user_key':_0x311636[0x0],'session_key':_0x311636[0x1]};_0x5ee688={'url':_0x100247+_0xea25('0x34'),'method':_0xea25('0x35'),'headers':{'user_key':_0x3dda58[_0xea25('0x36')],'Session_key':_0x3dda58['session_key']},'json':!![],'body':_0x5c4bb3};return rp(_0x5ee688);})[_0xea25('0x1a')](function(_0x46423e){if(_0x46423e[_0xea25('0x37')]>=0x1){var _0x874aab={'messageId':_0x46423e[_0xea25('0x38')]};if(_0x2e3803[_0xea25('0x30')]!=='GP'||!_0x2e3803[_0xea25('0x39')]){_0x874aab['read']=!![];}return _0x26fb6a[_0xea25('0x29')](_0x874aab);}else{return logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),'skebby',util[_0xea25('0x3a')](_0x46423e,{'showHidden':![],'depth':null}));}})[_0xea25('0x1b')](function(_0x303574){return logger[_0xea25('0x1c')](_0xea25('0x2a'),'afterCreate','skebby',util[_0xea25('0x3a')](_0x303574,{'showHidden':![],'depth':null}));});}else{logger[_0xea25('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xea25('0x2c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xea25('0x3b'):if(_0x2e3803[_0xea25('0x3c')]){var _0x240d7c={'recipient':_0x24145c[_0xea25('0x21')],'message':_0x24145c[_0xea25('0xd')],'sender':_0x2e3803[_0xea25('0x3d')]||_0x2e3803['phone'],'authorization':_0x2e3803['authToken']};var _0x262524={'method':_0xea25('0x35'),'uri':_0xea25('0x3e'),'body':_0x240d7c,'json':!![]};rp(_0x262524)[_0xea25('0x1a')](function(_0x58d6b5){var _0x28ec78={'messageId':_0x58d6b5[_0xea25('0x3f')]};if(!_0x2e3803['deliveryReport']){_0x28ec78[_0xea25('0x40')]=!![];}return _0x26fb6a[_0xea25('0x29')](_0x28ec78);})[_0xea25('0x1b')](function(_0x2be806){logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),'connectel',util[_0xea25('0x3a')](_0x2be806,{'showHidden':![],'depth':null}));});}else{logger[_0xea25('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xea25('0x3b'),_0xea25('0x41'));}break;case _0xea25('0x42'):if(_0x2e3803[_0xea25('0x2e')]&&_0x2e3803[_0xea25('0x2f')]){var _0x240d7c={'messages':[{'source':_0xea25('0x43'),'to':_0x24145c[_0xea25('0x21')],'body':_0x24145c[_0xea25('0xd')],'from':_0x2e3803[_0xea25('0x3d')]||_0x2e3803[_0xea25('0x21')]}]};var _0x3949b6=util[_0xea25('0x44')](_0xea25('0x45'),_0x2e3803[_0xea25('0x2e')],_0x2e3803[_0xea25('0x2f')]);var _0x262524={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x240d7c,'headers':{'Authorization':util[_0xea25('0x44')]('Basic\x20%s',new Buffer(_0x3949b6)[_0xea25('0x46')](_0xea25('0x47')))},'json':!![]};rp(_0x262524)['then'](function(_0x5006cb){if(_0x5006cb[_0xea25('0x48')]>=0xc8&&_0x5006cb[_0xea25('0x48')]<=0xce){if(_0x5006cb[_0xea25('0x49')]&&_0x5006cb['data']['queued_count']>0x0){var _0x21f296=_[_0xea25('0x4a')](_0x5006cb['data'][_0xea25('0x22')]);var _0x53361a={'messageId':_0x21f296['message_id']};if(!_0x2e3803[_0xea25('0x39')]){_0x53361a[_0xea25('0x40')]=!![];}return _0x26fb6a[_0xea25('0x29')](_0x53361a);}else{logger[_0xea25('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xea25('0x4b'),util[_0xea25('0x3a')](_0x5006cb,{'showHidden':![],'depth':null}));}}else{logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),'clickSend',util[_0xea25('0x3a')](_0x5006cb,{'showHidden':![],'depth':null}));}})[_0xea25('0x1b')](function(_0x519d13){logger['error'](_0xea25('0x2a'),_0xea25('0x2b'),_0xea25('0x4b'),util[_0xea25('0x3a')](_0x519d13,{'showHidden':![],'depth':null}));});}else{logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),_0xea25('0x4b'),_0xea25('0x4c'));}break;case _0xea25('0x4d'):if(_0x2e3803[_0xea25('0x4e')]&&_0x2e3803[_0xea25('0x3c')]){var _0x240d7c={'dst':_0x24145c[_0xea25('0x21')],'text':_0x24145c[_0xea25('0xd')],'src':_0x2e3803[_0xea25('0x3d')]||_0x2e3803[_0xea25('0x21')],'url':_0x2e3803[_0xea25('0x24')]+_0xea25('0x25')+_0x24145c['id']+'/status?token='+_0x2e3803[_0xea25('0x27')]};var _0x3949b6=util['format'](_0xea25('0x45'),_0x2e3803['authId'],_0x2e3803['authToken']);var _0x262524={'method':'POST','uri':util['format'](_0xea25('0x4f'),_0x2e3803['authId']),'body':_0x240d7c,'headers':{'Authorization':util['format'](_0xea25('0x50'),new Buffer(_0x3949b6)[_0xea25('0x46')](_0xea25('0x47')))},'json':!![]};rp(_0x262524)[_0xea25('0x1a')](function(_0x3c16a1){var _0x34bae2={'messageId':_0x3c16a1[_0xea25('0x51')][0x0]};return _0x26fb6a[_0xea25('0x29')](_0x34bae2);})[_0xea25('0x1b')](function(_0x36bc5c){logger[_0xea25('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xea25('0x2b'),'plivo',util['inspect'](_0x36bc5c,{'showHidden':![],'depth':null}));});}else{logger[_0xea25('0x1c')](_0xea25('0x2a'),'afterCreate',_0xea25('0x4d'),_0xea25('0x52'));}break;case'infobip':if(_0x2e3803[_0xea25('0x2e')]&&_0x2e3803[_0xea25('0x2f')]){if(_0x2e3803[_0xea25('0x53')]){var _0x42401a={'method':'POST','uri':_0x2e3803[_0xea25('0x53')]+_0xea25('0x54'),'body':{'username':_0x2e3803['username'],'password':_0x2e3803['password']},'json':!![]};return rp(_0x42401a)[_0xea25('0x1a')](function(_0x4927ec){var _0x2ea9e9={'method':_0xea25('0x35'),'uri':_0x2e3803[_0xea25('0x53')]+_0xea25('0x55'),'body':{'messages':[{'from':_0x2e3803[_0xea25('0x21')],'destinations':[{'to':_0x24145c[_0xea25('0x21')]}],'text':_0x24145c[_0xea25('0xd')],'notifyUrl':_0x2e3803['remote']+_0xea25('0x25')+_0x24145c['id']+_0xea25('0x26')+_0x2e3803[_0xea25('0x27')],'notifyContentType':'application/json','callbackData':_0x2e3803[_0xea25('0x21')]+';'+_0x24145c[_0xea25('0xd')]}]},'headers':{'Authorization':_0xea25('0x56')+_0x4927ec[_0xea25('0x27')]},'json':!![]};return rp(_0x2ea9e9)[_0xea25('0x1a')](function(_0x14ee18){if(_0x14ee18['messages']){var _0x4a8270={'messageId':_0x14ee18[_0xea25('0x22')][0x0][_0xea25('0xc')]};if(!_0x2e3803[_0xea25('0x39')]){_0x4a8270['read']=!![];}return _0x26fb6a[_0xea25('0x29')](_0x4a8270);}else{return logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),_0xea25('0x57'),util['inspect'](_0x14ee18,{'showHidden':![],'depth':null}));}});})[_0xea25('0x1b')](function(_0x28b9a9){return logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),'infobip',util['inspect'](_0x28b9a9,{'showHidden':![],'depth':null}));});}else{logger[_0xea25('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xea25('0x2b'),_0xea25('0x57'),_0xea25('0x58'));}}else{logger[_0xea25('0x1c')](_0xea25('0x2a'),'afterCreate',_0xea25('0x57'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x4be76b=require(_0xea25('0x59'));if(_0x2e3803[_0xea25('0x5a')]){var _0x2a51f5={};_0x2a51f5[_0xea25('0x5b')]=_0x2e3803[_0xea25('0x2e')];_0x2a51f5['phone']=_0x24145c[_0xea25('0x21')];_0x2a51f5[_0xea25('0x31')]=_0x2e3803[_0xea25('0x21')];_0x2a51f5[_0xea25('0x5c')]=_0x24145c[_0xea25('0xd')];_0x2a51f5['timestamp']=+new Date();var _0x47fc27='';var _0x571a5a='';var _0x528fce=Object[_0xea25('0x5d')](_0x2a51f5);_0x528fce['sort']();for(var _0x203da3=0x0;_0x203da3<_0x528fce['length'];_0x203da3++){if(_0x47fc27!=''){_0x47fc27+='&';}_0x47fc27+=_0x528fce[_0x203da3]+'='+encodeURIComponent(_0x2a51f5[_0x528fce[_0x203da3]]);_0x571a5a+=_0x2a51f5[_0x528fce[_0x203da3]];}_0x571a5a+=_0x2e3803[_0xea25('0x5a')];_0x571a5a=_0x4be76b[_0xea25('0x5e')](_0xea25('0x5f'))['update'](_0x571a5a)['digest'](_0xea25('0x60'));if(_0x47fc27!==''){_0x47fc27+='&';}_0x47fc27+=_0xea25('0x61')+_0x571a5a;var _0x5ee688={'method':'GET','uri':_0x2e3803['baseUrl']+_0xea25('0x62')+_0x47fc27,'json':!![]};return rp(_0x5ee688)['then'](function(_0x139c71){var _0x100f5c=Object[_0xea25('0x5d')](_0x139c71);if(_0x139c71[_0x100f5c[0x0]][_0xea25('0x1c')]&&parseInt(_0x139c71[_0x100f5c[0x0]][_0xea25('0x1c')])===0x0){var _0x52b0ce={'messageId':_0x139c71[_0x100f5c[0x0]]['id_sms']};if(!_0x2e3803[_0xea25('0x39')]){_0x52b0ce['read']=!![];}return _0x26fb6a[_0xea25('0x29')](_0x52b0ce);}else{return logger[_0xea25('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xea25('0x2b'),_0xea25('0x63'),util['inspect'](_0x139c71['error'],{'showHidden':![],'depth':null}));}})[_0xea25('0x1b')](function(_0x4a3036){return logger[_0xea25('0x1c')](_0xea25('0x2a'),'afterCreate','csc',util[_0xea25('0x3a')](_0x4a3036,{'showHidden':![],'depth':null}));});}else{logger[_0xea25('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xea25('0x63'),'Missing\x20parameters:\x20apiKey');}break;case _0xea25('0x64'):if(_0x2e3803[_0xea25('0x5a')]){var _0x3f63e3={'method':_0xea25('0x35'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x2e3803[_0xea25('0x5a')]},'body':{'content':_0x24145c['body'],'to':[_0x24145c['phone']],'from':_0x2e3803[_0xea25('0x21')],'binary':![],'clientMessageId':'uuid','charset':_0xea25('0x65')},'json':!![]};rp(_0x3f63e3)[_0xea25('0x1a')](function(_0x3b0c24){if(!_0x3b0c24['error']){var _0x4fcf97={'messageId':_0x3b0c24[_0xea25('0x22')][0x0][_0xea25('0x66')]};if(!_0x2e3803[_0xea25('0x39')]){_0x4fcf97[_0xea25('0x40')]=!![];}return _0x26fb6a[_0xea25('0x29')](_0x4fcf97);}else{return logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),_0xea25('0x64'),util[_0xea25('0x3a')](_0x3b0c24[_0xea25('0x1c')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x33f403){return logger['error'](_0xea25('0x2a'),_0xea25('0x2b'),'clickatell',util['inspect'](_0x33f403,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xea25('0x2a'),_0xea25('0x2b'),_0xea25('0x64'),'Missing\x20parameters:\x20apiKey');}break;case _0xea25('0x67'):if(_0x2e3803['username']&&_0x2e3803[_0xea25('0x2f')]){var _0x3949b6=util[_0xea25('0x44')]('%s:%s',_0x2e3803[_0xea25('0x2e')],_0x2e3803[_0xea25('0x2f')]);var _0x262524={'method':_0xea25('0x35'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x2e3803[_0xea25('0x68')]+_0xea25('0x69'),'body':{'to':[_0x24145c[_0xea25('0x21')]],'text':_0x24145c[_0xea25('0xd')],'from':_0x2e3803[_0xea25('0x21')],'applicationId':_0x2e3803[_0xea25('0x6a')]},'headers':{'Authorization':util['format'](_0xea25('0x50'),new Buffer(_0x3949b6)[_0xea25('0x46')]('base64'))},'json':!![]};rp(_0x262524)[_0xea25('0x1a')](function(_0x305e97){if(_0x305e97['id']){var _0x299ae5={'messageId':_0x305e97['id']};return _0x26fb6a[_0xea25('0x29')](_0x299ae5);}else{logger[_0xea25('0x1c')](_0xea25('0x2a'),'afterCreate',_0xea25('0x67'),util['inspect'](_0x305e97,{'showHidden':![],'depth':null}));}})[_0xea25('0x1b')](function(_0x292008){logger[_0xea25('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xea25('0x2b'),_0xea25('0x67'),util[_0xea25('0x3a')](_0x292008,{'showHidden':![],'depth':null}));});}else{logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),_0xea25('0x67'),_0xea25('0x4c'));}break;case _0xea25('0x6b'):if(_0x2e3803[_0xea25('0x5a')]){var _0x138146={};var _0x5ee688={'method':'POST','uri':_0xea25('0x6c'),'headers':{'Authorization':'Bearer\x20'+_0x2e3803[_0xea25('0x5a')],'Content-Type':_0xea25('0x6d')},'body':{'from':_0x2e3803[_0xea25('0x21')],'to':_0x24145c['phone'],'text':_0x24145c[_0xea25('0xd')]},'json':!![]};return rp(_0x5ee688)['then'](function(_0x34d32a){if(_0x34d32a[_0xea25('0x6e')]==0xca){_0x138146['message']=_0x34d32a;var _0x2e48ef={'method':_0xea25('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xea25('0x6f')+_0x2e3803[_0xea25('0x5a')],'Content-Type':_0xea25('0x6d')},'body':{'refid':_0x138146['message']['refid']},'json':!![]};return rp(_0x2e48ef)[_0xea25('0x1a')](function(_0x274b1e){_0x138146['status']=_0x274b1e;var _0x2adb5e={'messageId':_0x138146['message'][_0xea25('0x70')],'read':!![]};return _0x26fb6a[_0xea25('0x29')](_0x2adb5e);});}else{return logger[_0xea25('0x1c')](_0xea25('0x2a'),'afterCreate',_0xea25('0x6b'),util[_0xea25('0x3a')](_0x34d32a,{'showHidden':![],'depth':null}));}})[_0xea25('0x1b')](function(_0x411ca7){return logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),_0xea25('0x6b'),util['inspect'](_0x411ca7,{'showHidden':![],'depth':null}));});}else{return logger[_0xea25('0x1c')](_0xea25('0x2a'),_0xea25('0x2b'),_0xea25('0x6b'),_0xea25('0x71'));}break;}}})[_0xea25('0x72')](function(){_0x5d59c4();});}else{_0x5d59c4();}}},'charset':_0xea25('0x73'),'collate':_0xea25('0x74')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 181c40d..7e6ff23 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 _0x5150=['client','http','redis','socket.io-emitter','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsMessage','create','body','options','CreateSmsMessage','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4dd64b,_0x3b6289){var _0x1af70d=function(_0x25d945){while(--_0x25d945){_0x4dd64b['push'](_0x4dd64b['shift']());}};_0x1af70d(++_0x3b6289);}(_0x5150,0x1c8));var _0x0515=function(_0x1a809b,_0x4c15e3){_0x1a809b=_0x1a809b-0x0;var _0x5d90e6=_0x5150[_0x1a809b];return _0x5d90e6;};'use strict';var _=require(_0x0515('0x0'));var util=require(_0x0515('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0515('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0515('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0515('0x4'))(_0x0515('0x5'));var config=require(_0x0515('0x6'));var jayson=require(_0x0515('0x7'));var client=jayson[_0x0515('0x8')][_0x0515('0x9')]({'port':0x232a});config[_0x0515('0xa')]=_['defaults'](config[_0x0515('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0515('0xb'))(new Redis(config[_0x0515('0xa')]));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0xb7ef54,_0x23ba3f,_0xd96dce){return new BPromise(function(_0xfa0551,_0x5e4527){return client[_0x0515('0xc')](_0xb7ef54,_0xd96dce)[_0x0515('0xd')](function(_0x918644){logger[_0x0515('0xe')](_0x0515('0xf'),_0x23ba3f,_0x0515('0x10'));logger[_0x0515('0x11')](_0x0515('0x12'),_0x23ba3f,'request\x20sent',JSON[_0x0515('0x13')](_0x918644));if(_0x918644[_0x0515('0x14')]){if(_0x918644[_0x0515('0x14')][_0x0515('0x15')]===0x1f4){logger['error'](_0x0515('0xf'),_0x23ba3f,_0x918644[_0x0515('0x14')][_0x0515('0x16')]);return _0x5e4527(_0x918644[_0x0515('0x14')][_0x0515('0x16')]);}logger[_0x0515('0x14')](_0x0515('0xf'),_0x23ba3f,_0x918644[_0x0515('0x14')]['message']);return _0xfa0551(_0x918644['error']['message']);}else{logger[_0x0515('0xe')]('SmsMessage,\x20%s,\x20%s',_0x23ba3f,'request\x20sent');_0xfa0551(_0x918644['result'][_0x0515('0x16')]);}})['catch'](function(_0x4d2099){logger[_0x0515('0x14')]('SmsMessage,\x20%s,\x20%s',_0x23ba3f,_0x4d2099);_0x5e4527(_0x4d2099);});});}exports['CreateSmsMessage']=function(_0x355f77){var _0x451f2e=this;return new Promise(function(_0x44dc4d,_0x4a3d89){return db[_0x0515('0x17')][_0x0515('0x18')](_0x355f77[_0x0515('0x19')],{'raw':_0x355f77['options']?_0x355f77[_0x0515('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x0515('0xd')](function(_0x8c7fa0){logger['info'](_0x0515('0x1b'),_0x355f77);logger[_0x0515('0x11')](_0x0515('0x1b'),_0x355f77,JSON[_0x0515('0x13')](_0x8c7fa0));_0x44dc4d(_0x8c7fa0);})[_0x0515('0x1c')](function(_0x890adb){logger[_0x0515('0x14')](_0x0515('0x1b'),_0x890adb[_0x0515('0x16')],_0x355f77);_0x4a3d89(_0x451f2e[_0x0515('0x14')](0x1f4,_0x890adb['message']));});});}; \ No newline at end of file +var _0x2e2f=['localhost','socket.io-emitter','register','request','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','SmsMessage','create','body','options','then','CreateSmsMessage','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x524e2b,_0x19d442){var _0x26da31=function(_0x5aec61){while(--_0x5aec61){_0x524e2b['push'](_0x524e2b['shift']());}};_0x26da31(++_0x19d442);}(_0x2e2f,0x169));var _0xf2e2=function(_0x36daf3,_0x2ea0dd){_0x36daf3=_0x36daf3-0x0;var _0x3e4e26=_0x2e2f[_0x36daf3];return _0x3e4e26;};'use strict';var _=require(_0xf2e2('0x0'));var util=require(_0xf2e2('0x1'));var moment=require(_0xf2e2('0x2'));var BPromise=require(_0xf2e2('0x3'));var rs=require(_0xf2e2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf2e2('0x5'))['db'];var utils=require(_0xf2e2('0x6'));var logger=require('../../config/logger')(_0xf2e2('0x7'));var config=require(_0xf2e2('0x8'));var jayson=require(_0xf2e2('0x9'));var client=jayson[_0xf2e2('0xa')][_0xf2e2('0xb')]({'port':0x232a});config[_0xf2e2('0xc')]=_['defaults'](config['redis'],{'host':_0xf2e2('0xd'),'port':0x18eb});var socket=require(_0xf2e2('0xe'))(new Redis(config[_0xf2e2('0xc')]));require('./smsMessage.socket')[_0xf2e2('0xf')](socket);function respondWithRpcPromise(_0x5da43c,_0x2bd2db,_0x266c6d){return new BPromise(function(_0x2c65e7,_0xc70e55){return client[_0xf2e2('0x10')](_0x5da43c,_0x266c6d)['then'](function(_0x143fb4){logger[_0xf2e2('0x11')]('SmsMessage,\x20%s,\x20%s',_0x2bd2db,_0xf2e2('0x12'));logger[_0xf2e2('0x13')](_0xf2e2('0x14'),_0x2bd2db,_0xf2e2('0x12'),JSON[_0xf2e2('0x15')](_0x143fb4));if(_0x143fb4[_0xf2e2('0x16')]){if(_0x143fb4[_0xf2e2('0x16')][_0xf2e2('0x17')]===0x1f4){logger[_0xf2e2('0x16')](_0xf2e2('0x18'),_0x2bd2db,_0x143fb4[_0xf2e2('0x16')][_0xf2e2('0x19')]);return _0xc70e55(_0x143fb4[_0xf2e2('0x16')]['message']);}logger['error'](_0xf2e2('0x18'),_0x2bd2db,_0x143fb4[_0xf2e2('0x16')]['message']);return _0x2c65e7(_0x143fb4['error']['message']);}else{logger[_0xf2e2('0x11')](_0xf2e2('0x18'),_0x2bd2db,_0xf2e2('0x12'));_0x2c65e7(_0x143fb4[_0xf2e2('0x1a')][_0xf2e2('0x19')]);}})[_0xf2e2('0x1b')](function(_0x31ff4e){logger[_0xf2e2('0x16')]('SmsMessage,\x20%s,\x20%s',_0x2bd2db,_0x31ff4e);_0xc70e55(_0x31ff4e);});});}exports['CreateSmsMessage']=function(_0x2663b3){var _0x7e6994=this;return new Promise(function(_0x11ed4d,_0x271910){return db[_0xf2e2('0x1c')][_0xf2e2('0x1d')](_0x2663b3[_0xf2e2('0x1e')],{'raw':_0x2663b3[_0xf2e2('0x1f')]?_0x2663b3[_0xf2e2('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0xf2e2('0x20')](function(_0x31e456){logger[_0xf2e2('0x11')](_0xf2e2('0x21'),_0x2663b3);logger['debug']('CreateSmsMessage',_0x2663b3,JSON[_0xf2e2('0x15')](_0x31e456));_0x11ed4d(_0x31e456);})[_0xf2e2('0x1b')](function(_0x3a975c){logger[_0xf2e2('0x16')]('CreateSmsMessage',_0x3a975c[_0xf2e2('0x19')],_0x2663b3);_0x271910(_0x7e6994[_0xf2e2('0x16')](0x1f4,_0x3a975c[_0xf2e2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 4e2204a..56b7fca 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 _0x44d9=['remove','update','emit','removeListener','register','smsMessage:','save'];(function(_0x2fd873,_0x51262f){var _0x23e544=function(_0x107c74){while(--_0x107c74){_0x2fd873['push'](_0x2fd873['shift']());}};_0x23e544(++_0x51262f);}(_0x44d9,0x164));var _0x944d=function(_0x543cf9,_0x5875e4){_0x543cf9=_0x543cf9-0x0;var _0x38adb8=_0x44d9[_0x543cf9];return _0x38adb8;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x944d('0x0'),_0x944d('0x1'),_0x944d('0x2')];function createListener(_0x451d4d,_0x3373e5){return function(_0x5cdfc0){_0x3373e5[_0x944d('0x3')](_0x451d4d,_0x5cdfc0);};}function removeListener(_0x2249f7,_0x3d37ef){return function(){SmsMessageEvents[_0x944d('0x4')](_0x2249f7,_0x3d37ef);};}exports[_0x944d('0x5')]=function(_0x59bdc1){for(var _0x313d1f=0x0,_0x28b051=events['length'];_0x313d1f<_0x28b051;_0x313d1f++){var _0x399c31=events[_0x313d1f];var _0x3aea56=createListener(_0x944d('0x6')+_0x399c31,_0x59bdc1);SmsMessageEvents['on'](_0x399c31,_0x3aea56);}}; \ No newline at end of file +var _0x5816=['remove','update','emit','removeListener','length','smsMessage:','./smsMessage.events','save'];(function(_0x148a49,_0xc9f79f){var _0x1c2051=function(_0x4902fa){while(--_0x4902fa){_0x148a49['push'](_0x148a49['shift']());}};_0x1c2051(++_0xc9f79f);}(_0x5816,0x10e));var _0x6581=function(_0x16d73e,_0x56f741){_0x16d73e=_0x16d73e-0x0;var _0x167c4d=_0x5816[_0x16d73e];return _0x167c4d;};'use strict';var SmsMessageEvents=require(_0x6581('0x0'));var events=[_0x6581('0x1'),_0x6581('0x2'),_0x6581('0x3')];function createListener(_0x3bf216,_0xf40652){return function(_0xc8abdd){_0xf40652[_0x6581('0x4')](_0x3bf216,_0xc8abdd);};}function removeListener(_0x5b1654,_0x4a7b46){return function(){SmsMessageEvents[_0x6581('0x5')](_0x5b1654,_0x4a7b46);};}exports['register']=function(_0x3109ca){for(var _0x5d95e0=0x0,_0x364cb6=events[_0x6581('0x6')];_0x5d95e0<_0x364cb6;_0x5d95e0++){var _0xd97342=events[_0x5d95e0];var _0x5c75f0=createListener(_0x6581('0x7')+_0xd97342,_0x3109ca);SmsMessageEvents['on'](_0xd97342,_0x5c75f0);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index fd2904d..19b14a6 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 _0xfeb3=['/:id','show','/:id/teams','getTeams','getAgents','create','addTeams','/:id/users','addAgents','put','destroy','delete','removeTeams','removeAgents','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','/describe','isAuthenticated','describe'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xfeb3,0x11c));var _0x3feb=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xfeb3[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3feb('0x0'));var timeout=require(_0x3feb('0x1'));var express=require(_0x3feb('0x2'));var router=express[_0x3feb('0x3')]();var fs_extra=require(_0x3feb('0x4'));var auth=require(_0x3feb('0x5'));var interaction=require(_0x3feb('0x6'));var config=require(_0x3feb('0x7'));var controller=require(_0x3feb('0x8'));router[_0x3feb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3feb('0x9')](_0x3feb('0xa'),auth[_0x3feb('0xb')](),controller[_0x3feb('0xc')]);router['get'](_0x3feb('0xd'),auth[_0x3feb('0xb')](),controller[_0x3feb('0xe')]);router[_0x3feb('0x9')]('/:id/members',auth[_0x3feb('0xb')](),controller['getMembers']);router[_0x3feb('0x9')](_0x3feb('0xf'),auth[_0x3feb('0xb')](),controller[_0x3feb('0x10')]);router[_0x3feb('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x3feb('0x11')]);router['post']('/',auth[_0x3feb('0xb')](),controller[_0x3feb('0x12')]);router['post'](_0x3feb('0xf'),auth[_0x3feb('0xb')](),controller[_0x3feb('0x13')]);router['post'](_0x3feb('0x14'),auth['isAuthenticated'](),controller[_0x3feb('0x15')]);router[_0x3feb('0x16')]('/:id',auth[_0x3feb('0xb')](),controller['update']);router['delete'](_0x3feb('0xd'),auth[_0x3feb('0xb')](),controller[_0x3feb('0x17')]);router[_0x3feb('0x18')]('/:id/teams',auth[_0x3feb('0xb')](),controller[_0x3feb('0x19')]);router[_0x3feb('0x18')](_0x3feb('0x14'),auth['isAuthenticated'](),controller[_0x3feb('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xc923=['removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','/:id','destroy','delete'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc923,0xb7));var _0x3c92=function(_0x186d6d,_0x3e74bc){_0x186d6d=_0x186d6d-0x0;var _0x5d41c1=_0xc923[_0x186d6d];return _0x5d41c1;};'use strict';var multer=require(_0x3c92('0x0'));var util=require(_0x3c92('0x1'));var path=require(_0x3c92('0x2'));var timeout=require('connect-timeout');var express=require(_0x3c92('0x3'));var router=express[_0x3c92('0x4')]();var fs_extra=require(_0x3c92('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3c92('0x6'));var config=require(_0x3c92('0x7'));var controller=require(_0x3c92('0x8'));router[_0x3c92('0x9')]('/',auth[_0x3c92('0xa')](),controller[_0x3c92('0xb')]);router['get'](_0x3c92('0xc'),auth[_0x3c92('0xa')](),controller['describe']);router[_0x3c92('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x3c92('0xd')]);router['get'](_0x3c92('0xe'),auth['isAuthenticated'](),controller[_0x3c92('0xf')]);router[_0x3c92('0x9')](_0x3c92('0x10'),auth[_0x3c92('0xa')](),controller[_0x3c92('0x11')]);router[_0x3c92('0x9')](_0x3c92('0x12'),auth[_0x3c92('0xa')](),controller[_0x3c92('0x13')]);router[_0x3c92('0x14')]('/',auth[_0x3c92('0xa')](),controller[_0x3c92('0x15')]);router['post'](_0x3c92('0x10'),auth[_0x3c92('0xa')](),controller[_0x3c92('0x16')]);router[_0x3c92('0x14')](_0x3c92('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0x3c92('0x17')](_0x3c92('0x18'),auth[_0x3c92('0xa')](),controller['update']);router['delete']('/:id',auth[_0x3c92('0xa')](),controller[_0x3c92('0x19')]);router[_0x3c92('0x1a')]('/:id/teams',auth[_0x3c92('0xa')](),controller[_0x3c92('0x1b')]);router[_0x3c92('0x1a')](_0x3c92('0x12'),auth[_0x3c92('0xa')](),controller[_0x3c92('0x1c')]);module[_0x3c92('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 d5c0de1..d4b3d6d 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 _0xc375=['STRING','INTEGER','ENUM','sequelize','name'];(function(_0x378666,_0x287b36){var _0x5ed40a=function(_0x39d845){while(--_0x39d845){_0x378666['push'](_0x378666['shift']());}};_0x5ed40a(++_0x287b36);}(_0xc375,0x198));var _0x5c37=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xc375[_0x5c9307];return _0x373e29;};'use strict';var Sequelize=require(_0x5c37('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x5c37('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5c37('0x2')]},'timeout':{'type':Sequelize[_0x5c37('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5c37('0x4')]('rrmemory','beepall','roundrobin')}}; \ No newline at end of file +var _0x8b76=['STRING','name','INTEGER','rrmemory','roundrobin','exports'];(function(_0x5c4e16,_0x113035){var _0x36044a=function(_0xde2f25){while(--_0xde2f25){_0x5c4e16['push'](_0x5c4e16['shift']());}};_0x36044a(++_0x113035);}(_0x8b76,0x95));var _0x68b7=function(_0x29b6d0,_0x492462){_0x29b6d0=_0x29b6d0-0x0;var _0x15110b=_0x8b76[_0x29b6d0];return _0x15110b;};'use strict';var Sequelize=require('sequelize');module[_0x68b7('0x0')]={'name':{'type':Sequelize[_0x68b7('0x1')],'unique':_0x68b7('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x68b7('0x1')]},'timeout':{'type':Sequelize[_0x68b7('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x68b7('0x4'),'beepall',_0x68b7('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 4bc2ae6..12484a3 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 _0x014c=['save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','params','keys','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','hasOwnProperty','SmsQueueId','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','order','ids','findAll','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','field','from','team_has_sms_queues','ut.TeamId\x20=\x20tq.TeamId','push','toString','QueryTypes','SELECT','every','includes','all','compact','value','isEmpty','removeAgents','addAgents','omit','spread','userSmsQueue:save','isArray','userSmsQueue:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsQueue.socket','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject'];(function(_0x5b06fb,_0x1190f4){var _0x53a53a=function(_0x52adb4){while(--_0x52adb4){_0x5b06fb['push'](_0x5b06fb['shift']());}};_0x53a53a(++_0x1190f4);}(_0x014c,0x17b));var _0xc014=function(_0x10d0f0,_0x1eba3d){_0x10d0f0=_0x10d0f0-0x0;var _0x93e308=_0x014c[_0x10d0f0];return _0x93e308;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc014('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc014('0x1'));var rp=require(_0xc014('0x2'));var moment=require(_0xc014('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc014('0x4'));var path=require(_0xc014('0x5'));var sox=require(_0xc014('0x6'));var csv=require(_0xc014('0x7'));var ejs=require(_0xc014('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc014('0x9'));var squel=require(_0xc014('0xa'));var crypto=require('crypto');var jsforce=require(_0xc014('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc014('0x7'));var querystring=require(_0xc014('0xc'));var Papa=require(_0xc014('0xd'));var Redis=require('ioredis');var authService=require(_0xc014('0xe'));var qs=require(_0xc014('0xf'));var as=require(_0xc014('0x10'));var hardwareService=require(_0xc014('0x11'));var logger=require('../../config/logger')(_0xc014('0x12'));var utils=require('../../config/utils');var config=require(_0xc014('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc014('0x14'))['db'];config[_0xc014('0x15')]=_[_0xc014('0x16')](config[_0xc014('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xc014('0x17'))(new Redis(config[_0xc014('0x15')]));require(_0xc014('0x18'))['register'](socket);function respondWithStatusCode(_0x36b26e,_0x4fe97e){_0x4fe97e=_0x4fe97e||0xcc;return function(_0x458195){if(_0x458195){return _0x36b26e[_0xc014('0x19')](_0x4fe97e);}return _0x36b26e[_0xc014('0x1a')](_0x4fe97e)[_0xc014('0x1b')]();};}function respondWithResult(_0x9f6a26,_0x9791b9){_0x9791b9=_0x9791b9||0xc8;return function(_0x4aa669){if(_0x4aa669){return _0x9f6a26[_0xc014('0x1a')](_0x9791b9)[_0xc014('0x1c')](_0x4aa669);}};}function respondWithFilteredResult(_0x263ad0,_0x1b2f1b){return function(_0x5a2be0){if(_0x5a2be0){var _0x4d29bb=typeof _0x1b2f1b[_0xc014('0x1d')]==='undefined'&&typeof _0x1b2f1b['limit']===_0xc014('0x1e');var _0x4287fe=_0x5a2be0['count'];var _0x9442cc=_0x4d29bb?0x0:_0x1b2f1b[_0xc014('0x1d')];var _0x391a07=_0x4d29bb?_0x5a2be0[_0xc014('0x1f')]:_0x1b2f1b[_0xc014('0x1d')]+_0x1b2f1b['limit'];var _0xc8b0fb;if(_0x391a07>=_0x4287fe){_0x391a07=_0x4287fe;_0xc8b0fb=0xc8;}else{_0xc8b0fb=0xce;}_0x263ad0[_0xc014('0x1a')](_0xc8b0fb);return _0x263ad0[_0xc014('0x20')](_0xc014('0x21'),_0x9442cc+'-'+_0x391a07+'/'+_0x4287fe)[_0xc014('0x1c')](_0x5a2be0);}return null;};}function patchUpdates(_0x3f28b6){return function(_0x380fca){try{jsonpatch['apply'](_0x380fca,_0x3f28b6,!![]);}catch(_0x1089c6){return BPromise[_0xc014('0x22')](_0x1089c6);}return _0x380fca[_0xc014('0x23')]();};}function saveUpdates(_0x174b46,_0xb0e94e){return function(_0x144e11){if(_0x144e11){return _0x144e11[_0xc014('0x24')](_0x174b46)[_0xc014('0x25')](function(_0xe4c68){return _0xe4c68;});}return null;};}function removeEntity(_0x2e5c30,_0x4850bb){return function(_0x1d6020){if(_0x1d6020){return _0x1d6020[_0xc014('0x26')]()[_0xc014('0x25')](function(){var _0x7f47ef=_0x1d6020[_0xc014('0x27')]({'plain':!![]});var _0x5676a3=_0xc014('0x28');return db[_0xc014('0x29')][_0xc014('0x26')]({'where':{'type':_0x5676a3,'resourceId':_0x7f47ef['id']}})[_0xc014('0x25')](function(){return _0x1d6020;});})['then'](function(){_0x2e5c30[_0xc014('0x1a')](0xcc)[_0xc014('0x1b')]();});}};}function handleEntityNotFound(_0x151705,_0x30e97a){return function(_0x21cd81){if(!_0x21cd81){_0x151705[_0xc014('0x19')](0x194);}return _0x21cd81;};}function handleError(_0x106a33,_0x6d69b){_0x6d69b=_0x6d69b||0x1f4;return function(_0x93186){logger[_0xc014('0x2a')](_0x93186[_0xc014('0x2b')]);if(_0x93186['name']){delete _0x93186[_0xc014('0x2c')];}_0x106a33['status'](_0x6d69b)['send'](_0x93186);};}exports['index']=function(_0x40fae2,_0x2c041f){var _0x5aeb3b={},_0x32b089={},_0x2b7379={'count':0x0,'rows':[]};var _0x2d1859=_[_0xc014('0x2d')](db[_0xc014('0x2e')][_0xc014('0x2f')],function(_0x3e6c54){return{'name':_0x3e6c54[_0xc014('0x30')],'type':_0x3e6c54[_0xc014('0x31')][_0xc014('0x32')]};});_0x32b089[_0xc014('0x33')]=_[_0xc014('0x2d')](_0x2d1859,'name');_0x32b089[_0xc014('0x34')]=_['keys'](_0x40fae2[_0xc014('0x34')]);_0x32b089[_0xc014('0x35')]=_[_0xc014('0x36')](_0x32b089[_0xc014('0x33')],_0x32b089[_0xc014('0x34')]);_0x5aeb3b[_0xc014('0x37')]=_[_0xc014('0x36')](_0x32b089['model'],qs[_0xc014('0x38')](_0x40fae2['query'][_0xc014('0x38')]));_0x5aeb3b[_0xc014('0x37')]=_0x5aeb3b[_0xc014('0x37')][_0xc014('0x39')]?_0x5aeb3b[_0xc014('0x37')]:_0x32b089[_0xc014('0x33')];if(!_0x40fae2[_0xc014('0x34')]['hasOwnProperty'](_0xc014('0x3a'))){_0x5aeb3b[_0xc014('0x3b')]=qs[_0xc014('0x3b')](_0x40fae2['query'][_0xc014('0x3b')]);_0x5aeb3b[_0xc014('0x1d')]=qs[_0xc014('0x1d')](_0x40fae2['query'][_0xc014('0x1d')]);}_0x5aeb3b['order']=qs[_0xc014('0x3c')](_0x40fae2[_0xc014('0x34')][_0xc014('0x3c')]);_0x5aeb3b[_0xc014('0x3d')]=qs[_0xc014('0x35')](_[_0xc014('0x3e')](_0x40fae2[_0xc014('0x34')],_0x32b089[_0xc014('0x35')]),_0x2d1859);if(_0x40fae2[_0xc014('0x34')][_0xc014('0x3f')]){_0x5aeb3b[_0xc014('0x3d')]=_[_0xc014('0x40')](_0x5aeb3b['where'],{'$or':_[_0xc014('0x2d')](_0x2d1859,function(_0x368dd6){if(_0x368dd6[_0xc014('0x31')]!==_0xc014('0x41')){var _0x4dc56f={};_0x4dc56f[_0x368dd6[_0xc014('0x2c')]]={'$like':'%'+_0x40fae2['query'][_0xc014('0x3f')]+'%'};return _0x4dc56f;}})});}_0x5aeb3b=_[_0xc014('0x40')]({},_0x5aeb3b,_0x40fae2[_0xc014('0x42')]);var _0x3aa2bc={'where':_0x5aeb3b[_0xc014('0x3d')]};return db[_0xc014('0x2e')][_0xc014('0x1f')](_0x3aa2bc)[_0xc014('0x25')](function(_0x84720d){_0x2b7379[_0xc014('0x1f')]=_0x84720d;if(_0x40fae2[_0xc014('0x34')]['includeAll']){_0x5aeb3b[_0xc014('0x43')]=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0x5aeb3b);})[_0xc014('0x25')](function(_0x8da85e){_0x2b7379[_0xc014('0x44')]=_0x8da85e;return _0x2b7379;})[_0xc014('0x25')](respondWithFilteredResult(_0x2c041f,_0x5aeb3b))[_0xc014('0x45')](handleError(_0x2c041f,null));};exports['show']=function(_0x317897,_0x328956){var _0x501a3e={'raw':!![],'where':{'id':_0x317897[_0xc014('0x46')]['id']}},_0x1b145f={};_0x1b145f[_0xc014('0x33')]=_[_0xc014('0x47')](db[_0xc014('0x2e')][_0xc014('0x2f')]);_0x1b145f[_0xc014('0x34')]=_[_0xc014('0x47')](_0x317897[_0xc014('0x34')]);_0x1b145f['filters']=_[_0xc014('0x36')](_0x1b145f[_0xc014('0x33')],_0x1b145f[_0xc014('0x34')]);_0x501a3e[_0xc014('0x37')]=_[_0xc014('0x36')](_0x1b145f[_0xc014('0x33')],qs[_0xc014('0x38')](_0x317897[_0xc014('0x34')][_0xc014('0x38')]));_0x501a3e['attributes']=_0x501a3e[_0xc014('0x37')]['length']?_0x501a3e['attributes']:_0x1b145f[_0xc014('0x33')];if(_0x317897['query'][_0xc014('0x48')]){_0x501a3e[_0xc014('0x43')]=[{'all':!![]}];}_0x501a3e=_['merge']({},_0x501a3e,_0x317897[_0xc014('0x42')]);return db[_0xc014('0x2e')][_0xc014('0x49')](_0x501a3e)[_0xc014('0x25')](handleEntityNotFound(_0x328956,null))[_0xc014('0x25')](respondWithResult(_0x328956,null))[_0xc014('0x45')](handleError(_0x328956,null));};exports['create']=function(_0x1b0738,_0x1d85d1){return db[_0xc014('0x2e')][_0xc014('0x4a')](_0x1b0738[_0xc014('0x4b')],{})[_0xc014('0x25')](function(_0x255a3b){var _0x14af79=_0x1b0738[_0xc014('0x4c')][_0xc014('0x27')]({'plain':!![]});if(!_0x14af79)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14af79[_0xc014('0x4d')]===_0xc014('0x4c')){var _0x2b60f8=_0x255a3b[_0xc014('0x27')]({'plain':!![]});var _0x53676a=_0xc014('0x28');return db[_0xc014('0x4e')][_0xc014('0x49')]({'where':{'name':_0x53676a,'userProfileId':_0x14af79[_0xc014('0x4f')]},'raw':!![]})[_0xc014('0x25')](function(_0x2dfb69){if(_0x2dfb69&&_0x2dfb69[_0xc014('0x50')]===0x0){return db[_0xc014('0x29')][_0xc014('0x4a')]({'name':_0x2b60f8[_0xc014('0x2c')],'resourceId':_0x2b60f8['id'],'type':_0x2dfb69[_0xc014('0x2c')],'sectionId':_0x2dfb69['id']},{})[_0xc014('0x25')](function(){return _0x255a3b;});}else{return _0x255a3b;}})[_0xc014('0x45')](function(_0xc58284){logger[_0xc014('0x2a')](_0xc014('0x51'),_0xc58284);throw _0xc58284;});}return _0x255a3b;})['then'](respondWithResult(_0x1d85d1,0xc9))[_0xc014('0x45')](handleError(_0x1d85d1,null));};exports['update']=function(_0x1a97a4,_0x4541ba){if(_0x1a97a4['body']['id']){delete _0x1a97a4[_0xc014('0x4b')]['id'];}return db[_0xc014('0x2e')]['find']({'where':{'id':_0x1a97a4['params']['id']}})[_0xc014('0x25')](handleEntityNotFound(_0x4541ba,null))[_0xc014('0x25')](saveUpdates(_0x1a97a4['body'],null))[_0xc014('0x25')](respondWithResult(_0x4541ba,null))['catch'](handleError(_0x4541ba,null));};exports[_0xc014('0x26')]=function(_0x22f6c2,_0xadc160){return db['SmsQueue'][_0xc014('0x49')]({'where':{'id':_0x22f6c2['params']['id']}})[_0xc014('0x25')](handleEntityNotFound(_0xadc160,null))[_0xc014('0x25')](removeEntity(_0xadc160,null))['catch'](handleError(_0xadc160,null));};exports['describe']=function(_0x3dbfb,_0x153929){return db['SmsQueue'][_0xc014('0x52')]()['then'](respondWithResult(_0x153929,null))['catch'](handleError(_0x153929,null));};exports[_0xc014('0x53')]=function(_0x40b2a8,_0x1d0376,_0x224da8){var _0x4c9e8f={'raw':!![],'where':{}},_0x47fe6d={},_0x161aa8;return db[_0xc014('0x2e')][_0xc014('0x54')]({'where':{'id':_0x40b2a8[_0xc014('0x46')]['id']}})[_0xc014('0x25')](handleEntityNotFound(_0x1d0376,null))[_0xc014('0x25')](function(_0x386ef9){if(_0x386ef9){_0x161aa8=_0x386ef9[_0xc014('0x27')]({'plain':!![]});_0x47fe6d[_0xc014('0x33')]=_[_0xc014('0x47')](db[_0xc014('0x55')][_0xc014('0x2f')]);_0x47fe6d[_0xc014('0x34')]=_['keys'](_0x40b2a8[_0xc014('0x34')]);_0x47fe6d['filters']=_[_0xc014('0x36')](_0x47fe6d[_0xc014('0x33')],_0x47fe6d[_0xc014('0x34')]);_0x4c9e8f[_0xc014('0x37')]=_[_0xc014('0x36')](_0x47fe6d[_0xc014('0x33')],qs[_0xc014('0x38')](_0x40b2a8['query'][_0xc014('0x38')]));_0x4c9e8f[_0xc014('0x37')]=_0x4c9e8f[_0xc014('0x37')]['length']?_0x4c9e8f[_0xc014('0x37')]:_0x47fe6d[_0xc014('0x33')];if(!_0x40b2a8[_0xc014('0x34')][_0xc014('0x56')](_0xc014('0x3a'))){_0x4c9e8f[_0xc014('0x3b')]=qs[_0xc014('0x3b')](_0x40b2a8[_0xc014('0x34')][_0xc014('0x3b')]);_0x4c9e8f['offset']=qs[_0xc014('0x1d')](_0x40b2a8[_0xc014('0x34')][_0xc014('0x1d')]);}_0x4c9e8f['order']=qs[_0xc014('0x3c')](_0x40b2a8[_0xc014('0x34')][_0xc014('0x3c')]);_0x4c9e8f[_0xc014('0x3d')]=qs[_0xc014('0x35')](_[_0xc014('0x3e')](_0x40b2a8[_0xc014('0x34')],_0x47fe6d[_0xc014('0x35')]));_0x4c9e8f[_0xc014('0x3d')][_0xc014('0x57')]=_0x386ef9['id'];if(_0x40b2a8['query'][_0xc014('0x3f')]){_0x4c9e8f['where']=_['merge'](_0x4c9e8f[_0xc014('0x3d')],{'$or':_[_0xc014('0x2d')](_0x4c9e8f[_0xc014('0x37')],function(_0x422ab6){var _0x2e9a64={};_0x2e9a64[_0x422ab6]={'$like':'%'+_0x40b2a8[_0xc014('0x34')][_0xc014('0x3f')]+'%'};return _0x2e9a64;})});}_0x4c9e8f=_['merge']({},_0x4c9e8f,_0x40b2a8[_0xc014('0x42')]);return db['UserSmsQueue']['findAll'](_0x4c9e8f);}})[_0xc014('0x25')](function(_0x48cb9f){if(_0x48cb9f){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x48cb9f,_0xc014('0x58')),'role':_0xc014('0x59')},'attributes':['id',_0xc014('0x2c'),_0xc014('0x5a'),_0xc014('0x5b'),_0xc014('0x5c')]});}})[_0xc014('0x25')](function(_0x1fcd84){if(_0x1fcd84){return{'count':_0x1fcd84['count'],'rows':_[_0xc014('0x2d')](_0x1fcd84['rows'],function(_0x4b57f9){return{'membername':_0x4b57f9['name'],'UserId':_0x4b57f9['id'],'queue_name':_0x161aa8[_0xc014('0x2c')],'SmsQueueId':_0x161aa8['id'],'interface':util[_0xc014('0x5d')](_0xc014('0x5e'),_0xc014('0x5f'),_0x4b57f9[_0xc014('0x2c')]),'penalty':0x0,'paused':_0x4b57f9[_0xc014('0x5a')],'createdAt':_0x4b57f9[_0xc014('0x5c')],'updatedAt':_0x4b57f9[_0xc014('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1d0376,_0x4c9e8f))[_0xc014('0x45')](handleError(_0x1d0376,null));};exports[_0xc014('0x60')]=function(_0x20e9e3,_0x56dad4,_0x594ec9){var _0x57b586={};var _0x1309ca={};var _0x591a17;var _0x1484f3;return db[_0xc014('0x2e')][_0xc014('0x54')]({'where':{'id':_0x20e9e3[_0xc014('0x46')]['id']}})[_0xc014('0x25')](handleEntityNotFound(_0x56dad4,null))[_0xc014('0x25')](function(_0x1ac336){if(_0x1ac336){_0x591a17=_0x1ac336;_0x1309ca[_0xc014('0x33')]=_[_0xc014('0x47')](db[_0xc014('0x61')][_0xc014('0x2f')]);_0x1309ca[_0xc014('0x34')]=_[_0xc014('0x47')](_0x20e9e3[_0xc014('0x34')]);_0x1309ca[_0xc014('0x35')]=_[_0xc014('0x36')](_0x1309ca[_0xc014('0x33')],_0x1309ca['query']);_0x57b586[_0xc014('0x37')]=_[_0xc014('0x36')](_0x1309ca[_0xc014('0x33')],qs[_0xc014('0x38')](_0x20e9e3[_0xc014('0x34')][_0xc014('0x38')]));_0x57b586[_0xc014('0x37')]=_0x57b586[_0xc014('0x37')]['length']?_0x57b586['attributes']:_0x1309ca['model'];_0x57b586[_0xc014('0x62')]=qs[_0xc014('0x3c')](_0x20e9e3[_0xc014('0x34')][_0xc014('0x3c')]);_0x57b586[_0xc014('0x3d')]=qs[_0xc014('0x35')](_[_0xc014('0x3e')](_0x20e9e3[_0xc014('0x34')],_0x1309ca[_0xc014('0x35')]));if(_0x20e9e3[_0xc014('0x34')][_0xc014('0x3f')]){_0x57b586[_0xc014('0x3d')]=_['merge'](_0x57b586[_0xc014('0x3d')],{'$or':_[_0xc014('0x2d')](_0x57b586[_0xc014('0x37')],function(_0x2cdefc){var _0xdf1e3b={};_0xdf1e3b[_0x2cdefc]={'$like':'%'+_0x20e9e3[_0xc014('0x34')][_0xc014('0x3f')]+'%'};return _0xdf1e3b;})});}_0x57b586=_[_0xc014('0x40')]({},_0x57b586,_0x20e9e3['options']);return _0x591a17[_0xc014('0x60')](_0x57b586);}})[_0xc014('0x25')](function(_0x19f271){if(_0x19f271){_0x1484f3=_0x19f271[_0xc014('0x39')];if(!_0x20e9e3[_0xc014('0x34')]['hasOwnProperty'](_0xc014('0x3a'))){_0x57b586[_0xc014('0x3b')]=qs['limit'](_0x20e9e3['query'][_0xc014('0x3b')]);_0x57b586[_0xc014('0x1d')]=qs['offset'](_0x20e9e3['query'][_0xc014('0x1d')]);}return _0x591a17[_0xc014('0x60')](_0x57b586);}})[_0xc014('0x25')](function(_0x5bbd6c){if(_0x5bbd6c){return _0x5bbd6c?{'count':_0x1484f3,'rows':_0x5bbd6c}:null;}})[_0xc014('0x25')](respondWithResult(_0x56dad4,null))[_0xc014('0x45')](handleError(_0x56dad4,null));};exports['addTeams']=function(_0x10c73f,_0x3cfc71,_0x3ac982){var _0x5a7ddb=_0x10c73f['body'][_0xc014('0x63')];return db[_0xc014('0x61')][_0xc014('0x64')]({'where':{'id':_0x5a7ddb},'attributes':['id'],'include':[{'model':db[_0xc014('0x65')],'as':_0xc014('0x66'),'attributes':['id',_0xc014('0x2c'),_0xc014('0x67'),_0xc014('0x68'),_0xc014('0x69')],'raw':!![]}]})[_0xc014('0x25')](function(_0x2ea7d6){if(_0x2ea7d6){var _0x209fbe=_[_0xc014('0x6a')](_0x2ea7d6,function(_0x1ff504){var _0x5748f7=_0x1ff504[_0xc014('0x27')]({'plain':!![]});return _0x5748f7['Agents'];});return db[_0xc014('0x2e')][_0xc014('0x49')]({'where':{'id':_0x10c73f[_0xc014('0x46')]['id']}})['then'](function(_0xc021c){return db[_0xc014('0x6b')][_0xc014('0x6c')](function(_0x3e7e69){return _0xc021c[_0xc014('0x6d')](_0x5a7ddb,{'transaction':_0x3e7e69})['then'](function(){return BPromise[_0xc014('0x6e')](_0x209fbe,function(_0x186d9b){return db[_0xc014('0x55')][_0xc014('0x6f')]({'where':{'UserId':_0x186d9b['id'],'SmsQueueId':_0x10c73f[_0xc014('0x46')]['id']},'transaction':_0x3e7e69});});})['then'](function(){_0x209fbe[_0xc014('0x70')](function(_0x4b1850){socket[_0xc014('0x71')]('userSmsQueue:save',{'UserId':_0x4b1850['id'],'SmsQueueId':_0xc021c['id']});});});});});}})[_0xc014('0x25')](respondWithStatusCode(_0x3cfc71,null))[_0xc014('0x45')](handleError(_0x3cfc71,null));};exports[_0xc014('0x72')]=function(_0x4c5e3e,_0x39dd7d,_0x4be189){return db['Team']['findAll']({'where':{'id':_0x4c5e3e[_0xc014('0x34')][_0xc014('0x63')]},'attributes':['id'],'include':[{'model':db[_0xc014('0x65')],'as':_0xc014('0x66'),'attributes':['id'],'raw':!![]}]})[_0xc014('0x25')](handleEntityNotFound(_0x39dd7d,null))['then'](function(_0x570a2e){var _0x5ca23c=_[_0xc014('0x2d')](_0x570a2e,'id');var _0x3e9132=[];var _0x966c27=[];var _0x57b349=squel[_0xc014('0x73')]();_0x57b349[_0xc014('0x74')]('tq.TeamId')[_0xc014('0x75')](_0xc014('0x76'),'tq')['join']('user_has_teams','ut',_0xc014('0x77'))[_0xc014('0x3d')]('SmsQueueId\x20=\x20?',_0x4c5e3e['params']['id']);for(var _0x4f6553=0x0;_0x4f6553<_0x570a2e[_0xc014('0x39')];_0x4f6553+=0x1){let _0x59a0ca=_0x570a2e[_0x4f6553];for(var _0x1b758a=0x0;_0x1b758a<_0x59a0ca['Agents'][_0xc014('0x39')];_0x1b758a+=0x1){let _0x5435d5=_0x59a0ca[_0xc014('0x66')][_0x1b758a];var _0x411c3f=_0x57b349['clone']();_0x411c3f[_0xc014('0x3d')]('ut.UserId\x20=\x20?',_0x5435d5['id']);_0x966c27[_0xc014('0x78')](db['sequelize'][_0xc014('0x34')](_0x411c3f[_0xc014('0x79')](),{'type':db[_0xc014('0x6b')][_0xc014('0x7a')][_0xc014('0x7b')]})[_0xc014('0x25')](function(_0x58d87a){if(_0x58d87a[_0xc014('0x39')]===0x1){return _0x5435d5['id'];}else{var _0x25b6ea=_[_0xc014('0x7c')](_[_0xc014('0x2d')](_0x58d87a,'TeamId'),function(_0x316811){return _[_0xc014('0x7d')](_0x5ca23c,_0x316811);});if(_0x25b6ea){return _0x5435d5['id'];}}}));}}return BPromise[_0xc014('0x7e')](_0x966c27)['then'](function(_0x434f25){_0x3e9132=_(_0x3e9132)['union'](_0x434f25)[_0xc014('0x7f')]()[_0xc014('0x80')]();return db[_0xc014('0x2e')]['find']({'where':{'id':_0x4c5e3e[_0xc014('0x46')]['id']}})[_0xc014('0x25')](function(_0x2482da){return db['sequelize'][_0xc014('0x6c')](function(_0x1f2983){return _0x2482da['removeTeams'](_0x4c5e3e[_0xc014('0x34')][_0xc014('0x63')],{'transaction':_0x1f2983})[_0xc014('0x25')](function(){if(!_[_0xc014('0x81')](_0x3e9132)){return _0x2482da[_0xc014('0x82')](_0x3e9132,{'transaction':_0x1f2983});}})['then'](function(){_0x3e9132['forEach'](function(_0x1b5cd5){socket[_0xc014('0x71')]('userSmsQueue:remove',{'UserId':_0x1b5cd5,'SmsQueueId':_0x2482da['id']});});});});});});})[_0xc014('0x25')](respondWithStatusCode(_0x39dd7d,null))[_0xc014('0x45')](handleError(_0x39dd7d,null));};exports[_0xc014('0x83')]=function(_0x2322f8,_0x424b91,_0x485a58){return db['SmsQueue']['find']({'where':{'id':_0x2322f8['params']['id']}})[_0xc014('0x25')](handleEntityNotFound(_0x424b91,null))[_0xc014('0x25')](function(_0x284868){if(_0x284868){return _0x284868[_0xc014('0x83')](_0x2322f8[_0xc014('0x4b')][_0xc014('0x63')],_[_0xc014('0x84')](_0x2322f8['body'],[_0xc014('0x63'),'id'])||{})[_0xc014('0x85')](function(_0x39e53e){for(var _0x35ed70=0x0;_0x35ed70<_0x2322f8['body']['ids'][_0xc014('0x39')];_0x35ed70+=0x1){socket[_0xc014('0x71')](_0xc014('0x86'),{'UserId':Number(_0x2322f8[_0xc014('0x4b')][_0xc014('0x63')][_0x35ed70]),'SmsQueueId':Number(_0x2322f8[_0xc014('0x46')]['id'])});}return _0x39e53e;});}})[_0xc014('0x25')](respondWithResult(_0x424b91,null))[_0xc014('0x45')](handleError(_0x424b91,null));};exports[_0xc014('0x82')]=function(_0xc9353f,_0x1f3243,_0x456879){return db['SmsQueue'][_0xc014('0x49')]({'where':{'id':_0xc9353f[_0xc014('0x46')]['id']}})[_0xc014('0x25')](handleEntityNotFound(_0x1f3243,null))[_0xc014('0x25')](function(_0x63eb99){if(_0x63eb99){return _0x63eb99[_0xc014('0x82')](_0xc9353f[_0xc014('0x34')][_0xc014('0x63')])[_0xc014('0x25')](function(){if(_[_0xc014('0x87')](_0xc9353f['query'][_0xc014('0x63')])){for(var _0x16a22f=0x0;_0x16a22f<_0xc9353f['query'][_0xc014('0x63')][_0xc014('0x39')];_0x16a22f+=0x1){socket[_0xc014('0x71')](_0xc014('0x88'),{'UserId':Number(_0xc9353f[_0xc014('0x34')][_0xc014('0x63')][_0x16a22f]),'SmsQueueId':Number(_0xc9353f[_0xc014('0x46')]['id'])});}}else{socket['emit']('userSmsQueue:remove',{'UserId':Number(_0xc9353f[_0xc014('0x34')]['ids']),'SmsQueueId':Number(_0xc9353f[_0xc014('0x46')]['id'])});}});}})['then'](respondWithStatusCode(_0x1f3243,null))['catch'](handleError(_0x1f3243,null));};exports[_0xc014('0x89')]=function(_0x26b22d,_0x5942fb,_0x2fbf5c){var _0x122eea={};var _0x323b31={};var _0x2bb4d3;var _0x1f7c22;return db[_0xc014('0x2e')][_0xc014('0x54')]({'where':{'id':_0x26b22d['params']['id']}})[_0xc014('0x25')](handleEntityNotFound(_0x5942fb,null))[_0xc014('0x25')](function(_0x3f231c){if(_0x3f231c){_0x2bb4d3=_0x3f231c;_0x323b31[_0xc014('0x33')]=_[_0xc014('0x47')](db[_0xc014('0x65')]['rawAttributes']);_0x323b31[_0xc014('0x34')]=_[_0xc014('0x47')](_0x26b22d[_0xc014('0x34')]);_0x323b31[_0xc014('0x35')]=_['intersection'](_0x323b31['model'],_0x323b31[_0xc014('0x34')]);_0x122eea[_0xc014('0x37')]=_[_0xc014('0x36')](_0x323b31[_0xc014('0x33')],qs[_0xc014('0x38')](_0x26b22d['query'][_0xc014('0x38')]));_0x122eea[_0xc014('0x37')]=_0x122eea[_0xc014('0x37')]['length']?_0x122eea[_0xc014('0x37')]:_0x323b31[_0xc014('0x33')];_0x122eea[_0xc014('0x62')]=qs[_0xc014('0x3c')](_0x26b22d[_0xc014('0x34')][_0xc014('0x3c')]);_0x122eea[_0xc014('0x3d')]=qs[_0xc014('0x35')](_[_0xc014('0x3e')](_0x26b22d[_0xc014('0x34')],_0x323b31[_0xc014('0x35')]));if(_0x26b22d[_0xc014('0x34')]['filter']){_0x122eea['where']=_[_0xc014('0x40')](_0x122eea[_0xc014('0x3d')],{'$or':_[_0xc014('0x2d')](_0x122eea[_0xc014('0x37')],function(_0x38e7a5){var _0x1b3d4a={};_0x1b3d4a[_0x38e7a5]={'$like':'%'+_0x26b22d[_0xc014('0x34')][_0xc014('0x3f')]+'%'};return _0x1b3d4a;})});}_0x122eea=_[_0xc014('0x40')]({},_0x122eea,_0x26b22d[_0xc014('0x42')]);return _0x2bb4d3[_0xc014('0x89')](_0x122eea);}})[_0xc014('0x25')](function(_0x418855){if(_0x418855){_0x1f7c22=_0x418855[_0xc014('0x39')];if(!_0x26b22d[_0xc014('0x34')]['hasOwnProperty'](_0xc014('0x3a'))){_0x122eea[_0xc014('0x3b')]=qs[_0xc014('0x3b')](_0x26b22d['query']['limit']);_0x122eea['offset']=qs[_0xc014('0x1d')](_0x26b22d['query'][_0xc014('0x1d')]);}return _0x2bb4d3[_0xc014('0x89')](_0x122eea);}})['then'](function(_0x322af8){if(_0x322af8){return _0x322af8?{'count':_0x1f7c22,'rows':_0x322af8}:null;}})[_0xc014('0x25')](respondWithResult(_0x5942fb,null))[_0xc014('0x45')](handleError(_0x5942fb,null));}; \ No newline at end of file +var _0x0598=['value','isEmpty','emit','userSmsQueue:remove','addAgents','removeAgents','isArray','getAgents','eml-format','rimraf','fast-json-patch','bluebird','mustache','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','json','offset','undefined','limit','Content-Range','reject','save','update','then','destroy','get','SmsQueues','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','count','includeAll','include','SmsQueue','findAll','rows','catch','show','params','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','nolimit','order','SmsQueueId','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','sequelize','QueryTypes','SELECT','every','TeamId','all','union','compact'];(function(_0x77b868,_0x45ea4b){var _0x1f54ea=function(_0x3cb8a6){while(--_0x3cb8a6){_0x77b868['push'](_0x77b868['shift']());}};_0x1f54ea(++_0x45ea4b);}(_0x0598,0x92));var _0x8059=function(_0x307cf8,_0x1f144a){_0x307cf8=_0x307cf8-0x0;var _0x1c5d9d=_0x0598[_0x307cf8];return _0x1c5d9d;};'use strict';var emlformat=require(_0x8059('0x0'));var rimraf=require(_0x8059('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8059('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8059('0x3'));var Mustache=require(_0x8059('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8059('0x5'));var ejs=require(_0x8059('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8059('0x7'));var crypto=require(_0x8059('0x8'));var jsforce=require(_0x8059('0x9'));var deskjs=require(_0x8059('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8059('0xb'));var Redis=require(_0x8059('0xc'));var authService=require(_0x8059('0xd'));var qs=require(_0x8059('0xe'));var as=require(_0x8059('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8059('0x10'));var utils=require(_0x8059('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x8059('0x12')]=_[_0x8059('0x13')](config[_0x8059('0x12')],{'host':_0x8059('0x14'),'port':0x18eb});var socket=require(_0x8059('0x15'))(new Redis(config['redis']));require(_0x8059('0x16'))['register'](socket);function respondWithStatusCode(_0x346b23,_0x5c916e){_0x5c916e=_0x5c916e||0xcc;return function(_0x3e4f08){if(_0x3e4f08){return _0x346b23[_0x8059('0x17')](_0x5c916e);}return _0x346b23[_0x8059('0x18')](_0x5c916e)['end']();};}function respondWithResult(_0x516c1f,_0x5cda43){_0x5cda43=_0x5cda43||0xc8;return function(_0x3b8f18){if(_0x3b8f18){return _0x516c1f[_0x8059('0x18')](_0x5cda43)[_0x8059('0x19')](_0x3b8f18);}};}function respondWithFilteredResult(_0x246c9d,_0x3abfe8){return function(_0x4b6d55){if(_0x4b6d55){var _0x10ad98=typeof _0x3abfe8[_0x8059('0x1a')]===_0x8059('0x1b')&&typeof _0x3abfe8[_0x8059('0x1c')]==='undefined';var _0x5456a9=_0x4b6d55['count'];var _0x113f42=_0x10ad98?0x0:_0x3abfe8['offset'];var _0x1857c1=_0x10ad98?_0x4b6d55['count']:_0x3abfe8[_0x8059('0x1a')]+_0x3abfe8[_0x8059('0x1c')];var _0x1e9ac5;if(_0x1857c1>=_0x5456a9){_0x1857c1=_0x5456a9;_0x1e9ac5=0xc8;}else{_0x1e9ac5=0xce;}_0x246c9d['status'](_0x1e9ac5);return _0x246c9d['set'](_0x8059('0x1d'),_0x113f42+'-'+_0x1857c1+'/'+_0x5456a9)[_0x8059('0x19')](_0x4b6d55);}return null;};}function patchUpdates(_0x32aeda){return function(_0x1585a3){try{jsonpatch['apply'](_0x1585a3,_0x32aeda,!![]);}catch(_0x3bc226){return BPromise[_0x8059('0x1e')](_0x3bc226);}return _0x1585a3[_0x8059('0x1f')]();};}function saveUpdates(_0x5449d9,_0xe9a72d){return function(_0x2256b1){if(_0x2256b1){return _0x2256b1[_0x8059('0x20')](_0x5449d9)[_0x8059('0x21')](function(_0x59d3a6){return _0x59d3a6;});}return null;};}function removeEntity(_0x140f64,_0x2cd179){return function(_0x4781e2){if(_0x4781e2){return _0x4781e2[_0x8059('0x22')]()[_0x8059('0x21')](function(){var _0x54b88b=_0x4781e2[_0x8059('0x23')]({'plain':!![]});var _0x19b95a=_0x8059('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x19b95a,'resourceId':_0x54b88b['id']}})['then'](function(){return _0x4781e2;});})[_0x8059('0x21')](function(){_0x140f64[_0x8059('0x18')](0xcc)[_0x8059('0x25')]();});}};}function handleEntityNotFound(_0x1009af,_0x59abe9){return function(_0x1eb71b){if(!_0x1eb71b){_0x1009af['sendStatus'](0x194);}return _0x1eb71b;};}function handleError(_0x2f887c,_0x35c73e){_0x35c73e=_0x35c73e||0x1f4;return function(_0x5ecf7f){logger[_0x8059('0x26')](_0x5ecf7f[_0x8059('0x27')]);if(_0x5ecf7f[_0x8059('0x28')]){delete _0x5ecf7f[_0x8059('0x28')];}_0x2f887c[_0x8059('0x18')](_0x35c73e)[_0x8059('0x29')](_0x5ecf7f);};}exports[_0x8059('0x2a')]=function(_0x2016ea,_0x505756){var _0xb3c36e={},_0x40b39e={},_0x1f8983={'count':0x0,'rows':[]};var _0x15f843=_[_0x8059('0x2b')](db['SmsQueue'][_0x8059('0x2c')],function(_0x22c492){return{'name':_0x22c492[_0x8059('0x2d')],'type':_0x22c492[_0x8059('0x2e')][_0x8059('0x2f')]};});_0x40b39e[_0x8059('0x30')]=_[_0x8059('0x2b')](_0x15f843,_0x8059('0x28'));_0x40b39e[_0x8059('0x31')]=_[_0x8059('0x32')](_0x2016ea['query']);_0x40b39e[_0x8059('0x33')]=_['intersection'](_0x40b39e[_0x8059('0x30')],_0x40b39e['query']);_0xb3c36e['attributes']=_[_0x8059('0x34')](_0x40b39e['model'],qs[_0x8059('0x35')](_0x2016ea['query'][_0x8059('0x35')]));_0xb3c36e['attributes']=_0xb3c36e[_0x8059('0x36')][_0x8059('0x37')]?_0xb3c36e['attributes']:_0x40b39e[_0x8059('0x30')];if(!_0x2016ea[_0x8059('0x31')][_0x8059('0x38')]('nolimit')){_0xb3c36e[_0x8059('0x1c')]=qs['limit'](_0x2016ea[_0x8059('0x31')]['limit']);_0xb3c36e[_0x8059('0x1a')]=qs[_0x8059('0x1a')](_0x2016ea[_0x8059('0x31')][_0x8059('0x1a')]);}_0xb3c36e['order']=qs[_0x8059('0x39')](_0x2016ea['query']['sort']);_0xb3c36e[_0x8059('0x3a')]=qs[_0x8059('0x33')](_[_0x8059('0x3b')](_0x2016ea[_0x8059('0x31')],_0x40b39e[_0x8059('0x33')]),_0x15f843);if(_0x2016ea['query']['filter']){_0xb3c36e['where']=_['merge'](_0xb3c36e[_0x8059('0x3a')],{'$or':_[_0x8059('0x2b')](_0x15f843,function(_0xc84f04){if(_0xc84f04['type']!==_0x8059('0x3c')){var _0x406ec3={};_0x406ec3[_0xc84f04['name']]={'$like':'%'+_0x2016ea[_0x8059('0x31')][_0x8059('0x3d')]+'%'};return _0x406ec3;}})});}_0xb3c36e=_[_0x8059('0x3e')]({},_0xb3c36e,_0x2016ea['options']);var _0x2c48cf={'where':_0xb3c36e[_0x8059('0x3a')]};return db['SmsQueue'][_0x8059('0x3f')](_0x2c48cf)[_0x8059('0x21')](function(_0x3f00de){_0x1f8983[_0x8059('0x3f')]=_0x3f00de;if(_0x2016ea[_0x8059('0x31')][_0x8059('0x40')]){_0xb3c36e[_0x8059('0x41')]=[{'all':!![]}];}return db[_0x8059('0x42')][_0x8059('0x43')](_0xb3c36e);})[_0x8059('0x21')](function(_0x1d64db){_0x1f8983[_0x8059('0x44')]=_0x1d64db;return _0x1f8983;})[_0x8059('0x21')](respondWithFilteredResult(_0x505756,_0xb3c36e))[_0x8059('0x45')](handleError(_0x505756,null));};exports[_0x8059('0x46')]=function(_0x93ee2f,_0x35c94a){var _0x25f542={'raw':!![],'where':{'id':_0x93ee2f[_0x8059('0x47')]['id']}},_0x1b613f={};_0x1b613f[_0x8059('0x30')]=_[_0x8059('0x32')](db[_0x8059('0x42')]['rawAttributes']);_0x1b613f[_0x8059('0x31')]=_['keys'](_0x93ee2f['query']);_0x1b613f[_0x8059('0x33')]=_['intersection'](_0x1b613f[_0x8059('0x30')],_0x1b613f['query']);_0x25f542[_0x8059('0x36')]=_[_0x8059('0x34')](_0x1b613f[_0x8059('0x30')],qs[_0x8059('0x35')](_0x93ee2f[_0x8059('0x31')][_0x8059('0x35')]));_0x25f542['attributes']=_0x25f542[_0x8059('0x36')]['length']?_0x25f542[_0x8059('0x36')]:_0x1b613f[_0x8059('0x30')];if(_0x93ee2f[_0x8059('0x31')]['includeAll']){_0x25f542[_0x8059('0x41')]=[{'all':!![]}];}_0x25f542=_[_0x8059('0x3e')]({},_0x25f542,_0x93ee2f[_0x8059('0x48')]);return db[_0x8059('0x42')]['find'](_0x25f542)[_0x8059('0x21')](handleEntityNotFound(_0x35c94a,null))[_0x8059('0x21')](respondWithResult(_0x35c94a,null))[_0x8059('0x45')](handleError(_0x35c94a,null));};exports['create']=function(_0x2ba3f1,_0x5d9458){return db['SmsQueue'][_0x8059('0x49')](_0x2ba3f1['body'],{})[_0x8059('0x21')](function(_0x54d2d2){var _0x261967=_0x2ba3f1[_0x8059('0x4a')]['get']({'plain':!![]});if(!_0x261967)throw new Error(_0x8059('0x4b'));if(_0x261967['role']===_0x8059('0x4a')){var _0x7a844b=_0x54d2d2[_0x8059('0x23')]({'plain':!![]});var _0x5d5f16=_0x8059('0x24');return db['UserProfileSection'][_0x8059('0x4c')]({'where':{'name':_0x5d5f16,'userProfileId':_0x261967[_0x8059('0x4d')]},'raw':!![]})[_0x8059('0x21')](function(_0xb63fee){if(_0xb63fee&&_0xb63fee['autoAssociation']===0x0){return db[_0x8059('0x4e')][_0x8059('0x49')]({'name':_0x7a844b['name'],'resourceId':_0x7a844b['id'],'type':_0xb63fee[_0x8059('0x28')],'sectionId':_0xb63fee['id']},{})['then'](function(){return _0x54d2d2;});}else{return _0x54d2d2;}})[_0x8059('0x45')](function(_0x547ffb){logger['error'](_0x8059('0x4f'),_0x547ffb);throw _0x547ffb;});}return _0x54d2d2;})[_0x8059('0x21')](respondWithResult(_0x5d9458,0xc9))[_0x8059('0x45')](handleError(_0x5d9458,null));};exports[_0x8059('0x20')]=function(_0x3e1a6f,_0x153c4a){if(_0x3e1a6f[_0x8059('0x50')]['id']){delete _0x3e1a6f['body']['id'];}return db['SmsQueue']['find']({'where':{'id':_0x3e1a6f['params']['id']}})[_0x8059('0x21')](handleEntityNotFound(_0x153c4a,null))[_0x8059('0x21')](saveUpdates(_0x3e1a6f['body'],null))[_0x8059('0x21')](respondWithResult(_0x153c4a,null))['catch'](handleError(_0x153c4a,null));};exports['destroy']=function(_0x1add7c,_0x55cb8d){return db[_0x8059('0x42')][_0x8059('0x4c')]({'where':{'id':_0x1add7c[_0x8059('0x47')]['id']}})['then'](handleEntityNotFound(_0x55cb8d,null))['then'](removeEntity(_0x55cb8d,null))[_0x8059('0x45')](handleError(_0x55cb8d,null));};exports[_0x8059('0x51')]=function(_0x182637,_0x5056e6){return db['SmsQueue'][_0x8059('0x51')]()['then'](respondWithResult(_0x5056e6,null))['catch'](handleError(_0x5056e6,null));};exports[_0x8059('0x52')]=function(_0x51927e,_0x391687,_0x1c4015){var _0x4c5387={'raw':!![],'where':{}},_0x4927bf={},_0x1c8193;return db[_0x8059('0x42')][_0x8059('0x53')]({'where':{'id':_0x51927e['params']['id']}})[_0x8059('0x21')](handleEntityNotFound(_0x391687,null))[_0x8059('0x21')](function(_0xc6b6d8){if(_0xc6b6d8){_0x1c8193=_0xc6b6d8[_0x8059('0x23')]({'plain':!![]});_0x4927bf['model']=_[_0x8059('0x32')](db['UserSmsQueue'][_0x8059('0x2c')]);_0x4927bf[_0x8059('0x31')]=_['keys'](_0x51927e[_0x8059('0x31')]);_0x4927bf['filters']=_[_0x8059('0x34')](_0x4927bf[_0x8059('0x30')],_0x4927bf[_0x8059('0x31')]);_0x4c5387[_0x8059('0x36')]=_[_0x8059('0x34')](_0x4927bf[_0x8059('0x30')],qs[_0x8059('0x35')](_0x51927e[_0x8059('0x31')][_0x8059('0x35')]));_0x4c5387[_0x8059('0x36')]=_0x4c5387[_0x8059('0x36')][_0x8059('0x37')]?_0x4c5387[_0x8059('0x36')]:_0x4927bf['model'];if(!_0x51927e[_0x8059('0x31')][_0x8059('0x38')](_0x8059('0x54'))){_0x4c5387[_0x8059('0x1c')]=qs[_0x8059('0x1c')](_0x51927e['query'][_0x8059('0x1c')]);_0x4c5387[_0x8059('0x1a')]=qs[_0x8059('0x1a')](_0x51927e[_0x8059('0x31')][_0x8059('0x1a')]);}_0x4c5387[_0x8059('0x55')]=qs[_0x8059('0x39')](_0x51927e[_0x8059('0x31')][_0x8059('0x39')]);_0x4c5387['where']=qs[_0x8059('0x33')](_[_0x8059('0x3b')](_0x51927e[_0x8059('0x31')],_0x4927bf['filters']));_0x4c5387['where'][_0x8059('0x56')]=_0xc6b6d8['id'];if(_0x51927e[_0x8059('0x31')][_0x8059('0x3d')]){_0x4c5387[_0x8059('0x3a')]=_[_0x8059('0x3e')](_0x4c5387[_0x8059('0x3a')],{'$or':_[_0x8059('0x2b')](_0x4c5387['attributes'],function(_0x35ec63){var _0x39c5d9={};_0x39c5d9[_0x35ec63]={'$like':'%'+_0x51927e[_0x8059('0x31')]['filter']+'%'};return _0x39c5d9;})});}_0x4c5387=_[_0x8059('0x3e')]({},_0x4c5387,_0x51927e[_0x8059('0x48')]);return db[_0x8059('0x57')][_0x8059('0x43')](_0x4c5387);}})['then'](function(_0x4d806c){if(_0x4d806c){return db[_0x8059('0x58')][_0x8059('0x59')]({'where':{'id':_['map'](_0x4d806c,_0x8059('0x5a')),'role':_0x8059('0x5b')},'attributes':['id',_0x8059('0x28'),_0x8059('0x5c'),_0x8059('0x5d'),_0x8059('0x5e')]});}})['then'](function(_0x3e6600){if(_0x3e6600){return{'count':_0x3e6600[_0x8059('0x3f')],'rows':_[_0x8059('0x2b')](_0x3e6600['rows'],function(_0x5143c8){return{'membername':_0x5143c8[_0x8059('0x28')],'UserId':_0x5143c8['id'],'queue_name':_0x1c8193[_0x8059('0x28')],'SmsQueueId':_0x1c8193['id'],'interface':util['format'](_0x8059('0x5f'),_0x8059('0x60'),_0x5143c8[_0x8059('0x28')]),'penalty':0x0,'paused':_0x5143c8[_0x8059('0x5c')],'createdAt':_0x5143c8[_0x8059('0x5e')],'updatedAt':_0x5143c8[_0x8059('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8059('0x21')](respondWithFilteredResult(_0x391687,_0x4c5387))[_0x8059('0x45')](handleError(_0x391687,null));};exports[_0x8059('0x61')]=function(_0x1a6f36,_0x175802,_0x2bd6a8){var _0x598596={};var _0x407a7d={};var _0x1cec27;var _0x31a0af;return db['SmsQueue']['findOne']({'where':{'id':_0x1a6f36[_0x8059('0x47')]['id']}})['then'](handleEntityNotFound(_0x175802,null))['then'](function(_0x1554ca){if(_0x1554ca){_0x1cec27=_0x1554ca;_0x407a7d[_0x8059('0x30')]=_['keys'](db[_0x8059('0x62')][_0x8059('0x2c')]);_0x407a7d['query']=_['keys'](_0x1a6f36[_0x8059('0x31')]);_0x407a7d['filters']=_['intersection'](_0x407a7d[_0x8059('0x30')],_0x407a7d[_0x8059('0x31')]);_0x598596[_0x8059('0x36')]=_[_0x8059('0x34')](_0x407a7d['model'],qs['fields'](_0x1a6f36[_0x8059('0x31')][_0x8059('0x35')]));_0x598596[_0x8059('0x36')]=_0x598596[_0x8059('0x36')][_0x8059('0x37')]?_0x598596[_0x8059('0x36')]:_0x407a7d['model'];_0x598596['order']=qs[_0x8059('0x39')](_0x1a6f36[_0x8059('0x31')][_0x8059('0x39')]);_0x598596['where']=qs[_0x8059('0x33')](_[_0x8059('0x3b')](_0x1a6f36['query'],_0x407a7d[_0x8059('0x33')]));if(_0x1a6f36[_0x8059('0x31')]['filter']){_0x598596[_0x8059('0x3a')]=_[_0x8059('0x3e')](_0x598596[_0x8059('0x3a')],{'$or':_[_0x8059('0x2b')](_0x598596[_0x8059('0x36')],function(_0x42bd9f){var _0x38ea39={};_0x38ea39[_0x42bd9f]={'$like':'%'+_0x1a6f36[_0x8059('0x31')][_0x8059('0x3d')]+'%'};return _0x38ea39;})});}_0x598596=_['merge']({},_0x598596,_0x1a6f36['options']);return _0x1cec27[_0x8059('0x61')](_0x598596);}})[_0x8059('0x21')](function(_0x3fbdbe){if(_0x3fbdbe){_0x31a0af=_0x3fbdbe[_0x8059('0x37')];if(!_0x1a6f36[_0x8059('0x31')][_0x8059('0x38')]('nolimit')){_0x598596[_0x8059('0x1c')]=qs[_0x8059('0x1c')](_0x1a6f36[_0x8059('0x31')]['limit']);_0x598596[_0x8059('0x1a')]=qs[_0x8059('0x1a')](_0x1a6f36[_0x8059('0x31')][_0x8059('0x1a')]);}return _0x1cec27[_0x8059('0x61')](_0x598596);}})[_0x8059('0x21')](function(_0x902642){if(_0x902642){return _0x902642?{'count':_0x31a0af,'rows':_0x902642}:null;}})[_0x8059('0x21')](respondWithResult(_0x175802,null))[_0x8059('0x45')](handleError(_0x175802,null));};exports[_0x8059('0x63')]=function(_0x43893f,_0x23d558,_0xc56961){var _0x3297b7=_0x43893f[_0x8059('0x50')]['ids'];return db[_0x8059('0x62')][_0x8059('0x43')]({'where':{'id':_0x3297b7},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8059('0x64'),'attributes':['id','name',_0x8059('0x65'),_0x8059('0x66'),_0x8059('0x67')],'raw':!![]}]})[_0x8059('0x21')](function(_0x1e2b15){if(_0x1e2b15){var _0x416c93=_[_0x8059('0x68')](_0x1e2b15,function(_0x3e595c){var _0x589222=_0x3e595c[_0x8059('0x23')]({'plain':!![]});return _0x589222[_0x8059('0x64')];});return db[_0x8059('0x42')]['find']({'where':{'id':_0x43893f['params']['id']}})[_0x8059('0x21')](function(_0x276c67){return db['sequelize'][_0x8059('0x69')](function(_0x4ae0ca){return _0x276c67[_0x8059('0x63')](_0x3297b7,{'transaction':_0x4ae0ca})[_0x8059('0x21')](function(){return BPromise[_0x8059('0x6a')](_0x416c93,function(_0x274ef6){return db[_0x8059('0x57')][_0x8059('0x6b')]({'where':{'UserId':_0x274ef6['id'],'SmsQueueId':_0x43893f[_0x8059('0x47')]['id']},'transaction':_0x4ae0ca});});})[_0x8059('0x21')](function(){_0x416c93[_0x8059('0x6c')](function(_0xe6fdc4){socket['emit'](_0x8059('0x6d'),{'UserId':_0xe6fdc4['id'],'SmsQueueId':_0x276c67['id']});});});});});}})[_0x8059('0x21')](respondWithStatusCode(_0x23d558,null))['catch'](handleError(_0x23d558,null));};exports[_0x8059('0x6e')]=function(_0x24d7cb,_0x41ac30,_0x2e0a9e){return db[_0x8059('0x62')]['findAll']({'where':{'id':_0x24d7cb[_0x8059('0x31')][_0x8059('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x8059('0x58')],'as':_0x8059('0x64'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x41ac30,null))[_0x8059('0x21')](function(_0x371762){var _0x6356ed=_[_0x8059('0x2b')](_0x371762,'id');var _0x299b67=[];var _0x43388b=[];var _0x29e863=squel[_0x8059('0x70')]();_0x29e863[_0x8059('0x71')](_0x8059('0x72'))['from'](_0x8059('0x73'),'tq')[_0x8059('0x74')](_0x8059('0x75'),'ut',_0x8059('0x76'))[_0x8059('0x3a')](_0x8059('0x77'),_0x24d7cb[_0x8059('0x47')]['id']);for(var _0x21f9d1=0x0;_0x21f9d1<_0x371762[_0x8059('0x37')];_0x21f9d1+=0x1){let _0x10817f=_0x371762[_0x21f9d1];for(var _0x5db9a7=0x0;_0x5db9a7<_0x10817f[_0x8059('0x64')][_0x8059('0x37')];_0x5db9a7+=0x1){let _0x2b65c0=_0x10817f[_0x8059('0x64')][_0x5db9a7];var _0x161265=_0x29e863[_0x8059('0x78')]();_0x161265['where']('ut.UserId\x20=\x20?',_0x2b65c0['id']);_0x43388b[_0x8059('0x79')](db['sequelize']['query'](_0x161265['toString'](),{'type':db[_0x8059('0x7a')][_0x8059('0x7b')][_0x8059('0x7c')]})[_0x8059('0x21')](function(_0x51a570){if(_0x51a570[_0x8059('0x37')]===0x1){return _0x2b65c0['id'];}else{var _0x3fbf03=_[_0x8059('0x7d')](_[_0x8059('0x2b')](_0x51a570,_0x8059('0x7e')),function(_0xcde601){return _['includes'](_0x6356ed,_0xcde601);});if(_0x3fbf03){return _0x2b65c0['id'];}}}));}}return BPromise[_0x8059('0x7f')](_0x43388b)[_0x8059('0x21')](function(_0x3aa43b){_0x299b67=_(_0x299b67)[_0x8059('0x80')](_0x3aa43b)[_0x8059('0x81')]()[_0x8059('0x82')]();return db[_0x8059('0x42')][_0x8059('0x4c')]({'where':{'id':_0x24d7cb[_0x8059('0x47')]['id']}})[_0x8059('0x21')](function(_0x609788){return db[_0x8059('0x7a')][_0x8059('0x69')](function(_0x100e00){return _0x609788['removeTeams'](_0x24d7cb[_0x8059('0x31')][_0x8059('0x6f')],{'transaction':_0x100e00})[_0x8059('0x21')](function(){if(!_[_0x8059('0x83')](_0x299b67)){return _0x609788['removeAgents'](_0x299b67,{'transaction':_0x100e00});}})['then'](function(){_0x299b67['forEach'](function(_0x4a58b8){socket[_0x8059('0x84')](_0x8059('0x85'),{'UserId':_0x4a58b8,'SmsQueueId':_0x609788['id']});});});});});});})[_0x8059('0x21')](respondWithStatusCode(_0x41ac30,null))[_0x8059('0x45')](handleError(_0x41ac30,null));};exports[_0x8059('0x86')]=function(_0x375942,_0x16cd09,_0x2ec671){return db[_0x8059('0x42')][_0x8059('0x4c')]({'where':{'id':_0x375942[_0x8059('0x47')]['id']}})[_0x8059('0x21')](handleEntityNotFound(_0x16cd09,null))['then'](function(_0x11462a){if(_0x11462a){return _0x11462a[_0x8059('0x86')](_0x375942[_0x8059('0x50')][_0x8059('0x6f')],_['omit'](_0x375942[_0x8059('0x50')],[_0x8059('0x6f'),'id'])||{})['spread'](function(_0x30bfb3){for(var _0x4e564b=0x0;_0x4e564b<_0x375942[_0x8059('0x50')][_0x8059('0x6f')][_0x8059('0x37')];_0x4e564b+=0x1){socket[_0x8059('0x84')](_0x8059('0x6d'),{'UserId':Number(_0x375942[_0x8059('0x50')][_0x8059('0x6f')][_0x4e564b]),'SmsQueueId':Number(_0x375942[_0x8059('0x47')]['id'])});}return _0x30bfb3;});}})[_0x8059('0x21')](respondWithResult(_0x16cd09,null))[_0x8059('0x45')](handleError(_0x16cd09,null));};exports[_0x8059('0x87')]=function(_0x662d3d,_0xb92f27,_0xa35595){return db[_0x8059('0x42')]['find']({'where':{'id':_0x662d3d[_0x8059('0x47')]['id']}})['then'](handleEntityNotFound(_0xb92f27,null))[_0x8059('0x21')](function(_0x3976e7){if(_0x3976e7){return _0x3976e7[_0x8059('0x87')](_0x662d3d[_0x8059('0x31')]['ids'])[_0x8059('0x21')](function(){if(_[_0x8059('0x88')](_0x662d3d['query']['ids'])){for(var _0x1312b6=0x0;_0x1312b6<_0x662d3d['query'][_0x8059('0x6f')][_0x8059('0x37')];_0x1312b6+=0x1){socket[_0x8059('0x84')](_0x8059('0x85'),{'UserId':Number(_0x662d3d[_0x8059('0x31')]['ids'][_0x1312b6]),'SmsQueueId':Number(_0x662d3d['params']['id'])});}}else{socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x662d3d[_0x8059('0x31')][_0x8059('0x6f')]),'SmsQueueId':Number(_0x662d3d[_0x8059('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0xb92f27,null))[_0x8059('0x45')](handleError(_0xb92f27,null));};exports[_0x8059('0x89')]=function(_0x307eca,_0x17df12,_0x39dd43){var _0x57633f={};var _0x4dec29={};var _0x4d6a1b;var _0x13f867;return db[_0x8059('0x42')][_0x8059('0x53')]({'where':{'id':_0x307eca[_0x8059('0x47')]['id']}})['then'](handleEntityNotFound(_0x17df12,null))['then'](function(_0x5282b2){if(_0x5282b2){_0x4d6a1b=_0x5282b2;_0x4dec29[_0x8059('0x30')]=_[_0x8059('0x32')](db['User'][_0x8059('0x2c')]);_0x4dec29[_0x8059('0x31')]=_[_0x8059('0x32')](_0x307eca[_0x8059('0x31')]);_0x4dec29['filters']=_[_0x8059('0x34')](_0x4dec29[_0x8059('0x30')],_0x4dec29[_0x8059('0x31')]);_0x57633f[_0x8059('0x36')]=_[_0x8059('0x34')](_0x4dec29[_0x8059('0x30')],qs[_0x8059('0x35')](_0x307eca[_0x8059('0x31')][_0x8059('0x35')]));_0x57633f[_0x8059('0x36')]=_0x57633f[_0x8059('0x36')][_0x8059('0x37')]?_0x57633f[_0x8059('0x36')]:_0x4dec29['model'];_0x57633f['order']=qs['sort'](_0x307eca[_0x8059('0x31')][_0x8059('0x39')]);_0x57633f[_0x8059('0x3a')]=qs[_0x8059('0x33')](_[_0x8059('0x3b')](_0x307eca[_0x8059('0x31')],_0x4dec29[_0x8059('0x33')]));if(_0x307eca[_0x8059('0x31')][_0x8059('0x3d')]){_0x57633f[_0x8059('0x3a')]=_[_0x8059('0x3e')](_0x57633f['where'],{'$or':_['map'](_0x57633f[_0x8059('0x36')],function(_0x4c1595){var _0x439b5c={};_0x439b5c[_0x4c1595]={'$like':'%'+_0x307eca[_0x8059('0x31')][_0x8059('0x3d')]+'%'};return _0x439b5c;})});}_0x57633f=_[_0x8059('0x3e')]({},_0x57633f,_0x307eca[_0x8059('0x48')]);return _0x4d6a1b[_0x8059('0x89')](_0x57633f);}})['then'](function(_0x23a4c9){if(_0x23a4c9){_0x13f867=_0x23a4c9[_0x8059('0x37')];if(!_0x307eca[_0x8059('0x31')][_0x8059('0x38')](_0x8059('0x54'))){_0x57633f[_0x8059('0x1c')]=qs[_0x8059('0x1c')](_0x307eca[_0x8059('0x31')][_0x8059('0x1c')]);_0x57633f[_0x8059('0x1a')]=qs[_0x8059('0x1a')](_0x307eca[_0x8059('0x31')][_0x8059('0x1a')]);}return _0x4d6a1b[_0x8059('0x89')](_0x57633f);}})['then'](function(_0x3be218){if(_0x3be218){return _0x3be218?{'count':_0x13f867,'rows':_0x3be218}:null;}})['then'](respondWithResult(_0x17df12,null))['catch'](handleError(_0x17df12,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 55cf380..7aa3e8b 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 _0x2522=['save','update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5d77cb,_0x27de2a){var _0x52b1f5=function(_0x4798b1){while(--_0x4798b1){_0x5d77cb['push'](_0x5d77cb['shift']());}};_0x52b1f5(++_0x27de2a);}(_0x2522,0x1e3));var _0x2252=function(_0x3de6d7,_0x5d02f2){_0x3de6d7=_0x3de6d7-0x0;var _0x230a9e=_0x2522[_0x3de6d7];return _0x230a9e;};'use strict';var EventEmitter=require(_0x2252('0x0'));var SmsQueue=require(_0x2252('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x2252('0x2')](0x0);var events={'afterCreate':_0x2252('0x3'),'afterUpdate':_0x2252('0x4'),'afterDestroy':_0x2252('0x5')};function emitEvent(_0x46e49c){return function(_0x447525,_0x27fa38,_0x2facea){SmsQueueEvents[_0x2252('0x6')](_0x46e49c+':'+_0x447525['id'],_0x447525);SmsQueueEvents[_0x2252('0x6')](_0x46e49c,_0x447525);_0x2facea(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x2252('0x7')](e,emitEvent(event));}}module[_0x2252('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0xdc60=['update','remove','emit','hook','../../mysqldb','SmsQueue','setMaxListeners','save'];(function(_0x3ae5be,_0x582174){var _0x1b122b=function(_0x3ac0f4){while(--_0x3ac0f4){_0x3ae5be['push'](_0x3ae5be['shift']());}};_0x1b122b(++_0x582174);}(_0xdc60,0xe4));var _0x0dc6=function(_0x32dbcd,_0x463cd2){_0x32dbcd=_0x32dbcd-0x0;var _0x303818=_0xdc60[_0x32dbcd];return _0x303818;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x0dc6('0x0'))['db'][_0x0dc6('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x0dc6('0x2')](0x0);var events={'afterCreate':_0x0dc6('0x3'),'afterUpdate':_0x0dc6('0x4'),'afterDestroy':_0x0dc6('0x5')};function emitEvent(_0x118ab9){return function(_0x1051d0,_0x5ca56e,_0x1657ab){SmsQueueEvents[_0x0dc6('0x6')](_0x118ab9+':'+_0x1051d0['id'],_0x1051d0);SmsQueueEvents[_0x0dc6('0x6')](_0x118ab9,_0x1051d0);_0x1657ab(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x0dc6('0x7')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index d33eb9e..9dd9397 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 _0xce54=['SmsQueue','sms_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0xa74357,_0x50ce37){var _0x2ee075=function(_0x104061){while(--_0x104061){_0xa74357['push'](_0xa74357['shift']());}};_0x2ee075(++_0x50ce37);}(_0xce54,0x77));var _0x4ce5=function(_0x5e2bcd,_0x33f00e){_0x5e2bcd=_0x5e2bcd-0x0;var _0x1f4d06=_0xce54[_0x5e2bcd];return _0x1f4d06;};'use strict';var _=require(_0x4ce5('0x0'));var util=require(_0x4ce5('0x1'));var logger=require(_0x4ce5('0x2'))(_0x4ce5('0x3'));var moment=require('moment');var BPromise=require(_0x4ce5('0x4'));var rp=require(_0x4ce5('0x5'));var fs=require('fs');var path=require(_0x4ce5('0x6'));var rimraf=require(_0x4ce5('0x7'));var config=require(_0x4ce5('0x8'));var attributes=require('./smsQueue.attributes');module[_0x4ce5('0x9')]=function(_0x1595e8,_0x36d2d7){return _0x1595e8[_0x4ce5('0xa')](_0x4ce5('0xb'),attributes,{'tableName':_0x4ce5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x74f0=['./smsQueue.attributes','exports','define','SmsQueue','sms_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x74f0,0x18d));var _0x074f=function(_0x3bc82d,_0x59187f){_0x3bc82d=_0x3bc82d-0x0;var _0x2cfb3d=_0x74f0[_0x3bc82d];return _0x2cfb3d;};'use strict';var _=require('lodash');var util=require(_0x074f('0x0'));var logger=require(_0x074f('0x1'))(_0x074f('0x2'));var moment=require(_0x074f('0x3'));var BPromise=require(_0x074f('0x4'));var rp=require(_0x074f('0x5'));var fs=require('fs');var path=require(_0x074f('0x6'));var rimraf=require(_0x074f('0x7'));var config=require(_0x074f('0x8'));var attributes=require(_0x074f('0x9'));module[_0x074f('0xa')]=function(_0xd2d4d0,_0x1b6019){return _0xd2d4d0[_0x074f('0xb')](_0x074f('0xc'),attributes,{'tableName':_0x074f('0xd'),'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 ad45c99..8cba795 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 _0xb7f4=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','where','attributes','include','model','map','debug','raw','ShowSmsQueue','lodash','util','moment','bluebird'];(function(_0x37d4ac,_0x372800){var _0x3b8b45=function(_0x2d0d59){while(--_0x2d0d59){_0x37d4ac['push'](_0x37d4ac['shift']());}};_0x3b8b45(++_0x372800);}(_0xb7f4,0x164));var _0x4b7f=function(_0x324f45,_0x1f558a){_0x324f45=_0x324f45-0x0;var _0x2130ab=_0xb7f4[_0x324f45];return _0x2130ab;};'use strict';var _=require(_0x4b7f('0x0'));var util=require(_0x4b7f('0x1'));var moment=require(_0x4b7f('0x2'));var BPromise=require(_0x4b7f('0x3'));var rs=require(_0x4b7f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4b7f('0x5'));var logger=require(_0x4b7f('0x6'))(_0x4b7f('0x7'));var config=require(_0x4b7f('0x8'));var jayson=require(_0x4b7f('0x9'));var client=jayson['client'][_0x4b7f('0xa')]({'port':0x232a});config['redis']=_[_0x4b7f('0xb')](config[_0x4b7f('0xc')],{'host':_0x4b7f('0xd'),'port':0x18eb});var socket=require(_0x4b7f('0xe'))(new Redis(config[_0x4b7f('0xc')]));require('./smsQueue.socket')[_0x4b7f('0xf')](socket);function respondWithRpcPromise(_0x3242f2,_0x90921f,_0x5d9bcc){return new BPromise(function(_0x5bc9ad,_0x2969cf){return client[_0x4b7f('0x10')](_0x3242f2,_0x5d9bcc)[_0x4b7f('0x11')](function(_0x2883f4){logger[_0x4b7f('0x12')](_0x4b7f('0x13'),_0x90921f,_0x4b7f('0x14'));logger['debug'](_0x4b7f('0x15'),_0x90921f,_0x4b7f('0x14'),JSON[_0x4b7f('0x16')](_0x2883f4));if(_0x2883f4[_0x4b7f('0x17')]){if(_0x2883f4[_0x4b7f('0x17')][_0x4b7f('0x18')]===0x1f4){logger[_0x4b7f('0x17')]('SmsQueue,\x20%s,\x20%s',_0x90921f,_0x2883f4[_0x4b7f('0x17')][_0x4b7f('0x19')]);return _0x2969cf(_0x2883f4[_0x4b7f('0x17')][_0x4b7f('0x19')]);}logger[_0x4b7f('0x17')]('SmsQueue,\x20%s,\x20%s',_0x90921f,_0x2883f4['error']['message']);return _0x5bc9ad(_0x2883f4['error'][_0x4b7f('0x19')]);}else{logger[_0x4b7f('0x12')](_0x4b7f('0x13'),_0x90921f,_0x4b7f('0x14'));_0x5bc9ad(_0x2883f4[_0x4b7f('0x1a')]['message']);}})[_0x4b7f('0x1b')](function(_0x26ae41){logger[_0x4b7f('0x17')](_0x4b7f('0x13'),_0x90921f,_0x26ae41);_0x2969cf(_0x26ae41);});});}exports[_0x4b7f('0x1c')]=function(_0x5609b1){var _0x2be320=this;return new Promise(function(_0x1bed20,_0x32b8cc){return db[_0x4b7f('0x1d')][_0x4b7f('0x1e')]({'raw':_0x5609b1['options']?_0x5609b1['options']['raw']===undefined?!![]:![]:!![],'where':_0x5609b1[_0x4b7f('0x1f')]?_0x5609b1['options'][_0x4b7f('0x20')]||null:null,'attributes':_0x5609b1[_0x4b7f('0x1f')]?_0x5609b1[_0x4b7f('0x1f')][_0x4b7f('0x21')]||null:null,'limit':_0x5609b1[_0x4b7f('0x1f')]?_0x5609b1[_0x4b7f('0x1f')]['limit']||null:null,'include':_0x5609b1[_0x4b7f('0x1f')]?_0x5609b1['options'][_0x4b7f('0x22')]?_['map'](_0x5609b1[_0x4b7f('0x1f')]['include'],function(_0xe0eb09){return{'model':db[_0xe0eb09[_0x4b7f('0x23')]],'as':_0xe0eb09['as'],'attributes':_0xe0eb09['attributes'],'include':_0xe0eb09[_0x4b7f('0x22')]?_[_0x4b7f('0x24')](_0xe0eb09[_0x4b7f('0x22')],function(_0x41720e){return{'model':db[_0x41720e[_0x4b7f('0x23')]],'as':_0x41720e['as'],'attributes':_0x41720e[_0x4b7f('0x21')],'include':_0x41720e[_0x4b7f('0x22')]?_[_0x4b7f('0x24')](_0x41720e[_0x4b7f('0x22')],function(_0x1895fe){return{'model':db[_0x1895fe['model']],'as':_0x1895fe['as'],'attributes':_0x1895fe[_0x4b7f('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x48333e){logger['info'](_0x4b7f('0x1c'),_0x5609b1);logger[_0x4b7f('0x25')](_0x4b7f('0x1c'),_0x5609b1,JSON[_0x4b7f('0x16')](_0x48333e));_0x1bed20(_0x48333e);})[_0x4b7f('0x1b')](function(_0x2282b1){logger[_0x4b7f('0x17')](_0x4b7f('0x1c'),_0x2282b1[_0x4b7f('0x19')],_0x5609b1);_0x32b8cc(_0x2be320[_0x4b7f('0x17')](0x1f4,_0x2282b1[_0x4b7f('0x19')]));});});};exports['ShowSmsQueue']=function(_0x275bc3){var _0x447507=this;return new Promise(function(_0x504e4a,_0x4e7aab){return db[_0x4b7f('0x1d')]['find']({'raw':_0x275bc3[_0x4b7f('0x1f')]?_0x275bc3[_0x4b7f('0x1f')][_0x4b7f('0x26')]===undefined?!![]:![]:!![],'where':_0x275bc3[_0x4b7f('0x1f')]?_0x275bc3[_0x4b7f('0x1f')][_0x4b7f('0x20')]||null:null,'attributes':_0x275bc3[_0x4b7f('0x1f')]?_0x275bc3[_0x4b7f('0x1f')][_0x4b7f('0x21')]||null:null,'include':_0x275bc3[_0x4b7f('0x1f')]?_0x275bc3[_0x4b7f('0x1f')][_0x4b7f('0x22')]?_['map'](_0x275bc3[_0x4b7f('0x1f')][_0x4b7f('0x22')],function(_0xb4adb5){return{'model':db[_0xb4adb5[_0x4b7f('0x23')]],'as':_0xb4adb5['as'],'attributes':_0xb4adb5[_0x4b7f('0x21')],'include':_0xb4adb5[_0x4b7f('0x22')]?_['map'](_0xb4adb5[_0x4b7f('0x22')],function(_0x258b52){return{'model':db[_0x258b52[_0x4b7f('0x23')]],'as':_0x258b52['as'],'attributes':_0x258b52['attributes'],'include':_0x258b52['include']?_[_0x4b7f('0x24')](_0x258b52[_0x4b7f('0x22')],function(_0x35f114){return{'model':db[_0x35f114[_0x4b7f('0x23')]],'as':_0x35f114['as'],'attributes':_0x35f114[_0x4b7f('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4b7f('0x11')](function(_0x3fc6bb){logger[_0x4b7f('0x12')]('ShowSmsQueue',_0x275bc3);logger[_0x4b7f('0x25')](_0x4b7f('0x27'),_0x275bc3,JSON['stringify'](_0x3fc6bb));_0x504e4a(_0x3fc6bb);})[_0x4b7f('0x1b')](function(_0x1fb449){logger[_0x4b7f('0x17')](_0x4b7f('0x27'),_0x1fb449[_0x4b7f('0x19')],_0x275bc3);_0x4e7aab(_0x447507[_0x4b7f('0x17')](0x1f4,_0x1fb449['message']));});});}; \ No newline at end of file +var _0xe789=['stringify','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','request','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','message','catch','SmsQueue','findAll','options','raw','where','attributes','limit','map','include','model','then','info','GetSmsQueue'];(function(_0x58c1ad,_0x349e71){var _0x22bddf=function(_0x2a6bb5){while(--_0x2a6bb5){_0x58c1ad['push'](_0x58c1ad['shift']());}};_0x22bddf(++_0x349e71);}(_0xe789,0x1af));var _0x9e78=function(_0xea30d3,_0x3be3be){_0xea30d3=_0xea30d3-0x0;var _0x35ab90=_0xe789[_0xea30d3];return _0x35ab90;};'use strict';var _=require(_0x9e78('0x0'));var util=require(_0x9e78('0x1'));var moment=require(_0x9e78('0x2'));var BPromise=require(_0x9e78('0x3'));var rs=require(_0x9e78('0x4'));var fs=require('fs');var Redis=require(_0x9e78('0x5'));var db=require(_0x9e78('0x6'))['db'];var utils=require(_0x9e78('0x7'));var logger=require('../../config/logger')(_0x9e78('0x8'));var config=require(_0x9e78('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9e78('0xa')]({'port':0x232a});config[_0x9e78('0xb')]=_[_0x9e78('0xc')](config[_0x9e78('0xb')],{'host':_0x9e78('0xd'),'port':0x18eb});var socket=require(_0x9e78('0xe'))(new Redis(config[_0x9e78('0xb')]));require(_0x9e78('0xf'))['register'](socket);function respondWithRpcPromise(_0x19b6d9,_0x54dddb,_0x29cd13){return new BPromise(function(_0x14d7d9,_0x234c21){return client[_0x9e78('0x10')](_0x19b6d9,_0x29cd13)['then'](function(_0x12401e){logger['info'](_0x9e78('0x11'),_0x54dddb,_0x9e78('0x12'));logger[_0x9e78('0x13')](_0x9e78('0x14'),_0x54dddb,_0x9e78('0x12'),JSON['stringify'](_0x12401e));if(_0x12401e[_0x9e78('0x15')]){if(_0x12401e[_0x9e78('0x15')]['code']===0x1f4){logger[_0x9e78('0x15')](_0x9e78('0x11'),_0x54dddb,_0x12401e['error'][_0x9e78('0x16')]);return _0x234c21(_0x12401e[_0x9e78('0x15')][_0x9e78('0x16')]);}logger[_0x9e78('0x15')](_0x9e78('0x11'),_0x54dddb,_0x12401e[_0x9e78('0x15')][_0x9e78('0x16')]);return _0x14d7d9(_0x12401e[_0x9e78('0x15')][_0x9e78('0x16')]);}else{logger['info'](_0x9e78('0x11'),_0x54dddb,'request\x20sent');_0x14d7d9(_0x12401e['result']['message']);}})[_0x9e78('0x17')](function(_0x3ea9f1){logger[_0x9e78('0x15')]('SmsQueue,\x20%s,\x20%s',_0x54dddb,_0x3ea9f1);_0x234c21(_0x3ea9f1);});});}exports['GetSmsQueue']=function(_0x232fee){var _0x285cb2=this;return new Promise(function(_0x467a7,_0x5ca3f7){return db[_0x9e78('0x18')][_0x9e78('0x19')]({'raw':_0x232fee[_0x9e78('0x1a')]?_0x232fee['options'][_0x9e78('0x1b')]===undefined?!![]:![]:!![],'where':_0x232fee['options']?_0x232fee[_0x9e78('0x1a')][_0x9e78('0x1c')]||null:null,'attributes':_0x232fee['options']?_0x232fee[_0x9e78('0x1a')][_0x9e78('0x1d')]||null:null,'limit':_0x232fee['options']?_0x232fee[_0x9e78('0x1a')][_0x9e78('0x1e')]||null:null,'include':_0x232fee['options']?_0x232fee['options']['include']?_[_0x9e78('0x1f')](_0x232fee['options'][_0x9e78('0x20')],function(_0x579d01){return{'model':db[_0x579d01[_0x9e78('0x21')]],'as':_0x579d01['as'],'attributes':_0x579d01[_0x9e78('0x1d')],'include':_0x579d01[_0x9e78('0x20')]?_[_0x9e78('0x1f')](_0x579d01['include'],function(_0x26c52a){return{'model':db[_0x26c52a[_0x9e78('0x21')]],'as':_0x26c52a['as'],'attributes':_0x26c52a[_0x9e78('0x1d')],'include':_0x26c52a[_0x9e78('0x20')]?_[_0x9e78('0x1f')](_0x26c52a['include'],function(_0x12b06b){return{'model':db[_0x12b06b[_0x9e78('0x21')]],'as':_0x12b06b['as'],'attributes':_0x12b06b[_0x9e78('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9e78('0x22')](function(_0x27c81b){logger[_0x9e78('0x23')]('GetSmsQueue',_0x232fee);logger[_0x9e78('0x13')](_0x9e78('0x24'),_0x232fee,JSON[_0x9e78('0x25')](_0x27c81b));_0x467a7(_0x27c81b);})[_0x9e78('0x17')](function(_0xa7e573){logger[_0x9e78('0x15')](_0x9e78('0x24'),_0xa7e573[_0x9e78('0x16')],_0x232fee);_0x5ca3f7(_0x285cb2[_0x9e78('0x15')](0x1f4,_0xa7e573['message']));});});};exports[_0x9e78('0x26')]=function(_0x3fca4a){var _0xd18952=this;return new Promise(function(_0x2a35d5,_0x5ca6fd){return db[_0x9e78('0x18')]['find']({'raw':_0x3fca4a['options']?_0x3fca4a[_0x9e78('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3fca4a['options']?_0x3fca4a[_0x9e78('0x1a')]['where']||null:null,'attributes':_0x3fca4a[_0x9e78('0x1a')]?_0x3fca4a['options'][_0x9e78('0x1d')]||null:null,'include':_0x3fca4a[_0x9e78('0x1a')]?_0x3fca4a[_0x9e78('0x1a')][_0x9e78('0x20')]?_['map'](_0x3fca4a[_0x9e78('0x1a')][_0x9e78('0x20')],function(_0x155700){return{'model':db[_0x155700[_0x9e78('0x21')]],'as':_0x155700['as'],'attributes':_0x155700[_0x9e78('0x1d')],'include':_0x155700['include']?_[_0x9e78('0x1f')](_0x155700[_0x9e78('0x20')],function(_0x146660){return{'model':db[_0x146660['model']],'as':_0x146660['as'],'attributes':_0x146660['attributes'],'include':_0x146660[_0x9e78('0x20')]?_[_0x9e78('0x1f')](_0x146660[_0x9e78('0x20')],function(_0x5b90f1){return{'model':db[_0x5b90f1['model']],'as':_0x5b90f1['as'],'attributes':_0x5b90f1[_0x9e78('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9e78('0x22')](function(_0x387645){logger['info'](_0x9e78('0x26'),_0x3fca4a);logger['debug'](_0x9e78('0x26'),_0x3fca4a,JSON['stringify'](_0x387645));_0x2a35d5(_0x387645);})[_0x9e78('0x17')](function(_0x1995e1){logger['error'](_0x9e78('0x26'),_0x1995e1['message'],_0x3fca4a);_0x5ca6fd(_0xd18952[_0x9e78('0x15')](0x1f4,_0x1995e1[_0x9e78('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 50f131d..f6777ac 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 _0xcb78=['removeListener','length','smsQueue:','save','remove','update'];(function(_0x18fae7,_0x1a9ef1){var _0x5e86e9=function(_0x3a519f){while(--_0x3a519f){_0x18fae7['push'](_0x18fae7['shift']());}};_0x5e86e9(++_0x1a9ef1);}(_0xcb78,0x1dd));var _0x8cb7=function(_0x406746,_0x39da38){_0x406746=_0x406746-0x0;var _0x877ba=_0xcb78[_0x406746];return _0x877ba;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x8cb7('0x0'),_0x8cb7('0x1'),_0x8cb7('0x2')];function createListener(_0x5979e1,_0x276493){return function(_0x1b516f){_0x276493['emit'](_0x5979e1,_0x1b516f);};}function removeListener(_0xdeacde,_0x12458f){return function(){SmsQueueEvents[_0x8cb7('0x3')](_0xdeacde,_0x12458f);};}exports['register']=function(_0x29e727){for(var _0x30b8e3=0x0,_0x28eee1=events[_0x8cb7('0x4')];_0x30b8e3<_0x28eee1;_0x30b8e3++){var _0x2a1f92=events[_0x30b8e3];var _0x476296=createListener(_0x8cb7('0x5')+_0x2a1f92,_0x29e727);SmsQueueEvents['on'](_0x2a1f92,_0x476296);}}; \ No newline at end of file +var _0xfea2=['save','emit','removeListener','register','./smsQueue.events'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xfea2,0x1a8));var _0x2fea=function(_0x40894e,_0x3fc95a){_0x40894e=_0x40894e-0x0;var _0x119c25=_0xfea2[_0x40894e];return _0x119c25;};'use strict';var SmsQueueEvents=require(_0x2fea('0x0'));var events=[_0x2fea('0x1'),'remove','update'];function createListener(_0x34088d,_0x7528f9){return function(_0x20101a){_0x7528f9[_0x2fea('0x2')](_0x34088d,_0x20101a);};}function removeListener(_0x1f94d2,_0x5582fd){return function(){SmsQueueEvents[_0x2fea('0x3')](_0x1f94d2,_0x5582fd);};}exports[_0x2fea('0x4')]=function(_0x8d6d59){for(var _0x13e318=0x0,_0x1e5b55=events['length'];_0x13e318<_0x1e5b55;_0x13e318++){var _0x29231e=events[_0x13e318];var _0x227ebb=createListener('smsQueue:'+_0x29231e,_0x8d6d59);SmsQueueEvents['on'](_0x29231e,_0x227ebb);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index ec022c9..495eeca 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 _0xf77f=['describe','show','post','create','put','/:id','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x4ff40c,_0x50bddf){var _0x3074a3=function(_0x52d7c6){while(--_0x52d7c6){_0x4ff40c['push'](_0x4ff40c['shift']());}};_0x3074a3(++_0x50bddf);}(_0xf77f,0x134));var _0xff77=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xf77f[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0xff77('0x0'));var util=require('util');var path=require(_0xff77('0x1'));var timeout=require(_0xff77('0x2'));var express=require(_0xff77('0x3'));var router=express[_0xff77('0x4')]();var fs_extra=require(_0xff77('0x5'));var auth=require(_0xff77('0x6'));var interaction=require(_0xff77('0x7'));var config=require(_0xff77('0x8'));var controller=require('./smsQueueReport.controller');router[_0xff77('0x9')]('/',auth[_0xff77('0xa')](),controller['index']);router['get'](_0xff77('0xb'),auth[_0xff77('0xa')](),controller[_0xff77('0xc')]);router[_0xff77('0x9')]('/:id',auth[_0xff77('0xa')](),controller[_0xff77('0xd')]);router[_0xff77('0xe')]('/',auth[_0xff77('0xa')](),controller[_0xff77('0xf')]);router[_0xff77('0x10')](_0xff77('0x11'),auth['isAuthenticated'](),controller[_0xff77('0x12')]);router[_0xff77('0x13')](_0xff77('0x11'),auth[_0xff77('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xcb57=['/describe','describe','/:id','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated'];(function(_0x3acc19,_0x1835de){var _0x5256a2=function(_0xbd72a0){while(--_0xbd72a0){_0x3acc19['push'](_0x3acc19['shift']());}};_0x5256a2(++_0x1835de);}(_0xcb57,0xa1));var _0x7cb5=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xcb57[_0x525c7b];return _0x27b33e;};'use strict';var multer=require(_0x7cb5('0x0'));var util=require(_0x7cb5('0x1'));var path=require('path');var timeout=require(_0x7cb5('0x2'));var express=require('express');var router=express[_0x7cb5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7cb5('0x4'));var interaction=require(_0x7cb5('0x5'));var config=require('../../config/environment');var controller=require(_0x7cb5('0x6'));router[_0x7cb5('0x7')]('/',auth[_0x7cb5('0x8')](),controller['index']);router[_0x7cb5('0x7')](_0x7cb5('0x9'),auth[_0x7cb5('0x8')](),controller[_0x7cb5('0xa')]);router[_0x7cb5('0x7')](_0x7cb5('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x7cb5('0x8')](),controller['create']);router[_0x7cb5('0xc')]('/:id',auth[_0x7cb5('0x8')](),controller[_0x7cb5('0xd')]);router[_0x7cb5('0xe')](_0x7cb5('0xb'),auth[_0x7cb5('0x8')](),controller[_0x7cb5('0xf')]);module[_0x7cb5('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 2884edd..8a27226 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 _0x98af=['DATE','moment','exports','STRING'];(function(_0x127c7b,_0x1f65e7){var _0x1708eb=function(_0x2033e5){while(--_0x2033e5){_0x127c7b['push'](_0x127c7b['shift']());}};_0x1708eb(++_0x1f65e7);}(_0x98af,0x131));var _0xf98a=function(_0x503ea4,_0x562c0a){_0x503ea4=_0x503ea4-0x0;var _0x22f2fb=_0x98af[_0x503ea4];return _0x22f2fb;};'use strict';var moment=require(_0xf98a('0x0'));var Sequelize=require('sequelize');module[_0xf98a('0x1')]={'uniqueid':{'type':Sequelize[_0xf98a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf98a('0x2')]},'joinAt':{'type':Sequelize[_0xf98a('0x3')]},'leaveAt':{'type':Sequelize[_0xf98a('0x3')]},'acceptAt':{'type':Sequelize[_0xf98a('0x3')]},'exitAt':{'type':Sequelize[_0xf98a('0x3')]},'reason':{'type':Sequelize[_0xf98a('0x2')]}}; \ No newline at end of file +var _0x04bc=['sequelize','exports','STRING','DATE'];(function(_0x1d558c,_0x1e497c){var _0x15767d=function(_0x26326d){while(--_0x26326d){_0x1d558c['push'](_0x1d558c['shift']());}};_0x15767d(++_0x1e497c);}(_0x04bc,0x188));var _0xc04b=function(_0x2fb597,_0x1278f1){_0x2fb597=_0x2fb597-0x0;var _0x28c923=_0x04bc[_0x2fb597];return _0x28c923;};'use strict';var moment=require('moment');var Sequelize=require(_0xc04b('0x0'));module[_0xc04b('0x1')]={'uniqueid':{'type':Sequelize[_0xc04b('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc04b('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xc04b('0x3')]},'exitAt':{'type':Sequelize[_0xc04b('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index a6d0771..23d19a5 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 _0xcc2e=['SmsQueueReport','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','name','send','index','map'];(function(_0x7dafb7,_0x88e2dc){var _0x17f97b=function(_0x55d3f2){while(--_0x55d3f2){_0x7dafb7['push'](_0x7dafb7['shift']());}};_0x17f97b(++_0x88e2dc);}(_0xcc2e,0x191));var _0xecc2=function(_0x51e171,_0x347d9a){_0x51e171=_0x51e171-0x0;var _0x314206=_0xcc2e[_0x51e171];return _0x314206;};'use strict';var emlformat=require(_0xecc2('0x0'));var rimraf=require(_0xecc2('0x1'));var zipdir=require(_0xecc2('0x2'));var jsonpatch=require(_0xecc2('0x3'));var rp=require(_0xecc2('0x4'));var moment=require(_0xecc2('0x5'));var BPromise=require(_0xecc2('0x6'));var Mustache=require(_0xecc2('0x7'));var util=require('util');var path=require(_0xecc2('0x8'));var sox=require(_0xecc2('0x9'));var csv=require(_0xecc2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xecc2('0xb'));var _=require(_0xecc2('0xc'));var squel=require(_0xecc2('0xd'));var crypto=require(_0xecc2('0xe'));var jsforce=require(_0xecc2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xecc2('0x10'));var authService=require(_0xecc2('0x11'));var qs=require(_0xecc2('0x12'));var as=require(_0xecc2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xecc2('0x14'));var utils=require(_0xecc2('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xecc2('0x16'))['db'];function respondWithStatusCode(_0x5ee0be,_0xaec417){_0xaec417=_0xaec417||0xcc;return function(_0x13b274){if(_0x13b274){return _0x5ee0be[_0xecc2('0x17')](_0xaec417);}return _0x5ee0be[_0xecc2('0x18')](_0xaec417)[_0xecc2('0x19')]();};}function respondWithResult(_0x5e04ce,_0x258b18){_0x258b18=_0x258b18||0xc8;return function(_0x356283){if(_0x356283){return _0x5e04ce['status'](_0x258b18)['json'](_0x356283);}};}function respondWithFilteredResult(_0x2f742b,_0x5e0424){return function(_0x3b4785){if(_0x3b4785){var _0x4fa84c=typeof _0x5e0424[_0xecc2('0x1a')]===_0xecc2('0x1b')&&typeof _0x5e0424[_0xecc2('0x1c')]===_0xecc2('0x1b');var _0x39e6c8=_0x3b4785[_0xecc2('0x1d')];var _0x1b1dad=_0x4fa84c?0x0:_0x5e0424[_0xecc2('0x1a')];var _0x2c6339=_0x4fa84c?_0x3b4785['count']:_0x5e0424[_0xecc2('0x1a')]+_0x5e0424[_0xecc2('0x1c')];var _0xc40767;if(_0x2c6339>=_0x39e6c8){_0x2c6339=_0x39e6c8;_0xc40767=0xc8;}else{_0xc40767=0xce;}_0x2f742b['status'](_0xc40767);return _0x2f742b[_0xecc2('0x1e')](_0xecc2('0x1f'),_0x1b1dad+'-'+_0x2c6339+'/'+_0x39e6c8)[_0xecc2('0x20')](_0x3b4785);}return null;};}function patchUpdates(_0x5ec22e){return function(_0x17ca2b){try{jsonpatch[_0xecc2('0x21')](_0x17ca2b,_0x5ec22e,!![]);}catch(_0x13cd0d){return BPromise[_0xecc2('0x22')](_0x13cd0d);}return _0x17ca2b['save']();};}function saveUpdates(_0x4bb5cf,_0x2e421f){return function(_0x266618){if(_0x266618){return _0x266618[_0xecc2('0x23')](_0x4bb5cf)[_0xecc2('0x24')](function(_0xfa0b65){return _0xfa0b65;});}return null;};}function removeEntity(_0x18eb6b,_0x5734e8){return function(_0x40d199){if(_0x40d199){return _0x40d199[_0xecc2('0x25')]()[_0xecc2('0x24')](function(){_0x18eb6b[_0xecc2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e90a2,_0x5d8786){return function(_0x409c3b){if(!_0x409c3b){_0x2e90a2[_0xecc2('0x17')](0x194);}return _0x409c3b;};}function handleError(_0xe56acf,_0x2b4f3a){_0x2b4f3a=_0x2b4f3a||0x1f4;return function(_0x1a210f){logger[_0xecc2('0x26')](_0x1a210f['stack']);if(_0x1a210f[_0xecc2('0x27')]){delete _0x1a210f[_0xecc2('0x27')];}_0xe56acf[_0xecc2('0x18')](_0x2b4f3a)[_0xecc2('0x28')](_0x1a210f);};}exports[_0xecc2('0x29')]=function(_0x42e8e8,_0x748b51){var _0x710868={},_0x2c290c={},_0x5b7994={'count':0x0,'rows':[]};var _0x50ebd0=_[_0xecc2('0x2a')](db[_0xecc2('0x2b')]['rawAttributes'],function(_0x5a5508){return{'name':_0x5a5508[_0xecc2('0x2c')],'type':_0x5a5508[_0xecc2('0x2d')]['key']};});_0x2c290c['model']=_[_0xecc2('0x2a')](_0x50ebd0,'name');_0x2c290c['query']=_['keys'](_0x42e8e8[_0xecc2('0x2e')]);_0x2c290c[_0xecc2('0x2f')]=_[_0xecc2('0x30')](_0x2c290c[_0xecc2('0x31')],_0x2c290c['query']);_0x710868[_0xecc2('0x32')]=_[_0xecc2('0x30')](_0x2c290c['model'],qs[_0xecc2('0x33')](_0x42e8e8[_0xecc2('0x2e')][_0xecc2('0x33')]));_0x710868['attributes']=_0x710868[_0xecc2('0x32')][_0xecc2('0x34')]?_0x710868[_0xecc2('0x32')]:_0x2c290c[_0xecc2('0x31')];if(!_0x42e8e8[_0xecc2('0x2e')][_0xecc2('0x35')](_0xecc2('0x36'))){_0x710868[_0xecc2('0x1c')]=qs[_0xecc2('0x1c')](_0x42e8e8[_0xecc2('0x2e')][_0xecc2('0x1c')]);_0x710868[_0xecc2('0x1a')]=qs['offset'](_0x42e8e8[_0xecc2('0x2e')][_0xecc2('0x1a')]);}_0x710868[_0xecc2('0x37')]=qs['sort'](_0x42e8e8[_0xecc2('0x2e')][_0xecc2('0x38')]);_0x710868[_0xecc2('0x39')]=qs[_0xecc2('0x2f')](_[_0xecc2('0x3a')](_0x42e8e8[_0xecc2('0x2e')],_0x2c290c[_0xecc2('0x2f')]),_0x50ebd0);if(_0x42e8e8[_0xecc2('0x2e')][_0xecc2('0x3b')]){_0x710868[_0xecc2('0x39')]=_[_0xecc2('0x3c')](_0x710868[_0xecc2('0x39')],{'$or':_[_0xecc2('0x2a')](_0x50ebd0,function(_0x5cb139){if(_0x5cb139['type']!==_0xecc2('0x3d')){var _0x2c676d={};_0x2c676d[_0x5cb139[_0xecc2('0x27')]]={'$like':'%'+_0x42e8e8[_0xecc2('0x2e')][_0xecc2('0x3b')]+'%'};return _0x2c676d;}})});}_0x710868=_[_0xecc2('0x3c')]({},_0x710868,_0x42e8e8[_0xecc2('0x3e')]);var _0x351414={'where':_0x710868['where']};return db[_0xecc2('0x2b')]['count'](_0x351414)[_0xecc2('0x24')](function(_0x5c4a8f){_0x5b7994['count']=_0x5c4a8f;if(_0x42e8e8[_0xecc2('0x2e')][_0xecc2('0x3f')]){_0x710868[_0xecc2('0x40')]=[{'all':!![]}];}return db[_0xecc2('0x2b')][_0xecc2('0x41')](_0x710868);})[_0xecc2('0x24')](function(_0x20503b){_0x5b7994[_0xecc2('0x42')]=_0x20503b;return _0x5b7994;})[_0xecc2('0x24')](respondWithFilteredResult(_0x748b51,_0x710868))[_0xecc2('0x43')](handleError(_0x748b51,null));};exports[_0xecc2('0x44')]=function(_0x87652c,_0x5365dd){var _0x4662be={'raw':!![],'where':{'id':_0x87652c[_0xecc2('0x45')]['id']}},_0xb1f1a3={};_0xb1f1a3[_0xecc2('0x31')]=_['keys'](db[_0xecc2('0x2b')][_0xecc2('0x46')]);_0xb1f1a3[_0xecc2('0x2e')]=_['keys'](_0x87652c[_0xecc2('0x2e')]);_0xb1f1a3['filters']=_['intersection'](_0xb1f1a3[_0xecc2('0x31')],_0xb1f1a3[_0xecc2('0x2e')]);_0x4662be[_0xecc2('0x32')]=_[_0xecc2('0x30')](_0xb1f1a3[_0xecc2('0x31')],qs[_0xecc2('0x33')](_0x87652c[_0xecc2('0x2e')][_0xecc2('0x33')]));_0x4662be[_0xecc2('0x32')]=_0x4662be[_0xecc2('0x32')][_0xecc2('0x34')]?_0x4662be['attributes']:_0xb1f1a3['model'];if(_0x87652c[_0xecc2('0x2e')]['includeAll']){_0x4662be[_0xecc2('0x40')]=[{'all':!![]}];}_0x4662be=_['merge']({},_0x4662be,_0x87652c[_0xecc2('0x3e')]);return db['SmsQueueReport'][_0xecc2('0x47')](_0x4662be)[_0xecc2('0x24')](handleEntityNotFound(_0x5365dd,null))['then'](respondWithResult(_0x5365dd,null))[_0xecc2('0x43')](handleError(_0x5365dd,null));};exports[_0xecc2('0x48')]=function(_0x29e273,_0x29f8ce){return db['SmsQueueReport'][_0xecc2('0x48')](_0x29e273['body'],{})[_0xecc2('0x24')](respondWithResult(_0x29f8ce,0xc9))[_0xecc2('0x43')](handleError(_0x29f8ce,null));};exports['update']=function(_0x328ac7,_0x2c8274){if(_0x328ac7[_0xecc2('0x49')]['id']){delete _0x328ac7[_0xecc2('0x49')]['id'];}return db['SmsQueueReport'][_0xecc2('0x47')]({'where':{'id':_0x328ac7['params']['id']}})[_0xecc2('0x24')](handleEntityNotFound(_0x2c8274,null))[_0xecc2('0x24')](saveUpdates(_0x328ac7[_0xecc2('0x49')],null))[_0xecc2('0x24')](respondWithResult(_0x2c8274,null))[_0xecc2('0x43')](handleError(_0x2c8274,null));};exports[_0xecc2('0x25')]=function(_0x1783d3,_0x37efe0){return db[_0xecc2('0x2b')][_0xecc2('0x47')]({'where':{'id':_0x1783d3[_0xecc2('0x45')]['id']}})[_0xecc2('0x24')](handleEntityNotFound(_0x37efe0,null))['then'](removeEntity(_0x37efe0,null))[_0xecc2('0x43')](handleError(_0x37efe0,null));};exports['describe']=function(_0x7bdcde,_0x4c7843){return db[_0xecc2('0x2b')]['describe']()['then'](respondWithResult(_0x4c7843,null))[_0xecc2('0x43')](handleError(_0x4c7843,null));}; \ No newline at end of file +var _0xdebb=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','status','stack','name','send','index','SmsQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xdebb,0x1d2));var _0xbdeb=function(_0x444c2b,_0x1d9920){_0x444c2b=_0x444c2b-0x0;var _0x333ed0=_0xdebb[_0x444c2b];return _0x333ed0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbdeb('0x0'));var zipdir=require(_0xbdeb('0x1'));var jsonpatch=require(_0xbdeb('0x2'));var rp=require(_0xbdeb('0x3'));var moment=require(_0xbdeb('0x4'));var BPromise=require(_0xbdeb('0x5'));var Mustache=require(_0xbdeb('0x6'));var util=require(_0xbdeb('0x7'));var path=require(_0xbdeb('0x8'));var sox=require(_0xbdeb('0x9'));var csv=require(_0xbdeb('0xa'));var ejs=require(_0xbdeb('0xb'));var fs=require('fs');var fs_extra=require(_0xbdeb('0xc'));var _=require(_0xbdeb('0xd'));var squel=require(_0xbdeb('0xe'));var crypto=require(_0xbdeb('0xf'));var jsforce=require(_0xbdeb('0x10'));var deskjs=require(_0xbdeb('0x11'));var toCsv=require(_0xbdeb('0xa'));var querystring=require(_0xbdeb('0x12'));var Papa=require(_0xbdeb('0x13'));var Redis=require(_0xbdeb('0x14'));var authService=require(_0xbdeb('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xbdeb('0x16'));var hardwareService=require(_0xbdeb('0x17'));var logger=require(_0xbdeb('0x18'))(_0xbdeb('0x19'));var utils=require('../../config/utils');var config=require(_0xbdeb('0x1a'));var licenseUtil=require(_0xbdeb('0x1b'));var db=require(_0xbdeb('0x1c'))['db'];function respondWithStatusCode(_0x38686e,_0xa11b71){_0xa11b71=_0xa11b71||0xcc;return function(_0x1690fe){if(_0x1690fe){return _0x38686e[_0xbdeb('0x1d')](_0xa11b71);}return _0x38686e['status'](_0xa11b71)['end']();};}function respondWithResult(_0x19977d,_0x266725){_0x266725=_0x266725||0xc8;return function(_0x3d88be){if(_0x3d88be){return _0x19977d['status'](_0x266725)['json'](_0x3d88be);}};}function respondWithFilteredResult(_0xe92c3f,_0x781d27){return function(_0x43ee5a){if(_0x43ee5a){var _0x1d4f48=typeof _0x781d27[_0xbdeb('0x1e')]===_0xbdeb('0x1f')&&typeof _0x781d27['limit']==='undefined';var _0x193ca2=_0x43ee5a['count'];var _0x4872fb=_0x1d4f48?0x0:_0x781d27[_0xbdeb('0x1e')];var _0x6b4f97=_0x1d4f48?_0x43ee5a[_0xbdeb('0x20')]:_0x781d27[_0xbdeb('0x1e')]+_0x781d27[_0xbdeb('0x21')];var _0x35f0ba;if(_0x6b4f97>=_0x193ca2){_0x6b4f97=_0x193ca2;_0x35f0ba=0xc8;}else{_0x35f0ba=0xce;}_0xe92c3f['status'](_0x35f0ba);return _0xe92c3f[_0xbdeb('0x22')](_0xbdeb('0x23'),_0x4872fb+'-'+_0x6b4f97+'/'+_0x193ca2)[_0xbdeb('0x24')](_0x43ee5a);}return null;};}function patchUpdates(_0x33408b){return function(_0x2e39a0){try{jsonpatch[_0xbdeb('0x25')](_0x2e39a0,_0x33408b,!![]);}catch(_0x45f99b){return BPromise[_0xbdeb('0x26')](_0x45f99b);}return _0x2e39a0[_0xbdeb('0x27')]();};}function saveUpdates(_0x458110,_0x388769){return function(_0x4517fe){if(_0x4517fe){return _0x4517fe[_0xbdeb('0x28')](_0x458110)[_0xbdeb('0x29')](function(_0x2d2759){return _0x2d2759;});}return null;};}function removeEntity(_0x5c715f,_0x10f8d0){return function(_0x4f8d2f){if(_0x4f8d2f){return _0x4f8d2f['destroy']()[_0xbdeb('0x29')](function(){_0x5c715f[_0xbdeb('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x382555,_0x11c38e){return function(_0x548265){if(!_0x548265){_0x382555[_0xbdeb('0x1d')](0x194);}return _0x548265;};}function handleError(_0x387833,_0x289f55){_0x289f55=_0x289f55||0x1f4;return function(_0x47f063){logger['error'](_0x47f063[_0xbdeb('0x2b')]);if(_0x47f063[_0xbdeb('0x2c')]){delete _0x47f063[_0xbdeb('0x2c')];}_0x387833[_0xbdeb('0x2a')](_0x289f55)[_0xbdeb('0x2d')](_0x47f063);};}exports[_0xbdeb('0x2e')]=function(_0x57e454,_0x5e60cb){var _0x342867={},_0x2807c2={},_0x310669={'count':0x0,'rows':[]};var _0x5abdb0=_['map'](db[_0xbdeb('0x2f')][_0xbdeb('0x30')],function(_0x162d0b){return{'name':_0x162d0b[_0xbdeb('0x31')],'type':_0x162d0b[_0xbdeb('0x32')][_0xbdeb('0x33')]};});_0x2807c2[_0xbdeb('0x34')]=_[_0xbdeb('0x35')](_0x5abdb0,_0xbdeb('0x2c'));_0x2807c2[_0xbdeb('0x36')]=_[_0xbdeb('0x37')](_0x57e454['query']);_0x2807c2[_0xbdeb('0x38')]=_[_0xbdeb('0x39')](_0x2807c2[_0xbdeb('0x34')],_0x2807c2[_0xbdeb('0x36')]);_0x342867['attributes']=_[_0xbdeb('0x39')](_0x2807c2[_0xbdeb('0x34')],qs[_0xbdeb('0x3a')](_0x57e454['query']['fields']));_0x342867[_0xbdeb('0x3b')]=_0x342867['attributes'][_0xbdeb('0x3c')]?_0x342867['attributes']:_0x2807c2[_0xbdeb('0x34')];if(!_0x57e454[_0xbdeb('0x36')]['hasOwnProperty'](_0xbdeb('0x3d'))){_0x342867[_0xbdeb('0x21')]=qs['limit'](_0x57e454[_0xbdeb('0x36')]['limit']);_0x342867[_0xbdeb('0x1e')]=qs[_0xbdeb('0x1e')](_0x57e454[_0xbdeb('0x36')][_0xbdeb('0x1e')]);}_0x342867['order']=qs['sort'](_0x57e454[_0xbdeb('0x36')]['sort']);_0x342867[_0xbdeb('0x3e')]=qs[_0xbdeb('0x38')](_[_0xbdeb('0x3f')](_0x57e454[_0xbdeb('0x36')],_0x2807c2[_0xbdeb('0x38')]),_0x5abdb0);if(_0x57e454[_0xbdeb('0x36')][_0xbdeb('0x40')]){_0x342867['where']=_[_0xbdeb('0x41')](_0x342867['where'],{'$or':_[_0xbdeb('0x35')](_0x5abdb0,function(_0x17af72){if(_0x17af72[_0xbdeb('0x32')]!==_0xbdeb('0x42')){var _0x727eed={};_0x727eed[_0x17af72[_0xbdeb('0x2c')]]={'$like':'%'+_0x57e454[_0xbdeb('0x36')][_0xbdeb('0x40')]+'%'};return _0x727eed;}})});}_0x342867=_[_0xbdeb('0x41')]({},_0x342867,_0x57e454['options']);var _0x3bbfe6={'where':_0x342867[_0xbdeb('0x3e')]};return db[_0xbdeb('0x2f')][_0xbdeb('0x20')](_0x3bbfe6)['then'](function(_0x3ebba4){_0x310669[_0xbdeb('0x20')]=_0x3ebba4;if(_0x57e454[_0xbdeb('0x36')][_0xbdeb('0x43')]){_0x342867[_0xbdeb('0x44')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xbdeb('0x45')](_0x342867);})[_0xbdeb('0x29')](function(_0x1288f9){_0x310669[_0xbdeb('0x46')]=_0x1288f9;return _0x310669;})[_0xbdeb('0x29')](respondWithFilteredResult(_0x5e60cb,_0x342867))[_0xbdeb('0x47')](handleError(_0x5e60cb,null));};exports[_0xbdeb('0x48')]=function(_0x4c65b8,_0x456c26){var _0x311be3={'raw':!![],'where':{'id':_0x4c65b8[_0xbdeb('0x49')]['id']}},_0x2c06a0={};_0x2c06a0[_0xbdeb('0x34')]=_[_0xbdeb('0x37')](db[_0xbdeb('0x2f')][_0xbdeb('0x30')]);_0x2c06a0[_0xbdeb('0x36')]=_[_0xbdeb('0x37')](_0x4c65b8[_0xbdeb('0x36')]);_0x2c06a0[_0xbdeb('0x38')]=_[_0xbdeb('0x39')](_0x2c06a0[_0xbdeb('0x34')],_0x2c06a0[_0xbdeb('0x36')]);_0x311be3[_0xbdeb('0x3b')]=_[_0xbdeb('0x39')](_0x2c06a0[_0xbdeb('0x34')],qs[_0xbdeb('0x3a')](_0x4c65b8[_0xbdeb('0x36')][_0xbdeb('0x3a')]));_0x311be3['attributes']=_0x311be3[_0xbdeb('0x3b')][_0xbdeb('0x3c')]?_0x311be3[_0xbdeb('0x3b')]:_0x2c06a0[_0xbdeb('0x34')];if(_0x4c65b8['query']['includeAll']){_0x311be3[_0xbdeb('0x44')]=[{'all':!![]}];}_0x311be3=_[_0xbdeb('0x41')]({},_0x311be3,_0x4c65b8[_0xbdeb('0x4a')]);return db['SmsQueueReport']['find'](_0x311be3)[_0xbdeb('0x29')](handleEntityNotFound(_0x456c26,null))[_0xbdeb('0x29')](respondWithResult(_0x456c26,null))[_0xbdeb('0x47')](handleError(_0x456c26,null));};exports[_0xbdeb('0x4b')]=function(_0x498c7f,_0x3ede28){return db[_0xbdeb('0x2f')][_0xbdeb('0x4b')](_0x498c7f['body'],{})['then'](respondWithResult(_0x3ede28,0xc9))[_0xbdeb('0x47')](handleError(_0x3ede28,null));};exports['update']=function(_0x49eb45,_0x7f5825){if(_0x49eb45[_0xbdeb('0x4c')]['id']){delete _0x49eb45[_0xbdeb('0x4c')]['id'];}return db['SmsQueueReport'][_0xbdeb('0x4d')]({'where':{'id':_0x49eb45[_0xbdeb('0x49')]['id']}})[_0xbdeb('0x29')](handleEntityNotFound(_0x7f5825,null))[_0xbdeb('0x29')](saveUpdates(_0x49eb45[_0xbdeb('0x4c')],null))['then'](respondWithResult(_0x7f5825,null))['catch'](handleError(_0x7f5825,null));};exports[_0xbdeb('0x4e')]=function(_0x234d2b,_0x283ce6){return db['SmsQueueReport']['find']({'where':{'id':_0x234d2b[_0xbdeb('0x49')]['id']}})[_0xbdeb('0x29')](handleEntityNotFound(_0x283ce6,null))['then'](removeEntity(_0x283ce6,null))['catch'](handleError(_0x283ce6,null));};exports[_0xbdeb('0x4f')]=function(_0x124a47,_0x32388c){return db[_0xbdeb('0x2f')][_0xbdeb('0x4f')]()[_0xbdeb('0x29')](respondWithResult(_0x32388c,null))[_0xbdeb('0x47')](handleError(_0x32388c,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 79fcf87..ceca8be 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 _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x4d209b,_0x1a05e8){var _0xc5e693=function(_0x109c6e){while(--_0x109c6e){_0x4d209b['push'](_0x4d209b['shift']());}};_0xc5e693(++_0x1a05e8);}(_0xe706,0xa3));var _0x6e70=function(_0xa90718,_0x2fd952){_0xa90718=_0xa90718-0x0;var _0x56ed79=_0xe706[_0xa90718];return _0x56ed79;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index cbd9967..d07c6db 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 _0xaba4=['request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateSmsQueueReport','create','options','raw','stringify','UpdateSmsQueueReport','SmsQueueReport','update','where','limit','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','then','info','SmsQueueReport,\x20%s,\x20%s'];(function(_0x66adbd,_0xa70710){var _0xcf294f=function(_0x58f374){while(--_0x58f374){_0x66adbd['push'](_0x66adbd['shift']());}};_0xcf294f(++_0xa70710);}(_0xaba4,0xc5));var _0x4aba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaba4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4aba('0x0'));var moment=require(_0x4aba('0x1'));var BPromise=require(_0x4aba('0x2'));var rs=require(_0x4aba('0x3'));var fs=require('fs');var Redis=require(_0x4aba('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4aba('0x5'))(_0x4aba('0x6'));var config=require('../../config/environment');var jayson=require(_0x4aba('0x7'));var client=jayson[_0x4aba('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5249b4,_0x232967,_0x935729){return new BPromise(function(_0x2bbe2a,_0x5af1b5){return client[_0x4aba('0x9')](_0x5249b4,_0x935729)[_0x4aba('0xa')](function(_0x12ea83){logger[_0x4aba('0xb')](_0x4aba('0xc'),_0x232967,_0x4aba('0xd'));logger[_0x4aba('0xe')](_0x4aba('0xf'),_0x232967,_0x4aba('0xd'),JSON['stringify'](_0x12ea83));if(_0x12ea83[_0x4aba('0x10')]){if(_0x12ea83[_0x4aba('0x10')][_0x4aba('0x11')]===0x1f4){logger[_0x4aba('0x10')](_0x4aba('0xc'),_0x232967,_0x12ea83['error'][_0x4aba('0x12')]);return _0x5af1b5(_0x12ea83[_0x4aba('0x10')][_0x4aba('0x12')]);}logger[_0x4aba('0x10')](_0x4aba('0xc'),_0x232967,_0x12ea83[_0x4aba('0x10')][_0x4aba('0x12')]);return _0x2bbe2a(_0x12ea83[_0x4aba('0x10')]['message']);}else{logger[_0x4aba('0xb')](_0x4aba('0xc'),_0x232967,'request\x20sent');_0x2bbe2a(_0x12ea83['result'][_0x4aba('0x12')]);}})[_0x4aba('0x13')](function(_0x107a24){logger[_0x4aba('0x10')](_0x4aba('0xc'),_0x232967,_0x107a24);_0x5af1b5(_0x107a24);});});}exports[_0x4aba('0x14')]=function(_0x3a43fe){var _0x36c45c=this;return new Promise(function(_0x26bcc4,_0x4e82fa){return db['SmsQueueReport'][_0x4aba('0x15')](_0x3a43fe['body'],{'raw':_0x3a43fe[_0x4aba('0x16')]?_0x3a43fe[_0x4aba('0x16')][_0x4aba('0x17')]===undefined?!![]:![]:!![]})[_0x4aba('0xa')](function(_0x433b9f){logger['info'](_0x4aba('0x14'),_0x3a43fe);logger[_0x4aba('0xe')](_0x4aba('0x14'),_0x3a43fe,JSON[_0x4aba('0x18')](_0x433b9f));_0x26bcc4(_0x433b9f);})[_0x4aba('0x13')](function(_0x3a597a){logger[_0x4aba('0x10')](_0x4aba('0x14'),_0x3a597a['message'],_0x3a43fe);_0x4e82fa(_0x36c45c[_0x4aba('0x10')](0x1f4,_0x3a597a['message']));});});};exports[_0x4aba('0x19')]=function(_0x40c352){var _0x1408da=this;return new Promise(function(_0x3120c3,_0x51a623){return db[_0x4aba('0x1a')][_0x4aba('0x1b')](_0x40c352['body'],{'raw':_0x40c352[_0x4aba('0x16')]?_0x40c352['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40c352[_0x4aba('0x16')]?_0x40c352[_0x4aba('0x16')][_0x4aba('0x1c')]||null:null,'attributes':_0x40c352[_0x4aba('0x16')]?_0x40c352[_0x4aba('0x16')]['attributes']||null:null,'limit':_0x40c352[_0x4aba('0x16')]?_0x40c352[_0x4aba('0x16')][_0x4aba('0x1d')]||null:null})['then'](function(_0xf70f92){logger[_0x4aba('0xb')](_0x4aba('0x19'),_0x40c352);logger[_0x4aba('0xe')](_0x4aba('0x19'),_0x40c352,JSON[_0x4aba('0x18')](_0xf70f92));_0x3120c3(_0xf70f92);})['catch'](function(_0x58f108){logger[_0x4aba('0x10')](_0x4aba('0x19'),_0x58f108['message'],_0x40c352);_0x51a623(_0x1408da[_0x4aba('0x10')](0x1f4,_0x58f108['message']));});});}; \ No newline at end of file +var _0xe984=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','update','attributes','limit','UpdateSmsQueueReport'];(function(_0x51500b,_0x48aba5){var _0x3f2648=function(_0x1a4c89){while(--_0x1a4c89){_0x51500b['push'](_0x51500b['shift']());}};_0x3f2648(++_0x48aba5);}(_0xe984,0xcc));var _0x4e98=function(_0x152fe3,_0x12b0c8){_0x152fe3=_0x152fe3-0x0;var _0xc5bb39=_0xe984[_0x152fe3];return _0xc5bb39;};'use strict';var _=require(_0x4e98('0x0'));var util=require(_0x4e98('0x1'));var moment=require(_0x4e98('0x2'));var BPromise=require(_0x4e98('0x3'));var rs=require(_0x4e98('0x4'));var fs=require('fs');var Redis=require(_0x4e98('0x5'));var db=require(_0x4e98('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4e98('0x7'))(_0x4e98('0x8'));var config=require('../../config/environment');var jayson=require(_0x4e98('0x9'));var client=jayson[_0x4e98('0xa')][_0x4e98('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55c8df,_0x461260,_0x283006){return new BPromise(function(_0x4216aa,_0x2ebc96){return client[_0x4e98('0xc')](_0x55c8df,_0x283006)[_0x4e98('0xd')](function(_0x9937b6){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x461260,'request\x20sent');logger[_0x4e98('0xe')](_0x4e98('0xf'),_0x461260,_0x4e98('0x10'),JSON[_0x4e98('0x11')](_0x9937b6));if(_0x9937b6[_0x4e98('0x12')]){if(_0x9937b6[_0x4e98('0x12')][_0x4e98('0x13')]===0x1f4){logger[_0x4e98('0x12')](_0x4e98('0x14'),_0x461260,_0x9937b6[_0x4e98('0x12')][_0x4e98('0x15')]);return _0x2ebc96(_0x9937b6[_0x4e98('0x12')][_0x4e98('0x15')]);}logger[_0x4e98('0x12')](_0x4e98('0x14'),_0x461260,_0x9937b6[_0x4e98('0x12')][_0x4e98('0x15')]);return _0x4216aa(_0x9937b6[_0x4e98('0x12')]['message']);}else{logger[_0x4e98('0x16')](_0x4e98('0x14'),_0x461260,_0x4e98('0x10'));_0x4216aa(_0x9937b6[_0x4e98('0x17')]['message']);}})[_0x4e98('0x18')](function(_0x6e542d){logger['error'](_0x4e98('0x14'),_0x461260,_0x6e542d);_0x2ebc96(_0x6e542d);});});}exports[_0x4e98('0x19')]=function(_0x58f02e){var _0x20a6e2=this;return new Promise(function(_0x3d87f8,_0x10dd9b){return db[_0x4e98('0x1a')][_0x4e98('0x1b')](_0x58f02e[_0x4e98('0x1c')],{'raw':_0x58f02e[_0x4e98('0x1d')]?_0x58f02e[_0x4e98('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x4e98('0xd')](function(_0x38e511){logger[_0x4e98('0x16')](_0x4e98('0x19'),_0x58f02e);logger['debug'](_0x4e98('0x19'),_0x58f02e,JSON[_0x4e98('0x11')](_0x38e511));_0x3d87f8(_0x38e511);})[_0x4e98('0x18')](function(_0x5100b4){logger['error'](_0x4e98('0x19'),_0x5100b4[_0x4e98('0x15')],_0x58f02e);_0x10dd9b(_0x20a6e2[_0x4e98('0x12')](0x1f4,_0x5100b4[_0x4e98('0x15')]));});});};exports['UpdateSmsQueueReport']=function(_0x250f3c){var _0x382018=this;return new Promise(function(_0x11ab19,_0x3c69cf){return db['SmsQueueReport'][_0x4e98('0x1e')](_0x250f3c[_0x4e98('0x1c')],{'raw':_0x250f3c[_0x4e98('0x1d')]?_0x250f3c[_0x4e98('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x250f3c[_0x4e98('0x1d')]?_0x250f3c[_0x4e98('0x1d')]['where']||null:null,'attributes':_0x250f3c[_0x4e98('0x1d')]?_0x250f3c[_0x4e98('0x1d')][_0x4e98('0x1f')]||null:null,'limit':_0x250f3c[_0x4e98('0x1d')]?_0x250f3c[_0x4e98('0x1d')][_0x4e98('0x20')]||null:null})[_0x4e98('0xd')](function(_0x404d9f){logger[_0x4e98('0x16')](_0x4e98('0x21'),_0x250f3c);logger[_0x4e98('0xe')]('UpdateSmsQueueReport',_0x250f3c,JSON[_0x4e98('0x11')](_0x404d9f));_0x11ab19(_0x404d9f);})[_0x4e98('0x18')](function(_0x499712){logger['error']('UpdateSmsQueueReport',_0x499712['message'],_0x250f3c);_0x3c69cf(_0x382018[_0x4e98('0x12')](0x1f4,_0x499712[_0x4e98('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index b68ab07..ba32510 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 _0xb4c7=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','describe','/:id','show'];(function(_0x1f8a01,_0x4ac0b7){var _0x59346f=function(_0x53c828){while(--_0x53c828){_0x1f8a01['push'](_0x1f8a01['shift']());}};_0x59346f(++_0x4ac0b7);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x50918e,_0x2ef21d){_0x50918e=_0x50918e-0x0;var _0x194586=_0xb4c7[_0x50918e];return _0x194586;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get']('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xb')]);router[_0x7b4c('0xc')]('/describe',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xd')]);router['get'](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xf')]);router[_0x7b4c('0x10')]('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x11')]);router[_0x7b4c('0x12')](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x13')]);router['delete']('/:id',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x14')]);module[_0x7b4c('0x15')]=router; \ No newline at end of file +var _0x0fda=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x44cf20,_0x3b6faf){var _0x3bb7c5=function(_0x516c01){while(--_0x516c01){_0x44cf20['push'](_0x44cf20['shift']());}};_0x3bb7c5(++_0x3b6faf);}(_0x0fda,0x1a0));var _0xa0fd=function(_0xa4e9c8,_0x2676f3){_0xa4e9c8=_0xa4e9c8-0x0;var _0x45d4e1=_0x0fda[_0xa4e9c8];return _0x45d4e1;};'use strict';var multer=require(_0xa0fd('0x0'));var util=require('util');var path=require(_0xa0fd('0x1'));var timeout=require(_0xa0fd('0x2'));var express=require(_0xa0fd('0x3'));var router=express[_0xa0fd('0x4')]();var fs_extra=require(_0xa0fd('0x5'));var auth=require(_0xa0fd('0x6'));var interaction=require(_0xa0fd('0x7'));var config=require('../../config/environment');var controller=require('./smsTransferReport.controller');router[_0xa0fd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa0fd('0x8')](_0xa0fd('0x9'),auth[_0xa0fd('0xa')](),controller[_0xa0fd('0xb')]);router['get'](_0xa0fd('0xc'),auth[_0xa0fd('0xa')](),controller[_0xa0fd('0xd')]);router[_0xa0fd('0xe')]('/',auth['isAuthenticated'](),controller[_0xa0fd('0xf')]);router[_0xa0fd('0x10')](_0xa0fd('0xc'),auth['isAuthenticated'](),controller[_0xa0fd('0x11')]);router[_0xa0fd('0x12')](_0xa0fd('0xc'),auth[_0xa0fd('0xa')](),controller[_0xa0fd('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index a389bdf..1b90095 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x3aad23,_0x37d3c1){var _0x3377cd=function(_0x552a1d){while(--_0x552a1d){_0x3aad23['push'](_0x3aad23['shift']());}};_0x3377cd(++_0x37d3c1);}(_0x70e0,0x17b));var _0x070e=function(_0x2898a6,_0x310f12){_0x2898a6=_0x2898a6-0x0;var _0x57563b=_0x70e0[_0x2898a6];return _0x57563b;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x82c6ae,_0x166560){var _0x41a4fa=function(_0x461ed8){while(--_0x461ed8){_0x82c6ae['push'](_0x82c6ae['shift']());}};_0x41a4fa(++_0x166560);}(_0x70e0,0x17b));var _0x070e=function(_0x3a67d2,_0x4a0cad){_0x3a67d2=_0x3a67d2-0x0;var _0x286153=_0x70e0[_0x3a67d2];return _0x286153;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 792e0c0..911c1b0 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 _0xc8cd=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','include','findAll','rows','catch','params','includeAll','create','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','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','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','reject','save','update','then','destroy','stack','name','index','map','SmsTransferReport','rawAttributes','fieldName','key','model','query','keys','intersection'];(function(_0x9cf14e,_0x57d04f){var _0x14877a=function(_0x35e94f){while(--_0x35e94f){_0x9cf14e['push'](_0x9cf14e['shift']());}};_0x14877a(++_0x57d04f);}(_0xc8cd,0x1cc));var _0xdc8c=function(_0x2830a1,_0x361c7e){_0x2830a1=_0x2830a1-0x0;var _0xf94d31=_0xc8cd[_0x2830a1];return _0xf94d31;};'use strict';var emlformat=require(_0xdc8c('0x0'));var rimraf=require(_0xdc8c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdc8c('0x2'));var moment=require(_0xdc8c('0x3'));var BPromise=require(_0xdc8c('0x4'));var Mustache=require('mustache');var util=require(_0xdc8c('0x5'));var path=require('path');var sox=require(_0xdc8c('0x6'));var csv=require(_0xdc8c('0x7'));var ejs=require(_0xdc8c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc8c('0x9'));var squel=require(_0xdc8c('0xa'));var crypto=require(_0xdc8c('0xb'));var jsforce=require(_0xdc8c('0xc'));var deskjs=require(_0xdc8c('0xd'));var toCsv=require(_0xdc8c('0x7'));var querystring=require(_0xdc8c('0xe'));var Papa=require(_0xdc8c('0xf'));var Redis=require(_0xdc8c('0x10'));var authService=require(_0xdc8c('0x11'));var qs=require(_0xdc8c('0x12'));var as=require(_0xdc8c('0x13'));var hardwareService=require(_0xdc8c('0x14'));var logger=require(_0xdc8c('0x15'))('api');var utils=require(_0xdc8c('0x16'));var config=require(_0xdc8c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xdc8c('0x18'))['db'];function respondWithStatusCode(_0x2f4f11,_0x8e4ae4){_0x8e4ae4=_0x8e4ae4||0xcc;return function(_0x32a2d6){if(_0x32a2d6){return _0x2f4f11[_0xdc8c('0x19')](_0x8e4ae4);}return _0x2f4f11[_0xdc8c('0x1a')](_0x8e4ae4)[_0xdc8c('0x1b')]();};}function respondWithResult(_0x41e706,_0x45f689){_0x45f689=_0x45f689||0xc8;return function(_0x115c67){if(_0x115c67){return _0x41e706[_0xdc8c('0x1a')](_0x45f689)[_0xdc8c('0x1c')](_0x115c67);}};}function respondWithFilteredResult(_0x345fbd,_0x41502e){return function(_0x283ad7){if(_0x283ad7){var _0x404657=typeof _0x41502e['offset']===_0xdc8c('0x1d')&&typeof _0x41502e[_0xdc8c('0x1e')]===_0xdc8c('0x1d');var _0x56e0ef=_0x283ad7['count'];var _0x5177c8=_0x404657?0x0:_0x41502e[_0xdc8c('0x1f')];var _0x2f2492=_0x404657?_0x283ad7[_0xdc8c('0x20')]:_0x41502e[_0xdc8c('0x1f')]+_0x41502e[_0xdc8c('0x1e')];var _0x2de295;if(_0x2f2492>=_0x56e0ef){_0x2f2492=_0x56e0ef;_0x2de295=0xc8;}else{_0x2de295=0xce;}_0x345fbd[_0xdc8c('0x1a')](_0x2de295);return _0x345fbd[_0xdc8c('0x21')]('Content-Range',_0x5177c8+'-'+_0x2f2492+'/'+_0x56e0ef)[_0xdc8c('0x1c')](_0x283ad7);}return null;};}function patchUpdates(_0xa9d90e){return function(_0x38155a){try{jsonpatch['apply'](_0x38155a,_0xa9d90e,!![]);}catch(_0x4c6a18){return BPromise[_0xdc8c('0x22')](_0x4c6a18);}return _0x38155a[_0xdc8c('0x23')]();};}function saveUpdates(_0xc1a285,_0x5d3159){return function(_0xa54f2d){if(_0xa54f2d){return _0xa54f2d[_0xdc8c('0x24')](_0xc1a285)[_0xdc8c('0x25')](function(_0x33fa4a){return _0x33fa4a;});}return null;};}function removeEntity(_0x5a2cc3,_0x1ee0fe){return function(_0x431d07){if(_0x431d07){return _0x431d07[_0xdc8c('0x26')]()[_0xdc8c('0x25')](function(){_0x5a2cc3[_0xdc8c('0x1a')](0xcc)[_0xdc8c('0x1b')]();});}};}function handleEntityNotFound(_0xa7d346,_0x1dd393){return function(_0x31cc1a){if(!_0x31cc1a){_0xa7d346['sendStatus'](0x194);}return _0x31cc1a;};}function handleError(_0x1dc8f8,_0x288e76){_0x288e76=_0x288e76||0x1f4;return function(_0x1bc4c1){logger['error'](_0x1bc4c1[_0xdc8c('0x27')]);if(_0x1bc4c1[_0xdc8c('0x28')]){delete _0x1bc4c1[_0xdc8c('0x28')];}_0x1dc8f8[_0xdc8c('0x1a')](_0x288e76)['send'](_0x1bc4c1);};}exports[_0xdc8c('0x29')]=function(_0x2ba465,_0x274f72){var _0x2530f1={},_0x46b35e={},_0x2a52fa={'count':0x0,'rows':[]};var _0x5c8cdc=_[_0xdc8c('0x2a')](db[_0xdc8c('0x2b')][_0xdc8c('0x2c')],function(_0x448cc8){return{'name':_0x448cc8[_0xdc8c('0x2d')],'type':_0x448cc8['type'][_0xdc8c('0x2e')]};});_0x46b35e[_0xdc8c('0x2f')]=_[_0xdc8c('0x2a')](_0x5c8cdc,_0xdc8c('0x28'));_0x46b35e[_0xdc8c('0x30')]=_[_0xdc8c('0x31')](_0x2ba465['query']);_0x46b35e['filters']=_[_0xdc8c('0x32')](_0x46b35e[_0xdc8c('0x2f')],_0x46b35e[_0xdc8c('0x30')]);_0x2530f1['attributes']=_[_0xdc8c('0x32')](_0x46b35e[_0xdc8c('0x2f')],qs[_0xdc8c('0x33')](_0x2ba465[_0xdc8c('0x30')][_0xdc8c('0x33')]));_0x2530f1['attributes']=_0x2530f1[_0xdc8c('0x34')][_0xdc8c('0x35')]?_0x2530f1[_0xdc8c('0x34')]:_0x46b35e[_0xdc8c('0x2f')];if(!_0x2ba465[_0xdc8c('0x30')][_0xdc8c('0x36')](_0xdc8c('0x37'))){_0x2530f1['limit']=qs[_0xdc8c('0x1e')](_0x2ba465[_0xdc8c('0x30')]['limit']);_0x2530f1[_0xdc8c('0x1f')]=qs[_0xdc8c('0x1f')](_0x2ba465[_0xdc8c('0x30')][_0xdc8c('0x1f')]);}_0x2530f1[_0xdc8c('0x38')]=qs[_0xdc8c('0x39')](_0x2ba465[_0xdc8c('0x30')][_0xdc8c('0x39')]);_0x2530f1[_0xdc8c('0x3a')]=qs[_0xdc8c('0x3b')](_['pick'](_0x2ba465[_0xdc8c('0x30')],_0x46b35e['filters']),_0x5c8cdc);if(_0x2ba465[_0xdc8c('0x30')][_0xdc8c('0x3c')]){_0x2530f1[_0xdc8c('0x3a')]=_['merge'](_0x2530f1[_0xdc8c('0x3a')],{'$or':_[_0xdc8c('0x2a')](_0x5c8cdc,function(_0x1fa88a){if(_0x1fa88a['type']!=='VIRTUAL'){var _0x23005c={};_0x23005c[_0x1fa88a['name']]={'$like':'%'+_0x2ba465[_0xdc8c('0x30')]['filter']+'%'};return _0x23005c;}})});}_0x2530f1=_[_0xdc8c('0x3d')]({},_0x2530f1,_0x2ba465[_0xdc8c('0x3e')]);var _0x1a2104={'where':_0x2530f1[_0xdc8c('0x3a')]};return db[_0xdc8c('0x2b')]['count'](_0x1a2104)['then'](function(_0x34d949){_0x2a52fa['count']=_0x34d949;if(_0x2ba465['query']['includeAll']){_0x2530f1[_0xdc8c('0x3f')]=[{'all':!![]}];}return db[_0xdc8c('0x2b')][_0xdc8c('0x40')](_0x2530f1);})[_0xdc8c('0x25')](function(_0x3e88d1){_0x2a52fa[_0xdc8c('0x41')]=_0x3e88d1;return _0x2a52fa;})[_0xdc8c('0x25')](respondWithFilteredResult(_0x274f72,_0x2530f1))[_0xdc8c('0x42')](handleError(_0x274f72,null));};exports['show']=function(_0xd91225,_0x2834f0){var _0x17db1b={'raw':!![],'where':{'id':_0xd91225[_0xdc8c('0x43')]['id']}},_0x1dcdc5={};_0x1dcdc5[_0xdc8c('0x2f')]=_[_0xdc8c('0x31')](db[_0xdc8c('0x2b')][_0xdc8c('0x2c')]);_0x1dcdc5['query']=_[_0xdc8c('0x31')](_0xd91225['query']);_0x1dcdc5[_0xdc8c('0x3b')]=_['intersection'](_0x1dcdc5[_0xdc8c('0x2f')],_0x1dcdc5[_0xdc8c('0x30')]);_0x17db1b['attributes']=_[_0xdc8c('0x32')](_0x1dcdc5[_0xdc8c('0x2f')],qs[_0xdc8c('0x33')](_0xd91225[_0xdc8c('0x30')][_0xdc8c('0x33')]));_0x17db1b[_0xdc8c('0x34')]=_0x17db1b['attributes'][_0xdc8c('0x35')]?_0x17db1b[_0xdc8c('0x34')]:_0x1dcdc5['model'];if(_0xd91225['query'][_0xdc8c('0x44')]){_0x17db1b[_0xdc8c('0x3f')]=[{'all':!![]}];}_0x17db1b=_['merge']({},_0x17db1b,_0xd91225[_0xdc8c('0x3e')]);return db['SmsTransferReport']['find'](_0x17db1b)[_0xdc8c('0x25')](handleEntityNotFound(_0x2834f0,null))['then'](respondWithResult(_0x2834f0,null))[_0xdc8c('0x42')](handleError(_0x2834f0,null));};exports['create']=function(_0x7a248d,_0x304414){return db['SmsTransferReport'][_0xdc8c('0x45')](_0x7a248d['body'],{})[_0xdc8c('0x25')](respondWithResult(_0x304414,0xc9))[_0xdc8c('0x42')](handleError(_0x304414,null));};exports[_0xdc8c('0x24')]=function(_0x1cae97,_0x449f06){if(_0x1cae97[_0xdc8c('0x46')]['id']){delete _0x1cae97[_0xdc8c('0x46')]['id'];}return db[_0xdc8c('0x2b')]['find']({'where':{'id':_0x1cae97[_0xdc8c('0x43')]['id']}})[_0xdc8c('0x25')](handleEntityNotFound(_0x449f06,null))[_0xdc8c('0x25')](saveUpdates(_0x1cae97['body'],null))[_0xdc8c('0x25')](respondWithResult(_0x449f06,null))[_0xdc8c('0x42')](handleError(_0x449f06,null));};exports['destroy']=function(_0x9e99f8,_0x286590){return db[_0xdc8c('0x2b')][_0xdc8c('0x47')]({'where':{'id':_0x9e99f8[_0xdc8c('0x43')]['id']}})[_0xdc8c('0x25')](handleEntityNotFound(_0x286590,null))[_0xdc8c('0x25')](removeEntity(_0x286590,null))[_0xdc8c('0x42')](handleError(_0x286590,null));};exports[_0xdc8c('0x48')]=function(_0x484928,_0x21e314){return db[_0xdc8c('0x2b')]['describe']()['then'](respondWithResult(_0x21e314,null))[_0xdc8c('0x42')](handleError(_0x21e314,null));}; \ No newline at end of file +var _0x4e4d=['../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','apply','save','update','then','end','sendStatus','error','stack','name','send','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x4e4d,0x188));var _0xd4e4=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0x4e4d[_0x59d0cc];return _0x2ae79f;};'use strict';var emlformat=require(_0xd4e4('0x0'));var rimraf=require(_0xd4e4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4e4('0x2'));var rp=require(_0xd4e4('0x3'));var moment=require(_0xd4e4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd4e4('0x5'));var util=require(_0xd4e4('0x6'));var path=require('path');var sox=require(_0xd4e4('0x7'));var csv=require(_0xd4e4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd4e4('0x9'));var crypto=require(_0xd4e4('0xa'));var jsforce=require(_0xd4e4('0xb'));var deskjs=require(_0xd4e4('0xc'));var toCsv=require(_0xd4e4('0x8'));var querystring=require(_0xd4e4('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd4e4('0xe'));var qs=require(_0xd4e4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd4e4('0x10'));var logger=require(_0xd4e4('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xd4e4('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xd4e4('0x13'))['db'];function respondWithStatusCode(_0x6a141a,_0x5980e6){_0x5980e6=_0x5980e6||0xcc;return function(_0x5264d1){if(_0x5264d1){return _0x6a141a['sendStatus'](_0x5980e6);}return _0x6a141a[_0xd4e4('0x14')](_0x5980e6)['end']();};}function respondWithResult(_0xf51c2f,_0x560e84){_0x560e84=_0x560e84||0xc8;return function(_0x1e9435){if(_0x1e9435){return _0xf51c2f[_0xd4e4('0x14')](_0x560e84)['json'](_0x1e9435);}};}function respondWithFilteredResult(_0x3d70af,_0x272f56){return function(_0x3b9308){if(_0x3b9308){var _0x58b28d=typeof _0x272f56[_0xd4e4('0x15')]===_0xd4e4('0x16')&&typeof _0x272f56[_0xd4e4('0x17')]===_0xd4e4('0x16');var _0x1114fc=_0x3b9308[_0xd4e4('0x18')];var _0x4e9c2b=_0x58b28d?0x0:_0x272f56['offset'];var _0x4ff5c2=_0x58b28d?_0x3b9308[_0xd4e4('0x18')]:_0x272f56[_0xd4e4('0x15')]+_0x272f56[_0xd4e4('0x17')];var _0x242da3;if(_0x4ff5c2>=_0x1114fc){_0x4ff5c2=_0x1114fc;_0x242da3=0xc8;}else{_0x242da3=0xce;}_0x3d70af['status'](_0x242da3);return _0x3d70af['set']('Content-Range',_0x4e9c2b+'-'+_0x4ff5c2+'/'+_0x1114fc)['json'](_0x3b9308);}return null;};}function patchUpdates(_0x5b2d06){return function(_0x388e94){try{jsonpatch[_0xd4e4('0x19')](_0x388e94,_0x5b2d06,!![]);}catch(_0x544725){return BPromise['reject'](_0x544725);}return _0x388e94[_0xd4e4('0x1a')]();};}function saveUpdates(_0x46fa1f,_0x5b18ac){return function(_0x37db51){if(_0x37db51){return _0x37db51[_0xd4e4('0x1b')](_0x46fa1f)[_0xd4e4('0x1c')](function(_0x56f285){return _0x56f285;});}return null;};}function removeEntity(_0x5ca26b,_0x8ccd74){return function(_0xed8392){if(_0xed8392){return _0xed8392['destroy']()[_0xd4e4('0x1c')](function(){_0x5ca26b[_0xd4e4('0x14')](0xcc)[_0xd4e4('0x1d')]();});}};}function handleEntityNotFound(_0xc987b2,_0x3fab1c){return function(_0x955634){if(!_0x955634){_0xc987b2[_0xd4e4('0x1e')](0x194);}return _0x955634;};}function handleError(_0x4875a6,_0x1c675f){_0x1c675f=_0x1c675f||0x1f4;return function(_0x32d1cc){logger[_0xd4e4('0x1f')](_0x32d1cc[_0xd4e4('0x20')]);if(_0x32d1cc[_0xd4e4('0x21')]){delete _0x32d1cc[_0xd4e4('0x21')];}_0x4875a6[_0xd4e4('0x14')](_0x1c675f)[_0xd4e4('0x22')](_0x32d1cc);};}exports['index']=function(_0x426ec0,_0x58c632){var _0x25f8d0={},_0x98c5ef={},_0x5b1c2e={'count':0x0,'rows':[]};var _0x22e2cd=_[_0xd4e4('0x23')](db[_0xd4e4('0x24')][_0xd4e4('0x25')],function(_0x470466){return{'name':_0x470466[_0xd4e4('0x26')],'type':_0x470466[_0xd4e4('0x27')][_0xd4e4('0x28')]};});_0x98c5ef[_0xd4e4('0x29')]=_[_0xd4e4('0x23')](_0x22e2cd,_0xd4e4('0x21'));_0x98c5ef[_0xd4e4('0x2a')]=_[_0xd4e4('0x2b')](_0x426ec0[_0xd4e4('0x2a')]);_0x98c5ef[_0xd4e4('0x2c')]=_[_0xd4e4('0x2d')](_0x98c5ef[_0xd4e4('0x29')],_0x98c5ef['query']);_0x25f8d0[_0xd4e4('0x2e')]=_[_0xd4e4('0x2d')](_0x98c5ef[_0xd4e4('0x29')],qs[_0xd4e4('0x2f')](_0x426ec0['query'][_0xd4e4('0x2f')]));_0x25f8d0[_0xd4e4('0x2e')]=_0x25f8d0[_0xd4e4('0x2e')][_0xd4e4('0x30')]?_0x25f8d0[_0xd4e4('0x2e')]:_0x98c5ef[_0xd4e4('0x29')];if(!_0x426ec0[_0xd4e4('0x2a')][_0xd4e4('0x31')](_0xd4e4('0x32'))){_0x25f8d0[_0xd4e4('0x17')]=qs[_0xd4e4('0x17')](_0x426ec0['query'][_0xd4e4('0x17')]);_0x25f8d0['offset']=qs['offset'](_0x426ec0[_0xd4e4('0x2a')][_0xd4e4('0x15')]);}_0x25f8d0['order']=qs[_0xd4e4('0x33')](_0x426ec0[_0xd4e4('0x2a')]['sort']);_0x25f8d0[_0xd4e4('0x34')]=qs[_0xd4e4('0x2c')](_[_0xd4e4('0x35')](_0x426ec0[_0xd4e4('0x2a')],_0x98c5ef['filters']),_0x22e2cd);if(_0x426ec0[_0xd4e4('0x2a')][_0xd4e4('0x36')]){_0x25f8d0['where']=_[_0xd4e4('0x37')](_0x25f8d0[_0xd4e4('0x34')],{'$or':_[_0xd4e4('0x23')](_0x22e2cd,function(_0x4ac377){if(_0x4ac377[_0xd4e4('0x27')]!=='VIRTUAL'){var _0x398162={};_0x398162[_0x4ac377[_0xd4e4('0x21')]]={'$like':'%'+_0x426ec0[_0xd4e4('0x2a')][_0xd4e4('0x36')]+'%'};return _0x398162;}})});}_0x25f8d0=_[_0xd4e4('0x37')]({},_0x25f8d0,_0x426ec0[_0xd4e4('0x38')]);var _0x55ba87={'where':_0x25f8d0['where']};return db[_0xd4e4('0x24')][_0xd4e4('0x18')](_0x55ba87)['then'](function(_0x46b006){_0x5b1c2e[_0xd4e4('0x18')]=_0x46b006;if(_0x426ec0[_0xd4e4('0x2a')][_0xd4e4('0x39')]){_0x25f8d0[_0xd4e4('0x3a')]=[{'all':!![]}];}return db[_0xd4e4('0x24')][_0xd4e4('0x3b')](_0x25f8d0);})['then'](function(_0x1987e1){_0x5b1c2e[_0xd4e4('0x3c')]=_0x1987e1;return _0x5b1c2e;})[_0xd4e4('0x1c')](respondWithFilteredResult(_0x58c632,_0x25f8d0))['catch'](handleError(_0x58c632,null));};exports[_0xd4e4('0x3d')]=function(_0x57ba8c,_0x4f9ad2){var _0x3166c8={'raw':!![],'where':{'id':_0x57ba8c[_0xd4e4('0x3e')]['id']}},_0x2ef4cb={};_0x2ef4cb[_0xd4e4('0x29')]=_[_0xd4e4('0x2b')](db[_0xd4e4('0x24')][_0xd4e4('0x25')]);_0x2ef4cb['query']=_[_0xd4e4('0x2b')](_0x57ba8c[_0xd4e4('0x2a')]);_0x2ef4cb['filters']=_[_0xd4e4('0x2d')](_0x2ef4cb[_0xd4e4('0x29')],_0x2ef4cb[_0xd4e4('0x2a')]);_0x3166c8[_0xd4e4('0x2e')]=_[_0xd4e4('0x2d')](_0x2ef4cb[_0xd4e4('0x29')],qs[_0xd4e4('0x2f')](_0x57ba8c['query'][_0xd4e4('0x2f')]));_0x3166c8[_0xd4e4('0x2e')]=_0x3166c8[_0xd4e4('0x2e')][_0xd4e4('0x30')]?_0x3166c8[_0xd4e4('0x2e')]:_0x2ef4cb['model'];if(_0x57ba8c[_0xd4e4('0x2a')]['includeAll']){_0x3166c8[_0xd4e4('0x3a')]=[{'all':!![]}];}_0x3166c8=_[_0xd4e4('0x37')]({},_0x3166c8,_0x57ba8c[_0xd4e4('0x38')]);return db[_0xd4e4('0x24')][_0xd4e4('0x3f')](_0x3166c8)['then'](handleEntityNotFound(_0x4f9ad2,null))['then'](respondWithResult(_0x4f9ad2,null))['catch'](handleError(_0x4f9ad2,null));};exports[_0xd4e4('0x40')]=function(_0x3ad6b7,_0x5396d3){return db[_0xd4e4('0x24')][_0xd4e4('0x40')](_0x3ad6b7[_0xd4e4('0x41')],{})[_0xd4e4('0x1c')](respondWithResult(_0x5396d3,0xc9))[_0xd4e4('0x42')](handleError(_0x5396d3,null));};exports[_0xd4e4('0x1b')]=function(_0x2e1feb,_0x3c1905){if(_0x2e1feb[_0xd4e4('0x41')]['id']){delete _0x2e1feb[_0xd4e4('0x41')]['id'];}return db['SmsTransferReport'][_0xd4e4('0x3f')]({'where':{'id':_0x2e1feb[_0xd4e4('0x3e')]['id']}})[_0xd4e4('0x1c')](handleEntityNotFound(_0x3c1905,null))[_0xd4e4('0x1c')](saveUpdates(_0x2e1feb[_0xd4e4('0x41')],null))[_0xd4e4('0x1c')](respondWithResult(_0x3c1905,null))[_0xd4e4('0x42')](handleError(_0x3c1905,null));};exports['destroy']=function(_0x2728a0,_0x55fd3b){return db['SmsTransferReport']['find']({'where':{'id':_0x2728a0[_0xd4e4('0x3e')]['id']}})[_0xd4e4('0x1c')](handleEntityNotFound(_0x55fd3b,null))['then'](removeEntity(_0x55fd3b,null))[_0xd4e4('0x42')](handleError(_0x55fd3b,null));};exports[_0xd4e4('0x43')]=function(_0x4c1933,_0x441b4f){return db[_0xd4e4('0x24')][_0xd4e4('0x43')]()[_0xd4e4('0x1c')](respondWithResult(_0x441b4f,null))['catch'](handleError(_0x441b4f,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index d08f377..0855d55 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 _0xf987=['define','SmsTransferReport','report_sms_transfer','uniqueid','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports'];(function(_0x599d71,_0x86b3b7){var _0x582c85=function(_0x1b2206){while(--_0x1b2206){_0x599d71['push'](_0x599d71['shift']());}};_0x582c85(++_0x86b3b7);}(_0xf987,0x18a));var _0x7f98=function(_0x24bf0f,_0xf1d4ec){_0x24bf0f=_0x24bf0f-0x0;var _0x42ce95=_0xf987[_0x24bf0f];return _0x42ce95;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7f98('0x0'))(_0x7f98('0x1'));var moment=require('moment');var BPromise=require(_0x7f98('0x2'));var rp=require(_0x7f98('0x3'));var fs=require('fs');var path=require(_0x7f98('0x4'));var rimraf=require(_0x7f98('0x5'));var config=require(_0x7f98('0x6'));var attributes=require(_0x7f98('0x7'));module[_0x7f98('0x8')]=function(_0x3b5abb,_0x3fb8e2){return _0x3b5abb[_0x7f98('0x9')](_0x7f98('0xa'),attributes,{'tableName':_0x7f98('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7f98('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x82a7=['define','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsTransferReport.attributes','exports'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x82a7,0x1c4));var _0x782a=function(_0x3adf17,_0x520913){_0x3adf17=_0x3adf17-0x0;var _0x580073=_0x82a7[_0x3adf17];return _0x580073;};'use strict';var _=require('lodash');var util=require(_0x782a('0x0'));var logger=require(_0x782a('0x1'))(_0x782a('0x2'));var moment=require(_0x782a('0x3'));var BPromise=require(_0x782a('0x4'));var rp=require(_0x782a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x782a('0x6'));var config=require(_0x782a('0x7'));var attributes=require(_0x782a('0x8'));module[_0x782a('0x9')]=function(_0x2fc0df,_0x2c5ea1){return _0x2fc0df[_0x782a('0xa')](_0x782a('0xb'),attributes,{'tableName':_0x782a('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x782a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 52f0b1e..8543801 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 _0x6c84=['../../config/logger','jayson/promise','client','http','then','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3a931c,_0x328d3d){var _0x38497d=function(_0x2c5524){while(--_0x2c5524){_0x3a931c['push'](_0x3a931c['shift']());}};_0x38497d(++_0x328d3d);}(_0x6c84,0x112));var _0x46c8=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x6c84[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x46c8('0x0'));var util=require(_0x46c8('0x1'));var moment=require(_0x46c8('0x2'));var BPromise=require(_0x46c8('0x3'));var rs=require(_0x46c8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46c8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x46c8('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x46c8('0x7'));var client=jayson[_0x46c8('0x8')][_0x46c8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d239a,_0x13bf93,_0x3c1e2a){return new BPromise(function(_0xfe26c8,_0x1727f4){return client['request'](_0x2d239a,_0x3c1e2a)[_0x46c8('0xa')](function(_0x561c61){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x13bf93,_0x46c8('0xb'));logger['debug'](_0x46c8('0xc'),_0x13bf93,_0x46c8('0xb'),JSON[_0x46c8('0xd')](_0x561c61));if(_0x561c61[_0x46c8('0xe')]){if(_0x561c61[_0x46c8('0xe')][_0x46c8('0xf')]===0x1f4){logger[_0x46c8('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x13bf93,_0x561c61['error']['message']);return _0x1727f4(_0x561c61[_0x46c8('0xe')]['message']);}logger[_0x46c8('0xe')](_0x46c8('0x10'),_0x13bf93,_0x561c61[_0x46c8('0xe')][_0x46c8('0x11')]);return _0xfe26c8(_0x561c61[_0x46c8('0xe')]['message']);}else{logger[_0x46c8('0x12')](_0x46c8('0x10'),_0x13bf93,'request\x20sent');_0xfe26c8(_0x561c61[_0x46c8('0x13')][_0x46c8('0x11')]);}})['catch'](function(_0x488eb5){logger[_0x46c8('0xe')](_0x46c8('0x10'),_0x13bf93,_0x488eb5);_0x1727f4(_0x488eb5);});});} \ No newline at end of file +var _0xeb5d=['then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xeb5d[_0x1cc8fe];return _0x230054;};'use strict';var _=require('lodash');var util=require(_0xdeb5('0x0'));var moment=require(_0xdeb5('0x1'));var BPromise=require(_0xdeb5('0x2'));var rs=require(_0xdeb5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdeb5('0x4'));var logger=require(_0xdeb5('0x5'))('rpc');var config=require(_0xdeb5('0x6'));var jayson=require(_0xdeb5('0x7'));var client=jayson[_0xdeb5('0x8')][_0xdeb5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x120329,_0x12484b,_0x328d6b){return new BPromise(function(_0x35c086,_0x2c8509){return client[_0xdeb5('0xa')](_0x120329,_0x328d6b)[_0xdeb5('0xb')](function(_0x2114ba){logger[_0xdeb5('0xc')](_0xdeb5('0xd'),_0x12484b,_0xdeb5('0xe'));logger[_0xdeb5('0xf')](_0xdeb5('0x10'),_0x12484b,'request\x20sent',JSON[_0xdeb5('0x11')](_0x2114ba));if(_0x2114ba[_0xdeb5('0x12')]){if(_0x2114ba[_0xdeb5('0x12')][_0xdeb5('0x13')]===0x1f4){logger[_0xdeb5('0x12')](_0xdeb5('0xd'),_0x12484b,_0x2114ba[_0xdeb5('0x12')][_0xdeb5('0x14')]);return _0x2c8509(_0x2114ba['error'][_0xdeb5('0x14')]);}logger['error'](_0xdeb5('0xd'),_0x12484b,_0x2114ba[_0xdeb5('0x12')][_0xdeb5('0x14')]);return _0x35c086(_0x2114ba[_0xdeb5('0x12')][_0xdeb5('0x14')]);}else{logger['info'](_0xdeb5('0xd'),_0x12484b,_0xdeb5('0xe'));_0x35c086(_0x2114ba['result'][_0xdeb5('0x14')]);}})[_0xdeb5('0x15')](function(_0x3521b2){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x12484b,_0x3521b2);_0x2c8509(_0x3521b2);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 5849bf1..bddaee4 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 _0x662a=['file','create','put','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','single'];(function(_0x58c594,_0x2fb1f7){var _0x4b0096=function(_0xd27733){while(--_0xd27733){_0x58c594['push'](_0x58c594['shift']());}};_0x4b0096(++_0x2fb1f7);}(_0x662a,0x12e));var _0xa662=function(_0x4dcfd4,_0xc2f4c3){_0x4dcfd4=_0x4dcfd4-0x0;var _0x55a84e=_0x662a[_0x4dcfd4];return _0x55a84e;};'use strict';var multer=require(_0xa662('0x0'));var util=require(_0xa662('0x1'));var path=require(_0xa662('0x2'));var timeout=require(_0xa662('0x3'));var express=require(_0xa662('0x4'));var router=express['Router']();var fs_extra=require(_0xa662('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa662('0x6'));var config=require(_0xa662('0x7'));var controller=require('./sound.controller');router[_0xa662('0x8')]('/',auth[_0xa662('0x9')](),controller[_0xa662('0xa')]);router['get'](_0xa662('0xb'),auth[_0xa662('0x9')](),controller[_0xa662('0xc')]);router['get'](_0xa662('0xd'),auth[_0xa662('0x9')](),controller[_0xa662('0xe')]);var upload=multer({'storage':multer[_0xa662('0xf')]({'destination':function(_0x3e16eb,_0x3affc6,_0x5e77ec){_0x5e77ec(null,path[_0xa662('0x10')](config[_0xa662('0x11')],_0xa662('0x12')));},'filename':function(_0x1f9524,_0x45aa73,_0x5a859c){_0x45aa73[_0xa662('0x13')]=_0x45aa73[_0xa662('0x13')][_0xa662('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5a859c(null,util[_0xa662('0x15')](_0xa662('0x16'),path[_0xa662('0x17')](_0x45aa73[_0xa662('0x13')],path[_0xa662('0x18')](_0x45aa73[_0xa662('0x13')])),Date[_0xa662('0x19')](),path[_0xa662('0x18')](_0x45aa73[_0xa662('0x13')])));}})});router[_0xa662('0x1a')]('/',upload[_0xa662('0x1b')](_0xa662('0x1c')),controller[_0xa662('0x1d')]);router[_0xa662('0x1e')](_0xa662('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xa662('0x1f')](_0xa662('0xb'),auth[_0xa662('0x9')](),controller['delete']);module[_0xa662('0x20')]=router; \ No newline at end of file +var _0xc94e=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','get','/:id/download','diskStorage','join','root','originalname','%s-%s%s','basename','extname','now','single','file','create','/:id','update','delete'];(function(_0x52bd82,_0x1d70a2){var _0x35135e=function(_0x27b907){while(--_0x27b907){_0x52bd82['push'](_0x52bd82['shift']());}};_0x35135e(++_0x1d70a2);}(_0xc94e,0x196));var _0xec94=function(_0x37fb9d,_0x3f92d6){_0x37fb9d=_0x37fb9d-0x0;var _0x13ed7f=_0xc94e[_0x37fb9d];return _0x13ed7f;};'use strict';var multer=require(_0xec94('0x0'));var util=require(_0xec94('0x1'));var path=require(_0xec94('0x2'));var timeout=require('connect-timeout');var express=require(_0xec94('0x3'));var router=express[_0xec94('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xec94('0x5'));var interaction=require(_0xec94('0x6'));var config=require(_0xec94('0x7'));var controller=require(_0xec94('0x8'));router['get']('/',auth[_0xec94('0x9')](),controller['index']);router[_0xec94('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xec94('0xb'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0xec94('0xc')]({'destination':function(_0xc5ecaf,_0x3231bc,_0x45c0e5){_0x45c0e5(null,path[_0xec94('0xd')](config[_0xec94('0xe')],'server/files/sounds/original/'));},'filename':function(_0x50febb,_0x21e34c,_0x364ec1){_0x21e34c[_0xec94('0xf')]=_0x21e34c[_0xec94('0xf')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x364ec1(null,util['format'](_0xec94('0x10'),path[_0xec94('0x11')](_0x21e34c[_0xec94('0xf')],path[_0xec94('0x12')](_0x21e34c[_0xec94('0xf')])),Date[_0xec94('0x13')](),path[_0xec94('0x12')](_0x21e34c[_0xec94('0xf')])));}})});router['post']('/',upload[_0xec94('0x14')](_0xec94('0x15')),controller[_0xec94('0x16')]);router['put'](_0xec94('0x17'),auth['isAuthenticated'](),controller[_0xec94('0x18')]);router[_0xec94('0x19')](_0xec94('0x17'),auth['isAuthenticated'](),controller[_0xec94('0x19')]);module[_0xec94('0x1a')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index d4770e5..df1096f 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 _0x0892=['INTEGER','sequelize','exports','name','STRING','BIGINT'];(function(_0x35f0d1,_0x45d762){var _0x56a167=function(_0x2223b9){while(--_0x2223b9){_0x35f0d1['push'](_0x35f0d1['shift']());}};_0x56a167(++_0x45d762);}(_0x0892,0x79));var _0x2089=function(_0x42e07b,_0x1ff692){_0x42e07b=_0x42e07b-0x0;var _0x159786=_0x0892[_0x42e07b];return _0x159786;};'use strict';var Sequelize=require(_0x2089('0x0'));module[_0x2089('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2089('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x2089('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0x2089('0x3')]},'original_format':{'type':Sequelize[_0x2089('0x3')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x2089('0x4')]},'original_channelCount':{'type':Sequelize[_0x2089('0x5')]},'original_bitRate':{'type':Sequelize[_0x2089('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x2089('0x3')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x2089('0x4')]},'converted_channelCount':{'type':Sequelize[_0x2089('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x2089('0x5')]}}; \ No newline at end of file +var _0x9b51=['name','INTEGER','BIGINT','sequelize','exports','STRING'];(function(_0x409830,_0x34b582){var _0xe04484=function(_0x1d573c){while(--_0x1d573c){_0x409830['push'](_0x409830['shift']());}};_0xe04484(++_0x34b582);}(_0x9b51,0x1d7));var _0x19b5=function(_0x1e486a,_0x10047e){_0x1e486a=_0x1e486a-0x0;var _0x22d8ca=_0x9b51[_0x1e486a];return _0x22d8ca;};'use strict';var Sequelize=require(_0x19b5('0x0'));module[_0x19b5('0x1')]={'name':{'type':Sequelize[_0x19b5('0x2')],'unique':_0x19b5('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x19b5('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x19b5('0x2')]},'original_format':{'type':Sequelize[_0x19b5('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x19b5('0x4')]},'original_bitRate':{'type':Sequelize[_0x19b5('0x5')]},'original_sampleRate':{'type':Sequelize[_0x19b5('0x4')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x19b5('0x5')]},'converted_channelCount':{'type':Sequelize[_0x19b5('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x19b5('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 57d621d..921a757 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 _0x7612=['limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Sounds','UserProfileResource','sendStatus','error','stack','name','send','map','Sound','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','hasOwnProperty','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','download','save_name','converted_format','join','root','server/files/sounds/converted','Sequelize','Sound\x20not\x20found','format','%s.%s','create','basename','extname','file','originalname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','original_duration','duration','sampleCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','role','body','userProfileId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined'];(function(_0x4fc3d5,_0x546ee5){var _0x6e3676=function(_0x5a642a){while(--_0x5a642a){_0x4fc3d5['push'](_0x4fc3d5['shift']());}};_0x6e3676(++_0x546ee5);}(_0x7612,0x1ce));var _0x2761=function(_0x1d9163,_0x79567d){_0x1d9163=_0x1d9163-0x0;var _0xb42197=_0x7612[_0x1d9163];return _0xb42197;};'use strict';var emlformat=require(_0x2761('0x0'));var rimraf=require(_0x2761('0x1'));var zipdir=require(_0x2761('0x2'));var jsonpatch=require(_0x2761('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2761('0x4'));var Mustache=require('mustache');var util=require(_0x2761('0x5'));var path=require(_0x2761('0x6'));var sox=require('sox');var csv=require(_0x2761('0x7'));var ejs=require(_0x2761('0x8'));var fs=require('fs');var fs_extra=require(_0x2761('0x9'));var _=require(_0x2761('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2761('0xb'));var deskjs=require(_0x2761('0xc'));var toCsv=require(_0x2761('0x7'));var querystring=require('querystring');var Papa=require(_0x2761('0xd'));var Redis=require('ioredis');var authService=require(_0x2761('0xe'));var qs=require(_0x2761('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2761('0x10'));var logger=require(_0x2761('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x2761('0x12'));var licenseUtil=require(_0x2761('0x13'));var db=require(_0x2761('0x14'))['db'];function respondWithStatusCode(_0x30aed4,_0x2b87c2){_0x2b87c2=_0x2b87c2||0xcc;return function(_0x47a054){if(_0x47a054){return _0x30aed4['sendStatus'](_0x2b87c2);}return _0x30aed4[_0x2761('0x15')](_0x2b87c2)[_0x2761('0x16')]();};}function respondWithResult(_0x4cbc2b,_0x3b0382){_0x3b0382=_0x3b0382||0xc8;return function(_0x4d656e){if(_0x4d656e){return _0x4cbc2b[_0x2761('0x15')](_0x3b0382)[_0x2761('0x17')](_0x4d656e);}};}function respondWithFilteredResult(_0x564f01,_0x4ea379){return function(_0x509aa6){if(_0x509aa6){var _0x318cf9=typeof _0x4ea379[_0x2761('0x18')]===_0x2761('0x19')&&typeof _0x4ea379[_0x2761('0x1a')]===_0x2761('0x19');var _0x52fdd5=_0x509aa6[_0x2761('0x1b')];var _0x325d29=_0x318cf9?0x0:_0x4ea379['offset'];var _0xd5c5ad=_0x318cf9?_0x509aa6['count']:_0x4ea379[_0x2761('0x18')]+_0x4ea379[_0x2761('0x1a')];var _0x3337b1;if(_0xd5c5ad>=_0x52fdd5){_0xd5c5ad=_0x52fdd5;_0x3337b1=0xc8;}else{_0x3337b1=0xce;}_0x564f01[_0x2761('0x15')](_0x3337b1);return _0x564f01[_0x2761('0x1c')](_0x2761('0x1d'),_0x325d29+'-'+_0xd5c5ad+'/'+_0x52fdd5)['json'](_0x509aa6);}return null;};}function patchUpdates(_0x868fc8){return function(_0x2187de){try{jsonpatch[_0x2761('0x1e')](_0x2187de,_0x868fc8,!![]);}catch(_0x3bf5d7){return BPromise[_0x2761('0x1f')](_0x3bf5d7);}return _0x2187de['save']();};}function saveUpdates(_0x4e39b4,_0xb0dabe){return function(_0x5eb83b){if(_0x5eb83b){return _0x5eb83b[_0x2761('0x20')](_0x4e39b4)[_0x2761('0x21')](function(_0x3e9373){return _0x3e9373;});}return null;};}function removeEntity(_0x58bb71,_0x23f32d){return function(_0x176445){if(_0x176445){return _0x176445[_0x2761('0x22')]()[_0x2761('0x21')](function(){var _0x20e8e9=_0x176445[_0x2761('0x23')]({'plain':!![]});var _0x252157=_0x2761('0x24');return db[_0x2761('0x25')][_0x2761('0x22')]({'where':{'type':_0x252157,'resourceId':_0x20e8e9['id']}})[_0x2761('0x21')](function(){return _0x176445;});})[_0x2761('0x21')](function(){_0x58bb71['status'](0xcc)[_0x2761('0x16')]();});}};}function handleEntityNotFound(_0x3ff358,_0x36a03c){return function(_0x5d32c8){if(!_0x5d32c8){_0x3ff358[_0x2761('0x26')](0x194);}return _0x5d32c8;};}function handleError(_0x3b7ba4,_0x477b94){_0x477b94=_0x477b94||0x1f4;return function(_0x140383){logger[_0x2761('0x27')](_0x140383[_0x2761('0x28')]);if(_0x140383['name']){delete _0x140383[_0x2761('0x29')];}_0x3b7ba4[_0x2761('0x15')](_0x477b94)[_0x2761('0x2a')](_0x140383);};}exports['index']=function(_0x5bdb6f,_0x443831){var _0x583249={},_0x4d124={},_0x16ccc4={'count':0x0,'rows':[]};var _0x342b49=_[_0x2761('0x2b')](db[_0x2761('0x2c')][_0x2761('0x2d')],function(_0x1eb13f){return{'name':_0x1eb13f[_0x2761('0x2e')],'type':_0x1eb13f[_0x2761('0x2f')][_0x2761('0x30')]};});_0x4d124[_0x2761('0x31')]=_[_0x2761('0x2b')](_0x342b49,'name');_0x4d124[_0x2761('0x32')]=_['keys'](_0x5bdb6f[_0x2761('0x32')]);_0x4d124['filters']=_['intersection'](_0x4d124[_0x2761('0x31')],_0x4d124[_0x2761('0x32')]);_0x583249[_0x2761('0x33')]=_[_0x2761('0x34')](_0x4d124[_0x2761('0x31')],qs[_0x2761('0x35')](_0x5bdb6f['query'][_0x2761('0x35')]));_0x583249[_0x2761('0x33')]=_0x583249[_0x2761('0x33')]['length']?_0x583249[_0x2761('0x33')]:_0x4d124[_0x2761('0x31')];if(!_0x5bdb6f[_0x2761('0x32')][_0x2761('0x36')]('nolimit')){_0x583249[_0x2761('0x1a')]=qs[_0x2761('0x1a')](_0x5bdb6f[_0x2761('0x32')][_0x2761('0x1a')]);_0x583249[_0x2761('0x18')]=qs[_0x2761('0x18')](_0x5bdb6f['query'][_0x2761('0x18')]);}_0x583249[_0x2761('0x37')]=qs[_0x2761('0x38')](_0x5bdb6f['query'][_0x2761('0x38')]);_0x583249['where']=qs[_0x2761('0x39')](_[_0x2761('0x3a')](_0x5bdb6f[_0x2761('0x32')],_0x4d124[_0x2761('0x39')]),_0x342b49);if(_0x5bdb6f['query'][_0x2761('0x3b')]){_0x583249['where']=_[_0x2761('0x3c')](_0x583249[_0x2761('0x3d')],{'$or':_['map'](_0x342b49,function(_0x1978b9){if(_0x1978b9['type']!==_0x2761('0x3e')){var _0x156110={};_0x156110[_0x1978b9[_0x2761('0x29')]]={'$like':'%'+_0x5bdb6f['query'][_0x2761('0x3b')]+'%'};return _0x156110;}})});}_0x583249=_[_0x2761('0x3c')]({},_0x583249,_0x5bdb6f[_0x2761('0x3f')]);var _0x5007ed={'where':_0x583249[_0x2761('0x3d')]};return db[_0x2761('0x2c')][_0x2761('0x1b')](_0x5007ed)[_0x2761('0x21')](function(_0x36cdd9){_0x16ccc4['count']=_0x36cdd9;if(_0x5bdb6f['query'][_0x2761('0x40')]){_0x583249[_0x2761('0x41')]=[{'all':!![]}];}return db[_0x2761('0x2c')][_0x2761('0x42')](_0x583249);})[_0x2761('0x21')](function(_0x1bfa4d){_0x16ccc4[_0x2761('0x43')]=_0x1bfa4d;return _0x16ccc4;})['then'](respondWithFilteredResult(_0x443831,_0x583249))[_0x2761('0x44')](handleError(_0x443831,null));};exports[_0x2761('0x45')]=function(_0xfd8118,_0x3892ba){var _0x2f4599={'raw':!![],'where':{'id':_0xfd8118[_0x2761('0x46')]['id']}},_0x5e840e={};_0x5e840e[_0x2761('0x31')]=_[_0x2761('0x47')](db[_0x2761('0x2c')]['rawAttributes']);_0x5e840e['query']=_[_0x2761('0x47')](_0xfd8118['query']);_0x5e840e[_0x2761('0x39')]=_[_0x2761('0x34')](_0x5e840e[_0x2761('0x31')],_0x5e840e[_0x2761('0x32')]);_0x2f4599[_0x2761('0x33')]=_[_0x2761('0x34')](_0x5e840e[_0x2761('0x31')],qs[_0x2761('0x35')](_0xfd8118[_0x2761('0x32')][_0x2761('0x35')]));_0x2f4599[_0x2761('0x33')]=_0x2f4599[_0x2761('0x33')][_0x2761('0x48')]?_0x2f4599[_0x2761('0x33')]:_0x5e840e[_0x2761('0x31')];if(_0xfd8118[_0x2761('0x32')][_0x2761('0x40')]){_0x2f4599['include']=[{'all':!![]}];}_0x2f4599=_['merge']({},_0x2f4599,_0xfd8118[_0x2761('0x3f')]);return db['Sound'][_0x2761('0x49')](_0x2f4599)[_0x2761('0x21')](handleEntityNotFound(_0x3892ba,null))[_0x2761('0x21')](respondWithResult(_0x3892ba,null))[_0x2761('0x44')](handleError(_0x3892ba,null));};exports[_0x2761('0x4a')]=function(_0x4f8588,_0xc4b71a,_0x525454){return db[_0x2761('0x2c')][_0x2761('0x49')]({'where':{'id':_0x4f8588[_0x2761('0x46')]['id']},'attributes':[_0x2761('0x29'),_0x2761('0x4b'),_0x2761('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0xc4b71a,null))[_0x2761('0x21')](function(_0x21c5c6){if(_0x21c5c6){if(!fs['existsSync'](path[_0x2761('0x4d')](config[_0x2761('0x4e')],_0x2761('0x4f'),_0x21c5c6['save_name']+'.'+_0x21c5c6[_0x2761('0x4c')]))){throw new db[(_0x2761('0x50'))]['ValidationError'](_0x2761('0x51'));}return _0xc4b71a[_0x2761('0x4a')](path[_0x2761('0x4d')](config['root'],'server/files/sounds/converted',util[_0x2761('0x52')](_0x2761('0x53'),_0x21c5c6[_0x2761('0x4b')],_0x21c5c6[_0x2761('0x4c')])),util[_0x2761('0x52')]('%s.%s',_0x21c5c6[_0x2761('0x29')],_0x21c5c6[_0x2761('0x4c')]));}return null;})[_0x2761('0x44')](handleError(_0xc4b71a,null));};exports[_0x2761('0x54')]=function(_0x389073,_0x13ef79,_0x343dcc){var _0x400c74={'name':path[_0x2761('0x55')](_0x389073['file']['originalname'],path[_0x2761('0x56')](_0x389073[_0x2761('0x57')][_0x2761('0x58')])),'save_name':path[_0x2761('0x55')](_0x389073['file'][_0x2761('0x59')],path[_0x2761('0x56')](_0x389073['file'][_0x2761('0x59')])),'original_format':path[_0x2761('0x56')](_0x389073[_0x2761('0x57')][_0x2761('0x58')])[_0x2761('0x5a')](0x1),'converted_format':_0x2761('0x5b')};var _0x21272f=path['join'](config[_0x2761('0x4e')],_0x2761('0x5c'),_0x389073[_0x2761('0x57')][_0x2761('0x59')]);var _0x2c6262=path[_0x2761('0x4d')](config['root'],_0x2761('0x4f'),util[_0x2761('0x52')](_0x2761('0x53'),path['basename'](_0x389073[_0x2761('0x57')][_0x2761('0x59')],path['extname'](_0x389073[_0x2761('0x57')]['filename'])),_0x400c74[_0x2761('0x4c')]));logger[_0x2761('0x5d')]('Sound\x20upload\x20filepath:\x20%s',_0x21272f);logger[_0x2761('0x5d')](_0x2761('0x5e'),_0x2c6262);try{fs[_0x2761('0x5f')](_0x21272f,parseInt(_0x2761('0x60'),0x8));var _0x4825ae=sox[_0x2761('0x61')](_0x21272f,_0x2c6262,{'sampleRate':0x1f40,'format':_0x2761('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4825ae['on'](_0x2761('0x27'),function(_0x3a6d4d){fs[_0x2761('0x62')](_0x21272f);_0x13ef79[_0x2761('0x15')](0x1f4)['send'](_0x3a6d4d);});_0x4825ae['on']('src',function(_0x33ef8d){_0x400c74[_0x2761('0x63')]=isNaN(_0x33ef8d[_0x2761('0x64')])?null:_0x33ef8d[_0x2761('0x64')]*0x3e8;_0x400c74['original_sampleCount']=isNaN(_0x33ef8d[_0x2761('0x65')])?null:_0x33ef8d[_0x2761('0x65')];_0x400c74['original_channelCount']=isNaN(_0x33ef8d['channelCount'])?null:_0x33ef8d[_0x2761('0x66')];_0x400c74['original_bitRate']=isNaN(_0x33ef8d[_0x2761('0x67')])?null:_0x33ef8d['bitRate'];_0x400c74[_0x2761('0x68')]=isNaN(_0x33ef8d[_0x2761('0x69')])?null:_0x33ef8d[_0x2761('0x69')];});_0x4825ae['on'](_0x2761('0x6a'),function(_0x505415){_0x400c74[_0x2761('0x6b')]=isNaN(_0x505415[_0x2761('0x64')])?null:_0x505415['duration']*0x3e8;_0x400c74[_0x2761('0x6c')]=isNaN(_0x505415[_0x2761('0x65')])?null:_0x505415[_0x2761('0x65')];_0x400c74[_0x2761('0x6d')]=isNaN(_0x505415[_0x2761('0x66')])?null:_0x505415['channelCount'];_0x400c74[_0x2761('0x6e')]=isNaN(_0x505415[_0x2761('0x67')])?null:_0x505415[_0x2761('0x67')];_0x400c74[_0x2761('0x6f')]=isNaN(_0x505415[_0x2761('0x69')])?null:_0x505415['sampleRate'];});_0x4825ae['on'](_0x2761('0x16'),function(){fs[_0x2761('0x5f')](_0x2c6262,parseInt(_0x2761('0x60'),0x8));return db[_0x2761('0x2c')][_0x2761('0x54')](_0x400c74)[_0x2761('0x21')](function(_0x4f0442){var _0xe2d73e={'role':_0x389073['body'][_0x2761('0x70')],'userProfileId':_0x389073[_0x2761('0x71')][_0x2761('0x72')]};if(!_0xe2d73e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe2d73e[_0x2761('0x70')]===_0x2761('0x73')){var _0x5dd721=_0x4f0442[_0x2761('0x23')]({'plain':!![]});return db[_0x2761('0x74')][_0x2761('0x49')]({'where':{'name':_0x2761('0x24'),'userProfileId':_0xe2d73e[_0x2761('0x72')]},'raw':!![]})[_0x2761('0x21')](function(_0x341288){if(_0x341288&&_0x341288[_0x2761('0x75')]===0x0){return db[_0x2761('0x25')]['create']({'name':_0x5dd721['name'],'resourceId':_0x5dd721['id'],'type':_0x341288[_0x2761('0x29')],'sectionId':_0x341288['id']},{})[_0x2761('0x21')](function(){return _0x4f0442;});}else{return _0x4f0442;}})[_0x2761('0x44')](function(_0x3fbd1f){logger['error'](_0x2761('0x76'),_0x3fbd1f);throw _0x3fbd1f;});}return _0x4f0442;})[_0x2761('0x21')](respondWithResult(_0x13ef79,null))[_0x2761('0x44')](handleError(_0x13ef79,null));});_0x4825ae[_0x2761('0x77')]();}catch(_0x3c261d){_0x13ef79[_0x2761('0x15')](0x1f4)[_0x2761('0x2a')](_0x3c261d);}};exports['update']=function(_0x12bb36,_0x5e49e2,_0x5df222){return db[_0x2761('0x2c')][_0x2761('0x49')]({'where':{'id':_0x12bb36[_0x2761('0x46')]['id']}})[_0x2761('0x21')](handleEntityNotFound(_0x5e49e2,null))[_0x2761('0x21')](saveUpdates(_[_0x2761('0x3a')](_0x12bb36['body'],[_0x2761('0x29'),_0x2761('0x78')]),null))[_0x2761('0x21')](respondWithResult(_0x5e49e2,null))[_0x2761('0x44')](handleError(_0x5e49e2,null));};exports[_0x2761('0x79')]=function(_0x3a9b69,_0x1e6a1e,_0x32bfd2){return db[_0x2761('0x2c')]['find']({'where':{'id':_0x3a9b69['params']['id']}})[_0x2761('0x21')](function(_0x1241ae){if(_0x1241ae){return _0x1241ae['destroy']();}})[_0x2761('0x21')](function(_0x8ffaaa){var _0x3b480c=path[_0x2761('0x4d')](config[_0x2761('0x4e')],_0x2761('0x5c'),util['format']('%s.%s',_0x8ffaaa['save_name'],_0x8ffaaa['original_format']));var _0x4f91d6=path[_0x2761('0x4d')](config[_0x2761('0x4e')],_0x2761('0x4f'),util[_0x2761('0x52')]('%s.%s',_0x8ffaaa['save_name'],_0x8ffaaa[_0x2761('0x4c')]));fs['unlinkSync'](_0x3b480c);fs['unlinkSync'](_0x4f91d6);return _0x8ffaaa;})[_0x2761('0x21')](function(_0x3bef5a){if(_0x3bef5a){return _0x1e6a1e['status'](0xcc)[_0x2761('0x16')]();}})[_0x2761('0x21')](handleEntityNotFound(_0x1e6a1e,null))[_0x2761('0x44')](handleError(_0x1e6a1e,null));}; \ No newline at end of file +var _0x327c=['undefined','count','set','Content-Range','apply','reject','then','get','Sounds','UserProfileResource','sendStatus','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','where','pick','filter','merge','type','VIRTUAL','options','Sound','includeAll','include','catch','params','length','download','find','save_name','existsSync','join','root','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','create','basename','file','originalname','extname','filename','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','sampleRate','converted_sampleCount','converted_channelCount','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','start','update','description','delete','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','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','end','json','offset','limit'];(function(_0x506996,_0x375344){var _0xc74569=function(_0x1ac244){while(--_0x1ac244){_0x506996['push'](_0x506996['shift']());}};_0xc74569(++_0x375344);}(_0x327c,0x1d2));var _0xc327=function(_0x3dd457,_0x5a04b5){_0x3dd457=_0x3dd457-0x0;var _0x2b5698=_0x327c[_0x3dd457];return _0x2b5698;};'use strict';var emlformat=require(_0xc327('0x0'));var rimraf=require(_0xc327('0x1'));var zipdir=require(_0xc327('0x2'));var jsonpatch=require(_0xc327('0x3'));var rp=require(_0xc327('0x4'));var moment=require(_0xc327('0x5'));var BPromise=require(_0xc327('0x6'));var Mustache=require('mustache');var util=require(_0xc327('0x7'));var path=require(_0xc327('0x8'));var sox=require(_0xc327('0x9'));var csv=require(_0xc327('0xa'));var ejs=require(_0xc327('0xb'));var fs=require('fs');var fs_extra=require(_0xc327('0xc'));var _=require('lodash');var squel=require(_0xc327('0xd'));var crypto=require(_0xc327('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc327('0xf'));var toCsv=require(_0xc327('0xa'));var querystring=require(_0xc327('0x10'));var Papa=require(_0xc327('0x11'));var Redis=require(_0xc327('0x12'));var authService=require(_0xc327('0x13'));var qs=require(_0xc327('0x14'));var as=require(_0xc327('0x15'));var hardwareService=require(_0xc327('0x16'));var logger=require(_0xc327('0x17'))(_0xc327('0x18'));var utils=require(_0xc327('0x19'));var config=require(_0xc327('0x1a'));var licenseUtil=require(_0xc327('0x1b'));var db=require(_0xc327('0x1c'))['db'];function respondWithStatusCode(_0x40e6ad,_0xf3cfd9){_0xf3cfd9=_0xf3cfd9||0xcc;return function(_0x518113){if(_0x518113){return _0x40e6ad['sendStatus'](_0xf3cfd9);}return _0x40e6ad[_0xc327('0x1d')](_0xf3cfd9)[_0xc327('0x1e')]();};}function respondWithResult(_0x2a09b4,_0x73c284){_0x73c284=_0x73c284||0xc8;return function(_0x4b02bc){if(_0x4b02bc){return _0x2a09b4['status'](_0x73c284)[_0xc327('0x1f')](_0x4b02bc);}};}function respondWithFilteredResult(_0x633a9,_0xe778b5){return function(_0x58bd9f){if(_0x58bd9f){var _0x482e36=typeof _0xe778b5[_0xc327('0x20')]==='undefined'&&typeof _0xe778b5[_0xc327('0x21')]===_0xc327('0x22');var _0x29291d=_0x58bd9f[_0xc327('0x23')];var _0xf971ba=_0x482e36?0x0:_0xe778b5['offset'];var _0x3ee587=_0x482e36?_0x58bd9f[_0xc327('0x23')]:_0xe778b5[_0xc327('0x20')]+_0xe778b5[_0xc327('0x21')];var _0x171804;if(_0x3ee587>=_0x29291d){_0x3ee587=_0x29291d;_0x171804=0xc8;}else{_0x171804=0xce;}_0x633a9['status'](_0x171804);return _0x633a9[_0xc327('0x24')](_0xc327('0x25'),_0xf971ba+'-'+_0x3ee587+'/'+_0x29291d)[_0xc327('0x1f')](_0x58bd9f);}return null;};}function patchUpdates(_0xafb74e){return function(_0x5bbd81){try{jsonpatch[_0xc327('0x26')](_0x5bbd81,_0xafb74e,!![]);}catch(_0x3bc4ac){return BPromise[_0xc327('0x27')](_0x3bc4ac);}return _0x5bbd81['save']();};}function saveUpdates(_0x24fcc4,_0x113138){return function(_0x304e5c){if(_0x304e5c){return _0x304e5c['update'](_0x24fcc4)[_0xc327('0x28')](function(_0x1ed99a){return _0x1ed99a;});}return null;};}function removeEntity(_0x3652ea,_0xd3c6e9){return function(_0x218c67){if(_0x218c67){return _0x218c67['destroy']()[_0xc327('0x28')](function(){var _0x16ac0f=_0x218c67[_0xc327('0x29')]({'plain':!![]});var _0x249e6a=_0xc327('0x2a');return db[_0xc327('0x2b')]['destroy']({'where':{'type':_0x249e6a,'resourceId':_0x16ac0f['id']}})['then'](function(){return _0x218c67;});})[_0xc327('0x28')](function(){_0x3652ea[_0xc327('0x1d')](0xcc)[_0xc327('0x1e')]();});}};}function handleEntityNotFound(_0x5e5a5e,_0x42aa5b){return function(_0x223727){if(!_0x223727){_0x5e5a5e[_0xc327('0x2c')](0x194);}return _0x223727;};}function handleError(_0x5592fb,_0x1a9e00){_0x1a9e00=_0x1a9e00||0x1f4;return function(_0x15da0e){logger[_0xc327('0x2d')](_0x15da0e[_0xc327('0x2e')]);if(_0x15da0e[_0xc327('0x2f')]){delete _0x15da0e['name'];}_0x5592fb[_0xc327('0x1d')](_0x1a9e00)[_0xc327('0x30')](_0x15da0e);};}exports['index']=function(_0x362287,_0x2096e7){var _0x39c459={},_0x33885={},_0x2c5411={'count':0x0,'rows':[]};var _0x404960=_['map'](db['Sound'][_0xc327('0x31')],function(_0x756fbe){return{'name':_0x756fbe[_0xc327('0x32')],'type':_0x756fbe['type'][_0xc327('0x33')]};});_0x33885[_0xc327('0x34')]=_[_0xc327('0x35')](_0x404960,_0xc327('0x2f'));_0x33885[_0xc327('0x36')]=_[_0xc327('0x37')](_0x362287['query']);_0x33885[_0xc327('0x38')]=_[_0xc327('0x39')](_0x33885[_0xc327('0x34')],_0x33885[_0xc327('0x36')]);_0x39c459[_0xc327('0x3a')]=_['intersection'](_0x33885[_0xc327('0x34')],qs[_0xc327('0x3b')](_0x362287[_0xc327('0x36')][_0xc327('0x3b')]));_0x39c459[_0xc327('0x3a')]=_0x39c459[_0xc327('0x3a')]['length']?_0x39c459[_0xc327('0x3a')]:_0x33885[_0xc327('0x34')];if(!_0x362287[_0xc327('0x36')]['hasOwnProperty'](_0xc327('0x3c'))){_0x39c459[_0xc327('0x21')]=qs[_0xc327('0x21')](_0x362287['query']['limit']);_0x39c459[_0xc327('0x20')]=qs[_0xc327('0x20')](_0x362287[_0xc327('0x36')][_0xc327('0x20')]);}_0x39c459['order']=qs['sort'](_0x362287[_0xc327('0x36')]['sort']);_0x39c459[_0xc327('0x3d')]=qs[_0xc327('0x38')](_[_0xc327('0x3e')](_0x362287[_0xc327('0x36')],_0x33885[_0xc327('0x38')]),_0x404960);if(_0x362287[_0xc327('0x36')][_0xc327('0x3f')]){_0x39c459[_0xc327('0x3d')]=_[_0xc327('0x40')](_0x39c459[_0xc327('0x3d')],{'$or':_[_0xc327('0x35')](_0x404960,function(_0xca7d98){if(_0xca7d98[_0xc327('0x41')]!==_0xc327('0x42')){var _0x464b78={};_0x464b78[_0xca7d98[_0xc327('0x2f')]]={'$like':'%'+_0x362287[_0xc327('0x36')][_0xc327('0x3f')]+'%'};return _0x464b78;}})});}_0x39c459=_['merge']({},_0x39c459,_0x362287[_0xc327('0x43')]);var _0x4c2332={'where':_0x39c459['where']};return db[_0xc327('0x44')][_0xc327('0x23')](_0x4c2332)[_0xc327('0x28')](function(_0x457e56){_0x2c5411[_0xc327('0x23')]=_0x457e56;if(_0x362287[_0xc327('0x36')][_0xc327('0x45')]){_0x39c459[_0xc327('0x46')]=[{'all':!![]}];}return db[_0xc327('0x44')]['findAll'](_0x39c459);})[_0xc327('0x28')](function(_0x452c49){_0x2c5411['rows']=_0x452c49;return _0x2c5411;})[_0xc327('0x28')](respondWithFilteredResult(_0x2096e7,_0x39c459))[_0xc327('0x47')](handleError(_0x2096e7,null));};exports['show']=function(_0x5e2b05,_0x2af6bd){var _0x36c2cd={'raw':!![],'where':{'id':_0x5e2b05[_0xc327('0x48')]['id']}},_0x1ef030={};_0x1ef030[_0xc327('0x34')]=_[_0xc327('0x37')](db[_0xc327('0x44')][_0xc327('0x31')]);_0x1ef030['query']=_['keys'](_0x5e2b05['query']);_0x1ef030[_0xc327('0x38')]=_['intersection'](_0x1ef030[_0xc327('0x34')],_0x1ef030['query']);_0x36c2cd[_0xc327('0x3a')]=_[_0xc327('0x39')](_0x1ef030[_0xc327('0x34')],qs[_0xc327('0x3b')](_0x5e2b05['query']['fields']));_0x36c2cd[_0xc327('0x3a')]=_0x36c2cd['attributes'][_0xc327('0x49')]?_0x36c2cd['attributes']:_0x1ef030['model'];if(_0x5e2b05[_0xc327('0x36')]['includeAll']){_0x36c2cd[_0xc327('0x46')]=[{'all':!![]}];}_0x36c2cd=_[_0xc327('0x40')]({},_0x36c2cd,_0x5e2b05['options']);return db[_0xc327('0x44')]['find'](_0x36c2cd)[_0xc327('0x28')](handleEntityNotFound(_0x2af6bd,null))[_0xc327('0x28')](respondWithResult(_0x2af6bd,null))['catch'](handleError(_0x2af6bd,null));};exports[_0xc327('0x4a')]=function(_0x225172,_0x897fa4,_0x370de5){return db['Sound'][_0xc327('0x4b')]({'where':{'id':_0x225172['params']['id']},'attributes':[_0xc327('0x2f'),_0xc327('0x4c'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x897fa4,null))['then'](function(_0x3cfa11){if(_0x3cfa11){if(!fs[_0xc327('0x4d')](path[_0xc327('0x4e')](config[_0xc327('0x4f')],'server/files/sounds/converted',_0x3cfa11[_0xc327('0x4c')]+'.'+_0x3cfa11[_0xc327('0x50')]))){throw new db[(_0xc327('0x51'))][(_0xc327('0x52'))](_0xc327('0x53'));}return _0x897fa4['download'](path[_0xc327('0x4e')](config['root'],_0xc327('0x54'),util[_0xc327('0x55')]('%s.%s',_0x3cfa11[_0xc327('0x4c')],_0x3cfa11[_0xc327('0x50')])),util[_0xc327('0x55')](_0xc327('0x56'),_0x3cfa11[_0xc327('0x2f')],_0x3cfa11[_0xc327('0x50')]));}return null;})[_0xc327('0x47')](handleError(_0x897fa4,null));};exports[_0xc327('0x57')]=function(_0x254264,_0x36e950,_0x1e341e){var _0xe2ae0a={'name':path[_0xc327('0x58')](_0x254264[_0xc327('0x59')][_0xc327('0x5a')],path[_0xc327('0x5b')](_0x254264['file'][_0xc327('0x5a')])),'save_name':path[_0xc327('0x58')](_0x254264['file'][_0xc327('0x5c')],path[_0xc327('0x5b')](_0x254264[_0xc327('0x59')][_0xc327('0x5c')])),'original_format':path[_0xc327('0x5b')](_0x254264['file'][_0xc327('0x5a')])['substring'](0x1),'converted_format':'wav'};var _0x469e2a=path[_0xc327('0x4e')](config[_0xc327('0x4f')],_0xc327('0x5d'),_0x254264[_0xc327('0x59')][_0xc327('0x5c')]);var _0x1c5b19=path[_0xc327('0x4e')](config[_0xc327('0x4f')],'server/files/sounds/converted',util[_0xc327('0x55')](_0xc327('0x56'),path[_0xc327('0x58')](_0x254264[_0xc327('0x59')][_0xc327('0x5c')],path[_0xc327('0x5b')](_0x254264['file']['filename'])),_0xe2ae0a[_0xc327('0x50')]));logger[_0xc327('0x5e')](_0xc327('0x5f'),_0x469e2a);logger['info'](_0xc327('0x60'),_0x1c5b19);try{fs[_0xc327('0x61')](_0x469e2a,parseInt(_0xc327('0x62'),0x8));var _0x5e00eb=sox[_0xc327('0x63')](_0x469e2a,_0x1c5b19,{'sampleRate':0x1f40,'format':_0xc327('0x64'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5e00eb['on'](_0xc327('0x2d'),function(_0x35fc58){fs[_0xc327('0x65')](_0x469e2a);_0x36e950[_0xc327('0x1d')](0x1f4)[_0xc327('0x30')](_0x35fc58);});_0x5e00eb['on'](_0xc327('0x66'),function(_0x210f1d){_0xe2ae0a[_0xc327('0x67')]=isNaN(_0x210f1d['duration'])?null:_0x210f1d[_0xc327('0x68')]*0x3e8;_0xe2ae0a[_0xc327('0x69')]=isNaN(_0x210f1d[_0xc327('0x6a')])?null:_0x210f1d[_0xc327('0x6a')];_0xe2ae0a['original_channelCount']=isNaN(_0x210f1d[_0xc327('0x6b')])?null:_0x210f1d[_0xc327('0x6b')];_0xe2ae0a[_0xc327('0x6c')]=isNaN(_0x210f1d[_0xc327('0x6d')])?null:_0x210f1d[_0xc327('0x6d')];_0xe2ae0a['original_sampleRate']=isNaN(_0x210f1d[_0xc327('0x6e')])?null:_0x210f1d[_0xc327('0x6e')];});_0x5e00eb['on']('dest',function(_0x45c623){_0xe2ae0a['converted_duration']=isNaN(_0x45c623[_0xc327('0x68')])?null:_0x45c623['duration']*0x3e8;_0xe2ae0a[_0xc327('0x6f')]=isNaN(_0x45c623[_0xc327('0x6a')])?null:_0x45c623[_0xc327('0x6a')];_0xe2ae0a[_0xc327('0x70')]=isNaN(_0x45c623['channelCount'])?null:_0x45c623[_0xc327('0x6b')];_0xe2ae0a['converted_bitRate']=isNaN(_0x45c623['bitRate'])?null:_0x45c623[_0xc327('0x6d')];_0xe2ae0a[_0xc327('0x71')]=isNaN(_0x45c623['sampleRate'])?null:_0x45c623[_0xc327('0x6e')];});_0x5e00eb['on']('end',function(){fs['chmodSync'](_0x1c5b19,parseInt('0777',0x8));return db['Sound'][_0xc327('0x57')](_0xe2ae0a)[_0xc327('0x28')](function(_0x14b288){var _0x2a93c8={'role':_0x254264[_0xc327('0x72')][_0xc327('0x73')],'userProfileId':_0x254264['body'][_0xc327('0x74')]};if(!_0x2a93c8)throw new Error(_0xc327('0x75'));if(_0x2a93c8[_0xc327('0x73')]===_0xc327('0x76')){var _0x107c8d=_0x14b288['get']({'plain':!![]});return db[_0xc327('0x77')][_0xc327('0x4b')]({'where':{'name':_0xc327('0x2a'),'userProfileId':_0x2a93c8[_0xc327('0x74')]},'raw':!![]})[_0xc327('0x28')](function(_0x29f69f){if(_0x29f69f&&_0x29f69f['autoAssociation']===0x0){return db['UserProfileResource'][_0xc327('0x57')]({'name':_0x107c8d[_0xc327('0x2f')],'resourceId':_0x107c8d['id'],'type':_0x29f69f[_0xc327('0x2f')],'sectionId':_0x29f69f['id']},{})['then'](function(){return _0x14b288;});}else{return _0x14b288;}})[_0xc327('0x47')](function(_0x3c01b6){logger[_0xc327('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c01b6);throw _0x3c01b6;});}return _0x14b288;})[_0xc327('0x28')](respondWithResult(_0x36e950,null))[_0xc327('0x47')](handleError(_0x36e950,null));});_0x5e00eb[_0xc327('0x78')]();}catch(_0x5e7726){_0x36e950['status'](0x1f4)[_0xc327('0x30')](_0x5e7726);}};exports[_0xc327('0x79')]=function(_0xf6a52c,_0x5e359a,_0x1a3f9b){return db[_0xc327('0x44')][_0xc327('0x4b')]({'where':{'id':_0xf6a52c[_0xc327('0x48')]['id']}})[_0xc327('0x28')](handleEntityNotFound(_0x5e359a,null))['then'](saveUpdates(_[_0xc327('0x3e')](_0xf6a52c[_0xc327('0x72')],[_0xc327('0x2f'),_0xc327('0x7a')]),null))[_0xc327('0x28')](respondWithResult(_0x5e359a,null))[_0xc327('0x47')](handleError(_0x5e359a,null));};exports[_0xc327('0x7b')]=function(_0x6d451a,_0x11f167,_0x37c0a7){return db[_0xc327('0x44')][_0xc327('0x4b')]({'where':{'id':_0x6d451a[_0xc327('0x48')]['id']}})['then'](function(_0x407d9c){if(_0x407d9c){return _0x407d9c['destroy']();}})[_0xc327('0x28')](function(_0x14439f){var _0x2de41a=path[_0xc327('0x4e')](config[_0xc327('0x4f')],_0xc327('0x5d'),util[_0xc327('0x55')](_0xc327('0x56'),_0x14439f['save_name'],_0x14439f[_0xc327('0x7c')]));var _0x58aa05=path[_0xc327('0x4e')](config[_0xc327('0x4f')],'server/files/sounds/converted',util[_0xc327('0x55')](_0xc327('0x56'),_0x14439f[_0xc327('0x4c')],_0x14439f[_0xc327('0x50')]));fs['unlinkSync'](_0x2de41a);fs['unlinkSync'](_0x58aa05);return _0x14439f;})['then'](function(_0x3ffe08){if(_0x3ffe08){return _0x11f167[_0xc327('0x1d')](0xcc)[_0xc327('0x1e')]();}})[_0xc327('0x28')](handleEntityNotFound(_0x11f167,null))[_0xc327('0x47')](handleError(_0x11f167,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 11133b2..bf9dd9b 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 _0x528a=['Sound','tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define'];(function(_0x275080,_0x38d7ef){var _0x4defa7=function(_0x264aca){while(--_0x264aca){_0x275080['push'](_0x275080['shift']());}};_0x4defa7(++_0x38d7ef);}(_0x528a,0xc5));var _0xa528=function(_0x54e380,_0x21d2f4){_0x54e380=_0x54e380-0x0;var _0x1c9e5d=_0x528a[_0x54e380];return _0x1c9e5d;};'use strict';var _=require(_0xa528('0x0'));var util=require(_0xa528('0x1'));var logger=require(_0xa528('0x2'))(_0xa528('0x3'));var moment=require(_0xa528('0x4'));var BPromise=require(_0xa528('0x5'));var rp=require(_0xa528('0x6'));var fs=require('fs');var path=require(_0xa528('0x7'));var rimraf=require(_0xa528('0x8'));var config=require(_0xa528('0x9'));var attributes=require(_0xa528('0xa'));module[_0xa528('0xb')]=function(_0x528d87,_0x3a2865){return _0x528d87[_0xa528('0xc')](_0xa528('0xd'),attributes,{'tableName':_0xa528('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a15=['path','rimraf','./sound.attributes','exports','define','Sound','tools_sounds','lodash','../../config/logger','api','moment','request-promise'];(function(_0x539d8e,_0x4025d6){var _0x36ff10=function(_0x39e12d){while(--_0x39e12d){_0x539d8e['push'](_0x539d8e['shift']());}};_0x36ff10(++_0x4025d6);}(_0x3a15,0x1b7));var _0x53a1=function(_0x313cb5,_0x14e880){_0x313cb5=_0x313cb5-0x0;var _0x28dc82=_0x3a15[_0x313cb5];return _0x28dc82;};'use strict';var _=require(_0x53a1('0x0'));var util=require('util');var logger=require(_0x53a1('0x1'))(_0x53a1('0x2'));var moment=require(_0x53a1('0x3'));var BPromise=require('bluebird');var rp=require(_0x53a1('0x4'));var fs=require('fs');var path=require(_0x53a1('0x5'));var rimraf=require(_0x53a1('0x6'));var config=require('../../config/environment');var attributes=require(_0x53a1('0x7'));module[_0x53a1('0x8')]=function(_0x10ac1f,_0x49f1a4){return _0x10ac1f[_0x53a1('0x9')](_0x53a1('0xa'),attributes,{'tableName':_0x53a1('0xb'),'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 1f21d73..33dfd0c 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 _0xeb3e=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSound','find','options','raw','where','attributes','include','map','model','debug','lodash','util'];(function(_0x1e9d12,_0x419045){var _0x508e1a=function(_0x1ec76e){while(--_0x1ec76e){_0x1e9d12['push'](_0x1e9d12['shift']());}};_0x508e1a(++_0x419045);}(_0xeb3e,0x174));var _0xeeb3=function(_0x49bce8,_0x236695){_0x49bce8=_0x49bce8-0x0;var _0x253728=_0xeb3e[_0x49bce8];return _0x253728;};'use strict';var _=require(_0xeeb3('0x0'));var util=require(_0xeeb3('0x1'));var moment=require(_0xeeb3('0x2'));var BPromise=require(_0xeeb3('0x3'));var rs=require(_0xeeb3('0x4'));var fs=require('fs');var Redis=require(_0xeeb3('0x5'));var db=require(_0xeeb3('0x6'))['db'];var utils=require(_0xeeb3('0x7'));var logger=require(_0xeeb3('0x8'))('rpc');var config=require(_0xeeb3('0x9'));var jayson=require(_0xeeb3('0xa'));var client=jayson[_0xeeb3('0xb')][_0xeeb3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ba8a0,_0x2915ca,_0xc572b1){return new BPromise(function(_0x17112d,_0x2d169b){return client[_0xeeb3('0xd')](_0x1ba8a0,_0xc572b1)[_0xeeb3('0xe')](function(_0x472e12){logger[_0xeeb3('0xf')](_0xeeb3('0x10'),_0x2915ca,_0xeeb3('0x11'));logger['debug']('Sound,\x20%s,\x20%s,\x20%s',_0x2915ca,_0xeeb3('0x11'),JSON[_0xeeb3('0x12')](_0x472e12));if(_0x472e12[_0xeeb3('0x13')]){if(_0x472e12[_0xeeb3('0x13')][_0xeeb3('0x14')]===0x1f4){logger[_0xeeb3('0x13')](_0xeeb3('0x10'),_0x2915ca,_0x472e12['error'][_0xeeb3('0x15')]);return _0x2d169b(_0x472e12[_0xeeb3('0x13')][_0xeeb3('0x15')]);}logger['error'](_0xeeb3('0x10'),_0x2915ca,_0x472e12['error'][_0xeeb3('0x15')]);return _0x17112d(_0x472e12[_0xeeb3('0x13')][_0xeeb3('0x15')]);}else{logger[_0xeeb3('0xf')](_0xeeb3('0x10'),_0x2915ca,'request\x20sent');_0x17112d(_0x472e12[_0xeeb3('0x16')][_0xeeb3('0x15')]);}})[_0xeeb3('0x17')](function(_0x1f9e4d){logger['error'](_0xeeb3('0x10'),_0x2915ca,_0x1f9e4d);_0x2d169b(_0x1f9e4d);});});}exports[_0xeeb3('0x18')]=function(_0x59baa2){var _0x2ec1d3=this;return new Promise(function(_0x4a1030,_0x166741){return db['Sound'][_0xeeb3('0x19')]({'raw':_0x59baa2[_0xeeb3('0x1a')]?_0x59baa2[_0xeeb3('0x1a')][_0xeeb3('0x1b')]===undefined?!![]:![]:!![],'where':_0x59baa2[_0xeeb3('0x1a')]?_0x59baa2[_0xeeb3('0x1a')][_0xeeb3('0x1c')]||null:null,'attributes':_0x59baa2['options']?_0x59baa2[_0xeeb3('0x1a')][_0xeeb3('0x1d')]||null:null,'include':_0x59baa2[_0xeeb3('0x1a')]?_0x59baa2[_0xeeb3('0x1a')][_0xeeb3('0x1e')]?_[_0xeeb3('0x1f')](_0x59baa2['options'][_0xeeb3('0x1e')],function(_0x40adbc){return{'model':db[_0x40adbc['model']],'as':_0x40adbc['as'],'attributes':_0x40adbc[_0xeeb3('0x1d')],'include':_0x40adbc['include']?_[_0xeeb3('0x1f')](_0x40adbc[_0xeeb3('0x1e')],function(_0x5d0c09){return{'model':db[_0x5d0c09[_0xeeb3('0x20')]],'as':_0x5d0c09['as'],'attributes':_0x5d0c09['attributes'],'include':_0x5d0c09[_0xeeb3('0x1e')]?_[_0xeeb3('0x1f')](_0x5d0c09['include'],function(_0x241d58){return{'model':db[_0x241d58['model']],'as':_0x241d58['as'],'attributes':_0x241d58[_0xeeb3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xeeb3('0xe')](function(_0x378c47){logger[_0xeeb3('0xf')](_0xeeb3('0x18'),_0x59baa2);logger[_0xeeb3('0x21')](_0xeeb3('0x18'),_0x59baa2,JSON['stringify'](_0x378c47));_0x4a1030(_0x378c47);})['catch'](function(_0x11b478){logger[_0xeeb3('0x13')](_0xeeb3('0x18'),_0x11b478[_0xeeb3('0x15')],_0x59baa2);_0x166741(_0x2ec1d3[_0xeeb3('0x13')](0x1f4,_0x11b478[_0xeeb3('0x15')]));});});}; \ No newline at end of file +var _0x5215=['map','model','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','result','ShowSound','find','options','raw','where','attributes','include'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5215,0x1c3));var _0x5521=function(_0x23c150,_0x15281b){_0x23c150=_0x23c150-0x0;var _0x3418af=_0x5215[_0x23c150];return _0x3418af;};'use strict';var _=require('lodash');var util=require(_0x5521('0x0'));var moment=require(_0x5521('0x1'));var BPromise=require(_0x5521('0x2'));var rs=require(_0x5521('0x3'));var fs=require('fs');var Redis=require(_0x5521('0x4'));var db=require(_0x5521('0x5'))['db'];var utils=require(_0x5521('0x6'));var logger=require(_0x5521('0x7'))(_0x5521('0x8'));var config=require(_0x5521('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5521('0xa')][_0x5521('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54adbc,_0x1b3e90,_0x118087){return new BPromise(function(_0x6cc84f,_0x346e4e){return client['request'](_0x54adbc,_0x118087)[_0x5521('0xc')](function(_0x3e0752){logger[_0x5521('0xd')](_0x5521('0xe'),_0x1b3e90,_0x5521('0xf'));logger[_0x5521('0x10')](_0x5521('0x11'),_0x1b3e90,'request\x20sent',JSON['stringify'](_0x3e0752));if(_0x3e0752[_0x5521('0x12')]){if(_0x3e0752['error'][_0x5521('0x13')]===0x1f4){logger[_0x5521('0x12')](_0x5521('0xe'),_0x1b3e90,_0x3e0752[_0x5521('0x12')][_0x5521('0x14')]);return _0x346e4e(_0x3e0752['error'][_0x5521('0x14')]);}logger[_0x5521('0x12')](_0x5521('0xe'),_0x1b3e90,_0x3e0752[_0x5521('0x12')][_0x5521('0x14')]);return _0x6cc84f(_0x3e0752[_0x5521('0x12')][_0x5521('0x14')]);}else{logger[_0x5521('0xd')](_0x5521('0xe'),_0x1b3e90,'request\x20sent');_0x6cc84f(_0x3e0752[_0x5521('0x15')][_0x5521('0x14')]);}})['catch'](function(_0x57e100){logger['error'](_0x5521('0xe'),_0x1b3e90,_0x57e100);_0x346e4e(_0x57e100);});});}exports[_0x5521('0x16')]=function(_0x2eb293){var _0x223fbb=this;return new Promise(function(_0x34bb1c,_0x41dce2){return db['Sound'][_0x5521('0x17')]({'raw':_0x2eb293['options']?_0x2eb293[_0x5521('0x18')][_0x5521('0x19')]===undefined?!![]:![]:!![],'where':_0x2eb293[_0x5521('0x18')]?_0x2eb293['options'][_0x5521('0x1a')]||null:null,'attributes':_0x2eb293[_0x5521('0x18')]?_0x2eb293['options'][_0x5521('0x1b')]||null:null,'include':_0x2eb293[_0x5521('0x18')]?_0x2eb293[_0x5521('0x18')][_0x5521('0x1c')]?_[_0x5521('0x1d')](_0x2eb293[_0x5521('0x18')][_0x5521('0x1c')],function(_0x2cada0){return{'model':db[_0x2cada0[_0x5521('0x1e')]],'as':_0x2cada0['as'],'attributes':_0x2cada0[_0x5521('0x1b')],'include':_0x2cada0[_0x5521('0x1c')]?_['map'](_0x2cada0[_0x5521('0x1c')],function(_0x2101ab){return{'model':db[_0x2101ab['model']],'as':_0x2101ab['as'],'attributes':_0x2101ab[_0x5521('0x1b')],'include':_0x2101ab[_0x5521('0x1c')]?_['map'](_0x2101ab['include'],function(_0x42e12c){return{'model':db[_0x42e12c[_0x5521('0x1e')]],'as':_0x42e12c['as'],'attributes':_0x42e12c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ecc75){logger[_0x5521('0xd')]('ShowSound',_0x2eb293);logger['debug'](_0x5521('0x16'),_0x2eb293,JSON['stringify'](_0x3ecc75));_0x34bb1c(_0x3ecc75);})[_0x5521('0x1f')](function(_0x546ca1){logger['error'](_0x5521('0x16'),_0x546ca1[_0x5521('0x14')],_0x2eb293);_0x41dce2(_0x223fbb[_0x5521('0x12')](0x1f4,_0x546ca1[_0x5521('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 485d99c..5408266 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(_0x48b810,_0x173a5e){var _0x23c17d=function(_0x38531e){while(--_0x38531e){_0x48b810['push'](_0x48b810['shift']());}};_0x23c17d(++_0x173a5e);}(_0x8603,0x190));var _0x3860=function(_0x29d0d7,_0xc8a6ce){_0x29d0d7=_0x29d0d7-0x0;var _0x54fac3=_0x8603[_0x29d0d7];return _0x54fac3;};'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 _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x587a92,_0x50345c){var _0x35b0f2=function(_0x5a1357){while(--_0x5a1357){_0x587a92['push'](_0x587a92['shift']());}};_0x35b0f2(++_0x50345c);}(_0xb7e7,0x121));var _0x7b7e=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xb7e7[_0x45f951];return _0x24756c;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index a40a845..c69b8f6 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 _0x72b0=['ENUM','sequelize','STRING','TEXT'];(function(_0x9d1e6b,_0x3bdc22){var _0x2b3070=function(_0x4c4ced){while(--_0x4c4ced){_0x9d1e6b['push'](_0x9d1e6b['shift']());}};_0x2b3070(++_0x3bdc22);}(_0x72b0,0x12d));var _0x072b=function(_0x4585ee,_0x436efa){_0x4585ee=_0x4585ee-0x0;var _0x5bd642=_0x72b0[_0x4585ee];return _0x5bd642;};'use strict';var Sequelize=require(_0x072b('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x072b('0x1')]},'body':{'type':Sequelize[_0x072b('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x072b('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x072b('0x2')]}}; \ No newline at end of file +var _0xa130=['TEXT','sequelize','exports','STRING','medium','out'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xa130,0x169));var _0x0a13=function(_0x3d8b1b,_0x4bbd28){_0x3d8b1b=_0x3d8b1b-0x0;var _0x42d2c7=_0xa130[_0x3d8b1b];return _0x42d2c7;};'use strict';var Sequelize=require(_0x0a13('0x0'));module[_0x0a13('0x1')]={'uniqueid':{'type':Sequelize[_0x0a13('0x2')]},'body':{'type':Sequelize['TEXT'](_0x0a13('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x0a13('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x0a13('0x2')]},'providerResponse':{'type':Sequelize[_0x0a13('0x5')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index b44b5cf..ad7c053 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 _0xecf5=['map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','SquareMessage','includeAll','findAll','rows','catch','show','options','find','create','body','update','params','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','save','destroy','then','error','stack','name','send'];(function(_0x28b12e,_0x59f4f5){var _0x2c3bd1=function(_0x1680c1){while(--_0x1680c1){_0x28b12e['push'](_0x28b12e['shift']());}};_0x2c3bd1(++_0x59f4f5);}(_0xecf5,0x1c5));var _0x5ecf=function(_0xfc95da,_0x487638){_0xfc95da=_0xfc95da-0x0;var _0x4c840d=_0xecf5[_0xfc95da];return _0x4c840d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ecf('0x0'));var zipdir=require(_0x5ecf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5ecf('0x2'));var moment=require(_0x5ecf('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5ecf('0x4'));var sox=require(_0x5ecf('0x5'));var csv=require(_0x5ecf('0x6'));var ejs=require(_0x5ecf('0x7'));var fs=require('fs');var fs_extra=require(_0x5ecf('0x8'));var _=require(_0x5ecf('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5ecf('0xa'));var toCsv=require(_0x5ecf('0x6'));var querystring=require(_0x5ecf('0xb'));var Papa=require('papaparse');var Redis=require(_0x5ecf('0xc'));var authService=require(_0x5ecf('0xd'));var qs=require(_0x5ecf('0xe'));var as=require(_0x5ecf('0xf'));var hardwareService=require(_0x5ecf('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x5ecf('0x11'));var config=require(_0x5ecf('0x12'));var licenseUtil=require(_0x5ecf('0x13'));var db=require(_0x5ecf('0x14'))['db'];function respondWithStatusCode(_0x3d061c,_0x4a39f8){_0x4a39f8=_0x4a39f8||0xcc;return function(_0x5d576a){if(_0x5d576a){return _0x3d061c[_0x5ecf('0x15')](_0x4a39f8);}return _0x3d061c[_0x5ecf('0x16')](_0x4a39f8)[_0x5ecf('0x17')]();};}function respondWithResult(_0x5cb5db,_0x3f4692){_0x3f4692=_0x3f4692||0xc8;return function(_0x9ead61){if(_0x9ead61){return _0x5cb5db['status'](_0x3f4692)['json'](_0x9ead61);}};}function respondWithFilteredResult(_0x2c2472,_0x4bd1c3){return function(_0x13ddb6){if(_0x13ddb6){var _0x54c980=typeof _0x4bd1c3[_0x5ecf('0x18')]===_0x5ecf('0x19')&&typeof _0x4bd1c3[_0x5ecf('0x1a')]===_0x5ecf('0x19');var _0x4be5dc=_0x13ddb6[_0x5ecf('0x1b')];var _0x5723b7=_0x54c980?0x0:_0x4bd1c3['offset'];var _0x190f90=_0x54c980?_0x13ddb6[_0x5ecf('0x1b')]:_0x4bd1c3[_0x5ecf('0x18')]+_0x4bd1c3[_0x5ecf('0x1a')];var _0x2c0569;if(_0x190f90>=_0x4be5dc){_0x190f90=_0x4be5dc;_0x2c0569=0xc8;}else{_0x2c0569=0xce;}_0x2c2472[_0x5ecf('0x16')](_0x2c0569);return _0x2c2472[_0x5ecf('0x1c')]('Content-Range',_0x5723b7+'-'+_0x190f90+'/'+_0x4be5dc)['json'](_0x13ddb6);}return null;};}function patchUpdates(_0x35a74a){return function(_0x49fff9){try{jsonpatch[_0x5ecf('0x1d')](_0x49fff9,_0x35a74a,!![]);}catch(_0x22f032){return BPromise['reject'](_0x22f032);}return _0x49fff9[_0x5ecf('0x1e')]();};}function saveUpdates(_0xd8d34f,_0x3bdced){return function(_0x16cb5e){if(_0x16cb5e){return _0x16cb5e['update'](_0xd8d34f)['then'](function(_0x3feb4d){return _0x3feb4d;});}return null;};}function removeEntity(_0x4524a8,_0x16aa19){return function(_0x50fbeb){if(_0x50fbeb){return _0x50fbeb[_0x5ecf('0x1f')]()[_0x5ecf('0x20')](function(){_0x4524a8[_0x5ecf('0x16')](0xcc)[_0x5ecf('0x17')]();});}};}function handleEntityNotFound(_0x3b6390,_0x44f18d){return function(_0x15b163){if(!_0x15b163){_0x3b6390[_0x5ecf('0x15')](0x194);}return _0x15b163;};}function handleError(_0x11d12a,_0x15acbe){_0x15acbe=_0x15acbe||0x1f4;return function(_0x1786c7){logger[_0x5ecf('0x21')](_0x1786c7[_0x5ecf('0x22')]);if(_0x1786c7[_0x5ecf('0x23')]){delete _0x1786c7[_0x5ecf('0x23')];}_0x11d12a[_0x5ecf('0x16')](_0x15acbe)[_0x5ecf('0x24')](_0x1786c7);};}exports['index']=function(_0x1a2677,_0x5831f8){var _0x5d3cb9={},_0x4b752b={},_0x460bb2={'count':0x0,'rows':[]};var _0x41d9bf=_[_0x5ecf('0x25')](db['SquareMessage'][_0x5ecf('0x26')],function(_0x131531){return{'name':_0x131531[_0x5ecf('0x27')],'type':_0x131531[_0x5ecf('0x28')][_0x5ecf('0x29')]};});_0x4b752b[_0x5ecf('0x2a')]=_['map'](_0x41d9bf,_0x5ecf('0x23'));_0x4b752b[_0x5ecf('0x2b')]=_[_0x5ecf('0x2c')](_0x1a2677['query']);_0x4b752b[_0x5ecf('0x2d')]=_['intersection'](_0x4b752b['model'],_0x4b752b[_0x5ecf('0x2b')]);_0x5d3cb9[_0x5ecf('0x2e')]=_[_0x5ecf('0x2f')](_0x4b752b['model'],qs[_0x5ecf('0x30')](_0x1a2677[_0x5ecf('0x2b')]['fields']));_0x5d3cb9[_0x5ecf('0x2e')]=_0x5d3cb9[_0x5ecf('0x2e')][_0x5ecf('0x31')]?_0x5d3cb9[_0x5ecf('0x2e')]:_0x4b752b['model'];if(!_0x1a2677[_0x5ecf('0x2b')][_0x5ecf('0x32')]('nolimit')){_0x5d3cb9[_0x5ecf('0x1a')]=qs[_0x5ecf('0x1a')](_0x1a2677['query'][_0x5ecf('0x1a')]);_0x5d3cb9[_0x5ecf('0x18')]=qs['offset'](_0x1a2677[_0x5ecf('0x2b')]['offset']);}_0x5d3cb9[_0x5ecf('0x33')]=qs[_0x5ecf('0x34')](_0x1a2677['query'][_0x5ecf('0x34')]);_0x5d3cb9[_0x5ecf('0x35')]=qs[_0x5ecf('0x2d')](_[_0x5ecf('0x36')](_0x1a2677[_0x5ecf('0x2b')],_0x4b752b[_0x5ecf('0x2d')]),_0x41d9bf);if(_0x1a2677[_0x5ecf('0x2b')]['filter']){_0x5d3cb9[_0x5ecf('0x35')]=_['merge'](_0x5d3cb9[_0x5ecf('0x35')],{'$or':_[_0x5ecf('0x25')](_0x41d9bf,function(_0x12507c){if(_0x12507c[_0x5ecf('0x28')]!==_0x5ecf('0x37')){var _0x3907db={};_0x3907db[_0x12507c[_0x5ecf('0x23')]]={'$like':'%'+_0x1a2677[_0x5ecf('0x2b')][_0x5ecf('0x38')]+'%'};return _0x3907db;}})});}_0x5d3cb9=_[_0x5ecf('0x39')]({},_0x5d3cb9,_0x1a2677['options']);var _0x207f15={'where':_0x5d3cb9['where']};return db[_0x5ecf('0x3a')][_0x5ecf('0x1b')](_0x207f15)[_0x5ecf('0x20')](function(_0x5e25e8){_0x460bb2[_0x5ecf('0x1b')]=_0x5e25e8;if(_0x1a2677[_0x5ecf('0x2b')][_0x5ecf('0x3b')]){_0x5d3cb9['include']=[{'all':!![]}];}return db['SquareMessage'][_0x5ecf('0x3c')](_0x5d3cb9);})[_0x5ecf('0x20')](function(_0x2acd35){_0x460bb2[_0x5ecf('0x3d')]=_0x2acd35;return _0x460bb2;})['then'](respondWithFilteredResult(_0x5831f8,_0x5d3cb9))[_0x5ecf('0x3e')](handleError(_0x5831f8,null));};exports[_0x5ecf('0x3f')]=function(_0x1b2fe0,_0x465b65){var _0x4c4b9c={'raw':!![],'where':{'id':_0x1b2fe0['params']['id']}},_0x2c9712={};_0x2c9712['model']=_[_0x5ecf('0x2c')](db[_0x5ecf('0x3a')][_0x5ecf('0x26')]);_0x2c9712[_0x5ecf('0x2b')]=_[_0x5ecf('0x2c')](_0x1b2fe0['query']);_0x2c9712['filters']=_[_0x5ecf('0x2f')](_0x2c9712[_0x5ecf('0x2a')],_0x2c9712[_0x5ecf('0x2b')]);_0x4c4b9c[_0x5ecf('0x2e')]=_[_0x5ecf('0x2f')](_0x2c9712['model'],qs['fields'](_0x1b2fe0['query'][_0x5ecf('0x30')]));_0x4c4b9c[_0x5ecf('0x2e')]=_0x4c4b9c[_0x5ecf('0x2e')]['length']?_0x4c4b9c['attributes']:_0x2c9712[_0x5ecf('0x2a')];if(_0x1b2fe0['query'][_0x5ecf('0x3b')]){_0x4c4b9c['include']=[{'all':!![]}];}_0x4c4b9c=_[_0x5ecf('0x39')]({},_0x4c4b9c,_0x1b2fe0[_0x5ecf('0x40')]);return db[_0x5ecf('0x3a')][_0x5ecf('0x41')](_0x4c4b9c)[_0x5ecf('0x20')](handleEntityNotFound(_0x465b65,null))[_0x5ecf('0x20')](respondWithResult(_0x465b65,null))['catch'](handleError(_0x465b65,null));};exports[_0x5ecf('0x42')]=function(_0x1ecbb8,_0x23ce59){return db[_0x5ecf('0x3a')][_0x5ecf('0x42')](_0x1ecbb8[_0x5ecf('0x43')],{})[_0x5ecf('0x20')](respondWithResult(_0x23ce59,0xc9))['catch'](handleError(_0x23ce59,null));};exports[_0x5ecf('0x44')]=function(_0xef4473,_0x392179){if(_0xef4473[_0x5ecf('0x43')]['id']){delete _0xef4473[_0x5ecf('0x43')]['id'];}return db[_0x5ecf('0x3a')]['find']({'where':{'id':_0xef4473[_0x5ecf('0x45')]['id']}})['then'](handleEntityNotFound(_0x392179,null))[_0x5ecf('0x20')](saveUpdates(_0xef4473[_0x5ecf('0x43')],null))[_0x5ecf('0x20')](respondWithResult(_0x392179,null))['catch'](handleError(_0x392179,null));};exports[_0x5ecf('0x1f')]=function(_0x4c93c1,_0x692069){return db[_0x5ecf('0x3a')][_0x5ecf('0x41')]({'where':{'id':_0x4c93c1[_0x5ecf('0x45')]['id']}})['then'](handleEntityNotFound(_0x692069,null))[_0x5ecf('0x20')](removeEntity(_0x692069,null))[_0x5ecf('0x3e')](handleError(_0x692069,null));}; \ No newline at end of file +var _0x316a=['util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','error','stack','send','index','SquareMessage','rawAttributes','fieldName','type','key','map','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','findAll','rows','catch','show','include','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x1d1e1f,_0xdd44f6){var _0x51a9f7=function(_0x2873aa){while(--_0x2873aa){_0x1d1e1f['push'](_0x1d1e1f['shift']());}};_0x51a9f7(++_0xdd44f6);}(_0x316a,0xdb));var _0xa316=function(_0x13c70c,_0x546b34){_0x13c70c=_0x13c70c-0x0;var _0x50f0f2=_0x316a[_0x13c70c];return _0x50f0f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa316('0x0'));var zipdir=require(_0xa316('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa316('0x2'));var moment=require(_0xa316('0x3'));var BPromise=require(_0xa316('0x4'));var Mustache=require(_0xa316('0x5'));var util=require(_0xa316('0x6'));var path=require('path');var sox=require(_0xa316('0x7'));var csv=require(_0xa316('0x8'));var ejs=require(_0xa316('0x9'));var fs=require('fs');var fs_extra=require(_0xa316('0xa'));var _=require(_0xa316('0xb'));var squel=require(_0xa316('0xc'));var crypto=require(_0xa316('0xd'));var jsforce=require(_0xa316('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa316('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa316('0x10'));var qs=require(_0xa316('0x11'));var as=require(_0xa316('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa316('0x13'))(_0xa316('0x14'));var utils=require('../../config/utils');var config=require(_0xa316('0x15'));var licenseUtil=require(_0xa316('0x16'));var db=require(_0xa316('0x17'))['db'];function respondWithStatusCode(_0x5dfcd2,_0x3c7559){_0x3c7559=_0x3c7559||0xcc;return function(_0x49b105){if(_0x49b105){return _0x5dfcd2['sendStatus'](_0x3c7559);}return _0x5dfcd2[_0xa316('0x18')](_0x3c7559)[_0xa316('0x19')]();};}function respondWithResult(_0x54fd65,_0x5c5289){_0x5c5289=_0x5c5289||0xc8;return function(_0x1211c9){if(_0x1211c9){return _0x54fd65['status'](_0x5c5289)[_0xa316('0x1a')](_0x1211c9);}};}function respondWithFilteredResult(_0x473aa9,_0xc18bb3){return function(_0x3b8a4e){if(_0x3b8a4e){var _0x52833b=typeof _0xc18bb3[_0xa316('0x1b')]===_0xa316('0x1c')&&typeof _0xc18bb3[_0xa316('0x1d')]===_0xa316('0x1c');var _0xdeb0b7=_0x3b8a4e['count'];var _0x5cf7d6=_0x52833b?0x0:_0xc18bb3['offset'];var _0x33e508=_0x52833b?_0x3b8a4e['count']:_0xc18bb3['offset']+_0xc18bb3[_0xa316('0x1d')];var _0x48e57a;if(_0x33e508>=_0xdeb0b7){_0x33e508=_0xdeb0b7;_0x48e57a=0xc8;}else{_0x48e57a=0xce;}_0x473aa9[_0xa316('0x18')](_0x48e57a);return _0x473aa9[_0xa316('0x1e')]('Content-Range',_0x5cf7d6+'-'+_0x33e508+'/'+_0xdeb0b7)[_0xa316('0x1a')](_0x3b8a4e);}return null;};}function patchUpdates(_0x25b599){return function(_0x1d0668){try{jsonpatch[_0xa316('0x1f')](_0x1d0668,_0x25b599,!![]);}catch(_0x5787c9){return BPromise[_0xa316('0x20')](_0x5787c9);}return _0x1d0668[_0xa316('0x21')]();};}function saveUpdates(_0x140c3f,_0x493f56){return function(_0x23cbf9){if(_0x23cbf9){return _0x23cbf9[_0xa316('0x22')](_0x140c3f)[_0xa316('0x23')](function(_0x2550dc){return _0x2550dc;});}return null;};}function removeEntity(_0x4ccfa8,_0x36ed5a){return function(_0x5e405a){if(_0x5e405a){return _0x5e405a[_0xa316('0x24')]()[_0xa316('0x23')](function(){_0x4ccfa8[_0xa316('0x18')](0xcc)[_0xa316('0x19')]();});}};}function handleEntityNotFound(_0x423d2c,_0x874eb8){return function(_0x1e780c){if(!_0x1e780c){_0x423d2c['sendStatus'](0x194);}return _0x1e780c;};}function handleError(_0xaaff55,_0x27bee3){_0x27bee3=_0x27bee3||0x1f4;return function(_0x3c23c1){logger[_0xa316('0x25')](_0x3c23c1[_0xa316('0x26')]);if(_0x3c23c1['name']){delete _0x3c23c1['name'];}_0xaaff55[_0xa316('0x18')](_0x27bee3)[_0xa316('0x27')](_0x3c23c1);};}exports[_0xa316('0x28')]=function(_0x536361,_0x534d39){var _0x3d9581={},_0xc2151b={},_0x11ac7f={'count':0x0,'rows':[]};var _0x29cc7d=_['map'](db[_0xa316('0x29')][_0xa316('0x2a')],function(_0x19879b){return{'name':_0x19879b[_0xa316('0x2b')],'type':_0x19879b[_0xa316('0x2c')][_0xa316('0x2d')]};});_0xc2151b['model']=_[_0xa316('0x2e')](_0x29cc7d,_0xa316('0x2f'));_0xc2151b[_0xa316('0x30')]=_[_0xa316('0x31')](_0x536361[_0xa316('0x30')]);_0xc2151b[_0xa316('0x32')]=_[_0xa316('0x33')](_0xc2151b[_0xa316('0x34')],_0xc2151b[_0xa316('0x30')]);_0x3d9581[_0xa316('0x35')]=_[_0xa316('0x33')](_0xc2151b[_0xa316('0x34')],qs['fields'](_0x536361['query'][_0xa316('0x36')]));_0x3d9581[_0xa316('0x35')]=_0x3d9581[_0xa316('0x35')][_0xa316('0x37')]?_0x3d9581[_0xa316('0x35')]:_0xc2151b[_0xa316('0x34')];if(!_0x536361[_0xa316('0x30')][_0xa316('0x38')](_0xa316('0x39'))){_0x3d9581[_0xa316('0x1d')]=qs['limit'](_0x536361['query'][_0xa316('0x1d')]);_0x3d9581['offset']=qs[_0xa316('0x1b')](_0x536361[_0xa316('0x30')][_0xa316('0x1b')]);}_0x3d9581[_0xa316('0x3a')]=qs[_0xa316('0x3b')](_0x536361[_0xa316('0x30')][_0xa316('0x3b')]);_0x3d9581[_0xa316('0x3c')]=qs[_0xa316('0x32')](_[_0xa316('0x3d')](_0x536361['query'],_0xc2151b[_0xa316('0x32')]),_0x29cc7d);if(_0x536361[_0xa316('0x30')][_0xa316('0x3e')]){_0x3d9581['where']=_[_0xa316('0x3f')](_0x3d9581[_0xa316('0x3c')],{'$or':_['map'](_0x29cc7d,function(_0xbd6976){if(_0xbd6976[_0xa316('0x2c')]!=='VIRTUAL'){var _0x287499={};_0x287499[_0xbd6976['name']]={'$like':'%'+_0x536361[_0xa316('0x30')][_0xa316('0x3e')]+'%'};return _0x287499;}})});}_0x3d9581=_['merge']({},_0x3d9581,_0x536361[_0xa316('0x40')]);var _0x5726fc={'where':_0x3d9581[_0xa316('0x3c')]};return db['SquareMessage'][_0xa316('0x41')](_0x5726fc)[_0xa316('0x23')](function(_0x1f77b1){_0x11ac7f['count']=_0x1f77b1;if(_0x536361[_0xa316('0x30')][_0xa316('0x42')]){_0x3d9581['include']=[{'all':!![]}];}return db['SquareMessage'][_0xa316('0x43')](_0x3d9581);})[_0xa316('0x23')](function(_0x4ca28c){_0x11ac7f[_0xa316('0x44')]=_0x4ca28c;return _0x11ac7f;})['then'](respondWithFilteredResult(_0x534d39,_0x3d9581))[_0xa316('0x45')](handleError(_0x534d39,null));};exports[_0xa316('0x46')]=function(_0x546402,_0x312252){var _0x3441d8={'raw':!![],'where':{'id':_0x546402['params']['id']}},_0x34951e={};_0x34951e[_0xa316('0x34')]=_['keys'](db[_0xa316('0x29')][_0xa316('0x2a')]);_0x34951e[_0xa316('0x30')]=_[_0xa316('0x31')](_0x546402[_0xa316('0x30')]);_0x34951e[_0xa316('0x32')]=_[_0xa316('0x33')](_0x34951e[_0xa316('0x34')],_0x34951e[_0xa316('0x30')]);_0x3441d8[_0xa316('0x35')]=_[_0xa316('0x33')](_0x34951e[_0xa316('0x34')],qs['fields'](_0x546402[_0xa316('0x30')][_0xa316('0x36')]));_0x3441d8['attributes']=_0x3441d8[_0xa316('0x35')][_0xa316('0x37')]?_0x3441d8['attributes']:_0x34951e[_0xa316('0x34')];if(_0x546402[_0xa316('0x30')][_0xa316('0x42')]){_0x3441d8[_0xa316('0x47')]=[{'all':!![]}];}_0x3441d8=_['merge']({},_0x3441d8,_0x546402['options']);return db['SquareMessage'][_0xa316('0x48')](_0x3441d8)[_0xa316('0x23')](handleEntityNotFound(_0x312252,null))[_0xa316('0x23')](respondWithResult(_0x312252,null))[_0xa316('0x45')](handleError(_0x312252,null));};exports[_0xa316('0x49')]=function(_0x4bde40,_0x4f9b88){return db['SquareMessage']['create'](_0x4bde40[_0xa316('0x4a')],{})[_0xa316('0x23')](respondWithResult(_0x4f9b88,0xc9))[_0xa316('0x45')](handleError(_0x4f9b88,null));};exports[_0xa316('0x22')]=function(_0x51e870,_0x17f46c){if(_0x51e870[_0xa316('0x4a')]['id']){delete _0x51e870[_0xa316('0x4a')]['id'];}return db['SquareMessage'][_0xa316('0x48')]({'where':{'id':_0x51e870['params']['id']}})[_0xa316('0x23')](handleEntityNotFound(_0x17f46c,null))[_0xa316('0x23')](saveUpdates(_0x51e870['body'],null))['then'](respondWithResult(_0x17f46c,null))[_0xa316('0x45')](handleError(_0x17f46c,null));};exports[_0xa316('0x24')]=function(_0x426b9b,_0x1ed5f3){return db[_0xa316('0x29')]['find']({'where':{'id':_0x426b9b['params']['id']}})[_0xa316('0x23')](handleEntityNotFound(_0x1ed5f3,null))[_0xa316('0x23')](removeEntity(_0x1ed5f3,null))['catch'](handleError(_0x1ed5f3,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 360338a..4541685 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 _0x3ed8=['../../config/environment','./squareMessage.attributes','define','SquareMessage','square_messages','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x1b1f88,_0x3fe1cb){var _0x5045b9=function(_0x5c1367){while(--_0x5c1367){_0x1b1f88['push'](_0x1b1f88['shift']());}};_0x5045b9(++_0x3fe1cb);}(_0x3ed8,0x1d9));var _0x83ed=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0x3ed8[_0x209ec9];return _0x129b1b;};'use strict';var _=require(_0x83ed('0x0'));var util=require('util');var logger=require(_0x83ed('0x1'))(_0x83ed('0x2'));var moment=require(_0x83ed('0x3'));var BPromise=require('bluebird');var rp=require(_0x83ed('0x4'));var fs=require('fs');var path=require(_0x83ed('0x5'));var rimraf=require(_0x83ed('0x6'));var config=require(_0x83ed('0x7'));var attributes=require(_0x83ed('0x8'));module['exports']=function(_0x21172a,_0x5f2b32){return _0x21172a[_0x83ed('0x9')](_0x83ed('0xa'),attributes,{'tableName':_0x83ed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc794=['define','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x172a3e,_0xdf84fa){var _0xf154ad=function(_0x233a26){while(--_0x233a26){_0x172a3e['push'](_0x172a3e['shift']());}};_0xf154ad(++_0xdf84fa);}(_0xc794,0x10f));var _0x4c79=function(_0x3b9270,_0x4c5bb8){_0x3b9270=_0x3b9270-0x0;var _0x1bac08=_0xc794[_0x3b9270];return _0x1bac08;};'use strict';var _=require('lodash');var util=require(_0x4c79('0x0'));var logger=require(_0x4c79('0x1'))(_0x4c79('0x2'));var moment=require('moment');var BPromise=require(_0x4c79('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c79('0x4'));var rimraf=require(_0x4c79('0x5'));var config=require(_0x4c79('0x6'));var attributes=require('./squareMessage.attributes');module[_0x4c79('0x7')]=function(_0xec838a,_0xaad6d){return _0xec838a[_0x4c79('0x8')]('SquareMessage',attributes,{'tableName':'square_messages','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 0abeb5d..99b4c53 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 _0x1fdc=['info','stringify','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','CreateSquareMessage','create','body','options','raw'];(function(_0x53b594,_0x559767){var _0x1e616f=function(_0x333eda){while(--_0x333eda){_0x53b594['push'](_0x53b594['shift']());}};_0x1e616f(++_0x559767);}(_0x1fdc,0x144));var _0xc1fd=function(_0x571a17,_0x63fb3d){_0x571a17=_0x571a17-0x0;var _0x3ef337=_0x1fdc[_0x571a17];return _0x3ef337;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc1fd('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1fd('0x1'));var db=require(_0xc1fd('0x2'))['db'];var utils=require(_0xc1fd('0x3'));var logger=require('../../config/logger')(_0xc1fd('0x4'));var config=require(_0xc1fd('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xc1fd('0x6')][_0xc1fd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4a8e19,_0x39cf43,_0x193dfb){return new BPromise(function(_0x677ad8,_0x15220d){return client[_0xc1fd('0x8')](_0x4a8e19,_0x193dfb)['then'](function(_0x3f15a3){logger['info'](_0xc1fd('0x9'),_0x39cf43,_0xc1fd('0xa'));logger[_0xc1fd('0xb')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x39cf43,_0xc1fd('0xa'),JSON['stringify'](_0x3f15a3));if(_0x3f15a3[_0xc1fd('0xc')]){if(_0x3f15a3[_0xc1fd('0xc')]['code']===0x1f4){logger[_0xc1fd('0xc')](_0xc1fd('0x9'),_0x39cf43,_0x3f15a3[_0xc1fd('0xc')][_0xc1fd('0xd')]);return _0x15220d(_0x3f15a3[_0xc1fd('0xc')]['message']);}logger[_0xc1fd('0xc')]('SquareMessage,\x20%s,\x20%s',_0x39cf43,_0x3f15a3[_0xc1fd('0xc')][_0xc1fd('0xd')]);return _0x677ad8(_0x3f15a3[_0xc1fd('0xc')]['message']);}else{logger['info'](_0xc1fd('0x9'),_0x39cf43,_0xc1fd('0xa'));_0x677ad8(_0x3f15a3[_0xc1fd('0xe')][_0xc1fd('0xd')]);}})[_0xc1fd('0xf')](function(_0x4a2963){logger[_0xc1fd('0xc')](_0xc1fd('0x9'),_0x39cf43,_0x4a2963);_0x15220d(_0x4a2963);});});}exports[_0xc1fd('0x10')]=function(_0x428813){var _0x4293cf=this;return new Promise(function(_0x346aae,_0x56e0f8){return db['SquareMessage'][_0xc1fd('0x11')](_0x428813[_0xc1fd('0x12')],{'raw':_0x428813['options']?_0x428813[_0xc1fd('0x13')][_0xc1fd('0x14')]===undefined?!![]:![]:!![]})['then'](function(_0x3e33b5){logger[_0xc1fd('0x15')](_0xc1fd('0x10'),_0x428813);logger['debug'](_0xc1fd('0x10'),_0x428813,JSON[_0xc1fd('0x16')](_0x3e33b5));_0x346aae(_0x3e33b5);})[_0xc1fd('0xf')](function(_0x57d5ec){logger[_0xc1fd('0xc')]('CreateSquareMessage',_0x57d5ec[_0xc1fd('0xd')],_0x428813);_0x56e0f8(_0x4293cf[_0xc1fd('0xc')](0x1f4,_0x57d5ec['message']));});});}; \ No newline at end of file +var _0x7043=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','CreateSquareMessage','create','body','options','raw','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7043,0x167));var _0x3704=function(_0x35611a,_0x59bb6c){_0x35611a=_0x35611a-0x0;var _0x57490a=_0x7043[_0x35611a];return _0x57490a;};'use strict';var _=require(_0x3704('0x0'));var util=require(_0x3704('0x1'));var moment=require(_0x3704('0x2'));var BPromise=require(_0x3704('0x3'));var rs=require(_0x3704('0x4'));var fs=require('fs');var Redis=require(_0x3704('0x5'));var db=require(_0x3704('0x6'))['db'];var utils=require(_0x3704('0x7'));var logger=require(_0x3704('0x8'))(_0x3704('0x9'));var config=require(_0x3704('0xa'));var jayson=require(_0x3704('0xb'));var client=jayson[_0x3704('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54f32c,_0x39e0c2,_0x575ae4){return new BPromise(function(_0x1da401,_0x28b7a5){return client[_0x3704('0xd')](_0x54f32c,_0x575ae4)[_0x3704('0xe')](function(_0x27797a){logger[_0x3704('0xf')](_0x3704('0x10'),_0x39e0c2,'request\x20sent');logger[_0x3704('0x11')](_0x3704('0x12'),_0x39e0c2,'request\x20sent',JSON[_0x3704('0x13')](_0x27797a));if(_0x27797a[_0x3704('0x14')]){if(_0x27797a[_0x3704('0x14')]['code']===0x1f4){logger[_0x3704('0x14')](_0x3704('0x10'),_0x39e0c2,_0x27797a['error'][_0x3704('0x15')]);return _0x28b7a5(_0x27797a[_0x3704('0x14')][_0x3704('0x15')]);}logger[_0x3704('0x14')](_0x3704('0x10'),_0x39e0c2,_0x27797a[_0x3704('0x14')][_0x3704('0x15')]);return _0x1da401(_0x27797a[_0x3704('0x14')]['message']);}else{logger['info'](_0x3704('0x10'),_0x39e0c2,_0x3704('0x16'));_0x1da401(_0x27797a[_0x3704('0x17')][_0x3704('0x15')]);}})[_0x3704('0x18')](function(_0xb3834f){logger[_0x3704('0x14')](_0x3704('0x10'),_0x39e0c2,_0xb3834f);_0x28b7a5(_0xb3834f);});});}exports[_0x3704('0x19')]=function(_0x234ccd){var _0x277b9c=this;return new Promise(function(_0x48cbbc,_0xfafb63){return db['SquareMessage'][_0x3704('0x1a')](_0x234ccd[_0x3704('0x1b')],{'raw':_0x234ccd[_0x3704('0x1c')]?_0x234ccd[_0x3704('0x1c')][_0x3704('0x1d')]===undefined?!![]:![]:!![]})[_0x3704('0xe')](function(_0xf4a5b0){logger[_0x3704('0xf')]('CreateSquareMessage',_0x234ccd);logger['debug'](_0x3704('0x19'),_0x234ccd,JSON['stringify'](_0xf4a5b0));_0x48cbbc(_0xf4a5b0);})[_0x3704('0x18')](function(_0x10ae7d){logger[_0x3704('0x14')](_0x3704('0x19'),_0x10ae7d[_0x3704('0x15')],_0x234ccd);_0xfafb63(_0x277b9c[_0x3704('0x14')](0x1f4,_0x10ae7d[_0x3704('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 209b27f..8ed3e31 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 _0x73a8=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','15s','post','put','update','delete','destroy','exports'];(function(_0x24bb72,_0x5d94b4){var _0x238e47=function(_0x55e617){while(--_0x55e617){_0x24bb72['push'](_0x24bb72['shift']());}};_0x238e47(++_0x5d94b4);}(_0x73a8,0x165));var _0x873a=function(_0x1ac054,_0x17b072){_0x1ac054=_0x1ac054-0x0;var _0x1a6780=_0x73a8[_0x1ac054];return _0x1a6780;};'use strict';var multer=require('multer');var util=require(_0x873a('0x0'));var path=require(_0x873a('0x1'));var timeout=require(_0x873a('0x2'));var express=require('express');var router=express[_0x873a('0x3')]();var fs_extra=require(_0x873a('0x4'));var auth=require(_0x873a('0x5'));var interaction=require(_0x873a('0x6'));var config=require(_0x873a('0x7'));var controller=require(_0x873a('0x8'));router[_0x873a('0x9')]('/',auth[_0x873a('0xa')](),controller[_0x873a('0xb')]);router['get'](_0x873a('0xc'),auth[_0x873a('0xa')](),controller[_0x873a('0xd')]);router[_0x873a('0x9')]('/:id/test',auth[_0x873a('0xa')](),timeout(_0x873a('0xe')),controller['test']);router[_0x873a('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x873a('0x10')](_0x873a('0xc'),auth['isAuthenticated'](),controller[_0x873a('0x11')]);router[_0x873a('0x12')]('/:id',auth[_0x873a('0xa')](),controller[_0x873a('0x13')]);module[_0x873a('0x14')]=router; \ No newline at end of file +var _0x4531=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','/:id/test','test','create','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x4b8526,_0x2771ec){var _0x3394b4=function(_0xd1fc26){while(--_0xd1fc26){_0x4b8526['push'](_0x4b8526['shift']());}};_0x3394b4(++_0x2771ec);}(_0x4531,0x1e1));var _0x1453=function(_0x5ea0ab,_0x3c0aec){_0x5ea0ab=_0x5ea0ab-0x0;var _0x3716bb=_0x4531[_0x5ea0ab];return _0x3716bb;};'use strict';var multer=require(_0x1453('0x0'));var util=require(_0x1453('0x1'));var path=require(_0x1453('0x2'));var timeout=require(_0x1453('0x3'));var express=require(_0x1453('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1453('0x5'));var interaction=require(_0x1453('0x6'));var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router[_0x1453('0x7')]('/',auth[_0x1453('0x8')](),controller['index']);router[_0x1453('0x7')](_0x1453('0x9'),auth[_0x1453('0x8')](),controller[_0x1453('0xa')]);router['get'](_0x1453('0xb'),auth['isAuthenticated'](),timeout('15s'),controller[_0x1453('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1453('0xd')]);router[_0x1453('0xe')](_0x1453('0x9'),auth['isAuthenticated'](),controller[_0x1453('0xf')]);router[_0x1453('0x10')](_0x1453('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x1453('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 2932ac1..30a40b9 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 _0x4c6d=['name','STRING'];(function(_0x54f5cc,_0x4a9d2d){var _0x49e0c2=function(_0x72c458){while(--_0x72c458){_0x54f5cc['push'](_0x54f5cc['shift']());}};_0x49e0c2(++_0x4a9d2d);}(_0x4c6d,0x129));var _0xd4c6=function(_0xa85234,_0x582a56){_0xa85234=_0xa85234-0x0;var _0x19b52f=_0x4c6d[_0xa85234];return _0x19b52f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd4c6('0x0')],'unique':_0xd4c6('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0xd4c6('0x0')]},'description':{'type':Sequelize[_0xd4c6('0x0')]}}; \ No newline at end of file +var _0x7ace=['sequelize','exports','STRING','name'];(function(_0x3eefc6,_0x1852db){var _0x943b68=function(_0x333ac1){while(--_0x333ac1){_0x3eefc6['push'](_0x3eefc6['shift']());}};_0x943b68(++_0x1852db);}(_0x7ace,0x16c));var _0xe7ac=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x7ace[_0x5d4607];return _0x5e4a86;};'use strict';var Sequelize=require(_0xe7ac('0x0'));module[_0xe7ac('0x1')]={'name':{'type':Sequelize[_0xe7ac('0x2')],'unique':_0xe7ac('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe7ac('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index d1fe2dc..775606e 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 _0x1c5b=['show','params','find','create','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','odbc','openSync','closeSync','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','destroy','then','get','ODBC','UserProfileResource','error','stack','name','send','index','map','SquareOdbc','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch'];(function(_0x22455b,_0x4cfb68){var _0x21d8ee=function(_0x44b4db){while(--_0x44b4db){_0x22455b['push'](_0x22455b['shift']());}};_0x21d8ee(++_0x4cfb68);}(_0x1c5b,0x67));var _0xb1c5=function(_0x13fb1e,_0x3ad860){_0x13fb1e=_0x13fb1e-0x0;var _0x221fd3=_0x1c5b[_0x13fb1e];return _0x221fd3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb1c5('0x0'));var rp=require(_0xb1c5('0x1'));var moment=require(_0xb1c5('0x2'));var BPromise=require(_0xb1c5('0x3'));var Mustache=require(_0xb1c5('0x4'));var util=require(_0xb1c5('0x5'));var path=require(_0xb1c5('0x6'));var sox=require(_0xb1c5('0x7'));var csv=require(_0xb1c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1c5('0x9'));var _=require(_0xb1c5('0xa'));var squel=require('squel');var crypto=require(_0xb1c5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb1c5('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb1c5('0xd'));var Redis=require('ioredis');var authService=require(_0xb1c5('0xe'));var qs=require(_0xb1c5('0xf'));var as=require(_0xb1c5('0x10'));var hardwareService=require(_0xb1c5('0x11'));var logger=require(_0xb1c5('0x12'))(_0xb1c5('0x13'));var utils=require(_0xb1c5('0x14'));var config=require(_0xb1c5('0x15'));var licenseUtil=require(_0xb1c5('0x16'));var db=require(_0xb1c5('0x17'))['db'];function respondWithStatusCode(_0x510edb,_0x2127b7){_0x2127b7=_0x2127b7||0xcc;return function(_0x66179c){if(_0x66179c){return _0x510edb[_0xb1c5('0x18')](_0x2127b7);}return _0x510edb[_0xb1c5('0x19')](_0x2127b7)[_0xb1c5('0x1a')]();};}function respondWithResult(_0x1ab85d,_0x54b4f2){_0x54b4f2=_0x54b4f2||0xc8;return function(_0x40fd15){if(_0x40fd15){return _0x1ab85d[_0xb1c5('0x19')](_0x54b4f2)[_0xb1c5('0x1b')](_0x40fd15);}};}function respondWithFilteredResult(_0x537fb3,_0x3fdb7b){return function(_0x32dbc3){if(_0x32dbc3){var _0x34222a=typeof _0x3fdb7b[_0xb1c5('0x1c')]===_0xb1c5('0x1d')&&typeof _0x3fdb7b['limit']===_0xb1c5('0x1d');var _0x3d12f9=_0x32dbc3['count'];var _0x4a00fc=_0x34222a?0x0:_0x3fdb7b[_0xb1c5('0x1c')];var _0x415d47=_0x34222a?_0x32dbc3[_0xb1c5('0x1e')]:_0x3fdb7b[_0xb1c5('0x1c')]+_0x3fdb7b[_0xb1c5('0x1f')];var _0x10dc69;if(_0x415d47>=_0x3d12f9){_0x415d47=_0x3d12f9;_0x10dc69=0xc8;}else{_0x10dc69=0xce;}_0x537fb3[_0xb1c5('0x19')](_0x10dc69);return _0x537fb3[_0xb1c5('0x20')]('Content-Range',_0x4a00fc+'-'+_0x415d47+'/'+_0x3d12f9)[_0xb1c5('0x1b')](_0x32dbc3);}return null;};}function patchUpdates(_0x562696){return function(_0x8ac10b){try{jsonpatch[_0xb1c5('0x21')](_0x8ac10b,_0x562696,!![]);}catch(_0xe45578){return BPromise['reject'](_0xe45578);}return _0x8ac10b[_0xb1c5('0x22')]();};}function saveUpdates(_0x4b0968,_0x27c117){return function(_0x167576){if(_0x167576){return _0x167576[_0xb1c5('0x23')](_0x4b0968)['then'](function(_0x491c0a){return _0x491c0a;});}return null;};}function removeEntity(_0x46fca1,_0x3bd26c){return function(_0x2be5c4){if(_0x2be5c4){return _0x2be5c4[_0xb1c5('0x24')]()[_0xb1c5('0x25')](function(){var _0x215912=_0x2be5c4[_0xb1c5('0x26')]({'plain':!![]});var _0x14dac5=_0xb1c5('0x27');return db[_0xb1c5('0x28')][_0xb1c5('0x24')]({'where':{'type':_0x14dac5,'resourceId':_0x215912['id']}})[_0xb1c5('0x25')](function(){return _0x2be5c4;});})[_0xb1c5('0x25')](function(){_0x46fca1['status'](0xcc)[_0xb1c5('0x1a')]();});}};}function handleEntityNotFound(_0x5b45fe,_0x22cdff){return function(_0x278f4c){if(!_0x278f4c){_0x5b45fe[_0xb1c5('0x18')](0x194);}return _0x278f4c;};}function handleError(_0x4d52bb,_0xe6aabd){_0xe6aabd=_0xe6aabd||0x1f4;return function(_0x53dd35){logger[_0xb1c5('0x29')](_0x53dd35[_0xb1c5('0x2a')]);if(_0x53dd35['name']){delete _0x53dd35[_0xb1c5('0x2b')];}_0x4d52bb[_0xb1c5('0x19')](_0xe6aabd)[_0xb1c5('0x2c')](_0x53dd35);};}exports[_0xb1c5('0x2d')]=function(_0x529cb5,_0x5a3977){var _0x485fd3={},_0x510064={},_0x34f5e4={'count':0x0,'rows':[]};var _0x3cb8ad=_[_0xb1c5('0x2e')](db[_0xb1c5('0x2f')][_0xb1c5('0x30')],function(_0x28b9c9){return{'name':_0x28b9c9['fieldName'],'type':_0x28b9c9[_0xb1c5('0x31')][_0xb1c5('0x32')]};});_0x510064[_0xb1c5('0x33')]=_[_0xb1c5('0x2e')](_0x3cb8ad,_0xb1c5('0x2b'));_0x510064[_0xb1c5('0x34')]=_[_0xb1c5('0x35')](_0x529cb5[_0xb1c5('0x34')]);_0x510064[_0xb1c5('0x36')]=_[_0xb1c5('0x37')](_0x510064[_0xb1c5('0x33')],_0x510064[_0xb1c5('0x34')]);_0x485fd3[_0xb1c5('0x38')]=_['intersection'](_0x510064[_0xb1c5('0x33')],qs['fields'](_0x529cb5[_0xb1c5('0x34')][_0xb1c5('0x39')]));_0x485fd3[_0xb1c5('0x38')]=_0x485fd3[_0xb1c5('0x38')][_0xb1c5('0x3a')]?_0x485fd3[_0xb1c5('0x38')]:_0x510064[_0xb1c5('0x33')];if(!_0x529cb5[_0xb1c5('0x34')][_0xb1c5('0x3b')](_0xb1c5('0x3c'))){_0x485fd3['limit']=qs['limit'](_0x529cb5[_0xb1c5('0x34')][_0xb1c5('0x1f')]);_0x485fd3[_0xb1c5('0x1c')]=qs[_0xb1c5('0x1c')](_0x529cb5[_0xb1c5('0x34')][_0xb1c5('0x1c')]);}_0x485fd3[_0xb1c5('0x3d')]=qs[_0xb1c5('0x3e')](_0x529cb5['query'][_0xb1c5('0x3e')]);_0x485fd3['where']=qs[_0xb1c5('0x36')](_[_0xb1c5('0x3f')](_0x529cb5[_0xb1c5('0x34')],_0x510064['filters']),_0x3cb8ad);if(_0x529cb5['query'][_0xb1c5('0x40')]){_0x485fd3[_0xb1c5('0x41')]=_[_0xb1c5('0x42')](_0x485fd3['where'],{'$or':_[_0xb1c5('0x2e')](_0x3cb8ad,function(_0x52984b){if(_0x52984b[_0xb1c5('0x31')]!==_0xb1c5('0x43')){var _0x5c768c={};_0x5c768c[_0x52984b[_0xb1c5('0x2b')]]={'$like':'%'+_0x529cb5['query'][_0xb1c5('0x40')]+'%'};return _0x5c768c;}})});}_0x485fd3=_['merge']({},_0x485fd3,_0x529cb5[_0xb1c5('0x44')]);var _0x178e6a={'where':_0x485fd3[_0xb1c5('0x41')]};return db[_0xb1c5('0x2f')][_0xb1c5('0x1e')](_0x178e6a)[_0xb1c5('0x25')](function(_0x2a451){_0x34f5e4[_0xb1c5('0x1e')]=_0x2a451;if(_0x529cb5[_0xb1c5('0x34')][_0xb1c5('0x45')]){_0x485fd3[_0xb1c5('0x46')]=[{'all':!![]}];}return db[_0xb1c5('0x2f')][_0xb1c5('0x47')](_0x485fd3);})[_0xb1c5('0x25')](function(_0x2f639c){_0x34f5e4['rows']=_0x2f639c;return _0x34f5e4;})['then'](respondWithFilteredResult(_0x5a3977,_0x485fd3))[_0xb1c5('0x48')](handleError(_0x5a3977,null));};exports[_0xb1c5('0x49')]=function(_0x1c02d4,_0x5086c3){var _0x2ab12d={'raw':!![],'where':{'id':_0x1c02d4[_0xb1c5('0x4a')]['id']}},_0x4d3872={};_0x4d3872[_0xb1c5('0x33')]=_[_0xb1c5('0x35')](db['SquareOdbc']['rawAttributes']);_0x4d3872[_0xb1c5('0x34')]=_['keys'](_0x1c02d4[_0xb1c5('0x34')]);_0x4d3872['filters']=_[_0xb1c5('0x37')](_0x4d3872[_0xb1c5('0x33')],_0x4d3872[_0xb1c5('0x34')]);_0x2ab12d['attributes']=_[_0xb1c5('0x37')](_0x4d3872['model'],qs['fields'](_0x1c02d4[_0xb1c5('0x34')][_0xb1c5('0x39')]));_0x2ab12d['attributes']=_0x2ab12d[_0xb1c5('0x38')]['length']?_0x2ab12d[_0xb1c5('0x38')]:_0x4d3872[_0xb1c5('0x33')];if(_0x1c02d4['query'][_0xb1c5('0x45')]){_0x2ab12d['include']=[{'all':!![]}];}_0x2ab12d=_['merge']({},_0x2ab12d,_0x1c02d4[_0xb1c5('0x44')]);return db[_0xb1c5('0x2f')][_0xb1c5('0x4b')](_0x2ab12d)[_0xb1c5('0x25')](handleEntityNotFound(_0x5086c3,null))[_0xb1c5('0x25')](respondWithResult(_0x5086c3,null))['catch'](handleError(_0x5086c3,null));};exports[_0xb1c5('0x4c')]=function(_0x5a0774,_0x245015){return db[_0xb1c5('0x2f')][_0xb1c5('0x4c')](_0x5a0774['body'],{})[_0xb1c5('0x25')](function(_0x2fcfdd){var _0x13a71f=_0x5a0774[_0xb1c5('0x4d')][_0xb1c5('0x26')]({'plain':!![]});if(!_0x13a71f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13a71f['role']===_0xb1c5('0x4d')){var _0x4b3f67=_0x2fcfdd[_0xb1c5('0x26')]({'plain':!![]});var _0x10d479=_0xb1c5('0x27');return db[_0xb1c5('0x4e')][_0xb1c5('0x4b')]({'where':{'name':_0x10d479,'userProfileId':_0x13a71f[_0xb1c5('0x4f')]},'raw':!![]})[_0xb1c5('0x25')](function(_0x462ab8){if(_0x462ab8&&_0x462ab8[_0xb1c5('0x50')]===0x0){return db['UserProfileResource'][_0xb1c5('0x4c')]({'name':_0x4b3f67['name'],'resourceId':_0x4b3f67['id'],'type':_0x462ab8[_0xb1c5('0x2b')],'sectionId':_0x462ab8['id']},{})['then'](function(){return _0x2fcfdd;});}else{return _0x2fcfdd;}})['catch'](function(_0x164e50){logger['error'](_0xb1c5('0x51'),_0x164e50);throw _0x164e50;});}return _0x2fcfdd;})[_0xb1c5('0x25')](respondWithResult(_0x245015,0xc9))[_0xb1c5('0x48')](handleError(_0x245015,null));};exports[_0xb1c5('0x23')]=function(_0x30213d,_0x492adf){if(_0x30213d[_0xb1c5('0x52')]['id']){delete _0x30213d['body']['id'];}return db[_0xb1c5('0x2f')][_0xb1c5('0x4b')]({'where':{'id':_0x30213d[_0xb1c5('0x4a')]['id']}})[_0xb1c5('0x25')](handleEntityNotFound(_0x492adf,null))[_0xb1c5('0x25')](saveUpdates(_0x30213d[_0xb1c5('0x52')],null))['then'](respondWithResult(_0x492adf,null))[_0xb1c5('0x48')](handleError(_0x492adf,null));};exports[_0xb1c5('0x24')]=function(_0x43c5cc,_0x2dd345){return db[_0xb1c5('0x2f')][_0xb1c5('0x4b')]({'where':{'id':_0x43c5cc['params']['id']}})[_0xb1c5('0x25')](handleEntityNotFound(_0x2dd345,null))['then'](removeEntity(_0x2dd345,null))[_0xb1c5('0x48')](handleError(_0x2dd345,null));};exports[_0xb1c5('0x53')]=function(_0x38b304,_0x80ace7,_0x20197e){var _0x2e09e4;return db['SquareOdbc'][_0xb1c5('0x4b')]({'where':{'id':_0x38b304[_0xb1c5('0x4a')]['id']},'attributes':['id',_0xb1c5('0x54')]})[_0xb1c5('0x25')](handleEntityNotFound(_0x80ace7,null))['then'](function(_0x2e3937){if(_0x2e3937){var _0x3b91c4=require(_0xb1c5('0x55'))();_0x3b91c4[_0xb1c5('0x56')](_0x2e3937[_0xb1c5('0x54')]);_0x3b91c4[_0xb1c5('0x57')]();return _0x2e3937;}})[_0xb1c5('0x25')](respondWithResult(_0x80ace7,null))[_0xb1c5('0x48')](handleError(_0x80ace7,null));}; \ No newline at end of file +var _0x212a=['filter','merge','type','VIRTUAL','SquareOdbc','includeAll','include','rows','show','params','options','find','create','body','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','catch','test','dsn','odbc','openSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','get','ODBC','UserProfileResource','destroy','then','error','stack','name','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x377b6d,_0x1f0d6d){var _0x4f3fd9=function(_0x1580d5){while(--_0x1580d5){_0x377b6d['push'](_0x377b6d['shift']());}};_0x4f3fd9(++_0x1f0d6d);}(_0x212a,0x1b6));var _0xa212=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x212a[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0xa212('0x0'));var rimraf=require(_0xa212('0x1'));var zipdir=require(_0xa212('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa212('0x3'));var moment=require(_0xa212('0x4'));var BPromise=require(_0xa212('0x5'));var Mustache=require(_0xa212('0x6'));var util=require(_0xa212('0x7'));var path=require(_0xa212('0x8'));var sox=require('sox');var csv=require(_0xa212('0x9'));var ejs=require(_0xa212('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa212('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa212('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa212('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa212('0xe'));var qs=require(_0xa212('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa212('0x10'))(_0xa212('0x11'));var utils=require(_0xa212('0x12'));var config=require(_0xa212('0x13'));var licenseUtil=require(_0xa212('0x14'));var db=require(_0xa212('0x15'))['db'];function respondWithStatusCode(_0x52042e,_0x3aa27e){_0x3aa27e=_0x3aa27e||0xcc;return function(_0x484d43){if(_0x484d43){return _0x52042e[_0xa212('0x16')](_0x3aa27e);}return _0x52042e[_0xa212('0x17')](_0x3aa27e)[_0xa212('0x18')]();};}function respondWithResult(_0x578602,_0x321f68){_0x321f68=_0x321f68||0xc8;return function(_0x24260d){if(_0x24260d){return _0x578602[_0xa212('0x17')](_0x321f68)[_0xa212('0x19')](_0x24260d);}};}function respondWithFilteredResult(_0x87ce83,_0x530b5b){return function(_0x573a16){if(_0x573a16){var _0x2423ec=typeof _0x530b5b[_0xa212('0x1a')]===_0xa212('0x1b')&&typeof _0x530b5b['limit']==='undefined';var _0x5b2b9b=_0x573a16[_0xa212('0x1c')];var _0xbc5b8a=_0x2423ec?0x0:_0x530b5b[_0xa212('0x1a')];var _0x39e281=_0x2423ec?_0x573a16[_0xa212('0x1c')]:_0x530b5b[_0xa212('0x1a')]+_0x530b5b[_0xa212('0x1d')];var _0x35b012;if(_0x39e281>=_0x5b2b9b){_0x39e281=_0x5b2b9b;_0x35b012=0xc8;}else{_0x35b012=0xce;}_0x87ce83['status'](_0x35b012);return _0x87ce83[_0xa212('0x1e')](_0xa212('0x1f'),_0xbc5b8a+'-'+_0x39e281+'/'+_0x5b2b9b)[_0xa212('0x19')](_0x573a16);}return null;};}function patchUpdates(_0x2db0c0){return function(_0x1ba10b){try{jsonpatch[_0xa212('0x20')](_0x1ba10b,_0x2db0c0,!![]);}catch(_0x29add8){return BPromise['reject'](_0x29add8);}return _0x1ba10b[_0xa212('0x21')]();};}function saveUpdates(_0x668c19,_0x56d7f3){return function(_0x57d766){if(_0x57d766){return _0x57d766['update'](_0x668c19)['then'](function(_0xab0491){return _0xab0491;});}return null;};}function removeEntity(_0x56d949,_0x599f38){return function(_0x16e0c6){if(_0x16e0c6){return _0x16e0c6['destroy']()['then'](function(){var _0x2c5cd7=_0x16e0c6[_0xa212('0x22')]({'plain':!![]});var _0x19374a=_0xa212('0x23');return db[_0xa212('0x24')][_0xa212('0x25')]({'where':{'type':_0x19374a,'resourceId':_0x2c5cd7['id']}})[_0xa212('0x26')](function(){return _0x16e0c6;});})[_0xa212('0x26')](function(){_0x56d949['status'](0xcc)[_0xa212('0x18')]();});}};}function handleEntityNotFound(_0x211744,_0x2f411e){return function(_0x5b1267){if(!_0x5b1267){_0x211744[_0xa212('0x16')](0x194);}return _0x5b1267;};}function handleError(_0x1bc058,_0x35703c){_0x35703c=_0x35703c||0x1f4;return function(_0xea1f1d){logger[_0xa212('0x27')](_0xea1f1d[_0xa212('0x28')]);if(_0xea1f1d[_0xa212('0x29')]){delete _0xea1f1d[_0xa212('0x29')];}_0x1bc058['status'](_0x35703c)['send'](_0xea1f1d);};}exports['index']=function(_0x53758a,_0x24afb0){var _0x375b26={},_0x1c1998={},_0x25d10={'count':0x0,'rows':[]};var _0x2b50ca=_[_0xa212('0x2a')](db['SquareOdbc'][_0xa212('0x2b')],function(_0x54c7e9){return{'name':_0x54c7e9[_0xa212('0x2c')],'type':_0x54c7e9['type'][_0xa212('0x2d')]};});_0x1c1998['model']=_['map'](_0x2b50ca,_0xa212('0x29'));_0x1c1998[_0xa212('0x2e')]=_[_0xa212('0x2f')](_0x53758a[_0xa212('0x2e')]);_0x1c1998[_0xa212('0x30')]=_[_0xa212('0x31')](_0x1c1998[_0xa212('0x32')],_0x1c1998[_0xa212('0x2e')]);_0x375b26[_0xa212('0x33')]=_['intersection'](_0x1c1998['model'],qs[_0xa212('0x34')](_0x53758a['query'][_0xa212('0x34')]));_0x375b26[_0xa212('0x33')]=_0x375b26[_0xa212('0x33')][_0xa212('0x35')]?_0x375b26[_0xa212('0x33')]:_0x1c1998[_0xa212('0x32')];if(!_0x53758a[_0xa212('0x2e')][_0xa212('0x36')](_0xa212('0x37'))){_0x375b26[_0xa212('0x1d')]=qs[_0xa212('0x1d')](_0x53758a[_0xa212('0x2e')][_0xa212('0x1d')]);_0x375b26['offset']=qs[_0xa212('0x1a')](_0x53758a[_0xa212('0x2e')][_0xa212('0x1a')]);}_0x375b26[_0xa212('0x38')]=qs['sort'](_0x53758a[_0xa212('0x2e')][_0xa212('0x39')]);_0x375b26[_0xa212('0x3a')]=qs[_0xa212('0x30')](_[_0xa212('0x3b')](_0x53758a[_0xa212('0x2e')],_0x1c1998['filters']),_0x2b50ca);if(_0x53758a[_0xa212('0x2e')][_0xa212('0x3c')]){_0x375b26[_0xa212('0x3a')]=_[_0xa212('0x3d')](_0x375b26[_0xa212('0x3a')],{'$or':_[_0xa212('0x2a')](_0x2b50ca,function(_0x334de7){if(_0x334de7[_0xa212('0x3e')]!==_0xa212('0x3f')){var _0x373396={};_0x373396[_0x334de7[_0xa212('0x29')]]={'$like':'%'+_0x53758a[_0xa212('0x2e')][_0xa212('0x3c')]+'%'};return _0x373396;}})});}_0x375b26=_[_0xa212('0x3d')]({},_0x375b26,_0x53758a['options']);var _0x17db84={'where':_0x375b26[_0xa212('0x3a')]};return db[_0xa212('0x40')][_0xa212('0x1c')](_0x17db84)[_0xa212('0x26')](function(_0x321e52){_0x25d10[_0xa212('0x1c')]=_0x321e52;if(_0x53758a[_0xa212('0x2e')][_0xa212('0x41')]){_0x375b26[_0xa212('0x42')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x375b26);})[_0xa212('0x26')](function(_0x15db73){_0x25d10[_0xa212('0x43')]=_0x15db73;return _0x25d10;})[_0xa212('0x26')](respondWithFilteredResult(_0x24afb0,_0x375b26))['catch'](handleError(_0x24afb0,null));};exports[_0xa212('0x44')]=function(_0xf1ec2d,_0x4b669f){var _0x57135c={'raw':!![],'where':{'id':_0xf1ec2d[_0xa212('0x45')]['id']}},_0x1fedb9={};_0x1fedb9[_0xa212('0x32')]=_[_0xa212('0x2f')](db[_0xa212('0x40')][_0xa212('0x2b')]);_0x1fedb9[_0xa212('0x2e')]=_[_0xa212('0x2f')](_0xf1ec2d[_0xa212('0x2e')]);_0x1fedb9['filters']=_[_0xa212('0x31')](_0x1fedb9[_0xa212('0x32')],_0x1fedb9[_0xa212('0x2e')]);_0x57135c[_0xa212('0x33')]=_[_0xa212('0x31')](_0x1fedb9['model'],qs[_0xa212('0x34')](_0xf1ec2d[_0xa212('0x2e')]['fields']));_0x57135c[_0xa212('0x33')]=_0x57135c['attributes']['length']?_0x57135c[_0xa212('0x33')]:_0x1fedb9[_0xa212('0x32')];if(_0xf1ec2d[_0xa212('0x2e')][_0xa212('0x41')]){_0x57135c[_0xa212('0x42')]=[{'all':!![]}];}_0x57135c=_[_0xa212('0x3d')]({},_0x57135c,_0xf1ec2d[_0xa212('0x46')]);return db['SquareOdbc'][_0xa212('0x47')](_0x57135c)[_0xa212('0x26')](handleEntityNotFound(_0x4b669f,null))['then'](respondWithResult(_0x4b669f,null))['catch'](handleError(_0x4b669f,null));};exports[_0xa212('0x48')]=function(_0x513786,_0x1c6307){return db[_0xa212('0x40')][_0xa212('0x48')](_0x513786[_0xa212('0x49')],{})[_0xa212('0x26')](function(_0x3333a5){var _0x3d1a0b=_0x513786[_0xa212('0x4a')]['get']({'plain':!![]});if(!_0x3d1a0b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d1a0b['role']===_0xa212('0x4a')){var _0x14a524=_0x3333a5[_0xa212('0x22')]({'plain':!![]});var _0x2ac75d=_0xa212('0x23');return db['UserProfileSection'][_0xa212('0x47')]({'where':{'name':_0x2ac75d,'userProfileId':_0x3d1a0b[_0xa212('0x4b')]},'raw':!![]})[_0xa212('0x26')](function(_0x14c753){if(_0x14c753&&_0x14c753['autoAssociation']===0x0){return db[_0xa212('0x24')][_0xa212('0x48')]({'name':_0x14a524[_0xa212('0x29')],'resourceId':_0x14a524['id'],'type':_0x14c753['name'],'sectionId':_0x14c753['id']},{})['then'](function(){return _0x3333a5;});}else{return _0x3333a5;}})['catch'](function(_0x58a6ba){logger[_0xa212('0x27')](_0xa212('0x4c'),_0x58a6ba);throw _0x58a6ba;});}return _0x3333a5;})[_0xa212('0x26')](respondWithResult(_0x1c6307,0xc9))['catch'](handleError(_0x1c6307,null));};exports[_0xa212('0x4d')]=function(_0x4bb161,_0x40176f){if(_0x4bb161[_0xa212('0x49')]['id']){delete _0x4bb161[_0xa212('0x49')]['id'];}return db['SquareOdbc'][_0xa212('0x47')]({'where':{'id':_0x4bb161[_0xa212('0x45')]['id']}})[_0xa212('0x26')](handleEntityNotFound(_0x40176f,null))[_0xa212('0x26')](saveUpdates(_0x4bb161[_0xa212('0x49')],null))[_0xa212('0x26')](respondWithResult(_0x40176f,null))[_0xa212('0x4e')](handleError(_0x40176f,null));};exports[_0xa212('0x25')]=function(_0x1d0997,_0x52ee28){return db[_0xa212('0x40')][_0xa212('0x47')]({'where':{'id':_0x1d0997[_0xa212('0x45')]['id']}})[_0xa212('0x26')](handleEntityNotFound(_0x52ee28,null))[_0xa212('0x26')](removeEntity(_0x52ee28,null))['catch'](handleError(_0x52ee28,null));};exports[_0xa212('0x4f')]=function(_0xf5757f,_0x2a1faa,_0x21f788){var _0x540d33;return db[_0xa212('0x40')][_0xa212('0x47')]({'where':{'id':_0xf5757f[_0xa212('0x45')]['id']},'attributes':['id',_0xa212('0x50')]})[_0xa212('0x26')](handleEntityNotFound(_0x2a1faa,null))[_0xa212('0x26')](function(_0x2d818b){if(_0x2d818b){var _0x6cbed0=require(_0xa212('0x51'))();_0x6cbed0[_0xa212('0x52')](_0x2d818b['dsn']);_0x6cbed0['closeSync']();return _0x2d818b;}})[_0xa212('0x26')](respondWithResult(_0x2a1faa,null))[_0xa212('0x4e')](handleError(_0x2a1faa,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 32772b9..929b54e 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 _0xb506=['SquareOdbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x45adb4,_0x2abb06){var _0x137296=function(_0x552ec9){while(--_0x552ec9){_0x45adb4['push'](_0x45adb4['shift']());}};_0x137296(++_0x2abb06);}(_0xb506,0x18d));var _0x6b50=function(_0x473547,_0x423c77){_0x473547=_0x473547-0x0;var _0x14d75d=_0xb506[_0x473547];return _0x14d75d;};'use strict';var _=require(_0x6b50('0x0'));var util=require(_0x6b50('0x1'));var logger=require(_0x6b50('0x2'))(_0x6b50('0x3'));var moment=require(_0x6b50('0x4'));var BPromise=require(_0x6b50('0x5'));var rp=require(_0x6b50('0x6'));var fs=require('fs');var path=require(_0x6b50('0x7'));var rimraf=require(_0x6b50('0x8'));var config=require(_0x6b50('0x9'));var attributes=require('./squareOdbc.attributes');module[_0x6b50('0xa')]=function(_0x59a756,_0x3eb1a9){return _0x59a756['define'](_0x6b50('0xb'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x29c3=['../../config/environment','./squareOdbc.attributes','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x29c3,0x100));var _0x329c=function(_0x2332f3,_0x2eff9a){_0x2332f3=_0x2332f3-0x0;var _0x353330=_0x29c3[_0x2332f3];return _0x353330;};'use strict';var _=require(_0x329c('0x0'));var util=require(_0x329c('0x1'));var logger=require(_0x329c('0x2'))(_0x329c('0x3'));var moment=require(_0x329c('0x4'));var BPromise=require('bluebird');var rp=require(_0x329c('0x5'));var fs=require('fs');var path=require(_0x329c('0x6'));var rimraf=require(_0x329c('0x7'));var config=require(_0x329c('0x8'));var attributes=require(_0x329c('0x9'));module['exports']=function(_0x5d2ff8,_0x5ff3a6){return _0x5d2ff8['define'](_0x329c('0xa'),attributes,{'tableName':_0x329c('0xb'),'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 ac4f1a2..ccc6c58 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 _0x0484=['stringify','error','code','message','result','catch','ShowSquareOdbc','find','options','raw','where','attributes','include','model','map','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0x4229d8,_0x2c79a6){var _0x38a525=function(_0x8ebc8b){while(--_0x8ebc8b){_0x4229d8['push'](_0x4229d8['shift']());}};_0x38a525(++_0x2c79a6);}(_0x0484,0xd6));var _0x4048=function(_0x5d02fb,_0x518ec3){_0x5d02fb=_0x5d02fb-0x0;var _0x4c179e=_0x0484[_0x5d02fb];return _0x4c179e;};'use strict';var _=require(_0x4048('0x0'));var util=require('util');var moment=require(_0x4048('0x1'));var BPromise=require(_0x4048('0x2'));var rs=require(_0x4048('0x3'));var fs=require('fs');var Redis=require(_0x4048('0x4'));var db=require(_0x4048('0x5'))['db'];var utils=require(_0x4048('0x6'));var logger=require(_0x4048('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4048('0x8'));var client=jayson[_0x4048('0x9')][_0x4048('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb45620,_0x5327ee,_0x310499){return new BPromise(function(_0x35366c,_0x2c2eba){return client[_0x4048('0xb')](_0xb45620,_0x310499)['then'](function(_0x309f51){logger[_0x4048('0xc')](_0x4048('0xd'),_0x5327ee,_0x4048('0xe'));logger[_0x4048('0xf')](_0x4048('0x10'),_0x5327ee,_0x4048('0xe'),JSON[_0x4048('0x11')](_0x309f51));if(_0x309f51[_0x4048('0x12')]){if(_0x309f51['error'][_0x4048('0x13')]===0x1f4){logger[_0x4048('0x12')](_0x4048('0xd'),_0x5327ee,_0x309f51[_0x4048('0x12')][_0x4048('0x14')]);return _0x2c2eba(_0x309f51[_0x4048('0x12')][_0x4048('0x14')]);}logger[_0x4048('0x12')](_0x4048('0xd'),_0x5327ee,_0x309f51[_0x4048('0x12')]['message']);return _0x35366c(_0x309f51[_0x4048('0x12')][_0x4048('0x14')]);}else{logger[_0x4048('0xc')](_0x4048('0xd'),_0x5327ee,_0x4048('0xe'));_0x35366c(_0x309f51[_0x4048('0x15')][_0x4048('0x14')]);}})[_0x4048('0x16')](function(_0x174e13){logger[_0x4048('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x5327ee,_0x174e13);_0x2c2eba(_0x174e13);});});}exports[_0x4048('0x17')]=function(_0x5d86ee){var _0x361da5=this;return new Promise(function(_0x53cbc5,_0x8df463){return db['SquareOdbc'][_0x4048('0x18')]({'raw':_0x5d86ee[_0x4048('0x19')]?_0x5d86ee[_0x4048('0x19')][_0x4048('0x1a')]===undefined?!![]:![]:!![],'where':_0x5d86ee[_0x4048('0x19')]?_0x5d86ee['options'][_0x4048('0x1b')]||null:null,'attributes':_0x5d86ee['options']?_0x5d86ee[_0x4048('0x19')][_0x4048('0x1c')]||null:null,'include':_0x5d86ee[_0x4048('0x19')]?_0x5d86ee['options']['include']?_['map'](_0x5d86ee[_0x4048('0x19')][_0x4048('0x1d')],function(_0x4ef0e3){return{'model':db[_0x4ef0e3[_0x4048('0x1e')]],'as':_0x4ef0e3['as'],'attributes':_0x4ef0e3[_0x4048('0x1c')],'include':_0x4ef0e3[_0x4048('0x1d')]?_[_0x4048('0x1f')](_0x4ef0e3['include'],function(_0x2564e1){return{'model':db[_0x2564e1[_0x4048('0x1e')]],'as':_0x2564e1['as'],'attributes':_0x2564e1[_0x4048('0x1c')],'include':_0x2564e1[_0x4048('0x1d')]?_[_0x4048('0x1f')](_0x2564e1[_0x4048('0x1d')],function(_0x324001){return{'model':db[_0x324001[_0x4048('0x1e')]],'as':_0x324001['as'],'attributes':_0x324001[_0x4048('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4048('0x20')](function(_0x1e98c1){logger[_0x4048('0xc')](_0x4048('0x17'),_0x5d86ee);logger['debug'](_0x4048('0x17'),_0x5d86ee,JSON[_0x4048('0x11')](_0x1e98c1));_0x53cbc5(_0x1e98c1);})[_0x4048('0x16')](function(_0x1b1e60){logger[_0x4048('0x12')](_0x4048('0x17'),_0x1b1e60[_0x4048('0x14')],_0x5d86ee);_0x8df463(_0x361da5['error'](0x1f4,_0x1b1e60[_0x4048('0x14')]));});});}; \ No newline at end of file +var _0x070b=['options','raw','where','attributes','include','model','map','then','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc'];(function(_0x2d8434,_0x43d781){var _0x26b9e4=function(_0x54f5b8){while(--_0x54f5b8){_0x2d8434['push'](_0x2d8434['shift']());}};_0x26b9e4(++_0x43d781);}(_0x070b,0x18e));var _0xb070=function(_0x4cc2c5,_0x1aa91f){_0x4cc2c5=_0x4cc2c5-0x0;var _0x478c39=_0x070b[_0x4cc2c5];return _0x478c39;};'use strict';var _=require(_0xb070('0x0'));var util=require(_0xb070('0x1'));var moment=require(_0xb070('0x2'));var BPromise=require('bluebird');var rs=require(_0xb070('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb070('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb070('0x5'))(_0xb070('0x6'));var config=require(_0xb070('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb070('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37e3fb,_0x3b209c,_0x367e1b){return new BPromise(function(_0x2e8712,_0x596d43){return client[_0xb070('0x9')](_0x37e3fb,_0x367e1b)['then'](function(_0x318227){logger[_0xb070('0xa')](_0xb070('0xb'),_0x3b209c,_0xb070('0xc'));logger[_0xb070('0xd')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x3b209c,_0xb070('0xc'),JSON[_0xb070('0xe')](_0x318227));if(_0x318227[_0xb070('0xf')]){if(_0x318227[_0xb070('0xf')][_0xb070('0x10')]===0x1f4){logger[_0xb070('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x3b209c,_0x318227[_0xb070('0xf')]['message']);return _0x596d43(_0x318227[_0xb070('0xf')][_0xb070('0x11')]);}logger[_0xb070('0xf')](_0xb070('0xb'),_0x3b209c,_0x318227[_0xb070('0xf')][_0xb070('0x11')]);return _0x2e8712(_0x318227[_0xb070('0xf')][_0xb070('0x11')]);}else{logger[_0xb070('0xa')](_0xb070('0xb'),_0x3b209c,'request\x20sent');_0x2e8712(_0x318227[_0xb070('0x12')][_0xb070('0x11')]);}})[_0xb070('0x13')](function(_0x5bce7e){logger[_0xb070('0xf')](_0xb070('0xb'),_0x3b209c,_0x5bce7e);_0x596d43(_0x5bce7e);});});}exports[_0xb070('0x14')]=function(_0x15550f){var _0x5b0c21=this;return new Promise(function(_0x1a4c29,_0x3601dc){return db[_0xb070('0x15')]['find']({'raw':_0x15550f['options']?_0x15550f[_0xb070('0x16')][_0xb070('0x17')]===undefined?!![]:![]:!![],'where':_0x15550f['options']?_0x15550f[_0xb070('0x16')][_0xb070('0x18')]||null:null,'attributes':_0x15550f[_0xb070('0x16')]?_0x15550f[_0xb070('0x16')][_0xb070('0x19')]||null:null,'include':_0x15550f['options']?_0x15550f[_0xb070('0x16')][_0xb070('0x1a')]?_['map'](_0x15550f[_0xb070('0x16')]['include'],function(_0x20e716){return{'model':db[_0x20e716[_0xb070('0x1b')]],'as':_0x20e716['as'],'attributes':_0x20e716[_0xb070('0x19')],'include':_0x20e716[_0xb070('0x1a')]?_[_0xb070('0x1c')](_0x20e716[_0xb070('0x1a')],function(_0x575a98){return{'model':db[_0x575a98[_0xb070('0x1b')]],'as':_0x575a98['as'],'attributes':_0x575a98[_0xb070('0x19')],'include':_0x575a98['include']?_[_0xb070('0x1c')](_0x575a98[_0xb070('0x1a')],function(_0x46c353){return{'model':db[_0x46c353[_0xb070('0x1b')]],'as':_0x46c353['as'],'attributes':_0x46c353['attributes']};}):[]};}):[]};}):[]:[]})[_0xb070('0x1d')](function(_0x350453){logger[_0xb070('0xa')](_0xb070('0x14'),_0x15550f);logger['debug'](_0xb070('0x14'),_0x15550f,JSON['stringify'](_0x350453));_0x1a4c29(_0x350453);})[_0xb070('0x13')](function(_0xe93f79){logger[_0xb070('0xf')](_0xb070('0x14'),_0xe93f79[_0xb070('0x11')],_0x15550f);_0x3601dc(_0x5b0c21[_0xb070('0xf')](0x1f4,_0xe93f79[_0xb070('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 9ebabfc..44790b8 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 _0x71af=['isAuthenticated','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','get','show','post'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x71af,0x115));var _0xf71a=function(_0x116243,_0x5c6473){_0x116243=_0x116243-0x0;var _0x3a8bff=_0x71af[_0x116243];return _0x3a8bff;};'use strict';var multer=require(_0xf71a('0x0'));var util=require(_0xf71a('0x1'));var path=require(_0xf71a('0x2'));var timeout=require(_0xf71a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf71a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf71a('0x5'));var config=require(_0xf71a('0x6'));var controller=require(_0xf71a('0x7'));router[_0xf71a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf71a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf71a('0x9')]);router[_0xf71a('0xa')]('/',auth[_0xf71a('0xb')](),controller[_0xf71a('0xc')]);router[_0xf71a('0xd')](_0xf71a('0xe'),auth[_0xf71a('0xb')](),controller[_0xf71a('0xf')]);router[_0xf71a('0x10')]('/:id',auth[_0xf71a('0xb')](),controller[_0xf71a('0x11')]);module['exports']=router; \ No newline at end of file +var _0xd617=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','path'];(function(_0x405aea,_0x21cb59){var _0x5585e0=function(_0x51bc49){while(--_0x51bc49){_0x405aea['push'](_0x405aea['shift']());}};_0x5585e0(++_0x21cb59);}(_0xd617,0x197));var _0x7d61=function(_0x23eaf7,_0x314847){_0x23eaf7=_0x23eaf7-0x0;var _0x448018=_0xd617[_0x23eaf7];return _0x448018;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7d61('0x0'));var timeout=require(_0x7d61('0x1'));var express=require(_0x7d61('0x2'));var router=express[_0x7d61('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7d61('0x4'));var interaction=require(_0x7d61('0x5'));var config=require('../../config/environment');var controller=require(_0x7d61('0x6'));router[_0x7d61('0x7')]('/',auth[_0x7d61('0x8')](),controller[_0x7d61('0x9')]);router[_0x7d61('0x7')](_0x7d61('0xa'),auth[_0x7d61('0x8')](),controller[_0x7d61('0xb')]);router[_0x7d61('0xc')]('/',auth[_0x7d61('0x8')](),controller['create']);router[_0x7d61('0xd')](_0x7d61('0xa'),auth[_0x7d61('0x8')](),controller[_0x7d61('0xe')]);router[_0x7d61('0xf')](_0x7d61('0xa'),auth[_0x7d61('0x8')](),controller['destroy']);module[_0x7d61('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index ab361a3..8b49674 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 _0x2539=['exports','BLOB','preproduction','getDataValue','toString','long','production','utf8','DATE'];(function(_0x1896d2,_0x38e977){var _0xd06e7=function(_0x2ef043){while(--_0x2ef043){_0x1896d2['push'](_0x1896d2['shift']());}};_0xd06e7(++_0x38e977);}(_0x2539,0x1e6));var _0x9253=function(_0x621d18,_0x52fd00){_0x621d18=_0x621d18-0x0;var _0x2a9400=_0x2539[_0x621d18];return _0x2a9400;};'use strict';var Sequelize=require('sequelize');module[_0x9253('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x9253('0x1')]('long'),'get':function(){if(this['getDataValue'](_0x9253('0x2'))){return this[_0x9253('0x3')](_0x9253('0x2'))[_0x9253('0x4')]('utf8');}}},'production':{'type':Sequelize[_0x9253('0x1')](_0x9253('0x5')),'get':function(){if(this[_0x9253('0x3')]('production')){return this[_0x9253('0x3')](_0x9253('0x6'))['toString'](_0x9253('0x7'));}}},'savedAt':{'type':Sequelize[_0x9253('0x8')]},'publishedAt':{'type':Sequelize[_0x9253('0x8')]}}; \ No newline at end of file +var _0xc1ec=['preproduction','utf8','production','toString','DATE','sequelize','exports','STRING','TEXT','BLOB','long','getDataValue'];(function(_0x980531,_0x2667ad){var _0x447e42=function(_0x221792){while(--_0x221792){_0x980531['push'](_0x980531['shift']());}};_0x447e42(++_0x2667ad);}(_0xc1ec,0x13d));var _0xcc1e=function(_0x29621f,_0x59e7e1){_0x29621f=_0x29621f-0x0;var _0x54e0e5=_0xc1ec[_0x29621f];return _0x54e0e5;};'use strict';var Sequelize=require(_0xcc1e('0x0'));module[_0xcc1e('0x1')]={'name':{'type':Sequelize[_0xcc1e('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xcc1e('0x2')]},'notes':{'type':Sequelize[_0xcc1e('0x3')]},'preproduction':{'type':Sequelize[_0xcc1e('0x4')](_0xcc1e('0x5')),'get':function(){if(this[_0xcc1e('0x6')]('preproduction')){return this['getDataValue'](_0xcc1e('0x7'))['toString'](_0xcc1e('0x8'));}}},'production':{'type':Sequelize[_0xcc1e('0x4')](_0xcc1e('0x5')),'get':function(){if(this[_0xcc1e('0x6')](_0xcc1e('0x9'))){return this[_0xcc1e('0x6')](_0xcc1e('0x9'))[_0xcc1e('0xa')](_0xcc1e('0x8'));}}},'savedAt':{'type':Sequelize[_0xcc1e('0xb')]},'publishedAt':{'type':Sequelize[_0xcc1e('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index a6478bb..5731515 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 _0x82ba=['find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','stringify','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','SquareProjects','UserProfileResource','publish','agi','end','sendStatus','error','stack','name','send','index','map','fieldName','type','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','SquareProject','includeAll','include','rows','catch','rawAttributes'];(function(_0x11720a,_0xb04a05){var _0x13cdd5=function(_0x47d14f){while(--_0x47d14f){_0x11720a['push'](_0x11720a['shift']());}};_0x13cdd5(++_0xb04a05);}(_0x82ba,0xea));var _0xa82b=function(_0x4211ac,_0x42ed02){_0x4211ac=_0x4211ac-0x0;var _0x2d3c64=_0x82ba[_0x4211ac];return _0x2d3c64;};'use strict';var _=require(_0xa82b('0x0'));var Redis=require(_0xa82b('0x1'));var qs=require(_0xa82b('0x2'));var logger=require(_0xa82b('0x3'))(_0xa82b('0x4'));var config=require(_0xa82b('0x5'));var db=require(_0xa82b('0x6'))['db'];config[_0xa82b('0x7')]=_[_0xa82b('0x8')](config['redis'],{'host':_0xa82b('0x9'),'port':0x18eb});var socket=require(_0xa82b('0xa'))(new Redis(config[_0xa82b('0x7')]));require(_0xa82b('0xb'))[_0xa82b('0xc')](socket);function respondWithResult(_0x1dfdef,_0x3d151a){_0x3d151a=_0x3d151a||0xc8;return function(_0x4d1fb8){if(_0x4d1fb8){return _0x1dfdef[_0xa82b('0xd')](_0x3d151a)[_0xa82b('0xe')](_0x4d1fb8);}};}function respondWithFilteredResult(_0x347ed4,_0x2dd22e){return function(_0x4ad31b){if(_0x4ad31b){var _0xf25e5c=typeof _0x2dd22e[_0xa82b('0xf')]===_0xa82b('0x10')&&typeof _0x2dd22e['limit']===_0xa82b('0x10');var _0xcdcab7=_0x4ad31b[_0xa82b('0x11')];var _0xd61cbf=_0xf25e5c?0x0:_0x2dd22e[_0xa82b('0xf')];var _0x1f1072=_0xf25e5c?_0x4ad31b[_0xa82b('0x11')]:_0x2dd22e[_0xa82b('0xf')]+_0x2dd22e[_0xa82b('0x12')];var _0x12f818;if(_0x1f1072>=_0xcdcab7){_0x1f1072=_0xcdcab7;_0x12f818=0xc8;}else{_0x12f818=0xce;}_0x347ed4['status'](_0x12f818);return _0x347ed4[_0xa82b('0x13')](_0xa82b('0x14'),_0xd61cbf+'-'+_0x1f1072+'/'+_0xcdcab7)[_0xa82b('0xe')](_0x4ad31b);}return null;};}function saveUpdates(_0x461a14){return function(_0x2ed5e7){if(_0x2ed5e7){return _0x2ed5e7[_0xa82b('0x15')](_0x461a14)[_0xa82b('0x16')](function(_0xbccd3c){return _0xbccd3c;});}return null;};}function removeEntity(_0x2ab762){return function(_0x4cf348){if(_0x4cf348){return _0x4cf348[_0xa82b('0x17')]()[_0xa82b('0x16')](function(){var _0x40d132=_0x4cf348[_0xa82b('0x18')]({'plain':!![]});var _0x1111b2=_0xa82b('0x19');return db[_0xa82b('0x1a')][_0xa82b('0x17')]({'where':{'type':_0x1111b2,'resourceId':_0x40d132['id']}})[_0xa82b('0x16')](function(){return _0x4cf348;});})['then'](function(){var _0x25a616=new Redis(config[_0xa82b('0x7')]);_0x25a616[_0xa82b('0x1b')](_0xa82b('0x1c'),JSON['stringify']({'id':_0x4cf348['id'],'deleted':!![]}));})[_0xa82b('0x16')](function(){_0x2ab762['status'](0xcc)[_0xa82b('0x1d')]();});}};}function handleEntityNotFound(_0x24c3a2){return function(_0x6ed59c){if(!_0x6ed59c){_0x24c3a2[_0xa82b('0x1e')](0x194);}return _0x6ed59c;};}function handleError(_0x1f03f4,_0x40f327){_0x40f327=_0x40f327||0x1f4;return function(_0x2c53e3){logger[_0xa82b('0x1f')](_0x2c53e3[_0xa82b('0x20')]);if(_0x2c53e3[_0xa82b('0x21')]){delete _0x2c53e3['name'];}_0x1f03f4[_0xa82b('0xd')](_0x40f327)[_0xa82b('0x22')](_0x2c53e3);};}exports[_0xa82b('0x23')]=function(_0x2166ec,_0x305c5a){var _0xbd9ee7={},_0xb904a5={},_0x169bd9={'count':0x0,'rows':[]};var _0x5646b0=_[_0xa82b('0x24')](db['SquareProject']['rawAttributes'],function(_0x46943d){return{'name':_0x46943d[_0xa82b('0x25')],'type':_0x46943d[_0xa82b('0x26')]['key']};});_0xb904a5['model']=_['map'](_0x5646b0,_0xa82b('0x21'));_0xb904a5[_0xa82b('0x27')]=_[_0xa82b('0x28')](_0x2166ec['query']);_0xb904a5['filters']=_[_0xa82b('0x29')](_0xb904a5[_0xa82b('0x2a')],_0xb904a5[_0xa82b('0x27')]);_0xbd9ee7[_0xa82b('0x2b')]=_[_0xa82b('0x29')](_0xb904a5['model'],qs[_0xa82b('0x2c')](_0x2166ec[_0xa82b('0x27')][_0xa82b('0x2c')]));_0xbd9ee7[_0xa82b('0x2b')]=_0xbd9ee7['attributes'][_0xa82b('0x2d')]?_0xbd9ee7[_0xa82b('0x2b')]:_0xb904a5[_0xa82b('0x2a')];if(!_0x2166ec['query']['hasOwnProperty'](_0xa82b('0x2e'))){_0xbd9ee7[_0xa82b('0x12')]=qs['limit'](_0x2166ec[_0xa82b('0x27')][_0xa82b('0x12')]);_0xbd9ee7[_0xa82b('0xf')]=qs['offset'](_0x2166ec[_0xa82b('0x27')]['offset']);}_0xbd9ee7[_0xa82b('0x2f')]=qs[_0xa82b('0x30')](_0x2166ec['query'][_0xa82b('0x30')]);_0xbd9ee7[_0xa82b('0x31')]=qs[_0xa82b('0x32')](_[_0xa82b('0x33')](_0x2166ec[_0xa82b('0x27')],_0xb904a5[_0xa82b('0x32')]),_0x5646b0);if(_0x2166ec[_0xa82b('0x27')][_0xa82b('0x34')]){_0xbd9ee7['where']=_['merge'](_0xbd9ee7['where'],{'$or':_[_0xa82b('0x24')](_0x5646b0,function(_0x437afa){if(_0x437afa[_0xa82b('0x26')]!==_0xa82b('0x35')){var _0x55562a={};_0x55562a[_0x437afa['name']]={'$like':'%'+_0x2166ec[_0xa82b('0x27')][_0xa82b('0x34')]+'%'};return _0x55562a;}})});}_0xbd9ee7=_[_0xa82b('0x36')]({},_0xbd9ee7,_0x2166ec[_0xa82b('0x37')]);var _0x1f5bb6={'where':_0xbd9ee7['where']};return db[_0xa82b('0x38')][_0xa82b('0x11')](_0x1f5bb6)['then'](function(_0x5d0e13){_0x169bd9[_0xa82b('0x11')]=_0x5d0e13;if(_0x2166ec[_0xa82b('0x27')][_0xa82b('0x39')]){_0xbd9ee7[_0xa82b('0x3a')]=[{'all':!![]}];}return db[_0xa82b('0x38')]['findAll'](_0xbd9ee7);})['then'](function(_0x5131df){_0x169bd9[_0xa82b('0x3b')]=_0x5131df;return _0x169bd9;})['then'](respondWithFilteredResult(_0x305c5a,_0xbd9ee7))[_0xa82b('0x3c')](handleError(_0x305c5a,null));};exports['show']=function(_0x32590c,_0x16eacf){var _0x533300={'raw':![],'where':{'id':_0x32590c['params']['id']}},_0x3dc72c={};_0x3dc72c[_0xa82b('0x2a')]=_[_0xa82b('0x28')](db[_0xa82b('0x38')][_0xa82b('0x3d')]);_0x3dc72c[_0xa82b('0x27')]=_[_0xa82b('0x28')](_0x32590c[_0xa82b('0x27')]);_0x3dc72c['filters']=_[_0xa82b('0x29')](_0x3dc72c[_0xa82b('0x2a')],_0x3dc72c[_0xa82b('0x27')]);_0x533300[_0xa82b('0x2b')]=_[_0xa82b('0x29')](_0x3dc72c[_0xa82b('0x2a')],qs['fields'](_0x32590c['query']['fields']));_0x533300[_0xa82b('0x2b')]=_0x533300[_0xa82b('0x2b')][_0xa82b('0x2d')]?_0x533300[_0xa82b('0x2b')]:_0x3dc72c[_0xa82b('0x2a')];if(_0x32590c[_0xa82b('0x27')]['includeAll']){_0x533300[_0xa82b('0x3a')]=[{'all':!![]}];}_0x533300=_[_0xa82b('0x36')]({},_0x533300,_0x32590c[_0xa82b('0x37')]);return db['SquareProject'][_0xa82b('0x3e')](_0x533300)[_0xa82b('0x16')](handleEntityNotFound(_0x16eacf,null))[_0xa82b('0x16')](respondWithResult(_0x16eacf,null))[_0xa82b('0x3c')](handleError(_0x16eacf,null));};exports[_0xa82b('0x3f')]=function(_0xf284b0,_0x4abd7a){return db[_0xa82b('0x38')][_0xa82b('0x3f')](_0xf284b0[_0xa82b('0x40')],{})['then'](function(_0x1d8dc4){var _0x3830d3=_0xf284b0['user'][_0xa82b('0x18')]({'plain':!![]});if(!_0x3830d3)throw new Error(_0xa82b('0x41'));if(_0x3830d3[_0xa82b('0x42')]===_0xa82b('0x43')){var _0x3f1d39=_0x1d8dc4[_0xa82b('0x18')]({'plain':!![]});var _0x1d4257=_0xa82b('0x19');return db[_0xa82b('0x44')]['find']({'where':{'name':_0x1d4257,'userProfileId':_0x3830d3[_0xa82b('0x45')]},'raw':!![]})[_0xa82b('0x16')](function(_0x17f329){if(_0x17f329&&_0x17f329[_0xa82b('0x46')]===0x0){return db[_0xa82b('0x1a')][_0xa82b('0x3f')]({'name':_0x3f1d39[_0xa82b('0x21')],'resourceId':_0x3f1d39['id'],'type':_0x17f329[_0xa82b('0x21')],'sectionId':_0x17f329['id']},{})['then'](function(){return _0x1d8dc4;});}else{return _0x1d8dc4;}})[_0xa82b('0x3c')](function(_0x17dd52){logger['error'](_0xa82b('0x47'),_0x17dd52);throw _0x17dd52;});}return _0x1d8dc4;})[_0xa82b('0x16')](respondWithResult(_0x4abd7a,0xc9))[_0xa82b('0x3c')](handleError(_0x4abd7a,null));};exports[_0xa82b('0x15')]=function(_0x4034ed,_0x515f9a){if(_0x4034ed[_0xa82b('0x40')]['id']){delete _0x4034ed[_0xa82b('0x40')]['id'];}return db[_0xa82b('0x38')][_0xa82b('0x3e')]({'where':{'id':_0x4034ed['params']['id']}})[_0xa82b('0x16')](handleEntityNotFound(_0x515f9a,null))[_0xa82b('0x16')](saveUpdates(_0x4034ed[_0xa82b('0x40')],null))['then'](function(_0x30f59f){if(!_0x30f59f)return;var _0x3cf7b2=_0x30f59f[_0xa82b('0x18')]({'plain':!![]});return _0x3cf7b2;})[_0xa82b('0x16')](function(_0x179f26){var _0xb9566b=new Redis(config['redis']);_0xb9566b[_0xa82b('0x1b')](_0xa82b('0x1c'),JSON[_0xa82b('0x48')](_[_0xa82b('0x33')](_0x179f26,['id',_0xa82b('0x21'),_0xa82b('0x49')])));return _0x179f26;})[_0xa82b('0x16')](respondWithResult(_0x515f9a,null))['catch'](handleError(_0x515f9a,null));};exports[_0xa82b('0x17')]=function(_0x524a45,_0x3d8f13){return db[_0xa82b('0x38')]['find']({'where':{'id':_0x524a45['params']['id']}})[_0xa82b('0x16')](handleEntityNotFound(_0x3d8f13,null))[_0xa82b('0x16')](removeEntity(_0x3d8f13,null))[_0xa82b('0x3c')](handleError(_0x3d8f13,null));}; \ No newline at end of file +var _0x3564=['production','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','redis','defaults','socket.io-emitter','./squareProject.socket','status','json','offset','undefined','limit','count','set','Content-Range','update','then','get','SquareProjects','destroy','publish','agi','stringify','sendStatus','error','name','send','index','map','SquareProject','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','params','rawAttributes','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x1d54c4,_0x1fb650){var _0x51539c=function(_0x491438){while(--_0x491438){_0x1d54c4['push'](_0x1d54c4['shift']());}};_0x51539c(++_0x1fb650);}(_0x3564,0x87));var _0x4356=function(_0x24b571,_0x35517a){_0x24b571=_0x24b571-0x0;var _0x2da88f=_0x3564[_0x24b571];return _0x2da88f;};'use strict';var _=require(_0x4356('0x0'));var Redis=require(_0x4356('0x1'));var qs=require(_0x4356('0x2'));var logger=require(_0x4356('0x3'))(_0x4356('0x4'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x4356('0x5')]=_[_0x4356('0x6')](config[_0x4356('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x4356('0x7'))(new Redis(config[_0x4356('0x5')]));require(_0x4356('0x8'))['register'](socket);function respondWithResult(_0x51f3db,_0x11a851){_0x11a851=_0x11a851||0xc8;return function(_0x3c37b4){if(_0x3c37b4){return _0x51f3db[_0x4356('0x9')](_0x11a851)[_0x4356('0xa')](_0x3c37b4);}};}function respondWithFilteredResult(_0x2354c0,_0x3cc77c){return function(_0x3fc95f){if(_0x3fc95f){var _0x6b5906=typeof _0x3cc77c[_0x4356('0xb')]===_0x4356('0xc')&&typeof _0x3cc77c[_0x4356('0xd')]===_0x4356('0xc');var _0x2e2b71=_0x3fc95f['count'];var _0x5561ba=_0x6b5906?0x0:_0x3cc77c[_0x4356('0xb')];var _0x3f7058=_0x6b5906?_0x3fc95f[_0x4356('0xe')]:_0x3cc77c[_0x4356('0xb')]+_0x3cc77c['limit'];var _0x2c3de5;if(_0x3f7058>=_0x2e2b71){_0x3f7058=_0x2e2b71;_0x2c3de5=0xc8;}else{_0x2c3de5=0xce;}_0x2354c0['status'](_0x2c3de5);return _0x2354c0[_0x4356('0xf')](_0x4356('0x10'),_0x5561ba+'-'+_0x3f7058+'/'+_0x2e2b71)[_0x4356('0xa')](_0x3fc95f);}return null;};}function saveUpdates(_0x1c136a){return function(_0xd817ab){if(_0xd817ab){return _0xd817ab[_0x4356('0x11')](_0x1c136a)[_0x4356('0x12')](function(_0x41a8c4){return _0x41a8c4;});}return null;};}function removeEntity(_0x3ad1ae){return function(_0x2317ae){if(_0x2317ae){return _0x2317ae['destroy']()[_0x4356('0x12')](function(){var _0x3f9a4b=_0x2317ae[_0x4356('0x13')]({'plain':!![]});var _0x3181da=_0x4356('0x14');return db['UserProfileResource'][_0x4356('0x15')]({'where':{'type':_0x3181da,'resourceId':_0x3f9a4b['id']}})[_0x4356('0x12')](function(){return _0x2317ae;});})['then'](function(){var _0x343d4a=new Redis(config[_0x4356('0x5')]);_0x343d4a[_0x4356('0x16')](_0x4356('0x17'),JSON[_0x4356('0x18')]({'id':_0x2317ae['id'],'deleted':!![]}));})[_0x4356('0x12')](function(){_0x3ad1ae['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x57d602){return function(_0x4bcb91){if(!_0x4bcb91){_0x57d602[_0x4356('0x19')](0x194);}return _0x4bcb91;};}function handleError(_0x1ed0de,_0x994c76){_0x994c76=_0x994c76||0x1f4;return function(_0x462806){logger[_0x4356('0x1a')](_0x462806['stack']);if(_0x462806[_0x4356('0x1b')]){delete _0x462806[_0x4356('0x1b')];}_0x1ed0de[_0x4356('0x9')](_0x994c76)[_0x4356('0x1c')](_0x462806);};}exports[_0x4356('0x1d')]=function(_0xe05f00,_0x442657){var _0x40dfb6={},_0x341acd={},_0x680e48={'count':0x0,'rows':[]};var _0x5654ac=_[_0x4356('0x1e')](db[_0x4356('0x1f')]['rawAttributes'],function(_0x2170f7){return{'name':_0x2170f7[_0x4356('0x20')],'type':_0x2170f7[_0x4356('0x21')][_0x4356('0x22')]};});_0x341acd['model']=_[_0x4356('0x1e')](_0x5654ac,'name');_0x341acd[_0x4356('0x23')]=_[_0x4356('0x24')](_0xe05f00['query']);_0x341acd[_0x4356('0x25')]=_[_0x4356('0x26')](_0x341acd['model'],_0x341acd[_0x4356('0x23')]);_0x40dfb6[_0x4356('0x27')]=_[_0x4356('0x26')](_0x341acd[_0x4356('0x28')],qs[_0x4356('0x29')](_0xe05f00['query']['fields']));_0x40dfb6['attributes']=_0x40dfb6['attributes'][_0x4356('0x2a')]?_0x40dfb6[_0x4356('0x27')]:_0x341acd['model'];if(!_0xe05f00['query'][_0x4356('0x2b')]('nolimit')){_0x40dfb6[_0x4356('0xd')]=qs[_0x4356('0xd')](_0xe05f00['query']['limit']);_0x40dfb6[_0x4356('0xb')]=qs[_0x4356('0xb')](_0xe05f00[_0x4356('0x23')]['offset']);}_0x40dfb6['order']=qs[_0x4356('0x2c')](_0xe05f00[_0x4356('0x23')][_0x4356('0x2c')]);_0x40dfb6[_0x4356('0x2d')]=qs['filters'](_[_0x4356('0x2e')](_0xe05f00[_0x4356('0x23')],_0x341acd[_0x4356('0x25')]),_0x5654ac);if(_0xe05f00['query'][_0x4356('0x2f')]){_0x40dfb6[_0x4356('0x2d')]=_[_0x4356('0x30')](_0x40dfb6[_0x4356('0x2d')],{'$or':_['map'](_0x5654ac,function(_0x3efc00){if(_0x3efc00[_0x4356('0x21')]!==_0x4356('0x31')){var _0x508d79={};_0x508d79[_0x3efc00[_0x4356('0x1b')]]={'$like':'%'+_0xe05f00[_0x4356('0x23')][_0x4356('0x2f')]+'%'};return _0x508d79;}})});}_0x40dfb6=_['merge']({},_0x40dfb6,_0xe05f00[_0x4356('0x32')]);var _0x3cc276={'where':_0x40dfb6[_0x4356('0x2d')]};return db[_0x4356('0x1f')][_0x4356('0xe')](_0x3cc276)['then'](function(_0x3ea48a){_0x680e48[_0x4356('0xe')]=_0x3ea48a;if(_0xe05f00[_0x4356('0x23')][_0x4356('0x33')]){_0x40dfb6[_0x4356('0x34')]=[{'all':!![]}];}return db[_0x4356('0x1f')]['findAll'](_0x40dfb6);})[_0x4356('0x12')](function(_0x4303a7){_0x680e48['rows']=_0x4303a7;return _0x680e48;})[_0x4356('0x12')](respondWithFilteredResult(_0x442657,_0x40dfb6))[_0x4356('0x35')](handleError(_0x442657,null));};exports['show']=function(_0x3bb7dc,_0x3626b0){var _0x4d3be4={'raw':![],'where':{'id':_0x3bb7dc[_0x4356('0x36')]['id']}},_0x403ff4={};_0x403ff4[_0x4356('0x28')]=_[_0x4356('0x24')](db[_0x4356('0x1f')][_0x4356('0x37')]);_0x403ff4['query']=_[_0x4356('0x24')](_0x3bb7dc[_0x4356('0x23')]);_0x403ff4[_0x4356('0x25')]=_['intersection'](_0x403ff4[_0x4356('0x28')],_0x403ff4[_0x4356('0x23')]);_0x4d3be4[_0x4356('0x27')]=_[_0x4356('0x26')](_0x403ff4['model'],qs[_0x4356('0x29')](_0x3bb7dc['query'][_0x4356('0x29')]));_0x4d3be4[_0x4356('0x27')]=_0x4d3be4['attributes'][_0x4356('0x2a')]?_0x4d3be4[_0x4356('0x27')]:_0x403ff4[_0x4356('0x28')];if(_0x3bb7dc[_0x4356('0x23')][_0x4356('0x33')]){_0x4d3be4[_0x4356('0x34')]=[{'all':!![]}];}_0x4d3be4=_[_0x4356('0x30')]({},_0x4d3be4,_0x3bb7dc[_0x4356('0x32')]);return db[_0x4356('0x1f')][_0x4356('0x38')](_0x4d3be4)[_0x4356('0x12')](handleEntityNotFound(_0x3626b0,null))['then'](respondWithResult(_0x3626b0,null))[_0x4356('0x35')](handleError(_0x3626b0,null));};exports['create']=function(_0x4ee983,_0x5d512d){return db['SquareProject'][_0x4356('0x39')](_0x4ee983[_0x4356('0x3a')],{})[_0x4356('0x12')](function(_0x4c5bad){var _0x5221c8=_0x4ee983['user'][_0x4356('0x13')]({'plain':!![]});if(!_0x5221c8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5221c8[_0x4356('0x3b')]===_0x4356('0x3c')){var _0x234ea1=_0x4c5bad['get']({'plain':!![]});var _0x40566d=_0x4356('0x14');return db[_0x4356('0x3d')]['find']({'where':{'name':_0x40566d,'userProfileId':_0x5221c8[_0x4356('0x3e')]},'raw':!![]})['then'](function(_0x25cacb){if(_0x25cacb&&_0x25cacb[_0x4356('0x3f')]===0x0){return db[_0x4356('0x40')]['create']({'name':_0x234ea1['name'],'resourceId':_0x234ea1['id'],'type':_0x25cacb[_0x4356('0x1b')],'sectionId':_0x25cacb['id']},{})[_0x4356('0x12')](function(){return _0x4c5bad;});}else{return _0x4c5bad;}})['catch'](function(_0x3c6a4e){logger['error'](_0x4356('0x41'),_0x3c6a4e);throw _0x3c6a4e;});}return _0x4c5bad;})[_0x4356('0x12')](respondWithResult(_0x5d512d,0xc9))[_0x4356('0x35')](handleError(_0x5d512d,null));};exports[_0x4356('0x11')]=function(_0x42a27d,_0x574559){if(_0x42a27d[_0x4356('0x3a')]['id']){delete _0x42a27d[_0x4356('0x3a')]['id'];}return db[_0x4356('0x1f')][_0x4356('0x38')]({'where':{'id':_0x42a27d[_0x4356('0x36')]['id']}})['then'](handleEntityNotFound(_0x574559,null))[_0x4356('0x12')](saveUpdates(_0x42a27d[_0x4356('0x3a')],null))[_0x4356('0x12')](function(_0x524f41){if(!_0x524f41)return;var _0x541e05=_0x524f41[_0x4356('0x13')]({'plain':!![]});return _0x541e05;})[_0x4356('0x12')](function(_0xa134a1){var _0x4c35d9=new Redis(config['redis']);_0x4c35d9['publish'](_0x4356('0x17'),JSON[_0x4356('0x18')](_[_0x4356('0x2e')](_0xa134a1,['id',_0x4356('0x1b'),_0x4356('0x42')])));return _0xa134a1;})[_0x4356('0x12')](respondWithResult(_0x574559,null))[_0x4356('0x35')](handleError(_0x574559,null));};exports[_0x4356('0x15')]=function(_0x453fc9,_0x209aa8){return db[_0x4356('0x1f')][_0x4356('0x38')]({'where':{'id':_0x453fc9[_0x4356('0x36')]['id']}})[_0x4356('0x12')](handleEntityNotFound(_0x209aa8,null))[_0x4356('0x12')](removeEntity(_0x209aa8,null))[_0x4356('0x35')](handleError(_0x209aa8,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index f59dfe8..5a7fb5f 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 _0xc92d=['setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb','SquareProject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc92d,0xd5));var _0xdc92=function(_0x445b52,_0x1325fd){_0x445b52=_0x445b52-0x0;var _0x38a47c=_0xc92d[_0x445b52];return _0x38a47c;};'use strict';var EventEmitter=require(_0xdc92('0x0'));var SquareProject=require(_0xdc92('0x1'))['db'][_0xdc92('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xdc92('0x3')](0x0);var events={'afterCreate':_0xdc92('0x4'),'afterUpdate':_0xdc92('0x5'),'afterDestroy':_0xdc92('0x6')};function emitEvent(_0x5950ce){return function(_0x1fd9a9,_0x50fa86,_0x14e175){SquareProjectEvents[_0xdc92('0x7')](_0x5950ce+':'+_0x1fd9a9['id'],_0x1fd9a9);SquareProjectEvents[_0xdc92('0x7')](_0x5950ce,_0x1fd9a9);_0x14e175(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xdc92('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x03b1=['SquareProject','setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x3a18f3,_0xa6b079){var _0x431120=function(_0x3ce96e){while(--_0x3ce96e){_0x3a18f3['push'](_0x3a18f3['shift']());}};_0x431120(++_0xa6b079);}(_0x03b1,0xdf));var _0x103b=function(_0x6d9060,_0x2e7efb){_0x6d9060=_0x6d9060-0x0;var _0xd9145=_0x03b1[_0x6d9060];return _0xd9145;};'use strict';var EventEmitter=require(_0x103b('0x0'));var SquareProject=require(_0x103b('0x1'))['db'][_0x103b('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x103b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x103b('0x4'),'afterDestroy':_0x103b('0x5')};function emitEvent(_0x2be8fd){return function(_0x47ff41,_0x38722a,_0x2627dd){SquareProjectEvents['emit'](_0x2be8fd+':'+_0x47ff41['id'],_0x47ff41);SquareProjectEvents[_0x103b('0x6')](_0x2be8fd,_0x47ff41);_0x2627dd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x103b('0x7')](e,emitEvent(event));}}module[_0x103b('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 bdd1535..47e6208 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 _0x4197=['api','moment','bluebird','request-promise','path','define','SquareProject','square_projects','preproduction','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x54f7e4,_0x1561bd){var _0x14227c=function(_0x4c0b9c){while(--_0x4c0b9c){_0x54f7e4['push'](_0x54f7e4['shift']());}};_0x14227c(++_0x1561bd);}(_0x4197,0x138));var _0x7419=function(_0x2d8868,_0x24ef33){_0x2d8868=_0x2d8868-0x0;var _0x321438=_0x4197[_0x2d8868];return _0x321438;};'use strict';var _=require(_0x7419('0x0'));var util=require(_0x7419('0x1'));var logger=require(_0x7419('0x2'))(_0x7419('0x3'));var moment=require(_0x7419('0x4'));var BPromise=require(_0x7419('0x5'));var rp=require(_0x7419('0x6'));var fs=require('fs');var path=require(_0x7419('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module['exports']=function(_0x2cf616,_0xe06e23){return _0x2cf616[_0x7419('0x8')](_0x7419('0x9'),attributes,{'tableName':_0x7419('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x331274,_0x4b9e86,_0x36fc41){if(_0x331274['changed'](_0x7419('0xb'))){_0x331274['savedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x331274[_0x7419('0xc')]('production')){_0x331274['publishedAt']=moment()[_0x7419('0xd')](_0x7419('0xe'));}_0x36fc41(null,_0x331274);}}});}; \ No newline at end of file +var _0x1a7a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','SquareProject','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','format','util'];(function(_0x182339,_0x275d88){var _0x7b27d=function(_0x54a080){while(--_0x54a080){_0x182339['push'](_0x182339['shift']());}};_0x7b27d(++_0x275d88);}(_0x1a7a,0x1ca));var _0xa1a7=function(_0x51f40e,_0x14e8ea){_0x51f40e=_0x51f40e-0x0;var _0xb37761=_0x1a7a[_0x51f40e];return _0xb37761;};'use strict';var _=require('lodash');var util=require(_0xa1a7('0x0'));var logger=require('../../config/logger')(_0xa1a7('0x1'));var moment=require(_0xa1a7('0x2'));var BPromise=require(_0xa1a7('0x3'));var rp=require(_0xa1a7('0x4'));var fs=require('fs');var path=require(_0xa1a7('0x5'));var rimraf=require(_0xa1a7('0x6'));var config=require(_0xa1a7('0x7'));var attributes=require('./squareProject.attributes');module['exports']=function(_0x232eb4,_0x1a7021){return _0x232eb4[_0xa1a7('0x8')](_0xa1a7('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4603ed,_0x12e9f5,_0x5d8284){if(_0x4603ed[_0xa1a7('0xa')](_0xa1a7('0xb'))){_0x4603ed[_0xa1a7('0xc')]=moment()['format'](_0xa1a7('0xd'));}if(_0x4603ed['changed'](_0xa1a7('0xe'))){_0x4603ed[_0xa1a7('0xf')]=moment()[_0xa1a7('0x10')](_0xa1a7('0xd'));}_0x5d8284(null,_0x4603ed);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 70c8b9c..cccc6ee 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 _0xb3a2=['../../config/logger','rpc','../../config/environment','redis','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','limit','include','model','map','then','info','stringify','catch','error','message','ShowSquareProject','find','debug','lodash','../../mysqldb'];(function(_0x3ddd5c,_0x31fff6){var _0xcdd6f9=function(_0x3e7b97){while(--_0x3e7b97){_0x3ddd5c['push'](_0x3ddd5c['shift']());}};_0xcdd6f9(++_0x31fff6);}(_0xb3a2,0x1a2));var _0x2b3a=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xb3a2[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0x2b3a('0x0'));var Redis=require('ioredis');var db=require(_0x2b3a('0x1'))['db'];var logger=require(_0x2b3a('0x2'))(_0x2b3a('0x3'));var config=require(_0x2b3a('0x4'));config[_0x2b3a('0x5')]=_['defaults'](config[_0x2b3a('0x5')],{'host':_0x2b3a('0x6'),'port':0x18eb});var socket=require(_0x2b3a('0x7'))(new Redis(config[_0x2b3a('0x5')]));require(_0x2b3a('0x8'))[_0x2b3a('0x9')](socket);exports[_0x2b3a('0xa')]=function(_0xd055a1){var _0x193a46=this;return new Promise(function(_0x18e361,_0x3bb95d){return db[_0x2b3a('0xb')][_0x2b3a('0xc')]({'raw':_0xd055a1['options']?_0xd055a1[_0x2b3a('0xd')][_0x2b3a('0xe')]===undefined?!![]:![]:!![],'where':_0xd055a1['options']?_0xd055a1[_0x2b3a('0xd')][_0x2b3a('0xf')]||null:null,'attributes':_0xd055a1[_0x2b3a('0xd')]?_0xd055a1[_0x2b3a('0xd')][_0x2b3a('0x10')]||null:null,'limit':_0xd055a1[_0x2b3a('0xd')]?_0xd055a1['options'][_0x2b3a('0x11')]||null:null,'include':_0xd055a1[_0x2b3a('0xd')]?_0xd055a1['options'][_0x2b3a('0x12')]?_['map'](_0xd055a1['options'][_0x2b3a('0x12')],function(_0x36678f){return{'model':db[_0x36678f[_0x2b3a('0x13')]],'as':_0x36678f['as'],'attributes':_0x36678f[_0x2b3a('0x10')],'include':_0x36678f[_0x2b3a('0x12')]?_[_0x2b3a('0x14')](_0x36678f['include'],function(_0xb941d1){return{'model':db[_0xb941d1['model']],'as':_0xb941d1['as'],'attributes':_0xb941d1[_0x2b3a('0x10')],'include':_0xb941d1[_0x2b3a('0x12')]?_[_0x2b3a('0x14')](_0xb941d1[_0x2b3a('0x12')],function(_0x340a8d){return{'model':db[_0x340a8d[_0x2b3a('0x13')]],'as':_0x340a8d['as'],'attributes':_0x340a8d[_0x2b3a('0x10')]};}):[]};}):[]};}):[]:[]})[_0x2b3a('0x15')](function(_0x3823ae){logger[_0x2b3a('0x16')](_0x2b3a('0xa'),_0xd055a1);logger['debug']('GetSquareProjects',_0xd055a1,JSON[_0x2b3a('0x17')](_0x3823ae));_0x18e361(_0x3823ae);})[_0x2b3a('0x18')](function(_0x4ce4c3){logger[_0x2b3a('0x19')](_0x2b3a('0xa'),_0x4ce4c3[_0x2b3a('0x1a')],_0xd055a1);_0x3bb95d(_0x193a46['error'](0x1f4,_0x4ce4c3[_0x2b3a('0x1a')]));});});};exports[_0x2b3a('0x1b')]=function(_0x4b6ef8){var _0x13725c=this;return new Promise(function(_0xabe357,_0x5bd6ac){return db[_0x2b3a('0xb')][_0x2b3a('0x1c')]({'raw':_0x4b6ef8[_0x2b3a('0xd')]?_0x4b6ef8[_0x2b3a('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0x4b6ef8[_0x2b3a('0xd')]?_0x4b6ef8['options']['where']||null:null,'attributes':_0x4b6ef8[_0x2b3a('0xd')]?_0x4b6ef8[_0x2b3a('0xd')][_0x2b3a('0x10')]||null:null,'include':_0x4b6ef8['options']?_0x4b6ef8[_0x2b3a('0xd')]['include']?_[_0x2b3a('0x14')](_0x4b6ef8['options'][_0x2b3a('0x12')],function(_0x130934){return{'model':db[_0x130934['model']],'as':_0x130934['as'],'attributes':_0x130934[_0x2b3a('0x10')],'include':_0x130934[_0x2b3a('0x12')]?_[_0x2b3a('0x14')](_0x130934['include'],function(_0x2f3cac){return{'model':db[_0x2f3cac[_0x2b3a('0x13')]],'as':_0x2f3cac['as'],'attributes':_0x2f3cac[_0x2b3a('0x10')],'include':_0x2f3cac[_0x2b3a('0x12')]?_[_0x2b3a('0x14')](_0x2f3cac[_0x2b3a('0x12')],function(_0x28f397){return{'model':db[_0x28f397[_0x2b3a('0x13')]],'as':_0x28f397['as'],'attributes':_0x28f397[_0x2b3a('0x10')]};}):[]};}):[]};}):[]:[]})[_0x2b3a('0x15')](function(_0x33feb8){logger[_0x2b3a('0x16')](_0x2b3a('0x1b'),_0x4b6ef8);logger[_0x2b3a('0x1d')](_0x2b3a('0x1b'),_0x4b6ef8,JSON[_0x2b3a('0x17')](_0x33feb8));_0xabe357(_0x33feb8);})['catch'](function(_0x55e221){logger['error'](_0x2b3a('0x1b'),_0x55e221['message'],_0x4b6ef8);_0x5bd6ac(_0x13725c[_0x2b3a('0x19')](0x1f4,_0x55e221[_0x2b3a('0x1a')]));});});}; \ No newline at end of file +var _0xc8d6=['limit','include','map','model','then','info','GetSquareProjects','catch','error','ShowSquareProject','find','raw','debug','stringify','message','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','defaults','localhost','socket.io-emitter','redis','./squareProject.socket','register','findAll','options','where','attributes'];(function(_0x305b20,_0x5e57e9){var _0x26d64a=function(_0x2e17f0){while(--_0x2e17f0){_0x305b20['push'](_0x305b20['shift']());}};_0x26d64a(++_0x5e57e9);}(_0xc8d6,0x87));var _0x6c8d=function(_0xbc1ba5,_0x4d119d){_0xbc1ba5=_0xbc1ba5-0x0;var _0x58e822=_0xc8d6[_0xbc1ba5];return _0x58e822;};'use strict';var _=require('lodash');var Redis=require(_0x6c8d('0x0'));var db=require(_0x6c8d('0x1'))['db'];var logger=require(_0x6c8d('0x2'))(_0x6c8d('0x3'));var config=require(_0x6c8d('0x4'));config['redis']=_[_0x6c8d('0x5')](config['redis'],{'host':_0x6c8d('0x6'),'port':0x18eb});var socket=require(_0x6c8d('0x7'))(new Redis(config[_0x6c8d('0x8')]));require(_0x6c8d('0x9'))[_0x6c8d('0xa')](socket);exports['GetSquareProjects']=function(_0x52b288){var _0x382668=this;return new Promise(function(_0x1c0390,_0xb22288){return db['SquareProject'][_0x6c8d('0xb')]({'raw':_0x52b288[_0x6c8d('0xc')]?_0x52b288[_0x6c8d('0xc')]['raw']===undefined?!![]:![]:!![],'where':_0x52b288[_0x6c8d('0xc')]?_0x52b288[_0x6c8d('0xc')][_0x6c8d('0xd')]||null:null,'attributes':_0x52b288[_0x6c8d('0xc')]?_0x52b288[_0x6c8d('0xc')][_0x6c8d('0xe')]||null:null,'limit':_0x52b288[_0x6c8d('0xc')]?_0x52b288['options'][_0x6c8d('0xf')]||null:null,'include':_0x52b288[_0x6c8d('0xc')]?_0x52b288[_0x6c8d('0xc')][_0x6c8d('0x10')]?_[_0x6c8d('0x11')](_0x52b288['options'][_0x6c8d('0x10')],function(_0xf2bec1){return{'model':db[_0xf2bec1[_0x6c8d('0x12')]],'as':_0xf2bec1['as'],'attributes':_0xf2bec1[_0x6c8d('0xe')],'include':_0xf2bec1[_0x6c8d('0x10')]?_[_0x6c8d('0x11')](_0xf2bec1[_0x6c8d('0x10')],function(_0x73319f){return{'model':db[_0x73319f[_0x6c8d('0x12')]],'as':_0x73319f['as'],'attributes':_0x73319f[_0x6c8d('0xe')],'include':_0x73319f[_0x6c8d('0x10')]?_[_0x6c8d('0x11')](_0x73319f[_0x6c8d('0x10')],function(_0x2774c8){return{'model':db[_0x2774c8[_0x6c8d('0x12')]],'as':_0x2774c8['as'],'attributes':_0x2774c8['attributes']};}):[]};}):[]};}):[]:[]})[_0x6c8d('0x13')](function(_0x351d10){logger[_0x6c8d('0x14')](_0x6c8d('0x15'),_0x52b288);logger['debug'](_0x6c8d('0x15'),_0x52b288,JSON['stringify'](_0x351d10));_0x1c0390(_0x351d10);})[_0x6c8d('0x16')](function(_0x430081){logger[_0x6c8d('0x17')](_0x6c8d('0x15'),_0x430081['message'],_0x52b288);_0xb22288(_0x382668[_0x6c8d('0x17')](0x1f4,_0x430081['message']));});});};exports[_0x6c8d('0x18')]=function(_0x47320c){var _0x1025dd=this;return new Promise(function(_0x4bb339,_0x3d3b47){return db['SquareProject'][_0x6c8d('0x19')]({'raw':_0x47320c[_0x6c8d('0xc')]?_0x47320c['options'][_0x6c8d('0x1a')]===undefined?!![]:![]:!![],'where':_0x47320c[_0x6c8d('0xc')]?_0x47320c['options'][_0x6c8d('0xd')]||null:null,'attributes':_0x47320c[_0x6c8d('0xc')]?_0x47320c[_0x6c8d('0xc')][_0x6c8d('0xe')]||null:null,'include':_0x47320c[_0x6c8d('0xc')]?_0x47320c[_0x6c8d('0xc')]['include']?_['map'](_0x47320c[_0x6c8d('0xc')]['include'],function(_0x324885){return{'model':db[_0x324885[_0x6c8d('0x12')]],'as':_0x324885['as'],'attributes':_0x324885['attributes'],'include':_0x324885['include']?_[_0x6c8d('0x11')](_0x324885[_0x6c8d('0x10')],function(_0x5b3ae6){return{'model':db[_0x5b3ae6[_0x6c8d('0x12')]],'as':_0x5b3ae6['as'],'attributes':_0x5b3ae6[_0x6c8d('0xe')],'include':_0x5b3ae6[_0x6c8d('0x10')]?_['map'](_0x5b3ae6[_0x6c8d('0x10')],function(_0x1d4673){return{'model':db[_0x1d4673[_0x6c8d('0x12')]],'as':_0x1d4673['as'],'attributes':_0x1d4673[_0x6c8d('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x129c4c){logger['info']('ShowSquareProject',_0x47320c);logger[_0x6c8d('0x1b')](_0x6c8d('0x18'),_0x47320c,JSON[_0x6c8d('0x1c')](_0x129c4c));_0x4bb339(_0x129c4c);})[_0x6c8d('0x16')](function(_0x541378){logger[_0x6c8d('0x17')](_0x6c8d('0x18'),_0x541378[_0x6c8d('0x1d')],_0x47320c);_0x3d3b47(_0x1025dd['error'](0x1f4,_0x541378['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index fdeb9f2..c5e951e 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 _0x3c17=['save','remove','update','emit','removeListener','register','length','squareProject:','./squareProject.events'];(function(_0x4b5813,_0x5769de){var _0x423465=function(_0x18071f){while(--_0x18071f){_0x4b5813['push'](_0x4b5813['shift']());}};_0x423465(++_0x5769de);}(_0x3c17,0x7d));var _0x73c1=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x3c17[_0x397cfb];return _0x15fed9;};'use strict';var SquareProjectEvents=require(_0x73c1('0x0'));var events=[_0x73c1('0x1'),_0x73c1('0x2'),_0x73c1('0x3')];function createListener(_0x3aa9df,_0x584149){return function(_0x20c8a6){_0x584149[_0x73c1('0x4')](_0x3aa9df,_0x20c8a6);};}function removeListener(_0x13f9f1,_0x3e4d00){return function(){SquareProjectEvents[_0x73c1('0x5')](_0x13f9f1,_0x3e4d00);};}exports[_0x73c1('0x6')]=function(_0x5bb0d2){for(var _0x21ded1=0x0,_0x26c828=events[_0x73c1('0x7')];_0x21ded1<_0x26c828;_0x21ded1++){var _0x3a8200=events[_0x21ded1];var _0x3cf4c3=createListener(_0x73c1('0x8')+_0x3a8200,_0x5bb0d2);SquareProjectEvents['on'](_0x3a8200,_0x3cf4c3);}}; \ No newline at end of file +var _0x8949=['length','squareProject:','update','emit','removeListener','register'];(function(_0x45c2ea,_0x3d157c){var _0x37886a=function(_0x8572d9){while(--_0x8572d9){_0x45c2ea['push'](_0x45c2ea['shift']());}};_0x37886a(++_0x3d157c);}(_0x8949,0x92));var _0x9894=function(_0x1adb5d,_0x1e36cc){_0x1adb5d=_0x1adb5d-0x0;var _0x3acc58=_0x8949[_0x1adb5d];return _0x3acc58;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save','remove',_0x9894('0x0')];function createListener(_0x126926,_0x4fb90e){return function(_0x4463c8){_0x4fb90e[_0x9894('0x1')](_0x126926,_0x4463c8);};}function removeListener(_0x22911c,_0x353541){return function(){SquareProjectEvents[_0x9894('0x2')](_0x22911c,_0x353541);};}exports[_0x9894('0x3')]=function(_0x380218){for(var _0x1520e9=0x0,_0x59b7ad=events[_0x9894('0x4')];_0x1520e9<_0x59b7ad;_0x1520e9++){var _0xb6ca8e=events[_0x1520e9];var _0x226d56=createListener(_0x9894('0x5')+_0xb6ca8e,_0x380218);SquareProjectEvents['on'](_0xb6ca8e,_0x226d56);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index b4b5eaf..874d156 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 _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0x330fb9,_0x5ca0fd){var _0xa43ccc=function(_0x152fb1){while(--_0x152fb1){_0x330fb9['push'](_0x330fb9['shift']());}};_0xa43ccc(++_0x5ca0fd);}(_0x5fc3,0xa8));var _0x35fc=function(_0xa9eaa0,_0x4ba2b4){_0xa9eaa0=_0xa9eaa0-0x0;var _0x30897a=_0x5fc3[_0xa9eaa0];return _0x30897a;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +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(_0x428f1a,_0x23b323){var _0xf9165c=function(_0x42be66){while(--_0x42be66){_0x428f1a['push'](_0x428f1a['shift']());}};_0xf9165c(++_0x23b323);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xc4aa[_0x4f9b18];return _0x29f20c;};'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 diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index f5c06dc..f3df8cc 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 _0x7c09=['exports','STRING','VIRTUAL','getDataValue','savePath','lastIndexOf'];(function(_0x3b8345,_0x59d181){var _0x47965d=function(_0x57223c){while(--_0x57223c){_0x3b8345['push'](_0x3b8345['shift']());}};_0x47965d(++_0x59d181);}(_0x7c09,0x102));var _0x97c0=function(_0x34cc52,_0xcc3d61){_0x34cc52=_0x34cc52-0x0;var _0x44c0b6=_0x7c09[_0x34cc52];return _0x44c0b6;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'uniqueid':{'type':Sequelize[_0x97c0('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x97c0('0x1')]},'context':{'type':Sequelize[_0x97c0('0x1')]},'extension':{'type':Sequelize[_0x97c0('0x1')]},'priority':{'type':Sequelize[_0x97c0('0x1')]},'accountcode':{'type':Sequelize[_0x97c0('0x1')]},'dnid':{'type':Sequelize[_0x97c0('0x1')]},'projectName':{'type':Sequelize[_0x97c0('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x97c0('0x2')],'get':function(){var _0x42c6c7='';var _0x2c19fa=this[_0x97c0('0x3')](_0x97c0('0x4'));if(_0x2c19fa){_0x42c6c7=_0x2c19fa['substring'](_0x2c19fa[_0x97c0('0x5')]('.'));}return _0x42c6c7;}}}; \ No newline at end of file +var _0xac31=['STRING','VIRTUAL','savePath','lastIndexOf','sequelize','exports'];(function(_0x30fc63,_0x456284){var _0x43d2ce=function(_0x1800a8){while(--_0x1800a8){_0x30fc63['push'](_0x30fc63['shift']());}};_0x43d2ce(++_0x456284);}(_0xac31,0xca));var _0x1ac3=function(_0x5a3416,_0x52e028){_0x5a3416=_0x5a3416-0x0;var _0x36fe00=_0xac31[_0x5a3416];return _0x36fe00;};'use strict';var Sequelize=require(_0x1ac3('0x0'));module[_0x1ac3('0x1')]={'uniqueid':{'type':Sequelize[_0x1ac3('0x2')]},'callerid':{'type':Sequelize[_0x1ac3('0x2')]},'calleridname':{'type':Sequelize[_0x1ac3('0x2')]},'context':{'type':Sequelize[_0x1ac3('0x2')]},'extension':{'type':Sequelize[_0x1ac3('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1ac3('0x2')]},'dnid':{'type':Sequelize[_0x1ac3('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x1ac3('0x2')]},'savePath':{'type':Sequelize[_0x1ac3('0x2')]},'format':{'type':Sequelize[_0x1ac3('0x3')],'get':function(){var _0x1be223='';var _0x157604=this['getDataValue'](_0x1ac3('0x4'));if(_0x157604){_0x1be223=_0x157604['substring'](_0x157604[_0x1ac3('0x5')]('.'));}return _0x1be223;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 4ad40e7..62aae65 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 _0x8c0d=['order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','SquareRecording\x20not\x20found','unlink','message','send','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','.cypher','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','destroy','then','stack','name','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0xa5db38,_0x189d0c){var _0x48dc06=function(_0x11086f){while(--_0x11086f){_0xa5db38['push'](_0xa5db38['shift']());}};_0x48dc06(++_0x189d0c);}(_0x8c0d,0xf0));var _0xd8c0=function(_0x1123bc,_0x18c217){_0x1123bc=_0x1123bc-0x0;var _0x5418a9=_0x8c0d[_0x1123bc];return _0x5418a9;};'use strict';var emlformat=require(_0xd8c0('0x0'));var rimraf=require(_0xd8c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8c0('0x2'));var rp=require(_0xd8c0('0x3'));var moment=require(_0xd8c0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd8c0('0x5'));var util=require(_0xd8c0('0x6'));var path=require('path');var sox=require(_0xd8c0('0x7'));var csv=require(_0xd8c0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd8c0('0x9'));var squel=require(_0xd8c0('0xa'));var crypto=require(_0xd8c0('0xb'));var jsforce=require(_0xd8c0('0xc'));var deskjs=require(_0xd8c0('0xd'));var toCsv=require(_0xd8c0('0x8'));var querystring=require('querystring');var Papa=require(_0xd8c0('0xe'));var Redis=require(_0xd8c0('0xf'));var authService=require(_0xd8c0('0x10'));var qs=require(_0xd8c0('0x11'));var as=require(_0xd8c0('0x12'));var hardwareService=require(_0xd8c0('0x13'));var logger=require(_0xd8c0('0x14'))(_0xd8c0('0x15'));var utils=require(_0xd8c0('0x16'));var config=require(_0xd8c0('0x17'));var licenseUtil=require(_0xd8c0('0x18'));var db=require(_0xd8c0('0x19'))['db'];function respondWithStatusCode(_0x304733,_0x48b2cc){_0x48b2cc=_0x48b2cc||0xcc;return function(_0xca5d6e){if(_0xca5d6e){return _0x304733[_0xd8c0('0x1a')](_0x48b2cc);}return _0x304733[_0xd8c0('0x1b')](_0x48b2cc)[_0xd8c0('0x1c')]();};}function respondWithResult(_0x2ba58b,_0x35fa2e){_0x35fa2e=_0x35fa2e||0xc8;return function(_0x2bfda0){if(_0x2bfda0){return _0x2ba58b['status'](_0x35fa2e)[_0xd8c0('0x1d')](_0x2bfda0);}};}function respondWithFilteredResult(_0x58246f,_0x1136e8){return function(_0x2a8737){if(_0x2a8737){var _0x459b0d=typeof _0x1136e8['offset']==='undefined'&&typeof _0x1136e8[_0xd8c0('0x1e')]===_0xd8c0('0x1f');var _0x406677=_0x2a8737[_0xd8c0('0x20')];var _0x3fcc57=_0x459b0d?0x0:_0x1136e8[_0xd8c0('0x21')];var _0x45d7ec=_0x459b0d?_0x2a8737[_0xd8c0('0x20')]:_0x1136e8['offset']+_0x1136e8[_0xd8c0('0x1e')];var _0x4693c1;if(_0x45d7ec>=_0x406677){_0x45d7ec=_0x406677;_0x4693c1=0xc8;}else{_0x4693c1=0xce;}_0x58246f[_0xd8c0('0x1b')](_0x4693c1);return _0x58246f[_0xd8c0('0x22')](_0xd8c0('0x23'),_0x3fcc57+'-'+_0x45d7ec+'/'+_0x406677)['json'](_0x2a8737);}return null;};}function patchUpdates(_0x480173){return function(_0x4c78c4){try{jsonpatch['apply'](_0x4c78c4,_0x480173,!![]);}catch(_0x40fe41){return BPromise[_0xd8c0('0x24')](_0x40fe41);}return _0x4c78c4[_0xd8c0('0x25')]();};}function saveUpdates(_0x17a969,_0x479102){return function(_0x26e0ce){if(_0x26e0ce){return _0x26e0ce[_0xd8c0('0x26')](_0x17a969)['then'](function(_0x47c70d){return _0x47c70d;});}return null;};}function removeEntity(_0x414707,_0x88f1a8){return function(_0x479450){if(_0x479450){return _0x479450[_0xd8c0('0x27')]()[_0xd8c0('0x28')](function(){_0x414707['status'](0xcc)[_0xd8c0('0x1c')]();});}};}function handleEntityNotFound(_0x1344f8,_0x358d55){return function(_0x1eebf2){if(!_0x1eebf2){_0x1344f8['sendStatus'](0x194);}return _0x1eebf2;};}function handleError(_0x4768b4,_0xb302b){_0xb302b=_0xb302b||0x1f4;return function(_0x7fed42){logger['error'](_0x7fed42[_0xd8c0('0x29')]);if(_0x7fed42[_0xd8c0('0x2a')]){delete _0x7fed42['name'];}_0x4768b4[_0xd8c0('0x1b')](_0xb302b)['send'](_0x7fed42);};}exports[_0xd8c0('0x2b')]=function(_0x871dcd,_0x59d29c){var _0x1b4333={},_0x49d0b0={},_0x57649e={'count':0x0,'rows':[]};var _0x35fc0a=_[_0xd8c0('0x2c')](db[_0xd8c0('0x2d')][_0xd8c0('0x2e')],function(_0xdd05c2){return{'name':_0xdd05c2[_0xd8c0('0x2f')],'type':_0xdd05c2[_0xd8c0('0x30')][_0xd8c0('0x31')]};});_0x49d0b0[_0xd8c0('0x32')]=_[_0xd8c0('0x2c')](_0x35fc0a,_0xd8c0('0x2a'));_0x49d0b0[_0xd8c0('0x33')]=_[_0xd8c0('0x34')](_0x871dcd['query']);_0x49d0b0[_0xd8c0('0x35')]=_['intersection'](_0x49d0b0[_0xd8c0('0x32')],_0x49d0b0['query']);_0x1b4333[_0xd8c0('0x36')]=_[_0xd8c0('0x37')](_0x49d0b0[_0xd8c0('0x32')],qs[_0xd8c0('0x38')](_0x871dcd[_0xd8c0('0x33')][_0xd8c0('0x38')]));_0x1b4333[_0xd8c0('0x36')]=_0x1b4333['attributes'][_0xd8c0('0x39')]?_0x1b4333['attributes']:_0x49d0b0['model'];if(!_0x871dcd[_0xd8c0('0x33')][_0xd8c0('0x3a')](_0xd8c0('0x3b'))){_0x1b4333[_0xd8c0('0x1e')]=qs[_0xd8c0('0x1e')](_0x871dcd[_0xd8c0('0x33')]['limit']);_0x1b4333[_0xd8c0('0x21')]=qs[_0xd8c0('0x21')](_0x871dcd[_0xd8c0('0x33')][_0xd8c0('0x21')]);}_0x1b4333[_0xd8c0('0x3c')]=qs[_0xd8c0('0x3d')](_0x871dcd[_0xd8c0('0x33')]['sort']);_0x1b4333[_0xd8c0('0x3e')]=qs[_0xd8c0('0x35')](_[_0xd8c0('0x3f')](_0x871dcd[_0xd8c0('0x33')],_0x49d0b0['filters']),_0x35fc0a);if(_0x871dcd[_0xd8c0('0x33')][_0xd8c0('0x40')]){_0x1b4333[_0xd8c0('0x3e')]=_['merge'](_0x1b4333[_0xd8c0('0x3e')],{'$or':_[_0xd8c0('0x2c')](_0x35fc0a,function(_0x5092a1){if(_0x5092a1[_0xd8c0('0x30')]!==_0xd8c0('0x41')){var _0x2a9a8c={};_0x2a9a8c[_0x5092a1[_0xd8c0('0x2a')]]={'$like':'%'+_0x871dcd[_0xd8c0('0x33')][_0xd8c0('0x40')]+'%'};return _0x2a9a8c;}})});}_0x1b4333=_[_0xd8c0('0x42')]({},_0x1b4333,_0x871dcd[_0xd8c0('0x43')]);var _0x549576={'where':_0x1b4333[_0xd8c0('0x3e')]};return db[_0xd8c0('0x2d')][_0xd8c0('0x20')](_0x549576)['then'](function(_0x372cbe){_0x57649e[_0xd8c0('0x20')]=_0x372cbe;if(_0x871dcd[_0xd8c0('0x33')][_0xd8c0('0x44')]){_0x1b4333[_0xd8c0('0x45')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x1b4333);})[_0xd8c0('0x28')](function(_0x5edf8f){_0x57649e[_0xd8c0('0x46')]=_0x5edf8f;return _0x57649e;})[_0xd8c0('0x28')](respondWithFilteredResult(_0x59d29c,_0x1b4333))[_0xd8c0('0x47')](handleError(_0x59d29c,null));};exports[_0xd8c0('0x48')]=function(_0x1d3188,_0x4099aa){var _0x2657e9={'raw':!![],'where':{'id':_0x1d3188[_0xd8c0('0x49')]['id']}},_0x1b2ecf={};_0x1b2ecf[_0xd8c0('0x32')]=_[_0xd8c0('0x34')](db[_0xd8c0('0x2d')][_0xd8c0('0x2e')]);_0x1b2ecf[_0xd8c0('0x33')]=_[_0xd8c0('0x34')](_0x1d3188[_0xd8c0('0x33')]);_0x1b2ecf['filters']=_[_0xd8c0('0x37')](_0x1b2ecf['model'],_0x1b2ecf[_0xd8c0('0x33')]);_0x2657e9[_0xd8c0('0x36')]=_[_0xd8c0('0x37')](_0x1b2ecf[_0xd8c0('0x32')],qs[_0xd8c0('0x38')](_0x1d3188[_0xd8c0('0x33')][_0xd8c0('0x38')]));_0x2657e9[_0xd8c0('0x36')]=_0x2657e9[_0xd8c0('0x36')]['length']?_0x2657e9[_0xd8c0('0x36')]:_0x1b2ecf[_0xd8c0('0x32')];if(_0x1d3188['query'][_0xd8c0('0x44')]){_0x2657e9[_0xd8c0('0x45')]=[{'all':!![]}];}_0x2657e9=_[_0xd8c0('0x42')]({},_0x2657e9,_0x1d3188['options']);return db[_0xd8c0('0x2d')][_0xd8c0('0x4a')](_0x2657e9)['then'](handleEntityNotFound(_0x4099aa,null))['then'](respondWithResult(_0x4099aa,null))['catch'](handleError(_0x4099aa,null));};exports[_0xd8c0('0x4b')]=function(_0x2a1bf8,_0x4fff95){return db['SquareRecording'][_0xd8c0('0x4b')](_0x2a1bf8[_0xd8c0('0x4c')],{})[_0xd8c0('0x28')](respondWithResult(_0x4fff95,0xc9))[_0xd8c0('0x47')](handleError(_0x4fff95,null));};exports[_0xd8c0('0x26')]=function(_0x26b2bc,_0x24cddd){if(_0x26b2bc[_0xd8c0('0x4c')]['id']){delete _0x26b2bc['body']['id'];}return db['SquareRecording'][_0xd8c0('0x4a')]({'where':{'id':_0x26b2bc[_0xd8c0('0x49')]['id']}})[_0xd8c0('0x28')](handleEntityNotFound(_0x24cddd,null))[_0xd8c0('0x28')](saveUpdates(_0x26b2bc[_0xd8c0('0x4c')],null))[_0xd8c0('0x28')](respondWithResult(_0x24cddd,null))[_0xd8c0('0x47')](handleError(_0x24cddd,null));};exports[_0xd8c0('0x4d')]=function(_0x3083e0,_0x1aae15,_0x9045c1){var _0x1b5643=require(_0xd8c0('0x4e'));var _0x1b5a8e=![];var _0x4e424e={};if(_0x3083e0[_0xd8c0('0x33')]['type']&&_0x3083e0[_0xd8c0('0x33')][_0xd8c0('0x30')]==='uniqueid'){_0x4e424e[_0xd8c0('0x4f')]=_0x3083e0[_0xd8c0('0x49')]['id'];}else{_0x4e424e['id']=_0x3083e0[_0xd8c0('0x49')]['id'];}return db[_0xd8c0('0x2d')][_0xd8c0('0x4a')]({'where':_0x4e424e,'attributes':['id',_0xd8c0('0x50'),_0xd8c0('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x1aae15,null))[_0xd8c0('0x28')](function(_0x5e7295){if(_0x5e7295){var _0x31bfb6=_0x5e7295['savePath'];var _0x180d74=util[_0xd8c0('0x52')](_0xd8c0('0x53'),_0x31bfb6);if(fs[_0xd8c0('0x54')](_0x180d74)){_0x1b5a8e=!![];return _0x1b5643[_0xd8c0('0x55')](_0x180d74,_0x31bfb6,config[_0xd8c0('0x56')][_0xd8c0('0x57')])[_0xd8c0('0x28')](function(){return _0x5e7295;});}return _0x5e7295;}})[_0xd8c0('0x28')](function(_0x178876){if(_0x178876){var _0x32c249=_0x178876[_0xd8c0('0x50')];if(!fs[_0xd8c0('0x54')](_0x32c249)){throw new db[(_0xd8c0('0x58'))]['ValidationError'](_0xd8c0('0x59'));}if(_0x178876['filename']){return _0x1aae15['download'](_0x32c249,_0x178876[_0xd8c0('0x51')]+path['extname'](_0x32c249),function(){if(_0x1b5a8e){fs[_0xd8c0('0x5a')](_0x32c249);}});}else{return _0x1aae15[_0xd8c0('0x4d')](_0x32c249,function(_0x25ad66){if(_0x1b5a8e){fs[_0xd8c0('0x5a')](_0x32c249);}});}}})[_0xd8c0('0x47')](function(_0x3b5713){if(_0x3b5713[_0xd8c0('0x5b')]===_0xd8c0('0x59')){_0x1aae15[_0xd8c0('0x1b')](0x194)[_0xd8c0('0x5c')](_0xd8c0('0x5d'));}else{return handleError(_0x1aae15,null);}});};exports[_0xd8c0('0x27')]=function(_0x23607d,_0x2b3e45){return db[_0xd8c0('0x2d')]['find']({'where':{'id':_0x23607d[_0xd8c0('0x49')]['id']}})['then'](function(_0x5ce7b5){if(_['isNil'](_0x5ce7b5)){throw new ReferenceError(_0xd8c0('0x5e'));}return _0x5ce7b5;})[_0xd8c0('0x28')](function(_0x505b0c){var _0x399059=_0x505b0c[_0xd8c0('0x50')];logger[_0xd8c0('0x5f')](_0xd8c0('0x60'),_0x399059);if(!_[_0xd8c0('0x61')](_0x505b0c[_0xd8c0('0x50')])&&fs[_0xd8c0('0x54')](_0x399059)){logger[_0xd8c0('0x5f')](_0xd8c0('0x62')+_0x399059+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x399059);}_0x399059=_0x399059+_0xd8c0('0x63');if(!_[_0xd8c0('0x61')](_0x505b0c[_0xd8c0('0x50')])&&fs[_0xd8c0('0x54')](_0x399059)){logger[_0xd8c0('0x5f')](_0xd8c0('0x62')+_0x399059+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x399059);}return _0x505b0c;})['then'](function(_0x49073b){if(!_0x49073b)throw new InternalError();return _0x49073b[_0xd8c0('0x27')]();})[_0xd8c0('0x28')](function(){_0x2b3e45[_0xd8c0('0x1b')](0xcc)['end']();})['catch'](handleError(_0x2b3e45,null));}; \ No newline at end of file +var _0x47c9=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','save','update','then','end','error','stack','name','send','index','SquareRecording','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','merge','options','count','includeAll','include','rows','show','find','catch','create','body','params','download','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','secrets','recording','ValidationError','SquareRecording\x20not\x20found','extname','unlink','destroy','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x111068,_0x4e1daf){var _0x1670c4=function(_0x55d110){while(--_0x55d110){_0x111068['push'](_0x111068['shift']());}};_0x1670c4(++_0x4e1daf);}(_0x47c9,0x1d1));var _0x947c=function(_0x4cf19f,_0x593a2e){_0x4cf19f=_0x4cf19f-0x0;var _0x1224ce=_0x47c9[_0x4cf19f];return _0x1224ce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x947c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x947c('0x1'));var rp=require('request-promise');var moment=require(_0x947c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x947c('0x3'));var util=require(_0x947c('0x4'));var path=require(_0x947c('0x5'));var sox=require(_0x947c('0x6'));var csv=require(_0x947c('0x7'));var ejs=require(_0x947c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x947c('0x9'));var squel=require(_0x947c('0xa'));var crypto=require(_0x947c('0xb'));var jsforce=require(_0x947c('0xc'));var deskjs=require(_0x947c('0xd'));var toCsv=require(_0x947c('0x7'));var querystring=require(_0x947c('0xe'));var Papa=require(_0x947c('0xf'));var Redis=require(_0x947c('0x10'));var authService=require(_0x947c('0x11'));var qs=require(_0x947c('0x12'));var as=require(_0x947c('0x13'));var hardwareService=require(_0x947c('0x14'));var logger=require('../../config/logger')(_0x947c('0x15'));var utils=require(_0x947c('0x16'));var config=require(_0x947c('0x17'));var licenseUtil=require(_0x947c('0x18'));var db=require(_0x947c('0x19'))['db'];function respondWithStatusCode(_0x2b26c1,_0x500392){_0x500392=_0x500392||0xcc;return function(_0x457c1e){if(_0x457c1e){return _0x2b26c1[_0x947c('0x1a')](_0x500392);}return _0x2b26c1[_0x947c('0x1b')](_0x500392)['end']();};}function respondWithResult(_0x4564b6,_0x383e87){_0x383e87=_0x383e87||0xc8;return function(_0x29c5d0){if(_0x29c5d0){return _0x4564b6[_0x947c('0x1b')](_0x383e87)[_0x947c('0x1c')](_0x29c5d0);}};}function respondWithFilteredResult(_0x594985,_0x253756){return function(_0x4d52b6){if(_0x4d52b6){var _0xf12dcd=typeof _0x253756[_0x947c('0x1d')]===_0x947c('0x1e')&&typeof _0x253756[_0x947c('0x1f')]===_0x947c('0x1e');var _0x56b87f=_0x4d52b6['count'];var _0x5cd9a5=_0xf12dcd?0x0:_0x253756['offset'];var _0x1c04d1=_0xf12dcd?_0x4d52b6['count']:_0x253756[_0x947c('0x1d')]+_0x253756[_0x947c('0x1f')];var _0x34f322;if(_0x1c04d1>=_0x56b87f){_0x1c04d1=_0x56b87f;_0x34f322=0xc8;}else{_0x34f322=0xce;}_0x594985[_0x947c('0x1b')](_0x34f322);return _0x594985['set']('Content-Range',_0x5cd9a5+'-'+_0x1c04d1+'/'+_0x56b87f)['json'](_0x4d52b6);}return null;};}function patchUpdates(_0x1f9b76){return function(_0x40eefe){try{jsonpatch['apply'](_0x40eefe,_0x1f9b76,!![]);}catch(_0x32bf19){return BPromise['reject'](_0x32bf19);}return _0x40eefe[_0x947c('0x20')]();};}function saveUpdates(_0x57928b,_0x4ab2cb){return function(_0x2a3ddf){if(_0x2a3ddf){return _0x2a3ddf[_0x947c('0x21')](_0x57928b)[_0x947c('0x22')](function(_0x56205b){return _0x56205b;});}return null;};}function removeEntity(_0xb4231f,_0x1abda5){return function(_0x44e879){if(_0x44e879){return _0x44e879['destroy']()['then'](function(){_0xb4231f[_0x947c('0x1b')](0xcc)[_0x947c('0x23')]();});}};}function handleEntityNotFound(_0x2e57c4,_0x1e9c21){return function(_0x4862f9){if(!_0x4862f9){_0x2e57c4[_0x947c('0x1a')](0x194);}return _0x4862f9;};}function handleError(_0xef99b9,_0x578dc2){_0x578dc2=_0x578dc2||0x1f4;return function(_0xb16cfc){logger[_0x947c('0x24')](_0xb16cfc[_0x947c('0x25')]);if(_0xb16cfc[_0x947c('0x26')]){delete _0xb16cfc[_0x947c('0x26')];}_0xef99b9[_0x947c('0x1b')](_0x578dc2)[_0x947c('0x27')](_0xb16cfc);};}exports[_0x947c('0x28')]=function(_0x41c382,_0x2d873b){var _0x45cdaa={},_0x2682cf={},_0x7c9a7c={'count':0x0,'rows':[]};var _0x420874=_['map'](db[_0x947c('0x29')][_0x947c('0x2a')],function(_0xe5d1bb){return{'name':_0xe5d1bb[_0x947c('0x2b')],'type':_0xe5d1bb['type'][_0x947c('0x2c')]};});_0x2682cf[_0x947c('0x2d')]=_[_0x947c('0x2e')](_0x420874,_0x947c('0x26'));_0x2682cf['query']=_[_0x947c('0x2f')](_0x41c382[_0x947c('0x30')]);_0x2682cf[_0x947c('0x31')]=_[_0x947c('0x32')](_0x2682cf[_0x947c('0x2d')],_0x2682cf[_0x947c('0x30')]);_0x45cdaa[_0x947c('0x33')]=_['intersection'](_0x2682cf[_0x947c('0x2d')],qs[_0x947c('0x34')](_0x41c382[_0x947c('0x30')]['fields']));_0x45cdaa[_0x947c('0x33')]=_0x45cdaa[_0x947c('0x33')][_0x947c('0x35')]?_0x45cdaa[_0x947c('0x33')]:_0x2682cf[_0x947c('0x2d')];if(!_0x41c382[_0x947c('0x30')][_0x947c('0x36')](_0x947c('0x37'))){_0x45cdaa[_0x947c('0x1f')]=qs[_0x947c('0x1f')](_0x41c382[_0x947c('0x30')][_0x947c('0x1f')]);_0x45cdaa[_0x947c('0x1d')]=qs[_0x947c('0x1d')](_0x41c382[_0x947c('0x30')][_0x947c('0x1d')]);}_0x45cdaa[_0x947c('0x38')]=qs['sort'](_0x41c382['query'][_0x947c('0x39')]);_0x45cdaa['where']=qs['filters'](_[_0x947c('0x3a')](_0x41c382[_0x947c('0x30')],_0x2682cf['filters']),_0x420874);if(_0x41c382[_0x947c('0x30')]['filter']){_0x45cdaa[_0x947c('0x3b')]=_['merge'](_0x45cdaa['where'],{'$or':_['map'](_0x420874,function(_0x4ebfad){if(_0x4ebfad[_0x947c('0x3c')]!==_0x947c('0x3d')){var _0x5e1a5c={};_0x5e1a5c[_0x4ebfad[_0x947c('0x26')]]={'$like':'%'+_0x41c382[_0x947c('0x30')][_0x947c('0x3e')]+'%'};return _0x5e1a5c;}})});}_0x45cdaa=_[_0x947c('0x3f')]({},_0x45cdaa,_0x41c382[_0x947c('0x40')]);var _0x4297b0={'where':_0x45cdaa['where']};return db[_0x947c('0x29')]['count'](_0x4297b0)[_0x947c('0x22')](function(_0x2879e8){_0x7c9a7c[_0x947c('0x41')]=_0x2879e8;if(_0x41c382[_0x947c('0x30')][_0x947c('0x42')]){_0x45cdaa[_0x947c('0x43')]=[{'all':!![]}];}return db[_0x947c('0x29')]['findAll'](_0x45cdaa);})[_0x947c('0x22')](function(_0x10576d){_0x7c9a7c[_0x947c('0x44')]=_0x10576d;return _0x7c9a7c;})[_0x947c('0x22')](respondWithFilteredResult(_0x2d873b,_0x45cdaa))['catch'](handleError(_0x2d873b,null));};exports[_0x947c('0x45')]=function(_0x3a42dc,_0x5de369){var _0x39913c={'raw':!![],'where':{'id':_0x3a42dc['params']['id']}},_0x4b3d39={};_0x4b3d39['model']=_[_0x947c('0x2f')](db['SquareRecording'][_0x947c('0x2a')]);_0x4b3d39[_0x947c('0x30')]=_[_0x947c('0x2f')](_0x3a42dc[_0x947c('0x30')]);_0x4b3d39[_0x947c('0x31')]=_[_0x947c('0x32')](_0x4b3d39[_0x947c('0x2d')],_0x4b3d39[_0x947c('0x30')]);_0x39913c['attributes']=_[_0x947c('0x32')](_0x4b3d39['model'],qs[_0x947c('0x34')](_0x3a42dc[_0x947c('0x30')][_0x947c('0x34')]));_0x39913c[_0x947c('0x33')]=_0x39913c[_0x947c('0x33')]['length']?_0x39913c[_0x947c('0x33')]:_0x4b3d39['model'];if(_0x3a42dc['query']['includeAll']){_0x39913c[_0x947c('0x43')]=[{'all':!![]}];}_0x39913c=_[_0x947c('0x3f')]({},_0x39913c,_0x3a42dc[_0x947c('0x40')]);return db[_0x947c('0x29')][_0x947c('0x46')](_0x39913c)['then'](handleEntityNotFound(_0x5de369,null))[_0x947c('0x22')](respondWithResult(_0x5de369,null))[_0x947c('0x47')](handleError(_0x5de369,null));};exports[_0x947c('0x48')]=function(_0x4cd297,_0x4eb37a){return db['SquareRecording'][_0x947c('0x48')](_0x4cd297[_0x947c('0x49')],{})['then'](respondWithResult(_0x4eb37a,0xc9))[_0x947c('0x47')](handleError(_0x4eb37a,null));};exports[_0x947c('0x21')]=function(_0x393369,_0x3d366b){if(_0x393369[_0x947c('0x49')]['id']){delete _0x393369['body']['id'];}return db['SquareRecording'][_0x947c('0x46')]({'where':{'id':_0x393369[_0x947c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3d366b,null))[_0x947c('0x22')](saveUpdates(_0x393369['body'],null))[_0x947c('0x22')](respondWithResult(_0x3d366b,null))[_0x947c('0x47')](handleError(_0x3d366b,null));};exports[_0x947c('0x4b')]=function(_0x5040c6,_0x32ab6a,_0x639633){var _0x2ae49d=require(_0x947c('0x4c'));var _0x40d2cf=![];var _0x1ee0d5={};if(_0x5040c6['query'][_0x947c('0x3c')]&&_0x5040c6[_0x947c('0x30')][_0x947c('0x3c')]===_0x947c('0x4d')){_0x1ee0d5[_0x947c('0x4d')]=_0x5040c6[_0x947c('0x4a')]['id'];}else{_0x1ee0d5['id']=_0x5040c6[_0x947c('0x4a')]['id'];}return db[_0x947c('0x29')][_0x947c('0x46')]({'where':_0x1ee0d5,'attributes':['id',_0x947c('0x4e'),_0x947c('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x32ab6a,null))[_0x947c('0x22')](function(_0x505147){if(_0x505147){var _0x28fcf4=_0x505147[_0x947c('0x4e')];var _0x1bbeba=util[_0x947c('0x50')]('%s.cypher',_0x28fcf4);if(fs[_0x947c('0x51')](_0x1bbeba)){_0x40d2cf=!![];return _0x2ae49d['decryptFile'](_0x1bbeba,_0x28fcf4,config[_0x947c('0x52')][_0x947c('0x53')])[_0x947c('0x22')](function(){return _0x505147;});}return _0x505147;}})[_0x947c('0x22')](function(_0x2e0fbe){if(_0x2e0fbe){var _0x53c56a=_0x2e0fbe[_0x947c('0x4e')];if(!fs['existsSync'](_0x53c56a)){throw new db['Sequelize'][(_0x947c('0x54'))](_0x947c('0x55'));}if(_0x2e0fbe[_0x947c('0x4f')]){return _0x32ab6a[_0x947c('0x4b')](_0x53c56a,_0x2e0fbe['filename']+path[_0x947c('0x56')](_0x53c56a),function(){if(_0x40d2cf){fs[_0x947c('0x57')](_0x53c56a);}});}else{return _0x32ab6a[_0x947c('0x4b')](_0x53c56a,function(_0x306cd3){if(_0x40d2cf){fs[_0x947c('0x57')](_0x53c56a);}});}}})[_0x947c('0x47')](function(_0x2d4a85){if(_0x2d4a85['message']===_0x947c('0x55')){_0x32ab6a[_0x947c('0x1b')](0x194)[_0x947c('0x27')]('Not\x20found');}else{return handleError(_0x32ab6a,null);}});};exports[_0x947c('0x58')]=function(_0x3e8870,_0xab695){return db[_0x947c('0x29')][_0x947c('0x46')]({'where':{'id':_0x3e8870[_0x947c('0x4a')]['id']}})[_0x947c('0x22')](function(_0x44c3bc){if(_[_0x947c('0x59')](_0x44c3bc)){throw new ReferenceError(_0x947c('0x5a'));}return _0x44c3bc;})[_0x947c('0x22')](function(_0xfbebb4){var _0x5a3923=_0xfbebb4[_0x947c('0x4e')];logger['info'](_0x947c('0x5b'),_0x5a3923);if(!_['isNil'](_0xfbebb4[_0x947c('0x4e')])&&fs[_0x947c('0x51')](_0x5a3923)){logger[_0x947c('0x5c')](_0x947c('0x5d')+_0x5a3923+_0x947c('0x5e'));fs[_0x947c('0x5f')](_0x5a3923);}_0x5a3923=_0x5a3923+_0x947c('0x60');if(!_[_0x947c('0x59')](_0xfbebb4[_0x947c('0x4e')])&&fs[_0x947c('0x51')](_0x5a3923)){logger[_0x947c('0x5c')](_0x947c('0x5d')+_0x5a3923+_0x947c('0x5e'));fs[_0x947c('0x5f')](_0x5a3923);}return _0xfbebb4;})[_0x947c('0x22')](function(_0x3e124b){if(!_0x3e124b)throw new InternalError();return _0x3e124b[_0x947c('0x58')]();})['then'](function(){_0xab695[_0x947c('0x1b')](0xcc)[_0x947c('0x23')]();})[_0x947c('0x47')](handleError(_0xab695,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index e28b6cd..97c7a73 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 _0x3e4d=['rimraf','./squareRecording.attributes','define','SquareRecording','square_recordings','lodash','../../config/logger','request-promise','path'];(function(_0x43d373,_0x430bcc){var _0x17e486=function(_0x2aed64){while(--_0x2aed64){_0x43d373['push'](_0x43d373['shift']());}};_0x17e486(++_0x430bcc);}(_0x3e4d,0x16d));var _0xd3e4=function(_0x5d60ed,_0x38684f){_0x5d60ed=_0x5d60ed-0x0;var _0x3e7c34=_0x3e4d[_0x5d60ed];return _0x3e7c34;};'use strict';var _=require(_0xd3e4('0x0'));var util=require('util');var logger=require(_0xd3e4('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd3e4('0x2'));var fs=require('fs');var path=require(_0xd3e4('0x3'));var rimraf=require(_0xd3e4('0x4'));var config=require('../../config/environment');var attributes=require(_0xd3e4('0x5'));module['exports']=function(_0x4b9a10,_0x7b42fe){return _0x4b9a10[_0xd3e4('0x6')](_0xd3e4('0x7'),attributes,{'tableName':_0xd3e4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc7b3=['api','moment','bluebird','request-promise','path','rimraf','./squareRecording.attributes','exports','define','SquareRecording','lodash','util'];(function(_0x18065f,_0x2d731d){var _0x80d378=function(_0x19eedf){while(--_0x19eedf){_0x18065f['push'](_0x18065f['shift']());}};_0x80d378(++_0x2d731d);}(_0xc7b3,0x1c6));var _0x3c7b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc7b3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x3c7b('0x0'));var util=require(_0x3c7b('0x1'));var logger=require('../../config/logger')(_0x3c7b('0x2'));var moment=require(_0x3c7b('0x3'));var BPromise=require(_0x3c7b('0x4'));var rp=require(_0x3c7b('0x5'));var fs=require('fs');var path=require(_0x3c7b('0x6'));var rimraf=require(_0x3c7b('0x7'));var config=require('../../config/environment');var attributes=require(_0x3c7b('0x8'));module[_0x3c7b('0x9')]=function(_0x1fa371,_0x55975f){return _0x1fa371[_0x3c7b('0xa')](_0x3c7b('0xb'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 7399416..bab0d5e 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 _0x92cf=['../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','code','message','error','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3dc55d,_0xd07e93){var _0x3aa7f3=function(_0x506b46){while(--_0x506b46){_0x3dc55d['push'](_0x3dc55d['shift']());}};_0x3aa7f3(++_0xd07e93);}(_0x92cf,0x1c9));var _0xf92c=function(_0x527a53,_0x3265d6){_0x527a53=_0x527a53-0x0;var _0x2332f5=_0x92cf[_0x527a53];return _0x2332f5;};'use strict';var _=require('lodash');var util=require(_0xf92c('0x0'));var moment=require(_0xf92c('0x1'));var BPromise=require('bluebird');var rs=require(_0xf92c('0x2'));var fs=require('fs');var Redis=require(_0xf92c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf92c('0x4'));var logger=require(_0xf92c('0x5'))(_0xf92c('0x6'));var config=require(_0xf92c('0x7'));var jayson=require(_0xf92c('0x8'));var client=jayson[_0xf92c('0x9')][_0xf92c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31e360,_0x267165,_0x30a0f1){return new BPromise(function(_0x403c39,_0x4199e4){return client[_0xf92c('0xb')](_0x31e360,_0x30a0f1)[_0xf92c('0xc')](function(_0x5adb7d){logger[_0xf92c('0xd')](_0xf92c('0xe'),_0x267165,_0xf92c('0xf'));logger[_0xf92c('0x10')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x267165,_0xf92c('0xf'),JSON[_0xf92c('0x11')](_0x5adb7d));if(_0x5adb7d['error']){if(_0x5adb7d['error'][_0xf92c('0x12')]===0x1f4){logger['error'](_0xf92c('0xe'),_0x267165,_0x5adb7d['error'][_0xf92c('0x13')]);return _0x4199e4(_0x5adb7d['error']['message']);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x267165,_0x5adb7d[_0xf92c('0x14')][_0xf92c('0x13')]);return _0x403c39(_0x5adb7d[_0xf92c('0x14')][_0xf92c('0x13')]);}else{logger[_0xf92c('0xd')](_0xf92c('0xe'),_0x267165,_0xf92c('0xf'));_0x403c39(_0x5adb7d[_0xf92c('0x15')][_0xf92c('0x13')]);}})[_0xf92c('0x16')](function(_0x2e5b94){logger[_0xf92c('0x14')](_0xf92c('0xe'),_0x267165,_0x2e5b94);_0x4199e4(_0x2e5b94);});});}exports[_0xf92c('0x17')]=function(_0x54c1ea){var _0x289c0d=this;return new Promise(function(_0x5a1ee2,_0x3d06d6){return db[_0xf92c('0x18')][_0xf92c('0x19')](_0x54c1ea[_0xf92c('0x1a')],{'raw':_0x54c1ea[_0xf92c('0x1b')]?_0x54c1ea['options'][_0xf92c('0x1c')]===undefined?!![]:![]:!![]})[_0xf92c('0xc')](function(_0xa83806){logger['info']('CreateSquareRecording',_0x54c1ea);logger[_0xf92c('0x10')](_0xf92c('0x17'),_0x54c1ea,JSON[_0xf92c('0x11')](_0xa83806));_0x5a1ee2(_0xa83806);})[_0xf92c('0x16')](function(_0x39555){logger[_0xf92c('0x14')](_0xf92c('0x17'),_0x39555[_0xf92c('0x13')],_0x54c1ea);_0x3d06d6(_0x289c0d[_0xf92c('0x14')](0x1f4,_0x39555[_0xf92c('0x13')]));});});}; \ No newline at end of file +var _0x10c0=['options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','SquareRecording,\x20%s,\x20%s','message','result','catch','CreateSquareRecording'];(function(_0x4a8418,_0x39078a){var _0x390174=function(_0x173ea6){while(--_0x173ea6){_0x4a8418['push'](_0x4a8418['shift']());}};_0x390174(++_0x39078a);}(_0x10c0,0x12a));var _0x010c=function(_0x352713,_0x737610){_0x352713=_0x352713-0x0;var _0x46a4ea=_0x10c0[_0x352713];return _0x46a4ea;};'use strict';var _=require(_0x010c('0x0'));var util=require(_0x010c('0x1'));var moment=require(_0x010c('0x2'));var BPromise=require(_0x010c('0x3'));var rs=require(_0x010c('0x4'));var fs=require('fs');var Redis=require(_0x010c('0x5'));var db=require(_0x010c('0x6'))['db'];var utils=require(_0x010c('0x7'));var logger=require(_0x010c('0x8'))(_0x010c('0x9'));var config=require(_0x010c('0xa'));var jayson=require(_0x010c('0xb'));var client=jayson[_0x010c('0xc')][_0x010c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5c2df2,_0x257b43,_0x49fec9){return new BPromise(function(_0x4fc308,_0x5f42dc){return client['request'](_0x5c2df2,_0x49fec9)[_0x010c('0xe')](function(_0x421a38){logger[_0x010c('0xf')]('SquareRecording,\x20%s,\x20%s',_0x257b43,_0x010c('0x10'));logger[_0x010c('0x11')](_0x010c('0x12'),_0x257b43,'request\x20sent',JSON['stringify'](_0x421a38));if(_0x421a38['error']){if(_0x421a38[_0x010c('0x13')][_0x010c('0x14')]===0x1f4){logger[_0x010c('0x13')](_0x010c('0x15'),_0x257b43,_0x421a38[_0x010c('0x13')][_0x010c('0x16')]);return _0x5f42dc(_0x421a38[_0x010c('0x13')][_0x010c('0x16')]);}logger[_0x010c('0x13')](_0x010c('0x15'),_0x257b43,_0x421a38[_0x010c('0x13')][_0x010c('0x16')]);return _0x4fc308(_0x421a38['error'][_0x010c('0x16')]);}else{logger['info']('SquareRecording,\x20%s,\x20%s',_0x257b43,_0x010c('0x10'));_0x4fc308(_0x421a38[_0x010c('0x17')]['message']);}})[_0x010c('0x18')](function(_0x5211c6){logger[_0x010c('0x13')](_0x010c('0x15'),_0x257b43,_0x5211c6);_0x5f42dc(_0x5211c6);});});}exports[_0x010c('0x19')]=function(_0x2ec8){var _0x4fcc9d=this;return new Promise(function(_0x315245,_0x565d54){return db['SquareRecording']['create'](_0x2ec8['body'],{'raw':_0x2ec8[_0x010c('0x1a')]?_0x2ec8[_0x010c('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x010c('0xe')](function(_0x4d7567){logger[_0x010c('0xf')](_0x010c('0x19'),_0x2ec8);logger[_0x010c('0x11')](_0x010c('0x19'),_0x2ec8,JSON['stringify'](_0x4d7567));_0x315245(_0x4d7567);})[_0x010c('0x18')](function(_0x44e25e){logger[_0x010c('0x13')](_0x010c('0x19'),_0x44e25e['message'],_0x2ec8);_0x565d54(_0x4fcc9d[_0x010c('0x13')](0x1f4,_0x44e25e['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 1244310..d62c0e0 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x42a721,_0x2098e5){var _0x300148=function(_0x585f3c){while(--_0x585f3c){_0x42a721['push'](_0x42a721['shift']());}};_0x300148(++_0x2098e5);}(_0xe706,0xa3));var _0x6e70=function(_0x3a3c3d,_0x3b8542){_0x3a3c3d=_0x3a3c3d-0x0;var _0xf3142f=_0xe706[_0x3a3c3d];return _0xf3142f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _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(_0x158358,_0x125fa5){var _0x450745=function(_0x4e5324){while(--_0x4e5324){_0x158358['push'](_0x158358['shift']());}};_0x450745(++_0x125fa5);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'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 a035f1a..5d498b5 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 _0x2c12=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0xf085c9,_0x47b098){var _0x45a63c=function(_0x15783b){while(--_0x15783b){_0xf085c9['push'](_0xf085c9['shift']());}};_0x45a63c(++_0x47b098);}(_0x2c12,0x1b4));var _0x22c1=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0x2c12[_0x32b993];return _0x482780;};'use strict';var Sequelize=require(_0x22c1('0x0'));module[_0x22c1('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x22c1('0x2')]},'channel':{'type':Sequelize[_0x22c1('0x2')]},'language':{'type':Sequelize[_0x22c1('0x2')]},'type':{'type':Sequelize[_0x22c1('0x2')]},'uniqueid':{'type':Sequelize[_0x22c1('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x22c1('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x22c1('0x2')]},'callington':{'type':Sequelize[_0x22c1('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x22c1('0x2')]},'context':{'type':Sequelize[_0x22c1('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x22c1('0x2')]},'enhanced':{'type':Sequelize[_0x22c1('0x2')]},'accountcode':{'type':Sequelize[_0x22c1('0x2')]},'threadid':{'type':Sequelize[_0x22c1('0x2')]},'project_name':{'type':Sequelize[_0x22c1('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x22c1('0x3')]},'bot':{'type':Sequelize[_0x22c1('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x3e04=['exports','STRING','DATE','sequelize'];(function(_0x51ce3e,_0x4a1ed5){var _0x175562=function(_0x2e739d){while(--_0x2e739d){_0x51ce3e['push'](_0x51ce3e['shift']());}};_0x175562(++_0x4a1ed5);}(_0x3e04,0x16f));var _0x43e0=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x3e04[_0x5c3c0b];return _0x52ecd2;};'use strict';var Sequelize=require(_0x43e0('0x0'));module[_0x43e0('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x43e0('0x2')]},'request':{'type':Sequelize[_0x43e0('0x2')]},'channel':{'type':Sequelize[_0x43e0('0x2')]},'language':{'type':Sequelize[_0x43e0('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x43e0('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x43e0('0x2')]},'callingani2':{'type':Sequelize[_0x43e0('0x2')]},'callington':{'type':Sequelize[_0x43e0('0x2')]},'callingtns':{'type':Sequelize[_0x43e0('0x2')]},'dnid':{'type':Sequelize[_0x43e0('0x2')]},'rdnis':{'type':Sequelize[_0x43e0('0x2')]},'context':{'type':Sequelize[_0x43e0('0x2')]},'extension':{'type':Sequelize[_0x43e0('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x43e0('0x2')]},'accountcode':{'type':Sequelize[_0x43e0('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x43e0('0x2')]},'joinAt':{'type':Sequelize[_0x43e0('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 6b845db..07b6c58 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 _0x3431=['undefined','limit','count','offset','set','reject','save','then','error','stack','name','send','index','map','SquareReport','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','show','params','rawAttributes','fields','includeAll','include','find','catch','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json'];(function(_0x15d9b6,_0x4e0772){var _0xb44729=function(_0x4d9e0c){while(--_0x4d9e0c){_0x15d9b6['push'](_0x15d9b6['shift']());}};_0xb44729(++_0x4e0772);}(_0x3431,0xc0));var _0x1343=function(_0x2f48cd,_0x46a75a){_0x2f48cd=_0x2f48cd-0x0;var _0x193ae2=_0x3431[_0x2f48cd];return _0x193ae2;};'use strict';var emlformat=require(_0x1343('0x0'));var rimraf=require(_0x1343('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1343('0x2'));var rp=require(_0x1343('0x3'));var moment=require(_0x1343('0x4'));var BPromise=require(_0x1343('0x5'));var Mustache=require(_0x1343('0x6'));var util=require('util');var path=require(_0x1343('0x7'));var sox=require(_0x1343('0x8'));var csv=require(_0x1343('0x9'));var ejs=require(_0x1343('0xa'));var fs=require('fs');var fs_extra=require(_0x1343('0xb'));var _=require(_0x1343('0xc'));var squel=require(_0x1343('0xd'));var crypto=require(_0x1343('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1343('0xf'));var toCsv=require(_0x1343('0x9'));var querystring=require(_0x1343('0x10'));var Papa=require(_0x1343('0x11'));var Redis=require(_0x1343('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1343('0x13'));var as=require(_0x1343('0x14'));var hardwareService=require(_0x1343('0x15'));var logger=require(_0x1343('0x16'))(_0x1343('0x17'));var utils=require(_0x1343('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1343('0x19'))['db'];function respondWithStatusCode(_0x589c14,_0x21e379){_0x21e379=_0x21e379||0xcc;return function(_0x37662f){if(_0x37662f){return _0x589c14[_0x1343('0x1a')](_0x21e379);}return _0x589c14[_0x1343('0x1b')](_0x21e379)[_0x1343('0x1c')]();};}function respondWithResult(_0x4247bc,_0x53ca94){_0x53ca94=_0x53ca94||0xc8;return function(_0x46d99d){if(_0x46d99d){return _0x4247bc[_0x1343('0x1b')](_0x53ca94)[_0x1343('0x1d')](_0x46d99d);}};}function respondWithFilteredResult(_0x2706d9,_0x3794db){return function(_0x5c923e){if(_0x5c923e){var _0x4839de=typeof _0x3794db['offset']===_0x1343('0x1e')&&typeof _0x3794db[_0x1343('0x1f')]===_0x1343('0x1e');var _0x4230bf=_0x5c923e[_0x1343('0x20')];var _0x39b6d6=_0x4839de?0x0:_0x3794db[_0x1343('0x21')];var _0x402cc0=_0x4839de?_0x5c923e[_0x1343('0x20')]:_0x3794db[_0x1343('0x21')]+_0x3794db['limit'];var _0x2b61a0;if(_0x402cc0>=_0x4230bf){_0x402cc0=_0x4230bf;_0x2b61a0=0xc8;}else{_0x2b61a0=0xce;}_0x2706d9[_0x1343('0x1b')](_0x2b61a0);return _0x2706d9[_0x1343('0x22')]('Content-Range',_0x39b6d6+'-'+_0x402cc0+'/'+_0x4230bf)[_0x1343('0x1d')](_0x5c923e);}return null;};}function patchUpdates(_0x2488fe){return function(_0x333eef){try{jsonpatch['apply'](_0x333eef,_0x2488fe,!![]);}catch(_0x2c9efe){return BPromise[_0x1343('0x23')](_0x2c9efe);}return _0x333eef[_0x1343('0x24')]();};}function saveUpdates(_0xc1171a,_0x50d03f){return function(_0x1f64d9){if(_0x1f64d9){return _0x1f64d9['update'](_0xc1171a)[_0x1343('0x25')](function(_0x52a0a0){return _0x52a0a0;});}return null;};}function removeEntity(_0x433e82,_0x399205){return function(_0x3a757f){if(_0x3a757f){return _0x3a757f['destroy']()[_0x1343('0x25')](function(){_0x433e82[_0x1343('0x1b')](0xcc)[_0x1343('0x1c')]();});}};}function handleEntityNotFound(_0x24c940,_0x13e078){return function(_0x5c1f90){if(!_0x5c1f90){_0x24c940[_0x1343('0x1a')](0x194);}return _0x5c1f90;};}function handleError(_0x3091c0,_0x3b562e){_0x3b562e=_0x3b562e||0x1f4;return function(_0x2d79c9){logger[_0x1343('0x26')](_0x2d79c9[_0x1343('0x27')]);if(_0x2d79c9[_0x1343('0x28')]){delete _0x2d79c9[_0x1343('0x28')];}_0x3091c0['status'](_0x3b562e)[_0x1343('0x29')](_0x2d79c9);};}exports[_0x1343('0x2a')]=function(_0x5279d4,_0x193b23){var _0x1dac67={},_0x51d364={},_0x258bd8={'count':0x0,'rows':[]};var _0x71f6c=_[_0x1343('0x2b')](db[_0x1343('0x2c')]['rawAttributes'],function(_0xe9709f){return{'name':_0xe9709f['fieldName'],'type':_0xe9709f[_0x1343('0x2d')][_0x1343('0x2e')]};});_0x51d364[_0x1343('0x2f')]=_[_0x1343('0x2b')](_0x71f6c,_0x1343('0x28'));_0x51d364['query']=_[_0x1343('0x30')](_0x5279d4[_0x1343('0x31')]);_0x51d364[_0x1343('0x32')]=_[_0x1343('0x33')](_0x51d364[_0x1343('0x2f')],_0x51d364[_0x1343('0x31')]);_0x1dac67[_0x1343('0x34')]=_['intersection'](_0x51d364['model'],qs['fields'](_0x5279d4[_0x1343('0x31')]['fields']));_0x1dac67[_0x1343('0x34')]=_0x1dac67[_0x1343('0x34')][_0x1343('0x35')]?_0x1dac67[_0x1343('0x34')]:_0x51d364['model'];if(!_0x5279d4['query'][_0x1343('0x36')]('nolimit')){_0x1dac67['limit']=qs[_0x1343('0x1f')](_0x5279d4['query'][_0x1343('0x1f')]);_0x1dac67[_0x1343('0x21')]=qs[_0x1343('0x21')](_0x5279d4[_0x1343('0x31')]['offset']);}_0x1dac67[_0x1343('0x37')]=qs[_0x1343('0x38')](_0x5279d4[_0x1343('0x31')][_0x1343('0x38')]);_0x1dac67[_0x1343('0x39')]=qs['filters'](_[_0x1343('0x3a')](_0x5279d4['query'],_0x51d364['filters']),_0x71f6c);if(_0x5279d4[_0x1343('0x31')][_0x1343('0x3b')]){_0x1dac67[_0x1343('0x39')]=_[_0x1343('0x3c')](_0x1dac67[_0x1343('0x39')],{'$or':_[_0x1343('0x2b')](_0x71f6c,function(_0x35c00a){if(_0x35c00a[_0x1343('0x2d')]!==_0x1343('0x3d')){var _0x1eeb4b={};_0x1eeb4b[_0x35c00a[_0x1343('0x28')]]={'$like':'%'+_0x5279d4['query'][_0x1343('0x3b')]+'%'};return _0x1eeb4b;}})});}_0x1dac67=_['merge']({},_0x1dac67,_0x5279d4['options']);var _0x3ccb10={'where':_0x1dac67[_0x1343('0x39')]};return db[_0x1343('0x2c')][_0x1343('0x20')](_0x3ccb10)[_0x1343('0x25')](function(_0x40ad53){_0x258bd8[_0x1343('0x20')]=_0x40ad53;if(_0x5279d4[_0x1343('0x31')]['includeAll']){_0x1dac67['include']=[{'all':!![]}];}return db[_0x1343('0x2c')]['findAll'](_0x1dac67);})[_0x1343('0x25')](function(_0x2d423d){_0x258bd8['rows']=_0x2d423d;return _0x258bd8;})['then'](respondWithFilteredResult(_0x193b23,_0x1dac67))['catch'](handleError(_0x193b23,null));};exports[_0x1343('0x3e')]=function(_0x570fd0,_0x406690){var _0x23ae6e={'raw':!![],'where':{'id':_0x570fd0[_0x1343('0x3f')]['id']}},_0x2d4bae={};_0x2d4bae[_0x1343('0x2f')]=_[_0x1343('0x30')](db[_0x1343('0x2c')][_0x1343('0x40')]);_0x2d4bae[_0x1343('0x31')]=_[_0x1343('0x30')](_0x570fd0[_0x1343('0x31')]);_0x2d4bae['filters']=_[_0x1343('0x33')](_0x2d4bae[_0x1343('0x2f')],_0x2d4bae['query']);_0x23ae6e[_0x1343('0x34')]=_['intersection'](_0x2d4bae[_0x1343('0x2f')],qs['fields'](_0x570fd0[_0x1343('0x31')][_0x1343('0x41')]));_0x23ae6e[_0x1343('0x34')]=_0x23ae6e[_0x1343('0x34')][_0x1343('0x35')]?_0x23ae6e[_0x1343('0x34')]:_0x2d4bae[_0x1343('0x2f')];if(_0x570fd0[_0x1343('0x31')][_0x1343('0x42')]){_0x23ae6e[_0x1343('0x43')]=[{'all':!![]}];}_0x23ae6e=_[_0x1343('0x3c')]({},_0x23ae6e,_0x570fd0['options']);return db['SquareReport'][_0x1343('0x44')](_0x23ae6e)[_0x1343('0x25')](handleEntityNotFound(_0x406690,null))[_0x1343('0x25')](respondWithResult(_0x406690,null))[_0x1343('0x45')](handleError(_0x406690,null));};exports[_0x1343('0x46')]=function(_0x4b66ae,_0x100946){return db['SquareReport'][_0x1343('0x46')](_0x4b66ae[_0x1343('0x47')],{})[_0x1343('0x25')](respondWithResult(_0x100946,0xc9))[_0x1343('0x45')](handleError(_0x100946,null));};exports['update']=function(_0x5e79aa,_0x252bcd){if(_0x5e79aa[_0x1343('0x47')]['id']){delete _0x5e79aa['body']['id'];}return db[_0x1343('0x2c')][_0x1343('0x44')]({'where':{'id':_0x5e79aa[_0x1343('0x3f')]['id']}})[_0x1343('0x25')](handleEntityNotFound(_0x252bcd,null))[_0x1343('0x25')](saveUpdates(_0x5e79aa[_0x1343('0x47')],null))['then'](respondWithResult(_0x252bcd,null))['catch'](handleError(_0x252bcd,null));};exports[_0x1343('0x48')]=function(_0x26b257,_0x50d9e1){return db[_0x1343('0x2c')][_0x1343('0x44')]({'where':{'id':_0x26b257[_0x1343('0x3f')]['id']}})[_0x1343('0x25')](handleEntityNotFound(_0x50d9e1,null))[_0x1343('0x25')](removeEntity(_0x50d9e1,null))[_0x1343('0x45')](handleError(_0x50d9e1,null));};exports['describe']=function(_0x43be9a,_0x3fa909){return db[_0x1343('0x2c')][_0x1343('0x49')]()['then'](respondWithResult(_0x3fa909,null))['catch'](handleError(_0x3fa909,null));}; \ No newline at end of file +var _0xb788=['body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','name','index','map','SquareReport','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','keys','rawAttributes','find','catch','create'];(function(_0x1ffd1b,_0x20e496){var _0x35640a=function(_0x345deb){while(--_0x345deb){_0x1ffd1b['push'](_0x1ffd1b['shift']());}};_0x35640a(++_0x20e496);}(_0xb788,0xe6));var _0x8b78=function(_0x2b9c0c,_0x4678a3){_0x2b9c0c=_0x2b9c0c-0x0;var _0xd8577b=_0xb788[_0x2b9c0c];return _0xd8577b;};'use strict';var emlformat=require(_0x8b78('0x0'));var rimraf=require(_0x8b78('0x1'));var zipdir=require(_0x8b78('0x2'));var jsonpatch=require(_0x8b78('0x3'));var rp=require(_0x8b78('0x4'));var moment=require('moment');var BPromise=require(_0x8b78('0x5'));var Mustache=require(_0x8b78('0x6'));var util=require(_0x8b78('0x7'));var path=require(_0x8b78('0x8'));var sox=require(_0x8b78('0x9'));var csv=require(_0x8b78('0xa'));var ejs=require(_0x8b78('0xb'));var fs=require('fs');var fs_extra=require(_0x8b78('0xc'));var _=require(_0x8b78('0xd'));var squel=require(_0x8b78('0xe'));var crypto=require(_0x8b78('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x8b78('0x10'));var toCsv=require(_0x8b78('0xa'));var querystring=require(_0x8b78('0x11'));var Papa=require(_0x8b78('0x12'));var Redis=require(_0x8b78('0x13'));var authService=require(_0x8b78('0x14'));var qs=require(_0x8b78('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b78('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x8b78('0x17'));var config=require(_0x8b78('0x18'));var licenseUtil=require(_0x8b78('0x19'));var db=require(_0x8b78('0x1a'))['db'];function respondWithStatusCode(_0x1c8f70,_0x62fb36){_0x62fb36=_0x62fb36||0xcc;return function(_0x4dc61d){if(_0x4dc61d){return _0x1c8f70[_0x8b78('0x1b')](_0x62fb36);}return _0x1c8f70[_0x8b78('0x1c')](_0x62fb36)[_0x8b78('0x1d')]();};}function respondWithResult(_0x1044ba,_0x32ffcc){_0x32ffcc=_0x32ffcc||0xc8;return function(_0x254235){if(_0x254235){return _0x1044ba['status'](_0x32ffcc)[_0x8b78('0x1e')](_0x254235);}};}function respondWithFilteredResult(_0x119f6b,_0x31635d){return function(_0xe635ba){if(_0xe635ba){var _0x5a96cc=typeof _0x31635d[_0x8b78('0x1f')]===_0x8b78('0x20')&&typeof _0x31635d['limit']===_0x8b78('0x20');var _0x3948b9=_0xe635ba['count'];var _0x459369=_0x5a96cc?0x0:_0x31635d['offset'];var _0x4151b1=_0x5a96cc?_0xe635ba[_0x8b78('0x21')]:_0x31635d['offset']+_0x31635d[_0x8b78('0x22')];var _0x51ae63;if(_0x4151b1>=_0x3948b9){_0x4151b1=_0x3948b9;_0x51ae63=0xc8;}else{_0x51ae63=0xce;}_0x119f6b['status'](_0x51ae63);return _0x119f6b[_0x8b78('0x23')](_0x8b78('0x24'),_0x459369+'-'+_0x4151b1+'/'+_0x3948b9)[_0x8b78('0x1e')](_0xe635ba);}return null;};}function patchUpdates(_0x2240c4){return function(_0x16552a){try{jsonpatch[_0x8b78('0x25')](_0x16552a,_0x2240c4,!![]);}catch(_0x2bbd6f){return BPromise[_0x8b78('0x26')](_0x2bbd6f);}return _0x16552a[_0x8b78('0x27')]();};}function saveUpdates(_0x162c78,_0x3a5d67){return function(_0x110b6f){if(_0x110b6f){return _0x110b6f[_0x8b78('0x28')](_0x162c78)['then'](function(_0x1a485a){return _0x1a485a;});}return null;};}function removeEntity(_0x27b618,_0x494626){return function(_0x3f4e90){if(_0x3f4e90){return _0x3f4e90[_0x8b78('0x29')]()[_0x8b78('0x2a')](function(){_0x27b618['status'](0xcc)[_0x8b78('0x1d')]();});}};}function handleEntityNotFound(_0x2c0b18,_0x4d58f7){return function(_0x340aad){if(!_0x340aad){_0x2c0b18['sendStatus'](0x194);}return _0x340aad;};}function handleError(_0x41ca61,_0x1d6db5){_0x1d6db5=_0x1d6db5||0x1f4;return function(_0x584e76){logger[_0x8b78('0x2b')](_0x584e76['stack']);if(_0x584e76['name']){delete _0x584e76[_0x8b78('0x2c')];}_0x41ca61['status'](_0x1d6db5)['send'](_0x584e76);};}exports[_0x8b78('0x2d')]=function(_0x200e57,_0x244c46){var _0x274982={},_0x3b654d={},_0x101dcc={'count':0x0,'rows':[]};var _0x20f87b=_[_0x8b78('0x2e')](db[_0x8b78('0x2f')]['rawAttributes'],function(_0x36637b){return{'name':_0x36637b['fieldName'],'type':_0x36637b[_0x8b78('0x30')][_0x8b78('0x31')]};});_0x3b654d[_0x8b78('0x32')]=_['map'](_0x20f87b,_0x8b78('0x2c'));_0x3b654d[_0x8b78('0x33')]=_['keys'](_0x200e57[_0x8b78('0x33')]);_0x3b654d[_0x8b78('0x34')]=_[_0x8b78('0x35')](_0x3b654d[_0x8b78('0x32')],_0x3b654d[_0x8b78('0x33')]);_0x274982[_0x8b78('0x36')]=_[_0x8b78('0x35')](_0x3b654d[_0x8b78('0x32')],qs[_0x8b78('0x37')](_0x200e57[_0x8b78('0x33')]['fields']));_0x274982['attributes']=_0x274982[_0x8b78('0x36')][_0x8b78('0x38')]?_0x274982[_0x8b78('0x36')]:_0x3b654d[_0x8b78('0x32')];if(!_0x200e57[_0x8b78('0x33')]['hasOwnProperty'](_0x8b78('0x39'))){_0x274982['limit']=qs['limit'](_0x200e57[_0x8b78('0x33')][_0x8b78('0x22')]);_0x274982[_0x8b78('0x1f')]=qs[_0x8b78('0x1f')](_0x200e57[_0x8b78('0x33')][_0x8b78('0x1f')]);}_0x274982[_0x8b78('0x3a')]=qs['sort'](_0x200e57['query']['sort']);_0x274982[_0x8b78('0x3b')]=qs[_0x8b78('0x34')](_[_0x8b78('0x3c')](_0x200e57['query'],_0x3b654d[_0x8b78('0x34')]),_0x20f87b);if(_0x200e57[_0x8b78('0x33')][_0x8b78('0x3d')]){_0x274982[_0x8b78('0x3b')]=_[_0x8b78('0x3e')](_0x274982[_0x8b78('0x3b')],{'$or':_[_0x8b78('0x2e')](_0x20f87b,function(_0x3fe4f7){if(_0x3fe4f7[_0x8b78('0x30')]!==_0x8b78('0x3f')){var _0x2839bb={};_0x2839bb[_0x3fe4f7['name']]={'$like':'%'+_0x200e57[_0x8b78('0x33')]['filter']+'%'};return _0x2839bb;}})});}_0x274982=_[_0x8b78('0x3e')]({},_0x274982,_0x200e57[_0x8b78('0x40')]);var _0x2d652c={'where':_0x274982[_0x8b78('0x3b')]};return db[_0x8b78('0x2f')][_0x8b78('0x21')](_0x2d652c)['then'](function(_0x5b3aea){_0x101dcc[_0x8b78('0x21')]=_0x5b3aea;if(_0x200e57[_0x8b78('0x33')][_0x8b78('0x41')]){_0x274982[_0x8b78('0x42')]=[{'all':!![]}];}return db[_0x8b78('0x2f')][_0x8b78('0x43')](_0x274982);})['then'](function(_0x125a2d){_0x101dcc['rows']=_0x125a2d;return _0x101dcc;})[_0x8b78('0x2a')](respondWithFilteredResult(_0x244c46,_0x274982))['catch'](handleError(_0x244c46,null));};exports['show']=function(_0x167ca3,_0x51ca18){var _0x12f1ef={'raw':!![],'where':{'id':_0x167ca3[_0x8b78('0x44')]['id']}},_0x210f23={};_0x210f23[_0x8b78('0x32')]=_[_0x8b78('0x45')](db[_0x8b78('0x2f')][_0x8b78('0x46')]);_0x210f23[_0x8b78('0x33')]=_[_0x8b78('0x45')](_0x167ca3[_0x8b78('0x33')]);_0x210f23[_0x8b78('0x34')]=_[_0x8b78('0x35')](_0x210f23[_0x8b78('0x32')],_0x210f23['query']);_0x12f1ef[_0x8b78('0x36')]=_[_0x8b78('0x35')](_0x210f23[_0x8b78('0x32')],qs[_0x8b78('0x37')](_0x167ca3[_0x8b78('0x33')][_0x8b78('0x37')]));_0x12f1ef['attributes']=_0x12f1ef['attributes'][_0x8b78('0x38')]?_0x12f1ef[_0x8b78('0x36')]:_0x210f23[_0x8b78('0x32')];if(_0x167ca3[_0x8b78('0x33')]['includeAll']){_0x12f1ef[_0x8b78('0x42')]=[{'all':!![]}];}_0x12f1ef=_[_0x8b78('0x3e')]({},_0x12f1ef,_0x167ca3['options']);return db[_0x8b78('0x2f')][_0x8b78('0x47')](_0x12f1ef)[_0x8b78('0x2a')](handleEntityNotFound(_0x51ca18,null))[_0x8b78('0x2a')](respondWithResult(_0x51ca18,null))[_0x8b78('0x48')](handleError(_0x51ca18,null));};exports[_0x8b78('0x49')]=function(_0x28a451,_0x1a29f6){return db[_0x8b78('0x2f')][_0x8b78('0x49')](_0x28a451[_0x8b78('0x4a')],{})[_0x8b78('0x2a')](respondWithResult(_0x1a29f6,0xc9))[_0x8b78('0x48')](handleError(_0x1a29f6,null));};exports[_0x8b78('0x28')]=function(_0x5b5140,_0x54e42d){if(_0x5b5140['body']['id']){delete _0x5b5140[_0x8b78('0x4a')]['id'];}return db['SquareReport'][_0x8b78('0x47')]({'where':{'id':_0x5b5140[_0x8b78('0x44')]['id']}})[_0x8b78('0x2a')](handleEntityNotFound(_0x54e42d,null))[_0x8b78('0x2a')](saveUpdates(_0x5b5140[_0x8b78('0x4a')],null))[_0x8b78('0x2a')](respondWithResult(_0x54e42d,null))[_0x8b78('0x48')](handleError(_0x54e42d,null));};exports[_0x8b78('0x29')]=function(_0x50fe7a,_0x53e86b){return db['SquareReport'][_0x8b78('0x47')]({'where':{'id':_0x50fe7a[_0x8b78('0x44')]['id']}})[_0x8b78('0x2a')](handleEntityNotFound(_0x53e86b,null))[_0x8b78('0x2a')](removeEntity(_0x53e86b,null))[_0x8b78('0x48')](handleError(_0x53e86b,null));};exports[_0x8b78('0x4b')]=function(_0x5bfdda,_0x6675a6){return db[_0x8b78('0x2f')][_0x8b78('0x4b')]()[_0x8b78('0x2a')](respondWithResult(_0x6675a6,null))[_0x8b78('0x48')](handleError(_0x6675a6,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index c0c2a6d..ef2a297 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 _0xc3e4=['report_square','uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports'];(function(_0x412c23,_0x53f8fb){var _0x3622df=function(_0x426330){while(--_0x426330){_0x412c23['push'](_0x412c23['shift']());}};_0x3622df(++_0x53f8fb);}(_0xc3e4,0x194));var _0x4c3e=function(_0x24d590,_0x3e4dee){_0x24d590=_0x24d590-0x0;var _0x2bdbe8=_0xc3e4[_0x24d590];return _0x2bdbe8;};'use strict';var _=require(_0x4c3e('0x0'));var util=require(_0x4c3e('0x1'));var logger=require(_0x4c3e('0x2'))(_0x4c3e('0x3'));var moment=require(_0x4c3e('0x4'));var BPromise=require(_0x4c3e('0x5'));var rp=require(_0x4c3e('0x6'));var fs=require('fs');var path=require(_0x4c3e('0x7'));var rimraf=require(_0x4c3e('0x8'));var config=require(_0x4c3e('0x9'));var attributes=require(_0x4c3e('0xa'));module[_0x4c3e('0xb')]=function(_0x2727bf,_0x2d0231){return _0x2727bf['define']('SquareReport',attributes,{'tableName':_0x4c3e('0xc'),'paranoid':![],'indexes':[{'name':_0x4c3e('0xd'),'fields':[_0x4c3e('0xe'),'project_name']},{'name':'leaveAt','fields':[_0x4c3e('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x73a7=['define','SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes'];(function(_0x1f153a,_0x4a5e67){var _0x54c5ae=function(_0x577cda){while(--_0x577cda){_0x1f153a['push'](_0x1f153a['shift']());}};_0x54c5ae(++_0x4a5e67);}(_0x73a7,0x149));var _0x773a=function(_0x4b9cfe,_0x10415b){_0x4b9cfe=_0x4b9cfe-0x0;var _0x455e7c=_0x73a7[_0x4b9cfe];return _0x455e7c;};'use strict';var _=require(_0x773a('0x0'));var util=require(_0x773a('0x1'));var logger=require(_0x773a('0x2'))(_0x773a('0x3'));var moment=require(_0x773a('0x4'));var BPromise=require(_0x773a('0x5'));var rp=require(_0x773a('0x6'));var fs=require('fs');var path=require(_0x773a('0x7'));var rimraf=require(_0x773a('0x8'));var config=require(_0x773a('0x9'));var attributes=require(_0x773a('0xa'));module['exports']=function(_0xcdac86,_0x75752b){return _0xcdac86[_0x773a('0xb')](_0x773a('0xc'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x773a('0xd'),'fields':[_0x773a('0xe'),_0x773a('0xf')]},{'name':_0x773a('0x10'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 1f7692a..345a965 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 _0x3c76=['UpdateSquareReport','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','info','SquareReport,\x20%s,\x20%s','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSquareReport','SquareReport','options','raw','then','update','body'];(function(_0x35c46e,_0x10deaa){var _0x3f926=function(_0x3a8584){while(--_0x3a8584){_0x35c46e['push'](_0x35c46e['shift']());}};_0x3f926(++_0x10deaa);}(_0x3c76,0x139));var _0x63c7=function(_0x1f3b31,_0x162586){_0x1f3b31=_0x1f3b31-0x0;var _0x58a27e=_0x3c76[_0x1f3b31];return _0x58a27e;};'use strict';var _=require(_0x63c7('0x0'));var util=require('util');var moment=require(_0x63c7('0x1'));var BPromise=require(_0x63c7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x63c7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x63c7('0x4'));var logger=require('../../config/logger')(_0x63c7('0x5'));var config=require(_0x63c7('0x6'));var jayson=require(_0x63c7('0x7'));var client=jayson[_0x63c7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x197d99,_0x1ec142,_0x484fb2){return new BPromise(function(_0xb20944,_0x35b56c){return client['request'](_0x197d99,_0x484fb2)['then'](function(_0x1d1e42){logger[_0x63c7('0x9')](_0x63c7('0xa'),_0x1ec142,'request\x20sent');logger['debug'](_0x63c7('0xb'),_0x1ec142,_0x63c7('0xc'),JSON[_0x63c7('0xd')](_0x1d1e42));if(_0x1d1e42[_0x63c7('0xe')]){if(_0x1d1e42[_0x63c7('0xe')]['code']===0x1f4){logger[_0x63c7('0xe')]('SquareReport,\x20%s,\x20%s',_0x1ec142,_0x1d1e42[_0x63c7('0xe')][_0x63c7('0xf')]);return _0x35b56c(_0x1d1e42[_0x63c7('0xe')][_0x63c7('0xf')]);}logger['error'](_0x63c7('0xa'),_0x1ec142,_0x1d1e42[_0x63c7('0xe')][_0x63c7('0xf')]);return _0xb20944(_0x1d1e42[_0x63c7('0xe')][_0x63c7('0xf')]);}else{logger[_0x63c7('0x9')](_0x63c7('0xa'),_0x1ec142,_0x63c7('0xc'));_0xb20944(_0x1d1e42[_0x63c7('0x10')]['message']);}})[_0x63c7('0x11')](function(_0x35df51){logger[_0x63c7('0xe')]('SquareReport,\x20%s,\x20%s',_0x1ec142,_0x35df51);_0x35b56c(_0x35df51);});});}exports[_0x63c7('0x12')]=function(_0x23cadb){var _0x4cb063=this;return new Promise(function(_0x211703,_0x53e1e5){return db[_0x63c7('0x13')]['create'](_0x23cadb['body'],{'raw':_0x23cadb[_0x63c7('0x14')]?_0x23cadb['options'][_0x63c7('0x15')]===undefined?!![]:![]:!![]})[_0x63c7('0x16')](function(_0x23649e){logger[_0x63c7('0x9')](_0x63c7('0x12'),_0x23cadb);logger['debug']('CreateSquareReport',_0x23cadb,JSON[_0x63c7('0xd')](_0x23649e));_0x211703(_0x23649e);})[_0x63c7('0x11')](function(_0x471b57){logger[_0x63c7('0xe')](_0x63c7('0x12'),_0x471b57[_0x63c7('0xf')],_0x23cadb);_0x53e1e5(_0x4cb063['error'](0x1f4,_0x471b57[_0x63c7('0xf')]));});});};exports['UpdateSquareReport']=function(_0x502165){var _0x23ebb6=this;return new Promise(function(_0x56306c,_0x3fa0cf){return db[_0x63c7('0x13')][_0x63c7('0x17')](_0x502165[_0x63c7('0x18')],{'raw':_0x502165[_0x63c7('0x14')]?_0x502165[_0x63c7('0x14')][_0x63c7('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x502165[_0x63c7('0x14')]?_0x502165[_0x63c7('0x14')]['where']||null:null,'attributes':_0x502165['options']?_0x502165[_0x63c7('0x14')]['attributes']||null:null,'limit':_0x502165['options']?_0x502165[_0x63c7('0x14')]['limit']||null:null})[_0x63c7('0x16')](function(_0x1fa62a){logger[_0x63c7('0x9')](_0x63c7('0x19'),_0x502165);logger['debug'](_0x63c7('0x19'),_0x502165,JSON['stringify'](_0x1fa62a));_0x56306c(_0x1fa62a);})[_0x63c7('0x11')](function(_0x1d3acf){logger[_0x63c7('0xe')]('UpdateSquareReport',_0x1d3acf['message'],_0x502165);_0x3fa0cf(_0x23ebb6[_0x63c7('0xe')](0x1f4,_0x1d3acf[_0x63c7('0xf')]));});});}; \ No newline at end of file +var _0x760f=['client','http','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareReport','create','options','raw','then','CreateSquareReport','catch','UpdateSquareReport','update','attributes','lodash','util','../../mysqldb','../../config/logger','rpc'];(function(_0x5f51d2,_0x4f0133){var _0x24bf08=function(_0x25e6b5){while(--_0x25e6b5){_0x5f51d2['push'](_0x5f51d2['shift']());}};_0x24bf08(++_0x4f0133);}(_0x760f,0x133));var _0xf760=function(_0x45bf7d,_0x395393){_0x45bf7d=_0x45bf7d-0x0;var _0x351c5b=_0x760f[_0x45bf7d];return _0x351c5b;};'use strict';var _=require(_0xf760('0x0'));var util=require(_0xf760('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf760('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xf760('0x3'))(_0xf760('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf760('0x5')][_0xf760('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x588f39,_0x424f82,_0x442878){return new BPromise(function(_0x2b0e1c,_0x3d34d0){return client['request'](_0x588f39,_0x442878)['then'](function(_0x1ff4c8){logger[_0xf760('0x7')](_0xf760('0x8'),_0x424f82,_0xf760('0x9'));logger[_0xf760('0xa')](_0xf760('0xb'),_0x424f82,_0xf760('0x9'),JSON[_0xf760('0xc')](_0x1ff4c8));if(_0x1ff4c8[_0xf760('0xd')]){if(_0x1ff4c8['error'][_0xf760('0xe')]===0x1f4){logger[_0xf760('0xd')](_0xf760('0x8'),_0x424f82,_0x1ff4c8[_0xf760('0xd')][_0xf760('0xf')]);return _0x3d34d0(_0x1ff4c8[_0xf760('0xd')][_0xf760('0xf')]);}logger[_0xf760('0xd')](_0xf760('0x8'),_0x424f82,_0x1ff4c8['error'][_0xf760('0xf')]);return _0x2b0e1c(_0x1ff4c8[_0xf760('0xd')]['message']);}else{logger['info'](_0xf760('0x8'),_0x424f82,_0xf760('0x9'));_0x2b0e1c(_0x1ff4c8['result'][_0xf760('0xf')]);}})['catch'](function(_0xa1c39e){logger['error'](_0xf760('0x8'),_0x424f82,_0xa1c39e);_0x3d34d0(_0xa1c39e);});});}exports['CreateSquareReport']=function(_0x646847){var _0xaaf1e9=this;return new Promise(function(_0x229c5c,_0x106cfb){return db[_0xf760('0x10')][_0xf760('0x11')](_0x646847['body'],{'raw':_0x646847['options']?_0x646847[_0xf760('0x12')][_0xf760('0x13')]===undefined?!![]:![]:!![]})[_0xf760('0x14')](function(_0x455d5f){logger['info'](_0xf760('0x15'),_0x646847);logger['debug'](_0xf760('0x15'),_0x646847,JSON[_0xf760('0xc')](_0x455d5f));_0x229c5c(_0x455d5f);})[_0xf760('0x16')](function(_0x13c36b){logger[_0xf760('0xd')](_0xf760('0x15'),_0x13c36b['message'],_0x646847);_0x106cfb(_0xaaf1e9['error'](0x1f4,_0x13c36b[_0xf760('0xf')]));});});};exports[_0xf760('0x17')]=function(_0x5a628f){var _0x4c5941=this;return new Promise(function(_0x265e1f,_0x1cd185){return db[_0xf760('0x10')][_0xf760('0x18')](_0x5a628f['body'],{'raw':_0x5a628f[_0xf760('0x12')]?_0x5a628f[_0xf760('0x12')][_0xf760('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a628f['options']?_0x5a628f[_0xf760('0x12')]['where']||null:null,'attributes':_0x5a628f[_0xf760('0x12')]?_0x5a628f[_0xf760('0x12')][_0xf760('0x19')]||null:null,'limit':_0x5a628f[_0xf760('0x12')]?_0x5a628f[_0xf760('0x12')]['limit']||null:null})[_0xf760('0x14')](function(_0x4052ee){logger['info'](_0xf760('0x17'),_0x5a628f);logger[_0xf760('0xa')](_0xf760('0x17'),_0x5a628f,JSON[_0xf760('0xc')](_0x4052ee));_0x265e1f(_0x4052ee);})[_0xf760('0x16')](function(_0x59f020){logger[_0xf760('0xd')]('UpdateSquareReport',_0x59f020[_0xf760('0xf')],_0x5a628f);_0x1cd185(_0x4c5941[_0xf760('0xd')](0x1f4,_0x59f020['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 22cd815..715467e 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 _0x04ca=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show','create','put'];(function(_0x9356ea,_0x3b073c){var _0x23886e=function(_0xa4c385){while(--_0xa4c385){_0x9356ea['push'](_0x9356ea['shift']());}};_0x23886e(++_0x3b073c);}(_0x04ca,0x130));var _0xa04c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x04ca[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xa04c('0x0'));var util=require('util');var path=require(_0xa04c('0x1'));var timeout=require(_0xa04c('0x2'));var express=require(_0xa04c('0x3'));var router=express[_0xa04c('0x4')]();var fs_extra=require(_0xa04c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa04c('0x6'));var config=require('../../config/environment');var controller=require(_0xa04c('0x7'));router[_0xa04c('0x8')]('/',auth[_0xa04c('0x9')](),controller[_0xa04c('0xa')]);router[_0xa04c('0x8')](_0xa04c('0xb'),auth[_0xa04c('0x9')](),controller['describe']);router['get'](_0xa04c('0xc'),auth[_0xa04c('0x9')](),controller[_0xa04c('0xd')]);router['post']('/',auth[_0xa04c('0x9')](),controller[_0xa04c('0xe')]);router[_0xa04c('0xf')](_0xa04c('0xc'),auth[_0xa04c('0x9')](),controller[_0xa04c('0x10')]);router[_0xa04c('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa04c('0x12')]);module[_0xa04c('0x13')]=router; \ No newline at end of file +var _0xd8c7=['Router','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','post','create','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x4c9faf,_0x1f480b){var _0x31860a=function(_0x230e46){while(--_0x230e46){_0x4c9faf['push'](_0x4c9faf['shift']());}};_0x31860a(++_0x1f480b);}(_0xd8c7,0x14b));var _0x7d8c=function(_0x491d85,_0x32599a){_0x491d85=_0x491d85-0x0;var _0x4a4609=_0xd8c7[_0x491d85];return _0x4a4609;};'use strict';var multer=require(_0x7d8c('0x0'));var util=require(_0x7d8c('0x1'));var path=require(_0x7d8c('0x2'));var timeout=require(_0x7d8c('0x3'));var express=require(_0x7d8c('0x4'));var router=express[_0x7d8c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7d8c('0x6'));router[_0x7d8c('0x7')]('/',auth[_0x7d8c('0x8')](),controller[_0x7d8c('0x9')]);router[_0x7d8c('0x7')](_0x7d8c('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x7d8c('0xb'),auth[_0x7d8c('0x8')](),controller['show']);router[_0x7d8c('0xc')]('/',auth[_0x7d8c('0x8')](),controller[_0x7d8c('0xd')]);router['put']('/:id',auth[_0x7d8c('0x8')](),controller['update']);router[_0x7d8c('0xe')](_0x7d8c('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7d8c('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 827cf8a..10cb282 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 _0x437d=['TEXT','sequelize','exports','STRING'];(function(_0x199235,_0x5bc36a){var _0x53c9a1=function(_0x39392d){while(--_0x39392d){_0x199235['push'](_0x199235['shift']());}};_0x53c9a1(++_0x5bc36a);}(_0x437d,0x1c1));var _0xd437=function(_0x1e458e,_0x48b732){_0x1e458e=_0x1e458e-0x0;var _0x3cebcb=_0x437d[_0x1e458e];return _0x3cebcb;};'use strict';var Sequelize=require(_0xd437('0x0'));module[_0xd437('0x1')]={'uniqueid':{'type':Sequelize[_0xd437('0x2')]},'node':{'type':Sequelize[_0xd437('0x2')]},'application':{'type':Sequelize[_0xd437('0x2')]},'data':{'type':Sequelize[_0xd437('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8634=['STRING','TEXT','sequelize','exports'];(function(_0x422be2,_0x1c439e){var _0x1b820e=function(_0x513cc8){while(--_0x513cc8){_0x422be2['push'](_0x422be2['shift']());}};_0x1b820e(++_0x1c439e);}(_0x8634,0xa2));var _0x4863=function(_0x5756f8,_0x22b6d5){_0x5756f8=_0x5756f8-0x0;var _0x3bb749=_0x8634[_0x5756f8];return _0x3bb749;};'use strict';var Sequelize=require(_0x4863('0x0'));module[_0x4863('0x1')]={'uniqueid':{'type':Sequelize[_0x4863('0x2')]},'node':{'type':Sequelize[_0x4863('0x2')]},'application':{'type':Sequelize[_0x4863('0x2')]},'data':{'type':Sequelize[_0x4863('0x3')]},'project_name':{'type':Sequelize[_0x4863('0x2')]},'callerid':{'type':Sequelize[_0x4863('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 0a1f47b..7fbd5fc 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 _0xf7dd=['rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','rows','includeAll','include','find','catch','create','body','params','describe'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xf7dd,0xd2));var _0xdf7d=function(_0x317943,_0x1a4079){_0x317943=_0x317943-0x0;var _0x5a578e=_0xf7dd[_0x317943];return _0x5a578e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf7d('0x0'));var zipdir=require(_0xdf7d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdf7d('0x2'));var moment=require(_0xdf7d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdf7d('0x4'));var util=require('util');var path=require(_0xdf7d('0x5'));var sox=require(_0xdf7d('0x6'));var csv=require(_0xdf7d('0x7'));var ejs=require(_0xdf7d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xdf7d('0x9'));var jsforce=require(_0xdf7d('0xa'));var deskjs=require(_0xdf7d('0xb'));var toCsv=require(_0xdf7d('0x7'));var querystring=require(_0xdf7d('0xc'));var Papa=require('papaparse');var Redis=require(_0xdf7d('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdf7d('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf7d('0xf'))(_0xdf7d('0x10'));var utils=require(_0xdf7d('0x11'));var config=require(_0xdf7d('0x12'));var licenseUtil=require(_0xdf7d('0x13'));var db=require(_0xdf7d('0x14'))['db'];function respondWithStatusCode(_0x259e4c,_0x372696){_0x372696=_0x372696||0xcc;return function(_0x509b40){if(_0x509b40){return _0x259e4c['sendStatus'](_0x372696);}return _0x259e4c[_0xdf7d('0x15')](_0x372696)['end']();};}function respondWithResult(_0x15071f,_0x1faa0e){_0x1faa0e=_0x1faa0e||0xc8;return function(_0x1c84e6){if(_0x1c84e6){return _0x15071f['status'](_0x1faa0e)[_0xdf7d('0x16')](_0x1c84e6);}};}function respondWithFilteredResult(_0x458d5e,_0x56e451){return function(_0x273f12){if(_0x273f12){var _0x12ecf8=typeof _0x56e451[_0xdf7d('0x17')]==='undefined'&&typeof _0x56e451[_0xdf7d('0x18')]===_0xdf7d('0x19');var _0x195d93=_0x273f12['count'];var _0x34263d=_0x12ecf8?0x0:_0x56e451['offset'];var _0x332f64=_0x12ecf8?_0x273f12[_0xdf7d('0x1a')]:_0x56e451[_0xdf7d('0x17')]+_0x56e451[_0xdf7d('0x18')];var _0x1248ff;if(_0x332f64>=_0x195d93){_0x332f64=_0x195d93;_0x1248ff=0xc8;}else{_0x1248ff=0xce;}_0x458d5e[_0xdf7d('0x15')](_0x1248ff);return _0x458d5e[_0xdf7d('0x1b')]('Content-Range',_0x34263d+'-'+_0x332f64+'/'+_0x195d93)[_0xdf7d('0x16')](_0x273f12);}return null;};}function patchUpdates(_0x269c69){return function(_0x2808b7){try{jsonpatch[_0xdf7d('0x1c')](_0x2808b7,_0x269c69,!![]);}catch(_0x21a5c9){return BPromise[_0xdf7d('0x1d')](_0x21a5c9);}return _0x2808b7[_0xdf7d('0x1e')]();};}function saveUpdates(_0x5a4ca2,_0x39e459){return function(_0x1f0927){if(_0x1f0927){return _0x1f0927[_0xdf7d('0x1f')](_0x5a4ca2)[_0xdf7d('0x20')](function(_0x44f62a){return _0x44f62a;});}return null;};}function removeEntity(_0x47ed3c,_0x49b762){return function(_0x1524da){if(_0x1524da){return _0x1524da[_0xdf7d('0x21')]()[_0xdf7d('0x20')](function(){_0x47ed3c[_0xdf7d('0x15')](0xcc)[_0xdf7d('0x22')]();});}};}function handleEntityNotFound(_0x2b0b3e,_0x4e1f39){return function(_0x51ccad){if(!_0x51ccad){_0x2b0b3e[_0xdf7d('0x23')](0x194);}return _0x51ccad;};}function handleError(_0x8677e5,_0x158980){_0x158980=_0x158980||0x1f4;return function(_0x56cd43){logger[_0xdf7d('0x24')](_0x56cd43['stack']);if(_0x56cd43[_0xdf7d('0x25')]){delete _0x56cd43[_0xdf7d('0x25')];}_0x8677e5[_0xdf7d('0x15')](_0x158980)[_0xdf7d('0x26')](_0x56cd43);};}exports[_0xdf7d('0x27')]=function(_0x2fc0ff,_0x4bc799){var _0x5160fa={},_0xe22e14={},_0x2c6bc0={'count':0x0,'rows':[]};var _0x58f00e=_[_0xdf7d('0x28')](db[_0xdf7d('0x29')][_0xdf7d('0x2a')],function(_0x30cefd){return{'name':_0x30cefd[_0xdf7d('0x2b')],'type':_0x30cefd[_0xdf7d('0x2c')]['key']};});_0xe22e14[_0xdf7d('0x2d')]=_['map'](_0x58f00e,_0xdf7d('0x25'));_0xe22e14[_0xdf7d('0x2e')]=_[_0xdf7d('0x2f')](_0x2fc0ff[_0xdf7d('0x2e')]);_0xe22e14['filters']=_[_0xdf7d('0x30')](_0xe22e14['model'],_0xe22e14[_0xdf7d('0x2e')]);_0x5160fa[_0xdf7d('0x31')]=_['intersection'](_0xe22e14[_0xdf7d('0x2d')],qs[_0xdf7d('0x32')](_0x2fc0ff[_0xdf7d('0x2e')][_0xdf7d('0x32')]));_0x5160fa[_0xdf7d('0x31')]=_0x5160fa[_0xdf7d('0x31')][_0xdf7d('0x33')]?_0x5160fa['attributes']:_0xe22e14[_0xdf7d('0x2d')];if(!_0x2fc0ff[_0xdf7d('0x2e')][_0xdf7d('0x34')]('nolimit')){_0x5160fa['limit']=qs[_0xdf7d('0x18')](_0x2fc0ff[_0xdf7d('0x2e')][_0xdf7d('0x18')]);_0x5160fa[_0xdf7d('0x17')]=qs[_0xdf7d('0x17')](_0x2fc0ff[_0xdf7d('0x2e')][_0xdf7d('0x17')]);}_0x5160fa[_0xdf7d('0x35')]=qs['sort'](_0x2fc0ff[_0xdf7d('0x2e')][_0xdf7d('0x36')]);_0x5160fa[_0xdf7d('0x37')]=qs[_0xdf7d('0x38')](_['pick'](_0x2fc0ff['query'],_0xe22e14['filters']),_0x58f00e);if(_0x2fc0ff[_0xdf7d('0x2e')][_0xdf7d('0x39')]){_0x5160fa[_0xdf7d('0x37')]=_[_0xdf7d('0x3a')](_0x5160fa['where'],{'$or':_[_0xdf7d('0x28')](_0x58f00e,function(_0xc30bbb){if(_0xc30bbb[_0xdf7d('0x2c')]!==_0xdf7d('0x3b')){var _0x11be66={};_0x11be66[_0xc30bbb[_0xdf7d('0x25')]]={'$like':'%'+_0x2fc0ff[_0xdf7d('0x2e')][_0xdf7d('0x39')]+'%'};return _0x11be66;}})});}_0x5160fa=_[_0xdf7d('0x3a')]({},_0x5160fa,_0x2fc0ff[_0xdf7d('0x3c')]);var _0x4c112e={'where':_0x5160fa[_0xdf7d('0x37')]};return db[_0xdf7d('0x29')]['count'](_0x4c112e)[_0xdf7d('0x20')](function(_0x33b23b){_0x2c6bc0[_0xdf7d('0x1a')]=_0x33b23b;if(_0x2fc0ff[_0xdf7d('0x2e')]['includeAll']){_0x5160fa['include']=[{'all':!![]}];}return db[_0xdf7d('0x29')]['findAll'](_0x5160fa);})[_0xdf7d('0x20')](function(_0x462fca){_0x2c6bc0[_0xdf7d('0x3d')]=_0x462fca;return _0x2c6bc0;})[_0xdf7d('0x20')](respondWithFilteredResult(_0x4bc799,_0x5160fa))['catch'](handleError(_0x4bc799,null));};exports['show']=function(_0x414396,_0x42ddff){var _0x4acaad={'raw':!![],'where':{'id':_0x414396['params']['id']}},_0x26aade={};_0x26aade[_0xdf7d('0x2d')]=_[_0xdf7d('0x2f')](db[_0xdf7d('0x29')][_0xdf7d('0x2a')]);_0x26aade[_0xdf7d('0x2e')]=_['keys'](_0x414396[_0xdf7d('0x2e')]);_0x26aade[_0xdf7d('0x38')]=_['intersection'](_0x26aade['model'],_0x26aade[_0xdf7d('0x2e')]);_0x4acaad['attributes']=_['intersection'](_0x26aade[_0xdf7d('0x2d')],qs['fields'](_0x414396[_0xdf7d('0x2e')]['fields']));_0x4acaad[_0xdf7d('0x31')]=_0x4acaad[_0xdf7d('0x31')][_0xdf7d('0x33')]?_0x4acaad['attributes']:_0x26aade[_0xdf7d('0x2d')];if(_0x414396[_0xdf7d('0x2e')][_0xdf7d('0x3e')]){_0x4acaad[_0xdf7d('0x3f')]=[{'all':!![]}];}_0x4acaad=_[_0xdf7d('0x3a')]({},_0x4acaad,_0x414396['options']);return db['SquareDetailsReport'][_0xdf7d('0x40')](_0x4acaad)[_0xdf7d('0x20')](handleEntityNotFound(_0x42ddff,null))[_0xdf7d('0x20')](respondWithResult(_0x42ddff,null))[_0xdf7d('0x41')](handleError(_0x42ddff,null));};exports['create']=function(_0x4a1888,_0x5babd7){return db[_0xdf7d('0x29')][_0xdf7d('0x42')](_0x4a1888[_0xdf7d('0x43')],{})[_0xdf7d('0x20')](respondWithResult(_0x5babd7,0xc9))[_0xdf7d('0x41')](handleError(_0x5babd7,null));};exports[_0xdf7d('0x1f')]=function(_0x1e1e49,_0x4c5f55){if(_0x1e1e49['body']['id']){delete _0x1e1e49[_0xdf7d('0x43')]['id'];}return db[_0xdf7d('0x29')]['find']({'where':{'id':_0x1e1e49['params']['id']}})[_0xdf7d('0x20')](handleEntityNotFound(_0x4c5f55,null))[_0xdf7d('0x20')](saveUpdates(_0x1e1e49[_0xdf7d('0x43')],null))[_0xdf7d('0x20')](respondWithResult(_0x4c5f55,null))[_0xdf7d('0x41')](handleError(_0x4c5f55,null));};exports['destroy']=function(_0x4a9dca,_0x2de96a){return db[_0xdf7d('0x29')][_0xdf7d('0x40')]({'where':{'id':_0x4a9dca[_0xdf7d('0x44')]['id']}})[_0xdf7d('0x20')](handleEntityNotFound(_0x2de96a,null))['then'](removeEntity(_0x2de96a,null))['catch'](handleError(_0x2de96a,null));};exports[_0xdf7d('0x45')]=function(_0x373797,_0x30f7ca){return db[_0xdf7d('0x29')][_0xdf7d('0x45')]()[_0xdf7d('0x20')](respondWithResult(_0x30f7ca,null))[_0xdf7d('0x41')](handleError(_0x30f7ca,null));}; \ No newline at end of file +var _0x3142=['catch','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','SquareDetailsReport','findAll','rows','show','params','find'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0x3142,0x1e3));var _0x2314=function(_0x4f15d2,_0x2086cb){_0x4f15d2=_0x4f15d2-0x0;var _0x2522b6=_0x3142[_0x4f15d2];return _0x2522b6;};'use strict';var emlformat=require(_0x2314('0x0'));var rimraf=require(_0x2314('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2314('0x2'));var rp=require(_0x2314('0x3'));var moment=require(_0x2314('0x4'));var BPromise=require(_0x2314('0x5'));var Mustache=require(_0x2314('0x6'));var util=require(_0x2314('0x7'));var path=require(_0x2314('0x8'));var sox=require(_0x2314('0x9'));var csv=require(_0x2314('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2314('0xb'));var _=require(_0x2314('0xc'));var squel=require(_0x2314('0xd'));var crypto=require(_0x2314('0xe'));var jsforce=require(_0x2314('0xf'));var deskjs=require(_0x2314('0x10'));var toCsv=require(_0x2314('0xa'));var querystring=require(_0x2314('0x11'));var Papa=require('papaparse');var Redis=require(_0x2314('0x12'));var authService=require(_0x2314('0x13'));var qs=require(_0x2314('0x14'));var as=require(_0x2314('0x15'));var hardwareService=require(_0x2314('0x16'));var logger=require(_0x2314('0x17'))(_0x2314('0x18'));var utils=require(_0x2314('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x2314('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4062d9,_0x308521){_0x308521=_0x308521||0xcc;return function(_0x35beb2){if(_0x35beb2){return _0x4062d9[_0x2314('0x1b')](_0x308521);}return _0x4062d9[_0x2314('0x1c')](_0x308521)['end']();};}function respondWithResult(_0x49d40d,_0x5d40ef){_0x5d40ef=_0x5d40ef||0xc8;return function(_0x1a7957){if(_0x1a7957){return _0x49d40d[_0x2314('0x1c')](_0x5d40ef)[_0x2314('0x1d')](_0x1a7957);}};}function respondWithFilteredResult(_0x169800,_0x4626bb){return function(_0x502598){if(_0x502598){var _0x4a5c92=typeof _0x4626bb[_0x2314('0x1e')]===_0x2314('0x1f')&&typeof _0x4626bb[_0x2314('0x20')]===_0x2314('0x1f');var _0x5b2064=_0x502598[_0x2314('0x21')];var _0x1c9167=_0x4a5c92?0x0:_0x4626bb[_0x2314('0x1e')];var _0x104324=_0x4a5c92?_0x502598['count']:_0x4626bb[_0x2314('0x1e')]+_0x4626bb['limit'];var _0x10495f;if(_0x104324>=_0x5b2064){_0x104324=_0x5b2064;_0x10495f=0xc8;}else{_0x10495f=0xce;}_0x169800[_0x2314('0x1c')](_0x10495f);return _0x169800[_0x2314('0x22')](_0x2314('0x23'),_0x1c9167+'-'+_0x104324+'/'+_0x5b2064)['json'](_0x502598);}return null;};}function patchUpdates(_0x30ff4e){return function(_0xbf9285){try{jsonpatch[_0x2314('0x24')](_0xbf9285,_0x30ff4e,!![]);}catch(_0x140a83){return BPromise['reject'](_0x140a83);}return _0xbf9285[_0x2314('0x25')]();};}function saveUpdates(_0x15eca0,_0x443787){return function(_0x383e18){if(_0x383e18){return _0x383e18[_0x2314('0x26')](_0x15eca0)[_0x2314('0x27')](function(_0x383d7f){return _0x383d7f;});}return null;};}function removeEntity(_0x21eeec,_0xa9c736){return function(_0x653141){if(_0x653141){return _0x653141[_0x2314('0x28')]()['then'](function(){_0x21eeec[_0x2314('0x1c')](0xcc)[_0x2314('0x29')]();});}};}function handleEntityNotFound(_0x1ebc59,_0x466e2f){return function(_0x22c467){if(!_0x22c467){_0x1ebc59[_0x2314('0x1b')](0x194);}return _0x22c467;};}function handleError(_0x4b5887,_0x1e844d){_0x1e844d=_0x1e844d||0x1f4;return function(_0x4d502e){logger[_0x2314('0x2a')](_0x4d502e['stack']);if(_0x4d502e[_0x2314('0x2b')]){delete _0x4d502e[_0x2314('0x2b')];}_0x4b5887[_0x2314('0x1c')](_0x1e844d)[_0x2314('0x2c')](_0x4d502e);};}exports[_0x2314('0x2d')]=function(_0x27cea7,_0x2dae75){var _0x48e0f0={},_0x410327={},_0x25d77c={'count':0x0,'rows':[]};var _0x188c10=_[_0x2314('0x2e')](db['SquareDetailsReport'][_0x2314('0x2f')],function(_0x4c0fea){return{'name':_0x4c0fea[_0x2314('0x30')],'type':_0x4c0fea['type'][_0x2314('0x31')]};});_0x410327[_0x2314('0x32')]=_[_0x2314('0x2e')](_0x188c10,_0x2314('0x2b'));_0x410327['query']=_[_0x2314('0x33')](_0x27cea7[_0x2314('0x34')]);_0x410327[_0x2314('0x35')]=_[_0x2314('0x36')](_0x410327[_0x2314('0x32')],_0x410327[_0x2314('0x34')]);_0x48e0f0[_0x2314('0x37')]=_['intersection'](_0x410327['model'],qs['fields'](_0x27cea7[_0x2314('0x34')][_0x2314('0x38')]));_0x48e0f0[_0x2314('0x37')]=_0x48e0f0[_0x2314('0x37')][_0x2314('0x39')]?_0x48e0f0['attributes']:_0x410327[_0x2314('0x32')];if(!_0x27cea7['query'][_0x2314('0x3a')](_0x2314('0x3b'))){_0x48e0f0['limit']=qs['limit'](_0x27cea7[_0x2314('0x34')]['limit']);_0x48e0f0[_0x2314('0x1e')]=qs[_0x2314('0x1e')](_0x27cea7[_0x2314('0x34')]['offset']);}_0x48e0f0[_0x2314('0x3c')]=qs[_0x2314('0x3d')](_0x27cea7['query'][_0x2314('0x3d')]);_0x48e0f0[_0x2314('0x3e')]=qs[_0x2314('0x35')](_[_0x2314('0x3f')](_0x27cea7[_0x2314('0x34')],_0x410327[_0x2314('0x35')]),_0x188c10);if(_0x27cea7[_0x2314('0x34')][_0x2314('0x40')]){_0x48e0f0['where']=_[_0x2314('0x41')](_0x48e0f0[_0x2314('0x3e')],{'$or':_[_0x2314('0x2e')](_0x188c10,function(_0x1db52d){if(_0x1db52d[_0x2314('0x42')]!==_0x2314('0x43')){var _0x805407={};_0x805407[_0x1db52d['name']]={'$like':'%'+_0x27cea7[_0x2314('0x34')][_0x2314('0x40')]+'%'};return _0x805407;}})});}_0x48e0f0=_[_0x2314('0x41')]({},_0x48e0f0,_0x27cea7[_0x2314('0x44')]);var _0x2c0dbd={'where':_0x48e0f0[_0x2314('0x3e')]};return db['SquareDetailsReport'][_0x2314('0x21')](_0x2c0dbd)[_0x2314('0x27')](function(_0x3e0ae3){_0x25d77c[_0x2314('0x21')]=_0x3e0ae3;if(_0x27cea7['query'][_0x2314('0x45')]){_0x48e0f0[_0x2314('0x46')]=[{'all':!![]}];}return db[_0x2314('0x47')][_0x2314('0x48')](_0x48e0f0);})['then'](function(_0x4b3dd3){_0x25d77c[_0x2314('0x49')]=_0x4b3dd3;return _0x25d77c;})[_0x2314('0x27')](respondWithFilteredResult(_0x2dae75,_0x48e0f0))['catch'](handleError(_0x2dae75,null));};exports[_0x2314('0x4a')]=function(_0x4f1466,_0x20e6d2){var _0xf74fcb={'raw':!![],'where':{'id':_0x4f1466[_0x2314('0x4b')]['id']}},_0xe73044={};_0xe73044['model']=_[_0x2314('0x33')](db[_0x2314('0x47')][_0x2314('0x2f')]);_0xe73044[_0x2314('0x34')]=_[_0x2314('0x33')](_0x4f1466[_0x2314('0x34')]);_0xe73044[_0x2314('0x35')]=_[_0x2314('0x36')](_0xe73044[_0x2314('0x32')],_0xe73044[_0x2314('0x34')]);_0xf74fcb[_0x2314('0x37')]=_[_0x2314('0x36')](_0xe73044[_0x2314('0x32')],qs[_0x2314('0x38')](_0x4f1466[_0x2314('0x34')][_0x2314('0x38')]));_0xf74fcb['attributes']=_0xf74fcb['attributes'][_0x2314('0x39')]?_0xf74fcb[_0x2314('0x37')]:_0xe73044[_0x2314('0x32')];if(_0x4f1466[_0x2314('0x34')]['includeAll']){_0xf74fcb['include']=[{'all':!![]}];}_0xf74fcb=_[_0x2314('0x41')]({},_0xf74fcb,_0x4f1466[_0x2314('0x44')]);return db['SquareDetailsReport'][_0x2314('0x4c')](_0xf74fcb)[_0x2314('0x27')](handleEntityNotFound(_0x20e6d2,null))['then'](respondWithResult(_0x20e6d2,null))[_0x2314('0x4d')](handleError(_0x20e6d2,null));};exports['create']=function(_0x29a56f,_0x4106b6){return db[_0x2314('0x47')]['create'](_0x29a56f['body'],{})[_0x2314('0x27')](respondWithResult(_0x4106b6,0xc9))[_0x2314('0x4d')](handleError(_0x4106b6,null));};exports[_0x2314('0x26')]=function(_0x184f62,_0x119c1e){if(_0x184f62['body']['id']){delete _0x184f62[_0x2314('0x4e')]['id'];}return db[_0x2314('0x47')][_0x2314('0x4c')]({'where':{'id':_0x184f62[_0x2314('0x4b')]['id']}})['then'](handleEntityNotFound(_0x119c1e,null))[_0x2314('0x27')](saveUpdates(_0x184f62[_0x2314('0x4e')],null))[_0x2314('0x27')](respondWithResult(_0x119c1e,null))[_0x2314('0x4d')](handleError(_0x119c1e,null));};exports['destroy']=function(_0x228df3,_0x2cc37c){return db[_0x2314('0x47')][_0x2314('0x4c')]({'where':{'id':_0x228df3[_0x2314('0x4b')]['id']}})[_0x2314('0x27')](handleEntityNotFound(_0x2cc37c,null))[_0x2314('0x27')](removeEntity(_0x2cc37c,null))[_0x2314('0x4d')](handleError(_0x2cc37c,null));};exports['describe']=function(_0x5df1b4,_0xeed9c3){return db['SquareDetailsReport'][_0x2314('0x4f')]()[_0x2314('0x27')](respondWithResult(_0xeed9c3,null))[_0x2314('0x4d')](handleError(_0xeed9c3,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index fccf5eb..06e5960 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 _0x00c9=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','report_square_details','util','api'];(function(_0x23e6bb,_0x5c2d69){var _0x1e3b4c=function(_0x1afc46){while(--_0x1afc46){_0x23e6bb['push'](_0x23e6bb['shift']());}};_0x1e3b4c(++_0x5c2d69);}(_0x00c9,0x198));var _0x900c=function(_0x50150f,_0x92b2ca){_0x50150f=_0x50150f-0x0;var _0x3f3764=_0x00c9[_0x50150f];return _0x3f3764;};'use strict';var _=require('lodash');var util=require(_0x900c('0x0'));var logger=require('../../config/logger')(_0x900c('0x1'));var moment=require(_0x900c('0x2'));var BPromise=require(_0x900c('0x3'));var rp=require(_0x900c('0x4'));var fs=require('fs');var path=require(_0x900c('0x5'));var rimraf=require(_0x900c('0x6'));var config=require(_0x900c('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0x900c('0x8')]=function(_0x34aaa0,_0x34f908){return _0x34aaa0['define']('SquareDetailsReport',attributes,{'tableName':_0x900c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbb72=['exports','report_square_details','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x3627f4,_0x513a27){var _0x351a03=function(_0x573ef2){while(--_0x573ef2){_0x3627f4['push'](_0x3627f4['shift']());}};_0x351a03(++_0x513a27);}(_0xbb72,0x197));var _0x2bb7=function(_0x37d87d,_0x2dc914){_0x37d87d=_0x37d87d-0x0;var _0x10f6f0=_0xbb72[_0x37d87d];return _0x10f6f0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2bb7('0x0'))('api');var moment=require('moment');var BPromise=require(_0x2bb7('0x1'));var rp=require(_0x2bb7('0x2'));var fs=require('fs');var path=require(_0x2bb7('0x3'));var rimraf=require(_0x2bb7('0x4'));var config=require(_0x2bb7('0x5'));var attributes=require(_0x2bb7('0x6'));module[_0x2bb7('0x7')]=function(_0x2f897c,_0x1777e8){return _0x2f897c['define']('SquareDetailsReport',attributes,{'tableName':_0x2bb7('0x8'),'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 fdd1552..f53ee64 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 _0x55f1=['SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info'];(function(_0x3708e6,_0x55e776){var _0x56fd59=function(_0x294cd5){while(--_0x294cd5){_0x3708e6['push'](_0x3708e6['shift']());}};_0x56fd59(++_0x55e776);}(_0x55f1,0x9b));var _0x155f=function(_0x5a5453,_0x137c44){_0x5a5453=_0x5a5453-0x0;var _0x13c561=_0x55f1[_0x5a5453];return _0x13c561;};'use strict';var _=require(_0x155f('0x0'));var util=require('util');var moment=require(_0x155f('0x1'));var BPromise=require(_0x155f('0x2'));var rs=require(_0x155f('0x3'));var fs=require('fs');var Redis=require(_0x155f('0x4'));var db=require(_0x155f('0x5'))['db'];var utils=require(_0x155f('0x6'));var logger=require(_0x155f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x155f('0x8'));var client=jayson['client'][_0x155f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22e07f,_0x39b14d,_0x1bcf84){return new BPromise(function(_0x2a0a02,_0x9fc06e){return client[_0x155f('0xa')](_0x22e07f,_0x1bcf84)[_0x155f('0xb')](function(_0x100e9a){logger[_0x155f('0xc')](_0x155f('0xd'),_0x39b14d,_0x155f('0xe'));logger[_0x155f('0xf')](_0x155f('0x10'),_0x39b14d,_0x155f('0xe'),JSON[_0x155f('0x11')](_0x100e9a));if(_0x100e9a[_0x155f('0x12')]){if(_0x100e9a['error'][_0x155f('0x13')]===0x1f4){logger[_0x155f('0x12')](_0x155f('0xd'),_0x39b14d,_0x100e9a['error']['message']);return _0x9fc06e(_0x100e9a[_0x155f('0x12')][_0x155f('0x14')]);}logger[_0x155f('0x12')](_0x155f('0xd'),_0x39b14d,_0x100e9a[_0x155f('0x12')][_0x155f('0x14')]);return _0x2a0a02(_0x100e9a[_0x155f('0x12')]['message']);}else{logger[_0x155f('0xc')](_0x155f('0xd'),_0x39b14d,'request\x20sent');_0x2a0a02(_0x100e9a[_0x155f('0x15')][_0x155f('0x14')]);}})[_0x155f('0x16')](function(_0x7ad1c2){logger[_0x155f('0x12')](_0x155f('0xd'),_0x39b14d,_0x7ad1c2);_0x9fc06e(_0x7ad1c2);});});}exports[_0x155f('0x17')]=function(_0x343a1e){var _0x2f5b83=this;return new Promise(function(_0x407e26,_0x2e248d){return db[_0x155f('0x18')][_0x155f('0x19')](_0x343a1e[_0x155f('0x1a')],{'raw':_0x343a1e[_0x155f('0x1b')]?_0x343a1e[_0x155f('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x155f('0xb')](function(_0x26a322){logger[_0x155f('0xc')](_0x155f('0x17'),_0x343a1e);logger['debug']('CreateSquareDetailsReport',_0x343a1e,JSON['stringify'](_0x26a322));_0x407e26(_0x26a322);})[_0x155f('0x16')](function(_0x3a40b4){logger[_0x155f('0x12')](_0x155f('0x17'),_0x3a40b4[_0x155f('0x14')],_0x343a1e);_0x2e248d(_0x2f5b83['error'](0x1f4,_0x3a40b4[_0x155f('0x14')]));});});}; \ No newline at end of file +var _0x087b=['debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result','create','body','options','CreateSquareDetailsReport','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x19b6af,_0x570032){var _0x4b6fd9=function(_0x21fcdb){while(--_0x21fcdb){_0x19b6af['push'](_0x19b6af['shift']());}};_0x4b6fd9(++_0x570032);}(_0x087b,0x11a));var _0xb087=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x087b[_0x2aec52];return _0x3b8835;};'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});function respondWithRpcPromise(_0xecf080,_0x36ac30,_0x3cebbf){return new BPromise(function(_0x6d83fb,_0x1dbe9f){return client[_0xb087('0xb')](_0xecf080,_0x3cebbf)[_0xb087('0xc')](function(_0x23cdd7){logger[_0xb087('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x36ac30,_0xb087('0xe'));logger[_0xb087('0xf')](_0xb087('0x10'),_0x36ac30,_0xb087('0xe'),JSON[_0xb087('0x11')](_0x23cdd7));if(_0x23cdd7[_0xb087('0x12')]){if(_0x23cdd7[_0xb087('0x12')]['code']===0x1f4){logger[_0xb087('0x12')](_0xb087('0x13'),_0x36ac30,_0x23cdd7[_0xb087('0x12')]['message']);return _0x1dbe9f(_0x23cdd7[_0xb087('0x12')][_0xb087('0x14')]);}logger[_0xb087('0x12')](_0xb087('0x13'),_0x36ac30,_0x23cdd7[_0xb087('0x12')][_0xb087('0x14')]);return _0x6d83fb(_0x23cdd7[_0xb087('0x12')][_0xb087('0x14')]);}else{logger[_0xb087('0xd')](_0xb087('0x13'),_0x36ac30,'request\x20sent');_0x6d83fb(_0x23cdd7[_0xb087('0x15')][_0xb087('0x14')]);}})['catch'](function(_0xcc4426){logger[_0xb087('0x12')](_0xb087('0x13'),_0x36ac30,_0xcc4426);_0x1dbe9f(_0xcc4426);});});}exports['CreateSquareDetailsReport']=function(_0x330005){var _0x3c680f=this;return new Promise(function(_0x17200d,_0x45d074){return db['SquareDetailsReport'][_0xb087('0x16')](_0x330005[_0xb087('0x17')],{'raw':_0x330005[_0xb087('0x18')]?_0x330005[_0xb087('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5ea3dc){logger['info'](_0xb087('0x19'),_0x330005);logger[_0xb087('0xf')](_0xb087('0x19'),_0x330005,JSON[_0xb087('0x11')](_0x5ea3dc));_0x17200d(_0x5ea3dc);})[_0xb087('0x1a')](function(_0x258b4c){logger[_0xb087('0x12')]('CreateSquareDetailsReport',_0x258b4c[_0xb087('0x14')],_0x330005);_0x45d074(_0x3c680f[_0xb087('0x12')](0x1f4,_0x258b4c[_0xb087('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 967fd32..b1fb691 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 _0x7a17=['get','/process/:pid/kill','isAuthenticated','killProcess','exports','express','Router','./system.controller','index'];(function(_0x3e612d,_0x2f0836){var _0xdd57f5=function(_0x2fdafb){while(--_0x2fdafb){_0x3e612d['push'](_0x3e612d['shift']());}};_0xdd57f5(++_0x2f0836);}(_0x7a17,0x17f));var _0x77a1=function(_0x35ffac,_0x5a4c69){_0x35ffac=_0x35ffac-0x0;var _0x202a54=_0x7a17[_0x35ffac];return _0x202a54;};'use strict';var express=require(_0x77a1('0x0'));var router=express[_0x77a1('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x77a1('0x2'));router['get']('/',auth['isAuthenticated'](),controller[_0x77a1('0x3')]);router[_0x77a1('0x4')](_0x77a1('0x5'),auth[_0x77a1('0x6')](),controller[_0x77a1('0x7')]);module[_0x77a1('0x8')]=router; \ No newline at end of file +var _0xc55b=['/process/:pid/kill','exports','express','Router','./system.controller','isAuthenticated','index'];(function(_0x4f7c9b,_0x1b83b6){var _0x5149f3=function(_0xef5f6e){while(--_0xef5f6e){_0x4f7c9b['push'](_0x4f7c9b['shift']());}};_0x5149f3(++_0x1b83b6);}(_0xc55b,0x121));var _0xbc55=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc55b[_0x19e35c];return _0x3e1fe8;};'use strict';var express=require(_0xbc55('0x0'));var router=express[_0xbc55('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xbc55('0x2'));router['get']('/',auth[_0xbc55('0x3')](),controller[_0xbc55('0x4')]);router['get'](_0xbc55('0x5'),auth['isAuthenticated'](),controller['killProcess']);module[_0xbc55('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 974efad..bda254a 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 _0x6c73=['api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','exec'];(function(_0x4bcb3c,_0x192122){var _0xfe09bb=function(_0xcd8ad2){while(--_0xcd8ad2){_0x4bcb3c['push'](_0x4bcb3c['shift']());}};_0xfe09bb(++_0x192122);}(_0x6c73,0x1be));var _0x36c7=function(_0x6dd3c1,_0x53cf52){_0x6dd3c1=_0x6dd3c1-0x0;var _0xdef05a=_0x6c73[_0x6dd3c1];return _0xdef05a;};'use strict';var info=require('systeminformation');var exec=require(_0x36c7('0x0'))[_0x36c7('0x1')];var logger=require('../../config/logger')(_0x36c7('0x2'));var util=require(_0x36c7('0x3'));var BPromise=require(_0x36c7('0x4'));var _=require(_0x36c7('0x5'));function handleError(_0x25dfac,_0x27809f,_0x30c2cb){_0x27809f=_0x27809f||0x1f4;return function(_0x3228ee){logger[_0x36c7('0x6')](_0x36c7('0x7'),_0x30c2cb,_0x27809f,util[_0x36c7('0x8')](_0x3228ee,{'showHidden':![],'depth':null}));delete _0x3228ee[_0x36c7('0x9')];_0x25dfac[_0x36c7('0xa')](_0x27809f)[_0x36c7('0xb')](_0x3228ee);};}exports[_0x36c7('0xc')]=function(_0x511a68,_0x5428a2){return info[_0x36c7('0xd')]()[_0x36c7('0xe')](function(_0x21b811){return _0x5428a2[_0x36c7('0xa')](0xc8)[_0x36c7('0xf')](_0x21b811);})['catch'](function(_0x3691ce){return _0x5428a2[_0x36c7('0xa')](0x1f4)[_0x36c7('0xf')](_0x3691ce);});};exports[_0x36c7('0x10')]=function(_0x305e6d,_0x1bc279){var _0x5179c8=[_0x36c7('0x11')];return new BPromise(function(_0x10d42a,_0x2b36c3){return exec(util['format'](_0x36c7('0x12'),_0x305e6d['params'][_0x36c7('0x13')]),function(_0x48162c,_0x57ef0f,_0x4b4473){if(_0x48162c){return _0x2b36c3(_0x48162c);}return _0x10d42a(_0x57ef0f);});})['then'](function(_0x41a1c4){var _0x546972=![];var _0x443970=_0x41a1c4[_0x36c7('0x14')](/\n/);for(var _0x2a7c3c=0x0,_0x14c776=_0x5179c8[_0x36c7('0x15')];_0x2a7c3c<_0x14c776,_0x546972===![];_0x2a7c3c+=0x1){if(_0x41a1c4[_0x36c7('0x16')](_0x5179c8[_0x2a7c3c])>=0x0){_0x546972=!![];}}if(!_0x546972){throw new Error(util[_0x36c7('0x17')](_0x36c7('0x18'),_0x305e6d[_0x36c7('0x19')][_0x36c7('0x13')]));}process[_0x36c7('0x1a')](_0x305e6d[_0x36c7('0x19')][_0x36c7('0x13')],'SIGINT');return _0x1bc279[_0x36c7('0xa')](0xc8)[_0x36c7('0xf')]({'message':util[_0x36c7('0x17')](_0x36c7('0x1b'),_0x305e6d['params'][_0x36c7('0x13')])});})['catch'](handleError(_0x1bc279,null,'killProcess'));}; \ No newline at end of file +var _0x8727=['catch','systeminformation','child_process','exec','../../config/logger','api','bluebird','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','send','getAllData','then','json','status','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly'];(function(_0x418379,_0xf69c17){var _0x1267d8=function(_0x144810){while(--_0x144810){_0x418379['push'](_0x418379['shift']());}};_0x1267d8(++_0xf69c17);}(_0x8727,0x1aa));var _0x7872=function(_0x18f9e1,_0x2763b3){_0x18f9e1=_0x18f9e1-0x0;var _0x61a32d=_0x8727[_0x18f9e1];return _0x61a32d;};'use strict';var info=require(_0x7872('0x0'));var exec=require(_0x7872('0x1'))[_0x7872('0x2')];var logger=require(_0x7872('0x3'))(_0x7872('0x4'));var util=require('util');var BPromise=require(_0x7872('0x5'));var _=require('lodash');function handleError(_0x5bef7b,_0x4a4a71,_0x2de8d9){_0x4a4a71=_0x4a4a71||0x1f4;return function(_0x4aaf1c){logger['error'](_0x7872('0x6'),_0x2de8d9,_0x4a4a71,util['inspect'](_0x4aaf1c,{'showHidden':![],'depth':null}));delete _0x4aaf1c[_0x7872('0x7')];_0x5bef7b['status'](_0x4a4a71)[_0x7872('0x8')](_0x4aaf1c);};}exports['index']=function(_0x183802,_0x431a03){return info[_0x7872('0x9')]()[_0x7872('0xa')](function(_0x5da66d){return _0x431a03['status'](0xc8)[_0x7872('0xb')](_0x5da66d);})['catch'](function(_0x1b988c){return _0x431a03[_0x7872('0xc')](0x1f4)[_0x7872('0xb')](_0x1b988c);});};exports[_0x7872('0xd')]=function(_0x543cf6,_0x35a35a){var _0x2044d9=['components/import/cm'];return new BPromise(function(_0x2199ca,_0x3ec23b){return exec(util[_0x7872('0xe')](_0x7872('0xf'),_0x543cf6[_0x7872('0x10')]['pid']),function(_0x320371,_0x110281,_0x2c83e2){if(_0x320371){return _0x3ec23b(_0x320371);}return _0x2199ca(_0x110281);});})[_0x7872('0xa')](function(_0x5ccf15){var _0x41cf7b=![];var _0x170fe0=_0x5ccf15[_0x7872('0x11')](/\n/);for(var _0x40c64b=0x0,_0x56e351=_0x2044d9[_0x7872('0x12')];_0x40c64b<_0x56e351,_0x41cf7b===![];_0x40c64b+=0x1){if(_0x5ccf15['indexOf'](_0x2044d9[_0x40c64b])>=0x0){_0x41cf7b=!![];}}if(!_0x41cf7b){throw new Error(util[_0x7872('0xe')](_0x7872('0x13'),_0x543cf6['params'][_0x7872('0x14')]));}process[_0x7872('0x15')](_0x543cf6[_0x7872('0x10')][_0x7872('0x14')],_0x7872('0x16'));return _0x35a35a[_0x7872('0xc')](0xc8)[_0x7872('0xb')]({'message':util[_0x7872('0xe')](_0x7872('0x17'),_0x543cf6[_0x7872('0x10')][_0x7872('0x14')])});})[_0x7872('0x18')](handleError(_0x35a35a,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index c8b1c7a..235857e 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 _0x6802=['update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','post','put'];(function(_0xe44ec0,_0x249046){var _0x58bd7f=function(_0x3cd0ab){while(--_0x3cd0ab){_0xe44ec0['push'](_0xe44ec0['shift']());}};_0x58bd7f(++_0x249046);}(_0x6802,0x123));var _0x2680=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x6802[_0x565c49];return _0x20ca34;};'use strict';var multer=require(_0x2680('0x0'));var util=require(_0x2680('0x1'));var path=require(_0x2680('0x2'));var timeout=require('connect-timeout');var express=require(_0x2680('0x3'));var router=express[_0x2680('0x4')]();var fs_extra=require(_0x2680('0x5'));var auth=require(_0x2680('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2680('0x7'));var controller=require(_0x2680('0x8'));router[_0x2680('0x9')]('/',auth[_0x2680('0xa')](),controller['index']);router[_0x2680('0x9')](_0x2680('0xb'),auth[_0x2680('0xa')](),controller[_0x2680('0xc')]);router[_0x2680('0xd')]('/',auth[_0x2680('0xa')](),controller['create']);router[_0x2680('0xe')]('/:id',auth[_0x2680('0xa')](),controller[_0x2680('0xf')]);router[_0x2680('0x10')](_0x2680('0xb'),auth[_0x2680('0xa')](),controller[_0x2680('0x11')]);module['exports']=router; \ No newline at end of file +var _0x605b=['create','put','update','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./tag.controller','get','isAuthenticated','/:id','show','post'];(function(_0x5f48ec,_0xef972d){var _0xf3bbbb=function(_0x22feaf){while(--_0x22feaf){_0x5f48ec['push'](_0x5f48ec['shift']());}};_0xf3bbbb(++_0xef972d);}(_0x605b,0xf4));var _0xb605=function(_0xb461fa,_0x10204d){_0xb461fa=_0xb461fa-0x0;var _0x5839cf=_0x605b[_0xb461fa];return _0x5839cf;};'use strict';var multer=require(_0xb605('0x0'));var util=require(_0xb605('0x1'));var path=require(_0xb605('0x2'));var timeout=require(_0xb605('0x3'));var express=require('express');var router=express[_0xb605('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb605('0x5'));var config=require('../../config/environment');var controller=require(_0xb605('0x6'));router[_0xb605('0x7')]('/',auth[_0xb605('0x8')](),controller['index']);router[_0xb605('0x7')](_0xb605('0x9'),auth[_0xb605('0x8')](),controller[_0xb605('0xa')]);router[_0xb605('0xb')]('/',auth[_0xb605('0x8')](),controller[_0xb605('0xc')]);router[_0xb605('0xd')](_0xb605('0x9'),auth[_0xb605('0x8')](),controller[_0xb605('0xe')]);router['delete'](_0xb605('0x9'),auth[_0xb605('0x8')](),controller['destroy']);module[_0xb605('0xf')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index abca8f0..cef56ec 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 _0x7b37=['STRING','sequelize','exports','name'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x7b37,0xd9));var _0x77b3=function(_0x130c43,_0x4b4fa8){_0x130c43=_0x130c43-0x0;var _0x1951e0=_0x7b37[_0x130c43];return _0x1951e0;};'use strict';var Sequelize=require(_0x77b3('0x0'));module[_0x77b3('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x77b3('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x77b3('0x3')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x77b3('0x3')]}}; \ No newline at end of file +var _0x6f18=['#0091EA','sequelize','STRING'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x6f18,0x1b4));var _0x86f1=function(_0x507af7,_0x5cfb83){_0x507af7=_0x507af7-0x0;var _0x496d57=_0x6f18[_0x507af7];return _0x496d57;};'use strict';var Sequelize=require(_0x86f1('0x0'));module['exports']={'name':{'type':Sequelize[_0x86f1('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x86f1('0x1')],'defaultValue':_0x86f1('0x2')},'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 e779198..0bbe02c 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 _0xe28e=['stack','name','send','index','map','Tag','fieldName','key','model','query','keys','attributes','intersection','fields','limit','order','sort','where','filters','pick','VIRTUAL','merge','include','catch','show','rawAttributes','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','json','apply','reject','save','update','destroy','then','get','Tags','UserProfileResource','error'];(function(_0x83500f,_0x1b1f13){var _0x5c1481=function(_0x421fdd){while(--_0x421fdd){_0x83500f['push'](_0x83500f['shift']());}};_0x5c1481(++_0x1b1f13);}(_0xe28e,0x1ba));var _0xee28=function(_0x4cde49,_0x4c8aca){_0x4cde49=_0x4cde49-0x0;var _0x59d690=_0xe28e[_0x4cde49];return _0x59d690;};'use strict';var emlformat=require(_0xee28('0x0'));var rimraf=require(_0xee28('0x1'));var zipdir=require(_0xee28('0x2'));var jsonpatch=require(_0xee28('0x3'));var rp=require(_0xee28('0x4'));var moment=require(_0xee28('0x5'));var BPromise=require(_0xee28('0x6'));var Mustache=require(_0xee28('0x7'));var util=require(_0xee28('0x8'));var path=require(_0xee28('0x9'));var sox=require(_0xee28('0xa'));var csv=require(_0xee28('0xb'));var ejs=require(_0xee28('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee28('0xd'));var squel=require(_0xee28('0xe'));var crypto=require(_0xee28('0xf'));var jsforce=require(_0xee28('0x10'));var deskjs=require(_0xee28('0x11'));var toCsv=require(_0xee28('0xb'));var querystring=require(_0xee28('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xee28('0x13'));var as=require(_0xee28('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee28('0x15'))(_0xee28('0x16'));var utils=require('../../config/utils');var config=require(_0xee28('0x17'));var licenseUtil=require(_0xee28('0x18'));var db=require(_0xee28('0x19'))['db'];function respondWithStatusCode(_0x2488cf,_0x267031){_0x267031=_0x267031||0xcc;return function(_0x46e784){if(_0x46e784){return _0x2488cf[_0xee28('0x1a')](_0x267031);}return _0x2488cf['status'](_0x267031)[_0xee28('0x1b')]();};}function respondWithResult(_0x1df69a,_0x555b9c){_0x555b9c=_0x555b9c||0xc8;return function(_0x331b7c){if(_0x331b7c){return _0x1df69a[_0xee28('0x1c')](_0x555b9c)['json'](_0x331b7c);}};}function respondWithFilteredResult(_0x11ac93,_0x17c99a){return function(_0x3d3a5c){if(_0x3d3a5c){var _0x343358=typeof _0x17c99a[_0xee28('0x1d')]===_0xee28('0x1e')&&typeof _0x17c99a['limit']===_0xee28('0x1e');var _0x5de212=_0x3d3a5c[_0xee28('0x1f')];var _0x19472a=_0x343358?0x0:_0x17c99a['offset'];var _0x355b07=_0x343358?_0x3d3a5c['count']:_0x17c99a[_0xee28('0x1d')]+_0x17c99a['limit'];var _0x28da88;if(_0x355b07>=_0x5de212){_0x355b07=_0x5de212;_0x28da88=0xc8;}else{_0x28da88=0xce;}_0x11ac93['status'](_0x28da88);return _0x11ac93[_0xee28('0x20')]('Content-Range',_0x19472a+'-'+_0x355b07+'/'+_0x5de212)[_0xee28('0x21')](_0x3d3a5c);}return null;};}function patchUpdates(_0x2a01ff){return function(_0x96f5db){try{jsonpatch[_0xee28('0x22')](_0x96f5db,_0x2a01ff,!![]);}catch(_0x21ee24){return BPromise[_0xee28('0x23')](_0x21ee24);}return _0x96f5db[_0xee28('0x24')]();};}function saveUpdates(_0x4bda53,_0x342798){return function(_0x44d7ff){if(_0x44d7ff){return _0x44d7ff[_0xee28('0x25')](_0x4bda53)['then'](function(_0x5b500b){return _0x5b500b;});}return null;};}function removeEntity(_0x17d8e4,_0x4a524d){return function(_0x1519ae){if(_0x1519ae){return _0x1519ae[_0xee28('0x26')]()[_0xee28('0x27')](function(){var _0x3acfc9=_0x1519ae[_0xee28('0x28')]({'plain':!![]});var _0x95d917=_0xee28('0x29');return db[_0xee28('0x2a')][_0xee28('0x26')]({'where':{'type':_0x95d917,'resourceId':_0x3acfc9['id']}})['then'](function(){return _0x1519ae;});})[_0xee28('0x27')](function(){_0x17d8e4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x54528b,_0x587aac){return function(_0x51eae7){if(!_0x51eae7){_0x54528b[_0xee28('0x1a')](0x194);}return _0x51eae7;};}function handleError(_0x884e7d,_0x3b64ad){_0x3b64ad=_0x3b64ad||0x1f4;return function(_0x469889){logger[_0xee28('0x2b')](_0x469889[_0xee28('0x2c')]);if(_0x469889[_0xee28('0x2d')]){delete _0x469889['name'];}_0x884e7d[_0xee28('0x1c')](_0x3b64ad)[_0xee28('0x2e')](_0x469889);};}exports[_0xee28('0x2f')]=function(_0x49644a,_0x14f7c4){var _0x2890ad={},_0x213e45={},_0xf0b169={'count':0x0,'rows':[]};var _0x1421bc=_[_0xee28('0x30')](db[_0xee28('0x31')]['rawAttributes'],function(_0x15f294){return{'name':_0x15f294[_0xee28('0x32')],'type':_0x15f294['type'][_0xee28('0x33')]};});_0x213e45[_0xee28('0x34')]=_[_0xee28('0x30')](_0x1421bc,_0xee28('0x2d'));_0x213e45[_0xee28('0x35')]=_[_0xee28('0x36')](_0x49644a[_0xee28('0x35')]);_0x213e45['filters']=_['intersection'](_0x213e45['model'],_0x213e45[_0xee28('0x35')]);_0x2890ad[_0xee28('0x37')]=_[_0xee28('0x38')](_0x213e45[_0xee28('0x34')],qs[_0xee28('0x39')](_0x49644a[_0xee28('0x35')]['fields']));_0x2890ad[_0xee28('0x37')]=_0x2890ad[_0xee28('0x37')]['length']?_0x2890ad['attributes']:_0x213e45[_0xee28('0x34')];if(!_0x49644a[_0xee28('0x35')]['hasOwnProperty']('nolimit')){_0x2890ad[_0xee28('0x3a')]=qs[_0xee28('0x3a')](_0x49644a['query'][_0xee28('0x3a')]);_0x2890ad[_0xee28('0x1d')]=qs[_0xee28('0x1d')](_0x49644a[_0xee28('0x35')][_0xee28('0x1d')]);}_0x2890ad[_0xee28('0x3b')]=qs[_0xee28('0x3c')](_0x49644a[_0xee28('0x35')][_0xee28('0x3c')]);_0x2890ad[_0xee28('0x3d')]=qs[_0xee28('0x3e')](_[_0xee28('0x3f')](_0x49644a['query'],_0x213e45[_0xee28('0x3e')]),_0x1421bc);if(_0x49644a['query']['filter']){_0x2890ad[_0xee28('0x3d')]=_['merge'](_0x2890ad[_0xee28('0x3d')],{'$or':_['map'](_0x1421bc,function(_0x2b73d9){if(_0x2b73d9['type']!==_0xee28('0x40')){var _0x211345={};_0x211345[_0x2b73d9[_0xee28('0x2d')]]={'$like':'%'+_0x49644a[_0xee28('0x35')]['filter']+'%'};return _0x211345;}})});}_0x2890ad=_[_0xee28('0x41')]({},_0x2890ad,_0x49644a['options']);var _0x45ed94={'where':_0x2890ad[_0xee28('0x3d')]};return db[_0xee28('0x31')][_0xee28('0x1f')](_0x45ed94)[_0xee28('0x27')](function(_0x2e046e){_0xf0b169[_0xee28('0x1f')]=_0x2e046e;if(_0x49644a['query']['includeAll']){_0x2890ad[_0xee28('0x42')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x2890ad);})[_0xee28('0x27')](function(_0x14bd8d){_0xf0b169['rows']=_0x14bd8d;return _0xf0b169;})[_0xee28('0x27')](respondWithFilteredResult(_0x14f7c4,_0x2890ad))[_0xee28('0x43')](handleError(_0x14f7c4,null));};exports[_0xee28('0x44')]=function(_0x24cfaa,_0x460c61){var _0x2351f7={'raw':!![],'where':{'id':_0x24cfaa['params']['id']}},_0x1735a9={};_0x1735a9[_0xee28('0x34')]=_[_0xee28('0x36')](db[_0xee28('0x31')][_0xee28('0x45')]);_0x1735a9[_0xee28('0x35')]=_['keys'](_0x24cfaa[_0xee28('0x35')]);_0x1735a9[_0xee28('0x3e')]=_['intersection'](_0x1735a9[_0xee28('0x34')],_0x1735a9[_0xee28('0x35')]);_0x2351f7[_0xee28('0x37')]=_[_0xee28('0x38')](_0x1735a9[_0xee28('0x34')],qs[_0xee28('0x39')](_0x24cfaa['query'][_0xee28('0x39')]));_0x2351f7['attributes']=_0x2351f7['attributes'][_0xee28('0x46')]?_0x2351f7[_0xee28('0x37')]:_0x1735a9['model'];if(_0x24cfaa[_0xee28('0x35')][_0xee28('0x47')]){_0x2351f7[_0xee28('0x42')]=[{'all':!![]}];}_0x2351f7=_['merge']({},_0x2351f7,_0x24cfaa['options']);return db[_0xee28('0x31')][_0xee28('0x48')](_0x2351f7)[_0xee28('0x27')](handleEntityNotFound(_0x460c61,null))[_0xee28('0x27')](respondWithResult(_0x460c61,null))[_0xee28('0x43')](handleError(_0x460c61,null));};exports[_0xee28('0x49')]=function(_0x2574c5,_0x2b5f36){return db[_0xee28('0x31')][_0xee28('0x49')](_0x2574c5['body'],{})[_0xee28('0x27')](function(_0x5e174f){var _0x21a66a=_0x2574c5[_0xee28('0x4a')][_0xee28('0x28')]({'plain':!![]});if(!_0x21a66a)throw new Error(_0xee28('0x4b'));if(_0x21a66a[_0xee28('0x4c')]==='user'){var _0x5247fe=_0x5e174f['get']({'plain':!![]});var _0x1b15a4='Tags';return db['UserProfileSection'][_0xee28('0x48')]({'where':{'name':_0x1b15a4,'userProfileId':_0x21a66a['userProfileId']},'raw':!![]})[_0xee28('0x27')](function(_0x1f6754){if(_0x1f6754&&_0x1f6754[_0xee28('0x4d')]===0x0){return db[_0xee28('0x2a')][_0xee28('0x49')]({'name':_0x5247fe[_0xee28('0x2d')],'resourceId':_0x5247fe['id'],'type':_0x1f6754[_0xee28('0x2d')],'sectionId':_0x1f6754['id']},{})[_0xee28('0x27')](function(){return _0x5e174f;});}else{return _0x5e174f;}})[_0xee28('0x43')](function(_0x10d393){logger['error'](_0xee28('0x4e'),_0x10d393);throw _0x10d393;});}return _0x5e174f;})[_0xee28('0x27')](respondWithResult(_0x2b5f36,0xc9))[_0xee28('0x43')](handleError(_0x2b5f36,null));};exports['update']=function(_0x5b9ced,_0x57d865){if(_0x5b9ced['body']['id']){delete _0x5b9ced[_0xee28('0x4f')]['id'];}return db[_0xee28('0x31')][_0xee28('0x48')]({'where':{'id':_0x5b9ced['params']['id']}})[_0xee28('0x27')](handleEntityNotFound(_0x57d865,null))[_0xee28('0x27')](saveUpdates(_0x5b9ced[_0xee28('0x4f')],null))[_0xee28('0x27')](respondWithResult(_0x57d865,null))[_0xee28('0x43')](handleError(_0x57d865,null));};exports['destroy']=function(_0x2a5da9,_0x1c6696){return db[_0xee28('0x31')]['find']({'where':{'id':_0x2a5da9[_0xee28('0x50')]['id']}})[_0xee28('0x27')](handleEntityNotFound(_0x1c6696,null))[_0xee28('0x27')](removeEntity(_0x1c6696,null))[_0xee28('0x43')](handleError(_0x1c6696,null));}; \ No newline at end of file +var _0xc368=['error','name','map','Tag','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','includeAll','include','rows','catch','params','keys','length','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','then','UserProfileResource'];(function(_0x3cad1a,_0x4a92c5){var _0x4b768d=function(_0x2b9e6f){while(--_0x2b9e6f){_0x3cad1a['push'](_0x3cad1a['shift']());}};_0x4b768d(++_0x4a92c5);}(_0xc368,0x7b));var _0x8c36=function(_0x17d595,_0x470934){_0x17d595=_0x17d595-0x0;var _0x54535a=_0xc368[_0x17d595];return _0x54535a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8c36('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8c36('0x1'));var rp=require(_0x8c36('0x2'));var moment=require(_0x8c36('0x3'));var BPromise=require(_0x8c36('0x4'));var Mustache=require(_0x8c36('0x5'));var util=require('util');var path=require(_0x8c36('0x6'));var sox=require(_0x8c36('0x7'));var csv=require(_0x8c36('0x8'));var ejs=require(_0x8c36('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8c36('0xa'));var crypto=require(_0x8c36('0xb'));var jsforce=require(_0x8c36('0xc'));var deskjs=require(_0x8c36('0xd'));var toCsv=require(_0x8c36('0x8'));var querystring=require(_0x8c36('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8c36('0xf'));var as=require(_0x8c36('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8c36('0x11'))(_0x8c36('0x12'));var utils=require(_0x8c36('0x13'));var config=require(_0x8c36('0x14'));var licenseUtil=require(_0x8c36('0x15'));var db=require(_0x8c36('0x16'))['db'];function respondWithStatusCode(_0xa09884,_0x23eb71){_0x23eb71=_0x23eb71||0xcc;return function(_0x205d5c){if(_0x205d5c){return _0xa09884[_0x8c36('0x17')](_0x23eb71);}return _0xa09884[_0x8c36('0x18')](_0x23eb71)[_0x8c36('0x19')]();};}function respondWithResult(_0x3c824b,_0x220f18){_0x220f18=_0x220f18||0xc8;return function(_0x5dfcd5){if(_0x5dfcd5){return _0x3c824b[_0x8c36('0x18')](_0x220f18)['json'](_0x5dfcd5);}};}function respondWithFilteredResult(_0xea7509,_0x3f83aa){return function(_0x29e791){if(_0x29e791){var _0x1fc68e=typeof _0x3f83aa[_0x8c36('0x1a')]===_0x8c36('0x1b')&&typeof _0x3f83aa[_0x8c36('0x1c')]===_0x8c36('0x1b');var _0x30229e=_0x29e791['count'];var _0x2be9b0=_0x1fc68e?0x0:_0x3f83aa[_0x8c36('0x1a')];var _0x47832a=_0x1fc68e?_0x29e791[_0x8c36('0x1d')]:_0x3f83aa[_0x8c36('0x1a')]+_0x3f83aa['limit'];var _0x15100f;if(_0x47832a>=_0x30229e){_0x47832a=_0x30229e;_0x15100f=0xc8;}else{_0x15100f=0xce;}_0xea7509[_0x8c36('0x18')](_0x15100f);return _0xea7509[_0x8c36('0x1e')](_0x8c36('0x1f'),_0x2be9b0+'-'+_0x47832a+'/'+_0x30229e)[_0x8c36('0x20')](_0x29e791);}return null;};}function patchUpdates(_0x2b07ad){return function(_0xfb9763){try{jsonpatch[_0x8c36('0x21')](_0xfb9763,_0x2b07ad,!![]);}catch(_0x153735){return BPromise[_0x8c36('0x22')](_0x153735);}return _0xfb9763[_0x8c36('0x23')]();};}function saveUpdates(_0x14ee6b,_0x46645d){return function(_0x51fd6c){if(_0x51fd6c){return _0x51fd6c['update'](_0x14ee6b)['then'](function(_0x55b844){return _0x55b844;});}return null;};}function removeEntity(_0x2269f5,_0x7effb8){return function(_0x2088aa){if(_0x2088aa){return _0x2088aa[_0x8c36('0x24')]()[_0x8c36('0x25')](function(){var _0x27c0df=_0x2088aa['get']({'plain':!![]});var _0x1d39ca='Tags';return db[_0x8c36('0x26')]['destroy']({'where':{'type':_0x1d39ca,'resourceId':_0x27c0df['id']}})[_0x8c36('0x25')](function(){return _0x2088aa;});})[_0x8c36('0x25')](function(){_0x2269f5[_0x8c36('0x18')](0xcc)[_0x8c36('0x19')]();});}};}function handleEntityNotFound(_0x50aa48,_0x55cbfb){return function(_0x7e7e56){if(!_0x7e7e56){_0x50aa48[_0x8c36('0x17')](0x194);}return _0x7e7e56;};}function handleError(_0x5ad933,_0x4fc3ba){_0x4fc3ba=_0x4fc3ba||0x1f4;return function(_0x418663){logger[_0x8c36('0x27')](_0x418663['stack']);if(_0x418663[_0x8c36('0x28')]){delete _0x418663[_0x8c36('0x28')];}_0x5ad933[_0x8c36('0x18')](_0x4fc3ba)['send'](_0x418663);};}exports['index']=function(_0x46b72f,_0x1531fc){var _0x3d7056={},_0x192ce3={},_0x3ae970={'count':0x0,'rows':[]};var _0x2e8855=_[_0x8c36('0x29')](db[_0x8c36('0x2a')][_0x8c36('0x2b')],function(_0x2d6476){return{'name':_0x2d6476[_0x8c36('0x2c')],'type':_0x2d6476[_0x8c36('0x2d')][_0x8c36('0x2e')]};});_0x192ce3[_0x8c36('0x2f')]=_[_0x8c36('0x29')](_0x2e8855,_0x8c36('0x28'));_0x192ce3[_0x8c36('0x30')]=_['keys'](_0x46b72f['query']);_0x192ce3['filters']=_[_0x8c36('0x31')](_0x192ce3[_0x8c36('0x2f')],_0x192ce3[_0x8c36('0x30')]);_0x3d7056[_0x8c36('0x32')]=_[_0x8c36('0x31')](_0x192ce3[_0x8c36('0x2f')],qs[_0x8c36('0x33')](_0x46b72f['query'][_0x8c36('0x33')]));_0x3d7056['attributes']=_0x3d7056[_0x8c36('0x32')]['length']?_0x3d7056[_0x8c36('0x32')]:_0x192ce3[_0x8c36('0x2f')];if(!_0x46b72f[_0x8c36('0x30')]['hasOwnProperty'](_0x8c36('0x34'))){_0x3d7056[_0x8c36('0x1c')]=qs[_0x8c36('0x1c')](_0x46b72f[_0x8c36('0x30')][_0x8c36('0x1c')]);_0x3d7056[_0x8c36('0x1a')]=qs[_0x8c36('0x1a')](_0x46b72f[_0x8c36('0x30')][_0x8c36('0x1a')]);}_0x3d7056[_0x8c36('0x35')]=qs[_0x8c36('0x36')](_0x46b72f[_0x8c36('0x30')][_0x8c36('0x36')]);_0x3d7056[_0x8c36('0x37')]=qs[_0x8c36('0x38')](_[_0x8c36('0x39')](_0x46b72f[_0x8c36('0x30')],_0x192ce3['filters']),_0x2e8855);if(_0x46b72f[_0x8c36('0x30')]['filter']){_0x3d7056[_0x8c36('0x37')]=_[_0x8c36('0x3a')](_0x3d7056[_0x8c36('0x37')],{'$or':_[_0x8c36('0x29')](_0x2e8855,function(_0x4da574){if(_0x4da574['type']!==_0x8c36('0x3b')){var _0x15a553={};_0x15a553[_0x4da574[_0x8c36('0x28')]]={'$like':'%'+_0x46b72f['query']['filter']+'%'};return _0x15a553;}})});}_0x3d7056=_[_0x8c36('0x3a')]({},_0x3d7056,_0x46b72f['options']);var _0x568290={'where':_0x3d7056[_0x8c36('0x37')]};return db[_0x8c36('0x2a')][_0x8c36('0x1d')](_0x568290)[_0x8c36('0x25')](function(_0x2a0272){_0x3ae970[_0x8c36('0x1d')]=_0x2a0272;if(_0x46b72f[_0x8c36('0x30')][_0x8c36('0x3c')]){_0x3d7056[_0x8c36('0x3d')]=[{'all':!![]}];}return db[_0x8c36('0x2a')]['findAll'](_0x3d7056);})[_0x8c36('0x25')](function(_0x24505c){_0x3ae970[_0x8c36('0x3e')]=_0x24505c;return _0x3ae970;})[_0x8c36('0x25')](respondWithFilteredResult(_0x1531fc,_0x3d7056))[_0x8c36('0x3f')](handleError(_0x1531fc,null));};exports['show']=function(_0xb1f8ac,_0x3dde7b){var _0x31699c={'raw':!![],'where':{'id':_0xb1f8ac[_0x8c36('0x40')]['id']}},_0x18e28e={};_0x18e28e[_0x8c36('0x2f')]=_['keys'](db[_0x8c36('0x2a')][_0x8c36('0x2b')]);_0x18e28e[_0x8c36('0x30')]=_[_0x8c36('0x41')](_0xb1f8ac[_0x8c36('0x30')]);_0x18e28e[_0x8c36('0x38')]=_[_0x8c36('0x31')](_0x18e28e['model'],_0x18e28e[_0x8c36('0x30')]);_0x31699c[_0x8c36('0x32')]=_[_0x8c36('0x31')](_0x18e28e[_0x8c36('0x2f')],qs[_0x8c36('0x33')](_0xb1f8ac[_0x8c36('0x30')][_0x8c36('0x33')]));_0x31699c[_0x8c36('0x32')]=_0x31699c[_0x8c36('0x32')][_0x8c36('0x42')]?_0x31699c[_0x8c36('0x32')]:_0x18e28e[_0x8c36('0x2f')];if(_0xb1f8ac['query']['includeAll']){_0x31699c[_0x8c36('0x3d')]=[{'all':!![]}];}_0x31699c=_[_0x8c36('0x3a')]({},_0x31699c,_0xb1f8ac[_0x8c36('0x43')]);return db[_0x8c36('0x2a')]['find'](_0x31699c)[_0x8c36('0x25')](handleEntityNotFound(_0x3dde7b,null))[_0x8c36('0x25')](respondWithResult(_0x3dde7b,null))['catch'](handleError(_0x3dde7b,null));};exports['create']=function(_0x4edf8e,_0xb4ebae){return db[_0x8c36('0x2a')][_0x8c36('0x44')](_0x4edf8e[_0x8c36('0x45')],{})[_0x8c36('0x25')](function(_0x2778b3){var _0x4dd393=_0x4edf8e[_0x8c36('0x46')][_0x8c36('0x47')]({'plain':!![]});if(!_0x4dd393)throw new Error(_0x8c36('0x48'));if(_0x4dd393[_0x8c36('0x49')]==='user'){var _0x5e668d=_0x2778b3['get']({'plain':!![]});var _0x3887e4=_0x8c36('0x4a');return db[_0x8c36('0x4b')][_0x8c36('0x4c')]({'where':{'name':_0x3887e4,'userProfileId':_0x4dd393[_0x8c36('0x4d')]},'raw':!![]})[_0x8c36('0x25')](function(_0x43b5e2){if(_0x43b5e2&&_0x43b5e2[_0x8c36('0x4e')]===0x0){return db[_0x8c36('0x26')]['create']({'name':_0x5e668d['name'],'resourceId':_0x5e668d['id'],'type':_0x43b5e2[_0x8c36('0x28')],'sectionId':_0x43b5e2['id']},{})['then'](function(){return _0x2778b3;});}else{return _0x2778b3;}})['catch'](function(_0x9955bc){logger['error'](_0x8c36('0x4f'),_0x9955bc);throw _0x9955bc;});}return _0x2778b3;})[_0x8c36('0x25')](respondWithResult(_0xb4ebae,0xc9))['catch'](handleError(_0xb4ebae,null));};exports[_0x8c36('0x50')]=function(_0x5af860,_0x31fbde){if(_0x5af860[_0x8c36('0x45')]['id']){delete _0x5af860[_0x8c36('0x45')]['id'];}return db['Tag'][_0x8c36('0x4c')]({'where':{'id':_0x5af860[_0x8c36('0x40')]['id']}})[_0x8c36('0x25')](handleEntityNotFound(_0x31fbde,null))[_0x8c36('0x25')](saveUpdates(_0x5af860[_0x8c36('0x45')],null))[_0x8c36('0x25')](respondWithResult(_0x31fbde,null))[_0x8c36('0x3f')](handleError(_0x31fbde,null));};exports[_0x8c36('0x24')]=function(_0x20f1d9,_0x4cd57c){return db['Tag']['find']({'where':{'id':_0x20f1d9[_0x8c36('0x40')]['id']}})['then'](handleEntityNotFound(_0x4cd57c,null))['then'](removeEntity(_0x4cd57c,null))[_0x8c36('0x3f')](handleError(_0x4cd57c,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 7dd72a7..ab16d41 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 _0x4ff3=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define'];(function(_0x21c3ac,_0x2a46bb){var _0x3c45ad=function(_0xa506ae){while(--_0xa506ae){_0x21c3ac['push'](_0x21c3ac['shift']());}};_0x3c45ad(++_0x2a46bb);}(_0x4ff3,0x198));var _0x34ff=function(_0x1d649a,_0x3b7d14){_0x1d649a=_0x1d649a-0x0;var _0x2f5f7b=_0x4ff3[_0x1d649a];return _0x2f5f7b;};'use strict';var _=require('lodash');var util=require(_0x34ff('0x0'));var logger=require(_0x34ff('0x1'))(_0x34ff('0x2'));var moment=require(_0x34ff('0x3'));var BPromise=require(_0x34ff('0x4'));var rp=require(_0x34ff('0x5'));var fs=require('fs');var path=require(_0x34ff('0x6'));var rimraf=require(_0x34ff('0x7'));var config=require(_0x34ff('0x8'));var attributes=require(_0x34ff('0x9'));module[_0x34ff('0xa')]=function(_0x1abcd1,_0x17bec3){return _0x1abcd1[_0x34ff('0xb')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6364=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Tag'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x6364,0x8f));var _0x4636=function(_0x15b20b,_0x398fff){_0x15b20b=_0x15b20b-0x0;var _0x2b24bc=_0x6364[_0x15b20b];return _0x2b24bc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4636('0x0'))(_0x4636('0x1'));var moment=require(_0x4636('0x2'));var BPromise=require(_0x4636('0x3'));var rp=require(_0x4636('0x4'));var fs=require('fs');var path=require(_0x4636('0x5'));var rimraf=require(_0x4636('0x6'));var config=require(_0x4636('0x7'));var attributes=require('./tag.attributes');module[_0x4636('0x8')]=function(_0x30201f,_0x3e0ed6){return _0x30201f[_0x4636('0x9')](_0x4636('0xa'),attributes,{'tableName':'tools_tags','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 e695fd0..25c3940 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 _0xb821=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','util','moment','ioredis'];(function(_0x237312,_0x4dd4c0){var _0x93cdf0=function(_0x24c169){while(--_0x24c169){_0x237312['push'](_0x237312['shift']());}};_0x93cdf0(++_0x4dd4c0);}(_0xb821,0xa7));var _0x1b82=function(_0x547bd5,_0x1d113f){_0x547bd5=_0x547bd5-0x0;var _0x37984c=_0xb821[_0x547bd5];return _0x37984c;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var moment=require(_0x1b82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b82('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b82('0x3'))(_0x1b82('0x4'));var config=require(_0x1b82('0x5'));var jayson=require(_0x1b82('0x6'));var client=jayson['client'][_0x1b82('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x192434,_0x202a5f,_0x3632dd){return new BPromise(function(_0x18f45f,_0x7b87e8){return client[_0x1b82('0x8')](_0x192434,_0x3632dd)[_0x1b82('0x9')](function(_0x141673){logger['info'](_0x1b82('0xa'),_0x202a5f,_0x1b82('0xb'));logger[_0x1b82('0xc')](_0x1b82('0xd'),_0x202a5f,_0x1b82('0xb'),JSON[_0x1b82('0xe')](_0x141673));if(_0x141673[_0x1b82('0xf')]){if(_0x141673[_0x1b82('0xf')]['code']===0x1f4){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);return _0x7b87e8(_0x141673['error'][_0x1b82('0x10')]);}logger['error']('Tag,\x20%s,\x20%s',_0x202a5f,_0x141673[_0x1b82('0xf')]['message']);return _0x18f45f(_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);}else{logger['info'](_0x1b82('0xa'),_0x202a5f,'request\x20sent');_0x18f45f(_0x141673['result'][_0x1b82('0x10')]);}})['catch'](function(_0x111247){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x111247);_0x7b87e8(_0x111247);});});} \ No newline at end of file +var _0xe13a=['code','message','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x163c61,_0x1685b4){var _0x5a6c80=function(_0x155bd0){while(--_0x155bd0){_0x163c61['push'](_0x163c61['shift']());}};_0x5a6c80(++_0x1685b4);}(_0xe13a,0x178));var _0xae13=function(_0x2270be,_0x14321f){_0x2270be=_0x2270be-0x0;var _0x418a19=_0xe13a[_0x2270be];return _0x418a19;};'use strict';var _=require('lodash');var util=require(_0xae13('0x0'));var moment=require(_0xae13('0x1'));var BPromise=require(_0xae13('0x2'));var rs=require(_0xae13('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae13('0x4'))['db'];var utils=require(_0xae13('0x5'));var logger=require(_0xae13('0x6'))(_0xae13('0x7'));var config=require(_0xae13('0x8'));var jayson=require(_0xae13('0x9'));var client=jayson[_0xae13('0xa')][_0xae13('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x341ba4,_0x4ae51f,_0x2f6d10){return new BPromise(function(_0x2b2e1f,_0x27fefd){return client[_0xae13('0xc')](_0x341ba4,_0x2f6d10)[_0xae13('0xd')](function(_0x41bf44){logger[_0xae13('0xe')](_0xae13('0xf'),_0x4ae51f,_0xae13('0x10'));logger['debug'](_0xae13('0x11'),_0x4ae51f,_0xae13('0x10'),JSON[_0xae13('0x12')](_0x41bf44));if(_0x41bf44[_0xae13('0x13')]){if(_0x41bf44[_0xae13('0x13')][_0xae13('0x14')]===0x1f4){logger[_0xae13('0x13')]('Tag,\x20%s,\x20%s',_0x4ae51f,_0x41bf44[_0xae13('0x13')][_0xae13('0x15')]);return _0x27fefd(_0x41bf44['error']['message']);}logger['error']('Tag,\x20%s,\x20%s',_0x4ae51f,_0x41bf44['error'][_0xae13('0x15')]);return _0x2b2e1f(_0x41bf44[_0xae13('0x13')][_0xae13('0x15')]);}else{logger[_0xae13('0xe')](_0xae13('0xf'),_0x4ae51f,_0xae13('0x10'));_0x2b2e1f(_0x41bf44['result'][_0xae13('0x15')]);}})['catch'](function(_0xe10aab){logger[_0xae13('0x13')](_0xae13('0xf'),_0x4ae51f,_0xe10aab);_0x27fefd(_0xe10aab);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 07ff3ce..1c0caf2 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(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_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/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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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 5625f59..b071c84 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['name','exports','STRING'];(function(_0x5db65f,_0x297030){var _0x4beb79=function(_0x5d1d73){while(--_0x5d1d73){_0x5db65f['push'](_0x5db65f['shift']());}};_0x4beb79(++_0x297030);}(_0x2032,0xd9));var _0x2203=function(_0x486baf,_0x182258){_0x486baf=_0x486baf-0x0;var _0xe2e36b=_0x2032[_0x486baf];return _0xe2e36b;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x2e4cf9,_0x515fd9){var _0x39f63a=function(_0x33ef49){while(--_0x33ef49){_0x2e4cf9['push'](_0x2e4cf9['shift']());}};_0x39f63a(++_0x515fd9);}(_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 diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 173ca8b..7695c49 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 _0x5f15=['count','offset','set','apply','reject','update','then','error','stack','name','send','index','map','Team','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','params','includeAll','include','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','Sequelize','QueryTypes','SELECT','UserId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','sendStatus','getQueues','findOne','channel','ValidationError','Unknown\x20channel','capitalize','Queue','Queues','addQueues','isValidChannel','add','removeQueues','remove','ids','addAgents','Voice','Mail','Fax','Openchannel','QueueId','TeamVoiceQueue','penalty','findOrCreate','emit','Queue:save','voicePause','interface','upsert','isNil','SIP/%s','all','VoicePrefixId','spread','removeAgents','Chat','Sms','Whatsapp','Queue:remove','UserVoiceQueueRt','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','undefined','limit'];(function(_0x2998ec,_0x10f5cd){var _0x287909=function(_0x15d2ff){while(--_0x15d2ff){_0x2998ec['push'](_0x2998ec['shift']());}};_0x287909(++_0x10f5cd);}(_0x5f15,0x111));var _0x55f1=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5f15[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x55f1('0x0'));var rimraf=require(_0x55f1('0x1'));var zipdir=require(_0x55f1('0x2'));var jsonpatch=require(_0x55f1('0x3'));var rp=require(_0x55f1('0x4'));var moment=require(_0x55f1('0x5'));var BPromise=require(_0x55f1('0x6'));var Mustache=require(_0x55f1('0x7'));var util=require(_0x55f1('0x8'));var path=require('path');var sox=require(_0x55f1('0x9'));var csv=require(_0x55f1('0xa'));var ejs=require(_0x55f1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x55f1('0xc'));var squel=require('squel');var crypto=require(_0x55f1('0xd'));var jsforce=require(_0x55f1('0xe'));var deskjs=require(_0x55f1('0xf'));var toCsv=require(_0x55f1('0xa'));var querystring=require(_0x55f1('0x10'));var Papa=require(_0x55f1('0x11'));var Redis=require(_0x55f1('0x12'));var authService=require(_0x55f1('0x13'));var qs=require(_0x55f1('0x14'));var as=require(_0x55f1('0x15'));var hardwareService=require(_0x55f1('0x16'));var logger=require(_0x55f1('0x17'))(_0x55f1('0x18'));var utils=require(_0x55f1('0x19'));var config=require(_0x55f1('0x1a'));var licenseUtil=require(_0x55f1('0x1b'));var db=require(_0x55f1('0x1c'))['db'];config[_0x55f1('0x1d')]=_['defaults'](config[_0x55f1('0x1d')],{'host':_0x55f1('0x1e'),'port':0x18eb});var socket=require(_0x55f1('0x1f'))(new Redis(config[_0x55f1('0x1d')]));require('./team.socket')[_0x55f1('0x20')](socket);function respondWithStatusCode(_0x49b7c1,_0xbdd80b){_0xbdd80b=_0xbdd80b||0xcc;return function(_0x36fda4){if(_0x36fda4){return _0x49b7c1['sendStatus'](_0xbdd80b);}return _0x49b7c1[_0x55f1('0x21')](_0xbdd80b)[_0x55f1('0x22')]();};}function respondWithResult(_0x2c5a4e,_0x1035e2){_0x1035e2=_0x1035e2||0xc8;return function(_0x23ab8f){if(_0x23ab8f){return _0x2c5a4e[_0x55f1('0x21')](_0x1035e2)['json'](_0x23ab8f);}};}function respondWithFilteredResult(_0xd717f7,_0x25f7a6){return function(_0x14cb0e){if(_0x14cb0e){var _0x1e6f76=typeof _0x25f7a6['offset']===_0x55f1('0x23')&&typeof _0x25f7a6[_0x55f1('0x24')]===_0x55f1('0x23');var _0x697a00=_0x14cb0e[_0x55f1('0x25')];var _0x1c7bd8=_0x1e6f76?0x0:_0x25f7a6[_0x55f1('0x26')];var _0x25b1b3=_0x1e6f76?_0x14cb0e[_0x55f1('0x25')]:_0x25f7a6[_0x55f1('0x26')]+_0x25f7a6[_0x55f1('0x24')];var _0x477bbe;if(_0x25b1b3>=_0x697a00){_0x25b1b3=_0x697a00;_0x477bbe=0xc8;}else{_0x477bbe=0xce;}_0xd717f7[_0x55f1('0x21')](_0x477bbe);return _0xd717f7[_0x55f1('0x27')]('Content-Range',_0x1c7bd8+'-'+_0x25b1b3+'/'+_0x697a00)['json'](_0x14cb0e);}return null;};}function patchUpdates(_0xf2e7a){return function(_0x305920){try{jsonpatch[_0x55f1('0x28')](_0x305920,_0xf2e7a,!![]);}catch(_0x2c3ddc){return BPromise[_0x55f1('0x29')](_0x2c3ddc);}return _0x305920['save']();};}function saveUpdates(_0x2b7f9c,_0x8fde55){return function(_0x5a139a){if(_0x5a139a){return _0x5a139a[_0x55f1('0x2a')](_0x2b7f9c)[_0x55f1('0x2b')](function(_0x27ac70){return _0x27ac70;});}return null;};}function handleEntityNotFound(_0x292e90,_0x64404d){return function(_0x4a991e){if(!_0x4a991e){_0x292e90['sendStatus'](0x194);}return _0x4a991e;};}function handleError(_0x2abd69,_0xa7f72e){_0xa7f72e=_0xa7f72e||0x1f4;return function(_0x56fee5){logger[_0x55f1('0x2c')](_0x56fee5[_0x55f1('0x2d')]);if(_0x56fee5['name']){delete _0x56fee5[_0x55f1('0x2e')];}_0x2abd69[_0x55f1('0x21')](_0xa7f72e)[_0x55f1('0x2f')](_0x56fee5);};}exports[_0x55f1('0x30')]=function(_0x5c3fb7,_0x4a3251){var _0x384969={},_0x2169f3={},_0x4a0c19={'count':0x0,'rows':[]};var _0x1961d0=_[_0x55f1('0x31')](db[_0x55f1('0x32')][_0x55f1('0x33')],function(_0x28ecb0){return{'name':_0x28ecb0[_0x55f1('0x34')],'type':_0x28ecb0['type'][_0x55f1('0x35')]};});_0x2169f3['model']=_[_0x55f1('0x31')](_0x1961d0,'name');_0x2169f3[_0x55f1('0x36')]=_[_0x55f1('0x37')](_0x5c3fb7['query']);_0x2169f3[_0x55f1('0x38')]=_[_0x55f1('0x39')](_0x2169f3[_0x55f1('0x3a')],_0x2169f3['query']);_0x384969[_0x55f1('0x3b')]=_[_0x55f1('0x39')](_0x2169f3[_0x55f1('0x3a')],qs[_0x55f1('0x3c')](_0x5c3fb7['query'][_0x55f1('0x3c')]));_0x384969[_0x55f1('0x3b')]=_0x384969[_0x55f1('0x3b')][_0x55f1('0x3d')]?_0x384969[_0x55f1('0x3b')]:_0x2169f3[_0x55f1('0x3a')];if(!_0x5c3fb7[_0x55f1('0x36')]['hasOwnProperty'](_0x55f1('0x3e'))){_0x384969[_0x55f1('0x24')]=qs['limit'](_0x5c3fb7[_0x55f1('0x36')][_0x55f1('0x24')]);_0x384969['offset']=qs[_0x55f1('0x26')](_0x5c3fb7[_0x55f1('0x36')]['offset']);}_0x384969[_0x55f1('0x3f')]=qs['sort'](_0x5c3fb7[_0x55f1('0x36')][_0x55f1('0x40')]);_0x384969[_0x55f1('0x41')]=qs['filters'](_[_0x55f1('0x42')](_0x5c3fb7['query'],_0x2169f3[_0x55f1('0x38')]),_0x1961d0);if(_0x5c3fb7[_0x55f1('0x36')][_0x55f1('0x43')]){_0x384969[_0x55f1('0x41')]=_['merge'](_0x384969[_0x55f1('0x41')],{'$or':_['map'](_0x1961d0,function(_0x4e1f60){if(_0x4e1f60['type']!=='VIRTUAL'){var _0xc3a43b={};_0xc3a43b[_0x4e1f60['name']]={'$like':'%'+_0x5c3fb7[_0x55f1('0x36')][_0x55f1('0x43')]+'%'};return _0xc3a43b;}})});}_0x384969=_[_0x55f1('0x44')]({},_0x384969,_0x5c3fb7[_0x55f1('0x45')]);var _0x559e63={'where':_0x384969[_0x55f1('0x41')]};return db[_0x55f1('0x32')]['count'](_0x559e63)[_0x55f1('0x2b')](function(_0x588dfc){_0x4a0c19[_0x55f1('0x25')]=_0x588dfc;if(_0x5c3fb7[_0x55f1('0x36')]['includeAll']){_0x384969['include']=[{'all':!![]}];}return db['Team'][_0x55f1('0x46')](_0x384969);})[_0x55f1('0x2b')](function(_0x81c52d){_0x4a0c19[_0x55f1('0x47')]=_0x81c52d;return _0x4a0c19;})['then'](respondWithFilteredResult(_0x4a3251,_0x384969))['catch'](handleError(_0x4a3251,null));};exports['show']=function(_0x52a6e0,_0x3c1463){var _0xb46442={'raw':![],'where':{'id':_0x52a6e0[_0x55f1('0x48')]['id']}},_0x542f88={};_0x542f88['model']=_[_0x55f1('0x37')](db['Team'][_0x55f1('0x33')]);_0x542f88['query']=_[_0x55f1('0x37')](_0x52a6e0[_0x55f1('0x36')]);_0x542f88[_0x55f1('0x38')]=_[_0x55f1('0x39')](_0x542f88[_0x55f1('0x3a')],_0x542f88['query']);_0xb46442[_0x55f1('0x3b')]=_[_0x55f1('0x39')](_0x542f88[_0x55f1('0x3a')],qs[_0x55f1('0x3c')](_0x52a6e0[_0x55f1('0x36')][_0x55f1('0x3c')]));_0xb46442[_0x55f1('0x3b')]=_0xb46442[_0x55f1('0x3b')][_0x55f1('0x3d')]?_0xb46442[_0x55f1('0x3b')]:_0x542f88[_0x55f1('0x3a')];if(_0x52a6e0['query'][_0x55f1('0x49')]){_0xb46442[_0x55f1('0x4a')]=[{'all':!![]}];}_0xb46442=_[_0x55f1('0x44')]({},_0xb46442,_0x52a6e0['options']);return db['Team'][_0x55f1('0x4b')](_0xb46442)[_0x55f1('0x2b')](handleEntityNotFound(_0x3c1463,null))[_0x55f1('0x2b')](respondWithResult(_0x3c1463,null))[_0x55f1('0x4c')](handleError(_0x3c1463,null));};exports[_0x55f1('0x4d')]=function(_0x45e220,_0x45f3fb){return db['Team'][_0x55f1('0x4d')](_0x45e220[_0x55f1('0x4e')],{})[_0x55f1('0x2b')](function(_0x4042a8){var _0xee0125=_0x45e220[_0x55f1('0x4f')][_0x55f1('0x50')]({'plain':!![]});if(!_0xee0125)throw new Error(_0x55f1('0x51'));if(_0xee0125[_0x55f1('0x52')]===_0x55f1('0x4f')){var _0x568c68=_0x4042a8[_0x55f1('0x50')]({'plain':!![]});var _0x15f354=_0x55f1('0x53');return db['UserProfileSection'][_0x55f1('0x4b')]({'where':{'name':_0x15f354,'userProfileId':_0xee0125[_0x55f1('0x54')]},'raw':!![]})[_0x55f1('0x2b')](function(_0x5df3a9){if(_0x5df3a9&&_0x5df3a9[_0x55f1('0x55')]===0x0){return db[_0x55f1('0x56')][_0x55f1('0x4d')]({'name':_0x568c68[_0x55f1('0x2e')],'resourceId':_0x568c68['id'],'type':_0x5df3a9[_0x55f1('0x2e')],'sectionId':_0x5df3a9['id']},{})[_0x55f1('0x2b')](function(){return _0x4042a8;});}else{return _0x4042a8;}})[_0x55f1('0x4c')](function(_0x43fc92){logger['error'](_0x55f1('0x57'),_0x43fc92);throw _0x43fc92;});}return _0x4042a8;})[_0x55f1('0x2b')](respondWithResult(_0x45f3fb,0xc9))[_0x55f1('0x4c')](handleError(_0x45f3fb,null));};exports[_0x55f1('0x2a')]=function(_0x2712a4,_0x133978){if(_0x2712a4['body']['id']){delete _0x2712a4[_0x55f1('0x4e')]['id'];}return db['Team']['find']({'where':{'id':_0x2712a4[_0x55f1('0x48')]['id']}})[_0x55f1('0x2b')](handleEntityNotFound(_0x133978,null))[_0x55f1('0x2b')](saveUpdates(_0x2712a4[_0x55f1('0x4e')],null))['then'](respondWithResult(_0x133978,null))[_0x55f1('0x4c')](handleError(_0x133978,null));};exports[_0x55f1('0x58')]=function(_0xc493e7,_0xcd00a1){var _0x12920d=_0xc493e7[_0x55f1('0x48')]['id'];var _0x551092=[];return db[_0x55f1('0x59')][_0x55f1('0x5a')](function(_0x55c813){var _0x311714='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x12920d;return db[_0x55f1('0x59')][_0x55f1('0x36')](_0x311714,{'type':db[_0x55f1('0x5b')][_0x55f1('0x5c')][_0x55f1('0x5d')],'raw':!![],'transaction':_0x55c813})[_0x55f1('0x2b')](function(_0xe4e2f4){_0x551092=_[_0x55f1('0x31')](_0xe4e2f4,function(_0x232324){return Number(_0x232324[_0x55f1('0x5e')]);});})['then'](function(){var _0x4230a5='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x12920d;return db[_0x55f1('0x59')][_0x55f1('0x36')](_0x4230a5,{'type':db[_0x55f1('0x5b')][_0x55f1('0x5c')][_0x55f1('0x5d')],'raw':!![],'transaction':_0x55c813});})['then'](function(_0x2f410e){var _0x114e4c=_[_0x55f1('0x31')](_0x2f410e,function(_0xc3ccc){return Number(_0xc3ccc['VoiceQueueId']);});return db[_0x55f1('0x5f')][_0x55f1('0x58')]({'where':{'UserId':{'$in':_0x551092},'VoiceQueueId':{'$in':_0x114e4c}},'transaction':_0x55c813});})[_0x55f1('0x2b')](function(){var _0x5a34b0=_0x55f1('0x60')+_0x12920d;return db[_0x55f1('0x59')][_0x55f1('0x36')](_0x5a34b0,{'type':db[_0x55f1('0x5b')][_0x55f1('0x5c')][_0x55f1('0x5d')],'raw':!![],'transaction':_0x55c813});})[_0x55f1('0x2b')](function(_0x4c1848){var _0x2a12fe=_['map'](_0x4c1848,function(_0x334ac9){return Number(_0x334ac9[_0x55f1('0x61')]);});return db['UserMailQueue']['destroy']({'where':{'UserId':{'$in':_0x551092},'MailQueueId':{'$in':_0x2a12fe}},'transaction':_0x55c813});})[_0x55f1('0x2b')](function(){var _0x3d28c9=_0x55f1('0x62')+_0x12920d;return db['sequelize'][_0x55f1('0x36')](_0x3d28c9,{'type':db['Sequelize'][_0x55f1('0x5c')][_0x55f1('0x5d')],'raw':!![],'transaction':_0x55c813});})['then'](function(_0xae4748){var _0x1ad6c8=_[_0x55f1('0x31')](_0xae4748,function(_0xc009c8){return Number(_0xc009c8[_0x55f1('0x63')]);});return db[_0x55f1('0x64')][_0x55f1('0x58')]({'where':{'UserId':{'$in':_0x551092},'SmsQueueId':{'$in':_0x1ad6c8}},'transaction':_0x55c813});})['then'](function(){var _0x16ae9c=_0x55f1('0x65')+_0x12920d;return db[_0x55f1('0x59')][_0x55f1('0x36')](_0x16ae9c,{'type':db[_0x55f1('0x5b')][_0x55f1('0x5c')]['SELECT'],'raw':!![],'transaction':_0x55c813});})[_0x55f1('0x2b')](function(_0x43f6f3){var _0x213be3=_['map'](_0x43f6f3,function(_0x14842a){return Number(_0x14842a[_0x55f1('0x66')]);});return db[_0x55f1('0x67')][_0x55f1('0x58')]({'where':{'UserId':{'$in':_0x551092},'ChatQueueId':{'$in':_0x213be3}},'transaction':_0x55c813});})[_0x55f1('0x2b')](function(){var _0x1dba56=_0x55f1('0x68')+_0x12920d;return db[_0x55f1('0x59')][_0x55f1('0x36')](_0x1dba56,{'type':db[_0x55f1('0x5b')][_0x55f1('0x5c')][_0x55f1('0x5d')],'raw':!![],'transaction':_0x55c813});})['then'](function(_0x407a57){var _0x4281a9=_[_0x55f1('0x31')](_0x407a57,function(_0x1c783f){return Number(_0x1c783f[_0x55f1('0x69')]);});return db['UserFaxQueue']['destroy']({'where':{'UserId':{'$in':_0x551092},'FaxQueueId':{'$in':_0x4281a9}},'transaction':_0x55c813});})['then'](function(){var _0x1ae3d9=_0x55f1('0x6a')+_0x12920d;return db[_0x55f1('0x59')][_0x55f1('0x36')](_0x1ae3d9,{'type':db['Sequelize'][_0x55f1('0x5c')]['SELECT'],'raw':!![],'transaction':_0x55c813});})[_0x55f1('0x2b')](function(_0x1fd157){var _0x480672=_[_0x55f1('0x31')](_0x1fd157,function(_0x38e88b){return Number(_0x38e88b[_0x55f1('0x6b')]);});return db[_0x55f1('0x6c')][_0x55f1('0x58')]({'where':{'UserId':{'$in':_0x551092},'OpenchannelQueueId':{'$in':_0x480672}},'transaction':_0x55c813});})['then'](function(){var _0x1ac623=_0x55f1('0x6d')+_0x12920d;return db['sequelize'][_0x55f1('0x36')](_0x1ac623,{'type':db[_0x55f1('0x5b')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x55c813});})[_0x55f1('0x2b')](function(_0x610b2f){var _0x279511=_[_0x55f1('0x31')](_0x610b2f,function(_0x152738){return Number(_0x152738[_0x55f1('0x6e')]);});return db[_0x55f1('0x6f')][_0x55f1('0x58')]({'where':{'UserId':{'$in':_0x551092},'WhatsappQueueId':{'$in':_0x279511}},'transaction':_0x55c813});})['then'](function(){return db[_0x55f1('0x70')][_0x55f1('0x4b')]({'where':{'TeamId':_0x12920d}});})[_0x55f1('0x2b')](function(_0x37feb5){if(_0x37feb5===null){return;}return db[_0x55f1('0x71')][_0x55f1('0x58')]({'where':{'UserId':{'$in':_0x551092},'VoicePrefixId':_0x37feb5['VoicePrefixId']},'transaction':_0x55c813});})[_0x55f1('0x2b')](function(){return db['Team']['destroy']({'where':{'id':_0x12920d},'cascade':!![],'transaction':_0x55c813});})['then'](function(_0x4927ff){if(_0x4927ff===0x0){_0xcd00a1[_0x55f1('0x72')](0x194);}else{return db[_0x55f1('0x56')][_0x55f1('0x58')]({'where':{'type':_0x55f1('0x53'),'resourceId':_0x12920d},'cascade':!![],'transaction':_0x55c813})[_0x55f1('0x2b')](function(){_0xcd00a1['status'](0xcc)[_0x55f1('0x22')]();});}})[_0x55f1('0x4c')](function(_0x2ca755){_0xcd00a1[_0x55f1('0x21')](0x1f4)['send'](_0x2ca755);});});};exports[_0x55f1('0x73')]=function(_0x459a57,_0x3cf32a,_0x34462f){return db[_0x55f1('0x32')][_0x55f1('0x74')]({'where':{'id':_0x459a57[_0x55f1('0x48')]['id']}})['then'](handleEntityNotFound(_0x3cf32a,null))[_0x55f1('0x2b')](function(_0x1dcba){if(!_0x459a57[_0x55f1('0x36')][_0x55f1('0x75')]||!utils['isValidChannel'](_0x459a57[_0x55f1('0x36')]['channel'])){throw new db['Sequelize'][(_0x55f1('0x76'))](_0x55f1('0x77'));}var _0x29e64={};var _0x2ddef6={};_0x2ddef6[_0x55f1('0x3a')]=_['keys'](db[_[_0x55f1('0x78')](_0x459a57[_0x55f1('0x36')][_0x55f1('0x75')]['toLowerCase']())+_0x55f1('0x79')]['rawAttributes']);_0x2ddef6['query']=_[_0x55f1('0x37')](_0x459a57[_0x55f1('0x36')]);_0x2ddef6['filters']=_['intersection'](_0x2ddef6[_0x55f1('0x3a')],_0x2ddef6[_0x55f1('0x36')]);_0x29e64['attributes']=_['intersection'](_0x2ddef6[_0x55f1('0x3a')],qs[_0x55f1('0x3c')](_0x459a57['query'][_0x55f1('0x3c')]));_0x29e64[_0x55f1('0x3b')]=_0x29e64['attributes'][_0x55f1('0x3d')]?_0x29e64[_0x55f1('0x3b')]:_0x2ddef6[_0x55f1('0x3a')];_0x29e64[_0x55f1('0x24')]=qs[_0x55f1('0x24')](_0x459a57[_0x55f1('0x36')][_0x55f1('0x24')]);_0x29e64[_0x55f1('0x26')]=qs['offset'](_0x459a57[_0x55f1('0x36')][_0x55f1('0x26')]);_0x29e64[_0x55f1('0x3f')]=qs[_0x55f1('0x40')](_0x459a57['query']['sort']);_0x29e64[_0x55f1('0x41')]=qs[_0x55f1('0x38')](_['pick'](_0x459a57['query'],_0x2ddef6[_0x55f1('0x38')]));_0x29e64=_[_0x55f1('0x44')]({},_0x29e64,_0x459a57[_0x55f1('0x45')]);return _0x1dcba[_0x55f1('0x50')+_[_0x55f1('0x78')](_0x459a57[_0x55f1('0x36')]['channel']['toLowerCase']())+_0x55f1('0x7a')](_0x29e64);})[_0x55f1('0x2b')](respondWithResult(_0x3cf32a,null))[_0x55f1('0x4c')](handleError(_0x3cf32a,null));};exports[_0x55f1('0x7b')]=function(_0x31c8bb,_0x22cbd8,_0x209bc1){return db['Team'][_0x55f1('0x74')]({'where':{'id':_0x31c8bb[_0x55f1('0x48')]['id']}})['then'](function(_0x5a7a13){if(_0x5a7a13){if(!_0x31c8bb[_0x55f1('0x4e')]['channel']||!utils[_0x55f1('0x7c')](_0x31c8bb['body']['channel'])){throw new db[(_0x55f1('0x5b'))]['ValidationError'](_0x55f1('0x77'));}return _0x5a7a13[_0x55f1('0x7d')+_['capitalize'](_0x31c8bb['body'][_0x55f1('0x75')]['toLowerCase']())+_0x55f1('0x7a')](_0x31c8bb['body']['ids']);}return null;})[_0x55f1('0x2b')](handleEntityNotFound(_0x22cbd8,null))[_0x55f1('0x2b')](respondWithStatusCode(_0x22cbd8,null))[_0x55f1('0x4c')](handleError(_0x22cbd8,null));};exports[_0x55f1('0x7e')]=function(_0x1cea06,_0x4dbe63,_0x9a56e4){return db[_0x55f1('0x32')][_0x55f1('0x74')]({'where':{'id':_0x1cea06[_0x55f1('0x48')]['id']}})[_0x55f1('0x2b')](function(_0x3858e7){if(_0x3858e7){if(!_0x1cea06[_0x55f1('0x36')][_0x55f1('0x75')]||!utils['isValidChannel'](_0x1cea06[_0x55f1('0x36')][_0x55f1('0x75')])){throw new db[(_0x55f1('0x5b'))][(_0x55f1('0x76'))]('Unknown\x20channel');}return _0x3858e7[_0x55f1('0x7f')+_['capitalize'](_0x1cea06[_0x55f1('0x36')][_0x55f1('0x75')]['toLowerCase']())+'Queues'](_0x1cea06[_0x55f1('0x36')][_0x55f1('0x80')]);}return null;})[_0x55f1('0x2b')](handleEntityNotFound(_0x4dbe63,null))[_0x55f1('0x2b')](respondWithStatusCode(_0x4dbe63,null))[_0x55f1('0x4c')](handleError(_0x4dbe63,null));};exports[_0x55f1('0x81')]=function(_0xf946b9,_0x4f913e){var _0x4199b7=_['isArray'](_0xf946b9[_0x55f1('0x4e')][_0x55f1('0x80')])?_0xf946b9[_0x55f1('0x4e')][_0x55f1('0x80')]:[_0xf946b9[_0x55f1('0x4e')][_0x55f1('0x80')]];var _0x862368=_0xf946b9['params']['id'];return db[_0x55f1('0x32')][_0x55f1('0x4b')]({'where':{'id':_0x862368}})[_0x55f1('0x2b')](handleEntityNotFound(_0x4f913e,null))[_0x55f1('0x2b')](function(_0x154827){if(_0x154827){var _0x12d738=[_0x55f1('0x82'),'Chat',_0x55f1('0x83'),'Sms',_0x55f1('0x84'),_0x55f1('0x85'),'Whatsapp'];return db[_0x55f1('0x59')][_0x55f1('0x5a')](function(_0x4fc718){var _0x300d43=_[_0x55f1('0x31')](_0x12d738,function(_0x39abe0){var _0x5e8a39={'attributes':['id',_0x55f1('0x2e')]};if(_0x39abe0===_0x55f1('0x82')){_0x5e8a39['through']={'attributes':['penalty']};}return _0x154827[_0x55f1('0x50')+_0x39abe0+_0x55f1('0x7a')](_0x5e8a39)[_0x55f1('0x2b')](function(_0x98930e){var _0x47dfb0=_[_0x55f1('0x31')](_0x98930e,function(_0x10744f){var _0x47bebe=_[_0x55f1('0x31')](_0x4199b7,function(_0xeaae56){var _0x16b0c5={'where':{'UserId':_0xeaae56,[_0x39abe0+_0x55f1('0x86')]:_0x10744f['id']},'transaction':_0x4fc718};if(_0x39abe0===_0x55f1('0x82')){_0x16b0c5['defaults']={'penalty':_0x10744f[_0x55f1('0x87')][_0x55f1('0x88')]};}return db['User'+_0x39abe0+'Queue'][_0x55f1('0x89')](_0x16b0c5)[_0x55f1('0x2b')](function(){socket[_0x55f1('0x8a')](_0x55f1('0x4f')+_0x39abe0+_0x55f1('0x8b'),{'UserId':_0xeaae56,[_0x39abe0+_0x55f1('0x86')]:_0x10744f['id']});if(_0x39abe0!==_0x55f1('0x82')){return;}return db['User'][_0x55f1('0x46')]({'where':{'id':_0x4199b7,'online':0x1},'attributes':['id','name','online',_0x55f1('0x8c'),_0x55f1('0x8d')],'raw':!![]})['then'](function(_0x1905ca){var _0x5b56a0=_[_0x55f1('0x31')](_0x1905ca,function(_0x1c504c){return db['UserVoiceQueueRt'][_0x55f1('0x8e')]({'membername':_0x1c504c[_0x55f1('0x2e')],'UserId':_0x1c504c['id'],'queue_name':_0x10744f[_0x55f1('0x2e')],'VoiceQueueId':_0x10744f['id'],'interface':_[_0x55f1('0x8f')](_0x1c504c[_0x55f1('0x8d')])?util['format'](_0x55f1('0x90'),_0x1c504c[_0x55f1('0x2e')]):_0x1c504c['interface'],'paused':_0x1c504c[_0x55f1('0x8c')]||![],'penalty':_0x10744f[_0x55f1('0x87')][_0x55f1('0x88')]},{'transaction':_0x4fc718});});return Promise['all'](_0x5b56a0);});});});return Promise[_0x55f1('0x91')](_0x47bebe);});return Promise['all'](_0x47dfb0);})[_0x55f1('0x2b')](function(){return db[_0x55f1('0x70')][_0x55f1('0x74')]({'where':{'teamId':_0x862368}})['then'](function(_0x145097){if(_0x145097){var _0x7d5c0c=_['map'](_0x4199b7,function(_0xedef6c){db[_0x55f1('0x71')][_0x55f1('0x8e')]({'UserId':_0xedef6c,'VoicePrefixId':_0x145097[_0x55f1('0x92')]});});return Promise[_0x55f1('0x91')](_0x7d5c0c);}});});});return Promise['all'](_0x300d43)[_0x55f1('0x2b')](function(){return _0x154827['addAgents'](_0x4199b7,{'transaction':_0x4fc718})[_0x55f1('0x93')](function(_0x270f71){return _0x270f71;});});});}})[_0x55f1('0x2b')](respondWithResult(_0x4f913e,null))['catch'](handleError(_0x4f913e,null));};exports[_0x55f1('0x94')]=function(_0x4868e6,_0x716b49){var _0x59a5b3=_['isArray'](_0x4868e6[_0x55f1('0x36')][_0x55f1('0x80')])?_0x4868e6['query'][_0x55f1('0x80')]:[_0x4868e6['query'][_0x55f1('0x80')]];var _0x4d54ef=_0x4868e6[_0x55f1('0x48')]['id'];return db[_0x55f1('0x32')][_0x55f1('0x4b')]({'where':{'id':_0x4d54ef}})[_0x55f1('0x2b')](handleEntityNotFound(_0x716b49,null))[_0x55f1('0x2b')](function(_0x284c22){if(_0x284c22){var _0x372403=[_0x55f1('0x82'),_0x55f1('0x95'),_0x55f1('0x83'),_0x55f1('0x96'),_0x55f1('0x84'),_0x55f1('0x85'),_0x55f1('0x97')];return db[_0x55f1('0x59')]['transaction'](function(_0x293339){var _0x2c1a68=_[_0x55f1('0x31')](_0x372403,function(_0x5621d5){var _0x4ee6f7={'attributes':['id',_0x55f1('0x2e')]};return _0x284c22[_0x55f1('0x50')+_0x5621d5+_0x55f1('0x7a')](_0x4ee6f7)[_0x55f1('0x2b')](function(_0x520708){var _0x48c5df=_[_0x55f1('0x31')](_0x520708,function(_0x197c57){return _0x197c57[_0x55f1('0x94')](_0x59a5b3,{'transaction':_0x293339})[_0x55f1('0x2b')](function(){var _0x4b3aef=_[_0x55f1('0x31')](_0x59a5b3,function(_0x4ae1da){socket['emit']('user'+_0x5621d5+_0x55f1('0x98'),{'UserId':Number(_0x4ae1da),[_0x5621d5+_0x55f1('0x86')]:_0x197c57['id']});if(_0x5621d5!==_0x55f1('0x82')){return;}return db[_0x55f1('0x99')][_0x55f1('0x58')]({'where':{'VoiceQueueId':_0x197c57['id'],'UserId':_0x4ae1da},'transaction':_0x293339});});return Promise[_0x55f1('0x91')](_0x4b3aef);});});return Promise['all'](_0x48c5df);});});return Promise['all'](_0x2c1a68)[_0x55f1('0x2b')](function(){return _0x284c22[_0x55f1('0x94')](_0x59a5b3,{'transaction':_0x293339});})['then'](function(){return db[_0x55f1('0x70')][_0x55f1('0x74')]({'where':{'teamId':_0x4d54ef}})[_0x55f1('0x2b')](function(_0x1f4f4e){if(_0x1f4f4e){var _0x5a3db9=_[_0x55f1('0x31')](_0x59a5b3,function(_0x7a29b9){db[_0x55f1('0x71')][_0x55f1('0x58')]({'where':{'UserId':_0x7a29b9,'VoicePrefixId':_0x1f4f4e[_0x55f1('0x92')]}});});return Promise[_0x55f1('0x91')](_0x5a3db9);}});});});}})[_0x55f1('0x2b')](respondWithStatusCode(_0x716b49,null))[_0x55f1('0x4c')](handleError(_0x716b49,null));};exports[_0x55f1('0x9a')]=function(_0x393096,_0x46db33,_0x53188f){var _0x3532d0={};var _0x212d2a={};var _0x530ac1;var _0x152ea8;return db['Team'][_0x55f1('0x74')]({'where':{'id':_0x393096['params']['id']}})['then'](handleEntityNotFound(_0x46db33,null))[_0x55f1('0x2b')](function(_0x2edd12){if(_0x2edd12){_0x530ac1=_0x2edd12;_0x212d2a[_0x55f1('0x3a')]=_[_0x55f1('0x37')](db['User'][_0x55f1('0x33')]);_0x212d2a['query']=_[_0x55f1('0x37')](_0x393096[_0x55f1('0x36')]);_0x212d2a['filters']=_['intersection'](_0x212d2a[_0x55f1('0x3a')],_0x212d2a['query']);_0x3532d0[_0x55f1('0x3b')]=_[_0x55f1('0x39')](_0x212d2a[_0x55f1('0x3a')],qs[_0x55f1('0x3c')](_0x393096[_0x55f1('0x36')][_0x55f1('0x3c')]));_0x3532d0['attributes']=_0x3532d0[_0x55f1('0x3b')][_0x55f1('0x3d')]?_0x3532d0['attributes']:_0x212d2a['model'];_0x3532d0[_0x55f1('0x3f')]=qs[_0x55f1('0x40')](_0x393096[_0x55f1('0x36')]['sort']);_0x3532d0[_0x55f1('0x41')]=qs[_0x55f1('0x38')](_[_0x55f1('0x42')](_0x393096['query'],_0x212d2a['filters']));if(_0x393096[_0x55f1('0x36')][_0x55f1('0x43')]){_0x3532d0[_0x55f1('0x41')]=_[_0x55f1('0x44')](_0x3532d0['where'],{'$or':_['map'](_0x3532d0[_0x55f1('0x3b')],function(_0x156615){var _0x54c4d9={};_0x54c4d9[_0x156615]={'$like':'%'+_0x393096['query']['filter']+'%'};return _0x54c4d9;})});}_0x3532d0=_[_0x55f1('0x44')]({},_0x3532d0,_0x393096[_0x55f1('0x45')]);return _0x530ac1['getAgents'](_0x3532d0);}})['then'](function(_0x1546b0){if(_0x1546b0){_0x152ea8=_0x1546b0[_0x55f1('0x3d')];if(!_0x393096[_0x55f1('0x36')]['hasOwnProperty'](_0x55f1('0x3e'))){_0x3532d0[_0x55f1('0x24')]=qs['limit'](_0x393096[_0x55f1('0x36')][_0x55f1('0x24')]);_0x3532d0['offset']=qs[_0x55f1('0x26')](_0x393096[_0x55f1('0x36')][_0x55f1('0x26')]);}return _0x530ac1[_0x55f1('0x9a')](_0x3532d0);}})['then'](function(_0x47d839){if(_0x47d839){return _0x47d839?{'count':_0x152ea8,'rows':_0x47d839}:null;}})[_0x55f1('0x2b')](respondWithResult(_0x46db33,null))[_0x55f1('0x4c')](handleError(_0x46db33,null));}; \ No newline at end of file +var _0xfed8=['model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','intersection','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','UserId','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','add','Queues','ids','removeQueues','findOne','addAgents','isArray','Voice','Mail','Sms','Fax','Whatsapp','through','penalty','defaults','TeamVoiceQueue','User','Queue','emit','Queue:save','voicePause','upsert','isNil','format','all','UserVoicePrefix','spread','removeAgents','Chat','Openchannel','Queue:remove','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./team.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','name','send','index','map','Team','rawAttributes','type'];(function(_0x29f1e2,_0x53f688){var _0x2aef40=function(_0x4d47a1){while(--_0x4d47a1){_0x29f1e2['push'](_0x29f1e2['shift']());}};_0x2aef40(++_0x53f688);}(_0xfed8,0xfe));var _0x8fed=function(_0x5f20b3,_0x557a07){_0x5f20b3=_0x5f20b3-0x0;var _0x2aa6e2=_0xfed8[_0x5f20b3];return _0x2aa6e2;};'use strict';var emlformat=require(_0x8fed('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8fed('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8fed('0x2'));var moment=require(_0x8fed('0x3'));var BPromise=require(_0x8fed('0x4'));var Mustache=require('mustache');var util=require(_0x8fed('0x5'));var path=require(_0x8fed('0x6'));var sox=require(_0x8fed('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8fed('0x8'));var _=require(_0x8fed('0x9'));var squel=require(_0x8fed('0xa'));var crypto=require(_0x8fed('0xb'));var jsforce=require(_0x8fed('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8fed('0xd'));var querystring=require(_0x8fed('0xe'));var Papa=require('papaparse');var Redis=require(_0x8fed('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8fed('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8fed('0x11'))(_0x8fed('0x12'));var utils=require(_0x8fed('0x13'));var config=require(_0x8fed('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8fed('0x15'))['db'];config[_0x8fed('0x16')]=_['defaults'](config[_0x8fed('0x16')],{'host':_0x8fed('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8fed('0x18'))[_0x8fed('0x19')](socket);function respondWithStatusCode(_0x28a3e8,_0x933e5){_0x933e5=_0x933e5||0xcc;return function(_0x34a25f){if(_0x34a25f){return _0x28a3e8[_0x8fed('0x1a')](_0x933e5);}return _0x28a3e8[_0x8fed('0x1b')](_0x933e5)[_0x8fed('0x1c')]();};}function respondWithResult(_0x1dee66,_0x35430e){_0x35430e=_0x35430e||0xc8;return function(_0x3eb9f2){if(_0x3eb9f2){return _0x1dee66[_0x8fed('0x1b')](_0x35430e)[_0x8fed('0x1d')](_0x3eb9f2);}};}function respondWithFilteredResult(_0x227c48,_0x1e30a0){return function(_0xe0d5a7){if(_0xe0d5a7){var _0x49d247=typeof _0x1e30a0[_0x8fed('0x1e')]===_0x8fed('0x1f')&&typeof _0x1e30a0[_0x8fed('0x20')]===_0x8fed('0x1f');var _0x16d405=_0xe0d5a7['count'];var _0x501759=_0x49d247?0x0:_0x1e30a0['offset'];var _0x98f643=_0x49d247?_0xe0d5a7[_0x8fed('0x21')]:_0x1e30a0['offset']+_0x1e30a0[_0x8fed('0x20')];var _0x5e17ec;if(_0x98f643>=_0x16d405){_0x98f643=_0x16d405;_0x5e17ec=0xc8;}else{_0x5e17ec=0xce;}_0x227c48[_0x8fed('0x1b')](_0x5e17ec);return _0x227c48[_0x8fed('0x22')](_0x8fed('0x23'),_0x501759+'-'+_0x98f643+'/'+_0x16d405)['json'](_0xe0d5a7);}return null;};}function patchUpdates(_0x4700fa){return function(_0x131b5a){try{jsonpatch[_0x8fed('0x24')](_0x131b5a,_0x4700fa,!![]);}catch(_0x4f2d5e){return BPromise[_0x8fed('0x25')](_0x4f2d5e);}return _0x131b5a[_0x8fed('0x26')]();};}function saveUpdates(_0x18cea3,_0x22764f){return function(_0x4b07b3){if(_0x4b07b3){return _0x4b07b3[_0x8fed('0x27')](_0x18cea3)[_0x8fed('0x28')](function(_0x23effe){return _0x23effe;});}return null;};}function handleEntityNotFound(_0xba9654,_0x4c933e){return function(_0x4d003a){if(!_0x4d003a){_0xba9654[_0x8fed('0x1a')](0x194);}return _0x4d003a;};}function handleError(_0x3320d9,_0xfdd97a){_0xfdd97a=_0xfdd97a||0x1f4;return function(_0x11334f){logger['error'](_0x11334f['stack']);if(_0x11334f[_0x8fed('0x29')]){delete _0x11334f[_0x8fed('0x29')];}_0x3320d9[_0x8fed('0x1b')](_0xfdd97a)[_0x8fed('0x2a')](_0x11334f);};}exports[_0x8fed('0x2b')]=function(_0x4563ca,_0x39a61d){var _0x12462b={},_0x2fae39={},_0x36952b={'count':0x0,'rows':[]};var _0x11e5d9=_[_0x8fed('0x2c')](db[_0x8fed('0x2d')][_0x8fed('0x2e')],function(_0x1c1560){return{'name':_0x1c1560['fieldName'],'type':_0x1c1560[_0x8fed('0x2f')]['key']};});_0x2fae39[_0x8fed('0x30')]=_[_0x8fed('0x2c')](_0x11e5d9,_0x8fed('0x29'));_0x2fae39[_0x8fed('0x31')]=_[_0x8fed('0x32')](_0x4563ca[_0x8fed('0x31')]);_0x2fae39[_0x8fed('0x33')]=_['intersection'](_0x2fae39[_0x8fed('0x30')],_0x2fae39[_0x8fed('0x31')]);_0x12462b[_0x8fed('0x34')]=_['intersection'](_0x2fae39[_0x8fed('0x30')],qs[_0x8fed('0x35')](_0x4563ca['query'][_0x8fed('0x35')]));_0x12462b[_0x8fed('0x34')]=_0x12462b[_0x8fed('0x34')][_0x8fed('0x36')]?_0x12462b['attributes']:_0x2fae39[_0x8fed('0x30')];if(!_0x4563ca[_0x8fed('0x31')][_0x8fed('0x37')](_0x8fed('0x38'))){_0x12462b[_0x8fed('0x20')]=qs[_0x8fed('0x20')](_0x4563ca['query'][_0x8fed('0x20')]);_0x12462b[_0x8fed('0x1e')]=qs[_0x8fed('0x1e')](_0x4563ca[_0x8fed('0x31')][_0x8fed('0x1e')]);}_0x12462b[_0x8fed('0x39')]=qs[_0x8fed('0x3a')](_0x4563ca[_0x8fed('0x31')][_0x8fed('0x3a')]);_0x12462b[_0x8fed('0x3b')]=qs['filters'](_[_0x8fed('0x3c')](_0x4563ca[_0x8fed('0x31')],_0x2fae39[_0x8fed('0x33')]),_0x11e5d9);if(_0x4563ca['query']['filter']){_0x12462b[_0x8fed('0x3b')]=_[_0x8fed('0x3d')](_0x12462b[_0x8fed('0x3b')],{'$or':_['map'](_0x11e5d9,function(_0xd487a6){if(_0xd487a6[_0x8fed('0x2f')]!==_0x8fed('0x3e')){var _0x2720c2={};_0x2720c2[_0xd487a6[_0x8fed('0x29')]]={'$like':'%'+_0x4563ca[_0x8fed('0x31')][_0x8fed('0x3f')]+'%'};return _0x2720c2;}})});}_0x12462b=_['merge']({},_0x12462b,_0x4563ca[_0x8fed('0x40')]);var _0x1ef5be={'where':_0x12462b[_0x8fed('0x3b')]};return db['Team']['count'](_0x1ef5be)['then'](function(_0x494645){_0x36952b[_0x8fed('0x21')]=_0x494645;if(_0x4563ca[_0x8fed('0x31')][_0x8fed('0x41')]){_0x12462b[_0x8fed('0x42')]=[{'all':!![]}];}return db[_0x8fed('0x2d')][_0x8fed('0x43')](_0x12462b);})[_0x8fed('0x28')](function(_0xc97df7){_0x36952b['rows']=_0xc97df7;return _0x36952b;})[_0x8fed('0x28')](respondWithFilteredResult(_0x39a61d,_0x12462b))['catch'](handleError(_0x39a61d,null));};exports[_0x8fed('0x44')]=function(_0x16eda5,_0x28f92f){var _0x328384={'raw':![],'where':{'id':_0x16eda5[_0x8fed('0x45')]['id']}},_0x38f290={};_0x38f290[_0x8fed('0x30')]=_[_0x8fed('0x32')](db[_0x8fed('0x2d')][_0x8fed('0x2e')]);_0x38f290['query']=_['keys'](_0x16eda5[_0x8fed('0x31')]);_0x38f290[_0x8fed('0x33')]=_['intersection'](_0x38f290['model'],_0x38f290['query']);_0x328384[_0x8fed('0x34')]=_[_0x8fed('0x46')](_0x38f290[_0x8fed('0x30')],qs[_0x8fed('0x35')](_0x16eda5[_0x8fed('0x31')][_0x8fed('0x35')]));_0x328384['attributes']=_0x328384[_0x8fed('0x34')][_0x8fed('0x36')]?_0x328384[_0x8fed('0x34')]:_0x38f290[_0x8fed('0x30')];if(_0x16eda5[_0x8fed('0x31')][_0x8fed('0x41')]){_0x328384[_0x8fed('0x42')]=[{'all':!![]}];}_0x328384=_[_0x8fed('0x3d')]({},_0x328384,_0x16eda5['options']);return db[_0x8fed('0x2d')][_0x8fed('0x47')](_0x328384)['then'](handleEntityNotFound(_0x28f92f,null))['then'](respondWithResult(_0x28f92f,null))[_0x8fed('0x48')](handleError(_0x28f92f,null));};exports[_0x8fed('0x49')]=function(_0x508a5d,_0x4efbc1){return db[_0x8fed('0x2d')][_0x8fed('0x49')](_0x508a5d[_0x8fed('0x4a')],{})[_0x8fed('0x28')](function(_0x501beb){var _0x295b38=_0x508a5d[_0x8fed('0x4b')][_0x8fed('0x4c')]({'plain':!![]});if(!_0x295b38)throw new Error(_0x8fed('0x4d'));if(_0x295b38[_0x8fed('0x4e')]===_0x8fed('0x4b')){var _0x5085f6=_0x501beb['get']({'plain':!![]});var _0x4ca23a=_0x8fed('0x4f');return db[_0x8fed('0x50')]['find']({'where':{'name':_0x4ca23a,'userProfileId':_0x295b38[_0x8fed('0x51')]},'raw':!![]})[_0x8fed('0x28')](function(_0x532dac){if(_0x532dac&&_0x532dac[_0x8fed('0x52')]===0x0){return db[_0x8fed('0x53')][_0x8fed('0x49')]({'name':_0x5085f6[_0x8fed('0x29')],'resourceId':_0x5085f6['id'],'type':_0x532dac[_0x8fed('0x29')],'sectionId':_0x532dac['id']},{})['then'](function(){return _0x501beb;});}else{return _0x501beb;}})[_0x8fed('0x48')](function(_0x8eb1fd){logger[_0x8fed('0x54')](_0x8fed('0x55'),_0x8eb1fd);throw _0x8eb1fd;});}return _0x501beb;})['then'](respondWithResult(_0x4efbc1,0xc9))[_0x8fed('0x48')](handleError(_0x4efbc1,null));};exports['update']=function(_0x39cab9,_0x42be8a){if(_0x39cab9[_0x8fed('0x4a')]['id']){delete _0x39cab9[_0x8fed('0x4a')]['id'];}return db[_0x8fed('0x2d')][_0x8fed('0x47')]({'where':{'id':_0x39cab9[_0x8fed('0x45')]['id']}})['then'](handleEntityNotFound(_0x42be8a,null))[_0x8fed('0x28')](saveUpdates(_0x39cab9[_0x8fed('0x4a')],null))[_0x8fed('0x28')](respondWithResult(_0x42be8a,null))[_0x8fed('0x48')](handleError(_0x42be8a,null));};exports['destroy']=function(_0x263e22,_0x1342ad){var _0x5b36b6=_0x263e22[_0x8fed('0x45')]['id'];var _0x54f46f=[];return db[_0x8fed('0x56')][_0x8fed('0x57')](function(_0x24e4f0){var _0x18212b=_0x8fed('0x58')+_0x5b36b6;return db[_0x8fed('0x56')]['query'](_0x18212b,{'type':db[_0x8fed('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x24e4f0})[_0x8fed('0x28')](function(_0x48517a){_0x54f46f=_[_0x8fed('0x2c')](_0x48517a,function(_0x4418b5){return Number(_0x4418b5[_0x8fed('0x5a')]);});})[_0x8fed('0x28')](function(){var _0x33834e='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5b36b6;return db[_0x8fed('0x56')][_0x8fed('0x31')](_0x33834e,{'type':db[_0x8fed('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x24e4f0});})['then'](function(_0x5a2bd1){var _0x3c8c21=_[_0x8fed('0x2c')](_0x5a2bd1,function(_0x56002b){return Number(_0x56002b[_0x8fed('0x5b')]);});return db[_0x8fed('0x5c')][_0x8fed('0x5d')]({'where':{'UserId':{'$in':_0x54f46f},'VoiceQueueId':{'$in':_0x3c8c21}},'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(){var _0x2f1566=_0x8fed('0x5e')+_0x5b36b6;return db['sequelize'][_0x8fed('0x31')](_0x2f1566,{'type':db[_0x8fed('0x59')][_0x8fed('0x5f')][_0x8fed('0x60')],'raw':!![],'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(_0x2376d0){var _0xf08a22=_[_0x8fed('0x2c')](_0x2376d0,function(_0x5ed8c5){return Number(_0x5ed8c5[_0x8fed('0x61')]);});return db['UserMailQueue'][_0x8fed('0x5d')]({'where':{'UserId':{'$in':_0x54f46f},'MailQueueId':{'$in':_0xf08a22}},'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(){var _0x41614c=_0x8fed('0x62')+_0x5b36b6;return db[_0x8fed('0x56')][_0x8fed('0x31')](_0x41614c,{'type':db[_0x8fed('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(_0x1ab8a2){var _0x5757f2=_[_0x8fed('0x2c')](_0x1ab8a2,function(_0x1c51fb){return Number(_0x1c51fb[_0x8fed('0x63')]);});return db['UserSmsQueue'][_0x8fed('0x5d')]({'where':{'UserId':{'$in':_0x54f46f},'SmsQueueId':{'$in':_0x5757f2}},'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(){var _0x3dd3bc=_0x8fed('0x64')+_0x5b36b6;return db['sequelize'][_0x8fed('0x31')](_0x3dd3bc,{'type':db[_0x8fed('0x59')][_0x8fed('0x5f')][_0x8fed('0x60')],'raw':!![],'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(_0x456abf){var _0x2229d3=_['map'](_0x456abf,function(_0x3b4390){return Number(_0x3b4390[_0x8fed('0x65')]);});return db['UserChatQueue'][_0x8fed('0x5d')]({'where':{'UserId':{'$in':_0x54f46f},'ChatQueueId':{'$in':_0x2229d3}},'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(){var _0x572e89=_0x8fed('0x66')+_0x5b36b6;return db[_0x8fed('0x56')][_0x8fed('0x31')](_0x572e89,{'type':db[_0x8fed('0x59')][_0x8fed('0x5f')][_0x8fed('0x60')],'raw':!![],'transaction':_0x24e4f0});})['then'](function(_0x1a3147){var _0x1c2a05=_['map'](_0x1a3147,function(_0x54b1a2){return Number(_0x54b1a2[_0x8fed('0x67')]);});return db['UserFaxQueue'][_0x8fed('0x5d')]({'where':{'UserId':{'$in':_0x54f46f},'FaxQueueId':{'$in':_0x1c2a05}},'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(){var _0x3d6930=_0x8fed('0x68')+_0x5b36b6;return db[_0x8fed('0x56')][_0x8fed('0x31')](_0x3d6930,{'type':db[_0x8fed('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(_0x9f2c81){var _0xe1d480=_[_0x8fed('0x2c')](_0x9f2c81,function(_0x37c7c9){return Number(_0x37c7c9[_0x8fed('0x69')]);});return db[_0x8fed('0x6a')][_0x8fed('0x5d')]({'where':{'UserId':{'$in':_0x54f46f},'OpenchannelQueueId':{'$in':_0xe1d480}},'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(){var _0x31f31c=_0x8fed('0x6b')+_0x5b36b6;return db['sequelize'][_0x8fed('0x31')](_0x31f31c,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(_0x433083){var _0x232d86=_['map'](_0x433083,function(_0xf80d7){return Number(_0xf80d7[_0x8fed('0x6c')]);});return db[_0x8fed('0x6d')][_0x8fed('0x5d')]({'where':{'UserId':{'$in':_0x54f46f},'WhatsappQueueId':{'$in':_0x232d86}},'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(){return db[_0x8fed('0x6e')]['find']({'where':{'TeamId':_0x5b36b6}});})[_0x8fed('0x28')](function(_0x145dc0){if(_0x145dc0===null){return;}return db['UserVoicePrefix'][_0x8fed('0x5d')]({'where':{'UserId':{'$in':_0x54f46f},'VoicePrefixId':_0x145dc0[_0x8fed('0x6f')]},'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(){return db[_0x8fed('0x2d')][_0x8fed('0x5d')]({'where':{'id':_0x5b36b6},'cascade':!![],'transaction':_0x24e4f0});})[_0x8fed('0x28')](function(_0x469768){if(_0x469768===0x0){_0x1342ad['sendStatus'](0x194);}else{return db[_0x8fed('0x53')][_0x8fed('0x5d')]({'where':{'type':'Teams','resourceId':_0x5b36b6},'cascade':!![],'transaction':_0x24e4f0})[_0x8fed('0x28')](function(){_0x1342ad[_0x8fed('0x1b')](0xcc)[_0x8fed('0x1c')]();});}})['catch'](function(_0x3bb0a2){_0x1342ad['status'](0x1f4)['send'](_0x3bb0a2);});});};exports[_0x8fed('0x70')]=function(_0x422de0,_0x227e4b,_0x7cbc40){return db[_0x8fed('0x2d')]['findOne']({'where':{'id':_0x422de0[_0x8fed('0x45')]['id']}})[_0x8fed('0x28')](handleEntityNotFound(_0x227e4b,null))[_0x8fed('0x28')](function(_0x1e75d8){if(!_0x422de0[_0x8fed('0x31')][_0x8fed('0x71')]||!utils[_0x8fed('0x72')](_0x422de0[_0x8fed('0x31')][_0x8fed('0x71')])){throw new db[(_0x8fed('0x59'))][(_0x8fed('0x73'))](_0x8fed('0x74'));}var _0x1237bd={};var _0x3e6d30={};_0x3e6d30[_0x8fed('0x30')]=_[_0x8fed('0x32')](db[_[_0x8fed('0x75')](_0x422de0['query'][_0x8fed('0x71')][_0x8fed('0x76')]())+'Queue'][_0x8fed('0x2e')]);_0x3e6d30['query']=_['keys'](_0x422de0[_0x8fed('0x31')]);_0x3e6d30[_0x8fed('0x33')]=_[_0x8fed('0x46')](_0x3e6d30[_0x8fed('0x30')],_0x3e6d30[_0x8fed('0x31')]);_0x1237bd[_0x8fed('0x34')]=_[_0x8fed('0x46')](_0x3e6d30['model'],qs[_0x8fed('0x35')](_0x422de0[_0x8fed('0x31')][_0x8fed('0x35')]));_0x1237bd[_0x8fed('0x34')]=_0x1237bd[_0x8fed('0x34')][_0x8fed('0x36')]?_0x1237bd['attributes']:_0x3e6d30[_0x8fed('0x30')];_0x1237bd[_0x8fed('0x20')]=qs[_0x8fed('0x20')](_0x422de0[_0x8fed('0x31')][_0x8fed('0x20')]);_0x1237bd['offset']=qs[_0x8fed('0x1e')](_0x422de0['query'][_0x8fed('0x1e')]);_0x1237bd[_0x8fed('0x39')]=qs[_0x8fed('0x3a')](_0x422de0[_0x8fed('0x31')][_0x8fed('0x3a')]);_0x1237bd[_0x8fed('0x3b')]=qs[_0x8fed('0x33')](_[_0x8fed('0x3c')](_0x422de0['query'],_0x3e6d30[_0x8fed('0x33')]));_0x1237bd=_['merge']({},_0x1237bd,_0x422de0[_0x8fed('0x40')]);return _0x1e75d8['get'+_[_0x8fed('0x75')](_0x422de0[_0x8fed('0x31')][_0x8fed('0x71')][_0x8fed('0x76')]())+'Queues'](_0x1237bd);})[_0x8fed('0x28')](respondWithResult(_0x227e4b,null))[_0x8fed('0x48')](handleError(_0x227e4b,null));};exports['addQueues']=function(_0x2795b1,_0x2a060f,_0x430414){return db['Team']['findOne']({'where':{'id':_0x2795b1[_0x8fed('0x45')]['id']}})['then'](function(_0xfec68){if(_0xfec68){if(!_0x2795b1[_0x8fed('0x4a')][_0x8fed('0x71')]||!utils[_0x8fed('0x72')](_0x2795b1[_0x8fed('0x4a')][_0x8fed('0x71')])){throw new db['Sequelize'][(_0x8fed('0x73'))](_0x8fed('0x74'));}return _0xfec68[_0x8fed('0x77')+_['capitalize'](_0x2795b1['body'][_0x8fed('0x71')][_0x8fed('0x76')]())+_0x8fed('0x78')](_0x2795b1[_0x8fed('0x4a')][_0x8fed('0x79')]);}return null;})[_0x8fed('0x28')](handleEntityNotFound(_0x2a060f,null))[_0x8fed('0x28')](respondWithStatusCode(_0x2a060f,null))['catch'](handleError(_0x2a060f,null));};exports[_0x8fed('0x7a')]=function(_0x35abb7,_0x271478,_0x43a6b9){return db[_0x8fed('0x2d')][_0x8fed('0x7b')]({'where':{'id':_0x35abb7['params']['id']}})['then'](function(_0x386f7c){if(_0x386f7c){if(!_0x35abb7[_0x8fed('0x31')][_0x8fed('0x71')]||!utils['isValidChannel'](_0x35abb7['query'][_0x8fed('0x71')])){throw new db[(_0x8fed('0x59'))]['ValidationError']('Unknown\x20channel');}return _0x386f7c['remove'+_[_0x8fed('0x75')](_0x35abb7['query'][_0x8fed('0x71')][_0x8fed('0x76')]())+_0x8fed('0x78')](_0x35abb7[_0x8fed('0x31')]['ids']);}return null;})[_0x8fed('0x28')](handleEntityNotFound(_0x271478,null))[_0x8fed('0x28')](respondWithStatusCode(_0x271478,null))[_0x8fed('0x48')](handleError(_0x271478,null));};exports[_0x8fed('0x7c')]=function(_0x3c6523,_0x23416d){var _0x593646=_[_0x8fed('0x7d')](_0x3c6523['body'][_0x8fed('0x79')])?_0x3c6523[_0x8fed('0x4a')]['ids']:[_0x3c6523[_0x8fed('0x4a')][_0x8fed('0x79')]];var _0x483ac6=_0x3c6523[_0x8fed('0x45')]['id'];return db[_0x8fed('0x2d')][_0x8fed('0x47')]({'where':{'id':_0x483ac6}})['then'](handleEntityNotFound(_0x23416d,null))[_0x8fed('0x28')](function(_0x48b18a){if(_0x48b18a){var _0x5da3d1=[_0x8fed('0x7e'),'Chat',_0x8fed('0x7f'),_0x8fed('0x80'),_0x8fed('0x81'),'Openchannel',_0x8fed('0x82')];return db[_0x8fed('0x56')][_0x8fed('0x57')](function(_0x31e169){var _0x4cd0f2=_[_0x8fed('0x2c')](_0x5da3d1,function(_0x202063){var _0x17def0={'attributes':['id',_0x8fed('0x29')]};if(_0x202063===_0x8fed('0x7e')){_0x17def0[_0x8fed('0x83')]={'attributes':[_0x8fed('0x84')]};}return _0x48b18a[_0x8fed('0x4c')+_0x202063+_0x8fed('0x78')](_0x17def0)[_0x8fed('0x28')](function(_0x30d457){var _0x15f48d=_[_0x8fed('0x2c')](_0x30d457,function(_0x2bea1f){var _0x39e499=_[_0x8fed('0x2c')](_0x593646,function(_0x2cf0a5){var _0x31b124={'where':{'UserId':_0x2cf0a5,[_0x202063+'QueueId']:_0x2bea1f['id']},'transaction':_0x31e169};if(_0x202063===_0x8fed('0x7e')){_0x31b124[_0x8fed('0x85')]={'penalty':_0x2bea1f[_0x8fed('0x86')]['penalty']};}return db[_0x8fed('0x87')+_0x202063+_0x8fed('0x88')]['findOrCreate'](_0x31b124)[_0x8fed('0x28')](function(){socket[_0x8fed('0x89')]('user'+_0x202063+_0x8fed('0x8a'),{'UserId':_0x2cf0a5,[_0x202063+'QueueId']:_0x2bea1f['id']});if(_0x202063!==_0x8fed('0x7e')){return;}return db[_0x8fed('0x87')][_0x8fed('0x43')]({'where':{'id':_0x593646,'online':0x1},'attributes':['id',_0x8fed('0x29'),'online',_0x8fed('0x8b'),'interface'],'raw':!![]})['then'](function(_0x3ab8de){var _0x3f1236=_['map'](_0x3ab8de,function(_0x5405bf){return db['UserVoiceQueueRt'][_0x8fed('0x8c')]({'membername':_0x5405bf[_0x8fed('0x29')],'UserId':_0x5405bf['id'],'queue_name':_0x2bea1f[_0x8fed('0x29')],'VoiceQueueId':_0x2bea1f['id'],'interface':_[_0x8fed('0x8d')](_0x5405bf['interface'])?util[_0x8fed('0x8e')]('SIP/%s',_0x5405bf[_0x8fed('0x29')]):_0x5405bf['interface'],'paused':_0x5405bf[_0x8fed('0x8b')]||![],'penalty':_0x2bea1f[_0x8fed('0x86')][_0x8fed('0x84')]},{'transaction':_0x31e169});});return Promise[_0x8fed('0x8f')](_0x3f1236);});});});return Promise[_0x8fed('0x8f')](_0x39e499);});return Promise['all'](_0x15f48d);})[_0x8fed('0x28')](function(){return db['TeamVoicePrefix'][_0x8fed('0x7b')]({'where':{'teamId':_0x483ac6}})[_0x8fed('0x28')](function(_0x4e0dd7){if(_0x4e0dd7){var _0x4ffebd=_['map'](_0x593646,function(_0x4b9298){db[_0x8fed('0x90')][_0x8fed('0x8c')]({'UserId':_0x4b9298,'VoicePrefixId':_0x4e0dd7[_0x8fed('0x6f')]});});return Promise[_0x8fed('0x8f')](_0x4ffebd);}});});});return Promise[_0x8fed('0x8f')](_0x4cd0f2)[_0x8fed('0x28')](function(){return _0x48b18a['addAgents'](_0x593646,{'transaction':_0x31e169})[_0x8fed('0x91')](function(_0x45122c){return _0x45122c;});});});}})[_0x8fed('0x28')](respondWithResult(_0x23416d,null))[_0x8fed('0x48')](handleError(_0x23416d,null));};exports[_0x8fed('0x92')]=function(_0x586720,_0x41bb43){var _0x20e03c=_[_0x8fed('0x7d')](_0x586720[_0x8fed('0x31')][_0x8fed('0x79')])?_0x586720[_0x8fed('0x31')][_0x8fed('0x79')]:[_0x586720[_0x8fed('0x31')][_0x8fed('0x79')]];var _0x3d38a2=_0x586720[_0x8fed('0x45')]['id'];return db[_0x8fed('0x2d')][_0x8fed('0x47')]({'where':{'id':_0x3d38a2}})[_0x8fed('0x28')](handleEntityNotFound(_0x41bb43,null))['then'](function(_0x5602a8){if(_0x5602a8){var _0x8f78aa=[_0x8fed('0x7e'),_0x8fed('0x93'),'Mail',_0x8fed('0x80'),_0x8fed('0x81'),_0x8fed('0x94'),'Whatsapp'];return db[_0x8fed('0x56')]['transaction'](function(_0x433942){var _0x1aaff4=_['map'](_0x8f78aa,function(_0x519baa){var _0x338f35={'attributes':['id',_0x8fed('0x29')]};return _0x5602a8[_0x8fed('0x4c')+_0x519baa+_0x8fed('0x78')](_0x338f35)[_0x8fed('0x28')](function(_0x421d3e){var _0xb44c18=_[_0x8fed('0x2c')](_0x421d3e,function(_0xf17767){return _0xf17767[_0x8fed('0x92')](_0x20e03c,{'transaction':_0x433942})[_0x8fed('0x28')](function(){var _0xd16342=_['map'](_0x20e03c,function(_0x10755b){socket['emit'](_0x8fed('0x4b')+_0x519baa+_0x8fed('0x95'),{'UserId':Number(_0x10755b),[_0x519baa+'QueueId']:_0xf17767['id']});if(_0x519baa!==_0x8fed('0x7e')){return;}return db['UserVoiceQueueRt'][_0x8fed('0x5d')]({'where':{'VoiceQueueId':_0xf17767['id'],'UserId':_0x10755b},'transaction':_0x433942});});return Promise[_0x8fed('0x8f')](_0xd16342);});});return Promise['all'](_0xb44c18);});});return Promise[_0x8fed('0x8f')](_0x1aaff4)[_0x8fed('0x28')](function(){return _0x5602a8[_0x8fed('0x92')](_0x20e03c,{'transaction':_0x433942});})[_0x8fed('0x28')](function(){return db['TeamVoicePrefix'][_0x8fed('0x7b')]({'where':{'teamId':_0x3d38a2}})['then'](function(_0x5b9fbf){if(_0x5b9fbf){var _0x510344=_[_0x8fed('0x2c')](_0x20e03c,function(_0x25bac7){db[_0x8fed('0x90')]['destroy']({'where':{'UserId':_0x25bac7,'VoicePrefixId':_0x5b9fbf[_0x8fed('0x6f')]}});});return Promise['all'](_0x510344);}});});});}})['then'](respondWithStatusCode(_0x41bb43,null))[_0x8fed('0x48')](handleError(_0x41bb43,null));};exports[_0x8fed('0x96')]=function(_0x1e7469,_0x35c525,_0x5720ad){var _0x4a1c01={};var _0x348273={};var _0x349604;var _0x34c7d9;return db[_0x8fed('0x2d')][_0x8fed('0x7b')]({'where':{'id':_0x1e7469[_0x8fed('0x45')]['id']}})[_0x8fed('0x28')](handleEntityNotFound(_0x35c525,null))['then'](function(_0x43c0ce){if(_0x43c0ce){_0x349604=_0x43c0ce;_0x348273[_0x8fed('0x30')]=_['keys'](db['User'][_0x8fed('0x2e')]);_0x348273[_0x8fed('0x31')]=_[_0x8fed('0x32')](_0x1e7469[_0x8fed('0x31')]);_0x348273['filters']=_[_0x8fed('0x46')](_0x348273['model'],_0x348273[_0x8fed('0x31')]);_0x4a1c01[_0x8fed('0x34')]=_['intersection'](_0x348273[_0x8fed('0x30')],qs[_0x8fed('0x35')](_0x1e7469['query'][_0x8fed('0x35')]));_0x4a1c01[_0x8fed('0x34')]=_0x4a1c01[_0x8fed('0x34')][_0x8fed('0x36')]?_0x4a1c01[_0x8fed('0x34')]:_0x348273['model'];_0x4a1c01['order']=qs[_0x8fed('0x3a')](_0x1e7469['query'][_0x8fed('0x3a')]);_0x4a1c01[_0x8fed('0x3b')]=qs[_0x8fed('0x33')](_[_0x8fed('0x3c')](_0x1e7469[_0x8fed('0x31')],_0x348273[_0x8fed('0x33')]));if(_0x1e7469[_0x8fed('0x31')][_0x8fed('0x3f')]){_0x4a1c01[_0x8fed('0x3b')]=_['merge'](_0x4a1c01[_0x8fed('0x3b')],{'$or':_[_0x8fed('0x2c')](_0x4a1c01[_0x8fed('0x34')],function(_0x19e751){var _0x37b454={};_0x37b454[_0x19e751]={'$like':'%'+_0x1e7469['query'][_0x8fed('0x3f')]+'%'};return _0x37b454;})});}_0x4a1c01=_[_0x8fed('0x3d')]({},_0x4a1c01,_0x1e7469['options']);return _0x349604[_0x8fed('0x96')](_0x4a1c01);}})[_0x8fed('0x28')](function(_0x491c96){if(_0x491c96){_0x34c7d9=_0x491c96[_0x8fed('0x36')];if(!_0x1e7469[_0x8fed('0x31')]['hasOwnProperty'](_0x8fed('0x38'))){_0x4a1c01[_0x8fed('0x20')]=qs[_0x8fed('0x20')](_0x1e7469[_0x8fed('0x31')][_0x8fed('0x20')]);_0x4a1c01[_0x8fed('0x1e')]=qs[_0x8fed('0x1e')](_0x1e7469[_0x8fed('0x31')][_0x8fed('0x1e')]);}return _0x349604[_0x8fed('0x96')](_0x4a1c01);}})[_0x8fed('0x28')](function(_0x1a317f){if(_0x1a317f){return _0x1a317f?{'count':_0x34c7d9,'rows':_0x1a317f}:null;}})[_0x8fed('0x28')](respondWithResult(_0x35c525,null))[_0x8fed('0x48')](handleError(_0x35c525,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index a70e33f..f8c2719 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 _0xb07d=['hook','events','Team','save','update','emit'];(function(_0x135f4,_0x1fc1b1){var _0x2cd050=function(_0xeb7b4e){while(--_0xeb7b4e){_0x135f4['push'](_0x135f4['shift']());}};_0x2cd050(++_0x1fc1b1);}(_0xb07d,0x16f));var _0xdb07=function(_0x31c41c,_0x21d103){_0x31c41c=_0x31c41c-0x0;var _0x95c257=_0xb07d[_0x31c41c];return _0x95c257;};'use strict';var EventEmitter=require(_0xdb07('0x0'));var Team=require('../../mysqldb')['db'][_0xdb07('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdb07('0x2'),'afterUpdate':_0xdb07('0x3'),'afterDestroy':'remove'};function emitEvent(_0x41c9e3){return function(_0x6216be,_0x5af902,_0x2f367d){TeamEvents['emit'](_0x41c9e3+':'+_0x6216be['id'],_0x6216be);TeamEvents[_0xdb07('0x4')](_0x41c9e3,_0x6216be);_0x2f367d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xdb07('0x5')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x93b4=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x533b95,_0x20351a){var _0xc5bf07=function(_0x5cd8f2){while(--_0x5cd8f2){_0x533b95['push'](_0x533b95['shift']());}};_0xc5bf07(++_0x20351a);}(_0x93b4,0x9e));var _0x493b=function(_0x22839f,_0xf73eef){_0x22839f=_0x22839f-0x0;var _0x120a46=_0x93b4[_0x22839f];return _0x120a46;};'use strict';var EventEmitter=require(_0x493b('0x0'));var Team=require(_0x493b('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x493b('0x2')](0x0);var events={'afterCreate':_0x493b('0x3'),'afterUpdate':_0x493b('0x4'),'afterDestroy':_0x493b('0x5')};function emitEvent(_0x243c62){return function(_0x11a0eb,_0x222e4f,_0x572c18){TeamEvents[_0x493b('0x6')](_0x243c62+':'+_0x11a0eb['id'],_0x11a0eb);TeamEvents[_0x493b('0x6')](_0x243c62,_0x11a0eb);_0x572c18(null);};}for(var e in events){if(events[_0x493b('0x7')](e)){var event=events[e];Team[_0x493b('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 13d4a27..68aec5f 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 _0x64e8=['all','./team.attributes','get','then','setDataValue','channel','catch','exports','define','Team','teams','Chat','Fax','Mail','Openchannel','Sms','Voice'];(function(_0x2c732d,_0x4e683e){var _0xd4b603=function(_0xd593ca){while(--_0xd593ca){_0x2c732d['push'](_0x2c732d['shift']());}};_0xd4b603(++_0x4e683e);}(_0x64e8,0x1cc));var _0x864e=function(_0x36c6a1,_0x41edfc){_0x36c6a1=_0x36c6a1-0x0;var _0x292e0f=_0x64e8[_0x36c6a1];return _0x292e0f;};'use strict';var _=require('lodash');var attributes=require(_0x864e('0x0'));function getQueuesByChannel(_0x2c1106,_0x2f10e5){var _0x39e33d=_0x864e('0x1')+_0x2f10e5+'Queues';return _0x2c1106[_0x39e33d]()[_0x864e('0x2')](function(_0x1af9d4){return _['map'](_0x1af9d4,function(_0x3b0907){_0x3b0907[_0x864e('0x3')](_0x864e('0x4'),_0x2f10e5);return _0x3b0907;});})[_0x864e('0x5')](function(_0x217ee1){throw _0x217ee1;});}module[_0x864e('0x6')]=function(_0x5c216b){return _0x5c216b[_0x864e('0x7')](_0x864e('0x8'),attributes,{'tableName':_0x864e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x1a5356=this;var _0x2e0d0f=[_0x864e('0xa'),_0x864e('0xb'),_0x864e('0xc'),_0x864e('0xd'),_0x864e('0xe'),_0x864e('0xf'),'Whatsapp'];return Promise['resolve']()[_0x864e('0x2')](function(){var _0x26db01=_['map'](_0x2e0d0f,function(_0x5604ce){return getQueuesByChannel(_0x1a5356,_0x5604ce);});return Promise[_0x864e('0x10')](_0x26db01);})['catch'](function(_0x86938e){throw _0x86938e;});}}});}; \ No newline at end of file +var _0x40d6=['lodash','./team.attributes','get','Queues','map','setDataValue','catch','exports','define','Team','teams','Fax','Mail','Openchannel','Sms','Voice','Whatsapp','resolve','all'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x40d6,0xf7));var _0x640d=function(_0x2b085a,_0x139172){_0x2b085a=_0x2b085a-0x0;var _0x1c4067=_0x40d6[_0x2b085a];return _0x1c4067;};'use strict';var _=require(_0x640d('0x0'));var attributes=require(_0x640d('0x1'));function getQueuesByChannel(_0x43ea7e,_0x1fc661){var _0x409a6d=_0x640d('0x2')+_0x1fc661+_0x640d('0x3');return _0x43ea7e[_0x409a6d]()['then'](function(_0x40d5af){return _[_0x640d('0x4')](_0x40d5af,function(_0x18be06){_0x18be06[_0x640d('0x5')]('channel',_0x1fc661);return _0x18be06;});})[_0x640d('0x6')](function(_0x4d3b76){throw _0x4d3b76;});}module[_0x640d('0x7')]=function(_0xc16c70){return _0xc16c70[_0x640d('0x8')](_0x640d('0x9'),attributes,{'tableName':_0x640d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x2dd9aa=this;var _0x4c5c75=['Chat',_0x640d('0xb'),_0x640d('0xc'),_0x640d('0xd'),_0x640d('0xe'),_0x640d('0xf'),_0x640d('0x10')];return Promise[_0x640d('0x11')]()['then'](function(){var _0x376091=_[_0x640d('0x4')](_0x4c5c75,function(_0x41f6e0){return getQueuesByChannel(_0x2dd9aa,_0x41f6e0);});return Promise[_0x640d('0x12')](_0x376091);})[_0x640d('0x6')](function(_0x2d8320){throw _0x2d8320;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 274b77d..8bd1611 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 _0xd469=['debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./team.socket','register','info','Team,\x20%s,\x20%s','request\x20sent'];(function(_0x5b3950,_0x4e5556){var _0x41e436=function(_0x139e30){while(--_0x139e30){_0x5b3950['push'](_0x5b3950['shift']());}};_0x41e436(++_0x4e5556);}(_0xd469,0x181));var _0x9d46=function(_0x5ebac5,_0x39844b){_0x5ebac5=_0x5ebac5-0x0;var _0x5e407f=_0xd469[_0x5ebac5];return _0x5e407f;};'use strict';var _=require(_0x9d46('0x0'));var util=require(_0x9d46('0x1'));var moment=require(_0x9d46('0x2'));var BPromise=require('bluebird');var rs=require(_0x9d46('0x3'));var fs=require('fs');var Redis=require(_0x9d46('0x4'));var db=require('../../mysqldb')['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['client'][_0x9d46('0xa')]({'port':0x232a});config['redis']=_[_0x9d46('0xb')](config['redis'],{'host':_0x9d46('0xc'),'port':0x18eb});var socket=require(_0x9d46('0xd'))(new Redis(config[_0x9d46('0xe')]));require(_0x9d46('0xf'))[_0x9d46('0x10')](socket);function respondWithRpcPromise(_0x2225c3,_0x2e4d05,_0xfc072b){return new BPromise(function(_0x1a63e7,_0x2516b5){return client['request'](_0x2225c3,_0xfc072b)['then'](function(_0x55959f){logger[_0x9d46('0x11')](_0x9d46('0x12'),_0x2e4d05,_0x9d46('0x13'));logger[_0x9d46('0x14')](_0x9d46('0x15'),_0x2e4d05,'request\x20sent',JSON[_0x9d46('0x16')](_0x55959f));if(_0x55959f[_0x9d46('0x17')]){if(_0x55959f[_0x9d46('0x17')]['code']===0x1f4){logger[_0x9d46('0x17')](_0x9d46('0x12'),_0x2e4d05,_0x55959f[_0x9d46('0x17')]['message']);return _0x2516b5(_0x55959f[_0x9d46('0x17')][_0x9d46('0x18')]);}logger['error'](_0x9d46('0x12'),_0x2e4d05,_0x55959f[_0x9d46('0x17')][_0x9d46('0x18')]);return _0x1a63e7(_0x55959f['error'][_0x9d46('0x18')]);}else{logger[_0x9d46('0x11')](_0x9d46('0x12'),_0x2e4d05,'request\x20sent');_0x1a63e7(_0x55959f[_0x9d46('0x19')]['message']);}})[_0x9d46('0x1a')](function(_0x19e352){logger[_0x9d46('0x17')](_0x9d46('0x12'),_0x2e4d05,_0x19e352);_0x2516b5(_0x19e352);});});} \ No newline at end of file +var _0x3b64=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x4ac00f,_0x356690){var _0x535bef=function(_0x496c7a){while(--_0x496c7a){_0x4ac00f['push'](_0x4ac00f['shift']());}};_0x535bef(++_0x356690);}(_0x3b64,0x71));var _0x43b6=function(_0x46af82,_0x5c6ce2){_0x46af82=_0x46af82-0x0;var _0x5e392a=_0x3b64[_0x46af82];return _0x5e392a;};'use strict';var _=require(_0x43b6('0x0'));var util=require(_0x43b6('0x1'));var moment=require(_0x43b6('0x2'));var BPromise=require(_0x43b6('0x3'));var rs=require(_0x43b6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43b6('0x5'))['db'];var utils=require(_0x43b6('0x6'));var logger=require(_0x43b6('0x7'))(_0x43b6('0x8'));var config=require(_0x43b6('0x9'));var jayson=require(_0x43b6('0xa'));var client=jayson[_0x43b6('0xb')][_0x43b6('0xc')]({'port':0x232a});config[_0x43b6('0xd')]=_[_0x43b6('0xe')](config[_0x43b6('0xd')],{'host':_0x43b6('0xf'),'port':0x18eb});var socket=require(_0x43b6('0x10'))(new Redis(config[_0x43b6('0xd')]));require(_0x43b6('0x11'))['register'](socket);function respondWithRpcPromise(_0x4b5e5a,_0xfd724a,_0x4f47b6){return new BPromise(function(_0x30c122,_0x486d1d){return client['request'](_0x4b5e5a,_0x4f47b6)[_0x43b6('0x12')](function(_0x5cdbb3){logger[_0x43b6('0x13')](_0x43b6('0x14'),_0xfd724a,_0x43b6('0x15'));logger[_0x43b6('0x16')](_0x43b6('0x17'),_0xfd724a,_0x43b6('0x15'),JSON[_0x43b6('0x18')](_0x5cdbb3));if(_0x5cdbb3[_0x43b6('0x19')]){if(_0x5cdbb3[_0x43b6('0x19')][_0x43b6('0x1a')]===0x1f4){logger[_0x43b6('0x19')]('Team,\x20%s,\x20%s',_0xfd724a,_0x5cdbb3[_0x43b6('0x19')][_0x43b6('0x1b')]);return _0x486d1d(_0x5cdbb3[_0x43b6('0x19')][_0x43b6('0x1b')]);}logger[_0x43b6('0x19')]('Team,\x20%s,\x20%s',_0xfd724a,_0x5cdbb3[_0x43b6('0x19')]['message']);return _0x30c122(_0x5cdbb3['error'][_0x43b6('0x1b')]);}else{logger[_0x43b6('0x13')]('Team,\x20%s,\x20%s',_0xfd724a,'request\x20sent');_0x30c122(_0x5cdbb3['result'][_0x43b6('0x1b')]);}})[_0x43b6('0x1c')](function(_0x15b4e9){logger['error'](_0x43b6('0x14'),_0xfd724a,_0x15b4e9);_0x486d1d(_0x15b4e9);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index cfec7a0..f13e588 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 _0xbc48=['register','length','team:','save','remove','update','emit','removeListener'];(function(_0x49beea,_0x47add1){var _0x27693a=function(_0x192ed8){while(--_0x192ed8){_0x49beea['push'](_0x49beea['shift']());}};_0x27693a(++_0x47add1);}(_0xbc48,0x16b));var _0x8bc4=function(_0x541352,_0x29e495){_0x541352=_0x541352-0x0;var _0x27c954=_0xbc48[_0x541352];return _0x27c954;};'use strict';var TeamEvents=require('./team.events');var events=[_0x8bc4('0x0'),_0x8bc4('0x1'),_0x8bc4('0x2')];function createListener(_0x5b0d08,_0x46bbd8){return function(_0x51f087){_0x46bbd8[_0x8bc4('0x3')](_0x5b0d08,_0x51f087);};}function removeListener(_0xdd2942,_0x3271df){return function(){TeamEvents[_0x8bc4('0x4')](_0xdd2942,_0x3271df);};}exports[_0x8bc4('0x5')]=function(_0x20e04c){for(var _0x35ffbf=0x0,_0x2fe686=events[_0x8bc4('0x6')];_0x35ffbf<_0x2fe686;_0x35ffbf++){var _0x2f2372=events[_0x35ffbf];var _0x10c6c2=createListener(_0x8bc4('0x7')+_0x2f2372,_0x20e04c);TeamEvents['on'](_0x2f2372,_0x10c6c2);}}; \ No newline at end of file +var _0xdcf9=['team:','./team.events','save','remove','update','emit','removeListener','register'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0xdcf9,0x101));var _0x9dcf=function(_0xe6c138,_0x4f69f4){_0xe6c138=_0xe6c138-0x0;var _0x3fb496=_0xdcf9[_0xe6c138];return _0x3fb496;};'use strict';var TeamEvents=require(_0x9dcf('0x0'));var events=[_0x9dcf('0x1'),_0x9dcf('0x2'),_0x9dcf('0x3')];function createListener(_0xfa66c4,_0x3d3bdd){return function(_0x1c04ad){_0x3d3bdd[_0x9dcf('0x4')](_0xfa66c4,_0x1c04ad);};}function removeListener(_0x142eda,_0x3a1aaa){return function(){TeamEvents[_0x9dcf('0x5')](_0x142eda,_0x3a1aaa);};}exports[_0x9dcf('0x6')]=function(_0x46b7bb){for(var _0x544404=0x0,_0x4c6588=events['length'];_0x544404<_0x4c6588;_0x544404++){var _0x19567a=events[_0x544404];var _0x16d36d=createListener(_0x9dcf('0x7')+_0x19567a,_0x46b7bb);TeamEvents['on'](_0x19567a,_0x16d36d);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 381da74..4b8cc31 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 _0x10bd=['INTEGER','exports'];(function(_0x54782e,_0x364fe4){var _0x5ce508=function(_0x34caf0){while(--_0x34caf0){_0x54782e['push'](_0x54782e['shift']());}};_0x5ce508(++_0x364fe4);}(_0x10bd,0x97));var _0xd10b=function(_0x138e5b,_0x3864e9){_0x138e5b=_0x138e5b-0x0;var _0x4f4d86=_0x10bd[_0x138e5b];return _0x4f4d86;};'use strict';var Sequelize=require('sequelize');module[_0xd10b('0x0')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xd10b('0x1')]}}; \ No newline at end of file +var _0x8f7d=['exports','INTEGER','sequelize'];(function(_0x51b8d7,_0x2c6d69){var _0x3cc35e=function(_0x493549){while(--_0x493549){_0x51b8d7['push'](_0x51b8d7['shift']());}};_0x3cc35e(++_0x2c6d69);}(_0x8f7d,0xf5));var _0xd8f7=function(_0x524657,_0x424944){_0x524657=_0x524657-0x0;var _0x4c8f35=_0x8f7d[_0x524657];return _0x4c8f35;};'use strict';var Sequelize=require(_0xd8f7('0x0'));module[_0xd8f7('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xd8f7('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 84f64dd..681fa4e 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 _0xdaa8=['api','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','lodash','util','../../config/logger'];(function(_0x593c1b,_0x35c524){var _0x4e0c07=function(_0x8c0aab){while(--_0x8c0aab){_0x593c1b['push'](_0x593c1b['shift']());}};_0x4e0c07(++_0x35c524);}(_0xdaa8,0xe4));var _0x8daa=function(_0x232328,_0x4c3439){_0x232328=_0x232328-0x0;var _0x39c46b=_0xdaa8[_0x232328];return _0x39c46b;};'use strict';var _=require(_0x8daa('0x0'));var util=require(_0x8daa('0x1'));var logger=require(_0x8daa('0x2'))(_0x8daa('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('rimraf');var config=require('../../config/environment');var attributes=require(_0x8daa('0x4'));module[_0x8daa('0x5')]=function(_0x46f753,_0x4d2392){return _0x46f753['define'](_0x8daa('0x6'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0102=['api','moment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','util','../../config/logger'];(function(_0x1a4a06,_0x36a5c2){var _0x49ec08=function(_0x497f24){while(--_0x497f24){_0x1a4a06['push'](_0x1a4a06['shift']());}};_0x49ec08(++_0x36a5c2);}(_0x0102,0x186));var _0x2010=function(_0x173bb9,_0x144a51){_0x173bb9=_0x173bb9-0x0;var _0x370fe0=_0x0102[_0x173bb9];return _0x370fe0;};'use strict';var _=require('lodash');var util=require(_0x2010('0x0'));var logger=require(_0x2010('0x1'))(_0x2010('0x2'));var moment=require(_0x2010('0x3'));var BPromise=require('bluebird');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(_0x2010('0x4'));module[_0x2010('0x5')]=function(_0x130725,_0x304264){return _0x130725['define'](_0x2010('0x6'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index bc64ace..b6ea32e 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x223528,_0x435ddc){var _0x2d20a3=function(_0x40ac21){while(--_0x40ac21){_0x223528['push'](_0x223528['shift']());}};_0x2d20a3(++_0x435ddc);}(_0xedd9,0xfc));var _0x9edd=function(_0x379618,_0xc96b07){_0x379618=_0x379618-0x0;var _0x1dad0b=_0xedd9[_0x379618];return _0x1dad0b;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x58322a,_0x73595b){var _0x13dc6e=function(_0xe85441){while(--_0xe85441){_0x58322a['push'](_0x58322a['shift']());}};_0x13dc6e(++_0x73595b);}(_0x70e0,0x17b));var _0x070e=function(_0x1d6fe4,_0xd042ad){_0x1d6fe4=_0x1d6fe4-0x0;var _0xa56d4a=_0x70e0[_0x1d6fe4];return _0xa56d4a;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 31ef412..32d294a 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 _0xac95=['sequelize','exports','INTEGER'];(function(_0x1f3f4f,_0x2eb964){var _0x1f85ec=function(_0x13189e){while(--_0x13189e){_0x1f3f4f['push'](_0x1f3f4f['shift']());}};_0x1f85ec(++_0x2eb964);}(_0xac95,0xa8));var _0x5ac9=function(_0x21f72a,_0x21e4c5){_0x21f72a=_0x21f72a-0x0;var _0x2f35f4=_0xac95[_0x21f72a];return _0x2f35f4;};'use strict';var Sequelize=require(_0x5ac9('0x0'));module[_0x5ac9('0x1')]={'penalty':{'type':Sequelize[_0x5ac9('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb922=['INTEGER','sequelize','exports'];(function(_0x4d5d91,_0x3b0799){var _0x269da4=function(_0x19a42a){while(--_0x19a42a){_0x4d5d91['push'](_0x4d5d91['shift']());}};_0x269da4(++_0x3b0799);}(_0xb922,0x7c));var _0x2b92=function(_0x5950e7,_0x43a5bb){_0x5950e7=_0x5950e7-0x0;var _0x47494d=_0xb922[_0x5950e7];return _0x47494d;};'use strict';var Sequelize=require(_0x2b92('0x0'));module[_0x2b92('0x1')]={'penalty':{'type':Sequelize[_0x2b92('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 0e38f23..a488491 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 _0x5636=['./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','bluebird','request-promise','path','../../config/environment'];(function(_0x3af806,_0x2b4c0d){var _0x45ff78=function(_0x554fd2){while(--_0x554fd2){_0x3af806['push'](_0x3af806['shift']());}};_0x45ff78(++_0x2b4c0d);}(_0x5636,0x102));var _0x6563=function(_0x23a884,_0x287c95){_0x23a884=_0x23a884-0x0;var _0x2b2a4a=_0x5636[_0x23a884];return _0x2b2a4a;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6563('0x2'));var rp=require(_0x6563('0x3'));var fs=require('fs');var path=require(_0x6563('0x4'));var rimraf=require('rimraf');var config=require(_0x6563('0x5'));var attributes=require(_0x6563('0x6'));module[_0x6563('0x7')]=function(_0x39792f,_0x29f687){return _0x39792f[_0x6563('0x8')](_0x6563('0x9'),attributes,{'tableName':_0x6563('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc73e=['exports','define','team_has_voice_queues','lodash','util','api','moment','rimraf','../../config/environment'];(function(_0x27beea,_0x3bc9f4){var _0x122645=function(_0x2c848){while(--_0x2c848){_0x27beea['push'](_0x27beea['shift']());}};_0x122645(++_0x3bc9f4);}(_0xc73e,0x1e9));var _0xec73=function(_0x50f6f1,_0x3536f6){_0x50f6f1=_0x50f6f1-0x0;var _0x46bb98=_0xc73e[_0x50f6f1];return _0x46bb98;};'use strict';var _=require(_0xec73('0x0'));var util=require(_0xec73('0x1'));var logger=require('../../config/logger')(_0xec73('0x2'));var moment=require(_0xec73('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xec73('0x4'));var config=require(_0xec73('0x5'));var attributes=require('./teamVoiceQueue.attributes');module[_0xec73('0x6')]=function(_0x26598a,_0x3bd154){return _0x26598a[_0xec73('0x7')]('TeamVoiceQueue',attributes,{'tableName':_0xec73('0x8'),'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 6655ce2..d75689a 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 _0x66fa=['../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xc6c40b,_0x460a61){var _0x28ab98=function(_0x1a6b3d){while(--_0x1a6b3d){_0xc6c40b['push'](_0xc6c40b['shift']());}};_0x28ab98(++_0x460a61);}(_0x66fa,0x168));var _0xa66f=function(_0x4b81b7,_0x45b1a0){_0x4b81b7=_0x4b81b7-0x0;var _0x296fbe=_0x66fa[_0x4b81b7];return _0x296fbe;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require(_0xa66f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa66f('0x3'));var db=require(_0xa66f('0x4'))['db'];var utils=require(_0xa66f('0x5'));var logger=require(_0xa66f('0x6'))(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var jayson=require(_0xa66f('0x9'));var client=jayson[_0xa66f('0xa')][_0xa66f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33bd0d,_0x150f73,_0x5b7cf7){return new BPromise(function(_0x1cf624,_0x5ec156){return client[_0xa66f('0xc')](_0x33bd0d,_0x5b7cf7)[_0xa66f('0xd')](function(_0x5ad336){logger[_0xa66f('0xe')](_0xa66f('0xf'),_0x150f73,_0xa66f('0x10'));logger[_0xa66f('0x11')](_0xa66f('0x12'),_0x150f73,_0xa66f('0x10'),JSON['stringify'](_0x5ad336));if(_0x5ad336['error']){if(_0x5ad336[_0xa66f('0x13')]['code']===0x1f4){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x150f73,_0x5ad336[_0xa66f('0x13')]['message']);return _0x5ec156(_0x5ad336[_0xa66f('0x13')][_0xa66f('0x14')]);}logger['error'](_0xa66f('0xf'),_0x150f73,_0x5ad336[_0xa66f('0x13')][_0xa66f('0x14')]);return _0x1cf624(_0x5ad336[_0xa66f('0x13')]['message']);}else{logger[_0xa66f('0xe')](_0xa66f('0xf'),_0x150f73,'request\x20sent');_0x1cf624(_0x5ad336[_0xa66f('0x15')][_0xa66f('0x14')]);}})[_0xa66f('0x16')](function(_0x76af81){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x150f73,_0x76af81);_0x5ec156(_0x76af81);});});} \ No newline at end of file +var _0x876c=['then','request\x20sent','debug','stringify','error','TeamVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x47c838,_0x1d79ec){var _0x3279ad=function(_0x4867db){while(--_0x4867db){_0x47c838['push'](_0x47c838['shift']());}};_0x3279ad(++_0x1d79ec);}(_0x876c,0x12f));var _0xc876=function(_0x41fe2d,_0x1d758c){_0x41fe2d=_0x41fe2d-0x0;var _0x1c3b86=_0x876c[_0x41fe2d];return _0x1c3b86;};'use strict';var _=require(_0xc876('0x0'));var util=require(_0xc876('0x1'));var moment=require(_0xc876('0x2'));var BPromise=require(_0xc876('0x3'));var rs=require(_0xc876('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc876('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc876('0x6'))(_0xc876('0x7'));var config=require(_0xc876('0x8'));var jayson=require(_0xc876('0x9'));var client=jayson[_0xc876('0xa')][_0xc876('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x195e3e,_0x3f6d9e,_0x2b3e09){return new BPromise(function(_0x5c0c6a,_0x5a823b){return client['request'](_0x195e3e,_0x2b3e09)[_0xc876('0xc')](function(_0x2a65cc){logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x3f6d9e,_0xc876('0xd'));logger[_0xc876('0xe')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x3f6d9e,_0xc876('0xd'),JSON[_0xc876('0xf')](_0x2a65cc));if(_0x2a65cc[_0xc876('0x10')]){if(_0x2a65cc['error']['code']===0x1f4){logger[_0xc876('0x10')](_0xc876('0x11'),_0x3f6d9e,_0x2a65cc['error']['message']);return _0x5a823b(_0x2a65cc[_0xc876('0x10')][_0xc876('0x12')]);}logger['error'](_0xc876('0x11'),_0x3f6d9e,_0x2a65cc['error'][_0xc876('0x12')]);return _0x5c0c6a(_0x2a65cc[_0xc876('0x10')][_0xc876('0x12')]);}else{logger['info'](_0xc876('0x11'),_0x3f6d9e,_0xc876('0xd'));_0x5c0c6a(_0x2a65cc[_0xc876('0x13')][_0xc876('0x12')]);}})[_0xc876('0x14')](function(_0x51e40f){logger['error'](_0xc876('0x11'),_0x3f6d9e,_0x51e40f);_0x5a823b(_0x51e40f);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 1ccd497..899ea52 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 _0xfef9=['../../components/interaction/service','./template.controller','get','index','isAuthenticated','show','post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x332193,_0x1070b1){var _0x418cc8=function(_0x118768){while(--_0x118768){_0x332193['push'](_0x332193['shift']());}};_0x418cc8(++_0x1070b1);}(_0xfef9,0xd3));var _0x9fef=function(_0x1f44e4,_0x22d9fd){_0x1f44e4=_0x1f44e4-0x0;var _0x591989=_0xfef9[_0x1f44e4];return _0x591989;};'use strict';var multer=require(_0x9fef('0x0'));var util=require(_0x9fef('0x1'));var path=require('path');var timeout=require(_0x9fef('0x2'));var express=require(_0x9fef('0x3'));var router=express['Router']();var fs_extra=require(_0x9fef('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9fef('0x5'));var config=require('../../config/environment');var controller=require(_0x9fef('0x6'));router[_0x9fef('0x7')]('/',auth['isAuthenticated'](),controller[_0x9fef('0x8')]);router[_0x9fef('0x7')]('/:id',auth[_0x9fef('0x9')](),controller[_0x9fef('0xa')]);router[_0x9fef('0xb')]('/',auth['isAuthenticated'](),controller[_0x9fef('0xc')]);router[_0x9fef('0xd')](_0x9fef('0xe'),auth['isAuthenticated'](),controller[_0x9fef('0xf')]);router['delete'](_0x9fef('0xe'),auth[_0x9fef('0x9')](),controller[_0x9fef('0x10')]);module[_0x9fef('0x11')]=router; \ No newline at end of file +var _0x5464=['get','/:id','isAuthenticated','show','post','create','put','delete','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./template.controller'];(function(_0x12d6cc,_0x155c63){var _0x4af7d3=function(_0x3d4c5a){while(--_0x3d4c5a){_0x12d6cc['push'](_0x12d6cc['shift']());}};_0x4af7d3(++_0x155c63);}(_0x5464,0x15d));var _0x4546=function(_0x2d294f,_0x4a142a){_0x2d294f=_0x2d294f-0x0;var _0x1dce43=_0x5464[_0x2d294f];return _0x1dce43;};'use strict';var multer=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var path=require(_0x4546('0x2'));var timeout=require('connect-timeout');var express=require(_0x4546('0x3'));var router=express['Router']();var fs_extra=require(_0x4546('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4546('0x5'));var config=require(_0x4546('0x6'));var controller=require(_0x4546('0x7'));router[_0x4546('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4546('0x9'),auth[_0x4546('0xa')](),controller[_0x4546('0xb')]);router[_0x4546('0xc')]('/',auth[_0x4546('0xa')](),controller[_0x4546('0xd')]);router[_0x4546('0xe')](_0x4546('0x9'),auth[_0x4546('0xa')](),controller['update']);router[_0x4546('0xf')](_0x4546('0x9'),auth[_0x4546('0xa')](),controller['destroy']);module[_0x4546('0x10')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 70e0a8e..5980c63 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 _0x0cb7=['exports','STRING','TEXT','sequelize'];(function(_0x5d4f12,_0x11e67c){var _0x4eb577=function(_0x4d7a2d){while(--_0x4d7a2d){_0x5d4f12['push'](_0x5d4f12['shift']());}};_0x4eb577(++_0x11e67c);}(_0x0cb7,0x1b3));var _0x70cb=function(_0x333965,_0x16e0f5){_0x333965=_0x333965-0x0;var _0x50290e=_0x0cb7[_0x333965];return _0x50290e;};'use strict';var Sequelize=require(_0x70cb('0x0'));module[_0x70cb('0x1')]={'name':{'type':Sequelize[_0x70cb('0x2')]},'description':{'type':Sequelize[_0x70cb('0x2')]},'html':{'type':Sequelize[_0x70cb('0x3')]}}; \ No newline at end of file +var _0x4310=['STRING','TEXT','sequelize','exports'];(function(_0x571eb2,_0x597ac4){var _0x59249a=function(_0x3552bd){while(--_0x3552bd){_0x571eb2['push'](_0x571eb2['shift']());}};_0x59249a(++_0x597ac4);}(_0x4310,0x112));var _0x0431=function(_0x40b66c,_0x578758){_0x40b66c=_0x40b66c-0x0;var _0x2fd22b=_0x4310[_0x40b66c];return _0x2fd22b;};'use strict';var Sequelize=require(_0x0431('0x0'));module[_0x0431('0x1')]={'name':{'type':Sequelize[_0x0431('0x2')]},'description':{'type':Sequelize[_0x0431('0x2')]},'html':{'type':Sequelize[_0x0431('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 2933e78..a9a5271 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 _0x5ea5=['attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','options','count','includeAll','include','findAll','catch','show','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Templates','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','get','destroy','error','name','send','index','Template','rawAttributes','fieldName','key','model','map','query','keys','intersection'];(function(_0x2498a4,_0x119be2){var _0xd2aa2b=function(_0xbac0b3){while(--_0xbac0b3){_0x2498a4['push'](_0x2498a4['shift']());}};_0xd2aa2b(++_0x119be2);}(_0x5ea5,0x1ef));var _0x55ea=function(_0xb7a459,_0xc13228){_0xb7a459=_0xb7a459-0x0;var _0x104ab5=_0x5ea5[_0xb7a459];return _0x104ab5;};'use strict';var emlformat=require(_0x55ea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x55ea('0x1'));var jsonpatch=require(_0x55ea('0x2'));var rp=require(_0x55ea('0x3'));var moment=require(_0x55ea('0x4'));var BPromise=require(_0x55ea('0x5'));var Mustache=require(_0x55ea('0x6'));var util=require('util');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(_0x55ea('0x7'));var squel=require('squel');var crypto=require(_0x55ea('0x8'));var jsforce=require(_0x55ea('0x9'));var deskjs=require(_0x55ea('0xa'));var toCsv=require(_0x55ea('0xb'));var querystring=require(_0x55ea('0xc'));var Papa=require(_0x55ea('0xd'));var Redis=require(_0x55ea('0xe'));var authService=require(_0x55ea('0xf'));var qs=require(_0x55ea('0x10'));var as=require(_0x55ea('0x11'));var hardwareService=require(_0x55ea('0x12'));var logger=require(_0x55ea('0x13'))(_0x55ea('0x14'));var utils=require('../../config/utils');var config=require(_0x55ea('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x55ea('0x16'))['db'];function respondWithStatusCode(_0xee2ef3,_0x4ec88b){_0x4ec88b=_0x4ec88b||0xcc;return function(_0x203484){if(_0x203484){return _0xee2ef3[_0x55ea('0x17')](_0x4ec88b);}return _0xee2ef3[_0x55ea('0x18')](_0x4ec88b)[_0x55ea('0x19')]();};}function respondWithResult(_0x165633,_0x33655d){_0x33655d=_0x33655d||0xc8;return function(_0x4c5545){if(_0x4c5545){return _0x165633[_0x55ea('0x18')](_0x33655d)[_0x55ea('0x1a')](_0x4c5545);}};}function respondWithFilteredResult(_0x67dc03,_0x552876){return function(_0x1ed55c){if(_0x1ed55c){var _0x3b48be=typeof _0x552876[_0x55ea('0x1b')]===_0x55ea('0x1c')&&typeof _0x552876[_0x55ea('0x1d')]===_0x55ea('0x1c');var _0x840c6=_0x1ed55c['count'];var _0x3a0491=_0x3b48be?0x0:_0x552876[_0x55ea('0x1b')];var _0x215ecf=_0x3b48be?_0x1ed55c['count']:_0x552876['offset']+_0x552876[_0x55ea('0x1d')];var _0x2c789b;if(_0x215ecf>=_0x840c6){_0x215ecf=_0x840c6;_0x2c789b=0xc8;}else{_0x2c789b=0xce;}_0x67dc03[_0x55ea('0x18')](_0x2c789b);return _0x67dc03['set'](_0x55ea('0x1e'),_0x3a0491+'-'+_0x215ecf+'/'+_0x840c6)['json'](_0x1ed55c);}return null;};}function patchUpdates(_0xe9329e){return function(_0x1bb507){try{jsonpatch[_0x55ea('0x1f')](_0x1bb507,_0xe9329e,!![]);}catch(_0x2add79){return BPromise[_0x55ea('0x20')](_0x2add79);}return _0x1bb507[_0x55ea('0x21')]();};}function saveUpdates(_0x5abe31,_0x4627a2){return function(_0x244e2b){if(_0x244e2b){return _0x244e2b[_0x55ea('0x22')](_0x5abe31)[_0x55ea('0x23')](function(_0x233d3e){return _0x233d3e;});}return null;};}function removeEntity(_0x2a0d08,_0x287189){return function(_0x40b199){if(_0x40b199){return _0x40b199['destroy']()[_0x55ea('0x23')](function(){var _0x561c24=_0x40b199[_0x55ea('0x24')]({'plain':!![]});var _0x253771='Templates';return db['UserProfileResource'][_0x55ea('0x25')]({'where':{'type':_0x253771,'resourceId':_0x561c24['id']}})[_0x55ea('0x23')](function(){return _0x40b199;});})['then'](function(){_0x2a0d08[_0x55ea('0x18')](0xcc)[_0x55ea('0x19')]();});}};}function handleEntityNotFound(_0x3d6a9f,_0x1cc053){return function(_0x8e5575){if(!_0x8e5575){_0x3d6a9f[_0x55ea('0x17')](0x194);}return _0x8e5575;};}function handleError(_0x318efe,_0x50ba42){_0x50ba42=_0x50ba42||0x1f4;return function(_0x55a49a){logger[_0x55ea('0x26')](_0x55a49a['stack']);if(_0x55a49a[_0x55ea('0x27')]){delete _0x55a49a[_0x55ea('0x27')];}_0x318efe[_0x55ea('0x18')](_0x50ba42)[_0x55ea('0x28')](_0x55a49a);};}exports[_0x55ea('0x29')]=function(_0x1805ba,_0x32ef97){var _0x7ab0e6={},_0x41530c={},_0x5eda45={'count':0x0,'rows':[]};var _0xbe23d2=_['map'](db[_0x55ea('0x2a')][_0x55ea('0x2b')],function(_0x3ea507){return{'name':_0x3ea507[_0x55ea('0x2c')],'type':_0x3ea507['type'][_0x55ea('0x2d')]};});_0x41530c[_0x55ea('0x2e')]=_[_0x55ea('0x2f')](_0xbe23d2,_0x55ea('0x27'));_0x41530c[_0x55ea('0x30')]=_[_0x55ea('0x31')](_0x1805ba[_0x55ea('0x30')]);_0x41530c['filters']=_[_0x55ea('0x32')](_0x41530c['model'],_0x41530c[_0x55ea('0x30')]);_0x7ab0e6[_0x55ea('0x33')]=_[_0x55ea('0x32')](_0x41530c[_0x55ea('0x2e')],qs[_0x55ea('0x34')](_0x1805ba[_0x55ea('0x30')][_0x55ea('0x34')]));_0x7ab0e6[_0x55ea('0x33')]=_0x7ab0e6[_0x55ea('0x33')]['length']?_0x7ab0e6[_0x55ea('0x33')]:_0x41530c[_0x55ea('0x2e')];if(!_0x1805ba[_0x55ea('0x30')][_0x55ea('0x35')]('nolimit')){_0x7ab0e6[_0x55ea('0x1d')]=qs[_0x55ea('0x1d')](_0x1805ba[_0x55ea('0x30')][_0x55ea('0x1d')]);_0x7ab0e6['offset']=qs[_0x55ea('0x1b')](_0x1805ba[_0x55ea('0x30')]['offset']);}_0x7ab0e6[_0x55ea('0x36')]=qs[_0x55ea('0x37')](_0x1805ba[_0x55ea('0x30')][_0x55ea('0x37')]);_0x7ab0e6[_0x55ea('0x38')]=qs[_0x55ea('0x39')](_['pick'](_0x1805ba[_0x55ea('0x30')],_0x41530c[_0x55ea('0x39')]),_0xbe23d2);if(_0x1805ba['query'][_0x55ea('0x3a')]){_0x7ab0e6[_0x55ea('0x38')]=_['merge'](_0x7ab0e6[_0x55ea('0x38')],{'$or':_['map'](_0xbe23d2,function(_0x471a10){if(_0x471a10['type']!=='VIRTUAL'){var _0x5f5130={};_0x5f5130[_0x471a10[_0x55ea('0x27')]]={'$like':'%'+_0x1805ba[_0x55ea('0x30')][_0x55ea('0x3a')]+'%'};return _0x5f5130;}})});}_0x7ab0e6=_[_0x55ea('0x3b')]({},_0x7ab0e6,_0x1805ba[_0x55ea('0x3c')]);var _0x21d310={'where':_0x7ab0e6[_0x55ea('0x38')]};return db[_0x55ea('0x2a')][_0x55ea('0x3d')](_0x21d310)[_0x55ea('0x23')](function(_0xa3fabf){_0x5eda45[_0x55ea('0x3d')]=_0xa3fabf;if(_0x1805ba['query'][_0x55ea('0x3e')]){_0x7ab0e6[_0x55ea('0x3f')]=[{'all':!![]}];}return db['Template'][_0x55ea('0x40')](_0x7ab0e6);})['then'](function(_0x5869e4){_0x5eda45['rows']=_0x5869e4;return _0x5eda45;})[_0x55ea('0x23')](respondWithFilteredResult(_0x32ef97,_0x7ab0e6))[_0x55ea('0x41')](handleError(_0x32ef97,null));};exports[_0x55ea('0x42')]=function(_0x24a937,_0x59d841){var _0x17d2ad={'raw':!![],'where':{'id':_0x24a937['params']['id']}},_0x578af0={};_0x578af0[_0x55ea('0x2e')]=_[_0x55ea('0x31')](db['Template']['rawAttributes']);_0x578af0[_0x55ea('0x30')]=_[_0x55ea('0x31')](_0x24a937[_0x55ea('0x30')]);_0x578af0['filters']=_['intersection'](_0x578af0[_0x55ea('0x2e')],_0x578af0[_0x55ea('0x30')]);_0x17d2ad[_0x55ea('0x33')]=_[_0x55ea('0x32')](_0x578af0[_0x55ea('0x2e')],qs[_0x55ea('0x34')](_0x24a937[_0x55ea('0x30')][_0x55ea('0x34')]));_0x17d2ad['attributes']=_0x17d2ad[_0x55ea('0x33')]['length']?_0x17d2ad[_0x55ea('0x33')]:_0x578af0['model'];if(_0x24a937[_0x55ea('0x30')]['includeAll']){_0x17d2ad['include']=[{'all':!![]}];}_0x17d2ad=_[_0x55ea('0x3b')]({},_0x17d2ad,_0x24a937[_0x55ea('0x3c')]);return db['Template']['find'](_0x17d2ad)[_0x55ea('0x23')](handleEntityNotFound(_0x59d841,null))[_0x55ea('0x23')](respondWithResult(_0x59d841,null))[_0x55ea('0x41')](handleError(_0x59d841,null));};exports['create']=function(_0x5b00ae,_0x5daaf1){return db['Template']['create'](_0x5b00ae[_0x55ea('0x43')],{})[_0x55ea('0x23')](function(_0x494f80){var _0x45b5ac=_0x5b00ae['user']['get']({'plain':!![]});if(!_0x45b5ac)throw new Error(_0x55ea('0x44'));if(_0x45b5ac[_0x55ea('0x45')]===_0x55ea('0x46')){var _0x33a56a=_0x494f80[_0x55ea('0x24')]({'plain':!![]});var _0x2afb63=_0x55ea('0x47');return db[_0x55ea('0x48')]['find']({'where':{'name':_0x2afb63,'userProfileId':_0x45b5ac[_0x55ea('0x49')]},'raw':!![]})[_0x55ea('0x23')](function(_0x1be59b){if(_0x1be59b&&_0x1be59b[_0x55ea('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x33a56a[_0x55ea('0x27')],'resourceId':_0x33a56a['id'],'type':_0x1be59b[_0x55ea('0x27')],'sectionId':_0x1be59b['id']},{})[_0x55ea('0x23')](function(){return _0x494f80;});}else{return _0x494f80;}})['catch'](function(_0x326ad8){logger[_0x55ea('0x26')](_0x55ea('0x4b'),_0x326ad8);throw _0x326ad8;});}return _0x494f80;})[_0x55ea('0x23')](respondWithResult(_0x5daaf1,0xc9))[_0x55ea('0x41')](handleError(_0x5daaf1,null));};exports[_0x55ea('0x22')]=function(_0x408760,_0x13bf03){if(_0x408760[_0x55ea('0x43')]['id']){delete _0x408760['body']['id'];}return db[_0x55ea('0x2a')][_0x55ea('0x4c')]({'where':{'id':_0x408760[_0x55ea('0x4d')]['id']}})[_0x55ea('0x23')](handleEntityNotFound(_0x13bf03,null))[_0x55ea('0x23')](saveUpdates(_0x408760[_0x55ea('0x43')],null))[_0x55ea('0x23')](respondWithResult(_0x13bf03,null))[_0x55ea('0x41')](handleError(_0x13bf03,null));};exports[_0x55ea('0x25')]=function(_0x50706c,_0x6e2bc9){return db[_0x55ea('0x2a')][_0x55ea('0x4c')]({'where':{'id':_0x50706c[_0x55ea('0x4d')]['id']}})[_0x55ea('0x23')](handleEntityNotFound(_0x6e2bc9,null))['then'](removeEntity(_0x6e2bc9,null))[_0x55ea('0x41')](handleError(_0x6e2bc9,null));}; \ No newline at end of file +var _0x0133=['offset','undefined','limit','count','set','apply','save','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','index','map','Template','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json'];(function(_0x4ec313,_0x2b8639){var _0x57e679=function(_0x20fbef){while(--_0x20fbef){_0x4ec313['push'](_0x4ec313['shift']());}};_0x57e679(++_0x2b8639);}(_0x0133,0x1cb));var _0x3013=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0133[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0x3013('0x0'));var rimraf=require(_0x3013('0x1'));var zipdir=require(_0x3013('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3013('0x3'));var BPromise=require(_0x3013('0x4'));var Mustache=require('mustache');var util=require(_0x3013('0x5'));var path=require('path');var sox=require(_0x3013('0x6'));var csv=require(_0x3013('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3013('0x8'));var _=require(_0x3013('0x9'));var squel=require(_0x3013('0xa'));var crypto=require(_0x3013('0xb'));var jsforce=require(_0x3013('0xc'));var deskjs=require(_0x3013('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3013('0xe'));var Papa=require(_0x3013('0xf'));var Redis=require(_0x3013('0x10'));var authService=require(_0x3013('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3013('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3013('0x13'))(_0x3013('0x14'));var utils=require('../../config/utils');var config=require(_0x3013('0x15'));var licenseUtil=require(_0x3013('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44236d,_0x2ea3f5){_0x2ea3f5=_0x2ea3f5||0xcc;return function(_0x594ff9){if(_0x594ff9){return _0x44236d[_0x3013('0x17')](_0x2ea3f5);}return _0x44236d['status'](_0x2ea3f5)[_0x3013('0x18')]();};}function respondWithResult(_0xac4680,_0x3d5c2d){_0x3d5c2d=_0x3d5c2d||0xc8;return function(_0x418988){if(_0x418988){return _0xac4680[_0x3013('0x19')](_0x3d5c2d)[_0x3013('0x1a')](_0x418988);}};}function respondWithFilteredResult(_0x4b6483,_0x4347dd){return function(_0x3987c9){if(_0x3987c9){var _0x596a0f=typeof _0x4347dd[_0x3013('0x1b')]===_0x3013('0x1c')&&typeof _0x4347dd[_0x3013('0x1d')]===_0x3013('0x1c');var _0x4ac4ae=_0x3987c9[_0x3013('0x1e')];var _0x5b9fac=_0x596a0f?0x0:_0x4347dd[_0x3013('0x1b')];var _0x169a06=_0x596a0f?_0x3987c9[_0x3013('0x1e')]:_0x4347dd[_0x3013('0x1b')]+_0x4347dd[_0x3013('0x1d')];var _0x18fa4b;if(_0x169a06>=_0x4ac4ae){_0x169a06=_0x4ac4ae;_0x18fa4b=0xc8;}else{_0x18fa4b=0xce;}_0x4b6483['status'](_0x18fa4b);return _0x4b6483[_0x3013('0x1f')]('Content-Range',_0x5b9fac+'-'+_0x169a06+'/'+_0x4ac4ae)['json'](_0x3987c9);}return null;};}function patchUpdates(_0x47ea3f){return function(_0xaae437){try{jsonpatch[_0x3013('0x20')](_0xaae437,_0x47ea3f,!![]);}catch(_0x156b70){return BPromise['reject'](_0x156b70);}return _0xaae437[_0x3013('0x21')]();};}function saveUpdates(_0x33423c,_0x145310){return function(_0x5c6665){if(_0x5c6665){return _0x5c6665[_0x3013('0x22')](_0x33423c)[_0x3013('0x23')](function(_0x1eb34d){return _0x1eb34d;});}return null;};}function removeEntity(_0x3b4e9c,_0x9a6b21){return function(_0x38e0ee){if(_0x38e0ee){return _0x38e0ee[_0x3013('0x24')]()[_0x3013('0x23')](function(){var _0x1fbadd=_0x38e0ee[_0x3013('0x25')]({'plain':!![]});var _0x4ca4aa=_0x3013('0x26');return db[_0x3013('0x27')][_0x3013('0x24')]({'where':{'type':_0x4ca4aa,'resourceId':_0x1fbadd['id']}})['then'](function(){return _0x38e0ee;});})[_0x3013('0x23')](function(){_0x3b4e9c[_0x3013('0x19')](0xcc)[_0x3013('0x18')]();});}};}function handleEntityNotFound(_0x54e07f,_0x314370){return function(_0x240ad4){if(!_0x240ad4){_0x54e07f[_0x3013('0x17')](0x194);}return _0x240ad4;};}function handleError(_0x4d820d,_0xf74a55){_0xf74a55=_0xf74a55||0x1f4;return function(_0x16c950){logger[_0x3013('0x28')](_0x16c950[_0x3013('0x29')]);if(_0x16c950[_0x3013('0x2a')]){delete _0x16c950[_0x3013('0x2a')];}_0x4d820d['status'](_0xf74a55)[_0x3013('0x2b')](_0x16c950);};}exports[_0x3013('0x2c')]=function(_0x5d116f,_0x37e74f){var _0x1f704d={},_0x351deb={},_0x31b5ee={'count':0x0,'rows':[]};var _0x361438=_[_0x3013('0x2d')](db[_0x3013('0x2e')]['rawAttributes'],function(_0x12e60b){return{'name':_0x12e60b['fieldName'],'type':_0x12e60b[_0x3013('0x2f')][_0x3013('0x30')]};});_0x351deb['model']=_['map'](_0x361438,_0x3013('0x2a'));_0x351deb['query']=_['keys'](_0x5d116f[_0x3013('0x31')]);_0x351deb['filters']=_[_0x3013('0x32')](_0x351deb['model'],_0x351deb[_0x3013('0x31')]);_0x1f704d['attributes']=_[_0x3013('0x32')](_0x351deb[_0x3013('0x33')],qs[_0x3013('0x34')](_0x5d116f['query']['fields']));_0x1f704d[_0x3013('0x35')]=_0x1f704d[_0x3013('0x35')][_0x3013('0x36')]?_0x1f704d['attributes']:_0x351deb['model'];if(!_0x5d116f['query'][_0x3013('0x37')](_0x3013('0x38'))){_0x1f704d[_0x3013('0x1d')]=qs['limit'](_0x5d116f['query']['limit']);_0x1f704d[_0x3013('0x1b')]=qs[_0x3013('0x1b')](_0x5d116f[_0x3013('0x31')][_0x3013('0x1b')]);}_0x1f704d[_0x3013('0x39')]=qs[_0x3013('0x3a')](_0x5d116f['query'][_0x3013('0x3a')]);_0x1f704d[_0x3013('0x3b')]=qs[_0x3013('0x3c')](_['pick'](_0x5d116f[_0x3013('0x31')],_0x351deb[_0x3013('0x3c')]),_0x361438);if(_0x5d116f[_0x3013('0x31')][_0x3013('0x3d')]){_0x1f704d[_0x3013('0x3b')]=_[_0x3013('0x3e')](_0x1f704d[_0x3013('0x3b')],{'$or':_[_0x3013('0x2d')](_0x361438,function(_0x103968){if(_0x103968[_0x3013('0x2f')]!==_0x3013('0x3f')){var _0x49b74b={};_0x49b74b[_0x103968[_0x3013('0x2a')]]={'$like':'%'+_0x5d116f['query'][_0x3013('0x3d')]+'%'};return _0x49b74b;}})});}_0x1f704d=_['merge']({},_0x1f704d,_0x5d116f[_0x3013('0x40')]);var _0x3e29a3={'where':_0x1f704d[_0x3013('0x3b')]};return db[_0x3013('0x2e')][_0x3013('0x1e')](_0x3e29a3)[_0x3013('0x23')](function(_0x3641b4){_0x31b5ee[_0x3013('0x1e')]=_0x3641b4;if(_0x5d116f[_0x3013('0x31')][_0x3013('0x41')]){_0x1f704d[_0x3013('0x42')]=[{'all':!![]}];}return db[_0x3013('0x2e')][_0x3013('0x43')](_0x1f704d);})[_0x3013('0x23')](function(_0x500b4c){_0x31b5ee[_0x3013('0x44')]=_0x500b4c;return _0x31b5ee;})['then'](respondWithFilteredResult(_0x37e74f,_0x1f704d))[_0x3013('0x45')](handleError(_0x37e74f,null));};exports['show']=function(_0x404a0c,_0x47c483){var _0x10d98c={'raw':!![],'where':{'id':_0x404a0c[_0x3013('0x46')]['id']}},_0x374a35={};_0x374a35[_0x3013('0x33')]=_[_0x3013('0x47')](db[_0x3013('0x2e')][_0x3013('0x48')]);_0x374a35[_0x3013('0x31')]=_[_0x3013('0x47')](_0x404a0c['query']);_0x374a35[_0x3013('0x3c')]=_[_0x3013('0x32')](_0x374a35[_0x3013('0x33')],_0x374a35[_0x3013('0x31')]);_0x10d98c[_0x3013('0x35')]=_[_0x3013('0x32')](_0x374a35[_0x3013('0x33')],qs[_0x3013('0x34')](_0x404a0c[_0x3013('0x31')][_0x3013('0x34')]));_0x10d98c[_0x3013('0x35')]=_0x10d98c[_0x3013('0x35')][_0x3013('0x36')]?_0x10d98c[_0x3013('0x35')]:_0x374a35['model'];if(_0x404a0c['query'][_0x3013('0x41')]){_0x10d98c[_0x3013('0x42')]=[{'all':!![]}];}_0x10d98c=_[_0x3013('0x3e')]({},_0x10d98c,_0x404a0c[_0x3013('0x40')]);return db[_0x3013('0x2e')][_0x3013('0x49')](_0x10d98c)[_0x3013('0x23')](handleEntityNotFound(_0x47c483,null))['then'](respondWithResult(_0x47c483,null))[_0x3013('0x45')](handleError(_0x47c483,null));};exports[_0x3013('0x4a')]=function(_0x521787,_0x4801ed){return db[_0x3013('0x2e')][_0x3013('0x4a')](_0x521787[_0x3013('0x4b')],{})['then'](function(_0x4e6cb4){var _0x1104a8=_0x521787[_0x3013('0x4c')][_0x3013('0x25')]({'plain':!![]});if(!_0x1104a8)throw new Error(_0x3013('0x4d'));if(_0x1104a8[_0x3013('0x4e')]==='user'){var _0x3b06f9=_0x4e6cb4[_0x3013('0x25')]({'plain':!![]});var _0x3c4dfc=_0x3013('0x26');return db['UserProfileSection'][_0x3013('0x49')]({'where':{'name':_0x3c4dfc,'userProfileId':_0x1104a8[_0x3013('0x4f')]},'raw':!![]})[_0x3013('0x23')](function(_0x3fdfd3){if(_0x3fdfd3&&_0x3fdfd3[_0x3013('0x50')]===0x0){return db[_0x3013('0x27')][_0x3013('0x4a')]({'name':_0x3b06f9[_0x3013('0x2a')],'resourceId':_0x3b06f9['id'],'type':_0x3fdfd3[_0x3013('0x2a')],'sectionId':_0x3fdfd3['id']},{})[_0x3013('0x23')](function(){return _0x4e6cb4;});}else{return _0x4e6cb4;}})[_0x3013('0x45')](function(_0x14429e){logger[_0x3013('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14429e);throw _0x14429e;});}return _0x4e6cb4;})[_0x3013('0x23')](respondWithResult(_0x4801ed,0xc9))[_0x3013('0x45')](handleError(_0x4801ed,null));};exports[_0x3013('0x22')]=function(_0x422ea4,_0x3844b0){if(_0x422ea4[_0x3013('0x4b')]['id']){delete _0x422ea4['body']['id'];}return db['Template'][_0x3013('0x49')]({'where':{'id':_0x422ea4[_0x3013('0x46')]['id']}})[_0x3013('0x23')](handleEntityNotFound(_0x3844b0,null))[_0x3013('0x23')](saveUpdates(_0x422ea4[_0x3013('0x4b')],null))[_0x3013('0x23')](respondWithResult(_0x3844b0,null))['catch'](handleError(_0x3844b0,null));};exports[_0x3013('0x24')]=function(_0x1e0156,_0x304d65){return db['Template'][_0x3013('0x49')]({'where':{'id':_0x1e0156['params']['id']}})[_0x3013('0x23')](handleEntityNotFound(_0x304d65,null))[_0x3013('0x23')](removeEntity(_0x304d65,null))['catch'](handleError(_0x304d65,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 53e324c..6ab93d4 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 _0x1895=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','define','lodash','util'];(function(_0x257289,_0x290d05){var _0x2f76f7=function(_0x1d4bad){while(--_0x1d4bad){_0x257289['push'](_0x257289['shift']());}};_0x2f76f7(++_0x290d05);}(_0x1895,0x198));var _0x5189=function(_0x344660,_0x1afb71){_0x344660=_0x344660-0x0;var _0x3a52de=_0x1895[_0x344660];return _0x3a52de;};'use strict';var _=require(_0x5189('0x0'));var util=require(_0x5189('0x1'));var logger=require(_0x5189('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5189('0x3'));var rp=require(_0x5189('0x4'));var fs=require('fs');var path=require(_0x5189('0x5'));var rimraf=require(_0x5189('0x6'));var config=require(_0x5189('0x7'));var attributes=require(_0x5189('0x8'));module['exports']=function(_0x4c4821,_0x5d0f9d){return _0x4c4821[_0x5189('0x9')]('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7580=['path','rimraf','./template.attributes','define','tools_templates','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3de3f3,_0x22704d){var _0x455541=function(_0x55878d){while(--_0x55878d){_0x3de3f3['push'](_0x3de3f3['shift']());}};_0x455541(++_0x22704d);}(_0x7580,0x94));var _0x0758=function(_0x659c20,_0x3df818){_0x659c20=_0x659c20-0x0;var _0x1bbb92=_0x7580[_0x659c20];return _0x1bbb92;};'use strict';var _=require(_0x0758('0x0'));var util=require(_0x0758('0x1'));var logger=require('../../config/logger')(_0x0758('0x2'));var moment=require(_0x0758('0x3'));var BPromise=require(_0x0758('0x4'));var rp=require(_0x0758('0x5'));var fs=require('fs');var path=require(_0x0758('0x6'));var rimraf=require(_0x0758('0x7'));var config=require('../../config/environment');var attributes=require(_0x0758('0x8'));module['exports']=function(_0x574b1c,_0x5b2e94){return _0x574b1c[_0x0758('0x9')]('Template',attributes,{'tableName':_0x0758('0xa'),'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 dfbadf5..9e3aaef 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 _0x7b9b=['http','request','then','info','Template,\x20%s,\x20%s','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x5ead88,_0x126fee){var _0x549603=function(_0x2b85cc){while(--_0x2b85cc){_0x5ead88['push'](_0x5ead88['shift']());}};_0x549603(++_0x126fee);}(_0x7b9b,0x97));var _0xb7b9=function(_0x4c2a73,_0x2835cd){_0x4c2a73=_0x4c2a73-0x0;var _0x121267=_0x7b9b[_0x4c2a73];return _0x121267;};'use strict';var _=require('lodash');var util=require(_0xb7b9('0x0'));var moment=require('moment');var BPromise=require(_0xb7b9('0x1'));var rs=require(_0xb7b9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7b9('0x3'))['db'];var utils=require(_0xb7b9('0x4'));var logger=require(_0xb7b9('0x5'))('rpc');var config=require(_0xb7b9('0x6'));var jayson=require(_0xb7b9('0x7'));var client=jayson[_0xb7b9('0x8')][_0xb7b9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37679d,_0x169110,_0x37146e){return new BPromise(function(_0x3e8eae,_0x3a1a56){return client[_0xb7b9('0xa')](_0x37679d,_0x37146e)[_0xb7b9('0xb')](function(_0x3413de){logger[_0xb7b9('0xc')](_0xb7b9('0xd'),_0x169110,'request\x20sent');logger['debug'](_0xb7b9('0xe'),_0x169110,_0xb7b9('0xf'),JSON['stringify'](_0x3413de));if(_0x3413de[_0xb7b9('0x10')]){if(_0x3413de[_0xb7b9('0x10')][_0xb7b9('0x11')]===0x1f4){logger[_0xb7b9('0x10')](_0xb7b9('0xd'),_0x169110,_0x3413de['error'][_0xb7b9('0x12')]);return _0x3a1a56(_0x3413de['error'][_0xb7b9('0x12')]);}logger['error'](_0xb7b9('0xd'),_0x169110,_0x3413de['error']['message']);return _0x3e8eae(_0x3413de[_0xb7b9('0x10')][_0xb7b9('0x12')]);}else{logger[_0xb7b9('0xc')](_0xb7b9('0xd'),_0x169110,'request\x20sent');_0x3e8eae(_0x3413de[_0xb7b9('0x13')]['message']);}})['catch'](function(_0x347cf5){logger[_0xb7b9('0x10')]('Template,\x20%s,\x20%s',_0x169110,_0x347cf5);_0x3a1a56(_0x347cf5);});});}exports[_0xb7b9('0x14')]=function(_0xcde679){var _0x1def6b=this;return new Promise(function(_0x3da58e,_0x1b9dad){return db[_0xb7b9('0x15')][_0xb7b9('0x16')]({'raw':_0xcde679[_0xb7b9('0x17')]?_0xcde679[_0xb7b9('0x17')][_0xb7b9('0x18')]===undefined?!![]:![]:!![],'where':_0xcde679[_0xb7b9('0x17')]?_0xcde679['options'][_0xb7b9('0x19')]||null:null,'attributes':_0xcde679['options']?_0xcde679[_0xb7b9('0x17')][_0xb7b9('0x1a')]||null:null,'limit':_0xcde679['options']?_0xcde679[_0xb7b9('0x17')][_0xb7b9('0x1b')]||null:null,'include':_0xcde679[_0xb7b9('0x17')]?_0xcde679[_0xb7b9('0x17')][_0xb7b9('0x1c')]?_[_0xb7b9('0x1d')](_0xcde679['options'][_0xb7b9('0x1c')],function(_0x2c9b36){return{'model':db[_0x2c9b36[_0xb7b9('0x1e')]],'as':_0x2c9b36['as'],'attributes':_0x2c9b36[_0xb7b9('0x1a')],'include':_0x2c9b36[_0xb7b9('0x1c')]?_[_0xb7b9('0x1d')](_0x2c9b36[_0xb7b9('0x1c')],function(_0x59693a){return{'model':db[_0x59693a[_0xb7b9('0x1e')]],'as':_0x59693a['as'],'attributes':_0x59693a[_0xb7b9('0x1a')],'include':_0x59693a[_0xb7b9('0x1c')]?_['map'](_0x59693a['include'],function(_0x4b3160){return{'model':db[_0x4b3160[_0xb7b9('0x1e')]],'as':_0x4b3160['as'],'attributes':_0x4b3160['attributes']};}):[]};}):[]};}):[]:[]})[_0xb7b9('0xb')](function(_0x2b0153){logger[_0xb7b9('0xc')](_0xb7b9('0x14'),_0xcde679);logger['debug'](_0xb7b9('0x14'),_0xcde679,JSON['stringify'](_0x2b0153));_0x3da58e(_0x2b0153);})[_0xb7b9('0x1f')](function(_0x74051){logger['error']('GetTemplate',_0x74051['message'],_0xcde679);_0x1b9dad(_0x1def6b[_0xb7b9('0x10')](0x1f4,_0x74051[_0xb7b9('0x12')]));});});}; \ No newline at end of file +var _0x50fb=['Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','include','model','map','lodash','util','moment','bluebird','randomstring','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x552682,_0x28007e){var _0x3ad328=function(_0x20bb66){while(--_0x20bb66){_0x552682['push'](_0x552682['shift']());}};_0x3ad328(++_0x28007e);}(_0x50fb,0x1f4));var _0xb50f=function(_0x3462de,_0x313b5b){_0x3462de=_0x3462de-0x0;var _0x51ce2f=_0x50fb[_0x3462de];return _0x51ce2f;};'use strict';var _=require(_0xb50f('0x0'));var util=require(_0xb50f('0x1'));var moment=require(_0xb50f('0x2'));var BPromise=require(_0xb50f('0x3'));var rs=require(_0xb50f('0x4'));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(_0xb50f('0x5'));var jayson=require(_0xb50f('0x6'));var client=jayson[_0xb50f('0x7')][_0xb50f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f43d5,_0x182cd9,_0x36fe0a){return new BPromise(function(_0x33c1d6,_0x44f575){return client[_0xb50f('0x9')](_0x5f43d5,_0x36fe0a)[_0xb50f('0xa')](function(_0x384fa4){logger[_0xb50f('0xb')](_0xb50f('0xc'),_0x182cd9,_0xb50f('0xd'));logger[_0xb50f('0xe')](_0xb50f('0xf'),_0x182cd9,'request\x20sent',JSON[_0xb50f('0x10')](_0x384fa4));if(_0x384fa4[_0xb50f('0x11')]){if(_0x384fa4[_0xb50f('0x11')][_0xb50f('0x12')]===0x1f4){logger[_0xb50f('0x11')](_0xb50f('0xc'),_0x182cd9,_0x384fa4[_0xb50f('0x11')][_0xb50f('0x13')]);return _0x44f575(_0x384fa4[_0xb50f('0x11')][_0xb50f('0x13')]);}logger['error'](_0xb50f('0xc'),_0x182cd9,_0x384fa4[_0xb50f('0x11')][_0xb50f('0x13')]);return _0x33c1d6(_0x384fa4[_0xb50f('0x11')][_0xb50f('0x13')]);}else{logger['info'](_0xb50f('0xc'),_0x182cd9,'request\x20sent');_0x33c1d6(_0x384fa4[_0xb50f('0x14')][_0xb50f('0x13')]);}})[_0xb50f('0x15')](function(_0x362782){logger[_0xb50f('0x11')](_0xb50f('0xc'),_0x182cd9,_0x362782);_0x44f575(_0x362782);});});}exports[_0xb50f('0x16')]=function(_0x43d11b){var _0x3aef0b=this;return new Promise(function(_0x2f6421,_0x3c0a57){return db[_0xb50f('0x17')][_0xb50f('0x18')]({'raw':_0x43d11b[_0xb50f('0x19')]?_0x43d11b[_0xb50f('0x19')][_0xb50f('0x1a')]===undefined?!![]:![]:!![],'where':_0x43d11b[_0xb50f('0x19')]?_0x43d11b[_0xb50f('0x19')][_0xb50f('0x1b')]||null:null,'attributes':_0x43d11b[_0xb50f('0x19')]?_0x43d11b[_0xb50f('0x19')][_0xb50f('0x1c')]||null:null,'limit':_0x43d11b[_0xb50f('0x19')]?_0x43d11b[_0xb50f('0x19')]['limit']||null:null,'include':_0x43d11b['options']?_0x43d11b['options'][_0xb50f('0x1d')]?_['map'](_0x43d11b[_0xb50f('0x19')][_0xb50f('0x1d')],function(_0x1ff1f9){return{'model':db[_0x1ff1f9[_0xb50f('0x1e')]],'as':_0x1ff1f9['as'],'attributes':_0x1ff1f9[_0xb50f('0x1c')],'include':_0x1ff1f9['include']?_[_0xb50f('0x1f')](_0x1ff1f9[_0xb50f('0x1d')],function(_0xf669c7){return{'model':db[_0xf669c7[_0xb50f('0x1e')]],'as':_0xf669c7['as'],'attributes':_0xf669c7[_0xb50f('0x1c')],'include':_0xf669c7[_0xb50f('0x1d')]?_[_0xb50f('0x1f')](_0xf669c7[_0xb50f('0x1d')],function(_0x17dafc){return{'model':db[_0x17dafc['model']],'as':_0x17dafc['as'],'attributes':_0x17dafc[_0xb50f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb50f('0xa')](function(_0x439888){logger['info'](_0xb50f('0x16'),_0x43d11b);logger[_0xb50f('0xe')]('GetTemplate',_0x43d11b,JSON[_0xb50f('0x10')](_0x439888));_0x2f6421(_0x439888);})[_0xb50f('0x15')](function(_0x4d66af){logger['error'](_0xb50f('0x16'),_0x4d66af[_0xb50f('0x13')],_0x43d11b);_0x3c0a57(_0x3aef0b['error'](0x1f4,_0x4d66af[_0xb50f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index dda9e1f..fcc41e8 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 _0x459c=['destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','index','show','get','/:id/all_conditions','getAllConditions','getAnyConditions','post','create','addAllCondition','/:id/any_conditions','addAnyCondition','/:id/actions','put','delete','/:id'];(function(_0x5d9e18,_0x1c9a53){var _0x3b8cdc=function(_0x512768){while(--_0x512768){_0x5d9e18['push'](_0x5d9e18['shift']());}};_0x3b8cdc(++_0x1c9a53);}(_0x459c,0x12b));var _0xc459=function(_0x3655f1,_0x1be3a1){_0x3655f1=_0x3655f1-0x0;var _0x314d45=_0x459c[_0x3655f1];return _0x314d45;};'use strict';var multer=require('multer');var util=require(_0xc459('0x0'));var path=require('path');var timeout=require(_0xc459('0x1'));var express=require(_0xc459('0x2'));var router=express[_0xc459('0x3')]();var fs_extra=require(_0xc459('0x4'));var auth=require(_0xc459('0x5'));var interaction=require(_0xc459('0x6'));var config=require(_0xc459('0x7'));var controller=require(_0xc459('0x8'));router['get']('/',auth[_0xc459('0x9')](),controller[_0xc459('0xa')]);router['get']('/:id',auth[_0xc459('0x9')](),controller[_0xc459('0xb')]);router[_0xc459('0xc')](_0xc459('0xd'),auth[_0xc459('0x9')](),controller[_0xc459('0xe')]);router[_0xc459('0xc')]('/:id/any_conditions',auth[_0xc459('0x9')](),controller[_0xc459('0xf')]);router[_0xc459('0xc')]('/:id/actions',auth[_0xc459('0x9')](),controller['getActions']);router[_0xc459('0x10')]('/',auth['isAuthenticated'](),controller[_0xc459('0x11')]);router[_0xc459('0x10')](_0xc459('0xd'),auth['isAuthenticated'](),controller[_0xc459('0x12')]);router['post'](_0xc459('0x13'),auth['isAuthenticated'](),controller[_0xc459('0x14')]);router[_0xc459('0x10')](_0xc459('0x15'),auth[_0xc459('0x9')](),controller['addAction']);router[_0xc459('0x16')]('/:id',auth[_0xc459('0x9')](),controller['update']);router[_0xc459('0x17')](_0xc459('0x18'),auth['isAuthenticated'](),controller[_0xc459('0x19')]);module[_0xc459('0x1a')]=router; \ No newline at end of file +var _0x5d8a=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','getAllConditions','getAnyConditions','/:id/actions','getActions','create','post','/:id/all_conditions','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','put','update','delete','multer'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x5d8a,0x16b));var _0xa5d8=function(_0x30bdff,_0x308063){_0x30bdff=_0x30bdff-0x0;var _0x1e7ca9=_0x5d8a[_0x30bdff];return _0x1e7ca9;};'use strict';var multer=require(_0xa5d8('0x0'));var util=require(_0xa5d8('0x1'));var path=require(_0xa5d8('0x2'));var timeout=require(_0xa5d8('0x3'));var express=require(_0xa5d8('0x4'));var router=express['Router']();var fs_extra=require(_0xa5d8('0x5'));var auth=require(_0xa5d8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa5d8('0x7'));var controller=require(_0xa5d8('0x8'));router[_0xa5d8('0x9')]('/',auth[_0xa5d8('0xa')](),controller[_0xa5d8('0xb')]);router[_0xa5d8('0x9')](_0xa5d8('0xc'),auth[_0xa5d8('0xa')](),controller[_0xa5d8('0xd')]);router[_0xa5d8('0x9')]('/:id/all_conditions',auth[_0xa5d8('0xa')](),controller[_0xa5d8('0xe')]);router[_0xa5d8('0x9')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0xa5d8('0xf')]);router[_0xa5d8('0x9')](_0xa5d8('0x10'),auth['isAuthenticated'](),controller[_0xa5d8('0x11')]);router['post']('/',auth[_0xa5d8('0xa')](),controller[_0xa5d8('0x12')]);router[_0xa5d8('0x13')](_0xa5d8('0x14'),auth[_0xa5d8('0xa')](),controller[_0xa5d8('0x15')]);router[_0xa5d8('0x13')](_0xa5d8('0x16'),auth[_0xa5d8('0xa')](),controller[_0xa5d8('0x17')]);router[_0xa5d8('0x13')](_0xa5d8('0x10'),auth[_0xa5d8('0xa')](),controller[_0xa5d8('0x18')]);router[_0xa5d8('0x19')](_0xa5d8('0xc'),auth[_0xa5d8('0xa')](),controller[_0xa5d8('0x1a')]);router[_0xa5d8('0x1b')](_0xa5d8('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 519ae03..e29b30e 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 _0x78f6=['STRING','BOOLEAN','sequelize','exports'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x78f6,0x1b6));var _0x678f=function(_0x3f2268,_0x56a740){_0x3f2268=_0x3f2268-0x0;var _0x440412=_0x78f6[_0x3f2268];return _0x440412;};'use strict';var Sequelize=require(_0x678f('0x0'));module[_0x678f('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x678f('0x2')]},'description':{'type':Sequelize[_0x678f('0x2')]},'status':{'type':Sequelize[_0x678f('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x43e7=['sequelize','STRING'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x43e7,0xda));var _0x743e=function(_0x4be8ba,_0x5d10ba){_0x4be8ba=_0x4be8ba-0x0;var _0x1af822=_0x43e7[_0x4be8ba];return _0x1af822;};'use strict';var Sequelize=require(_0x743e('0x0'));module['exports']={'name':{'type':Sequelize[_0x743e('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'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 54d7803..f824f0a 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 _0x82f0=['sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','end','stack','name','send','index','map','Trigger','rawAttributes','keys','query','filters','attributes','model','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','catch','show','intersection','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions','findOne','pick','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','zip-dir','fast-json-patch','bluebird','mustache','util','path'];(function(_0x4dd1d2,_0x368e7){var _0x4ca6fe=function(_0x3439ea){while(--_0x3439ea){_0x4dd1d2['push'](_0x4dd1d2['shift']());}};_0x4ca6fe(++_0x368e7);}(_0x82f0,0xae));var _0x082f=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x82f0[_0x110c3d];return _0x226d67;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x082f('0x0'));var jsonpatch=require(_0x082f('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x082f('0x2'));var Mustache=require(_0x082f('0x3'));var util=require(_0x082f('0x4'));var path=require(_0x082f('0x5'));var sox=require(_0x082f('0x6'));var csv=require(_0x082f('0x7'));var ejs=require(_0x082f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x082f('0x9'));var squel=require('squel');var crypto=require(_0x082f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x082f('0xb'));var toCsv=require(_0x082f('0x7'));var querystring=require(_0x082f('0xc'));var Papa=require(_0x082f('0xd'));var Redis=require(_0x082f('0xe'));var authService=require(_0x082f('0xf'));var qs=require(_0x082f('0x10'));var as=require(_0x082f('0x11'));var hardwareService=require(_0x082f('0x12'));var logger=require(_0x082f('0x13'))('api');var utils=require(_0x082f('0x14'));var config=require(_0x082f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x082f('0x16'))['db'];function respondWithStatusCode(_0x1f7daf,_0x264cab){_0x264cab=_0x264cab||0xcc;return function(_0x43aaab){if(_0x43aaab){return _0x1f7daf[_0x082f('0x17')](_0x264cab);}return _0x1f7daf['status'](_0x264cab)['end']();};}function respondWithResult(_0x35a152,_0x56d5af){_0x56d5af=_0x56d5af||0xc8;return function(_0x5080bd){if(_0x5080bd){return _0x35a152['status'](_0x56d5af)[_0x082f('0x18')](_0x5080bd);}};}function respondWithFilteredResult(_0x4d96d1,_0x52e8fa){return function(_0x42cc2d){if(_0x42cc2d){var _0x4e2293=typeof _0x52e8fa['offset']===_0x082f('0x19')&&typeof _0x52e8fa[_0x082f('0x1a')]===_0x082f('0x19');var _0x2d6882=_0x42cc2d[_0x082f('0x1b')];var _0x100ad1=_0x4e2293?0x0:_0x52e8fa[_0x082f('0x1c')];var _0x4a098c=_0x4e2293?_0x42cc2d['count']:_0x52e8fa[_0x082f('0x1c')]+_0x52e8fa['limit'];var _0x49c185;if(_0x4a098c>=_0x2d6882){_0x4a098c=_0x2d6882;_0x49c185=0xc8;}else{_0x49c185=0xce;}_0x4d96d1[_0x082f('0x1d')](_0x49c185);return _0x4d96d1[_0x082f('0x1e')](_0x082f('0x1f'),_0x100ad1+'-'+_0x4a098c+'/'+_0x2d6882)[_0x082f('0x18')](_0x42cc2d);}return null;};}function patchUpdates(_0x2df6f3){return function(_0x2274fa){try{jsonpatch[_0x082f('0x20')](_0x2274fa,_0x2df6f3,!![]);}catch(_0x30eb43){return BPromise[_0x082f('0x21')](_0x30eb43);}return _0x2274fa[_0x082f('0x22')]();};}function saveUpdates(_0x3179f7,_0x11d851){return function(_0xac8175){if(_0xac8175){return _0xac8175[_0x082f('0x23')](_0x3179f7)['then'](function(_0x5c0e4a){return _0x5c0e4a;});}return null;};}function removeEntity(_0x57f5bd,_0x54ad38){return function(_0x153bdd){if(_0x153bdd){return _0x153bdd[_0x082f('0x24')]()[_0x082f('0x25')](function(){var _0x86834e=_0x153bdd[_0x082f('0x26')]({'plain':!![]});var _0x117200='Triggers';return db[_0x082f('0x27')][_0x082f('0x24')]({'where':{'type':_0x117200,'resourceId':_0x86834e['id']}})[_0x082f('0x25')](function(){return _0x153bdd;});})[_0x082f('0x25')](function(){_0x57f5bd['status'](0xcc)[_0x082f('0x28')]();});}};}function handleEntityNotFound(_0x4080a7,_0x51c303){return function(_0x584930){if(!_0x584930){_0x4080a7[_0x082f('0x17')](0x194);}return _0x584930;};}function handleError(_0x389bca,_0x5959db){_0x5959db=_0x5959db||0x1f4;return function(_0x36d8c1){logger['error'](_0x36d8c1[_0x082f('0x29')]);if(_0x36d8c1[_0x082f('0x2a')]){delete _0x36d8c1[_0x082f('0x2a')];}_0x389bca[_0x082f('0x1d')](_0x5959db)[_0x082f('0x2b')](_0x36d8c1);};}exports[_0x082f('0x2c')]=function(_0x2a9c97,_0x34ee82){var _0xe8d0d1={},_0x17a46d={},_0xc8519a={'count':0x0,'rows':[]};var _0x2232ba=_[_0x082f('0x2d')](db[_0x082f('0x2e')][_0x082f('0x2f')],function(_0xcc575c){return{'name':_0xcc575c['fieldName'],'type':_0xcc575c['type']['key']};});_0x17a46d['model']=_[_0x082f('0x2d')](_0x2232ba,_0x082f('0x2a'));_0x17a46d['query']=_[_0x082f('0x30')](_0x2a9c97[_0x082f('0x31')]);_0x17a46d[_0x082f('0x32')]=_['intersection'](_0x17a46d['model'],_0x17a46d['query']);_0xe8d0d1[_0x082f('0x33')]=_['intersection'](_0x17a46d[_0x082f('0x34')],qs[_0x082f('0x35')](_0x2a9c97[_0x082f('0x31')][_0x082f('0x35')]));_0xe8d0d1['attributes']=_0xe8d0d1[_0x082f('0x33')][_0x082f('0x36')]?_0xe8d0d1[_0x082f('0x33')]:_0x17a46d[_0x082f('0x34')];if(!_0x2a9c97[_0x082f('0x31')]['hasOwnProperty'](_0x082f('0x37'))){_0xe8d0d1['limit']=qs['limit'](_0x2a9c97['query'][_0x082f('0x1a')]);_0xe8d0d1[_0x082f('0x1c')]=qs[_0x082f('0x1c')](_0x2a9c97[_0x082f('0x31')]['offset']);}_0xe8d0d1[_0x082f('0x38')]=qs[_0x082f('0x39')](_0x2a9c97[_0x082f('0x31')][_0x082f('0x39')]);_0xe8d0d1['where']=qs['filters'](_['pick'](_0x2a9c97[_0x082f('0x31')],_0x17a46d[_0x082f('0x32')]),_0x2232ba);if(_0x2a9c97[_0x082f('0x31')][_0x082f('0x3a')]){_0xe8d0d1[_0x082f('0x3b')]=_[_0x082f('0x3c')](_0xe8d0d1['where'],{'$or':_[_0x082f('0x2d')](_0x2232ba,function(_0x22a728){if(_0x22a728['type']!==_0x082f('0x3d')){var _0x39e9fa={};_0x39e9fa[_0x22a728[_0x082f('0x2a')]]={'$like':'%'+_0x2a9c97['query']['filter']+'%'};return _0x39e9fa;}})});}_0xe8d0d1=_[_0x082f('0x3c')]({},_0xe8d0d1,_0x2a9c97['options']);var _0x5c1f5d={'where':_0xe8d0d1[_0x082f('0x3b')]};return db[_0x082f('0x2e')][_0x082f('0x1b')](_0x5c1f5d)[_0x082f('0x25')](function(_0x404979){_0xc8519a[_0x082f('0x1b')]=_0x404979;if(_0x2a9c97[_0x082f('0x31')][_0x082f('0x3e')]){_0xe8d0d1['include']=[{'all':!![]}];}return db['Trigger']['findAll'](_0xe8d0d1);})['then'](function(_0x18d604){_0xc8519a['rows']=_0x18d604;return _0xc8519a;})[_0x082f('0x25')](respondWithFilteredResult(_0x34ee82,_0xe8d0d1))[_0x082f('0x3f')](handleError(_0x34ee82,null));};exports[_0x082f('0x40')]=function(_0x36712b,_0x1e8cc5){var _0x491f2d={'raw':![],'where':{'id':_0x36712b['params']['id']}},_0x4003ca={};_0x4003ca[_0x082f('0x34')]=_['keys'](db[_0x082f('0x2e')]['rawAttributes']);_0x4003ca[_0x082f('0x31')]=_[_0x082f('0x30')](_0x36712b[_0x082f('0x31')]);_0x4003ca[_0x082f('0x32')]=_[_0x082f('0x41')](_0x4003ca[_0x082f('0x34')],_0x4003ca[_0x082f('0x31')]);_0x491f2d[_0x082f('0x33')]=_[_0x082f('0x41')](_0x4003ca[_0x082f('0x34')],qs[_0x082f('0x35')](_0x36712b[_0x082f('0x31')][_0x082f('0x35')]));_0x491f2d['attributes']=_0x491f2d[_0x082f('0x33')][_0x082f('0x36')]?_0x491f2d[_0x082f('0x33')]:_0x4003ca[_0x082f('0x34')];if(_0x36712b[_0x082f('0x31')][_0x082f('0x3e')]){_0x491f2d[_0x082f('0x42')]=[{'all':!![]}];}_0x491f2d=_['merge']({},_0x491f2d,_0x36712b[_0x082f('0x43')]);return db[_0x082f('0x2e')][_0x082f('0x44')](_0x491f2d)[_0x082f('0x25')](handleEntityNotFound(_0x1e8cc5,null))[_0x082f('0x25')](respondWithResult(_0x1e8cc5,null))['catch'](handleError(_0x1e8cc5,null));};exports[_0x082f('0x45')]=function(_0x4c4f52,_0x49a60b){return db['Trigger'][_0x082f('0x45')](_0x4c4f52[_0x082f('0x46')],{})[_0x082f('0x25')](function(_0x41b4a8){var _0x51f462=_0x4c4f52[_0x082f('0x47')][_0x082f('0x26')]({'plain':!![]});if(!_0x51f462)throw new Error(_0x082f('0x48'));if(_0x51f462['role']===_0x082f('0x47')){var _0x35d644=_0x41b4a8[_0x082f('0x26')]({'plain':!![]});var _0x1aa9d3='Triggers';return db[_0x082f('0x49')]['find']({'where':{'name':_0x1aa9d3,'userProfileId':_0x51f462['userProfileId']},'raw':!![]})[_0x082f('0x25')](function(_0x5c54c1){if(_0x5c54c1&&_0x5c54c1['autoAssociation']===0x0){return db['UserProfileResource'][_0x082f('0x45')]({'name':_0x35d644[_0x082f('0x2a')],'resourceId':_0x35d644['id'],'type':_0x5c54c1['name'],'sectionId':_0x5c54c1['id']},{})['then'](function(){return _0x41b4a8;});}else{return _0x41b4a8;}})[_0x082f('0x3f')](function(_0x558df2){logger[_0x082f('0x4a')](_0x082f('0x4b'),_0x558df2);throw _0x558df2;});}return _0x41b4a8;})['then'](respondWithResult(_0x49a60b,0xc9))[_0x082f('0x3f')](handleError(_0x49a60b,null));};exports[_0x082f('0x23')]=function(_0x10acf4,_0x45d728){if(_0x10acf4[_0x082f('0x46')]['id']){delete _0x10acf4[_0x082f('0x46')]['id'];}return db[_0x082f('0x2e')][_0x082f('0x44')]({'where':{'id':_0x10acf4[_0x082f('0x4c')]['id']}})[_0x082f('0x25')](handleEntityNotFound(_0x45d728,null))[_0x082f('0x25')](saveUpdates(_0x10acf4['body'],null))[_0x082f('0x25')](respondWithResult(_0x45d728,null))[_0x082f('0x3f')](handleError(_0x45d728,null));};exports[_0x082f('0x24')]=function(_0x3f8f39,_0xddc327){return db[_0x082f('0x2e')]['find']({'where':{'id':_0x3f8f39[_0x082f('0x4c')]['id']}})[_0x082f('0x25')](handleEntityNotFound(_0xddc327,null))[_0x082f('0x25')](removeEntity(_0xddc327,null))['catch'](handleError(_0xddc327,null));};exports[_0x082f('0x4d')]=function(_0x4e529a,_0x346508,_0x399886){if(_0x4e529a[_0x082f('0x46')]['id']){delete _0x4e529a[_0x082f('0x46')]['id'];}return db['Trigger'][_0x082f('0x44')]({'where':{'id':_0x4e529a[_0x082f('0x4c')]['id']}})[_0x082f('0x25')](handleEntityNotFound(_0x346508,null))[_0x082f('0x25')](function(_0x523cae){if(_0x523cae){_0x4e529a[_0x082f('0x46')][_0x082f('0x4e')]=_0x523cae['id'];return db[_0x082f('0x4f')][_0x082f('0x45')](_0x4e529a['body']);}})['then'](respondWithResult(_0x346508,null))[_0x082f('0x3f')](handleError(_0x346508,null));};exports['addAnyCondition']=function(_0x2b1285,_0x2f2caf,_0x5ee7fb){if(_0x2b1285['body']['id']){delete _0x2b1285['body']['id'];}return db[_0x082f('0x2e')][_0x082f('0x44')]({'where':{'id':_0x2b1285[_0x082f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2f2caf,null))['then'](function(_0x47262b){if(_0x47262b){_0x2b1285[_0x082f('0x46')][_0x082f('0x50')]=_0x47262b['id'];return db['Condition'][_0x082f('0x45')](_0x2b1285[_0x082f('0x46')]);}})[_0x082f('0x25')](respondWithResult(_0x2f2caf,null))['catch'](handleError(_0x2f2caf,null));};exports[_0x082f('0x51')]=function(_0x57e041,_0x11fbff,_0x2d366e){var _0x308b53={};var _0x46af1a={};var _0x3a97d9;var _0x581363;return db[_0x082f('0x2e')][_0x082f('0x52')]({'where':{'id':_0x57e041[_0x082f('0x4c')]['id']}})[_0x082f('0x25')](handleEntityNotFound(_0x11fbff,null))['then'](function(_0x2d3440){if(_0x2d3440){_0x3a97d9=_0x2d3440;_0x46af1a[_0x082f('0x34')]=_[_0x082f('0x30')](db['Condition'][_0x082f('0x2f')]);_0x46af1a[_0x082f('0x31')]=_['keys'](_0x57e041['query']);_0x46af1a['filters']=_[_0x082f('0x41')](_0x46af1a['model'],_0x46af1a[_0x082f('0x31')]);_0x308b53[_0x082f('0x33')]=_[_0x082f('0x41')](_0x46af1a[_0x082f('0x34')],qs[_0x082f('0x35')](_0x57e041['query'][_0x082f('0x35')]));_0x308b53[_0x082f('0x33')]=_0x308b53[_0x082f('0x33')][_0x082f('0x36')]?_0x308b53[_0x082f('0x33')]:_0x46af1a[_0x082f('0x34')];_0x308b53[_0x082f('0x38')]=qs[_0x082f('0x39')](_0x57e041['query']['sort']);_0x308b53[_0x082f('0x3b')]=qs[_0x082f('0x32')](_[_0x082f('0x53')](_0x57e041[_0x082f('0x31')],_0x46af1a[_0x082f('0x32')]));if(_0x57e041[_0x082f('0x31')][_0x082f('0x3a')]){_0x308b53[_0x082f('0x3b')]=_[_0x082f('0x3c')](_0x308b53[_0x082f('0x3b')],{'$or':_[_0x082f('0x2d')](_0x308b53[_0x082f('0x33')],function(_0x1cc20c){var _0x14b69b={};_0x14b69b[_0x1cc20c]={'$like':'%'+_0x57e041['query']['filter']+'%'};return _0x14b69b;})});}_0x308b53=_[_0x082f('0x3c')]({},_0x308b53,_0x57e041['options']);return _0x3a97d9['getAllConditions'](_0x308b53);}})[_0x082f('0x25')](function(_0x4abc96){if(_0x4abc96){_0x581363=_0x4abc96[_0x082f('0x36')];if(!_0x57e041[_0x082f('0x31')][_0x082f('0x54')](_0x082f('0x37'))){_0x308b53[_0x082f('0x1a')]=qs[_0x082f('0x1a')](_0x57e041[_0x082f('0x31')][_0x082f('0x1a')]);_0x308b53['offset']=qs[_0x082f('0x1c')](_0x57e041['query'][_0x082f('0x1c')]);}return _0x3a97d9[_0x082f('0x51')](_0x308b53);}})[_0x082f('0x25')](function(_0xd0d643){if(_0xd0d643){return _0xd0d643?{'count':_0x581363,'rows':_0xd0d643}:null;}})[_0x082f('0x25')](respondWithResult(_0x11fbff,null))[_0x082f('0x3f')](handleError(_0x11fbff,null));};exports[_0x082f('0x55')]=function(_0x373a67,_0x1b41a1,_0x1632b8){var _0x4f3fdb={};var _0x3cfdbc={};var _0x1afbea;var _0x4b4d40;return db[_0x082f('0x2e')]['findOne']({'where':{'id':_0x373a67[_0x082f('0x4c')]['id']}})[_0x082f('0x25')](handleEntityNotFound(_0x1b41a1,null))[_0x082f('0x25')](function(_0xef1fd0){if(_0xef1fd0){_0x1afbea=_0xef1fd0;_0x3cfdbc['model']=_[_0x082f('0x30')](db['Condition'][_0x082f('0x2f')]);_0x3cfdbc['query']=_['keys'](_0x373a67[_0x082f('0x31')]);_0x3cfdbc[_0x082f('0x32')]=_[_0x082f('0x41')](_0x3cfdbc[_0x082f('0x34')],_0x3cfdbc[_0x082f('0x31')]);_0x4f3fdb[_0x082f('0x33')]=_['intersection'](_0x3cfdbc[_0x082f('0x34')],qs[_0x082f('0x35')](_0x373a67[_0x082f('0x31')][_0x082f('0x35')]));_0x4f3fdb[_0x082f('0x33')]=_0x4f3fdb[_0x082f('0x33')][_0x082f('0x36')]?_0x4f3fdb['attributes']:_0x3cfdbc[_0x082f('0x34')];_0x4f3fdb[_0x082f('0x38')]=qs[_0x082f('0x39')](_0x373a67[_0x082f('0x31')][_0x082f('0x39')]);_0x4f3fdb[_0x082f('0x3b')]=qs['filters'](_[_0x082f('0x53')](_0x373a67['query'],_0x3cfdbc[_0x082f('0x32')]));if(_0x373a67[_0x082f('0x31')][_0x082f('0x3a')]){_0x4f3fdb[_0x082f('0x3b')]=_[_0x082f('0x3c')](_0x4f3fdb[_0x082f('0x3b')],{'$or':_[_0x082f('0x2d')](_0x4f3fdb['attributes'],function(_0x1cc6a1){var _0x3a6a75={};_0x3a6a75[_0x1cc6a1]={'$like':'%'+_0x373a67[_0x082f('0x31')][_0x082f('0x3a')]+'%'};return _0x3a6a75;})});}_0x4f3fdb=_[_0x082f('0x3c')]({},_0x4f3fdb,_0x373a67[_0x082f('0x43')]);return _0x1afbea[_0x082f('0x55')](_0x4f3fdb);}})[_0x082f('0x25')](function(_0x62cff2){if(_0x62cff2){_0x4b4d40=_0x62cff2[_0x082f('0x36')];if(!_0x373a67[_0x082f('0x31')]['hasOwnProperty'](_0x082f('0x37'))){_0x4f3fdb[_0x082f('0x1a')]=qs[_0x082f('0x1a')](_0x373a67[_0x082f('0x31')][_0x082f('0x1a')]);_0x4f3fdb['offset']=qs['offset'](_0x373a67['query'][_0x082f('0x1c')]);}return _0x1afbea[_0x082f('0x55')](_0x4f3fdb);}})['then'](function(_0x311bdc){if(_0x311bdc){return _0x311bdc?{'count':_0x4b4d40,'rows':_0x311bdc}:null;}})['then'](respondWithResult(_0x1b41a1,null))[_0x082f('0x3f')](handleError(_0x1b41a1,null));};exports[_0x082f('0x56')]=function(_0x2e5c51,_0x57ddcf,_0x24a67b){if(_0x2e5c51[_0x082f('0x46')]['id']){delete _0x2e5c51['body']['id'];}return db['Trigger'][_0x082f('0x44')]({'where':{'id':_0x2e5c51[_0x082f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x57ddcf,null))[_0x082f('0x25')](function(_0x3cda89){if(_0x3cda89){_0x2e5c51[_0x082f('0x46')][_0x082f('0x57')]=_0x3cda89['id'];return db[_0x082f('0x58')][_0x082f('0x45')](_0x2e5c51['body']);}})[_0x082f('0x25')](respondWithResult(_0x57ddcf,null))[_0x082f('0x3f')](handleError(_0x57ddcf,null));};exports[_0x082f('0x59')]=function(_0xd2eced,_0x3cd905,_0x3cf741){var _0xcfa64f={};var _0x5d7899={};var _0x5b8fb9;var _0x6a9873;return db['Trigger'][_0x082f('0x52')]({'where':{'id':_0xd2eced[_0x082f('0x4c')]['id']}})[_0x082f('0x25')](handleEntityNotFound(_0x3cd905,null))[_0x082f('0x25')](function(_0x1b0a22){if(_0x1b0a22){_0x5b8fb9=_0x1b0a22;_0x5d7899['model']=_[_0x082f('0x30')](db[_0x082f('0x58')]['rawAttributes']);_0x5d7899[_0x082f('0x31')]=_['keys'](_0xd2eced[_0x082f('0x31')]);_0x5d7899['filters']=_['intersection'](_0x5d7899[_0x082f('0x34')],_0x5d7899[_0x082f('0x31')]);_0xcfa64f['attributes']=_[_0x082f('0x41')](_0x5d7899[_0x082f('0x34')],qs['fields'](_0xd2eced[_0x082f('0x31')][_0x082f('0x35')]));_0xcfa64f[_0x082f('0x33')]=_0xcfa64f['attributes'][_0x082f('0x36')]?_0xcfa64f[_0x082f('0x33')]:_0x5d7899['model'];_0xcfa64f[_0x082f('0x38')]=qs[_0x082f('0x39')](_0xd2eced[_0x082f('0x31')][_0x082f('0x39')]);_0xcfa64f['where']=qs[_0x082f('0x32')](_['pick'](_0xd2eced['query'],_0x5d7899['filters']));if(_0xd2eced[_0x082f('0x31')]['filter']){_0xcfa64f[_0x082f('0x3b')]=_['merge'](_0xcfa64f[_0x082f('0x3b')],{'$or':_['map'](_0xcfa64f['attributes'],function(_0x11976c){var _0x1ed976={};_0x1ed976[_0x11976c]={'$like':'%'+_0xd2eced[_0x082f('0x31')][_0x082f('0x3a')]+'%'};return _0x1ed976;})});}_0xcfa64f=_[_0x082f('0x3c')]({},_0xcfa64f,_0xd2eced['options']);return _0x5b8fb9[_0x082f('0x59')](_0xcfa64f);}})['then'](function(_0xde63ff){if(_0xde63ff){_0x6a9873=_0xde63ff[_0x082f('0x36')];if(!_0xd2eced[_0x082f('0x31')][_0x082f('0x54')](_0x082f('0x37'))){_0xcfa64f[_0x082f('0x1a')]=qs[_0x082f('0x1a')](_0xd2eced['query'][_0x082f('0x1a')]);_0xcfa64f[_0x082f('0x1c')]=qs[_0x082f('0x1c')](_0xd2eced[_0x082f('0x31')][_0x082f('0x1c')]);}return _0x5b8fb9['getActions'](_0xcfa64f);}})[_0x082f('0x25')](function(_0x13f156){if(_0x13f156){return _0x13f156?{'count':_0x6a9873,'rows':_0x13f156}:null;}})[_0x082f('0x25')](respondWithResult(_0x3cd905,null))[_0x082f('0x3f')](handleError(_0x3cd905,null));}; \ No newline at end of file +var _0xf484=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions','findOne','nolimit','getAnyConditions','addAction','TriggerId','getActions','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','get','Triggers','UserProfileResource','destroy','then','sendStatus','error','index','map','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Trigger','includeAll','include','rows','catch','show','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xf484,0x18e));var _0x4f48=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xf484[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4f48('0x0'));var jsonpatch=require(_0x4f48('0x1'));var rp=require('request-promise');var moment=require(_0x4f48('0x2'));var BPromise=require(_0x4f48('0x3'));var Mustache=require(_0x4f48('0x4'));var util=require('util');var path=require(_0x4f48('0x5'));var sox=require(_0x4f48('0x6'));var csv=require(_0x4f48('0x7'));var ejs=require(_0x4f48('0x8'));var fs=require('fs');var fs_extra=require(_0x4f48('0x9'));var _=require('lodash');var squel=require(_0x4f48('0xa'));var crypto=require(_0x4f48('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4f48('0xc'));var toCsv=require(_0x4f48('0x7'));var querystring=require(_0x4f48('0xd'));var Papa=require(_0x4f48('0xe'));var Redis=require(_0x4f48('0xf'));var authService=require(_0x4f48('0x10'));var qs=require(_0x4f48('0x11'));var as=require(_0x4f48('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4f48('0x13'));var utils=require(_0x4f48('0x14'));var config=require(_0x4f48('0x15'));var licenseUtil=require(_0x4f48('0x16'));var db=require(_0x4f48('0x17'))['db'];function respondWithStatusCode(_0x1d4e01,_0x5c41cf){_0x5c41cf=_0x5c41cf||0xcc;return function(_0x1a6f2c){if(_0x1a6f2c){return _0x1d4e01['sendStatus'](_0x5c41cf);}return _0x1d4e01[_0x4f48('0x18')](_0x5c41cf)[_0x4f48('0x19')]();};}function respondWithResult(_0x583c2a,_0x34deb8){_0x34deb8=_0x34deb8||0xc8;return function(_0x5bad58){if(_0x5bad58){return _0x583c2a['status'](_0x34deb8)['json'](_0x5bad58);}};}function respondWithFilteredResult(_0x12473d,_0x22420d){return function(_0x215f03){if(_0x215f03){var _0x231f64=typeof _0x22420d[_0x4f48('0x1a')]==='undefined'&&typeof _0x22420d[_0x4f48('0x1b')]===_0x4f48('0x1c');var _0x21e9a4=_0x215f03[_0x4f48('0x1d')];var _0x67b20=_0x231f64?0x0:_0x22420d[_0x4f48('0x1a')];var _0x2fe239=_0x231f64?_0x215f03[_0x4f48('0x1d')]:_0x22420d[_0x4f48('0x1a')]+_0x22420d[_0x4f48('0x1b')];var _0x586d1a;if(_0x2fe239>=_0x21e9a4){_0x2fe239=_0x21e9a4;_0x586d1a=0xc8;}else{_0x586d1a=0xce;}_0x12473d[_0x4f48('0x18')](_0x586d1a);return _0x12473d[_0x4f48('0x1e')](_0x4f48('0x1f'),_0x67b20+'-'+_0x2fe239+'/'+_0x21e9a4)[_0x4f48('0x20')](_0x215f03);}return null;};}function patchUpdates(_0x1ec170){return function(_0x242b85){try{jsonpatch[_0x4f48('0x21')](_0x242b85,_0x1ec170,!![]);}catch(_0x43ea48){return BPromise[_0x4f48('0x22')](_0x43ea48);}return _0x242b85[_0x4f48('0x23')]();};}function saveUpdates(_0x1c4b09,_0xdc6c65){return function(_0x12d36c){if(_0x12d36c){return _0x12d36c[_0x4f48('0x24')](_0x1c4b09)['then'](function(_0x5f3e53){return _0x5f3e53;});}return null;};}function removeEntity(_0x58985d,_0x5e33ed){return function(_0x5366ea){if(_0x5366ea){return _0x5366ea['destroy']()['then'](function(){var _0x2636a7=_0x5366ea[_0x4f48('0x25')]({'plain':!![]});var _0x58fa92=_0x4f48('0x26');return db[_0x4f48('0x27')][_0x4f48('0x28')]({'where':{'type':_0x58fa92,'resourceId':_0x2636a7['id']}})[_0x4f48('0x29')](function(){return _0x5366ea;});})[_0x4f48('0x29')](function(){_0x58985d[_0x4f48('0x18')](0xcc)[_0x4f48('0x19')]();});}};}function handleEntityNotFound(_0xf4aa85,_0x3ee0bc){return function(_0x2342e0){if(!_0x2342e0){_0xf4aa85[_0x4f48('0x2a')](0x194);}return _0x2342e0;};}function handleError(_0x419aea,_0x3ce0e3){_0x3ce0e3=_0x3ce0e3||0x1f4;return function(_0x17ec09){logger[_0x4f48('0x2b')](_0x17ec09['stack']);if(_0x17ec09['name']){delete _0x17ec09['name'];}_0x419aea[_0x4f48('0x18')](_0x3ce0e3)['send'](_0x17ec09);};}exports[_0x4f48('0x2c')]=function(_0x1c271b,_0x2fb377){var _0x4e9fcf={},_0x14e1cd={},_0x34410a={'count':0x0,'rows':[]};var _0xa92cc=_[_0x4f48('0x2d')](db['Trigger'][_0x4f48('0x2e')],function(_0x5263da){return{'name':_0x5263da[_0x4f48('0x2f')],'type':_0x5263da[_0x4f48('0x30')][_0x4f48('0x31')]};});_0x14e1cd[_0x4f48('0x32')]=_[_0x4f48('0x2d')](_0xa92cc,_0x4f48('0x33'));_0x14e1cd['query']=_[_0x4f48('0x34')](_0x1c271b[_0x4f48('0x35')]);_0x14e1cd[_0x4f48('0x36')]=_[_0x4f48('0x37')](_0x14e1cd[_0x4f48('0x32')],_0x14e1cd['query']);_0x4e9fcf[_0x4f48('0x38')]=_[_0x4f48('0x37')](_0x14e1cd['model'],qs['fields'](_0x1c271b[_0x4f48('0x35')]['fields']));_0x4e9fcf['attributes']=_0x4e9fcf[_0x4f48('0x38')][_0x4f48('0x39')]?_0x4e9fcf[_0x4f48('0x38')]:_0x14e1cd[_0x4f48('0x32')];if(!_0x1c271b[_0x4f48('0x35')][_0x4f48('0x3a')]('nolimit')){_0x4e9fcf[_0x4f48('0x1b')]=qs[_0x4f48('0x1b')](_0x1c271b[_0x4f48('0x35')][_0x4f48('0x1b')]);_0x4e9fcf['offset']=qs[_0x4f48('0x1a')](_0x1c271b[_0x4f48('0x35')][_0x4f48('0x1a')]);}_0x4e9fcf[_0x4f48('0x3b')]=qs[_0x4f48('0x3c')](_0x1c271b[_0x4f48('0x35')][_0x4f48('0x3c')]);_0x4e9fcf[_0x4f48('0x3d')]=qs[_0x4f48('0x36')](_[_0x4f48('0x3e')](_0x1c271b[_0x4f48('0x35')],_0x14e1cd['filters']),_0xa92cc);if(_0x1c271b['query'][_0x4f48('0x3f')]){_0x4e9fcf[_0x4f48('0x3d')]=_[_0x4f48('0x40')](_0x4e9fcf[_0x4f48('0x3d')],{'$or':_['map'](_0xa92cc,function(_0x2f06e3){if(_0x2f06e3['type']!==_0x4f48('0x41')){var _0x36a0d2={};_0x36a0d2[_0x2f06e3[_0x4f48('0x33')]]={'$like':'%'+_0x1c271b['query'][_0x4f48('0x3f')]+'%'};return _0x36a0d2;}})});}_0x4e9fcf=_['merge']({},_0x4e9fcf,_0x1c271b[_0x4f48('0x42')]);var _0x898ef9={'where':_0x4e9fcf[_0x4f48('0x3d')]};return db[_0x4f48('0x43')][_0x4f48('0x1d')](_0x898ef9)[_0x4f48('0x29')](function(_0xdb1650){_0x34410a[_0x4f48('0x1d')]=_0xdb1650;if(_0x1c271b[_0x4f48('0x35')][_0x4f48('0x44')]){_0x4e9fcf[_0x4f48('0x45')]=[{'all':!![]}];}return db['Trigger']['findAll'](_0x4e9fcf);})[_0x4f48('0x29')](function(_0x22bf4e){_0x34410a[_0x4f48('0x46')]=_0x22bf4e;return _0x34410a;})[_0x4f48('0x29')](respondWithFilteredResult(_0x2fb377,_0x4e9fcf))[_0x4f48('0x47')](handleError(_0x2fb377,null));};exports[_0x4f48('0x48')]=function(_0x6aaa71,_0x295b23){var _0x4cbd28={'raw':![],'where':{'id':_0x6aaa71[_0x4f48('0x49')]['id']}},_0x42d54f={};_0x42d54f[_0x4f48('0x32')]=_[_0x4f48('0x34')](db[_0x4f48('0x43')][_0x4f48('0x2e')]);_0x42d54f[_0x4f48('0x35')]=_[_0x4f48('0x34')](_0x6aaa71[_0x4f48('0x35')]);_0x42d54f[_0x4f48('0x36')]=_['intersection'](_0x42d54f[_0x4f48('0x32')],_0x42d54f[_0x4f48('0x35')]);_0x4cbd28[_0x4f48('0x38')]=_[_0x4f48('0x37')](_0x42d54f['model'],qs[_0x4f48('0x4a')](_0x6aaa71['query']['fields']));_0x4cbd28[_0x4f48('0x38')]=_0x4cbd28['attributes'][_0x4f48('0x39')]?_0x4cbd28['attributes']:_0x42d54f[_0x4f48('0x32')];if(_0x6aaa71[_0x4f48('0x35')][_0x4f48('0x44')]){_0x4cbd28[_0x4f48('0x45')]=[{'all':!![]}];}_0x4cbd28=_[_0x4f48('0x40')]({},_0x4cbd28,_0x6aaa71[_0x4f48('0x42')]);return db[_0x4f48('0x43')][_0x4f48('0x4b')](_0x4cbd28)[_0x4f48('0x29')](handleEntityNotFound(_0x295b23,null))[_0x4f48('0x29')](respondWithResult(_0x295b23,null))[_0x4f48('0x47')](handleError(_0x295b23,null));};exports[_0x4f48('0x4c')]=function(_0x289b86,_0x223ffb){return db[_0x4f48('0x43')]['create'](_0x289b86[_0x4f48('0x4d')],{})[_0x4f48('0x29')](function(_0x4ce5aa){var _0x4dd44d=_0x289b86[_0x4f48('0x4e')][_0x4f48('0x25')]({'plain':!![]});if(!_0x4dd44d)throw new Error(_0x4f48('0x4f'));if(_0x4dd44d[_0x4f48('0x50')]===_0x4f48('0x4e')){var _0x33a25c=_0x4ce5aa['get']({'plain':!![]});var _0x2cb17f=_0x4f48('0x26');return db[_0x4f48('0x51')][_0x4f48('0x4b')]({'where':{'name':_0x2cb17f,'userProfileId':_0x4dd44d[_0x4f48('0x52')]},'raw':!![]})['then'](function(_0x441950){if(_0x441950&&_0x441950[_0x4f48('0x53')]===0x0){return db['UserProfileResource'][_0x4f48('0x4c')]({'name':_0x33a25c['name'],'resourceId':_0x33a25c['id'],'type':_0x441950['name'],'sectionId':_0x441950['id']},{})[_0x4f48('0x29')](function(){return _0x4ce5aa;});}else{return _0x4ce5aa;}})['catch'](function(_0x23890b){logger[_0x4f48('0x2b')](_0x4f48('0x54'),_0x23890b);throw _0x23890b;});}return _0x4ce5aa;})[_0x4f48('0x29')](respondWithResult(_0x223ffb,0xc9))[_0x4f48('0x47')](handleError(_0x223ffb,null));};exports[_0x4f48('0x24')]=function(_0x260af5,_0x987554){if(_0x260af5[_0x4f48('0x4d')]['id']){delete _0x260af5[_0x4f48('0x4d')]['id'];}return db['Trigger'][_0x4f48('0x4b')]({'where':{'id':_0x260af5[_0x4f48('0x49')]['id']}})[_0x4f48('0x29')](handleEntityNotFound(_0x987554,null))[_0x4f48('0x29')](saveUpdates(_0x260af5['body'],null))[_0x4f48('0x29')](respondWithResult(_0x987554,null))[_0x4f48('0x47')](handleError(_0x987554,null));};exports['destroy']=function(_0x3a08e6,_0x2e15e5){return db[_0x4f48('0x43')][_0x4f48('0x4b')]({'where':{'id':_0x3a08e6['params']['id']}})[_0x4f48('0x29')](handleEntityNotFound(_0x2e15e5,null))[_0x4f48('0x29')](removeEntity(_0x2e15e5,null))['catch'](handleError(_0x2e15e5,null));};exports[_0x4f48('0x55')]=function(_0x6c1d4e,_0xf0d077,_0x3b7979){if(_0x6c1d4e['body']['id']){delete _0x6c1d4e[_0x4f48('0x4d')]['id'];}return db[_0x4f48('0x43')][_0x4f48('0x4b')]({'where':{'id':_0x6c1d4e[_0x4f48('0x49')]['id']}})[_0x4f48('0x29')](handleEntityNotFound(_0xf0d077,null))[_0x4f48('0x29')](function(_0x5ae83f){if(_0x5ae83f){_0x6c1d4e[_0x4f48('0x4d')][_0x4f48('0x56')]=_0x5ae83f['id'];return db[_0x4f48('0x57')]['create'](_0x6c1d4e[_0x4f48('0x4d')]);}})[_0x4f48('0x29')](respondWithResult(_0xf0d077,null))[_0x4f48('0x47')](handleError(_0xf0d077,null));};exports['addAnyCondition']=function(_0x350ae4,_0x19368d,_0x3b476e){if(_0x350ae4[_0x4f48('0x4d')]['id']){delete _0x350ae4[_0x4f48('0x4d')]['id'];}return db['Trigger'][_0x4f48('0x4b')]({'where':{'id':_0x350ae4['params']['id']}})[_0x4f48('0x29')](handleEntityNotFound(_0x19368d,null))['then'](function(_0xb29d0d){if(_0xb29d0d){_0x350ae4['body'][_0x4f48('0x58')]=_0xb29d0d['id'];return db[_0x4f48('0x57')][_0x4f48('0x4c')](_0x350ae4[_0x4f48('0x4d')]);}})[_0x4f48('0x29')](respondWithResult(_0x19368d,null))['catch'](handleError(_0x19368d,null));};exports[_0x4f48('0x59')]=function(_0x3ed369,_0x20f763,_0x3a4dbe){var _0x36a5bc={};var _0x3e0554={};var _0x6e7ffd;var _0x5508d6;return db[_0x4f48('0x43')][_0x4f48('0x5a')]({'where':{'id':_0x3ed369[_0x4f48('0x49')]['id']}})[_0x4f48('0x29')](handleEntityNotFound(_0x20f763,null))[_0x4f48('0x29')](function(_0x4908eb){if(_0x4908eb){_0x6e7ffd=_0x4908eb;_0x3e0554[_0x4f48('0x32')]=_[_0x4f48('0x34')](db[_0x4f48('0x57')][_0x4f48('0x2e')]);_0x3e0554[_0x4f48('0x35')]=_['keys'](_0x3ed369[_0x4f48('0x35')]);_0x3e0554[_0x4f48('0x36')]=_[_0x4f48('0x37')](_0x3e0554[_0x4f48('0x32')],_0x3e0554[_0x4f48('0x35')]);_0x36a5bc[_0x4f48('0x38')]=_[_0x4f48('0x37')](_0x3e0554['model'],qs[_0x4f48('0x4a')](_0x3ed369[_0x4f48('0x35')][_0x4f48('0x4a')]));_0x36a5bc[_0x4f48('0x38')]=_0x36a5bc[_0x4f48('0x38')][_0x4f48('0x39')]?_0x36a5bc[_0x4f48('0x38')]:_0x3e0554[_0x4f48('0x32')];_0x36a5bc[_0x4f48('0x3b')]=qs[_0x4f48('0x3c')](_0x3ed369[_0x4f48('0x35')][_0x4f48('0x3c')]);_0x36a5bc[_0x4f48('0x3d')]=qs[_0x4f48('0x36')](_['pick'](_0x3ed369['query'],_0x3e0554[_0x4f48('0x36')]));if(_0x3ed369[_0x4f48('0x35')][_0x4f48('0x3f')]){_0x36a5bc[_0x4f48('0x3d')]=_[_0x4f48('0x40')](_0x36a5bc[_0x4f48('0x3d')],{'$or':_['map'](_0x36a5bc[_0x4f48('0x38')],function(_0x3c8878){var _0x256a9d={};_0x256a9d[_0x3c8878]={'$like':'%'+_0x3ed369[_0x4f48('0x35')][_0x4f48('0x3f')]+'%'};return _0x256a9d;})});}_0x36a5bc=_[_0x4f48('0x40')]({},_0x36a5bc,_0x3ed369['options']);return _0x6e7ffd['getAllConditions'](_0x36a5bc);}})[_0x4f48('0x29')](function(_0x368ff1){if(_0x368ff1){_0x5508d6=_0x368ff1[_0x4f48('0x39')];if(!_0x3ed369[_0x4f48('0x35')][_0x4f48('0x3a')](_0x4f48('0x5b'))){_0x36a5bc['limit']=qs[_0x4f48('0x1b')](_0x3ed369['query']['limit']);_0x36a5bc['offset']=qs[_0x4f48('0x1a')](_0x3ed369[_0x4f48('0x35')]['offset']);}return _0x6e7ffd['getAllConditions'](_0x36a5bc);}})[_0x4f48('0x29')](function(_0xa4c364){if(_0xa4c364){return _0xa4c364?{'count':_0x5508d6,'rows':_0xa4c364}:null;}})[_0x4f48('0x29')](respondWithResult(_0x20f763,null))[_0x4f48('0x47')](handleError(_0x20f763,null));};exports['getAnyConditions']=function(_0x28dadb,_0x1c827b,_0x1cd87b){var _0x5242b4={};var _0x3a93c4={};var _0xd68f19;var _0x49a7cf;return db[_0x4f48('0x43')]['findOne']({'where':{'id':_0x28dadb['params']['id']}})['then'](handleEntityNotFound(_0x1c827b,null))[_0x4f48('0x29')](function(_0x7dba66){if(_0x7dba66){_0xd68f19=_0x7dba66;_0x3a93c4[_0x4f48('0x32')]=_[_0x4f48('0x34')](db[_0x4f48('0x57')]['rawAttributes']);_0x3a93c4[_0x4f48('0x35')]=_['keys'](_0x28dadb[_0x4f48('0x35')]);_0x3a93c4[_0x4f48('0x36')]=_[_0x4f48('0x37')](_0x3a93c4[_0x4f48('0x32')],_0x3a93c4[_0x4f48('0x35')]);_0x5242b4[_0x4f48('0x38')]=_['intersection'](_0x3a93c4['model'],qs[_0x4f48('0x4a')](_0x28dadb[_0x4f48('0x35')][_0x4f48('0x4a')]));_0x5242b4['attributes']=_0x5242b4[_0x4f48('0x38')][_0x4f48('0x39')]?_0x5242b4[_0x4f48('0x38')]:_0x3a93c4[_0x4f48('0x32')];_0x5242b4[_0x4f48('0x3b')]=qs[_0x4f48('0x3c')](_0x28dadb[_0x4f48('0x35')][_0x4f48('0x3c')]);_0x5242b4[_0x4f48('0x3d')]=qs['filters'](_['pick'](_0x28dadb[_0x4f48('0x35')],_0x3a93c4[_0x4f48('0x36')]));if(_0x28dadb['query'][_0x4f48('0x3f')]){_0x5242b4['where']=_[_0x4f48('0x40')](_0x5242b4[_0x4f48('0x3d')],{'$or':_[_0x4f48('0x2d')](_0x5242b4[_0x4f48('0x38')],function(_0x66e51e){var _0xb91ff3={};_0xb91ff3[_0x66e51e]={'$like':'%'+_0x28dadb['query']['filter']+'%'};return _0xb91ff3;})});}_0x5242b4=_[_0x4f48('0x40')]({},_0x5242b4,_0x28dadb['options']);return _0xd68f19['getAnyConditions'](_0x5242b4);}})['then'](function(_0x50fad3){if(_0x50fad3){_0x49a7cf=_0x50fad3[_0x4f48('0x39')];if(!_0x28dadb[_0x4f48('0x35')][_0x4f48('0x3a')](_0x4f48('0x5b'))){_0x5242b4[_0x4f48('0x1b')]=qs[_0x4f48('0x1b')](_0x28dadb[_0x4f48('0x35')][_0x4f48('0x1b')]);_0x5242b4[_0x4f48('0x1a')]=qs['offset'](_0x28dadb[_0x4f48('0x35')][_0x4f48('0x1a')]);}return _0xd68f19[_0x4f48('0x5c')](_0x5242b4);}})[_0x4f48('0x29')](function(_0x1a5c41){if(_0x1a5c41){return _0x1a5c41?{'count':_0x49a7cf,'rows':_0x1a5c41}:null;}})[_0x4f48('0x29')](respondWithResult(_0x1c827b,null))['catch'](handleError(_0x1c827b,null));};exports[_0x4f48('0x5d')]=function(_0x4d78e4,_0x1a7876,_0x4ced9e){if(_0x4d78e4[_0x4f48('0x4d')]['id']){delete _0x4d78e4['body']['id'];}return db[_0x4f48('0x43')][_0x4f48('0x4b')]({'where':{'id':_0x4d78e4[_0x4f48('0x49')]['id']}})['then'](handleEntityNotFound(_0x1a7876,null))[_0x4f48('0x29')](function(_0x1407d2){if(_0x1407d2){_0x4d78e4[_0x4f48('0x4d')][_0x4f48('0x5e')]=_0x1407d2['id'];return db['Action'][_0x4f48('0x4c')](_0x4d78e4[_0x4f48('0x4d')]);}})[_0x4f48('0x29')](respondWithResult(_0x1a7876,null))[_0x4f48('0x47')](handleError(_0x1a7876,null));};exports[_0x4f48('0x5f')]=function(_0x40665d,_0x335c2a,_0x2e1881){var _0x2428b1={};var _0x403c52={};var _0x47caf7;var _0x307d88;return db[_0x4f48('0x43')]['findOne']({'where':{'id':_0x40665d[_0x4f48('0x49')]['id']}})['then'](handleEntityNotFound(_0x335c2a,null))[_0x4f48('0x29')](function(_0x371633){if(_0x371633){_0x47caf7=_0x371633;_0x403c52[_0x4f48('0x32')]=_[_0x4f48('0x34')](db['Action']['rawAttributes']);_0x403c52[_0x4f48('0x35')]=_['keys'](_0x40665d[_0x4f48('0x35')]);_0x403c52['filters']=_[_0x4f48('0x37')](_0x403c52['model'],_0x403c52['query']);_0x2428b1[_0x4f48('0x38')]=_['intersection'](_0x403c52[_0x4f48('0x32')],qs[_0x4f48('0x4a')](_0x40665d[_0x4f48('0x35')][_0x4f48('0x4a')]));_0x2428b1[_0x4f48('0x38')]=_0x2428b1['attributes'][_0x4f48('0x39')]?_0x2428b1[_0x4f48('0x38')]:_0x403c52[_0x4f48('0x32')];_0x2428b1[_0x4f48('0x3b')]=qs['sort'](_0x40665d[_0x4f48('0x35')]['sort']);_0x2428b1[_0x4f48('0x3d')]=qs[_0x4f48('0x36')](_['pick'](_0x40665d[_0x4f48('0x35')],_0x403c52[_0x4f48('0x36')]));if(_0x40665d['query'][_0x4f48('0x3f')]){_0x2428b1[_0x4f48('0x3d')]=_[_0x4f48('0x40')](_0x2428b1[_0x4f48('0x3d')],{'$or':_[_0x4f48('0x2d')](_0x2428b1[_0x4f48('0x38')],function(_0x1751fe){var _0x54ef6b={};_0x54ef6b[_0x1751fe]={'$like':'%'+_0x40665d['query'][_0x4f48('0x3f')]+'%'};return _0x54ef6b;})});}_0x2428b1=_['merge']({},_0x2428b1,_0x40665d['options']);return _0x47caf7[_0x4f48('0x5f')](_0x2428b1);}})[_0x4f48('0x29')](function(_0x53c7da){if(_0x53c7da){_0x307d88=_0x53c7da[_0x4f48('0x39')];if(!_0x40665d[_0x4f48('0x35')][_0x4f48('0x3a')](_0x4f48('0x5b'))){_0x2428b1[_0x4f48('0x1b')]=qs[_0x4f48('0x1b')](_0x40665d[_0x4f48('0x35')][_0x4f48('0x1b')]);_0x2428b1['offset']=qs['offset'](_0x40665d[_0x4f48('0x35')]['offset']);}return _0x47caf7['getActions'](_0x2428b1);}})[_0x4f48('0x29')](function(_0x247434){if(_0x247434){return _0x247434?{'count':_0x307d88,'rows':_0x247434}:null;}})[_0x4f48('0x29')](respondWithResult(_0x335c2a,null))[_0x4f48('0x47')](handleError(_0x335c2a,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 0e21100..21fbc8b 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 _0x861c=['request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x461628,_0x4d27c6){var _0x572414=function(_0x17d5a2){while(--_0x17d5a2){_0x461628['push'](_0x461628['shift']());}};_0x572414(++_0x4d27c6);}(_0x861c,0xdb));var _0xc861=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x861c[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xc861('0x0'));var util=require(_0xc861('0x1'));var logger=require(_0xc861('0x2'))(_0xc861('0x3'));var moment=require(_0xc861('0x4'));var BPromise=require(_0xc861('0x5'));var rp=require(_0xc861('0x6'));var fs=require('fs');var path=require(_0xc861('0x7'));var rimraf=require(_0xc861('0x8'));var config=require(_0xc861('0x9'));var attributes=require(_0xc861('0xa'));module[_0xc861('0xb')]=function(_0x562f12,_0xc3b5fd){return _0x562f12[_0xc861('0xc')](_0xc861('0xd'),attributes,{'tableName':_0xc861('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8c52=['path','rimraf','../../config/environment','./trigger.attributes','exports','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0x8c52,0x7e));var _0x28c5=function(_0x451b32,_0x1eace6){_0x451b32=_0x451b32-0x0;var _0x4ac489=_0x8c52[_0x451b32];return _0x4ac489;};'use strict';var _=require(_0x28c5('0x0'));var util=require('util');var logger=require(_0x28c5('0x1'))(_0x28c5('0x2'));var moment=require(_0x28c5('0x3'));var BPromise=require(_0x28c5('0x4'));var rp=require(_0x28c5('0x5'));var fs=require('fs');var path=require(_0x28c5('0x6'));var rimraf=require(_0x28c5('0x7'));var config=require(_0x28c5('0x8'));var attributes=require(_0x28c5('0x9'));module[_0x28c5('0xa')]=function(_0x209f3d,_0x3b5c38){return _0x209f3d['define']('Trigger',attributes,{'tableName':'tools_triggers','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 05fc2a9..23b9788 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 _0xc4ea=['find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowTrigger'];(function(_0x6d394d,_0x185b80){var _0x1f0621=function(_0x2e5c81){while(--_0x2e5c81){_0x6d394d['push'](_0x6d394d['shift']());}};_0x1f0621(++_0x185b80);}(_0xc4ea,0x15f));var _0xac4e=function(_0x230bd0,_0x504acc){_0x230bd0=_0x230bd0-0x0;var _0x7a46d9=_0xc4ea[_0x230bd0];return _0x7a46d9;};'use strict';var _=require(_0xac4e('0x0'));var util=require(_0xac4e('0x1'));var moment=require(_0xac4e('0x2'));var BPromise=require(_0xac4e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac4e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xac4e('0x5'));var logger=require(_0xac4e('0x6'))(_0xac4e('0x7'));var config=require('../../config/environment');var jayson=require(_0xac4e('0x8'));var client=jayson[_0xac4e('0x9')][_0xac4e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ac755,_0x1c0f79,_0x47fc23){return new BPromise(function(_0x34fd7b,_0x1e421a){return client[_0xac4e('0xb')](_0x2ac755,_0x47fc23)[_0xac4e('0xc')](function(_0x10b858){logger[_0xac4e('0xd')](_0xac4e('0xe'),_0x1c0f79,_0xac4e('0xf'));logger[_0xac4e('0x10')]('Trigger,\x20%s,\x20%s,\x20%s',_0x1c0f79,_0xac4e('0xf'),JSON[_0xac4e('0x11')](_0x10b858));if(_0x10b858[_0xac4e('0x12')]){if(_0x10b858['error']['code']===0x1f4){logger['error'](_0xac4e('0xe'),_0x1c0f79,_0x10b858[_0xac4e('0x12')]['message']);return _0x1e421a(_0x10b858['error']['message']);}logger['error'](_0xac4e('0xe'),_0x1c0f79,_0x10b858['error'][_0xac4e('0x13')]);return _0x34fd7b(_0x10b858[_0xac4e('0x12')][_0xac4e('0x13')]);}else{logger[_0xac4e('0xd')](_0xac4e('0xe'),_0x1c0f79,_0xac4e('0xf'));_0x34fd7b(_0x10b858[_0xac4e('0x14')][_0xac4e('0x13')]);}})['catch'](function(_0x287955){logger[_0xac4e('0x12')]('Trigger,\x20%s,\x20%s',_0x1c0f79,_0x287955);_0x1e421a(_0x287955);});});}exports[_0xac4e('0x15')]=function(_0x26460f){var _0x75271=this;return new Promise(function(_0x4bcf84,_0x27d6b9){return db[_0xac4e('0x16')][_0xac4e('0x17')]({'raw':_0x26460f[_0xac4e('0x18')]?_0x26460f[_0xac4e('0x18')][_0xac4e('0x19')]===undefined?!![]:![]:!![],'where':_0x26460f[_0xac4e('0x18')]?_0x26460f[_0xac4e('0x18')][_0xac4e('0x1a')]||null:null,'attributes':_0x26460f['options']?_0x26460f['options'][_0xac4e('0x1b')]||null:null,'limit':_0x26460f['options']?_0x26460f[_0xac4e('0x18')][_0xac4e('0x1c')]||null:null,'include':_0x26460f[_0xac4e('0x18')]?_0x26460f[_0xac4e('0x18')][_0xac4e('0x1d')]?_[_0xac4e('0x1e')](_0x26460f[_0xac4e('0x18')][_0xac4e('0x1d')],function(_0x5643fe){return{'model':db[_0x5643fe[_0xac4e('0x1f')]],'as':_0x5643fe['as'],'attributes':_0x5643fe[_0xac4e('0x1b')],'include':_0x5643fe[_0xac4e('0x1d')]?_[_0xac4e('0x1e')](_0x5643fe[_0xac4e('0x1d')],function(_0x5597ad){return{'model':db[_0x5597ad[_0xac4e('0x1f')]],'as':_0x5597ad['as'],'attributes':_0x5597ad['attributes'],'include':_0x5597ad[_0xac4e('0x1d')]?_[_0xac4e('0x1e')](_0x5597ad[_0xac4e('0x1d')],function(_0x283085){return{'model':db[_0x283085[_0xac4e('0x1f')]],'as':_0x283085['as'],'attributes':_0x283085[_0xac4e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xac4e('0xc')](function(_0x5c42a9){logger['info'](_0xac4e('0x15'),_0x26460f);logger[_0xac4e('0x10')](_0xac4e('0x15'),_0x26460f,JSON[_0xac4e('0x11')](_0x5c42a9));_0x4bcf84(_0x5c42a9);})[_0xac4e('0x20')](function(_0x3d1b57){logger['error'](_0xac4e('0x15'),_0x3d1b57['message'],_0x26460f);_0x27d6b9(_0x75271[_0xac4e('0x12')](0x1f4,_0x3d1b57[_0xac4e('0x13')]));});});};exports[_0xac4e('0x21')]=function(_0x27fd81){var _0x8be96d=this;return new Promise(function(_0x41d57c,_0x10a966){return db['Trigger'][_0xac4e('0x22')]({'raw':_0x27fd81[_0xac4e('0x18')]?_0x27fd81['options']['raw']===undefined?!![]:![]:!![],'where':_0x27fd81['options']?_0x27fd81[_0xac4e('0x18')][_0xac4e('0x1a')]||null:null,'attributes':_0x27fd81[_0xac4e('0x18')]?_0x27fd81[_0xac4e('0x18')][_0xac4e('0x1b')]||null:null,'include':_0x27fd81[_0xac4e('0x18')]?_0x27fd81['options'][_0xac4e('0x1d')]?_[_0xac4e('0x1e')](_0x27fd81['options'][_0xac4e('0x1d')],function(_0x5685f9){return{'model':db[_0x5685f9[_0xac4e('0x1f')]],'as':_0x5685f9['as'],'attributes':_0x5685f9[_0xac4e('0x1b')],'include':_0x5685f9[_0xac4e('0x1d')]?_[_0xac4e('0x1e')](_0x5685f9[_0xac4e('0x1d')],function(_0x3915f1){return{'model':db[_0x3915f1[_0xac4e('0x1f')]],'as':_0x3915f1['as'],'attributes':_0x3915f1[_0xac4e('0x1b')],'include':_0x3915f1[_0xac4e('0x1d')]?_[_0xac4e('0x1e')](_0x3915f1['include'],function(_0x2fb595){return{'model':db[_0x2fb595[_0xac4e('0x1f')]],'as':_0x2fb595['as'],'attributes':_0x2fb595[_0xac4e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xac4e('0xc')](function(_0xabae9a){logger[_0xac4e('0xd')](_0xac4e('0x21'),_0x27fd81);logger[_0xac4e('0x10')]('ShowTrigger',_0x27fd81,JSON[_0xac4e('0x11')](_0xabae9a));_0x41d57c(_0xabae9a);})[_0xac4e('0x20')](function(_0x1f8a37){logger[_0xac4e('0x12')]('ShowTrigger',_0x1f8a37[_0xac4e('0x13')],_0x27fd81);_0x10a966(_0x8be96d[_0xac4e('0x12')](0x1f4,_0x1f8a37[_0xac4e('0x13')]));});});}; \ No newline at end of file +var _0x65da=['debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowTrigger','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info'];(function(_0x4470b3,_0x15d053){var _0xb5ac6c=function(_0x3f0685){while(--_0x3f0685){_0x4470b3['push'](_0x4470b3['shift']());}};_0xb5ac6c(++_0x15d053);}(_0x65da,0x152));var _0xa65d=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x65da[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0xa65d('0x0'));var util=require('util');var moment=require(_0xa65d('0x1'));var BPromise=require(_0xa65d('0x2'));var rs=require(_0xa65d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa65d('0x4'))['db'];var utils=require(_0xa65d('0x5'));var logger=require(_0xa65d('0x6'))(_0xa65d('0x7'));var config=require(_0xa65d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa65d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x372107,_0x36afc3,_0x461d40){return new BPromise(function(_0x1631de,_0x13ed40){return client[_0xa65d('0xa')](_0x372107,_0x461d40)['then'](function(_0x3c0017){logger[_0xa65d('0xb')]('Trigger,\x20%s,\x20%s',_0x36afc3,'request\x20sent');logger[_0xa65d('0xc')](_0xa65d('0xd'),_0x36afc3,_0xa65d('0xe'),JSON[_0xa65d('0xf')](_0x3c0017));if(_0x3c0017['error']){if(_0x3c0017[_0xa65d('0x10')][_0xa65d('0x11')]===0x1f4){logger[_0xa65d('0x10')](_0xa65d('0x12'),_0x36afc3,_0x3c0017[_0xa65d('0x10')][_0xa65d('0x13')]);return _0x13ed40(_0x3c0017['error'][_0xa65d('0x13')]);}logger[_0xa65d('0x10')]('Trigger,\x20%s,\x20%s',_0x36afc3,_0x3c0017[_0xa65d('0x10')]['message']);return _0x1631de(_0x3c0017[_0xa65d('0x10')]['message']);}else{logger[_0xa65d('0xb')]('Trigger,\x20%s,\x20%s',_0x36afc3,_0xa65d('0xe'));_0x1631de(_0x3c0017[_0xa65d('0x14')]['message']);}})['catch'](function(_0x268f86){logger[_0xa65d('0x10')](_0xa65d('0x12'),_0x36afc3,_0x268f86);_0x13ed40(_0x268f86);});});}exports[_0xa65d('0x15')]=function(_0x335e62){var _0x3e0630=this;return new Promise(function(_0x4127bb,_0x4cd6ce){return db[_0xa65d('0x16')][_0xa65d('0x17')]({'raw':_0x335e62['options']?_0x335e62[_0xa65d('0x18')][_0xa65d('0x19')]===undefined?!![]:![]:!![],'where':_0x335e62[_0xa65d('0x18')]?_0x335e62[_0xa65d('0x18')][_0xa65d('0x1a')]||null:null,'attributes':_0x335e62[_0xa65d('0x18')]?_0x335e62[_0xa65d('0x18')][_0xa65d('0x1b')]||null:null,'limit':_0x335e62['options']?_0x335e62['options'][_0xa65d('0x1c')]||null:null,'include':_0x335e62['options']?_0x335e62[_0xa65d('0x18')][_0xa65d('0x1d')]?_[_0xa65d('0x1e')](_0x335e62[_0xa65d('0x18')][_0xa65d('0x1d')],function(_0x146bb0){return{'model':db[_0x146bb0['model']],'as':_0x146bb0['as'],'attributes':_0x146bb0[_0xa65d('0x1b')],'include':_0x146bb0[_0xa65d('0x1d')]?_[_0xa65d('0x1e')](_0x146bb0[_0xa65d('0x1d')],function(_0x28d92b){return{'model':db[_0x28d92b['model']],'as':_0x28d92b['as'],'attributes':_0x28d92b[_0xa65d('0x1b')],'include':_0x28d92b[_0xa65d('0x1d')]?_[_0xa65d('0x1e')](_0x28d92b['include'],function(_0x5874a6){return{'model':db[_0x5874a6[_0xa65d('0x1f')]],'as':_0x5874a6['as'],'attributes':_0x5874a6[_0xa65d('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x101177){logger[_0xa65d('0xb')](_0xa65d('0x15'),_0x335e62);logger['debug'](_0xa65d('0x15'),_0x335e62,JSON[_0xa65d('0xf')](_0x101177));_0x4127bb(_0x101177);})['catch'](function(_0x233b86){logger[_0xa65d('0x10')](_0xa65d('0x15'),_0x233b86['message'],_0x335e62);_0x4cd6ce(_0x3e0630[_0xa65d('0x10')](0x1f4,_0x233b86[_0xa65d('0x13')]));});});};exports['ShowTrigger']=function(_0x56b3ac){var _0x558e52=this;return new Promise(function(_0x357fd0,_0x3920a0){return db['Trigger']['find']({'raw':_0x56b3ac['options']?_0x56b3ac[_0xa65d('0x18')][_0xa65d('0x19')]===undefined?!![]:![]:!![],'where':_0x56b3ac[_0xa65d('0x18')]?_0x56b3ac[_0xa65d('0x18')][_0xa65d('0x1a')]||null:null,'attributes':_0x56b3ac['options']?_0x56b3ac['options']['attributes']||null:null,'include':_0x56b3ac['options']?_0x56b3ac[_0xa65d('0x18')][_0xa65d('0x1d')]?_['map'](_0x56b3ac[_0xa65d('0x18')][_0xa65d('0x1d')],function(_0x1268ee){return{'model':db[_0x1268ee[_0xa65d('0x1f')]],'as':_0x1268ee['as'],'attributes':_0x1268ee[_0xa65d('0x1b')],'include':_0x1268ee[_0xa65d('0x1d')]?_[_0xa65d('0x1e')](_0x1268ee['include'],function(_0x2ba141){return{'model':db[_0x2ba141[_0xa65d('0x1f')]],'as':_0x2ba141['as'],'attributes':_0x2ba141['attributes'],'include':_0x2ba141[_0xa65d('0x1d')]?_[_0xa65d('0x1e')](_0x2ba141[_0xa65d('0x1d')],function(_0x2703eb){return{'model':db[_0x2703eb[_0xa65d('0x1f')]],'as':_0x2703eb['as'],'attributes':_0x2703eb[_0xa65d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa65d('0x20')](function(_0x1338e0){logger[_0xa65d('0xb')]('ShowTrigger',_0x56b3ac);logger[_0xa65d('0xc')](_0xa65d('0x21'),_0x56b3ac,JSON[_0xa65d('0xf')](_0x1338e0));_0x357fd0(_0x1338e0);})[_0xa65d('0x22')](function(_0x1ed823){logger[_0xa65d('0x10')](_0xa65d('0x21'),_0x1ed823['message'],_0x56b3ac);_0x3920a0(_0x558e52[_0xa65d('0x10')](0x1f4,_0x1ed823[_0xa65d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index e0773f4..c167f54 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 _0x806a=['util','path','connect-timeout','Router','fs-extra','isAuthenticated','index','get','/:id','show','post','clone','create','destroy','exports','multer'];(function(_0x305b20,_0x5e57e9){var _0x26d64a=function(_0x2e17f0){while(--_0x2e17f0){_0x305b20['push'](_0x305b20['shift']());}};_0x26d64a(++_0x5e57e9);}(_0x806a,0x1ef));var _0xa806=function(_0x3ff5b2,_0x215adb){_0x3ff5b2=_0x3ff5b2-0x0;var _0x558547=_0x806a[_0x3ff5b2];return _0x558547;};'use strict';var multer=require(_0xa806('0x0'));var util=require(_0xa806('0x1'));var path=require(_0xa806('0x2'));var timeout=require(_0xa806('0x3'));var express=require('express');var router=express[_0xa806('0x4')]();var fs_extra=require(_0xa806('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./trunk.controller');router['get']('/',auth[_0xa806('0x6')](),controller[_0xa806('0x7')]);router[_0xa806('0x8')](_0xa806('0x9'),auth[_0xa806('0x6')](),controller[_0xa806('0xa')]);router[_0xa806('0xb')]('/:id/clone',auth[_0xa806('0x6')](),controller[_0xa806('0xc')]);router[_0xa806('0xb')]('/',auth['isAuthenticated'](),controller[_0xa806('0xd')]);router['put'](_0xa806('0x9'),auth[_0xa806('0x6')](),controller['update']);router['delete']('/:id',auth[_0xa806('0x6')](),controller[_0xa806('0xe')]);module[_0xa806('0xf')]=router; \ No newline at end of file +var _0x6a76=['isAuthenticated','index','/:id','post','/:id/clone','clone','create','delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6a76,0x1ba));var _0x66a7=function(_0xd2e88,_0x4c0089){_0xd2e88=_0xd2e88-0x0;var _0x39a606=_0x6a76[_0xd2e88];return _0x39a606;};'use strict';var multer=require(_0x66a7('0x0'));var util=require('util');var path=require(_0x66a7('0x1'));var timeout=require(_0x66a7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x66a7('0x3'));var interaction=require(_0x66a7('0x4'));var config=require(_0x66a7('0x5'));var controller=require('./trunk.controller');router['get']('/',auth[_0x66a7('0x6')](),controller[_0x66a7('0x7')]);router['get'](_0x66a7('0x8'),auth[_0x66a7('0x6')](),controller['show']);router[_0x66a7('0x9')](_0x66a7('0xa'),auth['isAuthenticated'](),controller[_0x66a7('0xb')]);router['post']('/',auth[_0x66a7('0x6')](),controller[_0x66a7('0xc')]);router['put'](_0x66a7('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x66a7('0xd')](_0x66a7('0x8'),auth[_0x66a7('0x6')](),controller[_0x66a7('0xe')]);module[_0x66a7('0xf')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 0c4fdb4..f58d695 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 _0x33a1=['getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','inband','auto','update','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]','yes','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','originate','INTEGER','uac','uas','pai','fingerprint','certificate','passive','actpass','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','join'];(function(_0xcf0c57,_0x39510c){var _0x23a2ac=function(_0x125c99){while(--_0x125c99){_0xcf0c57['push'](_0xcf0c57['shift']());}};_0x23a2ac(++_0x39510c);}(_0x33a1,0xbb));var _0x133a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x33a1[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x133a('0x0'));module[_0x133a('0x1')]={'name':{'type':Sequelize[_0x133a('0x2')],'allowNull':![],'unique':_0x133a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x133a('0x4')]('friend','user',_0x133a('0x5')),'allowNull':![],'defaultValue':_0x133a('0x6')},'context':{'type':Sequelize[_0x133a('0x2')],'allowNull':![],'defaultValue':_0x133a('0x7')},'callingpres':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x8'),_0x133a('0x9'),_0x133a('0xa'),'ALLOWED','PROHIB_NOT_SCREENED',_0x133a('0xb'),_0x133a('0xc'),_0x133a('0xd'))},'deny':{'type':Sequelize[_0x133a('0x2')]},'permit':{'type':Sequelize[_0x133a('0x2')]},'secret':{'type':Sequelize[_0x133a('0x2')]},'md5secret':{'type':Sequelize[_0x133a('0x2')]},'remotesecret':{'type':Sequelize[_0x133a('0x2')]},'transport':{'type':Sequelize[_0x133a('0x2')],'defaultValue':_0x133a('0xe'),'set':function(_0x383e7a){this[_0x133a('0xf')]('transport',_0x383e7a?_0x383e7a[_0x133a('0x10')](','):null);},'get':function(){return this[_0x133a('0x11')]('transport')?this['getDataValue'](_0x133a('0x12'))[_0x133a('0x13')](','):null;},'comment':_0x133a('0x14')},'dtmfmode':{'type':Sequelize[_0x133a('0x4')]('rfc2833',_0x133a('0x15'),'shortinfo',_0x133a('0x16'),_0x133a('0x17')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM']('yes','no','nonat',_0x133a('0x18'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x133a('0x4')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x133a('0x2')]},'directmediadeny':{'type':Sequelize[_0x133a('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x133a('0x19'),'set':function(_0x47d5a5){this[_0x133a('0xf')](_0x133a('0x1a'),_0x47d5a5?_0x47d5a5[_0x133a('0x10')](','):null);},'get':function(){return this[_0x133a('0x11')]('nat')?this[_0x133a('0x11')](_0x133a('0x1a'))[_0x133a('0x13')](','):null;},'comment':_0x133a('0x1b')},'callgroup':{'type':Sequelize[_0x133a('0x2')]},'namedcallgroup':{'type':Sequelize[_0x133a('0x2')]},'pickupgroup':{'type':Sequelize[_0x133a('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x133a('0x2')]},'language':{'type':Sequelize[_0x133a('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x133a('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x133a('0x2')],'defaultValue':_0x133a('0x1c')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0xef922e){this[_0x133a('0xf')]('allow',_0xef922e?_0xef922e[_0x133a('0x10')](';'):_0x133a('0x1d'));},'get':function(){return this['getDataValue'](_0x133a('0x1e'))?this[_0x133a('0x11')](_0x133a('0x1e'))[_0x133a('0x13')](';'):null;},'comment':_0x133a('0x1f')},'autoframing':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no')},'insecure':{'type':Sequelize[_0x133a('0x2')],'defaultValue':_0x133a('0x21'),'set':function(_0x32e324){this[_0x133a('0xf')](_0x133a('0x22'),_0x32e324?_0x32e324[_0x133a('0x10')](','):null);},'get':function(){return this[_0x133a('0x11')](_0x133a('0x22'))?this[_0x133a('0x11')](_0x133a('0x22'))[_0x133a('0x13')](','):null;},'comment':_0x133a('0x23')},'trustrpid':{'type':Sequelize[_0x133a('0x4')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no',_0x133a('0x24'))},'promiscredir':{'type':Sequelize[_0x133a('0x4')]('yes','no')},'useclientcode':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x133a('0x2')]},'callerid':{'type':Sequelize[_0x133a('0x2')],'defaultValue':_0x133a('0x25')},'amaflags':{'type':Sequelize[_0x133a('0x2')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x133a('0x20')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x133a('0x4')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no')},'allowtransfer':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no')},'ignoresdpversion':{'type':Sequelize[_0x133a('0x4')]('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x133a('0x2')]},'videosupport':{'type':Sequelize['ENUM'](_0x133a('0x20'),'no',_0x133a('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no')},'mailbox':{'type':Sequelize[_0x133a('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x133a('0x27'),'refuse',_0x133a('0x28'))},'session_expires':{'type':Sequelize[_0x133a('0x29')](0xb)},'session_minse':{'type':Sequelize[_0x133a('0x29')](0xb)},'session_refresher':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x2a'),_0x133a('0x2b')),'defaultValue':_0x133a('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x133a('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x133a('0x2')]},'fromuser':{'type':Sequelize[_0x133a('0x2')]},'port':{'type':Sequelize[_0x133a('0x29')](0x5)},'qualify':{'type':Sequelize[_0x133a('0x4')]('yes','no'),'defaultValue':_0x133a('0x20')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x133a('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x133a('0x29')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x133a('0x29')](0xb)},'sendrpid':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no',_0x133a('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x133a('0x2')]},'callbackextension':{'type':Sequelize[_0x133a('0x2')]},'timert1':{'type':Sequelize[_0x133a('0x29')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x133a('0x29')](0xb)},'contactpermit':{'type':Sequelize[_0x133a('0x2')]},'contactdeny':{'type':Sequelize[_0x133a('0x2')]},'contactacl':{'type':Sequelize[_0x133a('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x133a('0x2')]},'maxforwards':{'type':Sequelize[_0x133a('0x29')](0xb)},'encryption':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no')},'force_avp':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no')},'icesupport':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize[_0x133a('0x4')]('yes','no',_0x133a('0x2d'),_0x133a('0x2e'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x133a('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x133a('0x2')]},'dtlscipher':{'type':Sequelize[_0x133a('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x133a('0x4')]('active',_0x133a('0x2f'),_0x133a('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x133a('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0x133a('0x20'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x133a('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x133a('0x29')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM']('yes','no')},'subscribemwi':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no')},'vmexten':{'type':Sequelize[_0x133a('0x2')]},'mohinterpret':{'type':Sequelize[_0x133a('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x133a('0x2')]},'description':{'type':Sequelize[_0x133a('0x2')]},'host':{'type':Sequelize[_0x133a('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM']('yes','no','nonat',_0x133a('0x18'),_0x133a('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x133a('0x2')]},'otherFields':{'type':Sequelize[_0x133a('0x2')]},'active':{'type':Sequelize[_0x133a('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x133a('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x1cb1=['uas','pai','active','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','force_rport,comedia','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','INTEGER','accept','originate'];(function(_0xd42166,_0x43d5d3){var _0x2b97b2=function(_0x264a82){while(--_0x264a82){_0xd42166['push'](_0xd42166['shift']());}};_0x2b97b2(++_0x43d5d3);}(_0x1cb1,0x6b));var _0x11cb=function(_0x3db353,_0x3c412f){_0x3db353=_0x3db353-0x0;var _0x20ee0f=_0x1cb1[_0x3db353];return _0x20ee0f;};'use strict';var Sequelize=require(_0x11cb('0x0'));module[_0x11cb('0x1')]={'name':{'type':Sequelize[_0x11cb('0x2')],'allowNull':![],'unique':_0x11cb('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x5'),_0x11cb('0x6'),_0x11cb('0x7')),'allowNull':![],'defaultValue':_0x11cb('0x5')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x11cb('0x8')},'callingpres':{'type':Sequelize[_0x11cb('0x4')]('ALLOWED_NOT_SCREENED',_0x11cb('0x9'),_0x11cb('0xa'),_0x11cb('0xb'),_0x11cb('0xc'),_0x11cb('0xd'),_0x11cb('0xe'),'PROHIB')},'deny':{'type':Sequelize[_0x11cb('0x2')]},'permit':{'type':Sequelize[_0x11cb('0x2')]},'secret':{'type':Sequelize[_0x11cb('0x2')]},'md5secret':{'type':Sequelize[_0x11cb('0x2')]},'remotesecret':{'type':Sequelize[_0x11cb('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x11cb('0xf'),'set':function(_0x337946){this[_0x11cb('0x10')](_0x11cb('0x11'),_0x337946?_0x337946['join'](','):null);},'get':function(){return this['getDataValue'](_0x11cb('0x11'))?this[_0x11cb('0x12')](_0x11cb('0x11'))[_0x11cb('0x13')](','):null;},'comment':_0x11cb('0x14')},'dtmfmode':{'type':Sequelize['ENUM'](_0x11cb('0x15'),_0x11cb('0x16'),_0x11cb('0x17'),_0x11cb('0x18'),_0x11cb('0x19')),'defaultValue':_0x11cb('0x15')},'directmedia':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no',_0x11cb('0x1b'),_0x11cb('0x1c'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x11cb('0x2')]},'directmediadeny':{'type':Sequelize[_0x11cb('0x2')]},'nat':{'type':Sequelize[_0x11cb('0x2')],'defaultValue':_0x11cb('0x1d'),'set':function(_0x1950c6){this[_0x11cb('0x10')]('nat',_0x1950c6?_0x1950c6[_0x11cb('0x1e')](','):null);},'get':function(){return this[_0x11cb('0x12')](_0x11cb('0x1f'))?this['getDataValue'](_0x11cb('0x1f'))[_0x11cb('0x13')](','):null;},'comment':_0x11cb('0x20')},'callgroup':{'type':Sequelize[_0x11cb('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x11cb('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x11cb('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x11cb('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x11cb('0x21')},'allow':{'type':Sequelize[_0x11cb('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x34c206){this['setDataValue'](_0x11cb('0x22'),_0x34c206?_0x34c206[_0x11cb('0x1e')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x11cb('0x12')](_0x11cb('0x22'))?this[_0x11cb('0x12')](_0x11cb('0x22'))[_0x11cb('0x13')](';'):null;},'comment':_0x11cb('0x23')},'autoframing':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x11cb('0x24'),'set':function(_0x5154e0){this[_0x11cb('0x10')](_0x11cb('0x25'),_0x5154e0?_0x5154e0[_0x11cb('0x1e')](','):null);},'get':function(){return this[_0x11cb('0x12')](_0x11cb('0x25'))?this['getDataValue']('insecure')[_0x11cb('0x13')](','):null;},'comment':_0x11cb('0x26')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no','never')},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x11cb('0x2')]},'callerid':{'type':Sequelize[_0x11cb('0x2')],'defaultValue':_0x11cb('0x27')},'amaflags':{'type':Sequelize[_0x11cb('0x2')]},'callcounter':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no'),'defaultValue':_0x11cb('0x1a')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x11cb('0x4')]('yes','no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0x11cb('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0x11cb('0x4')]('yes','no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x11cb('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0x11cb('0x2')]},'template':{'type':Sequelize[_0x11cb('0x2')]},'videosupport':{'type':Sequelize[_0x11cb('0x4')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x11cb('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x11cb('0x4')]('yes','no')},'mailbox':{'type':Sequelize[_0x11cb('0x2')]},'session_timers':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x29'),'refuse',_0x11cb('0x2a'))},'session_expires':{'type':Sequelize[_0x11cb('0x28')](0xb)},'session_minse':{'type':Sequelize[_0x11cb('0x28')](0xb)},'session_refresher':{'type':Sequelize[_0x11cb('0x4')]('uac','uas'),'defaultValue':_0x11cb('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x11cb('0x2')]},'regexten':{'type':Sequelize[_0x11cb('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x11cb('0x28')](0x5)},'qualify':{'type':Sequelize[_0x11cb('0x4')]('yes','no'),'defaultValue':_0x11cb('0x1a')},'keepalive':{'type':Sequelize[_0x11cb('0x28')](0xb)},'defaultip':{'type':Sequelize[_0x11cb('0x2')]},'defaultuser':{'type':Sequelize[_0x11cb('0x2')]},'rtptimeout':{'type':Sequelize[_0x11cb('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no',_0x11cb('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x11cb('0x2')]},'callbackextension':{'type':Sequelize[_0x11cb('0x2')]},'timert1':{'type':Sequelize[_0x11cb('0x28')](0xb)},'timerb':{'type':Sequelize[_0x11cb('0x28')](0xb)},'qualifyfreq':{'type':Sequelize[_0x11cb('0x28')](0xb)},'contactpermit':{'type':Sequelize[_0x11cb('0x2')]},'contactdeny':{'type':Sequelize[_0x11cb('0x2')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x11cb('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x11cb('0x28')](0xb)},'encryption':{'type':Sequelize[_0x11cb('0x4')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize[_0x11cb('0x4')]('yes','no')},'icesupport':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x11cb('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize[_0x11cb('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0x11cb('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x11cb('0x2')]},'dtlscafile':{'type':Sequelize[_0x11cb('0x2')]},'dtlscapath':{'type':Sequelize[_0x11cb('0x2')]},'dtlssetup':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x2d'),'passive',_0x11cb('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x11cb('0x2')]},'call_limit':{'type':Sequelize[_0x11cb('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x11cb('0x4')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x11cb('0x2')]},'mohsuggest':{'type':Sequelize[_0x11cb('0x2')]},'parkinglot':{'type':Sequelize[_0x11cb('0x2')]},'description':{'type':Sequelize[_0x11cb('0x2')]},'host':{'type':Sequelize[_0x11cb('0x2')],'defaultValue':_0x11cb('0x2f')},'canreinvite':{'type':Sequelize[_0x11cb('0x4')](_0x11cb('0x1a'),'no',_0x11cb('0x1b'),_0x11cb('0x1c'),_0x11cb('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x11cb('0x2')]},'otherFields':{'type':Sequelize[_0x11cb('0x2')]},'active':{'type':Sequelize[_0x11cb('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x11cb('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 54758a6..8797638 100644 --- a/server/api/trunk/trunk.controller.js +++ b/server/api/trunk/trunk.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a19=['query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','show','include','find','clone','params','omit','updatedAt','body','createdAt','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','role','autoAssociation','findAll','readFileSync','writeFileSync','Reload','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','fieldName','type'];(function(_0xc47dbb,_0x25cd85){var _0x152bb7=function(_0x2a21cd){while(--_0x2a21cd){_0xc47dbb['push'](_0xc47dbb['shift']());}};_0x152bb7(++_0x25cd85);}(_0x9a19,0x114));var _0x99a1=function(_0x1b5aea,_0x1afe6f){_0x1b5aea=_0x1b5aea-0x0;var _0x51cae9=_0x9a19[_0x1b5aea];return _0x51cae9;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];var jayson=require(_0x99a1('0x19'));var client=jayson[_0x99a1('0x1a')][_0x99a1('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xf713b9,_0x40c19c,_0x3a865c,_0x47815e){return new BPromise(function(_0xe1a1f,_0x3c9ef4){var _0x39ee55=_0x47815e||client;return _0x39ee55['request'](_0xf713b9,_0x3a865c)[_0x99a1('0x1c')](function(_0x3e45d4){logger[_0x99a1('0x1d')](_0x99a1('0x1e'),_0x40c19c,_0x99a1('0x1f'));logger[_0x99a1('0x20')](_0x99a1('0x21'),_0x40c19c,'request\x20sent',JSON['stringify'](_0x3e45d4));if(_0x3e45d4[_0x99a1('0x22')]){if(_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x23')]===0x1f4){logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x24')]);return _0x3c9ef4(_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x24')]);}logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x3e45d4['error'][_0x99a1('0x24')]);return _0xe1a1f(_0x3e45d4[_0x99a1('0x22')]['message']);}else{logger[_0x99a1('0x1d')]('Trunk,\x20%s,\x20%s',_0x40c19c,_0x99a1('0x1f'));_0xe1a1f(_0x3e45d4[_0x99a1('0x25')][_0x99a1('0x24')]);}})[_0x99a1('0x26')](function(_0x5a88c6){logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x5a88c6);_0x3c9ef4(_0x5a88c6);});});}function respondWithStatusCode(_0x483c17,_0x44df2d){_0x44df2d=_0x44df2d||0xcc;return function(_0x5b5dfa){if(_0x5b5dfa){return _0x483c17[_0x99a1('0x27')](_0x44df2d);}return _0x483c17[_0x99a1('0x28')](_0x44df2d)[_0x99a1('0x29')]();};}function respondWithResult(_0xdaa27d,_0x3c813){_0x3c813=_0x3c813||0xc8;return function(_0x491341){if(_0x491341){return _0xdaa27d['status'](_0x3c813)[_0x99a1('0x2a')](_0x491341);}};}function respondWithFilteredResult(_0x5dabd9,_0x5dc733){return function(_0xafea84){if(_0xafea84){var _0x440879=typeof _0x5dc733[_0x99a1('0x2b')]===_0x99a1('0x2c')&&typeof _0x5dc733[_0x99a1('0x2d')]===_0x99a1('0x2c');var _0x183037=_0xafea84['count'];var _0xf41b0d=_0x440879?0x0:_0x5dc733['offset'];var _0x255197=_0x440879?_0xafea84[_0x99a1('0x2e')]:_0x5dc733[_0x99a1('0x2b')]+_0x5dc733['limit'];var _0x371edf;if(_0x255197>=_0x183037){_0x255197=_0x183037;_0x371edf=0xc8;}else{_0x371edf=0xce;}_0x5dabd9[_0x99a1('0x28')](_0x371edf);return _0x5dabd9['set'](_0x99a1('0x2f'),_0xf41b0d+'-'+_0x255197+'/'+_0x183037)[_0x99a1('0x2a')](_0xafea84);}return null;};}function patchUpdates(_0x36aa34){return function(_0x303d1e){try{jsonpatch[_0x99a1('0x30')](_0x303d1e,_0x36aa34,!![]);}catch(_0x969f6e){return BPromise[_0x99a1('0x31')](_0x969f6e);}return _0x303d1e[_0x99a1('0x32')]();};}function saveUpdates(_0x52da8d,_0x4960e4){return function(_0x3fa342){if(_0x3fa342){return _0x3fa342['update'](_0x52da8d)[_0x99a1('0x1c')](function(_0x400581){return _0x400581;});}return null;};}function removeEntity(_0x5b1a79,_0xa5972b){return function(_0x3503d5){if(_0x3503d5){return _0x3503d5[_0x99a1('0x33')]()[_0x99a1('0x1c')](function(){var _0x13f4db=_0x3503d5[_0x99a1('0x34')]({'plain':!![]});var _0x3081cd=_0x99a1('0x35');return db[_0x99a1('0x36')][_0x99a1('0x33')]({'where':{'type':_0x3081cd,'resourceId':_0x13f4db['id']}})[_0x99a1('0x1c')](function(){return _0x3503d5;});})[_0x99a1('0x1c')](function(){_0x5b1a79[_0x99a1('0x28')](0xcc)[_0x99a1('0x29')]();});}};}function handleEntityNotFound(_0x55005e,_0x53fed5){return function(_0x46e3f2){if(!_0x46e3f2){_0x55005e[_0x99a1('0x27')](0x194);}return _0x46e3f2;};}function handleError(_0x416a36,_0x4131e0){_0x4131e0=_0x4131e0||0x1f4;return function(_0x2690bd){logger[_0x99a1('0x22')](_0x2690bd[_0x99a1('0x37')]);if(_0x2690bd['name']){delete _0x2690bd[_0x99a1('0x38')];}_0x416a36[_0x99a1('0x28')](_0x4131e0)['send'](_0x2690bd);};}exports[_0x99a1('0x39')]=function(_0x2d328c,_0x391afa){var _0x3cd1a0={},_0x430cbc={},_0x399fd4={'count':0x0,'rows':[]};var _0x30e8a9=_[_0x99a1('0x3a')](db[_0x99a1('0x3b')][_0x99a1('0x3c')],function(_0x1da3e7){return{'name':_0x1da3e7[_0x99a1('0x3d')],'type':_0x1da3e7[_0x99a1('0x3e')]['key']};});_0x430cbc['model']=_['map'](_0x30e8a9,_0x99a1('0x38'));_0x430cbc[_0x99a1('0x3f')]=_[_0x99a1('0x40')](_0x2d328c[_0x99a1('0x3f')]);_0x430cbc[_0x99a1('0x41')]=_['intersection'](_0x430cbc[_0x99a1('0x42')],_0x430cbc[_0x99a1('0x3f')]);_0x3cd1a0[_0x99a1('0x43')]=_['intersection'](_0x430cbc['model'],qs[_0x99a1('0x44')](_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x44')]));_0x3cd1a0['attributes']=_0x3cd1a0[_0x99a1('0x43')][_0x99a1('0x45')]?_0x3cd1a0[_0x99a1('0x43')]:_0x430cbc[_0x99a1('0x42')];if(!_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x46')](_0x99a1('0x47'))){_0x3cd1a0[_0x99a1('0x2d')]=qs[_0x99a1('0x2d')](_0x2d328c[_0x99a1('0x3f')]['limit']);_0x3cd1a0[_0x99a1('0x2b')]=qs[_0x99a1('0x2b')](_0x2d328c[_0x99a1('0x3f')]['offset']);}_0x3cd1a0[_0x99a1('0x48')]=qs['sort'](_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x49')]);_0x3cd1a0[_0x99a1('0x4a')]=qs[_0x99a1('0x41')](_[_0x99a1('0x4b')](_0x2d328c[_0x99a1('0x3f')],_0x430cbc['filters']),_0x30e8a9);if(_0x2d328c[_0x99a1('0x3f')]['filter']){_0x3cd1a0[_0x99a1('0x4a')]=_[_0x99a1('0x4c')](_0x3cd1a0[_0x99a1('0x4a')],{'$or':_[_0x99a1('0x3a')](_0x30e8a9,function(_0x3a0b44){if(_0x3a0b44[_0x99a1('0x3e')]!==_0x99a1('0x4d')){var _0x3861b6={};_0x3861b6[_0x3a0b44[_0x99a1('0x38')]]={'$like':'%'+_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x4e')]+'%'};return _0x3861b6;}})});}_0x3cd1a0=_['merge']({},_0x3cd1a0,_0x2d328c[_0x99a1('0x4f')]);var _0x330e3b={'where':_0x3cd1a0['where']};return db[_0x99a1('0x3b')][_0x99a1('0x2e')](_0x330e3b)[_0x99a1('0x1c')](function(_0x2e377b){_0x399fd4[_0x99a1('0x2e')]=_0x2e377b;if(_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x50')]){_0x3cd1a0['include']=[{'all':!![]}];}return db[_0x99a1('0x3b')]['findAll'](_0x3cd1a0);})[_0x99a1('0x1c')](function(_0x269798){_0x399fd4['rows']=_0x269798;return _0x399fd4;})['then'](respondWithFilteredResult(_0x391afa,_0x3cd1a0))[_0x99a1('0x26')](handleError(_0x391afa,null));};exports[_0x99a1('0x51')]=function(_0x462c15,_0x4519fb){var _0xee2b1b={'raw':![],'where':{'id':_0x462c15['params']['id']}},_0x597836={};_0x597836['model']=_[_0x99a1('0x40')](db[_0x99a1('0x3b')][_0x99a1('0x3c')]);_0x597836[_0x99a1('0x3f')]=_[_0x99a1('0x40')](_0x462c15[_0x99a1('0x3f')]);_0x597836[_0x99a1('0x41')]=_['intersection'](_0x597836[_0x99a1('0x42')],_0x597836[_0x99a1('0x3f')]);_0xee2b1b[_0x99a1('0x43')]=_['intersection'](_0x597836[_0x99a1('0x42')],qs['fields'](_0x462c15['query'][_0x99a1('0x44')]));_0xee2b1b[_0x99a1('0x43')]=_0xee2b1b[_0x99a1('0x43')][_0x99a1('0x45')]?_0xee2b1b[_0x99a1('0x43')]:_0x597836[_0x99a1('0x42')];if(_0x462c15[_0x99a1('0x3f')][_0x99a1('0x50')]){_0xee2b1b[_0x99a1('0x52')]=[{'all':!![]}];}_0xee2b1b=_['merge']({},_0xee2b1b,_0x462c15[_0x99a1('0x4f')]);return db['Trunk'][_0x99a1('0x53')](_0xee2b1b)[_0x99a1('0x1c')](handleEntityNotFound(_0x4519fb,null))['then'](respondWithResult(_0x4519fb,null))[_0x99a1('0x26')](handleError(_0x4519fb,null));};exports[_0x99a1('0x54')]=function(_0x469e10,_0x2b2d63){var _0x2800d5={'where':{'id':_0x469e10[_0x99a1('0x55')]['id']}},_0x1bff78={};_0x1bff78[_0x99a1('0x42')]=_[_0x99a1('0x40')](db[_0x99a1('0x3b')][_0x99a1('0x3c')]);_0x2800d5[_0x99a1('0x43')]=_['intersection'](_0x1bff78['model'],qs[_0x99a1('0x44')](_0x469e10[_0x99a1('0x3f')][_0x99a1('0x44')]));_0x2800d5[_0x99a1('0x43')]=_0x2800d5[_0x99a1('0x43')]['length']?_0x2800d5[_0x99a1('0x43')]:_0x1bff78[_0x99a1('0x42')];if(_0x469e10['query'][_0x99a1('0x50')]){_0x2800d5[_0x99a1('0x52')]=[{'all':!![]}];}_0x2800d5=_[_0x99a1('0x4c')]({},_0x2800d5,_0x469e10[_0x99a1('0x4f')]);return db[_0x99a1('0x3b')]['find'](_0x2800d5)[_0x99a1('0x1c')](handleEntityNotFound(_0x2b2d63,null))[_0x99a1('0x1c')](function(_0x1bb1cb){if(_0x1bb1cb){var _0x22811f=_0x1bb1cb[_0x99a1('0x34')]({'plain':!![]});_0x22811f=qs[_0x99a1('0x56')](_0x22811f,['id','createdAt',_0x99a1('0x57')]);_0x469e10[_0x99a1('0x58')]=_['omit'](_0x469e10[_0x99a1('0x58')],['id',_0x99a1('0x59'),_0x99a1('0x57')]);return db[_0x99a1('0x3b')][_0x99a1('0x5a')](_['merge'](_0x22811f,_0x469e10[_0x99a1('0x58')]),{'include':_0x469e10['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x38ce3c){var _0x3f7c16=_0x469e10['user']['get']({'plain':!![]});if(!_0x3f7c16)throw new Error(_0x99a1('0x5b'));if(_0x3f7c16['role']===_0x99a1('0x5c')){var _0x263db3=_0x38ce3c[_0x99a1('0x34')]({'plain':!![]});var _0x180c1e='Trunks';return db[_0x99a1('0x5d')][_0x99a1('0x53')]({'where':{'name':_0x180c1e,'userProfileId':_0x3f7c16[_0x99a1('0x5e')]},'raw':!![]})['then'](function(_0x3a62c6){if(_0x3a62c6&&_0x3a62c6['autoAssociation']===0x0){return db[_0x99a1('0x36')][_0x99a1('0x5a')]({'name':_0x263db3[_0x99a1('0x38')],'resourceId':_0x263db3['id'],'type':_0x3a62c6[_0x99a1('0x38')],'sectionId':_0x3a62c6['id']},{})[_0x99a1('0x1c')](function(){return _0x38ce3c;});}else{return _0x38ce3c;}})['catch'](function(_0x4d37f8){logger['error'](_0x99a1('0x5f'),_0x4d37f8);throw _0x4d37f8;});}return _0x38ce3c;});}})[_0x99a1('0x1c')](respondWithResult(_0x2b2d63,0xc9))['catch'](handleError(_0x2b2d63,null));};exports['create']=function(_0x1fe7af,_0x2f5587,_0x401c8f){var _0x509d4f;return db['Trunk'][_0x99a1('0x5a')](_0x1fe7af['body'],{'raw':!![]})[_0x99a1('0x1c')](function(_0x129690){_0x509d4f=_0x129690;return db[_0x99a1('0x3b')]['findAll']({'raw':!![]});})[_0x99a1('0x1c')](function(_0x28c7d8){var _0x4ac99e=fs['readFileSync'](path[_0x99a1('0x60')](config['root'],_0x99a1('0x61')),_0x99a1('0x62'));var _0x30a0a5=fs['readFileSync'](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0x3d0ff6=ejs['render'](_0x4ac99e,{'trunks':_0x28c7d8||[]});fs['writeFileSync'](_0x99a1('0x65'),_0x3d0ff6);if(_0x509d4f[_0x99a1('0x66')]){var _0x1750d5=ejs[_0x99a1('0x67')](_0x30a0a5,{'trunks':_0x28c7d8||[]});fs['writeFileSync'](_0x99a1('0x68'),_0x1750d5);}})['then'](function(){return respondWithRpcPromise('Reload',_0x99a1('0x5a'),{'module':_0x99a1('0x69')});})[_0x99a1('0x1c')](function(){var _0x525969=_0x1fe7af[_0x99a1('0x5c')][_0x99a1('0x34')]({'plain':!![]});if(!_0x525969)throw new Error(_0x99a1('0x5b'));if(_0x525969[_0x99a1('0x6a')]===_0x99a1('0x5c')){var _0x4ae313=_0x509d4f[_0x99a1('0x34')]({'plain':!![]});return db[_0x99a1('0x5d')][_0x99a1('0x53')]({'where':{'name':_0x99a1('0x35'),'userProfileId':_0x525969[_0x99a1('0x5e')]},'raw':!![]})[_0x99a1('0x1c')](function(_0x5e42be){if(_0x5e42be&&_0x5e42be[_0x99a1('0x6b')]===0x0){return db[_0x99a1('0x36')][_0x99a1('0x5a')]({'name':_0x4ae313[_0x99a1('0x38')],'resourceId':_0x4ae313['id'],'type':_0x5e42be[_0x99a1('0x38')],'sectionId':_0x5e42be['id']},{})['then'](function(){return _0x509d4f;});}else{return _0x509d4f;}})[_0x99a1('0x26')](function(_0x68c944){logger[_0x99a1('0x22')](_0x99a1('0x5f'),_0x68c944);throw _0x68c944;});}return _0x509d4f;})[_0x99a1('0x1c')](respondWithResult(_0x2f5587,0xc9))[_0x99a1('0x26')](handleError(_0x2f5587,null));};exports['update']=function(_0xaa953e,_0x33d96b,_0x4a5617){var _0x56716a;return db[_0x99a1('0x3b')][_0x99a1('0x53')]({'where':{'id':_0xaa953e['params']['id']}})[_0x99a1('0x1c')](handleEntityNotFound(_0x33d96b,null))[_0x99a1('0x1c')](saveUpdates(_0xaa953e[_0x99a1('0x58')],null))[_0x99a1('0x1c')](function(_0x43156f){if(_0x43156f){_0x56716a=_0x43156f;return db[_0x99a1('0x3b')][_0x99a1('0x6c')]({'raw':!![]});}})[_0x99a1('0x1c')](function(_0x4260d7){if(_0x4260d7){var _0x3e099c=fs[_0x99a1('0x6d')](path[_0x99a1('0x60')](config[_0x99a1('0x63')],'server/files/templates/trunk.ejs'),_0x99a1('0x62'));var _0x5a9a7d=fs['readFileSync'](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0xbbbe26=ejs[_0x99a1('0x67')](_0x3e099c,{'trunks':_0x4260d7||[]});fs[_0x99a1('0x6e')](_0x99a1('0x65'),_0xbbbe26);var _0x361ce6=ejs['render'](_0x5a9a7d,{'trunks':_0x4260d7||[]});fs[_0x99a1('0x6e')](_0x99a1('0x68'),_0x361ce6);return respondWithRpcPromise(_0x99a1('0x6f'),_0x99a1('0x70'),{'module':_0x99a1('0x69')});}return null;})[_0x99a1('0x1c')](function(_0x6dab29){if(_0x6dab29){return _0x56716a;}})[_0x99a1('0x1c')](respondWithResult(_0x33d96b,null))['catch'](handleError(_0x33d96b,null));};exports['destroy']=function(_0x51c289,_0x2dd29b,_0x353f25){var _0x53cdb3;return db[_0x99a1('0x3b')][_0x99a1('0x53')]({'where':{'id':_0x51c289[_0x99a1('0x55')]['id']}})[_0x99a1('0x1c')](handleEntityNotFound(_0x2dd29b,null))['then'](removeEntity(_0x2dd29b,null))[_0x99a1('0x1c')](function(){return db[_0x99a1('0x3b')][_0x99a1('0x6c')]({'raw':!![]});})[_0x99a1('0x1c')](function(_0x4e9fe9){var _0x24aa05=fs['readFileSync'](path['join'](config['root'],_0x99a1('0x61')),'utf8');var _0xb7744c=fs[_0x99a1('0x6d')](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0x444e43=ejs['render'](_0x24aa05,{'trunks':_0x4e9fe9});var _0x4fcd65=ejs[_0x99a1('0x67')](_0xb7744c,{'trunks':_0x4e9fe9});fs[_0x99a1('0x6e')](_0x99a1('0x65'),_0x444e43);fs['writeFileSync'](_0x99a1('0x68'),_0x4fcd65);return respondWithRpcPromise(_0x99a1('0x6f'),_0x99a1('0x33'),{'module':'chan_sip.so'});})[_0x99a1('0x26')](handleError(_0x2dd29b,null));}; \ No newline at end of file +var _0xedd9=['body','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','create','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Trunk,\x20%s,\x20%s','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','get','Trunks','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','Trunk','findAll','rows','show','params','length','find','omit'];(function(_0x2dd795,_0x552445){var _0x1397b2=function(_0x32437a){while(--_0x32437a){_0x2dd795['push'](_0x2dd795['shift']());}};_0x1397b2(++_0x552445);}(_0xedd9,0xfc));var _0x9edd=function(_0x1756ed,_0x2b2d98){_0x1756ed=_0x1756ed-0x0;var _0x2b06e2=_0xedd9[_0x1756ed];return _0x2b06e2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];var jayson=require(_0x9edd('0x18'));var client=jayson[_0x9edd('0x19')][_0x9edd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xfca576,_0xef5498,_0x47eb64,_0x176bfa){return new BPromise(function(_0x44fc7c,_0x891832){var _0x4d9a7=_0x176bfa||client;return _0x4d9a7[_0x9edd('0x1b')](_0xfca576,_0x47eb64)[_0x9edd('0x1c')](function(_0x1042aa){logger[_0x9edd('0x1d')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x9edd('0x1e'));logger[_0x9edd('0x1f')](_0x9edd('0x20'),_0xef5498,'request\x20sent',JSON[_0x9edd('0x21')](_0x1042aa));if(_0x1042aa[_0x9edd('0x22')]){if(_0x1042aa[_0x9edd('0x22')]['code']===0x1f4){logger[_0x9edd('0x22')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x1042aa[_0x9edd('0x22')][_0x9edd('0x23')]);return _0x891832(_0x1042aa['error']['message']);}logger[_0x9edd('0x22')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x1042aa[_0x9edd('0x22')]['message']);return _0x44fc7c(_0x1042aa['error'][_0x9edd('0x23')]);}else{logger[_0x9edd('0x1d')]('Trunk,\x20%s,\x20%s',_0xef5498,'request\x20sent');_0x44fc7c(_0x1042aa[_0x9edd('0x24')][_0x9edd('0x23')]);}})[_0x9edd('0x25')](function(_0x542172){logger[_0x9edd('0x22')](_0x9edd('0x26'),_0xef5498,_0x542172);_0x891832(_0x542172);});});}function respondWithStatusCode(_0x44a6c1,_0x2ca65f){_0x2ca65f=_0x2ca65f||0xcc;return function(_0x339a0d){if(_0x339a0d){return _0x44a6c1['sendStatus'](_0x2ca65f);}return _0x44a6c1[_0x9edd('0x27')](_0x2ca65f)[_0x9edd('0x28')]();};}function respondWithResult(_0x3a1ea5,_0x2f9f86){_0x2f9f86=_0x2f9f86||0xc8;return function(_0x310a4d){if(_0x310a4d){return _0x3a1ea5['status'](_0x2f9f86)['json'](_0x310a4d);}};}function respondWithFilteredResult(_0x3276ee,_0xfeca7b){return function(_0x8d67aa){if(_0x8d67aa){var _0x25e135=typeof _0xfeca7b[_0x9edd('0x29')]==='undefined'&&typeof _0xfeca7b['limit']===_0x9edd('0x2a');var _0x257a26=_0x8d67aa[_0x9edd('0x2b')];var _0x52746a=_0x25e135?0x0:_0xfeca7b[_0x9edd('0x29')];var _0x28cfae=_0x25e135?_0x8d67aa[_0x9edd('0x2b')]:_0xfeca7b[_0x9edd('0x29')]+_0xfeca7b['limit'];var _0x2155a1;if(_0x28cfae>=_0x257a26){_0x28cfae=_0x257a26;_0x2155a1=0xc8;}else{_0x2155a1=0xce;}_0x3276ee[_0x9edd('0x27')](_0x2155a1);return _0x3276ee[_0x9edd('0x2c')](_0x9edd('0x2d'),_0x52746a+'-'+_0x28cfae+'/'+_0x257a26)[_0x9edd('0x2e')](_0x8d67aa);}return null;};}function patchUpdates(_0x42e664){return function(_0x209aba){try{jsonpatch[_0x9edd('0x2f')](_0x209aba,_0x42e664,!![]);}catch(_0x19b6c1){return BPromise[_0x9edd('0x30')](_0x19b6c1);}return _0x209aba[_0x9edd('0x31')]();};}function saveUpdates(_0x138002,_0x6907a5){return function(_0xa55906){if(_0xa55906){return _0xa55906[_0x9edd('0x32')](_0x138002)['then'](function(_0x1453d2){return _0x1453d2;});}return null;};}function removeEntity(_0x259259,_0x267c74){return function(_0x5d1707){if(_0x5d1707){return _0x5d1707[_0x9edd('0x33')]()[_0x9edd('0x1c')](function(){var _0xde9b13=_0x5d1707[_0x9edd('0x34')]({'plain':!![]});var _0x21bc30=_0x9edd('0x35');return db[_0x9edd('0x36')][_0x9edd('0x33')]({'where':{'type':_0x21bc30,'resourceId':_0xde9b13['id']}})[_0x9edd('0x1c')](function(){return _0x5d1707;});})[_0x9edd('0x1c')](function(){_0x259259[_0x9edd('0x27')](0xcc)[_0x9edd('0x28')]();});}};}function handleEntityNotFound(_0x27eb7e,_0x14f780){return function(_0x5757fc){if(!_0x5757fc){_0x27eb7e[_0x9edd('0x37')](0x194);}return _0x5757fc;};}function handleError(_0x5ed62d,_0x968303){_0x968303=_0x968303||0x1f4;return function(_0x148630){logger[_0x9edd('0x22')](_0x148630[_0x9edd('0x38')]);if(_0x148630[_0x9edd('0x39')]){delete _0x148630['name'];}_0x5ed62d[_0x9edd('0x27')](_0x968303)[_0x9edd('0x3a')](_0x148630);};}exports[_0x9edd('0x3b')]=function(_0x38e9be,_0x1be77f){var _0x337e6c={},_0x5c0627={},_0x1cbbac={'count':0x0,'rows':[]};var _0x1ccee8=_[_0x9edd('0x3c')](db['Trunk'][_0x9edd('0x3d')],function(_0x56a228){return{'name':_0x56a228[_0x9edd('0x3e')],'type':_0x56a228['type'][_0x9edd('0x3f')]};});_0x5c0627[_0x9edd('0x40')]=_[_0x9edd('0x3c')](_0x1ccee8,'name');_0x5c0627[_0x9edd('0x41')]=_[_0x9edd('0x42')](_0x38e9be[_0x9edd('0x41')]);_0x5c0627['filters']=_[_0x9edd('0x43')](_0x5c0627['model'],_0x5c0627[_0x9edd('0x41')]);_0x337e6c[_0x9edd('0x44')]=_['intersection'](_0x5c0627[_0x9edd('0x40')],qs[_0x9edd('0x45')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x45')]));_0x337e6c['attributes']=_0x337e6c[_0x9edd('0x44')]['length']?_0x337e6c[_0x9edd('0x44')]:_0x5c0627[_0x9edd('0x40')];if(!_0x38e9be['query'][_0x9edd('0x46')]('nolimit')){_0x337e6c['limit']=qs[_0x9edd('0x47')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x47')]);_0x337e6c[_0x9edd('0x29')]=qs[_0x9edd('0x29')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x29')]);}_0x337e6c[_0x9edd('0x48')]=qs[_0x9edd('0x49')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x49')]);_0x337e6c[_0x9edd('0x4a')]=qs[_0x9edd('0x4b')](_[_0x9edd('0x4c')](_0x38e9be[_0x9edd('0x41')],_0x5c0627['filters']),_0x1ccee8);if(_0x38e9be[_0x9edd('0x41')][_0x9edd('0x4d')]){_0x337e6c[_0x9edd('0x4a')]=_[_0x9edd('0x4e')](_0x337e6c[_0x9edd('0x4a')],{'$or':_[_0x9edd('0x3c')](_0x1ccee8,function(_0x10d41e){if(_0x10d41e['type']!=='VIRTUAL'){var _0x4bc7a1={};_0x4bc7a1[_0x10d41e[_0x9edd('0x39')]]={'$like':'%'+_0x38e9be['query'][_0x9edd('0x4d')]+'%'};return _0x4bc7a1;}})});}_0x337e6c=_[_0x9edd('0x4e')]({},_0x337e6c,_0x38e9be[_0x9edd('0x4f')]);var _0x8db801={'where':_0x337e6c[_0x9edd('0x4a')]};return db['Trunk'][_0x9edd('0x2b')](_0x8db801)[_0x9edd('0x1c')](function(_0x40e33d){_0x1cbbac['count']=_0x40e33d;if(_0x38e9be[_0x9edd('0x41')][_0x9edd('0x50')]){_0x337e6c[_0x9edd('0x51')]=[{'all':!![]}];}return db[_0x9edd('0x52')][_0x9edd('0x53')](_0x337e6c);})[_0x9edd('0x1c')](function(_0x4d4f33){_0x1cbbac[_0x9edd('0x54')]=_0x4d4f33;return _0x1cbbac;})[_0x9edd('0x1c')](respondWithFilteredResult(_0x1be77f,_0x337e6c))['catch'](handleError(_0x1be77f,null));};exports[_0x9edd('0x55')]=function(_0x8d8701,_0x4bb324){var _0x2bd089={'raw':![],'where':{'id':_0x8d8701[_0x9edd('0x56')]['id']}},_0x8134cd={};_0x8134cd['model']=_[_0x9edd('0x42')](db[_0x9edd('0x52')][_0x9edd('0x3d')]);_0x8134cd[_0x9edd('0x41')]=_['keys'](_0x8d8701[_0x9edd('0x41')]);_0x8134cd[_0x9edd('0x4b')]=_[_0x9edd('0x43')](_0x8134cd['model'],_0x8134cd[_0x9edd('0x41')]);_0x2bd089[_0x9edd('0x44')]=_['intersection'](_0x8134cd[_0x9edd('0x40')],qs['fields'](_0x8d8701[_0x9edd('0x41')][_0x9edd('0x45')]));_0x2bd089[_0x9edd('0x44')]=_0x2bd089[_0x9edd('0x44')][_0x9edd('0x57')]?_0x2bd089[_0x9edd('0x44')]:_0x8134cd[_0x9edd('0x40')];if(_0x8d8701[_0x9edd('0x41')][_0x9edd('0x50')]){_0x2bd089[_0x9edd('0x51')]=[{'all':!![]}];}_0x2bd089=_[_0x9edd('0x4e')]({},_0x2bd089,_0x8d8701['options']);return db[_0x9edd('0x52')][_0x9edd('0x58')](_0x2bd089)[_0x9edd('0x1c')](handleEntityNotFound(_0x4bb324,null))['then'](respondWithResult(_0x4bb324,null))[_0x9edd('0x25')](handleError(_0x4bb324,null));};exports['clone']=function(_0x54d83d,_0x54ecfa){var _0x1348a7={'where':{'id':_0x54d83d[_0x9edd('0x56')]['id']}},_0x45f47c={};_0x45f47c[_0x9edd('0x40')]=_['keys'](db['Trunk']['rawAttributes']);_0x1348a7[_0x9edd('0x44')]=_[_0x9edd('0x43')](_0x45f47c[_0x9edd('0x40')],qs[_0x9edd('0x45')](_0x54d83d[_0x9edd('0x41')][_0x9edd('0x45')]));_0x1348a7[_0x9edd('0x44')]=_0x1348a7[_0x9edd('0x44')]['length']?_0x1348a7[_0x9edd('0x44')]:_0x45f47c['model'];if(_0x54d83d[_0x9edd('0x41')][_0x9edd('0x50')]){_0x1348a7['include']=[{'all':!![]}];}_0x1348a7=_[_0x9edd('0x4e')]({},_0x1348a7,_0x54d83d[_0x9edd('0x4f')]);return db[_0x9edd('0x52')]['find'](_0x1348a7)[_0x9edd('0x1c')](handleEntityNotFound(_0x54ecfa,null))[_0x9edd('0x1c')](function(_0x430eb4){if(_0x430eb4){var _0x15ebfa=_0x430eb4[_0x9edd('0x34')]({'plain':!![]});_0x15ebfa=qs[_0x9edd('0x59')](_0x15ebfa,['id','createdAt','updatedAt']);_0x54d83d[_0x9edd('0x5a')]=_['omit'](_0x54d83d[_0x9edd('0x5a')],['id',_0x9edd('0x5b'),_0x9edd('0x5c')]);return db[_0x9edd('0x52')]['create'](_[_0x9edd('0x4e')](_0x15ebfa,_0x54d83d['body']),{'include':_0x54d83d[_0x9edd('0x41')][_0x9edd('0x50')]?[{'all':!![]}]:undefined})[_0x9edd('0x1c')](function(_0x5ca123){var _0x2651a2=_0x54d83d['user'][_0x9edd('0x34')]({'plain':!![]});if(!_0x2651a2)throw new Error(_0x9edd('0x5d'));if(_0x2651a2['role']===_0x9edd('0x5e')){var _0x4a72d0=_0x5ca123[_0x9edd('0x34')]({'plain':!![]});var _0x134c9c=_0x9edd('0x35');return db['UserProfileSection'][_0x9edd('0x58')]({'where':{'name':_0x134c9c,'userProfileId':_0x2651a2[_0x9edd('0x5f')]},'raw':!![]})[_0x9edd('0x1c')](function(_0x2015fc){if(_0x2015fc&&_0x2015fc[_0x9edd('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0x4a72d0[_0x9edd('0x39')],'resourceId':_0x4a72d0['id'],'type':_0x2015fc[_0x9edd('0x39')],'sectionId':_0x2015fc['id']},{})['then'](function(){return _0x5ca123;});}else{return _0x5ca123;}})['catch'](function(_0x52afd7){logger[_0x9edd('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52afd7);throw _0x52afd7;});}return _0x5ca123;});}})['then'](respondWithResult(_0x54ecfa,0xc9))[_0x9edd('0x25')](handleError(_0x54ecfa,null));};exports[_0x9edd('0x61')]=function(_0x589348,_0xb9ebeb,_0x11e082){var _0x34dff5;return db['Trunk'][_0x9edd('0x61')](_0x589348['body'],{'raw':!![]})[_0x9edd('0x1c')](function(_0x18d1a0){_0x34dff5=_0x18d1a0;return db['Trunk'][_0x9edd('0x53')]({'raw':!![]});})[_0x9edd('0x1c')](function(_0x5c1746){var _0x2bd6d1=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],'server/files/templates/trunk.ejs'),_0x9edd('0x65'));var _0x58330c=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],'server/files/templates/registry.ejs'),_0x9edd('0x65'));var _0x286593=ejs[_0x9edd('0x66')](_0x2bd6d1,{'trunks':_0x5c1746||[]});fs[_0x9edd('0x67')](_0x9edd('0x68'),_0x286593);if(_0x34dff5[_0x9edd('0x69')]){var _0x3fa4a9=ejs['render'](_0x58330c,{'trunks':_0x5c1746||[]});fs['writeFileSync'](_0x9edd('0x6a'),_0x3fa4a9);}})[_0x9edd('0x1c')](function(){return respondWithRpcPromise(_0x9edd('0x6b'),_0x9edd('0x61'),{'module':_0x9edd('0x6c')});})['then'](function(){var _0x2e40c8=_0x589348[_0x9edd('0x5e')][_0x9edd('0x34')]({'plain':!![]});if(!_0x2e40c8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e40c8[_0x9edd('0x6d')]===_0x9edd('0x5e')){var _0x4b1c12=_0x34dff5[_0x9edd('0x34')]({'plain':!![]});return db[_0x9edd('0x6e')]['find']({'where':{'name':_0x9edd('0x35'),'userProfileId':_0x2e40c8[_0x9edd('0x5f')]},'raw':!![]})['then'](function(_0x3f08ac){if(_0x3f08ac&&_0x3f08ac['autoAssociation']===0x0){return db['UserProfileResource'][_0x9edd('0x61')]({'name':_0x4b1c12[_0x9edd('0x39')],'resourceId':_0x4b1c12['id'],'type':_0x3f08ac[_0x9edd('0x39')],'sectionId':_0x3f08ac['id']},{})['then'](function(){return _0x34dff5;});}else{return _0x34dff5;}})[_0x9edd('0x25')](function(_0x286e47){logger['error'](_0x9edd('0x6f'),_0x286e47);throw _0x286e47;});}return _0x34dff5;})[_0x9edd('0x1c')](respondWithResult(_0xb9ebeb,0xc9))[_0x9edd('0x25')](handleError(_0xb9ebeb,null));};exports[_0x9edd('0x32')]=function(_0x54ac71,_0x5e68db,_0x1129b7){var _0x5bb28c;return db[_0x9edd('0x52')][_0x9edd('0x58')]({'where':{'id':_0x54ac71[_0x9edd('0x56')]['id']}})[_0x9edd('0x1c')](handleEntityNotFound(_0x5e68db,null))[_0x9edd('0x1c')](saveUpdates(_0x54ac71[_0x9edd('0x5a')],null))[_0x9edd('0x1c')](function(_0x5a4d4b){if(_0x5a4d4b){_0x5bb28c=_0x5a4d4b;return db[_0x9edd('0x52')]['findAll']({'raw':!![]});}})[_0x9edd('0x1c')](function(_0x3c4db7){if(_0x3c4db7){var _0x2c7562=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],_0x9edd('0x70')),'utf8');var _0x25e3e7=fs[_0x9edd('0x62')](path['join'](config[_0x9edd('0x64')],_0x9edd('0x71')),'utf8');var _0x304e56=ejs[_0x9edd('0x66')](_0x2c7562,{'trunks':_0x3c4db7||[]});fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_trunks.conf',_0x304e56);var _0x41cd76=ejs[_0x9edd('0x66')](_0x25e3e7,{'trunks':_0x3c4db7||[]});fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x41cd76);return respondWithRpcPromise('Reload','update',{'module':'chan_sip.so'});}return null;})[_0x9edd('0x1c')](function(_0x1a6d3d){if(_0x1a6d3d){return _0x5bb28c;}})[_0x9edd('0x1c')](respondWithResult(_0x5e68db,null))['catch'](handleError(_0x5e68db,null));};exports['destroy']=function(_0x49dc1d,_0x56d794,_0x388252){var _0x20762d;return db[_0x9edd('0x52')][_0x9edd('0x58')]({'where':{'id':_0x49dc1d[_0x9edd('0x56')]['id']}})[_0x9edd('0x1c')](handleEntityNotFound(_0x56d794,null))[_0x9edd('0x1c')](removeEntity(_0x56d794,null))[_0x9edd('0x1c')](function(){return db[_0x9edd('0x52')][_0x9edd('0x53')]({'raw':!![]});})[_0x9edd('0x1c')](function(_0x4cfa99){var _0x367fc6=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],_0x9edd('0x70')),_0x9edd('0x65'));var _0x3d4890=fs[_0x9edd('0x62')](path['join'](config['root'],_0x9edd('0x71')),'utf8');var _0x35950b=ejs['render'](_0x367fc6,{'trunks':_0x4cfa99});var _0x21c35f=ejs[_0x9edd('0x66')](_0x3d4890,{'trunks':_0x4cfa99});fs['writeFileSync'](_0x9edd('0x68'),_0x35950b);fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x21c35f);return respondWithRpcPromise(_0x9edd('0x6b'),_0x9edd('0x33'),{'module':_0x9edd('0x6c')});})[_0x9edd('0x25')](handleError(_0x56d794,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 8d75ad3..0310995 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 _0x745d=['moment','bluebird','path','rimraf','./trunk.attributes','exports','define','tools_trunks','lodash','util','../../config/logger','api'];(function(_0x50d84b,_0x1d7ea7){var _0x6d4270=function(_0x883f21){while(--_0x883f21){_0x50d84b['push'](_0x50d84b['shift']());}};_0x6d4270(++_0x1d7ea7);}(_0x745d,0xb0));var _0xd745=function(_0x57e2ce,_0x255ad6){_0x57e2ce=_0x57e2ce-0x0;var _0x3617ad=_0x745d[_0x57e2ce];return _0x3617ad;};'use strict';var _=require(_0xd745('0x0'));var util=require(_0xd745('0x1'));var logger=require(_0xd745('0x2'))(_0xd745('0x3'));var moment=require(_0xd745('0x4'));var BPromise=require(_0xd745('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd745('0x6'));var rimraf=require(_0xd745('0x7'));var config=require('../../config/environment');var attributes=require(_0xd745('0x8'));module[_0xd745('0x9')]=function(_0x3c2f7b,_0x52dc11){return _0x3c2f7b[_0xd745('0xa')]('Trunk',attributes,{'tableName':_0xd745('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x31c2=['bluebird','request-promise','path','rimraf','./trunk.attributes','exports','define','Trunk','util','../../config/logger'];(function(_0x54c9dd,_0x233a86){var _0x855156=function(_0x2dd60b){while(--_0x2dd60b){_0x54c9dd['push'](_0x54c9dd['shift']());}};_0x855156(++_0x233a86);}(_0x31c2,0xd0));var _0x231c=function(_0x4f2756,_0x3fffa7){_0x4f2756=_0x4f2756-0x0;var _0x3ab0dd=_0x31c2[_0x4f2756];return _0x3ab0dd;};'use strict';var _=require('lodash');var util=require(_0x231c('0x0'));var logger=require(_0x231c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x231c('0x2'));var rp=require(_0x231c('0x3'));var fs=require('fs');var path=require(_0x231c('0x4'));var rimraf=require(_0x231c('0x5'));var config=require('../../config/environment');var attributes=require(_0x231c('0x6'));module[_0x231c('0x7')]=function(_0x344c6d,_0x55dc2d){return _0x344c6d[_0x231c('0x8')](_0x231c('0x9'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 768a0e8..6c5a488 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 _0x50e6=['message','result','catch','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','then','GetTrunk','ShowTrunk','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x1a0c36,_0x1e0a97){var _0x1ffccb=function(_0x1a21cb){while(--_0x1a21cb){_0x1a0c36['push'](_0x1a0c36['shift']());}};_0x1ffccb(++_0x1e0a97);}(_0x50e6,0x1a8));var _0x650e=function(_0xb7c3d1,_0x203733){_0xb7c3d1=_0xb7c3d1-0x0;var _0x4a668b=_0x50e6[_0xb7c3d1];return _0x4a668b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x650e('0x0'));var BPromise=require(_0x650e('0x1'));var rs=require(_0x650e('0x2'));var fs=require('fs');var Redis=require(_0x650e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x650e('0x4'));var logger=require(_0x650e('0x5'))(_0x650e('0x6'));var config=require('../../config/environment');var jayson=require(_0x650e('0x7'));var client=jayson[_0x650e('0x8')][_0x650e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a0a56,_0x2cd0ab,_0xa75f37){return new BPromise(function(_0x1dd07e,_0x352252){return client['request'](_0x2a0a56,_0xa75f37)['then'](function(_0x273234){logger[_0x650e('0xa')](_0x650e('0xb'),_0x2cd0ab,'request\x20sent');logger[_0x650e('0xc')](_0x650e('0xd'),_0x2cd0ab,_0x650e('0xe'),JSON[_0x650e('0xf')](_0x273234));if(_0x273234[_0x650e('0x10')]){if(_0x273234[_0x650e('0x10')][_0x650e('0x11')]===0x1f4){logger[_0x650e('0x10')](_0x650e('0xb'),_0x2cd0ab,_0x273234[_0x650e('0x10')]['message']);return _0x352252(_0x273234[_0x650e('0x10')]['message']);}logger[_0x650e('0x10')](_0x650e('0xb'),_0x2cd0ab,_0x273234[_0x650e('0x10')][_0x650e('0x12')]);return _0x1dd07e(_0x273234[_0x650e('0x10')][_0x650e('0x12')]);}else{logger['info'](_0x650e('0xb'),_0x2cd0ab,'request\x20sent');_0x1dd07e(_0x273234[_0x650e('0x13')][_0x650e('0x12')]);}})[_0x650e('0x14')](function(_0x417d13){logger[_0x650e('0x10')](_0x650e('0xb'),_0x2cd0ab,_0x417d13);_0x352252(_0x417d13);});});}exports['GetTrunk']=function(_0x5aae02){var _0x297a76=this;return new Promise(function(_0x141bfd,_0x3fdb7a){return db[_0x650e('0x15')][_0x650e('0x16')]({'raw':_0x5aae02[_0x650e('0x17')]?_0x5aae02[_0x650e('0x17')][_0x650e('0x18')]===undefined?!![]:![]:!![],'where':_0x5aae02[_0x650e('0x17')]?_0x5aae02[_0x650e('0x17')][_0x650e('0x19')]||null:null,'attributes':_0x5aae02['options']?_0x5aae02[_0x650e('0x17')][_0x650e('0x1a')]||null:null,'limit':_0x5aae02[_0x650e('0x17')]?_0x5aae02[_0x650e('0x17')][_0x650e('0x1b')]||null:null,'include':_0x5aae02[_0x650e('0x17')]?_0x5aae02['options'][_0x650e('0x1c')]?_[_0x650e('0x1d')](_0x5aae02[_0x650e('0x17')]['include'],function(_0x5aac75){return{'model':db[_0x5aac75[_0x650e('0x1e')]],'as':_0x5aac75['as'],'attributes':_0x5aac75[_0x650e('0x1a')],'include':_0x5aac75[_0x650e('0x1c')]?_['map'](_0x5aac75[_0x650e('0x1c')],function(_0x46be29){return{'model':db[_0x46be29[_0x650e('0x1e')]],'as':_0x46be29['as'],'attributes':_0x46be29['attributes'],'include':_0x46be29['include']?_[_0x650e('0x1d')](_0x46be29['include'],function(_0x26a89b){return{'model':db[_0x26a89b['model']],'as':_0x26a89b['as'],'attributes':_0x26a89b[_0x650e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x650e('0x1f')](function(_0x43f908){logger[_0x650e('0xa')](_0x650e('0x20'),_0x5aae02);logger['debug']('GetTrunk',_0x5aae02,JSON[_0x650e('0xf')](_0x43f908));_0x141bfd(_0x43f908);})[_0x650e('0x14')](function(_0x32d4f5){logger[_0x650e('0x10')](_0x650e('0x20'),_0x32d4f5[_0x650e('0x12')],_0x5aae02);_0x3fdb7a(_0x297a76[_0x650e('0x10')](0x1f4,_0x32d4f5[_0x650e('0x12')]));});});};exports[_0x650e('0x21')]=function(_0x37c7c1){var _0x34662b=this;return new Promise(function(_0xf26995,_0x215ab6){return db[_0x650e('0x15')]['find']({'raw':_0x37c7c1[_0x650e('0x17')]?_0x37c7c1[_0x650e('0x17')][_0x650e('0x18')]===undefined?!![]:![]:!![],'where':_0x37c7c1[_0x650e('0x17')]?_0x37c7c1[_0x650e('0x17')][_0x650e('0x19')]||null:null,'attributes':_0x37c7c1[_0x650e('0x17')]?_0x37c7c1['options'][_0x650e('0x1a')]||null:null,'include':_0x37c7c1[_0x650e('0x17')]?_0x37c7c1[_0x650e('0x17')][_0x650e('0x1c')]?_[_0x650e('0x1d')](_0x37c7c1['options'][_0x650e('0x1c')],function(_0x4bb932){return{'model':db[_0x4bb932['model']],'as':_0x4bb932['as'],'attributes':_0x4bb932[_0x650e('0x1a')],'include':_0x4bb932[_0x650e('0x1c')]?_['map'](_0x4bb932[_0x650e('0x1c')],function(_0x4368af){return{'model':db[_0x4368af['model']],'as':_0x4368af['as'],'attributes':_0x4368af['attributes'],'include':_0x4368af[_0x650e('0x1c')]?_[_0x650e('0x1d')](_0x4368af[_0x650e('0x1c')],function(_0x242cce){return{'model':db[_0x242cce[_0x650e('0x1e')]],'as':_0x242cce['as'],'attributes':_0x242cce[_0x650e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x650e('0x1f')](function(_0x210d65){logger[_0x650e('0xa')](_0x650e('0x21'),_0x37c7c1);logger[_0x650e('0xc')]('ShowTrunk',_0x37c7c1,JSON['stringify'](_0x210d65));_0xf26995(_0x210d65);})[_0x650e('0x14')](function(_0x414862){logger[_0x650e('0x10')]('ShowTrunk',_0x414862[_0x650e('0x12')],_0x37c7c1);_0x215ab6(_0x34662b[_0x650e('0x10')](0x1f4,_0x414862[_0x650e('0x12')]));});});}; \ No newline at end of file +var _0xd633=['Trunk','findAll','raw','options','where','attributes','limit','include','model','map','debug','stringify','ShowTrunk','find','then','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','code','error','message','info','request\x20sent','result','catch','GetTrunk'];(function(_0x435592,_0x363aed){var _0x2d544d=function(_0x57dc9f){while(--_0x57dc9f){_0x435592['push'](_0x435592['shift']());}};_0x2d544d(++_0x363aed);}(_0xd633,0x1b3));var _0x3d63=function(_0x1124ea,_0x19e351){_0x1124ea=_0x1124ea-0x0;var _0x442d53=_0xd633[_0x1124ea];return _0x442d53;};'use strict';var _=require(_0x3d63('0x0'));var util=require(_0x3d63('0x1'));var moment=require(_0x3d63('0x2'));var BPromise=require(_0x3d63('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d63('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3d63('0x5'))(_0x3d63('0x6'));var config=require('../../config/environment');var jayson=require(_0x3d63('0x7'));var client=jayson[_0x3d63('0x8')][_0x3d63('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x517f85,_0xeec484,_0x1caf74){return new BPromise(function(_0x102896,_0x391ad4){return client['request'](_0x517f85,_0x1caf74)['then'](function(_0x45dab3){logger['info'](_0x3d63('0xa'),_0xeec484,'request\x20sent');logger['debug'](_0x3d63('0xb'),_0xeec484,'request\x20sent',JSON['stringify'](_0x45dab3));if(_0x45dab3['error']){if(_0x45dab3['error'][_0x3d63('0xc')]===0x1f4){logger[_0x3d63('0xd')]('Trunk,\x20%s,\x20%s',_0xeec484,_0x45dab3[_0x3d63('0xd')][_0x3d63('0xe')]);return _0x391ad4(_0x45dab3[_0x3d63('0xd')][_0x3d63('0xe')]);}logger[_0x3d63('0xd')](_0x3d63('0xa'),_0xeec484,_0x45dab3[_0x3d63('0xd')]['message']);return _0x102896(_0x45dab3[_0x3d63('0xd')]['message']);}else{logger[_0x3d63('0xf')](_0x3d63('0xa'),_0xeec484,_0x3d63('0x10'));_0x102896(_0x45dab3[_0x3d63('0x11')][_0x3d63('0xe')]);}})[_0x3d63('0x12')](function(_0x2bf6b4){logger[_0x3d63('0xd')]('Trunk,\x20%s,\x20%s',_0xeec484,_0x2bf6b4);_0x391ad4(_0x2bf6b4);});});}exports[_0x3d63('0x13')]=function(_0x4c6c39){var _0x2fc41c=this;return new Promise(function(_0x5d2b8e,_0x2d2ebb){return db[_0x3d63('0x14')][_0x3d63('0x15')]({'raw':_0x4c6c39['options']?_0x4c6c39['options'][_0x3d63('0x16')]===undefined?!![]:![]:!![],'where':_0x4c6c39[_0x3d63('0x17')]?_0x4c6c39[_0x3d63('0x17')][_0x3d63('0x18')]||null:null,'attributes':_0x4c6c39['options']?_0x4c6c39['options'][_0x3d63('0x19')]||null:null,'limit':_0x4c6c39[_0x3d63('0x17')]?_0x4c6c39[_0x3d63('0x17')][_0x3d63('0x1a')]||null:null,'include':_0x4c6c39[_0x3d63('0x17')]?_0x4c6c39['options'][_0x3d63('0x1b')]?_['map'](_0x4c6c39[_0x3d63('0x17')][_0x3d63('0x1b')],function(_0x271618){return{'model':db[_0x271618[_0x3d63('0x1c')]],'as':_0x271618['as'],'attributes':_0x271618[_0x3d63('0x19')],'include':_0x271618[_0x3d63('0x1b')]?_[_0x3d63('0x1d')](_0x271618[_0x3d63('0x1b')],function(_0x48f6ea){return{'model':db[_0x48f6ea[_0x3d63('0x1c')]],'as':_0x48f6ea['as'],'attributes':_0x48f6ea[_0x3d63('0x19')],'include':_0x48f6ea[_0x3d63('0x1b')]?_[_0x3d63('0x1d')](_0x48f6ea[_0x3d63('0x1b')],function(_0x475e1a){return{'model':db[_0x475e1a[_0x3d63('0x1c')]],'as':_0x475e1a['as'],'attributes':_0x475e1a[_0x3d63('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x215b50){logger[_0x3d63('0xf')](_0x3d63('0x13'),_0x4c6c39);logger[_0x3d63('0x1e')](_0x3d63('0x13'),_0x4c6c39,JSON[_0x3d63('0x1f')](_0x215b50));_0x5d2b8e(_0x215b50);})['catch'](function(_0xe924c6){logger[_0x3d63('0xd')]('GetTrunk',_0xe924c6['message'],_0x4c6c39);_0x2d2ebb(_0x2fc41c[_0x3d63('0xd')](0x1f4,_0xe924c6[_0x3d63('0xe')]));});});};exports[_0x3d63('0x20')]=function(_0x2ae7e3){var _0x181b1d=this;return new Promise(function(_0x4a3535,_0x4a20a2){return db[_0x3d63('0x14')][_0x3d63('0x21')]({'raw':_0x2ae7e3[_0x3d63('0x17')]?_0x2ae7e3[_0x3d63('0x17')][_0x3d63('0x16')]===undefined?!![]:![]:!![],'where':_0x2ae7e3[_0x3d63('0x17')]?_0x2ae7e3[_0x3d63('0x17')][_0x3d63('0x18')]||null:null,'attributes':_0x2ae7e3[_0x3d63('0x17')]?_0x2ae7e3[_0x3d63('0x17')][_0x3d63('0x19')]||null:null,'include':_0x2ae7e3['options']?_0x2ae7e3[_0x3d63('0x17')]['include']?_[_0x3d63('0x1d')](_0x2ae7e3[_0x3d63('0x17')]['include'],function(_0x228c42){return{'model':db[_0x228c42[_0x3d63('0x1c')]],'as':_0x228c42['as'],'attributes':_0x228c42[_0x3d63('0x19')],'include':_0x228c42[_0x3d63('0x1b')]?_['map'](_0x228c42[_0x3d63('0x1b')],function(_0x45835f){return{'model':db[_0x45835f[_0x3d63('0x1c')]],'as':_0x45835f['as'],'attributes':_0x45835f['attributes'],'include':_0x45835f[_0x3d63('0x1b')]?_[_0x3d63('0x1d')](_0x45835f[_0x3d63('0x1b')],function(_0x5df4b9){return{'model':db[_0x5df4b9[_0x3d63('0x1c')]],'as':_0x5df4b9['as'],'attributes':_0x5df4b9[_0x3d63('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3d63('0x22')](function(_0x49ca0b){logger[_0x3d63('0xf')](_0x3d63('0x20'),_0x2ae7e3);logger[_0x3d63('0x1e')](_0x3d63('0x20'),_0x2ae7e3,JSON[_0x3d63('0x1f')](_0x49ca0b));_0x4a3535(_0x49ca0b);})['catch'](function(_0x5911b9){logger[_0x3d63('0xd')](_0x3d63('0x20'),_0x5911b9[_0x3d63('0xe')],_0x2ae7e3);_0x4a20a2(_0x181b1d[_0x3d63('0xd')](0x1f4,_0x5911b9['message']));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 966f907..5ec45f0 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 _0x19c9=['update','Router','./user-setting.controller','put','/:id','isAuthenticated'];(function(_0x3f6ece,_0x530c18){var _0x3ecfa2=function(_0x55717e){while(--_0x55717e){_0x3f6ece['push'](_0x3f6ece['shift']());}};_0x3ecfa2(++_0x530c18);}(_0x19c9,0xf1));var _0x919c=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x19c9[_0x3c2a69];return _0x596bc8;};'use strict';var express=require('express');var router=express[_0x919c('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x919c('0x1'));router[_0x919c('0x2')](_0x919c('0x3'),auth[_0x919c('0x4')](),controller[_0x919c('0x5')]);module['exports']=router; \ No newline at end of file +var _0x2df9=['Router','../../components/auth/service','./user-setting.controller','/:id','exports','express'];(function(_0x5bceb8,_0x1714ff){var _0x441f32=function(_0x33823e){while(--_0x33823e){_0x5bceb8['push'](_0x5bceb8['shift']());}};_0x441f32(++_0x1714ff);}(_0x2df9,0x113));var _0x92df=function(_0x250635,_0x2f621b){_0x250635=_0x250635-0x0;var _0x4f0688=_0x2df9[_0x250635];return _0x4f0688;};'use strict';var express=require(_0x92df('0x0'));var router=express[_0x92df('0x1')]();var auth=require(_0x92df('0x2'));var controller=require(_0x92df('0x3'));router['put'](_0x92df('0x4'),auth['isAuthenticated'](),controller['update']);module[_0x92df('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 f5ef786..5d9ab62 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 _0xc43a=['INTEGER','UserId','sequelize','error','info','exports','ENUM','TEXT'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xc43a,0x13a));var _0xac43=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc43a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xac43('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xac43('0x1'),'warning',_0xac43('0x2'),'debug'];module[_0xac43('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0xac43('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xac43('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xac43('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xac43('0x6')],'unique':_0xac43('0x7')}}; \ No newline at end of file +var _0x803d=['warning','info','debug','ENUM','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize','error'];(function(_0x326722,_0x299750){var _0x3327a9=function(_0x4ad025){while(--_0x4ad025){_0x326722['push'](_0x326722['shift']());}};_0x3327a9(++_0x299750);}(_0x803d,0x13d));var _0xd803=function(_0x2ccf50,_0x258a8c){_0x2ccf50=_0x2ccf50-0x0;var _0x5e0c68=_0x803d[_0x2ccf50];return _0x5e0c68;};'use strict';var Sequelize=require(_0xd803('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xd803('0x1'),_0xd803('0x2'),_0xd803('0x3'),_0xd803('0x4')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0xd803('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xd803('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xd803('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xd803('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xd803('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xd803('0x9')],'unique':_0xd803('0xa')}}; \ 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 6a10f6e..2bd0e76 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 _0xd3d1=['Unauthorized','Invalid\x20user\x20setting\x20id','UserSetting','find','params','body','lodash','ioredis','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','localhost','status','json','then','sendStatus','error','stack','name','send','user','role'];(function(_0x4033e4,_0x469e1a){var _0x121a3a=function(_0x210a0b){while(--_0x210a0b){_0x4033e4['push'](_0x4033e4['shift']());}};_0x121a3a(++_0x469e1a);}(_0xd3d1,0x172));var _0x1d3d=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xd3d1[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x1d3d('0x0'));var Redis=require(_0x1d3d('0x1'));var logger=require('../../config/logger')('api');var config=require(_0x1d3d('0x2'));var db=require(_0x1d3d('0x3'))['db'];var socket=require(_0x1d3d('0x4'))(new Redis(config[_0x1d3d('0x5')]));require(_0x1d3d('0x6'))[_0x1d3d('0x7')](socket);config[_0x1d3d('0x5')]=_[_0x1d3d('0x8')](config[_0x1d3d('0x5')],{'host':_0x1d3d('0x9'),'port':0x18eb});function respondWithResult(_0x3831ce,_0xb1b3c6){_0xb1b3c6=_0xb1b3c6||0xc8;return function(_0xe10bca){if(_0xe10bca){return _0x3831ce[_0x1d3d('0xa')](_0xb1b3c6)[_0x1d3d('0xb')](_0xe10bca);}};}function saveUpdates(_0x2ba122){return function(_0x3683c9){if(_0x3683c9){return _0x3683c9['update'](_0x2ba122)[_0x1d3d('0xc')](function(_0x44d950){return _0x44d950;});}return null;};}function handleEntityNotFound(_0x32d5da){return function(_0x32742c){if(!_0x32742c){_0x32d5da[_0x1d3d('0xd')](0x194);}return _0x32742c;};}function handleError(_0x372ff2,_0x44b374){_0x44b374=_0x44b374||0x1f4;return function(_0x2fa11e){logger[_0x1d3d('0xe')](_0x2fa11e[_0x1d3d('0xf')]);if(_0x2fa11e[_0x1d3d('0x10')]){delete _0x2fa11e['name'];}_0x372ff2[_0x1d3d('0xa')](_0x44b374)[_0x1d3d('0x11')](_0x2fa11e);};}exports['update']=function(_0x4dd753,_0x12bd00){if(_0x4dd753[_0x1d3d('0x12')][_0x1d3d('0x13')]!=='admin')throw new Error(_0x1d3d('0x14'));if(isNaN(Number(_0x4dd753['params']['id'])))throw new Error(_0x1d3d('0x15'));return db[_0x1d3d('0x16')][_0x1d3d('0x17')]({'where':{'id':_0x4dd753[_0x1d3d('0x18')]['id']}})[_0x1d3d('0xc')](handleEntityNotFound(_0x12bd00,null))[_0x1d3d('0xc')](saveUpdates(_0x4dd753[_0x1d3d('0x19')],null))['then'](respondWithResult(_0x12bd00,null))['catch'](handleError(_0x12bd00,null));}; \ No newline at end of file +var _0x3fec=['status','json','update','then','sendStatus','stack','name','send','user','role','Unauthorized','Invalid\x20user\x20setting\x20id','UserSetting','find','params','body','catch','lodash','api','../../config/environment','socket.io-emitter','register','defaults','redis','localhost'];(function(_0x289a67,_0x1e5a3c){var _0x572b49=function(_0x22e036){while(--_0x22e036){_0x289a67['push'](_0x289a67['shift']());}};_0x572b49(++_0x1e5a3c);}(_0x3fec,0x1ba));var _0xc3fe=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3fec[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc3fe('0x0'));var Redis=require('ioredis');var logger=require('../../config/logger')(_0xc3fe('0x1'));var config=require(_0xc3fe('0x2'));var db=require('../../mysqldb')['db'];var socket=require(_0xc3fe('0x3'))(new Redis(config['redis']));require('./user-setting.socket')[_0xc3fe('0x4')](socket);config['redis']=_[_0xc3fe('0x5')](config[_0xc3fe('0x6')],{'host':_0xc3fe('0x7'),'port':0x18eb});function respondWithResult(_0x1ae20f,_0xf96362){_0xf96362=_0xf96362||0xc8;return function(_0x43a9a9){if(_0x43a9a9){return _0x1ae20f[_0xc3fe('0x8')](_0xf96362)[_0xc3fe('0x9')](_0x43a9a9);}};}function saveUpdates(_0x25b1eb){return function(_0x17dbcb){if(_0x17dbcb){return _0x17dbcb[_0xc3fe('0xa')](_0x25b1eb)[_0xc3fe('0xb')](function(_0x2852c9){return _0x2852c9;});}return null;};}function handleEntityNotFound(_0x3ffe1a){return function(_0x22f543){if(!_0x22f543){_0x3ffe1a[_0xc3fe('0xc')](0x194);}return _0x22f543;};}function handleError(_0x5b166d,_0x3100bd){_0x3100bd=_0x3100bd||0x1f4;return function(_0x144702){logger['error'](_0x144702[_0xc3fe('0xd')]);if(_0x144702[_0xc3fe('0xe')]){delete _0x144702[_0xc3fe('0xe')];}_0x5b166d[_0xc3fe('0x8')](_0x3100bd)[_0xc3fe('0xf')](_0x144702);};}exports[_0xc3fe('0xa')]=function(_0x1ac4d7,_0x7d5e67){if(_0x1ac4d7[_0xc3fe('0x10')][_0xc3fe('0x11')]!=='admin')throw new Error(_0xc3fe('0x12'));if(isNaN(Number(_0x1ac4d7['params']['id'])))throw new Error(_0xc3fe('0x13'));return db[_0xc3fe('0x14')][_0xc3fe('0x15')]({'where':{'id':_0x1ac4d7[_0xc3fe('0x16')]['id']}})[_0xc3fe('0xb')](handleEntityNotFound(_0x7d5e67,null))[_0xc3fe('0xb')](saveUpdates(_0x1ac4d7[_0xc3fe('0x17')],null))[_0xc3fe('0xb')](respondWithResult(_0x7d5e67,null))[_0xc3fe('0x18')](handleError(_0x7d5e67,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 fcbc21f..c245927 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 _0xc963=['../../mysqldb','UserSetting','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x5e2365,_0x32e377){var _0x127117=function(_0x4907db){while(--_0x4907db){_0x5e2365['push'](_0x5e2365['shift']());}};_0x127117(++_0x32e377);}(_0xc963,0x13b));var _0x3c96=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0xc963[_0x265aa2];return _0x447a3a;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x3c96('0x0'))['db'][_0x3c96('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x3c96('0x2')](0x0);var events={'afterCreate':_0x3c96('0x3'),'afterUpdate':_0x3c96('0x4'),'afterDestroy':_0x3c96('0x5')};function emitEvent(_0x172e1f){return function(_0x347ae3,_0x1506ae,_0x1bde0b){UserSettingEvents[_0x3c96('0x6')](_0x172e1f+':'+_0x347ae3['id'],_0x347ae3);UserSettingEvents[_0x3c96('0x6')](_0x172e1f,_0x347ae3);_0x1bde0b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x3c96('0x7')](e,emitEvent(event));}}module[_0x3c96('0x8')]=UserSettingEvents; \ No newline at end of file +var _0xbdf8=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0xd95a4f,_0x5b2faf){var _0x913026=function(_0x4e9711){while(--_0x4e9711){_0xd95a4f['push'](_0xd95a4f['shift']());}};_0x913026(++_0x5b2faf);}(_0xbdf8,0x144));var _0x8bdf=function(_0x42838e,_0x2a0689){_0x42838e=_0x42838e-0x0;var _0x3c04e1=_0xbdf8[_0x42838e];return _0x3c04e1;};'use strict';var EventEmitter=require(_0x8bdf('0x0'));var UserSetting=require(_0x8bdf('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x8bdf('0x2')](0x0);var events={'afterCreate':_0x8bdf('0x3'),'afterUpdate':_0x8bdf('0x4'),'afterDestroy':_0x8bdf('0x5')};function emitEvent(_0x23d11f){return function(_0x28a337,_0x12443f,_0x37080a){UserSettingEvents[_0x8bdf('0x6')](_0x23d11f+':'+_0x28a337['id'],_0x28a337);UserSettingEvents['emit'](_0x23d11f,_0x28a337);_0x37080a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x8bdf('0x7')](e,emitEvent(event));}}module[_0x8bdf('0x8')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 0dcc9c6..fb05192 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 _0x48bc=['./user-setting.attributes','exports','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince'];(function(_0x481868,_0x8b28aa){var _0x1c2e03=function(_0x4ce7cf){while(--_0x4ce7cf){_0x481868['push'](_0x481868['shift']());}};_0x1c2e03(++_0x8b28aa);}(_0x48bc,0x1b6));var _0xc48b=function(_0x4a6e26,_0x405004){_0x4a6e26=_0x4a6e26-0x0;var _0x932820=_0x48bc[_0x4a6e26];return _0x932820;};'use strict';var attributes=require(_0xc48b('0x0'));module[_0xc48b('0x1')]=function(_0x11f046){return _0x11f046['define'](_0xc48b('0x2'),attributes,{'tableName':_0xc48b('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x15b642){if(!_0x15b642[_0xc48b('0x4')])_0x15b642[_0xc48b('0x5')]=null;else if(_0x15b642[_0xc48b('0x5')]===null)_0x15b642[_0xc48b('0x5')]=new Date();}}});}; \ No newline at end of file +var _0xf290=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','exports','define','user_settings'];(function(_0x2f7d20,_0x3f8989){var _0x4e00fe=function(_0x3207ed){while(--_0x3207ed){_0x2f7d20['push'](_0x2f7d20['shift']());}};_0x4e00fe(++_0x3f8989);}(_0xf290,0xde));var _0x0f29=function(_0x3dfeb9,_0x1cc6e4){_0x3dfeb9=_0x3dfeb9-0x0;var _0x412314=_0xf290[_0x3dfeb9];return _0x412314;};'use strict';var attributes=require('./user-setting.attributes');module[_0x0f29('0x0')]=function(_0x550692){return _0x550692[_0x0f29('0x1')]('UserSetting',attributes,{'tableName':_0x0f29('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1b4f85){if(!_0x1b4f85[_0x0f29('0x3')])_0x1b4f85[_0x0f29('0x4')]=null;else if(_0x1b4f85[_0x0f29('0x4')]===null)_0x1b4f85['clientSideLoggingEnabledSince']=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 3caa046..fa508e1 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 _0xb3b1=['./user-setting.events','remove','update','emit','UserId','register','length','user-setting:'];(function(_0x1e9f1e,_0x27224f){var _0x563620=function(_0x2b4fcc){while(--_0x2b4fcc){_0x1e9f1e['push'](_0x1e9f1e['shift']());}};_0x563620(++_0x27224f);}(_0xb3b1,0x160));var _0x1b3b=function(_0x3705df,_0x183575){_0x3705df=_0x3705df-0x0;var _0x4dc1a9=_0xb3b1[_0x3705df];return _0x4dc1a9;};'use strict';var UserSettingEvents=require(_0x1b3b('0x0'));var events=['save',_0x1b3b('0x1'),_0x1b3b('0x2')];function createListener(_0x3e4909,_0x4136b0){return function(_0x2e79c9){_0x4136b0[_0x1b3b('0x3')](_0x3e4909,_0x2e79c9);if(_0x3e4909==='user-setting:update'){_0x4136b0[_0x1b3b('0x3')]('user-setting:update:user-'+_0x2e79c9[_0x1b3b('0x4')],_0x2e79c9);}};}exports[_0x1b3b('0x5')]=function(_0x1546e5){for(var _0x5d752e=0x0,_0x1936f5=events[_0x1b3b('0x6')];_0x5d752e<_0x1936f5;_0x5d752e++){var _0xa33ec5=events[_0x5d752e];var _0x14a837=createListener(_0x1b3b('0x7')+_0xa33ec5,_0x1546e5);UserSettingEvents['on'](_0xa33ec5,_0x14a837);}}; \ No newline at end of file +var _0xebe6=['register','length','./user-setting.events','save','remove','update','emit','user-setting:update'];(function(_0x288285,_0x222a9e){var _0x1d1328=function(_0x3d78f6){while(--_0x3d78f6){_0x288285['push'](_0x288285['shift']());}};_0x1d1328(++_0x222a9e);}(_0xebe6,0x13a));var _0x6ebe=function(_0x5229bb,_0x4b17f5){_0x5229bb=_0x5229bb-0x0;var _0x15db9b=_0xebe6[_0x5229bb];return _0x15db9b;};'use strict';var UserSettingEvents=require(_0x6ebe('0x0'));var events=[_0x6ebe('0x1'),_0x6ebe('0x2'),_0x6ebe('0x3')];function createListener(_0x229b70,_0x12699e){return function(_0x80db7b){_0x12699e[_0x6ebe('0x4')](_0x229b70,_0x80db7b);if(_0x229b70===_0x6ebe('0x5')){_0x12699e[_0x6ebe('0x4')]('user-setting:update:user-'+_0x80db7b['UserId'],_0x80db7b);}};}exports[_0x6ebe('0x6')]=function(_0x2a63a5){for(var _0x1226b9=0x0,_0x19b9dc=events[_0x6ebe('0x7')];_0x1226b9<_0x19b9dc;_0x1226b9++){var _0x4f8750=events[_0x1226b9];var _0x3cd02f=createListener('user-setting:'+_0x4f8750,_0x2a63a5);UserSettingEvents['on'](_0x4f8750,_0x3cd02f);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 03d61da..3c54ba0 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 _0x7860=['destroy','/:id/chat_interactions','/:id/mail_interactions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeWhatsappInteractions','removeOpenchannelAccounts','removeChatWebsites','removeApiKey','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','get','describe','/whoami','whoami','/presence','getPresence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','addContacts','post','/create_many','bulkCreate','addQueues','diskStorage','join','server/files/images/','format','%s-%s','originalname','single','addAvatar','/:id/login','login','/:id/pause','pause','unpause','addChatInteractions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','/:id/password','changePassword','delete','removeQueues'];(function(_0x4c9e31,_0x13568b){var _0x386208=function(_0x492b47){while(--_0x492b47){_0x4c9e31['push'](_0x4c9e31['shift']());}};_0x386208(++_0x13568b);}(_0x7860,0xe4));var _0x0786=function(_0x5ccb19,_0x42f12b){_0x5ccb19=_0x5ccb19-0x0;var _0x34b533=_0x7860[_0x5ccb19];return _0x34b533;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0786('0x0'));var timeout=require(_0x0786('0x1'));var express=require('express');var router=express[_0x0786('0x2')]();var fs_extra=require(_0x0786('0x3'));var auth=require(_0x0786('0x4'));var interaction=require(_0x0786('0x5'));var config=require(_0x0786('0x6'));var controller=require(_0x0786('0x7'));router['get']('/',auth[_0x0786('0x8')](),controller['index']);router[_0x0786('0x9')]('/describe',auth[_0x0786('0x8')](),controller[_0x0786('0xa')]);router[_0x0786('0x9')](_0x0786('0xb'),auth[_0x0786('0x8')](),controller[_0x0786('0xc')]);router[_0x0786('0x9')](_0x0786('0xd'),auth[_0x0786('0x8')](),controller[_0x0786('0xe')]);router['get'](_0x0786('0xf'),auth[_0x0786('0x8')](),controller['show']);router[_0x0786('0x9')](_0x0786('0x10'),controller[_0x0786('0x11')]);router[_0x0786('0x9')](_0x0786('0x12'),auth[_0x0786('0x8')](),controller[_0x0786('0x13')]);router[_0x0786('0x9')](_0x0786('0x14'),auth[_0x0786('0x8')](),controller[_0x0786('0x15')]);router[_0x0786('0x9')](_0x0786('0x16'),auth[_0x0786('0x8')](),controller['getQueues']);router[_0x0786('0x9')](_0x0786('0x17'),auth[_0x0786('0x8')](),controller[_0x0786('0x18')]);router[_0x0786('0x9')](_0x0786('0x19'),auth[_0x0786('0x8')](),controller[_0x0786('0x1a')]);router[_0x0786('0x9')](_0x0786('0x1b'),auth[_0x0786('0x8')](),controller[_0x0786('0x1c')]);router['get']('/:id/screen_recordings',auth[_0x0786('0x8')](),controller[_0x0786('0x1d')]);router[_0x0786('0x9')](_0x0786('0x1e'),auth['isAuthenticated'](),controller['getChatInteractions']);router['get']('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x0786('0x1f')]);router[_0x0786('0x9')](_0x0786('0x20'),auth['isAuthenticated'](),controller['getMailInteractions']);router[_0x0786('0x9')](_0x0786('0x21'),auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0x0786('0x9')](_0x0786('0x22'),auth[_0x0786('0x8')](),controller['getFaxInteractions']);router[_0x0786('0x9')](_0x0786('0x23'),auth[_0x0786('0x8')](),controller[_0x0786('0x24')]);router['get'](_0x0786('0x25'),auth[_0x0786('0x8')](),controller[_0x0786('0x26')]);router[_0x0786('0x9')](_0x0786('0x27'),auth[_0x0786('0x8')](),controller[_0x0786('0x28')]);router['get'](_0x0786('0x29'),auth['isAuthenticated'](),controller[_0x0786('0x2a')]);router[_0x0786('0x9')]('/:id/prefixes',auth[_0x0786('0x8')](),controller[_0x0786('0x2b')]);router['get'](_0x0786('0x2c'),auth[_0x0786('0x8')](),controller[_0x0786('0x2d')]);router[_0x0786('0x9')]('/:id/mail_accounts',auth[_0x0786('0x8')](),controller[_0x0786('0x2e')]);router[_0x0786('0x9')](_0x0786('0x2f'),auth[_0x0786('0x8')](),controller[_0x0786('0x30')]);router['get'](_0x0786('0x31'),auth[_0x0786('0x8')](),controller[_0x0786('0x32')]);router[_0x0786('0x9')](_0x0786('0x33'),auth['isAuthenticated'](),controller[_0x0786('0x34')]);router[_0x0786('0x9')](_0x0786('0x35'),auth[_0x0786('0x8')](),controller[_0x0786('0x36')]);router[_0x0786('0x9')](_0x0786('0x37'),auth['isAuthenticated'](),controller[_0x0786('0x38')]);router[_0x0786('0x9')](_0x0786('0x39'),auth[_0x0786('0x8')](),controller[_0x0786('0x3a')]);router['post']('/:id/contacts',auth[_0x0786('0x8')](),controller[_0x0786('0x3b')]);router[_0x0786('0x3c')]('/',auth[_0x0786('0x8')](),controller['create']);router['post'](_0x0786('0x3d'),auth[_0x0786('0x8')](),controller[_0x0786('0x3e')]);router['post']('/:id/queues',auth['isAuthenticated'](),controller[_0x0786('0x3f')]);var upload=multer({'storage':multer[_0x0786('0x40')]({'destination':function(_0x1d0e36,_0x472bbb,_0x5efae8){_0x5efae8(null,path[_0x0786('0x41')](config['root'],_0x0786('0x42')));},'filename':function(_0x9eb867,_0x12fd7f,_0x195f83){_0x195f83(null,util[_0x0786('0x43')](_0x0786('0x44'),Date['now'](),_0x12fd7f[_0x0786('0x45')]));}})});router[_0x0786('0x3c')](_0x0786('0x10'),upload[_0x0786('0x46')]('file'),controller[_0x0786('0x47')]);router[_0x0786('0x3c')](_0x0786('0x48'),auth[_0x0786('0x8')](),controller[_0x0786('0x49')]);router['post']('/:id/logout',auth[_0x0786('0x8')](),controller['logout']);router['post'](_0x0786('0x4a'),auth[_0x0786('0x8')](),controller[_0x0786('0x4b')]);router['post']('/:id/unpause',auth['isAuthenticated'](),controller[_0x0786('0x4c')]);router[_0x0786('0x3c')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0x0786('0x3c')]('/:id/chat_interactions',auth[_0x0786('0x8')](),controller[_0x0786('0x4d')]);router[_0x0786('0x3c')]('/:id/mail_interactions',auth[_0x0786('0x8')](),controller[_0x0786('0x4e')]);router['post']('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x0786('0x4f')]);router[_0x0786('0x3c')](_0x0786('0x50'),auth[_0x0786('0x8')](),controller['addSmsInteractions']);router[_0x0786('0x3c')](_0x0786('0x51'),auth[_0x0786('0x8')](),controller[_0x0786('0x52')]);router[_0x0786('0x3c')]('/:id/whatsapp_interactions',auth[_0x0786('0x8')](),controller[_0x0786('0x53')]);router[_0x0786('0x3c')](_0x0786('0x2c'),auth['isAuthenticated'](),controller['addFaxAccounts']);router['post'](_0x0786('0x54'),auth[_0x0786('0x8')](),controller[_0x0786('0x55')]);router[_0x0786('0x3c')]('/:id/openchannel_accounts',auth[_0x0786('0x8')](),controller[_0x0786('0x56')]);router[_0x0786('0x3c')](_0x0786('0x31'),auth[_0x0786('0x8')](),controller[_0x0786('0x57')]);router[_0x0786('0x3c')](_0x0786('0x33'),auth[_0x0786('0x8')](),controller[_0x0786('0x58')]);router[_0x0786('0x3c')](_0x0786('0x35'),auth[_0x0786('0x8')](),controller[_0x0786('0x59')]);router['post'](_0x0786('0x39'),auth['isAuthenticated'](),controller[_0x0786('0x5a')]);router['put'](_0x0786('0xf'),auth[_0x0786('0x8')](),controller['update']);router[_0x0786('0x5b')](_0x0786('0x5c'),auth[_0x0786('0x8')](),controller[_0x0786('0x5d')]);router[_0x0786('0x5e')]('/:id/queues',auth[_0x0786('0x8')](),controller[_0x0786('0x5f')]);router[_0x0786('0x5e')](_0x0786('0x25'),auth[_0x0786('0x8')](),controller['removeTeams']);router['delete'](_0x0786('0xf'),auth['isAuthenticated'](),controller[_0x0786('0x60')]);router[_0x0786('0x5e')](_0x0786('0x61'),auth[_0x0786('0x8')](),controller['removeChatInteractions']);router[_0x0786('0x5e')](_0x0786('0x62'),auth[_0x0786('0x8')](),controller[_0x0786('0x63')]);router['delete'](_0x0786('0x64'),auth[_0x0786('0x8')](),controller[_0x0786('0x65')]);router[_0x0786('0x5e')]('/:id/sms_interactions',auth[_0x0786('0x8')](),controller[_0x0786('0x66')]);router[_0x0786('0x5e')](_0x0786('0x51'),auth[_0x0786('0x8')](),controller['removeOpenchannelInteractions']);router[_0x0786('0x5e')]('/:id/whatsapp_interactions',auth[_0x0786('0x8')](),controller[_0x0786('0x67')]);router['delete']('/:id/fax_accounts',auth[_0x0786('0x8')](),controller['removeFaxAccounts']);router[_0x0786('0x5e')]('/:id/mail_accounts',auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0x0786('0x5e')](_0x0786('0x2f'),auth[_0x0786('0x8')](),controller[_0x0786('0x68')]);router[_0x0786('0x5e')](_0x0786('0x31'),auth[_0x0786('0x8')](),controller['removeSmsAccounts']);router[_0x0786('0x5e')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x0786('0x69')]);router[_0x0786('0x5e')](_0x0786('0x35'),auth[_0x0786('0x8')](),controller['removeWhatsappAccounts']);router[_0x0786('0x5e')](_0x0786('0x39'),auth[_0x0786('0x8')](),controller[_0x0786('0x6a')]);module[_0x0786('0x6b')]=router; \ No newline at end of file +var _0xe148=['addContacts','/create_many','bulkCreate','addQueues','diskStorage','root','server/files/images/','format','%s-%s','now','single','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','update','put','/:id/password','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','/describe','isAuthenticated','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getRecordings','/:id/screen_recordings','/:id/chat/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','/:id/lists','getLists','getAgents','getVoicePrefixes','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post'];(function(_0x32a2aa,_0x1c032d){var _0x3c0e61=function(_0x1b97af){while(--_0x1b97af){_0x32a2aa['push'](_0x32a2aa['shift']());}};_0x3c0e61(++_0x1c032d);}(_0xe148,0x109));var _0x8e14=function(_0x671369,_0x433da5){_0x671369=_0x671369-0x0;var _0x33f2b4=_0xe148[_0x671369];return _0x33f2b4;};'use strict';var multer=require(_0x8e14('0x0'));var util=require(_0x8e14('0x1'));var path=require(_0x8e14('0x2'));var timeout=require(_0x8e14('0x3'));var express=require(_0x8e14('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8e14('0x5'));var interaction=require(_0x8e14('0x6'));var config=require(_0x8e14('0x7'));var controller=require(_0x8e14('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8e14('0x9')](_0x8e14('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x8e14('0x9')]('/whoami',auth[_0x8e14('0xb')](),controller[_0x8e14('0xc')]);router[_0x8e14('0x9')](_0x8e14('0xd'),auth[_0x8e14('0xb')](),controller[_0x8e14('0xe')]);router[_0x8e14('0x9')](_0x8e14('0xf'),auth['isAuthenticated'](),controller[_0x8e14('0x10')]);router['get'](_0x8e14('0x11'),controller[_0x8e14('0x12')]);router[_0x8e14('0x9')](_0x8e14('0x13'),auth[_0x8e14('0xb')](),controller['getOpenTabs']);router[_0x8e14('0x9')](_0x8e14('0x14'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x15')]);router['get'](_0x8e14('0x16'),auth['isAuthenticated'](),controller[_0x8e14('0x17')]);router[_0x8e14('0x9')](_0x8e14('0x18'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x19')]);router['get']('/:id/groups',auth[_0x8e14('0xb')](),controller['getGroups']);router[_0x8e14('0x9')]('/:id/recordings',auth['isAuthenticated'](),controller[_0x8e14('0x1a')]);router[_0x8e14('0x9')](_0x8e14('0x1b'),auth[_0x8e14('0xb')](),controller['getScreenRecordings']);router[_0x8e14('0x9')](_0x8e14('0x1c'),auth[_0x8e14('0xb')](),controller['getChatInteractions']);router['get']('/:id/openchannel/interactions',auth[_0x8e14('0xb')](),controller['getOpenchannelInteractions']);router['get'](_0x8e14('0x1d'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x1e')]);router[_0x8e14('0x9')](_0x8e14('0x1f'),auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0x8e14('0x9')](_0x8e14('0x20'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x21')]);router[_0x8e14('0x9')](_0x8e14('0x22'),auth[_0x8e14('0xb')](),controller['getWhatsappInteractions']);router[_0x8e14('0x9')](_0x8e14('0x23'),auth[_0x8e14('0xb')](),controller['getTeams']);router[_0x8e14('0x9')](_0x8e14('0x24'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x25')]);router[_0x8e14('0x9')]('/:id/agents',auth['isAuthenticated'](),controller[_0x8e14('0x26')]);router[_0x8e14('0x9')]('/:id/prefixes',auth[_0x8e14('0xb')](),controller[_0x8e14('0x27')]);router['get']('/:id/fax_accounts',auth[_0x8e14('0xb')](),controller['getFaxAccounts']);router[_0x8e14('0x9')](_0x8e14('0x28'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x29')]);router[_0x8e14('0x9')](_0x8e14('0x2a'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x2b')]);router[_0x8e14('0x9')](_0x8e14('0x2c'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x2d')]);router[_0x8e14('0x9')](_0x8e14('0x2e'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x2f')]);router['get'](_0x8e14('0x30'),auth[_0x8e14('0xb')](),controller['getWhatsappAccounts']);router[_0x8e14('0x9')](_0x8e14('0x31'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x32')]);router[_0x8e14('0x9')](_0x8e14('0x33'),auth[_0x8e14('0xb')](),controller['getApiKey']);router[_0x8e14('0x34')](_0x8e14('0x14'),auth['isAuthenticated'](),controller[_0x8e14('0x35')]);router['post']('/',auth[_0x8e14('0xb')](),controller['create']);router[_0x8e14('0x34')](_0x8e14('0x36'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x37')]);router[_0x8e14('0x34')](_0x8e14('0x16'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x38')]);var upload=multer({'storage':multer[_0x8e14('0x39')]({'destination':function(_0x8f4afc,_0x48c018,_0x3aae16){_0x3aae16(null,path['join'](config[_0x8e14('0x3a')],_0x8e14('0x3b')));},'filename':function(_0xf84bf3,_0x23d577,_0x4344d4){_0x4344d4(null,util[_0x8e14('0x3c')](_0x8e14('0x3d'),Date[_0x8e14('0x3e')](),_0x23d577['originalname']));}})});router[_0x8e14('0x34')](_0x8e14('0x11'),upload[_0x8e14('0x3f')]('file'),controller[_0x8e14('0x40')]);router[_0x8e14('0x34')](_0x8e14('0x41'),auth['isAuthenticated'](),controller['login']);router[_0x8e14('0x34')](_0x8e14('0x42'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x43')]);router[_0x8e14('0x34')](_0x8e14('0x44'),auth['isAuthenticated'](),controller[_0x8e14('0x45')]);router[_0x8e14('0x34')](_0x8e14('0x46'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x47')]);router[_0x8e14('0x34')](_0x8e14('0x23'),auth['isAuthenticated'](),controller[_0x8e14('0x48')]);router['post'](_0x8e14('0x49'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x4a')]);router['post'](_0x8e14('0x4b'),auth[_0x8e14('0xb')](),controller['addMailInteractions']);router[_0x8e14('0x34')]('/:id/fax_interactions',auth['isAuthenticated'](),controller['addFaxInteractions']);router[_0x8e14('0x34')]('/:id/sms_interactions',auth[_0x8e14('0xb')](),controller[_0x8e14('0x4c')]);router[_0x8e14('0x34')](_0x8e14('0x4d'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x4e')]);router[_0x8e14('0x34')](_0x8e14('0x4f'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x50')]);router[_0x8e14('0x34')]('/:id/fax_accounts',auth[_0x8e14('0xb')](),controller['addFaxAccounts']);router[_0x8e14('0x34')](_0x8e14('0x28'),auth[_0x8e14('0xb')](),controller['addMailAccounts']);router['post'](_0x8e14('0x2a'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x51')]);router['post'](_0x8e14('0x2c'),auth['isAuthenticated'](),controller[_0x8e14('0x52')]);router[_0x8e14('0x34')](_0x8e14('0x2e'),auth['isAuthenticated'](),controller[_0x8e14('0x53')]);router[_0x8e14('0x34')](_0x8e14('0x30'),auth['isAuthenticated'](),controller[_0x8e14('0x54')]);router[_0x8e14('0x34')](_0x8e14('0x33'),auth['isAuthenticated'](),controller['createApiKey']);router['put'](_0x8e14('0xf'),auth['isAuthenticated'](),controller[_0x8e14('0x55')]);router[_0x8e14('0x56')](_0x8e14('0x57'),auth['isAuthenticated'](),controller['changePassword']);router[_0x8e14('0x58')](_0x8e14('0x16'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x59')]);router[_0x8e14('0x58')](_0x8e14('0x23'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x5a')]);router[_0x8e14('0x58')]('/:id',auth[_0x8e14('0xb')](),controller[_0x8e14('0x5b')]);router[_0x8e14('0x58')](_0x8e14('0x49'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x5c')]);router[_0x8e14('0x58')](_0x8e14('0x4b'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x5d')]);router[_0x8e14('0x58')](_0x8e14('0x5e'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x5f')]);router[_0x8e14('0x58')](_0x8e14('0x60'),auth['isAuthenticated'](),controller[_0x8e14('0x61')]);router[_0x8e14('0x58')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x8e14('0x62')]);router[_0x8e14('0x58')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router[_0x8e14('0x58')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x8e14('0x63')]);router[_0x8e14('0x58')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x8e14('0x64')]);router['delete']('/:id/openchannel_accounts',auth[_0x8e14('0xb')](),controller[_0x8e14('0x65')]);router[_0x8e14('0x58')]('/:id/sms_accounts',auth[_0x8e14('0xb')](),controller[_0x8e14('0x66')]);router[_0x8e14('0x58')](_0x8e14('0x2e'),auth['isAuthenticated'](),controller[_0x8e14('0x67')]);router[_0x8e14('0x58')](_0x8e14('0x30'),auth[_0x8e14('0xb')](),controller[_0x8e14('0x68')]);router['delete'](_0x8e14('0x33'),auth[_0x8e14('0xb')](),controller['removeApiKey']);module[_0x8e14('0x69')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index d2159aa..1be838e 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 _0xe706=['admin','user','agent','telephone','local','accountcode','BOOLEAN','DATE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept','uac','uas','certificate','active','passive','actpass','update,nonat','showWebBar','get','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','wss','avpf','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','blocked','blockedAt','UNSIGNED','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM'];(function(_0x3e973b,_0x439ae2){var _0x5b98f0=function(_0x2e9d01){while(--_0x2e9d01){_0x3e973b['push'](_0x3e973b['shift']());}};_0x5b98f0(++_0x439ae2);}(_0xe706,0xa3));var _0x6e70=function(_0x2e1a2,_0x81aa1c){_0x2e1a2=_0x2e1a2-0x0;var _0x3df6c8=_0xe706[_0x2e1a2];return _0x3df6c8;};'use strict';var Sequelize=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var util=require(_0x6e70('0x2'));var _=require('lodash');module[_0x6e70('0x3')]={'name':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x7dfbc3){this[_0x6e70('0x6')](_0x6e70('0x5'),_0x7dfbc3);this[_0x6e70('0x6')](_0x6e70('0x7'),_0x7dfbc3);},'comment':_0x6e70('0x8')},'fullname':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'set':function(_0x36357b){this[_0x6e70('0x6')](_0x6e70('0x9'),_0x36357b);this[_0x6e70('0x6')](_0x6e70('0xa'),util[_0x6e70('0xb')](_0x6e70('0xc'),_0x36357b,this[_0x6e70('0xd')](_0x6e70('0xe'))));}},'alias':{'type':Sequelize[_0x6e70('0x4')]},'email':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0xf'),'validate':{'isEmail':!![]},'set':function(_0x37b3e0){if(_0x37b3e0){this[_0x6e70('0x6')]('email',_0x37b3e0['toLowerCase']());}}},'role':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x11'),_0x6e70('0x12'),_0x6e70('0x13'),_0x6e70('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':_0x6e70('0x15')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x48bc72){this[_0x6e70('0x6')]('internal',_0x48bc72);this['setDataValue'](_0x6e70('0x16'),_0x48bc72);this[_0x6e70('0x6')]('callerid',util[_0x6e70('0xb')]('\x22%s\x22\x20<%s>',this[_0x6e70('0xd')](_0x6e70('0x9')),_0x48bc72));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x6e70('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x6e70('0x4')]},'userpic':{'type':Sequelize[_0x6e70('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x6e70('0x18')]},'voicePause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x6e70('0x18')]},'chatCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x1a')},'ipaddr':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x6e70('0x19')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1b'),'user',_0x6e70('0x1c')),'allowNull':!![],'defaultValue':_0x6e70('0x1b')},'context':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x1d')},'callingpres':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1e'),_0x6e70('0x1f'),_0x6e70('0x20'),_0x6e70('0x21'),_0x6e70('0x22'),'PROHIB_PASSED_SCREEN',_0x6e70('0x23'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x24'),'set':function(_0x42b094){this['setDataValue'](_0x6e70('0x25'),_0x42b094?_0x42b094[_0x6e70('0x26')](','):null);},'get':function(){return this['getDataValue'](_0x6e70('0x25'))?this[_0x6e70('0xd')](_0x6e70('0x25'))[_0x6e70('0x27')](','):null;},'comment':_0x6e70('0x28')},'dtmfmode':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x29'),_0x6e70('0x2a'),_0x6e70('0x2b'),_0x6e70('0x2c'),'auto'),'allowNull':!![],'defaultValue':_0x6e70('0x29')},'directmedia':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no',_0x6e70('0x2e'),_0x6e70('0x2f'),_0x6e70('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x31'),'set':function(_0x2a5444){this[_0x6e70('0x6')](_0x6e70('0x32'),_0x2a5444?_0x2a5444['join'](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x6e70('0xd')](_0x6e70('0x32'))[_0x6e70('0x27')](','):null;},'comment':_0x6e70('0x33')},'callgroup':{'type':Sequelize[_0x6e70('0x4')]},'namedcallgroup':{'type':Sequelize[_0x6e70('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x6e70('0x4')]},'language':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6e70('0x4')]},'disallow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x34')},'allow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x35'),'set':function(_0x16fc7d){this['setDataValue'](_0x6e70('0x36'),_0x16fc7d?_0x16fc7d[_0x6e70('0x26')](';'):_0x6e70('0x35'));},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x36'))?this[_0x6e70('0xd')](_0x6e70('0x36'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'set':function(_0x83847b){this[_0x6e70('0x6')](_0x6e70('0x37'),_0x83847b?_0x83847b['join'](','):null);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x37'))?this[_0x6e70('0xd')]('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x38')},'amaflags':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x6e70('0x2d')},'busylevel':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x6e70('0x10')]('yes','no',_0x6e70('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3a'),'refuse','originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3b'),_0x6e70('0x3c')),'allowNull':!![],'defaultValue':_0x6e70('0x3c')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','fingerprint',_0x6e70('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3e'),_0x6e70('0x3f'),_0x6e70('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','nonat',_0x6e70('0x2f'),_0x6e70('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x6e70('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x6e70('0x18')]},'passwordResetAt':{'type':Sequelize[_0x6e70('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x2f9be4){this[_0x6e70('0x6')](_0x6e70('0x42'),_0x2f9be4);var _0x41a861=this[_0x6e70('0x43')]({'plain':!![]});switch(_0x2f9be4){case 0x0:case 0x1:var _0x739946=_0x41a861[_0x6e70('0x25')]?_['isArray'](_0x41a861['transport'])?_0x41a861[_0x6e70('0x25')][_0x6e70('0x26')]():_0x41a861[_0x6e70('0x25')]:_0x6e70('0x24');if(_0x739946==='wss'){_0x739946='udp';}this[_0x6e70('0x6')](_0x6e70('0x25'),_0x739946);this['setDataValue']('encryption','no');this[_0x6e70('0x6')]('avpf',null);this[_0x6e70('0x6')](_0x6e70('0x44'),null);this[_0x6e70('0x6')](_0x6e70('0x45'),null);this[_0x6e70('0x6')](_0x6e70('0x46'),null);this[_0x6e70('0x6')](_0x6e70('0x47'),null);this['setDataValue'](_0x6e70('0x48'),null);this[_0x6e70('0x6')](_0x6e70('0x49'),null);this[_0x6e70('0x6')](_0x6e70('0x4a'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x6e70('0x25'),_0x6e70('0x4b'));this[_0x6e70('0x6')]('encryption','yes');this[_0x6e70('0x6')](_0x6e70('0x4c'),_0x6e70('0x2d'));this[_0x6e70('0x6')](_0x6e70('0x44'),_0x6e70('0x2d'));this['setDataValue'](_0x6e70('0x45'),_0x6e70('0x2d'));this[_0x6e70('0x6')](_0x6e70('0x46'),'yes');this[_0x6e70('0x6')]('dtlsverify','no');this['setDataValue'](_0x6e70('0x48'),_0x6e70('0x40'));this[_0x6e70('0x6')](_0x6e70('0x49'),_0x41a861[_0x6e70('0x49')]||_0x6e70('0x4d'));this['setDataValue'](_0x6e70('0x4a'),_0x41a861[_0x6e70('0x4a')]||_0x6e70('0x4e'));this[_0x6e70('0x6')](_0x6e70('0x4f'),_0x6e70('0x2d'));break;default:}}},'permissions':{'type':Sequelize[_0x6e70('0x50')],'set':function(_0xd9b4a9){this[_0x6e70('0x6')](_0x6e70('0x51'),_0xd9b4a9?_0xd9b4a9['join'](','):[]);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x51'))?_[_0x6e70('0x52')](this['getDataValue']('permissions')[_0x6e70('0x27')](','),function(_0x18ecf0){return parseInt(_0x18ecf0,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x6e70('0x53')],'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x54'))?this[_0x6e70('0xd')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x576069){if(typeof _0x576069===_0x6e70('0x55')){var _0x21e4c2=_0x576069==='1'?!![]:_0x576069==='0'?![]:_0x576069===_0x6e70('0x56')?!![]:_0x576069==='false'?![]:![];this['setDataValue']('screenrecording',_0x21e4c2);}else{this[_0x6e70('0x6')]('screenrecording',_0x576069);}}},'blocked':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![],'set':function(_0x34237d){this[_0x6e70('0x6')](_0x6e70('0x57'),_0x34237d);if(_0x34237d===!![]){this[_0x6e70('0x6')](_0x6e70('0x58'),moment());this[_0x6e70('0x6')]('loginAttempts',0x0);}else{this[_0x6e70('0x6')](_0x6e70('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0x6e70('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x6e70('0x19')](0x5)[_0x6e70('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcb91=['toLowerCase','ENUM','admin','user','local','INTEGER','accountcode','\x22%s\x22\x20<%s>','getDataValue','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','never','always','accept','originate','uac','uas','fingerprint','certificate','active','passive','update','showWebBar','get','isArray','encryption','avpf','icesupport','dtlsverify','dtlssetup','rtcp_mux','wss','force_avp','dtlscertfile','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','util','lodash','exports','STRING','setDataValue','defaultuser','fullname','format','internal','email'];(function(_0x237aa6,_0x5a22e6){var _0x587955=function(_0x33cac7){while(--_0x33cac7){_0x237aa6['push'](_0x237aa6['shift']());}};_0x587955(++_0x5a22e6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0xcb91[_0x2f6f50];return _0x2cf365;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x1cb9('0x0'));var _=require(_0x1cb9('0x1'));module[_0x1cb9('0x2')]={'name':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x8c392f){this[_0x1cb9('0x4')]('name',_0x8c392f);this[_0x1cb9('0x4')](_0x1cb9('0x5'),_0x8c392f);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'set':function(_0x3f7deb){this['setDataValue'](_0x1cb9('0x6'),_0x3f7deb);this[_0x1cb9('0x4')]('callerid',util[_0x1cb9('0x7')]('\x22%s\x22\x20<%s>',_0x3f7deb,this['getDataValue'](_0x1cb9('0x8'))));}},'alias':{'type':Sequelize[_0x1cb9('0x3')]},'email':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'unique':_0x1cb9('0x9'),'validate':{'isEmail':!![]},'set':function(_0x2fc627){if(_0x2fc627){this['setDataValue'](_0x1cb9('0x9'),_0x2fc627[_0x1cb9('0xa')]());}}},'role':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0xc'),_0x1cb9('0xd'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0xe')},'internal':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':![],'unique':_0x1cb9('0x8'),'set':function(_0x56884d){this[_0x1cb9('0x4')](_0x1cb9('0x8'),_0x56884d);this[_0x1cb9('0x4')](_0x1cb9('0x10'),_0x56884d);this[_0x1cb9('0x4')]('callerid',util['format'](_0x1cb9('0x11'),this[_0x1cb9('0x12')](_0x1cb9('0x6')),_0x56884d));}},'salt':{'type':Sequelize[_0x1cb9('0x3')]},'phone':{'type':Sequelize[_0x1cb9('0x3')]},'mobile':{'type':Sequelize[_0x1cb9('0x3')]},'address':{'type':Sequelize[_0x1cb9('0x3')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1cb9('0x3')]},'country':{'type':Sequelize[_0x1cb9('0x3')]},'online':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1cb9('0x14')]},'voicePause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':_0x1cb9('0x15')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1cb9('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x16')},'ipaddr':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x17'),_0x1cb9('0xd'),_0x1cb9('0x18')),'allowNull':!![],'defaultValue':_0x1cb9('0x17')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1cb9('0x19')},'callingpres':{'type':Sequelize['ENUM'](_0x1cb9('0x1a'),'ALLOWED_PASSED_SCREEN',_0x1cb9('0x1b'),_0x1cb9('0x1c'),_0x1cb9('0x1d'),_0x1cb9('0x1e'),'PROHIB_FAILED_SCREEN',_0x1cb9('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3a3543){this['setDataValue'](_0x1cb9('0x20'),_0x3a3543?_0x3a3543[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x20'))?this['getDataValue'](_0x1cb9('0x20'))[_0x1cb9('0x22')](','):null;},'comment':_0x1cb9('0x23')},'dtmfmode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x24'),_0x1cb9('0x25'),_0x1cb9('0x26'),_0x1cb9('0x27'),_0x1cb9('0x28')),'allowNull':!![],'defaultValue':_0x1cb9('0x24')},'directmedia':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'defaultValue':_0x1cb9('0x2b'),'set':function(_0x35f5e8){this[_0x1cb9('0x4')]('nat',_0x35f5e8?_0x35f5e8[_0x1cb9('0x21')](','):null);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2c'))?this['getDataValue'](_0x1cb9('0x2c'))['split'](','):null;},'comment':_0x1cb9('0x2d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x1cb9('0x3')]},'pickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x1cb9('0x3')]},'language':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1cb9('0x3')]},'disallow':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':![],'defaultValue':_0x1cb9('0x2e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4111b8){this[_0x1cb9('0x4')](_0x1cb9('0x2f'),_0x4111b8?_0x4111b8[_0x1cb9('0x21')](';'):_0x1cb9('0x30'));},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x2f'))?this['getDataValue'](_0x1cb9('0x2f'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![],'set':function(_0x1bf51c){this[_0x1cb9('0x4')](_0x1cb9('0x31'),_0x1bf51c?_0x1bf51c['join'](','):null);},'get':function(){return this[_0x1cb9('0x12')]('insecure')?this[_0x1cb9('0x12')](_0x1cb9('0x31'))[_0x1cb9('0x22')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x32')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'busylevel':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no',_0x1cb9('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x1cb9('0x34'),'refuse',_0x1cb9('0x35')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x36'),_0x1cb9('0x37')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':_0x1cb9('0x29')},'keepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0x1cb9('0x38'),_0x1cb9('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x3a'),_0x1cb9('0x3b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x1cb9('0xf')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x1cb9('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x1cb9('0xb')](_0x1cb9('0x29'),'no',_0x1cb9('0x2a'),_0x1cb9('0x3c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1cb9('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x1cb9('0x14')]},'passwordResetAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x319358){this[_0x1cb9('0x4')](_0x1cb9('0x3d'),_0x319358);var _0x173db5=this[_0x1cb9('0x3e')]({'plain':!![]});switch(_0x319358){case 0x0:case 0x1:var _0x75c734=_0x173db5[_0x1cb9('0x20')]?_[_0x1cb9('0x3f')](_0x173db5['transport'])?_0x173db5['transport'][_0x1cb9('0x21')]():_0x173db5['transport']:'udp';if(_0x75c734==='wss'){_0x75c734='udp';}this['setDataValue'](_0x1cb9('0x20'),_0x75c734);this[_0x1cb9('0x4')](_0x1cb9('0x40'),'no');this[_0x1cb9('0x4')](_0x1cb9('0x41'),null);this[_0x1cb9('0x4')]('force_avp',null);this[_0x1cb9('0x4')](_0x1cb9('0x42'),null);this['setDataValue']('dtlsenable',null);this[_0x1cb9('0x4')](_0x1cb9('0x43'),null);this[_0x1cb9('0x4')](_0x1cb9('0x44'),null);this[_0x1cb9('0x4')]('dtlscertfile',null);this['setDataValue']('dtlsprivatekey',null);this[_0x1cb9('0x4')](_0x1cb9('0x45'),'no');break;case 0x2:this[_0x1cb9('0x4')](_0x1cb9('0x20'),_0x1cb9('0x46'));this['setDataValue'](_0x1cb9('0x40'),_0x1cb9('0x29'));this['setDataValue']('avpf',_0x1cb9('0x29'));this['setDataValue'](_0x1cb9('0x47'),_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x42'),_0x1cb9('0x29'));this[_0x1cb9('0x4')]('dtlsenable',_0x1cb9('0x29'));this[_0x1cb9('0x4')](_0x1cb9('0x43'),'no');this[_0x1cb9('0x4')]('dtlssetup','actpass');this[_0x1cb9('0x4')](_0x1cb9('0x48'),_0x173db5[_0x1cb9('0x48')]||_0x1cb9('0x49'));this[_0x1cb9('0x4')](_0x1cb9('0x4a'),_0x173db5['dtlsprivatekey']||_0x1cb9('0x4b'));this['setDataValue'](_0x1cb9('0x45'),_0x1cb9('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xf5b006){this[_0x1cb9('0x4')](_0x1cb9('0x4c'),_0xf5b006?_0xf5b006['join'](','):[]);},'get':function(){return this[_0x1cb9('0x12')](_0x1cb9('0x4c'))?_[_0x1cb9('0x4d')](this[_0x1cb9('0x12')](_0x1cb9('0x4c'))[_0x1cb9('0x22')](','),function(_0x5a3f1d){return parseInt(_0x5a3f1d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x1cb9('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1cb9('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1cb9('0xb')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x1cb9('0x4e')],'get':function(){return this['getDataValue'](_0x1cb9('0x4f'))?this['getDataValue'](_0x1cb9('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1cb9('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![],'set':function(_0x4f8d74){if(typeof _0x4f8d74===_0x1cb9('0x50')){var _0x4cb014=_0x4f8d74==='1'?!![]:_0x4f8d74==='0'?![]:_0x4f8d74===_0x1cb9('0x51')?!![]:_0x4f8d74===_0x1cb9('0x52')?![]:![];this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4cb014);}else{this[_0x1cb9('0x4')](_0x1cb9('0x53'),_0x4f8d74);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3db146){this[_0x1cb9('0x4')]('blocked',_0x3db146);if(_0x3db146===!![]){this[_0x1cb9('0x4')](_0x1cb9('0x54'),moment());this[_0x1cb9('0x4')](_0x1cb9('0x55'),0x0);}else{this[_0x1cb9('0x4')](_0x1cb9('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x1cb9('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1cb9('0xf')](0x5)[_0x1cb9('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x1cb9('0x13')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'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 a1e4791..1e476e3 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 _0x92ab=['interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','QueueId','emit','Queue:save','VoiceQueue','voice','SIP/%s','penalty','upsert','removeQueues','channel','remove','isArray','Queue:remove','UserVoiceQueueRt','addAvatar','file','filename','getAvatar','server/files/images/logos/default_profile.png','userpic','existsSync','root','server/files/images/','download','ChatOpenTabs','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','findOne','CmContact','order','sort','pick','options','hasOwnProperty','List','Tag','Tags','color','tag','nolimit','Queue','Unknown\x20role','getVoiceQueuesRt','ChatGroup','getGroups','UserId','VoiceRecording','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','format','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','bulkCreate','LOGININPAUSE','isMiddleware','resolve','logout','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','getAssociatedQueues','flattenDeep','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','Voice','getLists','getAgents','getVoiceQueues','values','addChatInteractions','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$and','$gt','$gte','$lt','$ne','$eq','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','firstName','lastName','Contact','dialActive','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','nonce','removeApiKey','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','queues','teams','inbound','flatten','lower','col','toString','asc','desc','substring','uniqBy','orderBy','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','busy','slice','select','field','InteractionId','ui.createdAt','user_has_','_interactions','moment','util','path','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','../../mysqldb','socket.io-emitter','redis','localhost','client','http','info','User,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','role','destroy','get','admin','Users','user','Agents','agent','Telephones','telephone','filter','ignore','map','find','value','name','UserProfileResource','stack','send','index','User','type','key','includes','password','where','query','includeAll','UserSetting','userSetting','push','findAll','rows','openTabs','true','length','chat','dataValues','fax','mail','openchannel','all','show','params','model','differenceBy','keys','rawAttributes','filters','intersection','attributes','fields','include','merge','sms','whatsapp','update','body','describe','addContacts','ids','omit','internal','Setting','securePassword','validatePasswordPattern','max','min_internal','sequelize','QueryTypes','SELECT','from','isNil','voicemail','VoiceMail','fullname','email','permissions','101','103','113','110','104','105','107','108','109','100','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','isEmpty','compact','changePassword','oldPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','newPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','updatePasswordsHistory','addQueues','online','loginInPause','voicePause'];(function(_0x405fcf,_0x755feb){var _0x25cf68=function(_0x5257bd){while(--_0x5257bd){_0x405fcf['push'](_0x405fcf['shift']());}};_0x25cf68(++_0x755feb);}(_0x92ab,0xed));var _0xb92a=function(_0x4896ad,_0x4a0648){_0x4896ad=_0x4896ad-0x0;var _0x2295d8=_0x92ab[_0x4896ad];return _0x2295d8;};'use strict';var moment=require(_0xb92a('0x0'));var util=require(_0xb92a('0x1'));var path=require(_0xb92a('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb92a('0x3'));var jayson=require('jayson/promise');var Redis=require(_0xb92a('0x4'));var authService=require(_0xb92a('0x5'));var qs=require(_0xb92a('0x6'));var logger=require(_0xb92a('0x7'))(_0xb92a('0x8'));var utils=require(_0xb92a('0x9'));var config=require('../../config/environment');var licenseUtil=require(_0xb92a('0xa'));var APIBadRequestError=require(_0xb92a('0xb'))[_0xb92a('0xc')];var APINotFoundError=require(_0xb92a('0xb'))[_0xb92a('0xd')];var APIHandleError=require('../../errors/api')['handleError'];var db=require(_0xb92a('0xe'))['db'];var socket=require(_0xb92a('0xf'))(new Redis(config['redis']));require('./user.socket')['register'](socket);config[_0xb92a('0x10')]=_['defaults'](config[_0xb92a('0x10')],{'host':_0xb92a('0x11'),'port':0x18eb});var amiClient=jayson[_0xb92a('0x12')][_0xb92a('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x46e392,_0x3dcbe1,_0x50c785,_0x2105f9){return new Promise(function(_0x5404df,_0x140927){var _0x6b5f47=_0x2105f9||amiClient;return _0x6b5f47['request'](_0x46e392,_0x50c785)['then'](function(_0x15c295){logger[_0xb92a('0x14')](_0xb92a('0x15'),_0x3dcbe1,'request\x20sent');logger[_0xb92a('0x16')]('User,\x20%s,\x20%s,\x20%s',_0x3dcbe1,'request\x20sent',JSON[_0xb92a('0x17')](_0x15c295));if(_0x15c295[_0xb92a('0x18')]){if(_0x15c295[_0xb92a('0x18')]['code']===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x3dcbe1,_0x15c295[_0xb92a('0x18')][_0xb92a('0x19')]);return _0x140927(_0x15c295[_0xb92a('0x18')][_0xb92a('0x19')]);}logger[_0xb92a('0x18')](_0xb92a('0x15'),_0x3dcbe1,_0x15c295[_0xb92a('0x18')][_0xb92a('0x19')]);return _0x5404df(_0x15c295[_0xb92a('0x18')][_0xb92a('0x19')]);}else{logger['info'](_0xb92a('0x15'),_0x3dcbe1,_0xb92a('0x1a'));_0x5404df(_0x15c295[_0xb92a('0x1b')][_0xb92a('0x19')]);}})[_0xb92a('0x1c')](function(_0x5847a2){logger[_0xb92a('0x18')](_0xb92a('0x15'),_0x3dcbe1,_0x5847a2);_0x140927(_0x5847a2);});});}function respondWithStatusCode(_0x43edb5,_0xce27fd){_0xce27fd=_0xce27fd||0xcc;return function(_0x26d6b1){if(_0x26d6b1){return _0x43edb5[_0xb92a('0x1d')](_0xce27fd);}return _0x43edb5[_0xb92a('0x1e')](_0xce27fd)[_0xb92a('0x1f')]();};}function respondWithResult(_0x290723,_0x37af0b){_0x37af0b=_0x37af0b||0xc8;return function(_0x1432c1){if(_0x1432c1){return _0x290723[_0xb92a('0x1e')](_0x37af0b)[_0xb92a('0x20')](_0x1432c1);}};}function respondWithFilteredResult(_0x374db9,_0x35c9a6){return function(_0x4e0c50){if(_0x4e0c50){var _0x375a51=typeof _0x35c9a6[_0xb92a('0x21')]===_0xb92a('0x22')&&typeof _0x35c9a6[_0xb92a('0x23')]===_0xb92a('0x22');var _0x4906e5=_0x4e0c50[_0xb92a('0x24')];var _0x206860=_0x375a51?0x0:_0x35c9a6[_0xb92a('0x21')];var _0x4eb963=_0x375a51?_0x4e0c50['count']:_0x35c9a6[_0xb92a('0x21')]+_0x35c9a6[_0xb92a('0x23')];var _0x1acc6b;if(_0x4eb963>=_0x4906e5){_0x4eb963=_0x4906e5;_0x1acc6b=0xc8;}else{_0x1acc6b=0xce;}_0x374db9[_0xb92a('0x1e')](_0x1acc6b);return _0x374db9[_0xb92a('0x25')](_0xb92a('0x26'),_0x206860+'-'+_0x4eb963+'/'+_0x4906e5)[_0xb92a('0x20')](_0x4e0c50);}return null;};}function saveUpdates(_0x5ac69c){return function(_0x763c7c){if(_0x763c7c){return _0x763c7c['update'](_0x5ac69c)[_0xb92a('0x27')](function(_0x2e7e03){if(_0x2e7e03[_0xb92a('0x28')]==='agent'){socket['emit']('userNotification:recalc:'+_0x2e7e03['id'],_0x2e7e03);}return _0x2e7e03;});}return null;};}function removeEntity(_0x4f4393){return function(_0x493cf5){if(_0x493cf5){return _0x493cf5[_0xb92a('0x29')]()[_0xb92a('0x27')](function(){var _0x426446=_0x493cf5[_0xb92a('0x2a')]({'plain':!![]});if(_0x426446[_0xb92a('0x28')]===_0xb92a('0x2b'))return;var _0x28123f=[{'name':_0xb92a('0x2c'),'value':_0xb92a('0x2d'),'ignore':!![]},{'name':_0xb92a('0x2e'),'value':_0xb92a('0x2f'),'ignore':![]},{'name':_0xb92a('0x30'),'value':_0xb92a('0x31'),'ignore':![]}];var _0x5cb2a8=_(_0x28123f)[_0xb92a('0x32')](_0xb92a('0x33'))[_0xb92a('0x34')]('value')['value']();if(_['includes'](_0x5cb2a8,_0x426446[_0xb92a('0x28')])){return;}var _0x3ad65c=_[_0xb92a('0x35')](_0x28123f,[_0xb92a('0x36'),_0x426446[_0xb92a('0x28')]])[_0xb92a('0x37')];return db[_0xb92a('0x38')]['destroy']({'where':{'type':_0x3ad65c,'resourceId':_0x426446['id']}})[_0xb92a('0x27')](function(){return _0x493cf5;});})[_0xb92a('0x27')](function(){_0x4f4393[_0xb92a('0x1e')](0xcc)[_0xb92a('0x1f')]();});}};}function handleEntityNotFound(_0xb0321a){return function(_0x5cdaae){if(!_0x5cdaae){_0xb0321a[_0xb92a('0x1d')](0x194);}return _0x5cdaae;};}function handleError(_0x3428d2,_0x1b17f4){_0x1b17f4=_0x1b17f4||0x1f4;return function(_0x418aff){logger[_0xb92a('0x18')](_0x418aff[_0xb92a('0x39')]);if(_0x418aff[_0xb92a('0x37')]){delete _0x418aff[_0xb92a('0x37')];}_0x3428d2[_0xb92a('0x1e')](_0x1b17f4)[_0xb92a('0x3a')](_0x418aff);};}exports[_0xb92a('0x3b')]=function(_0x1a6d89,_0x8b3671){var _0x3d3015={},_0x339696={'count':0x0,'rows':[]};var _0x5c8d58=_(db[_0xb92a('0x3c')]['rawAttributes'])[_0xb92a('0x34')](function(_0x178558){return{'name':_0x178558['fieldName'],'type':_0x178558[_0xb92a('0x3d')][_0xb92a('0x3e')]};})[_0xb92a('0x32')](function(_0x2c5d55){return!_[_0xb92a('0x3f')]([_0xb92a('0x40'),'salt'],_0x2c5d55[_0xb92a('0x37')]);})[_0xb92a('0x36')]();_0x3d3015=qs['getOptions'](_0x5c8d58,_0x1a6d89);var _0x92eed6={'where':_0x3d3015[_0xb92a('0x41')]};return db[_0xb92a('0x3c')]['count'](_0x92eed6)[_0xb92a('0x27')](function(_0x570a6a){_0x339696[_0xb92a('0x24')]=_0x570a6a;if(_0x1a6d89[_0xb92a('0x42')][_0xb92a('0x43')]){_0x3d3015['include']=[{'all':!![]}];}if(_0x1a6d89[_0xb92a('0x42')]['userSetting']==='true'){_0x3d3015['include']=[{'model':db[_0xb92a('0x44')],'as':_0xb92a('0x45')}];}if(!_[_0xb92a('0x3f')](_0x3d3015['attributes'],'id')){_0x3d3015['attributes'][_0xb92a('0x46')]('id');}return db['User'][_0xb92a('0x47')](_0x3d3015);})[_0xb92a('0x27')](function(_0x346350){_0x339696[_0xb92a('0x48')]=_0x346350;if(_0x1a6d89[_0xb92a('0x42')][_0xb92a('0x49')]===_0xb92a('0x4a')){var _0x22a6d8=[];for(var _0x4e65=0x0;_0x4e65<_0x339696[_0xb92a('0x48')][_0xb92a('0x4b')];_0x4e65++){_0x22a6d8[_0xb92a('0x46')](get_open_tabs(_0xb92a('0x4c'),_0x339696[_0xb92a('0x48')][_0x4e65][_0xb92a('0x4d')]));_0x22a6d8[_0xb92a('0x46')](get_open_tabs('sms',_0x339696[_0xb92a('0x48')][_0x4e65][_0xb92a('0x4d')]));_0x22a6d8[_0xb92a('0x46')](get_open_tabs(_0xb92a('0x4e'),_0x339696['rows'][_0x4e65]['dataValues']));_0x22a6d8['push'](get_open_tabs(_0xb92a('0x4f'),_0x339696[_0xb92a('0x48')][_0x4e65][_0xb92a('0x4d')]));_0x22a6d8[_0xb92a('0x46')](get_open_tabs(_0xb92a('0x50'),_0x339696['rows'][_0x4e65][_0xb92a('0x4d')]));_0x22a6d8[_0xb92a('0x46')](get_open_tabs('whatsapp',_0x339696[_0xb92a('0x48')][_0x4e65][_0xb92a('0x4d')]));}return Promise[_0xb92a('0x51')](_0x22a6d8)[_0xb92a('0x27')](function(){return _0x339696;});}else{return _0x339696;}})[_0xb92a('0x27')](respondWithFilteredResult(_0x8b3671,_0x3d3015))[_0xb92a('0x1c')](handleError(_0x8b3671,null));};exports[_0xb92a('0x52')]=function(_0x5c8489,_0x25f5a7){var _0x3b8128={'raw':![],'where':{'id':_0x5c8489[_0xb92a('0x53')]['id']}},_0x21be09={};_0x21be09[_0xb92a('0x54')]=_[_0xb92a('0x55')](_[_0xb92a('0x56')](db['User'][_0xb92a('0x57')]),[_0xb92a('0x40'),'salt']);_0x21be09[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x5c8489[_0xb92a('0x42')]);_0x21be09[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0x21be09[_0xb92a('0x54')],_0x21be09[_0xb92a('0x42')]);_0x3b8128[_0xb92a('0x5a')]=_[_0xb92a('0x59')](_0x21be09[_0xb92a('0x54')],qs[_0xb92a('0x5b')](_0x5c8489[_0xb92a('0x42')][_0xb92a('0x5b')]));_0x3b8128[_0xb92a('0x5a')]=_0x3b8128['attributes'][_0xb92a('0x4b')]?_0x3b8128[_0xb92a('0x5a')]:_0x21be09[_0xb92a('0x54')];if(_0x5c8489['query']['includeAll']){_0x3b8128['include']=[{'all':!![]}];}if(_0x5c8489[_0xb92a('0x42')][_0xb92a('0x45')]===_0xb92a('0x4a')){_0x3b8128[_0xb92a('0x5c')]=[{'model':db[_0xb92a('0x44')],'as':'userSetting'}];}_0x3b8128=_[_0xb92a('0x5d')]({},_0x3b8128,_0x5c8489['options']);if(!_[_0xb92a('0x3f')](_0x3b8128['attributes'],'id')){_0x3b8128[_0xb92a('0x5a')]['push']('id');}return db[_0xb92a('0x3c')][_0xb92a('0x35')](_0x3b8128)[_0xb92a('0x27')](handleEntityNotFound(_0x25f5a7,null))[_0xb92a('0x27')](function(_0x481587){var _0x3830db=[];values=_0x481587;if(_0x5c8489[_0xb92a('0x42')]['openTabs']==='true'){_0x3830db['push'](get_open_tabs(_0xb92a('0x4c'),_0x481587[_0xb92a('0x4d')]));_0x3830db[_0xb92a('0x46')](get_open_tabs(_0xb92a('0x5e'),_0x481587[_0xb92a('0x4d')]));_0x3830db['push'](get_open_tabs(_0xb92a('0x50'),_0x481587[_0xb92a('0x4d')]));_0x3830db[_0xb92a('0x46')](get_open_tabs(_0xb92a('0x5f'),_0x481587[_0xb92a('0x4d')]));_0x3830db['push'](get_open_tabs('fax',_0x481587[_0xb92a('0x4d')]));_0x3830db['push'](get_open_tabs(_0xb92a('0x4f'),_0x481587[_0xb92a('0x4d')]));return Promise[_0xb92a('0x51')](_0x3830db);}else{return values;}})[_0xb92a('0x27')](function(){return values;})[_0xb92a('0x27')](respondWithResult(_0x25f5a7,null))[_0xb92a('0x1c')](handleError(_0x25f5a7,null));};exports[_0xb92a('0x60')]=function(_0x5784f8,_0x4aee7b){if(_0x5784f8[_0xb92a('0x61')]['id']){delete _0x5784f8[_0xb92a('0x61')]['id'];}delete _0x5784f8[_0xb92a('0x61')][_0xb92a('0x28')];return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x5784f8['params']['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x4aee7b,null))['then'](saveUpdates(_0x5784f8[_0xb92a('0x61')],null))[_0xb92a('0x27')](respondWithResult(_0x4aee7b,null))[_0xb92a('0x1c')](handleError(_0x4aee7b,null));};exports['describe']=function(_0x537c07,_0x2b178f){return db[_0xb92a('0x3c')][_0xb92a('0x62')]()[_0xb92a('0x27')](respondWithResult(_0x2b178f,null))[_0xb92a('0x1c')](handleError(_0x2b178f,null));};exports['addContacts']=function(_0x441d0c,_0x14fffb){return db['User']['find']({'where':{'id':_0x441d0c[_0xb92a('0x53')]['id']}})['then'](handleEntityNotFound(_0x14fffb,null))['then'](function(_0x122d7b){if(_0x122d7b){return _0x122d7b[_0xb92a('0x63')](_0x441d0c[_0xb92a('0x61')][_0xb92a('0x64')],_[_0xb92a('0x65')](_0x441d0c['body'],[_0xb92a('0x64'),'id'])||{});}})[_0xb92a('0x27')](respondWithResult(_0x14fffb,null))[_0xb92a('0x1c')](handleError(_0x14fffb,null));};function validateUser(_0x524254){return new Promise(function(_0x3f18d1,_0x101068){if(_0x524254[_0xb92a('0x66')])return _0x3f18d1(_0x524254);return db[_0xb92a('0x67')]['findById'](0x1)[_0xb92a('0x27')](function(_0x295281){if(_0x295281[_0xb92a('0x68')])authService[_0xb92a('0x69')](_0x524254['password']);db[_0xb92a('0x3c')][_0xb92a('0x6a')](_0xb92a('0x66'))[_0xb92a('0x27')](function(_0x5e65be){if(_['isNil'](_0x5e65be)){_0x524254[_0xb92a('0x66')]=_0x295281[_0xb92a('0x6b')]||0x1;return;}if(_['isNil'](_0x295281['min_internal'])||_0x295281[_0xb92a('0x6b')]===_0x5e65be){_0x524254[_0xb92a('0x66')]=_0x5e65be+0x1;return;}if(_0x295281[_0xb92a('0x6b')]>_0x5e65be){_0x524254[_0xb92a('0x66')]=_0x295281[_0xb92a('0x6b')];return;}return db[_0xb92a('0x6c')]['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0xb92a('0x6c')][_0xb92a('0x6d')][_0xb92a('0x6e')]})[_0xb92a('0x27')](function(_0x4ff345){if(_0x4ff345&&_0x4ff345[_0xb92a('0x4b')]){for(var _0x157590=0x0,_0x32057d=_0x4ff345[_0xb92a('0x4b')];_0x157590<_0x32057d&&_['isNil'](_0x524254[_0xb92a('0x66')]);_0x157590++){if(_0x295281['min_internal']<=_0x4ff345[_0x157590][_0xb92a('0x6f')]){_0x524254[_0xb92a('0x66')]=_0x4ff345[_0x157590][_0xb92a('0x6f')];}else if(_0x295281[_0xb92a('0x6b')]>_0x4ff345[_0x157590][_0xb92a('0x6f')]&&_0x295281['min_internal']<=_0x4ff345[_0x157590]['to']){_0x524254[_0xb92a('0x66')]=_0x295281['min_internal'];}}}if(_[_0xb92a('0x70')](_0x524254[_0xb92a('0x66')])){_0x524254[_0xb92a('0x66')]=_0x5e65be+0x1;}return _0x3f18d1(_0x524254);});});})[_0xb92a('0x1c')](function(_0xbd9773){_0x101068(_0xbd9773);});});}function updateUser(_0x18845c){return new Promise(function(_0x354123,_0xb8a155){try{if(_0x18845c[_0xb92a('0x71')]){_0x18845c['mailbox']=_0x18845c[_0xb92a('0x66')];_0x18845c[_0xb92a('0x72')]={'mailbox':_0x18845c[_0xb92a('0x66')],'password':_0x18845c['password'],'fullname':_0x18845c[_0xb92a('0x73')],'email':_0x18845c[_0xb92a('0x74')]};}if(_0x18845c[_0xb92a('0x28')]===_0xb92a('0x2f')){if(!_0x18845c[_0xb92a('0x75')])_0x18845c['permissions']=[_0xb92a('0x76'),'102',_0xb92a('0x77'),_0xb92a('0x78'),_0xb92a('0x79'),_0xb92a('0x7a'),_0xb92a('0x7b'),'106',_0xb92a('0x7c'),_0xb92a('0x7d'),_0xb92a('0x7e'),_0xb92a('0x7f'),_0xb92a('0x80'),_0xb92a('0x81'),_0xb92a('0x82')];}_0x354123(_0x18845c);}catch(_0x5a972a){_0xb8a155(_0x5a972a);}});}exports[_0xb92a('0x83')]=function(_0x35febc,_0x15acc7){if(_0x35febc[_0xb92a('0x2d')][_0xb92a('0x28')]===_0xb92a('0x2f'))throw new Error(_0xb92a('0x84'));if(_0x35febc[_0xb92a('0x61')][_0xb92a('0x28')]===_0xb92a('0x2d')&&_0x35febc['user'][_0xb92a('0x28')]!==_0xb92a('0x2b')){throw new Error(_0xb92a('0x85'));}if(_0x35febc[_0xb92a('0x61')][_0xb92a('0x28')]===_0xb92a('0x2b')&&_0x35febc[_0xb92a('0x2d')][_0xb92a('0x28')]!==_0xb92a('0x2b')){throw new Error(_0xb92a('0x86'));}return licenseUtil['checkUserLimits']([_0x35febc['body']])[_0xb92a('0x27')](function(){return validateUser(_0x35febc[_0xb92a('0x61')]);})[_0xb92a('0x27')](function(_0x45ef85){return updateUser(_0x45ef85)[_0xb92a('0x27')](function(_0x1666b1){if(_0x1666b1[_0xb92a('0x28')]==='admin'){_0x1666b1[_0xb92a('0x87')]=_0x35febc[_0xb92a('0x2d')][_0xb92a('0x87')];delete _0x1666b1[_0xb92a('0x88')];}return _0x1666b1;});})[_0xb92a('0x27')](function(_0x55f478){return db[_0xb92a('0x3c')][_0xb92a('0x83')](_0x55f478,{'include':[{'model':db[_0xb92a('0x72')],'as':_0xb92a('0x72')}]});})['then'](function(_0x275dbd){if(_0x35febc[_0xb92a('0x61')][_0xb92a('0x28')]==='user')return _0x275dbd;if(_0x35febc['user'][_0xb92a('0x28')]!=='user')return _0x275dbd;return db[_0xb92a('0x89')][_0xb92a('0x35')]({'where':{'name':_0x275dbd[_0xb92a('0x28')]===_0xb92a('0x2f')?_0xb92a('0x2e'):_0xb92a('0x30'),'userProfileId':_0x35febc[_0xb92a('0x2d')][_0xb92a('0x88')]},'raw':!![]})[_0xb92a('0x27')](function(_0x428a57){if(!_0x428a57||_0x428a57[_0xb92a('0x8a')]!=0x0)return _0x275dbd;return db[_0xb92a('0x38')][_0xb92a('0x83')]({'name':_0x275dbd[_0xb92a('0x37')],'resourceId':_0x275dbd['id'],'type':_0x428a57[_0xb92a('0x37')],'sectionId':_0x428a57['id']},{})[_0xb92a('0x27')](function(){return _0x275dbd;});})[_0xb92a('0x1c')](function(_0x7d8314){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7d8314);throw _0x7d8314;});})[_0xb92a('0x27')](respondWithResult(_0x15acc7,0xc9))[_0xb92a('0x1c')](handleError(_0x15acc7,null));};exports['bulkCreate']=function(_0x58902f,_0x1a2e57){var _0x558c45=_0x58902f[_0xb92a('0x61')];var _0x54a85d=[];if(_0x58902f[_0xb92a('0x2d')][_0xb92a('0x28')]===_0xb92a('0x2f'))throw new Error(_0xb92a('0x84'));if(_[_0xb92a('0x8b')](_0x558c45,[_0xb92a('0x28'),_0xb92a('0x2d')])&&_0x58902f[_0xb92a('0x2d')][_0xb92a('0x28')]!==_0xb92a('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xb92a('0x8b')](_0x558c45,[_0xb92a('0x28'),_0xb92a('0x2b')])&&_0x58902f['user'][_0xb92a('0x28')]!==_0xb92a('0x2b')){throw new Error(_0xb92a('0x8c'));}return licenseUtil[_0xb92a('0x8d')](_0x558c45)['then'](function(){return validateUser(_0x558c45[0x0]);})[_0xb92a('0x27')](function(){for(var _0x1f1a88=0x1;_0x1f1a88<_0x558c45[_0xb92a('0x4b')];_0x1f1a88++){var _0x37330b=_0x558c45[_0x1f1a88-0x1]['internal'];if(!_0x558c45[_0x1f1a88][_0xb92a('0x66')])_0x558c45[_0x1f1a88][_0xb92a('0x66')]=_0x37330b+0x1;_0x54a85d['push'](validateUser(_0x558c45[_0x1f1a88]));}return Promise[_0xb92a('0x51')](_0x54a85d);})[_0xb92a('0x27')](function(){_0x54a85d=[];for(var _0x14bac2=0x0;_0x14bac2<_0x558c45['length'];_0x14bac2++){_0x54a85d[_0xb92a('0x46')](updateUser(_0x558c45[_0x14bac2]));}return Promise[_0xb92a('0x51')](_0x54a85d);})['then'](function(){_0x54a85d=_0x558c45[_0xb92a('0x34')](function(_0x2a8a3d){return db[_0xb92a('0x3c')]['create'](_0x2a8a3d,{'include':[{'model':db['VoiceMail'],'as':_0xb92a('0x72')}]})[_0xb92a('0x27')](function(_0x31f717){_0x2a8a3d['id']=_0x31f717['id'];return _0x2a8a3d;});});return Promise['all'](_0x54a85d);})[_0xb92a('0x27')](function(_0xf4bbd3){if(_0x58902f[_0xb92a('0x61')][_0xb92a('0x28')]===_0xb92a('0x2d'))return _0xf4bbd3;if(_0x58902f[_0xb92a('0x2d')]['role']!==_0xb92a('0x2d'))return _0xf4bbd3;var _0x3e0299=_['some'](_0xf4bbd3,function(_0x2908c2){return _0x2908c2[_0xb92a('0x28')]===_0xb92a('0x2f')||_0x2908c2[_0xb92a('0x28')]===_0xb92a('0x31');});if(!_0x3e0299)return _0xf4bbd3;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':[_0xb92a('0x2e'),_0xb92a('0x30')]},'userProfileId':_0x58902f[_0xb92a('0x2d')][_0xb92a('0x88')]},'raw':!![]})[_0xb92a('0x27')](function(_0x3042bc){if(_[_0xb92a('0x8e')](_0x3042bc)||!_[_0xb92a('0x8b')](_0x3042bc,[_0xb92a('0x8a'),0x0]))return _0xf4bbd3;_0x54a85d=[];var _0x5005a9=_(_0x3042bc)[_0xb92a('0x34')](function(_0xfd9085){if(_0xfd9085[_0xb92a('0x8a')]===0x1)return;return _0xfd9085['name']===_0xb92a('0x2e')?_0xb92a('0x2f'):_0xb92a('0x31');})[_0xb92a('0x8f')]()[_0xb92a('0x36')]();for(var _0x1fe381=0x0;_0x1fe381<_0xf4bbd3[_0xb92a('0x4b')];_0x1fe381++){if(!_[_0xb92a('0x3f')](_0x5005a9,_0xf4bbd3[_0x1fe381]['role']))return;var _0x3b2fdf=_0xf4bbd3[_0x1fe381]['role']===_0xb92a('0x2f')?_0xb92a('0x2e'):_0xb92a('0x30');_0x54a85d[_0xb92a('0x46')](db[_0xb92a('0x38')][_0xb92a('0x83')]({'name':_0xf4bbd3[_0x1fe381][_0xb92a('0x37')],'resourceId':_0xf4bbd3[_0x1fe381]['id'],'type':_0x3b2fdf,'sectionId':_['find'](_0x3042bc,['name',_0x3b2fdf])['id']},{}));}return Promise[_0xb92a('0x51')](_0x54a85d);});})[_0xb92a('0x27')](respondWithResult(_0x1a2e57,0xc9))['catch'](handleError(_0x1a2e57,null));};exports[_0xb92a('0x90')]=function(_0x479083,_0x554a03){if(_0x479083[_0xb92a('0x61')]['id']){delete _0x479083['body']['id'];}return db['User'][_0xb92a('0x35')]({'where':{'id':_0x479083[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](function(_0x38360c){if(!_0x38360c)return null;if(_0x38360c['id']===_0x479083['user']['id']){if(!_0x479083['body'][_0xb92a('0x91')]||!_0x479083['body']['newPassword']){throw new db[(_0xb92a('0x92'))][(_0xb92a('0x93'))](_0xb92a('0x94'));}if(!_0x38360c[_0xb92a('0x95')](_0x479083[_0xb92a('0x61')][_0xb92a('0x91')])){throw new db[(_0xb92a('0x92'))]['ValidationError']('Wrong\x20credentials');}if(_0x479083[_0xb92a('0x61')][_0xb92a('0x91')]===_0x479083[_0xb92a('0x61')]['newPassword']){throw new db['Sequelize'][(_0xb92a('0x93'))](_0xb92a('0x96'));}}else if(_0x479083[_0xb92a('0x2d')][_0xb92a('0x28')]===_0xb92a('0x2b')){if(!_0x479083[_0xb92a('0x61')][_0xb92a('0x97')]){throw new db[(_0xb92a('0x92'))]['ValidationError'](_0xb92a('0x98'));}}else if(_0x479083['user']['role']===_0xb92a('0x2d')){if(!_0x479083[_0xb92a('0x61')][_0xb92a('0x97')]){throw new db[(_0xb92a('0x92'))][(_0xb92a('0x93'))](_0xb92a('0x98'));}if(_0x38360c[_0xb92a('0x28')]!==_0xb92a('0x2f')){throw new db[(_0xb92a('0x92'))]['ValidationError'](_0xb92a('0x84'));}}else{throw new db['Sequelize'][(_0xb92a('0x93'))](_0xb92a('0x84'));}return _0x38360c;})[_0xb92a('0x27')](handleEntityNotFound(_0x554a03,null))[_0xb92a('0x27')](function(_0x4a203b){return db[_0xb92a('0x67')]['findOne']({'attributes':['id',_0xb92a('0x68'),_0xb92a('0x99'),_0xb92a('0x9a')]})[_0xb92a('0x27')](function(_0x3b4a7a){if(_0x3b4a7a['securePassword'])authService['validatePasswordPattern'](_0x479083[_0xb92a('0x61')][_0xb92a('0x97')]);if(!_0x3b4a7a[_0xb92a('0x99')]||!_0x4a203b['previousPasswords'])return _0x4a203b;authService[_0xb92a('0x9b')](_0x479083[_0xb92a('0x61')][_0xb92a('0x97')],_0x4a203b[_0xb92a('0x9c')],_0x3b4a7a[_0xb92a('0x9a')]);return _0x4a203b;})[_0xb92a('0x27')](saveUpdates({'password':_0x479083[_0xb92a('0x61')]['newPassword'],'passwordResetAt':_0x479083[_0xb92a('0x2d')]['id']==_0x479083[_0xb92a('0x53')]['id']?moment():null,'previousPasswords':authService[_0xb92a('0x9d')](_0x479083[_0xb92a('0x61')][_0xb92a('0x97')],_0x4a203b['previousPasswords'])},null));})['then'](respondWithResult(_0x554a03,null))[_0xb92a('0x1c')](handleError(_0x554a03,null));};exports[_0xb92a('0x9e')]=function(_0x35b2ec,_0x33705b){var _0x3d4cb6=_0x35b2ec[_0xb92a('0x61')]['channel'];return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x35b2ec[_0xb92a('0x53')]['id']},'attributes':['id',_0xb92a('0x37'),_0xb92a('0x28'),_0xb92a('0x9f'),_0xb92a('0xa0'),_0xb92a('0xa1'),_0xb92a('0xa2')]})[_0xb92a('0x27')](handleEntityNotFound(_0x33705b,null))['then'](function(_0x20fa2f){if(_0x20fa2f){if(!utils[_0xb92a('0xa3')](_0x3d4cb6)){throw new db['Sequelize'][(_0xb92a('0x93'))](_0xb92a('0xa4'));}return _0x20fa2f[_0xb92a('0xa5')+_[_0xb92a('0xa6')](_0x3d4cb6[_0xb92a('0xa7')]())+_0xb92a('0xa8')](_0x35b2ec[_0xb92a('0x61')][_0xb92a('0x64')],{'penalty':_0x35b2ec['body']['penalty']||0x0})['spread'](function(_0x5e380b){for(var _0xe6eda0=0x0;_0xe6eda0<_0x35b2ec['body'][_0xb92a('0x64')]['length'];_0xe6eda0+=0x1){var _0x299caa={'UserId':Number(_0x35b2ec[_0xb92a('0x53')]['id'])};_0x299caa[_[_0xb92a('0xa6')](_0x3d4cb6[_0xb92a('0xa7')]())+_0xb92a('0xa9')]=Number(_0x35b2ec['body'][_0xb92a('0x64')][_0xe6eda0]);socket[_0xb92a('0xaa')]('user'+_[_0xb92a('0xa6')](_0x3d4cb6['toLowerCase']())+_0xb92a('0xab'),_0x299caa);}return _0x5e380b;})[_0xb92a('0x27')](function(){if(_0x3d4cb6==='voice'){return db[_0xb92a('0xac')][_0xb92a('0x47')]({'where':{'id':_0x35b2ec[_0xb92a('0x61')]['ids']||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x19d5fd){var _0xb4e46c=_0x20fa2f[_0xb92a('0x2a')]({'plain':!![]});var _0x3a0dcd=[];if(_0x3d4cb6===_0xb92a('0xad')&&_0xb4e46c['role']===_0xb92a('0x2f')&&_0xb4e46c[_0xb92a('0x9f')]){for(let _0x3a9348=0x0;_0x3a9348<_0x19d5fd['length'];_0x3a9348+=0x1){_0x3a0dcd[_0xb92a('0x46')]({'membername':_0xb4e46c[_0xb92a('0x37')],'UserId':_0xb4e46c['id'],'queue_name':_0x19d5fd[_0x3a9348][_0xb92a('0x37')],'VoiceQueueId':_0x19d5fd[_0x3a9348]['id'],'interface':_['isNil'](_0xb4e46c[_0xb92a('0xa2')])?util['format'](_0xb92a('0xae'),_0xb4e46c['name']):_0xb4e46c[_0xb92a('0xa2')],'paused':_0xb4e46c['voicePause']||![],'penalty':_0x35b2ec[_0xb92a('0x61')][_0xb92a('0xaf')]||0x0});}return Promise['all'](_0x3a0dcd['map'](function(_0x346a8e){return db['UserVoiceQueueRt'][_0xb92a('0xb0')](_0x346a8e);}));}return _0x20fa2f;});}})[_0xb92a('0x27')](respondWithStatusCode(_0x33705b,null))[_0xb92a('0x1c')](handleError(_0x33705b,null));};exports[_0xb92a('0xb1')]=function(_0x1714ef,_0x41539b){var _0x2db52f,_0x581068;return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x1714ef[_0xb92a('0x53')]['id']},'attributes':['id','name',_0xb92a('0x28')]})[_0xb92a('0x27')](handleEntityNotFound(_0x41539b,null))[_0xb92a('0x27')](function(_0x256098){if(_0x256098){_0x2db52f=_0x256098;if(!_0x1714ef['query'][_0xb92a('0xb2')]||!utils['isValidChannel'](_0x1714ef[_0xb92a('0x42')][_0xb92a('0xb2')])){throw new db[(_0xb92a('0x92'))]['ValidationError'](_0xb92a('0xa4'));}return _0x256098[_0xb92a('0xb3')+_[_0xb92a('0xa6')](_0x1714ef[_0xb92a('0x42')]['channel']['toLowerCase']())+_0xb92a('0xa8')](_0x1714ef[_0xb92a('0x42')][_0xb92a('0x64')]);}})['then'](function(_0x3bfd9a){if(_[_0xb92a('0xb4')](_0x1714ef[_0xb92a('0x42')]['ids'])){for(var _0x3e81bd=0x0;_0x3e81bd<_0x1714ef[_0xb92a('0x42')][_0xb92a('0x64')][_0xb92a('0x4b')];_0x3e81bd+=0x1){_0x581068={'UserId':Number(_0x1714ef[_0xb92a('0x53')]['id'])};_0x581068[_['capitalize'](_0x1714ef[_0xb92a('0x42')][_0xb92a('0xb2')][_0xb92a('0xa7')]())+_0xb92a('0xa9')]=Number(_0x1714ef[_0xb92a('0x42')][_0xb92a('0x64')][_0x3e81bd]);socket['emit'](_0xb92a('0x2d')+_[_0xb92a('0xa6')](_0x1714ef['query']['channel'][_0xb92a('0xa7')]())+_0xb92a('0xb5'),_0x581068);}}else{_0x581068={'UserId':Number(_0x1714ef[_0xb92a('0x53')]['id'])};_0x581068[_[_0xb92a('0xa6')](_0x1714ef[_0xb92a('0x42')][_0xb92a('0xb2')][_0xb92a('0xa7')]())+'QueueId']=Number(_0x1714ef[_0xb92a('0x42')][_0xb92a('0x64')]);socket[_0xb92a('0xaa')](_0xb92a('0x2d')+_['capitalize'](_0x1714ef['query'][_0xb92a('0xb2')]['toLowerCase']())+'Queue:remove',_0x581068);}return _0x3bfd9a;})[_0xb92a('0x27')](function(){if(_0x1714ef[_0xb92a('0x42')][_0xb92a('0xb2')]==='voice'){return db[_0xb92a('0xb6')][_0xb92a('0x29')]({'where':{'UserId':_0x1714ef[_0xb92a('0x53')]['id'],'VoiceQueueId':_0x1714ef[_0xb92a('0x42')][_0xb92a('0x64')]},'individualHooks':!![]})['then'](function(){return _0x2db52f;});}return _0x2db52f;})['then'](respondWithStatusCode(_0x41539b,null))[_0xb92a('0x1c')](handleError(_0x41539b,null));};exports[_0xb92a('0xb7')]=function(_0x517ea7,_0x4a6a51){_0x517ea7['body']['userpic']=_0x517ea7[_0xb92a('0xb8')][_0xb92a('0xb9')];return db[_0xb92a('0x3c')]['find']({'where':{'id':_0x517ea7['params']['id']}})['then'](handleEntityNotFound(_0x4a6a51,null))['then'](saveUpdates(_0x517ea7[_0xb92a('0x61')],null))[_0xb92a('0x27')](respondWithResult(_0x4a6a51,null))[_0xb92a('0x1c')](handleError(_0x4a6a51,null));};exports[_0xb92a('0xba')]=function(_0x5cdf47,_0x81ef06){var _0x457afa=path['join'](config['root'],_0xb92a('0xbb'));return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x5cdf47[_0xb92a('0x53')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0xb92a('0x27')](handleEntityNotFound(_0x81ef06,null))['then'](function(_0x2326be){if(_0x2326be){if(_[_0xb92a('0x70')](_0x2326be[_0xb92a('0xbc')])){return _0x81ef06['download'](_0x457afa);}else{if(!fs[_0xb92a('0xbd')](path['join'](config[_0xb92a('0xbe')],_0xb92a('0xbf'),_0x2326be[_0xb92a('0xbc')]))){return _0x81ef06['download'](_0x457afa);}return _0x81ef06[_0xb92a('0xc0')](path['join'](config['root'],_0xb92a('0xbf'),_0x2326be[_0xb92a('0xbc')]));}}})[_0xb92a('0x1c')](handleError(_0x81ef06,null));};exports['getOpenTabs']=function(_0x4f21e2,_0x19b7cb){return db[_0xb92a('0x3c')]['find']({'where':{'id':_0x4f21e2[_0xb92a('0x53')]['id']},'attributes':['id']})[_0xb92a('0x27')](handleEntityNotFound(_0x19b7cb,null))[_0xb92a('0x27')](function(_0x3165a4){var _0x52a554=[];values=_0x3165a4['dataValues'];_0x52a554[_0xb92a('0x46')](get_open_tabs(_0xb92a('0x4c'),_0x3165a4[_0xb92a('0x4d')]));_0x52a554[_0xb92a('0x46')](get_open_tabs(_0xb92a('0x5e'),_0x3165a4[_0xb92a('0x4d')]));_0x52a554[_0xb92a('0x46')](get_open_tabs(_0xb92a('0x50'),_0x3165a4[_0xb92a('0x4d')]));_0x52a554[_0xb92a('0x46')](get_open_tabs(_0xb92a('0x5f'),_0x3165a4[_0xb92a('0x4d')]));_0x52a554['push'](get_open_tabs('fax',_0x3165a4[_0xb92a('0x4d')]));_0x52a554['push'](get_open_tabs(_0xb92a('0x4f'),_0x3165a4[_0xb92a('0x4d')]));return Promise[_0xb92a('0x51')](_0x52a554);})[_0xb92a('0x27')](function(_0x4b069f){if(_0x4b069f){var _0x462add=_[_0xb92a('0x34')](values[_0xb92a('0xc1')],function(_0x12e482){return{'channel':'CHAT','id':_0x12e482['id'],'createdAt':_0x12e482[_0xb92a('0xc2')]};});var _0x1a680c=_['map'](values[_0xb92a('0xc3')],function(_0x35df63){return{'channel':_0xb92a('0xc4'),'id':_0x35df63['id'],'createdAt':_0x35df63[_0xb92a('0xc2')]};});var _0x2ad5e2=_[_0xb92a('0x34')](values[_0xb92a('0xc5')],function(_0x2653bb){return{'channel':_0xb92a('0xc6'),'id':_0x2653bb['id'],'createdAt':_0x2653bb[_0xb92a('0xc2')]};});var _0x5a4743=_['map'](values[_0xb92a('0xc7')],function(_0x14d7cc){return{'channel':_0xb92a('0xc8'),'id':_0x14d7cc['id'],'createdAt':_0x14d7cc['createdAt']};});var _0x50fbbc=_['map'](values[_0xb92a('0xc9')],function(_0x2928f9){return{'channel':_0xb92a('0xca'),'id':_0x2928f9['id'],'createdAt':_0x2928f9[_0xb92a('0xc2')]};});var _0x26ded4=_[_0xb92a('0x34')](values[_0xb92a('0xcb')],function(_0x4d1a01){return{'channel':_0xb92a('0xcc'),'id':_0x4d1a01['id'],'createdAt':_0x4d1a01[_0xb92a('0xc2')]};});var _0xf0c098=_[_0xb92a('0xcd')](_0x462add,_0x1a680c,_0x2ad5e2,_0x5a4743,_0x50fbbc,_0x26ded4);var _0x42bbf5={'count':_0xf0c098['length'],'rows':_0xf0c098};return _0x42bbf5;}else return null;})['then'](respondWithResult(_0x19b7cb,null))[_0xb92a('0x1c')](handleError(_0x19b7cb,null));};exports[_0xb92a('0xce')]=function(_0x592f6c,_0x15e378){var _0x5c7ed4={};var _0x4f482d={};var _0x5ac3e4;var _0x16603a;return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x592f6c['params']['id']}})['then'](handleEntityNotFound(_0x15e378,null))['then'](function(_0x3b87e6){if(_0x3b87e6){_0x5ac3e4=_0x3b87e6;_0x4f482d[_0xb92a('0x54')]=_['keys'](db[_0xb92a('0xd0')][_0xb92a('0x57')]);_0x4f482d['query']=_[_0xb92a('0x56')](_0x592f6c[_0xb92a('0x42')]);_0x4f482d[_0xb92a('0x58')]=_['intersection'](_0x4f482d[_0xb92a('0x54')],_0x4f482d[_0xb92a('0x42')]);_0x5c7ed4['attributes']=_[_0xb92a('0x59')](_0x4f482d[_0xb92a('0x54')],qs[_0xb92a('0x5b')](_0x592f6c['query'][_0xb92a('0x5b')]));_0x5c7ed4[_0xb92a('0x5a')]=_0x5c7ed4['attributes'][_0xb92a('0x4b')]?_0x5c7ed4['attributes']:_0x4f482d[_0xb92a('0x54')];_0x5c7ed4[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x592f6c[_0xb92a('0x42')][_0xb92a('0xd2')]);_0x5c7ed4[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0x592f6c[_0xb92a('0x42')],_0x4f482d[_0xb92a('0x58')]));if(_0x592f6c[_0xb92a('0x42')][_0xb92a('0x32')]){_0x5c7ed4[_0xb92a('0x41')]=_[_0xb92a('0x5d')](_0x5c7ed4['where'],{'$or':_[_0xb92a('0x34')](_0x5c7ed4[_0xb92a('0x5a')],function(_0x7eba57){var _0x5c4b89={};_0x5c4b89[_0x7eba57]={'$like':'%'+_0x592f6c[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x5c4b89;})});}_0x5c7ed4=_[_0xb92a('0x5d')]({},_0x5c7ed4,_0x592f6c[_0xb92a('0xd4')]);return _0x5ac3e4[_0xb92a('0xce')](_0x5c7ed4);}})[_0xb92a('0x27')](function(_0x5778e7){if(_0x5778e7){_0x16603a=_0x5778e7['length'];if(_0x592f6c[_0xb92a('0x42')][_0xb92a('0xd5')](_0xb92a('0x43'))){_0x5c7ed4['include']=[{'model':db['CmList'],'as':_0xb92a('0xd6'),'required':![]},{'model':db[_0xb92a('0xd7')],'as':_0xb92a('0xd8'),'attributes':['id','name',_0xb92a('0xd9')],'where':_0x592f6c[_0xb92a('0x42')][_0xb92a('0xda')]?{'id':_0x592f6c[_0xb92a('0x42')][_0xb92a('0xda')]}:undefined,'required':_0x592f6c[_0xb92a('0x42')]['tag']?!![]:![]}];}if(!_0x592f6c[_0xb92a('0x42')][_0xb92a('0xd5')](_0xb92a('0xdb'))){_0x5c7ed4[_0xb92a('0x23')]=qs['limit'](_0x592f6c[_0xb92a('0x42')][_0xb92a('0x23')]);_0x5c7ed4[_0xb92a('0x21')]=qs[_0xb92a('0x21')](_0x592f6c['query']['offset']);}return _0x5ac3e4[_0xb92a('0xce')](_0x5c7ed4);}})[_0xb92a('0x27')](function(_0x4be730){if(_0x4be730){return _0x4be730?{'count':_0x16603a,'rows':_0x4be730}:null;}})['then'](respondWithResult(_0x15e378,null))['catch'](handleError(_0x15e378,null));};exports['getQueues']=function(_0x45a8b2,_0x40feb2){var _0x77f6a5;var _0x11657a={};var _0x1aba13;return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x45a8b2['params']['id']},'attributes':['id',_0xb92a('0x37'),_0xb92a('0x28')]})[_0xb92a('0x27')](handleEntityNotFound(_0x40feb2,null))[_0xb92a('0x27')](function(_0x383247){if(!utils[_0xb92a('0xa3')](_0x45a8b2[_0xb92a('0x42')]['channel'])){throw new db[(_0xb92a('0x92'))][(_0xb92a('0x93'))](_0xb92a('0xa4'));}_0x77f6a5=_0x383247;var _0xededaf={};_0xededaf[_0xb92a('0x54')]=_[_0xb92a('0x56')](db[_[_0xb92a('0xa6')](_0x45a8b2[_0xb92a('0x42')][_0xb92a('0xb2')])+'Queue'][_0xb92a('0x57')]);_0xededaf['query']=_[_0xb92a('0x56')](_0x45a8b2[_0xb92a('0x42')]);_0xededaf[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0xededaf['model'],_0xededaf[_0xb92a('0x42')]);_0x11657a['attributes']=_[_0xb92a('0x59')](_0xededaf[_0xb92a('0x54')],qs['fields'](_0x45a8b2[_0xb92a('0x42')][_0xb92a('0x5b')]));_0x11657a[_0xb92a('0x5a')]=_0x11657a[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x11657a[_0xb92a('0x5a')]:_0xededaf['model'];_0x11657a[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x45a8b2[_0xb92a('0x42')][_0xb92a('0xd2')]);_0x11657a[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0x45a8b2[_0xb92a('0x42')],_0xededaf[_0xb92a('0x58')]));if(_0x45a8b2['query']['filter']){_0x11657a['where']=_[_0xb92a('0x5d')](_0x11657a[_0xb92a('0x41')],{'$or':_[_0xb92a('0x34')](_0x11657a[_0xb92a('0x5a')],function(_0x3a3a62){var _0x38fed1={};_0x38fed1[_0x3a3a62]={'$like':'%'+_0x45a8b2[_0xb92a('0x42')]['filter']+'%'};return _0x38fed1;})});}_0x11657a=_[_0xb92a('0x5d')]({},_0x11657a,_0x45a8b2['options']);switch(_0x77f6a5[_0xb92a('0x28')]){case _0xb92a('0x2b'):return db[_[_0xb92a('0xa6')](_0x45a8b2[_0xb92a('0x42')][_0xb92a('0xb2')])+_0xb92a('0xdc')]['findAll'](_0x11657a);case _0xb92a('0x2d'):case'agent':return _0x77f6a5[_0xb92a('0x2a')+_[_0xb92a('0xa6')](_0x45a8b2[_0xb92a('0x42')][_0xb92a('0xb2')])+_0xb92a('0xa8')](_0x11657a);default:throw new db['Sequelize']['ValidationError'](_0xb92a('0xdd'));}})[_0xb92a('0x27')](function(_0x1f90fa){_0x1aba13=_0x1f90fa['length'];if(!_0x45a8b2['query']['hasOwnProperty']('nolimit')){_0x11657a['limit']=qs[_0xb92a('0x23')](_0x45a8b2[_0xb92a('0x42')][_0xb92a('0x23')]);_0x11657a[_0xb92a('0x21')]=qs[_0xb92a('0x21')](_0x45a8b2[_0xb92a('0x42')]['offset']);}switch(_0x77f6a5[_0xb92a('0x28')]){case _0xb92a('0x2b'):return db[_[_0xb92a('0xa6')](_0x45a8b2['query']['channel'])+_0xb92a('0xdc')][_0xb92a('0x47')](_0x11657a);case'user':case _0xb92a('0x2f'):return _0x77f6a5[_0xb92a('0x2a')+_['capitalize'](_0x45a8b2[_0xb92a('0x42')]['channel'])+_0xb92a('0xa8')](_0x11657a);}})[_0xb92a('0x27')](function(_0x345b9e){return{'count':_0x1aba13,'rows':_0x345b9e};})[_0xb92a('0x27')](respondWithResult(_0x40feb2,null))[_0xb92a('0x1c')](handleError(_0x40feb2,null));};exports['getVoiceQueuesRt']=function(_0x5b942d,_0xd59bc){var _0x5dd2cc={};var _0x2fc9c3={};var _0x2fb0db;var _0xe24781;return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x5b942d[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0xd59bc,null))[_0xb92a('0x27')](function(_0xaa38de){if(_0xaa38de){_0x2fb0db=_0xaa38de;_0x2fc9c3[_0xb92a('0x54')]=_['keys'](db[_0xb92a('0xb6')]['rawAttributes']);_0x2fc9c3[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x5b942d[_0xb92a('0x42')]);_0x2fc9c3['filters']=_['intersection'](_0x2fc9c3[_0xb92a('0x54')],_0x2fc9c3[_0xb92a('0x42')]);_0x5dd2cc['attributes']=_[_0xb92a('0x59')](_0x2fc9c3[_0xb92a('0x54')],qs['fields'](_0x5b942d['query'][_0xb92a('0x5b')]));_0x5dd2cc[_0xb92a('0x5a')]=_0x5dd2cc[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x5dd2cc[_0xb92a('0x5a')]:_0x2fc9c3[_0xb92a('0x54')];_0x5dd2cc[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x5b942d[_0xb92a('0x42')][_0xb92a('0xd2')]);_0x5dd2cc[_0xb92a('0x41')]=qs['filters'](_[_0xb92a('0xd3')](_0x5b942d[_0xb92a('0x42')],_0x2fc9c3['filters']));if(_0x5b942d[_0xb92a('0x42')]['filter']){_0x5dd2cc['where']=_[_0xb92a('0x5d')](_0x5dd2cc[_0xb92a('0x41')],{'$or':_['map'](_0x5dd2cc['attributes'],function(_0x46c053){var _0x548459={};_0x548459[_0x46c053]={'$like':'%'+_0x5b942d[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x548459;})});}_0x5dd2cc=_['merge']({},_0x5dd2cc,_0x5b942d[_0xb92a('0xd4')]);return _0x2fb0db['getVoiceQueuesRt'](_0x5dd2cc);}})[_0xb92a('0x27')](function(_0xc1030f){if(_0xc1030f){_0xe24781=_0xc1030f[_0xb92a('0x4b')];if(!_0x5b942d[_0xb92a('0x42')][_0xb92a('0xd5')]('nolimit')){_0x5dd2cc[_0xb92a('0x23')]=qs[_0xb92a('0x23')](_0x5b942d[_0xb92a('0x42')]['limit']);_0x5dd2cc['offset']=qs[_0xb92a('0x21')](_0x5b942d[_0xb92a('0x42')][_0xb92a('0x21')]);}return _0x2fb0db[_0xb92a('0xde')](_0x5dd2cc);}})[_0xb92a('0x27')](function(_0x4e8cb8){if(_0x4e8cb8){return _0x4e8cb8?{'count':_0xe24781,'rows':_0x4e8cb8}:null;}})['then'](respondWithResult(_0xd59bc,null))[_0xb92a('0x1c')](handleError(_0xd59bc,null));};exports['getGroups']=function(_0x47c7b8,_0x68a1c5){var _0x30f10a={};var _0x1dfc4b={};var _0x374463;var _0x4a516b;return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x47c7b8[_0xb92a('0x53')]['id']}})['then'](handleEntityNotFound(_0x68a1c5,null))[_0xb92a('0x27')](function(_0x3adaa0){if(_0x3adaa0){_0x374463=_0x3adaa0;_0x1dfc4b['model']=_[_0xb92a('0x56')](db[_0xb92a('0xdf')][_0xb92a('0x57')]);_0x1dfc4b[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x47c7b8['query']);_0x1dfc4b[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0x1dfc4b[_0xb92a('0x54')],_0x1dfc4b[_0xb92a('0x42')]);_0x30f10a[_0xb92a('0x5a')]=_[_0xb92a('0x59')](_0x1dfc4b[_0xb92a('0x54')],qs[_0xb92a('0x5b')](_0x47c7b8['query'][_0xb92a('0x5b')]));_0x30f10a[_0xb92a('0x5a')]=_0x30f10a[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x30f10a['attributes']:_0x1dfc4b[_0xb92a('0x54')];_0x30f10a[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x47c7b8[_0xb92a('0x42')][_0xb92a('0xd2')]);_0x30f10a['where']=qs[_0xb92a('0x58')](_['pick'](_0x47c7b8['query'],_0x1dfc4b[_0xb92a('0x58')]));if(_0x47c7b8[_0xb92a('0x42')][_0xb92a('0x32')]){_0x30f10a[_0xb92a('0x41')]=_[_0xb92a('0x5d')](_0x30f10a[_0xb92a('0x41')],{'$or':_['map'](_0x30f10a['attributes'],function(_0xc58f5d){var _0x336f75={};_0x336f75[_0xc58f5d]={'$like':'%'+_0x47c7b8[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x336f75;})});}_0x30f10a=_['merge']({},_0x30f10a,_0x47c7b8[_0xb92a('0xd4')]);return _0x374463['getGroups'](_0x30f10a);}})['then'](function(_0x3f22a5){if(_0x3f22a5){_0x4a516b=_0x3f22a5[_0xb92a('0x4b')];if(!_0x47c7b8[_0xb92a('0x42')][_0xb92a('0xd5')](_0xb92a('0xdb'))){_0x30f10a['limit']=qs[_0xb92a('0x23')](_0x47c7b8['query']['limit']);_0x30f10a[_0xb92a('0x21')]=qs['offset'](_0x47c7b8[_0xb92a('0x42')][_0xb92a('0x21')]);}return _0x374463[_0xb92a('0xe0')](_0x30f10a);}})['then'](function(_0x1b76b1){if(_0x1b76b1){return _0x1b76b1?{'count':_0x4a516b,'rows':_0x1b76b1}:null;}})[_0xb92a('0x27')](respondWithResult(_0x68a1c5,null))[_0xb92a('0x1c')](handleError(_0x68a1c5,null));};exports['getRecordings']=function(_0x15cbee,_0x347e87){var _0x475eec={'raw':!![],'where':{}};var _0xad4f1a={};var _0x2482c9={'count':0x0,'rows':[]};return db['User'][_0xb92a('0xcf')]({'where':{'id':_0x15cbee[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x347e87,null))[_0xb92a('0x27')](function(_0x3ef04c){if(_0x3ef04c){_0xad4f1a[_0xb92a('0x54')]=_['keys'](db['VoiceRecording']['rawAttributes']);_0xad4f1a[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x15cbee[_0xb92a('0x42')]);_0xad4f1a['filters']=_['intersection'](_0xad4f1a[_0xb92a('0x54')],_0xad4f1a[_0xb92a('0x42')]);_0x475eec[_0xb92a('0x5a')]=_['intersection'](_0xad4f1a['model'],qs[_0xb92a('0x5b')](_0x15cbee[_0xb92a('0x42')]['fields']));_0x475eec[_0xb92a('0x5a')]=_0x475eec[_0xb92a('0x5a')]['length']?_0x475eec[_0xb92a('0x5a')]:_0xad4f1a[_0xb92a('0x54')];if(!_0x15cbee[_0xb92a('0x42')][_0xb92a('0xd5')]('nolimit')){_0x475eec['limit']=qs[_0xb92a('0x23')](_0x15cbee[_0xb92a('0x42')][_0xb92a('0x23')]);_0x475eec[_0xb92a('0x21')]=qs[_0xb92a('0x21')](_0x15cbee[_0xb92a('0x42')][_0xb92a('0x21')]);}_0x475eec['order']=qs['sort'](_0x15cbee[_0xb92a('0x42')][_0xb92a('0xd2')]);_0x475eec[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0x15cbee[_0xb92a('0x42')],_0xad4f1a[_0xb92a('0x58')]));_0x475eec['where'][_0xb92a('0xe1')]=_0x3ef04c['id'];if(_0x15cbee[_0xb92a('0x42')][_0xb92a('0x32')]){_0x475eec['where']=_[_0xb92a('0x5d')](_0x475eec[_0xb92a('0x41')],{'$or':_[_0xb92a('0x34')](_0x475eec[_0xb92a('0x5a')],function(_0xcf6242){var _0xe4470c={};_0xe4470c[_0xcf6242]={'$like':'%'+_0x15cbee['query'][_0xb92a('0x32')]+'%'};return _0xe4470c;})});}_0x475eec=_[_0xb92a('0x5d')]({},_0x475eec,_0x15cbee[_0xb92a('0xd4')]);return db[_0xb92a('0xe2')][_0xb92a('0x24')]({'where':_0x475eec[_0xb92a('0x41')]})[_0xb92a('0x27')](function(_0x450f3b){_0x2482c9[_0xb92a('0x24')]=_0x450f3b;if(_0x15cbee['query'][_0xb92a('0x43')]){_0x475eec[_0xb92a('0x5c')]=[{'all':!![]}];}return db[_0xb92a('0xe2')][_0xb92a('0x47')](_0x475eec);})['then'](function(_0x44448a){_0x2482c9[_0xb92a('0x48')]=_0x44448a;return _0x2482c9;});}})[_0xb92a('0x27')](respondWithFilteredResult(_0x347e87,_0x475eec))[_0xb92a('0x1c')](handleError(_0x347e87,null));};exports['getScreenRecordings']=function(_0x3a7f55,_0x1bda30){var _0x591fbb={'raw':!![],'where':{}};var _0x417785={};var _0x3fa612={'count':0x0,'rows':[]};return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x3a7f55[_0xb92a('0x53')]['id']}})['then'](handleEntityNotFound(_0x1bda30,null))[_0xb92a('0x27')](function(_0x4aa105){if(_0x4aa105){_0x417785['model']=_[_0xb92a('0x56')](db[_0xb92a('0xe3')]['rawAttributes']);_0x417785[_0xb92a('0x42')]=_['keys'](_0x3a7f55[_0xb92a('0x42')]);_0x417785[_0xb92a('0x58')]=_['intersection'](_0x417785[_0xb92a('0x54')],_0x417785[_0xb92a('0x42')]);_0x591fbb[_0xb92a('0x5a')]=_[_0xb92a('0x59')](_0x417785[_0xb92a('0x54')],qs[_0xb92a('0x5b')](_0x3a7f55[_0xb92a('0x42')][_0xb92a('0x5b')]));_0x591fbb['attributes']=_0x591fbb[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x591fbb[_0xb92a('0x5a')]:_0x417785[_0xb92a('0x54')];if(!_0x3a7f55[_0xb92a('0x42')][_0xb92a('0xd5')]('nolimit')){_0x591fbb['limit']=qs[_0xb92a('0x23')](_0x3a7f55[_0xb92a('0x42')]['limit']);_0x591fbb[_0xb92a('0x21')]=qs[_0xb92a('0x21')](_0x3a7f55[_0xb92a('0x42')][_0xb92a('0x21')]);}_0x591fbb[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x3a7f55[_0xb92a('0x42')]['sort']);_0x591fbb['where']=qs['filters'](_[_0xb92a('0xd3')](_0x3a7f55['query'],_0x417785[_0xb92a('0x58')]));_0x591fbb[_0xb92a('0x41')][_0xb92a('0xe1')]=_0x4aa105['id'];if(_0x3a7f55[_0xb92a('0x42')][_0xb92a('0x32')]){_0x591fbb[_0xb92a('0x41')]=_[_0xb92a('0x5d')](_0x591fbb['where'],{'$or':_[_0xb92a('0x34')](_0x591fbb['attributes'],function(_0x1ab306){var _0x3e0c0d={};_0x3e0c0d[_0x1ab306]={'$like':'%'+_0x3a7f55[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x3e0c0d;})});}_0x591fbb=_[_0xb92a('0x5d')]({},_0x591fbb,_0x3a7f55[_0xb92a('0xd4')]);return db[_0xb92a('0xe3')][_0xb92a('0x24')]({'where':_0x591fbb[_0xb92a('0x41')]})[_0xb92a('0x27')](function(_0x58a040){_0x3fa612['count']=_0x58a040;if(_0x3a7f55[_0xb92a('0x42')][_0xb92a('0x43')]){_0x591fbb[_0xb92a('0x5c')]=[{'all':!![]}];}return db[_0xb92a('0xe3')][_0xb92a('0x47')](_0x591fbb);})[_0xb92a('0x27')](function(_0x5ebcbf){_0x3fa612[_0xb92a('0x48')]=_0x5ebcbf;return _0x3fa612;});}})['then'](respondWithFilteredResult(_0x1bda30,_0x591fbb))[_0xb92a('0x1c')](handleError(_0x1bda30,null));};exports['getChatInteractions']=function(_0x25365b,_0x4ca326){var _0x31516c={};var _0x36a4fc={};var _0x1f9957;var _0x69ef70;return db[_0xb92a('0x3c')]['findOne']({'where':{'id':_0x25365b[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x4ca326,null))[_0xb92a('0x27')](function(_0x24b087){if(_0x24b087){_0x1f9957=_0x24b087;_0x36a4fc[_0xb92a('0x54')]=_[_0xb92a('0x56')](db['ChatInteraction']['rawAttributes']);_0x36a4fc[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x25365b[_0xb92a('0x42')]);_0x36a4fc[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0x36a4fc[_0xb92a('0x54')],_0x36a4fc[_0xb92a('0x42')]);_0x31516c[_0xb92a('0x5a')]=_[_0xb92a('0x59')](_0x36a4fc[_0xb92a('0x54')],qs['fields'](_0x25365b['query'][_0xb92a('0x5b')]));_0x31516c['attributes']=_0x31516c[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x31516c[_0xb92a('0x5a')]:_0x36a4fc['model'];_0x31516c['order']=qs[_0xb92a('0xd2')](_0x25365b['query'][_0xb92a('0xd2')]);_0x31516c[_0xb92a('0x41')]=qs['filters'](_['pick'](_0x25365b['query'],_0x36a4fc[_0xb92a('0x58')]));if(_0x25365b[_0xb92a('0x42')][_0xb92a('0x32')]){_0x31516c[_0xb92a('0x41')]=_[_0xb92a('0x5d')](_0x31516c[_0xb92a('0x41')],{'$or':_[_0xb92a('0x34')](_0x31516c[_0xb92a('0x5a')],function(_0x2dce56){var _0x4dd115={};_0x4dd115[_0x2dce56]={'$like':'%'+_0x25365b[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x4dd115;})});}_0x31516c=_[_0xb92a('0x5d')]({},_0x31516c,_0x25365b['options']);return _0x1f9957[_0xb92a('0xe4')](_0x31516c);}})['then'](function(_0x14356a){if(_0x14356a){_0x69ef70=_0x14356a[_0xb92a('0x4b')];if(!_0x25365b[_0xb92a('0x42')][_0xb92a('0xd5')](_0xb92a('0xdb'))){_0x31516c[_0xb92a('0x23')]=qs[_0xb92a('0x23')](_0x25365b[_0xb92a('0x42')][_0xb92a('0x23')]);_0x31516c[_0xb92a('0x21')]=qs[_0xb92a('0x21')](_0x25365b[_0xb92a('0x42')][_0xb92a('0x21')]);}return _0x1f9957[_0xb92a('0xe4')](_0x31516c);}})[_0xb92a('0x27')](function(_0x10c470){if(_0x10c470){return _0x10c470?{'count':_0x69ef70,'rows':_0x10c470}:null;}})[_0xb92a('0x27')](respondWithResult(_0x4ca326,null))[_0xb92a('0x1c')](handleError(_0x4ca326,null));};exports[_0xb92a('0xe5')]=function(_0x2f5091,_0x577d4){var _0x3fb457={};var _0x3d9de0={};var _0x5bf345;var _0x1c73b8;return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x2f5091[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x577d4,null))['then'](function(_0x12a471){if(_0x12a471){_0x5bf345=_0x12a471;_0x3d9de0[_0xb92a('0x54')]=_[_0xb92a('0x56')](db[_0xb92a('0xe6')][_0xb92a('0x57')]);_0x3d9de0[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x2f5091[_0xb92a('0x42')]);_0x3d9de0['filters']=_['intersection'](_0x3d9de0[_0xb92a('0x54')],_0x3d9de0[_0xb92a('0x42')]);_0x3fb457[_0xb92a('0x5a')]=_[_0xb92a('0x59')](_0x3d9de0['model'],qs[_0xb92a('0x5b')](_0x2f5091['query'][_0xb92a('0x5b')]));_0x3fb457[_0xb92a('0x5a')]=_0x3fb457[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x3fb457[_0xb92a('0x5a')]:_0x3d9de0[_0xb92a('0x54')];_0x3fb457[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x2f5091[_0xb92a('0x42')][_0xb92a('0xd2')]);_0x3fb457[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0x2f5091[_0xb92a('0x42')],_0x3d9de0[_0xb92a('0x58')]));if(_0x2f5091[_0xb92a('0x42')][_0xb92a('0x32')]){_0x3fb457[_0xb92a('0x41')]=_[_0xb92a('0x5d')](_0x3fb457[_0xb92a('0x41')],{'$or':_[_0xb92a('0x34')](_0x3fb457[_0xb92a('0x5a')],function(_0x37b566){var _0x11408f={};_0x11408f[_0x37b566]={'$like':'%'+_0x2f5091['query'][_0xb92a('0x32')]+'%'};return _0x11408f;})});}_0x3fb457=_[_0xb92a('0x5d')]({},_0x3fb457,_0x2f5091[_0xb92a('0xd4')]);return _0x5bf345[_0xb92a('0xe5')](_0x3fb457);}})[_0xb92a('0x27')](function(_0x1ac627){if(_0x1ac627){_0x1c73b8=_0x1ac627[_0xb92a('0x4b')];if(!_0x2f5091[_0xb92a('0x42')][_0xb92a('0xd5')](_0xb92a('0xdb'))){_0x3fb457[_0xb92a('0x23')]=qs[_0xb92a('0x23')](_0x2f5091['query'][_0xb92a('0x23')]);_0x3fb457['offset']=qs[_0xb92a('0x21')](_0x2f5091[_0xb92a('0x42')]['offset']);}return _0x5bf345[_0xb92a('0xe5')](_0x3fb457);}})[_0xb92a('0x27')](function(_0x473e85){if(_0x473e85){return _0x473e85?{'count':_0x1c73b8,'rows':_0x473e85}:null;}})['then'](respondWithResult(_0x577d4,null))[_0xb92a('0x1c')](handleError(_0x577d4,null));};exports[_0xb92a('0xe7')]=function(_0x3d19ce,_0xc2752a){var _0x21c151={'raw':!![],'where':{}};var _0x384afb={};var _0x313ba7={'count':0x0,'rows':[]};return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x3d19ce['params']['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0xc2752a,null))['then'](function(_0x107c5){if(_0x107c5){_0x384afb['model']=_[_0xb92a('0x56')](db['MailInteraction'][_0xb92a('0x57')]);_0x384afb[_0xb92a('0x42')]=_['keys'](_0x3d19ce['query']);_0x384afb[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0x384afb[_0xb92a('0x54')],_0x384afb[_0xb92a('0x42')]);_0x21c151[_0xb92a('0x5a')]=_[_0xb92a('0x59')](_0x384afb[_0xb92a('0x54')],qs[_0xb92a('0x5b')](_0x3d19ce[_0xb92a('0x42')][_0xb92a('0x5b')]));_0x21c151[_0xb92a('0x5a')]=_0x21c151[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x21c151[_0xb92a('0x5a')]:_0x384afb['model'];if(!_0x3d19ce['query'][_0xb92a('0xd5')](_0xb92a('0xdb'))){_0x21c151[_0xb92a('0x23')]=qs['limit'](_0x3d19ce[_0xb92a('0x42')][_0xb92a('0x23')]);_0x21c151['offset']=qs[_0xb92a('0x21')](_0x3d19ce[_0xb92a('0x42')]['offset']);}_0x21c151[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x3d19ce['query'][_0xb92a('0xd2')]);_0x21c151[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0x3d19ce[_0xb92a('0x42')],_0x384afb[_0xb92a('0x58')]));_0x21c151[_0xb92a('0x41')][_0xb92a('0xe1')]=_0x107c5['id'];if(_0x3d19ce[_0xb92a('0x42')]['filter']){_0x21c151[_0xb92a('0x41')]=_[_0xb92a('0x5d')](_0x21c151[_0xb92a('0x41')],{'$or':_[_0xb92a('0x34')](_0x21c151[_0xb92a('0x5a')],function(_0x1f41d0){var _0x46417b={};_0x46417b[_0x1f41d0]={'$like':'%'+_0x3d19ce[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x46417b;})});}_0x21c151=_[_0xb92a('0x5d')]({},_0x21c151,_0x3d19ce[_0xb92a('0xd4')]);return db[_0xb92a('0xe8')][_0xb92a('0x24')]({'where':_0x21c151[_0xb92a('0x41')]})[_0xb92a('0x27')](function(_0x285637){_0x313ba7['count']=_0x285637;if(_0x3d19ce[_0xb92a('0x42')]['includeAll']){_0x21c151['include']=[{'all':!![]}];}return db[_0xb92a('0xe8')][_0xb92a('0x47')](_0x21c151);})[_0xb92a('0x27')](function(_0x202982){_0x313ba7[_0xb92a('0x48')]=_0x202982;return _0x313ba7;});}})[_0xb92a('0x27')](respondWithFilteredResult(_0xc2752a,_0x21c151))['catch'](handleError(_0xc2752a,null));};exports[_0xb92a('0xe9')]=function(_0x1cb850,_0x168903){var _0x3af44a={};var _0x403165={};var _0x22f392;var _0x180729;return db['User'][_0xb92a('0xcf')]({'where':{'id':_0x1cb850[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x168903,null))[_0xb92a('0x27')](function(_0xa3edfe){if(_0xa3edfe){_0x22f392=_0xa3edfe;_0x403165[_0xb92a('0x54')]=_[_0xb92a('0x56')](db[_0xb92a('0xea')][_0xb92a('0x57')]);_0x403165[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x1cb850['query']);_0x403165[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0x403165[_0xb92a('0x54')],_0x403165[_0xb92a('0x42')]);_0x3af44a[_0xb92a('0x5a')]=_['intersection'](_0x403165[_0xb92a('0x54')],qs['fields'](_0x1cb850[_0xb92a('0x42')][_0xb92a('0x5b')]));_0x3af44a[_0xb92a('0x5a')]=_0x3af44a[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x3af44a[_0xb92a('0x5a')]:_0x403165[_0xb92a('0x54')];_0x3af44a[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x1cb850[_0xb92a('0x42')][_0xb92a('0xd2')]);_0x3af44a[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_['pick'](_0x1cb850[_0xb92a('0x42')],_0x403165[_0xb92a('0x58')]));if(_0x1cb850[_0xb92a('0x42')][_0xb92a('0x32')]){_0x3af44a[_0xb92a('0x41')]=_[_0xb92a('0x5d')](_0x3af44a[_0xb92a('0x41')],{'$or':_['map'](_0x3af44a['attributes'],function(_0x4c496f){var _0x2f0618={};_0x2f0618[_0x4c496f]={'$like':'%'+_0x1cb850[_0xb92a('0x42')]['filter']+'%'};return _0x2f0618;})});}_0x3af44a=_['merge']({},_0x3af44a,_0x1cb850[_0xb92a('0xd4')]);return _0x22f392['getSmsInteractions'](_0x3af44a);}})[_0xb92a('0x27')](function(_0x3017fd){if(_0x3017fd){_0x180729=_0x3017fd[_0xb92a('0x4b')];if(!_0x1cb850[_0xb92a('0x42')]['hasOwnProperty'](_0xb92a('0xdb'))){_0x3af44a[_0xb92a('0x23')]=qs[_0xb92a('0x23')](_0x1cb850[_0xb92a('0x42')]['limit']);_0x3af44a[_0xb92a('0x21')]=qs['offset'](_0x1cb850[_0xb92a('0x42')]['offset']);}return _0x22f392[_0xb92a('0xe9')](_0x3af44a);}})[_0xb92a('0x27')](function(_0x5b9b3a){if(_0x5b9b3a){return _0x5b9b3a?{'count':_0x180729,'rows':_0x5b9b3a}:null;}})[_0xb92a('0x27')](respondWithResult(_0x168903,null))[_0xb92a('0x1c')](handleError(_0x168903,null));};exports[_0xb92a('0xeb')]=function(_0x56f38a,_0x1ce53a){var _0x272078={};var _0x21572c={};var _0x3cfe84;var _0x4cd46d;return db[_0xb92a('0x3c')]['findOne']({'where':{'id':_0x56f38a[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x1ce53a,null))[_0xb92a('0x27')](function(_0x4994e7){if(_0x4994e7){_0x3cfe84=_0x4994e7;_0x21572c[_0xb92a('0x54')]=_['keys'](db[_0xb92a('0xec')]['rawAttributes']);_0x21572c[_0xb92a('0x42')]=_['keys'](_0x56f38a[_0xb92a('0x42')]);_0x21572c[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0x21572c['model'],_0x21572c['query']);_0x272078['attributes']=_[_0xb92a('0x59')](_0x21572c[_0xb92a('0x54')],qs['fields'](_0x56f38a[_0xb92a('0x42')]['fields']));_0x272078['attributes']=_0x272078['attributes'][_0xb92a('0x4b')]?_0x272078[_0xb92a('0x5a')]:_0x21572c['model'];_0x272078[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x56f38a[_0xb92a('0x42')][_0xb92a('0xd2')]);_0x272078['where']=qs['filters'](_[_0xb92a('0xd3')](_0x56f38a[_0xb92a('0x42')],_0x21572c[_0xb92a('0x58')]));if(_0x56f38a['query']['filter']){_0x272078[_0xb92a('0x41')]=_['merge'](_0x272078[_0xb92a('0x41')],{'$or':_['map'](_0x272078['attributes'],function(_0x314955){var _0xd77241={};_0xd77241[_0x314955]={'$like':'%'+_0x56f38a[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0xd77241;})});}_0x272078=_[_0xb92a('0x5d')]({},_0x272078,_0x56f38a[_0xb92a('0xd4')]);return _0x3cfe84[_0xb92a('0xeb')](_0x272078);}})[_0xb92a('0x27')](function(_0x388d41){if(_0x388d41){_0x4cd46d=_0x388d41[_0xb92a('0x4b')];if(!_0x56f38a[_0xb92a('0x42')][_0xb92a('0xd5')]('nolimit')){_0x272078['limit']=qs[_0xb92a('0x23')](_0x56f38a['query'][_0xb92a('0x23')]);_0x272078['offset']=qs[_0xb92a('0x21')](_0x56f38a[_0xb92a('0x42')][_0xb92a('0x21')]);}return _0x3cfe84[_0xb92a('0xeb')](_0x272078);}})[_0xb92a('0x27')](function(_0x292542){if(_0x292542){return _0x292542?{'count':_0x4cd46d,'rows':_0x292542}:null;}})['then'](respondWithResult(_0x1ce53a,null))[_0xb92a('0x1c')](handleError(_0x1ce53a,null));};exports[_0xb92a('0xed')]=function(_0x197bfd,_0x4f6592){var _0x23a29d={};var _0x26afe7={};var _0xc79704;var _0xede2c9;return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x197bfd[_0xb92a('0x53')]['id']}})['then'](handleEntityNotFound(_0x4f6592,null))[_0xb92a('0x27')](function(_0x41319f){if(_0x41319f){_0xc79704=_0x41319f;_0x26afe7[_0xb92a('0x54')]=_['keys'](db[_0xb92a('0xee')]['rawAttributes']);_0x26afe7[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x197bfd[_0xb92a('0x42')]);_0x26afe7[_0xb92a('0x58')]=_['intersection'](_0x26afe7[_0xb92a('0x54')],_0x26afe7['query']);_0x23a29d[_0xb92a('0x5a')]=_['intersection'](_0x26afe7[_0xb92a('0x54')],qs[_0xb92a('0x5b')](_0x197bfd['query'][_0xb92a('0x5b')]));_0x23a29d[_0xb92a('0x5a')]=_0x23a29d[_0xb92a('0x5a')]['length']?_0x23a29d[_0xb92a('0x5a')]:_0x26afe7['model'];_0x23a29d[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x197bfd['query']['sort']);_0x23a29d[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0x197bfd[_0xb92a('0x42')],_0x26afe7[_0xb92a('0x58')]));if(_0x197bfd[_0xb92a('0x42')]['filter']){_0x23a29d['where']=_['merge'](_0x23a29d['where'],{'$or':_[_0xb92a('0x34')](_0x23a29d[_0xb92a('0x5a')],function(_0x455828){var _0x596038={};_0x596038[_0x455828]={'$like':'%'+_0x197bfd['query'][_0xb92a('0x32')]+'%'};return _0x596038;})});}_0x23a29d=_[_0xb92a('0x5d')]({},_0x23a29d,_0x197bfd[_0xb92a('0xd4')]);return _0xc79704[_0xb92a('0xed')](_0x23a29d);}})[_0xb92a('0x27')](function(_0x1694d3){if(_0x1694d3){_0xede2c9=_0x1694d3[_0xb92a('0x4b')];if(!_0x197bfd[_0xb92a('0x42')][_0xb92a('0xd5')]('nolimit')){_0x23a29d['limit']=qs[_0xb92a('0x23')](_0x197bfd[_0xb92a('0x42')][_0xb92a('0x23')]);_0x23a29d[_0xb92a('0x21')]=qs['offset'](_0x197bfd['query']['offset']);}return _0xc79704[_0xb92a('0xed')](_0x23a29d);}})['then'](function(_0x53c68f){if(_0x53c68f){return _0x53c68f?{'count':_0xede2c9,'rows':_0x53c68f}:null;}})['then'](respondWithResult(_0x4f6592,null))['catch'](handleError(_0x4f6592,null));};exports[_0xb92a('0xef')]=function(_0xf1c44b,_0x228ffe,_0x44ab02){var _0x4d231f;var _0xa099af;var _0x39830e;var _0x3e87d7=!_['isNil'](_0xf1c44b[_0xb92a('0x53')]['id'])?_0xf1c44b['params']['id']:!_['isNil'](_0xf1c44b['user']['id'])?_0xf1c44b[_0xb92a('0x2d')]['id']:null;return db['User'][_0xb92a('0x35')]({'where':{'id':_0x3e87d7,'role':{'$or':[_0xb92a('0x2b'),'user',_0xb92a('0x2f')]}},'attributes':['id',_0xb92a('0x37'),_0xb92a('0xf0'),_0xb92a('0xf1'),_0xb92a('0x28'),_0xb92a('0x66'),_0xb92a('0xa0')]})[_0xb92a('0x27')](function(_0x254b48){if(_0x254b48){if(_0x254b48[_0xb92a('0x28')]===_0xb92a('0x2f')){_0x4d231f=_0x254b48;if(_0xf1c44b[_0xb92a('0x61')][_0xb92a('0xa2')]){_0x39830e=util['format'](_0xb92a('0xf2'),_0x4d231f[_0xf1c44b['body']['interface']]);}else if(_0xf1c44b[_0xb92a('0x61')][_0xb92a('0xf3')]){_0x39830e=util['format'](_0xb92a('0xae'),_0xf1c44b[_0xb92a('0x61')]['intrf']);}else{_0x39830e=util['format'](_0xb92a('0xae'),_0x4d231f[_0xb92a('0x37')]);}socket['to'](util[_0xb92a('0xf4')](_0xb92a('0xf5'),_0x4d231f[_0xb92a('0x37')]))[_0xb92a('0xaa')](_0xb92a('0xf6'),{'user':{'id':_0x4d231f['id'],'name':_0x4d231f['name']},'ip':_0xf1c44b[_0xb92a('0xf7')][_0xb92a('0xf8')]||_0xf1c44b[_0xb92a('0xf9')][_0xb92a('0xfa')]||_0xf1c44b[_0xb92a('0xfb')][_0xb92a('0xfa')]||_0xf1c44b[_0xb92a('0xf9')][_0xb92a('0xfb')][_0xb92a('0xfa')]});return db[_0xb92a('0xb6')][_0xb92a('0x29')]({'where':{'membername':_0x4d231f[_0xb92a('0x37')]},'individualHooks':!![]});}}else{throw new db[(_0xb92a('0x92'))][(_0xb92a('0x93'))](_0xb92a('0xfc'));}})[_0xb92a('0x27')](function(){if(_0x4d231f){return _0x4d231f['getVoiceQueues']({'raw':!![]});}})[_0xb92a('0x27')](function(_0x4ac225){if(_0x4d231f){if(_0x4ac225){_0xa099af=_0x4ac225;if(_0xa099af[_0xb92a('0x4b')]){var _0x446af3=_0xa099af['map'](function(_0x3a6815){var _0x5ee886={'membername':_0x4d231f['name'],'UserId':_0x4d231f['id'],'queue_name':_0x3a6815['name'],'VoiceQueueId':_0x3a6815['id'],'interface':_0x39830e,'paused':_0x4d231f[_0xb92a('0xa0')]||![],'penalty':_0x3a6815[_0xb92a('0xfd')]||0x0};return db[_0xb92a('0xb6')][_0xb92a('0xb0')](_0x5ee886);});return Promise[_0xb92a('0x51')](_0x446af3);}}}})[_0xb92a('0x27')](function(){if(_0x4d231f){return db[_0xb92a('0xfe')][_0xb92a('0x47')]({'where':{'membername':_0x4d231f[_0xb92a('0x37')],'exitAt':null}});}})[_0xb92a('0x27')](function(_0x2847d0){if(_0x4d231f){var _0x553bf4=[];_0x2847d0[_0xb92a('0xff')](function(_0x56703c){_0x553bf4[_0xb92a('0x46')](_0x56703c['update']({'exitAt':moment()[_0xb92a('0xf4')](_0xb92a('0x100'))}));});return Promise[_0xb92a('0x51')](_0x553bf4);}})[_0xb92a('0x27')](function(){if(_0x4d231f){var _0x256811=[];var _0x1478c8=[];var _0x40bf45=utils[_0xb92a('0x101')]();var _0x35bbb4={'membername':_0x4d231f[_0xb92a('0x37')],'interface':_0x39830e,'enterAt':moment()['format'](_0xb92a('0x100')),'role':_0x4d231f[_0xb92a('0x28')],'internal':_0x4d231f[_0xb92a('0x66')]};_0x40bf45[_0xb92a('0xff')](function(_0x4911ca){_0x256811[_0xb92a('0x46')](_[_0xb92a('0x5d')]({'channel':_0x4911ca,'type':_0xb92a('0x102'),'data1':_0xf1c44b[_0xb92a('0x61')][_0xb92a('0x103')],'data2':_0x39830e},_0x35bbb4));if(_0x4d231f['loginInPause']){_0x1478c8['push'](_[_0xb92a('0x5d')]({'channel':_0x4911ca,'type':_0xb92a('0x104'),'data1':'LOGININPAUSE'},_0x35bbb4));}});return db[_0xb92a('0xfe')][_0xb92a('0x105')](_0x256811[_0xb92a('0xcd')](_0x1478c8),{'individualHooks':!![]});}})[_0xb92a('0x27')](function(){if(_0x4d231f){return _0x4d231f[_0xb92a('0x60')]({'online':!![],'lastLoginAt':moment()[_0xb92a('0xf4')](_0xb92a('0x100')),'voicePause':_0x4d231f[_0xb92a('0xa0')]||![],'mailPause':_0x4d231f[_0xb92a('0xa0')]||![],'chatPause':_0x4d231f[_0xb92a('0xa0')]||![],'faxPause':_0x4d231f[_0xb92a('0xa0')]||![],'smsPause':_0x4d231f[_0xb92a('0xa0')]||![],'openchannelPause':_0x4d231f['loginInPause']||![],'whatsappPause':_0x4d231f['loginInPause']||![],'pauseType':_0x4d231f[_0xb92a('0xa0')]?_0xb92a('0x106'):null,'interface':_0x39830e,'lastPauseAt':moment()['format'](_0xb92a('0x100'))});}})[_0xb92a('0x27')](function(_0x113bc8){if(_0xf1c44b[_0xb92a('0x107')]){return _0x44ab02();}else{return Promise[_0xb92a('0x108')](_0x113bc8)[_0xb92a('0x27')](respondWithResult(_0x228ffe,null));}})[_0xb92a('0x1c')](handleError(_0x228ffe,null));};exports[_0xb92a('0x109')]=function(_0x23887a,_0x468ab3){var _0x21eb1b;return db['User'][_0xb92a('0x35')]({'where':{'id':_0x23887a[_0xb92a('0x53')]['id'],'role':_0xb92a('0x2f')},'attributes':['id',_0xb92a('0x37'),_0xb92a('0x28')]})[_0xb92a('0x27')](handleEntityNotFound(_0x468ab3,null))[_0xb92a('0x27')](function(_0x31fc9b){if(_0x31fc9b){_0x21eb1b=_0x31fc9b;return db[_0xb92a('0xb6')][_0xb92a('0x29')]({'where':{'membername':_0x21eb1b[_0xb92a('0x37')]},'individualHooks':!![]});}})['then'](function(){return db[_0xb92a('0xfe')]['findAll']({'where':{'membername':_0x21eb1b[_0xb92a('0x37')],'exitAt':null}});})[_0xb92a('0x27')](function(_0x53a9d2){var _0x214f78=[];_0x53a9d2[_0xb92a('0xff')](function(_0x2fcf17){_0x214f78[_0xb92a('0x46')](_0x2fcf17[_0xb92a('0x60')]({'exitAt':moment()[_0xb92a('0xf4')](_0xb92a('0x100'))}));});return Promise[_0xb92a('0x51')](_0x214f78);})['then'](function(){return _0x21eb1b[_0xb92a('0x60')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x468ab3,null))[_0xb92a('0x1c')](handleError(_0x468ab3,null));};exports[_0xb92a('0x10a')]=function(_0x4c62b1,_0x5bbdea){var _0x3a59b9;return db[_0xb92a('0xb6')][_0xb92a('0x60')]({'paused':0x1},{'where':{'UserId':_0x4c62b1[_0xb92a('0x53')]['id']},'individualHooks':!![]})[_0xb92a('0x27')](function(){return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x4c62b1[_0xb92a('0x53')]['id'],'role':_0xb92a('0x2f')},'attributes':['id',_0xb92a('0x37'),_0xb92a('0x28'),_0xb92a('0x66'),_0xb92a('0xa2'),'online']});})[_0xb92a('0x27')](handleEntityNotFound(_0x5bbdea,null))['then'](function(_0x4080bd){if(_0x4080bd){_0x3a59b9=_0x4080bd;return respondWithRpcPromise('QueuePause',_0xb92a('0x10a'),{'id':_0x3a59b9['id'],'name':_0x3a59b9[_0xb92a('0x37')],'pause':!![]});}})[_0xb92a('0x27')](function(){if(_0x3a59b9){return db['MemberReport'][_0xb92a('0x47')]({'where':{'membername':_0x3a59b9[_0xb92a('0x37')],'type':_0xb92a('0x104'),'exitAt':null}});}})[_0xb92a('0x27')](function(_0x484a8e){if(_0x484a8e[_0xb92a('0x4b')]){var _0x8eea3a=moment()[_0xb92a('0xf4')](_0xb92a('0x100'));for(var _0x3ed23a=0x0,_0x4ff03e=_0x484a8e[_0xb92a('0x4b')];_0x3ed23a<_0x4ff03e;_0x3ed23a++){_0x484a8e[_0x3ed23a][_0xb92a('0x10b')]({'exitAt':_0x8eea3a});}}})[_0xb92a('0x27')](function(){var _0x266e34=[];var _0x3c8e29=utils[_0xb92a('0x101')]();_0x3c8e29[_0xb92a('0xff')](function(_0x1bc80e){_0x266e34[_0xb92a('0x46')]({'channel':_0x1bc80e,'membername':_0x3a59b9[_0xb92a('0x37')],'interface':_[_0xb92a('0x70')](_0x3a59b9[_0xb92a('0xa2')])?util[_0xb92a('0xf4')](_0xb92a('0xae'),_0x3a59b9[_0xb92a('0x37')]):_0x3a59b9['interface'],'type':_0xb92a('0x104'),'enterAt':moment()['format'](_0xb92a('0x100')),'data1':_0x4c62b1[_0xb92a('0x61')][_0xb92a('0x3d')]||'DEFAULT\x20PAUSE','role':_0x3a59b9['role'],'internal':_0x3a59b9[_0xb92a('0x66')]});});return db[_0xb92a('0xfe')][_0xb92a('0x105')](_0x266e34,{'individualHooks':!![]});})[_0xb92a('0x27')](function(){return _0x3a59b9[_0xb92a('0x60')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x4c62b1[_0xb92a('0x61')]['type']||_0xb92a('0x10c'),'lastPauseAt':moment()[_0xb92a('0xf4')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xb92a('0x27')](respondWithResult(_0x5bbdea,null))[_0xb92a('0x1c')](handleError(_0x5bbdea,null));};exports[_0xb92a('0x10d')]=function(_0x5119f3,_0x294f18){if(_0x5119f3[_0xb92a('0x61')]['channel']&&!utils[_0xb92a('0xa3')](_0x5119f3[_0xb92a('0x61')][_0xb92a('0xb2')])){throw new APIBadRequestError(util[_0xb92a('0xf4')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x5119f3['body']['channel']));}return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x5119f3[_0xb92a('0x53')]['id']},'attributes':['id',_0xb92a('0x37'),_0xb92a('0x28'),_0xb92a('0x66'),_0xb92a('0xa2'),'online','voicePause',_0xb92a('0x10e'),'chatPause',_0xb92a('0x10f'),_0xb92a('0x110'),_0xb92a('0x111'),_0xb92a('0x112'),_0xb92a('0x113'),_0xb92a('0x114')]})[_0xb92a('0x27')](function(_0x319f81){if(!_0x319f81){throw new APINotFoundError(util[_0xb92a('0xf4')](_0xb92a('0x115'),_0x5119f3[_0xb92a('0x53')]['id']));}return _0x319f81['unpause'](_0x5119f3[_0xb92a('0x61')][_0xb92a('0xb2')]);})[_0xb92a('0x27')](respondWithResult(_0x294f18,null))['catch'](APIHandleError(_0x294f18));};exports[_0xb92a('0x116')]=function(_0x4e2c5a,_0x15387f){var _0x1d3b0c={};var _0x5c2771={};var _0x156fba;var _0x1a98f0;return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x4e2c5a[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x15387f,null))[_0xb92a('0x27')](function(_0x275cfc){if(_0x275cfc){_0x156fba=_0x275cfc;_0x5c2771['model']=_[_0xb92a('0x56')](db[_0xb92a('0x117')][_0xb92a('0x57')]);_0x5c2771['query']=_['keys'](_0x4e2c5a[_0xb92a('0x42')]);_0x5c2771['filters']=_[_0xb92a('0x59')](_0x5c2771[_0xb92a('0x54')],_0x5c2771['query']);_0x1d3b0c[_0xb92a('0x5a')]=_[_0xb92a('0x59')](_0x5c2771[_0xb92a('0x54')],qs[_0xb92a('0x5b')](_0x4e2c5a[_0xb92a('0x42')]['fields']));_0x1d3b0c[_0xb92a('0x5a')]=_0x1d3b0c[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x1d3b0c['attributes']:_0x5c2771['model'];_0x1d3b0c[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x4e2c5a[_0xb92a('0x42')]['sort']);_0x1d3b0c['where']=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0x4e2c5a['query'],_0x5c2771[_0xb92a('0x58')]));if(_0x4e2c5a[_0xb92a('0x42')][_0xb92a('0x32')]){_0x1d3b0c['where']=_[_0xb92a('0x5d')](_0x1d3b0c['where'],{'$or':_[_0xb92a('0x34')](_0x1d3b0c['attributes'],function(_0x4a18f9){var _0x2033a3={};_0x2033a3[_0x4a18f9]={'$like':'%'+_0x4e2c5a[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x2033a3;})});}_0x1d3b0c=_[_0xb92a('0x5d')]({},_0x1d3b0c,_0x4e2c5a[_0xb92a('0xd4')]);return _0x156fba[_0xb92a('0x116')](_0x1d3b0c);}})['then'](function(_0xfa7624){if(_0xfa7624){_0x1a98f0=_0xfa7624[_0xb92a('0x4b')];if(!_0x4e2c5a[_0xb92a('0x42')][_0xb92a('0xd5')](_0xb92a('0xdb'))){_0x1d3b0c['limit']=qs[_0xb92a('0x23')](_0x4e2c5a['query'][_0xb92a('0x23')]);_0x1d3b0c['offset']=qs[_0xb92a('0x21')](_0x4e2c5a[_0xb92a('0x42')][_0xb92a('0x21')]);}return _0x156fba[_0xb92a('0x116')](_0x1d3b0c);}})[_0xb92a('0x27')](function(_0x5ef3e4){if(_0x5ef3e4){return _0x5ef3e4?{'count':_0x1a98f0,'rows':_0x5ef3e4}:null;}})[_0xb92a('0x27')](respondWithResult(_0x15387f,null))[_0xb92a('0x1c')](handleError(_0x15387f,null));};exports[_0xb92a('0x118')]=function(_0x464c3e,_0x51850c){var _0x11dd86=_0x464c3e['params']['id'];var _0x35812e=_0x464c3e[_0xb92a('0x61')]?_0x464c3e[_0xb92a('0x61')][_0xb92a('0x64')]:null;var _0x148361=[];return Promise[_0xb92a('0x108')]()[_0xb92a('0x27')](function(){if(!_0x35812e)throw new APIBadRequestError(_0xb92a('0x119'));})['then'](function(){return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x11dd86}});})[_0xb92a('0x27')](function(_0x27080d){if(!_0x27080d)throw new APINotFoundError(util['format'](_0xb92a('0x115'),_0x464c3e[_0xb92a('0x53')]['id']));return db[_0xb92a('0x6c')]['transaction'](function(_0x530cc7){return _0x27080d['addTeams'](_0x35812e,{'transaction':_0x530cc7})[_0xb92a('0x27')](function(){return db[_0xb92a('0x117')][_0xb92a('0x47')]({'where':{'id':{'$in':_0x35812e}}});})[_0xb92a('0x27')](function(_0x261412){var _0x5ddcc7=_['map'](_0x261412,function(_0x1d550f){return _0x1d550f[_0xb92a('0x11a')]();});return Promise[_0xb92a('0x51')](_0x5ddcc7);})['then'](function(_0x51aaf8){_0x148361=_[_0xb92a('0x11b')](_0x51aaf8);var _0xf17817=_[_0xb92a('0x34')](_0x148361,function(_0x2148a4){return _0x2148a4[_0xb92a('0x11c')](_0x27080d['id'],{'transaction':_0x530cc7});});return Promise[_0xb92a('0x51')](_0xf17817);})['then'](function(){if(!_0x27080d['online'])return;var _0x17e12d=_[_0xb92a('0x32')](_0x148361,function(_0x3efae6){return _0x3efae6[_0xb92a('0x11d')](_0xb92a('0xb2'))==='Voice';});var _0x454472=_[_0xb92a('0x34')](_0x17e12d,function(_0x3438a4){return db[_0xb92a('0xb6')][_0xb92a('0xb0')]({'membername':_0x27080d['name'],'UserId':_0x27080d['id'],'queue_name':_0x3438a4[_0xb92a('0x37')],'VoiceQueueId':_0x3438a4['id'],'interface':_[_0xb92a('0x70')](_0x27080d[_0xb92a('0xa2')])?util['format'](_0xb92a('0xae'),_0x27080d[_0xb92a('0x37')]):_0x27080d[_0xb92a('0xa2')],'paused':_0x27080d['voicePause']||![],'penalty':_0x27080d['penalty']},{'transaction':_0x530cc7});});return Promise[_0xb92a('0x51')](_0x454472);})[_0xb92a('0x27')](function(){return db[_0xb92a('0x11e')][_0xb92a('0x47')]({'where':{'teamId':{'$in':_0x35812e}}});})[_0xb92a('0x27')](function(_0x3e08ea){var _0x54b35e=_[_0xb92a('0x34')](_0x3e08ea,function(_0x27c785){return db[_0xb92a('0x11f')][_0xb92a('0x83')]({'UserId':_0x27080d['id'],'VoicePrefixId':_0x27c785[_0xb92a('0x120')]},{'transaction':_0x530cc7});});return Promise[_0xb92a('0x51')](_0x54b35e);});});})['then'](function(){for(var _0x2f499a=0x0;_0x2f499a<_0x148361[_0xb92a('0x4b')];_0x2f499a++){var _0x2ccd0e=_0x148361[_0x2f499a][_0xb92a('0x11d')](_0xb92a('0xb2'));var _0xfd9bf8=_0x2ccd0e+_0xb92a('0xa9');socket[_0xb92a('0xaa')]('user'+_0x2ccd0e+_0xb92a('0xab'),{'UserId':_0x11dd86,['queueField']:_0x148361[_0x2f499a]['id']});}})[_0xb92a('0x27')](respondWithStatusCode(_0x51850c,null))[_0xb92a('0x1c')](APIHandleError(_0x51850c));};exports[_0xb92a('0x121')]=function(_0x5ca426,_0x3c0c0e){var _0x1eca35=_0x5ca426['params']['id'];var _0x543d33=null;if(_0x5ca426[_0xb92a('0x42')][_0xb92a('0x64')]){_0x543d33=_[_0xb92a('0xb4')](_0x5ca426['query']['ids'])?_0x5ca426['query'][_0xb92a('0x64')]:[_0x5ca426[_0xb92a('0x42')][_0xb92a('0x64')]];}var _0x561ee3=[];return Promise[_0xb92a('0x108')]()['then'](function(){if(!_0x543d33)throw new APIBadRequestError(_0xb92a('0x122'));})['then'](function(){return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x1eca35}});})[_0xb92a('0x27')](function(_0x31adfb){if(!_0x31adfb)throw new APINotFoundError(util['format'](_0xb92a('0x115'),_0x5ca426[_0xb92a('0x53')]['id']));return db[_0xb92a('0x6c')][_0xb92a('0x123')](function(_0x2905ae){return _0x31adfb[_0xb92a('0x121')](_0x543d33,{'transaction':_0x2905ae})[_0xb92a('0x27')](function(){return db[_0xb92a('0x117')]['findAll']({'where':{'id':{'$in':_0x543d33}}});})['then'](function(_0x1424ad){var _0x3d0a03=_[_0xb92a('0x34')](_0x1424ad,function(_0x2d3c39){return _0x2d3c39[_0xb92a('0x11a')]();});return Promise[_0xb92a('0x51')](_0x3d0a03);})[_0xb92a('0x27')](function(_0x1b9f67){_0x561ee3=_[_0xb92a('0x11b')](_0x1b9f67);var _0x32cf00=_[_0xb92a('0x34')](_0x561ee3,function(_0x28f5de){return _0x28f5de['removeAgent'](_0x31adfb['id'],{'transaction':_0x2905ae});});return Promise['all'](_0x32cf00);})[_0xb92a('0x27')](function(){if(!_0x31adfb['online'])return;var _0x57beb5=_[_0xb92a('0x32')](_0x561ee3,function(_0x75f6c9){return _0x75f6c9[_0xb92a('0x11d')](_0xb92a('0xb2'))===_0xb92a('0x124');});var _0x50b3de=_['map'](_0x57beb5,function(_0x532b52){return db[_0xb92a('0xb6')][_0xb92a('0x29')]({'where':{'VoiceQueueId':_0x532b52['id'],'UserId':_0x31adfb['id']},'transaction':_0x2905ae});});return Promise[_0xb92a('0x51')](_0x50b3de);})[_0xb92a('0x27')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x543d33}}});})['then'](function(_0x28bc97){var _0x3f5c9e=_[_0xb92a('0x34')](_0x28bc97,function(_0x506287){return db[_0xb92a('0x11f')][_0xb92a('0x29')]({'where':{'UserId':_0x31adfb['id'],'VoicePrefixId':_0x506287[_0xb92a('0x120')]}},{'transaction':_0x2905ae});});return Promise[_0xb92a('0x51')](_0x3f5c9e);});});})[_0xb92a('0x27')](function(){for(var _0x4ae91c=0x0;_0x4ae91c<_0x561ee3['length'];_0x4ae91c++){var _0x33e151=_0x561ee3[_0x4ae91c][_0xb92a('0x11d')](_0xb92a('0xb2'));var _0x271fc7=_0x33e151+'QueueId';socket[_0xb92a('0xaa')](_0xb92a('0x2d')+_0x33e151+_0xb92a('0xb5'),{'UserId':_0x1eca35,['queueField']:_0x561ee3[_0x4ae91c]['id']});}})['then'](respondWithStatusCode(_0x3c0c0e,null))[_0xb92a('0x1c')](APIHandleError(_0x3c0c0e));};exports[_0xb92a('0x125')]=function(_0x18fd89,_0x20b69c){var _0x1cdc3f={};var _0x121582={};var _0x2ea67f;var _0x4b2f96;return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x18fd89[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x20b69c,null))[_0xb92a('0x27')](function(_0x584bdf){if(_0x584bdf){_0x2ea67f=_0x584bdf;_0x121582[_0xb92a('0x54')]=_[_0xb92a('0x56')](db['CmList'][_0xb92a('0x57')]);_0x121582[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x18fd89[_0xb92a('0x42')]);_0x121582[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0x121582[_0xb92a('0x54')],_0x121582[_0xb92a('0x42')]);_0x1cdc3f[_0xb92a('0x5a')]=_['intersection'](_0x121582[_0xb92a('0x54')],qs[_0xb92a('0x5b')](_0x18fd89[_0xb92a('0x42')][_0xb92a('0x5b')]));_0x1cdc3f[_0xb92a('0x5a')]=_0x1cdc3f['attributes'][_0xb92a('0x4b')]?_0x1cdc3f[_0xb92a('0x5a')]:_0x121582['model'];_0x1cdc3f[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x18fd89['query']['sort']);_0x1cdc3f[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0x18fd89[_0xb92a('0x42')],_0x121582[_0xb92a('0x58')]));if(_0x18fd89['query'][_0xb92a('0x32')]){_0x1cdc3f['where']=_[_0xb92a('0x5d')](_0x1cdc3f[_0xb92a('0x41')],{'$or':_[_0xb92a('0x34')](_0x1cdc3f[_0xb92a('0x5a')],function(_0x5c4bcb){var _0x1dd1f3={};_0x1dd1f3[_0x5c4bcb]={'$like':'%'+_0x18fd89[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x1dd1f3;})});}_0x1cdc3f=_[_0xb92a('0x5d')]({},_0x1cdc3f,_0x18fd89[_0xb92a('0xd4')]);return _0x2ea67f[_0xb92a('0x125')](_0x1cdc3f);}})[_0xb92a('0x27')](function(_0x4c11b1){if(_0x4c11b1){_0x4b2f96=_0x4c11b1[_0xb92a('0x4b')];if(!_0x18fd89[_0xb92a('0x42')]['hasOwnProperty'](_0xb92a('0xdb'))){_0x1cdc3f[_0xb92a('0x23')]=qs[_0xb92a('0x23')](_0x18fd89[_0xb92a('0x42')][_0xb92a('0x23')]);_0x1cdc3f[_0xb92a('0x21')]=qs[_0xb92a('0x21')](_0x18fd89['query'][_0xb92a('0x21')]);}return _0x2ea67f[_0xb92a('0x125')](_0x1cdc3f);}})[_0xb92a('0x27')](function(_0x36b976){if(_0x36b976){return _0x36b976?{'count':_0x4b2f96,'rows':_0x36b976}:null;}})[_0xb92a('0x27')](respondWithResult(_0x20b69c,null))[_0xb92a('0x1c')](handleError(_0x20b69c,null));};exports[_0xb92a('0x126')]=function(_0x457391,_0x243923){var _0x4d522d={};var _0x5451c7={};var _0x10f797;return db[_0xb92a('0x3c')]['findOne']({'where':{'id':_0x457391['params']['id']}})['then'](handleEntityNotFound(_0x243923,null))[_0xb92a('0x27')](function(_0x58e70b){if(_0x58e70b){_0x10f797=_0x58e70b;_0x5451c7['model']=_['keys'](db['User']['rawAttributes']);_0x5451c7[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x457391[_0xb92a('0x42')]);_0x5451c7[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0x5451c7[_0xb92a('0x54')],_0x5451c7[_0xb92a('0x42')]);_0x4d522d[_0xb92a('0x5a')]=_['intersection'](_0x5451c7[_0xb92a('0x54')],qs[_0xb92a('0x5b')](_0x457391['query']['fields']));_0x4d522d[_0xb92a('0x5a')]=_0x4d522d['attributes'][_0xb92a('0x4b')]?_0x4d522d[_0xb92a('0x5a')]:_0x5451c7['model'];_0x4d522d[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x457391['query'][_0xb92a('0xd2')]);_0x4d522d[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0x457391['query'],_0x5451c7['filters']));if(_0x457391['query'][_0xb92a('0x32')]){_0x4d522d[_0xb92a('0x41')]=_[_0xb92a('0x5d')](_0x4d522d[_0xb92a('0x41')],{'$or':_[_0xb92a('0x34')](_0x4d522d['attributes'],function(_0x3bdedf){var _0x5e0fde={};_0x5e0fde[_0x3bdedf]={'$like':'%'+_0x457391[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x5e0fde;})});}_0x4d522d[_0xb92a('0x54')]=db[_0xb92a('0x3c')];_0x4d522d['as']=_0xb92a('0x2e');_0x4d522d=_[_0xb92a('0x5d')]({},_0x4d522d,_0x457391[_0xb92a('0xd4')]);return _0x10f797[_0xb92a('0x127')]({'include':[_0x4d522d]});}})[_0xb92a('0x27')](function(_0x307505){if(_0x307505){var _0x4c3de4={},_0x2ed6e0=[];for(var _0x472c89=0x0;_0x472c89<_0x307505['length'];_0x472c89+=0x1){for(var _0x486ee1=0x0,_0x128a91;_0x486ee1<_0x307505[_0x472c89][_0xb92a('0x2e')][_0xb92a('0x4b')];_0x486ee1+=0x1){_0x128a91=_0x307505[_0x472c89][_0xb92a('0x2e')][_0x486ee1]['get']({'plain':!![]});_0x4c3de4[_0x128a91['id']]=_0x128a91;}}_0x4c3de4=_[_0xb92a('0x128')](_0x4c3de4);for(var _0x1d9167=qs[_0xb92a('0x21')](_0x457391[_0xb92a('0x42')]['offset']);_0x1d9167<_0x4c3de4[_0xb92a('0x4b')]&&_0x2ed6e0[_0xb92a('0x4b')]=_0x562a68){_0x1048a1=_0x562a68;_0x110027=0xc8;}else{_0x110027=0xce;}_0x54dd09[_0x33c4('0x1f')](_0x110027);return _0x54dd09[_0x33c4('0x25')](_0x33c4('0x26'),_0x37f968+'-'+_0x1048a1+'/'+_0x562a68)[_0x33c4('0x20')](_0x1890fd);}return null;};}function saveUpdates(_0x4ab58a){return function(_0x1cf223){if(_0x1cf223){return _0x1cf223[_0x33c4('0x27')](_0x4ab58a)[_0x33c4('0x28')](function(_0x4a8eb9){if(_0x4a8eb9[_0x33c4('0x29')]==='agent'){socket['emit']('userNotification:recalc:'+_0x4a8eb9['id'],_0x4a8eb9);}return _0x4a8eb9;});}return null;};}function removeEntity(_0x278fdd){return function(_0x426af1){if(_0x426af1){return _0x426af1[_0x33c4('0x2a')]()[_0x33c4('0x28')](function(){var _0x3332c4=_0x426af1[_0x33c4('0x2b')]({'plain':!![]});if(_0x3332c4[_0x33c4('0x29')]===_0x33c4('0x2c'))return;var _0x27cda7=[{'name':_0x33c4('0x2d'),'value':_0x33c4('0x2e'),'ignore':!![]},{'name':_0x33c4('0x2f'),'value':_0x33c4('0x30'),'ignore':![]},{'name':_0x33c4('0x31'),'value':'telephone','ignore':![]}];var _0x42a695=_(_0x27cda7)[_0x33c4('0x32')](_0x33c4('0x33'))['map'](_0x33c4('0x34'))[_0x33c4('0x34')]();if(_[_0x33c4('0x35')](_0x42a695,_0x3332c4[_0x33c4('0x29')])){return;}var _0x494317=_[_0x33c4('0x36')](_0x27cda7,['value',_0x3332c4[_0x33c4('0x29')]])[_0x33c4('0x37')];return db[_0x33c4('0x38')][_0x33c4('0x2a')]({'where':{'type':_0x494317,'resourceId':_0x3332c4['id']}})[_0x33c4('0x28')](function(){return _0x426af1;});})[_0x33c4('0x28')](function(){_0x278fdd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c1102){return function(_0x2df220){if(!_0x2df220){_0x5c1102['sendStatus'](0x194);}return _0x2df220;};}function handleError(_0x3746a1,_0x4fae9a){_0x4fae9a=_0x4fae9a||0x1f4;return function(_0x4c0487){logger[_0x33c4('0x1a')](_0x4c0487['stack']);if(_0x4c0487['name']){delete _0x4c0487[_0x33c4('0x37')];}_0x3746a1['status'](_0x4fae9a)[_0x33c4('0x39')](_0x4c0487);};}exports[_0x33c4('0x3a')]=function(_0x1df291,_0xc05f4e){var _0x3671f0={},_0x434080={'count':0x0,'rows':[]};var _0x5e0fd4=_(db['User'][_0x33c4('0x3b')])[_0x33c4('0x3c')](function(_0xab9d29){return{'name':_0xab9d29[_0x33c4('0x3d')],'type':_0xab9d29[_0x33c4('0x3e')]['key']};})[_0x33c4('0x32')](function(_0xc3fe52){return!_[_0x33c4('0x35')]([_0x33c4('0x3f'),_0x33c4('0x40')],_0xc3fe52[_0x33c4('0x37')]);})[_0x33c4('0x34')]();_0x3671f0=qs[_0x33c4('0x41')](_0x5e0fd4,_0x1df291);var _0x2fb533={'where':_0x3671f0[_0x33c4('0x42')]};return db['User'][_0x33c4('0x24')](_0x2fb533)[_0x33c4('0x28')](function(_0x51ebdd){_0x434080['count']=_0x51ebdd;if(_0x1df291[_0x33c4('0x43')][_0x33c4('0x44')]){_0x3671f0[_0x33c4('0x45')]=[{'all':!![]}];}if(_0x1df291['query']['userSetting']===_0x33c4('0x46')){_0x3671f0[_0x33c4('0x45')]=[{'model':db[_0x33c4('0x47')],'as':_0x33c4('0x48')}];}if(!_[_0x33c4('0x35')](_0x3671f0[_0x33c4('0x49')],'id')){_0x3671f0['attributes'][_0x33c4('0x4a')]('id');}return db[_0x33c4('0x4b')][_0x33c4('0x4c')](_0x3671f0);})[_0x33c4('0x28')](function(_0x3013df){_0x434080[_0x33c4('0x4d')]=_0x3013df;if(_0x1df291[_0x33c4('0x43')]['openTabs']==='true'){var _0x1dfb36=[];for(var _0x36b35b=0x0;_0x36b35b<_0x434080[_0x33c4('0x4d')][_0x33c4('0x4e')];_0x36b35b++){_0x1dfb36[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x4f'),_0x434080[_0x33c4('0x4d')][_0x36b35b]['dataValues']));_0x1dfb36[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x50'),_0x434080[_0x33c4('0x4d')][_0x36b35b]['dataValues']));_0x1dfb36['push'](get_open_tabs(_0x33c4('0x51'),_0x434080[_0x33c4('0x4d')][_0x36b35b][_0x33c4('0x52')]));_0x1dfb36[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x53'),_0x434080[_0x33c4('0x4d')][_0x36b35b][_0x33c4('0x52')]));_0x1dfb36[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x54'),_0x434080['rows'][_0x36b35b][_0x33c4('0x52')]));_0x1dfb36[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x55'),_0x434080['rows'][_0x36b35b][_0x33c4('0x52')]));}return Promise[_0x33c4('0x56')](_0x1dfb36)['then'](function(){return _0x434080;});}else{return _0x434080;}})['then'](respondWithFilteredResult(_0xc05f4e,_0x3671f0))[_0x33c4('0x1d')](handleError(_0xc05f4e,null));};exports[_0x33c4('0x57')]=function(_0xe1fb11,_0x6fe377){var _0x43f3fe={'raw':![],'where':{'id':_0xe1fb11[_0x33c4('0x58')]['id']}},_0x25c1cc={};_0x25c1cc['model']=_[_0x33c4('0x59')](_[_0x33c4('0x5a')](db[_0x33c4('0x4b')][_0x33c4('0x3b')]),['password','salt']);_0x25c1cc[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0xe1fb11[_0x33c4('0x43')]);_0x25c1cc['filters']=_[_0x33c4('0x5b')](_0x25c1cc[_0x33c4('0x5c')],_0x25c1cc['query']);_0x43f3fe[_0x33c4('0x49')]=_[_0x33c4('0x5b')](_0x25c1cc['model'],qs[_0x33c4('0x5d')](_0xe1fb11[_0x33c4('0x43')][_0x33c4('0x5d')]));_0x43f3fe['attributes']=_0x43f3fe[_0x33c4('0x49')][_0x33c4('0x4e')]?_0x43f3fe[_0x33c4('0x49')]:_0x25c1cc[_0x33c4('0x5c')];if(_0xe1fb11[_0x33c4('0x43')][_0x33c4('0x44')]){_0x43f3fe[_0x33c4('0x45')]=[{'all':!![]}];}if(_0xe1fb11[_0x33c4('0x43')]['userSetting']===_0x33c4('0x46')){_0x43f3fe[_0x33c4('0x45')]=[{'model':db['UserSetting'],'as':'userSetting'}];}_0x43f3fe=_[_0x33c4('0x5e')]({},_0x43f3fe,_0xe1fb11['options']);if(!_[_0x33c4('0x35')](_0x43f3fe[_0x33c4('0x49')],'id')){_0x43f3fe['attributes']['push']('id');}return db[_0x33c4('0x4b')][_0x33c4('0x36')](_0x43f3fe)[_0x33c4('0x28')](handleEntityNotFound(_0x6fe377,null))[_0x33c4('0x28')](function(_0xe3cf86){var _0x16719d=[];values=_0xe3cf86;if(_0xe1fb11[_0x33c4('0x43')][_0x33c4('0x5f')]===_0x33c4('0x46')){_0x16719d[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x4f'),_0xe3cf86[_0x33c4('0x52')]));_0x16719d[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x50'),_0xe3cf86[_0x33c4('0x52')]));_0x16719d[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x54'),_0xe3cf86[_0x33c4('0x52')]));_0x16719d[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x55'),_0xe3cf86['dataValues']));_0x16719d[_0x33c4('0x4a')](get_open_tabs('fax',_0xe3cf86[_0x33c4('0x52')]));_0x16719d[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x53'),_0xe3cf86[_0x33c4('0x52')]));return Promise[_0x33c4('0x56')](_0x16719d);}else{return values;}})[_0x33c4('0x28')](function(){return values;})['then'](respondWithResult(_0x6fe377,null))[_0x33c4('0x1d')](handleError(_0x6fe377,null));};exports[_0x33c4('0x27')]=function(_0x5a8272,_0x436a06){if(_0x5a8272[_0x33c4('0x60')]['id']){delete _0x5a8272['body']['id'];}delete _0x5a8272['body'][_0x33c4('0x29')];return db[_0x33c4('0x4b')]['find']({'where':{'id':_0x5a8272[_0x33c4('0x58')]['id']}})[_0x33c4('0x28')](handleEntityNotFound(_0x436a06,null))[_0x33c4('0x28')](saveUpdates(_0x5a8272[_0x33c4('0x60')],null))['then'](respondWithResult(_0x436a06,null))[_0x33c4('0x1d')](handleError(_0x436a06,null));};exports[_0x33c4('0x61')]=function(_0x529c71,_0xef6b92){return db['User']['describe']()[_0x33c4('0x28')](respondWithResult(_0xef6b92,null))['catch'](handleError(_0xef6b92,null));};exports['addContacts']=function(_0x59d6fc,_0x1e11f6){return db[_0x33c4('0x4b')]['find']({'where':{'id':_0x59d6fc['params']['id']}})[_0x33c4('0x28')](handleEntityNotFound(_0x1e11f6,null))['then'](function(_0x20a06b){if(_0x20a06b){return _0x20a06b[_0x33c4('0x62')](_0x59d6fc[_0x33c4('0x60')][_0x33c4('0x63')],_['omit'](_0x59d6fc[_0x33c4('0x60')],[_0x33c4('0x63'),'id'])||{});}})[_0x33c4('0x28')](respondWithResult(_0x1e11f6,null))['catch'](handleError(_0x1e11f6,null));};function validateUser(_0x562646){return new Promise(function(_0xff65fc,_0x33d03b){if(_0x562646[_0x33c4('0x64')])return _0xff65fc(_0x562646);return db[_0x33c4('0x65')]['findById'](0x1)[_0x33c4('0x28')](function(_0xa20eb0){if(_0xa20eb0[_0x33c4('0x66')])authService['validatePasswordPattern'](_0x562646[_0x33c4('0x3f')]);db[_0x33c4('0x4b')][_0x33c4('0x67')]('internal')[_0x33c4('0x28')](function(_0xa01cab){if(_[_0x33c4('0x68')](_0xa01cab)){_0x562646[_0x33c4('0x64')]=_0xa20eb0[_0x33c4('0x69')]||0x1;return;}if(_[_0x33c4('0x68')](_0xa20eb0[_0x33c4('0x69')])||_0xa20eb0['min_internal']===_0xa01cab){_0x562646[_0x33c4('0x64')]=_0xa01cab+0x1;return;}if(_0xa20eb0[_0x33c4('0x69')]>_0xa01cab){_0x562646[_0x33c4('0x64')]=_0xa20eb0[_0x33c4('0x69')];return;}return db[_0x33c4('0x6a')]['query'](_0x33c4('0x6b'),{'type':db[_0x33c4('0x6a')][_0x33c4('0x6c')][_0x33c4('0x6d')]})[_0x33c4('0x28')](function(_0x50c2e9){if(_0x50c2e9&&_0x50c2e9['length']){for(var _0x3f8603=0x0,_0x4193c2=_0x50c2e9[_0x33c4('0x4e')];_0x3f8603<_0x4193c2&&_[_0x33c4('0x68')](_0x562646['internal']);_0x3f8603++){if(_0xa20eb0[_0x33c4('0x69')]<=_0x50c2e9[_0x3f8603]['from']){_0x562646[_0x33c4('0x64')]=_0x50c2e9[_0x3f8603][_0x33c4('0x6e')];}else if(_0xa20eb0[_0x33c4('0x69')]>_0x50c2e9[_0x3f8603][_0x33c4('0x6e')]&&_0xa20eb0[_0x33c4('0x69')]<=_0x50c2e9[_0x3f8603]['to']){_0x562646[_0x33c4('0x64')]=_0xa20eb0['min_internal'];}}}if(_[_0x33c4('0x68')](_0x562646[_0x33c4('0x64')])){_0x562646[_0x33c4('0x64')]=_0xa01cab+0x1;}return _0xff65fc(_0x562646);});});})[_0x33c4('0x1d')](function(_0x58c070){_0x33d03b(_0x58c070);});});}function updateUser(_0x4fb7e5){return new Promise(function(_0x4d6ff7,_0x5554a6){try{if(_0x4fb7e5[_0x33c4('0x6f')]){_0x4fb7e5['mailbox']=_0x4fb7e5[_0x33c4('0x64')];_0x4fb7e5['VoiceMail']={'mailbox':_0x4fb7e5[_0x33c4('0x64')],'password':_0x4fb7e5[_0x33c4('0x3f')],'fullname':_0x4fb7e5[_0x33c4('0x70')],'email':_0x4fb7e5[_0x33c4('0x71')]};}if(_0x4fb7e5[_0x33c4('0x29')]===_0x33c4('0x30')){if(!_0x4fb7e5[_0x33c4('0x72')])_0x4fb7e5['permissions']=[_0x33c4('0x73'),_0x33c4('0x74'),_0x33c4('0x75'),_0x33c4('0x76'),_0x33c4('0x77'),_0x33c4('0x78'),_0x33c4('0x79'),'106',_0x33c4('0x7a'),_0x33c4('0x7b'),_0x33c4('0x7c'),'100',_0x33c4('0x7d'),_0x33c4('0x7e'),_0x33c4('0x7f')];}_0x4d6ff7(_0x4fb7e5);}catch(_0x4de2cd){_0x5554a6(_0x4de2cd);}});}exports[_0x33c4('0x80')]=function(_0x24be1a,_0x476f71){if(_0x24be1a[_0x33c4('0x2e')][_0x33c4('0x29')]===_0x33c4('0x30'))throw new Error(_0x33c4('0x81'));if(_0x24be1a[_0x33c4('0x60')][_0x33c4('0x29')]===_0x33c4('0x2e')&&_0x24be1a[_0x33c4('0x2e')]['role']!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x24be1a['body']['role']==='admin'&&_0x24be1a[_0x33c4('0x2e')]['role']!==_0x33c4('0x2c')){throw new Error(_0x33c4('0x82'));}return licenseUtil[_0x33c4('0x83')]([_0x24be1a[_0x33c4('0x60')]])[_0x33c4('0x28')](function(){return validateUser(_0x24be1a[_0x33c4('0x60')]);})[_0x33c4('0x28')](function(_0x3353e9){return updateUser(_0x3353e9)[_0x33c4('0x28')](function(_0x216103){if(_0x216103[_0x33c4('0x29')]===_0x33c4('0x2c')){_0x216103[_0x33c4('0x84')]=_0x24be1a[_0x33c4('0x2e')][_0x33c4('0x84')];delete _0x216103[_0x33c4('0x85')];}return _0x216103;});})[_0x33c4('0x28')](function(_0x4bb0a6){return db['User'][_0x33c4('0x80')](_0x4bb0a6,{'include':[{'model':db['VoiceMail'],'as':_0x33c4('0x86')}]});})[_0x33c4('0x28')](function(_0x14961f){if(_0x24be1a[_0x33c4('0x60')][_0x33c4('0x29')]===_0x33c4('0x2e'))return _0x14961f;if(_0x24be1a[_0x33c4('0x2e')][_0x33c4('0x29')]!=='user')return _0x14961f;return db[_0x33c4('0x87')][_0x33c4('0x36')]({'where':{'name':_0x14961f['role']==='agent'?_0x33c4('0x2f'):_0x33c4('0x31'),'userProfileId':_0x24be1a['user'][_0x33c4('0x85')]},'raw':!![]})[_0x33c4('0x28')](function(_0x82f7aa){if(!_0x82f7aa||_0x82f7aa['autoAssociation']!=0x0)return _0x14961f;return db[_0x33c4('0x38')][_0x33c4('0x80')]({'name':_0x14961f[_0x33c4('0x37')],'resourceId':_0x14961f['id'],'type':_0x82f7aa[_0x33c4('0x37')],'sectionId':_0x82f7aa['id']},{})[_0x33c4('0x28')](function(){return _0x14961f;});})['catch'](function(_0x1c3d71){logger[_0x33c4('0x1a')](_0x33c4('0x88'),_0x1c3d71);throw _0x1c3d71;});})[_0x33c4('0x28')](respondWithResult(_0x476f71,0xc9))['catch'](handleError(_0x476f71,null));};exports['bulkCreate']=function(_0x239e85,_0x4d7f04){var _0x7e96f=_0x239e85[_0x33c4('0x60')];var _0x181890=[];if(_0x239e85[_0x33c4('0x2e')][_0x33c4('0x29')]==='agent')throw new Error(_0x33c4('0x81'));if(_[_0x33c4('0x89')](_0x7e96f,['role',_0x33c4('0x2e')])&&_0x239e85[_0x33c4('0x2e')]['role']!==_0x33c4('0x2c')){throw new Error(_0x33c4('0x8a'));}if(_[_0x33c4('0x89')](_0x7e96f,[_0x33c4('0x29'),'admin'])&&_0x239e85[_0x33c4('0x2e')][_0x33c4('0x29')]!==_0x33c4('0x2c')){throw new Error(_0x33c4('0x8b'));}return licenseUtil[_0x33c4('0x83')](_0x7e96f)['then'](function(){return validateUser(_0x7e96f[0x0]);})['then'](function(){for(var _0x1e4c43=0x1;_0x1e4c43<_0x7e96f[_0x33c4('0x4e')];_0x1e4c43++){var _0x3a5371=_0x7e96f[_0x1e4c43-0x1][_0x33c4('0x64')];if(!_0x7e96f[_0x1e4c43][_0x33c4('0x64')])_0x7e96f[_0x1e4c43][_0x33c4('0x64')]=_0x3a5371+0x1;_0x181890[_0x33c4('0x4a')](validateUser(_0x7e96f[_0x1e4c43]));}return Promise['all'](_0x181890);})[_0x33c4('0x28')](function(){_0x181890=[];for(var _0xd0eb96=0x0;_0xd0eb96<_0x7e96f['length'];_0xd0eb96++){_0x181890[_0x33c4('0x4a')](updateUser(_0x7e96f[_0xd0eb96]));}return Promise[_0x33c4('0x56')](_0x181890);})[_0x33c4('0x28')](function(){_0x181890=_0x7e96f[_0x33c4('0x3c')](function(_0x4ca692){return db[_0x33c4('0x4b')]['create'](_0x4ca692,{'include':[{'model':db[_0x33c4('0x86')],'as':_0x33c4('0x86')}]})[_0x33c4('0x28')](function(_0x2d01ab){_0x4ca692['id']=_0x2d01ab['id'];return _0x4ca692;});});return Promise[_0x33c4('0x56')](_0x181890);})[_0x33c4('0x28')](function(_0x3a7719){if(_0x239e85[_0x33c4('0x60')][_0x33c4('0x29')]===_0x33c4('0x2e'))return _0x3a7719;if(_0x239e85[_0x33c4('0x2e')][_0x33c4('0x29')]!==_0x33c4('0x2e'))return _0x3a7719;var _0x3e1c7c=_[_0x33c4('0x89')](_0x3a7719,function(_0x5aec1f){return _0x5aec1f['role']===_0x33c4('0x30')||_0x5aec1f['role']===_0x33c4('0x8c');});if(!_0x3e1c7c)return _0x3a7719;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':[_0x33c4('0x2f'),_0x33c4('0x31')]},'userProfileId':_0x239e85[_0x33c4('0x2e')][_0x33c4('0x85')]},'raw':!![]})['then'](function(_0x52fe5f){if(_['isEmpty'](_0x52fe5f)||!_[_0x33c4('0x89')](_0x52fe5f,['autoAssociation',0x0]))return _0x3a7719;_0x181890=[];var _0x3f92e8=_(_0x52fe5f)[_0x33c4('0x3c')](function(_0x586327){if(_0x586327[_0x33c4('0x8d')]===0x1)return;return _0x586327[_0x33c4('0x37')]===_0x33c4('0x2f')?_0x33c4('0x30'):'telephone';})[_0x33c4('0x8e')]()['value']();for(var _0x3555f8=0x0;_0x3555f8<_0x3a7719['length'];_0x3555f8++){if(!_[_0x33c4('0x35')](_0x3f92e8,_0x3a7719[_0x3555f8][_0x33c4('0x29')]))return;var _0x1c01df=_0x3a7719[_0x3555f8][_0x33c4('0x29')]===_0x33c4('0x30')?_0x33c4('0x2f'):_0x33c4('0x31');_0x181890[_0x33c4('0x4a')](db[_0x33c4('0x38')][_0x33c4('0x80')]({'name':_0x3a7719[_0x3555f8][_0x33c4('0x37')],'resourceId':_0x3a7719[_0x3555f8]['id'],'type':_0x1c01df,'sectionId':_['find'](_0x52fe5f,[_0x33c4('0x37'),_0x1c01df])['id']},{}));}return Promise['all'](_0x181890);});})['then'](respondWithResult(_0x4d7f04,0xc9))['catch'](handleError(_0x4d7f04,null));};exports['changePassword']=function(_0x1d6e03,_0x73dab4){if(_0x1d6e03[_0x33c4('0x60')]['id']){delete _0x1d6e03[_0x33c4('0x60')]['id'];}return db['User'][_0x33c4('0x36')]({'where':{'id':_0x1d6e03[_0x33c4('0x58')]['id']}})[_0x33c4('0x28')](function(_0x4d2fd9){if(!_0x4d2fd9)return null;if(_0x4d2fd9['id']===_0x1d6e03[_0x33c4('0x2e')]['id']){if(!_0x1d6e03[_0x33c4('0x60')]['oldPassword']||!_0x1d6e03[_0x33c4('0x60')]['newPassword']){throw new db[(_0x33c4('0x8f'))][(_0x33c4('0x90'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x4d2fd9[_0x33c4('0x91')](_0x1d6e03[_0x33c4('0x60')]['oldPassword'])){throw new db['Sequelize'][(_0x33c4('0x90'))](_0x33c4('0x92'));}if(_0x1d6e03[_0x33c4('0x60')][_0x33c4('0x93')]===_0x1d6e03[_0x33c4('0x60')][_0x33c4('0x94')]){throw new db[(_0x33c4('0x8f'))]['ValidationError'](_0x33c4('0x95'));}}else if(_0x1d6e03['user'][_0x33c4('0x29')]===_0x33c4('0x2c')){if(!_0x1d6e03['body'][_0x33c4('0x94')]){throw new db[(_0x33c4('0x8f'))]['ValidationError'](_0x33c4('0x96'));}}else if(_0x1d6e03[_0x33c4('0x2e')]['role']===_0x33c4('0x2e')){if(!_0x1d6e03[_0x33c4('0x60')][_0x33c4('0x94')]){throw new db[(_0x33c4('0x8f'))][(_0x33c4('0x90'))](_0x33c4('0x96'));}if(_0x4d2fd9['role']!=='agent'){throw new db['Sequelize'][(_0x33c4('0x90'))](_0x33c4('0x81'));}}else{throw new db[(_0x33c4('0x8f'))][(_0x33c4('0x90'))]('Unauthorized');}return _0x4d2fd9;})[_0x33c4('0x28')](handleEntityNotFound(_0x73dab4,null))[_0x33c4('0x28')](function(_0x550e8a){return db['Setting'][_0x33c4('0x97')]({'attributes':['id','securePassword',_0x33c4('0x98'),_0x33c4('0x99')]})[_0x33c4('0x28')](function(_0x3bd4d3){if(_0x3bd4d3[_0x33c4('0x66')])authService[_0x33c4('0x9a')](_0x1d6e03[_0x33c4('0x60')]['newPassword']);if(!_0x3bd4d3[_0x33c4('0x98')]||!_0x550e8a['previousPasswords'])return _0x550e8a;authService[_0x33c4('0x9b')](_0x1d6e03[_0x33c4('0x60')]['newPassword'],_0x550e8a[_0x33c4('0x9c')],_0x3bd4d3[_0x33c4('0x99')]);return _0x550e8a;})[_0x33c4('0x28')](saveUpdates({'password':_0x1d6e03[_0x33c4('0x60')][_0x33c4('0x94')],'passwordResetAt':_0x1d6e03[_0x33c4('0x2e')]['id']==_0x1d6e03[_0x33c4('0x58')]['id']?moment():null,'previousPasswords':authService[_0x33c4('0x9d')](_0x1d6e03[_0x33c4('0x60')][_0x33c4('0x94')],_0x550e8a[_0x33c4('0x9c')])},null));})[_0x33c4('0x28')](respondWithResult(_0x73dab4,null))[_0x33c4('0x1d')](handleError(_0x73dab4,null));};exports[_0x33c4('0x9e')]=function(_0x4a666d,_0x50fc8c){var _0x15ad36=_0x4a666d[_0x33c4('0x60')][_0x33c4('0x9f')];return db['User'][_0x33c4('0x36')]({'where':{'id':_0x4a666d[_0x33c4('0x58')]['id']},'attributes':['id',_0x33c4('0x37'),_0x33c4('0x29'),'online','loginInPause','voicePause',_0x33c4('0xa0')]})[_0x33c4('0x28')](handleEntityNotFound(_0x50fc8c,null))['then'](function(_0x581181){if(_0x581181){if(!utils[_0x33c4('0xa1')](_0x15ad36)){throw new db[(_0x33c4('0x8f'))]['ValidationError'](_0x33c4('0xa2'));}return _0x581181[_0x33c4('0xa3')+_[_0x33c4('0xa4')](_0x15ad36[_0x33c4('0xa5')]())+'Queues'](_0x4a666d[_0x33c4('0x60')][_0x33c4('0x63')],{'penalty':_0x4a666d['body'][_0x33c4('0xa6')]||0x0})[_0x33c4('0xa7')](function(_0x3b43ec){for(var _0xee208d=0x0;_0xee208d<_0x4a666d['body'][_0x33c4('0x63')][_0x33c4('0x4e')];_0xee208d+=0x1){var _0x59e2b9={'UserId':Number(_0x4a666d[_0x33c4('0x58')]['id'])};_0x59e2b9[_['capitalize'](_0x15ad36[_0x33c4('0xa5')]())+_0x33c4('0xa8')]=Number(_0x4a666d[_0x33c4('0x60')][_0x33c4('0x63')][_0xee208d]);socket[_0x33c4('0xa9')]('user'+_['capitalize'](_0x15ad36[_0x33c4('0xa5')]())+_0x33c4('0xaa'),_0x59e2b9);}return _0x3b43ec;})[_0x33c4('0x28')](function(){if(_0x15ad36===_0x33c4('0xab')){return db[_0x33c4('0xac')][_0x33c4('0x4c')]({'where':{'id':_0x4a666d[_0x33c4('0x60')][_0x33c4('0x63')]||[]},'raw':!![],'attributes':['id',_0x33c4('0x37')]});}})[_0x33c4('0x28')](function(_0x140d92){var _0x55ffcd=_0x581181[_0x33c4('0x2b')]({'plain':!![]});var _0x2ec94e=[];if(_0x15ad36===_0x33c4('0xab')&&_0x55ffcd['role']===_0x33c4('0x30')&&_0x55ffcd[_0x33c4('0xad')]){for(let _0xe0bcc4=0x0;_0xe0bcc4<_0x140d92['length'];_0xe0bcc4+=0x1){_0x2ec94e['push']({'membername':_0x55ffcd[_0x33c4('0x37')],'UserId':_0x55ffcd['id'],'queue_name':_0x140d92[_0xe0bcc4][_0x33c4('0x37')],'VoiceQueueId':_0x140d92[_0xe0bcc4]['id'],'interface':_[_0x33c4('0x68')](_0x55ffcd[_0x33c4('0xa0')])?util[_0x33c4('0xae')]('SIP/%s',_0x55ffcd[_0x33c4('0x37')]):_0x55ffcd[_0x33c4('0xa0')],'paused':_0x55ffcd[_0x33c4('0xaf')]||![],'penalty':_0x4a666d[_0x33c4('0x60')][_0x33c4('0xa6')]||0x0});}return Promise[_0x33c4('0x56')](_0x2ec94e[_0x33c4('0x3c')](function(_0x402f9f){return db[_0x33c4('0xb0')][_0x33c4('0xb1')](_0x402f9f);}));}return _0x581181;});}})[_0x33c4('0x28')](respondWithStatusCode(_0x50fc8c,null))[_0x33c4('0x1d')](handleError(_0x50fc8c,null));};exports['removeQueues']=function(_0x59fa4d,_0x61f54){var _0x177e4e,_0x42530f;return db[_0x33c4('0x4b')][_0x33c4('0x36')]({'where':{'id':_0x59fa4d[_0x33c4('0x58')]['id']},'attributes':['id',_0x33c4('0x37'),_0x33c4('0x29')]})[_0x33c4('0x28')](handleEntityNotFound(_0x61f54,null))[_0x33c4('0x28')](function(_0x3fe5a6){if(_0x3fe5a6){_0x177e4e=_0x3fe5a6;if(!_0x59fa4d['query']['channel']||!utils['isValidChannel'](_0x59fa4d[_0x33c4('0x43')][_0x33c4('0x9f')])){throw new db[(_0x33c4('0x8f'))][(_0x33c4('0x90'))](_0x33c4('0xa2'));}return _0x3fe5a6[_0x33c4('0xb2')+_[_0x33c4('0xa4')](_0x59fa4d[_0x33c4('0x43')][_0x33c4('0x9f')][_0x33c4('0xa5')]())+_0x33c4('0xb3')](_0x59fa4d[_0x33c4('0x43')][_0x33c4('0x63')]);}})[_0x33c4('0x28')](function(_0x37ea90){if(_[_0x33c4('0xb4')](_0x59fa4d['query']['ids'])){for(var _0xd77201=0x0;_0xd77201<_0x59fa4d['query'][_0x33c4('0x63')][_0x33c4('0x4e')];_0xd77201+=0x1){_0x42530f={'UserId':Number(_0x59fa4d['params']['id'])};_0x42530f[_[_0x33c4('0xa4')](_0x59fa4d['query']['channel'][_0x33c4('0xa5')]())+'QueueId']=Number(_0x59fa4d[_0x33c4('0x43')][_0x33c4('0x63')][_0xd77201]);socket[_0x33c4('0xa9')]('user'+_[_0x33c4('0xa4')](_0x59fa4d['query'][_0x33c4('0x9f')][_0x33c4('0xa5')]())+_0x33c4('0xb5'),_0x42530f);}}else{_0x42530f={'UserId':Number(_0x59fa4d['params']['id'])};_0x42530f[_['capitalize'](_0x59fa4d[_0x33c4('0x43')][_0x33c4('0x9f')]['toLowerCase']())+_0x33c4('0xa8')]=Number(_0x59fa4d[_0x33c4('0x43')]['ids']);socket[_0x33c4('0xa9')]('user'+_['capitalize'](_0x59fa4d[_0x33c4('0x43')][_0x33c4('0x9f')][_0x33c4('0xa5')]())+_0x33c4('0xb5'),_0x42530f);}return _0x37ea90;})['then'](function(){if(_0x59fa4d['query'][_0x33c4('0x9f')]===_0x33c4('0xab')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x59fa4d['params']['id'],'VoiceQueueId':_0x59fa4d['query'][_0x33c4('0x63')]},'individualHooks':!![]})[_0x33c4('0x28')](function(){return _0x177e4e;});}return _0x177e4e;})['then'](respondWithStatusCode(_0x61f54,null))['catch'](handleError(_0x61f54,null));};exports[_0x33c4('0xb6')]=function(_0x36570d,_0x32be6c){_0x36570d[_0x33c4('0x60')][_0x33c4('0xb7')]=_0x36570d['file'][_0x33c4('0xb8')];return db[_0x33c4('0x4b')][_0x33c4('0x36')]({'where':{'id':_0x36570d[_0x33c4('0x58')]['id']}})['then'](handleEntityNotFound(_0x32be6c,null))[_0x33c4('0x28')](saveUpdates(_0x36570d[_0x33c4('0x60')],null))[_0x33c4('0x28')](respondWithResult(_0x32be6c,null))[_0x33c4('0x1d')](handleError(_0x32be6c,null));};exports[_0x33c4('0xb9')]=function(_0x5cf7d8,_0x26d697){var _0x1741b6=path[_0x33c4('0xba')](config['root'],_0x33c4('0xbb'));return db[_0x33c4('0x4b')][_0x33c4('0x36')]({'where':{'id':_0x5cf7d8[_0x33c4('0x58')]['id']},'attributes':['id',_0x33c4('0xb7')],'raw':!![]})[_0x33c4('0x28')](handleEntityNotFound(_0x26d697,null))['then'](function(_0x2de02c){if(_0x2de02c){if(_[_0x33c4('0x68')](_0x2de02c[_0x33c4('0xb7')])){return _0x26d697[_0x33c4('0xbc')](_0x1741b6);}else{if(!fs[_0x33c4('0xbd')](path[_0x33c4('0xba')](config['root'],_0x33c4('0xbe'),_0x2de02c['userpic']))){return _0x26d697['download'](_0x1741b6);}return _0x26d697[_0x33c4('0xbc')](path['join'](config['root'],_0x33c4('0xbe'),_0x2de02c[_0x33c4('0xb7')]));}}})[_0x33c4('0x1d')](handleError(_0x26d697,null));};exports[_0x33c4('0xbf')]=function(_0x4f4d89,_0x179922){return db[_0x33c4('0x4b')]['find']({'where':{'id':_0x4f4d89[_0x33c4('0x58')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x179922,null))[_0x33c4('0x28')](function(_0x537c78){var _0x2fa06e=[];values=_0x537c78[_0x33c4('0x52')];_0x2fa06e[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x4f'),_0x537c78[_0x33c4('0x52')]));_0x2fa06e[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x50'),_0x537c78['dataValues']));_0x2fa06e['push'](get_open_tabs(_0x33c4('0x54'),_0x537c78['dataValues']));_0x2fa06e['push'](get_open_tabs(_0x33c4('0x55'),_0x537c78['dataValues']));_0x2fa06e[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x51'),_0x537c78[_0x33c4('0x52')]));_0x2fa06e[_0x33c4('0x4a')](get_open_tabs(_0x33c4('0x53'),_0x537c78[_0x33c4('0x52')]));return Promise['all'](_0x2fa06e);})[_0x33c4('0x28')](function(_0x5428ac){if(_0x5428ac){var _0x550087=_['map'](values[_0x33c4('0xc0')],function(_0x2c9268){return{'channel':_0x33c4('0xc1'),'id':_0x2c9268['id'],'createdAt':_0x2c9268[_0x33c4('0xc2')]};});var _0x2ad346=_[_0x33c4('0x3c')](values[_0x33c4('0xc3')],function(_0x12abab){return{'channel':_0x33c4('0xc4'),'id':_0x12abab['id'],'createdAt':_0x12abab[_0x33c4('0xc2')]};});var _0x2f0d7d=_[_0x33c4('0x3c')](values[_0x33c4('0xc5')],function(_0x24a180){return{'channel':_0x33c4('0xc6'),'id':_0x24a180['id'],'createdAt':_0x24a180[_0x33c4('0xc2')]};});var _0x2b92fe=_[_0x33c4('0x3c')](values[_0x33c4('0xc7')],function(_0x404c65){return{'channel':_0x33c4('0xc8'),'id':_0x404c65['id'],'createdAt':_0x404c65['createdAt']};});var _0x30802d=_[_0x33c4('0x3c')](values[_0x33c4('0xc9')],function(_0x31b115){return{'channel':_0x33c4('0xca'),'id':_0x31b115['id'],'createdAt':_0x31b115['createdAt']};});var _0x279107=_[_0x33c4('0x3c')](values[_0x33c4('0xcb')],function(_0x3d94c0){return{'channel':_0x33c4('0xcc'),'id':_0x3d94c0['id'],'createdAt':_0x3d94c0[_0x33c4('0xc2')]};});var _0x2a9ece=_[_0x33c4('0xcd')](_0x550087,_0x2ad346,_0x2f0d7d,_0x2b92fe,_0x30802d,_0x279107);var _0x25bccd={'count':_0x2a9ece[_0x33c4('0x4e')],'rows':_0x2a9ece};return _0x25bccd;}else return null;})[_0x33c4('0x28')](respondWithResult(_0x179922,null))[_0x33c4('0x1d')](handleError(_0x179922,null));};exports[_0x33c4('0xce')]=function(_0x28d32a,_0x19e8ca){var _0x15933b={};var _0x31ef51={};var _0x4b573b;var _0x46ba28;return db[_0x33c4('0x4b')][_0x33c4('0x97')]({'where':{'id':_0x28d32a['params']['id']}})[_0x33c4('0x28')](handleEntityNotFound(_0x19e8ca,null))[_0x33c4('0x28')](function(_0x35ad13){if(_0x35ad13){_0x4b573b=_0x35ad13;_0x31ef51[_0x33c4('0x5c')]=_['keys'](db['CmContact'][_0x33c4('0x3b')]);_0x31ef51[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0x28d32a[_0x33c4('0x43')]);_0x31ef51[_0x33c4('0xcf')]=_[_0x33c4('0x5b')](_0x31ef51[_0x33c4('0x5c')],_0x31ef51[_0x33c4('0x43')]);_0x15933b[_0x33c4('0x49')]=_['intersection'](_0x31ef51[_0x33c4('0x5c')],qs['fields'](_0x28d32a['query']['fields']));_0x15933b[_0x33c4('0x49')]=_0x15933b[_0x33c4('0x49')][_0x33c4('0x4e')]?_0x15933b[_0x33c4('0x49')]:_0x31ef51[_0x33c4('0x5c')];_0x15933b[_0x33c4('0xd0')]=qs[_0x33c4('0xd1')](_0x28d32a['query']['sort']);_0x15933b['where']=qs[_0x33c4('0xcf')](_[_0x33c4('0xd2')](_0x28d32a[_0x33c4('0x43')],_0x31ef51['filters']));if(_0x28d32a[_0x33c4('0x43')][_0x33c4('0x32')]){_0x15933b[_0x33c4('0x42')]=_['merge'](_0x15933b[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0x15933b[_0x33c4('0x49')],function(_0x30dfdd){var _0x597858={};_0x597858[_0x30dfdd]={'$like':'%'+_0x28d32a[_0x33c4('0x43')]['filter']+'%'};return _0x597858;})});}_0x15933b=_['merge']({},_0x15933b,_0x28d32a[_0x33c4('0xd3')]);return _0x4b573b[_0x33c4('0xce')](_0x15933b);}})[_0x33c4('0x28')](function(_0x52e18e){if(_0x52e18e){_0x46ba28=_0x52e18e['length'];if(_0x28d32a[_0x33c4('0x43')][_0x33c4('0xd4')](_0x33c4('0x44'))){_0x15933b['include']=[{'model':db[_0x33c4('0xd5')],'as':'List','required':![]},{'model':db[_0x33c4('0xd6')],'as':_0x33c4('0xd7'),'attributes':['id',_0x33c4('0x37'),'color'],'where':_0x28d32a[_0x33c4('0x43')][_0x33c4('0xd8')]?{'id':_0x28d32a[_0x33c4('0x43')][_0x33c4('0xd8')]}:undefined,'required':_0x28d32a[_0x33c4('0x43')][_0x33c4('0xd8')]?!![]:![]}];}if(!_0x28d32a[_0x33c4('0x43')]['hasOwnProperty'](_0x33c4('0xd9'))){_0x15933b[_0x33c4('0x22')]=qs[_0x33c4('0x22')](_0x28d32a['query'][_0x33c4('0x22')]);_0x15933b[_0x33c4('0x21')]=qs[_0x33c4('0x21')](_0x28d32a[_0x33c4('0x43')][_0x33c4('0x21')]);}return _0x4b573b[_0x33c4('0xce')](_0x15933b);}})[_0x33c4('0x28')](function(_0x41e40d){if(_0x41e40d){return _0x41e40d?{'count':_0x46ba28,'rows':_0x41e40d}:null;}})['then'](respondWithResult(_0x19e8ca,null))[_0x33c4('0x1d')](handleError(_0x19e8ca,null));};exports[_0x33c4('0xda')]=function(_0x35f938,_0xc0c88a){var _0x4bc5ec;var _0xd33faa={};var _0x5c4c41;return db[_0x33c4('0x4b')][_0x33c4('0x97')]({'where':{'id':_0x35f938[_0x33c4('0x58')]['id']},'attributes':['id',_0x33c4('0x37'),_0x33c4('0x29')]})['then'](handleEntityNotFound(_0xc0c88a,null))['then'](function(_0x17ee66){if(!utils[_0x33c4('0xa1')](_0x35f938[_0x33c4('0x43')][_0x33c4('0x9f')])){throw new db['Sequelize']['ValidationError'](_0x33c4('0xa2'));}_0x4bc5ec=_0x17ee66;var _0x1f28d3={};_0x1f28d3['model']=_[_0x33c4('0x5a')](db[_[_0x33c4('0xa4')](_0x35f938[_0x33c4('0x43')][_0x33c4('0x9f')])+_0x33c4('0xdb')][_0x33c4('0x3b')]);_0x1f28d3[_0x33c4('0x43')]=_['keys'](_0x35f938[_0x33c4('0x43')]);_0x1f28d3['filters']=_[_0x33c4('0x5b')](_0x1f28d3['model'],_0x1f28d3[_0x33c4('0x43')]);_0xd33faa[_0x33c4('0x49')]=_['intersection'](_0x1f28d3[_0x33c4('0x5c')],qs['fields'](_0x35f938[_0x33c4('0x43')][_0x33c4('0x5d')]));_0xd33faa['attributes']=_0xd33faa[_0x33c4('0x49')]['length']?_0xd33faa[_0x33c4('0x49')]:_0x1f28d3[_0x33c4('0x5c')];_0xd33faa[_0x33c4('0xd0')]=qs[_0x33c4('0xd1')](_0x35f938[_0x33c4('0x43')][_0x33c4('0xd1')]);_0xd33faa[_0x33c4('0x42')]=qs['filters'](_[_0x33c4('0xd2')](_0x35f938[_0x33c4('0x43')],_0x1f28d3['filters']));if(_0x35f938[_0x33c4('0x43')][_0x33c4('0x32')]){_0xd33faa['where']=_[_0x33c4('0x5e')](_0xd33faa[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0xd33faa[_0x33c4('0x49')],function(_0x5bcac9){var _0xc0df5b={};_0xc0df5b[_0x5bcac9]={'$like':'%'+_0x35f938[_0x33c4('0x43')]['filter']+'%'};return _0xc0df5b;})});}_0xd33faa=_[_0x33c4('0x5e')]({},_0xd33faa,_0x35f938[_0x33c4('0xd3')]);switch(_0x4bc5ec[_0x33c4('0x29')]){case'admin':return db[_[_0x33c4('0xa4')](_0x35f938[_0x33c4('0x43')][_0x33c4('0x9f')])+_0x33c4('0xdb')][_0x33c4('0x4c')](_0xd33faa);case _0x33c4('0x2e'):case _0x33c4('0x30'):return _0x4bc5ec['get'+_['capitalize'](_0x35f938['query']['channel'])+_0x33c4('0xb3')](_0xd33faa);default:throw new db[(_0x33c4('0x8f'))]['ValidationError'](_0x33c4('0xdc'));}})['then'](function(_0x56eb49){_0x5c4c41=_0x56eb49[_0x33c4('0x4e')];if(!_0x35f938['query'][_0x33c4('0xd4')](_0x33c4('0xd9'))){_0xd33faa['limit']=qs['limit'](_0x35f938[_0x33c4('0x43')][_0x33c4('0x22')]);_0xd33faa[_0x33c4('0x21')]=qs[_0x33c4('0x21')](_0x35f938[_0x33c4('0x43')][_0x33c4('0x21')]);}switch(_0x4bc5ec[_0x33c4('0x29')]){case _0x33c4('0x2c'):return db[_[_0x33c4('0xa4')](_0x35f938['query']['channel'])+_0x33c4('0xdb')][_0x33c4('0x4c')](_0xd33faa);case _0x33c4('0x2e'):case'agent':return _0x4bc5ec[_0x33c4('0x2b')+_[_0x33c4('0xa4')](_0x35f938[_0x33c4('0x43')]['channel'])+'Queues'](_0xd33faa);}})[_0x33c4('0x28')](function(_0x218f5d){return{'count':_0x5c4c41,'rows':_0x218f5d};})[_0x33c4('0x28')](respondWithResult(_0xc0c88a,null))[_0x33c4('0x1d')](handleError(_0xc0c88a,null));};exports[_0x33c4('0xdd')]=function(_0x39a411,_0x52186b){var _0x4cac38={};var _0x4c030d={};var _0x1f13cd;var _0x29aa1d;return db[_0x33c4('0x4b')][_0x33c4('0x97')]({'where':{'id':_0x39a411[_0x33c4('0x58')]['id']}})[_0x33c4('0x28')](handleEntityNotFound(_0x52186b,null))['then'](function(_0x50da27){if(_0x50da27){_0x1f13cd=_0x50da27;_0x4c030d[_0x33c4('0x5c')]=_[_0x33c4('0x5a')](db[_0x33c4('0xb0')][_0x33c4('0x3b')]);_0x4c030d[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0x39a411[_0x33c4('0x43')]);_0x4c030d['filters']=_['intersection'](_0x4c030d[_0x33c4('0x5c')],_0x4c030d[_0x33c4('0x43')]);_0x4cac38[_0x33c4('0x49')]=_[_0x33c4('0x5b')](_0x4c030d[_0x33c4('0x5c')],qs[_0x33c4('0x5d')](_0x39a411['query'][_0x33c4('0x5d')]));_0x4cac38[_0x33c4('0x49')]=_0x4cac38[_0x33c4('0x49')][_0x33c4('0x4e')]?_0x4cac38[_0x33c4('0x49')]:_0x4c030d['model'];_0x4cac38[_0x33c4('0xd0')]=qs[_0x33c4('0xd1')](_0x39a411[_0x33c4('0x43')]['sort']);_0x4cac38[_0x33c4('0x42')]=qs[_0x33c4('0xcf')](_['pick'](_0x39a411['query'],_0x4c030d[_0x33c4('0xcf')]));if(_0x39a411[_0x33c4('0x43')][_0x33c4('0x32')]){_0x4cac38[_0x33c4('0x42')]=_[_0x33c4('0x5e')](_0x4cac38[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0x4cac38[_0x33c4('0x49')],function(_0x17af32){var _0x47868c={};_0x47868c[_0x17af32]={'$like':'%'+_0x39a411[_0x33c4('0x43')][_0x33c4('0x32')]+'%'};return _0x47868c;})});}_0x4cac38=_[_0x33c4('0x5e')]({},_0x4cac38,_0x39a411[_0x33c4('0xd3')]);return _0x1f13cd[_0x33c4('0xdd')](_0x4cac38);}})[_0x33c4('0x28')](function(_0x4f7341){if(_0x4f7341){_0x29aa1d=_0x4f7341[_0x33c4('0x4e')];if(!_0x39a411[_0x33c4('0x43')][_0x33c4('0xd4')](_0x33c4('0xd9'))){_0x4cac38[_0x33c4('0x22')]=qs[_0x33c4('0x22')](_0x39a411[_0x33c4('0x43')][_0x33c4('0x22')]);_0x4cac38['offset']=qs[_0x33c4('0x21')](_0x39a411[_0x33c4('0x43')]['offset']);}return _0x1f13cd[_0x33c4('0xdd')](_0x4cac38);}})[_0x33c4('0x28')](function(_0x12cc24){if(_0x12cc24){return _0x12cc24?{'count':_0x29aa1d,'rows':_0x12cc24}:null;}})['then'](respondWithResult(_0x52186b,null))[_0x33c4('0x1d')](handleError(_0x52186b,null));};exports[_0x33c4('0xde')]=function(_0x34434e,_0x33be25){var _0x56ed4a={};var _0x687375={};var _0x34a21e;var _0x3fa34b;return db['User']['findOne']({'where':{'id':_0x34434e['params']['id']}})[_0x33c4('0x28')](handleEntityNotFound(_0x33be25,null))[_0x33c4('0x28')](function(_0x260f1d){if(_0x260f1d){_0x34a21e=_0x260f1d;_0x687375[_0x33c4('0x5c')]=_['keys'](db['ChatGroup']['rawAttributes']);_0x687375[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0x34434e['query']);_0x687375[_0x33c4('0xcf')]=_['intersection'](_0x687375[_0x33c4('0x5c')],_0x687375['query']);_0x56ed4a[_0x33c4('0x49')]=_[_0x33c4('0x5b')](_0x687375['model'],qs[_0x33c4('0x5d')](_0x34434e[_0x33c4('0x43')][_0x33c4('0x5d')]));_0x56ed4a[_0x33c4('0x49')]=_0x56ed4a['attributes']['length']?_0x56ed4a['attributes']:_0x687375['model'];_0x56ed4a[_0x33c4('0xd0')]=qs['sort'](_0x34434e[_0x33c4('0x43')]['sort']);_0x56ed4a[_0x33c4('0x42')]=qs[_0x33c4('0xcf')](_[_0x33c4('0xd2')](_0x34434e[_0x33c4('0x43')],_0x687375[_0x33c4('0xcf')]));if(_0x34434e[_0x33c4('0x43')][_0x33c4('0x32')]){_0x56ed4a[_0x33c4('0x42')]=_[_0x33c4('0x5e')](_0x56ed4a['where'],{'$or':_[_0x33c4('0x3c')](_0x56ed4a[_0x33c4('0x49')],function(_0x5cd9df){var _0x179bb5={};_0x179bb5[_0x5cd9df]={'$like':'%'+_0x34434e[_0x33c4('0x43')][_0x33c4('0x32')]+'%'};return _0x179bb5;})});}_0x56ed4a=_['merge']({},_0x56ed4a,_0x34434e[_0x33c4('0xd3')]);return _0x34a21e[_0x33c4('0xde')](_0x56ed4a);}})[_0x33c4('0x28')](function(_0x2cbcdb){if(_0x2cbcdb){_0x3fa34b=_0x2cbcdb['length'];if(!_0x34434e['query'][_0x33c4('0xd4')](_0x33c4('0xd9'))){_0x56ed4a[_0x33c4('0x22')]=qs['limit'](_0x34434e[_0x33c4('0x43')][_0x33c4('0x22')]);_0x56ed4a[_0x33c4('0x21')]=qs[_0x33c4('0x21')](_0x34434e[_0x33c4('0x43')][_0x33c4('0x21')]);}return _0x34a21e[_0x33c4('0xde')](_0x56ed4a);}})[_0x33c4('0x28')](function(_0x3ee937){if(_0x3ee937){return _0x3ee937?{'count':_0x3fa34b,'rows':_0x3ee937}:null;}})[_0x33c4('0x28')](respondWithResult(_0x33be25,null))[_0x33c4('0x1d')](handleError(_0x33be25,null));};exports[_0x33c4('0xdf')]=function(_0x381e5c,_0x1204ef){var _0x52bf48={'raw':!![],'where':{}};var _0x2bade2={};var _0xd40a7d={'count':0x0,'rows':[]};return db['User'][_0x33c4('0x97')]({'where':{'id':_0x381e5c[_0x33c4('0x58')]['id']}})['then'](handleEntityNotFound(_0x1204ef,null))[_0x33c4('0x28')](function(_0x1bfb51){if(_0x1bfb51){_0x2bade2[_0x33c4('0x5c')]=_[_0x33c4('0x5a')](db['VoiceRecording']['rawAttributes']);_0x2bade2['query']=_['keys'](_0x381e5c[_0x33c4('0x43')]);_0x2bade2[_0x33c4('0xcf')]=_[_0x33c4('0x5b')](_0x2bade2[_0x33c4('0x5c')],_0x2bade2[_0x33c4('0x43')]);_0x52bf48[_0x33c4('0x49')]=_[_0x33c4('0x5b')](_0x2bade2[_0x33c4('0x5c')],qs[_0x33c4('0x5d')](_0x381e5c[_0x33c4('0x43')][_0x33c4('0x5d')]));_0x52bf48[_0x33c4('0x49')]=_0x52bf48[_0x33c4('0x49')][_0x33c4('0x4e')]?_0x52bf48[_0x33c4('0x49')]:_0x2bade2[_0x33c4('0x5c')];if(!_0x381e5c[_0x33c4('0x43')][_0x33c4('0xd4')](_0x33c4('0xd9'))){_0x52bf48[_0x33c4('0x22')]=qs[_0x33c4('0x22')](_0x381e5c['query'][_0x33c4('0x22')]);_0x52bf48[_0x33c4('0x21')]=qs[_0x33c4('0x21')](_0x381e5c['query'][_0x33c4('0x21')]);}_0x52bf48[_0x33c4('0xd0')]=qs['sort'](_0x381e5c[_0x33c4('0x43')]['sort']);_0x52bf48['where']=qs[_0x33c4('0xcf')](_[_0x33c4('0xd2')](_0x381e5c['query'],_0x2bade2['filters']));_0x52bf48[_0x33c4('0x42')][_0x33c4('0xe0')]=_0x1bfb51['id'];if(_0x381e5c[_0x33c4('0x43')][_0x33c4('0x32')]){_0x52bf48['where']=_[_0x33c4('0x5e')](_0x52bf48[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0x52bf48[_0x33c4('0x49')],function(_0x53d535){var _0x279460={};_0x279460[_0x53d535]={'$like':'%'+_0x381e5c[_0x33c4('0x43')][_0x33c4('0x32')]+'%'};return _0x279460;})});}_0x52bf48=_['merge']({},_0x52bf48,_0x381e5c[_0x33c4('0xd3')]);return db[_0x33c4('0xe1')]['count']({'where':_0x52bf48[_0x33c4('0x42')]})[_0x33c4('0x28')](function(_0xa3ce47){_0xd40a7d[_0x33c4('0x24')]=_0xa3ce47;if(_0x381e5c[_0x33c4('0x43')][_0x33c4('0x44')]){_0x52bf48[_0x33c4('0x45')]=[{'all':!![]}];}return db[_0x33c4('0xe1')][_0x33c4('0x4c')](_0x52bf48);})[_0x33c4('0x28')](function(_0x294280){_0xd40a7d['rows']=_0x294280;return _0xd40a7d;});}})[_0x33c4('0x28')](respondWithFilteredResult(_0x1204ef,_0x52bf48))[_0x33c4('0x1d')](handleError(_0x1204ef,null));};exports['getScreenRecordings']=function(_0x556c37,_0x5f4a3b){var _0x294f24={'raw':!![],'where':{}};var _0xf9dbdc={};var _0x1b66ce={'count':0x0,'rows':[]};return db['User'][_0x33c4('0x97')]({'where':{'id':_0x556c37['params']['id']}})[_0x33c4('0x28')](handleEntityNotFound(_0x5f4a3b,null))[_0x33c4('0x28')](function(_0x3437ac){if(_0x3437ac){_0xf9dbdc[_0x33c4('0x5c')]=_['keys'](db[_0x33c4('0xe2')][_0x33c4('0x3b')]);_0xf9dbdc['query']=_[_0x33c4('0x5a')](_0x556c37['query']);_0xf9dbdc[_0x33c4('0xcf')]=_[_0x33c4('0x5b')](_0xf9dbdc[_0x33c4('0x5c')],_0xf9dbdc[_0x33c4('0x43')]);_0x294f24['attributes']=_[_0x33c4('0x5b')](_0xf9dbdc[_0x33c4('0x5c')],qs[_0x33c4('0x5d')](_0x556c37[_0x33c4('0x43')]['fields']));_0x294f24[_0x33c4('0x49')]=_0x294f24[_0x33c4('0x49')][_0x33c4('0x4e')]?_0x294f24[_0x33c4('0x49')]:_0xf9dbdc['model'];if(!_0x556c37['query'][_0x33c4('0xd4')](_0x33c4('0xd9'))){_0x294f24[_0x33c4('0x22')]=qs['limit'](_0x556c37[_0x33c4('0x43')][_0x33c4('0x22')]);_0x294f24[_0x33c4('0x21')]=qs[_0x33c4('0x21')](_0x556c37[_0x33c4('0x43')]['offset']);}_0x294f24['order']=qs[_0x33c4('0xd1')](_0x556c37[_0x33c4('0x43')][_0x33c4('0xd1')]);_0x294f24[_0x33c4('0x42')]=qs[_0x33c4('0xcf')](_[_0x33c4('0xd2')](_0x556c37[_0x33c4('0x43')],_0xf9dbdc[_0x33c4('0xcf')]));_0x294f24[_0x33c4('0x42')]['UserId']=_0x3437ac['id'];if(_0x556c37[_0x33c4('0x43')]['filter']){_0x294f24[_0x33c4('0x42')]=_[_0x33c4('0x5e')](_0x294f24['where'],{'$or':_[_0x33c4('0x3c')](_0x294f24['attributes'],function(_0x27e224){var _0x22e8df={};_0x22e8df[_0x27e224]={'$like':'%'+_0x556c37[_0x33c4('0x43')]['filter']+'%'};return _0x22e8df;})});}_0x294f24=_[_0x33c4('0x5e')]({},_0x294f24,_0x556c37[_0x33c4('0xd3')]);return db[_0x33c4('0xe2')][_0x33c4('0x24')]({'where':_0x294f24[_0x33c4('0x42')]})[_0x33c4('0x28')](function(_0xac4d0b){_0x1b66ce[_0x33c4('0x24')]=_0xac4d0b;if(_0x556c37[_0x33c4('0x43')]['includeAll']){_0x294f24[_0x33c4('0x45')]=[{'all':!![]}];}return db['ScreenRecording'][_0x33c4('0x4c')](_0x294f24);})[_0x33c4('0x28')](function(_0x503655){_0x1b66ce['rows']=_0x503655;return _0x1b66ce;});}})[_0x33c4('0x28')](respondWithFilteredResult(_0x5f4a3b,_0x294f24))['catch'](handleError(_0x5f4a3b,null));};exports['getChatInteractions']=function(_0xc431c7,_0x1689ff){var _0x1caeec={};var _0x2144f7={};var _0x1db663;var _0x2faf6e;return db[_0x33c4('0x4b')][_0x33c4('0x97')]({'where':{'id':_0xc431c7[_0x33c4('0x58')]['id']}})[_0x33c4('0x28')](handleEntityNotFound(_0x1689ff,null))[_0x33c4('0x28')](function(_0x3bf950){if(_0x3bf950){_0x1db663=_0x3bf950;_0x2144f7[_0x33c4('0x5c')]=_[_0x33c4('0x5a')](db[_0x33c4('0xe3')][_0x33c4('0x3b')]);_0x2144f7[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0xc431c7[_0x33c4('0x43')]);_0x2144f7['filters']=_[_0x33c4('0x5b')](_0x2144f7[_0x33c4('0x5c')],_0x2144f7[_0x33c4('0x43')]);_0x1caeec[_0x33c4('0x49')]=_[_0x33c4('0x5b')](_0x2144f7[_0x33c4('0x5c')],qs[_0x33c4('0x5d')](_0xc431c7[_0x33c4('0x43')]['fields']));_0x1caeec[_0x33c4('0x49')]=_0x1caeec[_0x33c4('0x49')][_0x33c4('0x4e')]?_0x1caeec[_0x33c4('0x49')]:_0x2144f7['model'];_0x1caeec[_0x33c4('0xd0')]=qs['sort'](_0xc431c7['query'][_0x33c4('0xd1')]);_0x1caeec[_0x33c4('0x42')]=qs[_0x33c4('0xcf')](_[_0x33c4('0xd2')](_0xc431c7[_0x33c4('0x43')],_0x2144f7[_0x33c4('0xcf')]));if(_0xc431c7[_0x33c4('0x43')]['filter']){_0x1caeec['where']=_[_0x33c4('0x5e')](_0x1caeec[_0x33c4('0x42')],{'$or':_['map'](_0x1caeec['attributes'],function(_0x327fa5){var _0x2e108e={};_0x2e108e[_0x327fa5]={'$like':'%'+_0xc431c7[_0x33c4('0x43')][_0x33c4('0x32')]+'%'};return _0x2e108e;})});}_0x1caeec=_[_0x33c4('0x5e')]({},_0x1caeec,_0xc431c7[_0x33c4('0xd3')]);return _0x1db663[_0x33c4('0xe4')](_0x1caeec);}})[_0x33c4('0x28')](function(_0x4dbd49){if(_0x4dbd49){_0x2faf6e=_0x4dbd49[_0x33c4('0x4e')];if(!_0xc431c7['query'][_0x33c4('0xd4')](_0x33c4('0xd9'))){_0x1caeec['limit']=qs[_0x33c4('0x22')](_0xc431c7[_0x33c4('0x43')][_0x33c4('0x22')]);_0x1caeec['offset']=qs[_0x33c4('0x21')](_0xc431c7[_0x33c4('0x43')]['offset']);}return _0x1db663[_0x33c4('0xe4')](_0x1caeec);}})[_0x33c4('0x28')](function(_0xfa1e28){if(_0xfa1e28){return _0xfa1e28?{'count':_0x2faf6e,'rows':_0xfa1e28}:null;}})['then'](respondWithResult(_0x1689ff,null))[_0x33c4('0x1d')](handleError(_0x1689ff,null));};exports[_0x33c4('0xe5')]=function(_0x1d0e6a,_0x1ee188){var _0x141e10={};var _0x4fdcc3={};var _0x4007f1;var _0x5901b6;return db[_0x33c4('0x4b')][_0x33c4('0x97')]({'where':{'id':_0x1d0e6a['params']['id']}})[_0x33c4('0x28')](handleEntityNotFound(_0x1ee188,null))['then'](function(_0x4466d5){if(_0x4466d5){_0x4007f1=_0x4466d5;_0x4fdcc3[_0x33c4('0x5c')]=_[_0x33c4('0x5a')](db['OpenchannelInteraction'][_0x33c4('0x3b')]);_0x4fdcc3[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0x1d0e6a[_0x33c4('0x43')]);_0x4fdcc3[_0x33c4('0xcf')]=_[_0x33c4('0x5b')](_0x4fdcc3[_0x33c4('0x5c')],_0x4fdcc3[_0x33c4('0x43')]);_0x141e10[_0x33c4('0x49')]=_[_0x33c4('0x5b')](_0x4fdcc3['model'],qs['fields'](_0x1d0e6a[_0x33c4('0x43')][_0x33c4('0x5d')]));_0x141e10[_0x33c4('0x49')]=_0x141e10['attributes'][_0x33c4('0x4e')]?_0x141e10[_0x33c4('0x49')]:_0x4fdcc3[_0x33c4('0x5c')];_0x141e10[_0x33c4('0xd0')]=qs[_0x33c4('0xd1')](_0x1d0e6a[_0x33c4('0x43')][_0x33c4('0xd1')]);_0x141e10['where']=qs[_0x33c4('0xcf')](_[_0x33c4('0xd2')](_0x1d0e6a['query'],_0x4fdcc3[_0x33c4('0xcf')]));if(_0x1d0e6a[_0x33c4('0x43')][_0x33c4('0x32')]){_0x141e10[_0x33c4('0x42')]=_[_0x33c4('0x5e')](_0x141e10[_0x33c4('0x42')],{'$or':_['map'](_0x141e10['attributes'],function(_0xd284b8){var _0x3be0d3={};_0x3be0d3[_0xd284b8]={'$like':'%'+_0x1d0e6a[_0x33c4('0x43')][_0x33c4('0x32')]+'%'};return _0x3be0d3;})});}_0x141e10=_[_0x33c4('0x5e')]({},_0x141e10,_0x1d0e6a[_0x33c4('0xd3')]);return _0x4007f1['getOpenchannelInteractions'](_0x141e10);}})['then'](function(_0x349be2){if(_0x349be2){_0x5901b6=_0x349be2[_0x33c4('0x4e')];if(!_0x1d0e6a[_0x33c4('0x43')][_0x33c4('0xd4')](_0x33c4('0xd9'))){_0x141e10[_0x33c4('0x22')]=qs[_0x33c4('0x22')](_0x1d0e6a['query'][_0x33c4('0x22')]);_0x141e10['offset']=qs[_0x33c4('0x21')](_0x1d0e6a['query'][_0x33c4('0x21')]);}return _0x4007f1['getOpenchannelInteractions'](_0x141e10);}})[_0x33c4('0x28')](function(_0x38e1eb){if(_0x38e1eb){return _0x38e1eb?{'count':_0x5901b6,'rows':_0x38e1eb}:null;}})['then'](respondWithResult(_0x1ee188,null))['catch'](handleError(_0x1ee188,null));};exports[_0x33c4('0xe6')]=function(_0x2f49a0,_0x58b9ca){var _0x140ade={'raw':!![],'where':{}};var _0x1e12b0={};var _0x33641f={'count':0x0,'rows':[]};return db[_0x33c4('0x4b')][_0x33c4('0x97')]({'where':{'id':_0x2f49a0[_0x33c4('0x58')]['id']}})['then'](handleEntityNotFound(_0x58b9ca,null))[_0x33c4('0x28')](function(_0x3eba12){if(_0x3eba12){_0x1e12b0[_0x33c4('0x5c')]=_[_0x33c4('0x5a')](db['MailInteraction'][_0x33c4('0x3b')]);_0x1e12b0[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0x2f49a0[_0x33c4('0x43')]);_0x1e12b0[_0x33c4('0xcf')]=_[_0x33c4('0x5b')](_0x1e12b0[_0x33c4('0x5c')],_0x1e12b0[_0x33c4('0x43')]);_0x140ade['attributes']=_[_0x33c4('0x5b')](_0x1e12b0['model'],qs[_0x33c4('0x5d')](_0x2f49a0['query'][_0x33c4('0x5d')]));_0x140ade[_0x33c4('0x49')]=_0x140ade[_0x33c4('0x49')][_0x33c4('0x4e')]?_0x140ade[_0x33c4('0x49')]:_0x1e12b0[_0x33c4('0x5c')];if(!_0x2f49a0[_0x33c4('0x43')][_0x33c4('0xd4')]('nolimit')){_0x140ade['limit']=qs[_0x33c4('0x22')](_0x2f49a0[_0x33c4('0x43')][_0x33c4('0x22')]);_0x140ade[_0x33c4('0x21')]=qs[_0x33c4('0x21')](_0x2f49a0[_0x33c4('0x43')]['offset']);}_0x140ade['order']=qs[_0x33c4('0xd1')](_0x2f49a0[_0x33c4('0x43')][_0x33c4('0xd1')]);_0x140ade[_0x33c4('0x42')]=qs['filters'](_['pick'](_0x2f49a0[_0x33c4('0x43')],_0x1e12b0[_0x33c4('0xcf')]));_0x140ade['where'][_0x33c4('0xe0')]=_0x3eba12['id'];if(_0x2f49a0['query'][_0x33c4('0x32')]){_0x140ade['where']=_[_0x33c4('0x5e')](_0x140ade[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0x140ade[_0x33c4('0x49')],function(_0x566ad0){var _0x4154dd={};_0x4154dd[_0x566ad0]={'$like':'%'+_0x2f49a0['query'][_0x33c4('0x32')]+'%'};return _0x4154dd;})});}_0x140ade=_[_0x33c4('0x5e')]({},_0x140ade,_0x2f49a0['options']);return db[_0x33c4('0xe7')][_0x33c4('0x24')]({'where':_0x140ade['where']})[_0x33c4('0x28')](function(_0x103464){_0x33641f[_0x33c4('0x24')]=_0x103464;if(_0x2f49a0[_0x33c4('0x43')]['includeAll']){_0x140ade[_0x33c4('0x45')]=[{'all':!![]}];}return db[_0x33c4('0xe7')][_0x33c4('0x4c')](_0x140ade);})[_0x33c4('0x28')](function(_0x3eac30){_0x33641f[_0x33c4('0x4d')]=_0x3eac30;return _0x33641f;});}})['then'](respondWithFilteredResult(_0x58b9ca,_0x140ade))['catch'](handleError(_0x58b9ca,null));};exports[_0x33c4('0xe8')]=function(_0x521994,_0x39ac12){var _0x330e42={};var _0x40d13b={};var _0x1c8325;var _0x42875a;return db['User']['findOne']({'where':{'id':_0x521994[_0x33c4('0x58')]['id']}})[_0x33c4('0x28')](handleEntityNotFound(_0x39ac12,null))[_0x33c4('0x28')](function(_0x22b7a1){if(_0x22b7a1){_0x1c8325=_0x22b7a1;_0x40d13b['model']=_[_0x33c4('0x5a')](db[_0x33c4('0xe9')][_0x33c4('0x3b')]);_0x40d13b[_0x33c4('0x43')]=_['keys'](_0x521994[_0x33c4('0x43')]);_0x40d13b[_0x33c4('0xcf')]=_[_0x33c4('0x5b')](_0x40d13b[_0x33c4('0x5c')],_0x40d13b[_0x33c4('0x43')]);_0x330e42[_0x33c4('0x49')]=_[_0x33c4('0x5b')](_0x40d13b[_0x33c4('0x5c')],qs[_0x33c4('0x5d')](_0x521994[_0x33c4('0x43')][_0x33c4('0x5d')]));_0x330e42[_0x33c4('0x49')]=_0x330e42[_0x33c4('0x49')][_0x33c4('0x4e')]?_0x330e42['attributes']:_0x40d13b[_0x33c4('0x5c')];_0x330e42[_0x33c4('0xd0')]=qs[_0x33c4('0xd1')](_0x521994[_0x33c4('0x43')][_0x33c4('0xd1')]);_0x330e42[_0x33c4('0x42')]=qs['filters'](_[_0x33c4('0xd2')](_0x521994['query'],_0x40d13b['filters']));if(_0x521994[_0x33c4('0x43')][_0x33c4('0x32')]){_0x330e42[_0x33c4('0x42')]=_['merge'](_0x330e42[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0x330e42['attributes'],function(_0x39ce23){var _0x54bcda={};_0x54bcda[_0x39ce23]={'$like':'%'+_0x521994['query'][_0x33c4('0x32')]+'%'};return _0x54bcda;})});}_0x330e42=_[_0x33c4('0x5e')]({},_0x330e42,_0x521994['options']);return _0x1c8325[_0x33c4('0xe8')](_0x330e42);}})[_0x33c4('0x28')](function(_0x26aee8){if(_0x26aee8){_0x42875a=_0x26aee8[_0x33c4('0x4e')];if(!_0x521994[_0x33c4('0x43')][_0x33c4('0xd4')](_0x33c4('0xd9'))){_0x330e42[_0x33c4('0x22')]=qs['limit'](_0x521994[_0x33c4('0x43')][_0x33c4('0x22')]);_0x330e42[_0x33c4('0x21')]=qs['offset'](_0x521994[_0x33c4('0x43')][_0x33c4('0x21')]);}return _0x1c8325['getSmsInteractions'](_0x330e42);}})[_0x33c4('0x28')](function(_0x1a6430){if(_0x1a6430){return _0x1a6430?{'count':_0x42875a,'rows':_0x1a6430}:null;}})[_0x33c4('0x28')](respondWithResult(_0x39ac12,null))['catch'](handleError(_0x39ac12,null));};exports[_0x33c4('0xea')]=function(_0x4880bf,_0x43c2bd){var _0x5312f3={};var _0xd2aa7c={};var _0x3e5a61;var _0x1d2f76;return db[_0x33c4('0x4b')]['findOne']({'where':{'id':_0x4880bf[_0x33c4('0x58')]['id']}})['then'](handleEntityNotFound(_0x43c2bd,null))['then'](function(_0x3da996){if(_0x3da996){_0x3e5a61=_0x3da996;_0xd2aa7c[_0x33c4('0x5c')]=_[_0x33c4('0x5a')](db[_0x33c4('0xeb')][_0x33c4('0x3b')]);_0xd2aa7c[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0x4880bf[_0x33c4('0x43')]);_0xd2aa7c[_0x33c4('0xcf')]=_[_0x33c4('0x5b')](_0xd2aa7c[_0x33c4('0x5c')],_0xd2aa7c['query']);_0x5312f3[_0x33c4('0x49')]=_[_0x33c4('0x5b')](_0xd2aa7c[_0x33c4('0x5c')],qs[_0x33c4('0x5d')](_0x4880bf['query'][_0x33c4('0x5d')]));_0x5312f3[_0x33c4('0x49')]=_0x5312f3['attributes']['length']?_0x5312f3[_0x33c4('0x49')]:_0xd2aa7c['model'];_0x5312f3[_0x33c4('0xd0')]=qs[_0x33c4('0xd1')](_0x4880bf[_0x33c4('0x43')][_0x33c4('0xd1')]);_0x5312f3[_0x33c4('0x42')]=qs['filters'](_[_0x33c4('0xd2')](_0x4880bf[_0x33c4('0x43')],_0xd2aa7c[_0x33c4('0xcf')]));if(_0x4880bf['query']['filter']){_0x5312f3['where']=_[_0x33c4('0x5e')](_0x5312f3[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0x5312f3['attributes'],function(_0x2dc89b){var _0x263d89={};_0x263d89[_0x2dc89b]={'$like':'%'+_0x4880bf['query']['filter']+'%'};return _0x263d89;})});}_0x5312f3=_[_0x33c4('0x5e')]({},_0x5312f3,_0x4880bf[_0x33c4('0xd3')]);return _0x3e5a61[_0x33c4('0xea')](_0x5312f3);}})['then'](function(_0xbae636){if(_0xbae636){_0x1d2f76=_0xbae636[_0x33c4('0x4e')];if(!_0x4880bf[_0x33c4('0x43')]['hasOwnProperty']('nolimit')){_0x5312f3[_0x33c4('0x22')]=qs['limit'](_0x4880bf['query']['limit']);_0x5312f3['offset']=qs['offset'](_0x4880bf['query']['offset']);}return _0x3e5a61[_0x33c4('0xea')](_0x5312f3);}})['then'](function(_0x48bdd4){if(_0x48bdd4){return _0x48bdd4?{'count':_0x1d2f76,'rows':_0x48bdd4}:null;}})['then'](respondWithResult(_0x43c2bd,null))['catch'](handleError(_0x43c2bd,null));};exports[_0x33c4('0xec')]=function(_0x46b060,_0x47cc5a){var _0x19f494={};var _0x2907a4={};var _0x648207;var _0x57c4f7;return db[_0x33c4('0x4b')][_0x33c4('0x97')]({'where':{'id':_0x46b060['params']['id']}})['then'](handleEntityNotFound(_0x47cc5a,null))[_0x33c4('0x28')](function(_0x5753ec){if(_0x5753ec){_0x648207=_0x5753ec;_0x2907a4[_0x33c4('0x5c')]=_[_0x33c4('0x5a')](db[_0x33c4('0xed')]['rawAttributes']);_0x2907a4[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0x46b060[_0x33c4('0x43')]);_0x2907a4[_0x33c4('0xcf')]=_[_0x33c4('0x5b')](_0x2907a4[_0x33c4('0x5c')],_0x2907a4[_0x33c4('0x43')]);_0x19f494[_0x33c4('0x49')]=_['intersection'](_0x2907a4['model'],qs[_0x33c4('0x5d')](_0x46b060[_0x33c4('0x43')][_0x33c4('0x5d')]));_0x19f494[_0x33c4('0x49')]=_0x19f494['attributes'][_0x33c4('0x4e')]?_0x19f494[_0x33c4('0x49')]:_0x2907a4['model'];_0x19f494[_0x33c4('0xd0')]=qs[_0x33c4('0xd1')](_0x46b060[_0x33c4('0x43')][_0x33c4('0xd1')]);_0x19f494[_0x33c4('0x42')]=qs[_0x33c4('0xcf')](_[_0x33c4('0xd2')](_0x46b060['query'],_0x2907a4['filters']));if(_0x46b060[_0x33c4('0x43')][_0x33c4('0x32')]){_0x19f494[_0x33c4('0x42')]=_[_0x33c4('0x5e')](_0x19f494[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0x19f494[_0x33c4('0x49')],function(_0x385976){var _0x51f837={};_0x51f837[_0x385976]={'$like':'%'+_0x46b060[_0x33c4('0x43')][_0x33c4('0x32')]+'%'};return _0x51f837;})});}_0x19f494=_[_0x33c4('0x5e')]({},_0x19f494,_0x46b060[_0x33c4('0xd3')]);return _0x648207['getWhatsappInteractions'](_0x19f494);}})[_0x33c4('0x28')](function(_0x23eb20){if(_0x23eb20){_0x57c4f7=_0x23eb20[_0x33c4('0x4e')];if(!_0x46b060['query'][_0x33c4('0xd4')](_0x33c4('0xd9'))){_0x19f494['limit']=qs[_0x33c4('0x22')](_0x46b060[_0x33c4('0x43')][_0x33c4('0x22')]);_0x19f494[_0x33c4('0x21')]=qs['offset'](_0x46b060[_0x33c4('0x43')][_0x33c4('0x21')]);}return _0x648207['getWhatsappInteractions'](_0x19f494);}})['then'](function(_0x3c78fc){if(_0x3c78fc){return _0x3c78fc?{'count':_0x57c4f7,'rows':_0x3c78fc}:null;}})[_0x33c4('0x28')](respondWithResult(_0x47cc5a,null))[_0x33c4('0x1d')](handleError(_0x47cc5a,null));};exports[_0x33c4('0xee')]=function(_0x2ecbea,_0x45da69,_0x231845){var _0x551154;var _0x30e61b;var _0x1b2e4f;var _0x59e1ff=!_[_0x33c4('0x68')](_0x2ecbea[_0x33c4('0x58')]['id'])?_0x2ecbea[_0x33c4('0x58')]['id']:!_['isNil'](_0x2ecbea[_0x33c4('0x2e')]['id'])?_0x2ecbea[_0x33c4('0x2e')]['id']:null;return db[_0x33c4('0x4b')][_0x33c4('0x36')]({'where':{'id':_0x59e1ff,'role':{'$or':['admin',_0x33c4('0x2e'),'agent']}},'attributes':['id',_0x33c4('0x37'),_0x33c4('0xef'),_0x33c4('0xf0'),_0x33c4('0x29'),_0x33c4('0x64'),'loginInPause']})[_0x33c4('0x28')](function(_0x190c46){if(_0x190c46){if(_0x190c46[_0x33c4('0x29')]===_0x33c4('0x30')){_0x551154=_0x190c46;if(_0x2ecbea[_0x33c4('0x60')][_0x33c4('0xa0')]){_0x1b2e4f=util[_0x33c4('0xae')](_0x33c4('0xf1'),_0x551154[_0x2ecbea['body'][_0x33c4('0xa0')]]);}else if(_0x2ecbea[_0x33c4('0x60')][_0x33c4('0xf2')]){_0x1b2e4f=util[_0x33c4('0xae')]('SIP/%s',_0x2ecbea[_0x33c4('0x60')]['intrf']);}else{_0x1b2e4f=util[_0x33c4('0xae')](_0x33c4('0xf3'),_0x551154[_0x33c4('0x37')]);}socket['to'](util['format'](_0x33c4('0xf4'),_0x551154[_0x33c4('0x37')]))[_0x33c4('0xa9')](_0x33c4('0xf5'),{'user':{'id':_0x551154['id'],'name':_0x551154[_0x33c4('0x37')]},'ip':_0x2ecbea[_0x33c4('0xf6')]['x-forwarded-for']||_0x2ecbea[_0x33c4('0xf7')]['remoteAddress']||_0x2ecbea[_0x33c4('0xf8')]['remoteAddress']||_0x2ecbea['connection']['socket'][_0x33c4('0xf9')]});return db[_0x33c4('0xb0')][_0x33c4('0x2a')]({'where':{'membername':_0x551154[_0x33c4('0x37')]},'individualHooks':!![]});}}else{throw new db[(_0x33c4('0x8f'))][(_0x33c4('0x90'))](_0x33c4('0xfa'));}})[_0x33c4('0x28')](function(){if(_0x551154){return _0x551154[_0x33c4('0xfb')]({'raw':!![]});}})[_0x33c4('0x28')](function(_0x11fb19){if(_0x551154){if(_0x11fb19){_0x30e61b=_0x11fb19;if(_0x30e61b[_0x33c4('0x4e')]){var _0x152677=_0x30e61b[_0x33c4('0x3c')](function(_0x8b6c0f){var _0x3bc172={'membername':_0x551154[_0x33c4('0x37')],'UserId':_0x551154['id'],'queue_name':_0x8b6c0f[_0x33c4('0x37')],'VoiceQueueId':_0x8b6c0f['id'],'interface':_0x1b2e4f,'paused':_0x551154[_0x33c4('0xfc')]||![],'penalty':_0x8b6c0f[_0x33c4('0xfd')]||0x0};return db[_0x33c4('0xb0')][_0x33c4('0xb1')](_0x3bc172);});return Promise[_0x33c4('0x56')](_0x152677);}}}})['then'](function(){if(_0x551154){return db[_0x33c4('0xfe')][_0x33c4('0x4c')]({'where':{'membername':_0x551154['name'],'exitAt':null}});}})[_0x33c4('0x28')](function(_0x32f9ed){if(_0x551154){var _0x1ea582=[];_0x32f9ed[_0x33c4('0xff')](function(_0x265976){_0x1ea582[_0x33c4('0x4a')](_0x265976[_0x33c4('0x27')]({'exitAt':moment()[_0x33c4('0xae')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise['all'](_0x1ea582);}})[_0x33c4('0x28')](function(){if(_0x551154){var _0x1a6915=[];var _0x396a60=[];var _0x1929c6=utils[_0x33c4('0x100')]();var _0x26a808={'membername':_0x551154['name'],'interface':_0x1b2e4f,'enterAt':moment()['format'](_0x33c4('0x101')),'role':_0x551154[_0x33c4('0x29')],'internal':_0x551154[_0x33c4('0x64')]};_0x1929c6['forEach'](function(_0x81085){_0x1a6915[_0x33c4('0x4a')](_[_0x33c4('0x5e')]({'channel':_0x81085,'type':_0x33c4('0x102'),'data1':_0x2ecbea['body'][_0x33c4('0x103')],'data2':_0x1b2e4f},_0x26a808));if(_0x551154['loginInPause']){_0x396a60['push'](_['merge']({'channel':_0x81085,'type':_0x33c4('0x104'),'data1':_0x33c4('0x105')},_0x26a808));}});return db[_0x33c4('0xfe')][_0x33c4('0x106')](_0x1a6915[_0x33c4('0xcd')](_0x396a60),{'individualHooks':!![]});}})[_0x33c4('0x28')](function(){if(_0x551154){return _0x551154['update']({'online':!![],'lastLoginAt':moment()['format'](_0x33c4('0x101')),'voicePause':_0x551154['loginInPause']||![],'mailPause':_0x551154[_0x33c4('0xfc')]||![],'chatPause':_0x551154[_0x33c4('0xfc')]||![],'faxPause':_0x551154[_0x33c4('0xfc')]||![],'smsPause':_0x551154[_0x33c4('0xfc')]||![],'openchannelPause':_0x551154[_0x33c4('0xfc')]||![],'whatsappPause':_0x551154[_0x33c4('0xfc')]||![],'pauseType':_0x551154[_0x33c4('0xfc')]?_0x33c4('0x105'):null,'interface':_0x1b2e4f,'lastPauseAt':moment()[_0x33c4('0xae')](_0x33c4('0x101'))});}})[_0x33c4('0x28')](function(_0x3a0a3d){if(_0x2ecbea[_0x33c4('0x107')]){return _0x231845();}else{return Promise[_0x33c4('0x108')](_0x3a0a3d)[_0x33c4('0x28')](respondWithResult(_0x45da69,null));}})['catch'](handleError(_0x45da69,null));};exports[_0x33c4('0x109')]=function(_0x1a67c1,_0x25eab3){var _0x2f725e;return db['User'][_0x33c4('0x36')]({'where':{'id':_0x1a67c1[_0x33c4('0x58')]['id'],'role':_0x33c4('0x30')},'attributes':['id',_0x33c4('0x37'),'role']})[_0x33c4('0x28')](handleEntityNotFound(_0x25eab3,null))['then'](function(_0x505bfd){if(_0x505bfd){_0x2f725e=_0x505bfd;return db[_0x33c4('0xb0')][_0x33c4('0x2a')]({'where':{'membername':_0x2f725e[_0x33c4('0x37')]},'individualHooks':!![]});}})[_0x33c4('0x28')](function(){return db[_0x33c4('0xfe')][_0x33c4('0x4c')]({'where':{'membername':_0x2f725e['name'],'exitAt':null}});})[_0x33c4('0x28')](function(_0x5353e9){var _0x4012ab=[];_0x5353e9[_0x33c4('0xff')](function(_0x3493e7){_0x4012ab[_0x33c4('0x4a')](_0x3493e7[_0x33c4('0x27')]({'exitAt':moment()['format'](_0x33c4('0x101'))}));});return Promise[_0x33c4('0x56')](_0x4012ab);})[_0x33c4('0x28')](function(){return _0x2f725e['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x33c4('0x28')](respondWithResult(_0x25eab3,null))[_0x33c4('0x1d')](handleError(_0x25eab3,null));};exports[_0x33c4('0x10a')]=function(_0x1ef24b,_0x16ed31){var _0x4d6f7d;return db[_0x33c4('0xb0')][_0x33c4('0x27')]({'paused':0x1},{'where':{'UserId':_0x1ef24b[_0x33c4('0x58')]['id']},'individualHooks':!![]})['then'](function(){return db['User'][_0x33c4('0x36')]({'where':{'id':_0x1ef24b[_0x33c4('0x58')]['id'],'role':_0x33c4('0x30')},'attributes':['id',_0x33c4('0x37'),'role',_0x33c4('0x64'),_0x33c4('0xa0'),_0x33c4('0xad')]});})[_0x33c4('0x28')](handleEntityNotFound(_0x16ed31,null))['then'](function(_0x2fee07){if(_0x2fee07){_0x4d6f7d=_0x2fee07;return respondWithRpcPromise(_0x33c4('0x10b'),_0x33c4('0x10a'),{'id':_0x4d6f7d['id'],'name':_0x4d6f7d[_0x33c4('0x37')],'pause':!![]});}})['then'](function(){if(_0x4d6f7d){return db[_0x33c4('0xfe')][_0x33c4('0x4c')]({'where':{'membername':_0x4d6f7d['name'],'type':_0x33c4('0x104'),'exitAt':null}});}})['then'](function(_0x1b9915){if(_0x1b9915[_0x33c4('0x4e')]){var _0xf0c773=moment()[_0x33c4('0xae')](_0x33c4('0x101'));for(var _0xfd9f66=0x0,_0x5bca5f=_0x1b9915['length'];_0xfd9f66<_0x5bca5f;_0xfd9f66++){_0x1b9915[_0xfd9f66][_0x33c4('0x10c')]({'exitAt':_0xf0c773});}}})['then'](function(){var _0x34df7c=[];var _0x231d56=utils['getChannels']();_0x231d56[_0x33c4('0xff')](function(_0x5b9cda){_0x34df7c[_0x33c4('0x4a')]({'channel':_0x5b9cda,'membername':_0x4d6f7d['name'],'interface':_[_0x33c4('0x68')](_0x4d6f7d[_0x33c4('0xa0')])?util['format'](_0x33c4('0xf3'),_0x4d6f7d[_0x33c4('0x37')]):_0x4d6f7d[_0x33c4('0xa0')],'type':_0x33c4('0x104'),'enterAt':moment()[_0x33c4('0xae')](_0x33c4('0x101')),'data1':_0x1ef24b['body'][_0x33c4('0x3e')]||_0x33c4('0x10d'),'role':_0x4d6f7d[_0x33c4('0x29')],'internal':_0x4d6f7d[_0x33c4('0x64')]});});return db[_0x33c4('0xfe')][_0x33c4('0x106')](_0x34df7c,{'individualHooks':!![]});})[_0x33c4('0x28')](function(){return _0x4d6f7d[_0x33c4('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1ef24b[_0x33c4('0x60')][_0x33c4('0x3e')]||_0x33c4('0x10d'),'lastPauseAt':moment()[_0x33c4('0xae')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x16ed31,null))[_0x33c4('0x1d')](handleError(_0x16ed31,null));};exports['unpause']=function(_0x39f1d5,_0x3f9d18){if(_0x39f1d5[_0x33c4('0x60')][_0x33c4('0x9f')]&&!utils['isValidChannel'](_0x39f1d5[_0x33c4('0x60')][_0x33c4('0x9f')])){throw new APIBadRequestError(util[_0x33c4('0xae')](_0x33c4('0x10e'),_0x39f1d5[_0x33c4('0x60')][_0x33c4('0x9f')]));}return db['User'][_0x33c4('0x36')]({'where':{'id':_0x39f1d5[_0x33c4('0x58')]['id']},'attributes':['id','name','role',_0x33c4('0x64'),'interface',_0x33c4('0xad'),_0x33c4('0xaf'),_0x33c4('0x10f'),_0x33c4('0x110'),_0x33c4('0x111'),_0x33c4('0x112'),_0x33c4('0x113'),_0x33c4('0x114'),_0x33c4('0x115'),_0x33c4('0x116')]})[_0x33c4('0x28')](function(_0x47067a){if(!_0x47067a){throw new APINotFoundError(util[_0x33c4('0xae')](_0x33c4('0x117'),_0x39f1d5['params']['id']));}return _0x47067a[_0x33c4('0x118')](_0x39f1d5[_0x33c4('0x60')][_0x33c4('0x9f')]);})[_0x33c4('0x28')](respondWithResult(_0x3f9d18,null))['catch'](APIHandleError(_0x3f9d18));};exports[_0x33c4('0x119')]=function(_0x4213f5,_0x219a9e){var _0x56fb4b={};var _0x36c387={};var _0xf71b29;var _0x44c9d7;return db['User'][_0x33c4('0x97')]({'where':{'id':_0x4213f5[_0x33c4('0x58')]['id']}})['then'](handleEntityNotFound(_0x219a9e,null))['then'](function(_0x45e40a){if(_0x45e40a){_0xf71b29=_0x45e40a;_0x36c387[_0x33c4('0x5c')]=_[_0x33c4('0x5a')](db[_0x33c4('0x11a')][_0x33c4('0x3b')]);_0x36c387[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0x4213f5['query']);_0x36c387[_0x33c4('0xcf')]=_['intersection'](_0x36c387[_0x33c4('0x5c')],_0x36c387[_0x33c4('0x43')]);_0x56fb4b[_0x33c4('0x49')]=_[_0x33c4('0x5b')](_0x36c387[_0x33c4('0x5c')],qs[_0x33c4('0x5d')](_0x4213f5[_0x33c4('0x43')][_0x33c4('0x5d')]));_0x56fb4b[_0x33c4('0x49')]=_0x56fb4b[_0x33c4('0x49')][_0x33c4('0x4e')]?_0x56fb4b['attributes']:_0x36c387[_0x33c4('0x5c')];_0x56fb4b[_0x33c4('0xd0')]=qs[_0x33c4('0xd1')](_0x4213f5[_0x33c4('0x43')]['sort']);_0x56fb4b[_0x33c4('0x42')]=qs[_0x33c4('0xcf')](_[_0x33c4('0xd2')](_0x4213f5[_0x33c4('0x43')],_0x36c387[_0x33c4('0xcf')]));if(_0x4213f5['query'][_0x33c4('0x32')]){_0x56fb4b['where']=_[_0x33c4('0x5e')](_0x56fb4b[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0x56fb4b[_0x33c4('0x49')],function(_0x2b0299){var _0x25f8c3={};_0x25f8c3[_0x2b0299]={'$like':'%'+_0x4213f5['query']['filter']+'%'};return _0x25f8c3;})});}_0x56fb4b=_[_0x33c4('0x5e')]({},_0x56fb4b,_0x4213f5['options']);return _0xf71b29[_0x33c4('0x119')](_0x56fb4b);}})[_0x33c4('0x28')](function(_0x544410){if(_0x544410){_0x44c9d7=_0x544410[_0x33c4('0x4e')];if(!_0x4213f5[_0x33c4('0x43')][_0x33c4('0xd4')](_0x33c4('0xd9'))){_0x56fb4b['limit']=qs[_0x33c4('0x22')](_0x4213f5[_0x33c4('0x43')]['limit']);_0x56fb4b[_0x33c4('0x21')]=qs[_0x33c4('0x21')](_0x4213f5[_0x33c4('0x43')][_0x33c4('0x21')]);}return _0xf71b29[_0x33c4('0x119')](_0x56fb4b);}})[_0x33c4('0x28')](function(_0xee6b8){if(_0xee6b8){return _0xee6b8?{'count':_0x44c9d7,'rows':_0xee6b8}:null;}})[_0x33c4('0x28')](respondWithResult(_0x219a9e,null))[_0x33c4('0x1d')](handleError(_0x219a9e,null));};exports[_0x33c4('0x11b')]=function(_0x336299,_0x490edd){var _0x278728=_0x336299[_0x33c4('0x58')]['id'];var _0x5633e9=_0x336299[_0x33c4('0x60')]?_0x336299[_0x33c4('0x60')][_0x33c4('0x63')]:null;var _0x596030=[];return Promise[_0x33c4('0x108')]()['then'](function(){if(!_0x5633e9)throw new APIBadRequestError(_0x33c4('0x11c'));})[_0x33c4('0x28')](function(){return db[_0x33c4('0x4b')][_0x33c4('0x97')]({'where':{'id':_0x278728}});})[_0x33c4('0x28')](function(_0x1006d5){if(!_0x1006d5)throw new APINotFoundError(util[_0x33c4('0xae')](_0x33c4('0x117'),_0x336299[_0x33c4('0x58')]['id']));return db[_0x33c4('0x6a')][_0x33c4('0x11d')](function(_0x2510bc){return _0x1006d5[_0x33c4('0x11b')](_0x5633e9,{'transaction':_0x2510bc})['then'](function(){return db['Team'][_0x33c4('0x4c')]({'where':{'id':{'$in':_0x5633e9}}});})[_0x33c4('0x28')](function(_0x1aafd3){var _0x484d2f=_[_0x33c4('0x3c')](_0x1aafd3,function(_0x3d437f){return _0x3d437f[_0x33c4('0x11e')]();});return Promise['all'](_0x484d2f);})[_0x33c4('0x28')](function(_0x327027){_0x596030=_[_0x33c4('0x11f')](_0x327027);var _0x20f148=_[_0x33c4('0x3c')](_0x596030,function(_0x468a20){return _0x468a20[_0x33c4('0x120')](_0x1006d5['id'],{'transaction':_0x2510bc});});return Promise[_0x33c4('0x56')](_0x20f148);})[_0x33c4('0x28')](function(){if(!_0x1006d5['online'])return;var _0x308afe=_[_0x33c4('0x32')](_0x596030,function(_0xfa5e1e){return _0xfa5e1e[_0x33c4('0x121')](_0x33c4('0x9f'))===_0x33c4('0x122');});var _0x5734e2=_['map'](_0x308afe,function(_0x175c57){return db[_0x33c4('0xb0')][_0x33c4('0xb1')]({'membername':_0x1006d5[_0x33c4('0x37')],'UserId':_0x1006d5['id'],'queue_name':_0x175c57[_0x33c4('0x37')],'VoiceQueueId':_0x175c57['id'],'interface':_[_0x33c4('0x68')](_0x1006d5['interface'])?util[_0x33c4('0xae')](_0x33c4('0xf3'),_0x1006d5[_0x33c4('0x37')]):_0x1006d5[_0x33c4('0xa0')],'paused':_0x1006d5[_0x33c4('0xaf')]||![],'penalty':_0x1006d5[_0x33c4('0xa6')]},{'transaction':_0x2510bc});});return Promise[_0x33c4('0x56')](_0x5734e2);})[_0x33c4('0x28')](function(){return db[_0x33c4('0x123')][_0x33c4('0x4c')]({'where':{'teamId':{'$in':_0x5633e9}}});})[_0x33c4('0x28')](function(_0xc7ac1d){var _0x13bebd=_['map'](_0xc7ac1d,function(_0x22e0cb){return db[_0x33c4('0x124')][_0x33c4('0x80')]({'UserId':_0x1006d5['id'],'VoicePrefixId':_0x22e0cb['VoicePrefixId']},{'transaction':_0x2510bc});});return Promise[_0x33c4('0x56')](_0x13bebd);});});})['then'](function(){for(var _0xf1a743=0x0;_0xf1a743<_0x596030[_0x33c4('0x4e')];_0xf1a743++){var _0x118b03=_0x596030[_0xf1a743][_0x33c4('0x121')](_0x33c4('0x9f'));var _0x1dca78=_0x118b03+_0x33c4('0xa8');socket[_0x33c4('0xa9')](_0x33c4('0x2e')+_0x118b03+_0x33c4('0xaa'),{'UserId':_0x278728,['queueField']:_0x596030[_0xf1a743]['id']});}})[_0x33c4('0x28')](respondWithStatusCode(_0x490edd,null))['catch'](APIHandleError(_0x490edd));};exports['removeTeams']=function(_0x4e3783,_0x6ead49){var _0x1bf830=_0x4e3783[_0x33c4('0x58')]['id'];var _0x4cb5d5=null;if(_0x4e3783[_0x33c4('0x43')]['ids']){_0x4cb5d5=_[_0x33c4('0xb4')](_0x4e3783[_0x33c4('0x43')][_0x33c4('0x63')])?_0x4e3783[_0x33c4('0x43')]['ids']:[_0x4e3783[_0x33c4('0x43')][_0x33c4('0x63')]];}var _0x4fa453=[];return Promise[_0x33c4('0x108')]()[_0x33c4('0x28')](function(){if(!_0x4cb5d5)throw new APIBadRequestError(_0x33c4('0x125'));})[_0x33c4('0x28')](function(){return db[_0x33c4('0x4b')][_0x33c4('0x97')]({'where':{'id':_0x1bf830}});})[_0x33c4('0x28')](function(_0x2d236a){if(!_0x2d236a)throw new APINotFoundError(util[_0x33c4('0xae')](_0x33c4('0x117'),_0x4e3783[_0x33c4('0x58')]['id']));return db[_0x33c4('0x6a')]['transaction'](function(_0x5624df){return _0x2d236a[_0x33c4('0x126')](_0x4cb5d5,{'transaction':_0x5624df})['then'](function(){return db[_0x33c4('0x11a')]['findAll']({'where':{'id':{'$in':_0x4cb5d5}}});})[_0x33c4('0x28')](function(_0x269765){var _0x401f26=_[_0x33c4('0x3c')](_0x269765,function(_0x18f90b){return _0x18f90b[_0x33c4('0x11e')]();});return Promise[_0x33c4('0x56')](_0x401f26);})[_0x33c4('0x28')](function(_0x4f2102){_0x4fa453=_[_0x33c4('0x11f')](_0x4f2102);var _0x12f0f3=_[_0x33c4('0x3c')](_0x4fa453,function(_0x5a233d){return _0x5a233d[_0x33c4('0x127')](_0x2d236a['id'],{'transaction':_0x5624df});});return Promise[_0x33c4('0x56')](_0x12f0f3);})[_0x33c4('0x28')](function(){if(!_0x2d236a[_0x33c4('0xad')])return;var _0x28914c=_[_0x33c4('0x32')](_0x4fa453,function(_0x2ee8bb){return _0x2ee8bb[_0x33c4('0x121')]('channel')===_0x33c4('0x122');});var _0x3c8ba4=_[_0x33c4('0x3c')](_0x28914c,function(_0x4775b2){return db['UserVoiceQueueRt'][_0x33c4('0x2a')]({'where':{'VoiceQueueId':_0x4775b2['id'],'UserId':_0x2d236a['id']},'transaction':_0x5624df});});return Promise['all'](_0x3c8ba4);})[_0x33c4('0x28')](function(){return db[_0x33c4('0x123')][_0x33c4('0x4c')]({'where':{'teamId':{'$in':_0x4cb5d5}}});})[_0x33c4('0x28')](function(_0x300e99){var _0x1b796b=_[_0x33c4('0x3c')](_0x300e99,function(_0xcbd1b8){return db[_0x33c4('0x124')]['destroy']({'where':{'UserId':_0x2d236a['id'],'VoicePrefixId':_0xcbd1b8['VoicePrefixId']}},{'transaction':_0x5624df});});return Promise[_0x33c4('0x56')](_0x1b796b);});});})[_0x33c4('0x28')](function(){for(var _0x589a9c=0x0;_0x589a9c<_0x4fa453['length'];_0x589a9c++){var _0x3826b7=_0x4fa453[_0x589a9c]['getDataValue'](_0x33c4('0x9f'));var _0x2bb09d=_0x3826b7+_0x33c4('0xa8');socket[_0x33c4('0xa9')](_0x33c4('0x2e')+_0x3826b7+_0x33c4('0xb5'),{'UserId':_0x1bf830,['queueField']:_0x4fa453[_0x589a9c]['id']});}})[_0x33c4('0x28')](respondWithStatusCode(_0x6ead49,null))[_0x33c4('0x1d')](APIHandleError(_0x6ead49));};exports[_0x33c4('0x128')]=function(_0x12d909,_0xdd0d7f){var _0x366ba8={};var _0x47b010={};var _0x47441b;var _0x1d1faa;return db[_0x33c4('0x4b')]['findOne']({'where':{'id':_0x12d909['params']['id']}})[_0x33c4('0x28')](handleEntityNotFound(_0xdd0d7f,null))[_0x33c4('0x28')](function(_0x10ad22){if(_0x10ad22){_0x47441b=_0x10ad22;_0x47b010['model']=_[_0x33c4('0x5a')](db[_0x33c4('0xd5')][_0x33c4('0x3b')]);_0x47b010[_0x33c4('0x43')]=_[_0x33c4('0x5a')](_0x12d909[_0x33c4('0x43')]);_0x47b010[_0x33c4('0xcf')]=_[_0x33c4('0x5b')](_0x47b010[_0x33c4('0x5c')],_0x47b010['query']);_0x366ba8[_0x33c4('0x49')]=_[_0x33c4('0x5b')](_0x47b010['model'],qs[_0x33c4('0x5d')](_0x12d909[_0x33c4('0x43')][_0x33c4('0x5d')]));_0x366ba8[_0x33c4('0x49')]=_0x366ba8[_0x33c4('0x49')]['length']?_0x366ba8[_0x33c4('0x49')]:_0x47b010[_0x33c4('0x5c')];_0x366ba8[_0x33c4('0xd0')]=qs[_0x33c4('0xd1')](_0x12d909[_0x33c4('0x43')][_0x33c4('0xd1')]);_0x366ba8['where']=qs[_0x33c4('0xcf')](_['pick'](_0x12d909[_0x33c4('0x43')],_0x47b010[_0x33c4('0xcf')]));if(_0x12d909[_0x33c4('0x43')][_0x33c4('0x32')]){_0x366ba8['where']=_[_0x33c4('0x5e')](_0x366ba8[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0x366ba8[_0x33c4('0x49')],function(_0x41d27b){var _0x41636e={};_0x41636e[_0x41d27b]={'$like':'%'+_0x12d909[_0x33c4('0x43')][_0x33c4('0x32')]+'%'};return _0x41636e;})});}_0x366ba8=_[_0x33c4('0x5e')]({},_0x366ba8,_0x12d909[_0x33c4('0xd3')]);return _0x47441b[_0x33c4('0x128')](_0x366ba8);}})[_0x33c4('0x28')](function(_0x331380){if(_0x331380){_0x1d1faa=_0x331380['length'];if(!_0x12d909[_0x33c4('0x43')]['hasOwnProperty']('nolimit')){_0x366ba8[_0x33c4('0x22')]=qs[_0x33c4('0x22')](_0x12d909[_0x33c4('0x43')][_0x33c4('0x22')]);_0x366ba8['offset']=qs[_0x33c4('0x21')](_0x12d909[_0x33c4('0x43')][_0x33c4('0x21')]);}return _0x47441b[_0x33c4('0x128')](_0x366ba8);}})[_0x33c4('0x28')](function(_0x33fd8b){if(_0x33fd8b){return _0x33fd8b?{'count':_0x1d1faa,'rows':_0x33fd8b}:null;}})[_0x33c4('0x28')](respondWithResult(_0xdd0d7f,null))['catch'](handleError(_0xdd0d7f,null));};exports[_0x33c4('0x129')]=function(_0x10784b,_0x2928bc){var _0x4022da={};var _0x446bb8={};var _0x394b28;return db['User'][_0x33c4('0x97')]({'where':{'id':_0x10784b[_0x33c4('0x58')]['id']}})['then'](handleEntityNotFound(_0x2928bc,null))['then'](function(_0x50c7a9){if(_0x50c7a9){_0x394b28=_0x50c7a9;_0x446bb8[_0x33c4('0x5c')]=_[_0x33c4('0x5a')](db[_0x33c4('0x4b')][_0x33c4('0x3b')]);_0x446bb8['query']=_['keys'](_0x10784b['query']);_0x446bb8[_0x33c4('0xcf')]=_[_0x33c4('0x5b')](_0x446bb8['model'],_0x446bb8['query']);_0x4022da['attributes']=_['intersection'](_0x446bb8[_0x33c4('0x5c')],qs[_0x33c4('0x5d')](_0x10784b[_0x33c4('0x43')]['fields']));_0x4022da[_0x33c4('0x49')]=_0x4022da[_0x33c4('0x49')]['length']?_0x4022da[_0x33c4('0x49')]:_0x446bb8[_0x33c4('0x5c')];_0x4022da[_0x33c4('0xd0')]=qs[_0x33c4('0xd1')](_0x10784b[_0x33c4('0x43')][_0x33c4('0xd1')]);_0x4022da[_0x33c4('0x42')]=qs[_0x33c4('0xcf')](_[_0x33c4('0xd2')](_0x10784b[_0x33c4('0x43')],_0x446bb8['filters']));if(_0x10784b[_0x33c4('0x43')][_0x33c4('0x32')]){_0x4022da['where']=_[_0x33c4('0x5e')](_0x4022da[_0x33c4('0x42')],{'$or':_[_0x33c4('0x3c')](_0x4022da['attributes'],function(_0x138495){var _0x57e0e1={};_0x57e0e1[_0x138495]={'$like':'%'+_0x10784b[_0x33c4('0x43')]['filter']+'%'};return _0x57e0e1;})});}_0x4022da['model']=db[_0x33c4('0x4b')];_0x4022da['as']='Agents';_0x4022da=_[_0x33c4('0x5e')]({},_0x4022da,_0x10784b[_0x33c4('0xd3')]);return _0x394b28['getVoiceQueues']({'include':[_0x4022da]});}})[_0x33c4('0x28')](function(_0x451975){if(_0x451975){var _0x207825={},_0x17c4fc=[];for(var _0x3d5c9d=0x0;_0x3d5c9d<_0x451975[_0x33c4('0x4e')];_0x3d5c9d+=0x1){for(var _0x37dec8=0x0,_0x388805;_0x37dec8<_0x451975[_0x3d5c9d]['Agents'][_0x33c4('0x4e')];_0x37dec8+=0x1){_0x388805=_0x451975[_0x3d5c9d][_0x33c4('0x2f')][_0x37dec8]['get']({'plain':!![]});_0x207825[_0x388805['id']]=_0x388805;}}_0x207825=_[_0x33c4('0x12a')](_0x207825);for(var _0x5cd8f6=qs[_0x33c4('0x21')](_0x10784b['query']['offset']);_0x5cd8f6<_0x207825[_0x33c4('0x4e')]&&_0x17c4fc[_0x33c4('0x4e')]=_0x1402cc[_0xef0a('0x49')]){throw new Error(_0xef0a('0x4a'));}})[_0xef0a('0x1c')](function(){if(_0x1b8475){return db['UserVoiceQueueRt'][_0xef0a('0x41')]({'where':{'membername':_0x1b8475[_0xef0a('0x24')]},'individualHooks':!![]});}})[_0xef0a('0x1c')](function(){if(_0x1b8475){return _0x1b8475[_0xef0a('0x4b')]({'raw':!![]});}})[_0xef0a('0x1c')](function(_0x322c39){if(_0x1b8475){if(_0x322c39){var _0x4a4838=[];_0x50df27=_0x322c39;if(_0x50df27['length']){for(var _0x342dbc=0x0;_0x342dbc<_0x50df27[_0xef0a('0x42')];_0x342dbc++){_0x4a4838[_0xef0a('0x28')](db[_0xef0a('0x22')][_0xef0a('0x4c')]({'membername':_0x1b8475['name'],'UserId':_0x1b8475['id'],'queue_name':_0x50df27[_0x342dbc]['name'],'VoiceQueueId':_0x50df27[_0x342dbc]['id'],'interface':_0x56ecc4,'paused':_0x1b8475[_0xef0a('0x46')]||![],'penalty':_0x50df27[_0x342dbc][_0xef0a('0x4d')]||0x0}));}return BPromise['all'](_0x4a4838);}}}})[_0xef0a('0x1c')](function(){if(_0x1b8475){return db['MemberReport'][_0xef0a('0xd')]({'where':{'membername':_0x1b8475[_0xef0a('0x24')],'exitAt':null}});}})[_0xef0a('0x1c')](function(_0x1197de){if(_0x1b8475){if(_0x1197de&&_0x1197de['length']){var _0x2a5a5c=[];_0x1197de[_0xef0a('0x43')](function(_0x275054){_0x2a5a5c['push'](_0x275054[_0xef0a('0x23')]({'exitAt':moment()['format'](_0xef0a('0x26'))}));});return BPromise[_0xef0a('0x44')](_0x2a5a5c);}}})[_0xef0a('0x1c')](function(){if(_0x1b8475){var _0x5580ba=[];var _0x3c4eb4=[];var _0x171879=utils['getChannels']();var _0x4c155f={'membername':_0x1b8475[_0xef0a('0x24')],'interface':_0x56ecc4,'enterAt':moment()['format'](_0xef0a('0x26')),'role':_0x1b8475['role'],'internal':_0x1b8475[_0xef0a('0x2f')]};_0x171879[_0xef0a('0x43')](function(_0x4ec713){_0x5580ba[_0xef0a('0x28')](_[_0xef0a('0x4e')]({'channel':_0x4ec713,'type':_0xef0a('0x4f'),'data1':'callysquare','data2':_0x56ecc4},_0x4c155f));if(_0x1b8475[_0xef0a('0x46')]){_0x3c4eb4[_0xef0a('0x28')](_['merge']({'channel':_0x4ec713,'type':_0xef0a('0x25'),'data1':'LOGININPAUSE'},_0x4c155f));}});return db[_0xef0a('0x50')][_0xef0a('0x31')](_0x5580ba[_0xef0a('0x51')](_0x3c4eb4),{'individualHooks':!![]});}})[_0xef0a('0x1c')](function(){if(_0x1b8475){return _0x1b8475[_0xef0a('0x23')]({'online':!![],'lastLoginAt':moment()[_0xef0a('0x20')](_0xef0a('0x26')),'voicePause':_0x1b8475[_0xef0a('0x46')]||![],'mailPause':_0x1b8475[_0xef0a('0x46')]||![],'chatPause':_0x1b8475['loginInPause']||![],'faxPause':_0x1b8475['loginInPause']||![],'smsPause':_0x1b8475[_0xef0a('0x46')]||![],'openchannelPause':_0x1b8475['loginInPause']||![],'pauseType':_0x1b8475[_0xef0a('0x46')]?_0xef0a('0x52'):null,'lastPauseAt':moment()[_0xef0a('0x20')](_0xef0a('0x26')),'interface':_0x56ecc4});}})[_0xef0a('0x1c')](function(_0x25a87a){_0x52ee2f(_0x25a87a);})[_0xef0a('0x1e')](function(_0x40ab3b){_0x299071(_0x5920f1[_0xef0a('0x19')](0x1f4,_0x40ab3b[_0xef0a('0x18')]));});});}; \ No newline at end of file +var _0x229f=['catch','error','message','find','where','then','ShowUser','PauseUser','name','role','internal','format','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','update','PAUSE','length','updateAttributes','forEach','push','SIP/%s','interface','YYYY-MM-DD\x20HH:mm:ss','type','body','uniqueid','MemberReport','UnpauseUser','resolve','isValidChannel','channel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','voicePause','mailPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','unpause','system','LogoutUser','destroy','all','LoginUser','phone','loginInPause','count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','getChannels','merge','LOGIN','callysquare','LOGININPAUSE','bulkCreate','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','redis','defaults','localhost','./user.socket','register','GetUser','User','findAll','options','raw','attributes','include','map','model','debug','stringify'];(function(_0x29812f,_0x32dc08){var _0x47e96e=function(_0x328cf3){while(--_0x328cf3){_0x29812f['push'](_0x29812f['shift']());}};_0x47e96e(++_0x32dc08);}(_0x229f,0x93));var _0xf229=function(_0x11650f,_0x4eb613){_0x11650f=_0x11650f-0x0;var _0x29d3d5=_0x229f[_0x11650f];return _0x29d3d5;};'use strict';var _=require(_0xf229('0x0'));var util=require(_0xf229('0x1'));var moment=require('moment');var BPromise=require(_0xf229('0x2'));var Redis=require(_0xf229('0x3'));var db=require(_0xf229('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf229('0x5'));var config=require(_0xf229('0x6'));config[_0xf229('0x7')]=_[_0xf229('0x8')](config[_0xf229('0x7')],{'host':_0xf229('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf229('0x7')]));require(_0xf229('0xa'))[_0xf229('0xb')](socket);exports[_0xf229('0xc')]=function(_0x8f50de){var _0x25dd02=this;return new Promise(function(_0x458391,_0x21fc99){return db[_0xf229('0xd')][_0xf229('0xe')]({'raw':_0x8f50de[_0xf229('0xf')]?_0x8f50de['options'][_0xf229('0x10')]===undefined?!![]:![]:!![],'where':_0x8f50de['options']?_0x8f50de[_0xf229('0xf')]['where']||null:null,'attributes':_0x8f50de[_0xf229('0xf')]?_0x8f50de['options'][_0xf229('0x11')]||null:null,'limit':_0x8f50de[_0xf229('0xf')]?_0x8f50de[_0xf229('0xf')]['limit']||null:null,'include':_0x8f50de[_0xf229('0xf')]?_0x8f50de[_0xf229('0xf')][_0xf229('0x12')]?_[_0xf229('0x13')](_0x8f50de[_0xf229('0xf')][_0xf229('0x12')],function(_0x2c9676){return{'model':db[_0x2c9676['model']],'as':_0x2c9676['as'],'attributes':_0x2c9676[_0xf229('0x11')],'include':_0x2c9676[_0xf229('0x12')]?_['map'](_0x2c9676[_0xf229('0x12')],function(_0xbb1c73){return{'model':db[_0xbb1c73[_0xf229('0x14')]],'as':_0xbb1c73['as'],'attributes':_0xbb1c73['attributes'],'include':_0xbb1c73['include']?_[_0xf229('0x13')](_0xbb1c73[_0xf229('0x12')],function(_0x1223fa){return{'model':db[_0x1223fa[_0xf229('0x14')]],'as':_0x1223fa['as'],'attributes':_0x1223fa[_0xf229('0x11')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x22ac12){logger['info']('GetUser',_0x8f50de);logger[_0xf229('0x15')](_0xf229('0xc'),_0x8f50de,JSON[_0xf229('0x16')](_0x22ac12));_0x458391(_0x22ac12);})[_0xf229('0x17')](function(_0x2d0132){logger[_0xf229('0x18')](_0xf229('0xc'),_0x2d0132[_0xf229('0x19')],_0x8f50de);_0x21fc99(_0x25dd02['error'](0x1f4,_0x2d0132[_0xf229('0x19')]));});});};exports['ShowUser']=function(_0x428285){var _0x20f7bb=this;return new Promise(function(_0x5296bd,_0x57ffa6){return db['User'][_0xf229('0x1a')]({'raw':_0x428285[_0xf229('0xf')]?_0x428285[_0xf229('0xf')][_0xf229('0x10')]===undefined?!![]:![]:!![],'where':_0x428285[_0xf229('0xf')]?_0x428285['options'][_0xf229('0x1b')]||null:null,'attributes':_0x428285[_0xf229('0xf')]?_0x428285['options'][_0xf229('0x11')]||null:null,'include':_0x428285[_0xf229('0xf')]?_0x428285[_0xf229('0xf')][_0xf229('0x12')]?_[_0xf229('0x13')](_0x428285[_0xf229('0xf')][_0xf229('0x12')],function(_0x252880){return{'model':db[_0x252880['model']],'as':_0x252880['as'],'attributes':_0x252880[_0xf229('0x11')],'include':_0x252880[_0xf229('0x12')]?_[_0xf229('0x13')](_0x252880[_0xf229('0x12')],function(_0x31948a){return{'model':db[_0x31948a['model']],'as':_0x31948a['as'],'attributes':_0x31948a['attributes'],'include':_0x31948a[_0xf229('0x12')]?_[_0xf229('0x13')](_0x31948a['include'],function(_0x9e146f){return{'model':db[_0x9e146f[_0xf229('0x14')]],'as':_0x9e146f['as'],'attributes':_0x9e146f[_0xf229('0x11')]};}):[]};}):[]};}):[]:[]})[_0xf229('0x1c')](function(_0x4e1362){logger['info']('ShowUser',_0x428285);logger['debug'](_0xf229('0x1d'),_0x428285,JSON['stringify'](_0x4e1362));_0x5296bd(_0x4e1362);})[_0xf229('0x17')](function(_0x3a6ab8){logger[_0xf229('0x18')](_0xf229('0x1d'),_0x3a6ab8[_0xf229('0x19')],_0x428285);_0x57ffa6(_0x20f7bb[_0xf229('0x18')](0x1f4,_0x3a6ab8['message']));});});};exports[_0xf229('0x1e')]=function(_0x2379e9){var _0x114749;return db['User'][_0xf229('0x1a')]({'where':_0x2379e9['options'][_0xf229('0x1b')]||{},'attributes':['id',_0xf229('0x1f'),_0xf229('0x20'),_0xf229('0x21'),'interface']})[_0xf229('0x1c')](function(_0xf02415){if(!_0xf02415){throw new Error(util[_0xf229('0x22')](_0xf229('0x23'),_0x2379e9[_0xf229('0x24')]['id']));}_0x114749=_0xf02415;return db[_0xf229('0x25')][_0xf229('0x26')]({'paused':0x1},{'where':{'UserId':_0x114749['id']},'individualHooks':!![]});})[_0xf229('0x1c')](function(){return db['MemberReport'][_0xf229('0xe')]({'where':{'membername':_0x114749[_0xf229('0x1f')],'type':_0xf229('0x27'),'exitAt':null}});})[_0xf229('0x1c')](function(_0x40aadd){if(_0x40aadd&&_0x40aadd[_0xf229('0x28')]){var _0x1c87a5=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x274b34=0x0,_0x4be9dd=_0x40aadd['length'];_0x274b34<_0x4be9dd;_0x274b34++){_0x40aadd[_0x274b34][_0xf229('0x29')]({'exitAt':_0x1c87a5});}}})['then'](function(){var _0x507184=[];var _0x2c895b=utils['getChannels']();_0x2c895b[_0xf229('0x2a')](function(_0xf0be9b){_0x507184[_0xf229('0x2b')]({'channel':_0xf0be9b,'membername':_0x114749[_0xf229('0x1f')],'interface':_['isNil'](_0x114749['interface'])?util['format'](_0xf229('0x2c'),_0x114749['name']):_0x114749[_0xf229('0x2d')],'type':'PAUSE','enterAt':moment()[_0xf229('0x22')](_0xf229('0x2e')),'data1':_0x2379e9['body'][_0xf229('0x2f')]||'DEFAULT\x20PAUSE','role':_0x114749[_0xf229('0x20')],'internal':_0x114749[_0xf229('0x21')],'uniqueid':_0x2379e9[_0xf229('0x30')][_0xf229('0x31')]||null});});return db[_0xf229('0x32')]['bulkCreate'](_0x507184,{'individualHooks':!![]});})[_0xf229('0x1c')](function(){return _0x114749[_0xf229('0x26')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x2379e9['body'][_0xf229('0x2f')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xf229('0x22')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xf229('0x17')](function(_0x12ab7f){throw _0x12ab7f;});};exports[_0xf229('0x33')]=function(_0x18e94e){return Promise[_0xf229('0x34')]()[_0xf229('0x1c')](function(){if(_0x18e94e[_0xf229('0x30')]['channel']&&!utils[_0xf229('0x35')](_0x18e94e[_0xf229('0x30')][_0xf229('0x36')])){throw new Error(util[_0xf229('0x22')](_0xf229('0x37'),_0x18e94e[_0xf229('0x30')][_0xf229('0x36')]));}return db[_0xf229('0xd')][_0xf229('0x38')]({'where':_0x18e94e[_0xf229('0xf')]['where']||{},'attributes':['id',_0xf229('0x1f'),_0xf229('0x20'),_0xf229('0x21'),_0xf229('0x2d'),_0xf229('0x39'),_0xf229('0x3a'),_0xf229('0x3b'),'chatPause',_0xf229('0x3c'),_0xf229('0x3d'),_0xf229('0x3e'),_0xf229('0x3f'),_0xf229('0x40'),'lastPauseAt']});})[_0xf229('0x1c')](function(_0x5b3770){if(!_0x5b3770){throw new Error(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x18e94e[_0xf229('0x24')]['id']));}return _0x5b3770[_0xf229('0x41')](_0x18e94e[_0xf229('0x30')][_0xf229('0x36')],_0xf229('0x42'));})['catch'](function(_0x4f6bad){throw _0x4f6bad;});};exports[_0xf229('0x43')]=function(_0x1705e0){var _0x5279ab=this;return new Promise(function(_0x3515d8,_0x3b0601){var _0x164283;return db[_0xf229('0xd')][_0xf229('0x38')]({'where':_0x1705e0[_0xf229('0xf')][_0xf229('0x1b')]||{},'attributes':['id',_0xf229('0x1f')]})[_0xf229('0x1c')](function(_0x11bc27){if(_0x11bc27){_0x164283=_0x11bc27;return db[_0xf229('0x25')][_0xf229('0x44')]({'where':{'membername':_0x164283['name']},'individualHooks':!![]});}})['then'](function(){if(_0x164283){return db[_0xf229('0x32')]['findAll']({'where':{'membername':_0x164283[_0xf229('0x1f')],'exitAt':null}});}})[_0xf229('0x1c')](function(_0x6bcf2d){if(_0x164283){if(_0x6bcf2d&&_0x6bcf2d[_0xf229('0x28')]){var _0x2de7d7=[];_0x6bcf2d[_0xf229('0x2a')](function(_0x227e6c){_0x2de7d7[_0xf229('0x2b')](_0x227e6c[_0xf229('0x26')]({'exitAt':moment()[_0xf229('0x22')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xf229('0x45')](_0x2de7d7);}}})[_0xf229('0x1c')](function(){if(_0x164283){return _0x164283['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xf229('0x1c')](function(_0xc13951){_0x3515d8(_0xc13951);})['catch'](function(_0x4e9414){_0x3b0601(_0x5279ab[_0xf229('0x18')](0x1f4,_0x4e9414['message']));});});};exports[_0xf229('0x46')]=function(_0x114776){var _0x461014=this;return new Promise(function(_0x20a7e8,_0x1748e7){var _0x344bb6;var _0x5d70d0;var _0x547a7f;var _0x34a229;return db[_0xf229('0xd')][_0xf229('0x38')]({'where':_0x114776['options']['where']||{},'attributes':['id',_0xf229('0x1f'),_0xf229('0x20'),'mobile',_0xf229('0x47'),'internal',_0xf229('0x48'),'interface']})[_0xf229('0x1c')](function(_0x1a7db6){if(_0x1a7db6){_0x344bb6=_0x1a7db6;_0x34a229=_0x114776[_0xf229('0x30')][_0xf229('0x2d')]?_0x114776[_0xf229('0x30')][_0xf229('0x2d')]:util[_0xf229('0x22')](_0xf229('0x2c'),_0x344bb6[_0xf229('0x1f')]);return db['User'][_0xf229('0x49')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x344bb6['id']}}});}})[_0xf229('0x1c')](function(_0x5a7fba){if(_0x5a7fba){_0x547a7f=_0x5a7fba;return require(_0xf229('0x4a'))[_0xf229('0x4b')]();}})[_0xf229('0x1c')](function(_0x5812b5){if(_0x5812b5&&_0x5812b5[_0xf229('0x4c')]&&_0x547a7f>=_0x5812b5[_0xf229('0x4c')]){throw new Error(_0xf229('0x4d'));}})[_0xf229('0x1c')](function(){if(_0x344bb6){return db['UserVoiceQueueRt'][_0xf229('0x44')]({'where':{'membername':_0x344bb6['name']},'individualHooks':!![]});}})[_0xf229('0x1c')](function(){if(_0x344bb6){return _0x344bb6[_0xf229('0x4e')]({'raw':!![]});}})[_0xf229('0x1c')](function(_0x2d73fe){if(_0x344bb6){if(_0x2d73fe){var _0x5938c9=[];_0x5d70d0=_0x2d73fe;if(_0x5d70d0[_0xf229('0x28')]){for(var _0x14535f=0x0;_0x14535f<_0x5d70d0[_0xf229('0x28')];_0x14535f++){_0x5938c9[_0xf229('0x2b')](db[_0xf229('0x25')]['upsert']({'membername':_0x344bb6[_0xf229('0x1f')],'UserId':_0x344bb6['id'],'queue_name':_0x5d70d0[_0x14535f][_0xf229('0x1f')],'VoiceQueueId':_0x5d70d0[_0x14535f]['id'],'interface':_0x34a229,'paused':_0x344bb6[_0xf229('0x48')]||![],'penalty':_0x5d70d0[_0x14535f]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xf229('0x45')](_0x5938c9);}}}})[_0xf229('0x1c')](function(){if(_0x344bb6){return db['MemberReport'][_0xf229('0xe')]({'where':{'membername':_0x344bb6[_0xf229('0x1f')],'exitAt':null}});}})[_0xf229('0x1c')](function(_0x5e67f4){if(_0x344bb6){if(_0x5e67f4&&_0x5e67f4[_0xf229('0x28')]){var _0x588120=[];_0x5e67f4[_0xf229('0x2a')](function(_0x2b91d9){_0x588120[_0xf229('0x2b')](_0x2b91d9[_0xf229('0x26')]({'exitAt':moment()[_0xf229('0x22')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xf229('0x45')](_0x588120);}}})[_0xf229('0x1c')](function(){if(_0x344bb6){var _0x5c0d0b=[];var _0xc43a0b=[];var _0x286707=utils[_0xf229('0x4f')]();var _0x2db018={'membername':_0x344bb6[_0xf229('0x1f')],'interface':_0x34a229,'enterAt':moment()[_0xf229('0x22')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x344bb6['role'],'internal':_0x344bb6[_0xf229('0x21')]};_0x286707[_0xf229('0x2a')](function(_0x4e37fa){_0x5c0d0b[_0xf229('0x2b')](_[_0xf229('0x50')]({'channel':_0x4e37fa,'type':_0xf229('0x51'),'data1':_0xf229('0x52'),'data2':_0x34a229},_0x2db018));if(_0x344bb6[_0xf229('0x48')]){_0xc43a0b[_0xf229('0x2b')](_[_0xf229('0x50')]({'channel':_0x4e37fa,'type':_0xf229('0x27'),'data1':_0xf229('0x53')},_0x2db018));}});return db['MemberReport'][_0xf229('0x54')](_0x5c0d0b['concat'](_0xc43a0b),{'individualHooks':!![]});}})[_0xf229('0x1c')](function(){if(_0x344bb6){return _0x344bb6['update']({'online':!![],'lastLoginAt':moment()[_0xf229('0x22')](_0xf229('0x2e')),'voicePause':_0x344bb6[_0xf229('0x48')]||![],'mailPause':_0x344bb6[_0xf229('0x48')]||![],'chatPause':_0x344bb6[_0xf229('0x48')]||![],'faxPause':_0x344bb6[_0xf229('0x48')]||![],'smsPause':_0x344bb6[_0xf229('0x48')]||![],'openchannelPause':_0x344bb6['loginInPause']||![],'pauseType':_0x344bb6['loginInPause']?_0xf229('0x53'):null,'lastPauseAt':moment()['format'](_0xf229('0x2e')),'interface':_0x34a229});}})[_0xf229('0x1c')](function(_0x309e5f){_0x20a7e8(_0x309e5f);})[_0xf229('0x17')](function(_0x19b7fc){_0x1748e7(_0x461014[_0xf229('0x18')](0x1f4,_0x19b7fc[_0xf229('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 5c7de37..74d50c7 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 _0xb500=['removeListener','register','user:','save','remove','update','emit'];(function(_0x5a3324,_0x132fb1){var _0x5d3ab6=function(_0x1823e0){while(--_0x1823e0){_0x5a3324['push'](_0x5a3324['shift']());}};_0x5d3ab6(++_0x132fb1);}(_0xb500,0xff));var _0x0b50=function(_0x2e2636,_0x58b3cd){_0x2e2636=_0x2e2636-0x0;var _0x5805a6=_0xb500[_0x2e2636];return _0x5805a6;};'use strict';var UserEvents=require('./user.events');var events=[_0x0b50('0x0'),_0x0b50('0x1'),_0x0b50('0x2')];function createListener(_0x4f9f01,_0x429885){return function(_0x335ead){_0x429885[_0x0b50('0x3')](_0x4f9f01,_0x335ead);};}function removeListener(_0x1efefc,_0x371eb1){return function(){UserEvents[_0x0b50('0x4')](_0x1efefc,_0x371eb1);};}exports[_0x0b50('0x5')]=function(_0x54c838){for(var _0x18ee7a=0x0,_0x3fc73a=events['length'];_0x18ee7a<_0x3fc73a;_0x18ee7a++){var _0x2cbbc4=events[_0x18ee7a];var _0x17f7dc=createListener(_0x0b50('0x6')+_0x2cbbc4,_0x54c838);UserEvents['on'](_0x2cbbc4,_0x17f7dc);}}; \ No newline at end of file +var _0x1a81=['./user.events','save','remove','removeListener','register'];(function(_0x52d119,_0xfb015c){var _0xf82f81=function(_0x52c7b6){while(--_0x52c7b6){_0x52d119['push'](_0x52d119['shift']());}};_0xf82f81(++_0xfb015c);}(_0x1a81,0x1f4));var _0x11a8=function(_0x56622a,_0x223e67){_0x56622a=_0x56622a-0x0;var _0x371650=_0x1a81[_0x56622a];return _0x371650;};'use strict';var UserEvents=require(_0x11a8('0x0'));var events=[_0x11a8('0x1'),_0x11a8('0x2'),'update'];function createListener(_0x268081,_0x10f27c){return function(_0x549feb){_0x10f27c['emit'](_0x268081,_0x549feb);};}function removeListener(_0x32eb65,_0x2e02e2){return function(){UserEvents[_0x11a8('0x3')](_0x32eb65,_0x2e02e2);};}exports[_0x11a8('0x4')]=function(_0x1b370d){for(var _0x368950=0x0,_0xeae209=events['length'];_0x368950<_0xeae209;_0x368950++){var _0x5ec9bf=events[_0x368950];var _0x5c44a5=createListener('user:'+_0x5ec9bf,_0x1b370d);UserEvents['on'](_0x5ec9bf,_0x5c44a5);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 718122b..b0af63d 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(_0x25712d,_0x5cf614){var _0x2cc1f0=function(_0x3381f3){while(--_0x3381f3){_0x25712d['push'](_0x25712d['shift']());}};_0x2cc1f0(++_0x5cf614);}(_0xedd9,0xfc));var _0x9edd=function(_0x377b26,_0xa98089){_0x377b26=_0x377b26-0x0;var _0x5b79f3=_0xedd9[_0x377b26];return _0x5b79f3;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x19db4a,_0x39f04d){var _0x274fd4=function(_0x558813){while(--_0x558813){_0x19db4a['push'](_0x19db4a['shift']());}};_0x274fd4(++_0x39f04d);}(_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'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 9b99aa9..fb75484 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 _0xee73=['INTEGER','sequelize','exports'];(function(_0x511d82,_0x53f0a4){var _0x224903=function(_0x58c059){while(--_0x58c059){_0x511d82['push'](_0x511d82['shift']());}};_0x224903(++_0x53f0a4);}(_0xee73,0x196));var _0x3ee7=function(_0x2492dc,_0x3284a7){_0x2492dc=_0x2492dc-0x0;var _0x310431=_0xee73[_0x2492dc];return _0x310431;};'use strict';var Sequelize=require(_0x3ee7('0x0'));module[_0x3ee7('0x1')]={'penalty':{'type':Sequelize[_0x3ee7('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2d6d=['sequelize','exports'];(function(_0xb94101,_0x4027bb){var _0x4b94f4=function(_0x450437){while(--_0x450437){_0xb94101['push'](_0xb94101['shift']());}};_0x4b94f4(++_0x4027bb);}(_0x2d6d,0xec));var _0xd2d6=function(_0x35d8af,_0x14fd75){_0x35d8af=_0x35d8af-0x0;var _0x1d08b0=_0x2d6d[_0x35d8af];return _0x1d08b0;};'use strict';var Sequelize=require(_0xd2d6('0x0'));module[_0xd2d6('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 de38c66..e5a8286 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 _0x88ce=['rimraf','../../config/environment','define','UserChatQueue','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x52c3b8,_0x1c47e4){var _0x1c81d7=function(_0x2f3c49){while(--_0x2f3c49){_0x52c3b8['push'](_0x52c3b8['shift']());}};_0x1c81d7(++_0x1c47e4);}(_0x88ce,0x9e));var _0xe88c=function(_0x5ce961,_0x32151e){_0x5ce961=_0x5ce961-0x0;var _0x291b0f=_0x88ce[_0x5ce961];return _0x291b0f;};'use strict';var _=require(_0xe88c('0x0'));var util=require(_0xe88c('0x1'));var logger=require(_0xe88c('0x2'))(_0xe88c('0x3'));var moment=require('moment');var BPromise=require(_0xe88c('0x4'));var rp=require(_0xe88c('0x5'));var fs=require('fs');var path=require(_0xe88c('0x6'));var rimraf=require(_0xe88c('0x7'));var config=require(_0xe88c('0x8'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x12662b,_0x32553e){return _0x12662b[_0xe88c('0x9')](_0xe88c('0xa'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1bd4=['exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x59a8dc,_0x5c0a65){var _0x53336d=function(_0xb0eb66){while(--_0xb0eb66){_0x59a8dc['push'](_0x59a8dc['shift']());}};_0x53336d(++_0x5c0a65);}(_0x1bd4,0x1d8));var _0x41bd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bd4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x41bd('0x0'));var util=require(_0x41bd('0x1'));var logger=require(_0x41bd('0x2'))(_0x41bd('0x3'));var moment=require(_0x41bd('0x4'));var BPromise=require('bluebird');var rp=require(_0x41bd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x41bd('0x6'));var config=require(_0x41bd('0x7'));var attributes=require('./userChatQueue.attributes');module[_0x41bd('0x8')]=function(_0x5ad8fb,_0x1f9f14){return _0x5ad8fb[_0x41bd('0x9')](_0x41bd('0xa'),attributes,{'tableName':_0x41bd('0xb'),'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 986479d..b1d91b2 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 _0xf31c=['debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','request\x20sent'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xf31c,0x168));var _0xcf31=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xf31c[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0xcf31('0x0'));var util=require(_0xcf31('0x1'));var moment=require(_0xcf31('0x2'));var BPromise=require(_0xcf31('0x3'));var rs=require(_0xcf31('0x4'));var fs=require('fs');var Redis=require(_0xcf31('0x5'));var db=require(_0xcf31('0x6'))['db'];var utils=require(_0xcf31('0x7'));var logger=require(_0xcf31('0x8'))(_0xcf31('0x9'));var config=require('../../config/environment');var jayson=require(_0xcf31('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x16a302,_0x381e53,_0x254350){return new BPromise(function(_0x1f49d2,_0x36f574){return client[_0xcf31('0xb')](_0x16a302,_0x254350)['then'](function(_0x2eb715){logger[_0xcf31('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x381e53,_0xcf31('0xd'));logger[_0xcf31('0xe')](_0xcf31('0xf'),_0x381e53,'request\x20sent',JSON[_0xcf31('0x10')](_0x2eb715));if(_0x2eb715[_0xcf31('0x11')]){if(_0x2eb715[_0xcf31('0x11')][_0xcf31('0x12')]===0x1f4){logger['error'](_0xcf31('0x13'),_0x381e53,_0x2eb715[_0xcf31('0x11')][_0xcf31('0x14')]);return _0x36f574(_0x2eb715[_0xcf31('0x11')][_0xcf31('0x14')]);}logger['error'](_0xcf31('0x13'),_0x381e53,_0x2eb715[_0xcf31('0x11')]['message']);return _0x1f49d2(_0x2eb715[_0xcf31('0x11')]['message']);}else{logger[_0xcf31('0xc')](_0xcf31('0x13'),_0x381e53,_0xcf31('0xd'));_0x1f49d2(_0x2eb715[_0xcf31('0x15')][_0xcf31('0x14')]);}})['catch'](function(_0x523385){logger[_0xcf31('0x11')](_0xcf31('0x13'),_0x381e53,_0x523385);_0x36f574(_0x523385);});});} \ No newline at end of file +var _0xf496=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','UserChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x566143,_0x39d70e){var _0x37881d=function(_0x3d82ca){while(--_0x3d82ca){_0x566143['push'](_0x566143['shift']());}};_0x37881d(++_0x39d70e);}(_0xf496,0xc0));var _0x6f49=function(_0x4e809e,_0x148a2d){_0x4e809e=_0x4e809e-0x0;var _0x126252=_0xf496[_0x4e809e];return _0x126252;};'use strict';var _=require('lodash');var util=require(_0x6f49('0x0'));var moment=require(_0x6f49('0x1'));var BPromise=require(_0x6f49('0x2'));var rs=require(_0x6f49('0x3'));var fs=require('fs');var Redis=require(_0x6f49('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f49('0x5'));var logger=require(_0x6f49('0x6'))(_0x6f49('0x7'));var config=require(_0x6f49('0x8'));var jayson=require(_0x6f49('0x9'));var client=jayson[_0x6f49('0xa')][_0x6f49('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1942b2,_0x3e76f0,_0x292530){return new BPromise(function(_0x43d3c2,_0xaa9c74){return client[_0x6f49('0xc')](_0x1942b2,_0x292530)['then'](function(_0x9b2618){logger['info'](_0x6f49('0xd'),_0x3e76f0,'request\x20sent');logger[_0x6f49('0xe')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x3e76f0,_0x6f49('0xf'),JSON[_0x6f49('0x10')](_0x9b2618));if(_0x9b2618[_0x6f49('0x11')]){if(_0x9b2618['error'][_0x6f49('0x12')]===0x1f4){logger[_0x6f49('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x3e76f0,_0x9b2618[_0x6f49('0x11')]['message']);return _0xaa9c74(_0x9b2618[_0x6f49('0x11')][_0x6f49('0x13')]);}logger[_0x6f49('0x11')](_0x6f49('0xd'),_0x3e76f0,_0x9b2618['error'][_0x6f49('0x13')]);return _0x43d3c2(_0x9b2618[_0x6f49('0x11')][_0x6f49('0x13')]);}else{logger[_0x6f49('0x14')](_0x6f49('0xd'),_0x3e76f0,_0x6f49('0xf'));_0x43d3c2(_0x9b2618['result']['message']);}})[_0x6f49('0x15')](function(_0x4faa9e){logger[_0x6f49('0x11')](_0x6f49('0xd'),_0x3e76f0,_0x4faa9e);_0xaa9c74(_0x4faa9e);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index e3be2e7..7f755af 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2ee96a,_0x4e4cf1){var _0x5e62aa=function(_0x37f60f){while(--_0x37f60f){_0x2ee96a['push'](_0x2ee96a['shift']());}};_0x5e62aa(++_0x4e4cf1);}(_0xedd9,0xfc));var _0x9edd=function(_0x14406e,_0x2502b2){_0x14406e=_0x14406e-0x0;var _0x1474e9=_0xedd9[_0x14406e];return _0x1474e9;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5d24e,_0x1f75c0){var _0x1a54d0=function(_0x422a0f){while(--_0x422a0f){_0x5d24e['push'](_0x5d24e['shift']());}};_0x1a54d0(++_0x1f75c0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d08b8,_0x34c445){_0x4d08b8=_0x4d08b8-0x0;var _0x70214a=_0xcb91[_0x4d08b8];return _0x70214a;};'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 5ef7278..d57889e 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 _0xbd3a=['STRING','sequelize','exports','INTEGER'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbd3a,0x13d));var _0xabd3=function(_0x4979f4,_0x415768){_0x4979f4=_0x4979f4-0x0;var _0x3cce90=_0xbd3a[_0x4979f4];return _0x3cce90;};'use strict';var Sequelize=require(_0xabd3('0x0'));module[_0xabd3('0x1')]={'penalty':{'type':Sequelize[_0xabd3('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xabd3('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xabd3('0x3')]}}; \ No newline at end of file +var _0x2013=['sequelize','exports','INTEGER','STRING'];(function(_0x476e5c,_0x188d9b){var _0x51992c=function(_0x54c31f){while(--_0x54c31f){_0x476e5c['push'](_0x476e5c['shift']());}};_0x51992c(++_0x188d9b);}(_0x2013,0x190));var _0x3201=function(_0x2b72e0,_0x5730a7){_0x2b72e0=_0x2b72e0-0x0;var _0x4d6565=_0x2013[_0x2b72e0];return _0x4d6565;};'use strict';var Sequelize=require(_0x3201('0x0'));module[_0x3201('0x1')]={'penalty':{'type':Sequelize[_0x3201('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3201('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x3201('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index b475123..f9ec1f8 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 _0x399e=['../../config/logger','moment','bluebird','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','user_has_fax_queues','lodash','util'];(function(_0x44989b,_0x1824e8){var _0x1c771c=function(_0xbbfbac){while(--_0xbbfbac){_0x44989b['push'](_0x44989b['shift']());}};_0x1c771c(++_0x1824e8);}(_0x399e,0x94));var _0xe399=function(_0x26dfc5,_0x138166){_0x26dfc5=_0x26dfc5-0x0;var _0x566350=_0x399e[_0x26dfc5];return _0x566350;};'use strict';var _=require(_0xe399('0x0'));var util=require(_0xe399('0x1'));var logger=require(_0xe399('0x2'))('api');var moment=require(_0xe399('0x3'));var BPromise=require(_0xe399('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe399('0x5'));var attributes=require(_0xe399('0x6'));module['exports']=function(_0x274ca1,_0x282dc9){return _0x274ca1[_0xe399('0x7')](_0xe399('0x8'),attributes,{'tableName':_0xe399('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84e4=['../../config/logger','api','moment','bluebird','request-promise','path','exports','define','UserFaxQueue','lodash','util'];(function(_0x81dade,_0x214864){var _0x3b7224=function(_0x1ee304){while(--_0x1ee304){_0x81dade['push'](_0x81dade['shift']());}};_0x3b7224(++_0x214864);}(_0x84e4,0x127));var _0x484e=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0x84e4[_0x50f392];return _0x5926f2;};'use strict';var _=require(_0x484e('0x0'));var util=require(_0x484e('0x1'));var logger=require(_0x484e('0x2'))(_0x484e('0x3'));var moment=require(_0x484e('0x4'));var BPromise=require(_0x484e('0x5'));var rp=require(_0x484e('0x6'));var fs=require('fs');var path=require(_0x484e('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module[_0x484e('0x8')]=function(_0x474d30,_0x3a6ba5){return _0x474d30[_0x484e('0x9')](_0x484e('0xa'),attributes,{'tableName':'user_has_fax_queues','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 3c65683..4e4b875 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 _0xda64=['message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1b3564,_0x16c919){var _0x504069=function(_0x9322b6){while(--_0x9322b6){_0x1b3564['push'](_0x1b3564['shift']());}};_0x504069(++_0x16c919);}(_0xda64,0x144));var _0x4da6=function(_0x5a8d7c,_0x4b20a6){_0x5a8d7c=_0x5a8d7c-0x0;var _0x444a75=_0xda64[_0x5a8d7c];return _0x444a75;};'use strict';var _=require(_0x4da6('0x0'));var util=require(_0x4da6('0x1'));var moment=require(_0x4da6('0x2'));var BPromise=require(_0x4da6('0x3'));var rs=require(_0x4da6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4da6('0x5'))['db'];var utils=require(_0x4da6('0x6'));var logger=require('../../config/logger')(_0x4da6('0x7'));var config=require('../../config/environment');var jayson=require(_0x4da6('0x8'));var client=jayson[_0x4da6('0x9')][_0x4da6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51cc6f,_0x155d4a,_0x184639){return new BPromise(function(_0x57655e,_0x5ad4ab){return client[_0x4da6('0xb')](_0x51cc6f,_0x184639)[_0x4da6('0xc')](function(_0x53aec7){logger[_0x4da6('0xd')](_0x4da6('0xe'),_0x155d4a,_0x4da6('0xf'));logger[_0x4da6('0x10')](_0x4da6('0x11'),_0x155d4a,_0x4da6('0xf'),JSON[_0x4da6('0x12')](_0x53aec7));if(_0x53aec7[_0x4da6('0x13')]){if(_0x53aec7[_0x4da6('0x13')][_0x4da6('0x14')]===0x1f4){logger[_0x4da6('0x13')](_0x4da6('0xe'),_0x155d4a,_0x53aec7[_0x4da6('0x13')][_0x4da6('0x15')]);return _0x5ad4ab(_0x53aec7['error']['message']);}logger[_0x4da6('0x13')](_0x4da6('0xe'),_0x155d4a,_0x53aec7[_0x4da6('0x13')][_0x4da6('0x15')]);return _0x57655e(_0x53aec7[_0x4da6('0x13')][_0x4da6('0x15')]);}else{logger[_0x4da6('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x155d4a,_0x4da6('0xf'));_0x57655e(_0x53aec7['result']['message']);}})[_0x4da6('0x16')](function(_0x29c1d5){logger[_0x4da6('0x13')](_0x4da6('0xe'),_0x155d4a,_0x29c1d5);_0x5ad4ab(_0x29c1d5);});});} \ No newline at end of file +var _0x7b77=['message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xa756a3,_0x51445f){var _0xfd50f=function(_0x422a69){while(--_0x422a69){_0xa756a3['push'](_0xa756a3['shift']());}};_0xfd50f(++_0x51445f);}(_0x7b77,0xab));var _0x77b7=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x7b77[_0x2d364e];return _0x1b9312;};'use strict';var _=require(_0x77b7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x77b7('0x1'));var rs=require(_0x77b7('0x2'));var fs=require('fs');var Redis=require(_0x77b7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x77b7('0x4'));var logger=require(_0x77b7('0x5'))(_0x77b7('0x6'));var config=require(_0x77b7('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x77b7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b89fe,_0x2d8172,_0x52cecf){return new BPromise(function(_0x4cd610,_0x4b8438){return client['request'](_0x4b89fe,_0x52cecf)[_0x77b7('0x9')](function(_0x13b56b){logger[_0x77b7('0xa')](_0x77b7('0xb'),_0x2d8172,_0x77b7('0xc'));logger[_0x77b7('0xd')](_0x77b7('0xe'),_0x2d8172,_0x77b7('0xc'),JSON[_0x77b7('0xf')](_0x13b56b));if(_0x13b56b[_0x77b7('0x10')]){if(_0x13b56b['error'][_0x77b7('0x11')]===0x1f4){logger[_0x77b7('0x10')](_0x77b7('0xb'),_0x2d8172,_0x13b56b[_0x77b7('0x10')]['message']);return _0x4b8438(_0x13b56b['error'][_0x77b7('0x12')]);}logger['error'](_0x77b7('0xb'),_0x2d8172,_0x13b56b[_0x77b7('0x10')][_0x77b7('0x12')]);return _0x4cd610(_0x13b56b[_0x77b7('0x10')][_0x77b7('0x12')]);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x2d8172,'request\x20sent');_0x4cd610(_0x13b56b[_0x77b7('0x13')][_0x77b7('0x12')]);}})[_0x77b7('0x14')](function(_0x374678){logger['error'](_0x77b7('0xb'),_0x2d8172,_0x374678);_0x4b8438(_0x374678);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index ec12af2..27b2995 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x126420,_0x476f16){var _0x4e6517=function(_0x24134b){while(--_0x24134b){_0x126420['push'](_0x126420['shift']());}};_0x4e6517(++_0x476f16);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xd4f210,_0x2e08cf){var _0x5b1352=function(_0xcd93ef){while(--_0xcd93ef){_0xd4f210['push'](_0xd4f210['shift']());}};_0x5b1352(++_0x2e08cf);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index b20edb8..2451327 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 _0x8d30=['exports','INTEGER','sequelize'];(function(_0x22e1c1,_0x331397){var _0x5d5f4d=function(_0x4aa203){while(--_0x4aa203){_0x22e1c1['push'](_0x22e1c1['shift']());}};_0x5d5f4d(++_0x331397);}(_0x8d30,0x128));var _0x08d3=function(_0x5161fc,_0x37c5f6){_0x5161fc=_0x5161fc-0x0;var _0x38490b=_0x8d30[_0x5161fc];return _0x38490b;};'use strict';var Sequelize=require(_0x08d3('0x0'));module[_0x08d3('0x1')]={'penalty':{'type':Sequelize[_0x08d3('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4e3d=['exports','sequelize'];(function(_0x20b0a3,_0xa0a2ca){var _0x5882f1=function(_0x34d30e){while(--_0x34d30e){_0x20b0a3['push'](_0x20b0a3['shift']());}};_0x5882f1(++_0xa0a2ca);}(_0x4e3d,0x12b));var _0xd4e3=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4e3d[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0xd4e3('0x0'));module[_0xd4e3('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index bdfcee8..8d0a7ac 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 _0xe916=['rimraf','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','lodash','util','moment','bluebird','request-promise','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe916,0x7e));var _0x6e91=function(_0x231f0f,_0x5a609f){_0x231f0f=_0x231f0f-0x0;var _0x19a94e=_0xe916[_0x231f0f];return _0x19a94e;};'use strict';var _=require(_0x6e91('0x0'));var util=require(_0x6e91('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6e91('0x2'));var BPromise=require(_0x6e91('0x3'));var rp=require(_0x6e91('0x4'));var fs=require('fs');var path=require(_0x6e91('0x5'));var rimraf=require(_0x6e91('0x6'));var config=require(_0x6e91('0x7'));var attributes=require(_0x6e91('0x8'));module['exports']=function(_0x3ea934,_0x315c21){return _0x3ea934[_0x6e91('0x9')](_0x6e91('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x208d=['bluebird','request-promise','path','rimraf','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','util','api'];(function(_0x2058b3,_0x1b49b4){var _0x5cae63=function(_0x59d590){while(--_0x59d590){_0x2058b3['push'](_0x2058b3['shift']());}};_0x5cae63(++_0x1b49b4);}(_0x208d,0x11c));var _0xd208=function(_0x5800a5,_0x2823f6){_0x5800a5=_0x5800a5-0x0;var _0x420c85=_0x208d[_0x5800a5];return _0x420c85;};'use strict';var _=require('lodash');var util=require(_0xd208('0x0'));var logger=require('../../config/logger')(_0xd208('0x1'));var moment=require('moment');var BPromise=require(_0xd208('0x2'));var rp=require(_0xd208('0x3'));var fs=require('fs');var path=require(_0xd208('0x4'));var rimraf=require(_0xd208('0x5'));var config=require('../../config/environment');var attributes=require(_0xd208('0x6'));module[_0xd208('0x7')]=function(_0xd88502,_0x4139be){return _0xd88502[_0xd208('0x8')](_0xd208('0x9'),attributes,{'tableName':_0xd208('0xa'),'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 022c55e..74bf667 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 _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x50af06,_0x42816d){var _0x920e66=function(_0x37e033){while(--_0x37e033){_0x50af06['push'](_0x50af06['shift']());}};_0x920e66(++_0x42816d);}(_0x55ca,0x126));var _0xa55c=function(_0x46c8fb,_0x253501){_0x46c8fb=_0x46c8fb-0x0;var _0x48f9eb=_0x55ca[_0x46c8fb];return _0x48f9eb;};'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')]('UserMailQueue,\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')]('UserMailQueue,\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);});});} \ No newline at end of file +var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x4a8845,_0x11180a){var _0xffa189=function(_0x1a2d11){while(--_0x1a2d11){_0x4a8845['push'](_0x4a8845['shift']());}};_0xffa189(++_0x11180a);}(_0xe14b,0x93));var _0xbe14=function(_0x4bac65,_0x742f8d){_0x4bac65=_0x4bac65-0x0;var _0x51b0e0=_0xe14b[_0x4bac65];return _0x51b0e0;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 7851640..ee3a042 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 _0x85c1=['Router','fs-extra','../../config/environment','./userNotification.controller','post','isAuthenticated','exports','multer','util','path','connect-timeout','express'];(function(_0x46c23f,_0x209300){var _0xda89c9=function(_0x2548e8){while(--_0x2548e8){_0x46c23f['push'](_0x46c23f['shift']());}};_0xda89c9(++_0x209300);}(_0x85c1,0x127));var _0x185c=function(_0x3eb630,_0x552586){_0x3eb630=_0x3eb630-0x0;var _0x1b840d=_0x85c1[_0x3eb630];return _0x1b840d;};'use strict';var multer=require(_0x185c('0x0'));var util=require(_0x185c('0x1'));var path=require(_0x185c('0x2'));var timeout=require(_0x185c('0x3'));var express=require(_0x185c('0x4'));var router=express[_0x185c('0x5')]();var fs_extra=require(_0x185c('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x185c('0x7'));var controller=require(_0x185c('0x8'));router[_0x185c('0x9')]('/',auth[_0x185c('0xa')](),controller['sendUserNotification']);module[_0x185c('0xb')]=router; \ No newline at end of file +var _0x21a9=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','post','isAuthenticated','sendUserNotification','exports','util','path'];(function(_0x5b32f8,_0x4d0658){var _0x50e07f=function(_0x252edb){while(--_0x252edb){_0x5b32f8['push'](_0x5b32f8['shift']());}};_0x50e07f(++_0x4d0658);}(_0x21a9,0x1ae));var _0x921a=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x21a9[_0x1cc8fe];return _0x230054;};'use strict';var multer=require('multer');var util=require(_0x921a('0x0'));var path=require(_0x921a('0x1'));var timeout=require(_0x921a('0x2'));var express=require(_0x921a('0x3'));var router=express[_0x921a('0x4')]();var fs_extra=require(_0x921a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x921a('0x6'));var config=require(_0x921a('0x7'));var controller=require('./userNotification.controller');router[_0x921a('0x8')]('/',auth[_0x921a('0x9')](),controller[_0x921a('0xa')]);module[_0x921a('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 98631cf..6e3d848 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 _0x2058=['exports','TEXT','STRING','BOOLEAN'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2058,0xe0));var _0x8205=function(_0x5b47d9,_0x1327ce){_0x5b47d9=_0x5b47d9-0x0;var _0x4151f0=_0x2058[_0x5b47d9];return _0x4151f0;};'use strict';var Sequelize=require('sequelize');module[_0x8205('0x0')]={'body':{'type':Sequelize[_0x8205('0x1')]},'senderName':{'type':Sequelize[_0x8205('0x2')]},'recipientsId':{'type':Sequelize[_0x8205('0x1')]},'recipientsDescription':{'type':Sequelize[_0x8205('0x2')]},'beep':{'type':Sequelize[_0x8205('0x3')]}}; \ No newline at end of file +var _0x92bc=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x51606b,_0x112eb0){var _0x3ea25c=function(_0x29c56f){while(--_0x29c56f){_0x51606b['push'](_0x51606b['shift']());}};_0x3ea25c(++_0x112eb0);}(_0x92bc,0x117));var _0xc92b=function(_0x1ba92e,_0x518215){_0x1ba92e=_0x1ba92e-0x0;var _0x5a313b=_0x92bc[_0x1ba92e];return _0x5a313b;};'use strict';var Sequelize=require(_0xc92b('0x0'));module[_0xc92b('0x1')]={'body':{'type':Sequelize[_0xc92b('0x2')]},'senderName':{'type':Sequelize[_0xc92b('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0xc92b('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 6f91b97..f4bbfc9 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 _0xc085=['union','ids','queue','replace','Queue','push','all','flatten','getAgents','map','rimraf','moment','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./userNotification.socket','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','sendUserNotification','text','body','TemplateId','Sequelize','ValidationError','hasOwnProperty','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','voicequeue','whatsappqueue','team','user','some','model','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','transaction','UserNotification','create','emit','userNotification:send','catch','render','html','forEach','startCase','toLowerCase','User'];(function(_0x5a2add,_0x4acfdc){var _0x2a644b=function(_0x54f4d4){while(--_0x54f4d4){_0x5a2add['push'](_0x5a2add['shift']());}};_0x2a644b(++_0x4acfdc);}(_0xc085,0x1ea));var _0x5c08=function(_0x4676a0,_0x5e96e8){_0x4676a0=_0x4676a0-0x0;var _0x5a81b8=_0xc085[_0x4676a0];return _0x5a81b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c08('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5c08('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5c08('0x2'));var path=require(_0x5c08('0x3'));var sox=require(_0x5c08('0x4'));var csv=require(_0x5c08('0x5'));var ejs=require(_0x5c08('0x6'));var fs=require('fs');var fs_extra=require(_0x5c08('0x7'));var _=require(_0x5c08('0x8'));var squel=require(_0x5c08('0x9'));var crypto=require(_0x5c08('0xa'));var jsforce=require(_0x5c08('0xb'));var deskjs=require(_0x5c08('0xc'));var toCsv=require(_0x5c08('0x5'));var querystring=require(_0x5c08('0xd'));var Papa=require(_0x5c08('0xe'));var Redis=require('ioredis');var authService=require(_0x5c08('0xf'));var qs=require(_0x5c08('0x10'));var as=require(_0x5c08('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c08('0x12'))(_0x5c08('0x13'));var utils=require(_0x5c08('0x14'));var config=require(_0x5c08('0x15'));var licenseUtil=require(_0x5c08('0x16'));var db=require('../../mysqldb')['db'];config[_0x5c08('0x17')]=_[_0x5c08('0x18')](config[_0x5c08('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x5c08('0x19'))(new Redis(config[_0x5c08('0x17')]));require(_0x5c08('0x1a'))['register'](socket);function respondWithStatusCode(_0x1d59e8,_0x2e8f94){_0x2e8f94=_0x2e8f94||0xcc;return function(_0x3723c4){if(_0x3723c4){return _0x1d59e8[_0x5c08('0x1b')](_0x2e8f94);}return _0x1d59e8[_0x5c08('0x1c')](_0x2e8f94)['end']();};}function respondWithResult(_0x316a2e,_0x302e26){_0x302e26=_0x302e26||0xc8;return function(_0x4b03d1){if(_0x4b03d1){return _0x316a2e[_0x5c08('0x1c')](_0x302e26)[_0x5c08('0x1d')](_0x4b03d1);}};}function respondWithFilteredResult(_0x2666ec,_0x214cb3){return function(_0x4373e9){if(_0x4373e9){var _0x23b377=typeof _0x214cb3[_0x5c08('0x1e')]===_0x5c08('0x1f')&&typeof _0x214cb3[_0x5c08('0x20')]==='undefined';var _0x191a61=_0x4373e9[_0x5c08('0x21')];var _0x2a2b08=_0x23b377?0x0:_0x214cb3['offset'];var _0x5442df=_0x23b377?_0x4373e9['count']:_0x214cb3[_0x5c08('0x1e')]+_0x214cb3[_0x5c08('0x20')];var _0x5ca0fc;if(_0x5442df>=_0x191a61){_0x5442df=_0x191a61;_0x5ca0fc=0xc8;}else{_0x5ca0fc=0xce;}_0x2666ec[_0x5c08('0x1c')](_0x5ca0fc);return _0x2666ec['set'](_0x5c08('0x22'),_0x2a2b08+'-'+_0x5442df+'/'+_0x191a61)[_0x5c08('0x1d')](_0x4373e9);}return null;};}function patchUpdates(_0x2c069f){return function(_0x394778){try{jsonpatch[_0x5c08('0x23')](_0x394778,_0x2c069f,!![]);}catch(_0x533990){return BPromise[_0x5c08('0x24')](_0x533990);}return _0x394778['save']();};}function saveUpdates(_0x3f5330,_0x5c6458){return function(_0x1401f7){if(_0x1401f7){return _0x1401f7[_0x5c08('0x25')](_0x3f5330)[_0x5c08('0x26')](function(_0x42b975){return _0x42b975;});}return null;};}function removeEntity(_0x1b3e47,_0x17a6db){return function(_0x12634c){if(_0x12634c){return _0x12634c[_0x5c08('0x27')]()[_0x5c08('0x26')](function(){_0x1b3e47[_0x5c08('0x1c')](0xcc)[_0x5c08('0x28')]();});}};}function handleEntityNotFound(_0x355a99,_0x4606c9){return function(_0x5babe0){if(!_0x5babe0){_0x355a99['sendStatus'](0x194);}return _0x5babe0;};}function handleError(_0x47dbdb,_0x26f7c8){_0x26f7c8=_0x26f7c8||0x1f4;return function(_0x12300d){logger['error'](_0x12300d[_0x5c08('0x29')]);if(_0x12300d[_0x5c08('0x2a')]){delete _0x12300d[_0x5c08('0x2a')];}_0x47dbdb[_0x5c08('0x1c')](_0x26f7c8)[_0x5c08('0x2b')](_0x12300d);};}exports[_0x5c08('0x2c')]=function(_0x20036b,_0x2c5cd0,_0x2882a1){if(!_0x20036b['body']['hasOwnProperty'](_0x5c08('0x2d'))&&!_0x20036b[_0x5c08('0x2e')]['hasOwnProperty'](_0x5c08('0x2f'))){throw new db[(_0x5c08('0x30'))][(_0x5c08('0x31'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x20036b['body'][_0x5c08('0x32')](_0x5c08('0x2f'))&&!_0x20036b[_0x5c08('0x2e')][_0x5c08('0x32')](_0x5c08('0x33'))){throw new db['Sequelize'][(_0x5c08('0x31'))](_0x5c08('0x34'));}if(!_0x20036b[_0x5c08('0x2e')][_0x5c08('0x32')](_0x5c08('0x35'))){throw new db['Sequelize'][(_0x5c08('0x31'))](_0x5c08('0x36'));}else{try{var _0x42c41e=JSON[_0x5c08('0x37')](_0x20036b[_0x5c08('0x2e')][_0x5c08('0x35')]);}catch(_0x161337){logger[_0x5c08('0x38')](_0x161337);throw new db[(_0x5c08('0x30'))][(_0x5c08('0x31'))](_0x5c08('0x39'));}var _0x3b6669=[_0x5c08('0x3a'),'faxqueue',_0x5c08('0x3b'),'openchannelqueue','smsqueue',_0x5c08('0x3c'),_0x5c08('0x3d'),_0x5c08('0x3e'),_0x5c08('0x3f')];if(_[_0x5c08('0x40')](_0x42c41e,function(_0x43cf07){return!_['includes'](_0x3b6669,_0x43cf07[_0x5c08('0x41')]['toLowerCase']());})){throw new db[(_0x5c08('0x30'))][(_0x5c08('0x31'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x4f54e5={};_0x4f54e5['senderName']=_0x20036b['body']['hasOwnProperty']('senderName')?_0x20036b[_0x5c08('0x2e')][_0x5c08('0x42')]:_0x20036b[_0x5c08('0x3f')][_0x5c08('0x43')];_0x4f54e5['recipientsDescription']=_[_0x5c08('0x44')](_0x20036b['body']['recipientsDescription'])?null:_0x20036b[_0x5c08('0x2e')][_0x5c08('0x45')];_0x4f54e5[_0x5c08('0x46')]=_0x20036b['body'][_0x5c08('0x46')]||![];_0x4f54e5[_0x5c08('0x47')]=_0x20036b['user']['id'];return getContent(_0x20036b[_0x5c08('0x2e')])[_0x5c08('0x26')](function(_0x142271){_0x4f54e5['body']=_0x142271;return getRecipients(_0x42c41e);})[_0x5c08('0x26')](function(_0x2088f6){_0x4f54e5[_0x5c08('0x48')]=_[_0x5c08('0x49')](_0x2088f6)['join'](',');return db['sequelize'][_0x5c08('0x4a')](function(_0x25c77f){return db[_0x5c08('0x4b')][_0x5c08('0x4c')](_0x4f54e5,{'raw':!![],'transaction':_0x25c77f})[_0x5c08('0x26')](function(_0x157831){var _0x37280e={'sender':_0x4f54e5[_0x5c08('0x42')],'description':_0x4f54e5[_0x5c08('0x45')],'content':_0x4f54e5['body'],'beep':_0x4f54e5[_0x5c08('0x46')]};_0x2088f6['forEach'](function(_0xcc7383){_0x37280e['recipient']=_0xcc7383;socket[_0x5c08('0x4d')](_0x5c08('0x4e'),_0x37280e);});return _0x157831;});});})[_0x5c08('0x26')](respondWithResult(_0x2c5cd0,0xc9))[_0x5c08('0x4f')](handleError(_0x2c5cd0,null));};function getContent(_0x100332){return new BPromise(function(_0xb46615,_0x5b6a34){if(_0x100332[_0x5c08('0x2d')]){_0xb46615(_0x100332[_0x5c08('0x2d')]);return;}return db['Template']['findOne']({'attributes':['html'],'where':{'id':_0x100332[_0x5c08('0x2f')]},'raw':!![]})['then'](function(_0x45908d){if(!_0x45908d)throw new db[(_0x5c08('0x30'))][(_0x5c08('0x31'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x151627=Mustache[_0x5c08('0x50')](_0x45908d[_0x5c08('0x51')],_0x100332[_0x5c08('0x33')]);_0xb46615(_0x151627);})[_0x5c08('0x4f')](function(_0x2e061c){_0x5b6a34(_0x2e061c);});});}function getRecipients(_0x14ab49){return new BPromise(function(_0x11bddc,_0x504a2a){var _0x236f68=[];var _0x3baf44=[];_0x14ab49[_0x5c08('0x52')](function(_0x5667e9){var _0x5545c0=_[_0x5c08('0x53')](_0x5667e9['model'][_0x5c08('0x54')]());if(_0x5545c0===_0x5c08('0x55')){_0x236f68=_[_0x5c08('0x56')](_0x236f68,_0x5667e9[_0x5c08('0x57')]);}else{if(_['includes'](_0x5545c0,_0x5c08('0x58')))_0x5545c0=_0x5545c0[_0x5c08('0x59')](_0x5c08('0x58'),_0x5c08('0x5a'));_0x5667e9[_0x5c08('0x57')][_0x5c08('0x52')](function(_0x34299e){_0x3baf44[_0x5c08('0x5b')](getAgents(_0x5545c0,_0x34299e));});}});return BPromise[_0x5c08('0x5c')](_0x3baf44)[_0x5c08('0x26')](function(_0x22f756){_0x236f68=_['union'](_0x236f68,_[_0x5c08('0x5d')](_0x22f756));_0x11bddc(_0x236f68);})[_0x5c08('0x4f')](function(_0x58e5a8){_0x504a2a(_0x58e5a8);});});}function getAgents(_0x1ecaa6,_0x32eb91){return new BPromise(function(_0x3e8f0a,_0x3b571d){return db[_0x1ecaa6]['findOne']({'where':{'id':_0x32eb91}})[_0x5c08('0x26')](function(_0x563270){return _0x563270[_0x5c08('0x5e')]({'attributes':['id'],'raw':!![]})[_0x5c08('0x26')](function(_0x581063){var _0x10820a=_[_0x5c08('0x5f')](_0x581063,'id');_0x3e8f0a(_0x10820a);});})[_0x5c08('0x4f')](function(_0x3e0acd){_0x3b571d(_0x3e0acd);});});} \ No newline at end of file +var _0xe8be=['reject','save','update','destroy','then','error','stack','name','send','sendUserNotification','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','recipients','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','team','some','includes','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','SenderId','user','recipientsId','sortBy','join','sequelize','UserNotification','create','beep','forEach','recipient','userNotification:send','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','model','toLowerCase','User','union','ids','queue','Queue','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply'];(function(_0x4fab75,_0x398990){var _0x739298=function(_0x40943a){while(--_0x40943a){_0x4fab75['push'](_0x4fab75['shift']());}};_0x739298(++_0x398990);}(_0xe8be,0x174));var _0xee8b=function(_0x3f6e26,_0x811a34){_0x3f6e26=_0x3f6e26-0x0;var _0x474345=_0xe8be[_0x3f6e26];return _0x474345;};'use strict';var emlformat=require(_0xee8b('0x0'));var rimraf=require(_0xee8b('0x1'));var zipdir=require(_0xee8b('0x2'));var jsonpatch=require(_0xee8b('0x3'));var rp=require(_0xee8b('0x4'));var moment=require('moment');var BPromise=require(_0xee8b('0x5'));var Mustache=require(_0xee8b('0x6'));var util=require(_0xee8b('0x7'));var path=require(_0xee8b('0x8'));var sox=require(_0xee8b('0x9'));var csv=require(_0xee8b('0xa'));var ejs=require(_0xee8b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xee8b('0xc'));var crypto=require(_0xee8b('0xd'));var jsforce=require(_0xee8b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xee8b('0xa'));var querystring=require(_0xee8b('0xf'));var Papa=require('papaparse');var Redis=require(_0xee8b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xee8b('0x11'));var hardwareService=require(_0xee8b('0x12'));var logger=require(_0xee8b('0x13'))(_0xee8b('0x14'));var utils=require(_0xee8b('0x15'));var config=require(_0xee8b('0x16'));var licenseUtil=require(_0xee8b('0x17'));var db=require('../../mysqldb')['db'];config[_0xee8b('0x18')]=_[_0xee8b('0x19')](config[_0xee8b('0x18')],{'host':_0xee8b('0x1a'),'port':0x18eb});var socket=require(_0xee8b('0x1b'))(new Redis(config['redis']));require(_0xee8b('0x1c'))['register'](socket);function respondWithStatusCode(_0x35ef35,_0x594633){_0x594633=_0x594633||0xcc;return function(_0x21586f){if(_0x21586f){return _0x35ef35[_0xee8b('0x1d')](_0x594633);}return _0x35ef35[_0xee8b('0x1e')](_0x594633)[_0xee8b('0x1f')]();};}function respondWithResult(_0x336713,_0x4ae1d6){_0x4ae1d6=_0x4ae1d6||0xc8;return function(_0x5a46e9){if(_0x5a46e9){return _0x336713[_0xee8b('0x1e')](_0x4ae1d6)['json'](_0x5a46e9);}};}function respondWithFilteredResult(_0x5ecc3c,_0x15345c){return function(_0x595de3){if(_0x595de3){var _0x421e86=typeof _0x15345c['offset']===_0xee8b('0x20')&&typeof _0x15345c[_0xee8b('0x21')]==='undefined';var _0x5bd8e9=_0x595de3[_0xee8b('0x22')];var _0x431c0d=_0x421e86?0x0:_0x15345c[_0xee8b('0x23')];var _0x32627c=_0x421e86?_0x595de3[_0xee8b('0x22')]:_0x15345c[_0xee8b('0x23')]+_0x15345c[_0xee8b('0x21')];var _0x240e27;if(_0x32627c>=_0x5bd8e9){_0x32627c=_0x5bd8e9;_0x240e27=0xc8;}else{_0x240e27=0xce;}_0x5ecc3c[_0xee8b('0x1e')](_0x240e27);return _0x5ecc3c[_0xee8b('0x24')](_0xee8b('0x25'),_0x431c0d+'-'+_0x32627c+'/'+_0x5bd8e9)[_0xee8b('0x26')](_0x595de3);}return null;};}function patchUpdates(_0x16fe11){return function(_0xdfb4f1){try{jsonpatch[_0xee8b('0x27')](_0xdfb4f1,_0x16fe11,!![]);}catch(_0x5d7ade){return BPromise[_0xee8b('0x28')](_0x5d7ade);}return _0xdfb4f1[_0xee8b('0x29')]();};}function saveUpdates(_0x4a878e,_0x57649e){return function(_0x227b9b){if(_0x227b9b){return _0x227b9b[_0xee8b('0x2a')](_0x4a878e)['then'](function(_0x4df8e7){return _0x4df8e7;});}return null;};}function removeEntity(_0x538c08,_0x3e6657){return function(_0x2f097c){if(_0x2f097c){return _0x2f097c[_0xee8b('0x2b')]()[_0xee8b('0x2c')](function(){_0x538c08['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xdb7861,_0x27fe44){return function(_0x385481){if(!_0x385481){_0xdb7861['sendStatus'](0x194);}return _0x385481;};}function handleError(_0x40a6a0,_0x39c5d8){_0x39c5d8=_0x39c5d8||0x1f4;return function(_0x4b12a6){logger[_0xee8b('0x2d')](_0x4b12a6[_0xee8b('0x2e')]);if(_0x4b12a6['name']){delete _0x4b12a6[_0xee8b('0x2f')];}_0x40a6a0[_0xee8b('0x1e')](_0x39c5d8)[_0xee8b('0x30')](_0x4b12a6);};}exports[_0xee8b('0x31')]=function(_0x5f3fb8,_0x20753f,_0x2c95f7){if(!_0x5f3fb8[_0xee8b('0x32')][_0xee8b('0x33')](_0xee8b('0x34'))&&!_0x5f3fb8[_0xee8b('0x32')][_0xee8b('0x33')](_0xee8b('0x35'))){throw new db[(_0xee8b('0x36'))][(_0xee8b('0x37'))](_0xee8b('0x38'));}else{if(_0x5f3fb8[_0xee8b('0x32')][_0xee8b('0x33')](_0xee8b('0x35'))&&!_0x5f3fb8[_0xee8b('0x32')][_0xee8b('0x33')](_0xee8b('0x39'))){throw new db[(_0xee8b('0x36'))]['ValidationError'](_0xee8b('0x3a'));}if(!_0x5f3fb8[_0xee8b('0x32')][_0xee8b('0x33')](_0xee8b('0x3b'))){throw new db['Sequelize'][(_0xee8b('0x37'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x42db06=JSON[_0xee8b('0x3c')](_0x5f3fb8[_0xee8b('0x32')]['recipients']);}catch(_0x54028d){logger[_0xee8b('0x2d')](_0x54028d);throw new db[(_0xee8b('0x36'))][(_0xee8b('0x37'))](_0xee8b('0x3d'));}var _0x360d9a=[_0xee8b('0x3e'),_0xee8b('0x3f'),_0xee8b('0x40'),_0xee8b('0x41'),_0xee8b('0x42'),_0xee8b('0x43'),'whatsappqueue',_0xee8b('0x44'),'user'];if(_[_0xee8b('0x45')](_0x42db06,function(_0x3218e9){return!_[_0xee8b('0x46')](_0x360d9a,_0x3218e9['model']['toLowerCase']());})){throw new db[(_0xee8b('0x36'))][(_0xee8b('0x37'))](_0xee8b('0x47'));}}}var _0xf83db0={};_0xf83db0[_0xee8b('0x48')]=_0x5f3fb8['body']['hasOwnProperty'](_0xee8b('0x48'))?_0x5f3fb8['body'][_0xee8b('0x48')]:_0x5f3fb8['user'][_0xee8b('0x49')];_0xf83db0[_0xee8b('0x4a')]=_[_0xee8b('0x4b')](_0x5f3fb8[_0xee8b('0x32')]['recipientsDescription'])?null:_0x5f3fb8[_0xee8b('0x32')][_0xee8b('0x4a')];_0xf83db0['beep']=_0x5f3fb8[_0xee8b('0x32')]['beep']||![];_0xf83db0[_0xee8b('0x4c')]=_0x5f3fb8[_0xee8b('0x4d')]['id'];return getContent(_0x5f3fb8[_0xee8b('0x32')])[_0xee8b('0x2c')](function(_0x2e29ad){_0xf83db0[_0xee8b('0x32')]=_0x2e29ad;return getRecipients(_0x42db06);})[_0xee8b('0x2c')](function(_0x34554f){_0xf83db0[_0xee8b('0x4e')]=_[_0xee8b('0x4f')](_0x34554f)[_0xee8b('0x50')](',');return db[_0xee8b('0x51')]['transaction'](function(_0x3fe47d){return db[_0xee8b('0x52')][_0xee8b('0x53')](_0xf83db0,{'raw':!![],'transaction':_0x3fe47d})['then'](function(_0xdb0ce4){var _0x276caf={'sender':_0xf83db0[_0xee8b('0x48')],'description':_0xf83db0[_0xee8b('0x4a')],'content':_0xf83db0[_0xee8b('0x32')],'beep':_0xf83db0[_0xee8b('0x54')]};_0x34554f[_0xee8b('0x55')](function(_0x4450aa){_0x276caf[_0xee8b('0x56')]=_0x4450aa;socket['emit'](_0xee8b('0x57'),_0x276caf);});return _0xdb0ce4;});});})['then'](respondWithResult(_0x20753f,0xc9))[_0xee8b('0x58')](handleError(_0x20753f,null));};function getContent(_0x27c6dd){return new BPromise(function(_0x22ab31,_0x4324a3){if(_0x27c6dd[_0xee8b('0x34')]){_0x22ab31(_0x27c6dd['text']);return;}return db[_0xee8b('0x59')][_0xee8b('0x5a')]({'attributes':['html'],'where':{'id':_0x27c6dd[_0xee8b('0x35')]},'raw':!![]})[_0xee8b('0x2c')](function(_0x176aca){if(!_0x176aca)throw new db[(_0xee8b('0x36'))][(_0xee8b('0x37'))](_0xee8b('0x5b'));var _0xc35a9c=Mustache['render'](_0x176aca['html'],_0x27c6dd[_0xee8b('0x39')]);_0x22ab31(_0xc35a9c);})[_0xee8b('0x58')](function(_0x3a0b4d){_0x4324a3(_0x3a0b4d);});});}function getRecipients(_0x507ea4){return new BPromise(function(_0x280392,_0x1dda87){var _0x39239e=[];var _0x3db63c=[];_0x507ea4[_0xee8b('0x55')](function(_0xedb37){var _0x346458=_['startCase'](_0xedb37[_0xee8b('0x5c')][_0xee8b('0x5d')]());if(_0x346458===_0xee8b('0x5e')){_0x39239e=_[_0xee8b('0x5f')](_0x39239e,_0xedb37[_0xee8b('0x60')]);}else{if(_[_0xee8b('0x46')](_0x346458,_0xee8b('0x61')))_0x346458=_0x346458['replace'](_0xee8b('0x61'),_0xee8b('0x62'));_0xedb37['ids'][_0xee8b('0x55')](function(_0x3ea25f){_0x3db63c['push'](getAgents(_0x346458,_0x3ea25f));});}});return BPromise[_0xee8b('0x63')](_0x3db63c)['then'](function(_0x2902c2){_0x39239e=_[_0xee8b('0x5f')](_0x39239e,_[_0xee8b('0x64')](_0x2902c2));_0x280392(_0x39239e);})[_0xee8b('0x58')](function(_0x2d0108){_0x1dda87(_0x2d0108);});});}function getAgents(_0x5db551,_0x5d8ca7){return new BPromise(function(_0xf1ddca,_0x3b8511){return db[_0x5db551][_0xee8b('0x5a')]({'where':{'id':_0x5d8ca7}})[_0xee8b('0x2c')](function(_0x7c641b){return _0x7c641b[_0xee8b('0x65')]({'attributes':['id'],'raw':!![]})[_0xee8b('0x2c')](function(_0x400791){var _0x1087a7=_[_0xee8b('0x66')](_0x400791,'id');_0xf1ddca(_0x1087a7);});})[_0xee8b('0x58')](function(_0x3f9e49){_0x3b8511(_0x3f9e49);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 13292d9..3ef5996 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 _0xb0ea=['setMaxListeners','save','update','remove','emit','hook','exports','events','UserNotification'];(function(_0x3c3996,_0x5df990){var _0x51aaac=function(_0x3c2d21){while(--_0x3c2d21){_0x3c3996['push'](_0x3c3996['shift']());}};_0x51aaac(++_0x5df990);}(_0xb0ea,0x16f));var _0xab0e=function(_0x26a351,_0x5dd04c){_0x26a351=_0x26a351-0x0;var _0x1ef7fe=_0xb0ea[_0x26a351];return _0x1ef7fe;};'use strict';var EventEmitter=require(_0xab0e('0x0'));var UserNotification=require('../../mysqldb')['db'][_0xab0e('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xab0e('0x2')](0x0);var events={'afterCreate':_0xab0e('0x3'),'afterUpdate':_0xab0e('0x4'),'afterDestroy':_0xab0e('0x5')};function emitEvent(_0xe653ce){return function(_0x4a6732,_0x10f7e0,_0x5cf1e0){UserNotificationEvents[_0xab0e('0x6')](_0xe653ce+':'+_0x4a6732['id'],_0x4a6732);UserNotificationEvents[_0xab0e('0x6')](_0xe653ce,_0x4a6732);_0x5cf1e0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xab0e('0x7')](e,emitEvent(event));}}module[_0xab0e('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0xf54a=['exports','../../mysqldb','UserNotification','emit','hasOwnProperty','hook'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0xf54a,0x11b));var _0xaf54=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf54a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0xaf54('0x0'))['db'][_0xaf54('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1a5044){return function(_0x41ff17,_0x596b64,_0x30af71){UserNotificationEvents[_0xaf54('0x2')](_0x1a5044+':'+_0x41ff17['id'],_0x41ff17);UserNotificationEvents[_0xaf54('0x2')](_0x1a5044,_0x41ff17);_0x30af71(null);};}for(var e in events){if(events[_0xaf54('0x3')](e)){var event=events[e];UserNotification[_0xaf54('0x4')](e,emitEvent(event));}}module[_0xaf54('0x5')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index cb23381..da950b9 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 _0x11c1=['bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','userNotifications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x3b1ebe,_0x271afa){var _0x2d9c47=function(_0x4b290a){while(--_0x4b290a){_0x3b1ebe['push'](_0x3b1ebe['shift']());}};_0x2d9c47(++_0x271afa);}(_0x11c1,0x119));var _0x111c=function(_0x99d4d7,_0x1a79ea){_0x99d4d7=_0x99d4d7-0x0;var _0x6af61f=_0x11c1[_0x99d4d7];return _0x6af61f;};'use strict';var _=require('lodash');var util=require(_0x111c('0x0'));var logger=require(_0x111c('0x1'))(_0x111c('0x2'));var moment=require(_0x111c('0x3'));var BPromise=require(_0x111c('0x4'));var rp=require(_0x111c('0x5'));var fs=require('fs');var path=require(_0x111c('0x6'));var rimraf=require(_0x111c('0x7'));var config=require(_0x111c('0x8'));var attributes=require(_0x111c('0x9'));module[_0x111c('0xa')]=function(_0x3d3bfd,_0x2841f0){return _0x3d3bfd[_0x111c('0xb')]('UserNotification',attributes,{'tableName':_0x111c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x111c('0xd'),'collate':_0x111c('0xe')});}; \ No newline at end of file +var _0x655c=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./userNotification.attributes','UserNotification','userNotifications','utf8mb4'];(function(_0x4d7563,_0x4c3f27){var _0x44946b=function(_0x27798a){while(--_0x27798a){_0x4d7563['push'](_0x4d7563['shift']());}};_0x44946b(++_0x4c3f27);}(_0x655c,0x6c));var _0xc655=function(_0x26f2a3,_0xdec8ff){_0x26f2a3=_0x26f2a3-0x0;var _0x3a4bd3=_0x655c[_0x26f2a3];return _0x3a4bd3;};'use strict';var _=require(_0xc655('0x0'));var util=require(_0xc655('0x1'));var logger=require(_0xc655('0x2'))(_0xc655('0x3'));var moment=require(_0xc655('0x4'));var BPromise=require(_0xc655('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc655('0x6'));var config=require(_0xc655('0x7'));var attributes=require(_0xc655('0x8'));module['exports']=function(_0x2b6d8c,_0x472667){return _0x2b6d8c['define'](_0xc655('0x9'),attributes,{'tableName':_0xc655('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc655('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index bb25db7..d107a88 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 _0xbac2=['../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','code','error','UserNotification,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x46bcae,_0x5d0f07){var _0x1a13cf=function(_0x3afe3a){while(--_0x3afe3a){_0x46bcae['push'](_0x46bcae['shift']());}};_0x1a13cf(++_0x5d0f07);}(_0xbac2,0x1ba));var _0x2bac=function(_0x2211ed,_0x1bca0b){_0x2211ed=_0x2211ed-0x0;var _0x4d78cc=_0xbac2[_0x2211ed];return _0x4d78cc;};'use strict';var _=require(_0x2bac('0x0'));var util=require(_0x2bac('0x1'));var moment=require(_0x2bac('0x2'));var BPromise=require(_0x2bac('0x3'));var rs=require(_0x2bac('0x4'));var fs=require('fs');var Redis=require(_0x2bac('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2bac('0x6'));var logger=require(_0x2bac('0x7'))('rpc');var config=require(_0x2bac('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2bac('0x9')][_0x2bac('0xa')]({'port':0x232a});config[_0x2bac('0xb')]=_[_0x2bac('0xc')](config['redis'],{'host':_0x2bac('0xd'),'port':0x18eb});var socket=require(_0x2bac('0xe'))(new Redis(config[_0x2bac('0xb')]));require('./userNotification.socket')[_0x2bac('0xf')](socket);function respondWithRpcPromise(_0x5e7ea3,_0x411787,_0x245731){return new BPromise(function(_0x2648eb,_0x32a6ce){return client[_0x2bac('0x10')](_0x5e7ea3,_0x245731)[_0x2bac('0x11')](function(_0x209c31){logger[_0x2bac('0x12')]('UserNotification,\x20%s,\x20%s',_0x411787,_0x2bac('0x13'));logger['debug'](_0x2bac('0x14'),_0x411787,_0x2bac('0x13'),JSON[_0x2bac('0x15')](_0x209c31));if(_0x209c31['error']){if(_0x209c31['error'][_0x2bac('0x16')]===0x1f4){logger[_0x2bac('0x17')](_0x2bac('0x18'),_0x411787,_0x209c31['error'][_0x2bac('0x19')]);return _0x32a6ce(_0x209c31['error'][_0x2bac('0x19')]);}logger[_0x2bac('0x17')](_0x2bac('0x18'),_0x411787,_0x209c31[_0x2bac('0x17')]['message']);return _0x2648eb(_0x209c31[_0x2bac('0x17')][_0x2bac('0x19')]);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x411787,_0x2bac('0x13'));_0x2648eb(_0x209c31[_0x2bac('0x1a')][_0x2bac('0x19')]);}})[_0x2bac('0x1b')](function(_0x47b3a0){logger[_0x2bac('0x17')](_0x2bac('0x18'),_0x411787,_0x47b3a0);_0x32a6ce(_0x47b3a0);});});} \ No newline at end of file +var _0x793f=['info','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UserNotification,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./userNotification.socket','register','request','then'];(function(_0x494cbb,_0x470317){var _0x4eaba5=function(_0x11197b){while(--_0x11197b){_0x494cbb['push'](_0x494cbb['shift']());}};_0x4eaba5(++_0x470317);}(_0x793f,0x73));var _0xf793=function(_0x2a6d34,_0x4da937){_0x2a6d34=_0x2a6d34-0x0;var _0x2b500c=_0x793f[_0x2a6d34];return _0x2b500c;};'use strict';var _=require(_0xf793('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf793('0x1'));var rs=require(_0xf793('0x2'));var fs=require('fs');var Redis=require(_0xf793('0x3'));var db=require(_0xf793('0x4'))['db'];var utils=require(_0xf793('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf793('0x6'));var jayson=require(_0xf793('0x7'));var client=jayson[_0xf793('0x8')]['http']({'port':0x232a});config[_0xf793('0x9')]=_['defaults'](config[_0xf793('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xf793('0xa'))(new Redis(config[_0xf793('0x9')]));require(_0xf793('0xb'))[_0xf793('0xc')](socket);function respondWithRpcPromise(_0x2ad4d6,_0x2508f3,_0x4bb5c4){return new BPromise(function(_0x2d816f,_0x45ad96){return client[_0xf793('0xd')](_0x2ad4d6,_0x4bb5c4)[_0xf793('0xe')](function(_0x497156){logger[_0xf793('0xf')]('UserNotification,\x20%s,\x20%s',_0x2508f3,'request\x20sent');logger[_0xf793('0x10')](_0xf793('0x11'),_0x2508f3,_0xf793('0x12'),JSON[_0xf793('0x13')](_0x497156));if(_0x497156[_0xf793('0x14')]){if(_0x497156['error'][_0xf793('0x15')]===0x1f4){logger[_0xf793('0x14')]('UserNotification,\x20%s,\x20%s',_0x2508f3,_0x497156[_0xf793('0x14')][_0xf793('0x16')]);return _0x45ad96(_0x497156[_0xf793('0x14')][_0xf793('0x16')]);}logger[_0xf793('0x14')]('UserNotification,\x20%s,\x20%s',_0x2508f3,_0x497156[_0xf793('0x14')][_0xf793('0x16')]);return _0x2d816f(_0x497156[_0xf793('0x14')]['message']);}else{logger[_0xf793('0xf')](_0xf793('0x17'),_0x2508f3,'request\x20sent');_0x2d816f(_0x497156[_0xf793('0x18')][_0xf793('0x16')]);}})[_0xf793('0x19')](function(_0x4bb97f){logger['error'](_0xf793('0x17'),_0x2508f3,_0x4bb97f);_0x45ad96(_0x4bb97f);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 9f94fba..dbcfc5a 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 _0xdfa9=['userNotification:','./userNotification.events','remove','update','removeListener','length'];(function(_0x36a6b2,_0x50f305){var _0x1c5818=function(_0x1ac1a7){while(--_0x1ac1a7){_0x36a6b2['push'](_0x36a6b2['shift']());}};_0x1c5818(++_0x50f305);}(_0xdfa9,0x9d));var _0x9dfa=function(_0x50e4df,_0x3a41ea){_0x50e4df=_0x50e4df-0x0;var _0x4d25b0=_0xdfa9[_0x50e4df];return _0x4d25b0;};'use strict';var UserNotificationEvents=require(_0x9dfa('0x0'));var events=['save',_0x9dfa('0x1'),_0x9dfa('0x2')];function createListener(_0x569c81,_0x446659){return function(_0x57f925){_0x446659['emit'](_0x569c81,_0x57f925);};}function removeListener(_0x1532bf,_0x306fc4){return function(){UserNotificationEvents[_0x9dfa('0x3')](_0x1532bf,_0x306fc4);};}exports['register']=function(_0x378905){for(var _0x339613=0x0,_0xf35ca1=events[_0x9dfa('0x4')];_0x339613<_0xf35ca1;_0x339613++){var _0x2f3664=events[_0x339613];var _0x3639eb=createListener(_0x9dfa('0x5')+_0x2f3664,_0x378905);UserNotificationEvents['on'](_0x2f3664,_0x3639eb);}}; \ No newline at end of file +var _0x006e=['emit','userNotification:','remove'];(function(_0x53ad58,_0x3fb489){var _0x554b03=function(_0x5769ba){while(--_0x5769ba){_0x53ad58['push'](_0x53ad58['shift']());}};_0x554b03(++_0x3fb489);}(_0x006e,0x86));var _0xe006=function(_0x183a19,_0x36dace){_0x183a19=_0x183a19-0x0;var _0x5e2ba3=_0x006e[_0x183a19];return _0x5e2ba3;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=['save',_0xe006('0x0'),'update'];function createListener(_0x53e696,_0x5ce643){return function(_0x5e4acc){_0x5ce643[_0xe006('0x1')](_0x53e696,_0x5e4acc);};}function removeListener(_0x590c21,_0x475f82){return function(){UserNotificationEvents['removeListener'](_0x590c21,_0x475f82);};}exports['register']=function(_0x3a61d5){for(var _0x3bd97d=0x0,_0x4b218e=events['length'];_0x3bd97d<_0x4b218e;_0x3bd97d++){var _0x5f3f83=events[_0x3bd97d];var _0x8f7838=createListener(_0xe006('0x2')+_0x5f3f83,_0x3a61d5);UserNotificationEvents['on'](_0x5f3f83,_0x8f7838);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index fc9818f..8e749d1 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x226a9b,_0x4ec9c5){var _0x3347f4=function(_0x26b1a0){while(--_0x26b1a0){_0x226a9b['push'](_0x226a9b['shift']());}};_0x3347f4(++_0x4ec9c5);}(_0x70e0,0x17b));var _0x070e=function(_0x36949d,_0x53c391){_0x36949d=_0x36949d-0x0;var _0xe3c78f=_0x70e0[_0x36949d];return _0xe3c78f;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x237eef,_0x5a7753){var _0x370c86=function(_0x3d6c2d){while(--_0x3d6c2d){_0x237eef['push'](_0x237eef['shift']());}};_0x370c86(++_0x5a7753);}(_0x70e0,0x17b));var _0x070e=function(_0x40a845,_0x5024da){_0x40a845=_0x40a845-0x0;var _0x53a3ac=_0x70e0[_0x40a845];return _0x53a3ac;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index f1a3e16..0b7f46e 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 _0x266d=['INTEGER'];(function(_0x2e99b2,_0x364efc){var _0x8b1a67=function(_0x11212f){while(--_0x11212f){_0x2e99b2['push'](_0x2e99b2['shift']());}};_0x8b1a67(++_0x364efc);}(_0x266d,0x152));var _0xd266=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x266d[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xd266('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7a01=['sequelize','exports'];(function(_0x1a7f32,_0x2957df){var _0x34a005=function(_0x51f195){while(--_0x51f195){_0x1a7f32['push'](_0x1a7f32['shift']());}};_0x34a005(++_0x2957df);}(_0x7a01,0x1f0));var _0x17a0=function(_0x2a7cbd,_0x199b18){_0x2a7cbd=_0x2a7cbd-0x0;var _0x3c9e0c=_0x7a01[_0x2a7cbd];return _0x3c9e0c;};'use strict';var Sequelize=require(_0x17a0('0x0'));module[_0x17a0('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 c7f1743..790e780 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 _0xe467=['user_has_openchannel_queues','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue'];(function(_0x4d5d28,_0x26bd9b){var _0x2026b1=function(_0x1fe42c){while(--_0x1fe42c){_0x4d5d28['push'](_0x4d5d28['shift']());}};_0x2026b1(++_0x26bd9b);}(_0xe467,0x1c9));var _0x7e46=function(_0x1e3c2a,_0x33acf3){_0x1e3c2a=_0x1e3c2a-0x0;var _0x10fa0c=_0xe467[_0x1e3c2a];return _0x10fa0c;};'use strict';var _=require(_0x7e46('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7e46('0x1'));var moment=require(_0x7e46('0x2'));var BPromise=require(_0x7e46('0x3'));var rp=require(_0x7e46('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e46('0x5'));var config=require(_0x7e46('0x6'));var attributes=require(_0x7e46('0x7'));module[_0x7e46('0x8')]=function(_0x3b4401,_0x553c89){return _0x3b4401[_0x7e46('0x9')](_0x7e46('0xa'),attributes,{'tableName':_0x7e46('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa732=['exports','define','UserOpenchannelQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x5b569f,_0x5c321b){var _0x318308=function(_0x945c40){while(--_0x945c40){_0x5b569f['push'](_0x5b569f['shift']());}};_0x318308(++_0x5c321b);}(_0xa732,0x18b));var _0x2a73=function(_0x33923f,_0x9e2f92){_0x33923f=_0x33923f-0x0;var _0x29c91a=_0xa732[_0x33923f];return _0x29c91a;};'use strict';var _=require(_0x2a73('0x0'));var util=require(_0x2a73('0x1'));var logger=require(_0x2a73('0x2'))(_0x2a73('0x3'));var moment=require(_0x2a73('0x4'));var BPromise=require(_0x2a73('0x5'));var rp=require(_0x2a73('0x6'));var fs=require('fs');var path=require(_0x2a73('0x7'));var rimraf=require(_0x2a73('0x8'));var config=require(_0x2a73('0x9'));var attributes=require(_0x2a73('0xa'));module[_0x2a73('0xb')]=function(_0x676675,_0x1fc87d){return _0x676675[_0x2a73('0xc')](_0x2a73('0xd'),attributes,{'tableName':'user_has_openchannel_queues','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 f2f06e4..ed21fef 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 _0xd287=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x477b42,_0x1c141f){var _0x13998e=function(_0x24f3c6){while(--_0x24f3c6){_0x477b42['push'](_0x477b42['shift']());}};_0x13998e(++_0x1c141f);}(_0xd287,0x97));var _0x7d28=function(_0x327897,_0x1f07b4){_0x327897=_0x327897-0x0;var _0x538200=_0xd287[_0x327897];return _0x538200;};'use strict';var _=require(_0x7d28('0x0'));var util=require(_0x7d28('0x1'));var moment=require(_0x7d28('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d28('0x3'));var db=require(_0x7d28('0x4'))['db'];var utils=require(_0x7d28('0x5'));var logger=require(_0x7d28('0x6'))('rpc');var config=require(_0x7d28('0x7'));var jayson=require(_0x7d28('0x8'));var client=jayson[_0x7d28('0x9')][_0x7d28('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a6fcb,_0x3e5a01,_0x17bf0a){return new BPromise(function(_0x16aae3,_0x2f8077){return client[_0x7d28('0xb')](_0x1a6fcb,_0x17bf0a)[_0x7d28('0xc')](function(_0x56e3da){logger[_0x7d28('0xd')](_0x7d28('0xe'),_0x3e5a01,'request\x20sent');logger['debug'](_0x7d28('0xf'),_0x3e5a01,_0x7d28('0x10'),JSON[_0x7d28('0x11')](_0x56e3da));if(_0x56e3da['error']){if(_0x56e3da[_0x7d28('0x12')]['code']===0x1f4){logger[_0x7d28('0x12')](_0x7d28('0xe'),_0x3e5a01,_0x56e3da[_0x7d28('0x12')][_0x7d28('0x13')]);return _0x2f8077(_0x56e3da['error']['message']);}logger[_0x7d28('0x12')](_0x7d28('0xe'),_0x3e5a01,_0x56e3da[_0x7d28('0x12')]['message']);return _0x16aae3(_0x56e3da[_0x7d28('0x12')][_0x7d28('0x13')]);}else{logger[_0x7d28('0xd')](_0x7d28('0xe'),_0x3e5a01,_0x7d28('0x10'));_0x16aae3(_0x56e3da[_0x7d28('0x14')][_0x7d28('0x13')]);}})[_0x7d28('0x15')](function(_0x4485ba){logger[_0x7d28('0x12')](_0x7d28('0xe'),_0x3e5a01,_0x4485ba);_0x2f8077(_0x4485ba);});});} \ No newline at end of file +var _0x1d81=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','catch','lodash'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0x1d81,0x14f));var _0x11d8=function(_0x27d675,_0x4f1135){_0x27d675=_0x27d675-0x0;var _0x35b1d5=_0x1d81[_0x27d675];return _0x35b1d5;};'use strict';var _=require(_0x11d8('0x0'));var util=require(_0x11d8('0x1'));var moment=require(_0x11d8('0x2'));var BPromise=require(_0x11d8('0x3'));var rs=require(_0x11d8('0x4'));var fs=require('fs');var Redis=require(_0x11d8('0x5'));var db=require(_0x11d8('0x6'))['db'];var utils=require(_0x11d8('0x7'));var logger=require(_0x11d8('0x8'))('rpc');var config=require(_0x11d8('0x9'));var jayson=require(_0x11d8('0xa'));var client=jayson[_0x11d8('0xb')][_0x11d8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xbed23a,_0x23f08f,_0x1759fd){return new BPromise(function(_0x4f9dd2,_0x4b0715){return client[_0x11d8('0xd')](_0xbed23a,_0x1759fd)[_0x11d8('0xe')](function(_0x588899){logger[_0x11d8('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x23f08f,_0x11d8('0x10'));logger[_0x11d8('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x23f08f,_0x11d8('0x10'),JSON[_0x11d8('0x12')](_0x588899));if(_0x588899[_0x11d8('0x13')]){if(_0x588899[_0x11d8('0x13')][_0x11d8('0x14')]===0x1f4){logger['error'](_0x11d8('0x15'),_0x23f08f,_0x588899[_0x11d8('0x13')][_0x11d8('0x16')]);return _0x4b0715(_0x588899[_0x11d8('0x13')][_0x11d8('0x16')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x23f08f,_0x588899['error'][_0x11d8('0x16')]);return _0x4f9dd2(_0x588899['error']['message']);}else{logger[_0x11d8('0xf')](_0x11d8('0x15'),_0x23f08f,'request\x20sent');_0x4f9dd2(_0x588899['result']['message']);}})[_0x11d8('0x17')](function(_0x68964){logger[_0x11d8('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x23f08f,_0x68964);_0x4b0715(_0x68964);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 627257c..71e90cc 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 _0x1629=['index','get','/describe','describe','show','/:id/sections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','put','update','delete','/:id','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x444184,_0x3b8fc9){var _0xddd83b=function(_0x93330a){while(--_0x93330a){_0x444184['push'](_0x444184['shift']());}};_0xddd83b(++_0x3b8fc9);}(_0x1629,0x1d8));var _0x9162=function(_0xa48664,_0x18067d){_0xa48664=_0xa48664-0x0;var _0x3b28eb=_0x1629[_0xa48664];return _0x3b28eb;};'use strict';var multer=require(_0x9162('0x0'));var util=require(_0x9162('0x1'));var path=require(_0x9162('0x2'));var timeout=require(_0x9162('0x3'));var express=require('express');var router=express[_0x9162('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9162('0x5'));var config=require(_0x9162('0x6'));var controller=require('./userProfile.controller');router['get']('/',auth[_0x9162('0x7')](),controller[_0x9162('0x8')]);router[_0x9162('0x9')](_0x9162('0xa'),auth[_0x9162('0x7')](),controller[_0x9162('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9162('0xc')]);router[_0x9162('0x9')](_0x9162('0xd'),auth[_0x9162('0x7')](),controller['getSections']);router[_0x9162('0x9')](_0x9162('0xe'),auth['isAuthenticated'](),controller[_0x9162('0xf')]);router[_0x9162('0x10')]('/',auth['isAuthenticated'](),controller[_0x9162('0x11')]);router[_0x9162('0x10')](_0x9162('0x12'),auth[_0x9162('0x7')](),controller[_0x9162('0x13')]);router[_0x9162('0x10')](_0x9162('0xd'),auth[_0x9162('0x7')](),controller[_0x9162('0x14')]);router[_0x9162('0x10')](_0x9162('0xe'),auth['isAuthenticated'](),controller[_0x9162('0x15')]);router[_0x9162('0x16')]('/:id',auth[_0x9162('0x7')](),controller[_0x9162('0x17')]);router[_0x9162('0x18')](_0x9162('0x19'),auth[_0x9162('0x7')](),controller[_0x9162('0x1a')]);router[_0x9162('0x18')](_0x9162('0xd'),auth[_0x9162('0x7')](),controller[_0x9162('0x1b')]);router['delete']('/:id/resources',auth[_0x9162('0x7')](),controller[_0x9162('0x1c')]);module[_0x9162('0x1d')]=router; \ No newline at end of file +var _0xc692=['addSections','update','destroy','delete','removeSections','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','index','/describe','isAuthenticated','/:id','/:id/sections','getSections','/:id/resources','getResources','post','/:id/clone'];(function(_0x270919,_0xbedd){var _0x497195=function(_0xef5b95){while(--_0xef5b95){_0x270919['push'](_0x270919['shift']());}};_0x497195(++_0xbedd);}(_0xc692,0x11e));var _0x2c69=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xc692[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require(_0x2c69('0x0'));var util=require(_0x2c69('0x1'));var path=require(_0x2c69('0x2'));var timeout=require(_0x2c69('0x3'));var express=require(_0x2c69('0x4'));var router=express[_0x2c69('0x5')]();var fs_extra=require(_0x2c69('0x6'));var auth=require(_0x2c69('0x7'));var interaction=require(_0x2c69('0x8'));var config=require(_0x2c69('0x9'));var controller=require(_0x2c69('0xa'));router[_0x2c69('0xb')]('/',auth['isAuthenticated'](),controller[_0x2c69('0xc')]);router['get'](_0x2c69('0xd'),auth[_0x2c69('0xe')](),controller['describe']);router[_0x2c69('0xb')](_0x2c69('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x2c69('0xb')](_0x2c69('0x10'),auth[_0x2c69('0xe')](),controller[_0x2c69('0x11')]);router[_0x2c69('0xb')](_0x2c69('0x12'),auth[_0x2c69('0xe')](),controller[_0x2c69('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2c69('0x14')](_0x2c69('0x15'),auth[_0x2c69('0xe')](),controller['clone']);router[_0x2c69('0x14')](_0x2c69('0x10'),auth[_0x2c69('0xe')](),controller[_0x2c69('0x16')]);router[_0x2c69('0x14')](_0x2c69('0x12'),auth[_0x2c69('0xe')](),controller['addResources']);router['put'](_0x2c69('0xf'),auth[_0x2c69('0xe')](),controller[_0x2c69('0x17')]);router['delete'](_0x2c69('0xf'),auth[_0x2c69('0xe')](),controller[_0x2c69('0x18')]);router[_0x2c69('0x19')](_0x2c69('0x10'),auth[_0x2c69('0xe')](),controller[_0x2c69('0x1a')]);router[_0x2c69('0x19')](_0x2c69('0x12'),auth['isAuthenticated'](),controller['removeResources']);module[_0x2c69('0x1b')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index ffc9e00..f7f67f8 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 _0x1fef=['exports','STRING','name','crudPermissions','getDataValue','split','BOOLEAN'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x1fef,0xaf));var _0xf1fe=function(_0x32db7c,_0x340068){_0x32db7c=_0x32db7c-0x0;var _0x4adde2=_0x1fef[_0x32db7c];return _0x4adde2;};'use strict';var Sequelize=require('sequelize');module[_0xf1fe('0x0')]={'name':{'type':Sequelize[_0xf1fe('0x1')],'allowNull':![],'unique':_0xf1fe('0x2')},'crudPermissions':{'type':Sequelize[_0xf1fe('0x1')],'set':function(_0x22aabd){this['setDataValue'](_0xf1fe('0x3'),_0x22aabd?_0x22aabd['join'](''):[]);},'get':function(){return this[_0xf1fe('0x4')](_0xf1fe('0x3'))?this['getDataValue'](_0xf1fe('0x3'))[_0xf1fe('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xf1fe('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xf1fe('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xf1fe('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xf1fe('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xf1fe('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf1fe('0x6')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2ff2=['BOOLEAN','sequelize','exports','name','STRING','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2ff2,0x137));var _0x22ff=function(_0x1966ad,_0x43f2f3){_0x1966ad=_0x1966ad-0x0;var _0x5d7637=_0x2ff2[_0x1966ad];return _0x5d7637;};'use strict';var Sequelize=require(_0x22ff('0x0'));module[_0x22ff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x22ff('0x2')},'crudPermissions':{'type':Sequelize[_0x22ff('0x3')],'set':function(_0x41526d){this[_0x22ff('0x4')](_0x22ff('0x5'),_0x41526d?_0x41526d[_0x22ff('0x6')](''):[]);},'get':function(){return this[_0x22ff('0x7')](_0x22ff('0x5'))?this[_0x22ff('0x7')](_0x22ff('0x5'))[_0x22ff('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x22ff('0x3')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x22ff('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x22ff('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x22ff('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x22ff('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x22ff('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x22ff('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x22ff('0x9')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index b585db4..b7539f0 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 _0x6441=['userProfileId','Resources','update','describe','sequelize','push','getSections','enabled','includes','isEmpty','subsections','concat','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','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','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','then','destroy','end','stack','name','send','index','UserProfile','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','type','filter','options','includeAll','include','rows','show','find','catch','create','body','clone','params','length','get','omit','createdAt','updatedAt','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','findAll','sectionId'];(function(_0x28bf7c,_0x4ed463){var _0x39f246=function(_0x59311f){while(--_0x59311f){_0x28bf7c['push'](_0x28bf7c['shift']());}};_0x39f246(++_0x4ed463);}(_0x6441,0x16a));var _0x1644=function(_0x13c598,_0x30a951){_0x13c598=_0x13c598-0x0;var _0x351bfc=_0x6441[_0x13c598];return _0x351bfc;};'use strict';var emlformat=require(_0x1644('0x0'));var rimraf=require(_0x1644('0x1'));var zipdir=require(_0x1644('0x2'));var jsonpatch=require(_0x1644('0x3'));var rp=require(_0x1644('0x4'));var moment=require(_0x1644('0x5'));var BPromise=require(_0x1644('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1644('0x7'));var sox=require('sox');var csv=require(_0x1644('0x8'));var ejs=require(_0x1644('0x9'));var fs=require('fs');var fs_extra=require(_0x1644('0xa'));var _=require(_0x1644('0xb'));var squel=require('squel');var crypto=require(_0x1644('0xc'));var jsforce=require(_0x1644('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1644('0x8'));var querystring=require(_0x1644('0xe'));var Papa=require('papaparse');var Redis=require(_0x1644('0xf'));var authService=require(_0x1644('0x10'));var qs=require(_0x1644('0x11'));var as=require(_0x1644('0x12'));var hardwareService=require(_0x1644('0x13'));var logger=require(_0x1644('0x14'))(_0x1644('0x15'));var utils=require(_0x1644('0x16'));var config=require(_0x1644('0x17'));var licenseUtil=require(_0x1644('0x18'));var db=require('../../mysqldb')['db'];config[_0x1644('0x19')]=_[_0x1644('0x1a')](config[_0x1644('0x19')],{'host':_0x1644('0x1b'),'port':0x18eb});var socket=require(_0x1644('0x1c'))(new Redis(config['redis']));require(_0x1644('0x1d'))[_0x1644('0x1e')](socket);function respondWithStatusCode(_0xed0e4b,_0x506557){_0x506557=_0x506557||0xcc;return function(_0x79cccf){if(_0x79cccf){return _0xed0e4b[_0x1644('0x1f')](_0x506557);}return _0xed0e4b[_0x1644('0x20')](_0x506557)['end']();};}function respondWithResult(_0x42fbfe,_0x5d7562){_0x5d7562=_0x5d7562||0xc8;return function(_0x1ea887){if(_0x1ea887){return _0x42fbfe[_0x1644('0x20')](_0x5d7562)[_0x1644('0x21')](_0x1ea887);}};}function respondWithFilteredResult(_0x720959,_0x2be1d5){return function(_0x4b58db){if(_0x4b58db){var _0x145fc8=typeof _0x2be1d5[_0x1644('0x22')]===_0x1644('0x23')&&typeof _0x2be1d5[_0x1644('0x24')]===_0x1644('0x23');var _0x27d4b7=_0x4b58db[_0x1644('0x25')];var _0x424d04=_0x145fc8?0x0:_0x2be1d5['offset'];var _0x2f8436=_0x145fc8?_0x4b58db['count']:_0x2be1d5['offset']+_0x2be1d5[_0x1644('0x24')];var _0x21ed0d;if(_0x2f8436>=_0x27d4b7){_0x2f8436=_0x27d4b7;_0x21ed0d=0xc8;}else{_0x21ed0d=0xce;}_0x720959[_0x1644('0x20')](_0x21ed0d);return _0x720959['set']('Content-Range',_0x424d04+'-'+_0x2f8436+'/'+_0x27d4b7)[_0x1644('0x21')](_0x4b58db);}return null;};}function patchUpdates(_0x42bbf6){return function(_0x5c27dd){try{jsonpatch[_0x1644('0x26')](_0x5c27dd,_0x42bbf6,!![]);}catch(_0x2f3aaa){return BPromise[_0x1644('0x27')](_0x2f3aaa);}return _0x5c27dd[_0x1644('0x28')]();};}function saveUpdates(_0xf34514,_0x2cbab3){return function(_0x86752c){if(_0x86752c){return _0x86752c['update'](_0xf34514)[_0x1644('0x29')](function(_0x1cc471){return _0x1cc471;});}return null;};}function removeEntity(_0x243c93,_0x2f5ad6){return function(_0x2e9924){if(_0x2e9924){return _0x2e9924[_0x1644('0x2a')]()['then'](function(){_0x243c93[_0x1644('0x20')](0xcc)[_0x1644('0x2b')]();});}};}function handleEntityNotFound(_0x358f00,_0x5276b6){return function(_0xbd0965){if(!_0xbd0965){_0x358f00['sendStatus'](0x194);}return _0xbd0965;};}function handleError(_0x5859b7,_0x398fe0){_0x398fe0=_0x398fe0||0x1f4;return function(_0x5376cf){logger['error'](_0x5376cf[_0x1644('0x2c')]);if(_0x5376cf[_0x1644('0x2d')]){delete _0x5376cf[_0x1644('0x2d')];}_0x5859b7[_0x1644('0x20')](_0x398fe0)[_0x1644('0x2e')](_0x5376cf);};}exports[_0x1644('0x2f')]=function(_0x206524,_0x8b5af4){var _0x2a6167={},_0x3ff831={},_0x1e7ffd={'count':0x0,'rows':[]};var _0x34fec4=_['map'](db[_0x1644('0x30')][_0x1644('0x31')],function(_0x439f1){return{'name':_0x439f1[_0x1644('0x32')],'type':_0x439f1['type'][_0x1644('0x33')]};});_0x3ff831[_0x1644('0x34')]=_[_0x1644('0x35')](_0x34fec4,_0x1644('0x2d'));_0x3ff831[_0x1644('0x36')]=_[_0x1644('0x37')](_0x206524[_0x1644('0x36')]);_0x3ff831[_0x1644('0x38')]=_[_0x1644('0x39')](_0x3ff831[_0x1644('0x34')],_0x3ff831[_0x1644('0x36')]);_0x2a6167[_0x1644('0x3a')]=_[_0x1644('0x39')](_0x3ff831[_0x1644('0x34')],qs['fields'](_0x206524[_0x1644('0x36')][_0x1644('0x3b')]));_0x2a6167['attributes']=_0x2a6167['attributes']['length']?_0x2a6167[_0x1644('0x3a')]:_0x3ff831['model'];if(!_0x206524[_0x1644('0x36')]['hasOwnProperty'](_0x1644('0x3c'))){_0x2a6167[_0x1644('0x24')]=qs[_0x1644('0x24')](_0x206524[_0x1644('0x36')]['limit']);_0x2a6167[_0x1644('0x22')]=qs[_0x1644('0x22')](_0x206524[_0x1644('0x36')]['offset']);}_0x2a6167[_0x1644('0x3d')]=qs[_0x1644('0x3e')](_0x206524['query'][_0x1644('0x3e')]);_0x2a6167[_0x1644('0x3f')]=qs['filters'](_['pick'](_0x206524[_0x1644('0x36')],_0x3ff831[_0x1644('0x38')]),_0x34fec4);if(_0x206524['query']['filter']){_0x2a6167[_0x1644('0x3f')]=_[_0x1644('0x40')](_0x2a6167['where'],{'$or':_[_0x1644('0x35')](_0x34fec4,function(_0x2bf922){if(_0x2bf922[_0x1644('0x41')]!=='VIRTUAL'){var _0x788fae={};_0x788fae[_0x2bf922[_0x1644('0x2d')]]={'$like':'%'+_0x206524[_0x1644('0x36')][_0x1644('0x42')]+'%'};return _0x788fae;}})});}_0x2a6167=_[_0x1644('0x40')]({},_0x2a6167,_0x206524[_0x1644('0x43')]);var _0x2abe07={'where':_0x2a6167['where']};return db[_0x1644('0x30')][_0x1644('0x25')](_0x2abe07)['then'](function(_0x3091a8){_0x1e7ffd[_0x1644('0x25')]=_0x3091a8;if(_0x206524['query'][_0x1644('0x44')]){_0x2a6167[_0x1644('0x45')]=[{'all':!![]}];}return db[_0x1644('0x30')]['findAll'](_0x2a6167);})[_0x1644('0x29')](function(_0xf31700){_0x1e7ffd[_0x1644('0x46')]=_0xf31700;return _0x1e7ffd;})[_0x1644('0x29')](respondWithFilteredResult(_0x8b5af4,_0x2a6167))['catch'](handleError(_0x8b5af4,null));};exports[_0x1644('0x47')]=function(_0x1329e1,_0x143a89){var _0x142618={'raw':![],'where':{'id':_0x1329e1['params']['id']}},_0x36ce0c={};_0x36ce0c[_0x1644('0x34')]=_[_0x1644('0x37')](db[_0x1644('0x30')][_0x1644('0x31')]);_0x36ce0c[_0x1644('0x36')]=_['keys'](_0x1329e1[_0x1644('0x36')]);_0x36ce0c[_0x1644('0x38')]=_[_0x1644('0x39')](_0x36ce0c[_0x1644('0x34')],_0x36ce0c[_0x1644('0x36')]);_0x142618[_0x1644('0x3a')]=_[_0x1644('0x39')](_0x36ce0c['model'],qs[_0x1644('0x3b')](_0x1329e1[_0x1644('0x36')][_0x1644('0x3b')]));_0x142618[_0x1644('0x3a')]=_0x142618[_0x1644('0x3a')]['length']?_0x142618['attributes']:_0x36ce0c[_0x1644('0x34')];if(_0x1329e1[_0x1644('0x36')][_0x1644('0x44')]){_0x142618[_0x1644('0x45')]=[{'all':!![]}];}_0x142618=_['merge']({},_0x142618,_0x1329e1[_0x1644('0x43')]);return db[_0x1644('0x30')][_0x1644('0x48')](_0x142618)['then'](handleEntityNotFound(_0x143a89,null))[_0x1644('0x29')](respondWithResult(_0x143a89,null))[_0x1644('0x49')](handleError(_0x143a89,null));};exports[_0x1644('0x4a')]=function(_0x51d37c,_0x2fce62){return db['UserProfile'][_0x1644('0x4a')](_0x51d37c[_0x1644('0x4b')],{})[_0x1644('0x29')](respondWithResult(_0x2fce62,0xc9))['catch'](handleError(_0x2fce62,null));};exports[_0x1644('0x4c')]=function(_0x3c0094,_0x52c63b){var _0xab9930={'where':{'id':_0x3c0094[_0x1644('0x4d')]['id']}},_0x1cae33={};_0x1cae33[_0x1644('0x34')]=_[_0x1644('0x37')](db[_0x1644('0x30')][_0x1644('0x31')]);_0xab9930[_0x1644('0x3a')]=_['intersection'](_0x1cae33['model'],qs[_0x1644('0x3b')](_0x3c0094[_0x1644('0x36')][_0x1644('0x3b')]));_0xab9930['attributes']=_0xab9930[_0x1644('0x3a')][_0x1644('0x4e')]?_0xab9930['attributes']:_0x1cae33[_0x1644('0x34')];if(_0x3c0094[_0x1644('0x36')][_0x1644('0x44')]){_0xab9930[_0x1644('0x45')]=[{'all':!![]}];}_0xab9930=_['merge']({},_0xab9930,_0x3c0094[_0x1644('0x43')]);return db[_0x1644('0x30')]['find'](_0xab9930)[_0x1644('0x29')](handleEntityNotFound(_0x52c63b,null))[_0x1644('0x29')](function(_0x52568e){if(_0x52568e){var _0x18d758=_0x52568e[_0x1644('0x4f')]({'plain':!![]});_0x18d758=qs[_0x1644('0x50')](_0x18d758,['id','createdAt','updatedAt','crudPermissions']);_0x3c0094[_0x1644('0x4b')]=_['omit'](_0x3c0094[_0x1644('0x4b')],['id',_0x1644('0x51'),_0x1644('0x52')]);return db['sequelize'][_0x1644('0x53')](function(_0x7c4cef){return db[_0x1644('0x30')][_0x1644('0x4a')](_[_0x1644('0x40')](_0x18d758,_0x3c0094[_0x1644('0x4b')]),{'include':_0x3c0094['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x7c4cef})[_0x1644('0x29')](function(_0x334fa8){var _0x2c1184=_0x334fa8[_0x1644('0x4f')]({'plain':!![]});return db[_0x1644('0x54')]['findAll']({'where':{'userProfileId':_0x3c0094['params']['id']},'raw':!![]})[_0x1644('0x29')](function(_0x31106e){if(_0x31106e){return BPromise[_0x1644('0x55')](_0x31106e,function(_0x4af7f9){return new BPromise(function(_0xee1d52,_0x202950){if(_0x4af7f9[_0x1644('0x56')]===null||_0x4af7f9[_0x1644('0x56')]===0x1)_0xee1d52(null);return db[_0x1644('0x57')][_0x1644('0x58')]({'where':{'sectionId':_0x4af7f9['id']},'raw':!![]})['then'](function(_0x4385e6){var _0x92a458=_[_0x1644('0x35')](_0x4385e6,function(_0x2b7c73){return qs[_0x1644('0x50')](_0x2b7c73,['id','createdAt',_0x1644('0x52'),_0x1644('0x59')]);});_0xee1d52(_0x92a458);})[_0x1644('0x49')](function(_0x308914){_0x202950(_0x308914);});})[_0x1644('0x29')](function(_0x505f37){var _0x20222d=qs[_0x1644('0x50')](_0x4af7f9,['id',_0x1644('0x51'),_0x1644('0x52')]);_0x20222d[_0x1644('0x5a')]=_0x2c1184['id'];if(_0x505f37)_0x20222d[_0x1644('0x5b')]=_0x505f37;return _0x20222d;})[_0x1644('0x29')](function(_0x1299f6){return db['UserProfileSection'][_0x1644('0x4a')](_0x1299f6,{'include':[{'model':db[_0x1644('0x57')],'as':_0x1644('0x5b')}],'raw':!![],'transaction':_0x7c4cef});});})[_0x1644('0x29')](function(){return _0x2c1184;});}});});});}})['then'](respondWithResult(_0x52c63b,0xc9))['catch'](handleError(_0x52c63b,null));};exports[_0x1644('0x5c')]=function(_0x3d1681,_0x302c79){if(_0x3d1681[_0x1644('0x4b')]['id']){delete _0x3d1681['body']['id'];}return db[_0x1644('0x30')][_0x1644('0x48')]({'where':{'id':_0x3d1681[_0x1644('0x4d')]['id']}})['then'](handleEntityNotFound(_0x302c79,null))[_0x1644('0x29')](saveUpdates(_0x3d1681[_0x1644('0x4b')],null))['then'](respondWithResult(_0x302c79,null))[_0x1644('0x49')](handleError(_0x302c79,null));};exports[_0x1644('0x2a')]=function(_0x25b665,_0x4f2fa3){return db[_0x1644('0x30')][_0x1644('0x48')]({'where':{'id':_0x25b665[_0x1644('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4f2fa3,null))[_0x1644('0x29')](removeEntity(_0x4f2fa3,null))[_0x1644('0x49')](handleError(_0x4f2fa3,null));};exports[_0x1644('0x5d')]=function(_0x2b6ab6,_0x3bb14b){return db[_0x1644('0x30')][_0x1644('0x5d')]()[_0x1644('0x29')](respondWithResult(_0x3bb14b,null))['catch'](handleError(_0x3bb14b,null));};exports['addSections']=function(_0x29a76d,_0x3ef83c){var _0x7eba93=_0x29a76d[_0x1644('0x4b')];return db[_0x1644('0x30')][_0x1644('0x48')]({'where':{'id':_0x29a76d['params']['id']}})[_0x1644('0x29')](handleEntityNotFound(_0x3ef83c,null))[_0x1644('0x29')](function(_0x2bd689){if(_0x2bd689){return db[_0x1644('0x5e')]['transaction'](function(_0x4dfe0a){return db[_0x1644('0x54')][_0x1644('0x2a')]({'where':{'userProfileId':_0x29a76d[_0x1644('0x4d')]['id'],'sectionId':_[_0x1644('0x35')](_0x7eba93,function(_0x3062fc){return _0x3062fc[_0x1644('0x59')];})},'transaction':_0x4dfe0a})[_0x1644('0x29')](function(){var _0x5c39a3=_['map'](_0x7eba93,function(_0x4eea18){_0x4eea18[_0x1644('0x5a')]=_0x29a76d[_0x1644('0x4d')]['id'];return _0x4eea18;});var _0x4a81f1=[];return BPromise[_0x1644('0x55')](_0x5c39a3,function(_0x2143c6){return db[_0x1644('0x54')][_0x1644('0x4a')](_0x2143c6,{'include':[{'model':db[_0x1644('0x57')],'as':_0x1644('0x5b')}],'raw':!![],'transaction':_0x4dfe0a})[_0x1644('0x29')](function(_0x472377){_0x4a81f1[_0x1644('0x5f')](_0x472377[_0x1644('0x4f')]({'plain':!![]}));});})[_0x1644('0x29')](function(){return _0x4a81f1;});});});}})[_0x1644('0x29')](function(_0x5d27c6){return _0x5d27c6;})[_0x1644('0x29')](respondWithResult(_0x3ef83c,null))['catch'](handleError(_0x3ef83c,null));};exports['removeSections']=function(_0x3d14c6,_0x4539ea){var _0x3e53df;return db[_0x1644('0x30')][_0x1644('0x48')]({'where':{'id':_0x3d14c6[_0x1644('0x4d')]['id']},'attributes':['id',_0x1644('0x2d')]})['then'](handleEntityNotFound(_0x4539ea,null))[_0x1644('0x29')](function(_0x26bb62){if(_0x26bb62){_0x3e53df=_0x26bb62;return db[_0x1644('0x54')][_0x1644('0x2a')]({'where':{'userProfileId':_0x3d14c6[_0x1644('0x4d')]['id'],'sectionId':_0x3d14c6[_0x1644('0x36')]['ids']}});}})[_0x1644('0x29')](function(){return _0x3e53df;})['then'](respondWithStatusCode(_0x4539ea,null))[_0x1644('0x49')](handleError(_0x4539ea,null));};exports[_0x1644('0x60')]=function(_0x193342,_0x17716c){var _0x5c522d=[];var _0xf2ad24=[];return db['UserProfileSection'][_0x1644('0x58')]({'where':{'userProfileId':_0x193342['params']['id']},'raw':!![]})['then'](function(_0x2d82d2){_0x5c522d=_[_0x1644('0x42')](_0x2d82d2,function(_0x51020){return _0x51020[_0x1644('0x61')]===0x1||_[_0x1644('0x62')]([0x3eb,0x709],_0x51020[_0x1644('0x59')]);});if(!_[_0x1644('0x63')](_0x5c522d)){return _[_0x1644('0x35')](_0x5c522d,function(_0x1f021a){return _0x1f021a[_0x1644('0x59')];});}else{return;}})[_0x1644('0x29')](function(_0x10dfff){if(_0x10dfff)_0xf2ad24=_0x10dfff;if(_[_0x1644('0x62')](_0xf2ad24,0x64)){var _0x2a9e9c=_['find'](_0x5c522d,{'sectionId':0x64});return hasDefaultDashboard(_0x2a9e9c)[_0x1644('0x29')](function(_0x87d5b0){return _[_0x1644('0x35')](_0x5c522d,function(_0xdd509d){if(_0xdd509d[_0x1644('0x59')]===0x64){_0xdd509d['subsections']=_0x87d5b0;}return _0xdd509d;});});}else{return;}})[_0x1644('0x29')](function(_0x1771b9){if(_0x1771b9)_0x5c522d=_0x1771b9;if(_[_0x1644('0x62')](_0xf2ad24,0x3eb)){var _0x3c028f=_[_0x1644('0x48')](_0x5c522d,{'sectionId':0x3eb});return getCustomDashboards(_0x3c028f)[_0x1644('0x29')](function(_0x3bd9a5){return _[_0x1644('0x35')](_0x5c522d,function(_0x4cf45e){if(_0x3c028f[_0x1644('0x61')]){if(_0x4cf45e[_0x1644('0x59')]===0x3eb){_0x4cf45e[_0x1644('0x64')]=_0x3bd9a5;}}else{if(_0x4cf45e[_0x1644('0x59')]===0x64){if(!_0x4cf45e[_0x1644('0x64')]){_0x4cf45e[_0x1644('0x64')]=[];}_0x4cf45e[_0x1644('0x64')]=_0x4cf45e[_0x1644('0x64')][_0x1644('0x65')](_0x3bd9a5);}}return _0x4cf45e;});});}else{return;}})['then'](function(_0x4d061e){if(_0x4d061e)_0x5c522d=_0x4d061e;if(_[_0x1644('0x62')](_0xf2ad24,0x709)){var _0x3e9a98=_[_0x1644('0x48')](_0x5c522d,{'sectionId':0x709});return getPlugins(_0x3e9a98)[_0x1644('0x29')](function(_0x5a33af){if(_0x3e9a98[_0x1644('0x61')]){return _['map'](_0x5c522d,function(_0x23329c){if(_0x23329c['sectionId']===0x709){_0x23329c['subsections']=_0x5a33af;}return _0x23329c;});}else{var _0xc2aef1={'sectionId':0x76c,'enabled':0x1,'subsections':_0x5a33af};var _0x4175f0=_[_0x1644('0x35')](_0x5c522d);_0x4175f0['push'](_0xc2aef1);return _0x4175f0;}});}else{return;}})['then'](function(_0x13949b){if(_0x13949b)_0x5c522d=_0x13949b;return _[_0x1644('0x42')](_0x5c522d,['enabled',0x1]);})[_0x1644('0x29')](respondWithResult(_0x17716c,null))['catch'](handleError(_0x17716c,null));};function hasDefaultDashboard(_0x29ed68){var _0x50b67b=[0x65];return new BPromise(function(_0x14456c,_0x34a78b){try{if(_0x29ed68[_0x1644('0x56')]){_0x14456c(_0x50b67b);}else{return db[_0x1644('0x57')]['findOne']({'where':{'sectionId':_0x29ed68['id']},'raw':!![]})[_0x1644('0x29')](function(_0x228d95){_0x228d95?_0x14456c(_0x50b67b):_0x14456c();});}}catch(_0x2e078d){_0x34a78b(_0x2e078d);}});}function getCustomDashboards(_0x1a0174){var _0x32481c=[];return new BPromise(function(_0xd0c483,_0x920556){try{if(_0x1a0174[_0x1644('0x56')]){return db[_0x1644('0x66')][_0x1644('0x58')]({'raw':!![]})[_0x1644('0x29')](function(_0x14b3a7){_0x14b3a7[_0x1644('0x67')](function(_0x552467){_0x32481c[_0x1644('0x5f')](_0x552467['id']+0x1869f);});_0xd0c483(_0x32481c);});}else{return db[_0x1644('0x57')]['findAll']({'where':{'sectionId':_0x1a0174['id']},'raw':!![]})[_0x1644('0x29')](function(_0x315731){_0x315731[_0x1644('0x67')](function(_0x24053b){_0x32481c[_0x1644('0x5f')](_0x24053b[_0x1644('0x68')]+0x1869f);});_0xd0c483(_0x32481c);});}}catch(_0x12abd6){_0x920556(_0x12abd6);}});}function getPlugins(_0xe7ec50){var _0xce1372=[];return new BPromise(function(_0x34e40,_0x2e10b1){try{if(_0xe7ec50[_0x1644('0x56')]){return db['Plugin']['findAll']({'raw':!![]})[_0x1644('0x29')](function(_0x3daabc){_0x3daabc[_0x1644('0x67')](function(_0x2a1709){_0xce1372[_0x1644('0x5f')](_0x2a1709['id']+0x15b38);});_0x34e40(_0xce1372);});}else{return db[_0x1644('0x57')]['findAll']({'where':{'sectionId':_0xe7ec50['id']},'raw':!![]})['then'](function(_0x29d17b){_0x29d17b[_0x1644('0x67')](function(_0x450f73){_0xce1372[_0x1644('0x5f')](_0x450f73[_0x1644('0x68')]+0x15b38);});_0x34e40(_0xce1372);});}}catch(_0x250f6d){_0x2e10b1(_0x250f6d);}});}exports[_0x1644('0x69')]=function(_0x125f23,_0x2361ca){return db[_0x1644('0x30')][_0x1644('0x48')]({'where':{'id':_0x125f23[_0x1644('0x4d')]['id']}})[_0x1644('0x29')](handleEntityNotFound(_0x2361ca,null))[_0x1644('0x29')](function(_0x2c029a){if(_0x2c029a){return db['sequelize'][_0x1644('0x53')](function(_0x1f637f){return db['UserProfileSection'][_0x1644('0x58')]({'where':{'userProfileId':_0x125f23[_0x1644('0x4d')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x4657be){if(_0x4657be){return db[_0x1644('0x54')][_0x1644('0x2a')]({'where':{'userProfileId':_0x125f23[_0x1644('0x4d')]['id'],'id':_[_0x1644('0x35')](_0x4657be,function(_0x53a746){return _0x53a746['id'];})},'transaction':_0x1f637f});}})['then'](function(_0x2f0b87){var _0x2a5b27=_['map'](_0x125f23[_0x1644('0x4b')],function(_0x5abe6e){_0x5abe6e[_0x1644('0x5a')]=_0x125f23[_0x1644('0x4d')]['id'];return _0x5abe6e;});return db[_0x1644('0x54')][_0x1644('0x6a')](_0x2a5b27,{'raw':!![],'transaction':_0x1f637f});})[_0x1644('0x29')](function(_0x3bb3bc){var _0x518006=_[_0x1644('0x42')](_['map'](_0x3bb3bc,function(_0x549009){return _0x549009[_0x1644('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x518006){return db[_0x1644('0x54')]['findAll']({'where':{'userProfileId':_0x125f23['params']['id'],'sectionId':_[_0x1644('0x35')](_0x518006,function(_0x544ddc){return _0x544ddc[_0x1644('0x59')];})},'attributes':['id',_0x1644('0x59')],'raw':!![]})[_0x1644('0x29')](function(_0x53bee5){var _0x48d289=_[_0x1644('0x35')](_0x125f23[_0x1644('0x4b')],function(_0x384c9f){_0x384c9f[_0x1644('0x5a')]=_0x125f23[_0x1644('0x4d')]['id'];return _0x384c9f;});return db['UserProfileResource']['bulkCreate'](_0x48d289,{'raw':!![],'transaction':_0x1f637f});});}})['catch'](handleError(_0x2361ca,null));});}})['then'](function(_0x32c043){var _0x15eee0=_[_0x1644('0x35')](_0x32c043,function(_0x246fd7){return _0x246fd7['get']({'plain':!![]});});})['then'](respondWithResult(_0x2361ca,null))[_0x1644('0x49')](handleError(_0x2361ca,null));};exports[_0x1644('0x6b')]=function(_0x36d85b,_0x33b2aa,_0x387389){return db[_0x1644('0x30')]['find']({'where':{'id':_0x36d85b[_0x1644('0x4d')]['id']}})[_0x1644('0x29')](handleEntityNotFound(_0x33b2aa,null))['then'](function(_0x57f9c1){if(_0x57f9c1){return _0x57f9c1[_0x1644('0x6b')](_0x36d85b[_0x1644('0x36')]['ids']);}})[_0x1644('0x29')](respondWithStatusCode(_0x33b2aa,null))[_0x1644('0x49')](handleError(_0x33b2aa,null));};exports['getResources']=function(_0x2c9f4a,_0x441bc8){var _0x3f22e1={};if(!_0x2c9f4a[_0x1644('0x36')][_0x1644('0x6c')])throw new Error(_0x1644('0x6d'));if(!_0x2c9f4a[_0x1644('0x36')][_0x1644('0x6e')](_0x1644('0x3c'))){_0x3f22e1[_0x1644('0x24')]=qs[_0x1644('0x24')](_0x2c9f4a['query'][_0x1644('0x24')]);_0x3f22e1[_0x1644('0x22')]=qs[_0x1644('0x22')](_0x2c9f4a['query'][_0x1644('0x22')]);}return db[_0x1644('0x30')]['find']({'where':{'id':_0x2c9f4a[_0x1644('0x4d')]['id']}})['then'](function(_0x2b63b2){if(!_0x2b63b2)throw new Error(_0x1644('0x6f')+_0x2c9f4a['params']['id']);return db['UserProfile'][_0x1644('0x70')](_0x2c9f4a);})[_0x1644('0x29')](respondWithFilteredResult(_0x441bc8,_0x3f22e1))['catch'](handleError(_0x441bc8,null));}; \ No newline at end of file +var _0x2a7b=['autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','params','describe','addSections','sequelize','push','removeSections','ids','enabled','includes','isEmpty','subsections','concat','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','hasOwnProperty','getResources','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','save','update','destroy','then','error','stack','name','send','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','type','merge','options','UserProfile','includeAll','include','findAll','rows','catch','find','create','body','get','omit','createdAt','updatedAt','crudPermissions','transaction','UserProfileSection'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x2a7b,0x8d));var _0xb2a7=function(_0x5e4b4b,_0x225205){_0x5e4b4b=_0x5e4b4b-0x0;var _0x12be3c=_0x2a7b[_0x5e4b4b];return _0x12be3c;};'use strict';var emlformat=require(_0xb2a7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb2a7('0x1'));var rp=require(_0xb2a7('0x2'));var moment=require(_0xb2a7('0x3'));var BPromise=require(_0xb2a7('0x4'));var Mustache=require('mustache');var util=require(_0xb2a7('0x5'));var path=require(_0xb2a7('0x6'));var sox=require(_0xb2a7('0x7'));var csv=require(_0xb2a7('0x8'));var ejs=require(_0xb2a7('0x9'));var fs=require('fs');var fs_extra=require(_0xb2a7('0xa'));var _=require(_0xb2a7('0xb'));var squel=require(_0xb2a7('0xc'));var crypto=require(_0xb2a7('0xd'));var jsforce=require(_0xb2a7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb2a7('0x8'));var querystring=require(_0xb2a7('0xf'));var Papa=require(_0xb2a7('0x10'));var Redis=require(_0xb2a7('0x11'));var authService=require(_0xb2a7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb2a7('0x13'));var hardwareService=require(_0xb2a7('0x14'));var logger=require(_0xb2a7('0x15'))(_0xb2a7('0x16'));var utils=require(_0xb2a7('0x17'));var config=require(_0xb2a7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb2a7('0x19'))['db'];config[_0xb2a7('0x1a')]=_[_0xb2a7('0x1b')](config['redis'],{'host':_0xb2a7('0x1c'),'port':0x18eb});var socket=require(_0xb2a7('0x1d'))(new Redis(config[_0xb2a7('0x1a')]));require('./userProfile.socket')[_0xb2a7('0x1e')](socket);function respondWithStatusCode(_0x19d792,_0x718500){_0x718500=_0x718500||0xcc;return function(_0x21f95b){if(_0x21f95b){return _0x19d792[_0xb2a7('0x1f')](_0x718500);}return _0x19d792['status'](_0x718500)[_0xb2a7('0x20')]();};}function respondWithResult(_0x1158d0,_0x4d2e16){_0x4d2e16=_0x4d2e16||0xc8;return function(_0x384b70){if(_0x384b70){return _0x1158d0['status'](_0x4d2e16)[_0xb2a7('0x21')](_0x384b70);}};}function respondWithFilteredResult(_0xe0d3af,_0x2c569f){return function(_0x46a2e5){if(_0x46a2e5){var _0x52a95b=typeof _0x2c569f[_0xb2a7('0x22')]===_0xb2a7('0x23')&&typeof _0x2c569f[_0xb2a7('0x24')]==='undefined';var _0x40502f=_0x46a2e5['count'];var _0x582670=_0x52a95b?0x0:_0x2c569f['offset'];var _0x367d4a=_0x52a95b?_0x46a2e5[_0xb2a7('0x25')]:_0x2c569f['offset']+_0x2c569f['limit'];var _0x518016;if(_0x367d4a>=_0x40502f){_0x367d4a=_0x40502f;_0x518016=0xc8;}else{_0x518016=0xce;}_0xe0d3af[_0xb2a7('0x26')](_0x518016);return _0xe0d3af[_0xb2a7('0x27')]('Content-Range',_0x582670+'-'+_0x367d4a+'/'+_0x40502f)['json'](_0x46a2e5);}return null;};}function patchUpdates(_0x441c3c){return function(_0x4106cf){try{jsonpatch[_0xb2a7('0x28')](_0x4106cf,_0x441c3c,!![]);}catch(_0x15e207){return BPromise['reject'](_0x15e207);}return _0x4106cf[_0xb2a7('0x29')]();};}function saveUpdates(_0x30ea78,_0x4221f0){return function(_0x33d4eb){if(_0x33d4eb){return _0x33d4eb[_0xb2a7('0x2a')](_0x30ea78)['then'](function(_0x4336d){return _0x4336d;});}return null;};}function removeEntity(_0x3cd0bc,_0x3e2c92){return function(_0x288309){if(_0x288309){return _0x288309[_0xb2a7('0x2b')]()[_0xb2a7('0x2c')](function(){_0x3cd0bc[_0xb2a7('0x26')](0xcc)[_0xb2a7('0x20')]();});}};}function handleEntityNotFound(_0x49af91,_0x303014){return function(_0x54a33d){if(!_0x54a33d){_0x49af91[_0xb2a7('0x1f')](0x194);}return _0x54a33d;};}function handleError(_0x2feb25,_0x236e2a){_0x236e2a=_0x236e2a||0x1f4;return function(_0x51283c){logger[_0xb2a7('0x2d')](_0x51283c[_0xb2a7('0x2e')]);if(_0x51283c['name']){delete _0x51283c[_0xb2a7('0x2f')];}_0x2feb25[_0xb2a7('0x26')](_0x236e2a)[_0xb2a7('0x30')](_0x51283c);};}exports['index']=function(_0x437c48,_0x309283){var _0x24b1a9={},_0x12d150={},_0x5813e0={'count':0x0,'rows':[]};var _0x35a98c=_['map'](db['UserProfile'][_0xb2a7('0x31')],function(_0x2f3b3f){return{'name':_0x2f3b3f['fieldName'],'type':_0x2f3b3f['type'][_0xb2a7('0x32')]};});_0x12d150[_0xb2a7('0x33')]=_[_0xb2a7('0x34')](_0x35a98c,'name');_0x12d150[_0xb2a7('0x35')]=_[_0xb2a7('0x36')](_0x437c48[_0xb2a7('0x35')]);_0x12d150[_0xb2a7('0x37')]=_[_0xb2a7('0x38')](_0x12d150[_0xb2a7('0x33')],_0x12d150[_0xb2a7('0x35')]);_0x24b1a9['attributes']=_[_0xb2a7('0x38')](_0x12d150[_0xb2a7('0x33')],qs['fields'](_0x437c48[_0xb2a7('0x35')][_0xb2a7('0x39')]));_0x24b1a9['attributes']=_0x24b1a9[_0xb2a7('0x3a')][_0xb2a7('0x3b')]?_0x24b1a9[_0xb2a7('0x3a')]:_0x12d150[_0xb2a7('0x33')];if(!_0x437c48[_0xb2a7('0x35')]['hasOwnProperty'](_0xb2a7('0x3c'))){_0x24b1a9['limit']=qs[_0xb2a7('0x24')](_0x437c48[_0xb2a7('0x35')][_0xb2a7('0x24')]);_0x24b1a9[_0xb2a7('0x22')]=qs[_0xb2a7('0x22')](_0x437c48['query']['offset']);}_0x24b1a9[_0xb2a7('0x3d')]=qs[_0xb2a7('0x3e')](_0x437c48[_0xb2a7('0x35')][_0xb2a7('0x3e')]);_0x24b1a9[_0xb2a7('0x3f')]=qs[_0xb2a7('0x37')](_[_0xb2a7('0x40')](_0x437c48[_0xb2a7('0x35')],_0x12d150[_0xb2a7('0x37')]),_0x35a98c);if(_0x437c48['query'][_0xb2a7('0x41')]){_0x24b1a9[_0xb2a7('0x3f')]=_['merge'](_0x24b1a9[_0xb2a7('0x3f')],{'$or':_[_0xb2a7('0x34')](_0x35a98c,function(_0x5a84d4){if(_0x5a84d4[_0xb2a7('0x42')]!=='VIRTUAL'){var _0x108edf={};_0x108edf[_0x5a84d4[_0xb2a7('0x2f')]]={'$like':'%'+_0x437c48['query'][_0xb2a7('0x41')]+'%'};return _0x108edf;}})});}_0x24b1a9=_[_0xb2a7('0x43')]({},_0x24b1a9,_0x437c48[_0xb2a7('0x44')]);var _0x2cf6a1={'where':_0x24b1a9[_0xb2a7('0x3f')]};return db[_0xb2a7('0x45')][_0xb2a7('0x25')](_0x2cf6a1)[_0xb2a7('0x2c')](function(_0xcfc72e){_0x5813e0['count']=_0xcfc72e;if(_0x437c48[_0xb2a7('0x35')][_0xb2a7('0x46')]){_0x24b1a9[_0xb2a7('0x47')]=[{'all':!![]}];}return db[_0xb2a7('0x45')][_0xb2a7('0x48')](_0x24b1a9);})['then'](function(_0x46368f){_0x5813e0[_0xb2a7('0x49')]=_0x46368f;return _0x5813e0;})['then'](respondWithFilteredResult(_0x309283,_0x24b1a9))[_0xb2a7('0x4a')](handleError(_0x309283,null));};exports['show']=function(_0x4debee,_0x426aa7){var _0x3966e={'raw':![],'where':{'id':_0x4debee['params']['id']}},_0x1123c0={};_0x1123c0[_0xb2a7('0x33')]=_[_0xb2a7('0x36')](db['UserProfile'][_0xb2a7('0x31')]);_0x1123c0['query']=_['keys'](_0x4debee['query']);_0x1123c0[_0xb2a7('0x37')]=_[_0xb2a7('0x38')](_0x1123c0[_0xb2a7('0x33')],_0x1123c0[_0xb2a7('0x35')]);_0x3966e[_0xb2a7('0x3a')]=_[_0xb2a7('0x38')](_0x1123c0[_0xb2a7('0x33')],qs[_0xb2a7('0x39')](_0x4debee[_0xb2a7('0x35')][_0xb2a7('0x39')]));_0x3966e['attributes']=_0x3966e[_0xb2a7('0x3a')][_0xb2a7('0x3b')]?_0x3966e['attributes']:_0x1123c0[_0xb2a7('0x33')];if(_0x4debee[_0xb2a7('0x35')][_0xb2a7('0x46')]){_0x3966e['include']=[{'all':!![]}];}_0x3966e=_[_0xb2a7('0x43')]({},_0x3966e,_0x4debee['options']);return db[_0xb2a7('0x45')][_0xb2a7('0x4b')](_0x3966e)['then'](handleEntityNotFound(_0x426aa7,null))[_0xb2a7('0x2c')](respondWithResult(_0x426aa7,null))[_0xb2a7('0x4a')](handleError(_0x426aa7,null));};exports[_0xb2a7('0x4c')]=function(_0x1056a4,_0x2feed1){return db['UserProfile'][_0xb2a7('0x4c')](_0x1056a4[_0xb2a7('0x4d')],{})[_0xb2a7('0x2c')](respondWithResult(_0x2feed1,0xc9))[_0xb2a7('0x4a')](handleError(_0x2feed1,null));};exports['clone']=function(_0x28e36f,_0x18c4bf){var _0x5b5545={'where':{'id':_0x28e36f['params']['id']}},_0x118cb8={};_0x118cb8[_0xb2a7('0x33')]=_[_0xb2a7('0x36')](db['UserProfile'][_0xb2a7('0x31')]);_0x5b5545['attributes']=_[_0xb2a7('0x38')](_0x118cb8[_0xb2a7('0x33')],qs['fields'](_0x28e36f[_0xb2a7('0x35')]['fields']));_0x5b5545[_0xb2a7('0x3a')]=_0x5b5545[_0xb2a7('0x3a')][_0xb2a7('0x3b')]?_0x5b5545[_0xb2a7('0x3a')]:_0x118cb8['model'];if(_0x28e36f['query'][_0xb2a7('0x46')]){_0x5b5545[_0xb2a7('0x47')]=[{'all':!![]}];}_0x5b5545=_['merge']({},_0x5b5545,_0x28e36f['options']);return db[_0xb2a7('0x45')][_0xb2a7('0x4b')](_0x5b5545)[_0xb2a7('0x2c')](handleEntityNotFound(_0x18c4bf,null))[_0xb2a7('0x2c')](function(_0x469b82){if(_0x469b82){var _0x178837=_0x469b82[_0xb2a7('0x4e')]({'plain':!![]});_0x178837=qs[_0xb2a7('0x4f')](_0x178837,['id',_0xb2a7('0x50'),_0xb2a7('0x51'),_0xb2a7('0x52')]);_0x28e36f[_0xb2a7('0x4d')]=_[_0xb2a7('0x4f')](_0x28e36f[_0xb2a7('0x4d')],['id',_0xb2a7('0x50'),'updatedAt']);return db['sequelize'][_0xb2a7('0x53')](function(_0x2f99e){return db[_0xb2a7('0x45')][_0xb2a7('0x4c')](_[_0xb2a7('0x43')](_0x178837,_0x28e36f[_0xb2a7('0x4d')]),{'include':_0x28e36f[_0xb2a7('0x35')][_0xb2a7('0x46')]?[{'all':!![]}]:undefined,'transaction':_0x2f99e})['then'](function(_0x25a609){var _0x347367=_0x25a609[_0xb2a7('0x4e')]({'plain':!![]});return db[_0xb2a7('0x54')]['findAll']({'where':{'userProfileId':_0x28e36f['params']['id']},'raw':!![]})['then'](function(_0x402107){if(_0x402107){return BPromise['each'](_0x402107,function(_0x17f58b){return new BPromise(function(_0x9cc496,_0x33066d){if(_0x17f58b[_0xb2a7('0x55')]===null||_0x17f58b[_0xb2a7('0x55')]===0x1)_0x9cc496(null);return db[_0xb2a7('0x56')][_0xb2a7('0x48')]({'where':{'sectionId':_0x17f58b['id']},'raw':!![]})['then'](function(_0x535645){var _0x3e1da5=_['map'](_0x535645,function(_0x1f656c){return qs[_0xb2a7('0x4f')](_0x1f656c,['id',_0xb2a7('0x50'),'updatedAt',_0xb2a7('0x57')]);});_0x9cc496(_0x3e1da5);})[_0xb2a7('0x4a')](function(_0x247077){_0x33066d(_0x247077);});})[_0xb2a7('0x2c')](function(_0x8a4731){var _0x6ad79a=qs[_0xb2a7('0x4f')](_0x17f58b,['id',_0xb2a7('0x50'),_0xb2a7('0x51')]);_0x6ad79a[_0xb2a7('0x58')]=_0x347367['id'];if(_0x8a4731)_0x6ad79a[_0xb2a7('0x59')]=_0x8a4731;return _0x6ad79a;})[_0xb2a7('0x2c')](function(_0x371d87){return db['UserProfileSection'][_0xb2a7('0x4c')](_0x371d87,{'include':[{'model':db[_0xb2a7('0x56')],'as':_0xb2a7('0x59')}],'raw':!![],'transaction':_0x2f99e});});})[_0xb2a7('0x2c')](function(){return _0x347367;});}});});});}})['then'](respondWithResult(_0x18c4bf,0xc9))[_0xb2a7('0x4a')](handleError(_0x18c4bf,null));};exports[_0xb2a7('0x2a')]=function(_0x40fcc1,_0x3359c0){if(_0x40fcc1['body']['id']){delete _0x40fcc1[_0xb2a7('0x4d')]['id'];}return db[_0xb2a7('0x45')][_0xb2a7('0x4b')]({'where':{'id':_0x40fcc1[_0xb2a7('0x5a')]['id']}})[_0xb2a7('0x2c')](handleEntityNotFound(_0x3359c0,null))['then'](saveUpdates(_0x40fcc1[_0xb2a7('0x4d')],null))[_0xb2a7('0x2c')](respondWithResult(_0x3359c0,null))[_0xb2a7('0x4a')](handleError(_0x3359c0,null));};exports['destroy']=function(_0x56362d,_0x24b459){return db['UserProfile']['find']({'where':{'id':_0x56362d[_0xb2a7('0x5a')]['id']}})[_0xb2a7('0x2c')](handleEntityNotFound(_0x24b459,null))[_0xb2a7('0x2c')](removeEntity(_0x24b459,null))[_0xb2a7('0x4a')](handleError(_0x24b459,null));};exports['describe']=function(_0x4d7bac,_0x1594b8){return db[_0xb2a7('0x45')][_0xb2a7('0x5b')]()['then'](respondWithResult(_0x1594b8,null))[_0xb2a7('0x4a')](handleError(_0x1594b8,null));};exports[_0xb2a7('0x5c')]=function(_0x18ec8f,_0x18911a){var _0x8ff074=_0x18ec8f[_0xb2a7('0x4d')];return db['UserProfile'][_0xb2a7('0x4b')]({'where':{'id':_0x18ec8f[_0xb2a7('0x5a')]['id']}})['then'](handleEntityNotFound(_0x18911a,null))[_0xb2a7('0x2c')](function(_0x247395){if(_0x247395){return db[_0xb2a7('0x5d')]['transaction'](function(_0x1191ab){return db[_0xb2a7('0x54')][_0xb2a7('0x2b')]({'where':{'userProfileId':_0x18ec8f[_0xb2a7('0x5a')]['id'],'sectionId':_[_0xb2a7('0x34')](_0x8ff074,function(_0x341d28){return _0x341d28[_0xb2a7('0x57')];})},'transaction':_0x1191ab})[_0xb2a7('0x2c')](function(){var _0x3b0735=_[_0xb2a7('0x34')](_0x8ff074,function(_0x3c2629){_0x3c2629['userProfileId']=_0x18ec8f[_0xb2a7('0x5a')]['id'];return _0x3c2629;});var _0xa88c53=[];return BPromise['each'](_0x3b0735,function(_0x579c8b){return db[_0xb2a7('0x54')][_0xb2a7('0x4c')](_0x579c8b,{'include':[{'model':db[_0xb2a7('0x56')],'as':'Resources'}],'raw':!![],'transaction':_0x1191ab})[_0xb2a7('0x2c')](function(_0x4afaa8){_0xa88c53[_0xb2a7('0x5e')](_0x4afaa8['get']({'plain':!![]}));});})[_0xb2a7('0x2c')](function(){return _0xa88c53;});});});}})['then'](function(_0x24cc75){return _0x24cc75;})[_0xb2a7('0x2c')](respondWithResult(_0x18911a,null))[_0xb2a7('0x4a')](handleError(_0x18911a,null));};exports[_0xb2a7('0x5f')]=function(_0x49e6d8,_0x42c246){var _0x22fb51;return db[_0xb2a7('0x45')][_0xb2a7('0x4b')]({'where':{'id':_0x49e6d8[_0xb2a7('0x5a')]['id']},'attributes':['id','name']})[_0xb2a7('0x2c')](handleEntityNotFound(_0x42c246,null))[_0xb2a7('0x2c')](function(_0x1e597b){if(_0x1e597b){_0x22fb51=_0x1e597b;return db[_0xb2a7('0x54')][_0xb2a7('0x2b')]({'where':{'userProfileId':_0x49e6d8[_0xb2a7('0x5a')]['id'],'sectionId':_0x49e6d8['query'][_0xb2a7('0x60')]}});}})[_0xb2a7('0x2c')](function(){return _0x22fb51;})[_0xb2a7('0x2c')](respondWithStatusCode(_0x42c246,null))[_0xb2a7('0x4a')](handleError(_0x42c246,null));};exports['getSections']=function(_0x1f0ee4,_0xe74ef4){var _0x401720=[];var _0x2ce574=[];return db[_0xb2a7('0x54')][_0xb2a7('0x48')]({'where':{'userProfileId':_0x1f0ee4['params']['id']},'raw':!![]})[_0xb2a7('0x2c')](function(_0x349e7a){_0x401720=_[_0xb2a7('0x41')](_0x349e7a,function(_0x5857de){return _0x5857de[_0xb2a7('0x61')]===0x1||_[_0xb2a7('0x62')]([0x3eb,0x709],_0x5857de[_0xb2a7('0x57')]);});if(!_[_0xb2a7('0x63')](_0x401720)){return _[_0xb2a7('0x34')](_0x401720,function(_0x92145c){return _0x92145c[_0xb2a7('0x57')];});}else{return;}})['then'](function(_0x415299){if(_0x415299)_0x2ce574=_0x415299;if(_['includes'](_0x2ce574,0x64)){var _0x5642bb=_['find'](_0x401720,{'sectionId':0x64});return hasDefaultDashboard(_0x5642bb)[_0xb2a7('0x2c')](function(_0x3c4ed){return _[_0xb2a7('0x34')](_0x401720,function(_0x39b829){if(_0x39b829[_0xb2a7('0x57')]===0x64){_0x39b829['subsections']=_0x3c4ed;}return _0x39b829;});});}else{return;}})[_0xb2a7('0x2c')](function(_0x56ca04){if(_0x56ca04)_0x401720=_0x56ca04;if(_[_0xb2a7('0x62')](_0x2ce574,0x3eb)){var _0x1500c3=_['find'](_0x401720,{'sectionId':0x3eb});return getCustomDashboards(_0x1500c3)[_0xb2a7('0x2c')](function(_0x2b9c20){return _[_0xb2a7('0x34')](_0x401720,function(_0x48eff6){if(_0x1500c3[_0xb2a7('0x61')]){if(_0x48eff6[_0xb2a7('0x57')]===0x3eb){_0x48eff6['subsections']=_0x2b9c20;}}else{if(_0x48eff6[_0xb2a7('0x57')]===0x64){if(!_0x48eff6[_0xb2a7('0x64')]){_0x48eff6[_0xb2a7('0x64')]=[];}_0x48eff6[_0xb2a7('0x64')]=_0x48eff6['subsections'][_0xb2a7('0x65')](_0x2b9c20);}}return _0x48eff6;});});}else{return;}})[_0xb2a7('0x2c')](function(_0x39503b){if(_0x39503b)_0x401720=_0x39503b;if(_[_0xb2a7('0x62')](_0x2ce574,0x709)){var _0x65a402=_['find'](_0x401720,{'sectionId':0x709});return getPlugins(_0x65a402)[_0xb2a7('0x2c')](function(_0x4eecbc){if(_0x65a402['enabled']){return _[_0xb2a7('0x34')](_0x401720,function(_0x543541){if(_0x543541['sectionId']===0x709){_0x543541[_0xb2a7('0x64')]=_0x4eecbc;}return _0x543541;});}else{var _0x234671={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4eecbc};var _0x4271c7=_['map'](_0x401720);_0x4271c7[_0xb2a7('0x5e')](_0x234671);return _0x4271c7;}});}else{return;}})[_0xb2a7('0x2c')](function(_0x3ec67a){if(_0x3ec67a)_0x401720=_0x3ec67a;return _['filter'](_0x401720,[_0xb2a7('0x61'),0x1]);})[_0xb2a7('0x2c')](respondWithResult(_0xe74ef4,null))['catch'](handleError(_0xe74ef4,null));};function hasDefaultDashboard(_0x109a89){var _0x14008a=[0x65];return new BPromise(function(_0x5939af,_0xe7adea){try{if(_0x109a89[_0xb2a7('0x55')]){_0x5939af(_0x14008a);}else{return db[_0xb2a7('0x56')][_0xb2a7('0x66')]({'where':{'sectionId':_0x109a89['id']},'raw':!![]})[_0xb2a7('0x2c')](function(_0x2c05ed){_0x2c05ed?_0x5939af(_0x14008a):_0x5939af();});}}catch(_0x2b7576){_0xe7adea(_0x2b7576);}});}function getCustomDashboards(_0x1dda8a){var _0x2d19fa=[];return new BPromise(function(_0x3a652b,_0x5f3d82){try{if(_0x1dda8a[_0xb2a7('0x55')]){return db[_0xb2a7('0x67')][_0xb2a7('0x48')]({'raw':!![]})['then'](function(_0x22b487){_0x22b487[_0xb2a7('0x68')](function(_0x55db3e){_0x2d19fa[_0xb2a7('0x5e')](_0x55db3e['id']+0x1869f);});_0x3a652b(_0x2d19fa);});}else{return db[_0xb2a7('0x56')]['findAll']({'where':{'sectionId':_0x1dda8a['id']},'raw':!![]})['then'](function(_0x5caafc){_0x5caafc[_0xb2a7('0x68')](function(_0x32339d){_0x2d19fa['push'](_0x32339d[_0xb2a7('0x69')]+0x1869f);});_0x3a652b(_0x2d19fa);});}}catch(_0x2f2a24){_0x5f3d82(_0x2f2a24);}});}function getPlugins(_0x41330e){var _0xc7d298=[];return new BPromise(function(_0x11d975,_0x1c2d86){try{if(_0x41330e[_0xb2a7('0x55')]){return db['Plugin'][_0xb2a7('0x48')]({'raw':!![]})[_0xb2a7('0x2c')](function(_0x48c205){_0x48c205['forEach'](function(_0x17c7ac){_0xc7d298[_0xb2a7('0x5e')](_0x17c7ac['id']+0x15b38);});_0x11d975(_0xc7d298);});}else{return db[_0xb2a7('0x56')][_0xb2a7('0x48')]({'where':{'sectionId':_0x41330e['id']},'raw':!![]})[_0xb2a7('0x2c')](function(_0x220cfc){_0x220cfc[_0xb2a7('0x68')](function(_0x495c19){_0xc7d298[_0xb2a7('0x5e')](_0x495c19[_0xb2a7('0x69')]+0x15b38);});_0x11d975(_0xc7d298);});}}catch(_0xda87f4){_0x1c2d86(_0xda87f4);}});}exports[_0xb2a7('0x6a')]=function(_0x475b5e,_0x3a2ba3){return db[_0xb2a7('0x45')][_0xb2a7('0x4b')]({'where':{'id':_0x475b5e[_0xb2a7('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3a2ba3,null))[_0xb2a7('0x2c')](function(_0x44f746){if(_0x44f746){return db[_0xb2a7('0x5d')][_0xb2a7('0x53')](function(_0x65354){return db[_0xb2a7('0x54')][_0xb2a7('0x48')]({'where':{'userProfileId':_0x475b5e[_0xb2a7('0x5a')]['id']},'attributes':['id'],'raw':!![]})[_0xb2a7('0x2c')](function(_0x5ab4d7){if(_0x5ab4d7){return db['UserProfileSection'][_0xb2a7('0x2b')]({'where':{'userProfileId':_0x475b5e[_0xb2a7('0x5a')]['id'],'id':_[_0xb2a7('0x34')](_0x5ab4d7,function(_0x28c891){return _0x28c891['id'];})},'transaction':_0x65354});}})[_0xb2a7('0x2c')](function(_0x4a1519){var _0x3bb30b=_[_0xb2a7('0x34')](_0x475b5e[_0xb2a7('0x4d')],function(_0x3a8903){_0x3a8903[_0xb2a7('0x58')]=_0x475b5e[_0xb2a7('0x5a')]['id'];return _0x3a8903;});return db[_0xb2a7('0x54')][_0xb2a7('0x6b')](_0x3bb30b,{'raw':!![],'transaction':_0x65354});})['then'](function(_0x1b17a6){var _0xcb989f=_[_0xb2a7('0x41')](_[_0xb2a7('0x34')](_0x1b17a6,function(_0x2ebbfc){return _0x2ebbfc['get']({'plain':!![]});}),{'includeAll':![]});if(_0xcb989f){return db[_0xb2a7('0x54')][_0xb2a7('0x48')]({'where':{'userProfileId':_0x475b5e['params']['id'],'sectionId':_[_0xb2a7('0x34')](_0xcb989f,function(_0x4f0367){return _0x4f0367[_0xb2a7('0x57')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xb2a7('0x2c')](function(_0x48ea88){var _0x4c5654=_[_0xb2a7('0x34')](_0x475b5e[_0xb2a7('0x4d')],function(_0x1e115f){_0x1e115f[_0xb2a7('0x58')]=_0x475b5e[_0xb2a7('0x5a')]['id'];return _0x1e115f;});return db[_0xb2a7('0x56')][_0xb2a7('0x6b')](_0x4c5654,{'raw':!![],'transaction':_0x65354});});}})[_0xb2a7('0x4a')](handleError(_0x3a2ba3,null));});}})[_0xb2a7('0x2c')](function(_0x10f3a7){var _0x43eb42=_[_0xb2a7('0x34')](_0x10f3a7,function(_0x46836f){return _0x46836f[_0xb2a7('0x4e')]({'plain':!![]});});})[_0xb2a7('0x2c')](respondWithResult(_0x3a2ba3,null))[_0xb2a7('0x4a')](handleError(_0x3a2ba3,null));};exports[_0xb2a7('0x6c')]=function(_0x5eaa73,_0x5ee55d,_0x22882e){return db[_0xb2a7('0x45')][_0xb2a7('0x4b')]({'where':{'id':_0x5eaa73[_0xb2a7('0x5a')]['id']}})[_0xb2a7('0x2c')](handleEntityNotFound(_0x5ee55d,null))[_0xb2a7('0x2c')](function(_0xa75f6){if(_0xa75f6){return _0xa75f6[_0xb2a7('0x6c')](_0x5eaa73[_0xb2a7('0x35')]['ids']);}})['then'](respondWithStatusCode(_0x5ee55d,null))[_0xb2a7('0x4a')](handleError(_0x5ee55d,null));};exports['getResources']=function(_0x3269fb,_0x200856){var _0x5e6c76={};if(!_0x3269fb[_0xb2a7('0x35')][_0xb2a7('0x6d')])throw new Error(_0xb2a7('0x6e'));if(!_0x3269fb['query'][_0xb2a7('0x6f')](_0xb2a7('0x3c'))){_0x5e6c76[_0xb2a7('0x24')]=qs['limit'](_0x3269fb['query'][_0xb2a7('0x24')]);_0x5e6c76['offset']=qs[_0xb2a7('0x22')](_0x3269fb[_0xb2a7('0x35')][_0xb2a7('0x22')]);}return db[_0xb2a7('0x45')]['find']({'where':{'id':_0x3269fb[_0xb2a7('0x5a')]['id']}})[_0xb2a7('0x2c')](function(_0x1c2398){if(!_0x1c2398)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x3269fb['params']['id']);return db['UserProfile'][_0xb2a7('0x70')](_0x3269fb);})[_0xb2a7('0x2c')](respondWithFilteredResult(_0x200856,_0x5e6c76))['catch'](handleError(_0x200856,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index f387fa6..7db6c3e 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 _0x96fd=['setMaxListeners','save','remove','emit','hook','exports','../../mysqldb'];(function(_0xf4601d,_0x4bb96b){var _0x2f240f=function(_0xb1549f){while(--_0xb1549f){_0xf4601d['push'](_0xf4601d['shift']());}};_0x2f240f(++_0x4bb96b);}(_0x96fd,0x1e9));var _0xd96f=function(_0x3d6303,_0x5c65f8){_0x3d6303=_0x3d6303-0x0;var _0x4da744=_0x96fd[_0x3d6303];return _0x4da744;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xd96f('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xd96f('0x1')](0x0);var events={'afterCreate':_0xd96f('0x2'),'afterUpdate':'update','afterDestroy':_0xd96f('0x3')};function emitEvent(_0x110958){return function(_0x44f63c,_0x22b39b,_0x5d8681){UserProfileEvents[_0xd96f('0x4')](_0x110958+':'+_0x44f63c['id'],_0x44f63c);UserProfileEvents[_0xd96f('0x4')](_0x110958,_0x44f63c);_0x5d8681(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xd96f('0x5')](e,emitEvent(event));}}module[_0xd96f('0x6')]=UserProfileEvents; \ No newline at end of file +var _0x6f83=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserProfile','save'];(function(_0x142d3e,_0x353e86){var _0x493084=function(_0x14aa15){while(--_0x14aa15){_0x142d3e['push'](_0x142d3e['shift']());}};_0x493084(++_0x353e86);}(_0x6f83,0x72));var _0x36f8=function(_0x13e2ca,_0x1a3b3d){_0x13e2ca=_0x13e2ca-0x0;var _0x105595=_0x6f83[_0x13e2ca];return _0x105595;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x36f8('0x0'))['db'][_0x36f8('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x36f8('0x2'),'afterUpdate':_0x36f8('0x3'),'afterDestroy':_0x36f8('0x4')};function emitEvent(_0x442b8b){return function(_0x456795,_0xf53947,_0x9ed336){UserProfileEvents[_0x36f8('0x5')](_0x442b8b+':'+_0x456795['id'],_0x456795);UserProfileEvents[_0x36f8('0x5')](_0x442b8b,_0x456795);_0x9ed336(null);};}for(var e in events){if(events[_0x36f8('0x6')](e)){var event=events[e];UserProfile[_0x36f8('0x7')](e,emitEvent(event));}}module[_0x36f8('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 651ae21..cf1aae5 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 _0xfb64=['dataValues','sms','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','name','UserProfileResource','AnalyticExtractedReport','type','resourceId','squareprojects','childModel','SquareProject','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','User','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','MailQueue','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','whatsappqueues','whatsappaccounts','WhatsappAccount','Team','voicequeues','queuecampaigns','users','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','triggers','Trigger','trunks','Trunk','variables','Variable','Plugin','Reports','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','InteractionId','from','ui.UserId\x20=\x20?','sequelize','toString','define','UserProfile','user_profiles','query','raw','mergeResources','isEmpty','length','push','UserProfileSection','find','ignore','union','model','all','intersection','attributes','fields','nolimit','limit','offset','filters','where','merge','key','foreignKey','forEach','options','include','reportType','default','DefaultReports','custom','reportId','count','rows','ids','customSorting','order','extraQueryConditions','includeAll','Tags','color','tag','ThroughTags','openTabs','true','chat'];(function(_0x5d52e2,_0xf8b97e){var _0x3d2554=function(_0x53ddb0){while(--_0x53ddb0){_0x5d52e2['push'](_0x5d52e2['shift']());}};_0x3d2554(++_0xf8b97e);}(_0xfb64,0xc3));var _0x4fb6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfb64[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4fb6('0x0'));var attributes=require(_0x4fb6('0x1'));var qs=require(_0x4fb6('0x2'));var squel=require(_0x4fb6('0x3'));module[_0x4fb6('0x4')]=function(_0x280190){var _0xc68515=_0x280190[_0x4fb6('0x5')];function _0x52ca1a(_0x1d5851,_0x10703){return new Promise(function(_0x3cb9b5,_0x2e1dfe){if(!_0x10703)return _0x3cb9b5(null);var _0x1af4d2=_0x10703[_0x4fb6('0x6')]?{[_0x10703[_0x4fb6('0x6')][_0x4fb6('0x7')]]:_0x10703[_0x4fb6('0x6')][_0x4fb6('0x8')]}:undefined;return _0xc68515[_0x1d5851][_0x4fb6('0x9')]({'where':_0x1af4d2,'raw':!![]})[_0x4fb6('0xa')](function(_0x1f0ba0){_0x10703[_0x4fb6('0xb')]=_[_0x4fb6('0xc')](_0x1f0ba0,'id');_0x3cb9b5(_0x10703);})[_0x4fb6('0xd')](function(_0x53cd6a){_0x2e1dfe(_0x53cd6a);});});}function _0x180132(_0x4d02b4,_0x406dd7){return new Promise(function(_0x1341d7,_0xfae96f){var _0x1a31dc=_0x4d02b4['filter']?{[_0x4d02b4[_0x4fb6('0x6')][_0x4fb6('0x7')]]:_0x4d02b4[_0x4fb6('0x6')][_0x4fb6('0x8')]}:undefined;return _0xc68515[_0x4d02b4['model']][_0x4fb6('0x9')]({'where':_0x1a31dc,'raw':!![]})[_0x4fb6('0xa')](function(_0x170357){_0x406dd7[_0x4fb6('0xb')]=_[_0x4fb6('0xc')](_0x170357,function(_0x25fa24){return _0x25fa24[_0x4fb6('0xe')];});_0x1341d7(_0x406dd7);})[_0x4fb6('0xd')](function(_0x38d040){_0xfae96f(_0x38d040);});});}function _0x511c9c(_0xd2f726,_0x44cdae,_0x3fcee7){if(!_0x44cdae)return Promise['resolve'](null);return new Promise(function(_0x12d89f,_0x26bfff){return _0xc68515[_0x4fb6('0xf')][_0x4fb6('0x9')]({'where':{'sectionId':_0x44cdae['id']},'raw':!![]})[_0x4fb6('0xa')](function(_0x460912){if(_0xd2f726[_0x4fb6('0x7')]&&_0xd2f726[_0x4fb6('0x7')]!=='id'){_0x44cdae[_0x4fb6('0xb')]=_[_0x4fb6('0xc')](_0x460912,function(_0x2100e1){return _0x2100e1[_0xd2f726[_0x4fb6('0x7')]];});}else{if(_0x3fcee7===_0x4fb6('0x10')){_0x44cdae['associatedResources']=_[_0x4fb6('0xc')](_0x460912,function(_0x358bd9){return{'id':_0x358bd9['resourceId'],'type':_0x358bd9[_0x4fb6('0x11')]};});}else{_0x44cdae['associatedResources']=_[_0x4fb6('0xc')](_0x460912,function(_0x41cb59){return _0x41cb59[_0x4fb6('0x12')];});}}_0x12d89f(_0x44cdae);})['catch'](function(_0x28d8ed){_0x26bfff(_0x28d8ed);});});}function _0x27846e(_0x18cab5,_0x31081e){var _0x719487={'parentSections':[]};switch(_0x18cab5['toLowerCase']()){case _0x4fb6('0x13'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x15');break;case'odbc':_0x719487['childModel']=_0x4fb6('0x16');break;case _0x4fb6('0x17'):_0x719487['childModel']=_0x4fb6('0x18');_0x719487[_0x4fb6('0x19')]=[{'name':_0x4fb6('0x1a'),'field':_0x4fb6('0xe'),'foreignKey':'projectName'}];break;case _0x4fb6('0x1b'):_0x719487[_0x4fb6('0x14')]='JscriptyProject';break;case _0x4fb6('0x1c'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x1d');_0x719487[_0x4fb6('0x19')]=[{'name':_0x4fb6('0x1e'),'field':'id','foreignKey':_0x4fb6('0x1f')}];break;case _0x4fb6('0x20'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x21');break;case _0x4fb6('0x22'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x23');break;case _0x4fb6('0x24'):_0x719487[_0x4fb6('0x14')]='CmCustomField';break;case'chatqueues':_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x25');break;case _0x4fb6('0x26'):_0x719487[_0x4fb6('0x14')]='ChatWebsite';break;case _0x4fb6('0x27'):_0x719487['childModel']=_0x4fb6('0x28');break;case _0x4fb6('0x29'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x2a');break;case _0x4fb6('0x2b'):case _0x4fb6('0x2c'):case'outboundroutes':_0x719487[_0x4fb6('0x14')]='VoiceExtension';break;case'contexts':_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x2d');break;case _0x4fb6('0x2e'):_0x719487['childModel']=_0x4fb6('0x2f');break;case _0x4fb6('0x30'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x31');_0x719487[_0x4fb6('0x19')]=[{'name':_0x4fb6('0x32'),'field':_0x4fb6('0xe'),'foreignKey':_0x4fb6('0x33'),'model':'User','filter':{'field':_0x4fb6('0x34'),'value':[_0x4fb6('0x35')]}},{'name':_0x4fb6('0x36'),'field':_0x4fb6('0xe'),'foreignKey':_0x4fb6('0x33'),'model':_0x4fb6('0x37'),'filter':{'field':_0x4fb6('0x34'),'value':[_0x4fb6('0x38')]}},{'name':_0x4fb6('0x39'),'field':'name','foreignKey':_0x4fb6('0x3a'),'model':_0x4fb6('0x3b'),'filter':{'field':_0x4fb6('0x11'),'value':[_0x4fb6('0x3c')]}},{'name':_0x4fb6('0x3d'),'field':'name','foreignKey':'queue','model':_0x4fb6('0x3b'),'filter':{'field':'type','value':['outbound']}}];break;case _0x4fb6('0x3e'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x3f');break;case _0x4fb6('0x40'):_0x719487[_0x4fb6('0x14')]='VoiceChanSpy';break;case _0x4fb6('0x41'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x42');break;case _0x4fb6('0x43'):_0x719487[_0x4fb6('0x14')]='Campaign';break;case'mailqueues':_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x44');break;case'mailaccounts':_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x45');break;case _0x4fb6('0x46'):_0x719487[_0x4fb6('0x14')]='MailSubstatus';break;case _0x4fb6('0x47'):_0x719487['childModel']=_0x4fb6('0x48');break;case _0x4fb6('0x49'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x4a');break;case _0x4fb6('0x4b'):_0x719487['childModel']='SmsQueue';break;case _0x4fb6('0x4c'):_0x719487[_0x4fb6('0x14')]='SmsAccount';break;case _0x4fb6('0x4d'):_0x719487[_0x4fb6('0x14')]='WhatsappQueue';break;case _0x4fb6('0x4e'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x4f');break;case'teams':_0x719487['childModel']=_0x4fb6('0x50');break;case _0x4fb6('0x51'):case _0x4fb6('0x52'):_0x719487[_0x4fb6('0x14')]='VoiceQueue';if(_0x31081e){_0x719487[_0x4fb6('0x19')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x4fb6('0x53'):case'agents':case _0x4fb6('0x54'):_0x719487['childModel']=_0x4fb6('0x37');if(_0x31081e){_0x719487[_0x4fb6('0x19')]=[{'name':_0x4fb6('0x55'),'filter':{'field':_0x4fb6('0x34'),'value':[_0x4fb6('0x56'),_0x4fb6('0x57')]},'ignore':!![]},{'name':'Agents'},{'name':_0x4fb6('0x36')}];}break;case _0x4fb6('0x58'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x59');break;case _0x4fb6('0x5a'):_0x719487['childModel']=_0x4fb6('0x5b');break;case'freshdeskaccounts':_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x5c');break;case'sugarcrmaccounts':_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x5d');break;case _0x4fb6('0x5e'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x5f');break;case _0x4fb6('0x60'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x61');break;case _0x4fb6('0x62'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x37');break;case _0x4fb6('0x63'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x64');break;case _0x4fb6('0x65'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x66');break;case _0x4fb6('0x67'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x68');break;case _0x4fb6('0x69'):_0x719487['childModel']=_0x4fb6('0x6a');break;case'pauses':_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x6b');break;case _0x4fb6('0x6c'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x6d');break;case _0x4fb6('0x6e'):_0x719487['childModel']=_0x4fb6('0x6f');break;case _0x4fb6('0x70'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x71');break;case _0x4fb6('0x72'):_0x719487[_0x4fb6('0x14')]='Template';break;case _0x4fb6('0x73'):_0x719487['childModel']=_0x4fb6('0x74');break;case _0x4fb6('0x75'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x76');break;case _0x4fb6('0x77'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x78');break;case'plugins':_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x79');break;case'extractedreports':_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x10');_0x719487[_0x4fb6('0x19')]=[{'name':_0x4fb6('0x7a'),'field':'id','foreignKey':'reportId'}];break;case _0x4fb6('0x7b'):_0x719487['childModel']=_0x4fb6('0x7c');break;}return _0x719487;}function _0x3a5437(_0x27b8f5,_0x423afd){var _0x3a4b08=_0x27b8f5[_0x4fb6('0x7d')](0x0)[_0x4fb6('0x7e')]()+_0x27b8f5[_0x4fb6('0x7f')](0x1);var _0x5ce53c={'type':_0xc68515[_0x4fb6('0x80')][_0x4fb6('0x81')][_0x4fb6('0x82')],'raw':!![]};return new Promise(function(_0x2db5e3,_0x32bb0c){var _0xd33c81=squel[_0x4fb6('0x83')]()[_0x4fb6('0x7')]('ui.'+_0x3a4b08+_0x4fb6('0x84'),'id')[_0x4fb6('0x7')]('ui.createdAt')[_0x4fb6('0x85')]('user_has_'+_0x27b8f5+'_interactions','ui')['where'](_0x4fb6('0x86'),_0x423afd['id']);return _0xc68515[_0x4fb6('0x87')]['query'](_0xd33c81[_0x4fb6('0x88')](),_0x5ce53c)['then'](function(_0x3a3610){_0x423afd[_0x3a4b08+'OpenTabs']=_0x3a3610;_0x2db5e3(_0x3a3610);})[_0x4fb6('0xd')](function(_0x5ab619){_0x32bb0c(_0x5ab619);});});}return _0x280190[_0x4fb6('0x89')](_0x4fb6('0x8a'),attributes,{'tableName':_0x4fb6('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x87c131){var _0x5572c1={'raw':_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0x8d')],'where':{}};var _0x59d78a={};var _0x5aea39={'count':0x0,'rows':[]};var _0x5a305b=_0x87c131['query']['section'];var _0x4f138c=_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0x8e')]||![];var _0x5aceac=_0x27846e(_0x5a305b,_0x4f138c);if(!_0x5aceac[_0x4fb6('0x14')])throw new Error('Invalid\x20section\x20\x27'+_0x5a305b+'\x27');var _0x227fb6=[{'name':_0x5a305b}];if(!_[_0x4fb6('0x8f')](_0x5aceac['parentSections']))_0x227fb6=_0x5aceac['parentSections'];var _0x35b14f=[];for(var _0x412976=0x0;_0x412976<_0x227fb6[_0x4fb6('0x90')];_0x412976++){_0x35b14f[_0x4fb6('0x91')](_0xc68515[_0x4fb6('0x92')][_0x4fb6('0x93')]({'where':{'userProfileId':_0x87c131['params']['id'],'name':_0x227fb6[_0x412976][_0x4fb6('0xe')]},'raw':!![]}));}return Promise['all'](_0x35b14f)[_0x4fb6('0xa')](function(_0x5ae23d){var _0x40fee9=_[_0x4fb6('0x6')](_0x5ae23d,function(_0x4fa542){return _0x4fa542?_0x4fa542:undefined;});var _0x383482=_[_0x4fb6('0x6')](_0x227fb6,[_0x4fb6('0x94'),!![]]);var _0x15da2c=_['isEmpty'](_0x40fee9)&&_[_0x4fb6('0x8f')](_0x383482)?null:_[_0x4fb6('0x95')](_0x383482,_0x40fee9);if(!_0x15da2c)return null;var _0x5d6bf4=[];for(var _0x20f058=0x0;_0x20f058<_0x15da2c['length'];_0x20f058++){var _0x33dedd=_['find'](_0x227fb6,function(_0x46003e){return _0x15da2c[_0x20f058]?_0x46003e['name']===_0x15da2c[_0x20f058][_0x4fb6('0xe')]:null;});if(_0x33dedd){if(_0x15da2c[_0x20f058][_0x4fb6('0x94')]){_0x5d6bf4[_0x4fb6('0x91')](_0x52ca1a(_0x5aceac[_0x4fb6('0x14')],_0x15da2c[_0x20f058]));}else{if(!_0x15da2c[_0x20f058]['autoAssociation']){_0x5d6bf4[_0x4fb6('0x91')](_0x511c9c(_0x33dedd,_0x15da2c[_0x20f058],_0x5aceac[_0x4fb6('0x14')]));}else{if(_0x33dedd[_0x4fb6('0x96')]){_0x5d6bf4['push'](_0x180132(_0x33dedd,_0x15da2c[_0x20f058]));}}}}}return Promise[_0x4fb6('0x97')](_0x5d6bf4);})['then'](function(_0x518099){var _0x4b608d=_0x518099;var _0x39979f=null;if(_0x4b608d){_0x39979f=_0x4b608d[_0x4fb6('0x90')]===0x1?_0x4b608d[0x0]:null;}if(!_0x39979f&&!_0x4b608d)return _0x5aea39;var _0x4b794a=_0xc68515[_0x5aceac[_0x4fb6('0x14')]]['rawAttributes'];_0x59d78a[_0x4fb6('0x96')]=_['keys'](_0x4b794a);_0x59d78a[_0x4fb6('0x8c')]=_['keys'](_0x87c131[_0x4fb6('0x8c')]);_0x59d78a['filters']=_[_0x4fb6('0x98')](_0x59d78a[_0x4fb6('0x96')],_0x59d78a[_0x4fb6('0x8c')]);_0x5572c1[_0x4fb6('0x99')]=_[_0x4fb6('0x98')](_0x59d78a[_0x4fb6('0x96')],qs[_0x4fb6('0x9a')](_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0x9a')]));_0x5572c1[_0x4fb6('0x99')]=_0x5572c1[_0x4fb6('0x99')][_0x4fb6('0x90')]?_0x5572c1[_0x4fb6('0x99')]:_0x59d78a[_0x4fb6('0x96')];if(!_0x87c131[_0x4fb6('0x8c')]['hasOwnProperty'](_0x4fb6('0x9b'))){_0x5572c1[_0x4fb6('0x9c')]=qs[_0x4fb6('0x9c')](_0x87c131['query']['limit']);_0x5572c1[_0x4fb6('0x9d')]=qs[_0x4fb6('0x9d')](_0x87c131[_0x4fb6('0x8c')]['offset']);}_0x5572c1['order']=qs['sort'](_0x87c131[_0x4fb6('0x8c')]['sort']);_0x5572c1['where']=qs[_0x4fb6('0x9e')](_['pick'](_0x87c131[_0x4fb6('0x8c')],_0x59d78a[_0x4fb6('0x9e')]));if(_0x87c131['query'][_0x4fb6('0x6')]){_0x5572c1[_0x4fb6('0x9f')]=_[_0x4fb6('0xa0')](_0x5572c1[_0x4fb6('0x9f')],{'$or':_[_0x4fb6('0xc')](_0x4b794a,function(_0x410092){if(_0x410092[_0x4fb6('0x11')][_0x4fb6('0xa1')]!=='VIRTUAL'){var _0x28edd8={};_0x28edd8[_0x410092[_0x4fb6('0x7')]]={'$like':'%'+_0x87c131['query'][_0x4fb6('0x6')]+'%'};return _0x28edd8;}})});}var _0x261eec=[];var _0x181aae=null;var _0x327db8={};if(_0x39979f){_0x181aae=_['find'](_0x227fb6,[_0x4fb6('0xe'),_0x39979f['name']]);if(_0x181aae[_0x4fb6('0x7')]){_0x327db8={};if(_0x5aceac[_0x4fb6('0x14')]===_0x4fb6('0x10')){_0x327db8[_0x181aae[_0x4fb6('0xa2')]]=_['map'](_0x39979f[_0x4fb6('0xb')],'id');}else{_0x327db8[_0x181aae[_0x4fb6('0xa2')]]=_0x39979f['associatedResources'];}_0x261eec[_0x4fb6('0x91')](_0x327db8);}else{_0x5572c1[_0x4fb6('0x9f')]['id']=_0x39979f['associatedResources'];}}else{for(var _0x2d9902=0x0;_0x2d9902<_0x4b608d['length'];_0x2d9902++){_0x181aae=_[_0x4fb6('0x93')](_0x227fb6,[_0x4fb6('0xe'),_0x4b608d[_0x2d9902]['name']]);if(_0x181aae['field']){_0x327db8={};_0x327db8[_0x181aae['foreignKey']]=_0x4b608d[_0x2d9902][_0x4fb6('0xb')];_0x261eec[_0x4fb6('0x91')](_0x327db8);}else{if(!_0x5572c1[_0x4fb6('0x9f')]['id'])_0x5572c1[_0x4fb6('0x9f')]['id']=[];_0x4b608d[_0x2d9902]['associatedResources'][_0x4fb6('0xa3')](function(_0xa730b1){_0x5572c1[_0x4fb6('0x9f')]['id'][_0x4fb6('0x91')](_0xa730b1);});}}}if(!_[_0x4fb6('0x8f')](_0x261eec)){_0x5572c1['where']=_[_0x4fb6('0xa0')](_0x5572c1[_0x4fb6('0x9f')],{'$and':{'$or':_0x261eec}});}_0x5572c1=_[_0x4fb6('0xa0')]({},_0x5572c1,_0x87c131[_0x4fb6('0xa4')]);if(_0x39979f&&!_0x39979f['autoAssociation']&&_0x5aceac[_0x4fb6('0x14')]===_0x4fb6('0x10')){if(_0x87c131[_0x4fb6('0x8c')]['includeAll']){_0x5572c1[_0x4fb6('0xa5')]=[{'all':!![]}];}return _0xc68515[_0x5aceac[_0x4fb6('0x14')]][_0x4fb6('0x9')](_0x5572c1)[_0x4fb6('0xa')](function(_0x294e61){var _0xf30829=[];_0x294e61[_0x4fb6('0xa3')](function(_0x43ba66){var _0x28ac7c;switch(_0x43ba66[_0x4fb6('0xa6')]){case _0x4fb6('0xa7'):_0x28ac7c=_[_0x4fb6('0x93')](_0x39979f[_0x4fb6('0xb')],function(_0x346c78){return _0x346c78['id']===_0x43ba66['reportId']&&_0x346c78[_0x4fb6('0x11')]===_0x4fb6('0xa8');});break;case _0x4fb6('0xa9'):_0x28ac7c=_[_0x4fb6('0x93')](_0x39979f['associatedResources'],function(_0x5b45f3){return _0x5b45f3['id']===_0x43ba66[_0x4fb6('0xaa')]&&_0x5b45f3[_0x4fb6('0x11')]==='CustomReports';});break;}if(_0x28ac7c)_0xf30829[_0x4fb6('0x91')](_0x43ba66);});_0x5aea39[_0x4fb6('0xab')]=_0xf30829[_0x4fb6('0x90')];_0x5aea39[_0x4fb6('0xac')]=_0xf30829;return _0x5aea39;});}else{if(!_['isEmpty'](_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xad')])){_0x5572c1[_0x4fb6('0x9f')]['id']=_0x5572c1[_0x4fb6('0x9f')]['id']?_['intersection'](_0x5572c1[_0x4fb6('0x9f')]['id'],_0x87c131['query']['ids']):_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xad')];if(_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xae')]){_0x5572c1[_0x4fb6('0xaf')]=_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xae')];}}if(_0x87c131['query']['extraQueryConditions']){_0x5572c1['where']=_[_0x4fb6('0xa0')](_0x5572c1[_0x4fb6('0x9f')],{'$and':_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xb0')]});}return _0xc68515[_0x5aceac[_0x4fb6('0x14')]][_0x4fb6('0xab')]({'where':_0x5572c1['where']})['then'](function(_0x4fcb89){_0x5aea39['count']=_0x4fcb89;if(_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xb1')]){if(_0x5aceac[_0x4fb6('0x14')]==='CmContact'){_0x5572c1['include']=[{'model':_0xc68515[_0x4fb6('0x71')],'as':_0x4fb6('0xb2'),'attributes':['id',_0x4fb6('0xe'),_0x4fb6('0xb3')],'required':_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xb4')]?!![]:![]},{'model':_0xc68515[_0x4fb6('0x71')],'as':_0x4fb6('0xb5'),'attributes':['id',_0x4fb6('0xe'),'color'],'through':_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xb4')]?{'attributes':[],'where':{'TagId':_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xb4')]||undefined}}:{},'required':_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xb4')]?!![]:![]}];}else{_0x5572c1['include']=[{'all':!![]}];}}return _0xc68515[_0x5aceac['childModel']][_0x4fb6('0x9')](_0x5572c1);})[_0x4fb6('0xa')](function(_0x59e745){_0x5aea39[_0x4fb6('0xac')]=_0x59e745;if(_0x5a305b==='Agents'&&_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xb6')]===_0x4fb6('0xb7')){var _0x5e5715=[];for(var _0x5c924c=0x0;_0x5c924c<_0x5aea39[_0x4fb6('0xac')][_0x4fb6('0x90')];_0x5c924c++){_0x5e5715[_0x4fb6('0x91')](_0x3a5437(_0x4fb6('0xb8'),_0x5aea39[_0x4fb6('0xac')][_0x5c924c][_0x4fb6('0xb9')]));_0x5e5715[_0x4fb6('0x91')](_0x3a5437(_0x4fb6('0xba'),_0x5aea39[_0x4fb6('0xac')][_0x5c924c]['dataValues']));_0x5e5715[_0x4fb6('0x91')](_0x3a5437('fax',_0x5aea39[_0x4fb6('0xac')][_0x5c924c][_0x4fb6('0xb9')]));_0x5e5715[_0x4fb6('0x91')](_0x3a5437(_0x4fb6('0xbb'),_0x5aea39[_0x4fb6('0xac')][_0x5c924c][_0x4fb6('0xb9')]));_0x5e5715[_0x4fb6('0x91')](_0x3a5437(_0x4fb6('0xbc'),_0x5aea39['rows'][_0x5c924c][_0x4fb6('0xb9')]));_0x5e5715[_0x4fb6('0x91')](_0x3a5437(_0x4fb6('0xbd'),_0x5aea39[_0x4fb6('0xac')][_0x5c924c]['dataValues']));}return Promise[_0x4fb6('0x97')](_0x5e5715)['then'](function(){return _0x5aea39;});}return _0x5aea39;});}});}}});}; \ No newline at end of file +var _0xda5a=['ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','parentSections','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','inbound','QueueCampaigns','VoiceQueue','outbound','musiconholds','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','Users','admin','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','Tag','templates','triggers','Trigger','trunks','Trunk','plugins','Plugin','Reports','reportId','metrics','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','ui.createdAt','from','user_has_','_interactions','where','toString','OpenTabs','user_profiles','query','mergeResources','Invalid\x20section\x20\x27','UserProfileSection','find','params','ignore','isEmpty','length','autoAssociation','push','all','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','offset','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','order','extraQueryConditions','Tags','color','tag','ThroughTags','openTabs','dataValues','fax','mail','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','models','filter','field','value','findAll','model','then','associatedResources','map','name','UserProfileResource','AnalyticExtractedReport','resourceId','type','squareprojects','childModel','SquareProject','SquareOdbc','squarerecordings','SquareProjects','contacts','CmContact','Lists','ListId','lists','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites'];(function(_0x463926,_0x395f63){var _0x75b6e7=function(_0x2c0e5d){while(--_0x2c0e5d){_0x463926['push'](_0x463926['shift']());}};_0x75b6e7(++_0x395f63);}(_0xda5a,0x99));var _0xada5=function(_0x223a7c,_0x11ebdc){_0x223a7c=_0x223a7c-0x0;var _0x22e78a=_0xda5a[_0x223a7c];return _0x22e78a;};'use strict';var _=require(_0xada5('0x0'));var attributes=require(_0xada5('0x1'));var qs=require(_0xada5('0x2'));var squel=require('squel');module['exports']=function(_0x3c1c3c){var _0x276127=_0x3c1c3c[_0xada5('0x3')];function _0x29f4ad(_0x2dae7f,_0x4bb3cf){return new Promise(function(_0x5e5770,_0x3d8ac5){if(!_0x4bb3cf)return _0x5e5770(null);var _0x3aa735=_0x4bb3cf['filter']?{[_0x4bb3cf[_0xada5('0x4')][_0xada5('0x5')]]:_0x4bb3cf[_0xada5('0x4')][_0xada5('0x6')]}:undefined;return _0x276127[_0x2dae7f][_0xada5('0x7')]({'where':_0x3aa735,'raw':!![]})['then'](function(_0x2b9b50){_0x4bb3cf['associatedResources']=_['map'](_0x2b9b50,'id');_0x5e5770(_0x4bb3cf);})['catch'](function(_0x58664b){_0x3d8ac5(_0x58664b);});});}function _0x590e18(_0xf93e87,_0xdda76f){return new Promise(function(_0x23b127,_0x4f01dc){var _0x2af807=_0xf93e87[_0xada5('0x4')]?{[_0xf93e87[_0xada5('0x4')]['field']]:_0xf93e87['filter']['value']}:undefined;return _0x276127[_0xf93e87[_0xada5('0x8')]][_0xada5('0x7')]({'where':_0x2af807,'raw':!![]})[_0xada5('0x9')](function(_0x834fbd){_0xdda76f[_0xada5('0xa')]=_[_0xada5('0xb')](_0x834fbd,function(_0x5f2cc2){return _0x5f2cc2[_0xada5('0xc')];});_0x23b127(_0xdda76f);})['catch'](function(_0x14c9aa){_0x4f01dc(_0x14c9aa);});});}function _0x3a74dc(_0x5bd540,_0x417e31,_0x4c1f9f){if(!_0x417e31)return Promise['resolve'](null);return new Promise(function(_0x3dc46c,_0x241141){return _0x276127[_0xada5('0xd')]['findAll']({'where':{'sectionId':_0x417e31['id']},'raw':!![]})[_0xada5('0x9')](function(_0x462e93){if(_0x5bd540[_0xada5('0x5')]&&_0x5bd540['field']!=='id'){_0x417e31[_0xada5('0xa')]=_[_0xada5('0xb')](_0x462e93,function(_0xcd5855){return _0xcd5855[_0x5bd540[_0xada5('0x5')]];});}else{if(_0x4c1f9f===_0xada5('0xe')){_0x417e31[_0xada5('0xa')]=_['map'](_0x462e93,function(_0xdba090){return{'id':_0xdba090[_0xada5('0xf')],'type':_0xdba090[_0xada5('0x10')]};});}else{_0x417e31[_0xada5('0xa')]=_[_0xada5('0xb')](_0x462e93,function(_0x306e3b){return _0x306e3b[_0xada5('0xf')];});}}_0x3dc46c(_0x417e31);})['catch'](function(_0x22aedb){_0x241141(_0x22aedb);});});}function _0x543dc(_0x1ee220,_0xf4b238){var _0x12a7d4={'parentSections':[]};switch(_0x1ee220['toLowerCase']()){case _0xada5('0x11'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x13');break;case'odbc':_0x12a7d4[_0xada5('0x12')]=_0xada5('0x14');break;case _0xada5('0x15'):_0x12a7d4[_0xada5('0x12')]='SquareRecording';_0x12a7d4['parentSections']=[{'name':_0xada5('0x16'),'field':_0xada5('0xc'),'foreignKey':'projectName'}];break;case'projects':_0x12a7d4[_0xada5('0x12')]='JscriptyProject';break;case _0xada5('0x17'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x18');_0x12a7d4['parentSections']=[{'name':_0xada5('0x19'),'field':'id','foreignKey':_0xada5('0x1a')}];break;case _0xada5('0x1b'):_0x12a7d4[_0xada5('0x12')]='CmList';break;case _0xada5('0x1c'):_0x12a7d4[_0xada5('0x12')]='CmCompany';break;case _0xada5('0x1d'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x1e');break;case _0xada5('0x1f'):_0x12a7d4['childModel']=_0xada5('0x20');break;case _0xada5('0x21'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x22');break;case _0xada5('0x23'):_0x12a7d4['childModel']=_0xada5('0x24');break;case _0xada5('0x25'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x26');break;case _0xada5('0x27'):case'internalroutes':case _0xada5('0x28'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x29');break;case _0xada5('0x2a'):_0x12a7d4['childModel']='VoiceContext';break;case _0xada5('0x2b'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x2c');break;case _0xada5('0x2d'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x2e');_0x12a7d4[_0xada5('0x2f')]=[{'name':_0xada5('0x30'),'field':_0xada5('0xc'),'foreignKey':_0xada5('0x31'),'model':_0xada5('0x32'),'filter':{'field':_0xada5('0x33'),'value':[_0xada5('0x34')]}},{'name':_0xada5('0x35'),'field':'name','foreignKey':_0xada5('0x31'),'model':_0xada5('0x32'),'filter':{'field':_0xada5('0x33'),'value':[_0xada5('0x36')]}},{'name':_0xada5('0x37'),'field':_0xada5('0xc'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0xada5('0x10'),'value':[_0xada5('0x38')]}},{'name':_0xada5('0x39'),'field':_0xada5('0xc'),'foreignKey':'queue','model':_0xada5('0x3a'),'filter':{'field':'type','value':[_0xada5('0x3b')]}}];break;case _0xada5('0x3c'):_0x12a7d4['childModel']='VoiceMusicOnHold';break;case _0xada5('0x3d'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x3e');break;case'voiceprefixes':_0x12a7d4[_0xada5('0x12')]=_0xada5('0x3f');break;case _0xada5('0x40'):_0x12a7d4[_0xada5('0x12')]='Campaign';break;case _0xada5('0x41'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x42');break;case _0xada5('0x43'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x44');break;case _0xada5('0x45'):_0x12a7d4['childModel']=_0xada5('0x46');break;case _0xada5('0x47'):_0x12a7d4['childModel']=_0xada5('0x48');break;case _0xada5('0x49'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x4a');break;case _0xada5('0x4b'):_0x12a7d4[_0xada5('0x12')]='SmsQueue';break;case _0xada5('0x4c'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x4d');break;case'whatsappqueues':_0x12a7d4[_0xada5('0x12')]='WhatsappQueue';break;case _0xada5('0x4e'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x4f');break;case _0xada5('0x50'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x51');break;case _0xada5('0x52'):case _0xada5('0x53'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x3a');if(_0xf4b238){_0x12a7d4['parentSections']=[{'name':_0xada5('0x37')},{'name':'QueueCampaigns'}];}break;case _0xada5('0x54'):case _0xada5('0x55'):case'telephones':_0x12a7d4['childModel']=_0xada5('0x32');if(_0xf4b238){_0x12a7d4[_0xada5('0x2f')]=[{'name':_0xada5('0x56'),'filter':{'field':_0xada5('0x33'),'value':[_0xada5('0x57'),_0xada5('0x58')]},'ignore':!![]},{'name':_0xada5('0x30')},{'name':'Telephones'}];}break;case _0xada5('0x59'):_0x12a7d4['childModel']=_0xada5('0x5a');break;case'salesforceaccounts':_0x12a7d4[_0xada5('0x12')]=_0xada5('0x5b');break;case _0xada5('0x5c'):_0x12a7d4[_0xada5('0x12')]='FreshdeskAccount';break;case _0xada5('0x5d'):_0x12a7d4['childModel']='SugarcrmAccount';break;case _0xada5('0x5e'):_0x12a7d4[_0xada5('0x12')]='DeskAccount';break;case _0xada5('0x5f'):_0x12a7d4['childModel']=_0xada5('0x60');break;case _0xada5('0x61'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x32');break;case _0xada5('0x62'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x63');break;case _0xada5('0x64'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x65');break;case _0xada5('0x66'):_0x12a7d4['childModel']=_0xada5('0x67');break;case'intervals':_0x12a7d4[_0xada5('0x12')]=_0xada5('0x68');break;case _0xada5('0x69'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x6a');break;case _0xada5('0x6b'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x6c');break;case _0xada5('0x6d'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x6e');break;case'tags':_0x12a7d4[_0xada5('0x12')]=_0xada5('0x6f');break;case _0xada5('0x70'):_0x12a7d4[_0xada5('0x12')]='Template';break;case _0xada5('0x71'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x72');break;case _0xada5('0x73'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x74');break;case'variables':_0x12a7d4['childModel']='Variable';break;case _0xada5('0x75'):_0x12a7d4[_0xada5('0x12')]=_0xada5('0x76');break;case'extractedreports':_0x12a7d4[_0xada5('0x12')]=_0xada5('0xe');_0x12a7d4[_0xada5('0x2f')]=[{'name':_0xada5('0x77'),'field':'id','foreignKey':_0xada5('0x78')}];break;case _0xada5('0x79'):_0x12a7d4[_0xada5('0x12')]='AnalyticMetric';break;}return _0x12a7d4;}function _0x9b4cf4(_0x2bfbb9,_0x3b7257){var _0x32f6fd=_0x2bfbb9[_0xada5('0x7a')](0x0)[_0xada5('0x7b')]()+_0x2bfbb9[_0xada5('0x7c')](0x1);var _0x5a4908={'type':_0x276127[_0xada5('0x7d')][_0xada5('0x7e')][_0xada5('0x7f')],'raw':!![]};return new Promise(function(_0x20c172,_0x5dfa32){var _0x4001f7=squel[_0xada5('0x80')]()[_0xada5('0x5')](_0xada5('0x81')+_0x32f6fd+'InteractionId','id')[_0xada5('0x5')](_0xada5('0x82'))[_0xada5('0x83')](_0xada5('0x84')+_0x2bfbb9+_0xada5('0x85'),'ui')[_0xada5('0x86')]('ui.UserId\x20=\x20?',_0x3b7257['id']);return _0x276127['sequelize']['query'](_0x4001f7[_0xada5('0x87')](),_0x5a4908)[_0xada5('0x9')](function(_0x3f31bb){_0x3b7257[_0x32f6fd+_0xada5('0x88')]=_0x3f31bb;_0x20c172(_0x3f31bb);})['catch'](function(_0x1deb4f){_0x5dfa32(_0x1deb4f);});});}return _0x3c1c3c['define']('UserProfile',attributes,{'tableName':_0xada5('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2e0784){var _0x4b8d71={'raw':_0x2e0784[_0xada5('0x8a')]['raw'],'where':{}};var _0x3b8a06={};var _0x1ab22e={'count':0x0,'rows':[]};var _0x550e54=_0x2e0784['query']['section'];var _0x9440d2=_0x2e0784[_0xada5('0x8a')][_0xada5('0x8b')]||![];var _0x94684c=_0x543dc(_0x550e54,_0x9440d2);if(!_0x94684c[_0xada5('0x12')])throw new Error(_0xada5('0x8c')+_0x550e54+'\x27');var _0x4bf01c=[{'name':_0x550e54}];if(!_['isEmpty'](_0x94684c[_0xada5('0x2f')]))_0x4bf01c=_0x94684c[_0xada5('0x2f')];var _0x384755=[];for(var _0x52bc32=0x0;_0x52bc32<_0x4bf01c['length'];_0x52bc32++){_0x384755['push'](_0x276127[_0xada5('0x8d')][_0xada5('0x8e')]({'where':{'userProfileId':_0x2e0784[_0xada5('0x8f')]['id'],'name':_0x4bf01c[_0x52bc32]['name']},'raw':!![]}));}return Promise['all'](_0x384755)[_0xada5('0x9')](function(_0x31ee1d){var _0x36b4b1=_[_0xada5('0x4')](_0x31ee1d,function(_0x43b05c){return _0x43b05c?_0x43b05c:undefined;});var _0x4e4346=_[_0xada5('0x4')](_0x4bf01c,[_0xada5('0x90'),!![]]);var _0x22e04f=_['isEmpty'](_0x36b4b1)&&_[_0xada5('0x91')](_0x4e4346)?null:_['union'](_0x4e4346,_0x36b4b1);if(!_0x22e04f)return null;var _0x42f5f4=[];for(var _0x3ea864=0x0;_0x3ea864<_0x22e04f[_0xada5('0x92')];_0x3ea864++){var _0x3c2cab=_['find'](_0x4bf01c,function(_0x3e739c){return _0x22e04f[_0x3ea864]?_0x3e739c[_0xada5('0xc')]===_0x22e04f[_0x3ea864][_0xada5('0xc')]:null;});if(_0x3c2cab){if(_0x22e04f[_0x3ea864][_0xada5('0x90')]){_0x42f5f4['push'](_0x29f4ad(_0x94684c[_0xada5('0x12')],_0x22e04f[_0x3ea864]));}else{if(!_0x22e04f[_0x3ea864][_0xada5('0x93')]){_0x42f5f4[_0xada5('0x94')](_0x3a74dc(_0x3c2cab,_0x22e04f[_0x3ea864],_0x94684c[_0xada5('0x12')]));}else{if(_0x3c2cab[_0xada5('0x8')]){_0x42f5f4['push'](_0x590e18(_0x3c2cab,_0x22e04f[_0x3ea864]));}}}}}return Promise[_0xada5('0x95')](_0x42f5f4);})[_0xada5('0x9')](function(_0xd645db){var _0x336f94=_0xd645db;var _0xccbfa2=null;if(_0x336f94){_0xccbfa2=_0x336f94[_0xada5('0x92')]===0x1?_0x336f94[0x0]:null;}if(!_0xccbfa2&&!_0x336f94)return _0x1ab22e;var _0x4310d8=_0x276127[_0x94684c['childModel']]['rawAttributes'];_0x3b8a06[_0xada5('0x8')]=_[_0xada5('0x96')](_0x4310d8);_0x3b8a06[_0xada5('0x8a')]=_[_0xada5('0x96')](_0x2e0784['query']);_0x3b8a06[_0xada5('0x97')]=_['intersection'](_0x3b8a06[_0xada5('0x8')],_0x3b8a06[_0xada5('0x8a')]);_0x4b8d71['attributes']=_[_0xada5('0x98')](_0x3b8a06['model'],qs[_0xada5('0x99')](_0x2e0784[_0xada5('0x8a')]['fields']));_0x4b8d71[_0xada5('0x9a')]=_0x4b8d71[_0xada5('0x9a')][_0xada5('0x92')]?_0x4b8d71[_0xada5('0x9a')]:_0x3b8a06[_0xada5('0x8')];if(!_0x2e0784['query'][_0xada5('0x9b')]('nolimit')){_0x4b8d71['limit']=qs[_0xada5('0x9c')](_0x2e0784[_0xada5('0x8a')][_0xada5('0x9c')]);_0x4b8d71[_0xada5('0x9d')]=qs[_0xada5('0x9d')](_0x2e0784['query'][_0xada5('0x9d')]);}_0x4b8d71['order']=qs[_0xada5('0x9e')](_0x2e0784['query'][_0xada5('0x9e')]);_0x4b8d71[_0xada5('0x86')]=qs['filters'](_[_0xada5('0x9f')](_0x2e0784[_0xada5('0x8a')],_0x3b8a06[_0xada5('0x97')]));if(_0x2e0784['query'][_0xada5('0x4')]){_0x4b8d71['where']=_[_0xada5('0xa0')](_0x4b8d71[_0xada5('0x86')],{'$or':_[_0xada5('0xb')](_0x4310d8,function(_0x3ae660){if(_0x3ae660[_0xada5('0x10')][_0xada5('0xa1')]!==_0xada5('0xa2')){var _0x1bd1ce={};_0x1bd1ce[_0x3ae660[_0xada5('0x5')]]={'$like':'%'+_0x2e0784[_0xada5('0x8a')]['filter']+'%'};return _0x1bd1ce;}})});}var _0x271afc=[];var _0x517039=null;var _0x5b098d={};if(_0xccbfa2){_0x517039=_[_0xada5('0x8e')](_0x4bf01c,['name',_0xccbfa2[_0xada5('0xc')]]);if(_0x517039[_0xada5('0x5')]){_0x5b098d={};if(_0x94684c[_0xada5('0x12')]===_0xada5('0xe')){_0x5b098d[_0x517039[_0xada5('0xa3')]]=_['map'](_0xccbfa2[_0xada5('0xa')],'id');}else{_0x5b098d[_0x517039[_0xada5('0xa3')]]=_0xccbfa2[_0xada5('0xa')];}_0x271afc[_0xada5('0x94')](_0x5b098d);}else{_0x4b8d71['where']['id']=_0xccbfa2[_0xada5('0xa')];}}else{for(var _0x3e08aa=0x0;_0x3e08aa<_0x336f94[_0xada5('0x92')];_0x3e08aa++){_0x517039=_[_0xada5('0x8e')](_0x4bf01c,['name',_0x336f94[_0x3e08aa][_0xada5('0xc')]]);if(_0x517039[_0xada5('0x5')]){_0x5b098d={};_0x5b098d[_0x517039[_0xada5('0xa3')]]=_0x336f94[_0x3e08aa][_0xada5('0xa')];_0x271afc[_0xada5('0x94')](_0x5b098d);}else{if(!_0x4b8d71[_0xada5('0x86')]['id'])_0x4b8d71[_0xada5('0x86')]['id']=[];_0x336f94[_0x3e08aa][_0xada5('0xa')][_0xada5('0xa4')](function(_0x3dea96){_0x4b8d71[_0xada5('0x86')]['id'][_0xada5('0x94')](_0x3dea96);});}}}if(!_['isEmpty'](_0x271afc)){_0x4b8d71[_0xada5('0x86')]=_[_0xada5('0xa0')](_0x4b8d71[_0xada5('0x86')],{'$and':{'$or':_0x271afc}});}_0x4b8d71=_[_0xada5('0xa0')]({},_0x4b8d71,_0x2e0784['options']);if(_0xccbfa2&&!_0xccbfa2[_0xada5('0x93')]&&_0x94684c[_0xada5('0x12')]===_0xada5('0xe')){if(_0x2e0784[_0xada5('0x8a')][_0xada5('0xa5')]){_0x4b8d71[_0xada5('0xa6')]=[{'all':!![]}];}return _0x276127[_0x94684c[_0xada5('0x12')]]['findAll'](_0x4b8d71)[_0xada5('0x9')](function(_0x9ff69c){var _0x4d883e=[];_0x9ff69c['forEach'](function(_0x482543){var _0x3350a1;switch(_0x482543[_0xada5('0xa7')]){case _0xada5('0xa8'):_0x3350a1=_[_0xada5('0x8e')](_0xccbfa2[_0xada5('0xa')],function(_0x12c496){return _0x12c496['id']===_0x482543[_0xada5('0x78')]&&_0x12c496[_0xada5('0x10')]===_0xada5('0xa9');});break;case _0xada5('0xaa'):_0x3350a1=_[_0xada5('0x8e')](_0xccbfa2['associatedResources'],function(_0x2eacc3){return _0x2eacc3['id']===_0x482543[_0xada5('0x78')]&&_0x2eacc3[_0xada5('0x10')]===_0xada5('0xab');});break;}if(_0x3350a1)_0x4d883e[_0xada5('0x94')](_0x482543);});_0x1ab22e[_0xada5('0xac')]=_0x4d883e[_0xada5('0x92')];_0x1ab22e[_0xada5('0xad')]=_0x4d883e;return _0x1ab22e;});}else{if(!_[_0xada5('0x91')](_0x2e0784[_0xada5('0x8a')][_0xada5('0xae')])){_0x4b8d71[_0xada5('0x86')]['id']=_0x4b8d71[_0xada5('0x86')]['id']?_[_0xada5('0x98')](_0x4b8d71[_0xada5('0x86')]['id'],_0x2e0784['query'][_0xada5('0xae')]):_0x2e0784[_0xada5('0x8a')][_0xada5('0xae')];if(_0x2e0784[_0xada5('0x8a')][_0xada5('0xaf')]){_0x4b8d71[_0xada5('0xb0')]=_0x2e0784[_0xada5('0x8a')][_0xada5('0xaf')];}}if(_0x2e0784['query'][_0xada5('0xb1')]){_0x4b8d71[_0xada5('0x86')]=_['merge'](_0x4b8d71[_0xada5('0x86')],{'$and':_0x2e0784['query'][_0xada5('0xb1')]});}return _0x276127[_0x94684c[_0xada5('0x12')]]['count']({'where':_0x4b8d71['where']})[_0xada5('0x9')](function(_0x39f503){_0x1ab22e['count']=_0x39f503;if(_0x2e0784[_0xada5('0x8a')]['includeAll']){if(_0x94684c[_0xada5('0x12')]===_0xada5('0x18')){_0x4b8d71[_0xada5('0xa6')]=[{'model':_0x276127[_0xada5('0x6f')],'as':_0xada5('0xb2'),'attributes':['id',_0xada5('0xc'),_0xada5('0xb3')],'required':_0x2e0784['query'][_0xada5('0xb4')]?!![]:![]},{'model':_0x276127[_0xada5('0x6f')],'as':_0xada5('0xb5'),'attributes':['id',_0xada5('0xc'),_0xada5('0xb3')],'through':_0x2e0784[_0xada5('0x8a')][_0xada5('0xb4')]?{'attributes':[],'where':{'TagId':_0x2e0784[_0xada5('0x8a')][_0xada5('0xb4')]||undefined}}:{},'required':_0x2e0784['query'][_0xada5('0xb4')]?!![]:![]}];}else{_0x4b8d71[_0xada5('0xa6')]=[{'all':!![]}];}}return _0x276127[_0x94684c[_0xada5('0x12')]]['findAll'](_0x4b8d71);})[_0xada5('0x9')](function(_0x2d33a6){_0x1ab22e[_0xada5('0xad')]=_0x2d33a6;if(_0x550e54===_0xada5('0x30')&&_0x2e0784[_0xada5('0x8a')][_0xada5('0xb6')]==='true'){var _0x8ae498=[];for(var _0xc968d7=0x0;_0xc968d7<_0x1ab22e[_0xada5('0xad')][_0xada5('0x92')];_0xc968d7++){_0x8ae498[_0xada5('0x94')](_0x9b4cf4('chat',_0x1ab22e['rows'][_0xc968d7][_0xada5('0xb7')]));_0x8ae498['push'](_0x9b4cf4('sms',_0x1ab22e['rows'][_0xc968d7][_0xada5('0xb7')]));_0x8ae498['push'](_0x9b4cf4(_0xada5('0xb8'),_0x1ab22e[_0xada5('0xad')][_0xc968d7]['dataValues']));_0x8ae498['push'](_0x9b4cf4(_0xada5('0xb9'),_0x1ab22e[_0xada5('0xad')][_0xc968d7][_0xada5('0xb7')]));_0x8ae498[_0xada5('0x94')](_0x9b4cf4(_0xada5('0xba'),_0x1ab22e['rows'][_0xc968d7][_0xada5('0xb7')]));_0x8ae498[_0xada5('0x94')](_0x9b4cf4('whatsapp',_0x1ab22e['rows'][_0xc968d7][_0xada5('0xb7')]));}return Promise[_0xada5('0x95')](_0x8ae498)['then'](function(){return _0x1ab22e;});}return _0x1ab22e;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index b58aa8d..d4d5f09 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 _0xa6ce=['register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xa6ce,0x15e));var _0xea6c=function(_0x13ac10,_0x46e79e){_0x13ac10=_0x13ac10-0x0;var _0x28eda2=_0xa6ce[_0x13ac10];return _0x28eda2;};'use strict';var _=require(_0xea6c('0x0'));var util=require('util');var moment=require(_0xea6c('0x1'));var BPromise=require(_0xea6c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea6c('0x3'));var db=require(_0xea6c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xea6c('0x5'));var config=require(_0xea6c('0x6'));var jayson=require(_0xea6c('0x7'));var client=jayson[_0xea6c('0x8')][_0xea6c('0x9')]({'port':0x232a});config[_0xea6c('0xa')]=_['defaults'](config[_0xea6c('0xa')],{'host':_0xea6c('0xb'),'port':0x18eb});var socket=require(_0xea6c('0xc'))(new Redis(config[_0xea6c('0xa')]));require(_0xea6c('0xd'))[_0xea6c('0xe')](socket);function respondWithRpcPromise(_0x3bf4d2,_0x44a1ba,_0x2c414a){return new BPromise(function(_0x3b70a4,_0x2def55){return client[_0xea6c('0xf')](_0x3bf4d2,_0x2c414a)[_0xea6c('0x10')](function(_0x3c0992){logger['info'](_0xea6c('0x11'),_0x44a1ba,_0xea6c('0x12'));logger[_0xea6c('0x13')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x44a1ba,_0xea6c('0x12'),JSON[_0xea6c('0x14')](_0x3c0992));if(_0x3c0992['error']){if(_0x3c0992[_0xea6c('0x15')][_0xea6c('0x16')]===0x1f4){logger[_0xea6c('0x15')](_0xea6c('0x11'),_0x44a1ba,_0x3c0992[_0xea6c('0x15')][_0xea6c('0x17')]);return _0x2def55(_0x3c0992['error'][_0xea6c('0x17')]);}logger['error'](_0xea6c('0x11'),_0x44a1ba,_0x3c0992[_0xea6c('0x15')][_0xea6c('0x17')]);return _0x3b70a4(_0x3c0992[_0xea6c('0x15')][_0xea6c('0x17')]);}else{logger['info'](_0xea6c('0x11'),_0x44a1ba,_0xea6c('0x12'));_0x3b70a4(_0x3c0992[_0xea6c('0x18')][_0xea6c('0x17')]);}})[_0xea6c('0x19')](function(_0x257707){logger[_0xea6c('0x15')](_0xea6c('0x11'),_0x44a1ba,_0x257707);_0x2def55(_0x257707);});});} \ No newline at end of file +var _0x4f81=['localhost','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults'];(function(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0x4f81,0x1e3));var _0x14f8=function(_0x3e682d,_0x4ef863){_0x3e682d=_0x3e682d-0x0;var _0x3500e1=_0x4f81[_0x3e682d];return _0x3500e1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x14f8('0x0'));var BPromise=require('bluebird');var rs=require(_0x14f8('0x1'));var fs=require('fs');var Redis=require(_0x14f8('0x2'));var db=require(_0x14f8('0x3'))['db'];var utils=require(_0x14f8('0x4'));var logger=require(_0x14f8('0x5'))(_0x14f8('0x6'));var config=require(_0x14f8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x14f8('0x8')]['http']({'port':0x232a});config[_0x14f8('0x9')]=_[_0x14f8('0xa')](config['redis'],{'host':_0x14f8('0xb'),'port':0x18eb});var socket=require(_0x14f8('0xc'))(new Redis(config['redis']));require(_0x14f8('0xd'))['register'](socket);function respondWithRpcPromise(_0x496303,_0x19a1d0,_0x40a43d){return new BPromise(function(_0xbfbf2a,_0xd10497){return client[_0x14f8('0xe')](_0x496303,_0x40a43d)[_0x14f8('0xf')](function(_0x1fa3e8){logger[_0x14f8('0x10')](_0x14f8('0x11'),_0x19a1d0,_0x14f8('0x12'));logger[_0x14f8('0x13')](_0x14f8('0x14'),_0x19a1d0,'request\x20sent',JSON[_0x14f8('0x15')](_0x1fa3e8));if(_0x1fa3e8[_0x14f8('0x16')]){if(_0x1fa3e8[_0x14f8('0x16')][_0x14f8('0x17')]===0x1f4){logger[_0x14f8('0x16')](_0x14f8('0x11'),_0x19a1d0,_0x1fa3e8[_0x14f8('0x16')][_0x14f8('0x18')]);return _0xd10497(_0x1fa3e8[_0x14f8('0x16')][_0x14f8('0x18')]);}logger['error'](_0x14f8('0x11'),_0x19a1d0,_0x1fa3e8[_0x14f8('0x16')][_0x14f8('0x18')]);return _0xbfbf2a(_0x1fa3e8[_0x14f8('0x16')][_0x14f8('0x18')]);}else{logger[_0x14f8('0x10')](_0x14f8('0x11'),_0x19a1d0,'request\x20sent');_0xbfbf2a(_0x1fa3e8[_0x14f8('0x19')][_0x14f8('0x18')]);}})['catch'](function(_0x4f5720){logger['error'](_0x14f8('0x11'),_0x19a1d0,_0x4f5720);_0xd10497(_0x4f5720);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 7f04cad..802bee0 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 _0x4ae5=['remove','update','emit','removeListener','register','length','userProfile:','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ae5,0xdf));var _0x54ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4ae5[_0x3dd15e];return _0x231fd0;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x54ae('0x0'),_0x54ae('0x1'),_0x54ae('0x2')];function createListener(_0x3adfed,_0x479aac){return function(_0x122d41){_0x479aac[_0x54ae('0x3')](_0x3adfed,_0x122d41);};}function removeListener(_0x20efb4,_0x52fb69){return function(){UserProfileEvents[_0x54ae('0x4')](_0x20efb4,_0x52fb69);};}exports[_0x54ae('0x5')]=function(_0x1b0873){for(var _0xe0504d=0x0,_0x53d432=events[_0x54ae('0x6')];_0xe0504d<_0x53d432;_0xe0504d++){var _0x26bcd5=events[_0xe0504d];var _0x2973e7=createListener(_0x54ae('0x7')+_0x26bcd5,_0x1b0873);UserProfileEvents['on'](_0x26bcd5,_0x2973e7);}}; \ No newline at end of file +var _0xd267=['removeListener','length','./userProfile.events','save','remove'];(function(_0x20ca70,_0x165cd6){var _0x3d5032=function(_0x8907ad){while(--_0x8907ad){_0x20ca70['push'](_0x20ca70['shift']());}};_0x3d5032(++_0x165cd6);}(_0xd267,0xd4));var _0x7d26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd267[_0x3dd15e];return _0x231fd0;};'use strict';var UserProfileEvents=require(_0x7d26('0x0'));var events=[_0x7d26('0x1'),_0x7d26('0x2'),'update'];function createListener(_0x6226bd,_0x8e6c3e){return function(_0x6040f){_0x8e6c3e['emit'](_0x6226bd,_0x6040f);};}function removeListener(_0x228d11,_0x177776){return function(){UserProfileEvents[_0x7d26('0x3')](_0x228d11,_0x177776);};}exports['register']=function(_0x566b90){for(var _0x9dd0c2=0x0,_0x59626a=events[_0x7d26('0x4')];_0x9dd0c2<_0x59626a;_0x9dd0c2++){var _0x191aff=events[_0x9dd0c2];var _0x316471=createListener('userProfile:'+_0x191aff,_0x566b90);UserProfileEvents['on'](_0x191aff,_0x316471);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 57ffac2..68b6005 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 _0xa1c4=['express','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xa1c4,0x6e));var _0x4a1c=function(_0x401b3e,_0xed8de5){_0x401b3e=_0x401b3e-0x0;var _0x4f290f=_0xa1c4[_0x401b3e];return _0x4f290f;};'use strict';var multer=require(_0x4a1c('0x0'));var util=require(_0x4a1c('0x1'));var path=require(_0x4a1c('0x2'));var timeout=require(_0x4a1c('0x3'));var express=require(_0x4a1c('0x4'));var router=express['Router']();var fs_extra=require(_0x4a1c('0x5'));var auth=require(_0x4a1c('0x6'));var interaction=require(_0x4a1c('0x7'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4a1c('0x8')]);router[_0x4a1c('0x9')]('/describe',auth[_0x4a1c('0xa')](),controller[_0x4a1c('0xb')]);router[_0x4a1c('0x9')](_0x4a1c('0xc'),auth['isAuthenticated'](),controller[_0x4a1c('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4a1c('0xe')]);router[_0x4a1c('0xf')](_0x4a1c('0xc'),auth[_0x4a1c('0xa')](),controller[_0x4a1c('0x10')]);router[_0x4a1c('0x11')](_0x4a1c('0xc'),auth[_0x4a1c('0xa')](),controller[_0x4a1c('0x12')]);module['exports']=router; \ No newline at end of file +var _0xda49=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x1dc995,_0x5dd8f4){var _0x2cd006=function(_0x41cd9e){while(--_0x41cd9e){_0x1dc995['push'](_0x1dc995['shift']());}};_0x2cd006(++_0x5dd8f4);}(_0xda49,0x8b));var _0x9da4=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0xda49[_0x599e60];return _0x468e19;};'use strict';var multer=require(_0x9da4('0x0'));var util=require(_0x9da4('0x1'));var path=require(_0x9da4('0x2'));var timeout=require('connect-timeout');var express=require(_0x9da4('0x3'));var router=express[_0x9da4('0x4')]();var fs_extra=require(_0x9da4('0x5'));var auth=require(_0x9da4('0x6'));var interaction=require(_0x9da4('0x7'));var config=require(_0x9da4('0x8'));var controller=require(_0x9da4('0x9'));router[_0x9da4('0xa')]('/',auth['isAuthenticated'](),controller[_0x9da4('0xb')]);router[_0x9da4('0xa')](_0x9da4('0xc'),auth[_0x9da4('0xd')](),controller[_0x9da4('0xe')]);router[_0x9da4('0xa')](_0x9da4('0xf'),auth[_0x9da4('0xd')](),controller[_0x9da4('0x10')]);router[_0x9da4('0x11')]('/',auth['isAuthenticated'](),controller[_0x9da4('0x12')]);router[_0x9da4('0x13')](_0x9da4('0xf'),auth['isAuthenticated'](),controller[_0x9da4('0x14')]);router[_0x9da4('0x15')](_0x9da4('0xf'),auth[_0x9da4('0xd')](),controller[_0x9da4('0x16')]);module[_0x9da4('0x17')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index ac84fca..775ba58 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 _0xa9bd=['exports','INTEGER','sequelize'];(function(_0x2b0bc2,_0x4331f5){var _0x56e5b9=function(_0x4c1b06){while(--_0x4c1b06){_0x2b0bc2['push'](_0x2b0bc2['shift']());}};_0x56e5b9(++_0x4331f5);}(_0xa9bd,0xe0));var _0xda9b=function(_0x592929,_0x389ab9){_0x592929=_0x592929-0x0;var _0x25a98b=_0xa9bd[_0x592929];return _0x25a98b;};'use strict';var Sequelize=require(_0xda9b('0x0'));module[_0xda9b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xda9b('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x6909=['INTEGER','sequelize','exports','STRING'];(function(_0x29c1b1,_0x381ea7){var _0x4c9ade=function(_0x1eff58){while(--_0x1eff58){_0x29c1b1['push'](_0x29c1b1['shift']());}};_0x4c9ade(++_0x381ea7);}(_0x6909,0x17d));var _0x9690=function(_0x38d25e,_0x1ff702){_0x38d25e=_0x38d25e-0x0;var _0x1f316d=_0x6909[_0x38d25e];return _0x1f316d;};'use strict';var Sequelize=require(_0x9690('0x0'));module[_0x9690('0x1')]={'name':{'type':Sequelize[_0x9690('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x9690('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 22dc7a4..0bcee44 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 _0x2ef3=['name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','UserProfileResource','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack'];(function(_0x5d7f29,_0x56c670){var _0xa872c6=function(_0x3619ad){while(--_0x3619ad){_0x5d7f29['push'](_0x5d7f29['shift']());}};_0xa872c6(++_0x56c670);}(_0x2ef3,0xba));var _0x32ef=function(_0x292ae0,_0x36ef97){_0x292ae0=_0x292ae0-0x0;var _0x2007b7=_0x2ef3[_0x292ae0];return _0x2007b7;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['UserProfileResource'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['UserProfileResource'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['UserProfileResource']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));};exports['describe']=function(_0x179c2f,_0x259c32){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]()[_0x32ef('0x3e')](respondWithResult(_0x259c32,null))[_0x32ef('0x42')](handleError(_0x259c32,null));}; \ No newline at end of file +var _0x687b=['options','include','findAll','rows','show','length','includeAll','merge','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL'];(function(_0x48f7cf,_0x4baa04){var _0xc201c0=function(_0x23ff34){while(--_0x23ff34){_0x48f7cf['push'](_0x48f7cf['shift']());}};_0xc201c0(++_0x4baa04);}(_0x687b,0x14a));var _0xb687=function(_0x482b06,_0x475ea9){_0x482b06=_0x482b06-0x0;var _0x404a0a=_0x687b[_0x482b06];return _0x404a0a;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['UserProfileResource'][_0xb687('0x4b')](_0x40558a[_0xb687('0x4c')],{})[_0xb687('0x26')](respondWithResult(_0x4f3069,0xc9))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports['update']=function(_0x33a0b0,_0xfc4c5f){if(_0x33a0b0[_0xb687('0x4c')]['id']){delete _0x33a0b0[_0xb687('0x4c')]['id'];}return db['UserProfileResource']['find']({'where':{'id':_0x33a0b0[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0xfc4c5f,null))[_0xb687('0x26')](saveUpdates(_0x33a0b0['body'],null))['then'](respondWithResult(_0xfc4c5f,null))[_0xb687('0x4a')](handleError(_0xfc4c5f,null));};exports[_0xb687('0x27')]=function(_0xd5bdb7,_0x22e618){return db[_0xb687('0x2f')][_0xb687('0x49')]({'where':{'id':_0xd5bdb7[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x22e618,null))['then'](removeEntity(_0x22e618,null))[_0xb687('0x4a')](handleError(_0x22e618,null));};exports[_0xb687('0x4e')]=function(_0x2342f6,_0x4f5784){return db['UserProfileResource']['describe']()['then'](respondWithResult(_0x4f5784,null))[_0xb687('0x4a')](handleError(_0x4f5784,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 453318e..8212f6b 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 _0x1ba1=['user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./userProfileResource.attributes','define','UserProfileResource'];(function(_0x1561a1,_0x3f0b3c){var _0x4172be=function(_0x9da9e9){while(--_0x9da9e9){_0x1561a1['push'](_0x1561a1['shift']());}};_0x4172be(++_0x3f0b3c);}(_0x1ba1,0x1a8));var _0x11ba=function(_0x26423c,_0x2cfa2a){_0x26423c=_0x26423c-0x0;var _0x12f616=_0x1ba1[_0x26423c];return _0x12f616;};'use strict';var _=require(_0x11ba('0x0'));var util=require(_0x11ba('0x1'));var logger=require(_0x11ba('0x2'))(_0x11ba('0x3'));var moment=require(_0x11ba('0x4'));var BPromise=require('bluebird');var rp=require(_0x11ba('0x5'));var fs=require('fs');var path=require(_0x11ba('0x6'));var rimraf=require('rimraf');var config=require(_0x11ba('0x7'));var attributes=require(_0x11ba('0x8'));module['exports']=function(_0x292f7c,_0x5845d3){return _0x292f7c[_0x11ba('0x9')](_0x11ba('0xa'),attributes,{'tableName':_0x11ba('0xb'),'paranoid':![],'indexes':[{'name':_0x11ba('0xc'),'fields':[_0x11ba('0xd'),_0x11ba('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd7a2=['exports','define','user_profile_has_resources','resourceId','sectionId','lodash','util','api','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes'];(function(_0x5ac739,_0xdbaf4b){var _0x2447cc=function(_0x3ed453){while(--_0x3ed453){_0x5ac739['push'](_0x5ac739['shift']());}};_0x2447cc(++_0xdbaf4b);}(_0xd7a2,0x17e));var _0x2d7a=function(_0x20fd39,_0x4e3faf){_0x20fd39=_0x20fd39-0x0;var _0x2f2af9=_0xd7a2[_0x20fd39];return _0x2f2af9;};'use strict';var _=require(_0x2d7a('0x0'));var util=require(_0x2d7a('0x1'));var logger=require('../../config/logger')(_0x2d7a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2d7a('0x3'));var fs=require('fs');var path=require(_0x2d7a('0x4'));var rimraf=require(_0x2d7a('0x5'));var config=require(_0x2d7a('0x6'));var attributes=require(_0x2d7a('0x7'));module[_0x2d7a('0x8')]=function(_0x57f08a,_0x28d8b9){return _0x57f08a[_0x2d7a('0x9')]('UserProfileResource',attributes,{'tableName':_0x2d7a('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x2d7a('0xb'),_0x2d7a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 638efdb..a28b971 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 _0x6e6a=['request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','UserProfileResource,\x20%s,\x20%s'];(function(_0x2bc1fe,_0x45da98){var _0x1a47a5=function(_0x2e5053){while(--_0x2e5053){_0x2bc1fe['push'](_0x2bc1fe['shift']());}};_0x1a47a5(++_0x45da98);}(_0x6e6a,0xf0));var _0xa6e6=function(_0x399bbf,_0x8e297e){_0x399bbf=_0x399bbf-0x0;var _0x50afef=_0x6e6a[_0x399bbf];return _0x50afef;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa6e6('0x0'));var BPromise=require(_0xa6e6('0x1'));var rs=require(_0xa6e6('0x2'));var fs=require('fs');var Redis=require(_0xa6e6('0x3'));var db=require(_0xa6e6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa6e6('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa6e6('0x6'));var client=jayson[_0xa6e6('0x7')][_0xa6e6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ecd64,_0x12d145,_0x9d9f5e){return new BPromise(function(_0x43225b,_0x5d5c4c){return client[_0xa6e6('0x9')](_0x4ecd64,_0x9d9f5e)[_0xa6e6('0xa')](function(_0x558797){logger['info'](_0xa6e6('0xb'),_0x12d145,_0xa6e6('0xc'));logger[_0xa6e6('0xd')](_0xa6e6('0xe'),_0x12d145,'request\x20sent',JSON[_0xa6e6('0xf')](_0x558797));if(_0x558797[_0xa6e6('0x10')]){if(_0x558797[_0xa6e6('0x10')][_0xa6e6('0x11')]===0x1f4){logger[_0xa6e6('0x10')](_0xa6e6('0xb'),_0x12d145,_0x558797[_0xa6e6('0x10')][_0xa6e6('0x12')]);return _0x5d5c4c(_0x558797[_0xa6e6('0x10')]['message']);}logger[_0xa6e6('0x10')](_0xa6e6('0xb'),_0x12d145,_0x558797[_0xa6e6('0x10')][_0xa6e6('0x12')]);return _0x43225b(_0x558797['error'][_0xa6e6('0x12')]);}else{logger[_0xa6e6('0x13')](_0xa6e6('0xb'),_0x12d145,'request\x20sent');_0x43225b(_0x558797['result'][_0xa6e6('0x12')]);}})[_0xa6e6('0x14')](function(_0x21d4c0){logger[_0xa6e6('0x10')](_0xa6e6('0xb'),_0x12d145,_0x21d4c0);_0x5d5c4c(_0x21d4c0);});});} \ No newline at end of file +var _0x26f0=['../../config/logger','rpc','client','then','UserProfileResource,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x26f0,0x19a));var _0x026f=function(_0x3eb9a6,_0x5cd5f5){_0x3eb9a6=_0x3eb9a6-0x0;var _0x389665=_0x26f0[_0x3eb9a6];return _0x389665;};'use strict';var _=require(_0x026f('0x0'));var util=require(_0x026f('0x1'));var moment=require('moment');var BPromise=require(_0x026f('0x2'));var rs=require(_0x026f('0x3'));var fs=require('fs');var Redis=require(_0x026f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x026f('0x5'));var logger=require(_0x026f('0x6'))(_0x026f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x026f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd8936b,_0x52a942,_0x484264){return new BPromise(function(_0x206d4c,_0x1e2241){return client['request'](_0xd8936b,_0x484264)[_0x026f('0x9')](function(_0x38900b){logger['info'](_0x026f('0xa'),_0x52a942,'request\x20sent');logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x52a942,'request\x20sent',JSON['stringify'](_0x38900b));if(_0x38900b['error']){if(_0x38900b[_0x026f('0xb')][_0x026f('0xc')]===0x1f4){logger[_0x026f('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x52a942,_0x38900b[_0x026f('0xb')][_0x026f('0xd')]);return _0x1e2241(_0x38900b[_0x026f('0xb')]['message']);}logger[_0x026f('0xb')](_0x026f('0xa'),_0x52a942,_0x38900b['error'][_0x026f('0xd')]);return _0x206d4c(_0x38900b['error'][_0x026f('0xd')]);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0x52a942,'request\x20sent');_0x206d4c(_0x38900b[_0x026f('0xe')]['message']);}})[_0x026f('0xf')](function(_0x470cd4){logger['error'](_0x026f('0xa'),_0x52a942,_0x470cd4);_0x1e2241(_0x470cd4);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 024413d..33db571 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 _0xe5e8=['../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2b5905,_0xe114f3){var _0x1550dd=function(_0x5c3be5){while(--_0x5c3be5){_0x2b5905['push'](_0x2b5905['shift']());}};_0x1550dd(++_0xe114f3);}(_0xe5e8,0x178));var _0x8e5e=function(_0x30f679,_0x42f848){_0x30f679=_0x30f679-0x0;var _0x3b31f2=_0xe5e8[_0x30f679];return _0x3b31f2;};'use strict';var multer=require('multer');var util=require(_0x8e5e('0x0'));var path=require(_0x8e5e('0x1'));var timeout=require(_0x8e5e('0x2'));var express=require(_0x8e5e('0x3'));var router=express[_0x8e5e('0x4')]();var fs_extra=require(_0x8e5e('0x5'));var auth=require(_0x8e5e('0x6'));var interaction=require(_0x8e5e('0x7'));var config=require(_0x8e5e('0x8'));var controller=require(_0x8e5e('0x9'));router[_0x8e5e('0xa')]('/',auth[_0x8e5e('0xb')](),controller[_0x8e5e('0xc')]);router[_0x8e5e('0xa')](_0x8e5e('0xd'),auth['isAuthenticated'](),controller[_0x8e5e('0xe')]);router[_0x8e5e('0xa')](_0x8e5e('0xf'),auth[_0x8e5e('0xb')](),controller[_0x8e5e('0x10')]);router[_0x8e5e('0x11')]('/',auth[_0x8e5e('0xb')](),controller[_0x8e5e('0x12')]);router[_0x8e5e('0x13')](_0x8e5e('0xf'),auth[_0x8e5e('0xb')](),controller[_0x8e5e('0x14')]);router[_0x8e5e('0x15')](_0x8e5e('0xf'),auth[_0x8e5e('0xb')](),controller[_0x8e5e('0x16')]);module[_0x8e5e('0x17')]=router; \ No newline at end of file +var _0x32e0=['multer','util','express','../../components/auth/service','./userProfileSection.controller','get','/describe','describe','/:id','isAuthenticated','show','post','put','update','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x32e0,0xa5));var _0x032e=function(_0x57fa7e,_0xd0b5ce){_0x57fa7e=_0x57fa7e-0x0;var _0x320671=_0x32e0[_0x57fa7e];return _0x320671;};'use strict';var multer=require(_0x032e('0x0'));var util=require(_0x032e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x032e('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x032e('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x032e('0x4'));router[_0x032e('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x032e('0x6'),auth['isAuthenticated'](),controller[_0x032e('0x7')]);router[_0x032e('0x5')](_0x032e('0x8'),auth[_0x032e('0x9')](),controller[_0x032e('0xa')]);router[_0x032e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x032e('0xc')](_0x032e('0x8'),auth[_0x032e('0x9')](),controller[_0x032e('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x032e('0xe')]);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 90bdd07..771ea13 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 _0x5eb8=['STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x47b155,_0x4d317f){var _0x9e4373=function(_0x49dae9){while(--_0x49dae9){_0x47b155['push'](_0x47b155['shift']());}};_0x9e4373(++_0x4d317f);}(_0x5eb8,0xb0));var _0x85eb=function(_0x3f3a47,_0x28f84b){_0x3f3a47=_0x3f3a47-0x0;var _0x57a682=_0x5eb8[_0x3f3a47];return _0x57a682;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x85eb('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x85eb('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x85eb('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x85eb('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x85eb('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x85eb('0x0')],'set':function(_0x13b1df){this[_0x85eb('0x3')](_0x85eb('0x4'),_0x13b1df?_0x13b1df[_0x85eb('0x5')](''):[]);},'get':function(){return this[_0x85eb('0x6')](_0x85eb('0x4'))?this['getDataValue'](_0x85eb('0x4'))[_0x85eb('0x7')](''):[];}}}; \ No newline at end of file +var _0x9354=['BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','exports','STRING','INTEGER'];(function(_0x585133,_0x2412a1){var _0x18254a=function(_0x4c8aaf){while(--_0x4c8aaf){_0x585133['push'](_0x585133['shift']());}};_0x18254a(++_0x2412a1);}(_0x9354,0x96));var _0x4935=function(_0x1eb585,_0x202476){_0x1eb585=_0x1eb585-0x0;var _0x497ee2=_0x9354[_0x1eb585];return _0x497ee2;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'name':{'type':Sequelize[_0x4935('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4935('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x4935('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4935('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4935('0x1')],'set':function(_0x5327fc){this[_0x4935('0x4')](_0x4935('0x5'),_0x5327fc?_0x5327fc[_0x4935('0x6')](''):[]);},'get':function(){return this[_0x4935('0x7')](_0x4935('0x5'))?this[_0x4935('0x7')](_0x4935('0x5'))[_0x4935('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 25ccf28..d0b3f4c 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 _0x7fd0=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','Content-Range','json','apply','reject','save','stack','name','send','index','fieldName','type','key','map','query','intersection','model','fields','attributes','order','sort','where','filters','pick','filter','merge','options','UserProfileSection','includeAll','include','findAll','then','catch','show','params','rawAttributes','keys','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x159c6c,_0x4412a1){var _0x24d863=function(_0x36ef3a){while(--_0x36ef3a){_0x159c6c['push'](_0x159c6c['shift']());}};_0x24d863(++_0x4412a1);}(_0x7fd0,0xce));var _0x07fd=function(_0x11f3c5,_0x4766a3){_0x11f3c5=_0x11f3c5-0x0;var _0xc0b593=_0x7fd0[_0x11f3c5];return _0xc0b593;};'use strict';var emlformat=require(_0x07fd('0x0'));var rimraf=require(_0x07fd('0x1'));var zipdir=require(_0x07fd('0x2'));var jsonpatch=require(_0x07fd('0x3'));var rp=require(_0x07fd('0x4'));var moment=require('moment');var BPromise=require(_0x07fd('0x5'));var Mustache=require('mustache');var util=require(_0x07fd('0x6'));var path=require('path');var sox=require(_0x07fd('0x7'));var csv=require('to-csv');var ejs=require(_0x07fd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x07fd('0x9'));var squel=require(_0x07fd('0xa'));var crypto=require(_0x07fd('0xb'));var jsforce=require(_0x07fd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x07fd('0xd'));var querystring=require(_0x07fd('0xe'));var Papa=require(_0x07fd('0xf'));var Redis=require(_0x07fd('0x10'));var authService=require(_0x07fd('0x11'));var qs=require(_0x07fd('0x12'));var as=require(_0x07fd('0x13'));var hardwareService=require(_0x07fd('0x14'));var logger=require(_0x07fd('0x15'))(_0x07fd('0x16'));var utils=require(_0x07fd('0x17'));var config=require(_0x07fd('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x07fd('0x19'))['db'];function respondWithStatusCode(_0x597686,_0x42a4d6){_0x42a4d6=_0x42a4d6||0xcc;return function(_0x24f4a8){if(_0x24f4a8){return _0x597686[_0x07fd('0x1a')](_0x42a4d6);}return _0x597686['status'](_0x42a4d6)[_0x07fd('0x1b')]();};}function respondWithResult(_0x327fe9,_0x9a1298){_0x9a1298=_0x9a1298||0xc8;return function(_0x2f6303){if(_0x2f6303){return _0x327fe9[_0x07fd('0x1c')](_0x9a1298)['json'](_0x2f6303);}};}function respondWithFilteredResult(_0x122274,_0x369577){return function(_0x177bc5){if(_0x177bc5){var _0x1d196e=typeof _0x369577[_0x07fd('0x1d')]===_0x07fd('0x1e')&&typeof _0x369577['limit']===_0x07fd('0x1e');var _0x4733a1=_0x177bc5[_0x07fd('0x1f')];var _0x47487b=_0x1d196e?0x0:_0x369577[_0x07fd('0x1d')];var _0x2ac992=_0x1d196e?_0x177bc5['count']:_0x369577[_0x07fd('0x1d')]+_0x369577['limit'];var _0x3536f1;if(_0x2ac992>=_0x4733a1){_0x2ac992=_0x4733a1;_0x3536f1=0xc8;}else{_0x3536f1=0xce;}_0x122274[_0x07fd('0x1c')](_0x3536f1);return _0x122274[_0x07fd('0x20')](_0x07fd('0x21'),_0x47487b+'-'+_0x2ac992+'/'+_0x4733a1)[_0x07fd('0x22')](_0x177bc5);}return null;};}function patchUpdates(_0x31ae22){return function(_0x43e960){try{jsonpatch[_0x07fd('0x23')](_0x43e960,_0x31ae22,!![]);}catch(_0x1956ff){return BPromise[_0x07fd('0x24')](_0x1956ff);}return _0x43e960[_0x07fd('0x25')]();};}function saveUpdates(_0x477b9b,_0x4a6716){return function(_0x11f311){if(_0x11f311){return _0x11f311['update'](_0x477b9b)['then'](function(_0x381c2e){return _0x381c2e;});}return null;};}function removeEntity(_0x340b03,_0x4c7440){return function(_0x36042a){if(_0x36042a){return _0x36042a['destroy']()['then'](function(){_0x340b03[_0x07fd('0x1c')](0xcc)[_0x07fd('0x1b')]();});}};}function handleEntityNotFound(_0x1ece06,_0x1af488){return function(_0x2da714){if(!_0x2da714){_0x1ece06[_0x07fd('0x1a')](0x194);}return _0x2da714;};}function handleError(_0x3dfcf8,_0x2ec49c){_0x2ec49c=_0x2ec49c||0x1f4;return function(_0x4ac283){logger['error'](_0x4ac283[_0x07fd('0x26')]);if(_0x4ac283['name']){delete _0x4ac283[_0x07fd('0x27')];}_0x3dfcf8[_0x07fd('0x1c')](_0x2ec49c)[_0x07fd('0x28')](_0x4ac283);};}exports[_0x07fd('0x29')]=function(_0x37ed10,_0x44f214){var _0x481b21={},_0x289b72={},_0x840b67={'count':0x0,'rows':[]};var _0x2c5d40=_['map'](db['UserProfileSection']['rawAttributes'],function(_0x150228){return{'name':_0x150228[_0x07fd('0x2a')],'type':_0x150228[_0x07fd('0x2b')][_0x07fd('0x2c')]};});_0x289b72['model']=_[_0x07fd('0x2d')](_0x2c5d40,_0x07fd('0x27'));_0x289b72[_0x07fd('0x2e')]=_['keys'](_0x37ed10[_0x07fd('0x2e')]);_0x289b72['filters']=_[_0x07fd('0x2f')](_0x289b72[_0x07fd('0x30')],_0x289b72[_0x07fd('0x2e')]);_0x481b21['attributes']=_['intersection'](_0x289b72[_0x07fd('0x30')],qs[_0x07fd('0x31')](_0x37ed10[_0x07fd('0x2e')]['fields']));_0x481b21[_0x07fd('0x32')]=_0x481b21[_0x07fd('0x32')]['length']?_0x481b21[_0x07fd('0x32')]:_0x289b72[_0x07fd('0x30')];if(!_0x37ed10[_0x07fd('0x2e')]['hasOwnProperty']('nolimit')){_0x481b21['limit']=qs['limit'](_0x37ed10['query']['limit']);_0x481b21[_0x07fd('0x1d')]=qs['offset'](_0x37ed10[_0x07fd('0x2e')]['offset']);}_0x481b21[_0x07fd('0x33')]=qs[_0x07fd('0x34')](_0x37ed10['query']['sort']);_0x481b21[_0x07fd('0x35')]=qs[_0x07fd('0x36')](_[_0x07fd('0x37')](_0x37ed10['query'],_0x289b72[_0x07fd('0x36')]),_0x2c5d40);if(_0x37ed10[_0x07fd('0x2e')][_0x07fd('0x38')]){_0x481b21[_0x07fd('0x35')]=_['merge'](_0x481b21[_0x07fd('0x35')],{'$or':_[_0x07fd('0x2d')](_0x2c5d40,function(_0x2f40a1){if(_0x2f40a1[_0x07fd('0x2b')]!=='VIRTUAL'){var _0x32d56e={};_0x32d56e[_0x2f40a1[_0x07fd('0x27')]]={'$like':'%'+_0x37ed10[_0x07fd('0x2e')][_0x07fd('0x38')]+'%'};return _0x32d56e;}})});}_0x481b21=_[_0x07fd('0x39')]({},_0x481b21,_0x37ed10[_0x07fd('0x3a')]);var _0x2c0df7={'where':_0x481b21['where']};return db[_0x07fd('0x3b')]['count'](_0x2c0df7)['then'](function(_0x2abd3a){_0x840b67[_0x07fd('0x1f')]=_0x2abd3a;if(_0x37ed10[_0x07fd('0x2e')][_0x07fd('0x3c')]){_0x481b21[_0x07fd('0x3d')]=[{'all':!![]}];}return db[_0x07fd('0x3b')][_0x07fd('0x3e')](_0x481b21);})[_0x07fd('0x3f')](function(_0x147511){_0x840b67['rows']=_0x147511;return _0x840b67;})[_0x07fd('0x3f')](respondWithFilteredResult(_0x44f214,_0x481b21))[_0x07fd('0x40')](handleError(_0x44f214,null));};exports[_0x07fd('0x41')]=function(_0x1c90a0,_0x810ba2){var _0x5d36fc={'raw':![],'where':{'id':_0x1c90a0[_0x07fd('0x42')]['id']}},_0x3bf59c={};_0x3bf59c[_0x07fd('0x30')]=_['keys'](db[_0x07fd('0x3b')][_0x07fd('0x43')]);_0x3bf59c[_0x07fd('0x2e')]=_[_0x07fd('0x44')](_0x1c90a0[_0x07fd('0x2e')]);_0x3bf59c[_0x07fd('0x36')]=_[_0x07fd('0x2f')](_0x3bf59c[_0x07fd('0x30')],_0x3bf59c[_0x07fd('0x2e')]);_0x5d36fc[_0x07fd('0x32')]=_[_0x07fd('0x2f')](_0x3bf59c[_0x07fd('0x30')],qs['fields'](_0x1c90a0[_0x07fd('0x2e')][_0x07fd('0x31')]));_0x5d36fc[_0x07fd('0x32')]=_0x5d36fc[_0x07fd('0x32')]['length']?_0x5d36fc[_0x07fd('0x32')]:_0x3bf59c[_0x07fd('0x30')];if(_0x1c90a0['query'][_0x07fd('0x3c')]){_0x5d36fc['include']=[{'all':!![]}];}_0x5d36fc=_[_0x07fd('0x39')]({},_0x5d36fc,_0x1c90a0[_0x07fd('0x3a')]);return db[_0x07fd('0x3b')][_0x07fd('0x45')](_0x5d36fc)[_0x07fd('0x3f')](handleEntityNotFound(_0x810ba2,null))[_0x07fd('0x3f')](respondWithResult(_0x810ba2,null))['catch'](handleError(_0x810ba2,null));};exports[_0x07fd('0x46')]=function(_0x67fa59,_0x57e642){return db['UserProfileSection'][_0x07fd('0x46')](_0x67fa59[_0x07fd('0x47')],{})['then'](respondWithResult(_0x57e642,0xc9))[_0x07fd('0x40')](handleError(_0x57e642,null));};exports[_0x07fd('0x48')]=function(_0xd04566,_0x417a41){if(_0xd04566['body']['id']){delete _0xd04566[_0x07fd('0x47')]['id'];}return db[_0x07fd('0x3b')]['find']({'where':{'id':_0xd04566[_0x07fd('0x42')]['id']}})[_0x07fd('0x3f')](handleEntityNotFound(_0x417a41,null))['then'](saveUpdates(_0xd04566[_0x07fd('0x47')],null))['then'](respondWithResult(_0x417a41,null))[_0x07fd('0x40')](handleError(_0x417a41,null));};exports[_0x07fd('0x49')]=function(_0x16b077,_0x126337){return db[_0x07fd('0x3b')]['find']({'where':{'id':_0x16b077[_0x07fd('0x42')]['id']}})[_0x07fd('0x3f')](handleEntityNotFound(_0x126337,null))[_0x07fd('0x3f')](removeEntity(_0x126337,null))['catch'](handleError(_0x126337,null));};exports[_0x07fd('0x4a')]=function(_0x50459a,_0xe58423){return db['UserProfileSection'][_0x07fd('0x4a')]()[_0x07fd('0x3f')](respondWithResult(_0xe58423,null))[_0x07fd('0x40')](handleError(_0xe58423,null));}; \ No newline at end of file +var _0xda5b=['filters','filter','merge','type','VIRTUAL','options','count','includeAll','rows','catch','show','params','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','UserProfileSection','rawAttributes','fieldName','query','keys','intersection','attributes','model','fields','length','nolimit','order','sort','where'];(function(_0x281e02,_0x2c2889){var _0x52df67=function(_0x294473){while(--_0x294473){_0x281e02['push'](_0x281e02['shift']());}};_0x52df67(++_0x2c2889);}(_0xda5b,0x1d3));var _0xbda5=function(_0x6f9e6c,_0x5ef730){_0x6f9e6c=_0x6f9e6c-0x0;var _0x20a1a0=_0xda5b[_0x6f9e6c];return _0x20a1a0;};'use strict';var emlformat=require(_0xbda5('0x0'));var rimraf=require(_0xbda5('0x1'));var zipdir=require(_0xbda5('0x2'));var jsonpatch=require(_0xbda5('0x3'));var rp=require(_0xbda5('0x4'));var moment=require('moment');var BPromise=require(_0xbda5('0x5'));var Mustache=require(_0xbda5('0x6'));var util=require(_0xbda5('0x7'));var path=require(_0xbda5('0x8'));var sox=require(_0xbda5('0x9'));var csv=require('to-csv');var ejs=require(_0xbda5('0xa'));var fs=require('fs');var fs_extra=require(_0xbda5('0xb'));var _=require(_0xbda5('0xc'));var squel=require(_0xbda5('0xd'));var crypto=require(_0xbda5('0xe'));var jsforce=require(_0xbda5('0xf'));var deskjs=require(_0xbda5('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbda5('0x11'));var Redis=require(_0xbda5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbda5('0x13'));var as=require(_0xbda5('0x14'));var hardwareService=require(_0xbda5('0x15'));var logger=require(_0xbda5('0x16'))('api');var utils=require(_0xbda5('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbda5('0x18'))['db'];function respondWithStatusCode(_0xe4e2ee,_0x1d574c){_0x1d574c=_0x1d574c||0xcc;return function(_0x50073e){if(_0x50073e){return _0xe4e2ee['sendStatus'](_0x1d574c);}return _0xe4e2ee[_0xbda5('0x19')](_0x1d574c)[_0xbda5('0x1a')]();};}function respondWithResult(_0x2ec0d8,_0x3e18ab){_0x3e18ab=_0x3e18ab||0xc8;return function(_0x471225){if(_0x471225){return _0x2ec0d8[_0xbda5('0x19')](_0x3e18ab)['json'](_0x471225);}};}function respondWithFilteredResult(_0x2fb5e7,_0x2c45ff){return function(_0x1d00b9){if(_0x1d00b9){var _0x3106d7=typeof _0x2c45ff[_0xbda5('0x1b')]==='undefined'&&typeof _0x2c45ff[_0xbda5('0x1c')]==='undefined';var _0x1f3a13=_0x1d00b9['count'];var _0x12a9d1=_0x3106d7?0x0:_0x2c45ff[_0xbda5('0x1b')];var _0x82b21d=_0x3106d7?_0x1d00b9['count']:_0x2c45ff[_0xbda5('0x1b')]+_0x2c45ff[_0xbda5('0x1c')];var _0x345fb4;if(_0x82b21d>=_0x1f3a13){_0x82b21d=_0x1f3a13;_0x345fb4=0xc8;}else{_0x345fb4=0xce;}_0x2fb5e7[_0xbda5('0x19')](_0x345fb4);return _0x2fb5e7[_0xbda5('0x1d')](_0xbda5('0x1e'),_0x12a9d1+'-'+_0x82b21d+'/'+_0x1f3a13)[_0xbda5('0x1f')](_0x1d00b9);}return null;};}function patchUpdates(_0xf6da1b){return function(_0x3347a6){try{jsonpatch[_0xbda5('0x20')](_0x3347a6,_0xf6da1b,!![]);}catch(_0x53de27){return BPromise[_0xbda5('0x21')](_0x53de27);}return _0x3347a6[_0xbda5('0x22')]();};}function saveUpdates(_0x2f0667,_0x51829a){return function(_0x40b0b5){if(_0x40b0b5){return _0x40b0b5[_0xbda5('0x23')](_0x2f0667)[_0xbda5('0x24')](function(_0x5e760f){return _0x5e760f;});}return null;};}function removeEntity(_0x691951,_0x3b5bb4){return function(_0x5790b8){if(_0x5790b8){return _0x5790b8[_0xbda5('0x25')]()['then'](function(){_0x691951[_0xbda5('0x19')](0xcc)[_0xbda5('0x1a')]();});}};}function handleEntityNotFound(_0x312ff5,_0x1ccdeb){return function(_0x23d63f){if(!_0x23d63f){_0x312ff5[_0xbda5('0x26')](0x194);}return _0x23d63f;};}function handleError(_0x449830,_0x3e948f){_0x3e948f=_0x3e948f||0x1f4;return function(_0x54782d){logger[_0xbda5('0x27')](_0x54782d['stack']);if(_0x54782d[_0xbda5('0x28')]){delete _0x54782d[_0xbda5('0x28')];}_0x449830['status'](_0x3e948f)[_0xbda5('0x29')](_0x54782d);};}exports[_0xbda5('0x2a')]=function(_0x1c3084,_0x1ec316){var _0x53967d={},_0x17f697={},_0x3fa4f8={'count':0x0,'rows':[]};var _0x713cd2=_[_0xbda5('0x2b')](db[_0xbda5('0x2c')][_0xbda5('0x2d')],function(_0x8417ca){return{'name':_0x8417ca[_0xbda5('0x2e')],'type':_0x8417ca['type']['key']};});_0x17f697['model']=_[_0xbda5('0x2b')](_0x713cd2,_0xbda5('0x28'));_0x17f697[_0xbda5('0x2f')]=_[_0xbda5('0x30')](_0x1c3084['query']);_0x17f697['filters']=_[_0xbda5('0x31')](_0x17f697['model'],_0x17f697[_0xbda5('0x2f')]);_0x53967d[_0xbda5('0x32')]=_[_0xbda5('0x31')](_0x17f697[_0xbda5('0x33')],qs[_0xbda5('0x34')](_0x1c3084[_0xbda5('0x2f')][_0xbda5('0x34')]));_0x53967d[_0xbda5('0x32')]=_0x53967d[_0xbda5('0x32')][_0xbda5('0x35')]?_0x53967d[_0xbda5('0x32')]:_0x17f697[_0xbda5('0x33')];if(!_0x1c3084['query']['hasOwnProperty'](_0xbda5('0x36'))){_0x53967d[_0xbda5('0x1c')]=qs[_0xbda5('0x1c')](_0x1c3084[_0xbda5('0x2f')][_0xbda5('0x1c')]);_0x53967d[_0xbda5('0x1b')]=qs[_0xbda5('0x1b')](_0x1c3084['query']['offset']);}_0x53967d[_0xbda5('0x37')]=qs['sort'](_0x1c3084[_0xbda5('0x2f')][_0xbda5('0x38')]);_0x53967d[_0xbda5('0x39')]=qs[_0xbda5('0x3a')](_['pick'](_0x1c3084['query'],_0x17f697[_0xbda5('0x3a')]),_0x713cd2);if(_0x1c3084[_0xbda5('0x2f')][_0xbda5('0x3b')]){_0x53967d[_0xbda5('0x39')]=_[_0xbda5('0x3c')](_0x53967d[_0xbda5('0x39')],{'$or':_[_0xbda5('0x2b')](_0x713cd2,function(_0x43b025){if(_0x43b025[_0xbda5('0x3d')]!==_0xbda5('0x3e')){var _0x4de32a={};_0x4de32a[_0x43b025[_0xbda5('0x28')]]={'$like':'%'+_0x1c3084['query'][_0xbda5('0x3b')]+'%'};return _0x4de32a;}})});}_0x53967d=_[_0xbda5('0x3c')]({},_0x53967d,_0x1c3084[_0xbda5('0x3f')]);var _0x4e796f={'where':_0x53967d[_0xbda5('0x39')]};return db[_0xbda5('0x2c')][_0xbda5('0x40')](_0x4e796f)[_0xbda5('0x24')](function(_0x506ed0){_0x3fa4f8[_0xbda5('0x40')]=_0x506ed0;if(_0x1c3084['query'][_0xbda5('0x41')]){_0x53967d['include']=[{'all':!![]}];}return db[_0xbda5('0x2c')]['findAll'](_0x53967d);})[_0xbda5('0x24')](function(_0x1e416f){_0x3fa4f8[_0xbda5('0x42')]=_0x1e416f;return _0x3fa4f8;})[_0xbda5('0x24')](respondWithFilteredResult(_0x1ec316,_0x53967d))[_0xbda5('0x43')](handleError(_0x1ec316,null));};exports[_0xbda5('0x44')]=function(_0x545dbd,_0x6211be){var _0x517c14={'raw':![],'where':{'id':_0x545dbd[_0xbda5('0x45')]['id']}},_0x2b38cf={};_0x2b38cf[_0xbda5('0x33')]=_['keys'](db[_0xbda5('0x2c')]['rawAttributes']);_0x2b38cf[_0xbda5('0x2f')]=_['keys'](_0x545dbd[_0xbda5('0x2f')]);_0x2b38cf[_0xbda5('0x3a')]=_[_0xbda5('0x31')](_0x2b38cf['model'],_0x2b38cf['query']);_0x517c14[_0xbda5('0x32')]=_[_0xbda5('0x31')](_0x2b38cf[_0xbda5('0x33')],qs[_0xbda5('0x34')](_0x545dbd[_0xbda5('0x2f')]['fields']));_0x517c14[_0xbda5('0x32')]=_0x517c14[_0xbda5('0x32')][_0xbda5('0x35')]?_0x517c14[_0xbda5('0x32')]:_0x2b38cf[_0xbda5('0x33')];if(_0x545dbd[_0xbda5('0x2f')][_0xbda5('0x41')]){_0x517c14[_0xbda5('0x46')]=[{'all':!![]}];}_0x517c14=_['merge']({},_0x517c14,_0x545dbd[_0xbda5('0x3f')]);return db[_0xbda5('0x2c')]['find'](_0x517c14)[_0xbda5('0x24')](handleEntityNotFound(_0x6211be,null))[_0xbda5('0x24')](respondWithResult(_0x6211be,null))[_0xbda5('0x43')](handleError(_0x6211be,null));};exports[_0xbda5('0x47')]=function(_0x185245,_0x188f5b){return db[_0xbda5('0x2c')][_0xbda5('0x47')](_0x185245[_0xbda5('0x48')],{})[_0xbda5('0x24')](respondWithResult(_0x188f5b,0xc9))['catch'](handleError(_0x188f5b,null));};exports[_0xbda5('0x23')]=function(_0x2dce48,_0x286ee6){if(_0x2dce48[_0xbda5('0x48')]['id']){delete _0x2dce48[_0xbda5('0x48')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x2dce48['params']['id']}})[_0xbda5('0x24')](handleEntityNotFound(_0x286ee6,null))[_0xbda5('0x24')](saveUpdates(_0x2dce48[_0xbda5('0x48')],null))[_0xbda5('0x24')](respondWithResult(_0x286ee6,null))[_0xbda5('0x43')](handleError(_0x286ee6,null));};exports['destroy']=function(_0xb9440d,_0x29f98f){return db[_0xbda5('0x2c')][_0xbda5('0x49')]({'where':{'id':_0xb9440d[_0xbda5('0x45')]['id']}})[_0xbda5('0x24')](handleEntityNotFound(_0x29f98f,null))[_0xbda5('0x24')](removeEntity(_0x29f98f,null))[_0xbda5('0x43')](handleError(_0x29f98f,null));};exports['describe']=function(_0x262d6f,_0x15a537){return db['UserProfileSection'][_0xbda5('0x4a')]()[_0xbda5('0x24')](respondWithResult(_0x15a537,null))[_0xbda5('0x43')](handleError(_0x15a537,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 04f6714..d03a20e 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 _0x69e6=['./userProfileSection.attributes','exports','define','UserProfileSection','compositeIndex','sectionId','userProfileId','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4a3bd9,_0x4c6ea8){var _0x45b132=function(_0x8cf988){while(--_0x8cf988){_0x4a3bd9['push'](_0x4a3bd9['shift']());}};_0x45b132(++_0x4c6ea8);}(_0x69e6,0x1f1));var _0x669e=function(_0x156ddc,_0x33d8cb){_0x156ddc=_0x156ddc-0x0;var _0x3da943=_0x69e6[_0x156ddc];return _0x3da943;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x669e('0x0'))(_0x669e('0x1'));var moment=require(_0x669e('0x2'));var BPromise=require(_0x669e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x669e('0x4'));var rimraf=require(_0x669e('0x5'));var config=require(_0x669e('0x6'));var attributes=require(_0x669e('0x7'));module[_0x669e('0x8')]=function(_0xe13a43,_0x355782){return _0xe13a43[_0x669e('0x9')](_0x669e('0xa'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x669e('0xb'),'fields':[_0x669e('0xc'),_0x669e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdc61=['compositeIndex','sectionId','userProfileId','lodash','moment','bluebird','path','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections'];(function(_0x15e9a8,_0x35a295){var _0xdab359=function(_0xcc9899){while(--_0xcc9899){_0x15e9a8['push'](_0x15e9a8['shift']());}};_0xdab359(++_0x35a295);}(_0xdc61,0x7b));var _0x1dc6=function(_0x4b1a67,_0x1e9406){_0x4b1a67=_0x4b1a67-0x0;var _0x50d54e=_0xdc61[_0x4b1a67];return _0x50d54e;};'use strict';var _=require(_0x1dc6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1dc6('0x1'));var BPromise=require(_0x1dc6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1dc6('0x3'));var rimraf=require('rimraf');var config=require(_0x1dc6('0x4'));var attributes=require(_0x1dc6('0x5'));module[_0x1dc6('0x6')]=function(_0x569c34,_0x64be6b){return _0x569c34['define'](_0x1dc6('0x7'),attributes,{'tableName':_0x1dc6('0x8'),'paranoid':![],'indexes':[{'name':_0x1dc6('0x9'),'fields':[_0x1dc6('0xa'),_0x1dc6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index a296883..21b539b 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 _0xac8d=['../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x383dbb,_0x17d41b){var _0x6e8bde=function(_0x2740f1){while(--_0x2740f1){_0x383dbb['push'](_0x383dbb['shift']());}};_0x6e8bde(++_0x17d41b);}(_0xac8d,0x1d8));var _0xdac8=function(_0x32b273,_0x162394){_0x32b273=_0x32b273-0x0;var _0x1c8901=_0xac8d[_0x32b273];return _0x1c8901;};'use strict';var _=require(_0xdac8('0x0'));var util=require(_0xdac8('0x1'));var moment=require(_0xdac8('0x2'));var BPromise=require(_0xdac8('0x3'));var rs=require(_0xdac8('0x4'));var fs=require('fs');var Redis=require(_0xdac8('0x5'));var db=require(_0xdac8('0x6'))['db'];var utils=require(_0xdac8('0x7'));var logger=require(_0xdac8('0x8'))('rpc');var config=require(_0xdac8('0x9'));var jayson=require(_0xdac8('0xa'));var client=jayson[_0xdac8('0xb')][_0xdac8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e1cc7,_0x3677da,_0x8f90bd){return new BPromise(function(_0x96c908,_0x116c0a){return client['request'](_0x1e1cc7,_0x8f90bd)[_0xdac8('0xd')](function(_0x55e8ec){logger[_0xdac8('0xe')](_0xdac8('0xf'),_0x3677da,_0xdac8('0x10'));logger[_0xdac8('0x11')](_0xdac8('0x12'),_0x3677da,'request\x20sent',JSON[_0xdac8('0x13')](_0x55e8ec));if(_0x55e8ec['error']){if(_0x55e8ec[_0xdac8('0x14')][_0xdac8('0x15')]===0x1f4){logger[_0xdac8('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x3677da,_0x55e8ec[_0xdac8('0x14')]['message']);return _0x116c0a(_0x55e8ec['error'][_0xdac8('0x16')]);}logger['error'](_0xdac8('0xf'),_0x3677da,_0x55e8ec[_0xdac8('0x14')][_0xdac8('0x16')]);return _0x96c908(_0x55e8ec[_0xdac8('0x14')][_0xdac8('0x16')]);}else{logger['info'](_0xdac8('0xf'),_0x3677da,_0xdac8('0x10'));_0x96c908(_0x55e8ec[_0xdac8('0x17')][_0xdac8('0x16')]);}})['catch'](function(_0x9d075f){logger[_0xdac8('0x14')](_0xdac8('0xf'),_0x3677da,_0x9d075f);_0x116c0a(_0x9d075f);});});} \ No newline at end of file +var _0x6c41=['UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3d3d7b,_0x5c0937){var _0x33e7c8=function(_0xe0ee81){while(--_0xe0ee81){_0x3d3d7b['push'](_0x3d3d7b['shift']());}};_0x33e7c8(++_0x5c0937);}(_0x6c41,0x151));var _0x16c4=function(_0x54c9dd,_0x233a86){_0x54c9dd=_0x54c9dd-0x0;var _0x855156=_0x6c41[_0x54c9dd];return _0x855156;};'use strict';var _=require(_0x16c4('0x0'));var util=require(_0x16c4('0x1'));var moment=require('moment');var BPromise=require(_0x16c4('0x2'));var rs=require(_0x16c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16c4('0x4'))['db'];var utils=require(_0x16c4('0x5'));var logger=require(_0x16c4('0x6'))('rpc');var config=require(_0x16c4('0x7'));var jayson=require(_0x16c4('0x8'));var client=jayson['client'][_0x16c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c4ee2,_0x59fbe6,_0x56c378){return new BPromise(function(_0x5327f0,_0x58c6e8){return client[_0x16c4('0xa')](_0x5c4ee2,_0x56c378)[_0x16c4('0xb')](function(_0x41a9df){logger['info'](_0x16c4('0xc'),_0x59fbe6,_0x16c4('0xd'));logger[_0x16c4('0xe')](_0x16c4('0xf'),_0x59fbe6,_0x16c4('0xd'),JSON[_0x16c4('0x10')](_0x41a9df));if(_0x41a9df[_0x16c4('0x11')]){if(_0x41a9df['error'][_0x16c4('0x12')]===0x1f4){logger[_0x16c4('0x11')](_0x16c4('0xc'),_0x59fbe6,_0x41a9df[_0x16c4('0x11')]['message']);return _0x58c6e8(_0x41a9df[_0x16c4('0x11')][_0x16c4('0x13')]);}logger[_0x16c4('0x11')](_0x16c4('0xc'),_0x59fbe6,_0x41a9df['error'][_0x16c4('0x13')]);return _0x5327f0(_0x41a9df[_0x16c4('0x11')][_0x16c4('0x13')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x59fbe6,'request\x20sent');_0x5327f0(_0x41a9df[_0x16c4('0x14')][_0x16c4('0x13')]);}})[_0x16c4('0x15')](function(_0x2ea322){logger[_0x16c4('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x59fbe6,_0x2ea322);_0x58c6e8(_0x2ea322);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index bac8340..08e4e1d 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3036a0,_0x1fcc63){var _0x35e8b0=function(_0x165e9c){while(--_0x165e9c){_0x3036a0['push'](_0x3036a0['shift']());}};_0x35e8b0(++_0x1fcc63);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x170ee8,_0x13c147){var _0x24e763=function(_0x44ed7c){while(--_0x44ed7c){_0x170ee8['push'](_0x170ee8['shift']());}};_0x24e763(++_0x13c147);}(_0xe706,0xa3));var _0x6e70=function(_0x5c6299,_0x11bd28){_0x5c6299=_0x5c6299-0x0;var _0x23b564=_0xe706[_0x5c6299];return _0x23b564;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 518bddb..3885515 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 _0x09f8=['sequelize','exports'];(function(_0x3bb383,_0x26a2ab){var _0x126467=function(_0x1fd85c){while(--_0x1fd85c){_0x3bb383['push'](_0x3bb383['shift']());}};_0x126467(++_0x26a2ab);}(_0x09f8,0x8e));var _0x809f=function(_0x47906c,_0x19c3dd){_0x47906c=_0x47906c-0x0;var _0x3f7dcf=_0x09f8[_0x47906c];return _0x3f7dcf;};'use strict';var Sequelize=require(_0x809f('0x0'));module[_0x809f('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe4c0=['exports'];(function(_0x24d8db,_0x2392c6){var _0x13d20d=function(_0x568f80){while(--_0x568f80){_0x24d8db['push'](_0x24d8db['shift']());}};_0x13d20d(++_0x2392c6);}(_0xe4c0,0x1ca));var _0x0e4c=function(_0x7538c5,_0xa5d8ac){_0x7538c5=_0x7538c5-0x0;var _0x8b56be=_0xe4c0[_0x7538c5];return _0x8b56be;};'use strict';var Sequelize=require('sequelize');module[_0x0e4c('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'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 f92b63b..9d41435 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 _0x8506=['util','api','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x2d6016,_0x56656e){var _0x4fcd9a=function(_0x4a5787){while(--_0x4a5787){_0x2d6016['push'](_0x2d6016['shift']());}};_0x4fcd9a(++_0x56656e);}(_0x8506,0xe8));var _0x6850=function(_0x213ad0,_0x3363e0){_0x213ad0=_0x213ad0-0x0;var _0x40218e=_0x8506[_0x213ad0];return _0x40218e;};'use strict';var _=require('lodash');var util=require(_0x6850('0x0'));var logger=require('../../config/logger')(_0x6850('0x1'));var moment=require('moment');var BPromise=require(_0x6850('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6850('0x3'));var rimraf=require(_0x6850('0x4'));var config=require(_0x6850('0x5'));var attributes=require('./userSmsQueue.attributes');module[_0x6850('0x6')]=function(_0x372f0b,_0x232459){return _0x372f0b[_0x6850('0x7')]('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdfa0=['path','../../config/environment','exports','define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x4617b1,_0x11a341){var _0x2b14dc=function(_0x4f5b20){while(--_0x4f5b20){_0x4617b1['push'](_0x4617b1['shift']());}};_0x2b14dc(++_0x11a341);}(_0xdfa0,0x69));var _0x0dfa=function(_0x10c0a2,_0x401389){_0x10c0a2=_0x10c0a2-0x0;var _0x2efe4f=_0xdfa0[_0x10c0a2];return _0x2efe4f;};'use strict';var _=require(_0x0dfa('0x0'));var util=require('util');var logger=require(_0x0dfa('0x1'))(_0x0dfa('0x2'));var moment=require('moment');var BPromise=require(_0x0dfa('0x3'));var rp=require(_0x0dfa('0x4'));var fs=require('fs');var path=require(_0x0dfa('0x5'));var rimraf=require('rimraf');var config=require(_0x0dfa('0x6'));var attributes=require('./userSmsQueue.attributes');module[_0x0dfa('0x7')]=function(_0x2efe20,_0x4830b6){return _0x2efe20[_0x0dfa('0x8')](_0x0dfa('0x9'),attributes,{'tableName':_0x0dfa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index d4d0763..a6ab621 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 _0xfa9f=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','info','request\x20sent','debug','error','UserSmsQueue,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x36d183,_0x321974){var _0x442e71=function(_0x422f4c){while(--_0x422f4c){_0x36d183['push'](_0x36d183['shift']());}};_0x442e71(++_0x321974);}(_0xfa9f,0x11b));var _0xffa9=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0xfa9f[_0x1477ef];return _0x164acd;};'use strict';var _=require('lodash');var util=require(_0xffa9('0x0'));var moment=require('moment');var BPromise=require(_0xffa9('0x1'));var rs=require(_0xffa9('0x2'));var fs=require('fs');var Redis=require(_0xffa9('0x3'));var db=require(_0xffa9('0x4'))['db'];var utils=require(_0xffa9('0x5'));var logger=require(_0xffa9('0x6'))(_0xffa9('0x7'));var config=require(_0xffa9('0x8'));var jayson=require(_0xffa9('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xe9b5c1,_0x5b7b4e,_0x2616bb){return new BPromise(function(_0x1c5a60,_0x163480){return client['request'](_0xe9b5c1,_0x2616bb)['then'](function(_0x55a7c7){logger[_0xffa9('0xa')]('UserSmsQueue,\x20%s,\x20%s',_0x5b7b4e,_0xffa9('0xb'));logger[_0xffa9('0xc')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x5b7b4e,_0xffa9('0xb'),JSON['stringify'](_0x55a7c7));if(_0x55a7c7[_0xffa9('0xd')]){if(_0x55a7c7[_0xffa9('0xd')]['code']===0x1f4){logger['error'](_0xffa9('0xe'),_0x5b7b4e,_0x55a7c7[_0xffa9('0xd')]['message']);return _0x163480(_0x55a7c7[_0xffa9('0xd')][_0xffa9('0xf')]);}logger[_0xffa9('0xd')](_0xffa9('0xe'),_0x5b7b4e,_0x55a7c7[_0xffa9('0xd')][_0xffa9('0xf')]);return _0x1c5a60(_0x55a7c7[_0xffa9('0xd')][_0xffa9('0xf')]);}else{logger[_0xffa9('0xa')](_0xffa9('0xe'),_0x5b7b4e,_0xffa9('0xb'));_0x1c5a60(_0x55a7c7[_0xffa9('0x10')]['message']);}})[_0xffa9('0x11')](function(_0xdc6542){logger[_0xffa9('0xd')](_0xffa9('0xe'),_0x5b7b4e,_0xdc6542);_0x163480(_0xdc6542);});});} \ No newline at end of file +var _0x24d7=['info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x4d68d2,_0x1c93b1){var _0x7b8f3=function(_0x1d0d96){while(--_0x1d0d96){_0x4d68d2['push'](_0x4d68d2['shift']());}};_0x7b8f3(++_0x1c93b1);}(_0x24d7,0x198));var _0x724d=function(_0x1f6e8c,_0x362e75){_0x1f6e8c=_0x1f6e8c-0x0;var _0x414141=_0x24d7[_0x1f6e8c];return _0x414141;};'use strict';var _=require(_0x724d('0x0'));var util=require(_0x724d('0x1'));var moment=require(_0x724d('0x2'));var BPromise=require(_0x724d('0x3'));var rs=require(_0x724d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x724d('0x5'));var logger=require(_0x724d('0x6'))(_0x724d('0x7'));var config=require(_0x724d('0x8'));var jayson=require(_0x724d('0x9'));var client=jayson['client'][_0x724d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43aa64,_0x544b20,_0x4e4178){return new BPromise(function(_0x118b04,_0x560a02){return client['request'](_0x43aa64,_0x4e4178)[_0x724d('0xb')](function(_0x2be927){logger[_0x724d('0xc')](_0x724d('0xd'),_0x544b20,_0x724d('0xe'));logger[_0x724d('0xf')](_0x724d('0x10'),_0x544b20,_0x724d('0xe'),JSON[_0x724d('0x11')](_0x2be927));if(_0x2be927[_0x724d('0x12')]){if(_0x2be927[_0x724d('0x12')]['code']===0x1f4){logger[_0x724d('0x12')](_0x724d('0xd'),_0x544b20,_0x2be927[_0x724d('0x12')]['message']);return _0x560a02(_0x2be927[_0x724d('0x12')]['message']);}logger[_0x724d('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x544b20,_0x2be927[_0x724d('0x12')]['message']);return _0x118b04(_0x2be927[_0x724d('0x12')][_0x724d('0x13')]);}else{logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x544b20,'request\x20sent');_0x118b04(_0x2be927['result'][_0x724d('0x13')]);}})[_0x724d('0x14')](function(_0x40ba54){logger[_0x724d('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x544b20,_0x40ba54);_0x560a02(_0x40ba54);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index c8fa787..ea92d8d 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 _0x8095=['INTEGER','sequelize'];(function(_0x3aa32c,_0x4bacee){var _0x6c7a4b=function(_0x387bc){while(--_0x387bc){_0x3aa32c['push'](_0x3aa32c['shift']());}};_0x6c7a4b(++_0x4bacee);}(_0x8095,0x103));var _0x5809=function(_0xb4ea16,_0x53ed55){_0xb4ea16=_0xb4ea16-0x0;var _0x556bae=_0x8095[_0xb4ea16];return _0x556bae;};'use strict';var Sequelize=require(_0x5809('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x5809('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x5809('0x1')]}}; \ No newline at end of file +var _0x4a75=['exports','INTEGER','sequelize'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x4a75,0xdd));var _0x54a7=function(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0x4a75[_0x5d7227];return _0x15ac55;};'use strict';var Sequelize=require(_0x54a7('0x0'));module[_0x54a7('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x54a7('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 448cedc..c0bb480 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(_0x5b343d,_0x4b80a0){var _0x5ac230=function(_0x4cd211){while(--_0x4cd211){_0x5b343d['push'](_0x5b343d['shift']());}};_0x5ac230(++_0x4b80a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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(_0x1108fe,_0x131a36){var _0x334e86=function(_0x381f9f){while(--_0x381f9f){_0x1108fe['push'](_0x1108fe['shift']());}};_0x334e86(++_0x131a36);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 3deb1de..7a89991 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1b67dc,_0x351021){var _0x5ec54f=function(_0x24fc0a){while(--_0x24fc0a){_0x1b67dc['push'](_0x1b67dc['shift']());}};_0x5ec54f(++_0x351021);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4409e7,_0x307f17){_0x4409e7=_0x4409e7-0x0;var _0x24c751=_0xcb91[_0x4409e7];return _0x24c751;};'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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x5ab761,_0x3bf2d5){var _0x126dbf=function(_0x111ac0){while(--_0x111ac0){_0x5ab761['push'](_0x5ab761['shift']());}};_0x126dbf(++_0x3bf2d5);}(_0xedd9,0xfc));var _0x9edd=function(_0x67b060,_0x5b2995){_0x67b060=_0x67b060-0x0;var _0x947671=_0xedd9[_0x67b060];return _0x947671;};'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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index bc7ca8a..9e3985d 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 _0x3fb1=['exports','INTEGER','sequelize'];(function(_0x38913e,_0x51a574){var _0x4ebc78=function(_0x84720c){while(--_0x84720c){_0x38913e['push'](_0x38913e['shift']());}};_0x4ebc78(++_0x51a574);}(_0x3fb1,0x8c));var _0x13fb=function(_0x25b064,_0x4aa631){_0x25b064=_0x25b064-0x0;var _0x478c7b=_0x3fb1[_0x25b064];return _0x478c7b;};'use strict';var Sequelize=require(_0x13fb('0x0'));module[_0x13fb('0x1')]={'penalty':{'type':Sequelize[_0x13fb('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc755=['exports'];(function(_0x357526,_0x5f3b11){var _0x205f46=function(_0xf292e0){while(--_0xf292e0){_0x357526['push'](_0x357526['shift']());}};_0x205f46(++_0x5f3b11);}(_0xc755,0xd6));var _0x5c75=function(_0x79b72,_0x1772df){_0x79b72=_0x79b72-0x0;var _0x50802d=_0xc755[_0x79b72];return _0x50802d;};'use strict';var Sequelize=require('sequelize');module[_0x5c75('0x0')]={'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 7443f7a..3cdd308 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 _0xcb4b=['path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','util','../../config/logger','api','bluebird','request-promise'];(function(_0x431e6d,_0x471ab9){var _0x531ddd=function(_0x2afc32){while(--_0x2afc32){_0x431e6d['push'](_0x431e6d['shift']());}};_0x531ddd(++_0x471ab9);}(_0xcb4b,0x7d));var _0xbcb4=function(_0x1a541c,_0x3bc400){_0x1a541c=_0x1a541c-0x0;var _0x695bdc=_0xcb4b[_0x1a541c];return _0x695bdc;};'use strict';var _=require('lodash');var util=require(_0xbcb4('0x0'));var logger=require(_0xbcb4('0x1'))(_0xbcb4('0x2'));var moment=require('moment');var BPromise=require(_0xbcb4('0x3'));var rp=require(_0xbcb4('0x4'));var fs=require('fs');var path=require(_0xbcb4('0x5'));var rimraf=require(_0xbcb4('0x6'));var config=require(_0xbcb4('0x7'));var attributes=require(_0xbcb4('0x8'));module[_0xbcb4('0x9')]=function(_0x55bb47,_0x1d837b){return _0x55bb47[_0xbcb4('0xa')](_0xbcb4('0xb'),attributes,{'tableName':_0xbcb4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4146=['../../config/environment','./userVoiceQueue.attributes','exports','define','user_has_voice_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x1457ad,_0x5bce7d){var _0x5b384b=function(_0x154ad4){while(--_0x154ad4){_0x1457ad['push'](_0x1457ad['shift']());}};_0x5b384b(++_0x5bce7d);}(_0x4146,0x191));var _0x6414=function(_0x1f137d,_0x3773cf){_0x1f137d=_0x1f137d-0x0;var _0x237aaa=_0x4146[_0x1f137d];return _0x237aaa;};'use strict';var _=require(_0x6414('0x0'));var util=require('util');var logger=require(_0x6414('0x1'))(_0x6414('0x2'));var moment=require(_0x6414('0x3'));var BPromise=require(_0x6414('0x4'));var rp=require(_0x6414('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6414('0x6'));var config=require(_0x6414('0x7'));var attributes=require(_0x6414('0x8'));module[_0x6414('0x9')]=function(_0x5343e2,_0x595dc4){return _0x5343e2[_0x6414('0xa')]('UserVoiceQueue',attributes,{'tableName':_0x6414('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 0f306e9..c4b77ee 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 _0xe7c3=['request\x20sent','debug','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x16d080,_0x2753cb){var _0x4c7edc=function(_0x1cdf3e){while(--_0x1cdf3e){_0x16d080['push'](_0x16d080['shift']());}};_0x4c7edc(++_0x2753cb);}(_0xe7c3,0xf3));var _0x3e7c=function(_0x4285a0,_0x1dfb9d){_0x4285a0=_0x4285a0-0x0;var _0x1615c4=_0xe7c3[_0x4285a0];return _0x1615c4;};'use strict';var _=require(_0x3e7c('0x0'));var util=require(_0x3e7c('0x1'));var moment=require(_0x3e7c('0x2'));var BPromise=require(_0x3e7c('0x3'));var rs=require(_0x3e7c('0x4'));var fs=require('fs');var Redis=require(_0x3e7c('0x5'));var db=require(_0x3e7c('0x6'))['db'];var utils=require(_0x3e7c('0x7'));var logger=require(_0x3e7c('0x8'))(_0x3e7c('0x9'));var config=require(_0x3e7c('0xa'));var jayson=require(_0x3e7c('0xb'));var client=jayson[_0x3e7c('0xc')][_0x3e7c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x33ebfe,_0x230bca,_0x42aff6){return new BPromise(function(_0x5dce7e,_0x34775b){return client[_0x3e7c('0xe')](_0x33ebfe,_0x42aff6)[_0x3e7c('0xf')](function(_0x3cfec1){logger[_0x3e7c('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x230bca,_0x3e7c('0x11'));logger[_0x3e7c('0x12')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x230bca,'request\x20sent',JSON[_0x3e7c('0x13')](_0x3cfec1));if(_0x3cfec1[_0x3e7c('0x14')]){if(_0x3cfec1['error'][_0x3e7c('0x15')]===0x1f4){logger[_0x3e7c('0x14')](_0x3e7c('0x16'),_0x230bca,_0x3cfec1[_0x3e7c('0x14')][_0x3e7c('0x17')]);return _0x34775b(_0x3cfec1[_0x3e7c('0x14')][_0x3e7c('0x17')]);}logger[_0x3e7c('0x14')](_0x3e7c('0x16'),_0x230bca,_0x3cfec1[_0x3e7c('0x14')][_0x3e7c('0x17')]);return _0x5dce7e(_0x3cfec1[_0x3e7c('0x14')][_0x3e7c('0x17')]);}else{logger['info'](_0x3e7c('0x16'),_0x230bca,'request\x20sent');_0x5dce7e(_0x3cfec1[_0x3e7c('0x18')][_0x3e7c('0x17')]);}})[_0x3e7c('0x19')](function(_0x232102){logger[_0x3e7c('0x14')]('UserVoiceQueue,\x20%s,\x20%s',_0x230bca,_0x232102);_0x34775b(_0x232102);});});} \ No newline at end of file +var _0x44c3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x44c3,0x95));var _0x344c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x44c3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x344c('0x0'));var util=require(_0x344c('0x1'));var moment=require(_0x344c('0x2'));var BPromise=require(_0x344c('0x3'));var rs=require(_0x344c('0x4'));var fs=require('fs');var Redis=require(_0x344c('0x5'));var db=require(_0x344c('0x6'))['db'];var utils=require(_0x344c('0x7'));var logger=require(_0x344c('0x8'))(_0x344c('0x9'));var config=require('../../config/environment');var jayson=require(_0x344c('0xa'));var client=jayson[_0x344c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1eb100,_0x149dff,_0x47f720){return new BPromise(function(_0xd65b9f,_0x36e08e){return client[_0x344c('0xc')](_0x1eb100,_0x47f720)['then'](function(_0xfec475){logger[_0x344c('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x149dff,_0x344c('0xe'));logger[_0x344c('0xf')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x149dff,_0x344c('0xe'),JSON[_0x344c('0x10')](_0xfec475));if(_0xfec475[_0x344c('0x11')]){if(_0xfec475[_0x344c('0x11')][_0x344c('0x12')]===0x1f4){logger['error'](_0x344c('0x13'),_0x149dff,_0xfec475[_0x344c('0x11')][_0x344c('0x14')]);return _0x36e08e(_0xfec475['error'][_0x344c('0x14')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x149dff,_0xfec475[_0x344c('0x11')][_0x344c('0x14')]);return _0xd65b9f(_0xfec475[_0x344c('0x11')][_0x344c('0x14')]);}else{logger[_0x344c('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x149dff,_0x344c('0xe'));_0xd65b9f(_0xfec475[_0x344c('0x15')][_0x344c('0x14')]);}})['catch'](function(_0x5cb35a){logger[_0x344c('0x11')](_0x344c('0x13'),_0x149dff,_0x5cb35a);_0x36e08e(_0x5cb35a);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 97335da..b1f1c9d 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x24b5d8,_0x203128){var _0x54908d=function(_0x3b0db0){while(--_0x3b0db0){_0x24b5d8['push'](_0x24b5d8['shift']());}};_0x54908d(++_0x203128);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4cd0d9,_0x3f6f68){var _0xe4133b=function(_0x3e9bce){while(--_0x3e9bce){_0x4cd0d9['push'](_0x4cd0d9['shift']());}};_0xe4133b(++_0x3f6f68);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index c2f83bc..98055a7 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 _0xb422=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x1dbf56,_0x3cc814){var _0x157122=function(_0x4c420a){while(--_0x4c420a){_0x1dbf56['push'](_0x1dbf56['shift']());}};_0x157122(++_0x3cc814);}(_0xb422,0x179));var _0x2b42=function(_0x195690,_0x13d76e){_0x195690=_0x195690-0x0;var _0xcd8219=_0xb422[_0x195690];return _0xcd8219;};'use strict';var Sequelize=require(_0x2b42('0x0'));module[_0x2b42('0x1')]={'uniqueid':{'type':Sequelize[_0x2b42('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x2b42('0x3')},'UserId':{'type':Sequelize[_0x2b42('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x2b42('0x4')],'allowNull':![],'unique':_0x2b42('0x5'),'comment':_0x2b42('0x3')},'VoiceQueueId':{'type':Sequelize[_0x2b42('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2b42('0x5'),'comment':_0x2b42('0x3')},'penalty':{'type':Sequelize[_0x2b42('0x2')](0xb),'defaultValue':0x0,'comment':_0x2b42('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x2b42('0x3')}}; \ No newline at end of file +var _0x1771=['Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface','sequelize','exports'];(function(_0x18769a,_0xbb8d4c){var _0x28c59b=function(_0x4eb66f){while(--_0x4eb66f){_0x18769a['push'](_0x18769a['shift']());}};_0x28c59b(++_0xbb8d4c);}(_0x1771,0xdc));var _0x1177=function(_0x105f45,_0x1af649){_0x105f45=_0x105f45-0x0;var _0x5545d2=_0x1771[_0x105f45];return _0x5545d2;};'use strict';var Sequelize=require(_0x1177('0x0'));module[_0x1177('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x1177('0x2')},'membername':{'type':Sequelize[_0x1177('0x3')],'allowNull':![],'comment':_0x1177('0x2')},'UserId':{'type':Sequelize[_0x1177('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x1177('0x3')],'allowNull':![],'unique':_0x1177('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x1177('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0x1177('0x3')],'allowNull':![],'unique':_0x1177('0x5'),'comment':_0x1177('0x2')},'penalty':{'type':Sequelize[_0x1177('0x4')](0xb),'defaultValue':0x0,'comment':_0x1177('0x2')},'paused':{'type':Sequelize[_0x1177('0x4')](0xb),'defaultValue':0x0,'comment':_0x1177('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 9862241..507dcdb 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 _0xcb3e=['hook','exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners','update','emit'];(function(_0x5dfc2a,_0x1a953f){var _0x3f1a71=function(_0x15916){while(--_0x15916){_0x5dfc2a['push'](_0x5dfc2a['shift']());}};_0x3f1a71(++_0x1a953f);}(_0xcb3e,0xa3));var _0xecb3=function(_0x2d3b6e,_0x37addf){_0x2d3b6e=_0x2d3b6e-0x0;var _0x221990=_0xcb3e[_0x2d3b6e];return _0x221990;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xecb3('0x0'))['db'][_0xecb3('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xecb3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xecb3('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3b7f85){return function(_0x1ee0cb,_0x29cfcf,_0x347ccb){UserVoiceQueueRtEvents[_0xecb3('0x4')](_0x3b7f85+':'+_0x1ee0cb['id'],_0x1ee0cb);UserVoiceQueueRtEvents[_0xecb3('0x4')](_0x3b7f85,_0x1ee0cb);_0x347ccb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xecb3('0x5')](e,emitEvent(event));}}module[_0xecb3('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xfb46=['update','remove','emit','hook','exports','events','../../mysqldb','UserVoiceQueueRt'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfb46,0xb5));var _0x6fb4=function(_0x3bc3b4,_0x5acff4){_0x3bc3b4=_0x3bc3b4-0x0;var _0x4c546b=_0xfb46[_0x3bc3b4];return _0x4c546b;};'use strict';var EventEmitter=require(_0x6fb4('0x0'));var UserVoiceQueueRt=require(_0x6fb4('0x1'))['db'][_0x6fb4('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6fb4('0x3'),'afterDestroy':_0x6fb4('0x4')};function emitEvent(_0x42319b){return function(_0x44a04b,_0x40aa99,_0xc3e0aa){UserVoiceQueueRtEvents[_0x6fb4('0x5')](_0x42319b+':'+_0x44a04b['id'],_0x44a04b);UserVoiceQueueRtEvents[_0x6fb4('0x5')](_0x42319b,_0x44a04b);_0xc3e0aa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x6fb4('0x6')](e,emitEvent(event));}}module[_0x6fb4('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 97bbb37..cf4a7ba 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 _0x16d9=['exports','define','lodash','moment','rimraf','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x16d9,0xaa));var _0x916d=function(_0x2a9bf4,_0x5e0ffb){_0x2a9bf4=_0x2a9bf4-0x0;var _0x5f5ff1=_0x16d9[_0x2a9bf4];return _0x5f5ff1;};'use strict';var _=require(_0x916d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x916d('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x916d('0x2'));var config=require(_0x916d('0x3'));var attributes=require(_0x916d('0x4'));module[_0x916d('0x5')]=function(_0x526067,_0x3922ed){return _0x526067[_0x916d('0x6')]('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a82=['lodash','../../config/logger','api','bluebird','path','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt'];(function(_0x3b405e,_0x204e49){var _0x43891f=function(_0x5eddf1){while(--_0x5eddf1){_0x3b405e['push'](_0x3b405e['shift']());}};_0x43891f(++_0x204e49);}(_0x7a82,0xb4));var _0x27a8=function(_0x484d86,_0x5b8de8){_0x484d86=_0x484d86-0x0;var _0x3be269=_0x7a82[_0x484d86];return _0x3be269;};'use strict';var _=require(_0x27a8('0x0'));var util=require('util');var logger=require(_0x27a8('0x1'))(_0x27a8('0x2'));var moment=require('moment');var BPromise=require(_0x27a8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x27a8('0x4'));var rimraf=require('rimraf');var config=require(_0x27a8('0x5'));var attributes=require(_0x27a8('0x6'));module[_0x27a8('0x7')]=function(_0x57fea5,_0x2134af){return _0x57fea5[_0x27a8('0x8')](_0x27a8('0x9'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index ca21353..e82e76c 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 _0xa1d3=['error','code','message','UserVoiceQueueRt,\x20%s,\x20%s','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','outboundQueuePauses','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','localhost','register','then','info','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3bda6b,_0x179b7e){var _0x2c46a3=function(_0x1b184e){while(--_0x1b184e){_0x3bda6b['push'](_0x3bda6b['shift']());}};_0x2c46a3(++_0x179b7e);}(_0xa1d3,0x129));var _0x3a1d=function(_0xc036bb,_0x5cab81){_0xc036bb=_0xc036bb-0x0;var _0x523ab9=_0xa1d3[_0xc036bb];return _0x523ab9;};'use strict';var _=require(_0x3a1d('0x0'));var util=require(_0x3a1d('0x1'));var moment=require(_0x3a1d('0x2'));var BPromise=require(_0x3a1d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3a1d('0x4'));var db=require(_0x3a1d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3a1d('0x6'))(_0x3a1d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3a1d('0x8')][_0x3a1d('0x9')]({'port':0x232a});config[_0x3a1d('0xa')]=_['defaults'](config[_0x3a1d('0xa')],{'host':_0x3a1d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a1d('0xa')]));require('./userVoiceQueueRt.socket')[_0x3a1d('0xc')](socket);function respondWithRpcPromise(_0x5e574e,_0x4310f7,_0x535534){return new BPromise(function(_0x1b484b,_0x5d550a){return client['request'](_0x5e574e,_0x535534)[_0x3a1d('0xd')](function(_0x3b190b){logger[_0x3a1d('0xe')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4310f7,_0x3a1d('0xf'));logger['debug'](_0x3a1d('0x10'),_0x4310f7,'request\x20sent',JSON[_0x3a1d('0x11')](_0x3b190b));if(_0x3b190b['error']){if(_0x3b190b[_0x3a1d('0x12')][_0x3a1d('0x13')]===0x1f4){logger[_0x3a1d('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4310f7,_0x3b190b[_0x3a1d('0x12')]['message']);return _0x5d550a(_0x3b190b['error'][_0x3a1d('0x14')]);}logger[_0x3a1d('0x12')](_0x3a1d('0x15'),_0x4310f7,_0x3b190b[_0x3a1d('0x12')]['message']);return _0x1b484b(_0x3b190b['error'][_0x3a1d('0x14')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x4310f7,'request\x20sent');_0x1b484b(_0x3b190b[_0x3a1d('0x16')][_0x3a1d('0x14')]);}})[_0x3a1d('0x17')](function(_0x455d58){logger['error'](_0x3a1d('0x15'),_0x4310f7,_0x455d58);_0x5d550a(_0x455d58);});});}exports[_0x3a1d('0x18')]=function(_0x494e84){var _0x3e02f2=this;return new Promise(function(_0xdede05,_0x411230){return db[_0x3a1d('0x19')][_0x3a1d('0x1a')]({'raw':_0x494e84[_0x3a1d('0x1b')]?_0x494e84['options'][_0x3a1d('0x1c')]===undefined?!![]:![]:!![],'where':_0x494e84['options']?_0x494e84[_0x3a1d('0x1b')][_0x3a1d('0x1d')]||null:null,'attributes':[[db[_0x3a1d('0x1e')]['fn'](_0x3a1d('0x1f'),db[_0x3a1d('0x1e')]['fn']('IF',db[_0x3a1d('0x1e')][_0x3a1d('0x20')]('`paused`\x20=\x201,\x201,\x20null'))),_0x3a1d('0x21')]]})[_0x3a1d('0xd')](function(_0x3962ac){logger[_0x3a1d('0xe')](_0x3a1d('0x18'),_0x494e84);logger[_0x3a1d('0x22')]('GetVoiceQueueRtPauses',_0x494e84,JSON[_0x3a1d('0x11')](_0x3962ac));_0xdede05(_0x3962ac);})[_0x3a1d('0x17')](function(_0x64da9f){logger[_0x3a1d('0x12')](_0x3a1d('0x18'),_0x64da9f['message'],_0x494e84);_0x411230(_0x3e02f2[_0x3a1d('0x12')](0x1f4,_0x64da9f[_0x3a1d('0x14')]));});});}; \ No newline at end of file +var _0x43b8=['message','UserVoiceQueueRt,\x20%s,\x20%s','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','outboundQueuePauses','debug','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','request','then','info','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3861f7,_0x995b22){var _0x50879f=function(_0x3003f1){while(--_0x3003f1){_0x3861f7['push'](_0x3861f7['shift']());}};_0x50879f(++_0x995b22);}(_0x43b8,0xfc));var _0x843b=function(_0x2b7ffe,_0x3129be){_0x2b7ffe=_0x2b7ffe-0x0;var _0x1a009a=_0x43b8[_0x2b7ffe];return _0x1a009a;};'use strict';var _=require('lodash');var util=require(_0x843b('0x0'));var moment=require(_0x843b('0x1'));var BPromise=require('bluebird');var rs=require(_0x843b('0x2'));var fs=require('fs');var Redis=require(_0x843b('0x3'));var db=require(_0x843b('0x4'))['db'];var utils=require(_0x843b('0x5'));var logger=require('../../config/logger')(_0x843b('0x6'));var config=require('../../config/environment');var jayson=require(_0x843b('0x7'));var client=jayson[_0x843b('0x8')][_0x843b('0x9')]({'port':0x232a});config['redis']=_[_0x843b('0xa')](config[_0x843b('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x843b('0xb')]));require('./userVoiceQueueRt.socket')['register'](socket);function respondWithRpcPromise(_0x7e0f77,_0x38fdfb,_0x40c043){return new BPromise(function(_0x4c9cdb,_0x49daf){return client[_0x843b('0xc')](_0x7e0f77,_0x40c043)[_0x843b('0xd')](function(_0x59b19e){logger[_0x843b('0xe')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x38fdfb,_0x843b('0xf'));logger['debug'](_0x843b('0x10'),_0x38fdfb,_0x843b('0xf'),JSON[_0x843b('0x11')](_0x59b19e));if(_0x59b19e[_0x843b('0x12')]){if(_0x59b19e[_0x843b('0x12')][_0x843b('0x13')]===0x1f4){logger[_0x843b('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x38fdfb,_0x59b19e[_0x843b('0x12')][_0x843b('0x14')]);return _0x49daf(_0x59b19e[_0x843b('0x12')][_0x843b('0x14')]);}logger[_0x843b('0x12')](_0x843b('0x15'),_0x38fdfb,_0x59b19e[_0x843b('0x12')][_0x843b('0x14')]);return _0x4c9cdb(_0x59b19e[_0x843b('0x12')][_0x843b('0x14')]);}else{logger[_0x843b('0xe')](_0x843b('0x15'),_0x38fdfb,'request\x20sent');_0x4c9cdb(_0x59b19e['result']['message']);}})['catch'](function(_0x19cda7){logger['error'](_0x843b('0x15'),_0x38fdfb,_0x19cda7);_0x49daf(_0x19cda7);});});}exports[_0x843b('0x16')]=function(_0x3a1d21){var _0x5b6ee9=this;return new Promise(function(_0x5162a2,_0x404bd3){return db[_0x843b('0x17')][_0x843b('0x18')]({'raw':_0x3a1d21['options']?_0x3a1d21[_0x843b('0x19')][_0x843b('0x1a')]===undefined?!![]:![]:!![],'where':_0x3a1d21[_0x843b('0x19')]?_0x3a1d21['options'][_0x843b('0x1b')]||null:null,'attributes':[[db[_0x843b('0x1c')]['fn'](_0x843b('0x1d'),db[_0x843b('0x1c')]['fn']('IF',db[_0x843b('0x1c')][_0x843b('0x1e')]('`paused`\x20=\x201,\x201,\x20null'))),_0x843b('0x1f')]]})[_0x843b('0xd')](function(_0x2630fc){logger[_0x843b('0xe')](_0x843b('0x16'),_0x3a1d21);logger[_0x843b('0x20')](_0x843b('0x16'),_0x3a1d21,JSON['stringify'](_0x2630fc));_0x5162a2(_0x2630fc);})[_0x843b('0x21')](function(_0x402782){logger[_0x843b('0x12')](_0x843b('0x16'),_0x402782[_0x843b('0x14')],_0x3a1d21);_0x404bd3(_0x5b6ee9[_0x843b('0x12')](0x1f4,_0x402782['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 25aaa33..4e1f6e4 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 _0x9f5a=['update','emit','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0x40c8d0,_0x3a0fcc){var _0x20db54=function(_0x31afd4){while(--_0x31afd4){_0x40c8d0['push'](_0x40c8d0['shift']());}};_0x20db54(++_0x3a0fcc);}(_0x9f5a,0xbd));var _0xa9f5=function(_0x2fdbd1,_0x4a2124){_0x2fdbd1=_0x2fdbd1-0x0;var _0x2e2c39=_0x9f5a[_0x2fdbd1];return _0x2e2c39;};'use strict';var UserVoiceQueueRtEvents=require(_0xa9f5('0x0'));var events=[_0xa9f5('0x1'),_0xa9f5('0x2'),_0xa9f5('0x3')];function createListener(_0x546306,_0x4268b0){return function(_0x45e3f5){_0x4268b0[_0xa9f5('0x4')](_0x546306,_0x45e3f5);};}function removeListener(_0x4eeedd,_0x20f51f){return function(){UserVoiceQueueRtEvents['removeListener'](_0x4eeedd,_0x20f51f);};}exports[_0xa9f5('0x5')]=function(_0x219e89){for(var _0x49e337=0x0,_0x6c040d=events[_0xa9f5('0x6')];_0x49e337<_0x6c040d;_0x49e337++){var _0x3f644f=events[_0x49e337];var _0x1f6c78=createListener(_0xa9f5('0x7')+_0x3f644f,_0x219e89);UserVoiceQueueRtEvents['on'](_0x3f644f,_0x1f6c78);}}; \ No newline at end of file +var _0xba18=['./userVoiceQueueRt.events','save','remove','update','emit','removeListener','register'];(function(_0x67e45e,_0x23f132){var _0x5dff4a=function(_0x37bbe4){while(--_0x37bbe4){_0x67e45e['push'](_0x67e45e['shift']());}};_0x5dff4a(++_0x23f132);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var UserVoiceQueueRtEvents=require(_0x8ba1('0x0'));var events=[_0x8ba1('0x1'),_0x8ba1('0x2'),_0x8ba1('0x3')];function createListener(_0x4070cc,_0x46f8c7){return function(_0x25144d){_0x46f8c7[_0x8ba1('0x4')](_0x4070cc,_0x25144d);};}function removeListener(_0x59c54c,_0xe3bc16){return function(){UserVoiceQueueRtEvents[_0x8ba1('0x5')](_0x59c54c,_0xe3bc16);};}exports[_0x8ba1('0x6')]=function(_0x2a9dab){for(var _0x3b107c=0x0,_0x2ffa15=events['length'];_0x3b107c<_0x2ffa15;_0x3b107c++){var _0x3a87eb=events[_0x3b107c];var _0x3d1fe7=createListener('userVoiceQueueRt:'+_0x3a87eb,_0x2a9dab);UserVoiceQueueRtEvents['on'](_0x3a87eb,_0x3d1fe7);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 6a8bd4b..8f22405 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x13ed4f,_0x59898b){var _0x2e7107=function(_0x552c8d){while(--_0x552c8d){_0x13ed4f['push'](_0x13ed4f['shift']());}};_0x2e7107(++_0x59898b);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x59088a,_0x5262f2){var _0x1d3985=function(_0x4c1366){while(--_0x4c1366){_0x59088a['push'](_0x59088a['shift']());}};_0x1d3985(++_0x5262f2);}(_0xe706,0xa3));var _0x6e70=function(_0x332a78,_0x4d38b3){_0x332a78=_0x332a78-0x0;var _0x537ac5=_0xe706[_0x332a78];return _0x537ac5;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 424c3e7..16a3960 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 _0xcbbf=['exports','sequelize'];(function(_0x15389f,_0x4dfdc0){var _0x2011ac=function(_0x6a00df){while(--_0x6a00df){_0x15389f['push'](_0x15389f['shift']());}};_0x2011ac(++_0x4dfdc0);}(_0xcbbf,0xdd));var _0xfcbb=function(_0x4371d1,_0x3238fd){_0x4371d1=_0x4371d1-0x0;var _0x57c13f=_0xcbbf[_0x4371d1];return _0x57c13f;};'use strict';var Sequelize=require(_0xfcbb('0x0'));module[_0xfcbb('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa0a1=['INTEGER','sequelize'];(function(_0x303ab8,_0x59e0f7){var _0x25ff0d=function(_0x314264){while(--_0x314264){_0x303ab8['push'](_0x303ab8['shift']());}};_0x25ff0d(++_0x59e0f7);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x1379eb,_0x109dca){_0x1379eb=_0x1379eb-0x0;var _0x156332=_0xa0a1[_0x1379eb];return _0x156332;};'use strict';var Sequelize=require(_0x1a0a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1a0a('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 55266ab..7c9a1cb 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 _0xc6ec=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash'];(function(_0x1feac8,_0x5a211f){var _0x498465=function(_0x12a6c0){while(--_0x12a6c0){_0x1feac8['push'](_0x1feac8['shift']());}};_0x498465(++_0x5a211f);}(_0xc6ec,0x151));var _0xcc6e=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0xc6ec[_0x1bc0ae];return _0x501104;};'use strict';var _=require(_0xcc6e('0x0'));var util=require(_0xcc6e('0x1'));var logger=require(_0xcc6e('0x2'))(_0xcc6e('0x3'));var moment=require(_0xcc6e('0x4'));var BPromise=require(_0xcc6e('0x5'));var rp=require(_0xcc6e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcc6e('0x7'));var config=require('../../config/environment');var attributes=require(_0xcc6e('0x8'));module[_0xcc6e('0x9')]=function(_0x51c5fe,_0x4f290c){return _0x51c5fe[_0xcc6e('0xa')](_0xcc6e('0xb'),attributes,{'tableName':_0xcc6e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x48ed=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','user_has_whatsapp_queues','lodash'];(function(_0x2338e3,_0x523f4e){var _0x3f19a9=function(_0x48bb39){while(--_0x48bb39){_0x2338e3['push'](_0x2338e3['shift']());}};_0x3f19a9(++_0x523f4e);}(_0x48ed,0x19f));var _0xd48e=function(_0x23e5d2,_0x415e7a){_0x23e5d2=_0x23e5d2-0x0;var _0x51ee49=_0x48ed[_0x23e5d2];return _0x51ee49;};'use strict';var _=require(_0xd48e('0x0'));var util=require(_0xd48e('0x1'));var logger=require(_0xd48e('0x2'))(_0xd48e('0x3'));var moment=require('moment');var BPromise=require(_0xd48e('0x4'));var rp=require(_0xd48e('0x5'));var fs=require('fs');var path=require(_0xd48e('0x6'));var rimraf=require(_0xd48e('0x7'));var config=require(_0xd48e('0x8'));var attributes=require(_0xd48e('0x9'));module[_0xd48e('0xa')]=function(_0x298f75,_0x862029){return _0x298f75[_0xd48e('0xb')]('UserWhatsappQueue',attributes,{'tableName':_0xd48e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 4221c0d..75aa833 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 _0x6c2d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','UserWhatsappQueue,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring'];(function(_0x27d555,_0x475983){var _0xa1fe87=function(_0x2f0f41){while(--_0x2f0f41){_0x27d555['push'](_0x27d555['shift']());}};_0xa1fe87(++_0x475983);}(_0x6c2d,0xba));var _0xd6c2=function(_0x4d0662,_0x145963){_0x4d0662=_0x4d0662-0x0;var _0x6eea6d=_0x6c2d[_0x4d0662];return _0x6eea6d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd6c2('0x0'));var BPromise=require(_0xd6c2('0x1'));var rs=require(_0xd6c2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6c2('0x3'))['db'];var utils=require(_0xd6c2('0x4'));var logger=require(_0xd6c2('0x5'))(_0xd6c2('0x6'));var config=require(_0xd6c2('0x7'));var jayson=require(_0xd6c2('0x8'));var client=jayson[_0xd6c2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b95b1,_0x37b20f,_0x34f640){return new BPromise(function(_0xcc59be,_0x358f4f){return client[_0xd6c2('0xa')](_0x3b95b1,_0x34f640)[_0xd6c2('0xb')](function(_0x5d84ee){logger[_0xd6c2('0xc')]('UserWhatsappQueue,\x20%s,\x20%s',_0x37b20f,'request\x20sent');logger['debug'](_0xd6c2('0xd'),_0x37b20f,_0xd6c2('0xe'),JSON['stringify'](_0x5d84ee));if(_0x5d84ee[_0xd6c2('0xf')]){if(_0x5d84ee['error'][_0xd6c2('0x10')]===0x1f4){logger[_0xd6c2('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x37b20f,_0x5d84ee[_0xd6c2('0xf')]['message']);return _0x358f4f(_0x5d84ee[_0xd6c2('0xf')][_0xd6c2('0x11')]);}logger[_0xd6c2('0xf')](_0xd6c2('0x12'),_0x37b20f,_0x5d84ee[_0xd6c2('0xf')][_0xd6c2('0x11')]);return _0xcc59be(_0x5d84ee[_0xd6c2('0xf')][_0xd6c2('0x11')]);}else{logger[_0xd6c2('0xc')](_0xd6c2('0x12'),_0x37b20f,_0xd6c2('0xe'));_0xcc59be(_0x5d84ee[_0xd6c2('0x13')][_0xd6c2('0x11')]);}})[_0xd6c2('0x14')](function(_0x5b623b){logger['error'](_0xd6c2('0x12'),_0x37b20f,_0x5b623b);_0x358f4f(_0x5b623b);});});} \ No newline at end of file +var _0x4676=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4c1f0b,_0x50fa2b){var _0x5e2432=function(_0x12d38){while(--_0x12d38){_0x4c1f0b['push'](_0x4c1f0b['shift']());}};_0x5e2432(++_0x50fa2b);}(_0x4676,0x15b));var _0x6467=function(_0x460b54,_0x4a2719){_0x460b54=_0x460b54-0x0;var _0x22034b=_0x4676[_0x460b54];return _0x22034b;};'use strict';var _=require(_0x6467('0x0'));var util=require(_0x6467('0x1'));var moment=require(_0x6467('0x2'));var BPromise=require(_0x6467('0x3'));var rs=require(_0x6467('0x4'));var fs=require('fs');var Redis=require(_0x6467('0x5'));var db=require(_0x6467('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6467('0x7'))(_0x6467('0x8'));var config=require(_0x6467('0x9'));var jayson=require(_0x6467('0xa'));var client=jayson['client'][_0x6467('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbd194,_0x464162,_0x4368a1){return new BPromise(function(_0x49630f,_0x3b7ae9){return client[_0x6467('0xc')](_0xbd194,_0x4368a1)[_0x6467('0xd')](function(_0x2e6af1){logger['info'](_0x6467('0xe'),_0x464162,_0x6467('0xf'));logger[_0x6467('0x10')](_0x6467('0x11'),_0x464162,_0x6467('0xf'),JSON[_0x6467('0x12')](_0x2e6af1));if(_0x2e6af1[_0x6467('0x13')]){if(_0x2e6af1[_0x6467('0x13')]['code']===0x1f4){logger[_0x6467('0x13')](_0x6467('0xe'),_0x464162,_0x2e6af1['error'][_0x6467('0x14')]);return _0x3b7ae9(_0x2e6af1[_0x6467('0x13')][_0x6467('0x14')]);}logger[_0x6467('0x13')](_0x6467('0xe'),_0x464162,_0x2e6af1['error'][_0x6467('0x14')]);return _0x49630f(_0x2e6af1[_0x6467('0x13')][_0x6467('0x14')]);}else{logger['info'](_0x6467('0xe'),_0x464162,_0x6467('0xf'));_0x49630f(_0x2e6af1[_0x6467('0x15')][_0x6467('0x14')]);}})[_0x6467('0x16')](function(_0x50f6e5){logger[_0x6467('0x13')](_0x6467('0xe'),_0x464162,_0x50f6e5);_0x3b7ae9(_0x50f6e5);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 79ce044..b86f41e 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 _0xc17f=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x2d319b,_0x11c797){var _0xc850a1=function(_0x5a6e7c){while(--_0x5a6e7c){_0x2d319b['push'](_0x2d319b['shift']());}};_0xc850a1(++_0x11c797);}(_0xc17f,0xb8));var _0xfc17=function(_0x466ed8,_0x40a3eb){_0x466ed8=_0x466ed8-0x0;var _0x4fa2d4=_0xc17f[_0x466ed8];return _0x4fa2d4;};'use strict';var multer=require(_0xfc17('0x0'));var util=require(_0xfc17('0x1'));var path=require(_0xfc17('0x2'));var timeout=require(_0xfc17('0x3'));var express=require(_0xfc17('0x4'));var router=express[_0xfc17('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfc17('0x6'));var interaction=require(_0xfc17('0x7'));var config=require(_0xfc17('0x8'));var controller=require(_0xfc17('0x9'));router['get']('/',auth[_0xfc17('0xa')](),controller[_0xfc17('0xb')]);router[_0xfc17('0xc')](_0xfc17('0xd'),auth[_0xfc17('0xa')](),controller[_0xfc17('0xe')]);router[_0xfc17('0xf')]('/',auth[_0xfc17('0xa')](),controller['create']);router[_0xfc17('0x10')](_0xfc17('0xd'),auth[_0xfc17('0xa')](),controller[_0xfc17('0x11')]);router['delete']('/:id',auth[_0xfc17('0xa')](),controller[_0xfc17('0x12')]);module[_0xfc17('0x13')]=router; \ No newline at end of file +var _0x4f99=['update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./variable.controller','get','isAuthenticated','index','post','create','/:id'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x4f99,0x157));var _0x94f9=function(_0x224436,_0x13088b){_0x224436=_0x224436-0x0;var _0x3c694a=_0x4f99[_0x224436];return _0x3c694a;};'use strict';var multer=require(_0x94f9('0x0'));var util=require(_0x94f9('0x1'));var path=require('path');var timeout=require(_0x94f9('0x2'));var express=require(_0x94f9('0x3'));var router=express[_0x94f9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x94f9('0x5'));var interaction=require(_0x94f9('0x6'));var config=require('../../config/environment');var controller=require(_0x94f9('0x7'));router[_0x94f9('0x8')]('/',auth[_0x94f9('0x9')](),controller[_0x94f9('0xa')]);router[_0x94f9('0x8')]('/:id',auth[_0x94f9('0x9')](),controller['show']);router[_0x94f9('0xb')]('/',auth['isAuthenticated'](),controller[_0x94f9('0xc')]);router['put'](_0x94f9('0xd'),auth[_0x94f9('0x9')](),controller[_0x94f9('0xe')]);router[_0x94f9('0xf')](_0x94f9('0xd'),auth[_0x94f9('0x9')](),controller[_0x94f9('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index c37ff8e..6c36ade 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 _0x8838=['exports','STRING','name','sequelize'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x8838,0xeb));var _0x8883=function(_0x3fb97b,_0x27964c){_0x3fb97b=_0x3fb97b-0x0;var _0x51ddbd=_0x8838[_0x3fb97b];return _0x51ddbd;};'use strict';var Sequelize=require(_0x8883('0x0'));module[_0x8883('0x1')]={'name':{'type':Sequelize[_0x8883('0x2')],'unique':_0x8883('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8883('0x2')]}}; \ No newline at end of file +var _0x1d8d=['name','sequelize','STRING'];(function(_0x1347f8,_0x233feb){var _0x218368=function(_0x3f4ca3){while(--_0x3f4ca3){_0x1347f8['push'](_0x1347f8['shift']());}};_0x218368(++_0x233feb);}(_0x1d8d,0x1e7));var _0xd1d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d8d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd1d8('0x0'));module['exports']={'name':{'type':Sequelize[_0xd1d8('0x1')],'unique':_0xd1d8('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd1d8('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 69b8a4a..01c225f 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 _0xa8ef=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','end','status','offset','undefined','count','limit','json','apply','reject','save','then','get','Variables','UserProfileResource','destroy','sendStatus','send','index','map','Variable','rawAttributes','type','name','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','update','body','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'];(function(_0x1d57f2,_0x11cd04){var _0x25b058=function(_0x10ab91){while(--_0x10ab91){_0x1d57f2['push'](_0x1d57f2['shift']());}};_0x25b058(++_0x11cd04);}(_0xa8ef,0x183));var _0xfa8e=function(_0x4aee91,_0x1c7b11){_0x4aee91=_0x4aee91-0x0;var _0x1fbc74=_0xa8ef[_0x4aee91];return _0x1fbc74;};'use strict';var emlformat=require(_0xfa8e('0x0'));var rimraf=require(_0xfa8e('0x1'));var zipdir=require(_0xfa8e('0x2'));var jsonpatch=require(_0xfa8e('0x3'));var rp=require(_0xfa8e('0x4'));var moment=require(_0xfa8e('0x5'));var BPromise=require(_0xfa8e('0x6'));var Mustache=require('mustache');var util=require(_0xfa8e('0x7'));var path=require(_0xfa8e('0x8'));var sox=require(_0xfa8e('0x9'));var csv=require(_0xfa8e('0xa'));var ejs=require(_0xfa8e('0xb'));var fs=require('fs');var fs_extra=require(_0xfa8e('0xc'));var _=require(_0xfa8e('0xd'));var squel=require(_0xfa8e('0xe'));var crypto=require(_0xfa8e('0xf'));var jsforce=require(_0xfa8e('0x10'));var deskjs=require(_0xfa8e('0x11'));var toCsv=require(_0xfa8e('0xa'));var querystring=require('querystring');var Papa=require(_0xfa8e('0x12'));var Redis=require('ioredis');var authService=require(_0xfa8e('0x13'));var qs=require(_0xfa8e('0x14'));var as=require(_0xfa8e('0x15'));var hardwareService=require(_0xfa8e('0x16'));var logger=require(_0xfa8e('0x17'))(_0xfa8e('0x18'));var utils=require(_0xfa8e('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13d0e9,_0x2cf622){_0x2cf622=_0x2cf622||0xcc;return function(_0x4db7b7){if(_0x4db7b7){return _0x13d0e9['sendStatus'](_0x2cf622);}return _0x13d0e9['status'](_0x2cf622)[_0xfa8e('0x1a')]();};}function respondWithResult(_0x3cfeb9,_0x3ac889){_0x3ac889=_0x3ac889||0xc8;return function(_0x5c3c91){if(_0x5c3c91){return _0x3cfeb9[_0xfa8e('0x1b')](_0x3ac889)['json'](_0x5c3c91);}};}function respondWithFilteredResult(_0x446e73,_0x230a6e){return function(_0x27e114){if(_0x27e114){var _0x5725ef=typeof _0x230a6e[_0xfa8e('0x1c')]===_0xfa8e('0x1d')&&typeof _0x230a6e['limit']===_0xfa8e('0x1d');var _0x4c542c=_0x27e114[_0xfa8e('0x1e')];var _0x24e642=_0x5725ef?0x0:_0x230a6e[_0xfa8e('0x1c')];var _0x178661=_0x5725ef?_0x27e114[_0xfa8e('0x1e')]:_0x230a6e[_0xfa8e('0x1c')]+_0x230a6e[_0xfa8e('0x1f')];var _0x9881d8;if(_0x178661>=_0x4c542c){_0x178661=_0x4c542c;_0x9881d8=0xc8;}else{_0x9881d8=0xce;}_0x446e73[_0xfa8e('0x1b')](_0x9881d8);return _0x446e73['set']('Content-Range',_0x24e642+'-'+_0x178661+'/'+_0x4c542c)[_0xfa8e('0x20')](_0x27e114);}return null;};}function patchUpdates(_0x529076){return function(_0x38cdd5){try{jsonpatch[_0xfa8e('0x21')](_0x38cdd5,_0x529076,!![]);}catch(_0xac5bee){return BPromise[_0xfa8e('0x22')](_0xac5bee);}return _0x38cdd5[_0xfa8e('0x23')]();};}function saveUpdates(_0x3e0435,_0x4255f2){return function(_0x8bd412){if(_0x8bd412){return _0x8bd412['update'](_0x3e0435)[_0xfa8e('0x24')](function(_0x1db51b){return _0x1db51b;});}return null;};}function removeEntity(_0x692b90,_0x451c8e){return function(_0x527a7e){if(_0x527a7e){return _0x527a7e['destroy']()['then'](function(){var _0x57bd25=_0x527a7e[_0xfa8e('0x25')]({'plain':!![]});var _0x439268=_0xfa8e('0x26');return db[_0xfa8e('0x27')][_0xfa8e('0x28')]({'where':{'type':_0x439268,'resourceId':_0x57bd25['id']}})[_0xfa8e('0x24')](function(){return _0x527a7e;});})[_0xfa8e('0x24')](function(){_0x692b90[_0xfa8e('0x1b')](0xcc)[_0xfa8e('0x1a')]();});}};}function handleEntityNotFound(_0x11f239,_0x38e2e2){return function(_0x247c9c){if(!_0x247c9c){_0x11f239[_0xfa8e('0x29')](0x194);}return _0x247c9c;};}function handleError(_0x40bb0a,_0x1eba00){_0x1eba00=_0x1eba00||0x1f4;return function(_0x2402ad){logger['error'](_0x2402ad['stack']);if(_0x2402ad['name']){delete _0x2402ad['name'];}_0x40bb0a[_0xfa8e('0x1b')](_0x1eba00)[_0xfa8e('0x2a')](_0x2402ad);};}exports[_0xfa8e('0x2b')]=function(_0x2e7d9a,_0x8df51){var _0x24e49e={},_0x341f0b={},_0x53d0ab={'count':0x0,'rows':[]};var _0xe62334=_[_0xfa8e('0x2c')](db[_0xfa8e('0x2d')][_0xfa8e('0x2e')],function(_0x3e7769){return{'name':_0x3e7769['fieldName'],'type':_0x3e7769[_0xfa8e('0x2f')]['key']};});_0x341f0b['model']=_[_0xfa8e('0x2c')](_0xe62334,_0xfa8e('0x30'));_0x341f0b[_0xfa8e('0x31')]=_['keys'](_0x2e7d9a[_0xfa8e('0x31')]);_0x341f0b[_0xfa8e('0x32')]=_[_0xfa8e('0x33')](_0x341f0b[_0xfa8e('0x34')],_0x341f0b[_0xfa8e('0x31')]);_0x24e49e[_0xfa8e('0x35')]=_[_0xfa8e('0x33')](_0x341f0b[_0xfa8e('0x34')],qs[_0xfa8e('0x36')](_0x2e7d9a[_0xfa8e('0x31')][_0xfa8e('0x36')]));_0x24e49e['attributes']=_0x24e49e[_0xfa8e('0x35')]['length']?_0x24e49e[_0xfa8e('0x35')]:_0x341f0b['model'];if(!_0x2e7d9a[_0xfa8e('0x31')][_0xfa8e('0x37')](_0xfa8e('0x38'))){_0x24e49e[_0xfa8e('0x1f')]=qs[_0xfa8e('0x1f')](_0x2e7d9a[_0xfa8e('0x31')][_0xfa8e('0x1f')]);_0x24e49e[_0xfa8e('0x1c')]=qs['offset'](_0x2e7d9a['query'][_0xfa8e('0x1c')]);}_0x24e49e['order']=qs[_0xfa8e('0x39')](_0x2e7d9a[_0xfa8e('0x31')][_0xfa8e('0x39')]);_0x24e49e[_0xfa8e('0x3a')]=qs[_0xfa8e('0x32')](_[_0xfa8e('0x3b')](_0x2e7d9a[_0xfa8e('0x31')],_0x341f0b[_0xfa8e('0x32')]),_0xe62334);if(_0x2e7d9a[_0xfa8e('0x31')][_0xfa8e('0x3c')]){_0x24e49e[_0xfa8e('0x3a')]=_[_0xfa8e('0x3d')](_0x24e49e[_0xfa8e('0x3a')],{'$or':_[_0xfa8e('0x2c')](_0xe62334,function(_0x39f089){if(_0x39f089[_0xfa8e('0x2f')]!=='VIRTUAL'){var _0x5e9cea={};_0x5e9cea[_0x39f089[_0xfa8e('0x30')]]={'$like':'%'+_0x2e7d9a['query']['filter']+'%'};return _0x5e9cea;}})});}_0x24e49e=_['merge']({},_0x24e49e,_0x2e7d9a[_0xfa8e('0x3e')]);var _0x495d1f={'where':_0x24e49e[_0xfa8e('0x3a')]};return db[_0xfa8e('0x2d')]['count'](_0x495d1f)[_0xfa8e('0x24')](function(_0x4f0ea1){_0x53d0ab[_0xfa8e('0x1e')]=_0x4f0ea1;if(_0x2e7d9a[_0xfa8e('0x31')][_0xfa8e('0x3f')]){_0x24e49e[_0xfa8e('0x40')]=[{'all':!![]}];}return db[_0xfa8e('0x2d')][_0xfa8e('0x41')](_0x24e49e);})[_0xfa8e('0x24')](function(_0x536f9d){_0x53d0ab[_0xfa8e('0x42')]=_0x536f9d;return _0x53d0ab;})[_0xfa8e('0x24')](respondWithFilteredResult(_0x8df51,_0x24e49e))[_0xfa8e('0x43')](handleError(_0x8df51,null));};exports['show']=function(_0x4062a6,_0x5d2f9d){var _0xf187e1={'raw':!![],'where':{'id':_0x4062a6[_0xfa8e('0x44')]['id']}},_0x576d3b={};_0x576d3b[_0xfa8e('0x34')]=_[_0xfa8e('0x45')](db['Variable'][_0xfa8e('0x2e')]);_0x576d3b[_0xfa8e('0x31')]=_['keys'](_0x4062a6[_0xfa8e('0x31')]);_0x576d3b[_0xfa8e('0x32')]=_[_0xfa8e('0x33')](_0x576d3b['model'],_0x576d3b['query']);_0xf187e1['attributes']=_[_0xfa8e('0x33')](_0x576d3b[_0xfa8e('0x34')],qs[_0xfa8e('0x36')](_0x4062a6[_0xfa8e('0x31')]['fields']));_0xf187e1[_0xfa8e('0x35')]=_0xf187e1[_0xfa8e('0x35')][_0xfa8e('0x46')]?_0xf187e1[_0xfa8e('0x35')]:_0x576d3b[_0xfa8e('0x34')];if(_0x4062a6[_0xfa8e('0x31')][_0xfa8e('0x3f')]){_0xf187e1[_0xfa8e('0x40')]=[{'all':!![]}];}_0xf187e1=_[_0xfa8e('0x3d')]({},_0xf187e1,_0x4062a6[_0xfa8e('0x3e')]);return db[_0xfa8e('0x2d')][_0xfa8e('0x47')](_0xf187e1)[_0xfa8e('0x24')](handleEntityNotFound(_0x5d2f9d,null))[_0xfa8e('0x24')](respondWithResult(_0x5d2f9d,null))[_0xfa8e('0x43')](handleError(_0x5d2f9d,null));};exports['create']=function(_0x2ce942,_0x1ced51){return db['Variable'][_0xfa8e('0x48')](_0x2ce942['body'],{})[_0xfa8e('0x24')](function(_0x32246d){var _0x3f23be=_0x2ce942[_0xfa8e('0x49')][_0xfa8e('0x25')]({'plain':!![]});if(!_0x3f23be)throw new Error(_0xfa8e('0x4a'));if(_0x3f23be[_0xfa8e('0x4b')]===_0xfa8e('0x49')){var _0x32a183=_0x32246d['get']({'plain':!![]});var _0x590bf5=_0xfa8e('0x26');return db[_0xfa8e('0x4c')]['find']({'where':{'name':_0x590bf5,'userProfileId':_0x3f23be[_0xfa8e('0x4d')]},'raw':!![]})[_0xfa8e('0x24')](function(_0x7a6403){if(_0x7a6403&&_0x7a6403['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x32a183[_0xfa8e('0x30')],'resourceId':_0x32a183['id'],'type':_0x7a6403[_0xfa8e('0x30')],'sectionId':_0x7a6403['id']},{})[_0xfa8e('0x24')](function(){return _0x32246d;});}else{return _0x32246d;}})[_0xfa8e('0x43')](function(_0x2057a3){logger[_0xfa8e('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2057a3);throw _0x2057a3;});}return _0x32246d;})[_0xfa8e('0x24')](respondWithResult(_0x1ced51,0xc9))[_0xfa8e('0x43')](handleError(_0x1ced51,null));};exports[_0xfa8e('0x4f')]=function(_0x25969a,_0x486597){if(_0x25969a[_0xfa8e('0x50')]['id']){delete _0x25969a[_0xfa8e('0x50')]['id'];}return db[_0xfa8e('0x2d')]['find']({'where':{'id':_0x25969a[_0xfa8e('0x44')]['id']}})[_0xfa8e('0x24')](handleEntityNotFound(_0x486597,null))[_0xfa8e('0x24')](saveUpdates(_0x25969a[_0xfa8e('0x50')],null))[_0xfa8e('0x24')](respondWithResult(_0x486597,null))[_0xfa8e('0x43')](handleError(_0x486597,null));};exports[_0xfa8e('0x28')]=function(_0x243166,_0x4a759a){return db[_0xfa8e('0x2d')]['find']({'where':{'id':_0x243166[_0xfa8e('0x44')]['id']}})[_0xfa8e('0x24')](handleEntityNotFound(_0x4a759a,null))[_0xfa8e('0x24')](removeEntity(_0x4a759a,null))['catch'](handleError(_0x4a759a,null));}; \ No newline at end of file +var _0xa670=['get','Variables','UserProfileResource','stack','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','name','options','Variable','includeAll','include','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','destroy','then'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xa670,0x11c));var _0x0a67=function(_0x4ad197,_0x1de072){_0x4ad197=_0x4ad197-0x0;var _0xd24a4f=_0xa670[_0x4ad197];return _0xd24a4f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0a67('0x0'));var jsonpatch=require(_0x0a67('0x1'));var rp=require(_0x0a67('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0a67('0x3'));var util=require(_0x0a67('0x4'));var path=require(_0x0a67('0x5'));var sox=require(_0x0a67('0x6'));var csv=require(_0x0a67('0x7'));var ejs=require(_0x0a67('0x8'));var fs=require('fs');var fs_extra=require(_0x0a67('0x9'));var _=require('lodash');var squel=require(_0x0a67('0xa'));var crypto=require(_0x0a67('0xb'));var jsforce=require(_0x0a67('0xc'));var deskjs=require(_0x0a67('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0a67('0xe'));var Papa=require(_0x0a67('0xf'));var Redis=require('ioredis');var authService=require(_0x0a67('0x10'));var qs=require(_0x0a67('0x11'));var as=require(_0x0a67('0x12'));var hardwareService=require(_0x0a67('0x13'));var logger=require('../../config/logger')(_0x0a67('0x14'));var utils=require('../../config/utils');var config=require(_0x0a67('0x15'));var licenseUtil=require(_0x0a67('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bc694,_0x164907){_0x164907=_0x164907||0xcc;return function(_0x154832){if(_0x154832){return _0x2bc694[_0x0a67('0x17')](_0x164907);}return _0x2bc694[_0x0a67('0x18')](_0x164907)[_0x0a67('0x19')]();};}function respondWithResult(_0x7af112,_0x46efb0){_0x46efb0=_0x46efb0||0xc8;return function(_0x2dff7e){if(_0x2dff7e){return _0x7af112[_0x0a67('0x18')](_0x46efb0)[_0x0a67('0x1a')](_0x2dff7e);}};}function respondWithFilteredResult(_0x563a04,_0x5658fd){return function(_0x528f9b){if(_0x528f9b){var _0x4f54ab=typeof _0x5658fd[_0x0a67('0x1b')]===_0x0a67('0x1c')&&typeof _0x5658fd['limit']===_0x0a67('0x1c');var _0x1b5114=_0x528f9b[_0x0a67('0x1d')];var _0x27baf5=_0x4f54ab?0x0:_0x5658fd['offset'];var _0x15dd92=_0x4f54ab?_0x528f9b['count']:_0x5658fd[_0x0a67('0x1b')]+_0x5658fd[_0x0a67('0x1e')];var _0x5462df;if(_0x15dd92>=_0x1b5114){_0x15dd92=_0x1b5114;_0x5462df=0xc8;}else{_0x5462df=0xce;}_0x563a04['status'](_0x5462df);return _0x563a04['set'](_0x0a67('0x1f'),_0x27baf5+'-'+_0x15dd92+'/'+_0x1b5114)[_0x0a67('0x1a')](_0x528f9b);}return null;};}function patchUpdates(_0x4ecd02){return function(_0x239295){try{jsonpatch[_0x0a67('0x20')](_0x239295,_0x4ecd02,!![]);}catch(_0x4c256){return BPromise[_0x0a67('0x21')](_0x4c256);}return _0x239295['save']();};}function saveUpdates(_0x3b632e,_0x176e29){return function(_0x5114ca){if(_0x5114ca){return _0x5114ca['update'](_0x3b632e)['then'](function(_0x22ffac){return _0x22ffac;});}return null;};}function removeEntity(_0x69c295,_0x567129){return function(_0x2eb94c){if(_0x2eb94c){return _0x2eb94c[_0x0a67('0x22')]()[_0x0a67('0x23')](function(){var _0x39a907=_0x2eb94c[_0x0a67('0x24')]({'plain':!![]});var _0x1c757=_0x0a67('0x25');return db[_0x0a67('0x26')][_0x0a67('0x22')]({'where':{'type':_0x1c757,'resourceId':_0x39a907['id']}})[_0x0a67('0x23')](function(){return _0x2eb94c;});})[_0x0a67('0x23')](function(){_0x69c295[_0x0a67('0x18')](0xcc)[_0x0a67('0x19')]();});}};}function handleEntityNotFound(_0x1c1aa6,_0x35fc12){return function(_0x26c69b){if(!_0x26c69b){_0x1c1aa6['sendStatus'](0x194);}return _0x26c69b;};}function handleError(_0x4f21ee,_0x350d1c){_0x350d1c=_0x350d1c||0x1f4;return function(_0x55b4bf){logger['error'](_0x55b4bf[_0x0a67('0x27')]);if(_0x55b4bf['name']){delete _0x55b4bf['name'];}_0x4f21ee[_0x0a67('0x18')](_0x350d1c)['send'](_0x55b4bf);};}exports[_0x0a67('0x28')]=function(_0x366e1f,_0x138f43){var _0x1d33e9={},_0x3ee32e={},_0x5f296c={'count':0x0,'rows':[]};var _0x268a68=_[_0x0a67('0x29')](db['Variable'][_0x0a67('0x2a')],function(_0x270d37){return{'name':_0x270d37[_0x0a67('0x2b')],'type':_0x270d37['type'][_0x0a67('0x2c')]};});_0x3ee32e[_0x0a67('0x2d')]=_[_0x0a67('0x29')](_0x268a68,'name');_0x3ee32e[_0x0a67('0x2e')]=_['keys'](_0x366e1f[_0x0a67('0x2e')]);_0x3ee32e[_0x0a67('0x2f')]=_[_0x0a67('0x30')](_0x3ee32e['model'],_0x3ee32e['query']);_0x1d33e9[_0x0a67('0x31')]=_[_0x0a67('0x30')](_0x3ee32e[_0x0a67('0x2d')],qs[_0x0a67('0x32')](_0x366e1f[_0x0a67('0x2e')][_0x0a67('0x32')]));_0x1d33e9[_0x0a67('0x31')]=_0x1d33e9['attributes']['length']?_0x1d33e9[_0x0a67('0x31')]:_0x3ee32e['model'];if(!_0x366e1f[_0x0a67('0x2e')][_0x0a67('0x33')](_0x0a67('0x34'))){_0x1d33e9['limit']=qs['limit'](_0x366e1f[_0x0a67('0x2e')][_0x0a67('0x1e')]);_0x1d33e9[_0x0a67('0x1b')]=qs['offset'](_0x366e1f[_0x0a67('0x2e')]['offset']);}_0x1d33e9['order']=qs[_0x0a67('0x35')](_0x366e1f[_0x0a67('0x2e')][_0x0a67('0x35')]);_0x1d33e9['where']=qs[_0x0a67('0x2f')](_[_0x0a67('0x36')](_0x366e1f['query'],_0x3ee32e[_0x0a67('0x2f')]),_0x268a68);if(_0x366e1f[_0x0a67('0x2e')][_0x0a67('0x37')]){_0x1d33e9[_0x0a67('0x38')]=_[_0x0a67('0x39')](_0x1d33e9['where'],{'$or':_['map'](_0x268a68,function(_0x1cadf0){if(_0x1cadf0['type']!==_0x0a67('0x3a')){var _0x2a5b1c={};_0x2a5b1c[_0x1cadf0[_0x0a67('0x3b')]]={'$like':'%'+_0x366e1f['query'][_0x0a67('0x37')]+'%'};return _0x2a5b1c;}})});}_0x1d33e9=_[_0x0a67('0x39')]({},_0x1d33e9,_0x366e1f[_0x0a67('0x3c')]);var _0x6480bf={'where':_0x1d33e9[_0x0a67('0x38')]};return db[_0x0a67('0x3d')][_0x0a67('0x1d')](_0x6480bf)[_0x0a67('0x23')](function(_0x49145b){_0x5f296c[_0x0a67('0x1d')]=_0x49145b;if(_0x366e1f[_0x0a67('0x2e')][_0x0a67('0x3e')]){_0x1d33e9[_0x0a67('0x3f')]=[{'all':!![]}];}return db[_0x0a67('0x3d')]['findAll'](_0x1d33e9);})[_0x0a67('0x23')](function(_0xa41250){_0x5f296c[_0x0a67('0x40')]=_0xa41250;return _0x5f296c;})[_0x0a67('0x23')](respondWithFilteredResult(_0x138f43,_0x1d33e9))[_0x0a67('0x41')](handleError(_0x138f43,null));};exports[_0x0a67('0x42')]=function(_0x924b6c,_0x5bbf7a){var _0x4794e4={'raw':!![],'where':{'id':_0x924b6c[_0x0a67('0x43')]['id']}},_0x1abd8e={};_0x1abd8e[_0x0a67('0x2d')]=_[_0x0a67('0x44')](db[_0x0a67('0x3d')][_0x0a67('0x2a')]);_0x1abd8e['query']=_[_0x0a67('0x44')](_0x924b6c['query']);_0x1abd8e[_0x0a67('0x2f')]=_[_0x0a67('0x30')](_0x1abd8e[_0x0a67('0x2d')],_0x1abd8e[_0x0a67('0x2e')]);_0x4794e4[_0x0a67('0x31')]=_['intersection'](_0x1abd8e[_0x0a67('0x2d')],qs[_0x0a67('0x32')](_0x924b6c[_0x0a67('0x2e')][_0x0a67('0x32')]));_0x4794e4[_0x0a67('0x31')]=_0x4794e4[_0x0a67('0x31')]['length']?_0x4794e4[_0x0a67('0x31')]:_0x1abd8e['model'];if(_0x924b6c[_0x0a67('0x2e')]['includeAll']){_0x4794e4[_0x0a67('0x3f')]=[{'all':!![]}];}_0x4794e4=_['merge']({},_0x4794e4,_0x924b6c[_0x0a67('0x3c')]);return db[_0x0a67('0x3d')][_0x0a67('0x45')](_0x4794e4)['then'](handleEntityNotFound(_0x5bbf7a,null))['then'](respondWithResult(_0x5bbf7a,null))[_0x0a67('0x41')](handleError(_0x5bbf7a,null));};exports[_0x0a67('0x46')]=function(_0x1798c0,_0x2ce854){return db[_0x0a67('0x3d')][_0x0a67('0x46')](_0x1798c0[_0x0a67('0x47')],{})['then'](function(_0x5eb837){var _0x5826f5=_0x1798c0[_0x0a67('0x48')]['get']({'plain':!![]});if(!_0x5826f5)throw new Error(_0x0a67('0x49'));if(_0x5826f5[_0x0a67('0x4a')]===_0x0a67('0x48')){var _0x42f016=_0x5eb837[_0x0a67('0x24')]({'plain':!![]});var _0x8dcfae=_0x0a67('0x25');return db[_0x0a67('0x4b')][_0x0a67('0x45')]({'where':{'name':_0x8dcfae,'userProfileId':_0x5826f5[_0x0a67('0x4c')]},'raw':!![]})['then'](function(_0x2ac9a2){if(_0x2ac9a2&&_0x2ac9a2[_0x0a67('0x4d')]===0x0){return db[_0x0a67('0x26')][_0x0a67('0x46')]({'name':_0x42f016[_0x0a67('0x3b')],'resourceId':_0x42f016['id'],'type':_0x2ac9a2[_0x0a67('0x3b')],'sectionId':_0x2ac9a2['id']},{})['then'](function(){return _0x5eb837;});}else{return _0x5eb837;}})[_0x0a67('0x41')](function(_0x4d279c){logger[_0x0a67('0x4e')](_0x0a67('0x4f'),_0x4d279c);throw _0x4d279c;});}return _0x5eb837;})[_0x0a67('0x23')](respondWithResult(_0x2ce854,0xc9))[_0x0a67('0x41')](handleError(_0x2ce854,null));};exports['update']=function(_0x5e5044,_0x1db3f5){if(_0x5e5044['body']['id']){delete _0x5e5044[_0x0a67('0x47')]['id'];}return db['Variable'][_0x0a67('0x45')]({'where':{'id':_0x5e5044[_0x0a67('0x43')]['id']}})[_0x0a67('0x23')](handleEntityNotFound(_0x1db3f5,null))[_0x0a67('0x23')](saveUpdates(_0x5e5044[_0x0a67('0x47')],null))[_0x0a67('0x23')](respondWithResult(_0x1db3f5,null))[_0x0a67('0x41')](handleError(_0x1db3f5,null));};exports[_0x0a67('0x22')]=function(_0x5c4731,_0x3c525a){return db[_0x0a67('0x3d')][_0x0a67('0x45')]({'where':{'id':_0x5c4731[_0x0a67('0x43')]['id']}})['then'](handleEntityNotFound(_0x3c525a,null))['then'](removeEntity(_0x3c525a,null))['catch'](handleError(_0x3c525a,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 9544d41..bfd276e 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 _0xbfff=['Variable','lodash','../../config/logger','api','bluebird','request-promise','path','./variable.attributes','define'];(function(_0x566039,_0x58b5b5){var _0x36e743=function(_0x3baa89){while(--_0x3baa89){_0x566039['push'](_0x566039['shift']());}};_0x36e743(++_0x58b5b5);}(_0xbfff,0xb5));var _0xfbff=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbfff[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfbff('0x0'));var util=require('util');var logger=require(_0xfbff('0x1'))(_0xfbff('0x2'));var moment=require('moment');var BPromise=require(_0xfbff('0x3'));var rp=require(_0xfbff('0x4'));var fs=require('fs');var path=require(_0xfbff('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfbff('0x6'));module['exports']=function(_0x5e9794,_0x2a4056){return _0x5e9794[_0xfbff('0x7')](_0xfbff('0x8'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb944=['../../config/logger','api','moment','bluebird','path','./variable.attributes','exports','define','Variable','tools_variables','util'];(function(_0x575356,_0x17ea0a){var _0x37ff6=function(_0x3eb907){while(--_0x3eb907){_0x575356['push'](_0x575356['shift']());}};_0x37ff6(++_0x17ea0a);}(_0xb944,0xf1));var _0x4b94=function(_0x3dff0d,_0x4d59ff){_0x3dff0d=_0x3dff0d-0x0;var _0x352383=_0xb944[_0x3dff0d];return _0x352383;};'use strict';var _=require('lodash');var util=require(_0x4b94('0x0'));var logger=require(_0x4b94('0x1'))(_0x4b94('0x2'));var moment=require(_0x4b94('0x3'));var BPromise=require(_0x4b94('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b94('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4b94('0x6'));module[_0x4b94('0x7')]=function(_0x37abfa,_0x4d11be){return _0x37abfa[_0x4b94('0x8')](_0x4b94('0x9'),attributes,{'tableName':_0x4b94('0xa'),'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 b4a5022..1a041c7 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 _0x7217=['where','attributes','map','include','model','ShowVariable','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Variable','find','options','raw'];(function(_0x892bb7,_0x5c8b52){var _0x542698=function(_0x22a8c8){while(--_0x22a8c8){_0x892bb7['push'](_0x892bb7['shift']());}};_0x542698(++_0x5c8b52);}(_0x7217,0x19e));var _0x7721=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x7217[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Variable,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Variable,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowVariable']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowVariable',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});}; \ No newline at end of file +var _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xa41a,0x6b));var _0xaa41=function(_0x32b363,_0x2a8e26){_0x32b363=_0x32b363-0x0;var _0x13e95d=_0xa41a[_0x32b363];return _0x13e95d;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index e11b4fa..41edc92 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 _0x0fa7=['migrations','exports','express','./version.controller','get','index','isAuthenticated','fetch','canUpdate','reset','pull','/restart','restart','/migrations'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0fa7,0x18a));var _0x70fa=function(_0xa72a90,_0x3d2ff5){_0xa72a90=_0xa72a90-0x0;var _0x264a45=_0x0fa7[_0xa72a90];return _0x264a45;};'use strict';var express=require(_0x70fa('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x70fa('0x1'));router[_0x70fa('0x2')]('/',controller[_0x70fa('0x3')]);router['get']('/fetch',auth[_0x70fa('0x4')](),auth['canUpdate'](),controller[_0x70fa('0x5')]);router[_0x70fa('0x2')]('/reset',auth[_0x70fa('0x4')](),auth[_0x70fa('0x6')](),controller[_0x70fa('0x7')]);router[_0x70fa('0x2')]('/pull',auth['isAuthenticated'](),auth[_0x70fa('0x6')](),controller[_0x70fa('0x8')]);router[_0x70fa('0x2')](_0x70fa('0x9'),auth[_0x70fa('0x4')](),controller[_0x70fa('0xa')]);router['get'](_0x70fa('0xb'),controller[_0x70fa('0xc')]);module[_0x70fa('0xd')]=router; \ No newline at end of file +var _0xb941=['reset','/pull','pull','/restart','restart','/migrations','migrations','exports','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch'];(function(_0x4b9dc9,_0x14b3a2){var _0x57b302=function(_0x4f99ff){while(--_0x4f99ff){_0x4b9dc9['push'](_0x4b9dc9['shift']());}};_0x57b302(++_0x14b3a2);}(_0xb941,0x15c));var _0x1b94=function(_0x402282,_0x615de3){_0x402282=_0x402282-0x0;var _0x4f65af=_0xb941[_0x402282];return _0x4f65af;};'use strict';var express=require('express');var router=express[_0x1b94('0x0')]();var auth=require(_0x1b94('0x1'));var controller=require(_0x1b94('0x2'));router[_0x1b94('0x3')]('/',controller[_0x1b94('0x4')]);router[_0x1b94('0x3')](_0x1b94('0x5'),auth[_0x1b94('0x6')](),auth[_0x1b94('0x7')](),controller[_0x1b94('0x8')]);router['get']('/reset',auth[_0x1b94('0x6')](),auth[_0x1b94('0x7')](),controller[_0x1b94('0x9')]);router['get'](_0x1b94('0xa'),auth[_0x1b94('0x6')](),auth['canUpdate'](),controller[_0x1b94('0xb')]);router['get'](_0x1b94('0xc'),auth[_0x1b94('0x6')](),controller[_0x1b94('0xd')]);router[_0x1b94('0x3')](_0x1b94('0xe'),controller[_0x1b94('0xf')]);module[_0x1b94('0x10')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 5006e28..429c2e5 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 _0x7816=['migrations','readdirSync','join','server','length','push','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','version','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','exports','query','latest','fetch','2.0.0','status','json','origin','git\x20fetch','git\x20fetch\x20origin\x20master','reset','error','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch'];(function(_0x31db02,_0x330986){var _0x1b2e55=function(_0x121a87){while(--_0x121a87){_0x31db02['push'](_0x31db02['shift']());}};_0x1b2e55(++_0x330986);}(_0x7816,0x1db));var _0x6781=function(_0x11dcf0,_0x4eb137){_0x11dcf0=_0x11dcf0-0x0;var _0x4f9831=_0x7816[_0x11dcf0];return _0x4f9831;};'use strict';var Umzug=require(_0x6781('0x0'));var path=require(_0x6781('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,_0x6781('0x2'));var compareVersions=require('compare-versions');var exec=require(_0x6781('0x3'))['exec'];var db=require(_0x6781('0x4'))['db'];var config=require(_0x6781('0x5'));var pm2=require(_0x6781('0x6'));var logger=require(_0x6781('0x7'))('update');var git=require(_0x6781('0x8'))(config[_0x6781('0x9')]);exports['index']=function(_0x4bb3ff,_0x4e3b68){var _0xf8fda7={'current':module[_0x6781('0xa')][_0x6781('0x2')],'phonebar':0x2};if(_0x4bb3ff[_0x6781('0xb')]&&_0x4bb3ff[_0x6781('0xb')][_0x6781('0xc')]){return git[_0x6781('0xd')]()['tags'](function(_0x2bf3f6,_0x393892){_0xf8fda7['latest']=(_0x2bf3f6?module[_0x6781('0xa')]['version']:_0x393892[_0x6781('0xc')])||_0x6781('0xe');return _0x4e3b68[_0x6781('0xf')](0xc8)[_0x6781('0x10')](_0xf8fda7);});}else{return _0x4e3b68[_0x6781('0xf')](0xc8)['json'](_0xf8fda7);}};exports[_0x6781('0xd')]=function(_0x509045,_0x2ae3d0){return git[_0x6781('0xd')]([_0x6781('0x11'),'master'],function(_0x19e337){if(_0x19e337){logger['error'](_0x19e337);return _0x2ae3d0['status'](0x1f4)[_0x6781('0x10')](_0x19e337);}logger['info'](_0x6781('0x12'));return _0x2ae3d0[_0x6781('0xf')](0xc8)[_0x6781('0x10')]({'output':_0x6781('0x13')});});};exports[_0x6781('0x14')]=function(_0x2217a1,_0x51a5b0){return git[_0x6781('0x14')](['--hard','FETCH_HEAD'],function(_0x27805c){if(_0x27805c){logger[_0x6781('0x15')](_0x27805c);return _0x51a5b0[_0x6781('0xf')](0x1f4)[_0x6781('0x10')](_0x27805c);}logger[_0x6781('0x16')](_0x6781('0x17'));return _0x51a5b0[_0x6781('0xf')](0xc8)['json']({'output':_0x6781('0x18')});});};exports[_0x6781('0x19')]=function(_0x55aaf2,_0x1b7847){exec(_0x6781('0x1a'),function(_0x4ffb45,_0x1f257c,_0x2f08e5){logger[_0x6781('0x16')](_0x1f257c);logger['info'](_0x2f08e5);if(_0x4ffb45){logger[_0x6781('0x15')](_0x4ffb45);return _0x1b7847['status'](0x1f4)['json'](_0x4ffb45);}return _0x1b7847['status'](0xc8)[_0x6781('0x10')]({'output':_0x1f257c});});};exports['restart']=function(_0x25da56,_0x2b4ad3){return pm2[_0x6781('0x1b')]('motion2')[_0x6781('0x1c')](function(_0x54af9b){logger[_0x6781('0x16')]('pm2\x20restart\x20motion\x20%s',_0x54af9b);return _0x2b4ad3[_0x6781('0xf')](0xc8)['json']({'output':_0x6781('0x1d')});})[_0x6781('0x1e')](function(_0x27d9e0){logger['error'](_0x27d9e0);return _0x2b4ad3[_0x6781('0xf')](0x1f4)[_0x6781('0x10')](_0x27d9e0);});};exports[_0x6781('0x1f')]=function(_0xb58a45,_0x205002){var _0x1ff49c=fs[_0x6781('0x20')](path[_0x6781('0x21')](config['root'],_0x6781('0x22'),_0x6781('0x1f')));var _0x50a58d=[];for(var _0x27bdca=0x0;_0x27bdca<_0x1ff49c[_0x6781('0x23')];_0x27bdca++){var _0x24170f=_0x1ff49c[_0x27bdca]['replace']('.js','');if(compareVersions(module[_0x6781('0xa')][_0x6781('0x2')],_0x24170f)===-0x1){_0x50a58d[_0x6781('0x24')](_0x24170f);}}if(_0x50a58d[_0x6781('0x23')]){var _0x108e54=_0x50a58d['sort'](compareVersions);var _0x366f14=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x6781('0x25')],'modelName':_0x6781('0x25'),'columnName':_0x6781('0x2')},'migrations':{'params':[db[_0x6781('0x26')][_0x6781('0x27')](),db[_0x6781('0x26')][_0x6781('0x28')],function(){throw new Error(_0x6781('0x29'));}],'path':path[_0x6781('0x21')](config[_0x6781('0x9')],_0x6781('0x22'),'migrations'),'pattern':/\.js$/}});_0x366f14['up']({'migrations':_['map'](_0x108e54,function(_0x391a48){return _0x391a48+'.js';})})[_0x6781('0x1c')](function(){return _0x205002[_0x6781('0xf')](0xc8)[_0x6781('0x10')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x6781('0xa')][_0x6781('0x2')]+_0x6781('0x2a')+_[_0x6781('0x2b')](_0x108e54),'migrations':_['join'](_0x108e54)});})[_0x6781('0x1e')](function(_0x1ec686){if(_0x1ec686 instanceof db['sequelize'][_0x6781('0x2c')]){return _0x205002[_0x6781('0xf')](0xc8)[_0x6781('0x10')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x205002[_0x6781('0xf')](0x1f4)['json'](_0x1ec686);}});}else{return _0x205002[_0x6781('0xf')](0xc8)[_0x6781('0x10')]({'output':_0x6781('0x2d')});}}; \ No newline at end of file +var _0x23ed=['last','Database\x20already\x20up-to-date','umzug','path','pkginfo','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','simple-git','index','exports','version','query','fetch','tags','latest','status','master','json','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','error','migrations','readdirSync','join','root','length','replace','.js','sort','sequelize','Migration','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'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x23ed,0x19a));var _0xd23e=function(_0x4ceae1,_0x437160){_0x4ceae1=_0x4ceae1-0x0;var _0x3dc47e=_0x23ed[_0x4ceae1];return _0x3dc47e;};'use strict';var Umzug=require(_0xd23e('0x0'));var path=require(_0xd23e('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xd23e('0x2'))(module,'version');var compareVersions=require(_0xd23e('0x3'));var exec=require(_0xd23e('0x4'))[_0xd23e('0x5')];var db=require(_0xd23e('0x6'))['db'];var config=require(_0xd23e('0x7'));var pm2=require(_0xd23e('0x8'));var logger=require('../../config/logger')('update');var git=require(_0xd23e('0x9'))(config['root']);exports[_0xd23e('0xa')]=function(_0x51eda4,_0xad55dc){var _0x13bbea={'current':module[_0xd23e('0xb')][_0xd23e('0xc')],'phonebar':0x2};if(_0x51eda4[_0xd23e('0xd')]&&_0x51eda4[_0xd23e('0xd')]['latest']){return git[_0xd23e('0xe')]()[_0xd23e('0xf')](function(_0x5a4abf,_0x7bb0c3){_0x13bbea[_0xd23e('0x10')]=(_0x5a4abf?module['exports'][_0xd23e('0xc')]:_0x7bb0c3[_0xd23e('0x10')])||'2.0.0';return _0xad55dc['status'](0xc8)['json'](_0x13bbea);});}else{return _0xad55dc[_0xd23e('0x11')](0xc8)['json'](_0x13bbea);}};exports[_0xd23e('0xe')]=function(_0x5154e7,_0x33595a){return git[_0xd23e('0xe')](['origin',_0xd23e('0x12')],function(_0x249def){if(_0x249def){logger['error'](_0x249def);return _0x33595a['status'](0x1f4)[_0xd23e('0x13')](_0x249def);}logger[_0xd23e('0x14')](_0xd23e('0x15'));return _0x33595a['status'](0xc8)[_0xd23e('0x13')]({'output':_0xd23e('0x16')});});};exports[_0xd23e('0x17')]=function(_0x1a1483,_0x5a4a24){return git[_0xd23e('0x17')]([_0xd23e('0x18'),_0xd23e('0x19')],function(_0x453174){if(_0x453174){logger['error'](_0x453174);return _0x5a4a24[_0xd23e('0x11')](0x1f4)[_0xd23e('0x13')](_0x453174);}logger['info'](_0xd23e('0x1a'));return _0x5a4a24[_0xd23e('0x11')](0xc8)[_0xd23e('0x13')]({'output':_0xd23e('0x1b')});});};exports[_0xd23e('0x1c')]=function(_0x1ef3e4,_0x3e2f1b){exec(_0xd23e('0x1d'),function(_0x23f863,_0x39490e,_0x590fb2){logger[_0xd23e('0x14')](_0x39490e);logger[_0xd23e('0x14')](_0x590fb2);if(_0x23f863){logger['error'](_0x23f863);return _0x3e2f1b[_0xd23e('0x11')](0x1f4)[_0xd23e('0x13')](_0x23f863);}return _0x3e2f1b[_0xd23e('0x11')](0xc8)[_0xd23e('0x13')]({'output':_0x39490e});});};exports[_0xd23e('0x1e')]=function(_0x4ac145,_0x40d60b){return pm2['restart']('motion2')[_0xd23e('0x1f')](function(_0x23402c){logger[_0xd23e('0x14')]('pm2\x20restart\x20motion\x20%s',_0x23402c);return _0x40d60b[_0xd23e('0x11')](0xc8)[_0xd23e('0x13')]({'output':_0xd23e('0x20')});})[_0xd23e('0x21')](function(_0x1dd583){logger[_0xd23e('0x22')](_0x1dd583);return _0x40d60b[_0xd23e('0x11')](0x1f4)[_0xd23e('0x13')](_0x1dd583);});};exports[_0xd23e('0x23')]=function(_0x18b7fb,_0x728824){var _0x5a512d=fs[_0xd23e('0x24')](path[_0xd23e('0x25')](config[_0xd23e('0x26')],'server',_0xd23e('0x23')));var _0x354427=[];for(var _0x39f6ad=0x0;_0x39f6ad<_0x5a512d[_0xd23e('0x27')];_0x39f6ad++){var _0x5a7972=_0x5a512d[_0x39f6ad][_0xd23e('0x28')](_0xd23e('0x29'),'');if(compareVersions(module[_0xd23e('0xb')][_0xd23e('0xc')],_0x5a7972)===-0x1){_0x354427['push'](_0x5a7972);}}if(_0x354427[_0xd23e('0x27')]){var _0x5c45bb=_0x354427[_0xd23e('0x2a')](compareVersions);var _0x4ac2e2=new Umzug({'storage':_0xd23e('0x2b'),'storageOptions':{'model':db[_0xd23e('0x2c')],'modelName':_0xd23e('0x2c'),'columnName':_0xd23e('0xc')},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db[_0xd23e('0x2b')]['constructor'],function(){throw new Error(_0xd23e('0x2d'));}],'path':path['join'](config[_0xd23e('0x26')],_0xd23e('0x2e'),_0xd23e('0x23')),'pattern':/\.js$/}});_0x4ac2e2['up']({'migrations':_[_0xd23e('0x2f')](_0x5c45bb,function(_0x211e46){return _0x211e46+_0xd23e('0x29');})})[_0xd23e('0x1f')](function(){return _0x728824['status'](0xc8)[_0xd23e('0x13')]({'output':_0xd23e('0x30')+module[_0xd23e('0xb')][_0xd23e('0xc')]+'\x20to\x20'+_[_0xd23e('0x31')](_0x5c45bb),'migrations':_[_0xd23e('0x25')](_0x5c45bb)});})[_0xd23e('0x21')](function(_0x5909c1){if(_0x5909c1 instanceof db[_0xd23e('0x2b')]['UniqueConstraintError']){return _0x728824[_0xd23e('0x11')](0xc8)[_0xd23e('0x13')]({'output':_0xd23e('0x32')});}else{return _0x728824['status'](0x1f4)['json'](_0x5909c1);}});}else{return _0x728824['status'](0xc8)[_0xd23e('0x13')]({'output':_0xd23e('0x32')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index bf11f78..145bcfc 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 _0x5d1d=['create','put','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','post'];(function(_0x8261bb,_0x48e718){var _0x530867=function(_0x4b2b4e){while(--_0x4b2b4e){_0x8261bb['push'](_0x8261bb['shift']());}};_0x530867(++_0x48e718);}(_0x5d1d,0xb0));var _0xd5d1=function(_0xf62a8,_0x50dfa2){_0xf62a8=_0xf62a8-0x0;var _0xee7fca=_0x5d1d[_0xf62a8];return _0xee7fca;};'use strict';var multer=require(_0xd5d1('0x0'));var util=require(_0xd5d1('0x1'));var path=require(_0xd5d1('0x2'));var timeout=require(_0xd5d1('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd5d1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd5d1('0x5'));var config=require(_0xd5d1('0x6'));var controller=require('./voiceAgentReport.controller');router[_0xd5d1('0x7')]('/',auth['isAuthenticated'](),controller[_0xd5d1('0x8')]);router[_0xd5d1('0x7')]('/describe',auth[_0xd5d1('0x9')](),controller[_0xd5d1('0xa')]);router[_0xd5d1('0x7')](_0xd5d1('0xb'),auth[_0xd5d1('0x9')](),controller[_0xd5d1('0xc')]);router[_0xd5d1('0xd')]('/',auth[_0xd5d1('0x9')](),controller[_0xd5d1('0xe')]);router[_0xd5d1('0xf')]('/:id',auth[_0xd5d1('0x9')](),controller[_0xd5d1('0x10')]);router[_0xd5d1('0x11')](_0xd5d1('0xb'),auth[_0xd5d1('0x9')](),controller[_0xd5d1('0x12')]);module['exports']=router; \ No newline at end of file +var _0x4ba9=['./voiceAgentReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4207f4,_0x1f778b){var _0x29a621=function(_0xa6f5b7){while(--_0xa6f5b7){_0x4207f4['push'](_0x4207f4['shift']());}};_0x29a621(++_0x1f778b);}(_0x4ba9,0xe1));var _0x94ba=function(_0x4b2cc6,_0x29ef43){_0x4b2cc6=_0x4b2cc6-0x0;var _0x3e0b08=_0x4ba9[_0x4b2cc6];return _0x3e0b08;};'use strict';var multer=require(_0x94ba('0x0'));var util=require('util');var path=require(_0x94ba('0x1'));var timeout=require('connect-timeout');var express=require(_0x94ba('0x2'));var router=express[_0x94ba('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x94ba('0x4'));var interaction=require(_0x94ba('0x5'));var config=require('../../config/environment');var controller=require(_0x94ba('0x6'));router['get']('/',auth[_0x94ba('0x7')](),controller[_0x94ba('0x8')]);router[_0x94ba('0x9')](_0x94ba('0xa'),auth[_0x94ba('0x7')](),controller[_0x94ba('0xb')]);router[_0x94ba('0x9')]('/:id',auth[_0x94ba('0x7')](),controller[_0x94ba('0xc')]);router[_0x94ba('0xd')]('/',auth['isAuthenticated'](),controller[_0x94ba('0xe')]);router[_0x94ba('0xf')](_0x94ba('0x10'),auth[_0x94ba('0x7')](),controller[_0x94ba('0x11')]);router[_0x94ba('0x12')](_0x94ba('0x10'),auth[_0x94ba('0x7')](),controller[_0x94ba('0x13')]);module[_0x94ba('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 8c38297..34b8bd1 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 _0x36ee=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','STRING','DATE','INTEGER'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0x36ee,0xe8));var _0xe36e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x36ee[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xe36e('0x0')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe36e('0x0')]},'calleridname':{'type':Sequelize[_0xe36e('0x0')]},'queue':{'type':Sequelize[_0xe36e('0x0')]},'interface':{'type':Sequelize[_0xe36e('0x0')]},'membername':{'type':Sequelize[_0xe36e('0x0')]},'agentcalledAt':{'type':Sequelize[_0xe36e('0x1')]},'agentconnectAt':{'type':Sequelize[_0xe36e('0x1')]},'agentcompleteAt':{'type':Sequelize[_0xe36e('0x1')]},'agentringnoanswerAt':{'type':Sequelize[_0xe36e('0x1')]},'agentdumpAt':{'type':Sequelize[_0xe36e('0x1')]},'holdtime':{'type':Sequelize[_0xe36e('0x2')]},'agentcomplete':{'type':Sequelize[_0xe36e('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xe36e('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xe36e('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe36e('0x2')]},'reason':{'type':Sequelize[_0xe36e('0x0')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe36e('0x0')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xe36e('0x0')]},'connectedlinenum':{'type':Sequelize[_0xe36e('0x0')]},'connectedlinename':{'type':Sequelize[_0xe36e('0x0')]},'language':{'type':Sequelize[_0xe36e('0x0')]},'accountcode':{'type':Sequelize[_0xe36e('0x0')]},'context':{'type':Sequelize[_0xe36e('0x0')]},'exten':{'type':Sequelize[_0xe36e('0x0')]},'priority':{'type':Sequelize[_0xe36e('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xe36e('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xe36e('0x0')]},'destcalleridnum':{'type':Sequelize[_0xe36e('0x0')]},'destcalleridname':{'type':Sequelize[_0xe36e('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xe36e('0x0')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xe36e('0x0')]},'destexten':{'type':Sequelize[_0xe36e('0x0')]},'destpriority':{'type':Sequelize[_0xe36e('0x0')]},'destuniqueid':{'type':Sequelize[_0xe36e('0x0')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xe36e('0x0')]},'answeredelsewheremembername':{'type':Sequelize[_0xe36e('0x0')]},'transfer':{'type':Sequelize[_0xe36e('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe36e('0x0')],'comment':_0xe36e('0x4')},'transferexten':{'type':Sequelize[_0xe36e('0x0')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xe36e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd26f=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x22fefb,_0x105065){var _0x49a5e0=function(_0x11b61a){while(--_0x11b61a){_0x22fefb['push'](_0x22fefb['shift']());}};_0x49a5e0(++_0x105065);}(_0xd26f,0x113));var _0xfd26=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xd26f[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0xfd26('0x0'));module[_0xfd26('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xfd26('0x2')]},'calleridname':{'type':Sequelize[_0xfd26('0x2')]},'queue':{'type':Sequelize[_0xfd26('0x2')]},'interface':{'type':Sequelize[_0xfd26('0x2')]},'membername':{'type':Sequelize[_0xfd26('0x2')]},'agentcalledAt':{'type':Sequelize[_0xfd26('0x3')]},'agentconnectAt':{'type':Sequelize[_0xfd26('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xfd26('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xfd26('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xfd26('0x4')]},'agentcomplete':{'type':Sequelize[_0xfd26('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xfd26('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xfd26('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xfd26('0x4')]},'agentacw':{'type':Sequelize[_0xfd26('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xfd26('0x2')]},'lastevent':{'type':Sequelize[_0xfd26('0x2')]},'channel':{'type':Sequelize[_0xfd26('0x2')]},'channelstate':{'type':Sequelize[_0xfd26('0x4')]},'channelstatedesc':{'type':Sequelize[_0xfd26('0x2')]},'connectedlinenum':{'type':Sequelize[_0xfd26('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xfd26('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xfd26('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xfd26('0x2')]},'destcalleridname':{'type':Sequelize[_0xfd26('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xfd26('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xfd26('0x2')]},'destlanguage':{'type':Sequelize[_0xfd26('0x2')]},'destaccountcode':{'type':Sequelize[_0xfd26('0x2')]},'destcontext':{'type':Sequelize[_0xfd26('0x2')]},'destexten':{'type':Sequelize[_0xfd26('0x2')]},'destpriority':{'type':Sequelize[_0xfd26('0x2')]},'destuniqueid':{'type':Sequelize[_0xfd26('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xfd26('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xfd26('0x2')]},'transfer':{'type':Sequelize[_0xfd26('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xfd26('0x2')],'comment':_0xfd26('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xfd26('0x2')]},'agententerreason':{'type':Sequelize[_0xfd26('0x4')],'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 86a30a1..0a4d4fa 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'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(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 e7d4cfc..57809fd 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 _0x81bd=['../../config/environment','./voiceAgentReport.attributes','define','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x33f74b,_0x5e8e40){var _0x5e468c=function(_0x243580){while(--_0x243580){_0x33f74b['push'](_0x33f74b['shift']());}};_0x5e468c(++_0x5e8e40);}(_0x81bd,0x7c));var _0xd81b=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0x81bd[_0x1e500e];return _0x10dc5e;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var logger=require(_0xd81b('0x2'))(_0xd81b('0x3'));var moment=require(_0xd81b('0x4'));var BPromise=require(_0xd81b('0x5'));var rp=require(_0xd81b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd81b('0x7'));var config=require(_0xd81b('0x8'));var attributes=require(_0xd81b('0x9'));module['exports']=function(_0x42a0aa,_0x34eb73){return _0x42a0aa[_0xd81b('0xa')]('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0xd81b('0xb'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4f0d=['uniqueid','destuniqueid','bluebird','request-promise','path','../../config/environment','define','VoiceAgentReport'];(function(_0x5799ff,_0x3f6ac0){var _0x9513c5=function(_0x5ae2b5){while(--_0x5ae2b5){_0x5799ff['push'](_0x5799ff['shift']());}};_0x9513c5(++_0x3f6ac0);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x540160,_0x24c6b6){_0x540160=_0x540160-0x0;var _0x476120=_0x4f0d[_0x540160];return _0x476120;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd4f0('0x0'));var rp=require(_0xd4f0('0x1'));var fs=require('fs');var path=require(_0xd4f0('0x2'));var rimraf=require('rimraf');var config=require(_0xd4f0('0x3'));var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x1809dd,_0x4da370){return _0x1809dd[_0xd4f0('0x4')](_0xd4f0('0x5'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0xd4f0('0x6'),_0xd4f0('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index b8086d9..50f6929 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 _0x3617=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','debug','UpdateVoiceAgentReport','update','where','attributes'];(function(_0x3a6fd8,_0x2fa124){var _0x50d351=function(_0x1befeb){while(--_0x1befeb){_0x3a6fd8['push'](_0x3a6fd8['shift']());}};_0x50d351(++_0x2fa124);}(_0x3617,0x132));var _0x7361=function(_0x316cba,_0xc56f5f){_0x316cba=_0x316cba-0x0;var _0x33a8e2=_0x3617[_0x316cba];return _0x33a8e2;};'use strict';var _=require(_0x7361('0x0'));var util=require(_0x7361('0x1'));var moment=require(_0x7361('0x2'));var BPromise=require(_0x7361('0x3'));var rs=require(_0x7361('0x4'));var fs=require('fs');var Redis=require(_0x7361('0x5'));var db=require(_0x7361('0x6'))['db'];var utils=require(_0x7361('0x7'));var logger=require(_0x7361('0x8'))(_0x7361('0x9'));var config=require('../../config/environment');var jayson=require(_0x7361('0xa'));var client=jayson['client'][_0x7361('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b4984,_0x218562,_0x9f2602){return new BPromise(function(_0x180c30,_0x338054){return client[_0x7361('0xc')](_0x1b4984,_0x9f2602)[_0x7361('0xd')](function(_0x282094){logger[_0x7361('0xe')](_0x7361('0xf'),_0x218562,'request\x20sent');logger['debug'](_0x7361('0x10'),_0x218562,'request\x20sent',JSON[_0x7361('0x11')](_0x282094));if(_0x282094[_0x7361('0x12')]){if(_0x282094[_0x7361('0x12')]['code']===0x1f4){logger[_0x7361('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x218562,_0x282094['error'][_0x7361('0x13')]);return _0x338054(_0x282094[_0x7361('0x12')][_0x7361('0x13')]);}logger[_0x7361('0x12')](_0x7361('0xf'),_0x218562,_0x282094[_0x7361('0x12')][_0x7361('0x13')]);return _0x180c30(_0x282094[_0x7361('0x12')][_0x7361('0x13')]);}else{logger['info'](_0x7361('0xf'),_0x218562,_0x7361('0x14'));_0x180c30(_0x282094[_0x7361('0x15')][_0x7361('0x13')]);}})[_0x7361('0x16')](function(_0x289509){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x218562,_0x289509);_0x338054(_0x289509);});});}exports[_0x7361('0x17')]=function(_0x3959c4){var _0x470a5b=this;return new Promise(function(_0x5b93f2,_0x1dc510){return db[_0x7361('0x18')][_0x7361('0x19')](_0x3959c4[_0x7361('0x1a')],{'raw':_0x3959c4[_0x7361('0x1b')]?_0x3959c4['options'][_0x7361('0x1c')]===undefined?!![]:![]:!![]})[_0x7361('0xd')](function(_0x50d7e5){logger[_0x7361('0xe')](_0x7361('0x17'),_0x3959c4);logger[_0x7361('0x1d')](_0x7361('0x17'),_0x3959c4,JSON[_0x7361('0x11')](_0x50d7e5));_0x5b93f2(_0x50d7e5);})[_0x7361('0x16')](function(_0x4f3940){logger[_0x7361('0x12')](_0x7361('0x17'),_0x4f3940['message'],_0x3959c4);_0x1dc510(_0x470a5b[_0x7361('0x12')](0x1f4,_0x4f3940[_0x7361('0x13')]));});});};exports[_0x7361('0x1e')]=function(_0x3ac0fa){var _0x424d38=this;return new Promise(function(_0xbb9cb7,_0x4e4e4e){return db['VoiceAgentReport'][_0x7361('0x1f')](_0x3ac0fa[_0x7361('0x1a')],{'raw':_0x3ac0fa[_0x7361('0x1b')]?_0x3ac0fa[_0x7361('0x1b')][_0x7361('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ac0fa['options']?_0x3ac0fa['options'][_0x7361('0x20')]||null:null,'attributes':_0x3ac0fa[_0x7361('0x1b')]?_0x3ac0fa[_0x7361('0x1b')][_0x7361('0x21')]||null:null,'limit':_0x3ac0fa[_0x7361('0x1b')]?_0x3ac0fa[_0x7361('0x1b')]['limit']||null:null})[_0x7361('0xd')](function(_0x360049){logger['info'](_0x7361('0x1e'),_0x3ac0fa);logger[_0x7361('0x1d')](_0x7361('0x1e'),_0x3ac0fa,JSON[_0x7361('0x11')](_0x360049));_0xbb9cb7(_0x360049);})['catch'](function(_0x281815){logger[_0x7361('0x12')](_0x7361('0x1e'),_0x281815[_0x7361('0x13')],_0x3ac0fa);_0x4e4e4e(_0x424d38[_0x7361('0x12')](0x1f4,_0x281815[_0x7361('0x13')]));});});}; \ No newline at end of file +var _0x0c09=['jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','message','VoiceAgentReport,\x20%s,\x20%s','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','stringify','UpdateVoiceAgentReport','where','attributes','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c09,0x1e6));var _0x90c0=function(_0x232be5,_0x3e3ae0){_0x232be5=_0x232be5-0x0;var _0x46f6b1=_0x0c09[_0x232be5];return _0x46f6b1;};'use strict';var _=require('lodash');var util=require(_0x90c0('0x0'));var moment=require(_0x90c0('0x1'));var BPromise=require(_0x90c0('0x2'));var rs=require(_0x90c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x90c0('0x4'))['db'];var utils=require(_0x90c0('0x5'));var logger=require(_0x90c0('0x6'))(_0x90c0('0x7'));var config=require(_0x90c0('0x8'));var jayson=require(_0x90c0('0x9'));var client=jayson[_0x90c0('0xa')][_0x90c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39537a,_0x4487e5,_0x39d144){return new BPromise(function(_0x26464a,_0x3972ca){return client[_0x90c0('0xc')](_0x39537a,_0x39d144)[_0x90c0('0xd')](function(_0x53fb0e){logger[_0x90c0('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0x4487e5,_0x90c0('0xf'));logger[_0x90c0('0x10')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x4487e5,_0x90c0('0xf'),JSON['stringify'](_0x53fb0e));if(_0x53fb0e[_0x90c0('0x11')]){if(_0x53fb0e[_0x90c0('0x11')][_0x90c0('0x12')]===0x1f4){logger[_0x90c0('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x4487e5,_0x53fb0e[_0x90c0('0x11')]['message']);return _0x3972ca(_0x53fb0e[_0x90c0('0x11')][_0x90c0('0x13')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x4487e5,_0x53fb0e[_0x90c0('0x11')][_0x90c0('0x13')]);return _0x26464a(_0x53fb0e['error'][_0x90c0('0x13')]);}else{logger[_0x90c0('0xe')](_0x90c0('0x14'),_0x4487e5,'request\x20sent');_0x26464a(_0x53fb0e[_0x90c0('0x15')][_0x90c0('0x13')]);}})[_0x90c0('0x16')](function(_0x365dd6){logger['error'](_0x90c0('0x14'),_0x4487e5,_0x365dd6);_0x3972ca(_0x365dd6);});});}exports[_0x90c0('0x17')]=function(_0x319889){var _0x4a5cc0=this;return new Promise(function(_0x838e53,_0x394b69){return db[_0x90c0('0x18')][_0x90c0('0x19')](_0x319889[_0x90c0('0x1a')],{'raw':_0x319889[_0x90c0('0x1b')]?_0x319889[_0x90c0('0x1b')][_0x90c0('0x1c')]===undefined?!![]:![]:!![]})[_0x90c0('0xd')](function(_0x5afbe2){logger[_0x90c0('0xe')]('CreateVoiceAgentReport',_0x319889);logger[_0x90c0('0x10')](_0x90c0('0x17'),_0x319889,JSON[_0x90c0('0x1d')](_0x5afbe2));_0x838e53(_0x5afbe2);})[_0x90c0('0x16')](function(_0x1951f4){logger[_0x90c0('0x11')]('CreateVoiceAgentReport',_0x1951f4[_0x90c0('0x13')],_0x319889);_0x394b69(_0x4a5cc0['error'](0x1f4,_0x1951f4['message']));});});};exports[_0x90c0('0x1e')]=function(_0x329f63){var _0x27890d=this;return new Promise(function(_0x21bae5,_0x2bfa43){return db[_0x90c0('0x18')]['update'](_0x329f63[_0x90c0('0x1a')],{'raw':_0x329f63['options']?_0x329f63[_0x90c0('0x1b')][_0x90c0('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x329f63[_0x90c0('0x1b')]?_0x329f63[_0x90c0('0x1b')][_0x90c0('0x1f')]||null:null,'attributes':_0x329f63['options']?_0x329f63[_0x90c0('0x1b')][_0x90c0('0x20')]||null:null,'limit':_0x329f63[_0x90c0('0x1b')]?_0x329f63['options']['limit']||null:null})[_0x90c0('0xd')](function(_0x4dfab1){logger[_0x90c0('0xe')](_0x90c0('0x1e'),_0x329f63);logger[_0x90c0('0x10')]('UpdateVoiceAgentReport',_0x329f63,JSON[_0x90c0('0x1d')](_0x4dfab1));_0x21bae5(_0x4dfab1);})[_0x90c0('0x16')](function(_0x29c70f){logger[_0x90c0('0x11')](_0x90c0('0x1e'),_0x29c70f[_0x90c0('0x13')],_0x329f63);_0x2bfa43(_0x27890d['error'](0x1f4,_0x29c70f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 0e6e8ec..6ae0da7 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 _0x9c5a=['fs-extra','../../components/interaction/service','../../config/environment','get','index','describe','isAuthenticated','show','create','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x14f6e9,_0x42c524){_0x14f6e9=_0x14f6e9-0x0;var _0x52169d=_0x9c5a[_0x14f6e9];return _0x52169d;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var fs_extra=require(_0xa9c5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var controller=require('./voiceCallReport.controller');router[_0xa9c5('0x8')]('/',auth['isAuthenticated'](),controller[_0xa9c5('0x9')]);router[_0xa9c5('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xa9c5('0xa')]);router[_0xa9c5('0x8')]('/:id',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xc')]);router['post']('/',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xd')]);router['put']('/:id',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xe')]);router[_0xa9c5('0xf')](_0xa9c5('0x10'),auth[_0xa9c5('0xb')](),controller[_0xa9c5('0x11')]);module[_0xa9c5('0x12')]=router; \ No newline at end of file +var _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x3a7062,_0x328337){var _0x256c11=function(_0x174b10){while(--_0x174b10){_0x3a7062['push'](_0x3a7062['shift']());}};_0x256c11(++_0x328337);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3a93a7,_0x52bf3c){_0x3a93a7=_0x3a93a7-0x0;var _0x57fe87=_0x1cb9[_0x3a93a7];return _0x57fe87;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index b7a58db..3f20621 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 _0x832e=['ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','TEXT','DATE','INTEGER','STRING'];(function(_0x1902ef,_0x35f15a){var _0x1f21a1=function(_0x176df6){while(--_0x176df6){_0x1902ef['push'](_0x1902ef['shift']());}};_0x1f21a1(++_0x35f15a);}(_0x832e,0x17b));var _0xe832=function(_0xe940fc,_0x587243){_0xe940fc=_0xe940fc-0x0;var _0x51bc42=_0x832e[_0xe940fc];return _0x51bc42;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xe832('0x0')]},'type':{'type':Sequelize[_0xe832('0x1')](_0xe832('0x2'),_0xe832('0x3'),_0xe832('0x4'),_0xe832('0x5'),_0xe832('0x6'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xe832('0x0')]},'source':{'type':Sequelize[_0xe832('0x0')]},'destination':{'type':Sequelize[_0xe832('0x0')]},'destinationcontext':{'type':Sequelize[_0xe832('0x0')]},'callerid':{'type':Sequelize[_0xe832('0x0')]},'channel':{'type':Sequelize[_0xe832('0x0')]},'destinationchannel':{'type':Sequelize[_0xe832('0x0')]},'lastapplication':{'type':Sequelize[_0xe832('0x0')]},'lastdata':{'type':Sequelize[_0xe832('0x7')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xe832('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xe832('0x8')]},'duration':{'type':Sequelize[_0xe832('0x9')]},'billableseconds':{'type':Sequelize[_0xe832('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe832('0x0')]},'amaflags':{'type':Sequelize[_0xe832('0x0')]},'userfield':{'type':Sequelize[_0xe832('0x0')]},'userDisposition':{'type':Sequelize[_0xe832('0x0')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xe832('0x0')]},'note':{'type':Sequelize[_0xe832('0x0')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0xe832('0x9')]},'sipcallid':{'type':Sequelize[_0xe832('0x0')]}}; \ No newline at end of file +var _0x2cf5=['dialer','STRING','TEXT','DATE','INTEGER','sequelize','exports','ENUM','internal','outbound'];(function(_0x38aa39,_0x563f65){var _0x1ff3a5=function(_0x49213c){while(--_0x49213c){_0x38aa39['push'](_0x38aa39['shift']());}};_0x1ff3a5(++_0x563f65);}(_0x2cf5,0x19f));var _0x52cf=function(_0x1952ab,_0x285074){_0x1952ab=_0x1952ab-0x0;var _0x5ccce4=_0x2cf5[_0x1952ab];return _0x5ccce4;};'use strict';var Sequelize=require(_0x52cf('0x0'));module[_0x52cf('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x52cf('0x2')]('inbound',_0x52cf('0x3'),_0x52cf('0x4'),'inbound-fax','outbound-fax',_0x52cf('0x5'))},'tag':{'type':Sequelize[_0x52cf('0x6')]},'accountcode':{'type':Sequelize[_0x52cf('0x6')]},'source':{'type':Sequelize[_0x52cf('0x6')]},'destination':{'type':Sequelize[_0x52cf('0x6')]},'destinationcontext':{'type':Sequelize[_0x52cf('0x6')]},'callerid':{'type':Sequelize[_0x52cf('0x6')]},'channel':{'type':Sequelize[_0x52cf('0x6')]},'destinationchannel':{'type':Sequelize[_0x52cf('0x6')]},'lastapplication':{'type':Sequelize[_0x52cf('0x6')]},'lastdata':{'type':Sequelize[_0x52cf('0x7')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x52cf('0x8')]},'answertime':{'type':Sequelize[_0x52cf('0x8')]},'endtime':{'type':Sequelize[_0x52cf('0x8')]},'duration':{'type':Sequelize[_0x52cf('0x9')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x52cf('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x52cf('0x6')]},'amaflags':{'type':Sequelize[_0x52cf('0x6')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x52cf('0x6')]},'userSecondDisposition':{'type':Sequelize[_0x52cf('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x52cf('0x6')]},'note':{'type':Sequelize[_0x52cf('0x6')]},'prefix':{'type':Sequelize[_0x52cf('0x6')]},'routeid':{'type':Sequelize[_0x52cf('0x9')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 5df0289..304b2cb 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 _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x155b44,_0x35789b){var _0x554bae=function(_0x290b1a){while(--_0x290b1a){_0x155b44['push'](_0x155b44['shift']());}};_0x554bae(++_0x35789b);}(_0x0b0e,0x187));var _0xe0b0=function(_0x39cd3c,_0xa21102){_0x39cd3c=_0x39cd3c-0x0;var _0x47a0ae=_0x0b0e[_0x39cd3c];return _0x47a0ae;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,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(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x49295f,_0x1c281c){_0x49295f=_0x49295f-0x0;var _0x5de211=_0x5f2f[_0x49295f];return _0x5de211;};'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 ff8140e..ed9c33a 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 _0x98ea=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceCallReport.attributes','define','report_call','uniqueid'];(function(_0x47777f,_0x27460c){var _0x3f2835=function(_0xe6ba22){while(--_0xe6ba22){_0x47777f['push'](_0x47777f['shift']());}};_0x3f2835(++_0x27460c);}(_0x98ea,0x1ce));var _0xa98e=function(_0x196b65,_0x1f4ba4){_0x196b65=_0x196b65-0x0;var _0x3ef4d8=_0x98ea[_0x196b65];return _0x3ef4d8;};'use strict';var _=require(_0xa98e('0x0'));var util=require('util');var logger=require(_0xa98e('0x1'))('api');var moment=require(_0xa98e('0x2'));var BPromise=require(_0xa98e('0x3'));var rp=require(_0xa98e('0x4'));var fs=require('fs');var path=require(_0xa98e('0x5'));var rimraf=require(_0xa98e('0x6'));var config=require('../../config/environment');var attributes=require(_0xa98e('0x7'));module['exports']=function(_0x4517b4,_0x3c7612){return _0x4517b4[_0xa98e('0x8')]('VoiceCallReport',attributes,{'tableName':_0xa98e('0x9'),'paranoid':![],'indexes':[{'fields':[_0xa98e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6489=['rimraf','../../config/environment','./voiceCallReport.attributes','VoiceCallReport','report_call','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5e75af,_0x2d9b04){var _0x41da67=function(_0x340b58){while(--_0x340b58){_0x5e75af['push'](_0x5e75af['shift']());}};_0x41da67(++_0x2d9b04);}(_0x6489,0x124));var _0x9648=function(_0x3a07da,_0x2734f0){_0x3a07da=_0x3a07da-0x0;var _0x577fe8=_0x6489[_0x3a07da];return _0x577fe8;};'use strict';var _=require(_0x9648('0x0'));var util=require('util');var logger=require(_0x9648('0x1'))(_0x9648('0x2'));var moment=require(_0x9648('0x3'));var BPromise=require(_0x9648('0x4'));var rp=require(_0x9648('0x5'));var fs=require('fs');var path=require(_0x9648('0x6'));var rimraf=require(_0x9648('0x7'));var config=require(_0x9648('0x8'));var attributes=require(_0x9648('0x9'));module['exports']=function(_0x30ca0e,_0x311100){return _0x30ca0e['define'](_0x9648('0xa'),attributes,{'tableName':_0x9648('0xb'),'paranoid':![],'indexes':[{'fields':[_0x9648('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 859c353..1334949 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 _0x0b36=['options','raw','where','attributes','include','map','model','debug','stringify','CreateVoiceCallReport','create','body','update','limit','UpdateVoiceCallReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','VoiceCallReport,\x20%s,\x20%s','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','GetVoiceCallReport','VoiceCallReport','findAll'];(function(_0x279996,_0x4d2c41){var _0x14db97=function(_0x26490c){while(--_0x26490c){_0x279996['push'](_0x279996['shift']());}};_0x14db97(++_0x4d2c41);}(_0x0b36,0x16e));var _0x60b3=function(_0x125b80,_0x41db3b){_0x125b80=_0x125b80-0x0;var _0x414ba8=_0x0b36[_0x125b80];return _0x414ba8;};'use strict';var _=require(_0x60b3('0x0'));var util=require('util');var moment=require(_0x60b3('0x1'));var BPromise=require(_0x60b3('0x2'));var rs=require(_0x60b3('0x3'));var fs=require('fs');var Redis=require(_0x60b3('0x4'));var db=require(_0x60b3('0x5'))['db'];var utils=require(_0x60b3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x60b3('0x7'));var jayson=require(_0x60b3('0x8'));var client=jayson[_0x60b3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f54a8,_0x56a758,_0x2e7f3c){return new BPromise(function(_0xa94acb,_0x4c5227){return client[_0x60b3('0xa')](_0x1f54a8,_0x2e7f3c)[_0x60b3('0xb')](function(_0x20584e){logger['info'](_0x60b3('0xc'),_0x56a758,'request\x20sent');logger['debug'](_0x60b3('0xd'),_0x56a758,'request\x20sent',JSON['stringify'](_0x20584e));if(_0x20584e[_0x60b3('0xe')]){if(_0x20584e[_0x60b3('0xe')][_0x60b3('0xf')]===0x1f4){logger[_0x60b3('0xe')](_0x60b3('0xc'),_0x56a758,_0x20584e[_0x60b3('0xe')][_0x60b3('0x10')]);return _0x4c5227(_0x20584e[_0x60b3('0xe')][_0x60b3('0x10')]);}logger[_0x60b3('0xe')](_0x60b3('0xc'),_0x56a758,_0x20584e[_0x60b3('0xe')][_0x60b3('0x10')]);return _0xa94acb(_0x20584e[_0x60b3('0xe')][_0x60b3('0x10')]);}else{logger[_0x60b3('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x56a758,_0x60b3('0x12'));_0xa94acb(_0x20584e[_0x60b3('0x13')][_0x60b3('0x10')]);}})[_0x60b3('0x14')](function(_0x674054){logger[_0x60b3('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x56a758,_0x674054);_0x4c5227(_0x674054);});});}exports[_0x60b3('0x15')]=function(_0x23d437){var _0x3316f1=this;return new Promise(function(_0x2e9015,_0x15b542){return db[_0x60b3('0x16')][_0x60b3('0x17')]({'raw':_0x23d437[_0x60b3('0x18')]?_0x23d437[_0x60b3('0x18')][_0x60b3('0x19')]===undefined?!![]:![]:!![],'where':_0x23d437[_0x60b3('0x18')]?_0x23d437[_0x60b3('0x18')][_0x60b3('0x1a')]||null:null,'attributes':_0x23d437['options']?_0x23d437[_0x60b3('0x18')][_0x60b3('0x1b')]||null:null,'limit':_0x23d437[_0x60b3('0x18')]?_0x23d437[_0x60b3('0x18')]['limit']||null:null,'include':_0x23d437[_0x60b3('0x18')]?_0x23d437[_0x60b3('0x18')][_0x60b3('0x1c')]?_[_0x60b3('0x1d')](_0x23d437['options'][_0x60b3('0x1c')],function(_0xe5aea4){return{'model':db[_0xe5aea4[_0x60b3('0x1e')]],'as':_0xe5aea4['as'],'attributes':_0xe5aea4[_0x60b3('0x1b')],'include':_0xe5aea4[_0x60b3('0x1c')]?_['map'](_0xe5aea4[_0x60b3('0x1c')],function(_0x405f83){return{'model':db[_0x405f83['model']],'as':_0x405f83['as'],'attributes':_0x405f83[_0x60b3('0x1b')],'include':_0x405f83[_0x60b3('0x1c')]?_[_0x60b3('0x1d')](_0x405f83[_0x60b3('0x1c')],function(_0x15295c){return{'model':db[_0x15295c[_0x60b3('0x1e')]],'as':_0x15295c['as'],'attributes':_0x15295c[_0x60b3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x60b3('0xb')](function(_0x16bba8){logger[_0x60b3('0x11')](_0x60b3('0x15'),_0x23d437);logger[_0x60b3('0x1f')](_0x60b3('0x15'),_0x23d437,JSON[_0x60b3('0x20')](_0x16bba8));_0x2e9015(_0x16bba8);})['catch'](function(_0x384e41){logger[_0x60b3('0xe')]('GetVoiceCallReport',_0x384e41[_0x60b3('0x10')],_0x23d437);_0x15b542(_0x3316f1[_0x60b3('0xe')](0x1f4,_0x384e41[_0x60b3('0x10')]));});});};exports[_0x60b3('0x21')]=function(_0xb873a9){var _0x271bcd=this;return new Promise(function(_0x268eb2,_0x3c2dc2){return db['VoiceCallReport'][_0x60b3('0x22')](_0xb873a9[_0x60b3('0x23')],{'raw':_0xb873a9[_0x60b3('0x18')]?_0xb873a9['options'][_0x60b3('0x19')]===undefined?!![]:![]:!![]})[_0x60b3('0xb')](function(_0x37f34e){logger['info'](_0x60b3('0x21'),_0xb873a9);logger[_0x60b3('0x1f')](_0x60b3('0x21'),_0xb873a9,JSON[_0x60b3('0x20')](_0x37f34e));_0x268eb2(_0x37f34e);})['catch'](function(_0x161b2a){logger[_0x60b3('0xe')](_0x60b3('0x21'),_0x161b2a[_0x60b3('0x10')],_0xb873a9);_0x3c2dc2(_0x271bcd[_0x60b3('0xe')](0x1f4,_0x161b2a[_0x60b3('0x10')]));});});};exports['UpdateVoiceCallReport']=function(_0x4f1f72){var _0x4a3e5e=this;return new Promise(function(_0x319c0e,_0x1cecfa){return db['VoiceCallReport'][_0x60b3('0x24')](_0x4f1f72['body'],{'raw':_0x4f1f72[_0x60b3('0x18')]?_0x4f1f72[_0x60b3('0x18')][_0x60b3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f1f72['options']?_0x4f1f72[_0x60b3('0x18')][_0x60b3('0x1a')]||null:null,'attributes':_0x4f1f72[_0x60b3('0x18')]?_0x4f1f72['options'][_0x60b3('0x1b')]||null:null,'limit':_0x4f1f72[_0x60b3('0x18')]?_0x4f1f72[_0x60b3('0x18')][_0x60b3('0x25')]||null:null})['then'](function(_0x56c8b7){logger['info'](_0x60b3('0x26'),_0x4f1f72);logger[_0x60b3('0x1f')](_0x60b3('0x26'),_0x4f1f72,JSON['stringify'](_0x56c8b7));_0x319c0e(_0x56c8b7);})[_0x60b3('0x14')](function(_0x37c017){logger[_0x60b3('0xe')](_0x60b3('0x26'),_0x37c017[_0x60b3('0x10')],_0x4f1f72);_0x1cecfa(_0x4a3e5e['error'](0x1f4,_0x37c017[_0x60b3('0x10')]));});});}; \ No newline at end of file +var _0x37df=['model','include','debug','CreateVoiceCallReport','VoiceCallReport','body','UpdateVoiceCallReport','update','limit','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceCallReport','options','raw','where','attributes','map'];(function(_0x4cf6b0,_0x120ce1){var _0x15d06e=function(_0x4366e1){while(--_0x4366e1){_0x4cf6b0['push'](_0x4cf6b0['shift']());}};_0x15d06e(++_0x120ce1);}(_0x37df,0x195));var _0xf37d=function(_0x291d3f,_0x3ef99f){_0x291d3f=_0x291d3f-0x0;var _0x242080=_0x37df[_0x291d3f];return _0x242080;};'use strict';var _=require(_0xf37d('0x0'));var util=require(_0xf37d('0x1'));var moment=require(_0xf37d('0x2'));var BPromise=require(_0xf37d('0x3'));var rs=require(_0xf37d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf37d('0x5'));var logger=require(_0xf37d('0x6'))(_0xf37d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf37d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50edaa,_0x32b479,_0x9190a8){return new BPromise(function(_0x29b922,_0x18050f){return client[_0xf37d('0x9')](_0x50edaa,_0x9190a8)[_0xf37d('0xa')](function(_0x4bbf6b){logger[_0xf37d('0xb')](_0xf37d('0xc'),_0x32b479,'request\x20sent');logger['debug'](_0xf37d('0xd'),_0x32b479,_0xf37d('0xe'),JSON[_0xf37d('0xf')](_0x4bbf6b));if(_0x4bbf6b['error']){if(_0x4bbf6b[_0xf37d('0x10')][_0xf37d('0x11')]===0x1f4){logger['error'](_0xf37d('0xc'),_0x32b479,_0x4bbf6b[_0xf37d('0x10')][_0xf37d('0x12')]);return _0x18050f(_0x4bbf6b[_0xf37d('0x10')][_0xf37d('0x12')]);}logger[_0xf37d('0x10')](_0xf37d('0xc'),_0x32b479,_0x4bbf6b[_0xf37d('0x10')][_0xf37d('0x12')]);return _0x29b922(_0x4bbf6b[_0xf37d('0x10')][_0xf37d('0x12')]);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x32b479,_0xf37d('0xe'));_0x29b922(_0x4bbf6b[_0xf37d('0x13')][_0xf37d('0x12')]);}})[_0xf37d('0x14')](function(_0x1213a4){logger[_0xf37d('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x32b479,_0x1213a4);_0x18050f(_0x1213a4);});});}exports[_0xf37d('0x15')]=function(_0x1980f7){var _0x594fe3=this;return new Promise(function(_0x1f134d,_0x5bb10e){return db['VoiceCallReport']['findAll']({'raw':_0x1980f7[_0xf37d('0x16')]?_0x1980f7[_0xf37d('0x16')][_0xf37d('0x17')]===undefined?!![]:![]:!![],'where':_0x1980f7[_0xf37d('0x16')]?_0x1980f7[_0xf37d('0x16')][_0xf37d('0x18')]||null:null,'attributes':_0x1980f7[_0xf37d('0x16')]?_0x1980f7[_0xf37d('0x16')][_0xf37d('0x19')]||null:null,'limit':_0x1980f7[_0xf37d('0x16')]?_0x1980f7[_0xf37d('0x16')]['limit']||null:null,'include':_0x1980f7[_0xf37d('0x16')]?_0x1980f7['options']['include']?_[_0xf37d('0x1a')](_0x1980f7[_0xf37d('0x16')]['include'],function(_0x23682f){return{'model':db[_0x23682f[_0xf37d('0x1b')]],'as':_0x23682f['as'],'attributes':_0x23682f[_0xf37d('0x19')],'include':_0x23682f['include']?_['map'](_0x23682f[_0xf37d('0x1c')],function(_0x3b0965){return{'model':db[_0x3b0965[_0xf37d('0x1b')]],'as':_0x3b0965['as'],'attributes':_0x3b0965[_0xf37d('0x19')],'include':_0x3b0965[_0xf37d('0x1c')]?_['map'](_0x3b0965[_0xf37d('0x1c')],function(_0x16bf6c){return{'model':db[_0x16bf6c[_0xf37d('0x1b')]],'as':_0x16bf6c['as'],'attributes':_0x16bf6c[_0xf37d('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa024b7){logger[_0xf37d('0xb')](_0xf37d('0x15'),_0x1980f7);logger[_0xf37d('0x1d')]('GetVoiceCallReport',_0x1980f7,JSON[_0xf37d('0xf')](_0xa024b7));_0x1f134d(_0xa024b7);})['catch'](function(_0x3ea8f5){logger[_0xf37d('0x10')](_0xf37d('0x15'),_0x3ea8f5[_0xf37d('0x12')],_0x1980f7);_0x5bb10e(_0x594fe3[_0xf37d('0x10')](0x1f4,_0x3ea8f5['message']));});});};exports[_0xf37d('0x1e')]=function(_0x3382a4){var _0x2ad74d=this;return new Promise(function(_0x22c280,_0x4d7aeb){return db[_0xf37d('0x1f')]['create'](_0x3382a4[_0xf37d('0x20')],{'raw':_0x3382a4[_0xf37d('0x16')]?_0x3382a4['options'][_0xf37d('0x17')]===undefined?!![]:![]:!![]})[_0xf37d('0xa')](function(_0x234473){logger[_0xf37d('0xb')]('CreateVoiceCallReport',_0x3382a4);logger[_0xf37d('0x1d')]('CreateVoiceCallReport',_0x3382a4,JSON[_0xf37d('0xf')](_0x234473));_0x22c280(_0x234473);})[_0xf37d('0x14')](function(_0x523c56){logger[_0xf37d('0x10')]('CreateVoiceCallReport',_0x523c56[_0xf37d('0x12')],_0x3382a4);_0x4d7aeb(_0x2ad74d[_0xf37d('0x10')](0x1f4,_0x523c56[_0xf37d('0x12')]));});});};exports[_0xf37d('0x21')]=function(_0x5358de){var _0x1862ec=this;return new Promise(function(_0x381408,_0x3c2afc){return db[_0xf37d('0x1f')][_0xf37d('0x22')](_0x5358de[_0xf37d('0x20')],{'raw':_0x5358de[_0xf37d('0x16')]?_0x5358de[_0xf37d('0x16')][_0xf37d('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5358de['options']?_0x5358de[_0xf37d('0x16')][_0xf37d('0x18')]||null:null,'attributes':_0x5358de['options']?_0x5358de['options'][_0xf37d('0x19')]||null:null,'limit':_0x5358de[_0xf37d('0x16')]?_0x5358de['options'][_0xf37d('0x23')]||null:null})[_0xf37d('0xa')](function(_0x592be2){logger['info'](_0xf37d('0x21'),_0x5358de);logger[_0xf37d('0x1d')]('UpdateVoiceCallReport',_0x5358de,JSON[_0xf37d('0xf')](_0x592be2));_0x381408(_0x592be2);})[_0xf37d('0x14')](function(_0x4faa4b){logger['error']('UpdateVoiceCallReport',_0x4faa4b[_0xf37d('0x12')],_0x5358de);_0x3c2afc(_0x1862ec[_0xf37d('0x10')](0x1f4,_0x4faa4b[_0xf37d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 7bca988..26beb1c 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 _0x2f68=['/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceChanSpy.controller','get','isAuthenticated','index','show','post','put'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x2f68,0x15a));var _0x82f6=function(_0x170e9a,_0x482cbd){_0x170e9a=_0x170e9a-0x0;var _0x1cdf0b=_0x2f68[_0x170e9a];return _0x1cdf0b;};'use strict';var multer=require(_0x82f6('0x0'));var util=require(_0x82f6('0x1'));var path=require('path');var timeout=require(_0x82f6('0x2'));var express=require(_0x82f6('0x3'));var router=express[_0x82f6('0x4')]();var fs_extra=require(_0x82f6('0x5'));var auth=require(_0x82f6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x82f6('0x7'));router[_0x82f6('0x8')]('/',auth[_0x82f6('0x9')](),controller[_0x82f6('0xa')]);router[_0x82f6('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x82f6('0xb')]);router[_0x82f6('0xc')]('/',auth[_0x82f6('0x9')](),controller['create']);router[_0x82f6('0xd')](_0x82f6('0xe'),auth['isAuthenticated'](),controller[_0x82f6('0xf')]);router[_0x82f6('0x10')](_0x82f6('0xe'),auth[_0x82f6('0x9')](),controller['destroy']);module[_0x82f6('0x11')]=router; \ No newline at end of file +var _0x0b5d=['put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','/:id','show','post','isAuthenticated'];(function(_0x3b8522,_0x203c72){var _0x108c21=function(_0x371054){while(--_0x371054){_0x3b8522['push'](_0x3b8522['shift']());}};_0x108c21(++_0x203c72);}(_0x0b5d,0x136));var _0xd0b5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b5d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xd0b5('0x0'));var path=require(_0xd0b5('0x1'));var timeout=require(_0xd0b5('0x2'));var express=require(_0xd0b5('0x3'));var router=express[_0xd0b5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd0b5('0x5'));var config=require(_0xd0b5('0x6'));var controller=require(_0xd0b5('0x7'));router[_0xd0b5('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd0b5('0x8')](_0xd0b5('0x9'),auth['isAuthenticated'](),controller[_0xd0b5('0xa')]);router[_0xd0b5('0xb')]('/',auth[_0xd0b5('0xc')](),controller['create']);router[_0xd0b5('0xd')](_0xd0b5('0x9'),auth[_0xd0b5('0xc')](),controller[_0xd0b5('0xe')]);router[_0xd0b5('0xf')](_0xd0b5('0x9'),auth[_0xd0b5('0xc')](),controller['destroy']);module[_0xd0b5('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 0fce88d..59f1228 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 _0x37d5=['options','getDataValue','split','BOOLEAN','sequelize','STRING','name'];(function(_0x3b6aaf,_0x4aef36){var _0x295fa9=function(_0x4320d3){while(--_0x4320d3){_0x3b6aaf['push'](_0x3b6aaf['shift']());}};_0x295fa9(++_0x4aef36);}(_0x37d5,0x14d));var _0x537d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x37d5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x537d('0x0'));module['exports']={'name':{'type':Sequelize[_0x537d('0x1')]},'prefix':{'type':Sequelize[_0x537d('0x1')],'unique':_0x537d('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x537d('0x1')],'set':function(_0x519ac1){this['setDataValue'](_0x537d('0x3'),_0x519ac1?_0x519ac1['join'](''):[]);},'get':function(){return this[_0x537d('0x4')](_0x537d('0x3'))?this['getDataValue']('options')[_0x537d('0x5')](''):[];}},'auth':{'type':Sequelize[_0x537d('0x6')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x537d('0x1')]},'description':{'type':Sequelize[_0x537d('0x1')]}}; \ No newline at end of file +var _0xed53=['options','join','getDataValue','split','BOOLEAN','sequelize','STRING','name'];(function(_0x47e611,_0x141ea4){var _0x4a3809=function(_0x1d0004){while(--_0x1d0004){_0x47e611['push'](_0x47e611['shift']());}};_0x4a3809(++_0x141ea4);}(_0xed53,0x12d));var _0x3ed5=function(_0x3d7c5e,_0x28be64){_0x3d7c5e=_0x3d7c5e-0x0;var _0x3d3e24=_0xed53[_0x3d7c5e];return _0x3d3e24;};'use strict';var Sequelize=require(_0x3ed5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x3ed5('0x1')],'unique':_0x3ed5('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x3ed5('0x1')],'set':function(_0x3e7f0f){this['setDataValue'](_0x3ed5('0x3'),_0x3e7f0f?_0x3e7f0f[_0x3ed5('0x4')](''):[]);},'get':function(){return this[_0x3ed5('0x5')](_0x3ed5('0x3'))?this[_0x3ed5('0x5')](_0x3ed5('0x3'))[_0x3ed5('0x6')](''):[];}},'auth':{'type':Sequelize[_0x3ed5('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x3ed5('0x1')]},'record':{'type':Sequelize[_0x3ed5('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x3ed5('0x1')]},'description':{'type':Sequelize[_0x3ed5('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index d90e07c..47e4449 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 _0x7333=['include','keys','rawAttributes','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','params','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../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','apply','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','index','VoiceChanSpy','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x1a9798,_0x2c033b){var _0x343a05=function(_0x5a29a8){while(--_0x5a29a8){_0x1a9798['push'](_0x1a9798['shift']());}};_0x343a05(++_0x2c033b);}(_0x7333,0xfc));var _0x3733=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7333[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x3733('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3733('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3733('0x2'));var moment=require(_0x3733('0x3'));var BPromise=require(_0x3733('0x4'));var Mustache=require('mustache');var util=require(_0x3733('0x5'));var path=require(_0x3733('0x6'));var sox=require(_0x3733('0x7'));var csv=require('to-csv');var ejs=require(_0x3733('0x8'));var fs=require('fs');var fs_extra=require(_0x3733('0x9'));var _=require(_0x3733('0xa'));var squel=require(_0x3733('0xb'));var crypto=require('crypto');var jsforce=require(_0x3733('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3733('0xd'));var querystring=require(_0x3733('0xe'));var Papa=require(_0x3733('0xf'));var Redis=require(_0x3733('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3733('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3733('0x12'));var logger=require(_0x3733('0x13'))(_0x3733('0x14'));var utils=require(_0x3733('0x15'));var config=require(_0x3733('0x16'));var licenseUtil=require(_0x3733('0x17'));var db=require(_0x3733('0x18'))['db'];function respondWithStatusCode(_0x1402f8,_0x331f5d){_0x331f5d=_0x331f5d||0xcc;return function(_0x1fa139){if(_0x1fa139){return _0x1402f8[_0x3733('0x19')](_0x331f5d);}return _0x1402f8['status'](_0x331f5d)['end']();};}function respondWithResult(_0x387268,_0x2de05f){_0x2de05f=_0x2de05f||0xc8;return function(_0x402489){if(_0x402489){return _0x387268[_0x3733('0x1a')](_0x2de05f)[_0x3733('0x1b')](_0x402489);}};}function respondWithFilteredResult(_0x46a03e,_0x520008){return function(_0x1fd598){if(_0x1fd598){var _0x607186=typeof _0x520008[_0x3733('0x1c')]===_0x3733('0x1d')&&typeof _0x520008['limit']===_0x3733('0x1d');var _0x79ae75=_0x1fd598[_0x3733('0x1e')];var _0xd0f743=_0x607186?0x0:_0x520008['offset'];var _0x24a91e=_0x607186?_0x1fd598[_0x3733('0x1e')]:_0x520008[_0x3733('0x1c')]+_0x520008[_0x3733('0x1f')];var _0x981f37;if(_0x24a91e>=_0x79ae75){_0x24a91e=_0x79ae75;_0x981f37=0xc8;}else{_0x981f37=0xce;}_0x46a03e[_0x3733('0x1a')](_0x981f37);return _0x46a03e[_0x3733('0x20')](_0x3733('0x21'),_0xd0f743+'-'+_0x24a91e+'/'+_0x79ae75)[_0x3733('0x1b')](_0x1fd598);}return null;};}function patchUpdates(_0x48e182){return function(_0x92539){try{jsonpatch[_0x3733('0x22')](_0x92539,_0x48e182,!![]);}catch(_0x168fb5){return BPromise['reject'](_0x168fb5);}return _0x92539[_0x3733('0x23')]();};}function saveUpdates(_0x2fee60,_0x425495){return function(_0xab24eb){if(_0xab24eb){return _0xab24eb[_0x3733('0x24')](_0x2fee60)[_0x3733('0x25')](function(_0x81016){return _0x81016;});}return null;};}function removeEntity(_0x48826c,_0x3187a3){return function(_0x483904){if(_0x483904){return _0x483904[_0x3733('0x26')]()[_0x3733('0x25')](function(){var _0x24512a=_0x483904[_0x3733('0x27')]({'plain':!![]});var _0x3f77d0=_0x3733('0x28');return db[_0x3733('0x29')][_0x3733('0x26')]({'where':{'type':_0x3f77d0,'resourceId':_0x24512a['id']}})[_0x3733('0x25')](function(){return _0x483904;});})['then'](function(){_0x48826c[_0x3733('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x512a98,_0x46ee12){return function(_0x12169e){if(!_0x12169e){_0x512a98[_0x3733('0x19')](0x194);}return _0x12169e;};}function handleError(_0x4a2801,_0xe68681){_0xe68681=_0xe68681||0x1f4;return function(_0x375dc2){logger[_0x3733('0x2a')](_0x375dc2[_0x3733('0x2b')]);if(_0x375dc2[_0x3733('0x2c')]){delete _0x375dc2[_0x3733('0x2c')];}_0x4a2801[_0x3733('0x1a')](_0xe68681)['send'](_0x375dc2);};}exports[_0x3733('0x2d')]=function(_0x15cf54,_0x414f69){var _0x934ddc={},_0x4794fd={},_0x5ce0e6={'count':0x0,'rows':[]};var _0x2fef61=_['map'](db[_0x3733('0x2e')]['rawAttributes'],function(_0x10ac22){return{'name':_0x10ac22[_0x3733('0x2f')],'type':_0x10ac22[_0x3733('0x30')][_0x3733('0x31')]};});_0x4794fd[_0x3733('0x32')]=_[_0x3733('0x33')](_0x2fef61,_0x3733('0x2c'));_0x4794fd[_0x3733('0x34')]=_['keys'](_0x15cf54[_0x3733('0x34')]);_0x4794fd[_0x3733('0x35')]=_[_0x3733('0x36')](_0x4794fd[_0x3733('0x32')],_0x4794fd[_0x3733('0x34')]);_0x934ddc[_0x3733('0x37')]=_[_0x3733('0x36')](_0x4794fd[_0x3733('0x32')],qs[_0x3733('0x38')](_0x15cf54[_0x3733('0x34')][_0x3733('0x38')]));_0x934ddc[_0x3733('0x37')]=_0x934ddc[_0x3733('0x37')][_0x3733('0x39')]?_0x934ddc[_0x3733('0x37')]:_0x4794fd['model'];if(!_0x15cf54[_0x3733('0x34')][_0x3733('0x3a')](_0x3733('0x3b'))){_0x934ddc[_0x3733('0x1f')]=qs[_0x3733('0x1f')](_0x15cf54['query'][_0x3733('0x1f')]);_0x934ddc['offset']=qs[_0x3733('0x1c')](_0x15cf54[_0x3733('0x34')][_0x3733('0x1c')]);}_0x934ddc['order']=qs[_0x3733('0x3c')](_0x15cf54['query'][_0x3733('0x3c')]);_0x934ddc[_0x3733('0x3d')]=qs['filters'](_[_0x3733('0x3e')](_0x15cf54[_0x3733('0x34')],_0x4794fd[_0x3733('0x35')]),_0x2fef61);if(_0x15cf54['query'][_0x3733('0x3f')]){_0x934ddc[_0x3733('0x3d')]=_[_0x3733('0x40')](_0x934ddc[_0x3733('0x3d')],{'$or':_[_0x3733('0x33')](_0x2fef61,function(_0x81b214){if(_0x81b214['type']!==_0x3733('0x41')){var _0x499519={};_0x499519[_0x81b214['name']]={'$like':'%'+_0x15cf54[_0x3733('0x34')][_0x3733('0x3f')]+'%'};return _0x499519;}})});}_0x934ddc=_[_0x3733('0x40')]({},_0x934ddc,_0x15cf54[_0x3733('0x42')]);var _0x1b310f={'where':_0x934ddc['where']};return db[_0x3733('0x2e')]['count'](_0x1b310f)['then'](function(_0x358263){_0x5ce0e6[_0x3733('0x1e')]=_0x358263;if(_0x15cf54[_0x3733('0x34')][_0x3733('0x43')]){_0x934ddc[_0x3733('0x44')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x934ddc);})[_0x3733('0x25')](function(_0x3b0f86){_0x5ce0e6['rows']=_0x3b0f86;return _0x5ce0e6;})['then'](respondWithFilteredResult(_0x414f69,_0x934ddc))['catch'](handleError(_0x414f69,null));};exports['show']=function(_0x4d1f81,_0x2d0cfd){var _0x5c6846={'raw':![],'where':{'id':_0x4d1f81['params']['id']}},_0x5032ae={};_0x5032ae['model']=_[_0x3733('0x45')](db[_0x3733('0x2e')][_0x3733('0x46')]);_0x5032ae['query']=_[_0x3733('0x45')](_0x4d1f81[_0x3733('0x34')]);_0x5032ae[_0x3733('0x35')]=_['intersection'](_0x5032ae[_0x3733('0x32')],_0x5032ae[_0x3733('0x34')]);_0x5c6846[_0x3733('0x37')]=_[_0x3733('0x36')](_0x5032ae['model'],qs[_0x3733('0x38')](_0x4d1f81[_0x3733('0x34')]['fields']));_0x5c6846['attributes']=_0x5c6846['attributes'][_0x3733('0x39')]?_0x5c6846[_0x3733('0x37')]:_0x5032ae[_0x3733('0x32')];if(_0x4d1f81[_0x3733('0x34')][_0x3733('0x43')]){_0x5c6846['include']=[{'all':!![]}];}_0x5c6846=_[_0x3733('0x40')]({},_0x5c6846,_0x4d1f81[_0x3733('0x42')]);return db['VoiceChanSpy']['find'](_0x5c6846)[_0x3733('0x25')](handleEntityNotFound(_0x2d0cfd,null))['then'](respondWithResult(_0x2d0cfd,null))[_0x3733('0x47')](handleError(_0x2d0cfd,null));};exports[_0x3733('0x48')]=function(_0x10bdd9,_0xff007b){return db['VoiceChanSpy']['create'](_0x10bdd9[_0x3733('0x49')],{})['then'](function(_0x4014d8){var _0x4ade13=_0x10bdd9[_0x3733('0x4a')]['get']({'plain':!![]});if(!_0x4ade13)throw new Error(_0x3733('0x4b'));if(_0x4ade13['role']===_0x3733('0x4a')){var _0x4924c2=_0x4014d8[_0x3733('0x27')]({'plain':!![]});var _0x525d63=_0x3733('0x28');return db[_0x3733('0x4c')][_0x3733('0x4d')]({'where':{'name':_0x525d63,'userProfileId':_0x4ade13[_0x3733('0x4e')]},'raw':!![]})[_0x3733('0x25')](function(_0x18fde2){if(_0x18fde2&&_0x18fde2['autoAssociation']===0x0){return db[_0x3733('0x29')][_0x3733('0x48')]({'name':_0x4924c2[_0x3733('0x2c')],'resourceId':_0x4924c2['id'],'type':_0x18fde2[_0x3733('0x2c')],'sectionId':_0x18fde2['id']},{})[_0x3733('0x25')](function(){return _0x4014d8;});}else{return _0x4014d8;}})[_0x3733('0x47')](function(_0x3f0e22){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f0e22);throw _0x3f0e22;});}return _0x4014d8;})[_0x3733('0x25')](respondWithResult(_0xff007b,0xc9))['catch'](handleError(_0xff007b,null));};exports[_0x3733('0x24')]=function(_0x459df8,_0xc44dad){if(_0x459df8[_0x3733('0x49')]['id']){delete _0x459df8['body']['id'];}return db[_0x3733('0x2e')][_0x3733('0x4d')]({'where':{'id':_0x459df8[_0x3733('0x4f')]['id']}})[_0x3733('0x25')](handleEntityNotFound(_0xc44dad,null))['then'](saveUpdates(_0x459df8[_0x3733('0x49')],null))[_0x3733('0x25')](respondWithResult(_0xc44dad,null))[_0x3733('0x47')](handleError(_0xc44dad,null));};exports[_0x3733('0x26')]=function(_0x2a47c3,_0x2617d1){return db[_0x3733('0x2e')][_0x3733('0x4d')]({'where':{'id':_0x2a47c3[_0x3733('0x4f')]['id']}})[_0x3733('0x25')](handleEntityNotFound(_0x2617d1,null))[_0x3733('0x25')](removeEntity(_0x2617d1,null))['catch'](handleError(_0x2617d1,null));}; \ No newline at end of file +var _0x851d=['merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','rawAttributes','length','find','create','body','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','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','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','get','ChanSpies','UserProfileResource','then','end','error','stack','name','send','index','map','VoiceChanSpy','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x27c67a,_0x1a45b5){var _0x19b96e=function(_0x251ebe){while(--_0x251ebe){_0x27c67a['push'](_0x27c67a['shift']());}};_0x19b96e(++_0x1a45b5);}(_0x851d,0x69));var _0xd851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd851('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd851('0x1'));var jsonpatch=require(_0xd851('0x2'));var rp=require('request-promise');var moment=require(_0xd851('0x3'));var BPromise=require(_0xd851('0x4'));var Mustache=require(_0xd851('0x5'));var util=require(_0xd851('0x6'));var path=require(_0xd851('0x7'));var sox=require(_0xd851('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd851('0x9'));var _=require(_0xd851('0xa'));var squel=require(_0xd851('0xb'));var crypto=require(_0xd851('0xc'));var jsforce=require(_0xd851('0xd'));var deskjs=require(_0xd851('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd851('0xf'));var Papa=require('papaparse');var Redis=require(_0xd851('0x10'));var authService=require(_0xd851('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd851('0x12'));var hardwareService=require(_0xd851('0x13'));var logger=require(_0xd851('0x14'))(_0xd851('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd851('0x16'));var db=require(_0xd851('0x17'))['db'];function respondWithStatusCode(_0x173c88,_0x1188d5){_0x1188d5=_0x1188d5||0xcc;return function(_0x5a01bf){if(_0x5a01bf){return _0x173c88[_0xd851('0x18')](_0x1188d5);}return _0x173c88[_0xd851('0x19')](_0x1188d5)['end']();};}function respondWithResult(_0x399128,_0x2705fd){_0x2705fd=_0x2705fd||0xc8;return function(_0x237dda){if(_0x237dda){return _0x399128['status'](_0x2705fd)[_0xd851('0x1a')](_0x237dda);}};}function respondWithFilteredResult(_0x370ad3,_0xb26cf1){return function(_0x1e2ee7){if(_0x1e2ee7){var _0x1b3d4c=typeof _0xb26cf1[_0xd851('0x1b')]==='undefined'&&typeof _0xb26cf1[_0xd851('0x1c')]===_0xd851('0x1d');var _0x1f4f98=_0x1e2ee7[_0xd851('0x1e')];var _0x12b309=_0x1b3d4c?0x0:_0xb26cf1[_0xd851('0x1b')];var _0x3559a1=_0x1b3d4c?_0x1e2ee7['count']:_0xb26cf1['offset']+_0xb26cf1[_0xd851('0x1c')];var _0x8ddf05;if(_0x3559a1>=_0x1f4f98){_0x3559a1=_0x1f4f98;_0x8ddf05=0xc8;}else{_0x8ddf05=0xce;}_0x370ad3[_0xd851('0x19')](_0x8ddf05);return _0x370ad3[_0xd851('0x1f')](_0xd851('0x20'),_0x12b309+'-'+_0x3559a1+'/'+_0x1f4f98)[_0xd851('0x1a')](_0x1e2ee7);}return null;};}function patchUpdates(_0x8585e5){return function(_0x239356){try{jsonpatch[_0xd851('0x21')](_0x239356,_0x8585e5,!![]);}catch(_0x46773f){return BPromise[_0xd851('0x22')](_0x46773f);}return _0x239356[_0xd851('0x23')]();};}function saveUpdates(_0x17cb41,_0x4e38af){return function(_0x404ba4){if(_0x404ba4){return _0x404ba4[_0xd851('0x24')](_0x17cb41)['then'](function(_0x3856a8){return _0x3856a8;});}return null;};}function removeEntity(_0x30177c,_0x2f888e){return function(_0x4bb814){if(_0x4bb814){return _0x4bb814['destroy']()['then'](function(){var _0x35a9b0=_0x4bb814[_0xd851('0x25')]({'plain':!![]});var _0x2f2009=_0xd851('0x26');return db[_0xd851('0x27')]['destroy']({'where':{'type':_0x2f2009,'resourceId':_0x35a9b0['id']}})[_0xd851('0x28')](function(){return _0x4bb814;});})['then'](function(){_0x30177c[_0xd851('0x19')](0xcc)[_0xd851('0x29')]();});}};}function handleEntityNotFound(_0x39f9d4,_0x36457c){return function(_0x337da5){if(!_0x337da5){_0x39f9d4[_0xd851('0x18')](0x194);}return _0x337da5;};}function handleError(_0x4d1fa6,_0x94977e){_0x94977e=_0x94977e||0x1f4;return function(_0x441c27){logger[_0xd851('0x2a')](_0x441c27[_0xd851('0x2b')]);if(_0x441c27[_0xd851('0x2c')]){delete _0x441c27[_0xd851('0x2c')];}_0x4d1fa6[_0xd851('0x19')](_0x94977e)[_0xd851('0x2d')](_0x441c27);};}exports[_0xd851('0x2e')]=function(_0x2ef08d,_0xce3947){var _0x132df8={},_0x598ad4={},_0x15ce59={'count':0x0,'rows':[]};var _0x990498=_[_0xd851('0x2f')](db[_0xd851('0x30')]['rawAttributes'],function(_0x165f79){return{'name':_0x165f79['fieldName'],'type':_0x165f79['type'][_0xd851('0x31')]};});_0x598ad4[_0xd851('0x32')]=_['map'](_0x990498,'name');_0x598ad4[_0xd851('0x33')]=_[_0xd851('0x34')](_0x2ef08d[_0xd851('0x33')]);_0x598ad4[_0xd851('0x35')]=_[_0xd851('0x36')](_0x598ad4['model'],_0x598ad4['query']);_0x132df8[_0xd851('0x37')]=_[_0xd851('0x36')](_0x598ad4[_0xd851('0x32')],qs[_0xd851('0x38')](_0x2ef08d[_0xd851('0x33')][_0xd851('0x38')]));_0x132df8[_0xd851('0x37')]=_0x132df8[_0xd851('0x37')]['length']?_0x132df8['attributes']:_0x598ad4['model'];if(!_0x2ef08d[_0xd851('0x33')][_0xd851('0x39')](_0xd851('0x3a'))){_0x132df8[_0xd851('0x1c')]=qs[_0xd851('0x1c')](_0x2ef08d['query'][_0xd851('0x1c')]);_0x132df8[_0xd851('0x1b')]=qs['offset'](_0x2ef08d[_0xd851('0x33')][_0xd851('0x1b')]);}_0x132df8[_0xd851('0x3b')]=qs[_0xd851('0x3c')](_0x2ef08d['query']['sort']);_0x132df8[_0xd851('0x3d')]=qs['filters'](_[_0xd851('0x3e')](_0x2ef08d[_0xd851('0x33')],_0x598ad4[_0xd851('0x35')]),_0x990498);if(_0x2ef08d['query']['filter']){_0x132df8[_0xd851('0x3d')]=_[_0xd851('0x3f')](_0x132df8[_0xd851('0x3d')],{'$or':_['map'](_0x990498,function(_0x326631){if(_0x326631[_0xd851('0x40')]!==_0xd851('0x41')){var _0x321d6e={};_0x321d6e[_0x326631['name']]={'$like':'%'+_0x2ef08d['query'][_0xd851('0x42')]+'%'};return _0x321d6e;}})});}_0x132df8=_[_0xd851('0x3f')]({},_0x132df8,_0x2ef08d[_0xd851('0x43')]);var _0x5056bc={'where':_0x132df8[_0xd851('0x3d')]};return db[_0xd851('0x30')][_0xd851('0x1e')](_0x5056bc)['then'](function(_0x1ebf20){_0x15ce59[_0xd851('0x1e')]=_0x1ebf20;if(_0x2ef08d[_0xd851('0x33')][_0xd851('0x44')]){_0x132df8[_0xd851('0x45')]=[{'all':!![]}];}return db[_0xd851('0x30')][_0xd851('0x46')](_0x132df8);})[_0xd851('0x28')](function(_0x23dc50){_0x15ce59[_0xd851('0x47')]=_0x23dc50;return _0x15ce59;})[_0xd851('0x28')](respondWithFilteredResult(_0xce3947,_0x132df8))[_0xd851('0x48')](handleError(_0xce3947,null));};exports['show']=function(_0x5e4f40,_0x4fe987){var _0x247bb3={'raw':![],'where':{'id':_0x5e4f40['params']['id']}},_0x273868={};_0x273868[_0xd851('0x32')]=_[_0xd851('0x34')](db[_0xd851('0x30')][_0xd851('0x49')]);_0x273868['query']=_[_0xd851('0x34')](_0x5e4f40[_0xd851('0x33')]);_0x273868[_0xd851('0x35')]=_[_0xd851('0x36')](_0x273868[_0xd851('0x32')],_0x273868['query']);_0x247bb3[_0xd851('0x37')]=_[_0xd851('0x36')](_0x273868[_0xd851('0x32')],qs[_0xd851('0x38')](_0x5e4f40['query'][_0xd851('0x38')]));_0x247bb3[_0xd851('0x37')]=_0x247bb3[_0xd851('0x37')][_0xd851('0x4a')]?_0x247bb3['attributes']:_0x273868['model'];if(_0x5e4f40[_0xd851('0x33')][_0xd851('0x44')]){_0x247bb3[_0xd851('0x45')]=[{'all':!![]}];}_0x247bb3=_[_0xd851('0x3f')]({},_0x247bb3,_0x5e4f40[_0xd851('0x43')]);return db[_0xd851('0x30')][_0xd851('0x4b')](_0x247bb3)[_0xd851('0x28')](handleEntityNotFound(_0x4fe987,null))[_0xd851('0x28')](respondWithResult(_0x4fe987,null))[_0xd851('0x48')](handleError(_0x4fe987,null));};exports[_0xd851('0x4c')]=function(_0x3bcd39,_0x3828fe){return db['VoiceChanSpy'][_0xd851('0x4c')](_0x3bcd39[_0xd851('0x4d')],{})[_0xd851('0x28')](function(_0x38014d){var _0x5b9d03=_0x3bcd39[_0xd851('0x4e')][_0xd851('0x25')]({'plain':!![]});if(!_0x5b9d03)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b9d03['role']===_0xd851('0x4e')){var _0x2d9ecb=_0x38014d['get']({'plain':!![]});var _0x95c37e=_0xd851('0x26');return db[_0xd851('0x4f')][_0xd851('0x4b')]({'where':{'name':_0x95c37e,'userProfileId':_0x5b9d03[_0xd851('0x50')]},'raw':!![]})['then'](function(_0x10cf5b){if(_0x10cf5b&&_0x10cf5b['autoAssociation']===0x0){return db['UserProfileResource'][_0xd851('0x4c')]({'name':_0x2d9ecb[_0xd851('0x2c')],'resourceId':_0x2d9ecb['id'],'type':_0x10cf5b[_0xd851('0x2c')],'sectionId':_0x10cf5b['id']},{})[_0xd851('0x28')](function(){return _0x38014d;});}else{return _0x38014d;}})['catch'](function(_0x4bc500){logger[_0xd851('0x2a')](_0xd851('0x51'),_0x4bc500);throw _0x4bc500;});}return _0x38014d;})['then'](respondWithResult(_0x3828fe,0xc9))[_0xd851('0x48')](handleError(_0x3828fe,null));};exports[_0xd851('0x24')]=function(_0x2b8db2,_0x2478ad){if(_0x2b8db2['body']['id']){delete _0x2b8db2[_0xd851('0x4d')]['id'];}return db[_0xd851('0x30')]['find']({'where':{'id':_0x2b8db2[_0xd851('0x52')]['id']}})[_0xd851('0x28')](handleEntityNotFound(_0x2478ad,null))[_0xd851('0x28')](saveUpdates(_0x2b8db2[_0xd851('0x4d')],null))[_0xd851('0x28')](respondWithResult(_0x2478ad,null))[_0xd851('0x48')](handleError(_0x2478ad,null));};exports[_0xd851('0x53')]=function(_0x129412,_0x1118cc){return db['VoiceChanSpy'][_0xd851('0x4b')]({'where':{'id':_0x129412['params']['id']}})[_0xd851('0x28')](handleEntityNotFound(_0x1118cc,null))[_0xd851('0x28')](removeEntity(_0x1118cc,null))['catch'](handleError(_0x1118cc,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index af5d74f..bb15611 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 _0xcbb6=['record','MixMonitor','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','length','concat','internal','name','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','destroy','bulkCreate','lodash','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xcbb6,0x15a));var _0x6cbb=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xcbb6[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x6cbb('0x0'));var util=require('util');var BPromise=require(_0x6cbb('0x1'));var attributes=require(_0x6cbb('0x2'));var getUserApplications=function(_0x5d6383,_0x25919a,_0x18d5f9){var _0x18a6b6=0x1;var _0x288c01=[];var _0x35a758={'context':_0x25919a[_0x6cbb('0x3')]||_0x6cbb('0x4'),'exten':util[_0x6cbb('0x5')](_0x6cbb('0x6'),_0x5d6383[_0x6cbb('0x7')],_0x18d5f9),'type':_0x6cbb('0x8'),'isApp':![],'ChanSpyId':_0x5d6383['id'],'UserId':_0x25919a['id']};_0x288c01[_0x6cbb('0x9')](_[_0x6cbb('0xa')]({'app':_0x6cbb('0xb'),'appdata':util[_0x6cbb('0x5')](_0x6cbb('0xc'),_0x6cbb('0xd')),'priority':_0x18a6b6++},_0x35a758));if(_0x5d6383[_0x6cbb('0xe')]){_0x288c01[_0x6cbb('0x9')](_[_0x6cbb('0xa')]({'app':_0x6cbb('0xf'),'appdata':util[_0x6cbb('0x5')]('${UNIQUEID}.%s,a',_0x5d6383[_0x6cbb('0x10')]),'priority':_0x18a6b6++},_0x35a758));}if(_0x5d6383[_0x6cbb('0x11')]){_0x288c01[_0x6cbb('0x9')](_[_0x6cbb('0xa')]({'app':_0x6cbb('0x12'),'appdata':_0x5d6383['password'],'priority':_0x18a6b6++},_0x35a758));}_0x288c01[_0x6cbb('0x9')](_[_0x6cbb('0xa')]({'app':_0x6cbb('0x13'),'appdata':util['format'](_0x6cbb('0x14'),_0x25919a['name'],_0x5d6383[_0x6cbb('0x15')]?_0x5d6383[_0x6cbb('0x15')][_0x6cbb('0x16')](''):''),'priority':_0x18a6b6++},_0x35a758));if(_0x5d6383['record']){_0x288c01[_0x6cbb('0x9')](_[_0x6cbb('0xa')]({'app':_0x6cbb('0x17'),'priority':_0x18a6b6++},_0x35a758));}return _0x288c01;};var getChanSpyApplications=function(_0x36fd10,_0x55a37c){var _0x145059=[];for(var _0x52aaba=0x0,_0x48fc6b=0x1;_0x52aaba<_0x55a37c[_0x6cbb('0x18')];_0x52aaba++,_0x48fc6b=0x1){_0x145059=_0x145059[_0x6cbb('0x19')](getUserApplications(_0x36fd10,_0x55a37c[_0x52aaba],_0x55a37c[_0x52aaba][_0x6cbb('0x1a')]));if(_0x55a37c[_0x52aaba][_0x6cbb('0x1a')]!=_0x55a37c[_0x52aaba][_0x6cbb('0x1b')]){_0x145059=_0x145059['concat'](getUserApplications(_0x36fd10,_0x55a37c[_0x52aaba],_0x55a37c[_0x52aaba]['name']));}}return _0x145059;};var getChanSpyPromise=function(_0xa3dbff,_0x2de68b){return new BPromise(function(_0x49c137,_0x3ab551){return _0xa3dbff['User'][_0x6cbb('0x1c')]({'attributes':['id',_0x6cbb('0x1b'),_0x6cbb('0x1a')],'where':{'role':_0x6cbb('0x1d'),'chanspy':!![]},'raw':!![]})[_0x6cbb('0x1e')](function(_0x392154){if(_0x392154){return _0x49c137(getChanSpyApplications(_0x2de68b,_0x392154));}return _0x49c137([]);})[_0x6cbb('0x1f')](function(_0x222345){_0x3ab551(_0x222345);});});};module[_0x6cbb('0x20')]=function(_0x13842e,_0x249670){var _0xb642f7=_0x13842e[_0x6cbb('0x21')];return _0x13842e[_0x6cbb('0x22')](_0x6cbb('0x23'),attributes,{'tableName':_0x6cbb('0x24'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x332e3e,_0x4e6a80,_0x18f68a){return getChanSpyPromise(_0xb642f7,_0x332e3e)['then'](function(_0x1ce543){if(_0x1ce543&&_0x1ce543[_0x6cbb('0x18')]){return _0xb642f7[_0x6cbb('0x25')]['bulkCreate'](_0x1ce543);}})[_0x6cbb('0x1e')](function(){_0x18f68a();})['catch'](function(_0x98931c){_0x18f68a(_0x98931c);});},'afterUpdate':function(_0x3bb82f,_0x36f78e,_0x470fed){return _0xb642f7['VoiceExtension'][_0x6cbb('0x26')]({'where':{'ChanSpyId':_0x3bb82f['id']}})['then'](function(){return getChanSpyPromise(_0xb642f7,_0x3bb82f);})[_0x6cbb('0x1e')](function(_0x40acd8){if(_0x40acd8&&_0x40acd8[_0x6cbb('0x18')]){return _0xb642f7[_0x6cbb('0x25')][_0x6cbb('0x27')](_0x40acd8);}})[_0x6cbb('0x1e')](function(){_0x470fed();})[_0x6cbb('0x1f')](function(_0x12a179){_0x470fed(_0x12a179);});},'afterDestroy':function(_0x3421fe,_0x2bced1,_0x1a4fa1){return _0xb642f7['VoiceExtension'][_0x6cbb('0x26')]({'where':{'ChanSpyId':_0x3421fe['id']}})['then'](function(){_0x1a4fa1();})[_0x6cbb('0x1f')](function(_0x15c873){_0x1a4fa1(_0x15c873);});}}});}; \ No newline at end of file +var _0x83ef=['concat','internal','findAll','agent','then','exports','models','define','VoiceChanSpy','voice_chanspy','catch','VoiceExtension','destroy','bulkCreate','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','Set','record','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','push','Authenticate','password','name','options','join','length'];(function(_0x5dc539,_0x16480d){var _0x38a440=function(_0x4344e8){while(--_0x4344e8){_0x5dc539['push'](_0x5dc539['shift']());}};_0x38a440(++_0x16480d);}(_0x83ef,0x1ef));var _0xf83e=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x83ef[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0xf83e('0x0'));var BPromise=require(_0xf83e('0x1'));var attributes=require(_0xf83e('0x2'));var getUserApplications=function(_0x189c8b,_0x191240,_0x15445e){var _0x5e86b1=0x1;var _0x44090e=[];var _0xdce4a5={'context':_0x191240[_0xf83e('0x3')]||_0xf83e('0x4'),'exten':util[_0xf83e('0x5')](_0xf83e('0x6'),_0x189c8b[_0xf83e('0x7')],_0x15445e),'type':_0xf83e('0x8'),'isApp':![],'ChanSpyId':_0x189c8b['id'],'UserId':_0x191240['id']};_0x44090e['push'](_['merge']({'app':_0xf83e('0x9'),'appdata':util[_0xf83e('0x5')]('CDR(type)=%s','chanspy'),'priority':_0x5e86b1++},_0xdce4a5));if(_0x189c8b[_0xf83e('0xa')]){_0x44090e['push'](_[_0xf83e('0xb')]({'app':_0xf83e('0xc'),'appdata':util[_0xf83e('0x5')](_0xf83e('0xd'),_0x189c8b[_0xf83e('0xe')]),'priority':_0x5e86b1++},_0xdce4a5));}if(_0x189c8b[_0xf83e('0xf')]){_0x44090e[_0xf83e('0x10')](_[_0xf83e('0xb')]({'app':_0xf83e('0x11'),'appdata':_0x189c8b[_0xf83e('0x12')],'priority':_0x5e86b1++},_0xdce4a5));}_0x44090e[_0xf83e('0x10')](_[_0xf83e('0xb')]({'app':'ChanSpy','appdata':util[_0xf83e('0x5')]('SIP/%s,%s',_0x191240[_0xf83e('0x13')],_0x189c8b[_0xf83e('0x14')]?_0x189c8b[_0xf83e('0x14')][_0xf83e('0x15')](''):''),'priority':_0x5e86b1++},_0xdce4a5));if(_0x189c8b[_0xf83e('0xa')]){_0x44090e['push'](_['merge']({'app':'StopMixMonitor','priority':_0x5e86b1++},_0xdce4a5));}return _0x44090e;};var getChanSpyApplications=function(_0x3dbdd3,_0x5da457){var _0x470c9d=[];for(var _0x18a43c=0x0,_0x12ae2a=0x1;_0x18a43c<_0x5da457[_0xf83e('0x16')];_0x18a43c++,_0x12ae2a=0x1){_0x470c9d=_0x470c9d[_0xf83e('0x17')](getUserApplications(_0x3dbdd3,_0x5da457[_0x18a43c],_0x5da457[_0x18a43c][_0xf83e('0x18')]));if(_0x5da457[_0x18a43c][_0xf83e('0x18')]!=_0x5da457[_0x18a43c]['name']){_0x470c9d=_0x470c9d[_0xf83e('0x17')](getUserApplications(_0x3dbdd3,_0x5da457[_0x18a43c],_0x5da457[_0x18a43c][_0xf83e('0x13')]));}}return _0x470c9d;};var getChanSpyPromise=function(_0x3b930f,_0x4f8315){return new BPromise(function(_0x1d43fe,_0x473d20){return _0x3b930f['User'][_0xf83e('0x19')]({'attributes':['id','name',_0xf83e('0x18')],'where':{'role':_0xf83e('0x1a'),'chanspy':!![]},'raw':!![]})[_0xf83e('0x1b')](function(_0xde13a5){if(_0xde13a5){return _0x1d43fe(getChanSpyApplications(_0x4f8315,_0xde13a5));}return _0x1d43fe([]);})['catch'](function(_0x2b653f){_0x473d20(_0x2b653f);});});};module[_0xf83e('0x1c')]=function(_0x1f4cb8,_0x213a13){var _0x279934=_0x1f4cb8[_0xf83e('0x1d')];return _0x1f4cb8[_0xf83e('0x1e')](_0xf83e('0x1f'),attributes,{'tableName':_0xf83e('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x47bdda,_0x2e48bf,_0x129370){return getChanSpyPromise(_0x279934,_0x47bdda)['then'](function(_0x476a1b){if(_0x476a1b&&_0x476a1b[_0xf83e('0x16')]){return _0x279934['VoiceExtension']['bulkCreate'](_0x476a1b);}})[_0xf83e('0x1b')](function(){_0x129370();})[_0xf83e('0x21')](function(_0x4cbfbc){_0x129370(_0x4cbfbc);});},'afterUpdate':function(_0x3cc5a5,_0x2cb187,_0x4383c6){return _0x279934[_0xf83e('0x22')][_0xf83e('0x23')]({'where':{'ChanSpyId':_0x3cc5a5['id']}})['then'](function(){return getChanSpyPromise(_0x279934,_0x3cc5a5);})[_0xf83e('0x1b')](function(_0x5bd78e){if(_0x5bd78e&&_0x5bd78e[_0xf83e('0x16')]){return _0x279934[_0xf83e('0x22')][_0xf83e('0x24')](_0x5bd78e);}})[_0xf83e('0x1b')](function(){_0x4383c6();})[_0xf83e('0x21')](function(_0x1355bf){_0x4383c6(_0x1355bf);});},'afterDestroy':function(_0x4ebf0c,_0x181562,_0x461835){return _0x279934[_0xf83e('0x22')][_0xf83e('0x23')]({'where':{'ChanSpyId':_0x4ebf0c['id']}})[_0xf83e('0x1b')](function(){_0x461835();})[_0xf83e('0x21')](function(_0x5add7f){_0x461835(_0x5add7f);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index a306095..3891796 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 _0xcffe=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x3c28c0,_0x1cb29d){var _0x12cc9f=function(_0x33d0f7){while(--_0x33d0f7){_0x3c28c0['push'](_0x3c28c0['shift']());}};_0x12cc9f(++_0x1cb29d);}(_0xcffe,0x1a1));var _0xecff=function(_0x7aaac8,_0x3a4233){_0x7aaac8=_0x7aaac8-0x0;var _0x4a8013=_0xcffe[_0x7aaac8];return _0x4a8013;};'use strict';var _=require(_0xecff('0x0'));var util=require(_0xecff('0x1'));var moment=require(_0xecff('0x2'));var BPromise=require(_0xecff('0x3'));var rs=require(_0xecff('0x4'));var fs=require('fs');var Redis=require(_0xecff('0x5'));var db=require(_0xecff('0x6'))['db'];var utils=require(_0xecff('0x7'));var logger=require(_0xecff('0x8'))(_0xecff('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xecff('0xa')][_0xecff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e2fa9,_0x38a8f6,_0x50c98b){return new BPromise(function(_0x298c19,_0x1f7386){return client['request'](_0x2e2fa9,_0x50c98b)[_0xecff('0xc')](function(_0x3eefb9){logger[_0xecff('0xd')](_0xecff('0xe'),_0x38a8f6,_0xecff('0xf'));logger['debug'](_0xecff('0x10'),_0x38a8f6,_0xecff('0xf'),JSON[_0xecff('0x11')](_0x3eefb9));if(_0x3eefb9[_0xecff('0x12')]){if(_0x3eefb9[_0xecff('0x12')][_0xecff('0x13')]===0x1f4){logger[_0xecff('0x12')](_0xecff('0xe'),_0x38a8f6,_0x3eefb9[_0xecff('0x12')][_0xecff('0x14')]);return _0x1f7386(_0x3eefb9[_0xecff('0x12')][_0xecff('0x14')]);}logger[_0xecff('0x12')](_0xecff('0xe'),_0x38a8f6,_0x3eefb9['error']['message']);return _0x298c19(_0x3eefb9[_0xecff('0x12')][_0xecff('0x14')]);}else{logger['info'](_0xecff('0xe'),_0x38a8f6,_0xecff('0xf'));_0x298c19(_0x3eefb9[_0xecff('0x15')]['message']);}})['catch'](function(_0x24abef){logger[_0xecff('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x38a8f6,_0x24abef);_0x1f7386(_0x24abef);});});} \ No newline at end of file +var _0xf403=['error','code','VoiceChanSpy,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf403,0x1d3));var _0x3f40=function(_0x31fb4d,_0x3b02bb){_0x31fb4d=_0x31fb4d-0x0;var _0x2f9b31=_0xf403[_0x31fb4d];return _0x2f9b31;};'use strict';var _=require(_0x3f40('0x0'));var util=require('util');var moment=require(_0x3f40('0x1'));var BPromise=require(_0x3f40('0x2'));var rs=require(_0x3f40('0x3'));var fs=require('fs');var Redis=require(_0x3f40('0x4'));var db=require(_0x3f40('0x5'))['db'];var utils=require(_0x3f40('0x6'));var logger=require(_0x3f40('0x7'))(_0x3f40('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3f40('0x9')][_0x3f40('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24fb9e,_0x1f21fa,_0x5878f9){return new BPromise(function(_0x1dffe8,_0x4c1694){return client['request'](_0x24fb9e,_0x5878f9)[_0x3f40('0xb')](function(_0xb4a314){logger[_0x3f40('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x1f21fa,'request\x20sent');logger[_0x3f40('0xd')](_0x3f40('0xe'),_0x1f21fa,_0x3f40('0xf'),JSON['stringify'](_0xb4a314));if(_0xb4a314[_0x3f40('0x10')]){if(_0xb4a314[_0x3f40('0x10')][_0x3f40('0x11')]===0x1f4){logger['error'](_0x3f40('0x12'),_0x1f21fa,_0xb4a314['error'][_0x3f40('0x13')]);return _0x4c1694(_0xb4a314[_0x3f40('0x10')][_0x3f40('0x13')]);}logger[_0x3f40('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x1f21fa,_0xb4a314[_0x3f40('0x10')][_0x3f40('0x13')]);return _0x1dffe8(_0xb4a314[_0x3f40('0x10')][_0x3f40('0x13')]);}else{logger[_0x3f40('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x1f21fa,_0x3f40('0xf'));_0x1dffe8(_0xb4a314[_0x3f40('0x14')]['message']);}})['catch'](function(_0x54f596){logger[_0x3f40('0x10')](_0x3f40('0x12'),_0x1f21fa,_0x54f596);_0x4c1694(_0x54f596);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index f6c8e43..5ccb097 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 _0x6766=['index','get','/:id','post','put','delete','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated'];(function(_0x41d952,_0x16e3c5){var _0x14b0d8=function(_0x54a567){while(--_0x54a567){_0x41d952['push'](_0x41d952['shift']());}};_0x14b0d8(++_0x16e3c5);}(_0x6766,0x197));var _0x6676=function(_0x568a61,_0x2124f8){_0x568a61=_0x568a61-0x0;var _0x334c3b=_0x6766[_0x568a61];return _0x334c3b;};'use strict';var multer=require(_0x6676('0x0'));var util=require(_0x6676('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6676('0x2'));var router=express[_0x6676('0x3')]();var fs_extra=require(_0x6676('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6676('0x5'));var config=require(_0x6676('0x6'));var controller=require(_0x6676('0x7'));router['get']('/',auth[_0x6676('0x8')](),controller[_0x6676('0x9')]);router[_0x6676('0xa')](_0x6676('0xb'),auth[_0x6676('0x8')](),controller['show']);router[_0x6676('0xc')]('/',auth[_0x6676('0x8')](),controller['create']);router[_0x6676('0xd')](_0x6676('0xb'),auth[_0x6676('0x8')](),controller['update']);router[_0x6676('0xe')](_0x6676('0xb'),auth[_0x6676('0x8')](),controller['destroy']);module[_0x6676('0xf')]=router; \ No newline at end of file +var _0xce4f=['put','/:id','update','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceContext.controller','get','index','isAuthenticated','show','post','create'];(function(_0x450bf9,_0x1895de){var _0x268350=function(_0xebafa7){while(--_0xebafa7){_0x450bf9['push'](_0x450bf9['shift']());}};_0x268350(++_0x1895de);}(_0xce4f,0x125));var _0xfce4=function(_0x261934,_0x530dc3){_0x261934=_0x261934-0x0;var _0x697c97=_0xce4f[_0x261934];return _0x697c97;};'use strict';var multer=require('multer');var util=require(_0xfce4('0x0'));var path=require('path');var timeout=require(_0xfce4('0x1'));var express=require(_0xfce4('0x2'));var router=express[_0xfce4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfce4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfce4('0x5'));var controller=require(_0xfce4('0x6'));router[_0xfce4('0x7')]('/',auth['isAuthenticated'](),controller[_0xfce4('0x8')]);router['get']('/:id',auth[_0xfce4('0x9')](),controller[_0xfce4('0xa')]);router[_0xfce4('0xb')]('/',auth['isAuthenticated'](),controller[_0xfce4('0xc')]);router[_0xfce4('0xd')](_0xfce4('0xe'),auth[_0xfce4('0x9')](),controller[_0xfce4('0xf')]);router[_0xfce4('0x10')](_0xfce4('0xe'),auth[_0xfce4('0x9')](),controller[_0xfce4('0x11')]);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 aaa9cc3..286ceee 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 _0xdcb8=['BOOLEAN','name'];(function(_0x44a571,_0x45b4e8){var _0x536c00=function(_0x275714){while(--_0x275714){_0x44a571['push'](_0x44a571['shift']());}};_0x536c00(++_0x45b4e8);}(_0xdcb8,0x145));var _0x8dcb=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xdcb8[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x8dcb('0x0')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x8dcb('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1c2a=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0x1c2a,0xb6));var _0xa1c2=function(_0x5ccaea,_0x5f118a){_0x5ccaea=_0x5ccaea-0x0;var _0x43faa0=_0x1c2a[_0x5ccaea];return _0x43faa0;};'use strict';var Sequelize=require(_0xa1c2('0x0'));module[_0xa1c2('0x1')]={'name':{'type':Sequelize[_0xa1c2('0x2')],'unique':_0xa1c2('0x3')},'description':{'type':Sequelize[_0xa1c2('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xa1c2('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index c40d3e7..16d37a1 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 _0xc72f=['writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','chan_sip.so','render','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','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','client','http','request','then','info','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','Contexts','stack','name','map','VoiceContext','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','options','findAll','show','params','includeAll','include','find','create','body','readFileSync','root','server/files/templates/context.ejs','utf8'];(function(_0x43da23,_0x38d7c4){var _0x42a792=function(_0x16af1e){while(--_0x16af1e){_0x43da23['push'](_0x43da23['shift']());}};_0x42a792(++_0x38d7c4);}(_0xc72f,0x1a6));var _0xfc72=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0xc72f[_0x486f4a];return _0x135d99;};'use strict';var emlformat=require(_0xfc72('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfc72('0x1'));var rp=require(_0xfc72('0x2'));var moment=require(_0xfc72('0x3'));var BPromise=require(_0xfc72('0x4'));var Mustache=require(_0xfc72('0x5'));var util=require(_0xfc72('0x6'));var path=require(_0xfc72('0x7'));var sox=require('sox');var csv=require(_0xfc72('0x8'));var ejs=require(_0xfc72('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfc72('0xa'));var crypto=require(_0xfc72('0xb'));var jsforce=require(_0xfc72('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfc72('0xd'));var Papa=require(_0xfc72('0xe'));var Redis=require(_0xfc72('0xf'));var authService=require(_0xfc72('0x10'));var qs=require(_0xfc72('0x11'));var as=require(_0xfc72('0x12'));var hardwareService=require(_0xfc72('0x13'));var logger=require(_0xfc72('0x14'))('api');var utils=require(_0xfc72('0x15'));var config=require(_0xfc72('0x16'));var licenseUtil=require(_0xfc72('0x17'));var db=require(_0xfc72('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xfc72('0x19')][_0xfc72('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x42e188,_0x3d035e,_0x492be7,_0x195641){return new BPromise(function(_0x51194d,_0x5e9166){var _0x3a8c77=_0x195641||client;return _0x3a8c77[_0xfc72('0x1b')](_0x42e188,_0x492be7)[_0xfc72('0x1c')](function(_0x56ed8f){logger[_0xfc72('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x3d035e,_0xfc72('0x1e'));logger['debug'](_0xfc72('0x1f'),_0x3d035e,'request\x20sent',JSON['stringify'](_0x56ed8f));if(_0x56ed8f[_0xfc72('0x20')]){if(_0x56ed8f['error'][_0xfc72('0x21')]===0x1f4){logger[_0xfc72('0x20')](_0xfc72('0x22'),_0x3d035e,_0x56ed8f[_0xfc72('0x20')][_0xfc72('0x23')]);return _0x5e9166(_0x56ed8f[_0xfc72('0x20')][_0xfc72('0x23')]);}logger[_0xfc72('0x20')]('VoiceContext,\x20%s,\x20%s',_0x3d035e,_0x56ed8f[_0xfc72('0x20')]['message']);return _0x51194d(_0x56ed8f['error'][_0xfc72('0x23')]);}else{logger[_0xfc72('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x3d035e,_0xfc72('0x1e'));_0x51194d(_0x56ed8f[_0xfc72('0x24')][_0xfc72('0x23')]);}})[_0xfc72('0x25')](function(_0x2be274){logger['error']('VoiceContext,\x20%s,\x20%s',_0x3d035e,_0x2be274);_0x5e9166(_0x2be274);});});}function respondWithStatusCode(_0x1521f3,_0x1ff411){_0x1ff411=_0x1ff411||0xcc;return function(_0x365ff7){if(_0x365ff7){return _0x1521f3[_0xfc72('0x26')](_0x1ff411);}return _0x1521f3['status'](_0x1ff411)[_0xfc72('0x27')]();};}function respondWithResult(_0x21f9d0,_0x59159b){_0x59159b=_0x59159b||0xc8;return function(_0x48305b){if(_0x48305b){return _0x21f9d0[_0xfc72('0x28')](_0x59159b)[_0xfc72('0x29')](_0x48305b);}};}function respondWithFilteredResult(_0x322d9c,_0x58e265){return function(_0x556310){if(_0x556310){var _0x87cf7a=typeof _0x58e265[_0xfc72('0x2a')]===_0xfc72('0x2b')&&typeof _0x58e265[_0xfc72('0x2c')]===_0xfc72('0x2b');var _0x574b5d=_0x556310[_0xfc72('0x2d')];var _0x3d5429=_0x87cf7a?0x0:_0x58e265[_0xfc72('0x2a')];var _0x1c958f=_0x87cf7a?_0x556310[_0xfc72('0x2d')]:_0x58e265['offset']+_0x58e265[_0xfc72('0x2c')];var _0x3590b6;if(_0x1c958f>=_0x574b5d){_0x1c958f=_0x574b5d;_0x3590b6=0xc8;}else{_0x3590b6=0xce;}_0x322d9c[_0xfc72('0x28')](_0x3590b6);return _0x322d9c[_0xfc72('0x2e')](_0xfc72('0x2f'),_0x3d5429+'-'+_0x1c958f+'/'+_0x574b5d)[_0xfc72('0x29')](_0x556310);}return null;};}function patchUpdates(_0x4c3886){return function(_0xb2633e){try{jsonpatch[_0xfc72('0x30')](_0xb2633e,_0x4c3886,!![]);}catch(_0x1a3d10){return BPromise[_0xfc72('0x31')](_0x1a3d10);}return _0xb2633e[_0xfc72('0x32')]();};}function saveUpdates(_0x2b6dec,_0x1a62a6){return function(_0x2d8c84){if(_0x2d8c84){return _0x2d8c84[_0xfc72('0x33')](_0x2b6dec)[_0xfc72('0x1c')](function(_0x43ac43){return _0x43ac43;});}return null;};}function removeEntity(_0x43cc80,_0x31e388){return function(_0x305eb0){if(_0x305eb0){return _0x305eb0[_0xfc72('0x34')]()[_0xfc72('0x1c')](function(){var _0x1b454e=_0x305eb0['get']({'plain':!![]});var _0x3704c7=_0xfc72('0x35');return db['UserProfileResource']['destroy']({'where':{'type':_0x3704c7,'resourceId':_0x1b454e['id']}})[_0xfc72('0x1c')](function(){return _0x305eb0;});})['then'](function(){_0x43cc80['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb715b6,_0x3c1d39){return function(_0xeebf13){if(!_0xeebf13){_0xb715b6['sendStatus'](0x194);}return _0xeebf13;};}function handleError(_0x45915a,_0x330e3c){_0x330e3c=_0x330e3c||0x1f4;return function(_0x5c1097){logger['error'](_0x5c1097[_0xfc72('0x36')]);if(_0x5c1097[_0xfc72('0x37')]){delete _0x5c1097[_0xfc72('0x37')];}_0x45915a[_0xfc72('0x28')](_0x330e3c)['send'](_0x5c1097);};}exports['index']=function(_0x8cf0a6,_0x4ecfe8){var _0x32e54c={},_0x5b82f4={},_0x507708={'count':0x0,'rows':[]};var _0x13b114=_[_0xfc72('0x38')](db[_0xfc72('0x39')][_0xfc72('0x3a')],function(_0xedbb26){return{'name':_0xedbb26[_0xfc72('0x3b')],'type':_0xedbb26[_0xfc72('0x3c')]['key']};});_0x5b82f4['model']=_[_0xfc72('0x38')](_0x13b114,'name');_0x5b82f4[_0xfc72('0x3d')]=_[_0xfc72('0x3e')](_0x8cf0a6[_0xfc72('0x3d')]);_0x5b82f4[_0xfc72('0x3f')]=_[_0xfc72('0x40')](_0x5b82f4[_0xfc72('0x41')],_0x5b82f4['query']);_0x32e54c[_0xfc72('0x42')]=_['intersection'](_0x5b82f4[_0xfc72('0x41')],qs[_0xfc72('0x43')](_0x8cf0a6[_0xfc72('0x3d')][_0xfc72('0x43')]));_0x32e54c[_0xfc72('0x42')]=_0x32e54c[_0xfc72('0x42')][_0xfc72('0x44')]?_0x32e54c[_0xfc72('0x42')]:_0x5b82f4['model'];if(!_0x8cf0a6[_0xfc72('0x3d')]['hasOwnProperty']('nolimit')){_0x32e54c[_0xfc72('0x2c')]=qs[_0xfc72('0x2c')](_0x8cf0a6['query']['limit']);_0x32e54c['offset']=qs[_0xfc72('0x2a')](_0x8cf0a6[_0xfc72('0x3d')][_0xfc72('0x2a')]);}_0x32e54c[_0xfc72('0x45')]=qs[_0xfc72('0x46')](_0x8cf0a6[_0xfc72('0x3d')]['sort']);_0x32e54c[_0xfc72('0x47')]=qs['filters'](_['pick'](_0x8cf0a6[_0xfc72('0x3d')],_0x5b82f4[_0xfc72('0x3f')]),_0x13b114);if(_0x8cf0a6[_0xfc72('0x3d')][_0xfc72('0x48')]){_0x32e54c[_0xfc72('0x47')]=_[_0xfc72('0x49')](_0x32e54c[_0xfc72('0x47')],{'$or':_[_0xfc72('0x38')](_0x13b114,function(_0xdcddd9){if(_0xdcddd9['type']!==_0xfc72('0x4a')){var _0x1bc95d={};_0x1bc95d[_0xdcddd9[_0xfc72('0x37')]]={'$like':'%'+_0x8cf0a6[_0xfc72('0x3d')][_0xfc72('0x48')]+'%'};return _0x1bc95d;}})});}_0x32e54c=_['merge']({},_0x32e54c,_0x8cf0a6[_0xfc72('0x4b')]);var _0x3f6c96={'where':_0x32e54c['where']};return db[_0xfc72('0x39')][_0xfc72('0x2d')](_0x3f6c96)['then'](function(_0x5c5967){_0x507708[_0xfc72('0x2d')]=_0x5c5967;if(_0x8cf0a6[_0xfc72('0x3d')]['includeAll']){_0x32e54c['include']=[{'all':!![]}];}return db[_0xfc72('0x39')][_0xfc72('0x4c')](_0x32e54c);})[_0xfc72('0x1c')](function(_0x7ad03b){_0x507708['rows']=_0x7ad03b;return _0x507708;})[_0xfc72('0x1c')](respondWithFilteredResult(_0x4ecfe8,_0x32e54c))[_0xfc72('0x25')](handleError(_0x4ecfe8,null));};exports[_0xfc72('0x4d')]=function(_0x147479,_0x441d7f){var _0x307372={'raw':![],'where':{'id':_0x147479[_0xfc72('0x4e')]['id']}},_0x26a057={};_0x26a057[_0xfc72('0x41')]=_[_0xfc72('0x3e')](db[_0xfc72('0x39')]['rawAttributes']);_0x26a057[_0xfc72('0x3d')]=_['keys'](_0x147479['query']);_0x26a057[_0xfc72('0x3f')]=_[_0xfc72('0x40')](_0x26a057['model'],_0x26a057['query']);_0x307372[_0xfc72('0x42')]=_['intersection'](_0x26a057[_0xfc72('0x41')],qs[_0xfc72('0x43')](_0x147479[_0xfc72('0x3d')][_0xfc72('0x43')]));_0x307372[_0xfc72('0x42')]=_0x307372['attributes'][_0xfc72('0x44')]?_0x307372[_0xfc72('0x42')]:_0x26a057[_0xfc72('0x41')];if(_0x147479[_0xfc72('0x3d')][_0xfc72('0x4f')]){_0x307372[_0xfc72('0x50')]=[{'all':!![]}];}_0x307372=_[_0xfc72('0x49')]({},_0x307372,_0x147479[_0xfc72('0x4b')]);return db[_0xfc72('0x39')][_0xfc72('0x51')](_0x307372)['then'](handleEntityNotFound(_0x441d7f,null))[_0xfc72('0x1c')](respondWithResult(_0x441d7f,null))[_0xfc72('0x25')](handleError(_0x441d7f,null));};exports[_0xfc72('0x52')]=function(_0x5b6ae9,_0x578f9b,_0x3324da){var _0x33ee9a;return db['VoiceContext'][_0xfc72('0x52')](_0x5b6ae9[_0xfc72('0x53')],{'raw':!![]})[_0xfc72('0x1c')](function(_0x14d81b){_0x33ee9a=_0x14d81b;return db['VoiceContext'][_0xfc72('0x4c')]({'raw':!![]});})[_0xfc72('0x1c')](function(_0x5e5771){var _0x3a3f60=fs[_0xfc72('0x54')](path['join'](config[_0xfc72('0x55')],_0xfc72('0x56')),_0xfc72('0x57'));var _0x261958=ejs['render'](_0x3a3f60,{'contexts':_0x5e5771||[]});fs[_0xfc72('0x58')](_0xfc72('0x59'),_0x261958);})[_0xfc72('0x1c')](function(){return respondWithRpcPromise(_0xfc72('0x5a'),_0xfc72('0x52'),{'module':'chan_sip.so'});})[_0xfc72('0x1c')](function(){var _0x5a0149=_0x5b6ae9[_0xfc72('0x5b')][_0xfc72('0x5c')]({'plain':!![]});if(!_0x5a0149)throw new Error(_0xfc72('0x5d'));if(_0x5a0149['role']===_0xfc72('0x5b')){var _0xf32100=_0x33ee9a[_0xfc72('0x5c')]({'plain':!![]});return db[_0xfc72('0x5e')][_0xfc72('0x51')]({'where':{'name':_0xfc72('0x35'),'userProfileId':_0x5a0149[_0xfc72('0x5f')]},'raw':!![]})[_0xfc72('0x1c')](function(_0x338a68){if(_0x338a68&&_0x338a68[_0xfc72('0x60')]===0x0){return db[_0xfc72('0x61')][_0xfc72('0x52')]({'name':_0xf32100[_0xfc72('0x37')],'resourceId':_0xf32100['id'],'type':_0x338a68[_0xfc72('0x37')],'sectionId':_0x338a68['id']},{})[_0xfc72('0x1c')](function(){return _0x33ee9a;});}else{return _0x33ee9a;}})['catch'](function(_0x535d7a){logger[_0xfc72('0x20')](_0xfc72('0x62'),_0x535d7a);throw _0x535d7a;});}return _0x33ee9a;})[_0xfc72('0x1c')](respondWithResult(_0x578f9b,0xc9))[_0xfc72('0x25')](handleError(_0x578f9b,null));};exports[_0xfc72('0x33')]=function(_0x36e135,_0x32db4d,_0xba0dc2){var _0x29fd8a;return db[_0xfc72('0x39')][_0xfc72('0x51')]({'where':{'id':_0x36e135['params']['id']}})[_0xfc72('0x1c')](handleEntityNotFound(_0x32db4d,null))[_0xfc72('0x1c')](saveUpdates(_0x36e135[_0xfc72('0x53')],null))[_0xfc72('0x1c')](function(_0x30d33b){if(_0x30d33b){_0x29fd8a=_0x30d33b;return db['VoiceContext'][_0xfc72('0x4c')]({'raw':!![]});}})['then'](function(_0x19a3cb){var _0x27b22e=fs['readFileSync'](path[_0xfc72('0x63')](config[_0xfc72('0x55')],_0xfc72('0x56')),_0xfc72('0x57'));var _0x50402f=ejs['render'](_0x27b22e,{'contexts':_0x19a3cb||[]});fs[_0xfc72('0x58')](_0xfc72('0x59'),_0x50402f);})[_0xfc72('0x1c')](function(){return respondWithRpcPromise('Reload',_0xfc72('0x33'),{'module':_0xfc72('0x64')});})[_0xfc72('0x1c')](function(){return _0x29fd8a;})[_0xfc72('0x1c')](respondWithResult(_0x32db4d,null))['catch'](handleError(_0x32db4d,null));};exports[_0xfc72('0x34')]=function(_0x2e7d00,_0x42c5ea,_0x3d32da){var _0x1abb6b;return db[_0xfc72('0x39')][_0xfc72('0x51')]({'where':{'id':_0x2e7d00[_0xfc72('0x4e')]['id']}})[_0xfc72('0x1c')](handleEntityNotFound(_0x42c5ea,null))[_0xfc72('0x1c')](removeEntity(_0x42c5ea,null))[_0xfc72('0x1c')](function(){return db[_0xfc72('0x39')]['findAll']({'raw':!![]});})[_0xfc72('0x1c')](function(_0x34b1e9){var _0xa2887f=fs[_0xfc72('0x54')](path[_0xfc72('0x63')](config[_0xfc72('0x55')],'server/files/templates/context.ejs'),_0xfc72('0x57'));var _0x5cd5de=ejs[_0xfc72('0x65')](_0xa2887f,{'contexts':_0x34b1e9});fs['writeFileSync'](_0xfc72('0x59'),_0x5cd5de);return respondWithRpcPromise(_0xfc72('0x5a'),'destroy',{'module':'chan_sip.so'});})[_0xfc72('0x25')](handleError(_0x42c5ea,null));}; \ No newline at end of file +var _0x7416=['../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','update','destroy','Contexts','UserProfileResource','stack','name','send','map','VoiceContext','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','show','params','rawAttributes','includeAll','find','create','body','readFileSync','join','root','utf8','render','Reload','chan_sip.so','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/context.ejs','/etc/asterisk/extensions_xcally_contexts.conf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x3cc59e,_0x1942a4){var _0x2e03db=function(_0x2a9f8f){while(--_0x2a9f8f){_0x3cc59e['push'](_0x3cc59e['shift']());}};_0x2e03db(++_0x1942a4);}(_0x7416,0xb5));var _0x6741=function(_0x5c768b,_0x5e88a6){_0x5c768b=_0x5c768b-0x0;var _0x335af8=_0x7416[_0x5c768b];return _0x335af8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6741('0x0'));var zipdir=require(_0x6741('0x1'));var jsonpatch=require(_0x6741('0x2'));var rp=require(_0x6741('0x3'));var moment=require(_0x6741('0x4'));var BPromise=require(_0x6741('0x5'));var Mustache=require(_0x6741('0x6'));var util=require(_0x6741('0x7'));var path=require(_0x6741('0x8'));var sox=require(_0x6741('0x9'));var csv=require(_0x6741('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6741('0xb'));var _=require(_0x6741('0xc'));var squel=require(_0x6741('0xd'));var crypto=require(_0x6741('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6741('0xf'));var toCsv=require(_0x6741('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6741('0x10'));var qs=require(_0x6741('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6741('0x12'));var logger=require(_0x6741('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x6741('0x14'));var licenseUtil=require(_0x6741('0x15'));var db=require(_0x6741('0x16'))['db'];var jayson=require(_0x6741('0x17'));var client=jayson[_0x6741('0x18')][_0x6741('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x29ebde,_0x41c4aa,_0x332761,_0x27d010){return new BPromise(function(_0x59015c,_0xeae09){var _0x29bbdd=_0x27d010||client;return _0x29bbdd[_0x6741('0x1a')](_0x29ebde,_0x332761)[_0x6741('0x1b')](function(_0x139d91){logger[_0x6741('0x1c')](_0x6741('0x1d'),_0x41c4aa,_0x6741('0x1e'));logger['debug'](_0x6741('0x1f'),_0x41c4aa,_0x6741('0x1e'),JSON[_0x6741('0x20')](_0x139d91));if(_0x139d91[_0x6741('0x21')]){if(_0x139d91[_0x6741('0x21')][_0x6741('0x22')]===0x1f4){logger[_0x6741('0x21')](_0x6741('0x1d'),_0x41c4aa,_0x139d91['error'][_0x6741('0x23')]);return _0xeae09(_0x139d91['error']['message']);}logger[_0x6741('0x21')](_0x6741('0x1d'),_0x41c4aa,_0x139d91[_0x6741('0x21')][_0x6741('0x23')]);return _0x59015c(_0x139d91[_0x6741('0x21')]['message']);}else{logger[_0x6741('0x1c')](_0x6741('0x1d'),_0x41c4aa,_0x6741('0x1e'));_0x59015c(_0x139d91[_0x6741('0x24')]['message']);}})[_0x6741('0x25')](function(_0x183852){logger[_0x6741('0x21')]('VoiceContext,\x20%s,\x20%s',_0x41c4aa,_0x183852);_0xeae09(_0x183852);});});}function respondWithStatusCode(_0x3d9b5e,_0x5e8a65){_0x5e8a65=_0x5e8a65||0xcc;return function(_0x59e918){if(_0x59e918){return _0x3d9b5e[_0x6741('0x26')](_0x5e8a65);}return _0x3d9b5e['status'](_0x5e8a65)[_0x6741('0x27')]();};}function respondWithResult(_0x470884,_0x3a5e0c){_0x3a5e0c=_0x3a5e0c||0xc8;return function(_0x5c1855){if(_0x5c1855){return _0x470884[_0x6741('0x28')](_0x3a5e0c)[_0x6741('0x29')](_0x5c1855);}};}function respondWithFilteredResult(_0xabcfa7,_0x28d228){return function(_0x4c2369){if(_0x4c2369){var _0x496e85=typeof _0x28d228[_0x6741('0x2a')]===_0x6741('0x2b')&&typeof _0x28d228['limit']===_0x6741('0x2b');var _0x365fea=_0x4c2369['count'];var _0x580853=_0x496e85?0x0:_0x28d228['offset'];var _0x56d75f=_0x496e85?_0x4c2369[_0x6741('0x2c')]:_0x28d228[_0x6741('0x2a')]+_0x28d228[_0x6741('0x2d')];var _0xcef335;if(_0x56d75f>=_0x365fea){_0x56d75f=_0x365fea;_0xcef335=0xc8;}else{_0xcef335=0xce;}_0xabcfa7[_0x6741('0x28')](_0xcef335);return _0xabcfa7['set'](_0x6741('0x2e'),_0x580853+'-'+_0x56d75f+'/'+_0x365fea)[_0x6741('0x29')](_0x4c2369);}return null;};}function patchUpdates(_0x2c06de){return function(_0xf3fee5){try{jsonpatch[_0x6741('0x2f')](_0xf3fee5,_0x2c06de,!![]);}catch(_0x42ce30){return BPromise['reject'](_0x42ce30);}return _0xf3fee5['save']();};}function saveUpdates(_0x5a83ff,_0x88751c){return function(_0x4e9232){if(_0x4e9232){return _0x4e9232[_0x6741('0x30')](_0x5a83ff)[_0x6741('0x1b')](function(_0x24cbd8){return _0x24cbd8;});}return null;};}function removeEntity(_0x3c79e2,_0x57f070){return function(_0xe0a724){if(_0xe0a724){return _0xe0a724[_0x6741('0x31')]()[_0x6741('0x1b')](function(){var _0xec1ae7=_0xe0a724['get']({'plain':!![]});var _0x289199=_0x6741('0x32');return db[_0x6741('0x33')][_0x6741('0x31')]({'where':{'type':_0x289199,'resourceId':_0xec1ae7['id']}})[_0x6741('0x1b')](function(){return _0xe0a724;});})[_0x6741('0x1b')](function(){_0x3c79e2['status'](0xcc)[_0x6741('0x27')]();});}};}function handleEntityNotFound(_0x32c3,_0x2e846d){return function(_0x13ec1c){if(!_0x13ec1c){_0x32c3[_0x6741('0x26')](0x194);}return _0x13ec1c;};}function handleError(_0xeae5e7,_0x2e36fc){_0x2e36fc=_0x2e36fc||0x1f4;return function(_0x445325){logger[_0x6741('0x21')](_0x445325[_0x6741('0x34')]);if(_0x445325[_0x6741('0x35')]){delete _0x445325[_0x6741('0x35')];}_0xeae5e7[_0x6741('0x28')](_0x2e36fc)[_0x6741('0x36')](_0x445325);};}exports['index']=function(_0x8f019b,_0x2e4622){var _0x9f56b3={},_0x43a6ae={},_0x1f2379={'count':0x0,'rows':[]};var _0x73f26e=_[_0x6741('0x37')](db[_0x6741('0x38')]['rawAttributes'],function(_0x505ba2){return{'name':_0x505ba2[_0x6741('0x39')],'type':_0x505ba2['type'][_0x6741('0x3a')]};});_0x43a6ae[_0x6741('0x3b')]=_[_0x6741('0x37')](_0x73f26e,'name');_0x43a6ae[_0x6741('0x3c')]=_[_0x6741('0x3d')](_0x8f019b[_0x6741('0x3c')]);_0x43a6ae[_0x6741('0x3e')]=_[_0x6741('0x3f')](_0x43a6ae[_0x6741('0x3b')],_0x43a6ae['query']);_0x9f56b3[_0x6741('0x40')]=_['intersection'](_0x43a6ae[_0x6741('0x3b')],qs[_0x6741('0x41')](_0x8f019b['query'][_0x6741('0x41')]));_0x9f56b3['attributes']=_0x9f56b3[_0x6741('0x40')][_0x6741('0x42')]?_0x9f56b3[_0x6741('0x40')]:_0x43a6ae[_0x6741('0x3b')];if(!_0x8f019b[_0x6741('0x3c')]['hasOwnProperty'](_0x6741('0x43'))){_0x9f56b3['limit']=qs[_0x6741('0x2d')](_0x8f019b[_0x6741('0x3c')][_0x6741('0x2d')]);_0x9f56b3[_0x6741('0x2a')]=qs[_0x6741('0x2a')](_0x8f019b['query'][_0x6741('0x2a')]);}_0x9f56b3[_0x6741('0x44')]=qs[_0x6741('0x45')](_0x8f019b[_0x6741('0x3c')][_0x6741('0x45')]);_0x9f56b3[_0x6741('0x46')]=qs[_0x6741('0x3e')](_[_0x6741('0x47')](_0x8f019b['query'],_0x43a6ae['filters']),_0x73f26e);if(_0x8f019b[_0x6741('0x3c')][_0x6741('0x48')]){_0x9f56b3[_0x6741('0x46')]=_['merge'](_0x9f56b3['where'],{'$or':_['map'](_0x73f26e,function(_0x40ed35){if(_0x40ed35['type']!==_0x6741('0x49')){var _0x11abab={};_0x11abab[_0x40ed35['name']]={'$like':'%'+_0x8f019b[_0x6741('0x3c')][_0x6741('0x48')]+'%'};return _0x11abab;}})});}_0x9f56b3=_[_0x6741('0x4a')]({},_0x9f56b3,_0x8f019b[_0x6741('0x4b')]);var _0x1506fe={'where':_0x9f56b3['where']};return db[_0x6741('0x38')][_0x6741('0x2c')](_0x1506fe)[_0x6741('0x1b')](function(_0x23edeb){_0x1f2379[_0x6741('0x2c')]=_0x23edeb;if(_0x8f019b[_0x6741('0x3c')]['includeAll']){_0x9f56b3['include']=[{'all':!![]}];}return db[_0x6741('0x38')][_0x6741('0x4c')](_0x9f56b3);})[_0x6741('0x1b')](function(_0x1f8831){_0x1f2379[_0x6741('0x4d')]=_0x1f8831;return _0x1f2379;})[_0x6741('0x1b')](respondWithFilteredResult(_0x2e4622,_0x9f56b3))[_0x6741('0x25')](handleError(_0x2e4622,null));};exports[_0x6741('0x4e')]=function(_0x39abc9,_0x43ce08){var _0x28087b={'raw':![],'where':{'id':_0x39abc9[_0x6741('0x4f')]['id']}},_0x16365f={};_0x16365f['model']=_[_0x6741('0x3d')](db[_0x6741('0x38')][_0x6741('0x50')]);_0x16365f[_0x6741('0x3c')]=_[_0x6741('0x3d')](_0x39abc9[_0x6741('0x3c')]);_0x16365f[_0x6741('0x3e')]=_['intersection'](_0x16365f[_0x6741('0x3b')],_0x16365f[_0x6741('0x3c')]);_0x28087b['attributes']=_[_0x6741('0x3f')](_0x16365f[_0x6741('0x3b')],qs['fields'](_0x39abc9[_0x6741('0x3c')][_0x6741('0x41')]));_0x28087b['attributes']=_0x28087b[_0x6741('0x40')][_0x6741('0x42')]?_0x28087b['attributes']:_0x16365f[_0x6741('0x3b')];if(_0x39abc9['query'][_0x6741('0x51')]){_0x28087b['include']=[{'all':!![]}];}_0x28087b=_['merge']({},_0x28087b,_0x39abc9[_0x6741('0x4b')]);return db['VoiceContext'][_0x6741('0x52')](_0x28087b)[_0x6741('0x1b')](handleEntityNotFound(_0x43ce08,null))[_0x6741('0x1b')](respondWithResult(_0x43ce08,null))[_0x6741('0x25')](handleError(_0x43ce08,null));};exports[_0x6741('0x53')]=function(_0xe05420,_0x449313,_0x1c97aa){var _0x1afa65;return db[_0x6741('0x38')][_0x6741('0x53')](_0xe05420[_0x6741('0x54')],{'raw':!![]})['then'](function(_0x5dcfe4){_0x1afa65=_0x5dcfe4;return db[_0x6741('0x38')][_0x6741('0x4c')]({'raw':!![]});})[_0x6741('0x1b')](function(_0x341c43){var _0x435ce4=fs[_0x6741('0x55')](path[_0x6741('0x56')](config[_0x6741('0x57')],'server/files/templates/context.ejs'),_0x6741('0x58'));var _0x3fb624=ejs[_0x6741('0x59')](_0x435ce4,{'contexts':_0x341c43||[]});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x3fb624);})[_0x6741('0x1b')](function(){return respondWithRpcPromise(_0x6741('0x5a'),_0x6741('0x53'),{'module':_0x6741('0x5b')});})[_0x6741('0x1b')](function(){var _0x3dd34e=_0xe05420[_0x6741('0x5c')][_0x6741('0x5d')]({'plain':!![]});if(!_0x3dd34e)throw new Error(_0x6741('0x5e'));if(_0x3dd34e['role']===_0x6741('0x5c')){var _0x3c420a=_0x1afa65[_0x6741('0x5d')]({'plain':!![]});return db[_0x6741('0x5f')][_0x6741('0x52')]({'where':{'name':_0x6741('0x32'),'userProfileId':_0x3dd34e['userProfileId']},'raw':!![]})[_0x6741('0x1b')](function(_0x43d3af){if(_0x43d3af&&_0x43d3af[_0x6741('0x60')]===0x0){return db[_0x6741('0x33')][_0x6741('0x53')]({'name':_0x3c420a[_0x6741('0x35')],'resourceId':_0x3c420a['id'],'type':_0x43d3af[_0x6741('0x35')],'sectionId':_0x43d3af['id']},{})[_0x6741('0x1b')](function(){return _0x1afa65;});}else{return _0x1afa65;}})[_0x6741('0x25')](function(_0x4ce6a4){logger[_0x6741('0x21')](_0x6741('0x61'),_0x4ce6a4);throw _0x4ce6a4;});}return _0x1afa65;})[_0x6741('0x1b')](respondWithResult(_0x449313,0xc9))[_0x6741('0x25')](handleError(_0x449313,null));};exports[_0x6741('0x30')]=function(_0x499823,_0x555a59,_0x447e02){var _0x3f8f72;return db[_0x6741('0x38')][_0x6741('0x52')]({'where':{'id':_0x499823[_0x6741('0x4f')]['id']}})[_0x6741('0x1b')](handleEntityNotFound(_0x555a59,null))[_0x6741('0x1b')](saveUpdates(_0x499823['body'],null))[_0x6741('0x1b')](function(_0x36ac76){if(_0x36ac76){_0x3f8f72=_0x36ac76;return db[_0x6741('0x38')]['findAll']({'raw':!![]});}})[_0x6741('0x1b')](function(_0x293cd8){var _0x4e35e6=fs[_0x6741('0x55')](path[_0x6741('0x56')](config[_0x6741('0x57')],_0x6741('0x62')),'utf8');var _0x9cd147=ejs[_0x6741('0x59')](_0x4e35e6,{'contexts':_0x293cd8||[]});fs['writeFileSync'](_0x6741('0x63'),_0x9cd147);})['then'](function(){return respondWithRpcPromise(_0x6741('0x5a'),_0x6741('0x30'),{'module':_0x6741('0x5b')});})[_0x6741('0x1b')](function(){return _0x3f8f72;})[_0x6741('0x1b')](respondWithResult(_0x555a59,null))[_0x6741('0x25')](handleError(_0x555a59,null));};exports[_0x6741('0x31')]=function(_0x4d1e0b,_0x4fc870,_0x51a75e){var _0x3f229e;return db[_0x6741('0x38')][_0x6741('0x52')]({'where':{'id':_0x4d1e0b['params']['id']}})[_0x6741('0x1b')](handleEntityNotFound(_0x4fc870,null))['then'](removeEntity(_0x4fc870,null))['then'](function(){return db[_0x6741('0x38')][_0x6741('0x4c')]({'raw':!![]});})[_0x6741('0x1b')](function(_0x2c2c17){var _0x21af07=fs[_0x6741('0x55')](path['join'](config[_0x6741('0x57')],_0x6741('0x62')),_0x6741('0x58'));var _0x57ae23=ejs[_0x6741('0x59')](_0x21af07,{'contexts':_0x2c2c17});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x57ae23);return respondWithRpcPromise('Reload','destroy',{'module':_0x6741('0x5b')});})['catch'](handleError(_0x4fc870,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index f6fa484..38d34fe 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 _0x4110=['request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','voice_contexts','lodash','util','../../config/logger','api'];(function(_0x46cdf7,_0x5c6b42){var _0x58898c=function(_0xdd9531){while(--_0xdd9531){_0x46cdf7['push'](_0x46cdf7['shift']());}};_0x58898c(++_0x5c6b42);}(_0x4110,0xac));var _0x0411=function(_0x437fea,_0x39fee6){_0x437fea=_0x437fea-0x0;var _0xa46ed1=_0x4110[_0x437fea];return _0xa46ed1;};'use strict';var _=require(_0x0411('0x0'));var util=require(_0x0411('0x1'));var logger=require(_0x0411('0x2'))(_0x0411('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0411('0x4'));var fs=require('fs');var path=require(_0x0411('0x5'));var rimraf=require(_0x0411('0x6'));var config=require(_0x0411('0x7'));var attributes=require(_0x0411('0x8'));module[_0x0411('0x9')]=function(_0x4ec07b,_0x2714f0){return _0x4ec07b['define']('VoiceContext',attributes,{'tableName':_0x0411('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1b4=['VoiceContext','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x45fd3c,_0x3ab0e1){var _0x4b47a4=function(_0x2b2d50){while(--_0x2b2d50){_0x45fd3c['push'](_0x45fd3c['shift']());}};_0x4b47a4(++_0x3ab0e1);}(_0xb1b4,0x175));var _0x4b1b=function(_0x2c5009,_0x63505f){_0x2c5009=_0x2c5009-0x0;var _0x40b7f9=_0xb1b4[_0x2c5009];return _0x40b7f9;};'use strict';var _=require(_0x4b1b('0x0'));var util=require(_0x4b1b('0x1'));var logger=require(_0x4b1b('0x2'))('api');var moment=require(_0x4b1b('0x3'));var BPromise=require(_0x4b1b('0x4'));var rp=require(_0x4b1b('0x5'));var fs=require('fs');var path=require(_0x4b1b('0x6'));var rimraf=require(_0x4b1b('0x7'));var config=require(_0x4b1b('0x8'));var attributes=require('./voiceContext.attributes');module[_0x4b1b('0x9')]=function(_0x1c61de,_0x41fec8){return _0x1c61de[_0x4b1b('0xa')](_0x4b1b('0xb'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 3c44ab5..8b7a17f 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 _0x5eb8=['info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x368463,_0x14137d){var _0x481f7e=function(_0x5943f0){while(--_0x5943f0){_0x368463['push'](_0x368463['shift']());}};_0x481f7e(++_0x14137d);}(_0x5eb8,0xb0));var _0x85eb=function(_0x1b95a1,_0x529852){_0x1b95a1=_0x1b95a1-0x0;var _0x57aef1=_0x5eb8[_0x1b95a1];return _0x57aef1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('VoiceContext,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('VoiceContext,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('VoiceContext,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});} \ No newline at end of file +var _0x7969=['request','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3df77c,_0x1bd36d){var _0x2b794f=function(_0x5c6e62){while(--_0x5c6e62){_0x3df77c['push'](_0x3df77c['shift']());}};_0x2b794f(++_0x1bd36d);}(_0x7969,0x1c2));var _0x9796=function(_0x3894fa,_0xda7220){_0x3894fa=_0x3894fa-0x0;var _0x20dc04=_0x7969[_0x3894fa];return _0x20dc04;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9796('0x0'));var BPromise=require(_0x9796('0x1'));var rs=require(_0x9796('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9796('0x3'));var logger=require(_0x9796('0x4'))(_0x9796('0x5'));var config=require(_0x9796('0x6'));var jayson=require(_0x9796('0x7'));var client=jayson[_0x9796('0x8')][_0x9796('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x712716,_0x584f53,_0x4509c8){return new BPromise(function(_0x529351,_0x4e0079){return client[_0x9796('0xa')](_0x712716,_0x4509c8)['then'](function(_0x7ebdbd){logger['info'](_0x9796('0xb'),_0x584f53,_0x9796('0xc'));logger[_0x9796('0xd')](_0x9796('0xe'),_0x584f53,_0x9796('0xc'),JSON[_0x9796('0xf')](_0x7ebdbd));if(_0x7ebdbd[_0x9796('0x10')]){if(_0x7ebdbd[_0x9796('0x10')]['code']===0x1f4){logger[_0x9796('0x10')]('VoiceContext,\x20%s,\x20%s',_0x584f53,_0x7ebdbd[_0x9796('0x10')]['message']);return _0x4e0079(_0x7ebdbd[_0x9796('0x10')][_0x9796('0x11')]);}logger[_0x9796('0x10')](_0x9796('0xb'),_0x584f53,_0x7ebdbd[_0x9796('0x10')][_0x9796('0x11')]);return _0x529351(_0x7ebdbd[_0x9796('0x10')][_0x9796('0x11')]);}else{logger[_0x9796('0x12')](_0x9796('0xb'),_0x584f53,_0x9796('0xc'));_0x529351(_0x7ebdbd[_0x9796('0x13')]['message']);}})['catch'](function(_0x4f5a81){logger[_0x9796('0x10')](_0x9796('0xb'),_0x584f53,_0x4f5a81);_0x4e0079(_0x4f5a81);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index a743d0d..0fc6278 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 _0x3dc0=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x149bd3,_0x35df7c){var _0x18d477=function(_0x489587){while(--_0x489587){_0x149bd3['push'](_0x149bd3['shift']());}};_0x18d477(++_0x35df7c);}(_0x3dc0,0xad));var _0x03dc=function(_0x494533,_0x554567){_0x494533=_0x494533-0x0;var _0x5a9ff3=_0x3dc0[_0x494533];return _0x5a9ff3;};'use strict';var multer=require(_0x03dc('0x0'));var util=require(_0x03dc('0x1'));var path=require(_0x03dc('0x2'));var timeout=require(_0x03dc('0x3'));var express=require(_0x03dc('0x4'));var router=express[_0x03dc('0x5')]();var fs_extra=require(_0x03dc('0x6'));var auth=require(_0x03dc('0x7'));var interaction=require(_0x03dc('0x8'));var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0x03dc('0x9')]('/',auth[_0x03dc('0xa')](),controller[_0x03dc('0xb')]);router['get'](_0x03dc('0xc'),auth[_0x03dc('0xa')](),controller['describe']);router[_0x03dc('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x03dc('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x03dc('0xe')](_0x03dc('0xf'),auth[_0x03dc('0xa')](),controller[_0x03dc('0x10')]);router[_0x03dc('0x11')](_0x03dc('0xf'),auth[_0x03dc('0xa')](),controller[_0x03dc('0x12')]);module[_0x03dc('0x13')]=router; \ No newline at end of file +var _0xbf6e=['post','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x11e8ac,_0xe2068f){var _0xc35fdf=function(_0x1a1422){while(--_0x1a1422){_0x11e8ac['push'](_0x11e8ac['shift']());}};_0xc35fdf(++_0xe2068f);}(_0xbf6e,0x149));var _0xebf6=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0xbf6e[_0x382a62];return _0x490a25;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xebf6('0x0'));var timeout=require(_0xebf6('0x1'));var express=require(_0xebf6('0x2'));var router=express[_0xebf6('0x3')]();var fs_extra=require(_0xebf6('0x4'));var auth=require(_0xebf6('0x5'));var interaction=require(_0xebf6('0x6'));var config=require('../../config/environment');var controller=require(_0xebf6('0x7'));router[_0xebf6('0x8')]('/',auth[_0xebf6('0x9')](),controller[_0xebf6('0xa')]);router[_0xebf6('0x8')](_0xebf6('0xb'),auth[_0xebf6('0x9')](),controller['describe']);router[_0xebf6('0x8')](_0xebf6('0xc'),auth[_0xebf6('0x9')](),controller['show']);router[_0xebf6('0xd')]('/',auth[_0xebf6('0x9')](),controller['create']);router[_0xebf6('0xe')](_0xebf6('0xc'),auth[_0xebf6('0x9')](),controller[_0xebf6('0xf')]);router[_0xebf6('0x10')](_0xebf6('0xc'),auth['isAuthenticated'](),controller[_0xebf6('0x11')]);module[_0xebf6('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 6f9db7f..6fc3277 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 _0xb821=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x2bd630,_0x494f0a){var _0x34d159=function(_0x540cfd){while(--_0x540cfd){_0x2bd630['push'](_0x2bd630['shift']());}};_0x34d159(++_0x494f0a);}(_0xb821,0xa7));var _0x1b82=function(_0x9cbab1,_0x145e67){_0x9cbab1=_0x9cbab1-0x0;var _0x53ea8a=_0xb821[_0x9cbab1];return _0x53ea8a;};'use strict';var Sequelize=require('sequelize');module[_0x1b82('0x0')]={'privilege':{'type':Sequelize[_0x1b82('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x1b82('0x1')]},'connectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'language':{'type':Sequelize[_0x1b82('0x1')]},'accountcode':{'type':Sequelize[_0x1b82('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x1b82('0x1')]},'priority':{'type':Sequelize[_0x1b82('0x2')]},'uniqueid':{'type':Sequelize[_0x1b82('0x1')]},'linkedid':{'type':Sequelize[_0x1b82('0x1')]},'destchannel':{'type':Sequelize[_0x1b82('0x1')]},'destchannelstate':{'type':Sequelize[_0x1b82('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridnum':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridname':{'type':Sequelize[_0x1b82('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'destlanguage':{'type':Sequelize[_0x1b82('0x1')]},'destaccountcode':{'type':Sequelize[_0x1b82('0x1')]},'destcontext':{'type':Sequelize[_0x1b82('0x1')]},'destexten':{'type':Sequelize[_0x1b82('0x1')]},'destpriority':{'type':Sequelize[_0x1b82('0x2')]},'destuniqueid':{'type':Sequelize[_0x1b82('0x1')]},'destlinkedid':{'type':Sequelize[_0x1b82('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x1b82('0x1')]},'starttime':{'type':Sequelize[_0x1b82('0x3')]},'answertime':{'type':Sequelize[_0x1b82('0x3')]},'endtime':{'type':Sequelize[_0x1b82('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x1b82('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x1b82('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x3e74=['DATE','sequelize','STRING','INTEGER'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x3e74,0x175));var _0x43e7=function(_0x587f08,_0x560cd0){_0x587f08=_0x587f08-0x0;var _0x3f2cbd=_0x3e74[_0x587f08];return _0x3f2cbd;};'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 a9bfc1a..1723a68 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 _0x5b3f=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','save','then','destroy','error','stack','name','send','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','limit','order','sort','filter','merge','where','VIRTUAL','VoiceDialReport','include','findAll','catch','show','params','fields','options','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x362046,_0x5cf93f){var _0x419ffe=function(_0x18cb42){while(--_0x18cb42){_0x362046['push'](_0x362046['shift']());}};_0x419ffe(++_0x5cf93f);}(_0x5b3f,0x16d));var _0xf5b3=function(_0x246653,_0x1a9186){_0x246653=_0x246653-0x0;var _0x373293=_0x5b3f[_0x246653];return _0x373293;};'use strict';var emlformat=require(_0xf5b3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf5b3('0x1'));var jsonpatch=require(_0xf5b3('0x2'));var rp=require(_0xf5b3('0x3'));var moment=require(_0xf5b3('0x4'));var BPromise=require(_0xf5b3('0x5'));var Mustache=require(_0xf5b3('0x6'));var util=require(_0xf5b3('0x7'));var path=require(_0xf5b3('0x8'));var sox=require(_0xf5b3('0x9'));var csv=require(_0xf5b3('0xa'));var ejs=require(_0xf5b3('0xb'));var fs=require('fs');var fs_extra=require(_0xf5b3('0xc'));var _=require(_0xf5b3('0xd'));var squel=require(_0xf5b3('0xe'));var crypto=require(_0xf5b3('0xf'));var jsforce=require(_0xf5b3('0x10'));var deskjs=require(_0xf5b3('0x11'));var toCsv=require(_0xf5b3('0xa'));var querystring=require(_0xf5b3('0x12'));var Papa=require(_0xf5b3('0x13'));var Redis=require('ioredis');var authService=require(_0xf5b3('0x14'));var qs=require(_0xf5b3('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf5b3('0x16'));var logger=require(_0xf5b3('0x17'))('api');var utils=require(_0xf5b3('0x18'));var config=require(_0xf5b3('0x19'));var licenseUtil=require(_0xf5b3('0x1a'));var db=require(_0xf5b3('0x1b'))['db'];function respondWithStatusCode(_0x5696a5,_0x1aaee0){_0x1aaee0=_0x1aaee0||0xcc;return function(_0x2e2dbc){if(_0x2e2dbc){return _0x5696a5[_0xf5b3('0x1c')](_0x1aaee0);}return _0x5696a5[_0xf5b3('0x1d')](_0x1aaee0)[_0xf5b3('0x1e')]();};}function respondWithResult(_0xc566a6,_0x36c4bb){_0x36c4bb=_0x36c4bb||0xc8;return function(_0x3a319e){if(_0x3a319e){return _0xc566a6[_0xf5b3('0x1d')](_0x36c4bb)[_0xf5b3('0x1f')](_0x3a319e);}};}function respondWithFilteredResult(_0x25701e,_0x147b58){return function(_0x165553){if(_0x165553){var _0x1c9404=typeof _0x147b58[_0xf5b3('0x20')]===_0xf5b3('0x21')&&typeof _0x147b58['limit']===_0xf5b3('0x21');var _0x44cb2f=_0x165553['count'];var _0x47f1e4=_0x1c9404?0x0:_0x147b58[_0xf5b3('0x20')];var _0x2bb740=_0x1c9404?_0x165553[_0xf5b3('0x22')]:_0x147b58[_0xf5b3('0x20')]+_0x147b58['limit'];var _0x1e0179;if(_0x2bb740>=_0x44cb2f){_0x2bb740=_0x44cb2f;_0x1e0179=0xc8;}else{_0x1e0179=0xce;}_0x25701e[_0xf5b3('0x1d')](_0x1e0179);return _0x25701e[_0xf5b3('0x23')]('Content-Range',_0x47f1e4+'-'+_0x2bb740+'/'+_0x44cb2f)[_0xf5b3('0x1f')](_0x165553);}return null;};}function patchUpdates(_0x2df9ff){return function(_0x5db0ad){try{jsonpatch['apply'](_0x5db0ad,_0x2df9ff,!![]);}catch(_0x58ce48){return BPromise['reject'](_0x58ce48);}return _0x5db0ad[_0xf5b3('0x24')]();};}function saveUpdates(_0x715373,_0x571113){return function(_0x40a7d9){if(_0x40a7d9){return _0x40a7d9['update'](_0x715373)[_0xf5b3('0x25')](function(_0x473853){return _0x473853;});}return null;};}function removeEntity(_0x1f1fbd,_0x188484){return function(_0x225ccf){if(_0x225ccf){return _0x225ccf[_0xf5b3('0x26')]()[_0xf5b3('0x25')](function(){_0x1f1fbd['status'](0xcc)[_0xf5b3('0x1e')]();});}};}function handleEntityNotFound(_0x60d516,_0x51674c){return function(_0x3f0f2d){if(!_0x3f0f2d){_0x60d516[_0xf5b3('0x1c')](0x194);}return _0x3f0f2d;};}function handleError(_0x43d4f9,_0x1143ee){_0x1143ee=_0x1143ee||0x1f4;return function(_0x10bd76){logger[_0xf5b3('0x27')](_0x10bd76[_0xf5b3('0x28')]);if(_0x10bd76[_0xf5b3('0x29')]){delete _0x10bd76['name'];}_0x43d4f9[_0xf5b3('0x1d')](_0x1143ee)[_0xf5b3('0x2a')](_0x10bd76);};}exports['index']=function(_0x5bc053,_0x4a0ec9){var _0x2c2ed5={},_0x2e87d5={},_0x4e4fd7={'count':0x0,'rows':[]};var _0x42faed=_['map'](db['VoiceDialReport'][_0xf5b3('0x2b')],function(_0x57bae5){return{'name':_0x57bae5['fieldName'],'type':_0x57bae5[_0xf5b3('0x2c')][_0xf5b3('0x2d')]};});_0x2e87d5[_0xf5b3('0x2e')]=_['map'](_0x42faed,_0xf5b3('0x29'));_0x2e87d5[_0xf5b3('0x2f')]=_[_0xf5b3('0x30')](_0x5bc053['query']);_0x2e87d5[_0xf5b3('0x31')]=_[_0xf5b3('0x32')](_0x2e87d5[_0xf5b3('0x2e')],_0x2e87d5[_0xf5b3('0x2f')]);_0x2c2ed5[_0xf5b3('0x33')]=_[_0xf5b3('0x32')](_0x2e87d5[_0xf5b3('0x2e')],qs['fields'](_0x5bc053[_0xf5b3('0x2f')]['fields']));_0x2c2ed5[_0xf5b3('0x33')]=_0x2c2ed5['attributes'][_0xf5b3('0x34')]?_0x2c2ed5['attributes']:_0x2e87d5[_0xf5b3('0x2e')];if(!_0x5bc053['query']['hasOwnProperty'](_0xf5b3('0x35'))){_0x2c2ed5['limit']=qs[_0xf5b3('0x36')](_0x5bc053['query'][_0xf5b3('0x36')]);_0x2c2ed5['offset']=qs[_0xf5b3('0x20')](_0x5bc053[_0xf5b3('0x2f')][_0xf5b3('0x20')]);}_0x2c2ed5[_0xf5b3('0x37')]=qs[_0xf5b3('0x38')](_0x5bc053[_0xf5b3('0x2f')]['sort']);_0x2c2ed5['where']=qs[_0xf5b3('0x31')](_['pick'](_0x5bc053[_0xf5b3('0x2f')],_0x2e87d5[_0xf5b3('0x31')]),_0x42faed);if(_0x5bc053[_0xf5b3('0x2f')][_0xf5b3('0x39')]){_0x2c2ed5['where']=_[_0xf5b3('0x3a')](_0x2c2ed5[_0xf5b3('0x3b')],{'$or':_['map'](_0x42faed,function(_0x231f0c){if(_0x231f0c['type']!==_0xf5b3('0x3c')){var _0xa5de2f={};_0xa5de2f[_0x231f0c[_0xf5b3('0x29')]]={'$like':'%'+_0x5bc053[_0xf5b3('0x2f')][_0xf5b3('0x39')]+'%'};return _0xa5de2f;}})});}_0x2c2ed5=_['merge']({},_0x2c2ed5,_0x5bc053['options']);var _0x15d9b6={'where':_0x2c2ed5['where']};return db[_0xf5b3('0x3d')]['count'](_0x15d9b6)[_0xf5b3('0x25')](function(_0x55e64b){_0x4e4fd7[_0xf5b3('0x22')]=_0x55e64b;if(_0x5bc053[_0xf5b3('0x2f')]['includeAll']){_0x2c2ed5[_0xf5b3('0x3e')]=[{'all':!![]}];}return db[_0xf5b3('0x3d')][_0xf5b3('0x3f')](_0x2c2ed5);})['then'](function(_0x5e6870){_0x4e4fd7['rows']=_0x5e6870;return _0x4e4fd7;})[_0xf5b3('0x25')](respondWithFilteredResult(_0x4a0ec9,_0x2c2ed5))[_0xf5b3('0x40')](handleError(_0x4a0ec9,null));};exports[_0xf5b3('0x41')]=function(_0x1841dd,_0x1e5964){var _0x216f1d={'raw':!![],'where':{'id':_0x1841dd[_0xf5b3('0x42')]['id']}},_0x3ebaee={};_0x3ebaee['model']=_[_0xf5b3('0x30')](db['VoiceDialReport']['rawAttributes']);_0x3ebaee[_0xf5b3('0x2f')]=_[_0xf5b3('0x30')](_0x1841dd[_0xf5b3('0x2f')]);_0x3ebaee[_0xf5b3('0x31')]=_[_0xf5b3('0x32')](_0x3ebaee[_0xf5b3('0x2e')],_0x3ebaee[_0xf5b3('0x2f')]);_0x216f1d[_0xf5b3('0x33')]=_['intersection'](_0x3ebaee[_0xf5b3('0x2e')],qs['fields'](_0x1841dd[_0xf5b3('0x2f')][_0xf5b3('0x43')]));_0x216f1d[_0xf5b3('0x33')]=_0x216f1d['attributes'][_0xf5b3('0x34')]?_0x216f1d[_0xf5b3('0x33')]:_0x3ebaee['model'];if(_0x1841dd[_0xf5b3('0x2f')]['includeAll']){_0x216f1d[_0xf5b3('0x3e')]=[{'all':!![]}];}_0x216f1d=_['merge']({},_0x216f1d,_0x1841dd[_0xf5b3('0x44')]);return db['VoiceDialReport'][_0xf5b3('0x45')](_0x216f1d)['then'](handleEntityNotFound(_0x1e5964,null))[_0xf5b3('0x25')](respondWithResult(_0x1e5964,null))[_0xf5b3('0x40')](handleError(_0x1e5964,null));};exports['create']=function(_0x1d234d,_0xe600f5){return db[_0xf5b3('0x3d')][_0xf5b3('0x46')](_0x1d234d[_0xf5b3('0x47')],{})['then'](respondWithResult(_0xe600f5,0xc9))[_0xf5b3('0x40')](handleError(_0xe600f5,null));};exports[_0xf5b3('0x48')]=function(_0x1c957a,_0x39320f){if(_0x1c957a[_0xf5b3('0x47')]['id']){delete _0x1c957a['body']['id'];}return db[_0xf5b3('0x3d')][_0xf5b3('0x45')]({'where':{'id':_0x1c957a[_0xf5b3('0x42')]['id']}})[_0xf5b3('0x25')](handleEntityNotFound(_0x39320f,null))[_0xf5b3('0x25')](saveUpdates(_0x1c957a['body'],null))[_0xf5b3('0x25')](respondWithResult(_0x39320f,null))[_0xf5b3('0x40')](handleError(_0x39320f,null));};exports[_0xf5b3('0x26')]=function(_0x1fd644,_0x261f46){return db[_0xf5b3('0x3d')][_0xf5b3('0x45')]({'where':{'id':_0x1fd644[_0xf5b3('0x42')]['id']}})['then'](handleEntityNotFound(_0x261f46,null))[_0xf5b3('0x25')](removeEntity(_0x261f46,null))[_0xf5b3('0x40')](handleError(_0x261f46,null));};exports[_0xf5b3('0x49')]=function(_0x3ce1d1,_0xd0d4cb){return db[_0xf5b3('0x3d')][_0xf5b3('0x49')]()[_0xf5b3('0x25')](respondWithResult(_0xd0d4cb,null))[_0xf5b3('0x40')](handleError(_0xd0d4cb,null));}; \ No newline at end of file +var _0x3dc2=['VoiceDialReport','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','include','findAll','rows','catch','params','keys','rawAttributes','includeAll','options','find','create','update','body','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','stack','name','send','map'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x3dc2,0xbe));var _0x23dc=function(_0x42a4fd,_0x37ea6c){_0x42a4fd=_0x42a4fd-0x0;var _0x1626c3=_0x3dc2[_0x42a4fd];return _0x1626c3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x23dc('0x0'));var zipdir=require(_0x23dc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x23dc('0x2'));var moment=require(_0x23dc('0x3'));var BPromise=require(_0x23dc('0x4'));var Mustache=require(_0x23dc('0x5'));var util=require(_0x23dc('0x6'));var path=require(_0x23dc('0x7'));var sox=require('sox');var csv=require(_0x23dc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x23dc('0x9'));var _=require(_0x23dc('0xa'));var squel=require(_0x23dc('0xb'));var crypto=require(_0x23dc('0xc'));var jsforce=require(_0x23dc('0xd'));var deskjs=require(_0x23dc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x23dc('0xf'));var Papa=require(_0x23dc('0x10'));var Redis=require(_0x23dc('0x11'));var authService=require(_0x23dc('0x12'));var qs=require(_0x23dc('0x13'));var as=require(_0x23dc('0x14'));var hardwareService=require(_0x23dc('0x15'));var logger=require(_0x23dc('0x16'))(_0x23dc('0x17'));var utils=require(_0x23dc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x23dc('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2af55e,_0xb2efa7){_0xb2efa7=_0xb2efa7||0xcc;return function(_0x14821a){if(_0x14821a){return _0x2af55e[_0x23dc('0x1a')](_0xb2efa7);}return _0x2af55e[_0x23dc('0x1b')](_0xb2efa7)[_0x23dc('0x1c')]();};}function respondWithResult(_0x36562d,_0x5b08e9){_0x5b08e9=_0x5b08e9||0xc8;return function(_0x4eae5e){if(_0x4eae5e){return _0x36562d[_0x23dc('0x1b')](_0x5b08e9)[_0x23dc('0x1d')](_0x4eae5e);}};}function respondWithFilteredResult(_0x252641,_0x363775){return function(_0x23db2a){if(_0x23db2a){var _0x3adc42=typeof _0x363775[_0x23dc('0x1e')]==='undefined'&&typeof _0x363775[_0x23dc('0x1f')]===_0x23dc('0x20');var _0x5050fe=_0x23db2a[_0x23dc('0x21')];var _0x4ca543=_0x3adc42?0x0:_0x363775[_0x23dc('0x1e')];var _0x435aa4=_0x3adc42?_0x23db2a[_0x23dc('0x21')]:_0x363775[_0x23dc('0x1e')]+_0x363775[_0x23dc('0x1f')];var _0x1c9a4b;if(_0x435aa4>=_0x5050fe){_0x435aa4=_0x5050fe;_0x1c9a4b=0xc8;}else{_0x1c9a4b=0xce;}_0x252641[_0x23dc('0x1b')](_0x1c9a4b);return _0x252641[_0x23dc('0x22')](_0x23dc('0x23'),_0x4ca543+'-'+_0x435aa4+'/'+_0x5050fe)[_0x23dc('0x1d')](_0x23db2a);}return null;};}function patchUpdates(_0x414b06){return function(_0x5e766a){try{jsonpatch[_0x23dc('0x24')](_0x5e766a,_0x414b06,!![]);}catch(_0xdbc235){return BPromise[_0x23dc('0x25')](_0xdbc235);}return _0x5e766a[_0x23dc('0x26')]();};}function saveUpdates(_0x33092e,_0xc658bb){return function(_0x540bc8){if(_0x540bc8){return _0x540bc8['update'](_0x33092e)[_0x23dc('0x27')](function(_0x27e1f0){return _0x27e1f0;});}return null;};}function removeEntity(_0x8cb710,_0x201d3f){return function(_0x571851){if(_0x571851){return _0x571851['destroy']()['then'](function(){_0x8cb710[_0x23dc('0x1b')](0xcc)[_0x23dc('0x1c')]();});}};}function handleEntityNotFound(_0x121292,_0x1ccb8e){return function(_0xceb76c){if(!_0xceb76c){_0x121292['sendStatus'](0x194);}return _0xceb76c;};}function handleError(_0x1cc942,_0x4bdcf1){_0x4bdcf1=_0x4bdcf1||0x1f4;return function(_0x1ec33e){logger['error'](_0x1ec33e[_0x23dc('0x28')]);if(_0x1ec33e['name']){delete _0x1ec33e[_0x23dc('0x29')];}_0x1cc942[_0x23dc('0x1b')](_0x4bdcf1)[_0x23dc('0x2a')](_0x1ec33e);};}exports['index']=function(_0x5d3979,_0x37cb48){var _0x25f132={},_0xff9efe={},_0x3e8536={'count':0x0,'rows':[]};var _0x4e73ea=_[_0x23dc('0x2b')](db[_0x23dc('0x2c')]['rawAttributes'],function(_0x4772a4){return{'name':_0x4772a4[_0x23dc('0x2d')],'type':_0x4772a4[_0x23dc('0x2e')]['key']};});_0xff9efe[_0x23dc('0x2f')]=_[_0x23dc('0x2b')](_0x4e73ea,_0x23dc('0x29'));_0xff9efe['query']=_['keys'](_0x5d3979[_0x23dc('0x30')]);_0xff9efe[_0x23dc('0x31')]=_[_0x23dc('0x32')](_0xff9efe[_0x23dc('0x2f')],_0xff9efe[_0x23dc('0x30')]);_0x25f132[_0x23dc('0x33')]=_['intersection'](_0xff9efe['model'],qs[_0x23dc('0x34')](_0x5d3979[_0x23dc('0x30')]['fields']));_0x25f132['attributes']=_0x25f132[_0x23dc('0x33')][_0x23dc('0x35')]?_0x25f132[_0x23dc('0x33')]:_0xff9efe[_0x23dc('0x2f')];if(!_0x5d3979[_0x23dc('0x30')][_0x23dc('0x36')](_0x23dc('0x37'))){_0x25f132['limit']=qs[_0x23dc('0x1f')](_0x5d3979[_0x23dc('0x30')][_0x23dc('0x1f')]);_0x25f132[_0x23dc('0x1e')]=qs['offset'](_0x5d3979[_0x23dc('0x30')][_0x23dc('0x1e')]);}_0x25f132[_0x23dc('0x38')]=qs[_0x23dc('0x39')](_0x5d3979[_0x23dc('0x30')][_0x23dc('0x39')]);_0x25f132['where']=qs['filters'](_[_0x23dc('0x3a')](_0x5d3979[_0x23dc('0x30')],_0xff9efe[_0x23dc('0x31')]),_0x4e73ea);if(_0x5d3979[_0x23dc('0x30')][_0x23dc('0x3b')]){_0x25f132[_0x23dc('0x3c')]=_['merge'](_0x25f132[_0x23dc('0x3c')],{'$or':_[_0x23dc('0x2b')](_0x4e73ea,function(_0x469987){if(_0x469987[_0x23dc('0x2e')]!==_0x23dc('0x3d')){var _0x21a71b={};_0x21a71b[_0x469987[_0x23dc('0x29')]]={'$like':'%'+_0x5d3979[_0x23dc('0x30')][_0x23dc('0x3b')]+'%'};return _0x21a71b;}})});}_0x25f132=_[_0x23dc('0x3e')]({},_0x25f132,_0x5d3979['options']);var _0xd7aae3={'where':_0x25f132[_0x23dc('0x3c')]};return db[_0x23dc('0x2c')]['count'](_0xd7aae3)[_0x23dc('0x27')](function(_0x451f94){_0x3e8536[_0x23dc('0x21')]=_0x451f94;if(_0x5d3979['query']['includeAll']){_0x25f132[_0x23dc('0x3f')]=[{'all':!![]}];}return db[_0x23dc('0x2c')][_0x23dc('0x40')](_0x25f132);})[_0x23dc('0x27')](function(_0x50ff8f){_0x3e8536[_0x23dc('0x41')]=_0x50ff8f;return _0x3e8536;})[_0x23dc('0x27')](respondWithFilteredResult(_0x37cb48,_0x25f132))[_0x23dc('0x42')](handleError(_0x37cb48,null));};exports['show']=function(_0xe5fae0,_0x4fad4d){var _0x907ec4={'raw':!![],'where':{'id':_0xe5fae0[_0x23dc('0x43')]['id']}},_0x224c51={};_0x224c51[_0x23dc('0x2f')]=_[_0x23dc('0x44')](db[_0x23dc('0x2c')][_0x23dc('0x45')]);_0x224c51['query']=_[_0x23dc('0x44')](_0xe5fae0[_0x23dc('0x30')]);_0x224c51[_0x23dc('0x31')]=_[_0x23dc('0x32')](_0x224c51[_0x23dc('0x2f')],_0x224c51['query']);_0x907ec4['attributes']=_['intersection'](_0x224c51[_0x23dc('0x2f')],qs[_0x23dc('0x34')](_0xe5fae0[_0x23dc('0x30')]['fields']));_0x907ec4['attributes']=_0x907ec4['attributes'][_0x23dc('0x35')]?_0x907ec4[_0x23dc('0x33')]:_0x224c51['model'];if(_0xe5fae0['query'][_0x23dc('0x46')]){_0x907ec4['include']=[{'all':!![]}];}_0x907ec4=_['merge']({},_0x907ec4,_0xe5fae0[_0x23dc('0x47')]);return db[_0x23dc('0x2c')][_0x23dc('0x48')](_0x907ec4)[_0x23dc('0x27')](handleEntityNotFound(_0x4fad4d,null))[_0x23dc('0x27')](respondWithResult(_0x4fad4d,null))[_0x23dc('0x42')](handleError(_0x4fad4d,null));};exports['create']=function(_0x15c6f4,_0xb6d9d3){return db[_0x23dc('0x2c')][_0x23dc('0x49')](_0x15c6f4['body'],{})['then'](respondWithResult(_0xb6d9d3,0xc9))['catch'](handleError(_0xb6d9d3,null));};exports[_0x23dc('0x4a')]=function(_0x88f638,_0xb34e48){if(_0x88f638['body']['id']){delete _0x88f638[_0x23dc('0x4b')]['id'];}return db[_0x23dc('0x2c')][_0x23dc('0x48')]({'where':{'id':_0x88f638['params']['id']}})[_0x23dc('0x27')](handleEntityNotFound(_0xb34e48,null))[_0x23dc('0x27')](saveUpdates(_0x88f638[_0x23dc('0x4b')],null))[_0x23dc('0x27')](respondWithResult(_0xb34e48,null))[_0x23dc('0x42')](handleError(_0xb34e48,null));};exports[_0x23dc('0x4c')]=function(_0x2290f3,_0x4d95f6){return db[_0x23dc('0x2c')]['find']({'where':{'id':_0x2290f3[_0x23dc('0x43')]['id']}})[_0x23dc('0x27')](handleEntityNotFound(_0x4d95f6,null))['then'](removeEntity(_0x4d95f6,null))[_0x23dc('0x42')](handleError(_0x4d95f6,null));};exports['describe']=function(_0x2046e7,_0x622398){return db[_0x23dc('0x2c')][_0x23dc('0x4d')]()['then'](respondWithResult(_0x622398,null))['catch'](handleError(_0x622398,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 273ac4d..ff63e03 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 _0x496a=['rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x36aca2,_0x575247){var _0x16f16d=function(_0x1c0c15){while(--_0x1c0c15){_0x36aca2['push'](_0x36aca2['shift']());}};_0x16f16d(++_0x575247);}(_0x496a,0xe6));var _0xa496=function(_0x1b5464,_0x2a0b25){_0x1b5464=_0x1b5464-0x0;var _0x231b79=_0x496a[_0x1b5464];return _0x231b79;};'use strict';var _=require(_0xa496('0x0'));var util=require(_0xa496('0x1'));var logger=require(_0xa496('0x2'))(_0xa496('0x3'));var moment=require(_0xa496('0x4'));var BPromise=require(_0xa496('0x5'));var rp=require(_0xa496('0x6'));var fs=require('fs');var path=require(_0xa496('0x7'));var rimraf=require(_0xa496('0x8'));var config=require(_0xa496('0x9'));var attributes=require(_0xa496('0xa'));module[_0xa496('0xb')]=function(_0x2491bf,_0x32b8b0){return _0x2491bf['define'](_0xa496('0xc'),attributes,{'tableName':_0xa496('0xd'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6732=['rimraf','../../config/environment','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3eee56,_0x176daf){var _0x506bcd=function(_0x3cfe8b){while(--_0x3cfe8b){_0x3eee56['push'](_0x3eee56['shift']());}};_0x506bcd(++_0x176daf);}(_0x6732,0x66));var _0x2673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6732[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2673('0x0'));var util=require(_0x2673('0x1'));var logger=require(_0x2673('0x2'))(_0x2673('0x3'));var moment=require('moment');var BPromise=require(_0x2673('0x4'));var rp=require(_0x2673('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2673('0x6'));var config=require(_0x2673('0x7'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x90d6e5,_0x2ec408){return _0x90d6e5[_0x2673('0x8')](_0x2673('0x9'),attributes,{'tableName':_0x2673('0xa'),'paranoid':![],'indexes':[{'fields':[_0x2673('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 0d408fa..2824c43 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 _0x6db6=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','CreateVoiceDialReport','VoiceDialReport','options','raw','then','catch','UpdateVoiceDialReport','update','where','attributes','limit'];(function(_0x1af633,_0x2672a7){var _0x11e69c=function(_0x5c6a0d){while(--_0x5c6a0d){_0x1af633['push'](_0x1af633['shift']());}};_0x11e69c(++_0x2672a7);}(_0x6db6,0x140));var _0x66db=function(_0x5b1ff2,_0x1e8b1a){_0x5b1ff2=_0x5b1ff2-0x0;var _0x32d526=_0x6db6[_0x5b1ff2];return _0x32d526;};'use strict';var _=require(_0x66db('0x0'));var util=require(_0x66db('0x1'));var moment=require(_0x66db('0x2'));var BPromise=require(_0x66db('0x3'));var rs=require(_0x66db('0x4'));var fs=require('fs');var Redis=require(_0x66db('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x66db('0x6'))(_0x66db('0x7'));var config=require(_0x66db('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x66db('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42f0cf,_0x2af085,_0x164d80){return new BPromise(function(_0x371a34,_0x32150f){return client[_0x66db('0xa')](_0x42f0cf,_0x164d80)['then'](function(_0x591d60){logger[_0x66db('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0x2af085,_0x66db('0xc'));logger[_0x66db('0xd')](_0x66db('0xe'),_0x2af085,_0x66db('0xc'),JSON[_0x66db('0xf')](_0x591d60));if(_0x591d60[_0x66db('0x10')]){if(_0x591d60[_0x66db('0x10')][_0x66db('0x11')]===0x1f4){logger[_0x66db('0x10')](_0x66db('0x12'),_0x2af085,_0x591d60[_0x66db('0x10')][_0x66db('0x13')]);return _0x32150f(_0x591d60[_0x66db('0x10')][_0x66db('0x13')]);}logger['error'](_0x66db('0x12'),_0x2af085,_0x591d60['error']['message']);return _0x371a34(_0x591d60[_0x66db('0x10')][_0x66db('0x13')]);}else{logger[_0x66db('0xb')](_0x66db('0x12'),_0x2af085,'request\x20sent');_0x371a34(_0x591d60[_0x66db('0x14')][_0x66db('0x13')]);}})['catch'](function(_0x327859){logger[_0x66db('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x2af085,_0x327859);_0x32150f(_0x327859);});});}exports[_0x66db('0x15')]=function(_0x28d5e4){var _0x2b1c0a=this;return new Promise(function(_0x51d7b8,_0x25f960){return db[_0x66db('0x16')]['create'](_0x28d5e4['body'],{'raw':_0x28d5e4[_0x66db('0x17')]?_0x28d5e4[_0x66db('0x17')][_0x66db('0x18')]===undefined?!![]:![]:!![]})[_0x66db('0x19')](function(_0x3c1636){logger['info'](_0x66db('0x15'),_0x28d5e4);logger['debug']('CreateVoiceDialReport',_0x28d5e4,JSON['stringify'](_0x3c1636));_0x51d7b8(_0x3c1636);})[_0x66db('0x1a')](function(_0x29eed6){logger['error'](_0x66db('0x15'),_0x29eed6[_0x66db('0x13')],_0x28d5e4);_0x25f960(_0x2b1c0a[_0x66db('0x10')](0x1f4,_0x29eed6['message']));});});};exports[_0x66db('0x1b')]=function(_0x1b6b00){var _0x1a236b=this;return new Promise(function(_0x5aa96c,_0xb385e4){return db[_0x66db('0x16')][_0x66db('0x1c')](_0x1b6b00['body'],{'raw':_0x1b6b00[_0x66db('0x17')]?_0x1b6b00['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b6b00[_0x66db('0x17')]?_0x1b6b00[_0x66db('0x17')][_0x66db('0x1d')]||null:null,'attributes':_0x1b6b00['options']?_0x1b6b00[_0x66db('0x17')][_0x66db('0x1e')]||null:null,'limit':_0x1b6b00[_0x66db('0x17')]?_0x1b6b00[_0x66db('0x17')][_0x66db('0x1f')]||null:null})['then'](function(_0x51b5eb){logger[_0x66db('0xb')]('UpdateVoiceDialReport',_0x1b6b00);logger['debug'](_0x66db('0x1b'),_0x1b6b00,JSON['stringify'](_0x51b5eb));_0x5aa96c(_0x51b5eb);})[_0x66db('0x1a')](function(_0x49bab7){logger['error']('UpdateVoiceDialReport',_0x49bab7['message'],_0x1b6b00);_0xb385e4(_0x1a236b[_0x66db('0x10')](0x1f4,_0x49bab7['message']));});});}; \ No newline at end of file +var _0x8209=['UpdateVoiceDialReport','where','attributes','util','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','VoiceDialReport,\x20%s,\x20%s','result','catch','VoiceDialReport','create','body','options','raw','CreateVoiceDialReport'];(function(_0x10b84a,_0x9eccd6){var _0x284a42=function(_0x164656){while(--_0x164656){_0x10b84a['push'](_0x10b84a['shift']());}};_0x284a42(++_0x9eccd6);}(_0x8209,0xb1));var _0x9820=function(_0x41fcea,_0x83311b){_0x41fcea=_0x41fcea-0x0;var _0x465542=_0x8209[_0x41fcea];return _0x465542;};'use strict';var _=require('lodash');var util=require(_0x9820('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9820('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x9820('0x2'))(_0x9820('0x3'));var config=require('../../config/environment');var jayson=require(_0x9820('0x4'));var client=jayson[_0x9820('0x5')][_0x9820('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xbd9011,_0x176848,_0x1aa925){return new BPromise(function(_0x11d391,_0x268e60){return client[_0x9820('0x7')](_0xbd9011,_0x1aa925)[_0x9820('0x8')](function(_0x5475df){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x176848,_0x9820('0x9'));logger[_0x9820('0xa')](_0x9820('0xb'),_0x176848,_0x9820('0x9'),JSON[_0x9820('0xc')](_0x5475df));if(_0x5475df[_0x9820('0xd')]){if(_0x5475df['error'][_0x9820('0xe')]===0x1f4){logger[_0x9820('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x176848,_0x5475df[_0x9820('0xd')][_0x9820('0xf')]);return _0x268e60(_0x5475df[_0x9820('0xd')][_0x9820('0xf')]);}logger[_0x9820('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x176848,_0x5475df[_0x9820('0xd')][_0x9820('0xf')]);return _0x11d391(_0x5475df[_0x9820('0xd')]['message']);}else{logger[_0x9820('0x10')](_0x9820('0x11'),_0x176848,_0x9820('0x9'));_0x11d391(_0x5475df[_0x9820('0x12')][_0x9820('0xf')]);}})[_0x9820('0x13')](function(_0x72aa3e){logger['error'](_0x9820('0x11'),_0x176848,_0x72aa3e);_0x268e60(_0x72aa3e);});});}exports['CreateVoiceDialReport']=function(_0x222d13){var _0x5d265a=this;return new Promise(function(_0xeb667f,_0x499ba5){return db[_0x9820('0x14')][_0x9820('0x15')](_0x222d13[_0x9820('0x16')],{'raw':_0x222d13[_0x9820('0x17')]?_0x222d13[_0x9820('0x17')][_0x9820('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x2f8cba){logger[_0x9820('0x10')]('CreateVoiceDialReport',_0x222d13);logger[_0x9820('0xa')]('CreateVoiceDialReport',_0x222d13,JSON[_0x9820('0xc')](_0x2f8cba));_0xeb667f(_0x2f8cba);})[_0x9820('0x13')](function(_0x4b9b1b){logger[_0x9820('0xd')](_0x9820('0x19'),_0x4b9b1b[_0x9820('0xf')],_0x222d13);_0x499ba5(_0x5d265a[_0x9820('0xd')](0x1f4,_0x4b9b1b[_0x9820('0xf')]));});});};exports[_0x9820('0x1a')]=function(_0x11985f){var _0x1c7001=this;return new Promise(function(_0x23dfa0,_0x33ba5e){return db['VoiceDialReport']['update'](_0x11985f[_0x9820('0x16')],{'raw':_0x11985f['options']?_0x11985f[_0x9820('0x17')][_0x9820('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11985f[_0x9820('0x17')]?_0x11985f[_0x9820('0x17')][_0x9820('0x1b')]||null:null,'attributes':_0x11985f[_0x9820('0x17')]?_0x11985f['options'][_0x9820('0x1c')]||null:null,'limit':_0x11985f[_0x9820('0x17')]?_0x11985f[_0x9820('0x17')]['limit']||null:null})[_0x9820('0x8')](function(_0x58a5a6){logger[_0x9820('0x10')]('UpdateVoiceDialReport',_0x11985f);logger[_0x9820('0xa')]('UpdateVoiceDialReport',_0x11985f,JSON['stringify'](_0x58a5a6));_0x23dfa0(_0x58a5a6);})[_0x9820('0x13')](function(_0x511722){logger['error']('UpdateVoiceDialReport',_0x511722[_0x9820('0xf')],_0x11985f);_0x33ba5e(_0x1c7001[_0x9820('0xd')](0x1f4,_0x511722[_0x9820('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 413daab..88b3104 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 _0xff6a=['post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceExtension.controller','isAuthenticated','get','show'];(function(_0x2d78a4,_0x362f5){var _0x38d29a=function(_0x314265){while(--_0x314265){_0x2d78a4['push'](_0x2d78a4['shift']());}};_0x38d29a(++_0x362f5);}(_0xff6a,0x1ed));var _0xaff6=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xff6a[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0xaff6('0x0'));var util=require('util');var path=require(_0xaff6('0x1'));var timeout=require(_0xaff6('0x2'));var express=require(_0xaff6('0x3'));var router=express[_0xaff6('0x4')]();var fs_extra=require(_0xaff6('0x5'));var auth=require(_0xaff6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xaff6('0x7'));router['get']('/',auth[_0xaff6('0x8')](),controller['index']);router[_0xaff6('0x9')]('/:id',auth[_0xaff6('0x8')](),controller[_0xaff6('0xa')]);router[_0xaff6('0xb')]('/',auth[_0xaff6('0x8')](),controller['create']);router[_0xaff6('0xb')]('/:id/applications',auth[_0xaff6('0x8')](),controller['addApplications']);router[_0xaff6('0xc')](_0xaff6('0xd'),auth[_0xaff6('0x8')](),controller[_0xaff6('0xe')]);router[_0xaff6('0xf')]('/:id',auth[_0xaff6('0x8')](),controller[_0xaff6('0x10')]);module[_0xaff6('0x11')]=router; \ No newline at end of file +var _0x2b88=['get','isAuthenticated','show','create','/:id/applications','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index'];(function(_0x2cfac1,_0x29a0c9){var _0x25409b=function(_0x2ffb47){while(--_0x2ffb47){_0x2cfac1['push'](_0x2cfac1['shift']());}};_0x25409b(++_0x29a0c9);}(_0x2b88,0x122));var _0x82b8=function(_0x41bee3,_0x2315fb){_0x41bee3=_0x41bee3-0x0;var _0x2596ac=_0x2b88[_0x41bee3];return _0x2596ac;};'use strict';var multer=require(_0x82b8('0x0'));var util=require(_0x82b8('0x1'));var path=require(_0x82b8('0x2'));var timeout=require('connect-timeout');var express=require(_0x82b8('0x3'));var router=express[_0x82b8('0x4')]();var fs_extra=require(_0x82b8('0x5'));var auth=require(_0x82b8('0x6'));var interaction=require(_0x82b8('0x7'));var config=require(_0x82b8('0x8'));var controller=require('./voiceExtension.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x82b8('0x9')]);router[_0x82b8('0xa')]('/:id',auth[_0x82b8('0xb')](),controller[_0x82b8('0xc')]);router['post']('/',auth[_0x82b8('0xb')](),controller[_0x82b8('0xd')]);router['post'](_0x82b8('0xe'),auth['isAuthenticated'](),controller['addApplications']);router['put'](_0x82b8('0xf'),auth['isAuthenticated'](),controller[_0x82b8('0x10')]);router[_0x82b8('0x11')](_0x82b8('0xf'),auth[_0x82b8('0xb')](),controller[_0x82b8('0x12')]);module[_0x82b8('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 7f38005..be8cdd4 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 _0x6b6c=['INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','outbound','inbound-fax','outbound-fax','system','any','*,*,*,*'];(function(_0x540deb,_0x1e537d){var _0x445c96=function(_0x1b9b18){while(--_0x1b9b18){_0x540deb['push'](_0x540deb['shift']());}};_0x445c96(++_0x1e537d);}(_0x6b6c,0x127));var _0xc6b6=function(_0x46c215,_0x37d19c){_0x46c215=_0x46c215-0x0;var _0x14c353=_0x6b6c[_0x46c215];return _0x14c353;};'use strict';var Sequelize=require(_0xc6b6('0x0'));module[_0xc6b6('0x1')]={'context':{'type':Sequelize[_0xc6b6('0x2')],'allowNull':![],'unique':_0xc6b6('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xc6b6('0x2')],'allowNull':![],'unique':_0xc6b6('0x3')},'priority':{'type':Sequelize[_0xc6b6('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xc6b6('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc6b6('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0xc6b6('0x5'),'internal',_0xc6b6('0x6'),_0xc6b6('0x7'),_0xc6b6('0x8'),_0xc6b6('0x9')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc6b6('0x2')],'allowNull':![],'defaultValue':_0xc6b6('0xa')},'IntervalId':{'type':Sequelize[_0xc6b6('0xb')]},'isApp':{'type':Sequelize[_0xc6b6('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xc6b6('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xc6b6('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xc6b6('0xb')]},'recordingFormat':{'type':Sequelize[_0xc6b6('0x2')],'defaultValue':_0xc6b6('0xd')},'answer':{'type':Sequelize[_0xc6b6('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xc6b6('0xe')],'get':function(_0x303334){return this[_0xc6b6('0xf')](_0xc6b6('0x10'));}},'alias':{'type':Sequelize[_0xc6b6('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x84e7=['STRING','compositeIndex','NoOp','inbound','outbound','internal','inbound-fax','any','BOOLEAN','wav','VIRTUAL','getDataValue','exports'];(function(_0x277721,_0x46971e){var _0x286051=function(_0x130c98){while(--_0x130c98){_0x277721['push'](_0x277721['shift']());}};_0x286051(++_0x46971e);}(_0x84e7,0xb5));var _0x784e=function(_0x4f0002,_0x159a72){_0x4f0002=_0x4f0002-0x0;var _0x1b68d9=_0x84e7[_0x4f0002];return _0x1b68d9;};'use strict';var Sequelize=require('sequelize');module[_0x784e('0x0')]={'context':{'type':Sequelize[_0x784e('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x784e('0x2')},'priority':{'type':Sequelize[_0x784e('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x784e('0x2')},'tag':{'type':Sequelize[_0x784e('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x784e('0x3')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x784e('0x4'),_0x784e('0x5'),_0x784e('0x6'),_0x784e('0x7'),'outbound-fax','system',_0x784e('0x8')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x784e('0x1')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x784e('0x9')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0x784e('0x9')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x784e('0x1')],'defaultValue':_0x784e('0xa')},'answer':{'type':Sequelize[_0x784e('0x9')],'defaultValue':!![]},'name':{'type':Sequelize[_0x784e('0xb')],'get':function(_0x215cb8){return this[_0x784e('0xc')]('exten');}},'alias':{'type':Sequelize[_0x784e('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index ae2f04e..d9a1245 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 _0xed1d=['exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','cutdigits','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','finally','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','status','end','undefined','count','offset','Content-Range','json','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','type','find','name','sendStatus','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','VIRTUAL','include','findAll','rows','catch','show','params','keys','includeAll','options','create','body'];(function(_0x539145,_0xb2f4c2){var _0x59e7ef=function(_0x515df8){while(--_0x515df8){_0x539145['push'](_0x539145['shift']());}};_0x59e7ef(++_0xb2f4c2);}(_0xed1d,0x12a));var _0xded1=function(_0x5c5634,_0x5ed129){_0x5c5634=_0x5c5634-0x0;var _0xbb74aa=_0xed1d[_0x5c5634];return _0xbb74aa;};'use strict';var _=require(_0xded1('0x0'));var Redis=require(_0xded1('0x1'));var qs=require(_0xded1('0x2'));var logger=require('../../config/logger')(_0xded1('0x3'));var config=require(_0xded1('0x4'));var db=require(_0xded1('0x5'))['db'];config[_0xded1('0x6')]=_[_0xded1('0x7')](config['redis'],{'host':_0xded1('0x8'),'port':0x18eb});var socket=require(_0xded1('0x9'))(new Redis(config['redis']));require(_0xded1('0xa'))[_0xded1('0xb')](socket);function respondWithStatusCode(_0x5565da,_0x3f180e){_0x3f180e=_0x3f180e||0xcc;return function(_0x483c95){if(_0x483c95){return _0x5565da['sendStatus'](_0x3f180e);}return _0x5565da[_0xded1('0xc')](_0x3f180e)[_0xded1('0xd')]();};}function respondWithResult(_0x28145c,_0xa4302c){_0xa4302c=_0xa4302c||0xc8;return function(_0x3b4dbd){if(_0x3b4dbd){return _0x28145c[_0xded1('0xc')](_0xa4302c)['json'](_0x3b4dbd);}};}function respondWithFilteredResult(_0x1db889,_0x3532f1){return function(_0x1c9572){if(_0x1c9572){var _0x7156a0=typeof _0x3532f1['offset']===_0xded1('0xe')&&typeof _0x3532f1['limit']===_0xded1('0xe');var _0x56f9d1=_0x1c9572[_0xded1('0xf')];var _0x127704=_0x7156a0?0x0:_0x3532f1[_0xded1('0x10')];var _0x4bdbc8=_0x7156a0?_0x1c9572['count']:_0x3532f1[_0xded1('0x10')]+_0x3532f1['limit'];var _0x48317a;if(_0x4bdbc8>=_0x56f9d1){_0x4bdbc8=_0x56f9d1;_0x48317a=0xc8;}else{_0x48317a=0xce;}_0x1db889[_0xded1('0xc')](_0x48317a);return _0x1db889['set'](_0xded1('0x11'),_0x127704+'-'+_0x4bdbc8+'/'+_0x56f9d1)[_0xded1('0x12')](_0x1c9572);}return null;};}function removeEntity(_0x3fcda8){return function(_0x4637b9){if(_0x4637b9){return _0x4637b9[_0xded1('0x13')]()[_0xded1('0x14')](function(){var _0x34c380=_0x4637b9[_0xded1('0x15')]({'plain':!![]});var _0x153bc2=[{'name':_0xded1('0x16'),'value':_0xded1('0x17'),'ignore':![]},{'name':_0xded1('0x18'),'value':_0xded1('0x19'),'ignore':![]},{'name':_0xded1('0x1a'),'value':_0xded1('0x1b'),'ignore':![]}];var _0x30004a=_(_0x153bc2)[_0xded1('0x1c')](_0xded1('0x1d'))[_0xded1('0x1e')](_0xded1('0x1f'))[_0xded1('0x1f')]();if(_['includes'](_0x30004a,_0x34c380[_0xded1('0x20')])){return;}var _0x37aade=_[_0xded1('0x21')](_0x153bc2,[_0xded1('0x1f'),_0x34c380[_0xded1('0x20')]])[_0xded1('0x22')];return db['UserProfileResource'][_0xded1('0x13')]({'where':{'type':_0x37aade,'resourceId':_0x34c380['id']}})[_0xded1('0x14')](function(){return _0x4637b9;});})[_0xded1('0x14')](function(){_0x3fcda8['status'](0xcc)[_0xded1('0xd')]();});}};}function handleEntityNotFound(_0x558c79){return function(_0x23be1b){if(!_0x23be1b){_0x558c79[_0xded1('0x23')](0x194);}return _0x23be1b;};}function handleError(_0x10edf7,_0x327311){_0x327311=_0x327311||0x1f4;return function(_0x22cce4){logger[_0xded1('0x24')](_0x22cce4[_0xded1('0x25')]);if(_0x22cce4['name']){delete _0x22cce4[_0xded1('0x22')];}_0x10edf7['status'](_0x327311)[_0xded1('0x26')](_0x22cce4);};}exports[_0xded1('0x27')]=function(_0xd9a27b,_0x5ae4a6){var _0x129c6f={},_0x188584={},_0xf12bfe={'count':0x0,'rows':[]};var _0x5a1dc2=_[_0xded1('0x1e')](db[_0xded1('0x28')][_0xded1('0x29')],function(_0x19584f){return{'name':_0x19584f[_0xded1('0x2a')],'type':_0x19584f[_0xded1('0x20')][_0xded1('0x2b')]};});_0x188584[_0xded1('0x2c')]=_[_0xded1('0x1e')](_0x5a1dc2,_0xded1('0x22'));_0x188584[_0xded1('0x2d')]=_['keys'](_0xd9a27b[_0xded1('0x2d')]);_0x188584['filters']=_[_0xded1('0x2e')](_0x188584['model'],_0x188584[_0xded1('0x2d')]);_0x129c6f['attributes']=_[_0xded1('0x2e')](_0x188584[_0xded1('0x2c')],qs[_0xded1('0x2f')](_0xd9a27b[_0xded1('0x2d')]['fields']));_0x129c6f[_0xded1('0x30')]=_0x129c6f[_0xded1('0x30')][_0xded1('0x31')]?_0x129c6f[_0xded1('0x30')]:_0x188584[_0xded1('0x2c')];if(!_0xd9a27b[_0xded1('0x2d')][_0xded1('0x32')](_0xded1('0x33'))){_0x129c6f[_0xded1('0x34')]=qs[_0xded1('0x34')](_0xd9a27b[_0xded1('0x2d')][_0xded1('0x34')]);_0x129c6f[_0xded1('0x10')]=qs[_0xded1('0x10')](_0xd9a27b[_0xded1('0x2d')][_0xded1('0x10')]);}_0x129c6f[_0xded1('0x35')]=qs['sort'](_0xd9a27b[_0xded1('0x2d')][_0xded1('0x36')]);_0x129c6f[_0xded1('0x37')]=qs[_0xded1('0x38')](_[_0xded1('0x39')](_0xd9a27b[_0xded1('0x2d')],_0x188584[_0xded1('0x38')]),_0x5a1dc2);if(_0xd9a27b[_0xded1('0x2d')][_0xded1('0x1c')]){_0x129c6f[_0xded1('0x37')]=_['merge'](_0x129c6f[_0xded1('0x37')],{'$or':_[_0xded1('0x1e')](_0x5a1dc2,function(_0x46d900){if(_0x46d900[_0xded1('0x20')]!==_0xded1('0x3a')){var _0x3656f4={};_0x3656f4[_0x46d900[_0xded1('0x22')]]={'$like':'%'+_0xd9a27b[_0xded1('0x2d')]['filter']+'%'};return _0x3656f4;}})});}_0x129c6f=_['merge']({},_0x129c6f,_0xd9a27b['options']);var _0x297215={'where':_0x129c6f[_0xded1('0x37')]};return db['VoiceExtension'][_0xded1('0xf')](_0x297215)[_0xded1('0x14')](function(_0x33e05b){_0xf12bfe[_0xded1('0xf')]=_0x33e05b;if(_0xd9a27b[_0xded1('0x2d')]['includeAll']){_0x129c6f[_0xded1('0x3b')]=[{'all':!![]}];}return db[_0xded1('0x28')][_0xded1('0x3c')](_0x129c6f);})[_0xded1('0x14')](function(_0x284c4e){_0xf12bfe[_0xded1('0x3d')]=_0x284c4e;return _0xf12bfe;})[_0xded1('0x14')](respondWithFilteredResult(_0x5ae4a6,_0x129c6f))[_0xded1('0x3e')](handleError(_0x5ae4a6,null));};exports[_0xded1('0x3f')]=function(_0x1d4e10,_0x4206da){var _0x4988f4={'raw':![],'where':{'id':_0x1d4e10[_0xded1('0x40')]['id']}},_0xab61a7={};_0xab61a7['model']=_[_0xded1('0x41')](db[_0xded1('0x28')][_0xded1('0x29')]);_0xab61a7[_0xded1('0x2d')]=_[_0xded1('0x41')](_0x1d4e10['query']);_0xab61a7[_0xded1('0x38')]=_[_0xded1('0x2e')](_0xab61a7[_0xded1('0x2c')],_0xab61a7[_0xded1('0x2d')]);_0x4988f4['attributes']=_[_0xded1('0x2e')](_0xab61a7[_0xded1('0x2c')],qs[_0xded1('0x2f')](_0x1d4e10[_0xded1('0x2d')][_0xded1('0x2f')]));_0x4988f4['attributes']=_0x4988f4[_0xded1('0x30')]['length']?_0x4988f4[_0xded1('0x30')]:_0xab61a7[_0xded1('0x2c')];if(_0x1d4e10['query'][_0xded1('0x42')]){_0x4988f4[_0xded1('0x3b')]=[{'all':!![]}];}_0x4988f4=_['merge']({},_0x4988f4,_0x1d4e10[_0xded1('0x43')]);return db[_0xded1('0x28')]['find'](_0x4988f4)[_0xded1('0x14')](handleEntityNotFound(_0x4206da,null))['then'](respondWithResult(_0x4206da,null))['catch'](handleError(_0x4206da,null));};exports[_0xded1('0x13')]=function(_0x338347,_0x54213f){return db['VoiceExtension']['find']({'where':{'id':_0x338347[_0xded1('0x40')]['id']}})[_0xded1('0x14')](handleEntityNotFound(_0x54213f,null))[_0xded1('0x14')](removeEntity(_0x54213f,null))['catch'](handleError(_0x54213f,null));};exports[_0xded1('0x44')]=function(_0x557b07,_0x5e5e6e){if(_0x557b07['body'][_0xded1('0x20')]===_0xded1('0x19')&&!_['startsWith'](_0x557b07[_0xded1('0x45')]['exten'],'_')){_0x557b07[_0xded1('0x45')][_0xded1('0x46')]='_'['concat'](_0x557b07[_0xded1('0x45')][_0xded1('0x46')]);}return db[_0xded1('0x28')][_0xded1('0x44')](_0x557b07[_0xded1('0x45')],{'raw':![]})[_0xded1('0x14')](function(_0x3ac94f){var _0x8e899a=_0x557b07[_0xded1('0x47')][_0xded1('0x15')]({'plain':!![]});if(!_0x8e899a)throw new Error(_0xded1('0x48'));if(_0x8e899a[_0xded1('0x49')]===_0xded1('0x47')){var _0x2b2b4c=_0x3ac94f[_0xded1('0x15')]({'plain':!![]});var _0x628409=[{'name':_0xded1('0x16'),'value':'inbound'},{'name':'OutboundRoutes','value':'outbound'},{'name':_0xded1('0x1a'),'value':_0xded1('0x1b')}];var _0x20d708=_[_0xded1('0x21')](_0x628409,['value',_0x2b2b4c['type']])['name'];return db['UserProfileSection'][_0xded1('0x21')]({'where':{'name':_0x20d708,'userProfileId':_0x8e899a[_0xded1('0x4a')]},'raw':!![]})[_0xded1('0x14')](function(_0x17ea09){if(_0x17ea09&&_0x17ea09['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2b2b4c[_0xded1('0x22')],'resourceId':_0x2b2b4c['id'],'type':_0x17ea09[_0xded1('0x22')],'sectionId':_0x17ea09['id']},{})[_0xded1('0x14')](function(){return _0x3ac94f;});}else{return _0x3ac94f;}})[_0xded1('0x3e')](function(_0x541c5d){logger[_0xded1('0x24')](_0xded1('0x4b'),_0x541c5d);throw _0x541c5d;});}return _0x3ac94f;})[_0xded1('0x14')](respondWithResult(_0x5e5e6e,0xc9))[_0xded1('0x3e')](handleError(_0x5e5e6e,null));};exports['update']=function(_0x377512,_0x37e7c1){if(_0x377512[_0xded1('0x45')]['id']){delete _0x377512[_0xded1('0x45')]['id'];}return db[_0xded1('0x28')][_0xded1('0x21')]({'where':{'id':_0x377512[_0xded1('0x40')]['id']}})[_0xded1('0x14')](handleEntityNotFound(_0x37e7c1,null))['then'](function(_0x38ba58){if(_0x38ba58){return db[_0xded1('0x28')][_0xded1('0x4c')](_[_0xded1('0x39')](_0x377512['body'],[_0xded1('0x46'),'context',_0xded1('0x4d'),_0xded1('0x4e'),_0xded1('0x4f'),'mandatoryDisposition',_0xded1('0x50')]),{'where':{'context':_0x38ba58['context'],'exten':_0x38ba58['exten']},'individualHooks':!![]})[_0xded1('0x14')](function(_0x3edd07){return _0x3edd07;});}return null;})[_0xded1('0x14')](respondWithStatusCode(_0x37e7c1,null))[_0xded1('0x3e')](handleError(_0x37e7c1,null));};exports[_0xded1('0x51')]=function(_0x290d37,_0x349cdc){var _0x4f10fe=_0x290d37[_0xded1('0x40')]['id'];var _0x19ea72=_0x290d37[_0xded1('0x45')];var _0x303246=0xc8;var _0x53828c=null;return db[_0xded1('0x52')]['transaction']({'isolationLevel':db[_0xded1('0x52')][_0xded1('0x53')][_0xded1('0x54')][_0xded1('0x55')]},function(_0x2cfc0a){return db[_0xded1('0x28')][_0xded1('0x56')]({'where':{'id':_0x4f10fe},'transaction':_0x2cfc0a})[_0xded1('0x14')](function(_0x420ce7){if(_0x420ce7){return db[_0xded1('0x28')]['destroy']({'where':{'VoiceExtensionId':_0x4f10fe},'transaction':_0x2cfc0a})[_0xded1('0x14')](function(){var _0x10c204=_[_0xded1('0x1e')](_0x19ea72,function(_0x59718d){_0x59718d[_0xded1('0x57')]=_0x4f10fe;_0x59718d[_0xded1('0x58')]=!![];return _0x59718d;});return _0x420ce7[_0xded1('0x59')](_0x10c204);})['then'](function(_0x710e26){return db[_0xded1('0x28')][_0xded1('0x5a')](_0x710e26,{'transaction':_0x2cfc0a});});}else{_0x303246=0x194;_0x53828c=[];}});})[_0xded1('0x14')](function(){if(_0x303246!==0x194){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x4f10fe},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x4991bd){_0x53828c=_0x4991bd;});}})[_0xded1('0x3e')](function(_0x3843c3){_0x303246=0x1f4;logger['error'](_0x3843c3[_0xded1('0x25')]);if(_0x3843c3[_0xded1('0x22')]){delete _0x3843c3[_0xded1('0x22')];}_0x53828c=_0x3843c3;})[_0xded1('0x5b')](function(){if(_0x53828c===null){_0x349cdc[_0xded1('0x23')](_0x303246);}else{if(_0x303246===0x1f4){_0x349cdc[_0xded1('0xc')](_0x303246)[_0xded1('0x26')](_0x53828c);}else{_0x349cdc[_0xded1('0xc')](_0x303246)[_0xded1('0x12')](_0x53828c);}}});}; \ No newline at end of file +var _0x800f=['register','sendStatus','status','limit','undefined','count','offset','json','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','end','error','VoiceExtension','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','VIRTUAL','include','findAll','rows','catch','params','keys','length','includeAll','options','body','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','transaction','sequelize','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','stack','finally','send','lodash','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket'];(function(_0x158147,_0x15c105){var _0x2a751b=function(_0x111e0e){while(--_0x111e0e){_0x158147['push'](_0x158147['shift']());}};_0x2a751b(++_0x15c105);}(_0x800f,0x16e));var _0xf800=function(_0x4cb22f,_0x4f60a1){_0x4cb22f=_0x4cb22f-0x0;var _0x51f6cb=_0x800f[_0x4cb22f];return _0x51f6cb;};'use strict';var _=require(_0xf800('0x0'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xf800('0x1'))(_0xf800('0x2'));var config=require(_0xf800('0x3'));var db=require(_0xf800('0x4'))['db'];config[_0xf800('0x5')]=_[_0xf800('0x6')](config['redis'],{'host':_0xf800('0x7'),'port':0x18eb});var socket=require(_0xf800('0x8'))(new Redis(config[_0xf800('0x5')]));require(_0xf800('0x9'))[_0xf800('0xa')](socket);function respondWithStatusCode(_0x1ade4c,_0x4c1e68){_0x4c1e68=_0x4c1e68||0xcc;return function(_0x109947){if(_0x109947){return _0x1ade4c[_0xf800('0xb')](_0x4c1e68);}return _0x1ade4c[_0xf800('0xc')](_0x4c1e68)['end']();};}function respondWithResult(_0x1f9083,_0x3802e0){_0x3802e0=_0x3802e0||0xc8;return function(_0x18f0b6){if(_0x18f0b6){return _0x1f9083[_0xf800('0xc')](_0x3802e0)['json'](_0x18f0b6);}};}function respondWithFilteredResult(_0x15bbdb,_0x414dfa){return function(_0x2335c8){if(_0x2335c8){var _0xc238ea=typeof _0x414dfa['offset']==='undefined'&&typeof _0x414dfa[_0xf800('0xd')]===_0xf800('0xe');var _0x15081d=_0x2335c8[_0xf800('0xf')];var _0x1653e2=_0xc238ea?0x0:_0x414dfa[_0xf800('0x10')];var _0x4ef375=_0xc238ea?_0x2335c8[_0xf800('0xf')]:_0x414dfa[_0xf800('0x10')]+_0x414dfa['limit'];var _0x4d4b46;if(_0x4ef375>=_0x15081d){_0x4ef375=_0x15081d;_0x4d4b46=0xc8;}else{_0x4d4b46=0xce;}_0x15bbdb['status'](_0x4d4b46);return _0x15bbdb['set']('Content-Range',_0x1653e2+'-'+_0x4ef375+'/'+_0x15081d)[_0xf800('0x11')](_0x2335c8);}return null;};}function removeEntity(_0x4b64c5){return function(_0x53c2da){if(_0x53c2da){return _0x53c2da[_0xf800('0x12')]()[_0xf800('0x13')](function(){var _0x47df06=_0x53c2da[_0xf800('0x14')]({'plain':!![]});var _0x176ba6=[{'name':_0xf800('0x15'),'value':_0xf800('0x16'),'ignore':![]},{'name':_0xf800('0x17'),'value':_0xf800('0x18'),'ignore':![]},{'name':_0xf800('0x19'),'value':_0xf800('0x1a'),'ignore':![]}];var _0x37e159=_(_0x176ba6)[_0xf800('0x1b')](_0xf800('0x1c'))[_0xf800('0x1d')](_0xf800('0x1e'))[_0xf800('0x1e')]();if(_[_0xf800('0x1f')](_0x37e159,_0x47df06[_0xf800('0x20')])){return;}var _0x6a8668=_[_0xf800('0x21')](_0x176ba6,['value',_0x47df06['type']])[_0xf800('0x22')];return db[_0xf800('0x23')][_0xf800('0x12')]({'where':{'type':_0x6a8668,'resourceId':_0x47df06['id']}})[_0xf800('0x13')](function(){return _0x53c2da;});})[_0xf800('0x13')](function(){_0x4b64c5['status'](0xcc)[_0xf800('0x24')]();});}};}function handleEntityNotFound(_0x4c3f33){return function(_0x312fce){if(!_0x312fce){_0x4c3f33[_0xf800('0xb')](0x194);}return _0x312fce;};}function handleError(_0x15fd38,_0x7cb41e){_0x7cb41e=_0x7cb41e||0x1f4;return function(_0x297df4){logger[_0xf800('0x25')](_0x297df4['stack']);if(_0x297df4[_0xf800('0x22')]){delete _0x297df4[_0xf800('0x22')];}_0x15fd38[_0xf800('0xc')](_0x7cb41e)['send'](_0x297df4);};}exports['index']=function(_0x149f4c,_0x21abac){var _0x1a84b2={},_0x2e9797={},_0x31b92a={'count':0x0,'rows':[]};var _0x342eaa=_[_0xf800('0x1d')](db[_0xf800('0x26')][_0xf800('0x27')],function(_0x23928b){return{'name':_0x23928b[_0xf800('0x28')],'type':_0x23928b[_0xf800('0x20')][_0xf800('0x29')]};});_0x2e9797[_0xf800('0x2a')]=_[_0xf800('0x1d')](_0x342eaa,_0xf800('0x22'));_0x2e9797['query']=_['keys'](_0x149f4c[_0xf800('0x2b')]);_0x2e9797[_0xf800('0x2c')]=_[_0xf800('0x2d')](_0x2e9797[_0xf800('0x2a')],_0x2e9797[_0xf800('0x2b')]);_0x1a84b2[_0xf800('0x2e')]=_[_0xf800('0x2d')](_0x2e9797['model'],qs[_0xf800('0x2f')](_0x149f4c['query'][_0xf800('0x2f')]));_0x1a84b2[_0xf800('0x2e')]=_0x1a84b2['attributes']['length']?_0x1a84b2['attributes']:_0x2e9797[_0xf800('0x2a')];if(!_0x149f4c[_0xf800('0x2b')]['hasOwnProperty'](_0xf800('0x30'))){_0x1a84b2[_0xf800('0xd')]=qs[_0xf800('0xd')](_0x149f4c[_0xf800('0x2b')]['limit']);_0x1a84b2[_0xf800('0x10')]=qs[_0xf800('0x10')](_0x149f4c[_0xf800('0x2b')][_0xf800('0x10')]);}_0x1a84b2[_0xf800('0x31')]=qs[_0xf800('0x32')](_0x149f4c[_0xf800('0x2b')][_0xf800('0x32')]);_0x1a84b2[_0xf800('0x33')]=qs[_0xf800('0x2c')](_['pick'](_0x149f4c[_0xf800('0x2b')],_0x2e9797[_0xf800('0x2c')]),_0x342eaa);if(_0x149f4c[_0xf800('0x2b')][_0xf800('0x1b')]){_0x1a84b2[_0xf800('0x33')]=_[_0xf800('0x34')](_0x1a84b2['where'],{'$or':_[_0xf800('0x1d')](_0x342eaa,function(_0x4f1fde){if(_0x4f1fde['type']!==_0xf800('0x35')){var _0x4b19bf={};_0x4b19bf[_0x4f1fde[_0xf800('0x22')]]={'$like':'%'+_0x149f4c[_0xf800('0x2b')][_0xf800('0x1b')]+'%'};return _0x4b19bf;}})});}_0x1a84b2=_[_0xf800('0x34')]({},_0x1a84b2,_0x149f4c['options']);var _0x1cc65e={'where':_0x1a84b2[_0xf800('0x33')]};return db[_0xf800('0x26')][_0xf800('0xf')](_0x1cc65e)[_0xf800('0x13')](function(_0x3c3f90){_0x31b92a[_0xf800('0xf')]=_0x3c3f90;if(_0x149f4c['query']['includeAll']){_0x1a84b2[_0xf800('0x36')]=[{'all':!![]}];}return db[_0xf800('0x26')][_0xf800('0x37')](_0x1a84b2);})[_0xf800('0x13')](function(_0x58ea58){_0x31b92a[_0xf800('0x38')]=_0x58ea58;return _0x31b92a;})[_0xf800('0x13')](respondWithFilteredResult(_0x21abac,_0x1a84b2))[_0xf800('0x39')](handleError(_0x21abac,null));};exports['show']=function(_0xb58489,_0xf1f294){var _0x492828={'raw':![],'where':{'id':_0xb58489[_0xf800('0x3a')]['id']}},_0x2b158e={};_0x2b158e[_0xf800('0x2a')]=_[_0xf800('0x3b')](db[_0xf800('0x26')][_0xf800('0x27')]);_0x2b158e[_0xf800('0x2b')]=_[_0xf800('0x3b')](_0xb58489[_0xf800('0x2b')]);_0x2b158e[_0xf800('0x2c')]=_[_0xf800('0x2d')](_0x2b158e[_0xf800('0x2a')],_0x2b158e[_0xf800('0x2b')]);_0x492828[_0xf800('0x2e')]=_[_0xf800('0x2d')](_0x2b158e[_0xf800('0x2a')],qs[_0xf800('0x2f')](_0xb58489[_0xf800('0x2b')][_0xf800('0x2f')]));_0x492828['attributes']=_0x492828[_0xf800('0x2e')][_0xf800('0x3c')]?_0x492828['attributes']:_0x2b158e[_0xf800('0x2a')];if(_0xb58489['query'][_0xf800('0x3d')]){_0x492828[_0xf800('0x36')]=[{'all':!![]}];}_0x492828=_[_0xf800('0x34')]({},_0x492828,_0xb58489[_0xf800('0x3e')]);return db[_0xf800('0x26')][_0xf800('0x21')](_0x492828)['then'](handleEntityNotFound(_0xf1f294,null))['then'](respondWithResult(_0xf1f294,null))[_0xf800('0x39')](handleError(_0xf1f294,null));};exports[_0xf800('0x12')]=function(_0x2a1d85,_0x32cde0){return db['VoiceExtension'][_0xf800('0x21')]({'where':{'id':_0x2a1d85[_0xf800('0x3a')]['id']}})['then'](handleEntityNotFound(_0x32cde0,null))['then'](removeEntity(_0x32cde0,null))[_0xf800('0x39')](handleError(_0x32cde0,null));};exports['create']=function(_0x4ab6fe,_0x183d0c){if(_0x4ab6fe[_0xf800('0x3f')][_0xf800('0x20')]===_0xf800('0x18')&&!_['startsWith'](_0x4ab6fe[_0xf800('0x3f')][_0xf800('0x40')],'_')){_0x4ab6fe[_0xf800('0x3f')][_0xf800('0x40')]='_'[_0xf800('0x41')](_0x4ab6fe[_0xf800('0x3f')][_0xf800('0x40')]);}return db[_0xf800('0x26')][_0xf800('0x42')](_0x4ab6fe['body'],{'raw':![]})[_0xf800('0x13')](function(_0x3f8b47){var _0x299df2=_0x4ab6fe[_0xf800('0x43')]['get']({'plain':!![]});if(!_0x299df2)throw new Error(_0xf800('0x44'));if(_0x299df2[_0xf800('0x45')]===_0xf800('0x43')){var _0x2b6866=_0x3f8b47[_0xf800('0x14')]({'plain':!![]});var _0x188042=[{'name':'InboundRoutes','value':'inbound'},{'name':'OutboundRoutes','value':'outbound'},{'name':_0xf800('0x19'),'value':_0xf800('0x1a')}];var _0x2b6411=_[_0xf800('0x21')](_0x188042,[_0xf800('0x1e'),_0x2b6866[_0xf800('0x20')]])['name'];return db['UserProfileSection']['find']({'where':{'name':_0x2b6411,'userProfileId':_0x299df2[_0xf800('0x46')]},'raw':!![]})[_0xf800('0x13')](function(_0x413cf1){if(_0x413cf1&&_0x413cf1[_0xf800('0x47')]===0x0){return db[_0xf800('0x23')][_0xf800('0x42')]({'name':_0x2b6866[_0xf800('0x22')],'resourceId':_0x2b6866['id'],'type':_0x413cf1[_0xf800('0x22')],'sectionId':_0x413cf1['id']},{})[_0xf800('0x13')](function(){return _0x3f8b47;});}else{return _0x3f8b47;}})[_0xf800('0x39')](function(_0x1144f9){logger[_0xf800('0x25')](_0xf800('0x48'),_0x1144f9);throw _0x1144f9;});}return _0x3f8b47;})[_0xf800('0x13')](respondWithResult(_0x183d0c,0xc9))[_0xf800('0x39')](handleError(_0x183d0c,null));};exports['update']=function(_0x5187b0,_0x249bb8){if(_0x5187b0['body']['id']){delete _0x5187b0[_0xf800('0x3f')]['id'];}return db[_0xf800('0x26')][_0xf800('0x21')]({'where':{'id':_0x5187b0[_0xf800('0x3a')]['id']}})[_0xf800('0x13')](handleEntityNotFound(_0x249bb8,null))[_0xf800('0x13')](function(_0x3677c6){if(_0x3677c6){return db['VoiceExtension'][_0xf800('0x49')](_['pick'](_0x5187b0[_0xf800('0x3f')],['exten',_0xf800('0x4a'),_0xf800('0x4b'),_0xf800('0x4c'),_0xf800('0x4d'),_0xf800('0x4e'),_0xf800('0x4f')]),{'where':{'context':_0x3677c6[_0xf800('0x4a')],'exten':_0x3677c6['exten']},'individualHooks':!![]})[_0xf800('0x13')](function(_0x3f16ef){return _0x3f16ef;});}return null;})[_0xf800('0x13')](respondWithStatusCode(_0x249bb8,null))[_0xf800('0x39')](handleError(_0x249bb8,null));};exports[_0xf800('0x50')]=function(_0x5ed0ff,_0x1bc9ad){var _0x5a25cd=_0x5ed0ff[_0xf800('0x3a')]['id'];var _0x32c387=_0x5ed0ff[_0xf800('0x3f')];var _0x1c7eca=0xc8;var _0x10bb56=null;return db['sequelize'][_0xf800('0x51')]({'isolationLevel':db[_0xf800('0x52')]['Transaction']['ISOLATION_LEVELS'][_0xf800('0x53')]},function(_0x4da655){return db['VoiceExtension'][_0xf800('0x54')]({'where':{'id':_0x5a25cd},'transaction':_0x4da655})[_0xf800('0x13')](function(_0x530bd2){if(_0x530bd2){return db[_0xf800('0x26')][_0xf800('0x12')]({'where':{'VoiceExtensionId':_0x5a25cd},'transaction':_0x4da655})[_0xf800('0x13')](function(){var _0x44038c=_[_0xf800('0x1d')](_0x32c387,function(_0x25db6f){_0x25db6f[_0xf800('0x55')]=_0x5a25cd;_0x25db6f[_0xf800('0x56')]=!![];return _0x25db6f;});return _0x530bd2[_0xf800('0x57')](_0x44038c);})[_0xf800('0x13')](function(_0x35da94){return db['VoiceExtension'][_0xf800('0x58')](_0x35da94,{'transaction':_0x4da655});});}else{_0x1c7eca=0x194;_0x10bb56=[];}});})['then'](function(){if(_0x1c7eca!==0x194){return db[_0xf800('0x26')][_0xf800('0x59')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5a25cd},'order':_0xf800('0x5a')})[_0xf800('0x13')](function(_0x10b3f4){_0x10bb56=_0x10b3f4;});}})[_0xf800('0x39')](function(_0x4b0daa){_0x1c7eca=0x1f4;logger[_0xf800('0x25')](_0x4b0daa[_0xf800('0x5b')]);if(_0x4b0daa[_0xf800('0x22')]){delete _0x4b0daa['name'];}_0x10bb56=_0x4b0daa;})[_0xf800('0x5c')](function(){if(_0x10bb56===null){_0x1bc9ad[_0xf800('0xb')](_0x1c7eca);}else{if(_0x1c7eca===0x1f4){_0x1bc9ad[_0xf800('0xc')](_0x1c7eca)[_0xf800('0x5d')](_0x10bb56);}else{_0x1bc9ad[_0xf800('0xc')](_0x1c7eca)[_0xf800('0x11')](_0x10bb56);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 4aef943..cdf8f80 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 _0x10a7=['VoiceExtension','save','update','remove','emit','hook','exports','events'];(function(_0x1c30ce,_0xf6ca28){var _0x402610=function(_0x4df743){while(--_0x4df743){_0x1c30ce['push'](_0x1c30ce['shift']());}};_0x402610(++_0xf6ca28);}(_0x10a7,0xdf));var _0x710a=function(_0x1705fe,_0x42708c){_0x1705fe=_0x1705fe-0x0;var _0xae9e03=_0x10a7[_0x1705fe];return _0xae9e03;};'use strict';var EventEmitter=require(_0x710a('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x710a('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x710a('0x2'),'afterUpdate':_0x710a('0x3'),'afterDestroy':_0x710a('0x4')};function emitEvent(_0x5c36e9){return function(_0x4e9430,_0x3b2f78,_0x9c4dc0){VoiceExtensionEvents[_0x710a('0x5')](_0x5c36e9+':'+_0x4e9430['id'],_0x4e9430);VoiceExtensionEvents[_0x710a('0x5')](_0x5c36e9,_0x4e9430);_0x9c4dc0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x710a('0x6')](e,emitEvent(event));}}module[_0x710a('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0x602c=['remove','emit','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','update'];(function(_0x13fc71,_0x230bd3){var _0x525f1e=function(_0x3d1ff3){while(--_0x3d1ff3){_0x13fc71['push'](_0x13fc71['shift']());}};_0x525f1e(++_0x230bd3);}(_0x602c,0x148));var _0xc602=function(_0x30399c,_0x57b2aa){_0x30399c=_0x30399c-0x0;var _0x4a0491=_0x602c[_0x30399c];return _0x4a0491;};'use strict';var EventEmitter=require(_0xc602('0x0'));var VoiceExtension=require(_0xc602('0x1'))['db'][_0xc602('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xc602('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc602('0x4'),'afterDestroy':_0xc602('0x5')};function emitEvent(_0x3e108c){return function(_0x3150ff,_0x4d6b09,_0x5c6fda){VoiceExtensionEvents[_0xc602('0x6')](_0x3e108c+':'+_0x3150ff['id'],_0x3150ff);VoiceExtensionEvents[_0xc602('0x6')](_0x3e108c,_0x3150ff);_0x5c6fda(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xc602('0x7')](e,emitEvent(event));}}module[_0xc602('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 2fb1cd0..f82512e 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 _0xb51e=['wav','timeout','url','split','trunk','param','prefix','phone','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','replace','Interval','interval','IntervalId','then','length','*,*,*,*','intervals','map','filter','hasOwnProperty','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','playback','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appType','outboundDial','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','models','type','Set','CDR(type)=','context','alias','NoOp','No\x20alias\x20set','inbound','push','exten','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT='];(function(_0x24a45c,_0x14338e){var _0x4746a5=function(_0x2d070c){while(--_0x2d070c){_0x24a45c['push'](_0x24a45c['shift']());}};_0x4746a5(++_0x14338e);}(_0xb51e,0x12f));var _0xeb51=function(_0x448375,_0x50636f){_0x448375=_0x448375-0x0;var _0x3962e6=_0xb51e[_0x448375];return _0x3962e6;};'use strict';var _=require(_0xeb51('0x0'));var attributes=require(_0xeb51('0x1'));module['exports']=function(_0x4e844b){var _0x11110e=_0x4e844b[_0xeb51('0x2')];function _0x41170d(_0x3a5503){var _0x29c8be=0x2;var _0x299960=[{'type':_0x3a5503[_0xeb51('0x3')],'app':_0xeb51('0x4'),'appdata':_0xeb51('0x5')+_0x3a5503['type'],'context':_0x3a5503[_0xeb51('0x6')],'exten':_0x3a5503['exten'],'priority':_0x29c8be++,'VoiceExtensionId':_0x3a5503['id']},{'type':_0x3a5503[_0xeb51('0x3')],'app':_0x3a5503[_0xeb51('0x7')]?_0xeb51('0x4'):_0xeb51('0x8'),'appdata':_0x3a5503[_0xeb51('0x7')]?'CDR(routeAlias)='+_0x3a5503[_0xeb51('0x7')]:_0xeb51('0x9'),'context':_0x3a5503[_0xeb51('0x6')],'exten':_0x3a5503['exten'],'priority':_0x29c8be++,'VoiceExtensionId':_0x3a5503['id']}];if(_0x3a5503[_0xeb51('0x3')]===_0xeb51('0xa')){_0x299960[_0xeb51('0xb')]({'type':_0xeb51('0xa'),'app':_0xeb51('0x4'),'appdata':'CDR(routeid)='+_0x3a5503['id'],'context':_0x3a5503['context'],'exten':_0x3a5503[_0xeb51('0xc')],'priority':_0x29c8be++,'VoiceExtensionId':_0x3a5503['id']});}_0x299960[_0xeb51('0xb')]({'type':_0x3a5503[_0xeb51('0x3')],'app':_0xeb51('0x4'),'appdata':_0xeb51('0xd'),'context':_0x3a5503[_0xeb51('0x6')],'exten':_0x3a5503[_0xeb51('0xc')],'priority':_0x29c8be++,'VoiceExtensionId':_0x3a5503['id']},{'type':_0x3a5503[_0xeb51('0x3')],'app':_0xeb51('0x4'),'appdata':_0xeb51('0xe'),'context':_0x3a5503['context'],'exten':_0x3a5503[_0xeb51('0xc')],'priority':_0x29c8be++,'VoiceExtensionId':_0x3a5503['id']},{'type':_0x3a5503[_0xeb51('0x3')],'app':_0xeb51('0x4'),'appdata':_0xeb51('0xf'),'context':_0x3a5503[_0xeb51('0x6')],'exten':_0x3a5503[_0xeb51('0xc')],'priority':_0x29c8be++,'VoiceExtensionId':_0x3a5503['id']});return _0x299960;}function _0xa19fea(_0x2f09a8){var _0x412a9e=0x2;var _0x50948f=[{'type':_0xeb51('0x10'),'app':_0xeb51('0x4'),'appdata':_0xeb51('0x11'),'context':_0x2f09a8[_0xeb51('0x6')],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']},{'type':'outbound','app':_0x2f09a8['alias']?'Set':_0xeb51('0x8'),'appdata':_0x2f09a8[_0xeb51('0x7')]?_0xeb51('0x12')+_0x2f09a8[_0xeb51('0x7')]:_0xeb51('0x9'),'context':_0x2f09a8['context'],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']},{'type':_0xeb51('0x10'),'app':_0xeb51('0x4'),'appdata':_0xeb51('0x13')+(_0x2f09a8[_0xeb51('0x14')]?_0xeb51('0x15')+_0x2f09a8[_0xeb51('0x14')]+'}':_0xeb51('0x16')),'context':_0x2f09a8[_0xeb51('0x6')],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']},{'type':_0xeb51('0x10'),'app':'Set','appdata':_0xeb51('0x17')+_0x2f09a8['id'],'context':_0x2f09a8[_0xeb51('0x6')],'exten':_0x2f09a8['exten'],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']},{'type':_0xeb51('0x10'),'app':_0xeb51('0x18'),'appdata':_0xeb51('0x19')+(_0x412a9e+0x2)+_0xeb51('0x1a')+(_0x412a9e+0x1)+')','context':_0x2f09a8[_0xeb51('0x6')],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']},{'type':_0xeb51('0x10'),'app':_0xeb51('0x4'),'appdata':_0x2f09a8[_0xeb51('0x14')]?'CDR(prefix)=${EXTEN:0:'+_0x2f09a8[_0xeb51('0x14')]+'}':_0xeb51('0x1b'),'context':_0x2f09a8[_0xeb51('0x6')],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']},{'type':_0xeb51('0x10'),'app':_0xeb51('0x4'),'appdata':_0xeb51('0xd'),'context':_0x2f09a8[_0xeb51('0x6')],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']},{'type':_0xeb51('0x10'),'app':_0xeb51('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2f09a8[_0xeb51('0x6')],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']},{'type':_0xeb51('0x10'),'app':_0xeb51('0x4'),'appdata':_0xeb51('0xf'),'context':_0x2f09a8[_0xeb51('0x6')],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']},{'type':_0xeb51('0x10'),'app':_0xeb51('0x4'),'appdata':_0xeb51('0x1c')+_0x2f09a8['id'],'context':_0x2f09a8[_0xeb51('0x6')],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']}];if(_0x2f09a8['hasOwnProperty'](_0xeb51('0x1d'))&&_0x2f09a8[_0xeb51('0x1d')]!==_0xeb51('0x1e')){_0x50948f['push']({'type':_0xeb51('0x10'),'app':_0xeb51('0x4'),'appdata':_0xeb51('0x1f'),'context':_0x2f09a8['context'],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']},{'type':_0xeb51('0x10'),'app':_0xeb51('0x4'),'appdata':_0xeb51('0x20')+_0x2f09a8[_0xeb51('0x1d')]||_0xeb51('0x21'),'context':_0x2f09a8[_0xeb51('0x6')],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']});}return _0x50948f;}function _0x57afff(_0x9531a3,_0x17b2bc){var _0x576778=[{'name':'trunk','param':0x0},{'name':_0xeb51('0x22'),'param':0x1},{'name':'options','param':0x2},{'name':_0xeb51('0x23'),'param':0x3}];var _0x865ee5={};var _0x1a72fc=_0x17b2bc[_0xeb51('0x24')](',');var _0x295e93=[];for(var _0x8a1489=0x0;_0x8a1489<_0x576778['length'];_0x8a1489++){switch(_0x576778[_0x8a1489]['name']){case _0xeb51('0x25'):_0x865ee5[_0xeb51('0x25')]=_0x1a72fc[_0x576778[_0x8a1489][_0xeb51('0x26')]]['split']('/')[0x1];_0x865ee5['phone']=_0x1a72fc[_0x576778[_0x8a1489][_0xeb51('0x26')]][_0xeb51('0x24')]('/')[0x2];_0x865ee5[_0xeb51('0x27')]=_0x865ee5[_0xeb51('0x28')]?_0x865ee5[_0xeb51('0x28')][_0xeb51('0x24')]('$')[0x0]:undefined;_0x865ee5[_0xeb51('0x28')]=_0x9531a3[_0xeb51('0x14')]?(_0x865ee5[_0xeb51('0x27')]||'')+_0xeb51('0x15')+_0x9531a3['cutdigits']+'}':(_0x865ee5[_0xeb51('0x27')]||'')+'${EXTEN}';_0x295e93[_0x576778[_0x8a1489][_0xeb51('0x26')]]=[_0xeb51('0x29'),_0x865ee5[_0xeb51('0x25')],_0x865ee5[_0xeb51('0x28')]][_0xeb51('0x2a')]('/');break;case _0xeb51('0x2b'):_0x865ee5['options']=_0x1a72fc[_0x576778[_0x8a1489][_0xeb51('0x26')]];if(_0x9531a3['recordingFormat']!==_0xeb51('0x1e')){if(_0x865ee5[_0xeb51('0x2b')][_0xeb51('0x2c')](_0xeb51('0x2d'))<0x0){_0x865ee5[_0xeb51('0x2b')]+=_0xeb51('0x2d');}}else{_0x865ee5['options']=_0x865ee5[_0xeb51('0x2b')][_0xeb51('0x2e')](_0xeb51('0x2d'),'');}_0x295e93[_0x576778[_0x8a1489][_0xeb51('0x26')]]=_0x865ee5[_0xeb51('0x2b')];break;default:_0x295e93[_0x576778[_0x8a1489]['param']]=_0x1a72fc[_0x576778[_0x8a1489][_0xeb51('0x26')]];}}return _0x295e93[_0xeb51('0x2a')](',');}function _0x3aac13(_0x5153eb,_0x26469d,_0x2be2be){return new Promise(function(_0x157648,_0x5ac168){var _0x2084ed=[];if(_['isEmpty'](_0x26469d))return _0x157648(_0x2084ed);_0x11110e[_0xeb51('0x2f')]['findAll']({'attributes':['id',_0xeb51('0x30'),_0xeb51('0x31')],'raw':!![]})[_0xeb51('0x32')](function(_0x3eb9be){for(var _0x285493=0x0,_0x2449b5=0x0;_0x285493<_0x26469d[_0xeb51('0x33')];_0x285493++,_0x2449b5=0x0){var _0x1950eb=_0x26469d[_0x285493];var _0xf2da20=[];var _0x153055=[];delete _0x1950eb['id'];if(_0x1950eb['interval']!==_0xeb51('0x34')){_0x1950eb[_0xeb51('0x35')]=[_0x1950eb[_0xeb51('0x30')]];}else{_0x1950eb[_0xeb51('0x35')]=_0x1950eb['IntervalId']?_[_0xeb51('0x36')](_[_0xeb51('0x37')](_0x3eb9be,{'IntervalId':_0x1950eb[_0xeb51('0x31')]}),_0xeb51('0x30')):[];}_0x1950eb[_0xeb51('0x6')]=_0x5153eb[_0xeb51('0x6')];_0x1950eb['exten']=_0x5153eb[_0xeb51('0xc')];if(_0x1950eb[_0xeb51('0x3')])_0x1950eb[_0xeb51('0x3')]=_0x1950eb[_0xeb51('0x3')]['toLowerCase']();if(_0x5153eb[_0xeb51('0x3')]===_0xeb51('0x10')){if(_0x1950eb[_0xeb51('0x38')]('tag')&&_0x1950eb[_0xeb51('0x39')]&&_0x1950eb[_0xeb51('0x39')]!=='--'){_0xf2da20[_0xeb51('0xb')]({'type':_0x1950eb[_0xeb51('0x3')][_0xeb51('0x3a')](),'app':_0xeb51('0x4'),'appdata':_0xeb51('0x3b')+_0x1950eb['tag'],'context':_0x5153eb['context'],'exten':_0x5153eb[_0xeb51('0xc')],'priority':_0x1950eb['intervals']['length']+_0x2be2be+_0x2449b5++,'VoiceExtensionId':_0x5153eb['id']});}_0xf2da20[_0xeb51('0xb')]({'type':_0x1950eb['type'][_0xeb51('0x3a')](),'app':_0xeb51('0x18'),'appdata':_0xeb51('0x3c')+(_0x1950eb[_0xeb51('0x3d')]?'Set(CALLERID(all)='+_0x1950eb[_0xeb51('0x3d')]+')':_0xeb51('0x3e')),'context':_0x5153eb[_0xeb51('0x6')],'exten':_0x5153eb[_0xeb51('0xc')],'priority':_0x1950eb['intervals'][_0xeb51('0x33')]+_0x2be2be+_0x2449b5++,'VoiceExtensionId':_0x5153eb['id']});}else{if(_0x1950eb[_0xeb51('0x38')]('answer')){if(['queue',_0xeb51('0x3f')][_0xeb51('0x40')](_0x1950eb[_0xeb51('0x41')][_0xeb51('0x3a')]())&&_0x1950eb['appType']!==_0xeb51('0x42')){if(_0x1950eb['answer']){_0xf2da20[_0xeb51('0xb')]({'type':_0x1950eb[_0xeb51('0x3')]['toLowerCase'](),'app':_0xeb51('0x18'),'appdata':_0xeb51('0x43'),'context':_0x5153eb[_0xeb51('0x6')],'exten':_0x5153eb[_0xeb51('0xc')],'priority':_0x1950eb[_0xeb51('0x35')][_0xeb51('0x33')]+_0x2be2be+_0x2449b5++,'VoiceExtensionId':_0x5153eb['id']});_0xf2da20[_0xeb51('0xb')]({'type':_0x1950eb['type']['toLowerCase'](),'app':_0xeb51('0x4'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x5153eb[_0xeb51('0x6')],'exten':_0x5153eb[_0xeb51('0xc')],'priority':_0x1950eb[_0xeb51('0x35')][_0xeb51('0x33')]+_0x2be2be+_0x2449b5++,'VoiceExtensionId':_0x5153eb['id']});}else{_0xf2da20[_0xeb51('0xb')]({'type':_0x1950eb[_0xeb51('0x3')][_0xeb51('0x3a')](),'app':'ExecIf','appdata':_0xeb51('0x44'),'context':_0x5153eb[_0xeb51('0x6')],'exten':_0x5153eb[_0xeb51('0xc')],'priority':_0x1950eb[_0xeb51('0x35')][_0xeb51('0x33')]+_0x2be2be+_0x2449b5++,'VoiceExtensionId':_0x5153eb['id']});_0xf2da20['push']({'type':_0x1950eb[_0xeb51('0x3')][_0xeb51('0x3a')](),'app':'Set','appdata':_0xeb51('0x45'),'context':_0x5153eb[_0xeb51('0x6')],'exten':_0x5153eb[_0xeb51('0xc')],'priority':_0x1950eb['intervals']['length']+_0x2be2be+_0x2449b5++,'VoiceExtensionId':_0x5153eb['id']});}}}}for(var _0x1f3c9b=0x0;_0x1f3c9b<_0x1950eb['intervals'][_0xeb51('0x33')];_0x1f3c9b++){var _0x42e106=_0x2be2be+_0x1950eb[_0xeb51('0x35')][_0xeb51('0x33')];var _0x4bb88a=_0x1f3c9b===_0x1950eb[_0xeb51('0x35')]['length']-0x1?_0x2be2be+_0xf2da20[_0xeb51('0x33')]+_0x153055['length']+0x2:_0x2be2be+_0x1f3c9b+0x1;_0xf2da20[_0xeb51('0x46')](_0x1f3c9b,0x0,{'type':_0x5153eb[_0xeb51('0x3')],'app':'GotoIfTime','appdata':_0x1950eb[_0xeb51('0x35')][_0x1f3c9b]+'?'+_0x5153eb[_0xeb51('0x6')]+_0xeb51('0x47')+_0x42e106+':'+_0x5153eb[_0xeb51('0x6')]+',${EXTEN},'+_0x4bb88a,'exten':_0x5153eb[_0xeb51('0xc')],'context':_0x5153eb[_0xeb51('0x6')],'priority':_0x2be2be+_0x1f3c9b,'VoiceExtensionId':_0x5153eb['id']});}if(_0x1950eb[_0xeb51('0x48')]===_0xeb51('0x49'))_0x1950eb[_0xeb51('0x4a')]=_0x57afff(_0x5153eb,_0x1950eb['appdata']);_0x1950eb[_0xeb51('0x4b')]=_0xf2da20[_0xeb51('0x33')]?_[_0xeb51('0x4c')](_0xf2da20)['priority']+0x1:_0x2be2be;_0x2084ed=_[_0xeb51('0x4d')](_0x2084ed,_0xf2da20,[_0x1950eb],_0x153055);_0x2be2be=_[_0xeb51('0x4c')](_0x2084ed)['priority']+0x1;}return _0x157648(_0x2084ed);})[_0xeb51('0x4e')](function(_0x39301a){_0x5ac168(_0x39301a);});});}return _0x4e844b[_0xeb51('0x4f')](_0xeb51('0x50'),attributes,{'tableName':_0xeb51('0x51'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3a4768){var _0x251df1=this[_0xeb51('0x52')]({'plain':!![]});var _0x5f1c8d=_0x251df1['type']===_0xeb51('0x10')?_0xa19fea(_0x251df1):_0x41170d(_0x251df1);return _0x3aac13(_0x251df1,_0x3a4768,_[_0xeb51('0x4c')](_0x5f1c8d)[_0xeb51('0x4b')]+0x1)['then'](function(_0x176366){var _0x4a8208=_[_0xeb51('0x4d')](_0x5f1c8d,_0x176366);_0x4a8208[_0xeb51('0xb')]({'type':_0x251df1[_0xeb51('0x3')],'app':_0xeb51('0x53'),'exten':_0x251df1[_0xeb51('0xc')],'context':_0x251df1[_0xeb51('0x6')],'priority':_[_0xeb51('0x4c')](_0x4a8208)['priority']+0x1,'VoiceExtensionId':_0x251df1['id']});return _0x4a8208;});}}});}; \ No newline at end of file +var _0xc4f5=['priority','concat','VoiceExtension','get','Hangup','./voiceExtension.attributes','exports','models','Set','CDR(type)=','type','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','XCALLY-MOTION-PROGRESS=0','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','timeout','options','length','trunk','param','split','phone','prefix','SIP','join','replace','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','outboundDial','appdata','last'];(function(_0x4ae5d1,_0x29bc8a){var _0x15b583=function(_0x2429c5){while(--_0x2429c5){_0x4ae5d1['push'](_0x4ae5d1['shift']());}};_0x15b583(++_0x29bc8a);}(_0xc4f5,0xa5));var _0x5c4f=function(_0x26dc96,_0x10c6f5){_0x26dc96=_0x26dc96-0x0;var _0x30b7be=_0xc4f5[_0x26dc96];return _0x30b7be;};'use strict';var _=require('lodash');var attributes=require(_0x5c4f('0x0'));module[_0x5c4f('0x1')]=function(_0x37e15c){var _0x515f4c=_0x37e15c[_0x5c4f('0x2')];function _0x221555(_0x24c5b6){var _0xfd69b2=0x2;var _0x2676f7=[{'type':_0x24c5b6['type'],'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0x4')+_0x24c5b6[_0x5c4f('0x5')],'context':_0x24c5b6[_0x5c4f('0x6')],'exten':_0x24c5b6[_0x5c4f('0x7')],'priority':_0xfd69b2++,'VoiceExtensionId':_0x24c5b6['id']},{'type':_0x24c5b6['type'],'app':_0x24c5b6[_0x5c4f('0x8')]?'Set':_0x5c4f('0x9'),'appdata':_0x24c5b6['alias']?_0x5c4f('0xa')+_0x24c5b6[_0x5c4f('0x8')]:_0x5c4f('0xb'),'context':_0x24c5b6[_0x5c4f('0x6')],'exten':_0x24c5b6[_0x5c4f('0x7')],'priority':_0xfd69b2++,'VoiceExtensionId':_0x24c5b6['id']}];if(_0x24c5b6[_0x5c4f('0x5')]===_0x5c4f('0xc')){_0x2676f7['push']({'type':_0x5c4f('0xc'),'app':_0x5c4f('0x3'),'appdata':'CDR(routeid)='+_0x24c5b6['id'],'context':_0x24c5b6[_0x5c4f('0x6')],'exten':_0x24c5b6[_0x5c4f('0x7')],'priority':_0xfd69b2++,'VoiceExtensionId':_0x24c5b6['id']});}_0x2676f7[_0x5c4f('0xd')]({'type':_0x24c5b6[_0x5c4f('0x5')],'app':_0x5c4f('0x3'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x24c5b6['context'],'exten':_0x24c5b6[_0x5c4f('0x7')],'priority':_0xfd69b2++,'VoiceExtensionId':_0x24c5b6['id']},{'type':_0x24c5b6[_0x5c4f('0x5')],'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0xe'),'context':_0x24c5b6[_0x5c4f('0x6')],'exten':_0x24c5b6['exten'],'priority':_0xfd69b2++,'VoiceExtensionId':_0x24c5b6['id']},{'type':_0x24c5b6['type'],'app':_0x5c4f('0x3'),'appdata':'MONITOR_OPTIONS=ab','context':_0x24c5b6['context'],'exten':_0x24c5b6[_0x5c4f('0x7')],'priority':_0xfd69b2++,'VoiceExtensionId':_0x24c5b6['id']});return _0x2676f7;}function _0x5154eb(_0x3824b0){var _0x2cff0f=0x2;var _0x2360da=[{'type':_0x5c4f('0xf'),'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0x10'),'context':_0x3824b0[_0x5c4f('0x6')],'exten':_0x3824b0[_0x5c4f('0x7')],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']},{'type':_0x5c4f('0xf'),'app':_0x3824b0['alias']?_0x5c4f('0x3'):_0x5c4f('0x9'),'appdata':_0x3824b0[_0x5c4f('0x8')]?_0x5c4f('0xa')+_0x3824b0['alias']:'No\x20alias\x20set','context':_0x3824b0[_0x5c4f('0x6')],'exten':_0x3824b0[_0x5c4f('0x7')],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']},{'type':_0x5c4f('0xf'),'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0x11')+(_0x3824b0[_0x5c4f('0x12')]?_0x5c4f('0x13')+_0x3824b0[_0x5c4f('0x12')]+'}':'${EXTEN}'),'context':_0x3824b0['context'],'exten':_0x3824b0[_0x5c4f('0x7')],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']},{'type':_0x5c4f('0xf'),'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0x14')+_0x3824b0['id'],'context':_0x3824b0['context'],'exten':_0x3824b0[_0x5c4f('0x7')],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']},{'type':_0x5c4f('0xf'),'app':_0x5c4f('0x15'),'appdata':_0x5c4f('0x16')+(_0x2cff0f+0x2)+_0x5c4f('0x17')+(_0x2cff0f+0x1)+')','context':_0x3824b0['context'],'exten':_0x3824b0[_0x5c4f('0x7')],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']},{'type':_0x5c4f('0xf'),'app':_0x5c4f('0x3'),'appdata':_0x3824b0[_0x5c4f('0x12')]?_0x5c4f('0x18')+_0x3824b0[_0x5c4f('0x12')]+'}':'CDR(prefix)=noprefix','context':_0x3824b0[_0x5c4f('0x6')],'exten':_0x3824b0[_0x5c4f('0x7')],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']},{'type':_0x5c4f('0xf'),'app':_0x5c4f('0x3'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x3824b0['context'],'exten':_0x3824b0['exten'],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']},{'type':_0x5c4f('0xf'),'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0xe'),'context':_0x3824b0[_0x5c4f('0x6')],'exten':_0x3824b0[_0x5c4f('0x7')],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']},{'type':_0x5c4f('0xf'),'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0x19'),'context':_0x3824b0[_0x5c4f('0x6')],'exten':_0x3824b0[_0x5c4f('0x7')],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']},{'type':_0x5c4f('0xf'),'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0x1a')+_0x3824b0['id'],'context':_0x3824b0['context'],'exten':_0x3824b0['exten'],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']}];if(_0x3824b0[_0x5c4f('0x1b')]('recordingFormat')&&_0x3824b0[_0x5c4f('0x1c')]!==_0x5c4f('0x1d')){_0x2360da[_0x5c4f('0xd')]({'type':_0x5c4f('0xf'),'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0x1e'),'context':_0x3824b0[_0x5c4f('0x6')],'exten':_0x3824b0['exten'],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']},{'type':_0x5c4f('0xf'),'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0x1f')+_0x3824b0['recordingFormat']||'wav','context':_0x3824b0['context'],'exten':_0x3824b0[_0x5c4f('0x7')],'priority':_0x2cff0f++,'VoiceExtensionId':_0x3824b0['id']});}return _0x2360da;}function _0x1ffc6e(_0x46b020,_0x1025e2){var _0x447b4f=[{'name':'trunk','param':0x0},{'name':_0x5c4f('0x20'),'param':0x1},{'name':_0x5c4f('0x21'),'param':0x2},{'name':'url','param':0x3}];var _0x3b65c7={};var _0x9a12cb=_0x1025e2['split'](',');var _0x5c7281=[];for(var _0x130f17=0x0;_0x130f17<_0x447b4f[_0x5c4f('0x22')];_0x130f17++){switch(_0x447b4f[_0x130f17]['name']){case _0x5c4f('0x23'):_0x3b65c7[_0x5c4f('0x23')]=_0x9a12cb[_0x447b4f[_0x130f17][_0x5c4f('0x24')]][_0x5c4f('0x25')]('/')[0x1];_0x3b65c7[_0x5c4f('0x26')]=_0x9a12cb[_0x447b4f[_0x130f17]['param']][_0x5c4f('0x25')]('/')[0x2];_0x3b65c7['prefix']=_0x3b65c7[_0x5c4f('0x26')]?_0x3b65c7[_0x5c4f('0x26')][_0x5c4f('0x25')]('$')[0x0]:undefined;_0x3b65c7[_0x5c4f('0x26')]=_0x46b020[_0x5c4f('0x12')]?(_0x3b65c7[_0x5c4f('0x27')]||'')+_0x5c4f('0x13')+_0x46b020[_0x5c4f('0x12')]+'}':(_0x3b65c7[_0x5c4f('0x27')]||'')+'${EXTEN}';_0x5c7281[_0x447b4f[_0x130f17]['param']]=[_0x5c4f('0x28'),_0x3b65c7[_0x5c4f('0x23')],_0x3b65c7['phone']][_0x5c4f('0x29')]('/');break;case _0x5c4f('0x21'):_0x3b65c7[_0x5c4f('0x21')]=_0x9a12cb[_0x447b4f[_0x130f17][_0x5c4f('0x24')]];if(_0x46b020[_0x5c4f('0x1c')]!==_0x5c4f('0x1d')){if(_0x3b65c7['options']['indexOf']('U(xcally-mixmonitor-context)')<0x0){_0x3b65c7[_0x5c4f('0x21')]+='U(xcally-mixmonitor-context)';}}else{_0x3b65c7[_0x5c4f('0x21')]=_0x3b65c7[_0x5c4f('0x21')][_0x5c4f('0x2a')](_0x5c4f('0x2b'),'');}_0x5c7281[_0x447b4f[_0x130f17]['param']]=_0x3b65c7['options'];break;default:_0x5c7281[_0x447b4f[_0x130f17]['param']]=_0x9a12cb[_0x447b4f[_0x130f17]['param']];}}return _0x5c7281[_0x5c4f('0x29')](',');}function _0x1ead67(_0x2be120,_0x280b3a,_0x13075f){return new Promise(function(_0x3684b3,_0x2a40b8){var _0x1b7a55=[];if(_[_0x5c4f('0x2c')](_0x280b3a))return _0x3684b3(_0x1b7a55);_0x515f4c[_0x5c4f('0x2d')][_0x5c4f('0x2e')]({'attributes':['id',_0x5c4f('0x2f'),_0x5c4f('0x30')],'raw':!![]})[_0x5c4f('0x31')](function(_0x2d01d9){for(var _0x219616=0x0,_0x4e2f3e=0x0;_0x219616<_0x280b3a[_0x5c4f('0x22')];_0x219616++,_0x4e2f3e=0x0){var _0x1a6a58=_0x280b3a[_0x219616];var _0x88ca8b=[];var _0x3f21c4=[];delete _0x1a6a58['id'];if(_0x1a6a58[_0x5c4f('0x2f')]!==_0x5c4f('0x32')){_0x1a6a58['intervals']=[_0x1a6a58[_0x5c4f('0x2f')]];}else{_0x1a6a58[_0x5c4f('0x33')]=_0x1a6a58['IntervalId']?_[_0x5c4f('0x34')](_[_0x5c4f('0x35')](_0x2d01d9,{'IntervalId':_0x1a6a58[_0x5c4f('0x30')]}),_0x5c4f('0x2f')):[];}_0x1a6a58['context']=_0x2be120[_0x5c4f('0x6')];_0x1a6a58[_0x5c4f('0x7')]=_0x2be120['exten'];if(_0x1a6a58[_0x5c4f('0x5')])_0x1a6a58[_0x5c4f('0x5')]=_0x1a6a58[_0x5c4f('0x5')][_0x5c4f('0x36')]();if(_0x2be120['type']===_0x5c4f('0xf')){if(_0x1a6a58[_0x5c4f('0x1b')](_0x5c4f('0x37'))&&_0x1a6a58[_0x5c4f('0x37')]&&_0x1a6a58[_0x5c4f('0x37')]!=='--'){_0x88ca8b[_0x5c4f('0xd')]({'type':_0x1a6a58[_0x5c4f('0x5')][_0x5c4f('0x36')](),'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0x38')+_0x1a6a58[_0x5c4f('0x37')],'context':_0x2be120['context'],'exten':_0x2be120[_0x5c4f('0x7')],'priority':_0x1a6a58[_0x5c4f('0x33')][_0x5c4f('0x22')]+_0x13075f+_0x4e2f3e++,'VoiceExtensionId':_0x2be120['id']});}_0x88ca8b[_0x5c4f('0xd')]({'type':_0x1a6a58[_0x5c4f('0x5')]['toLowerCase'](),'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x1a6a58['callerID']?_0x5c4f('0x39')+_0x1a6a58[_0x5c4f('0x3a')]+')':_0x5c4f('0x3b')),'context':_0x2be120[_0x5c4f('0x6')],'exten':_0x2be120['exten'],'priority':_0x1a6a58['intervals'][_0x5c4f('0x22')]+_0x13075f+_0x4e2f3e++,'VoiceExtensionId':_0x2be120['id']});}else{if(_0x1a6a58['hasOwnProperty'](_0x5c4f('0x3c'))){if([_0x5c4f('0x3d'),_0x5c4f('0x3e')][_0x5c4f('0x3f')](_0x1a6a58[_0x5c4f('0x40')][_0x5c4f('0x36')]())&&_0x1a6a58[_0x5c4f('0x41')]!==_0x5c4f('0x42')){if(_0x1a6a58[_0x5c4f('0x3c')]){_0x88ca8b[_0x5c4f('0xd')]({'type':_0x1a6a58['type'][_0x5c4f('0x36')](),'app':_0x5c4f('0x15'),'appdata':_0x5c4f('0x43'),'context':_0x2be120['context'],'exten':_0x2be120[_0x5c4f('0x7')],'priority':_0x1a6a58[_0x5c4f('0x33')][_0x5c4f('0x22')]+_0x13075f+_0x4e2f3e++,'VoiceExtensionId':_0x2be120['id']});_0x88ca8b[_0x5c4f('0xd')]({'type':_0x1a6a58[_0x5c4f('0x5')]['toLowerCase'](),'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x2be120[_0x5c4f('0x6')],'exten':_0x2be120['exten'],'priority':_0x1a6a58[_0x5c4f('0x33')][_0x5c4f('0x22')]+_0x13075f+_0x4e2f3e++,'VoiceExtensionId':_0x2be120['id']});}else{_0x88ca8b['push']({'type':_0x1a6a58[_0x5c4f('0x5')][_0x5c4f('0x36')](),'app':_0x5c4f('0x15'),'appdata':_0x5c4f('0x44'),'context':_0x2be120[_0x5c4f('0x6')],'exten':_0x2be120[_0x5c4f('0x7')],'priority':_0x1a6a58[_0x5c4f('0x33')][_0x5c4f('0x22')]+_0x13075f+_0x4e2f3e++,'VoiceExtensionId':_0x2be120['id']});_0x88ca8b[_0x5c4f('0xd')]({'type':_0x1a6a58[_0x5c4f('0x5')][_0x5c4f('0x36')](),'app':_0x5c4f('0x3'),'appdata':_0x5c4f('0x45'),'context':_0x2be120[_0x5c4f('0x6')],'exten':_0x2be120[_0x5c4f('0x7')],'priority':_0x1a6a58[_0x5c4f('0x33')][_0x5c4f('0x22')]+_0x13075f+_0x4e2f3e++,'VoiceExtensionId':_0x2be120['id']});}}}}for(var _0x5e52ec=0x0;_0x5e52ec<_0x1a6a58[_0x5c4f('0x33')]['length'];_0x5e52ec++){var _0x132924=_0x13075f+_0x1a6a58[_0x5c4f('0x33')][_0x5c4f('0x22')];var _0x7ff8b8=_0x5e52ec===_0x1a6a58[_0x5c4f('0x33')][_0x5c4f('0x22')]-0x1?_0x13075f+_0x88ca8b[_0x5c4f('0x22')]+_0x3f21c4[_0x5c4f('0x22')]+0x2:_0x13075f+_0x5e52ec+0x1;_0x88ca8b[_0x5c4f('0x46')](_0x5e52ec,0x0,{'type':_0x2be120[_0x5c4f('0x5')],'app':_0x5c4f('0x47'),'appdata':_0x1a6a58['intervals'][_0x5e52ec]+'?'+_0x2be120[_0x5c4f('0x6')]+',${EXTEN},'+_0x132924+':'+_0x2be120['context']+',${EXTEN},'+_0x7ff8b8,'exten':_0x2be120[_0x5c4f('0x7')],'context':_0x2be120[_0x5c4f('0x6')],'priority':_0x13075f+_0x5e52ec,'VoiceExtensionId':_0x2be120['id']});}if(_0x1a6a58['appType']===_0x5c4f('0x48'))_0x1a6a58[_0x5c4f('0x49')]=_0x1ffc6e(_0x2be120,_0x1a6a58[_0x5c4f('0x49')]);_0x1a6a58['priority']=_0x88ca8b[_0x5c4f('0x22')]?_[_0x5c4f('0x4a')](_0x88ca8b)[_0x5c4f('0x4b')]+0x1:_0x13075f;_0x1b7a55=_[_0x5c4f('0x4c')](_0x1b7a55,_0x88ca8b,[_0x1a6a58],_0x3f21c4);_0x13075f=_[_0x5c4f('0x4a')](_0x1b7a55)[_0x5c4f('0x4b')]+0x1;}return _0x3684b3(_0x1b7a55);})['catch'](function(_0x47a357){_0x2a40b8(_0x47a357);});});}return _0x37e15c['define'](_0x5c4f('0x4d'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x45cf01){var _0x4f64d4=this[_0x5c4f('0x4e')]({'plain':!![]});var _0x17535b=_0x4f64d4['type']==='outbound'?_0x5154eb(_0x4f64d4):_0x221555(_0x4f64d4);return _0x1ead67(_0x4f64d4,_0x45cf01,_[_0x5c4f('0x4a')](_0x17535b)[_0x5c4f('0x4b')]+0x1)['then'](function(_0x2535f1){var _0x231652=_[_0x5c4f('0x4c')](_0x17535b,_0x2535f1);_0x231652[_0x5c4f('0xd')]({'type':_0x4f64d4[_0x5c4f('0x5')],'app':_0x5c4f('0x4f'),'exten':_0x4f64d4['exten'],'context':_0x4f64d4[_0x5c4f('0x6')],'priority':_[_0x5c4f('0x4a')](_0x231652)[_0x5c4f('0x4b')]+0x1,'VoiceExtensionId':_0x4f64d4['id']});return _0x231652;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 3302e5b..3b86cfa 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 _0x1224=['request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','limit','include','model','map','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1224,0x10d));var _0x4122=function(_0x4ead23,_0x537fec){_0x4ead23=_0x4ead23-0x0;var _0x36bcae=_0x1224[_0x4ead23];return _0x36bcae;};'use strict';var _=require(_0x4122('0x0'));var util=require(_0x4122('0x1'));var moment=require(_0x4122('0x2'));var BPromise=require(_0x4122('0x3'));var rs=require(_0x4122('0x4'));var fs=require('fs');var Redis=require(_0x4122('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4122('0x6'));var logger=require(_0x4122('0x7'))(_0x4122('0x8'));var config=require('../../config/environment');var jayson=require(_0x4122('0x9'));var client=jayson[_0x4122('0xa')][_0x4122('0xb')]({'port':0x232a});config[_0x4122('0xc')]=_[_0x4122('0xd')](config[_0x4122('0xc')],{'host':_0x4122('0xe'),'port':0x18eb});var socket=require(_0x4122('0xf'))(new Redis(config[_0x4122('0xc')]));require(_0x4122('0x10'))[_0x4122('0x11')](socket);function respondWithRpcPromise(_0x4779e2,_0x251ade,_0x35160c){return new BPromise(function(_0x1d229f,_0x201538){return client[_0x4122('0x12')](_0x4779e2,_0x35160c)[_0x4122('0x13')](function(_0x476ed2){logger[_0x4122('0x14')](_0x4122('0x15'),_0x251ade,_0x4122('0x16'));logger[_0x4122('0x17')](_0x4122('0x18'),_0x251ade,_0x4122('0x16'),JSON[_0x4122('0x19')](_0x476ed2));if(_0x476ed2[_0x4122('0x1a')]){if(_0x476ed2[_0x4122('0x1a')][_0x4122('0x1b')]===0x1f4){logger[_0x4122('0x1a')](_0x4122('0x15'),_0x251ade,_0x476ed2['error'][_0x4122('0x1c')]);return _0x201538(_0x476ed2[_0x4122('0x1a')][_0x4122('0x1c')]);}logger[_0x4122('0x1a')]('VoiceExtension,\x20%s,\x20%s',_0x251ade,_0x476ed2[_0x4122('0x1a')][_0x4122('0x1c')]);return _0x1d229f(_0x476ed2['error'][_0x4122('0x1c')]);}else{logger[_0x4122('0x14')](_0x4122('0x15'),_0x251ade,_0x4122('0x16'));_0x1d229f(_0x476ed2[_0x4122('0x1d')][_0x4122('0x1c')]);}})[_0x4122('0x1e')](function(_0x5a4fe6){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x251ade,_0x5a4fe6);_0x201538(_0x5a4fe6);});});}exports[_0x4122('0x1f')]=function(_0x2d95e8){var _0x23033a=this;return new Promise(function(_0x1dde85,_0xef6995){return db[_0x4122('0x20')][_0x4122('0x21')]({'raw':_0x2d95e8[_0x4122('0x22')]?_0x2d95e8['options'][_0x4122('0x23')]===undefined?!![]:![]:!![],'where':_0x2d95e8['options']?_0x2d95e8['options']['where']||null:null,'attributes':_0x2d95e8[_0x4122('0x22')]?_0x2d95e8[_0x4122('0x22')][_0x4122('0x24')]||null:null,'limit':_0x2d95e8['options']?_0x2d95e8[_0x4122('0x22')][_0x4122('0x25')]||null:null,'include':_0x2d95e8['options']?_0x2d95e8['options'][_0x4122('0x26')]?_['map'](_0x2d95e8['options']['include'],function(_0x1b449b){return{'model':db[_0x1b449b[_0x4122('0x27')]],'as':_0x1b449b['as'],'attributes':_0x1b449b[_0x4122('0x24')],'include':_0x1b449b[_0x4122('0x26')]?_[_0x4122('0x28')](_0x1b449b[_0x4122('0x26')],function(_0x26768b){return{'model':db[_0x26768b[_0x4122('0x27')]],'as':_0x26768b['as'],'attributes':_0x26768b[_0x4122('0x24')],'include':_0x26768b[_0x4122('0x26')]?_[_0x4122('0x28')](_0x26768b[_0x4122('0x26')],function(_0xfefaf6){return{'model':db[_0xfefaf6['model']],'as':_0xfefaf6['as'],'attributes':_0xfefaf6[_0x4122('0x24')]};}):[]};}):[]};}):[]:[]})[_0x4122('0x13')](function(_0x79c85){logger[_0x4122('0x14')]('GetVoiceExtension',_0x2d95e8);logger[_0x4122('0x17')]('GetVoiceExtension',_0x2d95e8,JSON[_0x4122('0x19')](_0x79c85));_0x1dde85(_0x79c85);})[_0x4122('0x1e')](function(_0x3a9633){logger[_0x4122('0x1a')](_0x4122('0x1f'),_0x3a9633[_0x4122('0x1c')],_0x2d95e8);_0xef6995(_0x23033a[_0x4122('0x1a')](0x1f4,_0x3a9633[_0x4122('0x1c')]));});});}; \ No newline at end of file +var _0x91c6=['http','redis','localhost','socket.io-emitter','register','request','then','info','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','VoiceExtension,\x20%s,\x20%s','result','catch','findAll','options','raw','where','limit','map','include','model','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x91c6,0xf9));var _0x691c=function(_0x1248c9,_0x22f277){_0x1248c9=_0x1248c9-0x0;var _0x2f7ff0=_0x91c6[_0x1248c9];return _0x2f7ff0;};'use strict';var _=require(_0x691c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x691c('0x1'));var rs=require(_0x691c('0x2'));var fs=require('fs');var Redis=require(_0x691c('0x3'));var db=require(_0x691c('0x4'))['db'];var utils=require(_0x691c('0x5'));var logger=require('../../config/logger')(_0x691c('0x6'));var config=require(_0x691c('0x7'));var jayson=require(_0x691c('0x8'));var client=jayson[_0x691c('0x9')][_0x691c('0xa')]({'port':0x232a});config[_0x691c('0xb')]=_['defaults'](config[_0x691c('0xb')],{'host':_0x691c('0xc'),'port':0x18eb});var socket=require(_0x691c('0xd'))(new Redis(config[_0x691c('0xb')]));require('./voiceExtension.socket')[_0x691c('0xe')](socket);function respondWithRpcPromise(_0x22944b,_0x3efbfb,_0x53c1eb){return new BPromise(function(_0x4bf36c,_0x497367){return client[_0x691c('0xf')](_0x22944b,_0x53c1eb)[_0x691c('0x10')](function(_0x16ef24){logger[_0x691c('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x3efbfb,'request\x20sent');logger[_0x691c('0x12')](_0x691c('0x13'),_0x3efbfb,_0x691c('0x14'),JSON[_0x691c('0x15')](_0x16ef24));if(_0x16ef24[_0x691c('0x16')]){if(_0x16ef24[_0x691c('0x16')][_0x691c('0x17')]===0x1f4){logger[_0x691c('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x3efbfb,_0x16ef24[_0x691c('0x16')][_0x691c('0x18')]);return _0x497367(_0x16ef24[_0x691c('0x16')][_0x691c('0x18')]);}logger[_0x691c('0x16')](_0x691c('0x19'),_0x3efbfb,_0x16ef24[_0x691c('0x16')][_0x691c('0x18')]);return _0x4bf36c(_0x16ef24['error'][_0x691c('0x18')]);}else{logger[_0x691c('0x11')](_0x691c('0x19'),_0x3efbfb,_0x691c('0x14'));_0x4bf36c(_0x16ef24[_0x691c('0x1a')]['message']);}})[_0x691c('0x1b')](function(_0x2bc7fe){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x3efbfb,_0x2bc7fe);_0x497367(_0x2bc7fe);});});}exports['GetVoiceExtension']=function(_0x152965){var _0x5d07de=this;return new Promise(function(_0x2a9195,_0x53a419){return db['VoiceExtension'][_0x691c('0x1c')]({'raw':_0x152965[_0x691c('0x1d')]?_0x152965[_0x691c('0x1d')][_0x691c('0x1e')]===undefined?!![]:![]:!![],'where':_0x152965[_0x691c('0x1d')]?_0x152965['options'][_0x691c('0x1f')]||null:null,'attributes':_0x152965['options']?_0x152965[_0x691c('0x1d')]['attributes']||null:null,'limit':_0x152965[_0x691c('0x1d')]?_0x152965[_0x691c('0x1d')][_0x691c('0x20')]||null:null,'include':_0x152965[_0x691c('0x1d')]?_0x152965[_0x691c('0x1d')]['include']?_[_0x691c('0x21')](_0x152965['options'][_0x691c('0x22')],function(_0x22cc77){return{'model':db[_0x22cc77[_0x691c('0x23')]],'as':_0x22cc77['as'],'attributes':_0x22cc77[_0x691c('0x24')],'include':_0x22cc77[_0x691c('0x22')]?_[_0x691c('0x21')](_0x22cc77[_0x691c('0x22')],function(_0xccf826){return{'model':db[_0xccf826['model']],'as':_0xccf826['as'],'attributes':_0xccf826[_0x691c('0x24')],'include':_0xccf826[_0x691c('0x22')]?_[_0x691c('0x21')](_0xccf826[_0x691c('0x22')],function(_0x598ece){return{'model':db[_0x598ece['model']],'as':_0x598ece['as'],'attributes':_0x598ece[_0x691c('0x24')]};}):[]};}):[]};}):[]:[]})[_0x691c('0x10')](function(_0x4feaa6){logger[_0x691c('0x11')]('GetVoiceExtension',_0x152965);logger[_0x691c('0x12')]('GetVoiceExtension',_0x152965,JSON[_0x691c('0x15')](_0x4feaa6));_0x2a9195(_0x4feaa6);})[_0x691c('0x1b')](function(_0x21c531){logger['error']('GetVoiceExtension',_0x21c531[_0x691c('0x18')],_0x152965);_0x53a419(_0x5d07de[_0x691c('0x16')](0x1f4,_0x21c531[_0x691c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index b56239f..105e709 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 _0xc4aa=['remove','update','removeListener','register','length','./voiceExtension.events','save'];(function(_0xdddfad,_0x10ae21){var _0x1d5c15=function(_0x3db485){while(--_0x3db485){_0xdddfad['push'](_0xdddfad['shift']());}};_0x1d5c15(++_0x10ae21);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xc4aa[_0x4d613c];return _0x301fe3;};'use strict';var VoiceExtensionEvents=require(_0xac4a('0x0'));var events=[_0xac4a('0x1'),_0xac4a('0x2'),_0xac4a('0x3')];function createListener(_0x275161,_0x22469d){return function(_0x58634e){_0x22469d['emit'](_0x275161,_0x58634e);};}function removeListener(_0x47d4f6,_0x2f48ed){return function(){VoiceExtensionEvents[_0xac4a('0x4')](_0x47d4f6,_0x2f48ed);};}exports[_0xac4a('0x5')]=function(_0x215f39){for(var _0x96be2b=0x0,_0x15cd34=events[_0xac4a('0x6')];_0x96be2b<_0x15cd34;_0x96be2b++){var _0x10525b=events[_0x96be2b];var _0x5c6179=createListener('voiceExtension:'+_0x10525b,_0x215f39);VoiceExtensionEvents['on'](_0x10525b,_0x5c6179);}}; \ No newline at end of file +var _0x5fc3=['./voiceExtension.events','save','update','emit','removeListener','register','voiceExtension:'];(function(_0x37c84e,_0x54d3fe){var _0x4737ce=function(_0x4ec94b){while(--_0x4ec94b){_0x37c84e['push'](_0x37c84e['shift']());}};_0x4737ce(++_0x54d3fe);}(_0x5fc3,0xa8));var _0x35fc=function(_0x47b15f,_0x103e93){_0x47b15f=_0x47b15f-0x0;var _0x55bf25=_0x5fc3[_0x47b15f];return _0x55bf25;};'use strict';var VoiceExtensionEvents=require(_0x35fc('0x0'));var events=[_0x35fc('0x1'),'remove',_0x35fc('0x2')];function createListener(_0x2ac6da,_0x196bc2){return function(_0x91d024){_0x196bc2[_0x35fc('0x3')](_0x2ac6da,_0x91d024);};}function removeListener(_0x5e75e6,_0x2d1404){return function(){VoiceExtensionEvents[_0x35fc('0x4')](_0x5e75e6,_0x2d1404);};}exports[_0x35fc('0x5')]=function(_0x5b85ad){for(var _0x5754be=0x0,_0x19a0d1=events['length'];_0x5754be<_0x19a0d1;_0x5754be++){var _0x16e153=events[_0x5754be];var _0x27524f=createListener(_0x35fc('0x6')+_0x16e153,_0x5b85ad);VoiceExtensionEvents['on'](_0x16e153,_0x27524f);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index ea4883f..708ff01 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 _0x3e24=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','create','destroy','exports','multer'];(function(_0x1c7b4c,_0x5b85b2){var _0x18daf6=function(_0xbe824e){while(--_0xbe824e){_0x1c7b4c['push'](_0x1c7b4c['shift']());}};_0x18daf6(++_0x5b85b2);}(_0x3e24,0x167));var _0x43e2=function(_0x425b10,_0xe4cbbe){_0x425b10=_0x425b10-0x0;var _0x1eecfe=_0x3e24[_0x425b10];return _0x1eecfe;};'use strict';var multer=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var path=require(_0x43e2('0x2'));var timeout=require(_0x43e2('0x3'));var express=require(_0x43e2('0x4'));var router=express['Router']();var fs_extra=require(_0x43e2('0x5'));var auth=require(_0x43e2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x43e2('0x7'));var controller=require(_0x43e2('0x8'));router[_0x43e2('0x9')]('/',auth[_0x43e2('0xa')](),controller[_0x43e2('0xb')]);router[_0x43e2('0x9')](_0x43e2('0xc'),auth['isAuthenticated'](),controller[_0x43e2('0xd')]);router[_0x43e2('0x9')]('/:id/messages',auth[_0x43e2('0xa')](),controller[_0x43e2('0xe')]);router['post']('/',auth[_0x43e2('0xa')](),controller[_0x43e2('0xf')]);router['put'](_0x43e2('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x43e2('0xc'),auth[_0x43e2('0xa')](),controller[_0x43e2('0x10')]);module[_0x43e2('0x11')]=router; \ No newline at end of file +var _0x2ef3=['express','Router','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','/:id','isAuthenticated','show','/:id/messages','getMessages','post','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x3a236c,_0x209f66){var _0x5b824f=function(_0x2b0602){while(--_0x2b0602){_0x3a236c['push'](_0x3a236c['shift']());}};_0x5b824f(++_0x209f66);}(_0x2ef3,0xba));var _0x32ef=function(_0x595a2c,_0x2d968e){_0x595a2c=_0x595a2c-0x0;var _0x37d4ec=_0x2ef3[_0x595a2c];return _0x37d4ec;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0xf')]('/',auth[_0x32ef('0xb')](),controller['create']);router['put'](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x10')]);router[_0x32ef('0x11')]('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 361b184..9367542 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 _0x1804=['getDataValue','fullname','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER'];(function(_0x56daff,_0xadca9a){var _0x132c82=function(_0x19e0d7){while(--_0x19e0d7){_0x56daff['push'](_0x56daff['shift']());}};_0x132c82(++_0xadca9a);}(_0x1804,0x1a2));var _0x4180=function(_0x441460,_0x1cb275){_0x441460=_0x441460-0x0;var _0x20e15b=_0x1804[_0x441460];return _0x20e15b;};'use strict';var Sequelize=require('sequelize');module[_0x4180('0x0')]={'customer_id':{'type':Sequelize[_0x4180('0x1')]},'context':{'type':Sequelize[_0x4180('0x1')],'defaultValue':_0x4180('0x2'),'unique':_0x4180('0x3')},'mailbox':{'type':Sequelize[_0x4180('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x4180('0x1')]},'fullname':{'type':Sequelize[_0x4180('0x1')]},'email':{'type':Sequelize[_0x4180('0x1')],'validate':{'isEmail':!![]},'set':function(_0x2ded3a){this[_0x4180('0x4')](_0x4180('0x5'),typeof _0x2ded3a===_0x4180('0x6')&&_0x2ded3a[_0x4180('0x7')]()?_0x2ded3a[_0x4180('0x7')]():null);}},'pager':{'type':Sequelize[_0x4180('0x1')]},'tz':{'type':Sequelize[_0x4180('0x1')],'defaultValue':_0x4180('0x8')},'attach':{'type':Sequelize[_0x4180('0x9')](_0x4180('0xa'),'no'),'defaultValue':_0x4180('0xa'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x4180('0xa'),'no'),'defaultValue':_0x4180('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x4180('0x1')]},'callback':{'type':Sequelize[_0x4180('0x1')]},'review':{'type':Sequelize['ENUM'](_0x4180('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x4180('0x9')](_0x4180('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x4180('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x4180('0x9')](_0x4180('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x4180('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x4180('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x4180('0x9')](_0x4180('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x4180('0x9')](_0x4180('0xa'),'no'),'defaultValue':_0x4180('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x4180('0x9')](_0x4180('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x4180('0x9')](_0x4180('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x4180('0x9')](_0x4180('0xa'),'no'),'defaultValue':_0x4180('0xa'),'allowNull':![]},'stamp':{'type':_0x4180('0xc')},'emailsubject':{'type':Sequelize[_0x4180('0x1')]},'emailbody':{'type':Sequelize[_0x4180('0x1')]},'maxsecs':{'type':Sequelize[_0x4180('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x4180('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x4180('0xe')](_0x4180('0xf'))+'\x20-\x20'+this[_0x4180('0xe')]('mailbox');}}}; \ No newline at end of file +var _0xf829=['trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','getDataValue','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string'];(function(_0x2e7b84,_0x25ea06){var _0x6b60fc=function(_0x2b6aa5){while(--_0x2b6aa5){_0x2e7b84['push'](_0x2e7b84['shift']());}};_0x6b60fc(++_0x25ea06);}(_0xf829,0x115));var _0x9f82=function(_0x49bf83,_0x3a54dc){_0x49bf83=_0x49bf83-0x0;var _0x339b39=_0xf829[_0x49bf83];return _0x339b39;};'use strict';var Sequelize=require(_0x9f82('0x0'));module[_0x9f82('0x1')]={'customer_id':{'type':Sequelize[_0x9f82('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x9f82('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x9f82('0x2')],'defaultValue':'','allowNull':![],'unique':_0x9f82('0x4')},'password':{'type':Sequelize[_0x9f82('0x2')]},'fullname':{'type':Sequelize[_0x9f82('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x10f214){this[_0x9f82('0x5')](_0x9f82('0x6'),typeof _0x10f214===_0x9f82('0x7')&&_0x10f214[_0x9f82('0x8')]()?_0x10f214[_0x9f82('0x8')]():null);}},'pager':{'type':Sequelize[_0x9f82('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x9f82('0x9')},'attach':{'type':Sequelize[_0x9f82('0xa')]('yes','no'),'defaultValue':_0x9f82('0xb'),'allowNull':![]},'saycid':{'type':Sequelize[_0x9f82('0xa')](_0x9f82('0xb'),'no'),'defaultValue':_0x9f82('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0x9f82('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x9f82('0xa')](_0x9f82('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x9f82('0xa')](_0x9f82('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x9f82('0xa')](_0x9f82('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x9f82('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x9f82('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x9f82('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x9f82('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x9f82('0xa')](_0x9f82('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x9f82('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x9f82('0xa')](_0x9f82('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x9f82('0xa')](_0x9f82('0xb'),'no'),'defaultValue':_0x9f82('0xb'),'allowNull':![]},'stamp':{'type':_0x9f82('0xd')},'emailsubject':{'type':Sequelize[_0x9f82('0x2')]},'emailbody':{'type':Sequelize[_0x9f82('0x2')]},'maxsecs':{'type':Sequelize[_0x9f82('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x9f82('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x9f82('0xf')],'get':function(){return this['getDataValue'](_0x9f82('0x10'))+_0x9f82('0x11')+this[_0x9f82('0x12')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 34906a7..562d460 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 _0x16d2=['sort','pick','filter','where','merge','options','findAll','rows','show','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Voicemails','UserProfileSection','userProfileId','UserProfileResource','catch','update','destroy','params','getMessages','findOne','VoiceMailMessage','nolimit','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','get','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order'];(function(_0xc71093,_0x3f31e0){var _0x3ee32a=function(_0x433a2a){while(--_0x433a2a){_0xc71093['push'](_0xc71093['shift']());}};_0x3ee32a(++_0x3f31e0);}(_0x16d2,0x123));var _0x216d=function(_0x170b30,_0xfbeb58){_0x170b30=_0x170b30-0x0;var _0x49f408=_0x16d2[_0x170b30];return _0x49f408;};'use strict';var emlformat=require(_0x216d('0x0'));var rimraf=require(_0x216d('0x1'));var zipdir=require(_0x216d('0x2'));var jsonpatch=require(_0x216d('0x3'));var rp=require(_0x216d('0x4'));var moment=require(_0x216d('0x5'));var BPromise=require(_0x216d('0x6'));var Mustache=require(_0x216d('0x7'));var util=require(_0x216d('0x8'));var path=require('path');var sox=require(_0x216d('0x9'));var csv=require(_0x216d('0xa'));var ejs=require(_0x216d('0xb'));var fs=require('fs');var fs_extra=require(_0x216d('0xc'));var _=require(_0x216d('0xd'));var squel=require(_0x216d('0xe'));var crypto=require(_0x216d('0xf'));var jsforce=require(_0x216d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x216d('0xa'));var querystring=require(_0x216d('0x11'));var Papa=require(_0x216d('0x12'));var Redis=require(_0x216d('0x13'));var authService=require(_0x216d('0x14'));var qs=require(_0x216d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x216d('0x16'));var logger=require('../../config/logger')(_0x216d('0x17'));var utils=require(_0x216d('0x18'));var config=require(_0x216d('0x19'));var licenseUtil=require(_0x216d('0x1a'));var db=require(_0x216d('0x1b'))['db'];function respondWithStatusCode(_0x23ecf9,_0x4c92d9){_0x4c92d9=_0x4c92d9||0xcc;return function(_0xb36a43){if(_0xb36a43){return _0x23ecf9['sendStatus'](_0x4c92d9);}return _0x23ecf9[_0x216d('0x1c')](_0x4c92d9)[_0x216d('0x1d')]();};}function respondWithResult(_0x4dc2a2,_0x165c19){_0x165c19=_0x165c19||0xc8;return function(_0x322e4b){if(_0x322e4b){return _0x4dc2a2['status'](_0x165c19)[_0x216d('0x1e')](_0x322e4b);}};}function respondWithFilteredResult(_0x494e92,_0x448c0d){return function(_0xf571a4){if(_0xf571a4){var _0x4631b0=typeof _0x448c0d[_0x216d('0x1f')]===_0x216d('0x20')&&typeof _0x448c0d[_0x216d('0x21')]===_0x216d('0x20');var _0x1496fe=_0xf571a4[_0x216d('0x22')];var _0x53d464=_0x4631b0?0x0:_0x448c0d[_0x216d('0x1f')];var _0x5124ab=_0x4631b0?_0xf571a4['count']:_0x448c0d[_0x216d('0x1f')]+_0x448c0d[_0x216d('0x21')];var _0x574758;if(_0x5124ab>=_0x1496fe){_0x5124ab=_0x1496fe;_0x574758=0xc8;}else{_0x574758=0xce;}_0x494e92[_0x216d('0x1c')](_0x574758);return _0x494e92[_0x216d('0x23')]('Content-Range',_0x53d464+'-'+_0x5124ab+'/'+_0x1496fe)[_0x216d('0x1e')](_0xf571a4);}return null;};}function patchUpdates(_0x13b8e0){return function(_0x430e81){try{jsonpatch[_0x216d('0x24')](_0x430e81,_0x13b8e0,!![]);}catch(_0x5c3e03){return BPromise[_0x216d('0x25')](_0x5c3e03);}return _0x430e81[_0x216d('0x26')]();};}function saveUpdates(_0x10f299,_0x438981){return function(_0x206782){if(_0x206782){return _0x206782['update'](_0x10f299)[_0x216d('0x27')](function(_0x1bd4db){return _0x1bd4db;});}return null;};}function removeEntity(_0x188494,_0x2880c6){return function(_0x6fa4b3){if(_0x6fa4b3){return _0x6fa4b3['destroy']()[_0x216d('0x27')](function(){var _0xab672=_0x6fa4b3[_0x216d('0x28')]({'plain':!![]});var _0x5998a1='Voicemails';return db['UserProfileResource']['destroy']({'where':{'type':_0x5998a1,'resourceId':_0xab672['id']}})['then'](function(){return _0x6fa4b3;});})[_0x216d('0x27')](function(){_0x188494[_0x216d('0x1c')](0xcc)[_0x216d('0x1d')]();});}};}function handleEntityNotFound(_0x73b509,_0x46d0ef){return function(_0x47fa6d){if(!_0x47fa6d){_0x73b509['sendStatus'](0x194);}return _0x47fa6d;};}function handleError(_0xa7624a,_0x51b2bd){_0x51b2bd=_0x51b2bd||0x1f4;return function(_0x23d1c3){logger[_0x216d('0x29')](_0x23d1c3[_0x216d('0x2a')]);if(_0x23d1c3[_0x216d('0x2b')]){delete _0x23d1c3[_0x216d('0x2b')];}_0xa7624a[_0x216d('0x1c')](_0x51b2bd)[_0x216d('0x2c')](_0x23d1c3);};}exports[_0x216d('0x2d')]=function(_0x169cfa,_0x28f56a){var _0x11be90={},_0x260134={},_0x4537fd={'count':0x0,'rows':[]};var _0x483324=_[_0x216d('0x2e')](db[_0x216d('0x2f')][_0x216d('0x30')],function(_0x510ad9){return{'name':_0x510ad9[_0x216d('0x31')],'type':_0x510ad9[_0x216d('0x32')][_0x216d('0x33')]};});_0x260134[_0x216d('0x34')]=_['map'](_0x483324,_0x216d('0x2b'));_0x260134[_0x216d('0x35')]=_[_0x216d('0x36')](_0x169cfa[_0x216d('0x35')]);_0x260134[_0x216d('0x37')]=_[_0x216d('0x38')](_0x260134[_0x216d('0x34')],_0x260134[_0x216d('0x35')]);_0x11be90[_0x216d('0x39')]=_[_0x216d('0x38')](_0x260134[_0x216d('0x34')],qs['fields'](_0x169cfa[_0x216d('0x35')][_0x216d('0x3a')]));_0x11be90[_0x216d('0x39')]=_0x11be90['attributes'][_0x216d('0x3b')]?_0x11be90[_0x216d('0x39')]:_0x260134['model'];if(!_0x169cfa[_0x216d('0x35')]['hasOwnProperty']('nolimit')){_0x11be90[_0x216d('0x21')]=qs[_0x216d('0x21')](_0x169cfa[_0x216d('0x35')][_0x216d('0x21')]);_0x11be90['offset']=qs['offset'](_0x169cfa['query'][_0x216d('0x1f')]);}_0x11be90[_0x216d('0x3c')]=qs['sort'](_0x169cfa[_0x216d('0x35')][_0x216d('0x3d')]);_0x11be90['where']=qs[_0x216d('0x37')](_[_0x216d('0x3e')](_0x169cfa[_0x216d('0x35')],_0x260134[_0x216d('0x37')]),_0x483324);if(_0x169cfa[_0x216d('0x35')][_0x216d('0x3f')]){_0x11be90[_0x216d('0x40')]=_[_0x216d('0x41')](_0x11be90['where'],{'$or':_['map'](_0x483324,function(_0x281a88){if(_0x281a88[_0x216d('0x32')]!=='VIRTUAL'){var _0xf33f9c={};_0xf33f9c[_0x281a88[_0x216d('0x2b')]]={'$like':'%'+_0x169cfa[_0x216d('0x35')]['filter']+'%'};return _0xf33f9c;}})});}_0x11be90=_[_0x216d('0x41')]({},_0x11be90,_0x169cfa[_0x216d('0x42')]);var _0x13d787={'where':_0x11be90[_0x216d('0x40')]};return db['VoiceMail'][_0x216d('0x22')](_0x13d787)[_0x216d('0x27')](function(_0x5665d7){_0x4537fd[_0x216d('0x22')]=_0x5665d7;if(_0x169cfa[_0x216d('0x35')]['includeAll']){_0x11be90['include']=[{'all':!![]}];}return db[_0x216d('0x2f')][_0x216d('0x43')](_0x11be90);})[_0x216d('0x27')](function(_0x498efe){_0x4537fd[_0x216d('0x44')]=_0x498efe;return _0x4537fd;})['then'](respondWithFilteredResult(_0x28f56a,_0x11be90))['catch'](handleError(_0x28f56a,null));};exports[_0x216d('0x45')]=function(_0x43336e,_0xac81f){var _0x5ddaeb={'raw':!![],'where':{'id':_0x43336e['params']['id']}},_0xaccf45={};_0xaccf45[_0x216d('0x34')]=_[_0x216d('0x36')](db[_0x216d('0x2f')]['rawAttributes']);_0xaccf45[_0x216d('0x35')]=_[_0x216d('0x36')](_0x43336e[_0x216d('0x35')]);_0xaccf45[_0x216d('0x37')]=_['intersection'](_0xaccf45['model'],_0xaccf45['query']);_0x5ddaeb[_0x216d('0x39')]=_[_0x216d('0x38')](_0xaccf45[_0x216d('0x34')],qs[_0x216d('0x3a')](_0x43336e[_0x216d('0x35')][_0x216d('0x3a')]));_0x5ddaeb[_0x216d('0x39')]=_0x5ddaeb[_0x216d('0x39')]['length']?_0x5ddaeb[_0x216d('0x39')]:_0xaccf45[_0x216d('0x34')];if(_0x43336e[_0x216d('0x35')][_0x216d('0x46')]){_0x5ddaeb['include']=[{'all':!![]}];}_0x5ddaeb=_[_0x216d('0x41')]({},_0x5ddaeb,_0x43336e['options']);return db[_0x216d('0x2f')][_0x216d('0x47')](_0x5ddaeb)[_0x216d('0x27')](handleEntityNotFound(_0xac81f,null))['then'](respondWithResult(_0xac81f,null))['catch'](handleError(_0xac81f,null));};exports[_0x216d('0x48')]=function(_0x32d499,_0x3932a3){return db[_0x216d('0x2f')][_0x216d('0x48')](_0x32d499[_0x216d('0x49')],{})['then'](function(_0x4f9274){var _0x26209c=_0x32d499['user'][_0x216d('0x28')]({'plain':!![]});if(!_0x26209c)throw new Error(_0x216d('0x4a'));if(_0x26209c['role']==='user'){var _0x5f37e3=_0x4f9274['get']({'plain':!![]});var _0x1ae9b7=_0x216d('0x4b');return db[_0x216d('0x4c')][_0x216d('0x47')]({'where':{'name':_0x1ae9b7,'userProfileId':_0x26209c[_0x216d('0x4d')]},'raw':!![]})[_0x216d('0x27')](function(_0x29efa8){if(_0x29efa8&&_0x29efa8['autoAssociation']===0x0){return db[_0x216d('0x4e')][_0x216d('0x48')]({'name':_0x5f37e3[_0x216d('0x2b')],'resourceId':_0x5f37e3['id'],'type':_0x29efa8['name'],'sectionId':_0x29efa8['id']},{})[_0x216d('0x27')](function(){return _0x4f9274;});}else{return _0x4f9274;}})[_0x216d('0x4f')](function(_0x2c7c67){logger[_0x216d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c7c67);throw _0x2c7c67;});}return _0x4f9274;})[_0x216d('0x27')](respondWithResult(_0x3932a3,0xc9))[_0x216d('0x4f')](handleError(_0x3932a3,null));};exports[_0x216d('0x50')]=function(_0x1a4761,_0x4d7705){if(_0x1a4761[_0x216d('0x49')]['id']){delete _0x1a4761[_0x216d('0x49')]['id'];}return db['VoiceMail'][_0x216d('0x47')]({'where':{'id':_0x1a4761['params']['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x4d7705,null))[_0x216d('0x27')](saveUpdates(_0x1a4761[_0x216d('0x49')],null))[_0x216d('0x27')](respondWithResult(_0x4d7705,null))[_0x216d('0x4f')](handleError(_0x4d7705,null));};exports[_0x216d('0x51')]=function(_0x24297f,_0x2c6cb6){return db[_0x216d('0x2f')]['find']({'where':{'id':_0x24297f[_0x216d('0x52')]['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x2c6cb6,null))['then'](removeEntity(_0x2c6cb6,null))[_0x216d('0x4f')](handleError(_0x2c6cb6,null));};exports[_0x216d('0x53')]=function(_0x59fa28,_0x4edf77,_0x3a0ee7){return db['VoiceMail'][_0x216d('0x54')]({'where':{'id':_0x59fa28[_0x216d('0x52')]['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x4edf77,null))['then'](function(_0x3acd4b){var _0x5112ea;var _0x5d96b3={},_0x462225={};_0x462225[_0x216d('0x34')]=_['keys'](db[_0x216d('0x55')][_0x216d('0x30')]);_0x462225[_0x216d('0x35')]=_[_0x216d('0x36')](_0x59fa28[_0x216d('0x35')]);_0x462225[_0x216d('0x37')]=_['intersection'](_0x462225['model'],_0x462225[_0x216d('0x35')]);_0x5d96b3[_0x216d('0x39')]=_[_0x216d('0x38')](_0x462225[_0x216d('0x34')],qs[_0x216d('0x3a')](_0x59fa28[_0x216d('0x35')][_0x216d('0x3a')]));_0x5d96b3[_0x216d('0x39')]=_0x5d96b3[_0x216d('0x39')][_0x216d('0x3b')]?_0x5d96b3[_0x216d('0x39')]:_0x462225[_0x216d('0x34')];if(!_0x59fa28['query']['hasOwnProperty'](_0x216d('0x56'))){_0x5d96b3[_0x216d('0x21')]=qs['limit'](_0x59fa28[_0x216d('0x35')]['limit']);_0x5d96b3['offset']=qs[_0x216d('0x1f')](_0x59fa28[_0x216d('0x35')][_0x216d('0x1f')]);}_0x5d96b3[_0x216d('0x3c')]=qs[_0x216d('0x3d')](_0x59fa28[_0x216d('0x35')][_0x216d('0x3d')]);_0x5d96b3[_0x216d('0x40')]=qs[_0x216d('0x37')](_[_0x216d('0x3e')](_0x59fa28[_0x216d('0x35')],_0x462225[_0x216d('0x37')]));if(_0x59fa28[_0x216d('0x35')][_0x216d('0x3f')]){_0x5d96b3[_0x216d('0x40')]=_[_0x216d('0x41')](_0x5d96b3[_0x216d('0x40')],{'$or':_[_0x216d('0x2e')](_0x5d96b3[_0x216d('0x39')],function(_0x34540e){var _0xb9302={};_0xb9302[_0x34540e]={'$like':'%'+_0x59fa28[_0x216d('0x35')]['filter']+'%'};return _0xb9302;})});}_0x5d96b3[_0x216d('0x40')]=_['merge'](_0x5d96b3[_0x216d('0x40')],{'mailboxuser':_0x3acd4b['mailbox']});_0x5d96b3=_[_0x216d('0x41')]({},_0x5d96b3,_0x59fa28[_0x216d('0x42')]);return db['VoiceMailMessage'][_0x216d('0x57')](_0x5d96b3)[_0x216d('0x27')](respondWithFilteredResult(_0x4edf77,_0x5d96b3));})[_0x216d('0x4f')](handleError(_0x4edf77,null));}; \ No newline at end of file +var _0xe1e3=['set','Content-Range','apply','reject','destroy','then','get','Voicemails','UserProfileResource','error','stack','name','send','VoiceMail','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','body','VoiceMailMessage','nolimit','order','options','findAndCountAll','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','offset','limit','count','status'];(function(_0x1fd4d7,_0x2feafd){var _0x7efe8a=function(_0xc54f55){while(--_0xc54f55){_0x1fd4d7['push'](_0x1fd4d7['shift']());}};_0x7efe8a(++_0x2feafd);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x4b18e1,_0x196f9e){_0x4b18e1=_0x4b18e1-0x0;var _0x5edc64=_0xe1e3[_0x4b18e1];return _0x5edc64;};'use strict';var emlformat=require(_0x3e1e('0x0'));var rimraf=require(_0x3e1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e1e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3e1e('0x3'));var Mustache=require('mustache');var util=require(_0x3e1e('0x4'));var path=require(_0x3e1e('0x5'));var sox=require(_0x3e1e('0x6'));var csv=require(_0x3e1e('0x7'));var ejs=require(_0x3e1e('0x8'));var fs=require('fs');var fs_extra=require(_0x3e1e('0x9'));var _=require('lodash');var squel=require(_0x3e1e('0xa'));var crypto=require(_0x3e1e('0xb'));var jsforce=require(_0x3e1e('0xc'));var deskjs=require(_0x3e1e('0xd'));var toCsv=require(_0x3e1e('0x7'));var querystring=require(_0x3e1e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e1e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e1e('0x10'));var logger=require(_0x3e1e('0x11'))(_0x3e1e('0x12'));var utils=require('../../config/utils');var config=require(_0x3e1e('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e47b9,_0x536129){_0x536129=_0x536129||0xcc;return function(_0x5c09a2){if(_0x5c09a2){return _0x4e47b9[_0x3e1e('0x14')](_0x536129);}return _0x4e47b9['status'](_0x536129)['end']();};}function respondWithResult(_0x3a9375,_0x8bd4cd){_0x8bd4cd=_0x8bd4cd||0xc8;return function(_0x78ee54){if(_0x78ee54){return _0x3a9375['status'](_0x8bd4cd)['json'](_0x78ee54);}};}function respondWithFilteredResult(_0x4131a1,_0x1b62e6){return function(_0x4dca60){if(_0x4dca60){var _0x26cb35=typeof _0x1b62e6[_0x3e1e('0x15')]==='undefined'&&typeof _0x1b62e6[_0x3e1e('0x16')]==='undefined';var _0x23228c=_0x4dca60[_0x3e1e('0x17')];var _0x1d786c=_0x26cb35?0x0:_0x1b62e6[_0x3e1e('0x15')];var _0x791ed8=_0x26cb35?_0x4dca60[_0x3e1e('0x17')]:_0x1b62e6['offset']+_0x1b62e6['limit'];var _0x4a9497;if(_0x791ed8>=_0x23228c){_0x791ed8=_0x23228c;_0x4a9497=0xc8;}else{_0x4a9497=0xce;}_0x4131a1[_0x3e1e('0x18')](_0x4a9497);return _0x4131a1[_0x3e1e('0x19')](_0x3e1e('0x1a'),_0x1d786c+'-'+_0x791ed8+'/'+_0x23228c)['json'](_0x4dca60);}return null;};}function patchUpdates(_0x1c5acd){return function(_0x530815){try{jsonpatch[_0x3e1e('0x1b')](_0x530815,_0x1c5acd,!![]);}catch(_0x33ec1d){return BPromise[_0x3e1e('0x1c')](_0x33ec1d);}return _0x530815['save']();};}function saveUpdates(_0x53e051,_0x96396){return function(_0xefa098){if(_0xefa098){return _0xefa098['update'](_0x53e051)['then'](function(_0x13d7ac){return _0x13d7ac;});}return null;};}function removeEntity(_0x1b5097,_0x488f9f){return function(_0x60e6bc){if(_0x60e6bc){return _0x60e6bc[_0x3e1e('0x1d')]()[_0x3e1e('0x1e')](function(){var _0x33bf0f=_0x60e6bc[_0x3e1e('0x1f')]({'plain':!![]});var _0x159212=_0x3e1e('0x20');return db[_0x3e1e('0x21')]['destroy']({'where':{'type':_0x159212,'resourceId':_0x33bf0f['id']}})['then'](function(){return _0x60e6bc;});})[_0x3e1e('0x1e')](function(){_0x1b5097[_0x3e1e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4be84e,_0x56b9a8){return function(_0x1a33bb){if(!_0x1a33bb){_0x4be84e[_0x3e1e('0x14')](0x194);}return _0x1a33bb;};}function handleError(_0x5b1bd1,_0x52f966){_0x52f966=_0x52f966||0x1f4;return function(_0x5ac814){logger[_0x3e1e('0x22')](_0x5ac814[_0x3e1e('0x23')]);if(_0x5ac814['name']){delete _0x5ac814[_0x3e1e('0x24')];}_0x5b1bd1[_0x3e1e('0x18')](_0x52f966)[_0x3e1e('0x25')](_0x5ac814);};}exports['index']=function(_0xdef39,_0x4ec149){var _0x591c36={},_0x494c75={},_0x39da8d={'count':0x0,'rows':[]};var _0x5b8f95=_['map'](db[_0x3e1e('0x26')][_0x3e1e('0x27')],function(_0x1c57c2){return{'name':_0x1c57c2[_0x3e1e('0x28')],'type':_0x1c57c2[_0x3e1e('0x29')]['key']};});_0x494c75['model']=_['map'](_0x5b8f95,'name');_0x494c75[_0x3e1e('0x2a')]=_[_0x3e1e('0x2b')](_0xdef39[_0x3e1e('0x2a')]);_0x494c75[_0x3e1e('0x2c')]=_[_0x3e1e('0x2d')](_0x494c75[_0x3e1e('0x2e')],_0x494c75[_0x3e1e('0x2a')]);_0x591c36[_0x3e1e('0x2f')]=_['intersection'](_0x494c75[_0x3e1e('0x2e')],qs[_0x3e1e('0x30')](_0xdef39['query'][_0x3e1e('0x30')]));_0x591c36[_0x3e1e('0x2f')]=_0x591c36[_0x3e1e('0x2f')][_0x3e1e('0x31')]?_0x591c36['attributes']:_0x494c75['model'];if(!_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x32')]('nolimit')){_0x591c36[_0x3e1e('0x16')]=qs[_0x3e1e('0x16')](_0xdef39['query'][_0x3e1e('0x16')]);_0x591c36[_0x3e1e('0x15')]=qs[_0x3e1e('0x15')](_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x15')]);}_0x591c36['order']=qs[_0x3e1e('0x33')](_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x33')]);_0x591c36[_0x3e1e('0x34')]=qs['filters'](_[_0x3e1e('0x35')](_0xdef39[_0x3e1e('0x2a')],_0x494c75[_0x3e1e('0x2c')]),_0x5b8f95);if(_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x36')]){_0x591c36[_0x3e1e('0x34')]=_[_0x3e1e('0x37')](_0x591c36['where'],{'$or':_[_0x3e1e('0x38')](_0x5b8f95,function(_0x4fdd7c){if(_0x4fdd7c['type']!==_0x3e1e('0x39')){var _0x469a42={};_0x469a42[_0x4fdd7c[_0x3e1e('0x24')]]={'$like':'%'+_0xdef39['query'][_0x3e1e('0x36')]+'%'};return _0x469a42;}})});}_0x591c36=_[_0x3e1e('0x37')]({},_0x591c36,_0xdef39['options']);var _0x16d03f={'where':_0x591c36[_0x3e1e('0x34')]};return db['VoiceMail']['count'](_0x16d03f)[_0x3e1e('0x1e')](function(_0x49e4cb){_0x39da8d['count']=_0x49e4cb;if(_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x3a')]){_0x591c36[_0x3e1e('0x3b')]=[{'all':!![]}];}return db[_0x3e1e('0x26')][_0x3e1e('0x3c')](_0x591c36);})['then'](function(_0x5b32ad){_0x39da8d[_0x3e1e('0x3d')]=_0x5b32ad;return _0x39da8d;})[_0x3e1e('0x1e')](respondWithFilteredResult(_0x4ec149,_0x591c36))[_0x3e1e('0x3e')](handleError(_0x4ec149,null));};exports['show']=function(_0x1124d0,_0x2dcce1){var _0xabe865={'raw':!![],'where':{'id':_0x1124d0[_0x3e1e('0x3f')]['id']}},_0x4ad5fd={};_0x4ad5fd['model']=_['keys'](db[_0x3e1e('0x26')][_0x3e1e('0x27')]);_0x4ad5fd[_0x3e1e('0x2a')]=_[_0x3e1e('0x2b')](_0x1124d0['query']);_0x4ad5fd['filters']=_['intersection'](_0x4ad5fd['model'],_0x4ad5fd[_0x3e1e('0x2a')]);_0xabe865[_0x3e1e('0x2f')]=_['intersection'](_0x4ad5fd['model'],qs[_0x3e1e('0x30')](_0x1124d0[_0x3e1e('0x2a')][_0x3e1e('0x30')]));_0xabe865['attributes']=_0xabe865[_0x3e1e('0x2f')]['length']?_0xabe865[_0x3e1e('0x2f')]:_0x4ad5fd[_0x3e1e('0x2e')];if(_0x1124d0[_0x3e1e('0x2a')][_0x3e1e('0x3a')]){_0xabe865[_0x3e1e('0x3b')]=[{'all':!![]}];}_0xabe865=_[_0x3e1e('0x37')]({},_0xabe865,_0x1124d0['options']);return db[_0x3e1e('0x26')][_0x3e1e('0x40')](_0xabe865)['then'](handleEntityNotFound(_0x2dcce1,null))[_0x3e1e('0x1e')](respondWithResult(_0x2dcce1,null))[_0x3e1e('0x3e')](handleError(_0x2dcce1,null));};exports['create']=function(_0x1cc820,_0x347b3f){return db[_0x3e1e('0x26')][_0x3e1e('0x41')](_0x1cc820['body'],{})[_0x3e1e('0x1e')](function(_0x3d7303){var _0x29d23b=_0x1cc820[_0x3e1e('0x42')]['get']({'plain':!![]});if(!_0x29d23b)throw new Error(_0x3e1e('0x43'));if(_0x29d23b[_0x3e1e('0x44')]===_0x3e1e('0x42')){var _0x25ddf7=_0x3d7303[_0x3e1e('0x1f')]({'plain':!![]});var _0x1df5a8=_0x3e1e('0x20');return db[_0x3e1e('0x45')]['find']({'where':{'name':_0x1df5a8,'userProfileId':_0x29d23b[_0x3e1e('0x46')]},'raw':!![]})['then'](function(_0x5b0d0d){if(_0x5b0d0d&&_0x5b0d0d['autoAssociation']===0x0){return db[_0x3e1e('0x21')][_0x3e1e('0x41')]({'name':_0x25ddf7['name'],'resourceId':_0x25ddf7['id'],'type':_0x5b0d0d[_0x3e1e('0x24')],'sectionId':_0x5b0d0d['id']},{})['then'](function(){return _0x3d7303;});}else{return _0x3d7303;}})['catch'](function(_0x3eaf76){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3eaf76);throw _0x3eaf76;});}return _0x3d7303;})['then'](respondWithResult(_0x347b3f,0xc9))[_0x3e1e('0x3e')](handleError(_0x347b3f,null));};exports[_0x3e1e('0x47')]=function(_0x1334c8,_0x162a51){if(_0x1334c8[_0x3e1e('0x48')]['id']){delete _0x1334c8[_0x3e1e('0x48')]['id'];}return db[_0x3e1e('0x26')]['find']({'where':{'id':_0x1334c8[_0x3e1e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x162a51,null))[_0x3e1e('0x1e')](saveUpdates(_0x1334c8[_0x3e1e('0x48')],null))[_0x3e1e('0x1e')](respondWithResult(_0x162a51,null))['catch'](handleError(_0x162a51,null));};exports['destroy']=function(_0xba8d16,_0xb1456e){return db['VoiceMail'][_0x3e1e('0x40')]({'where':{'id':_0xba8d16['params']['id']}})['then'](handleEntityNotFound(_0xb1456e,null))[_0x3e1e('0x1e')](removeEntity(_0xb1456e,null))[_0x3e1e('0x3e')](handleError(_0xb1456e,null));};exports['getMessages']=function(_0x17bc26,_0x551f12,_0x553451){return db[_0x3e1e('0x26')]['findOne']({'where':{'id':_0x17bc26[_0x3e1e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x551f12,null))[_0x3e1e('0x1e')](function(_0x57d845){var _0x7ea199;var _0x8a4987={},_0x48be40={};_0x48be40['model']=_['keys'](db[_0x3e1e('0x49')][_0x3e1e('0x27')]);_0x48be40[_0x3e1e('0x2a')]=_['keys'](_0x17bc26[_0x3e1e('0x2a')]);_0x48be40[_0x3e1e('0x2c')]=_[_0x3e1e('0x2d')](_0x48be40['model'],_0x48be40['query']);_0x8a4987[_0x3e1e('0x2f')]=_['intersection'](_0x48be40[_0x3e1e('0x2e')],qs[_0x3e1e('0x30')](_0x17bc26[_0x3e1e('0x2a')]['fields']));_0x8a4987[_0x3e1e('0x2f')]=_0x8a4987['attributes'][_0x3e1e('0x31')]?_0x8a4987[_0x3e1e('0x2f')]:_0x48be40['model'];if(!_0x17bc26[_0x3e1e('0x2a')]['hasOwnProperty'](_0x3e1e('0x4a'))){_0x8a4987['limit']=qs[_0x3e1e('0x16')](_0x17bc26['query'][_0x3e1e('0x16')]);_0x8a4987[_0x3e1e('0x15')]=qs[_0x3e1e('0x15')](_0x17bc26['query'][_0x3e1e('0x15')]);}_0x8a4987[_0x3e1e('0x4b')]=qs['sort'](_0x17bc26[_0x3e1e('0x2a')]['sort']);_0x8a4987['where']=qs['filters'](_[_0x3e1e('0x35')](_0x17bc26[_0x3e1e('0x2a')],_0x48be40[_0x3e1e('0x2c')]));if(_0x17bc26[_0x3e1e('0x2a')][_0x3e1e('0x36')]){_0x8a4987[_0x3e1e('0x34')]=_[_0x3e1e('0x37')](_0x8a4987['where'],{'$or':_[_0x3e1e('0x38')](_0x8a4987[_0x3e1e('0x2f')],function(_0x4634c0){var _0x2a9c84={};_0x2a9c84[_0x4634c0]={'$like':'%'+_0x17bc26[_0x3e1e('0x2a')][_0x3e1e('0x36')]+'%'};return _0x2a9c84;})});}_0x8a4987[_0x3e1e('0x34')]=_[_0x3e1e('0x37')](_0x8a4987['where'],{'mailboxuser':_0x57d845['mailbox']});_0x8a4987=_[_0x3e1e('0x37')]({},_0x8a4987,_0x17bc26[_0x3e1e('0x4c')]);return db[_0x3e1e('0x49')][_0x3e1e('0x4d')](_0x8a4987)[_0x3e1e('0x1e')](respondWithFilteredResult(_0x551f12,_0x8a4987));})[_0x3e1e('0x3e')](handleError(_0x551f12,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 5230472..12c932d 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 _0xdda3=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','VoiceMail','voice_voicemail','mailbox','context','util'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xdda3,0x15b));var _0x3dda=function(_0x22205c,_0x473493){_0x22205c=_0x22205c-0x0;var _0x3f5efe=_0xdda3[_0x22205c];return _0x3f5efe;};'use strict';var _=require('lodash');var util=require(_0x3dda('0x0'));var logger=require('../../config/logger')(_0x3dda('0x1'));var moment=require(_0x3dda('0x2'));var BPromise=require(_0x3dda('0x3'));var rp=require(_0x3dda('0x4'));var fs=require('fs');var path=require(_0x3dda('0x5'));var rimraf=require(_0x3dda('0x6'));var config=require(_0x3dda('0x7'));var attributes=require('./voiceMail.attributes');module['exports']=function(_0x3dd051,_0x4e0d95){return _0x3dd051['define'](_0x3dda('0x8'),attributes,{'tableName':_0x3dda('0x9'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x3dda('0xa'),_0x3dda('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xae31=['context','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','define','VoiceMail','mailbox_context','mailbox'];(function(_0x22cb34,_0x116622){var _0x592d3c=function(_0x5f19a4){while(--_0x5f19a4){_0x22cb34['push'](_0x22cb34['shift']());}};_0x592d3c(++_0x116622);}(_0xae31,0x91));var _0x1ae3=function(_0x50d7fd,_0x30cd62){_0x50d7fd=_0x50d7fd-0x0;var _0x512b17=_0xae31[_0x50d7fd];return _0x512b17;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x1ae3('0x0'));var moment=require('moment');var BPromise=require(_0x1ae3('0x1'));var rp=require(_0x1ae3('0x2'));var fs=require('fs');var path=require(_0x1ae3('0x3'));var rimraf=require(_0x1ae3('0x4'));var config=require(_0x1ae3('0x5'));var attributes=require(_0x1ae3('0x6'));module['exports']=function(_0x55f1af,_0x3560fb){return _0x55f1af[_0x1ae3('0x7')](_0x1ae3('0x8'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x1ae3('0x9'),'fields':[_0x1ae3('0xa'),_0x1ae3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 90091f4..e003115 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 _0xadc2=['VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','VoiceMail,\x20%s,\x20%s','info','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent'];(function(_0xf3fed3,_0x2a3897){var _0x5d0ca6=function(_0x2e7eda){while(--_0x2e7eda){_0xf3fed3['push'](_0xf3fed3['shift']());}};_0x5d0ca6(++_0x2a3897);}(_0xadc2,0xef));var _0x2adc=function(_0x5c0c77,_0x506e0f){_0x5c0c77=_0x5c0c77-0x0;var _0x3e7ef5=_0xadc2[_0x5c0c77];return _0x3e7ef5;};'use strict';var _=require(_0x2adc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2adc('0x1'));var rs=require(_0x2adc('0x2'));var fs=require('fs');var Redis=require(_0x2adc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2adc('0x4'));var logger=require(_0x2adc('0x5'))(_0x2adc('0x6'));var config=require(_0x2adc('0x7'));var jayson=require(_0x2adc('0x8'));var client=jayson[_0x2adc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x255b72,_0x49b839,_0x148590){return new BPromise(function(_0x528a99,_0x416b0e){return client[_0x2adc('0xa')](_0x255b72,_0x148590)[_0x2adc('0xb')](function(_0x23f3b9){logger['info']('VoiceMail,\x20%s,\x20%s',_0x49b839,_0x2adc('0xc'));logger['debug'](_0x2adc('0xd'),_0x49b839,_0x2adc('0xc'),JSON['stringify'](_0x23f3b9));if(_0x23f3b9['error']){if(_0x23f3b9[_0x2adc('0xe')][_0x2adc('0xf')]===0x1f4){logger[_0x2adc('0xe')]('VoiceMail,\x20%s,\x20%s',_0x49b839,_0x23f3b9['error'][_0x2adc('0x10')]);return _0x416b0e(_0x23f3b9[_0x2adc('0xe')][_0x2adc('0x10')]);}logger[_0x2adc('0xe')](_0x2adc('0x11'),_0x49b839,_0x23f3b9[_0x2adc('0xe')]['message']);return _0x528a99(_0x23f3b9['error']['message']);}else{logger[_0x2adc('0x12')](_0x2adc('0x11'),_0x49b839,_0x2adc('0xc'));_0x528a99(_0x23f3b9[_0x2adc('0x13')]['message']);}})[_0x2adc('0x14')](function(_0x1b865b){logger[_0x2adc('0xe')](_0x2adc('0x11'),_0x49b839,_0x1b865b);_0x416b0e(_0x1b865b);});});} \ No newline at end of file +var _0x70fd=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70fd,0x1b2));var _0xd70f=function(_0x3909fc,_0xe12bde){_0x3909fc=_0x3909fc-0x0;var _0x2226d8=_0x70fd[_0x3909fc];return _0x2226d8;};'use strict';var _=require(_0xd70f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd70f('0x1'));var rs=require(_0xd70f('0x2'));var fs=require('fs');var Redis=require(_0xd70f('0x3'));var db=require(_0xd70f('0x4'))['db'];var utils=require(_0xd70f('0x5'));var logger=require(_0xd70f('0x6'))('rpc');var config=require(_0xd70f('0x7'));var jayson=require(_0xd70f('0x8'));var client=jayson[_0xd70f('0x9')][_0xd70f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b83bf,_0xd0b6ce,_0x179a13){return new BPromise(function(_0x16e231,_0x3886cd){return client[_0xd70f('0xb')](_0x1b83bf,_0x179a13)[_0xd70f('0xc')](function(_0xb640b0){logger['info'](_0xd70f('0xd'),_0xd0b6ce,_0xd70f('0xe'));logger[_0xd70f('0xf')](_0xd70f('0x10'),_0xd0b6ce,'request\x20sent',JSON[_0xd70f('0x11')](_0xb640b0));if(_0xb640b0[_0xd70f('0x12')]){if(_0xb640b0[_0xd70f('0x12')]['code']===0x1f4){logger[_0xd70f('0x12')](_0xd70f('0xd'),_0xd0b6ce,_0xb640b0[_0xd70f('0x12')][_0xd70f('0x13')]);return _0x3886cd(_0xb640b0[_0xd70f('0x12')][_0xd70f('0x13')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0xd0b6ce,_0xb640b0[_0xd70f('0x12')][_0xd70f('0x13')]);return _0x16e231(_0xb640b0[_0xd70f('0x12')][_0xd70f('0x13')]);}else{logger[_0xd70f('0x14')](_0xd70f('0xd'),_0xd0b6ce,_0xd70f('0xe'));_0x16e231(_0xb640b0['result']['message']);}})[_0xd70f('0x15')](function(_0x44204){logger['error'](_0xd70f('0xd'),_0xd0b6ce,_0x44204);_0x3886cd(_0x44204);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 9d70b5c..be3d286 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 _0xd562=['Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/download','download','create','put','update','delete','/:id','exports','multer','path','connect-timeout','express'];(function(_0x492883,_0x2af036){var _0x1fab8b=function(_0x3adb0a){while(--_0x3adb0a){_0x492883['push'](_0x492883['shift']());}};_0x1fab8b(++_0x2af036);}(_0xd562,0x19e));var _0x2d56=function(_0x3be236,_0x3f4eb7){_0x3be236=_0x3be236-0x0;var _0x157d24=_0xd562[_0x3be236];return _0x157d24;};'use strict';var multer=require(_0x2d56('0x0'));var util=require('util');var path=require(_0x2d56('0x1'));var timeout=require(_0x2d56('0x2'));var express=require(_0x2d56('0x3'));var router=express[_0x2d56('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2d56('0x5'));var interaction=require(_0x2d56('0x6'));var config=require('../../config/environment');var controller=require('./voiceMailMessage.controller');router[_0x2d56('0x7')]('/',auth[_0x2d56('0x8')](),controller[_0x2d56('0x9')]);router[_0x2d56('0x7')]('/:id',auth[_0x2d56('0x8')](),controller[_0x2d56('0xa')]);router[_0x2d56('0x7')](_0x2d56('0xb'),auth['isAuthenticated'](),controller[_0x2d56('0xc')]);router['post']('/',auth[_0x2d56('0x8')](),controller[_0x2d56('0xd')]);router[_0x2d56('0xe')]('/:id',auth[_0x2d56('0x8')](),controller[_0x2d56('0xf')]);router[_0x2d56('0x10')](_0x2d56('0x11'),auth[_0x2d56('0x8')](),controller['destroy']);module[_0x2d56('0x12')]=router; \ No newline at end of file +var _0xfb25=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','download','post','create','update','delete','/:id','destroy','multer','path','connect-timeout'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xfb25,0x1e0));var _0x5fb2=function(_0x28215d,_0x43fef8){_0x28215d=_0x28215d-0x0;var _0x111b57=_0xfb25[_0x28215d];return _0x111b57;};'use strict';var multer=require(_0x5fb2('0x0'));var util=require('util');var path=require(_0x5fb2('0x1'));var timeout=require(_0x5fb2('0x2'));var express=require(_0x5fb2('0x3'));var router=express[_0x5fb2('0x4')]();var fs_extra=require(_0x5fb2('0x5'));var auth=require(_0x5fb2('0x6'));var interaction=require(_0x5fb2('0x7'));var config=require(_0x5fb2('0x8'));var controller=require(_0x5fb2('0x9'));router[_0x5fb2('0xa')]('/',auth[_0x5fb2('0xb')](),controller[_0x5fb2('0xc')]);router['get']('/:id',auth[_0x5fb2('0xb')](),controller[_0x5fb2('0xd')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x5fb2('0xe')]);router[_0x5fb2('0xf')]('/',auth[_0x5fb2('0xb')](),controller[_0x5fb2('0x10')]);router['put']('/:id',auth[_0x5fb2('0xb')](),controller[_0x5fb2('0x11')]);router[_0x5fb2('0x12')](_0x5fb2('0x13'),auth[_0x5fb2('0xb')](),controller[_0x5fb2('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 83c6193..d1325f8 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 _0xb1f5=['BLOB','long','TIMESTAMP','literal','sequelize','exports','VIRTUAL','INTEGER','STRING'];(function(_0x1d8119,_0xc98f17){var _0x3e30f6=function(_0x2c7f3e){while(--_0x2c7f3e){_0x1d8119['push'](_0x1d8119['shift']());}};_0x3e30f6(++_0xc98f17);}(_0xb1f5,0xca));var _0x5b1f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb1f5[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x5b1f('0x0'));module[_0x5b1f('0x1')]={'name':{'type':Sequelize[_0x5b1f('0x2')],'get':function(_0x5a9a68){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x5b1f('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x5b1f('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x5b1f('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x5b1f('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x5b1f('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x5b1f('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x5b1f('0x5')](_0x5b1f('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x5b1f('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x5b1f('0x4')],'defaultValue':''},'stamp':{'type':_0x5b1f('0x7'),'defaultValue':Sequelize[_0x5b1f('0x8')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x8a8b=['literal','sequelize','exports','VIRTUAL','getDataValue','STRING','BLOB','long','TIMESTAMP'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0x8a8b,0xa3));var _0xb8a8=function(_0x211774,_0x5b0bfb){_0x211774=_0x211774-0x0;var _0x395a65=_0x8a8b[_0x211774];return _0x395a65;};'use strict';var Sequelize=require(_0xb8a8('0x0'));module[_0xb8a8('0x1')]={'name':{'type':Sequelize[_0xb8a8('0x2')],'get':function(_0x3cfee0){return this[_0xb8a8('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xb8a8('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xb8a8('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xb8a8('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xb8a8('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xb8a8('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xb8a8('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xb8a8('0x5')](_0xb8a8('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xb8a8('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xb8a8('0x4')],'defaultValue':''},'stamp':{'type':_0xb8a8('0x7'),'defaultValue':Sequelize[_0xb8a8('0x8')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index fb5ebfb..d1a6511 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 _0xa4a3=['intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','rawAttributes','length','find','create','body','params','destroy','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','set','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','then','stack','name','index','map','VoiceMailMessage','fieldName','model','differenceBy','keys','query','filters'];(function(_0x227c9b,_0x34d983){var _0x37f247=function(_0x1adc5a){while(--_0x1adc5a){_0x227c9b['push'](_0x227c9b['shift']());}};_0x37f247(++_0x34d983);}(_0xa4a3,0x165));var _0x3a4a=function(_0x2c50b7,_0x7604fb){_0x2c50b7=_0x2c50b7-0x0;var _0x46b5a9=_0xa4a3[_0x2c50b7];return _0x46b5a9;};'use strict';var emlformat=require(_0x3a4a('0x0'));var rimraf=require(_0x3a4a('0x1'));var zipdir=require(_0x3a4a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3a4a('0x3'));var moment=require(_0x3a4a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3a4a('0x5'));var util=require('util');var path=require(_0x3a4a('0x6'));var sox=require(_0x3a4a('0x7'));var csv=require(_0x3a4a('0x8'));var ejs=require(_0x3a4a('0x9'));var fs=require('fs');var fs_extra=require(_0x3a4a('0xa'));var _=require(_0x3a4a('0xb'));var squel=require('squel');var crypto=require(_0x3a4a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3a4a('0x8'));var querystring=require(_0x3a4a('0xd'));var Papa=require(_0x3a4a('0xe'));var Redis=require(_0x3a4a('0xf'));var authService=require(_0x3a4a('0x10'));var qs=require(_0x3a4a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a4a('0x12'));var logger=require(_0x3a4a('0x13'))(_0x3a4a('0x14'));var utils=require(_0x3a4a('0x15'));var config=require(_0x3a4a('0x16'));var licenseUtil=require(_0x3a4a('0x17'));var db=require(_0x3a4a('0x18'))['db'];function respondWithStatusCode(_0x53bb3a,_0x20f476){_0x20f476=_0x20f476||0xcc;return function(_0x116007){if(_0x116007){return _0x53bb3a[_0x3a4a('0x19')](_0x20f476);}return _0x53bb3a[_0x3a4a('0x1a')](_0x20f476)[_0x3a4a('0x1b')]();};}function respondWithResult(_0x218fd9,_0xb24b01){_0xb24b01=_0xb24b01||0xc8;return function(_0x295d56){if(_0x295d56){return _0x218fd9[_0x3a4a('0x1a')](_0xb24b01)['json'](_0x295d56);}};}function respondWithFilteredResult(_0xf384a0,_0x43079e){return function(_0xee48e){if(_0xee48e){var _0x51de36=typeof _0x43079e['offset']===_0x3a4a('0x1c')&&typeof _0x43079e[_0x3a4a('0x1d')]===_0x3a4a('0x1c');var _0x57cb4e=_0xee48e[_0x3a4a('0x1e')];var _0x51fbab=_0x51de36?0x0:_0x43079e[_0x3a4a('0x1f')];var _0x4317d5=_0x51de36?_0xee48e[_0x3a4a('0x1e')]:_0x43079e[_0x3a4a('0x1f')]+_0x43079e[_0x3a4a('0x1d')];var _0x319ab2;if(_0x4317d5>=_0x57cb4e){_0x4317d5=_0x57cb4e;_0x319ab2=0xc8;}else{_0x319ab2=0xce;}_0xf384a0[_0x3a4a('0x1a')](_0x319ab2);return _0xf384a0['set'](_0x3a4a('0x20'),_0x51fbab+'-'+_0x4317d5+'/'+_0x57cb4e)[_0x3a4a('0x21')](_0xee48e);}return null;};}function patchUpdates(_0x55c6d7){return function(_0xa0c237){try{jsonpatch['apply'](_0xa0c237,_0x55c6d7,!![]);}catch(_0x52dca1){return BPromise[_0x3a4a('0x22')](_0x52dca1);}return _0xa0c237[_0x3a4a('0x23')]();};}function saveUpdates(_0x34e76a,_0x20f7f4){return function(_0xdd3380){if(_0xdd3380){return _0xdd3380['update'](_0x34e76a)['then'](function(_0x1d8d0c){return _0x1d8d0c;});}return null;};}function removeEntity(_0x2de0fe,_0x4c4a7e){return function(_0x44406c){if(_0x44406c){return _0x44406c['destroy']()[_0x3a4a('0x24')](function(){_0x2de0fe[_0x3a4a('0x1a')](0xcc)[_0x3a4a('0x1b')]();});}};}function handleEntityNotFound(_0x2ab50b,_0x1ab0b7){return function(_0x500e2d){if(!_0x500e2d){_0x2ab50b[_0x3a4a('0x19')](0x194);}return _0x500e2d;};}function handleError(_0x182cde,_0x4dc99f){_0x4dc99f=_0x4dc99f||0x1f4;return function(_0x196967){logger['error'](_0x196967[_0x3a4a('0x25')]);if(_0x196967[_0x3a4a('0x26')]){delete _0x196967[_0x3a4a('0x26')];}_0x182cde['status'](_0x4dc99f)['send'](_0x196967);};}exports[_0x3a4a('0x27')]=function(_0x1084fb,_0x34586f){var _0x578e49={},_0x5716ca={},_0x56895b={'count':0x0,'rows':[]};var _0x728f53=_[_0x3a4a('0x28')](db[_0x3a4a('0x29')]['rawAttributes'],function(_0x4605f0){return{'name':_0x4605f0[_0x3a4a('0x2a')],'type':_0x4605f0['type']['key']};});_0x5716ca[_0x3a4a('0x2b')]=_[_0x3a4a('0x2c')](_[_0x3a4a('0x28')](_0x728f53,_0x3a4a('0x26')),[_0x3a4a('0x26')]);_0x5716ca['query']=_[_0x3a4a('0x2d')](_0x1084fb[_0x3a4a('0x2e')]);_0x5716ca[_0x3a4a('0x2f')]=_[_0x3a4a('0x30')](_0x5716ca[_0x3a4a('0x2b')],_0x5716ca[_0x3a4a('0x2e')]);_0x578e49[_0x3a4a('0x31')]=_[_0x3a4a('0x30')](_0x5716ca[_0x3a4a('0x2b')],qs[_0x3a4a('0x32')](_0x1084fb[_0x3a4a('0x2e')]['fields']));_0x578e49[_0x3a4a('0x31')]=_0x578e49[_0x3a4a('0x31')]['length']?_0x578e49[_0x3a4a('0x31')]:_0x5716ca['model'];if(!_0x1084fb['query'][_0x3a4a('0x33')]('nolimit')){_0x578e49[_0x3a4a('0x1d')]=qs[_0x3a4a('0x1d')](_0x1084fb['query'][_0x3a4a('0x1d')]);_0x578e49[_0x3a4a('0x1f')]=qs['offset'](_0x1084fb[_0x3a4a('0x2e')]['offset']);}_0x578e49['order']=qs[_0x3a4a('0x34')](_0x1084fb[_0x3a4a('0x2e')][_0x3a4a('0x34')]);_0x578e49[_0x3a4a('0x35')]=qs[_0x3a4a('0x2f')](_[_0x3a4a('0x36')](_0x1084fb[_0x3a4a('0x2e')],_0x5716ca[_0x3a4a('0x2f')]),_0x728f53);if(_0x1084fb[_0x3a4a('0x2e')][_0x3a4a('0x37')]){_0x578e49['where']=_[_0x3a4a('0x38')](_0x578e49[_0x3a4a('0x35')],{'$or':_[_0x3a4a('0x28')](_0x728f53,function(_0x3d77c1){if(_0x3d77c1['type']!=='VIRTUAL'){var _0x3e1242={};_0x3e1242[_0x3d77c1[_0x3a4a('0x26')]]={'$like':'%'+_0x1084fb[_0x3a4a('0x2e')]['filter']+'%'};return _0x3e1242;}})});}_0x578e49=_[_0x3a4a('0x38')]({},_0x578e49,_0x1084fb[_0x3a4a('0x39')]);var _0x2d1f88={'where':_0x578e49[_0x3a4a('0x35')]};return db['VoiceMailMessage']['count'](_0x2d1f88)[_0x3a4a('0x24')](function(_0x334005){_0x56895b[_0x3a4a('0x1e')]=_0x334005;if(_0x1084fb[_0x3a4a('0x2e')][_0x3a4a('0x3a')]){_0x578e49[_0x3a4a('0x3b')]=[{'all':!![]}];}return db[_0x3a4a('0x29')][_0x3a4a('0x3c')](_0x578e49);})['then'](function(_0x5b6437){_0x56895b['rows']=_0x5b6437;return _0x56895b;})['then'](respondWithFilteredResult(_0x34586f,_0x578e49))[_0x3a4a('0x3d')](handleError(_0x34586f,null));};exports[_0x3a4a('0x3e')]=function(_0x22f63b,_0x46db25){var _0x2232d0={'raw':!![],'where':{'id':_0x22f63b['params']['id']}},_0x115500={};_0x115500['model']=_['keys'](db[_0x3a4a('0x29')][_0x3a4a('0x3f')]);_0x115500[_0x3a4a('0x2e')]=_[_0x3a4a('0x2d')](_0x22f63b['query']);_0x115500[_0x3a4a('0x2f')]=_[_0x3a4a('0x30')](_0x115500[_0x3a4a('0x2b')],_0x115500[_0x3a4a('0x2e')]);_0x2232d0[_0x3a4a('0x31')]=_[_0x3a4a('0x30')](_0x115500[_0x3a4a('0x2b')],qs[_0x3a4a('0x32')](_0x22f63b[_0x3a4a('0x2e')][_0x3a4a('0x32')]));_0x2232d0['attributes']=_0x2232d0[_0x3a4a('0x31')][_0x3a4a('0x40')]?_0x2232d0[_0x3a4a('0x31')]:_0x115500[_0x3a4a('0x2b')];if(_0x22f63b[_0x3a4a('0x2e')][_0x3a4a('0x3a')]){_0x2232d0[_0x3a4a('0x3b')]=[{'all':!![]}];}_0x2232d0=_[_0x3a4a('0x38')]({},_0x2232d0,_0x22f63b[_0x3a4a('0x39')]);return db['VoiceMailMessage'][_0x3a4a('0x41')](_0x2232d0)[_0x3a4a('0x24')](handleEntityNotFound(_0x46db25,null))[_0x3a4a('0x24')](respondWithResult(_0x46db25,null))[_0x3a4a('0x3d')](handleError(_0x46db25,null));};exports[_0x3a4a('0x42')]=function(_0xd9c031,_0x5cb867){return db[_0x3a4a('0x29')][_0x3a4a('0x42')](_0xd9c031[_0x3a4a('0x43')],{})[_0x3a4a('0x24')](respondWithResult(_0x5cb867,0xc9))[_0x3a4a('0x3d')](handleError(_0x5cb867,null));};exports['update']=function(_0x302537,_0x286bfa){if(_0x302537[_0x3a4a('0x43')]['id']){delete _0x302537[_0x3a4a('0x43')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x302537[_0x3a4a('0x44')]['id']}})[_0x3a4a('0x24')](handleEntityNotFound(_0x286bfa,null))[_0x3a4a('0x24')](saveUpdates(_0x302537[_0x3a4a('0x43')],null))['then'](respondWithResult(_0x286bfa,null))[_0x3a4a('0x3d')](handleError(_0x286bfa,null));};exports[_0x3a4a('0x45')]=function(_0x261ed9,_0x7aa62d){return db[_0x3a4a('0x29')]['find']({'where':{'id':_0x261ed9[_0x3a4a('0x44')]['id']}})[_0x3a4a('0x24')](handleEntityNotFound(_0x7aa62d,null))[_0x3a4a('0x24')](removeEntity(_0x7aa62d,null))['catch'](handleError(_0x7aa62d,null));};exports[_0x3a4a('0x46')]=function(_0x1ba2d8,_0x363b2d,_0x319e0e){return db[_0x3a4a('0x29')]['find']({'where':{'id':_0x1ba2d8['params']['id']},'attributes':['id',_0x3a4a('0x47'),_0x3a4a('0x48')]})[_0x3a4a('0x24')](handleEntityNotFound(_0x363b2d,null))[_0x3a4a('0x24')](function(_0x3ec458){if(_0x3ec458){if(!_0x3ec458[_0x3a4a('0x47')]){throw new db[(_0x3a4a('0x49'))][(_0x3a4a('0x4a'))](_0x3a4a('0x4b'));}var _0x21ea51={'Content-Type':_0x3a4a('0x4c'),'Content-Disposition':_0x3a4a('0x4d')};if(_0x3ec458['msg_id']){_0x21ea51[_0x3a4a('0x4e')]='attachment;\x20filename=\x22'+_0x3ec458[_0x3a4a('0x48')]+_0x3a4a('0x4f');}_0x363b2d[_0x3a4a('0x50')](_0x21ea51);return _0x363b2d['send'](new Buffer(_0x3ec458[_0x3a4a('0x47')]));}})[_0x3a4a('0x3d')](handleError(_0x363b2d,null));}; \ No newline at end of file +var _0x2d41=['create','body','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','model','differenceBy','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','findAll','catch','show','params','includeAll','include','find'];(function(_0x261808,_0x1ce540){var _0x2d684a=function(_0x3f82fa){while(--_0x3f82fa){_0x261808['push'](_0x261808['shift']());}};_0x2d684a(++_0x1ce540);}(_0x2d41,0x1ab));var _0x12d4=function(_0x698078,_0xf2ac9c){_0x698078=_0x698078-0x0;var _0x492aba=_0x2d41[_0x698078];return _0x492aba;};'use strict';var emlformat=require(_0x12d4('0x0'));var rimraf=require(_0x12d4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x12d4('0x2'));var rp=require(_0x12d4('0x3'));var moment=require(_0x12d4('0x4'));var BPromise=require(_0x12d4('0x5'));var Mustache=require(_0x12d4('0x6'));var util=require(_0x12d4('0x7'));var path=require(_0x12d4('0x8'));var sox=require(_0x12d4('0x9'));var csv=require(_0x12d4('0xa'));var ejs=require(_0x12d4('0xb'));var fs=require('fs');var fs_extra=require(_0x12d4('0xc'));var _=require(_0x12d4('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x12d4('0xe'));var deskjs=require(_0x12d4('0xf'));var toCsv=require(_0x12d4('0xa'));var querystring=require(_0x12d4('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x12d4('0x11'));var qs=require(_0x12d4('0x12'));var as=require(_0x12d4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x12d4('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x12d4('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d92a1,_0x55c9b9){_0x55c9b9=_0x55c9b9||0xcc;return function(_0x5d2154){if(_0x5d2154){return _0x2d92a1[_0x12d4('0x16')](_0x55c9b9);}return _0x2d92a1['status'](_0x55c9b9)[_0x12d4('0x17')]();};}function respondWithResult(_0x286f7c,_0x126e93){_0x126e93=_0x126e93||0xc8;return function(_0x27bf74){if(_0x27bf74){return _0x286f7c[_0x12d4('0x18')](_0x126e93)['json'](_0x27bf74);}};}function respondWithFilteredResult(_0x1c163d,_0x3d348c){return function(_0x321849){if(_0x321849){var _0x4a21c4=typeof _0x3d348c[_0x12d4('0x19')]===_0x12d4('0x1a')&&typeof _0x3d348c[_0x12d4('0x1b')]===_0x12d4('0x1a');var _0x1e6933=_0x321849['count'];var _0x5c1f0e=_0x4a21c4?0x0:_0x3d348c[_0x12d4('0x19')];var _0xbfa8e4=_0x4a21c4?_0x321849[_0x12d4('0x1c')]:_0x3d348c['offset']+_0x3d348c['limit'];var _0x5c65a0;if(_0xbfa8e4>=_0x1e6933){_0xbfa8e4=_0x1e6933;_0x5c65a0=0xc8;}else{_0x5c65a0=0xce;}_0x1c163d[_0x12d4('0x18')](_0x5c65a0);return _0x1c163d[_0x12d4('0x1d')](_0x12d4('0x1e'),_0x5c1f0e+'-'+_0xbfa8e4+'/'+_0x1e6933)['json'](_0x321849);}return null;};}function patchUpdates(_0x1d5ef3){return function(_0x559dca){try{jsonpatch[_0x12d4('0x1f')](_0x559dca,_0x1d5ef3,!![]);}catch(_0x2c014e){return BPromise[_0x12d4('0x20')](_0x2c014e);}return _0x559dca[_0x12d4('0x21')]();};}function saveUpdates(_0x3e68e9,_0x20268c){return function(_0x245587){if(_0x245587){return _0x245587[_0x12d4('0x22')](_0x3e68e9)['then'](function(_0x13120b){return _0x13120b;});}return null;};}function removeEntity(_0x4905ec,_0x13ea86){return function(_0x344e3b){if(_0x344e3b){return _0x344e3b[_0x12d4('0x23')]()[_0x12d4('0x24')](function(){_0x4905ec[_0x12d4('0x18')](0xcc)[_0x12d4('0x17')]();});}};}function handleEntityNotFound(_0x2e817b,_0x431072){return function(_0x441544){if(!_0x441544){_0x2e817b[_0x12d4('0x16')](0x194);}return _0x441544;};}function handleError(_0x158d6f,_0x1524c2){_0x1524c2=_0x1524c2||0x1f4;return function(_0x381d37){logger[_0x12d4('0x25')](_0x381d37[_0x12d4('0x26')]);if(_0x381d37['name']){delete _0x381d37['name'];}_0x158d6f['status'](_0x1524c2)[_0x12d4('0x27')](_0x381d37);};}exports[_0x12d4('0x28')]=function(_0x406f61,_0x1be450){var _0x3dca89={},_0x4903d1={},_0x10ce58={'count':0x0,'rows':[]};var _0x473b92=_[_0x12d4('0x29')](db[_0x12d4('0x2a')][_0x12d4('0x2b')],function(_0x347d0a){return{'name':_0x347d0a[_0x12d4('0x2c')],'type':_0x347d0a[_0x12d4('0x2d')]['key']};});_0x4903d1[_0x12d4('0x2e')]=_[_0x12d4('0x2f')](_[_0x12d4('0x29')](_0x473b92,_0x12d4('0x30')),[_0x12d4('0x30')]);_0x4903d1[_0x12d4('0x31')]=_[_0x12d4('0x32')](_0x406f61[_0x12d4('0x31')]);_0x4903d1[_0x12d4('0x33')]=_[_0x12d4('0x34')](_0x4903d1[_0x12d4('0x2e')],_0x4903d1[_0x12d4('0x31')]);_0x3dca89[_0x12d4('0x35')]=_[_0x12d4('0x34')](_0x4903d1[_0x12d4('0x2e')],qs[_0x12d4('0x36')](_0x406f61[_0x12d4('0x31')][_0x12d4('0x36')]));_0x3dca89[_0x12d4('0x35')]=_0x3dca89[_0x12d4('0x35')][_0x12d4('0x37')]?_0x3dca89[_0x12d4('0x35')]:_0x4903d1[_0x12d4('0x2e')];if(!_0x406f61['query']['hasOwnProperty'](_0x12d4('0x38'))){_0x3dca89[_0x12d4('0x1b')]=qs[_0x12d4('0x1b')](_0x406f61[_0x12d4('0x31')][_0x12d4('0x1b')]);_0x3dca89['offset']=qs[_0x12d4('0x19')](_0x406f61[_0x12d4('0x31')][_0x12d4('0x19')]);}_0x3dca89[_0x12d4('0x39')]=qs[_0x12d4('0x3a')](_0x406f61[_0x12d4('0x31')][_0x12d4('0x3a')]);_0x3dca89['where']=qs[_0x12d4('0x33')](_[_0x12d4('0x3b')](_0x406f61['query'],_0x4903d1[_0x12d4('0x33')]),_0x473b92);if(_0x406f61[_0x12d4('0x31')][_0x12d4('0x3c')]){_0x3dca89[_0x12d4('0x3d')]=_[_0x12d4('0x3e')](_0x3dca89[_0x12d4('0x3d')],{'$or':_[_0x12d4('0x29')](_0x473b92,function(_0x31935f){if(_0x31935f[_0x12d4('0x2d')]!=='VIRTUAL'){var _0x46bcc4={};_0x46bcc4[_0x31935f[_0x12d4('0x30')]]={'$like':'%'+_0x406f61[_0x12d4('0x31')][_0x12d4('0x3c')]+'%'};return _0x46bcc4;}})});}_0x3dca89=_[_0x12d4('0x3e')]({},_0x3dca89,_0x406f61[_0x12d4('0x3f')]);var _0xba8380={'where':_0x3dca89[_0x12d4('0x3d')]};return db[_0x12d4('0x2a')][_0x12d4('0x1c')](_0xba8380)[_0x12d4('0x24')](function(_0x301785){_0x10ce58[_0x12d4('0x1c')]=_0x301785;if(_0x406f61[_0x12d4('0x31')]['includeAll']){_0x3dca89['include']=[{'all':!![]}];}return db['VoiceMailMessage'][_0x12d4('0x40')](_0x3dca89);})[_0x12d4('0x24')](function(_0xd60eae){_0x10ce58['rows']=_0xd60eae;return _0x10ce58;})[_0x12d4('0x24')](respondWithFilteredResult(_0x1be450,_0x3dca89))[_0x12d4('0x41')](handleError(_0x1be450,null));};exports[_0x12d4('0x42')]=function(_0x2ee3b6,_0x42a190){var _0x2a5bac={'raw':!![],'where':{'id':_0x2ee3b6[_0x12d4('0x43')]['id']}},_0x16e44d={};_0x16e44d[_0x12d4('0x2e')]=_['keys'](db[_0x12d4('0x2a')][_0x12d4('0x2b')]);_0x16e44d[_0x12d4('0x31')]=_[_0x12d4('0x32')](_0x2ee3b6['query']);_0x16e44d[_0x12d4('0x33')]=_['intersection'](_0x16e44d[_0x12d4('0x2e')],_0x16e44d['query']);_0x2a5bac[_0x12d4('0x35')]=_[_0x12d4('0x34')](_0x16e44d[_0x12d4('0x2e')],qs[_0x12d4('0x36')](_0x2ee3b6[_0x12d4('0x31')][_0x12d4('0x36')]));_0x2a5bac[_0x12d4('0x35')]=_0x2a5bac[_0x12d4('0x35')][_0x12d4('0x37')]?_0x2a5bac['attributes']:_0x16e44d['model'];if(_0x2ee3b6[_0x12d4('0x31')][_0x12d4('0x44')]){_0x2a5bac[_0x12d4('0x45')]=[{'all':!![]}];}_0x2a5bac=_[_0x12d4('0x3e')]({},_0x2a5bac,_0x2ee3b6[_0x12d4('0x3f')]);return db['VoiceMailMessage'][_0x12d4('0x46')](_0x2a5bac)[_0x12d4('0x24')](handleEntityNotFound(_0x42a190,null))[_0x12d4('0x24')](respondWithResult(_0x42a190,null))[_0x12d4('0x41')](handleError(_0x42a190,null));};exports[_0x12d4('0x47')]=function(_0x58093d,_0x364e17){return db[_0x12d4('0x2a')][_0x12d4('0x47')](_0x58093d[_0x12d4('0x48')],{})['then'](respondWithResult(_0x364e17,0xc9))[_0x12d4('0x41')](handleError(_0x364e17,null));};exports[_0x12d4('0x22')]=function(_0x435589,_0x5e5a49){if(_0x435589['body']['id']){delete _0x435589[_0x12d4('0x48')]['id'];}return db[_0x12d4('0x2a')][_0x12d4('0x46')]({'where':{'id':_0x435589['params']['id']}})[_0x12d4('0x24')](handleEntityNotFound(_0x5e5a49,null))['then'](saveUpdates(_0x435589[_0x12d4('0x48')],null))['then'](respondWithResult(_0x5e5a49,null))[_0x12d4('0x41')](handleError(_0x5e5a49,null));};exports['destroy']=function(_0x3bc5d7,_0x1f7dac){return db[_0x12d4('0x2a')][_0x12d4('0x46')]({'where':{'id':_0x3bc5d7[_0x12d4('0x43')]['id']}})[_0x12d4('0x24')](handleEntityNotFound(_0x1f7dac,null))[_0x12d4('0x24')](removeEntity(_0x1f7dac,null))['catch'](handleError(_0x1f7dac,null));};exports[_0x12d4('0x49')]=function(_0x2fc0f9,_0x106f9d,_0x5431f9){return db['VoiceMailMessage']['find']({'where':{'id':_0x2fc0f9[_0x12d4('0x43')]['id']},'attributes':['id',_0x12d4('0x4a'),'msg_id']})[_0x12d4('0x24')](handleEntityNotFound(_0x106f9d,null))[_0x12d4('0x24')](function(_0x80c706){if(_0x80c706){if(!_0x80c706['recording']){throw new db[(_0x12d4('0x4b'))][(_0x12d4('0x4c'))](_0x12d4('0x4d'));}var _0x21f7b2={'Content-Type':_0x12d4('0x4e'),'Content-Disposition':_0x12d4('0x4f')};if(_0x80c706[_0x12d4('0x50')]){_0x21f7b2['Content-Disposition']=_0x12d4('0x51')+_0x80c706[_0x12d4('0x50')]+_0x12d4('0x52');}_0x106f9d[_0x12d4('0x1d')](_0x21f7b2);return _0x106f9d[_0x12d4('0x27')](new Buffer(_0x80c706[_0x12d4('0x4a')]));}})[_0x12d4('0x41')](handleError(_0x106f9d,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 31f6975..3f67eff 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 _0xfee8=['voice_voicemail_messages','dir','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xfee8,0xe8));var _0x8fee=function(_0x4635e5,_0x5590a9){_0x4635e5=_0x4635e5-0x0;var _0x5a187b=_0xfee8[_0x4635e5];return _0x5a187b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8fee('0x0'));var rp=require(_0x8fee('0x1'));var fs=require('fs');var path=require(_0x8fee('0x2'));var rimraf=require(_0x8fee('0x3'));var config=require(_0x8fee('0x4'));var attributes=require(_0x8fee('0x5'));module[_0x8fee('0x6')]=function(_0x4353b7,_0x171335){return _0x4353b7[_0x8fee('0x7')]('VoiceMailMessage',attributes,{'tableName':_0x8fee('0x8'),'paranoid':![],'indexes':[{'name':_0x8fee('0x9'),'fields':[_0x8fee('0x9')]}],'timestamps':![]});}; \ No newline at end of file +var _0x603e=['lodash','util','api','bluebird','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x603e,0x15c));var _0xe603=function(_0x16eb11,_0x1a2251){_0x16eb11=_0x16eb11-0x0;var _0x3ae7ef=_0x603e[_0x16eb11];return _0x3ae7ef;};'use strict';var _=require(_0xe603('0x0'));var util=require(_0xe603('0x1'));var logger=require('../../config/logger')(_0xe603('0x2'));var moment=require('moment');var BPromise=require(_0xe603('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe603('0x4'));var config=require(_0xe603('0x5'));var attributes=require(_0xe603('0x6'));module[_0xe603('0x7')]=function(_0xdadf86,_0x5c84e1){return _0xdadf86[_0xe603('0x8')](_0xe603('0x9'),attributes,{'tableName':_0xe603('0xa'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0xe603('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 97d0946..02b084c 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 _0x9939=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird'];(function(_0x527847,_0x5e9fb4){var _0x1742a6=function(_0x4efe94){while(--_0x4efe94){_0x527847['push'](_0x527847['shift']());}};_0x1742a6(++_0x5e9fb4);}(_0x9939,0x1a1));var _0x9993=function(_0x5b339b,_0x51fdbe){_0x5b339b=_0x5b339b-0x0;var _0x5b8380=_0x9939[_0x5b339b];return _0x5b8380;};'use strict';var _=require('lodash');var util=require(_0x9993('0x0'));var moment=require(_0x9993('0x1'));var BPromise=require(_0x9993('0x2'));var rs=require(_0x9993('0x3'));var fs=require('fs');var Redis=require(_0x9993('0x4'));var db=require(_0x9993('0x5'))['db'];var utils=require(_0x9993('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9993('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9993('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47cf4a,_0x310b15,_0xa6ad28){return new BPromise(function(_0x5d63a8,_0x3df139){return client['request'](_0x47cf4a,_0xa6ad28)[_0x9993('0x9')](function(_0x27bccb){logger[_0x9993('0xa')](_0x9993('0xb'),_0x310b15,_0x9993('0xc'));logger[_0x9993('0xd')](_0x9993('0xe'),_0x310b15,_0x9993('0xc'),JSON[_0x9993('0xf')](_0x27bccb));if(_0x27bccb['error']){if(_0x27bccb[_0x9993('0x10')][_0x9993('0x11')]===0x1f4){logger[_0x9993('0x10')](_0x9993('0xb'),_0x310b15,_0x27bccb['error'][_0x9993('0x12')]);return _0x3df139(_0x27bccb[_0x9993('0x10')][_0x9993('0x12')]);}logger['error'](_0x9993('0xb'),_0x310b15,_0x27bccb['error'][_0x9993('0x12')]);return _0x5d63a8(_0x27bccb[_0x9993('0x10')][_0x9993('0x12')]);}else{logger[_0x9993('0xa')](_0x9993('0xb'),_0x310b15,_0x9993('0xc'));_0x5d63a8(_0x27bccb['result'][_0x9993('0x12')]);}})[_0x9993('0x13')](function(_0x4bfd2d){logger[_0x9993('0x10')](_0x9993('0xb'),_0x310b15,_0x4bfd2d);_0x3df139(_0x4bfd2d);});});} \ No newline at end of file +var _0x1225=['info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3d18af,_0x5b4fa0){var _0x2ef919=function(_0x3c26d6){while(--_0x3c26d6){_0x3d18af['push'](_0x3d18af['shift']());}};_0x2ef919(++_0x5b4fa0);}(_0x1225,0x171));var _0x5122=function(_0x2144f0,_0x8479fd){_0x2144f0=_0x2144f0-0x0;var _0x1d0f5d=_0x1225[_0x2144f0];return _0x1d0f5d;};'use strict';var _=require(_0x5122('0x0'));var util=require(_0x5122('0x1'));var moment=require(_0x5122('0x2'));var BPromise=require(_0x5122('0x3'));var rs=require(_0x5122('0x4'));var fs=require('fs');var Redis=require(_0x5122('0x5'));var db=require(_0x5122('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5122('0x7'))(_0x5122('0x8'));var config=require(_0x5122('0x9'));var jayson=require(_0x5122('0xa'));var client=jayson[_0x5122('0xb')][_0x5122('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3608e3,_0x47bc76,_0x440610){return new BPromise(function(_0x2b2e41,_0x4fd12f){return client[_0x5122('0xd')](_0x3608e3,_0x440610)[_0x5122('0xe')](function(_0x1b90f2){logger[_0x5122('0xf')](_0x5122('0x10'),_0x47bc76,_0x5122('0x11'));logger['debug'](_0x5122('0x12'),_0x47bc76,_0x5122('0x11'),JSON[_0x5122('0x13')](_0x1b90f2));if(_0x1b90f2[_0x5122('0x14')]){if(_0x1b90f2[_0x5122('0x14')]['code']===0x1f4){logger[_0x5122('0x14')](_0x5122('0x10'),_0x47bc76,_0x1b90f2[_0x5122('0x14')]['message']);return _0x4fd12f(_0x1b90f2[_0x5122('0x14')]['message']);}logger[_0x5122('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0x47bc76,_0x1b90f2['error'][_0x5122('0x15')]);return _0x2b2e41(_0x1b90f2[_0x5122('0x14')]['message']);}else{logger[_0x5122('0xf')](_0x5122('0x10'),_0x47bc76,_0x5122('0x11'));_0x2b2e41(_0x1b90f2[_0x5122('0x16')][_0x5122('0x15')]);}})[_0x5122('0x17')](function(_0x5d4415){logger[_0x5122('0x14')](_0x5122('0x10'),_0x47bc76,_0x5d4415);_0x4fd12f(_0x5d4415);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 06422fb..b2dbc14 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 _0x26fa=['/:id','show','create','post','addSound','put','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','path','connect-timeout','Router','./voiceMusicOnHold.controller','isAuthenticated','index','get'];(function(_0x24a7c9,_0x157c78){var _0x451a81=function(_0x4bdc76){while(--_0x4bdc76){_0x24a7c9['push'](_0x24a7c9['shift']());}};_0x451a81(++_0x157c78);}(_0x26fa,0x90));var _0xa26f=function(_0x3268c8,_0x9c1403){_0x3268c8=_0x3268c8-0x0;var _0x203a8c=_0x26fa[_0x3268c8];return _0x203a8c;};'use strict';var multer=require(_0xa26f('0x0'));var util=require('util');var path=require(_0xa26f('0x1'));var timeout=require(_0xa26f('0x2'));var express=require('express');var router=express[_0xa26f('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(_0xa26f('0x4'));router['get']('/',auth[_0xa26f('0x5')](),controller[_0xa26f('0x6')]);router[_0xa26f('0x7')](_0xa26f('0x8'),auth['isAuthenticated'](),controller[_0xa26f('0x9')]);router[_0xa26f('0x7')]('/:id/sounds',auth['isAuthenticated'](),controller['getSounds']);router['post']('/',auth[_0xa26f('0x5')](),controller[_0xa26f('0xa')]);router[_0xa26f('0xb')]('/:id/sounds',auth[_0xa26f('0x5')](),controller[_0xa26f('0xc')]);router[_0xa26f('0xd')]('/:id',auth[_0xa26f('0x5')](),controller['update']);router[_0xa26f('0xe')](_0xa26f('0x8'),auth[_0xa26f('0x5')](),controller[_0xa26f('0xf')]);router[_0xa26f('0xe')](_0xa26f('0x10'),auth[_0xa26f('0x5')](),controller[_0xa26f('0x11')]);module[_0xa26f('0x12')]=router; \ No newline at end of file +var _0x8589=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/sounds','getSounds','post','put','/:id','delete','/:id/sounds/:id2','removeSound','exports','multer','util','connect-timeout'];(function(_0x593943,_0x4ea58c){var _0x18f984=function(_0x2799b8){while(--_0x2799b8){_0x593943['push'](_0x593943['shift']());}};_0x18f984(++_0x4ea58c);}(_0x8589,0xb1));var _0x9858=function(_0x27656b,_0x18b3c7){_0x27656b=_0x27656b-0x0;var _0x2b47c8=_0x8589[_0x27656b];return _0x2b47c8;};'use strict';var multer=require(_0x9858('0x0'));var util=require(_0x9858('0x1'));var path=require('path');var timeout=require(_0x9858('0x2'));var express=require(_0x9858('0x3'));var router=express['Router']();var fs_extra=require(_0x9858('0x4'));var auth=require(_0x9858('0x5'));var interaction=require(_0x9858('0x6'));var config=require(_0x9858('0x7'));var controller=require('./voiceMusicOnHold.controller');router[_0x9858('0x8')]('/',auth[_0x9858('0x9')](),controller[_0x9858('0xa')]);router[_0x9858('0x8')]('/:id',auth[_0x9858('0x9')](),controller['show']);router['get'](_0x9858('0xb'),auth[_0x9858('0x9')](),controller[_0x9858('0xc')]);router[_0x9858('0xd')]('/',auth[_0x9858('0x9')](),controller['create']);router[_0x9858('0xd')](_0x9858('0xb'),auth[_0x9858('0x9')](),controller['addSound']);router[_0x9858('0xe')](_0x9858('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x9858('0x10')](_0x9858('0xf'),auth['isAuthenticated'](),controller['destroy']);router[_0x9858('0x10')](_0x9858('0x11'),auth[_0x9858('0x9')](),controller[_0x9858('0x12')]);module[_0x9858('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 9be6266..b86672d 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 _0xbfd2=['custom','mp3nb','quietmp3','mp3','files','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM'];(function(_0x114748,_0x2a7e15){var _0x173357=function(_0xd7b840){while(--_0xd7b840){_0x114748['push'](_0x114748['shift']());}};_0x173357(++_0x2a7e15);}(_0xbfd2,0x14b));var _0x2bfd=function(_0x905fcb,_0x15216d){_0x905fcb=_0x905fcb-0x0;var _0x4c24a7=_0xbfd2[_0x905fcb];return _0x4c24a7;};'use strict';var Sequelize=require(_0x2bfd('0x0'));module[_0x2bfd('0x1')]={'name':{'type':Sequelize[_0x2bfd('0x2')],'allowNull':![],'unique':_0x2bfd('0x3')},'mode':{'type':Sequelize[_0x2bfd('0x4')](_0x2bfd('0x5'),'files',_0x2bfd('0x6'),'quietmp3nb',_0x2bfd('0x7'),_0x2bfd('0x8')),'allowNull':!![],'defaultValue':_0x2bfd('0x9')},'directory':{'type':Sequelize[_0x2bfd('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x2bfd('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x2bfd('0x2')],'allowNull':!![]},'stamp':{'type':_0x2bfd('0xa')},'defaultEntry':{'type':Sequelize[_0x2bfd('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5f5b=['files','mp3nb','quietmp3','alpha','TIMESTAMP','BOOLEAN','exports','STRING','name','custom'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f5b,0xec));var _0xb5f5=function(_0x305010,_0x54c9e3){_0x305010=_0x305010-0x0;var _0x46aa73=_0x5f5b[_0x305010];return _0x46aa73;};'use strict';var Sequelize=require('sequelize');module[_0xb5f5('0x0')]={'name':{'type':Sequelize[_0xb5f5('0x1')],'allowNull':![],'unique':_0xb5f5('0x2')},'mode':{'type':Sequelize['ENUM'](_0xb5f5('0x3'),_0xb5f5('0x4'),_0xb5f5('0x5'),'quietmp3nb',_0xb5f5('0x6'),'mp3'),'allowNull':!![],'defaultValue':_0xb5f5('0x4')},'directory':{'type':Sequelize[_0xb5f5('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0xb5f5('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xb5f5('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xb5f5('0x1')],'allowNull':!![],'defaultValue':_0xb5f5('0x7')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xb5f5('0x8')},'defaultEntry':{'type':Sequelize[_0xb5f5('0x9')],'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 af4675d..838982b 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 _0xe6ba=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','update','destroy','then','UserProfileResource','error','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','rows','catch','show','params','keys','find','body','create','sequelize','transaction','mode','files','directory','root','mkdirSync','0777','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','message','addSound','findOne','save_name','converted_format','server/files/sounds/converted','format','%s.%s','extname','server/files/moh','symlinkSync','Sequelize','removeSound','id2','createdAt','ValidationError','getSounds','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x15f012,_0x4cce15){var _0x3d1adf=function(_0x3363f9){while(--_0x3363f9){_0x15f012['push'](_0x15f012['shift']());}};_0x3d1adf(++_0x4cce15);}(_0xe6ba,0x1b3));var _0xae6b=function(_0x3b7994,_0x2f01e1){_0x3b7994=_0x3b7994-0x0;var _0x49bd13=_0xe6ba[_0x3b7994];return _0x49bd13;};'use strict';var emlformat=require(_0xae6b('0x0'));var rimraf=require(_0xae6b('0x1'));var zipdir=require(_0xae6b('0x2'));var jsonpatch=require(_0xae6b('0x3'));var rp=require(_0xae6b('0x4'));var moment=require(_0xae6b('0x5'));var BPromise=require(_0xae6b('0x6'));var Mustache=require(_0xae6b('0x7'));var util=require(_0xae6b('0x8'));var path=require(_0xae6b('0x9'));var sox=require(_0xae6b('0xa'));var csv=require(_0xae6b('0xb'));var ejs=require(_0xae6b('0xc'));var fs=require('fs');var fs_extra=require(_0xae6b('0xd'));var _=require('lodash');var squel=require(_0xae6b('0xe'));var crypto=require(_0xae6b('0xf'));var jsforce=require(_0xae6b('0x10'));var deskjs=require(_0xae6b('0x11'));var toCsv=require('to-csv');var querystring=require(_0xae6b('0x12'));var Papa=require(_0xae6b('0x13'));var Redis=require(_0xae6b('0x14'));var authService=require(_0xae6b('0x15'));var qs=require(_0xae6b('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae6b('0x17'));var logger=require(_0xae6b('0x18'))(_0xae6b('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xae6b('0x1a'));var db=require(_0xae6b('0x1b'))['db'];function respondWithStatusCode(_0x24fe40,_0x4033d1){_0x4033d1=_0x4033d1||0xcc;return function(_0x3b44a7){if(_0x3b44a7){return _0x24fe40[_0xae6b('0x1c')](_0x4033d1);}return _0x24fe40[_0xae6b('0x1d')](_0x4033d1)[_0xae6b('0x1e')]();};}function respondWithResult(_0x509ccb,_0x2326e5){_0x2326e5=_0x2326e5||0xc8;return function(_0x186e09){if(_0x186e09){return _0x509ccb[_0xae6b('0x1d')](_0x2326e5)[_0xae6b('0x1f')](_0x186e09);}};}function respondWithFilteredResult(_0x311838,_0x19761d){return function(_0x20a423){if(_0x20a423){var _0x1eb392=typeof _0x19761d['offset']===_0xae6b('0x20')&&typeof _0x19761d[_0xae6b('0x21')]===_0xae6b('0x20');var _0x895ed3=_0x20a423['count'];var _0x131a7e=_0x1eb392?0x0:_0x19761d[_0xae6b('0x22')];var _0x4b0763=_0x1eb392?_0x20a423[_0xae6b('0x23')]:_0x19761d[_0xae6b('0x22')]+_0x19761d[_0xae6b('0x21')];var _0x46557d;if(_0x4b0763>=_0x895ed3){_0x4b0763=_0x895ed3;_0x46557d=0xc8;}else{_0x46557d=0xce;}_0x311838[_0xae6b('0x1d')](_0x46557d);return _0x311838[_0xae6b('0x24')](_0xae6b('0x25'),_0x131a7e+'-'+_0x4b0763+'/'+_0x895ed3)[_0xae6b('0x1f')](_0x20a423);}return null;};}function patchUpdates(_0x3a8c09){return function(_0x56ca93){try{jsonpatch['apply'](_0x56ca93,_0x3a8c09,!![]);}catch(_0x30c972){return BPromise[_0xae6b('0x26')](_0x30c972);}return _0x56ca93['save']();};}function saveUpdates(_0x4736e8,_0x2fe3ec){return function(_0x5a12b7){if(_0x5a12b7){return _0x5a12b7[_0xae6b('0x27')](_0x4736e8)['then'](function(_0x5dd2a7){return _0x5dd2a7;});}return null;};}function removeEntity(_0xccf6b0,_0x1badad){return function(_0x36dadd){if(_0x36dadd){return _0x36dadd[_0xae6b('0x28')]()[_0xae6b('0x29')](function(){var _0x2c0766=_0x36dadd['get']({'plain':!![]});var _0x3bf66e='MusicOnHolds';return db[_0xae6b('0x2a')]['destroy']({'where':{'type':_0x3bf66e,'resourceId':_0x2c0766['id']}})[_0xae6b('0x29')](function(){return _0x36dadd;});})[_0xae6b('0x29')](function(){_0xccf6b0[_0xae6b('0x1d')](0xcc)[_0xae6b('0x1e')]();});}};}function handleEntityNotFound(_0x55184f,_0x5e75cd){return function(_0x406328){if(!_0x406328){_0x55184f[_0xae6b('0x1c')](0x194);}return _0x406328;};}function handleError(_0x2aaede,_0x24ad6f){_0x24ad6f=_0x24ad6f||0x1f4;return function(_0x220f3d){logger[_0xae6b('0x2b')](_0x220f3d['stack']);if(_0x220f3d[_0xae6b('0x2c')]){delete _0x220f3d[_0xae6b('0x2c')];}_0x2aaede['status'](_0x24ad6f)['send'](_0x220f3d);};}exports[_0xae6b('0x2d')]=function(_0x4d3419,_0x54616d){var _0x4043ce={},_0x1b1518={},_0x136117={'count':0x0,'rows':[]};var _0x5155d7=_[_0xae6b('0x2e')](db[_0xae6b('0x2f')][_0xae6b('0x30')],function(_0xf001e){return{'name':_0xf001e[_0xae6b('0x31')],'type':_0xf001e[_0xae6b('0x32')][_0xae6b('0x33')]};});_0x1b1518[_0xae6b('0x34')]=_[_0xae6b('0x2e')](_0x5155d7,_0xae6b('0x2c'));_0x1b1518[_0xae6b('0x35')]=_['keys'](_0x4d3419[_0xae6b('0x35')]);_0x1b1518[_0xae6b('0x36')]=_[_0xae6b('0x37')](_0x1b1518['model'],_0x1b1518['query']);_0x4043ce['attributes']=_[_0xae6b('0x37')](_0x1b1518['model'],qs['fields'](_0x4d3419['query'][_0xae6b('0x38')]));_0x4043ce[_0xae6b('0x39')]=_0x4043ce['attributes'][_0xae6b('0x3a')]?_0x4043ce[_0xae6b('0x39')]:_0x1b1518['model'];if(!_0x4d3419[_0xae6b('0x35')][_0xae6b('0x3b')](_0xae6b('0x3c'))){_0x4043ce[_0xae6b('0x21')]=qs['limit'](_0x4d3419[_0xae6b('0x35')]['limit']);_0x4043ce[_0xae6b('0x22')]=qs[_0xae6b('0x22')](_0x4d3419[_0xae6b('0x35')]['offset']);}_0x4043ce[_0xae6b('0x3d')]=qs['sort'](_0x4d3419[_0xae6b('0x35')]['sort']);delete _0x4d3419[_0xae6b('0x35')][_0xae6b('0x3e')];_0x4043ce['where']=qs[_0xae6b('0x36')](_['pick'](_0x4d3419[_0xae6b('0x35')],_0x1b1518['filters']),_0x5155d7);if(_0x4d3419[_0xae6b('0x35')]['filter']){_0x4043ce[_0xae6b('0x3f')]=_[_0xae6b('0x40')](_0x4043ce[_0xae6b('0x3f')],{'$or':_[_0xae6b('0x2e')](_0x5155d7,function(_0xaaf209){if(_0xaaf209[_0xae6b('0x32')]!==_0xae6b('0x41')){var _0x17b9a9={};_0x17b9a9[_0xaaf209[_0xae6b('0x2c')]]={'$like':'%'+_0x4d3419[_0xae6b('0x35')][_0xae6b('0x42')]+'%'};return _0x17b9a9;}})});}_0x4043ce=_[_0xae6b('0x40')]({},_0x4043ce,_0x4d3419[_0xae6b('0x43')]);var _0x164a6a={'where':_0x4043ce[_0xae6b('0x3f')]};return db[_0xae6b('0x2f')]['count'](_0x164a6a)[_0xae6b('0x29')](function(_0x4c8d5c){_0x136117[_0xae6b('0x23')]=_0x4c8d5c;if(_0x4d3419['query']['includeAll']){_0x4043ce[_0xae6b('0x44')]=[{'all':!![]}];}return db[_0xae6b('0x2f')]['findAll'](_0x4043ce);})[_0xae6b('0x29')](function(_0x508c39){_0x136117[_0xae6b('0x45')]=_0x508c39;return _0x136117;})['then'](respondWithFilteredResult(_0x54616d,_0x4043ce))[_0xae6b('0x46')](handleError(_0x54616d,null));};exports[_0xae6b('0x47')]=function(_0x567a86,_0x5315da){var _0x4ecddc={'raw':![],'where':{'id':_0x567a86[_0xae6b('0x48')]['id']}},_0x165b91={};_0x165b91[_0xae6b('0x34')]=_[_0xae6b('0x49')](db[_0xae6b('0x2f')][_0xae6b('0x30')]);_0x165b91[_0xae6b('0x35')]=_['keys'](_0x567a86[_0xae6b('0x35')]);_0x165b91[_0xae6b('0x36')]=_[_0xae6b('0x37')](_0x165b91[_0xae6b('0x34')],_0x165b91['query']);_0x4ecddc[_0xae6b('0x39')]=_[_0xae6b('0x37')](_0x165b91[_0xae6b('0x34')],qs[_0xae6b('0x38')](_0x567a86['query'][_0xae6b('0x38')]));_0x4ecddc[_0xae6b('0x39')]=_0x4ecddc[_0xae6b('0x39')][_0xae6b('0x3a')]?_0x4ecddc['attributes']:_0x165b91[_0xae6b('0x34')];if(_0x567a86['query']['includeAll']){_0x4ecddc[_0xae6b('0x44')]=[{'all':!![]}];}_0x4ecddc=_[_0xae6b('0x40')]({},_0x4ecddc,_0x567a86['options']);return db[_0xae6b('0x2f')][_0xae6b('0x4a')](_0x4ecddc)['then'](handleEntityNotFound(_0x5315da,null))[_0xae6b('0x29')](respondWithResult(_0x5315da,null))['catch'](handleError(_0x5315da,null));};exports[_0xae6b('0x27')]=function(_0x26e555,_0x3380c2){if(_0x26e555[_0xae6b('0x4b')]['id']){delete _0x26e555[_0xae6b('0x4b')]['id'];}return db['VoiceMusicOnHold'][_0xae6b('0x4a')]({'where':{'id':_0x26e555[_0xae6b('0x48')]['id']}})['then'](handleEntityNotFound(_0x3380c2,null))[_0xae6b('0x29')](saveUpdates(_0x26e555['body'],null))[_0xae6b('0x29')](respondWithResult(_0x3380c2,null))[_0xae6b('0x46')](handleError(_0x3380c2,null));};exports[_0xae6b('0x4c')]=function(_0x5a6f1f,_0x126ae7,_0x5169b5){return db[_0xae6b('0x4d')][_0xae6b('0x4e')](function(_0x15393){if(_0x5a6f1f[_0xae6b('0x4b')][_0xae6b('0x4f')]===_0xae6b('0x50')){_0x5a6f1f[_0xae6b('0x4b')][_0xae6b('0x51')]=path['join'](config[_0xae6b('0x52')],'server/files/moh',_0x5a6f1f[_0xae6b('0x4b')][_0xae6b('0x2c')]);}return db[_0xae6b('0x2f')][_0xae6b('0x4c')](_0x5a6f1f[_0xae6b('0x4b')],{'transaction':_0x15393})[_0xae6b('0x29')](function(_0x1a355a){if(_0x5a6f1f[_0xae6b('0x4b')][_0xae6b('0x4f')]===_0xae6b('0x50')){fs[_0xae6b('0x53')](_0x1a355a[_0xae6b('0x51')],parseInt(_0xae6b('0x54'),0x8));}var _0x1b4b65=_0x5a6f1f['user'][_0xae6b('0x55')]({'plain':!![]});if(!_0x1b4b65)throw new Error(_0xae6b('0x56'));if(_0x1b4b65['role']===_0xae6b('0x57')){var _0x90b798=_0x1a355a['get']({'plain':!![]});return db[_0xae6b('0x58')]['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x1b4b65[_0xae6b('0x59')]},'raw':!![]})[_0xae6b('0x29')](function(_0x8736ae){if(_0x8736ae&&_0x8736ae['autoAssociation']===0x0){return db[_0xae6b('0x2a')][_0xae6b('0x4c')]({'name':_0x90b798[_0xae6b('0x2c')],'resourceId':_0x90b798['id'],'type':_0x8736ae[_0xae6b('0x2c')],'sectionId':_0x8736ae['id']},{})[_0xae6b('0x29')](function(){return _0x1a355a;});}else{return _0x1a355a;}})[_0xae6b('0x46')](function(_0x400957){logger[_0xae6b('0x2b')](_0xae6b('0x5a'),_0x400957);});}return _0x1a355a;});})[_0xae6b('0x29')](respondWithResult(_0x126ae7,0xc9))[_0xae6b('0x46')](handleError(_0x126ae7,null));};exports[_0xae6b('0x28')]=function(_0x396d20,_0x5c2982,_0x3d6003){var _0x5168fe;return db[_0xae6b('0x2f')][_0xae6b('0x4a')]({'where':{'id':_0x396d20[_0xae6b('0x48')]['id']}})[_0xae6b('0x29')](function(_0x3d23d3){if(_0x3d23d3){return db['sequelize']['transaction'](function(_0x566bcc){return _0x3d23d3['destroy']({'transaction':_0x566bcc,'raw':!![]})[_0xae6b('0x29')](function(_0x1f8a13){if(_0x1f8a13[_0xae6b('0x51')]){fs['readdirSync'](_0x1f8a13['directory'])['forEach'](function(_0x49a6ab){fs['unlinkSync'](path[_0xae6b('0x5b')](_0x1f8a13[_0xae6b('0x51')],_0x49a6ab));});fs['rmdirSync'](_0x1f8a13[_0xae6b('0x51')]);}return _0x1f8a13;});})[_0xae6b('0x46')](function(_0xbf4482){throw new db['Sequelize']['ValidationError'](_0xbf4482[_0xae6b('0x5c')]);});}})[_0xae6b('0x29')](handleEntityNotFound(_0x5c2982,null))[_0xae6b('0x29')](removeEntity(_0x5c2982,null))[_0xae6b('0x46')](handleError(_0x5c2982,null));};exports['addSound']=function(_0x5a7464,_0x4aee2c,_0x16ce64){return db[_0xae6b('0x4d')][_0xae6b('0x4e')](function(_0x2fc1e9){var _0x1a527b;return db[_0xae6b('0x2f')][_0xae6b('0x4a')]({'where':{'id':_0x5a7464['params']['id']}})[_0xae6b('0x29')](function(_0x1cce8d){if(_0x1cce8d){_0x1a527b=_0x1cce8d;return _0x1cce8d[_0xae6b('0x5d')](_0x5a7464[_0xae6b('0x4b')]['id'],{'transaction':_0x2fc1e9});}})[_0xae6b('0x29')](function(_0x1a80b1){if(_0x1a80b1){return db['Sound'][_0xae6b('0x5e')]({'where':{'id':_0x5a7464['body']['id']},'attributes':['id','name',_0xae6b('0x5f'),_0xae6b('0x60'),'createdAt'],'raw':!![]});}})['then'](function(_0x1518a5){if(_0x1518a5){var _0x21eb57=path[_0xae6b('0x5b')](config[_0xae6b('0x52')],_0xae6b('0x61'),util[_0xae6b('0x62')](_0xae6b('0x63'),path['basename'](_0x1518a5[_0xae6b('0x5f')],path[_0xae6b('0x64')](_0x1518a5[_0xae6b('0x5f')])),_0x1518a5[_0xae6b('0x60')]));var _0x4ff2c8=path[_0xae6b('0x5b')](config['root'],_0xae6b('0x65'),_0x1a527b[_0xae6b('0x2c')],util[_0xae6b('0x62')](_0xae6b('0x63'),_0x1518a5['name'],_0x1518a5[_0xae6b('0x60')]));fs[_0xae6b('0x66')](_0x21eb57,_0x4ff2c8);return _0x1518a5;}})['catch'](function(_0x5f14c0){throw new db[(_0xae6b('0x67'))]['ValidationError'](_0x5f14c0[_0xae6b('0x5c')]);});})[_0xae6b('0x29')](handleEntityNotFound(_0x4aee2c,null))[_0xae6b('0x29')](respondWithResult(_0x4aee2c,0xc9))[_0xae6b('0x46')](handleError(_0x4aee2c,null));};exports['removeSound']=function(_0x23808f,_0x3a3660,_0xe2342d){return db[_0xae6b('0x4d')][_0xae6b('0x4e')](function(_0x132950){var _0x1baca1;return db[_0xae6b('0x2f')][_0xae6b('0x5e')]({'where':{'id':_0x23808f[_0xae6b('0x48')]['id']}})[_0xae6b('0x29')](handleEntityNotFound(_0x3a3660,null))['then'](function(_0x4619ff){if(_0x4619ff){_0x1baca1=_0x4619ff;return _0x4619ff[_0xae6b('0x68')](_0x23808f[_0xae6b('0x48')][_0xae6b('0x69')]);}})['then'](function(_0x5b0b5d){if(_0x5b0b5d){return db['Sound']['findOne']({'where':{'id':_0x23808f['params']['id2']},'attributes':['id',_0xae6b('0x2c'),_0xae6b('0x5f'),_0xae6b('0x60'),_0xae6b('0x6a')],'raw':!![]});}})[_0xae6b('0x29')](function(_0x48415a){if(_0x48415a){fs['unlinkSync'](path[_0xae6b('0x5b')](_0x1baca1[_0xae6b('0x51')],util[_0xae6b('0x62')]('%s.%s',_0x48415a[_0xae6b('0x2c')],_0x48415a['converted_format'])));return _0x48415a;}})[_0xae6b('0x46')](function(_0x3e9af9){throw new db['Sequelize'][(_0xae6b('0x6b'))](_0x3e9af9[_0xae6b('0x5c')]);});})[_0xae6b('0x29')](handleEntityNotFound(_0x3a3660,null))[_0xae6b('0x29')](respondWithStatusCode(_0x3a3660,0xcc))['catch'](handleError(_0x3a3660,null));};exports[_0xae6b('0x6c')]=function(_0x523f11,_0x5d0fe3,_0x204c8e){var _0x48be5b={};var _0x3190fc={};var _0x8a6c6b;var _0x3df269;return db[_0xae6b('0x2f')]['findOne']({'where':{'id':_0x523f11['params']['id']}})[_0xae6b('0x29')](handleEntityNotFound(_0x5d0fe3,null))[_0xae6b('0x29')](function(_0x184322){if(_0x184322){_0x8a6c6b=_0x184322;_0x3190fc['model']=_[_0xae6b('0x49')](db['Sound'][_0xae6b('0x30')]);_0x3190fc['query']=_[_0xae6b('0x49')](_0x523f11['query']);_0x3190fc['filters']=_[_0xae6b('0x37')](_0x3190fc[_0xae6b('0x34')],_0x3190fc[_0xae6b('0x35')]);_0x48be5b[_0xae6b('0x39')]=_[_0xae6b('0x37')](_0x3190fc['model'],qs['fields'](_0x523f11['query'][_0xae6b('0x38')]));_0x48be5b[_0xae6b('0x39')]=_0x48be5b[_0xae6b('0x39')][_0xae6b('0x3a')]?_0x48be5b['attributes']:_0x3190fc[_0xae6b('0x34')];_0x48be5b[_0xae6b('0x3d')]=qs[_0xae6b('0x3e')](_0x523f11[_0xae6b('0x35')][_0xae6b('0x3e')]);_0x48be5b['where']=qs[_0xae6b('0x36')](_[_0xae6b('0x6d')](_0x523f11[_0xae6b('0x35')],_0x3190fc[_0xae6b('0x36')]));if(_0x523f11[_0xae6b('0x35')][_0xae6b('0x42')]){_0x48be5b[_0xae6b('0x3f')]=_[_0xae6b('0x40')](_0x48be5b[_0xae6b('0x3f')],{'$or':_[_0xae6b('0x2e')](_0x48be5b[_0xae6b('0x39')],function(_0x5be2e2){var _0xc82add={};_0xc82add[_0x5be2e2]={'$like':'%'+_0x523f11[_0xae6b('0x35')]['filter']+'%'};return _0xc82add;})});}_0x48be5b=_[_0xae6b('0x40')]({},_0x48be5b,_0x523f11[_0xae6b('0x43')]);return _0x8a6c6b[_0xae6b('0x6c')](_0x48be5b);}})[_0xae6b('0x29')](function(_0x1d87ab){if(_0x1d87ab){_0x3df269=_0x1d87ab[_0xae6b('0x3a')];if(!_0x523f11['query'][_0xae6b('0x3b')](_0xae6b('0x3c'))){_0x48be5b['limit']=qs['limit'](_0x523f11['query'][_0xae6b('0x21')]);_0x48be5b[_0xae6b('0x22')]=qs['offset'](_0x523f11[_0xae6b('0x35')]['offset']);}return _0x8a6c6b[_0xae6b('0x6c')](_0x48be5b);}})[_0xae6b('0x29')](function(_0x5e395e){if(_0x5e395e){return _0x5e395e?{'count':_0x3df269,'rows':_0x5e395e}:null;}})[_0xae6b('0x29')](respondWithResult(_0x5d0fe3,null))[_0xae6b('0x46')](handleError(_0x5d0fe3,null));}; \ No newline at end of file +var _0x8c40=['server/files/moh','%s.%s','symlinkSync','Sequelize','removeSound','findOne','id2','converted_format','createdAt','ValidationError','rawAttributes','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','map','type','key','query','keys','model','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','VoiceMusicOnHold','includeAll','findAll','catch','params','attributes','length','find','body','create','transaction','mode','files','directory','join','root','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','sequelize','readdirSync','forEach','unlinkSync','rmdirSync','message','addSound','Sound','save_name','server/files/sounds/converted','format','basename','extname'];(function(_0x5aa0e3,_0x5088f7){var _0xef1132=function(_0x57a942){while(--_0x57a942){_0x5aa0e3['push'](_0x5aa0e3['shift']());}};_0xef1132(++_0x5088f7);}(_0x8c40,0x15c));var _0x08c4=function(_0xa05bd8,_0x2d5c8b){_0xa05bd8=_0xa05bd8-0x0;var _0x415cb7=_0x8c40[_0xa05bd8];return _0x415cb7;};'use strict';var emlformat=require(_0x08c4('0x0'));var rimraf=require(_0x08c4('0x1'));var zipdir=require(_0x08c4('0x2'));var jsonpatch=require(_0x08c4('0x3'));var rp=require('request-promise');var moment=require(_0x08c4('0x4'));var BPromise=require(_0x08c4('0x5'));var Mustache=require('mustache');var util=require(_0x08c4('0x6'));var path=require(_0x08c4('0x7'));var sox=require(_0x08c4('0x8'));var csv=require(_0x08c4('0x9'));var ejs=require(_0x08c4('0xa'));var fs=require('fs');var fs_extra=require(_0x08c4('0xb'));var _=require('lodash');var squel=require(_0x08c4('0xc'));var crypto=require(_0x08c4('0xd'));var jsforce=require(_0x08c4('0xe'));var deskjs=require(_0x08c4('0xf'));var toCsv=require(_0x08c4('0x9'));var querystring=require(_0x08c4('0x10'));var Papa=require(_0x08c4('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x08c4('0x12'));var as=require(_0x08c4('0x13'));var hardwareService=require(_0x08c4('0x14'));var logger=require(_0x08c4('0x15'))(_0x08c4('0x16'));var utils=require(_0x08c4('0x17'));var config=require(_0x08c4('0x18'));var licenseUtil=require(_0x08c4('0x19'));var db=require(_0x08c4('0x1a'))['db'];function respondWithStatusCode(_0xe2599d,_0x347590){_0x347590=_0x347590||0xcc;return function(_0x4dc779){if(_0x4dc779){return _0xe2599d[_0x08c4('0x1b')](_0x347590);}return _0xe2599d[_0x08c4('0x1c')](_0x347590)[_0x08c4('0x1d')]();};}function respondWithResult(_0x51bffa,_0x4edec0){_0x4edec0=_0x4edec0||0xc8;return function(_0x5670d0){if(_0x5670d0){return _0x51bffa[_0x08c4('0x1c')](_0x4edec0)[_0x08c4('0x1e')](_0x5670d0);}};}function respondWithFilteredResult(_0x1b368e,_0x54a51d){return function(_0x5a6aa3){if(_0x5a6aa3){var _0xc937c8=typeof _0x54a51d[_0x08c4('0x1f')]==='undefined'&&typeof _0x54a51d[_0x08c4('0x20')]===_0x08c4('0x21');var _0x4be50b=_0x5a6aa3[_0x08c4('0x22')];var _0x194370=_0xc937c8?0x0:_0x54a51d[_0x08c4('0x1f')];var _0x2cb077=_0xc937c8?_0x5a6aa3[_0x08c4('0x22')]:_0x54a51d[_0x08c4('0x1f')]+_0x54a51d[_0x08c4('0x20')];var _0xeeb2df;if(_0x2cb077>=_0x4be50b){_0x2cb077=_0x4be50b;_0xeeb2df=0xc8;}else{_0xeeb2df=0xce;}_0x1b368e[_0x08c4('0x1c')](_0xeeb2df);return _0x1b368e[_0x08c4('0x23')](_0x08c4('0x24'),_0x194370+'-'+_0x2cb077+'/'+_0x4be50b)[_0x08c4('0x1e')](_0x5a6aa3);}return null;};}function patchUpdates(_0x26261d){return function(_0x12347f){try{jsonpatch[_0x08c4('0x25')](_0x12347f,_0x26261d,!![]);}catch(_0x27187a){return BPromise[_0x08c4('0x26')](_0x27187a);}return _0x12347f['save']();};}function saveUpdates(_0x34172b,_0x27e329){return function(_0x41c146){if(_0x41c146){return _0x41c146[_0x08c4('0x27')](_0x34172b)[_0x08c4('0x28')](function(_0x197a2e){return _0x197a2e;});}return null;};}function removeEntity(_0x3c807c,_0x70a747){return function(_0x48af1a){if(_0x48af1a){return _0x48af1a[_0x08c4('0x29')]()[_0x08c4('0x28')](function(){var _0x5da193=_0x48af1a[_0x08c4('0x2a')]({'plain':!![]});var _0x58e7c4='MusicOnHolds';return db[_0x08c4('0x2b')][_0x08c4('0x29')]({'where':{'type':_0x58e7c4,'resourceId':_0x5da193['id']}})['then'](function(){return _0x48af1a;});})['then'](function(){_0x3c807c['status'](0xcc)[_0x08c4('0x1d')]();});}};}function handleEntityNotFound(_0x49a02f,_0x25ea16){return function(_0x63d384){if(!_0x63d384){_0x49a02f[_0x08c4('0x1b')](0x194);}return _0x63d384;};}function handleError(_0x2a356e,_0x22b0b1){_0x22b0b1=_0x22b0b1||0x1f4;return function(_0x26878f){logger[_0x08c4('0x2c')](_0x26878f[_0x08c4('0x2d')]);if(_0x26878f['name']){delete _0x26878f[_0x08c4('0x2e')];}_0x2a356e[_0x08c4('0x1c')](_0x22b0b1)['send'](_0x26878f);};}exports['index']=function(_0x491bc2,_0x570d56){var _0x5c7e38={},_0x332dbc={},_0x167f24={'count':0x0,'rows':[]};var _0x32dc8a=_[_0x08c4('0x2f')](db['VoiceMusicOnHold']['rawAttributes'],function(_0x5e1394){return{'name':_0x5e1394['fieldName'],'type':_0x5e1394[_0x08c4('0x30')][_0x08c4('0x31')]};});_0x332dbc['model']=_[_0x08c4('0x2f')](_0x32dc8a,'name');_0x332dbc[_0x08c4('0x32')]=_[_0x08c4('0x33')](_0x491bc2['query']);_0x332dbc['filters']=_['intersection'](_0x332dbc[_0x08c4('0x34')],_0x332dbc[_0x08c4('0x32')]);_0x5c7e38['attributes']=_[_0x08c4('0x35')](_0x332dbc['model'],qs['fields'](_0x491bc2[_0x08c4('0x32')][_0x08c4('0x36')]));_0x5c7e38['attributes']=_0x5c7e38['attributes']['length']?_0x5c7e38['attributes']:_0x332dbc[_0x08c4('0x34')];if(!_0x491bc2[_0x08c4('0x32')][_0x08c4('0x37')](_0x08c4('0x38'))){_0x5c7e38[_0x08c4('0x20')]=qs[_0x08c4('0x20')](_0x491bc2[_0x08c4('0x32')][_0x08c4('0x20')]);_0x5c7e38[_0x08c4('0x1f')]=qs[_0x08c4('0x1f')](_0x491bc2['query']['offset']);}_0x5c7e38[_0x08c4('0x39')]=qs[_0x08c4('0x3a')](_0x491bc2[_0x08c4('0x32')]['sort']);delete _0x491bc2[_0x08c4('0x32')][_0x08c4('0x3a')];_0x5c7e38[_0x08c4('0x3b')]=qs[_0x08c4('0x3c')](_[_0x08c4('0x3d')](_0x491bc2['query'],_0x332dbc[_0x08c4('0x3c')]),_0x32dc8a);if(_0x491bc2[_0x08c4('0x32')][_0x08c4('0x3e')]){_0x5c7e38[_0x08c4('0x3b')]=_[_0x08c4('0x3f')](_0x5c7e38[_0x08c4('0x3b')],{'$or':_[_0x08c4('0x2f')](_0x32dc8a,function(_0x2cca4b){if(_0x2cca4b[_0x08c4('0x30')]!=='VIRTUAL'){var _0x351d25={};_0x351d25[_0x2cca4b['name']]={'$like':'%'+_0x491bc2['query'][_0x08c4('0x3e')]+'%'};return _0x351d25;}})});}_0x5c7e38=_[_0x08c4('0x3f')]({},_0x5c7e38,_0x491bc2[_0x08c4('0x40')]);var _0x149d85={'where':_0x5c7e38[_0x08c4('0x3b')]};return db[_0x08c4('0x41')]['count'](_0x149d85)['then'](function(_0x15900f){_0x167f24['count']=_0x15900f;if(_0x491bc2['query'][_0x08c4('0x42')]){_0x5c7e38['include']=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x08c4('0x43')](_0x5c7e38);})['then'](function(_0xe47377){_0x167f24['rows']=_0xe47377;return _0x167f24;})[_0x08c4('0x28')](respondWithFilteredResult(_0x570d56,_0x5c7e38))[_0x08c4('0x44')](handleError(_0x570d56,null));};exports['show']=function(_0x17535e,_0x23b786){var _0x2d3b54={'raw':![],'where':{'id':_0x17535e[_0x08c4('0x45')]['id']}},_0x55b015={};_0x55b015[_0x08c4('0x34')]=_[_0x08c4('0x33')](db[_0x08c4('0x41')]['rawAttributes']);_0x55b015[_0x08c4('0x32')]=_['keys'](_0x17535e[_0x08c4('0x32')]);_0x55b015[_0x08c4('0x3c')]=_[_0x08c4('0x35')](_0x55b015[_0x08c4('0x34')],_0x55b015['query']);_0x2d3b54[_0x08c4('0x46')]=_[_0x08c4('0x35')](_0x55b015[_0x08c4('0x34')],qs[_0x08c4('0x36')](_0x17535e[_0x08c4('0x32')][_0x08c4('0x36')]));_0x2d3b54[_0x08c4('0x46')]=_0x2d3b54['attributes'][_0x08c4('0x47')]?_0x2d3b54['attributes']:_0x55b015[_0x08c4('0x34')];if(_0x17535e['query'][_0x08c4('0x42')]){_0x2d3b54['include']=[{'all':!![]}];}_0x2d3b54=_['merge']({},_0x2d3b54,_0x17535e[_0x08c4('0x40')]);return db[_0x08c4('0x41')][_0x08c4('0x48')](_0x2d3b54)[_0x08c4('0x28')](handleEntityNotFound(_0x23b786,null))['then'](respondWithResult(_0x23b786,null))[_0x08c4('0x44')](handleError(_0x23b786,null));};exports[_0x08c4('0x27')]=function(_0x5adc95,_0x4db1aa){if(_0x5adc95['body']['id']){delete _0x5adc95[_0x08c4('0x49')]['id'];}return db[_0x08c4('0x41')][_0x08c4('0x48')]({'where':{'id':_0x5adc95[_0x08c4('0x45')]['id']}})['then'](handleEntityNotFound(_0x4db1aa,null))[_0x08c4('0x28')](saveUpdates(_0x5adc95[_0x08c4('0x49')],null))['then'](respondWithResult(_0x4db1aa,null))[_0x08c4('0x44')](handleError(_0x4db1aa,null));};exports[_0x08c4('0x4a')]=function(_0x72d802,_0x46ea02,_0x3c43f7){return db['sequelize'][_0x08c4('0x4b')](function(_0x105712){if(_0x72d802['body'][_0x08c4('0x4c')]===_0x08c4('0x4d')){_0x72d802[_0x08c4('0x49')][_0x08c4('0x4e')]=path[_0x08c4('0x4f')](config[_0x08c4('0x50')],'server/files/moh',_0x72d802[_0x08c4('0x49')]['name']);}return db[_0x08c4('0x41')][_0x08c4('0x4a')](_0x72d802[_0x08c4('0x49')],{'transaction':_0x105712})['then'](function(_0x419f95){if(_0x72d802[_0x08c4('0x49')][_0x08c4('0x4c')]===_0x08c4('0x4d')){fs['mkdirSync'](_0x419f95['directory'],parseInt('0777',0x8));}var _0x5c7eb2=_0x72d802['user'][_0x08c4('0x2a')]({'plain':!![]});if(!_0x5c7eb2)throw new Error(_0x08c4('0x51'));if(_0x5c7eb2[_0x08c4('0x52')]==='user'){var _0x59a5cc=_0x419f95[_0x08c4('0x2a')]({'plain':!![]});return db[_0x08c4('0x53')][_0x08c4('0x48')]({'where':{'name':_0x08c4('0x54'),'userProfileId':_0x5c7eb2[_0x08c4('0x55')]},'raw':!![]})[_0x08c4('0x28')](function(_0x5918bd){if(_0x5918bd&&_0x5918bd[_0x08c4('0x56')]===0x0){return db[_0x08c4('0x2b')][_0x08c4('0x4a')]({'name':_0x59a5cc[_0x08c4('0x2e')],'resourceId':_0x59a5cc['id'],'type':_0x5918bd[_0x08c4('0x2e')],'sectionId':_0x5918bd['id']},{})['then'](function(){return _0x419f95;});}else{return _0x419f95;}})['catch'](function(_0x5054f2){logger[_0x08c4('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5054f2);});}return _0x419f95;});})[_0x08c4('0x28')](respondWithResult(_0x46ea02,0xc9))[_0x08c4('0x44')](handleError(_0x46ea02,null));};exports[_0x08c4('0x29')]=function(_0x39eeff,_0x482913,_0x5d94cd){var _0xe036ac;return db[_0x08c4('0x41')][_0x08c4('0x48')]({'where':{'id':_0x39eeff['params']['id']}})[_0x08c4('0x28')](function(_0x9108a0){if(_0x9108a0){return db[_0x08c4('0x57')][_0x08c4('0x4b')](function(_0x402e49){return _0x9108a0[_0x08c4('0x29')]({'transaction':_0x402e49,'raw':!![]})[_0x08c4('0x28')](function(_0x1beb2d){if(_0x1beb2d[_0x08c4('0x4e')]){fs[_0x08c4('0x58')](_0x1beb2d[_0x08c4('0x4e')])[_0x08c4('0x59')](function(_0x2925d4){fs[_0x08c4('0x5a')](path[_0x08c4('0x4f')](_0x1beb2d['directory'],_0x2925d4));});fs[_0x08c4('0x5b')](_0x1beb2d[_0x08c4('0x4e')]);}return _0x1beb2d;});})['catch'](function(_0x1eff48){throw new db['Sequelize']['ValidationError'](_0x1eff48[_0x08c4('0x5c')]);});}})[_0x08c4('0x28')](handleEntityNotFound(_0x482913,null))[_0x08c4('0x28')](removeEntity(_0x482913,null))[_0x08c4('0x44')](handleError(_0x482913,null));};exports[_0x08c4('0x5d')]=function(_0x498bed,_0x4b4ca,_0x471585){return db['sequelize']['transaction'](function(_0x4bb13c){var _0x4830cb;return db['VoiceMusicOnHold'][_0x08c4('0x48')]({'where':{'id':_0x498bed[_0x08c4('0x45')]['id']}})[_0x08c4('0x28')](function(_0x15cf00){if(_0x15cf00){_0x4830cb=_0x15cf00;return _0x15cf00[_0x08c4('0x5d')](_0x498bed['body']['id'],{'transaction':_0x4bb13c});}})[_0x08c4('0x28')](function(_0xdbed57){if(_0xdbed57){return db[_0x08c4('0x5e')]['findOne']({'where':{'id':_0x498bed['body']['id']},'attributes':['id',_0x08c4('0x2e'),_0x08c4('0x5f'),'converted_format','createdAt'],'raw':!![]});}})[_0x08c4('0x28')](function(_0x474e9){if(_0x474e9){var _0x46483e=path['join'](config[_0x08c4('0x50')],_0x08c4('0x60'),util[_0x08c4('0x61')]('%s.%s',path[_0x08c4('0x62')](_0x474e9[_0x08c4('0x5f')],path[_0x08c4('0x63')](_0x474e9[_0x08c4('0x5f')])),_0x474e9['converted_format']));var _0x41d422=path[_0x08c4('0x4f')](config[_0x08c4('0x50')],_0x08c4('0x64'),_0x4830cb['name'],util['format'](_0x08c4('0x65'),_0x474e9[_0x08c4('0x2e')],_0x474e9['converted_format']));fs[_0x08c4('0x66')](_0x46483e,_0x41d422);return _0x474e9;}})['catch'](function(_0x19baa0){throw new db[(_0x08c4('0x67'))]['ValidationError'](_0x19baa0[_0x08c4('0x5c')]);});})[_0x08c4('0x28')](handleEntityNotFound(_0x4b4ca,null))[_0x08c4('0x28')](respondWithResult(_0x4b4ca,0xc9))[_0x08c4('0x44')](handleError(_0x4b4ca,null));};exports[_0x08c4('0x68')]=function(_0x3cc610,_0x4510f5,_0x2020db){return db['sequelize'][_0x08c4('0x4b')](function(_0x244d41){var _0x18ef2f;return db[_0x08c4('0x41')][_0x08c4('0x69')]({'where':{'id':_0x3cc610[_0x08c4('0x45')]['id']}})[_0x08c4('0x28')](handleEntityNotFound(_0x4510f5,null))['then'](function(_0x2b9325){if(_0x2b9325){_0x18ef2f=_0x2b9325;return _0x2b9325[_0x08c4('0x68')](_0x3cc610[_0x08c4('0x45')][_0x08c4('0x6a')]);}})[_0x08c4('0x28')](function(_0x165b38){if(_0x165b38){return db[_0x08c4('0x5e')][_0x08c4('0x69')]({'where':{'id':_0x3cc610[_0x08c4('0x45')][_0x08c4('0x6a')]},'attributes':['id',_0x08c4('0x2e'),_0x08c4('0x5f'),_0x08c4('0x6b'),_0x08c4('0x6c')],'raw':!![]});}})[_0x08c4('0x28')](function(_0x587799){if(_0x587799){fs[_0x08c4('0x5a')](path[_0x08c4('0x4f')](_0x18ef2f[_0x08c4('0x4e')],util[_0x08c4('0x61')](_0x08c4('0x65'),_0x587799[_0x08c4('0x2e')],_0x587799['converted_format'])));return _0x587799;}})[_0x08c4('0x44')](function(_0x4d3ad3){throw new db['Sequelize'][(_0x08c4('0x6d'))](_0x4d3ad3[_0x08c4('0x5c')]);});})[_0x08c4('0x28')](handleEntityNotFound(_0x4510f5,null))[_0x08c4('0x28')](respondWithStatusCode(_0x4510f5,0xcc))[_0x08c4('0x44')](handleError(_0x4510f5,null));};exports['getSounds']=function(_0x582988,_0x15e09f,_0x21a2e5){var _0x5e3df3={};var _0x4fbf1b={};var _0x46bdad;var _0x2b638e;return db[_0x08c4('0x41')][_0x08c4('0x69')]({'where':{'id':_0x582988[_0x08c4('0x45')]['id']}})[_0x08c4('0x28')](handleEntityNotFound(_0x15e09f,null))[_0x08c4('0x28')](function(_0x5d07be){if(_0x5d07be){_0x46bdad=_0x5d07be;_0x4fbf1b['model']=_[_0x08c4('0x33')](db[_0x08c4('0x5e')][_0x08c4('0x6e')]);_0x4fbf1b[_0x08c4('0x32')]=_['keys'](_0x582988[_0x08c4('0x32')]);_0x4fbf1b['filters']=_[_0x08c4('0x35')](_0x4fbf1b[_0x08c4('0x34')],_0x4fbf1b[_0x08c4('0x32')]);_0x5e3df3[_0x08c4('0x46')]=_['intersection'](_0x4fbf1b['model'],qs[_0x08c4('0x36')](_0x582988['query'][_0x08c4('0x36')]));_0x5e3df3[_0x08c4('0x46')]=_0x5e3df3['attributes'][_0x08c4('0x47')]?_0x5e3df3[_0x08c4('0x46')]:_0x4fbf1b[_0x08c4('0x34')];_0x5e3df3[_0x08c4('0x39')]=qs['sort'](_0x582988[_0x08c4('0x32')][_0x08c4('0x3a')]);_0x5e3df3[_0x08c4('0x3b')]=qs[_0x08c4('0x3c')](_[_0x08c4('0x3d')](_0x582988[_0x08c4('0x32')],_0x4fbf1b[_0x08c4('0x3c')]));if(_0x582988[_0x08c4('0x32')][_0x08c4('0x3e')]){_0x5e3df3[_0x08c4('0x3b')]=_['merge'](_0x5e3df3[_0x08c4('0x3b')],{'$or':_['map'](_0x5e3df3[_0x08c4('0x46')],function(_0x496337){var _0x33c3ed={};_0x33c3ed[_0x496337]={'$like':'%'+_0x582988[_0x08c4('0x32')][_0x08c4('0x3e')]+'%'};return _0x33c3ed;})});}_0x5e3df3=_[_0x08c4('0x3f')]({},_0x5e3df3,_0x582988[_0x08c4('0x40')]);return _0x46bdad[_0x08c4('0x6f')](_0x5e3df3);}})[_0x08c4('0x28')](function(_0x20177e){if(_0x20177e){_0x2b638e=_0x20177e[_0x08c4('0x47')];if(!_0x582988[_0x08c4('0x32')][_0x08c4('0x37')](_0x08c4('0x38'))){_0x5e3df3[_0x08c4('0x20')]=qs[_0x08c4('0x20')](_0x582988[_0x08c4('0x32')][_0x08c4('0x20')]);_0x5e3df3[_0x08c4('0x1f')]=qs[_0x08c4('0x1f')](_0x582988[_0x08c4('0x32')][_0x08c4('0x1f')]);}return _0x46bdad[_0x08c4('0x6f')](_0x5e3df3);}})[_0x08c4('0x28')](function(_0xcabdc3){if(_0xcabdc3){return _0xcabdc3?{'count':_0x2b638e,'rows':_0xcabdc3}:null;}})[_0x08c4('0x28')](respondWithResult(_0x15e09f,null))[_0x08c4('0x44')](handleError(_0x15e09f,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index fc78c49..6a23374 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 _0x6907=['request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','api'];(function(_0x4a3e2e,_0x46ad17){var _0x4a56c7=function(_0x5531ce){while(--_0x5531ce){_0x4a3e2e['push'](_0x4a3e2e['shift']());}};_0x4a56c7(++_0x46ad17);}(_0x6907,0x171));var _0x7690=function(_0x49d4f0,_0x3f590c){_0x49d4f0=_0x49d4f0-0x0;var _0x4ec315=_0x6907[_0x49d4f0];return _0x4ec315;};'use strict';var _=require(_0x7690('0x0'));var util=require(_0x7690('0x1'));var logger=require('../../config/logger')(_0x7690('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7690('0x3'));var fs=require('fs');var path=require(_0x7690('0x4'));var rimraf=require(_0x7690('0x5'));var config=require(_0x7690('0x6'));var attributes=require(_0x7690('0x7'));module[_0x7690('0x8')]=function(_0x8fb8c2,_0x182d8){return _0x8fb8c2[_0x7690('0x9')](_0x7690('0xa'),attributes,{'tableName':_0x7690('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x933b=['request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird'];(function(_0x470aa2,_0x16fb16){var _0x51570d=function(_0x2dae71){while(--_0x2dae71){_0x470aa2['push'](_0x470aa2['shift']());}};_0x51570d(++_0x16fb16);}(_0x933b,0xf7));var _0xb933=function(_0x5896bf,_0x176a5a){_0x5896bf=_0x5896bf-0x0;var _0x5c7547=_0x933b[_0x5896bf];return _0x5c7547;};'use strict';var _=require(_0xb933('0x0'));var util=require('util');var logger=require(_0xb933('0x1'))(_0xb933('0x2'));var moment=require(_0xb933('0x3'));var BPromise=require(_0xb933('0x4'));var rp=require(_0xb933('0x5'));var fs=require('fs');var path=require(_0xb933('0x6'));var rimraf=require(_0xb933('0x7'));var config=require(_0xb933('0x8'));var attributes=require(_0xb933('0x9'));module[_0xb933('0xa')]=function(_0x3d89f9,_0xe7fa9b){return _0x3d89f9[_0xb933('0xb')]('VoiceMusicOnHold',attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index cb1ceb5..e647a65 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 _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x497b9b,_0x1a4a31){var _0x2f766c=function(_0x15ddf0){while(--_0x15ddf0){_0x497b9b['push'](_0x497b9b['shift']());}};_0x2f766c(++_0x1a4a31);}(_0xedd9,0xfc));var _0x9edd=function(_0x34d8f2,_0x57f54d){_0x34d8f2=_0x34d8f2-0x0;var _0x361f7c=_0xedd9[_0x34d8f2];return _0x361f7c;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file +var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x25d4d2,_0x50c193){var _0x55054d=function(_0x2ae684){while(--_0x2ae684){_0x25d4d2['push'](_0x25d4d2['shift']());}};_0x55054d(++_0x50c193);}(_0xedd9,0xfc));var _0x9edd=function(_0x6a8741,_0x57ac09){_0x6a8741=_0x6a8741-0x0;var _0xc70b78=_0xedd9[_0x6a8741];return _0xc70b78;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index beda3c7..01fe322 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 _0x02ef=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/users','/:id/teams','create','post','addAgents','put','update','delete','removeAgents','removeTeams','exports','multer','path','express','Router'];(function(_0x1b82bb,_0xd2669c){var _0x25d568=function(_0x124098){while(--_0x124098){_0x1b82bb['push'](_0x1b82bb['shift']());}};_0x25d568(++_0xd2669c);}(_0x02ef,0x11a));var _0xf02e=function(_0x2a83af,_0x4fa9ed){_0x2a83af=_0x2a83af-0x0;var _0x2e1648=_0x02ef[_0x2a83af];return _0x2e1648;};'use strict';var multer=require(_0xf02e('0x0'));var util=require('util');var path=require(_0xf02e('0x1'));var timeout=require('connect-timeout');var express=require(_0xf02e('0x2'));var router=express[_0xf02e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf02e('0x4'));var interaction=require(_0xf02e('0x5'));var config=require(_0xf02e('0x6'));var controller=require(_0xf02e('0x7'));router[_0xf02e('0x8')]('/',auth['isAuthenticated'](),controller[_0xf02e('0x9')]);router[_0xf02e('0x8')](_0xf02e('0xa'),auth[_0xf02e('0xb')](),controller[_0xf02e('0xc')]);router[_0xf02e('0x8')](_0xf02e('0xd'),auth[_0xf02e('0xb')](),controller[_0xf02e('0xe')]);router[_0xf02e('0x8')](_0xf02e('0xf'),auth[_0xf02e('0xb')](),controller['getAgents']);router['get'](_0xf02e('0x10'),auth[_0xf02e('0xb')](),controller['getTeams']);router['post']('/',auth['isAuthenticated'](),controller[_0xf02e('0x11')]);router[_0xf02e('0x12')](_0xf02e('0xf'),auth[_0xf02e('0xb')](),controller[_0xf02e('0x13')]);router[_0xf02e('0x12')]('/:id/teams',auth[_0xf02e('0xb')](),controller['addTeams']);router[_0xf02e('0x14')](_0xf02e('0xd'),auth['isAuthenticated'](),controller[_0xf02e('0x15')]);router[_0xf02e('0x16')]('/:id',auth[_0xf02e('0xb')](),controller['destroy']);router[_0xf02e('0x16')](_0xf02e('0xf'),auth[_0xf02e('0xb')](),controller[_0xf02e('0x17')]);router[_0xf02e('0x16')]('/:id/teams',auth[_0xf02e('0xb')](),controller[_0xf02e('0x18')]);module[_0xf02e('0x19')]=router; \ No newline at end of file +var _0xf128=['/:id/users','/:id/teams','getTeams','create','addAgents','post','addTeams','update','delete','destroy','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','/describe','/:id','show'];(function(_0x1d18b4,_0x455d59){var _0x5e142d=function(_0x442060){while(--_0x442060){_0x1d18b4['push'](_0x1d18b4['shift']());}};_0x5e142d(++_0x455d59);}(_0xf128,0x109));var _0x8f12=function(_0x3e57ef,_0x388fab){_0x3e57ef=_0x3e57ef-0x0;var _0x5ade66=_0xf128[_0x3e57ef];return _0x5ade66;};'use strict';var multer=require(_0x8f12('0x0'));var util=require(_0x8f12('0x1'));var path=require(_0x8f12('0x2'));var timeout=require(_0x8f12('0x3'));var express=require(_0x8f12('0x4'));var router=express[_0x8f12('0x5')]();var fs_extra=require(_0x8f12('0x6'));var auth=require(_0x8f12('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8f12('0x8'));var controller=require(_0x8f12('0x9'));router[_0x8f12('0xa')]('/',auth[_0x8f12('0xb')](),controller['index']);router[_0x8f12('0xa')](_0x8f12('0xc'),auth[_0x8f12('0xb')](),controller['describe']);router[_0x8f12('0xa')](_0x8f12('0xd'),auth[_0x8f12('0xb')](),controller[_0x8f12('0xe')]);router['get'](_0x8f12('0xf'),auth['isAuthenticated'](),controller['getAgents']);router[_0x8f12('0xa')](_0x8f12('0x10'),auth['isAuthenticated'](),controller[_0x8f12('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8f12('0x12')]);router['post'](_0x8f12('0xf'),auth[_0x8f12('0xb')](),controller[_0x8f12('0x13')]);router[_0x8f12('0x14')](_0x8f12('0x10'),auth[_0x8f12('0xb')](),controller[_0x8f12('0x15')]);router['put'](_0x8f12('0xd'),auth[_0x8f12('0xb')](),controller[_0x8f12('0x16')]);router[_0x8f12('0x17')](_0x8f12('0xd'),auth[_0x8f12('0xb')](),controller[_0x8f12('0x18')]);router['delete']('/:id/users',auth[_0x8f12('0xb')](),controller[_0x8f12('0x19')]);router[_0x8f12('0x17')]('/:id/teams',auth['isAuthenticated'](),controller[_0x8f12('0x1a')]);module[_0x8f12('0x1b')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 21728c2..cf3765f 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 _0x06b7=['STRING','VIRTUAL','system-'];(function(_0x49e0ca,_0x511b18){var _0x3c7e51=function(_0x3c2e8e){while(--_0x3c2e8e){_0x49e0ca['push'](_0x49e0ca['shift']());}};_0x3c7e51(++_0x511b18);}(_0x06b7,0x7b));var _0x706b=function(_0x49cb92,_0x3c31a6){_0x49cb92=_0x49cb92-0x0;var _0x16ee5a=_0x06b7[_0x49cb92];return _0x16ee5a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x706b('0x0')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x706b('0x1')],'get':function(_0x280c46){return _0x706b('0x2')+this['getDataValue']('name')+'-';}},'description':{'type':Sequelize[_0x706b('0x0')]},'callerIdAll':{'type':Sequelize[_0x706b('0x0')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x1ef2=['exports','name','VIRTUAL','system-','getDataValue','STRING','INTEGER'];(function(_0xb1e99e,_0x5a20ef){var _0x11ba35=function(_0x23ea94){while(--_0x23ea94){_0xb1e99e['push'](_0xb1e99e['shift']());}};_0x11ba35(++_0x5a20ef);}(_0x1ef2,0xa1));var _0x21ef=function(_0x152051,_0x51b9e5){_0x152051=_0x152051-0x0;var _0x1ce591=_0x1ef2[_0x152051];return _0x1ce591;};'use strict';var Sequelize=require('sequelize');module[_0x21ef('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x21ef('0x1')},'prefix':{'type':Sequelize[_0x21ef('0x2')],'get':function(_0x26989a){return _0x21ef('0x3')+this[_0x21ef('0x4')](_0x21ef('0x1'))+'-';}},'description':{'type':Sequelize[_0x21ef('0x5')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x21ef('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 01da666..e46a168 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 _0x8603=['send','map','VoicePrefix','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','find','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','NoOp','goto','charAt','update','system-','findById','addAgents','omit','ids','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','getAgents','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','each','upsert','findOrCreate','removeTeams','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','clone','toString','QueryTypes','every','includes','all','union','compact','forEach','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','get','VoicePrefixes','UserProfileResource','destroy','stack','name'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8603,0x190));var _0x3860=function(_0x8ad473,_0x4e40db){_0x8ad473=_0x8ad473-0x0;var _0x5ca4b9=_0x8603[_0x8ad473];return _0x5ca4b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3860('0x0'));var zipdir=require(_0x3860('0x1'));var jsonpatch=require(_0x3860('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3860('0x3'));var Mustache=require(_0x3860('0x4'));var util=require(_0x3860('0x5'));var path=require('path');var sox=require(_0x3860('0x6'));var csv=require('to-csv');var ejs=require(_0x3860('0x7'));var fs=require('fs');var fs_extra=require(_0x3860('0x8'));var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3860('0x10'));var logger=require(_0x3860('0x11'))('api');var utils=require(_0x3860('0x12'));var config=require(_0x3860('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3860('0x14'))['db'];config[_0x3860('0x15')]=_[_0x3860('0x16')](config[_0x3860('0x15')],{'host':_0x3860('0x17'),'port':0x18eb});var socket=require(_0x3860('0x18'))(new Redis(config[_0x3860('0x15')]));require(_0x3860('0x19'))[_0x3860('0x1a')](socket);function respondWithStatusCode(_0x46264d,_0x54dbc3){_0x54dbc3=_0x54dbc3||0xcc;return function(_0x3d861d){if(_0x3d861d){return _0x46264d[_0x3860('0x1b')](_0x54dbc3);}return _0x46264d[_0x3860('0x1c')](_0x54dbc3)[_0x3860('0x1d')]();};}function respondWithResult(_0x1055b3,_0xfa0c9a){_0xfa0c9a=_0xfa0c9a||0xc8;return function(_0x2d8a3a){if(_0x2d8a3a){return _0x1055b3[_0x3860('0x1c')](_0xfa0c9a)[_0x3860('0x1e')](_0x2d8a3a);}};}function respondWithFilteredResult(_0x3c0d91,_0x3e51b4){return function(_0x45b799){if(_0x45b799){var _0x4b6b15=typeof _0x3e51b4['offset']===_0x3860('0x1f')&&typeof _0x3e51b4[_0x3860('0x20')]===_0x3860('0x1f');var _0x53fc63=_0x45b799[_0x3860('0x21')];var _0x145b26=_0x4b6b15?0x0:_0x3e51b4[_0x3860('0x22')];var _0x3af33a=_0x4b6b15?_0x45b799[_0x3860('0x21')]:_0x3e51b4[_0x3860('0x22')]+_0x3e51b4[_0x3860('0x20')];var _0x1f8891;if(_0x3af33a>=_0x53fc63){_0x3af33a=_0x53fc63;_0x1f8891=0xc8;}else{_0x1f8891=0xce;}_0x3c0d91[_0x3860('0x1c')](_0x1f8891);return _0x3c0d91[_0x3860('0x23')](_0x3860('0x24'),_0x145b26+'-'+_0x3af33a+'/'+_0x53fc63)[_0x3860('0x1e')](_0x45b799);}return null;};}function patchUpdates(_0x280ea9){return function(_0x9eaaa1){try{jsonpatch[_0x3860('0x25')](_0x9eaaa1,_0x280ea9,!![]);}catch(_0x564efd){return BPromise[_0x3860('0x26')](_0x564efd);}return _0x9eaaa1[_0x3860('0x27')]();};}function saveUpdates(_0x2b91f2,_0x301e03){return function(_0x20bb1e){if(_0x20bb1e){return _0x20bb1e['update'](_0x2b91f2)[_0x3860('0x28')](function(_0x568515){return _0x568515;});}return null;};}function removeEntity(_0x577750,_0xfa9705){return function(_0x1c4bbc){if(_0x1c4bbc){return _0x1c4bbc['destroy']()['then'](function(){var _0x5f42d5=_0x1c4bbc[_0x3860('0x29')]({'plain':!![]});var _0x3ebc5b=_0x3860('0x2a');return db[_0x3860('0x2b')][_0x3860('0x2c')]({'where':{'type':_0x3ebc5b,'resourceId':_0x5f42d5['id']}})[_0x3860('0x28')](function(){return _0x1c4bbc;});})['then'](function(){_0x577750['status'](0xcc)[_0x3860('0x1d')]();});}};}function handleEntityNotFound(_0x1f1809,_0x5a9af2){return function(_0x2551f4){if(!_0x2551f4){_0x1f1809[_0x3860('0x1b')](0x194);}return _0x2551f4;};}function handleError(_0x10d9e4,_0x426e6c){_0x426e6c=_0x426e6c||0x1f4;return function(_0x3628f7){logger['error'](_0x3628f7[_0x3860('0x2d')]);if(_0x3628f7[_0x3860('0x2e')]){delete _0x3628f7[_0x3860('0x2e')];}_0x10d9e4['status'](_0x426e6c)[_0x3860('0x2f')](_0x3628f7);};}exports['index']=function(_0x294b3a,_0x4825f0){var _0x1c498c={},_0x2e542a={},_0x24cf39={'count':0x0,'rows':[]};var _0x47e350=_[_0x3860('0x30')](db[_0x3860('0x31')]['rawAttributes'],function(_0x1c94cc){return{'name':_0x1c94cc['fieldName'],'type':_0x1c94cc[_0x3860('0x32')][_0x3860('0x33')]};});_0x2e542a[_0x3860('0x34')]=_[_0x3860('0x30')](_0x47e350,_0x3860('0x2e'));_0x2e542a[_0x3860('0x35')]=_[_0x3860('0x36')](_0x294b3a['query']);_0x2e542a[_0x3860('0x37')]=_[_0x3860('0x38')](_0x2e542a['model'],_0x2e542a[_0x3860('0x35')]);_0x1c498c[_0x3860('0x39')]=_[_0x3860('0x38')](_0x2e542a['model'],qs['fields'](_0x294b3a[_0x3860('0x35')][_0x3860('0x3a')]));_0x1c498c[_0x3860('0x39')]=_0x1c498c[_0x3860('0x39')]['length']?_0x1c498c['attributes']:_0x2e542a[_0x3860('0x34')];if(!_0x294b3a[_0x3860('0x35')][_0x3860('0x3b')](_0x3860('0x3c'))){_0x1c498c[_0x3860('0x20')]=qs['limit'](_0x294b3a[_0x3860('0x35')][_0x3860('0x20')]);_0x1c498c['offset']=qs['offset'](_0x294b3a[_0x3860('0x35')][_0x3860('0x22')]);}_0x1c498c[_0x3860('0x3d')]=qs[_0x3860('0x3e')](_0x294b3a[_0x3860('0x35')]['sort']);_0x1c498c[_0x3860('0x3f')]=qs['filters'](_[_0x3860('0x40')](_0x294b3a[_0x3860('0x35')],_0x2e542a['filters']),_0x47e350);if(_0x294b3a[_0x3860('0x35')][_0x3860('0x41')]){_0x1c498c['where']=_[_0x3860('0x42')](_0x1c498c[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x47e350,function(_0xf346e){if(_0xf346e['type']!==_0x3860('0x43')){var _0x47141b={};_0x47141b[_0xf346e[_0x3860('0x2e')]]={'$like':'%'+_0x294b3a['query'][_0x3860('0x41')]+'%'};return _0x47141b;}})});}_0x1c498c=_['merge']({},_0x1c498c,_0x294b3a[_0x3860('0x44')]);var _0x424801={'where':_0x1c498c[_0x3860('0x3f')]};return db[_0x3860('0x31')][_0x3860('0x21')](_0x424801)[_0x3860('0x28')](function(_0x4e0a44){_0x24cf39[_0x3860('0x21')]=_0x4e0a44;if(_0x294b3a[_0x3860('0x35')]['includeAll']){_0x1c498c['include']=[{'all':!![]}];}return db[_0x3860('0x31')][_0x3860('0x45')](_0x1c498c);})['then'](function(_0x164a77){_0x24cf39[_0x3860('0x46')]=_0x164a77;return _0x24cf39;})['then'](respondWithFilteredResult(_0x4825f0,_0x1c498c))[_0x3860('0x47')](handleError(_0x4825f0,null));};exports[_0x3860('0x48')]=function(_0x392dc3,_0x37e5c3){var _0x14f5b2={'raw':![],'where':{'id':_0x392dc3[_0x3860('0x49')]['id']}},_0x3fa282={};_0x3fa282[_0x3860('0x34')]=_[_0x3860('0x36')](db[_0x3860('0x31')][_0x3860('0x4a')]);_0x3fa282[_0x3860('0x35')]=_[_0x3860('0x36')](_0x392dc3['query']);_0x3fa282[_0x3860('0x37')]=_['intersection'](_0x3fa282[_0x3860('0x34')],_0x3fa282[_0x3860('0x35')]);_0x14f5b2[_0x3860('0x39')]=_[_0x3860('0x38')](_0x3fa282[_0x3860('0x34')],qs[_0x3860('0x3a')](_0x392dc3[_0x3860('0x35')][_0x3860('0x3a')]));_0x14f5b2['attributes']=_0x14f5b2[_0x3860('0x39')][_0x3860('0x4b')]?_0x14f5b2[_0x3860('0x39')]:_0x3fa282['model'];if(_0x392dc3[_0x3860('0x35')][_0x3860('0x4c')]){_0x14f5b2[_0x3860('0x4d')]=[{'all':!![]}];}_0x14f5b2=_[_0x3860('0x42')]({},_0x14f5b2,_0x392dc3['options']);return db['VoicePrefix'][_0x3860('0x4e')](_0x14f5b2)['then'](handleEntityNotFound(_0x37e5c3,null))[_0x3860('0x28')](respondWithResult(_0x37e5c3,null))[_0x3860('0x47')](handleError(_0x37e5c3,null));};exports[_0x3860('0x2c')]=function(_0x52456e,_0x29c52d){return db['VoicePrefix'][_0x3860('0x4e')]({'where':{'id':_0x52456e['params']['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x29c52d,null))[_0x3860('0x28')](removeEntity(_0x29c52d,null))[_0x3860('0x47')](handleError(_0x29c52d,null));};exports['describe']=function(_0x4876ab,_0x4408b5){return db[_0x3860('0x31')]['describe']()[_0x3860('0x28')](respondWithResult(_0x4408b5,null))['catch'](handleError(_0x4408b5,null));};exports[_0x3860('0x4f')]=function(_0x1267e1,_0x254631){var _0x233eee;return db[_0x3860('0x50')][_0x3860('0x51')](function(_0x3fad85){return db['VoicePrefix'][_0x3860('0x4f')](_0x1267e1[_0x3860('0x52')],{'transaction':_0x3fad85})[_0x3860('0x28')](function(_0x137789){_0x233eee=_0x137789[_0x3860('0x29')]({'plain':!![]});return db[_0x3860('0x53')]['find']({'where':{'id':_0x233eee[_0x3860('0x54')]},'raw':!![]})[_0x3860('0x28')](function(_0x19a26d){return createVoicePrefixExtensions(_0x233eee,_0x19a26d,_0x3fad85);});});})[_0x3860('0x28')](function(){var _0x3a55e7=_0x1267e1[_0x3860('0x55')][_0x3860('0x29')]({'plain':!![]});if(!_0x3a55e7)throw new Error(_0x3860('0x56'));if(_0x3a55e7['role']===_0x3860('0x55')){var _0x2ff0bf=_0x233eee;return db['UserProfileSection'][_0x3860('0x4e')]({'where':{'name':_0x3860('0x2a'),'userProfileId':_0x3a55e7[_0x3860('0x57')]},'raw':!![]})['then'](function(_0x17d2df){if(_0x17d2df&&_0x17d2df['autoAssociation']===0x0){return db[_0x3860('0x2b')][_0x3860('0x4f')]({'name':_0x2ff0bf[_0x3860('0x2e')],'resourceId':_0x2ff0bf['id'],'type':_0x17d2df[_0x3860('0x2e')],'sectionId':_0x17d2df['id']},{})[_0x3860('0x28')](function(){return _0x233eee;});}else{return _0x233eee;}})[_0x3860('0x47')](function(_0x1a4f58){logger[_0x3860('0x58')](_0x3860('0x59'),_0x1a4f58);throw _0x1a4f58;});}return _0x233eee;})[_0x3860('0x28')](respondWithResult(_0x254631,null))[_0x3860('0x47')](handleError(_0x254631,null));};function Extension(_0x2bac24,_0x58147d,_0x5ce9a4,_0x5111e0){this[_0x3860('0x5a')]='from-sip';this['exten']=_0x2bac24;this[_0x3860('0x5b')]=_0x5ce9a4;this[_0x3860('0x32')]=_0x3860('0x5c');this[_0x3860('0x5d')]=_0x3860('0x5e');this[_0x3860('0x5f')]=_0x58147d;this['appdata']=_0x5111e0;}function createVoicePrefixExtensions(_0x49ec68,_0x4df47b,_0x1d6c70){return new BPromise(function(_0x1c1da4,_0x2d1646){var _0x5ec169=new Extension(formatPrefixName(_0x49ec68[_0x3860('0x60')]),0x1,'NoOp',_0x3860('0x61'));_0x5ec169[_0x3860('0x62')]=_0x49ec68['id'];return db['VoiceExtension'][_0x3860('0x4f')](_0x5ec169,{'transaction':_0x1d6c70})[_0x3860('0x28')](function(_0xfe45d8){var _0x27f817=_0xfe45d8['get']({'plain':!![]});var _0x18cc37=_[_0x3860('0x30')](addVoicePrefixExtensions(_0x49ec68,_0x4df47b),function(_0x17f248){_0x17f248['VoiceExtensionId']=_0x27f817['id'];_0x17f248['VoicePrefixId']=_0x49ec68['id'];return _0x17f248;});return db[_0x3860('0x53')][_0x3860('0x63')](_0x18cc37,{'transaction':_0x1d6c70})[_0x3860('0x28')](function(_0x1ca0e7){if(!_0x1ca0e7){return _0x2d1646(_0x3860('0x64'));}else{return _0x1c1da4(_0x1ca0e7);}})[_0x3860('0x47')](function(_0x5d0210){return _0x2d1646(_0x5d0210);});});;});};function addVoicePrefixExtensions(_0x2d916a,_0x4fe4e8){var _0x5db8f9=[];var _0x15fa2d=formatPrefixName(_0x2d916a[_0x3860('0x60')]);_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x2,_0x3860('0x66'),_0x3860('0x67')+_0x2d916a[_0x3860('0x2e')]));if(_0x2d916a['callerIdAll']){_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x3,_0x3860('0x66'),_0x3860('0x68')+_0x2d916a[_0x3860('0x69')]));}else{_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x3,_0x3860('0x6a'),'No\x20callerid\x20available'));}_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x4,_0x3860('0x6b'),_0x4fe4e8[_0x3860('0x5a')]+','+'${EXTEN:'+(0x8+_0x2d916a['name'][_0x3860('0x4b')])+'}'+','+0x1));return _0x5db8f9;}function formatPrefixName(_0x2d425d){var _0x11c2c8='_';for(var _0x3b7a76=0x0;_0x3b7a76<_0x2d425d[_0x3860('0x4b')];_0x3b7a76++){if(_0x2d425d['charAt'](_0x3b7a76)=='-'){_0x11c2c8+=_0x2d425d['charAt'](_0x3b7a76);}else{_0x11c2c8+='['+_0x2d425d[_0x3860('0x6c')](_0x3b7a76)+']';}}_0x11c2c8+='.';return _0x11c2c8;}exports[_0x3860('0x6d')]=function(_0x47e144,_0x5d9416,_0x2fd2ec){var _0x38ad4e=_0x47e144['body'];_0x38ad4e[_0x3860('0x60')]=_0x3860('0x6e')+_0x38ad4e[_0x3860('0x2e')]+'-';return db[_0x3860('0x50')]['transaction'](function(_0x1e8c5c){return db[_0x3860('0x31')]['update'](_0x38ad4e,{'where':{'id':_0x38ad4e['id']},'transaction':_0x1e8c5c})['then'](function(){return db[_0x3860('0x53')][_0x3860('0x2c')]({'where':{'VoicePrefixId':_0x38ad4e['id']},'transaction':_0x1e8c5c})['then'](function(){return db[_0x3860('0x53')]['find']({'where':{'id':_0x38ad4e[_0x3860('0x54')]},'raw':!![]})['then'](function(_0x543574){return createVoicePrefixExtensions(_0x38ad4e,_0x543574,_0x1e8c5c);});});});})[_0x3860('0x28')](function(){return db['VoicePrefix'][_0x3860('0x6f')](_0x38ad4e['id']);})[_0x3860('0x28')](respondWithResult(_0x5d9416,null))[_0x3860('0x47')](handleError(_0x5d9416,null));};exports[_0x3860('0x70')]=function(_0x19f717,_0x43c5a1,_0x4b3447){return db[_0x3860('0x31')][_0x3860('0x4e')]({'where':{'id':_0x19f717[_0x3860('0x49')]['id']}})['then'](handleEntityNotFound(_0x43c5a1,null))[_0x3860('0x28')](function(_0x55661a){if(_0x55661a){return _0x55661a[_0x3860('0x70')](_0x19f717[_0x3860('0x52')]['ids'],_[_0x3860('0x71')](_0x19f717[_0x3860('0x52')],[_0x3860('0x72'),'id'])||{})['spread'](function(_0x572707){for(var _0x5a282a=0x0;_0x5a282a<_0x19f717['body'][_0x3860('0x72')][_0x3860('0x4b')];_0x5a282a+=0x1){socket[_0x3860('0x73')](_0x3860('0x74'),{'UserId':Number(_0x19f717['body']['ids'][_0x5a282a]),'VoicePrefixId':Number(_0x19f717[_0x3860('0x49')]['id'])});}return _0x572707;});}})[_0x3860('0x28')](respondWithResult(_0x43c5a1,null))[_0x3860('0x47')](handleError(_0x43c5a1,null));};exports[_0x3860('0x75')]=function(_0x4b0652,_0x3a7c0c,_0x306560){return db['VoicePrefix']['find']({'where':{'id':_0x4b0652[_0x3860('0x49')]['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x3a7c0c,null))[_0x3860('0x28')](function(_0x27894f){if(_0x27894f){return _0x27894f['removeAgents'](_0x4b0652['query'][_0x3860('0x72')])['then'](function(){if(_[_0x3860('0x76')](_0x4b0652[_0x3860('0x35')]['ids'])){for(var _0x4e7713=0x0;_0x4e7713<_0x4b0652['query'][_0x3860('0x72')][_0x3860('0x4b')];_0x4e7713+=0x1){socket['emit'](_0x3860('0x77'),{'UserId':Number(_0x4b0652[_0x3860('0x35')][_0x3860('0x72')][_0x4e7713]),'VoicePrefixId':Number(_0x4b0652[_0x3860('0x49')]['id'])});}}else{socket[_0x3860('0x73')]('userVoicePrefix:remove',{'UserId':Number(_0x4b0652[_0x3860('0x35')][_0x3860('0x72')]),'VoicePrefixId':Number(_0x4b0652[_0x3860('0x49')]['id'])});}});}})[_0x3860('0x28')](respondWithStatusCode(_0x3a7c0c,null))[_0x3860('0x47')](handleError(_0x3a7c0c,null));};exports['getAgents']=function(_0x313366,_0xf57e80,_0x2f3759){var _0x41ee6f={};var _0x28fcb6={};var _0x543c98;var _0x532370;return db[_0x3860('0x31')][_0x3860('0x78')]({'where':{'id':_0x313366[_0x3860('0x49')]['id']}})[_0x3860('0x28')](handleEntityNotFound(_0xf57e80,null))[_0x3860('0x28')](function(_0x293c60){if(_0x293c60){_0x543c98=_0x293c60;_0x28fcb6[_0x3860('0x34')]=_['keys'](db[_0x3860('0x79')][_0x3860('0x4a')]);_0x28fcb6['query']=_[_0x3860('0x36')](_0x313366[_0x3860('0x35')]);_0x28fcb6[_0x3860('0x37')]=_['intersection'](_0x28fcb6[_0x3860('0x34')],_0x28fcb6[_0x3860('0x35')]);_0x41ee6f['attributes']=_[_0x3860('0x38')](_0x28fcb6['model'],qs[_0x3860('0x3a')](_0x313366[_0x3860('0x35')]['fields']));_0x41ee6f[_0x3860('0x39')]=_0x41ee6f[_0x3860('0x39')][_0x3860('0x4b')]?_0x41ee6f[_0x3860('0x39')]:_0x28fcb6[_0x3860('0x34')];_0x41ee6f['order']=qs[_0x3860('0x3e')](_0x313366[_0x3860('0x35')][_0x3860('0x3e')]);_0x41ee6f[_0x3860('0x3f')]=qs[_0x3860('0x37')](_['pick'](_0x313366['query'],_0x28fcb6[_0x3860('0x37')]));if(_0x313366[_0x3860('0x35')]['filter']){_0x41ee6f[_0x3860('0x3f')]=_[_0x3860('0x42')](_0x41ee6f[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x41ee6f['attributes'],function(_0x3a0719){var _0x5a2f99={};_0x5a2f99[_0x3a0719]={'$like':'%'+_0x313366[_0x3860('0x35')][_0x3860('0x41')]+'%'};return _0x5a2f99;})});}_0x41ee6f=_[_0x3860('0x42')]({},_0x41ee6f,_0x313366[_0x3860('0x44')]);return _0x543c98[_0x3860('0x7a')](_0x41ee6f);}})[_0x3860('0x28')](function(_0x467b1b){if(_0x467b1b){_0x532370=_0x467b1b['length'];if(!_0x313366[_0x3860('0x35')][_0x3860('0x3b')]('nolimit')){_0x41ee6f['limit']=qs['limit'](_0x313366['query'][_0x3860('0x20')]);_0x41ee6f[_0x3860('0x22')]=qs[_0x3860('0x22')](_0x313366[_0x3860('0x35')][_0x3860('0x22')]);}return _0x543c98[_0x3860('0x7a')](_0x41ee6f);}})['then'](function(_0x204da6){if(_0x204da6){return _0x204da6?{'count':_0x532370,'rows':_0x204da6}:null;}})['then'](respondWithResult(_0xf57e80,null))[_0x3860('0x47')](handleError(_0xf57e80,null));};exports[_0x3860('0x7b')]=function(_0x897ea0,_0x221229,_0x459b6c){var _0x1108d2={};var _0x23d7f0={};var _0x52987a;var _0xcd4bd3;return db[_0x3860('0x31')][_0x3860('0x78')]({'where':{'id':_0x897ea0['params']['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x221229,null))[_0x3860('0x28')](function(_0x1c87bd){if(_0x1c87bd){_0x52987a=_0x1c87bd;_0x23d7f0['model']=_[_0x3860('0x36')](db[_0x3860('0x7c')][_0x3860('0x4a')]);_0x23d7f0[_0x3860('0x35')]=_['keys'](_0x897ea0[_0x3860('0x35')]);_0x23d7f0[_0x3860('0x37')]=_[_0x3860('0x38')](_0x23d7f0['model'],_0x23d7f0[_0x3860('0x35')]);_0x1108d2[_0x3860('0x39')]=_[_0x3860('0x38')](_0x23d7f0['model'],qs[_0x3860('0x3a')](_0x897ea0[_0x3860('0x35')][_0x3860('0x3a')]));_0x1108d2['attributes']=_0x1108d2[_0x3860('0x39')][_0x3860('0x4b')]?_0x1108d2[_0x3860('0x39')]:_0x23d7f0['model'];_0x1108d2[_0x3860('0x3d')]=qs[_0x3860('0x3e')](_0x897ea0[_0x3860('0x35')]['sort']);_0x1108d2[_0x3860('0x3f')]=qs['filters'](_[_0x3860('0x40')](_0x897ea0['query'],_0x23d7f0[_0x3860('0x37')]));if(_0x897ea0[_0x3860('0x35')][_0x3860('0x41')]){_0x1108d2[_0x3860('0x3f')]=_[_0x3860('0x42')](_0x1108d2[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x1108d2[_0x3860('0x39')],function(_0x3f808c){var _0x1de607={};_0x1de607[_0x3f808c]={'$like':'%'+_0x897ea0[_0x3860('0x35')][_0x3860('0x41')]+'%'};return _0x1de607;})});}_0x1108d2=_[_0x3860('0x42')]({},_0x1108d2,_0x897ea0[_0x3860('0x44')]);return _0x52987a[_0x3860('0x7b')](_0x1108d2);}})[_0x3860('0x28')](function(_0x46661f){if(_0x46661f){_0xcd4bd3=_0x46661f[_0x3860('0x4b')];if(!_0x897ea0['query'][_0x3860('0x3b')](_0x3860('0x3c'))){_0x1108d2[_0x3860('0x20')]=qs[_0x3860('0x20')](_0x897ea0[_0x3860('0x35')][_0x3860('0x20')]);_0x1108d2[_0x3860('0x22')]=qs[_0x3860('0x22')](_0x897ea0[_0x3860('0x35')][_0x3860('0x22')]);}return _0x52987a[_0x3860('0x7b')](_0x1108d2);}})['then'](function(_0x252c19){if(_0x252c19){return _0x252c19?{'count':_0xcd4bd3,'rows':_0x252c19}:null;}})[_0x3860('0x28')](respondWithResult(_0x221229,null))[_0x3860('0x47')](handleError(_0x221229,null));};exports[_0x3860('0x7d')]=function(_0x4a929e,_0x1a1994,_0x2ece36){var _0x2fcf2c=_0x4a929e[_0x3860('0x52')]['ids'];var _0x280747;return db['Team']['findAll']({'where':{'id':_0x2fcf2c},'attributes':['id'],'include':[{'model':db[_0x3860('0x79')],'as':_0x3860('0x7e'),'attributes':['id',_0x3860('0x2e'),_0x3860('0x7f'),_0x3860('0x80'),_0x3860('0x81')],'raw':!![]}]})[_0x3860('0x28')](function(_0x273fed){if(_0x273fed){_0x280747=_0x273fed;var _0x3e4a88=_[_0x3860('0x82')](_0x273fed,function(_0x4677b0){var _0x559c=_0x4677b0[_0x3860('0x29')]({'plain':!![]});return _0x559c['Agents'];});return db[_0x3860('0x31')]['find']({'where':{'id':_0x4a929e[_0x3860('0x49')]['id']}})[_0x3860('0x28')](function(_0x5891d8){return db[_0x3860('0x50')][_0x3860('0x51')](function(_0x1a9158){return _0x5891d8[_0x3860('0x7d')](_0x2fcf2c,{'transaction':_0x1a9158})[_0x3860('0x28')](function(){return BPromise[_0x3860('0x83')](_0x280747,function(_0x12296a){return db['TeamVoicePrefix'][_0x3860('0x84')]({'TeamId':_0x12296a['id'],'VoicePrefixId':_0x4a929e[_0x3860('0x49')]['id']},{'transaction':_0x1a9158});});})[_0x3860('0x28')](function(){return BPromise[_0x3860('0x83')](_0x3e4a88,function(_0x469ae6){return db['UserVoicePrefix'][_0x3860('0x85')]({'where':{'UserId':_0x469ae6['id'],'VoicePrefixId':_0x4a929e['params']['id']},'transaction':_0x1a9158});});})['then'](function(){_0x3e4a88['forEach'](function(_0x1059a4){socket[_0x3860('0x73')](_0x3860('0x74'),{'UserId':_0x1059a4['id'],'VoicePrefixId':_0x5891d8['id']});});});});});}})[_0x3860('0x28')](respondWithStatusCode(_0x1a1994,null))[_0x3860('0x47')](handleError(_0x1a1994,null));};exports[_0x3860('0x86')]=function(_0x270ca1,_0xe24a1d,_0x59c203){return db[_0x3860('0x7c')][_0x3860('0x45')]({'where':{'id':_0x270ca1['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x3860('0x79')],'as':_0x3860('0x7e'),'attributes':['id'],'raw':!![]}]})[_0x3860('0x28')](handleEntityNotFound(_0xe24a1d,null))['then'](function(_0x1fe2d8){var _0x4f07f3=_[_0x3860('0x30')](_0x1fe2d8,'id');var _0x5c196e=[];var _0x41fd53=[];var _0xf91fc2=squel['select']();_0xf91fc2[_0x3860('0x87')](_0x3860('0x88'))['from'](_0x3860('0x89'),'tq')[_0x3860('0x8a')](_0x3860('0x8b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3860('0x3f')]('VoicePrefixId\x20=\x20?',_0x270ca1[_0x3860('0x49')]['id']);for(var _0x18b845=0x0;_0x18b845<_0x1fe2d8['length'];_0x18b845+=0x1){let _0x20edc7=_0x1fe2d8[_0x18b845];for(var _0x2d8581=0x0;_0x2d8581<_0x20edc7[_0x3860('0x7e')][_0x3860('0x4b')];_0x2d8581+=0x1){let _0x2d4744=_0x20edc7['Agents'][_0x2d8581];var _0x410bf4=_0xf91fc2[_0x3860('0x8c')]();_0x410bf4['where']('ut.UserId\x20=\x20?',_0x2d4744['id']);_0x41fd53[_0x3860('0x65')](db['sequelize'][_0x3860('0x35')](_0x410bf4[_0x3860('0x8d')](),{'type':db['sequelize'][_0x3860('0x8e')]['SELECT']})[_0x3860('0x28')](function(_0x4b8128){if(_0x4b8128[_0x3860('0x4b')]===0x1){return _0x2d4744['id'];}else{var _0x24788d=_[_0x3860('0x8f')](_[_0x3860('0x30')](_0x4b8128,'TeamId'),function(_0x25a8f7){return _[_0x3860('0x90')](_0x4f07f3,_0x25a8f7);});if(_0x24788d){return _0x2d4744['id'];}}}));}}return BPromise[_0x3860('0x91')](_0x41fd53)[_0x3860('0x28')](function(_0x4b7f2a){_0x5c196e=_(_0x5c196e)[_0x3860('0x92')](_0x4b7f2a)[_0x3860('0x93')]()['value']();return db[_0x3860('0x31')][_0x3860('0x4e')]({'where':{'id':_0x270ca1[_0x3860('0x49')]['id']}})[_0x3860('0x28')](function(_0x514374){return db[_0x3860('0x50')][_0x3860('0x51')](function(_0xd2167f){return _0x514374[_0x3860('0x86')](_0x270ca1['query'][_0x3860('0x72')],{'transaction':_0xd2167f})['then'](function(){if(!_['isEmpty'](_0x5c196e)){return _0x514374['removeAgents'](_0x5c196e,{'transaction':_0xd2167f});}})[_0x3860('0x28')](function(){_0x5c196e[_0x3860('0x94')](function(_0x1a6929){socket['emit'](_0x3860('0x77'),{'UserId':_0x1a6929,'VoicePrefixId':_0x514374['id']});});});});});});})['then'](respondWithStatusCode(_0xe24a1d,null))[_0x3860('0x47')](handleError(_0xe24a1d,null));}; \ No newline at end of file +var _0x02ce=['apply','reject','save','update','destroy','then','get','VoicePrefixes','UserProfileResource','sendStatus','error','name','send','index','map','VoicePrefix','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','show','params','length','find','catch','sequelize','body','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','create','context','from-sip','exten','app','type','description','Voice\x20Prefix\x20Extension','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','callerIdAll','Set','PREFIX-CALLERIDALL=','${EXTEN:','charAt','system-','transaction','VoiceExtension','findById','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','getAgents','User','pick','findOne','Team','getTeams','addTeams','online','voicePause','flatMap','Agents','each','TeamVoicePrefix','upsert','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','union','compact','value','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voicePrefix.socket','status','end','json','undefined','limit','count','offset','set'];(function(_0x124031,_0x395297){var _0x278769=function(_0x2215d0){while(--_0x2215d0){_0x124031['push'](_0x124031['shift']());}};_0x278769(++_0x395297);}(_0x02ce,0x1ac));var _0xe02c=function(_0x69ae63,_0x266fab){_0x69ae63=_0x69ae63-0x0;var _0x30405f=_0x02ce[_0x69ae63];return _0x30405f;};'use strict';var emlformat=require(_0xe02c('0x0'));var rimraf=require(_0xe02c('0x1'));var zipdir=require(_0xe02c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe02c('0x3'));var moment=require('moment');var BPromise=require(_0xe02c('0x4'));var Mustache=require(_0xe02c('0x5'));var util=require(_0xe02c('0x6'));var path=require(_0xe02c('0x7'));var sox=require(_0xe02c('0x8'));var csv=require(_0xe02c('0x9'));var ejs=require(_0xe02c('0xa'));var fs=require('fs');var fs_extra=require(_0xe02c('0xb'));var _=require(_0xe02c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe02c('0xd'));var deskjs=require(_0xe02c('0xe'));var toCsv=require(_0xe02c('0x9'));var querystring=require(_0xe02c('0xf'));var Papa=require(_0xe02c('0x10'));var Redis=require(_0xe02c('0x11'));var authService=require(_0xe02c('0x12'));var qs=require(_0xe02c('0x13'));var as=require(_0xe02c('0x14'));var hardwareService=require(_0xe02c('0x15'));var logger=require(_0xe02c('0x16'))(_0xe02c('0x17'));var utils=require(_0xe02c('0x18'));var config=require(_0xe02c('0x19'));var licenseUtil=require(_0xe02c('0x1a'));var db=require(_0xe02c('0x1b'))['db'];config[_0xe02c('0x1c')]=_[_0xe02c('0x1d')](config['redis'],{'host':_0xe02c('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe02c('0x1f'))['register'](socket);function respondWithStatusCode(_0x221910,_0x59614c){_0x59614c=_0x59614c||0xcc;return function(_0x3a5a2c){if(_0x3a5a2c){return _0x221910['sendStatus'](_0x59614c);}return _0x221910[_0xe02c('0x20')](_0x59614c)[_0xe02c('0x21')]();};}function respondWithResult(_0x59f2f6,_0x10a2a6){_0x10a2a6=_0x10a2a6||0xc8;return function(_0x226a80){if(_0x226a80){return _0x59f2f6['status'](_0x10a2a6)[_0xe02c('0x22')](_0x226a80);}};}function respondWithFilteredResult(_0x20f492,_0x5a4583){return function(_0x52917f){if(_0x52917f){var _0x3e37bf=typeof _0x5a4583['offset']===_0xe02c('0x23')&&typeof _0x5a4583[_0xe02c('0x24')]===_0xe02c('0x23');var _0x36fed0=_0x52917f[_0xe02c('0x25')];var _0x54c5b0=_0x3e37bf?0x0:_0x5a4583[_0xe02c('0x26')];var _0x59026f=_0x3e37bf?_0x52917f['count']:_0x5a4583[_0xe02c('0x26')]+_0x5a4583[_0xe02c('0x24')];var _0x480b9a;if(_0x59026f>=_0x36fed0){_0x59026f=_0x36fed0;_0x480b9a=0xc8;}else{_0x480b9a=0xce;}_0x20f492[_0xe02c('0x20')](_0x480b9a);return _0x20f492[_0xe02c('0x27')]('Content-Range',_0x54c5b0+'-'+_0x59026f+'/'+_0x36fed0)[_0xe02c('0x22')](_0x52917f);}return null;};}function patchUpdates(_0x45fd82){return function(_0x39b00c){try{jsonpatch[_0xe02c('0x28')](_0x39b00c,_0x45fd82,!![]);}catch(_0x2d44c8){return BPromise[_0xe02c('0x29')](_0x2d44c8);}return _0x39b00c[_0xe02c('0x2a')]();};}function saveUpdates(_0xf41d4c,_0xeae877){return function(_0x18b538){if(_0x18b538){return _0x18b538[_0xe02c('0x2b')](_0xf41d4c)['then'](function(_0xefd882){return _0xefd882;});}return null;};}function removeEntity(_0x4411d8,_0x3592ca){return function(_0x14ffba){if(_0x14ffba){return _0x14ffba[_0xe02c('0x2c')]()[_0xe02c('0x2d')](function(){var _0x43dc78=_0x14ffba[_0xe02c('0x2e')]({'plain':!![]});var _0x55ef2a=_0xe02c('0x2f');return db[_0xe02c('0x30')][_0xe02c('0x2c')]({'where':{'type':_0x55ef2a,'resourceId':_0x43dc78['id']}})['then'](function(){return _0x14ffba;});})[_0xe02c('0x2d')](function(){_0x4411d8[_0xe02c('0x20')](0xcc)[_0xe02c('0x21')]();});}};}function handleEntityNotFound(_0x287f7e,_0x1e7eab){return function(_0x35a309){if(!_0x35a309){_0x287f7e[_0xe02c('0x31')](0x194);}return _0x35a309;};}function handleError(_0x1b8f21,_0x9ee479){_0x9ee479=_0x9ee479||0x1f4;return function(_0x288004){logger[_0xe02c('0x32')](_0x288004['stack']);if(_0x288004[_0xe02c('0x33')]){delete _0x288004[_0xe02c('0x33')];}_0x1b8f21[_0xe02c('0x20')](_0x9ee479)[_0xe02c('0x34')](_0x288004);};}exports[_0xe02c('0x35')]=function(_0x14d27a,_0x58bf16){var _0x436bcc={},_0x1e605c={},_0x4fc4fd={'count':0x0,'rows':[]};var _0x1ce34c=_[_0xe02c('0x36')](db[_0xe02c('0x37')][_0xe02c('0x38')],function(_0x2b5ebe){return{'name':_0x2b5ebe['fieldName'],'type':_0x2b5ebe['type'][_0xe02c('0x39')]};});_0x1e605c[_0xe02c('0x3a')]=_['map'](_0x1ce34c,_0xe02c('0x33'));_0x1e605c['query']=_[_0xe02c('0x3b')](_0x14d27a[_0xe02c('0x3c')]);_0x1e605c[_0xe02c('0x3d')]=_[_0xe02c('0x3e')](_0x1e605c[_0xe02c('0x3a')],_0x1e605c['query']);_0x436bcc[_0xe02c('0x3f')]=_['intersection'](_0x1e605c[_0xe02c('0x3a')],qs[_0xe02c('0x40')](_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x40')]));_0x436bcc[_0xe02c('0x3f')]=_0x436bcc[_0xe02c('0x3f')]['length']?_0x436bcc[_0xe02c('0x3f')]:_0x1e605c[_0xe02c('0x3a')];if(!_0x14d27a['query'][_0xe02c('0x41')](_0xe02c('0x42'))){_0x436bcc['limit']=qs[_0xe02c('0x24')](_0x14d27a['query'][_0xe02c('0x24')]);_0x436bcc[_0xe02c('0x26')]=qs['offset'](_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x26')]);}_0x436bcc[_0xe02c('0x43')]=qs[_0xe02c('0x44')](_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x44')]);_0x436bcc['where']=qs[_0xe02c('0x3d')](_['pick'](_0x14d27a['query'],_0x1e605c[_0xe02c('0x3d')]),_0x1ce34c);if(_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x45')]){_0x436bcc[_0xe02c('0x46')]=_['merge'](_0x436bcc[_0xe02c('0x46')],{'$or':_[_0xe02c('0x36')](_0x1ce34c,function(_0x163573){if(_0x163573['type']!=='VIRTUAL'){var _0x33c6da={};_0x33c6da[_0x163573[_0xe02c('0x33')]]={'$like':'%'+_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x45')]+'%'};return _0x33c6da;}})});}_0x436bcc=_[_0xe02c('0x47')]({},_0x436bcc,_0x14d27a[_0xe02c('0x48')]);var _0x25f8ae={'where':_0x436bcc[_0xe02c('0x46')]};return db[_0xe02c('0x37')]['count'](_0x25f8ae)[_0xe02c('0x2d')](function(_0x5ef4a1){_0x4fc4fd['count']=_0x5ef4a1;if(_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x49')]){_0x436bcc[_0xe02c('0x4a')]=[{'all':!![]}];}return db[_0xe02c('0x37')][_0xe02c('0x4b')](_0x436bcc);})[_0xe02c('0x2d')](function(_0x165f4a){_0x4fc4fd[_0xe02c('0x4c')]=_0x165f4a;return _0x4fc4fd;})['then'](respondWithFilteredResult(_0x58bf16,_0x436bcc))['catch'](handleError(_0x58bf16,null));};exports[_0xe02c('0x4d')]=function(_0xf89a57,_0x304ece){var _0x52f239={'raw':![],'where':{'id':_0xf89a57[_0xe02c('0x4e')]['id']}},_0x1cf443={};_0x1cf443[_0xe02c('0x3a')]=_[_0xe02c('0x3b')](db[_0xe02c('0x37')][_0xe02c('0x38')]);_0x1cf443[_0xe02c('0x3c')]=_[_0xe02c('0x3b')](_0xf89a57[_0xe02c('0x3c')]);_0x1cf443[_0xe02c('0x3d')]=_['intersection'](_0x1cf443[_0xe02c('0x3a')],_0x1cf443[_0xe02c('0x3c')]);_0x52f239[_0xe02c('0x3f')]=_[_0xe02c('0x3e')](_0x1cf443[_0xe02c('0x3a')],qs[_0xe02c('0x40')](_0xf89a57[_0xe02c('0x3c')][_0xe02c('0x40')]));_0x52f239[_0xe02c('0x3f')]=_0x52f239[_0xe02c('0x3f')][_0xe02c('0x4f')]?_0x52f239[_0xe02c('0x3f')]:_0x1cf443[_0xe02c('0x3a')];if(_0xf89a57['query'][_0xe02c('0x49')]){_0x52f239['include']=[{'all':!![]}];}_0x52f239=_[_0xe02c('0x47')]({},_0x52f239,_0xf89a57[_0xe02c('0x48')]);return db[_0xe02c('0x37')][_0xe02c('0x50')](_0x52f239)[_0xe02c('0x2d')](handleEntityNotFound(_0x304ece,null))[_0xe02c('0x2d')](respondWithResult(_0x304ece,null))[_0xe02c('0x51')](handleError(_0x304ece,null));};exports[_0xe02c('0x2c')]=function(_0xc6ea7b,_0x385497){return db['VoicePrefix'][_0xe02c('0x50')]({'where':{'id':_0xc6ea7b[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](handleEntityNotFound(_0x385497,null))['then'](removeEntity(_0x385497,null))[_0xe02c('0x51')](handleError(_0x385497,null));};exports['describe']=function(_0x21a126,_0x56b9e2){return db['VoicePrefix']['describe']()['then'](respondWithResult(_0x56b9e2,null))['catch'](handleError(_0x56b9e2,null));};exports['create']=function(_0x107f3f,_0x3ac0a5){var _0x1510aa;return db[_0xe02c('0x52')]['transaction'](function(_0x274beb){return db[_0xe02c('0x37')]['create'](_0x107f3f[_0xe02c('0x53')],{'transaction':_0x274beb})[_0xe02c('0x2d')](function(_0x221e5e){_0x1510aa=_0x221e5e['get']({'plain':!![]});return db['VoiceExtension'][_0xe02c('0x50')]({'where':{'id':_0x1510aa[_0xe02c('0x54')]},'raw':!![]})[_0xe02c('0x2d')](function(_0x5b2d2b){return createVoicePrefixExtensions(_0x1510aa,_0x5b2d2b,_0x274beb);});});})[_0xe02c('0x2d')](function(){var _0x53765c=_0x107f3f['user'][_0xe02c('0x2e')]({'plain':!![]});if(!_0x53765c)throw new Error(_0xe02c('0x55'));if(_0x53765c['role']===_0xe02c('0x56')){var _0x849eea=_0x1510aa;return db[_0xe02c('0x57')]['find']({'where':{'name':_0xe02c('0x2f'),'userProfileId':_0x53765c[_0xe02c('0x58')]},'raw':!![]})['then'](function(_0x3788e8){if(_0x3788e8&&_0x3788e8[_0xe02c('0x59')]===0x0){return db[_0xe02c('0x30')][_0xe02c('0x5a')]({'name':_0x849eea[_0xe02c('0x33')],'resourceId':_0x849eea['id'],'type':_0x3788e8[_0xe02c('0x33')],'sectionId':_0x3788e8['id']},{})[_0xe02c('0x2d')](function(){return _0x1510aa;});}else{return _0x1510aa;}})[_0xe02c('0x51')](function(_0xf7e836){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf7e836);throw _0xf7e836;});}return _0x1510aa;})['then'](respondWithResult(_0x3ac0a5,null))[_0xe02c('0x51')](handleError(_0x3ac0a5,null));};function Extension(_0x299770,_0x42f2fd,_0x496eb1,_0x4eb35d){this[_0xe02c('0x5b')]=_0xe02c('0x5c');this[_0xe02c('0x5d')]=_0x299770;this[_0xe02c('0x5e')]=_0x496eb1;this[_0xe02c('0x5f')]='system';this[_0xe02c('0x60')]=_0xe02c('0x61');this['priority']=_0x42f2fd;this['appdata']=_0x4eb35d;}function createVoicePrefixExtensions(_0x879d99,_0x566204,_0x4da197){return new BPromise(function(_0x480d49,_0x3b19c9){var _0x28d7a2=new Extension(formatPrefixName(_0x879d99[_0xe02c('0x62')]),0x1,_0xe02c('0x63'),_0xe02c('0x64'));_0x28d7a2[_0xe02c('0x65')]=_0x879d99['id'];return db['VoiceExtension'][_0xe02c('0x5a')](_0x28d7a2,{'transaction':_0x4da197})['then'](function(_0x4f3c9a){var _0x185dc2=_0x4f3c9a[_0xe02c('0x2e')]({'plain':!![]});var _0x44ba68=_[_0xe02c('0x36')](addVoicePrefixExtensions(_0x879d99,_0x566204),function(_0x5b6979){_0x5b6979[_0xe02c('0x54')]=_0x185dc2['id'];_0x5b6979[_0xe02c('0x65')]=_0x879d99['id'];return _0x5b6979;});return db['VoiceExtension'][_0xe02c('0x66')](_0x44ba68,{'transaction':_0x4da197})[_0xe02c('0x2d')](function(_0x4cc74d){if(!_0x4cc74d){return _0x3b19c9(_0xe02c('0x67'));}else{return _0x480d49(_0x4cc74d);}})[_0xe02c('0x51')](function(_0x44f28f){return _0x3b19c9(_0x44f28f);});});;});};function addVoicePrefixExtensions(_0x4053e6,_0x323f3b){var _0x3a62a2=[];var _0x31b281=formatPrefixName(_0x4053e6['prefix']);_0x3a62a2[_0xe02c('0x68')](new Extension(_0x31b281,0x2,'Set','CDR(prefix)='+_0x4053e6['name']));if(_0x4053e6[_0xe02c('0x69')]){_0x3a62a2[_0xe02c('0x68')](new Extension(_0x31b281,0x3,_0xe02c('0x6a'),_0xe02c('0x6b')+_0x4053e6['callerIdAll']));}else{_0x3a62a2[_0xe02c('0x68')](new Extension(_0x31b281,0x3,_0xe02c('0x63'),'No\x20callerid\x20available'));}_0x3a62a2['push'](new Extension(_0x31b281,0x4,'goto',_0x323f3b[_0xe02c('0x5b')]+','+_0xe02c('0x6c')+(0x8+_0x4053e6['name']['length'])+'}'+','+0x1));return _0x3a62a2;}function formatPrefixName(_0x38789c){var _0x30ad9f='_';for(var _0x120ef1=0x0;_0x120ef1<_0x38789c[_0xe02c('0x4f')];_0x120ef1++){if(_0x38789c[_0xe02c('0x6d')](_0x120ef1)=='-'){_0x30ad9f+=_0x38789c['charAt'](_0x120ef1);}else{_0x30ad9f+='['+_0x38789c[_0xe02c('0x6d')](_0x120ef1)+']';}}_0x30ad9f+='.';return _0x30ad9f;}exports[_0xe02c('0x2b')]=function(_0x3f277b,_0x2776c0,_0x11c506){var _0x119119=_0x3f277b['body'];_0x119119[_0xe02c('0x62')]=_0xe02c('0x6e')+_0x119119['name']+'-';return db[_0xe02c('0x52')][_0xe02c('0x6f')](function(_0x123ca9){return db[_0xe02c('0x37')]['update'](_0x119119,{'where':{'id':_0x119119['id']},'transaction':_0x123ca9})[_0xe02c('0x2d')](function(){return db[_0xe02c('0x70')]['destroy']({'where':{'VoicePrefixId':_0x119119['id']},'transaction':_0x123ca9})['then'](function(){return db['VoiceExtension'][_0xe02c('0x50')]({'where':{'id':_0x119119[_0xe02c('0x54')]},'raw':!![]})[_0xe02c('0x2d')](function(_0x34e692){return createVoicePrefixExtensions(_0x119119,_0x34e692,_0x123ca9);});});});})[_0xe02c('0x2d')](function(){return db['VoicePrefix'][_0xe02c('0x71')](_0x119119['id']);})[_0xe02c('0x2d')](respondWithResult(_0x2776c0,null))[_0xe02c('0x51')](handleError(_0x2776c0,null));};exports['addAgents']=function(_0x4a7783,_0x4c3c91,_0x3cd802){return db[_0xe02c('0x37')][_0xe02c('0x50')]({'where':{'id':_0x4a7783[_0xe02c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4c3c91,null))[_0xe02c('0x2d')](function(_0x48f524){if(_0x48f524){return _0x48f524['addAgents'](_0x4a7783[_0xe02c('0x53')][_0xe02c('0x72')],_[_0xe02c('0x73')](_0x4a7783[_0xe02c('0x53')],[_0xe02c('0x72'),'id'])||{})[_0xe02c('0x74')](function(_0x748217){for(var _0x12aaea=0x0;_0x12aaea<_0x4a7783['body'][_0xe02c('0x72')][_0xe02c('0x4f')];_0x12aaea+=0x1){socket[_0xe02c('0x75')](_0xe02c('0x76'),{'UserId':Number(_0x4a7783[_0xe02c('0x53')][_0xe02c('0x72')][_0x12aaea]),'VoicePrefixId':Number(_0x4a7783[_0xe02c('0x4e')]['id'])});}return _0x748217;});}})[_0xe02c('0x2d')](respondWithResult(_0x4c3c91,null))[_0xe02c('0x51')](handleError(_0x4c3c91,null));};exports[_0xe02c('0x77')]=function(_0x5e6df5,_0x58acfd,_0x120dd7){return db[_0xe02c('0x37')][_0xe02c('0x50')]({'where':{'id':_0x5e6df5[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](handleEntityNotFound(_0x58acfd,null))['then'](function(_0x405b16){if(_0x405b16){return _0x405b16[_0xe02c('0x77')](_0x5e6df5[_0xe02c('0x3c')][_0xe02c('0x72')])[_0xe02c('0x2d')](function(){if(_[_0xe02c('0x78')](_0x5e6df5[_0xe02c('0x3c')][_0xe02c('0x72')])){for(var _0x1d594c=0x0;_0x1d594c<_0x5e6df5[_0xe02c('0x3c')][_0xe02c('0x72')][_0xe02c('0x4f')];_0x1d594c+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x5e6df5[_0xe02c('0x3c')][_0xe02c('0x72')][_0x1d594c]),'VoicePrefixId':Number(_0x5e6df5['params']['id'])});}}else{socket[_0xe02c('0x75')]('userVoicePrefix:remove',{'UserId':Number(_0x5e6df5[_0xe02c('0x3c')]['ids']),'VoicePrefixId':Number(_0x5e6df5[_0xe02c('0x4e')]['id'])});}});}})[_0xe02c('0x2d')](respondWithStatusCode(_0x58acfd,null))[_0xe02c('0x51')](handleError(_0x58acfd,null));};exports[_0xe02c('0x79')]=function(_0x28755a,_0x3c44d3,_0x119439){var _0x10d067={};var _0x3d3954={};var _0xd0d895;var _0x567478;return db['VoicePrefix']['findOne']({'where':{'id':_0x28755a[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](handleEntityNotFound(_0x3c44d3,null))[_0xe02c('0x2d')](function(_0x1133ce){if(_0x1133ce){_0xd0d895=_0x1133ce;_0x3d3954[_0xe02c('0x3a')]=_[_0xe02c('0x3b')](db[_0xe02c('0x7a')][_0xe02c('0x38')]);_0x3d3954[_0xe02c('0x3c')]=_[_0xe02c('0x3b')](_0x28755a[_0xe02c('0x3c')]);_0x3d3954[_0xe02c('0x3d')]=_[_0xe02c('0x3e')](_0x3d3954['model'],_0x3d3954['query']);_0x10d067[_0xe02c('0x3f')]=_[_0xe02c('0x3e')](_0x3d3954[_0xe02c('0x3a')],qs['fields'](_0x28755a[_0xe02c('0x3c')][_0xe02c('0x40')]));_0x10d067[_0xe02c('0x3f')]=_0x10d067[_0xe02c('0x3f')][_0xe02c('0x4f')]?_0x10d067['attributes']:_0x3d3954[_0xe02c('0x3a')];_0x10d067[_0xe02c('0x43')]=qs[_0xe02c('0x44')](_0x28755a['query'][_0xe02c('0x44')]);_0x10d067[_0xe02c('0x46')]=qs[_0xe02c('0x3d')](_[_0xe02c('0x7b')](_0x28755a[_0xe02c('0x3c')],_0x3d3954['filters']));if(_0x28755a[_0xe02c('0x3c')][_0xe02c('0x45')]){_0x10d067[_0xe02c('0x46')]=_['merge'](_0x10d067[_0xe02c('0x46')],{'$or':_[_0xe02c('0x36')](_0x10d067[_0xe02c('0x3f')],function(_0x3a5ec8){var _0x45e463={};_0x45e463[_0x3a5ec8]={'$like':'%'+_0x28755a['query'][_0xe02c('0x45')]+'%'};return _0x45e463;})});}_0x10d067=_[_0xe02c('0x47')]({},_0x10d067,_0x28755a['options']);return _0xd0d895[_0xe02c('0x79')](_0x10d067);}})['then'](function(_0x52fcd6){if(_0x52fcd6){_0x567478=_0x52fcd6['length'];if(!_0x28755a[_0xe02c('0x3c')][_0xe02c('0x41')](_0xe02c('0x42'))){_0x10d067[_0xe02c('0x24')]=qs[_0xe02c('0x24')](_0x28755a[_0xe02c('0x3c')][_0xe02c('0x24')]);_0x10d067[_0xe02c('0x26')]=qs[_0xe02c('0x26')](_0x28755a[_0xe02c('0x3c')][_0xe02c('0x26')]);}return _0xd0d895[_0xe02c('0x79')](_0x10d067);}})[_0xe02c('0x2d')](function(_0xfe0b1c){if(_0xfe0b1c){return _0xfe0b1c?{'count':_0x567478,'rows':_0xfe0b1c}:null;}})[_0xe02c('0x2d')](respondWithResult(_0x3c44d3,null))[_0xe02c('0x51')](handleError(_0x3c44d3,null));};exports['getTeams']=function(_0x283de9,_0x4cfbc0,_0x3650cb){var _0xdc8df0={};var _0x4564f1={};var _0x2c6d29;var _0x5b75ed;return db[_0xe02c('0x37')][_0xe02c('0x7c')]({'where':{'id':_0x283de9[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](handleEntityNotFound(_0x4cfbc0,null))[_0xe02c('0x2d')](function(_0xced62f){if(_0xced62f){_0x2c6d29=_0xced62f;_0x4564f1[_0xe02c('0x3a')]=_['keys'](db[_0xe02c('0x7d')][_0xe02c('0x38')]);_0x4564f1['query']=_[_0xe02c('0x3b')](_0x283de9['query']);_0x4564f1['filters']=_[_0xe02c('0x3e')](_0x4564f1[_0xe02c('0x3a')],_0x4564f1[_0xe02c('0x3c')]);_0xdc8df0[_0xe02c('0x3f')]=_['intersection'](_0x4564f1['model'],qs[_0xe02c('0x40')](_0x283de9[_0xe02c('0x3c')]['fields']));_0xdc8df0[_0xe02c('0x3f')]=_0xdc8df0[_0xe02c('0x3f')][_0xe02c('0x4f')]?_0xdc8df0[_0xe02c('0x3f')]:_0x4564f1[_0xe02c('0x3a')];_0xdc8df0[_0xe02c('0x43')]=qs['sort'](_0x283de9[_0xe02c('0x3c')][_0xe02c('0x44')]);_0xdc8df0[_0xe02c('0x46')]=qs[_0xe02c('0x3d')](_[_0xe02c('0x7b')](_0x283de9[_0xe02c('0x3c')],_0x4564f1[_0xe02c('0x3d')]));if(_0x283de9[_0xe02c('0x3c')][_0xe02c('0x45')]){_0xdc8df0[_0xe02c('0x46')]=_[_0xe02c('0x47')](_0xdc8df0[_0xe02c('0x46')],{'$or':_[_0xe02c('0x36')](_0xdc8df0[_0xe02c('0x3f')],function(_0x5c4ed7){var _0x1abb2d={};_0x1abb2d[_0x5c4ed7]={'$like':'%'+_0x283de9[_0xe02c('0x3c')][_0xe02c('0x45')]+'%'};return _0x1abb2d;})});}_0xdc8df0=_['merge']({},_0xdc8df0,_0x283de9[_0xe02c('0x48')]);return _0x2c6d29[_0xe02c('0x7e')](_0xdc8df0);}})[_0xe02c('0x2d')](function(_0x2127e7){if(_0x2127e7){_0x5b75ed=_0x2127e7[_0xe02c('0x4f')];if(!_0x283de9[_0xe02c('0x3c')][_0xe02c('0x41')]('nolimit')){_0xdc8df0[_0xe02c('0x24')]=qs[_0xe02c('0x24')](_0x283de9[_0xe02c('0x3c')][_0xe02c('0x24')]);_0xdc8df0[_0xe02c('0x26')]=qs[_0xe02c('0x26')](_0x283de9[_0xe02c('0x3c')][_0xe02c('0x26')]);}return _0x2c6d29[_0xe02c('0x7e')](_0xdc8df0);}})['then'](function(_0x4297b2){if(_0x4297b2){return _0x4297b2?{'count':_0x5b75ed,'rows':_0x4297b2}:null;}})[_0xe02c('0x2d')](respondWithResult(_0x4cfbc0,null))['catch'](handleError(_0x4cfbc0,null));};exports[_0xe02c('0x7f')]=function(_0x4081f5,_0x1d23ed,_0x46fd38){var _0x7cd9df=_0x4081f5[_0xe02c('0x53')]['ids'];var _0xc21958;return db[_0xe02c('0x7d')][_0xe02c('0x4b')]({'where':{'id':_0x7cd9df},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xe02c('0x33'),_0xe02c('0x80'),_0xe02c('0x81'),'interface'],'raw':!![]}]})[_0xe02c('0x2d')](function(_0x35b30c){if(_0x35b30c){_0xc21958=_0x35b30c;var _0x469eac=_[_0xe02c('0x82')](_0x35b30c,function(_0x7441e6){var _0x56e35d=_0x7441e6[_0xe02c('0x2e')]({'plain':!![]});return _0x56e35d[_0xe02c('0x83')];});return db[_0xe02c('0x37')][_0xe02c('0x50')]({'where':{'id':_0x4081f5[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](function(_0x327507){return db[_0xe02c('0x52')][_0xe02c('0x6f')](function(_0x2ee007){return _0x327507[_0xe02c('0x7f')](_0x7cd9df,{'transaction':_0x2ee007})[_0xe02c('0x2d')](function(){return BPromise[_0xe02c('0x84')](_0xc21958,function(_0x1de725){return db[_0xe02c('0x85')][_0xe02c('0x86')]({'TeamId':_0x1de725['id'],'VoicePrefixId':_0x4081f5[_0xe02c('0x4e')]['id']},{'transaction':_0x2ee007});});})['then'](function(){return BPromise['each'](_0x469eac,function(_0x4400b2){return db['UserVoicePrefix']['findOrCreate']({'where':{'UserId':_0x4400b2['id'],'VoicePrefixId':_0x4081f5['params']['id']},'transaction':_0x2ee007});});})[_0xe02c('0x2d')](function(){_0x469eac[_0xe02c('0x87')](function(_0x889cef){socket['emit'](_0xe02c('0x76'),{'UserId':_0x889cef['id'],'VoicePrefixId':_0x327507['id']});});});});});}})['then'](respondWithStatusCode(_0x1d23ed,null))['catch'](handleError(_0x1d23ed,null));};exports[_0xe02c('0x88')]=function(_0x3ca665,_0x4eb163,_0x1433bd){return db['Team']['findAll']({'where':{'id':_0x3ca665[_0xe02c('0x3c')][_0xe02c('0x72')]},'attributes':['id'],'include':[{'model':db[_0xe02c('0x7a')],'as':_0xe02c('0x83'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4eb163,null))[_0xe02c('0x2d')](function(_0x25933f){var _0x323d81=_[_0xe02c('0x36')](_0x25933f,'id');var _0x3b6e15=[];var _0x1c96cc=[];var _0x322b4a=squel[_0xe02c('0x89')]();_0x322b4a[_0xe02c('0x8a')](_0xe02c('0x8b'))[_0xe02c('0x8c')](_0xe02c('0x8d'),'tq')[_0xe02c('0x8e')](_0xe02c('0x8f'),'ut',_0xe02c('0x90'))[_0xe02c('0x46')](_0xe02c('0x91'),_0x3ca665['params']['id']);for(var _0x252f5f=0x0;_0x252f5f<_0x25933f[_0xe02c('0x4f')];_0x252f5f+=0x1){let _0x4d112d=_0x25933f[_0x252f5f];for(var _0x3e0961=0x0;_0x3e0961<_0x4d112d[_0xe02c('0x83')][_0xe02c('0x4f')];_0x3e0961+=0x1){let _0x4b7886=_0x4d112d[_0xe02c('0x83')][_0x3e0961];var _0x505074=_0x322b4a[_0xe02c('0x92')]();_0x505074['where'](_0xe02c('0x93'),_0x4b7886['id']);_0x1c96cc[_0xe02c('0x68')](db[_0xe02c('0x52')][_0xe02c('0x3c')](_0x505074[_0xe02c('0x94')](),{'type':db['sequelize'][_0xe02c('0x95')]['SELECT']})[_0xe02c('0x2d')](function(_0x47d3fa){if(_0x47d3fa[_0xe02c('0x4f')]===0x1){return _0x4b7886['id'];}else{var _0x534002=_[_0xe02c('0x96')](_[_0xe02c('0x36')](_0x47d3fa,_0xe02c('0x97')),function(_0x45c425){return _[_0xe02c('0x98')](_0x323d81,_0x45c425);});if(_0x534002){return _0x4b7886['id'];}}}));}}return BPromise['all'](_0x1c96cc)['then'](function(_0x27ea6e){_0x3b6e15=_(_0x3b6e15)[_0xe02c('0x99')](_0x27ea6e)[_0xe02c('0x9a')]()[_0xe02c('0x9b')]();return db[_0xe02c('0x37')]['find']({'where':{'id':_0x3ca665[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](function(_0x34b426){return db['sequelize'][_0xe02c('0x6f')](function(_0x2a8e1d){return _0x34b426[_0xe02c('0x88')](_0x3ca665[_0xe02c('0x3c')][_0xe02c('0x72')],{'transaction':_0x2a8e1d})[_0xe02c('0x2d')](function(){if(!_['isEmpty'](_0x3b6e15)){return _0x34b426['removeAgents'](_0x3b6e15,{'transaction':_0x2a8e1d});}})[_0xe02c('0x2d')](function(){_0x3b6e15[_0xe02c('0x87')](function(_0x4b9fb7){socket['emit']('userVoicePrefix:remove',{'UserId':_0x4b9fb7,'VoicePrefixId':_0x34b426['id']});});});});});});})['then'](respondWithStatusCode(_0x4eb163,null))[_0xe02c('0x51')](handleError(_0x4eb163,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 677e4bd..827e5f6 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 _0x63d9=['VoicePrefix','save','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x5e515a,_0x5d40e7){var _0x350bcd=function(_0x196cdf){while(--_0x196cdf){_0x5e515a['push'](_0x5e515a['shift']());}};_0x350bcd(++_0x5d40e7);}(_0x63d9,0xc9));var _0x963d=function(_0x18d143,_0x47a1a0){_0x18d143=_0x18d143-0x0;var _0x622498=_0x63d9[_0x18d143];return _0x622498;};'use strict';var EventEmitter=require(_0x963d('0x0'));var VoicePrefix=require(_0x963d('0x1'))['db'][_0x963d('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x963d('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1e1300){return function(_0x1deb65,_0x18d636,_0x1fe2e2){VoicePrefixEvents[_0x963d('0x4')](_0x1e1300+':'+_0x1deb65['id'],_0x1deb65);VoicePrefixEvents[_0x963d('0x4')](_0x1e1300,_0x1deb65);_0x1fe2e2(null);};}for(var e in events){if(events[_0x963d('0x5')](e)){var event=events[e];VoicePrefix[_0x963d('0x6')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0xbcd1=['setMaxListeners','save','remove','emit','hasOwnProperty','../../mysqldb','VoicePrefix'];(function(_0x4408d5,_0x42c1ab){var _0x22c585=function(_0x23020e){while(--_0x23020e){_0x4408d5['push'](_0x4408d5['shift']());}};_0x22c585(++_0x42c1ab);}(_0xbcd1,0x171));var _0x1bcd=function(_0x57fcd6,_0x70b457){_0x57fcd6=_0x57fcd6-0x0;var _0x5b6c73=_0xbcd1[_0x57fcd6];return _0x5b6c73;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x1bcd('0x0'))['db'][_0x1bcd('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x1bcd('0x2')](0x0);var events={'afterCreate':_0x1bcd('0x3'),'afterUpdate':'update','afterDestroy':_0x1bcd('0x4')};function emitEvent(_0x22e013){return function(_0x277389,_0x1a145f,_0x7ea934){VoicePrefixEvents[_0x1bcd('0x5')](_0x22e013+':'+_0x277389['id'],_0x277389);VoicePrefixEvents[_0x1bcd('0x5')](_0x22e013,_0x277389);_0x7ea934(null);};}for(var e in events){if(events[_0x1bcd('0x6')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index a388afb..c0db094 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 _0x4fca=['request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3f1248,_0x158a90){var _0x3a8eee=function(_0x4998be){while(--_0x4998be){_0x3f1248['push'](_0x3f1248['shift']());}};_0x3a8eee(++_0x158a90);}(_0x4fca,0x166));var _0xa4fc=function(_0x61be6,_0x120537){_0x61be6=_0x61be6-0x0;var _0x10e994=_0x4fca[_0x61be6];return _0x10e994;};'use strict';var _=require(_0xa4fc('0x0'));var util=require(_0xa4fc('0x1'));var logger=require(_0xa4fc('0x2'))(_0xa4fc('0x3'));var moment=require(_0xa4fc('0x4'));var BPromise=require(_0xa4fc('0x5'));var rp=require(_0xa4fc('0x6'));var fs=require('fs');var path=require(_0xa4fc('0x7'));var rimraf=require(_0xa4fc('0x8'));var config=require(_0xa4fc('0x9'));var attributes=require(_0xa4fc('0xa'));module[_0xa4fc('0xb')]=function(_0x110628,_0x43c88f){return _0x110628[_0xa4fc('0xc')](_0xa4fc('0xd'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb631=['exports','VoicePrefix','voice_prefixes','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4bb1b3,_0x446a44){var _0x6b3651=function(_0x1f0a7b){while(--_0x1f0a7b){_0x4bb1b3['push'](_0x4bb1b3['shift']());}};_0x6b3651(++_0x446a44);}(_0xb631,0x15f));var _0x1b63=function(_0xb00fe9,_0x22109e){_0xb00fe9=_0xb00fe9-0x0;var _0x271d1a=_0xb631[_0xb00fe9];return _0x271d1a;};'use strict';var _=require('lodash');var util=require(_0x1b63('0x0'));var logger=require(_0x1b63('0x1'))(_0x1b63('0x2'));var moment=require(_0x1b63('0x3'));var BPromise=require(_0x1b63('0x4'));var rp=require(_0x1b63('0x5'));var fs=require('fs');var path=require(_0x1b63('0x6'));var rimraf=require(_0x1b63('0x7'));var config=require(_0x1b63('0x8'));var attributes=require('./voicePrefix.attributes');module[_0x1b63('0x9')]=function(_0x4bb97a,_0x30d33b){return _0x4bb97a['define'](_0x1b63('0xa'),attributes,{'tableName':_0x1b63('0xb'),'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 3c3a4ac..0fdc665 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 _0xbb8d=['./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x2eafe2,_0x2f3aba){var _0x259112=function(_0xc2f396){while(--_0xc2f396){_0x2eafe2['push'](_0x2eafe2['shift']());}};_0x259112(++_0x2f3aba);}(_0xbb8d,0x146));var _0xdbb8=function(_0x3f6a27,_0x171508){_0x3f6a27=_0x3f6a27-0x0;var _0x496be8=_0xbb8d[_0x3f6a27];return _0x496be8;};'use strict';var _=require(_0xdbb8('0x0'));var util=require('util');var moment=require(_0xdbb8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdbb8('0x2'))['db'];var utils=require(_0xdbb8('0x3'));var logger=require(_0xdbb8('0x4'))(_0xdbb8('0x5'));var config=require(_0xdbb8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdbb8('0x7')][_0xdbb8('0x8')]({'port':0x232a});config[_0xdbb8('0x9')]=_[_0xdbb8('0xa')](config['redis'],{'host':_0xdbb8('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdbb8('0x9')]));require(_0xdbb8('0xc'))['register'](socket);function respondWithRpcPromise(_0x419cf4,_0x3e0aa5,_0x45c7af){return new BPromise(function(_0x3113b8,_0x2eb417){return client[_0xdbb8('0xd')](_0x419cf4,_0x45c7af)[_0xdbb8('0xe')](function(_0x2b2be9){logger[_0xdbb8('0xf')](_0xdbb8('0x10'),_0x3e0aa5,'request\x20sent');logger[_0xdbb8('0x11')](_0xdbb8('0x12'),_0x3e0aa5,_0xdbb8('0x13'),JSON[_0xdbb8('0x14')](_0x2b2be9));if(_0x2b2be9[_0xdbb8('0x15')]){if(_0x2b2be9[_0xdbb8('0x15')][_0xdbb8('0x16')]===0x1f4){logger[_0xdbb8('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x3e0aa5,_0x2b2be9[_0xdbb8('0x15')]['message']);return _0x2eb417(_0x2b2be9[_0xdbb8('0x15')][_0xdbb8('0x17')]);}logger[_0xdbb8('0x15')](_0xdbb8('0x10'),_0x3e0aa5,_0x2b2be9[_0xdbb8('0x15')]['message']);return _0x3113b8(_0x2b2be9[_0xdbb8('0x15')]['message']);}else{logger['info'](_0xdbb8('0x10'),_0x3e0aa5,'request\x20sent');_0x3113b8(_0x2b2be9[_0xdbb8('0x18')][_0xdbb8('0x17')]);}})[_0xdbb8('0x19')](function(_0xbfba8a){logger[_0xdbb8('0x15')](_0xdbb8('0x10'),_0x3e0aa5,_0xbfba8a);_0x2eb417(_0xbfba8a);});});} \ No newline at end of file +var _0xd9ce=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xb6c029,_0x289717){var _0x369954=function(_0xf20e69){while(--_0xf20e69){_0xb6c029['push'](_0xb6c029['shift']());}};_0x369954(++_0x289717);}(_0xd9ce,0xeb));var _0xed9c=function(_0x565faf,_0x5f3718){_0x565faf=_0x565faf-0x0;var _0x42292f=_0xd9ce[_0x565faf];return _0x42292f;};'use strict';var _=require(_0xed9c('0x0'));var util=require(_0xed9c('0x1'));var moment=require(_0xed9c('0x2'));var BPromise=require(_0xed9c('0x3'));var rs=require(_0xed9c('0x4'));var fs=require('fs');var Redis=require(_0xed9c('0x5'));var db=require(_0xed9c('0x6'))['db'];var utils=require(_0xed9c('0x7'));var logger=require('../../config/logger')(_0xed9c('0x8'));var config=require(_0xed9c('0x9'));var jayson=require(_0xed9c('0xa'));var client=jayson[_0xed9c('0xb')][_0xed9c('0xc')]({'port':0x232a});config[_0xed9c('0xd')]=_['defaults'](config[_0xed9c('0xd')],{'host':_0xed9c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xed9c('0xf'))['register'](socket);function respondWithRpcPromise(_0x2a61eb,_0x12471a,_0xd11a6){return new BPromise(function(_0x7f112a,_0x5e3385){return client[_0xed9c('0x10')](_0x2a61eb,_0xd11a6)[_0xed9c('0x11')](function(_0x103137){logger[_0xed9c('0x12')](_0xed9c('0x13'),_0x12471a,'request\x20sent');logger['debug'](_0xed9c('0x14'),_0x12471a,_0xed9c('0x15'),JSON[_0xed9c('0x16')](_0x103137));if(_0x103137[_0xed9c('0x17')]){if(_0x103137['error']['code']===0x1f4){logger[_0xed9c('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x12471a,_0x103137[_0xed9c('0x17')][_0xed9c('0x18')]);return _0x5e3385(_0x103137[_0xed9c('0x17')][_0xed9c('0x18')]);}logger[_0xed9c('0x17')](_0xed9c('0x13'),_0x12471a,_0x103137[_0xed9c('0x17')]['message']);return _0x7f112a(_0x103137[_0xed9c('0x17')][_0xed9c('0x18')]);}else{logger[_0xed9c('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x12471a,_0xed9c('0x15'));_0x7f112a(_0x103137[_0xed9c('0x19')]['message']);}})[_0xed9c('0x1a')](function(_0x465bec){logger[_0xed9c('0x17')](_0xed9c('0x13'),_0x12471a,_0x465bec);_0x5e3385(_0x465bec);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 7b7745e..bdc3bbd 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 _0xc698=['update','emit','register','length','voicePrefix:','./voicePrefix.events','save','remove'];(function(_0x5948dd,_0x1f6ac8){var _0xb1f8be=function(_0x31a8d2){while(--_0x31a8d2){_0x5948dd['push'](_0x5948dd['shift']());}};_0xb1f8be(++_0x1f6ac8);}(_0xc698,0x85));var _0x8c69=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xc698[_0x3ce3c];return _0x55a2c9;};'use strict';var VoicePrefixEvents=require(_0x8c69('0x0'));var events=[_0x8c69('0x1'),_0x8c69('0x2'),_0x8c69('0x3')];function createListener(_0x3ecc28,_0x4ed5d2){return function(_0x5d804c){_0x4ed5d2[_0x8c69('0x4')](_0x3ecc28,_0x5d804c);};}function removeListener(_0x55386c,_0x1b1dae){return function(){VoicePrefixEvents['removeListener'](_0x55386c,_0x1b1dae);};}exports[_0x8c69('0x5')]=function(_0x5e8069){for(var _0x5c0109=0x0,_0x350620=events[_0x8c69('0x6')];_0x5c0109<_0x350620;_0x5c0109++){var _0x434e14=events[_0x5c0109];var _0x20a688=createListener(_0x8c69('0x7')+_0x434e14,_0x5e8069);VoicePrefixEvents['on'](_0x434e14,_0x20a688);}}; \ No newline at end of file +var _0x6b61=['update','emit','register','length','voicePrefix:','./voicePrefix.events','remove'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x6b61,0x16a));var _0x16b6=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x6b61[_0xbca1b1];return _0x4e1686;};'use strict';var VoicePrefixEvents=require(_0x16b6('0x0'));var events=['save',_0x16b6('0x1'),_0x16b6('0x2')];function createListener(_0xbeab11,_0x2f73f2){return function(_0xffc401){_0x2f73f2[_0x16b6('0x3')](_0xbeab11,_0xffc401);};}function removeListener(_0x213f9e,_0x12ffdd){return function(){VoicePrefixEvents['removeListener'](_0x213f9e,_0x12ffdd);};}exports[_0x16b6('0x4')]=function(_0x173c5d){for(var _0x594a8f=0x0,_0x3d06d6=events[_0x16b6('0x5')];_0x594a8f<_0x3d06d6;_0x594a8f++){var _0x59552d=events[_0x594a8f];var _0x460269=createListener(_0x16b6('0x6')+_0x59552d,_0x173c5d);VoicePrefixEvents['on'](_0x59552d,_0x460269);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index d8dd76e..ec4d1fa 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(_0x250ce7,_0x502ad3){var _0x416428=function(_0x46564d){while(--_0x46564d){_0x250ce7['push'](_0x250ce7['shift']());}};_0x416428(++_0x502ad3);}(_0xb10b,0x12a));var _0xbb10=function(_0x29b2d0,_0x73bf4b){_0x29b2d0=_0x29b2d0-0x0;var _0x4af937=_0xb10b[_0x29b2d0];return _0x4af937;};'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(_0x501c92,_0x4c52d8){var _0x519828=function(_0x40308d){while(--_0x40308d){_0x501c92['push'](_0x501c92['shift']());}};_0x519828(++_0x4c52d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 752cdad..2ea775e 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 _0xbc95=['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\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\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)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','ringall','leastrecent','random','linear','wrandom','setDataValue','strategy','rrmemory','type','getDataValue','dialMethod','outbound','roundrobin','includes','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','power','predictive','booked','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'];(function(_0x311e99,_0x40ff5e){var _0x19a1a6=function(_0x3b5eb0){while(--_0x3b5eb0){_0x311e99['push'](_0x311e99['shift']());}};_0x19a1a6(++_0x40ff5e);}(_0xbc95,0xc4));var _0x5bc9=function(_0x327199,_0x1283db){_0x327199=_0x327199-0x0;var _0x5a7cf0=_0xbc95[_0x327199];return _0x5a7cf0;};'use strict';var Sequelize=require(_0x5bc9('0x0'));module[_0x5bc9('0x1')]={'name':{'type':Sequelize[_0x5bc9('0x2')],'allowNull':![],'unique':_0x5bc9('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x5'),'outbound'),'allowNull':![],'defaultValue':_0x5bc9('0x5')},'musiconhold':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x5bc9('0x4')]('rr',_0x5bc9('0x6'),_0x5bc9('0x7'),'fewestcalls',_0x5bc9('0x8'),'rrmemory',_0x5bc9('0x9'),_0x5bc9('0xa'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x48d763){this[_0x5bc9('0xb')](_0x5bc9('0xc'),_0x48d763?_0x48d763:_0x5bc9('0xd'));},'get':function(){var _0x48ae56=this['getDataValue'](_0x5bc9('0xe'));var _0x2c64c3=this[_0x5bc9('0xf')](_0x5bc9('0x10'));var _0xc0a15e=this['getDataValue'](_0x5bc9('0xc'));if(_0x48ae56===_0x5bc9('0x11')){if(_0x2c64c3==='preview'){return null;}if(_0x2c64c3==='booked'&&![_0x5bc9('0xd'),_0x5bc9('0x12')][_0x5bc9('0x13')](_0xc0a15e)){this[_0x5bc9('0xb')](_0x5bc9('0xc'),'rrmemory');}}return _0xc0a15e;}},'servicelevel':{'type':Sequelize[_0x5bc9('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x5bc9('0x14')](0xb)},'timeout':{'type':Sequelize[_0x5bc9('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x5bc9('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x5bc9('0x2')]},'weight':{'type':Sequelize[_0x5bc9('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x15'),'no'),'defaultValue':_0x5bc9('0x15')},'autopause':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x15'),'no',_0x5bc9('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x5bc9('0x14')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x5bc9('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x5bc9('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x5bc9('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x5bc9('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x5bc9('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x5bc9('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x5bc9('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x5bc9('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x5bc9('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x5bc9('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x15'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM'](_0x5bc9('0x15'),'no',_0x5bc9('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0x5bc9('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x5bc9('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x5bc9('0x2')]},'queue_youarenext':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x5bc9('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x5bc9('0x2')]},'queue_quantity1':{'type':Sequelize[_0x5bc9('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x5bc9('0x2')]},'periodic_announce':{'type':Sequelize[_0x5bc9('0x18')],'set':function(_0x37b8cd){this['setDataValue'](_0x5bc9('0x19'),_0x37b8cd?_0x37b8cd[_0x5bc9('0x1a')](','):[]);},'get':function(){return this['getDataValue'](_0x5bc9('0x19'))?this[_0x5bc9('0xf')](_0x5bc9('0x19'))[_0x5bc9('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':_0x5bc9('0x15'),'set':function(_0x37a40a){this[_0x5bc9('0xb')]('joinempty',_0x37a40a?_0x37a40a['join'](','):undefined);},'get':function(){return this[_0x5bc9('0xf')]('joinempty')?this['getDataValue']('joinempty')[_0x5bc9('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':'no','set':function(_0x2e7772){this['setDataValue']('leavewhenempty',_0x2e7772?_0x2e7772[_0x5bc9('0x1a')](','):undefined);},'get':function(){return this[_0x5bc9('0xf')](_0x5bc9('0x1c'))?this[_0x5bc9('0xf')]('leavewhenempty')[_0x5bc9('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x5bc9('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x5bc9('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x5bc9('0x2')]},'description':{'type':Sequelize[_0x5bc9('0x2')]},'acw':{'type':Sequelize[_0x5bc9('0x1d')],'defaultValue':0x0,'set':function(_0x1498b5){this['setDataValue'](_0x5bc9('0x1e'),_0x1498b5);if(_0x1498b5){if(this[_0x5bc9('0xf')](_0x5bc9('0x1f'))<0x2){this[_0x5bc9('0xb')](_0x5bc9('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x5bc9('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x5bc9('0x1d')],'defaultValue':0x0,'comment':_0x5bc9('0x20')},'dialMethod':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x21'),_0x5bc9('0x22'),_0x5bc9('0x23'),_0x5bc9('0x24'),_0x5bc9('0x25')),'defaultValue':_0x5bc9('0x22'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x5bc9('0x14')](0x4)[_0x5bc9('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5bc9('0x27')},'dialLimitQueue':{'type':Sequelize[_0x5bc9('0x14')](0x4)[_0x5bc9('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x5bc9('0x28')](0x2)[_0x5bc9('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x5bc9('0x29'),'dropRate'),'defaultValue':'dropRate','comment':_0x5bc9('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x5bc9('0x28')](0x2)[_0x5bc9('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x5bc9('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x5bc9('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5bc9('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':_0x5bc9('0x2c'),'comment':_0x5bc9('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0x5bc9('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x5bc9('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5bc9('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5bc9('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5bc9('0x14')](0x5)[_0x5bc9('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5bc9('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x5bc9('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5bc9('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5bc9('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5bc9('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'defaultValue':0x3,'comment':_0x5bc9('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5bc9('0x14')](0x5)[_0x5bc9('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5bc9('0x34')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5bc9('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5bc9('0x35')},'dialTimezone':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x5bc9('0x36')},'dialPrefix':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x37'),_0x5bc9('0x38'),_0x5bc9('0x39')),'defaultValue':_0x5bc9('0x37')},'dialAMDActive':{'type':Sequelize[_0x5bc9('0x1d')],'defaultValue':0x0,'comment':_0x5bc9('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x5bc9('0x14')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x5bc9('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5bc9('0x14')](0x9)[_0x5bc9('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5bc9('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5bc9('0x14')](0x9)[_0x5bc9('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5bc9('0x3c')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x5bc9('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5bc9('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5bc9('0x14')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5bc9('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x5bc9('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5bc9('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5bc9('0x14')](0x5)[_0x5bc9('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5bc9('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5bc9('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5bc9('0x41')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x5bc9('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x5bc9('0x42')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5bc9('0x43')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x5bc9('0x44'),_0x5bc9('0x45')),'defaultValue':_0x5bc9('0x44')},'dialQueueProject2':{'type':Sequelize[_0x5bc9('0x2')],'comment':_0x5bc9('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x5bc9('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5bc9('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5bc9('0x46')},'dialCutDigit':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5bc9('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5bc9('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5bc9('0x14')](0x5)[_0x5bc9('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5bc9('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5bc9('0x49')},'dialDropRetryFrequency':{'type':Sequelize[_0x5bc9('0x14')](0x5)[_0x5bc9('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5bc9('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5bc9('0x14')](0x5)[_0x5bc9('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x5bc9('0x14')](0x5)[_0x5bc9('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5bc9('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5bc9('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5bc9('0x14')](0x5)[_0x5bc9('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5bc9('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5bc9('0x14')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5bc9('0x1d')],'defaultValue':![],'comment':_0x5bc9('0x4e'),'set':function(_0x306df0){if(!_0x306df0)this[_0x5bc9('0xb')]('mandatoryDispositionPauseId',null);this[_0x5bc9('0xb')](_0x5bc9('0x4f'),_0x306df0);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x5bc9('0x1d')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x1d70=['Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#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','mandatoryDisposition','STRING','name','ENUM','inbound','ringall','leastrecent','fewestcalls','random','rrordered','setDataValue','rrmemory','type','getDataValue','strategy','includes','INTEGER','yes','all','once','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','preview','progressive','power','booked','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length'];(function(_0x33aad9,_0x32e987){var _0x191058=function(_0x13a230){while(--_0x13a230){_0x33aad9['push'](_0x33aad9['shift']());}};_0x191058(++_0x32e987);}(_0x1d70,0xf7));var _0x01d7=function(_0x59c278,_0x3d6d80){_0x59c278=_0x59c278-0x0;var _0x3bc355=_0x1d70[_0x59c278];return _0x3bc355;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x01d7('0x0')],'allowNull':![],'unique':_0x01d7('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x01d7('0x2')](_0x01d7('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x01d7('0x3')},'musiconhold':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':''},'strategy':{'type':Sequelize[_0x01d7('0x2')]('rr',_0x01d7('0x4'),_0x01d7('0x5'),_0x01d7('0x6'),_0x01d7('0x7'),'rrmemory','linear','wrandom',_0x01d7('0x8')),'allowNull':![],'defaultValue':_0x01d7('0x4'),'set':function(_0x2f06c7){this[_0x01d7('0x9')]('strategy',_0x2f06c7?_0x2f06c7:_0x01d7('0xa'));},'get':function(){var _0x5a4803=this['getDataValue'](_0x01d7('0xb'));var _0x1563a2=this[_0x01d7('0xc')]('dialMethod');var _0xaf8478=this[_0x01d7('0xc')](_0x01d7('0xd'));if(_0x5a4803==='outbound'){if(_0x1563a2==='preview'){return null;}if(_0x1563a2==='booked'&&![_0x01d7('0xa'),'roundrobin'][_0x01d7('0xe')](_0xaf8478)){this[_0x01d7('0x9')](_0x01d7('0xd'),_0x01d7('0xa'));}}return _0xaf8478;}},'servicelevel':{'type':Sequelize[_0x01d7('0xf')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x01d7('0xf')](0xb)},'timeout':{'type':Sequelize[_0x01d7('0xf')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x01d7('0xf')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x01d7('0x0')]},'weight':{'type':Sequelize[_0x01d7('0xf')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x01d7('0xf')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x01d7('0x10'),'no'),'defaultValue':_0x01d7('0x10')},'autopause':{'type':Sequelize[_0x01d7('0x2')](_0x01d7('0x10'),'no',_0x01d7('0x11')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x01d7('0x2')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x01d7('0x2')](_0x01d7('0x10'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x01d7('0xf')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x01d7('0x2')](_0x01d7('0x10'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x01d7('0x2')](_0x01d7('0x10'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x01d7('0x0')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x01d7('0xf')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x01d7('0xf')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x01d7('0xf')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x01d7('0x2')]('yes','no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x01d7('0x2')](_0x01d7('0x10'),'no',_0x01d7('0x12')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x01d7('0x10'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x01d7('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x01d7('0x0')]},'queue_youarenext':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x01d7('0x0')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x01d7('0x0')]},'queue_quantity2':{'type':Sequelize[_0x01d7('0x0')]},'queue_periodic_announce':{'type':Sequelize[_0x01d7('0x0')]},'queue_less_than':{'type':Sequelize[_0x01d7('0x0')]},'periodic_announce':{'type':Sequelize[_0x01d7('0x13')],'set':function(_0x4c33e7){this[_0x01d7('0x9')]('periodic_announce',_0x4c33e7?_0x4c33e7[_0x01d7('0x14')](','):[]);},'get':function(){return this['getDataValue'](_0x01d7('0x15'))?this[_0x01d7('0xc')](_0x01d7('0x15'))[_0x01d7('0x16')](','):[];}},'joinempty':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':_0x01d7('0x10'),'set':function(_0x5e00fa){this['setDataValue'](_0x01d7('0x17'),_0x5e00fa?_0x5e00fa['join'](','):undefined);},'get':function(){return this[_0x01d7('0xc')](_0x01d7('0x17'))?this[_0x01d7('0xc')](_0x01d7('0x17'))[_0x01d7('0x16')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':'no','set':function(_0x412435){this[_0x01d7('0x9')](_0x01d7('0x18'),_0x412435?_0x412435[_0x01d7('0x14')](','):undefined);},'get':function(){return this[_0x01d7('0xc')]('leavewhenempty')?this[_0x01d7('0xc')]('leavewhenempty')[_0x01d7('0x16')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x01d7('0x10'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x01d7('0x2')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x01d7('0xf')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x01d7('0x2')](_0x01d7('0x10'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x01d7('0x0')]},'acw':{'type':Sequelize[_0x01d7('0x19')],'defaultValue':0x0,'set':function(_0x57be83){this[_0x01d7('0x9')]('acw',_0x57be83);if(_0x57be83){if(this['getDataValue'](_0x01d7('0x1a'))<0x2){this[_0x01d7('0x9')](_0x01d7('0x1a'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x01d7('0xf')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x01d7('0x2')](_0x01d7('0x1b'),_0x01d7('0x1c'),_0x01d7('0x1d'),'predictive',_0x01d7('0x1e')),'defaultValue':_0x01d7('0x1c'),'comment':_0x01d7('0x1f')},'dialLimitChannel':{'type':Sequelize[_0x01d7('0xf')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x01d7('0x20')},'dialLimitQueue':{'type':Sequelize[_0x01d7('0xf')](0x4)[_0x01d7('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x01d7('0x22')},'dialPowerLevel':{'type':Sequelize[_0x01d7('0x23')](0x2)[_0x01d7('0x21')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x01d7('0x24')},'dialPredictiveOptimization':{'type':Sequelize[_0x01d7('0x2')]('agentBusyFactor',_0x01d7('0x25')),'defaultValue':'dropRate','comment':_0x01d7('0x26')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x01d7('0x23')](0x2)[_0x01d7('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x01d7('0x27')},'dialPredictiveInterval':{'type':Sequelize[_0x01d7('0xf')](0x3)[_0x01d7('0x21')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x01d7('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x01d7('0xf')](0x3)[_0x01d7('0x21')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x01d7('0x28')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x01d7('0x29'),'comment':_0x01d7('0x2a')},'dialQueueTimeout':{'type':Sequelize[_0x01d7('0xf')](0x3)[_0x01d7('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x01d7('0x2b')},'dialQueueProject':{'type':Sequelize[_0x01d7('0x0')],'comment':_0x01d7('0x2c')},'dialCongestionMaxRetry':{'type':Sequelize[_0x01d7('0xf')](0x3)[_0x01d7('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x01d7('0x2d')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x01d7('0x2e')},'dialBusyMaxRetry':{'type':Sequelize[_0x01d7('0xf')](0x3)[_0x01d7('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x01d7('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize[_0x01d7('0xf')](0x5)[_0x01d7('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x01d7('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x01d7('0x21')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x01d7('0xf')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x01d7('0x31')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':_0x01d7('0x32')},'dialPrefix':{'type':Sequelize[_0x01d7('0x0')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x01d7('0x2')]('always',_0x01d7('0x33'),_0x01d7('0x34')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x01d7('0x19')],'defaultValue':0x0,'comment':_0x01d7('0x35')},'dialAMDInitialSilence':{'type':Sequelize[_0x01d7('0xf')](0x9)[_0x01d7('0x21')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x01d7('0x36')},'dialAMDGreeting':{'type':Sequelize[_0x01d7('0xf')](0x9)[_0x01d7('0x21')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x01d7('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x01d7('0xf')](0x9)[_0x01d7('0x21')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x01d7('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x01d7('0xf')](0x9)[_0x01d7('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x01d7('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0x01d7('0xf')](0x9)[_0x01d7('0x21')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x01d7('0xf')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x01d7('0x3a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x01d7('0xf')](0x9)[_0x01d7('0x21')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x01d7('0xf')](0x5)[_0x01d7('0x21')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x01d7('0x3b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x01d7('0xf')](0x9)[_0x01d7('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x01d7('0x3c')},'dialRecallMeTimeout':{'type':Sequelize[_0x01d7('0xf')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x01d7('0x19')],'defaultValue':0x0,'comment':_0x01d7('0x3d')},'dialOrderByScheduledAt':{'type':Sequelize[_0x01d7('0x2')](_0x01d7('0x3e'),'ASC'),'defaultValue':_0x01d7('0x3e')},'dialQueueProject2':{'type':Sequelize[_0x01d7('0x0')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x01d7('0x19')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x01d7('0xf')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x01d7('0x3f')},'dialCutDigit':{'type':Sequelize[_0x01d7('0xf')](0x3)[_0x01d7('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x01d7('0x40')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x01d7('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x01d7('0x41')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x01d7('0xf')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x01d7('0xf')](0x3)[_0x01d7('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x01d7('0x42')},'dialDropRetryFrequency':{'type':Sequelize[_0x01d7('0xf')](0x5)[_0x01d7('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x01d7('0x43')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x01d7('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x01d7('0x44')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x01d7('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x01d7('0x45')},'dialMachineMaxRetry':{'type':Sequelize[_0x01d7('0xf')](0x3)[_0x01d7('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x01d7('0xf')](0x5)[_0x01d7('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x01d7('0x46')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x01d7('0x47')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x01d7('0xf')](0x5)[_0x01d7('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x01d7('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x01d7('0xf')],'allowNull':!![],'comment':_0x01d7('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x01d7('0x19')],'defaultValue':![],'comment':_0x01d7('0x4a'),'set':function(_0x428085){if(!_0x428085)this[_0x01d7('0x9')](_0x01d7('0x4b'),null);this[_0x01d7('0x9')](_0x01d7('0x4c'),_0x428085);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x01d7('0xf')](0x3)[_0x01d7('0x21')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x01d7('0xf')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x01d7('0x19')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x01d7('0xf')](0x3)[_0x01d7('0x21')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x01d7('0x19')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 54db0da..aa027e7 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 _0x326f=['VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','ListId\x20=\x20?','cm_hopper_additional_phones','h.id','ci.item','cm_contact_has_items','h.ContactId=ci.CmContactId','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','json','offset','undefined','limit','set','reject','save','destroy','then','VoiceQueues','inbound','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','error','send','index','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','VoiceQueue','findAll','rows','catch','params','includeAll','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','QueueCampaigns','userProfileId','clone','options','omit','updatedAt','UserProfileSection','update','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','online','voicePause','interface','flatMap','Agents','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','format','SIP/%s','forEach','emit','userVoiceQueue:save','ids','User','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','union','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','UserVoiceQueueRt','isNil','all','isArray','getAgents','getMembers','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','createdAt','toString','ListId','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','COALESCE(calleridnum,\x27\x27)','cm_hopper_final'];(function(_0x42d489,_0x10f9d1){var _0x5ddf43=function(_0x5071b8){while(--_0x5071b8){_0x42d489['push'](_0x42d489['shift']());}};_0x5ddf43(++_0x10f9d1);}(_0x326f,0xd1));var _0xf326=function(_0x281973,_0x1ed20b){_0x281973=_0x281973-0x0;var _0xf5241e=_0x326f[_0x281973];return _0xf5241e;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];config[_0xf326('0x17')]=_[_0xf326('0x18')](config['redis'],{'host':_0xf326('0x19'),'port':0x18eb});var socket=require(_0xf326('0x1a'))(new Redis(config[_0xf326('0x17')]));require(_0xf326('0x1b'))['register'](socket);function respondWithStatusCode(_0x45c1b6,_0x5204ee){_0x5204ee=_0x5204ee||0xcc;return function(_0x54bd1a){if(_0x54bd1a){return _0x45c1b6[_0xf326('0x1c')](_0x5204ee);}return _0x45c1b6[_0xf326('0x1d')](_0x5204ee)[_0xf326('0x1e')]();};}function respondWithResult(_0xa63d1a,_0x292f4b){_0x292f4b=_0x292f4b||0xc8;return function(_0x287a2a){if(_0x287a2a){return _0xa63d1a[_0xf326('0x1d')](_0x292f4b)[_0xf326('0x1f')](_0x287a2a);}};}function respondWithFilteredResult(_0x5a682a,_0x3ad7da){return function(_0x453100){if(_0x453100){var _0x18bee3=typeof _0x3ad7da[_0xf326('0x20')]===_0xf326('0x21')&&typeof _0x3ad7da[_0xf326('0x22')]==='undefined';var _0x4a5b6c=_0x453100['count'];var _0x16e605=_0x18bee3?0x0:_0x3ad7da[_0xf326('0x20')];var _0x484cbe=_0x18bee3?_0x453100['count']:_0x3ad7da[_0xf326('0x20')]+_0x3ad7da['limit'];var _0x5b6d3c;if(_0x484cbe>=_0x4a5b6c){_0x484cbe=_0x4a5b6c;_0x5b6d3c=0xc8;}else{_0x5b6d3c=0xce;}_0x5a682a[_0xf326('0x1d')](_0x5b6d3c);return _0x5a682a[_0xf326('0x23')]('Content-Range',_0x16e605+'-'+_0x484cbe+'/'+_0x4a5b6c)['json'](_0x453100);}return null;};}function patchUpdates(_0x19b8ba){return function(_0xb1efcf){try{jsonpatch['apply'](_0xb1efcf,_0x19b8ba,!![]);}catch(_0x337ed5){return BPromise[_0xf326('0x24')](_0x337ed5);}return _0xb1efcf[_0xf326('0x25')]();};}function saveUpdates(_0x295752,_0x17c157){return function(_0x2049ec){if(_0x2049ec){return _0x2049ec['update'](_0x295752)['then'](function(_0x4f31f6){return _0x4f31f6;});}return null;};}function removeEntity(_0x520d85,_0x1a2c4e){return function(_0x2cd45a){if(_0x2cd45a){return _0x2cd45a[_0xf326('0x26')]()[_0xf326('0x27')](function(){var _0x410237=_0x2cd45a['get']({'plain':!![]});var _0x201d28=[{'name':_0xf326('0x28'),'value':_0xf326('0x29'),'ignore':![]},{'name':'QueueCampaigns','value':_0xf326('0x2a'),'ignore':![]}];var _0x55ad0f=_(_0x201d28)['filter'](_0xf326('0x2b'))[_0xf326('0x2c')](_0xf326('0x2d'))['value']();if(_[_0xf326('0x2e')](_0x55ad0f,_0x410237[_0xf326('0x2f')])){return;}var _0x55790d=_[_0xf326('0x30')](_0x201d28,[_0xf326('0x2d'),_0x410237[_0xf326('0x2f')]])[_0xf326('0x31')];return db[_0xf326('0x32')][_0xf326('0x26')]({'where':{'type':_0x55790d,'resourceId':_0x410237['id']}})[_0xf326('0x27')](function(){return _0x2cd45a;});})[_0xf326('0x27')](function(){_0x520d85[_0xf326('0x1d')](0xcc)[_0xf326('0x1e')]();});}};}function handleEntityNotFound(_0x4b52f2,_0x1035ed){return function(_0x424104){if(!_0x424104){_0x4b52f2[_0xf326('0x1c')](0x194);}return _0x424104;};}function handleError(_0x4792d2,_0x2c0cac){_0x2c0cac=_0x2c0cac||0x1f4;return function(_0x1721fd){logger[_0xf326('0x33')](_0x1721fd['stack']);if(_0x1721fd['name']){delete _0x1721fd[_0xf326('0x31')];}_0x4792d2[_0xf326('0x1d')](_0x2c0cac)[_0xf326('0x34')](_0x1721fd);};}exports[_0xf326('0x35')]=function(_0x30694f,_0x2e8a64){var _0x62585a={},_0x2d5f20={},_0x580374={'count':0x0,'rows':[]};var _0x461e93=_[_0xf326('0x2c')](db['VoiceQueue'][_0xf326('0x36')],function(_0x4e5d7c){return{'name':_0x4e5d7c[_0xf326('0x37')],'type':_0x4e5d7c['type']['key']};});_0x2d5f20[_0xf326('0x38')]=_['map'](_0x461e93,_0xf326('0x31'));_0x2d5f20['query']=_[_0xf326('0x39')](_0x30694f[_0xf326('0x3a')]);_0x2d5f20[_0xf326('0x3b')]=_['intersection'](_0x2d5f20[_0xf326('0x38')],_0x2d5f20[_0xf326('0x3a')]);_0x62585a['attributes']=_[_0xf326('0x3c')](_0x2d5f20[_0xf326('0x38')],qs[_0xf326('0x3d')](_0x30694f[_0xf326('0x3a')]['fields']));_0x62585a[_0xf326('0x3e')]=_0x62585a[_0xf326('0x3e')][_0xf326('0x3f')]?_0x62585a[_0xf326('0x3e')]:_0x2d5f20[_0xf326('0x38')];if(!_0x30694f['query'][_0xf326('0x40')](_0xf326('0x41'))){_0x62585a['limit']=qs['limit'](_0x30694f[_0xf326('0x3a')]['limit']);_0x62585a['offset']=qs[_0xf326('0x20')](_0x30694f['query'][_0xf326('0x20')]);}_0x62585a[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x30694f[_0xf326('0x3a')]['sort']);_0x62585a[_0xf326('0x44')]=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0x30694f[_0xf326('0x3a')],_0x2d5f20[_0xf326('0x3b')]),_0x461e93);if(_0x30694f[_0xf326('0x3a')][_0xf326('0x46')]){_0x62585a[_0xf326('0x44')]=_[_0xf326('0x47')](_0x62585a[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0x461e93,function(_0x2bab13){if(_0x2bab13['type']!==_0xf326('0x48')){var _0x1637dc={};_0x1637dc[_0x2bab13[_0xf326('0x31')]]={'$like':'%'+_0x30694f[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x1637dc;}})});}_0x62585a=_[_0xf326('0x47')]({},_0x62585a,_0x30694f['options']);var _0x28e2d3={'where':_0x62585a[_0xf326('0x44')]};return db['VoiceQueue'][_0xf326('0x49')](_0x28e2d3)[_0xf326('0x27')](function(_0x130c56){_0x580374[_0xf326('0x49')]=_0x130c56;if(_0x30694f[_0xf326('0x3a')]['includeAll']){_0x62585a['include']=[{'all':!![]}];}return db[_0xf326('0x4a')][_0xf326('0x4b')](_0x62585a);})['then'](function(_0x4bd865){_0x580374[_0xf326('0x4c')]=_0x4bd865;return _0x580374;})[_0xf326('0x27')](respondWithFilteredResult(_0x2e8a64,_0x62585a))[_0xf326('0x4d')](handleError(_0x2e8a64,null));};exports['show']=function(_0x301e65,_0xe96e1e){var _0x2180d6={'raw':![],'where':{'id':_0x301e65[_0xf326('0x4e')]['id']}},_0xc43507={};_0xc43507[_0xf326('0x38')]=_[_0xf326('0x39')](db[_0xf326('0x4a')][_0xf326('0x36')]);_0xc43507[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x301e65[_0xf326('0x3a')]);_0xc43507[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0xc43507[_0xf326('0x38')],_0xc43507['query']);_0x2180d6[_0xf326('0x3e')]=_[_0xf326('0x3c')](_0xc43507[_0xf326('0x38')],qs[_0xf326('0x3d')](_0x301e65['query'][_0xf326('0x3d')]));_0x2180d6[_0xf326('0x3e')]=_0x2180d6[_0xf326('0x3e')][_0xf326('0x3f')]?_0x2180d6['attributes']:_0xc43507[_0xf326('0x38')];if(_0x301e65[_0xf326('0x3a')][_0xf326('0x4f')]){_0x2180d6[_0xf326('0x50')]=[{'all':!![]}];}_0x2180d6=_[_0xf326('0x47')]({},_0x2180d6,_0x301e65['options']);return db['VoiceQueue'][_0xf326('0x30')](_0x2180d6)[_0xf326('0x27')](handleEntityNotFound(_0xe96e1e,null))[_0xf326('0x27')](respondWithResult(_0xe96e1e,null))['catch'](handleError(_0xe96e1e,null));};exports[_0xf326('0x51')]=function(_0x4650db,_0x44eab7){return db['VoiceQueue']['create'](_0x4650db[_0xf326('0x52')],{})['then'](function(_0x1cf58f){var _0x554277=_0x4650db[_0xf326('0x53')][_0xf326('0x54')]({'plain':!![]});if(!_0x554277)throw new Error(_0xf326('0x55'));if(_0x554277[_0xf326('0x56')]===_0xf326('0x53')){var _0x35d3c8=_0x1cf58f[_0xf326('0x54')]({'plain':!![]});var _0x495a16=[{'name':_0xf326('0x28'),'value':_0xf326('0x29')},{'name':_0xf326('0x57'),'value':'outbound'}];var _0x208ba4=_[_0xf326('0x30')](_0x495a16,[_0xf326('0x2d'),_0x35d3c8[_0xf326('0x2f')]])[_0xf326('0x31')];return db['UserProfileSection'][_0xf326('0x30')]({'where':{'name':_0x208ba4,'userProfileId':_0x554277[_0xf326('0x58')]},'raw':!![]})[_0xf326('0x27')](function(_0x46a21f){if(_0x46a21f&&_0x46a21f['autoAssociation']===0x0){return db[_0xf326('0x32')][_0xf326('0x51')]({'name':_0x35d3c8[_0xf326('0x31')],'resourceId':_0x35d3c8['id'],'type':_0x46a21f[_0xf326('0x31')],'sectionId':_0x46a21f['id']},{})['then'](function(){return _0x1cf58f;});}else{return _0x1cf58f;}})['catch'](function(_0x18b46e){logger[_0xf326('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18b46e);throw _0x18b46e;});}return _0x1cf58f;})[_0xf326('0x27')](respondWithResult(_0x44eab7,0xc9))[_0xf326('0x4d')](handleError(_0x44eab7,null));};exports[_0xf326('0x59')]=function(_0x1258d1,_0x5765b0){var _0xb1c18c={'where':{'id':_0x1258d1['params']['id']}},_0x5657b7={};_0x5657b7[_0xf326('0x38')]=_['keys'](db[_0xf326('0x4a')][_0xf326('0x36')]);_0xb1c18c[_0xf326('0x3e')]=_['intersection'](_0x5657b7['model'],qs[_0xf326('0x3d')](_0x1258d1[_0xf326('0x3a')][_0xf326('0x3d')]));_0xb1c18c['attributes']=_0xb1c18c[_0xf326('0x3e')]['length']?_0xb1c18c[_0xf326('0x3e')]:_0x5657b7[_0xf326('0x38')];if(_0x1258d1[_0xf326('0x3a')][_0xf326('0x4f')]){_0xb1c18c[_0xf326('0x50')]=[{'all':!![]}];}_0xb1c18c=_[_0xf326('0x47')]({},_0xb1c18c,_0x1258d1[_0xf326('0x5a')]);return db[_0xf326('0x4a')][_0xf326('0x30')](_0xb1c18c)[_0xf326('0x27')](handleEntityNotFound(_0x5765b0,null))[_0xf326('0x27')](function(_0x1e56fb){if(_0x1e56fb){var _0x40f7cb=_0x1e56fb['get']({'plain':!![]});_0x40f7cb=qs[_0xf326('0x5b')](_0x40f7cb,['id','createdAt',_0xf326('0x5c')]);_0x1258d1[_0xf326('0x52')]=_['omit'](_0x1258d1[_0xf326('0x52')],['id','createdAt',_0xf326('0x5c')]);return db[_0xf326('0x4a')][_0xf326('0x51')](_[_0xf326('0x47')](_0x40f7cb,_0x1258d1[_0xf326('0x52')]),{'include':_0x1258d1['query']['includeAll']?[{'all':!![]}]:undefined})[_0xf326('0x27')](function(_0x32fe3a){var _0x15a538=_0x1258d1[_0xf326('0x53')][_0xf326('0x54')]({'plain':!![]});if(!_0x15a538)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15a538[_0xf326('0x56')]===_0xf326('0x53')){var _0x4aadc9=_0x32fe3a['get']({'plain':!![]});var _0x5b25ca=[{'name':_0xf326('0x28'),'value':_0xf326('0x29')},{'name':_0xf326('0x57'),'value':_0xf326('0x2a')}];var _0x240ce5=_[_0xf326('0x30')](_0x5b25ca,[_0xf326('0x2d'),_0x4aadc9['type']])[_0xf326('0x31')];return db[_0xf326('0x5d')][_0xf326('0x30')]({'where':{'name':_0x240ce5,'userProfileId':_0x15a538[_0xf326('0x58')]},'raw':!![]})['then'](function(_0x3717fe){if(_0x3717fe&&_0x3717fe['autoAssociation']===0x0){return db['UserProfileResource'][_0xf326('0x51')]({'name':_0x4aadc9['name'],'resourceId':_0x4aadc9['id'],'type':_0x3717fe[_0xf326('0x31')],'sectionId':_0x3717fe['id']},{})[_0xf326('0x27')](function(){return _0x32fe3a;});}else{return _0x32fe3a;}})[_0xf326('0x4d')](function(_0x2ea5a2){logger[_0xf326('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ea5a2);throw _0x2ea5a2;});}return _0x32fe3a;});}})['then'](respondWithResult(_0x5765b0,0xc9))['catch'](handleError(_0x5765b0,null));};exports[_0xf326('0x5e')]=function(_0x307441,_0x229a34){if(_0x307441[_0xf326('0x52')]['id']){delete _0x307441[_0xf326('0x52')]['id'];}return db['VoiceQueue'][_0xf326('0x30')]({'where':{'id':_0x307441[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x229a34,null))['then'](saveUpdates(_0x307441['body'],null))[_0xf326('0x27')](respondWithResult(_0x229a34,null))[_0xf326('0x4d')](handleError(_0x229a34,null));};exports['destroy']=function(_0x4bf1bf,_0x2497fd){return db['VoiceQueue'][_0xf326('0x30')]({'where':{'id':_0x4bf1bf['params']['id']}})['then'](handleEntityNotFound(_0x2497fd,null))['then'](removeEntity(_0x2497fd,null))[_0xf326('0x4d')](handleError(_0x2497fd,null));};exports[_0xf326('0x5f')]=function(_0xd44071,_0x4838d5,_0x1cf9a8){var _0xdeceb9={'raw':![],'where':{}};var _0x35e34d={};var _0x457f3d={'count':0x0,'rows':[]};return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0xd44071[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x4838d5,null))[_0xf326('0x27')](function(_0x5290da){if(_0x5290da){_0x35e34d[_0xf326('0x38')]=_['keys'](db[_0xf326('0x61')][_0xf326('0x36')]);_0x35e34d[_0xf326('0x3a')]=_['keys'](_0xd44071[_0xf326('0x3a')]);_0x35e34d[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x35e34d['model'],_0x35e34d[_0xf326('0x3a')]);_0xdeceb9[_0xf326('0x3e')]=_[_0xf326('0x3c')](_0x35e34d[_0xf326('0x38')],qs['fields'](_0xd44071[_0xf326('0x3a')]['fields']));_0xdeceb9['attributes']=_0xdeceb9[_0xf326('0x3e')][_0xf326('0x3f')]?_0xdeceb9['attributes']:_0x35e34d['model'];if(!_0xd44071['query'][_0xf326('0x40')]('nolimit')){_0xdeceb9[_0xf326('0x22')]=qs[_0xf326('0x22')](_0xd44071[_0xf326('0x3a')][_0xf326('0x22')]);_0xdeceb9[_0xf326('0x20')]=qs[_0xf326('0x20')](_0xd44071['query'][_0xf326('0x20')]);}_0xdeceb9[_0xf326('0x42')]=qs['sort'](_0xd44071['query'][_0xf326('0x43')]);_0xdeceb9['where']=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0xd44071[_0xf326('0x3a')],_0x35e34d[_0xf326('0x3b')]));_0xdeceb9[_0xf326('0x44')][_0xf326('0x62')]=_0x5290da['id'];if(_0xd44071[_0xf326('0x3a')][_0xf326('0x46')]){_0xdeceb9[_0xf326('0x44')]=_['merge'](_0xdeceb9[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0xdeceb9['attributes'],function(_0x3c82cf){var _0x5b0f2d={};_0x5b0f2d[_0x3c82cf]={'$like':'%'+_0xd44071[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x5b0f2d;})});}_0xdeceb9=_[_0xf326('0x47')]({},_0xdeceb9,_0xd44071['options']);return db[_0xf326('0x61')][_0xf326('0x49')]({'where':_0xdeceb9[_0xf326('0x44')]})[_0xf326('0x27')](function(_0x30e096){_0x457f3d[_0xf326('0x49')]=_0x30e096;if(_0xd44071[_0xf326('0x3a')][_0xf326('0x4f')]){_0xdeceb9[_0xf326('0x50')]=[{'all':!![]}];}return db[_0xf326('0x61')][_0xf326('0x4b')](_0xdeceb9);})[_0xf326('0x27')](function(_0x452e28){_0x457f3d[_0xf326('0x4c')]=_0x452e28;return _0x457f3d;});}})[_0xf326('0x27')](respondWithFilteredResult(_0x4838d5,_0xdeceb9))['catch'](handleError(_0x4838d5,null));};exports[_0xf326('0x63')]=function(_0x24aaca,_0x4829ae,_0x438daa){var _0x424be4={'raw':!![],'where':{}};var _0x5c1686={};var _0x80fce5={'count':0x0,'rows':[]};return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0x24aaca[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x4829ae,null))[_0xf326('0x27')](function(_0x1bb7cc){if(_0x1bb7cc){_0x5c1686['model']=_[_0xf326('0x39')](db[_0xf326('0x64')][_0xf326('0x36')]);_0x5c1686[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x24aaca[_0xf326('0x3a')]);_0x5c1686[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x5c1686['model'],_0x5c1686[_0xf326('0x3a')]);_0x424be4[_0xf326('0x3e')]=_['intersection'](_0x5c1686[_0xf326('0x38')],qs['fields'](_0x24aaca[_0xf326('0x3a')][_0xf326('0x3d')]));_0x424be4[_0xf326('0x3e')]=_0x424be4[_0xf326('0x3e')][_0xf326('0x3f')]?_0x424be4[_0xf326('0x3e')]:_0x5c1686[_0xf326('0x38')];if(!_0x24aaca[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x424be4[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x24aaca[_0xf326('0x3a')][_0xf326('0x22')]);_0x424be4['offset']=qs[_0xf326('0x20')](_0x24aaca[_0xf326('0x3a')][_0xf326('0x20')]);}_0x424be4[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x24aaca['query'][_0xf326('0x43')]);_0x424be4[_0xf326('0x44')]=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0x24aaca[_0xf326('0x3a')],_0x5c1686['filters']));_0x424be4['where'][_0xf326('0x62')]=_0x1bb7cc['id'];if(_0x24aaca['query'][_0xf326('0x46')]){_0x424be4[_0xf326('0x44')]=_[_0xf326('0x47')](_0x424be4['where'],{'$or':_['map'](_0x424be4[_0xf326('0x3e')],function(_0x2d92e4){var _0x167ac9={};_0x167ac9[_0x2d92e4]={'$like':'%'+_0x24aaca[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x167ac9;})});}_0x424be4=_['merge']({},_0x424be4,_0x24aaca[_0xf326('0x5a')]);return db[_0xf326('0x64')][_0xf326('0x49')]({'where':_0x424be4['where']})['then'](function(_0x47a35b){_0x80fce5[_0xf326('0x49')]=_0x47a35b;if(_0x24aaca[_0xf326('0x3a')][_0xf326('0x4f')]){_0x424be4[_0xf326('0x50')]=[{'all':!![]}];}return db[_0xf326('0x64')][_0xf326('0x4b')](_0x424be4);})[_0xf326('0x27')](function(_0x598a93){_0x80fce5['rows']=_0x598a93;return _0x80fce5;});}})[_0xf326('0x27')](respondWithFilteredResult(_0x4829ae,_0x424be4))[_0xf326('0x4d')](handleError(_0x4829ae,null));};exports[_0xf326('0x65')]=function(_0x571b8c,_0xd85b34,_0x39bdde){var _0x1746af={'raw':!![],'where':{}};var _0x597005={};var _0x39d16d={'count':0x0,'rows':[]};return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0x571b8c[_0xf326('0x4e')]['id']}})['then'](handleEntityNotFound(_0xd85b34,null))['then'](function(_0x5a7af3){if(_0x5a7af3){_0x597005[_0xf326('0x38')]=_[_0xf326('0x39')](db[_0xf326('0x66')]['rawAttributes']);_0x597005[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x571b8c[_0xf326('0x3a')]);_0x597005['filters']=_[_0xf326('0x3c')](_0x597005[_0xf326('0x38')],_0x597005[_0xf326('0x3a')]);_0x1746af[_0xf326('0x3e')]=_['intersection'](_0x597005[_0xf326('0x38')],qs['fields'](_0x571b8c[_0xf326('0x3a')][_0xf326('0x3d')]));_0x1746af[_0xf326('0x3e')]=_0x1746af[_0xf326('0x3e')]['length']?_0x1746af[_0xf326('0x3e')]:_0x597005['model'];if(!_0x571b8c[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x1746af[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x571b8c['query']['limit']);_0x1746af[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x571b8c[_0xf326('0x3a')][_0xf326('0x20')]);}_0x1746af['order']=qs[_0xf326('0x43')](_0x571b8c['query'][_0xf326('0x43')]);_0x1746af[_0xf326('0x44')]=qs[_0xf326('0x3b')](_['pick'](_0x571b8c[_0xf326('0x3a')],_0x597005[_0xf326('0x3b')]));_0x1746af[_0xf326('0x44')][_0xf326('0x62')]=_0x5a7af3['id'];if(_0x571b8c[_0xf326('0x3a')]['filter']){_0x1746af[_0xf326('0x44')]=_[_0xf326('0x47')](_0x1746af['where'],{'$or':_[_0xf326('0x2c')](_0x1746af[_0xf326('0x3e')],function(_0x306fc9){var _0x6dad26={};_0x6dad26[_0x306fc9]={'$like':'%'+_0x571b8c['query']['filter']+'%'};return _0x6dad26;})});}_0x1746af=_[_0xf326('0x47')]({},_0x1746af,_0x571b8c[_0xf326('0x5a')]);return db['CmHopperFinal'][_0xf326('0x49')]({'where':_0x1746af['where']})['then'](function(_0x4cad0){_0x39d16d[_0xf326('0x49')]=_0x4cad0;if(_0x571b8c[_0xf326('0x3a')][_0xf326('0x4f')]){_0x1746af[_0xf326('0x50')]=[{'all':!![]}];}return db[_0xf326('0x66')][_0xf326('0x4b')](_0x1746af);})[_0xf326('0x27')](function(_0xc9dead){_0x39d16d['rows']=_0xc9dead;return _0x39d16d;});}})[_0xf326('0x27')](respondWithFilteredResult(_0xd85b34,_0x1746af))[_0xf326('0x4d')](handleError(_0xd85b34,null));};exports[_0xf326('0x67')]=function(_0x1c7f81,_0x59d894,_0x3e6a5d){var _0x20020c={'raw':!![],'where':{}};var _0xc94723={};var _0x750d55={'count':0x0,'rows':[]};return db[_0xf326('0x4a')]['findOne']({'where':{'id':_0x1c7f81[_0xf326('0x4e')]['id']}})['then'](handleEntityNotFound(_0x59d894,null))[_0xf326('0x27')](function(_0x14d255){if(_0x14d255){_0xc94723[_0xf326('0x38')]=_[_0xf326('0x39')](db['CmHopperBlack'][_0xf326('0x36')]);_0xc94723[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x1c7f81['query']);_0xc94723[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0xc94723[_0xf326('0x38')],_0xc94723[_0xf326('0x3a')]);_0x20020c['attributes']=_[_0xf326('0x3c')](_0xc94723[_0xf326('0x38')],qs[_0xf326('0x3d')](_0x1c7f81[_0xf326('0x3a')]['fields']));_0x20020c[_0xf326('0x3e')]=_0x20020c[_0xf326('0x3e')][_0xf326('0x3f')]?_0x20020c['attributes']:_0xc94723[_0xf326('0x38')];if(!_0x1c7f81[_0xf326('0x3a')]['hasOwnProperty'](_0xf326('0x41'))){_0x20020c[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x1c7f81[_0xf326('0x3a')][_0xf326('0x22')]);_0x20020c[_0xf326('0x20')]=qs['offset'](_0x1c7f81['query'][_0xf326('0x20')]);}_0x20020c[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x1c7f81[_0xf326('0x3a')][_0xf326('0x43')]);_0x20020c[_0xf326('0x44')]=qs['filters'](_[_0xf326('0x45')](_0x1c7f81[_0xf326('0x3a')],_0xc94723[_0xf326('0x3b')]));_0x20020c[_0xf326('0x44')][_0xf326('0x62')]=_0x14d255['id'];if(_0x1c7f81[_0xf326('0x3a')][_0xf326('0x46')]){_0x20020c[_0xf326('0x44')]=_[_0xf326('0x47')](_0x20020c['where'],{'$or':_[_0xf326('0x2c')](_0x20020c['attributes'],function(_0x590dc0){var _0x32fc6e={};_0x32fc6e[_0x590dc0]={'$like':'%'+_0x1c7f81['query'][_0xf326('0x46')]+'%'};return _0x32fc6e;})});}_0x20020c=_[_0xf326('0x47')]({},_0x20020c,_0x1c7f81[_0xf326('0x5a')]);return db[_0xf326('0x68')][_0xf326('0x49')]({'where':_0x20020c[_0xf326('0x44')]})[_0xf326('0x27')](function(_0x18b3cc){_0x750d55[_0xf326('0x49')]=_0x18b3cc;if(_0x1c7f81[_0xf326('0x3a')][_0xf326('0x4f')]){_0x20020c[_0xf326('0x50')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xf326('0x4b')](_0x20020c);})[_0xf326('0x27')](function(_0x5657){_0x750d55[_0xf326('0x4c')]=_0x5657;return _0x750d55;});}})[_0xf326('0x27')](respondWithFilteredResult(_0x59d894,_0x20020c))[_0xf326('0x4d')](handleError(_0x59d894,null));};exports[_0xf326('0x69')]=function(_0x5429a2,_0x448d10,_0x15f799){var _0x320ab3={};var _0x316877={};var _0x79faa1;var _0x14259b;return db[_0xf326('0x4a')]['findOne']({'where':{'id':_0x5429a2[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x448d10,null))[_0xf326('0x27')](function(_0x9a0455){if(_0x9a0455){_0x79faa1=_0x9a0455;_0x316877[_0xf326('0x38')]=_[_0xf326('0x39')](db[_0xf326('0x6a')][_0xf326('0x36')]);_0x316877[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x5429a2[_0xf326('0x3a')]);_0x316877[_0xf326('0x3b')]=_['intersection'](_0x316877[_0xf326('0x38')],_0x316877[_0xf326('0x3a')]);_0x320ab3[_0xf326('0x3e')]=_['intersection'](_0x316877['model'],qs[_0xf326('0x3d')](_0x5429a2[_0xf326('0x3a')][_0xf326('0x3d')]));_0x320ab3[_0xf326('0x3e')]=_0x320ab3['attributes'][_0xf326('0x3f')]?_0x320ab3[_0xf326('0x3e')]:_0x316877[_0xf326('0x38')];_0x320ab3['order']=qs['sort'](_0x5429a2['query'][_0xf326('0x43')]);_0x320ab3[_0xf326('0x44')]=qs[_0xf326('0x3b')](_['pick'](_0x5429a2[_0xf326('0x3a')],_0x316877['filters']));if(_0x5429a2[_0xf326('0x3a')]['filter']){_0x320ab3[_0xf326('0x44')]=_[_0xf326('0x47')](_0x320ab3[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0x320ab3[_0xf326('0x3e')],function(_0x3dcaf9){var _0x1f05a2={};_0x1f05a2[_0x3dcaf9]={'$like':'%'+_0x5429a2[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x1f05a2;})});}_0x320ab3=_[_0xf326('0x47')]({},_0x320ab3,_0x5429a2[_0xf326('0x5a')]);return _0x79faa1[_0xf326('0x69')](_0x320ab3);}})[_0xf326('0x27')](function(_0x3dc3c5){if(_0x3dc3c5){_0x14259b=_0x3dc3c5['length'];if(!_0x5429a2[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x320ab3['limit']=qs['limit'](_0x5429a2['query'][_0xf326('0x22')]);_0x320ab3[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x5429a2[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x79faa1[_0xf326('0x69')](_0x320ab3);}})['then'](function(_0x1aeaf9){if(_0x1aeaf9){return _0x1aeaf9?{'count':_0x14259b,'rows':_0x1aeaf9}:null;}})[_0xf326('0x27')](respondWithResult(_0x448d10,null))[_0xf326('0x4d')](handleError(_0x448d10,null));};exports[_0xf326('0x6b')]=function(_0x71e344,_0x5cac48,_0x10f5cb){var _0x44c4bb=_0x71e344[_0xf326('0x52')][_0xf326('0x6c')];var _0x350d76=_['map'](_0x44c4bb,'id');return db['Team'][_0xf326('0x4b')]({'where':{'id':_0x350d76},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xf326('0x31'),_0xf326('0x6d'),_0xf326('0x6e'),_0xf326('0x6f')],'raw':!![]}]})[_0xf326('0x27')](function(_0x5aa1ca){if(_0x5aa1ca){var _0x51bfee=_[_0xf326('0x70')](_0x5aa1ca,function(_0x2eaf15){var _0x182080=_0x2eaf15['get']({'plain':!![]});_0x182080[_0xf326('0x71')]['forEach'](function(_0x4df691){_0x4df691['penalty']=_[_0xf326('0x30')](_0x44c4bb,{'id':_0x182080['id']})[_0xf326('0x72')];});return _0x182080[_0xf326('0x71')];});return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x71e344[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](function(_0x3833f9){return db[_0xf326('0x73')][_0xf326('0x74')](function(_0xb4b180){return _0x3833f9['addTeams'](_0x350d76,{'transaction':_0xb4b180})[_0xf326('0x27')](function(){return BPromise[_0xf326('0x75')](_0x44c4bb,function(_0x2a17bf){return db[_0xf326('0x76')][_0xf326('0x77')]({'TeamId':_0x2a17bf['id'],'VoiceQueueId':_0x71e344[_0xf326('0x4e')]['id'],'penalty':_0x2a17bf[_0xf326('0x72')]},{'transaction':_0xb4b180});});})[_0xf326('0x27')](function(){return BPromise[_0xf326('0x75')](_0x51bfee,function(_0x4d5f64){return db[_0xf326('0x78')][_0xf326('0x79')]({'where':{'UserId':_0x4d5f64['id'],'VoiceQueueId':_0x71e344[_0xf326('0x4e')]['id']},'defaults':{'penalty':_0x4d5f64['penalty']},'transaction':_0xb4b180});});})['then'](function(){return BPromise[_0xf326('0x75')](_[_0xf326('0x46')](_0x51bfee,{'online':!![]}),function(_0x5efac6){return db['UserVoiceQueueRt'][_0xf326('0x77')]({'membername':_0x5efac6['name'],'UserId':_0x5efac6['id'],'queue_name':_0x3833f9[_0xf326('0x31')],'VoiceQueueId':_0x3833f9['id'],'interface':_['isNil'](_0x5efac6[_0xf326('0x6f')])?util[_0xf326('0x7a')](_0xf326('0x7b'),_0x5efac6[_0xf326('0x31')]):_0x5efac6[_0xf326('0x6f')],'paused':_0x5efac6['voicePause']||![],'penalty':_0x5efac6[_0xf326('0x72')]},{'transaction':_0xb4b180});});})['then'](function(){_0x51bfee[_0xf326('0x7c')](function(_0x3fe546){socket[_0xf326('0x7d')](_0xf326('0x7e'),{'UserId':_0x3fe546['id'],'VoiceQueueId':_0x3833f9['id']});});});});});}})[_0xf326('0x27')](respondWithStatusCode(_0x5cac48,null))['catch'](handleError(_0x5cac48,null));};exports['removeTeams']=function(_0x1ad0df,_0x5c913c,_0x53421f){return db['Team']['findAll']({'where':{'id':_0x1ad0df[_0xf326('0x3a')][_0xf326('0x7f')]},'attributes':['id'],'include':[{'model':db[_0xf326('0x80')],'as':_0xf326('0x71'),'attributes':['id'],'raw':!![]}]})[_0xf326('0x27')](handleEntityNotFound(_0x5c913c,null))[_0xf326('0x27')](function(_0xc5d45e){var _0x4feb3e=_[_0xf326('0x2c')](_0xc5d45e,'id');var _0x3e0bf4=[];var _0x72c3ed=[];var _0x4abe8a=squel[_0xf326('0x81')]();_0x4abe8a[_0xf326('0x82')](_0xf326('0x83'))[_0xf326('0x84')](_0xf326('0x85'),'tq')[_0xf326('0x86')](_0xf326('0x87'),'ut',_0xf326('0x88'))[_0xf326('0x44')]('VoiceQueueId\x20=\x20?',_0x1ad0df[_0xf326('0x4e')]['id']);for(var _0x5e9650=0x0;_0x5e9650<_0xc5d45e[_0xf326('0x3f')];_0x5e9650+=0x1){let _0x500780=_0xc5d45e[_0x5e9650];for(var _0x4b537a=0x0;_0x4b537a<_0x500780[_0xf326('0x71')]['length'];_0x4b537a+=0x1){let _0x3edec1=_0x500780[_0xf326('0x71')][_0x4b537a];var _0x3dfa46=_0x4abe8a[_0xf326('0x59')]();_0x3dfa46['where'](_0xf326('0x89'),_0x3edec1['id']);_0x72c3ed[_0xf326('0x8a')](db[_0xf326('0x73')][_0xf326('0x3a')](_0x3dfa46['toString'](),{'type':db['sequelize'][_0xf326('0x8b')][_0xf326('0x8c')]})[_0xf326('0x27')](function(_0x160086){if(_0x160086[_0xf326('0x3f')]===0x1){return _0x3edec1['id'];}else{var _0x1acd3b=_[_0xf326('0x8d')](_[_0xf326('0x2c')](_0x160086,_0xf326('0x8e')),function(_0xa5963a){return _[_0xf326('0x2e')](_0x4feb3e,_0xa5963a);});if(_0x1acd3b){return _0x3edec1['id'];}}}));}}return BPromise['all'](_0x72c3ed)[_0xf326('0x27')](function(_0x303b42){_0x3e0bf4=_(_0x3e0bf4)[_0xf326('0x8f')](_0x303b42)['compact']()[_0xf326('0x2d')]();return db['VoiceQueue'][_0xf326('0x30')]({'where':{'id':_0x1ad0df[_0xf326('0x4e')]['id']}})['then'](function(_0x1b6d24){return db[_0xf326('0x73')][_0xf326('0x74')](function(_0x2d861a){return _0x1b6d24['removeTeams'](_0x1ad0df[_0xf326('0x3a')][_0xf326('0x7f')],{'transaction':_0x2d861a})[_0xf326('0x27')](function(){if(!_[_0xf326('0x90')](_0x3e0bf4)){return _0x1b6d24[_0xf326('0x91')](_0x3e0bf4,{'transaction':_0x2d861a})['then'](function(){return db['UserVoiceQueueRt'][_0xf326('0x26')]({'where':{'VoiceQueueId':_0x1ad0df[_0xf326('0x4e')]['id'],'UserId':_0x3e0bf4},'transaction':_0x2d861a});});}})[_0xf326('0x27')](function(){_0x3e0bf4[_0xf326('0x7c')](function(_0x42c8de){socket[_0xf326('0x7d')](_0xf326('0x92'),{'UserId':_0x42c8de,'VoiceQueueId':_0x1b6d24['id']});});});});});});})[_0xf326('0x27')](respondWithStatusCode(_0x5c913c,null))[_0xf326('0x4d')](handleError(_0x5c913c,null));};exports[_0xf326('0x93')]=function(_0x55d67f,_0x550bda,_0x4f14ff){var _0x8fccef,_0x190d3c;return db[_0xf326('0x4a')]['find']({'where':{'id':_0x55d67f[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x550bda,null))[_0xf326('0x27')](function(_0xc94f1e){if(_0xc94f1e){_0x190d3c=_0xc94f1e;return _0xc94f1e[_0xf326('0x93')](_0x55d67f[_0xf326('0x52')]['ids'],_[_0xf326('0x5b')](_0x55d67f['body'],['ids','id'])||{})[_0xf326('0x94')](function(_0x2a9fd1){for(var _0x4086fa=0x0;_0x4086fa<_0x55d67f[_0xf326('0x52')][_0xf326('0x7f')]['length'];_0x4086fa+=0x1){socket[_0xf326('0x7d')](_0xf326('0x7e'),{'UserId':Number(_0x55d67f[_0xf326('0x52')]['ids'][_0x4086fa]),'VoiceQueueId':Number(_0x55d67f[_0xf326('0x4e')]['id'])});}return _0x2a9fd1;});}})[_0xf326('0x27')](function(_0x38dbf3){_0x8fccef=_0x38dbf3||[];if(_0x190d3c){return db[_0xf326('0x80')]['findAll']({'where':{'id':_0x55d67f[_0xf326('0x52')]['ids']},'attributes':['id','name',_0xf326('0x6d'),'voicePause','interface'],'raw':!![]});}})[_0xf326('0x27')](function(_0xbd7671){if(!_[_0xf326('0x90')](_0xbd7671)){var _0x1d2611=[];for(var _0x497d2e=0x0;_0x497d2e<_0xbd7671['length'];_0x497d2e++){if(_0xbd7671[_0x497d2e][_0xf326('0x6d')]){_0x1d2611[_0xf326('0x8a')](db[_0xf326('0x95')][_0xf326('0x77')]({'membername':_0xbd7671[_0x497d2e][_0xf326('0x31')],'UserId':_0xbd7671[_0x497d2e]['id'],'queue_name':_0x190d3c[_0xf326('0x31')],'VoiceQueueId':_0x190d3c['id'],'interface':_[_0xf326('0x96')](_0xbd7671[_0x497d2e][_0xf326('0x6f')])?util[_0xf326('0x7a')]('SIP/%s',_0xbd7671[_0x497d2e][_0xf326('0x31')]):_0xbd7671[_0x497d2e][_0xf326('0x6f')],'paused':_0xbd7671[_0x497d2e][_0xf326('0x6e')]||![],'penalty':_0x55d67f['body']['penalty']||0x0}));}}return BPromise[_0xf326('0x97')](_0x1d2611);}})[_0xf326('0x27')](function(){return _0x8fccef;})[_0xf326('0x27')](respondWithResult(_0x550bda,null))[_0xf326('0x4d')](handleError(_0x550bda,null));};exports['removeAgents']=function(_0x4f96aa,_0x5ea5d4,_0x45aae6){return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x4f96aa['params']['id']}})['then'](handleEntityNotFound(_0x5ea5d4,null))[_0xf326('0x27')](function(_0x15c66f){if(_0x15c66f){return _0x15c66f[_0xf326('0x91')](_0x4f96aa['query']['ids'])['then'](function(){if(_[_0xf326('0x98')](_0x4f96aa[_0xf326('0x3a')][_0xf326('0x7f')])){for(var _0x1791dd=0x0;_0x1791dd<_0x4f96aa[_0xf326('0x3a')][_0xf326('0x7f')][_0xf326('0x3f')];_0x1791dd+=0x1){socket[_0xf326('0x7d')]('userVoiceQueue:remove',{'UserId':Number(_0x4f96aa['query'][_0xf326('0x7f')][_0x1791dd]),'VoiceQueueId':Number(_0x4f96aa['params']['id'])});}}else{socket['emit'](_0xf326('0x92'),{'UserId':Number(_0x4f96aa[_0xf326('0x3a')][_0xf326('0x7f')]),'VoiceQueueId':Number(_0x4f96aa[_0xf326('0x4e')]['id'])});}});}})[_0xf326('0x27')](function(_0x1307a4){return db[_0xf326('0x95')][_0xf326('0x26')]({'where':{'VoiceQueueId':_0x4f96aa[_0xf326('0x4e')]['id'],'UserId':_0x4f96aa[_0xf326('0x3a')][_0xf326('0x7f')]}})[_0xf326('0x27')](function(){return _0x1307a4;});})['then'](respondWithStatusCode(_0x5ea5d4,null))[_0xf326('0x4d')](handleError(_0x5ea5d4,null));};exports[_0xf326('0x99')]=function(_0x2b6585,_0x3d77af,_0x55e867){var _0x15e405={};var _0x27074a={};var _0x173ea9;var _0x130cbb;return db[_0xf326('0x4a')]['findOne']({'where':{'id':_0x2b6585[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x3d77af,null))[_0xf326('0x27')](function(_0x28d251){if(_0x28d251){_0x173ea9=_0x28d251;_0x27074a[_0xf326('0x38')]=_['keys'](db['User'][_0xf326('0x36')]);_0x27074a[_0xf326('0x3a')]=_['keys'](_0x2b6585[_0xf326('0x3a')]);_0x27074a[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x27074a[_0xf326('0x38')],_0x27074a['query']);_0x15e405[_0xf326('0x3e')]=_[_0xf326('0x3c')](_0x27074a['model'],qs[_0xf326('0x3d')](_0x2b6585[_0xf326('0x3a')][_0xf326('0x3d')]));_0x15e405[_0xf326('0x3e')]=_0x15e405[_0xf326('0x3e')][_0xf326('0x3f')]?_0x15e405[_0xf326('0x3e')]:_0x27074a[_0xf326('0x38')];_0x15e405[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x2b6585[_0xf326('0x3a')]['sort']);_0x15e405[_0xf326('0x44')]=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0x2b6585[_0xf326('0x3a')],_0x27074a[_0xf326('0x3b')]));if(_0x2b6585[_0xf326('0x3a')][_0xf326('0x46')]){_0x15e405[_0xf326('0x44')]=_['merge'](_0x15e405[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0x15e405[_0xf326('0x3e')],function(_0x12cc1d){var _0x5ae8c7={};_0x5ae8c7[_0x12cc1d]={'$like':'%'+_0x2b6585[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x5ae8c7;})});}_0x15e405=_[_0xf326('0x47')]({},_0x15e405,_0x2b6585['options']);return _0x173ea9[_0xf326('0x99')](_0x15e405);}})[_0xf326('0x27')](function(_0x5a0c11){if(_0x5a0c11){_0x130cbb=_0x5a0c11['length'];if(!_0x2b6585[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x15e405[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x2b6585[_0xf326('0x3a')][_0xf326('0x22')]);_0x15e405[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x2b6585[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x173ea9[_0xf326('0x99')](_0x15e405);}})[_0xf326('0x27')](function(_0x4a0a44){if(_0x4a0a44){return _0x4a0a44?{'count':_0x130cbb,'rows':_0x4a0a44}:null;}})['then'](respondWithResult(_0x3d77af,null))[_0xf326('0x4d')](handleError(_0x3d77af,null));};exports['getMembers']=function(_0x4ab9c0,_0x531d31,_0x878991){var _0xc4aa47={};var _0x4fa6f9={};var _0x17f967;var _0x1639f2;return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0x4ab9c0[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x531d31,null))['then'](function(_0x38ff4d){if(_0x38ff4d){_0x17f967=_0x38ff4d;_0x4fa6f9[_0xf326('0x38')]=_['keys'](db[_0xf326('0x95')][_0xf326('0x36')]);_0x4fa6f9[_0xf326('0x3a')]=_['keys'](_0x4ab9c0[_0xf326('0x3a')]);_0x4fa6f9[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x4fa6f9[_0xf326('0x38')],_0x4fa6f9[_0xf326('0x3a')]);_0xc4aa47['attributes']=_[_0xf326('0x3c')](_0x4fa6f9[_0xf326('0x38')],qs['fields'](_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x3d')]));_0xc4aa47[_0xf326('0x3e')]=_0xc4aa47['attributes']['length']?_0xc4aa47[_0xf326('0x3e')]:_0x4fa6f9[_0xf326('0x38')];_0xc4aa47['order']=qs[_0xf326('0x43')](_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x43')]);_0xc4aa47[_0xf326('0x44')]=qs['filters'](_['pick'](_0x4ab9c0[_0xf326('0x3a')],_0x4fa6f9[_0xf326('0x3b')]));if(_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x46')]){_0xc4aa47[_0xf326('0x44')]=_[_0xf326('0x47')](_0xc4aa47[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0xc4aa47['attributes'],function(_0x511e66){var _0x5d719a={};_0x5d719a[_0x511e66]={'$like':'%'+_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x5d719a;})});}_0xc4aa47=_[_0xf326('0x47')]({},_0xc4aa47,_0x4ab9c0['options']);return _0x17f967[_0xf326('0x9a')](_0xc4aa47);}})[_0xf326('0x27')](function(_0x30247a){if(_0x30247a){_0x1639f2=_0x30247a[_0xf326('0x3f')];if(!_0x4ab9c0['query']['hasOwnProperty'](_0xf326('0x41'))){_0xc4aa47[_0xf326('0x22')]=qs['limit'](_0x4ab9c0['query'][_0xf326('0x22')]);_0xc4aa47[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x17f967[_0xf326('0x9a')](_0xc4aa47);}})['then'](function(_0xb17fae){return _0xb17fae?{'count':_0x1639f2,'rows':_0xb17fae}:null;})[_0xf326('0x27')](respondWithResult(_0x531d31,null))['catch'](handleError(_0x531d31,null));};exports['getLists']=function(_0x371e52,_0x6a202f,_0x250682){var _0x4069bb={};var _0x1ea2be={};var _0x663019;var _0x2549ab;return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0x371e52[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x6a202f,null))[_0xf326('0x27')](function(_0x58fdca){if(_0x58fdca){_0x663019=_0x58fdca;_0x1ea2be[_0xf326('0x38')]=_[_0xf326('0x39')](db[_0xf326('0x9b')][_0xf326('0x36')]);_0x1ea2be['query']=_['keys'](_0x371e52[_0xf326('0x3a')]);_0x1ea2be['filters']=_[_0xf326('0x3c')](_0x1ea2be[_0xf326('0x38')],_0x1ea2be[_0xf326('0x3a')]);_0x4069bb['attributes']=_[_0xf326('0x3c')](_0x1ea2be['model'],qs['fields'](_0x371e52['query'][_0xf326('0x3d')]));_0x4069bb['attributes']=_0x4069bb[_0xf326('0x3e')][_0xf326('0x3f')]?_0x4069bb[_0xf326('0x3e')]:_0x1ea2be[_0xf326('0x38')];_0x4069bb[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x371e52[_0xf326('0x3a')]['sort']);_0x4069bb['where']=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0x371e52[_0xf326('0x3a')],_0x1ea2be[_0xf326('0x3b')]));if(_0x371e52[_0xf326('0x3a')][_0xf326('0x46')]){_0x4069bb['where']=_[_0xf326('0x47')](_0x4069bb['where'],{'$or':_[_0xf326('0x2c')](_0x4069bb[_0xf326('0x3e')],function(_0x5ba7ef){var _0x2671d5={};_0x2671d5[_0x5ba7ef]={'$like':'%'+_0x371e52[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x2671d5;})});}_0x4069bb=_[_0xf326('0x47')]({},_0x4069bb,_0x371e52[_0xf326('0x5a')]);return _0x663019[_0xf326('0x9c')](_0x4069bb);}})[_0xf326('0x27')](function(_0x55d9bd){if(_0x55d9bd){_0x2549ab=_0x55d9bd['length'];if(!_0x371e52[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x4069bb[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x371e52[_0xf326('0x3a')][_0xf326('0x22')]);_0x4069bb[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x371e52[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x663019[_0xf326('0x9c')](_0x4069bb);}})[_0xf326('0x27')](function(_0x4c88c2){if(_0x4c88c2){return _0x4c88c2?{'count':_0x2549ab,'rows':_0x4c88c2}:null;}})['then'](respondWithResult(_0x6a202f,null))['catch'](handleError(_0x6a202f,null));};exports[_0xf326('0x9d')]=function(_0x1af709,_0x3fdfc5,_0xf7df13){var _0x45afd7=moment()['format'](_0xf326('0x9e'));var _0x233857,_0xbc39f5;return db[_0xf326('0x4a')]['find']({'where':{'id':_0x1af709[_0xf326('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3fdfc5,null))[_0xf326('0x27')](function(_0xfa7c63){if(_0xfa7c63){_0xbc39f5=_0xfa7c63;return _0xfa7c63['addLists'](_0x1af709[_0xf326('0x52')][_0xf326('0x7f')],_['omit'](_0x1af709[_0xf326('0x52')],['ids','id'])||{});}return null;})[_0xf326('0x94')](function(_0x24dd16){var _0x4515c1;_0x233857=_0x24dd16||[];var _0x5100ec=[];if(_0x24dd16){for(var _0x293c16=0x0;_0x293c16<_0x24dd16[_0xf326('0x3f')];_0x293c16+=0x1){var _0x28ba7c=_0x24dd16[_0x293c16][_0xf326('0x54')]({'plain':!![]});_0xbc39f5['dialCheckDuplicateType']=_0x1af709[_0xf326('0x52')][_0xf326('0x9f')]?_0x1af709['body'][_0xf326('0x9f')]:_0xbc39f5['dialCheckDuplicateType'];switch(_0xbc39f5['dialCheckDuplicateType']){case _0xf326('0xa0'):_0x4515c1=squel[_0xf326('0xa1')]()[_0xf326('0xa2')]('cm_hopper')[_0xf326('0xa3')]([_0xf326('0xa4'),_0xf326('0xa5'),_0xf326('0xa6'),'ListId',_0xf326('0x62'),_0xf326('0xa7'),_0xf326('0x5c')],squel[_0xf326('0x81')]()[_0xf326('0x82')](_0xf326('0xa4'),'phone')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','scheduledAt')[_0xf326('0x82')]('id',_0xf326('0xa6'))[_0xf326('0x82')](_0x28ba7c['CmListId'][_0xf326('0xa8')](),_0xf326('0xa9'))['field'](_0x1af709['params']['id'][_0xf326('0xa8')](),_0xf326('0x62'))[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','createdAt')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','updatedAt')[_0xf326('0x84')](_0xf326('0xaa'))[_0xf326('0x44')](_0xf326('0xab'))[_0xf326('0x44')]('ListId\x20=\x20?',_0x28ba7c[_0xf326('0xac')][_0xf326('0xa8')]())[_0xf326('0x44')]('phone\x20IS\x20NOT\x20NULL')[_0xf326('0x44')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xf326('0x82')](_0xf326('0xad'))[_0xf326('0x84')](_0xf326('0xae'))[_0xf326('0x44')](_0xf326('0xaf'),_0x1af709['params']['id'][_0xf326('0xa8')]()))[_0xf326('0x44')](_0xf326('0xb0'),squel[_0xf326('0x81')]()[_0xf326('0x82')]('COALESCE(phone,\x27\x27)')[_0xf326('0x84')](_0xf326('0xb1'))[_0xf326('0x44')](_0xf326('0xaf'),_0x1af709[_0xf326('0x4e')]['id'][_0xf326('0xa8')]())))[_0xf326('0xa8')]();break;case _0xf326('0xb2'):_0x4515c1=squel[_0xf326('0xa1')]()[_0xf326('0xa2')]('cm_hopper')[_0xf326('0xa3')]([_0xf326('0xa4'),_0xf326('0xa5'),_0xf326('0xa6'),'ListId',_0xf326('0x62'),_0xf326('0xa7'),_0xf326('0x5c')],squel[_0xf326('0x81')]()[_0xf326('0x82')](_0xf326('0xa4'),_0xf326('0xa4'))[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','scheduledAt')[_0xf326('0x82')]('id',_0xf326('0xa6'))[_0xf326('0x82')](_0x28ba7c[_0xf326('0xac')]['toString'](),_0xf326('0xa9'))[_0xf326('0x82')](_0x1af709[_0xf326('0x4e')]['id'][_0xf326('0xa8')](),_0xf326('0x62'))['field']('\x27'+_0x45afd7+'\x27','createdAt')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27',_0xf326('0x5c'))[_0xf326('0x84')](_0xf326('0xaa'))['where'](_0xf326('0xab'))['where']('ListId\x20=\x20?',_0x28ba7c[_0xf326('0xac')][_0xf326('0xa8')]())[_0xf326('0x44')](_0xf326('0xb3'))[_0xf326('0x44')](_0xf326('0xb0'),squel['select']()[_0xf326('0x82')]('COALESCE(phone,\x27\x27)')[_0xf326('0x84')](_0xf326('0xb1'))[_0xf326('0x44')]('VoiceQueueId\x20=\x20?',_0x1af709['params']['id'][_0xf326('0xa8')]())))[_0xf326('0xa8')]();break;default:_0x4515c1=squel[_0xf326('0xa1')]()[_0xf326('0xa2')](_0xf326('0xb1'))[_0xf326('0xa3')]([_0xf326('0xa4'),_0xf326('0xa5'),_0xf326('0xa6'),'ListId',_0xf326('0x62'),_0xf326('0xa7'),_0xf326('0x5c')],squel[_0xf326('0x81')]()[_0xf326('0x82')]('phone',_0xf326('0xa4'))[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27',_0xf326('0xa5'))[_0xf326('0x82')]('id',_0xf326('0xa6'))['field'](_0x28ba7c[_0xf326('0xac')][_0xf326('0xa8')](),_0xf326('0xa9'))[_0xf326('0x82')](_0x1af709[_0xf326('0x4e')]['id'][_0xf326('0xa8')](),'VoiceQueueId')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','createdAt')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27',_0xf326('0x5c'))[_0xf326('0x84')](_0xf326('0xaa'))[_0xf326('0x44')](_0xf326('0xab'))['where'](_0xf326('0xb4'),_0x28ba7c[_0xf326('0xac')]['toString']())[_0xf326('0x44')](_0xf326('0xb3')))[_0xf326('0xa8')]();}_0x5100ec[_0xf326('0x8a')](db[_0xf326('0x73')][_0xf326('0x3a')](_0x4515c1));}return BPromise[_0xf326('0x97')](_0x5100ec);}})[_0xf326('0x27')](function(){var _0x122dfe=[];var _0x39a5f8=squel[_0xf326('0xa1')]()[_0xf326('0xa2')](_0xf326('0xb5'))[_0xf326('0xa3')](['CmHopperId',_0xf326('0xa4'),'OrderBy',_0xf326('0xa7'),'updatedAt'],squel[_0xf326('0x81')]()['field'](_0xf326('0xb6'))['field'](_0xf326('0xb7'))['field']('ci.OrderBy+1')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','createdAt')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27',_0xf326('0x5c'))[_0xf326('0x84')](_0xf326('0xb8'),'ci')[_0xf326('0x86')](_0xf326('0xb1'),'h',_0xf326('0xb9'))['where']('h.scheduledat=?',_0x45afd7)[_0xf326('0x44')]('ci.ItemClass=?','PHONE'))['toString']();_0x122dfe[_0xf326('0x8a')](db['sequelize']['query'](_0x39a5f8));return BPromise[_0xf326('0x97')](_0x122dfe);})[_0xf326('0x27')](function(){return _0x233857;})['then'](respondWithResult(_0x3fdfc5,null))[_0xf326('0x4d')](handleError(_0x3fdfc5,null));};exports[_0xf326('0xba')]=function(_0x38ee2f,_0x1ea221,_0x4136f9){return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x38ee2f[_0xf326('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1ea221,null))[_0xf326('0x27')](function(_0x424360){if(_0x424360){return _0x424360[_0xf326('0xba')](_0x38ee2f[_0xf326('0x3a')][_0xf326('0x7f')]);}})[_0xf326('0x27')](function(_0x35ff4d){if(_0x35ff4d){return db['CmHopper']['destroy']({'where':{'ListId':_0x38ee2f['query'][_0xf326('0x7f')],'VoiceQueueId':_0x38ee2f[_0xf326('0x4e')]['id']}})['then'](function(){return _0x35ff4d;});}})['then'](respondWithStatusCode(_0x1ea221,null))['catch'](handleError(_0x1ea221,null));};exports[_0xf326('0xbb')]=function(_0x1d05b3,_0x36d7c2,_0x1afa71){var _0x2a7789={};var _0x5b1d58={};var _0x5785c9;var _0x4ff3b8;return db[_0xf326('0x4a')]['findOne']({'where':{'id':_0x1d05b3['params']['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x36d7c2,null))[_0xf326('0x27')](function(_0x55e8e6){if(_0x55e8e6){_0x5785c9=_0x55e8e6;_0x5b1d58[_0xf326('0x38')]=_['keys'](db[_0xf326('0x9b')]['rawAttributes']);_0x5b1d58[_0xf326('0x3a')]=_['keys'](_0x1d05b3['query']);_0x5b1d58[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x5b1d58['model'],_0x5b1d58[_0xf326('0x3a')]);_0x2a7789[_0xf326('0x3e')]=_[_0xf326('0x3c')](_0x5b1d58[_0xf326('0x38')],qs[_0xf326('0x3d')](_0x1d05b3[_0xf326('0x3a')][_0xf326('0x3d')]));_0x2a7789[_0xf326('0x3e')]=_0x2a7789[_0xf326('0x3e')][_0xf326('0x3f')]?_0x2a7789['attributes']:_0x5b1d58[_0xf326('0x38')];_0x2a7789['order']=qs[_0xf326('0x43')](_0x1d05b3[_0xf326('0x3a')][_0xf326('0x43')]);_0x2a7789[_0xf326('0x44')]=qs['filters'](_[_0xf326('0x45')](_0x1d05b3[_0xf326('0x3a')],_0x5b1d58[_0xf326('0x3b')]));if(_0x1d05b3[_0xf326('0x3a')][_0xf326('0x46')]){_0x2a7789['where']=_['merge'](_0x2a7789['where'],{'$or':_[_0xf326('0x2c')](_0x2a7789['attributes'],function(_0x173bea){var _0x94eaa1={};_0x94eaa1[_0x173bea]={'$like':'%'+_0x1d05b3[_0xf326('0x3a')]['filter']+'%'};return _0x94eaa1;})});}_0x2a7789=_[_0xf326('0x47')]({},_0x2a7789,_0x1d05b3[_0xf326('0x5a')]);return _0x5785c9[_0xf326('0xbb')](_0x2a7789);}})['then'](function(_0x5387af){if(_0x5387af){_0x4ff3b8=_0x5387af[_0xf326('0x3f')];if(!_0x1d05b3[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x2a7789['limit']=qs[_0xf326('0x22')](_0x1d05b3[_0xf326('0x3a')][_0xf326('0x22')]);_0x2a7789[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x1d05b3[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x5785c9[_0xf326('0xbb')](_0x2a7789);}})[_0xf326('0x27')](function(_0x595e28){if(_0x595e28){return _0x595e28?{'count':_0x4ff3b8,'rows':_0x595e28}:null;}})['then'](respondWithResult(_0x36d7c2,null))[_0xf326('0x4d')](handleError(_0x36d7c2,null));};exports['addBlackLists']=function(_0x130b92,_0x1e7099,_0x47b04b){var _0x470e90,_0x5d9653;return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x130b92[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x1e7099,null))[_0xf326('0x27')](function(_0x13ba1a){if(_0x13ba1a){_0x5d9653=_0x13ba1a;return _0x13ba1a[_0xf326('0xbc')](_0x130b92['body'][_0xf326('0x7f')],_['omit'](_0x130b92['body'],['ids','id'])||{});}return null;})['spread'](function(_0xb6e17c){var _0x4d19ed;_0x470e90=_0xb6e17c||[];var _0x7c6644=[];if(_0xb6e17c){for(var _0x4eb5d3=0x0;_0x4eb5d3<_0xb6e17c[_0xf326('0x3f')];_0x4eb5d3+=0x1){var _0x4e2160=_0xb6e17c[_0x4eb5d3]['get']({'plain':!![]});_0x4d19ed=squel[_0xf326('0xa1')]()[_0xf326('0xa2')](_0xf326('0xbd'))[_0xf326('0xa3')](['phone',_0xf326('0xa6'),_0xf326('0xa9'),_0xf326('0x62'),_0xf326('0xa7'),'updatedAt'],squel['select']()['field']('phone',_0xf326('0xa4'))['field']('id','ContactId')[_0xf326('0x82')](_0x4e2160['CmListId']['toString'](),'ListId')[_0xf326('0x82')](_0x130b92['params']['id'][_0xf326('0xa8')](),'VoiceQueueId')[_0xf326('0x82')]('NOW()',_0xf326('0xa7'))[_0xf326('0x82')](_0xf326('0xbe'),_0xf326('0x5c'))['from'](_0xf326('0xaa'))[_0xf326('0x44')](_0xf326('0xab'))[_0xf326('0x44')](_0xf326('0xb4'),_0x4e2160[_0xf326('0xac')][_0xf326('0xa8')]())[_0xf326('0x44')](_0xf326('0xb3')))['toString']();_0x7c6644['push'](db[_0xf326('0x73')][_0xf326('0x3a')](_0x4d19ed));}return BPromise[_0xf326('0x97')](_0x7c6644);}})[_0xf326('0x27')](function(){return _0x470e90;})[_0xf326('0x27')](respondWithResult(_0x1e7099,null))['catch'](handleError(_0x1e7099,null));};exports[_0xf326('0xbf')]=function(_0x3e715a,_0x5d2dfa,_0x4fa725){return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x3e715a[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x5d2dfa,null))[_0xf326('0x27')](function(_0x4c3be5){if(_0x4c3be5){return _0x4c3be5['removeBlackLists'](_0x3e715a[_0xf326('0x3a')][_0xf326('0x7f')]);}})['then'](function(_0x53beb9){if(_0x53beb9){return db[_0xf326('0x68')]['destroy']({'where':{'ListId':_0x3e715a[_0xf326('0x3a')]['ids'],'VoiceQueueId':_0x3e715a[_0xf326('0x4e')]['id']}})['then'](function(){return _0x53beb9;});}})[_0xf326('0x27')](respondWithStatusCode(_0x5d2dfa,null))[_0xf326('0x4d')](handleError(_0x5d2dfa,null));}; \ No newline at end of file +var _0x79bf=['getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','Team','online','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','voicePause','userVoiceQueue:save','removeTeams','ids','User','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','push','SELECT','every','includes','compact','isEmpty','removeAgents','addAgents','spread','emit','all','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','into','cm_hopper','fromQuery','ContactId','ListId','phone','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','scheduledAt','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../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','./voiceQueue.socket','register','status','offset','limit','count','set','Content-Range','json','reject','save','update','then','VoiceQueues','inbound','QueueCampaigns','outbound','filter','map','value','type','name','UserProfileResource','destroy','end','sendStatus','send','index','VoiceQueue','fieldName','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','show','find','body','get','role','UserProfileSection','userProfileId','autoAssociation','create','rawAttributes','omit','createdAt','updatedAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getHoppers','findOne','CmHopper','getHopperHistories','VoiceQueueId','CmHopperHistory','getHopperFinals','CmHopperFinal'];(function(_0x263a79,_0x5b8f0b){var _0x4f4abe=function(_0x4a5d4b){while(--_0x4a5d4b){_0x263a79['push'](_0x263a79['shift']());}};_0x4f4abe(++_0x5b8f0b);}(_0x79bf,0x1df));var _0xf79b=function(_0x3e4566,_0x1e02e2){_0x3e4566=_0x3e4566-0x0;var _0x2eb60f=_0x79bf[_0x3e4566];return _0x2eb60f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf79b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf79b('0x1'));var rp=require('request-promise');var moment=require(_0xf79b('0x2'));var BPromise=require(_0xf79b('0x3'));var Mustache=require(_0xf79b('0x4'));var util=require(_0xf79b('0x5'));var path=require(_0xf79b('0x6'));var sox=require(_0xf79b('0x7'));var csv=require(_0xf79b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf79b('0x9'));var _=require(_0xf79b('0xa'));var squel=require(_0xf79b('0xb'));var crypto=require('crypto');var jsforce=require(_0xf79b('0xc'));var deskjs=require(_0xf79b('0xd'));var toCsv=require(_0xf79b('0x8'));var querystring=require(_0xf79b('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf79b('0xf'));var qs=require(_0xf79b('0x10'));var as=require(_0xf79b('0x11'));var hardwareService=require(_0xf79b('0x12'));var logger=require(_0xf79b('0x13'))(_0xf79b('0x14'));var utils=require(_0xf79b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf79b('0x16'));var db=require(_0xf79b('0x17'))['db'];config[_0xf79b('0x18')]=_[_0xf79b('0x19')](config[_0xf79b('0x18')],{'host':_0xf79b('0x1a'),'port':0x18eb});var socket=require(_0xf79b('0x1b'))(new Redis(config[_0xf79b('0x18')]));require(_0xf79b('0x1c'))[_0xf79b('0x1d')](socket);function respondWithStatusCode(_0x1bd011,_0x2d1361){_0x2d1361=_0x2d1361||0xcc;return function(_0x5ac739){if(_0x5ac739){return _0x1bd011['sendStatus'](_0x2d1361);}return _0x1bd011[_0xf79b('0x1e')](_0x2d1361)['end']();};}function respondWithResult(_0x3caf78,_0x4ed585){_0x4ed585=_0x4ed585||0xc8;return function(_0x39536e){if(_0x39536e){return _0x3caf78['status'](_0x4ed585)['json'](_0x39536e);}};}function respondWithFilteredResult(_0x14b21d,_0x56a70e){return function(_0x387e4e){if(_0x387e4e){var _0x97c15d=typeof _0x56a70e[_0xf79b('0x1f')]==='undefined'&&typeof _0x56a70e[_0xf79b('0x20')]==='undefined';var _0x379ac0=_0x387e4e[_0xf79b('0x21')];var _0x2340e3=_0x97c15d?0x0:_0x56a70e[_0xf79b('0x1f')];var _0xf18b94=_0x97c15d?_0x387e4e['count']:_0x56a70e[_0xf79b('0x1f')]+_0x56a70e['limit'];var _0x5d33fa;if(_0xf18b94>=_0x379ac0){_0xf18b94=_0x379ac0;_0x5d33fa=0xc8;}else{_0x5d33fa=0xce;}_0x14b21d[_0xf79b('0x1e')](_0x5d33fa);return _0x14b21d[_0xf79b('0x22')](_0xf79b('0x23'),_0x2340e3+'-'+_0xf18b94+'/'+_0x379ac0)[_0xf79b('0x24')](_0x387e4e);}return null;};}function patchUpdates(_0x20a503){return function(_0x3ef00a){try{jsonpatch['apply'](_0x3ef00a,_0x20a503,!![]);}catch(_0x255c13){return BPromise[_0xf79b('0x25')](_0x255c13);}return _0x3ef00a[_0xf79b('0x26')]();};}function saveUpdates(_0x13a339,_0x2de335){return function(_0x466065){if(_0x466065){return _0x466065[_0xf79b('0x27')](_0x13a339)[_0xf79b('0x28')](function(_0xf1480e){return _0xf1480e;});}return null;};}function removeEntity(_0x31bd2a,_0x5c9dfb){return function(_0x2dfa65){if(_0x2dfa65){return _0x2dfa65['destroy']()['then'](function(){var _0x1a99e3=_0x2dfa65['get']({'plain':!![]});var _0xb4e37=[{'name':_0xf79b('0x29'),'value':_0xf79b('0x2a'),'ignore':![]},{'name':_0xf79b('0x2b'),'value':_0xf79b('0x2c'),'ignore':![]}];var _0x4e9e45=_(_0xb4e37)[_0xf79b('0x2d')]('ignore')[_0xf79b('0x2e')](_0xf79b('0x2f'))[_0xf79b('0x2f')]();if(_['includes'](_0x4e9e45,_0x1a99e3[_0xf79b('0x30')])){return;}var _0x3b7c5d=_['find'](_0xb4e37,[_0xf79b('0x2f'),_0x1a99e3['type']])[_0xf79b('0x31')];return db[_0xf79b('0x32')][_0xf79b('0x33')]({'where':{'type':_0x3b7c5d,'resourceId':_0x1a99e3['id']}})[_0xf79b('0x28')](function(){return _0x2dfa65;});})[_0xf79b('0x28')](function(){_0x31bd2a[_0xf79b('0x1e')](0xcc)[_0xf79b('0x34')]();});}};}function handleEntityNotFound(_0x682ebf,_0x4a4d75){return function(_0x38901f){if(!_0x38901f){_0x682ebf[_0xf79b('0x35')](0x194);}return _0x38901f;};}function handleError(_0x3d33c0,_0x231a32){_0x231a32=_0x231a32||0x1f4;return function(_0x24e603){logger['error'](_0x24e603['stack']);if(_0x24e603[_0xf79b('0x31')]){delete _0x24e603[_0xf79b('0x31')];}_0x3d33c0[_0xf79b('0x1e')](_0x231a32)[_0xf79b('0x36')](_0x24e603);};}exports[_0xf79b('0x37')]=function(_0x4bb695,_0x5701d7){var _0x3c8fb5={},_0x1957ba={},_0x1b0cd7={'count':0x0,'rows':[]};var _0x39ae31=_[_0xf79b('0x2e')](db[_0xf79b('0x38')]['rawAttributes'],function(_0x2feedf){return{'name':_0x2feedf[_0xf79b('0x39')],'type':_0x2feedf[_0xf79b('0x30')][_0xf79b('0x3a')]};});_0x1957ba[_0xf79b('0x3b')]=_['map'](_0x39ae31,_0xf79b('0x31'));_0x1957ba['query']=_[_0xf79b('0x3c')](_0x4bb695['query']);_0x1957ba[_0xf79b('0x3d')]=_[_0xf79b('0x3e')](_0x1957ba[_0xf79b('0x3b')],_0x1957ba[_0xf79b('0x3f')]);_0x3c8fb5['attributes']=_['intersection'](_0x1957ba['model'],qs[_0xf79b('0x40')](_0x4bb695[_0xf79b('0x3f')]['fields']));_0x3c8fb5[_0xf79b('0x41')]=_0x3c8fb5['attributes'][_0xf79b('0x42')]?_0x3c8fb5[_0xf79b('0x41')]:_0x1957ba[_0xf79b('0x3b')];if(!_0x4bb695['query'][_0xf79b('0x43')](_0xf79b('0x44'))){_0x3c8fb5['limit']=qs[_0xf79b('0x20')](_0x4bb695['query'][_0xf79b('0x20')]);_0x3c8fb5[_0xf79b('0x1f')]=qs[_0xf79b('0x1f')](_0x4bb695[_0xf79b('0x3f')][_0xf79b('0x1f')]);}_0x3c8fb5[_0xf79b('0x45')]=qs[_0xf79b('0x46')](_0x4bb695[_0xf79b('0x3f')][_0xf79b('0x46')]);_0x3c8fb5[_0xf79b('0x47')]=qs[_0xf79b('0x3d')](_[_0xf79b('0x48')](_0x4bb695['query'],_0x1957ba[_0xf79b('0x3d')]),_0x39ae31);if(_0x4bb695[_0xf79b('0x3f')]['filter']){_0x3c8fb5['where']=_[_0xf79b('0x49')](_0x3c8fb5[_0xf79b('0x47')],{'$or':_[_0xf79b('0x2e')](_0x39ae31,function(_0x2ea597){if(_0x2ea597[_0xf79b('0x30')]!=='VIRTUAL'){var _0x31fcf5={};_0x31fcf5[_0x2ea597[_0xf79b('0x31')]]={'$like':'%'+_0x4bb695[_0xf79b('0x3f')][_0xf79b('0x2d')]+'%'};return _0x31fcf5;}})});}_0x3c8fb5=_[_0xf79b('0x49')]({},_0x3c8fb5,_0x4bb695[_0xf79b('0x4a')]);var _0xe3bff8={'where':_0x3c8fb5[_0xf79b('0x47')]};return db[_0xf79b('0x38')][_0xf79b('0x21')](_0xe3bff8)[_0xf79b('0x28')](function(_0x8e9ab4){_0x1b0cd7[_0xf79b('0x21')]=_0x8e9ab4;if(_0x4bb695[_0xf79b('0x3f')][_0xf79b('0x4b')]){_0x3c8fb5[_0xf79b('0x4c')]=[{'all':!![]}];}return db['VoiceQueue'][_0xf79b('0x4d')](_0x3c8fb5);})['then'](function(_0x76f13f){_0x1b0cd7[_0xf79b('0x4e')]=_0x76f13f;return _0x1b0cd7;})[_0xf79b('0x28')](respondWithFilteredResult(_0x5701d7,_0x3c8fb5))[_0xf79b('0x4f')](handleError(_0x5701d7,null));};exports[_0xf79b('0x50')]=function(_0x158f2f,_0xfda08e){var _0x429164={'raw':![],'where':{'id':_0x158f2f['params']['id']}},_0x46b1a6={};_0x46b1a6['model']=_[_0xf79b('0x3c')](db['VoiceQueue']['rawAttributes']);_0x46b1a6['query']=_[_0xf79b('0x3c')](_0x158f2f[_0xf79b('0x3f')]);_0x46b1a6[_0xf79b('0x3d')]=_['intersection'](_0x46b1a6[_0xf79b('0x3b')],_0x46b1a6[_0xf79b('0x3f')]);_0x429164['attributes']=_[_0xf79b('0x3e')](_0x46b1a6[_0xf79b('0x3b')],qs['fields'](_0x158f2f[_0xf79b('0x3f')][_0xf79b('0x40')]));_0x429164[_0xf79b('0x41')]=_0x429164[_0xf79b('0x41')][_0xf79b('0x42')]?_0x429164[_0xf79b('0x41')]:_0x46b1a6[_0xf79b('0x3b')];if(_0x158f2f[_0xf79b('0x3f')]['includeAll']){_0x429164[_0xf79b('0x4c')]=[{'all':!![]}];}_0x429164=_[_0xf79b('0x49')]({},_0x429164,_0x158f2f[_0xf79b('0x4a')]);return db[_0xf79b('0x38')][_0xf79b('0x51')](_0x429164)[_0xf79b('0x28')](handleEntityNotFound(_0xfda08e,null))['then'](respondWithResult(_0xfda08e,null))[_0xf79b('0x4f')](handleError(_0xfda08e,null));};exports['create']=function(_0x1b0332,_0x2261d7){return db[_0xf79b('0x38')]['create'](_0x1b0332[_0xf79b('0x52')],{})['then'](function(_0x6145ca){var _0x214ef2=_0x1b0332['user'][_0xf79b('0x53')]({'plain':!![]});if(!_0x214ef2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x214ef2[_0xf79b('0x54')]==='user'){var _0x545baa=_0x6145ca[_0xf79b('0x53')]({'plain':!![]});var _0x280774=[{'name':_0xf79b('0x29'),'value':_0xf79b('0x2a')},{'name':_0xf79b('0x2b'),'value':'outbound'}];var _0x7bfde2=_[_0xf79b('0x51')](_0x280774,[_0xf79b('0x2f'),_0x545baa[_0xf79b('0x30')]])['name'];return db[_0xf79b('0x55')][_0xf79b('0x51')]({'where':{'name':_0x7bfde2,'userProfileId':_0x214ef2[_0xf79b('0x56')]},'raw':!![]})['then'](function(_0x3bc052){if(_0x3bc052&&_0x3bc052[_0xf79b('0x57')]===0x0){return db['UserProfileResource'][_0xf79b('0x58')]({'name':_0x545baa[_0xf79b('0x31')],'resourceId':_0x545baa['id'],'type':_0x3bc052[_0xf79b('0x31')],'sectionId':_0x3bc052['id']},{})['then'](function(){return _0x6145ca;});}else{return _0x6145ca;}})[_0xf79b('0x4f')](function(_0x152c18){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x152c18);throw _0x152c18;});}return _0x6145ca;})[_0xf79b('0x28')](respondWithResult(_0x2261d7,0xc9))['catch'](handleError(_0x2261d7,null));};exports['clone']=function(_0x53f426,_0x4c4fdb){var _0xe5fa0e={'where':{'id':_0x53f426['params']['id']}},_0x4435df={};_0x4435df[_0xf79b('0x3b')]=_['keys'](db[_0xf79b('0x38')][_0xf79b('0x59')]);_0xe5fa0e[_0xf79b('0x41')]=_[_0xf79b('0x3e')](_0x4435df[_0xf79b('0x3b')],qs[_0xf79b('0x40')](_0x53f426['query'][_0xf79b('0x40')]));_0xe5fa0e[_0xf79b('0x41')]=_0xe5fa0e[_0xf79b('0x41')]['length']?_0xe5fa0e[_0xf79b('0x41')]:_0x4435df['model'];if(_0x53f426['query'][_0xf79b('0x4b')]){_0xe5fa0e[_0xf79b('0x4c')]=[{'all':!![]}];}_0xe5fa0e=_[_0xf79b('0x49')]({},_0xe5fa0e,_0x53f426[_0xf79b('0x4a')]);return db['VoiceQueue']['find'](_0xe5fa0e)[_0xf79b('0x28')](handleEntityNotFound(_0x4c4fdb,null))[_0xf79b('0x28')](function(_0x5bb211){if(_0x5bb211){var _0x3ab27a=_0x5bb211[_0xf79b('0x53')]({'plain':!![]});_0x3ab27a=qs[_0xf79b('0x5a')](_0x3ab27a,['id',_0xf79b('0x5b'),_0xf79b('0x5c')]);_0x53f426[_0xf79b('0x52')]=_['omit'](_0x53f426[_0xf79b('0x52')],['id',_0xf79b('0x5b'),_0xf79b('0x5c')]);return db['VoiceQueue'][_0xf79b('0x58')](_[_0xf79b('0x49')](_0x3ab27a,_0x53f426[_0xf79b('0x52')]),{'include':_0x53f426[_0xf79b('0x3f')][_0xf79b('0x4b')]?[{'all':!![]}]:undefined})[_0xf79b('0x28')](function(_0x4fa99f){var _0x50d557=_0x53f426[_0xf79b('0x5d')][_0xf79b('0x53')]({'plain':!![]});if(!_0x50d557)throw new Error(_0xf79b('0x5e'));if(_0x50d557[_0xf79b('0x54')]==='user'){var _0x248f67=_0x4fa99f[_0xf79b('0x53')]({'plain':!![]});var _0x238168=[{'name':_0xf79b('0x29'),'value':_0xf79b('0x2a')},{'name':_0xf79b('0x2b'),'value':_0xf79b('0x2c')}];var _0x59a8bf=_[_0xf79b('0x51')](_0x238168,[_0xf79b('0x2f'),_0x248f67[_0xf79b('0x30')]])[_0xf79b('0x31')];return db[_0xf79b('0x55')][_0xf79b('0x51')]({'where':{'name':_0x59a8bf,'userProfileId':_0x50d557['userProfileId']},'raw':!![]})[_0xf79b('0x28')](function(_0xecaf56){if(_0xecaf56&&_0xecaf56[_0xf79b('0x57')]===0x0){return db[_0xf79b('0x32')][_0xf79b('0x58')]({'name':_0x248f67[_0xf79b('0x31')],'resourceId':_0x248f67['id'],'type':_0xecaf56[_0xf79b('0x31')],'sectionId':_0xecaf56['id']},{})['then'](function(){return _0x4fa99f;});}else{return _0x4fa99f;}})[_0xf79b('0x4f')](function(_0x556d7a){logger[_0xf79b('0x5f')](_0xf79b('0x60'),_0x556d7a);throw _0x556d7a;});}return _0x4fa99f;});}})[_0xf79b('0x28')](respondWithResult(_0x4c4fdb,0xc9))[_0xf79b('0x4f')](handleError(_0x4c4fdb,null));};exports['update']=function(_0x350a99,_0x3e7858){if(_0x350a99[_0xf79b('0x52')]['id']){delete _0x350a99[_0xf79b('0x52')]['id'];}return db[_0xf79b('0x38')][_0xf79b('0x51')]({'where':{'id':_0x350a99[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0x3e7858,null))[_0xf79b('0x28')](saveUpdates(_0x350a99['body'],null))[_0xf79b('0x28')](respondWithResult(_0x3e7858,null))[_0xf79b('0x4f')](handleError(_0x3e7858,null));};exports[_0xf79b('0x33')]=function(_0x328012,_0x54272c){return db['VoiceQueue'][_0xf79b('0x51')]({'where':{'id':_0x328012[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0x54272c,null))[_0xf79b('0x28')](removeEntity(_0x54272c,null))[_0xf79b('0x4f')](handleError(_0x54272c,null));};exports[_0xf79b('0x62')]=function(_0x3f2ab5,_0x258805,_0xf9ee15){var _0x168d8c={'raw':![],'where':{}};var _0x5133ba={};var _0x4b871c={'count':0x0,'rows':[]};return db[_0xf79b('0x38')][_0xf79b('0x63')]({'where':{'id':_0x3f2ab5[_0xf79b('0x61')]['id']}})['then'](handleEntityNotFound(_0x258805,null))[_0xf79b('0x28')](function(_0x12360a){if(_0x12360a){_0x5133ba[_0xf79b('0x3b')]=_[_0xf79b('0x3c')](db[_0xf79b('0x64')][_0xf79b('0x59')]);_0x5133ba[_0xf79b('0x3f')]=_[_0xf79b('0x3c')](_0x3f2ab5['query']);_0x5133ba[_0xf79b('0x3d')]=_[_0xf79b('0x3e')](_0x5133ba['model'],_0x5133ba[_0xf79b('0x3f')]);_0x168d8c['attributes']=_[_0xf79b('0x3e')](_0x5133ba['model'],qs['fields'](_0x3f2ab5[_0xf79b('0x3f')][_0xf79b('0x40')]));_0x168d8c[_0xf79b('0x41')]=_0x168d8c[_0xf79b('0x41')][_0xf79b('0x42')]?_0x168d8c[_0xf79b('0x41')]:_0x5133ba['model'];if(!_0x3f2ab5['query'][_0xf79b('0x43')]('nolimit')){_0x168d8c[_0xf79b('0x20')]=qs[_0xf79b('0x20')](_0x3f2ab5[_0xf79b('0x3f')][_0xf79b('0x20')]);_0x168d8c[_0xf79b('0x1f')]=qs[_0xf79b('0x1f')](_0x3f2ab5['query'][_0xf79b('0x1f')]);}_0x168d8c[_0xf79b('0x45')]=qs[_0xf79b('0x46')](_0x3f2ab5[_0xf79b('0x3f')][_0xf79b('0x46')]);_0x168d8c[_0xf79b('0x47')]=qs[_0xf79b('0x3d')](_['pick'](_0x3f2ab5[_0xf79b('0x3f')],_0x5133ba[_0xf79b('0x3d')]));_0x168d8c[_0xf79b('0x47')]['VoiceQueueId']=_0x12360a['id'];if(_0x3f2ab5['query']['filter']){_0x168d8c['where']=_['merge'](_0x168d8c[_0xf79b('0x47')],{'$or':_['map'](_0x168d8c[_0xf79b('0x41')],function(_0x55cd28){var _0x2c4b79={};_0x2c4b79[_0x55cd28]={'$like':'%'+_0x3f2ab5[_0xf79b('0x3f')]['filter']+'%'};return _0x2c4b79;})});}_0x168d8c=_[_0xf79b('0x49')]({},_0x168d8c,_0x3f2ab5['options']);return db[_0xf79b('0x64')][_0xf79b('0x21')]({'where':_0x168d8c['where']})['then'](function(_0x3c5a5f){_0x4b871c[_0xf79b('0x21')]=_0x3c5a5f;if(_0x3f2ab5[_0xf79b('0x3f')][_0xf79b('0x4b')]){_0x168d8c[_0xf79b('0x4c')]=[{'all':!![]}];}return db[_0xf79b('0x64')][_0xf79b('0x4d')](_0x168d8c);})[_0xf79b('0x28')](function(_0x548d9e){_0x4b871c['rows']=_0x548d9e;return _0x4b871c;});}})[_0xf79b('0x28')](respondWithFilteredResult(_0x258805,_0x168d8c))[_0xf79b('0x4f')](handleError(_0x258805,null));};exports[_0xf79b('0x65')]=function(_0x5736c9,_0xaad7b2,_0x427867){var _0x17cba2={'raw':!![],'where':{}};var _0x2f583c={};var _0x3b2df1={'count':0x0,'rows':[]};return db[_0xf79b('0x38')][_0xf79b('0x63')]({'where':{'id':_0x5736c9[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0xaad7b2,null))[_0xf79b('0x28')](function(_0x2f9599){if(_0x2f9599){_0x2f583c[_0xf79b('0x3b')]=_[_0xf79b('0x3c')](db['CmHopperHistory']['rawAttributes']);_0x2f583c[_0xf79b('0x3f')]=_[_0xf79b('0x3c')](_0x5736c9[_0xf79b('0x3f')]);_0x2f583c[_0xf79b('0x3d')]=_[_0xf79b('0x3e')](_0x2f583c[_0xf79b('0x3b')],_0x2f583c[_0xf79b('0x3f')]);_0x17cba2[_0xf79b('0x41')]=_['intersection'](_0x2f583c[_0xf79b('0x3b')],qs[_0xf79b('0x40')](_0x5736c9['query'][_0xf79b('0x40')]));_0x17cba2[_0xf79b('0x41')]=_0x17cba2[_0xf79b('0x41')][_0xf79b('0x42')]?_0x17cba2[_0xf79b('0x41')]:_0x2f583c[_0xf79b('0x3b')];if(!_0x5736c9[_0xf79b('0x3f')][_0xf79b('0x43')]('nolimit')){_0x17cba2[_0xf79b('0x20')]=qs[_0xf79b('0x20')](_0x5736c9[_0xf79b('0x3f')][_0xf79b('0x20')]);_0x17cba2['offset']=qs['offset'](_0x5736c9[_0xf79b('0x3f')]['offset']);}_0x17cba2[_0xf79b('0x45')]=qs['sort'](_0x5736c9[_0xf79b('0x3f')][_0xf79b('0x46')]);_0x17cba2[_0xf79b('0x47')]=qs[_0xf79b('0x3d')](_[_0xf79b('0x48')](_0x5736c9['query'],_0x2f583c['filters']));_0x17cba2[_0xf79b('0x47')][_0xf79b('0x66')]=_0x2f9599['id'];if(_0x5736c9[_0xf79b('0x3f')]['filter']){_0x17cba2['where']=_[_0xf79b('0x49')](_0x17cba2[_0xf79b('0x47')],{'$or':_['map'](_0x17cba2['attributes'],function(_0x5f3abb){var _0x2575cf={};_0x2575cf[_0x5f3abb]={'$like':'%'+_0x5736c9['query'][_0xf79b('0x2d')]+'%'};return _0x2575cf;})});}_0x17cba2=_[_0xf79b('0x49')]({},_0x17cba2,_0x5736c9[_0xf79b('0x4a')]);return db['CmHopperHistory'][_0xf79b('0x21')]({'where':_0x17cba2[_0xf79b('0x47')]})[_0xf79b('0x28')](function(_0x3f3a04){_0x3b2df1[_0xf79b('0x21')]=_0x3f3a04;if(_0x5736c9[_0xf79b('0x3f')]['includeAll']){_0x17cba2[_0xf79b('0x4c')]=[{'all':!![]}];}return db[_0xf79b('0x67')][_0xf79b('0x4d')](_0x17cba2);})['then'](function(_0x50a177){_0x3b2df1[_0xf79b('0x4e')]=_0x50a177;return _0x3b2df1;});}})[_0xf79b('0x28')](respondWithFilteredResult(_0xaad7b2,_0x17cba2))[_0xf79b('0x4f')](handleError(_0xaad7b2,null));};exports[_0xf79b('0x68')]=function(_0xfffb3c,_0x4600f4,_0x3f7002){var _0x27acc3={'raw':!![],'where':{}};var _0x41f8cb={};var _0x3f66bc={'count':0x0,'rows':[]};return db[_0xf79b('0x38')][_0xf79b('0x63')]({'where':{'id':_0xfffb3c[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0x4600f4,null))[_0xf79b('0x28')](function(_0x2f5482){if(_0x2f5482){_0x41f8cb[_0xf79b('0x3b')]=_[_0xf79b('0x3c')](db['CmHopperFinal'][_0xf79b('0x59')]);_0x41f8cb[_0xf79b('0x3f')]=_[_0xf79b('0x3c')](_0xfffb3c['query']);_0x41f8cb[_0xf79b('0x3d')]=_[_0xf79b('0x3e')](_0x41f8cb[_0xf79b('0x3b')],_0x41f8cb[_0xf79b('0x3f')]);_0x27acc3['attributes']=_[_0xf79b('0x3e')](_0x41f8cb['model'],qs[_0xf79b('0x40')](_0xfffb3c[_0xf79b('0x3f')][_0xf79b('0x40')]));_0x27acc3[_0xf79b('0x41')]=_0x27acc3[_0xf79b('0x41')][_0xf79b('0x42')]?_0x27acc3[_0xf79b('0x41')]:_0x41f8cb['model'];if(!_0xfffb3c['query'][_0xf79b('0x43')](_0xf79b('0x44'))){_0x27acc3[_0xf79b('0x20')]=qs[_0xf79b('0x20')](_0xfffb3c[_0xf79b('0x3f')][_0xf79b('0x20')]);_0x27acc3[_0xf79b('0x1f')]=qs[_0xf79b('0x1f')](_0xfffb3c[_0xf79b('0x3f')]['offset']);}_0x27acc3['order']=qs[_0xf79b('0x46')](_0xfffb3c['query'][_0xf79b('0x46')]);_0x27acc3['where']=qs[_0xf79b('0x3d')](_[_0xf79b('0x48')](_0xfffb3c['query'],_0x41f8cb[_0xf79b('0x3d')]));_0x27acc3[_0xf79b('0x47')]['VoiceQueueId']=_0x2f5482['id'];if(_0xfffb3c[_0xf79b('0x3f')][_0xf79b('0x2d')]){_0x27acc3[_0xf79b('0x47')]=_[_0xf79b('0x49')](_0x27acc3['where'],{'$or':_[_0xf79b('0x2e')](_0x27acc3[_0xf79b('0x41')],function(_0x45e237){var _0xaf7330={};_0xaf7330[_0x45e237]={'$like':'%'+_0xfffb3c[_0xf79b('0x3f')][_0xf79b('0x2d')]+'%'};return _0xaf7330;})});}_0x27acc3=_['merge']({},_0x27acc3,_0xfffb3c[_0xf79b('0x4a')]);return db[_0xf79b('0x69')][_0xf79b('0x21')]({'where':_0x27acc3[_0xf79b('0x47')]})[_0xf79b('0x28')](function(_0x4de0b2){_0x3f66bc[_0xf79b('0x21')]=_0x4de0b2;if(_0xfffb3c[_0xf79b('0x3f')][_0xf79b('0x4b')]){_0x27acc3[_0xf79b('0x4c')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xf79b('0x4d')](_0x27acc3);})[_0xf79b('0x28')](function(_0x4b04e5){_0x3f66bc['rows']=_0x4b04e5;return _0x3f66bc;});}})[_0xf79b('0x28')](respondWithFilteredResult(_0x4600f4,_0x27acc3))[_0xf79b('0x4f')](handleError(_0x4600f4,null));};exports[_0xf79b('0x6a')]=function(_0x5df040,_0x114d9a,_0x4fd9de){var _0x244062={'raw':!![],'where':{}};var _0x254186={};var _0x353b37={'count':0x0,'rows':[]};return db[_0xf79b('0x38')][_0xf79b('0x63')]({'where':{'id':_0x5df040[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0x114d9a,null))[_0xf79b('0x28')](function(_0x32417d){if(_0x32417d){_0x254186['model']=_[_0xf79b('0x3c')](db[_0xf79b('0x6b')][_0xf79b('0x59')]);_0x254186[_0xf79b('0x3f')]=_[_0xf79b('0x3c')](_0x5df040['query']);_0x254186['filters']=_[_0xf79b('0x3e')](_0x254186[_0xf79b('0x3b')],_0x254186['query']);_0x244062[_0xf79b('0x41')]=_['intersection'](_0x254186[_0xf79b('0x3b')],qs[_0xf79b('0x40')](_0x5df040[_0xf79b('0x3f')][_0xf79b('0x40')]));_0x244062[_0xf79b('0x41')]=_0x244062[_0xf79b('0x41')][_0xf79b('0x42')]?_0x244062[_0xf79b('0x41')]:_0x254186[_0xf79b('0x3b')];if(!_0x5df040[_0xf79b('0x3f')][_0xf79b('0x43')](_0xf79b('0x44'))){_0x244062['limit']=qs[_0xf79b('0x20')](_0x5df040[_0xf79b('0x3f')]['limit']);_0x244062[_0xf79b('0x1f')]=qs['offset'](_0x5df040[_0xf79b('0x3f')]['offset']);}_0x244062[_0xf79b('0x45')]=qs[_0xf79b('0x46')](_0x5df040['query'][_0xf79b('0x46')]);_0x244062[_0xf79b('0x47')]=qs[_0xf79b('0x3d')](_[_0xf79b('0x48')](_0x5df040['query'],_0x254186[_0xf79b('0x3d')]));_0x244062[_0xf79b('0x47')]['VoiceQueueId']=_0x32417d['id'];if(_0x5df040[_0xf79b('0x3f')][_0xf79b('0x2d')]){_0x244062[_0xf79b('0x47')]=_[_0xf79b('0x49')](_0x244062[_0xf79b('0x47')],{'$or':_[_0xf79b('0x2e')](_0x244062[_0xf79b('0x41')],function(_0x21eb55){var _0x53659e={};_0x53659e[_0x21eb55]={'$like':'%'+_0x5df040['query']['filter']+'%'};return _0x53659e;})});}_0x244062=_['merge']({},_0x244062,_0x5df040[_0xf79b('0x4a')]);return db['CmHopperBlack'][_0xf79b('0x21')]({'where':_0x244062[_0xf79b('0x47')]})[_0xf79b('0x28')](function(_0x4e294d){_0x353b37[_0xf79b('0x21')]=_0x4e294d;if(_0x5df040[_0xf79b('0x3f')][_0xf79b('0x4b')]){_0x244062[_0xf79b('0x4c')]=[{'all':!![]}];}return db[_0xf79b('0x6b')][_0xf79b('0x4d')](_0x244062);})[_0xf79b('0x28')](function(_0x13ac83){_0x353b37['rows']=_0x13ac83;return _0x353b37;});}})[_0xf79b('0x28')](respondWithFilteredResult(_0x114d9a,_0x244062))[_0xf79b('0x4f')](handleError(_0x114d9a,null));};exports[_0xf79b('0x6c')]=function(_0x513564,_0x2f375d,_0xd0ea98){var _0x2c5171={};var _0x7566a6={};var _0x1cd979;var _0xb42e23;return db['VoiceQueue'][_0xf79b('0x63')]({'where':{'id':_0x513564['params']['id']}})['then'](handleEntityNotFound(_0x2f375d,null))[_0xf79b('0x28')](function(_0x3d77e4){if(_0x3d77e4){_0x1cd979=_0x3d77e4;_0x7566a6[_0xf79b('0x3b')]=_[_0xf79b('0x3c')](db['Team'][_0xf79b('0x59')]);_0x7566a6[_0xf79b('0x3f')]=_[_0xf79b('0x3c')](_0x513564['query']);_0x7566a6[_0xf79b('0x3d')]=_[_0xf79b('0x3e')](_0x7566a6['model'],_0x7566a6[_0xf79b('0x3f')]);_0x2c5171[_0xf79b('0x41')]=_[_0xf79b('0x3e')](_0x7566a6['model'],qs[_0xf79b('0x40')](_0x513564[_0xf79b('0x3f')][_0xf79b('0x40')]));_0x2c5171[_0xf79b('0x41')]=_0x2c5171[_0xf79b('0x41')][_0xf79b('0x42')]?_0x2c5171['attributes']:_0x7566a6[_0xf79b('0x3b')];_0x2c5171['order']=qs[_0xf79b('0x46')](_0x513564[_0xf79b('0x3f')][_0xf79b('0x46')]);_0x2c5171[_0xf79b('0x47')]=qs[_0xf79b('0x3d')](_['pick'](_0x513564['query'],_0x7566a6['filters']));if(_0x513564[_0xf79b('0x3f')][_0xf79b('0x2d')]){_0x2c5171['where']=_[_0xf79b('0x49')](_0x2c5171['where'],{'$or':_['map'](_0x2c5171['attributes'],function(_0x237be3){var _0x30e43a={};_0x30e43a[_0x237be3]={'$like':'%'+_0x513564['query'][_0xf79b('0x2d')]+'%'};return _0x30e43a;})});}_0x2c5171=_['merge']({},_0x2c5171,_0x513564[_0xf79b('0x4a')]);return _0x1cd979[_0xf79b('0x6c')](_0x2c5171);}})[_0xf79b('0x28')](function(_0x326e7a){if(_0x326e7a){_0xb42e23=_0x326e7a['length'];if(!_0x513564[_0xf79b('0x3f')][_0xf79b('0x43')](_0xf79b('0x44'))){_0x2c5171[_0xf79b('0x20')]=qs[_0xf79b('0x20')](_0x513564['query'][_0xf79b('0x20')]);_0x2c5171[_0xf79b('0x1f')]=qs['offset'](_0x513564[_0xf79b('0x3f')][_0xf79b('0x1f')]);}return _0x1cd979['getTeams'](_0x2c5171);}})[_0xf79b('0x28')](function(_0x3fb819){if(_0x3fb819){return _0x3fb819?{'count':_0xb42e23,'rows':_0x3fb819}:null;}})[_0xf79b('0x28')](respondWithResult(_0x2f375d,null))['catch'](handleError(_0x2f375d,null));};exports[_0xf79b('0x6d')]=function(_0x404c4f,_0x458c16,_0x109344){var _0x36e719=_0x404c4f[_0xf79b('0x52')][_0xf79b('0x6e')];var _0x22e6d8=_[_0xf79b('0x2e')](_0x36e719,'id');return db[_0xf79b('0x6f')][_0xf79b('0x4d')]({'where':{'id':_0x22e6d8},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xf79b('0x31'),_0xf79b('0x70'),'voicePause',_0xf79b('0x71')],'raw':!![]}]})[_0xf79b('0x28')](function(_0x15092c){if(_0x15092c){var _0xe229c7=_[_0xf79b('0x72')](_0x15092c,function(_0x12034f){var _0x4ae1eb=_0x12034f[_0xf79b('0x53')]({'plain':!![]});_0x4ae1eb[_0xf79b('0x73')][_0xf79b('0x74')](function(_0x4cc371){_0x4cc371[_0xf79b('0x75')]=_['find'](_0x36e719,{'id':_0x4ae1eb['id']})[_0xf79b('0x75')];});return _0x4ae1eb['Agents'];});return db[_0xf79b('0x38')]['find']({'where':{'id':_0x404c4f[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](function(_0x28974c){return db[_0xf79b('0x76')][_0xf79b('0x77')](function(_0x12bbce){return _0x28974c[_0xf79b('0x6d')](_0x22e6d8,{'transaction':_0x12bbce})['then'](function(){return BPromise[_0xf79b('0x78')](_0x36e719,function(_0x40eb1c){return db[_0xf79b('0x79')][_0xf79b('0x7a')]({'TeamId':_0x40eb1c['id'],'VoiceQueueId':_0x404c4f[_0xf79b('0x61')]['id'],'penalty':_0x40eb1c[_0xf79b('0x75')]},{'transaction':_0x12bbce});});})[_0xf79b('0x28')](function(){return BPromise[_0xf79b('0x78')](_0xe229c7,function(_0x471cf4){return db[_0xf79b('0x7b')][_0xf79b('0x7c')]({'where':{'UserId':_0x471cf4['id'],'VoiceQueueId':_0x404c4f[_0xf79b('0x61')]['id']},'defaults':{'penalty':_0x471cf4[_0xf79b('0x75')]},'transaction':_0x12bbce});});})[_0xf79b('0x28')](function(){return BPromise[_0xf79b('0x78')](_['filter'](_0xe229c7,{'online':!![]}),function(_0x1414c8){return db[_0xf79b('0x7d')][_0xf79b('0x7a')]({'membername':_0x1414c8[_0xf79b('0x31')],'UserId':_0x1414c8['id'],'queue_name':_0x28974c['name'],'VoiceQueueId':_0x28974c['id'],'interface':_[_0xf79b('0x7e')](_0x1414c8[_0xf79b('0x71')])?util[_0xf79b('0x7f')]('SIP/%s',_0x1414c8[_0xf79b('0x31')]):_0x1414c8['interface'],'paused':_0x1414c8[_0xf79b('0x80')]||![],'penalty':_0x1414c8['penalty']},{'transaction':_0x12bbce});});})['then'](function(){_0xe229c7[_0xf79b('0x74')](function(_0x30cb17){socket['emit'](_0xf79b('0x81'),{'UserId':_0x30cb17['id'],'VoiceQueueId':_0x28974c['id']});});});});});}})[_0xf79b('0x28')](respondWithStatusCode(_0x458c16,null))[_0xf79b('0x4f')](handleError(_0x458c16,null));};exports[_0xf79b('0x82')]=function(_0x12fb37,_0x489570,_0x27b742){return db[_0xf79b('0x6f')][_0xf79b('0x4d')]({'where':{'id':_0x12fb37[_0xf79b('0x3f')][_0xf79b('0x83')]},'attributes':['id'],'include':[{'model':db[_0xf79b('0x84')],'as':_0xf79b('0x73'),'attributes':['id'],'raw':!![]}]})[_0xf79b('0x28')](handleEntityNotFound(_0x489570,null))[_0xf79b('0x28')](function(_0x1244da){var _0x87bf3d=_[_0xf79b('0x2e')](_0x1244da,'id');var _0x5dc462=[];var _0x2187a4=[];var _0x30c670=squel[_0xf79b('0x85')]();_0x30c670[_0xf79b('0x86')](_0xf79b('0x87'))[_0xf79b('0x88')](_0xf79b('0x89'),'tq')[_0xf79b('0x8a')](_0xf79b('0x8b'),'ut',_0xf79b('0x8c'))[_0xf79b('0x47')](_0xf79b('0x8d'),_0x12fb37[_0xf79b('0x61')]['id']);for(var _0x9ec9eb=0x0;_0x9ec9eb<_0x1244da[_0xf79b('0x42')];_0x9ec9eb+=0x1){let _0x5721e0=_0x1244da[_0x9ec9eb];for(var _0x4a4057=0x0;_0x4a4057<_0x5721e0['Agents']['length'];_0x4a4057+=0x1){let _0x3636ea=_0x5721e0['Agents'][_0x4a4057];var _0x20106e=_0x30c670[_0xf79b('0x8e')]();_0x20106e[_0xf79b('0x47')]('ut.UserId\x20=\x20?',_0x3636ea['id']);_0x2187a4[_0xf79b('0x8f')](db[_0xf79b('0x76')][_0xf79b('0x3f')](_0x20106e['toString'](),{'type':db[_0xf79b('0x76')]['QueryTypes'][_0xf79b('0x90')]})[_0xf79b('0x28')](function(_0x31dd41){if(_0x31dd41[_0xf79b('0x42')]===0x1){return _0x3636ea['id'];}else{var _0x2f94e9=_[_0xf79b('0x91')](_['map'](_0x31dd41,'TeamId'),function(_0x277ee1){return _[_0xf79b('0x92')](_0x87bf3d,_0x277ee1);});if(_0x2f94e9){return _0x3636ea['id'];}}}));}}return BPromise['all'](_0x2187a4)['then'](function(_0x192cff){_0x5dc462=_(_0x5dc462)['union'](_0x192cff)[_0xf79b('0x93')]()[_0xf79b('0x2f')]();return db[_0xf79b('0x38')][_0xf79b('0x51')]({'where':{'id':_0x12fb37[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](function(_0x392763){return db['sequelize'][_0xf79b('0x77')](function(_0x95fa68){return _0x392763[_0xf79b('0x82')](_0x12fb37[_0xf79b('0x3f')][_0xf79b('0x83')],{'transaction':_0x95fa68})['then'](function(){if(!_[_0xf79b('0x94')](_0x5dc462)){return _0x392763[_0xf79b('0x95')](_0x5dc462,{'transaction':_0x95fa68})[_0xf79b('0x28')](function(){return db[_0xf79b('0x7d')][_0xf79b('0x33')]({'where':{'VoiceQueueId':_0x12fb37['params']['id'],'UserId':_0x5dc462},'transaction':_0x95fa68});});}})[_0xf79b('0x28')](function(){_0x5dc462['forEach'](function(_0x1e16b8){socket['emit']('userVoiceQueue:remove',{'UserId':_0x1e16b8,'VoiceQueueId':_0x392763['id']});});});});});});})[_0xf79b('0x28')](respondWithStatusCode(_0x489570,null))[_0xf79b('0x4f')](handleError(_0x489570,null));};exports[_0xf79b('0x96')]=function(_0x2bc949,_0x2d8345,_0x3366f2){var _0x2370fc,_0x1ce3e2;return db['VoiceQueue']['find']({'where':{'id':_0x2bc949[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0x2d8345,null))[_0xf79b('0x28')](function(_0x396bed){if(_0x396bed){_0x1ce3e2=_0x396bed;return _0x396bed[_0xf79b('0x96')](_0x2bc949['body'][_0xf79b('0x83')],_[_0xf79b('0x5a')](_0x2bc949[_0xf79b('0x52')],[_0xf79b('0x83'),'id'])||{})[_0xf79b('0x97')](function(_0x1381b2){for(var _0x172ea7=0x0;_0x172ea7<_0x2bc949['body'][_0xf79b('0x83')]['length'];_0x172ea7+=0x1){socket[_0xf79b('0x98')](_0xf79b('0x81'),{'UserId':Number(_0x2bc949[_0xf79b('0x52')][_0xf79b('0x83')][_0x172ea7]),'VoiceQueueId':Number(_0x2bc949['params']['id'])});}return _0x1381b2;});}})['then'](function(_0x4c2ffb){_0x2370fc=_0x4c2ffb||[];if(_0x1ce3e2){return db['User'][_0xf79b('0x4d')]({'where':{'id':_0x2bc949[_0xf79b('0x52')][_0xf79b('0x83')]},'attributes':['id',_0xf79b('0x31'),_0xf79b('0x70'),_0xf79b('0x80'),'interface'],'raw':!![]});}})[_0xf79b('0x28')](function(_0x1e75e0){if(!_[_0xf79b('0x94')](_0x1e75e0)){var _0x339529=[];for(var _0x5d2d84=0x0;_0x5d2d84<_0x1e75e0[_0xf79b('0x42')];_0x5d2d84++){if(_0x1e75e0[_0x5d2d84][_0xf79b('0x70')]){_0x339529['push'](db[_0xf79b('0x7d')][_0xf79b('0x7a')]({'membername':_0x1e75e0[_0x5d2d84][_0xf79b('0x31')],'UserId':_0x1e75e0[_0x5d2d84]['id'],'queue_name':_0x1ce3e2[_0xf79b('0x31')],'VoiceQueueId':_0x1ce3e2['id'],'interface':_['isNil'](_0x1e75e0[_0x5d2d84]['interface'])?util['format']('SIP/%s',_0x1e75e0[_0x5d2d84]['name']):_0x1e75e0[_0x5d2d84]['interface'],'paused':_0x1e75e0[_0x5d2d84][_0xf79b('0x80')]||![],'penalty':_0x2bc949[_0xf79b('0x52')][_0xf79b('0x75')]||0x0}));}}return BPromise[_0xf79b('0x99')](_0x339529);}})[_0xf79b('0x28')](function(){return _0x2370fc;})['then'](respondWithResult(_0x2d8345,null))[_0xf79b('0x4f')](handleError(_0x2d8345,null));};exports['removeAgents']=function(_0x2e4ffc,_0x45e78c,_0x2f9054){return db[_0xf79b('0x38')][_0xf79b('0x51')]({'where':{'id':_0x2e4ffc[_0xf79b('0x61')]['id']}})['then'](handleEntityNotFound(_0x45e78c,null))[_0xf79b('0x28')](function(_0x4dedf6){if(_0x4dedf6){return _0x4dedf6[_0xf79b('0x95')](_0x2e4ffc[_0xf79b('0x3f')][_0xf79b('0x83')])['then'](function(){if(_[_0xf79b('0x9a')](_0x2e4ffc[_0xf79b('0x3f')]['ids'])){for(var _0x22b0a6=0x0;_0x22b0a6<_0x2e4ffc[_0xf79b('0x3f')]['ids'][_0xf79b('0x42')];_0x22b0a6+=0x1){socket[_0xf79b('0x98')]('userVoiceQueue:remove',{'UserId':Number(_0x2e4ffc[_0xf79b('0x3f')][_0xf79b('0x83')][_0x22b0a6]),'VoiceQueueId':Number(_0x2e4ffc[_0xf79b('0x61')]['id'])});}}else{socket[_0xf79b('0x98')](_0xf79b('0x9b'),{'UserId':Number(_0x2e4ffc[_0xf79b('0x3f')][_0xf79b('0x83')]),'VoiceQueueId':Number(_0x2e4ffc[_0xf79b('0x61')]['id'])});}});}})[_0xf79b('0x28')](function(_0x33d4d8){return db[_0xf79b('0x7d')]['destroy']({'where':{'VoiceQueueId':_0x2e4ffc[_0xf79b('0x61')]['id'],'UserId':_0x2e4ffc[_0xf79b('0x3f')][_0xf79b('0x83')]}})[_0xf79b('0x28')](function(){return _0x33d4d8;});})['then'](respondWithStatusCode(_0x45e78c,null))['catch'](handleError(_0x45e78c,null));};exports['getAgents']=function(_0x42c620,_0x57d492,_0x3b10bd){var _0x248b91={};var _0x20aaca={};var _0x32f68f;var _0x2537fe;return db[_0xf79b('0x38')][_0xf79b('0x63')]({'where':{'id':_0x42c620[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0x57d492,null))['then'](function(_0x46c38c){if(_0x46c38c){_0x32f68f=_0x46c38c;_0x20aaca[_0xf79b('0x3b')]=_[_0xf79b('0x3c')](db['User'][_0xf79b('0x59')]);_0x20aaca[_0xf79b('0x3f')]=_[_0xf79b('0x3c')](_0x42c620['query']);_0x20aaca[_0xf79b('0x3d')]=_[_0xf79b('0x3e')](_0x20aaca['model'],_0x20aaca[_0xf79b('0x3f')]);_0x248b91['attributes']=_[_0xf79b('0x3e')](_0x20aaca[_0xf79b('0x3b')],qs['fields'](_0x42c620[_0xf79b('0x3f')][_0xf79b('0x40')]));_0x248b91[_0xf79b('0x41')]=_0x248b91['attributes'][_0xf79b('0x42')]?_0x248b91['attributes']:_0x20aaca[_0xf79b('0x3b')];_0x248b91[_0xf79b('0x45')]=qs[_0xf79b('0x46')](_0x42c620['query']['sort']);_0x248b91['where']=qs[_0xf79b('0x3d')](_[_0xf79b('0x48')](_0x42c620[_0xf79b('0x3f')],_0x20aaca[_0xf79b('0x3d')]));if(_0x42c620[_0xf79b('0x3f')][_0xf79b('0x2d')]){_0x248b91[_0xf79b('0x47')]=_[_0xf79b('0x49')](_0x248b91['where'],{'$or':_[_0xf79b('0x2e')](_0x248b91[_0xf79b('0x41')],function(_0x25fafe){var _0x2fbbee={};_0x2fbbee[_0x25fafe]={'$like':'%'+_0x42c620[_0xf79b('0x3f')]['filter']+'%'};return _0x2fbbee;})});}_0x248b91=_[_0xf79b('0x49')]({},_0x248b91,_0x42c620[_0xf79b('0x4a')]);return _0x32f68f[_0xf79b('0x9c')](_0x248b91);}})[_0xf79b('0x28')](function(_0x13b920){if(_0x13b920){_0x2537fe=_0x13b920[_0xf79b('0x42')];if(!_0x42c620[_0xf79b('0x3f')][_0xf79b('0x43')](_0xf79b('0x44'))){_0x248b91['limit']=qs[_0xf79b('0x20')](_0x42c620['query']['limit']);_0x248b91['offset']=qs[_0xf79b('0x1f')](_0x42c620['query'][_0xf79b('0x1f')]);}return _0x32f68f[_0xf79b('0x9c')](_0x248b91);}})[_0xf79b('0x28')](function(_0x437d0e){if(_0x437d0e){return _0x437d0e?{'count':_0x2537fe,'rows':_0x437d0e}:null;}})[_0xf79b('0x28')](respondWithResult(_0x57d492,null))[_0xf79b('0x4f')](handleError(_0x57d492,null));};exports[_0xf79b('0x9d')]=function(_0x50d087,_0x26f570,_0x5b4d24){var _0x38925b={};var _0x368e79={};var _0x58e4a0;var _0x2f96f7;return db[_0xf79b('0x38')]['findOne']({'where':{'id':_0x50d087['params']['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0x26f570,null))[_0xf79b('0x28')](function(_0x3d1711){if(_0x3d1711){_0x58e4a0=_0x3d1711;_0x368e79[_0xf79b('0x3b')]=_[_0xf79b('0x3c')](db[_0xf79b('0x7d')][_0xf79b('0x59')]);_0x368e79[_0xf79b('0x3f')]=_[_0xf79b('0x3c')](_0x50d087[_0xf79b('0x3f')]);_0x368e79[_0xf79b('0x3d')]=_['intersection'](_0x368e79[_0xf79b('0x3b')],_0x368e79[_0xf79b('0x3f')]);_0x38925b[_0xf79b('0x41')]=_['intersection'](_0x368e79[_0xf79b('0x3b')],qs['fields'](_0x50d087[_0xf79b('0x3f')]['fields']));_0x38925b['attributes']=_0x38925b[_0xf79b('0x41')]['length']?_0x38925b[_0xf79b('0x41')]:_0x368e79[_0xf79b('0x3b')];_0x38925b['order']=qs['sort'](_0x50d087[_0xf79b('0x3f')][_0xf79b('0x46')]);_0x38925b[_0xf79b('0x47')]=qs[_0xf79b('0x3d')](_[_0xf79b('0x48')](_0x50d087[_0xf79b('0x3f')],_0x368e79[_0xf79b('0x3d')]));if(_0x50d087['query'][_0xf79b('0x2d')]){_0x38925b[_0xf79b('0x47')]=_[_0xf79b('0x49')](_0x38925b[_0xf79b('0x47')],{'$or':_[_0xf79b('0x2e')](_0x38925b[_0xf79b('0x41')],function(_0x236c5b){var _0x3b9a66={};_0x3b9a66[_0x236c5b]={'$like':'%'+_0x50d087[_0xf79b('0x3f')][_0xf79b('0x2d')]+'%'};return _0x3b9a66;})});}_0x38925b=_[_0xf79b('0x49')]({},_0x38925b,_0x50d087['options']);return _0x58e4a0['getMembers'](_0x38925b);}})[_0xf79b('0x28')](function(_0x381ab8){if(_0x381ab8){_0x2f96f7=_0x381ab8[_0xf79b('0x42')];if(!_0x50d087[_0xf79b('0x3f')][_0xf79b('0x43')](_0xf79b('0x44'))){_0x38925b[_0xf79b('0x20')]=qs[_0xf79b('0x20')](_0x50d087[_0xf79b('0x3f')][_0xf79b('0x20')]);_0x38925b[_0xf79b('0x1f')]=qs[_0xf79b('0x1f')](_0x50d087[_0xf79b('0x3f')][_0xf79b('0x1f')]);}return _0x58e4a0[_0xf79b('0x9d')](_0x38925b);}})['then'](function(_0xa4cef3){return _0xa4cef3?{'count':_0x2f96f7,'rows':_0xa4cef3}:null;})[_0xf79b('0x28')](respondWithResult(_0x26f570,null))['catch'](handleError(_0x26f570,null));};exports[_0xf79b('0x9e')]=function(_0x575190,_0x23e0a6,_0x5ea33d){var _0x3d3664={};var _0x198a21={};var _0x29c491;var _0x31d0f3;return db['VoiceQueue']['findOne']({'where':{'id':_0x575190['params']['id']}})['then'](handleEntityNotFound(_0x23e0a6,null))[_0xf79b('0x28')](function(_0x537123){if(_0x537123){_0x29c491=_0x537123;_0x198a21['model']=_[_0xf79b('0x3c')](db[_0xf79b('0x9f')][_0xf79b('0x59')]);_0x198a21[_0xf79b('0x3f')]=_[_0xf79b('0x3c')](_0x575190['query']);_0x198a21[_0xf79b('0x3d')]=_[_0xf79b('0x3e')](_0x198a21[_0xf79b('0x3b')],_0x198a21[_0xf79b('0x3f')]);_0x3d3664[_0xf79b('0x41')]=_['intersection'](_0x198a21[_0xf79b('0x3b')],qs[_0xf79b('0x40')](_0x575190[_0xf79b('0x3f')][_0xf79b('0x40')]));_0x3d3664[_0xf79b('0x41')]=_0x3d3664[_0xf79b('0x41')][_0xf79b('0x42')]?_0x3d3664[_0xf79b('0x41')]:_0x198a21[_0xf79b('0x3b')];_0x3d3664[_0xf79b('0x45')]=qs[_0xf79b('0x46')](_0x575190[_0xf79b('0x3f')][_0xf79b('0x46')]);_0x3d3664[_0xf79b('0x47')]=qs['filters'](_[_0xf79b('0x48')](_0x575190[_0xf79b('0x3f')],_0x198a21['filters']));if(_0x575190['query'][_0xf79b('0x2d')]){_0x3d3664['where']=_['merge'](_0x3d3664[_0xf79b('0x47')],{'$or':_[_0xf79b('0x2e')](_0x3d3664['attributes'],function(_0x4204d4){var _0x1519b3={};_0x1519b3[_0x4204d4]={'$like':'%'+_0x575190['query']['filter']+'%'};return _0x1519b3;})});}_0x3d3664=_[_0xf79b('0x49')]({},_0x3d3664,_0x575190[_0xf79b('0x4a')]);return _0x29c491[_0xf79b('0x9e')](_0x3d3664);}})[_0xf79b('0x28')](function(_0x468bb7){if(_0x468bb7){_0x31d0f3=_0x468bb7[_0xf79b('0x42')];if(!_0x575190[_0xf79b('0x3f')][_0xf79b('0x43')](_0xf79b('0x44'))){_0x3d3664['limit']=qs['limit'](_0x575190[_0xf79b('0x3f')]['limit']);_0x3d3664[_0xf79b('0x1f')]=qs[_0xf79b('0x1f')](_0x575190[_0xf79b('0x3f')]['offset']);}return _0x29c491[_0xf79b('0x9e')](_0x3d3664);}})[_0xf79b('0x28')](function(_0x6bc286){if(_0x6bc286){return _0x6bc286?{'count':_0x31d0f3,'rows':_0x6bc286}:null;}})[_0xf79b('0x28')](respondWithResult(_0x23e0a6,null))['catch'](handleError(_0x23e0a6,null));};exports[_0xf79b('0xa0')]=function(_0x202b0b,_0xab5f90,_0x2f7361){var _0x4c09c0=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x399615,_0x508801;return db[_0xf79b('0x38')][_0xf79b('0x51')]({'where':{'id':_0x202b0b[_0xf79b('0x61')]['id']}})['then'](handleEntityNotFound(_0xab5f90,null))[_0xf79b('0x28')](function(_0x4a3825){if(_0x4a3825){_0x508801=_0x4a3825;return _0x4a3825[_0xf79b('0xa0')](_0x202b0b[_0xf79b('0x52')][_0xf79b('0x83')],_['omit'](_0x202b0b[_0xf79b('0x52')],[_0xf79b('0x83'),'id'])||{});}return null;})['spread'](function(_0x333fe9){var _0x3691ac;_0x399615=_0x333fe9||[];var _0x3a17f2=[];if(_0x333fe9){for(var _0x2064a9=0x0;_0x2064a9<_0x333fe9[_0xf79b('0x42')];_0x2064a9+=0x1){var _0x42b6a0=_0x333fe9[_0x2064a9][_0xf79b('0x53')]({'plain':!![]});_0x508801[_0xf79b('0xa1')]=_0x202b0b['body'][_0xf79b('0xa1')]?_0x202b0b[_0xf79b('0x52')]['dialCheckDuplicateType']:_0x508801['dialCheckDuplicateType'];switch(_0x508801[_0xf79b('0xa1')]){case'always':_0x3691ac=squel['insert']()[_0xf79b('0xa2')](_0xf79b('0xa3'))[_0xf79b('0xa4')](['phone','scheduledAt',_0xf79b('0xa5'),_0xf79b('0xa6'),_0xf79b('0x66'),_0xf79b('0x5b'),_0xf79b('0x5c')],squel['select']()[_0xf79b('0x86')](_0xf79b('0xa7'),_0xf79b('0xa7'))[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27','scheduledAt')[_0xf79b('0x86')]('id',_0xf79b('0xa5'))[_0xf79b('0x86')](_0x42b6a0[_0xf79b('0xa8')][_0xf79b('0xa9')](),_0xf79b('0xa6'))['field'](_0x202b0b[_0xf79b('0x61')]['id'][_0xf79b('0xa9')](),_0xf79b('0x66'))[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27',_0xf79b('0x5b'))[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27',_0xf79b('0x5c'))['from'](_0xf79b('0xaa'))['where'](_0xf79b('0xab'))[_0xf79b('0x47')](_0xf79b('0xac'),_0x42b6a0['CmListId'][_0xf79b('0xa9')]())[_0xf79b('0x47')]('phone\x20IS\x20NOT\x20NULL')[_0xf79b('0x47')](_0xf79b('0xad'),squel[_0xf79b('0x85')]()[_0xf79b('0x86')](_0xf79b('0xae'))[_0xf79b('0x88')](_0xf79b('0xaf'))[_0xf79b('0x47')](_0xf79b('0x8d'),_0x202b0b['params']['id'][_0xf79b('0xa9')]()))['where'](_0xf79b('0xad'),squel[_0xf79b('0x85')]()[_0xf79b('0x86')](_0xf79b('0xb0'))['from']('cm_hopper')[_0xf79b('0x47')](_0xf79b('0x8d'),_0x202b0b[_0xf79b('0x61')]['id'][_0xf79b('0xa9')]())))['toString']();break;case _0xf79b('0xb1'):_0x3691ac=squel[_0xf79b('0xb2')]()[_0xf79b('0xa2')](_0xf79b('0xa3'))[_0xf79b('0xa4')]([_0xf79b('0xa7'),_0xf79b('0xb3'),_0xf79b('0xa5'),'ListId',_0xf79b('0x66'),_0xf79b('0x5b'),'updatedAt'],squel['select']()[_0xf79b('0x86')](_0xf79b('0xa7'),_0xf79b('0xa7'))[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27',_0xf79b('0xb3'))[_0xf79b('0x86')]('id',_0xf79b('0xa5'))[_0xf79b('0x86')](_0x42b6a0[_0xf79b('0xa8')]['toString'](),_0xf79b('0xa6'))['field'](_0x202b0b['params']['id'][_0xf79b('0xa9')](),_0xf79b('0x66'))[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27','createdAt')[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27',_0xf79b('0x5c'))['from'](_0xf79b('0xaa'))[_0xf79b('0x47')]('deletedAt\x20IS\x20NULL')[_0xf79b('0x47')](_0xf79b('0xac'),_0x42b6a0['CmListId'][_0xf79b('0xa9')]())[_0xf79b('0x47')](_0xf79b('0xb4'))[_0xf79b('0x47')](_0xf79b('0xad'),squel[_0xf79b('0x85')]()[_0xf79b('0x86')](_0xf79b('0xb0'))[_0xf79b('0x88')](_0xf79b('0xa3'))[_0xf79b('0x47')](_0xf79b('0x8d'),_0x202b0b[_0xf79b('0x61')]['id'][_0xf79b('0xa9')]())))['toString']();break;default:_0x3691ac=squel[_0xf79b('0xb2')]()[_0xf79b('0xa2')](_0xf79b('0xa3'))[_0xf79b('0xa4')](['phone','scheduledAt',_0xf79b('0xa5'),_0xf79b('0xa6'),'VoiceQueueId','createdAt',_0xf79b('0x5c')],squel['select']()[_0xf79b('0x86')](_0xf79b('0xa7'),_0xf79b('0xa7'))[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27',_0xf79b('0xb3'))[_0xf79b('0x86')]('id','ContactId')['field'](_0x42b6a0[_0xf79b('0xa8')][_0xf79b('0xa9')](),_0xf79b('0xa6'))[_0xf79b('0x86')](_0x202b0b[_0xf79b('0x61')]['id'][_0xf79b('0xa9')](),_0xf79b('0x66'))[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27',_0xf79b('0x5b'))[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27',_0xf79b('0x5c'))[_0xf79b('0x88')](_0xf79b('0xaa'))[_0xf79b('0x47')](_0xf79b('0xab'))[_0xf79b('0x47')](_0xf79b('0xac'),_0x42b6a0[_0xf79b('0xa8')][_0xf79b('0xa9')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xf79b('0xa9')]();}_0x3a17f2['push'](db[_0xf79b('0x76')][_0xf79b('0x3f')](_0x3691ac));}return BPromise[_0xf79b('0x99')](_0x3a17f2);}})[_0xf79b('0x28')](function(){var _0x4271f1=[];var _0x54a3d7=squel['insert']()[_0xf79b('0xa2')](_0xf79b('0xb5'))[_0xf79b('0xa4')]([_0xf79b('0xb6'),_0xf79b('0xa7'),_0xf79b('0xb7'),'createdAt',_0xf79b('0x5c')],squel[_0xf79b('0x85')]()[_0xf79b('0x86')](_0xf79b('0xb8'))['field'](_0xf79b('0xb9'))[_0xf79b('0x86')]('ci.OrderBy+1')[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27',_0xf79b('0x5b'))[_0xf79b('0x86')]('\x27'+_0x4c09c0+'\x27',_0xf79b('0x5c'))[_0xf79b('0x88')](_0xf79b('0xba'),'ci')[_0xf79b('0x8a')](_0xf79b('0xa3'),'h','h.ContactId=ci.CmContactId')['where']('h.scheduledat=?',_0x4c09c0)[_0xf79b('0x47')](_0xf79b('0xbb'),_0xf79b('0xbc')))[_0xf79b('0xa9')]();_0x4271f1[_0xf79b('0x8f')](db[_0xf79b('0x76')][_0xf79b('0x3f')](_0x54a3d7));return BPromise[_0xf79b('0x99')](_0x4271f1);})[_0xf79b('0x28')](function(){return _0x399615;})[_0xf79b('0x28')](respondWithResult(_0xab5f90,null))['catch'](handleError(_0xab5f90,null));};exports['removeLists']=function(_0x36bc82,_0x528e5b,_0x2a98eb){return db[_0xf79b('0x38')][_0xf79b('0x51')]({'where':{'id':_0x36bc82[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0x528e5b,null))['then'](function(_0x4f3e75){if(_0x4f3e75){return _0x4f3e75[_0xf79b('0xbd')](_0x36bc82[_0xf79b('0x3f')][_0xf79b('0x83')]);}})['then'](function(_0x1d7e3f){if(_0x1d7e3f){return db[_0xf79b('0x64')][_0xf79b('0x33')]({'where':{'ListId':_0x36bc82[_0xf79b('0x3f')][_0xf79b('0x83')],'VoiceQueueId':_0x36bc82[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](function(){return _0x1d7e3f;});}})['then'](respondWithStatusCode(_0x528e5b,null))[_0xf79b('0x4f')](handleError(_0x528e5b,null));};exports[_0xf79b('0xbe')]=function(_0x10d3d2,_0xd2d6c6,_0x5bb383){var _0x209ee4={};var _0x3db7bd={};var _0x409e86;var _0x326195;return db['VoiceQueue'][_0xf79b('0x63')]({'where':{'id':_0x10d3d2[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0xd2d6c6,null))[_0xf79b('0x28')](function(_0x234b8f){if(_0x234b8f){_0x409e86=_0x234b8f;_0x3db7bd['model']=_[_0xf79b('0x3c')](db['CmList'][_0xf79b('0x59')]);_0x3db7bd[_0xf79b('0x3f')]=_['keys'](_0x10d3d2['query']);_0x3db7bd[_0xf79b('0x3d')]=_[_0xf79b('0x3e')](_0x3db7bd['model'],_0x3db7bd[_0xf79b('0x3f')]);_0x209ee4[_0xf79b('0x41')]=_[_0xf79b('0x3e')](_0x3db7bd[_0xf79b('0x3b')],qs[_0xf79b('0x40')](_0x10d3d2['query'][_0xf79b('0x40')]));_0x209ee4[_0xf79b('0x41')]=_0x209ee4[_0xf79b('0x41')][_0xf79b('0x42')]?_0x209ee4[_0xf79b('0x41')]:_0x3db7bd['model'];_0x209ee4[_0xf79b('0x45')]=qs[_0xf79b('0x46')](_0x10d3d2[_0xf79b('0x3f')][_0xf79b('0x46')]);_0x209ee4[_0xf79b('0x47')]=qs[_0xf79b('0x3d')](_[_0xf79b('0x48')](_0x10d3d2[_0xf79b('0x3f')],_0x3db7bd[_0xf79b('0x3d')]));if(_0x10d3d2[_0xf79b('0x3f')][_0xf79b('0x2d')]){_0x209ee4['where']=_[_0xf79b('0x49')](_0x209ee4[_0xf79b('0x47')],{'$or':_[_0xf79b('0x2e')](_0x209ee4[_0xf79b('0x41')],function(_0x4e0a14){var _0x20f212={};_0x20f212[_0x4e0a14]={'$like':'%'+_0x10d3d2[_0xf79b('0x3f')][_0xf79b('0x2d')]+'%'};return _0x20f212;})});}_0x209ee4=_['merge']({},_0x209ee4,_0x10d3d2[_0xf79b('0x4a')]);return _0x409e86[_0xf79b('0xbe')](_0x209ee4);}})[_0xf79b('0x28')](function(_0x1a0b53){if(_0x1a0b53){_0x326195=_0x1a0b53[_0xf79b('0x42')];if(!_0x10d3d2[_0xf79b('0x3f')][_0xf79b('0x43')]('nolimit')){_0x209ee4[_0xf79b('0x20')]=qs[_0xf79b('0x20')](_0x10d3d2['query']['limit']);_0x209ee4[_0xf79b('0x1f')]=qs[_0xf79b('0x1f')](_0x10d3d2[_0xf79b('0x3f')][_0xf79b('0x1f')]);}return _0x409e86[_0xf79b('0xbe')](_0x209ee4);}})[_0xf79b('0x28')](function(_0x4748d5){if(_0x4748d5){return _0x4748d5?{'count':_0x326195,'rows':_0x4748d5}:null;}})[_0xf79b('0x28')](respondWithResult(_0xd2d6c6,null))['catch'](handleError(_0xd2d6c6,null));};exports[_0xf79b('0xbf')]=function(_0x562485,_0x4f0f16,_0x4f0c02){var _0x2bdfe0,_0x224260;return db[_0xf79b('0x38')][_0xf79b('0x51')]({'where':{'id':_0x562485[_0xf79b('0x61')]['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0x4f0f16,null))[_0xf79b('0x28')](function(_0x365f29){if(_0x365f29){_0x224260=_0x365f29;return _0x365f29[_0xf79b('0xbf')](_0x562485[_0xf79b('0x52')][_0xf79b('0x83')],_['omit'](_0x562485[_0xf79b('0x52')],[_0xf79b('0x83'),'id'])||{});}return null;})['spread'](function(_0x22d9bd){var _0x2e1a26;_0x2bdfe0=_0x22d9bd||[];var _0x802794=[];if(_0x22d9bd){for(var _0x46dfcc=0x0;_0x46dfcc<_0x22d9bd[_0xf79b('0x42')];_0x46dfcc+=0x1){var _0x2ea95d=_0x22d9bd[_0x46dfcc][_0xf79b('0x53')]({'plain':!![]});_0x2e1a26=squel[_0xf79b('0xb2')]()['into'](_0xf79b('0xc0'))['fromQuery']([_0xf79b('0xa7'),_0xf79b('0xa5'),_0xf79b('0xa6'),_0xf79b('0x66'),_0xf79b('0x5b'),_0xf79b('0x5c')],squel[_0xf79b('0x85')]()[_0xf79b('0x86')]('phone',_0xf79b('0xa7'))[_0xf79b('0x86')]('id',_0xf79b('0xa5'))[_0xf79b('0x86')](_0x2ea95d[_0xf79b('0xa8')][_0xf79b('0xa9')](),_0xf79b('0xa6'))[_0xf79b('0x86')](_0x562485[_0xf79b('0x61')]['id'][_0xf79b('0xa9')](),_0xf79b('0x66'))[_0xf79b('0x86')](_0xf79b('0xc1'),_0xf79b('0x5b'))[_0xf79b('0x86')](_0xf79b('0xc1'),_0xf79b('0x5c'))[_0xf79b('0x88')](_0xf79b('0xaa'))[_0xf79b('0x47')](_0xf79b('0xab'))['where'](_0xf79b('0xac'),_0x2ea95d['CmListId'][_0xf79b('0xa9')]())[_0xf79b('0x47')](_0xf79b('0xb4')))['toString']();_0x802794[_0xf79b('0x8f')](db[_0xf79b('0x76')][_0xf79b('0x3f')](_0x2e1a26));}return BPromise[_0xf79b('0x99')](_0x802794);}})['then'](function(){return _0x2bdfe0;})[_0xf79b('0x28')](respondWithResult(_0x4f0f16,null))[_0xf79b('0x4f')](handleError(_0x4f0f16,null));};exports[_0xf79b('0xc2')]=function(_0x27ae4,_0xcc238b,_0x25ad0b){return db['VoiceQueue'][_0xf79b('0x51')]({'where':{'id':_0x27ae4['params']['id']}})[_0xf79b('0x28')](handleEntityNotFound(_0xcc238b,null))[_0xf79b('0x28')](function(_0x33fb1c){if(_0x33fb1c){return _0x33fb1c[_0xf79b('0xc2')](_0x27ae4[_0xf79b('0x3f')]['ids']);}})['then'](function(_0x5a59e1){if(_0x5a59e1){return db[_0xf79b('0x6b')][_0xf79b('0x33')]({'where':{'ListId':_0x27ae4[_0xf79b('0x3f')]['ids'],'VoiceQueueId':_0x27ae4['params']['id']}})[_0xf79b('0x28')](function(){return _0x5a59e1;});}})[_0xf79b('0x28')](respondWithStatusCode(_0xcc238b,null))[_0xf79b('0x4f')](handleError(_0xcc238b,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 7708ec3..fcbee95 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 _0xc493=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x5459f5,_0x2b208c){var _0x12253c=function(_0x203790){while(--_0x203790){_0x5459f5['push'](_0x5459f5['shift']());}};_0x12253c(++_0x2b208c);}(_0xc493,0xb1));var _0x3c49=function(_0x24b6e6,_0x3b7e13){_0x24b6e6=_0x24b6e6-0x0;var _0x56fceb=_0xc493[_0x24b6e6];return _0x56fceb;};'use strict';var EventEmitter=require(_0x3c49('0x0'));var VoiceQueue=require(_0x3c49('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x3c49('0x2')](0x0);var events={'afterCreate':_0x3c49('0x3'),'afterUpdate':_0x3c49('0x4'),'afterDestroy':_0x3c49('0x5')};function emitEvent(_0x5b9c74){return function(_0x541ba5,_0x1e8ba7,_0x4921c3){VoiceQueueEvents[_0x3c49('0x6')](_0x5b9c74+':'+_0x541ba5['id'],_0x541ba5);VoiceQueueEvents[_0x3c49('0x6')](_0x5b9c74,_0x541ba5);_0x4921c3(null);};}for(var e in events){if(events[_0x3c49('0x7')](e)){var event=events[e];VoiceQueue[_0x3c49('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0x7be6=['exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x2f1114,_0x4561f1){var _0x2fe856=function(_0x8397f8){while(--_0x8397f8){_0x2f1114['push'](_0x2f1114['shift']());}};_0x2fe856(++_0x4561f1);}(_0x7be6,0xa1));var _0x67be=function(_0x3e6ba5,_0x3d33f5){_0x3e6ba5=_0x3e6ba5-0x0;var _0x82e56=_0x7be6[_0x3e6ba5];return _0x82e56;};'use strict';var EventEmitter=require(_0x67be('0x0'));var VoiceQueue=require(_0x67be('0x1'))['db'][_0x67be('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x67be('0x3')](0x0);var events={'afterCreate':_0x67be('0x4'),'afterUpdate':_0x67be('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1bc84a){return function(_0x31bc0a,_0x16bc3a,_0x4e50c2){VoiceQueueEvents[_0x67be('0x6')](_0x1bc84a+':'+_0x31bc0a['id'],_0x31bc0a);VoiceQueueEvents[_0x67be('0x6')](_0x1bc84a,_0x31bc0a);_0x4e50c2(null);};}for(var e in events){if(events[_0x67be('0x7')](e)){var event=events[e];VoiceQueue[_0x67be('0x8')](e,emitEvent(event));}}module[_0x67be('0x9')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 46f1100..0fff14f 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 _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x1124d3,_0x59d506){var _0x8a1853=function(_0x5eced2){while(--_0x5eced2){_0x1124d3['push'](_0x1124d3['shift']());}};_0x8a1853(++_0x59d506);}(_0x70e0,0x17b));var _0x070e=function(_0x98d352,_0x367316){_0x98d352=_0x98d352-0x0;var _0x477e82=_0x70e0[_0x98d352];return _0x477e82;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x955078,_0x11da52){var _0x165906=function(_0x2054ab){while(--_0x2054ab){_0x955078['push'](_0x955078['shift']());}};_0x165906(++_0x11da52);}(_0x34e8,0x12c));var _0x834e=function(_0x32fdb0,_0x5f22e1){_0x32fdb0=_0x32fdb0-0x0;var _0x4d9074=_0x34e8[_0x32fdb0];return _0x4d9074;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 5debaa8..a24ef2a 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 _0x0022=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','where','include','map','model','ShowVoiceQueue','find','attributes','lodash','util','moment'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x0022,0xe7));var _0x2002=function(_0x55ac2a,_0x231b87){_0x55ac2a=_0x55ac2a-0x0;var _0xe4a21d=_0x0022[_0x55ac2a];return _0xe4a21d;};'use strict';var _=require(_0x2002('0x0'));var util=require(_0x2002('0x1'));var moment=require(_0x2002('0x2'));var BPromise=require(_0x2002('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2002('0x4'));var db=require(_0x2002('0x5'))['db'];var utils=require(_0x2002('0x6'));var logger=require(_0x2002('0x7'))('rpc');var config=require(_0x2002('0x8'));var jayson=require(_0x2002('0x9'));var client=jayson[_0x2002('0xa')][_0x2002('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2002('0xc')],{'host':_0x2002('0xd'),'port':0x18eb});var socket=require(_0x2002('0xe'))(new Redis(config[_0x2002('0xc')]));require(_0x2002('0xf'))[_0x2002('0x10')](socket);function respondWithRpcPromise(_0x48d99b,_0xbb0552,_0x28ff61){return new BPromise(function(_0x145340,_0x15ba3a){return client[_0x2002('0x11')](_0x48d99b,_0x28ff61)[_0x2002('0x12')](function(_0x34dbca){logger[_0x2002('0x13')](_0x2002('0x14'),_0xbb0552,'request\x20sent');logger[_0x2002('0x15')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0xbb0552,_0x2002('0x16'),JSON[_0x2002('0x17')](_0x34dbca));if(_0x34dbca[_0x2002('0x18')]){if(_0x34dbca['error'][_0x2002('0x19')]===0x1f4){logger[_0x2002('0x18')](_0x2002('0x14'),_0xbb0552,_0x34dbca[_0x2002('0x18')][_0x2002('0x1a')]);return _0x15ba3a(_0x34dbca[_0x2002('0x18')][_0x2002('0x1a')]);}logger[_0x2002('0x18')](_0x2002('0x14'),_0xbb0552,_0x34dbca[_0x2002('0x18')][_0x2002('0x1a')]);return _0x145340(_0x34dbca[_0x2002('0x18')]['message']);}else{logger[_0x2002('0x13')]('VoiceQueue,\x20%s,\x20%s',_0xbb0552,_0x2002('0x16'));_0x145340(_0x34dbca['result'][_0x2002('0x1a')]);}})[_0x2002('0x1b')](function(_0x5e0cc3){logger[_0x2002('0x18')](_0x2002('0x14'),_0xbb0552,_0x5e0cc3);_0x15ba3a(_0x5e0cc3);});});}exports[_0x2002('0x1c')]=function(_0x593e28){var _0x15d834=this;return new Promise(function(_0x139ab7,_0x18b32b){return db[_0x2002('0x1d')][_0x2002('0x1e')]({'raw':_0x593e28[_0x2002('0x1f')]?_0x593e28[_0x2002('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x593e28['options']?_0x593e28[_0x2002('0x1f')][_0x2002('0x20')]||null:null,'attributes':_0x593e28[_0x2002('0x1f')]?_0x593e28[_0x2002('0x1f')]['attributes']||null:null,'limit':_0x593e28[_0x2002('0x1f')]?_0x593e28[_0x2002('0x1f')]['limit']||null:null,'include':_0x593e28[_0x2002('0x1f')]?_0x593e28[_0x2002('0x1f')][_0x2002('0x21')]?_[_0x2002('0x22')](_0x593e28[_0x2002('0x1f')][_0x2002('0x21')],function(_0x3b7df6){return{'model':db[_0x3b7df6[_0x2002('0x23')]],'as':_0x3b7df6['as'],'attributes':_0x3b7df6['attributes'],'include':_0x3b7df6[_0x2002('0x21')]?_[_0x2002('0x22')](_0x3b7df6[_0x2002('0x21')],function(_0x98822c){return{'model':db[_0x98822c[_0x2002('0x23')]],'as':_0x98822c['as'],'attributes':_0x98822c['attributes'],'include':_0x98822c[_0x2002('0x21')]?_[_0x2002('0x22')](_0x98822c[_0x2002('0x21')],function(_0x9c0ce7){return{'model':db[_0x9c0ce7['model']],'as':_0x9c0ce7['as'],'attributes':_0x9c0ce7['attributes']};}):[]};}):[]};}):[]:[]})[_0x2002('0x12')](function(_0x451f19){logger[_0x2002('0x13')](_0x2002('0x1c'),_0x593e28);logger[_0x2002('0x15')](_0x2002('0x1c'),_0x593e28,JSON[_0x2002('0x17')](_0x451f19));_0x139ab7(_0x451f19);})[_0x2002('0x1b')](function(_0x221428){logger['error']('GetVoiceQueue',_0x221428[_0x2002('0x1a')],_0x593e28);_0x18b32b(_0x15d834[_0x2002('0x18')](0x1f4,_0x221428[_0x2002('0x1a')]));});});};exports[_0x2002('0x24')]=function(_0x4d5590){var _0x326a30=this;return new Promise(function(_0xa2a545,_0x38e84b){return db[_0x2002('0x1d')][_0x2002('0x25')]({'raw':_0x4d5590[_0x2002('0x1f')]?_0x4d5590[_0x2002('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x4d5590['options']?_0x4d5590[_0x2002('0x1f')][_0x2002('0x20')]||null:null,'attributes':_0x4d5590[_0x2002('0x1f')]?_0x4d5590[_0x2002('0x1f')][_0x2002('0x26')]||null:null,'include':_0x4d5590['options']?_0x4d5590['options'][_0x2002('0x21')]?_['map'](_0x4d5590[_0x2002('0x1f')][_0x2002('0x21')],function(_0x1689a0){return{'model':db[_0x1689a0['model']],'as':_0x1689a0['as'],'attributes':_0x1689a0[_0x2002('0x26')],'include':_0x1689a0[_0x2002('0x21')]?_[_0x2002('0x22')](_0x1689a0['include'],function(_0x3f4349){return{'model':db[_0x3f4349['model']],'as':_0x3f4349['as'],'attributes':_0x3f4349[_0x2002('0x26')],'include':_0x3f4349[_0x2002('0x21')]?_[_0x2002('0x22')](_0x3f4349[_0x2002('0x21')],function(_0x397bb2){return{'model':db[_0x397bb2[_0x2002('0x23')]],'as':_0x397bb2['as'],'attributes':_0x397bb2['attributes']};}):[]};}):[]};}):[]:[]})[_0x2002('0x12')](function(_0x4f5281){logger[_0x2002('0x13')](_0x2002('0x24'),_0x4d5590);logger[_0x2002('0x15')](_0x2002('0x24'),_0x4d5590,JSON[_0x2002('0x17')](_0x4f5281));_0xa2a545(_0x4f5281);})[_0x2002('0x1b')](function(_0x35ce7b){logger[_0x2002('0x18')](_0x2002('0x24'),_0x35ce7b[_0x2002('0x1a')],_0x4d5590);_0x38e84b(_0x326a30[_0x2002('0x18')](0x1f4,_0x35ce7b[_0x2002('0x1a')]));});});}; \ No newline at end of file +var _0x66d4=['client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','map','include','model','debug','catch','find','ShowVoiceQueue','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x49bf15,_0x40f6cf){var _0x15897a=function(_0x5a3a75){while(--_0x5a3a75){_0x49bf15['push'](_0x49bf15['shift']());}};_0x15897a(++_0x40f6cf);}(_0x66d4,0x10f));var _0x466d=function(_0x3b3cc6,_0x1a6e24){_0x3b3cc6=_0x3b3cc6-0x0;var _0x1161e4=_0x66d4[_0x3b3cc6];return _0x1161e4;};'use strict';var _=require(_0x466d('0x0'));var util=require(_0x466d('0x1'));var moment=require('moment');var BPromise=require(_0x466d('0x2'));var rs=require(_0x466d('0x3'));var fs=require('fs');var Redis=require(_0x466d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x466d('0x5'));var logger=require(_0x466d('0x6'))(_0x466d('0x7'));var config=require(_0x466d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x466d('0x9')][_0x466d('0xa')]({'port':0x232a});config[_0x466d('0xb')]=_[_0x466d('0xc')](config['redis'],{'host':_0x466d('0xd'),'port':0x18eb});var socket=require(_0x466d('0xe'))(new Redis(config[_0x466d('0xb')]));require(_0x466d('0xf'))['register'](socket);function respondWithRpcPromise(_0x1306e1,_0x141508,_0x3d36f2){return new BPromise(function(_0x35c2f2,_0x407ec3){return client[_0x466d('0x10')](_0x1306e1,_0x3d36f2)[_0x466d('0x11')](function(_0x1ebf71){logger[_0x466d('0x12')](_0x466d('0x13'),_0x141508,_0x466d('0x14'));logger['debug'](_0x466d('0x15'),_0x141508,_0x466d('0x14'),JSON[_0x466d('0x16')](_0x1ebf71));if(_0x1ebf71['error']){if(_0x1ebf71[_0x466d('0x17')]['code']===0x1f4){logger[_0x466d('0x17')](_0x466d('0x13'),_0x141508,_0x1ebf71[_0x466d('0x17')][_0x466d('0x18')]);return _0x407ec3(_0x1ebf71[_0x466d('0x17')][_0x466d('0x18')]);}logger[_0x466d('0x17')](_0x466d('0x13'),_0x141508,_0x1ebf71[_0x466d('0x17')]['message']);return _0x35c2f2(_0x1ebf71[_0x466d('0x17')][_0x466d('0x18')]);}else{logger[_0x466d('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x141508,_0x466d('0x14'));_0x35c2f2(_0x1ebf71[_0x466d('0x19')][_0x466d('0x18')]);}})['catch'](function(_0x56ddfc){logger[_0x466d('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x141508,_0x56ddfc);_0x407ec3(_0x56ddfc);});});}exports[_0x466d('0x1a')]=function(_0x3989cb){var _0x27c305=this;return new Promise(function(_0x453524,_0x6bbd01){return db[_0x466d('0x1b')][_0x466d('0x1c')]({'raw':_0x3989cb[_0x466d('0x1d')]?_0x3989cb[_0x466d('0x1d')][_0x466d('0x1e')]===undefined?!![]:![]:!![],'where':_0x3989cb[_0x466d('0x1d')]?_0x3989cb['options'][_0x466d('0x1f')]||null:null,'attributes':_0x3989cb[_0x466d('0x1d')]?_0x3989cb['options'][_0x466d('0x20')]||null:null,'limit':_0x3989cb[_0x466d('0x1d')]?_0x3989cb['options']['limit']||null:null,'include':_0x3989cb[_0x466d('0x1d')]?_0x3989cb['options']['include']?_[_0x466d('0x21')](_0x3989cb[_0x466d('0x1d')][_0x466d('0x22')],function(_0x1300ca){return{'model':db[_0x1300ca[_0x466d('0x23')]],'as':_0x1300ca['as'],'attributes':_0x1300ca['attributes'],'include':_0x1300ca[_0x466d('0x22')]?_[_0x466d('0x21')](_0x1300ca[_0x466d('0x22')],function(_0x3023df){return{'model':db[_0x3023df['model']],'as':_0x3023df['as'],'attributes':_0x3023df[_0x466d('0x20')],'include':_0x3023df['include']?_[_0x466d('0x21')](_0x3023df[_0x466d('0x22')],function(_0x59e7a7){return{'model':db[_0x59e7a7[_0x466d('0x23')]],'as':_0x59e7a7['as'],'attributes':_0x59e7a7['attributes']};}):[]};}):[]};}):[]:[]})[_0x466d('0x11')](function(_0x549aa0){logger[_0x466d('0x12')]('GetVoiceQueue',_0x3989cb);logger[_0x466d('0x24')](_0x466d('0x1a'),_0x3989cb,JSON[_0x466d('0x16')](_0x549aa0));_0x453524(_0x549aa0);})[_0x466d('0x25')](function(_0x54b83a){logger[_0x466d('0x17')](_0x466d('0x1a'),_0x54b83a[_0x466d('0x18')],_0x3989cb);_0x6bbd01(_0x27c305[_0x466d('0x17')](0x1f4,_0x54b83a[_0x466d('0x18')]));});});};exports['ShowVoiceQueue']=function(_0x695878){var _0x5ce29c=this;return new Promise(function(_0x2ca3b4,_0x1f1254){return db[_0x466d('0x1b')][_0x466d('0x26')]({'raw':_0x695878[_0x466d('0x1d')]?_0x695878[_0x466d('0x1d')][_0x466d('0x1e')]===undefined?!![]:![]:!![],'where':_0x695878['options']?_0x695878[_0x466d('0x1d')][_0x466d('0x1f')]||null:null,'attributes':_0x695878['options']?_0x695878[_0x466d('0x1d')][_0x466d('0x20')]||null:null,'include':_0x695878[_0x466d('0x1d')]?_0x695878[_0x466d('0x1d')][_0x466d('0x22')]?_[_0x466d('0x21')](_0x695878[_0x466d('0x1d')][_0x466d('0x22')],function(_0x29024d){return{'model':db[_0x29024d[_0x466d('0x23')]],'as':_0x29024d['as'],'attributes':_0x29024d[_0x466d('0x20')],'include':_0x29024d[_0x466d('0x22')]?_[_0x466d('0x21')](_0x29024d[_0x466d('0x22')],function(_0x7a5a01){return{'model':db[_0x7a5a01[_0x466d('0x23')]],'as':_0x7a5a01['as'],'attributes':_0x7a5a01[_0x466d('0x20')],'include':_0x7a5a01[_0x466d('0x22')]?_[_0x466d('0x21')](_0x7a5a01[_0x466d('0x22')],function(_0xbfa6e9){return{'model':db[_0xbfa6e9['model']],'as':_0xbfa6e9['as'],'attributes':_0xbfa6e9[_0x466d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x466d('0x11')](function(_0x16e6eb){logger['info']('ShowVoiceQueue',_0x695878);logger[_0x466d('0x24')](_0x466d('0x27'),_0x695878,JSON['stringify'](_0x16e6eb));_0x2ca3b4(_0x16e6eb);})['catch'](function(_0x2f743d){logger[_0x466d('0x17')]('ShowVoiceQueue',_0x2f743d[_0x466d('0x18')],_0x695878);_0x1f1254(_0x5ce29c[_0x466d('0x17')](0x1f4,_0x2f743d['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 7583339..916b032 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 _0x51ac=['voiceQueue:','remove','update','removeListener','length'];(function(_0x290fb7,_0x12cb99){var _0x36ab45=function(_0x26c138){while(--_0x26c138){_0x290fb7['push'](_0x290fb7['shift']());}};_0x36ab45(++_0x12cb99);}(_0x51ac,0xec));var _0xc51a=function(_0x56d507,_0x395a9f){_0x56d507=_0x56d507-0x0;var _0x1fc0d9=_0x51ac[_0x56d507];return _0x1fc0d9;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=['save',_0xc51a('0x0'),_0xc51a('0x1')];function createListener(_0x4c8de7,_0x6022d8){return function(_0x769aef){_0x6022d8['emit'](_0x4c8de7,_0x769aef);};}function removeListener(_0x100176,_0x1327b4){return function(){VoiceQueueEvents[_0xc51a('0x2')](_0x100176,_0x1327b4);};}exports['register']=function(_0x36cd22){for(var _0x30dfec=0x0,_0x2b9006=events[_0xc51a('0x3')];_0x30dfec<_0x2b9006;_0x30dfec++){var _0x281e73=events[_0x30dfec];var _0xd1b7f0=createListener(_0xc51a('0x4')+_0x281e73,_0x36cd22);VoiceQueueEvents['on'](_0x281e73,_0xd1b7f0);}}; \ No newline at end of file +var _0xe017=['remove','update','emit','removeListener','register','length','save'];(function(_0x2d6f79,_0x2b5e21){var _0x1d5423=function(_0x3f327f){while(--_0x3f327f){_0x2d6f79['push'](_0x2d6f79['shift']());}};_0x1d5423(++_0x2b5e21);}(_0xe017,0x7d));var _0x7e01=function(_0x370d9c,_0x50f2f0){_0x370d9c=_0x370d9c-0x0;var _0x597a57=_0xe017[_0x370d9c];return _0x597a57;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x7e01('0x0'),_0x7e01('0x1'),_0x7e01('0x2')];function createListener(_0x5b3812,_0x372a69){return function(_0x40c611){_0x372a69[_0x7e01('0x3')](_0x5b3812,_0x40c611);};}function removeListener(_0x42eb5f,_0x4a9c91){return function(){VoiceQueueEvents[_0x7e01('0x4')](_0x42eb5f,_0x4a9c91);};}exports[_0x7e01('0x5')]=function(_0x570b77){for(var _0x1eefe8=0x0,_0x3d55b5=events[_0x7e01('0x6')];_0x1eefe8<_0x3d55b5;_0x1eefe8++){var _0x422f8c=events[_0x1eefe8];var _0x2f2ea1=createListener('voiceQueue:'+_0x422f8c,_0x570b77);VoiceQueueEvents['on'](_0x422f8c,_0x2f2ea1);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 44202c2..d5438b6 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 _0x60cb=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','getVoiceQueuesReport','/:id','post','put','update','delete','exports'];(function(_0x3b4693,_0x3f3be3){var _0x10492b=function(_0x9795c){while(--_0x9795c){_0x3b4693['push'](_0x3b4693['shift']());}};_0x10492b(++_0x3f3be3);}(_0x60cb,0x121));var _0xb60c=function(_0x4d8a96,_0x4c1b83){_0x4d8a96=_0x4d8a96-0x0;var _0x2b8ff6=_0x60cb[_0x4d8a96];return _0x2b8ff6;};'use strict';var multer=require('multer');var util=require(_0xb60c('0x0'));var path=require(_0xb60c('0x1'));var timeout=require(_0xb60c('0x2'));var express=require(_0xb60c('0x3'));var router=express['Router']();var fs_extra=require(_0xb60c('0x4'));var auth=require(_0xb60c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb60c('0x6'));var controller=require(_0xb60c('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb60c('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/index',auth[_0xb60c('0x9')](),controller[_0xb60c('0xa')]);router['get'](_0xb60c('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xb60c('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb60c('0xd')](_0xb60c('0xb'),auth[_0xb60c('0x9')](),controller[_0xb60c('0xe')]);router[_0xb60c('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xb60c('0x10')]=router; \ No newline at end of file +var _0x906d=['show','post','create','update','/:id','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','/index','getVoiceQueuesReport'];(function(_0x2ad80f,_0x40e4dd){var _0xc10ada=function(_0x2b9658){while(--_0x2b9658){_0x2ad80f['push'](_0x2ad80f['shift']());}};_0xc10ada(++_0x40e4dd);}(_0x906d,0x197));var _0xd906=function(_0x273dc5,_0x268a81){_0x273dc5=_0x273dc5-0x0;var _0x46dae7=_0x906d[_0x273dc5];return _0x46dae7;};'use strict';var multer=require(_0xd906('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd906('0x1'));var express=require(_0xd906('0x2'));var router=express[_0xd906('0x3')]();var fs_extra=require(_0xd906('0x4'));var auth=require(_0xd906('0x5'));var interaction=require(_0xd906('0x6'));var config=require(_0xd906('0x7'));var controller=require('./voiceQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd906('0x8')]);router[_0xd906('0x9')]('/describe',auth[_0xd906('0xa')](),controller['describe']);router[_0xd906('0x9')](_0xd906('0xb'),auth[_0xd906('0xa')](),controller[_0xd906('0xc')]);router[_0xd906('0x9')]('/:id',auth[_0xd906('0xa')](),controller[_0xd906('0xd')]);router[_0xd906('0xe')]('/',auth[_0xd906('0xa')](),controller[_0xd906('0xf')]);router['put']('/:id',auth[_0xd906('0xa')](),controller[_0xd906('0x10')]);router['delete'](_0xd906('0x11'),auth[_0xd906('0xa')](),controller[_0xd906('0x12')]);module[_0xd906('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 380ffbc..4dde079 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 _0x9c43=['BOOLEAN','DATE','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime','INTEGER'];(function(_0x164334,_0x2c9b1f){var _0x5ad15b=function(_0x5cca4f){while(--_0x5cca4f){_0x164334['push'](_0x164334['shift']());}};_0x5ad15b(++_0x2c9b1f);}(_0x9c43,0x1a3));var _0x39c4=function(_0x2f4f25,_0x592d31){_0x2f4f25=_0x2f4f25-0x0;var _0x6a112a=_0x9c43[_0x2f4f25];return _0x6a112a;};'use strict';var Sequelize=require(_0x39c4('0x0'));var moment=require(_0x39c4('0x1'));module[_0x39c4('0x2')]={'type':{'type':Sequelize[_0x39c4('0x3')]},'uniqueid':{'type':Sequelize[_0x39c4('0x3')]},'calleridnum':{'type':Sequelize[_0x39c4('0x3')]},'calleridname':{'type':Sequelize[_0x39c4('0x3')]},'queue':{'type':Sequelize[_0x39c4('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x4de853){var _0x320b86=moment(_0x4de853);var _0x593909=moment(this[_0x39c4('0x4')](_0x39c4('0x5')))[_0x39c4('0x6')](_0x39c4('0x7'));var _0x943054=_0x320b86[_0x39c4('0x8')](_0x593909,_0x39c4('0x9'));this[_0x39c4('0xa')]('queuecallerleaveAt',_0x4de853);this[_0x39c4('0xa')](_0x39c4('0xb'),_0x943054||null);}},'position':{'type':Sequelize[_0x39c4('0xc')]},'count':{'type':Sequelize[_0x39c4('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x39c4('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x39c4('0xe')]},'queuecallercomplete':{'type':Sequelize[_0x39c4('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x39c4('0xe')]},'queuecallerexit':{'type':Sequelize[_0x39c4('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x39c4('0xe')]},'queuecallerexitreason':{'type':Sequelize[_0x39c4('0x3')],'comment':_0x39c4('0xf')},'originalposition':{'type':Sequelize[_0x39c4('0xc')]},'channel':{'type':Sequelize[_0x39c4('0x3')]},'connectedlinenum':{'type':Sequelize[_0x39c4('0x3')]},'connectedlinename':{'type':Sequelize[_0x39c4('0x3')]},'accountcode':{'type':Sequelize[_0x39c4('0x3')]},'context':{'type':Sequelize[_0x39c4('0x3')]},'exten':{'type':Sequelize[_0x39c4('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x39c4('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x39c4('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x39c4('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x39c4('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x39c4('0x3')]},'secondDisposition':{'type':Sequelize[_0x39c4('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0x39c4('0x3')]}}; \ No newline at end of file +var _0xaac6=['diff','setDataValue','queuecallerleaveAt','INTEGER','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3833f4,_0xb7f4ec){var _0x393f0b=function(_0x2eb3a9){while(--_0x2eb3a9){_0x3833f4['push'](_0x3833f4['shift']());}};_0x393f0b(++_0xb7f4ec);}(_0xaac6,0x167));var _0x6aac=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0xaac6[_0x1d558c];return _0x15767d;};'use strict';var Sequelize=require(_0x6aac('0x0'));var moment=require(_0x6aac('0x1'));module[_0x6aac('0x2')]={'type':{'type':Sequelize[_0x6aac('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6aac('0x3')]},'calleridname':{'type':Sequelize[_0x6aac('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x6aac('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x6aac('0x4')],'set':function(_0x2a37e1){var _0x58d181=moment(_0x2a37e1);var _0xca45f9=moment(this[_0x6aac('0x5')](_0x6aac('0x6')))[_0x6aac('0x7')](_0x6aac('0x8'));var _0x18c0e4=_0x58d181[_0x6aac('0x9')](_0xca45f9,'seconds');this[_0x6aac('0xa')](_0x6aac('0xb'),_0x2a37e1);this['setDataValue']('holdtime',_0x18c0e4||null);}},'position':{'type':Sequelize[_0x6aac('0xc')]},'count':{'type':Sequelize[_0x6aac('0xc')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x6aac('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x6aac('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x6aac('0x3')],'comment':_0x6aac('0xd')},'originalposition':{'type':Sequelize[_0x6aac('0xc')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x6aac('0x3')]},'connectedlinename':{'type':Sequelize[_0x6aac('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6aac('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x6aac('0xc')]},'mohtime':{'type':Sequelize[_0x6aac('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x6aac('0x3')]},'transfer':{'type':Sequelize[_0x6aac('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x6aac('0x3')],'comment':_0x6aac('0xf')},'transferexten':{'type':Sequelize[_0x6aac('0x3')]},'transferuniqueid':{'type':Sequelize[_0x6aac('0x3')]},'disposition':{'type':Sequelize[_0x6aac('0x3')]},'secondDisposition':{'type':Sequelize[_0x6aac('0x3')]},'thirdDisposition':{'type':Sequelize[_0x6aac('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0x6aac('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index bf03532..eaacac5 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 _0xc862=['sort','where','pick','filter','VIRTUAL','options','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','bluebird','mustache','util','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','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x2fe15c,_0x48713a){var _0x26ec58=function(_0x3e475a){while(--_0x3e475a){_0x2fe15c['push'](_0x2fe15c['shift']());}};_0x26ec58(++_0x48713a);}(_0xc862,0xb6));var _0x2c86=function(_0x18bb4d,_0x5a5d17){_0x18bb4d=_0x18bb4d-0x0;var _0xd1fa04=_0xc862[_0x18bb4d];return _0xd1fa04;};'use strict';var emlformat=require(_0x2c86('0x0'));var rimraf=require(_0x2c86('0x1'));var zipdir=require(_0x2c86('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2c86('0x3'));var Mustache=require(_0x2c86('0x4'));var util=require(_0x2c86('0x5'));var path=require(_0x2c86('0x6'));var sox=require(_0x2c86('0x7'));var csv=require(_0x2c86('0x8'));var ejs=require(_0x2c86('0x9'));var fs=require('fs');var fs_extra=require(_0x2c86('0xa'));var _=require(_0x2c86('0xb'));var squel=require(_0x2c86('0xc'));var crypto=require('crypto');var jsforce=require(_0x2c86('0xd'));var deskjs=require(_0x2c86('0xe'));var toCsv=require(_0x2c86('0x8'));var querystring=require('querystring');var Papa=require(_0x2c86('0xf'));var Redis=require(_0x2c86('0x10'));var authService=require(_0x2c86('0x11'));var qs=require(_0x2c86('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c86('0x13'));var logger=require(_0x2c86('0x14'))('api');var utils=require(_0x2c86('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2c86('0x16'));var db=require(_0x2c86('0x17'))['db'];config[_0x2c86('0x18')]=_['defaults'](config[_0x2c86('0x18')],{'host':_0x2c86('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2c86('0x18')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x524e3d,_0x29add5){_0x29add5=_0x29add5||0xcc;return function(_0x111fec){if(_0x111fec){return _0x524e3d[_0x2c86('0x1a')](_0x29add5);}return _0x524e3d[_0x2c86('0x1b')](_0x29add5)[_0x2c86('0x1c')]();};}function respondWithResult(_0x763e95,_0x316bc9){_0x316bc9=_0x316bc9||0xc8;return function(_0x5d4b4b){if(_0x5d4b4b){return _0x763e95[_0x2c86('0x1b')](_0x316bc9)[_0x2c86('0x1d')](_0x5d4b4b);}};}function respondWithFilteredResult(_0x26723c,_0x43aee4){return function(_0xe63e1c){if(_0xe63e1c){var _0x1b7dd7=typeof _0x43aee4[_0x2c86('0x1e')]==='undefined'&&typeof _0x43aee4[_0x2c86('0x1f')]===_0x2c86('0x20');var _0x21144e=_0xe63e1c[_0x2c86('0x21')];var _0x51e9d8=_0x1b7dd7?0x0:_0x43aee4[_0x2c86('0x1e')];var _0x30e4dd=_0x1b7dd7?_0xe63e1c['count']:_0x43aee4[_0x2c86('0x1e')]+_0x43aee4['limit'];var _0x4ae9e4;if(_0x30e4dd>=_0x21144e){_0x30e4dd=_0x21144e;_0x4ae9e4=0xc8;}else{_0x4ae9e4=0xce;}_0x26723c[_0x2c86('0x1b')](_0x4ae9e4);return _0x26723c[_0x2c86('0x22')](_0x2c86('0x23'),_0x51e9d8+'-'+_0x30e4dd+'/'+_0x21144e)[_0x2c86('0x1d')](_0xe63e1c);}return null;};}function patchUpdates(_0x74bfdc){return function(_0x9c04f3){try{jsonpatch[_0x2c86('0x24')](_0x9c04f3,_0x74bfdc,!![]);}catch(_0x55aa38){return BPromise[_0x2c86('0x25')](_0x55aa38);}return _0x9c04f3[_0x2c86('0x26')]();};}function saveUpdates(_0x1adc46,_0x2c33d5){return function(_0xdb547f){if(_0xdb547f){return _0xdb547f[_0x2c86('0x27')](_0x1adc46)[_0x2c86('0x28')](function(_0x3965ef){return _0x3965ef;});}return null;};}function removeEntity(_0x536473,_0x4f04e0){return function(_0x1952cb){if(_0x1952cb){return _0x1952cb[_0x2c86('0x29')]()[_0x2c86('0x28')](function(){_0x536473['status'](0xcc)[_0x2c86('0x1c')]();});}};}function handleEntityNotFound(_0x56a83b,_0x427029){return function(_0x36b0e6){if(!_0x36b0e6){_0x56a83b[_0x2c86('0x1a')](0x194);}return _0x36b0e6;};}function handleError(_0x217c14,_0x32a908){_0x32a908=_0x32a908||0x1f4;return function(_0x507075){logger[_0x2c86('0x2a')](_0x507075[_0x2c86('0x2b')]);if(_0x507075[_0x2c86('0x2c')]){delete _0x507075[_0x2c86('0x2c')];}_0x217c14[_0x2c86('0x1b')](_0x32a908)[_0x2c86('0x2d')](_0x507075);};}exports['index']=function(_0x290bc1,_0xe058b2){var _0x3c9d17={},_0x104334={},_0x73a511={'count':0x0,'rows':[]};var _0x169f7c=_[_0x2c86('0x2e')](db['VoiceQueueReport'][_0x2c86('0x2f')],function(_0x4238ea){return{'name':_0x4238ea['fieldName'],'type':_0x4238ea[_0x2c86('0x30')][_0x2c86('0x31')]};});_0x104334[_0x2c86('0x32')]=_[_0x2c86('0x2e')](_0x169f7c,'name');_0x104334[_0x2c86('0x33')]=_[_0x2c86('0x34')](_0x290bc1['query']);_0x104334[_0x2c86('0x35')]=_[_0x2c86('0x36')](_0x104334[_0x2c86('0x32')],_0x104334[_0x2c86('0x33')]);_0x3c9d17[_0x2c86('0x37')]=_['intersection'](_0x104334[_0x2c86('0x32')],qs[_0x2c86('0x38')](_0x290bc1[_0x2c86('0x33')][_0x2c86('0x38')]));_0x3c9d17[_0x2c86('0x37')]=_0x3c9d17[_0x2c86('0x37')][_0x2c86('0x39')]?_0x3c9d17['attributes']:_0x104334[_0x2c86('0x32')];if(!_0x290bc1[_0x2c86('0x33')][_0x2c86('0x3a')](_0x2c86('0x3b'))){_0x3c9d17['limit']=qs[_0x2c86('0x1f')](_0x290bc1[_0x2c86('0x33')][_0x2c86('0x1f')]);_0x3c9d17['offset']=qs['offset'](_0x290bc1['query']['offset']);}_0x3c9d17[_0x2c86('0x3c')]=qs[_0x2c86('0x3d')](_0x290bc1[_0x2c86('0x33')][_0x2c86('0x3d')]);_0x3c9d17[_0x2c86('0x3e')]=qs[_0x2c86('0x35')](_[_0x2c86('0x3f')](_0x290bc1['query'],_0x104334['filters']),_0x169f7c);if(_0x290bc1[_0x2c86('0x33')][_0x2c86('0x40')]){_0x3c9d17[_0x2c86('0x3e')]=_['merge'](_0x3c9d17[_0x2c86('0x3e')],{'$or':_['map'](_0x169f7c,function(_0x2f4bbc){if(_0x2f4bbc[_0x2c86('0x30')]!==_0x2c86('0x41')){var _0x57f424={};_0x57f424[_0x2f4bbc[_0x2c86('0x2c')]]={'$like':'%'+_0x290bc1[_0x2c86('0x33')][_0x2c86('0x40')]+'%'};return _0x57f424;}})});}_0x3c9d17=_['merge']({},_0x3c9d17,_0x290bc1[_0x2c86('0x42')]);var _0x6d5297={'where':_0x3c9d17[_0x2c86('0x3e')]};return db[_0x2c86('0x43')][_0x2c86('0x21')](_0x6d5297)[_0x2c86('0x28')](function(_0x1585e3){_0x73a511['count']=_0x1585e3;if(_0x290bc1[_0x2c86('0x33')][_0x2c86('0x44')]){_0x3c9d17[_0x2c86('0x45')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x2c86('0x46')](_0x3c9d17);})[_0x2c86('0x28')](function(_0x3b530f){_0x73a511[_0x2c86('0x47')]=_0x3b530f;return _0x73a511;})['then'](respondWithFilteredResult(_0xe058b2,_0x3c9d17))[_0x2c86('0x48')](handleError(_0xe058b2,null));};exports[_0x2c86('0x49')]=function(_0x20f34a,_0x186a03){var _0x321439={'raw':![],'where':{'id':_0x20f34a[_0x2c86('0x4a')]['id']}},_0x10a5cf={};_0x10a5cf[_0x2c86('0x32')]=_['keys'](db[_0x2c86('0x43')][_0x2c86('0x2f')]);_0x10a5cf[_0x2c86('0x33')]=_['keys'](_0x20f34a['query']);_0x10a5cf[_0x2c86('0x35')]=_[_0x2c86('0x36')](_0x10a5cf[_0x2c86('0x32')],_0x10a5cf[_0x2c86('0x33')]);_0x321439[_0x2c86('0x37')]=_[_0x2c86('0x36')](_0x10a5cf[_0x2c86('0x32')],qs[_0x2c86('0x38')](_0x20f34a[_0x2c86('0x33')][_0x2c86('0x38')]));_0x321439[_0x2c86('0x37')]=_0x321439[_0x2c86('0x37')][_0x2c86('0x39')]?_0x321439[_0x2c86('0x37')]:_0x10a5cf['model'];if(_0x20f34a[_0x2c86('0x33')][_0x2c86('0x44')]){_0x321439[_0x2c86('0x45')]=[{'all':!![]}];}_0x321439=_[_0x2c86('0x4b')]({},_0x321439,_0x20f34a[_0x2c86('0x42')]);return db[_0x2c86('0x43')][_0x2c86('0x4c')](_0x321439)[_0x2c86('0x28')](handleEntityNotFound(_0x186a03,null))[_0x2c86('0x28')](respondWithResult(_0x186a03,null))['catch'](handleError(_0x186a03,null));};exports['create']=function(_0x103ed0,_0x7e14cb){return db[_0x2c86('0x43')][_0x2c86('0x4d')](_0x103ed0[_0x2c86('0x4e')],{})[_0x2c86('0x28')](respondWithResult(_0x7e14cb,0xc9))[_0x2c86('0x48')](handleError(_0x7e14cb,null));};exports[_0x2c86('0x27')]=function(_0x29de84,_0x2fa44f){if(_0x29de84[_0x2c86('0x4e')]['id']){delete _0x29de84[_0x2c86('0x4e')]['id'];}return db[_0x2c86('0x43')]['find']({'where':{'id':_0x29de84['params']['id']}})[_0x2c86('0x28')](handleEntityNotFound(_0x2fa44f,null))[_0x2c86('0x28')](saveUpdates(_0x29de84[_0x2c86('0x4e')],null))[_0x2c86('0x28')](respondWithResult(_0x2fa44f,null))[_0x2c86('0x48')](handleError(_0x2fa44f,null));};exports[_0x2c86('0x29')]=function(_0x1eeb0e,_0x397e85){return db[_0x2c86('0x43')][_0x2c86('0x4c')]({'where':{'id':_0x1eeb0e['params']['id']}})[_0x2c86('0x28')](handleEntityNotFound(_0x397e85,null))['then'](removeEntity(_0x397e85,null))[_0x2c86('0x48')](handleError(_0x397e85,null));};exports[_0x2c86('0x4f')]=function(_0x1e73c8,_0x2dded3){return db['VoiceQueueReport'][_0x2c86('0x4f')]()[_0x2c86('0x28')](respondWithResult(_0x2dded3,null))[_0x2c86('0x48')](handleError(_0x2dded3,null));};exports[_0x2c86('0x50')]=function(_0x55effd,_0x39c6f6){var _0x535808={},_0x216c5f={},_0x49d984={'count':0x0,'rows':[]};_0x216c5f[_0x2c86('0x32')]=_['keys'](db[_0x2c86('0x43')]['rawAttributes']);_0x216c5f['query']=_[_0x2c86('0x34')](_0x55effd[_0x2c86('0x33')]);_0x216c5f[_0x2c86('0x35')]=_[_0x2c86('0x36')](_0x216c5f[_0x2c86('0x32')],_0x216c5f[_0x2c86('0x33')]);_0x535808[_0x2c86('0x37')]=_['intersection'](_0x216c5f['model'],qs['fields'](_0x55effd[_0x2c86('0x33')]['fields']));_0x535808['attributes']=_0x535808['attributes']['length']?_0x535808['attributes']:_0x216c5f[_0x2c86('0x32')];if(!_0x55effd[_0x2c86('0x33')]['hasOwnProperty'](_0x2c86('0x3b'))){_0x535808['limit']=qs[_0x2c86('0x1f')](_0x55effd['query'][_0x2c86('0x1f')]);_0x535808[_0x2c86('0x1e')]=qs['offset'](_0x55effd[_0x2c86('0x33')][_0x2c86('0x1e')]);}_0x535808[_0x2c86('0x3c')]=qs[_0x2c86('0x3d')](_0x55effd[_0x2c86('0x33')][_0x2c86('0x3d')]);_0x535808[_0x2c86('0x3e')]=qs[_0x2c86('0x35')](_[_0x2c86('0x3f')](_0x55effd['query'],_0x216c5f[_0x2c86('0x35')]));if(_0x55effd[_0x2c86('0x33')][_0x2c86('0x40')]){_0x535808[_0x2c86('0x3e')]=_[_0x2c86('0x4b')](_0x535808['where'],{'$or':_[_0x2c86('0x2e')](_0x535808[_0x2c86('0x37')],function(_0x268e5c){var _0x31ba4a={};_0x31ba4a[_0x268e5c]={'$like':'%'+_0x55effd['query'][_0x2c86('0x40')]+'%'};return _0x31ba4a;})});}_0x535808=_[_0x2c86('0x4b')]({},_0x535808,_0x55effd['options']);var _0x314edb={'where':_0x535808['where']};return db[_0x2c86('0x43')][_0x2c86('0x21')](_0x314edb)[_0x2c86('0x28')](function(_0x50424a){_0x49d984[_0x2c86('0x21')]=_0x50424a;if(_0x55effd[_0x2c86('0x33')]['includeAll']){_0x535808[_0x2c86('0x45')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x2c86('0x46')](_0x535808);})[_0x2c86('0x28')](function(_0x37f2f0){_0x49d984[_0x2c86('0x47')]=_0x37f2f0;return _0x49d984;})['then'](respondWithFilteredResult(_0x39c6f6,_0x535808,_0x2c86('0x50')))[_0x2c86('0x48')](handleError(_0x39c6f6,null,_0x2c86('0x50')));}; \ No newline at end of file +var _0x6d48=['options','includeAll','include','findAll','rows','catch','params','filters','intersection','find','create','body','describe','getVoiceQueuesReport','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','defaults','redis','localhost','./voiceQueueReport.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','VoiceQueueReport','rawAttributes','type','key','model','query','keys','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL'];(function(_0x41e499,_0x48d0dc){var _0x45ac00=function(_0x491f46){while(--_0x491f46){_0x41e499['push'](_0x41e499['shift']());}};_0x45ac00(++_0x48d0dc);}(_0x6d48,0xfb));var _0x86d4=function(_0x327027,_0x554b7e){_0x327027=_0x327027-0x0;var _0x4a9067=_0x6d48[_0x327027];return _0x4a9067;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d4('0x0'));var zipdir=require(_0x86d4('0x1'));var jsonpatch=require(_0x86d4('0x2'));var rp=require(_0x86d4('0x3'));var moment=require(_0x86d4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x86d4('0x5'));var util=require(_0x86d4('0x6'));var path=require(_0x86d4('0x7'));var sox=require(_0x86d4('0x8'));var csv=require(_0x86d4('0x9'));var ejs=require(_0x86d4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x86d4('0xb'));var jsforce=require(_0x86d4('0xc'));var deskjs=require(_0x86d4('0xd'));var toCsv=require(_0x86d4('0x9'));var querystring=require(_0x86d4('0xe'));var Papa=require(_0x86d4('0xf'));var Redis=require(_0x86d4('0x10'));var authService=require(_0x86d4('0x11'));var qs=require(_0x86d4('0x12'));var as=require(_0x86d4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d4('0x14'))(_0x86d4('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x86d4('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x86d4('0x17')](config[_0x86d4('0x18')],{'host':_0x86d4('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x86d4('0x18')]));require(_0x86d4('0x1a'))[_0x86d4('0x1b')](socket);function respondWithStatusCode(_0x502539,_0xd95b58){_0xd95b58=_0xd95b58||0xcc;return function(_0x57ea8b){if(_0x57ea8b){return _0x502539[_0x86d4('0x1c')](_0xd95b58);}return _0x502539[_0x86d4('0x1d')](_0xd95b58)[_0x86d4('0x1e')]();};}function respondWithResult(_0xa55a05,_0x24aeda){_0x24aeda=_0x24aeda||0xc8;return function(_0x3df090){if(_0x3df090){return _0xa55a05['status'](_0x24aeda)['json'](_0x3df090);}};}function respondWithFilteredResult(_0x3c26d9,_0x2c4e9f){return function(_0x51b4ec){if(_0x51b4ec){var _0x3a6cd1=typeof _0x2c4e9f[_0x86d4('0x1f')]===_0x86d4('0x20')&&typeof _0x2c4e9f[_0x86d4('0x21')]==='undefined';var _0x1a8457=_0x51b4ec[_0x86d4('0x22')];var _0x48cc8c=_0x3a6cd1?0x0:_0x2c4e9f['offset'];var _0x4acd72=_0x3a6cd1?_0x51b4ec['count']:_0x2c4e9f[_0x86d4('0x1f')]+_0x2c4e9f[_0x86d4('0x21')];var _0x472a24;if(_0x4acd72>=_0x1a8457){_0x4acd72=_0x1a8457;_0x472a24=0xc8;}else{_0x472a24=0xce;}_0x3c26d9[_0x86d4('0x1d')](_0x472a24);return _0x3c26d9[_0x86d4('0x23')]('Content-Range',_0x48cc8c+'-'+_0x4acd72+'/'+_0x1a8457)['json'](_0x51b4ec);}return null;};}function patchUpdates(_0x307bee){return function(_0x2e2e85){try{jsonpatch[_0x86d4('0x24')](_0x2e2e85,_0x307bee,!![]);}catch(_0x4220b8){return BPromise[_0x86d4('0x25')](_0x4220b8);}return _0x2e2e85[_0x86d4('0x26')]();};}function saveUpdates(_0x3205ef,_0x339db3){return function(_0x26d321){if(_0x26d321){return _0x26d321[_0x86d4('0x27')](_0x3205ef)[_0x86d4('0x28')](function(_0x59b47d){return _0x59b47d;});}return null;};}function removeEntity(_0x4bfd12,_0x210670){return function(_0x41829c){if(_0x41829c){return _0x41829c[_0x86d4('0x29')]()[_0x86d4('0x28')](function(){_0x4bfd12[_0x86d4('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ecf21,_0x22a8c1){return function(_0x52534e){if(!_0x52534e){_0x1ecf21['sendStatus'](0x194);}return _0x52534e;};}function handleError(_0x53547b,_0x680624){_0x680624=_0x680624||0x1f4;return function(_0x1281b){logger[_0x86d4('0x2a')](_0x1281b[_0x86d4('0x2b')]);if(_0x1281b[_0x86d4('0x2c')]){delete _0x1281b['name'];}_0x53547b['status'](_0x680624)[_0x86d4('0x2d')](_0x1281b);};}exports['index']=function(_0x17a9c0,_0x343ed2){var _0x314158={},_0x58212f={},_0x1e265d={'count':0x0,'rows':[]};var _0x5db6f3=_[_0x86d4('0x2e')](db[_0x86d4('0x2f')][_0x86d4('0x30')],function(_0x2761c6){return{'name':_0x2761c6['fieldName'],'type':_0x2761c6[_0x86d4('0x31')][_0x86d4('0x32')]};});_0x58212f[_0x86d4('0x33')]=_['map'](_0x5db6f3,'name');_0x58212f[_0x86d4('0x34')]=_[_0x86d4('0x35')](_0x17a9c0[_0x86d4('0x34')]);_0x58212f['filters']=_['intersection'](_0x58212f[_0x86d4('0x33')],_0x58212f[_0x86d4('0x34')]);_0x314158[_0x86d4('0x36')]=_['intersection'](_0x58212f[_0x86d4('0x33')],qs[_0x86d4('0x37')](_0x17a9c0[_0x86d4('0x34')][_0x86d4('0x37')]));_0x314158[_0x86d4('0x36')]=_0x314158['attributes']['length']?_0x314158[_0x86d4('0x36')]:_0x58212f[_0x86d4('0x33')];if(!_0x17a9c0[_0x86d4('0x34')][_0x86d4('0x38')](_0x86d4('0x39'))){_0x314158[_0x86d4('0x21')]=qs[_0x86d4('0x21')](_0x17a9c0[_0x86d4('0x34')][_0x86d4('0x21')]);_0x314158[_0x86d4('0x1f')]=qs['offset'](_0x17a9c0[_0x86d4('0x34')]['offset']);}_0x314158[_0x86d4('0x3a')]=qs['sort'](_0x17a9c0[_0x86d4('0x34')][_0x86d4('0x3b')]);_0x314158['where']=qs['filters'](_[_0x86d4('0x3c')](_0x17a9c0[_0x86d4('0x34')],_0x58212f['filters']),_0x5db6f3);if(_0x17a9c0[_0x86d4('0x34')][_0x86d4('0x3d')]){_0x314158[_0x86d4('0x3e')]=_[_0x86d4('0x3f')](_0x314158[_0x86d4('0x3e')],{'$or':_[_0x86d4('0x2e')](_0x5db6f3,function(_0x3c9260){if(_0x3c9260['type']!==_0x86d4('0x40')){var _0x34f83a={};_0x34f83a[_0x3c9260[_0x86d4('0x2c')]]={'$like':'%'+_0x17a9c0['query'][_0x86d4('0x3d')]+'%'};return _0x34f83a;}})});}_0x314158=_[_0x86d4('0x3f')]({},_0x314158,_0x17a9c0[_0x86d4('0x41')]);var _0x399e3e={'where':_0x314158[_0x86d4('0x3e')]};return db[_0x86d4('0x2f')][_0x86d4('0x22')](_0x399e3e)[_0x86d4('0x28')](function(_0x5a14ac){_0x1e265d[_0x86d4('0x22')]=_0x5a14ac;if(_0x17a9c0[_0x86d4('0x34')][_0x86d4('0x42')]){_0x314158[_0x86d4('0x43')]=[{'all':!![]}];}return db[_0x86d4('0x2f')][_0x86d4('0x44')](_0x314158);})[_0x86d4('0x28')](function(_0x538212){_0x1e265d[_0x86d4('0x45')]=_0x538212;return _0x1e265d;})[_0x86d4('0x28')](respondWithFilteredResult(_0x343ed2,_0x314158))[_0x86d4('0x46')](handleError(_0x343ed2,null));};exports['show']=function(_0x501627,_0x554ac3){var _0x48e0f0={'raw':![],'where':{'id':_0x501627[_0x86d4('0x47')]['id']}},_0x14134e={};_0x14134e[_0x86d4('0x33')]=_['keys'](db[_0x86d4('0x2f')][_0x86d4('0x30')]);_0x14134e[_0x86d4('0x34')]=_['keys'](_0x501627[_0x86d4('0x34')]);_0x14134e[_0x86d4('0x48')]=_[_0x86d4('0x49')](_0x14134e['model'],_0x14134e[_0x86d4('0x34')]);_0x48e0f0['attributes']=_['intersection'](_0x14134e['model'],qs[_0x86d4('0x37')](_0x501627[_0x86d4('0x34')][_0x86d4('0x37')]));_0x48e0f0[_0x86d4('0x36')]=_0x48e0f0[_0x86d4('0x36')]['length']?_0x48e0f0[_0x86d4('0x36')]:_0x14134e[_0x86d4('0x33')];if(_0x501627[_0x86d4('0x34')][_0x86d4('0x42')]){_0x48e0f0[_0x86d4('0x43')]=[{'all':!![]}];}_0x48e0f0=_[_0x86d4('0x3f')]({},_0x48e0f0,_0x501627[_0x86d4('0x41')]);return db[_0x86d4('0x2f')][_0x86d4('0x4a')](_0x48e0f0)[_0x86d4('0x28')](handleEntityNotFound(_0x554ac3,null))['then'](respondWithResult(_0x554ac3,null))[_0x86d4('0x46')](handleError(_0x554ac3,null));};exports[_0x86d4('0x4b')]=function(_0x5b58f6,_0x35ab9f){return db[_0x86d4('0x2f')][_0x86d4('0x4b')](_0x5b58f6['body'],{})[_0x86d4('0x28')](respondWithResult(_0x35ab9f,0xc9))[_0x86d4('0x46')](handleError(_0x35ab9f,null));};exports['update']=function(_0x4d05c1,_0x151f22){if(_0x4d05c1[_0x86d4('0x4c')]['id']){delete _0x4d05c1[_0x86d4('0x4c')]['id'];}return db['VoiceQueueReport'][_0x86d4('0x4a')]({'where':{'id':_0x4d05c1[_0x86d4('0x47')]['id']}})['then'](handleEntityNotFound(_0x151f22,null))[_0x86d4('0x28')](saveUpdates(_0x4d05c1[_0x86d4('0x4c')],null))[_0x86d4('0x28')](respondWithResult(_0x151f22,null))[_0x86d4('0x46')](handleError(_0x151f22,null));};exports[_0x86d4('0x29')]=function(_0x5ceedf,_0xb44628){return db['VoiceQueueReport'][_0x86d4('0x4a')]({'where':{'id':_0x5ceedf[_0x86d4('0x47')]['id']}})[_0x86d4('0x28')](handleEntityNotFound(_0xb44628,null))['then'](removeEntity(_0xb44628,null))[_0x86d4('0x46')](handleError(_0xb44628,null));};exports[_0x86d4('0x4d')]=function(_0x5a4976,_0xa335b1){return db[_0x86d4('0x2f')]['describe']()['then'](respondWithResult(_0xa335b1,null))[_0x86d4('0x46')](handleError(_0xa335b1,null));};exports[_0x86d4('0x4e')]=function(_0x59adba,_0x151d00){var _0x455154={},_0x423ed7={},_0x436a07={'count':0x0,'rows':[]};_0x423ed7[_0x86d4('0x33')]=_['keys'](db[_0x86d4('0x2f')]['rawAttributes']);_0x423ed7[_0x86d4('0x34')]=_[_0x86d4('0x35')](_0x59adba['query']);_0x423ed7['filters']=_[_0x86d4('0x49')](_0x423ed7['model'],_0x423ed7[_0x86d4('0x34')]);_0x455154[_0x86d4('0x36')]=_[_0x86d4('0x49')](_0x423ed7[_0x86d4('0x33')],qs[_0x86d4('0x37')](_0x59adba[_0x86d4('0x34')][_0x86d4('0x37')]));_0x455154[_0x86d4('0x36')]=_0x455154[_0x86d4('0x36')]['length']?_0x455154['attributes']:_0x423ed7[_0x86d4('0x33')];if(!_0x59adba[_0x86d4('0x34')][_0x86d4('0x38')]('nolimit')){_0x455154[_0x86d4('0x21')]=qs[_0x86d4('0x21')](_0x59adba[_0x86d4('0x34')][_0x86d4('0x21')]);_0x455154['offset']=qs[_0x86d4('0x1f')](_0x59adba[_0x86d4('0x34')][_0x86d4('0x1f')]);}_0x455154[_0x86d4('0x3a')]=qs[_0x86d4('0x3b')](_0x59adba['query']['sort']);_0x455154[_0x86d4('0x3e')]=qs[_0x86d4('0x48')](_['pick'](_0x59adba['query'],_0x423ed7[_0x86d4('0x48')]));if(_0x59adba['query'][_0x86d4('0x3d')]){_0x455154[_0x86d4('0x3e')]=_[_0x86d4('0x3f')](_0x455154[_0x86d4('0x3e')],{'$or':_[_0x86d4('0x2e')](_0x455154[_0x86d4('0x36')],function(_0x90736e){var _0x12aa9e={};_0x12aa9e[_0x90736e]={'$like':'%'+_0x59adba[_0x86d4('0x34')][_0x86d4('0x3d')]+'%'};return _0x12aa9e;})});}_0x455154=_['merge']({},_0x455154,_0x59adba[_0x86d4('0x41')]);var _0x18d4f0={'where':_0x455154[_0x86d4('0x3e')]};return db[_0x86d4('0x2f')][_0x86d4('0x22')](_0x18d4f0)[_0x86d4('0x28')](function(_0x4fc5a5){_0x436a07[_0x86d4('0x22')]=_0x4fc5a5;if(_0x59adba[_0x86d4('0x34')][_0x86d4('0x42')]){_0x455154[_0x86d4('0x43')]=[{'all':!![]}];}return db[_0x86d4('0x2f')]['findAll'](_0x455154);})[_0x86d4('0x28')](function(_0x4373ad){_0x436a07['rows']=_0x4373ad;return _0x436a07;})['then'](respondWithFilteredResult(_0x151d00,_0x455154,_0x86d4('0x4e')))[_0x86d4('0x46')](handleError(_0x151d00,null,_0x86d4('0x4e')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 64fa7e5..3b536a5 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 _0xbd8e=['update','remove','emit','../../mysqldb','VoiceQueueReport','save'];(function(_0x2f3209,_0x3e8421){var _0x4564eb=function(_0xe0e2b){while(--_0xe0e2b){_0x2f3209['push'](_0x2f3209['shift']());}};_0x4564eb(++_0x3e8421);}(_0xbd8e,0x13b));var _0xebd8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbd8e[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xebd8('0x0'))['db'][_0xebd8('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xebd8('0x2'),'afterUpdate':_0xebd8('0x3'),'afterDestroy':_0xebd8('0x4')};function emitEvent(_0x4f7d31){return function(_0x20807b,_0x77c304,_0x1ede10){VoiceQueueReportEvents[_0xebd8('0x5')](_0x4f7d31+':'+_0x20807b['id'],_0x20807b);VoiceQueueReportEvents[_0xebd8('0x5')](_0x4f7d31,_0x20807b);_0x1ede10(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0xd17c=['events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x348461,_0x47a721){var _0x5b30f6=function(_0x594e30){while(--_0x594e30){_0x348461['push'](_0x348461['shift']());}};_0x5b30f6(++_0x47a721);}(_0xd17c,0xd1));var _0xcd17=function(_0x158de7,_0x369b23){_0x158de7=_0x158de7-0x0;var _0x24d61e=_0xd17c[_0x158de7];return _0x24d61e;};'use strict';var EventEmitter=require(_0xcd17('0x0'));var VoiceQueueReport=require(_0xcd17('0x1'))['db'][_0xcd17('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xcd17('0x3')](0x0);var events={'afterCreate':_0xcd17('0x4'),'afterUpdate':_0xcd17('0x5'),'afterDestroy':_0xcd17('0x6')};function emitEvent(_0x339f8b){return function(_0x5d0f6e,_0x38147b,_0x60cd56){VoiceQueueReportEvents['emit'](_0x339f8b+':'+_0x5d0f6e['id'],_0x5d0f6e);VoiceQueueReportEvents[_0xcd17('0x7')](_0x339f8b,_0x5d0f6e);_0x60cd56(null);};}for(var e in events){if(events[_0xcd17('0x8')](e)){var event=events[e];VoiceQueueReport[_0xcd17('0x9')](e,emitEvent(event));}}module[_0xcd17('0xa')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index f043055..2f03df7 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 _0x5fb3=['api','moment','bluebird','path','rimraf','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fb3,0x138));var _0x35fb=function(_0x5e9da3,_0x86e482){_0x5e9da3=_0x5e9da3-0x0;var _0x567a27=_0x5fb3[_0x5e9da3];return _0x567a27;};'use strict';var _=require(_0x35fb('0x0'));var util=require(_0x35fb('0x1'));var logger=require(_0x35fb('0x2'))(_0x35fb('0x3'));var moment=require(_0x35fb('0x4'));var BPromise=require(_0x35fb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x35fb('0x6'));var rimraf=require(_0x35fb('0x7'));var config=require(_0x35fb('0x8'));var attributes=require(_0x35fb('0x9'));module['exports']=function(_0x436fd4,_0x5c660e){return _0x436fd4[_0x35fb('0xa')](_0x35fb('0xb'),attributes,{'tableName':_0x35fb('0xc'),'paranoid':![],'indexes':[{'fields':[_0x35fb('0xd')]},{'fields':[_0x35fb('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa901=['./voiceQueueReport.attributes','define','report_queue','uniqueid','calleridnum','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x52cd61,_0x2b8b85){var _0x26f8ea=function(_0x32de68){while(--_0x32de68){_0x52cd61['push'](_0x52cd61['shift']());}};_0x26f8ea(++_0x2b8b85);}(_0xa901,0x65));var _0x1a90=function(_0x32cfcd,_0x45c746){_0x32cfcd=_0x32cfcd-0x0;var _0x432baa=_0xa901[_0x32cfcd];return _0x432baa;};'use strict';var _=require('lodash');var util=require(_0x1a90('0x0'));var logger=require(_0x1a90('0x1'))(_0x1a90('0x2'));var moment=require(_0x1a90('0x3'));var BPromise=require('bluebird');var rp=require(_0x1a90('0x4'));var fs=require('fs');var path=require(_0x1a90('0x5'));var rimraf=require(_0x1a90('0x6'));var config=require('../../config/environment');var attributes=require(_0x1a90('0x7'));module['exports']=function(_0x1c3e0d,_0x19eb97){return _0x1c3e0d[_0x1a90('0x8')]('VoiceQueueReport',attributes,{'tableName':_0x1a90('0x9'),'paranoid':![],'indexes':[{'fields':[_0x1a90('0xa')]},{'fields':[_0x1a90('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 8da7325..9935525 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 _0x4c5a=['client','redis','defaults','localhost','./voiceQueueReport.socket','register','then','info','request\x20sent','debug','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','map','include','model','attributes','catch','CreateVoiceQueueReport','create','body','limit','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1a8bbc,_0x17a086){var _0x212fc2=function(_0x55c718){while(--_0x55c718){_0x1a8bbc['push'](_0x1a8bbc['shift']());}};_0x212fc2(++_0x17a086);}(_0x4c5a,0x13e));var _0xa4c5=function(_0x4fdc46,_0x2a3759){_0x4fdc46=_0x4fdc46-0x0;var _0x2c178a=_0x4c5a[_0x4fdc46];return _0x2c178a;};'use strict';var _=require(_0xa4c5('0x0'));var util=require(_0xa4c5('0x1'));var moment=require(_0xa4c5('0x2'));var BPromise=require(_0xa4c5('0x3'));var rs=require(_0xa4c5('0x4'));var fs=require('fs');var Redis=require(_0xa4c5('0x5'));var db=require(_0xa4c5('0x6'))['db'];var utils=require(_0xa4c5('0x7'));var logger=require('../../config/logger')(_0xa4c5('0x8'));var config=require(_0xa4c5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa4c5('0xa')]['http']({'port':0x232a});config[_0xa4c5('0xb')]=_[_0xa4c5('0xc')](config[_0xa4c5('0xb')],{'host':_0xa4c5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa4c5('0xb')]));require(_0xa4c5('0xe'))[_0xa4c5('0xf')](socket);function respondWithRpcPromise(_0x9812b1,_0x2d68d2,_0x1f17e6){return new BPromise(function(_0x41ef46,_0x55091d){return client['request'](_0x9812b1,_0x1f17e6)[_0xa4c5('0x10')](function(_0x54b76d){logger[_0xa4c5('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x2d68d2,_0xa4c5('0x12'));logger[_0xa4c5('0x13')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x2d68d2,'request\x20sent',JSON[_0xa4c5('0x14')](_0x54b76d));if(_0x54b76d[_0xa4c5('0x15')]){if(_0x54b76d[_0xa4c5('0x15')][_0xa4c5('0x16')]===0x1f4){logger[_0xa4c5('0x15')](_0xa4c5('0x17'),_0x2d68d2,_0x54b76d[_0xa4c5('0x15')]['message']);return _0x55091d(_0x54b76d[_0xa4c5('0x15')][_0xa4c5('0x18')]);}logger[_0xa4c5('0x15')](_0xa4c5('0x17'),_0x2d68d2,_0x54b76d['error'][_0xa4c5('0x18')]);return _0x41ef46(_0x54b76d[_0xa4c5('0x15')]['message']);}else{logger[_0xa4c5('0x11')](_0xa4c5('0x17'),_0x2d68d2,'request\x20sent');_0x41ef46(_0x54b76d[_0xa4c5('0x19')]['message']);}})['catch'](function(_0xceb18){logger[_0xa4c5('0x15')](_0xa4c5('0x17'),_0x2d68d2,_0xceb18);_0x55091d(_0xceb18);});});}exports[_0xa4c5('0x1a')]=function(_0x1bb4ec){var _0x331640=this;return new Promise(function(_0x81d265,_0x512912){return db[_0xa4c5('0x1b')][_0xa4c5('0x1c')]({'raw':_0x1bb4ec[_0xa4c5('0x1d')]?_0x1bb4ec[_0xa4c5('0x1d')][_0xa4c5('0x1e')]===undefined?!![]:![]:!![],'where':_0x1bb4ec['options']?_0x1bb4ec[_0xa4c5('0x1d')]['where']||null:null,'attributes':_0x1bb4ec[_0xa4c5('0x1d')]?_0x1bb4ec[_0xa4c5('0x1d')]['attributes']||null:null,'limit':_0x1bb4ec[_0xa4c5('0x1d')]?_0x1bb4ec[_0xa4c5('0x1d')]['limit']||null:null,'include':_0x1bb4ec[_0xa4c5('0x1d')]?_0x1bb4ec['options']['include']?_[_0xa4c5('0x1f')](_0x1bb4ec[_0xa4c5('0x1d')][_0xa4c5('0x20')],function(_0x3fbefb){return{'model':db[_0x3fbefb[_0xa4c5('0x21')]],'as':_0x3fbefb['as'],'attributes':_0x3fbefb[_0xa4c5('0x22')],'include':_0x3fbefb['include']?_[_0xa4c5('0x1f')](_0x3fbefb[_0xa4c5('0x20')],function(_0x3ff7f1){return{'model':db[_0x3ff7f1[_0xa4c5('0x21')]],'as':_0x3ff7f1['as'],'attributes':_0x3ff7f1[_0xa4c5('0x22')],'include':_0x3ff7f1[_0xa4c5('0x20')]?_['map'](_0x3ff7f1[_0xa4c5('0x20')],function(_0x71430b){return{'model':db[_0x71430b[_0xa4c5('0x21')]],'as':_0x71430b['as'],'attributes':_0x71430b['attributes']};}):[]};}):[]};}):[]:[]})[_0xa4c5('0x10')](function(_0x43c40f){logger['info']('GetVoiceQueueReport',_0x1bb4ec);logger[_0xa4c5('0x13')](_0xa4c5('0x1a'),_0x1bb4ec,JSON[_0xa4c5('0x14')](_0x43c40f));_0x81d265(_0x43c40f);})[_0xa4c5('0x23')](function(_0x329e20){logger[_0xa4c5('0x15')](_0xa4c5('0x1a'),_0x329e20['message'],_0x1bb4ec);_0x512912(_0x331640['error'](0x1f4,_0x329e20[_0xa4c5('0x18')]));});});};exports[_0xa4c5('0x24')]=function(_0x2299fa){var _0x15fa87=this;return new Promise(function(_0x21e100,_0x40c54b){return db[_0xa4c5('0x1b')][_0xa4c5('0x25')](_0x2299fa[_0xa4c5('0x26')],{'raw':_0x2299fa['options']?_0x2299fa[_0xa4c5('0x1d')][_0xa4c5('0x1e')]===undefined?!![]:![]:!![]})[_0xa4c5('0x10')](function(_0x24b73c){logger[_0xa4c5('0x11')](_0xa4c5('0x24'),_0x2299fa);logger['debug'](_0xa4c5('0x24'),_0x2299fa,JSON['stringify'](_0x24b73c));_0x21e100(_0x24b73c);})['catch'](function(_0x5c4032){logger['error'](_0xa4c5('0x24'),_0x5c4032['message'],_0x2299fa);_0x40c54b(_0x15fa87['error'](0x1f4,_0x5c4032['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x5addda){var _0x81e0d7=this;return new Promise(function(_0x49f2d1,_0x2d0834){return db[_0xa4c5('0x1b')]['update'](_0x5addda[_0xa4c5('0x26')],{'raw':_0x5addda[_0xa4c5('0x1d')]?_0x5addda[_0xa4c5('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5addda[_0xa4c5('0x1d')]?_0x5addda['options']['where']||null:null,'attributes':_0x5addda[_0xa4c5('0x1d')]?_0x5addda[_0xa4c5('0x1d')][_0xa4c5('0x22')]||null:null,'limit':_0x5addda[_0xa4c5('0x1d')]?_0x5addda[_0xa4c5('0x1d')][_0xa4c5('0x27')]||null:null})['then'](function(_0x3c2387){logger[_0xa4c5('0x11')](_0xa4c5('0x28'),_0x5addda);logger[_0xa4c5('0x13')](_0xa4c5('0x28'),_0x5addda,JSON[_0xa4c5('0x14')](_0x3c2387));_0x49f2d1(_0x3c2387);})[_0xa4c5('0x23')](function(_0x2f86e9){logger[_0xa4c5('0x15')]('UpdateVoiceQueueReport',_0x2f86e9['message'],_0x5addda);_0x2d0834(_0x81e0d7['error'](0x1f4,_0x2f86e9[_0xa4c5('0x18')]));});});}; \ No newline at end of file +var _0xc874=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','info','request\x20sent','debug','stringify','error','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','limit','model','attributes','include','map','then','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','body','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x432e03,_0x23ae2e){var _0x3ebb01=function(_0x553f3f){while(--_0x553f3f){_0x432e03['push'](_0x432e03['shift']());}};_0x3ebb01(++_0x23ae2e);}(_0xc874,0x104));var _0x4c87=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0xc874[_0x4d07cc];return _0x42de3b;};'use strict';var _=require(_0x4c87('0x0'));var util=require(_0x4c87('0x1'));var moment=require(_0x4c87('0x2'));var BPromise=require(_0x4c87('0x3'));var rs=require(_0x4c87('0x4'));var fs=require('fs');var Redis=require(_0x4c87('0x5'));var db=require(_0x4c87('0x6'))['db'];var utils=require(_0x4c87('0x7'));var logger=require('../../config/logger')(_0x4c87('0x8'));var config=require(_0x4c87('0x9'));var jayson=require(_0x4c87('0xa'));var client=jayson[_0x4c87('0xb')]['http']({'port':0x232a});config[_0x4c87('0xc')]=_[_0x4c87('0xd')](config[_0x4c87('0xc')],{'host':_0x4c87('0xe'),'port':0x18eb});var socket=require(_0x4c87('0xf'))(new Redis(config['redis']));require(_0x4c87('0x10'))[_0x4c87('0x11')](socket);function respondWithRpcPromise(_0x12fb25,_0x1789c7,_0x209df1){return new BPromise(function(_0x11c363,_0x1b1e26){return client[_0x4c87('0x12')](_0x12fb25,_0x209df1)['then'](function(_0x3899ad){logger[_0x4c87('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x1789c7,_0x4c87('0x14'));logger[_0x4c87('0x15')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x1789c7,'request\x20sent',JSON[_0x4c87('0x16')](_0x3899ad));if(_0x3899ad[_0x4c87('0x17')]){if(_0x3899ad[_0x4c87('0x17')]['code']===0x1f4){logger[_0x4c87('0x17')](_0x4c87('0x18'),_0x1789c7,_0x3899ad[_0x4c87('0x17')][_0x4c87('0x19')]);return _0x1b1e26(_0x3899ad[_0x4c87('0x17')][_0x4c87('0x19')]);}logger['error'](_0x4c87('0x18'),_0x1789c7,_0x3899ad[_0x4c87('0x17')][_0x4c87('0x19')]);return _0x11c363(_0x3899ad[_0x4c87('0x17')][_0x4c87('0x19')]);}else{logger[_0x4c87('0x13')](_0x4c87('0x18'),_0x1789c7,_0x4c87('0x14'));_0x11c363(_0x3899ad[_0x4c87('0x1a')][_0x4c87('0x19')]);}})[_0x4c87('0x1b')](function(_0x494c4f){logger[_0x4c87('0x17')](_0x4c87('0x18'),_0x1789c7,_0x494c4f);_0x1b1e26(_0x494c4f);});});}exports[_0x4c87('0x1c')]=function(_0x3f653f){var _0xa4480b=this;return new Promise(function(_0x444786,_0x20d1df){return db[_0x4c87('0x1d')][_0x4c87('0x1e')]({'raw':_0x3f653f[_0x4c87('0x1f')]?_0x3f653f['options']['raw']===undefined?!![]:![]:!![],'where':_0x3f653f[_0x4c87('0x1f')]?_0x3f653f[_0x4c87('0x1f')][_0x4c87('0x20')]||null:null,'attributes':_0x3f653f[_0x4c87('0x1f')]?_0x3f653f['options']['attributes']||null:null,'limit':_0x3f653f[_0x4c87('0x1f')]?_0x3f653f[_0x4c87('0x1f')][_0x4c87('0x21')]||null:null,'include':_0x3f653f[_0x4c87('0x1f')]?_0x3f653f[_0x4c87('0x1f')]['include']?_['map'](_0x3f653f[_0x4c87('0x1f')]['include'],function(_0x5e9620){return{'model':db[_0x5e9620[_0x4c87('0x22')]],'as':_0x5e9620['as'],'attributes':_0x5e9620[_0x4c87('0x23')],'include':_0x5e9620[_0x4c87('0x24')]?_[_0x4c87('0x25')](_0x5e9620['include'],function(_0x1954ca){return{'model':db[_0x1954ca[_0x4c87('0x22')]],'as':_0x1954ca['as'],'attributes':_0x1954ca[_0x4c87('0x23')],'include':_0x1954ca[_0x4c87('0x24')]?_[_0x4c87('0x25')](_0x1954ca[_0x4c87('0x24')],function(_0x3714fc){return{'model':db[_0x3714fc[_0x4c87('0x22')]],'as':_0x3714fc['as'],'attributes':_0x3714fc[_0x4c87('0x23')]};}):[]};}):[]};}):[]:[]})[_0x4c87('0x26')](function(_0x38b58d){logger['info']('GetVoiceQueueReport',_0x3f653f);logger[_0x4c87('0x15')](_0x4c87('0x1c'),_0x3f653f,JSON[_0x4c87('0x16')](_0x38b58d));_0x444786(_0x38b58d);})['catch'](function(_0x2cd011){logger[_0x4c87('0x17')](_0x4c87('0x1c'),_0x2cd011[_0x4c87('0x19')],_0x3f653f);_0x20d1df(_0xa4480b['error'](0x1f4,_0x2cd011[_0x4c87('0x19')]));});});};exports[_0x4c87('0x27')]=function(_0xb97b8){var _0x5f508b=this;return new Promise(function(_0x19896e,_0x339cfe){return db[_0x4c87('0x1d')][_0x4c87('0x28')](_0xb97b8['body'],{'raw':_0xb97b8['options']?_0xb97b8['options']['raw']===undefined?!![]:![]:!![]})[_0x4c87('0x26')](function(_0x37e560){logger[_0x4c87('0x13')]('CreateVoiceQueueReport',_0xb97b8);logger['debug']('CreateVoiceQueueReport',_0xb97b8,JSON['stringify'](_0x37e560));_0x19896e(_0x37e560);})[_0x4c87('0x1b')](function(_0x328606){logger[_0x4c87('0x17')](_0x4c87('0x27'),_0x328606[_0x4c87('0x19')],_0xb97b8);_0x339cfe(_0x5f508b['error'](0x1f4,_0x328606[_0x4c87('0x19')]));});});};exports[_0x4c87('0x29')]=function(_0x278a0f){var _0x4a6447=this;return new Promise(function(_0x272973,_0x2a8617){return db[_0x4c87('0x1d')][_0x4c87('0x2a')](_0x278a0f[_0x4c87('0x2b')],{'raw':_0x278a0f[_0x4c87('0x1f')]?_0x278a0f[_0x4c87('0x1f')][_0x4c87('0x2c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x278a0f[_0x4c87('0x1f')]?_0x278a0f[_0x4c87('0x1f')][_0x4c87('0x20')]||null:null,'attributes':_0x278a0f['options']?_0x278a0f['options'][_0x4c87('0x23')]||null:null,'limit':_0x278a0f[_0x4c87('0x1f')]?_0x278a0f['options'][_0x4c87('0x21')]||null:null})[_0x4c87('0x26')](function(_0x12486e){logger[_0x4c87('0x13')](_0x4c87('0x29'),_0x278a0f);logger[_0x4c87('0x15')](_0x4c87('0x29'),_0x278a0f,JSON[_0x4c87('0x16')](_0x12486e));_0x272973(_0x12486e);})[_0x4c87('0x1b')](function(_0x62d2d2){logger[_0x4c87('0x17')](_0x4c87('0x29'),_0x62d2d2['message'],_0x278a0f);_0x2a8617(_0x4a6447['error'](0x1f4,_0x62d2d2[_0x4c87('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 217d99c..bf2d66b 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 _0x6379=['emit','removeListener','register','voiceQueueReport:','./voiceQueueReport.events','save','remove','update'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6379,0x84));var _0x9637=function(_0x142026,_0x49dda6){_0x142026=_0x142026-0x0;var _0x5e199f=_0x6379[_0x142026];return _0x5e199f;};'use strict';var VoiceQueueReportEvents=require(_0x9637('0x0'));var events=[_0x9637('0x1'),_0x9637('0x2'),_0x9637('0x3')];function createListener(_0x19949a,_0x52d27e){return function(_0x44a9ae){_0x52d27e[_0x9637('0x4')](_0x19949a,_0x44a9ae);};}function removeListener(_0x5f1058,_0x5f50c5){return function(){VoiceQueueReportEvents[_0x9637('0x5')](_0x5f1058,_0x5f50c5);};}exports[_0x9637('0x6')]=function(_0x19f7d0){for(var _0x25087c=0x0,_0xf0db9f=events['length'];_0x25087c<_0xf0db9f;_0x25087c++){var _0x515a84=events[_0x25087c];var _0x21d91b=createListener(_0x9637('0x7')+_0x515a84,_0x19f7d0);VoiceQueueReportEvents['on'](_0x515a84,_0x21d91b);}}; \ No newline at end of file +var _0x4944=['removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','remove','update'];(function(_0x29678a,_0x183038){var _0x47c4ef=function(_0x50efde){while(--_0x50efde){_0x29678a['push'](_0x29678a['shift']());}};_0x47c4ef(++_0x183038);}(_0x4944,0x6d));var _0x4494=function(_0x58206b,_0x17d1cd){_0x58206b=_0x58206b-0x0;var _0x70bfaa=_0x4944[_0x58206b];return _0x70bfaa;};'use strict';var VoiceQueueReportEvents=require(_0x4494('0x0'));var events=['save',_0x4494('0x1'),_0x4494('0x2')];function createListener(_0x2578d3,_0x138f00){return function(_0x22adf0){_0x138f00['emit'](_0x2578d3,_0x22adf0);};}function removeListener(_0x187098,_0x5c7492){return function(){VoiceQueueReportEvents[_0x4494('0x3')](_0x187098,_0x5c7492);};}exports[_0x4494('0x4')]=function(_0x38480d){for(var _0xb94d02=0x0,_0x2a4911=events[_0x4494('0x5')];_0xb94d02<_0x2a4911;_0xb94d02++){var _0x55bb81=events[_0xb94d02];var _0x12ef8e=createListener(_0x4494('0x6')+_0x55bb81,_0x38480d);VoiceQueueReportEvents['on'](_0x55bb81,_0x12ef8e);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 11d25e0..070c61f 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 _0x8e6a=['/:id','post','create','put','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','index'];(function(_0x429948,_0x1a6851){var _0x35d5d1=function(_0x574853){while(--_0x574853){_0x429948['push'](_0x429948['shift']());}};_0x35d5d1(++_0x1a6851);}(_0x8e6a,0x105));var _0xa8e6=function(_0x441a68,_0x3140b1){_0x441a68=_0x441a68-0x0;var _0x5644d3=_0x8e6a[_0x441a68];return _0x5644d3;};'use strict';var multer=require(_0xa8e6('0x0'));var util=require(_0xa8e6('0x1'));var path=require('path');var timeout=require(_0xa8e6('0x2'));var express=require(_0xa8e6('0x3'));var router=express[_0xa8e6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa8e6('0x5'));var interaction=require(_0xa8e6('0x6'));var config=require('../../config/environment');var controller=require(_0xa8e6('0x7'));router[_0xa8e6('0x8')]('/',auth[_0xa8e6('0x9')](),controller[_0xa8e6('0xa')]);router[_0xa8e6('0x8')](_0xa8e6('0xb'),auth[_0xa8e6('0x9')](),controller['show']);router[_0xa8e6('0xc')]('/',auth['isAuthenticated'](),controller[_0xa8e6('0xd')]);router[_0xa8e6('0xe')](_0xa8e6('0xb'),auth[_0xa8e6('0x9')](),controller['update']);router[_0xa8e6('0xf')](_0xa8e6('0xb'),auth[_0xa8e6('0x9')](),controller[_0xa8e6('0x10')]);module['exports']=router; \ No newline at end of file +var _0x8cb4=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','create','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8cb4,0xf3));var _0x48cb=function(_0x5d621b,_0x122552){_0x5d621b=_0x5d621b-0x0;var _0xbee2ba=_0x8cb4[_0x5d621b];return _0xbee2ba;};'use strict';var multer=require(_0x48cb('0x0'));var util=require(_0x48cb('0x1'));var path=require(_0x48cb('0x2'));var timeout=require('connect-timeout');var express=require(_0x48cb('0x3'));var router=express[_0x48cb('0x4')]();var fs_extra=require(_0x48cb('0x5'));var auth=require(_0x48cb('0x6'));var interaction=require(_0x48cb('0x7'));var config=require(_0x48cb('0x8'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth[_0x48cb('0x9')](),controller[_0x48cb('0xa')]);router[_0x48cb('0xb')](_0x48cb('0xc'),auth[_0x48cb('0x9')](),controller['show']);router['post']('/',auth[_0x48cb('0x9')](),controller[_0x48cb('0xd')]);router[_0x48cb('0xe')](_0x48cb('0xc'),auth[_0x48cb('0x9')](),controller[_0x48cb('0xf')]);router[_0x48cb('0x10')](_0x48cb('0xc'),auth[_0x48cb('0x9')](),controller[_0x48cb('0x11')]);module[_0x48cb('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 8735e6b..5f754b0 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 _0xb84b=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','moment','STRING','DATE','literal'];(function(_0xeeb156,_0x5392f4){var _0x4b7c74=function(_0x5705bb){while(--_0x5705bb){_0xeeb156['push'](_0xeeb156['shift']());}};_0x4b7c74(++_0x5392f4);}(_0xb84b,0x18c));var _0xbb84=function(_0x36cc6d,_0x49b08f){_0x36cc6d=_0x36cc6d-0x0;var _0x564476=_0xb84b[_0x36cc6d];return _0x564476;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xbb84('0x0'));module['exports']={'time':{'type':Sequelize[_0xbb84('0x1')]},'callid':{'type':Sequelize[_0xbb84('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xbb84('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xbb84('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xbb84('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xbb84('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xbb84('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xbb84('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xbb84('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xbb84('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xbb84('0x2')],'allowNull':![],'defaultValue':Sequelize[_0xbb84('0x3')](_0xbb84('0x4'))}}; \ No newline at end of file +var _0x019e=['DATE','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','moment','exports','STRING'];(function(_0x12e3f4,_0x4a3923){var _0x50d9b4=function(_0x2f0972){while(--_0x2f0972){_0x12e3f4['push'](_0x12e3f4['shift']());}};_0x50d9b4(++_0x4a3923);}(_0x019e,0xe6));var _0xe019=function(_0x35ee4c,_0x44ee31){_0x35ee4c=_0x35ee4c-0x0;var _0x11882c=_0x019e[_0x35ee4c];return _0x11882c;};'use strict';var Sequelize=require(_0xe019('0x0'));var moment=require(_0xe019('0x1'));module[_0xe019('0x2')]={'time':{'type':Sequelize[_0xe019('0x3')]},'callid':{'type':Sequelize[_0xe019('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xe019('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xe019('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xe019('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xe019('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xe019('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xe019('0x4')],'allowNull':![],'defaultValue':Sequelize['literal'](_0xe019('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index f10a1bb..cd1dd3e 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 _0xff79=['querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','map','VoiceQueuesLog','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','squel','crypto','desk.js'];(function(_0x5b0a60,_0x506853){var _0x4ff501=function(_0x43d91a){while(--_0x43d91a){_0x5b0a60['push'](_0x5b0a60['shift']());}};_0x4ff501(++_0x506853);}(_0xff79,0x156));var _0x9ff7=function(_0x25ba5d,_0x50fb62){_0x25ba5d=_0x25ba5d-0x0;var _0x2d39c0=_0xff79[_0x25ba5d];return _0x2d39c0;};'use strict';var emlformat=require(_0x9ff7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9ff7('0x1'));var jsonpatch=require(_0x9ff7('0x2'));var rp=require(_0x9ff7('0x3'));var moment=require(_0x9ff7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9ff7('0x5'));var util=require(_0x9ff7('0x6'));var path=require(_0x9ff7('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9ff7('0x8'));var fs=require('fs');var fs_extra=require(_0x9ff7('0x9'));var _=require('lodash');var squel=require(_0x9ff7('0xa'));var crypto=require(_0x9ff7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9ff7('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9ff7('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9ff7('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x9ff7('0xf'));var hardwareService=require(_0x9ff7('0x10'));var logger=require(_0x9ff7('0x11'))('api');var utils=require(_0x9ff7('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x9ff7('0x13'));var db=require(_0x9ff7('0x14'))['db'];function respondWithStatusCode(_0x47e2ce,_0x3d7c52){_0x3d7c52=_0x3d7c52||0xcc;return function(_0x438c07){if(_0x438c07){return _0x47e2ce[_0x9ff7('0x15')](_0x3d7c52);}return _0x47e2ce[_0x9ff7('0x16')](_0x3d7c52)[_0x9ff7('0x17')]();};}function respondWithResult(_0x348904,_0x3cff94){_0x3cff94=_0x3cff94||0xc8;return function(_0x1e8861){if(_0x1e8861){return _0x348904['status'](_0x3cff94)[_0x9ff7('0x18')](_0x1e8861);}};}function respondWithFilteredResult(_0xa4f305,_0x4d119e){return function(_0xa21379){if(_0xa21379){var _0x5eb4ed=typeof _0x4d119e[_0x9ff7('0x19')]==='undefined'&&typeof _0x4d119e['limit']===_0x9ff7('0x1a');var _0x33364d=_0xa21379['count'];var _0x4980b9=_0x5eb4ed?0x0:_0x4d119e['offset'];var _0x3ed298=_0x5eb4ed?_0xa21379[_0x9ff7('0x1b')]:_0x4d119e['offset']+_0x4d119e[_0x9ff7('0x1c')];var _0x29e5e5;if(_0x3ed298>=_0x33364d){_0x3ed298=_0x33364d;_0x29e5e5=0xc8;}else{_0x29e5e5=0xce;}_0xa4f305[_0x9ff7('0x16')](_0x29e5e5);return _0xa4f305[_0x9ff7('0x1d')](_0x9ff7('0x1e'),_0x4980b9+'-'+_0x3ed298+'/'+_0x33364d)[_0x9ff7('0x18')](_0xa21379);}return null;};}function patchUpdates(_0x556d39){return function(_0x3fdfda){try{jsonpatch[_0x9ff7('0x1f')](_0x3fdfda,_0x556d39,!![]);}catch(_0x578a4f){return BPromise[_0x9ff7('0x20')](_0x578a4f);}return _0x3fdfda[_0x9ff7('0x21')]();};}function saveUpdates(_0x3a3e10,_0x3ca11d){return function(_0x1d6423){if(_0x1d6423){return _0x1d6423[_0x9ff7('0x22')](_0x3a3e10)['then'](function(_0x5656a9){return _0x5656a9;});}return null;};}function removeEntity(_0x165301,_0x334153){return function(_0x4f9b57){if(_0x4f9b57){return _0x4f9b57[_0x9ff7('0x23')]()[_0x9ff7('0x24')](function(){_0x165301[_0x9ff7('0x16')](0xcc)[_0x9ff7('0x17')]();});}};}function handleEntityNotFound(_0x5f4cb2,_0xf6c0bb){return function(_0x2174ae){if(!_0x2174ae){_0x5f4cb2[_0x9ff7('0x15')](0x194);}return _0x2174ae;};}function handleError(_0x3f44cc,_0x156afc){_0x156afc=_0x156afc||0x1f4;return function(_0x20d2fa){logger[_0x9ff7('0x25')](_0x20d2fa[_0x9ff7('0x26')]);if(_0x20d2fa['name']){delete _0x20d2fa[_0x9ff7('0x27')];}_0x3f44cc[_0x9ff7('0x16')](_0x156afc)['send'](_0x20d2fa);};}exports['index']=function(_0x1cd25e,_0x48459b){var _0x52eeef={},_0x26b800={},_0xc827cf={'count':0x0,'rows':[]};var _0x344269=_[_0x9ff7('0x28')](db[_0x9ff7('0x29')][_0x9ff7('0x2a')],function(_0x1c86eb){return{'name':_0x1c86eb[_0x9ff7('0x2b')],'type':_0x1c86eb['type'][_0x9ff7('0x2c')]};});_0x26b800['model']=_[_0x9ff7('0x28')](_0x344269,_0x9ff7('0x27'));_0x26b800[_0x9ff7('0x2d')]=_[_0x9ff7('0x2e')](_0x1cd25e['query']);_0x26b800[_0x9ff7('0x2f')]=_[_0x9ff7('0x30')](_0x26b800['model'],_0x26b800[_0x9ff7('0x2d')]);_0x52eeef['attributes']=_[_0x9ff7('0x30')](_0x26b800[_0x9ff7('0x31')],qs['fields'](_0x1cd25e['query'][_0x9ff7('0x32')]));_0x52eeef[_0x9ff7('0x33')]=_0x52eeef[_0x9ff7('0x33')][_0x9ff7('0x34')]?_0x52eeef[_0x9ff7('0x33')]:_0x26b800['model'];if(!_0x1cd25e[_0x9ff7('0x2d')][_0x9ff7('0x35')](_0x9ff7('0x36'))){_0x52eeef['limit']=qs[_0x9ff7('0x1c')](_0x1cd25e[_0x9ff7('0x2d')][_0x9ff7('0x1c')]);_0x52eeef[_0x9ff7('0x19')]=qs[_0x9ff7('0x19')](_0x1cd25e[_0x9ff7('0x2d')][_0x9ff7('0x19')]);}_0x52eeef[_0x9ff7('0x37')]=qs[_0x9ff7('0x38')](_0x1cd25e[_0x9ff7('0x2d')][_0x9ff7('0x38')]);_0x52eeef[_0x9ff7('0x39')]=qs[_0x9ff7('0x2f')](_[_0x9ff7('0x3a')](_0x1cd25e[_0x9ff7('0x2d')],_0x26b800['filters']),_0x344269);if(_0x1cd25e[_0x9ff7('0x2d')][_0x9ff7('0x3b')]){_0x52eeef['where']=_[_0x9ff7('0x3c')](_0x52eeef[_0x9ff7('0x39')],{'$or':_[_0x9ff7('0x28')](_0x344269,function(_0x299a35){if(_0x299a35['type']!==_0x9ff7('0x3d')){var _0x3a497e={};_0x3a497e[_0x299a35['name']]={'$like':'%'+_0x1cd25e[_0x9ff7('0x2d')]['filter']+'%'};return _0x3a497e;}})});}_0x52eeef=_[_0x9ff7('0x3c')]({},_0x52eeef,_0x1cd25e['options']);var _0x58a89d={'where':_0x52eeef[_0x9ff7('0x39')]};return db[_0x9ff7('0x29')][_0x9ff7('0x1b')](_0x58a89d)[_0x9ff7('0x24')](function(_0xd2ddf2){_0xc827cf['count']=_0xd2ddf2;if(_0x1cd25e[_0x9ff7('0x2d')][_0x9ff7('0x3e')]){_0x52eeef[_0x9ff7('0x3f')]=[{'all':!![]}];}return db[_0x9ff7('0x29')][_0x9ff7('0x40')](_0x52eeef);})[_0x9ff7('0x24')](function(_0x15f0a3){_0xc827cf['rows']=_0x15f0a3;return _0xc827cf;})[_0x9ff7('0x24')](respondWithFilteredResult(_0x48459b,_0x52eeef))[_0x9ff7('0x41')](handleError(_0x48459b,null));};exports[_0x9ff7('0x42')]=function(_0x495225,_0x4dff36){var _0x15d4ab={'raw':!![],'where':{'id':_0x495225[_0x9ff7('0x43')]['id']}},_0x3975b1={};_0x3975b1[_0x9ff7('0x31')]=_[_0x9ff7('0x2e')](db[_0x9ff7('0x29')][_0x9ff7('0x2a')]);_0x3975b1[_0x9ff7('0x2d')]=_[_0x9ff7('0x2e')](_0x495225[_0x9ff7('0x2d')]);_0x3975b1[_0x9ff7('0x2f')]=_['intersection'](_0x3975b1['model'],_0x3975b1[_0x9ff7('0x2d')]);_0x15d4ab[_0x9ff7('0x33')]=_['intersection'](_0x3975b1[_0x9ff7('0x31')],qs[_0x9ff7('0x32')](_0x495225[_0x9ff7('0x2d')][_0x9ff7('0x32')]));_0x15d4ab[_0x9ff7('0x33')]=_0x15d4ab[_0x9ff7('0x33')][_0x9ff7('0x34')]?_0x15d4ab[_0x9ff7('0x33')]:_0x3975b1['model'];if(_0x495225[_0x9ff7('0x2d')][_0x9ff7('0x3e')]){_0x15d4ab[_0x9ff7('0x3f')]=[{'all':!![]}];}_0x15d4ab=_[_0x9ff7('0x3c')]({},_0x15d4ab,_0x495225['options']);return db[_0x9ff7('0x29')][_0x9ff7('0x44')](_0x15d4ab)['then'](handleEntityNotFound(_0x4dff36,null))['then'](respondWithResult(_0x4dff36,null))[_0x9ff7('0x41')](handleError(_0x4dff36,null));};exports[_0x9ff7('0x45')]=function(_0x28a0e6,_0x34b944){return db['VoiceQueuesLog'][_0x9ff7('0x45')](_0x28a0e6[_0x9ff7('0x46')],{})['then'](respondWithResult(_0x34b944,0xc9))[_0x9ff7('0x41')](handleError(_0x34b944,null));};exports[_0x9ff7('0x22')]=function(_0x5da5a4,_0x13e3b1){if(_0x5da5a4[_0x9ff7('0x46')]['id']){delete _0x5da5a4[_0x9ff7('0x46')]['id'];}return db[_0x9ff7('0x29')][_0x9ff7('0x44')]({'where':{'id':_0x5da5a4[_0x9ff7('0x43')]['id']}})[_0x9ff7('0x24')](handleEntityNotFound(_0x13e3b1,null))[_0x9ff7('0x24')](saveUpdates(_0x5da5a4[_0x9ff7('0x46')],null))[_0x9ff7('0x24')](respondWithResult(_0x13e3b1,null))[_0x9ff7('0x41')](handleError(_0x13e3b1,null));};exports[_0x9ff7('0x23')]=function(_0x6b34c9,_0x25b391){return db[_0x9ff7('0x29')][_0x9ff7('0x44')]({'where':{'id':_0x6b34c9[_0x9ff7('0x43')]['id']}})[_0x9ff7('0x24')](handleEntityNotFound(_0x25b391,null))[_0x9ff7('0x24')](removeEntity(_0x25b391,null))[_0x9ff7('0x41')](handleError(_0x25b391,null));}; \ No newline at end of file +var _0x53ae=['crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel'];(function(_0x2b9790,_0x4d37fc){var _0x1caf58=function(_0x151051){while(--_0x151051){_0x2b9790['push'](_0x2b9790['shift']());}};_0x1caf58(++_0x4d37fc);}(_0x53ae,0x161));var _0xe53a=function(_0x3bcc63,_0x484411){_0x3bcc63=_0x3bcc63-0x0;var _0x1313e1=_0x53ae[_0x3bcc63];return _0x1313e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe53a('0x0'));var zipdir=require(_0xe53a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe53a('0x2'));var moment=require(_0xe53a('0x3'));var BPromise=require(_0xe53a('0x4'));var Mustache=require(_0xe53a('0x5'));var util=require(_0xe53a('0x6'));var path=require('path');var sox=require(_0xe53a('0x7'));var csv=require(_0xe53a('0x8'));var ejs=require(_0xe53a('0x9'));var fs=require('fs');var fs_extra=require(_0xe53a('0xa'));var _=require('lodash');var squel=require(_0xe53a('0xb'));var crypto=require(_0xe53a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe53a('0xd'));var Papa=require(_0xe53a('0xe'));var Redis=require(_0xe53a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe53a('0x10'));var as=require(_0xe53a('0x11'));var hardwareService=require(_0xe53a('0x12'));var logger=require(_0xe53a('0x13'))(_0xe53a('0x14'));var utils=require(_0xe53a('0x15'));var config=require(_0xe53a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe53a('0x17'))['db'];function respondWithStatusCode(_0x326ecc,_0x1222c6){_0x1222c6=_0x1222c6||0xcc;return function(_0x221ec5){if(_0x221ec5){return _0x326ecc[_0xe53a('0x18')](_0x1222c6);}return _0x326ecc[_0xe53a('0x19')](_0x1222c6)[_0xe53a('0x1a')]();};}function respondWithResult(_0x586d0e,_0x491760){_0x491760=_0x491760||0xc8;return function(_0x47cabd){if(_0x47cabd){return _0x586d0e[_0xe53a('0x19')](_0x491760)[_0xe53a('0x1b')](_0x47cabd);}};}function respondWithFilteredResult(_0x5dd7c5,_0x142060){return function(_0x23dce9){if(_0x23dce9){var _0x17032f=typeof _0x142060[_0xe53a('0x1c')]===_0xe53a('0x1d')&&typeof _0x142060[_0xe53a('0x1e')]==='undefined';var _0x770e15=_0x23dce9['count'];var _0x3dc1a7=_0x17032f?0x0:_0x142060[_0xe53a('0x1c')];var _0x48886a=_0x17032f?_0x23dce9[_0xe53a('0x1f')]:_0x142060['offset']+_0x142060[_0xe53a('0x1e')];var _0x2a492e;if(_0x48886a>=_0x770e15){_0x48886a=_0x770e15;_0x2a492e=0xc8;}else{_0x2a492e=0xce;}_0x5dd7c5['status'](_0x2a492e);return _0x5dd7c5['set'](_0xe53a('0x20'),_0x3dc1a7+'-'+_0x48886a+'/'+_0x770e15)[_0xe53a('0x1b')](_0x23dce9);}return null;};}function patchUpdates(_0x3dadeb){return function(_0x291140){try{jsonpatch[_0xe53a('0x21')](_0x291140,_0x3dadeb,!![]);}catch(_0x5e1fa7){return BPromise[_0xe53a('0x22')](_0x5e1fa7);}return _0x291140[_0xe53a('0x23')]();};}function saveUpdates(_0x3f74c7,_0xeb4687){return function(_0x2d98f8){if(_0x2d98f8){return _0x2d98f8[_0xe53a('0x24')](_0x3f74c7)[_0xe53a('0x25')](function(_0x1d62a2){return _0x1d62a2;});}return null;};}function removeEntity(_0x4503e8,_0x563d74){return function(_0x10e787){if(_0x10e787){return _0x10e787[_0xe53a('0x26')]()[_0xe53a('0x25')](function(){_0x4503e8[_0xe53a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x267902,_0xde3a68){return function(_0x11d5d9){if(!_0x11d5d9){_0x267902[_0xe53a('0x18')](0x194);}return _0x11d5d9;};}function handleError(_0x4a0bb8,_0x339483){_0x339483=_0x339483||0x1f4;return function(_0x2ff5c4){logger[_0xe53a('0x27')](_0x2ff5c4['stack']);if(_0x2ff5c4[_0xe53a('0x28')]){delete _0x2ff5c4[_0xe53a('0x28')];}_0x4a0bb8[_0xe53a('0x19')](_0x339483)[_0xe53a('0x29')](_0x2ff5c4);};}exports['index']=function(_0x2ff39b,_0x52b620){var _0xf18e45={},_0xb79af2={},_0x20a9cf={'count':0x0,'rows':[]};var _0xe66210=_[_0xe53a('0x2a')](db[_0xe53a('0x2b')][_0xe53a('0x2c')],function(_0x1316a0){return{'name':_0x1316a0[_0xe53a('0x2d')],'type':_0x1316a0[_0xe53a('0x2e')]['key']};});_0xb79af2[_0xe53a('0x2f')]=_[_0xe53a('0x2a')](_0xe66210,_0xe53a('0x28'));_0xb79af2['query']=_[_0xe53a('0x30')](_0x2ff39b[_0xe53a('0x31')]);_0xb79af2[_0xe53a('0x32')]=_[_0xe53a('0x33')](_0xb79af2[_0xe53a('0x2f')],_0xb79af2[_0xe53a('0x31')]);_0xf18e45[_0xe53a('0x34')]=_['intersection'](_0xb79af2[_0xe53a('0x2f')],qs['fields'](_0x2ff39b['query'][_0xe53a('0x35')]));_0xf18e45['attributes']=_0xf18e45[_0xe53a('0x34')][_0xe53a('0x36')]?_0xf18e45[_0xe53a('0x34')]:_0xb79af2[_0xe53a('0x2f')];if(!_0x2ff39b['query']['hasOwnProperty'](_0xe53a('0x37'))){_0xf18e45['limit']=qs[_0xe53a('0x1e')](_0x2ff39b[_0xe53a('0x31')]['limit']);_0xf18e45[_0xe53a('0x1c')]=qs['offset'](_0x2ff39b[_0xe53a('0x31')][_0xe53a('0x1c')]);}_0xf18e45[_0xe53a('0x38')]=qs[_0xe53a('0x39')](_0x2ff39b[_0xe53a('0x31')][_0xe53a('0x39')]);_0xf18e45[_0xe53a('0x3a')]=qs[_0xe53a('0x32')](_[_0xe53a('0x3b')](_0x2ff39b[_0xe53a('0x31')],_0xb79af2[_0xe53a('0x32')]),_0xe66210);if(_0x2ff39b['query'][_0xe53a('0x3c')]){_0xf18e45[_0xe53a('0x3a')]=_[_0xe53a('0x3d')](_0xf18e45[_0xe53a('0x3a')],{'$or':_[_0xe53a('0x2a')](_0xe66210,function(_0x170daa){if(_0x170daa[_0xe53a('0x2e')]!=='VIRTUAL'){var _0x564a61={};_0x564a61[_0x170daa[_0xe53a('0x28')]]={'$like':'%'+_0x2ff39b[_0xe53a('0x31')][_0xe53a('0x3c')]+'%'};return _0x564a61;}})});}_0xf18e45=_[_0xe53a('0x3d')]({},_0xf18e45,_0x2ff39b[_0xe53a('0x3e')]);var _0x541e32={'where':_0xf18e45['where']};return db[_0xe53a('0x2b')][_0xe53a('0x1f')](_0x541e32)[_0xe53a('0x25')](function(_0x3be169){_0x20a9cf[_0xe53a('0x1f')]=_0x3be169;if(_0x2ff39b[_0xe53a('0x31')][_0xe53a('0x3f')]){_0xf18e45[_0xe53a('0x40')]=[{'all':!![]}];}return db[_0xe53a('0x2b')][_0xe53a('0x41')](_0xf18e45);})['then'](function(_0x32e13b){_0x20a9cf[_0xe53a('0x42')]=_0x32e13b;return _0x20a9cf;})[_0xe53a('0x25')](respondWithFilteredResult(_0x52b620,_0xf18e45))[_0xe53a('0x43')](handleError(_0x52b620,null));};exports[_0xe53a('0x44')]=function(_0x3b85d8,_0x6c94ea){var _0x3fbcac={'raw':!![],'where':{'id':_0x3b85d8[_0xe53a('0x45')]['id']}},_0x9fa31b={};_0x9fa31b[_0xe53a('0x2f')]=_['keys'](db[_0xe53a('0x2b')][_0xe53a('0x2c')]);_0x9fa31b[_0xe53a('0x31')]=_[_0xe53a('0x30')](_0x3b85d8[_0xe53a('0x31')]);_0x9fa31b[_0xe53a('0x32')]=_[_0xe53a('0x33')](_0x9fa31b['model'],_0x9fa31b[_0xe53a('0x31')]);_0x3fbcac['attributes']=_[_0xe53a('0x33')](_0x9fa31b[_0xe53a('0x2f')],qs[_0xe53a('0x35')](_0x3b85d8[_0xe53a('0x31')][_0xe53a('0x35')]));_0x3fbcac[_0xe53a('0x34')]=_0x3fbcac[_0xe53a('0x34')][_0xe53a('0x36')]?_0x3fbcac['attributes']:_0x9fa31b[_0xe53a('0x2f')];if(_0x3b85d8['query']['includeAll']){_0x3fbcac[_0xe53a('0x40')]=[{'all':!![]}];}_0x3fbcac=_['merge']({},_0x3fbcac,_0x3b85d8[_0xe53a('0x3e')]);return db['VoiceQueuesLog']['find'](_0x3fbcac)[_0xe53a('0x25')](handleEntityNotFound(_0x6c94ea,null))[_0xe53a('0x25')](respondWithResult(_0x6c94ea,null))[_0xe53a('0x43')](handleError(_0x6c94ea,null));};exports[_0xe53a('0x46')]=function(_0x42b670,_0x2cc56f){return db[_0xe53a('0x2b')][_0xe53a('0x46')](_0x42b670[_0xe53a('0x47')],{})['then'](respondWithResult(_0x2cc56f,0xc9))[_0xe53a('0x43')](handleError(_0x2cc56f,null));};exports['update']=function(_0xefb3f7,_0x2d794c){if(_0xefb3f7[_0xe53a('0x47')]['id']){delete _0xefb3f7[_0xe53a('0x47')]['id'];}return db[_0xe53a('0x2b')][_0xe53a('0x48')]({'where':{'id':_0xefb3f7['params']['id']}})[_0xe53a('0x25')](handleEntityNotFound(_0x2d794c,null))[_0xe53a('0x25')](saveUpdates(_0xefb3f7[_0xe53a('0x47')],null))[_0xe53a('0x25')](respondWithResult(_0x2d794c,null))[_0xe53a('0x43')](handleError(_0x2d794c,null));};exports[_0xe53a('0x26')]=function(_0x2a59bb,_0x2f5630){return db[_0xe53a('0x2b')]['find']({'where':{'id':_0x2a59bb[_0xe53a('0x45')]['id']}})[_0xe53a('0x25')](handleEntityNotFound(_0x2f5630,null))[_0xe53a('0x25')](removeEntity(_0x2f5630,null))['catch'](handleError(_0x2f5630,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 2cc3a0c..2fe8316 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 _0xda11=['exports','define','voice_queues_log','dtm','../../config/logger','api','moment','bluebird','path','rimraf','./voiceQueuesLog.attributes'];(function(_0x5ecc17,_0x489e46){var _0x4f4917=function(_0x36a0ee){while(--_0x36a0ee){_0x5ecc17['push'](_0x5ecc17['shift']());}};_0x4f4917(++_0x489e46);}(_0xda11,0x185));var _0x1da1=function(_0x415357,_0x4f15ae){_0x415357=_0x415357-0x0;var _0x1b862c=_0xda11[_0x415357];return _0x1b862c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1da1('0x0'))(_0x1da1('0x1'));var moment=require(_0x1da1('0x2'));var BPromise=require(_0x1da1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1da1('0x4'));var rimraf=require(_0x1da1('0x5'));var config=require('../../config/environment');var attributes=require(_0x1da1('0x6'));module[_0x1da1('0x7')]=function(_0x23e9ff,_0xb68641){return _0x23e9ff[_0x1da1('0x8')]('VoiceQueuesLog',attributes,{'tableName':_0x1da1('0x9'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event',_0x1da1('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0xfb93=['voice_queues_log','event','lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','VoiceQueuesLog'];(function(_0x2c8afe,_0x100f80){var _0x982977=function(_0x5b3a44){while(--_0x5b3a44){_0x2c8afe['push'](_0x2c8afe['shift']());}};_0x982977(++_0x100f80);}(_0xfb93,0x115));var _0x3fb9=function(_0x1a21d0,_0x4ba87c){_0x1a21d0=_0x1a21d0-0x0;var _0x5a3938=_0xfb93[_0x1a21d0];return _0x5a3938;};'use strict';var _=require(_0x3fb9('0x0'));var util=require('util');var logger=require(_0x3fb9('0x1'))(_0x3fb9('0x2'));var moment=require('moment');var BPromise=require(_0x3fb9('0x3'));var rp=require(_0x3fb9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3fb9('0x5'));var attributes=require('./voiceQueuesLog.attributes');module[_0x3fb9('0x6')]=function(_0x27f92b,_0x173476){return _0x27f92b[_0x3fb9('0x7')](_0x3fb9('0x8'),attributes,{'tableName':_0x3fb9('0x9'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x3fb9('0xa'),'dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index e9a7ad8..763ab28 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 _0x9b69=['request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x9b69,0x196));var _0x99b6=function(_0x245ad2,_0x5496a0){_0x245ad2=_0x245ad2-0x0;var _0x12d7db=_0x9b69[_0x245ad2];return _0x12d7db;};'use strict';var _=require(_0x99b6('0x0'));var util=require('util');var moment=require(_0x99b6('0x1'));var BPromise=require(_0x99b6('0x2'));var rs=require(_0x99b6('0x3'));var fs=require('fs');var Redis=require(_0x99b6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x99b6('0x5'));var logger=require('../../config/logger')(_0x99b6('0x6'));var config=require(_0x99b6('0x7'));var jayson=require(_0x99b6('0x8'));var client=jayson[_0x99b6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55a5ad,_0x5d0ca6,_0x49d176){return new BPromise(function(_0x38c76a,_0x2d14a8){return client[_0x99b6('0xa')](_0x55a5ad,_0x49d176)[_0x99b6('0xb')](function(_0xaf4c11){logger[_0x99b6('0xc')](_0x99b6('0xd'),_0x5d0ca6,_0x99b6('0xe'));logger['debug'](_0x99b6('0xf'),_0x5d0ca6,'request\x20sent',JSON['stringify'](_0xaf4c11));if(_0xaf4c11[_0x99b6('0x10')]){if(_0xaf4c11[_0x99b6('0x10')][_0x99b6('0x11')]===0x1f4){logger[_0x99b6('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5d0ca6,_0xaf4c11[_0x99b6('0x10')][_0x99b6('0x12')]);return _0x2d14a8(_0xaf4c11['error']['message']);}logger['error'](_0x99b6('0xd'),_0x5d0ca6,_0xaf4c11[_0x99b6('0x10')][_0x99b6('0x12')]);return _0x38c76a(_0xaf4c11['error']['message']);}else{logger[_0x99b6('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5d0ca6,_0x99b6('0xe'));_0x38c76a(_0xaf4c11[_0x99b6('0x13')][_0x99b6('0x12')]);}})[_0x99b6('0x14')](function(_0x389ded){logger[_0x99b6('0x10')](_0x99b6('0xd'),_0x5d0ca6,_0x389ded);_0x2d14a8(_0x389ded);});});} \ No newline at end of file +var _0x8979=['http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1fc601,_0x191b32){var _0x13990e=function(_0x6a78d5){while(--_0x6a78d5){_0x1fc601['push'](_0x1fc601['shift']());}};_0x13990e(++_0x191b32);}(_0x8979,0x16e));var _0x9897=function(_0x304967,_0x307b50){_0x304967=_0x304967-0x0;var _0x122383=_0x8979[_0x304967];return _0x122383;};'use strict';var _=require(_0x9897('0x0'));var util=require(_0x9897('0x1'));var moment=require(_0x9897('0x2'));var BPromise=require('bluebird');var rs=require(_0x9897('0x3'));var fs=require('fs');var Redis=require(_0x9897('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9897('0x5'))('rpc');var config=require(_0x9897('0x6'));var jayson=require(_0x9897('0x7'));var client=jayson['client'][_0x9897('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x22b116,_0x59c3bf,_0x379277){return new BPromise(function(_0x37813e,_0x436798){return client[_0x9897('0x9')](_0x22b116,_0x379277)[_0x9897('0xa')](function(_0x33efe3){logger[_0x9897('0xb')](_0x9897('0xc'),_0x59c3bf,_0x9897('0xd'));logger[_0x9897('0xe')](_0x9897('0xf'),_0x59c3bf,_0x9897('0xd'),JSON[_0x9897('0x10')](_0x33efe3));if(_0x33efe3[_0x9897('0x11')]){if(_0x33efe3['error'][_0x9897('0x12')]===0x1f4){logger[_0x9897('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x59c3bf,_0x33efe3['error'][_0x9897('0x13')]);return _0x436798(_0x33efe3[_0x9897('0x11')][_0x9897('0x13')]);}logger[_0x9897('0x11')](_0x9897('0xc'),_0x59c3bf,_0x33efe3[_0x9897('0x11')]['message']);return _0x37813e(_0x33efe3[_0x9897('0x11')]['message']);}else{logger[_0x9897('0xb')](_0x9897('0xc'),_0x59c3bf,_0x9897('0xd'));_0x37813e(_0x33efe3[_0x9897('0x14')][_0x9897('0x13')]);}})[_0x9897('0x15')](function(_0x304a42){logger[_0x9897('0x11')](_0x9897('0xc'),_0x59c3bf,_0x304a42);_0x436798(_0x304a42);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index ccad401..1a8d3f4 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 _0x9442=['index','isAuthenticated','get','/:id','/:id/download','download','downloads','/:id/transcribe','post','create','runTranscribe','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2250da,_0xdb9fe6){var _0x573dc5=function(_0x3f397a){while(--_0x3f397a){_0x2250da['push'](_0x2250da['shift']());}};_0x573dc5(++_0xdb9fe6);}(_0x9442,0xa8));var _0x2944=function(_0x49316a,_0xb14307){_0x49316a=_0x49316a-0x0;var _0xaf2fa9=_0x9442[_0x49316a];return _0xaf2fa9;};'use strict';var multer=require(_0x2944('0x0'));var util=require('util');var path=require(_0x2944('0x1'));var timeout=require(_0x2944('0x2'));var express=require(_0x2944('0x3'));var router=express[_0x2944('0x4')]();var fs_extra=require(_0x2944('0x5'));var auth=require(_0x2944('0x6'));var interaction=require(_0x2944('0x7'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2944('0x8')]);router['get']('/describe',auth[_0x2944('0x9')](),controller['describe']);router[_0x2944('0xa')](_0x2944('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x2944('0xa')](_0x2944('0xc'),auth[_0x2944('0x9')](),controller[_0x2944('0xd')]);router[_0x2944('0xa')]('/:id/downloads',controller[_0x2944('0xe')]);router['get'](_0x2944('0xf'),auth[_0x2944('0x9')](),controller['downloadTranscribe']);router[_0x2944('0x10')]('/',auth[_0x2944('0x9')](),controller[_0x2944('0x11')]);router['post'](_0x2944('0xf'),auth[_0x2944('0x9')](),controller[_0x2944('0x12')]);router['put'](_0x2944('0xb'),auth[_0x2944('0x9')](),controller['update']);router[_0x2944('0x13')](_0x2944('0xb'),auth[_0x2944('0x9')](),controller[_0x2944('0x14')]);module[_0x2944('0x15')]=router; \ No newline at end of file +var _0x5f23=['put','/:id','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','index','isAuthenticated','describe','show','/:id/download','downloads','downloadTranscribe','post','create','/:id/transcribe'];(function(_0x4d8dc3,_0x585fd1){var _0x9b03d9=function(_0x7a31d5){while(--_0x7a31d5){_0x4d8dc3['push'](_0x4d8dc3['shift']());}};_0x9b03d9(++_0x585fd1);}(_0x5f23,0x10a));var _0x35f2=function(_0x11d5cf,_0x1b32b0){_0x11d5cf=_0x11d5cf-0x0;var _0x157138=_0x5f23[_0x11d5cf];return _0x157138;};'use strict';var multer=require(_0x35f2('0x0'));var util=require(_0x35f2('0x1'));var path=require(_0x35f2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x35f2('0x3')]();var fs_extra=require(_0x35f2('0x4'));var auth=require(_0x35f2('0x5'));var interaction=require(_0x35f2('0x6'));var config=require(_0x35f2('0x7'));var controller=require(_0x35f2('0x8'));router[_0x35f2('0x9')]('/',auth['isAuthenticated'](),controller[_0x35f2('0xa')]);router[_0x35f2('0x9')]('/describe',auth[_0x35f2('0xb')](),controller[_0x35f2('0xc')]);router[_0x35f2('0x9')]('/:id',auth[_0x35f2('0xb')](),controller[_0x35f2('0xd')]);router['get'](_0x35f2('0xe'),auth[_0x35f2('0xb')](),controller['download']);router['get']('/:id/downloads',controller[_0x35f2('0xf')]);router[_0x35f2('0x9')]('/:id/transcribe',auth[_0x35f2('0xb')](),controller[_0x35f2('0x10')]);router[_0x35f2('0x11')]('/',auth[_0x35f2('0xb')](),controller[_0x35f2('0x12')]);router[_0x35f2('0x11')](_0x35f2('0x13'),auth[_0x35f2('0xb')](),controller['runTranscribe']);router[_0x35f2('0x14')](_0x35f2('0x15'),auth['isAuthenticated'](),controller[_0x35f2('0x16')]);router[_0x35f2('0x17')](_0x35f2('0x15'),auth['isAuthenticated'](),controller[_0x35f2('0x18')]);module[_0x35f2('0x19')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 9eadf90..8ab3c59 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(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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 2920427..0086331 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 _0xbda7=['catch','show','params','rawAttributes','create','body','find','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','filename','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','destroy','listBuckets','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','request-promise','bluebird','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','uuid/v4','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','map','VoiceRecording','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x4b577e,_0x1f42a6){var _0x3b0493=function(_0x4e3aeb){while(--_0x4e3aeb){_0x4b577e['push'](_0x4b577e['shift']());}};_0x3b0493(++_0x1f42a6);}(_0xbda7,0xe7));var _0x7bda=function(_0x368be2,_0x6ca033){_0x368be2=_0x368be2-0x0;var _0x460a2e=_0xbda7[_0x368be2];return _0x460a2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7bda('0x0'));var zipdir=require(_0x7bda('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7bda('0x2'));var moment=require('moment');var BPromise=require(_0x7bda('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7bda('0x4'));var sox=require(_0x7bda('0x5'));var csv=require('to-csv');var ejs=require(_0x7bda('0x6'));var fs=require('fs');var fs_extra=require(_0x7bda('0x7'));var _=require('lodash');var squel=require(_0x7bda('0x8'));var crypto=require(_0x7bda('0x9'));var jsforce=require(_0x7bda('0xa'));var deskjs=require(_0x7bda('0xb'));var toCsv=require(_0x7bda('0xc'));var querystring=require(_0x7bda('0xd'));var Papa=require(_0x7bda('0xe'));var AWS=require('aws-sdk');var uuidv4=require(_0x7bda('0xf'));var Redis=require(_0x7bda('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7bda('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bda('0x12'))(_0x7bda('0x13'));var utils=require(_0x7bda('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7bda('0x15'));var db=require(_0x7bda('0x16'))['db'];function respondWithStatusCode(_0x1a6864,_0x60dd9f){_0x60dd9f=_0x60dd9f||0xcc;return function(_0x231cad){if(_0x231cad){return _0x1a6864['sendStatus'](_0x60dd9f);}return _0x1a6864[_0x7bda('0x17')](_0x60dd9f)['end']();};}function respondWithResult(_0x5fe6b0,_0x34b9f9){_0x34b9f9=_0x34b9f9||0xc8;return function(_0x4fc11a){if(_0x4fc11a){return _0x5fe6b0[_0x7bda('0x17')](_0x34b9f9)[_0x7bda('0x18')](_0x4fc11a);}};}function respondWithFilteredResult(_0x10b5f6,_0x1503f3){return function(_0x488478){if(_0x488478){var _0x4cee6f=typeof _0x1503f3[_0x7bda('0x19')]===_0x7bda('0x1a')&&typeof _0x1503f3['limit']===_0x7bda('0x1a');var _0x3ac1b7=_0x488478[_0x7bda('0x1b')];var _0x593fc7=_0x4cee6f?0x0:_0x1503f3[_0x7bda('0x19')];var _0x2eec82=_0x4cee6f?_0x488478['count']:_0x1503f3[_0x7bda('0x19')]+_0x1503f3['limit'];var _0x3ebd01;if(_0x2eec82>=_0x3ac1b7){_0x2eec82=_0x3ac1b7;_0x3ebd01=0xc8;}else{_0x3ebd01=0xce;}_0x10b5f6['status'](_0x3ebd01);return _0x10b5f6[_0x7bda('0x1c')](_0x7bda('0x1d'),_0x593fc7+'-'+_0x2eec82+'/'+_0x3ac1b7)[_0x7bda('0x18')](_0x488478);}return null;};}function patchUpdates(_0x24ca2b){return function(_0x3bfe9a){try{jsonpatch[_0x7bda('0x1e')](_0x3bfe9a,_0x24ca2b,!![]);}catch(_0x399d7a){return BPromise[_0x7bda('0x1f')](_0x399d7a);}return _0x3bfe9a[_0x7bda('0x20')]();};}function saveUpdates(_0x4c5128,_0x379c90){return function(_0x35b9ce){if(_0x35b9ce){return _0x35b9ce[_0x7bda('0x21')](_0x4c5128)[_0x7bda('0x22')](function(_0x33f28e){return _0x33f28e;});}return null;};}function removeEntity(_0x362db7,_0x577b6c){return function(_0x5d7b8a){if(_0x5d7b8a){return _0x5d7b8a['destroy']()[_0x7bda('0x22')](function(){_0x362db7[_0x7bda('0x17')](0xcc)[_0x7bda('0x23')]();});}};}function handleEntityNotFound(_0xcc0fd,_0x2b84a1){return function(_0xa1fd9){if(!_0xa1fd9){_0xcc0fd[_0x7bda('0x24')](0x194);}return _0xa1fd9;};}function handleError(_0x4af699,_0x3dd4b7){_0x3dd4b7=_0x3dd4b7||0x1f4;return function(_0x514e45){logger[_0x7bda('0x25')](_0x514e45[_0x7bda('0x26')]);if(_0x514e45[_0x7bda('0x27')]){delete _0x514e45[_0x7bda('0x27')];}_0x4af699[_0x7bda('0x17')](_0x3dd4b7)[_0x7bda('0x28')](_0x514e45);};}exports['index']=function(_0x182577,_0x3877b8){var _0x315b14={},_0x2528a9={},_0x4b5fcf={'count':0x0,'rows':[]};var _0x21793d=_[_0x7bda('0x29')](db[_0x7bda('0x2a')]['rawAttributes'],function(_0x1c90d2){return{'name':_0x1c90d2[_0x7bda('0x2b')],'type':_0x1c90d2[_0x7bda('0x2c')][_0x7bda('0x2d')]};});_0x2528a9[_0x7bda('0x2e')]=_['differenceBy'](_[_0x7bda('0x29')](_0x21793d,_0x7bda('0x27')),['format']);_0x2528a9[_0x7bda('0x2f')]=_[_0x7bda('0x30')](_0x182577['query']);_0x2528a9['filters']=_[_0x7bda('0x31')](_0x2528a9['model'],_0x2528a9[_0x7bda('0x2f')]);_0x315b14['attributes']=_[_0x7bda('0x31')](_0x2528a9[_0x7bda('0x2e')],qs[_0x7bda('0x32')](_0x182577[_0x7bda('0x2f')][_0x7bda('0x32')]));_0x315b14[_0x7bda('0x33')]=_0x315b14[_0x7bda('0x33')][_0x7bda('0x34')]?_0x315b14[_0x7bda('0x33')]:_0x2528a9[_0x7bda('0x2e')];if(!_0x182577[_0x7bda('0x2f')][_0x7bda('0x35')](_0x7bda('0x36'))){_0x315b14[_0x7bda('0x37')]=qs[_0x7bda('0x37')](_0x182577[_0x7bda('0x2f')][_0x7bda('0x37')]);_0x315b14[_0x7bda('0x19')]=qs['offset'](_0x182577[_0x7bda('0x2f')][_0x7bda('0x19')]);}_0x315b14[_0x7bda('0x38')]=qs['sort'](_0x182577[_0x7bda('0x2f')][_0x7bda('0x39')]);_0x315b14[_0x7bda('0x3a')]=qs[_0x7bda('0x3b')](_[_0x7bda('0x3c')](_0x182577['query'],_0x2528a9['filters']),_0x21793d);if(_0x182577['query'][_0x7bda('0x3d')]){_0x315b14[_0x7bda('0x3a')]=_[_0x7bda('0x3e')](_0x315b14[_0x7bda('0x3a')],{'$or':_[_0x7bda('0x29')](_0x21793d,function(_0x3a8ba6){if(_0x3a8ba6['type']!==_0x7bda('0x3f')){var _0x268e8d={};_0x268e8d[_0x3a8ba6[_0x7bda('0x27')]]={'$like':'%'+_0x182577['query'][_0x7bda('0x3d')]+'%'};return _0x268e8d;}})});}_0x315b14=_['merge']({},_0x315b14,_0x182577[_0x7bda('0x40')]);var _0x4fd058={'where':_0x315b14[_0x7bda('0x3a')]};return db[_0x7bda('0x2a')][_0x7bda('0x1b')](_0x4fd058)[_0x7bda('0x22')](function(_0x41897b){_0x4b5fcf[_0x7bda('0x1b')]=_0x41897b;if(_0x182577['query'][_0x7bda('0x41')]){_0x315b14[_0x7bda('0x42')]=[{'all':!![]}];}return db[_0x7bda('0x2a')][_0x7bda('0x43')](_0x315b14);})['then'](function(_0x58decf){_0x4b5fcf[_0x7bda('0x44')]=_0x58decf;return _0x4b5fcf;})[_0x7bda('0x22')](respondWithFilteredResult(_0x3877b8,_0x315b14))[_0x7bda('0x45')](handleError(_0x3877b8,null));};exports[_0x7bda('0x46')]=function(_0x3b7fae,_0x2d2f4b){var _0xcae58={'raw':![],'where':{'id':_0x3b7fae[_0x7bda('0x47')]['id']}},_0xc6c9af={};_0xc6c9af[_0x7bda('0x2e')]=_[_0x7bda('0x30')](db[_0x7bda('0x2a')][_0x7bda('0x48')]);_0xc6c9af[_0x7bda('0x2f')]=_[_0x7bda('0x30')](_0x3b7fae[_0x7bda('0x2f')]);_0xc6c9af[_0x7bda('0x3b')]=_[_0x7bda('0x31')](_0xc6c9af[_0x7bda('0x2e')],_0xc6c9af[_0x7bda('0x2f')]);_0xcae58['attributes']=_[_0x7bda('0x31')](_0xc6c9af[_0x7bda('0x2e')],qs['fields'](_0x3b7fae['query']['fields']));_0xcae58['attributes']=_0xcae58[_0x7bda('0x33')][_0x7bda('0x34')]?_0xcae58['attributes']:_0xc6c9af['model'];if(_0x3b7fae['query'][_0x7bda('0x41')]){_0xcae58[_0x7bda('0x42')]=[{'all':!![]}];}_0xcae58=_[_0x7bda('0x3e')]({},_0xcae58,_0x3b7fae[_0x7bda('0x40')]);return db[_0x7bda('0x2a')]['find'](_0xcae58)[_0x7bda('0x22')](handleEntityNotFound(_0x2d2f4b,null))[_0x7bda('0x22')](respondWithResult(_0x2d2f4b,null))[_0x7bda('0x45')](handleError(_0x2d2f4b,null));};exports[_0x7bda('0x49')]=function(_0x53b3c6,_0x3f309d){return db['VoiceRecording'][_0x7bda('0x49')](_0x53b3c6[_0x7bda('0x4a')],{})[_0x7bda('0x22')](respondWithResult(_0x3f309d,0xc9))['catch'](handleError(_0x3f309d,null));};exports[_0x7bda('0x21')]=function(_0x2c8cc1,_0x3e4823){if(_0x2c8cc1[_0x7bda('0x4a')]['id']){delete _0x2c8cc1[_0x7bda('0x4a')]['id'];}return db['VoiceRecording'][_0x7bda('0x4b')]({'where':{'id':_0x2c8cc1['params']['id']}})[_0x7bda('0x22')](handleEntityNotFound(_0x3e4823,null))[_0x7bda('0x22')](saveUpdates(_0x2c8cc1[_0x7bda('0x4a')],null))['then'](respondWithResult(_0x3e4823,null))[_0x7bda('0x45')](handleError(_0x3e4823,null));};exports['describe']=function(_0x2b06d3,_0x58d2e5){return db[_0x7bda('0x2a')][_0x7bda('0x4c')]()[_0x7bda('0x22')](respondWithResult(_0x58d2e5,null))['catch'](handleError(_0x58d2e5,null));};exports[_0x7bda('0x4d')]=function(_0x362e36,_0x145ec3,_0xd85c33){var _0x5b296c=require(_0x7bda('0x4e'));var _0x32d597=![];var _0x5d6fa1={};if(_0x362e36[_0x7bda('0x2f')][_0x7bda('0x2c')]&&_0x362e36['query'][_0x7bda('0x2c')]===_0x7bda('0x4f')){_0x5d6fa1['uniqueid']=_0x362e36['params']['id'];}else{_0x5d6fa1['id']=_0x362e36[_0x7bda('0x47')]['id'];}return db[_0x7bda('0x2a')]['find']({'where':_0x5d6fa1,'attributes':['id',_0x7bda('0x50')],'raw':!![]})[_0x7bda('0x22')](handleEntityNotFound(_0x145ec3,null))[_0x7bda('0x22')](function(_0x2b47a3){if(_0x2b47a3){var _0xbf388e=_0x2b47a3['value'];var _0x4137e3=util[_0x7bda('0x51')](_0x7bda('0x52'),_0xbf388e);if(fs[_0x7bda('0x53')](_0x4137e3)){_0x32d597=!![];return _0x5b296c[_0x7bda('0x54')](_0x4137e3,_0xbf388e,config[_0x7bda('0x55')][_0x7bda('0x56')])[_0x7bda('0x22')](function(){return _0x2b47a3;});}return _0x2b47a3;}})[_0x7bda('0x22')](function(_0x7c04c1){if(_0x7c04c1){var _0x47182d=_0x7c04c1['value'];if(!fs['existsSync'](_0x47182d)){throw new db[(_0x7bda('0x57'))][(_0x7bda('0x58'))]('VoiceRecording\x20not\x20found');}if(_0x7c04c1['filename']){return _0x145ec3['download'](_0x47182d,_0x7c04c1[_0x7bda('0x59')]+path[_0x7bda('0x5a')](_0x47182d),function(){if(_0x32d597){fs[_0x7bda('0x5b')](_0x47182d);}});}else{return _0x145ec3[_0x7bda('0x4d')](_0x47182d,function(_0x3854a0){if(_0x32d597){fs[_0x7bda('0x5b')](_0x47182d);}});}}})[_0x7bda('0x45')](function(_0x15929b){if(_0x15929b[_0x7bda('0x5c')]===_0x7bda('0x5d')){_0x145ec3[_0x7bda('0x17')](0x194)[_0x7bda('0x28')](_0x7bda('0x5e'));}else{return handleError(_0x145ec3,null);}});};exports[_0x7bda('0x5f')]=function(_0x5093fc,_0x5b24d3,_0x253845){var _0x10bbba=require('../../components/encryptor');var _0x4e2af5=![];var _0x2c6a25={'$and':[db[_0x7bda('0x60')][_0x7bda('0x3a')](db[_0x7bda('0x60')]['fn'](_0x7bda('0x61'),db['sequelize'][_0x7bda('0x62')](_0x7bda('0x4f'))),_0x5093fc[_0x7bda('0x2f')][_0x7bda('0x63')])]};if(_0x5093fc[_0x7bda('0x2f')][_0x7bda('0x2c')]&&_0x5093fc[_0x7bda('0x2f')][_0x7bda('0x2c')]===_0x7bda('0x4f')){_0x2c6a25[_0x7bda('0x64')]['push']({'uniqueid':_0x5093fc[_0x7bda('0x47')]['id']});}else{_0x2c6a25[_0x7bda('0x64')][_0x7bda('0x65')]({'id':_0x5093fc[_0x7bda('0x47')]['id']});}return db[_0x7bda('0x2a')][_0x7bda('0x4b')]({'where':_0x2c6a25,'attributes':['id',_0x7bda('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x5b24d3,null))[_0x7bda('0x22')](function(_0x400d9d){if(_0x400d9d){var _0x2a77e3=util[_0x7bda('0x51')](_0x7bda('0x52'),_0x400d9d['value']);if(fs['existsSync'](_0x2a77e3)){_0x4e2af5=!![];return _0x10bbba[_0x7bda('0x54')](_0x2a77e3,_0x400d9d[_0x7bda('0x50')],config[_0x7bda('0x55')][_0x7bda('0x56')])[_0x7bda('0x22')](function(){return _0x400d9d;});}return _0x400d9d;}})[_0x7bda('0x22')](function(_0x40b24b){if(_0x40b24b){if(!fs[_0x7bda('0x53')](_0x40b24b[_0x7bda('0x50')])){throw new db[(_0x7bda('0x57'))][(_0x7bda('0x58'))]('VoiceRecording\x20not\x20found');}if(_0x40b24b['filename']){return _0x5b24d3[_0x7bda('0x4d')](_0x40b24b['value'],_0x40b24b[_0x7bda('0x59')]+path[_0x7bda('0x5a')](_0x40b24b[_0x7bda('0x50')]),function(){if(_0x4e2af5){fs[_0x7bda('0x5b')](_0x40b24b[_0x7bda('0x50')]);}});}else{return _0x5b24d3[_0x7bda('0x4d')](_0x40b24b[_0x7bda('0x50')],function(_0x1276b7){if(_0x4e2af5){fs[_0x7bda('0x5b')](_0x40b24b[_0x7bda('0x50')]);}});}}})['catch'](handleError(_0x5b24d3,null));};exports['destroy']=function(_0x3e5e82,_0xd4d491){return db[_0x7bda('0x2a')][_0x7bda('0x4b')]({'where':{'id':_0x3e5e82['params']['id']}})[_0x7bda('0x22')](function(_0xc21917){if(_[_0x7bda('0x66')](_0xc21917)){throw new ReferenceError('Entity\x20not\x20found');}return _0xc21917;})[_0x7bda('0x22')](function(_0x5c8d22){var _0x1d6e50=_0x5c8d22[_0x7bda('0x50')];logger[_0x7bda('0x67')]('cancellazione\x20fisica\x20documento\x20%s',_0x1d6e50);if(!_['isNil'](_0x5c8d22[_0x7bda('0x50')])&&fs[_0x7bda('0x53')](_0x1d6e50)){logger['info'](_0x7bda('0x68')+_0x1d6e50+_0x7bda('0x69'));fs['unlinkSync'](_0x1d6e50);}_0x1d6e50=_0x1d6e50+_0x7bda('0x6a');if(!_['isNil'](_0x5c8d22[_0x7bda('0x50')])&&fs[_0x7bda('0x53')](_0x1d6e50)){logger[_0x7bda('0x67')](_0x7bda('0x68')+_0x1d6e50+_0x7bda('0x69'));fs[_0x7bda('0x6b')](_0x1d6e50);}return _0x5c8d22;})[_0x7bda('0x22')](function(_0x4b36ba){if(!_0x4b36ba)throw new InternalError();return _0x4b36ba[_0x7bda('0x6c')]();})[_0x7bda('0x22')](function(){_0xd4d491['status'](0xcc)[_0x7bda('0x23')]();})['catch'](handleError(_0xd4d491,null));};function getBucketslist(_0x4c9c0c,_0x3b40a9,_0x562dc7){return new Promise(function(_0x124e33,_0x455024){var _0x162b0f=new AWS['S3']({'accessKeyId':_0x3b40a9,'secretAccessKey':_0x4c9c0c,'region':_0x562dc7});_0x162b0f[_0x7bda('0x6d')]({},function(_0x489bf9,_0x5575c1){if(_0x489bf9){return _0x455024(_0x489bf9);}else{return _0x124e33(_0x5575c1);}});});}function createBucket(_0x2b19e5,_0x52f332,_0x1e9b15,_0x58cfd9){return new Promise(function(_0x417a89,_0x321992){var _0x54ea0d=new AWS['S3']({'accessKeyId':_0x52f332,'secretAccessKey':_0x2b19e5,'region':_0x1e9b15});_0x54ea0d['createBucket']({'Bucket':_0x58cfd9},function(_0x48e625,_0x3be874){if(_0x48e625){return _0x321992(_0x48e625);}else{return _0x417a89(_0x3be874);}});});}function uploadFile(_0x418dd7,_0x1b8bcc,_0x24ab36,_0xd640ad,_0x42f263,_0x4f4c79){return new Promise(function(_0x3249f1,_0x128347){var _0x4694d4=new AWS['S3']({'accessKeyId':_0x1b8bcc,'secretAccessKey':_0x418dd7,'region':_0x24ab36});_0x4694d4['upload']({'Bucket':_0xd640ad,'Key':_0x42f263,'Body':_0x4f4c79},function(_0x270a44,_0xf50405){if(_0x270a44){return _0x128347(_0x270a44);}else{return _0x3249f1(_0xf50405);}});});}function startTranscribe(_0x40528b,_0x2796df,_0x1df100,_0x4dfaed,_0xbd6655,_0x2a5b30){return new Promise(function(_0x2fcb22,_0x20dad8){var _0x5234e4=new AWS[(_0x7bda('0x6e'))]({'accessKeyId':_0x2796df,'secretAccessKey':_0x40528b,'region':_0x1df100});_0x5234e4[_0x7bda('0x6f')]({'TranscriptionJobName':_0x4dfaed,'LanguageCode':_0xbd6655,'Media':{'MediaFileUri':_0x2a5b30}},function(_0x395fe4,_0x182cc2){if(_0x395fe4){return _0x20dad8(_0x395fe4);}else{return _0x2fcb22(_0x182cc2);}});});}function transcribe(_0x2cd7d2,_0x5972c9,_0x2554c8,_0xa20176,_0x21636c,_0x2dc347,_0x5cfa4b){return new Promise(function(_0x239713,_0x5065b4){var _0x2369f5={};logger['info'](util[_0x7bda('0x51')](_0x7bda('0x70'),_0x2cd7d2,_0x21636c));return uploadFile(_0x5972c9,_0x2554c8,_0xa20176,_0x21636c,path[_0x7bda('0x71')](_0x2dc347),fs['readFileSync'](_0x2dc347))[_0x7bda('0x22')](function(_0x411914){logger[_0x7bda('0x67')](util[_0x7bda('0x51')](_0x7bda('0x72'),_0x2cd7d2,_0x21636c,_0x411914['Location']));_0x2369f5[_0x7bda('0x73')]=_0x411914[_0x7bda('0x74')];_0x2369f5[_0x7bda('0x75')]=_0x411914['Location'];logger['info'](util[_0x7bda('0x51')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x2cd7d2));return startTranscribe(_0x5972c9,_0x2554c8,_0xa20176,uuidv4(),_0x5cfa4b,_0x411914['Location']);})[_0x7bda('0x22')](function(_0x499961){logger[_0x7bda('0x67')](util[_0x7bda('0x51')](_0x7bda('0x76'),_0x2cd7d2,_0x499961[_0x7bda('0x77')][_0x7bda('0x78')]));_0x2369f5[_0x7bda('0x79')]=_0x499961[_0x7bda('0x77')]['TranscriptionJobName'];_0x2369f5[_0x7bda('0x7a')]=_0x499961[_0x7bda('0x77')][_0x7bda('0x7b')];return _0x239713(_0x2369f5);})['catch'](function(_0x34ccb2){return _0x5065b4(_0x34ccb2);});});}exports['runTranscribe']=function(_0x189b0d,_0x2e5e82,_0x59fcc9){var _0x29d1a8;var _0x16612d;var _0x1614df;var _0x3c49de=require(_0x7bda('0x4e'));return db[_0x7bda('0x2a')][_0x7bda('0x7c')]({'where':{'id':_0x189b0d[_0x7bda('0x47')]['id']}})['then'](function(_0x278a01){if(_0x278a01){var _0x3c871f=util['format'](_0x7bda('0x52'),_0x278a01[_0x7bda('0x50')]);if(fs[_0x7bda('0x53')](_0x3c871f)){cypher=!![];return _0x3c49de['decryptFile'](_0x3c871f,_0x278a01[_0x7bda('0x50')],config[_0x7bda('0x55')][_0x7bda('0x56')])[_0x7bda('0x22')](function(){return _0x278a01;});}return _0x278a01;}})[_0x7bda('0x22')](function(_0x2f8527){if(!_0x2f8527){throw new db[(_0x7bda('0x57'))][(_0x7bda('0x58'))](_0x7bda('0x7d'));}_0x16612d=_0x2f8527;return db[_0x7bda('0x7e')][_0x7bda('0x7c')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x2e5e82,null))[_0x7bda('0x22')](function(_0x4820fa){if(_0x4820fa){_0x29d1a8=_0x4820fa;if(!_0x29d1a8['transcribe']||!_0x29d1a8['transcribeAccountId']||!_0x29d1a8[_0x7bda('0x7f')]||!_0x29d1a8[_0x7bda('0x80')]||!_0x29d1a8[_0x7bda('0x73')]){throw new db['Sequelize'][(_0x7bda('0x58'))](_0x7bda('0x81'));}if(_0x189b0d['body'][_0x7bda('0x82')]&&(!_0x29d1a8[_0x7bda('0x83')]||!_0x29d1a8[_0x7bda('0x84')]||!_0x29d1a8[_0x7bda('0x85')]||!_0x29d1a8[_0x7bda('0x80')]||!_0x29d1a8[_0x7bda('0x73')])){throw new db[(_0x7bda('0x57'))]['ValidationError'](_0x7bda('0x86'));}return db[_0x7bda('0x87')]['findOne']({'where':{'id':_0x29d1a8[_0x7bda('0x88')]}});}})['then'](function(_0x4fcb7d){if(!_0x4fcb7d){throw new db[(_0x7bda('0x57'))]['ValidationError'](_0x7bda('0x89'));}if(!_0x4fcb7d[_0x7bda('0x8a')]||!_0x4fcb7d[_0x7bda('0x8b')]){throw new db['Sequelize'][(_0x7bda('0x58'))]('Cloud\x20Provider\x20not\x20configured');}_0x1614df=_0x4fcb7d;return getBucketslist(_0x1614df[_0x7bda('0x8a')],_0x1614df[_0x7bda('0x8b')],_0x29d1a8['transcribeRegion']);})[_0x7bda('0x22')](function(_0x49d795){if(_0x49d795&&_0x49d795['Buckets']){var _0x236dd4=_['find'](_0x49d795[_0x7bda('0x8c')],function(_0x3c445d){return _0x3c445d[_0x7bda('0x8d')]===_0x29d1a8['bucket'];});if(!_0x236dd4){logger[_0x7bda('0x67')](util[_0x7bda('0x51')](_0x7bda('0x8e'),_0x189b0d[_0x7bda('0x47')]['id'],_0x29d1a8[_0x7bda('0x73')]));return createBucket(_0x1614df[_0x7bda('0x8a')],_0x1614df['data2'],_0x29d1a8['transcribeRegion'],_0x29d1a8[_0x7bda('0x73')]);}logger[_0x7bda('0x67')](util[_0x7bda('0x51')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x189b0d['params']['id'],_0x29d1a8[_0x7bda('0x73')]));return;}})[_0x7bda('0x22')](function(_0x4a80c7){if(_0x16612d[_0x7bda('0x7a')]==='NEW'){return transcribe(_0x189b0d[_0x7bda('0x47')]['id'],_0x1614df[_0x7bda('0x8a')],_0x1614df[_0x7bda('0x8b')],_0x29d1a8[_0x7bda('0x7f')],_0x29d1a8[_0x7bda('0x73')],_0x16612d[_0x7bda('0x50')],_0x29d1a8[_0x7bda('0x80')]);}else{logger[_0x7bda('0x67')](util['format'](_0x7bda('0x8f'),_0x189b0d[_0x7bda('0x47')]['id']));return{'transcribeStatus':_0x7bda('0x90')};}})[_0x7bda('0x22')](function(_0x3ba375){if(_0x3ba375){_0x3ba375[_0x7bda('0x91')]=_0x189b0d[_0x7bda('0x4a')]['runSentiment'];return _0x16612d['updateAttributes'](_0x3ba375);}})[_0x7bda('0x22')](respondWithResult(_0x2e5e82,null))[_0x7bda('0x45')](handleError(_0x2e5e82,null));};function writeFile(_0x3a8975,_0x2af4c0){return new Promise(function(_0x113c6d,_0x21f70c){fs['writeFile'](_0x2af4c0,_0x3a8975,function(_0x7718ca,_0x17e4fa){if(_0x7718ca){return _0x21f70c(_0x7718ca);}else{return _0x113c6d(_0x17e4fa);}});});}exports['downloadTranscribe']=function(_0x4ed235,_0x4ebae6,_0x35efd0){return db[_0x7bda('0x2a')][_0x7bda('0x7c')]({'where':{'id':_0x4ed235[_0x7bda('0x47')]['id']}})[_0x7bda('0x22')](handleEntityNotFound(_0x4ebae6))['then'](function(_0x426374){if(_0x426374&&_0x426374['fileText']){var _0x543b42=_0x426374['fileText'];var _0x5bcbc7=config[_0x7bda('0x92')]+_0x7bda('0x93')+_0x426374['id']+_0x7bda('0x94');if(fs[_0x7bda('0x53')](_0x5bcbc7)){return _0x5bcbc7;}return writeFile(_0x543b42,_0x5bcbc7)[_0x7bda('0x22')](function(){return _0x5bcbc7;});}else{throw new db['Sequelize'][(_0x7bda('0x58'))](_0x7bda('0x95'));}})[_0x7bda('0x22')](function(_0x42aceb){return _0x4ebae6[_0x7bda('0x4d')](_0x42aceb);})[_0x7bda('0x45')](handleError(_0x4ebae6));}; \ No newline at end of file +var _0x54d5=['token','$and','push','secrets','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','TranscriptionJobStatus','findOne','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeStatus','NEW','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','map','VoiceRecording','rawAttributes','fieldName','type','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','options','catch','create','body','find','describe','download','uniqueid','value','format','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','filename','extname','unlink','VoiceRecording\x20not\x20found','Not\x20found','downloads','../../components/encryptor','sequelize','MD5'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x54d5,0x16a));var _0x554d=function(_0x2ea6f4,_0x3bd3ea){_0x2ea6f4=_0x2ea6f4-0x0;var _0xdd158a=_0x54d5[_0x2ea6f4];return _0xdd158a;};'use strict';var emlformat=require(_0x554d('0x0'));var rimraf=require(_0x554d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x554d('0x2'));var rp=require(_0x554d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x554d('0x4'));var util=require('util');var path=require(_0x554d('0x5'));var sox=require(_0x554d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x554d('0x7'));var squel=require(_0x554d('0x8'));var crypto=require(_0x554d('0x9'));var jsforce=require(_0x554d('0xa'));var deskjs=require(_0x554d('0xb'));var toCsv=require('to-csv');var querystring=require(_0x554d('0xc'));var Papa=require(_0x554d('0xd'));var AWS=require('aws-sdk');var uuidv4=require(_0x554d('0xe'));var Redis=require(_0x554d('0xf'));var authService=require(_0x554d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x554d('0x11'));var hardwareService=require(_0x554d('0x12'));var logger=require('../../config/logger')(_0x554d('0x13'));var utils=require(_0x554d('0x14'));var config=require(_0x554d('0x15'));var licenseUtil=require(_0x554d('0x16'));var db=require(_0x554d('0x17'))['db'];function respondWithStatusCode(_0x503b67,_0x4fe60e){_0x4fe60e=_0x4fe60e||0xcc;return function(_0x13de32){if(_0x13de32){return _0x503b67[_0x554d('0x18')](_0x4fe60e);}return _0x503b67[_0x554d('0x19')](_0x4fe60e)['end']();};}function respondWithResult(_0xe51295,_0x496582){_0x496582=_0x496582||0xc8;return function(_0x10cebc){if(_0x10cebc){return _0xe51295[_0x554d('0x19')](_0x496582)['json'](_0x10cebc);}};}function respondWithFilteredResult(_0x2cd17b,_0x3be09c){return function(_0x578957){if(_0x578957){var _0x307018=typeof _0x3be09c['offset']==='undefined'&&typeof _0x3be09c[_0x554d('0x1a')]==='undefined';var _0x138109=_0x578957[_0x554d('0x1b')];var _0x5494bc=_0x307018?0x0:_0x3be09c['offset'];var _0x1cb127=_0x307018?_0x578957[_0x554d('0x1b')]:_0x3be09c[_0x554d('0x1c')]+_0x3be09c[_0x554d('0x1a')];var _0x1c81ab;if(_0x1cb127>=_0x138109){_0x1cb127=_0x138109;_0x1c81ab=0xc8;}else{_0x1c81ab=0xce;}_0x2cd17b[_0x554d('0x19')](_0x1c81ab);return _0x2cd17b[_0x554d('0x1d')](_0x554d('0x1e'),_0x5494bc+'-'+_0x1cb127+'/'+_0x138109)['json'](_0x578957);}return null;};}function patchUpdates(_0x51a84c){return function(_0x13004c){try{jsonpatch[_0x554d('0x1f')](_0x13004c,_0x51a84c,!![]);}catch(_0x5ec1a6){return BPromise[_0x554d('0x20')](_0x5ec1a6);}return _0x13004c[_0x554d('0x21')]();};}function saveUpdates(_0xa06c99,_0x1e7655){return function(_0x3d2502){if(_0x3d2502){return _0x3d2502[_0x554d('0x22')](_0xa06c99)[_0x554d('0x23')](function(_0x2d0063){return _0x2d0063;});}return null;};}function removeEntity(_0x4ffdd,_0x41a8ba){return function(_0x28bcdb){if(_0x28bcdb){return _0x28bcdb[_0x554d('0x24')]()[_0x554d('0x23')](function(){_0x4ffdd['status'](0xcc)[_0x554d('0x25')]();});}};}function handleEntityNotFound(_0x574a6e,_0x58b58c){return function(_0x20582a){if(!_0x20582a){_0x574a6e[_0x554d('0x18')](0x194);}return _0x20582a;};}function handleError(_0x1d1380,_0x4dc3cf){_0x4dc3cf=_0x4dc3cf||0x1f4;return function(_0x1d613c){logger[_0x554d('0x26')](_0x1d613c['stack']);if(_0x1d613c[_0x554d('0x27')]){delete _0x1d613c[_0x554d('0x27')];}_0x1d1380['status'](_0x4dc3cf)[_0x554d('0x28')](_0x1d613c);};}exports['index']=function(_0x120162,_0x3a2f2f){var _0xec8dac={},_0x374a43={},_0x67977e={'count':0x0,'rows':[]};var _0x4ce775=_[_0x554d('0x29')](db[_0x554d('0x2a')][_0x554d('0x2b')],function(_0x1c97ef){return{'name':_0x1c97ef[_0x554d('0x2c')],'type':_0x1c97ef[_0x554d('0x2d')]['key']};});_0x374a43['model']=_['differenceBy'](_[_0x554d('0x29')](_0x4ce775,'name'),['format']);_0x374a43[_0x554d('0x2e')]=_['keys'](_0x120162[_0x554d('0x2e')]);_0x374a43[_0x554d('0x2f')]=_['intersection'](_0x374a43[_0x554d('0x30')],_0x374a43['query']);_0xec8dac[_0x554d('0x31')]=_[_0x554d('0x32')](_0x374a43['model'],qs['fields'](_0x120162[_0x554d('0x2e')][_0x554d('0x33')]));_0xec8dac[_0x554d('0x31')]=_0xec8dac['attributes'][_0x554d('0x34')]?_0xec8dac[_0x554d('0x31')]:_0x374a43[_0x554d('0x30')];if(!_0x120162[_0x554d('0x2e')][_0x554d('0x35')](_0x554d('0x36'))){_0xec8dac[_0x554d('0x1a')]=qs[_0x554d('0x1a')](_0x120162['query'][_0x554d('0x1a')]);_0xec8dac['offset']=qs[_0x554d('0x1c')](_0x120162[_0x554d('0x2e')][_0x554d('0x1c')]);}_0xec8dac[_0x554d('0x37')]=qs[_0x554d('0x38')](_0x120162[_0x554d('0x2e')][_0x554d('0x38')]);_0xec8dac[_0x554d('0x39')]=qs['filters'](_[_0x554d('0x3a')](_0x120162[_0x554d('0x2e')],_0x374a43[_0x554d('0x2f')]),_0x4ce775);if(_0x120162['query'][_0x554d('0x3b')]){_0xec8dac[_0x554d('0x39')]=_[_0x554d('0x3c')](_0xec8dac[_0x554d('0x39')],{'$or':_[_0x554d('0x29')](_0x4ce775,function(_0x5f09c9){if(_0x5f09c9[_0x554d('0x2d')]!==_0x554d('0x3d')){var _0x3fa0fd={};_0x3fa0fd[_0x5f09c9[_0x554d('0x27')]]={'$like':'%'+_0x120162[_0x554d('0x2e')][_0x554d('0x3b')]+'%'};return _0x3fa0fd;}})});}_0xec8dac=_[_0x554d('0x3c')]({},_0xec8dac,_0x120162['options']);var _0x301ea5={'where':_0xec8dac[_0x554d('0x39')]};return db[_0x554d('0x2a')][_0x554d('0x1b')](_0x301ea5)[_0x554d('0x23')](function(_0x3936f0){_0x67977e[_0x554d('0x1b')]=_0x3936f0;if(_0x120162[_0x554d('0x2e')][_0x554d('0x3e')]){_0xec8dac[_0x554d('0x3f')]=[{'all':!![]}];}return db[_0x554d('0x2a')][_0x554d('0x40')](_0xec8dac);})[_0x554d('0x23')](function(_0x1626b7){_0x67977e[_0x554d('0x41')]=_0x1626b7;return _0x67977e;})[_0x554d('0x23')](respondWithFilteredResult(_0x3a2f2f,_0xec8dac))['catch'](handleError(_0x3a2f2f,null));};exports[_0x554d('0x42')]=function(_0x3c9231,_0x3a9734){var _0x3e83c0={'raw':![],'where':{'id':_0x3c9231[_0x554d('0x43')]['id']}},_0x5bcc16={};_0x5bcc16[_0x554d('0x30')]=_[_0x554d('0x44')](db[_0x554d('0x2a')]['rawAttributes']);_0x5bcc16[_0x554d('0x2e')]=_['keys'](_0x3c9231[_0x554d('0x2e')]);_0x5bcc16[_0x554d('0x2f')]=_[_0x554d('0x32')](_0x5bcc16[_0x554d('0x30')],_0x5bcc16[_0x554d('0x2e')]);_0x3e83c0[_0x554d('0x31')]=_[_0x554d('0x32')](_0x5bcc16[_0x554d('0x30')],qs[_0x554d('0x33')](_0x3c9231['query'][_0x554d('0x33')]));_0x3e83c0[_0x554d('0x31')]=_0x3e83c0[_0x554d('0x31')]['length']?_0x3e83c0[_0x554d('0x31')]:_0x5bcc16[_0x554d('0x30')];if(_0x3c9231['query'][_0x554d('0x3e')]){_0x3e83c0[_0x554d('0x3f')]=[{'all':!![]}];}_0x3e83c0=_[_0x554d('0x3c')]({},_0x3e83c0,_0x3c9231[_0x554d('0x45')]);return db[_0x554d('0x2a')]['find'](_0x3e83c0)['then'](handleEntityNotFound(_0x3a9734,null))[_0x554d('0x23')](respondWithResult(_0x3a9734,null))[_0x554d('0x46')](handleError(_0x3a9734,null));};exports['create']=function(_0x5da5d0,_0x5790fd){return db[_0x554d('0x2a')][_0x554d('0x47')](_0x5da5d0[_0x554d('0x48')],{})[_0x554d('0x23')](respondWithResult(_0x5790fd,0xc9))[_0x554d('0x46')](handleError(_0x5790fd,null));};exports[_0x554d('0x22')]=function(_0x2dda71,_0x21cad2){if(_0x2dda71[_0x554d('0x48')]['id']){delete _0x2dda71[_0x554d('0x48')]['id'];}return db[_0x554d('0x2a')][_0x554d('0x49')]({'where':{'id':_0x2dda71[_0x554d('0x43')]['id']}})[_0x554d('0x23')](handleEntityNotFound(_0x21cad2,null))[_0x554d('0x23')](saveUpdates(_0x2dda71['body'],null))[_0x554d('0x23')](respondWithResult(_0x21cad2,null))['catch'](handleError(_0x21cad2,null));};exports['describe']=function(_0x16d7c6,_0x79e0f6){return db[_0x554d('0x2a')][_0x554d('0x4a')]()['then'](respondWithResult(_0x79e0f6,null))[_0x554d('0x46')](handleError(_0x79e0f6,null));};exports[_0x554d('0x4b')]=function(_0x515987,_0x45317a,_0x2276b6){var _0x5eaed5=require('../../components/encryptor');var _0x5903fb=![];var _0x5911a0={};if(_0x515987['query'][_0x554d('0x2d')]&&_0x515987['query']['type']==='uniqueid'){_0x5911a0[_0x554d('0x4c')]=_0x515987[_0x554d('0x43')]['id'];}else{_0x5911a0['id']=_0x515987[_0x554d('0x43')]['id'];}return db[_0x554d('0x2a')][_0x554d('0x49')]({'where':_0x5911a0,'attributes':['id',_0x554d('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x45317a,null))[_0x554d('0x23')](function(_0x444844){if(_0x444844){var _0x4671ad=_0x444844[_0x554d('0x4d')];var _0xcc0a3b=util[_0x554d('0x4e')](_0x554d('0x4f'),_0x4671ad);if(fs[_0x554d('0x50')](_0xcc0a3b)){_0x5903fb=!![];return _0x5eaed5[_0x554d('0x51')](_0xcc0a3b,_0x4671ad,config['secrets'][_0x554d('0x52')])[_0x554d('0x23')](function(){return _0x444844;});}return _0x444844;}})[_0x554d('0x23')](function(_0x2535c2){if(_0x2535c2){var _0x8e860e=_0x2535c2['value'];if(!fs[_0x554d('0x50')](_0x8e860e)){throw new db[(_0x554d('0x53'))][(_0x554d('0x54'))]('VoiceRecording\x20not\x20found');}if(_0x2535c2[_0x554d('0x55')]){return _0x45317a['download'](_0x8e860e,_0x2535c2[_0x554d('0x55')]+path[_0x554d('0x56')](_0x8e860e),function(){if(_0x5903fb){fs['unlink'](_0x8e860e);}});}else{return _0x45317a['download'](_0x8e860e,function(_0xe5bd6e){if(_0x5903fb){fs[_0x554d('0x57')](_0x8e860e);}});}}})[_0x554d('0x46')](function(_0xaa62cb){if(_0xaa62cb['message']===_0x554d('0x58')){_0x45317a[_0x554d('0x19')](0x194)[_0x554d('0x28')](_0x554d('0x59'));}else{return handleError(_0x45317a,null);}});};exports[_0x554d('0x5a')]=function(_0x10ece3,_0x3a18fd,_0x3615cc){var _0x4c3fed=require(_0x554d('0x5b'));var _0x4bbc02=![];var _0x297e6b={'$and':[db[_0x554d('0x5c')][_0x554d('0x39')](db['sequelize']['fn'](_0x554d('0x5d'),db['sequelize']['col'](_0x554d('0x4c'))),_0x10ece3[_0x554d('0x2e')][_0x554d('0x5e')])]};if(_0x10ece3['query']['type']&&_0x10ece3[_0x554d('0x2e')][_0x554d('0x2d')]==='uniqueid'){_0x297e6b['$and']['push']({'uniqueid':_0x10ece3['params']['id']});}else{_0x297e6b[_0x554d('0x5f')][_0x554d('0x60')]({'id':_0x10ece3['params']['id']});}return db[_0x554d('0x2a')]['find']({'where':_0x297e6b,'attributes':['id',_0x554d('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x3a18fd,null))[_0x554d('0x23')](function(_0x32ccba){if(_0x32ccba){var _0x1303fa=util[_0x554d('0x4e')]('%s.cypher',_0x32ccba[_0x554d('0x4d')]);if(fs[_0x554d('0x50')](_0x1303fa)){_0x4bbc02=!![];return _0x4c3fed[_0x554d('0x51')](_0x1303fa,_0x32ccba[_0x554d('0x4d')],config[_0x554d('0x61')][_0x554d('0x52')])[_0x554d('0x23')](function(){return _0x32ccba;});}return _0x32ccba;}})[_0x554d('0x23')](function(_0x447305){if(_0x447305){if(!fs[_0x554d('0x50')](_0x447305[_0x554d('0x4d')])){throw new db[(_0x554d('0x53'))][(_0x554d('0x54'))](_0x554d('0x58'));}if(_0x447305[_0x554d('0x55')]){return _0x3a18fd[_0x554d('0x4b')](_0x447305['value'],_0x447305['filename']+path[_0x554d('0x56')](_0x447305[_0x554d('0x4d')]),function(){if(_0x4bbc02){fs[_0x554d('0x57')](_0x447305[_0x554d('0x4d')]);}});}else{return _0x3a18fd[_0x554d('0x4b')](_0x447305[_0x554d('0x4d')],function(_0x373dad){if(_0x4bbc02){fs[_0x554d('0x57')](_0x447305[_0x554d('0x4d')]);}});}}})[_0x554d('0x46')](handleError(_0x3a18fd,null));};exports[_0x554d('0x24')]=function(_0x365f9b,_0x182349){return db[_0x554d('0x2a')][_0x554d('0x49')]({'where':{'id':_0x365f9b[_0x554d('0x43')]['id']}})[_0x554d('0x23')](function(_0x98a6bd){if(_[_0x554d('0x62')](_0x98a6bd)){throw new ReferenceError('Entity\x20not\x20found');}return _0x98a6bd;})['then'](function(_0x102495){var _0x10e999=_0x102495[_0x554d('0x4d')];logger[_0x554d('0x63')](_0x554d('0x64'),_0x10e999);if(!_[_0x554d('0x62')](_0x102495[_0x554d('0x4d')])&&fs[_0x554d('0x50')](_0x10e999)){logger[_0x554d('0x63')](_0x554d('0x65')+_0x10e999+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x554d('0x66')](_0x10e999);}_0x10e999=_0x10e999+_0x554d('0x67');if(!_['isNil'](_0x102495[_0x554d('0x4d')])&&fs[_0x554d('0x50')](_0x10e999)){logger[_0x554d('0x63')](_0x554d('0x65')+_0x10e999+_0x554d('0x68'));fs['unlinkSync'](_0x10e999);}return _0x102495;})[_0x554d('0x23')](function(_0x38cab4){if(!_0x38cab4)throw new InternalError();return _0x38cab4[_0x554d('0x24')]();})[_0x554d('0x23')](function(){_0x182349['status'](0xcc)[_0x554d('0x25')]();})[_0x554d('0x46')](handleError(_0x182349,null));};function getBucketslist(_0x36061a,_0x336aec,_0x41ee71){return new Promise(function(_0x5e4f39,_0x3f7699){var _0x4a22a0=new AWS['S3']({'accessKeyId':_0x336aec,'secretAccessKey':_0x36061a,'region':_0x41ee71});_0x4a22a0[_0x554d('0x69')]({},function(_0x68dd11,_0x1fc951){if(_0x68dd11){return _0x3f7699(_0x68dd11);}else{return _0x5e4f39(_0x1fc951);}});});}function createBucket(_0x4739dc,_0x4f37a2,_0x4dd98c,_0x98daf4){return new Promise(function(_0x5a1cf7,_0x17f0d4){var _0x320866=new AWS['S3']({'accessKeyId':_0x4f37a2,'secretAccessKey':_0x4739dc,'region':_0x4dd98c});_0x320866[_0x554d('0x6a')]({'Bucket':_0x98daf4},function(_0x3143df,_0x2ba535){if(_0x3143df){return _0x17f0d4(_0x3143df);}else{return _0x5a1cf7(_0x2ba535);}});});}function uploadFile(_0x1b5cd7,_0x5c0431,_0x4e99d9,_0x4aa525,_0x347f6b,_0x40e704){return new Promise(function(_0x4ebad4,_0x5004ae){var _0x3a5702=new AWS['S3']({'accessKeyId':_0x5c0431,'secretAccessKey':_0x1b5cd7,'region':_0x4e99d9});_0x3a5702[_0x554d('0x6b')]({'Bucket':_0x4aa525,'Key':_0x347f6b,'Body':_0x40e704},function(_0x5a4ba9,_0x376625){if(_0x5a4ba9){return _0x5004ae(_0x5a4ba9);}else{return _0x4ebad4(_0x376625);}});});}function startTranscribe(_0x415aa1,_0x373ad3,_0x509cfd,_0x10bb11,_0x4c696,_0x30c2f1){return new Promise(function(_0x5627fe,_0x1f8d06){var _0x37cfc8=new AWS[(_0x554d('0x6c'))]({'accessKeyId':_0x373ad3,'secretAccessKey':_0x415aa1,'region':_0x509cfd});_0x37cfc8[_0x554d('0x6d')]({'TranscriptionJobName':_0x10bb11,'LanguageCode':_0x4c696,'Media':{'MediaFileUri':_0x30c2f1}},function(_0x100762,_0x14491c){if(_0x100762){return _0x1f8d06(_0x100762);}else{return _0x5627fe(_0x14491c);}});});}function transcribe(_0x38640c,_0x32f328,_0x5bdbaa,_0x511202,_0x2def22,_0x46f546,_0x41cbd5){return new Promise(function(_0x163eff,_0x171cf8){var _0x5d852a={};logger[_0x554d('0x63')](util[_0x554d('0x4e')](_0x554d('0x6e'),_0x38640c,_0x2def22));return uploadFile(_0x32f328,_0x5bdbaa,_0x511202,_0x2def22,path[_0x554d('0x6f')](_0x46f546),fs[_0x554d('0x70')](_0x46f546))[_0x554d('0x23')](function(_0x83abf){logger[_0x554d('0x63')](util['format'](_0x554d('0x71'),_0x38640c,_0x2def22,_0x83abf[_0x554d('0x72')]));_0x5d852a[_0x554d('0x73')]=_0x83abf[_0x554d('0x74')];_0x5d852a[_0x554d('0x75')]=_0x83abf[_0x554d('0x72')];logger['info'](util[_0x554d('0x4e')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x38640c));return startTranscribe(_0x32f328,_0x5bdbaa,_0x511202,uuidv4(),_0x41cbd5,_0x83abf['Location']);})[_0x554d('0x23')](function(_0x36da95){logger[_0x554d('0x63')](util[_0x554d('0x4e')](_0x554d('0x76'),_0x38640c,_0x36da95[_0x554d('0x77')]['TranscriptionJobName']));_0x5d852a[_0x554d('0x78')]=_0x36da95[_0x554d('0x77')][_0x554d('0x79')];_0x5d852a['transcribeStatus']=_0x36da95[_0x554d('0x77')][_0x554d('0x7a')];return _0x163eff(_0x5d852a);})[_0x554d('0x46')](function(_0x34c7fc){return _0x171cf8(_0x34c7fc);});});}exports['runTranscribe']=function(_0x4acf42,_0x472be4,_0xe6d187){var _0x31c50e;var _0x30ea27;var _0x366822;var _0x169f5e=require(_0x554d('0x5b'));return db[_0x554d('0x2a')][_0x554d('0x7b')]({'where':{'id':_0x4acf42[_0x554d('0x43')]['id']}})[_0x554d('0x23')](function(_0xe492ae){if(_0xe492ae){var _0x1588b7=util['format'](_0x554d('0x4f'),_0xe492ae[_0x554d('0x4d')]);if(fs['existsSync'](_0x1588b7)){cypher=!![];return _0x169f5e['decryptFile'](_0x1588b7,_0xe492ae['value'],config['secrets'][_0x554d('0x52')])[_0x554d('0x23')](function(){return _0xe492ae;});}return _0xe492ae;}})[_0x554d('0x23')](function(_0x55c40c){if(!_0x55c40c){throw new db[(_0x554d('0x53'))]['ValidationError']('Voice\x20Recording\x20not\x20found');}_0x30ea27=_0x55c40c;return db[_0x554d('0x7c')][_0x554d('0x7b')]({'where':{'id':0x1}});})[_0x554d('0x23')](handleEntityNotFound(_0x472be4,null))[_0x554d('0x23')](function(_0x24929c){if(_0x24929c){_0x31c50e=_0x24929c;if(!_0x31c50e[_0x554d('0x7d')]||!_0x31c50e[_0x554d('0x7e')]||!_0x31c50e[_0x554d('0x7f')]||!_0x31c50e[_0x554d('0x80')]||!_0x31c50e['bucket']){throw new db[(_0x554d('0x53'))][(_0x554d('0x54'))](_0x554d('0x81'));}if(_0x4acf42['body']['runSentiment']&&(!_0x31c50e[_0x554d('0x82')]||!_0x31c50e[_0x554d('0x83')]||!_0x31c50e[_0x554d('0x84')]||!_0x31c50e[_0x554d('0x80')]||!_0x31c50e[_0x554d('0x73')])){throw new db[(_0x554d('0x53'))][(_0x554d('0x54'))](_0x554d('0x85'));}return db[_0x554d('0x86')][_0x554d('0x7b')]({'where':{'id':_0x31c50e[_0x554d('0x7e')]}});}})[_0x554d('0x23')](function(_0x240f59){if(!_0x240f59){throw new db[(_0x554d('0x53'))][(_0x554d('0x54'))](_0x554d('0x87'));}if(!_0x240f59[_0x554d('0x88')]||!_0x240f59[_0x554d('0x89')]){throw new db[(_0x554d('0x53'))]['ValidationError'](_0x554d('0x8a'));}_0x366822=_0x240f59;return getBucketslist(_0x366822[_0x554d('0x88')],_0x366822[_0x554d('0x89')],_0x31c50e[_0x554d('0x7f')]);})['then'](function(_0x5526bb){if(_0x5526bb&&_0x5526bb['Buckets']){var _0x2a4fc3=_[_0x554d('0x49')](_0x5526bb[_0x554d('0x8b')],function(_0x40fc31){return _0x40fc31['Name']===_0x31c50e[_0x554d('0x73')];});if(!_0x2a4fc3){logger['info'](util['format'](_0x554d('0x8c'),_0x4acf42['params']['id'],_0x31c50e['bucket']));return createBucket(_0x366822[_0x554d('0x88')],_0x366822[_0x554d('0x89')],_0x31c50e[_0x554d('0x7f')],_0x31c50e[_0x554d('0x73')]);}logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x4acf42[_0x554d('0x43')]['id'],_0x31c50e[_0x554d('0x73')]));return;}})[_0x554d('0x23')](function(_0x4ccfdd){if(_0x30ea27[_0x554d('0x8d')]===_0x554d('0x8e')){return transcribe(_0x4acf42[_0x554d('0x43')]['id'],_0x366822['data1'],_0x366822[_0x554d('0x89')],_0x31c50e[_0x554d('0x7f')],_0x31c50e['bucket'],_0x30ea27['value'],_0x31c50e[_0x554d('0x80')]);}else{logger[_0x554d('0x63')](util[_0x554d('0x4e')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x4acf42['params']['id']));return{'transcribeStatus':_0x554d('0x8f')};}})['then'](function(_0x2e7ed1){if(_0x2e7ed1){_0x2e7ed1[_0x554d('0x90')]=_0x4acf42['body'][_0x554d('0x91')];return _0x30ea27[_0x554d('0x92')](_0x2e7ed1);}})['then'](respondWithResult(_0x472be4,null))[_0x554d('0x46')](handleError(_0x472be4,null));};function writeFile(_0x15a6b5,_0x2f65b3){return new Promise(function(_0xb239bc,_0x317896){fs[_0x554d('0x93')](_0x2f65b3,_0x15a6b5,function(_0x45f6d4,_0xbd26d6){if(_0x45f6d4){return _0x317896(_0x45f6d4);}else{return _0xb239bc(_0xbd26d6);}});});}exports['downloadTranscribe']=function(_0x3812ef,_0x380df0,_0x117215){return db[_0x554d('0x2a')][_0x554d('0x7b')]({'where':{'id':_0x3812ef[_0x554d('0x43')]['id']}})[_0x554d('0x23')](handleEntityNotFound(_0x380df0))[_0x554d('0x23')](function(_0x761791){if(_0x761791&&_0x761791[_0x554d('0x94')]){var _0x111df8=_0x761791['fileText'];var _0x41bc25=config[_0x554d('0x95')]+'/server/files/transcribes/transcribe_'+_0x761791['id']+_0x554d('0x96');if(fs[_0x554d('0x50')](_0x41bc25)){return _0x41bc25;}return writeFile(_0x111df8,_0x41bc25)['then'](function(){return _0x41bc25;});}else{throw new db['Sequelize']['ValidationError'](_0x554d('0x97'));}})[_0x554d('0x23')](function(_0x3dfdf6){return _0x380df0['download'](_0x3dfdf6);})[_0x554d('0x46')](handleError(_0x380df0));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 47f058b..ea5596f 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 _0x8d97=['VoiceRecording','voice_recordings','uniqueid','transcribeStatus','exports','define'];(function(_0x2f7e15,_0x6e0949){var _0xbf1bf1=function(_0x538ea3){while(--_0x538ea3){_0x2f7e15['push'](_0x2f7e15['shift']());}};_0xbf1bf1(++_0x6e0949);}(_0x8d97,0x82));var _0x78d9=function(_0x1d042f,_0x883c50){_0x1d042f=_0x1d042f-0x0;var _0x1fa617=_0x8d97[_0x1d042f];return _0x1fa617;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0x78d9('0x0')]=function(_0x288fbe,_0x54c125){return _0x288fbe[_0x78d9('0x1')](_0x78d9('0x2'),attributes,{'tableName':_0x78d9('0x3'),'paranoid':![],'indexes':[{'name':_0x78d9('0x4'),'fields':[_0x78d9('0x4')]},{'name':'transcribeStatus','fields':[_0x78d9('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9658=['VoiceRecording','uniqueid','transcribeStatus','./voiceRecording.attributes'];(function(_0x20620f,_0x37c815){var _0x593a2f=function(_0x25479a){while(--_0x25479a){_0x20620f['push'](_0x20620f['shift']());}};_0x593a2f(++_0x37c815);}(_0x9658,0x6f));var _0x8965=function(_0x16db8b,_0xca7d28){_0x16db8b=_0x16db8b-0x0;var _0x5ba017=_0x9658[_0x16db8b];return _0x5ba017;};'use strict';var attributes=require(_0x8965('0x0'));module['exports']=function(_0x1f5bb6,_0xa89576){return _0x1f5bb6['define'](_0x8965('0x1'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x8965('0x2'),'fields':[_0x8965('0x2')]},{'name':_0x8965('0x3'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 1c5d6b6..5adab42 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 _0xbff5=['catch','CreateVoiceRecording','Setting','findOne','create','callRecordingEncryption','existsSync','%s.cypher','encryptFile','value','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','update','options','raw','where','attributes','then','UpdateVoiceRecording','debug'];(function(_0x35d3a8,_0x44406a){var _0x182378=function(_0x298e0b){while(--_0x298e0b){_0x35d3a8['push'](_0x35d3a8['shift']());}};_0x182378(++_0x44406a);}(_0xbff5,0x1bc));var _0x5bff=function(_0x3771eb,_0x2ee089){_0x3771eb=_0x3771eb-0x0;var _0x1c562d=_0xbff5[_0x3771eb];return _0x1c562d;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var moment=require(_0x5bff('0x2'));var BPromise=require(_0x5bff('0x3'));var rs=require(_0x5bff('0x4'));var fs=require('fs');var Redis=require(_0x5bff('0x5'));var db=require(_0x5bff('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bff('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5bff('0x8'));var client=jayson[_0x5bff('0x9')][_0x5bff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa54c57,_0x43605a,_0xd4b9dc){return new BPromise(function(_0x1acb49,_0x139c99){return client[_0x5bff('0xb')](_0xa54c57,_0xd4b9dc)['then'](function(_0x20e26f){logger['info'](_0x5bff('0xc'),_0x43605a,_0x5bff('0xd'));logger['debug'](_0x5bff('0xe'),_0x43605a,'request\x20sent',JSON[_0x5bff('0xf')](_0x20e26f));if(_0x20e26f['error']){if(_0x20e26f[_0x5bff('0x10')][_0x5bff('0x11')]===0x1f4){logger['error'](_0x5bff('0xc'),_0x43605a,_0x20e26f['error'][_0x5bff('0x12')]);return _0x139c99(_0x20e26f[_0x5bff('0x10')]['message']);}logger[_0x5bff('0x10')](_0x5bff('0xc'),_0x43605a,_0x20e26f['error']['message']);return _0x1acb49(_0x20e26f[_0x5bff('0x10')][_0x5bff('0x12')]);}else{logger[_0x5bff('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x43605a,_0x5bff('0xd'));_0x1acb49(_0x20e26f[_0x5bff('0x14')][_0x5bff('0x12')]);}})['catch'](function(_0x3ffbbc){logger[_0x5bff('0x10')](_0x5bff('0xc'),_0x43605a,_0x3ffbbc);_0x139c99(_0x3ffbbc);});});}exports['UpdateVoiceRecording']=function(_0xc9fbc3){var _0x279c22=this;return new Promise(function(_0x36653b,_0x32cf60){return db['VoiceRecording'][_0x5bff('0x15')](_0xc9fbc3['body'],{'raw':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3['options'][_0x5bff('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3[_0x5bff('0x16')][_0x5bff('0x18')]||null:null,'attributes':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3[_0x5bff('0x16')][_0x5bff('0x19')]||null:null,'limit':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3[_0x5bff('0x16')]['limit']||null:null})[_0x5bff('0x1a')](function(_0x263cf5){logger[_0x5bff('0x13')](_0x5bff('0x1b'),_0xc9fbc3);logger[_0x5bff('0x1c')](_0x5bff('0x1b'),_0xc9fbc3,JSON[_0x5bff('0xf')](_0x263cf5));_0x36653b(_0x263cf5);})[_0x5bff('0x1d')](function(_0x5e2ae8){logger['error'](_0x5bff('0x1b'),_0x5e2ae8['message'],_0xc9fbc3);_0x32cf60(_0x279c22[_0x5bff('0x10')](0x1f4,_0x5e2ae8[_0x5bff('0x12')]));});});};exports[_0x5bff('0x1e')]=function(_0x6f18f1){var _0xfa361d=this;return new Promise(function(_0x1140eb,_0x271f3c){var _0xedba9d=require('../../components/encryptor');var _0x4df57a;return db[_0x5bff('0x1f')][_0x5bff('0x20')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x5bff('0x1a')](function(_0x588078){_0x4df57a=_0x588078;return db['VoiceRecording'][_0x5bff('0x21')](_0x6f18f1['body']);})[_0x5bff('0x1a')](function(_0x64e22){if(_0x4df57a[_0x5bff('0x22')]&&fs[_0x5bff('0x23')](_0x64e22['value'])){var _0x71783=util['format'](_0x5bff('0x24'),_0x64e22['value']);return _0xedba9d[_0x5bff('0x25')](_0x64e22[_0x5bff('0x26')],_0x71783,config[_0x5bff('0x27')][_0x5bff('0x28')])[_0x5bff('0x1a')](function(){fs[_0x5bff('0x29')](_0x64e22['value']);logger[_0x5bff('0x13')](_0x5bff('0x2a'));return _0x64e22;});}return _0x64e22;})[_0x5bff('0x1a')](function(_0x42fe4a){logger[_0x5bff('0x13')](_0x5bff('0x1e'),_0x6f18f1);logger[_0x5bff('0x1c')](_0x5bff('0x1e'),_0x6f18f1,JSON['stringify'](_0x42fe4a));_0x1140eb(_0x42fe4a);})[_0x5bff('0x1d')](function(_0x16042d){logger[_0x5bff('0x10')](_0x5bff('0x1e'),_0x16042d['message'],_0x6f18f1);_0x271f3c(_0xfa361d[_0x5bff('0x10')](0x1f4,_0x16042d[_0x5bff('0x12')]));});});}; \ No newline at end of file +var _0xacf4=['limit','debug','stringify','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes'];(function(_0x1f1b10,_0x3136fd){var _0x3d0c2b=function(_0x59b85a){while(--_0x59b85a){_0x1f1b10['push'](_0x1f1b10['shift']());}};_0x3d0c2b(++_0x3136fd);}(_0xacf4,0xe7));var _0x4acf=function(_0x2fd7fb,_0x32afad){_0x2fd7fb=_0x2fd7fb-0x0;var _0x15bf0a=_0xacf4[_0x2fd7fb];return _0x15bf0a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acf('0x0'));var BPromise=require(_0x4acf('0x1'));var rs=require(_0x4acf('0x2'));var fs=require('fs');var Redis=require(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var utils=require(_0x4acf('0x5'));var logger=require(_0x4acf('0x6'))('rpc');var config=require(_0x4acf('0x7'));var jayson=require(_0x4acf('0x8'));var client=jayson['client'][_0x4acf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba08a,_0x649ad2,_0x45a5a4){return new BPromise(function(_0x25d345,_0x50f5f4){return client['request'](_0x2ba08a,_0x45a5a4)[_0x4acf('0xa')](function(_0x59f559){logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x649ad2,_0x4acf('0xd'));logger['debug'](_0x4acf('0xe'),_0x649ad2,_0x4acf('0xd'),JSON['stringify'](_0x59f559));if(_0x59f559['error']){if(_0x59f559[_0x4acf('0xf')]['code']===0x1f4){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x50f5f4(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}logger[_0x4acf('0xf')](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x25d345(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}else{logger['info'](_0x4acf('0xc'),_0x649ad2,'request\x20sent');_0x25d345(_0x59f559[_0x4acf('0x11')][_0x4acf('0x10')]);}})[_0x4acf('0x12')](function(_0x5d934a){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x5d934a);_0x50f5f4(_0x5d934a);});});}exports[_0x4acf('0x13')]=function(_0x240c00){var _0x4b1d93=this;return new Promise(function(_0x2a678b,_0x137302){return db[_0x4acf('0x14')][_0x4acf('0x15')](_0x240c00[_0x4acf('0x16')],{'raw':_0x240c00[_0x4acf('0x17')]?_0x240c00[_0x4acf('0x17')][_0x4acf('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x240c00[_0x4acf('0x17')]?_0x240c00[_0x4acf('0x17')][_0x4acf('0x19')]||null:null,'attributes':_0x240c00['options']?_0x240c00[_0x4acf('0x17')][_0x4acf('0x1a')]||null:null,'limit':_0x240c00['options']?_0x240c00[_0x4acf('0x17')][_0x4acf('0x1b')]||null:null})['then'](function(_0x3b26ac){logger[_0x4acf('0xb')](_0x4acf('0x13'),_0x240c00);logger[_0x4acf('0x1c')]('UpdateVoiceRecording',_0x240c00,JSON[_0x4acf('0x1d')](_0x3b26ac));_0x2a678b(_0x3b26ac);})[_0x4acf('0x12')](function(_0x57e595){logger[_0x4acf('0xf')](_0x4acf('0x13'),_0x57e595['message'],_0x240c00);_0x137302(_0x4b1d93[_0x4acf('0xf')](0x1f4,_0x57e595[_0x4acf('0x10')]));});});};exports[_0x4acf('0x1e')]=function(_0x16458f){var _0x571a30=this;return new Promise(function(_0x50236d,_0x17a756){var _0x3f548a=require(_0x4acf('0x1f'));var _0x42c90c;return db[_0x4acf('0x20')][_0x4acf('0x21')]({'attributes':['id',_0x4acf('0x22')],'where':{'id':0x1},'raw':!![]})[_0x4acf('0xa')](function(_0x382c41){_0x42c90c=_0x382c41;return db[_0x4acf('0x14')]['create'](_0x16458f[_0x4acf('0x16')]);})[_0x4acf('0xa')](function(_0xd027c7){if(_0x42c90c[_0x4acf('0x22')]&&fs[_0x4acf('0x23')](_0xd027c7[_0x4acf('0x24')])){var _0x27384c=util['format'](_0x4acf('0x25'),_0xd027c7[_0x4acf('0x24')]);return _0x3f548a[_0x4acf('0x26')](_0xd027c7['value'],_0x27384c,config[_0x4acf('0x27')][_0x4acf('0x28')])[_0x4acf('0xa')](function(){fs[_0x4acf('0x29')](_0xd027c7['value']);logger[_0x4acf('0xb')](_0x4acf('0x2a'));return _0xd027c7;});}return _0xd027c7;})[_0x4acf('0xa')](function(_0x5e2332){logger[_0x4acf('0xb')](_0x4acf('0x1e'),_0x16458f);logger[_0x4acf('0x1c')](_0x4acf('0x1e'),_0x16458f,JSON[_0x4acf('0x1d')](_0x5e2332));_0x50236d(_0x5e2332);})[_0x4acf('0x12')](function(_0x490880){logger[_0x4acf('0xf')](_0x4acf('0x1e'),_0x490880['message'],_0x16458f);_0x17a756(_0x571a30[_0x4acf('0xf')](0x1f4,_0x490880['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 63be0ef..322dd16 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 _0xd602=['../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xd602,0x126));var _0x2d60=function(_0x5baa46,_0xee7c7f){_0x5baa46=_0x5baa46-0x0;var _0x137bf7=_0xd602[_0x5baa46];return _0x137bf7;};'use strict';var multer=require(_0x2d60('0x0'));var util=require(_0x2d60('0x1'));var path=require(_0x2d60('0x2'));var timeout=require(_0x2d60('0x3'));var express=require(_0x2d60('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2d60('0x5'));var interaction=require(_0x2d60('0x6'));var config=require(_0x2d60('0x7'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2d60('0x8')]);router[_0x2d60('0x9')](_0x2d60('0xa'),auth[_0x2d60('0xb')](),controller[_0x2d60('0xc')]);router['get'](_0x2d60('0xd'),auth[_0x2d60('0xb')](),controller[_0x2d60('0xe')]);router['post']('/',auth[_0x2d60('0xb')](),controller[_0x2d60('0xf')]);router[_0x2d60('0x10')](_0x2d60('0xd'),auth[_0x2d60('0xb')](),controller[_0x2d60('0x11')]);router[_0x2d60('0x12')]('/:id',auth[_0x2d60('0xb')](),controller['destroy']);module[_0x2d60('0x13')]=router; \ No newline at end of file +var _0x53e5=['../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x302d0a,_0x31aeff){var _0x154752=function(_0x44fc09){while(--_0x44fc09){_0x302d0a['push'](_0x302d0a['shift']());}};_0x154752(++_0x31aeff);}(_0x53e5,0x72));var _0x553e=function(_0x1bb572,_0x3674d8){_0x1bb572=_0x1bb572-0x0;var _0x3716e3=_0x53e5[_0x1bb572];return _0x3716e3;};'use strict';var multer=require('multer');var util=require(_0x553e('0x0'));var path=require(_0x553e('0x1'));var timeout=require(_0x553e('0x2'));var express=require(_0x553e('0x3'));var router=express[_0x553e('0x4')]();var fs_extra=require(_0x553e('0x5'));var auth=require(_0x553e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x553e('0x7'));var controller=require(_0x553e('0x8'));router[_0x553e('0x9')]('/',auth['isAuthenticated'](),controller[_0x553e('0xa')]);router[_0x553e('0x9')](_0x553e('0xb'),auth[_0x553e('0xc')](),controller[_0x553e('0xd')]);router['get'](_0x553e('0xe'),auth[_0x553e('0xc')](),controller[_0x553e('0xf')]);router['post']('/',auth[_0x553e('0xc')](),controller['create']);router[_0x553e('0x10')]('/:id',auth[_0x553e('0xc')](),controller[_0x553e('0x11')]);router[_0x553e('0x12')](_0x553e('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x553e('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 7e51f7c..0addf32 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 _0x2a7e=['attended','STRING','moment','exports','ENUM','blind'];(function(_0x4a8c64,_0x4b2df3){var _0x570e8b=function(_0x4dc5ae){while(--_0x4dc5ae){_0x4a8c64['push'](_0x4a8c64['shift']());}};_0x570e8b(++_0x4b2df3);}(_0x2a7e,0x1d6));var _0xe2a7=function(_0x2b5d75,_0x12888c){_0x2b5d75=_0x2b5d75-0x0;var _0x446bb2=_0x2a7e[_0x2b5d75];return _0x446bb2;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe2a7('0x0'));module[_0xe2a7('0x1')]={'type':{'type':Sequelize[_0xe2a7('0x2')](_0xe2a7('0x3'),_0xe2a7('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xe2a7('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xe2a7('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xe2a7('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xe2a7('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xe2a7('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xe2a7('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xe2a7('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xe2a7('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xe2a7('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xe2a7('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xe2a7('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xe2a7('0x5')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xe2a7('0x5')]}}; \ No newline at end of file +var _0xecef=['STRING','Yes','moment','exports','blind','attended'];(function(_0x594a98,_0x508a42){var _0x355283=function(_0x13d677){while(--_0x13d677){_0x594a98['push'](_0x594a98['shift']());}};_0x355283(++_0x508a42);}(_0xecef,0xe0));var _0xfece=function(_0x145d7d,_0x349ede){_0x145d7d=_0x145d7d-0x0;var _0x25bc00=_0xecef[_0x145d7d];return _0x25bc00;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfece('0x0'));module[_0xfece('0x1')]={'type':{'type':Sequelize['ENUM'](_0xfece('0x2'),_0xfece('0x3'))},'result':{'type':Sequelize[_0xfece('0x4')]},'transfererchannel':{'type':Sequelize[_0xfece('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xfece('0x4')]},'transferercalleridname':{'type':Sequelize[_0xfece('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xfece('0x4')]},'transfereraccountcode':{'type':Sequelize[_0xfece('0x4')]},'transferercontext':{'type':Sequelize[_0xfece('0x4')]},'transfererexten':{'type':Sequelize[_0xfece('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xfece('0x4')]},'transfereechannel':{'type':Sequelize[_0xfece('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0xfece('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xfece('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xfece('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xfece('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xfece('0x4')]},'transfereeexten':{'type':Sequelize[_0xfece('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0xfece('0x5'),'No')},'context':{'type':Sequelize[_0xfece('0x4')]},'extension':{'type':Sequelize[_0xfece('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index d92f8dc..d3e542b 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 _0x6c1e=['offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','VoiceTransferReport','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','count','includeAll','include','findAll','rows','catch','params','rawAttributes','options','create','body','find','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c1e,0x194));var _0xe6c1=function(_0x1f323d,_0x358c4a){_0x1f323d=_0x1f323d-0x0;var _0x251789=_0x6c1e[_0x1f323d];return _0x251789;};'use strict';var emlformat=require(_0xe6c1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe6c1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe6c1('0x2'));var moment=require(_0xe6c1('0x3'));var BPromise=require(_0xe6c1('0x4'));var Mustache=require(_0xe6c1('0x5'));var util=require('util');var path=require(_0xe6c1('0x6'));var sox=require('sox');var csv=require(_0xe6c1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe6c1('0x8'));var _=require(_0xe6c1('0x9'));var squel=require(_0xe6c1('0xa'));var crypto=require(_0xe6c1('0xb'));var jsforce=require(_0xe6c1('0xc'));var deskjs=require(_0xe6c1('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe6c1('0xe'));var Papa=require(_0xe6c1('0xf'));var Redis=require(_0xe6c1('0x10'));var authService=require(_0xe6c1('0x11'));var qs=require(_0xe6c1('0x12'));var as=require(_0xe6c1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe6c1('0x14'));var config=require(_0xe6c1('0x15'));var licenseUtil=require(_0xe6c1('0x16'));var db=require(_0xe6c1('0x17'))['db'];function respondWithStatusCode(_0x15ead3,_0x13ad4f){_0x13ad4f=_0x13ad4f||0xcc;return function(_0x4ad0a4){if(_0x4ad0a4){return _0x15ead3[_0xe6c1('0x18')](_0x13ad4f);}return _0x15ead3['status'](_0x13ad4f)[_0xe6c1('0x19')]();};}function respondWithResult(_0x55ebb6,_0x2d57db){_0x2d57db=_0x2d57db||0xc8;return function(_0xfef60e){if(_0xfef60e){return _0x55ebb6[_0xe6c1('0x1a')](_0x2d57db)[_0xe6c1('0x1b')](_0xfef60e);}};}function respondWithFilteredResult(_0x3dd259,_0x1130d1){return function(_0x4f3220){if(_0x4f3220){var _0x294a67=typeof _0x1130d1[_0xe6c1('0x1c')]==='undefined'&&typeof _0x1130d1['limit']==='undefined';var _0x2f31a4=_0x4f3220['count'];var _0x231a33=_0x294a67?0x0:_0x1130d1['offset'];var _0x2c7fe5=_0x294a67?_0x4f3220['count']:_0x1130d1[_0xe6c1('0x1c')]+_0x1130d1[_0xe6c1('0x1d')];var _0xa1ed23;if(_0x2c7fe5>=_0x2f31a4){_0x2c7fe5=_0x2f31a4;_0xa1ed23=0xc8;}else{_0xa1ed23=0xce;}_0x3dd259[_0xe6c1('0x1a')](_0xa1ed23);return _0x3dd259[_0xe6c1('0x1e')](_0xe6c1('0x1f'),_0x231a33+'-'+_0x2c7fe5+'/'+_0x2f31a4)['json'](_0x4f3220);}return null;};}function patchUpdates(_0x1a3773){return function(_0x3ec221){try{jsonpatch[_0xe6c1('0x20')](_0x3ec221,_0x1a3773,!![]);}catch(_0x21dae1){return BPromise[_0xe6c1('0x21')](_0x21dae1);}return _0x3ec221[_0xe6c1('0x22')]();};}function saveUpdates(_0x23172e,_0x59522c){return function(_0x5db3a0){if(_0x5db3a0){return _0x5db3a0[_0xe6c1('0x23')](_0x23172e)[_0xe6c1('0x24')](function(_0xc75e26){return _0xc75e26;});}return null;};}function removeEntity(_0x3576e3,_0x540bbe){return function(_0x26f592){if(_0x26f592){return _0x26f592[_0xe6c1('0x25')]()[_0xe6c1('0x24')](function(){_0x3576e3[_0xe6c1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x598802,_0x29d74e){return function(_0x4de383){if(!_0x4de383){_0x598802[_0xe6c1('0x18')](0x194);}return _0x4de383;};}function handleError(_0x5c04dd,_0xf3b5aa){_0xf3b5aa=_0xf3b5aa||0x1f4;return function(_0x7bdcd9){logger[_0xe6c1('0x26')](_0x7bdcd9[_0xe6c1('0x27')]);if(_0x7bdcd9[_0xe6c1('0x28')]){delete _0x7bdcd9['name'];}_0x5c04dd[_0xe6c1('0x1a')](_0xf3b5aa)[_0xe6c1('0x29')](_0x7bdcd9);};}exports['index']=function(_0x2ccc06,_0x170b41){var _0x52d90f={},_0x197d3a={},_0x3505ef={'count':0x0,'rows':[]};var _0x4043ea=_['map'](db[_0xe6c1('0x2a')]['rawAttributes'],function(_0x499370){return{'name':_0x499370[_0xe6c1('0x2b')],'type':_0x499370[_0xe6c1('0x2c')]['key']};});_0x197d3a[_0xe6c1('0x2d')]=_[_0xe6c1('0x2e')](_0x4043ea,_0xe6c1('0x28'));_0x197d3a[_0xe6c1('0x2f')]=_[_0xe6c1('0x30')](_0x2ccc06['query']);_0x197d3a[_0xe6c1('0x31')]=_[_0xe6c1('0x32')](_0x197d3a[_0xe6c1('0x2d')],_0x197d3a[_0xe6c1('0x2f')]);_0x52d90f[_0xe6c1('0x33')]=_[_0xe6c1('0x32')](_0x197d3a['model'],qs[_0xe6c1('0x34')](_0x2ccc06['query'][_0xe6c1('0x34')]));_0x52d90f[_0xe6c1('0x33')]=_0x52d90f['attributes'][_0xe6c1('0x35')]?_0x52d90f[_0xe6c1('0x33')]:_0x197d3a[_0xe6c1('0x2d')];if(!_0x2ccc06['query'][_0xe6c1('0x36')]('nolimit')){_0x52d90f[_0xe6c1('0x1d')]=qs[_0xe6c1('0x1d')](_0x2ccc06[_0xe6c1('0x2f')][_0xe6c1('0x1d')]);_0x52d90f[_0xe6c1('0x1c')]=qs[_0xe6c1('0x1c')](_0x2ccc06[_0xe6c1('0x2f')]['offset']);}_0x52d90f['order']=qs[_0xe6c1('0x37')](_0x2ccc06[_0xe6c1('0x2f')]['sort']);_0x52d90f[_0xe6c1('0x38')]=qs[_0xe6c1('0x31')](_['pick'](_0x2ccc06[_0xe6c1('0x2f')],_0x197d3a['filters']),_0x4043ea);if(_0x2ccc06[_0xe6c1('0x2f')]['filter']){_0x52d90f['where']=_[_0xe6c1('0x39')](_0x52d90f[_0xe6c1('0x38')],{'$or':_[_0xe6c1('0x2e')](_0x4043ea,function(_0x14a2be){if(_0x14a2be[_0xe6c1('0x2c')]!==_0xe6c1('0x3a')){var _0x38cbf6={};_0x38cbf6[_0x14a2be['name']]={'$like':'%'+_0x2ccc06['query'][_0xe6c1('0x3b')]+'%'};return _0x38cbf6;}})});}_0x52d90f=_[_0xe6c1('0x39')]({},_0x52d90f,_0x2ccc06['options']);var _0x15b155={'where':_0x52d90f['where']};return db['VoiceTransferReport'][_0xe6c1('0x3c')](_0x15b155)[_0xe6c1('0x24')](function(_0xbc3263){_0x3505ef[_0xe6c1('0x3c')]=_0xbc3263;if(_0x2ccc06['query'][_0xe6c1('0x3d')]){_0x52d90f[_0xe6c1('0x3e')]=[{'all':!![]}];}return db[_0xe6c1('0x2a')][_0xe6c1('0x3f')](_0x52d90f);})[_0xe6c1('0x24')](function(_0x19235a){_0x3505ef[_0xe6c1('0x40')]=_0x19235a;return _0x3505ef;})[_0xe6c1('0x24')](respondWithFilteredResult(_0x170b41,_0x52d90f))[_0xe6c1('0x41')](handleError(_0x170b41,null));};exports['show']=function(_0x46a3c2,_0x4b1f6c){var _0x466342={'raw':!![],'where':{'id':_0x46a3c2[_0xe6c1('0x42')]['id']}},_0x48938a={};_0x48938a['model']=_['keys'](db[_0xe6c1('0x2a')][_0xe6c1('0x43')]);_0x48938a['query']=_['keys'](_0x46a3c2[_0xe6c1('0x2f')]);_0x48938a[_0xe6c1('0x31')]=_['intersection'](_0x48938a['model'],_0x48938a[_0xe6c1('0x2f')]);_0x466342[_0xe6c1('0x33')]=_['intersection'](_0x48938a[_0xe6c1('0x2d')],qs[_0xe6c1('0x34')](_0x46a3c2[_0xe6c1('0x2f')][_0xe6c1('0x34')]));_0x466342[_0xe6c1('0x33')]=_0x466342[_0xe6c1('0x33')]['length']?_0x466342['attributes']:_0x48938a['model'];if(_0x46a3c2[_0xe6c1('0x2f')][_0xe6c1('0x3d')]){_0x466342[_0xe6c1('0x3e')]=[{'all':!![]}];}_0x466342=_['merge']({},_0x466342,_0x46a3c2[_0xe6c1('0x44')]);return db[_0xe6c1('0x2a')]['find'](_0x466342)[_0xe6c1('0x24')](handleEntityNotFound(_0x4b1f6c,null))[_0xe6c1('0x24')](respondWithResult(_0x4b1f6c,null))['catch'](handleError(_0x4b1f6c,null));};exports[_0xe6c1('0x45')]=function(_0x16b0de,_0x472546){return db[_0xe6c1('0x2a')][_0xe6c1('0x45')](_0x16b0de['body'],{})[_0xe6c1('0x24')](respondWithResult(_0x472546,0xc9))[_0xe6c1('0x41')](handleError(_0x472546,null));};exports['update']=function(_0x1b761a,_0x5c14de){if(_0x1b761a[_0xe6c1('0x46')]['id']){delete _0x1b761a[_0xe6c1('0x46')]['id'];}return db[_0xe6c1('0x2a')][_0xe6c1('0x47')]({'where':{'id':_0x1b761a[_0xe6c1('0x42')]['id']}})[_0xe6c1('0x24')](handleEntityNotFound(_0x5c14de,null))[_0xe6c1('0x24')](saveUpdates(_0x1b761a['body'],null))[_0xe6c1('0x24')](respondWithResult(_0x5c14de,null))[_0xe6c1('0x41')](handleError(_0x5c14de,null));};exports['destroy']=function(_0x15b4aa,_0x281c19){return db[_0xe6c1('0x2a')][_0xe6c1('0x47')]({'where':{'id':_0x15b4aa[_0xe6c1('0x42')]['id']}})['then'](handleEntityNotFound(_0x281c19,null))[_0xe6c1('0x24')](removeEntity(_0x281c19,null))['catch'](handleError(_0x281c19,null));};exports['describe']=function(_0x293031,_0x42d2fe){return db[_0xe6c1('0x2a')]['describe']()[_0xe6c1('0x24')](respondWithResult(_0x42d2fe,null))[_0xe6c1('0x41')](handleError(_0x42d2fe,null));}; \ No newline at end of file +var _0x00fd=['pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x00fd,0x188));var _0xd00f=function(_0x5146a6,_0x2e14c5){_0x5146a6=_0x5146a6-0x0;var _0x49523e=_0x00fd[_0x5146a6];return _0x49523e;};'use strict';var emlformat=require(_0xd00f('0x0'));var rimraf=require(_0xd00f('0x1'));var zipdir=require(_0xd00f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd00f('0x3'));var BPromise=require(_0xd00f('0x4'));var Mustache=require(_0xd00f('0x5'));var util=require(_0xd00f('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd00f('0x7'));var ejs=require(_0xd00f('0x8'));var fs=require('fs');var fs_extra=require(_0xd00f('0x9'));var _=require('lodash');var squel=require(_0xd00f('0xa'));var crypto=require(_0xd00f('0xb'));var jsforce=require(_0xd00f('0xc'));var deskjs=require(_0xd00f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd00f('0xe'));var Papa=require(_0xd00f('0xf'));var Redis=require('ioredis');var authService=require(_0xd00f('0x10'));var qs=require(_0xd00f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd00f('0x12'));var logger=require('../../config/logger')(_0xd00f('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd00f('0x14'));var db=require(_0xd00f('0x15'))['db'];function respondWithStatusCode(_0x582859,_0x2c9551){_0x2c9551=_0x2c9551||0xcc;return function(_0x1f216c){if(_0x1f216c){return _0x582859[_0xd00f('0x16')](_0x2c9551);}return _0x582859['status'](_0x2c9551)[_0xd00f('0x17')]();};}function respondWithResult(_0x379327,_0xd9d092){_0xd9d092=_0xd9d092||0xc8;return function(_0x21ad79){if(_0x21ad79){return _0x379327[_0xd00f('0x18')](_0xd9d092)[_0xd00f('0x19')](_0x21ad79);}};}function respondWithFilteredResult(_0x4503c0,_0x289084){return function(_0x12905d){if(_0x12905d){var _0x398729=typeof _0x289084['offset']==='undefined'&&typeof _0x289084['limit']===_0xd00f('0x1a');var _0xdcac47=_0x12905d[_0xd00f('0x1b')];var _0x450b38=_0x398729?0x0:_0x289084[_0xd00f('0x1c')];var _0x18d964=_0x398729?_0x12905d['count']:_0x289084[_0xd00f('0x1c')]+_0x289084[_0xd00f('0x1d')];var _0x5b003d;if(_0x18d964>=_0xdcac47){_0x18d964=_0xdcac47;_0x5b003d=0xc8;}else{_0x5b003d=0xce;}_0x4503c0[_0xd00f('0x18')](_0x5b003d);return _0x4503c0[_0xd00f('0x1e')](_0xd00f('0x1f'),_0x450b38+'-'+_0x18d964+'/'+_0xdcac47)[_0xd00f('0x19')](_0x12905d);}return null;};}function patchUpdates(_0x28d159){return function(_0x3dc79b){try{jsonpatch[_0xd00f('0x20')](_0x3dc79b,_0x28d159,!![]);}catch(_0x2d6fda){return BPromise[_0xd00f('0x21')](_0x2d6fda);}return _0x3dc79b[_0xd00f('0x22')]();};}function saveUpdates(_0x303a0f,_0x16769e){return function(_0x1f1c15){if(_0x1f1c15){return _0x1f1c15[_0xd00f('0x23')](_0x303a0f)['then'](function(_0x1a61d5){return _0x1a61d5;});}return null;};}function removeEntity(_0xb96afc,_0x2e977f){return function(_0x41e43b){if(_0x41e43b){return _0x41e43b[_0xd00f('0x24')]()[_0xd00f('0x25')](function(){_0xb96afc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x219d30,_0x43f8b5){return function(_0x278161){if(!_0x278161){_0x219d30['sendStatus'](0x194);}return _0x278161;};}function handleError(_0x51ed70,_0x379293){_0x379293=_0x379293||0x1f4;return function(_0x3e45dd){logger['error'](_0x3e45dd['stack']);if(_0x3e45dd[_0xd00f('0x26')]){delete _0x3e45dd[_0xd00f('0x26')];}_0x51ed70[_0xd00f('0x18')](_0x379293)[_0xd00f('0x27')](_0x3e45dd);};}exports[_0xd00f('0x28')]=function(_0x11e04d,_0xa7b0ce){var _0x47f1d6={},_0x768ade={},_0x4ab5b2={'count':0x0,'rows':[]};var _0x1626b9=_[_0xd00f('0x29')](db[_0xd00f('0x2a')][_0xd00f('0x2b')],function(_0x2b5451){return{'name':_0x2b5451[_0xd00f('0x2c')],'type':_0x2b5451[_0xd00f('0x2d')][_0xd00f('0x2e')]};});_0x768ade[_0xd00f('0x2f')]=_[_0xd00f('0x29')](_0x1626b9,_0xd00f('0x26'));_0x768ade['query']=_[_0xd00f('0x30')](_0x11e04d[_0xd00f('0x31')]);_0x768ade['filters']=_['intersection'](_0x768ade[_0xd00f('0x2f')],_0x768ade[_0xd00f('0x31')]);_0x47f1d6[_0xd00f('0x32')]=_[_0xd00f('0x33')](_0x768ade['model'],qs[_0xd00f('0x34')](_0x11e04d['query'][_0xd00f('0x34')]));_0x47f1d6[_0xd00f('0x32')]=_0x47f1d6[_0xd00f('0x32')]['length']?_0x47f1d6['attributes']:_0x768ade['model'];if(!_0x11e04d[_0xd00f('0x31')][_0xd00f('0x35')](_0xd00f('0x36'))){_0x47f1d6[_0xd00f('0x1d')]=qs[_0xd00f('0x1d')](_0x11e04d[_0xd00f('0x31')][_0xd00f('0x1d')]);_0x47f1d6[_0xd00f('0x1c')]=qs['offset'](_0x11e04d['query']['offset']);}_0x47f1d6[_0xd00f('0x37')]=qs[_0xd00f('0x38')](_0x11e04d[_0xd00f('0x31')]['sort']);_0x47f1d6['where']=qs[_0xd00f('0x39')](_[_0xd00f('0x3a')](_0x11e04d[_0xd00f('0x31')],_0x768ade[_0xd00f('0x39')]),_0x1626b9);if(_0x11e04d[_0xd00f('0x31')][_0xd00f('0x3b')]){_0x47f1d6[_0xd00f('0x3c')]=_[_0xd00f('0x3d')](_0x47f1d6[_0xd00f('0x3c')],{'$or':_[_0xd00f('0x29')](_0x1626b9,function(_0x52256d){if(_0x52256d[_0xd00f('0x2d')]!=='VIRTUAL'){var _0x25a4ee={};_0x25a4ee[_0x52256d[_0xd00f('0x26')]]={'$like':'%'+_0x11e04d[_0xd00f('0x31')][_0xd00f('0x3b')]+'%'};return _0x25a4ee;}})});}_0x47f1d6=_[_0xd00f('0x3d')]({},_0x47f1d6,_0x11e04d[_0xd00f('0x3e')]);var _0x472144={'where':_0x47f1d6[_0xd00f('0x3c')]};return db['VoiceTransferReport'][_0xd00f('0x1b')](_0x472144)[_0xd00f('0x25')](function(_0xb77e35){_0x4ab5b2[_0xd00f('0x1b')]=_0xb77e35;if(_0x11e04d[_0xd00f('0x31')][_0xd00f('0x3f')]){_0x47f1d6[_0xd00f('0x40')]=[{'all':!![]}];}return db[_0xd00f('0x2a')][_0xd00f('0x41')](_0x47f1d6);})[_0xd00f('0x25')](function(_0x5138cf){_0x4ab5b2[_0xd00f('0x42')]=_0x5138cf;return _0x4ab5b2;})[_0xd00f('0x25')](respondWithFilteredResult(_0xa7b0ce,_0x47f1d6))[_0xd00f('0x43')](handleError(_0xa7b0ce,null));};exports[_0xd00f('0x44')]=function(_0x877984,_0x24b204){var _0xccb049={'raw':!![],'where':{'id':_0x877984[_0xd00f('0x45')]['id']}},_0xb3ca4b={};_0xb3ca4b['model']=_[_0xd00f('0x30')](db[_0xd00f('0x2a')][_0xd00f('0x2b')]);_0xb3ca4b[_0xd00f('0x31')]=_[_0xd00f('0x30')](_0x877984[_0xd00f('0x31')]);_0xb3ca4b['filters']=_[_0xd00f('0x33')](_0xb3ca4b[_0xd00f('0x2f')],_0xb3ca4b['query']);_0xccb049[_0xd00f('0x32')]=_[_0xd00f('0x33')](_0xb3ca4b[_0xd00f('0x2f')],qs[_0xd00f('0x34')](_0x877984[_0xd00f('0x31')]['fields']));_0xccb049['attributes']=_0xccb049[_0xd00f('0x32')][_0xd00f('0x46')]?_0xccb049[_0xd00f('0x32')]:_0xb3ca4b['model'];if(_0x877984['query'][_0xd00f('0x3f')]){_0xccb049[_0xd00f('0x40')]=[{'all':!![]}];}_0xccb049=_['merge']({},_0xccb049,_0x877984['options']);return db[_0xd00f('0x2a')][_0xd00f('0x47')](_0xccb049)[_0xd00f('0x25')](handleEntityNotFound(_0x24b204,null))['then'](respondWithResult(_0x24b204,null))['catch'](handleError(_0x24b204,null));};exports[_0xd00f('0x48')]=function(_0x3161d,_0x385576){return db[_0xd00f('0x2a')][_0xd00f('0x48')](_0x3161d['body'],{})[_0xd00f('0x25')](respondWithResult(_0x385576,0xc9))['catch'](handleError(_0x385576,null));};exports['update']=function(_0x36c426,_0x863b83){if(_0x36c426[_0xd00f('0x49')]['id']){delete _0x36c426['body']['id'];}return db[_0xd00f('0x2a')][_0xd00f('0x47')]({'where':{'id':_0x36c426['params']['id']}})['then'](handleEntityNotFound(_0x863b83,null))[_0xd00f('0x25')](saveUpdates(_0x36c426[_0xd00f('0x49')],null))[_0xd00f('0x25')](respondWithResult(_0x863b83,null))[_0xd00f('0x43')](handleError(_0x863b83,null));};exports[_0xd00f('0x24')]=function(_0x59f7d7,_0x525920){return db[_0xd00f('0x2a')][_0xd00f('0x47')]({'where':{'id':_0x59f7d7[_0xd00f('0x45')]['id']}})[_0xd00f('0x25')](handleEntityNotFound(_0x525920,null))['then'](removeEntity(_0x525920,null))[_0xd00f('0x43')](handleError(_0x525920,null));};exports[_0xd00f('0x4a')]=function(_0x364c67,_0x33ad5e){return db[_0xd00f('0x2a')][_0xd00f('0x4a')]()['then'](respondWithResult(_0x33ad5e,null))[_0xd00f('0x43')](handleError(_0x33ad5e,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 7badf39..a38350d 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 _0xffd9=['define','report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./voiceTransferReport.attributes','exports'];(function(_0x3ffc23,_0x49befe){var _0x220254=function(_0xe8264e){while(--_0xe8264e){_0x3ffc23['push'](_0x3ffc23['shift']());}};_0x220254(++_0x49befe);}(_0xffd9,0x146));var _0x9ffd=function(_0x120582,_0x276e78){_0x120582=_0x120582-0x0;var _0x3169b4=_0xffd9[_0x120582];return _0x3169b4;};'use strict';var _=require(_0x9ffd('0x0'));var util=require(_0x9ffd('0x1'));var logger=require(_0x9ffd('0x2'))(_0x9ffd('0x3'));var moment=require(_0x9ffd('0x4'));var BPromise=require(_0x9ffd('0x5'));var rp=require(_0x9ffd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ffd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9ffd('0x8'));module[_0x9ffd('0x9')]=function(_0x526e1c,_0x32de7a){return _0x526e1c[_0x9ffd('0xa')]('VoiceTransferReport',attributes,{'tableName':_0x9ffd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd0f=['path','rimraf','../../config/environment','./voiceTransferReport.attributes','define','report_call_transfer','lodash','util','moment','request-promise'];(function(_0x4ebb9f,_0x3f5630){var _0xf77862=function(_0x4d7587){while(--_0x4d7587){_0x4ebb9f['push'](_0x4ebb9f['shift']());}};_0xf77862(++_0x3f5630);}(_0xfd0f,0x1c8));var _0xffd0=function(_0x44fd63,_0x692201){_0x44fd63=_0x44fd63-0x0;var _0x19b154=_0xfd0f[_0x44fd63];return _0x19b154;};'use strict';var _=require(_0xffd0('0x0'));var util=require(_0xffd0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xffd0('0x2'));var BPromise=require('bluebird');var rp=require(_0xffd0('0x3'));var fs=require('fs');var path=require(_0xffd0('0x4'));var rimraf=require(_0xffd0('0x5'));var config=require(_0xffd0('0x6'));var attributes=require(_0xffd0('0x7'));module['exports']=function(_0x182b4f,_0xfbe53){return _0x182b4f[_0xffd0('0x8')]('VoiceTransferReport',attributes,{'tableName':_0xffd0('0x9'),'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 9a5cbad..cd5ec9b 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 _0x8d90=['then','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateVoiceTransferReport','create','options','stringify','util','randomstring','../../config/utils','rpc','jayson/promise','client','request'];(function(_0x3c2182,_0x7cb572){var _0x4eb804=function(_0x4138bc){while(--_0x4138bc){_0x3c2182['push'](_0x3c2182['shift']());}};_0x4eb804(++_0x7cb572);}(_0x8d90,0x134));var _0x08d9=function(_0x10e97a,_0x1c563d){_0x10e97a=_0x10e97a-0x0;var _0x20da73=_0x8d90[_0x10e97a];return _0x20da73;};'use strict';var _=require('lodash');var util=require(_0x08d9('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x08d9('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x08d9('0x2'));var logger=require('../../config/logger')(_0x08d9('0x3'));var config=require('../../config/environment');var jayson=require(_0x08d9('0x4'));var client=jayson[_0x08d9('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x585229,_0x28f800,_0xbbd229){return new BPromise(function(_0x9e3d33,_0x51a4b0){return client[_0x08d9('0x6')](_0x585229,_0xbbd229)[_0x08d9('0x7')](function(_0x384b79){logger[_0x08d9('0x8')](_0x08d9('0x9'),_0x28f800,'request\x20sent');logger[_0x08d9('0xa')](_0x08d9('0xb'),_0x28f800,_0x08d9('0xc'),JSON['stringify'](_0x384b79));if(_0x384b79[_0x08d9('0xd')]){if(_0x384b79[_0x08d9('0xd')]['code']===0x1f4){logger[_0x08d9('0xd')](_0x08d9('0x9'),_0x28f800,_0x384b79['error']['message']);return _0x51a4b0(_0x384b79[_0x08d9('0xd')][_0x08d9('0xe')]);}logger['error'](_0x08d9('0x9'),_0x28f800,_0x384b79['error'][_0x08d9('0xe')]);return _0x9e3d33(_0x384b79['error'][_0x08d9('0xe')]);}else{logger['info'](_0x08d9('0x9'),_0x28f800,'request\x20sent');_0x9e3d33(_0x384b79[_0x08d9('0xf')][_0x08d9('0xe')]);}})[_0x08d9('0x10')](function(_0x5474c9){logger['error'](_0x08d9('0x9'),_0x28f800,_0x5474c9);_0x51a4b0(_0x5474c9);});});}exports[_0x08d9('0x11')]=function(_0x544bd6){var _0x42c7f2=this;return new Promise(function(_0x39ef5e,_0x2ed638){return db['VoiceTransferReport'][_0x08d9('0x12')](_0x544bd6['body'],{'raw':_0x544bd6[_0x08d9('0x13')]?_0x544bd6[_0x08d9('0x13')]['raw']===undefined?!![]:![]:!![]})[_0x08d9('0x7')](function(_0x26912d){logger[_0x08d9('0x8')](_0x08d9('0x11'),_0x544bd6);logger['debug'](_0x08d9('0x11'),_0x544bd6,JSON[_0x08d9('0x14')](_0x26912d));_0x39ef5e(_0x26912d);})[_0x08d9('0x10')](function(_0x1e223a){logger['error'](_0x08d9('0x11'),_0x1e223a[_0x08d9('0xe')],_0x544bd6);_0x2ed638(_0x42c7f2[_0x08d9('0xd')](0x1f4,_0x1e223a[_0x08d9('0xe')]));});});}; \ No newline at end of file +var _0x1f7b=['rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x69fb6a,_0x46ec8d){var _0x2faee2=function(_0x56b079){while(--_0x56b079){_0x69fb6a['push'](_0x69fb6a['shift']());}};_0x2faee2(++_0x46ec8d);}(_0x1f7b,0xc4));var _0xb1f7=function(_0x1dfa63,_0x362bd4){_0x1dfa63=_0x1dfa63-0x0;var _0x26f2a9=_0x1f7b[_0x1dfa63];return _0x26f2a9;};'use strict';var _=require('lodash');var util=require(_0xb1f7('0x0'));var moment=require(_0xb1f7('0x1'));var BPromise=require(_0xb1f7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb1f7('0x3'));var db=require(_0xb1f7('0x4'))['db'];var utils=require(_0xb1f7('0x5'));var logger=require(_0xb1f7('0x6'))(_0xb1f7('0x7'));var config=require(_0xb1f7('0x8'));var jayson=require(_0xb1f7('0x9'));var client=jayson[_0xb1f7('0xa')][_0xb1f7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d6276,_0xc1a3e6,_0x3a37c6){return new BPromise(function(_0x447699,_0x119af6){return client[_0xb1f7('0xc')](_0x2d6276,_0x3a37c6)[_0xb1f7('0xd')](function(_0x4245e1){logger['info'](_0xb1f7('0xe'),_0xc1a3e6,_0xb1f7('0xf'));logger[_0xb1f7('0x10')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0xc1a3e6,_0xb1f7('0xf'),JSON['stringify'](_0x4245e1));if(_0x4245e1['error']){if(_0x4245e1[_0xb1f7('0x11')]['code']===0x1f4){logger[_0xb1f7('0x11')](_0xb1f7('0xe'),_0xc1a3e6,_0x4245e1[_0xb1f7('0x11')][_0xb1f7('0x12')]);return _0x119af6(_0x4245e1[_0xb1f7('0x11')][_0xb1f7('0x12')]);}logger['error'](_0xb1f7('0xe'),_0xc1a3e6,_0x4245e1[_0xb1f7('0x11')][_0xb1f7('0x12')]);return _0x447699(_0x4245e1['error'][_0xb1f7('0x12')]);}else{logger[_0xb1f7('0x13')](_0xb1f7('0xe'),_0xc1a3e6,'request\x20sent');_0x447699(_0x4245e1[_0xb1f7('0x14')][_0xb1f7('0x12')]);}})[_0xb1f7('0x15')](function(_0x3f1f6e){logger[_0xb1f7('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0xc1a3e6,_0x3f1f6e);_0x119af6(_0x3f1f6e);});});}exports[_0xb1f7('0x16')]=function(_0x3f9c05){var _0x4bd4ff=this;return new Promise(function(_0x33b37f,_0x5bdd1f){return db[_0xb1f7('0x17')][_0xb1f7('0x18')](_0x3f9c05[_0xb1f7('0x19')],{'raw':_0x3f9c05[_0xb1f7('0x1a')]?_0x3f9c05[_0xb1f7('0x1a')][_0xb1f7('0x1b')]===undefined?!![]:![]:!![]})[_0xb1f7('0xd')](function(_0x178e23){logger[_0xb1f7('0x13')]('CreateVoiceTransferReport',_0x3f9c05);logger[_0xb1f7('0x10')](_0xb1f7('0x16'),_0x3f9c05,JSON[_0xb1f7('0x1c')](_0x178e23));_0x33b37f(_0x178e23);})[_0xb1f7('0x15')](function(_0x1ea1ef){logger[_0xb1f7('0x11')]('CreateVoiceTransferReport',_0x1ea1ef[_0xb1f7('0x12')],_0x3f9c05);_0x5bdd1f(_0x4bd4ff['error'](0x1f4,_0x1ea1ef[_0xb1f7('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index b429214..f5de46b 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 _0xe14d=['hangup','answer','/hold','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','originate','post','/hangup','isWebrtcLicence'];(function(_0x388679,_0x502313){var _0x3392fa=function(_0x39dfda){while(--_0x39dfda){_0x388679['push'](_0x388679['shift']());}};_0x3392fa(++_0x502313);}(_0xe14d,0x1ee));var _0xde14=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xe14d[_0x173d7e];return _0x2220d6;};'use strict';var express=require(_0xde14('0x0'));var router=express[_0xde14('0x1')]();var auth=require(_0xde14('0x2'));var controller=require(_0xde14('0x3'));router['post'](_0xde14('0x4'),auth[_0xde14('0x5')](),auth['isWebrtcLicence'](),controller[_0xde14('0x6')]);router[_0xde14('0x7')](_0xde14('0x8'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xa')]);router['post']('/answer',auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xb')]);router[_0xde14('0x7')](_0xde14('0xc'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xd')]);router['post'](_0xde14('0xe'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xf')]);router[_0xde14('0x7')](_0xde14('0x10'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x11')]);router[_0xde14('0x7')](_0xde14('0x12'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x13')]);module[_0xde14('0x14')]=router; \ No newline at end of file +var _0xa9e0=['/transfer','transfer','exports','express','Router','../../components/auth/service','/originate','isWebrtcLicence','originate','post','/hangup','isAuthenticated','hangup','/answer','answer','hold','/unhold','calls'];(function(_0x1baba1,_0x45a1f5){var _0x5d815c=function(_0x475818){while(--_0x475818){_0x1baba1['push'](_0x1baba1['shift']());}};_0x5d815c(++_0x45a1f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./webbar.controller');router['post'](_0x0a9e('0x3'),auth['isAuthenticated'](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0x5')]);router[_0x0a9e('0x6')](_0x0a9e('0x7'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x6')](_0x0a9e('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x0a9e('0xb')]);router['post']('/hold',auth[_0x0a9e('0x8')](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x6')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller['unhold']);router['post']('/calls',auth[_0x0a9e('0x8')](),auth[_0x0a9e('0x4')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x6')](_0x0a9e('0xf'),auth[_0x0a9e('0x8')](),auth['isWebrtcLicence'](),controller[_0x0a9e('0x10')]);module[_0x0a9e('0x11')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 3990293..a16f4c0 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 _0xa75b=['handleError:','error','stack','name','status','send','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter','rows','sessionId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','length','json','userId','callerId','callbackUrl','entityFound:','format','webbar:originate','originate\x20executed!','hangup','user:%s','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold','hold\x20fired:','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','UserId','conference','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','validate','string','number','userId\x20is\x20required','sessionId\x20is\x20required','info','stringify','emit','log'];(function(_0x165887,_0xfdfe8f){var _0x2a0108=function(_0x4e253f){while(--_0x4e253f){_0x165887['push'](_0x165887['shift']());}};_0x2a0108(++_0xfdfe8f);}(_0xa75b,0x170));var _0xba75=function(_0x42657d,_0x465f4a){_0x42657d=_0x42657d-0x0;var _0xcdf566=_0xa75b[_0x42657d];return _0xcdf566;};'use strict';var path=require(_0xba75('0x0'));var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require(_0xba75('0x1'));var util=require(_0xba75('0x2'));var BPromise=require(_0xba75('0x3'));var jayson=require(_0xba75('0x4'));var amiClient=jayson[_0xba75('0x5')][_0xba75('0x6')]({'port':0x232a});var logger=require(_0xba75('0x7'))(_0xba75('0x8'));var Redis=require(_0xba75('0x9'));config[_0xba75('0xa')]=_[_0xba75('0xb')](config[_0xba75('0xa')],{'host':_0xba75('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0xba75('0xd'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xba75('0xe'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0xba75('0xe')},'callbackUrl':{'type':_0xba75('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0xba75('0xf'),'required':[!![],_0xba75('0x10')]},'sessionId':{'type':_0xba75('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xba75('0xf'),'required':[!![],_0xba75('0x10')]},'sessionId':{'type':_0xba75('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xba75('0xf'),'required':[!![],_0xba75('0x10')]},'sessionId':{'type':_0xba75('0xe'),'required':[!![],_0xba75('0x11')]},'transferNumber':{'type':'string','required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xba75('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xba75('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xba75('0xf'),'required':[!![],_0xba75('0x10')]},'sessionId':{'type':_0xba75('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xba75('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0xba75('0xf'),'required':[!![],_0xba75('0x10')]}});function emit(_0x4028f9,_0x41c9e5,_0x51112b){logger[_0xba75('0x12')](_0x4028f9,_0x41c9e5,JSON[_0xba75('0x13')](_0x51112b));io['to'](_0x4028f9)[_0xba75('0x14')](_0x41c9e5,_0x51112b);}function handleError(_0x47be93){return function(_0x2822af){console[_0xba75('0x15')](_0xba75('0x16'),_0x2822af,_0x2822af instanceof RangeError);logger[_0xba75('0x17')](_0x2822af[_0xba75('0x18')]);if(_0x2822af instanceof RangeError){if(_0x2822af[_0xba75('0x19')]){delete _0x2822af['name'];}_0x47be93[_0xba75('0x1a')](0x194)[_0xba75('0x1b')](_0x2822af);}else{if(_0x2822af['name']){delete _0x2822af['name'];}_0x47be93[_0xba75('0x1a')](0x1f4)[_0xba75('0x1b')](_0x2822af);}};}function checkError(){return function(_0x496cfc){if(!_0x496cfc){throw new RangeError('NotFound');}return _0x496cfc;};}function respondWithRpcPromise(_0x30f482,_0x4e79a9){return new BPromise(function(_0x1b8a36,_0x2ece41){var _0x19b2d7=amiClient;return _0x19b2d7['request'](_0x30f482,_0x4e79a9)[_0xba75('0x1c')](function(_0x221d5e){if(_0x221d5e[_0xba75('0x17')]){if(_0x221d5e[_0xba75('0x17')][_0xba75('0x1d')]===0x1f4){return _0x2ece41(_0x221d5e[_0xba75('0x17')]['message']);}return _0x1b8a36(_0x221d5e[_0xba75('0x17')][_0xba75('0x1e')]);}else{_0x1b8a36(_0x221d5e[_0xba75('0x1f')]);}})[_0xba75('0x20')](function(_0x1caa6){_0x2ece41(_0x1caa6);});});}function getAgent(_0x44b1d4){return db[_0xba75('0x21')][_0xba75('0x22')]({'where':{'id':_0x44b1d4,'role':_0xba75('0x23')}})[_0xba75('0x1c')](checkError());}function getAgentCheckSession(_0x47ddff,_0x4c8d02){return new BPromise(function(_0x4e1987,_0x240522){var _0x4856be=respondWithRpcPromise(_0xba75('0x24'));var _0x58ea2d=getAgent(_0x47ddff);Promise[_0xba75('0x25')]([_0x4856be,_0x58ea2d])[_0xba75('0x1c')](function(_0x20ac78){var _0x4edc2e=_0x20ac78[0x0];var _0x3a1fd3=_0x20ac78[0x1];var _0x62cf49=_[_0xba75('0x26')](_0x4edc2e[_0xba75('0x27')],function(_0x5d9f78){return _0x5d9f78['UserId']==_0x3a1fd3['id']&&_0x5d9f78[_0xba75('0x28')]==_0x4c8d02;});if(_0x62cf49['length']==0x1){_0x4e1987(_0x3a1fd3);}else{_0x240522(new RangeError(_0xba75('0x29')+_0x4c8d02+_0xba75('0x2a')));}});});}exports[_0xba75('0x2b')]=function(_0x32166a,_0x4b4d69){logger[_0xba75('0x12')](_0xba75('0x2c'),_0x32166a['body']);var _0x33a732=originateValidation[_0xba75('0xd')](_0x32166a[_0xba75('0x2d')]);if(_0x33a732[_0xba75('0x2e')]>0x0){return _0x4b4d69['status'](0x190)[_0xba75('0x2f')](_0x33a732);}var _0x3a1610=_0x32166a['body'][_0xba75('0x30')];var _0x6ea4fc=_0x32166a[_0xba75('0x2d')]['callNumber'];var _0x29334a=_0x32166a[_0xba75('0x2d')][_0xba75('0x31')];var _0x381cb=_0x32166a[_0xba75('0x2d')][_0xba75('0x32')];return getAgent(_0x3a1610)[_0xba75('0x1c')](function(_0x4c9fb2){logger['info'](_0xba75('0x33'),_0x4c9fb2[_0xba75('0x19')]);emit(util[_0xba75('0x34')]('user:%s',_0x4c9fb2[_0xba75('0x19')]),_0xba75('0x35'),{'callNumber':_0x6ea4fc,'callerId':_0x29334a,'callbackUrl':_0x381cb});return _0x4b4d69['status'](0xc8)['json']({'error':![],'message':_0xba75('0x36')});})[_0xba75('0x20')](handleError(_0x4b4d69));};exports[_0xba75('0x37')]=function(_0x1243e8,_0x92882d){logger['info']('hangup\x20fired:',_0x1243e8[_0xba75('0x2d')]);var _0x22b335=hangupValidation[_0xba75('0xd')](_0x1243e8[_0xba75('0x2d')]);if(_0x22b335[_0xba75('0x2e')]>0x0){return _0x92882d[_0xba75('0x1a')](0x190)[_0xba75('0x2f')](_0x22b335);}var _0x5dad31=_0x1243e8[_0xba75('0x2d')][_0xba75('0x30')];var _0x5bec5f=_0x1243e8[_0xba75('0x2d')][_0xba75('0x28')];return getAgent(_0x5dad31)[_0xba75('0x1c')](function(_0x45d8cd){logger[_0xba75('0x12')](_0xba75('0x33'),_0x45d8cd[_0xba75('0x19')]);emit(util['format'](_0xba75('0x38'),_0x45d8cd['name']),_0xba75('0x39'),{'sessionId':_0x5bec5f});return _0x92882d['status'](0xc8)[_0xba75('0x2f')]({'error':![],'message':_0xba75('0x3a')});})[_0xba75('0x20')](handleError(_0x92882d));};exports[_0xba75('0x3b')]=function(_0x24d80b,_0x30338c){logger[_0xba75('0x12')](_0xba75('0x3c'),_0x24d80b[_0xba75('0x2d')]);var _0x5c7c7f=answerValidation[_0xba75('0xd')](_0x24d80b[_0xba75('0x2d')]);if(_0x5c7c7f['length']>0x0){return _0x30338c[_0xba75('0x1a')](0x190)[_0xba75('0x2f')](_0x5c7c7f);}var _0x1130ac=_0x24d80b['body']['userId'];var _0x5c6491=_0x24d80b['body'][_0xba75('0x28')];return getAgent(_0x1130ac)['then'](function(_0x46e9b9){logger[_0xba75('0x12')](_0xba75('0x33'),_0x46e9b9[_0xba75('0x19')]);emit(util[_0xba75('0x34')]('user:%s',_0x46e9b9['name']),_0xba75('0x3d'),{'sessionId':_0x5c6491});return _0x30338c['status'](0xc8)[_0xba75('0x2f')]({'error':![],'message':'answer\x20executed!'});})[_0xba75('0x20')](handleError(_0x30338c));};exports[_0xba75('0x3e')]=function(_0x22e5b4,_0x3983dc){logger['info'](_0xba75('0x3f'),_0x22e5b4[_0xba75('0x2d')]);var _0x254dc7=holdValidation[_0xba75('0xd')](_0x22e5b4[_0xba75('0x2d')]);if(_0x254dc7[_0xba75('0x2e')]>0x0){return _0x3983dc[_0xba75('0x1a')](0x190)[_0xba75('0x2f')](_0x254dc7);}var _0x51cd22=_0x22e5b4[_0xba75('0x2d')][_0xba75('0x30')];var _0x7c297b=_0x22e5b4[_0xba75('0x2d')][_0xba75('0x28')];return getAgent(_0x51cd22)['then'](function(_0x2a1f84){logger[_0xba75('0x12')](_0xba75('0x33'),_0x2a1f84[_0xba75('0x19')]);emit(util[_0xba75('0x34')](_0xba75('0x38'),_0x2a1f84[_0xba75('0x19')]),'webbar:hold',{'sessionId':_0x7c297b});return _0x3983dc[_0xba75('0x1a')](0xc8)[_0xba75('0x2f')]({'error':![],'message':_0xba75('0x40')});})['catch'](handleError(_0x3983dc));};exports[_0xba75('0x41')]=function(_0x29b4fc,_0x559f6f){logger['info'](_0xba75('0x42'),_0x29b4fc['body']);var _0x49a4df=unholdValidation[_0xba75('0xd')](_0x29b4fc['body']);if(_0x49a4df[_0xba75('0x2e')]>0x0){return _0x559f6f[_0xba75('0x1a')](0x190)[_0xba75('0x2f')](_0x49a4df);}var _0x70474=_0x29b4fc[_0xba75('0x2d')]['userId'];var _0xfa79e6=_0x29b4fc[_0xba75('0x2d')]['sessionId'];return getAgent(_0x70474)[_0xba75('0x1c')](function(_0x19a08f){logger[_0xba75('0x12')](_0xba75('0x33'),_0x19a08f[_0xba75('0x19')]);emit(util['format'](_0xba75('0x38'),_0x19a08f[_0xba75('0x19')]),'webbar:unhold',{'sessionId':_0xfa79e6});return _0x559f6f[_0xba75('0x1a')](0xc8)[_0xba75('0x2f')]({'error':![],'message':_0xba75('0x43')});})[_0xba75('0x20')](handleError(_0x559f6f));};exports[_0xba75('0x44')]=function(_0x3b6490,_0x49fb61){logger[_0xba75('0x12')](_0xba75('0x45'),_0x49fb61[_0xba75('0x2d')]);var _0x429e26=callsValidation[_0xba75('0xd')](_0x3b6490[_0xba75('0x2d')]);if(_0x429e26['length']>0x0){return _0x49fb61['status'](0x190)['json'](_0x429e26);}var _0x4cda26=_0x3b6490[_0xba75('0x2d')][_0xba75('0x30')];var _0x2991e5=respondWithRpcPromise(_0xba75('0x24'));var _0x3716c6=getAgent(_0x4cda26);return Promise[_0xba75('0x25')]([_0x2991e5,_0x3716c6])[_0xba75('0x1c')](function(_0x5cfedd){var _0x1c4707=_0x5cfedd[0x0];var _0x1e7500=_0x5cfedd[0x1];var _0x287f30=_[_0xba75('0x26')](_0x1c4707['rows'],function(_0xb7b3a4){return _0xb7b3a4[_0xba75('0x46')]==_0x1e7500['id'];});return _0x49fb61['status'](0xc8)[_0xba75('0x2f')]({'count':_0x287f30['length'],'rows':_0x287f30});})[_0xba75('0x20')](handleError(_0x49fb61));};exports[_0xba75('0x47')]=function(_0x57eceb,_0x276757){logger[_0xba75('0x12')]('conference\x20fired:',_0x57eceb['body']);var _0x3d9420=conferenceValidation['validate'](_0x57eceb[_0xba75('0x2d')]);if(_0x3d9420['length']>0x0){return _0x276757[_0xba75('0x1a')](0x190)[_0xba75('0x2f')](_0x3d9420);}var _0x46c43c=_0x57eceb[_0xba75('0x2d')][_0xba75('0x30')];return getAgent(_0x46c43c)['then'](function(_0xf02890){logger[_0xba75('0x12')]('entityFound:',_0xf02890[_0xba75('0x19')]);emit(util[_0xba75('0x34')](_0xba75('0x38'),_0xf02890[_0xba75('0x19')]),_0xba75('0x48'));return _0x276757[_0xba75('0x1a')](0xc8)[_0xba75('0x2f')]({'error':![],'message':_0xba75('0x49')});})[_0xba75('0x20')](handleError(_0x276757));};exports[_0xba75('0x4a')]=function(_0xa0a92,_0x9da35c){logger['info']('transfer\x20fired:',_0xa0a92[_0xba75('0x2d')]);var _0x31e3b6=transferValidation[_0xba75('0xd')](_0xa0a92[_0xba75('0x2d')]);if(_0x31e3b6[_0xba75('0x2e')]>0x0){return _0x9da35c[_0xba75('0x1a')](0x190)[_0xba75('0x2f')](_0x31e3b6);}var _0x115798=_0xa0a92[_0xba75('0x2d')][_0xba75('0x30')];var _0x2b686e=_0xa0a92['body'][_0xba75('0x28')];var _0x5c1e1d=_0xa0a92[_0xba75('0x2d')][_0xba75('0x4b')];return getAgent(_0x115798)[_0xba75('0x1c')](function(_0x43b73b){logger[_0xba75('0x12')](_0xba75('0x33'),_0x43b73b['name']);emit(util[_0xba75('0x34')]('user:%s',_0x43b73b[_0xba75('0x19')]),_0xba75('0x4c'),{'sessionId':_0x2b686e,'transferNumber':_0x5c1e1d});return _0x9da35c['status'](0xc8)['json']({'error':![],'message':_0xba75('0x4d')});})[_0xba75('0x20')](handleError(_0x9da35c));}; \ No newline at end of file +var _0x593e=['number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','handleError:','error','name','status','send','NotFound','request','code','message','catch','findOne','agent','then','all','filter','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','body','json','userId','callerId','callbackUrl','entityFound:','format','user:%s','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','webbar:hold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','rows','conference\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','callNumber\x20is\x20required'];(function(_0x39f761,_0x552ff1){var _0x5096f0=function(_0x7ab8d3){while(--_0x7ab8d3){_0x39f761['push'](_0x39f761['shift']());}};_0x5096f0(++_0x552ff1);}(_0x593e,0xcb));var _0xe593=function(_0x26e461,_0x198549){_0x26e461=_0x26e461-0x0;var _0x237a76=_0x593e[_0x26e461];return _0x237a76;};'use strict';var path=require(_0xe593('0x0'));var fs=require('fs');var _=require(_0xe593('0x1'));var db=require(_0xe593('0x2'))['db'];var config=require(_0xe593('0x3'));var util=require(_0xe593('0x4'));var BPromise=require(_0xe593('0x5'));var jayson=require(_0xe593('0x6'));var amiClient=jayson[_0xe593('0x7')]['http']({'port':0x232a});var logger=require(_0xe593('0x8'))(_0xe593('0x9'));var Redis=require(_0xe593('0xa'));config[_0xe593('0xb')]=_[_0xe593('0xc')](config[_0xe593('0xb')],{'host':_0xe593('0xd'),'port':0x18eb});var io=require(_0xe593('0xe'))(new Redis(config[_0xe593('0xb')]));var Schema=require(_0xe593('0xf'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe593('0x10')]},'callNumber':{'type':_0xe593('0x11'),'required':[!![],_0xe593('0x12')]},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xe593('0x13'),'required':[!![],_0xe593('0x10')]},'sessionId':{'type':_0xe593('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe593('0x10')]},'sessionId':{'type':_0xe593('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xe593('0x13'),'required':[!![],_0xe593('0x10')]},'sessionId':{'type':_0xe593('0x11'),'required':[!![],_0xe593('0x14')]},'transferNumber':{'type':_0xe593('0x11'),'required':[!![],_0xe593('0x15')]}});var holdValidation=new Schema({'userId':{'type':_0xe593('0x13'),'required':[!![],_0xe593('0x10')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xe593('0x13'),'required':[!![],_0xe593('0x10')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xe593('0x13'),'required':[!![],_0xe593('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xe593('0x10')]}});function emit(_0x40416c,_0x1c6de3,_0x2d525c){logger[_0xe593('0x16')](_0x40416c,_0x1c6de3,JSON[_0xe593('0x17')](_0x2d525c));io['to'](_0x40416c)['emit'](_0x1c6de3,_0x2d525c);}function handleError(_0xfbc79f){return function(_0x470d07){console['log'](_0xe593('0x18'),_0x470d07,_0x470d07 instanceof RangeError);logger[_0xe593('0x19')](_0x470d07['stack']);if(_0x470d07 instanceof RangeError){if(_0x470d07[_0xe593('0x1a')]){delete _0x470d07[_0xe593('0x1a')];}_0xfbc79f[_0xe593('0x1b')](0x194)[_0xe593('0x1c')](_0x470d07);}else{if(_0x470d07[_0xe593('0x1a')]){delete _0x470d07[_0xe593('0x1a')];}_0xfbc79f[_0xe593('0x1b')](0x1f4)['send'](_0x470d07);}};}function checkError(){return function(_0x4af4c8){if(!_0x4af4c8){throw new RangeError(_0xe593('0x1d'));}return _0x4af4c8;};}function respondWithRpcPromise(_0x5d4895,_0x56c23f){return new BPromise(function(_0x1bb8e8,_0x3c65b5){var _0x57379d=amiClient;return _0x57379d[_0xe593('0x1e')](_0x5d4895,_0x56c23f)['then'](function(_0x1672bf){if(_0x1672bf[_0xe593('0x19')]){if(_0x1672bf[_0xe593('0x19')][_0xe593('0x1f')]===0x1f4){return _0x3c65b5(_0x1672bf[_0xe593('0x19')][_0xe593('0x20')]);}return _0x1bb8e8(_0x1672bf[_0xe593('0x19')][_0xe593('0x20')]);}else{_0x1bb8e8(_0x1672bf['result']);}})[_0xe593('0x21')](function(_0x347d7d){_0x3c65b5(_0x347d7d);});});}function getAgent(_0x480218){return db['User'][_0xe593('0x22')]({'where':{'id':_0x480218,'role':_0xe593('0x23')}})[_0xe593('0x24')](checkError());}function getAgentCheckSession(_0x43699d,_0x3b66bc){return new BPromise(function(_0x27a3d2,_0x5918cd){var _0x350e2b=respondWithRpcPromise('VoiceChannels');var _0x1dacf6=getAgent(_0x43699d);Promise[_0xe593('0x25')]([_0x350e2b,_0x1dacf6])['then'](function(_0x337ee0){var _0x561a01=_0x337ee0[0x0];var _0x44a68c=_0x337ee0[0x1];var _0x1c147b=_[_0xe593('0x26')](_0x561a01['rows'],function(_0x1ae8d9){return _0x1ae8d9[_0xe593('0x27')]==_0x44a68c['id']&&_0x1ae8d9[_0xe593('0x28')]==_0x3b66bc;});if(_0x1c147b[_0xe593('0x29')]==0x1){_0x27a3d2(_0x44a68c);}else{_0x5918cd(new RangeError(_0xe593('0x2a')+_0x3b66bc+_0xe593('0x2b')));}});});}exports[_0xe593('0x2c')]=function(_0x4efc93,_0x4098a9){logger[_0xe593('0x16')]('originate\x20fired:',_0x4efc93[_0xe593('0x2d')]);var _0x571995=originateValidation[_0xe593('0xf')](_0x4efc93[_0xe593('0x2d')]);if(_0x571995[_0xe593('0x29')]>0x0){return _0x4098a9[_0xe593('0x1b')](0x190)[_0xe593('0x2e')](_0x571995);}var _0x24a560=_0x4efc93[_0xe593('0x2d')][_0xe593('0x2f')];var _0x11f287=_0x4efc93[_0xe593('0x2d')]['callNumber'];var _0x27a563=_0x4efc93[_0xe593('0x2d')][_0xe593('0x30')];var _0x5a55c0=_0x4efc93['body'][_0xe593('0x31')];return getAgent(_0x24a560)['then'](function(_0x232bf1){logger[_0xe593('0x16')](_0xe593('0x32'),_0x232bf1[_0xe593('0x1a')]);emit(util[_0xe593('0x33')](_0xe593('0x34'),_0x232bf1[_0xe593('0x1a')]),'webbar:originate',{'callNumber':_0x11f287,'callerId':_0x27a563,'callbackUrl':_0x5a55c0});return _0x4098a9['status'](0xc8)[_0xe593('0x2e')]({'error':![],'message':'originate\x20executed!'});})[_0xe593('0x21')](handleError(_0x4098a9));};exports['hangup']=function(_0x206775,_0x5b9589){logger['info'](_0xe593('0x35'),_0x206775[_0xe593('0x2d')]);var _0x2aa9d8=hangupValidation['validate'](_0x206775['body']);if(_0x2aa9d8['length']>0x0){return _0x5b9589[_0xe593('0x1b')](0x190)['json'](_0x2aa9d8);}var _0x37ba0e=_0x206775[_0xe593('0x2d')][_0xe593('0x2f')];var _0x475207=_0x206775['body'][_0xe593('0x28')];return getAgent(_0x37ba0e)['then'](function(_0x36c08e){logger['info']('entityFound:',_0x36c08e['name']);emit(util[_0xe593('0x33')]('user:%s',_0x36c08e[_0xe593('0x1a')]),_0xe593('0x36'),{'sessionId':_0x475207});return _0x5b9589[_0xe593('0x1b')](0xc8)['json']({'error':![],'message':_0xe593('0x37')});})[_0xe593('0x21')](handleError(_0x5b9589));};exports[_0xe593('0x38')]=function(_0x4655dd,_0x26ff41){logger[_0xe593('0x16')](_0xe593('0x39'),_0x4655dd[_0xe593('0x2d')]);var _0x4b36e1=answerValidation[_0xe593('0xf')](_0x4655dd[_0xe593('0x2d')]);if(_0x4b36e1[_0xe593('0x29')]>0x0){return _0x26ff41[_0xe593('0x1b')](0x190)[_0xe593('0x2e')](_0x4b36e1);}var _0x4d3018=_0x4655dd['body'][_0xe593('0x2f')];var _0x380429=_0x4655dd[_0xe593('0x2d')]['sessionId'];return getAgent(_0x4d3018)[_0xe593('0x24')](function(_0x8a4c26){logger['info']('entityFound:',_0x8a4c26[_0xe593('0x1a')]);emit(util[_0xe593('0x33')](_0xe593('0x34'),_0x8a4c26['name']),_0xe593('0x3a'),{'sessionId':_0x380429});return _0x26ff41[_0xe593('0x1b')](0xc8)[_0xe593('0x2e')]({'error':![],'message':_0xe593('0x3b')});})['catch'](handleError(_0x26ff41));};exports['hold']=function(_0x4a7434,_0x4c8d14){logger[_0xe593('0x16')]('hold\x20fired:',_0x4a7434[_0xe593('0x2d')]);var _0xd016b3=holdValidation[_0xe593('0xf')](_0x4a7434[_0xe593('0x2d')]);if(_0xd016b3[_0xe593('0x29')]>0x0){return _0x4c8d14[_0xe593('0x1b')](0x190)[_0xe593('0x2e')](_0xd016b3);}var _0x297c3e=_0x4a7434['body'][_0xe593('0x2f')];var _0x1a5e0f=_0x4a7434[_0xe593('0x2d')]['sessionId'];return getAgent(_0x297c3e)[_0xe593('0x24')](function(_0x5dfdb1){logger[_0xe593('0x16')](_0xe593('0x32'),_0x5dfdb1[_0xe593('0x1a')]);emit(util['format']('user:%s',_0x5dfdb1[_0xe593('0x1a')]),_0xe593('0x3c'),{'sessionId':_0x1a5e0f});return _0x4c8d14['status'](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x4c8d14));};exports['unhold']=function(_0x383645,_0x1e48d8){logger[_0xe593('0x16')](_0xe593('0x3d'),_0x383645[_0xe593('0x2d')]);var _0x44201e=unholdValidation[_0xe593('0xf')](_0x383645[_0xe593('0x2d')]);if(_0x44201e[_0xe593('0x29')]>0x0){return _0x1e48d8[_0xe593('0x1b')](0x190)[_0xe593('0x2e')](_0x44201e);}var _0x1ea4ef=_0x383645[_0xe593('0x2d')][_0xe593('0x2f')];var _0xa25aa8=_0x383645[_0xe593('0x2d')]['sessionId'];return getAgent(_0x1ea4ef)[_0xe593('0x24')](function(_0x12e2ac){logger[_0xe593('0x16')](_0xe593('0x32'),_0x12e2ac[_0xe593('0x1a')]);emit(util[_0xe593('0x33')](_0xe593('0x34'),_0x12e2ac[_0xe593('0x1a')]),_0xe593('0x3e'),{'sessionId':_0xa25aa8});return _0x1e48d8[_0xe593('0x1b')](0xc8)[_0xe593('0x2e')]({'error':![],'message':_0xe593('0x3f')});})[_0xe593('0x21')](handleError(_0x1e48d8));};exports[_0xe593('0x40')]=function(_0x93ca5e,_0x5e8f9c){logger[_0xe593('0x16')](_0xe593('0x41'),_0x5e8f9c[_0xe593('0x2d')]);var _0x24d061=callsValidation[_0xe593('0xf')](_0x93ca5e['body']);if(_0x24d061['length']>0x0){return _0x5e8f9c[_0xe593('0x1b')](0x190)[_0xe593('0x2e')](_0x24d061);}var _0x318dd2=_0x93ca5e[_0xe593('0x2d')][_0xe593('0x2f')];var _0x1e49ed=respondWithRpcPromise(_0xe593('0x42'));var _0x518b6f=getAgent(_0x318dd2);return Promise['all']([_0x1e49ed,_0x518b6f])[_0xe593('0x24')](function(_0x23ee3b){var _0x4ff51d=_0x23ee3b[0x0];var _0x103403=_0x23ee3b[0x1];var _0xf8ed1d=_[_0xe593('0x26')](_0x4ff51d[_0xe593('0x43')],function(_0x3a3d7b){return _0x3a3d7b[_0xe593('0x27')]==_0x103403['id'];});return _0x5e8f9c[_0xe593('0x1b')](0xc8)[_0xe593('0x2e')]({'count':_0xf8ed1d[_0xe593('0x29')],'rows':_0xf8ed1d});})[_0xe593('0x21')](handleError(_0x5e8f9c));};exports['conference']=function(_0x36f38e,_0x13e368){logger[_0xe593('0x16')](_0xe593('0x44'),_0x36f38e[_0xe593('0x2d')]);var _0x202b18=conferenceValidation[_0xe593('0xf')](_0x36f38e['body']);if(_0x202b18[_0xe593('0x29')]>0x0){return _0x13e368[_0xe593('0x1b')](0x190)[_0xe593('0x2e')](_0x202b18);}var _0x14f8e1=_0x36f38e['body'][_0xe593('0x2f')];return getAgent(_0x14f8e1)[_0xe593('0x24')](function(_0x207c3d){logger[_0xe593('0x16')](_0xe593('0x32'),_0x207c3d['name']);emit(util[_0xe593('0x33')](_0xe593('0x34'),_0x207c3d[_0xe593('0x1a')]),_0xe593('0x45'));return _0x13e368[_0xe593('0x1b')](0xc8)[_0xe593('0x2e')]({'error':![],'message':_0xe593('0x46')});})[_0xe593('0x21')](handleError(_0x13e368));};exports['transfer']=function(_0x2145c0,_0x16f9fc){logger[_0xe593('0x16')](_0xe593('0x47'),_0x2145c0[_0xe593('0x2d')]);var _0x9f1813=transferValidation[_0xe593('0xf')](_0x2145c0[_0xe593('0x2d')]);if(_0x9f1813[_0xe593('0x29')]>0x0){return _0x16f9fc[_0xe593('0x1b')](0x190)['json'](_0x9f1813);}var _0x190e90=_0x2145c0[_0xe593('0x2d')][_0xe593('0x2f')];var _0x492a9e=_0x2145c0[_0xe593('0x2d')][_0xe593('0x28')];var _0x4001b7=_0x2145c0[_0xe593('0x2d')][_0xe593('0x48')];return getAgent(_0x190e90)['then'](function(_0x17a1bc){logger[_0xe593('0x16')]('entityFound:',_0x17a1bc[_0xe593('0x1a')]);emit(util[_0xe593('0x33')](_0xe593('0x34'),_0x17a1bc[_0xe593('0x1a')]),'webbar:transfer',{'sessionId':_0x492a9e,'transferNumber':_0x4001b7});return _0x16f9fc[_0xe593('0x1b')](0xc8)[_0xe593('0x2e')]({'error':![],'message':_0xe593('0x49')});})['catch'](handleError(_0x16f9fc));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index b48b73b..de7a8c1 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 _0x955f=['addApplications','notify','/:id/send','send','update','destroy','delete','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getAnswers','getApplications','post','create','addDisposition','/:id/users','addAgents'];(function(_0x2d3a2a,_0x77d432){var _0x3e60fb=function(_0x162aab){while(--_0x162aab){_0x2d3a2a['push'](_0x2d3a2a['shift']());}};_0x3e60fb(++_0x77d432);}(_0x955f,0x1eb));var _0xf955=function(_0x3b5768,_0x42f70c){_0x3b5768=_0x3b5768-0x0;var _0xe5965b=_0x955f[_0x3b5768];return _0xe5965b;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./whatsappAccount.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0x7')](_0xf955('0xd'),auth[_0xf955('0x8')](),controller['getDispositions']);router[_0xf955('0x7')]('/:id/canned_answers',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router[_0xf955('0x7')]('/:id/users',auth[_0xf955('0x8')](),controller['getAgents']);router[_0xf955('0x7')]('/:id/applications',auth[_0xf955('0x8')](),controller[_0xf955('0xf')]);router[_0xf955('0x10')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x11')]);router[_0xf955('0x10')](_0xf955('0xd'),auth[_0xf955('0x8')](),controller[_0xf955('0x12')]);router[_0xf955('0x10')]('/:id/canned_answers',auth[_0xf955('0x8')](),controller['addAnswer']);router[_0xf955('0x10')](_0xf955('0x13'),auth[_0xf955('0x8')](),controller[_0xf955('0x14')]);router['post']('/:id/applications',auth[_0xf955('0x8')](),controller[_0xf955('0x15')]);router[_0xf955('0x10')]('/:id/notify',controller[_0xf955('0x16')]);router[_0xf955('0x10')](_0xf955('0x17'),auth[_0xf955('0x8')](),controller[_0xf955('0x18')]);router['put'](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0x19')]);router['delete'](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0x1a')]);router[_0xf955('0x1b')](_0xf955('0xd'),auth[_0xf955('0x8')](),controller[_0xf955('0x1c')]);router['delete'](_0xf955('0x1d'),auth[_0xf955('0x8')](),controller[_0xf955('0x1e')]);router[_0xf955('0x1b')](_0xf955('0x13'),auth[_0xf955('0x8')](),controller[_0xf955('0x1f')]);module['exports']=router; \ No newline at end of file +var _0xfcf0=['/:id/applications','getApplications','post','addAnswer','/:id/users','addAgents','addApplications','notify','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getAgents'];(function(_0x1b8bb0,_0x5cb62b){var _0x11d90e=function(_0x459fdf){while(--_0x459fdf){_0x1b8bb0['push'](_0x1b8bb0['shift']());}};_0x11d90e(++_0x5cb62b);}(_0xfcf0,0x138));var _0x0fcf=function(_0x1ca29f,_0x318ac5){_0x1ca29f=_0x1ca29f-0x0;var _0x576c3b=_0xfcf0[_0x1ca29f];return _0x576c3b;};'use strict';var multer=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var path=require('path');var timeout=require(_0x0fcf('0x2'));var express=require(_0x0fcf('0x3'));var router=express[_0x0fcf('0x4')]();var fs_extra=require(_0x0fcf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var controller=require(_0x0fcf('0x8'));router[_0x0fcf('0x9')]('/',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0xb')]);router[_0x0fcf('0x9')](_0x0fcf('0xc'),auth['isAuthenticated'](),controller[_0x0fcf('0xd')]);router[_0x0fcf('0x9')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0xf')]);router[_0x0fcf('0x9')](_0x0fcf('0x10'),auth['isAuthenticated'](),controller[_0x0fcf('0x11')]);router['get'](_0x0fcf('0x12'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x13')]);router['get']('/:id/users',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x14')]);router['get'](_0x0fcf('0x15'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x16')]);router[_0x0fcf('0x17')]('/',auth[_0x0fcf('0xa')](),controller['create']);router[_0x0fcf('0x17')](_0x0fcf('0x10'),auth[_0x0fcf('0xa')](),controller['addDisposition']);router[_0x0fcf('0x17')](_0x0fcf('0x12'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x18')]);router['post'](_0x0fcf('0x19'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x1a')]);router[_0x0fcf('0x17')](_0x0fcf('0x15'),auth['isAuthenticated'](),controller[_0x0fcf('0x1b')]);router[_0x0fcf('0x17')]('/:id/notify',controller[_0x0fcf('0x1c')]);router[_0x0fcf('0x17')]('/:id/send',auth[_0x0fcf('0xa')](),controller['send']);router[_0x0fcf('0x1d')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0x1e')]);router[_0x0fcf('0x1f')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0x20')]);router[_0x0fcf('0x1f')](_0x0fcf('0x10'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x21')]);router[_0x0fcf('0x1f')]('/:id/canned_answers',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x22')]);router[_0x0fcf('0x1f')](_0x0fcf('0x19'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x23')]);module[_0x0fcf('0x24')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 5488c96..aaec073 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 _0x467e=['twilio','sinch','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x4dcb2f,_0x428551){var _0x4bb638=function(_0x501f3c){while(--_0x501f3c){_0x4dcb2f['push'](_0x4dcb2f['shift']());}};_0x4bb638(++_0x428551);}(_0x467e,0x130));var _0xe467=function(_0xea4633,_0x595928){_0xea4633=_0xea4633-0x0;var _0x2e7e83=_0x467e[_0xea4633];return _0x2e7e83;};'use strict';var Sequelize=require(_0xe467('0x0'));var rs=require(_0xe467('0x1'));module[_0xe467('0x2')]={'name':{'type':Sequelize[_0xe467('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xe467('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xe467('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xe467('0x4'),_0xe467('0x5'))},'accountSid':{'type':Sequelize[_0xe467('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xe467('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xe467('0x6');}},'notificationSound':{'type':Sequelize[_0xe467('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xe467('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe467('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe467('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe467('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe467('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xe467('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xe467('0xa'),'set':function(_0x124312){if(!_0x124312){this[_0xe467('0xb')](_0xe467('0xc'),null);}this['setDataValue'](_0xe467('0xd'),_0x124312);}},'description':{'type':Sequelize[_0xe467('0x3')]}}; \ No newline at end of file +var _0x9aee=['setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','STRING','ENUM','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x1180e5,_0x1747cd){var _0x42965f=function(_0x567686){while(--_0x567686){_0x1180e5['push'](_0x1180e5['shift']());}};_0x42965f(++_0x1747cd);}(_0x9aee,0x162));var _0xe9ae=function(_0x1b38e7,_0x489741){_0x1b38e7=_0x1b38e7-0x0;var _0x1b4635=_0x9aee[_0x1b38e7];return _0x1b4635;};'use strict';var Sequelize=require(_0xe9ae('0x0'));var rs=require(_0xe9ae('0x1'));module['exports']={'name':{'type':Sequelize[_0xe9ae('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xe9ae('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xe9ae('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xe9ae('0x2')]},'type':{'type':Sequelize[_0xe9ae('0x3')]('twilio',_0xe9ae('0x4'))},'accountSid':{'type':Sequelize[_0xe9ae('0x2')]},'baseUrl':{'type':Sequelize[_0xe9ae('0x2')]},'authToken':{'type':Sequelize[_0xe9ae('0x2')]},'notificationTemplate':{'type':Sequelize[_0xe9ae('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xe9ae('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xe9ae('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe9ae('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe9ae('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe9ae('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe9ae('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xe9ae('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xe9ae('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x21c352){if(!_0x21c352){this[_0xe9ae('0x9')](_0xe9ae('0xa'),null);}this[_0xe9ae('0x9')]('mandatoryDisposition',_0x21c352);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 6d82978..5b96a2d 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 _0x36e0=['mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./whatsappAccount.socket','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','json','limit','undefined','count','offset','Content-Range','save','destroy','get','WhatsappAccounts','status','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','rows','removeDispositions','addAnswer','CannedAnswer','findOne','rawAttributes','removeAnswers','ids','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','sequelize','transaction','bulkCreate','WhatsappApplication','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','update','timestamp','message_id','applications','orderBy','priority','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','replace','whatsapp:','Body','MessageSid','notifications','isNil','Sequelize','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','Contacts','defaults','contact','WhatsappInteraction','interaction','created','push','close','*,*,*,*','WhatsappMessage','messageId','ContactId','AttachmentId','UserId','User','unshift','agent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','set','text/xml','\x0a','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x36e0,0xbc));var _0x036e=function(_0x3e083f,_0x137323){_0x3e083f=_0x3e083f-0x0;var _0x1cd914=_0x36e0[_0x3e083f];return _0x1cd914;};'use strict';var emlformat=require(_0x036e('0x0'));var rimraf=require(_0x036e('0x1'));var zipdir=require(_0x036e('0x2'));var jsonpatch=require(_0x036e('0x3'));var rp=require(_0x036e('0x4'));var moment=require(_0x036e('0x5'));var BPromise=require(_0x036e('0x6'));var Mustache=require(_0x036e('0x7'));var util=require(_0x036e('0x8'));var path=require(_0x036e('0x9'));var sox=require('sox');var csv=require(_0x036e('0xa'));var ejs=require(_0x036e('0xb'));var fs=require('fs');var fs_extra=require(_0x036e('0xc'));var _=require(_0x036e('0xd'));var squel=require(_0x036e('0xe'));var crypto=require(_0x036e('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x036e('0x10'));var toCsv=require(_0x036e('0xa'));var querystring=require(_0x036e('0x11'));var Papa=require(_0x036e('0x12'));var Redis=require('ioredis');var authService=require(_0x036e('0x13'));var qs=require(_0x036e('0x14'));var as=require(_0x036e('0x15'));var hardwareService=require(_0x036e('0x16'));var logger=require('../../config/logger')(_0x036e('0x17'));var utils=require(_0x036e('0x18'));var config=require(_0x036e('0x19'));var licenseUtil=require(_0x036e('0x1a'));var db=require(_0x036e('0x1b'))['db'];config[_0x036e('0x1c')]=_['defaults'](config[_0x036e('0x1c')],{'host':_0x036e('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x036e('0x1c')]));require(_0x036e('0x1e'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x036e('0x1f')][_0x036e('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x5e6451,_0x25c280,_0x17aac5,_0x271574){return new BPromise(function(_0x15c4df,_0x16121d){var _0x374fc7=_0x271574||client;return _0x374fc7[_0x036e('0x21')](_0x5e6451,_0x17aac5)[_0x036e('0x22')](function(_0x56fc89){logger[_0x036e('0x23')](_0x036e('0x24'),_0x25c280,_0x036e('0x25'));logger[_0x036e('0x26')](_0x036e('0x27'),_0x25c280,_0x036e('0x25'),JSON['stringify'](_0x56fc89));if(_0x56fc89[_0x036e('0x28')]){if(_0x56fc89[_0x036e('0x28')][_0x036e('0x29')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x25c280,_0x56fc89[_0x036e('0x28')][_0x036e('0x2a')]);return _0x16121d(_0x56fc89[_0x036e('0x28')][_0x036e('0x2a')]);}logger[_0x036e('0x28')](_0x036e('0x24'),_0x25c280,_0x56fc89['error'][_0x036e('0x2a')]);return _0x15c4df(_0x56fc89[_0x036e('0x28')][_0x036e('0x2a')]);}else{logger['info'](_0x036e('0x24'),_0x25c280,_0x036e('0x25'));_0x15c4df(_0x56fc89[_0x036e('0x2b')][_0x036e('0x2a')]);}})[_0x036e('0x2c')](function(_0x49e6e1){logger[_0x036e('0x28')](_0x036e('0x24'),_0x25c280,_0x49e6e1);_0x16121d(_0x49e6e1);});});}function respondWithStatusCode(_0x3500b9,_0x1d42f3){_0x1d42f3=_0x1d42f3||0xcc;return function(_0x583383){if(_0x583383){return _0x3500b9[_0x036e('0x2d')](_0x1d42f3);}return _0x3500b9['status'](_0x1d42f3)['end']();};}function respondWithResult(_0x151681,_0x8598fa){_0x8598fa=_0x8598fa||0xc8;return function(_0x373304){if(_0x373304){return _0x151681['status'](_0x8598fa)[_0x036e('0x2e')](_0x373304);}};}function respondWithFilteredResult(_0x24c525,_0x122b12){return function(_0x3c43d2){if(_0x3c43d2){var _0x442f2e=typeof _0x122b12['offset']==='undefined'&&typeof _0x122b12[_0x036e('0x2f')]===_0x036e('0x30');var _0x17573f=_0x3c43d2[_0x036e('0x31')];var _0x4a4a86=_0x442f2e?0x0:_0x122b12[_0x036e('0x32')];var _0x570344=_0x442f2e?_0x3c43d2[_0x036e('0x31')]:_0x122b12['offset']+_0x122b12['limit'];var _0x40e069;if(_0x570344>=_0x17573f){_0x570344=_0x17573f;_0x40e069=0xc8;}else{_0x40e069=0xce;}_0x24c525['status'](_0x40e069);return _0x24c525['set'](_0x036e('0x33'),_0x4a4a86+'-'+_0x570344+'/'+_0x17573f)[_0x036e('0x2e')](_0x3c43d2);}return null;};}function patchUpdates(_0x72835c){return function(_0x9d9739){try{jsonpatch['apply'](_0x9d9739,_0x72835c,!![]);}catch(_0x33429e){return BPromise['reject'](_0x33429e);}return _0x9d9739[_0x036e('0x34')]();};}function saveUpdates(_0x3302e3,_0x25329a){return function(_0x5e894e){if(_0x5e894e){return _0x5e894e['update'](_0x3302e3)[_0x036e('0x22')](function(_0xdb3f3d){return _0xdb3f3d;});}return null;};}function removeEntity(_0x590595,_0x29db9b){return function(_0x1f261c){if(_0x1f261c){return _0x1f261c[_0x036e('0x35')]()['then'](function(){var _0x180d54=_0x1f261c[_0x036e('0x36')]({'plain':!![]});var _0x28400a=_0x036e('0x37');return db['UserProfileResource'][_0x036e('0x35')]({'where':{'type':_0x28400a,'resourceId':_0x180d54['id']}})['then'](function(){return _0x1f261c;});})['then'](function(){_0x590595[_0x036e('0x38')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dc64c,_0x137988){return function(_0x4d809c){if(!_0x4d809c){_0x3dc64c[_0x036e('0x2d')](0x194);}return _0x4d809c;};}function handleError(_0x17b7b9,_0x52d590){_0x52d590=_0x52d590||0x1f4;return function(_0x48cba4){logger[_0x036e('0x28')](_0x48cba4[_0x036e('0x39')]);if(_0x48cba4[_0x036e('0x3a')]){delete _0x48cba4[_0x036e('0x3a')];}_0x17b7b9['status'](_0x52d590)[_0x036e('0x3b')](_0x48cba4);};}exports[_0x036e('0x3c')]=function(_0xbcfa13,_0x18be49){var _0xb1914f={'include':[{'model':db[_0x036e('0x3d')],'as':_0x036e('0x3e')}]},_0x4aa3b3={},_0x1ad3d5={'count':0x0,'rows':[]};var _0x3b020f=_[_0x036e('0x3f')](db[_0x036e('0x40')]['rawAttributes'],function(_0x20d9c0){return{'name':_0x20d9c0[_0x036e('0x41')],'type':_0x20d9c0[_0x036e('0x42')][_0x036e('0x43')]};});_0x4aa3b3['model']=_[_0x036e('0x3f')](_0x3b020f,'name');_0x4aa3b3[_0x036e('0x44')]=_[_0x036e('0x45')](_0xbcfa13[_0x036e('0x44')]);_0x4aa3b3[_0x036e('0x46')]=_[_0x036e('0x47')](_0x4aa3b3['model'],_0x4aa3b3['query']);_0xb1914f[_0x036e('0x48')]=_['intersection'](_0x4aa3b3[_0x036e('0x49')],qs['fields'](_0xbcfa13[_0x036e('0x44')][_0x036e('0x4a')]));_0xb1914f['attributes']=_0xb1914f[_0x036e('0x48')][_0x036e('0x4b')]?_0xb1914f[_0x036e('0x48')]:_0x4aa3b3[_0x036e('0x49')];if(!_0xbcfa13['query'][_0x036e('0x4c')](_0x036e('0x4d'))){_0xb1914f[_0x036e('0x2f')]=qs[_0x036e('0x2f')](_0xbcfa13[_0x036e('0x44')][_0x036e('0x2f')]);_0xb1914f[_0x036e('0x32')]=qs[_0x036e('0x32')](_0xbcfa13['query'][_0x036e('0x32')]);}_0xb1914f[_0x036e('0x4e')]=qs['sort'](_0xbcfa13[_0x036e('0x44')][_0x036e('0x4f')]);_0xb1914f[_0x036e('0x50')]=qs[_0x036e('0x46')](_[_0x036e('0x51')](_0xbcfa13['query'],_0x4aa3b3[_0x036e('0x46')]),_0x3b020f);if(_0xbcfa13[_0x036e('0x44')][_0x036e('0x52')]){_0xb1914f[_0x036e('0x50')]=_[_0x036e('0x53')](_0xb1914f[_0x036e('0x50')],{'$or':_[_0x036e('0x3f')](_0x3b020f,function(_0x408293){if(_0x408293[_0x036e('0x42')]!=='VIRTUAL'){var _0x31ab41={};_0x31ab41[_0x408293[_0x036e('0x3a')]]={'$like':'%'+_0xbcfa13[_0x036e('0x44')]['filter']+'%'};return _0x31ab41;}})});}_0xb1914f=_[_0x036e('0x53')]({},_0xb1914f,_0xbcfa13[_0x036e('0x54')]);var _0x48d77a={'where':_0xb1914f[_0x036e('0x50')]};return db[_0x036e('0x40')]['count'](_0x48d77a)['then'](function(_0x6222f7){_0x1ad3d5[_0x036e('0x31')]=_0x6222f7;if(_0xbcfa13['query'][_0x036e('0x55')]){_0xb1914f[_0x036e('0x56')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x036e('0x57')](_0xb1914f);})[_0x036e('0x22')](function(_0xac5886){_0x1ad3d5['rows']=_0xac5886;return _0x1ad3d5;})['then'](respondWithFilteredResult(_0x18be49,_0xb1914f))[_0x036e('0x2c')](handleError(_0x18be49,null));};exports[_0x036e('0x58')]=function(_0xc11a74,_0x3108e9){var _0x5caec6={'raw':![],'where':{'id':_0xc11a74['params']['id']},'include':[{'model':db[_0x036e('0x3d')],'as':_0x036e('0x3e')}]},_0x59f0fd={};_0x59f0fd['model']=_['keys'](db[_0x036e('0x40')]['rawAttributes']);_0x59f0fd[_0x036e('0x44')]=_[_0x036e('0x45')](_0xc11a74[_0x036e('0x44')]);_0x59f0fd[_0x036e('0x46')]=_[_0x036e('0x47')](_0x59f0fd['model'],_0x59f0fd[_0x036e('0x44')]);_0x5caec6[_0x036e('0x48')]=_[_0x036e('0x47')](_0x59f0fd[_0x036e('0x49')],qs[_0x036e('0x4a')](_0xc11a74[_0x036e('0x44')][_0x036e('0x4a')]));_0x5caec6[_0x036e('0x48')]=_0x5caec6[_0x036e('0x48')][_0x036e('0x4b')]?_0x5caec6[_0x036e('0x48')]:_0x59f0fd[_0x036e('0x49')];if(_0xc11a74[_0x036e('0x44')][_0x036e('0x55')]){_0x5caec6[_0x036e('0x56')]=[{'all':!![]}];}_0x5caec6=_[_0x036e('0x53')]({},_0x5caec6,_0xc11a74['options']);return db['WhatsappAccount']['find'](_0x5caec6)['then'](handleEntityNotFound(_0x3108e9,null))[_0x036e('0x22')](respondWithResult(_0x3108e9,null))[_0x036e('0x2c')](handleError(_0x3108e9,null));};exports[_0x036e('0x59')]=function(_0x11df05,_0x353aee){return db[_0x036e('0x40')]['create'](_0x11df05[_0x036e('0x5a')],{})['then'](function(_0x5890a4){var _0x11f7e0=_0x11df05[_0x036e('0x5b')][_0x036e('0x36')]({'plain':!![]});if(!_0x11f7e0)throw new Error(_0x036e('0x5c'));if(_0x11f7e0['role']===_0x036e('0x5b')){var _0x75ecf5=_0x5890a4[_0x036e('0x36')]({'plain':!![]});var _0x2ec370=_0x036e('0x37');return db[_0x036e('0x5d')][_0x036e('0x5e')]({'where':{'name':_0x2ec370,'userProfileId':_0x11f7e0[_0x036e('0x5f')]},'raw':!![]})[_0x036e('0x22')](function(_0x47c84e){if(_0x47c84e&&_0x47c84e[_0x036e('0x60')]===0x0){return db[_0x036e('0x61')]['create']({'name':_0x75ecf5['name'],'resourceId':_0x75ecf5['id'],'type':_0x47c84e[_0x036e('0x3a')],'sectionId':_0x47c84e['id']},{})[_0x036e('0x22')](function(){return _0x5890a4;});}else{return _0x5890a4;}})['catch'](function(_0x5277f7){logger['error'](_0x036e('0x62'),_0x5277f7);throw _0x5277f7;});}return _0x5890a4;})['then'](respondWithResult(_0x353aee,0xc9))[_0x036e('0x2c')](handleError(_0x353aee,null));};exports['update']=function(_0x5c60ef,_0x28e3a8){if(_0x5c60ef[_0x036e('0x5a')]['id']){delete _0x5c60ef[_0x036e('0x5a')]['id'];}return db[_0x036e('0x40')][_0x036e('0x5e')]({'where':{'id':_0x5c60ef[_0x036e('0x63')]['id']},'include':[{'model':db[_0x036e('0x3d')],'as':_0x036e('0x3e')}]})[_0x036e('0x22')](handleEntityNotFound(_0x28e3a8,null))[_0x036e('0x22')](saveUpdates(_0x5c60ef[_0x036e('0x5a')],null))['then'](respondWithResult(_0x28e3a8,null))[_0x036e('0x2c')](handleError(_0x28e3a8,null));};exports[_0x036e('0x35')]=function(_0x4735a3,_0x1f48f5){return db[_0x036e('0x40')][_0x036e('0x5e')]({'where':{'id':_0x4735a3['params']['id']}})[_0x036e('0x22')](handleEntityNotFound(_0x1f48f5,null))[_0x036e('0x22')](removeEntity(_0x1f48f5,null))['catch'](handleError(_0x1f48f5,null));};exports[_0x036e('0x64')]=function(_0x1eeaa1,_0x1d8cc6){return db[_0x036e('0x40')][_0x036e('0x64')]()[_0x036e('0x22')](respondWithResult(_0x1d8cc6,null))[_0x036e('0x2c')](handleError(_0x1d8cc6,null));};exports[_0x036e('0x65')]=function(_0x4a21e8,_0x2d7caa,_0x1b3bd6){if(_0x4a21e8[_0x036e('0x5a')]['id']){delete _0x4a21e8[_0x036e('0x5a')]['id'];}return db['WhatsappAccount'][_0x036e('0x5e')]({'where':{'id':_0x4a21e8[_0x036e('0x63')]['id']}})['then'](handleEntityNotFound(_0x2d7caa,null))[_0x036e('0x22')](function(_0x660d4a){if(_0x660d4a){_0x4a21e8[_0x036e('0x5a')][_0x036e('0x66')]=_0x660d4a['id'];return db[_0x036e('0x67')][_0x036e('0x59')](_0x4a21e8[_0x036e('0x5a')]);}})[_0x036e('0x22')](respondWithResult(_0x2d7caa,null))['catch'](handleError(_0x2d7caa,null));};exports[_0x036e('0x68')]=function(_0x3a7c45,_0x108966,_0xa644e7){var _0x1cbfa8={'raw':![],'where':{}};var _0xfe864={};var _0xe52e15={'count':0x0,'rows':[]};return db[_0x036e('0x40')]['findOne']({'where':{'id':_0x3a7c45[_0x036e('0x63')]['id']}})['then'](handleEntityNotFound(_0x108966,null))['then'](function(_0x17cd89){if(_0x17cd89){_0xfe864[_0x036e('0x49')]=_[_0x036e('0x45')](db[_0x036e('0x67')]['rawAttributes']);_0xfe864[_0x036e('0x44')]=_[_0x036e('0x45')](_0x3a7c45['query']);_0xfe864[_0x036e('0x46')]=_[_0x036e('0x47')](_0xfe864[_0x036e('0x49')],_0xfe864[_0x036e('0x44')]);_0x1cbfa8[_0x036e('0x48')]=_[_0x036e('0x47')](_0xfe864['model'],qs[_0x036e('0x4a')](_0x3a7c45[_0x036e('0x44')]['fields']));_0x1cbfa8[_0x036e('0x48')]=_0x1cbfa8[_0x036e('0x48')]['length']?_0x1cbfa8[_0x036e('0x48')]:_0xfe864['model'];if(!_0x3a7c45['query'][_0x036e('0x4c')](_0x036e('0x4d'))){_0x1cbfa8[_0x036e('0x2f')]=qs[_0x036e('0x2f')](_0x3a7c45[_0x036e('0x44')][_0x036e('0x2f')]);_0x1cbfa8[_0x036e('0x32')]=qs['offset'](_0x3a7c45[_0x036e('0x44')]['offset']);}_0x1cbfa8[_0x036e('0x4e')]=qs[_0x036e('0x4f')](_0x3a7c45['query'][_0x036e('0x4f')]);_0x1cbfa8[_0x036e('0x50')]=qs[_0x036e('0x46')](_['pick'](_0x3a7c45[_0x036e('0x44')],_0xfe864[_0x036e('0x46')]));_0x1cbfa8[_0x036e('0x50')][_0x036e('0x66')]=_0x17cd89['id'];if(_0x3a7c45[_0x036e('0x44')][_0x036e('0x52')]){_0x1cbfa8['where']=_[_0x036e('0x53')](_0x1cbfa8[_0x036e('0x50')],{'$or':_[_0x036e('0x3f')](_0x1cbfa8['attributes'],function(_0x14a4d9){var _0x5e1d19={};_0x5e1d19[_0x14a4d9]={'$like':'%'+_0x3a7c45[_0x036e('0x44')][_0x036e('0x52')]+'%'};return _0x5e1d19;})});}_0x1cbfa8=_['merge']({},_0x1cbfa8,_0x3a7c45[_0x036e('0x54')]);return db[_0x036e('0x67')][_0x036e('0x31')]({'where':_0x1cbfa8['where']})[_0x036e('0x22')](function(_0x2cb983){_0xe52e15['count']=_0x2cb983;if(_0x3a7c45[_0x036e('0x44')][_0x036e('0x55')]){_0x1cbfa8[_0x036e('0x56')]=[{'all':!![]}];}return db[_0x036e('0x67')][_0x036e('0x57')](_0x1cbfa8);})[_0x036e('0x22')](function(_0x2db778){_0xe52e15[_0x036e('0x69')]=_0x2db778;return _0xe52e15;});}})['then'](respondWithFilteredResult(_0x108966,_0x1cbfa8))['catch'](handleError(_0x108966,null));};exports[_0x036e('0x6a')]=function(_0x49f416,_0x589045,_0x1d2e8b){return db[_0x036e('0x40')][_0x036e('0x5e')]({'where':{'id':_0x49f416[_0x036e('0x63')]['id']}})[_0x036e('0x22')](handleEntityNotFound(_0x589045,null))[_0x036e('0x22')](function(_0x3d248f){if(_0x3d248f){return _0x3d248f[_0x036e('0x6a')](_0x49f416[_0x036e('0x44')]['ids']);}})[_0x036e('0x22')](respondWithStatusCode(_0x589045,null))[_0x036e('0x2c')](handleError(_0x589045,null));};exports[_0x036e('0x6b')]=function(_0x5cb640,_0x36ae2a,_0x4bb973){if(_0x5cb640[_0x036e('0x5a')]['id']){delete _0x5cb640[_0x036e('0x5a')]['id'];}return db['WhatsappAccount'][_0x036e('0x5e')]({'where':{'id':_0x5cb640[_0x036e('0x63')]['id']}})[_0x036e('0x22')](handleEntityNotFound(_0x36ae2a,null))['then'](function(_0x14136b){if(_0x14136b){_0x5cb640[_0x036e('0x5a')][_0x036e('0x66')]=_0x14136b['id'];return db[_0x036e('0x6c')][_0x036e('0x59')](_0x5cb640[_0x036e('0x5a')]);}})[_0x036e('0x22')](respondWithResult(_0x36ae2a,null))['catch'](handleError(_0x36ae2a,null));};exports['getAnswers']=function(_0x546c56,_0x46fd8e,_0x1bc773){var _0x541319={'raw':![],'where':{}};var _0x41529d={};var _0x9887be={'count':0x0,'rows':[]};return db[_0x036e('0x40')][_0x036e('0x6d')]({'where':{'id':_0x546c56[_0x036e('0x63')]['id']}})['then'](handleEntityNotFound(_0x46fd8e,null))['then'](function(_0x1d11bf){if(_0x1d11bf){_0x41529d['model']=_[_0x036e('0x45')](db[_0x036e('0x6c')][_0x036e('0x6e')]);_0x41529d['query']=_['keys'](_0x546c56[_0x036e('0x44')]);_0x41529d[_0x036e('0x46')]=_[_0x036e('0x47')](_0x41529d[_0x036e('0x49')],_0x41529d[_0x036e('0x44')]);_0x541319[_0x036e('0x48')]=_['intersection'](_0x41529d[_0x036e('0x49')],qs[_0x036e('0x4a')](_0x546c56[_0x036e('0x44')][_0x036e('0x4a')]));_0x541319[_0x036e('0x48')]=_0x541319[_0x036e('0x48')][_0x036e('0x4b')]?_0x541319[_0x036e('0x48')]:_0x41529d['model'];if(!_0x546c56[_0x036e('0x44')][_0x036e('0x4c')]('nolimit')){_0x541319['limit']=qs[_0x036e('0x2f')](_0x546c56['query'][_0x036e('0x2f')]);_0x541319[_0x036e('0x32')]=qs['offset'](_0x546c56[_0x036e('0x44')][_0x036e('0x32')]);}_0x541319[_0x036e('0x4e')]=qs[_0x036e('0x4f')](_0x546c56[_0x036e('0x44')][_0x036e('0x4f')]);_0x541319[_0x036e('0x50')]=qs[_0x036e('0x46')](_[_0x036e('0x51')](_0x546c56['query'],_0x41529d[_0x036e('0x46')]));_0x541319[_0x036e('0x50')][_0x036e('0x66')]=_0x1d11bf['id'];if(_0x546c56['query'][_0x036e('0x52')]){_0x541319[_0x036e('0x50')]=_[_0x036e('0x53')](_0x541319[_0x036e('0x50')],{'$or':_[_0x036e('0x3f')](_0x541319[_0x036e('0x48')],function(_0x3106f6){var _0x42d500={};_0x42d500[_0x3106f6]={'$like':'%'+_0x546c56['query']['filter']+'%'};return _0x42d500;})});}_0x541319=_[_0x036e('0x53')]({},_0x541319,_0x546c56[_0x036e('0x54')]);return db[_0x036e('0x6c')][_0x036e('0x31')]({'where':_0x541319[_0x036e('0x50')]})[_0x036e('0x22')](function(_0x1dddcd){_0x9887be['count']=_0x1dddcd;if(_0x546c56['query'][_0x036e('0x55')]){_0x541319['include']=[{'all':!![]}];}return db[_0x036e('0x6c')][_0x036e('0x57')](_0x541319);})[_0x036e('0x22')](function(_0x323309){_0x9887be[_0x036e('0x69')]=_0x323309;return _0x9887be;});}})[_0x036e('0x22')](respondWithFilteredResult(_0x46fd8e,_0x541319))['catch'](handleError(_0x46fd8e,null));};exports['removeAnswers']=function(_0x38d589,_0x8aeadb,_0x4a752e){return db[_0x036e('0x40')][_0x036e('0x5e')]({'where':{'id':_0x38d589[_0x036e('0x63')]['id']}})[_0x036e('0x22')](handleEntityNotFound(_0x8aeadb,null))[_0x036e('0x22')](function(_0x377073){if(_0x377073){return _0x377073[_0x036e('0x6f')](_0x38d589['query'][_0x036e('0x70')]);}})['then'](respondWithStatusCode(_0x8aeadb,null))[_0x036e('0x2c')](handleError(_0x8aeadb,null));};exports[_0x036e('0x71')]=function(_0x48b68e,_0x13aeda,_0x50c708){return db['WhatsappAccount'][_0x036e('0x5e')]({'where':{'id':_0x48b68e[_0x036e('0x63')]['id']}})['then'](handleEntityNotFound(_0x13aeda,null))[_0x036e('0x22')](function(_0x5d1b4f){if(_0x5d1b4f){return _0x5d1b4f['addAgents'](_0x48b68e[_0x036e('0x5a')]['ids'],_[_0x036e('0x72')](_0x48b68e[_0x036e('0x5a')],['ids','id'])||{})[_0x036e('0x73')](function(_0x16d80f){for(var _0x3f8627=0x0;_0x3f8627<_0x48b68e[_0x036e('0x5a')][_0x036e('0x70')][_0x036e('0x4b')];_0x3f8627+=0x1){socket[_0x036e('0x74')](_0x036e('0x75'),{'UserId':Number(_0x48b68e[_0x036e('0x5a')][_0x036e('0x70')][_0x3f8627]),'WhatsappAccountId':Number(_0x48b68e[_0x036e('0x63')]['id'])});}return _0x16d80f;});}})[_0x036e('0x22')](respondWithResult(_0x13aeda,null))[_0x036e('0x2c')](handleError(_0x13aeda,null));};exports['removeAgents']=function(_0xa9dd88,_0x12db4f,_0x51711d){return db['WhatsappAccount'][_0x036e('0x5e')]({'where':{'id':_0xa9dd88[_0x036e('0x63')]['id']}})[_0x036e('0x22')](handleEntityNotFound(_0x12db4f,null))['then'](function(_0x539176){if(_0x539176){return _0x539176[_0x036e('0x76')](_0xa9dd88[_0x036e('0x44')]['ids'])['then'](function(){if(_['isArray'](_0xa9dd88[_0x036e('0x44')][_0x036e('0x70')])){for(var _0x476365=0x0;_0x476365<_0xa9dd88[_0x036e('0x44')][_0x036e('0x70')][_0x036e('0x4b')];_0x476365+=0x1){socket[_0x036e('0x74')](_0x036e('0x77'),{'UserId':Number(_0xa9dd88[_0x036e('0x44')][_0x036e('0x70')][_0x476365]),'WhatsappAccountId':Number(_0xa9dd88[_0x036e('0x63')]['id'])});}}else{socket[_0x036e('0x74')](_0x036e('0x77'),{'UserId':Number(_0xa9dd88[_0x036e('0x44')][_0x036e('0x70')]),'WhatsappAccountId':Number(_0xa9dd88[_0x036e('0x63')]['id'])});}});}})['then'](respondWithStatusCode(_0x12db4f,null))[_0x036e('0x2c')](handleError(_0x12db4f,null));};exports['getAgents']=function(_0x47e1bb,_0x28f3c6,_0x157590){var _0x27d93f={};var _0x367a5b={};var _0x4ee618;var _0x28554b;return db[_0x036e('0x40')][_0x036e('0x6d')]({'where':{'id':_0x47e1bb[_0x036e('0x63')]['id']}})[_0x036e('0x22')](handleEntityNotFound(_0x28f3c6,null))['then'](function(_0x51a235){if(_0x51a235){_0x4ee618=_0x51a235;_0x367a5b[_0x036e('0x49')]=_[_0x036e('0x45')](db['User'][_0x036e('0x6e')]);_0x367a5b[_0x036e('0x44')]=_['keys'](_0x47e1bb[_0x036e('0x44')]);_0x367a5b[_0x036e('0x46')]=_[_0x036e('0x47')](_0x367a5b[_0x036e('0x49')],_0x367a5b['query']);_0x27d93f[_0x036e('0x48')]=_[_0x036e('0x47')](_0x367a5b[_0x036e('0x49')],qs[_0x036e('0x4a')](_0x47e1bb['query'][_0x036e('0x4a')]));_0x27d93f[_0x036e('0x48')]=_0x27d93f['attributes'][_0x036e('0x4b')]?_0x27d93f[_0x036e('0x48')]:_0x367a5b[_0x036e('0x49')];_0x27d93f[_0x036e('0x4e')]=qs['sort'](_0x47e1bb[_0x036e('0x44')][_0x036e('0x4f')]);_0x27d93f['where']=qs[_0x036e('0x46')](_[_0x036e('0x51')](_0x47e1bb[_0x036e('0x44')],_0x367a5b[_0x036e('0x46')]));if(_0x47e1bb[_0x036e('0x44')]['filter']){_0x27d93f[_0x036e('0x50')]=_[_0x036e('0x53')](_0x27d93f['where'],{'$or':_[_0x036e('0x3f')](_0x27d93f[_0x036e('0x48')],function(_0x1cfccd){var _0x35359c={};_0x35359c[_0x1cfccd]={'$like':'%'+_0x47e1bb[_0x036e('0x44')][_0x036e('0x52')]+'%'};return _0x35359c;})});}_0x27d93f=_['merge']({},_0x27d93f,_0x47e1bb['options']);return _0x4ee618[_0x036e('0x78')](_0x27d93f);}})[_0x036e('0x22')](function(_0x1b5c71){if(_0x1b5c71){_0x28554b=_0x1b5c71[_0x036e('0x4b')];if(!_0x47e1bb['query'][_0x036e('0x4c')](_0x036e('0x4d'))){_0x27d93f[_0x036e('0x2f')]=qs[_0x036e('0x2f')](_0x47e1bb[_0x036e('0x44')][_0x036e('0x2f')]);_0x27d93f[_0x036e('0x32')]=qs[_0x036e('0x32')](_0x47e1bb[_0x036e('0x44')][_0x036e('0x32')]);}return _0x4ee618[_0x036e('0x78')](_0x27d93f);}})['then'](function(_0x594874){if(_0x594874){return _0x594874?{'count':_0x28554b,'rows':_0x594874}:null;}})['then'](respondWithResult(_0x28f3c6,null))[_0x036e('0x2c')](handleError(_0x28f3c6,null));};exports['addApplications']=function(_0x2f9586,_0x12d228){var _0x3267f9=_0x2f9586['params']['id'];var _0x431617=_0x2f9586[_0x036e('0x5a')];var _0x20372b=0xc8;var _0x3bb9fa=null;return db[_0x036e('0x79')][_0x036e('0x7a')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x467543){return db['WhatsappAccount'][_0x036e('0x6d')]({'where':{'id':_0x3267f9},'transaction':_0x467543})[_0x036e('0x22')](function(_0x2c8853){if(_0x2c8853){return db['WhatsappApplication'][_0x036e('0x35')]({'where':{'WhatsappAccountId':_0x3267f9},'transaction':_0x467543})['then'](function(){var _0x1c331a=_[_0x036e('0x3f')](_0x431617,function(_0x2d5510){_0x2d5510[_0x036e('0x66')]=_0x3267f9;return _0x2d5510;});return db['WhatsappApplication'][_0x036e('0x7b')](_0x1c331a,{'transaction':_0x467543});});}else{_0x20372b=0x194;_0x3bb9fa=[];}});})[_0x036e('0x22')](function(){if(_0x20372b!==0x194){return db[_0x036e('0x7c')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x3267f9},'order':'priority'})[_0x036e('0x22')](function(_0x30ebdd){_0x3bb9fa=_0x30ebdd;});}})[_0x036e('0x2c')](function(_0x589cc3){_0x20372b=0x1f4;logger[_0x036e('0x28')](_0x589cc3[_0x036e('0x39')]);if(_0x589cc3[_0x036e('0x3a')]){delete _0x589cc3[_0x036e('0x3a')];}_0x3bb9fa=_0x589cc3;})[_0x036e('0x7d')](function(){if(_0x3bb9fa===null){_0x12d228[_0x036e('0x2d')](_0x20372b);}else{if(_0x20372b===0x1f4){_0x12d228[_0x036e('0x38')](_0x20372b)[_0x036e('0x3b')](_0x3bb9fa);}else{_0x12d228['status'](_0x20372b)[_0x036e('0x2e')](_0x3bb9fa);}}});};exports[_0x036e('0x7e')]=function(_0x5b16a4,_0x538644,_0x14d577){var _0x1b9719={};var _0x588f03={};var _0x931e40;var _0x211f8f;return db[_0x036e('0x40')][_0x036e('0x6d')]({'where':{'id':_0x5b16a4[_0x036e('0x63')]['id']}})[_0x036e('0x22')](handleEntityNotFound(_0x538644,null))[_0x036e('0x22')](function(_0x14308d){if(_0x14308d){_0x931e40=_0x14308d;_0x588f03['model']=_[_0x036e('0x45')](db[_0x036e('0x7c')][_0x036e('0x6e')]);_0x588f03[_0x036e('0x44')]=_[_0x036e('0x45')](_0x5b16a4['query']);_0x588f03['filters']=_[_0x036e('0x47')](_0x588f03[_0x036e('0x49')],_0x588f03['query']);_0x1b9719['attributes']=_['intersection'](_0x588f03['model'],qs['fields'](_0x5b16a4[_0x036e('0x44')][_0x036e('0x4a')]));_0x1b9719[_0x036e('0x48')]=_0x1b9719[_0x036e('0x48')][_0x036e('0x4b')]?_0x1b9719[_0x036e('0x48')]:_0x588f03[_0x036e('0x49')];_0x1b9719[_0x036e('0x4e')]=qs['sort'](_0x5b16a4['query'][_0x036e('0x4f')]);_0x1b9719[_0x036e('0x50')]=qs[_0x036e('0x46')](_[_0x036e('0x51')](_0x5b16a4[_0x036e('0x44')],_0x588f03[_0x036e('0x46')]));if(_0x5b16a4['query'][_0x036e('0x52')]){_0x1b9719[_0x036e('0x50')]=_[_0x036e('0x53')](_0x1b9719['where'],{'$or':_['map'](_0x1b9719[_0x036e('0x48')],function(_0x430f1d){var _0x58ed65={};_0x58ed65[_0x430f1d]={'$like':'%'+_0x5b16a4[_0x036e('0x44')][_0x036e('0x52')]+'%'};return _0x58ed65;})});}_0x1b9719=_[_0x036e('0x53')]({},_0x1b9719,_0x5b16a4['options']);return _0x931e40[_0x036e('0x7e')](_0x1b9719);}})[_0x036e('0x22')](function(_0x4dcc50){if(_0x4dcc50){_0x211f8f=_0x4dcc50[_0x036e('0x4b')];if(!_0x5b16a4[_0x036e('0x44')]['hasOwnProperty'](_0x036e('0x4d'))){_0x1b9719[_0x036e('0x2f')]=qs[_0x036e('0x2f')](_0x5b16a4[_0x036e('0x44')][_0x036e('0x2f')]);_0x1b9719['offset']=qs[_0x036e('0x32')](_0x5b16a4[_0x036e('0x44')][_0x036e('0x32')]);}return _0x931e40[_0x036e('0x7e')](_0x1b9719);}})[_0x036e('0x22')](function(_0x4d2a55){if(_0x4d2a55){return _0x4d2a55?{'count':_0x211f8f,'rows':_0x4d2a55}:null;}})[_0x036e('0x22')](respondWithResult(_0x538644,null))['catch'](handleError(_0x538644,null));};exports[_0x036e('0x7f')]=function(_0x5abd6a,_0x20db0b,_0xe61dfc){var _0x4646f5={'channel':_0x036e('0x80')};var _0x490453=[];var _0x3aa051=[];var _0x38b970={};return db[_0x036e('0x40')][_0x036e('0x5e')]({'where':{'id':_0x5abd6a[_0x036e('0x63')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x036e('0x81')}]})[_0x036e('0x22')](handleEntityNotFound(_0x20db0b,null))[_0x036e('0x22')](function(_0x546727){_0x4646f5[_0x036e('0x82')]=_0x546727;if(_0x4646f5[_0x036e('0x82')]&&_0x4646f5[_0x036e('0x82')][_0x036e('0x42')]===_0x036e('0x83')&&_0x5abd6a['body']['statuses']){if(_0x5abd6a[_0x036e('0x5a')][_0x036e('0x84')][_0x036e('0x4b')]===0x0)return;if(_0x5abd6a['body']['statuses'][0x0][_0x036e('0x85')]!=='read')return;return db['WhatsappMessage'][_0x036e('0x86')]({'read':!![],'readAt':_0x5abd6a[_0x036e('0x5a')][_0x036e('0x84')][0x0][_0x036e('0x87')]},{'where':{'messageId':_0x5abd6a[_0x036e('0x5a')][_0x036e('0x84')][0x0][_0x036e('0x88')]},'individualHooks':!![]})[_0x036e('0x22')](function(_0x33e49d){return _0x20db0b[_0x036e('0x38')](0xc8)[_0x036e('0x2e')](_0x33e49d);});}_0x4646f5[_0x036e('0x89')]=_[_0x036e('0x8a')](_0x546727[_0x036e('0x81')],[_0x036e('0x8b')],[_0x036e('0x8c')]);if(_0x4646f5[_0x036e('0x82')][_0x036e('0x81')]){delete _0x4646f5[_0x036e('0x82')][_0x036e('0x81')];}return db[_0x036e('0x8d')]['describe']()['then'](function(_0x2eb8fb){if(!_0x2eb8fb){throw new db['Sequelize'][(_0x036e('0x8e'))](_0x036e('0x8f'));}_0x490453=_[_0x036e('0x90')](_[_0x036e('0x45')](_0x2eb8fb),['createdAt',_0x036e('0x91')]);_0x3aa051=_[_0x036e('0x90')](_[_0x036e('0x45')](_0x2eb8fb),[_0x036e('0x92'),_0x036e('0x91'),_0x036e('0x93'),_0x036e('0x94')]);_0x4646f5[_0x036e('0x5a')]={'mapKey':_0x036e('0x95')};if(_0x4646f5[_0x036e('0x82')]&&_0x4646f5[_0x036e('0x82')][_0x036e('0x42')]===_0x036e('0x96')){_0x4646f5['body'][_0x036e('0x97')]=_0x5abd6a['body']['From'][_0x036e('0x98')](_0x036e('0x99'),'');_0x4646f5[_0x036e('0x5a')]['body']=_0x5abd6a['body'][_0x036e('0x9a')];_0x4646f5['body']['messageId']=_0x5abd6a[_0x036e('0x5a')][_0x036e('0x9b')];}if(_0x4646f5[_0x036e('0x82')]&&_0x4646f5[_0x036e('0x82')][_0x036e('0x42')]===_0x036e('0x83')){_0x4646f5[_0x036e('0x5a')]['from']=_0x5abd6a[_0x036e('0x5a')][_0x036e('0x9c')][0x0]['from'];_0x4646f5[_0x036e('0x5a')]['body']=_0x5abd6a['body'][_0x036e('0x9c')][0x0][_0x036e('0x2a')][_0x036e('0x5a')];_0x4646f5[_0x036e('0x5a')]['messageId']=_0x5abd6a[_0x036e('0x5a')][_0x036e('0x9c')][0x0]['message_id'];}if(_0x4646f5[_0x036e('0x5a')]['id']){delete _0x4646f5[_0x036e('0x5a')]['id'];}if(_[_0x036e('0x9d')](_0x4646f5[_0x036e('0x5a')][_0x036e('0x97')])){throw new db['Sequelize'][(_0x036e('0x8e'))]('from\x20is\x20mandatory');}if(_[_0x036e('0x9d')](_0x4646f5['body'][_0x036e('0x5a')])||_0x4646f5[_0x036e('0x5a')][_0x036e('0x5a')]===''){throw new db[(_0x036e('0x9e'))]['ValidationError'](_0x036e('0x9f'));}if(_[_0x036e('0x9d')](_0x4646f5['body'][_0x036e('0xa0')])){throw new db[(_0x036e('0x9e'))]['ValidationError'](_0x036e('0xa1')+_0x3aa051);}if(!_['includes'](_0x3aa051,_0x4646f5[_0x036e('0x5a')]['mapKey'])){throw new db[(_0x036e('0x9e'))][(_0x036e('0x8e'))](_0x036e('0xa2')+_0x3aa051);}_0x38b970[_0x4646f5[_0x036e('0x5a')]['mapKey']]=_0x4646f5['body'][_0x036e('0x97')];return db[_0x036e('0xa3')]['find']({'where':{'id':_0x4646f5['account'][_0x036e('0x94')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x38b970,'limit':0x1,'order':[[_0x036e('0x91'),_0x036e('0xa4')]]}]});})['then'](handleEntityNotFound(_0x20db0b,null))[_0x036e('0x22')](function(_0x4bf066){if(_0x4bf066){_0x4646f5['list']=_[_0x036e('0x72')](_0x4bf066,[_0x036e('0xa5')]);if(_0x4bf066[_0x036e('0xa5')][_0x036e('0x4b')]){return _0x4bf066[_0x036e('0xa5')][0x0];}var _0x4180f1=_[_0x036e('0xa6')](_0x4646f5[_0x036e('0x5a')],{'firstName':_0x4646f5[_0x036e('0x5a')][_0x036e('0x97')],'ListId':_0x4bf066['id']});_0x4180f1[_0x4646f5[_0x036e('0x5a')]['mapKey']]=_0x4646f5[_0x036e('0x5a')][_0x036e('0x97')];return db['CmContact']['create'](_0x4180f1,{'fields':_0x490453,'raw':!![]});}})[_0x036e('0x22')](handleEntityNotFound(_0x20db0b,null))[_0x036e('0x22')](function(_0x3cfae5){if(_0x3cfae5){_0x4646f5[_0x036e('0xa7')]=_0x3cfae5;var _0x20f2a2={'ContactId':_0x3cfae5['id'],'phone':_0x4646f5[_0x036e('0x5a')][_0x036e('0x97')],'WhatsappAccountId':_0x5abd6a[_0x036e('0x63')]['id']};var _0x143306={'ContactId':_0x3cfae5['id'],'WhatsappAccountId':_0x5abd6a['params']['id'],'closed':![]};return db[_0x036e('0xa8')][_0x036e('0x5e')]({'where':_0x143306})[_0x036e('0x22')](function(_0xee524c){if(_0xee524c){return[_0xee524c,![]];}return db[_0x036e('0xa8')][_0x036e('0x59')](_0x20f2a2)[_0x036e('0x22')](function(_0x32ef96){return[_0x32ef96,!![]];});});}})[_0x036e('0x73')](function(_0x2892e5,_0x1be68c){_0x4646f5[_0x036e('0xa9')]=_0x2892e5['get']({'plain':!![]});_0x4646f5['interaction'][_0x036e('0xaa')]=![];if(_0x1be68c){if(_0x4646f5[_0x036e('0x82')]['autoclose']){_0x4646f5[_0x036e('0x89')][_0x036e('0xab')]({'id':0x0,'priority':_0x4646f5[_0x036e('0x89')]['length']+0x1,'app':_0x036e('0xac'),'appdata':'unmanaged','interval':_0x036e('0xad')});}_0x4646f5[_0x036e('0xa9')]['created']=!![];}return db[_0x036e('0xae')][_0x036e('0x59')]({'phone':_0x4646f5[_0x036e('0x5a')][_0x036e('0x97')],'messageId':_0x4646f5['body'][_0x036e('0xaf')],'body':_0x4646f5['body']['body'],'WhatsappAccountId':_0x5abd6a['params']['id'],'WhatsappInteractionId':_0x2892e5['id'],'direction':'in','ContactId':_0x2892e5[_0x036e('0xb0')],'AttachmentId':_0x4646f5[_0x036e('0x5a')][_0x036e('0xb1')]});})[_0x036e('0x22')](function(_0xf6c6fb){_0x4646f5['message']=_0xf6c6fb;if(_0x4646f5['interaction'][_0x036e('0xb2')]){return db[_0x036e('0xb3')][_0x036e('0x5e')]({'attributes':['id',_0x036e('0x3a')],'where':{'id':_0x4646f5['interaction'][_0x036e('0xb2')]}})['then'](function(_0x296088){if(_0x296088){_0x4646f5[_0x036e('0x89')][_0x036e('0xb4')]({'id':0x0,'priority':0x0,'app':_0x036e('0xb5'),'appdata':_0x296088[_0x036e('0x3a')]+','+(_0x4646f5[_0x036e('0x82')]['waitForTheAssignedAgent']||0xa),'interval':_0x036e('0xad')});}return respondWithRpcPromise(_0x036e('0xb6'),_0x036e('0xb7'),_0x4646f5);});}return respondWithRpcPromise('Start',_0x036e('0xb7'),_0x4646f5);})[_0x036e('0x22')](function(_0x1730e9){if(_0x1730e9){var _0x854977=0xc8;var _0x4bfc2f=_0x036e('0xb8');logger[_0x036e('0x23')](_0x036e('0x27'),_0x4bfc2f,_0x854977,'entity\x20found');logger[_0x036e('0x26')](_0x036e('0xb9'),_0x4bfc2f,_0x854977,_0x036e('0xba'),JSON[_0x036e('0xbb')](_0x1730e9));if(_0x4646f5['account'][_0x036e('0x42')]===_0x036e('0x96')){return _0x20db0b['status'](_0x854977)[_0x036e('0xbc')]('Content-Type',_0x036e('0xbd'))['send'](_0x036e('0xbe'));}else{return _0x20db0b[_0x036e('0x38')](_0x854977)[_0x036e('0x2e')](_0x1730e9);}}});})[_0x036e('0x2c')](handleError(_0x20db0b,null));};exports[_0x036e('0x3b')]=function(_0x12389a,_0x15f644,_0x25161f){var _0x4ac909,_0x209a90,_0x412d57;if(_[_0x036e('0x9d')](_0x12389a[_0x036e('0x5a')]['body'])||_0x12389a[_0x036e('0x5a')][_0x036e('0x5a')]===''){throw new db['Sequelize']['ValidationError'](_0x036e('0x9f'));}if(_[_0x036e('0x9d')](_0x12389a[_0x036e('0x5a')]['to'])){throw new db['Sequelize']['ValidationError']('to\x20is\x20mandatory');}_0x4ac909=_0x12389a[_0x036e('0x5a')]['to'];return db[_0x036e('0x40')]['find']({'where':{'id':_0x12389a[_0x036e('0x63')]['id']},'include':[{'model':db[_0x036e('0xa3')],'as':_0x036e('0xbf'),'include':[{'model':db[_0x036e('0x8d')],'as':_0x036e('0xa5'),'where':{'mobile':_0x4ac909},'limit':0x1,'order':[[_0x036e('0x91'),'DESC']]}]}]})[_0x036e('0x22')](handleEntityNotFound(_0x15f644,null))['then'](function(_0xd5f362){if(_0xd5f362&&_0xd5f362[_0x036e('0xbf')]){_0x209a90=_0xd5f362[_0x036e('0x36')]({'plain':!![]});if(_0x209a90[_0x036e('0xbf')]&&_0x209a90[_0x036e('0xbf')]['Contacts'][_0x036e('0x4b')]){return _0x209a90[_0x036e('0xbf')][_0x036e('0xa5')][0x0];}return db[_0x036e('0x8d')][_0x036e('0x59')](_['defaults'](_0x12389a[_0x036e('0x5a')],{'firstName':_0x4ac909,'mobile':_0x4ac909,'phone':_0x4ac909,'ListId':_0x209a90['ListId']}));}})['then'](handleEntityNotFound(_0x15f644,null))[_0x036e('0x22')](function(_0x4eed17){if(_0x4eed17){_0x412d57=_0x4eed17;return db[_0x036e('0xa8')]['find']({'where':{'ContactId':_0x412d57['id'],'closed':![],'WhatsappAccountId':_0x209a90['id']}})[_0x036e('0x22')](function(_0x2ea87b){if(_0x2ea87b){return[_0x2ea87b,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x12389a['user']['id'],'ContactId':_0x412d57['id'],'WhatsappAccountId':_0x209a90['id'],'phone':_0x4ac909,'firstMsgDirection':_0x036e('0xc0'),'Messages':[_['merge'](_0x12389a[_0x036e('0x5a')],{'read':![],'body':_0x12389a[_0x036e('0x5a')]['body'],'phone':_0x4ac909,'WhatsappAccountId':_0x209a90['id'],'UserId':_0x12389a['user']['id'],'ContactId':_0x412d57['id']})]},{'include':[{'model':db[_0x036e('0xae')],'as':_0x036e('0xc1')}]})['then'](function(_0x2168dd){return[_0x2168dd,!![]];});});}})[_0x036e('0x73')](function(_0x1e5081,_0x5e8c3f){if(_0x5e8c3f){return _0x1e5081;}return db[_0x036e('0xae')][_0x036e('0x59')](_[_0x036e('0x53')](_0x12389a[_0x036e('0x5a')],{'read':![],'body':_0x12389a[_0x036e('0x5a')]['body'],'phone':_0x4ac909,'WhatsappAccountId':_0x209a90['id'],'WhatsappInteractionId':_0x1e5081['id'],'UserId':_0x12389a[_0x036e('0x5b')]['id'],'ContactId':_0x412d57['id']}))[_0x036e('0x22')](function(_0x3513c3){_0x1e5081['dataValues']['Messages']=[];_0x1e5081['dataValues'][_0x036e('0xc1')]['push'](_0x3513c3[_0x036e('0xc2')]);return _0x1e5081;});})[_0x036e('0x22')](respondWithResult(_0x15f644,null))[_0x036e('0x2c')](handleError(_0x15f644,null));}; \ No newline at end of file +var _0x2235=['order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','describe','addDisposition','Disposition','getDispositions','findOne','WhatsappAccountId','removeDispositions','addAnswer','CannedAnswer','pick','removeAnswers','ids','addAgents','omit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','WhatsappApplication','priority','finally','getApplications','notify','whatsapp','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','orderBy','Applications','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','twilio','From','whatsapp:','MessageSid','from','notifications','messageId','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','DESC','list','Contacts','defaults','contact','WhatsappInteraction','spread','interaction','created','autoclose','push','applications','unmanaged','ContactId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','send','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','register','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','get','WhatsappAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0xa79977,_0x4f7f12){var _0x109f10=function(_0x56780f){while(--_0x56780f){_0xa79977['push'](_0xa79977['shift']());}};_0x109f10(++_0x4f7f12);}(_0x2235,0x7a));var _0x5223=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x2235[_0xf50820];return _0x2a9b10;};'use strict';var emlformat=require(_0x5223('0x0'));var rimraf=require(_0x5223('0x1'));var zipdir=require(_0x5223('0x2'));var jsonpatch=require(_0x5223('0x3'));var rp=require(_0x5223('0x4'));var moment=require(_0x5223('0x5'));var BPromise=require(_0x5223('0x6'));var Mustache=require(_0x5223('0x7'));var util=require(_0x5223('0x8'));var path=require(_0x5223('0x9'));var sox=require(_0x5223('0xa'));var csv=require(_0x5223('0xb'));var ejs=require(_0x5223('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5223('0xd'));var squel=require(_0x5223('0xe'));var crypto=require('crypto');var jsforce=require(_0x5223('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5223('0x10'));var Papa=require(_0x5223('0x11'));var Redis=require(_0x5223('0x12'));var authService=require(_0x5223('0x13'));var qs=require(_0x5223('0x14'));var as=require(_0x5223('0x15'));var hardwareService=require(_0x5223('0x16'));var logger=require(_0x5223('0x17'))('api');var utils=require(_0x5223('0x18'));var config=require(_0x5223('0x19'));var licenseUtil=require(_0x5223('0x1a'));var db=require('../../mysqldb')['db'];config[_0x5223('0x1b')]=_['defaults'](config[_0x5223('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x5223('0x1c'))(new Redis(config[_0x5223('0x1b')]));require('./whatsappAccount.socket')[_0x5223('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5223('0x1e')][_0x5223('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x2ca728,_0x4a9ebd,_0x3bb294,_0x585486){return new BPromise(function(_0x27612e,_0x4d0344){var _0x358772=_0x585486||client;return _0x358772[_0x5223('0x20')](_0x2ca728,_0x3bb294)['then'](function(_0x54d152){logger[_0x5223('0x21')](_0x5223('0x22'),_0x4a9ebd,_0x5223('0x23'));logger[_0x5223('0x24')](_0x5223('0x25'),_0x4a9ebd,'request\x20sent',JSON[_0x5223('0x26')](_0x54d152));if(_0x54d152[_0x5223('0x27')]){if(_0x54d152[_0x5223('0x27')][_0x5223('0x28')]===0x1f4){logger[_0x5223('0x27')](_0x5223('0x22'),_0x4a9ebd,_0x54d152[_0x5223('0x27')]['message']);return _0x4d0344(_0x54d152[_0x5223('0x27')][_0x5223('0x29')]);}logger[_0x5223('0x27')](_0x5223('0x22'),_0x4a9ebd,_0x54d152[_0x5223('0x27')]['message']);return _0x27612e(_0x54d152['error'][_0x5223('0x29')]);}else{logger[_0x5223('0x21')](_0x5223('0x22'),_0x4a9ebd,_0x5223('0x23'));_0x27612e(_0x54d152[_0x5223('0x2a')][_0x5223('0x29')]);}})['catch'](function(_0x1dbb1e){logger[_0x5223('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x4a9ebd,_0x1dbb1e);_0x4d0344(_0x1dbb1e);});});}function respondWithStatusCode(_0x4a0aed,_0x5f2e54){_0x5f2e54=_0x5f2e54||0xcc;return function(_0x34b4b1){if(_0x34b4b1){return _0x4a0aed[_0x5223('0x2b')](_0x5f2e54);}return _0x4a0aed[_0x5223('0x2c')](_0x5f2e54)[_0x5223('0x2d')]();};}function respondWithResult(_0xc06553,_0x3552be){_0x3552be=_0x3552be||0xc8;return function(_0x379874){if(_0x379874){return _0xc06553[_0x5223('0x2c')](_0x3552be)[_0x5223('0x2e')](_0x379874);}};}function respondWithFilteredResult(_0x222f10,_0xed9f58){return function(_0x12a8ce){if(_0x12a8ce){var _0x1954ca=typeof _0xed9f58[_0x5223('0x2f')]===_0x5223('0x30')&&typeof _0xed9f58[_0x5223('0x31')]==='undefined';var _0x3cac75=_0x12a8ce[_0x5223('0x32')];var _0x3f571d=_0x1954ca?0x0:_0xed9f58['offset'];var _0x40ce98=_0x1954ca?_0x12a8ce[_0x5223('0x32')]:_0xed9f58[_0x5223('0x2f')]+_0xed9f58['limit'];var _0x36bd09;if(_0x40ce98>=_0x3cac75){_0x40ce98=_0x3cac75;_0x36bd09=0xc8;}else{_0x36bd09=0xce;}_0x222f10[_0x5223('0x2c')](_0x36bd09);return _0x222f10[_0x5223('0x33')]('Content-Range',_0x3f571d+'-'+_0x40ce98+'/'+_0x3cac75)[_0x5223('0x2e')](_0x12a8ce);}return null;};}function patchUpdates(_0x11c3d4){return function(_0x269447){try{jsonpatch[_0x5223('0x34')](_0x269447,_0x11c3d4,!![]);}catch(_0x20335d){return BPromise[_0x5223('0x35')](_0x20335d);}return _0x269447[_0x5223('0x36')]();};}function saveUpdates(_0x2f6451,_0x2369f3){return function(_0x89f5cb){if(_0x89f5cb){return _0x89f5cb['update'](_0x2f6451)[_0x5223('0x37')](function(_0x1f1c8c){return _0x1f1c8c;});}return null;};}function removeEntity(_0x23b12,_0x536091){return function(_0xa7c9ac){if(_0xa7c9ac){return _0xa7c9ac['destroy']()['then'](function(){var _0x500bd3=_0xa7c9ac[_0x5223('0x38')]({'plain':!![]});var _0x30bb26=_0x5223('0x39');return db[_0x5223('0x3a')]['destroy']({'where':{'type':_0x30bb26,'resourceId':_0x500bd3['id']}})['then'](function(){return _0xa7c9ac;});})[_0x5223('0x37')](function(){_0x23b12[_0x5223('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c9799,_0xdafee4){return function(_0x5b2783){if(!_0x5b2783){_0x3c9799[_0x5223('0x2b')](0x194);}return _0x5b2783;};}function handleError(_0x43a7c9,_0x8424e3){_0x8424e3=_0x8424e3||0x1f4;return function(_0x47e16b){logger['error'](_0x47e16b[_0x5223('0x3b')]);if(_0x47e16b[_0x5223('0x3c')]){delete _0x47e16b[_0x5223('0x3c')];}_0x43a7c9[_0x5223('0x2c')](_0x8424e3)['send'](_0x47e16b);};}exports[_0x5223('0x3d')]=function(_0x745416,_0x4471cb){var _0x3dee59={'include':[{'model':db[_0x5223('0x3e')],'as':_0x5223('0x3f')}]},_0x3752db={},_0x2ce5d9={'count':0x0,'rows':[]};var _0x53c1e2=_[_0x5223('0x40')](db[_0x5223('0x41')][_0x5223('0x42')],function(_0x5aeaa1){return{'name':_0x5aeaa1[_0x5223('0x43')],'type':_0x5aeaa1[_0x5223('0x44')][_0x5223('0x45')]};});_0x3752db['model']=_[_0x5223('0x40')](_0x53c1e2,_0x5223('0x3c'));_0x3752db[_0x5223('0x46')]=_['keys'](_0x745416[_0x5223('0x46')]);_0x3752db[_0x5223('0x47')]=_[_0x5223('0x48')](_0x3752db[_0x5223('0x49')],_0x3752db[_0x5223('0x46')]);_0x3dee59['attributes']=_[_0x5223('0x48')](_0x3752db[_0x5223('0x49')],qs[_0x5223('0x4a')](_0x745416['query'][_0x5223('0x4a')]));_0x3dee59[_0x5223('0x4b')]=_0x3dee59[_0x5223('0x4b')][_0x5223('0x4c')]?_0x3dee59['attributes']:_0x3752db[_0x5223('0x49')];if(!_0x745416[_0x5223('0x46')][_0x5223('0x4d')](_0x5223('0x4e'))){_0x3dee59[_0x5223('0x31')]=qs['limit'](_0x745416[_0x5223('0x46')][_0x5223('0x31')]);_0x3dee59['offset']=qs['offset'](_0x745416['query'][_0x5223('0x2f')]);}_0x3dee59[_0x5223('0x4f')]=qs[_0x5223('0x50')](_0x745416[_0x5223('0x46')][_0x5223('0x50')]);_0x3dee59[_0x5223('0x51')]=qs[_0x5223('0x47')](_['pick'](_0x745416['query'],_0x3752db[_0x5223('0x47')]),_0x53c1e2);if(_0x745416[_0x5223('0x46')][_0x5223('0x52')]){_0x3dee59['where']=_[_0x5223('0x53')](_0x3dee59[_0x5223('0x51')],{'$or':_[_0x5223('0x40')](_0x53c1e2,function(_0x33f6fd){if(_0x33f6fd[_0x5223('0x44')]!==_0x5223('0x54')){var _0x5ab217={};_0x5ab217[_0x33f6fd[_0x5223('0x3c')]]={'$like':'%'+_0x745416[_0x5223('0x46')]['filter']+'%'};return _0x5ab217;}})});}_0x3dee59=_[_0x5223('0x53')]({},_0x3dee59,_0x745416[_0x5223('0x55')]);var _0x450e5d={'where':_0x3dee59[_0x5223('0x51')]};return db[_0x5223('0x41')][_0x5223('0x32')](_0x450e5d)[_0x5223('0x37')](function(_0x14107e){_0x2ce5d9[_0x5223('0x32')]=_0x14107e;if(_0x745416[_0x5223('0x46')][_0x5223('0x56')]){_0x3dee59[_0x5223('0x57')]=[{'all':!![]}];}return db[_0x5223('0x41')][_0x5223('0x58')](_0x3dee59);})['then'](function(_0x4a0c93){_0x2ce5d9[_0x5223('0x59')]=_0x4a0c93;return _0x2ce5d9;})[_0x5223('0x37')](respondWithFilteredResult(_0x4471cb,_0x3dee59))['catch'](handleError(_0x4471cb,null));};exports['show']=function(_0x7dbaa9,_0x585e7a){var _0x333ce9={'raw':![],'where':{'id':_0x7dbaa9[_0x5223('0x5a')]['id']},'include':[{'model':db[_0x5223('0x3e')],'as':_0x5223('0x3f')}]},_0x403384={};_0x403384[_0x5223('0x49')]=_[_0x5223('0x5b')](db[_0x5223('0x41')][_0x5223('0x42')]);_0x403384['query']=_[_0x5223('0x5b')](_0x7dbaa9[_0x5223('0x46')]);_0x403384[_0x5223('0x47')]=_[_0x5223('0x48')](_0x403384['model'],_0x403384[_0x5223('0x46')]);_0x333ce9[_0x5223('0x4b')]=_[_0x5223('0x48')](_0x403384[_0x5223('0x49')],qs[_0x5223('0x4a')](_0x7dbaa9[_0x5223('0x46')][_0x5223('0x4a')]));_0x333ce9['attributes']=_0x333ce9[_0x5223('0x4b')][_0x5223('0x4c')]?_0x333ce9[_0x5223('0x4b')]:_0x403384[_0x5223('0x49')];if(_0x7dbaa9[_0x5223('0x46')][_0x5223('0x56')]){_0x333ce9[_0x5223('0x57')]=[{'all':!![]}];}_0x333ce9=_[_0x5223('0x53')]({},_0x333ce9,_0x7dbaa9[_0x5223('0x55')]);return db['WhatsappAccount']['find'](_0x333ce9)['then'](handleEntityNotFound(_0x585e7a,null))[_0x5223('0x37')](respondWithResult(_0x585e7a,null))[_0x5223('0x5c')](handleError(_0x585e7a,null));};exports[_0x5223('0x5d')]=function(_0x4d14a8,_0x499f4a){return db[_0x5223('0x41')]['create'](_0x4d14a8['body'],{})[_0x5223('0x37')](function(_0x34c584){var _0x14684a=_0x4d14a8[_0x5223('0x5e')][_0x5223('0x38')]({'plain':!![]});if(!_0x14684a)throw new Error(_0x5223('0x5f'));if(_0x14684a[_0x5223('0x60')]==='user'){var _0x145a63=_0x34c584[_0x5223('0x38')]({'plain':!![]});var _0x50cef4=_0x5223('0x39');return db['UserProfileSection'][_0x5223('0x61')]({'where':{'name':_0x50cef4,'userProfileId':_0x14684a[_0x5223('0x62')]},'raw':!![]})[_0x5223('0x37')](function(_0x3cc7fb){if(_0x3cc7fb&&_0x3cc7fb[_0x5223('0x63')]===0x0){return db['UserProfileResource']['create']({'name':_0x145a63[_0x5223('0x3c')],'resourceId':_0x145a63['id'],'type':_0x3cc7fb[_0x5223('0x3c')],'sectionId':_0x3cc7fb['id']},{})[_0x5223('0x37')](function(){return _0x34c584;});}else{return _0x34c584;}})[_0x5223('0x5c')](function(_0x32e14c){logger[_0x5223('0x27')](_0x5223('0x64'),_0x32e14c);throw _0x32e14c;});}return _0x34c584;})['then'](respondWithResult(_0x499f4a,0xc9))['catch'](handleError(_0x499f4a,null));};exports[_0x5223('0x65')]=function(_0x113376,_0x3ea470){if(_0x113376['body']['id']){delete _0x113376[_0x5223('0x66')]['id'];}return db[_0x5223('0x41')]['find']({'where':{'id':_0x113376[_0x5223('0x5a')]['id']},'include':[{'model':db[_0x5223('0x3e')],'as':_0x5223('0x3f')}]})[_0x5223('0x37')](handleEntityNotFound(_0x3ea470,null))[_0x5223('0x37')](saveUpdates(_0x113376[_0x5223('0x66')],null))[_0x5223('0x37')](respondWithResult(_0x3ea470,null))[_0x5223('0x5c')](handleError(_0x3ea470,null));};exports[_0x5223('0x67')]=function(_0xdd50c0,_0x5e5301){return db['WhatsappAccount'][_0x5223('0x61')]({'where':{'id':_0xdd50c0[_0x5223('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5e5301,null))[_0x5223('0x37')](removeEntity(_0x5e5301,null))[_0x5223('0x5c')](handleError(_0x5e5301,null));};exports[_0x5223('0x68')]=function(_0x1d874c,_0x3d7b12){return db[_0x5223('0x41')][_0x5223('0x68')]()[_0x5223('0x37')](respondWithResult(_0x3d7b12,null))[_0x5223('0x5c')](handleError(_0x3d7b12,null));};exports[_0x5223('0x69')]=function(_0x2eae99,_0x44c31d,_0x21c920){if(_0x2eae99[_0x5223('0x66')]['id']){delete _0x2eae99['body']['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x2eae99['params']['id']}})['then'](handleEntityNotFound(_0x44c31d,null))[_0x5223('0x37')](function(_0x506be0){if(_0x506be0){_0x2eae99['body']['WhatsappAccountId']=_0x506be0['id'];return db[_0x5223('0x6a')][_0x5223('0x5d')](_0x2eae99[_0x5223('0x66')]);}})[_0x5223('0x37')](respondWithResult(_0x44c31d,null))[_0x5223('0x5c')](handleError(_0x44c31d,null));};exports[_0x5223('0x6b')]=function(_0x5e7eb8,_0x5d0d68,_0x118847){var _0x305bef={'raw':![],'where':{}};var _0x389ce3={};var _0x1629db={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x5223('0x6c')]({'where':{'id':_0x5e7eb8[_0x5223('0x5a')]['id']}})[_0x5223('0x37')](handleEntityNotFound(_0x5d0d68,null))[_0x5223('0x37')](function(_0x4727f3){if(_0x4727f3){_0x389ce3[_0x5223('0x49')]=_['keys'](db['Disposition'][_0x5223('0x42')]);_0x389ce3[_0x5223('0x46')]=_[_0x5223('0x5b')](_0x5e7eb8['query']);_0x389ce3[_0x5223('0x47')]=_[_0x5223('0x48')](_0x389ce3[_0x5223('0x49')],_0x389ce3[_0x5223('0x46')]);_0x305bef['attributes']=_['intersection'](_0x389ce3[_0x5223('0x49')],qs['fields'](_0x5e7eb8[_0x5223('0x46')]['fields']));_0x305bef[_0x5223('0x4b')]=_0x305bef[_0x5223('0x4b')][_0x5223('0x4c')]?_0x305bef[_0x5223('0x4b')]:_0x389ce3[_0x5223('0x49')];if(!_0x5e7eb8['query']['hasOwnProperty'](_0x5223('0x4e'))){_0x305bef['limit']=qs['limit'](_0x5e7eb8[_0x5223('0x46')][_0x5223('0x31')]);_0x305bef[_0x5223('0x2f')]=qs[_0x5223('0x2f')](_0x5e7eb8[_0x5223('0x46')][_0x5223('0x2f')]);}_0x305bef[_0x5223('0x4f')]=qs['sort'](_0x5e7eb8['query'][_0x5223('0x50')]);_0x305bef[_0x5223('0x51')]=qs[_0x5223('0x47')](_['pick'](_0x5e7eb8[_0x5223('0x46')],_0x389ce3[_0x5223('0x47')]));_0x305bef[_0x5223('0x51')][_0x5223('0x6d')]=_0x4727f3['id'];if(_0x5e7eb8[_0x5223('0x46')][_0x5223('0x52')]){_0x305bef[_0x5223('0x51')]=_[_0x5223('0x53')](_0x305bef[_0x5223('0x51')],{'$or':_[_0x5223('0x40')](_0x305bef['attributes'],function(_0x31a81a){var _0xaf2993={};_0xaf2993[_0x31a81a]={'$like':'%'+_0x5e7eb8[_0x5223('0x46')][_0x5223('0x52')]+'%'};return _0xaf2993;})});}_0x305bef=_['merge']({},_0x305bef,_0x5e7eb8[_0x5223('0x55')]);return db['Disposition'][_0x5223('0x32')]({'where':_0x305bef[_0x5223('0x51')]})[_0x5223('0x37')](function(_0x2d7fe1){_0x1629db['count']=_0x2d7fe1;if(_0x5e7eb8[_0x5223('0x46')][_0x5223('0x56')]){_0x305bef[_0x5223('0x57')]=[{'all':!![]}];}return db[_0x5223('0x6a')][_0x5223('0x58')](_0x305bef);})[_0x5223('0x37')](function(_0x156d4c){_0x1629db[_0x5223('0x59')]=_0x156d4c;return _0x1629db;});}})[_0x5223('0x37')](respondWithFilteredResult(_0x5d0d68,_0x305bef))['catch'](handleError(_0x5d0d68,null));};exports[_0x5223('0x6e')]=function(_0x50af89,_0x398e1f,_0x4b8135){return db[_0x5223('0x41')][_0x5223('0x61')]({'where':{'id':_0x50af89[_0x5223('0x5a')]['id']}})['then'](handleEntityNotFound(_0x398e1f,null))[_0x5223('0x37')](function(_0x54a025){if(_0x54a025){return _0x54a025[_0x5223('0x6e')](_0x50af89[_0x5223('0x46')]['ids']);}})['then'](respondWithStatusCode(_0x398e1f,null))[_0x5223('0x5c')](handleError(_0x398e1f,null));};exports[_0x5223('0x6f')]=function(_0x519be4,_0x59c6e2,_0x50f910){if(_0x519be4[_0x5223('0x66')]['id']){delete _0x519be4[_0x5223('0x66')]['id'];}return db[_0x5223('0x41')][_0x5223('0x61')]({'where':{'id':_0x519be4[_0x5223('0x5a')]['id']}})['then'](handleEntityNotFound(_0x59c6e2,null))['then'](function(_0x43d294){if(_0x43d294){_0x519be4[_0x5223('0x66')][_0x5223('0x6d')]=_0x43d294['id'];return db[_0x5223('0x70')][_0x5223('0x5d')](_0x519be4['body']);}})[_0x5223('0x37')](respondWithResult(_0x59c6e2,null))['catch'](handleError(_0x59c6e2,null));};exports['getAnswers']=function(_0x128f31,_0x4aaa31,_0x327d55){var _0x564259={'raw':![],'where':{}};var _0x494408={};var _0x1472ef={'count':0x0,'rows':[]};return db[_0x5223('0x41')][_0x5223('0x6c')]({'where':{'id':_0x128f31[_0x5223('0x5a')]['id']}})[_0x5223('0x37')](handleEntityNotFound(_0x4aaa31,null))[_0x5223('0x37')](function(_0xe2bd50){if(_0xe2bd50){_0x494408[_0x5223('0x49')]=_['keys'](db[_0x5223('0x70')]['rawAttributes']);_0x494408[_0x5223('0x46')]=_[_0x5223('0x5b')](_0x128f31['query']);_0x494408[_0x5223('0x47')]=_[_0x5223('0x48')](_0x494408['model'],_0x494408[_0x5223('0x46')]);_0x564259['attributes']=_[_0x5223('0x48')](_0x494408['model'],qs[_0x5223('0x4a')](_0x128f31[_0x5223('0x46')][_0x5223('0x4a')]));_0x564259[_0x5223('0x4b')]=_0x564259[_0x5223('0x4b')]['length']?_0x564259['attributes']:_0x494408[_0x5223('0x49')];if(!_0x128f31['query'][_0x5223('0x4d')](_0x5223('0x4e'))){_0x564259['limit']=qs[_0x5223('0x31')](_0x128f31[_0x5223('0x46')][_0x5223('0x31')]);_0x564259[_0x5223('0x2f')]=qs[_0x5223('0x2f')](_0x128f31[_0x5223('0x46')]['offset']);}_0x564259['order']=qs[_0x5223('0x50')](_0x128f31['query']['sort']);_0x564259[_0x5223('0x51')]=qs['filters'](_[_0x5223('0x71')](_0x128f31['query'],_0x494408[_0x5223('0x47')]));_0x564259[_0x5223('0x51')][_0x5223('0x6d')]=_0xe2bd50['id'];if(_0x128f31[_0x5223('0x46')][_0x5223('0x52')]){_0x564259[_0x5223('0x51')]=_['merge'](_0x564259[_0x5223('0x51')],{'$or':_[_0x5223('0x40')](_0x564259[_0x5223('0x4b')],function(_0x348892){var _0x267b0f={};_0x267b0f[_0x348892]={'$like':'%'+_0x128f31[_0x5223('0x46')][_0x5223('0x52')]+'%'};return _0x267b0f;})});}_0x564259=_[_0x5223('0x53')]({},_0x564259,_0x128f31[_0x5223('0x55')]);return db[_0x5223('0x70')][_0x5223('0x32')]({'where':_0x564259[_0x5223('0x51')]})[_0x5223('0x37')](function(_0x2904f3){_0x1472ef['count']=_0x2904f3;if(_0x128f31['query'][_0x5223('0x56')]){_0x564259[_0x5223('0x57')]=[{'all':!![]}];}return db[_0x5223('0x70')][_0x5223('0x58')](_0x564259);})[_0x5223('0x37')](function(_0x1cdb3a){_0x1472ef['rows']=_0x1cdb3a;return _0x1472ef;});}})[_0x5223('0x37')](respondWithFilteredResult(_0x4aaa31,_0x564259))['catch'](handleError(_0x4aaa31,null));};exports[_0x5223('0x72')]=function(_0x1fcdc8,_0x1819f2,_0x23ee7d){return db[_0x5223('0x41')][_0x5223('0x61')]({'where':{'id':_0x1fcdc8[_0x5223('0x5a')]['id']}})[_0x5223('0x37')](handleEntityNotFound(_0x1819f2,null))[_0x5223('0x37')](function(_0x1653d9){if(_0x1653d9){return _0x1653d9[_0x5223('0x72')](_0x1fcdc8['query'][_0x5223('0x73')]);}})[_0x5223('0x37')](respondWithStatusCode(_0x1819f2,null))[_0x5223('0x5c')](handleError(_0x1819f2,null));};exports[_0x5223('0x74')]=function(_0x146a2,_0x493703,_0x1c3570){return db['WhatsappAccount'][_0x5223('0x61')]({'where':{'id':_0x146a2[_0x5223('0x5a')]['id']}})[_0x5223('0x37')](handleEntityNotFound(_0x493703,null))[_0x5223('0x37')](function(_0x3cad4){if(_0x3cad4){return _0x3cad4[_0x5223('0x74')](_0x146a2['body'][_0x5223('0x73')],_[_0x5223('0x75')](_0x146a2['body'],[_0x5223('0x73'),'id'])||{})['spread'](function(_0x26512c){for(var _0x3d995a=0x0;_0x3d995a<_0x146a2[_0x5223('0x66')][_0x5223('0x73')][_0x5223('0x4c')];_0x3d995a+=0x1){socket['emit'](_0x5223('0x76'),{'UserId':Number(_0x146a2[_0x5223('0x66')]['ids'][_0x3d995a]),'WhatsappAccountId':Number(_0x146a2[_0x5223('0x5a')]['id'])});}return _0x26512c;});}})[_0x5223('0x37')](respondWithResult(_0x493703,null))['catch'](handleError(_0x493703,null));};exports[_0x5223('0x77')]=function(_0x2219a5,_0x24e769,_0x562e39){return db[_0x5223('0x41')]['find']({'where':{'id':_0x2219a5[_0x5223('0x5a')]['id']}})[_0x5223('0x37')](handleEntityNotFound(_0x24e769,null))[_0x5223('0x37')](function(_0xca426b){if(_0xca426b){return _0xca426b['removeAgents'](_0x2219a5[_0x5223('0x46')][_0x5223('0x73')])[_0x5223('0x37')](function(){if(_[_0x5223('0x78')](_0x2219a5[_0x5223('0x46')][_0x5223('0x73')])){for(var _0x585a0e=0x0;_0x585a0e<_0x2219a5['query'][_0x5223('0x73')][_0x5223('0x4c')];_0x585a0e+=0x1){socket['emit'](_0x5223('0x79'),{'UserId':Number(_0x2219a5[_0x5223('0x46')][_0x5223('0x73')][_0x585a0e]),'WhatsappAccountId':Number(_0x2219a5['params']['id'])});}}else{socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x2219a5[_0x5223('0x46')][_0x5223('0x73')]),'WhatsappAccountId':Number(_0x2219a5[_0x5223('0x5a')]['id'])});}});}})[_0x5223('0x37')](respondWithStatusCode(_0x24e769,null))[_0x5223('0x5c')](handleError(_0x24e769,null));};exports[_0x5223('0x7a')]=function(_0x12ac45,_0x12f406,_0x1aaa21){var _0x5a984d={};var _0x467d32={};var _0x28a53d;var _0x3f73b2;return db['WhatsappAccount'][_0x5223('0x6c')]({'where':{'id':_0x12ac45[_0x5223('0x5a')]['id']}})['then'](handleEntityNotFound(_0x12f406,null))[_0x5223('0x37')](function(_0x24ed0e){if(_0x24ed0e){_0x28a53d=_0x24ed0e;_0x467d32[_0x5223('0x49')]=_[_0x5223('0x5b')](db[_0x5223('0x7b')][_0x5223('0x42')]);_0x467d32['query']=_[_0x5223('0x5b')](_0x12ac45['query']);_0x467d32[_0x5223('0x47')]=_[_0x5223('0x48')](_0x467d32['model'],_0x467d32[_0x5223('0x46')]);_0x5a984d['attributes']=_[_0x5223('0x48')](_0x467d32[_0x5223('0x49')],qs[_0x5223('0x4a')](_0x12ac45[_0x5223('0x46')][_0x5223('0x4a')]));_0x5a984d['attributes']=_0x5a984d[_0x5223('0x4b')][_0x5223('0x4c')]?_0x5a984d[_0x5223('0x4b')]:_0x467d32['model'];_0x5a984d[_0x5223('0x4f')]=qs[_0x5223('0x50')](_0x12ac45[_0x5223('0x46')][_0x5223('0x50')]);_0x5a984d[_0x5223('0x51')]=qs[_0x5223('0x47')](_[_0x5223('0x71')](_0x12ac45[_0x5223('0x46')],_0x467d32[_0x5223('0x47')]));if(_0x12ac45[_0x5223('0x46')][_0x5223('0x52')]){_0x5a984d['where']=_[_0x5223('0x53')](_0x5a984d[_0x5223('0x51')],{'$or':_['map'](_0x5a984d['attributes'],function(_0x378b90){var _0xe23df7={};_0xe23df7[_0x378b90]={'$like':'%'+_0x12ac45[_0x5223('0x46')]['filter']+'%'};return _0xe23df7;})});}_0x5a984d=_[_0x5223('0x53')]({},_0x5a984d,_0x12ac45['options']);return _0x28a53d[_0x5223('0x7a')](_0x5a984d);}})[_0x5223('0x37')](function(_0x50a2e8){if(_0x50a2e8){_0x3f73b2=_0x50a2e8[_0x5223('0x4c')];if(!_0x12ac45['query'][_0x5223('0x4d')](_0x5223('0x4e'))){_0x5a984d[_0x5223('0x31')]=qs[_0x5223('0x31')](_0x12ac45[_0x5223('0x46')][_0x5223('0x31')]);_0x5a984d['offset']=qs[_0x5223('0x2f')](_0x12ac45['query'][_0x5223('0x2f')]);}return _0x28a53d[_0x5223('0x7a')](_0x5a984d);}})[_0x5223('0x37')](function(_0x2a37d9){if(_0x2a37d9){return _0x2a37d9?{'count':_0x3f73b2,'rows':_0x2a37d9}:null;}})['then'](respondWithResult(_0x12f406,null))[_0x5223('0x5c')](handleError(_0x12f406,null));};exports[_0x5223('0x7c')]=function(_0x25cf09,_0x49ea64){var _0x4dc732=_0x25cf09['params']['id'];var _0x53c096=_0x25cf09[_0x5223('0x66')];var _0x2201a1=0xc8;var _0x5332a8=null;return db[_0x5223('0x7d')][_0x5223('0x7e')]({'isolationLevel':db[_0x5223('0x7d')]['Transaction'][_0x5223('0x7f')][_0x5223('0x80')]},function(_0x258684){return db['WhatsappAccount'][_0x5223('0x6c')]({'where':{'id':_0x4dc732},'transaction':_0x258684})[_0x5223('0x37')](function(_0x417558){if(_0x417558){return db['WhatsappApplication'][_0x5223('0x67')]({'where':{'WhatsappAccountId':_0x4dc732},'transaction':_0x258684})['then'](function(){var _0x1ddcda=_[_0x5223('0x40')](_0x53c096,function(_0x4a81c9){_0x4a81c9['WhatsappAccountId']=_0x4dc732;return _0x4a81c9;});return db['WhatsappApplication'][_0x5223('0x81')](_0x1ddcda,{'transaction':_0x258684});});}else{_0x2201a1=0x194;_0x5332a8=[];}});})['then'](function(){if(_0x2201a1!==0x194){return db[_0x5223('0x82')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x4dc732},'order':_0x5223('0x83')})[_0x5223('0x37')](function(_0x29b3e0){_0x5332a8=_0x29b3e0;});}})[_0x5223('0x5c')](function(_0x2c21aa){_0x2201a1=0x1f4;logger[_0x5223('0x27')](_0x2c21aa['stack']);if(_0x2c21aa[_0x5223('0x3c')]){delete _0x2c21aa[_0x5223('0x3c')];}_0x5332a8=_0x2c21aa;})[_0x5223('0x84')](function(){if(_0x5332a8===null){_0x49ea64[_0x5223('0x2b')](_0x2201a1);}else{if(_0x2201a1===0x1f4){_0x49ea64[_0x5223('0x2c')](_0x2201a1)['send'](_0x5332a8);}else{_0x49ea64[_0x5223('0x2c')](_0x2201a1)[_0x5223('0x2e')](_0x5332a8);}}});};exports[_0x5223('0x85')]=function(_0x5091e8,_0x47a5a9,_0x4f4217){var _0x4a68b9={};var _0xaab9ae={};var _0x1a818d;var _0x248b4c;return db[_0x5223('0x41')][_0x5223('0x6c')]({'where':{'id':_0x5091e8[_0x5223('0x5a')]['id']}})[_0x5223('0x37')](handleEntityNotFound(_0x47a5a9,null))[_0x5223('0x37')](function(_0x481168){if(_0x481168){_0x1a818d=_0x481168;_0xaab9ae[_0x5223('0x49')]=_[_0x5223('0x5b')](db[_0x5223('0x82')][_0x5223('0x42')]);_0xaab9ae[_0x5223('0x46')]=_[_0x5223('0x5b')](_0x5091e8[_0x5223('0x46')]);_0xaab9ae[_0x5223('0x47')]=_['intersection'](_0xaab9ae['model'],_0xaab9ae[_0x5223('0x46')]);_0x4a68b9['attributes']=_[_0x5223('0x48')](_0xaab9ae['model'],qs[_0x5223('0x4a')](_0x5091e8[_0x5223('0x46')][_0x5223('0x4a')]));_0x4a68b9[_0x5223('0x4b')]=_0x4a68b9['attributes'][_0x5223('0x4c')]?_0x4a68b9[_0x5223('0x4b')]:_0xaab9ae[_0x5223('0x49')];_0x4a68b9[_0x5223('0x4f')]=qs[_0x5223('0x50')](_0x5091e8[_0x5223('0x46')]['sort']);_0x4a68b9[_0x5223('0x51')]=qs[_0x5223('0x47')](_[_0x5223('0x71')](_0x5091e8[_0x5223('0x46')],_0xaab9ae[_0x5223('0x47')]));if(_0x5091e8[_0x5223('0x46')]['filter']){_0x4a68b9[_0x5223('0x51')]=_['merge'](_0x4a68b9['where'],{'$or':_['map'](_0x4a68b9[_0x5223('0x4b')],function(_0x33ce54){var _0x440c7a={};_0x440c7a[_0x33ce54]={'$like':'%'+_0x5091e8['query'][_0x5223('0x52')]+'%'};return _0x440c7a;})});}_0x4a68b9=_[_0x5223('0x53')]({},_0x4a68b9,_0x5091e8['options']);return _0x1a818d[_0x5223('0x85')](_0x4a68b9);}})[_0x5223('0x37')](function(_0x5437b7){if(_0x5437b7){_0x248b4c=_0x5437b7[_0x5223('0x4c')];if(!_0x5091e8[_0x5223('0x46')][_0x5223('0x4d')](_0x5223('0x4e'))){_0x4a68b9[_0x5223('0x31')]=qs[_0x5223('0x31')](_0x5091e8[_0x5223('0x46')][_0x5223('0x31')]);_0x4a68b9[_0x5223('0x2f')]=qs[_0x5223('0x2f')](_0x5091e8[_0x5223('0x46')]['offset']);}return _0x1a818d['getApplications'](_0x4a68b9);}})[_0x5223('0x37')](function(_0xd8004b){if(_0xd8004b){return _0xd8004b?{'count':_0x248b4c,'rows':_0xd8004b}:null;}})[_0x5223('0x37')](respondWithResult(_0x47a5a9,null))['catch'](handleError(_0x47a5a9,null));};exports[_0x5223('0x86')]=function(_0x1ebc1b,_0x1759e0,_0x258599){var _0x29b355={'channel':_0x5223('0x87')};var _0xd6bbd6=[];var _0x20d712=[];var _0x5d111e={};return db['WhatsappAccount'][_0x5223('0x61')]({'where':{'id':_0x1ebc1b[_0x5223('0x5a')]['id']},'include':[{'model':db[_0x5223('0x82')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x1759e0,null))[_0x5223('0x37')](function(_0x533f0f){_0x29b355[_0x5223('0x88')]=_0x533f0f;if(_0x29b355[_0x5223('0x88')]&&_0x29b355[_0x5223('0x88')]['type']===_0x5223('0x89')&&_0x1ebc1b[_0x5223('0x66')][_0x5223('0x8a')]){if(_0x1ebc1b[_0x5223('0x66')][_0x5223('0x8a')][_0x5223('0x4c')]===0x0)return;if(_0x1ebc1b[_0x5223('0x66')]['statuses'][0x0][_0x5223('0x8b')]!==_0x5223('0x8c'))return;return db[_0x5223('0x8d')][_0x5223('0x65')]({'read':!![],'readAt':_0x1ebc1b[_0x5223('0x66')][_0x5223('0x8a')][0x0][_0x5223('0x8e')]},{'where':{'messageId':_0x1ebc1b[_0x5223('0x66')][_0x5223('0x8a')][0x0][_0x5223('0x8f')]},'individualHooks':!![]})[_0x5223('0x37')](function(_0x547e5e){return _0x1759e0['status'](0xc8)['json'](_0x547e5e);});}_0x29b355['applications']=_[_0x5223('0x90')](_0x533f0f[_0x5223('0x91')],[_0x5223('0x83')],[_0x5223('0x92')]);if(_0x29b355[_0x5223('0x88')][_0x5223('0x91')]){delete _0x29b355[_0x5223('0x88')]['Applications'];}return db[_0x5223('0x93')][_0x5223('0x68')]()[_0x5223('0x37')](function(_0x4830c4){if(!_0x4830c4){throw new db[(_0x5223('0x94'))][(_0x5223('0x95'))]('no\x20available\x20attributes');}_0xd6bbd6=_[_0x5223('0x96')](_[_0x5223('0x5b')](_0x4830c4),[_0x5223('0x97'),_0x5223('0x98')]);_0x20d712=_[_0x5223('0x96')](_[_0x5223('0x5b')](_0x4830c4),[_0x5223('0x97'),_0x5223('0x98'),_0x5223('0x99'),_0x5223('0x9a')]);_0x29b355[_0x5223('0x66')]={'mapKey':'mobile'};if(_0x29b355['account']&&_0x29b355[_0x5223('0x88')][_0x5223('0x44')]===_0x5223('0x9b')){_0x29b355['body']['from']=_0x1ebc1b[_0x5223('0x66')][_0x5223('0x9c')]['replace'](_0x5223('0x9d'),'');_0x29b355[_0x5223('0x66')][_0x5223('0x66')]=_0x1ebc1b[_0x5223('0x66')]['Body'];_0x29b355['body']['messageId']=_0x1ebc1b['body'][_0x5223('0x9e')];}if(_0x29b355[_0x5223('0x88')]&&_0x29b355['account'][_0x5223('0x44')]==='sinch'){_0x29b355['body'][_0x5223('0x9f')]=_0x1ebc1b[_0x5223('0x66')][_0x5223('0xa0')][0x0][_0x5223('0x9f')];_0x29b355[_0x5223('0x66')][_0x5223('0x66')]=_0x1ebc1b[_0x5223('0x66')]['notifications'][0x0][_0x5223('0x29')]['body'];_0x29b355[_0x5223('0x66')][_0x5223('0xa1')]=_0x1ebc1b[_0x5223('0x66')]['notifications'][0x0][_0x5223('0x8f')];}if(_0x29b355[_0x5223('0x66')]['id']){delete _0x29b355[_0x5223('0x66')]['id'];}if(_['isNil'](_0x29b355[_0x5223('0x66')]['from'])){throw new db[(_0x5223('0x94'))]['ValidationError'](_0x5223('0xa2'));}if(_[_0x5223('0xa3')](_0x29b355['body'][_0x5223('0x66')])||_0x29b355[_0x5223('0x66')][_0x5223('0x66')]===''){throw new db[(_0x5223('0x94'))][(_0x5223('0x95'))](_0x5223('0xa4'));}if(_['isNil'](_0x29b355[_0x5223('0x66')]['mapKey'])){throw new db[(_0x5223('0x94'))][(_0x5223('0x95'))](_0x5223('0xa5')+_0x20d712);}if(!_[_0x5223('0xa6')](_0x20d712,_0x29b355[_0x5223('0x66')][_0x5223('0xa7')])){throw new db[(_0x5223('0x94'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x20d712);}_0x5d111e[_0x29b355[_0x5223('0x66')][_0x5223('0xa7')]]=_0x29b355[_0x5223('0x66')][_0x5223('0x9f')];return db[_0x5223('0xa8')][_0x5223('0x61')]({'where':{'id':_0x29b355[_0x5223('0x88')][_0x5223('0x9a')]},'include':[{'model':db[_0x5223('0x93')],'as':'Contacts','where':_0x5d111e,'limit':0x1,'order':[['updatedAt',_0x5223('0xa9')]]}]});})[_0x5223('0x37')](handleEntityNotFound(_0x1759e0,null))[_0x5223('0x37')](function(_0x25c8db){if(_0x25c8db){_0x29b355[_0x5223('0xaa')]=_[_0x5223('0x75')](_0x25c8db,[_0x5223('0xab')]);if(_0x25c8db[_0x5223('0xab')][_0x5223('0x4c')]){return _0x25c8db[_0x5223('0xab')][0x0];}var _0x10e834=_[_0x5223('0xac')](_0x29b355[_0x5223('0x66')],{'firstName':_0x29b355[_0x5223('0x66')][_0x5223('0x9f')],'ListId':_0x25c8db['id']});_0x10e834[_0x29b355[_0x5223('0x66')]['mapKey']]=_0x29b355[_0x5223('0x66')][_0x5223('0x9f')];return db[_0x5223('0x93')][_0x5223('0x5d')](_0x10e834,{'fields':_0xd6bbd6,'raw':!![]});}})[_0x5223('0x37')](handleEntityNotFound(_0x1759e0,null))['then'](function(_0x27e291){if(_0x27e291){_0x29b355[_0x5223('0xad')]=_0x27e291;var _0x2d8158={'ContactId':_0x27e291['id'],'phone':_0x29b355[_0x5223('0x66')][_0x5223('0x9f')],'WhatsappAccountId':_0x1ebc1b[_0x5223('0x5a')]['id']};var _0x7f15c1={'ContactId':_0x27e291['id'],'WhatsappAccountId':_0x1ebc1b[_0x5223('0x5a')]['id'],'closed':![]};return db[_0x5223('0xae')][_0x5223('0x61')]({'where':_0x7f15c1})['then'](function(_0x3fcde4){if(_0x3fcde4){return[_0x3fcde4,![]];}return db[_0x5223('0xae')]['create'](_0x2d8158)[_0x5223('0x37')](function(_0x55af5d){return[_0x55af5d,!![]];});});}})[_0x5223('0xaf')](function(_0xbb4d4d,_0x4d93bb){_0x29b355['interaction']=_0xbb4d4d['get']({'plain':!![]});_0x29b355[_0x5223('0xb0')][_0x5223('0xb1')]=![];if(_0x4d93bb){if(_0x29b355[_0x5223('0x88')][_0x5223('0xb2')]){_0x29b355['applications'][_0x5223('0xb3')]({'id':0x0,'priority':_0x29b355[_0x5223('0xb4')][_0x5223('0x4c')]+0x1,'app':'close','appdata':_0x5223('0xb5'),'interval':'*,*,*,*'});}_0x29b355[_0x5223('0xb0')]['created']=!![];}return db[_0x5223('0x8d')][_0x5223('0x5d')]({'phone':_0x29b355[_0x5223('0x66')][_0x5223('0x9f')],'messageId':_0x29b355[_0x5223('0x66')][_0x5223('0xa1')],'body':_0x29b355[_0x5223('0x66')][_0x5223('0x66')],'WhatsappAccountId':_0x1ebc1b[_0x5223('0x5a')]['id'],'WhatsappInteractionId':_0xbb4d4d['id'],'direction':'in','ContactId':_0xbb4d4d[_0x5223('0xb6')],'AttachmentId':_0x29b355['body']['AttachmentId']});})[_0x5223('0x37')](function(_0x108f5a){_0x29b355[_0x5223('0x29')]=_0x108f5a;if(_0x29b355['interaction'][_0x5223('0xb7')]){return db['User']['find']({'attributes':['id',_0x5223('0x3c')],'where':{'id':_0x29b355[_0x5223('0xb0')]['UserId']}})[_0x5223('0x37')](function(_0xb52eae){if(_0xb52eae){_0x29b355['applications'][_0x5223('0xb8')]({'id':0x0,'priority':0x0,'app':_0x5223('0xb9'),'appdata':_0xb52eae['name']+','+(_0x29b355['account'][_0x5223('0xba')]||0xa),'interval':_0x5223('0xbb')});}return respondWithRpcPromise(_0x5223('0xbc'),'startRouting',_0x29b355);});}return respondWithRpcPromise(_0x5223('0xbc'),_0x5223('0xbd'),_0x29b355);})[_0x5223('0x37')](function(_0x16684e){if(_0x16684e){var _0x5f39b9=0xc8;var _0x16d275='receiveMessage';logger[_0x5223('0x21')](_0x5223('0x25'),_0x16d275,_0x5f39b9,_0x5223('0xbe'));logger['debug'](_0x5223('0xbf'),_0x16d275,_0x5f39b9,_0x5223('0xbe'),JSON[_0x5223('0x26')](_0x16684e));if(_0x29b355[_0x5223('0x88')][_0x5223('0x44')]===_0x5223('0x9b')){return _0x1759e0['status'](_0x5f39b9)[_0x5223('0x33')](_0x5223('0xc0'),_0x5223('0xc1'))[_0x5223('0xc2')](_0x5223('0xc3'));}else{return _0x1759e0['status'](_0x5f39b9)[_0x5223('0x2e')](_0x16684e);}}});})[_0x5223('0x5c')](handleError(_0x1759e0,null));};exports['send']=function(_0x22d87c,_0x625687,_0x42f706){var _0x3f7dad,_0x4de6d9,_0x4756a;if(_[_0x5223('0xa3')](_0x22d87c[_0x5223('0x66')][_0x5223('0x66')])||_0x22d87c['body'][_0x5223('0x66')]===''){throw new db[(_0x5223('0x94'))][(_0x5223('0x95'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x22d87c[_0x5223('0x66')]['to'])){throw new db[(_0x5223('0x94'))][(_0x5223('0x95'))](_0x5223('0xc4'));}_0x3f7dad=_0x22d87c[_0x5223('0x66')]['to'];return db[_0x5223('0x41')][_0x5223('0x61')]({'where':{'id':_0x22d87c[_0x5223('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0x5223('0xc5'),'include':[{'model':db[_0x5223('0x93')],'as':_0x5223('0xab'),'where':{'mobile':_0x3f7dad},'limit':0x1,'order':[[_0x5223('0x98'),_0x5223('0xa9')]]}]}]})[_0x5223('0x37')](handleEntityNotFound(_0x625687,null))[_0x5223('0x37')](function(_0x47105c){if(_0x47105c&&_0x47105c[_0x5223('0xc5')]){_0x4de6d9=_0x47105c[_0x5223('0x38')]({'plain':!![]});if(_0x4de6d9['List']&&_0x4de6d9[_0x5223('0xc5')][_0x5223('0xab')][_0x5223('0x4c')]){return _0x4de6d9[_0x5223('0xc5')][_0x5223('0xab')][0x0];}return db[_0x5223('0x93')][_0x5223('0x5d')](_[_0x5223('0xac')](_0x22d87c['body'],{'firstName':_0x3f7dad,'mobile':_0x3f7dad,'phone':_0x3f7dad,'ListId':_0x4de6d9['ListId']}));}})[_0x5223('0x37')](handleEntityNotFound(_0x625687,null))[_0x5223('0x37')](function(_0x2c732d){if(_0x2c732d){_0x4756a=_0x2c732d;return db['WhatsappInteraction'][_0x5223('0x61')]({'where':{'ContactId':_0x4756a['id'],'closed':![],'WhatsappAccountId':_0x4de6d9['id']}})['then'](function(_0x189f45){if(_0x189f45){return[_0x189f45,![]];}return db[_0x5223('0xae')][_0x5223('0x5d')]({'UserId':_0x22d87c['user']['id'],'ContactId':_0x4756a['id'],'WhatsappAccountId':_0x4de6d9['id'],'phone':_0x3f7dad,'firstMsgDirection':_0x5223('0xc6'),'Messages':[_['merge'](_0x22d87c[_0x5223('0x66')],{'read':![],'body':_0x22d87c['body']['body'],'phone':_0x3f7dad,'WhatsappAccountId':_0x4de6d9['id'],'UserId':_0x22d87c[_0x5223('0x5e')]['id'],'ContactId':_0x4756a['id']})]},{'include':[{'model':db[_0x5223('0x8d')],'as':_0x5223('0xc7')}]})[_0x5223('0x37')](function(_0x39528d){return[_0x39528d,!![]];});});}})['spread'](function(_0x2d8910,_0x50c8c5){if(_0x50c8c5){return _0x2d8910;}return db[_0x5223('0x8d')][_0x5223('0x5d')](_[_0x5223('0x53')](_0x22d87c['body'],{'read':![],'body':_0x22d87c['body']['body'],'phone':_0x3f7dad,'WhatsappAccountId':_0x4de6d9['id'],'WhatsappInteractionId':_0x2d8910['id'],'UserId':_0x22d87c[_0x5223('0x5e')]['id'],'ContactId':_0x4756a['id']}))[_0x5223('0x37')](function(_0x55d0ab){_0x2d8910[_0x5223('0xc8')][_0x5223('0xc7')]=[];_0x2d8910[_0x5223('0xc8')]['Messages']['push'](_0x55d0ab[_0x5223('0xc8')]);return _0x2d8910;});})[_0x5223('0x37')](respondWithResult(_0x625687,null))['catch'](handleError(_0x625687,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 444df88..45a2380 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 _0xe009=['events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3ab353,_0x5d5283){var _0x1e2285=function(_0x55804f){while(--_0x55804f){_0x3ab353['push'](_0x3ab353['shift']());}};_0x1e2285(++_0x5d5283);}(_0xe009,0x1b8));var _0x9e00=function(_0x335a47,_0x1f9381){_0x335a47=_0x335a47-0x0;var _0x27cecf=_0xe009[_0x335a47];return _0x27cecf;};'use strict';var EventEmitter=require(_0x9e00('0x0'));var WhatsappAccount=require(_0x9e00('0x1'))['db'][_0x9e00('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x9e00('0x3')](0x0);var events={'afterCreate':_0x9e00('0x4'),'afterUpdate':_0x9e00('0x5'),'afterDestroy':_0x9e00('0x6')};function emitEvent(_0x3cbe68){return function(_0x480bb0,_0x2234ff,_0x1c859c){WhatsappAccountEvents['emit'](_0x3cbe68+':'+_0x480bb0['id'],_0x480bb0);WhatsappAccountEvents[_0x9e00('0x7')](_0x3cbe68,_0x480bb0);_0x1c859c(null);};}for(var e in events){if(events[_0x9e00('0x8')](e)){var event=events[e];WhatsappAccount[_0x9e00('0x9')](e,emitEvent(event));}}module[_0x9e00('0xa')]=WhatsappAccountEvents; \ No newline at end of file +var _0xa7d9=['save','update','remove','emit','hook','exports','../../mysqldb','WhatsappAccount','setMaxListeners'];(function(_0x56a095,_0x2c7dd8){var _0x15beb4=function(_0x36079f){while(--_0x36079f){_0x56a095['push'](_0x56a095['shift']());}};_0x15beb4(++_0x2c7dd8);}(_0xa7d9,0xe7));var _0x9a7d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xa7d9[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x9a7d('0x0'))['db'][_0x9a7d('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x9a7d('0x2')](0x0);var events={'afterCreate':_0x9a7d('0x3'),'afterUpdate':_0x9a7d('0x4'),'afterDestroy':_0x9a7d('0x5')};function emitEvent(_0x5a2ec5){return function(_0x210289,_0xcfc149,_0x41b1a8){WhatsappAccountEvents[_0x9a7d('0x6')](_0x5a2ec5+':'+_0x210289['id'],_0x210289);WhatsappAccountEvents[_0x9a7d('0x6')](_0x5a2ec5,_0x210289);_0x41b1a8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x9a7d('0x7')](e,emitEvent(event));}}module[_0x9a7d('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index dc16deb..46ef6a6 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 _0x2bc4=['whatsapp_accounts','lodash','util','api','moment','path','../../config/environment','exports'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x2bc4,0x1b9));var _0x42bc=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2bc4[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x42bc('0x0'));var util=require(_0x42bc('0x1'));var logger=require('../../config/logger')(_0x42bc('0x2'));var moment=require(_0x42bc('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x42bc('0x4'));var rimraf=require('rimraf');var config=require(_0x42bc('0x5'));var attributes=require('./whatsappAccount.attributes');module[_0x42bc('0x6')]=function(_0x18915f,_0x4ee5b2){return _0x18915f['define']('WhatsappAccount',attributes,{'tableName':_0x42bc('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x194e=['define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x194e,0xe3));var _0xe194=function(_0x260525,_0x211b29){_0x260525=_0x260525-0x0;var _0xb75e8b=_0x194e[_0x260525];return _0xb75e8b;};'use strict';var _=require(_0xe194('0x0'));var util=require(_0xe194('0x1'));var logger=require(_0xe194('0x2'))(_0xe194('0x3'));var moment=require(_0xe194('0x4'));var BPromise=require(_0xe194('0x5'));var rp=require(_0xe194('0x6'));var fs=require('fs');var path=require(_0xe194('0x7'));var rimraf=require(_0xe194('0x8'));var config=require(_0xe194('0x9'));var attributes=require(_0xe194('0xa'));module['exports']=function(_0x2c153f,_0xe1bb03){return _0x2c153f[_0xe194('0xb')](_0xe194('0xc'),attributes,{'tableName':_0xe194('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 577116c..85c7673 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 _0x4b11=['socket.io-emitter','./whatsappAccount.socket','register','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','ShowWhatsappAccount','find','options','raw','where','include','map','model','attributes','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x34967a,_0x5409db){var _0xf08c5e=function(_0x223207){while(--_0x223207){_0x34967a['push'](_0x34967a['shift']());}};_0xf08c5e(++_0x5409db);}(_0x4b11,0xf4));var _0x14b1=function(_0x25cbf5,_0x5c315a){_0x25cbf5=_0x25cbf5-0x0;var _0x30ce03=_0x4b11[_0x25cbf5];return _0x30ce03;};'use strict';var _=require(_0x14b1('0x0'));var util=require(_0x14b1('0x1'));var moment=require(_0x14b1('0x2'));var BPromise=require(_0x14b1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x14b1('0x4'));var db=require(_0x14b1('0x5'))['db'];var utils=require(_0x14b1('0x6'));var logger=require('../../config/logger')(_0x14b1('0x7'));var config=require(_0x14b1('0x8'));var jayson=require(_0x14b1('0x9'));var client=jayson[_0x14b1('0xa')][_0x14b1('0xb')]({'port':0x232a});config[_0x14b1('0xc')]=_[_0x14b1('0xd')](config[_0x14b1('0xc')],{'host':_0x14b1('0xe'),'port':0x18eb});var socket=require(_0x14b1('0xf'))(new Redis(config[_0x14b1('0xc')]));require(_0x14b1('0x10'))[_0x14b1('0x11')](socket);function respondWithRpcPromise(_0x104038,_0x31be73,_0x57bb9f){return new BPromise(function(_0x2c5978,_0x99ff66){return client['request'](_0x104038,_0x57bb9f)[_0x14b1('0x12')](function(_0x84c9dc){logger[_0x14b1('0x13')](_0x14b1('0x14'),_0x31be73,_0x14b1('0x15'));logger[_0x14b1('0x16')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x31be73,_0x14b1('0x15'),JSON['stringify'](_0x84c9dc));if(_0x84c9dc['error']){if(_0x84c9dc[_0x14b1('0x17')][_0x14b1('0x18')]===0x1f4){logger[_0x14b1('0x17')](_0x14b1('0x14'),_0x31be73,_0x84c9dc[_0x14b1('0x17')][_0x14b1('0x19')]);return _0x99ff66(_0x84c9dc['error'][_0x14b1('0x19')]);}logger[_0x14b1('0x17')](_0x14b1('0x14'),_0x31be73,_0x84c9dc[_0x14b1('0x17')][_0x14b1('0x19')]);return _0x2c5978(_0x84c9dc[_0x14b1('0x17')][_0x14b1('0x19')]);}else{logger[_0x14b1('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x31be73,'request\x20sent');_0x2c5978(_0x84c9dc['result'][_0x14b1('0x19')]);}})[_0x14b1('0x1a')](function(_0x36a0d1){logger[_0x14b1('0x17')](_0x14b1('0x14'),_0x31be73,_0x36a0d1);_0x99ff66(_0x36a0d1);});});}exports[_0x14b1('0x1b')]=function(_0x36aca6){var _0x290d40=this;return new Promise(function(_0x4f4830,_0x1785ac){return db['WhatsappAccount'][_0x14b1('0x1c')]({'raw':_0x36aca6[_0x14b1('0x1d')]?_0x36aca6['options'][_0x14b1('0x1e')]===undefined?!![]:![]:!![],'where':_0x36aca6[_0x14b1('0x1d')]?_0x36aca6['options'][_0x14b1('0x1f')]||null:null,'attributes':_0x36aca6[_0x14b1('0x1d')]?_0x36aca6[_0x14b1('0x1d')]['attributes']||null:null,'include':_0x36aca6[_0x14b1('0x1d')]?_0x36aca6['options'][_0x14b1('0x20')]?_[_0x14b1('0x21')](_0x36aca6[_0x14b1('0x1d')][_0x14b1('0x20')],function(_0x3eeb09){return{'model':db[_0x3eeb09[_0x14b1('0x22')]],'as':_0x3eeb09['as'],'attributes':_0x3eeb09[_0x14b1('0x23')],'include':_0x3eeb09[_0x14b1('0x20')]?_[_0x14b1('0x21')](_0x3eeb09['include'],function(_0x5e46e5){return{'model':db[_0x5e46e5[_0x14b1('0x22')]],'as':_0x5e46e5['as'],'attributes':_0x5e46e5[_0x14b1('0x23')],'include':_0x5e46e5['include']?_[_0x14b1('0x21')](_0x5e46e5[_0x14b1('0x20')],function(_0x551dbe){return{'model':db[_0x551dbe[_0x14b1('0x22')]],'as':_0x551dbe['as'],'attributes':_0x551dbe[_0x14b1('0x23')]};}):[]};}):[]};}):[]:[]})[_0x14b1('0x12')](function(_0x357eb3){logger['info'](_0x14b1('0x1b'),_0x36aca6);logger[_0x14b1('0x16')](_0x14b1('0x1b'),_0x36aca6,JSON[_0x14b1('0x24')](_0x357eb3));_0x4f4830(_0x357eb3);})[_0x14b1('0x1a')](function(_0x1c9fd3){logger['error'](_0x14b1('0x1b'),_0x1c9fd3['message'],_0x36aca6);_0x1785ac(_0x290d40[_0x14b1('0x17')](0x1f4,_0x1c9fd3['message']));});});}; \ No newline at end of file +var _0x4628=['result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','include','map','attributes','model','then','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','request','info','request\x20sent','stringify','error','WhatsappAccount,\x20%s,\x20%s','message'];(function(_0x3aa1f5,_0x5c9dba){var _0x22ab3b=function(_0x130b84){while(--_0x130b84){_0x3aa1f5['push'](_0x3aa1f5['shift']());}};_0x22ab3b(++_0x5c9dba);}(_0x4628,0xd3));var _0x8462=function(_0x19c66f,_0x1866f8){_0x19c66f=_0x19c66f-0x0;var _0x522de6=_0x4628[_0x19c66f];return _0x522de6;};'use strict';var _=require(_0x8462('0x0'));var util=require(_0x8462('0x1'));var moment=require('moment');var BPromise=require(_0x8462('0x2'));var rs=require(_0x8462('0x3'));var fs=require('fs');var Redis=require(_0x8462('0x4'));var db=require(_0x8462('0x5'))['db'];var utils=require(_0x8462('0x6'));var logger=require('../../config/logger')(_0x8462('0x7'));var config=require(_0x8462('0x8'));var jayson=require(_0x8462('0x9'));var client=jayson[_0x8462('0xa')]['http']({'port':0x232a});config[_0x8462('0xb')]=_['defaults'](config[_0x8462('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8462('0xc'))(new Redis(config[_0x8462('0xb')]));require('./whatsappAccount.socket')['register'](socket);function respondWithRpcPromise(_0x3ebf01,_0x1cc040,_0x34cd6b){return new BPromise(function(_0x3cd893,_0x18e80e){return client[_0x8462('0xd')](_0x3ebf01,_0x34cd6b)['then'](function(_0x1799d6){logger[_0x8462('0xe')]('WhatsappAccount,\x20%s,\x20%s',_0x1cc040,_0x8462('0xf'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1cc040,'request\x20sent',JSON[_0x8462('0x10')](_0x1799d6));if(_0x1799d6[_0x8462('0x11')]){if(_0x1799d6[_0x8462('0x11')]['code']===0x1f4){logger[_0x8462('0x11')](_0x8462('0x12'),_0x1cc040,_0x1799d6[_0x8462('0x11')][_0x8462('0x13')]);return _0x18e80e(_0x1799d6['error'][_0x8462('0x13')]);}logger[_0x8462('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x1cc040,_0x1799d6[_0x8462('0x11')][_0x8462('0x13')]);return _0x3cd893(_0x1799d6[_0x8462('0x11')][_0x8462('0x13')]);}else{logger['info'](_0x8462('0x12'),_0x1cc040,_0x8462('0xf'));_0x3cd893(_0x1799d6[_0x8462('0x14')][_0x8462('0x13')]);}})[_0x8462('0x15')](function(_0x528157){logger['error'](_0x8462('0x12'),_0x1cc040,_0x528157);_0x18e80e(_0x528157);});});}exports[_0x8462('0x16')]=function(_0x267e7d){var _0x2c3c48=this;return new Promise(function(_0x49bef5,_0x490dcb){return db[_0x8462('0x17')][_0x8462('0x18')]({'raw':_0x267e7d[_0x8462('0x19')]?_0x267e7d[_0x8462('0x19')][_0x8462('0x1a')]===undefined?!![]:![]:!![],'where':_0x267e7d['options']?_0x267e7d[_0x8462('0x19')]['where']||null:null,'attributes':_0x267e7d['options']?_0x267e7d['options']['attributes']||null:null,'include':_0x267e7d[_0x8462('0x19')]?_0x267e7d[_0x8462('0x19')][_0x8462('0x1b')]?_[_0x8462('0x1c')](_0x267e7d[_0x8462('0x19')][_0x8462('0x1b')],function(_0x3b5af3){return{'model':db[_0x3b5af3['model']],'as':_0x3b5af3['as'],'attributes':_0x3b5af3[_0x8462('0x1d')],'include':_0x3b5af3[_0x8462('0x1b')]?_[_0x8462('0x1c')](_0x3b5af3[_0x8462('0x1b')],function(_0x27b8b9){return{'model':db[_0x27b8b9[_0x8462('0x1e')]],'as':_0x27b8b9['as'],'attributes':_0x27b8b9['attributes'],'include':_0x27b8b9['include']?_['map'](_0x27b8b9[_0x8462('0x1b')],function(_0x279637){return{'model':db[_0x279637['model']],'as':_0x279637['as'],'attributes':_0x279637[_0x8462('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8462('0x1f')](function(_0xdafc1d){logger[_0x8462('0xe')]('ShowWhatsappAccount',_0x267e7d);logger[_0x8462('0x20')]('ShowWhatsappAccount',_0x267e7d,JSON[_0x8462('0x10')](_0xdafc1d));_0x49bef5(_0xdafc1d);})['catch'](function(_0x4541c8){logger['error']('ShowWhatsappAccount',_0x4541c8[_0x8462('0x13')],_0x267e7d);_0x490dcb(_0x2c3c48[_0x8462('0x11')](0x1f4,_0x4541c8[_0x8462('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index d651ea7..a18374b 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 _0x2885=['removeListener','register','whatsappAccount:','remove','update','emit'];(function(_0x4f29cb,_0x3f2946){var _0x13b478=function(_0x3bd4e6){while(--_0x3bd4e6){_0x4f29cb['push'](_0x4f29cb['shift']());}};_0x13b478(++_0x3f2946);}(_0x2885,0x1a1));var _0x5288=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x2885[_0x11005e];return _0x29338f;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=['save',_0x5288('0x0'),_0x5288('0x1')];function createListener(_0x15b44e,_0x42921b){return function(_0x3a7cf4){_0x42921b[_0x5288('0x2')](_0x15b44e,_0x3a7cf4);};}function removeListener(_0x224025,_0x396864){return function(){WhatsappAccountEvents[_0x5288('0x3')](_0x224025,_0x396864);};}exports[_0x5288('0x4')]=function(_0x5f54ac){for(var _0x58c1e7=0x0,_0x19a92f=events['length'];_0x58c1e7<_0x19a92f;_0x58c1e7++){var _0x3151c6=events[_0x58c1e7];var _0x21e4ef=createListener(_0x5288('0x5')+_0x3151c6,_0x5f54ac);WhatsappAccountEvents['on'](_0x3151c6,_0x21e4ef);}}; \ No newline at end of file +var _0x393c=['whatsappAccount:','./whatsappAccount.events','save','remove','emit','removeListener'];(function(_0x3e0dc4,_0x13971b){var _0x586111=function(_0x123c53){while(--_0x123c53){_0x3e0dc4['push'](_0x3e0dc4['shift']());}};_0x586111(++_0x13971b);}(_0x393c,0xe5));var _0xc393=function(_0x37f9fd,_0x11a523){_0x37f9fd=_0x37f9fd-0x0;var _0x27f2d8=_0x393c[_0x37f9fd];return _0x27f2d8;};'use strict';var WhatsappAccountEvents=require(_0xc393('0x0'));var events=[_0xc393('0x1'),_0xc393('0x2'),'update'];function createListener(_0x29c35b,_0x3c73eb){return function(_0x24447a){_0x3c73eb[_0xc393('0x3')](_0x29c35b,_0x24447a);};}function removeListener(_0x5af17d,_0x44ccd3){return function(){WhatsappAccountEvents[_0xc393('0x4')](_0x5af17d,_0x44ccd3);};}exports['register']=function(_0x1da1b5){for(var _0x38b37e=0x0,_0x36e128=events['length'];_0x38b37e<_0x36e128;_0x38b37e++){var _0x4f3659=events[_0x38b37e];var _0x68a548=createListener(_0xc393('0x5')+_0x4f3659,_0x1da1b5);WhatsappAccountEvents['on'](_0x4f3659,_0x68a548);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 4d56787..6aba290 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 _0x5614=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra'];(function(_0x485fa6,_0x4cfca0){var _0x20fe7c=function(_0x4bd47c){while(--_0x4bd47c){_0x485fa6['push'](_0x485fa6['shift']());}};_0x20fe7c(++_0x4cfca0);}(_0x5614,0x1b1));var _0x4561=function(_0x2ceb73,_0xdc2d0a){_0x2ceb73=_0x2ceb73-0x0;var _0x3be568=_0x5614[_0x2ceb73];return _0x3be568;};'use strict';var multer=require('multer');var util=require(_0x4561('0x0'));var path=require(_0x4561('0x1'));var timeout=require(_0x4561('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4561('0x3'));var auth=require(_0x4561('0x4'));var interaction=require(_0x4561('0x5'));var config=require(_0x4561('0x6'));var controller=require(_0x4561('0x7'));router[_0x4561('0x8')]('/',auth[_0x4561('0x9')](),controller[_0x4561('0xa')]);router[_0x4561('0x8')](_0x4561('0xb'),auth[_0x4561('0x9')](),controller['show']);router[_0x4561('0xc')]('/',auth[_0x4561('0x9')](),controller[_0x4561('0xd')]);router[_0x4561('0xe')](_0x4561('0xb'),auth['isAuthenticated'](),controller[_0x4561('0xf')]);router[_0x4561('0x10')](_0x4561('0xb'),auth[_0x4561('0x9')](),controller[_0x4561('0x11')]);module[_0x4561('0x12')]=router; \ No newline at end of file +var _0x4f53=['./whatsappApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x21a685,_0x3c7c71){var _0x330af2=function(_0x2e1f07){while(--_0x2e1f07){_0x21a685['push'](_0x21a685['shift']());}};_0x330af2(++_0x3c7c71);}(_0x4f53,0x110));var _0x34f5=function(_0x3d1d2f,_0x1158fc){_0x3d1d2f=_0x3d1d2f-0x0;var _0x2bd2ba=_0x4f53[_0x3d1d2f];return _0x2bd2ba;};'use strict';var multer=require(_0x34f5('0x0'));var util=require('util');var path=require(_0x34f5('0x1'));var timeout=require(_0x34f5('0x2'));var express=require(_0x34f5('0x3'));var router=express[_0x34f5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x34f5('0x5'));var interaction=require(_0x34f5('0x6'));var config=require(_0x34f5('0x7'));var controller=require(_0x34f5('0x8'));router[_0x34f5('0x9')]('/',auth['isAuthenticated'](),controller[_0x34f5('0xa')]);router[_0x34f5('0x9')](_0x34f5('0xb'),auth[_0x34f5('0xc')](),controller[_0x34f5('0xd')]);router[_0x34f5('0xe')]('/',auth[_0x34f5('0xc')](),controller[_0x34f5('0xf')]);router[_0x34f5('0x10')](_0x34f5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x34f5('0x11')](_0x34f5('0xb'),auth['isAuthenticated'](),controller[_0x34f5('0x12')]);module[_0x34f5('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index a9e33fe..2a4900c 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 _0x0ebd=['INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x56e7f3,_0x546616){var _0x3e99e4=function(_0x4f16a3){while(--_0x4f16a3){_0x56e7f3['push'](_0x56e7f3['shift']());}};_0x3e99e4(++_0x546616);}(_0x0ebd,0xcd));var _0xd0eb=function(_0x3ccb3b,_0x11e879){_0x3ccb3b=_0x3ccb3b-0x0;var _0x2a10a0=_0x0ebd[_0x3ccb3b];return _0x2a10a0;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xd0eb('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd0eb('0x1')},'appdata':{'type':Sequelize[_0xd0eb('0x2')]()},'description':{'type':Sequelize[_0xd0eb('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xd0eb('0x4')}}; \ No newline at end of file +var _0x1d9d=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x1d9d,0xbc));var _0xd1d9=function(_0x1c877d,_0x221ce1){_0x1c877d=_0x1c877d-0x0;var _0x575c32=_0x1d9d[_0x1c877d];return _0x575c32;};'use strict';var Sequelize=require(_0xd1d9('0x0'));module[_0xd1d9('0x1')]={'priority':{'type':Sequelize[_0xd1d9('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd1d9('0x3')],'allowNull':![],'defaultValue':_0xd1d9('0x4')},'appdata':{'type':Sequelize[_0xd1d9('0x5')]()},'description':{'type':Sequelize[_0xd1d9('0x3')]},'interval':{'type':Sequelize[_0xd1d9('0x3')],'defaultValue':_0xd1d9('0x6')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index f9a5d2b..473c864 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 _0xdeb3=['WhatsappApplication','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index'];(function(_0x19595e,_0x4f2b8a){var _0x3f76fa=function(_0x4945c2){while(--_0x4945c2){_0x19595e['push'](_0x19595e['shift']());}};_0x3f76fa(++_0x4f2b8a);}(_0xdeb3,0xb7));var _0x3deb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdeb3[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3deb('0x0'));var zipdir=require(_0x3deb('0x1'));var jsonpatch=require(_0x3deb('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3deb('0x3'));var Mustache=require(_0x3deb('0x4'));var util=require(_0x3deb('0x5'));var path=require(_0x3deb('0x6'));var sox=require(_0x3deb('0x7'));var csv=require('to-csv');var ejs=require(_0x3deb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3deb('0x9'));var squel=require('squel');var crypto=require(_0x3deb('0xa'));var jsforce=require(_0x3deb('0xb'));var deskjs=require(_0x3deb('0xc'));var toCsv=require(_0x3deb('0xd'));var querystring=require(_0x3deb('0xe'));var Papa=require(_0x3deb('0xf'));var Redis=require(_0x3deb('0x10'));var authService=require(_0x3deb('0x11'));var qs=require(_0x3deb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3deb('0x13'))(_0x3deb('0x14'));var utils=require(_0x3deb('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3deb('0x16'));var db=require(_0x3deb('0x17'))['db'];function respondWithStatusCode(_0xc65b64,_0x106ead){_0x106ead=_0x106ead||0xcc;return function(_0x555a07){if(_0x555a07){return _0xc65b64['sendStatus'](_0x106ead);}return _0xc65b64['status'](_0x106ead)[_0x3deb('0x18')]();};}function respondWithResult(_0x1260a4,_0x39f5e0){_0x39f5e0=_0x39f5e0||0xc8;return function(_0x5336c7){if(_0x5336c7){return _0x1260a4[_0x3deb('0x19')](_0x39f5e0)[_0x3deb('0x1a')](_0x5336c7);}};}function respondWithFilteredResult(_0x55c13c,_0x24b516){return function(_0x3210e7){if(_0x3210e7){var _0x5ddc06=typeof _0x24b516[_0x3deb('0x1b')]==='undefined'&&typeof _0x24b516[_0x3deb('0x1c')]==='undefined';var _0x4cce09=_0x3210e7[_0x3deb('0x1d')];var _0x23c4b9=_0x5ddc06?0x0:_0x24b516[_0x3deb('0x1b')];var _0x9ba4f=_0x5ddc06?_0x3210e7[_0x3deb('0x1d')]:_0x24b516[_0x3deb('0x1b')]+_0x24b516['limit'];var _0x311a48;if(_0x9ba4f>=_0x4cce09){_0x9ba4f=_0x4cce09;_0x311a48=0xc8;}else{_0x311a48=0xce;}_0x55c13c[_0x3deb('0x19')](_0x311a48);return _0x55c13c['set'](_0x3deb('0x1e'),_0x23c4b9+'-'+_0x9ba4f+'/'+_0x4cce09)[_0x3deb('0x1a')](_0x3210e7);}return null;};}function patchUpdates(_0x1c8641){return function(_0xedc588){try{jsonpatch[_0x3deb('0x1f')](_0xedc588,_0x1c8641,!![]);}catch(_0x583dce){return BPromise[_0x3deb('0x20')](_0x583dce);}return _0xedc588[_0x3deb('0x21')]();};}function saveUpdates(_0x2705e5,_0x1b81ff){return function(_0x3327e0){if(_0x3327e0){return _0x3327e0[_0x3deb('0x22')](_0x2705e5)[_0x3deb('0x23')](function(_0x1f535e){return _0x1f535e;});}return null;};}function removeEntity(_0x42a8d5,_0x487283){return function(_0x1f6120){if(_0x1f6120){return _0x1f6120['destroy']()[_0x3deb('0x23')](function(){_0x42a8d5[_0x3deb('0x19')](0xcc)[_0x3deb('0x18')]();});}};}function handleEntityNotFound(_0x392fec,_0x9fad49){return function(_0x245544){if(!_0x245544){_0x392fec[_0x3deb('0x24')](0x194);}return _0x245544;};}function handleError(_0x255fa5,_0x38af26){_0x38af26=_0x38af26||0x1f4;return function(_0x2789cd){logger[_0x3deb('0x25')](_0x2789cd[_0x3deb('0x26')]);if(_0x2789cd[_0x3deb('0x27')]){delete _0x2789cd[_0x3deb('0x27')];}_0x255fa5[_0x3deb('0x19')](_0x38af26)[_0x3deb('0x28')](_0x2789cd);};}exports[_0x3deb('0x29')]=function(_0x16b44e,_0x1b6d93){var _0x3e8b62={},_0x4c72c7={},_0x2e10ca={'count':0x0,'rows':[]};var _0x438e65=_['map'](db[_0x3deb('0x2a')]['rawAttributes'],function(_0x349f1b){return{'name':_0x349f1b[_0x3deb('0x2b')],'type':_0x349f1b[_0x3deb('0x2c')][_0x3deb('0x2d')]};});_0x4c72c7[_0x3deb('0x2e')]=_[_0x3deb('0x2f')](_0x438e65,'name');_0x4c72c7[_0x3deb('0x30')]=_[_0x3deb('0x31')](_0x16b44e[_0x3deb('0x30')]);_0x4c72c7[_0x3deb('0x32')]=_[_0x3deb('0x33')](_0x4c72c7[_0x3deb('0x2e')],_0x4c72c7[_0x3deb('0x30')]);_0x3e8b62[_0x3deb('0x34')]=_['intersection'](_0x4c72c7[_0x3deb('0x2e')],qs[_0x3deb('0x35')](_0x16b44e[_0x3deb('0x30')][_0x3deb('0x35')]));_0x3e8b62[_0x3deb('0x34')]=_0x3e8b62[_0x3deb('0x34')][_0x3deb('0x36')]?_0x3e8b62[_0x3deb('0x34')]:_0x4c72c7[_0x3deb('0x2e')];if(!_0x16b44e[_0x3deb('0x30')][_0x3deb('0x37')](_0x3deb('0x38'))){_0x3e8b62[_0x3deb('0x1c')]=qs[_0x3deb('0x1c')](_0x16b44e[_0x3deb('0x30')][_0x3deb('0x1c')]);_0x3e8b62[_0x3deb('0x1b')]=qs[_0x3deb('0x1b')](_0x16b44e[_0x3deb('0x30')]['offset']);}_0x3e8b62[_0x3deb('0x39')]=qs[_0x3deb('0x3a')](_0x16b44e[_0x3deb('0x30')][_0x3deb('0x3a')]);_0x3e8b62['where']=qs[_0x3deb('0x32')](_[_0x3deb('0x3b')](_0x16b44e[_0x3deb('0x30')],_0x4c72c7[_0x3deb('0x32')]),_0x438e65);if(_0x16b44e[_0x3deb('0x30')]['filter']){_0x3e8b62['where']=_[_0x3deb('0x3c')](_0x3e8b62[_0x3deb('0x3d')],{'$or':_[_0x3deb('0x2f')](_0x438e65,function(_0x3412e1){if(_0x3412e1[_0x3deb('0x2c')]!==_0x3deb('0x3e')){var _0x27499b={};_0x27499b[_0x3412e1[_0x3deb('0x27')]]={'$like':'%'+_0x16b44e[_0x3deb('0x30')][_0x3deb('0x3f')]+'%'};return _0x27499b;}})});}_0x3e8b62=_[_0x3deb('0x3c')]({},_0x3e8b62,_0x16b44e['options']);var _0x597f89={'where':_0x3e8b62[_0x3deb('0x3d')]};return db[_0x3deb('0x2a')][_0x3deb('0x1d')](_0x597f89)[_0x3deb('0x23')](function(_0x3a4866){_0x2e10ca[_0x3deb('0x1d')]=_0x3a4866;if(_0x16b44e['query']['includeAll']){_0x3e8b62[_0x3deb('0x40')]=[{'all':!![]}];}return db[_0x3deb('0x2a')][_0x3deb('0x41')](_0x3e8b62);})[_0x3deb('0x23')](function(_0x4e6254){_0x2e10ca[_0x3deb('0x42')]=_0x4e6254;return _0x2e10ca;})[_0x3deb('0x23')](respondWithFilteredResult(_0x1b6d93,_0x3e8b62))[_0x3deb('0x43')](handleError(_0x1b6d93,null));};exports[_0x3deb('0x44')]=function(_0x4a81b2,_0x355594){var _0x5bd42c={'raw':!![],'where':{'id':_0x4a81b2[_0x3deb('0x45')]['id']}},_0x5e5763={};_0x5e5763[_0x3deb('0x2e')]=_['keys'](db[_0x3deb('0x2a')][_0x3deb('0x46')]);_0x5e5763[_0x3deb('0x30')]=_[_0x3deb('0x31')](_0x4a81b2[_0x3deb('0x30')]);_0x5e5763['filters']=_[_0x3deb('0x33')](_0x5e5763[_0x3deb('0x2e')],_0x5e5763['query']);_0x5bd42c['attributes']=_['intersection'](_0x5e5763[_0x3deb('0x2e')],qs[_0x3deb('0x35')](_0x4a81b2[_0x3deb('0x30')][_0x3deb('0x35')]));_0x5bd42c['attributes']=_0x5bd42c[_0x3deb('0x34')][_0x3deb('0x36')]?_0x5bd42c[_0x3deb('0x34')]:_0x5e5763[_0x3deb('0x2e')];if(_0x4a81b2['query']['includeAll']){_0x5bd42c[_0x3deb('0x40')]=[{'all':!![]}];}_0x5bd42c=_[_0x3deb('0x3c')]({},_0x5bd42c,_0x4a81b2['options']);return db['WhatsappApplication'][_0x3deb('0x47')](_0x5bd42c)['then'](handleEntityNotFound(_0x355594,null))[_0x3deb('0x23')](respondWithResult(_0x355594,null))[_0x3deb('0x43')](handleError(_0x355594,null));};exports['create']=function(_0x46fc80,_0x2fbdc3){return db[_0x3deb('0x2a')][_0x3deb('0x48')](_0x46fc80[_0x3deb('0x49')],{})[_0x3deb('0x23')](respondWithResult(_0x2fbdc3,0xc9))[_0x3deb('0x43')](handleError(_0x2fbdc3,null));};exports[_0x3deb('0x22')]=function(_0xcd0ba9,_0x24a040){if(_0xcd0ba9[_0x3deb('0x49')]['id']){delete _0xcd0ba9[_0x3deb('0x49')]['id'];}return db[_0x3deb('0x2a')]['find']({'where':{'id':_0xcd0ba9['params']['id']}})[_0x3deb('0x23')](handleEntityNotFound(_0x24a040,null))['then'](saveUpdates(_0xcd0ba9['body'],null))[_0x3deb('0x23')](respondWithResult(_0x24a040,null))[_0x3deb('0x43')](handleError(_0x24a040,null));};exports[_0x3deb('0x4a')]=function(_0x273054,_0x596ad4){return db[_0x3deb('0x2a')][_0x3deb('0x47')]({'where':{'id':_0x273054[_0x3deb('0x45')]['id']}})[_0x3deb('0x23')](handleEntityNotFound(_0x596ad4,null))['then'](removeEntity(_0x596ad4,null))[_0x3deb('0x43')](handleError(_0x596ad4,null));}; \ No newline at end of file +var _0x5d0a=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','apply','save','update','then','error','name','index','map','WhatsappApplication','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x4aba15,_0x4e90aa){var _0x1c8122=function(_0x568dba){while(--_0x568dba){_0x4aba15['push'](_0x4aba15['shift']());}};_0x1c8122(++_0x4e90aa);}(_0x5d0a,0x175));var _0xa5d0=function(_0x4c42e9,_0xa58a1){_0x4c42e9=_0x4c42e9-0x0;var _0x34af6d=_0x5d0a[_0x4c42e9];return _0x34af6d;};'use strict';var emlformat=require(_0xa5d0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa5d0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa5d0('0x2'));var moment=require(_0xa5d0('0x3'));var BPromise=require(_0xa5d0('0x4'));var Mustache=require(_0xa5d0('0x5'));var util=require('util');var path=require(_0xa5d0('0x6'));var sox=require(_0xa5d0('0x7'));var csv=require(_0xa5d0('0x8'));var ejs=require(_0xa5d0('0x9'));var fs=require('fs');var fs_extra=require(_0xa5d0('0xa'));var _=require(_0xa5d0('0xb'));var squel=require(_0xa5d0('0xc'));var crypto=require(_0xa5d0('0xd'));var jsforce=require(_0xa5d0('0xe'));var deskjs=require(_0xa5d0('0xf'));var toCsv=require(_0xa5d0('0x8'));var querystring=require('querystring');var Papa=require(_0xa5d0('0x10'));var Redis=require(_0xa5d0('0x11'));var authService=require(_0xa5d0('0x12'));var qs=require(_0xa5d0('0x13'));var as=require(_0xa5d0('0x14'));var hardwareService=require(_0xa5d0('0x15'));var logger=require(_0xa5d0('0x16'))(_0xa5d0('0x17'));var utils=require(_0xa5d0('0x18'));var config=require(_0xa5d0('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa5d0('0x1a'))['db'];function respondWithStatusCode(_0x4bdb6b,_0x566b17){_0x566b17=_0x566b17||0xcc;return function(_0x3ab8b9){if(_0x3ab8b9){return _0x4bdb6b[_0xa5d0('0x1b')](_0x566b17);}return _0x4bdb6b[_0xa5d0('0x1c')](_0x566b17)[_0xa5d0('0x1d')]();};}function respondWithResult(_0x4cb722,_0x56ee85){_0x56ee85=_0x56ee85||0xc8;return function(_0xf06747){if(_0xf06747){return _0x4cb722[_0xa5d0('0x1c')](_0x56ee85)[_0xa5d0('0x1e')](_0xf06747);}};}function respondWithFilteredResult(_0x22afa2,_0x3847bb){return function(_0x146722){if(_0x146722){var _0x1461d5=typeof _0x3847bb['offset']===_0xa5d0('0x1f')&&typeof _0x3847bb['limit']===_0xa5d0('0x1f');var _0x3c00fd=_0x146722['count'];var _0x5bc068=_0x1461d5?0x0:_0x3847bb[_0xa5d0('0x20')];var _0x234254=_0x1461d5?_0x146722['count']:_0x3847bb[_0xa5d0('0x20')]+_0x3847bb[_0xa5d0('0x21')];var _0x9fab4;if(_0x234254>=_0x3c00fd){_0x234254=_0x3c00fd;_0x9fab4=0xc8;}else{_0x9fab4=0xce;}_0x22afa2[_0xa5d0('0x1c')](_0x9fab4);return _0x22afa2[_0xa5d0('0x22')](_0xa5d0('0x23'),_0x5bc068+'-'+_0x234254+'/'+_0x3c00fd)['json'](_0x146722);}return null;};}function patchUpdates(_0x4cf8db){return function(_0x2a56ff){try{jsonpatch[_0xa5d0('0x24')](_0x2a56ff,_0x4cf8db,!![]);}catch(_0x4cc587){return BPromise['reject'](_0x4cc587);}return _0x2a56ff[_0xa5d0('0x25')]();};}function saveUpdates(_0x42a745,_0x27a4cb){return function(_0xde8c41){if(_0xde8c41){return _0xde8c41[_0xa5d0('0x26')](_0x42a745)[_0xa5d0('0x27')](function(_0x518a60){return _0x518a60;});}return null;};}function removeEntity(_0x2de295,_0x307377){return function(_0xefd903){if(_0xefd903){return _0xefd903['destroy']()[_0xa5d0('0x27')](function(){_0x2de295[_0xa5d0('0x1c')](0xcc)[_0xa5d0('0x1d')]();});}};}function handleEntityNotFound(_0x4d5e7a,_0x4916f6){return function(_0x758789){if(!_0x758789){_0x4d5e7a['sendStatus'](0x194);}return _0x758789;};}function handleError(_0x49ca76,_0x55cd15){_0x55cd15=_0x55cd15||0x1f4;return function(_0x2b29a5){logger[_0xa5d0('0x28')](_0x2b29a5['stack']);if(_0x2b29a5[_0xa5d0('0x29')]){delete _0x2b29a5['name'];}_0x49ca76[_0xa5d0('0x1c')](_0x55cd15)['send'](_0x2b29a5);};}exports[_0xa5d0('0x2a')]=function(_0xc3336f,_0x431fea){var _0x48dbd2={},_0x5495cb={},_0x5bcfe1={'count':0x0,'rows':[]};var _0x3d7818=_[_0xa5d0('0x2b')](db[_0xa5d0('0x2c')][_0xa5d0('0x2d')],function(_0x5e876c){return{'name':_0x5e876c[_0xa5d0('0x2e')],'type':_0x5e876c[_0xa5d0('0x2f')]['key']};});_0x5495cb[_0xa5d0('0x30')]=_[_0xa5d0('0x2b')](_0x3d7818,_0xa5d0('0x29'));_0x5495cb[_0xa5d0('0x31')]=_[_0xa5d0('0x32')](_0xc3336f[_0xa5d0('0x31')]);_0x5495cb[_0xa5d0('0x33')]=_[_0xa5d0('0x34')](_0x5495cb[_0xa5d0('0x30')],_0x5495cb[_0xa5d0('0x31')]);_0x48dbd2[_0xa5d0('0x35')]=_['intersection'](_0x5495cb[_0xa5d0('0x30')],qs[_0xa5d0('0x36')](_0xc3336f[_0xa5d0('0x31')][_0xa5d0('0x36')]));_0x48dbd2['attributes']=_0x48dbd2[_0xa5d0('0x35')][_0xa5d0('0x37')]?_0x48dbd2['attributes']:_0x5495cb[_0xa5d0('0x30')];if(!_0xc3336f['query'][_0xa5d0('0x38')](_0xa5d0('0x39'))){_0x48dbd2['limit']=qs['limit'](_0xc3336f['query'][_0xa5d0('0x21')]);_0x48dbd2['offset']=qs[_0xa5d0('0x20')](_0xc3336f[_0xa5d0('0x31')]['offset']);}_0x48dbd2[_0xa5d0('0x3a')]=qs[_0xa5d0('0x3b')](_0xc3336f[_0xa5d0('0x31')][_0xa5d0('0x3b')]);_0x48dbd2[_0xa5d0('0x3c')]=qs[_0xa5d0('0x33')](_[_0xa5d0('0x3d')](_0xc3336f[_0xa5d0('0x31')],_0x5495cb[_0xa5d0('0x33')]),_0x3d7818);if(_0xc3336f[_0xa5d0('0x31')][_0xa5d0('0x3e')]){_0x48dbd2[_0xa5d0('0x3c')]=_['merge'](_0x48dbd2[_0xa5d0('0x3c')],{'$or':_['map'](_0x3d7818,function(_0x393daf){if(_0x393daf[_0xa5d0('0x2f')]!==_0xa5d0('0x3f')){var _0x40c179={};_0x40c179[_0x393daf[_0xa5d0('0x29')]]={'$like':'%'+_0xc3336f[_0xa5d0('0x31')]['filter']+'%'};return _0x40c179;}})});}_0x48dbd2=_[_0xa5d0('0x40')]({},_0x48dbd2,_0xc3336f['options']);var _0x16fe00={'where':_0x48dbd2['where']};return db['WhatsappApplication'][_0xa5d0('0x41')](_0x16fe00)[_0xa5d0('0x27')](function(_0x249b28){_0x5bcfe1[_0xa5d0('0x41')]=_0x249b28;if(_0xc3336f['query'][_0xa5d0('0x42')]){_0x48dbd2[_0xa5d0('0x43')]=[{'all':!![]}];}return db[_0xa5d0('0x2c')][_0xa5d0('0x44')](_0x48dbd2);})[_0xa5d0('0x27')](function(_0x26d37f){_0x5bcfe1[_0xa5d0('0x45')]=_0x26d37f;return _0x5bcfe1;})['then'](respondWithFilteredResult(_0x431fea,_0x48dbd2))[_0xa5d0('0x46')](handleError(_0x431fea,null));};exports[_0xa5d0('0x47')]=function(_0x20ae65,_0x343376){var _0x1090b6={'raw':!![],'where':{'id':_0x20ae65[_0xa5d0('0x48')]['id']}},_0x358b23={};_0x358b23[_0xa5d0('0x30')]=_['keys'](db[_0xa5d0('0x2c')]['rawAttributes']);_0x358b23[_0xa5d0('0x31')]=_['keys'](_0x20ae65[_0xa5d0('0x31')]);_0x358b23['filters']=_[_0xa5d0('0x34')](_0x358b23['model'],_0x358b23[_0xa5d0('0x31')]);_0x1090b6[_0xa5d0('0x35')]=_['intersection'](_0x358b23[_0xa5d0('0x30')],qs[_0xa5d0('0x36')](_0x20ae65[_0xa5d0('0x31')][_0xa5d0('0x36')]));_0x1090b6['attributes']=_0x1090b6['attributes'][_0xa5d0('0x37')]?_0x1090b6[_0xa5d0('0x35')]:_0x358b23[_0xa5d0('0x30')];if(_0x20ae65[_0xa5d0('0x31')]['includeAll']){_0x1090b6['include']=[{'all':!![]}];}_0x1090b6=_[_0xa5d0('0x40')]({},_0x1090b6,_0x20ae65[_0xa5d0('0x49')]);return db[_0xa5d0('0x2c')][_0xa5d0('0x4a')](_0x1090b6)[_0xa5d0('0x27')](handleEntityNotFound(_0x343376,null))['then'](respondWithResult(_0x343376,null))['catch'](handleError(_0x343376,null));};exports[_0xa5d0('0x4b')]=function(_0x9a4c50,_0x2d8551){return db[_0xa5d0('0x2c')][_0xa5d0('0x4b')](_0x9a4c50[_0xa5d0('0x4c')],{})[_0xa5d0('0x27')](respondWithResult(_0x2d8551,0xc9))[_0xa5d0('0x46')](handleError(_0x2d8551,null));};exports[_0xa5d0('0x26')]=function(_0xbb7c45,_0x555ec8){if(_0xbb7c45[_0xa5d0('0x4c')]['id']){delete _0xbb7c45['body']['id'];}return db[_0xa5d0('0x2c')][_0xa5d0('0x4a')]({'where':{'id':_0xbb7c45['params']['id']}})[_0xa5d0('0x27')](handleEntityNotFound(_0x555ec8,null))[_0xa5d0('0x27')](saveUpdates(_0xbb7c45[_0xa5d0('0x4c')],null))[_0xa5d0('0x27')](respondWithResult(_0x555ec8,null))[_0xa5d0('0x46')](handleError(_0x555ec8,null));};exports['destroy']=function(_0x30d13c,_0x54bd94){return db[_0xa5d0('0x2c')][_0xa5d0('0x4a')]({'where':{'id':_0x30d13c[_0xa5d0('0x48')]['id']}})[_0xa5d0('0x27')](handleEntityNotFound(_0x54bd94,null))['then'](removeEntity(_0x54bd94,null))['catch'](handleError(_0x54bd94,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index b7f7373..c8ad6c9 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 _0xc03e=['bluebird','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci','lodash','api'];(function(_0x3cb587,_0x119c86){var _0x5ed07a=function(_0x397b7d){while(--_0x397b7d){_0x3cb587['push'](_0x3cb587['shift']());}};_0x5ed07a(++_0x119c86);}(_0xc03e,0x15a));var _0xec03=function(_0xa30766,_0x6f613e){_0xa30766=_0xa30766-0x0;var _0x24e780=_0xc03e[_0xa30766];return _0x24e780;};'use strict';var _=require(_0xec03('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xec03('0x1'));var moment=require('moment');var BPromise=require(_0xec03('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec03('0x3'));var rimraf=require(_0xec03('0x4'));var config=require(_0xec03('0x5'));var attributes=require(_0xec03('0x6'));module[_0xec03('0x7')]=function(_0x1ce78a,_0x31db21){return _0x1ce78a[_0xec03('0x8')](_0xec03('0x9'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xec03('0xa'),'collate':_0xec03('0xb')});}; \ No newline at end of file +var _0x984b=['bluebird','rimraf','../../config/environment','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','api','moment'];(function(_0x4c6ea2,_0x235789){var _0x3f1e64=function(_0x32cc91){while(--_0x32cc91){_0x4c6ea2['push'](_0x4c6ea2['shift']());}};_0x3f1e64(++_0x235789);}(_0x984b,0xee));var _0xb984=function(_0x5316a3,_0x1ea00b){_0x5316a3=_0x5316a3-0x0;var _0x1c7d1e=_0x984b[_0x5316a3];return _0x1c7d1e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xb984('0x0'));var moment=require(_0xb984('0x1'));var BPromise=require(_0xb984('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb984('0x3'));var config=require(_0xb984('0x4'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x2cca53,_0x46c541){return _0x2cca53['define'](_0xb984('0x5'),attributes,{'tableName':_0xb984('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb984('0x7')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 95213ef..020068a 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 _0x24ca=['request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s'];(function(_0x4d137f,_0x4cf4fa){var _0x308a9e=function(_0x2944dd){while(--_0x2944dd){_0x4d137f['push'](_0x4d137f['shift']());}};_0x308a9e(++_0x4cf4fa);}(_0x24ca,0x1bc));var _0xa24c=function(_0x1df7b8,_0x2fe5e5){_0x1df7b8=_0x1df7b8-0x0;var _0x29d911=_0x24ca[_0x1df7b8];return _0x29d911;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var moment=require(_0xa24c('0x1'));var BPromise=require(_0xa24c('0x2'));var rs=require(_0xa24c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa24c('0x4'))['db'];var utils=require(_0xa24c('0x5'));var logger=require(_0xa24c('0x6'))(_0xa24c('0x7'));var config=require(_0xa24c('0x8'));var jayson=require(_0xa24c('0x9'));var client=jayson[_0xa24c('0xa')][_0xa24c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd348,_0x257264,_0x9a5013){return new BPromise(function(_0x481196,_0x42d89c){return client[_0xa24c('0xc')](_0x2dd348,_0x9a5013)[_0xa24c('0xd')](function(_0x5eac78){logger[_0xa24c('0xe')](_0xa24c('0xf'),_0x257264,_0xa24c('0x10'));logger[_0xa24c('0x11')](_0xa24c('0x12'),_0x257264,_0xa24c('0x10'),JSON[_0xa24c('0x13')](_0x5eac78));if(_0x5eac78[_0xa24c('0x14')]){if(_0x5eac78[_0xa24c('0x14')]['code']===0x1f4){logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x42d89c(_0x5eac78['error'][_0xa24c('0x15')]);}logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x481196(_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x257264,_0xa24c('0x10'));_0x481196(_0x5eac78[_0xa24c('0x16')]['message']);}})['catch'](function(_0x221d21){logger[_0xa24c('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x257264,_0x221d21);_0x42d89c(_0x221d21);});});} \ No newline at end of file +var _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x008c,0x188));var _0xc008=function(_0x4ea809,_0x5416a6){_0x4ea809=_0x4ea809-0x0;var _0x31be45=_0x008c[_0x4ea809];return _0x31be45;};'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')]('WhatsappApplication,\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')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 7405e02..04ab133 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 _0xcd59=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags'];(function(_0x1829f6,_0x34df48){var _0x59ffff=function(_0x30230b){while(--_0x30230b){_0x1829f6['push'](_0x1829f6['shift']());}};_0x59ffff(++_0x34df48);}(_0xcd59,0x14b));var _0x9cd5=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xcd59[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0x9cd5('0x0'));var util=require(_0x9cd5('0x1'));var path=require(_0x9cd5('0x2'));var timeout=require(_0x9cd5('0x3'));var express=require(_0x9cd5('0x4'));var router=express[_0x9cd5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9cd5('0x6'));var interaction=require(_0x9cd5('0x7'));var config=require(_0x9cd5('0x8'));var controller=require(_0x9cd5('0x9'));router[_0x9cd5('0xa')]('/',auth[_0x9cd5('0xb')](),controller[_0x9cd5('0xc')]);router[_0x9cd5('0xa')](_0x9cd5('0xd'),auth[_0x9cd5('0xb')](),controller['describe']);router[_0x9cd5('0xa')](_0x9cd5('0xe'),auth[_0x9cd5('0xb')](),controller[_0x9cd5('0xf')]);router[_0x9cd5('0xa')](_0x9cd5('0x10'),auth[_0x9cd5('0xb')](),controller[_0x9cd5('0x11')]);router['get'](_0x9cd5('0x12'),auth[_0x9cd5('0xb')](),controller[_0x9cd5('0x13')]);router[_0x9cd5('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9cd5('0x14')](_0x9cd5('0x10'),auth[_0x9cd5('0xb')](),controller[_0x9cd5('0x15')]);router[_0x9cd5('0x14')](_0x9cd5('0x16'),auth['isAuthenticated'](),interaction[_0x9cd5('0x17')](_0x9cd5('0x18'),_0x9cd5('0x19')),controller['addTags']);router['put']('/:id',auth[_0x9cd5('0xb')](),interaction[_0x9cd5('0x17')]('whatsapp',_0x9cd5('0x1a')),controller[_0x9cd5('0x1b')]);router[_0x9cd5('0x1c')]('/:id',auth[_0x9cd5('0xb')](),interaction[_0x9cd5('0x17')](_0x9cd5('0x18'),_0x9cd5('0x1d')),controller[_0x9cd5('0x1e')]);router[_0x9cd5('0x1c')]('/:id/tags',auth[_0x9cd5('0xb')](),controller[_0x9cd5('0x1f')]);module[_0x9cd5('0x20')]=router; \ No newline at end of file +var _0xa6b0=['/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index'];(function(_0x2dca64,_0x85899){var _0x442ba2=function(_0x357ba8){while(--_0x357ba8){_0x2dca64['push'](_0x2dca64['shift']());}};_0x442ba2(++_0x85899);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x420c27,_0xecec40){_0x420c27=_0x420c27-0x0;var _0x555949=_0xa6b0[_0x420c27];return _0x555949;};'use strict';var multer=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a6b('0x2'));var router=express[_0x0a6b('0x3')]();var fs_extra=require(_0x0a6b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var controller=require(_0x0a6b('0x7'));router[_0x0a6b('0x8')]('/',auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xa')]);router[_0x0a6b('0x8')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xc')]);router[_0x0a6b('0x8')](_0x0a6b('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x0a6b('0x8')](_0x0a6b('0xe'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xf')]);router[_0x0a6b('0x8')](_0x0a6b('0x10'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x11')]);router[_0x0a6b('0x12')]('/',auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x13')]);router[_0x0a6b('0x12')](_0x0a6b('0xe'),auth[_0x0a6b('0x9')](),controller['addMessage']);router['post'](_0x0a6b('0x14'),auth[_0x0a6b('0x9')](),interaction[_0x0a6b('0x15')](_0x0a6b('0x16'),_0x0a6b('0x17')),controller[_0x0a6b('0x18')]);router[_0x0a6b('0x19')](_0x0a6b('0xd'),auth[_0x0a6b('0x9')](),interaction[_0x0a6b('0x15')]('whatsapp',_0x0a6b('0x1a')),controller[_0x0a6b('0x1b')]);router['delete'](_0x0a6b('0xd'),auth['isAuthenticated'](),interaction[_0x0a6b('0x15')](_0x0a6b('0x16'),_0x0a6b('0x1c')),controller[_0x0a6b('0x1d')]);router['delete'](_0x0a6b('0x14'),auth[_0x0a6b('0x9')](),controller['removeTags']);module[_0x0a6b('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 7b52600..18166ec 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 _0x873a=['out','BOOLEAN','sequelize','moment','exports','DATE','STRING','ENUM'];(function(_0x21440c,_0x306995){var _0x3ba1f0=function(_0x108d0a){while(--_0x108d0a){_0x21440c['push'](_0x21440c['shift']());}};_0x3ba1f0(++_0x306995);}(_0x873a,0x1c2));var _0xa873=function(_0x142a68,_0xa69a83){_0x142a68=_0x142a68-0x0;var _0x10679d=_0x873a[_0x142a68];return _0x10679d;};'use strict';var Sequelize=require(_0xa873('0x0'));var moment=require(_0xa873('0x1'));module[_0xa873('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa873('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xa873('0x4')]},'note':{'type':Sequelize[_0xa873('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xa873('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xa873('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa873('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa873('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa873('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x6379=['DATE','STRING','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0x13f323,_0x57bdca){var _0x5bf651=function(_0x598adf){while(--_0x598adf){_0x13f323['push'](_0x13f323['shift']());}};_0x5bf651(++_0x57bdca);}(_0x6379,0x84));var _0x9637=function(_0x1a7244,_0x3d99d9){_0x1a7244=_0x1a7244-0x0;var _0x5c4e9f=_0x6379[_0x1a7244];return _0x5c4e9f;};'use strict';var Sequelize=require(_0x9637('0x0'));var moment=require(_0x9637('0x1'));module[_0x9637('0x2')]={'closed':{'type':Sequelize[_0x9637('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9637('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9637('0x5')]},'thirdDisposition':{'type':Sequelize[_0x9637('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x9637('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x9637('0x6')]('in',_0x9637('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9637('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x9637('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 99852ed..fcdaf2b 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 _0xa724=['renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','download','log','unlinkSync','rimraf','bluebird','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','destroy','then','stack','name','WhatsappInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','whatsapp','query','show','model','keys','intersection','fields','attributes','length','includeAll','include','options','find','catch','create','body','update','params','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','filters','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappInteractionId','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','merge','addTags','setTags','spread','color','whatsappInteractionTags:save','removeTags','unix','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','push','fullname','CmContact','Contact','lastName','Attachment','Messages','createdAt','secret','read','WhatsappAccount','Account','Owner','get','Whatsapp','toString','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','direction','out','User','System','firstName','value'];(function(_0x5dbb84,_0x1bbce9){var _0x1d6eae=function(_0xd93967){while(--_0xd93967){_0x5dbb84['push'](_0x5dbb84['shift']());}};_0x1d6eae(++_0x1bbce9);}(_0xa724,0x185));var _0x4a72=function(_0xf164d9,_0x3799e6){_0xf164d9=_0xf164d9-0x0;var _0x367c3b=_0xa724[_0xf164d9];return _0x367c3b;};'use strict';var rimraf=require(_0x4a72('0x0'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x4a72('0x1'));var util=require('util');var path=require(_0x4a72('0x2'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4a72('0x3'));var Redis=require(_0x4a72('0x4'));var interaction=require(_0x4a72('0x5'));var qs=require(_0x4a72('0x6'));var pdf=require('../../components/export/pdf');var logger=require(_0x4a72('0x7'))(_0x4a72('0x8'));var config=require(_0x4a72('0x9'));var db=require(_0x4a72('0xa'))['db'];config[_0x4a72('0xb')]=_['defaults'](config[_0x4a72('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x4a72('0xc'))(new Redis(config[_0x4a72('0xb')]));require(_0x4a72('0xd'))[_0x4a72('0xe')](socket);function respondWithStatusCode(_0x104cc2,_0xba5193){_0xba5193=_0xba5193||0xcc;return function(_0x4ad550){if(_0x4ad550){return _0x104cc2[_0x4a72('0xf')](_0xba5193);}return _0x104cc2[_0x4a72('0x10')](_0xba5193)[_0x4a72('0x11')]();};}function respondWithResult(_0x17c684,_0x3da21c){_0x3da21c=_0x3da21c||0xc8;return function(_0x4884f2){if(_0x4884f2){return _0x17c684[_0x4a72('0x10')](_0x3da21c)[_0x4a72('0x12')](_0x4884f2);}};}function respondWithFilteredResult(_0x5f0312,_0x354653){return function(_0x17af30){if(_0x17af30){var _0x11d135=typeof _0x354653[_0x4a72('0x13')]==='undefined'&&typeof _0x354653[_0x4a72('0x14')]===_0x4a72('0x15');var _0x5b24ca=_0x17af30[_0x4a72('0x16')];var _0x5148a5=_0x11d135?0x0:_0x354653[_0x4a72('0x13')];var _0x30541a=_0x11d135?_0x17af30[_0x4a72('0x16')]:_0x354653[_0x4a72('0x13')]+_0x354653['limit'];var _0x4b6866;if(_0x30541a>=_0x5b24ca){_0x30541a=_0x5b24ca;_0x4b6866=0xc8;}else{_0x4b6866=0xce;}_0x5f0312[_0x4a72('0x10')](_0x4b6866);return _0x5f0312['set'](_0x4a72('0x17'),_0x5148a5+'-'+_0x30541a+'/'+_0x5b24ca)[_0x4a72('0x12')](_0x17af30);}return null;};}function saveUpdates(_0x4f01da){return function(_0x8be444){if(_0x8be444){return _0x8be444['update'](_0x4f01da)['then'](function(_0x29b8a1){return _0x29b8a1;});}return null;};}function removeEntity(_0x133941){return function(_0x1b35bf){if(_0x1b35bf){return _0x1b35bf[_0x4a72('0x18')]()[_0x4a72('0x19')](function(){_0x133941[_0x4a72('0x10')](0xcc)[_0x4a72('0x11')]();});}};}function handleEntityNotFound(_0x5fe6a7){return function(_0x5d2f99){if(!_0x5d2f99){_0x5fe6a7[_0x4a72('0xf')](0x194);}return _0x5d2f99;};}function handleError(_0x504ee3,_0x4c1f8d){_0x4c1f8d=_0x4c1f8d||0x1f4;return function(_0x20b6a4){logger['error'](_0x20b6a4[_0x4a72('0x1a')]);if(_0x20b6a4[_0x4a72('0x1b')]){delete _0x20b6a4['name'];}_0x504ee3[_0x4a72('0x10')](_0x4c1f8d)['send'](_0x20b6a4);};}exports['index']=function(_0x5b1179,_0x1e61d5){var _0x5968c0={};var _0x3f0428=_['map'](db[_0x4a72('0x1c')][_0x4a72('0x1d')],function(_0x3a85c0){return{'name':_0x3a85c0[_0x4a72('0x1e')],'type':_0x3a85c0[_0x4a72('0x1f')][_0x4a72('0x20')]};});_0x5968c0=qs[_0x4a72('0x21')](_0x3f0428,_0x5b1179);return interaction[_0x4a72('0x22')](_0x4a72('0x23'),_0x5b1179[_0x4a72('0x24')],_0x5b1179['user'],_0x5968c0,_0x3f0428)[_0x4a72('0x19')](respondWithFilteredResult(_0x1e61d5,_0x5968c0))['catch'](handleError(_0x1e61d5,null));};exports[_0x4a72('0x25')]=function(_0xf00090,_0x251d56){var _0x1a452f={'raw':![],'where':{'id':_0xf00090['params']['id']}},_0x3d201e={};_0x3d201e[_0x4a72('0x26')]=_[_0x4a72('0x27')](db[_0x4a72('0x1c')][_0x4a72('0x1d')]);_0x3d201e[_0x4a72('0x24')]=_[_0x4a72('0x27')](_0xf00090['query']);_0x3d201e['filters']=_[_0x4a72('0x28')](_0x3d201e['model'],_0x3d201e['query']);_0x1a452f['attributes']=_[_0x4a72('0x28')](_0x3d201e[_0x4a72('0x26')],qs['fields'](_0xf00090[_0x4a72('0x24')][_0x4a72('0x29')]));_0x1a452f['attributes']=_0x1a452f[_0x4a72('0x2a')][_0x4a72('0x2b')]?_0x1a452f[_0x4a72('0x2a')]:_0x3d201e[_0x4a72('0x26')];if(_0xf00090['query'][_0x4a72('0x2c')]){_0x1a452f[_0x4a72('0x2d')]=[{'all':!![]}];}_0x1a452f=_['merge']({},_0x1a452f,_0xf00090[_0x4a72('0x2e')]);return db[_0x4a72('0x1c')][_0x4a72('0x2f')](_0x1a452f)[_0x4a72('0x19')](handleEntityNotFound(_0x251d56,null))[_0x4a72('0x19')](respondWithResult(_0x251d56,null))[_0x4a72('0x30')](handleError(_0x251d56,null));};exports['create']=function(_0xa70ec7,_0x5a98de){return db['WhatsappInteraction'][_0x4a72('0x31')](_0xa70ec7[_0x4a72('0x32')],{})['then'](respondWithResult(_0x5a98de,0xc9))['catch'](handleError(_0x5a98de,null));};exports[_0x4a72('0x33')]=function(_0x487c0d,_0x73338b){if(_0x487c0d[_0x4a72('0x32')]['id']){delete _0x487c0d[_0x4a72('0x32')]['id'];}return db[_0x4a72('0x1c')][_0x4a72('0x2f')]({'where':{'id':_0x487c0d[_0x4a72('0x34')]['id']}})[_0x4a72('0x19')](handleEntityNotFound(_0x73338b,null))[_0x4a72('0x19')](saveUpdates(_0x487c0d[_0x4a72('0x32')],null))[_0x4a72('0x19')](respondWithResult(_0x73338b,null))[_0x4a72('0x30')](handleError(_0x73338b,null));};exports[_0x4a72('0x18')]=function(_0x4491a9,_0x269064){return db['WhatsappInteraction'][_0x4a72('0x2f')]({'where':{'id':_0x4491a9[_0x4a72('0x34')]['id']}})[_0x4a72('0x19')](handleEntityNotFound(_0x269064,null))[_0x4a72('0x19')](removeEntity(_0x269064,null))[_0x4a72('0x30')](handleError(_0x269064,null));};exports[_0x4a72('0x35')]=function(_0x3ce4d2,_0x16e618){return db[_0x4a72('0x1c')][_0x4a72('0x35')]()['then'](respondWithResult(_0x16e618,null))[_0x4a72('0x30')](handleError(_0x16e618,null));};exports[_0x4a72('0x36')]=function(_0x52e7bb,_0x343263){return db[_0x4a72('0x37')]['find']({'where':{'id':_0x52e7bb['params']['id']}})[_0x4a72('0x19')](handleEntityNotFound(_0x343263,null))[_0x4a72('0x19')](function(_0x7d61c3){if(_0x7d61c3){return _0x7d61c3[_0x4a72('0x36')](_0x52e7bb['body'][_0x4a72('0x38')],_[_0x4a72('0x39')](_0x52e7bb[_0x4a72('0x32')],[_0x4a72('0x38'),'id'])||{});}})[_0x4a72('0x19')](respondWithResult(_0x343263,null))[_0x4a72('0x30')](handleError(_0x343263,null));};exports[_0x4a72('0x3a')]=function(_0x265586,_0x40c1a3){var _0x5e584c={'raw':![],'where':{}};var _0x475855={};var _0x292019={'count':0x0,'rows':[]};return db[_0x4a72('0x1c')][_0x4a72('0x3b')]({'where':{'id':_0x265586['params']['id']}})[_0x4a72('0x19')](handleEntityNotFound(_0x40c1a3,null))['then'](function(_0x346695){if(_0x346695){_0x475855[_0x4a72('0x26')]=_[_0x4a72('0x27')](db['WhatsappMessage'][_0x4a72('0x1d')]);_0x475855[_0x4a72('0x24')]=_[_0x4a72('0x27')](_0x265586[_0x4a72('0x24')]);_0x475855[_0x4a72('0x3c')]=_[_0x4a72('0x28')](_0x475855[_0x4a72('0x26')],_0x475855[_0x4a72('0x24')]);_0x5e584c[_0x4a72('0x2a')]=_['intersection'](_0x475855[_0x4a72('0x26')],qs[_0x4a72('0x29')](_0x265586[_0x4a72('0x24')]['fields']));_0x5e584c[_0x4a72('0x2a')]=_0x5e584c[_0x4a72('0x2a')][_0x4a72('0x2b')]?_0x5e584c[_0x4a72('0x2a')]:_0x475855['model'];if(!_0x265586[_0x4a72('0x24')][_0x4a72('0x3d')](_0x4a72('0x3e'))){_0x5e584c[_0x4a72('0x14')]=qs['limit'](_0x265586[_0x4a72('0x24')]['limit']);_0x5e584c[_0x4a72('0x13')]=qs[_0x4a72('0x13')](_0x265586[_0x4a72('0x24')][_0x4a72('0x13')]);}_0x5e584c[_0x4a72('0x3f')]=qs[_0x4a72('0x40')](_0x265586['query']['sort']);_0x5e584c[_0x4a72('0x41')]=qs['filters'](_[_0x4a72('0x42')](_0x265586[_0x4a72('0x24')],_0x475855[_0x4a72('0x3c')]));_0x5e584c[_0x4a72('0x41')][_0x4a72('0x43')]=_0x346695['id'];if(_0x265586[_0x4a72('0x24')][_0x4a72('0x44')]){_0x5e584c[_0x4a72('0x41')]=_['merge'](_0x5e584c['where'],{'$or':_[_0x4a72('0x45')](_0x5e584c[_0x4a72('0x2a')],function(_0x1811b7){var _0x3a12b9={};_0x3a12b9[_0x1811b7]={'$like':'%'+_0x265586[_0x4a72('0x24')][_0x4a72('0x44')]+'%'};return _0x3a12b9;})});}if(_0x265586[_0x4a72('0x24')][_0x4a72('0x46')]){var _0x2bc6a7=_0x265586[_0x4a72('0x24')]['$gte'][_0x4a72('0x47')](',');var _0x128db6={};_0x128db6[_0x2bc6a7[0x0]]={'$gte':moment(_0x2bc6a7[0x1])[_0x4a72('0x48')](_0x4a72('0x49'))};_0x5e584c[_0x4a72('0x41')]=_['merge'](_0x5e584c[_0x4a72('0x41')],_0x128db6);}_0x5e584c=_[_0x4a72('0x4a')]({},_0x5e584c,_0x265586[_0x4a72('0x2e')]);return db[_0x4a72('0x37')]['count']({'where':_0x5e584c[_0x4a72('0x41')]})[_0x4a72('0x19')](function(_0x5168ca){_0x292019[_0x4a72('0x16')]=_0x5168ca;if(_0x265586[_0x4a72('0x24')]['includeAll']){_0x5e584c[_0x4a72('0x2d')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x5e584c);})[_0x4a72('0x19')](function(_0x1d68c4){_0x292019['rows']=_0x1d68c4;return _0x292019;});}})[_0x4a72('0x19')](respondWithFilteredResult(_0x40c1a3,_0x5e584c))[_0x4a72('0x30')](handleError(_0x40c1a3,null));};exports[_0x4a72('0x4b')]=function(_0x2b2ed0,_0x27f818){return db['WhatsappInteraction'][_0x4a72('0x2f')]({'where':{'id':_0x2b2ed0[_0x4a72('0x34')]['id']}})[_0x4a72('0x19')](handleEntityNotFound(_0x27f818,null))[_0x4a72('0x19')](function(_0x2452e7){if(_0x2452e7){return _0x2452e7[_0x4a72('0x4c')](_0x2b2ed0[_0x4a72('0x32')][_0x4a72('0x38')],_['omit'](_0x2b2ed0[_0x4a72('0x32')],['ids','id'])||{})[_0x4a72('0x4d')](function(){return db['Tag'][_0x4a72('0x22')]({'attributes':['id',_0x4a72('0x1b'),_0x4a72('0x4e')],'where':{'id':_0x2b2ed0[_0x4a72('0x32')][_0x4a72('0x38')]}});})['then'](function(_0x844087){socket['emit'](_0x4a72('0x4f'),{'id':Number(_0x2b2ed0[_0x4a72('0x34')]['id']),'tags':_0x844087||[]});return{'id':Number(_0x2b2ed0[_0x4a72('0x34')]['id']),'tags':_0x844087||[]};});}})[_0x4a72('0x19')](respondWithResult(_0x27f818,null))[_0x4a72('0x30')](handleError(_0x27f818,null));};exports[_0x4a72('0x50')]=function(_0x460035,_0x37b75b){return db[_0x4a72('0x1c')][_0x4a72('0x2f')]({'where':{'id':_0x460035[_0x4a72('0x34')]['id']}})['then'](handleEntityNotFound(_0x37b75b,null))[_0x4a72('0x19')](function(_0x468323){if(_0x468323){return _0x468323[_0x4a72('0x50')](_0x460035[_0x4a72('0x24')][_0x4a72('0x38')]);}})[_0x4a72('0x19')](respondWithStatusCode(_0x37b75b,null))[_0x4a72('0x30')](handleError(_0x37b75b,null));};exports['download']=function(_0x27ccff,_0x3dba8d){var _0x2c56f0=moment()[_0x4a72('0x51')]()['toString']();var _0x1683be=path[_0x4a72('0x52')](config[_0x4a72('0x53')],'server',_0x4a72('0x54'),_0x4a72('0x55'));var _0x1031c3=path[_0x4a72('0x52')](config['root'],_0x4a72('0x56'),_0x4a72('0x54'),_0x4a72('0x57'));var _0x39c9d1=path['join'](_0x1683be,_0x2c56f0);var _0x192f2d=util[_0x4a72('0x48')](_0x4a72('0x58'),_0x27ccff[_0x4a72('0x34')]['id'],_0x2c56f0);var _0x138e9b=path[_0x4a72('0x52')](_0x1683be,_0x192f2d);var _0x45d06e=[];_0x45d06e[_0x4a72('0x59')]({'model':db['User'],'as':'User','attributes':['id',_0x4a72('0x5a')],'raw':!![]});_0x45d06e[_0x4a72('0x59')]({'model':db[_0x4a72('0x5b')],'as':_0x4a72('0x5c'),'attributes':['id','firstName',_0x4a72('0x5d')],'raw':!![]});if(_0x27ccff['query'][_0x4a72('0x57')]){_0x45d06e[_0x4a72('0x59')]({'model':db[_0x4a72('0x5e')],'as':_0x4a72('0x5e'),'raw':!![]});}var _0x3b4359=[{'model':db[_0x4a72('0x37')],'as':_0x4a72('0x5f'),'attributes':['id',_0x4a72('0x32'),_0x4a72('0x60'),'direction',_0x4a72('0x61'),_0x4a72('0x62')],'include':_0x45d06e}];_0x3b4359[_0x4a72('0x59')]({'model':db[_0x4a72('0x63')],'as':_0x4a72('0x64'),'attributes':['id',_0x4a72('0x1b')]});_0x3b4359[_0x4a72('0x59')]({'model':db['User'],'as':_0x4a72('0x65'),'attributes':['id',_0x4a72('0x5a')]});return db[_0x4a72('0x1c')]['find']({'where':{'id':_0x27ccff[_0x4a72('0x34')]['id']},'include':_0x3b4359})[_0x4a72('0x19')](handleEntityNotFound(_0x3dba8d,null))['then'](function(_0x370e79){if(_0x370e79){var _0x5b1493=_0x370e79[_0x4a72('0x66')]({'plain':!![]});fs['mkdirSync'](_0x39c9d1);var _0x3d52ae={'channel':_0x4a72('0x67'),'account':_0x5b1493[_0x4a72('0x64')][_0x4a72('0x1b')],'agent':_0x5b1493[_0x4a72('0x65')]?_0x5b1493['Owner']['fullname']:'N.A.','createdAt':moment(_0x5b1493[_0x4a72('0x60')])['format'](_0x4a72('0x49'))[_0x4a72('0x68')](),'closedAt':_0x5b1493[_0x4a72('0x69')]?moment(_0x5b1493[_0x4a72('0x6a')])['format'](_0x4a72('0x49'))['toString']():'','disposition':_0x5b1493[_0x4a72('0x6b')],'messages':_(_0x5b1493['Messages'])['filter']({'secret':![]})[_0x4a72('0x45')](function(_0x26dce2){if(_0x26dce2['Attachment']){var _0x126bae=path[_0x4a72('0x52')](_0x1031c3,_0x26dce2['Attachment'][_0x4a72('0x6c')]);if(fs[_0x4a72('0x6d')](_0x126bae)){fs[_0x4a72('0x6e')](_0x126bae)[_0x4a72('0x6f')](fs[_0x4a72('0x70')](path[_0x4a72('0x52')](_0x39c9d1,_0x26dce2[_0x4a72('0x5e')][_0x4a72('0x6c')])));}}return{'date':moment(_0x26dce2[_0x4a72('0x60')])[_0x4a72('0x48')](_0x4a72('0x49'))[_0x4a72('0x68')](),'sender':_0x26dce2[_0x4a72('0x71')]===_0x4a72('0x72')?_0x26dce2[_0x4a72('0x73')]?_0x26dce2[_0x4a72('0x73')][_0x4a72('0x5a')]:_0x4a72('0x74'):_0x26dce2[_0x4a72('0x5c')][_0x4a72('0x75')]+(_0x26dce2[_0x4a72('0x5c')][_0x4a72('0x5d')]?'\x20'+_0x26dce2[_0x4a72('0x5c')]['lastName']:''),'body':_0x26dce2[_0x4a72('0x5e')]?_0x26dce2[_0x4a72('0x5e')][_0x4a72('0x6c')]:_0x26dce2['body'],'direction':_0x26dce2[_0x4a72('0x71')]==='out'?'A':'C','secret':_0x26dce2[_0x4a72('0x61')],'read':_0x26dce2[_0x4a72('0x62')],'attachment':_0x26dce2[_0x4a72('0x5e')]};})[_0x4a72('0x76')]()};return ejs[_0x4a72('0x77')](path[_0x4a72('0x52')](config[_0x4a72('0x53')],'server',_0x4a72('0x78'),_0x4a72('0x79')),{'interaction':_0x3d52ae})[_0x4a72('0x19')](function(_0x29b4ee){var _0x4fc6e0=path[_0x4a72('0x52')](_0x39c9d1,'transcript-'+_0x5b1493['id']+'-'+_0x2c56f0+_0x4a72('0x7a'));var _0x1a1b8c={'path':_0x4fc6e0,'channel':_0x4a72('0x67'),'interactionId':_0x5b1493['id']};return pdf[_0x4a72('0x7b')](_0x29b4ee,_0x1a1b8c);})[_0x4a72('0x19')](function(){return new BPromise(function(_0x193ae7,_0x4ca87d){zipdir(_0x39c9d1,{'saveTo':_0x138e9b},function(_0x1ecf2f,_0x7a6e16){if(_0x1ecf2f)return _0x4ca87d(_0x1ecf2f);return _0x193ae7(_0x7a6e16);});})['then'](function(){return new BPromise(function(_0x254dd5,_0x47690a){rimraf(_0x39c9d1,function(_0x4c1885){if(_0x4c1885)_0x47690a(_0x4c1885);return _0x254dd5();});});})[_0x4a72('0x19')](function(){return _0x3dba8d[_0x4a72('0x7c')](_0x138e9b,_0x192f2d,function(_0xf4a8a8){if(_0xf4a8a8){console[_0x4a72('0x7d')]('err',_0xf4a8a8);}else{fs[_0x4a72('0x7e')](_0x138e9b);}});});});}else{return _0x3dba8d['sendStatus'](0xc8);}})[_0x4a72('0x30')](handleError(_0x3dba8d,null));}; \ No newline at end of file +var _0xcd94=['N.A.','closed','closedAt','toString','existsSync','createWriteStream','basename','out','System','secret','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','zip-dir','moment','bluebird','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','update','then','destroy','end','error','stack','name','send','index','WhatsappInteraction','rawAttributes','fieldName','type','getOptions','findAll','whatsapp','user','show','params','model','keys','filters','intersection','query','attributes','fields','length','includeAll','include','merge','options','catch','create','body','find','describe','addMessage','WhatsappMessage','omit','getMessages','findOne','hasOwnProperty','nolimit','order','where','pick','WhatsappInteractionId','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','ids','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','unix','join','tmp','root','server','files','attachments','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','read','WhatsappAccount','Account','Owner','get','Whatsapp'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xcd94,0x19b));var _0x4cd9=function(_0x7cb10c,_0x2fcc3a){_0x7cb10c=_0x7cb10c-0x0;var _0x11df59=_0xcd94[_0x7cb10c];return _0x11df59;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x4cd9('0x0'));var moment=require(_0x4cd9('0x1'));var BPromise=require(_0x4cd9('0x2'));var util=require(_0x4cd9('0x3'));var path=require(_0x4cd9('0x4'));var ejs=require(_0x4cd9('0x5'));var fs=require('fs');var _=require(_0x4cd9('0x6'));var Redis=require('ioredis');var interaction=require(_0x4cd9('0x7'));var qs=require(_0x4cd9('0x8'));var pdf=require(_0x4cd9('0x9'));var logger=require(_0x4cd9('0xa'))(_0x4cd9('0xb'));var config=require(_0x4cd9('0xc'));var db=require(_0x4cd9('0xd'))['db'];config[_0x4cd9('0xe')]=_[_0x4cd9('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4cd9('0x10'))(new Redis(config[_0x4cd9('0xe')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x4a424a,_0x4d70e3){_0x4d70e3=_0x4d70e3||0xcc;return function(_0x515512){if(_0x515512){return _0x4a424a[_0x4cd9('0x11')](_0x4d70e3);}return _0x4a424a[_0x4cd9('0x12')](_0x4d70e3)['end']();};}function respondWithResult(_0x5e2773,_0x25f934){_0x25f934=_0x25f934||0xc8;return function(_0xf50e8c){if(_0xf50e8c){return _0x5e2773[_0x4cd9('0x12')](_0x25f934)[_0x4cd9('0x13')](_0xf50e8c);}};}function respondWithFilteredResult(_0x522a10,_0x3c35d7){return function(_0x5839c2){if(_0x5839c2){var _0x42f724=typeof _0x3c35d7[_0x4cd9('0x14')]===_0x4cd9('0x15')&&typeof _0x3c35d7[_0x4cd9('0x16')]===_0x4cd9('0x15');var _0xc8f727=_0x5839c2[_0x4cd9('0x17')];var _0x3b020d=_0x42f724?0x0:_0x3c35d7['offset'];var _0x4b0ba3=_0x42f724?_0x5839c2[_0x4cd9('0x17')]:_0x3c35d7[_0x4cd9('0x14')]+_0x3c35d7[_0x4cd9('0x16')];var _0x2b471f;if(_0x4b0ba3>=_0xc8f727){_0x4b0ba3=_0xc8f727;_0x2b471f=0xc8;}else{_0x2b471f=0xce;}_0x522a10[_0x4cd9('0x12')](_0x2b471f);return _0x522a10[_0x4cd9('0x18')]('Content-Range',_0x3b020d+'-'+_0x4b0ba3+'/'+_0xc8f727)[_0x4cd9('0x13')](_0x5839c2);}return null;};}function saveUpdates(_0x187dfa){return function(_0x1dbc8a){if(_0x1dbc8a){return _0x1dbc8a[_0x4cd9('0x19')](_0x187dfa)[_0x4cd9('0x1a')](function(_0x9b74bd){return _0x9b74bd;});}return null;};}function removeEntity(_0x366d97){return function(_0x39efdb){if(_0x39efdb){return _0x39efdb[_0x4cd9('0x1b')]()['then'](function(){_0x366d97[_0x4cd9('0x12')](0xcc)[_0x4cd9('0x1c')]();});}};}function handleEntityNotFound(_0x4f6b7f){return function(_0x28ccfd){if(!_0x28ccfd){_0x4f6b7f['sendStatus'](0x194);}return _0x28ccfd;};}function handleError(_0x26ee3c,_0x4424dc){_0x4424dc=_0x4424dc||0x1f4;return function(_0x2cc1b4){logger[_0x4cd9('0x1d')](_0x2cc1b4[_0x4cd9('0x1e')]);if(_0x2cc1b4[_0x4cd9('0x1f')]){delete _0x2cc1b4[_0x4cd9('0x1f')];}_0x26ee3c['status'](_0x4424dc)[_0x4cd9('0x20')](_0x2cc1b4);};}exports[_0x4cd9('0x21')]=function(_0x3bca78,_0x423153){var _0x2f0ed1={};var _0x5c0464=_['map'](db[_0x4cd9('0x22')][_0x4cd9('0x23')],function(_0x1954ed){return{'name':_0x1954ed[_0x4cd9('0x24')],'type':_0x1954ed[_0x4cd9('0x25')]['key']};});_0x2f0ed1=qs[_0x4cd9('0x26')](_0x5c0464,_0x3bca78);return interaction[_0x4cd9('0x27')](_0x4cd9('0x28'),_0x3bca78['query'],_0x3bca78[_0x4cd9('0x29')],_0x2f0ed1,_0x5c0464)['then'](respondWithFilteredResult(_0x423153,_0x2f0ed1))['catch'](handleError(_0x423153,null));};exports[_0x4cd9('0x2a')]=function(_0x25aee2,_0x39402b){var _0xb00090={'raw':![],'where':{'id':_0x25aee2[_0x4cd9('0x2b')]['id']}},_0x2d0910={};_0x2d0910[_0x4cd9('0x2c')]=_['keys'](db['WhatsappInteraction']['rawAttributes']);_0x2d0910['query']=_[_0x4cd9('0x2d')](_0x25aee2['query']);_0x2d0910[_0x4cd9('0x2e')]=_[_0x4cd9('0x2f')](_0x2d0910[_0x4cd9('0x2c')],_0x2d0910[_0x4cd9('0x30')]);_0xb00090[_0x4cd9('0x31')]=_['intersection'](_0x2d0910[_0x4cd9('0x2c')],qs[_0x4cd9('0x32')](_0x25aee2[_0x4cd9('0x30')][_0x4cd9('0x32')]));_0xb00090[_0x4cd9('0x31')]=_0xb00090[_0x4cd9('0x31')][_0x4cd9('0x33')]?_0xb00090[_0x4cd9('0x31')]:_0x2d0910[_0x4cd9('0x2c')];if(_0x25aee2['query'][_0x4cd9('0x34')]){_0xb00090[_0x4cd9('0x35')]=[{'all':!![]}];}_0xb00090=_[_0x4cd9('0x36')]({},_0xb00090,_0x25aee2[_0x4cd9('0x37')]);return db[_0x4cd9('0x22')]['find'](_0xb00090)['then'](handleEntityNotFound(_0x39402b,null))[_0x4cd9('0x1a')](respondWithResult(_0x39402b,null))[_0x4cd9('0x38')](handleError(_0x39402b,null));};exports[_0x4cd9('0x39')]=function(_0xb80264,_0x5f0ba2){return db[_0x4cd9('0x22')]['create'](_0xb80264[_0x4cd9('0x3a')],{})['then'](respondWithResult(_0x5f0ba2,0xc9))[_0x4cd9('0x38')](handleError(_0x5f0ba2,null));};exports[_0x4cd9('0x19')]=function(_0x4120ea,_0xf7da19){if(_0x4120ea[_0x4cd9('0x3a')]['id']){delete _0x4120ea[_0x4cd9('0x3a')]['id'];}return db[_0x4cd9('0x22')][_0x4cd9('0x3b')]({'where':{'id':_0x4120ea[_0x4cd9('0x2b')]['id']}})[_0x4cd9('0x1a')](handleEntityNotFound(_0xf7da19,null))['then'](saveUpdates(_0x4120ea['body'],null))[_0x4cd9('0x1a')](respondWithResult(_0xf7da19,null))[_0x4cd9('0x38')](handleError(_0xf7da19,null));};exports[_0x4cd9('0x1b')]=function(_0xa257bf,_0x29554a){return db[_0x4cd9('0x22')][_0x4cd9('0x3b')]({'where':{'id':_0xa257bf[_0x4cd9('0x2b')]['id']}})[_0x4cd9('0x1a')](handleEntityNotFound(_0x29554a,null))[_0x4cd9('0x1a')](removeEntity(_0x29554a,null))[_0x4cd9('0x38')](handleError(_0x29554a,null));};exports['describe']=function(_0x97f7fa,_0x2a2abc){return db[_0x4cd9('0x22')][_0x4cd9('0x3c')]()['then'](respondWithResult(_0x2a2abc,null))['catch'](handleError(_0x2a2abc,null));};exports[_0x4cd9('0x3d')]=function(_0x2eb5c5,_0x48d9ff){return db[_0x4cd9('0x3e')][_0x4cd9('0x3b')]({'where':{'id':_0x2eb5c5[_0x4cd9('0x2b')]['id']}})[_0x4cd9('0x1a')](handleEntityNotFound(_0x48d9ff,null))[_0x4cd9('0x1a')](function(_0xc745db){if(_0xc745db){return _0xc745db[_0x4cd9('0x3d')](_0x2eb5c5[_0x4cd9('0x3a')]['ids'],_[_0x4cd9('0x3f')](_0x2eb5c5['body'],['ids','id'])||{});}})[_0x4cd9('0x1a')](respondWithResult(_0x48d9ff,null))[_0x4cd9('0x38')](handleError(_0x48d9ff,null));};exports[_0x4cd9('0x40')]=function(_0x441452,_0x363587){var _0x71cf4c={'raw':![],'where':{}};var _0xbd8b4a={};var _0x5dae70={'count':0x0,'rows':[]};return db[_0x4cd9('0x22')][_0x4cd9('0x41')]({'where':{'id':_0x441452[_0x4cd9('0x2b')]['id']}})[_0x4cd9('0x1a')](handleEntityNotFound(_0x363587,null))[_0x4cd9('0x1a')](function(_0x4a094b){if(_0x4a094b){_0xbd8b4a['model']=_[_0x4cd9('0x2d')](db[_0x4cd9('0x3e')][_0x4cd9('0x23')]);_0xbd8b4a[_0x4cd9('0x30')]=_['keys'](_0x441452[_0x4cd9('0x30')]);_0xbd8b4a[_0x4cd9('0x2e')]=_[_0x4cd9('0x2f')](_0xbd8b4a[_0x4cd9('0x2c')],_0xbd8b4a[_0x4cd9('0x30')]);_0x71cf4c[_0x4cd9('0x31')]=_[_0x4cd9('0x2f')](_0xbd8b4a[_0x4cd9('0x2c')],qs[_0x4cd9('0x32')](_0x441452[_0x4cd9('0x30')][_0x4cd9('0x32')]));_0x71cf4c['attributes']=_0x71cf4c[_0x4cd9('0x31')][_0x4cd9('0x33')]?_0x71cf4c[_0x4cd9('0x31')]:_0xbd8b4a[_0x4cd9('0x2c')];if(!_0x441452[_0x4cd9('0x30')][_0x4cd9('0x42')](_0x4cd9('0x43'))){_0x71cf4c[_0x4cd9('0x16')]=qs[_0x4cd9('0x16')](_0x441452[_0x4cd9('0x30')]['limit']);_0x71cf4c[_0x4cd9('0x14')]=qs[_0x4cd9('0x14')](_0x441452[_0x4cd9('0x30')][_0x4cd9('0x14')]);}_0x71cf4c[_0x4cd9('0x44')]=qs['sort'](_0x441452['query']['sort']);_0x71cf4c[_0x4cd9('0x45')]=qs[_0x4cd9('0x2e')](_[_0x4cd9('0x46')](_0x441452[_0x4cd9('0x30')],_0xbd8b4a['filters']));_0x71cf4c[_0x4cd9('0x45')][_0x4cd9('0x47')]=_0x4a094b['id'];if(_0x441452[_0x4cd9('0x30')][_0x4cd9('0x48')]){_0x71cf4c[_0x4cd9('0x45')]=_['merge'](_0x71cf4c[_0x4cd9('0x45')],{'$or':_[_0x4cd9('0x49')](_0x71cf4c[_0x4cd9('0x31')],function(_0x371d90){var _0x3ddc3a={};_0x3ddc3a[_0x371d90]={'$like':'%'+_0x441452[_0x4cd9('0x30')][_0x4cd9('0x48')]+'%'};return _0x3ddc3a;})});}if(_0x441452[_0x4cd9('0x30')]['$gte']){var _0x45f9db=_0x441452[_0x4cd9('0x30')][_0x4cd9('0x4a')][_0x4cd9('0x4b')](',');var _0x263467={};_0x263467[_0x45f9db[0x0]]={'$gte':moment(_0x45f9db[0x1])[_0x4cd9('0x4c')](_0x4cd9('0x4d'))};_0x71cf4c[_0x4cd9('0x45')]=_[_0x4cd9('0x36')](_0x71cf4c[_0x4cd9('0x45')],_0x263467);}_0x71cf4c=_[_0x4cd9('0x36')]({},_0x71cf4c,_0x441452[_0x4cd9('0x37')]);return db[_0x4cd9('0x3e')][_0x4cd9('0x17')]({'where':_0x71cf4c['where']})[_0x4cd9('0x1a')](function(_0x1aa3e0){_0x5dae70[_0x4cd9('0x17')]=_0x1aa3e0;if(_0x441452[_0x4cd9('0x30')]['includeAll']){_0x71cf4c[_0x4cd9('0x35')]=[{'all':!![]}];}return db[_0x4cd9('0x3e')]['findAll'](_0x71cf4c);})[_0x4cd9('0x1a')](function(_0x5a4fff){_0x5dae70[_0x4cd9('0x4e')]=_0x5a4fff;return _0x5dae70;});}})[_0x4cd9('0x1a')](respondWithFilteredResult(_0x363587,_0x71cf4c))['catch'](handleError(_0x363587,null));};exports[_0x4cd9('0x4f')]=function(_0x2eebfc,_0x3895de){return db[_0x4cd9('0x22')][_0x4cd9('0x3b')]({'where':{'id':_0x2eebfc[_0x4cd9('0x2b')]['id']}})['then'](handleEntityNotFound(_0x3895de,null))['then'](function(_0x1703a3){if(_0x1703a3){return _0x1703a3[_0x4cd9('0x50')](_0x2eebfc[_0x4cd9('0x3a')][_0x4cd9('0x51')],_[_0x4cd9('0x3f')](_0x2eebfc[_0x4cd9('0x3a')],[_0x4cd9('0x51'),'id'])||{})[_0x4cd9('0x52')](function(){return db[_0x4cd9('0x53')]['findAll']({'attributes':['id','name',_0x4cd9('0x54')],'where':{'id':_0x2eebfc[_0x4cd9('0x3a')][_0x4cd9('0x51')]}});})[_0x4cd9('0x1a')](function(_0x5dd615){socket[_0x4cd9('0x55')](_0x4cd9('0x56'),{'id':Number(_0x2eebfc[_0x4cd9('0x2b')]['id']),'tags':_0x5dd615||[]});return{'id':Number(_0x2eebfc[_0x4cd9('0x2b')]['id']),'tags':_0x5dd615||[]};});}})[_0x4cd9('0x1a')](respondWithResult(_0x3895de,null))['catch'](handleError(_0x3895de,null));};exports[_0x4cd9('0x57')]=function(_0x52adfa,_0x43a373){return db['WhatsappInteraction'][_0x4cd9('0x3b')]({'where':{'id':_0x52adfa[_0x4cd9('0x2b')]['id']}})['then'](handleEntityNotFound(_0x43a373,null))[_0x4cd9('0x1a')](function(_0x277611){if(_0x277611){return _0x277611['removeTags'](_0x52adfa[_0x4cd9('0x30')][_0x4cd9('0x51')]);}})['then'](respondWithStatusCode(_0x43a373,null))[_0x4cd9('0x38')](handleError(_0x43a373,null));};exports[_0x4cd9('0x58')]=function(_0x496500,_0xe8d1d6){var _0x1a0c4d=moment()[_0x4cd9('0x59')]()['toString']();var _0x32def3=path[_0x4cd9('0x5a')](config['root'],'server','files',_0x4cd9('0x5b'));var _0x38be1d=path[_0x4cd9('0x5a')](config[_0x4cd9('0x5c')],_0x4cd9('0x5d'),_0x4cd9('0x5e'),_0x4cd9('0x5f'));var _0x4ef105=path['join'](_0x32def3,_0x1a0c4d);var _0x8d6ce0=util[_0x4cd9('0x4c')]('transcript-%d-%s.zip',_0x496500[_0x4cd9('0x2b')]['id'],_0x1a0c4d);var _0x169fee=path[_0x4cd9('0x5a')](_0x32def3,_0x8d6ce0);var _0x2fafc0=[];_0x2fafc0[_0x4cd9('0x60')]({'model':db[_0x4cd9('0x61')],'as':'User','attributes':['id',_0x4cd9('0x62')],'raw':!![]});_0x2fafc0[_0x4cd9('0x60')]({'model':db[_0x4cd9('0x63')],'as':_0x4cd9('0x64'),'attributes':['id',_0x4cd9('0x65'),_0x4cd9('0x66')],'raw':!![]});if(_0x496500[_0x4cd9('0x30')][_0x4cd9('0x5f')]){_0x2fafc0[_0x4cd9('0x60')]({'model':db[_0x4cd9('0x67')],'as':_0x4cd9('0x67'),'raw':!![]});}var _0x473144=[{'model':db[_0x4cd9('0x3e')],'as':_0x4cd9('0x68'),'attributes':['id',_0x4cd9('0x3a'),_0x4cd9('0x69'),_0x4cd9('0x6a'),'secret',_0x4cd9('0x6b')],'include':_0x2fafc0}];_0x473144['push']({'model':db[_0x4cd9('0x6c')],'as':_0x4cd9('0x6d'),'attributes':['id',_0x4cd9('0x1f')]});_0x473144[_0x4cd9('0x60')]({'model':db['User'],'as':_0x4cd9('0x6e'),'attributes':['id',_0x4cd9('0x62')]});return db[_0x4cd9('0x22')][_0x4cd9('0x3b')]({'where':{'id':_0x496500['params']['id']},'include':_0x473144})[_0x4cd9('0x1a')](handleEntityNotFound(_0xe8d1d6,null))['then'](function(_0xfe47d5){if(_0xfe47d5){var _0x258756=_0xfe47d5[_0x4cd9('0x6f')]({'plain':!![]});fs['mkdirSync'](_0x4ef105);var _0x485155={'channel':_0x4cd9('0x70'),'account':_0x258756[_0x4cd9('0x6d')][_0x4cd9('0x1f')],'agent':_0x258756[_0x4cd9('0x6e')]?_0x258756[_0x4cd9('0x6e')][_0x4cd9('0x62')]:_0x4cd9('0x71'),'createdAt':moment(_0x258756[_0x4cd9('0x69')])[_0x4cd9('0x4c')](_0x4cd9('0x4d'))['toString'](),'closedAt':_0x258756[_0x4cd9('0x72')]?moment(_0x258756[_0x4cd9('0x73')])['format'](_0x4cd9('0x4d'))[_0x4cd9('0x74')]():'','disposition':_0x258756['disposition'],'messages':_(_0x258756[_0x4cd9('0x68')])[_0x4cd9('0x48')]({'secret':![]})[_0x4cd9('0x49')](function(_0xe87ae){if(_0xe87ae[_0x4cd9('0x67')]){var _0x1067f0=path[_0x4cd9('0x5a')](_0x38be1d,_0xe87ae['Attachment']['basename']);if(fs[_0x4cd9('0x75')](_0x1067f0)){fs['createReadStream'](_0x1067f0)['pipe'](fs[_0x4cd9('0x76')](path[_0x4cd9('0x5a')](_0x4ef105,_0xe87ae['Attachment'][_0x4cd9('0x77')])));}}return{'date':moment(_0xe87ae[_0x4cd9('0x69')])[_0x4cd9('0x4c')](_0x4cd9('0x4d'))[_0x4cd9('0x74')](),'sender':_0xe87ae['direction']===_0x4cd9('0x78')?_0xe87ae[_0x4cd9('0x61')]?_0xe87ae[_0x4cd9('0x61')][_0x4cd9('0x62')]:_0x4cd9('0x79'):_0xe87ae[_0x4cd9('0x64')]['firstName']+(_0xe87ae[_0x4cd9('0x64')][_0x4cd9('0x66')]?'\x20'+_0xe87ae[_0x4cd9('0x64')]['lastName']:''),'body':_0xe87ae['Attachment']?_0xe87ae[_0x4cd9('0x67')][_0x4cd9('0x77')]:_0xe87ae[_0x4cd9('0x3a')],'direction':_0xe87ae[_0x4cd9('0x6a')]==='out'?'A':'C','secret':_0xe87ae[_0x4cd9('0x7a')],'read':_0xe87ae[_0x4cd9('0x6b')],'attachment':_0xe87ae['Attachment']};})[_0x4cd9('0x7b')]()};return ejs[_0x4cd9('0x7c')](path['join'](config[_0x4cd9('0x5c')],'server','views',_0x4cd9('0x7d')),{'interaction':_0x485155})['then'](function(_0x201d9d){var _0x3999f1=path[_0x4cd9('0x5a')](_0x4ef105,_0x4cd9('0x7e')+_0x258756['id']+'-'+_0x1a0c4d+_0x4cd9('0x7f'));var _0xf7e0c6={'path':_0x3999f1,'channel':_0x4cd9('0x70'),'interactionId':_0x258756['id']};return pdf[_0x4cd9('0x80')](_0x201d9d,_0xf7e0c6);})['then'](function(){return new BPromise(function(_0x3886f9,_0x47bfdd){zipdir(_0x4ef105,{'saveTo':_0x169fee},function(_0x4dbcbe,_0x1abad1){if(_0x4dbcbe)return _0x47bfdd(_0x4dbcbe);return _0x3886f9(_0x1abad1);});})['then'](function(){return new BPromise(function(_0x2a2d0a,_0x2e4a3a){rimraf(_0x4ef105,function(_0x327a4d){if(_0x327a4d)_0x2e4a3a(_0x327a4d);return _0x2a2d0a();});});})[_0x4cd9('0x1a')](function(){return _0xe8d1d6[_0x4cd9('0x58')](_0x169fee,_0x8d6ce0,function(_0x114555){if(_0x114555){console[_0x4cd9('0x81')](_0x4cd9('0x82'),_0x114555);}else{fs['unlinkSync'](_0x169fee);}});});});}else{return _0xe8d1d6['sendStatus'](0xc8);}})[_0x4cd9('0x38')](handleError(_0xe8d1d6,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index c08dd0e..aa83d51 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 _0x453b=['../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x5e1b49,_0x49a243){var _0x119fd7=function(_0x197f1d){while(--_0x197f1d){_0x5e1b49['push'](_0x5e1b49['shift']());}};_0x119fd7(++_0x49a243);}(_0x453b,0x164));var _0xb453=function(_0x5cc3d4,_0xbcbf9b){_0x5cc3d4=_0x5cc3d4-0x0;var _0x17ca31=_0x453b[_0x5cc3d4];return _0x17ca31;};'use strict';var EventEmitter=require(_0xb453('0x0'));var WhatsappInteraction=require(_0xb453('0x1'))['db'][_0xb453('0x2')];var WhatsappMessage=require(_0xb453('0x1'))['db'][_0xb453('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xb453('0x4')](0x0);var events={'afterCreate':_0xb453('0x5'),'afterUpdate':_0xb453('0x6'),'afterDestroy':_0xb453('0x7')};function emitEvent(_0x1314f4){return function(_0x6ee7a0,_0x3cfd60,_0x434695){_0x6ee7a0[_0xb453('0x8')]({'attributes':['id'],'raw':!![]})[_0xb453('0x9')](function(_0x2436a7){_0x6ee7a0['setDataValue'](_0xb453('0xa'),_0x2436a7[_0xb453('0xb')](function(_0x55b2fa){return{'id':_0x55b2fa['id']};}));return WhatsappMessage[_0xb453('0xc')]({'where':{'WhatsappInteractionId':_0x6ee7a0['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x894303){_0x6ee7a0[_0xb453('0xd')](_0xb453('0xe'),_0x894303[_0xb453('0xf')]);WhatsappInteractionEvents['emit'](_0x1314f4+':'+_0x6ee7a0['id'],_0x6ee7a0);WhatsappInteractionEvents[_0xb453('0x10')](_0x1314f4,_0x6ee7a0);_0x434695(null);})[_0xb453('0x11')](_0x434695(null));};}for(var e in events){if(events[_0xb453('0x12')](e)){var event=events[e];WhatsappInteraction[_0xb453('0x13')](e,emitEvent(event));}}module[_0xb453('0x14')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x3c81=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','getUsers','then','Users','findAll','setDataValue','unreadMessages','length','emit','catch'];(function(_0x20713e,_0x44f710){var _0x7d998b=function(_0x5d98ab){while(--_0x5d98ab){_0x20713e['push'](_0x20713e['shift']());}};_0x7d998b(++_0x44f710);}(_0x3c81,0x102));var _0x13c8=function(_0x38c797,_0x3bee1f){_0x38c797=_0x38c797-0x0;var _0x5f4ef6=_0x3c81[_0x38c797];return _0x5f4ef6;};'use strict';var EventEmitter=require(_0x13c8('0x0'));var WhatsappInteraction=require(_0x13c8('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x13c8('0x1'))['db'][_0x13c8('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x101d4f){return function(_0x3ec886,_0x18bd0f,_0x1c16f1){_0x3ec886[_0x13c8('0x3')]({'attributes':['id'],'raw':!![]})[_0x13c8('0x4')](function(_0x445b69){_0x3ec886['setDataValue'](_0x13c8('0x5'),_0x445b69['map'](function(_0x380aed){return{'id':_0x380aed['id']};}));return WhatsappMessage[_0x13c8('0x6')]({'where':{'WhatsappInteractionId':_0x3ec886['id'],'direction':'in','read':![]},'raw':!![]});})[_0x13c8('0x4')](function(_0x30b4d6){_0x3ec886[_0x13c8('0x7')](_0x13c8('0x8'),_0x30b4d6[_0x13c8('0x9')]);WhatsappInteractionEvents[_0x13c8('0xa')](_0x101d4f+':'+_0x3ec886['id'],_0x3ec886);WhatsappInteractionEvents[_0x13c8('0xa')](_0x101d4f,_0x3ec886);_0x1c16f1(null);})[_0x13c8('0xb')](_0x1c16f1(null));};}for(var e in events){if(events[_0x13c8('0xc')](e)){var event=events[e];WhatsappInteraction[_0x13c8('0xd')](e,emitEvent(event));}}module[_0x13c8('0xe')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 66899ba..a8be18f 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 _0xde05=['WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports'];(function(_0x9cbfe0,_0x56aada){var _0x1f1534=function(_0x422947){while(--_0x422947){_0x9cbfe0['push'](_0x9cbfe0['shift']());}};_0x1f1534(++_0x56aada);}(_0xde05,0xf1));var _0x5de0=function(_0x146c5d,_0x1237ba){_0x146c5d=_0x146c5d-0x0;var _0x25c278=_0xde05[_0x146c5d];return _0x25c278;};'use strict';var _=require('lodash');var util=require(_0x5de0('0x0'));var logger=require(_0x5de0('0x1'))(_0x5de0('0x2'));var moment=require(_0x5de0('0x3'));var BPromise=require(_0x5de0('0x4'));var rp=require(_0x5de0('0x5'));var fs=require('fs');var path=require(_0x5de0('0x6'));var rimraf=require(_0x5de0('0x7'));var config=require(_0x5de0('0x8'));var attributes=require(_0x5de0('0x9'));module[_0x5de0('0xa')]=function(_0x27d7cf,_0x2b3da3){return _0x27d7cf['define'](_0x5de0('0xb'),attributes,{'tableName':_0x5de0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2ec328,_0x15a815,_0x286129){if(_0x2ec328[_0x5de0('0xd')](_0x5de0('0xe'))){_0x2ec328[_0x5de0('0xf')]=moment()[_0x5de0('0x10')](_0x5de0('0x11'));}_0x286129(null,_0x2ec328);}}});}; \ No newline at end of file +var _0xaae4=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format'];(function(_0x1bfee7,_0x4a9c39){var _0x5aa07b=function(_0x3995fc){while(--_0x3995fc){_0x1bfee7['push'](_0x1bfee7['shift']());}};_0x5aa07b(++_0x4a9c39);}(_0xaae4,0x120));var _0x4aae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaae4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4aae('0x0'));var util=require(_0x4aae('0x1'));var logger=require(_0x4aae('0x2'))('api');var moment=require(_0x4aae('0x3'));var BPromise=require(_0x4aae('0x4'));var rp=require(_0x4aae('0x5'));var fs=require('fs');var path=require(_0x4aae('0x6'));var rimraf=require(_0x4aae('0x7'));var config=require(_0x4aae('0x8'));var attributes=require(_0x4aae('0x9'));module['exports']=function(_0xb5135a,_0x32b1fc){return _0xb5135a['define'](_0x4aae('0xa'),attributes,{'tableName':_0x4aae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1c4b45,_0x262bc4,_0x1aaf7b){if(_0x1c4b45[_0x4aae('0xc')](_0x4aae('0xd'))){_0x1c4b45[_0x4aae('0xe')]=moment()[_0x4aae('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1aaf7b(null,_0x1c4b45);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index e9c1144..c8c5a68 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 _0xe962=['client','http','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','request','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','then','catch','AddTagsToWhatsappInteraction','find','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xe962,0x154));var _0x2e96=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe962[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2e96('0x0'));var util=require(_0x2e96('0x1'));var moment=require(_0x2e96('0x2'));var BPromise=require('bluebird');var rs=require(_0x2e96('0x3'));var fs=require('fs');var Redis=require(_0x2e96('0x4'));var db=require(_0x2e96('0x5'))['db'];var utils=require(_0x2e96('0x6'));var logger=require(_0x2e96('0x7'))(_0x2e96('0x8'));var config=require(_0x2e96('0x9'));var jayson=require(_0x2e96('0xa'));var client=jayson[_0x2e96('0xb')][_0x2e96('0xc')]({'port':0x232a});config[_0x2e96('0xd')]=_[_0x2e96('0xe')](config[_0x2e96('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x2e96('0xf'))(new Redis(config[_0x2e96('0xd')]));require(_0x2e96('0x10'))['register'](socket);function respondWithRpcPromise(_0x37a186,_0x495e4c,_0x15cde9){return new BPromise(function(_0x59a221,_0x5acce3){return client[_0x2e96('0x11')](_0x37a186,_0x15cde9)['then'](function(_0x1034ff){logger['info'](_0x2e96('0x12'),_0x495e4c,_0x2e96('0x13'));logger[_0x2e96('0x14')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x495e4c,_0x2e96('0x13'),JSON[_0x2e96('0x15')](_0x1034ff));if(_0x1034ff['error']){if(_0x1034ff[_0x2e96('0x16')][_0x2e96('0x17')]===0x1f4){logger[_0x2e96('0x16')](_0x2e96('0x12'),_0x495e4c,_0x1034ff[_0x2e96('0x16')]['message']);return _0x5acce3(_0x1034ff[_0x2e96('0x16')][_0x2e96('0x18')]);}logger[_0x2e96('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x495e4c,_0x1034ff['error'][_0x2e96('0x18')]);return _0x59a221(_0x1034ff[_0x2e96('0x16')]['message']);}else{logger[_0x2e96('0x19')](_0x2e96('0x12'),_0x495e4c,_0x2e96('0x13'));_0x59a221(_0x1034ff['result']['message']);}})['catch'](function(_0x2b483a){logger['error'](_0x2e96('0x12'),_0x495e4c,_0x2b483a);_0x5acce3(_0x2b483a);});});}exports[_0x2e96('0x1a')]=function(_0x11234f){var _0x483543=this;return new Promise(function(_0x5f380c,_0x4634bf){return db[_0x2e96('0x1b')][_0x2e96('0x1c')](_0x11234f[_0x2e96('0x1d')],{'raw':_0x11234f[_0x2e96('0x1e')]?_0x11234f[_0x2e96('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11234f[_0x2e96('0x1e')]?_0x11234f[_0x2e96('0x1e')][_0x2e96('0x1f')]||null:null,'attributes':_0x11234f[_0x2e96('0x1e')]?_0x11234f[_0x2e96('0x1e')]['attributes']||null:null,'limit':_0x11234f[_0x2e96('0x1e')]?_0x11234f[_0x2e96('0x1e')]['limit']||null:null})[_0x2e96('0x20')](function(_0x1b784e){logger[_0x2e96('0x19')](_0x2e96('0x1a'),_0x11234f);logger[_0x2e96('0x14')](_0x2e96('0x1a'),_0x11234f,JSON[_0x2e96('0x15')](_0x1b784e));_0x5f380c(_0x1b784e);})[_0x2e96('0x21')](function(_0xec661a){logger[_0x2e96('0x16')](_0x2e96('0x1a'),_0xec661a[_0x2e96('0x18')],_0x11234f);_0x4634bf(_0x483543[_0x2e96('0x16')](0x1f4,_0xec661a[_0x2e96('0x18')]));});});};exports[_0x2e96('0x22')]=function(_0x238fa3){return new Promise(function(_0x52fb28,_0x53f82b){return db[_0x2e96('0x1b')][_0x2e96('0x23')]({'where':_0x238fa3[_0x2e96('0x1e')]?_0x238fa3[_0x2e96('0x1e')][_0x2e96('0x1f')]||null:null})[_0x2e96('0x20')](function(_0x513be8){if(_0x513be8){return _0x513be8['addTags'](_0x238fa3[_0x2e96('0x1d')]['ids'],_[_0x2e96('0x24')](_0x238fa3[_0x2e96('0x1d')],['ids','id'])||{});}})[_0x2e96('0x25')](function(_0x585cda){logger[_0x2e96('0x19')]('AddTags',_0x238fa3);logger['debug'](_0x2e96('0x26'),_0x238fa3,JSON['stringify'](_0x585cda));_0x52fb28(_0x585cda);})[_0x2e96('0x21')](function(_0x466059){logger[_0x2e96('0x16')](_0x2e96('0x26'),_0x466059['message'],_0x238fa3);_0x53f82b(_this[_0x2e96('0x16')](0x1f4,_0x466059[_0x2e96('0x18')]));});});}; \ No newline at end of file +var _0x5537=['WhatsappInteraction','update','body','raw','options','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','where','addTags','ids','AddTags','debug','lodash','util','bluebird','randomstring','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappInteraction.socket','register','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x5b306d,_0x498446){var _0x55bfc0=function(_0x589c50){while(--_0x589c50){_0x5b306d['push'](_0x5b306d['shift']());}};_0x55bfc0(++_0x498446);}(_0x5537,0x78));var _0x7553=function(_0x3e4a27,_0x10b5aa){_0x3e4a27=_0x3e4a27-0x0;var _0x4e61c1=_0x5537[_0x3e4a27];return _0x4e61c1;};'use strict';var _=require(_0x7553('0x0'));var util=require(_0x7553('0x1'));var moment=require('moment');var BPromise=require(_0x7553('0x2'));var rs=require(_0x7553('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(_0x7553('0x4'));var jayson=require(_0x7553('0x5'));var client=jayson[_0x7553('0x6')][_0x7553('0x7')]({'port':0x232a});config[_0x7553('0x8')]=_[_0x7553('0x9')](config['redis'],{'host':_0x7553('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7553('0xb'))[_0x7553('0xc')](socket);function respondWithRpcPromise(_0x282d20,_0x25159f,_0x344f75){return new BPromise(function(_0xdc51bc,_0x4111a3){return client['request'](_0x282d20,_0x344f75)[_0x7553('0xd')](function(_0x5347c8){logger[_0x7553('0xe')](_0x7553('0xf'),_0x25159f,_0x7553('0x10'));logger['debug'](_0x7553('0x11'),_0x25159f,_0x7553('0x10'),JSON[_0x7553('0x12')](_0x5347c8));if(_0x5347c8[_0x7553('0x13')]){if(_0x5347c8[_0x7553('0x13')][_0x7553('0x14')]===0x1f4){logger[_0x7553('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x25159f,_0x5347c8[_0x7553('0x13')]['message']);return _0x4111a3(_0x5347c8['error'][_0x7553('0x15')]);}logger[_0x7553('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x25159f,_0x5347c8[_0x7553('0x13')]['message']);return _0xdc51bc(_0x5347c8[_0x7553('0x13')][_0x7553('0x15')]);}else{logger[_0x7553('0xe')](_0x7553('0xf'),_0x25159f,_0x7553('0x10'));_0xdc51bc(_0x5347c8[_0x7553('0x16')][_0x7553('0x15')]);}})[_0x7553('0x17')](function(_0x2ff083){logger['error'](_0x7553('0xf'),_0x25159f,_0x2ff083);_0x4111a3(_0x2ff083);});});}exports['UpdateWhatsappInteraction']=function(_0x20ff13){var _0x45a690=this;return new Promise(function(_0x174adf,_0x5e86ae){return db[_0x7553('0x18')][_0x7553('0x19')](_0x20ff13[_0x7553('0x1a')],{'raw':_0x20ff13['options']?_0x20ff13['options'][_0x7553('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20ff13['options']?_0x20ff13[_0x7553('0x1c')]['where']||null:null,'attributes':_0x20ff13[_0x7553('0x1c')]?_0x20ff13[_0x7553('0x1c')]['attributes']||null:null,'limit':_0x20ff13['options']?_0x20ff13['options']['limit']||null:null})[_0x7553('0xd')](function(_0x579fe7){logger[_0x7553('0xe')](_0x7553('0x1d'),_0x20ff13);logger['debug'](_0x7553('0x1d'),_0x20ff13,JSON[_0x7553('0x12')](_0x579fe7));_0x174adf(_0x579fe7);})[_0x7553('0x17')](function(_0x1159e5){logger[_0x7553('0x13')]('UpdateWhatsappInteraction',_0x1159e5[_0x7553('0x15')],_0x20ff13);_0x5e86ae(_0x45a690[_0x7553('0x13')](0x1f4,_0x1159e5['message']));});});};exports[_0x7553('0x1e')]=function(_0x40dbf8){return new Promise(function(_0x345bec,_0x3d24f3){return db[_0x7553('0x18')]['find']({'where':_0x40dbf8['options']?_0x40dbf8[_0x7553('0x1c')][_0x7553('0x1f')]||null:null})[_0x7553('0xd')](function(_0x1352e0){if(_0x1352e0){return _0x1352e0[_0x7553('0x20')](_0x40dbf8[_0x7553('0x1a')][_0x7553('0x21')],_['omit'](_0x40dbf8[_0x7553('0x1a')],[_0x7553('0x21'),'id'])||{});}})['spread'](function(_0x13e31f){logger[_0x7553('0xe')](_0x7553('0x22'),_0x40dbf8);logger[_0x7553('0x23')]('AddTags',_0x40dbf8,JSON[_0x7553('0x12')](_0x13e31f));_0x345bec(_0x13e31f);})[_0x7553('0x17')](function(_0x4072f4){logger['error']('AddTags',_0x4072f4['message'],_0x40dbf8);_0x3d24f3(_this[_0x7553('0x13')](0x1f4,_0x4072f4[_0x7553('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 079d012..ad73619 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 _0xc39e=['removeListener','register','length','./whatsappInteraction.events','save','remove','update'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xc39e,0x65));var _0xec39=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0xc39e[_0x1147ab];return _0x55cb5a;};'use strict';var WhatsappInteractionEvents=require(_0xec39('0x0'));var events=[_0xec39('0x1'),_0xec39('0x2'),_0xec39('0x3')];function createListener(_0x37842e,_0xb691e5){return function(_0x2bc1f5){_0xb691e5['emit'](_0x37842e,_0x2bc1f5);};}function removeListener(_0x27e9e0,_0x2d1c1c){return function(){WhatsappInteractionEvents[_0xec39('0x4')](_0x27e9e0,_0x2d1c1c);};}exports[_0xec39('0x5')]=function(_0x504b38){for(var _0x1bada1=0x0,_0x2c687f=events[_0xec39('0x6')];_0x1bada1<_0x2c687f;_0x1bada1++){var _0x3bafc8=events[_0x1bada1];var _0x1eef0c=createListener('whatsappInteraction:'+_0x3bafc8,_0x504b38);WhatsappInteractionEvents['on'](_0x3bafc8,_0x1eef0c);}}; \ No newline at end of file +var _0x0cf3=['save','remove','emit','removeListener','length','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x0cf3,0x16b));var _0x30cf=function(_0x2681b7,_0x2d1b49){_0x2681b7=_0x2681b7-0x0;var _0x4d466b=_0x0cf3[_0x2681b7];return _0x4d466b;};'use strict';var WhatsappInteractionEvents=require(_0x30cf('0x0'));var events=[_0x30cf('0x1'),_0x30cf('0x2'),'update'];function createListener(_0x1ac137,_0x8a760b){return function(_0x4c6adf){_0x8a760b[_0x30cf('0x3')](_0x1ac137,_0x4c6adf);};}function removeListener(_0x585442,_0x46c57e){return function(){WhatsappInteractionEvents[_0x30cf('0x4')](_0x585442,_0x46c57e);};}exports['register']=function(_0x59cb81){for(var _0x57229f=0x0,_0x180249=events[_0x30cf('0x5')];_0x57229f<_0x180249;_0x57229f++){var _0xdf5242=events[_0x57229f];var _0xdc9cd9=createListener(_0x30cf('0x6')+_0xdf5242,_0x59cb81);WhatsappInteractionEvents['on'](_0xdf5242,_0xdc9cd9);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 08346e5..d767d76 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 _0x4017=['isAuthenticated','get','/:id','show','post','tracked','whatsapp','whatsappmessage:create','/:id/status','status','put','/:id/accept','accept','/:id/reject','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','/describe'];(function(_0x3b7b8a,_0x52c3b0){var _0x441206=function(_0x5d34d3){while(--_0x5d34d3){_0x3b7b8a['push'](_0x3b7b8a['shift']());}};_0x441206(++_0x52c3b0);}(_0x4017,0xde));var _0x7401=function(_0x346490,_0xaf0e1b){_0x346490=_0x346490-0x0;var _0x1c47ef=_0x4017[_0x346490];return _0x1c47ef;};'use strict';var multer=require(_0x7401('0x0'));var util=require('util');var path=require(_0x7401('0x1'));var timeout=require(_0x7401('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7401('0x3'));var auth=require(_0x7401('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7401('0x5'));var controller=require(_0x7401('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7401('0x7'),auth[_0x7401('0x8')](),controller['describe']);router[_0x7401('0x9')](_0x7401('0xa'),auth[_0x7401('0x8')](),controller[_0x7401('0xb')]);router[_0x7401('0xc')]('/',auth[_0x7401('0x8')](),interaction[_0x7401('0xd')](_0x7401('0xe'),_0x7401('0xf')),controller['create']);router[_0x7401('0xc')](_0x7401('0x10'),controller[_0x7401('0x11')]);router[_0x7401('0x12')](_0x7401('0xa'),auth[_0x7401('0x8')](),controller['update']);router[_0x7401('0x12')](_0x7401('0x13'),auth[_0x7401('0x8')](),controller[_0x7401('0x14')]);router[_0x7401('0x12')](_0x7401('0x15'),auth[_0x7401('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x7401('0x8')](),controller['destroy']);module[_0x7401('0x16')]=router; \ No newline at end of file +var _0xefd9=['post','status','put','update','/:id/accept','/:id/reject','reject','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','show','whatsapp','create'];(function(_0x2018cf,_0x2ebfd4){var _0x3561b6=function(_0x1f7051){while(--_0x1f7051){_0x2018cf['push'](_0x2018cf['shift']());}};_0x3561b6(++_0x2ebfd4);}(_0xefd9,0x15a));var _0x9efd=function(_0x26d05d,_0x368ba0){_0x26d05d=_0x26d05d-0x0;var _0x510108=_0xefd9[_0x26d05d];return _0x510108;};'use strict';var multer=require(_0x9efd('0x0'));var util=require(_0x9efd('0x1'));var path=require(_0x9efd('0x2'));var timeout=require(_0x9efd('0x3'));var express=require(_0x9efd('0x4'));var router=express[_0x9efd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9efd('0x6'));var interaction=require(_0x9efd('0x7'));var config=require(_0x9efd('0x8'));var controller=require(_0x9efd('0x9'));router[_0x9efd('0xa')]('/',auth[_0x9efd('0xb')](),controller[_0x9efd('0xc')]);router[_0x9efd('0xa')](_0x9efd('0xd'),auth[_0x9efd('0xb')](),controller[_0x9efd('0xe')]);router[_0x9efd('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x9efd('0xf')]);router['post']('/',auth[_0x9efd('0xb')](),interaction['tracked'](_0x9efd('0x10'),'whatsappmessage:create'),controller[_0x9efd('0x11')]);router[_0x9efd('0x12')]('/:id/status',controller[_0x9efd('0x13')]);router[_0x9efd('0x14')]('/:id',auth[_0x9efd('0xb')](),controller[_0x9efd('0x15')]);router['put'](_0x9efd('0x16'),auth[_0x9efd('0xb')](),controller['accept']);router['put'](_0x9efd('0x17'),auth[_0x9efd('0xb')](),controller[_0x9efd('0x18')]);router[_0x9efd('0x19')](_0x9efd('0x1a'),auth['isAuthenticated'](),controller[_0x9efd('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index df56818..9f06957 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 _0x4939=['BOOLEAN','TEXT','sequelize','exports','medium','ENUM','out','STRING','DATE'];(function(_0x11b124,_0x1a9c63){var _0x1c9406=function(_0x5e89cc){while(--_0x5e89cc){_0x11b124['push'](_0x11b124['shift']());}};_0x1c9406(++_0x1a9c63);}(_0x4939,0x1a9));var _0x9493=function(_0x71961,_0x5d7d59){_0x71961=_0x71961-0x0;var _0x5b591e=_0x4939[_0x71961];return _0x5b591e;};'use strict';var Sequelize=require(_0x9493('0x0'));module[_0x9493('0x1')]={'body':{'type':Sequelize['TEXT'](_0x9493('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9493('0x3')]('in',_0x9493('0x4')),'defaultValue':_0x9493('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9493('0x5')](0xbe)},'phone':{'type':Sequelize[_0x9493('0x5')]},'readAt':{'type':Sequelize[_0x9493('0x6')]},'secret':{'type':Sequelize[_0x9493('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x9493('0x5')]},'providerResponse':{'type':Sequelize[_0x9493('0x8')]}}; \ No newline at end of file +var _0xc01b=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize'];(function(_0x3243d4,_0x2cfa97){var _0x45f124=function(_0xf8e1ce){while(--_0xf8e1ce){_0x3243d4['push'](_0x3243d4['shift']());}};_0x45f124(++_0x2cfa97);}(_0xc01b,0x74));var _0xbc01=function(_0x56bc08,_0x27e788){_0x56bc08=_0x56bc08-0x0;var _0x27b2ca=_0xc01b[_0x56bc08];return _0x27b2ca;};'use strict';var Sequelize=require(_0xbc01('0x0'));module[_0xbc01('0x1')]={'body':{'type':Sequelize[_0xbc01('0x2')](_0xbc01('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbc01('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbc01('0x5')]('in',_0xbc01('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xbc01('0x7')](0xbe)},'phone':{'type':Sequelize[_0xbc01('0x7')]},'readAt':{'type':Sequelize[_0xbc01('0x8')]},'secret':{'type':Sequelize[_0xbc01('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xbc01('0x7')]},'providerResponse':{'type':Sequelize[_0xbc01('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 16b8dce..ae787b5 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 _0x66f0=['defaults','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','json','offset','undefined','limit','set','apply','save','update','destroy','sendStatus','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','type','count','includeAll','include','findAll','rows','show','params','keys','find','create','body','describe','whatsapp-interactions','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','whatsapp','role','RejectMessage','rejectMessage','rejectmessage','WhatsappAccount','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis'];(function(_0x654e84,_0x431ca2){var _0xc77c75=function(_0x5c6e48){while(--_0x5c6e48){_0x654e84['push'](_0x654e84['shift']());}};_0xc77c75(++_0x431ca2);}(_0x66f0,0x17b));var _0x066f=function(_0x44afa4,_0x5be27b){_0x44afa4=_0x44afa4-0x0;var _0xcad289=_0x66f0[_0x44afa4];return _0xcad289;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x066f('0x0'));var zipdir=require(_0x066f('0x1'));var jsonpatch=require(_0x066f('0x2'));var rp=require(_0x066f('0x3'));var moment=require(_0x066f('0x4'));var BPromise=require(_0x066f('0x5'));var Mustache=require(_0x066f('0x6'));var util=require(_0x066f('0x7'));var path=require('path');var sox=require(_0x066f('0x8'));var csv=require('to-csv');var ejs=require(_0x066f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x066f('0xa'));var crypto=require(_0x066f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x066f('0xc'));var Papa=require(_0x066f('0xd'));var Redis=require('ioredis');var authService=require(_0x066f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x066f('0xf'));var hardwareService=require(_0x066f('0x10'));var logger=require(_0x066f('0x11'))(_0x066f('0x12'));var utils=require(_0x066f('0x13'));var config=require(_0x066f('0x14'));var licenseUtil=require(_0x066f('0x15'));var db=require('../../mysqldb')['db'];config[_0x066f('0x16')]=_[_0x066f('0x17')](config[_0x066f('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x066f('0x18'))(new Redis(config[_0x066f('0x16')]));require(_0x066f('0x19'))[_0x066f('0x1a')](socket);var jayson=require(_0x066f('0x1b'));var client=jayson[_0x066f('0x1c')]['http']({'port':0x232c});var client9002=jayson['client'][_0x066f('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5362d6,_0x352f04,_0x213772,_0x10e498){return new BPromise(function(_0x50e0ab,_0x3fcc16){var _0xf1ac3=_0x10e498||client;return _0xf1ac3[_0x066f('0x1e')](_0x5362d6,_0x213772)[_0x066f('0x1f')](function(_0x2ad2ee){logger[_0x066f('0x20')](_0x066f('0x21'),_0x352f04,_0x066f('0x22'));logger[_0x066f('0x23')](_0x066f('0x24'),_0x352f04,_0x066f('0x22'),JSON[_0x066f('0x25')](_0x2ad2ee));if(_0x2ad2ee['error']){if(_0x2ad2ee[_0x066f('0x26')][_0x066f('0x27')]===0x1f4){logger[_0x066f('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x352f04,_0x2ad2ee[_0x066f('0x26')][_0x066f('0x28')]);return _0x3fcc16(_0x2ad2ee['error'][_0x066f('0x28')]);}logger[_0x066f('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x352f04,_0x2ad2ee[_0x066f('0x26')][_0x066f('0x28')]);return _0x50e0ab(_0x2ad2ee[_0x066f('0x26')][_0x066f('0x28')]);}else{logger[_0x066f('0x20')]('WhatsappMessage,\x20%s,\x20%s',_0x352f04,_0x066f('0x22'));_0x50e0ab(_0x2ad2ee[_0x066f('0x29')][_0x066f('0x28')]);}})[_0x066f('0x2a')](function(_0x1e81c9){logger[_0x066f('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x352f04,_0x1e81c9);_0x3fcc16(_0x1e81c9);});});}function respondWithStatusCode(_0x160dec,_0x28f811){_0x28f811=_0x28f811||0xcc;return function(_0x2756c1){if(_0x2756c1){return _0x160dec['sendStatus'](_0x28f811);}return _0x160dec['status'](_0x28f811)[_0x066f('0x2b')]();};}function respondWithResult(_0x5e18f7,_0xc5f7b){_0xc5f7b=_0xc5f7b||0xc8;return function(_0x416fee){if(_0x416fee){return _0x5e18f7[_0x066f('0x2c')](_0xc5f7b)[_0x066f('0x2d')](_0x416fee);}};}function respondWithFilteredResult(_0x218cd9,_0x4ac5f2){return function(_0x317acf){if(_0x317acf){var _0x204312=typeof _0x4ac5f2[_0x066f('0x2e')]===_0x066f('0x2f')&&typeof _0x4ac5f2[_0x066f('0x30')]===_0x066f('0x2f');var _0x52e1a6=_0x317acf['count'];var _0x275e6b=_0x204312?0x0:_0x4ac5f2[_0x066f('0x2e')];var _0x578b60=_0x204312?_0x317acf['count']:_0x4ac5f2[_0x066f('0x2e')]+_0x4ac5f2[_0x066f('0x30')];var _0x396371;if(_0x578b60>=_0x52e1a6){_0x578b60=_0x52e1a6;_0x396371=0xc8;}else{_0x396371=0xce;}_0x218cd9[_0x066f('0x2c')](_0x396371);return _0x218cd9[_0x066f('0x31')]('Content-Range',_0x275e6b+'-'+_0x578b60+'/'+_0x52e1a6)[_0x066f('0x2d')](_0x317acf);}return null;};}function patchUpdates(_0x29ffe0){return function(_0x47893c){try{jsonpatch[_0x066f('0x32')](_0x47893c,_0x29ffe0,!![]);}catch(_0x53ca76){return BPromise['reject'](_0x53ca76);}return _0x47893c[_0x066f('0x33')]();};}function saveUpdates(_0x4d2171,_0x1d5a24){return function(_0xdaffd){if(_0xdaffd){return _0xdaffd[_0x066f('0x34')](_0x4d2171)[_0x066f('0x1f')](function(_0xd71478){return _0xd71478;});}return null;};}function removeEntity(_0x286472,_0x43f57b){return function(_0x163a19){if(_0x163a19){return _0x163a19[_0x066f('0x35')]()[_0x066f('0x1f')](function(){_0x286472['status'](0xcc)[_0x066f('0x2b')]();});}};}function handleEntityNotFound(_0xaaf39b,_0x1dd4b3){return function(_0x178572){if(!_0x178572){_0xaaf39b[_0x066f('0x36')](0x194);}return _0x178572;};}function handleError(_0x5d4036,_0x48159a){_0x48159a=_0x48159a||0x1f4;return function(_0x305198){logger[_0x066f('0x26')](_0x305198[_0x066f('0x37')]);if(_0x305198[_0x066f('0x38')]){delete _0x305198['name'];}_0x5d4036[_0x066f('0x2c')](_0x48159a)[_0x066f('0x39')](_0x305198);};}exports[_0x066f('0x3a')]=function(_0x39254e,_0x36b131){var _0x10eff8={},_0x3279c7={},_0x1bf6dc={'count':0x0,'rows':[]};var _0x4b12a6=_[_0x066f('0x3b')](db[_0x066f('0x3c')][_0x066f('0x3d')],function(_0x2b3798){return{'name':_0x2b3798[_0x066f('0x3e')],'type':_0x2b3798['type'][_0x066f('0x3f')]};});_0x3279c7[_0x066f('0x40')]=_[_0x066f('0x3b')](_0x4b12a6,_0x066f('0x38'));_0x3279c7[_0x066f('0x41')]=_['keys'](_0x39254e[_0x066f('0x41')]);_0x3279c7[_0x066f('0x42')]=_[_0x066f('0x43')](_0x3279c7[_0x066f('0x40')],_0x3279c7['query']);_0x10eff8[_0x066f('0x44')]=_[_0x066f('0x43')](_0x3279c7[_0x066f('0x40')],qs[_0x066f('0x45')](_0x39254e['query'][_0x066f('0x45')]));_0x10eff8[_0x066f('0x44')]=_0x10eff8[_0x066f('0x44')][_0x066f('0x46')]?_0x10eff8[_0x066f('0x44')]:_0x3279c7['model'];if(!_0x39254e[_0x066f('0x41')]['hasOwnProperty']('nolimit')){_0x10eff8[_0x066f('0x30')]=qs[_0x066f('0x30')](_0x39254e['query'][_0x066f('0x30')]);_0x10eff8['offset']=qs[_0x066f('0x2e')](_0x39254e[_0x066f('0x41')][_0x066f('0x2e')]);}_0x10eff8['order']=qs[_0x066f('0x47')](_0x39254e[_0x066f('0x41')][_0x066f('0x47')]);_0x10eff8[_0x066f('0x48')]=qs[_0x066f('0x42')](_[_0x066f('0x49')](_0x39254e['query'],_0x3279c7[_0x066f('0x42')]),_0x4b12a6);if(_0x39254e['query'][_0x066f('0x4a')]){_0x10eff8['where']=_[_0x066f('0x4b')](_0x10eff8['where'],{'$or':_[_0x066f('0x3b')](_0x4b12a6,function(_0x3313d6){if(_0x3313d6[_0x066f('0x4c')]!=='VIRTUAL'){var _0x54b8bf={};_0x54b8bf[_0x3313d6[_0x066f('0x38')]]={'$like':'%'+_0x39254e[_0x066f('0x41')][_0x066f('0x4a')]+'%'};return _0x54b8bf;}})});}_0x10eff8=_[_0x066f('0x4b')]({},_0x10eff8,_0x39254e['options']);var _0x1f514e={'where':_0x10eff8[_0x066f('0x48')]};return db['WhatsappMessage'][_0x066f('0x4d')](_0x1f514e)['then'](function(_0x365e27){_0x1bf6dc['count']=_0x365e27;if(_0x39254e['query'][_0x066f('0x4e')]){_0x10eff8[_0x066f('0x4f')]=[{'all':!![]}];}return db[_0x066f('0x3c')][_0x066f('0x50')](_0x10eff8);})[_0x066f('0x1f')](function(_0x30f79c){_0x1bf6dc[_0x066f('0x51')]=_0x30f79c;return _0x1bf6dc;})[_0x066f('0x1f')](respondWithFilteredResult(_0x36b131,_0x10eff8))[_0x066f('0x2a')](handleError(_0x36b131,null));};exports[_0x066f('0x52')]=function(_0x58281d,_0x941d92){var _0x54d9eb={'raw':!![],'where':{'id':_0x58281d[_0x066f('0x53')]['id']}},_0x1319dd={};_0x1319dd['model']=_[_0x066f('0x54')](db[_0x066f('0x3c')][_0x066f('0x3d')]);_0x1319dd[_0x066f('0x41')]=_[_0x066f('0x54')](_0x58281d[_0x066f('0x41')]);_0x1319dd['filters']=_['intersection'](_0x1319dd[_0x066f('0x40')],_0x1319dd['query']);_0x54d9eb[_0x066f('0x44')]=_[_0x066f('0x43')](_0x1319dd[_0x066f('0x40')],qs[_0x066f('0x45')](_0x58281d['query'][_0x066f('0x45')]));_0x54d9eb[_0x066f('0x44')]=_0x54d9eb['attributes'][_0x066f('0x46')]?_0x54d9eb[_0x066f('0x44')]:_0x1319dd[_0x066f('0x40')];if(_0x58281d[_0x066f('0x41')][_0x066f('0x4e')]){_0x54d9eb[_0x066f('0x4f')]=[{'all':!![]}];}_0x54d9eb=_['merge']({},_0x54d9eb,_0x58281d['options']);return db[_0x066f('0x3c')][_0x066f('0x55')](_0x54d9eb)['then'](handleEntityNotFound(_0x941d92,null))[_0x066f('0x1f')](respondWithResult(_0x941d92,null))[_0x066f('0x2a')](handleError(_0x941d92,null));};exports[_0x066f('0x56')]=function(_0x406d13,_0xceb149){return db[_0x066f('0x3c')][_0x066f('0x56')](_0x406d13['body'],{})['then'](respondWithResult(_0xceb149,0xc9))['catch'](handleError(_0xceb149,null));};exports[_0x066f('0x34')]=function(_0x405c1a,_0x3ff201){if(_0x405c1a[_0x066f('0x57')]['id']){delete _0x405c1a['body']['id'];}return db['WhatsappMessage'][_0x066f('0x55')]({'where':{'id':_0x405c1a[_0x066f('0x53')]['id']}})['then'](handleEntityNotFound(_0x3ff201,null))[_0x066f('0x1f')](saveUpdates(_0x405c1a[_0x066f('0x57')],null))[_0x066f('0x1f')](respondWithResult(_0x3ff201,null))[_0x066f('0x2a')](handleError(_0x3ff201,null));};exports[_0x066f('0x35')]=function(_0x26b5fe,_0x52b635){return db[_0x066f('0x3c')][_0x066f('0x55')]({'where':{'id':_0x26b5fe[_0x066f('0x53')]['id']}})['then'](handleEntityNotFound(_0x52b635,null))[_0x066f('0x1f')](removeEntity(_0x52b635,null))['catch'](handleError(_0x52b635,null));};exports[_0x066f('0x58')]=function(_0x1bcd25,_0x27d864){return db[_0x066f('0x3c')][_0x066f('0x58')]()[_0x066f('0x1f')](respondWithResult(_0x27d864,null))[_0x066f('0x2a')](handleError(_0x27d864,null));};var interaction_log=require(_0x066f('0x11'))(_0x066f('0x59'));exports['accept']=function(_0xe4cd40,_0x255429,_0x24c469){var _0x4829ac={'agent':{},'channel':'whatsapp'};if(_0xe4cd40[_0x066f('0x57')]['id']){delete _0xe4cd40[_0x066f('0x57')]['id'];}_0xe4cd40[_0x066f('0x57')][_0x066f('0x5a')]=!![];_0xe4cd40[_0x066f('0x57')][_0x066f('0x5b')]=moment()['format'](_0x066f('0x5c'));_0xe4cd40[_0x066f('0x57')][_0x066f('0x5d')]=_0xe4cd40['body'][_0x066f('0x5d')]||_0xe4cd40[_0x066f('0x5e')]['id'];_0x4829ac[_0x066f('0x5f')]['id']=_0xe4cd40[_0x066f('0x57')][_0x066f('0x5d')];return db[_0x066f('0x3c')][_0x066f('0x55')]({'where':{'id':_0xe4cd40[_0x066f('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x255429,null))[_0x066f('0x1f')](saveUpdates(_0xe4cd40['body'],null))[_0x066f('0x1f')](function(_0x4383e2){if(_0x4383e2){_0x4829ac[_0x066f('0x28')]=_0x4383e2[_0x066f('0x60')]({'plain':!![]});return db[_0x066f('0x61')][_0x066f('0x55')]({'where':{'id':_0x4383e2[_0x066f('0x62')]}});}return null;})[_0x066f('0x1f')](handleEntityNotFound(_0x255429,null))[_0x066f('0x1f')](function(_0x57cab7){if(_0x57cab7){return _0x57cab7['update']({'UserId':_0xe4cd40['body'][_0x066f('0x5d')],'read1stAt':_[_0x066f('0x63')](_0x57cab7[_0x066f('0x64')])?moment()[_0x066f('0x65')](_0x066f('0x5c')):undefined});}return null;})[_0x066f('0x1f')](function(_0x56f8a0){if(_0x56f8a0){_0x4829ac[_0x066f('0x66')]=_0x56f8a0['get']({'plain':!![]});interaction_log['info'](_0x066f('0x67'),_0xe4cd40['user']['id'],_0xe4cd40[_0x066f('0x5e')]['name'],_0xe4cd40[_0x066f('0x5e')]['role'],_0x4829ac[_0x066f('0x66')]['id'],_0xe4cd40[_0x066f('0x57')]?JSON['stringify'](_0xe4cd40[_0x066f('0x57')]):_0x066f('0x68'));return respondWithRpcPromise('AcceptMessage',_0x066f('0x69'),_0x4829ac);}return null;})[_0x066f('0x1f')](function(_0x123a70){var _0x226d54=_0x066f('0x6a')+_0x123a70[_0x066f('0x28')][_0x066f('0x6b')];return db['sequelize']['query'](_0x226d54,{'type':db[_0x066f('0x6c')][_0x066f('0x6d')][_0x066f('0x6e')],'raw':!![]})[_0x066f('0x1f')](function(_0x17107e){return _0x17107e;});})[_0x066f('0x1f')](function(_0x1fc87b){if(_0x1fc87b){_0x4829ac[_0x066f('0x28')][_0x066f('0x6f')]=_0x1fc87b[0x0];if(!_0xe4cd40[_0x066f('0x57')][_0x066f('0x5d')])return;return db[_0x066f('0x70')]['find']({'where':{'id':_0xe4cd40[_0x066f('0x57')][_0x066f('0x5d')],'role':_0x066f('0x5f')},'attributes':['id',_0x066f('0x38'),_0x066f('0x71'),_0x066f('0x72'),'internal'],'raw':!![]});}return null;})[_0x066f('0x1f')](function(_0x4ec083){if(!_0x4ec083)return null;_0x4829ac['message'][_0x066f('0x5f')]=_0x4ec083;return _0x4829ac;})[_0x066f('0x1f')](function(_0x4b3396){if(_0x4b3396){if(_0xe4cd40['body'][_0x066f('0x73')]){_0x4829ac[_0x066f('0x28')][_0x066f('0x74')]=util[_0x066f('0x65')](_0x066f('0x75'),_0xe4cd40['user']['name']);_0x4829ac[_0x066f('0x28')]['channel']=_0x4829ac[_0x066f('0x76')];_0x4829ac[_0x066f('0x28')][_0x066f('0x77')]=_0x4829ac[_0x066f('0x76')];_0x4829ac[_0x066f('0x28')][_0x066f('0x78')]=_0x066f('0x79');return respondWithRpcPromise('EventManager',_0x066f('0x7a'),{'event':'acceptmessage','message':_0x4829ac[_0x066f('0x28')]},client9002)[_0x066f('0x1f')](function(){return _0x4829ac;});}return _0x4829ac;}return null;})['then'](respondWithResult(_0x255429,null))['catch'](handleError(_0x255429,null));};var interaction_log=require(_0x066f('0x11'))('whatsapp-interactions');exports['reject']=function(_0x4d7193,_0x501500,_0x46c5fb){var _0x4f667f={'agent':{},'channel':_0x066f('0x7b')};if(_0x4d7193[_0x066f('0x57')]['id']){delete _0x4d7193['body']['id'];}_0x4d7193[_0x066f('0x57')]['UserId']=_0x4d7193[_0x066f('0x57')]['UserId']||_0x4d7193['user']['id'];_0x4f667f['agent']['id']=_0x4d7193[_0x066f('0x57')]['UserId'];return db['WhatsappMessage'][_0x066f('0x55')]({'where':{'id':_0x4d7193[_0x066f('0x53')]['id'],'UserId':null}})[_0x066f('0x1f')](handleEntityNotFound(_0x501500,null))['then'](function(_0x48cd4f){if(_0x48cd4f){_0x4f667f[_0x066f('0x28')]=_0x48cd4f[_0x066f('0x60')]({'plain':!![]});return db[_0x066f('0x61')]['find']({'where':{'id':_0x48cd4f['WhatsappInteractionId']}});}return null;})[_0x066f('0x1f')](handleEntityNotFound(_0x501500,null))[_0x066f('0x1f')](function(_0x2ee089){if(_0x2ee089){_0x4f667f[_0x066f('0x66')]=_0x2ee089[_0x066f('0x60')]({'plain':!![]});interaction_log[_0x066f('0x20')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4d7193[_0x066f('0x5e')]['id'],_0x4d7193[_0x066f('0x5e')][_0x066f('0x38')],_0x4d7193['user'][_0x066f('0x7c')],_0x4f667f[_0x066f('0x66')]['id'],_0x4d7193['body']?JSON[_0x066f('0x25')](_0x4d7193['body']):_0x066f('0x68'));return respondWithRpcPromise(_0x066f('0x7d'),_0x066f('0x7e'),_0x4f667f);}return null;})['then'](function(_0x441009){var _0x1f4579=_0x066f('0x6a')+_0x441009[_0x066f('0x28')][_0x066f('0x6b')];return db['sequelize'][_0x066f('0x41')](_0x1f4579,{'type':db[_0x066f('0x6c')]['QueryTypes']['SELECT'],'raw':!![]})[_0x066f('0x1f')](function(_0x216dec){return _0x216dec;});})['then'](function(_0x2155d4){if(_0x2155d4){_0x4f667f['message'][_0x066f('0x6f')]=_0x2155d4[0x0];if(!_0x4d7193[_0x066f('0x57')][_0x066f('0x5d')])return;return db[_0x066f('0x70')][_0x066f('0x55')]({'where':{'id':_0x4d7193[_0x066f('0x57')][_0x066f('0x5d')],'role':'agent'},'attributes':['id',_0x066f('0x38'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x066f('0x1f')](function(_0x4c4947){if(!_0x4c4947)return null;_0x4f667f[_0x066f('0x28')][_0x066f('0x5f')]=_0x4c4947;return _0x4f667f;})[_0x066f('0x1f')](function(_0x2eac17){if(_0x2eac17){_0x2eac17[_0x066f('0x28')][_0x066f('0x74')]=util[_0x066f('0x65')](_0x066f('0x75'),_0x4d7193[_0x066f('0x5e')][_0x066f('0x38')]);_0x2eac17['message'][_0x066f('0x76')]=_0x4f667f[_0x066f('0x76')];_0x2eac17[_0x066f('0x28')]['motionChannel']=_0x4f667f[_0x066f('0x76')];_0x2eac17[_0x066f('0x28')][_0x066f('0x78')]='reject';respondWithRpcPromise(_0x066f('0x7a'),_0x066f('0x7a'),{'event':_0x066f('0x7f'),'message':_0x2eac17[_0x066f('0x28')]},client9002);return _0x4f667f;}return null;})['then'](respondWithResult(_0x501500,null))[_0x066f('0x2a')](handleError(_0x501500,null));};exports[_0x066f('0x2c')]=function(_0x43f0f7,_0x553198,_0xcc55b2){if(_0x43f0f7[_0x066f('0x57')]['id']){delete _0x43f0f7['body']['id'];}var _0x56e995;return db['WhatsappMessage'][_0x066f('0x55')]({'where':{'id':_0x43f0f7[_0x066f('0x53')]['id']}})[_0x066f('0x1f')](handleEntityNotFound(_0x553198,null))[_0x066f('0x1f')](function(_0x26bc90){if(_0x26bc90){_0x56e995=_0x26bc90;return db[_0x066f('0x80')][_0x066f('0x55')]({'where':{'id':_0x26bc90['WhatsappAccountId']}});}})[_0x066f('0x1f')](handleEntityNotFound(_0x553198,null))[_0x066f('0x1f')](function(_0x136221){if(_0x136221){logger[_0x066f('0x23')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x066f('0x2c'),'received\x20delivery\x20report\x20from',_0x136221['type'],util['inspect'](_0x43f0f7[_0x066f('0x57')],{'showHidden':![],'depth':null}));switch(_0x136221[_0x066f('0x4c')]){case _0x066f('0x81'):if(_0x43f0f7['body'][_0x066f('0x82')]&&_0x43f0f7[_0x066f('0x57')]['MessageSid']===_0x56e995[_0x066f('0x83')]&&_0x43f0f7[_0x066f('0x57')][_0x066f('0x84')]&&_0x43f0f7['body'][_0x066f('0x84')]===_0x066f('0x5a')){return _0x56e995[_0x066f('0x34')]({'read':!![]});}else{logger['error'](_0x066f('0x85'),_0x066f('0x2c'),_0x066f('0x81'),util['inspect'](_0x43f0f7[_0x066f('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x56e995;}})[_0x066f('0x1f')](respondWithResult(_0x553198,null))[_0x066f('0x2a')](handleError(_0x553198,null));}; \ No newline at end of file +var _0xd309=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','WhatsappMessage','includeAll','include','findAll','show','params','options','find','create','body','update','describe','whatsapp','read','readAt','format','UserId','agent','get','WhatsappInteraction','isNil','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','User','fullname','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','MessageStatus','inspect','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x231261,_0x1f241f){var _0x7dc2=function(_0xa1ebaf){while(--_0xa1ebaf){_0x231261['push'](_0x231261['shift']());}};_0x7dc2(++_0x1f241f);}(_0xd309,0x77));var _0x9d30=function(_0x2e96fc,_0x5b6556){_0x2e96fc=_0x2e96fc-0x0;var _0x51c0b8=_0xd309[_0x2e96fc];return _0x51c0b8;};'use strict';var emlformat=require(_0x9d30('0x0'));var rimraf=require(_0x9d30('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9d30('0x2'));var moment=require(_0x9d30('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9d30('0x4'));var util=require(_0x9d30('0x5'));var path=require(_0x9d30('0x6'));var sox=require(_0x9d30('0x7'));var csv=require(_0x9d30('0x8'));var ejs=require(_0x9d30('0x9'));var fs=require('fs');var fs_extra=require(_0x9d30('0xa'));var _=require('lodash');var squel=require(_0x9d30('0xb'));var crypto=require(_0x9d30('0xc'));var jsforce=require(_0x9d30('0xd'));var deskjs=require(_0x9d30('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9d30('0xf'));var Papa=require('papaparse');var Redis=require(_0x9d30('0x10'));var authService=require(_0x9d30('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9d30('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d30('0x13'))(_0x9d30('0x14'));var utils=require(_0x9d30('0x15'));var config=require(_0x9d30('0x16'));var licenseUtil=require(_0x9d30('0x17'));var db=require(_0x9d30('0x18'))['db'];config[_0x9d30('0x19')]=_['defaults'](config[_0x9d30('0x19')],{'host':_0x9d30('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9d30('0x19')]));require('./whatsappMessage.socket')[_0x9d30('0x1b')](socket);var jayson=require(_0x9d30('0x1c'));var client=jayson[_0x9d30('0x1d')][_0x9d30('0x1e')]({'port':0x232c});var client9002=jayson[_0x9d30('0x1d')][_0x9d30('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2f2202,_0x2ed591,_0x1b6d10,_0x2f8751){return new BPromise(function(_0x147ac8,_0x1a5215){var _0x86a4b1=_0x2f8751||client;return _0x86a4b1[_0x9d30('0x1f')](_0x2f2202,_0x1b6d10)[_0x9d30('0x20')](function(_0x2bf078){logger[_0x9d30('0x21')](_0x9d30('0x22'),_0x2ed591,_0x9d30('0x23'));logger[_0x9d30('0x24')](_0x9d30('0x25'),_0x2ed591,_0x9d30('0x23'),JSON[_0x9d30('0x26')](_0x2bf078));if(_0x2bf078['error']){if(_0x2bf078['error'][_0x9d30('0x27')]===0x1f4){logger[_0x9d30('0x28')](_0x9d30('0x22'),_0x2ed591,_0x2bf078[_0x9d30('0x28')][_0x9d30('0x29')]);return _0x1a5215(_0x2bf078[_0x9d30('0x28')][_0x9d30('0x29')]);}logger[_0x9d30('0x28')](_0x9d30('0x22'),_0x2ed591,_0x2bf078[_0x9d30('0x28')][_0x9d30('0x29')]);return _0x147ac8(_0x2bf078['error']['message']);}else{logger['info'](_0x9d30('0x22'),_0x2ed591,_0x9d30('0x23'));_0x147ac8(_0x2bf078[_0x9d30('0x2a')][_0x9d30('0x29')]);}})[_0x9d30('0x2b')](function(_0x553272){logger[_0x9d30('0x28')](_0x9d30('0x22'),_0x2ed591,_0x553272);_0x1a5215(_0x553272);});});}function respondWithStatusCode(_0xb76ecc,_0x4d540a){_0x4d540a=_0x4d540a||0xcc;return function(_0x4d128b){if(_0x4d128b){return _0xb76ecc[_0x9d30('0x2c')](_0x4d540a);}return _0xb76ecc['status'](_0x4d540a)[_0x9d30('0x2d')]();};}function respondWithResult(_0xd55b40,_0x50495f){_0x50495f=_0x50495f||0xc8;return function(_0x18d9d4){if(_0x18d9d4){return _0xd55b40[_0x9d30('0x2e')](_0x50495f)[_0x9d30('0x2f')](_0x18d9d4);}};}function respondWithFilteredResult(_0x37a452,_0x4c7d3e){return function(_0xfe48bf){if(_0xfe48bf){var _0x7538c7=typeof _0x4c7d3e['offset']==='undefined'&&typeof _0x4c7d3e[_0x9d30('0x30')]===_0x9d30('0x31');var _0x1bd32b=_0xfe48bf[_0x9d30('0x32')];var _0x2417fa=_0x7538c7?0x0:_0x4c7d3e[_0x9d30('0x33')];var _0x4006b5=_0x7538c7?_0xfe48bf[_0x9d30('0x32')]:_0x4c7d3e[_0x9d30('0x33')]+_0x4c7d3e[_0x9d30('0x30')];var _0x4245ae;if(_0x4006b5>=_0x1bd32b){_0x4006b5=_0x1bd32b;_0x4245ae=0xc8;}else{_0x4245ae=0xce;}_0x37a452[_0x9d30('0x2e')](_0x4245ae);return _0x37a452[_0x9d30('0x34')](_0x9d30('0x35'),_0x2417fa+'-'+_0x4006b5+'/'+_0x1bd32b)[_0x9d30('0x2f')](_0xfe48bf);}return null;};}function patchUpdates(_0x48eabf){return function(_0x541994){try{jsonpatch['apply'](_0x541994,_0x48eabf,!![]);}catch(_0x38739c){return BPromise[_0x9d30('0x36')](_0x38739c);}return _0x541994[_0x9d30('0x37')]();};}function saveUpdates(_0x75d1fe,_0x54782a){return function(_0x40d9e4){if(_0x40d9e4){return _0x40d9e4['update'](_0x75d1fe)[_0x9d30('0x20')](function(_0x59a86d){return _0x59a86d;});}return null;};}function removeEntity(_0x26fd7d,_0x2a9c56){return function(_0xecd2e7){if(_0xecd2e7){return _0xecd2e7[_0x9d30('0x38')]()['then'](function(){_0x26fd7d['status'](0xcc)[_0x9d30('0x2d')]();});}};}function handleEntityNotFound(_0x5b1d76,_0xffc297){return function(_0x4a9889){if(!_0x4a9889){_0x5b1d76[_0x9d30('0x2c')](0x194);}return _0x4a9889;};}function handleError(_0x248d13,_0x21e99c){_0x21e99c=_0x21e99c||0x1f4;return function(_0x4560f0){logger['error'](_0x4560f0[_0x9d30('0x39')]);if(_0x4560f0[_0x9d30('0x3a')]){delete _0x4560f0[_0x9d30('0x3a')];}_0x248d13[_0x9d30('0x2e')](_0x21e99c)[_0x9d30('0x3b')](_0x4560f0);};}exports['index']=function(_0x3cd5e0,_0x75f4da){var _0x49d29c={},_0x347940={},_0x2b99f9={'count':0x0,'rows':[]};var _0xf25036=_[_0x9d30('0x3c')](db['WhatsappMessage'][_0x9d30('0x3d')],function(_0x2785c5){return{'name':_0x2785c5[_0x9d30('0x3e')],'type':_0x2785c5[_0x9d30('0x3f')][_0x9d30('0x40')]};});_0x347940[_0x9d30('0x41')]=_[_0x9d30('0x3c')](_0xf25036,_0x9d30('0x3a'));_0x347940[_0x9d30('0x42')]=_[_0x9d30('0x43')](_0x3cd5e0[_0x9d30('0x42')]);_0x347940[_0x9d30('0x44')]=_[_0x9d30('0x45')](_0x347940[_0x9d30('0x41')],_0x347940[_0x9d30('0x42')]);_0x49d29c[_0x9d30('0x46')]=_[_0x9d30('0x45')](_0x347940[_0x9d30('0x41')],qs[_0x9d30('0x47')](_0x3cd5e0[_0x9d30('0x42')][_0x9d30('0x47')]));_0x49d29c[_0x9d30('0x46')]=_0x49d29c[_0x9d30('0x46')][_0x9d30('0x48')]?_0x49d29c[_0x9d30('0x46')]:_0x347940[_0x9d30('0x41')];if(!_0x3cd5e0['query'][_0x9d30('0x49')](_0x9d30('0x4a'))){_0x49d29c[_0x9d30('0x30')]=qs['limit'](_0x3cd5e0[_0x9d30('0x42')]['limit']);_0x49d29c[_0x9d30('0x33')]=qs['offset'](_0x3cd5e0['query'][_0x9d30('0x33')]);}_0x49d29c[_0x9d30('0x4b')]=qs[_0x9d30('0x4c')](_0x3cd5e0[_0x9d30('0x42')][_0x9d30('0x4c')]);_0x49d29c[_0x9d30('0x4d')]=qs[_0x9d30('0x44')](_[_0x9d30('0x4e')](_0x3cd5e0[_0x9d30('0x42')],_0x347940[_0x9d30('0x44')]),_0xf25036);if(_0x3cd5e0['query']['filter']){_0x49d29c[_0x9d30('0x4d')]=_[_0x9d30('0x4f')](_0x49d29c[_0x9d30('0x4d')],{'$or':_[_0x9d30('0x3c')](_0xf25036,function(_0x483a68){if(_0x483a68[_0x9d30('0x3f')]!=='VIRTUAL'){var _0x7eab1b={};_0x7eab1b[_0x483a68['name']]={'$like':'%'+_0x3cd5e0[_0x9d30('0x42')][_0x9d30('0x50')]+'%'};return _0x7eab1b;}})});}_0x49d29c=_[_0x9d30('0x4f')]({},_0x49d29c,_0x3cd5e0['options']);var _0x5c72e1={'where':_0x49d29c[_0x9d30('0x4d')]};return db[_0x9d30('0x51')]['count'](_0x5c72e1)[_0x9d30('0x20')](function(_0x4360b1){_0x2b99f9[_0x9d30('0x32')]=_0x4360b1;if(_0x3cd5e0[_0x9d30('0x42')][_0x9d30('0x52')]){_0x49d29c[_0x9d30('0x53')]=[{'all':!![]}];}return db[_0x9d30('0x51')][_0x9d30('0x54')](_0x49d29c);})['then'](function(_0x241e88){_0x2b99f9['rows']=_0x241e88;return _0x2b99f9;})[_0x9d30('0x20')](respondWithFilteredResult(_0x75f4da,_0x49d29c))[_0x9d30('0x2b')](handleError(_0x75f4da,null));};exports[_0x9d30('0x55')]=function(_0x2b3864,_0x2bd198){var _0x3088fc={'raw':!![],'where':{'id':_0x2b3864[_0x9d30('0x56')]['id']}},_0x3669e3={};_0x3669e3[_0x9d30('0x41')]=_[_0x9d30('0x43')](db[_0x9d30('0x51')][_0x9d30('0x3d')]);_0x3669e3['query']=_[_0x9d30('0x43')](_0x2b3864['query']);_0x3669e3[_0x9d30('0x44')]=_[_0x9d30('0x45')](_0x3669e3[_0x9d30('0x41')],_0x3669e3[_0x9d30('0x42')]);_0x3088fc['attributes']=_[_0x9d30('0x45')](_0x3669e3['model'],qs['fields'](_0x2b3864[_0x9d30('0x42')][_0x9d30('0x47')]));_0x3088fc[_0x9d30('0x46')]=_0x3088fc['attributes']['length']?_0x3088fc['attributes']:_0x3669e3[_0x9d30('0x41')];if(_0x2b3864[_0x9d30('0x42')]['includeAll']){_0x3088fc[_0x9d30('0x53')]=[{'all':!![]}];}_0x3088fc=_[_0x9d30('0x4f')]({},_0x3088fc,_0x2b3864[_0x9d30('0x57')]);return db[_0x9d30('0x51')][_0x9d30('0x58')](_0x3088fc)['then'](handleEntityNotFound(_0x2bd198,null))[_0x9d30('0x20')](respondWithResult(_0x2bd198,null))[_0x9d30('0x2b')](handleError(_0x2bd198,null));};exports[_0x9d30('0x59')]=function(_0x26ae32,_0x353898){return db['WhatsappMessage'][_0x9d30('0x59')](_0x26ae32[_0x9d30('0x5a')],{})['then'](respondWithResult(_0x353898,0xc9))[_0x9d30('0x2b')](handleError(_0x353898,null));};exports[_0x9d30('0x5b')]=function(_0x3a7724,_0x3cbba6){if(_0x3a7724[_0x9d30('0x5a')]['id']){delete _0x3a7724['body']['id'];}return db[_0x9d30('0x51')][_0x9d30('0x58')]({'where':{'id':_0x3a7724[_0x9d30('0x56')]['id']}})[_0x9d30('0x20')](handleEntityNotFound(_0x3cbba6,null))[_0x9d30('0x20')](saveUpdates(_0x3a7724[_0x9d30('0x5a')],null))['then'](respondWithResult(_0x3cbba6,null))[_0x9d30('0x2b')](handleError(_0x3cbba6,null));};exports[_0x9d30('0x38')]=function(_0x403a74,_0x13f5bc){return db[_0x9d30('0x51')][_0x9d30('0x58')]({'where':{'id':_0x403a74[_0x9d30('0x56')]['id']}})[_0x9d30('0x20')](handleEntityNotFound(_0x13f5bc,null))[_0x9d30('0x20')](removeEntity(_0x13f5bc,null))['catch'](handleError(_0x13f5bc,null));};exports[_0x9d30('0x5c')]=function(_0x39e6ce,_0x1583d6){return db[_0x9d30('0x51')][_0x9d30('0x5c')]()[_0x9d30('0x20')](respondWithResult(_0x1583d6,null))[_0x9d30('0x2b')](handleError(_0x1583d6,null));};var interaction_log=require(_0x9d30('0x13'))('whatsapp-interactions');exports['accept']=function(_0x11c6d5,_0x3da296,_0xce998a){var _0x1cf979={'agent':{},'channel':_0x9d30('0x5d')};if(_0x11c6d5[_0x9d30('0x5a')]['id']){delete _0x11c6d5[_0x9d30('0x5a')]['id'];}_0x11c6d5[_0x9d30('0x5a')][_0x9d30('0x5e')]=!![];_0x11c6d5['body'][_0x9d30('0x5f')]=moment()[_0x9d30('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x11c6d5[_0x9d30('0x5a')][_0x9d30('0x61')]=_0x11c6d5['body']['UserId']||_0x11c6d5['user']['id'];_0x1cf979[_0x9d30('0x62')]['id']=_0x11c6d5[_0x9d30('0x5a')][_0x9d30('0x61')];return db[_0x9d30('0x51')][_0x9d30('0x58')]({'where':{'id':_0x11c6d5[_0x9d30('0x56')]['id'],'UserId':null}})[_0x9d30('0x20')](handleEntityNotFound(_0x3da296,null))['then'](saveUpdates(_0x11c6d5['body'],null))['then'](function(_0x361b1b){if(_0x361b1b){_0x1cf979[_0x9d30('0x29')]=_0x361b1b[_0x9d30('0x63')]({'plain':!![]});return db[_0x9d30('0x64')][_0x9d30('0x58')]({'where':{'id':_0x361b1b['WhatsappInteractionId']}});}return null;})[_0x9d30('0x20')](handleEntityNotFound(_0x3da296,null))['then'](function(_0x548eda){if(_0x548eda){return _0x548eda[_0x9d30('0x5b')]({'UserId':_0x11c6d5[_0x9d30('0x5a')][_0x9d30('0x61')],'read1stAt':_[_0x9d30('0x65')](_0x548eda['read1stAt'])?moment()[_0x9d30('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x9d30('0x20')](function(_0x452f7a){if(_0x452f7a){_0x1cf979[_0x9d30('0x66')]=_0x452f7a['get']({'plain':!![]});interaction_log[_0x9d30('0x21')](_0x9d30('0x67'),_0x11c6d5[_0x9d30('0x68')]['id'],_0x11c6d5[_0x9d30('0x68')][_0x9d30('0x3a')],_0x11c6d5[_0x9d30('0x68')]['role'],_0x1cf979[_0x9d30('0x66')]['id'],_0x11c6d5[_0x9d30('0x5a')]?JSON['stringify'](_0x11c6d5['body']):_0x9d30('0x69'));return respondWithRpcPromise('AcceptMessage',_0x9d30('0x6a'),_0x1cf979);}return null;})['then'](function(_0x159bae){var _0x579db8=_0x9d30('0x6b')+_0x159bae[_0x9d30('0x29')][_0x9d30('0x6c')];return db[_0x9d30('0x6d')]['query'](_0x579db8,{'type':db[_0x9d30('0x6e')][_0x9d30('0x6f')][_0x9d30('0x70')],'raw':!![]})['then'](function(_0x2bac21){return _0x2bac21;});})[_0x9d30('0x20')](function(_0x41dc42){if(_0x41dc42){_0x1cf979[_0x9d30('0x29')][_0x9d30('0x71')]=_0x41dc42[0x0];if(!_0x11c6d5['body'][_0x9d30('0x61')])return;return db['User']['find']({'where':{'id':_0x11c6d5[_0x9d30('0x5a')][_0x9d30('0x61')],'role':_0x9d30('0x62')},'attributes':['id',_0x9d30('0x3a'),'fullname',_0x9d30('0x72'),_0x9d30('0x73')],'raw':!![]});}return null;})['then'](function(_0x4e659a){if(!_0x4e659a)return null;_0x1cf979[_0x9d30('0x29')][_0x9d30('0x62')]=_0x4e659a;return _0x1cf979;})[_0x9d30('0x20')](function(_0x3be80f){if(_0x3be80f){if(_0x11c6d5[_0x9d30('0x5a')][_0x9d30('0x74')]){_0x1cf979[_0x9d30('0x29')]['interface']=util[_0x9d30('0x60')](_0x9d30('0x75'),_0x11c6d5[_0x9d30('0x68')]['name']);_0x1cf979[_0x9d30('0x29')][_0x9d30('0x76')]=_0x1cf979[_0x9d30('0x76')];_0x1cf979[_0x9d30('0x29')][_0x9d30('0x77')]=_0x1cf979['channel'];_0x1cf979['message'][_0x9d30('0x78')]=_0x9d30('0x79');return respondWithRpcPromise(_0x9d30('0x7a'),'EventManager',{'event':'acceptmessage','message':_0x1cf979[_0x9d30('0x29')]},client9002)[_0x9d30('0x20')](function(){return _0x1cf979;});}return _0x1cf979;}return null;})[_0x9d30('0x20')](respondWithResult(_0x3da296,null))['catch'](handleError(_0x3da296,null));};var interaction_log=require(_0x9d30('0x13'))(_0x9d30('0x7b'));exports[_0x9d30('0x36')]=function(_0x7e623a,_0x38c662,_0x14b592){var _0x44a3c0={'agent':{},'channel':_0x9d30('0x5d')};if(_0x7e623a[_0x9d30('0x5a')]['id']){delete _0x7e623a['body']['id'];}_0x7e623a[_0x9d30('0x5a')][_0x9d30('0x61')]=_0x7e623a[_0x9d30('0x5a')]['UserId']||_0x7e623a[_0x9d30('0x68')]['id'];_0x44a3c0[_0x9d30('0x62')]['id']=_0x7e623a[_0x9d30('0x5a')]['UserId'];return db[_0x9d30('0x51')][_0x9d30('0x58')]({'where':{'id':_0x7e623a[_0x9d30('0x56')]['id'],'UserId':null}})[_0x9d30('0x20')](handleEntityNotFound(_0x38c662,null))['then'](function(_0x220bb3){if(_0x220bb3){_0x44a3c0[_0x9d30('0x29')]=_0x220bb3[_0x9d30('0x63')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x220bb3['WhatsappInteractionId']}});}return null;})[_0x9d30('0x20')](handleEntityNotFound(_0x38c662,null))[_0x9d30('0x20')](function(_0x1c6bb7){if(_0x1c6bb7){_0x44a3c0[_0x9d30('0x66')]=_0x1c6bb7[_0x9d30('0x63')]({'plain':!![]});interaction_log[_0x9d30('0x21')](_0x9d30('0x7c'),_0x7e623a[_0x9d30('0x68')]['id'],_0x7e623a[_0x9d30('0x68')][_0x9d30('0x3a')],_0x7e623a['user']['role'],_0x44a3c0['interaction']['id'],_0x7e623a[_0x9d30('0x5a')]?JSON[_0x9d30('0x26')](_0x7e623a[_0x9d30('0x5a')]):_0x9d30('0x69'));return respondWithRpcPromise('RejectMessage',_0x9d30('0x7d'),_0x44a3c0);}return null;})[_0x9d30('0x20')](function(_0x427d11){var _0x5a734c=_0x9d30('0x6b')+_0x427d11[_0x9d30('0x29')][_0x9d30('0x6c')];return db[_0x9d30('0x6d')][_0x9d30('0x42')](_0x5a734c,{'type':db[_0x9d30('0x6e')][_0x9d30('0x6f')]['SELECT'],'raw':!![]})[_0x9d30('0x20')](function(_0x1fd8b0){return _0x1fd8b0;});})[_0x9d30('0x20')](function(_0x3314c9){if(_0x3314c9){_0x44a3c0[_0x9d30('0x29')][_0x9d30('0x71')]=_0x3314c9[0x0];if(!_0x7e623a['body'][_0x9d30('0x61')])return;return db[_0x9d30('0x7e')]['find']({'where':{'id':_0x7e623a[_0x9d30('0x5a')][_0x9d30('0x61')],'role':'agent'},'attributes':['id',_0x9d30('0x3a'),_0x9d30('0x7f'),_0x9d30('0x72'),_0x9d30('0x73')],'raw':!![]});}return null;})[_0x9d30('0x20')](function(_0x1e3ea9){if(!_0x1e3ea9)return null;_0x44a3c0['message'][_0x9d30('0x62')]=_0x1e3ea9;return _0x44a3c0;})[_0x9d30('0x20')](function(_0x5f0cef){if(_0x5f0cef){_0x5f0cef[_0x9d30('0x29')]['interface']=util[_0x9d30('0x60')](_0x9d30('0x75'),_0x7e623a[_0x9d30('0x68')][_0x9d30('0x3a')]);_0x5f0cef[_0x9d30('0x29')][_0x9d30('0x76')]=_0x44a3c0[_0x9d30('0x76')];_0x5f0cef[_0x9d30('0x29')][_0x9d30('0x77')]=_0x44a3c0[_0x9d30('0x76')];_0x5f0cef[_0x9d30('0x29')]['event']=_0x9d30('0x36');respondWithRpcPromise('EventManager',_0x9d30('0x7a'),{'event':_0x9d30('0x80'),'message':_0x5f0cef['message']},client9002);return _0x44a3c0;}return null;})[_0x9d30('0x20')](respondWithResult(_0x38c662,null))[_0x9d30('0x2b')](handleError(_0x38c662,null));};exports[_0x9d30('0x2e')]=function(_0x3eec57,_0x38c232,_0x4c9274){if(_0x3eec57['body']['id']){delete _0x3eec57['body']['id'];}var _0x3a73b2;return db['WhatsappMessage'][_0x9d30('0x58')]({'where':{'id':_0x3eec57[_0x9d30('0x56')]['id']}})[_0x9d30('0x20')](handleEntityNotFound(_0x38c232,null))[_0x9d30('0x20')](function(_0x54af10){if(_0x54af10){_0x3a73b2=_0x54af10;return db[_0x9d30('0x81')][_0x9d30('0x58')]({'where':{'id':_0x54af10['WhatsappAccountId']}});}})[_0x9d30('0x20')](handleEntityNotFound(_0x38c232,null))['then'](function(_0x42f01b){if(_0x42f01b){logger[_0x9d30('0x24')](_0x9d30('0x82'),_0x9d30('0x2e'),_0x9d30('0x83'),_0x42f01b[_0x9d30('0x3f')],util['inspect'](_0x3eec57['body'],{'showHidden':![],'depth':null}));switch(_0x42f01b[_0x9d30('0x3f')]){case _0x9d30('0x84'):if(_0x3eec57[_0x9d30('0x5a')][_0x9d30('0x85')]&&_0x3eec57[_0x9d30('0x5a')][_0x9d30('0x85')]===_0x3a73b2['messageId']&&_0x3eec57[_0x9d30('0x5a')][_0x9d30('0x86')]&&_0x3eec57['body']['MessageStatus']===_0x9d30('0x5e')){return _0x3a73b2[_0x9d30('0x5b')]({'read':!![]});}else{logger[_0x9d30('0x28')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x9d30('0x2e'),_0x9d30('0x84'),util[_0x9d30('0x87')](_0x3eec57['body'],{'showHidden':![],'depth':null}));}break;}return _0x3a73b2;}})[_0x9d30('0x20')](respondWithResult(_0x38c232,null))[_0x9d30('0x2b')](handleError(_0x38c232,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 341bcc2..4c0c8dd 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 _0x63a5=['WhatsappMessage','save','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x27551c,_0x184f9c){var _0x2f518d=function(_0x3c37c2){while(--_0x3c37c2){_0x27551c['push'](_0x27551c['shift']());}};_0x2f518d(++_0x184f9c);}(_0x63a5,0x18e));var _0x563a=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x63a5[_0x1f36bb];return _0xaf97fa;};'use strict';var EventEmitter=require(_0x563a('0x0'));var WhatsappMessage=require(_0x563a('0x1'))['db'][_0x563a('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x563a('0x3'),'afterUpdate':'update','afterDestroy':_0x563a('0x4')};function emitEvent(_0x13195e){return function(_0x386400,_0x37e617,_0x5c2a8d){WhatsappMessageEvents['emit'](_0x13195e+':'+_0x386400['id'],_0x386400);WhatsappMessageEvents[_0x563a('0x5')](_0x13195e,_0x386400);_0x5c2a8d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x563a('0x6')](e,emitEvent(event));}}module[_0x563a('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0x0abf=['hook','events','WhatsappMessage','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x5184d9,_0x307075){var _0x57ffd0=function(_0x17c431){while(--_0x17c431){_0x5184d9['push'](_0x5184d9['shift']());}};_0x57ffd0(++_0x307075);}(_0x0abf,0xe8));var _0xf0ab=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0abf[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0xf0ab('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0xf0ab('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf0ab('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf0ab('0x3')};function emitEvent(_0x4889fb){return function(_0x7ea4e0,_0x3be05e,_0x2efe43){WhatsappMessageEvents[_0xf0ab('0x4')](_0x4889fb+':'+_0x7ea4e0['id'],_0x7ea4e0);WhatsappMessageEvents[_0xf0ab('0x4')](_0x4889fb,_0x7ea4e0);_0x2efe43(null);};}for(var e in events){if(events[_0xf0ab('0x5')](e)){var event=events[e];WhatsappMessage[_0xf0ab('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index b2c1bf5..c4999d3 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 _0x43e7=['Bearer\x20','statuses','message_id','err','WhatsappMessage,\x20%s','finally','lodash','../../config/logger','request-promise','path','rimraf','exports','messageId','fti_whatsapp_messages','body','models','direction','toLowerCase','out','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','catch','error','secret','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','phone','authToken','messages','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','/messages/','text'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x43e7,0xda));var _0x743e=function(_0x235f49,_0x2992b4){_0x235f49=_0x235f49-0x0;var _0x551139=_0x43e7[_0x235f49];return _0x551139;};'use strict';var _=require(_0x743e('0x0'));var util=require('util');var logger=require(_0x743e('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x743e('0x2'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x743e('0x3'));var rimraf=require(_0x743e('0x4'));var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module[_0x743e('0x5')]=function(_0x54a27d,_0x175a12){return _0x54a27d['define']('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x743e('0x6')]},{'name':_0x743e('0x7'),'fields':[_0x743e('0x8')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b27f6,_0x3877de,_0x54e740){var _0x4421e5=_0x54a27d[_0x743e('0x9')];var _0x27b8b5=_0x4b27f6['get']({'plain':!![]});if(_0x27b8b5[_0x743e('0xa')]['toLowerCase']()==='in'||_0x27b8b5[_0x743e('0xa')][_0x743e('0xb')]()===_0x743e('0xc')&&!_0x27b8b5['secret']&&!_[_0x743e('0xd')](_0x27b8b5[_0x743e('0xe')])){_0x4421e5[_0x743e('0xf')][_0x743e('0x10')]({'where':{'id':_0x27b8b5[_0x743e('0x11')]}})['then'](function(_0x5780ba){if(_0x5780ba){_0x5780ba[_0x743e('0x12')]({'lastMsgAt':_0x27b8b5[_0x743e('0x13')],'lastMsgDirection':_0x27b8b5[_0x743e('0xa')][_0x743e('0xb')]()});}})[_0x743e('0x14')](function(_0x4f80b2){console[_0x743e('0x15')](_0x4f80b2);});}if(_0x27b8b5[_0x743e('0xa')]===_0x743e('0xc')&&!_0x27b8b5[_0x743e('0x16')]){var _0x3799e8;_0x4421e5[_0x743e('0x17')][_0x743e('0x18')]({'where':{'id':_0x27b8b5[_0x743e('0x19')]},'raw':!![]})[_0x743e('0x1a')](function(_0x3ea85b){_0x3799e8=_0x3ea85b;if(_0x3799e8&&_0x3799e8[_0x743e('0x1b')]){switch(_0x3799e8[_0x743e('0x1b')]){case _0x743e('0x1c'):var _0x27c3b5=require(_0x743e('0x1c'));if(_0x3799e8[_0x743e('0x1d')]&&_0x3799e8['authToken']&&_0x3799e8[_0x743e('0x1e')]){var _0x78993f=new _0x27c3b5(_0x3799e8[_0x743e('0x1d')],_0x3799e8[_0x743e('0x1f')]);_0x78993f[_0x743e('0x20')]['create']({'body':_0x27b8b5[_0x743e('0x8')],'to':_0x743e('0x21')+_0x27b8b5[_0x743e('0x1e')],'from':_0x743e('0x21')+_0x3799e8[_0x743e('0x1e')],'statusCallback':_0x3799e8[_0x743e('0x22')]+_0x743e('0x23')+_0x27b8b5['id']+_0x743e('0x24')+_0x3799e8[_0x743e('0x25')]})[_0x743e('0x1a')](function(_0x30cb8e){if(_0x30cb8e[_0x743e('0x26')]){return _0x4b27f6[_0x743e('0x12')]({'messageId':_0x30cb8e[_0x743e('0x26')]});}})['catch'](function(_0x4310cc){logger[_0x743e('0x15')](_0x743e('0x27'),_0x743e('0x28'),_0x743e('0x1c'),util[_0x743e('0x29')](_0x4310cc,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x743e('0x27'),'afterCreate','twilio',_0x743e('0x2a'));}break;case _0x743e('0x2b'):var _0x4936c1=_0x3799e8[_0x743e('0x1d')];var _0x1da709=_0x3799e8['authToken'];var _0x3f72df=_0x3799e8['baseUrl']+_0x743e('0x2c')+_0x4936c1+_0x743e('0x2d');var _0x4cd1f7={'to':[_0x27b8b5[_0x743e('0x1e')]],'message':{'type':_0x743e('0x2e'),'text':_0x27b8b5[_0x743e('0x8')]}};var _0x497cd1={'method':'POST','uri':_0x3f72df,'headers':{'Authorization':_0x743e('0x2f')+_0x1da709,'Content-Type':'application/json'},'body':_0x4cd1f7,'json':!![]};rp(_0x497cd1)[_0x743e('0x1a')](function(_0x5bbc26){if(_0x5bbc26[_0x743e('0x30')][0x0][_0x743e('0x31')]){return _0x4b27f6[_0x743e('0x12')]({'messageId':_0x5bbc26['statuses'][0x0][_0x743e('0x31')]});}})['catch'](function(_0x4bf3dc){logger[_0x743e('0x32')](_0x743e('0x33'),_0x4bf3dc);});break;}}})[_0x743e('0x34')](function(){_0x54e740();});}else{_0x54e740();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9992=['util','moment','bluebird','request-promise','./whatsappMessage.attributes','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','whatsapp:','remote','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','application/json','statuses','err','finally','lodash'];(function(_0x15717e,_0x2ad12b){var _0x5dd7a2=function(_0x43283d){while(--_0x43283d){_0x15717e['push'](_0x15717e['shift']());}};_0x5dd7a2(++_0x2ad12b);}(_0x9992,0x143));var _0x2999=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0x9992[_0x4953da];return _0x2d3780;};'use strict';var _=require(_0x2999('0x0'));var util=require(_0x2999('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2999('0x2'));var BPromise=require(_0x2999('0x3'));var rp=require(_0x2999('0x4'));var fetch=require('node-fetch');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2999('0x5'));module[_0x2999('0x6')]=function(_0x4bc81f,_0x422015){return _0x4bc81f[_0x2999('0x7')]('WhatsappMessage',attributes,{'tableName':_0x2999('0x8'),'paranoid':![],'indexes':[{'name':_0x2999('0x9'),'fields':[_0x2999('0x9')]},{'name':_0x2999('0xa'),'fields':[_0x2999('0xb')],'type':_0x2999('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5879a1,_0x57ba92,_0xe1f01b){var _0x3d45d2=_0x4bc81f[_0x2999('0xd')];var _0x1f1536=_0x5879a1[_0x2999('0xe')]({'plain':!![]});if(_0x1f1536[_0x2999('0xf')][_0x2999('0x10')]()==='in'||_0x1f1536['direction']['toLowerCase']()===_0x2999('0x11')&&!_0x1f1536[_0x2999('0x12')]&&!_[_0x2999('0x13')](_0x1f1536[_0x2999('0x14')])){_0x3d45d2['WhatsappInteraction'][_0x2999('0x15')]({'where':{'id':_0x1f1536[_0x2999('0x16')]}})[_0x2999('0x17')](function(_0x4d992e){if(_0x4d992e){_0x4d992e[_0x2999('0x18')]({'lastMsgAt':_0x1f1536[_0x2999('0x19')],'lastMsgDirection':_0x1f1536['direction'][_0x2999('0x10')]()});}})[_0x2999('0x1a')](function(_0x4f9708){console[_0x2999('0x1b')](_0x4f9708);});}if(_0x1f1536[_0x2999('0xf')]==='out'&&!_0x1f1536[_0x2999('0x12')]){var _0x357064;_0x3d45d2[_0x2999('0x1c')]['find']({'where':{'id':_0x1f1536[_0x2999('0x1d')]},'raw':!![]})[_0x2999('0x17')](function(_0x5545ba){_0x357064=_0x5545ba;if(_0x357064&&_0x357064[_0x2999('0x1e')]){switch(_0x357064['type']){case _0x2999('0x1f'):var _0x3ce8d6=require('twilio');if(_0x357064[_0x2999('0x20')]&&_0x357064[_0x2999('0x21')]&&_0x357064[_0x2999('0x22')]){var _0x1a240a=new _0x3ce8d6(_0x357064[_0x2999('0x20')],_0x357064[_0x2999('0x21')]);_0x1a240a[_0x2999('0x23')]['create']({'body':_0x1f1536[_0x2999('0xb')],'to':_0x2999('0x24')+_0x1f1536[_0x2999('0x22')],'from':'whatsapp:'+_0x357064[_0x2999('0x22')],'statusCallback':_0x357064[_0x2999('0x25')]+'/api/whatsapp/messages/'+_0x1f1536['id']+_0x2999('0x26')+_0x357064[_0x2999('0x27')]})[_0x2999('0x17')](function(_0x35b28a){if(_0x35b28a[_0x2999('0x28')]){return _0x5879a1['update']({'messageId':_0x35b28a['sid']});}})[_0x2999('0x1a')](function(_0x34cfe8){logger[_0x2999('0x1b')](_0x2999('0x29'),_0x2999('0x2a'),_0x2999('0x1f'),util[_0x2999('0x2b')](_0x34cfe8,{'showHidden':![],'depth':null}));});}else{logger[_0x2999('0x1b')](_0x2999('0x29'),_0x2999('0x2a'),_0x2999('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x2999('0x2c'):var _0x595e0b=_0x357064[_0x2999('0x20')];var _0x420c5f=_0x357064[_0x2999('0x21')];var _0xa8bf86=_0x357064[_0x2999('0x2d')]+_0x2999('0x2e')+_0x595e0b+_0x2999('0x2f');var _0x24024e={'to':[_0x1f1536['phone']],'message':{'type':_0x2999('0x30'),'text':_0x1f1536[_0x2999('0xb')]}};var _0x54fc12={'method':_0x2999('0x31'),'uri':_0xa8bf86,'headers':{'Authorization':'Bearer\x20'+_0x420c5f,'Content-Type':_0x2999('0x32')},'body':_0x24024e,'json':!![]};rp(_0x54fc12)[_0x2999('0x17')](function(_0x56640c){if(_0x56640c[_0x2999('0x33')][0x0]['message_id']){return _0x5879a1[_0x2999('0x18')]({'messageId':_0x56640c[_0x2999('0x33')][0x0]['message_id']});}})[_0x2999('0x1a')](function(_0x44e7dc){logger[_0x2999('0x34')]('WhatsappMessage,\x20%s',_0x44e7dc);});break;}}})[_0x2999('0x35')](function(){_0xe1f01b();});}else{_0xe1f01b();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index ca235a7..1034ad7 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 _0x8332=['CreateWhatsappMessage','WhatsappMessage','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x2cc407,_0x184b1d){var _0x37d44d=function(_0x1db55f){while(--_0x1db55f){_0x2cc407['push'](_0x2cc407['shift']());}};_0x37d44d(++_0x184b1d);}(_0x8332,0x18b));var _0x2833=function(_0x515f91,_0x3c7964){_0x515f91=_0x515f91-0x0;var _0x1867ee=_0x8332[_0x515f91];return _0x1867ee;};'use strict';var _=require(_0x2833('0x0'));var util=require(_0x2833('0x1'));var moment=require(_0x2833('0x2'));var BPromise=require(_0x2833('0x3'));var rs=require(_0x2833('0x4'));var fs=require('fs');var Redis=require(_0x2833('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2833('0x6'))(_0x2833('0x7'));var config=require('../../config/environment');var jayson=require(_0x2833('0x8'));var client=jayson[_0x2833('0x9')][_0x2833('0xa')]({'port':0x232a});config[_0x2833('0xb')]=_[_0x2833('0xc')](config[_0x2833('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x2833('0xd'))(new Redis(config[_0x2833('0xb')]));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2f2dfb,_0x18c22c,_0xdafd70){return new BPromise(function(_0x2d0579,_0x3c81c8){return client['request'](_0x2f2dfb,_0xdafd70)['then'](function(_0x5390ea){logger['info'](_0x2833('0xe'),_0x18c22c,_0x2833('0xf'));logger[_0x2833('0x10')](_0x2833('0x11'),_0x18c22c,_0x2833('0xf'),JSON[_0x2833('0x12')](_0x5390ea));if(_0x5390ea[_0x2833('0x13')]){if(_0x5390ea[_0x2833('0x13')][_0x2833('0x14')]===0x1f4){logger[_0x2833('0x13')](_0x2833('0xe'),_0x18c22c,_0x5390ea['error'][_0x2833('0x15')]);return _0x3c81c8(_0x5390ea[_0x2833('0x13')]['message']);}logger[_0x2833('0x13')](_0x2833('0xe'),_0x18c22c,_0x5390ea[_0x2833('0x13')][_0x2833('0x15')]);return _0x2d0579(_0x5390ea[_0x2833('0x13')][_0x2833('0x15')]);}else{logger[_0x2833('0x16')](_0x2833('0xe'),_0x18c22c,_0x2833('0xf'));_0x2d0579(_0x5390ea[_0x2833('0x17')][_0x2833('0x15')]);}})[_0x2833('0x18')](function(_0x9ac013){logger[_0x2833('0x13')](_0x2833('0xe'),_0x18c22c,_0x9ac013);_0x3c81c8(_0x9ac013);});});}exports[_0x2833('0x19')]=function(_0x211462){var _0x55c567=this;return new Promise(function(_0x111d09,_0x18ab04){return db[_0x2833('0x1a')][_0x2833('0x1b')](_0x211462[_0x2833('0x1c')],{'raw':_0x211462[_0x2833('0x1d')]?_0x211462['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4d1cb6){logger[_0x2833('0x16')](_0x2833('0x19'),_0x211462);logger[_0x2833('0x10')](_0x2833('0x19'),_0x211462,JSON[_0x2833('0x12')](_0x4d1cb6));_0x111d09(_0x4d1cb6);})[_0x2833('0x18')](function(_0xc9509f){logger[_0x2833('0x13')](_0x2833('0x19'),_0xc9509f['message'],_0x211462);_0x18ab04(_0x55c567[_0x2833('0x13')](0x1f4,_0xc9509f[_0x2833('0x15')]));});});}; \ No newline at end of file +var _0xa6d5=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./whatsappMessage.socket','register','request','then','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','WhatsappMessage,\x20%s,\x20%s','message','info','request\x20sent','catch','create','body','options','raw','CreateWhatsappMessage','stringify','util','moment','bluebird','randomstring'];(function(_0x529972,_0x2a1477){var _0x14da23=function(_0x276837){while(--_0x276837){_0x529972['push'](_0x529972['shift']());}};_0x14da23(++_0x2a1477);}(_0xa6d5,0x15c));var _0x5a6d=function(_0x3174bf,_0x3460e4){_0x3174bf=_0x3174bf-0x0;var _0xf18c31=_0xa6d5[_0x3174bf];return _0xf18c31;};'use strict';var _=require('lodash');var util=require(_0x5a6d('0x0'));var moment=require(_0x5a6d('0x1'));var BPromise=require(_0x5a6d('0x2'));var rs=require(_0x5a6d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a6d('0x4'))['db'];var utils=require(_0x5a6d('0x5'));var logger=require(_0x5a6d('0x6'))('rpc');var config=require(_0x5a6d('0x7'));var jayson=require(_0x5a6d('0x8'));var client=jayson[_0x5a6d('0x9')]['http']({'port':0x232a});config[_0x5a6d('0xa')]=_[_0x5a6d('0xb')](config['redis'],{'host':_0x5a6d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5a6d('0xd'))[_0x5a6d('0xe')](socket);function respondWithRpcPromise(_0x26a8ea,_0x2b5752,_0x4fde34){return new BPromise(function(_0x176b2d,_0x1d8f07){return client[_0x5a6d('0xf')](_0x26a8ea,_0x4fde34)[_0x5a6d('0x10')](function(_0x2b9bff){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x2b5752,'request\x20sent');logger[_0x5a6d('0x11')](_0x5a6d('0x12'),_0x2b5752,'request\x20sent',JSON['stringify'](_0x2b9bff));if(_0x2b9bff[_0x5a6d('0x13')]){if(_0x2b9bff[_0x5a6d('0x13')][_0x5a6d('0x14')]===0x1f4){logger[_0x5a6d('0x13')](_0x5a6d('0x15'),_0x2b5752,_0x2b9bff[_0x5a6d('0x13')]['message']);return _0x1d8f07(_0x2b9bff['error']['message']);}logger[_0x5a6d('0x13')](_0x5a6d('0x15'),_0x2b5752,_0x2b9bff[_0x5a6d('0x13')]['message']);return _0x176b2d(_0x2b9bff[_0x5a6d('0x13')][_0x5a6d('0x16')]);}else{logger[_0x5a6d('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x2b5752,_0x5a6d('0x18'));_0x176b2d(_0x2b9bff['result'][_0x5a6d('0x16')]);}})[_0x5a6d('0x19')](function(_0x52038e){logger[_0x5a6d('0x13')](_0x5a6d('0x15'),_0x2b5752,_0x52038e);_0x1d8f07(_0x52038e);});});}exports['CreateWhatsappMessage']=function(_0x38607b){var _0x2040c2=this;return new Promise(function(_0x4a4bd2,_0x2ae31a){return db['WhatsappMessage'][_0x5a6d('0x1a')](_0x38607b[_0x5a6d('0x1b')],{'raw':_0x38607b['options']?_0x38607b[_0x5a6d('0x1c')][_0x5a6d('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x3e2ea1){logger['info'](_0x5a6d('0x1e'),_0x38607b);logger[_0x5a6d('0x11')](_0x5a6d('0x1e'),_0x38607b,JSON[_0x5a6d('0x1f')](_0x3e2ea1));_0x4a4bd2(_0x3e2ea1);})['catch'](function(_0x5a6163){logger[_0x5a6d('0x13')](_0x5a6d('0x1e'),_0x5a6163['message'],_0x38607b);_0x2ae31a(_0x2040c2['error'](0x1f4,_0x5a6163['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 671e562..3a5be55 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 _0xf3e6=['update','removeListener','length','whatsappMessage:','./whatsappMessage.events','save','remove'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf3e6,0x1d2));var _0x6f3e=function(_0x771341,_0x22e7ca){_0x771341=_0x771341-0x0;var _0x2d66af=_0xf3e6[_0x771341];return _0x2d66af;};'use strict';var WhatsappMessageEvents=require(_0x6f3e('0x0'));var events=[_0x6f3e('0x1'),_0x6f3e('0x2'),_0x6f3e('0x3')];function createListener(_0x44b871,_0x269275){return function(_0x550aae){_0x269275['emit'](_0x44b871,_0x550aae);};}function removeListener(_0x450751,_0x47bb5c){return function(){WhatsappMessageEvents[_0x6f3e('0x4')](_0x450751,_0x47bb5c);};}exports['register']=function(_0x2aea30){for(var _0x1b344e=0x0,_0x28e9b1=events[_0x6f3e('0x5')];_0x1b344e<_0x28e9b1;_0x1b344e++){var _0x5410c3=events[_0x1b344e];var _0x5f22f8=createListener(_0x6f3e('0x6')+_0x5410c3,_0x2aea30);WhatsappMessageEvents['on'](_0x5410c3,_0x5f22f8);}}; \ No newline at end of file +var _0x1c5a=['whatsappMessage:','./whatsappMessage.events','remove','emit','removeListener','register','length'];(function(_0x543f8b,_0xcd2fba){var _0x62f0a9=function(_0x2b06a5){while(--_0x2b06a5){_0x543f8b['push'](_0x543f8b['shift']());}};_0x62f0a9(++_0xcd2fba);}(_0x1c5a,0x135));var _0xa1c5=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x1c5a[_0x3bf83f];return _0x22c4a9;};'use strict';var WhatsappMessageEvents=require(_0xa1c5('0x0'));var events=['save',_0xa1c5('0x1'),'update'];function createListener(_0x3c0715,_0x3391a7){return function(_0x596698){_0x3391a7[_0xa1c5('0x2')](_0x3c0715,_0x596698);};}function removeListener(_0x5c8190,_0x4ce767){return function(){WhatsappMessageEvents[_0xa1c5('0x3')](_0x5c8190,_0x4ce767);};}exports[_0xa1c5('0x4')]=function(_0x2f0721){for(var _0x7e2516=0x0,_0x49fd0a=events[_0xa1c5('0x5')];_0x7e2516<_0x49fd0a;_0x7e2516++){var _0x3224f4=events[_0x7e2516];var _0x52ca78=createListener(_0xa1c5('0x6')+_0x3224f4,_0x2f0721);WhatsappMessageEvents['on'](_0x3224f4,_0x52ca78);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 6b56261..d059d58 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 _0x5498=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','/:id/users','addAgents','put','update','destroy','delete','removeAgents','exports','multer','util'];(function(_0x10963b,_0x50d8a1){var _0x212696=function(_0x590622){while(--_0x590622){_0x10963b['push'](_0x10963b['shift']());}};_0x212696(++_0x50d8a1);}(_0x5498,0x11e));var _0x8549=function(_0xdbb511,_0x3cc4cf){_0xdbb511=_0xdbb511-0x0;var _0x1980aa=_0x5498[_0xdbb511];return _0x1980aa;};'use strict';var multer=require(_0x8549('0x0'));var util=require(_0x8549('0x1'));var path=require(_0x8549('0x2'));var timeout=require(_0x8549('0x3'));var express=require(_0x8549('0x4'));var router=express[_0x8549('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8549('0x6'));var interaction=require(_0x8549('0x7'));var config=require(_0x8549('0x8'));var controller=require(_0x8549('0x9'));router[_0x8549('0xa')]('/',auth['isAuthenticated'](),controller[_0x8549('0xb')]);router['get'](_0x8549('0xc'),auth[_0x8549('0xd')](),controller[_0x8549('0xe')]);router[_0x8549('0xa')](_0x8549('0xf'),auth[_0x8549('0xd')](),controller[_0x8549('0x10')]);router[_0x8549('0xa')](_0x8549('0x11'),auth[_0x8549('0xd')](),controller[_0x8549('0x12')]);router[_0x8549('0xa')](_0x8549('0x13'),auth[_0x8549('0xd')](),controller[_0x8549('0x14')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x8549('0x15')]);router[_0x8549('0x16')]('/',auth[_0x8549('0xd')](),controller[_0x8549('0x17')]);router[_0x8549('0x16')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0x8549('0x16')](_0x8549('0x18'),auth[_0x8549('0xd')](),controller[_0x8549('0x19')]);router[_0x8549('0x1a')](_0x8549('0xf'),auth['isAuthenticated'](),controller[_0x8549('0x1b')]);router['delete'](_0x8549('0xf'),auth[_0x8549('0xd')](),controller[_0x8549('0x1c')]);router['delete'](_0x8549('0x13'),auth[_0x8549('0xd')](),controller['removeTeams']);router[_0x8549('0x1d')](_0x8549('0x18'),auth[_0x8549('0xd')](),controller[_0x8549('0x1e')]);module[_0x8549('0x1f')]=router; \ No newline at end of file +var _0xe76f=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','post','addTeams','addAgents','put','update','destroy','delete','removeTeams','exports','multer'];(function(_0x4089bf,_0x49de28){var _0x12f3ba=function(_0x48f32b){while(--_0x48f32b){_0x4089bf['push'](_0x4089bf['shift']());}};_0x12f3ba(++_0x49de28);}(_0xe76f,0x1df));var _0xfe76=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xe76f[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0xfe76('0x0'));var util=require(_0xfe76('0x1'));var path=require('path');var timeout=require(_0xfe76('0x2'));var express=require(_0xfe76('0x3'));var router=express[_0xfe76('0x4')]();var fs_extra=require(_0xfe76('0x5'));var auth=require(_0xfe76('0x6'));var interaction=require(_0xfe76('0x7'));var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router['get']('/',auth[_0xfe76('0x8')](),controller[_0xfe76('0x9')]);router[_0xfe76('0xa')](_0xfe76('0xb'),auth[_0xfe76('0x8')](),controller[_0xfe76('0xc')]);router[_0xfe76('0xa')](_0xfe76('0xd'),auth[_0xfe76('0x8')](),controller[_0xfe76('0xe')]);router[_0xfe76('0xa')](_0xfe76('0xf'),auth[_0xfe76('0x8')](),controller[_0xfe76('0x10')]);router[_0xfe76('0xa')](_0xfe76('0x11'),auth[_0xfe76('0x8')](),controller[_0xfe76('0x12')]);router[_0xfe76('0xa')](_0xfe76('0x13'),auth[_0xfe76('0x8')](),controller['getAgents']);router['post']('/',auth[_0xfe76('0x8')](),controller[_0xfe76('0x14')]);router[_0xfe76('0x15')](_0xfe76('0x11'),auth[_0xfe76('0x8')](),controller[_0xfe76('0x16')]);router[_0xfe76('0x15')](_0xfe76('0x13'),auth[_0xfe76('0x8')](),controller[_0xfe76('0x17')]);router[_0xfe76('0x18')](_0xfe76('0xd'),auth['isAuthenticated'](),controller[_0xfe76('0x19')]);router['delete'](_0xfe76('0xd'),auth[_0xfe76('0x8')](),controller[_0xfe76('0x1a')]);router[_0xfe76('0x1b')](_0xfe76('0x11'),auth[_0xfe76('0x8')](),controller[_0xfe76('0x1c')]);router[_0xfe76('0x1b')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xfe76('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 884c131..89a2924 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 _0xb945=['roundrobin','sequelize','STRING','INTEGER','beepall'];(function(_0x1cfdcb,_0x30bb6e){var _0x2cecd1=function(_0x2bfa1e){while(--_0x2bfa1e){_0x1cfdcb['push'](_0x1cfdcb['shift']());}};_0x2cecd1(++_0x30bb6e);}(_0xb945,0x97));var _0x5b94=function(_0x2f9226,_0x51ec7c){_0x2f9226=_0x2f9226-0x0;var _0x244843=_0xb945[_0x2f9226];return _0x244843;};'use strict';var Sequelize=require(_0x5b94('0x0'));module['exports']={'name':{'type':Sequelize[_0x5b94('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x5b94('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x5b94('0x3'),_0x5b94('0x4'))},'description':{'type':Sequelize[_0x5b94('0x1')]}}; \ No newline at end of file +var _0x7868=['sequelize','STRING','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x31c796,_0x2e3c7f){var _0x128356=function(_0x35534a){while(--_0x35534a){_0x31c796['push'](_0x31c796['shift']());}};_0x128356(++_0x2e3c7f);}(_0x7868,0x1c0));var _0x8786=function(_0xd98f9d,_0x10cb93){_0xd98f9d=_0xd98f9d-0x0;var _0x41440d=_0x7868[_0xd98f9d];return _0x41440d;};'use strict';var Sequelize=require(_0x8786('0x0'));module['exports']={'name':{'type':Sequelize[_0x8786('0x1')],'unique':_0x8786('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x8786('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8786('0x4')](_0x8786('0x5'),'beepall',_0x8786('0x6'))},'description':{'type':Sequelize[_0x8786('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 0e31553..05b5def 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 _0x03c5=['../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','stack','name','send','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','map','VIRTUAL','options','include','rows','catch','show','params','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserWhatsappQueue','order','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','api'];(function(_0x1299ff,_0x132845){var _0x2d732a=function(_0x3b3d1b){while(--_0x3b3d1b){_0x1299ff['push'](_0x1299ff['shift']());}};_0x2d732a(++_0x132845);}(_0x03c5,0x76));var _0x503c=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x03c5[_0x3fba9f];return _0x192cf1;};'use strict';var emlformat=require(_0x503c('0x0'));var rimraf=require(_0x503c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x503c('0x2'));var rp=require(_0x503c('0x3'));var moment=require(_0x503c('0x4'));var BPromise=require(_0x503c('0x5'));var Mustache=require(_0x503c('0x6'));var util=require(_0x503c('0x7'));var path=require(_0x503c('0x8'));var sox=require(_0x503c('0x9'));var csv=require('to-csv');var ejs=require(_0x503c('0xa'));var fs=require('fs');var fs_extra=require(_0x503c('0xb'));var _=require('lodash');var squel=require(_0x503c('0xc'));var crypto=require(_0x503c('0xd'));var jsforce=require(_0x503c('0xe'));var deskjs=require(_0x503c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x503c('0x10'));var Redis=require(_0x503c('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x503c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x503c('0x13'));var utils=require(_0x503c('0x14'));var config=require(_0x503c('0x15'));var licenseUtil=require(_0x503c('0x16'));var db=require('../../mysqldb')['db'];config[_0x503c('0x17')]=_[_0x503c('0x18')](config[_0x503c('0x17')],{'host':_0x503c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x503c('0x17')]));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x3758bd,_0x4105ad){_0x4105ad=_0x4105ad||0xcc;return function(_0x1cbbfd){if(_0x1cbbfd){return _0x3758bd[_0x503c('0x1a')](_0x4105ad);}return _0x3758bd[_0x503c('0x1b')](_0x4105ad)[_0x503c('0x1c')]();};}function respondWithResult(_0xefe127,_0x228d36){_0x228d36=_0x228d36||0xc8;return function(_0x380958){if(_0x380958){return _0xefe127[_0x503c('0x1b')](_0x228d36)[_0x503c('0x1d')](_0x380958);}};}function respondWithFilteredResult(_0x197fca,_0x36413a){return function(_0x5dc2ca){if(_0x5dc2ca){var _0x1b6f93=typeof _0x36413a[_0x503c('0x1e')]===_0x503c('0x1f')&&typeof _0x36413a[_0x503c('0x20')]==='undefined';var _0x49b73f=_0x5dc2ca[_0x503c('0x21')];var _0x38b309=_0x1b6f93?0x0:_0x36413a['offset'];var _0xe84f0c=_0x1b6f93?_0x5dc2ca['count']:_0x36413a[_0x503c('0x1e')]+_0x36413a['limit'];var _0x5460e0;if(_0xe84f0c>=_0x49b73f){_0xe84f0c=_0x49b73f;_0x5460e0=0xc8;}else{_0x5460e0=0xce;}_0x197fca['status'](_0x5460e0);return _0x197fca['set'](_0x503c('0x22'),_0x38b309+'-'+_0xe84f0c+'/'+_0x49b73f)['json'](_0x5dc2ca);}return null;};}function patchUpdates(_0x3d7742){return function(_0x5e6b7e){try{jsonpatch['apply'](_0x5e6b7e,_0x3d7742,!![]);}catch(_0x45a129){return BPromise['reject'](_0x45a129);}return _0x5e6b7e[_0x503c('0x23')]();};}function saveUpdates(_0x10dfe4,_0xeab30b){return function(_0x5a270d){if(_0x5a270d){return _0x5a270d[_0x503c('0x24')](_0x10dfe4)[_0x503c('0x25')](function(_0x38c351){return _0x38c351;});}return null;};}function removeEntity(_0x5b2647,_0x425cde){return function(_0x1ea809){if(_0x1ea809){return _0x1ea809[_0x503c('0x26')]()[_0x503c('0x25')](function(){var _0x91a20c=_0x1ea809[_0x503c('0x27')]({'plain':!![]});var _0x5eade1=_0x503c('0x28');return db[_0x503c('0x29')][_0x503c('0x26')]({'where':{'type':_0x5eade1,'resourceId':_0x91a20c['id']}})[_0x503c('0x25')](function(){return _0x1ea809;});})[_0x503c('0x25')](function(){_0x5b2647[_0x503c('0x1b')](0xcc)[_0x503c('0x1c')]();});}};}function handleEntityNotFound(_0x211156,_0xe0a4a4){return function(_0x5e64ec){if(!_0x5e64ec){_0x211156[_0x503c('0x1a')](0x194);}return _0x5e64ec;};}function handleError(_0x46b7d4,_0x13e416){_0x13e416=_0x13e416||0x1f4;return function(_0x76f4d6){logger['error'](_0x76f4d6[_0x503c('0x2a')]);if(_0x76f4d6['name']){delete _0x76f4d6[_0x503c('0x2b')];}_0x46b7d4['status'](_0x13e416)[_0x503c('0x2c')](_0x76f4d6);};}exports['index']=function(_0x1e264d,_0x584982){var _0xdc07d3={},_0x519628={},_0x14a6e4={'count':0x0,'rows':[]};var _0x113bef=_['map'](db[_0x503c('0x2d')][_0x503c('0x2e')],function(_0x553e77){return{'name':_0x553e77[_0x503c('0x2f')],'type':_0x553e77[_0x503c('0x30')][_0x503c('0x31')]};});_0x519628[_0x503c('0x32')]=_['map'](_0x113bef,'name');_0x519628[_0x503c('0x33')]=_[_0x503c('0x34')](_0x1e264d[_0x503c('0x33')]);_0x519628['filters']=_[_0x503c('0x35')](_0x519628[_0x503c('0x32')],_0x519628['query']);_0xdc07d3[_0x503c('0x36')]=_[_0x503c('0x35')](_0x519628[_0x503c('0x32')],qs[_0x503c('0x37')](_0x1e264d[_0x503c('0x33')]['fields']));_0xdc07d3[_0x503c('0x36')]=_0xdc07d3[_0x503c('0x36')][_0x503c('0x38')]?_0xdc07d3[_0x503c('0x36')]:_0x519628['model'];if(!_0x1e264d[_0x503c('0x33')][_0x503c('0x39')](_0x503c('0x3a'))){_0xdc07d3['limit']=qs[_0x503c('0x20')](_0x1e264d[_0x503c('0x33')]['limit']);_0xdc07d3[_0x503c('0x1e')]=qs[_0x503c('0x1e')](_0x1e264d['query']['offset']);}_0xdc07d3['order']=qs[_0x503c('0x3b')](_0x1e264d['query'][_0x503c('0x3b')]);_0xdc07d3[_0x503c('0x3c')]=qs['filters'](_[_0x503c('0x3d')](_0x1e264d[_0x503c('0x33')],_0x519628[_0x503c('0x3e')]),_0x113bef);if(_0x1e264d[_0x503c('0x33')][_0x503c('0x3f')]){_0xdc07d3[_0x503c('0x3c')]=_[_0x503c('0x40')](_0xdc07d3[_0x503c('0x3c')],{'$or':_[_0x503c('0x41')](_0x113bef,function(_0x4885ea){if(_0x4885ea[_0x503c('0x30')]!==_0x503c('0x42')){var _0x5669c2={};_0x5669c2[_0x4885ea[_0x503c('0x2b')]]={'$like':'%'+_0x1e264d[_0x503c('0x33')][_0x503c('0x3f')]+'%'};return _0x5669c2;}})});}_0xdc07d3=_[_0x503c('0x40')]({},_0xdc07d3,_0x1e264d[_0x503c('0x43')]);var _0x2939f3={'where':_0xdc07d3['where']};return db[_0x503c('0x2d')][_0x503c('0x21')](_0x2939f3)['then'](function(_0x571133){_0x14a6e4[_0x503c('0x21')]=_0x571133;if(_0x1e264d[_0x503c('0x33')]['includeAll']){_0xdc07d3[_0x503c('0x44')]=[{'all':!![]}];}return db[_0x503c('0x2d')]['findAll'](_0xdc07d3);})[_0x503c('0x25')](function(_0x115427){_0x14a6e4[_0x503c('0x45')]=_0x115427;return _0x14a6e4;})[_0x503c('0x25')](respondWithFilteredResult(_0x584982,_0xdc07d3))[_0x503c('0x46')](handleError(_0x584982,null));};exports[_0x503c('0x47')]=function(_0x22e072,_0x1badfc){var _0x463690={'raw':!![],'where':{'id':_0x22e072[_0x503c('0x48')]['id']}},_0x130902={};_0x130902[_0x503c('0x32')]=_[_0x503c('0x34')](db[_0x503c('0x2d')]['rawAttributes']);_0x130902[_0x503c('0x33')]=_[_0x503c('0x34')](_0x22e072['query']);_0x130902['filters']=_['intersection'](_0x130902[_0x503c('0x32')],_0x130902[_0x503c('0x33')]);_0x463690[_0x503c('0x36')]=_[_0x503c('0x35')](_0x130902[_0x503c('0x32')],qs[_0x503c('0x37')](_0x22e072['query'][_0x503c('0x37')]));_0x463690[_0x503c('0x36')]=_0x463690[_0x503c('0x36')][_0x503c('0x38')]?_0x463690[_0x503c('0x36')]:_0x130902['model'];if(_0x22e072[_0x503c('0x33')][_0x503c('0x49')]){_0x463690[_0x503c('0x44')]=[{'all':!![]}];}_0x463690=_[_0x503c('0x40')]({},_0x463690,_0x22e072[_0x503c('0x43')]);return db[_0x503c('0x2d')]['find'](_0x463690)[_0x503c('0x25')](handleEntityNotFound(_0x1badfc,null))[_0x503c('0x25')](respondWithResult(_0x1badfc,null))[_0x503c('0x46')](handleError(_0x1badfc,null));};exports[_0x503c('0x4a')]=function(_0x5846a6,_0x46d1d3){return db[_0x503c('0x2d')][_0x503c('0x4a')](_0x5846a6[_0x503c('0x4b')],{})[_0x503c('0x25')](function(_0x218e1a){var _0x4fb29e=_0x5846a6['user'][_0x503c('0x27')]({'plain':!![]});if(!_0x4fb29e)throw new Error(_0x503c('0x4c'));if(_0x4fb29e['role']==='user'){var _0x4c7b2a=_0x218e1a[_0x503c('0x27')]({'plain':!![]});var _0x526922=_0x503c('0x28');return db[_0x503c('0x4d')][_0x503c('0x4e')]({'where':{'name':_0x526922,'userProfileId':_0x4fb29e[_0x503c('0x4f')]},'raw':!![]})[_0x503c('0x25')](function(_0x60dddb){if(_0x60dddb&&_0x60dddb['autoAssociation']===0x0){return db[_0x503c('0x29')][_0x503c('0x4a')]({'name':_0x4c7b2a[_0x503c('0x2b')],'resourceId':_0x4c7b2a['id'],'type':_0x60dddb['name'],'sectionId':_0x60dddb['id']},{})['then'](function(){return _0x218e1a;});}else{return _0x218e1a;}})[_0x503c('0x46')](function(_0x374345){logger['error'](_0x503c('0x50'),_0x374345);throw _0x374345;});}return _0x218e1a;})[_0x503c('0x25')](respondWithResult(_0x46d1d3,0xc9))['catch'](handleError(_0x46d1d3,null));};exports[_0x503c('0x24')]=function(_0x33740c,_0x70f14e){if(_0x33740c[_0x503c('0x4b')]['id']){delete _0x33740c[_0x503c('0x4b')]['id'];}return db['WhatsappQueue'][_0x503c('0x4e')]({'where':{'id':_0x33740c[_0x503c('0x48')]['id']}})['then'](handleEntityNotFound(_0x70f14e,null))['then'](saveUpdates(_0x33740c[_0x503c('0x4b')],null))[_0x503c('0x25')](respondWithResult(_0x70f14e,null))['catch'](handleError(_0x70f14e,null));};exports['destroy']=function(_0x41517a,_0x2a17c4){return db['WhatsappQueue'][_0x503c('0x4e')]({'where':{'id':_0x41517a['params']['id']}})[_0x503c('0x25')](handleEntityNotFound(_0x2a17c4,null))['then'](removeEntity(_0x2a17c4,null))[_0x503c('0x46')](handleError(_0x2a17c4,null));};exports['describe']=function(_0x5b32d2,_0x2fde16){return db['WhatsappQueue'][_0x503c('0x51')]()[_0x503c('0x25')](respondWithResult(_0x2fde16,null))[_0x503c('0x46')](handleError(_0x2fde16,null));};exports[_0x503c('0x52')]=function(_0x5e0e16,_0x414637,_0x2fc296){var _0x4d96b3={'raw':!![],'where':{}},_0x293d28={},_0x416c65;return db[_0x503c('0x2d')]['findOne']({'where':{'id':_0x5e0e16[_0x503c('0x48')]['id']}})['then'](handleEntityNotFound(_0x414637,null))[_0x503c('0x25')](function(_0x14b4e3){if(_0x14b4e3){_0x416c65=_0x14b4e3[_0x503c('0x27')]({'plain':!![]});_0x293d28['model']=_[_0x503c('0x34')](db[_0x503c('0x53')]['rawAttributes']);_0x293d28[_0x503c('0x33')]=_[_0x503c('0x34')](_0x5e0e16[_0x503c('0x33')]);_0x293d28[_0x503c('0x3e')]=_[_0x503c('0x35')](_0x293d28[_0x503c('0x32')],_0x293d28[_0x503c('0x33')]);_0x4d96b3['attributes']=_[_0x503c('0x35')](_0x293d28[_0x503c('0x32')],qs[_0x503c('0x37')](_0x5e0e16[_0x503c('0x33')][_0x503c('0x37')]));_0x4d96b3[_0x503c('0x36')]=_0x4d96b3['attributes']['length']?_0x4d96b3[_0x503c('0x36')]:_0x293d28['model'];if(!_0x5e0e16[_0x503c('0x33')]['hasOwnProperty']('nolimit')){_0x4d96b3['limit']=qs[_0x503c('0x20')](_0x5e0e16['query'][_0x503c('0x20')]);_0x4d96b3[_0x503c('0x1e')]=qs[_0x503c('0x1e')](_0x5e0e16['query'][_0x503c('0x1e')]);}_0x4d96b3[_0x503c('0x54')]=qs['sort'](_0x5e0e16['query']['sort']);_0x4d96b3[_0x503c('0x3c')]=qs['filters'](_['pick'](_0x5e0e16[_0x503c('0x33')],_0x293d28[_0x503c('0x3e')]));_0x4d96b3[_0x503c('0x3c')][_0x503c('0x55')]=_0x14b4e3['id'];if(_0x5e0e16[_0x503c('0x33')][_0x503c('0x3f')]){_0x4d96b3[_0x503c('0x3c')]=_[_0x503c('0x40')](_0x4d96b3[_0x503c('0x3c')],{'$or':_[_0x503c('0x41')](_0x4d96b3[_0x503c('0x36')],function(_0x20972b){var _0x25848c={};_0x25848c[_0x20972b]={'$like':'%'+_0x5e0e16[_0x503c('0x33')][_0x503c('0x3f')]+'%'};return _0x25848c;})});}_0x4d96b3=_[_0x503c('0x40')]({},_0x4d96b3,_0x5e0e16[_0x503c('0x43')]);return db['UserWhatsappQueue']['findAll'](_0x4d96b3);}})[_0x503c('0x25')](function(_0x5bc0ff){if(_0x5bc0ff){return db[_0x503c('0x56')][_0x503c('0x57')]({'where':{'id':_[_0x503c('0x41')](_0x5bc0ff,_0x503c('0x58')),'role':_0x503c('0x59')},'attributes':['id','name',_0x503c('0x5a'),_0x503c('0x5b'),_0x503c('0x5c')]});}})[_0x503c('0x25')](function(_0x5898c9){if(_0x5898c9){return{'count':_0x5898c9[_0x503c('0x21')],'rows':_[_0x503c('0x41')](_0x5898c9[_0x503c('0x45')],function(_0x1a946d){return{'membername':_0x1a946d['name'],'UserId':_0x1a946d['id'],'queue_name':_0x416c65['name'],'WhatsappQueueId':_0x416c65['id'],'interface':util[_0x503c('0x5d')](_0x503c('0x5e'),_0x503c('0x5f'),_0x1a946d[_0x503c('0x2b')]),'penalty':0x0,'paused':_0x1a946d[_0x503c('0x5a')],'createdAt':_0x1a946d[_0x503c('0x5c')],'updatedAt':_0x1a946d[_0x503c('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x414637,_0x4d96b3))[_0x503c('0x46')](handleError(_0x414637,null));};exports['getTeams']=function(_0x1358d6,_0xddbed0,_0x31a58a){var _0x513a4b={};var _0x5f0efa={};var _0x4126fc;var _0x227e1e;return db['WhatsappQueue']['findOne']({'where':{'id':_0x1358d6[_0x503c('0x48')]['id']}})[_0x503c('0x25')](handleEntityNotFound(_0xddbed0,null))[_0x503c('0x25')](function(_0x58d120){if(_0x58d120){_0x4126fc=_0x58d120;_0x5f0efa[_0x503c('0x32')]=_['keys'](db[_0x503c('0x60')][_0x503c('0x2e')]);_0x5f0efa[_0x503c('0x33')]=_[_0x503c('0x34')](_0x1358d6[_0x503c('0x33')]);_0x5f0efa[_0x503c('0x3e')]=_[_0x503c('0x35')](_0x5f0efa['model'],_0x5f0efa[_0x503c('0x33')]);_0x513a4b['attributes']=_[_0x503c('0x35')](_0x5f0efa[_0x503c('0x32')],qs[_0x503c('0x37')](_0x1358d6['query'][_0x503c('0x37')]));_0x513a4b[_0x503c('0x36')]=_0x513a4b[_0x503c('0x36')][_0x503c('0x38')]?_0x513a4b[_0x503c('0x36')]:_0x5f0efa[_0x503c('0x32')];_0x513a4b[_0x503c('0x54')]=qs[_0x503c('0x3b')](_0x1358d6['query']['sort']);_0x513a4b[_0x503c('0x3c')]=qs[_0x503c('0x3e')](_[_0x503c('0x3d')](_0x1358d6['query'],_0x5f0efa[_0x503c('0x3e')]));if(_0x1358d6['query'][_0x503c('0x3f')]){_0x513a4b['where']=_['merge'](_0x513a4b[_0x503c('0x3c')],{'$or':_[_0x503c('0x41')](_0x513a4b[_0x503c('0x36')],function(_0x44c42e){var _0x4a96a6={};_0x4a96a6[_0x44c42e]={'$like':'%'+_0x1358d6['query'][_0x503c('0x3f')]+'%'};return _0x4a96a6;})});}_0x513a4b=_[_0x503c('0x40')]({},_0x513a4b,_0x1358d6['options']);return _0x4126fc[_0x503c('0x61')](_0x513a4b);}})[_0x503c('0x25')](function(_0x5f5baf){if(_0x5f5baf){_0x227e1e=_0x5f5baf[_0x503c('0x38')];if(!_0x1358d6['query']['hasOwnProperty'](_0x503c('0x3a'))){_0x513a4b['limit']=qs[_0x503c('0x20')](_0x1358d6[_0x503c('0x33')][_0x503c('0x20')]);_0x513a4b[_0x503c('0x1e')]=qs[_0x503c('0x1e')](_0x1358d6[_0x503c('0x33')][_0x503c('0x1e')]);}return _0x4126fc[_0x503c('0x61')](_0x513a4b);}})[_0x503c('0x25')](function(_0x336418){if(_0x336418){return _0x336418?{'count':_0x227e1e,'rows':_0x336418}:null;}})['then'](respondWithResult(_0xddbed0,null))[_0x503c('0x46')](handleError(_0xddbed0,null));};exports[_0x503c('0x62')]=function(_0x32b21a,_0x28b155,_0x194309){var _0xdfce53=_0x32b21a['body'][_0x503c('0x63')];return db[_0x503c('0x60')][_0x503c('0x64')]({'where':{'id':_0xdfce53},'attributes':['id'],'include':[{'model':db['User'],'as':_0x503c('0x65'),'attributes':['id',_0x503c('0x2b'),_0x503c('0x66'),_0x503c('0x67'),_0x503c('0x68')],'raw':!![]}]})[_0x503c('0x25')](function(_0x1e2924){if(_0x1e2924){var _0x8c7c2=_[_0x503c('0x69')](_0x1e2924,function(_0x19899d){var _0x30de93=_0x19899d[_0x503c('0x27')]({'plain':!![]});return _0x30de93[_0x503c('0x65')];});return db['WhatsappQueue'][_0x503c('0x4e')]({'where':{'id':_0x32b21a[_0x503c('0x48')]['id']}})[_0x503c('0x25')](function(_0x2733ae){return db[_0x503c('0x6a')][_0x503c('0x6b')](function(_0x848887){return _0x2733ae['addTeams'](_0xdfce53,{'transaction':_0x848887})[_0x503c('0x25')](function(){return BPromise[_0x503c('0x6c')](_0x8c7c2,function(_0x533b38){return db[_0x503c('0x53')][_0x503c('0x6d')]({'where':{'UserId':_0x533b38['id'],'WhatsappQueueId':_0x32b21a[_0x503c('0x48')]['id']},'transaction':_0x848887});});})[_0x503c('0x25')](function(){_0x8c7c2[_0x503c('0x6e')](function(_0x37703d){socket[_0x503c('0x6f')](_0x503c('0x70'),{'UserId':_0x37703d['id'],'WhatsappQueueId':_0x2733ae['id']});});});});});}})[_0x503c('0x25')](respondWithStatusCode(_0x28b155,null))[_0x503c('0x46')](handleError(_0x28b155,null));};exports[_0x503c('0x71')]=function(_0x2b1856,_0x1578e5,_0x5d2fc5){return db[_0x503c('0x60')][_0x503c('0x64')]({'where':{'id':_0x2b1856[_0x503c('0x33')][_0x503c('0x63')]},'attributes':['id'],'include':[{'model':db[_0x503c('0x56')],'as':_0x503c('0x65'),'attributes':['id'],'raw':!![]}]})[_0x503c('0x25')](handleEntityNotFound(_0x1578e5,null))[_0x503c('0x25')](function(_0x3b5445){var _0x3d382b=_[_0x503c('0x41')](_0x3b5445,'id');var _0x932723=[];var _0x5445ad=[];var _0x57164e=squel[_0x503c('0x72')]();_0x57164e[_0x503c('0x73')](_0x503c('0x74'))[_0x503c('0x75')]('team_has_whatsapp_queues','tq')[_0x503c('0x76')](_0x503c('0x77'),'ut',_0x503c('0x78'))[_0x503c('0x3c')](_0x503c('0x79'),_0x2b1856[_0x503c('0x48')]['id']);for(var _0x533493=0x0;_0x533493<_0x3b5445[_0x503c('0x38')];_0x533493+=0x1){let _0x2f7616=_0x3b5445[_0x533493];for(var _0x19c716=0x0;_0x19c716<_0x2f7616[_0x503c('0x65')]['length'];_0x19c716+=0x1){let _0x5861be=_0x2f7616[_0x503c('0x65')][_0x19c716];var _0x528b4f=_0x57164e['clone']();_0x528b4f['where'](_0x503c('0x7a'),_0x5861be['id']);_0x5445ad[_0x503c('0x7b')](db[_0x503c('0x6a')][_0x503c('0x33')](_0x528b4f[_0x503c('0x7c')](),{'type':db[_0x503c('0x6a')][_0x503c('0x7d')][_0x503c('0x7e')]})[_0x503c('0x25')](function(_0x5d670e){if(_0x5d670e['length']===0x1){return _0x5861be['id'];}else{var _0x4acdf5=_[_0x503c('0x7f')](_[_0x503c('0x41')](_0x5d670e,'TeamId'),function(_0xc238d9){return _['includes'](_0x3d382b,_0xc238d9);});if(_0x4acdf5){return _0x5861be['id'];}}}));}}return BPromise[_0x503c('0x80')](_0x5445ad)[_0x503c('0x25')](function(_0x58b3ee){_0x932723=_(_0x932723)[_0x503c('0x81')](_0x58b3ee)['compact']()['value']();return db[_0x503c('0x2d')][_0x503c('0x4e')]({'where':{'id':_0x2b1856['params']['id']}})[_0x503c('0x25')](function(_0xd17438){return db[_0x503c('0x6a')][_0x503c('0x6b')](function(_0x3e000f){return _0xd17438[_0x503c('0x71')](_0x2b1856[_0x503c('0x33')][_0x503c('0x63')],{'transaction':_0x3e000f})[_0x503c('0x25')](function(){if(!_['isEmpty'](_0x932723)){return _0xd17438[_0x503c('0x82')](_0x932723,{'transaction':_0x3e000f});}})[_0x503c('0x25')](function(){_0x932723[_0x503c('0x6e')](function(_0x4ca847){socket[_0x503c('0x6f')](_0x503c('0x83'),{'UserId':_0x4ca847,'WhatsappQueueId':_0xd17438['id']});});});});});});})[_0x503c('0x25')](respondWithStatusCode(_0x1578e5,null))[_0x503c('0x46')](handleError(_0x1578e5,null));};exports[_0x503c('0x84')]=function(_0x2fc153,_0x59a921,_0x1b5562){return db[_0x503c('0x2d')][_0x503c('0x4e')]({'where':{'id':_0x2fc153[_0x503c('0x48')]['id']}})['then'](handleEntityNotFound(_0x59a921,null))[_0x503c('0x25')](function(_0x26ecf9){if(_0x26ecf9){return _0x26ecf9[_0x503c('0x84')](_0x2fc153[_0x503c('0x4b')]['ids'],_[_0x503c('0x85')](_0x2fc153['body'],[_0x503c('0x63'),'id'])||{})[_0x503c('0x86')](function(_0x3d4f82){for(var _0x4cb39d=0x0;_0x4cb39d<_0x2fc153['body'][_0x503c('0x63')][_0x503c('0x38')];_0x4cb39d+=0x1){socket[_0x503c('0x6f')](_0x503c('0x70'),{'UserId':Number(_0x2fc153[_0x503c('0x4b')][_0x503c('0x63')][_0x4cb39d]),'WhatsappQueueId':Number(_0x2fc153['params']['id'])});}return _0x3d4f82;});}})['then'](respondWithResult(_0x59a921,null))[_0x503c('0x46')](handleError(_0x59a921,null));};exports[_0x503c('0x82')]=function(_0x2366e1,_0x214e3e,_0x323c20){return db[_0x503c('0x2d')][_0x503c('0x4e')]({'where':{'id':_0x2366e1[_0x503c('0x48')]['id']}})[_0x503c('0x25')](handleEntityNotFound(_0x214e3e,null))[_0x503c('0x25')](function(_0x47a23e){if(_0x47a23e){return _0x47a23e[_0x503c('0x82')](_0x2366e1[_0x503c('0x33')][_0x503c('0x63')])['then'](function(){if(_[_0x503c('0x87')](_0x2366e1[_0x503c('0x33')][_0x503c('0x63')])){for(var _0x9ea1df=0x0;_0x9ea1df<_0x2366e1[_0x503c('0x33')][_0x503c('0x63')][_0x503c('0x38')];_0x9ea1df+=0x1){socket[_0x503c('0x6f')](_0x503c('0x83'),{'UserId':Number(_0x2366e1[_0x503c('0x33')][_0x503c('0x63')][_0x9ea1df]),'WhatsappQueueId':Number(_0x2366e1['params']['id'])});}}else{socket[_0x503c('0x6f')](_0x503c('0x83'),{'UserId':Number(_0x2366e1[_0x503c('0x33')][_0x503c('0x63')]),'WhatsappQueueId':Number(_0x2366e1[_0x503c('0x48')]['id'])});}});}})[_0x503c('0x25')](respondWithStatusCode(_0x214e3e,null))[_0x503c('0x46')](handleError(_0x214e3e,null));};exports[_0x503c('0x88')]=function(_0x5d2683,_0x225c48,_0x59acab){var _0x4a8db1={};var _0x45de2d={};var _0x15a484;var _0x289d13;return db[_0x503c('0x2d')][_0x503c('0x89')]({'where':{'id':_0x5d2683[_0x503c('0x48')]['id']}})['then'](handleEntityNotFound(_0x225c48,null))[_0x503c('0x25')](function(_0x1181ee){if(_0x1181ee){_0x15a484=_0x1181ee;_0x45de2d[_0x503c('0x32')]=_[_0x503c('0x34')](db[_0x503c('0x56')]['rawAttributes']);_0x45de2d[_0x503c('0x33')]=_[_0x503c('0x34')](_0x5d2683[_0x503c('0x33')]);_0x45de2d[_0x503c('0x3e')]=_[_0x503c('0x35')](_0x45de2d[_0x503c('0x32')],_0x45de2d[_0x503c('0x33')]);_0x4a8db1[_0x503c('0x36')]=_['intersection'](_0x45de2d[_0x503c('0x32')],qs[_0x503c('0x37')](_0x5d2683[_0x503c('0x33')]['fields']));_0x4a8db1['attributes']=_0x4a8db1['attributes'][_0x503c('0x38')]?_0x4a8db1[_0x503c('0x36')]:_0x45de2d[_0x503c('0x32')];_0x4a8db1[_0x503c('0x54')]=qs[_0x503c('0x3b')](_0x5d2683[_0x503c('0x33')][_0x503c('0x3b')]);_0x4a8db1[_0x503c('0x3c')]=qs[_0x503c('0x3e')](_[_0x503c('0x3d')](_0x5d2683[_0x503c('0x33')],_0x45de2d[_0x503c('0x3e')]));if(_0x5d2683[_0x503c('0x33')][_0x503c('0x3f')]){_0x4a8db1[_0x503c('0x3c')]=_['merge'](_0x4a8db1[_0x503c('0x3c')],{'$or':_[_0x503c('0x41')](_0x4a8db1[_0x503c('0x36')],function(_0x1f12d0){var _0x3c659d={};_0x3c659d[_0x1f12d0]={'$like':'%'+_0x5d2683[_0x503c('0x33')][_0x503c('0x3f')]+'%'};return _0x3c659d;})});}_0x4a8db1=_[_0x503c('0x40')]({},_0x4a8db1,_0x5d2683['options']);return _0x15a484[_0x503c('0x88')](_0x4a8db1);}})[_0x503c('0x25')](function(_0x14cc17){if(_0x14cc17){_0x289d13=_0x14cc17[_0x503c('0x38')];if(!_0x5d2683['query']['hasOwnProperty']('nolimit')){_0x4a8db1[_0x503c('0x20')]=qs[_0x503c('0x20')](_0x5d2683['query']['limit']);_0x4a8db1['offset']=qs[_0x503c('0x1e')](_0x5d2683[_0x503c('0x33')][_0x503c('0x1e')]);}return _0x15a484[_0x503c('0x88')](_0x4a8db1);}})[_0x503c('0x25')](function(_0x27e096){if(_0x27e096){return _0x27e096?{'count':_0x289d13,'rows':_0x27e096}:null;}})['then'](respondWithResult(_0x225c48,null))[_0x503c('0x46')](handleError(_0x225c48,null));}; \ No newline at end of file +var _0x1ab3=['UserWhatsappQueue','findOrCreate','emit','userWhatsappQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_whatsapp_queues','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','forEach','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','rimraf','zip-dir','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','sendStatus','end','status','json','limit','undefined','count','offset','Content-Range','apply','save','then','get','UserProfileResource','destroy','error','name','send','map','WhatsappQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappQueues','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','rawAttributes','nolimit','WhatsappQueueId','findAndCountAll','UserId','agent','whatsappPause','updatedAt','SIP','createdAt','findOne','getTeams','addTeams','Team','User','Agents','online','voicePause','sequelize','transaction','each'];(function(_0x5be290,_0x583450){var _0x542d5a=function(_0x2c14ef){while(--_0x2c14ef){_0x5be290['push'](_0x5be290['shift']());}};_0x542d5a(++_0x583450);}(_0x1ab3,0xad));var _0x31ab=function(_0x27b6a5,_0x1b148d){_0x27b6a5=_0x27b6a5-0x0;var _0x25d174=_0x1ab3[_0x27b6a5];return _0x25d174;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x31ab('0x0'));var zipdir=require(_0x31ab('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x31ab('0x2'));var util=require(_0x31ab('0x3'));var path=require(_0x31ab('0x4'));var sox=require('sox');var csv=require(_0x31ab('0x5'));var ejs=require(_0x31ab('0x6'));var fs=require('fs');var fs_extra=require(_0x31ab('0x7'));var _=require(_0x31ab('0x8'));var squel=require(_0x31ab('0x9'));var crypto=require(_0x31ab('0xa'));var jsforce=require(_0x31ab('0xb'));var deskjs=require(_0x31ab('0xc'));var toCsv=require('to-csv');var querystring=require(_0x31ab('0xd'));var Papa=require(_0x31ab('0xe'));var Redis=require(_0x31ab('0xf'));var authService=require(_0x31ab('0x10'));var qs=require(_0x31ab('0x11'));var as=require(_0x31ab('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x31ab('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x31ab('0x14'));var db=require(_0x31ab('0x15'))['db'];config[_0x31ab('0x16')]=_[_0x31ab('0x17')](config[_0x31ab('0x16')],{'host':_0x31ab('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x31ab('0x16')]));require(_0x31ab('0x19'))['register'](socket);function respondWithStatusCode(_0x142b3a,_0x1b8dc3){_0x1b8dc3=_0x1b8dc3||0xcc;return function(_0x374391){if(_0x374391){return _0x142b3a[_0x31ab('0x1a')](_0x1b8dc3);}return _0x142b3a['status'](_0x1b8dc3)[_0x31ab('0x1b')]();};}function respondWithResult(_0x460896,_0x45de43){_0x45de43=_0x45de43||0xc8;return function(_0xec54bd){if(_0xec54bd){return _0x460896[_0x31ab('0x1c')](_0x45de43)[_0x31ab('0x1d')](_0xec54bd);}};}function respondWithFilteredResult(_0x4801b3,_0x3a436d){return function(_0x8260a6){if(_0x8260a6){var _0x4e8adc=typeof _0x3a436d['offset']==='undefined'&&typeof _0x3a436d[_0x31ab('0x1e')]===_0x31ab('0x1f');var _0x452e68=_0x8260a6['count'];var _0x4623fb=_0x4e8adc?0x0:_0x3a436d['offset'];var _0xbf401f=_0x4e8adc?_0x8260a6[_0x31ab('0x20')]:_0x3a436d[_0x31ab('0x21')]+_0x3a436d[_0x31ab('0x1e')];var _0x5e0069;if(_0xbf401f>=_0x452e68){_0xbf401f=_0x452e68;_0x5e0069=0xc8;}else{_0x5e0069=0xce;}_0x4801b3[_0x31ab('0x1c')](_0x5e0069);return _0x4801b3['set'](_0x31ab('0x22'),_0x4623fb+'-'+_0xbf401f+'/'+_0x452e68)['json'](_0x8260a6);}return null;};}function patchUpdates(_0x384291){return function(_0x51f175){try{jsonpatch[_0x31ab('0x23')](_0x51f175,_0x384291,!![]);}catch(_0x3495ed){return BPromise['reject'](_0x3495ed);}return _0x51f175[_0x31ab('0x24')]();};}function saveUpdates(_0x2078e4,_0x513a07){return function(_0x4af7dd){if(_0x4af7dd){return _0x4af7dd['update'](_0x2078e4)[_0x31ab('0x25')](function(_0x3ca4b3){return _0x3ca4b3;});}return null;};}function removeEntity(_0x417ec0,_0x3b5ba9){return function(_0x1f72d2){if(_0x1f72d2){return _0x1f72d2['destroy']()[_0x31ab('0x25')](function(){var _0x245e08=_0x1f72d2[_0x31ab('0x26')]({'plain':!![]});var _0x306e76='WhatsappQueues';return db[_0x31ab('0x27')][_0x31ab('0x28')]({'where':{'type':_0x306e76,'resourceId':_0x245e08['id']}})[_0x31ab('0x25')](function(){return _0x1f72d2;});})[_0x31ab('0x25')](function(){_0x417ec0[_0x31ab('0x1c')](0xcc)[_0x31ab('0x1b')]();});}};}function handleEntityNotFound(_0xd54628,_0x10907d){return function(_0x3802db){if(!_0x3802db){_0xd54628['sendStatus'](0x194);}return _0x3802db;};}function handleError(_0x1f5f5f,_0x1cd9ab){_0x1cd9ab=_0x1cd9ab||0x1f4;return function(_0x29bbe9){logger[_0x31ab('0x29')](_0x29bbe9['stack']);if(_0x29bbe9[_0x31ab('0x2a')]){delete _0x29bbe9[_0x31ab('0x2a')];}_0x1f5f5f[_0x31ab('0x1c')](_0x1cd9ab)[_0x31ab('0x2b')](_0x29bbe9);};}exports['index']=function(_0x180d3f,_0x5a4448){var _0x2d81f7={},_0x49a842={},_0x5d3af5={'count':0x0,'rows':[]};var _0x185892=_[_0x31ab('0x2c')](db[_0x31ab('0x2d')]['rawAttributes'],function(_0x562b79){return{'name':_0x562b79[_0x31ab('0x2e')],'type':_0x562b79[_0x31ab('0x2f')][_0x31ab('0x30')]};});_0x49a842[_0x31ab('0x31')]=_[_0x31ab('0x2c')](_0x185892,_0x31ab('0x2a'));_0x49a842[_0x31ab('0x32')]=_[_0x31ab('0x33')](_0x180d3f[_0x31ab('0x32')]);_0x49a842[_0x31ab('0x34')]=_[_0x31ab('0x35')](_0x49a842[_0x31ab('0x31')],_0x49a842[_0x31ab('0x32')]);_0x2d81f7[_0x31ab('0x36')]=_[_0x31ab('0x35')](_0x49a842[_0x31ab('0x31')],qs[_0x31ab('0x37')](_0x180d3f[_0x31ab('0x32')][_0x31ab('0x37')]));_0x2d81f7['attributes']=_0x2d81f7[_0x31ab('0x36')]['length']?_0x2d81f7[_0x31ab('0x36')]:_0x49a842[_0x31ab('0x31')];if(!_0x180d3f[_0x31ab('0x32')][_0x31ab('0x38')]('nolimit')){_0x2d81f7[_0x31ab('0x1e')]=qs[_0x31ab('0x1e')](_0x180d3f[_0x31ab('0x32')][_0x31ab('0x1e')]);_0x2d81f7['offset']=qs[_0x31ab('0x21')](_0x180d3f['query'][_0x31ab('0x21')]);}_0x2d81f7[_0x31ab('0x39')]=qs['sort'](_0x180d3f[_0x31ab('0x32')][_0x31ab('0x3a')]);_0x2d81f7['where']=qs[_0x31ab('0x34')](_[_0x31ab('0x3b')](_0x180d3f[_0x31ab('0x32')],_0x49a842[_0x31ab('0x34')]),_0x185892);if(_0x180d3f[_0x31ab('0x32')][_0x31ab('0x3c')]){_0x2d81f7[_0x31ab('0x3d')]=_[_0x31ab('0x3e')](_0x2d81f7[_0x31ab('0x3d')],{'$or':_['map'](_0x185892,function(_0x22f5aa){if(_0x22f5aa[_0x31ab('0x2f')]!==_0x31ab('0x3f')){var _0x348fff={};_0x348fff[_0x22f5aa['name']]={'$like':'%'+_0x180d3f[_0x31ab('0x32')][_0x31ab('0x3c')]+'%'};return _0x348fff;}})});}_0x2d81f7=_[_0x31ab('0x3e')]({},_0x2d81f7,_0x180d3f[_0x31ab('0x40')]);var _0x4eff25={'where':_0x2d81f7[_0x31ab('0x3d')]};return db[_0x31ab('0x2d')]['count'](_0x4eff25)['then'](function(_0x2dfafe){_0x5d3af5[_0x31ab('0x20')]=_0x2dfafe;if(_0x180d3f[_0x31ab('0x32')][_0x31ab('0x41')]){_0x2d81f7['include']=[{'all':!![]}];}return db[_0x31ab('0x2d')][_0x31ab('0x42')](_0x2d81f7);})[_0x31ab('0x25')](function(_0x4dcd1){_0x5d3af5[_0x31ab('0x43')]=_0x4dcd1;return _0x5d3af5;})['then'](respondWithFilteredResult(_0x5a4448,_0x2d81f7))[_0x31ab('0x44')](handleError(_0x5a4448,null));};exports[_0x31ab('0x45')]=function(_0x316a9e,_0x5ef2d4){var _0x408930={'raw':!![],'where':{'id':_0x316a9e[_0x31ab('0x46')]['id']}},_0x3c592e={};_0x3c592e[_0x31ab('0x31')]=_[_0x31ab('0x33')](db[_0x31ab('0x2d')]['rawAttributes']);_0x3c592e[_0x31ab('0x32')]=_[_0x31ab('0x33')](_0x316a9e[_0x31ab('0x32')]);_0x3c592e[_0x31ab('0x34')]=_['intersection'](_0x3c592e[_0x31ab('0x31')],_0x3c592e[_0x31ab('0x32')]);_0x408930[_0x31ab('0x36')]=_[_0x31ab('0x35')](_0x3c592e[_0x31ab('0x31')],qs['fields'](_0x316a9e[_0x31ab('0x32')][_0x31ab('0x37')]));_0x408930[_0x31ab('0x36')]=_0x408930['attributes'][_0x31ab('0x47')]?_0x408930[_0x31ab('0x36')]:_0x3c592e[_0x31ab('0x31')];if(_0x316a9e[_0x31ab('0x32')]['includeAll']){_0x408930[_0x31ab('0x48')]=[{'all':!![]}];}_0x408930=_[_0x31ab('0x3e')]({},_0x408930,_0x316a9e[_0x31ab('0x40')]);return db[_0x31ab('0x2d')][_0x31ab('0x49')](_0x408930)[_0x31ab('0x25')](handleEntityNotFound(_0x5ef2d4,null))['then'](respondWithResult(_0x5ef2d4,null))['catch'](handleError(_0x5ef2d4,null));};exports[_0x31ab('0x4a')]=function(_0x20a516,_0x5ccec5){return db['WhatsappQueue'][_0x31ab('0x4a')](_0x20a516[_0x31ab('0x4b')],{})[_0x31ab('0x25')](function(_0x51e7e2){var _0x48e7cd=_0x20a516[_0x31ab('0x4c')][_0x31ab('0x26')]({'plain':!![]});if(!_0x48e7cd)throw new Error(_0x31ab('0x4d'));if(_0x48e7cd[_0x31ab('0x4e')]===_0x31ab('0x4c')){var _0xbe94fd=_0x51e7e2[_0x31ab('0x26')]({'plain':!![]});var _0x2e29e8=_0x31ab('0x4f');return db[_0x31ab('0x50')][_0x31ab('0x49')]({'where':{'name':_0x2e29e8,'userProfileId':_0x48e7cd['userProfileId']},'raw':!![]})[_0x31ab('0x25')](function(_0x4e39a4){if(_0x4e39a4&&_0x4e39a4[_0x31ab('0x51')]===0x0){return db[_0x31ab('0x27')][_0x31ab('0x4a')]({'name':_0xbe94fd[_0x31ab('0x2a')],'resourceId':_0xbe94fd['id'],'type':_0x4e39a4['name'],'sectionId':_0x4e39a4['id']},{})[_0x31ab('0x25')](function(){return _0x51e7e2;});}else{return _0x51e7e2;}})[_0x31ab('0x44')](function(_0x447caa){logger['error'](_0x31ab('0x52'),_0x447caa);throw _0x447caa;});}return _0x51e7e2;})[_0x31ab('0x25')](respondWithResult(_0x5ccec5,0xc9))['catch'](handleError(_0x5ccec5,null));};exports[_0x31ab('0x53')]=function(_0xf572aa,_0x1846cf){if(_0xf572aa[_0x31ab('0x4b')]['id']){delete _0xf572aa[_0x31ab('0x4b')]['id'];}return db[_0x31ab('0x2d')][_0x31ab('0x49')]({'where':{'id':_0xf572aa[_0x31ab('0x46')]['id']}})[_0x31ab('0x25')](handleEntityNotFound(_0x1846cf,null))[_0x31ab('0x25')](saveUpdates(_0xf572aa[_0x31ab('0x4b')],null))['then'](respondWithResult(_0x1846cf,null))['catch'](handleError(_0x1846cf,null));};exports['destroy']=function(_0x2ed35a,_0x4fd44b){return db[_0x31ab('0x2d')][_0x31ab('0x49')]({'where':{'id':_0x2ed35a[_0x31ab('0x46')]['id']}})[_0x31ab('0x25')](handleEntityNotFound(_0x4fd44b,null))[_0x31ab('0x25')](removeEntity(_0x4fd44b,null))[_0x31ab('0x44')](handleError(_0x4fd44b,null));};exports[_0x31ab('0x54')]=function(_0x5d2a44,_0x507cee){return db[_0x31ab('0x2d')][_0x31ab('0x54')]()[_0x31ab('0x25')](respondWithResult(_0x507cee,null))[_0x31ab('0x44')](handleError(_0x507cee,null));};exports[_0x31ab('0x55')]=function(_0x47968d,_0x5ef177,_0x20f8e4){var _0x5b225d={'raw':!![],'where':{}},_0x272a84={},_0x5335b1;return db['WhatsappQueue']['findOne']({'where':{'id':_0x47968d[_0x31ab('0x46')]['id']}})[_0x31ab('0x25')](handleEntityNotFound(_0x5ef177,null))[_0x31ab('0x25')](function(_0x362150){if(_0x362150){_0x5335b1=_0x362150['get']({'plain':!![]});_0x272a84[_0x31ab('0x31')]=_[_0x31ab('0x33')](db['UserWhatsappQueue'][_0x31ab('0x56')]);_0x272a84['query']=_[_0x31ab('0x33')](_0x47968d['query']);_0x272a84[_0x31ab('0x34')]=_[_0x31ab('0x35')](_0x272a84[_0x31ab('0x31')],_0x272a84[_0x31ab('0x32')]);_0x5b225d[_0x31ab('0x36')]=_[_0x31ab('0x35')](_0x272a84[_0x31ab('0x31')],qs[_0x31ab('0x37')](_0x47968d[_0x31ab('0x32')][_0x31ab('0x37')]));_0x5b225d[_0x31ab('0x36')]=_0x5b225d[_0x31ab('0x36')][_0x31ab('0x47')]?_0x5b225d[_0x31ab('0x36')]:_0x272a84[_0x31ab('0x31')];if(!_0x47968d[_0x31ab('0x32')][_0x31ab('0x38')](_0x31ab('0x57'))){_0x5b225d[_0x31ab('0x1e')]=qs[_0x31ab('0x1e')](_0x47968d[_0x31ab('0x32')][_0x31ab('0x1e')]);_0x5b225d['offset']=qs['offset'](_0x47968d[_0x31ab('0x32')][_0x31ab('0x21')]);}_0x5b225d[_0x31ab('0x39')]=qs['sort'](_0x47968d[_0x31ab('0x32')][_0x31ab('0x3a')]);_0x5b225d['where']=qs[_0x31ab('0x34')](_[_0x31ab('0x3b')](_0x47968d['query'],_0x272a84['filters']));_0x5b225d['where'][_0x31ab('0x58')]=_0x362150['id'];if(_0x47968d[_0x31ab('0x32')]['filter']){_0x5b225d[_0x31ab('0x3d')]=_['merge'](_0x5b225d[_0x31ab('0x3d')],{'$or':_['map'](_0x5b225d[_0x31ab('0x36')],function(_0x2184f6){var _0x54247c={};_0x54247c[_0x2184f6]={'$like':'%'+_0x47968d[_0x31ab('0x32')][_0x31ab('0x3c')]+'%'};return _0x54247c;})});}_0x5b225d=_['merge']({},_0x5b225d,_0x47968d[_0x31ab('0x40')]);return db['UserWhatsappQueue'][_0x31ab('0x42')](_0x5b225d);}})[_0x31ab('0x25')](function(_0x43522d){if(_0x43522d){return db['User'][_0x31ab('0x59')]({'where':{'id':_['map'](_0x43522d,_0x31ab('0x5a')),'role':_0x31ab('0x5b')},'attributes':['id',_0x31ab('0x2a'),_0x31ab('0x5c'),_0x31ab('0x5d'),'createdAt']});}})[_0x31ab('0x25')](function(_0x5afd38){if(_0x5afd38){return{'count':_0x5afd38['count'],'rows':_[_0x31ab('0x2c')](_0x5afd38[_0x31ab('0x43')],function(_0x310f52){return{'membername':_0x310f52['name'],'UserId':_0x310f52['id'],'queue_name':_0x5335b1[_0x31ab('0x2a')],'WhatsappQueueId':_0x5335b1['id'],'interface':util['format']('%s/%s',_0x31ab('0x5e'),_0x310f52[_0x31ab('0x2a')]),'penalty':0x0,'paused':_0x310f52['whatsappPause'],'createdAt':_0x310f52[_0x31ab('0x5f')],'updatedAt':_0x310f52[_0x31ab('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x31ab('0x25')](respondWithFilteredResult(_0x5ef177,_0x5b225d))[_0x31ab('0x44')](handleError(_0x5ef177,null));};exports['getTeams']=function(_0x3f1f92,_0x3fd654,_0x335bbc){var _0x163b61={};var _0x5c0a81={};var _0xb8c67c;var _0x44bf93;return db[_0x31ab('0x2d')][_0x31ab('0x60')]({'where':{'id':_0x3f1f92[_0x31ab('0x46')]['id']}})['then'](handleEntityNotFound(_0x3fd654,null))['then'](function(_0x5f58aa){if(_0x5f58aa){_0xb8c67c=_0x5f58aa;_0x5c0a81[_0x31ab('0x31')]=_['keys'](db['Team'][_0x31ab('0x56')]);_0x5c0a81[_0x31ab('0x32')]=_[_0x31ab('0x33')](_0x3f1f92[_0x31ab('0x32')]);_0x5c0a81[_0x31ab('0x34')]=_['intersection'](_0x5c0a81['model'],_0x5c0a81['query']);_0x163b61['attributes']=_[_0x31ab('0x35')](_0x5c0a81[_0x31ab('0x31')],qs[_0x31ab('0x37')](_0x3f1f92[_0x31ab('0x32')][_0x31ab('0x37')]));_0x163b61[_0x31ab('0x36')]=_0x163b61[_0x31ab('0x36')][_0x31ab('0x47')]?_0x163b61[_0x31ab('0x36')]:_0x5c0a81['model'];_0x163b61[_0x31ab('0x39')]=qs[_0x31ab('0x3a')](_0x3f1f92['query'][_0x31ab('0x3a')]);_0x163b61[_0x31ab('0x3d')]=qs[_0x31ab('0x34')](_['pick'](_0x3f1f92[_0x31ab('0x32')],_0x5c0a81[_0x31ab('0x34')]));if(_0x3f1f92[_0x31ab('0x32')][_0x31ab('0x3c')]){_0x163b61[_0x31ab('0x3d')]=_[_0x31ab('0x3e')](_0x163b61['where'],{'$or':_[_0x31ab('0x2c')](_0x163b61[_0x31ab('0x36')],function(_0x4f25c7){var _0x4a6dba={};_0x4a6dba[_0x4f25c7]={'$like':'%'+_0x3f1f92[_0x31ab('0x32')][_0x31ab('0x3c')]+'%'};return _0x4a6dba;})});}_0x163b61=_[_0x31ab('0x3e')]({},_0x163b61,_0x3f1f92['options']);return _0xb8c67c[_0x31ab('0x61')](_0x163b61);}})['then'](function(_0x199385){if(_0x199385){_0x44bf93=_0x199385[_0x31ab('0x47')];if(!_0x3f1f92['query']['hasOwnProperty'](_0x31ab('0x57'))){_0x163b61['limit']=qs[_0x31ab('0x1e')](_0x3f1f92[_0x31ab('0x32')][_0x31ab('0x1e')]);_0x163b61[_0x31ab('0x21')]=qs[_0x31ab('0x21')](_0x3f1f92[_0x31ab('0x32')][_0x31ab('0x21')]);}return _0xb8c67c['getTeams'](_0x163b61);}})[_0x31ab('0x25')](function(_0x4b70d1){if(_0x4b70d1){return _0x4b70d1?{'count':_0x44bf93,'rows':_0x4b70d1}:null;}})[_0x31ab('0x25')](respondWithResult(_0x3fd654,null))[_0x31ab('0x44')](handleError(_0x3fd654,null));};exports[_0x31ab('0x62')]=function(_0x531ea9,_0x3b1aae,_0x1bcad2){var _0x55a4bf=_0x531ea9[_0x31ab('0x4b')]['ids'];return db[_0x31ab('0x63')][_0x31ab('0x42')]({'where':{'id':_0x55a4bf},'attributes':['id'],'include':[{'model':db[_0x31ab('0x64')],'as':_0x31ab('0x65'),'attributes':['id',_0x31ab('0x2a'),_0x31ab('0x66'),_0x31ab('0x67'),'interface'],'raw':!![]}]})[_0x31ab('0x25')](function(_0x11ad5c){if(_0x11ad5c){var _0x3eb90c=_['flatMap'](_0x11ad5c,function(_0x5711c0){var _0x4f29a7=_0x5711c0[_0x31ab('0x26')]({'plain':!![]});return _0x4f29a7[_0x31ab('0x65')];});return db[_0x31ab('0x2d')][_0x31ab('0x49')]({'where':{'id':_0x531ea9[_0x31ab('0x46')]['id']}})['then'](function(_0x51bdfb){return db[_0x31ab('0x68')][_0x31ab('0x69')](function(_0x1ee7ca){return _0x51bdfb[_0x31ab('0x62')](_0x55a4bf,{'transaction':_0x1ee7ca})['then'](function(){return BPromise[_0x31ab('0x6a')](_0x3eb90c,function(_0x2de647){return db[_0x31ab('0x6b')][_0x31ab('0x6c')]({'where':{'UserId':_0x2de647['id'],'WhatsappQueueId':_0x531ea9[_0x31ab('0x46')]['id']},'transaction':_0x1ee7ca});});})['then'](function(){_0x3eb90c['forEach'](function(_0x2096c7){socket[_0x31ab('0x6d')](_0x31ab('0x6e'),{'UserId':_0x2096c7['id'],'WhatsappQueueId':_0x51bdfb['id']});});});});});}})[_0x31ab('0x25')](respondWithStatusCode(_0x3b1aae,null))[_0x31ab('0x44')](handleError(_0x3b1aae,null));};exports[_0x31ab('0x6f')]=function(_0x1613c5,_0x452baa,_0x20ad91){return db[_0x31ab('0x63')][_0x31ab('0x42')]({'where':{'id':_0x1613c5['query'][_0x31ab('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x452baa,null))['then'](function(_0x18ddbe){var _0x458ac7=_[_0x31ab('0x2c')](_0x18ddbe,'id');var _0x5911fa=[];var _0xfa0468=[];var _0x1bdd11=squel[_0x31ab('0x71')]();_0x1bdd11[_0x31ab('0x72')](_0x31ab('0x73'))[_0x31ab('0x74')](_0x31ab('0x75'),'tq')['join']('user_has_teams','ut',_0x31ab('0x76'))[_0x31ab('0x3d')](_0x31ab('0x77'),_0x1613c5[_0x31ab('0x46')]['id']);for(var _0x53b742=0x0;_0x53b742<_0x18ddbe[_0x31ab('0x47')];_0x53b742+=0x1){let _0x803446=_0x18ddbe[_0x53b742];for(var _0x356e44=0x0;_0x356e44<_0x803446['Agents'][_0x31ab('0x47')];_0x356e44+=0x1){let _0x18a9af=_0x803446['Agents'][_0x356e44];var _0x47ece2=_0x1bdd11[_0x31ab('0x78')]();_0x47ece2[_0x31ab('0x3d')]('ut.UserId\x20=\x20?',_0x18a9af['id']);_0xfa0468[_0x31ab('0x79')](db[_0x31ab('0x68')][_0x31ab('0x32')](_0x47ece2['toString'](),{'type':db[_0x31ab('0x68')][_0x31ab('0x7a')][_0x31ab('0x7b')]})['then'](function(_0x281581){if(_0x281581['length']===0x1){return _0x18a9af['id'];}else{var _0xcff296=_[_0x31ab('0x7c')](_[_0x31ab('0x2c')](_0x281581,_0x31ab('0x7d')),function(_0x17682c){return _[_0x31ab('0x7e')](_0x458ac7,_0x17682c);});if(_0xcff296){return _0x18a9af['id'];}}}));}}return BPromise[_0x31ab('0x7f')](_0xfa0468)[_0x31ab('0x25')](function(_0x4e9341){_0x5911fa=_(_0x5911fa)[_0x31ab('0x80')](_0x4e9341)[_0x31ab('0x81')]()[_0x31ab('0x82')]();return db[_0x31ab('0x2d')][_0x31ab('0x49')]({'where':{'id':_0x1613c5['params']['id']}})['then'](function(_0x4898d7){return db[_0x31ab('0x68')][_0x31ab('0x69')](function(_0x2c4bf6){return _0x4898d7[_0x31ab('0x6f')](_0x1613c5[_0x31ab('0x32')][_0x31ab('0x70')],{'transaction':_0x2c4bf6})[_0x31ab('0x25')](function(){if(!_[_0x31ab('0x83')](_0x5911fa)){return _0x4898d7['removeAgents'](_0x5911fa,{'transaction':_0x2c4bf6});}})[_0x31ab('0x25')](function(){_0x5911fa[_0x31ab('0x84')](function(_0xce6dd){socket[_0x31ab('0x6d')](_0x31ab('0x85'),{'UserId':_0xce6dd,'WhatsappQueueId':_0x4898d7['id']});});});});});});})[_0x31ab('0x25')](respondWithStatusCode(_0x452baa,null))[_0x31ab('0x44')](handleError(_0x452baa,null));};exports[_0x31ab('0x86')]=function(_0x1d1672,_0x308f52,_0x4c14b8){return db[_0x31ab('0x2d')]['find']({'where':{'id':_0x1d1672[_0x31ab('0x46')]['id']}})[_0x31ab('0x25')](handleEntityNotFound(_0x308f52,null))[_0x31ab('0x25')](function(_0xf83185){if(_0xf83185){return _0xf83185[_0x31ab('0x86')](_0x1d1672[_0x31ab('0x4b')][_0x31ab('0x70')],_[_0x31ab('0x87')](_0x1d1672['body'],[_0x31ab('0x70'),'id'])||{})[_0x31ab('0x88')](function(_0x343aba){for(var _0x347485=0x0;_0x347485<_0x1d1672[_0x31ab('0x4b')][_0x31ab('0x70')][_0x31ab('0x47')];_0x347485+=0x1){socket[_0x31ab('0x6d')](_0x31ab('0x6e'),{'UserId':Number(_0x1d1672[_0x31ab('0x4b')][_0x31ab('0x70')][_0x347485]),'WhatsappQueueId':Number(_0x1d1672[_0x31ab('0x46')]['id'])});}return _0x343aba;});}})['then'](respondWithResult(_0x308f52,null))[_0x31ab('0x44')](handleError(_0x308f52,null));};exports['removeAgents']=function(_0x40b601,_0x127360,_0x320875){return db[_0x31ab('0x2d')][_0x31ab('0x49')]({'where':{'id':_0x40b601[_0x31ab('0x46')]['id']}})[_0x31ab('0x25')](handleEntityNotFound(_0x127360,null))['then'](function(_0x2f06e0){if(_0x2f06e0){return _0x2f06e0[_0x31ab('0x89')](_0x40b601[_0x31ab('0x32')][_0x31ab('0x70')])[_0x31ab('0x25')](function(){if(_[_0x31ab('0x8a')](_0x40b601[_0x31ab('0x32')][_0x31ab('0x70')])){for(var _0x16ca20=0x0;_0x16ca20<_0x40b601['query']['ids'][_0x31ab('0x47')];_0x16ca20+=0x1){socket[_0x31ab('0x6d')]('userWhatsappQueue:remove',{'UserId':Number(_0x40b601['query'][_0x31ab('0x70')][_0x16ca20]),'WhatsappQueueId':Number(_0x40b601[_0x31ab('0x46')]['id'])});}}else{socket[_0x31ab('0x6d')]('userWhatsappQueue:remove',{'UserId':Number(_0x40b601[_0x31ab('0x32')]['ids']),'WhatsappQueueId':Number(_0x40b601[_0x31ab('0x46')]['id'])});}});}})[_0x31ab('0x25')](respondWithStatusCode(_0x127360,null))['catch'](handleError(_0x127360,null));};exports['getAgents']=function(_0x1ec80a,_0x36cd02,_0x5c1269){var _0x8eb921={};var _0x23fcac={};var _0x5edfaa;var _0x405624;return db['WhatsappQueue'][_0x31ab('0x60')]({'where':{'id':_0x1ec80a[_0x31ab('0x46')]['id']}})[_0x31ab('0x25')](handleEntityNotFound(_0x36cd02,null))[_0x31ab('0x25')](function(_0x206f72){if(_0x206f72){_0x5edfaa=_0x206f72;_0x23fcac[_0x31ab('0x31')]=_['keys'](db['User'][_0x31ab('0x56')]);_0x23fcac[_0x31ab('0x32')]=_[_0x31ab('0x33')](_0x1ec80a[_0x31ab('0x32')]);_0x23fcac[_0x31ab('0x34')]=_[_0x31ab('0x35')](_0x23fcac[_0x31ab('0x31')],_0x23fcac['query']);_0x8eb921['attributes']=_['intersection'](_0x23fcac[_0x31ab('0x31')],qs[_0x31ab('0x37')](_0x1ec80a['query']['fields']));_0x8eb921[_0x31ab('0x36')]=_0x8eb921[_0x31ab('0x36')][_0x31ab('0x47')]?_0x8eb921['attributes']:_0x23fcac[_0x31ab('0x31')];_0x8eb921[_0x31ab('0x39')]=qs['sort'](_0x1ec80a[_0x31ab('0x32')]['sort']);_0x8eb921[_0x31ab('0x3d')]=qs['filters'](_[_0x31ab('0x3b')](_0x1ec80a[_0x31ab('0x32')],_0x23fcac[_0x31ab('0x34')]));if(_0x1ec80a['query']['filter']){_0x8eb921[_0x31ab('0x3d')]=_[_0x31ab('0x3e')](_0x8eb921[_0x31ab('0x3d')],{'$or':_[_0x31ab('0x2c')](_0x8eb921[_0x31ab('0x36')],function(_0x56e3c9){var _0x3be3c2={};_0x3be3c2[_0x56e3c9]={'$like':'%'+_0x1ec80a['query'][_0x31ab('0x3c')]+'%'};return _0x3be3c2;})});}_0x8eb921=_[_0x31ab('0x3e')]({},_0x8eb921,_0x1ec80a[_0x31ab('0x40')]);return _0x5edfaa[_0x31ab('0x8b')](_0x8eb921);}})[_0x31ab('0x25')](function(_0x55aa7e){if(_0x55aa7e){_0x405624=_0x55aa7e[_0x31ab('0x47')];if(!_0x1ec80a[_0x31ab('0x32')][_0x31ab('0x38')](_0x31ab('0x57'))){_0x8eb921[_0x31ab('0x1e')]=qs['limit'](_0x1ec80a[_0x31ab('0x32')][_0x31ab('0x1e')]);_0x8eb921[_0x31ab('0x21')]=qs['offset'](_0x1ec80a[_0x31ab('0x32')][_0x31ab('0x21')]);}return _0x5edfaa['getAgents'](_0x8eb921);}})[_0x31ab('0x25')](function(_0x11971d){if(_0x11971d){return _0x11971d?{'count':_0x405624,'rows':_0x11971d}:null;}})[_0x31ab('0x25')](respondWithResult(_0x36cd02,null))['catch'](handleError(_0x36cd02,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index de0484b..a55ffa3 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 _0x04a8=['../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x453503,_0x216c0d){var _0x587f85=function(_0x9c1ab1){while(--_0x9c1ab1){_0x453503['push'](_0x453503['shift']());}};_0x587f85(++_0x216c0d);}(_0x04a8,0xa7));var _0x804a=function(_0x580e4e,_0x35ff54){_0x580e4e=_0x580e4e-0x0;var _0x42b6ed=_0x04a8[_0x580e4e];return _0x42b6ed;};'use strict';var EventEmitter=require(_0x804a('0x0'));var WhatsappQueue=require(_0x804a('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x804a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x804a('0x3'),'afterDestroy':_0x804a('0x4')};function emitEvent(_0x1025be){return function(_0x531e58,_0x85e444,_0x4f2d37){WhatsappQueueEvents[_0x804a('0x5')](_0x1025be+':'+_0x531e58['id'],_0x531e58);WhatsappQueueEvents[_0x804a('0x5')](_0x1025be,_0x531e58);_0x4f2d37(null);};}for(var e in events){if(events[_0x804a('0x6')](e)){var event=events[e];WhatsappQueue[_0x804a('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0x3e83=['emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x3e83,0x189));var _0x33e8=function(_0x19a9b5,_0x198382){_0x19a9b5=_0x19a9b5-0x0;var _0x632733=_0x3e83[_0x19a9b5];return _0x632733;};'use strict';var EventEmitter=require(_0x33e8('0x0'));var WhatsappQueue=require(_0x33e8('0x1'))['db'][_0x33e8('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x33e8('0x3')](0x0);var events={'afterCreate':_0x33e8('0x4'),'afterUpdate':_0x33e8('0x5'),'afterDestroy':_0x33e8('0x6')};function emitEvent(_0x2fc3c5){return function(_0x538e23,_0x2f9da9,_0x162b92){WhatsappQueueEvents[_0x33e8('0x7')](_0x2fc3c5+':'+_0x538e23['id'],_0x538e23);WhatsappQueueEvents[_0x33e8('0x7')](_0x2fc3c5,_0x538e23);_0x162b92(null);};}for(var e in events){if(events[_0x33e8('0x8')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x33e8('0x9')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 08e24ea..3f35e10 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 _0xc8f9=['moment','bluebird','request-promise','../../config/environment','exports','define','WhatsappQueue','lodash','util','../../config/logger'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xc8f9,0x89));var _0x9c8f=function(_0x29028d,_0x3537b8){_0x29028d=_0x29028d-0x0;var _0x19ca96=_0xc8f9[_0x29028d];return _0x19ca96;};'use strict';var _=require(_0x9c8f('0x0'));var util=require(_0x9c8f('0x1'));var logger=require(_0x9c8f('0x2'))('api');var moment=require(_0x9c8f('0x3'));var BPromise=require(_0x9c8f('0x4'));var rp=require(_0x9c8f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9c8f('0x6'));var attributes=require('./whatsappQueue.attributes');module[_0x9c8f('0x7')]=function(_0x77ecd0,_0x45afb8){return _0x77ecd0[_0x9c8f('0x8')](_0x9c8f('0x9'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d83=['define','whatsapp_queues','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./whatsappQueue.attributes'];(function(_0x284247,_0x26bdfe){var _0x3c1b30=function(_0x22f37b){while(--_0x22f37b){_0x284247['push'](_0x284247['shift']());}};_0x3c1b30(++_0x26bdfe);}(_0x8d83,0xa2));var _0x38d8=function(_0x1ae31,_0x12e3c6){_0x1ae31=_0x1ae31-0x0;var _0x585990=_0x8d83[_0x1ae31];return _0x585990;};'use strict';var _=require(_0x38d8('0x0'));var util=require('util');var logger=require(_0x38d8('0x1'))(_0x38d8('0x2'));var moment=require(_0x38d8('0x3'));var BPromise=require(_0x38d8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x38d8('0x5'));var config=require(_0x38d8('0x6'));var attributes=require(_0x38d8('0x7'));module['exports']=function(_0x5ef564,_0x5e82ed){return _0x5ef564[_0x38d8('0x8')]('WhatsappQueue',attributes,{'tableName':_0x38d8('0x9'),'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 6ce7e01..fc91358 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 _0xf3a7=['then','find','ShowWhatsappQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','GetWhatsappQueue','options','raw','where','attributes','limit','include','map','model'];(function(_0x2644ec,_0x46eb68){var _0x21754a=function(_0x3dee25){while(--_0x3dee25){_0x2644ec['push'](_0x2644ec['shift']());}};_0x21754a(++_0x46eb68);}(_0xf3a7,0x10d));var _0x7f3a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf3a7[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7f3a('0x0'));var util=require(_0x7f3a('0x1'));var moment=require(_0x7f3a('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f3a('0x3'));var fs=require('fs');var Redis=require(_0x7f3a('0x4'));var db=require(_0x7f3a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f3a('0x6'))(_0x7f3a('0x7'));var config=require('../../config/environment');var jayson=require(_0x7f3a('0x8'));var client=jayson[_0x7f3a('0x9')][_0x7f3a('0xa')]({'port':0x232a});config[_0x7f3a('0xb')]=_[_0x7f3a('0xc')](config[_0x7f3a('0xb')],{'host':_0x7f3a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7f3a('0xb')]));require(_0x7f3a('0xe'))[_0x7f3a('0xf')](socket);function respondWithRpcPromise(_0x5c34c4,_0x5e2cf2,_0x3f8736){return new BPromise(function(_0x258c93,_0x26fe5f){return client[_0x7f3a('0x10')](_0x5c34c4,_0x3f8736)['then'](function(_0x5c44a7){logger[_0x7f3a('0x11')](_0x7f3a('0x12'),_0x5e2cf2,_0x7f3a('0x13'));logger[_0x7f3a('0x14')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x5e2cf2,_0x7f3a('0x13'),JSON[_0x7f3a('0x15')](_0x5c44a7));if(_0x5c44a7['error']){if(_0x5c44a7['error'][_0x7f3a('0x16')]===0x1f4){logger[_0x7f3a('0x17')](_0x7f3a('0x12'),_0x5e2cf2,_0x5c44a7[_0x7f3a('0x17')][_0x7f3a('0x18')]);return _0x26fe5f(_0x5c44a7[_0x7f3a('0x17')][_0x7f3a('0x18')]);}logger[_0x7f3a('0x17')](_0x7f3a('0x12'),_0x5e2cf2,_0x5c44a7[_0x7f3a('0x17')][_0x7f3a('0x18')]);return _0x258c93(_0x5c44a7['error'][_0x7f3a('0x18')]);}else{logger[_0x7f3a('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x5e2cf2,_0x7f3a('0x13'));_0x258c93(_0x5c44a7['result'][_0x7f3a('0x18')]);}})[_0x7f3a('0x19')](function(_0x38094f){logger[_0x7f3a('0x17')](_0x7f3a('0x12'),_0x5e2cf2,_0x38094f);_0x26fe5f(_0x38094f);});});}exports[_0x7f3a('0x1a')]=function(_0x3e2b75){var _0x57af9a=this;return new Promise(function(_0x5d0bda,_0x3ee093){return db['WhatsappQueue']['findAll']({'raw':_0x3e2b75['options']?_0x3e2b75[_0x7f3a('0x1b')][_0x7f3a('0x1c')]===undefined?!![]:![]:!![],'where':_0x3e2b75[_0x7f3a('0x1b')]?_0x3e2b75[_0x7f3a('0x1b')][_0x7f3a('0x1d')]||null:null,'attributes':_0x3e2b75[_0x7f3a('0x1b')]?_0x3e2b75[_0x7f3a('0x1b')][_0x7f3a('0x1e')]||null:null,'limit':_0x3e2b75[_0x7f3a('0x1b')]?_0x3e2b75[_0x7f3a('0x1b')][_0x7f3a('0x1f')]||null:null,'include':_0x3e2b75[_0x7f3a('0x1b')]?_0x3e2b75[_0x7f3a('0x1b')][_0x7f3a('0x20')]?_[_0x7f3a('0x21')](_0x3e2b75['options'][_0x7f3a('0x20')],function(_0x12fbcb){return{'model':db[_0x12fbcb[_0x7f3a('0x22')]],'as':_0x12fbcb['as'],'attributes':_0x12fbcb['attributes'],'include':_0x12fbcb[_0x7f3a('0x20')]?_[_0x7f3a('0x21')](_0x12fbcb[_0x7f3a('0x20')],function(_0x4697d7){return{'model':db[_0x4697d7['model']],'as':_0x4697d7['as'],'attributes':_0x4697d7['attributes'],'include':_0x4697d7['include']?_['map'](_0x4697d7[_0x7f3a('0x20')],function(_0x4c2d8a){return{'model':db[_0x4c2d8a[_0x7f3a('0x22')]],'as':_0x4c2d8a['as'],'attributes':_0x4c2d8a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7f3a('0x23')](function(_0x3e8112){logger[_0x7f3a('0x11')]('GetWhatsappQueue',_0x3e2b75);logger['debug'](_0x7f3a('0x1a'),_0x3e2b75,JSON[_0x7f3a('0x15')](_0x3e8112));_0x5d0bda(_0x3e8112);})['catch'](function(_0x202b70){logger[_0x7f3a('0x17')](_0x7f3a('0x1a'),_0x202b70[_0x7f3a('0x18')],_0x3e2b75);_0x3ee093(_0x57af9a[_0x7f3a('0x17')](0x1f4,_0x202b70['message']));});});};exports['ShowWhatsappQueue']=function(_0x45f43f){var _0x2b9537=this;return new Promise(function(_0x1c61f8,_0x340229){return db['WhatsappQueue'][_0x7f3a('0x24')]({'raw':_0x45f43f[_0x7f3a('0x1b')]?_0x45f43f[_0x7f3a('0x1b')][_0x7f3a('0x1c')]===undefined?!![]:![]:!![],'where':_0x45f43f[_0x7f3a('0x1b')]?_0x45f43f[_0x7f3a('0x1b')]['where']||null:null,'attributes':_0x45f43f[_0x7f3a('0x1b')]?_0x45f43f[_0x7f3a('0x1b')][_0x7f3a('0x1e')]||null:null,'include':_0x45f43f[_0x7f3a('0x1b')]?_0x45f43f[_0x7f3a('0x1b')][_0x7f3a('0x20')]?_[_0x7f3a('0x21')](_0x45f43f[_0x7f3a('0x1b')][_0x7f3a('0x20')],function(_0x47cf8a){return{'model':db[_0x47cf8a['model']],'as':_0x47cf8a['as'],'attributes':_0x47cf8a['attributes'],'include':_0x47cf8a[_0x7f3a('0x20')]?_[_0x7f3a('0x21')](_0x47cf8a[_0x7f3a('0x20')],function(_0x5d1ba1){return{'model':db[_0x5d1ba1[_0x7f3a('0x22')]],'as':_0x5d1ba1['as'],'attributes':_0x5d1ba1[_0x7f3a('0x1e')],'include':_0x5d1ba1[_0x7f3a('0x20')]?_[_0x7f3a('0x21')](_0x5d1ba1[_0x7f3a('0x20')],function(_0x10ce58){return{'model':db[_0x10ce58[_0x7f3a('0x22')]],'as':_0x10ce58['as'],'attributes':_0x10ce58[_0x7f3a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7f3a('0x23')](function(_0x43e4a9){logger[_0x7f3a('0x11')](_0x7f3a('0x25'),_0x45f43f);logger[_0x7f3a('0x14')]('ShowWhatsappQueue',_0x45f43f,JSON[_0x7f3a('0x15')](_0x43e4a9));_0x1c61f8(_0x43e4a9);})['catch'](function(_0x122c24){logger[_0x7f3a('0x17')](_0x7f3a('0x25'),_0x122c24['message'],_0x45f43f);_0x340229(_0x2b9537[_0x7f3a('0x17')](0x1f4,_0x122c24[_0x7f3a('0x18')]));});});}; \ No newline at end of file +var _0xf116=['redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','where','limit','include','map','model','attributes','debug','find','raw','ShowWhatsappQueue','stringify','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x6de3e9,_0x2a6ef3){var _0x6d0d9=function(_0x323e3e){while(--_0x323e3e){_0x6de3e9['push'](_0x6de3e9['shift']());}};_0x6d0d9(++_0x2a6ef3);}(_0xf116,0xec));var _0x6f11=function(_0x49ad79,_0x48ee93){_0x49ad79=_0x49ad79-0x0;var _0xa4e38a=_0xf116[_0x49ad79];return _0xa4e38a;};'use strict';var _=require(_0x6f11('0x0'));var util=require('util');var moment=require(_0x6f11('0x1'));var BPromise=require(_0x6f11('0x2'));var rs=require(_0x6f11('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6f11('0x4'));var logger=require(_0x6f11('0x5'))(_0x6f11('0x6'));var config=require(_0x6f11('0x7'));var jayson=require(_0x6f11('0x8'));var client=jayson[_0x6f11('0x9')]['http']({'port':0x232a});config[_0x6f11('0xa')]=_[_0x6f11('0xb')](config[_0x6f11('0xa')],{'host':_0x6f11('0xc'),'port':0x18eb});var socket=require(_0x6f11('0xd'))(new Redis(config[_0x6f11('0xa')]));require(_0x6f11('0xe'))[_0x6f11('0xf')](socket);function respondWithRpcPromise(_0x31f684,_0x2591c1,_0x25f9ae){return new BPromise(function(_0x39cedb,_0x2db979){return client[_0x6f11('0x10')](_0x31f684,_0x25f9ae)[_0x6f11('0x11')](function(_0xf0a54c){logger[_0x6f11('0x12')](_0x6f11('0x13'),_0x2591c1,_0x6f11('0x14'));logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x2591c1,'request\x20sent',JSON['stringify'](_0xf0a54c));if(_0xf0a54c[_0x6f11('0x15')]){if(_0xf0a54c['error'][_0x6f11('0x16')]===0x1f4){logger['error'](_0x6f11('0x13'),_0x2591c1,_0xf0a54c[_0x6f11('0x15')][_0x6f11('0x17')]);return _0x2db979(_0xf0a54c[_0x6f11('0x15')][_0x6f11('0x17')]);}logger['error'](_0x6f11('0x13'),_0x2591c1,_0xf0a54c['error']['message']);return _0x39cedb(_0xf0a54c[_0x6f11('0x15')][_0x6f11('0x17')]);}else{logger['info'](_0x6f11('0x13'),_0x2591c1,_0x6f11('0x14'));_0x39cedb(_0xf0a54c[_0x6f11('0x18')][_0x6f11('0x17')]);}})[_0x6f11('0x19')](function(_0x380085){logger[_0x6f11('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x2591c1,_0x380085);_0x2db979(_0x380085);});});}exports[_0x6f11('0x1a')]=function(_0x24a748){var _0x14d236=this;return new Promise(function(_0x5a4851,_0x5d169d){return db[_0x6f11('0x1b')][_0x6f11('0x1c')]({'raw':_0x24a748[_0x6f11('0x1d')]?_0x24a748[_0x6f11('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x24a748['options']?_0x24a748[_0x6f11('0x1d')][_0x6f11('0x1e')]||null:null,'attributes':_0x24a748[_0x6f11('0x1d')]?_0x24a748[_0x6f11('0x1d')]['attributes']||null:null,'limit':_0x24a748[_0x6f11('0x1d')]?_0x24a748[_0x6f11('0x1d')][_0x6f11('0x1f')]||null:null,'include':_0x24a748['options']?_0x24a748[_0x6f11('0x1d')][_0x6f11('0x20')]?_[_0x6f11('0x21')](_0x24a748[_0x6f11('0x1d')][_0x6f11('0x20')],function(_0x552abb){return{'model':db[_0x552abb[_0x6f11('0x22')]],'as':_0x552abb['as'],'attributes':_0x552abb[_0x6f11('0x23')],'include':_0x552abb[_0x6f11('0x20')]?_[_0x6f11('0x21')](_0x552abb[_0x6f11('0x20')],function(_0x1b9798){return{'model':db[_0x1b9798['model']],'as':_0x1b9798['as'],'attributes':_0x1b9798['attributes'],'include':_0x1b9798[_0x6f11('0x20')]?_[_0x6f11('0x21')](_0x1b9798[_0x6f11('0x20')],function(_0x158aca){return{'model':db[_0x158aca[_0x6f11('0x22')]],'as':_0x158aca['as'],'attributes':_0x158aca[_0x6f11('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ec067){logger[_0x6f11('0x12')](_0x6f11('0x1a'),_0x24a748);logger[_0x6f11('0x24')](_0x6f11('0x1a'),_0x24a748,JSON['stringify'](_0x1ec067));_0x5a4851(_0x1ec067);})['catch'](function(_0x5d82c2){logger[_0x6f11('0x15')](_0x6f11('0x1a'),_0x5d82c2[_0x6f11('0x17')],_0x24a748);_0x5d169d(_0x14d236[_0x6f11('0x15')](0x1f4,_0x5d82c2[_0x6f11('0x17')]));});});};exports['ShowWhatsappQueue']=function(_0x5a8c48){var _0x458a12=this;return new Promise(function(_0x4e976b,_0x562b19){return db[_0x6f11('0x1b')][_0x6f11('0x25')]({'raw':_0x5a8c48['options']?_0x5a8c48[_0x6f11('0x1d')][_0x6f11('0x26')]===undefined?!![]:![]:!![],'where':_0x5a8c48[_0x6f11('0x1d')]?_0x5a8c48['options'][_0x6f11('0x1e')]||null:null,'attributes':_0x5a8c48[_0x6f11('0x1d')]?_0x5a8c48[_0x6f11('0x1d')][_0x6f11('0x23')]||null:null,'include':_0x5a8c48[_0x6f11('0x1d')]?_0x5a8c48['options'][_0x6f11('0x20')]?_[_0x6f11('0x21')](_0x5a8c48[_0x6f11('0x1d')][_0x6f11('0x20')],function(_0x4c8ef5){return{'model':db[_0x4c8ef5[_0x6f11('0x22')]],'as':_0x4c8ef5['as'],'attributes':_0x4c8ef5[_0x6f11('0x23')],'include':_0x4c8ef5[_0x6f11('0x20')]?_[_0x6f11('0x21')](_0x4c8ef5[_0x6f11('0x20')],function(_0xa8001){return{'model':db[_0xa8001['model']],'as':_0xa8001['as'],'attributes':_0xa8001[_0x6f11('0x23')],'include':_0xa8001['include']?_[_0x6f11('0x21')](_0xa8001[_0x6f11('0x20')],function(_0x1a635c){return{'model':db[_0x1a635c[_0x6f11('0x22')]],'as':_0x1a635c['as'],'attributes':_0x1a635c[_0x6f11('0x23')]};}):[]};}):[]};}):[]:[]})[_0x6f11('0x11')](function(_0x2c7a57){logger['info'](_0x6f11('0x27'),_0x5a8c48);logger[_0x6f11('0x24')](_0x6f11('0x27'),_0x5a8c48,JSON[_0x6f11('0x28')](_0x2c7a57));_0x4e976b(_0x2c7a57);})['catch'](function(_0x689390){logger[_0x6f11('0x15')](_0x6f11('0x27'),_0x689390[_0x6f11('0x17')],_0x5a8c48);_0x562b19(_0x458a12['error'](0x1f4,_0x689390['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 1edae3e..5f3c1f9 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 _0xd45d=['register','length','whatsappQueue:','./whatsappQueue.events','save','remove','update','emit'];(function(_0x57cbfb,_0x2de760){var _0x4cb933=function(_0x33cf6a){while(--_0x33cf6a){_0x57cbfb['push'](_0x57cbfb['shift']());}};_0x4cb933(++_0x2de760);}(_0xd45d,0xb3));var _0xdd45=function(_0x1b7a5b,_0x4b19e2){_0x1b7a5b=_0x1b7a5b-0x0;var _0xf0a88a=_0xd45d[_0x1b7a5b];return _0xf0a88a;};'use strict';var WhatsappQueueEvents=require(_0xdd45('0x0'));var events=[_0xdd45('0x1'),_0xdd45('0x2'),_0xdd45('0x3')];function createListener(_0x2a59fe,_0x3720b1){return function(_0xd6433b){_0x3720b1[_0xdd45('0x4')](_0x2a59fe,_0xd6433b);};}function removeListener(_0x43cbe1,_0x16b1df){return function(){WhatsappQueueEvents['removeListener'](_0x43cbe1,_0x16b1df);};}exports[_0xdd45('0x5')]=function(_0x15a78a){for(var _0x48a204=0x0,_0x5243ee=events[_0xdd45('0x6')];_0x48a204<_0x5243ee;_0x48a204++){var _0x164c7e=events[_0x48a204];var _0x193126=createListener(_0xdd45('0x7')+_0x164c7e,_0x15a78a);WhatsappQueueEvents['on'](_0x164c7e,_0x193126);}}; \ No newline at end of file +var _0xf155=['length','./whatsappQueue.events','save','remove','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf155,0x199));var _0x5f15=function(_0x1945a5,_0x50de54){_0x1945a5=_0x1945a5-0x0;var _0x5817a5=_0xf155[_0x1945a5];return _0x5817a5;};'use strict';var WhatsappQueueEvents=require(_0x5f15('0x0'));var events=[_0x5f15('0x1'),_0x5f15('0x2'),_0x5f15('0x3')];function createListener(_0x815850,_0xfd53a3){return function(_0x1e38ae){_0xfd53a3[_0x5f15('0x4')](_0x815850,_0x1e38ae);};}function removeListener(_0x1dcbaa,_0x5c81d9){return function(){WhatsappQueueEvents['removeListener'](_0x1dcbaa,_0x5c81d9);};}exports['register']=function(_0x381af1){for(var _0x73993b=0x0,_0x1f7291=events[_0x5f15('0x5')];_0x73993b<_0x1f7291;_0x73993b++){var _0x340718=events[_0x73993b];var _0x5dc1d2=createListener('whatsappQueue:'+_0x340718,_0x381af1);WhatsappQueueEvents['on'](_0x340718,_0x5dc1d2);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 55e7da1..581efe6 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 _0xe424=['isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get'];(function(_0x347b52,_0xfe591b){var _0x38bd34=function(_0x1be5e7){while(--_0x1be5e7){_0x347b52['push'](_0x347b52['shift']());}};_0x38bd34(++_0xfe591b);}(_0xe424,0x13f));var _0x4e42=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xe424[_0xefd519];return _0x4bb882;};'use strict';var multer=require(_0x4e42('0x0'));var util=require(_0x4e42('0x1'));var path=require(_0x4e42('0x2'));var timeout=require(_0x4e42('0x3'));var express=require(_0x4e42('0x4'));var router=express[_0x4e42('0x5')]();var fs_extra=require(_0x4e42('0x6'));var auth=require(_0x4e42('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4e42('0x8'));var controller=require(_0x4e42('0x9'));router[_0x4e42('0xa')]('/',auth[_0x4e42('0xb')](),controller['index']);router[_0x4e42('0xa')](_0x4e42('0xc'),auth['isAuthenticated'](),controller[_0x4e42('0xd')]);router[_0x4e42('0xa')](_0x4e42('0xe'),auth[_0x4e42('0xb')](),controller[_0x4e42('0xf')]);router[_0x4e42('0x10')]('/',auth[_0x4e42('0xb')](),controller['create']);router[_0x4e42('0x11')]('/:id',auth[_0x4e42('0xb')](),controller[_0x4e42('0x12')]);router[_0x4e42('0x13')](_0x4e42('0xe'),auth[_0x4e42('0xb')](),controller[_0x4e42('0x14')]);module[_0x4e42('0x15')]=router; \ No newline at end of file +var _0xe0f2=['./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','show','post','put','update','delete','/:id','destroy','exports','multer','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x479f6f,_0x1c26c4){var _0x24e701=function(_0x5291dd){while(--_0x5291dd){_0x479f6f['push'](_0x479f6f['shift']());}};_0x24e701(++_0x1c26c4);}(_0xe0f2,0x67));var _0x2e0f=function(_0x363a81,_0x533e8d){_0x363a81=_0x363a81-0x0;var _0x1f139c=_0xe0f2[_0x363a81];return _0x1f139c;};'use strict';var multer=require(_0x2e0f('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2e0f('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2e0f('0x2'));var interaction=require(_0x2e0f('0x3'));var config=require(_0x2e0f('0x4'));var controller=require(_0x2e0f('0x5'));router[_0x2e0f('0x6')]('/',auth[_0x2e0f('0x7')](),controller[_0x2e0f('0x8')]);router[_0x2e0f('0x6')](_0x2e0f('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x2e0f('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x2e0f('0xa')]);router[_0x2e0f('0xb')]('/',auth[_0x2e0f('0x7')](),controller['create']);router[_0x2e0f('0xc')]('/:id',auth[_0x2e0f('0x7')](),controller[_0x2e0f('0xd')]);router[_0x2e0f('0xe')](_0x2e0f('0xf'),auth[_0x2e0f('0x7')](),controller[_0x2e0f('0x10')]);module[_0x2e0f('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 1f6dab0..0d25ff2 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 _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x25a74e,_0x3f40f4){var _0x235557=function(_0xd3ee2a){while(--_0xd3ee2a){_0x25a74e['push'](_0x25a74e['shift']());}};_0x235557(++_0x3f40f4);}(_0x7a54,0x106));var _0x47a5=function(_0x290220,_0x1b9ec7){_0x290220=_0x290220-0x0;var _0x30b69c=_0x7a54[_0x290220];return _0x30b69c;};'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 +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x5988ff,_0x145b06){var _0x3a8ec3=function(_0x9d2ff4){while(--_0x9d2ff4){_0x5988ff['push'](_0x5988ff['shift']());}};_0x3a8ec3(++_0x145b06);}(_0x7a54,0x106));var _0x47a5=function(_0x5709d0,_0x1560c6){_0x5709d0=_0x5709d0-0x0;var _0x3245ea=_0x7a54[_0x5709d0];return _0x3245ea;};'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 c531766..a52bd5a 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 _0x1eba=['name','send','WhatsappQueueReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','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','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error'];(function(_0x10d73b,_0xb2bc5){var _0x22f7c2=function(_0x1a89b5){while(--_0x1a89b5){_0x10d73b['push'](_0x10d73b['shift']());}};_0x22f7c2(++_0xb2bc5);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x1eba[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0xa1eb('0x0'));var rimraf=require(_0xa1eb('0x1'));var zipdir=require(_0xa1eb('0x2'));var jsonpatch=require(_0xa1eb('0x3'));var rp=require(_0xa1eb('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa1eb('0x5'));var util=require(_0xa1eb('0x6'));var path=require(_0xa1eb('0x7'));var sox=require(_0xa1eb('0x8'));var csv=require(_0xa1eb('0x9'));var ejs=require(_0xa1eb('0xa'));var fs=require('fs');var fs_extra=require(_0xa1eb('0xb'));var _=require(_0xa1eb('0xc'));var squel=require(_0xa1eb('0xd'));var crypto=require(_0xa1eb('0xe'));var jsforce=require(_0xa1eb('0xf'));var deskjs=require(_0xa1eb('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa1eb('0x11'));var Papa=require('papaparse');var Redis=require(_0xa1eb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa1eb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1eb('0x14'));var logger=require('../../config/logger')(_0xa1eb('0x15'));var utils=require(_0xa1eb('0x16'));var config=require(_0xa1eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa1eb('0x18'))['db'];function respondWithStatusCode(_0x39b4a3,_0x5df92d){_0x5df92d=_0x5df92d||0xcc;return function(_0x16a623){if(_0x16a623){return _0x39b4a3['sendStatus'](_0x5df92d);}return _0x39b4a3['status'](_0x5df92d)[_0xa1eb('0x19')]();};}function respondWithResult(_0x4c7983,_0x25d058){_0x25d058=_0x25d058||0xc8;return function(_0x2178e2){if(_0x2178e2){return _0x4c7983[_0xa1eb('0x1a')](_0x25d058)[_0xa1eb('0x1b')](_0x2178e2);}};}function respondWithFilteredResult(_0x3cd675,_0x44f37d){return function(_0x1c858c){if(_0x1c858c){var _0x45d6dd=typeof _0x44f37d[_0xa1eb('0x1c')]==='undefined'&&typeof _0x44f37d[_0xa1eb('0x1d')]==='undefined';var _0x1401ef=_0x1c858c[_0xa1eb('0x1e')];var _0x33c4e3=_0x45d6dd?0x0:_0x44f37d[_0xa1eb('0x1c')];var _0x49bfaa=_0x45d6dd?_0x1c858c[_0xa1eb('0x1e')]:_0x44f37d[_0xa1eb('0x1c')]+_0x44f37d[_0xa1eb('0x1d')];var _0xcf45c1;if(_0x49bfaa>=_0x1401ef){_0x49bfaa=_0x1401ef;_0xcf45c1=0xc8;}else{_0xcf45c1=0xce;}_0x3cd675[_0xa1eb('0x1a')](_0xcf45c1);return _0x3cd675[_0xa1eb('0x1f')](_0xa1eb('0x20'),_0x33c4e3+'-'+_0x49bfaa+'/'+_0x1401ef)[_0xa1eb('0x1b')](_0x1c858c);}return null;};}function patchUpdates(_0x4fc14a){return function(_0x137e2c){try{jsonpatch['apply'](_0x137e2c,_0x4fc14a,!![]);}catch(_0x2258d1){return BPromise[_0xa1eb('0x21')](_0x2258d1);}return _0x137e2c[_0xa1eb('0x22')]();};}function saveUpdates(_0x250f99,_0x5e7a34){return function(_0x539634){if(_0x539634){return _0x539634[_0xa1eb('0x23')](_0x250f99)[_0xa1eb('0x24')](function(_0x5b0903){return _0x5b0903;});}return null;};}function removeEntity(_0x437b2a,_0x250728){return function(_0x258d3a){if(_0x258d3a){return _0x258d3a[_0xa1eb('0x25')]()[_0xa1eb('0x24')](function(){_0x437b2a[_0xa1eb('0x1a')](0xcc)[_0xa1eb('0x19')]();});}};}function handleEntityNotFound(_0x364b1c,_0xd7bb88){return function(_0x352796){if(!_0x352796){_0x364b1c[_0xa1eb('0x26')](0x194);}return _0x352796;};}function handleError(_0x208844,_0x57d089){_0x57d089=_0x57d089||0x1f4;return function(_0x7c617e){logger[_0xa1eb('0x27')](_0x7c617e['stack']);if(_0x7c617e[_0xa1eb('0x28')]){delete _0x7c617e['name'];}_0x208844[_0xa1eb('0x1a')](_0x57d089)[_0xa1eb('0x29')](_0x7c617e);};}exports['index']=function(_0x45ff0d,_0x1581ee){var _0x136835={},_0x4f64bb={},_0x12cf56={'count':0x0,'rows':[]};var _0x41b3ad=_['map'](db[_0xa1eb('0x2a')][_0xa1eb('0x2b')],function(_0x401510){return{'name':_0x401510[_0xa1eb('0x2c')],'type':_0x401510[_0xa1eb('0x2d')]['key']};});_0x4f64bb[_0xa1eb('0x2e')]=_[_0xa1eb('0x2f')](_0x41b3ad,_0xa1eb('0x28'));_0x4f64bb[_0xa1eb('0x30')]=_[_0xa1eb('0x31')](_0x45ff0d[_0xa1eb('0x30')]);_0x4f64bb[_0xa1eb('0x32')]=_[_0xa1eb('0x33')](_0x4f64bb[_0xa1eb('0x2e')],_0x4f64bb[_0xa1eb('0x30')]);_0x136835[_0xa1eb('0x34')]=_['intersection'](_0x4f64bb['model'],qs[_0xa1eb('0x35')](_0x45ff0d[_0xa1eb('0x30')][_0xa1eb('0x35')]));_0x136835[_0xa1eb('0x34')]=_0x136835[_0xa1eb('0x34')]['length']?_0x136835['attributes']:_0x4f64bb[_0xa1eb('0x2e')];if(!_0x45ff0d[_0xa1eb('0x30')]['hasOwnProperty']('nolimit')){_0x136835[_0xa1eb('0x1d')]=qs['limit'](_0x45ff0d[_0xa1eb('0x30')]['limit']);_0x136835[_0xa1eb('0x1c')]=qs[_0xa1eb('0x1c')](_0x45ff0d[_0xa1eb('0x30')]['offset']);}_0x136835[_0xa1eb('0x36')]=qs[_0xa1eb('0x37')](_0x45ff0d[_0xa1eb('0x30')]['sort']);_0x136835[_0xa1eb('0x38')]=qs[_0xa1eb('0x32')](_[_0xa1eb('0x39')](_0x45ff0d[_0xa1eb('0x30')],_0x4f64bb[_0xa1eb('0x32')]),_0x41b3ad);if(_0x45ff0d['query'][_0xa1eb('0x3a')]){_0x136835[_0xa1eb('0x38')]=_[_0xa1eb('0x3b')](_0x136835[_0xa1eb('0x38')],{'$or':_[_0xa1eb('0x2f')](_0x41b3ad,function(_0x2af1d1){if(_0x2af1d1[_0xa1eb('0x2d')]!==_0xa1eb('0x3c')){var _0x53f251={};_0x53f251[_0x2af1d1[_0xa1eb('0x28')]]={'$like':'%'+_0x45ff0d[_0xa1eb('0x30')][_0xa1eb('0x3a')]+'%'};return _0x53f251;}})});}_0x136835=_[_0xa1eb('0x3b')]({},_0x136835,_0x45ff0d[_0xa1eb('0x3d')]);var _0x5bf994={'where':_0x136835[_0xa1eb('0x38')]};return db[_0xa1eb('0x2a')][_0xa1eb('0x1e')](_0x5bf994)['then'](function(_0x334849){_0x12cf56[_0xa1eb('0x1e')]=_0x334849;if(_0x45ff0d[_0xa1eb('0x30')][_0xa1eb('0x3e')]){_0x136835[_0xa1eb('0x3f')]=[{'all':!![]}];}return db[_0xa1eb('0x2a')][_0xa1eb('0x40')](_0x136835);})['then'](function(_0x3c8713){_0x12cf56[_0xa1eb('0x41')]=_0x3c8713;return _0x12cf56;})['then'](respondWithFilteredResult(_0x1581ee,_0x136835))[_0xa1eb('0x42')](handleError(_0x1581ee,null));};exports['show']=function(_0x1744e4,_0x3a6f36){var _0x75f7f6={'raw':!![],'where':{'id':_0x1744e4[_0xa1eb('0x43')]['id']}},_0x361675={};_0x361675[_0xa1eb('0x2e')]=_[_0xa1eb('0x31')](db[_0xa1eb('0x2a')][_0xa1eb('0x2b')]);_0x361675[_0xa1eb('0x30')]=_[_0xa1eb('0x31')](_0x1744e4[_0xa1eb('0x30')]);_0x361675[_0xa1eb('0x32')]=_[_0xa1eb('0x33')](_0x361675[_0xa1eb('0x2e')],_0x361675[_0xa1eb('0x30')]);_0x75f7f6['attributes']=_[_0xa1eb('0x33')](_0x361675['model'],qs[_0xa1eb('0x35')](_0x1744e4[_0xa1eb('0x30')]['fields']));_0x75f7f6['attributes']=_0x75f7f6[_0xa1eb('0x34')][_0xa1eb('0x44')]?_0x75f7f6[_0xa1eb('0x34')]:_0x361675['model'];if(_0x1744e4[_0xa1eb('0x30')][_0xa1eb('0x3e')]){_0x75f7f6[_0xa1eb('0x3f')]=[{'all':!![]}];}_0x75f7f6=_[_0xa1eb('0x3b')]({},_0x75f7f6,_0x1744e4[_0xa1eb('0x3d')]);return db[_0xa1eb('0x2a')][_0xa1eb('0x45')](_0x75f7f6)[_0xa1eb('0x24')](handleEntityNotFound(_0x3a6f36,null))[_0xa1eb('0x24')](respondWithResult(_0x3a6f36,null))[_0xa1eb('0x42')](handleError(_0x3a6f36,null));};exports[_0xa1eb('0x46')]=function(_0x393f95,_0x39d3c6){return db[_0xa1eb('0x2a')]['create'](_0x393f95[_0xa1eb('0x47')],{})[_0xa1eb('0x24')](respondWithResult(_0x39d3c6,0xc9))[_0xa1eb('0x42')](handleError(_0x39d3c6,null));};exports[_0xa1eb('0x23')]=function(_0x2b0cbf,_0x12dfd4){if(_0x2b0cbf[_0xa1eb('0x47')]['id']){delete _0x2b0cbf['body']['id'];}return db[_0xa1eb('0x2a')][_0xa1eb('0x45')]({'where':{'id':_0x2b0cbf[_0xa1eb('0x43')]['id']}})[_0xa1eb('0x24')](handleEntityNotFound(_0x12dfd4,null))[_0xa1eb('0x24')](saveUpdates(_0x2b0cbf[_0xa1eb('0x47')],null))[_0xa1eb('0x24')](respondWithResult(_0x12dfd4,null))[_0xa1eb('0x42')](handleError(_0x12dfd4,null));};exports[_0xa1eb('0x25')]=function(_0x4f7c05,_0x190370){return db['WhatsappQueueReport'][_0xa1eb('0x45')]({'where':{'id':_0x4f7c05['params']['id']}})[_0xa1eb('0x24')](handleEntityNotFound(_0x190370,null))[_0xa1eb('0x24')](removeEntity(_0x190370,null))[_0xa1eb('0x42')](handleError(_0x190370,null));};exports['describe']=function(_0x3fbd6c,_0xbd9a42){return db['WhatsappQueueReport'][_0xa1eb('0x48')]()[_0xa1eb('0x24')](respondWithResult(_0xbd9a42,null))[_0xa1eb('0x42')](handleError(_0xbd9a42,null));}; \ No newline at end of file +var _0x0972=['nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','describe','catch','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','stack','name','send','index','WhatsappQueueReport','rawAttributes','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x3683be,_0x1aa3cf){var _0x7e4c5b=function(_0x31bb47){while(--_0x31bb47){_0x3683be['push'](_0x3683be['shift']());}};_0x7e4c5b(++_0x1aa3cf);}(_0x0972,0x64));var _0x2097=function(_0x206e6c,_0x3c0c4e){_0x206e6c=_0x206e6c-0x0;var _0x423a21=_0x0972[_0x206e6c];return _0x423a21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2097('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2097('0x1'));var rp=require('request-promise');var moment=require(_0x2097('0x2'));var BPromise=require(_0x2097('0x3'));var Mustache=require('mustache');var util=require(_0x2097('0x4'));var path=require(_0x2097('0x5'));var sox=require(_0x2097('0x6'));var csv=require(_0x2097('0x7'));var ejs=require(_0x2097('0x8'));var fs=require('fs');var fs_extra=require(_0x2097('0x9'));var _=require(_0x2097('0xa'));var squel=require('squel');var crypto=require(_0x2097('0xb'));var jsforce=require(_0x2097('0xc'));var deskjs=require(_0x2097('0xd'));var toCsv=require(_0x2097('0x7'));var querystring=require(_0x2097('0xe'));var Papa=require('papaparse');var Redis=require(_0x2097('0xf'));var authService=require(_0x2097('0x10'));var qs=require(_0x2097('0x11'));var as=require(_0x2097('0x12'));var hardwareService=require(_0x2097('0x13'));var logger=require(_0x2097('0x14'))(_0x2097('0x15'));var utils=require(_0x2097('0x16'));var config=require(_0x2097('0x17'));var licenseUtil=require(_0x2097('0x18'));var db=require(_0x2097('0x19'))['db'];function respondWithStatusCode(_0x3b2f94,_0x170005){_0x170005=_0x170005||0xcc;return function(_0x16871b){if(_0x16871b){return _0x3b2f94[_0x2097('0x1a')](_0x170005);}return _0x3b2f94[_0x2097('0x1b')](_0x170005)[_0x2097('0x1c')]();};}function respondWithResult(_0x1c9ef9,_0x2c3e41){_0x2c3e41=_0x2c3e41||0xc8;return function(_0x354387){if(_0x354387){return _0x1c9ef9['status'](_0x2c3e41)[_0x2097('0x1d')](_0x354387);}};}function respondWithFilteredResult(_0x35c062,_0x4d31bc){return function(_0x4eec05){if(_0x4eec05){var _0x4fc8c5=typeof _0x4d31bc[_0x2097('0x1e')]==='undefined'&&typeof _0x4d31bc[_0x2097('0x1f')]===_0x2097('0x20');var _0x43fec9=_0x4eec05[_0x2097('0x21')];var _0x44c584=_0x4fc8c5?0x0:_0x4d31bc['offset'];var _0x324652=_0x4fc8c5?_0x4eec05[_0x2097('0x21')]:_0x4d31bc[_0x2097('0x1e')]+_0x4d31bc[_0x2097('0x1f')];var _0x1d3804;if(_0x324652>=_0x43fec9){_0x324652=_0x43fec9;_0x1d3804=0xc8;}else{_0x1d3804=0xce;}_0x35c062[_0x2097('0x1b')](_0x1d3804);return _0x35c062[_0x2097('0x22')](_0x2097('0x23'),_0x44c584+'-'+_0x324652+'/'+_0x43fec9)['json'](_0x4eec05);}return null;};}function patchUpdates(_0x4d957e){return function(_0xf65dc6){try{jsonpatch['apply'](_0xf65dc6,_0x4d957e,!![]);}catch(_0x227c00){return BPromise[_0x2097('0x24')](_0x227c00);}return _0xf65dc6['save']();};}function saveUpdates(_0x442db7,_0x5b0582){return function(_0x2e17c8){if(_0x2e17c8){return _0x2e17c8[_0x2097('0x25')](_0x442db7)[_0x2097('0x26')](function(_0x20b93a){return _0x20b93a;});}return null;};}function removeEntity(_0x36b15e,_0x35047b){return function(_0x56390a){if(_0x56390a){return _0x56390a[_0x2097('0x27')]()['then'](function(){_0x36b15e[_0x2097('0x1b')](0xcc)[_0x2097('0x1c')]();});}};}function handleEntityNotFound(_0x345875,_0x9f59bc){return function(_0x499988){if(!_0x499988){_0x345875[_0x2097('0x1a')](0x194);}return _0x499988;};}function handleError(_0x80c5ee,_0x56af3b){_0x56af3b=_0x56af3b||0x1f4;return function(_0x1229fc){logger['error'](_0x1229fc[_0x2097('0x28')]);if(_0x1229fc['name']){delete _0x1229fc[_0x2097('0x29')];}_0x80c5ee[_0x2097('0x1b')](_0x56af3b)[_0x2097('0x2a')](_0x1229fc);};}exports[_0x2097('0x2b')]=function(_0x410afa,_0x36228c){var _0x450e0b={},_0x4b443d={},_0x11242f={'count':0x0,'rows':[]};var _0x14d964=_['map'](db[_0x2097('0x2c')][_0x2097('0x2d')],function(_0x59fb84){return{'name':_0x59fb84['fieldName'],'type':_0x59fb84[_0x2097('0x2e')][_0x2097('0x2f')]};});_0x4b443d[_0x2097('0x30')]=_[_0x2097('0x31')](_0x14d964,_0x2097('0x29'));_0x4b443d[_0x2097('0x32')]=_['keys'](_0x410afa[_0x2097('0x32')]);_0x4b443d['filters']=_[_0x2097('0x33')](_0x4b443d[_0x2097('0x30')],_0x4b443d[_0x2097('0x32')]);_0x450e0b[_0x2097('0x34')]=_[_0x2097('0x33')](_0x4b443d[_0x2097('0x30')],qs[_0x2097('0x35')](_0x410afa[_0x2097('0x32')][_0x2097('0x35')]));_0x450e0b['attributes']=_0x450e0b[_0x2097('0x34')][_0x2097('0x36')]?_0x450e0b[_0x2097('0x34')]:_0x4b443d['model'];if(!_0x410afa[_0x2097('0x32')][_0x2097('0x37')](_0x2097('0x38'))){_0x450e0b[_0x2097('0x1f')]=qs['limit'](_0x410afa['query']['limit']);_0x450e0b[_0x2097('0x1e')]=qs[_0x2097('0x1e')](_0x410afa[_0x2097('0x32')][_0x2097('0x1e')]);}_0x450e0b[_0x2097('0x39')]=qs[_0x2097('0x3a')](_0x410afa['query'][_0x2097('0x3a')]);_0x450e0b[_0x2097('0x3b')]=qs[_0x2097('0x3c')](_[_0x2097('0x3d')](_0x410afa[_0x2097('0x32')],_0x4b443d[_0x2097('0x3c')]),_0x14d964);if(_0x410afa['query'][_0x2097('0x3e')]){_0x450e0b[_0x2097('0x3b')]=_[_0x2097('0x3f')](_0x450e0b['where'],{'$or':_['map'](_0x14d964,function(_0x57649e){if(_0x57649e[_0x2097('0x2e')]!==_0x2097('0x40')){var _0x85b01e={};_0x85b01e[_0x57649e[_0x2097('0x29')]]={'$like':'%'+_0x410afa[_0x2097('0x32')][_0x2097('0x3e')]+'%'};return _0x85b01e;}})});}_0x450e0b=_[_0x2097('0x3f')]({},_0x450e0b,_0x410afa[_0x2097('0x41')]);var _0x3bfb5c={'where':_0x450e0b[_0x2097('0x3b')]};return db[_0x2097('0x2c')]['count'](_0x3bfb5c)[_0x2097('0x26')](function(_0x2f5378){_0x11242f[_0x2097('0x21')]=_0x2f5378;if(_0x410afa['query'][_0x2097('0x42')]){_0x450e0b[_0x2097('0x43')]=[{'all':!![]}];}return db[_0x2097('0x2c')][_0x2097('0x44')](_0x450e0b);})[_0x2097('0x26')](function(_0xd4d89e){_0x11242f[_0x2097('0x45')]=_0xd4d89e;return _0x11242f;})[_0x2097('0x26')](respondWithFilteredResult(_0x36228c,_0x450e0b))['catch'](handleError(_0x36228c,null));};exports[_0x2097('0x46')]=function(_0x283adc,_0x186ca5){var _0x3288ae={'raw':!![],'where':{'id':_0x283adc[_0x2097('0x47')]['id']}},_0x12e0e2={};_0x12e0e2[_0x2097('0x30')]=_[_0x2097('0x48')](db['WhatsappQueueReport'][_0x2097('0x2d')]);_0x12e0e2['query']=_[_0x2097('0x48')](_0x283adc[_0x2097('0x32')]);_0x12e0e2[_0x2097('0x3c')]=_[_0x2097('0x33')](_0x12e0e2[_0x2097('0x30')],_0x12e0e2['query']);_0x3288ae[_0x2097('0x34')]=_[_0x2097('0x33')](_0x12e0e2[_0x2097('0x30')],qs[_0x2097('0x35')](_0x283adc[_0x2097('0x32')]['fields']));_0x3288ae[_0x2097('0x34')]=_0x3288ae[_0x2097('0x34')][_0x2097('0x36')]?_0x3288ae[_0x2097('0x34')]:_0x12e0e2[_0x2097('0x30')];if(_0x283adc[_0x2097('0x32')][_0x2097('0x42')]){_0x3288ae[_0x2097('0x43')]=[{'all':!![]}];}_0x3288ae=_['merge']({},_0x3288ae,_0x283adc[_0x2097('0x41')]);return db[_0x2097('0x2c')][_0x2097('0x49')](_0x3288ae)[_0x2097('0x26')](handleEntityNotFound(_0x186ca5,null))['then'](respondWithResult(_0x186ca5,null))['catch'](handleError(_0x186ca5,null));};exports['create']=function(_0xdf0b6e,_0x396979){return db['WhatsappQueueReport'][_0x2097('0x4a')](_0xdf0b6e[_0x2097('0x4b')],{})['then'](respondWithResult(_0x396979,0xc9))['catch'](handleError(_0x396979,null));};exports[_0x2097('0x25')]=function(_0x21829d,_0x1b4de6){if(_0x21829d['body']['id']){delete _0x21829d[_0x2097('0x4b')]['id'];}return db[_0x2097('0x2c')]['find']({'where':{'id':_0x21829d[_0x2097('0x47')]['id']}})[_0x2097('0x26')](handleEntityNotFound(_0x1b4de6,null))[_0x2097('0x26')](saveUpdates(_0x21829d[_0x2097('0x4b')],null))[_0x2097('0x26')](respondWithResult(_0x1b4de6,null))['catch'](handleError(_0x1b4de6,null));};exports['destroy']=function(_0x140b41,_0x39f9cb){return db[_0x2097('0x2c')]['find']({'where':{'id':_0x140b41['params']['id']}})[_0x2097('0x26')](handleEntityNotFound(_0x39f9cb,null))[_0x2097('0x26')](removeEntity(_0x39f9cb,null))['catch'](handleError(_0x39f9cb,null));};exports[_0x2097('0x4c')]=function(_0x33583e,_0x12bdbd){return db[_0x2097('0x2c')][_0x2097('0x4c')]()['then'](respondWithResult(_0x12bdbd,null))[_0x2097('0x4d')](handleError(_0x12bdbd,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index f5390d2..b623461 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 _0x95cf=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util'];(function(_0x2ea2dc,_0x1b3cf6){var _0xd7d188=function(_0x3c5d2b){while(--_0x3c5d2b){_0x2ea2dc['push'](_0x2ea2dc['shift']());}};_0xd7d188(++_0x1b3cf6);}(_0x95cf,0x1a2));var _0xf95c=function(_0x34c6ff,_0x2afa3a){_0x34c6ff=_0x34c6ff-0x0;var _0x1a5a65=_0x95cf[_0x34c6ff];return _0x1a5a65;};'use strict';var _=require(_0xf95c('0x0'));var util=require(_0xf95c('0x1'));var logger=require(_0xf95c('0x2'))(_0xf95c('0x3'));var moment=require(_0xf95c('0x4'));var BPromise=require(_0xf95c('0x5'));var rp=require(_0xf95c('0x6'));var fs=require('fs');var path=require(_0xf95c('0x7'));var rimraf=require(_0xf95c('0x8'));var config=require(_0xf95c('0x9'));var attributes=require('./whatsappQueueReport.attributes');module[_0xf95c('0xa')]=function(_0x2291c6,_0x57302d){return _0x2291c6['define'](_0xf95c('0xb'),attributes,{'tableName':_0xf95c('0xc'),'paranoid':![],'indexes':[{'name':_0xf95c('0xd'),'fields':[_0xf95c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9558=['rimraf','./whatsappQueueReport.attributes','exports','report_whatsapp_queue','uniqueid','lodash','api','moment','request-promise','path'];(function(_0x15aead,_0x102bbf){var _0x3aa800=function(_0x5b0d70){while(--_0x5b0d70){_0x15aead['push'](_0x15aead['shift']());}};_0x3aa800(++_0x102bbf);}(_0x9558,0x1bd));var _0x8955=function(_0x43251e,_0x584e7f){_0x43251e=_0x43251e-0x0;var _0x5c8edc=_0x9558[_0x43251e];return _0x5c8edc;};'use strict';var _=require(_0x8955('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8955('0x1'));var moment=require(_0x8955('0x2'));var BPromise=require('bluebird');var rp=require(_0x8955('0x3'));var fs=require('fs');var path=require(_0x8955('0x4'));var rimraf=require(_0x8955('0x5'));var config=require('../../config/environment');var attributes=require(_0x8955('0x6'));module[_0x8955('0x7')]=function(_0x294cc3,_0x56d9dd){return _0x294cc3['define']('WhatsappQueueReport',attributes,{'tableName':_0x8955('0x8'),'paranoid':![],'indexes':[{'name':_0x8955('0x9'),'fields':[_0x8955('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index a294c0a..159eb40 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 _0xbc07=['message','result','WhatsappQueueReport','create','options','raw','stringify','catch','UpdateWhatsappQueueReport','update','body','where','limit','lodash','util','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1f109c,_0xd9952e){var _0x3984e8=function(_0x40b60b){while(--_0x40b60b){_0x1f109c['push'](_0x1f109c['shift']());}};_0x3984e8(++_0xd9952e);}(_0xbc07,0x193));var _0x7bc0=function(_0x1d10a8,_0x1164f8){_0x1d10a8=_0x1d10a8-0x0;var _0x5bafb1=_0xbc07[_0x1d10a8];return _0x5bafb1;};'use strict';var _=require(_0x7bc0('0x0'));var util=require(_0x7bc0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7bc0('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x7bc0('0x3'))(_0x7bc0('0x4'));var config=require(_0x7bc0('0x5'));var jayson=require(_0x7bc0('0x6'));var client=jayson['client'][_0x7bc0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3c66cb,_0x202afa,_0x39f4e3){return new BPromise(function(_0x4b12cd,_0x489964){return client[_0x7bc0('0x8')](_0x3c66cb,_0x39f4e3)[_0x7bc0('0x9')](function(_0x5491e7){logger[_0x7bc0('0xa')](_0x7bc0('0xb'),_0x202afa,_0x7bc0('0xc'));logger[_0x7bc0('0xd')](_0x7bc0('0xe'),_0x202afa,_0x7bc0('0xc'),JSON['stringify'](_0x5491e7));if(_0x5491e7[_0x7bc0('0xf')]){if(_0x5491e7[_0x7bc0('0xf')][_0x7bc0('0x10')]===0x1f4){logger[_0x7bc0('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x202afa,_0x5491e7[_0x7bc0('0xf')][_0x7bc0('0x11')]);return _0x489964(_0x5491e7[_0x7bc0('0xf')][_0x7bc0('0x11')]);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x202afa,_0x5491e7[_0x7bc0('0xf')]['message']);return _0x4b12cd(_0x5491e7[_0x7bc0('0xf')]['message']);}else{logger[_0x7bc0('0xa')](_0x7bc0('0xb'),_0x202afa,_0x7bc0('0xc'));_0x4b12cd(_0x5491e7[_0x7bc0('0x12')][_0x7bc0('0x11')]);}})['catch'](function(_0x222c04){logger[_0x7bc0('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x202afa,_0x222c04);_0x489964(_0x222c04);});});}exports['CreateWhatsappQueueReport']=function(_0x376d2a){var _0x4e1501=this;return new Promise(function(_0x2623a3,_0x3a01e2){return db[_0x7bc0('0x13')][_0x7bc0('0x14')](_0x376d2a['body'],{'raw':_0x376d2a[_0x7bc0('0x15')]?_0x376d2a[_0x7bc0('0x15')][_0x7bc0('0x16')]===undefined?!![]:![]:!![]})[_0x7bc0('0x9')](function(_0x3bcbb2){logger[_0x7bc0('0xa')]('CreateWhatsappQueueReport',_0x376d2a);logger[_0x7bc0('0xd')]('CreateWhatsappQueueReport',_0x376d2a,JSON[_0x7bc0('0x17')](_0x3bcbb2));_0x2623a3(_0x3bcbb2);})[_0x7bc0('0x18')](function(_0x46a3a2){logger[_0x7bc0('0xf')]('CreateWhatsappQueueReport',_0x46a3a2[_0x7bc0('0x11')],_0x376d2a);_0x3a01e2(_0x4e1501[_0x7bc0('0xf')](0x1f4,_0x46a3a2[_0x7bc0('0x11')]));});});};exports[_0x7bc0('0x19')]=function(_0x271221){var _0x2ba75f=this;return new Promise(function(_0x18ade2,_0x44091a){return db[_0x7bc0('0x13')][_0x7bc0('0x1a')](_0x271221[_0x7bc0('0x1b')],{'raw':_0x271221[_0x7bc0('0x15')]?_0x271221[_0x7bc0('0x15')][_0x7bc0('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x271221['options']?_0x271221[_0x7bc0('0x15')][_0x7bc0('0x1c')]||null:null,'attributes':_0x271221[_0x7bc0('0x15')]?_0x271221['options']['attributes']||null:null,'limit':_0x271221['options']?_0x271221['options'][_0x7bc0('0x1d')]||null:null})[_0x7bc0('0x9')](function(_0x31ec76){logger[_0x7bc0('0xa')]('UpdateWhatsappQueueReport',_0x271221);logger[_0x7bc0('0xd')](_0x7bc0('0x19'),_0x271221,JSON[_0x7bc0('0x17')](_0x31ec76));_0x18ade2(_0x31ec76);})[_0x7bc0('0x18')](function(_0x2fcd8e){logger['error'](_0x7bc0('0x19'),_0x2fcd8e[_0x7bc0('0x11')],_0x271221);_0x44091a(_0x2ba75f['error'](0x1f4,_0x2fcd8e[_0x7bc0('0x11')]));});});}; \ No newline at end of file +var _0x3646=['raw','update','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateWhatsappQueueReport','create','body','options'];(function(_0x35027c,_0x4af623){var _0x4bba7d=function(_0x1d84f9){while(--_0x1d84f9){_0x35027c['push'](_0x35027c['shift']());}};_0x4bba7d(++_0x4af623);}(_0x3646,0xab));var _0x6364=function(_0x3baf6b,_0x49e57b){_0x3baf6b=_0x3baf6b-0x0;var _0x4da69a=_0x3646[_0x3baf6b];return _0x4da69a;};'use strict';var _=require(_0x6364('0x0'));var util=require(_0x6364('0x1'));var moment=require('moment');var BPromise=require(_0x6364('0x2'));var rs=require(_0x6364('0x3'));var fs=require('fs');var Redis=require(_0x6364('0x4'));var db=require(_0x6364('0x5'))['db'];var utils=require(_0x6364('0x6'));var logger=require(_0x6364('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6364('0x8'));var client=jayson[_0x6364('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1db030,_0xd627da,_0x2a390b){return new BPromise(function(_0x165785,_0x2332df){return client[_0x6364('0xa')](_0x1db030,_0x2a390b)[_0x6364('0xb')](function(_0x11019e){logger['info'](_0x6364('0xc'),_0xd627da,_0x6364('0xd'));logger[_0x6364('0xe')](_0x6364('0xf'),_0xd627da,_0x6364('0xd'),JSON[_0x6364('0x10')](_0x11019e));if(_0x11019e[_0x6364('0x11')]){if(_0x11019e[_0x6364('0x11')][_0x6364('0x12')]===0x1f4){logger[_0x6364('0x11')](_0x6364('0xc'),_0xd627da,_0x11019e['error']['message']);return _0x2332df(_0x11019e['error']['message']);}logger[_0x6364('0x11')](_0x6364('0xc'),_0xd627da,_0x11019e['error'][_0x6364('0x13')]);return _0x165785(_0x11019e[_0x6364('0x11')][_0x6364('0x13')]);}else{logger[_0x6364('0x14')]('WhatsappQueueReport,\x20%s,\x20%s',_0xd627da,'request\x20sent');_0x165785(_0x11019e[_0x6364('0x15')][_0x6364('0x13')]);}})[_0x6364('0x16')](function(_0x36eae9){logger['error'](_0x6364('0xc'),_0xd627da,_0x36eae9);_0x2332df(_0x36eae9);});});}exports[_0x6364('0x17')]=function(_0x4d0b76){var _0x9674ba=this;return new Promise(function(_0x216cbb,_0x35909c){return db['WhatsappQueueReport'][_0x6364('0x18')](_0x4d0b76[_0x6364('0x19')],{'raw':_0x4d0b76[_0x6364('0x1a')]?_0x4d0b76[_0x6364('0x1a')][_0x6364('0x1b')]===undefined?!![]:![]:!![]})[_0x6364('0xb')](function(_0x213da3){logger[_0x6364('0x14')](_0x6364('0x17'),_0x4d0b76);logger['debug']('CreateWhatsappQueueReport',_0x4d0b76,JSON[_0x6364('0x10')](_0x213da3));_0x216cbb(_0x213da3);})[_0x6364('0x16')](function(_0x42762e){logger[_0x6364('0x11')](_0x6364('0x17'),_0x42762e[_0x6364('0x13')],_0x4d0b76);_0x35909c(_0x9674ba[_0x6364('0x11')](0x1f4,_0x42762e[_0x6364('0x13')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x11187e){var _0x53b07f=this;return new Promise(function(_0xa85d14,_0x2195db){return db['WhatsappQueueReport'][_0x6364('0x1c')](_0x11187e['body'],{'raw':_0x11187e[_0x6364('0x1a')]?_0x11187e[_0x6364('0x1a')][_0x6364('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11187e[_0x6364('0x1a')]?_0x11187e['options'][_0x6364('0x1d')]||null:null,'attributes':_0x11187e[_0x6364('0x1a')]?_0x11187e[_0x6364('0x1a')][_0x6364('0x1e')]||null:null,'limit':_0x11187e[_0x6364('0x1a')]?_0x11187e[_0x6364('0x1a')][_0x6364('0x1f')]||null:null})['then'](function(_0x23dc61){logger[_0x6364('0x14')](_0x6364('0x20'),_0x11187e);logger[_0x6364('0xe')](_0x6364('0x20'),_0x11187e,JSON[_0x6364('0x10')](_0x23dc61));_0xa85d14(_0x23dc61);})[_0x6364('0x16')](function(_0x3d8283){logger['error']('UpdateWhatsappQueueReport',_0x3d8283[_0x6364('0x13')],_0x11187e);_0x2195db(_0x53b07f[_0x6364('0x11')](0x1f4,_0x3d8283[_0x6364('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 7bc72f6..926b7ed 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 _0x55b4=['index','/describe','isAuthenticated','describe','show','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2c74a9,_0x217a88){var _0x5e773f=function(_0x458b4b){while(--_0x458b4b){_0x2c74a9['push'](_0x2c74a9['shift']());}};_0x5e773f(++_0x217a88);}(_0x55b4,0xe8));var _0x455b=function(_0x4042d8,_0x305288){_0x4042d8=_0x4042d8-0x0;var _0x3cb304=_0x55b4[_0x4042d8];return _0x3cb304;};'use strict';var multer=require('multer');var util=require(_0x455b('0x0'));var path=require(_0x455b('0x1'));var timeout=require(_0x455b('0x2'));var express=require(_0x455b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x455b('0x4'));var interaction=require(_0x455b('0x5'));var config=require(_0x455b('0x6'));var controller=require('./whatsappTransferReport.controller');router[_0x455b('0x7')]('/',auth['isAuthenticated'](),controller[_0x455b('0x8')]);router[_0x455b('0x7')](_0x455b('0x9'),auth[_0x455b('0xa')](),controller[_0x455b('0xb')]);router[_0x455b('0x7')]('/:id',auth[_0x455b('0xa')](),controller[_0x455b('0xc')]);router['post']('/',auth[_0x455b('0xa')](),controller[_0x455b('0xd')]);router[_0x455b('0xe')](_0x455b('0xf'),auth['isAuthenticated'](),controller[_0x455b('0x10')]);router[_0x455b('0x11')](_0x455b('0xf'),auth[_0x455b('0xa')](),controller[_0x455b('0x12')]);module[_0x455b('0x13')]=router; \ No newline at end of file +var _0xfe41=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x5335c4,_0x3f1891){var _0x1c8659=function(_0x57e375){while(--_0x57e375){_0x5335c4['push'](_0x5335c4['shift']());}};_0x1c8659(++_0x3f1891);}(_0xfe41,0x131));var _0x1fe4=function(_0x1a49fc,_0x527071){_0x1a49fc=_0x1a49fc-0x0;var _0x5589fc=_0xfe41[_0x1a49fc];return _0x5589fc;};'use strict';var multer=require(_0x1fe4('0x0'));var util=require(_0x1fe4('0x1'));var path=require(_0x1fe4('0x2'));var timeout=require(_0x1fe4('0x3'));var express=require(_0x1fe4('0x4'));var router=express[_0x1fe4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1fe4('0x6'));var interaction=require(_0x1fe4('0x7'));var config=require(_0x1fe4('0x8'));var controller=require(_0x1fe4('0x9'));router[_0x1fe4('0xa')]('/',auth[_0x1fe4('0xb')](),controller['index']);router['get'](_0x1fe4('0xc'),auth['isAuthenticated'](),controller[_0x1fe4('0xd')]);router[_0x1fe4('0xa')]('/:id',auth[_0x1fe4('0xb')](),controller[_0x1fe4('0xe')]);router[_0x1fe4('0xf')]('/',auth[_0x1fe4('0xb')](),controller[_0x1fe4('0x10')]);router[_0x1fe4('0x11')](_0x1fe4('0x12'),auth[_0x1fe4('0xb')](),controller[_0x1fe4('0x13')]);router[_0x1fe4('0x14')]('/:id',auth[_0x1fe4('0xb')](),controller[_0x1fe4('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 3add8ce..e5dfa29 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 _0x65c9=['DATE','sequelize','exports','ENUM','account','agent','queue'];(function(_0xe24de5,_0x5f8ad3){var _0x4c9ceb=function(_0x3aaa42){while(--_0x3aaa42){_0xe24de5['push'](_0xe24de5['shift']());}};_0x4c9ceb(++_0x5f8ad3);}(_0x65c9,0x182));var _0x965c=function(_0x427519,_0x3257bb){_0x427519=_0x427519-0x0;var _0x1cd5c6=_0x65c9[_0x427519];return _0x1cd5c6;};'use strict';var Sequelize=require(_0x965c('0x0'));module[_0x965c('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x965c('0x2')](_0x965c('0x3'),_0x965c('0x4'),_0x965c('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x965c('0x6')]}}; \ No newline at end of file +var _0x2d07=['queue','DATE','sequelize','exports','ENUM','account'];(function(_0x2c1daa,_0x5cecf8){var _0x5e5bba=function(_0x328a4c){while(--_0x328a4c){_0x2c1daa['push'](_0x2c1daa['shift']());}};_0x5e5bba(++_0x5cecf8);}(_0x2d07,0x13a));var _0x72d0=function(_0x5c1cdc,_0x322014){_0x5c1cdc=_0x5c1cdc-0x0;var _0x2e8317=_0x2d07[_0x5c1cdc];return _0x2e8317;};'use strict';var Sequelize=require(_0x72d0('0x0'));module[_0x72d0('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x72d0('0x2')](_0x72d0('0x3'),'agent',_0x72d0('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x72d0('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 02eb72f..f4116dd 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 _0x973f=['sort','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','fields','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','length','order'];(function(_0x1c0524,_0x17d33f){var _0x3c8ff6=function(_0x4dfbaa){while(--_0x4dfbaa){_0x1c0524['push'](_0x1c0524['shift']());}};_0x3c8ff6(++_0x17d33f);}(_0x973f,0x18d));var _0xf973=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x973f[_0x3511d3];return _0x5d6321;};'use strict';var emlformat=require(_0xf973('0x0'));var rimraf=require(_0xf973('0x1'));var zipdir=require(_0xf973('0x2'));var jsonpatch=require(_0xf973('0x3'));var rp=require(_0xf973('0x4'));var moment=require(_0xf973('0x5'));var BPromise=require(_0xf973('0x6'));var Mustache=require('mustache');var util=require(_0xf973('0x7'));var path=require('path');var sox=require(_0xf973('0x8'));var csv=require(_0xf973('0x9'));var ejs=require(_0xf973('0xa'));var fs=require('fs');var fs_extra=require(_0xf973('0xb'));var _=require('lodash');var squel=require(_0xf973('0xc'));var crypto=require(_0xf973('0xd'));var jsforce=require(_0xf973('0xe'));var deskjs=require(_0xf973('0xf'));var toCsv=require(_0xf973('0x9'));var querystring=require('querystring');var Papa=require(_0xf973('0x10'));var Redis=require(_0xf973('0x11'));var authService=require(_0xf973('0x12'));var qs=require(_0xf973('0x13'));var as=require(_0xf973('0x14'));var hardwareService=require(_0xf973('0x15'));var logger=require('../../config/logger')(_0xf973('0x16'));var utils=require(_0xf973('0x17'));var config=require(_0xf973('0x18'));var licenseUtil=require(_0xf973('0x19'));var db=require(_0xf973('0x1a'))['db'];function respondWithStatusCode(_0x359703,_0x39ab5e){_0x39ab5e=_0x39ab5e||0xcc;return function(_0xe33a78){if(_0xe33a78){return _0x359703['sendStatus'](_0x39ab5e);}return _0x359703[_0xf973('0x1b')](_0x39ab5e)[_0xf973('0x1c')]();};}function respondWithResult(_0x448ce0,_0x1da223){_0x1da223=_0x1da223||0xc8;return function(_0x166765){if(_0x166765){return _0x448ce0['status'](_0x1da223)[_0xf973('0x1d')](_0x166765);}};}function respondWithFilteredResult(_0x824794,_0x5a3a60){return function(_0x2bf956){if(_0x2bf956){var _0x39ad02=typeof _0x5a3a60[_0xf973('0x1e')]===_0xf973('0x1f')&&typeof _0x5a3a60['limit']===_0xf973('0x1f');var _0x334b64=_0x2bf956[_0xf973('0x20')];var _0x23693e=_0x39ad02?0x0:_0x5a3a60[_0xf973('0x1e')];var _0x4ccf53=_0x39ad02?_0x2bf956[_0xf973('0x20')]:_0x5a3a60[_0xf973('0x1e')]+_0x5a3a60[_0xf973('0x21')];var _0x4e98c2;if(_0x4ccf53>=_0x334b64){_0x4ccf53=_0x334b64;_0x4e98c2=0xc8;}else{_0x4e98c2=0xce;}_0x824794[_0xf973('0x1b')](_0x4e98c2);return _0x824794[_0xf973('0x22')](_0xf973('0x23'),_0x23693e+'-'+_0x4ccf53+'/'+_0x334b64)[_0xf973('0x1d')](_0x2bf956);}return null;};}function patchUpdates(_0x980eac){return function(_0x76e82e){try{jsonpatch['apply'](_0x76e82e,_0x980eac,!![]);}catch(_0x36c1bd){return BPromise[_0xf973('0x24')](_0x36c1bd);}return _0x76e82e[_0xf973('0x25')]();};}function saveUpdates(_0x1f7317,_0x3af519){return function(_0x175cf7){if(_0x175cf7){return _0x175cf7[_0xf973('0x26')](_0x1f7317)[_0xf973('0x27')](function(_0x4aa2ea){return _0x4aa2ea;});}return null;};}function removeEntity(_0xcc3f80,_0x49fc20){return function(_0x3284b8){if(_0x3284b8){return _0x3284b8['destroy']()[_0xf973('0x27')](function(){_0xcc3f80[_0xf973('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x173a39,_0x687420){return function(_0x147446){if(!_0x147446){_0x173a39[_0xf973('0x28')](0x194);}return _0x147446;};}function handleError(_0x11dde0,_0x12a202){_0x12a202=_0x12a202||0x1f4;return function(_0x201803){logger[_0xf973('0x29')](_0x201803[_0xf973('0x2a')]);if(_0x201803[_0xf973('0x2b')]){delete _0x201803[_0xf973('0x2b')];}_0x11dde0[_0xf973('0x1b')](_0x12a202)[_0xf973('0x2c')](_0x201803);};}exports[_0xf973('0x2d')]=function(_0x353a2b,_0x385920){var _0x1eb99c={},_0x582c27={},_0x5d5521={'count':0x0,'rows':[]};var _0x5c4532=_[_0xf973('0x2e')](db[_0xf973('0x2f')][_0xf973('0x30')],function(_0x4d9ae6){return{'name':_0x4d9ae6['fieldName'],'type':_0x4d9ae6[_0xf973('0x31')][_0xf973('0x32')]};});_0x582c27['model']=_[_0xf973('0x2e')](_0x5c4532,_0xf973('0x2b'));_0x582c27[_0xf973('0x33')]=_[_0xf973('0x34')](_0x353a2b[_0xf973('0x33')]);_0x582c27[_0xf973('0x35')]=_[_0xf973('0x36')](_0x582c27[_0xf973('0x37')],_0x582c27[_0xf973('0x33')]);_0x1eb99c[_0xf973('0x38')]=_['intersection'](_0x582c27[_0xf973('0x37')],qs['fields'](_0x353a2b[_0xf973('0x33')]['fields']));_0x1eb99c[_0xf973('0x38')]=_0x1eb99c[_0xf973('0x38')][_0xf973('0x39')]?_0x1eb99c['attributes']:_0x582c27[_0xf973('0x37')];if(!_0x353a2b[_0xf973('0x33')]['hasOwnProperty']('nolimit')){_0x1eb99c['limit']=qs[_0xf973('0x21')](_0x353a2b[_0xf973('0x33')][_0xf973('0x21')]);_0x1eb99c[_0xf973('0x1e')]=qs[_0xf973('0x1e')](_0x353a2b[_0xf973('0x33')][_0xf973('0x1e')]);}_0x1eb99c[_0xf973('0x3a')]=qs['sort'](_0x353a2b[_0xf973('0x33')][_0xf973('0x3b')]);_0x1eb99c['where']=qs[_0xf973('0x35')](_['pick'](_0x353a2b[_0xf973('0x33')],_0x582c27[_0xf973('0x35')]),_0x5c4532);if(_0x353a2b[_0xf973('0x33')][_0xf973('0x3c')]){_0x1eb99c['where']=_['merge'](_0x1eb99c[_0xf973('0x3d')],{'$or':_[_0xf973('0x2e')](_0x5c4532,function(_0x360727){if(_0x360727[_0xf973('0x31')]!==_0xf973('0x3e')){var _0x2d38b4={};_0x2d38b4[_0x360727[_0xf973('0x2b')]]={'$like':'%'+_0x353a2b[_0xf973('0x33')][_0xf973('0x3c')]+'%'};return _0x2d38b4;}})});}_0x1eb99c=_[_0xf973('0x3f')]({},_0x1eb99c,_0x353a2b[_0xf973('0x40')]);var _0x2402b1={'where':_0x1eb99c[_0xf973('0x3d')]};return db[_0xf973('0x2f')][_0xf973('0x20')](_0x2402b1)['then'](function(_0x1c3ca2){_0x5d5521[_0xf973('0x20')]=_0x1c3ca2;if(_0x353a2b[_0xf973('0x33')][_0xf973('0x41')]){_0x1eb99c[_0xf973('0x42')]=[{'all':!![]}];}return db[_0xf973('0x2f')]['findAll'](_0x1eb99c);})[_0xf973('0x27')](function(_0x5c33ce){_0x5d5521[_0xf973('0x43')]=_0x5c33ce;return _0x5d5521;})[_0xf973('0x27')](respondWithFilteredResult(_0x385920,_0x1eb99c))[_0xf973('0x44')](handleError(_0x385920,null));};exports[_0xf973('0x45')]=function(_0x401561,_0x4c92af){var _0x485c08={'raw':!![],'where':{'id':_0x401561[_0xf973('0x46')]['id']}},_0x4b151d={};_0x4b151d[_0xf973('0x37')]=_[_0xf973('0x34')](db['WhatsappTransferReport'][_0xf973('0x30')]);_0x4b151d[_0xf973('0x33')]=_[_0xf973('0x34')](_0x401561[_0xf973('0x33')]);_0x4b151d[_0xf973('0x35')]=_['intersection'](_0x4b151d[_0xf973('0x37')],_0x4b151d[_0xf973('0x33')]);_0x485c08[_0xf973('0x38')]=_['intersection'](_0x4b151d[_0xf973('0x37')],qs[_0xf973('0x47')](_0x401561[_0xf973('0x33')][_0xf973('0x47')]));_0x485c08[_0xf973('0x38')]=_0x485c08[_0xf973('0x38')][_0xf973('0x39')]?_0x485c08[_0xf973('0x38')]:_0x4b151d[_0xf973('0x37')];if(_0x401561[_0xf973('0x33')][_0xf973('0x41')]){_0x485c08['include']=[{'all':!![]}];}_0x485c08=_[_0xf973('0x3f')]({},_0x485c08,_0x401561[_0xf973('0x40')]);return db[_0xf973('0x2f')][_0xf973('0x48')](_0x485c08)['then'](handleEntityNotFound(_0x4c92af,null))[_0xf973('0x27')](respondWithResult(_0x4c92af,null))['catch'](handleError(_0x4c92af,null));};exports[_0xf973('0x49')]=function(_0x37fce5,_0x14db2d){return db[_0xf973('0x2f')][_0xf973('0x49')](_0x37fce5[_0xf973('0x4a')],{})[_0xf973('0x27')](respondWithResult(_0x14db2d,0xc9))[_0xf973('0x44')](handleError(_0x14db2d,null));};exports[_0xf973('0x26')]=function(_0xb0b06b,_0x37d92f){if(_0xb0b06b[_0xf973('0x4a')]['id']){delete _0xb0b06b[_0xf973('0x4a')]['id'];}return db['WhatsappTransferReport'][_0xf973('0x48')]({'where':{'id':_0xb0b06b['params']['id']}})['then'](handleEntityNotFound(_0x37d92f,null))[_0xf973('0x27')](saveUpdates(_0xb0b06b[_0xf973('0x4a')],null))[_0xf973('0x27')](respondWithResult(_0x37d92f,null))[_0xf973('0x44')](handleError(_0x37d92f,null));};exports['destroy']=function(_0x329fc4,_0x128d74){return db[_0xf973('0x2f')]['find']({'where':{'id':_0x329fc4[_0xf973('0x46')]['id']}})[_0xf973('0x27')](handleEntityNotFound(_0x128d74,null))['then'](removeEntity(_0x128d74,null))[_0xf973('0x44')](handleError(_0x128d74,null));};exports['describe']=function(_0x577b0c,_0x113a9c){return db[_0xf973('0x2f')][_0xf973('0x4b')]()['then'](respondWithResult(_0x113a9c,null))[_0xf973('0x44')](handleError(_0x113a9c,null));}; \ No newline at end of file +var _0x9f0e=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f0e,0x116));var _0xe9f0=function(_0x2c83f2,_0x745d24){_0x2c83f2=_0x2c83f2-0x0;var _0x3b33b8=_0x9f0e[_0x2c83f2];return _0x3b33b8;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f0('0xa'));var squel=require(_0xe9f0('0xb'));var crypto=require(_0xe9f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe9f0('0xd'));var toCsv=require(_0xe9f0('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var hardwareService=require(_0xe9f0('0x14'));var logger=require('../../config/logger')(_0xe9f0('0x15'));var utils=require(_0xe9f0('0x16'));var config=require(_0xe9f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9f0('0x18'))['db'];function respondWithStatusCode(_0x586763,_0x367545){_0x367545=_0x367545||0xcc;return function(_0xd82420){if(_0xd82420){return _0x586763[_0xe9f0('0x19')](_0x367545);}return _0x586763[_0xe9f0('0x1a')](_0x367545)['end']();};}function respondWithResult(_0x2cf75d,_0x5a10c6){_0x5a10c6=_0x5a10c6||0xc8;return function(_0x1e3ba8){if(_0x1e3ba8){return _0x2cf75d[_0xe9f0('0x1a')](_0x5a10c6)[_0xe9f0('0x1b')](_0x1e3ba8);}};}function respondWithFilteredResult(_0x59320d,_0x28bfac){return function(_0x33e9e4){if(_0x33e9e4){var _0x2e68ef=typeof _0x28bfac['offset']===_0xe9f0('0x1c')&&typeof _0x28bfac[_0xe9f0('0x1d')]===_0xe9f0('0x1c');var _0xd71ac8=_0x33e9e4[_0xe9f0('0x1e')];var _0x2ab12b=_0x2e68ef?0x0:_0x28bfac[_0xe9f0('0x1f')];var _0x59bf5a=_0x2e68ef?_0x33e9e4[_0xe9f0('0x1e')]:_0x28bfac[_0xe9f0('0x1f')]+_0x28bfac[_0xe9f0('0x1d')];var _0x5c4182;if(_0x59bf5a>=_0xd71ac8){_0x59bf5a=_0xd71ac8;_0x5c4182=0xc8;}else{_0x5c4182=0xce;}_0x59320d[_0xe9f0('0x1a')](_0x5c4182);return _0x59320d[_0xe9f0('0x20')](_0xe9f0('0x21'),_0x2ab12b+'-'+_0x59bf5a+'/'+_0xd71ac8)[_0xe9f0('0x1b')](_0x33e9e4);}return null;};}function patchUpdates(_0x5ba788){return function(_0x33f143){try{jsonpatch[_0xe9f0('0x22')](_0x33f143,_0x5ba788,!![]);}catch(_0x583687){return BPromise['reject'](_0x583687);}return _0x33f143['save']();};}function saveUpdates(_0x12fe9f,_0xa1ddc){return function(_0x1211ae){if(_0x1211ae){return _0x1211ae[_0xe9f0('0x23')](_0x12fe9f)[_0xe9f0('0x24')](function(_0x4a5c27){return _0x4a5c27;});}return null;};}function removeEntity(_0x229fe0,_0x38b7ee){return function(_0x437d43){if(_0x437d43){return _0x437d43[_0xe9f0('0x25')]()[_0xe9f0('0x24')](function(){_0x229fe0[_0xe9f0('0x1a')](0xcc)[_0xe9f0('0x26')]();});}};}function handleEntityNotFound(_0x1321bb,_0x3c4ba9){return function(_0x3fce54){if(!_0x3fce54){_0x1321bb['sendStatus'](0x194);}return _0x3fce54;};}function handleError(_0x371095,_0x27541f){_0x27541f=_0x27541f||0x1f4;return function(_0x2ddfba){logger[_0xe9f0('0x27')](_0x2ddfba['stack']);if(_0x2ddfba[_0xe9f0('0x28')]){delete _0x2ddfba[_0xe9f0('0x28')];}_0x371095[_0xe9f0('0x1a')](_0x27541f)[_0xe9f0('0x29')](_0x2ddfba);};}exports[_0xe9f0('0x2a')]=function(_0x5457f6,_0x130f96){var _0xdc16bc={},_0x44fb5b={},_0xab3d81={'count':0x0,'rows':[]};var _0xa27c84=_[_0xe9f0('0x2b')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')],function(_0x2b6503){return{'name':_0x2b6503[_0xe9f0('0x2e')],'type':_0x2b6503[_0xe9f0('0x2f')][_0xe9f0('0x30')]};});_0x44fb5b[_0xe9f0('0x31')]=_[_0xe9f0('0x2b')](_0xa27c84,_0xe9f0('0x28'));_0x44fb5b[_0xe9f0('0x32')]=_[_0xe9f0('0x33')](_0x5457f6[_0xe9f0('0x32')]);_0x44fb5b[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x44fb5b[_0xe9f0('0x31')],_0x44fb5b[_0xe9f0('0x32')]);_0xdc16bc[_0xe9f0('0x36')]=_[_0xe9f0('0x35')](_0x44fb5b['model'],qs['fields'](_0x5457f6['query'][_0xe9f0('0x37')]));_0xdc16bc['attributes']=_0xdc16bc[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0xdc16bc['attributes']:_0x44fb5b[_0xe9f0('0x31')];if(!_0x5457f6['query']['hasOwnProperty']('nolimit')){_0xdc16bc[_0xe9f0('0x1d')]=qs[_0xe9f0('0x1d')](_0x5457f6['query'][_0xe9f0('0x1d')]);_0xdc16bc[_0xe9f0('0x1f')]=qs[_0xe9f0('0x1f')](_0x5457f6['query']['offset']);}_0xdc16bc[_0xe9f0('0x39')]=qs[_0xe9f0('0x3a')](_0x5457f6[_0xe9f0('0x32')]['sort']);_0xdc16bc[_0xe9f0('0x3b')]=qs[_0xe9f0('0x34')](_[_0xe9f0('0x3c')](_0x5457f6[_0xe9f0('0x32')],_0x44fb5b[_0xe9f0('0x34')]),_0xa27c84);if(_0x5457f6['query'][_0xe9f0('0x3d')]){_0xdc16bc[_0xe9f0('0x3b')]=_[_0xe9f0('0x3e')](_0xdc16bc['where'],{'$or':_[_0xe9f0('0x2b')](_0xa27c84,function(_0xbec11f){if(_0xbec11f['type']!==_0xe9f0('0x3f')){var _0x5154c3={};_0x5154c3[_0xbec11f[_0xe9f0('0x28')]]={'$like':'%'+_0x5457f6['query']['filter']+'%'};return _0x5154c3;}})});}_0xdc16bc=_['merge']({},_0xdc16bc,_0x5457f6['options']);var _0x5165f7={'where':_0xdc16bc[_0xe9f0('0x3b')]};return db[_0xe9f0('0x2c')][_0xe9f0('0x1e')](_0x5165f7)[_0xe9f0('0x24')](function(_0x2560c6){_0xab3d81[_0xe9f0('0x1e')]=_0x2560c6;if(_0x5457f6[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0xdc16bc[_0xe9f0('0x41')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xe9f0('0x42')](_0xdc16bc);})[_0xe9f0('0x24')](function(_0x36b00a){_0xab3d81['rows']=_0x36b00a;return _0xab3d81;})['then'](respondWithFilteredResult(_0x130f96,_0xdc16bc))[_0xe9f0('0x43')](handleError(_0x130f96,null));};exports['show']=function(_0x297689,_0x52613a){var _0x314f0e={'raw':!![],'where':{'id':_0x297689['params']['id']}},_0x42d9d2={};_0x42d9d2[_0xe9f0('0x31')]=_[_0xe9f0('0x33')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')]);_0x42d9d2[_0xe9f0('0x32')]=_['keys'](_0x297689[_0xe9f0('0x32')]);_0x42d9d2[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x42d9d2[_0xe9f0('0x31')],_0x42d9d2[_0xe9f0('0x32')]);_0x314f0e['attributes']=_[_0xe9f0('0x35')](_0x42d9d2['model'],qs['fields'](_0x297689[_0xe9f0('0x32')][_0xe9f0('0x37')]));_0x314f0e['attributes']=_0x314f0e[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0x314f0e[_0xe9f0('0x36')]:_0x42d9d2[_0xe9f0('0x31')];if(_0x297689[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0x314f0e[_0xe9f0('0x41')]=[{'all':!![]}];}_0x314f0e=_['merge']({},_0x314f0e,_0x297689[_0xe9f0('0x44')]);return db['WhatsappTransferReport'][_0xe9f0('0x45')](_0x314f0e)['then'](handleEntityNotFound(_0x52613a,null))[_0xe9f0('0x24')](respondWithResult(_0x52613a,null))['catch'](handleError(_0x52613a,null));};exports[_0xe9f0('0x46')]=function(_0x2023b4,_0x422324){return db['WhatsappTransferReport'][_0xe9f0('0x46')](_0x2023b4[_0xe9f0('0x47')],{})[_0xe9f0('0x24')](respondWithResult(_0x422324,0xc9))[_0xe9f0('0x43')](handleError(_0x422324,null));};exports[_0xe9f0('0x23')]=function(_0x135175,_0x6ece3f){if(_0x135175[_0xe9f0('0x47')]['id']){delete _0x135175[_0xe9f0('0x47')]['id'];}return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x135175[_0xe9f0('0x48')]['id']}})['then'](handleEntityNotFound(_0x6ece3f,null))['then'](saveUpdates(_0x135175[_0xe9f0('0x47')],null))[_0xe9f0('0x24')](respondWithResult(_0x6ece3f,null))[_0xe9f0('0x43')](handleError(_0x6ece3f,null));};exports['destroy']=function(_0x1ac381,_0x4d8b2e){return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x1ac381[_0xe9f0('0x48')]['id']}})[_0xe9f0('0x24')](handleEntityNotFound(_0x4d8b2e,null))['then'](removeEntity(_0x4d8b2e,null))[_0xe9f0('0x43')](handleError(_0x4d8b2e,null));};exports[_0xe9f0('0x49')]=function(_0x5163ea,_0x2bf65c){return db[_0xe9f0('0x2c')][_0xe9f0('0x49')]()[_0xe9f0('0x24')](respondWithResult(_0x2bf65c,null))['catch'](handleError(_0x2bf65c,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 234667a..9b141f7 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 _0xdc42=['exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','moment','bluebird','request-promise','./whatsappTransferReport.attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdc42,0x73));var _0x2dc4=function(_0x229564,_0x5e5fc6){_0x229564=_0x229564-0x0;var _0x5c8aaf=_0xdc42[_0x229564];return _0x5c8aaf;};'use strict';var _=require(_0x2dc4('0x0'));var util=require(_0x2dc4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2dc4('0x2'));var BPromise=require(_0x2dc4('0x3'));var rp=require(_0x2dc4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2dc4('0x5'));module[_0x2dc4('0x6')]=function(_0x4fabd6,_0x27d99a){return _0x4fabd6[_0x2dc4('0x7')](_0x2dc4('0x8'),attributes,{'tableName':_0x2dc4('0x9'),'paranoid':![],'indexes':[{'name':_0x2dc4('0xa'),'fields':[_0x2dc4('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3099=['define','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports'];(function(_0x41d7e4,_0x400232){var _0xd4a044=function(_0x2f2fd4){while(--_0x2f2fd4){_0x41d7e4['push'](_0x41d7e4['shift']());}};_0xd4a044(++_0x400232);}(_0x3099,0x113));var _0x9309=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3099[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9309('0x0'));var util=require(_0x9309('0x1'));var logger=require(_0x9309('0x2'))(_0x9309('0x3'));var moment=require(_0x9309('0x4'));var BPromise=require(_0x9309('0x5'));var rp=require(_0x9309('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9309('0x7'));var config=require(_0x9309('0x8'));var attributes=require(_0x9309('0x9'));module[_0x9309('0xa')]=function(_0x65a498,_0x180e4f){return _0x65a498[_0x9309('0xb')]('WhatsappTransferReport',attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x9309('0xc'),'fields':[_0x9309('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index be6a8a1..91053cf 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 _0xb8f7=['jayson/promise','client','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4812c8,_0x38afe9){var _0xa33c4c=function(_0x164a2f){while(--_0x164a2f){_0x4812c8['push'](_0x4812c8['shift']());}};_0xa33c4c(++_0x38afe9);}(_0xb8f7,0xb4));var _0x7b8f=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xb8f7[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0x7b8f('0x0'));var util=require('util');var moment=require(_0x7b8f('0x1'));var BPromise=require(_0x7b8f('0x2'));var rs=require(_0x7b8f('0x3'));var fs=require('fs');var Redis=require(_0x7b8f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b8f('0x5'));var logger=require(_0x7b8f('0x6'))(_0x7b8f('0x7'));var config=require(_0x7b8f('0x8'));var jayson=require(_0x7b8f('0x9'));var client=jayson[_0x7b8f('0xa')][_0x7b8f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a667f,_0x376751,_0x593e89){return new BPromise(function(_0x5ba2b4,_0x1fb187){return client['request'](_0x2a667f,_0x593e89)[_0x7b8f('0xc')](function(_0x3c391f){logger[_0x7b8f('0xd')](_0x7b8f('0xe'),_0x376751,'request\x20sent');logger[_0x7b8f('0xf')](_0x7b8f('0x10'),_0x376751,'request\x20sent',JSON['stringify'](_0x3c391f));if(_0x3c391f['error']){if(_0x3c391f[_0x7b8f('0x11')]['code']===0x1f4){logger[_0x7b8f('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x376751,_0x3c391f['error'][_0x7b8f('0x12')]);return _0x1fb187(_0x3c391f[_0x7b8f('0x11')][_0x7b8f('0x12')]);}logger[_0x7b8f('0x11')](_0x7b8f('0xe'),_0x376751,_0x3c391f['error'][_0x7b8f('0x12')]);return _0x5ba2b4(_0x3c391f[_0x7b8f('0x11')][_0x7b8f('0x12')]);}else{logger[_0x7b8f('0xd')](_0x7b8f('0xe'),_0x376751,_0x7b8f('0x13'));_0x5ba2b4(_0x3c391f['result']['message']);}})[_0x7b8f('0x14')](function(_0x16c1f6){logger['error'](_0x7b8f('0xe'),_0x376751,_0x16c1f6);_0x1fb187(_0x16c1f6);});});} \ No newline at end of file +var _0x4b78=['code','error','message','WhatsappTransferReport,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x4b78,0x90));var _0x84b7=function(_0x438028,_0x3dc7fb){_0x438028=_0x438028-0x0;var _0xe07257=_0x4b78[_0x438028];return _0xe07257;};'use strict';var _=require('lodash');var util=require(_0x84b7('0x0'));var moment=require(_0x84b7('0x1'));var BPromise=require(_0x84b7('0x2'));var rs=require(_0x84b7('0x3'));var fs=require('fs');var Redis=require(_0x84b7('0x4'));var db=require(_0x84b7('0x5'))['db'];var utils=require(_0x84b7('0x6'));var logger=require(_0x84b7('0x7'))(_0x84b7('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x84b7('0x9')][_0x84b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e9dc8,_0x48269b,_0x5b2348){return new BPromise(function(_0x1786b7,_0x51a571){return client[_0x84b7('0xb')](_0x4e9dc8,_0x5b2348)[_0x84b7('0xc')](function(_0x2a52df){logger[_0x84b7('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0x48269b,_0x84b7('0xe'));logger[_0x84b7('0xf')](_0x84b7('0x10'),_0x48269b,_0x84b7('0xe'),JSON['stringify'](_0x2a52df));if(_0x2a52df['error']){if(_0x2a52df['error'][_0x84b7('0x11')]===0x1f4){logger[_0x84b7('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x48269b,_0x2a52df[_0x84b7('0x12')][_0x84b7('0x13')]);return _0x51a571(_0x2a52df['error'][_0x84b7('0x13')]);}logger[_0x84b7('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x48269b,_0x2a52df[_0x84b7('0x12')][_0x84b7('0x13')]);return _0x1786b7(_0x2a52df[_0x84b7('0x12')][_0x84b7('0x13')]);}else{logger[_0x84b7('0xd')](_0x84b7('0x14'),_0x48269b,_0x84b7('0xe'));_0x1786b7(_0x2a52df[_0x84b7('0x15')]['message']);}})[_0x84b7('0x16')](function(_0xf68e0f){logger[_0x84b7('0x12')](_0x84b7('0x14'),_0x48269b,_0xf68e0f);_0x51a571(_0xf68e0f);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index f596757..7a5d908 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x12e9=['Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./config/seedDB','./rpc','./config/environment','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','seedDB','default','listen','info','start','exitCode','number','\x20processes\x20failed\x20at\x20startup:\x20','map','name','Online\x20apps:','filter','join','Offline\x20apps:','status','online','log','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x12e9,0x66));var _0x912e=function(_0x22141e,_0x489b53){_0x22141e=_0x22141e-0x0;var _0x12539d=_0x12e9[_0x22141e];return _0x12539d;};'use strict';var _=require('lodash');var db=require('./mysqldb')['db'];var seedDb=require(_0x912e('0x0'));var checkLicense=require('./config/license');var rpc=require(_0x912e('0x1'));var config=require(_0x912e('0x2'));var logger=require('./config/logger')(_0x912e('0x3'));var pm2=require(_0x912e('0x4'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x912e('0x5'));var chat=require(_0x912e('0x6'));var whatsapp=require(_0x912e('0x7'));var transcribe=require(_0x912e('0x8'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x912e('0x9')][_0x912e('0xa')]()[_0x912e('0xb')](function(){if(config[_0x912e('0xc')]){return seedDb[_0x912e('0xd')]();}})['then'](function(){return checkLicense['default']();})['then'](function(){return rpc[_0x912e('0xe')]();})[_0x912e('0xb')](function(_0x360119){logger[_0x912e('0xf')](_0x360119);return chat[_0x912e('0x10')]();})['then'](function(){return whatsapp[_0x912e('0x10')]();})[_0x912e('0xb')](function(){return schedule[_0x912e('0x10')]();})[_0x912e('0xb')](function(){return transcribe[_0x912e('0x10')]();})[_0x912e('0xb')](function(){return provider[_0x912e('0x10')]();})[_0x912e('0xb')](function(_0x3c153b){logger[_0x912e('0xf')](_0x3c153b);return pm2[_0x912e('0x10')](pm2Config);})[_0x912e('0xb')](function(_0x536c1b){var _0x3a02aa=_0x536c1b['filter'](function(_0x5144c2){return typeof _0x5144c2[_0x912e('0x11')]===_0x912e('0x12')&&_0x5144c2[_0x912e('0x11')]>=0x0;});if(_0x3a02aa['length']>0x0){throw new Error(_0x3a02aa['length']+_0x912e('0x13')+_[_0x912e('0x14')](_0x3a02aa,function(_0x265614){return'\x22'+_0x265614['pm2_env'][_0x912e('0x15')]+'\x22';}));}logger[_0x912e('0xf')](_0x912e('0x16'),_[_0x912e('0x14')](_[_0x912e('0x17')](_0x536c1b,{'status':'online'}),_0x912e('0x15'))[_0x912e('0x18')]());logger[_0x912e('0xf')](_0x912e('0x19'),_[_0x912e('0x14')](_[_0x912e('0x17')](_0x536c1b,function(_0x1efa84){return _0x1efa84[_0x912e('0x1a')]!==_0x912e('0x1b');}),_0x912e('0x15'))[_0x912e('0x18')]()||'None');console[_0x912e('0x1c')]('App\x20Ready!');})[_0x912e('0x1d')](function(_0x499e80){console[_0x912e('0x1c')](_0x912e('0x1e'),_0x499e80);logger['error'](_0x912e('0x1f'),_0x499e80);process[_0x912e('0x20')](0x1);});}main(); \ No newline at end of file +var _0x1a0b=['catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','sequelize','seedDB','default','then','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','online','join','log'];(function(_0x5d82bb,_0x3c4097){var _0x1f9676=function(_0x35914a){while(--_0x35914a){_0x5d82bb['push'](_0x5d82bb['shift']());}};_0x1f9676(++_0x3c4097);}(_0x1a0b,0x18f));var _0xb1a0=function(_0x466c68,_0x220577){_0x466c68=_0x466c68-0x0;var _0x9c7ba8=_0x1a0b[_0x466c68];return _0x9c7ba8;};'use strict';var _=require(_0xb1a0('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0xb1a0('0x1'));var checkLicense=require(_0xb1a0('0x2'));var rpc=require(_0xb1a0('0x3'));var config=require(_0xb1a0('0x4'));var logger=require(_0xb1a0('0x5'))(_0xb1a0('0x6'));var pm2=require(_0xb1a0('0x7'));var pm2Config=require(_0xb1a0('0x8'));var schedule=require(_0xb1a0('0x9'));var chat=require(_0xb1a0('0xa'));var whatsapp=require(_0xb1a0('0xb'));var transcribe=require('./config/schedule/transcribe');var provider=require('./config/schedule/cloud-provider');function main(){return db[_0xb1a0('0xc')]['sync']()['then'](function(){if(config[_0xb1a0('0xd')]){return seedDb[_0xb1a0('0xe')]();}})[_0xb1a0('0xf')](function(){return checkLicense['default']();})['then'](function(){return rpc[_0xb1a0('0x10')]();})[_0xb1a0('0xf')](function(_0x16c4fb){logger[_0xb1a0('0x11')](_0x16c4fb);return chat[_0xb1a0('0x12')]();})[_0xb1a0('0xf')](function(){return whatsapp['start']();})[_0xb1a0('0xf')](function(){return schedule[_0xb1a0('0x12')]();})[_0xb1a0('0xf')](function(){return transcribe['start']();})[_0xb1a0('0xf')](function(){return provider[_0xb1a0('0x12')]();})[_0xb1a0('0xf')](function(_0x180c44){logger['info'](_0x180c44);return pm2[_0xb1a0('0x12')](pm2Config);})[_0xb1a0('0xf')](function(_0x171d06){var _0x209b89=_0x171d06[_0xb1a0('0x13')](function(_0x3b9724){return typeof _0x3b9724[_0xb1a0('0x14')]===_0xb1a0('0x15')&&_0x3b9724[_0xb1a0('0x14')]>=0x0;});if(_0x209b89[_0xb1a0('0x16')]>0x0){throw new Error(_0x209b89[_0xb1a0('0x16')]+_0xb1a0('0x17')+_[_0xb1a0('0x18')](_0x209b89,function(_0x3e6d71){return'\x22'+_0x3e6d71[_0xb1a0('0x19')][_0xb1a0('0x1a')]+'\x22';}));}logger[_0xb1a0('0x11')]('Online\x20apps:',_['map'](_['filter'](_0x171d06,{'status':'online'}),'name')['join']());logger['info']('Offline\x20apps:',_[_0xb1a0('0x18')](_[_0xb1a0('0x13')](_0x171d06,function(_0x3af888){return _0x3af888['status']!==_0xb1a0('0x1b');}),_0xb1a0('0x1a'))[_0xb1a0('0x1c')]()||'None');console[_0xb1a0('0x1d')]('App\x20Ready!');})[_0xb1a0('0x1e')](function(_0x301514){console[_0xb1a0('0x1d')](_0xb1a0('0x1f'),_0x301514);logger['error'](_0xb1a0('0x20'),_0x301514);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 f366185..c470e2e 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 _0xa41a=['passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','User','name','then','status','json','Wrong\x20credentials.','startsWith','Bearer','query','apikey','getUuid','find','sub','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','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.','updatePasswordsHistory','decryptString','length','splice','unshift','join','promisify','sign','secret','verify','secrets','session','randomBytes','now','toString','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','util','moment','role','fullname','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','lastPauseAt','allowmessenger'];(function(_0x3619e2,_0x292475){var _0x2a5d63=function(_0x3137bc){while(--_0x3137bc){_0x3619e2['push'](_0x3619e2['shift']());}};_0x2a5d63(++_0x292475);}(_0xa41a,0x6b));var _0xaa41=function(_0x1484bb,_0x2ee5bc){_0x1484bb=_0x1484bb-0x0;var _0x4dd0e1=_0xa41a[_0x1484bb];return _0x4dd0e1;};'use strict';var db=require(_0xaa41('0x0'))['db'];var config=require(_0xaa41('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xaa41('0x2'));var encryptor=require(_0xaa41('0x3'));var _=require(_0xaa41('0x4'));var jwt=require(_0xaa41('0x5'));var expressJwt=require(_0xaa41('0x6'));var compose=require(_0xaa41('0x7'));var basicAuth=require(_0xaa41('0x8'));var crypto=require(_0xaa41('0x9'));var BPromise=require('bluebird');var util=require(_0xaa41('0xa'));var moment=require(_0xaa41('0xb'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0xaa41('0xc'),_0xaa41('0xd'),'name',_0xaa41('0xe'),_0xaa41('0xf'),_0xaa41('0x10'),_0xaa41('0x11'),_0xaa41('0x12'),_0xaa41('0x13'),_0xaa41('0x14'),_0xaa41('0x15'),_0xaa41('0x16'),'smsPause',_0xaa41('0x17'),_0xaa41('0x18'),'showWebBar','lastLoginAt',_0xaa41('0x19'),'crudPermissions',_0xaa41('0x1a'),_0xaa41('0x1b'),_0xaa41('0x1c'),_0xaa41('0x1d'),_0xaa41('0x1e'),'phoneBarDnd',_0xaa41('0x1f'),_0xaa41('0x20'),_0xaa41('0x21'),_0xaa41('0x22'),_0xaa41('0x23'),_0xaa41('0x24'),_0xaa41('0x25'),'hotdesk',_0xaa41('0x26'),_0xaa41('0x27'),_0xaa41('0x28'),_0xaa41('0x29'),_0xaa41('0x2a'),_0xaa41('0x2b'),_0xaa41('0x2c'),_0xaa41('0x2d'),_0xaa41('0x2e'),'selectRecallMeCampaign','chatAutoanswer',_0xaa41('0x2f'),_0xaa41('0x30'),_0xaa41('0x31'),'smsAutoanswer',_0xaa41('0x32'),_0xaa41('0x33'),'openchannelAutoanswerDelay','faxAutoanswer',_0xaa41('0x34'),'whatsappAutoanswer',_0xaa41('0x35')];exports[_0xaa41('0x36')]=function(){return this[_0xaa41('0x37')](!![])[_0xaa41('0x38')](function(_0x1d623c,_0x4eb01f,_0x43c430){if(_0x1d623c[_0xaa41('0x39')]){_0x43c430();}else{return db[_0xaa41('0x3a')][_0xaa41('0x3b')]({'where':{'id':_0x1d623c[_0xaa41('0x3c')]['id']},'attributes':['id',_0xaa41('0x3d'),'disposition'],'raw':!![]})['then'](function(_0x16aec5){if(_0x16aec5&&_0x16aec5['closed']){return _0x4eb01f['status'](_0x16aec5[_0xaa41('0x3e')]==='unmanaged'?0x195:0x193)['json']({'message':_0x16aec5[_0xaa41('0x3e')]===_0xaa41('0x3f')?_0xaa41('0x40'):_0xaa41('0x41')});}else{_0x43c430();}})[_0xaa41('0x42')](function(_0xa7269f){_0x43c430(_0xa7269f);});}});};exports['isAuthenticated']=function isAuthenticated(_0x30a174){return compose()[_0xaa41('0x38')](function(_0x63c18c,_0x9a16e3,_0x1d8c2b){var _0x4466a3;if(_0x63c18c[_0xaa41('0x43')][_0xaa41('0x44')]){if(_['startsWith'](_0x63c18c[_0xaa41('0x43')]['authorization'],'Basic')){var _0x714537=basicAuth(_0x63c18c);db[_0xaa41('0x45')]['find']({'where':{'name':_0x714537[_0xaa41('0x46')]}})[_0xaa41('0x47')](function(_0x4e3b44){if(!_0x4e3b44||!_0x4e3b44['authenticate'](_0x714537['pass'])){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x4a')});}_0x63c18c[_0xaa41('0x39')]={'id':_0x4e3b44['id']};_0x1d8c2b();})['catch'](function(_0x289c4a){_0x1d8c2b(_0x289c4a);});}else if(_[_0xaa41('0x4b')](_0x63c18c[_0xaa41('0x43')]['authorization'],_0xaa41('0x4c'))){validateJwt(_0x63c18c,_0x9a16e3,_0x1d8c2b);}else{if(_0x30a174){_0x1d8c2b();}else{return _0x9a16e3[_0xaa41('0x48')](0x193)[_0xaa41('0x49')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x63c18c[_0xaa41('0x4d')][_0xaa41('0x4e')]){try{var _0x57fe1d={'audience':hardwareConf[_0xaa41('0x4f')](),'issuer':hardwareConf[_0xaa41('0x4f')]()};verifyJwt(_0x63c18c[_0xaa41('0x4d')]['apikey'],_0x57fe1d)[_0xaa41('0x47')](function(_0x48335f){return db[_0xaa41('0x45')][_0xaa41('0x50')]({'where':{'id':_0x48335f[_0xaa41('0x51')]}})['then'](function(_0x526377){_0x4466a3=_0x526377;return db['Setting'][_0xaa41('0x3b')]({'where':{'id':0x1},'attributes':[_0xaa41('0x52'),_0xaa41('0x53')],'raw':!![]});})[_0xaa41('0x47')](function(_0x4fbb92){if(!_0x4466a3||!_['isEqual'](_0x4466a3[_0xaa41('0x54')],_0x48335f[_0xaa41('0x55')])){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x56')});}if(_0x4466a3[_0xaa41('0x57')]){return _0x9a16e3[_0xaa41('0x48')](0x191)['json']({'message':_0xaa41('0x58')});}if(_0x4466a3[_0xaa41('0x59')]){if(_0x4fbb92[_0xaa41('0x53')]>0x0){if(moment(_0x4466a3[_0xaa41('0x5a')])['add'](_0x4fbb92['blockDuration'],_0xaa41('0x5b'))>moment()){return _0x9a16e3[_0xaa41('0x48')](0x191)['json']({'message':_0xaa41('0x58')});}}else{return _0x9a16e3['status'](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x58')});}}_0x63c18c[_0xaa41('0x39')]={'id':_0x4466a3['id']};_0x1d8c2b();});})[_0xaa41('0x42')](function(){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x58')});});}catch(_0x21f204){_0x1d8c2b(_0x21f204);}}else if(_0x30a174){_0x1d8c2b();}else{return _0x9a16e3['status'](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5c')});}})[_0xaa41('0x38')](function(_0x398c35,_0xc84fb8,_0x1e2eb2){if(_0x398c35['user']){db['User'][_0xaa41('0x50')]({'where':{'id':_0x398c35['user']['id']},'attributes':userAttributes})[_0xaa41('0x47')](function(_0x215896){if(!_0x215896){return _0xc84fb8[_0xaa41('0x48')](0x194)[_0xaa41('0x49')]({'message':_0xaa41('0x5d')});}_0x398c35[_0xaa41('0x39')]=_0x215896;_0x1e2eb2();})[_0xaa41('0x42')](function(_0x5ee74c){_0x1e2eb2(_0x5ee74c);});}else if(_0x30a174){_0x1e2eb2();}else{return _0xc84fb8[_0xaa41('0x48')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xaa41('0x5e')]=function canUpdate(){return compose()['use'](function(_0x57240d,_0x5274c9,_0x3bad48){return licenseUtil['getLicense']()[_0xaa41('0x47')](function(_0x198716){if(_0x198716['update']){_0x3bad48();}else{return _0x5274c9['status'](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5f')});}})[_0xaa41('0x42')](function(_0x2af8ba){_0x3bad48(_0x2af8ba);});});};exports[_0xaa41('0x60')]=function isWebrtcLicence(){return compose()[_0xaa41('0x38')](function(_0x258096,_0x37bf5d,_0x2fa6ec){return licenseUtil['getLicense']()[_0xaa41('0x47')](function(_0x22d512){if(_0x22d512[_0xaa41('0x61')]){_0x2fa6ec();}else{return _0x37bf5d[_0xaa41('0x48')](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5f')});}})['catch'](function(_0x406824){_0x2fa6ec(_0x406824);});});};exports[_0xaa41('0x62')]=function(_0x1f50c,_0x2288f8,_0x57d1f6){_0x1f50c[_0xaa41('0x62')]=!![];return _0x57d1f6();};exports['signToken']=function signToken(_0x49fedd){return signJwt(_0x49fedd);};exports[_0xaa41('0x63')]=function(_0xe0eec0,_0x3e16ef){if(!_0xe0eec0['user']){return _0x3e16ef[_0xaa41('0x48')](0x194)[_0xaa41('0x49')]({'message':_0xaa41('0x64')});}var _0x48fa37={'payload':{'id':_0xe0eec0[_0xaa41('0x39')]['id'],'role':_0xe0eec0[_0xaa41('0x39')][_0xaa41('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x48fa37)[_0xaa41('0x47')](function(_0x37fbe2){_0x3e16ef[_0xaa41('0x65')](_0xaa41('0x66'),_0x37fbe2);_0x3e16ef[_0xaa41('0x67')]('/dashboards/general');})[_0xaa41('0x42')](function(_0x5bef5f){return _0x3e16ef['status'](0x1f4)[_0xaa41('0x68')](_0x5bef5f);});};exports[_0xaa41('0x69')]=function(_0x3fef3e){if(_[_0xaa41('0x6a')](_0x3fef3e[_0xaa41('0x54')])||_[_0xaa41('0x6a')](_0x3fef3e[_0xaa41('0x6b')])){return null;}else{return createJwt(_0x3fef3e);}};exports[_0xaa41('0x6c')]=function(_0x519e39){_0x519e39[_0xaa41('0x54')]=generateNonce();_0x519e39[_0xaa41('0x6b')]=generateIssuedAt();return createJwt(_0x519e39);};exports[_0xaa41('0x6d')]=function(_0x4f9e92,_0x2e0f53){var _0x35f664=_0x4f9e92['query'][_0xaa41('0x4e')];if(_0x35f664){var _0xd36d1a={'nonce':_0x2e0f53[_0xaa41('0x54')],'iat':_0x2e0f53['apiKeyIat'],'audience':hardwareConf[_0xaa41('0x4f')](),'issuer':hardwareConf[_0xaa41('0x4f')]()};return verifyJwt(_0x35f664,_0xd36d1a)['then'](function(){return generateApiKey(_0x2e0f53);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xaa41('0x6e')]=function(_0x3cd14f){var _0x3a29d2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3a29d2['test'](_0x3cd14f))throw new db[(_0xaa41('0x6f'))][(_0xaa41('0x70'))](_0xaa41('0x71'));return;};exports[_0xaa41('0x72')]=function(_0x2abb78,_0x5ccdc5,_0x2ae70c){var _0x57cb70=encryptor['decryptString'](_0x5ccdc5)[_0xaa41('0x73')](',');for(var _0x52ae7f=0x0;_0x52ae7f<_0x2ae70c;_0x52ae7f++){if(!_0x57cb70[_0x52ae7f])break;if(_0x2abb78[_0xaa41('0x74')]()===_0x57cb70[_0x52ae7f][_0xaa41('0x74')]()){var _0x169ddf=util['format'](_0xaa41('0x75'),_0x2ae70c);if(_0x2ae70c===0x1){_0x169ddf=_0xaa41('0x76');}throw new db[(_0xaa41('0x6f'))][(_0xaa41('0x70'))](_0x169ddf);}}return;};exports[_0xaa41('0x77')]=function(_0x332a3c,_0xc56018){var _0x337059=_0xc56018?encryptor[_0xaa41('0x78')](_0xc56018)['split'](','):[];if(_0x337059[_0xaa41('0x79')]===0x5){_0x337059[_0xaa41('0x7a')](-0x1,0x1);}_0x337059[_0xaa41('0x7b')](_0x332a3c);return encryptor['encryptString'](_0x337059[_0xaa41('0x7c')](','));};function signJwt(_0x2caf5c){var _0x157898=BPromise[_0xaa41('0x7d')](jwt[_0xaa41('0x7e')],{'context':jwt});var _0xfbe748=_0x2caf5c[_0xaa41('0x7f')]||config['secrets']['session'];return new BPromise(function(_0x5cb34d,_0x540325){_0x157898(_0x2caf5c['payload'],_0xfbe748,_0x2caf5c['options'])[_0xaa41('0x47')](function(_0x50b598){_0x5cb34d(_0x50b598);})['catch'](function(_0x24c6f3){_0x540325(_0x24c6f3);});});}function verifyJwt(_0x40a524,_0x1a877b,_0x312eee){var _0x5cabc4=BPromise[_0xaa41('0x7d')](jwt[_0xaa41('0x80')],{'context':jwt});var _0x1ddb6c=_0x312eee||config[_0xaa41('0x81')][_0xaa41('0x82')];return new BPromise(function(_0x41ca40,_0x46ebcd){_0x5cabc4(_0x40a524,_0x1ddb6c,_0x1a877b)[_0xaa41('0x47')](function(_0x1795d1){_0x41ca40(_0x1795d1);})['catch'](function(_0x185600){_0x46ebcd(_0x185600);});});}function generateNonce(){return crypto[_0xaa41('0x83')](0x10)['toString']('hex');}function generateIssuedAt(){return Math['floor'](Date[_0xaa41('0x84')]()/0x3e8)['toString']();}function createJwt(_0x1eac4a){var _0x5c8028={'payload':{'iat':_0x1eac4a[_0xaa41('0x6b')],'nonce':_0x1eac4a[_0xaa41('0x54')]},'options':{'algorithm':'HS512','subject':_0x1eac4a['id'][_0xaa41('0x85')](),'issuer':hardwareConf[_0xaa41('0x4f')](),'audience':hardwareConf[_0xaa41('0x4f')]()}};return signJwt(_0x5c8028)[_0xaa41('0x47')](function(_0x5a2683){return{'iat':_0x1eac4a['apiKeyIat'],'nonce':_0x1eac4a[_0xaa41('0x54')],'token':_0x5a2683};});} \ No newline at end of file +var _0x34e8=['validatePasswordPattern','test','Sequelize','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','splice','unshift','encryptString','join','promisify','sign','secret','secrets','payload','options','verify','toString','hex','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','session','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','user','ChatInteraction','params','closed','disposition','unmanaged','Unmanaged.','Forbidden.','catch','authorization','startsWith','headers','Basic','User','find','pass','status','json','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','getUuid','then','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','minutes','User\x20not\x20found.','canUpdate','use','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','send','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'];(function(_0x3cdc8a,_0x4bf272){var _0x5af324=function(_0x4b0539){while(--_0x4b0539){_0x3cdc8a['push'](_0x3cdc8a['shift']());}};_0x5af324(++_0x4bf272);}(_0x34e8,0x12c));var _0x834e=function(_0x4a7d53,_0xcb3c3a){_0x4a7d53=_0x4a7d53-0x0;var _0x268c62=_0x34e8[_0x4a7d53];return _0x268c62;};'use strict';var db=require(_0x834e('0x0'))['db'];var config=require(_0x834e('0x1'));var hardwareConf=require(_0x834e('0x2'));var licenseUtil=require(_0x834e('0x3'));var encryptor=require('../encryptor');var _=require(_0x834e('0x4'));var jwt=require(_0x834e('0x5'));var expressJwt=require(_0x834e('0x6'));var compose=require(_0x834e('0x7'));var basicAuth=require(_0x834e('0x8'));var crypto=require(_0x834e('0x9'));var BPromise=require(_0x834e('0xa'));var util=require('util');var moment=require(_0x834e('0xb'));var validateJwt=expressJwt({'secret':config['secrets'][_0x834e('0xc')]});var userAttributes=['id',_0x834e('0xd'),_0x834e('0xe'),_0x834e('0xf'),_0x834e('0x10'),_0x834e('0x11'),_0x834e('0x12'),_0x834e('0x13'),_0x834e('0x14'),_0x834e('0x15'),_0x834e('0x16'),_0x834e('0x17'),_0x834e('0x18'),_0x834e('0x19'),_0x834e('0x1a'),_0x834e('0x1b'),_0x834e('0x1c'),'lastLoginAt',_0x834e('0x1d'),_0x834e('0x1e'),'allowmessenger',_0x834e('0x1f'),_0x834e('0x20'),_0x834e('0x21'),_0x834e('0x22'),'phoneBarDnd',_0x834e('0x23'),_0x834e('0x24'),'phoneBarEnableSettings',_0x834e('0x25'),'phoneBarPrefixRequired',_0x834e('0x26'),_0x834e('0x27'),'hotdesk',_0x834e('0x28'),_0x834e('0x29'),_0x834e('0x2a'),'settingsEnabled',_0x834e('0x2b'),_0x834e('0x2c'),_0x834e('0x2d'),_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x30'),_0x834e('0x31'),'chatAutoanswerDelay',_0x834e('0x32'),_0x834e('0x33'),_0x834e('0x34'),_0x834e('0x35'),'openchannelAutoanswer',_0x834e('0x36'),_0x834e('0x37'),'faxAutoanswerDelay',_0x834e('0x38'),_0x834e('0x39')];exports[_0x834e('0x3a')]=function(){return this['isAuthenticated'](!![])['use'](function(_0x231619,_0x34563b,_0x589dde){if(_0x231619[_0x834e('0x3b')]){_0x589dde();}else{return db[_0x834e('0x3c')]['findOne']({'where':{'id':_0x231619[_0x834e('0x3d')]['id']},'attributes':['id',_0x834e('0x3e'),_0x834e('0x3f')],'raw':!![]})['then'](function(_0x24fcf7){if(_0x24fcf7&&_0x24fcf7[_0x834e('0x3e')]){return _0x34563b['status'](_0x24fcf7['disposition']===_0x834e('0x40')?0x195:0x193)['json']({'message':_0x24fcf7[_0x834e('0x3f')]===_0x834e('0x40')?_0x834e('0x41'):_0x834e('0x42')});}else{_0x589dde();}})[_0x834e('0x43')](function(_0x130cc5){_0x589dde(_0x130cc5);});}});};exports['isAuthenticated']=function isAuthenticated(_0x510780){return compose()['use'](function(_0x58c1d7,_0x2c7a8d,_0x567cea){var _0x106d6a;if(_0x58c1d7['headers'][_0x834e('0x44')]){if(_[_0x834e('0x45')](_0x58c1d7[_0x834e('0x46')][_0x834e('0x44')],_0x834e('0x47'))){var _0x390119=basicAuth(_0x58c1d7);db[_0x834e('0x48')][_0x834e('0x49')]({'where':{'name':_0x390119[_0x834e('0xf')]}})['then'](function(_0xef9ec2){if(!_0xef9ec2||!_0xef9ec2['authenticate'](_0x390119[_0x834e('0x4a')])){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x4d')});}_0x58c1d7[_0x834e('0x3b')]={'id':_0xef9ec2['id']};_0x567cea();})[_0x834e('0x43')](function(_0x4696a1){_0x567cea(_0x4696a1);});}else if(_[_0x834e('0x45')](_0x58c1d7[_0x834e('0x46')][_0x834e('0x44')],'Bearer')){validateJwt(_0x58c1d7,_0x2c7a8d,_0x567cea);}else{if(_0x510780){_0x567cea();}else{return _0x2c7a8d[_0x834e('0x4b')](0x193)[_0x834e('0x4c')]({'message':_0x834e('0x4e')});}}}else if(_0x58c1d7[_0x834e('0x4f')]['apikey']){try{var _0x3f88ad={'audience':hardwareConf[_0x834e('0x50')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x58c1d7['query']['apikey'],_0x3f88ad)[_0x834e('0x51')](function(_0x41bf4d){return db[_0x834e('0x48')][_0x834e('0x49')]({'where':{'id':_0x41bf4d[_0x834e('0x52')]}})[_0x834e('0x51')](function(_0x4c2ef6){_0x106d6a=_0x4c2ef6;return db[_0x834e('0x53')]['findOne']({'where':{'id':0x1},'attributes':[_0x834e('0x54'),_0x834e('0x55')],'raw':!![]});})['then'](function(_0x18ac3b){if(!_0x106d6a||!_[_0x834e('0x56')](_0x106d6a['apiKeyNonce'],_0x41bf4d['nonce'])){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x57')});}if(_0x106d6a[_0x834e('0x58')]){return _0x2c7a8d[_0x834e('0x4b')](0x191)['json']({'message':_0x834e('0x59')});}if(_0x106d6a['blocked']){if(_0x18ac3b['blockDuration']>0x0){if(moment(_0x106d6a[_0x834e('0x5a')])['add'](_0x18ac3b[_0x834e('0x55')],_0x834e('0x5b'))>moment()){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x59')});}}else{return _0x2c7a8d['status'](0x191)[_0x834e('0x4c')]({'message':_0x834e('0x59')});}}_0x58c1d7[_0x834e('0x3b')]={'id':_0x106d6a['id']};_0x567cea();});})['catch'](function(){return _0x2c7a8d[_0x834e('0x4b')](0x191)[_0x834e('0x4c')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x1e3e71){_0x567cea(_0x1e3e71);}}else if(_0x510780){_0x567cea();}else{return _0x2c7a8d['status'](0x193)[_0x834e('0x4c')]({'message':_0x834e('0x4e')});}})['use'](function(_0x4a6942,_0x22ea21,_0x16969b){if(_0x4a6942[_0x834e('0x3b')]){db[_0x834e('0x48')][_0x834e('0x49')]({'where':{'id':_0x4a6942[_0x834e('0x3b')]['id']},'attributes':userAttributes})[_0x834e('0x51')](function(_0x4a3381){if(!_0x4a3381){return _0x22ea21[_0x834e('0x4b')](0x194)['json']({'message':_0x834e('0x5c')});}_0x4a6942['user']=_0x4a3381;_0x16969b();})[_0x834e('0x43')](function(_0x5a5807){_0x16969b(_0x5a5807);});}else if(_0x510780){_0x16969b();}else{return _0x22ea21[_0x834e('0x4b')](0x194)[_0x834e('0x4c')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x834e('0x5d')]=function canUpdate(){return compose()[_0x834e('0x5e')](function(_0xa880cb,_0xd55cc3,_0x252ea0){return licenseUtil[_0x834e('0x5f')]()[_0x834e('0x51')](function(_0x3ccd8e){if(_0x3ccd8e[_0x834e('0x60')]){_0x252ea0();}else{return _0xd55cc3[_0x834e('0x4b')](0x193)['json']({'message':_0x834e('0x61')});}})[_0x834e('0x43')](function(_0x47a8a9){_0x252ea0(_0x47a8a9);});});};exports[_0x834e('0x62')]=function isWebrtcLicence(){return compose()[_0x834e('0x5e')](function(_0x25b035,_0x2112d5,_0x19b5ef){return licenseUtil[_0x834e('0x5f')]()['then'](function(_0x59c855){if(_0x59c855[_0x834e('0x63')]){_0x19b5ef();}else{return _0x2112d5[_0x834e('0x4b')](0x193)[_0x834e('0x4c')]({'message':_0x834e('0x61')});}})[_0x834e('0x43')](function(_0xd1d83b){_0x19b5ef(_0xd1d83b);});});};exports[_0x834e('0x64')]=function(_0x43f599,_0x1419eb,_0x390c45){_0x43f599[_0x834e('0x64')]=!![];return _0x390c45();};exports[_0x834e('0x65')]=function signToken(_0x1a28f6){return signJwt(_0x1a28f6);};exports[_0x834e('0x66')]=function(_0x2aa072,_0x1a3855){if(!_0x2aa072[_0x834e('0x3b')]){return _0x1a3855[_0x834e('0x4b')](0x194)[_0x834e('0x4c')]({'message':_0x834e('0x67')});}var _0x4cfacd={'payload':{'id':_0x2aa072[_0x834e('0x3b')]['id'],'role':_0x2aa072[_0x834e('0x3b')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x4cfacd)[_0x834e('0x51')](function(_0x3b0988){_0x1a3855['cookie'](_0x834e('0x68'),_0x3b0988);_0x1a3855[_0x834e('0x69')](_0x834e('0x6a'));})[_0x834e('0x43')](function(_0x4288e4){return _0x1a3855[_0x834e('0x4b')](0x1f4)[_0x834e('0x6b')](_0x4288e4);});};exports['retrieveApiKey']=function(_0x1ad7fe){if(_[_0x834e('0x6c')](_0x1ad7fe[_0x834e('0x6d')])||_[_0x834e('0x6c')](_0x1ad7fe[_0x834e('0x6e')])){return null;}else{return createJwt(_0x1ad7fe);}};exports[_0x834e('0x6f')]=function(_0x344b51){_0x344b51[_0x834e('0x6d')]=generateNonce();_0x344b51['apiKeyIat']=generateIssuedAt();return createJwt(_0x344b51);};exports[_0x834e('0x70')]=function(_0x4dc104,_0x2f4bde){var _0x53a9ee=_0x4dc104[_0x834e('0x4f')]['apikey'];if(_0x53a9ee){var _0x527eef={'nonce':_0x2f4bde[_0x834e('0x6d')],'iat':_0x2f4bde[_0x834e('0x6e')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x53a9ee,_0x527eef)[_0x834e('0x51')](function(){return generateApiKey(_0x2f4bde);});}else{throw{'message':_0x834e('0x71')};}};exports[_0x834e('0x72')]=function(_0x387365){var _0x21c417=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x21c417[_0x834e('0x73')](_0x387365))throw new db[(_0x834e('0x74'))][(_0x834e('0x75'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x834e('0x76')]=function(_0x3c70bf,_0x5d5ac2,_0x281342){var _0x4e2b22=encryptor[_0x834e('0x77')](_0x5d5ac2)[_0x834e('0x78')](',');for(var _0x5160c4=0x0;_0x5160c4<_0x281342;_0x5160c4++){if(!_0x4e2b22[_0x5160c4])break;if(_0x3c70bf[_0x834e('0x79')]()===_0x4e2b22[_0x5160c4][_0x834e('0x79')]()){var _0x2de29a=util[_0x834e('0x7a')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x281342);if(_0x281342===0x1){_0x2de29a=_0x834e('0x7b');}throw new db[(_0x834e('0x74'))][(_0x834e('0x75'))](_0x2de29a);}}return;};exports['updatePasswordsHistory']=function(_0x246b8e,_0x1fcae9){var _0x3a7683=_0x1fcae9?encryptor[_0x834e('0x77')](_0x1fcae9)[_0x834e('0x78')](','):[];if(_0x3a7683[_0x834e('0x7c')]===0x5){_0x3a7683[_0x834e('0x7d')](-0x1,0x1);}_0x3a7683[_0x834e('0x7e')](_0x246b8e);return encryptor[_0x834e('0x7f')](_0x3a7683[_0x834e('0x80')](','));};function signJwt(_0x1e4310){var _0x1dfa95=BPromise[_0x834e('0x81')](jwt[_0x834e('0x82')],{'context':jwt});var _0x460a7a=_0x1e4310[_0x834e('0x83')]||config[_0x834e('0x84')][_0x834e('0xc')];return new BPromise(function(_0x193a15,_0x3e3467){_0x1dfa95(_0x1e4310[_0x834e('0x85')],_0x460a7a,_0x1e4310[_0x834e('0x86')])['then'](function(_0x2145cf){_0x193a15(_0x2145cf);})[_0x834e('0x43')](function(_0x45bcc2){_0x3e3467(_0x45bcc2);});});}function verifyJwt(_0x36cc14,_0x4ca099,_0x30faa8){var _0x5a9c70=BPromise['promisify'](jwt[_0x834e('0x87')],{'context':jwt});var _0x2b1ec7=_0x30faa8||config[_0x834e('0x84')][_0x834e('0xc')];return new BPromise(function(_0x216105,_0x3821ad){_0x5a9c70(_0x36cc14,_0x2b1ec7,_0x4ca099)[_0x834e('0x51')](function(_0xe5c8f6){_0x216105(_0xe5c8f6);})['catch'](function(_0xdef8c4){_0x3821ad(_0xdef8c4);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x834e('0x88')](_0x834e('0x89'));}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0x834e('0x88')]();}function createJwt(_0x82f2a7){var _0x363cc2={'payload':{'iat':_0x82f2a7[_0x834e('0x6e')],'nonce':_0x82f2a7[_0x834e('0x6d')]},'options':{'algorithm':'HS512','subject':_0x82f2a7['id'][_0x834e('0x88')](),'issuer':hardwareConf[_0x834e('0x50')](),'audience':hardwareConf[_0x834e('0x50')]()}};return signJwt(_0x363cc2)[_0x834e('0x51')](function(_0x3181af){return{'iat':_0x82f2a7[_0x834e('0x6e')],'nonce':_0x82f2a7[_0x834e('0x6d')],'token':_0x3181af};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 2702881..604ff03 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 _0x5f2f=['rows','catch','keys','filter','startsWith','cf_','map','CmCustomField','findOne','slice','length','fieldType','type','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseQueryParameters','where','fields','user','clause','tags','skip','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts'];(function(_0x21800e,_0x3b5490){var _0x463dbc=function(_0xdb07e2){while(--_0xdb07e2){_0x21800e['push'](_0x21800e['shift']());}};_0x463dbc(++_0x3b5490);}(_0x5f2f,0x73));var _0xf5f2=function(_0x217d9a,_0x3700e8){_0x217d9a=_0x217d9a-0x0;var _0x4aabeb=_0x5f2f[_0x217d9a];return _0x4aabeb;};'use strict';var _=require(_0xf5f2('0x0'));var sqlUtils=require(_0xf5f2('0x1'));var db=require(_0xf5f2('0x2'))['db'];exports[_0xf5f2('0x3')]=function(_0x1172dd,_0x174bc7,_0x3c72ee,_0x107cf){var _0x501fbd={'count':0x0,'rows':[]};var _0x4854b6=sqlUtils[_0xf5f2('0x4')](_0x174bc7,_0x1172dd);if(_0x4854b6){return Promise[_0xf5f2('0x5')](_0x501fbd);}var _0xad7f65=sqlUtils[_0xf5f2('0x6')]();var _0x3133bc={};var _0x473100=![];var _0x5907aa=![];return Promise[_0xf5f2('0x5')]()[_0xf5f2('0x7')](function(){if(_0x1172dd[_0xf5f2('0x8')]){return sqlUtils['parseAdvancedSearchFilter'](_0x1172dd[_0xf5f2('0x8')],_0x107cf);}else{return sqlUtils[_0xf5f2('0x9')](_0x1172dd,_0x107cf);}})[_0xf5f2('0x7')](function(_0x4e0e6b){_0xad7f65[_0xf5f2('0xa')](_0x4e0e6b['default']);_0xad7f65['where'](_0x4e0e6b[_0xf5f2('0xb')]);_0xad7f65[_0xf5f2('0xa')](_0x4e0e6b['filter']);_0xad7f65[_0xf5f2('0xa')](_0x4e0e6b[_0xf5f2('0xc')][_0xf5f2('0xd')]);_0x3133bc=_0x4e0e6b[_0xf5f2('0xe')];_0x5907aa=_0x4e0e6b[_0xf5f2('0xc')][_0xf5f2('0xf')];return sqlUtils['checkListsRestrictions'](_0x174bc7,_0x1172dd,_0x5907aa);})[_0xf5f2('0x7')](function(_0xea612c){_0xad7f65[_0xf5f2('0xa')](_0xea612c);var _0x1c1a5c=_0x1172dd[_0xf5f2('0x8')]?_0x3133bc['ids']:_0x1172dd[_0xf5f2('0x10')];_0x473100=_0x1c1a5c?!![]:![];return sqlUtils[_0xf5f2('0x11')](_0xad7f65,_0x1c1a5c);})[_0xf5f2('0x7')](function(_0x1b6dd2){_0x501fbd[_0xf5f2('0x12')]=_0x1b6dd2;if(_0x501fbd[_0xf5f2('0x12')]===0x0){return;}return sqlUtils[_0xf5f2('0x13')](_0xad7f65,_0x1172dd[_0xf5f2('0xb')],_0x3c72ee,_0x473100,_0x3133bc[_0xf5f2('0xd')],_0x5907aa);})[_0xf5f2('0x7')](function(_0x20fccd){if(!_0x20fccd){return[];}return sqlUtils[_0xf5f2('0x14')](_0x20fccd,_0x1172dd,_0x3c72ee);})[_0xf5f2('0x7')](function(_0x3ee69){_0x501fbd[_0xf5f2('0x15')]=_0x3ee69;return _0x501fbd;})[_0xf5f2('0x16')](function(_0x1bf655){throw _0x1bf655;});};exports['describe']=function(){var _0x34706d={};var _0x47101e=[];return db['CmContact']['describe']()[_0xf5f2('0x7')](function(_0x388e6c){_0x34706d=_0x388e6c;var _0x4ae323=Object[_0xf5f2('0x17')](_0x34706d)[_0xf5f2('0x18')](function(_0x39e44a){return _[_0xf5f2('0x19')](_0x39e44a,_0xf5f2('0x1a'))?_0x39e44a:undefined;});var _0x4c691a=_0x4ae323[_0xf5f2('0x1b')](function(_0x4669a6){return db[_0xf5f2('0x1c')][_0xf5f2('0x1d')]({'where':{'id':_0x4669a6[_0xf5f2('0x1e')](0x3)},'raw':!![]});});return Promise['all'](_0x4c691a);})['then'](function(_0x5f1124){for(var _0x3f79d5=0x0;_0x3f79d5<_0x5f1124[_0xf5f2('0x1f')];_0x3f79d5++){if(_0x5f1124[_0x3f79d5]){var _0x1a5bb3=_0xf5f2('0x1a')+_0x5f1124[_0x3f79d5]['id'];_0x34706d[_0x1a5bb3][_0xf5f2('0x20')]=_0x5f1124[_0x3f79d5][_0xf5f2('0x21')];}}_0x47101e=_[_0xf5f2('0x1b')](Object[_0xf5f2('0x17')](_0x34706d),function(_0x4ab014){return{'name':_0x4ab014,'type':_0x34706d[_0x4ab014][_0xf5f2('0x21')]};});return _0x47101e;})[_0xf5f2('0x16')](function(_0x375ca8){throw _0x375ca8;});}; \ No newline at end of file +var _0x0b0e=['tags','skip','tag','count','getFilteredContacts','catch','CmContact','keys','cf_','map','findOne','all','length','type','lodash','../../mysqldb','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','user','clause'];(function(_0x3f0fd0,_0x599d6f){var _0x3ee3f8=function(_0x4124a1){while(--_0x4124a1){_0x3f0fd0['push'](_0x3f0fd0['shift']());}};_0x3ee3f8(++_0x599d6f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5d5c49,_0x528f94){_0x5d5c49=_0x5d5c49-0x0;var _0x41cb72=_0x0b0e[_0x5d5c49];return _0x41cb72;};'use strict';var _=require(_0xe0b0('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xe0b0('0x1'))['db'];exports['findAll']=function(_0x7e5a8a,_0xdf715e,_0x3b5e2b,_0x25153a){var _0x28040c={'count':0x0,'rows':[]};var _0x38a058=sqlUtils[_0xe0b0('0x2')](_0xdf715e,_0x7e5a8a);if(_0x38a058){return Promise[_0xe0b0('0x3')](_0x28040c);}var _0x30e20d=sqlUtils[_0xe0b0('0x4')]();var _0x219b1c={};var _0x5cf9cc=![];var _0x50be7f=![];return Promise[_0xe0b0('0x3')]()[_0xe0b0('0x5')](function(){if(_0x7e5a8a[_0xe0b0('0x6')]){return sqlUtils[_0xe0b0('0x7')](_0x7e5a8a['search'],_0x25153a);}else{return sqlUtils[_0xe0b0('0x8')](_0x7e5a8a,_0x25153a);}})[_0xe0b0('0x5')](function(_0x553d4f){_0x30e20d[_0xe0b0('0x9')](_0x553d4f[_0xe0b0('0xa')]);_0x30e20d['where'](_0x553d4f[_0xe0b0('0xb')]);_0x30e20d[_0xe0b0('0x9')](_0x553d4f[_0xe0b0('0xc')]);_0x30e20d['where'](_0x553d4f[_0xe0b0('0xd')][_0xe0b0('0xe')]);_0x219b1c=_0x553d4f[_0xe0b0('0xf')];_0x50be7f=_0x553d4f[_0xe0b0('0xd')][_0xe0b0('0x10')];return sqlUtils['checkListsRestrictions'](_0xdf715e,_0x7e5a8a,_0x50be7f);})[_0xe0b0('0x5')](function(_0x154de6){_0x30e20d[_0xe0b0('0x9')](_0x154de6);var _0x24babd=_0x7e5a8a[_0xe0b0('0x6')]?_0x219b1c['ids']:_0x7e5a8a[_0xe0b0('0x11')];_0x5cf9cc=_0x24babd?!![]:![];return sqlUtils['countFilteredContacts'](_0x30e20d,_0x24babd);})[_0xe0b0('0x5')](function(_0xadee6e){_0x28040c['count']=_0xadee6e;if(_0x28040c[_0xe0b0('0x12')]===0x0){return;}return sqlUtils['buildContactsQuery'](_0x30e20d,_0x7e5a8a[_0xe0b0('0xb')],_0x3b5e2b,_0x5cf9cc,_0x219b1c[_0xe0b0('0xe')],_0x50be7f);})['then'](function(_0x54a3eb){if(!_0x54a3eb){return[];}return sqlUtils[_0xe0b0('0x13')](_0x54a3eb,_0x7e5a8a,_0x3b5e2b);})['then'](function(_0x4df8da){_0x28040c['rows']=_0x4df8da;return _0x28040c;})[_0xe0b0('0x14')](function(_0x50fa4a){throw _0x50fa4a;});};exports['describe']=function(){var _0x10cde1={};var _0x59dff5=[];return db[_0xe0b0('0x15')]['describe']()[_0xe0b0('0x5')](function(_0x1cd7c4){_0x10cde1=_0x1cd7c4;var _0x3e10b3=Object[_0xe0b0('0x16')](_0x10cde1)[_0xe0b0('0xc')](function(_0x58b804){return _['startsWith'](_0x58b804,_0xe0b0('0x17'))?_0x58b804:undefined;});var _0x5512bb=_0x3e10b3[_0xe0b0('0x18')](function(_0x31b5f8){return db['CmCustomField'][_0xe0b0('0x19')]({'where':{'id':_0x31b5f8['slice'](0x3)},'raw':!![]});});return Promise[_0xe0b0('0x1a')](_0x5512bb);})['then'](function(_0x28586d){for(var _0x576352=0x0;_0x576352<_0x28586d[_0xe0b0('0x1b')];_0x576352++){if(_0x28586d[_0x576352]){var _0x4de537=_0xe0b0('0x17')+_0x28586d[_0x576352]['id'];_0x10cde1[_0x4de537]['fieldType']=_0x28586d[_0x576352][_0xe0b0('0x1c')];}}_0x59dff5=_['map'](Object[_0xe0b0('0x16')](_0x10cde1),function(_0x3c3bc2){return{'name':_0x3c3bc2,'type':_0x10cde1[_0x3c3bc2][_0xe0b0('0x1c')]};});return _0x59dff5;})[_0xe0b0('0x14')](function(_0x3ec2){throw _0x3ec2;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index b86bae1..00fb052 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 _0xbe65=['CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','conditions','find','fieldType','datetime','castTo','buildExpression','type','default','value','start','end','split','map','tags','clause','and','ids','uc.UserId\x20=\x20?','skip','keys','some','name','compact','Contact','concat','\x20=\x20?','resolve','then','tag','filter','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','order','DESC','subqry.','findAll','SELECT','CmContact','sequelize','query','toString','Tags','push','clone','isEmpty','where','t.id\x20IN\x20?','Sequelize','QueryTypes','COUNT(*)','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','agent','search','ListId','select','from','cm_contacts','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','left_join','cm_contact_has_tags','tools_tags','t.id\x20=\x20ct.TagId','lastName','phone','mobile','fax','email','CompanyId','updatedAt','deletedAt','TagIds','includes','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xbe65,0x17b));var _0x5be6=function(_0x48ea83,_0xb7b30b){_0x48ea83=_0x48ea83-0x0;var _0x1f6925=_0xbe65[_0x48ea83];return _0x1f6925;};'use strict';var _=require('lodash');var squel=require(_0x5be6('0x0'));var as=require(_0x5be6('0x1'));var qs=require(_0x5be6('0x2'));var utils=require(_0x5be6('0x3'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0xe13ccb,_0x209caf){var _0x1c9b1d=![];if(_0xe13ccb['role']===_0x5be6('0x4')&&!_0x209caf[_0x5be6('0x5')]&&!_0x209caf[_0x5be6('0x6')]&&_0x209caf['autocomplete']!=='true'){_0x1c9b1d=!![];}return _0x1c9b1d;}function getContactsSubquery(){return squel[_0x5be6('0x7')]()[_0x5be6('0x8')](_0x5be6('0x9'),'c')['where']('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x5343dd,_0x4cf7be){var _0x44579f=_0x4cf7be?'c':_0x5be6('0xa');_0x5343dd['left_join'](_0x5be6('0xb'),'uc',_0x5be6('0xc')+_0x44579f+_0x5be6('0xd'))[_0x5be6('0xe')](_0x5be6('0xf'),'ct','ct.CmContactId\x20=\x20'+_0x44579f+'.id')['left_join'](_0x5be6('0x10'),'t',_0x5be6('0x11'));return _0x5343dd;}function addFieldsToQuery(_0x40f213,_0x2e1c00,_0x5ce94e,_0x23ec0f,_0x3b731c){var _0x402745=_0x3b731c?'c':_0x5be6('0xa');if(!_0x2e1c00){_0x2e1c00=['id','firstName',_0x5be6('0x12'),_0x5be6('0x13'),_0x5be6('0x14'),_0x5be6('0x15'),_0x5be6('0x16'),_0x5be6('0x6'),_0x5be6('0x17'),'createdAt',_0x5be6('0x18'),_0x5be6('0x19'),_0x5be6('0x1a')];}else if(!_0x2e1c00[_0x5be6('0x1b')]('id')){_0x2e1c00['push']('id');}var _0x4bd69c=_0x5ce94e&&_0x3b731c||!_0x5ce94e&&!_0x3b731c;if(_0x23ec0f){_0x4bd69c=_0x23ec0f&&_0x3b731c||!_0x23ec0f&&!_0x3b731c;}_0x2e1c00[_0x5be6('0x1c')](function(_0x5b4f4c){if(_0x5b4f4c===_0x5be6('0x1a')){if(_0x4bd69c){_0x40f213[_0x5be6('0x1d')](_0x5be6('0x1e'),_0x5b4f4c);}else if(_0x5ce94e||_0x23ec0f){_0x40f213[_0x5be6('0x1d')](_0x402745+'.'+_0x5b4f4c);}}else{_0x40f213[_0x5be6('0x1d')](_0x402745+'.'+_0x5b4f4c);}});return _0x40f213;}function getSqlClauses(){var _0x901c83={'default':squel[_0x5be6('0x1f')](),'fields':squel[_0x5be6('0x1f')](),'filter':squel[_0x5be6('0x1f')](),'tags':{'clause':squel[_0x5be6('0x1f')](),'ids':null},'user':{'clause':squel[_0x5be6('0x1f')](),'skip':![]}};return _0x901c83;}function parseTagParameter(_0x4d275c){var _0x55239a=squel['expr']();if(_0x4d275c){var _0x1d33c1=utils[_0x5be6('0x20')](_0x4d275c);_0x1d33c1[_0x5be6('0x1c')](function(_0x378b1b){_0x55239a['or'](_0x5be6('0x21'),'%,'+_0x378b1b+',%');});}return _0x55239a;}function parseSearchFilter(_0xfd5886){var _0x5f5268=squel[_0x5be6('0x1f')]();if(_0xfd5886){var _0x2ec362=_0xfd5886[_0x5be6('0x22')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x2ec362['split']('\x20')[_0x5be6('0x23')]>0x1){_0x5f5268['or'](_0x5be6('0x24'),qs['getFullTextValue'](_0x2ec362),null);}else{if(qs[_0x5be6('0x25')](_0x2ec362)){_0x5f5268['or'](_0x5be6('0x26'),_0x2ec362+'%');_0x5f5268['or'](_0x5be6('0x27'),_0x2ec362+'%');_0x5f5268['or'](_0x5be6('0x28'),_0x2ec362+'%');_0x5f5268['or'](_0x5be6('0x29'),_0x2ec362+'%');}else if(qs[_0x5be6('0x2a')](_0x2ec362)){_0x5f5268['or'](_0x5be6('0x2b'),_0x2ec362+'%');}else{_0x5f5268['or'](_0x5be6('0x2c'),'%'+_0x2ec362+'%');_0x5f5268['or'](_0x5be6('0x2d'),'%'+_0x2ec362+'%');_0x5f5268['or'](_0x5be6('0x2b'),'%'+_0x2ec362+'%');}}}return _0x5f5268;}function parseAdvancedSearchFilter(_0x3c95f1,_0x5f8a22){var _0xe6679b=getSqlClauses();var _0x11add8=as[_0x5be6('0x2e')](_0x3c95f1);var _0x4c1aeb=_0x11add8['sqlOperator'];for(var _0x1899dd=0x0;_0x1899dd<_0x11add8['conditions'][_0x5be6('0x23')];_0x1899dd++){var _0x2ecdcd=_0x11add8[_0x5be6('0x2f')][_0x1899dd];var _0x4ab451='c';var _0x20bf00=_[_0x5be6('0x30')](_0x5f8a22,['name',_0x2ecdcd['field']]);if(_0x20bf00){if(_0x2ecdcd[_0x5be6('0x1d')]==='dateOfBirth'||_0x20bf00[_0x5be6('0x31')]===_0x5be6('0x32')){_0x2ecdcd[_0x5be6('0x33')]='DATE';}var _0x5e05d3=as[_0x5be6('0x34')](_0x4ab451,_0x20bf00[_0x5be6('0x35')],_0x2ecdcd);_0xe6679b[_0x5be6('0x36')][_0x4c1aeb](_0x5e05d3['text'],_0x5e05d3[_0x5be6('0x37')][_0x5be6('0x38')],_0x5e05d3[_0x5be6('0x37')][_0x5be6('0x39')]);}else{if(_0x2ecdcd[_0x5be6('0x1d')]==='Tag'){var _0x22afbf=_0x2ecdcd[_0x5be6('0x37')][_0x5be6('0x3a')](',')[_0x5be6('0x3b')](function(_0x1bd104){return Number(_0x1bd104);});var _0x21d100=parseTagParameter(_0x22afbf);_0xe6679b[_0x5be6('0x3c')][_0x5be6('0x3d')][_0x5be6('0x3e')](_0x21d100);_0xe6679b[_0x5be6('0x3c')][_0x5be6('0x3f')]=_0x22afbf;}else if(_0x2ecdcd[_0x5be6('0x1d')]==='User'){_0xe6679b['user'][_0x5be6('0x3d')][_0x5be6('0x3e')](_0x5be6('0x40'),_0x2ecdcd['value']);_0xe6679b['user'][_0x5be6('0x41')]=!![];}}}return _0xe6679b;}function parseModelFields(_0x492c4f,_0xa007){var _0x51aed5=squel[_0x5be6('0x1f')]();var _0x3c761c=_(_0x492c4f)[_0x5be6('0x42')]()[_0x5be6('0x3b')](function(_0x58e441){return _[_0x5be6('0x43')](_0xa007,[_0x5be6('0x44'),_0x58e441])?_0x58e441:undefined;})[_0x5be6('0x45')]()['value']();if(_0x492c4f[_0x5be6('0x46')]){_0x3c761c['push'](_0x5be6('0x46'));}if(_0x3c761c[_0x5be6('0x23')]>0x0){_0x3c761c[_0x5be6('0x1c')](function(_0x56cd2c){if(_0x56cd2c===_0x5be6('0x6')){_0x51aed5['and']('c.ListId\x20IN\x20?',[][_0x5be6('0x47')](_0x492c4f[_0x56cd2c]));}else if(_0x56cd2c===_0x5be6('0x46')){var _0x5cd773='%'+_0x492c4f[_0x56cd2c]+'%';_0x51aed5[_0x5be6('0x3e')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x5cd773);}else{_0x51aed5[_0x5be6('0x3e')]('c.'+_0x56cd2c+_0x5be6('0x48'),_0x492c4f[_0x56cd2c]);}});}return _0x51aed5;}function parseQueryParameters(_0x4e42bb,_0x1a6f93){var _0x49ee59=getSqlClauses();return Promise[_0x5be6('0x49')]()[_0x5be6('0x4a')](function(){return parseModelFields(_0x4e42bb,_0x1a6f93);})[_0x5be6('0x4a')](function(_0x16f5ab){_0x49ee59['fields'][_0x5be6('0x3e')](_0x16f5ab);return parseTagParameter(_0x4e42bb[_0x5be6('0x4b')]);})[_0x5be6('0x4a')](function(_0x4b49c0){_0x49ee59['tags']['clause'][_0x5be6('0x3e')](_0x4b49c0);return parseSearchFilter(_0x4e42bb['filter']);})[_0x5be6('0x4a')](function(_0x2a6cc5){_0x49ee59[_0x5be6('0x4c')]=_0x2a6cc5;return _0x49ee59;});}function checkListsRestrictions(_0x1885cf,_0x2efed0,_0xd77b17){var _0x4fcccd=squel['expr']();return Promise['resolve']()[_0x5be6('0x4a')](function(){if(_0x2efed0[_0x5be6('0x5')]&&_0x1885cf['role']===_0x5be6('0x4')&&!_0xd77b17){return _0x1885cf[_0x5be6('0x4d')]({'attributes':['id'],'raw':!![]});}})[_0x5be6('0x4a')](function(_0x3f77a6){if(_0x3f77a6){if(_0x3f77a6[_0x5be6('0x23')]===0x0){_0x4fcccd[_0x5be6('0x3e')](_0x5be6('0x4e'));}else{_0x4fcccd[_0x5be6('0x3e')]('c.ListId\x20IN\x20?',_[_0x5be6('0x3b')](_0x3f77a6,'id'));}}})[_0x5be6('0x4a')](function(){return _0x4fcccd;});}function buildContactsQuery(_0x244002,_0x3ab27a,_0x5023a5,_0x3a5dd7,_0x534200,_0x423143){if(_0x3ab27a){_0x3ab27a=_0x5023a5[_0x5be6('0x4f')];}_0x244002=addFieldsToQuery(_0x244002,_0x3ab27a,_0x3a5dd7,_0x423143,!![]);var _0x16a84e=squel[_0x5be6('0x7')]();_0x16a84e=addFieldsToQuery(_0x16a84e,_0x3ab27a,_0x3a5dd7,_0x423143,![]);if(_0x3a5dd7||_0x423143){_0x244002=applyJoinClauses(_0x244002,!![]);_0x244002[_0x5be6('0x50')](_0x5be6('0x51'));if(_0x5023a5[_0x5be6('0x52')]){_0x16a84e[_0x5be6('0x52')](_0x5023a5[_0x5be6('0x52')]);}if(_0x5023a5[_0x5be6('0x53')]){_0x16a84e[_0x5be6('0x53')](_0x5023a5[_0x5be6('0x53')]);}}else{_0x16a84e=applyJoinClauses(_0x16a84e,![]);_0x16a84e[_0x5be6('0x50')](_0x5be6('0x54'));if(_0x5023a5[_0x5be6('0x52')]){_0x244002[_0x5be6('0x52')](_0x5023a5[_0x5be6('0x52')]);}if(_0x5023a5['offset']){_0x244002[_0x5be6('0x53')](_0x5023a5[_0x5be6('0x53')]);}}_0x16a84e['having'](_0x534200);if(_0x5023a5['order']){_0x5023a5[_0x5be6('0x55')][_0x5be6('0x1c')](function(_0x502d7e){_0x244002['order']('c.'+_0x502d7e[0x0],_0x502d7e[0x1]===_0x5be6('0x56')?![]:!![]);_0x16a84e[_0x5be6('0x55')](_0x5be6('0x57')+_0x502d7e[0x0],_0x502d7e[0x1]==='DESC'?![]:!![]);});}_0x16a84e['from'](_0x244002,_0x5be6('0xa'));return _0x16a84e;}function getFilteredContacts(_0x126cb0){var _0x45df4d=[];return db['Tag'][_0x5be6('0x58')]({'attributes':['id','name','color'],'raw':!![]})[_0x5be6('0x4a')](function(_0x3454b1){_0x45df4d=_['keyBy'](_0x3454b1,'id');var _0x529405={'type':db['Sequelize']['QueryTypes'][_0x5be6('0x59')],'model':db[_0x5be6('0x5a')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x5be6('0x5b')][_0x5be6('0x5c')](_0x126cb0[_0x5be6('0x5d')](),_0x529405);})[_0x5be6('0x4a')](function(_0x1f5be7){_0x1f5be7[_0x5be6('0x1c')](function(_0x220ea0){if(_0x220ea0['TagIds']){_0x220ea0['Tags']=[];_0x220ea0[_0x5be6('0x1a')][_0x5be6('0x3a')](',')[_0x5be6('0x1c')](function(_0x3e11ad){_0x220ea0[_0x5be6('0x5e')][_0x5be6('0x5f')](_0x45df4d[_0x3e11ad]);});}delete _0x220ea0[_0x5be6('0x1a')];});return _0x1f5be7;});}function countFilteredContacts(_0x3e3ab9,_0x441a8b){var _0x14fe16=_0x3e3ab9[_0x5be6('0x60')]();_0x14fe16[_0x5be6('0x1d')]('COUNT(*)');_0x14fe16=applyJoinClauses(_0x14fe16,!![]);_0x3e3ab9[_0x5be6('0x50')](_0x5be6('0x51'));var _0x2d962c=utils['getSelectedTags'](_0x441a8b);if(!_[_0x5be6('0x61')](_0x2d962c)){_0x14fe16[_0x5be6('0x62')](_0x5be6('0x63'),_0x2d962c);}var _0x1c259a={'type':db[_0x5be6('0x64')][_0x5be6('0x65')][_0x5be6('0x59')],'raw':!![]};return db[_0x5be6('0x5b')][_0x5be6('0x5c')](_0x14fe16[_0x5be6('0x5d')](),_0x1c259a)[_0x5be6('0x4a')](function(_0x334887){return _0x334887[0x0][_0x5be6('0x66')];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xac1f=['CmContact','query','toString','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','Sequelize','sequelize','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','search','ListId','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','firstName','lastName','phone','mobile','fax','email','createdAt','updatedAt','deletedAt','TagIds','includes','push','forEach','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','fieldType','DATE','buildExpression','type','default','value','start','end','map','clause','and','tags','ids','User','uc.UserId\x20=\x20?','skip','keys','some','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','then','fields','tag','filter','resolve','agent','getLists','attributes','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','Tag','findAll','color','keyBy','QueryTypes','SELECT'];(function(_0x32b9d2,_0x273b5d){var _0x5af2e3=function(_0x2549bc){while(--_0x2549bc){_0x32b9d2['push'](_0x32b9d2['shift']());}};_0x5af2e3(++_0x273b5d);}(_0xac1f,0xed));var _0xfac1=function(_0x22c82f,_0x26c2fb){_0x22c82f=_0x22c82f-0x0;var _0x1348d7=_0xac1f[_0x22c82f];return _0x1348d7;};'use strict';var _=require(_0xfac1('0x0'));var squel=require(_0xfac1('0x1'));var as=require(_0xfac1('0x2'));var qs=require(_0xfac1('0x3'));var utils=require(_0xfac1('0x4'));var db=require(_0xfac1('0x5'))['db'];function skipContactsQuery(_0xb87bf6,_0x16da16){var _0x19d65f=![];if(_0xb87bf6[_0xfac1('0x6')]==='agent'&&!_0x16da16[_0xfac1('0x7')]&&!_0x16da16[_0xfac1('0x8')]&&_0x16da16['autocomplete']!==_0xfac1('0x9')){_0x19d65f=!![];}return _0x19d65f;}function getContactsSubquery(){return squel[_0xfac1('0xa')]()[_0xfac1('0xb')](_0xfac1('0xc'),'c')[_0xfac1('0xd')](_0xfac1('0xe'));}function applyJoinClauses(_0x223f75,_0x5690e4){var _0x221240=_0x5690e4?'c':_0xfac1('0xf');_0x223f75['left_join']('cm_user_has_contacts','uc',_0xfac1('0x10')+_0x221240+_0xfac1('0x11'))['left_join'](_0xfac1('0x12'),'ct',_0xfac1('0x13')+_0x221240+_0xfac1('0x11'))['left_join'](_0xfac1('0x14'),'t','t.id\x20=\x20ct.TagId');return _0x223f75;}function addFieldsToQuery(_0x128465,_0x451a83,_0x3f3a30,_0x425a0c,_0x50716c){var _0x241cc7=_0x50716c?'c':_0xfac1('0xf');if(!_0x451a83){_0x451a83=['id',_0xfac1('0x15'),_0xfac1('0x16'),_0xfac1('0x17'),_0xfac1('0x18'),_0xfac1('0x19'),_0xfac1('0x1a'),_0xfac1('0x8'),'CompanyId',_0xfac1('0x1b'),_0xfac1('0x1c'),_0xfac1('0x1d'),_0xfac1('0x1e')];}else if(!_0x451a83[_0xfac1('0x1f')]('id')){_0x451a83[_0xfac1('0x20')]('id');}var _0x28498c=_0x3f3a30&&_0x50716c||!_0x3f3a30&&!_0x50716c;if(_0x425a0c){_0x28498c=_0x425a0c&&_0x50716c||!_0x425a0c&&!_0x50716c;}_0x451a83[_0xfac1('0x21')](function(_0x46565a){if(_0x46565a==='TagIds'){if(_0x28498c){_0x128465[_0xfac1('0x22')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x46565a);}else if(_0x3f3a30||_0x425a0c){_0x128465[_0xfac1('0x22')](_0x241cc7+'.'+_0x46565a);}}else{_0x128465[_0xfac1('0x22')](_0x241cc7+'.'+_0x46565a);}});return _0x128465;}function getSqlClauses(){var _0xa4a3a2={'default':squel[_0xfac1('0x23')](),'fields':squel['expr'](),'filter':squel[_0xfac1('0x23')](),'tags':{'clause':squel[_0xfac1('0x23')](),'ids':null},'user':{'clause':squel[_0xfac1('0x23')](),'skip':![]}};return _0xa4a3a2;}function parseTagParameter(_0x446b2b){var _0x1223ec=squel[_0xfac1('0x23')]();if(_0x446b2b){var _0x536746=utils[_0xfac1('0x24')](_0x446b2b);_0x536746[_0xfac1('0x21')](function(_0x336a50){_0x1223ec['or'](_0xfac1('0x25'),'%,'+_0x336a50+',%');});}return _0x1223ec;}function parseSearchFilter(_0x32e950){var _0x3cd5ff=squel[_0xfac1('0x23')]();if(_0x32e950){var _0x124419=_0x32e950[_0xfac1('0x26')]('\x5c','\x5c\x5c')[_0xfac1('0x26')](/'/g,'\x27\x27');if(_0x124419[_0xfac1('0x27')]('\x20')[_0xfac1('0x28')]>0x1){_0x3cd5ff['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xfac1('0x29')](_0x124419),null);}else{if(qs[_0xfac1('0x2a')](_0x124419)){_0x3cd5ff['or']('c.id\x20LIKE\x20?',_0x124419+'%');_0x3cd5ff['or'](_0xfac1('0x2b'),_0x124419+'%');_0x3cd5ff['or'](_0xfac1('0x2c'),_0x124419+'%');_0x3cd5ff['or'](_0xfac1('0x2d'),_0x124419+'%');}else if(qs[_0xfac1('0x2e')](_0x124419)){_0x3cd5ff['or']('c.email\x20LIKE\x20?',_0x124419+'%');}else{_0x3cd5ff['or'](_0xfac1('0x2f'),'%'+_0x124419+'%');_0x3cd5ff['or'](_0xfac1('0x30'),'%'+_0x124419+'%');_0x3cd5ff['or'](_0xfac1('0x31'),'%'+_0x124419+'%');}}}return _0x3cd5ff;}function parseAdvancedSearchFilter(_0x21951d,_0x2d420a){var _0x1ccfa6=getSqlClauses();var _0x3d3caa=as[_0xfac1('0x32')](_0x21951d);var _0x3bd200=_0x3d3caa[_0xfac1('0x33')];for(var _0xe24221=0x0;_0xe24221<_0x3d3caa[_0xfac1('0x34')][_0xfac1('0x28')];_0xe24221++){var _0x5fca73=_0x3d3caa[_0xfac1('0x34')][_0xe24221];var _0x7e8cfb='c';var _0x308bbe=_[_0xfac1('0x35')](_0x2d420a,[_0xfac1('0x36'),_0x5fca73['field']]);if(_0x308bbe){if(_0x5fca73[_0xfac1('0x22')]===_0xfac1('0x37')||_0x308bbe[_0xfac1('0x38')]==='datetime'){_0x5fca73['castTo']=_0xfac1('0x39');}var _0x2e40d7=as[_0xfac1('0x3a')](_0x7e8cfb,_0x308bbe[_0xfac1('0x3b')],_0x5fca73);_0x1ccfa6[_0xfac1('0x3c')][_0x3bd200](_0x2e40d7['text'],_0x2e40d7[_0xfac1('0x3d')][_0xfac1('0x3e')],_0x2e40d7[_0xfac1('0x3d')][_0xfac1('0x3f')]);}else{if(_0x5fca73[_0xfac1('0x22')]==='Tag'){var _0x4f6f85=_0x5fca73['value'][_0xfac1('0x27')](',')[_0xfac1('0x40')](function(_0x345224){return Number(_0x345224);});var _0x2cedab=parseTagParameter(_0x4f6f85);_0x1ccfa6['tags'][_0xfac1('0x41')][_0xfac1('0x42')](_0x2cedab);_0x1ccfa6[_0xfac1('0x43')][_0xfac1('0x44')]=_0x4f6f85;}else if(_0x5fca73['field']===_0xfac1('0x45')){_0x1ccfa6['user'][_0xfac1('0x41')]['and'](_0xfac1('0x46'),_0x5fca73[_0xfac1('0x3d')]);_0x1ccfa6['user'][_0xfac1('0x47')]=!![];}}}return _0x1ccfa6;}function parseModelFields(_0x892593,_0x53d364){var _0x183232=squel[_0xfac1('0x23')]();var _0x90969f=_(_0x892593)[_0xfac1('0x48')]()['map'](function(_0x310317){return _[_0xfac1('0x49')](_0x53d364,['name',_0x310317])?_0x310317:undefined;})[_0xfac1('0x4a')]()[_0xfac1('0x3d')]();if(_0x892593[_0xfac1('0x4b')]){_0x90969f['push'](_0xfac1('0x4b'));}if(_0x90969f[_0xfac1('0x28')]>0x0){_0x90969f[_0xfac1('0x21')](function(_0x136724){if(_0x136724===_0xfac1('0x8')){_0x183232['and'](_0xfac1('0x4c'),[][_0xfac1('0x4d')](_0x892593[_0x136724]));}else if(_0x136724===_0xfac1('0x4b')){var _0x5845ab='%'+_0x892593[_0x136724]+'%';_0x183232['and'](_0xfac1('0x4e'),_0x5845ab);}else{_0x183232['and']('c.'+_0x136724+_0xfac1('0x4f'),_0x892593[_0x136724]);}});}return _0x183232;}function parseQueryParameters(_0x163fd6,_0x24042a){var _0x59a066=getSqlClauses();return Promise['resolve']()['then'](function(){return parseModelFields(_0x163fd6,_0x24042a);})[_0xfac1('0x50')](function(_0x5c7bac){_0x59a066[_0xfac1('0x51')][_0xfac1('0x42')](_0x5c7bac);return parseTagParameter(_0x163fd6[_0xfac1('0x52')]);})[_0xfac1('0x50')](function(_0x4c0857){_0x59a066[_0xfac1('0x43')][_0xfac1('0x41')][_0xfac1('0x42')](_0x4c0857);return parseSearchFilter(_0x163fd6['filter']);})['then'](function(_0x296391){_0x59a066[_0xfac1('0x53')]=_0x296391;return _0x59a066;});}function checkListsRestrictions(_0x2bed52,_0x304e63,_0x4f57b4){var _0x1a883f=squel[_0xfac1('0x23')]();return Promise[_0xfac1('0x54')]()['then'](function(){if(_0x304e63['search']&&_0x2bed52[_0xfac1('0x6')]===_0xfac1('0x55')&&!_0x4f57b4){return _0x2bed52[_0xfac1('0x56')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x597a38){if(_0x597a38){if(_0x597a38['length']===0x0){_0x1a883f[_0xfac1('0x42')]('c.ListId\x20IS\x20NULL');}else{_0x1a883f['and'](_0xfac1('0x4c'),_[_0xfac1('0x40')](_0x597a38,'id'));}}})[_0xfac1('0x50')](function(){return _0x1a883f;});}function buildContactsQuery(_0x59a887,_0x17c563,_0x169527,_0x4931a7,_0x2f73db,_0x382609){if(_0x17c563){_0x17c563=_0x169527[_0xfac1('0x57')];}_0x59a887=addFieldsToQuery(_0x59a887,_0x17c563,_0x4931a7,_0x382609,!![]);var _0x87c810=squel[_0xfac1('0xa')]();_0x87c810=addFieldsToQuery(_0x87c810,_0x17c563,_0x4931a7,_0x382609,![]);if(_0x4931a7||_0x382609){_0x59a887=applyJoinClauses(_0x59a887,!![]);_0x59a887['group'](_0xfac1('0x58'));if(_0x169527[_0xfac1('0x59')]){_0x87c810[_0xfac1('0x59')](_0x169527[_0xfac1('0x59')]);}if(_0x169527[_0xfac1('0x5a')]){_0x87c810[_0xfac1('0x5a')](_0x169527[_0xfac1('0x5a')]);}}else{_0x87c810=applyJoinClauses(_0x87c810,![]);_0x87c810['group'](_0xfac1('0x5b'));if(_0x169527[_0xfac1('0x59')]){_0x59a887['limit'](_0x169527[_0xfac1('0x59')]);}if(_0x169527[_0xfac1('0x5a')]){_0x59a887[_0xfac1('0x5a')](_0x169527[_0xfac1('0x5a')]);}}_0x87c810[_0xfac1('0x5c')](_0x2f73db);if(_0x169527[_0xfac1('0x5d')]){_0x169527[_0xfac1('0x5d')]['forEach'](function(_0x89e0ca){_0x59a887[_0xfac1('0x5d')]('c.'+_0x89e0ca[0x0],_0x89e0ca[0x1]===_0xfac1('0x5e')?![]:!![]);_0x87c810[_0xfac1('0x5d')](_0xfac1('0x5f')+_0x89e0ca[0x0],_0x89e0ca[0x1]==='DESC'?![]:!![]);});}_0x87c810['from'](_0x59a887,'subqry');return _0x87c810;}function getFilteredContacts(_0x209bc1){var _0x581844=[];return db[_0xfac1('0x60')][_0xfac1('0x61')]({'attributes':['id',_0xfac1('0x36'),_0xfac1('0x62')],'raw':!![]})[_0xfac1('0x50')](function(_0x397895){_0x581844=_[_0xfac1('0x63')](_0x397895,'id');var _0x1f58b5={'type':db['Sequelize'][_0xfac1('0x64')][_0xfac1('0x65')],'model':db[_0xfac1('0x66')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0xfac1('0x67')](_0x209bc1[_0xfac1('0x68')](),_0x1f58b5);})['then'](function(_0x5da244){_0x5da244[_0xfac1('0x21')](function(_0x480739){if(_0x480739['TagIds']){_0x480739[_0xfac1('0x69')]=[];_0x480739[_0xfac1('0x1e')][_0xfac1('0x27')](',')[_0xfac1('0x21')](function(_0x1fa3c4){_0x480739[_0xfac1('0x69')][_0xfac1('0x20')](_0x581844[_0x1fa3c4]);});}delete _0x480739['TagIds'];});return _0x5da244;});}function countFilteredContacts(_0x24959a,_0x5891c2){var _0x379c82=_0x24959a[_0xfac1('0x6a')]();_0x379c82[_0xfac1('0x22')](_0xfac1('0x6b'));_0x379c82=applyJoinClauses(_0x379c82,!![]);_0x24959a['group'](_0xfac1('0x58'));var _0xef66c=utils[_0xfac1('0x24')](_0x5891c2);if(!_[_0xfac1('0x6c')](_0xef66c)){_0x379c82[_0xfac1('0xd')](_0xfac1('0x6d'),_0xef66c);}var _0x1fbf7c={'type':db[_0xfac1('0x6e')][_0xfac1('0x64')][_0xfac1('0x65')],'raw':!![]};return db[_0xfac1('0x6f')][_0xfac1('0x67')](_0x379c82['toString'](),_0x1fbf7c)[_0xfac1('0x50')](function(_0x226ba2){return _0x226ba2[0x0]['COUNT(*)'];});}module[_0xfac1('0x70')]={'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 d4bf317..7cff495 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 _0x8493=['write','end','close','decryptFile','createWriteStream','unlink','encryptString','base64','decryptString','secret','utf8','bluebird','lodash','../../config/environment','app','aes-256-ctr','aes192','encrypt','algorithm','join','error','getCiphers','indexOf','hasOwnProperty','encryptFile','createReadStream','createCipher','data','update','final','binary'];(function(_0x3e4bdd,_0x368b8a){var _0x46db74=function(_0x138ef1){while(--_0x138ef1){_0x3e4bdd['push'](_0x3e4bdd['shift']());}};_0x46db74(++_0x368b8a);}(_0x8493,0x103));var _0x3849=function(_0x3ee55a,_0x19aeea){_0x3ee55a=_0x3ee55a-0x0;var _0x581800=_0x8493[_0x3ee55a];return _0x581800;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x3849('0x0'));var _=require(_0x3849('0x1'));var config=require(_0x3849('0x2'));var logger=require('../../config/logger')(_0x3849('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':_0x3849('0x4')};const fileOptions={'algorithm':_0x3849('0x5')};if(config['encrypt']&&config[_0x3849('0x6')][_0x3849('0x7')]){var isSupported=isAlgorithmSupported(config[_0x3849('0x6')][_0x3849('0x7')]);if(isSupported){fileOptions[_0x3849('0x7')]=config[_0x3849('0x6')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x3849('0x8')](',\x20');logger[_0x3849('0x9')](config[_0x3849('0x6')]['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x567c56){return AES_SUPPORTED_RX['test'](_0x567c56);}function getSupportedCiphers(){return crypto[_0x3849('0xa')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x444dfb){return getSupportedCiphers()[_0x3849('0xb')](_0x444dfb)>-0x1;}function combineOptions(_0x1684af){var _0x29eaa6={};for(var _0x4866bb in fileOptions){if(fileOptions[_0x3849('0xc')](_0x4866bb)){_0x29eaa6[_0x4866bb]=fileOptions[_0x4866bb];}}if(_0x1684af){for(var _0x55a52 in _0x1684af){if(_0x1684af[_0x3849('0xc')](_0x55a52)){_0x29eaa6[_0x55a52]=_0x1684af[_0x55a52];}}}return _0x29eaa6;}exports[_0x3849('0xd')]=function(_0x42d305,_0x3eef66,_0x5b7975,_0x215b8e){return new BPromise(function(_0x3bd776,_0x2cb2eb){_0x215b8e=combineOptions(_0x215b8e);var _0xedf6b6=new Buffer(_0x5b7975);var _0x358c36=fs[_0x3849('0xe')](_0x42d305);var _0x48b360=fs['createWriteStream'](_0x3eef66);var _0x4ca15d=crypto[_0x3849('0xf')](_0x215b8e[_0x3849('0x7')],_0xedf6b6);_0x358c36['on'](_0x3849('0x10'),function(_0x5e9af5){var _0x5c70e0=new Buffer(_0x4ca15d[_0x3849('0x11')](_0x5e9af5),'binary');_0x48b360['write'](_0x5c70e0);});_0x358c36['on']('end',function(){try{var _0x3bc402=new Buffer(_0x4ca15d[_0x3849('0x12')](_0x3849('0x13')),_0x3849('0x13'));_0x48b360[_0x3849('0x14')](_0x3bc402);_0x48b360[_0x3849('0x15')]();_0x48b360['on'](_0x3849('0x16'),function(){return _0x3bd776(_0x3eef66);});}catch(_0x10a8e6){fs['unlink'](_0x3eef66);return _0x2cb2eb(_0x10a8e6);}});});};exports[_0x3849('0x17')]=function(_0x284fa5,_0x3793ea,_0x4bde25,_0x45f01){return new BPromise(function(_0x363495,_0x51b2cc){_0x45f01=combineOptions(_0x45f01);var _0x567ad9=new Buffer(_0x4bde25);var _0x226b3c=fs['createReadStream'](_0x284fa5);var _0x490033=fs[_0x3849('0x18')](_0x3793ea);var _0x254f70=crypto['createDecipher'](_0x45f01[_0x3849('0x7')],_0x567ad9);_0x226b3c['on'](_0x3849('0x10'),function(_0x10c958){var _0x8039a9=new Buffer(_0x254f70['update'](_0x10c958),_0x3849('0x13'));_0x490033[_0x3849('0x14')](_0x8039a9);});_0x226b3c['on'](_0x3849('0x15'),function(){try{var _0x15b5af=new Buffer(_0x254f70[_0x3849('0x12')](_0x3849('0x13')),'binary');_0x490033[_0x3849('0x14')](_0x15b5af);_0x490033[_0x3849('0x15')]();_0x490033['on'](_0x3849('0x16'),function(){return _0x363495(_0x3793ea);});}catch(_0xb576ed){fs[_0x3849('0x19')](_0x3793ea);return _0x51b2cc(_0xb576ed);}});});};exports[_0x3849('0x1a')]=function(_0x15ae3f,_0x17e0b8,_0x2c2d85){var _0x123d27=_0x2c2d85||stringOptions[_0x3849('0x7')];var _0x391635=_0x17e0b8||stringOptions['secret'];var _0x43750a=crypto[_0x3849('0xf')](_0x123d27,_0x391635);var _0x20f595=_0x43750a['update'](_0x15ae3f,'utf8',_0x3849('0x1b'));_0x20f595+=_0x43750a[_0x3849('0x12')]('base64');return _0x20f595;};exports[_0x3849('0x1c')]=function(_0x3008f5,_0x19f44b,_0x56efd2){var _0x14d9fc=_0x56efd2||stringOptions[_0x3849('0x7')];var _0xaadc7a=_0x19f44b||stringOptions[_0x3849('0x1d')];var _0x9de518=crypto['createDecipher'](_0x14d9fc,_0xaadc7a);var _0xab0240=_0x9de518['update'](_0x3008f5,_0x3849('0x1b'),_0x3849('0x1e'));_0xab0240+=_0x9de518['final'](_0x3849('0x1e'));return _0xab0240;}; \ No newline at end of file +var _0x7128=['decryptString','utf8','crypto','bluebird','lodash','../../config/environment','../../config/logger','session','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','write','final','binary','end','unlink','decryptFile','createDecipher','close','secret','base64'];(function(_0x263276,_0x4e0583){var _0x37e440=function(_0x589277){while(--_0x589277){_0x263276['push'](_0x263276['shift']());}};_0x37e440(++_0x4e0583);}(_0x7128,0xc2));var _0x8712=function(_0x1e9424,_0x191cba){_0x1e9424=_0x1e9424-0x0;var _0x1bd96c=_0x7128[_0x1e9424];return _0x1bd96c;};'use strict';var crypto=require(_0x8712('0x0'));var fs=require('fs');var BPromise=require(_0x8712('0x1'));var _=require(_0x8712('0x2'));var config=require(_0x8712('0x3'));var logger=require(_0x8712('0x4'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x8712('0x5')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':'aes192'};if(config[_0x8712('0x6')]&&config[_0x8712('0x6')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x8712('0x6')][_0x8712('0x7')]);if(isSupported){fileOptions[_0x8712('0x7')]=config[_0x8712('0x6')][_0x8712('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x8712('0x8')](',\x20');logger['error'](config['encrypt'][_0x8712('0x7')],_0x8712('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x4bdcd6){return AES_SUPPORTED_RX[_0x8712('0xa')](_0x4bdcd6);}function getSupportedCiphers(){return crypto[_0x8712('0xb')]()[_0x8712('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x349103){return getSupportedCiphers()['indexOf'](_0x349103)>-0x1;}function combineOptions(_0x514f93){var _0x49f2a1={};for(var _0x988e69 in fileOptions){if(fileOptions[_0x8712('0xd')](_0x988e69)){_0x49f2a1[_0x988e69]=fileOptions[_0x988e69];}}if(_0x514f93){for(var _0x114a60 in _0x514f93){if(_0x514f93['hasOwnProperty'](_0x114a60)){_0x49f2a1[_0x114a60]=_0x514f93[_0x114a60];}}}return _0x49f2a1;}exports[_0x8712('0xe')]=function(_0x42dd9e,_0x3c9f23,_0x38c0ea,_0x55500a){return new BPromise(function(_0x2d350b,_0x2eaaed){_0x55500a=combineOptions(_0x55500a);var _0x5fe6a1=new Buffer(_0x38c0ea);var _0x1b9cee=fs[_0x8712('0xf')](_0x42dd9e);var _0x8a2c04=fs[_0x8712('0x10')](_0x3c9f23);var _0xfb3c20=crypto[_0x8712('0x11')](_0x55500a['algorithm'],_0x5fe6a1);_0x1b9cee['on'](_0x8712('0x12'),function(_0x333a31){var _0x52060c=new Buffer(_0xfb3c20[_0x8712('0x13')](_0x333a31),'binary');_0x8a2c04[_0x8712('0x14')](_0x52060c);});_0x1b9cee['on']('end',function(){try{var _0x2cba85=new Buffer(_0xfb3c20[_0x8712('0x15')](_0x8712('0x16')),_0x8712('0x16'));_0x8a2c04[_0x8712('0x14')](_0x2cba85);_0x8a2c04[_0x8712('0x17')]();_0x8a2c04['on']('close',function(){return _0x2d350b(_0x3c9f23);});}catch(_0x29c6c7){fs[_0x8712('0x18')](_0x3c9f23);return _0x2eaaed(_0x29c6c7);}});});};exports[_0x8712('0x19')]=function(_0x5920e1,_0x7f8e69,_0x5e9d24,_0x17b7a9){return new BPromise(function(_0xd05506,_0x140ab4){_0x17b7a9=combineOptions(_0x17b7a9);var _0x4491ed=new Buffer(_0x5e9d24);var _0x2e8f63=fs['createReadStream'](_0x5920e1);var _0x26e60f=fs[_0x8712('0x10')](_0x7f8e69);var _0x324e4b=crypto[_0x8712('0x1a')](_0x17b7a9[_0x8712('0x7')],_0x4491ed);_0x2e8f63['on']('data',function(_0x43f674){var _0x34bd00=new Buffer(_0x324e4b[_0x8712('0x13')](_0x43f674),_0x8712('0x16'));_0x26e60f[_0x8712('0x14')](_0x34bd00);});_0x2e8f63['on'](_0x8712('0x17'),function(){try{var _0x10f20a=new Buffer(_0x324e4b[_0x8712('0x15')](_0x8712('0x16')),_0x8712('0x16'));_0x26e60f[_0x8712('0x14')](_0x10f20a);_0x26e60f['end']();_0x26e60f['on'](_0x8712('0x1b'),function(){return _0xd05506(_0x7f8e69);});}catch(_0x5ca44d){fs[_0x8712('0x18')](_0x7f8e69);return _0x140ab4(_0x5ca44d);}});});};exports['encryptString']=function(_0x502930,_0x4ea2cf,_0x2804d1){var _0x44c366=_0x2804d1||stringOptions[_0x8712('0x7')];var _0x5b4343=_0x4ea2cf||stringOptions[_0x8712('0x1c')];var _0xbd25dd=crypto[_0x8712('0x11')](_0x44c366,_0x5b4343);var _0x2ce6fe=_0xbd25dd[_0x8712('0x13')](_0x502930,'utf8',_0x8712('0x1d'));_0x2ce6fe+=_0xbd25dd['final'](_0x8712('0x1d'));return _0x2ce6fe;};exports[_0x8712('0x1e')]=function(_0x2eac80,_0x59a840,_0x228d7e){var _0x514da8=_0x228d7e||stringOptions[_0x8712('0x7')];var _0x2aac52=_0x59a840||stringOptions[_0x8712('0x1c')];var _0x3e8574=crypto[_0x8712('0x1a')](_0x514da8,_0x2aac52);var _0x424316=_0x3e8574['update'](_0x2eac80,_0x8712('0x1d'),_0x8712('0x1f'));_0x424316+=_0x3e8574[_0x8712('0x15')]('utf8');return _0x424316;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index b24ac6c..eb75996 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 _0xe7c0=['Setting','find','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT','num','Empty','length','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','existsSync','join','mkdirSync','each','csv','%s.%s','writeFileSync','zip','zip\x20finished','info','Completed','catch','inspect','Failed','finally','exit','util','path','lodash','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','CSV'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe7c0,0x1d2));var _0x0e7c=function(_0x77e7e8,_0x5a319f){_0x77e7e8=_0x77e7e8-0x0;var _0x205a3e=_0xe7c0[_0x77e7e8];return _0x205a3e;};'use strict';var util=require(_0x0e7c('0x0'));var path=require(_0x0e7c('0x1'));var _=require(_0x0e7c('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x0e7c('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x0e7c('0x4'))['db'];var dbH=require(_0x0e7c('0x4'))[_0x0e7c('0x5')];var logger=require(_0x0e7c('0x6'))(_0x0e7c('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x0e7c('0x8')][0x2]);var QUERY=process[_0x0e7c('0x8')][0x3];var PATH=process[_0x0e7c('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x226379,_0x15202d){var _0x483f4a={'status':_0x226379};var _0xc790a3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x15202d){_0x483f4a[_0x0e7c('0x9')]=_0x15202d;}return db[_0x0e7c('0xa')][_0x0e7c('0xb')](_0x483f4a,_0xc790a3);}function main(){var _0x52ba12=0x1388;var _0xf2a19a;logger['info'](util[_0x0e7c('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x0e7c('0xd')));return db[_0x0e7c('0xe')][_0x0e7c('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0e7c('0x10'),_0x0e7c('0x11')]})[_0x0e7c('0x12')](function(_0x29f6ea){if(_0x29f6ea){_0xf2a19a=_0x29f6ea;_0x52ba12=_0xf2a19a[_0x0e7c('0x11')]||0x1388;}})[_0x0e7c('0x12')](function(){return dbH['sequelize'][_0x0e7c('0x13')](util[_0x0e7c('0xc')](_0x0e7c('0x14'),QUERY),{'type':dbH[_0x0e7c('0x15')]['QueryTypes'][_0x0e7c('0x16')]});})['then'](function(_0x1e2d73){if(!_0x1e2d73[0x0][_0x0e7c('0x17')]){return analyticExtractedReport(_0x0e7c('0x18'));}var _0x39ea62=[];var _0x1f1c35=0x0;if(_0xf2a19a['split']){if(_0x1e2d73&&_0x1e2d73[_0x0e7c('0x19')]){var _0x543751=_['range'](_0x1e2d73[0x0][_0x0e7c('0x17')]/_0x52ba12);var _0x1df93b=Number['isInteger'](_0x1e2d73[0x0][_0x0e7c('0x17')]/_0x52ba12)?_0x1e2d73[0x0][_0x0e7c('0x17')]%_0x52ba12:0x0;_0x543751[_0x0e7c('0x1a')](function(_0x1314fc){if(_0x1314fc>0x0){_0x1f1c35+=_0x52ba12;}_0x39ea62[_0x0e7c('0x1b')](dbH['sequelize'][_0x0e7c('0x13')](util['format'](_0x0e7c('0x1c'),QUERY,_0x52ba12,_0x1f1c35),{'type':dbH[_0x0e7c('0x15')][_0x0e7c('0x1d')][_0x0e7c('0x16')]}));});if(_0x1df93b>0x0){_0x1f1c35+=_0x52ba12;_0x39ea62[_0x0e7c('0x1b')](dbH['sequelize']['query'](util[_0x0e7c('0xc')](_0x0e7c('0x1c'),QUERY,_0x1df93b,_0x1f1c35),{'type':dbH[_0x0e7c('0x15')][_0x0e7c('0x1d')][_0x0e7c('0x16')]}));}}}else{_0x39ea62['push'](dbH[_0x0e7c('0x15')][_0x0e7c('0x13')](QUERY,{'type':dbH[_0x0e7c('0x15')][_0x0e7c('0x1d')][_0x0e7c('0x16')]}));}var _0x540995=path[_0x0e7c('0x1e')](PATH);var _0x5a722f=path[_0x0e7c('0x1f')](PATH,'.csv');var _0x5449ad=_0xf2a19a[_0x0e7c('0x10')]&&_0x39ea62['length']>0x1;var _0x36d1b7=[];if(!fs[_0x0e7c('0x20')](path[_0x0e7c('0x21')](_0x540995,_0x5a722f))&&_0x5449ad){fs[_0x0e7c('0x22')](path[_0x0e7c('0x21')](_0x540995,_0x5a722f));}return BPromise[_0x0e7c('0x23')](_0x39ea62,function(_0x525218){_0x36d1b7[_0x0e7c('0x1b')](_0x525218);})[_0x0e7c('0x12')](function(){for(var _0x5e96ff=0x0;_0x5e96ff<_0x36d1b7[_0x0e7c('0x19')];_0x5e96ff+=0x1){var _0x2031ac;var _0x46e0a6=_0x36d1b7[_0x5e96ff];if(_0x5449ad){_0x2031ac=path['join'](_0x540995,_0x5a722f,util[_0x0e7c('0xc')]('%s%d.%s',_0x5a722f,_0x5e96ff,_0x0e7c('0x24')));}else{_0x2031ac=path[_0x0e7c('0x21')](_0x540995,util[_0x0e7c('0xc')](_0x0e7c('0x25'),_0x5a722f,_0x0e7c('0x24')));}fs[_0x0e7c('0x26')](_0x2031ac,csv(_0x46e0a6));}})[_0x0e7c('0x12')](function(){if(_0x5449ad){return new Promise(function(_0x200ae4){zipdir(path[_0x0e7c('0x21')](_0x540995,_0x5a722f),{'saveTo':path[_0x0e7c('0x21')](_0x540995,util[_0x0e7c('0xc')](_0x0e7c('0x25'),_0x5a722f,_0x0e7c('0x27')))},function(_0x2c7724,_0x175a6b){rimraf(path[_0x0e7c('0x21')](_0x540995,_0x5a722f),function(){});_0x200ae4(_0x0e7c('0x28'));});});}})[_0x0e7c('0x12')](function(){logger[_0x0e7c('0x29')](util[_0x0e7c('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x0e7c('0x2a'),_0x5449ad?util[_0x0e7c('0xc')](_0x0e7c('0x25'),_0x5a722f,_0x5449ad?'zip':_0x0e7c('0x24')):null);});})[_0x0e7c('0x2b')](function(_0x9f63f2){logger[_0x0e7c('0x29')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x0e7c('0xd')),util[_0x0e7c('0x2c')](_0x9f63f2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0e7c('0x2d'));})[_0x0e7c('0x2e')](function(){process[_0x0e7c('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x2a61=['range','forEach','push','query','SELECT','dirname','basename','existsSync','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length'];(function(_0x35c879,_0x1ed40a){var _0x43c682=function(_0x333f86){while(--_0x333f86){_0x35c879['push'](_0x35c879['shift']());}};_0x43c682(++_0x1ed40a);}(_0x2a61,0x13b));var _0x12a6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2a61[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x12a6('0x0'));var path=require(_0x12a6('0x1'));var _=require(_0x12a6('0x2'));var csv=require(_0x12a6('0x3'));var fs=require('fs');var BPromise=require(_0x12a6('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x12a6('0x5'));var db=require(_0x12a6('0x6'))['db'];var dbH=require(_0x12a6('0x6'))[_0x12a6('0x7')];var logger=require(_0x12a6('0x8'))(_0x12a6('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x12a6('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x12a6('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x6a0338,_0x3002d9){var _0xc0be2a={'status':_0x6a0338};var _0x48af83={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3002d9){_0xc0be2a[_0x12a6('0xb')]=_0x3002d9;}return db['AnalyticExtractedReport'][_0x12a6('0xc')](_0xc0be2a,_0x48af83);}function main(){var _0x3d894a=0x1388;var _0x5c4992;logger[_0x12a6('0xd')](util[_0x12a6('0xe')](_0x12a6('0xf'),EXTRACTED_REPORT_ID,_0x12a6('0x10')));return db[_0x12a6('0x11')][_0x12a6('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x12a6('0x13'),_0x12a6('0x14')]})[_0x12a6('0x15')](function(_0x17b85f){if(_0x17b85f){_0x5c4992=_0x17b85f;_0x3d894a=_0x5c4992['splitSizeCsv']||0x1388;}})[_0x12a6('0x15')](function(){return dbH[_0x12a6('0x16')]['query'](util[_0x12a6('0xe')](_0x12a6('0x17'),QUERY),{'type':dbH[_0x12a6('0x16')][_0x12a6('0x18')]['SELECT']});})[_0x12a6('0x15')](function(_0x19fe9a){if(!_0x19fe9a[0x0][_0x12a6('0x19')]){return analyticExtractedReport(_0x12a6('0x1a'));}var _0x416404=[];var _0x4c2b31=0x0;if(_0x5c4992['split']){if(_0x19fe9a&&_0x19fe9a[_0x12a6('0x1b')]){var _0x1af4ec=_[_0x12a6('0x1c')](_0x19fe9a[0x0][_0x12a6('0x19')]/_0x3d894a);var _0x4357c7=Number['isInteger'](_0x19fe9a[0x0][_0x12a6('0x19')]/_0x3d894a)?_0x19fe9a[0x0][_0x12a6('0x19')]%_0x3d894a:0x0;_0x1af4ec[_0x12a6('0x1d')](function(_0x123194){if(_0x123194>0x0){_0x4c2b31+=_0x3d894a;}_0x416404[_0x12a6('0x1e')](dbH[_0x12a6('0x16')][_0x12a6('0x1f')](util[_0x12a6('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3d894a,_0x4c2b31),{'type':dbH[_0x12a6('0x16')][_0x12a6('0x18')]['SELECT']}));});if(_0x4357c7>0x0){_0x4c2b31+=_0x3d894a;_0x416404['push'](dbH['sequelize'][_0x12a6('0x1f')](util[_0x12a6('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4357c7,_0x4c2b31),{'type':dbH['sequelize'][_0x12a6('0x18')][_0x12a6('0x20')]}));}}}else{_0x416404['push'](dbH[_0x12a6('0x16')][_0x12a6('0x1f')](QUERY,{'type':dbH[_0x12a6('0x16')]['QueryTypes']['SELECT']}));}var _0x2e285e=path[_0x12a6('0x21')](PATH);var _0x221219=path[_0x12a6('0x22')](PATH,'.csv');var _0x331df9=_0x5c4992[_0x12a6('0x13')]&&_0x416404[_0x12a6('0x1b')]>0x1;var _0x1cf059=[];if(!fs[_0x12a6('0x23')](path[_0x12a6('0x24')](_0x2e285e,_0x221219))&&_0x331df9){fs['mkdirSync'](path[_0x12a6('0x24')](_0x2e285e,_0x221219));}return BPromise[_0x12a6('0x25')](_0x416404,function(_0x4b60eb){_0x1cf059[_0x12a6('0x1e')](_0x4b60eb);})[_0x12a6('0x15')](function(){for(var _0x117a7d=0x0;_0x117a7d<_0x1cf059[_0x12a6('0x1b')];_0x117a7d+=0x1){var _0x9182b1;var _0x1cac22=_0x1cf059[_0x117a7d];if(_0x331df9){_0x9182b1=path['join'](_0x2e285e,_0x221219,util[_0x12a6('0xe')](_0x12a6('0x26'),_0x221219,_0x117a7d,_0x12a6('0x27')));}else{_0x9182b1=path[_0x12a6('0x24')](_0x2e285e,util[_0x12a6('0xe')](_0x12a6('0x28'),_0x221219,_0x12a6('0x27')));}fs[_0x12a6('0x29')](_0x9182b1,csv(_0x1cac22));}})[_0x12a6('0x15')](function(){if(_0x331df9){return new Promise(function(_0x20d7c7){zipdir(path['join'](_0x2e285e,_0x221219),{'saveTo':path[_0x12a6('0x24')](_0x2e285e,util[_0x12a6('0xe')](_0x12a6('0x28'),_0x221219,_0x12a6('0x2a')))},function(_0xe56092,_0x1b78ec){rimraf(path[_0x12a6('0x24')](_0x2e285e,_0x221219),function(){});_0x20d7c7('zip\x20finished');});});}})[_0x12a6('0x15')](function(){logger[_0x12a6('0xd')](util['format'](_0x12a6('0x2b'),EXTRACTED_REPORT_ID,_0x12a6('0x10')));return analyticExtractedReport(_0x12a6('0x2c'),_0x331df9?util['format']('%s.%s',_0x221219,_0x331df9?_0x12a6('0x2a'):_0x12a6('0x27')):null);});})['catch'](function(_0xba619a){logger[_0x12a6('0xd')](util[_0x12a6('0xe')](_0x12a6('0x2d'),EXTRACTED_REPORT_ID,_0x12a6('0x10')),util[_0x12a6('0x2e')](_0xba619a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x12a6('0x2f'));})[_0x12a6('0x30')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 7eba593..0bfa3c6 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 _0xaf36=['value','fill','auto','push','body','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','pageBreak','before','margin','landscape','toString','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','splitSizePdf','then','split','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','basename','.pdf','existsSync','join','mkdirSync','each','length','createPdfKitDocument','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne','catch','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','center','Interaction\x20Transcript','header','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','pick'];(function(_0x237ba6,_0x4ccff9){var _0x4d4ab0=function(_0x557f9b){while(--_0x557f9b){_0x237ba6['push'](_0x237ba6['shift']());}};_0x4d4ab0(++_0x4ccff9);}(_0xaf36,0x1c5));var _0x6af3=function(_0x23ca4d,_0x5c2a32){_0x23ca4d=_0x23ca4d-0x0;var _0x435432=_0xaf36[_0x23ca4d];return _0x435432;};'use strict';var _=require(_0x6af3('0x0'));var fs=require('fs');var util=require(_0x6af3('0x1'));var path=require(_0x6af3('0x2'));var moment=require(_0x6af3('0x3'));var htmlToPdfmake=require(_0x6af3('0x4'));var PdfPrinter=require(_0x6af3('0x5'));var zipdir=require(_0x6af3('0x6'));var rimraf=require(_0x6af3('0x7'));var JSDOM=require(_0x6af3('0x8'))[_0x6af3('0x9')];var window=new JSDOM('')[_0x6af3('0xa')];var BPromise=require(_0x6af3('0xb'));var db=require(_0x6af3('0xc'))['db'];var dbH=require(_0x6af3('0xc'))[_0x6af3('0xd')];var logger=require(_0x6af3('0xe'))(_0x6af3('0xf'));var EXTRACTED_REPORT_ID=Number(process[_0x6af3('0x10')][0x2]);var QUERY=process[_0x6af3('0x10')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x6af3('0x10')][0x5];var FORMAT=_0x6af3('0x11');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x36fbbe,_0x44ad12){var _0x2cd036={'status':_0x36fbbe};var _0xe69251={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x44ad12){_0x2cd036[_0x6af3('0x12')]=_0x44ad12;}return db['AnalyticExtractedReport'][_0x6af3('0x13')](_0x2cd036,_0xe69251);}function getHeaders(_0x4459a8){return _[_0x6af3('0x14')](_0x4459a8,function(_0x44e539){return{'text':_0x44e539,'style':'tableHeader'};});}function getRows(_0x22f136,_0x1fc6a6){return _[_0x6af3('0x14')](_0x1fc6a6,function(_0xa1801c){return _(_0xa1801c)[_0x6af3('0x15')](_0x22f136)['map'](function(_0x210f22){return _0x210f22?_['toString'](_0x210f22):'';})[_0x6af3('0x16')]();});}function createTable(_0x266859,_0x5eb6fc){var _0x597676={'widths':_[_0x6af3('0x17')](Array(_0x266859['length']),0x91),'heights':function(_0x3a65ad){return _0x3a65ad===0x0?_0x6af3('0x18'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xb1e3d6=getHeaders(_0x266859);_0x597676['body'][_0x6af3('0x19')](_0xb1e3d6);var _0x10052a=getRows(_0x266859,_0x5eb6fc);_0x597676[_0x6af3('0x1a')]=_0x597676[_0x6af3('0x1a')]['concat'](_0x10052a);return _0x597676;}function createTables(_0x3c06cf){var _0x15ebac=[];var _0x513e90=_['chunk'](Object[_0x6af3('0x1b')](_0x3c06cf[0x0]),0x5);_0x513e90[_0x6af3('0x1c')](function(_0x1e6d5b){_0x15ebac['push'](createTable(_0x1e6d5b,_0x3c06cf));});return _0x15ebac;}function getPDFDocDefinition(_0x28243e){var _0x3b4723=util[_0x6af3('0x1d')](_0x6af3('0x1e'),NAME,EXTRACTED_REPORT[_0x6af3('0x1f')],moment(EXTRACTED_REPORT[_0x6af3('0x20')])[_0x6af3('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0x6af3('0x21')])[_0x6af3('0x1d')](FORMAT));var _0x5f5556=[];for(var _0xefb3a8=0x0;_0xefb3a8<_0x28243e['length'];_0xefb3a8++){var _0x5d2c55=[];if(_0xefb3a8===0x0){_0x5d2c55[_0x6af3('0x19')]({'text':_0x3b4723,'style':'header'});}var _0x20b1bc={'table':_0x28243e[_0xefb3a8]};if(_0xefb3a8>0x0){_0x20b1bc[_0x6af3('0x22')]=_0x6af3('0x23');_0x20b1bc[_0x6af3('0x24')]=[0x0,0x46,0x0,0x0];}_0x5d2c55[_0x6af3('0x19')](_0x20b1bc);_0x5f5556[_0x6af3('0x19')](_0x5d2c55);}return{'pageSize':'A4','pageOrientation':_0x6af3('0x25'),'content':_0x5f5556,'footer':function(_0x2ab027,_0x2f38b3){return{'text':_0x2ab027[_0x6af3('0x26')]()+_0x6af3('0x27')+_0x2f38b3,'style':_0x6af3('0x28')};},'defaultStyle':{'font':_0x6af3('0x29')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x6af3('0x2a')},'footer':{'alignment':_0x6af3('0x2b'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x5d98ed){var _0x206d86=0x1388;var _0x1487c4;if(!_0x5d98ed[0x0][_0x6af3('0x2c')]){return analyticExtractedReport(_0x6af3('0x2d'));}return db[_0x6af3('0x2e')][_0x6af3('0x2f')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x6af3('0x30')]})['then'](function(_0xe2845b){if(_0xe2845b){_0x1487c4=_0xe2845b;_0x206d86=_0x1487c4[_0x6af3('0x30')]||0x3e8;}})[_0x6af3('0x31')](function(){var _0x529631=[];var _0xb2a0fe=0x0;if(_0x1487c4[_0x6af3('0x32')]){if(_0x5d98ed&&_0x5d98ed['length']){var _0x4e3f49=_[_0x6af3('0x33')](_0x5d98ed[0x0][_0x6af3('0x2c')]/_0x206d86);var _0x3eb60d=Number[_0x6af3('0x34')](_0x5d98ed[0x0][_0x6af3('0x2c')]/_0x206d86)?_0x5d98ed[0x0]['num']%_0x206d86:0x0;_0x4e3f49['forEach'](function(_0x6aa0fa){if(_0x6aa0fa>0x0){_0xb2a0fe+=_0x206d86;}_0x529631['push'](dbH[_0x6af3('0x35')][_0x6af3('0x36')](util[_0x6af3('0x1d')](_0x6af3('0x37'),QUERY,_0x206d86,_0xb2a0fe),{'type':dbH[_0x6af3('0x35')][_0x6af3('0x38')][_0x6af3('0x39')]}));});if(_0x3eb60d>0x0){_0xb2a0fe+=_0x206d86;_0x529631['push'](dbH[_0x6af3('0x35')][_0x6af3('0x36')](util[_0x6af3('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3eb60d,_0xb2a0fe),{'type':dbH[_0x6af3('0x35')][_0x6af3('0x38')]['SELECT']}));}}}else{_0x529631[_0x6af3('0x19')](dbH[_0x6af3('0x35')][_0x6af3('0x36')](QUERY,{'type':dbH[_0x6af3('0x35')][_0x6af3('0x38')][_0x6af3('0x39')]}));}var _0x28844b=path['dirname'](PATH);var _0x69d841=path[_0x6af3('0x3a')](PATH,_0x6af3('0x3b'));var _0x572d62=_0x1487c4[_0x6af3('0x32')]&&_0x529631['length']>0x1;var _0x10c415=[];if(!fs[_0x6af3('0x3c')](path[_0x6af3('0x3d')](_0x28844b,_0x69d841))&&_0x572d62){fs[_0x6af3('0x3e')](path[_0x6af3('0x3d')](_0x28844b,_0x69d841));}return BPromise[_0x6af3('0x3f')](_0x529631,function(_0xf609a4){_0x10c415[_0x6af3('0x19')](_0xf609a4);})[_0x6af3('0x31')](function(){var _0x11c335=[];for(var _0x56d06e=0x0;_0x56d06e<_0x10c415[_0x6af3('0x40')];_0x56d06e+=0x1){var _0x5e1f23=_0x10c415[_0x56d06e];var _0x1e4229=createTables(_['flatten'](_0x5e1f23));var _0x406e4e;var _0xa5325a=getPDFDocDefinition(_0x1e4229);var _0x3f9c00=getPDFPrinter();var _0x12f0e0=_0x3f9c00[_0x6af3('0x41')](_0xa5325a);if(_0x572d62){_0x406e4e=path[_0x6af3('0x3d')](_0x28844b,_0x69d841,util[_0x6af3('0x1d')]('%s%d.%s',_0x69d841,_0x56d06e,_0x6af3('0x42')));}else{_0x406e4e=path['join'](_0x28844b,util[_0x6af3('0x1d')](_0x6af3('0x43'),_0x69d841,_0x6af3('0x42')));}_0x11c335['push'](writePDFDocument(_0x12f0e0,_0x406e4e));}return Promise[_0x6af3('0x44')](_0x11c335);})['then'](function(){if(_0x572d62){return new Promise(function(_0x200cbb){zipdir(path[_0x6af3('0x3d')](_0x28844b,_0x69d841),{'saveTo':path[_0x6af3('0x3d')](_0x28844b,util[_0x6af3('0x1d')](_0x6af3('0x43'),_0x69d841,_0x6af3('0x45')))},function(){rimraf(path['join'](_0x28844b,_0x69d841),function(){});_0x200cbb(_0x6af3('0x46'));});});}})[_0x6af3('0x31')](function(){if(!_0x572d62)return;rimraf(path[_0x6af3('0x3d')](_0x28844b,_0x69d841),function(){});})[_0x6af3('0x31')](function(){logger[_0x6af3('0x47')](util[_0x6af3('0x1d')](_0x6af3('0x48'),EXTRACTED_REPORT_ID,_0x6af3('0x49')));return analyticExtractedReport('Completed',_0x572d62?util[_0x6af3('0x1d')](_0x6af3('0x43'),_0x69d841,_0x572d62?_0x6af3('0x45'):_0x6af3('0x42')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x6af3('0x47')](util[_0x6af3('0x1d')](_0x6af3('0x4a'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x6af3('0x4b')][_0x6af3('0x4c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x6af3('0x31')](function(_0x7ba5bd){EXTRACTED_REPORT=_0x7ba5bd;return dbH['sequelize'][_0x6af3('0x36')](util[_0x6af3('0x1d')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x6af3('0x35')][_0x6af3('0x38')][_0x6af3('0x39')]});})['then'](extractReport)[_0x6af3('0x4d')](function(_0x240833){logger[_0x6af3('0x47')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6af3('0x49')),util['inspect'](_0x240833,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6af3('0x4e'));})[_0x6af3('0x4f')](function(){process[_0x6af3('0x50')](EXIT_CODE);});}main();function getPDFPrinter(){var _0xa00b7b=new PdfPrinter({'Arial':{'normal':__dirname+_0x6af3('0x51'),'bold':__dirname+_0x6af3('0x52'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x6af3('0x53')}});return _0xa00b7b;}function getPDFDocDefinitionFromHTML(_0x4736f3,_0x469068){var _0x3afde1=util[_0x6af3('0x1d')](_0x6af3('0x54'),_0x469068[_0x6af3('0x55')],_0x469068['interactionId']);var _0x5b2084=moment()[_0x6af3('0x1d')]('YYYY-MM-DD')[_0x6af3('0x26')]();var _0x265a7d=htmlToPdfmake(_0x4736f3,{'window':window,'tableAutoSize':!![]});return{'content':[_0x265a7d],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x6af3('0x56'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x6af3('0x56'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x6af3('0x56')}},'header':function(){return[{'text':_0x6af3('0x57'),'style':_0x6af3('0x58')}];},'footer':function(_0x5aa149,_0x37f335){return[{'text':util[_0x6af3('0x1d')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x3afde1,_0x5aa149,_0x37f335,_0x5b2084),'style':'footer'}];}};}function writePDFDocument(_0x5d3439,_0x11aeb7){return new Promise(function(_0x1af4b7,_0x1f6f6b){var _0x287d61=_0x5d3439[_0x6af3('0x59')](fs[_0x6af3('0x5a')](_0x11aeb7));_0x287d61['on'](_0x6af3('0x5b'),function(){_0x1af4b7(_0x6af3('0x5b'));});_0x287d61['on'](_0x6af3('0x5c'),function(_0x19eec0){_0x1f6f6b(_0x19eec0);});_0x5d3439[_0x6af3('0x5d')]();});}exports[_0x6af3('0x5e')]=function(_0x4ad2a9,_0x4119e7){var _0x8d5e89=getPDFPrinter();var _0x20556c=getPDFDocDefinitionFromHTML(_0x4ad2a9,_0x4119e7);var _0x278254=_0x8d5e89['createPdfKitDocument'](_0x20556c);return writePDFDocument(_0x278254,_0x4119e7[_0x6af3('0x2')])[_0x6af3('0x4d')](function(_0x253c82){throw _0x253c82;});}; \ No newline at end of file +var _0x6a68=['splitSizePdf','then','isInteger','num','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','dirname','.pdf','existsSync','mkdirSync','join','each','flatten','createPdfKitDocument','pdf','%s.%s','all','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','zip','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','end','createPdfFromHTML','catch','lodash','util','path','moment','html-to-pdfmake','zip-dir','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','body','push','concat','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','length','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','Empty','Setting','find','split'];(function(_0x165703,_0x3309f6){var _0xd78d24=function(_0x25307d){while(--_0x25307d){_0x165703['push'](_0x165703['shift']());}};_0xd78d24(++_0x3309f6);}(_0x6a68,0x192));var _0x86a6=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x6a68[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x86a6('0x0'));var fs=require('fs');var util=require(_0x86a6('0x1'));var path=require(_0x86a6('0x2'));var moment=require(_0x86a6('0x3'));var htmlToPdfmake=require(_0x86a6('0x4'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x86a6('0x5'));var rimraf=require('rimraf');var JSDOM=require(_0x86a6('0x6'))[_0x86a6('0x7')];var window=new JSDOM('')[_0x86a6('0x8')];var BPromise=require(_0x86a6('0x9'));var db=require('../../mysqldb')['db'];var dbH=require(_0x86a6('0xa'))[_0x86a6('0xb')];var logger=require(_0x86a6('0xc'))(_0x86a6('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0x86a6('0xe')][0x2]);var QUERY=process[_0x86a6('0xe')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x86a6('0xe')][0x5];var FORMAT=_0x86a6('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2f98d4,_0x316e91){var _0x2a4914={'status':_0x2f98d4};var _0x2a5058={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x316e91){_0x2a4914['savename']=_0x316e91;}return db[_0x86a6('0x10')][_0x86a6('0x11')](_0x2a4914,_0x2a5058);}function getHeaders(_0x5d87a5){return _[_0x86a6('0x12')](_0x5d87a5,function(_0x2d5aaf){return{'text':_0x2d5aaf,'style':_0x86a6('0x13')};});}function getRows(_0x2e57da,_0x5bc63e){return _[_0x86a6('0x12')](_0x5bc63e,function(_0x44af38){return _(_0x44af38)[_0x86a6('0x14')](_0x2e57da)[_0x86a6('0x12')](function(_0x42dd7a){return _0x42dd7a?_[_0x86a6('0x15')](_0x42dd7a):'';})[_0x86a6('0x16')]();});}function createTable(_0x230bdf,_0x3a4791){var _0x3c8c40={'widths':_[_0x86a6('0x17')](Array(_0x230bdf['length']),0x91),'heights':function(_0x4866bb){return _0x4866bb===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x5662f3=getHeaders(_0x230bdf);_0x3c8c40[_0x86a6('0x18')][_0x86a6('0x19')](_0x5662f3);var _0x467b11=getRows(_0x230bdf,_0x3a4791);_0x3c8c40[_0x86a6('0x18')]=_0x3c8c40[_0x86a6('0x18')][_0x86a6('0x1a')](_0x467b11);return _0x3c8c40;}function createTables(_0x3eb22f){var _0x12f911=[];var _0x3c8e4e=_[_0x86a6('0x1b')](Object['keys'](_0x3eb22f[0x0]),0x5);_0x3c8e4e[_0x86a6('0x1c')](function(_0xadd7fd){_0x12f911['push'](createTable(_0xadd7fd,_0x3eb22f));});return _0x12f911;}function getPDFDocDefinition(_0x4b9b24){var _0x1ea6bb=util[_0x86a6('0x1d')](_0x86a6('0x1e'),NAME,EXTRACTED_REPORT[_0x86a6('0x1f')],moment(EXTRACTED_REPORT['startDate'])[_0x86a6('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0x86a6('0x20')])[_0x86a6('0x1d')](FORMAT));var _0xe10864=[];for(var _0x5d2c39=0x0;_0x5d2c39<_0x4b9b24[_0x86a6('0x21')];_0x5d2c39++){var _0x1f2a95=[];if(_0x5d2c39===0x0){_0x1f2a95[_0x86a6('0x19')]({'text':_0x1ea6bb,'style':_0x86a6('0x22')});}var _0x11a3ee={'table':_0x4b9b24[_0x5d2c39]};if(_0x5d2c39>0x0){_0x11a3ee[_0x86a6('0x23')]=_0x86a6('0x24');_0x11a3ee[_0x86a6('0x25')]=[0x0,0x46,0x0,0x0];}_0x1f2a95[_0x86a6('0x19')](_0x11a3ee);_0xe10864[_0x86a6('0x19')](_0x1f2a95);}return{'pageSize':'A4','pageOrientation':_0x86a6('0x26'),'content':_0xe10864,'footer':function(_0x14281e,_0x258213){return{'text':_0x14281e[_0x86a6('0x15')]()+_0x86a6('0x27')+_0x258213,'style':_0x86a6('0x28')};},'defaultStyle':{'font':_0x86a6('0x29')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x86a6('0x2a')},'footer':{'alignment':_0x86a6('0x2b'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x53f7d7){var _0xd2c9b8=0x1388;var _0x118ccf;if(!_0x53f7d7[0x0]['num']){return analyticExtractedReport(_0x86a6('0x2c'));}return db[_0x86a6('0x2d')][_0x86a6('0x2e')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x86a6('0x2f'),_0x86a6('0x30')]})[_0x86a6('0x31')](function(_0x4f433b){if(_0x4f433b){_0x118ccf=_0x4f433b;_0xd2c9b8=_0x118ccf[_0x86a6('0x30')]||0x3e8;}})[_0x86a6('0x31')](function(){var _0x5cd092=[];var _0x37e1fe=0x0;if(_0x118ccf[_0x86a6('0x2f')]){if(_0x53f7d7&&_0x53f7d7[_0x86a6('0x21')]){var _0x501e6f=_['range'](_0x53f7d7[0x0]['num']/_0xd2c9b8);var _0x2f422a=Number[_0x86a6('0x32')](_0x53f7d7[0x0][_0x86a6('0x33')]/_0xd2c9b8)?_0x53f7d7[0x0][_0x86a6('0x33')]%_0xd2c9b8:0x0;_0x501e6f['forEach'](function(_0x54771d){if(_0x54771d>0x0){_0x37e1fe+=_0xd2c9b8;}_0x5cd092[_0x86a6('0x19')](dbH['sequelize'][_0x86a6('0x34')](util['format'](_0x86a6('0x35'),QUERY,_0xd2c9b8,_0x37e1fe),{'type':dbH[_0x86a6('0x36')][_0x86a6('0x37')][_0x86a6('0x38')]}));});if(_0x2f422a>0x0){_0x37e1fe+=_0xd2c9b8;_0x5cd092['push'](dbH['sequelize']['query'](util['format'](_0x86a6('0x35'),QUERY,_0x2f422a,_0x37e1fe),{'type':dbH[_0x86a6('0x36')][_0x86a6('0x37')][_0x86a6('0x38')]}));}}}else{_0x5cd092['push'](dbH[_0x86a6('0x36')]['query'](QUERY,{'type':dbH[_0x86a6('0x36')][_0x86a6('0x37')][_0x86a6('0x38')]}));}var _0x603aa4=path[_0x86a6('0x39')](PATH);var _0x1c7c19=path['basename'](PATH,_0x86a6('0x3a'));var _0x44a371=_0x118ccf['split']&&_0x5cd092[_0x86a6('0x21')]>0x1;var _0x2912ad=[];if(!fs[_0x86a6('0x3b')](path['join'](_0x603aa4,_0x1c7c19))&&_0x44a371){fs[_0x86a6('0x3c')](path[_0x86a6('0x3d')](_0x603aa4,_0x1c7c19));}return BPromise[_0x86a6('0x3e')](_0x5cd092,function(_0xcad00){_0x2912ad[_0x86a6('0x19')](_0xcad00);})[_0x86a6('0x31')](function(){var _0x500619=[];for(var _0x24fcf9=0x0;_0x24fcf9<_0x2912ad[_0x86a6('0x21')];_0x24fcf9+=0x1){var _0x2068fd=_0x2912ad[_0x24fcf9];var _0x8a7ab=createTables(_[_0x86a6('0x3f')](_0x2068fd));var _0x679354;var _0x4f8ebd=getPDFDocDefinition(_0x8a7ab);var _0x3d7172=getPDFPrinter();var _0x1b8e69=_0x3d7172[_0x86a6('0x40')](_0x4f8ebd);if(_0x44a371){_0x679354=path[_0x86a6('0x3d')](_0x603aa4,_0x1c7c19,util[_0x86a6('0x1d')]('%s%d.%s',_0x1c7c19,_0x24fcf9,_0x86a6('0x41')));}else{_0x679354=path[_0x86a6('0x3d')](_0x603aa4,util[_0x86a6('0x1d')](_0x86a6('0x42'),_0x1c7c19,'pdf'));}_0x500619['push'](writePDFDocument(_0x1b8e69,_0x679354));}return Promise[_0x86a6('0x43')](_0x500619);})['then'](function(){if(_0x44a371){return new Promise(function(_0x4c1e2f){zipdir(path[_0x86a6('0x3d')](_0x603aa4,_0x1c7c19),{'saveTo':path[_0x86a6('0x3d')](_0x603aa4,util[_0x86a6('0x1d')](_0x86a6('0x42'),_0x1c7c19,'zip'))},function(){rimraf(path[_0x86a6('0x3d')](_0x603aa4,_0x1c7c19),function(){});_0x4c1e2f('zip\x20finished');});});}})[_0x86a6('0x31')](function(){if(!_0x44a371)return;rimraf(path[_0x86a6('0x3d')](_0x603aa4,_0x1c7c19),function(){});})[_0x86a6('0x31')](function(){logger[_0x86a6('0x44')](util[_0x86a6('0x1d')](_0x86a6('0x45'),EXTRACTED_REPORT_ID,_0x86a6('0x46')));return analyticExtractedReport('Completed',_0x44a371?util[_0x86a6('0x1d')](_0x86a6('0x42'),_0x1c7c19,_0x44a371?_0x86a6('0x47'):_0x86a6('0x41')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x86a6('0x44')](util[_0x86a6('0x1d')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x86a6('0x46')));return db[_0x86a6('0x10')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x251236){EXTRACTED_REPORT=_0x251236;return dbH[_0x86a6('0x36')][_0x86a6('0x34')](util[_0x86a6('0x1d')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x86a6('0x36')]['QueryTypes']['SELECT']});})['then'](extractReport)['catch'](function(_0x11a1e9){logger[_0x86a6('0x44')](util[_0x86a6('0x1d')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x11a1e9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x86a6('0x48'));})[_0x86a6('0x49')](function(){process[_0x86a6('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x14b24d=new PdfPrinter({'Arial':{'normal':__dirname+_0x86a6('0x4b'),'bold':__dirname+_0x86a6('0x4c'),'italics':__dirname+_0x86a6('0x4d'),'bolditalics':__dirname+_0x86a6('0x4e')}});return _0x14b24d;}function getPDFDocDefinitionFromHTML(_0x92bb29,_0x4ee149){var _0x1e713d=util['format']('%s\x20#%d',_0x4ee149[_0x86a6('0x4f')],_0x4ee149[_0x86a6('0x50')]);var _0x16371b=moment()[_0x86a6('0x1d')](_0x86a6('0x51'))['toString']();var _0x3e5867=htmlToPdfmake(_0x92bb29,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3e5867],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x86a6('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x86a6('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x86a6('0x52')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x86a6('0x22')}];},'footer':function(_0x113f3e,_0x492458){return[{'text':util['format'](_0x86a6('0x53'),_0x1e713d,_0x113f3e,_0x492458,_0x16371b),'style':_0x86a6('0x28')}];}};}function writePDFDocument(_0x4df725,_0xd508f4){return new Promise(function(_0x297471,_0x3e5bf5){var _0x45a611=_0x4df725['pipe'](fs[_0x86a6('0x54')](_0xd508f4));_0x45a611['on'](_0x86a6('0x55'),function(){_0x297471('finish');});_0x45a611['on'](_0x86a6('0x56'),function(_0x17d472){_0x3e5bf5(_0x17d472);});_0x4df725[_0x86a6('0x57')]();});}exports[_0x86a6('0x58')]=function(_0x550e7a,_0x273388){var _0x14e770=getPDFPrinter();var _0x3a37c2=getPDFDocDefinitionFromHTML(_0x550e7a,_0x273388);var _0x4d5ba7=_0x14e770[_0x86a6('0x40')](_0x3a37c2);return writePDFDocument(_0x4d5ba7,_0x273388[_0x86a6('0x2')])[_0x86a6('0x59')](function(_0x16bf0a){throw _0x16bf0a;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 82d063d..de6e07f 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 _0x87d0=['exit','util','path','lodash','bluebird','rimraf','../../mysqldb','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.xlsx','split','existsSync','join','each','xlsx','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x87d0,0xbd));var _0x087d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x87d0[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x087d('0x0'));var path=require(_0x087d('0x1'));var _=require(_0x087d('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x087d('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x087d('0x4'));var db=require(_0x087d('0x5'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')(_0x087d('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x087d('0x7')][0x2]);var QUERY=process[_0x087d('0x7')][0x3];var PATH=process[_0x087d('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x571c84,_0x1b1264){var _0x47fa98={'status':_0x571c84};var _0x28cf0d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1b1264){_0x47fa98['savename']=_0x1b1264;}return db[_0x087d('0x8')][_0x087d('0x9')](_0x47fa98,_0x28cf0d);}function main(){var _0xf992e1=0x1388;var _0x2b76f1;logger[_0x087d('0xa')](util[_0x087d('0xb')](_0x087d('0xc'),EXTRACTED_REPORT_ID,_0x087d('0xd')));return db[_0x087d('0xe')][_0x087d('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x087d('0x10')]})[_0x087d('0x11')](function(_0x581a32){if(_0x581a32){_0x2b76f1=_0x581a32;_0xf992e1=_0x2b76f1[_0x087d('0x10')]||0x1388;}})['then'](function(){return dbH[_0x087d('0x12')][_0x087d('0x13')](util[_0x087d('0xb')](_0x087d('0x14'),QUERY),{'type':dbH[_0x087d('0x12')][_0x087d('0x15')]['SELECT']});})['then'](function(_0x350df3){if(!_0x350df3[0x0][_0x087d('0x16')]){return analyticExtractedReport(_0x087d('0x17'));}var _0x3e8a5e=[];var _0x20ffa6=0x0;if(_0x2b76f1['split']){if(_0x350df3&&_0x350df3[_0x087d('0x18')]){var _0x2d8722=_['range'](_0x350df3[0x0][_0x087d('0x16')]/_0xf992e1);var _0x306d68=Number[_0x087d('0x19')](_0x350df3[0x0]['num']/_0xf992e1)?_0x350df3[0x0]['num']%_0xf992e1:0x0;_0x2d8722[_0x087d('0x1a')](function(_0x505ad2){if(_0x505ad2>0x0){_0x20ffa6+=_0xf992e1;}_0x3e8a5e[_0x087d('0x1b')](dbH[_0x087d('0x12')]['query'](util[_0x087d('0xb')](_0x087d('0x1c'),QUERY,_0xf992e1,_0x20ffa6),{'type':dbH['sequelize'][_0x087d('0x15')][_0x087d('0x1d')]}));});if(_0x306d68>0x0){_0x20ffa6+=_0xf992e1;_0x3e8a5e[_0x087d('0x1b')](dbH['sequelize']['query'](util[_0x087d('0xb')](_0x087d('0x1c'),QUERY,_0x306d68,_0x20ffa6),{'type':dbH[_0x087d('0x12')][_0x087d('0x15')][_0x087d('0x1d')]}));}}}else{_0x3e8a5e['push'](dbH[_0x087d('0x12')][_0x087d('0x13')](QUERY,{'type':dbH[_0x087d('0x12')][_0x087d('0x15')][_0x087d('0x1d')]}));}var _0x4a97d3=path[_0x087d('0x1e')](PATH);var _0x549a71=path[_0x087d('0x1f')](PATH,_0x087d('0x20'));var _0x345b1a=_0x2b76f1[_0x087d('0x21')]&&_0x3e8a5e[_0x087d('0x18')]>0x1;var _0x616e6c=[];if(!fs[_0x087d('0x22')](path[_0x087d('0x23')](_0x4a97d3,_0x549a71))&&_0x345b1a){fs['mkdirSync'](path['join'](_0x4a97d3,_0x549a71));}return BPromise[_0x087d('0x24')](_0x3e8a5e,function(_0x5e1f57){_0x616e6c[_0x087d('0x1b')](_0x5e1f57);})['then'](function(){for(var _0x2d9682=0x0;_0x2d9682<_0x616e6c[_0x087d('0x18')];_0x2d9682+=0x1){var _0x55de6;var _0x124a10=_0x616e6c[_0x2d9682];if(_0x345b1a){_0x55de6=path[_0x087d('0x23')](_0x4a97d3,_0x549a71,util[_0x087d('0xb')]('%s%d.%s',_0x549a71,_0x2d9682,_0x087d('0x25')));}else{_0x55de6=path[_0x087d('0x23')](_0x4a97d3,util[_0x087d('0xb')](_0x087d('0x26'),_0x549a71,_0x087d('0x25')));}fs['writeFileSync'](_0x55de6,json2xls(_0x124a10),'binary');}})[_0x087d('0x11')](function(){if(_0x345b1a){return new Promise(function(_0x15bebe){zipdir(path['join'](_0x4a97d3,_0x549a71),{'saveTo':path[_0x087d('0x23')](_0x4a97d3,util[_0x087d('0xb')](_0x087d('0x26'),_0x549a71,_0x087d('0x27')))},function(_0x32d547,_0x3040c3){rimraf(path[_0x087d('0x23')](_0x4a97d3,_0x549a71),function(){});_0x15bebe(_0x087d('0x28'));});});}})['then'](function(){logger['info'](util[_0x087d('0xb')](_0x087d('0x29'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x087d('0x2a'),_0x345b1a?util[_0x087d('0xb')]('%s.%s',_0x549a71,_0x345b1a?_0x087d('0x27'):_0x087d('0x25')):null);});})['catch'](function(_0x1a9b9b){logger['info'](util['format'](_0x087d('0x2b'),EXTRACTED_REPORT_ID,_0x087d('0xd')),util['inspect'](_0x1a9b9b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x087d('0x2c'));})[_0x087d('0x2d')](function(){process[_0x087d('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xae8c=['update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','split','length','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','binary','%s.%s','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','path','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename'];(function(_0x5e8eae,_0x4f81e0){var _0xdd09cd=function(_0x28c85c){while(--_0x28c85c){_0x5e8eae['push'](_0x5e8eae['shift']());}};_0xdd09cd(++_0x4f81e0);}(_0xae8c,0x14c));var _0xcae8=function(_0x17ad1c,_0x124722){_0x17ad1c=_0x17ad1c-0x0;var _0x310b59=_0xae8c[_0x17ad1c];return _0x310b59;};'use strict';var util=require('util');var path=require(_0xcae8('0x0'));var _=require(_0xcae8('0x1'));var fs=require('fs');var json2xls=require(_0xcae8('0x2'));var BPromise=require(_0xcae8('0x3'));var zipdir=require(_0xcae8('0x4'));var rimraf=require('rimraf');var db=require(_0xcae8('0x5'))['db'];var dbH=require(_0xcae8('0x5'))[_0xcae8('0x6')];var logger=require(_0xcae8('0x7'))(_0xcae8('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xcae8('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xb45b7e,_0x45ad3b){var _0x211418={'status':_0xb45b7e};var _0x5b2985={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x45ad3b){_0x211418[_0xcae8('0xa')]=_0x45ad3b;}return db['AnalyticExtractedReport'][_0xcae8('0xb')](_0x211418,_0x5b2985);}function main(){var _0x3dc50f=0x1388;var _0x222477;logger[_0xcae8('0xc')](util[_0xcae8('0xd')](_0xcae8('0xe'),EXTRACTED_REPORT_ID,_0xcae8('0xf')));return db['Setting'][_0xcae8('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})[_0xcae8('0x11')](function(_0x46ab13){if(_0x46ab13){_0x222477=_0x46ab13;_0x3dc50f=_0x222477['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0xcae8('0x12')][_0xcae8('0x13')](util['format'](_0xcae8('0x14'),QUERY),{'type':dbH[_0xcae8('0x12')]['QueryTypes'][_0xcae8('0x15')]});})['then'](function(_0x419a6a){if(!_0x419a6a[0x0][_0xcae8('0x16')]){return analyticExtractedReport(_0xcae8('0x17'));}var _0x505871=[];var _0x36b3d5=0x0;if(_0x222477['split']){if(_0x419a6a&&_0x419a6a['length']){var _0xdb9079=_['range'](_0x419a6a[0x0]['num']/_0x3dc50f);var _0x926615=Number[_0xcae8('0x18')](_0x419a6a[0x0][_0xcae8('0x16')]/_0x3dc50f)?_0x419a6a[0x0][_0xcae8('0x16')]%_0x3dc50f:0x0;_0xdb9079[_0xcae8('0x19')](function(_0x55f955){if(_0x55f955>0x0){_0x36b3d5+=_0x3dc50f;}_0x505871[_0xcae8('0x1a')](dbH[_0xcae8('0x12')][_0xcae8('0x13')](util[_0xcae8('0xd')](_0xcae8('0x1b'),QUERY,_0x3dc50f,_0x36b3d5),{'type':dbH[_0xcae8('0x12')]['QueryTypes']['SELECT']}));});if(_0x926615>0x0){_0x36b3d5+=_0x3dc50f;_0x505871[_0xcae8('0x1a')](dbH[_0xcae8('0x12')][_0xcae8('0x13')](util[_0xcae8('0xd')](_0xcae8('0x1b'),QUERY,_0x926615,_0x36b3d5),{'type':dbH[_0xcae8('0x12')]['QueryTypes'][_0xcae8('0x15')]}));}}}else{_0x505871[_0xcae8('0x1a')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0xcae8('0x12')][_0xcae8('0x1c')][_0xcae8('0x15')]}));}var _0x2c932e=path[_0xcae8('0x1d')](PATH);var _0x1111c6=path[_0xcae8('0x1e')](PATH,_0xcae8('0x1f'));var _0x2f1873=_0x222477[_0xcae8('0x20')]&&_0x505871[_0xcae8('0x21')]>0x1;var _0x5be47d=[];if(!fs[_0xcae8('0x22')](path[_0xcae8('0x23')](_0x2c932e,_0x1111c6))&&_0x2f1873){fs[_0xcae8('0x24')](path[_0xcae8('0x23')](_0x2c932e,_0x1111c6));}return BPromise[_0xcae8('0x25')](_0x505871,function(_0x466035){_0x5be47d[_0xcae8('0x1a')](_0x466035);})[_0xcae8('0x11')](function(){for(var _0x20f596=0x0;_0x20f596<_0x5be47d['length'];_0x20f596+=0x1){var _0x9406ce;var _0x51dad1=_0x5be47d[_0x20f596];if(_0x2f1873){_0x9406ce=path[_0xcae8('0x23')](_0x2c932e,_0x1111c6,util[_0xcae8('0xd')](_0xcae8('0x26'),_0x1111c6,_0x20f596,_0xcae8('0x27')));}else{_0x9406ce=path[_0xcae8('0x23')](_0x2c932e,util[_0xcae8('0xd')]('%s.%s',_0x1111c6,_0xcae8('0x27')));}fs['writeFileSync'](_0x9406ce,json2xls(_0x51dad1),_0xcae8('0x28'));}})[_0xcae8('0x11')](function(){if(_0x2f1873){return new Promise(function(_0x27ca43){zipdir(path[_0xcae8('0x23')](_0x2c932e,_0x1111c6),{'saveTo':path[_0xcae8('0x23')](_0x2c932e,util['format'](_0xcae8('0x29'),_0x1111c6,_0xcae8('0x2a')))},function(_0x2b0c95,_0x54dbc0){rimraf(path[_0xcae8('0x23')](_0x2c932e,_0x1111c6),function(){});_0x27ca43(_0xcae8('0x2b'));});});}})[_0xcae8('0x11')](function(){logger['info'](util[_0xcae8('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xcae8('0xf')));return analyticExtractedReport(_0xcae8('0x2c'),_0x2f1873?util[_0xcae8('0xd')](_0xcae8('0x29'),_0x1111c6,_0x2f1873?_0xcae8('0x2a'):'xlsx'):null);});})[_0xcae8('0x2d')](function(_0x1e3602){logger[_0xcae8('0xc')](util[_0xcae8('0xd')](_0xcae8('0x2e'),EXTRACTED_REPORT_ID,_0xcae8('0xf')),util['inspect'](_0x1e3602,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xcae8('0x2f')](function(){process[_0xcae8('0x30')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 0e0ba73..e6bf763 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 _0x4816=['):Goto(','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','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','appType','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','last','concat','Hangup','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extension','extensions','push','type','format','context','inbound','CDR(routeid)=','VoiceExtensionId','outbound','Set','${EXTEN:','cutdigits','ExecIf'];(function(_0xd1bbc5,_0x49370a){var _0x506e97=function(_0x1f0165){while(--_0x1f0165){_0xd1bbc5['push'](_0xd1bbc5['shift']());}};_0x506e97(++_0x49370a);}(_0x4816,0xdb));var _0x6481=function(_0x129216,_0x5c208d){_0x129216=_0x129216-0x0;var _0x2a0306=_0x4816[_0x129216];return _0x2a0306;};'use strict';var _=require(_0x6481('0x0'));var util=require(_0x6481('0x1'));function rewrite(_0x3b98b1,_0x3f7b58){var _0x3ed77b=this;return _0x3b98b1[_0x6481('0x2')][_0x6481('0x3')][_0x6481('0x4')]({'raw':!![]})[_0x6481('0x5')](function(_0xa194b1){_0x3ed77b[_0x6481('0x6')]=_0xa194b1;return _0x3b98b1['models'][_0x6481('0x7')][_0x6481('0x4')]({'where':{'IntervalId':_0x3f7b58[_0x6481('0x8')]},'raw':!![]});})[_0x6481('0x5')](function(_0x2b17a3){return _0x3b98b1[_0x6481('0x2')][_0x6481('0x7')][_0x6481('0x4')]({'where':{'exten':{'$in':_[_0x6481('0x9')](_[_0x6481('0xa')](_0x2b17a3,_0x6481('0xb')))}},'order':[{'raw':_0x6481('0xc')}],'raw':!![]});})[_0x6481('0x5')](function(_0x1bc829){var _0x5bcb54=_[_0x6481('0xd')](_0x1bc829,{'priority':'1'});var _0x4216bc=_[_0x6481('0xd')](_0x1bc829,{'isApp':0x1});var _0x2ca583=_[_0x6481('0xe')](_0x4216bc,'exten');var _0x152133=[_0x6481('0xf'),_0x6481('0x10')];var _0x718b5b=[];var _0xb28888=[];for(var _0x3142bd in _0x2ca583){if(_0x2ca583[_0x6481('0x11')](_0x3142bd)){_0x3ed77b[_0x6481('0x12')]=0x2;_0x3ed77b['extensions']=[];_0x3ed77b[_0x6481('0x13')]=_['find'](_0x5bcb54,{'exten':_0x2ca583[_0x3142bd][0x0][_0x6481('0xb')]});_0x3ed77b[_0x6481('0x14')][_0x6481('0x15')]({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':'Set','appdata':util[_0x6481('0x17')]('CDR(type)=%s',_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')]),'context':_0x2ca583[_0x3142bd][0x0][_0x6481('0x18')],'exten':_0x2ca583[_0x3142bd][0x0][_0x6481('0xb')],'priority':_0x3ed77b['priority']++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0]['VoiceExtensionId']});if(_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')]===_0x6481('0x19')){_0x3ed77b[_0x6481('0x14')][_0x6481('0x15')]({'type':_0x2ca583[_0x3142bd][0x0]['type'],'app':'Set','appdata':_0x6481('0x1a')+_0x2ca583[_0x3142bd][0x0][_0x6481('0x1b')],'context':_0x2ca583[_0x3142bd][0x0][_0x6481('0x18')],'exten':_0x2ca583[_0x3142bd][0x0]['exten'],'priority':_0x3ed77b[_0x6481('0x12')]++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0]['VoiceExtensionId']});}else if(_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')]===_0x6481('0x1c')){if(_0x3ed77b[_0x6481('0x13')]){_0x3ed77b[_0x6481('0x14')][_0x6481('0x15')]({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':_0x6481('0x1d'),'appdata':'CDR(destination)='+(_0x3ed77b['extension']['cutdigits']?_0x6481('0x1e')+_0x3ed77b[_0x6481('0x13')][_0x6481('0x1f')]+'}':'${EXTEN}'),'context':_0x2ca583[_0x3142bd][0x0][_0x6481('0x18')],'exten':_0x2ca583[_0x3142bd][0x0][_0x6481('0xb')],'priority':_0x3ed77b[_0x6481('0x12')]++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0][_0x6481('0x1b')]});}_0x3ed77b['extensions'][_0x6481('0x15')]({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':_0x6481('0x1d'),'appdata':'CDR(routeid)='+_0x2ca583[_0x3142bd][0x0][_0x6481('0x1b')],'context':_0x2ca583[_0x3142bd][0x0][_0x6481('0x18')],'exten':_0x2ca583[_0x3142bd][0x0]['exten'],'priority':_0x3ed77b[_0x6481('0x12')]++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0]['VoiceExtensionId']});var _0x15bd5d=_0x3ed77b[_0x6481('0x12')]++;_0x3ed77b[_0x6481('0x14')]['push']({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':_0x6481('0x20'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x15bd5d+0x2)+_0x6481('0x21')+(_0x15bd5d+0x1)+')','context':_0x2ca583[_0x3142bd][0x0][_0x6481('0x18')],'exten':_0x2ca583[_0x3142bd][0x0]['exten'],'priority':_0x15bd5d,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0][_0x6481('0x1b')]});if(_0x3ed77b['extension']){_0x3ed77b[_0x6481('0x14')]['push']({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':_0x6481('0x1d'),'appdata':_0x3ed77b[_0x6481('0x13')][_0x6481('0x1f')]?'CDR(prefix)=${EXTEN:0:'+_0x3ed77b['extension'][_0x6481('0x1f')]+'}':'CDR(prefix)=noprefix','context':_0x2ca583[_0x3142bd][0x0][_0x6481('0x18')],'exten':_0x2ca583[_0x3142bd][0x0][_0x6481('0xb')],'priority':_0x3ed77b[_0x6481('0x12')]++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0][_0x6481('0x1b')]});}_0x3ed77b['extensions'][_0x6481('0x15')]({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':'Set','appdata':_0x6481('0x22')+_0x2ca583[_0x3142bd][0x0][_0x6481('0x1b')],'context':_0x2ca583[_0x3142bd][0x0][_0x6481('0x18')],'exten':_0x2ca583[_0x3142bd][0x0][_0x6481('0xb')],'priority':_0x3ed77b[_0x6481('0x12')]++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0]['VoiceExtensionId']});if(_0x3ed77b['extension']&&_0x3ed77b['extension']['hasOwnProperty'](_0x6481('0x23'))&&_0x3ed77b[_0x6481('0x13')][_0x6481('0x23')]!==_0x6481('0x24')){_0x3ed77b[_0x6481('0x14')][_0x6481('0x15')]({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':_0x6481('0x1d'),'appdata':_0x6481('0x25'),'context':_0x2ca583[_0x3142bd][0x0]['context'],'exten':_0x2ca583[_0x3142bd][0x0]['exten'],'priority':_0x3ed77b[_0x6481('0x12')]++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0][_0x6481('0x1b')]});_0x3ed77b[_0x6481('0x14')][_0x6481('0x15')]({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':_0x6481('0x1d'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x3ed77b[_0x6481('0x13')][_0x6481('0x23')]||_0x6481('0x26'),'context':_0x2ca583[_0x3142bd][0x0]['context'],'exten':_0x2ca583[_0x3142bd][0x0][_0x6481('0xb')],'priority':_0x3ed77b[_0x6481('0x12')]++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0][_0x6481('0x1b')]});}}_0x3ed77b[_0x6481('0x14')]['push']({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':_0x6481('0x1d'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x2ca583[_0x3142bd][0x0]['context'],'exten':_0x2ca583[_0x3142bd][0x0][_0x6481('0xb')],'priority':_0x3ed77b['priority']++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0]['VoiceExtensionId']});_0x3ed77b[_0x6481('0x14')]['push']({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2ca583[_0x3142bd][0x0][_0x6481('0x18')],'exten':_0x2ca583[_0x3142bd][0x0][_0x6481('0xb')],'priority':_0x3ed77b['priority']++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0][_0x6481('0x1b')]});_0x3ed77b['extensions'][_0x6481('0x15')]({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':_0x6481('0x1d'),'appdata':'MONITOR_OPTIONS=ab','context':_0x2ca583[_0x3142bd][0x0]['context'],'exten':_0x2ca583[_0x3142bd][0x0][_0x6481('0xb')],'priority':_0x3ed77b[_0x6481('0x12')]++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0][_0x6481('0x1b')]});for(var _0x109a0f=0x0,_0x40586a=0x0;_0x109a0f<_0x2ca583[_0x3142bd]['length'];_0x109a0f+=0x1,_0x40586a=0x0){var _0x17c6cc=_0x2ca583[_0x3142bd][_0x109a0f];if(_0x17c6cc[_0x6481('0x16')]){_0x17c6cc[_0x6481('0x16')]=_0x17c6cc[_0x6481('0x16')][_0x6481('0x27')]();}var _0x316046=[];var _0x2c0825=[];delete _0x17c6cc['id'];delete _0x17c6cc[_0x6481('0x28')];delete _0x17c6cc[_0x6481('0x29')];var _0x5f4391=_0x17c6cc['interval']!==_0x6481('0x2a')?[_0x17c6cc['interval']]:_0x17c6cc[_0x6481('0x8')]?_[_0x6481('0xa')](_[_0x6481('0xd')](_0x3ed77b[_0x6481('0x6')],{'IntervalId':_0x17c6cc['IntervalId']}),_0x6481('0x2b')):[];if(_0x17c6cc['hasOwnProperty'](_0x6481('0x2c'))){if(_0x17c6cc[_0x6481('0x2c')]&&_0x17c6cc[_0x6481('0x2c')]!=='--'){_0x316046['push']({'type':_0x17c6cc[_0x6481('0x16')],'app':_0x6481('0x1d'),'appdata':'CDR(tag)='+_0x17c6cc[_0x6481('0x2c')],'context':_0x17c6cc[_0x6481('0x18')],'exten':_0x17c6cc['exten'],'priority':_0x5f4391[_0x6481('0x2d')]+_0x3ed77b['priority']+_0x40586a++,'VoiceExtensionId':_0x17c6cc['VoiceExtensionId']});}}if(_0x17c6cc[_0x6481('0x16')]==='outbound'&&_0x17c6cc[_0x6481('0x11')](_0x6481('0x2e'))){if(_0x17c6cc[_0x6481('0x2e')]){_0x316046['push']({'type':_0x17c6cc[_0x6481('0x16')],'app':_0x6481('0x20'),'appdata':_0x6481('0x2f')+_0x17c6cc[_0x6481('0x2e')]+')','context':_0x17c6cc[_0x6481('0x18')],'exten':_0x17c6cc[_0x6481('0xb')],'priority':_0x5f4391[_0x6481('0x2d')]+_0x3ed77b[_0x6481('0x12')]+_0x40586a++,'VoiceExtensionId':_0x17c6cc[_0x6481('0x1b')]});}else{_0x316046[_0x6481('0x15')]({'type':_0x17c6cc[_0x6481('0x16')],'app':_0x6481('0x20'),'appdata':_0x6481('0x30'),'context':_0x17c6cc[_0x6481('0x18')],'exten':_0x17c6cc[_0x6481('0xb')],'priority':_0x5f4391[_0x6481('0x2d')]+_0x3ed77b['priority']+_0x40586a++,'VoiceExtensionId':_0x17c6cc[_0x6481('0x1b')]});}}if(_0x17c6cc['hasOwnProperty'](_0x6481('0x31'))){if(_0x152133[_0x6481('0x32')](_0x17c6cc[_0x6481('0x33')][_0x6481('0x27')]())>=0x0&&_0x17c6cc[_0x6481('0x34')]!=='custom'){if(_0x17c6cc[_0x6481('0x31')]){_0x316046['push']({'type':_0x17c6cc['type'],'app':_0x6481('0x20'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x17c6cc[_0x6481('0x18')],'exten':_0x17c6cc[_0x6481('0xb')],'priority':_0x5f4391[_0x6481('0x2d')]+_0x3ed77b[_0x6481('0x12')]+_0x40586a++,'VoiceExtensionId':_0x17c6cc['VoiceExtensionId']});_0x316046[_0x6481('0x15')]({'type':_0x17c6cc[_0x6481('0x16')],'app':'Set','appdata':_0x6481('0x35'),'context':_0x17c6cc[_0x6481('0x18')],'exten':_0x17c6cc[_0x6481('0xb')],'priority':_0x5f4391[_0x6481('0x2d')]+_0x3ed77b[_0x6481('0x12')]+_0x40586a++,'VoiceExtensionId':_0x17c6cc[_0x6481('0x1b')]});}else{_0x316046[_0x6481('0x15')]({'type':_0x17c6cc[_0x6481('0x16')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x17c6cc[_0x6481('0x18')],'exten':_0x17c6cc[_0x6481('0xb')],'priority':_0x5f4391[_0x6481('0x2d')]+_0x3ed77b[_0x6481('0x12')]+_0x40586a++,'VoiceExtensionId':_0x17c6cc[_0x6481('0x1b')]});_0x316046[_0x6481('0x15')]({'type':_0x17c6cc[_0x6481('0x16')],'app':_0x6481('0x1d'),'appdata':_0x6481('0x36'),'context':_0x17c6cc[_0x6481('0x18')],'exten':_0x17c6cc[_0x6481('0xb')],'priority':_0x5f4391[_0x6481('0x2d')]+_0x3ed77b[_0x6481('0x12')]+_0x40586a++,'VoiceExtensionId':_0x17c6cc['VoiceExtensionId']});}}}for(var _0x7409d9=0x0;_0x7409d9<_0x5f4391[_0x6481('0x2d')];_0x7409d9+=0x1){var _0x52b929=_0x3ed77b[_0x6481('0x12')]+_0x5f4391[_0x6481('0x2d')];var _0x5f50d9=_0x7409d9===_0x5f4391[_0x6481('0x2d')]-0x1?_0x3ed77b[_0x6481('0x12')]+_0x316046['length']+_0x2c0825[_0x6481('0x2d')]+0x2:_0x3ed77b['priority']+_0x7409d9+0x1;_0x316046['splice'](_0x7409d9,0x0,{'type':_0x17c6cc[_0x6481('0x16')],'app':'GotoIfTime','appdata':_0x5f4391[_0x7409d9]+'?'+_0x17c6cc[_0x6481('0x18')]+_0x6481('0x37')+_0x52b929+':'+_0x17c6cc[_0x6481('0x18')]+',${EXTEN},'+_0x5f50d9,'exten':_0x17c6cc[_0x6481('0xb')],'context':_0x17c6cc[_0x6481('0x18')],'priority':_0x3ed77b[_0x6481('0x12')]+_0x7409d9,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0]['VoiceExtensionId']});}_0x17c6cc[_0x6481('0x12')]=_0x316046[_0x6481('0x2d')]?_[_0x6481('0x38')](_0x316046)['priority']+0x1:_0x3ed77b[_0x6481('0x12')];_0x3ed77b[_0x6481('0x12')]=(_0x2c0825['length']?_['last'](_0x2c0825)['priority']:_0x17c6cc['priority'])+0x1;_0x3ed77b[_0x6481('0x14')]=_[_0x6481('0x39')](_0x3ed77b[_0x6481('0x14')],_0x316046,[_0x17c6cc],_0x2c0825);}_0x3ed77b[_0x6481('0x14')]['push']({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':_0x6481('0x3a'),'exten':_0x2ca583[_0x3142bd][0x0]['exten'],'context':_0x2ca583[_0x3142bd][0x0][_0x6481('0x18')],'priority':_0x3ed77b['priority'],'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0]['VoiceExtensionId']});_0x718b5b[_0x6481('0x15')](_0x2ca583[_0x3142bd][0x0]['VoiceExtensionId']);_0xb28888=_[_0x6481('0x39')](_0xb28888,_0x3ed77b[_0x6481('0x14')]);}}return _0x3b98b1['transaction'](function(_0x371e6a){return _0x3b98b1[_0x6481('0x2')][_0x6481('0x7')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x718b5b}},'transaction':_0x371e6a})[_0x6481('0x5')](function(_0x2ee97d){return _0x3b98b1[_0x6481('0x2')]['VoiceExtension']['bulkCreate'](_[_0x6481('0x3b')](_0xb28888,_0x6481('0x12')),{'transaction':_0x371e6a});});});})[_0x6481('0x3c')](function(_0xa65b00){console[_0x6481('0x3d')](_0xa65b00);});}exports[_0x6481('0x3e')]=rewrite; \ No newline at end of file +var _0x2083=['$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','transaction','destroy','sortBy','rewrite','lodash','util','models','Interval','findAll','then','intervals','IntervalId','VoiceExtension','uniq','groupBy','queue','hasOwnProperty','priority','extensions','extension','find','push','format','CDR(type)=%s','type','context','exten','inbound','Set','CDR(routeid)=','VoiceExtensionId','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','none','_XCALLY_MIXMONITOR_FORMAT=','recordingFormat','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','filter','tag','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','length'];(function(_0x4f9939,_0x56fa3b){var _0x5e8326=function(_0x46752d){while(--_0x46752d){_0x4f9939['push'](_0x4f9939['shift']());}};_0x5e8326(++_0x56fa3b);}(_0x2083,0x1b6));var _0x3208=function(_0x79d5d0,_0x3dc9ef){_0x79d5d0=_0x79d5d0-0x0;var _0xfb3597=_0x2083[_0x79d5d0];return _0xfb3597;};'use strict';var _=require(_0x3208('0x0'));var util=require(_0x3208('0x1'));function rewrite(_0x44127b,_0x150d2b){var _0x1864da=this;return _0x44127b[_0x3208('0x2')][_0x3208('0x3')][_0x3208('0x4')]({'raw':!![]})[_0x3208('0x5')](function(_0x59d905){_0x1864da[_0x3208('0x6')]=_0x59d905;return _0x44127b[_0x3208('0x2')]['VoiceExtension'][_0x3208('0x4')]({'where':{'IntervalId':_0x150d2b[_0x3208('0x7')]},'raw':!![]});})['then'](function(_0x22c021){return _0x44127b[_0x3208('0x2')][_0x3208('0x8')]['findAll']({'where':{'exten':{'$in':_[_0x3208('0x9')](_['map'](_0x22c021,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x3208('0x5')](function(_0x4390d4){var _0x59187a=_['filter'](_0x4390d4,{'priority':'1'});var _0x5decb7=_['filter'](_0x4390d4,{'isApp':0x1});var _0x5be0b6=_[_0x3208('0xa')](_0x5decb7,'exten');var _0x125c8e=[_0x3208('0xb'),'playback'];var _0x55e16d=[];var _0x3a1cb7=[];for(var _0x207470 in _0x5be0b6){if(_0x5be0b6[_0x3208('0xc')](_0x207470)){_0x1864da[_0x3208('0xd')]=0x2;_0x1864da[_0x3208('0xe')]=[];_0x1864da[_0x3208('0xf')]=_[_0x3208('0x10')](_0x59187a,{'exten':_0x5be0b6[_0x207470][0x0]['exten']});_0x1864da['extensions'][_0x3208('0x11')]({'type':_0x5be0b6[_0x207470][0x0]['type'],'app':'Set','appdata':util[_0x3208('0x12')](_0x3208('0x13'),_0x5be0b6[_0x207470][0x0][_0x3208('0x14')]),'context':_0x5be0b6[_0x207470][0x0][_0x3208('0x15')],'exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'priority':_0x1864da[_0x3208('0xd')]++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0]['VoiceExtensionId']});if(_0x5be0b6[_0x207470][0x0][_0x3208('0x14')]===_0x3208('0x17')){_0x1864da[_0x3208('0xe')]['push']({'type':_0x5be0b6[_0x207470][0x0][_0x3208('0x14')],'app':_0x3208('0x18'),'appdata':_0x3208('0x19')+_0x5be0b6[_0x207470][0x0][_0x3208('0x1a')],'context':_0x5be0b6[_0x207470][0x0][_0x3208('0x15')],'exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'priority':_0x1864da[_0x3208('0xd')]++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0][_0x3208('0x1a')]});}else if(_0x5be0b6[_0x207470][0x0]['type']==='outbound'){if(_0x1864da[_0x3208('0xf')]){_0x1864da[_0x3208('0xe')][_0x3208('0x11')]({'type':_0x5be0b6[_0x207470][0x0]['type'],'app':_0x3208('0x18'),'appdata':'CDR(destination)='+(_0x1864da[_0x3208('0xf')][_0x3208('0x1b')]?_0x3208('0x1c')+_0x1864da[_0x3208('0xf')]['cutdigits']+'}':_0x3208('0x1d')),'context':_0x5be0b6[_0x207470][0x0][_0x3208('0x15')],'exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'priority':_0x1864da['priority']++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0]['VoiceExtensionId']});}_0x1864da[_0x3208('0xe')][_0x3208('0x11')]({'type':_0x5be0b6[_0x207470][0x0][_0x3208('0x14')],'app':_0x3208('0x18'),'appdata':_0x3208('0x19')+_0x5be0b6[_0x207470][0x0][_0x3208('0x1a')],'context':_0x5be0b6[_0x207470][0x0]['context'],'exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'priority':_0x1864da['priority']++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0][_0x3208('0x1a')]});var _0x30f1bb=_0x1864da[_0x3208('0xd')]++;_0x1864da['extensions'][_0x3208('0x11')]({'type':_0x5be0b6[_0x207470][0x0][_0x3208('0x14')],'app':_0x3208('0x1e'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x30f1bb+0x2)+_0x3208('0x1f')+(_0x30f1bb+0x1)+')','context':_0x5be0b6[_0x207470][0x0]['context'],'exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'priority':_0x30f1bb,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0]['VoiceExtensionId']});if(_0x1864da['extension']){_0x1864da[_0x3208('0xe')][_0x3208('0x11')]({'type':_0x5be0b6[_0x207470][0x0]['type'],'app':'Set','appdata':_0x1864da[_0x3208('0xf')][_0x3208('0x1b')]?_0x3208('0x20')+_0x1864da[_0x3208('0xf')][_0x3208('0x1b')]+'}':_0x3208('0x21'),'context':_0x5be0b6[_0x207470][0x0][_0x3208('0x15')],'exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'priority':_0x1864da[_0x3208('0xd')]++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0]['VoiceExtensionId']});}_0x1864da[_0x3208('0xe')]['push']({'type':_0x5be0b6[_0x207470][0x0][_0x3208('0x14')],'app':_0x3208('0x18'),'appdata':'outboundrouteid='+_0x5be0b6[_0x207470][0x0][_0x3208('0x1a')],'context':_0x5be0b6[_0x207470][0x0][_0x3208('0x15')],'exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'priority':_0x1864da[_0x3208('0xd')]++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0]['VoiceExtensionId']});if(_0x1864da[_0x3208('0xf')]&&_0x1864da['extension']['hasOwnProperty']('recordingFormat')&&_0x1864da[_0x3208('0xf')]['recordingFormat']!==_0x3208('0x22')){_0x1864da[_0x3208('0xe')][_0x3208('0x11')]({'type':_0x5be0b6[_0x207470][0x0][_0x3208('0x14')],'app':_0x3208('0x18'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x5be0b6[_0x207470][0x0][_0x3208('0x15')],'exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'priority':_0x1864da[_0x3208('0xd')]++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0]['VoiceExtensionId']});_0x1864da[_0x3208('0xe')][_0x3208('0x11')]({'type':_0x5be0b6[_0x207470][0x0]['type'],'app':'Set','appdata':_0x3208('0x23')+_0x1864da['extension'][_0x3208('0x24')]||_0x3208('0x25'),'context':_0x5be0b6[_0x207470][0x0]['context'],'exten':_0x5be0b6[_0x207470][0x0]['exten'],'priority':_0x1864da[_0x3208('0xd')]++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0]['VoiceExtensionId']});}}_0x1864da[_0x3208('0xe')][_0x3208('0x11')]({'type':_0x5be0b6[_0x207470][0x0]['type'],'app':_0x3208('0x18'),'appdata':_0x3208('0x26'),'context':_0x5be0b6[_0x207470][0x0][_0x3208('0x15')],'exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'priority':_0x1864da[_0x3208('0xd')]++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0][_0x3208('0x1a')]});_0x1864da[_0x3208('0xe')][_0x3208('0x11')]({'type':_0x5be0b6[_0x207470][0x0][_0x3208('0x14')],'app':_0x3208('0x18'),'appdata':_0x3208('0x27'),'context':_0x5be0b6[_0x207470][0x0][_0x3208('0x15')],'exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'priority':_0x1864da['priority']++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0][_0x3208('0x1a')]});_0x1864da['extensions']['push']({'type':_0x5be0b6[_0x207470][0x0][_0x3208('0x14')],'app':_0x3208('0x18'),'appdata':_0x3208('0x28'),'context':_0x5be0b6[_0x207470][0x0][_0x3208('0x15')],'exten':_0x5be0b6[_0x207470][0x0]['exten'],'priority':_0x1864da[_0x3208('0xd')]++,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0]['VoiceExtensionId']});for(var _0x2807ab=0x0,_0x42fc49=0x0;_0x2807ab<_0x5be0b6[_0x207470]['length'];_0x2807ab+=0x1,_0x42fc49=0x0){var _0x4b415d=_0x5be0b6[_0x207470][_0x2807ab];if(_0x4b415d['type']){_0x4b415d[_0x3208('0x14')]=_0x4b415d[_0x3208('0x14')][_0x3208('0x29')]();}var _0x991bc4=[];var _0x11933e=[];delete _0x4b415d['id'];delete _0x4b415d[_0x3208('0x2a')];delete _0x4b415d[_0x3208('0x2b')];var _0x3d47b0=_0x4b415d[_0x3208('0x2c')]!==_0x3208('0x2d')?[_0x4b415d['interval']]:_0x4b415d[_0x3208('0x7')]?_['map'](_[_0x3208('0x2e')](_0x1864da['intervals'],{'IntervalId':_0x4b415d[_0x3208('0x7')]}),_0x3208('0x2c')):[];if(_0x4b415d[_0x3208('0xc')](_0x3208('0x2f'))){if(_0x4b415d['tag']&&_0x4b415d['tag']!=='--'){_0x991bc4[_0x3208('0x11')]({'type':_0x4b415d[_0x3208('0x14')],'app':_0x3208('0x18'),'appdata':'CDR(tag)='+_0x4b415d[_0x3208('0x2f')],'context':_0x4b415d[_0x3208('0x15')],'exten':_0x4b415d['exten'],'priority':_0x3d47b0['length']+_0x1864da['priority']+_0x42fc49++,'VoiceExtensionId':_0x4b415d[_0x3208('0x1a')]});}}if(_0x4b415d[_0x3208('0x14')]===_0x3208('0x30')&&_0x4b415d[_0x3208('0xc')](_0x3208('0x31'))){if(_0x4b415d[_0x3208('0x31')]){_0x991bc4[_0x3208('0x11')]({'type':_0x4b415d[_0x3208('0x14')],'app':_0x3208('0x1e'),'appdata':_0x3208('0x32')+_0x4b415d[_0x3208('0x31')]+')','context':_0x4b415d[_0x3208('0x15')],'exten':_0x4b415d['exten'],'priority':_0x3d47b0[_0x3208('0x33')]+_0x1864da[_0x3208('0xd')]+_0x42fc49++,'VoiceExtensionId':_0x4b415d[_0x3208('0x1a')]});}else{_0x991bc4[_0x3208('0x11')]({'type':_0x4b415d[_0x3208('0x14')],'app':_0x3208('0x1e'),'appdata':_0x3208('0x34'),'context':_0x4b415d[_0x3208('0x15')],'exten':_0x4b415d[_0x3208('0x16')],'priority':_0x3d47b0[_0x3208('0x33')]+_0x1864da['priority']+_0x42fc49++,'VoiceExtensionId':_0x4b415d[_0x3208('0x1a')]});}}if(_0x4b415d['hasOwnProperty'](_0x3208('0x35'))){if(_0x125c8e[_0x3208('0x36')](_0x4b415d[_0x3208('0x37')]['toLowerCase']())>=0x0&&_0x4b415d[_0x3208('0x38')]!==_0x3208('0x39')){if(_0x4b415d[_0x3208('0x35')]){_0x991bc4['push']({'type':_0x4b415d['type'],'app':'ExecIf','appdata':_0x3208('0x3a'),'context':_0x4b415d[_0x3208('0x15')],'exten':_0x4b415d['exten'],'priority':_0x3d47b0['length']+_0x1864da[_0x3208('0xd')]+_0x42fc49++,'VoiceExtensionId':_0x4b415d['VoiceExtensionId']});_0x991bc4[_0x3208('0x11')]({'type':_0x4b415d[_0x3208('0x14')],'app':_0x3208('0x18'),'appdata':_0x3208('0x3b'),'context':_0x4b415d[_0x3208('0x15')],'exten':_0x4b415d[_0x3208('0x16')],'priority':_0x3d47b0[_0x3208('0x33')]+_0x1864da[_0x3208('0xd')]+_0x42fc49++,'VoiceExtensionId':_0x4b415d[_0x3208('0x1a')]});}else{_0x991bc4[_0x3208('0x11')]({'type':_0x4b415d['type'],'app':'ExecIf','appdata':_0x3208('0x3c'),'context':_0x4b415d[_0x3208('0x15')],'exten':_0x4b415d[_0x3208('0x16')],'priority':_0x3d47b0[_0x3208('0x33')]+_0x1864da[_0x3208('0xd')]+_0x42fc49++,'VoiceExtensionId':_0x4b415d['VoiceExtensionId']});_0x991bc4['push']({'type':_0x4b415d[_0x3208('0x14')],'app':_0x3208('0x18'),'appdata':_0x3208('0x3d'),'context':_0x4b415d[_0x3208('0x15')],'exten':_0x4b415d[_0x3208('0x16')],'priority':_0x3d47b0[_0x3208('0x33')]+_0x1864da[_0x3208('0xd')]+_0x42fc49++,'VoiceExtensionId':_0x4b415d[_0x3208('0x1a')]});}}}for(var _0x50d590=0x0;_0x50d590<_0x3d47b0[_0x3208('0x33')];_0x50d590+=0x1){var _0x205f76=_0x1864da[_0x3208('0xd')]+_0x3d47b0[_0x3208('0x33')];var _0x1fad50=_0x50d590===_0x3d47b0[_0x3208('0x33')]-0x1?_0x1864da[_0x3208('0xd')]+_0x991bc4[_0x3208('0x33')]+_0x11933e[_0x3208('0x33')]+0x2:_0x1864da[_0x3208('0xd')]+_0x50d590+0x1;_0x991bc4[_0x3208('0x3e')](_0x50d590,0x0,{'type':_0x4b415d[_0x3208('0x14')],'app':'GotoIfTime','appdata':_0x3d47b0[_0x50d590]+'?'+_0x4b415d[_0x3208('0x15')]+_0x3208('0x3f')+_0x205f76+':'+_0x4b415d[_0x3208('0x15')]+_0x3208('0x3f')+_0x1fad50,'exten':_0x4b415d[_0x3208('0x16')],'context':_0x4b415d['context'],'priority':_0x1864da['priority']+_0x50d590,'VoiceExtensionId':_0x5be0b6[_0x207470][0x0][_0x3208('0x1a')]});}_0x4b415d[_0x3208('0xd')]=_0x991bc4[_0x3208('0x33')]?_[_0x3208('0x40')](_0x991bc4)[_0x3208('0xd')]+0x1:_0x1864da[_0x3208('0xd')];_0x1864da[_0x3208('0xd')]=(_0x11933e['length']?_['last'](_0x11933e)[_0x3208('0xd')]:_0x4b415d['priority'])+0x1;_0x1864da[_0x3208('0xe')]=_[_0x3208('0x41')](_0x1864da[_0x3208('0xe')],_0x991bc4,[_0x4b415d],_0x11933e);}_0x1864da[_0x3208('0xe')][_0x3208('0x11')]({'type':_0x5be0b6[_0x207470][0x0][_0x3208('0x14')],'app':'Hangup','exten':_0x5be0b6[_0x207470][0x0][_0x3208('0x16')],'context':_0x5be0b6[_0x207470][0x0][_0x3208('0x15')],'priority':_0x1864da['priority'],'VoiceExtensionId':_0x5be0b6[_0x207470][0x0][_0x3208('0x1a')]});_0x55e16d[_0x3208('0x11')](_0x5be0b6[_0x207470][0x0]['VoiceExtensionId']);_0x3a1cb7=_[_0x3208('0x41')](_0x3a1cb7,_0x1864da[_0x3208('0xe')]);}}return _0x44127b[_0x3208('0x42')](function(_0x4ed33a){return _0x44127b[_0x3208('0x2')]['VoiceExtension'][_0x3208('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x55e16d}},'transaction':_0x4ed33a})[_0x3208('0x5')](function(_0x1733bd){return _0x44127b[_0x3208('0x2')]['VoiceExtension']['bulkCreate'](_[_0x3208('0x44')](_0x3a1cb7,_0x3208('0xd')),{'transaction':_0x4ed33a});});});})['catch'](function(_0x46e5a0){console['error'](_0x46e5a0);});}exports[_0x3208('0x45')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 9bd8aba..aff39c1 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 _0x8066=['../../../config/logger','api','redis','defaults','localhost','../../../api/cmContact/cmContact.socket','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','errors','length','map','join','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','keys','then','push','pick','message','stringify','checkHopper','inspect','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','updatedAt','select','field','NOW()','createdAt','from','cm_contacts','where','toString','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','into','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','id\x20IN\x20?','str','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','always','sequelize','query','VoiceQueueId','catch','onlyIfOpen','all','CmList','get','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','lodash','squel','papaparse','ioredis','../../../mysqldb'];(function(_0x1f7996,_0x299a14){var _0x584609=function(_0x14c34a){while(--_0x14c34a){_0x1f7996['push'](_0x1f7996['shift']());}};_0x584609(++_0x299a14);}(_0x8066,0xd5));var _0x6806=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8066[_0x122ef9];return _0x42fba0;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x6806('0x0'));var fs=require('fs');var squel=require(_0x6806('0x1'));var Papa=require(_0x6806('0x2'));var Redis=require(_0x6806('0x3'));var db=require(_0x6806('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x6806('0x5'))(_0x6806('0x6'));config[_0x6806('0x7')]=_[_0x6806('0x8')](config[_0x6806('0x7')],{'host':_0x6806('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6806('0x7')]));require(_0x6806('0xa'))['register'](socket);try{if(!process['argv'][0x2]||process[_0x6806('0xb')][0x2]===_0x6806('0xc')||process[_0x6806('0xb')][0x2]==='null'){throw new Error(_0x6806('0xd'));}var FILEPATH=process['argv'][0x2];if(!process[_0x6806('0xb')][0x3]||process['argv'][0x3]===_0x6806('0xc')||process[_0x6806('0xb')][0x3]===_0x6806('0xe')||!process[_0x6806('0xb')][0x4]||process['argv'][0x4]===_0x6806('0xc')||process[_0x6806('0xb')][0x4]===_0x6806('0xe')){throw new Error(_0x6806('0xf'));}var FIELDS=_[_0x6806('0x10')](process[_0x6806('0xb')][0x3][_0x6806('0x11')](','),process['argv'][0x4]['split'](','));if(!process[_0x6806('0xb')][0x5]||process[_0x6806('0xb')][0x5]===_0x6806('0xc')||process[_0x6806('0xb')][0x5]===_0x6806('0xe')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x6806('0xb')][0x6]!==_0x6806('0xc')&&process[_0x6806('0xb')][0x6]!==_0x6806('0xe')?process[_0x6806('0xb')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x6806('0xb')][0x7]!=='undefined'&&process[_0x6806('0xb')][0x7]!==_0x6806('0xe')?process[_0x6806('0xb')][0x7]:null;if(!process[_0x6806('0xb')][0x8]||process[_0x6806('0xb')][0x8]===_0x6806('0xc')||process[_0x6806('0xb')][0x8]===_0x6806('0xe')){throw new Error(_0x6806('0x12'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x3b94c7){logger[_0x6806('0x13')](_0x3b94c7);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(_0x17d416,_0x135499,_0x4e8228,_0x4ad1d3){var _0x2eb19b={'message':_0x135499};_0x2eb19b[_0x17d416]=!![];if(_0x4e8228){_0x2eb19b[_0x6806('0x14')]=_0x4e8228;}if(_0x4ad1d3){_0x2eb19b[_0x6806('0x15')]=_0x4ad1d3;}return _0x2eb19b;}function isEmail(_0x355439){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))*$/[_0x6806('0x16')](_0x355439);}function checkRow(_0x33957c,_0x17b9f2,_0x47648c){return new BPromise(function(_0x11cae4,_0x541bef){if(_['isNil'](_0x33957c)){return _0x541bef(handleCheckRowError(_0x6806('0x13'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x47648c));}if(_0x33957c[_0x6806('0x17')]&&_0x33957c[_0x6806('0x17')][_0x6806('0x18')]){var _0x3bb4ba=_[_0x6806('0x19')](_0x33957c[_0x6806('0x17')],'message')[_0x6806('0x1a')](';');return _0x541bef(handleCheckRowError(_0x6806('0x13'),_0x3bb4ba,null,_0x47648c));}var _0x2c126b={};for(var _0x4b4a44 in FIELDS){if(FIELDS['hasOwnProperty'](_0x4b4a44)&&FIELDS[_0x4b4a44]){_0x2c126b[_0x4b4a44]=_0x33957c[_0x6806('0x1b')][0x0][FIELDS[_0x4b4a44]]||_0x33957c[_0x6806('0x1b')][0x0]['\ufeff'+FIELDS[_0x4b4a44]];}}if(!_0x2c126b[_0x6806('0x1c')]){return _0x541bef(handleCheckRowError(_0x6806('0x13'),_0x6806('0x1d'),null,_0x47648c));}if(!_0x2c126b['phone']){return _0x541bef(handleCheckRowError(_0x6806('0x13'),_0x6806('0x1e'),null,_0x47648c));}if(_0x2c126b[_0x6806('0x1f')]){var _0x301b73=moment(_0x2c126b['birthDate'],_0x6806('0x20'));if(!_0x301b73[_0x6806('0x21')]()){return _0x541bef(handleCheckRowError(_0x6806('0x13'),_0x6806('0x22'),null,_0x47648c));}}if(_0x2c126b['email']){if(!isEmail(_0x2c126b['email'])){return _0x541bef(handleCheckRowError(_0x6806('0x13'),_0x6806('0x23'),null,_0x47648c));}}_0x2c126b[_0x6806('0x24')]=LISTID;_0x2c126b[_0x6806('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x6806('0x18')]&&_0x17b9f2){var _0x772f70={};for(var _0x284ea1=0x0,_0x429dea=DUPLICATES['length'];_0x284ea1<_0x429dea;_0x284ea1+=0x1){_0x772f70[DUPLICATES[_0x284ea1]]=_0x2c126b[DUPLICATES[_0x284ea1]];}var _0x34a9d9=_[_0x6806('0x26')](_0x17b9f2,_0x772f70);if(_0x34a9d9){return _0x541bef(handleCheckRowError(_0x6806('0x27'),_0x6806('0x28'),_0x34a9d9,_0x47648c));}}return db[_0x6806('0x29')]['create'](_0x2c126b,{'raw':!![],'hooks':![],'fields':_[_0x6806('0x2a')](_0x2c126b)})[_0x6806('0x2b')](function(_0x36091b){if(DUPLICATES&&DUPLICATES[_0x6806('0x18')]&&_0x17b9f2){_0x17b9f2[_0x6806('0x2c')](_[_0x6806('0x2d')](_0x2c126b,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x36091b['id'];return _0x11cae4();})['catch'](function(_0x43d3f9){return _0x541bef(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0x43d3f9[_0x6806('0x2e')]||JSON[_0x6806('0x2f')](_0x43d3f9)),null,_0x47648c));});});}function checkHopper(){function _0x63505d(){return function(_0x22870f){logger[_0x6806('0x13')]('cmContact',_0x6806('0x30'),util[_0x6806('0x31')](_0x22870f,{'showHidden':![],'depth':null}));};}var _0x5c512a=function(_0x17bf94,_0xaeb28f){var _0x323bef=squel[_0x6806('0x32')]()['into'](_0x6806('0x33'))[_0x6806('0x34')]([_0x6806('0x35'),_0x6806('0x36'),_0x6806('0x37'),'ListId',_0xaeb28f,'createdAt',_0x6806('0x38')],squel[_0x6806('0x39')]()[_0x6806('0x3a')](_0x6806('0x35'),'phone')['field'](_0x6806('0x3b'),_0x6806('0x36'))['field']('id','ContactId')[_0x6806('0x3a')](LISTID['toString'](),_0x6806('0x24'))['field'](_0x17bf94['id']['toString'](),_0xaeb28f)[_0x6806('0x3a')](_0x6806('0x3b'),_0x6806('0x3c'))[_0x6806('0x3a')](_0x6806('0x3b'),'updatedAt')[_0x6806('0x3d')](_0x6806('0x3e'))['where']('deletedAt\x20IS\x20NULL')[_0x6806('0x3f')]('ListId\x20=\x20?',LISTID[_0x6806('0x40')]())['where'](_0x6806('0x41'))['where'](_0x6806('0x42'),squel[_0x6806('0x39')]()[_0x6806('0x3a')](_0x6806('0x35'))[_0x6806('0x3d')](_0x6806('0x33'))[_0x6806('0x3f')](_0xaeb28f+'\x20=\x20?',_0x17bf94['id']['toString']())))[_0x6806('0x40')]();return _0x323bef;};var _0x36ff8f=function(_0x24cc6c,_0x51b56f){var _0x329032=squel['insert']()[_0x6806('0x43')](_0x6806('0x33'))[_0x6806('0x34')]([_0x6806('0x35'),_0x6806('0x36'),_0x6806('0x37'),'ListId',_0x51b56f,_0x6806('0x3c'),'updatedAt'],squel[_0x6806('0x39')]()[_0x6806('0x3a')]('phone',_0x6806('0x35'))[_0x6806('0x3a')]('NOW()',_0x6806('0x36'))[_0x6806('0x3a')]('id',_0x6806('0x37'))['field'](LISTID[_0x6806('0x40')](),_0x6806('0x24'))[_0x6806('0x3a')](_0x24cc6c['id'][_0x6806('0x40')](),_0x51b56f)['field'](_0x6806('0x3b'),_0x6806('0x3c'))[_0x6806('0x3a')](_0x6806('0x3b'),'updatedAt')[_0x6806('0x3d')](_0x6806('0x3e'))['where'](_0x6806('0x44'))[_0x6806('0x3f')](_0x6806('0x45'),LISTID['toString']())[_0x6806('0x3f')](_0x6806('0x46'),squel[_0x6806('0x47')](hopperContacts))[_0x6806('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0x6806('0x3f')](_0x6806('0x42'),squel[_0x6806('0x39')]()[_0x6806('0x3a')]('calleridnum')[_0x6806('0x3d')](_0x6806('0x48'))[_0x6806('0x3f')](_0x51b56f+_0x6806('0x49'),_0x24cc6c['id'][_0x6806('0x40')]()))[_0x6806('0x3f')](_0x6806('0x42'),squel[_0x6806('0x39')]()[_0x6806('0x3a')]('phone')[_0x6806('0x3d')](_0x6806('0x33'))[_0x6806('0x3f')](_0x51b56f+_0x6806('0x49'),_0x24cc6c['id'][_0x6806('0x40')]())))[_0x6806('0x40')]();return _0x329032;};function _0x23e0b4(_0x139b3f,_0x184cf8){var _0x2aa483=squel['insert']()[_0x6806('0x43')]('cm_hopper')[_0x6806('0x34')]([_0x6806('0x35'),_0x6806('0x36'),_0x6806('0x37'),_0x6806('0x24'),_0x184cf8,_0x6806('0x3c'),'updatedAt'],squel[_0x6806('0x39')]()[_0x6806('0x3a')](_0x6806('0x35'),_0x6806('0x35'))[_0x6806('0x3a')]('NOW()','scheduledAt')[_0x6806('0x3a')]('id',_0x6806('0x37'))[_0x6806('0x3a')](LISTID[_0x6806('0x40')](),_0x6806('0x24'))[_0x6806('0x3a')](_0x139b3f['id']['toString'](),_0x184cf8)['field'](_0x6806('0x3b'),_0x6806('0x3c'))['field'](_0x6806('0x3b'),'updatedAt')['from'](_0x6806('0x3e'))['where']('deletedAt\x20IS\x20NULL')[_0x6806('0x3f')](_0x6806('0x45'),LISTID[_0x6806('0x40')]())[_0x6806('0x3f')](_0x6806('0x46'),squel['str'](hopperContacts))[_0x6806('0x3f')](_0x6806('0x41')))[_0x6806('0x40')]();return _0x2aa483;}function _0x2438c1(_0x3948bf,_0x390c94){var _0x29d8b5=squel['insert']()[_0x6806('0x43')](_0x6806('0x4a'))['fromQuery']([_0x6806('0x35'),'ContactId',_0x6806('0x24'),_0x390c94,'createdAt',_0x6806('0x38')],squel['select']()[_0x6806('0x3a')]('phone',_0x6806('0x35'))['field']('id',_0x6806('0x37'))[_0x6806('0x3a')](LISTID[_0x6806('0x40')](),'ListId')[_0x6806('0x3a')](_0x3948bf['id'][_0x6806('0x40')](),_0x390c94)[_0x6806('0x3a')](_0x6806('0x3b'),_0x6806('0x3c'))['field'](_0x6806('0x3b'),_0x6806('0x38'))[_0x6806('0x3d')](_0x6806('0x3e'))['where'](_0x6806('0x44'))[_0x6806('0x3f')](_0x6806('0x45'),LISTID[_0x6806('0x40')]())['where']('id\x20IN\x20?',squel[_0x6806('0x47')](hopperContacts))['where'](_0x6806('0x41')))[_0x6806('0x40')]();return _0x29d8b5;}return db[_0x6806('0x4b')][_0x6806('0x4c')]({'where':{'type':_0x6806('0x4d')},'attributes':['id',_0x6806('0x4e')],'include':[{'model':db['CmList'],'as':_0x6806('0x4f'),'where':{'id':LISTID}}]})[_0x6806('0x2b')](function(_0x4b658e){var _0xa85c5b=[];if(_0x4b658e){var _0x4e235f;for(var _0x3f66d3=0x0,_0x649c55;_0x3f66d3<_0x4b658e['length'];_0x3f66d3+=0x1){_0x649c55=_0x4b658e[_0x3f66d3]['get']({'plain':!![]});switch(_0x649c55[_0x6806('0x4e')]){case _0x6806('0x50'):_0xa85c5b[_0x6806('0x2c')](db[_0x6806('0x51')][_0x6806('0x52')](_0x36ff8f(_0x649c55,_0x6806('0x53')))[_0x6806('0x2b')](function(){})[_0x6806('0x54')](_0x63505d()));break;case _0x6806('0x55'):_0xa85c5b['push'](db[_0x6806('0x51')][_0x6806('0x52')](_0x5c512a(_0x649c55,_0x6806('0x53')))[_0x6806('0x2b')](function(){})[_0x6806('0x54')](_0x63505d()));break;default:_0xa85c5b[_0x6806('0x2c')](db[_0x6806('0x51')][_0x6806('0x52')](_0x23e0b4(_0x649c55,'VoiceQueueId'))[_0x6806('0x2b')](function(){})['catch'](_0x63505d()));}}}return _0xa85c5b;})[_0x6806('0x56')]()[_0x6806('0x2b')](function(){return db[_0x6806('0x4b')][_0x6806('0x4c')]({'where':{'type':_0x6806('0x4d')},'attributes':['id'],'include':[{'model':db[_0x6806('0x57')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x6806('0x2b')](function(_0x318630){var _0x285302=[];if(_0x318630){var _0x209dea;for(var _0x434d21=0x0,_0x501a22;_0x434d21<_0x318630[_0x6806('0x18')];_0x434d21+=0x1){_0x501a22=_0x318630[_0x434d21][_0x6806('0x58')]({'plain':!![]});_0x285302['push'](db['sequelize'][_0x6806('0x52')](_0x2438c1(_0x501a22,_0x6806('0x53')))['then'](function(){})[_0x6806('0x54')](_0x63505d()));}}return _0x285302;})[_0x6806('0x56')]();})['then'](function(){return db[_0x6806('0x59')][_0x6806('0x4c')]({'attributes':['id',_0x6806('0x4e')],'include':[{'model':db[_0x6806('0x57')],'as':_0x6806('0x4f'),'where':{'id':LISTID}}]})['then'](function(_0x523be5){var _0x8c00c2=[];if(_0x523be5){for(var _0x397667=0x0,_0xad0e6;_0x397667<_0x523be5[_0x6806('0x18')];_0x397667+=0x1){_0xad0e6=_0x523be5[_0x397667][_0x6806('0x58')]({'plain':!![]});switch(_0xad0e6[_0x6806('0x4e')]){case'always':_0x8c00c2[_0x6806('0x2c')](db[_0x6806('0x51')][_0x6806('0x52')](_0x36ff8f(_0xad0e6,_0x6806('0x5a')))[_0x6806('0x2b')](function(){})[_0x6806('0x54')](_0x63505d()));break;case _0x6806('0x55'):_0x8c00c2[_0x6806('0x2c')](db['sequelize'][_0x6806('0x52')](_0x5c512a(_0xad0e6,_0x6806('0x5a')))[_0x6806('0x2b')](function(){})['catch'](_0x63505d()));break;default:_0x8c00c2['push'](db[_0x6806('0x51')][_0x6806('0x52')](_0x23e0b4(_0xad0e6,_0x6806('0x5a')))['then'](function(){})['catch'](_0x63505d()));}}}return _0x8c00c2;})[_0x6806('0x56')]();})['then'](function(){return db[_0x6806('0x59')][_0x6806('0x4c')]({'attributes':['id'],'include':[{'model':db[_0x6806('0x57')],'as':_0x6806('0x5b'),'where':{'id':LISTID}}]})[_0x6806('0x2b')](function(_0x596bf8){var _0xa49a8d=[];if(_0x596bf8){for(var _0x48e74a=0x0,_0x328181;_0x48e74a<_0x596bf8[_0x6806('0x18')];_0x48e74a+=0x1){_0x328181=_0x596bf8[_0x48e74a][_0x6806('0x58')]({'plain':!![]});_0xa49a8d[_0x6806('0x2c')](db[_0x6806('0x51')][_0x6806('0x52')](_0x2438c1(_0x328181,'CampaignId'))['then'](function(){})[_0x6806('0x54')](_0x63505d()));}}return _0xa49a8d;})[_0x6806('0x56')]();})[_0x6806('0x54')](function(_0x3b9cdd){logger[_0x6806('0x13')](_0x6806('0x5c'),_0x6806('0x5d'),_0x3b9cdd['message']);});}var processPromises=function(_0x4b98ea){return BPromise[_0x6806('0x56')](promises)[_0x6806('0x2b')](function(_0x27ce94){})['catch'](function(_0x35ef44){logger[_0x6806('0x13')]('Error\x20processing\x20rows\x20block:',JSON[_0x6806('0x2f')](_0x35ef44));})[_0x6806('0x5e')](function(){socket[_0x6806('0x5f')](_0x6806('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4b98ea){return _0x4b98ea[_0x6806('0x61')]();}});};var endCsv=function(){return BPromise[_0x6806('0x62')]()[_0x6806('0x2b')](function(){if(hopperContacts){return checkHopper();}})[_0x6806('0x2b')](function(){socket[_0x6806('0x5f')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x6806('0x63')](FILEPATH);}catch(_0x53ffd2){logger['error'](_0x6806('0x64'),JSON[_0x6806('0x2f')](_0x53ffd2));}finally{process[_0x6806('0x65')](0x0);}});};process['on'](_0x6806('0x66'),function(){logger[_0x6806('0x67')](_0x6806('0x68'));endCsv();});function main(){return BPromise[_0x6806('0x62')]()[_0x6806('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x6806('0x11')](',');return db['CmContact']['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x6806('0x2b')](function(_0x528507){var _0x241b73=fs[_0x6806('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x6806('0x6a')](_0x241b73,{'header':!![],'skipEmptyLines':!![],'step':function(_0x32590e,_0x28788f){total+=0x1;var _0x3d5557=total;promises[_0x6806('0x2c')](checkRow(_0x32590e,_0x528507,_0x3d5557)[_0x6806('0x2b')](function(){success+=0x1;})[_0x6806('0x54')](function(_0x59bf99){if(_0x59bf99[_0x6806('0x13')]){errors+=0x1;delete _0x59bf99['error'];}else if(_0x59bf99[_0x6806('0x27')]){duplicates+=0x1;delete _0x59bf99[_0x6806('0x27')];}rows[_0x6806('0x2c')](_0x59bf99);}));if(total%0xc8===0x0){_0x28788f['pause']();return processPromises(_0x28788f);}},'complete':function(){return processPromises()[_0x6806('0x2b')](function(){logger['info'](_0x6806('0x6b'));endCsv();});},'error':function(_0x39881a,_0x121ecb){logger[_0x6806('0x67')](_0x6806('0x6c'),JSON[_0x6806('0x2f')](_0x39881a));endCsv();}});})[_0x6806('0x54')](function(_0x2f4e67){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x6806('0x2f')](_0x2f4e67));});}main(); \ No newline at end of file +var _0x583c=['../../../mysqldb','../../../config/environment','api','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','create','keys','then','catch','message','stringify','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','into','deletedAt\x20IS\x20NULL','id\x20IN\x20?','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','str','VoiceQueue','findAll','outbound','CmList','get','always','push','sequelize','query','onlyIfOpen','VoiceQueueId','all','Campaign','dialCheckDuplicateType','Lists','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','finally','emit','contact:csv_','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','CSV\x20parsed\x20correctly!','bluebird','util','lodash','squel','papaparse','ioredis'];(function(_0x59d898,_0x36d124){var _0x1a31d9=function(_0x2260bc){while(--_0x2260bc){_0x59d898['push'](_0x59d898['shift']());}};_0x1a31d9(++_0x36d124);}(_0x583c,0x138));var _0xc583=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0x583c[_0x1d50f2];return _0x3769b8;};'use strict';var BPromise=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var _=require(_0xc583('0x2'));var fs=require('fs');var squel=require(_0xc583('0x3'));var Papa=require(_0xc583('0x4'));var Redis=require(_0xc583('0x5'));var db=require(_0xc583('0x6'))['db'];var config=require(_0xc583('0x7'));var logger=require('../../../config/logger')(_0xc583('0x8'));config[_0xc583('0x9')]=_['defaults'](config[_0xc583('0x9')],{'host':_0xc583('0xa'),'port':0x18eb});var socket=require(_0xc583('0xb'))(new Redis(config['redis']));require(_0xc583('0xc'))[_0xc583('0xd')](socket);try{if(!process['argv'][0x2]||process[_0xc583('0xe')][0x2]===_0xc583('0xf')||process[_0xc583('0xe')][0x2]===_0xc583('0x10')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xc583('0xe')][0x2];if(!process[_0xc583('0xe')][0x3]||process['argv'][0x3]===_0xc583('0xf')||process[_0xc583('0xe')][0x3]===_0xc583('0x10')||!process[_0xc583('0xe')][0x4]||process[_0xc583('0xe')][0x4]===_0xc583('0xf')||process[_0xc583('0xe')][0x4]===_0xc583('0x10')){throw new Error(_0xc583('0x11'));}var FIELDS=_[_0xc583('0x12')](process[_0xc583('0xe')][0x3][_0xc583('0x13')](','),process['argv'][0x4][_0xc583('0x13')](','));if(!process[_0xc583('0xe')][0x5]||process[_0xc583('0xe')][0x5]===_0xc583('0xf')||process[_0xc583('0xe')][0x5]===_0xc583('0x10')){throw new Error(_0xc583('0x14'));}var LISTID=process[_0xc583('0xe')][0x5];var COMPANYID=process[_0xc583('0xe')][0x6]&&process[_0xc583('0xe')][0x6]!==_0xc583('0xf')&&process[_0xc583('0xe')][0x6]!==_0xc583('0x10')?process[_0xc583('0xe')][0x6]:null;var DUPLICATES=process[_0xc583('0xe')][0x7]&&process['argv'][0x7]!==_0xc583('0xf')&&process[_0xc583('0xe')][0x7]!==_0xc583('0x10')?process[_0xc583('0xe')][0x7]:null;if(!process['argv'][0x8]||process[_0xc583('0xe')][0x8]===_0xc583('0xf')||process[_0xc583('0xe')][0x8]===_0xc583('0x10')){throw new Error(_0xc583('0x15'));}var SOCKET_TIMESTAMP=process[_0xc583('0xe')][0x8];}catch(_0x378515){logger['error'](_0x378515);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(_0x44cd6f,_0x47eec0,_0x2a93e5,_0x6d762f){var _0x3b8a45={'message':_0x47eec0};_0x3b8a45[_0x44cd6f]=!![];if(_0x2a93e5){_0x3b8a45[_0xc583('0x16')]=_0x2a93e5;}if(_0x6d762f){_0x3b8a45['index']=_0x6d762f;}return _0x3b8a45;}function isEmail(_0x4805cc){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'](_0x4805cc);}function checkRow(_0x32f70d,_0x1ecc73,_0x569d50){return new BPromise(function(_0xd56188,_0x37495a){if(_['isNil'](_0x32f70d)){return _0x37495a(handleCheckRowError(_0xc583('0x17'),_0xc583('0x18'),null,_0x569d50));}if(_0x32f70d[_0xc583('0x19')]&&_0x32f70d[_0xc583('0x19')][_0xc583('0x1a')]){var _0x365874=_[_0xc583('0x1b')](_0x32f70d[_0xc583('0x19')],'message')['join'](';');return _0x37495a(handleCheckRowError('error',_0x365874,null,_0x569d50));}var _0x11e9f8={};for(var _0x5edad2 in FIELDS){if(FIELDS[_0xc583('0x1c')](_0x5edad2)&&FIELDS[_0x5edad2]){_0x11e9f8[_0x5edad2]=_0x32f70d[_0xc583('0x1d')][0x0][FIELDS[_0x5edad2]]||_0x32f70d[_0xc583('0x1d')][0x0]['\ufeff'+FIELDS[_0x5edad2]];}}if(!_0x11e9f8[_0xc583('0x1e')]){return _0x37495a(handleCheckRowError(_0xc583('0x17'),_0xc583('0x1f'),null,_0x569d50));}if(!_0x11e9f8[_0xc583('0x20')]){return _0x37495a(handleCheckRowError(_0xc583('0x17'),'phone\x20not\x20specified!',null,_0x569d50));}if(_0x11e9f8['birthDate']){var _0x2c97ab=moment(_0x11e9f8[_0xc583('0x21')],_0xc583('0x22'));if(!_0x2c97ab['isValid']()){return _0x37495a(handleCheckRowError(_0xc583('0x17'),_0xc583('0x23'),null,_0x569d50));}}if(_0x11e9f8[_0xc583('0x24')]){if(!isEmail(_0x11e9f8[_0xc583('0x24')])){return _0x37495a(handleCheckRowError(_0xc583('0x17'),_0xc583('0x25'),null,_0x569d50));}}_0x11e9f8[_0xc583('0x26')]=LISTID;_0x11e9f8[_0xc583('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xc583('0x1a')]&&_0x1ecc73){var _0x457b20={};for(var _0x30bf7e=0x0,_0xe4d685=DUPLICATES[_0xc583('0x1a')];_0x30bf7e<_0xe4d685;_0x30bf7e+=0x1){_0x457b20[DUPLICATES[_0x30bf7e]]=_0x11e9f8[DUPLICATES[_0x30bf7e]];}var _0x50492c=_[_0xc583('0x28')](_0x1ecc73,_0x457b20);if(_0x50492c){return _0x37495a(handleCheckRowError(_0xc583('0x29'),_0xc583('0x2a'),_0x50492c,_0x569d50));}}return db['CmContact'][_0xc583('0x2b')](_0x11e9f8,{'raw':!![],'hooks':![],'fields':_[_0xc583('0x2c')](_0x11e9f8)})[_0xc583('0x2d')](function(_0x4c92e4){if(DUPLICATES&&DUPLICATES[_0xc583('0x1a')]&&_0x1ecc73){_0x1ecc73['push'](_['pick'](_0x11e9f8,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4c92e4['id'];return _0xd56188();})[_0xc583('0x2e')](function(_0x1bfe39){return _0x37495a(handleCheckRowError(_0xc583('0x17'),'Error\x20while\x20creating\x20contact:\x20'+(_0x1bfe39[_0xc583('0x2f')]||JSON[_0xc583('0x30')](_0x1bfe39)),null,_0x569d50));});});}function checkHopper(){function _0x12b34b(){return function(_0x3ecc85){logger['error']('cmContact',_0xc583('0x31'),util[_0xc583('0x32')](_0x3ecc85,{'showHidden':![],'depth':null}));};}var _0x5364c5=function(_0x46d042,_0x37dd0f){var _0x1ebd56=squel[_0xc583('0x33')]()['into'](_0xc583('0x34'))[_0xc583('0x35')]([_0xc583('0x20'),_0xc583('0x36'),_0xc583('0x37'),_0xc583('0x26'),_0x37dd0f,_0xc583('0x38'),_0xc583('0x39')],squel[_0xc583('0x3a')]()[_0xc583('0x3b')](_0xc583('0x20'),'phone')['field'](_0xc583('0x3c'),_0xc583('0x36'))[_0xc583('0x3b')]('id',_0xc583('0x37'))['field'](LISTID[_0xc583('0x3d')](),_0xc583('0x26'))['field'](_0x46d042['id']['toString'](),_0x37dd0f)[_0xc583('0x3b')](_0xc583('0x3c'),'createdAt')[_0xc583('0x3b')]('NOW()',_0xc583('0x39'))[_0xc583('0x3e')](_0xc583('0x3f'))[_0xc583('0x40')]('deletedAt\x20IS\x20NULL')[_0xc583('0x40')](_0xc583('0x41'),LISTID[_0xc583('0x3d')]())[_0xc583('0x40')](_0xc583('0x42'))[_0xc583('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc583('0x3a')]()[_0xc583('0x3b')](_0xc583('0x20'))[_0xc583('0x3e')](_0xc583('0x34'))[_0xc583('0x40')](_0x37dd0f+_0xc583('0x43'),_0x46d042['id'][_0xc583('0x3d')]())))[_0xc583('0x3d')]();return _0x1ebd56;};var _0x513006=function(_0x410977,_0x226b0e){var _0x5141ed=squel[_0xc583('0x33')]()[_0xc583('0x44')](_0xc583('0x34'))[_0xc583('0x35')]([_0xc583('0x20'),'scheduledAt',_0xc583('0x37'),_0xc583('0x26'),_0x226b0e,_0xc583('0x38'),_0xc583('0x39')],squel[_0xc583('0x3a')]()[_0xc583('0x3b')](_0xc583('0x20'),'phone')[_0xc583('0x3b')](_0xc583('0x3c'),_0xc583('0x36'))[_0xc583('0x3b')]('id',_0xc583('0x37'))[_0xc583('0x3b')](LISTID[_0xc583('0x3d')](),_0xc583('0x26'))[_0xc583('0x3b')](_0x410977['id'][_0xc583('0x3d')](),_0x226b0e)[_0xc583('0x3b')](_0xc583('0x3c'),_0xc583('0x38'))[_0xc583('0x3b')]('NOW()','updatedAt')[_0xc583('0x3e')](_0xc583('0x3f'))[_0xc583('0x40')](_0xc583('0x45'))['where'](_0xc583('0x41'),LISTID['toString']())[_0xc583('0x40')](_0xc583('0x46'),squel['str'](hopperContacts))['where'](_0xc583('0x42'))[_0xc583('0x40')](_0xc583('0x47'),squel['select']()[_0xc583('0x3b')](_0xc583('0x48'))[_0xc583('0x3e')](_0xc583('0x49'))[_0xc583('0x40')](_0x226b0e+'\x20=\x20?',_0x410977['id'][_0xc583('0x3d')]()))['where'](_0xc583('0x47'),squel[_0xc583('0x3a')]()[_0xc583('0x3b')](_0xc583('0x20'))[_0xc583('0x3e')]('cm_hopper')[_0xc583('0x40')](_0x226b0e+_0xc583('0x43'),_0x410977['id'][_0xc583('0x3d')]())))[_0xc583('0x3d')]();return _0x5141ed;};function _0x1abadb(_0x16d79b,_0x56929b){var _0xdedac6=squel[_0xc583('0x33')]()[_0xc583('0x44')](_0xc583('0x34'))['fromQuery']([_0xc583('0x20'),_0xc583('0x36'),_0xc583('0x37'),'ListId',_0x56929b,'createdAt',_0xc583('0x39')],squel[_0xc583('0x3a')]()[_0xc583('0x3b')](_0xc583('0x20'),'phone')[_0xc583('0x3b')](_0xc583('0x3c'),'scheduledAt')['field']('id','ContactId')[_0xc583('0x3b')](LISTID['toString'](),'ListId')[_0xc583('0x3b')](_0x16d79b['id'][_0xc583('0x3d')](),_0x56929b)[_0xc583('0x3b')]('NOW()',_0xc583('0x38'))['field'](_0xc583('0x3c'),'updatedAt')[_0xc583('0x3e')](_0xc583('0x3f'))[_0xc583('0x40')](_0xc583('0x45'))[_0xc583('0x40')]('ListId\x20=\x20?',LISTID[_0xc583('0x3d')]())[_0xc583('0x40')]('id\x20IN\x20?',squel[_0xc583('0x4a')](hopperContacts))[_0xc583('0x40')](_0xc583('0x42')))[_0xc583('0x3d')]();return _0xdedac6;}function _0x33fda6(_0x1d3188,_0x43a33e){var _0x3da349=squel[_0xc583('0x33')]()['into']('cm_hopper_black')[_0xc583('0x35')]([_0xc583('0x20'),_0xc583('0x37'),_0xc583('0x26'),_0x43a33e,_0xc583('0x38'),_0xc583('0x39')],squel['select']()['field'](_0xc583('0x20'),_0xc583('0x20'))[_0xc583('0x3b')]('id',_0xc583('0x37'))[_0xc583('0x3b')](LISTID['toString'](),_0xc583('0x26'))[_0xc583('0x3b')](_0x1d3188['id']['toString'](),_0x43a33e)[_0xc583('0x3b')](_0xc583('0x3c'),_0xc583('0x38'))[_0xc583('0x3b')](_0xc583('0x3c'),_0xc583('0x39'))[_0xc583('0x3e')](_0xc583('0x3f'))[_0xc583('0x40')](_0xc583('0x45'))[_0xc583('0x40')](_0xc583('0x41'),LISTID[_0xc583('0x3d')]())[_0xc583('0x40')](_0xc583('0x46'),squel[_0xc583('0x4a')](hopperContacts))[_0xc583('0x40')]('phone\x20IS\x20NOT\x20NULL'))[_0xc583('0x3d')]();return _0x3da349;}return db[_0xc583('0x4b')][_0xc583('0x4c')]({'where':{'type':_0xc583('0x4d')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xc583('0x4e')],'as':'Lists','where':{'id':LISTID}}]})[_0xc583('0x2d')](function(_0x3e8a9c){var _0x17317d=[];if(_0x3e8a9c){var _0x5ee756;for(var _0x243ac3=0x0,_0x4abfde;_0x243ac3<_0x3e8a9c[_0xc583('0x1a')];_0x243ac3+=0x1){_0x4abfde=_0x3e8a9c[_0x243ac3][_0xc583('0x4f')]({'plain':!![]});switch(_0x4abfde['dialCheckDuplicateType']){case _0xc583('0x50'):_0x17317d[_0xc583('0x51')](db[_0xc583('0x52')][_0xc583('0x53')](_0x513006(_0x4abfde,'VoiceQueueId'))[_0xc583('0x2d')](function(){})['catch'](_0x12b34b()));break;case _0xc583('0x54'):_0x17317d[_0xc583('0x51')](db[_0xc583('0x52')][_0xc583('0x53')](_0x5364c5(_0x4abfde,_0xc583('0x55')))[_0xc583('0x2d')](function(){})[_0xc583('0x2e')](_0x12b34b()));break;default:_0x17317d[_0xc583('0x51')](db['sequelize'][_0xc583('0x53')](_0x1abadb(_0x4abfde,_0xc583('0x55')))['then'](function(){})[_0xc583('0x2e')](_0x12b34b()));}}}return _0x17317d;})[_0xc583('0x56')]()[_0xc583('0x2d')](function(){return db[_0xc583('0x4b')][_0xc583('0x4c')]({'where':{'type':_0xc583('0x4d')},'attributes':['id'],'include':[{'model':db[_0xc583('0x4e')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x3515de){var _0x99c127=[];if(_0x3515de){var _0x24b9dc;for(var _0x2760a4=0x0,_0x55283b;_0x2760a4<_0x3515de[_0xc583('0x1a')];_0x2760a4+=0x1){_0x55283b=_0x3515de[_0x2760a4][_0xc583('0x4f')]({'plain':!![]});_0x99c127[_0xc583('0x51')](db[_0xc583('0x52')][_0xc583('0x53')](_0x33fda6(_0x55283b,'VoiceQueueId'))[_0xc583('0x2d')](function(){})[_0xc583('0x2e')](_0x12b34b()));}}return _0x99c127;})[_0xc583('0x56')]();})[_0xc583('0x2d')](function(){return db[_0xc583('0x57')][_0xc583('0x4c')]({'attributes':['id',_0xc583('0x58')],'include':[{'model':db[_0xc583('0x4e')],'as':_0xc583('0x59'),'where':{'id':LISTID}}]})[_0xc583('0x2d')](function(_0x37725d){var _0x3324d7=[];if(_0x37725d){for(var _0x22efdc=0x0,_0x133a22;_0x22efdc<_0x37725d[_0xc583('0x1a')];_0x22efdc+=0x1){_0x133a22=_0x37725d[_0x22efdc][_0xc583('0x4f')]({'plain':!![]});switch(_0x133a22[_0xc583('0x58')]){case _0xc583('0x50'):_0x3324d7['push'](db['sequelize'][_0xc583('0x53')](_0x513006(_0x133a22,_0xc583('0x5a')))[_0xc583('0x2d')](function(){})[_0xc583('0x2e')](_0x12b34b()));break;case'onlyIfOpen':_0x3324d7[_0xc583('0x51')](db[_0xc583('0x52')][_0xc583('0x53')](_0x5364c5(_0x133a22,_0xc583('0x5a')))[_0xc583('0x2d')](function(){})['catch'](_0x12b34b()));break;default:_0x3324d7[_0xc583('0x51')](db[_0xc583('0x52')][_0xc583('0x53')](_0x1abadb(_0x133a22,_0xc583('0x5a')))[_0xc583('0x2d')](function(){})['catch'](_0x12b34b()));}}}return _0x3324d7;})[_0xc583('0x56')]();})[_0xc583('0x2d')](function(){return db[_0xc583('0x57')][_0xc583('0x4c')]({'attributes':['id'],'include':[{'model':db[_0xc583('0x4e')],'as':_0xc583('0x5b'),'where':{'id':LISTID}}]})['then'](function(_0x4035c6){var _0x6d71a6=[];if(_0x4035c6){for(var _0x1485ef=0x0,_0x1953e6;_0x1485ef<_0x4035c6['length'];_0x1485ef+=0x1){_0x1953e6=_0x4035c6[_0x1485ef][_0xc583('0x4f')]({'plain':!![]});_0x6d71a6[_0xc583('0x51')](db[_0xc583('0x52')]['query'](_0x33fda6(_0x1953e6,_0xc583('0x5a')))[_0xc583('0x2d')](function(){})['catch'](_0x12b34b()));}}return _0x6d71a6;})[_0xc583('0x56')]();})[_0xc583('0x2e')](function(_0x39a818){logger[_0xc583('0x17')](_0xc583('0x5c'),'generalCheckHopper',_0x39a818[_0xc583('0x2f')]);});}var processPromises=function(_0x378079){return BPromise['all'](promises)[_0xc583('0x2d')](function(_0x5a1441){})[_0xc583('0x2e')](function(_0x570c0d){logger[_0xc583('0x17')]('Error\x20processing\x20rows\x20block:',JSON[_0xc583('0x30')](_0x570c0d));})[_0xc583('0x5d')](function(){socket[_0xc583('0x5e')](_0xc583('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x378079){return _0x378079['resume']();}});};var endCsv=function(){return BPromise[_0xc583('0x60')]()[_0xc583('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0xc583('0x2d')](function(){socket[_0xc583('0x5e')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xc583('0x61')](FILEPATH);}catch(_0x4bbea3){logger[_0xc583('0x17')](_0xc583('0x62'),JSON[_0xc583('0x30')](_0x4bbea3));}finally{process['exit'](0x0);}});};process['on'](_0xc583('0x63'),function(){logger[_0xc583('0x64')](_0xc583('0x65'));endCsv();});function main(){return BPromise[_0xc583('0x60')]()[_0xc583('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xc583('0x66')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x38de85){var _0x23ddbd=fs[_0xc583('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xc583('0x68')](_0x23ddbd,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4bf336,_0x146e07){total+=0x1;var _0x484093=total;promises[_0xc583('0x51')](checkRow(_0x4bf336,_0x38de85,_0x484093)[_0xc583('0x2d')](function(){success+=0x1;})['catch'](function(_0x234cfe){if(_0x234cfe[_0xc583('0x17')]){errors+=0x1;delete _0x234cfe[_0xc583('0x17')];}else if(_0x234cfe[_0xc583('0x29')]){duplicates+=0x1;delete _0x234cfe[_0xc583('0x29')];}rows[_0xc583('0x51')](_0x234cfe);}));if(total%0xc8===0x0){_0x146e07['pause']();return processPromises(_0x146e07);}},'complete':function(){return processPromises()[_0xc583('0x2d')](function(){logger[_0xc583('0x64')](_0xc583('0x69'));endCsv();});},'error':function(_0x30a3f6,_0x47b65b){logger['info']('CSV\x20parse\x20error',JSON[_0xc583('0x30')](_0x30a3f6));endCsv();}});})[_0xc583('0x2e')](function(_0x4dedbd){logger[_0xc583('0x17')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xc583('0x30')](_0x4dedbd));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 75ab3ef..7c0e953 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 _0x909a=['moment','ioredis','../../../config/environment','../../../config/environment/shared','import','redis','defaults','localhost','YYYY-MM-DD\x20HH:mm:ss','format','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','AdditionalPhones','then','length','push','all','filter','split','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','cm_hopper_black','phone','fields','cm_contacts.ListId\x20=\x20','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','fromQuery','ListId\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','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','exit','errors','code','message','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','query','voice_queues.id','voice_queues.dialTimezone','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','sequelize','error','timezones','dialTimezone','isNil','utcOffset','set','offset','main','send','binding','socket_timestamp','server/files/tmp','includes','header','ContactItemType','findAll','name','_description','writeFileSync','createReadStream','data','find','trim','replace','isValid','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','hasOwnProperty','itemTypeId','description','SystemRow','appendFileSync','rows','contact:import:','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','orderBy','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','emit','unlink','complete','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','parse','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','util'];(function(_0xb1ee0e,_0x2126df){var _0x376116=function(_0x44b7ad){while(--_0x44b7ad){_0xb1ee0e['push'](_0xb1ee0e['shift']());}};_0x376116(++_0x2126df);}(_0x909a,0xbc));var _0xa909=function(_0x551be0,_0x3372c1){_0x551be0=_0x551be0-0x0;var _0x112d08=_0x909a[_0x551be0];return _0x112d08;};'use strict';var fs=require('fs');var path=require(_0xa909('0x0'));var _=require(_0xa909('0x1'));var Papa=require(_0xa909('0x2'));var util=require(_0xa909('0x3'));var BPromise=require('bluebird');var moment=require(_0xa909('0x4'));var squel=require('squel');var Redis=require(_0xa909('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0xa909('0x6'));var shared=require(_0xa909('0x7'));var logger=require('../../../config/logger')(_0xa909('0x8'));config[_0xa909('0x9')]=_[_0xa909('0xa')](config['redis'],{'host':_0xa909('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa909('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0xa909('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xa909('0xd')](_0xa909('0xc'));function isEmail(_0x52ea00){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))*$/[_0xa909('0xe')](_0x52ea00);}function selectNotIn(_0x748800,_0x1fee21,_0x131863,_0x507e25,_0x1fdb42){return squel[_0xa909('0xf')]()[_0xa909('0x10')]('phone')[_0xa909('0x11')](_0x507e25)[_0xa909('0x12')](_0x1fee21,null,_0x1fee21+_0xa909('0x13')+_0x507e25+'.'+_0x131863)[_0xa909('0x14')](_0x507e25+'.'+_0x131863+_0xa909('0x15')+_0x748800+'.'+_0x131863)[_0xa909('0x14')](_0x1fee21+_0xa909('0x16')+_0x1fdb42[_0xa909('0x12')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1e6e3d,_0x16bd65){promisesAdditionalPhones=[];return db[_0xa909('0x17')]['findAll']({'raw':!![],'attributes':['id',_0xa909('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xa909('0x19')](function(_0x5a0567){if(_0x5a0567!==null){var _0x190274=[];for(var _0x1d02f7=0x0;_0x1d02f7<_0x5a0567[_0xa909('0x1a')];_0x1d02f7++){var _0x2f1d59=_0x5a0567[_0x1d02f7];_0x190274[_0xa909('0x1b')](insertAdditionalPhones(_0x2f1d59));}}Promise[_0xa909('0x1c')](_0x190274)[_0xa909('0x19')](function(){_0x1e6e3d({'val':0x1});});});});}function insertAdditionalPhones(_0x48f9df){return new Promise(function(_0x3cbdc6,_0x55eecf){var _0x436a70=_0x48f9df['AdditionalPhones'];var _0xd996eb=_0x436a70['split'](';');var _0x15500a=[];orderBy=0x0;for(var _0x35a3a1=0x0;_0x35a3a1<_0xd996eb[_0xa909('0x1a')];_0x35a3a1++){_0x15500a['push'](splitAdditionalPhone(_0x48f9df['id'],_0xd996eb[_0x35a3a1]));}Promise[_0xa909('0x1c')](_0x15500a)[_0xa909('0x19')](function(){_0x3cbdc6({'val':_0xd996eb[_0xa909('0x1a')]});});});}function splitAdditionalPhone(_0x54f1d8,_0x456c98){return new Promise(function(_0x52fd44,_0x776ae6){var _0xed8753=_0x456c98['split'](':');var _0x4fb23d=_0xed8753[0x0];var _0x5f2f89=_0xed8753[0x1];if(!_['isNil'](_0x5f2f89)){var _0x8d7f08=_0x5f2f89['split']('|');var _0x47d3eb=[];for(var _0x3d23fb=0x0;_0x3d23fb<_0x8d7f08[_0xa909('0x1a')];_0x3d23fb++){if(_0x8d7f08[_0x3d23fb]!==''){var _0x483140=_[_0xa909('0x1d')](promisesAdditionalPhones,{'contactId':_0x54f1d8,'phone':_0x8d7f08[_0x3d23fb]});if(_0x483140['length']==0x0){orderBy++;promisesAdditionalPhones[_0xa909('0x1b')]({'contactId':_0x54f1d8,'contactTypeId':_0x4fb23d,'phone':_0x8d7f08[_0x3d23fb],'orderBy':orderBy});}}}_0x52fd44({'ok':0x1});}else _0x52fd44({'res':0x0});});}function createAdditionalPhone(_0xe0f7f9,_0x569a88,_0x1305ce,_0x5f5122){var _0x28492e='';var _0x2a511c='';var _0x4a51e6=_0x1305ce[_0xa909('0x1e')]('§');_0x28492e=_0x4a51e6[0x0];if(_0x4a51e6[_0xa909('0x1a')]==0x2)_0x2a511c=_0x4a51e6[0x1];return new Promise(function(_0x5b2f1f,_0x47bb12){return db[_0xa909('0x1f')][_0xa909('0x20')]({'where':{'CmContactId':_0xe0f7f9,'item':_0x28492e}})[_0xa909('0x19')](function(_0x3d7e83){if(_0x3d7e83){return db[_0xa909('0x1f')][_0xa909('0x21')]({'ItemTypeId':_0x569a88,'description':_0x2a511c,'OrderBy':_0x5f5122},{'where':{'CmContactId':_0xe0f7f9,'item':_0x28492e}})['then'](function(_0x25e91f){_0x5b2f1f({'res':_0xa909('0x22')});});}else{return db['CmContactHasItem'][_0xa909('0x23')]({'CmContactId':_0xe0f7f9,'item':_0x28492e,'description':_0x2a511c,'ItemTypeId':_0x569a88,'OrderBy':_0x5f5122,'ItemClass':_0xa909('0x24')})['then'](function(_0x5d25e5){_0x5b2f1f({'res':_0xa909('0x25')});});}});});}function insertCmHopper(_0x2d1d74,_0xd267be,_0xe1c9e3,_0x5a2e77,_0x58330e){var _0x1513ac=['cm_contacts.phone',_0xa909('0x26'),_0xa909('0x27'),_0xa909('0x28'),_0xd267be+'.'+_0x5a2e77,_0xa909('0x29'),_0xa909('0x2a'),_0xa909('0x2b'),_0xa909('0x2c'),'\x22'+_0x58330e+'\x22'];return squel[_0xa909('0x2d')]()[_0xa909('0x2e')](_0xa909('0x2f'))['fromQuery'](['phone',_0xa909('0x30'),_0xa909('0x31'),_0xa909('0x32'),_0x5a2e77,_0xa909('0x33'),_0xa909('0x34'),_0xa909('0x35'),_0xa909('0x36'),_0xa909('0x37')],squel[_0xa909('0xf')]()['fields'](_0x1513ac)[_0xa909('0x11')](_0xd267be)[_0xa909('0x12')](_0xa909('0x38'),null,'cm_contacts.ListId\x20=\x20'+_0xd267be+_0xa909('0x39'))[_0xa909('0x12')](_0xe1c9e3,null,_0xe1c9e3+_0xa909('0x13')+_0xd267be+'.'+_0x5a2e77)[_0xa909('0x14')](_0xd267be+_0xa909('0x3a'),_0x2d1d74)[_0xa909('0x14')](_0xa909('0x3b'),NOW)[_0xa909('0x14')](_0xa909('0x3c'),selectNotIn(_0xd267be,_0xe1c9e3,_0x5a2e77,_0xa909('0x2f'),[_0xa909('0x3d'),_0xa909('0x3e')]))['where'](_0xa909('0x3c'),selectNotIn(_0xd267be,_0xe1c9e3,_0x5a2e77,_0xa909('0x2f'),[_0xa909('0x3d')])))[_0xa909('0x3f')]();}function insertCmHopperBlack(_0x744eca,_0x58df5a,_0x3ed0f9,_0xab1767){var _0x50085f=[_0xa909('0x40'),_0xa909('0x27'),'cm_contacts.ListId',_0x58df5a+'.'+_0xab1767,_0xa909('0x29'),_0xa909('0x2a')];return squel[_0xa909('0x2d')]()[_0xa909('0x2e')](_0xa909('0x41'))['fromQuery']([_0xa909('0x42'),_0xa909('0x31'),_0xa909('0x32'),_0xab1767,'createdAt',_0xa909('0x34')],squel[_0xa909('0xf')]()[_0xa909('0x43')](_0x50085f)[_0xa909('0x11')](_0x58df5a)[_0xa909('0x12')](_0xa909('0x38'),null,_0xa909('0x44')+_0x58df5a+_0xa909('0x39'))[_0xa909('0x12')](_0x3ed0f9,null,_0x3ed0f9+_0xa909('0x13')+_0x58df5a+'.'+_0xab1767)[_0xa909('0x14')](_0x58df5a+'.CmListId\x20=\x20?',_0x744eca)[_0xa909('0x14')](_0xa909('0x3b'),NOW)[_0xa909('0x14')](_0xa909('0x3c'),squel[_0xa909('0xf')]()[_0xa909('0x10')]('phone')['from'](_0xa909('0x41'))[_0xa909('0x14')]('ListId\x20=\x20?',_0x744eca)[_0xa909('0x14')](_0xab1767+_0xa909('0x15')+_0x58df5a+'.'+_0xab1767)))[_0xa909('0x3f')]();}function insertTzCmHopper(_0x27a59c,_0x401a11,_0xc01f4d,_0xcda892,_0x28b3b7,_0x19d72b){var _0x5b3233=[_0xa909('0x40'),_0xa909('0x45')+_0x19d72b+_0xa909('0x46'),_0xa909('0x27'),_0xa909('0x28'),_0x401a11+'.'+_0xcda892,'cm_contacts.createdAt','cm_contacts.updatedAt',_0xa909('0x2b'),'cm_contacts.UserId','\x22'+_0x28b3b7+'\x22'];var _0x56c752=squel[_0xa909('0x2d')]()[_0xa909('0x2e')](_0xa909('0x2f'))[_0xa909('0x47')](['phone',_0xa909('0x30'),_0xa909('0x31'),_0xa909('0x32'),_0xcda892,_0xa909('0x33'),_0xa909('0x34'),_0xa909('0x35'),_0xa909('0x36'),'recallme'],squel['select']()['fields'](_0x5b3233)['from'](_0x401a11)[_0xa909('0x12')](_0xa909('0x38'),null,_0xa909('0x44')+_0x401a11+_0xa909('0x39'))[_0xa909('0x12')](_0xc01f4d,null,_0xc01f4d+_0xa909('0x13')+_0x401a11+'.'+_0xcda892)[_0xa909('0x12')](_0x19d72b,null,_0x19d72b+_0xa909('0x13')+_0x401a11+'.'+_0xcda892)[_0xa909('0x14')](_0x401a11+'.CmListId\x20=\x20?',_0x27a59c)[_0xa909('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x401a11,_0xc01f4d,_0xcda892,_0xa909('0x2f'),['\x22always\x22',_0xa909('0x3e')]))[_0xa909('0x14')](_0xa909('0x3c'),selectNotIn(_0x401a11,_0xc01f4d,_0xcda892,_0xa909('0x2f'),['\x22always\x22'])))['toString']();return _0x56c752;}function insertTzCmHopperBlack(_0x15fbfa,_0x31250d,_0x21bc48,_0x324ad7){var _0x5222c8=['cm_contacts.phone',_0xa909('0x27'),'cm_contacts.ListId',_0x31250d+'.'+_0x324ad7,_0xa909('0x29'),_0xa909('0x2a')];return squel['insert']()[_0xa909('0x2e')](_0xa909('0x41'))[_0xa909('0x47')](['phone',_0xa909('0x31'),_0xa909('0x32'),_0x324ad7,'createdAt',_0xa909('0x34')],squel['select']()[_0xa909('0x43')](_0x5222c8)['from'](_0x31250d)[_0xa909('0x12')](_0xa909('0x38'),null,_0xa909('0x44')+_0x31250d+_0xa909('0x39'))[_0xa909('0x12')](_0x21bc48,null,_0x21bc48+_0xa909('0x13')+_0x31250d+'.'+_0x324ad7)[_0xa909('0x14')](_0x31250d+_0xa909('0x3a'),_0x15fbfa)[_0xa909('0x14')](_0xa909('0x3b'),NOW)[_0xa909('0x14')](_0xa909('0x3c'),squel[_0xa909('0xf')]()[_0xa909('0x10')](_0xa909('0x42'))[_0xa909('0x11')]('cm_hopper_black')[_0xa909('0x14')](_0xa909('0x48'),_0x15fbfa)[_0xa909('0x14')](_0x324ad7+_0xa909('0x15')+_0x31250d+'.'+_0x324ad7)))[_0xa909('0x3f')]();}function insertCmHopperAdditionalPhones(_0x461283){var _0x56480c=[_0xa909('0x49'),_0xa909('0x4a'),_0xa909('0x4b'),_0xa909('0x4c'),_0xa909('0x4d')];return squel[_0xa909('0x2d')]()['into'](_0xa909('0x4e'))['fromQuery']([_0xa909('0x4f'),_0xa909('0x42'),_0xa909('0x50'),_0xa909('0x33'),_0xa909('0x34')],squel[_0xa909('0xf')]()[_0xa909('0x43')](_0x56480c)[_0xa909('0x11')](_0xa909('0x2f'))[_0xa909('0x12')](_0xa909('0x38'),null,_0xa909('0x51'))[_0xa909('0x12')]('cm_contact_has_items',null,_0xa909('0x52'))[_0xa909('0x14')](_0xa909('0x53'),_0x461283)[_0xa909('0x14')](_0xa909('0x3b'),NOW))['toString']();}function insertCmContact(_0x4154d3,_0xfd5b89,_0x58c809,_0x2cd53b){var _0x4a041d=_[_0xa909('0x54')](_[_0xa909('0x55')](_0x2cd53b),[_0xa909('0x32'),'CompanyId',_0xa909('0x33'),_0xa909('0x34')]);return squel[_0xa909('0x2d')]()[_0xa909('0x2e')](_0xa909('0x38'))[_0xa909('0x47')](_0x4a041d,squel[_0xa909('0xf')]()[_0xa909('0x43')](_0x4a041d)[_0xa909('0x11')](_0xfd5b89)[_0xa909('0x14')]('('+_0x58c809[_0xa909('0x12')](',')+_0xa909('0x56'),squel[_0xa909('0xf')]()[_0xa909('0x43')](_0x58c809)[_0xa909('0x11')](_0xa909('0x38'))['where']('ListId\x20=\x20?',_0x4154d3)[_0xa909('0x14')](_0xa909('0x57')))[_0xa909('0x14')](_0xa909('0x58'),squel['select']()[_0xa909('0x10')](_0xa909('0x59'),'min_id')[_0xa909('0x11')](_0xfd5b89)[_0xa909('0x5a')](_0x58c809[_0xa909('0x12')](','))))['toString']();}function handleStop(){logger[_0xa909('0x5b')](_0xa909('0x5c'));stopped=!![];}function handleUncaughtException(_0x451b66){logger['error'](_0x451b66['message']);process[_0xa909('0x5d')](0x1);}function handleError(_0x9131f3,_0x4a2f7f){stats[_0xa909('0x5e')]['push']({'name':_0x4a2f7f[_0xa909('0x5f')],'message':_0x4a2f7f[_0xa909('0x60')],'row':_0x9131f3});}function handleQuery(_0x33cfee){logger['info'](_0x33cfee);return db['sequelize']['query'](_0x33cfee)[_0xa909('0x61')](function(_0x33bb1d){results['push'](_0x33bb1d);})[_0xa909('0x62')](function(_0x58b5a1){logger['error'](_0x58b5a1[_0xa909('0x60')]);});}function updateTzCampaigns(_0x425bbb){return new Promise(function(_0x5ec7de,_0x15b199){var _0x3d0d10=squel[_0xa909('0xf')]()[_0xa909('0x43')]([_0xa909('0x63'),_0xa909('0x64')])[_0xa909('0x11')](_0xa909('0x65'))[_0xa909('0x12')](_0xa909('0x66'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')['where'](_0xa909('0x67')+_0x425bbb);db['sequelize'][_0xa909('0x68')](_0x3d0d10[_0xa909('0x3f')]())[_0xa909('0x61')](function(_0x77be8c){var _0x2eb3e8=[];for(var _0xac72d2=0x0;_0xac72d2<_0x77be8c['length'];_0xac72d2++){_0x2eb3e8[_0xa909('0x1b')](getTimezoneData(_0x77be8c[_0xac72d2],tmp_campaigns));}BPromise[_0xa909('0x1c')](_0x2eb3e8)[_0xa909('0x19')](function(){_0x5ec7de({'val':0x1});});})['catch'](function(_0x5ab391){logger['error'](_0x5ab391[_0xa909('0x60')]);_0x5ec7de({'val':0x0});});});}function updateTzVoiceQueues(_0x3ab2f2){return new Promise(function(_0x74e224,_0x3149e8){var _0x5c9962=squel[_0xa909('0xf')]()[_0xa909('0x43')]([_0xa909('0x69'),_0xa909('0x6a')])[_0xa909('0x11')]('voice_queues')[_0xa909('0x12')]('voice_queues_has_cm_lists',null,_0xa909('0x6b'))[_0xa909('0x14')](_0xa909('0x6c')+_0x3ab2f2);db[_0xa909('0x6d')][_0xa909('0x68')](_0x5c9962[_0xa909('0x3f')]())['spread'](function(_0xf6f38e){var _0x5be633=[];for(var _0xb1aa60=0x0;_0xb1aa60<_0xf6f38e[_0xa909('0x1a')];_0xb1aa60++){_0x5be633[_0xa909('0x1b')](getTimezoneData(_0xf6f38e[_0xb1aa60],tmp_voice_queues));}BPromise[_0xa909('0x1c')](_0x5be633)[_0xa909('0x19')](function(){_0x74e224({'val':0x1});});})[_0xa909('0x62')](function(_0x52aba6){logger[_0xa909('0x6e')](_0x52aba6[_0xa909('0x60')]);_0x74e224({'val':0x0});});});}function getTimezoneData(_0x56bcb5,_0x307e36){return new Promise(function(_0x1c71ef,_0x359bb6){var _0xb999c0=shared[_0xa909('0x6f')];var _0x3fd149=_0xb999c0[_0x56bcb5[_0xa909('0x70')]];if(_[_0xa909('0x71')](_0x3fd149)){_0x1c71ef({'ret':0x1});}else{var _0x1b886b=_0x3fd149[_0xa909('0x72')];var _0x49d55a=squel[_0xa909('0x2d')]()['into'](_0x307e36)[_0xa909('0x73')]('id',_0x56bcb5['id'])[_0xa909('0x73')](_0xa909('0x74'),_0x1b886b)['set'](_0xa909('0x70'),_0x56bcb5[_0xa909('0x70')])[_0xa909('0x3f')]();return db[_0xa909('0x6d')]['query'](_0x49d55a)['spread'](function(_0x2d56ad){_0x1c71ef({'ret':0x1});})['catch'](function(_0x728f2d){logger[_0xa909('0x6e')](_0x728f2d[_0xa909('0x60')]);_0x359bb6({'ret':0x1});});}});}function handleTZQuery(_0x4d0a23){logger['info'](_0x4d0a23);return db[_0xa909('0x6d')][_0xa909('0x68')](_0x4d0a23)[_0xa909('0x61')](function(_0x2885a0){})[_0xa909('0x62')](function(_0x2b253e){logger[_0xa909('0x6e')](_0x2b253e[_0xa909('0x60')]);});}function main(_0x9a7e09,_0x5054d7,_0x34019b,_0x41c0f2){logger[_0xa909('0x5b')](_0xa909('0x75'),_0x9a7e09,JSON['stringify'](_0x5054d7));process[_0xa909('0x76')]('start');var _0x78b1b6=_0x5054d7[_0xa909('0x77')];var _0x479831=_['clone'](_0x78b1b6);var _0x174851=_0x5054d7[_0xa909('0x78')];var _0x148b6e=path[_0xa909('0x12')](config['root'],_0xa909('0x79'),_0x174851+'.csv');hasTZ=_[_0xa909('0x55')](_0x78b1b6)[_0xa909('0x7a')]('dialTimezone');var _0x53e1ce=_[_0xa909('0x55')](_0x78b1b6)['join']();logger[_0xa909('0x5b')](_0xa909('0x7b'),_0x53e1ce);db[_0xa909('0x7c')][_0xa909('0x7d')]({'raw':!![],'attributes':['id',_0xa909('0x7e')]})['then'](function(_0x4cf738){for(var _0x292d94=0x0;_0x292d94<_0x4cf738[_0xa909('0x1a')];_0x292d94++){if(_0x4cf738[_0x292d94][_0xa909('0x7e')]in _0x78b1b6){contactItemTypes[_0xa909('0x1b')](_0x4cf738[_0x292d94]);delete _0x479831[_0x4cf738[_0x292d94]['name']];hasAdditionalPhones=!![];}for(var _0x2db526 in _0x78b1b6){if(_0x4cf738[_0x292d94]['name']+_0xa909('0x7f')===_0x2db526){phoneDescriptions[_0xa909('0x1b')]({'itemTypeId':_0x4cf738[_0x292d94]['id'],'description':_0x2db526});delete _0x479831[_0x2db526];}}}if(hasAdditionalPhones)_0x479831[_0xa909('0x18')]='';var _0x5e1a74=_[_0xa909('0x55')](_0x479831)['join']();logger[_0xa909('0x5b')](_0xa909('0x7b'),_0x5e1a74);fs[_0xa909('0x80')](_0x148b6e,_0x5e1a74+'\x0a');Papa['parse'](fs[_0xa909('0x81')](_0x9a7e09),{'header':!![],'skipEmptyLines':!![],'step':function(_0x150e59,_0x11de1c){try{for(var _0x334e14=0x0,_0x39cd5d=[];_0x334e14<_0x150e59[_0xa909('0x82')][_0xa909('0x1a')];_0x334e14++){stats['rows']+=0x1;if(_0x150e59[_0xa909('0x5e')][_0x334e14]){handleError(_0x150e59['data'][_0x334e14],_0x150e59[_0xa909('0x5e')][_0x334e14]);}else{var _0x4d1196=[];var _0x5d0451=[];var _0x41d5bb={};for(var _0x4e1733 in _0x78b1b6){let _0x146217=contactItemTypes['find'](_0x9912d5=>_0x9912d5[_0xa909('0x7e')]===_0x4e1733);let _0x10d16c=contactItemTypes[_0xa909('0x83')](_0x58149b=>_0x58149b[_0xa909('0x7e')]+'_description'===_0x4e1733);if(_[_0xa909('0x71')](_0x146217)&&_[_0xa909('0x71')](_0x10d16c)){if(_0x78b1b6['hasOwnProperty'](_0x4e1733)){if(_0x150e59['data'][_0x334e14][_0x78b1b6[_0x4e1733]]){var _0x1a50b9=_[_0xa909('0x84')](_0x150e59[_0xa909('0x82')][_0x334e14][_0x78b1b6[_0x4e1733]][_0xa909('0x85')](/"/g,'\x27'));switch(_0x4e1733){case _0xa909('0x30'):var _0x18a2fb=moment(_0x1a50b9,_0xa909('0xc'),!![]);if(_0x18a2fb[_0xa909('0x86')]()){_0x39cd5d[_0xa909('0x1b')]('\x22'+_0x1a50b9+'\x22');}else{_0x4d1196[_0xa909('0x1b')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x3d7cc6=parseInt(_0x1a50b9);_0x1a50b9=_[_0xa909('0x87')](_0x3d7cc6)||_0x3d7cc6<0x0||_0x3d7cc6>0x4?_0x41c0f2?0x3:0x2:_0x3d7cc6;_0x39cd5d[_0xa909('0x1b')]('\x22'+_0x1a50b9+'\x22');break;case'UserId':var _0x9abe82=parseInt(_0x1a50b9);if(_[_0xa909('0x88')](_0x9abe82)&&_[_0xa909('0x7a')](_0x34019b,_0x9abe82)){_0x39cd5d['push']('\x22'+_0x9abe82+'\x22');}else{_0x4d1196[_0xa909('0x1b')](_0xa909('0x89'));}break;case _0xa909('0x8a'):if(isEmail(_0x1a50b9)){_0x39cd5d[_0xa909('0x1b')]('\x22'+_0x1a50b9+'\x22');}else{_0x4d1196[_0xa909('0x1b')](_0xa909('0x8b'));}break;case _0xa909('0x8c'):var _0x367891=moment(_0x1a50b9,_0xa909('0x8d'),!![]);if(_0x367891[_0xa909('0x86')]()){_0x39cd5d[_0xa909('0x1b')]('\x22'+_0x1a50b9+'\x22');}else{_0x4d1196[_0xa909('0x1b')](_0xa909('0x8e'));}break;case _0xa909('0x70'):var _0xef1d84=shared['timezones'];var _0x707199=_0xef1d84[_0x1a50b9];if(!_['isNil'](_0x707199)){var _0x5821fd=_0x707199[_0xa909('0x72')];_0x39cd5d[_0xa909('0x1b')]('\x22'+_0x1a50b9+'\x22');_0x39cd5d[_0xa909('0x1b')]('\x22'+_0x5821fd+'\x22');}break;default:_0x39cd5d[_0xa909('0x1b')]('\x22'+_0x1a50b9+'\x22');}}else{switch(_0x4e1733){case _0xa909('0x8f'):case'phone':_0x4d1196[_0xa909('0x1b')](_0x4e1733+_0xa909('0x90'));break;default:_0x39cd5d[_0xa909('0x1b')]('\x22\x22');}}}}else{var _0xf523ea='';if(!_[_0xa909('0x71')](_0x146217)){if(!_0x41d5bb[_0xa909('0x91')](_0x146217['id'])){if(!_[_0xa909('0x71')](_0x150e59[_0xa909('0x82')][_0x334e14][_0x78b1b6[_0x4e1733]])){var _0x1a50b9=_[_0xa909('0x84')](_0x150e59['data'][_0x334e14][_0x78b1b6[_0x4e1733]][_0xa909('0x85')](/"/g,'\x27'));var _0xbe9407=phoneDescriptions[_0xa909('0x83')](_0x421e98=>_0x421e98[_0xa909('0x92')]===_0x146217['id']);if(!_[_0xa909('0x71')](_0xbe9407)){var _0x415fde=_[_0xa909('0x84')](_0x150e59[_0xa909('0x82')][_0x334e14][_0x78b1b6[_0xbe9407[_0xa909('0x93')]]][_0xa909('0x85')](/"/g,'\x27'));if(!_[_0xa909('0x71')](_0x415fde))_0x1a50b9=_0x1a50b9+'§'+_0x415fde;}if(_0xf523ea=='')_0xf523ea=_0x1a50b9;else _0xf523ea+='|'+_0x1a50b9;}_0x5d0451[_0xa909('0x1b')](_0x146217['id']+':'+_0xf523ea);_0x41d5bb[_0x146217['id']]=0x1;}}}}if(hasAdditionalPhones){_0x39cd5d[_0xa909('0x1b')]('\x22'+_0x5d0451[_0xa909('0x12')](';')+'\x22');}if(_0x4d1196[_0xa909('0x1a')]){handleError(_0x150e59[_0xa909('0x82')][_0x334e14],{'code':_0xa909('0x94'),'message':_0x4d1196['join']()});}else{fs[_0xa909('0x95')](_0x148b6e,_0x39cd5d['join']()+'\x0a');}_0x39cd5d=[];}if(!(stats[_0xa909('0x96')]%0xc8)){socket['emit'](_0xa909('0x97')+_0x174851,stats);stats[_0xa909('0x5e')]=[];}}if(stopped){logger[_0xa909('0x5b')]('Abort\x20parser');_0x11de1c['abort']();}}catch(_0x589794){handleError(_0x150e59[_0xa909('0x82')][_0x334e14],{'code':_0xa909('0x98'),'message':_0x589794[_0xa909('0x60')]});logger['error'](_0xa909('0x99'),_0x589794[_0xa909('0x60')]);}},'complete':function(){try{var _0x56f6b8=[];var _0x3d3429=[];var _0x3200f4=_0xa909('0x38');if(_0x5054d7[_0xa909('0x9a')]&&_0x5054d7[_0xa909('0x9a')]['length']){_0x3200f4=_0xa909('0x9b')+_0x174851;_0x56f6b8[_0xa909('0x1b')](_0xa909('0x9c')+_0x3200f4+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0xa909('0x9d')+_0x174851;tmp_voice_queues=_0xa909('0x9e')+_0x174851;_0x3d3429[_0xa909('0x1b')](_0xa909('0x9c')+tmp_campaigns+_0xa909('0x9f'));_0x3d3429[_0xa909('0x1b')](_0xa909('0x9c')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0xa909('0xa0')](_0x3d3429,handleTZQuery)[_0xa909('0x19')](function(_0x5a7db8){updateTzCampaigns(_0x5054d7[_0xa909('0x32')])['then'](function(_0x431c60){updateTzVoiceQueues(_0x5054d7['ListId'])['then'](function(_0x84690f){if(hasTZ)_0x5e1a74=_0x5e1a74[_0xa909('0x85')](_0xa909('0x70'),_0xa909('0xa1'));var _0x16e1f5=util[_0xa909('0xd')](_0xa909('0xa2'),_0x148b6e,_0x3200f4,_0x5e1a74,_0x5054d7[_0xa909('0x32')],_0x5054d7[_0xa909('0xa3')]||null,NOW,NOW);if(_['isNil'](_0x78b1b6[_0xa909('0x30')])){_0x16e1f5+=_0xa909('0xa4');}_0x56f6b8[_0xa909('0x1b')](_0x16e1f5);if(_0x5054d7[_0xa909('0x9a')]&&_0x5054d7[_0xa909('0x9a')][_0xa909('0x1a')]){_0x56f6b8[_0xa909('0x1b')](insertCmContact(_0x5054d7['ListId'],_0x3200f4,_0x5054d7[_0xa909('0x9a')],_0x78b1b6));_0x56f6b8['push'](_0xa909('0xa5')+_0x3200f4+';');}BPromise[_0xa909('0xa0')](_0x56f6b8,handleQuery)[_0xa909('0x19')](function(_0x5e052a){BPromise[_0xa909('0x1c')]([handleAdditionalPhones()])[_0xa909('0x19')](function(){_0x56f6b8=[];for(var _0x55265a=0x0;_0x55265a\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','body\x20id\x20mandatory','map'];(function(_0x4c722e,_0x255163){var _0xa679c4=function(_0xc4da58){while(--_0xc4da58){_0x4c722e['push'](_0x4c722e['shift']());}};_0xa679c4(++_0x255163);}(_0x292c,0x17d));var _0xc292=function(_0x470bfb,_0x389787){_0x470bfb=_0x470bfb-0x0;var _0x2f5d97=_0x292c[_0x470bfb];return _0x2f5d97;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xc292('0x0'));var Papa=require('papaparse');var util=require('util');var BPromise=require(_0xc292('0x1'));var moment=require('moment');var squel=require(_0xc292('0x2'));var Redis=require(_0xc292('0x3'));var db=require(_0xc292('0x4'))['db'];var config=require('../../../config/environment');var shared=require('../../../config/environment/shared');var logger=require(_0xc292('0x5'))(_0xc292('0x6'));config[_0xc292('0x7')]=_[_0xc292('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc292('0x9'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xc292('0xa')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x20abae){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'](_0x20abae);}function selectNotIn(_0x24e0e1,_0x5b6521,_0x2d311a,_0x179064,_0x456455){return squel['select']()['field'](_0xc292('0xb'))[_0xc292('0xc')](_0x179064)[_0xc292('0xd')](_0x5b6521,null,_0x5b6521+_0xc292('0xe')+_0x179064+'.'+_0x2d311a)['where'](_0x179064+'.'+_0x2d311a+_0xc292('0xf')+_0x24e0e1+'.'+_0x2d311a)[_0xc292('0x10')](_0x5b6521+_0xc292('0x11')+_0x456455[_0xc292('0xd')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x15a89e,_0x4ec2bf){promisesAdditionalPhones=[];return db[_0xc292('0x12')][_0xc292('0x13')]({'raw':!![],'attributes':['id',_0xc292('0x14')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xc292('0x15')](function(_0x5a7e77){if(_0x5a7e77!==null){var _0x59dd08=[];for(var _0x2572e8=0x0;_0x2572e8<_0x5a7e77['length'];_0x2572e8++){var _0x3e95a1=_0x5a7e77[_0x2572e8];_0x59dd08['push'](insertAdditionalPhones(_0x3e95a1));}}Promise['all'](_0x59dd08)['then'](function(){_0x15a89e({'val':0x1});});});});}function insertAdditionalPhones(_0x4f22d6){return new Promise(function(_0xf3076d,_0x21f7b2){var _0x4a0913=_0x4f22d6['AdditionalPhones'];var _0x30aef2=_0x4a0913[_0xc292('0x16')](';');var _0x1dd032=[];orderBy=0x0;for(var _0x1c192e=0x0;_0x1c192e<_0x30aef2[_0xc292('0x17')];_0x1c192e++){_0x1dd032[_0xc292('0x18')](splitAdditionalPhone(_0x4f22d6['id'],_0x30aef2[_0x1c192e]));}Promise[_0xc292('0x19')](_0x1dd032)[_0xc292('0x15')](function(){_0xf3076d({'val':_0x30aef2[_0xc292('0x17')]});});});}function splitAdditionalPhone(_0x199352,_0x452788){return new Promise(function(_0x2331be,_0x575e90){var _0x2d9284=_0x452788[_0xc292('0x16')](':');var _0x242082=_0x2d9284[0x0];var _0x2758b7=_0x2d9284[0x1];if(!_['isNil'](_0x2758b7)){var _0x4887b8=_0x2758b7[_0xc292('0x16')]('|');var _0x563f85=[];for(var _0x4f53b6=0x0;_0x4f53b6<_0x4887b8[_0xc292('0x17')];_0x4f53b6++){if(_0x4887b8[_0x4f53b6]!==''){var _0x48b096=_['filter'](promisesAdditionalPhones,{'contactId':_0x199352,'phone':_0x4887b8[_0x4f53b6]});if(_0x48b096['length']==0x0){orderBy++;promisesAdditionalPhones[_0xc292('0x18')]({'contactId':_0x199352,'contactTypeId':_0x242082,'phone':_0x4887b8[_0x4f53b6],'orderBy':orderBy});}}}_0x2331be({'ok':0x1});}else _0x2331be({'res':0x0});});}function createAdditionalPhone(_0x47b4a8,_0x5cd288,_0x1610cd,_0x1d5922){var _0x55ff16='';var _0x11c7f4='';var _0x2ebcd1=_0x1610cd[_0xc292('0x16')]('§');_0x55ff16=_0x2ebcd1[0x0];if(_0x2ebcd1['length']==0x2)_0x11c7f4=_0x2ebcd1[0x1];return new Promise(function(_0xaca765,_0x2d76f2){return db[_0xc292('0x1a')][_0xc292('0x1b')]({'where':{'CmContactId':_0x47b4a8,'item':_0x55ff16}})['then'](function(_0x35cc24){if(_0x35cc24){return db[_0xc292('0x1a')][_0xc292('0x1c')]({'ItemTypeId':_0x5cd288,'description':_0x11c7f4,'OrderBy':_0x1d5922},{'where':{'CmContactId':_0x47b4a8,'item':_0x55ff16}})[_0xc292('0x15')](function(_0x3a3d45){_0xaca765({'res':_0xc292('0x1d')});});}else{return db['CmContactHasItem'][_0xc292('0x1e')]({'CmContactId':_0x47b4a8,'item':_0x55ff16,'description':_0x11c7f4,'ItemTypeId':_0x5cd288,'OrderBy':_0x1d5922,'ItemClass':_0xc292('0x1f')})['then'](function(_0x26be53){_0xaca765({'res':'inserted'});});}});});}function insertCmHopper(_0x92cffd,_0x5338e6,_0x5677a0,_0x35a5f7,_0x3319d0){var _0x2762c8=[_0xc292('0x20'),_0xc292('0x21'),_0xc292('0x22'),_0xc292('0x23'),_0x5338e6+'.'+_0x35a5f7,_0xc292('0x24'),_0xc292('0x25'),_0xc292('0x26'),'cm_contacts.UserId','\x22'+_0x3319d0+'\x22'];return squel[_0xc292('0x27')]()[_0xc292('0x28')]('cm_hopper')[_0xc292('0x29')]([_0xc292('0xb'),_0xc292('0x2a'),_0xc292('0x2b'),_0xc292('0x2c'),_0x35a5f7,_0xc292('0x2d'),'updatedAt',_0xc292('0x2e'),_0xc292('0x2f'),'recallme'],squel['select']()['fields'](_0x2762c8)[_0xc292('0xc')](_0x5338e6)[_0xc292('0xd')](_0xc292('0x30'),null,_0xc292('0x31')+_0x5338e6+_0xc292('0x32'))[_0xc292('0xd')](_0x5677a0,null,_0x5677a0+_0xc292('0xe')+_0x5338e6+'.'+_0x35a5f7)[_0xc292('0x10')](_0x5338e6+_0xc292('0x33'),_0x92cffd)[_0xc292('0x10')](_0xc292('0x34'),NOW)[_0xc292('0x10')](_0xc292('0x35'),selectNotIn(_0x5338e6,_0x5677a0,_0x35a5f7,'cm_hopper',[_0xc292('0x36'),_0xc292('0x37')]))['where'](_0xc292('0x35'),selectNotIn(_0x5338e6,_0x5677a0,_0x35a5f7,_0xc292('0x38'),['\x22always\x22'])))[_0xc292('0x39')]();}function insertCmHopperBlack(_0x2cea5a,_0x5940bd,_0xb6c510,_0x39ff75){var _0x260acd=[_0xc292('0x20'),'cm_contacts.id',_0xc292('0x23'),_0x5940bd+'.'+_0x39ff75,_0xc292('0x24'),_0xc292('0x25')];return squel[_0xc292('0x27')]()[_0xc292('0x28')]('cm_hopper_black')[_0xc292('0x29')]([_0xc292('0xb'),_0xc292('0x2b'),_0xc292('0x2c'),_0x39ff75,_0xc292('0x2d'),_0xc292('0x3a')],squel[_0xc292('0x3b')]()[_0xc292('0x3c')](_0x260acd)[_0xc292('0xc')](_0x5940bd)[_0xc292('0xd')](_0xc292('0x30'),null,_0xc292('0x31')+_0x5940bd+'.CmListId')['join'](_0xb6c510,null,_0xb6c510+_0xc292('0xe')+_0x5940bd+'.'+_0x39ff75)[_0xc292('0x10')](_0x5940bd+'.CmListId\x20=\x20?',_0x2cea5a)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xc292('0x10')](_0xc292('0x35'),squel[_0xc292('0x3b')]()[_0xc292('0x3d')]('phone')[_0xc292('0xc')](_0xc292('0x3e'))[_0xc292('0x10')](_0xc292('0x3f'),_0x2cea5a)['where'](_0x39ff75+'\x20=\x20'+_0x5940bd+'.'+_0x39ff75)))[_0xc292('0x39')]();}function insertTzCmHopper(_0x39ce0d,_0xb86fc2,_0x21a39f,_0x138ea9,_0x54a53b,_0x569ecf){var _0x263d72=[_0xc292('0x20'),_0xc292('0x40')+_0x569ecf+_0xc292('0x41'),_0xc292('0x22'),_0xc292('0x23'),_0xb86fc2+'.'+_0x138ea9,_0xc292('0x24'),_0xc292('0x25'),_0xc292('0x26'),_0xc292('0x42'),'\x22'+_0x54a53b+'\x22'];var _0x26348b=squel[_0xc292('0x27')]()[_0xc292('0x28')](_0xc292('0x38'))[_0xc292('0x29')]([_0xc292('0xb'),'scheduledat',_0xc292('0x2b'),_0xc292('0x2c'),_0x138ea9,'createdAt',_0xc292('0x3a'),_0xc292('0x2e'),'UserId',_0xc292('0x43')],squel[_0xc292('0x3b')]()[_0xc292('0x3c')](_0x263d72)[_0xc292('0xc')](_0xb86fc2)[_0xc292('0xd')](_0xc292('0x30'),null,_0xc292('0x31')+_0xb86fc2+_0xc292('0x32'))['join'](_0x21a39f,null,_0x21a39f+_0xc292('0xe')+_0xb86fc2+'.'+_0x138ea9)[_0xc292('0xd')](_0x569ecf,null,_0x569ecf+_0xc292('0xe')+_0xb86fc2+'.'+_0x138ea9)['where'](_0xb86fc2+_0xc292('0x33'),_0x39ce0d)[_0xc292('0x10')](_0xc292('0x34'),NOW)[_0xc292('0x10')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xb86fc2,_0x21a39f,_0x138ea9,'cm_hopper',[_0xc292('0x36'),_0xc292('0x37')]))[_0xc292('0x10')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xb86fc2,_0x21a39f,_0x138ea9,'cm_hopper',[_0xc292('0x36')])))[_0xc292('0x39')]();return _0x26348b;}function insertTzCmHopperBlack(_0x27b706,_0x2bbb57,_0x1d9ae5,_0x1ade37){var _0x4d18b1=[_0xc292('0x20'),_0xc292('0x22'),_0xc292('0x23'),_0x2bbb57+'.'+_0x1ade37,_0xc292('0x24'),_0xc292('0x25')];return squel['insert']()['into'](_0xc292('0x3e'))[_0xc292('0x29')]([_0xc292('0xb'),_0xc292('0x2b'),_0xc292('0x2c'),_0x1ade37,_0xc292('0x2d'),'updatedAt'],squel[_0xc292('0x3b')]()[_0xc292('0x3c')](_0x4d18b1)[_0xc292('0xc')](_0x2bbb57)[_0xc292('0xd')]('cm_contacts',null,_0xc292('0x31')+_0x2bbb57+_0xc292('0x32'))[_0xc292('0xd')](_0x1d9ae5,null,_0x1d9ae5+'.id\x20=\x20'+_0x2bbb57+'.'+_0x1ade37)[_0xc292('0x10')](_0x2bbb57+'.CmListId\x20=\x20?',_0x27b706)['where'](_0xc292('0x34'),NOW)[_0xc292('0x10')](_0xc292('0x35'),squel['select']()['field'](_0xc292('0xb'))[_0xc292('0xc')]('cm_hopper_black')[_0xc292('0x10')](_0xc292('0x3f'),_0x27b706)[_0xc292('0x10')](_0x1ade37+_0xc292('0xf')+_0x2bbb57+'.'+_0x1ade37)))[_0xc292('0x39')]();}function insertCmHopperAdditionalPhones(_0x2a3089){var _0x5e53bc=[_0xc292('0x44'),_0xc292('0x45'),_0xc292('0x46'),_0xc292('0x47'),_0xc292('0x48')];return squel[_0xc292('0x27')]()[_0xc292('0x28')](_0xc292('0x49'))[_0xc292('0x29')]([_0xc292('0x4a'),'phone',_0xc292('0x4b'),_0xc292('0x2d'),_0xc292('0x3a')],squel[_0xc292('0x3b')]()[_0xc292('0x3c')](_0x5e53bc)['from'](_0xc292('0x38'))[_0xc292('0xd')](_0xc292('0x30'),null,_0xc292('0x4c'))[_0xc292('0xd')](_0xc292('0x4d'),null,_0xc292('0x4e'))[_0xc292('0x10')](_0xc292('0x4f'),_0x2a3089)['where'](_0xc292('0x34'),NOW))[_0xc292('0x39')]();}function insertCmContact(_0xf5c5bc,_0x1ee835,_0x3130a0,_0xe3997f){var _0x5137aa=_[_0xc292('0x50')](_[_0xc292('0x51')](_0xe3997f),['ListId',_0xc292('0x52'),_0xc292('0x2d'),_0xc292('0x3a')]);return squel['insert']()[_0xc292('0x28')]('cm_contacts')[_0xc292('0x29')](_0x5137aa,squel[_0xc292('0x3b')]()[_0xc292('0x3c')](_0x5137aa)[_0xc292('0xc')](_0x1ee835)[_0xc292('0x10')]('('+_0x3130a0[_0xc292('0xd')](',')+_0xc292('0x53'),squel[_0xc292('0x3b')]()['fields'](_0x3130a0)[_0xc292('0xc')](_0xc292('0x30'))[_0xc292('0x10')]('ListId\x20=\x20?',_0xf5c5bc)[_0xc292('0x10')](_0xc292('0x54')))[_0xc292('0x10')](_0xc292('0x55'),squel[_0xc292('0x3b')]()[_0xc292('0x3d')](_0xc292('0x56'),_0xc292('0x57'))[_0xc292('0xc')](_0x1ee835)[_0xc292('0x58')](_0x3130a0[_0xc292('0xd')](','))))[_0xc292('0x39')]();}function handleStop(){logger['info'](_0xc292('0x59'));stopped=!![];}function handleUncaughtException(_0x1fea9b){logger[_0xc292('0x5a')](_0x1fea9b[_0xc292('0x5b')]);process[_0xc292('0x5c')](0x1);}function handleError(_0x53277a,_0x5ef2ef){stats[_0xc292('0x5d')][_0xc292('0x18')]({'name':_0x5ef2ef[_0xc292('0x5e')],'message':_0x5ef2ef[_0xc292('0x5b')],'row':_0x53277a});}function handleQuery(_0x396738){logger[_0xc292('0x5f')](_0x396738);return db[_0xc292('0x60')][_0xc292('0x61')](_0x396738)['spread'](function(_0xd96041){results['push'](_0xd96041);})[_0xc292('0x62')](function(_0x4cdee0){logger[_0xc292('0x5a')](_0x4cdee0[_0xc292('0x5b')]);});}function updateTzCampaigns(_0x573305){return new Promise(function(_0x3c0c03,_0x10d169){var _0x40f7a2=squel[_0xc292('0x3b')]()[_0xc292('0x3c')]([_0xc292('0x63'),'campaigns.dialTimezone'])['from']('campaigns')[_0xc292('0xd')](_0xc292('0x64'),null,_0xc292('0x65'))['where'](_0xc292('0x66')+_0x573305);db[_0xc292('0x60')][_0xc292('0x61')](_0x40f7a2[_0xc292('0x39')]())[_0xc292('0x67')](function(_0x4846cd){var _0x1cef9f=[];for(var _0x411f27=0x0;_0x411f27<_0x4846cd[_0xc292('0x17')];_0x411f27++){_0x1cef9f['push'](getTimezoneData(_0x4846cd[_0x411f27],tmp_campaigns));}BPromise[_0xc292('0x19')](_0x1cef9f)[_0xc292('0x15')](function(){_0x3c0c03({'val':0x1});});})[_0xc292('0x62')](function(_0x2d9e78){logger['error'](_0x2d9e78[_0xc292('0x5b')]);_0x3c0c03({'val':0x0});});});}function updateTzVoiceQueues(_0x2d53f4){return new Promise(function(_0x352819,_0xdf3e38){var _0x46a3fa=squel[_0xc292('0x3b')]()['fields']([_0xc292('0x68'),_0xc292('0x69')])[_0xc292('0xc')]('voice_queues')[_0xc292('0xd')](_0xc292('0x6a'),null,_0xc292('0x6b'))[_0xc292('0x10')](_0xc292('0x6c')+_0x2d53f4);db[_0xc292('0x60')][_0xc292('0x61')](_0x46a3fa[_0xc292('0x39')]())[_0xc292('0x67')](function(_0x4167ee){var _0x11fbf1=[];for(var _0x1512e1=0x0;_0x1512e1<_0x4167ee[_0xc292('0x17')];_0x1512e1++){_0x11fbf1['push'](getTimezoneData(_0x4167ee[_0x1512e1],tmp_voice_queues));}BPromise[_0xc292('0x19')](_0x11fbf1)[_0xc292('0x15')](function(){_0x352819({'val':0x1});});})[_0xc292('0x62')](function(_0x40887c){logger[_0xc292('0x5a')](_0x40887c[_0xc292('0x5b')]);_0x352819({'val':0x0});});});}function getTimezoneData(_0x3fa3d8,_0x491024){return new Promise(function(_0x7a710a,_0xc3b2ec){var _0x25a00b=shared[_0xc292('0x6d')];var _0x5bff81=_0x25a00b[_0x3fa3d8[_0xc292('0x6e')]];if(_[_0xc292('0x6f')](_0x5bff81)){_0x7a710a({'ret':0x1});}else{var _0x182126=_0x5bff81['utcOffset'];var _0x461d19=squel[_0xc292('0x27')]()[_0xc292('0x28')](_0x491024)[_0xc292('0x70')]('id',_0x3fa3d8['id'])[_0xc292('0x70')](_0xc292('0x71'),_0x182126)[_0xc292('0x70')](_0xc292('0x6e'),_0x3fa3d8['dialTimezone'])[_0xc292('0x39')]();return db[_0xc292('0x60')]['query'](_0x461d19)['spread'](function(_0x5a7437){_0x7a710a({'ret':0x1});})[_0xc292('0x62')](function(_0x577d4c){logger[_0xc292('0x5a')](_0x577d4c['message']);_0xc3b2ec({'ret':0x1});});}});}function handleTZQuery(_0x6f11f1){logger['info'](_0x6f11f1);return db[_0xc292('0x60')][_0xc292('0x61')](_0x6f11f1)[_0xc292('0x67')](function(_0x1c2952){})[_0xc292('0x62')](function(_0x5d4c1a){logger[_0xc292('0x5a')](_0x5d4c1a[_0xc292('0x5b')]);});}function main(_0x14a4d5,_0x56d517,_0x43441e,_0x3ec439){logger[_0xc292('0x5f')](_0xc292('0x72'),_0x14a4d5,JSON[_0xc292('0x73')](_0x56d517));process['send'](_0xc292('0x74'));var _0x64d757=_0x56d517[_0xc292('0x75')];var _0x2cff18=_[_0xc292('0x76')](_0x64d757);var _0x54a79d=_0x56d517[_0xc292('0x77')];var _0x2da55d=path[_0xc292('0xd')](config[_0xc292('0x78')],'server/files/tmp',_0x54a79d+_0xc292('0x79'));hasTZ=_['keys'](_0x64d757)[_0xc292('0x7a')]('dialTimezone');var _0x45bb17=_[_0xc292('0x51')](_0x64d757)[_0xc292('0xd')]();logger[_0xc292('0x5f')](_0xc292('0x7b'),_0x45bb17);db['ContactItemType'][_0xc292('0x13')]({'raw':!![],'attributes':['id',_0xc292('0x7c')]})[_0xc292('0x15')](function(_0x3a3fe6){for(var _0x563482=0x0;_0x563482<_0x3a3fe6[_0xc292('0x17')];_0x563482++){if(_0x3a3fe6[_0x563482][_0xc292('0x7c')]in _0x64d757){contactItemTypes[_0xc292('0x18')](_0x3a3fe6[_0x563482]);delete _0x2cff18[_0x3a3fe6[_0x563482][_0xc292('0x7c')]];hasAdditionalPhones=!![];}for(var _0x396917 in _0x64d757){if(_0x3a3fe6[_0x563482][_0xc292('0x7c')]+_0xc292('0x7d')===_0x396917){phoneDescriptions['push']({'itemTypeId':_0x3a3fe6[_0x563482]['id'],'description':_0x396917});delete _0x2cff18[_0x396917];}}}if(hasAdditionalPhones)_0x2cff18[_0xc292('0x14')]='';var _0x30ed92=_[_0xc292('0x51')](_0x2cff18)[_0xc292('0xd')]();logger[_0xc292('0x5f')]('header',_0x30ed92);fs[_0xc292('0x7e')](_0x2da55d,_0x30ed92+'\x0a');Papa[_0xc292('0x7f')](fs[_0xc292('0x80')](_0x14a4d5),{'header':!![],'skipEmptyLines':!![],'step':function(_0x139ee3,_0x4c75d7){try{for(var _0x50dfa1=0x0,_0x2f57b5=[];_0x50dfa1<_0x139ee3[_0xc292('0x81')][_0xc292('0x17')];_0x50dfa1++){stats[_0xc292('0x82')]+=0x1;if(_0x139ee3[_0xc292('0x5d')][_0x50dfa1]){handleError(_0x139ee3[_0xc292('0x81')][_0x50dfa1],_0x139ee3[_0xc292('0x5d')][_0x50dfa1]);}else{var _0x2a11af=[];var _0x12f8e5=[];var _0x1e5b53={};for(var _0xa6a170 in _0x64d757){let _0x1a99ef=contactItemTypes[_0xc292('0x83')](_0x5da20c=>_0x5da20c[_0xc292('0x7c')]===_0xa6a170);let _0xcebd00=contactItemTypes[_0xc292('0x83')](_0x50ee98=>_0x50ee98[_0xc292('0x7c')]+_0xc292('0x7d')===_0xa6a170);if(_[_0xc292('0x6f')](_0x1a99ef)&&_['isNil'](_0xcebd00)){if(_0x64d757[_0xc292('0x84')](_0xa6a170)){if(_0x139ee3[_0xc292('0x81')][_0x50dfa1][_0x64d757[_0xa6a170]]){var _0x722c8f=_[_0xc292('0x85')](_0x139ee3[_0xc292('0x81')][_0x50dfa1][_0x64d757[_0xa6a170]]['replace'](/"/g,'\x27'));switch(_0xa6a170){case _0xc292('0x2a'):var _0x32c11e=moment(_0x722c8f,_0xc292('0x86'),!![]);if(_0x32c11e[_0xc292('0x87')]()){_0x2f57b5[_0xc292('0x18')]('\x22'+_0x722c8f+'\x22');}else{_0x2a11af[_0xc292('0x18')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xc292('0x2e'):var _0x25d168=parseInt(_0x722c8f);_0x722c8f=_[_0xc292('0x88')](_0x25d168)||_0x25d168<0x0||_0x25d168>0x4?_0x3ec439?0x3:0x2:_0x25d168;_0x2f57b5[_0xc292('0x18')]('\x22'+_0x722c8f+'\x22');break;case _0xc292('0x2f'):var _0x41ddfc=parseInt(_0x722c8f);if(_[_0xc292('0x89')](_0x41ddfc)&&_[_0xc292('0x7a')](_0x43441e,_0x41ddfc)){_0x2f57b5[_0xc292('0x18')]('\x22'+_0x41ddfc+'\x22');}else{_0x2a11af['push'](_0xc292('0x8a'));}break;case _0xc292('0x8b'):if(isEmail(_0x722c8f)){_0x2f57b5[_0xc292('0x18')]('\x22'+_0x722c8f+'\x22');}else{_0x2a11af[_0xc292('0x18')](_0xc292('0x8c'));}break;case _0xc292('0x8d'):var _0x241cf2=moment(_0x722c8f,_0xc292('0x8e'),!![]);if(_0x241cf2[_0xc292('0x87')]()){_0x2f57b5['push']('\x22'+_0x722c8f+'\x22');}else{_0x2a11af[_0xc292('0x18')](_0xc292('0x8f'));}break;case _0xc292('0x6e'):var _0x4ae3bd=shared[_0xc292('0x6d')];var _0xbc6ce7=_0x4ae3bd[_0x722c8f];if(!_['isNil'](_0xbc6ce7)){var _0x2939b9=_0xbc6ce7['utcOffset'];_0x2f57b5['push']('\x22'+_0x722c8f+'\x22');_0x2f57b5[_0xc292('0x18')]('\x22'+_0x2939b9+'\x22');}break;default:_0x2f57b5[_0xc292('0x18')]('\x22'+_0x722c8f+'\x22');}}else{switch(_0xa6a170){case'firstName':case _0xc292('0xb'):_0x2a11af['push'](_0xa6a170+'\x20not\x20specified');break;default:_0x2f57b5[_0xc292('0x18')]('\x22\x22');}}}}else{var _0x130f75='';if(!_[_0xc292('0x6f')](_0x1a99ef)){if(!_0x1e5b53[_0xc292('0x84')](_0x1a99ef['id'])){if(!_[_0xc292('0x6f')](_0x139ee3[_0xc292('0x81')][_0x50dfa1][_0x64d757[_0xa6a170]])){var _0x722c8f=_[_0xc292('0x85')](_0x139ee3[_0xc292('0x81')][_0x50dfa1][_0x64d757[_0xa6a170]]['replace'](/"/g,'\x27'));var _0x1302b0=phoneDescriptions['find'](_0x5f0936=>_0x5f0936[_0xc292('0x90')]===_0x1a99ef['id']);if(!_[_0xc292('0x6f')](_0x1302b0)){var _0x14b722=_[_0xc292('0x85')](_0x139ee3[_0xc292('0x81')][_0x50dfa1][_0x64d757[_0x1302b0['description']]]['replace'](/"/g,'\x27'));if(!_[_0xc292('0x6f')](_0x14b722))_0x722c8f=_0x722c8f+'§'+_0x14b722;}if(_0x130f75=='')_0x130f75=_0x722c8f;else _0x130f75+='|'+_0x722c8f;}_0x12f8e5['push'](_0x1a99ef['id']+':'+_0x130f75);_0x1e5b53[_0x1a99ef['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2f57b5[_0xc292('0x18')]('\x22'+_0x12f8e5['join'](';')+'\x22');}if(_0x2a11af[_0xc292('0x17')]){handleError(_0x139ee3[_0xc292('0x81')][_0x50dfa1],{'code':_0xc292('0x91'),'message':_0x2a11af[_0xc292('0xd')]()});}else{fs[_0xc292('0x92')](_0x2da55d,_0x2f57b5[_0xc292('0xd')]()+'\x0a');}_0x2f57b5=[];}if(!(stats[_0xc292('0x82')]%0xc8)){socket[_0xc292('0x93')](_0xc292('0x94')+_0x54a79d,stats);stats[_0xc292('0x5d')]=[];}}if(stopped){logger[_0xc292('0x5f')](_0xc292('0x95'));_0x4c75d7['abort']();}}catch(_0x2f76ca){handleError(_0x139ee3[_0xc292('0x81')][_0x50dfa1],{'code':_0xc292('0x96'),'message':_0x2f76ca[_0xc292('0x5b')]});logger[_0xc292('0x5a')](_0xc292('0x97'),_0x2f76ca[_0xc292('0x5b')]);}},'complete':function(){try{var _0x24d2ee=[];var _0x4bbe85=[];var _0x3ad39a=_0xc292('0x30');if(_0x56d517['duplicates']&&_0x56d517[_0xc292('0x98')]['length']){_0x3ad39a=_0xc292('0x99')+_0x54a79d;_0x24d2ee[_0xc292('0x18')](_0xc292('0x9a')+_0x3ad39a+_0xc292('0x9b'));}tmp_campaigns=_0xc292('0x9c')+_0x54a79d;tmp_voice_queues=_0xc292('0x9d')+_0x54a79d;_0x4bbe85[_0xc292('0x18')](_0xc292('0x9a')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x4bbe85[_0xc292('0x18')](_0xc292('0x9a')+tmp_voice_queues+_0xc292('0x9e'));BPromise[_0xc292('0x9f')](_0x4bbe85,handleTZQuery)[_0xc292('0x15')](function(_0x5b47d1){updateTzCampaigns(_0x56d517[_0xc292('0x2c')])[_0xc292('0x15')](function(_0x4aba1b){updateTzVoiceQueues(_0x56d517[_0xc292('0x2c')])[_0xc292('0x15')](function(_0x5c2a38){if(hasTZ)_0x30ed92=_0x30ed92['replace'](_0xc292('0x6e'),_0xc292('0xa0'));var _0x195cd2=util['format'](_0xc292('0xa1'),_0x2da55d,_0x3ad39a,_0x30ed92,_0x56d517[_0xc292('0x2c')],_0x56d517[_0xc292('0x52')]||null,NOW,NOW);if(_[_0xc292('0x6f')](_0x64d757['scheduledat'])){_0x195cd2+=_0xc292('0xa2');}_0x24d2ee['push'](_0x195cd2);if(_0x56d517[_0xc292('0x98')]&&_0x56d517[_0xc292('0x98')][_0xc292('0x17')]){_0x24d2ee[_0xc292('0x18')](insertCmContact(_0x56d517[_0xc292('0x2c')],_0x3ad39a,_0x56d517['duplicates'],_0x64d757));_0x24d2ee[_0xc292('0x18')](_0xc292('0xa3')+_0x3ad39a+';');}BPromise[_0xc292('0x9f')](_0x24d2ee,handleQuery)['then'](function(_0x149eb5){BPromise[_0xc292('0x19')]([handleAdditionalPhones()])['then'](function(){_0x24d2ee=[];for(var _0x5d3198=0x0;_0x5d3198\x20\x20','existsSync','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','select','field','from','join','where'];(function(_0x286354,_0x128be5){var _0x30fe4d=function(_0x18ae00){while(--_0x18ae00){_0x286354['push'](_0x286354['shift']());}};_0x30fe4d(++_0x128be5);}(_0x4ffa,0x124));var _0xa4ff=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4ffa[_0x46e363];return _0x3fb059;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require(_0xa4ff('0x0'));var util=require('util');var BPromise=require(_0xa4ff('0x1'));var moment=require(_0xa4ff('0x2'));var squel=require(_0xa4ff('0x3'));var Redis=require(_0xa4ff('0x4'));var db=require(_0xa4ff('0x5'))['db'];var config=require(_0xa4ff('0x6'));var logger=require('../../../config/logger')(_0xa4ff('0x7'));config[_0xa4ff('0x8')]=_[_0xa4ff('0x9')](config['redis'],{'host':_0xa4ff('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa4ff('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()[_0xa4ff('0xb')](_0xa4ff('0xc'));var tempTableName='cm_contacts_temp_'+moment()[_0xa4ff('0xb')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x5e2d94){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'](_0x5e2d94);}function selectNotIn(_0xb9c9bc,_0x3b1fe4,_0x7cb440,_0x2007b1,_0x4ec03b){return squel[_0xa4ff('0xd')]()[_0xa4ff('0xe')]('phone')[_0xa4ff('0xf')](_0x2007b1)[_0xa4ff('0x10')](_0x3b1fe4,null,_0x3b1fe4+'.id\x20=\x20'+_0x2007b1+'.'+_0x7cb440)[_0xa4ff('0x11')](_0x2007b1+'.'+_0x7cb440+_0xa4ff('0x12')+_0xb9c9bc+'.'+_0x7cb440)['where'](_0x3b1fe4+_0xa4ff('0x13')+_0x4ec03b['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x34f681,_0x5a3869){promisesAdditionalPhones=[];promisesContact=[];return db[_0xa4ff('0x14')][_0xa4ff('0x15')]('select\x20*\x20from\x20'+tempTableName)[_0xa4ff('0x16')](function(_0x199d1e){if(_0x199d1e!==null){var _0x27f8d8=[];for(var _0x139e7f=0x0;_0x139e7f<_0x199d1e[_0xa4ff('0x17')];_0x139e7f++){var _0x380c2b=_0x199d1e[_0x139e7f];if(!_['isNil'](_0x380c2b[_0xa4ff('0x18')])){if(!_[_0xa4ff('0x19')](_0x380c2b[_0xa4ff('0x1a')]))_0x27f8d8['push'](insertAdditionalPhones(_0x380c2b));promisesContact[_0xa4ff('0x1b')]({'contact':_0x380c2b});}}}Promise[_0xa4ff('0x1c')](_0x27f8d8)['then'](function(){_0x34f681({'val':0x1});});})['catch'](function(_0x28a1bc){logger['error'](_0x28a1bc['message']);});});}function insertAdditionalPhones(_0x31d0da){return new Promise(function(_0x20ba0d,_0x2857e7){var _0x15450d=_0x31d0da[_0xa4ff('0x1a')];if(_['isNil'](_0x15450d))_0x2857e7({'val':0x0});else{var _0x77c629=_0x15450d['split'](';');var _0x570458=[];orderBy=0x0;for(var _0x2598b4=0x0;_0x2598b4<_0x77c629['length'];_0x2598b4++){_0x570458[_0xa4ff('0x1b')](splitAdditionalPhone(_0x31d0da['id'],_0x77c629[_0x2598b4]));}Promise['all'](_0x570458)[_0xa4ff('0x1d')](function(){_0x20ba0d({'val':_0x77c629['length']});});}});}function splitAdditionalPhone(_0x520bdc,_0x132633){return new Promise(function(_0xde9489,_0x24dce3){var _0x1d8a18=_0x132633['split'](':');var _0x4a649c=_0x1d8a18[0x0];var _0x1a62ba=_0x1d8a18[0x1];if(_0x1a62ba!==''){var _0x38f633=_0x1a62ba[_0xa4ff('0x1e')]('|');var _0x3532e3=[];for(var _0x20e611=0x0;_0x20e611<_0x38f633[_0xa4ff('0x17')];_0x20e611++){if(_0x38f633[_0x20e611]!==''){var _0x5420a2=_[_0xa4ff('0x1f')](promisesAdditionalPhones,{'contactId':_0x520bdc,'phone':_0x38f633[_0x20e611]});if(_0x5420a2[_0xa4ff('0x17')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x520bdc,'contactTypeId':_0x4a649c,'phone':_0x38f633[_0x20e611],'orderBy':orderBy});}}}_0xde9489({'ok':0x1});}else _0xde9489({'res':0x0});});}function createAdditionalPhone(_0x56ec3b,_0x166ed8,_0x245479,_0x3c3431){var _0x56c618='';var _0x30d2aa='';var _0x31bf4d=_0x245479[_0xa4ff('0x1e')]('§');_0x56c618=_0x31bf4d[0x0];if(_0x31bf4d[_0xa4ff('0x17')]==0x2)_0x30d2aa=_0x31bf4d[0x1];return new Promise(function(_0x4e56b7,_0x268b06){return db[_0xa4ff('0x20')]['findOne']({'where':{'CmContactId':_0x56ec3b,'item':_0x56c618}})[_0xa4ff('0x1d')](function(_0x1bcd10){if(_0x1bcd10){return db[_0xa4ff('0x20')][_0xa4ff('0x21')]({'ItemTypeId':_0x166ed8,'description':_0x30d2aa,'OrderBy':_0x3c3431},{'where':{'CmContactId':_0x56ec3b,'item':_0x56c618}})[_0xa4ff('0x1d')](function(_0x2c67ee){_0x4e56b7({'res':_0xa4ff('0x22')});});}else{return db[_0xa4ff('0x20')][_0xa4ff('0x23')]({'CmContactId':_0x56ec3b,'item':_0x56c618,'ItemTypeId':_0x166ed8,'description':_0x30d2aa,'OrderBy':_0x3c3431,'ItemClass':_0xa4ff('0x24')})['then'](function(_0x1b7911){_0x4e56b7({'res':_0xa4ff('0x25')});});}});});}function updateContact(_0x554c1b){return new Promise(function(_0x43cce3,_0x306e40){var _0x40659=_0x554c1b['id'];delete _0x554c1b['id'];return db[_0xa4ff('0x26')]['update'](_0x554c1b,{'where':{'id':_0x40659}})[_0xa4ff('0x1d')](function(_0x2236c1){updatedRows+=0x1;return db[_0xa4ff('0x27')]['update']({'phone':_0x554c1b['phone']},{'where':{'ContactId':_0x40659}})[_0xa4ff('0x1d')](function(_0x513aae){_0x43cce3({'ret':'OK'});});});});}function insertCmHopper(_0x270593,_0x1f5f1d,_0x326429,_0x4bf879,_0x23d613){var _0x10ef00=[_0xa4ff('0x28'),_0xa4ff('0x29'),'cm_contacts.id',_0xa4ff('0x2a'),_0x1f5f1d+'.'+_0x4bf879,_0xa4ff('0x2b'),_0xa4ff('0x2c'),'cm_contacts.priority',_0xa4ff('0x2d'),'\x22'+_0x23d613+'\x22'];return squel[_0xa4ff('0x2e')]()['into'](_0xa4ff('0x2f'))['fromQuery']([_0xa4ff('0x18'),'scheduledat','ContactId',_0xa4ff('0x30'),_0x4bf879,_0xa4ff('0x31'),_0xa4ff('0x32'),'priority',_0xa4ff('0x33'),_0xa4ff('0x34')],squel['select']()[_0xa4ff('0x35')](_0x10ef00)['from'](_0x1f5f1d)[_0xa4ff('0x10')](_0xa4ff('0x36'),null,_0xa4ff('0x37')+_0x1f5f1d+_0xa4ff('0x38'))[_0xa4ff('0x10')](_0x326429,null,_0x326429+_0xa4ff('0x39')+_0x1f5f1d+'.'+_0x4bf879)[_0xa4ff('0x11')](_0x1f5f1d+_0xa4ff('0x3a'),_0x270593)[_0xa4ff('0x11')](_0xa4ff('0x3b'),NOW)[_0xa4ff('0x11')](_0xa4ff('0x3c'),selectNotIn(_0x1f5f1d,_0x326429,_0x4bf879,_0xa4ff('0x2f'),[_0xa4ff('0x3d'),_0xa4ff('0x3e')]))[_0xa4ff('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1f5f1d,_0x326429,_0x4bf879,_0xa4ff('0x2f'),['\x22always\x22'])))[_0xa4ff('0x3f')]();}function insertCmHopperBlack(_0x287abb,_0x5d9a26,_0x15837b,_0x1b32c9){var _0x20d0ba=['cm_contacts.phone',_0xa4ff('0x40'),_0xa4ff('0x2a'),_0x5d9a26+'.'+_0x1b32c9,_0xa4ff('0x2b'),_0xa4ff('0x2c')];return squel['insert']()[_0xa4ff('0x41')](_0xa4ff('0x42'))['fromQuery'](['phone',_0xa4ff('0x43'),_0xa4ff('0x30'),_0x1b32c9,'createdAt','updatedAt'],squel[_0xa4ff('0xd')]()['fields'](_0x20d0ba)[_0xa4ff('0xf')](_0x5d9a26)[_0xa4ff('0x10')](_0xa4ff('0x36'),null,_0xa4ff('0x37')+_0x5d9a26+'.CmListId')[_0xa4ff('0x10')](_0x15837b,null,_0x15837b+_0xa4ff('0x39')+_0x5d9a26+'.'+_0x1b32c9)[_0xa4ff('0x11')](_0x5d9a26+'.CmListId\x20=\x20?',_0x287abb)[_0xa4ff('0x11')](_0xa4ff('0x3b'),NOW)['where'](_0xa4ff('0x3c'),squel[_0xa4ff('0xd')]()['field'](_0xa4ff('0x18'))[_0xa4ff('0xf')](_0xa4ff('0x42'))[_0xa4ff('0x11')](_0xa4ff('0x44'),_0x287abb)[_0xa4ff('0x11')](_0x1b32c9+'\x20=\x20?',_0x5d9a26+'.'+_0x1b32c9)))[_0xa4ff('0x3f')]();}function insertCmHopperAdditionalPhones(_0x945692){var _0x2a44f6=[_0xa4ff('0x45'),'cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt',_0xa4ff('0x46')];return squel['insert']()['into'](_0xa4ff('0x47'))['fromQuery']([_0xa4ff('0x48'),_0xa4ff('0x18'),_0xa4ff('0x49'),'createdAt',_0xa4ff('0x32')],squel['select']()[_0xa4ff('0x35')](_0x2a44f6)[_0xa4ff('0xf')](_0xa4ff('0x2f'))[_0xa4ff('0x10')](_0xa4ff('0x36'),null,_0xa4ff('0x4a'))[_0xa4ff('0x10')](_0xa4ff('0x4b'),null,_0xa4ff('0x4c'))[_0xa4ff('0x11')]('cm_hopper.ListId\x20=\x20?',_0x945692)[_0xa4ff('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xa4ff('0x3f')]();}function insertCmContact(_0x459c69,_0x4ee0e4,_0x45f27b,_0x184396){var _0x42de02=_[_0xa4ff('0x4d')](_['keys'](_0x184396),[_0xa4ff('0x30'),_0xa4ff('0x4e'),_0xa4ff('0x31'),_0xa4ff('0x32')]);return squel['insert']()['into'](_0xa4ff('0x36'))[_0xa4ff('0x4f')](_0x42de02,squel['select']()[_0xa4ff('0x35')](_0x42de02)[_0xa4ff('0xf')](_0x4ee0e4)[_0xa4ff('0x11')]('('+_0x45f27b[_0xa4ff('0x10')](',')+_0xa4ff('0x50'),squel[_0xa4ff('0xd')]()[_0xa4ff('0x35')](_0x45f27b)['from']('cm_contacts')['where'](_0xa4ff('0x44'),_0x459c69))[_0xa4ff('0x11')](_0xa4ff('0x51'),squel[_0xa4ff('0xd')]()[_0xa4ff('0xe')](_0xa4ff('0x52'),'min_id')[_0xa4ff('0xf')](_0x4ee0e4)[_0xa4ff('0x53')](_0x45f27b['join'](','))))[_0xa4ff('0x3f')]();}function handleStop(){logger[_0xa4ff('0x54')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x3ce969){logger[_0xa4ff('0x55')](_0x3ce969[_0xa4ff('0x56')]);process[_0xa4ff('0x57')](0x1);}function handleError(_0x39abc5,_0x53f66c){stats[_0xa4ff('0x58')][_0xa4ff('0x1b')]({'name':_0x53f66c[_0xa4ff('0x59')],'message':_0x53f66c[_0xa4ff('0x56')],'row':_0x39abc5});}function handleQuery(_0xe608c4){logger[_0xa4ff('0x54')](_0xe608c4);return db[_0xa4ff('0x14')]['query'](_0xe608c4)['spread'](function(_0x15b7a6){results['push'](_0x15b7a6);})[_0xa4ff('0x5a')](function(_0x254f09){logger[_0xa4ff('0x55')](_0x254f09[_0xa4ff('0x56')]);});}function main(_0x47fb21,_0x7ed532,_0x323092,_0x4e05fa){logger[_0xa4ff('0x54')](_0xa4ff('0x5b'),_0x47fb21,JSON['stringify'](_0x7ed532));process[_0xa4ff('0x5c')]('start');var _0x42c662=_0x7ed532[_0xa4ff('0x5d')];var _0x54f581=_[_0xa4ff('0x5e')](_0x42c662);var _0x443fa2=_0x7ed532[_0xa4ff('0x5f')];var _0x5893cc=path[_0xa4ff('0x10')](config[_0xa4ff('0x60')],_0xa4ff('0x61'),_0x443fa2+_0xa4ff('0x62'));logger[_0xa4ff('0x54')](_0xa4ff('0x63'),_0x7ed532);db['ContactItemType'][_0xa4ff('0x64')]({'raw':!![],'attributes':['id',_0xa4ff('0x65')]})[_0xa4ff('0x1d')](function(_0x238071){for(var _0x33635c=0x0;_0x33635c<_0x238071['length'];_0x33635c++){if(_0x238071[_0x33635c][_0xa4ff('0x65')]in _0x42c662){contactItemTypes['push'](_0x238071[_0x33635c]);delete _0x54f581[_0x238071[_0x33635c][_0xa4ff('0x65')]];hasAdditionalPhones=!![];}for(var _0x279491 in _0x42c662){if(_0x238071[_0x33635c][_0xa4ff('0x65')]+'_description'===_0x279491){phoneDescriptions['push']({'itemTypeId':_0x238071[_0x33635c]['id'],'description':_0x279491});delete _0x54f581[_0x279491];}}}if(hasAdditionalPhones)_0x54f581[_0xa4ff('0x1a')]='';var _0x9b8628=_[_0xa4ff('0x66')](_0x54f581)['join']();logger[_0xa4ff('0x54')](_0xa4ff('0x67'),_0x9b8628);fs['writeFileSync'](_0x5893cc,_0x9b8628+'\x0a');Papa[_0xa4ff('0x68')](fs[_0xa4ff('0x69')](_0x47fb21),{'header':!![],'skipEmptyLines':!![],'step':function(_0x15da7d,_0x21b986){try{for(var _0x1d2848=0x0,_0x187ddf=[];_0x1d2848<_0x15da7d[_0xa4ff('0x6a')]['length'];_0x1d2848++){stats[_0xa4ff('0x6b')]+=0x1;if(_0x15da7d[_0xa4ff('0x58')][_0x1d2848]){handleError(_0x15da7d[_0xa4ff('0x6a')][_0x1d2848],_0x15da7d['errors'][_0x1d2848]);}else{var _0x114bcd=[];var _0x1b8bc3=[];var _0x55480b={};for(var _0x14058c in _0x42c662){let _0x2e6bf8=contactItemTypes[_0xa4ff('0x6c')](_0x59b1d8=>_0x59b1d8[_0xa4ff('0x65')]===_0x14058c);let _0x33bcf9=contactItemTypes[_0xa4ff('0x6c')](_0x57e67a=>_0x57e67a[_0xa4ff('0x65')]+_0xa4ff('0x6d')===_0x14058c);if(_[_0xa4ff('0x19')](_0x2e6bf8)&&_[_0xa4ff('0x19')](_0x33bcf9)){if(_0x42c662[_0xa4ff('0x6e')](_0x14058c)){if(_0x15da7d['data'][_0x1d2848][_0x42c662[_0x14058c]]){var _0x1e5964=_['trim'](_0x15da7d[_0xa4ff('0x6a')][_0x1d2848][_0x42c662[_0x14058c]][_0xa4ff('0x6f')](/"/g,'\x27'));switch(_0x14058c){case _0xa4ff('0x70'):var _0x3461c4=moment(_0x1e5964,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x3461c4['isValid']()){_0x187ddf['push']('\x22'+_0x1e5964+'\x22');}else{_0x114bcd[_0xa4ff('0x1b')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xa4ff('0x71'):var _0x144243=parseInt(_0x1e5964);_0x1e5964=_[_0xa4ff('0x72')](_0x144243)||_0x144243<0x0||_0x144243>0x4?_0x4e05fa?0x3:0x2:_0x144243;_0x187ddf[_0xa4ff('0x1b')]('\x22'+_0x1e5964+'\x22');break;case _0xa4ff('0x33'):var _0x3fd830=parseInt(_0x1e5964);if(_[_0xa4ff('0x73')](_0x3fd830)&&_[_0xa4ff('0x74')](_0x323092,_0x3fd830)){_0x187ddf['push']('\x22'+_0x3fd830+'\x22');}else{_0x114bcd['push']('agent\x20not\x20exists');}break;case _0xa4ff('0x75'):if(isEmail(_0x1e5964)){_0x187ddf[_0xa4ff('0x1b')]('\x22'+_0x1e5964+'\x22');}else{_0x114bcd[_0xa4ff('0x1b')](_0xa4ff('0x76'));}break;case _0xa4ff('0x77'):var _0x582f42=moment(_0x1e5964,_0xa4ff('0x78'),!![]);if(_0x582f42[_0xa4ff('0x79')]()){_0x187ddf['push']('\x22'+_0x1e5964+'\x22');}else{_0x114bcd[_0xa4ff('0x1b')](_0xa4ff('0x7a'));}break;default:_0x187ddf[_0xa4ff('0x1b')]('\x22'+_0x1e5964+'\x22');}}else{switch(_0x14058c){case _0xa4ff('0x7b'):case _0xa4ff('0x18'):_0x114bcd[_0xa4ff('0x1b')](_0x14058c+_0xa4ff('0x7c'));break;default:_0x187ddf[_0xa4ff('0x1b')]('\x22\x22');}}}}else{var _0x5635c='';if(!_['isNil'](_0x2e6bf8)){if(!_0x55480b[_0xa4ff('0x6e')](_0x2e6bf8['id'])){for(var _0x1c6c6d=0x0;_0x1c6c6d<_0x42c662[_0x14058c][_0xa4ff('0x17')];_0x1c6c6d++){var _0x1e5964=_['trim'](_0x15da7d[_0xa4ff('0x6a')][_0x1d2848][_0x42c662[_0x14058c][_0x1c6c6d]][_0xa4ff('0x6f')](/"/g,'\x27'));var _0x1e849d=phoneDescriptions[_0xa4ff('0x6c')](_0x4c8c11=>_0x4c8c11[_0xa4ff('0x7d')]===_0x2e6bf8['id']);if(!_['isNil'](_0x1e849d)){var _0x94f69d=_[_0xa4ff('0x7e')](_0x15da7d[_0xa4ff('0x6a')][_0x1d2848][_0x42c662[_0x1e849d[_0xa4ff('0x7f')]][0x0]][_0xa4ff('0x6f')](/"/g,'\x27'));if(!_[_0xa4ff('0x19')](_0x94f69d))_0x1e5964=_0x1e5964+'§'+_0x94f69d;}if(_0x5635c=='')_0x5635c=_0x1e5964;else _0x5635c+='|'+_0x1e5964;}_0x1b8bc3[_0xa4ff('0x1b')](_0x2e6bf8['id']+':'+_0x5635c);_0x55480b[_0x2e6bf8['id']]=0x1;}}}}if(hasAdditionalPhones){_0x187ddf[_0xa4ff('0x1b')]('\x22'+_0x1b8bc3[_0xa4ff('0x10')](';')+'\x22');}if(_0x114bcd[_0xa4ff('0x17')]){handleError(_0x15da7d[_0xa4ff('0x6a')][_0x1d2848],{'code':'SystemRow','message':_0x114bcd[_0xa4ff('0x10')]()});}else{fs[_0xa4ff('0x80')](_0x5893cc,_0x187ddf[_0xa4ff('0x10')]()+'\x0a');}_0x187ddf=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0xa4ff('0x81')+_0x443fa2,stats);stats[_0xa4ff('0x58')]=[];}}if(stopped){logger[_0xa4ff('0x54')](_0xa4ff('0x82'));_0x21b986['abort']();}}catch(_0x2ccda5){handleError(_0x15da7d[_0xa4ff('0x6a')][_0x1d2848],{'code':_0xa4ff('0x83'),'message':_0x2ccda5[_0xa4ff('0x56')]});logger[_0xa4ff('0x55')](_0xa4ff('0x84'),_0x2ccda5[_0xa4ff('0x56')]);}},'complete':function(){try{var _0x5dc1d2=[];var _0x4b9808=tempTableName;_0x5dc1d2[_0xa4ff('0x1b')](_0xa4ff('0x85')+_0x4b9808+_0xa4ff('0x86'));logger[_0xa4ff('0x54')](_0xa4ff('0x87'),contactItemTypes[_0xa4ff('0x17')]);var _0xf686be=util[_0xa4ff('0xb')]('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',_0x5893cc,_0x4b9808,_0x9b8628,_0x7ed532[_0xa4ff('0x30')],_0x7ed532[_0xa4ff('0x4e')]||null,NOW,NOW);if(_[_0xa4ff('0x19')](_0x42c662['scheduledat'])){_0xf686be+=_0xa4ff('0x88');}_0x5dc1d2[_0xa4ff('0x1b')](_0xf686be);BPromise[_0xa4ff('0x89')](_0x5dc1d2,handleQuery)['then'](function(_0x19fd42){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x5dc1d2=[];for(var _0x548676=0x0;_0x548676\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','map','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','squel','ioredis','../../../mysqldb','../../../config/logger','import','defaults','localhost','redis','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','length','isNil','AdditionalPhones','then','message','push','all','split','filter','CmContactHasItem','findOne','update','create','PHONE','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','ListId','createdAt','updatedAt','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','error','exit','errors','spread','catch','main','stringify','send','start','binding','socket_timestamp','root','.csv','body','ContactItemType','name','_description','header','writeFileSync','parse','createReadStream','data'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0x4808,0x160));var _0x8480=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x4808[_0x5608a3];return _0x1ed50a;};'use strict';var fs=require('fs');var path=require(_0x8480('0x0'));var _=require(_0x8480('0x1'));var Papa=require(_0x8480('0x2'));var util=require('util');var BPromise=require(_0x8480('0x3'));var moment=require('moment');var squel=require(_0x8480('0x4'));var Redis=require(_0x8480('0x5'));var db=require(_0x8480('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x8480('0x7'))(_0x8480('0x8'));config['redis']=_[_0x8480('0x9')](config['redis'],{'host':_0x8480('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8480('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x8480('0xc')](_0x8480('0xd'));var tempTableName=_0x8480('0xe')+moment()[_0x8480('0xc')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x27b6d6){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))*$/[_0x8480('0xf')](_0x27b6d6);}function selectNotIn(_0x232440,_0x2301e9,_0x376291,_0x124a76,_0x1bb2a5){return squel[_0x8480('0x10')]()[_0x8480('0x11')](_0x8480('0x12'))[_0x8480('0x13')](_0x124a76)[_0x8480('0x14')](_0x2301e9,null,_0x2301e9+_0x8480('0x15')+_0x124a76+'.'+_0x376291)[_0x8480('0x16')](_0x124a76+'.'+_0x376291+_0x8480('0x17')+_0x232440+'.'+_0x376291)[_0x8480('0x16')](_0x2301e9+_0x8480('0x18')+_0x1bb2a5[_0x8480('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0xa15c3c,_0x5ea74c){promisesAdditionalPhones=[];promisesContact=[];return db[_0x8480('0x19')][_0x8480('0x1a')](_0x8480('0x1b')+tempTableName)['spread'](function(_0x12ead9){if(_0x12ead9!==null){var _0x2b6f56=[];for(var _0x118b2c=0x0;_0x118b2c<_0x12ead9[_0x8480('0x1c')];_0x118b2c++){var _0x34c687=_0x12ead9[_0x118b2c];if(!_[_0x8480('0x1d')](_0x34c687[_0x8480('0x12')])){if(!_['isNil'](_0x34c687[_0x8480('0x1e')]))_0x2b6f56['push'](insertAdditionalPhones(_0x34c687));promisesContact['push']({'contact':_0x34c687});}}}Promise['all'](_0x2b6f56)[_0x8480('0x1f')](function(){_0xa15c3c({'val':0x1});});})['catch'](function(_0x3e3827){logger['error'](_0x3e3827[_0x8480('0x20')]);});});}function insertAdditionalPhones(_0x4445d8){return new Promise(function(_0x1e2b60,_0x4cfed1){var _0x3165e7=_0x4445d8[_0x8480('0x1e')];if(_[_0x8480('0x1d')](_0x3165e7))_0x4cfed1({'val':0x0});else{var _0xa0fb7e=_0x3165e7['split'](';');var _0x5480c3=[];orderBy=0x0;for(var _0x37f38f=0x0;_0x37f38f<_0xa0fb7e[_0x8480('0x1c')];_0x37f38f++){_0x5480c3[_0x8480('0x21')](splitAdditionalPhone(_0x4445d8['id'],_0xa0fb7e[_0x37f38f]));}Promise[_0x8480('0x22')](_0x5480c3)['then'](function(){_0x1e2b60({'val':_0xa0fb7e[_0x8480('0x1c')]});});}});}function splitAdditionalPhone(_0x51c2d2,_0x560ea2){return new Promise(function(_0x38c7fa,_0x46e353){var _0x3413a6=_0x560ea2['split'](':');var _0x25b1a3=_0x3413a6[0x0];var _0x4ca36e=_0x3413a6[0x1];if(_0x4ca36e!==''){var _0x19f056=_0x4ca36e[_0x8480('0x23')]('|');var _0x5e64eb=[];for(var _0x18edd5=0x0;_0x18edd5<_0x19f056[_0x8480('0x1c')];_0x18edd5++){if(_0x19f056[_0x18edd5]!==''){var _0x3feecd=_[_0x8480('0x24')](promisesAdditionalPhones,{'contactId':_0x51c2d2,'phone':_0x19f056[_0x18edd5]});if(_0x3feecd[_0x8480('0x1c')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x51c2d2,'contactTypeId':_0x25b1a3,'phone':_0x19f056[_0x18edd5],'orderBy':orderBy});}}}_0x38c7fa({'ok':0x1});}else _0x38c7fa({'res':0x0});});}function createAdditionalPhone(_0x350df6,_0x3c0241,_0x53663c,_0x845033){var _0x24f7b4='';var _0x203981='';var _0x319ff1=_0x53663c['split']('§');_0x24f7b4=_0x319ff1[0x0];if(_0x319ff1['length']==0x2)_0x203981=_0x319ff1[0x1];return new Promise(function(_0x4eff81,_0x5a1d25){return db[_0x8480('0x25')][_0x8480('0x26')]({'where':{'CmContactId':_0x350df6,'item':_0x24f7b4}})[_0x8480('0x1f')](function(_0x2286b7){if(_0x2286b7){return db['CmContactHasItem'][_0x8480('0x27')]({'ItemTypeId':_0x3c0241,'description':_0x203981,'OrderBy':_0x845033},{'where':{'CmContactId':_0x350df6,'item':_0x24f7b4}})['then'](function(_0xea820e){_0x4eff81({'res':'updated'});});}else{return db[_0x8480('0x25')][_0x8480('0x28')]({'CmContactId':_0x350df6,'item':_0x24f7b4,'ItemTypeId':_0x3c0241,'description':_0x203981,'OrderBy':_0x845033,'ItemClass':_0x8480('0x29')})[_0x8480('0x1f')](function(_0x4495b1){_0x4eff81({'res':_0x8480('0x2a')});});}});});}function updateContact(_0x2a4218){return new Promise(function(_0x3f938c,_0x3a875a){var _0xaf0e75=_0x2a4218['id'];delete _0x2a4218['id'];return db[_0x8480('0x2b')][_0x8480('0x27')](_0x2a4218,{'where':{'id':_0xaf0e75}})[_0x8480('0x1f')](function(_0x270972){updatedRows+=0x1;return db[_0x8480('0x2c')][_0x8480('0x27')]({'phone':_0x2a4218[_0x8480('0x12')]},{'where':{'ContactId':_0xaf0e75}})[_0x8480('0x1f')](function(_0x3bceb){_0x3f938c({'ret':'OK'});});});});}function insertCmHopper(_0x346662,_0xb00b86,_0x50d045,_0x13a699,_0xb6284f){var _0x16e471=[_0x8480('0x2d'),_0x8480('0x2e'),_0x8480('0x2f'),_0x8480('0x30'),_0xb00b86+'.'+_0x13a699,_0x8480('0x31'),_0x8480('0x32'),_0x8480('0x33'),_0x8480('0x34'),'\x22'+_0xb6284f+'\x22'];return squel[_0x8480('0x35')]()[_0x8480('0x36')](_0x8480('0x37'))[_0x8480('0x38')](['phone','scheduledat',_0x8480('0x39'),'ListId',_0x13a699,'createdAt','updatedAt',_0x8480('0x3a'),_0x8480('0x3b'),'recallme'],squel['select']()[_0x8480('0x3c')](_0x16e471)[_0x8480('0x13')](_0xb00b86)[_0x8480('0x14')](_0x8480('0x3d'),null,_0x8480('0x3e')+_0xb00b86+_0x8480('0x3f'))['join'](_0x50d045,null,_0x50d045+_0x8480('0x15')+_0xb00b86+'.'+_0x13a699)[_0x8480('0x16')](_0xb00b86+_0x8480('0x40'),_0x346662)[_0x8480('0x16')](_0x8480('0x41'),NOW)[_0x8480('0x16')](_0x8480('0x42'),selectNotIn(_0xb00b86,_0x50d045,_0x13a699,_0x8480('0x37'),[_0x8480('0x43'),_0x8480('0x44')]))['where'](_0x8480('0x42'),selectNotIn(_0xb00b86,_0x50d045,_0x13a699,'cm_hopper',['\x22always\x22'])))[_0x8480('0x45')]();}function insertCmHopperBlack(_0x525165,_0x2c27d9,_0x2f4fdb,_0x3780b6){var _0x57b6d0=[_0x8480('0x2d'),_0x8480('0x2f'),_0x8480('0x30'),_0x2c27d9+'.'+_0x3780b6,'cm_contacts.createdAt',_0x8480('0x32')];return squel['insert']()[_0x8480('0x36')](_0x8480('0x46'))[_0x8480('0x38')](['phone','ContactId',_0x8480('0x47'),_0x3780b6,_0x8480('0x48'),_0x8480('0x49')],squel[_0x8480('0x10')]()['fields'](_0x57b6d0)[_0x8480('0x13')](_0x2c27d9)[_0x8480('0x14')]('cm_contacts',null,_0x8480('0x3e')+_0x2c27d9+_0x8480('0x3f'))['join'](_0x2f4fdb,null,_0x2f4fdb+_0x8480('0x15')+_0x2c27d9+'.'+_0x3780b6)['where'](_0x2c27d9+_0x8480('0x40'),_0x525165)['where'](_0x8480('0x41'),NOW)[_0x8480('0x16')](_0x8480('0x42'),squel[_0x8480('0x10')]()[_0x8480('0x11')]('phone')['from']('cm_hopper_black')[_0x8480('0x16')](_0x8480('0x4a'),_0x525165)[_0x8480('0x16')](_0x3780b6+_0x8480('0x4b'),_0x2c27d9+'.'+_0x3780b6)))['toString']();}function insertCmHopperAdditionalPhones(_0x300710){var _0x4a30a4=[_0x8480('0x4c'),_0x8480('0x4d'),'cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt',_0x8480('0x4e')];return squel['insert']()[_0x8480('0x36')](_0x8480('0x4f'))[_0x8480('0x38')]([_0x8480('0x50'),_0x8480('0x12'),_0x8480('0x51'),_0x8480('0x48'),_0x8480('0x49')],squel[_0x8480('0x10')]()[_0x8480('0x3c')](_0x4a30a4)[_0x8480('0x13')](_0x8480('0x37'))[_0x8480('0x14')](_0x8480('0x3d'),null,_0x8480('0x52'))['join'](_0x8480('0x53'),null,_0x8480('0x54'))[_0x8480('0x16')]('cm_hopper.ListId\x20=\x20?',_0x300710)['where'](_0x8480('0x41'),NOW))[_0x8480('0x45')]();}function insertCmContact(_0x6b1e12,_0x32d873,_0x23cad8,_0x3dcfbb){var _0x51ebdd=_[_0x8480('0x55')](_[_0x8480('0x56')](_0x3dcfbb),['ListId',_0x8480('0x57'),_0x8480('0x48'),_0x8480('0x49')]);return squel[_0x8480('0x35')]()['into'](_0x8480('0x3d'))[_0x8480('0x38')](_0x51ebdd,squel[_0x8480('0x10')]()[_0x8480('0x3c')](_0x51ebdd)[_0x8480('0x13')](_0x32d873)[_0x8480('0x16')]('('+_0x23cad8[_0x8480('0x14')](',')+_0x8480('0x58'),squel[_0x8480('0x10')]()[_0x8480('0x3c')](_0x23cad8)['from'](_0x8480('0x3d'))[_0x8480('0x16')](_0x8480('0x4a'),_0x6b1e12))['where'](_0x8480('0x59'),squel['select']()[_0x8480('0x11')](_0x8480('0x5a'),_0x8480('0x5b'))[_0x8480('0x13')](_0x32d873)[_0x8480('0x5c')](_0x23cad8[_0x8480('0x14')](','))))['toString']();}function handleStop(){logger[_0x8480('0x5d')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x45416e){logger[_0x8480('0x5e')](_0x45416e[_0x8480('0x20')]);process[_0x8480('0x5f')](0x1);}function handleError(_0x200f5c,_0x46fe85){stats[_0x8480('0x60')]['push']({'name':_0x46fe85['code'],'message':_0x46fe85['message'],'row':_0x200f5c});}function handleQuery(_0x4f84bb){logger[_0x8480('0x5d')](_0x4f84bb);return db['sequelize']['query'](_0x4f84bb)[_0x8480('0x61')](function(_0x3aa59a){results[_0x8480('0x21')](_0x3aa59a);})[_0x8480('0x62')](function(_0x5a29d4){logger[_0x8480('0x5e')](_0x5a29d4[_0x8480('0x20')]);});}function main(_0x338ffb,_0x343e92,_0x5c49f5,_0x2d74e8){logger[_0x8480('0x5d')](_0x8480('0x63'),_0x338ffb,JSON[_0x8480('0x64')](_0x343e92));process[_0x8480('0x65')](_0x8480('0x66'));var _0x387380=_0x343e92[_0x8480('0x67')];var _0x24ff04=_['clone'](_0x387380);var _0x21501e=_0x343e92[_0x8480('0x68')];var _0x5e0f8a=path[_0x8480('0x14')](config[_0x8480('0x69')],'server/files/tmp',_0x21501e+_0x8480('0x6a'));logger[_0x8480('0x5d')](_0x8480('0x6b'),_0x343e92);db[_0x8480('0x6c')]['findAll']({'raw':!![],'attributes':['id',_0x8480('0x6d')]})[_0x8480('0x1f')](function(_0x26eddb){for(var _0x4dec88=0x0;_0x4dec88<_0x26eddb[_0x8480('0x1c')];_0x4dec88++){if(_0x26eddb[_0x4dec88][_0x8480('0x6d')]in _0x387380){contactItemTypes[_0x8480('0x21')](_0x26eddb[_0x4dec88]);delete _0x24ff04[_0x26eddb[_0x4dec88][_0x8480('0x6d')]];hasAdditionalPhones=!![];}for(var _0x8796c3 in _0x387380){if(_0x26eddb[_0x4dec88][_0x8480('0x6d')]+_0x8480('0x6e')===_0x8796c3){phoneDescriptions[_0x8480('0x21')]({'itemTypeId':_0x26eddb[_0x4dec88]['id'],'description':_0x8796c3});delete _0x24ff04[_0x8796c3];}}}if(hasAdditionalPhones)_0x24ff04['AdditionalPhones']='';var _0x132a6e=_[_0x8480('0x56')](_0x24ff04)[_0x8480('0x14')]();logger[_0x8480('0x5d')](_0x8480('0x6f'),_0x132a6e);fs[_0x8480('0x70')](_0x5e0f8a,_0x132a6e+'\x0a');Papa[_0x8480('0x71')](fs[_0x8480('0x72')](_0x338ffb),{'header':!![],'skipEmptyLines':!![],'step':function(_0x37d67a,_0x1af43c){try{for(var _0x137d7e=0x0,_0x172f6a=[];_0x137d7e<_0x37d67a['data'][_0x8480('0x1c')];_0x137d7e++){stats['rows']+=0x1;if(_0x37d67a[_0x8480('0x60')][_0x137d7e]){handleError(_0x37d67a[_0x8480('0x73')][_0x137d7e],_0x37d67a[_0x8480('0x60')][_0x137d7e]);}else{var _0x42ceaf=[];var _0x1295c9=[];var _0x51481c={};for(var _0x592b6f in _0x387380){let _0x130ef1=contactItemTypes[_0x8480('0x74')](_0xf88f2a=>_0xf88f2a[_0x8480('0x6d')]===_0x592b6f);let _0x59a458=contactItemTypes['find'](_0x3bb0e3=>_0x3bb0e3[_0x8480('0x6d')]+_0x8480('0x6e')===_0x592b6f);if(_['isNil'](_0x130ef1)&&_[_0x8480('0x1d')](_0x59a458)){if(_0x387380[_0x8480('0x75')](_0x592b6f)){if(_0x37d67a[_0x8480('0x73')][_0x137d7e][_0x387380[_0x592b6f]]){var _0x3eb307=_[_0x8480('0x76')](_0x37d67a['data'][_0x137d7e][_0x387380[_0x592b6f]]['replace'](/"/g,'\x27'));switch(_0x592b6f){case _0x8480('0x77'):var _0x3daf8b=moment(_0x3eb307,_0x8480('0xd'),!![]);if(_0x3daf8b['isValid']()){_0x172f6a['push']('\x22'+_0x3eb307+'\x22');}else{_0x42ceaf['push'](_0x8480('0x78'));}break;case _0x8480('0x3a'):var _0x126b68=parseInt(_0x3eb307);_0x3eb307=_[_0x8480('0x79')](_0x126b68)||_0x126b68<0x0||_0x126b68>0x4?_0x2d74e8?0x3:0x2:_0x126b68;_0x172f6a[_0x8480('0x21')]('\x22'+_0x3eb307+'\x22');break;case'UserId':var _0x2239ba=parseInt(_0x3eb307);if(_['isNumber'](_0x2239ba)&&_['includes'](_0x5c49f5,_0x2239ba)){_0x172f6a[_0x8480('0x21')]('\x22'+_0x2239ba+'\x22');}else{_0x42ceaf['push'](_0x8480('0x7a'));}break;case _0x8480('0x7b'):if(isEmail(_0x3eb307)){_0x172f6a[_0x8480('0x21')]('\x22'+_0x3eb307+'\x22');}else{_0x42ceaf[_0x8480('0x21')](_0x8480('0x7c'));}break;case _0x8480('0x7d'):var _0x4c9f46=moment(_0x3eb307,'YYYY-MM-DD',!![]);if(_0x4c9f46[_0x8480('0x7e')]()){_0x172f6a['push']('\x22'+_0x3eb307+'\x22');}else{_0x42ceaf[_0x8480('0x21')](_0x8480('0x7f'));}break;default:_0x172f6a[_0x8480('0x21')]('\x22'+_0x3eb307+'\x22');}}else{switch(_0x592b6f){case'firstName':case _0x8480('0x12'):_0x42ceaf['push'](_0x592b6f+_0x8480('0x80'));break;default:_0x172f6a[_0x8480('0x21')]('\x22\x22');}}}}else{var _0x16f28d='';if(!_['isNil'](_0x130ef1)){if(!_0x51481c['hasOwnProperty'](_0x130ef1['id'])){for(var _0x505ef6=0x0;_0x505ef6<_0x387380[_0x592b6f][_0x8480('0x1c')];_0x505ef6++){var _0x3eb307=_[_0x8480('0x76')](_0x37d67a['data'][_0x137d7e][_0x387380[_0x592b6f][_0x505ef6]][_0x8480('0x81')](/"/g,'\x27'));var _0x59c62c=phoneDescriptions[_0x8480('0x74')](_0x2a1e24=>_0x2a1e24[_0x8480('0x82')]===_0x130ef1['id']);if(!_['isNil'](_0x59c62c)){var _0x1523a6=_[_0x8480('0x76')](_0x37d67a[_0x8480('0x73')][_0x137d7e][_0x387380[_0x59c62c['description']][0x0]][_0x8480('0x81')](/"/g,'\x27'));if(!_['isNil'](_0x1523a6))_0x3eb307=_0x3eb307+'§'+_0x1523a6;}if(_0x16f28d=='')_0x16f28d=_0x3eb307;else _0x16f28d+='|'+_0x3eb307;}_0x1295c9[_0x8480('0x21')](_0x130ef1['id']+':'+_0x16f28d);_0x51481c[_0x130ef1['id']]=0x1;}}}}if(hasAdditionalPhones){_0x172f6a[_0x8480('0x21')]('\x22'+_0x1295c9[_0x8480('0x14')](';')+'\x22');}if(_0x42ceaf[_0x8480('0x1c')]){handleError(_0x37d67a[_0x8480('0x73')][_0x137d7e],{'code':_0x8480('0x83'),'message':_0x42ceaf['join']()});}else{fs[_0x8480('0x84')](_0x5e0f8a,_0x172f6a[_0x8480('0x14')]()+'\x0a');}_0x172f6a=[];}if(!(stats[_0x8480('0x85')]%0xc8)){socket[_0x8480('0x86')](_0x8480('0x87')+_0x21501e,stats);stats[_0x8480('0x60')]=[];}}if(stopped){logger[_0x8480('0x5d')](_0x8480('0x88'));_0x1af43c[_0x8480('0x89')]();}}catch(_0x298032){handleError(_0x37d67a[_0x8480('0x73')][_0x137d7e],{'code':_0x8480('0x8a'),'message':_0x298032[_0x8480('0x20')]});logger['error']('step',_0x298032[_0x8480('0x20')]);}},'complete':function(){try{var _0x187e20=[];var _0x25d90d=tempTableName;_0x187e20[_0x8480('0x21')](_0x8480('0x8b')+_0x25d90d+_0x8480('0x8c'));logger[_0x8480('0x5d')]('CIS\x20len',contactItemTypes[_0x8480('0x1c')]);var _0x16bbfe=util[_0x8480('0xc')](_0x8480('0x8d'),_0x5e0f8a,_0x25d90d,_0x132a6e,_0x343e92[_0x8480('0x47')],_0x343e92[_0x8480('0x57')]||null,NOW,NOW);if(_[_0x8480('0x1d')](_0x387380['scheduledat'])){_0x16bbfe+=',\x20scheduledAt\x20=\x20NOW()';}_0x187e20[_0x8480('0x21')](_0x16bbfe);BPromise[_0x8480('0x8e')](_0x187e20,handleQuery)[_0x8480('0x1f')](function(_0xff0ea4){BPromise[_0x8480('0x22')]([handleAdditionalPhones()])['then'](function(){_0x187e20=[];for(var _0x241e03=0x0;_0x241e03\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.to','i.ContactId','i.MailAccountId','i.UserId','openchannel','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.lastName','c.email'];(function(_0xa76cbe,_0x53b6b6){var _0x4e47a8=function(_0x452d75){while(--_0x452d75){_0xa76cbe['push'](_0xa76cbe['shift']());}};_0x4e47a8(++_0x53b6b6);}(_0x99e9,0xb4));var _0x999e=function(_0x52a7e1,_0x189bf3){_0x52a7e1=_0x52a7e1-0x0;var _0x4f4495=_0x99e9[_0x52a7e1];return _0x4f4495;};'use strict';var _=require('lodash');var squel=require(_0x999e('0x0'));var as=require(_0x999e('0x1'));var qs=require(_0x999e('0x2'));var updateInteraction=require(_0x999e('0x3'))['updateInteraction'];var utils=require(_0x999e('0x4'));var db=require(_0x999e('0x5'))['db'];function skipInteractionsQuery(_0x3aac27,_0x4e2112,_0x296411){var _0x502307=![];var _0x25421f=utils[_0x999e('0x6')](_0x3aac27);if(_0x4e2112[_0x999e('0x7')]===_0x999e('0x8')&&!_0x296411['search']&&!_0x296411[_0x25421f]){_0x502307=!![];}return _0x502307;}function getTagsQuery(){return squel[_0x999e('0x9')]()[_0x999e('0xa')]('id')[_0x999e('0xa')](_0x999e('0xb'))[_0x999e('0xa')](_0x999e('0xc'))[_0x999e('0xd')](_0x999e('0xe'));}function getUsersQuery(_0x3cb1c2,_0xf40130){var _0x9368cf=utils[_0x999e('0xf')](_0x3cb1c2);var _0x4246b1=_0x999e('0x10')+_0x3cb1c2+_0x999e('0x11');var _0xdb587b=squel[_0x999e('0x9')]()['field'](_0x999e('0x12'))['field'](_0x999e('0x13'))[_0x999e('0xa')](_0x999e('0x14')+_0x9368cf)['from'](_0x4246b1,'ui')[_0x999e('0x15')]('users','u',_0x999e('0x16'));if(_0xf40130['length']>0x0){_0xdb587b['where'](_0x999e('0x14')+_0x9368cf+_0x999e('0x17'),_[_0x999e('0x18')](_0xf40130,'id'));}return _0xdb587b;}function getInteractionsQuery(_0x289e0e){var _0x1e9bff=utils[_0x999e('0x19')](_0x289e0e);var _0x4aac66=utils['getAccountFK'](_0x289e0e);var _0x4fcdfb=utils[_0x999e('0xf')](_0x289e0e);return squel[_0x999e('0x9')]()[_0x999e('0xd')](_0x1e9bff[_0x999e('0x1a')],'i')[_0x999e('0x15')](_0x999e('0x1b'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x999e('0x1c'),'o',_0x999e('0x1d'))[_0x999e('0x15')](_0x1e9bff['accounts'],'a',_0x999e('0x1e')+_0x4aac66)[_0x999e('0x15')](_0x1e9bff[_0x999e('0x1f')],'me',_0x999e('0x20')+_0x4fcdfb+_0x999e('0x21'))[_0x999e('0x15')](_0x1e9bff[_0x999e('0x22')],'it','it.'+_0x4fcdfb+'\x20=\x20i.id')[_0x999e('0x15')](_0x999e('0xe'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x452acd={'body':squel[_0x999e('0x23')](),'contact':squel[_0x999e('0x23')](),'default':squel[_0x999e('0x23')](),'fields':squel[_0x999e('0x23')](),'filter':squel[_0x999e('0x23')](),'read':squel['expr'](),'tags':{'clause':squel[_0x999e('0x23')](),'ids':null},'user':squel[_0x999e('0x23')]()};return _0x452acd;}function parseTagParameter(_0x11068e){var _0x12b9ad=squel[_0x999e('0x23')]();if(_0x11068e){var _0x1d2dc6=utils[_0x999e('0x24')](_0x11068e);_0x1d2dc6['forEach'](function(_0x28f803){_0x12b9ad['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x28f803+',%');});}return _0x12b9ad;}function parseReadParameter(_0x4fed13){var _0x3dff6b='';if(_0x4fed13){_0x3dff6b=_0x999e('0x25');if(_0x4fed13==='1'){_0x3dff6b=_0x3dff6b[_0x999e('0x26')]('{OPERATOR}','=');}else{_0x3dff6b=_0x3dff6b[_0x999e('0x26')](_0x999e('0x27'),'>');}}return _0x3dff6b;}function parseSearchFilter(_0x22cd81,_0x4339bf){var _0x15dca1=squel[_0x999e('0x23')]();if(_0x4339bf){var _0x82e067=_0x4339bf[_0x999e('0x26')]('\x5c','\x5c\x5c')[_0x999e('0x26')](/'/g,'\x27\x27');if(qs[_0x999e('0x28')](_0x82e067)){_0x15dca1['or']('i.id\x20LIKE\x20?',_0x82e067+'%');if([_0x999e('0x29'),_0x999e('0x2a')][_0x999e('0x2b')](_0x22cd81)){_0x15dca1['or']('i.phone\x20LIKE\x20?',_0x82e067+'%');}else if(_0x22cd81===_0x999e('0x2c')){_0x15dca1['or']('i.fax\x20LIKE\x20?',_0x82e067+'%');}else if(_0x22cd81==='openchannel'){_0x15dca1['or'](_0x999e('0x2d'),_0x82e067+'%');}}else if(_0x22cd81===_0x999e('0x2e')&&qs['isEmail'](_0x82e067)){_0x15dca1['or']('c.email\x20LIKE\x20?',_0x82e067+'%');}else{if(_0x22cd81===_0x999e('0x2e')){_0x15dca1['or'](_0x999e('0x2f'),qs[_0x999e('0x30')](_0x82e067))['or'](_0x999e('0x31'),qs['getFullTextValue'](_0x82e067));}else{if(_0x22cd81!==_0x999e('0x2c')){_0x15dca1['or'](_0x999e('0x32'),qs[_0x999e('0x30')](_0x82e067));}_0x15dca1['or'](_0x999e('0x33'),_0x82e067+'%');}}}return _0x15dca1;}function parseAdvancedSearchFilter(_0x4f861f,_0x4ebcb7){var _0x44fb32=getSqlClauses();var _0x490694=as[_0x999e('0x34')](_0x4f861f);var _0x2fda68=_0x490694[_0x999e('0x35')];for(var _0x14c9e0=0x0;_0x14c9e0<_0x490694['conditions'][_0x999e('0x36')];_0x14c9e0++){var _0x28df26=_0x490694['conditions'][_0x14c9e0];var _0x4808d1='i';var _0x327866=_['find'](_0x4ebcb7,[_0x999e('0xb'),_0x28df26['field']]);if(_0x327866){var _0x518083=as['buildExpression'](_0x4808d1,_0x327866['type'],_0x28df26);_0x44fb32[_0x999e('0x37')][_0x2fda68](_0x518083['text'],_0x518083[_0x999e('0x38')]['start'],_0x518083['value']['end']);}else{switch(_0x28df26[_0x999e('0xa')]){case _0x999e('0x39'):var _0xd529df=parseReadParameter(_0x28df26[_0x999e('0x38')]);_0x44fb32[_0x999e('0x3a')][_0x999e('0x3b')](_0xd529df);break;case _0x999e('0x3c'):if(_0x28df26[_0x999e('0x3d')]==='$substring'){if(_0x28df26[_0x999e('0x38')][_0x999e('0x3e')]('\x20')[_0x999e('0x36')]>0x1){_0x44fb32[_0x999e('0x3f')][_0x2fda68]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x999e('0x30')](_0x28df26['value']),null);}else{var _0x36194c='%'+_0x28df26[_0x999e('0x38')]+'%';_0x44fb32[_0x999e('0x3f')][_0x2fda68](_0x999e('0x40'),_0x36194c,_0x36194c,_0x36194c);}}else{_0x327866=_['find'](_0x4ebcb7,[_0x999e('0xb'),_0x999e('0x41')]);_0x28df26[_0x999e('0xa')]='ContactId';_0x518083=as['buildExpression'](_0x4808d1,_0x327866[_0x999e('0x42')],_0x28df26);_0x44fb32[_0x999e('0x3f')][_0x2fda68](_0x518083[_0x999e('0x43')],_0x518083[_0x999e('0x38')][_0x999e('0x44')],_0x518083[_0x999e('0x38')][_0x999e('0x45')]);}break;case _0x999e('0x46'):var _0x2576da=_0x28df26[_0x999e('0x38')]['split'](',')['map'](function(_0xa5742d){return Number(_0xa5742d);});var _0x30a60d=parseTagParameter(_0x2576da);_0x44fb32[_0x999e('0x47')][_0x999e('0x48')][_0x999e('0x3b')](_0x30a60d);_0x44fb32[_0x999e('0x47')]['ids']=_0x2576da;break;case _0x999e('0x49'):if(_0x28df26['operator']==='$substring'){_0x44fb32[_0x999e('0x4a')][_0x2fda68]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x28df26['value']+'%',null);}else{_0x327866=_['find'](_0x4ebcb7,['name',_0x999e('0x4b')]);_0x28df26[_0x999e('0xa')]='UserId';_0x518083=as[_0x999e('0x4c')](_0x4808d1,_0x327866[_0x999e('0x42')],_0x28df26);_0x44fb32[_0x999e('0x4a')][_0x2fda68](_0x518083['text'],_0x518083['value'][_0x999e('0x44')],_0x518083[_0x999e('0x38')][_0x999e('0x45')]);}break;case'body':case'plainBody':_0x518083=as['buildExpression']('me',null,_0x28df26);_0x44fb32['body'][_0x2fda68](_0x518083[_0x999e('0x43')],_0x518083['value']['start'],_0x518083[_0x999e('0x38')][_0x999e('0x45')]);break;}}}return _0x44fb32;}function parseModelFields(_0x5843f1,_0xa50dc6,_0x1a5c3d){var _0x5603a8=utils[_0x999e('0x6')](_0x5843f1);var _0x58be33=squel[_0x999e('0x23')]();var _0x42dfea=_(_0xa50dc6)['keys']()[_0x999e('0x18')](function(_0xdc94ea){return _['some'](_0x1a5c3d,['name',_0xdc94ea])?_0xdc94ea:undefined;})[_0x999e('0x4d')]()['value']();if(_0x42dfea['length']>0x0){_0x42dfea['forEach'](function(_0x1f85dd){if(_0x1f85dd===_0x5603a8){_0x58be33[_0x999e('0x3b')]('i.'+_0x5603a8+_0x999e('0x17'),[][_0x999e('0x4e')](_0xa50dc6[_0x1f85dd]));}else if(_0x1f85dd===_0x999e('0x4f')){var _0x14c01c=JSON['parse'](_0xa50dc6[_0x1f85dd])[_0x999e('0x50')];var _0x2317c5=JSON['parse'](_0xa50dc6[_0x1f85dd])[_0x999e('0x51')];_0x58be33[_0x999e('0x3b')](_0x999e('0x52'),_0x14c01c,_0x2317c5);}else{if(_0xa50dc6[_0x1f85dd]===_0x999e('0x53')){_0x58be33[_0x999e('0x3b')]('i.'+_0x1f85dd+_0x999e('0x54'));}else{_0x58be33[_0x999e('0x3b')]('i.'+_0x1f85dd+_0x999e('0x55'),_0xa50dc6[_0x1f85dd]);}}});}return _0x58be33;}function parseQueryParameters(_0x290c7a,_0x53932a,_0x9f3f7a){var _0x45b61a=getSqlClauses();return Promise[_0x999e('0x56')]()[_0x999e('0x57')](function(){return parseModelFields(_0x290c7a,_0x53932a,_0x9f3f7a);})['then'](function(_0x392324){_0x45b61a[_0x999e('0x58')][_0x999e('0x3b')](_0x392324);return parseReadParameter(_0x53932a[_0x999e('0x3a')]);})[_0x999e('0x57')](function(_0xdb368f){_0x45b61a[_0x999e('0x3a')][_0x999e('0x3b')](_0xdb368f);return parseTagParameter(_0x53932a['tag']);})['then'](function(_0xd118f9){_0x45b61a[_0x999e('0x47')][_0x999e('0x48')][_0x999e('0x3b')](_0xd118f9);return parseSearchFilter(_0x290c7a,_0x53932a[_0x999e('0x59')]);})[_0x999e('0x57')](function(_0x23c5fb){_0x45b61a['filter']=_0x23c5fb;return _0x45b61a;});}function checkAccountsRestrictions(_0x5579c4,_0xb9d60b,_0x55ae5){var _0x36c3dc=utils[_0x999e('0x6')](_0x5579c4);var _0x25176f='get'+_[_0x999e('0x5a')](_0x5579c4)+(_0x5579c4===_0x999e('0x5b')?_0x999e('0x5c'):_0x999e('0x5d'));var _0x502c9=squel[_0x999e('0x23')]();return Promise[_0x999e('0x56')]()['then'](function(){if(_0x55ae5[_0x999e('0x5e')]&&_0xb9d60b['role']===_0x999e('0x8')){return _0xb9d60b[_0x25176f]({'attributes':['id'],'raw':!![]});}})[_0x999e('0x57')](function(_0x2ce0b3){if(_0x2ce0b3){if(_0x2ce0b3[_0x999e('0x36')]===0x0){_0x502c9[_0x999e('0x3b')]('i.'+_0x36c3dc+_0x999e('0x54'));}else{_0x502c9['and']('i.'+_0x36c3dc+_0x999e('0x17'),_[_0x999e('0x18')](_0x2ce0b3,'id'));}}else if(!_0x55ae5[_0x36c3dc]){_0x502c9[_0x999e('0x3b')]('i.'+_0x36c3dc+_0x999e('0x5f'));}})[_0x999e('0x57')](function(){return _0x502c9;});}function getClosedOrderClause(_0x121110,_0x23fd58){var _0x3d398c='';var _0x455b0e=[_0x999e('0x60'),_0x999e('0x61'),_0x999e('0x62')];if(_0x121110===_0x999e('0x2e')){_0x455b0e[_0x999e('0x63')](_0x999e('0x64'));}if(_0x23fd58['closed']==='0'&&_0x121110===_0x999e('0x2e')){_0x3d398c=_0x999e('0x64');}else{if(_0x23fd58[_0x999e('0x65')]==='1'){_0x455b0e[_0x999e('0x66')]();}_0x3d398c='CONCAT_WS(\x27\x27,\x20'+_0x455b0e['join'](',\x20')+')';}return _0x3d398c;}function getFilteredInteractions(_0x21c8be,_0x2d398f,_0x67267d,_0x33abdc){var _0x1c9b64=utils[_0x999e('0xf')](_0x21c8be);var _0x1596bb=_[_0x999e('0x5a')](_0x21c8be)+_0x999e('0x67');var _0x5d4f50=[];var _0xe137c1=getTagsQuery();var _0x47c693={'type':db[_0x999e('0x68')][_0x999e('0x69')]['SELECT'],'raw':!![]};var _0x61ba8=[];var _0x175904=[];return db[_0x999e('0x6a')][_0x999e('0x6b')](_0xe137c1[_0x999e('0x6c')](),_0x47c693)['then'](function(_0x1807b7){_0x5d4f50=_[_0x999e('0x6d')](_0x1807b7,'id');_0x47c693=_['merge'](_0x47c693,{'model':db[_0x1596bb],'mapToModel':!![],'nest':!![]});if(_0x67267d['fields']){_0x33abdc['attributes'][_0x999e('0x6e')](function(_0x3f37e8){_0x2d398f[_0x999e('0xa')]('i.'+_0x3f37e8);});}else{_0x2d398f[_0x999e('0xa')](_0x999e('0x6f'),'unreadMessages');_0x2d398f['field']('a.key',_0x999e('0x70'));_0x2d398f['field']('a.mandatoryDisposition',_0x999e('0x71'));if(_0x21c8be==='mail'){_0x2d398f[_0x999e('0xa')](_0x999e('0x72'),_0x999e('0x73'));_0x2d398f['field'](_0x999e('0x74'),_0x999e('0x75'));_0x2d398f[_0x999e('0xa')](_0x999e('0x76'));_0x2d398f[_0x999e('0xa')](_0x999e('0x77'));_0x2d398f[_0x999e('0xa')]('i.updatedAt');_0x2d398f[_0x999e('0xa')](_0x999e('0x78'));_0x2d398f[_0x999e('0xa')]('i.closedAt');_0x2d398f[_0x999e('0xa')](_0x999e('0x79'));_0x2d398f['field'](_0x999e('0x7a'));_0x2d398f[_0x999e('0xa')](_0x999e('0x7b'));_0x2d398f[_0x999e('0xa')](_0x999e('0x7c'));_0x2d398f[_0x999e('0xa')](_0x999e('0x62'));_0x2d398f[_0x999e('0xa')](_0x999e('0x61'));_0x2d398f['field'](_0x999e('0x60'));_0x2d398f[_0x999e('0xa')](_0x999e('0x64'));_0x2d398f['field'](_0x999e('0x7d'));_0x2d398f['field'](_0x999e('0x7e'));_0x2d398f[_0x999e('0xa')](_0x999e('0x7f'));_0x2d398f['field'](_0x999e('0x80'));}else if(_0x21c8be===_0x999e('0x81')){_0x2d398f[_0x999e('0xa')](_0x999e('0x82'),_0x999e('0x75'));}else{_0x2d398f[_0x999e('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',_0x999e('0x75'));}if(_0x21c8be!=='mail'){_0x2d398f[_0x999e('0xa')]('i.*');}_0x2d398f['field'](_0x999e('0x83'),'Contact.firstName');_0x2d398f[_0x999e('0xa')](_0x999e('0x84'),'Contact.lastName');_0x2d398f[_0x999e('0xa')](_0x999e('0x85'),'Contact.email');_0x2d398f[_0x999e('0xa')](_0x999e('0x86'),_0x999e('0x87'));_0x2d398f[_0x999e('0xa')](_0x999e('0x88'),_0x999e('0x89'));_0x2d398f[_0x999e('0xa')](_0x999e('0x8a'),'Contact.fax');_0x2d398f['field'](_0x999e('0x8b'),_0x999e('0x8c'));_0x2d398f[_0x999e('0xa')](_0x999e('0x8d'),_0x999e('0x8e'));_0x2d398f[_0x999e('0xa')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x999e('0x8f'));}if(_0x33abdc[_0x999e('0x90')]){_0x2d398f['limit'](_0x33abdc[_0x999e('0x90')]);}if(_0x33abdc[_0x999e('0x91')]){_0x2d398f[_0x999e('0x91')](_0x33abdc['offset']);}return db[_0x999e('0x6a')][_0x999e('0x6b')](_0x2d398f[_0x999e('0x6c')](),_0x47c693);})['then'](function(_0x216040){_0x61ba8=_0x216040;var _0x372316=getUsersQuery(_0x21c8be,_0x61ba8);return db[_0x999e('0x6a')]['query'](_0x372316['toString'](),_0x47c693);})[_0x999e('0x57')](function(_0x47e5ce){_0x175904=_[_0x999e('0x92')](_0x47e5ce,_0x1c9b64);if(_0x21c8be===_0x999e('0x2e')){return db[_0x999e('0x93')][_0x999e('0x94')]({'attributes':[_0x999e('0x95')],'raw':!![]});}})[_0x999e('0x57')](function(_0x43043a){var _0x523231=_0x43043a?_0x43043a[_0x999e('0x95')]:undefined;var _0x540a9e=_0x61ba8['map'](function(_0x3dc18c){return updateInteraction(_0x3dc18c,_0x5d4f50,_0x175904,_0x523231);});return Promise[_0x999e('0x96')](_0x540a9e);});}function countFilteredInteractions(_0xa0a5de,_0x302e73){var _0x2c9443=_0xa0a5de[_0x999e('0x97')]();_0x2c9443['field'](_0x999e('0x98'));_0x2c9443['field'](_0x999e('0x6f'),_0x999e('0x39'));var _0x3f82db=utils['getSelectedTags'](_0x302e73);if(!_[_0x999e('0x99')](_0x3f82db)){_0x2c9443['where'](_0x999e('0x9a'),_0x3f82db);}var _0x16a7d6={'type':db[_0x999e('0x68')][_0x999e('0x69')][_0x999e('0x9b')],'raw':!![]};return db['sequelize']['query'](_0x2c9443[_0x999e('0x6c')](),_0x16a7d6);}module[_0x999e('0x9c')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x19ea=['ContactId','start','end','Tag','split','tags','clause','ids','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','user','body','keys','map','some','compact','concat','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','filter','get','capitalize','chat','Websites','Accounts','i.thirdDisposition','i.secondDisposition','i.disposition','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','SELECT','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','Account.mandatoryDisposition','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','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','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','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','query','groupBy','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','QueryTypes','exports','lodash','../parsers/qs','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','name','color','from','tools_tags','getInteractionFK','_interactions','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','getInteractionsTables','accounts','a.id\x20=\x20i.','me.','\x20=\x20i.id','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','getSelectedTags','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','i.phone\x20LIKE\x20?','i.fax\x20LIKE\x20?','openchannel','mail','getFullTextValue','fax','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','buildExpression','type','text','value','unreadMessages','read','and','Contact','$substring','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?'];(function(_0x128073,_0x332897){var _0x4e1368=function(_0x586627){while(--_0x586627){_0x128073['push'](_0x128073['shift']());}};_0x4e1368(++_0x332897);}(_0x19ea,0xfe));var _0xa19e=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0x19ea[_0x1d6a82];return _0x5834ac;};'use strict';var _=require(_0xa19e('0x0'));var squel=require('squel');var as=require('../parsers/advancedSearch');var qs=require(_0xa19e('0x1'));var updateInteraction=require('./update-interaction')[_0xa19e('0x2')];var utils=require(_0xa19e('0x3'));var db=require(_0xa19e('0x4'))['db'];function skipInteractionsQuery(_0x4d323a,_0x4a6556,_0x1fac51){var _0x2a8e2c=![];var _0x29fe52=utils[_0xa19e('0x5')](_0x4d323a);if(_0x4a6556[_0xa19e('0x6')]===_0xa19e('0x7')&&!_0x1fac51[_0xa19e('0x8')]&&!_0x1fac51[_0x29fe52]){_0x2a8e2c=!![];}return _0x2a8e2c;}function getTagsQuery(){return squel[_0xa19e('0x9')]()[_0xa19e('0xa')]('id')[_0xa19e('0xa')](_0xa19e('0xb'))['field'](_0xa19e('0xc'))[_0xa19e('0xd')](_0xa19e('0xe'));}function getUsersQuery(_0x8e307b,_0x54bf8c){var _0x13818d=utils[_0xa19e('0xf')](_0x8e307b);var _0xfb8dbf='user_has_'+_0x8e307b+_0xa19e('0x10');var _0x1d63b6=squel[_0xa19e('0x9')]()[_0xa19e('0xa')](_0xa19e('0x11'))['field'](_0xa19e('0x12'))[_0xa19e('0xa')](_0xa19e('0x13')+_0x13818d)[_0xa19e('0xd')](_0xfb8dbf,'ui')[_0xa19e('0x14')](_0xa19e('0x15'),'u',_0xa19e('0x16'));if(_0x54bf8c[_0xa19e('0x17')]>0x0){_0x1d63b6[_0xa19e('0x18')](_0xa19e('0x13')+_0x13818d+_0xa19e('0x19'),_['map'](_0x54bf8c,'id'));}return _0x1d63b6;}function getInteractionsQuery(_0x28fd37){var _0x34066a=utils[_0xa19e('0x1a')](_0x28fd37);var _0x256819=utils[_0xa19e('0x5')](_0x28fd37);var _0x38e398=utils[_0xa19e('0xf')](_0x28fd37);return squel['select']()[_0xa19e('0xd')](_0x34066a['interactions'],'i')[_0xa19e('0x14')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xa19e('0x14')](_0xa19e('0x15'),'o','o.id\x20=\x20i.UserId')[_0xa19e('0x14')](_0x34066a[_0xa19e('0x1b')],'a',_0xa19e('0x1c')+_0x256819)[_0xa19e('0x14')](_0x34066a['messages'],'me',_0xa19e('0x1d')+_0x38e398+_0xa19e('0x1e'))[_0xa19e('0x14')](_0x34066a[_0xa19e('0x1f')],'it',_0xa19e('0x20')+_0x38e398+_0xa19e('0x1e'))[_0xa19e('0x14')](_0xa19e('0xe'),'t',_0xa19e('0x21'));}function getSqlClauses(){var _0x536386={'body':squel[_0xa19e('0x22')](),'contact':squel[_0xa19e('0x22')](),'default':squel['expr'](),'fields':squel[_0xa19e('0x22')](),'filter':squel[_0xa19e('0x22')](),'read':squel['expr'](),'tags':{'clause':squel[_0xa19e('0x22')](),'ids':null},'user':squel[_0xa19e('0x22')]()};return _0x536386;}function parseTagParameter(_0x5d5559){var _0x40dc1c=squel[_0xa19e('0x22')]();if(_0x5d5559){var _0x2bd823=utils[_0xa19e('0x23')](_0x5d5559);_0x2bd823[_0xa19e('0x24')](function(_0x180407){_0x40dc1c['or'](_0xa19e('0x25'),'%,'+_0x180407+',%');});}return _0x40dc1c;}function parseReadParameter(_0x3f5ac6){var _0x18c96f='';if(_0x3f5ac6){_0x18c96f=_0xa19e('0x26');if(_0x3f5ac6==='1'){_0x18c96f=_0x18c96f[_0xa19e('0x27')](_0xa19e('0x28'),'=');}else{_0x18c96f=_0x18c96f[_0xa19e('0x27')](_0xa19e('0x28'),'>');}}return _0x18c96f;}function parseSearchFilter(_0xdf0b20,_0x4613c3){var _0x16bcd5=squel[_0xa19e('0x22')]();if(_0x4613c3){var _0x3dcd74=_0x4613c3[_0xa19e('0x27')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xa19e('0x29')](_0x3dcd74)){_0x16bcd5['or'](_0xa19e('0x2a'),_0x3dcd74+'%');if([_0xa19e('0x2b'),_0xa19e('0x2c')][_0xa19e('0x2d')](_0xdf0b20)){_0x16bcd5['or'](_0xa19e('0x2e'),_0x3dcd74+'%');}else if(_0xdf0b20==='fax'){_0x16bcd5['or'](_0xa19e('0x2f'),_0x3dcd74+'%');}else if(_0xdf0b20===_0xa19e('0x30')){_0x16bcd5['or']('i.from\x20LIKE\x20?',_0x3dcd74+'%');}}else if(_0xdf0b20===_0xa19e('0x31')&&qs['isEmail'](_0x3dcd74)){_0x16bcd5['or']('c.email\x20LIKE\x20?',_0x3dcd74+'%');}else{if(_0xdf0b20===_0xa19e('0x31')){_0x16bcd5['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x3dcd74))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa19e('0x32')](_0x3dcd74));}else{if(_0xdf0b20!==_0xa19e('0x33')){_0x16bcd5['or'](_0xa19e('0x34'),qs['getFullTextValue'](_0x3dcd74));}_0x16bcd5['or'](_0xa19e('0x35'),_0x3dcd74+'%');}}}return _0x16bcd5;}function parseAdvancedSearchFilter(_0x3f959c,_0x1f9af3){var _0x288a41=getSqlClauses();var _0xf857e7=as[_0xa19e('0x36')](_0x3f959c);var _0x53899a=_0xf857e7[_0xa19e('0x37')];for(var _0x434081=0x0;_0x434081<_0xf857e7['conditions'][_0xa19e('0x17')];_0x434081++){var _0x12b20a=_0xf857e7[_0xa19e('0x38')][_0x434081];var _0x5824c5='i';var _0x4bf11f=_[_0xa19e('0x39')](_0x1f9af3,['name',_0x12b20a[_0xa19e('0xa')]]);if(_0x4bf11f){var _0x13b2f8=as[_0xa19e('0x3a')](_0x5824c5,_0x4bf11f[_0xa19e('0x3b')],_0x12b20a);_0x288a41['default'][_0x53899a](_0x13b2f8[_0xa19e('0x3c')],_0x13b2f8[_0xa19e('0x3d')]['start'],_0x13b2f8[_0xa19e('0x3d')]['end']);}else{switch(_0x12b20a[_0xa19e('0xa')]){case _0xa19e('0x3e'):var _0x209424=parseReadParameter(_0x12b20a['value']);_0x288a41[_0xa19e('0x3f')][_0xa19e('0x40')](_0x209424);break;case _0xa19e('0x41'):if(_0x12b20a['operator']===_0xa19e('0x42')){if(_0x12b20a[_0xa19e('0x3d')]['split']('\x20')['length']>0x1){_0x288a41[_0xa19e('0x43')][_0x53899a](_0xa19e('0x44'),qs['getFullTextValue'](_0x12b20a[_0xa19e('0x3d')]),null);}else{var _0x2d43b4='%'+_0x12b20a['value']+'%';_0x288a41[_0xa19e('0x43')][_0x53899a](_0xa19e('0x45'),_0x2d43b4,_0x2d43b4,_0x2d43b4);}}else{_0x4bf11f=_[_0xa19e('0x39')](_0x1f9af3,[_0xa19e('0xb'),_0xa19e('0x46')]);_0x12b20a['field']=_0xa19e('0x46');_0x13b2f8=as[_0xa19e('0x3a')](_0x5824c5,_0x4bf11f[_0xa19e('0x3b')],_0x12b20a);_0x288a41[_0xa19e('0x43')][_0x53899a](_0x13b2f8[_0xa19e('0x3c')],_0x13b2f8['value'][_0xa19e('0x47')],_0x13b2f8['value'][_0xa19e('0x48')]);}break;case _0xa19e('0x49'):var _0x5d493c=_0x12b20a[_0xa19e('0x3d')][_0xa19e('0x4a')](',')['map'](function(_0x41d7ae){return Number(_0x41d7ae);});var _0x5b58b1=parseTagParameter(_0x5d493c);_0x288a41[_0xa19e('0x4b')][_0xa19e('0x4c')][_0xa19e('0x40')](_0x5b58b1);_0x288a41[_0xa19e('0x4b')][_0xa19e('0x4d')]=_0x5d493c;break;case _0xa19e('0x4e'):if(_0x12b20a[_0xa19e('0x4f')]===_0xa19e('0x42')){_0x288a41['user'][_0x53899a](_0xa19e('0x50'),'%'+_0x12b20a[_0xa19e('0x3d')]+'%',null);}else{_0x4bf11f=_['find'](_0x1f9af3,['name',_0xa19e('0x51')]);_0x12b20a[_0xa19e('0xa')]=_0xa19e('0x51');_0x13b2f8=as['buildExpression'](_0x5824c5,_0x4bf11f[_0xa19e('0x3b')],_0x12b20a);_0x288a41[_0xa19e('0x52')][_0x53899a](_0x13b2f8['text'],_0x13b2f8[_0xa19e('0x3d')][_0xa19e('0x47')],_0x13b2f8[_0xa19e('0x3d')]['end']);}break;case _0xa19e('0x53'):case'plainBody':_0x13b2f8=as[_0xa19e('0x3a')]('me',null,_0x12b20a);_0x288a41[_0xa19e('0x53')][_0x53899a](_0x13b2f8[_0xa19e('0x3c')],_0x13b2f8[_0xa19e('0x3d')][_0xa19e('0x47')],_0x13b2f8['value'][_0xa19e('0x48')]);break;}}}return _0x288a41;}function parseModelFields(_0x4c90fe,_0x4779d8,_0x5d2e5f){var _0x17e36e=utils[_0xa19e('0x5')](_0x4c90fe);var _0x2db3b2=squel[_0xa19e('0x22')]();var _0x538c9a=_(_0x4779d8)[_0xa19e('0x54')]()[_0xa19e('0x55')](function(_0x427214){return _[_0xa19e('0x56')](_0x5d2e5f,['name',_0x427214])?_0x427214:undefined;})[_0xa19e('0x57')]()['value']();if(_0x538c9a[_0xa19e('0x17')]>0x0){_0x538c9a[_0xa19e('0x24')](function(_0x3309ec){if(_0x3309ec===_0x17e36e){_0x2db3b2['and']('i.'+_0x17e36e+_0xa19e('0x19'),[][_0xa19e('0x58')](_0x4779d8[_0x3309ec]));}else if(_0x3309ec==='createdAt'){var _0x101576=JSON[_0xa19e('0x59')](_0x4779d8[_0x3309ec])[_0xa19e('0x5a')];var _0x3f8751=JSON['parse'](_0x4779d8[_0x3309ec])['$lte'];_0x2db3b2[_0xa19e('0x40')](_0xa19e('0x5b'),_0x101576,_0x3f8751);}else{if(_0x4779d8[_0x3309ec]==='null'){_0x2db3b2[_0xa19e('0x40')]('i.'+_0x3309ec+_0xa19e('0x5c'));}else{_0x2db3b2['and']('i.'+_0x3309ec+_0xa19e('0x5d'),_0x4779d8[_0x3309ec]);}}});}return _0x2db3b2;}function parseQueryParameters(_0x68e0d1,_0x44a946,_0x22890b){var _0x3cc870=getSqlClauses();return Promise[_0xa19e('0x5e')]()[_0xa19e('0x5f')](function(){return parseModelFields(_0x68e0d1,_0x44a946,_0x22890b);})[_0xa19e('0x5f')](function(_0x9008e4){_0x3cc870[_0xa19e('0x60')][_0xa19e('0x40')](_0x9008e4);return parseReadParameter(_0x44a946['read']);})['then'](function(_0x2f37b0){_0x3cc870[_0xa19e('0x3f')][_0xa19e('0x40')](_0x2f37b0);return parseTagParameter(_0x44a946['tag']);})['then'](function(_0x51b2cc){_0x3cc870[_0xa19e('0x4b')]['clause'][_0xa19e('0x40')](_0x51b2cc);return parseSearchFilter(_0x68e0d1,_0x44a946[_0xa19e('0x61')]);})[_0xa19e('0x5f')](function(_0xdf2b29){_0x3cc870['filter']=_0xdf2b29;return _0x3cc870;});}function checkAccountsRestrictions(_0x966a23,_0xe4bb66,_0x437292){var _0xfe4a4=utils[_0xa19e('0x5')](_0x966a23);var _0x12064e=_0xa19e('0x62')+_[_0xa19e('0x63')](_0x966a23)+(_0x966a23===_0xa19e('0x64')?_0xa19e('0x65'):_0xa19e('0x66'));var _0xae7dbc=squel[_0xa19e('0x22')]();return Promise[_0xa19e('0x5e')]()[_0xa19e('0x5f')](function(){if(_0x437292[_0xa19e('0x8')]&&_0xe4bb66[_0xa19e('0x6')]==='agent'){return _0xe4bb66[_0x12064e]({'attributes':['id'],'raw':!![]});}})[_0xa19e('0x5f')](function(_0x3cf325){if(_0x3cf325){if(_0x3cf325['length']===0x0){_0xae7dbc[_0xa19e('0x40')]('i.'+_0xfe4a4+'\x20IS\x20NULL');}else{_0xae7dbc['and']('i.'+_0xfe4a4+_0xa19e('0x19'),_[_0xa19e('0x55')](_0x3cf325,'id'));}}else if(!_0x437292[_0xfe4a4]){_0xae7dbc[_0xa19e('0x40')]('i.'+_0xfe4a4+'\x20IS\x20NOT\x20NULL');}})[_0xa19e('0x5f')](function(){return _0xae7dbc;});}function getClosedOrderClause(_0x4ad542,_0x462a4e){var _0x5afd28='';var _0x423d57=[_0xa19e('0x67'),_0xa19e('0x68'),_0xa19e('0x69')];if(_0x4ad542===_0xa19e('0x31')){_0x423d57['unshift'](_0xa19e('0x6a'));}if(_0x462a4e['closed']==='0'&&_0x4ad542===_0xa19e('0x31')){_0x5afd28=_0xa19e('0x6a');}else{if(_0x462a4e[_0xa19e('0x6b')]==='1'){_0x423d57[_0xa19e('0x6c')]();}_0x5afd28=_0xa19e('0x6d')+_0x423d57[_0xa19e('0x6e')](',\x20')+')';}return _0x5afd28;}function getFilteredInteractions(_0x9d442b,_0x331b17,_0x340df1,_0x3f6bf7){var _0x307a5d=utils[_0xa19e('0xf')](_0x9d442b);var _0x481e43=_[_0xa19e('0x63')](_0x9d442b)+_0xa19e('0x6f');var _0x5ca466=[];var _0x4195c9=getTagsQuery();var _0x53a806={'type':db[_0xa19e('0x70')]['QueryTypes'][_0xa19e('0x71')],'raw':!![]};var _0x45f260=[];var _0x52159a=[];return db[_0xa19e('0x72')]['query'](_0x4195c9[_0xa19e('0x73')](),_0x53a806)[_0xa19e('0x5f')](function(_0x14da59){_0x5ca466=_[_0xa19e('0x74')](_0x14da59,'id');_0x53a806=_[_0xa19e('0x75')](_0x53a806,{'model':db[_0x481e43],'mapToModel':!![],'nest':!![]});if(_0x340df1[_0xa19e('0x60')]){_0x3f6bf7['attributes'][_0xa19e('0x24')](function(_0x45e5f6){_0x331b17[_0xa19e('0xa')]('i.'+_0x45e5f6);});}else{_0x331b17['field'](_0xa19e('0x76'),_0xa19e('0x3e'));_0x331b17[_0xa19e('0xa')]('a.key',_0xa19e('0x77'));_0x331b17[_0xa19e('0xa')]('a.mandatoryDisposition',_0xa19e('0x78'));if(_0x9d442b===_0xa19e('0x31')){_0x331b17[_0xa19e('0xa')]('a.email',_0xa19e('0x79'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x7a'),_0xa19e('0x7b'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x7c'));_0x331b17[_0xa19e('0xa')]('i.createdAt');_0x331b17[_0xa19e('0xa')](_0xa19e('0x7d'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x7e'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x7f'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x80'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x81'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x82'));_0x331b17[_0xa19e('0xa')]('i.subject');_0x331b17[_0xa19e('0xa')](_0xa19e('0x69'));_0x331b17['field'](_0xa19e('0x68'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x67'));_0x331b17['field'](_0xa19e('0x6a'));_0x331b17['field']('i.to');_0x331b17['field'](_0xa19e('0x83'));_0x331b17['field'](_0xa19e('0x84'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x85'));}else if(_0x9d442b==='openchannel'){_0x331b17[_0xa19e('0xa')](_0xa19e('0x86'),_0xa19e('0x7b'));}else{_0x331b17[_0xa19e('0xa')](_0xa19e('0x87'),_0xa19e('0x7b'));}if(_0x9d442b!==_0xa19e('0x31')){_0x331b17[_0xa19e('0xa')]('i.*');}_0x331b17[_0xa19e('0xa')]('c.firstName',_0xa19e('0x88'));_0x331b17['field'](_0xa19e('0x89'),_0xa19e('0x8a'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x8b'),_0xa19e('0x8c'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x8d'),'Contact.phone');_0x331b17[_0xa19e('0xa')](_0xa19e('0x8e'),_0xa19e('0x8f'));_0x331b17[_0xa19e('0xa')]('c.fax',_0xa19e('0x90'));_0x331b17['field']('o.fullname','Owner.fullname');_0x331b17[_0xa19e('0xa')](_0xa19e('0x91'),_0xa19e('0x92'));_0x331b17[_0xa19e('0xa')](_0xa19e('0x93'),_0xa19e('0x94'));}if(_0x3f6bf7['limit']){_0x331b17[_0xa19e('0x95')](_0x3f6bf7['limit']);}if(_0x3f6bf7[_0xa19e('0x96')]){_0x331b17['offset'](_0x3f6bf7['offset']);}return db['sequelize'][_0xa19e('0x97')](_0x331b17[_0xa19e('0x73')](),_0x53a806);})[_0xa19e('0x5f')](function(_0x29177c){_0x45f260=_0x29177c;var _0x45ae6d=getUsersQuery(_0x9d442b,_0x45f260);return db[_0xa19e('0x72')][_0xa19e('0x97')](_0x45ae6d[_0xa19e('0x73')](),_0x53a806);})[_0xa19e('0x5f')](function(_0x23cefa){_0x52159a=_[_0xa19e('0x98')](_0x23cefa,_0x307a5d);if(_0x9d442b===_0xa19e('0x31')){return db['Setting'][_0xa19e('0x99')]({'attributes':['enableEmailPreview'],'raw':!![]});}})['then'](function(_0x444a6e){var _0x23b6d9=_0x444a6e?_0x444a6e[_0xa19e('0x9a')]:undefined;var _0x3f2610=_0x45f260[_0xa19e('0x55')](function(_0x2ce237){return updateInteraction(_0x2ce237,_0x5ca466,_0x52159a,_0x23b6d9);});return Promise[_0xa19e('0x9b')](_0x3f2610);});}function countFilteredInteractions(_0x1c77d4,_0x52e038){var _0xc1d84e=_0x1c77d4[_0xa19e('0x9c')]();_0xc1d84e['field'](_0xa19e('0x9d'));_0xc1d84e[_0xa19e('0xa')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');var _0x12cb29=utils[_0xa19e('0x23')](_0x52e038);if(!_[_0xa19e('0x9e')](_0x12cb29)){_0xc1d84e[_0xa19e('0x18')](_0xa19e('0x9f'),_0x12cb29);}var _0x195f22={'type':db[_0xa19e('0x70')][_0xa19e('0xa0')][_0xa19e('0x71')],'raw':!![]};return db[_0xa19e('0x72')][_0xa19e('0x97')](_0xc1d84e[_0xa19e('0x73')](),_0x195f22);}module[_0xa19e('0xa1')]={'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 0535e13..423ad67 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 _0x3af2=['answered','unmanaged','abandoned','closed','disposition','UserId','MailMessage','findOne','out','plainBody','-id','then','lastMsgText','trimStart','catch','updateInteraction','Users','TagIds','lodash','map','fullname','split','forEach','push','waiting','talking'];(function(_0x1682cc,_0x194ec0){var _0x391601=function(_0x45028a){while(--_0x45028a){_0x1682cc['push'](_0x1682cc['shift']());}};_0x391601(++_0x194ec0);}(_0x3af2,0x94));var _0x23af=function(_0x4ec13d,_0x358a8f){_0x4ec13d=_0x4ec13d-0x0;var _0x3c3fa7=_0x3af2[_0x4ec13d];return _0x3c3fa7;};'use strict';var _=require(_0x23af('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x165782,_0x3a855c){return new Promise(function(_0x53f69c,_0x389993){try{var _0x3406f5=[];if(_0x3a855c[_0x165782]){_0x3406f5=_0x3a855c[_0x165782][_0x23af('0x1')](function(_0x340aa0){return{'id':_0x340aa0['id'],'fullname':_0x340aa0[_0x23af('0x2')]};});}return _0x53f69c(_0x3406f5);}catch(_0x344ee7){_0x389993(_0x344ee7);}});}function getInteractionTags(_0x6f00f3,_0x4c81ba){var _0x4dc0e2=[];if(_0x6f00f3){_0x6f00f3[_0x23af('0x3')](',')[_0x23af('0x4')](function(_0x4840d7){_0x4dc0e2[_0x23af('0x5')](_0x4c81ba[_0x4840d7]);});}return _0x4dc0e2;}function updateWaitingCounter(_0x51e023){if(_0x51e023[_0x23af('0x6')]){_0x51e023[_0x23af('0x6')]-=0x1;}}function updateInteractionCounters(_0x1d0c9c){_0x1d0c9c['waiting']=0x0;_0x1d0c9c[_0x23af('0x7')]=0x0;_0x1d0c9c[_0x23af('0x8')]=0x0;_0x1d0c9c[_0x23af('0x9')]=0x0;_0x1d0c9c[_0x23af('0xa')]=0x0;_0x1d0c9c['total']=0x0;if(_0x1d0c9c[_0x23af('0xb')]){if(_0x1d0c9c[_0x23af('0xc')]==='abandoned'){_0x1d0c9c[_0x23af('0xa')]+=0x1;updateWaitingCounter(_0x1d0c9c);}if(_0x1d0c9c['UserId']){_0x1d0c9c[_0x23af('0x8')]+=0x1;if(_0x1d0c9c[_0x23af('0x7')]){_0x1d0c9c[_0x23af('0x7')]-=0x1;}}else{if(_0x1d0c9c[_0x23af('0xc')]){_0x1d0c9c[_0x23af('0x9')]+=0x1;updateWaitingCounter(_0x1d0c9c);}}}else{if(!_0x1d0c9c['UserId']){_0x1d0c9c['waiting']+=0x1;}if(_0x1d0c9c[_0x23af('0xd')]){_0x1d0c9c[_0x23af('0x7')]+=0x1;updateWaitingCounter(_0x1d0c9c);}}_0x1d0c9c['total']+=0x1;return _0x1d0c9c;}function getLastMessageText(_0x8a9d98){return db[_0x23af('0xe')][_0x23af('0xf')]({'where':{'$and':[{'MailInteractionId':_0x8a9d98['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x23af('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x23af('0x11')],'order':_0x23af('0x12'),'raw':!![]})[_0x23af('0x13')](function(_0x5722a0){if(_0x5722a0&&_0x5722a0[_0x23af('0x11')]){_0x8a9d98[_0x23af('0x14')]=_[_0x23af('0x15')](_0x5722a0[_0x23af('0x11')]);}return _0x8a9d98;})[_0x23af('0x16')](function(_0x232a19){throw _0x232a19;});}exports[_0x23af('0x17')]=function(_0x182566,_0x2b6bf0,_0x5cb66d,_0x51753e){return new Promise(function(_0x4d3ceb,_0x1d95b5){return getInteractionUsers(_0x182566['id'],_0x5cb66d)['then'](function(_0xf69b0d){_0x182566[_0x23af('0x18')]=_0xf69b0d;return getInteractionTags(_0x182566[_0x23af('0x19')],_0x2b6bf0);})[_0x23af('0x13')](function(_0x52a200){_0x182566['Tags']=_0x52a200;delete _0x182566[_0x23af('0x19')];return updateInteractionCounters(_0x182566);})[_0x23af('0x13')](function(_0x38da36){if(_0x51753e){return getLastMessageText(_0x38da36);}else{return _0x38da36;}})[_0x23af('0x13')](function(_0x357de8){_0x4d3ceb(_0x357de8);})[_0x23af('0x16')](function(_0x54de1e){_0x1d95b5(_0x54de1e);});});}; \ No newline at end of file +var _0x128b=['../../mysqldb','split','push','waiting','talking','unmanaged','closed','disposition','answered','UserId','total','plainBody','-id','then','lastMsgText','catch','updateInteraction','Users','TagIds','lodash'];(function(_0x3446af,_0x3b2f92){var _0x252b14=function(_0x1caaca){while(--_0x1caaca){_0x3446af['push'](_0x3446af['shift']());}};_0x252b14(++_0x3b2f92);}(_0x128b,0xb3));var _0xb128=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x128b[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xb128('0x0'));var db=require(_0xb128('0x1'))['db'];function getInteractionUsers(_0x414fc2,_0x334693){return new Promise(function(_0x623fc3,_0x454598){try{var _0x36a0a9=[];if(_0x334693[_0x414fc2]){_0x36a0a9=_0x334693[_0x414fc2]['map'](function(_0x37e8f1){return{'id':_0x37e8f1['id'],'fullname':_0x37e8f1['fullname']};});}return _0x623fc3(_0x36a0a9);}catch(_0x320d98){_0x454598(_0x320d98);}});}function getInteractionTags(_0x45c6c0,_0x279665){var _0x129ef8=[];if(_0x45c6c0){_0x45c6c0[_0xb128('0x2')](',')['forEach'](function(_0x21bf06){_0x129ef8[_0xb128('0x3')](_0x279665[_0x21bf06]);});}return _0x129ef8;}function updateWaitingCounter(_0xf2014a){if(_0xf2014a[_0xb128('0x4')]){_0xf2014a[_0xb128('0x4')]-=0x1;}}function updateInteractionCounters(_0x48990c){_0x48990c['waiting']=0x0;_0x48990c[_0xb128('0x5')]=0x0;_0x48990c['answered']=0x0;_0x48990c[_0xb128('0x6')]=0x0;_0x48990c['abandoned']=0x0;_0x48990c['total']=0x0;if(_0x48990c[_0xb128('0x7')]){if(_0x48990c[_0xb128('0x8')]==='abandoned'){_0x48990c['abandoned']+=0x1;updateWaitingCounter(_0x48990c);}if(_0x48990c['UserId']){_0x48990c[_0xb128('0x9')]+=0x1;if(_0x48990c['talking']){_0x48990c[_0xb128('0x5')]-=0x1;}}else{if(_0x48990c[_0xb128('0x8')]){_0x48990c[_0xb128('0x6')]+=0x1;updateWaitingCounter(_0x48990c);}}}else{if(!_0x48990c[_0xb128('0xa')]){_0x48990c[_0xb128('0x4')]+=0x1;}if(_0x48990c[_0xb128('0xa')]){_0x48990c[_0xb128('0x5')]+=0x1;updateWaitingCounter(_0x48990c);}}_0x48990c[_0xb128('0xb')]+=0x1;return _0x48990c;}function getLastMessageText(_0x4231b1){return db['MailMessage']['findOne']({'where':{'$and':[{'MailInteractionId':_0x4231b1['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xb128('0xc')],'order':_0xb128('0xd'),'raw':!![]})[_0xb128('0xe')](function(_0x1d5267){if(_0x1d5267&&_0x1d5267[_0xb128('0xc')]){_0x4231b1[_0xb128('0xf')]=_['trimStart'](_0x1d5267[_0xb128('0xc')]);}return _0x4231b1;})[_0xb128('0x10')](function(_0x4322c4){throw _0x4322c4;});}exports[_0xb128('0x11')]=function(_0x59b7dd,_0x428d7d,_0x426d10,_0x3224d7){return new Promise(function(_0x2c4561,_0x546521){return getInteractionUsers(_0x59b7dd['id'],_0x426d10)['then'](function(_0x44c344){_0x59b7dd[_0xb128('0x12')]=_0x44c344;return getInteractionTags(_0x59b7dd['TagIds'],_0x428d7d);})[_0xb128('0xe')](function(_0x1a3e21){_0x59b7dd['Tags']=_0x1a3e21;delete _0x59b7dd[_0xb128('0x13')];return updateInteractionCounters(_0x59b7dd);})['then'](function(_0x4ffb76){if(_0x3224d7){return getLastMessageText(_0x4ffb76);}else{return _0x4ffb76;}})[_0xb128('0xe')](function(_0xcd2319){_0x2c4561(_0xcd2319);})[_0xb128('0x10')](function(_0x1729a9){_0x546521(_0x1729a9);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 1b695d2..688a9ad 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 _0x91cd=['lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','Account','InteractionId','upperFirst','unknown','chat','websites','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','Interaction','info','catch','error','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x91cd,0xc0));var _0xd91c=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x91cd[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0xd91c('0x0'));var db=require(_0xd91c('0x1'))['db'];var loggers={'openchannel':require(_0xd91c('0x2'))(_0xd91c('0x3')),'mail':require(_0xd91c('0x2'))(_0xd91c('0x4')),'fax':require('../../config/logger')(_0xd91c('0x5')),'sms':require(_0xd91c('0x2'))(_0xd91c('0x6')),'chat':require(_0xd91c('0x2'))(_0xd91c('0x7')),'whatsapp':require(_0xd91c('0x2'))(_0xd91c('0x8'))};function getAccountFK(_0x1799cb){return _[_0xd91c('0x9')](_0x1799cb)+(_0x1799cb==='chat'?'Website':_0xd91c('0xa'))+'Id';}function getInteractionFK(_0x47a5b4){return _[_0xd91c('0x9')](_0x47a5b4)+_0xd91c('0xb');}function getInteractionId(_0x13da30,_0x23b9d2,_0x5b7cf2){if(_0x13da30&&_0x13da30[_[_0xd91c('0xc')](_0x5b7cf2)+'InteractionId']){return _0x13da30[_[_0xd91c('0xc')](_0x5b7cf2)+_0xd91c('0xb')];}else if(_0x13da30&&_0x13da30['id']){return _0x13da30['id'];}else if(_0x23b9d2&&_0x23b9d2['id']){return _0x23b9d2['id'];}else{return _0xd91c('0xd');}}function getInteractionsTables(_0x8a22d7){return{'accounts':_0x8a22d7+'_'+(_0x8a22d7===_0xd91c('0xe')?_0xd91c('0xf'):'accounts'),'interactions':_0x8a22d7+_0xd91c('0x10'),'interactionsTags':_0x8a22d7+_0xd91c('0x11'),'messages':_0x8a22d7+_0xd91c('0x12'),'userInteractions':_0xd91c('0x13')+_0x8a22d7+'_interactions'};}function getSelectedTags(_0x3cdd66){var _0x36b3d9=[];if(_0x3cdd66){_0x36b3d9=Array[_0xd91c('0x14')](_0x3cdd66)?_0x3cdd66:[_0x3cdd66];}return _0x36b3d9;}function log(_0x2864f1,_0x4ecb70,_0x550c3b,_0x58632f,_0xa4573f,_0xf95d24){loggers[_0xa4573f[_0xd91c('0x15')]()][_0x2864f1](_0xd91c('0x16'),_0xf95d24['toUpperCase'](),_0x4ecb70?_0x4ecb70['id']:null,_0x4ecb70?_0x4ecb70[_0xd91c('0x17')]:null,_0x4ecb70?_0x4ecb70[_0xd91c('0x18')]:null,getInteractionId(_0x550c3b,_0x58632f,_0xa4573f),_0x550c3b?JSON[_0xd91c('0x19')](_0x550c3b):_0xd91c('0x1a'));}function updateUser(_0x22c6ca,_0x4edfc3,_0xc50e29,_0x312fe5,_0x259984){db[_[_0xd91c('0xc')](_0x312fe5)+_0xd91c('0x1b')]['findOne']({'where':{'id':getInteractionId(_0x4edfc3,_0xc50e29,_0x312fe5)}})['then'](function(_0x523526){if(_0x523526){return _0x523526['update']({'UserId':_0x22c6ca?_0x22c6ca['id']:null});}})['then'](function(_0x11e74d){if(_0x11e74d){log(_0xd91c('0x1c'),_0x22c6ca,_0x4edfc3,_0xc50e29,_0x312fe5,_0x259984);}})[_0xd91c('0x1d')](function(){log(_0xd91c('0x1e'),_0x22c6ca,_0x4edfc3,_0xc50e29,_0x312fe5,_0x259984);});}module[_0xd91c('0x1f')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0xa9fc=['_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','findOne','then','info','error','exports','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','_interactions'];(function(_0xa3e0f7,_0x1b06db){var _0x4ce604=function(_0x29df1e){while(--_0x29df1e){_0xa3e0f7['push'](_0xa3e0f7['shift']());}};_0x4ce604(++_0x1b06db);}(_0xa9fc,0x12f));var _0xca9f=function(_0x28a5ad,_0x520afa){_0x28a5ad=_0x28a5ad-0x0;var _0x176b8a=_0xa9fc[_0x28a5ad];return _0x176b8a;};'use strict';var _=require(_0xca9f('0x0'));var db=require(_0xca9f('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require(_0xca9f('0x2'))(_0xca9f('0x3')),'fax':require(_0xca9f('0x2'))(_0xca9f('0x4')),'sms':require(_0xca9f('0x2'))(_0xca9f('0x5')),'chat':require(_0xca9f('0x2'))(_0xca9f('0x6')),'whatsapp':require('../../config/logger')(_0xca9f('0x7'))};function getAccountFK(_0x3b43c0){return _[_0xca9f('0x8')](_0x3b43c0)+(_0x3b43c0===_0xca9f('0x9')?_0xca9f('0xa'):_0xca9f('0xb'))+'Id';}function getInteractionFK(_0x34bc12){return _['capitalize'](_0x34bc12)+_0xca9f('0xc');}function getInteractionId(_0x4f1961,_0x37a2bb,_0x4ab920){if(_0x4f1961&&_0x4f1961[_['upperFirst'](_0x4ab920)+_0xca9f('0xc')]){return _0x4f1961[_[_0xca9f('0xd')](_0x4ab920)+_0xca9f('0xc')];}else if(_0x4f1961&&_0x4f1961['id']){return _0x4f1961['id'];}else if(_0x37a2bb&&_0x37a2bb['id']){return _0x37a2bb['id'];}else{return _0xca9f('0xe');}}function getInteractionsTables(_0x54d7a0){return{'accounts':_0x54d7a0+'_'+(_0x54d7a0===_0xca9f('0x9')?_0xca9f('0xf'):'accounts'),'interactions':_0x54d7a0+_0xca9f('0x10'),'interactionsTags':_0x54d7a0+_0xca9f('0x11'),'messages':_0x54d7a0+_0xca9f('0x12'),'userInteractions':_0xca9f('0x13')+_0x54d7a0+_0xca9f('0x10')};}function getSelectedTags(_0x5be744){var _0x10b4bc=[];if(_0x5be744){_0x10b4bc=Array[_0xca9f('0x14')](_0x5be744)?_0x5be744:[_0x5be744];}return _0x10b4bc;}function log(_0x5a5e09,_0x1fc639,_0x696b69,_0x2e0631,_0x3bcedc,_0x4abef9){loggers[_0x3bcedc[_0xca9f('0x15')]()][_0x5a5e09](_0xca9f('0x16'),_0x4abef9['toUpperCase'](),_0x1fc639?_0x1fc639['id']:null,_0x1fc639?_0x1fc639[_0xca9f('0x17')]:null,_0x1fc639?_0x1fc639[_0xca9f('0x18')]:null,getInteractionId(_0x696b69,_0x2e0631,_0x3bcedc),_0x696b69?JSON[_0xca9f('0x19')](_0x696b69):_0xca9f('0x1a'));}function updateUser(_0x272a8f,_0xcbdf4e,_0x58260c,_0x53e304,_0x470e95){db[_[_0xca9f('0xd')](_0x53e304)+'Interaction'][_0xca9f('0x1b')]({'where':{'id':getInteractionId(_0xcbdf4e,_0x58260c,_0x53e304)}})[_0xca9f('0x1c')](function(_0x23f3e9){if(_0x23f3e9){return _0x23f3e9['update']({'UserId':_0x272a8f?_0x272a8f['id']:null});}})[_0xca9f('0x1c')](function(_0x860fe6){if(_0x860fe6){log(_0xca9f('0x1d'),_0x272a8f,_0xcbdf4e,_0x58260c,_0x53e304,_0x470e95);}})['catch'](function(){log(_0xca9f('0x1e'),_0x272a8f,_0xcbdf4e,_0x58260c,_0x53e304,_0x470e95);});}module[_0xca9f('0x1f')]={'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 cd731a2..dab0c72 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 _0x773a=['use','License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','hasOwnProperty'];(function(_0x1dd397,_0x5bbff0){var _0x3f1e50=function(_0x1087f0){while(--_0x1087f0){_0x1dd397['push'](_0x1dd397['shift']());}};_0x3f1e50(++_0x5bbff0);}(_0x773a,0x194));var _0xa773=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x773a[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require(_0xa773('0x0'));var util=require(_0xa773('0x1'));var compose=require('composable-middleware');var db=require(_0xa773('0x2'))['db'];var config=require(_0xa773('0x3'));function getValueFromLicense(_0x324129,_0x48aa9b){if(_0x324129&&_0x48aa9b){if(_0x48aa9b[_0xa773('0x4')]&&_0x48aa9b['license']){var _0x4f9a6b=_0x48aa9b[_0xa773('0x4')];var _0x2c957a=_0x48aa9b[_0xa773('0x5')];var _0x29bca5=_0x4f9a6b[_0xa773('0x6')]('-')[0x4];var _0x523d66=_0x4f9a6b[_0xa773('0x6')]('-')[0x0];var _0x3b5b74=crypto[_0xa773('0x7')](_0xa773('0x8'),util[_0xa773('0x9')](_0xa773('0xa'),_0x29bca5,_0x4f9a6b,_0x523d66));var _0x1e1e0b=_0x3b5b74[_0xa773('0xb')](_0x2c957a,_0xa773('0xc'),_0xa773('0xd'));_0x1e1e0b+=_0x3b5b74[_0xa773('0xe')](_0xa773('0xd'));var _0x33022e=JSON['parse'](_0x1e1e0b);return _0x33022e[_0xa773('0xf')](_0x324129)?_0x33022e[_0x324129]:null;}}return null;}function isLimit(_0x405464,_0x312d31,_0x249949,_0x40b3b9){var _0x3c2b7c=_0x312d31;return compose()[_0xa773('0x10')](function(_0x419e1d,_0x3b7d22,_0x26c75b){return db[_0xa773('0x11')][_0xa773('0x12')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x5a8ed5){var _0x3a57b3=getValueFromLicense(_0x405464,_0x5a8ed5);return _0x3a57b3?_0x3a57b3:_0x3c2b7c;})[_0xa773('0x13')](function(_0x45ef08){_0x3c2b7c=_0x45ef08;return _0x249949['count'](_0x40b3b9);})['then'](function(_0x5adc15){if(_0x5adc15>=_0x3c2b7c){return _0x3b7d22[_0xa773('0x14')](0x193)[_0xa773('0x15')]({'message':util['format'](_0xa773('0x16'),_0x405464)});}_0x26c75b();})[_0xa773('0x17')](function(_0x17ca38){_0x26c75b(_0x17ca38);});});}function isUserLimit(){return isLimit(_0xa773('0x18'),0x1,db['User'],{'where':{'$or':[{'role':_0xa773('0x19')},{'role':_0xa773('0x1a')}]}});}exports[_0xa773('0x1b')]=isUserLimit; \ No newline at end of file +var _0x5f70=['catch','users','User','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x5378c0,_0x54c93c){var _0x301128=function(_0x4cbdd9){while(--_0x4cbdd9){_0x5378c0['push'](_0x5378c0['shift']());}};_0x301128(++_0x54c93c);}(_0x5f70,0x1a5));var _0x05f7=function(_0x11fc98,_0x35cc48){_0x11fc98=_0x11fc98-0x0;var _0x9019e=_0x5f70[_0x11fc98];return _0x9019e;};'use strict';var crypto=require(_0x05f7('0x0'));var util=require(_0x05f7('0x1'));var compose=require('composable-middleware');var db=require(_0x05f7('0x2'))['db'];var config=require(_0x05f7('0x3'));function getValueFromLicense(_0x5e46c5,_0x536201){if(_0x5e46c5&&_0x536201){if(_0x536201[_0x05f7('0x4')]&&_0x536201['license']){var _0x3c095a=_0x536201[_0x05f7('0x4')];var _0x1f95aa=_0x536201[_0x05f7('0x5')];var _0x15d0da=_0x3c095a[_0x05f7('0x6')]('-')[0x4];var _0x5350b6=_0x3c095a['split']('-')[0x0];var _0x33fb71=crypto[_0x05f7('0x7')]('aes-256-ctr',util['format']('%s:%s:%s',_0x15d0da,_0x3c095a,_0x5350b6));var _0x5011f7=_0x33fb71['update'](_0x1f95aa,_0x05f7('0x8'),_0x05f7('0x9'));_0x5011f7+=_0x33fb71[_0x05f7('0xa')](_0x05f7('0x9'));var _0x1c0ae2=JSON[_0x05f7('0xb')](_0x5011f7);return _0x1c0ae2[_0x05f7('0xc')](_0x5e46c5)?_0x1c0ae2[_0x5e46c5]:null;}}return null;}function isLimit(_0x26c6e9,_0xc4edc9,_0x3b2cdc,_0x2b0bf8){var _0x55c4b6=_0xc4edc9;return compose()[_0x05f7('0xd')](function(_0x3879af,_0x2ac9e7,_0x951166){return db[_0x05f7('0xe')][_0x05f7('0xf')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x394ca5){var _0x3ba31e=getValueFromLicense(_0x26c6e9,_0x394ca5);return _0x3ba31e?_0x3ba31e:_0x55c4b6;})[_0x05f7('0x10')](function(_0x3b1574){_0x55c4b6=_0x3b1574;return _0x3b2cdc[_0x05f7('0x11')](_0x2b0bf8);})[_0x05f7('0x10')](function(_0x3b0809){if(_0x3b0809>=_0x55c4b6){return _0x2ac9e7[_0x05f7('0x12')](0x193)[_0x05f7('0x13')]({'message':util['format'](_0x05f7('0x14'),_0x26c6e9)});}_0x951166();})[_0x05f7('0x15')](function(_0xf7d40b){_0x951166(_0xf7d40b);});});}function isUserLimit(){return isLimit(_0x05f7('0x16'),0x1,db[_0x05f7('0x17')],{'where':{'$or':[{'role':'admin'},{'role':_0x05f7('0x18')}]}});}exports[_0x05f7('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index f33ae2c..020508a 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 _0x4378=['split','length','slice','shift','match','filter','indexOf','conditions','push','buildExpression','operator','$between','value','$gt','$lte','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','minutes','add','seconds','lodash','moment','parseSearch','startsWith','and','replace','[$or]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4378,0xd1));var _0x8437=function(_0x3ab24b,_0x50d285){_0x3ab24b=_0x3ab24b-0x0;var _0x4fdbed=_0x4378[_0x3ab24b];return _0x4fdbed;};'use strict';var _=require(_0x8437('0x0'));var moment=require(_0x8437('0x1'));exports[_0x8437('0x2')]=function(_0xfbe720){var _0x4ea7d3={'conditions':[]};_0x4ea7d3['sqlOperator']=_[_0x8437('0x3')](_0xfbe720,'[$or]')?'or':_0x8437('0x4');var _0x549655=_0xfbe720[_0x8437('0x5')]('[$and]','')[_0x8437('0x5')](_0x8437('0x6'),'')[_0x8437('0x7')]('||');for(var _0x20870e=0x0;_0x20870e<_0x549655[_0x8437('0x8')];_0x20870e++){var _0x2a0d75=_0x549655[_0x20870e]['split'](':=');var _0x59a01f=_0x2a0d75[0x0];var _0x543125=_0x2a0d75[_0x8437('0x9')](0x1);_0x543125['forEach'](function(_0x24e432){var _0x549c51=_0x24e432[_0x8437('0x7')]('[')[_0x8437('0xa')]();var _0x22f9e9=_0x24e432[_0x8437('0xb')](/\[(.*?)\]/g);_0x22f9e9['forEach'](function(_0x62f87d){var _0x2e7821=_0x62f87d[_0x8437('0x7')]('[')[_0x8437('0xc')](function(_0x1cd1e1){return _0x1cd1e1[_0x8437('0xd')](']')>-0x1;})['map'](function(_0x48ef20){return _0x48ef20['split'](']')[0x0];})[0x0];_0x4ea7d3[_0x8437('0xe')][_0x8437('0xf')]({'field':_0x59a01f,'operator':_0x549c51,'value':_0x2e7821});});});}return _0x4ea7d3;};exports[_0x8437('0x10')]=function(_0x3eae2c,_0x310c4f,_0x3ae6d3){var _0x54af4e={};if(_0x310c4f==='DATE'){if(_0x3ae6d3[_0x8437('0x11')]==='$eq'){_0x3ae6d3['operator']=_0x8437('0x12');_0x3ae6d3[_0x8437('0x13')]+=','+_0x3ae6d3['value'];}else if(_['includes']([_0x8437('0x14'),_0x8437('0x15')],_0x3ae6d3[_0x8437('0x11')])){_0x3ae6d3['value']=moment(_0x3ae6d3['value'])['add'](0x1,'days')[_0x8437('0x16')](_0x8437('0x17'));}}if(_0x3ae6d3['castTo']){_0x310c4f=_0x3ae6d3[_0x8437('0x18')];_0x54af4e[_0x8437('0x19')]=_0x8437('0x1a')+_0x3eae2c+'.'+_0x3ae6d3[_0x8437('0x1b')]+_0x8437('0x1c')+_0x3ae6d3[_0x8437('0x18')]+')\x20'+parseOperator(_0x3ae6d3[_0x8437('0x11')]);}else{_0x54af4e[_0x8437('0x19')]=_0x3eae2c+'.'+_0x3ae6d3[_0x8437('0x1b')]+'\x20'+parseOperator(_0x3ae6d3[_0x8437('0x11')]);}if(_['includes']([_0x8437('0x1d'),_0x8437('0x1e')],_0x3ae6d3['operator']))_0x54af4e['text']='('+_0x54af4e[_0x8437('0x19')]+_0x8437('0x1f')+_0x3eae2c+'.'+_0x3ae6d3[_0x8437('0x1b')]+'\x20IS\x20NULL)';_0x54af4e[_0x8437('0x13')]=parseValue(_0x310c4f,_0x3ae6d3[_0x8437('0x11')],_0x3ae6d3[_0x8437('0x13')]);return _0x54af4e;};function parseOperator(_0x9cfe9f){var _0x442c7d;switch(_0x9cfe9f){case'$in':_0x442c7d=_0x8437('0x20');break;case _0x8437('0x1e'):_0x442c7d=_0x8437('0x21');break;case'$eq':_0x442c7d=_0x8437('0x22');break;case _0x8437('0x1d'):_0x442c7d=_0x8437('0x23');break;case _0x8437('0x24'):case _0x8437('0x25'):case _0x8437('0x26'):_0x442c7d=_0x8437('0x27');break;case _0x8437('0x28'):_0x442c7d=_0x8437('0x29');break;case _0x8437('0x14'):_0x442c7d=_0x8437('0x2a');break;case'$lte':_0x442c7d=_0x8437('0x2b');break;case _0x8437('0x2c'):_0x442c7d=_0x8437('0x2d');break;case _0x8437('0x12'):_0x442c7d=_0x8437('0x2e');break;}return _0x442c7d;}function parseValue(_0x1e45ea,_0x11435f,_0x2b5fd3){var _0x6b3732={'start':undefined,'end':undefined};switch(_0x11435f){case'$in':case'$notIn':_0x6b3732[_0x8437('0x2f')]=_0x2b5fd3[_0x8437('0x7')](',');break;case _0x8437('0x24'):_0x6b3732[_0x8437('0x2f')]='%'+_0x2b5fd3+'%';break;case'$startsWith':_0x6b3732[_0x8437('0x2f')]=_0x2b5fd3+'%';break;case _0x8437('0x26'):_0x6b3732['start']='%'+_0x2b5fd3;break;case _0x8437('0x12'):var _0x348cec=_0x2b5fd3[_0x8437('0x7')](',');var _0x2b5fd3=_0x348cec[_0x8437('0xa')]();var _0x4e7d30=_0x348cec[_0x8437('0x30')]();if(_0x1e45ea==='DATE'){_0x2b5fd3=moment(_0x2b5fd3)[_0x8437('0x31')](0x0,!![])['format']();_0x4e7d30=moment(_0x4e7d30)[_0x8437('0x31')](0x0,!![])['add'](0x17,_0x8437('0x32'))['add'](0x3b,_0x8437('0x33'))[_0x8437('0x34')](0x3b,_0x8437('0x35'))[_0x8437('0x16')]();}_0x6b3732={'start':_0x2b5fd3,'end':_0x4e7d30};break;default:_0x6b3732['start']=_0x2b5fd3;break;}return _0x6b3732;} \ No newline at end of file +var _0x2bd0=['[$or]','and','replace','[$and]','split','forEach','match','indexOf','map','conditions','push','buildExpression','DATE','operator','$between','value','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','includes','$ne','\x20OR\x20','field','\x20IS\x20NULL)','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','<>\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','$substring','shift','pop','utcOffset','hours','minutes','seconds','lodash','moment','startsWith'];(function(_0x514260,_0x1891e1){var _0x4ac81b=function(_0x53cab1){while(--_0x53cab1){_0x514260['push'](_0x514260['shift']());}};_0x4ac81b(++_0x1891e1);}(_0x2bd0,0xa5));var _0x02bd=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x2bd0[_0x4ae625];return _0x31accf;};'use strict';var _=require(_0x02bd('0x0'));var moment=require(_0x02bd('0x1'));exports['parseSearch']=function(_0x1f6ca4){var _0xce5cb7={'conditions':[]};_0xce5cb7['sqlOperator']=_[_0x02bd('0x2')](_0x1f6ca4,_0x02bd('0x3'))?'or':_0x02bd('0x4');var _0xec4d1f=_0x1f6ca4[_0x02bd('0x5')](_0x02bd('0x6'),'')[_0x02bd('0x5')]('[$or]','')['split']('||');for(var _0x5d653f=0x0;_0x5d653f<_0xec4d1f['length'];_0x5d653f++){var _0x576fa2=_0xec4d1f[_0x5d653f][_0x02bd('0x7')](':=');var _0x4d40f7=_0x576fa2[0x0];var _0x4fa83d=_0x576fa2['slice'](0x1);_0x4fa83d[_0x02bd('0x8')](function(_0x1b7b30){var _0x34c940=_0x1b7b30['split']('[')['shift']();var _0x5e0d14=_0x1b7b30[_0x02bd('0x9')](/\[(.*?)\]/g);_0x5e0d14['forEach'](function(_0x30996c){var _0x2a61b1=_0x30996c['split']('[')['filter'](function(_0x2882e4){return _0x2882e4[_0x02bd('0xa')](']')>-0x1;})[_0x02bd('0xb')](function(_0x29b59f){return _0x29b59f[_0x02bd('0x7')](']')[0x0];})[0x0];_0xce5cb7[_0x02bd('0xc')][_0x02bd('0xd')]({'field':_0x4d40f7,'operator':_0x34c940,'value':_0x2a61b1});});});}return _0xce5cb7;};exports[_0x02bd('0xe')]=function(_0x464c49,_0x4d42ea,_0x56e970){var _0x48265a={};if(_0x4d42ea===_0x02bd('0xf')){if(_0x56e970['operator']==='$eq'){_0x56e970[_0x02bd('0x10')]=_0x02bd('0x11');_0x56e970[_0x02bd('0x12')]+=','+_0x56e970[_0x02bd('0x12')];}else if(_['includes']([_0x02bd('0x13'),_0x02bd('0x14')],_0x56e970[_0x02bd('0x10')])){_0x56e970[_0x02bd('0x12')]=moment(_0x56e970[_0x02bd('0x12')])[_0x02bd('0x15')](0x1,_0x02bd('0x16'))[_0x02bd('0x17')](_0x02bd('0x18'));}}if(_0x56e970[_0x02bd('0x19')]){_0x4d42ea=_0x56e970[_0x02bd('0x19')];_0x48265a[_0x02bd('0x1a')]=_0x02bd('0x1b')+_0x464c49+'.'+_0x56e970['field']+'\x20AS\x20'+_0x56e970[_0x02bd('0x19')]+')\x20'+parseOperator(_0x56e970['operator']);}else{_0x48265a[_0x02bd('0x1a')]=_0x464c49+'.'+_0x56e970['field']+'\x20'+parseOperator(_0x56e970[_0x02bd('0x10')]);}if(_[_0x02bd('0x1c')]([_0x02bd('0x1d'),'$notIn'],_0x56e970[_0x02bd('0x10')]))_0x48265a[_0x02bd('0x1a')]='('+_0x48265a[_0x02bd('0x1a')]+_0x02bd('0x1e')+_0x464c49+'.'+_0x56e970[_0x02bd('0x1f')]+_0x02bd('0x20');_0x48265a[_0x02bd('0x12')]=parseValue(_0x4d42ea,_0x56e970[_0x02bd('0x10')],_0x56e970[_0x02bd('0x12')]);return _0x48265a;};function parseOperator(_0x56424f){var _0x232f1b;switch(_0x56424f){case'$in':_0x232f1b=_0x02bd('0x21');break;case _0x02bd('0x22'):_0x232f1b=_0x02bd('0x23');break;case'$eq':_0x232f1b=_0x02bd('0x24');break;case _0x02bd('0x1d'):_0x232f1b=_0x02bd('0x25');break;case'$substring':case _0x02bd('0x26'):case _0x02bd('0x27'):_0x232f1b=_0x02bd('0x28');break;case _0x02bd('0x29'):_0x232f1b=_0x02bd('0x2a');break;case _0x02bd('0x13'):_0x232f1b=_0x02bd('0x2b');break;case'$lte':_0x232f1b='<=\x20?';break;case _0x02bd('0x2c'):_0x232f1b=_0x02bd('0x2d');break;case _0x02bd('0x11'):_0x232f1b=_0x02bd('0x2e');break;}return _0x232f1b;}function parseValue(_0x4646d9,_0x5a7da1,_0x28163e){var _0x288378={'start':undefined,'end':undefined};switch(_0x5a7da1){case _0x02bd('0x2f'):case'$notIn':_0x288378[_0x02bd('0x30')]=_0x28163e['split'](',');break;case _0x02bd('0x31'):_0x288378[_0x02bd('0x30')]='%'+_0x28163e+'%';break;case _0x02bd('0x26'):_0x288378[_0x02bd('0x30')]=_0x28163e+'%';break;case _0x02bd('0x27'):_0x288378['start']='%'+_0x28163e;break;case'$between':var _0x174358=_0x28163e[_0x02bd('0x7')](',');var _0x28163e=_0x174358[_0x02bd('0x32')]();var _0x3dada2=_0x174358[_0x02bd('0x33')]();if(_0x4646d9===_0x02bd('0xf')){_0x28163e=moment(_0x28163e)[_0x02bd('0x34')](0x0,!![])['format']();_0x3dada2=moment(_0x3dada2)['utcOffset'](0x0,!![])[_0x02bd('0x15')](0x17,_0x02bd('0x35'))['add'](0x3b,_0x02bd('0x36'))['add'](0x3b,_0x02bd('0x37'))['format']();}_0x288378={'start':_0x28163e,'end':_0x3dada2};break;default:_0x288378['start']=_0x28163e;break;}return _0x288378;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 214e291..52ab892 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 _0xd67b=['attributes','nolimit','offset','sort','where','filter','object','columns','value','merge','lower','options','sequelize','includes','parse','keys','fields','split','filters','forOwn','find','type','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','format','$lte','subtract','name','isArray','limit','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','isEmpty','length','isString','unset','hasOwnProperty','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','push','getOptions','$id','query','model','intersection'];(function(_0x37d529,_0x13c20c){var _0x4d19ee=function(_0x156754){while(--_0x156754){_0x37d529['push'](_0x37d529['shift']());}};_0x4d19ee(++_0x13c20c);}(_0xd67b,0x133));var _0xbd67=function(_0x103697,_0x48be99){_0x103697=_0x103697-0x0;var _0x190e31=_0xd67b[_0x103697];return _0x190e31;};'use strict';var _=require('lodash');var sequelize=require(_0xbd67('0x0'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1da24d){var _0x280954=['ne'];try{var _0x317e33=JSON['parse'](_0x1da24d);var _0x40e384=Object['keys'](_0x317e33)[0x0];return _0x280954[_0xbd67('0x1')](_0x40e384);}catch(_0x5a827b){return![];}}function getOperatorValue(_0x309962){var _0xa5c384=JSON[_0xbd67('0x2')](_0x309962);var _0x27b016=Object[_0xbd67('0x3')](_0xa5c384)[0x0];var _0x72f9ac=_0xa5c384[_0x27b016];return{['$'+_0x27b016]:_0x72f9ac};}exports[_0xbd67('0x4')]=function(_0xfad775){var _0x1da7f1=null;if(_0xfad775){_0x1da7f1=_0xfad775[_0xbd67('0x5')](',');}return _0x1da7f1;};exports[_0xbd67('0x6')]=function(_0x3a7f43,_0x283f2f){var _0x52b981={};if(!_['isEmpty'](_0x3a7f43)){_[_0xbd67('0x7')](_0x3a7f43,function(_0x5aad7a,_0x388d95){try{if(_0x283f2f){var _0xb6b4b5=_[_0xbd67('0x8')](_0x283f2f,{'name':_0x388d95})||{};if(hasSequelizeOperator(_0x5aad7a)){_0x52b981[_0x388d95]=getOperatorValue(_0x5aad7a);}else if(_0xb6b4b5[_0xbd67('0x9')]===_0xbd67('0xa')&&_[_0xbd67('0xb')](_0x5aad7a)){var _0x3621ad=JSON[_0xbd67('0x2')](_0x5aad7a);var _0x341b2b={'$gte':moment(moment(_0x3621ad[_0xbd67('0xc')])['format'](_0xbd67('0xd')))[_0xbd67('0xe')]()[_0xbd67('0xf')](),'$lte':moment(moment(_0x3621ad[_0xbd67('0x10')])[_0xbd67('0xf')](_0xbd67('0xd')))[_0xbd67('0xe')]()[_0xbd67('0x11')](0x1,'s')[_0xbd67('0xf')]()};_0x52b981[_0x388d95]=_0x341b2b;}else if(_0xb6b4b5[_0xbd67('0x12')]==='uniqueid'){_0x52b981[_0x388d95]=_0x5aad7a;}else{_0x52b981[_0x388d95]=_['isArray'](_0x5aad7a)?_0x5aad7a:JSON[_0xbd67('0x2')](_0x5aad7a);}}else{_0x52b981[_0x388d95]=_[_0xbd67('0x13')](_0x5aad7a)?_0x5aad7a:JSON[_0xbd67('0x2')](_0x5aad7a);}}catch(_0x47d066){_0x52b981[_0x388d95]=_0x5aad7a[_0xbd67('0x5')](',');}});}return _0x52b981;};exports[_0xbd67('0x14')]=function(_0x357ff2){_0x357ff2=parseInt(_0x357ff2,0xa);if(!_0x357ff2||_0x357ff2<0x0){_0x357ff2=LIMIT_VALUE;}return _0x357ff2;};exports['offset']=function(_0x5906a2){_0x5906a2=parseInt(_0x5906a2,0xa);if(!_0x5906a2||_0x5906a2<0x0){_0x5906a2=0x0;}return _0x5906a2;};exports['sort']=function(_0x1f9193){var _0x4609b7,_0xb3f67f=null;if(_0x1f9193){_0x4609b7=_0x1f9193['split'](',');_0xb3f67f=_[_0xbd67('0x15')](_0x4609b7,function(_0x40ec96){if(_0x40ec96[_0xbd67('0x16')]('-')===0x0){return[_0x40ec96===_0xbd67('0x17')?sequelize[_0xbd67('0x18')](sequelize[_0xbd67('0x19')]('priority'),_0xbd67('0x1a')):_0x40ec96[_0xbd67('0x1b')](0x1),_0xbd67('0x1c')];}else{return[_0x40ec96===_0xbd67('0x17')?sequelize[_0xbd67('0x18')](sequelize[_0xbd67('0x19')](_0xbd67('0x17')),_0xbd67('0x1a')):_0x40ec96,_0xbd67('0x1d')];}});}return _0xb3f67f;};exports[_0xbd67('0x1e')]=function(_0x46b7ff,_0x57602d){if(_[_0xbd67('0x1f')](_0x46b7ff)){return _0x46b7ff;}if(_['isArray'](_0x46b7ff)){for(var _0x25bf7a=0x0;_0x25bf7a<_0x46b7ff[_0xbd67('0x20')];_0x25bf7a+=0x1){_0x46b7ff[_0x25bf7a]=this[_0xbd67('0x1e')](_0x46b7ff[_0x25bf7a],_0x57602d);}return _0x46b7ff;}if(!_['isObject'](_0x46b7ff)){return _0x46b7ff;}if(_[_0xbd67('0x21')](_0x57602d)){_0x57602d=[_0x57602d];}if(!_[_0xbd67('0x13')](_0x57602d)){return _0x46b7ff;}for(var _0x4dfa19=0x0;_0x4dfa19<_0x57602d[_0xbd67('0x20')];_0x4dfa19+=0x1){_[_0xbd67('0x22')](_0x46b7ff,_0x57602d[_0x4dfa19]);}for(var _0x374f1b in _0x46b7ff){if(_0x46b7ff[_0xbd67('0x23')](_0x374f1b)){_0x46b7ff[_0x374f1b]=this[_0xbd67('0x1e')](_0x46b7ff[_0x374f1b],_0x57602d);}}return _0x46b7ff;};exports['isNumeric']=function(_0x5975dc){return _0x5975dc[_0xbd67('0x24')](RegExp(_0xbd67('0x25')))?!![]:![];};exports[_0xbd67('0x26')]=function(_0x44eced){return _0x44eced[_0xbd67('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0xbd67('0x27')]=function(_0x256137){var _0x2e123e=[];_0x256137[_0xbd67('0x5')](/[ ,]+/)[_0xbd67('0x28')](function(_0x5cb0ce){_0x5cb0ce=_0x5cb0ce['replace'](/([^:]")"+/g,'$1');_0x5cb0ce='+'+_0x5cb0ce+'*';var _0x5fcae8=/[ `!@#$%^&*()_\-?~]/;if(_0x5cb0ce[_0xbd67('0x24')](_0x5fcae8))_0x5cb0ce='\x22'+_0x5cb0ce+'\x22';_0x2e123e[_0xbd67('0x29')](_0x5cb0ce);});return _0x2e123e['join']('\x20');};exports[_0xbd67('0x2a')]=function(_0x15da85,_0xb3f593,_0x484989){var _0x4d1ce3={},_0x5186eb={};if(_0xb3f593['query'][_0xbd67('0x2b')]){_0xb3f593[_0xbd67('0x2c')]['id']=_0xb3f593[_0xbd67('0x2c')]['$id'];delete _0xb3f593['query'][_0xbd67('0x2b')];}_0x4d1ce3[_0xbd67('0x2d')]=_[_0xbd67('0x15')](_0x15da85,_0xbd67('0x12'));_0x4d1ce3[_0xbd67('0x2c')]=_[_0xbd67('0x3')](_0xb3f593['query']);_0x4d1ce3[_0xbd67('0x6')]=_[_0xbd67('0x2e')](_0x4d1ce3[_0xbd67('0x2d')],_0x4d1ce3['query']);_0x5186eb[_0xbd67('0x2f')]=_['intersection'](_0x4d1ce3[_0xbd67('0x2d')],this[_0xbd67('0x4')](_0xb3f593['query'][_0xbd67('0x4')]));_0x5186eb[_0xbd67('0x2f')]=_0x5186eb[_0xbd67('0x2f')][_0xbd67('0x20')]?_0x5186eb[_0xbd67('0x2f')]:_0x4d1ce3[_0xbd67('0x2d')];if(!_0xb3f593['query'][_0xbd67('0x23')](_0xbd67('0x30'))){_0x5186eb[_0xbd67('0x14')]=this[_0xbd67('0x14')](_0xb3f593[_0xbd67('0x2c')]['limit']);_0x5186eb['offset']=this[_0xbd67('0x31')](_0xb3f593[_0xbd67('0x2c')][_0xbd67('0x31')]);}_0x5186eb['order']=this[_0xbd67('0x32')](_0xb3f593[_0xbd67('0x2c')][_0xbd67('0x32')]);_0x5186eb[_0xbd67('0x33')]=this['filters'](_['pick'](_0xb3f593['query'],_0x4d1ce3['filters']),_0x15da85);if(_0xb3f593['query'][_0xbd67('0x34')]){var _0x5a6b2d=_0x15da85;var _0x4d08a6=_0xb3f593['query'][_0xbd67('0x34')];if(typeof _0x4d08a6===_0xbd67('0x35')){_0x5a6b2d=_[_0xbd67('0x34')](_0x15da85,function(_0x2ca134){return _['includes'](_0x4d08a6[_0xbd67('0x36')],_0x2ca134[_0xbd67('0x12')]);});_0x4d08a6=_0x4d08a6[_0xbd67('0x37')];}_0x5186eb[_0xbd67('0x33')]=_[_0xbd67('0x38')](_0x5186eb[_0xbd67('0x33')],{'$or':_[_0xbd67('0x15')](_0x5a6b2d,function(_0x532c9b){if(_0x532c9b[_0xbd67('0x9')]!=='VIRTUAL'){if(_0x484989){return sequelize[_0xbd67('0x33')](sequelize['fn'](_0xbd67('0x39'),sequelize[_0xbd67('0x19')](_0x532c9b[_0xbd67('0x12')])),{'$like':sequelize['fn'](_0xbd67('0x39'),'%'+_0xb3f593[_0xbd67('0x2c')][_0xbd67('0x34')]+'%')});}else{var _0xfe170b={};_0xfe170b[_0x532c9b['name']]={'$like':'%'+_0xb3f593[_0xbd67('0x2c')][_0xbd67('0x34')]+'%'};return _0xfe170b;}}})});}_0x5186eb=_['merge']({},_0x5186eb,_0xb3f593[_0xbd67('0x3a')]);return _0x5186eb;}; \ No newline at end of file +var _0x1b20=['sort','map','indexOf','priority','cast','unsigned','substr','DESC','col','ASC','omit','length','isObject','isString','unset','match','^[+]?[0-9]*$','getFullTextValue','forEach','replace','join','getOptions','$id','query','model','name','attributes','intersection','fields','nolimit','limit','order','pick','object','filter','columns','value','where','VIRTUAL','lower','merge','options','sequelize','moment','parse','keys','includes','split','filters','isEmpty','forOwn','type','isPlainObject','format','YYYY-MM-DD','utc','$lte','subtract','isArray','offset'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x1b20,0x66));var _0x01b2=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1b20[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var sequelize=require(_0x01b2('0x0'));var moment=require(_0x01b2('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4a27f9){var _0x54eccf=['ne'];try{var _0x27a406=JSON[_0x01b2('0x2')](_0x4a27f9);var _0x2d6e99=Object[_0x01b2('0x3')](_0x27a406)[0x0];return _0x54eccf[_0x01b2('0x4')](_0x2d6e99);}catch(_0x365550){return![];}}function getOperatorValue(_0x419c17){var _0x28de4a=JSON[_0x01b2('0x2')](_0x419c17);var _0xa64ad1=Object[_0x01b2('0x3')](_0x28de4a)[0x0];var _0x323470=_0x28de4a[_0xa64ad1];return{['$'+_0xa64ad1]:_0x323470};}exports['fields']=function(_0x132a08){var _0x591ec0=null;if(_0x132a08){_0x591ec0=_0x132a08[_0x01b2('0x5')](',');}return _0x591ec0;};exports[_0x01b2('0x6')]=function(_0x3bad99,_0x3338f6){var _0x9c411f={};if(!_[_0x01b2('0x7')](_0x3bad99)){_[_0x01b2('0x8')](_0x3bad99,function(_0x22319b,_0x55804c){try{if(_0x3338f6){var _0x3c0044=_['find'](_0x3338f6,{'name':_0x55804c})||{};if(hasSequelizeOperator(_0x22319b)){_0x9c411f[_0x55804c]=getOperatorValue(_0x22319b);}else if(_0x3c0044[_0x01b2('0x9')]==='DATE'&&_[_0x01b2('0xa')](_0x22319b)){var _0x8ac569=JSON[_0x01b2('0x2')](_0x22319b);var _0x5ed1e2={'$gte':moment(moment(_0x8ac569['$gte'])[_0x01b2('0xb')](_0x01b2('0xc')))[_0x01b2('0xd')]()[_0x01b2('0xb')](),'$lte':moment(moment(_0x8ac569[_0x01b2('0xe')])['format'](_0x01b2('0xc')))[_0x01b2('0xd')]()[_0x01b2('0xf')](0x1,'s')[_0x01b2('0xb')]()};_0x9c411f[_0x55804c]=_0x5ed1e2;}else if(_0x3c0044['name']==='uniqueid'){_0x9c411f[_0x55804c]=_0x22319b;}else{_0x9c411f[_0x55804c]=_[_0x01b2('0x10')](_0x22319b)?_0x22319b:JSON[_0x01b2('0x2')](_0x22319b);}}else{_0x9c411f[_0x55804c]=_['isArray'](_0x22319b)?_0x22319b:JSON[_0x01b2('0x2')](_0x22319b);}}catch(_0x444236){_0x9c411f[_0x55804c]=_0x22319b[_0x01b2('0x5')](',');}});}return _0x9c411f;};exports['limit']=function(_0x25c55f){_0x25c55f=parseInt(_0x25c55f,0xa);if(!_0x25c55f||_0x25c55f<0x0){_0x25c55f=LIMIT_VALUE;}return _0x25c55f;};exports[_0x01b2('0x11')]=function(_0x38c4c8){_0x38c4c8=parseInt(_0x38c4c8,0xa);if(!_0x38c4c8||_0x38c4c8<0x0){_0x38c4c8=0x0;}return _0x38c4c8;};exports[_0x01b2('0x12')]=function(_0x1391f5){var _0x56ea3c,_0xfbd5db=null;if(_0x1391f5){_0x56ea3c=_0x1391f5['split'](',');_0xfbd5db=_[_0x01b2('0x13')](_0x56ea3c,function(_0x4c0008){if(_0x4c0008[_0x01b2('0x14')]('-')===0x0){return[_0x4c0008===_0x01b2('0x15')?sequelize[_0x01b2('0x16')](sequelize['col'](_0x01b2('0x15')),_0x01b2('0x17')):_0x4c0008[_0x01b2('0x18')](0x1),_0x01b2('0x19')];}else{return[_0x4c0008===_0x01b2('0x15')?sequelize['cast'](sequelize[_0x01b2('0x1a')]('priority'),'unsigned'):_0x4c0008,_0x01b2('0x1b')];}});}return _0xfbd5db;};exports[_0x01b2('0x1c')]=function(_0x3fcb69,_0x1d2e56){if(_[_0x01b2('0x7')](_0x3fcb69)){return _0x3fcb69;}if(_[_0x01b2('0x10')](_0x3fcb69)){for(var _0x4920f7=0x0;_0x4920f7<_0x3fcb69[_0x01b2('0x1d')];_0x4920f7+=0x1){_0x3fcb69[_0x4920f7]=this[_0x01b2('0x1c')](_0x3fcb69[_0x4920f7],_0x1d2e56);}return _0x3fcb69;}if(!_[_0x01b2('0x1e')](_0x3fcb69)){return _0x3fcb69;}if(_[_0x01b2('0x1f')](_0x1d2e56)){_0x1d2e56=[_0x1d2e56];}if(!_['isArray'](_0x1d2e56)){return _0x3fcb69;}for(var _0x45290e=0x0;_0x45290e<_0x1d2e56['length'];_0x45290e+=0x1){_[_0x01b2('0x20')](_0x3fcb69,_0x1d2e56[_0x45290e]);}for(var _0x1e6ac2 in _0x3fcb69){if(_0x3fcb69['hasOwnProperty'](_0x1e6ac2)){_0x3fcb69[_0x1e6ac2]=this[_0x01b2('0x1c')](_0x3fcb69[_0x1e6ac2],_0x1d2e56);}}return _0x3fcb69;};exports['isNumeric']=function(_0x487c49){return _0x487c49[_0x01b2('0x21')](RegExp(_0x01b2('0x22')))?!![]:![];};exports['isEmail']=function(_0x24ed7d){return _0x24ed7d[_0x01b2('0x21')](/^\S+@\S+$/)?!![]:![];};exports[_0x01b2('0x23')]=function(_0x2cf50f){var _0x3009a6=[];_0x2cf50f[_0x01b2('0x5')](/[ ,]+/)[_0x01b2('0x24')](function(_0x3169f5){_0x3169f5=_0x3169f5[_0x01b2('0x25')](/([^:]")"+/g,'$1');_0x3169f5='+'+_0x3169f5+'*';var _0x11d8e5=/[ `!@#$%^&*()_\-?~]/;if(_0x3169f5[_0x01b2('0x21')](_0x11d8e5))_0x3169f5='\x22'+_0x3169f5+'\x22';_0x3009a6['push'](_0x3169f5);});return _0x3009a6[_0x01b2('0x26')]('\x20');};exports[_0x01b2('0x27')]=function(_0x1c4ab5,_0x3081ed,_0x306666){var _0x11dd4e={},_0x582dd1={};if(_0x3081ed['query'][_0x01b2('0x28')]){_0x3081ed['query']['id']=_0x3081ed['query'][_0x01b2('0x28')];delete _0x3081ed[_0x01b2('0x29')][_0x01b2('0x28')];}_0x11dd4e[_0x01b2('0x2a')]=_['map'](_0x1c4ab5,_0x01b2('0x2b'));_0x11dd4e['query']=_[_0x01b2('0x3')](_0x3081ed['query']);_0x11dd4e['filters']=_['intersection'](_0x11dd4e[_0x01b2('0x2a')],_0x11dd4e[_0x01b2('0x29')]);_0x582dd1[_0x01b2('0x2c')]=_[_0x01b2('0x2d')](_0x11dd4e['model'],this[_0x01b2('0x2e')](_0x3081ed[_0x01b2('0x29')]['fields']));_0x582dd1[_0x01b2('0x2c')]=_0x582dd1[_0x01b2('0x2c')][_0x01b2('0x1d')]?_0x582dd1[_0x01b2('0x2c')]:_0x11dd4e[_0x01b2('0x2a')];if(!_0x3081ed[_0x01b2('0x29')]['hasOwnProperty'](_0x01b2('0x2f'))){_0x582dd1[_0x01b2('0x30')]=this['limit'](_0x3081ed['query'][_0x01b2('0x30')]);_0x582dd1[_0x01b2('0x11')]=this[_0x01b2('0x11')](_0x3081ed[_0x01b2('0x29')][_0x01b2('0x11')]);}_0x582dd1[_0x01b2('0x31')]=this['sort'](_0x3081ed['query'][_0x01b2('0x12')]);_0x582dd1['where']=this[_0x01b2('0x6')](_[_0x01b2('0x32')](_0x3081ed[_0x01b2('0x29')],_0x11dd4e[_0x01b2('0x6')]),_0x1c4ab5);if(_0x3081ed[_0x01b2('0x29')]['filter']){var _0x279ce0=_0x1c4ab5;var _0x183585=_0x3081ed[_0x01b2('0x29')]['filter'];if(typeof _0x183585===_0x01b2('0x33')){_0x279ce0=_[_0x01b2('0x34')](_0x1c4ab5,function(_0x28a0f4){return _['includes'](_0x183585[_0x01b2('0x35')],_0x28a0f4['name']);});_0x183585=_0x183585[_0x01b2('0x36')];}_0x582dd1[_0x01b2('0x37')]=_['merge'](_0x582dd1[_0x01b2('0x37')],{'$or':_[_0x01b2('0x13')](_0x279ce0,function(_0x4da4aa){if(_0x4da4aa[_0x01b2('0x9')]!==_0x01b2('0x38')){if(_0x306666){return sequelize[_0x01b2('0x37')](sequelize['fn'](_0x01b2('0x39'),sequelize[_0x01b2('0x1a')](_0x4da4aa['name'])),{'$like':sequelize['fn'](_0x01b2('0x39'),'%'+_0x3081ed[_0x01b2('0x29')][_0x01b2('0x34')]+'%')});}else{var _0x5d1b39={};_0x5d1b39[_0x4da4aa[_0x01b2('0x2b')]]={'$like':'%'+_0x3081ed[_0x01b2('0x29')][_0x01b2('0x34')]+'%'};return _0x5d1b39;}}})});}_0x582dd1=_[_0x01b2('0x3a')]({},_0x582dd1,_0x3081ed[_0x01b2('0x3b')]);return _0x582dd1;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 681ab5a..00ceff0 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 _0x1ce1=['map','uniq','value','includes','getAgentIdsByStatus','resolve','User','findAll','name','fullname','pauseType','getSortedAgentsIdsByStatus','globalStatus','order','startsWith','DESC','ASC','getUpdatedSortOptions','internal','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','mailStatus','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','screenrecording','phoneBarEnableAutomaticScreenRecording','lodash','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','pause','faxStatus','openchannelStatus','smsStatus','whatsappStatus','request','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','*pause','getAgentStatus','isArray','startCase','findOne','getAgents','all','flatten'];(function(_0x28c927,_0x20e448){var _0x3d9e52=function(_0x1e5526){while(--_0x1e5526){_0x28c927['push'](_0x28c927['shift']());}};_0x3d9e52(++_0x20e448);}(_0x1ce1,0x81));var _0x11ce=function(_0x458e0b,_0x1944a8){_0x458e0b=_0x458e0b-0x0;var _0x45edad=_0x1ce1[_0x458e0b];return _0x45edad;};'use strict';var _=require(_0x11ce('0x0'));var jayson=require('jayson/promise');var db=require(_0x11ce('0x1'))['db'];var amiClient=jayson[_0x11ce('0x2')][_0x11ce('0x3')]({'port':0x232a});var routingClient=jayson[_0x11ce('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x24c170,_0x8db765){var _0x4bf19f=[_0x24c170[_0x11ce('0x4')],_0x24c170[_0x11ce('0x5')],_0x24c170[_0x11ce('0x6')],_0x24c170[_0x11ce('0x7')],_0x24c170[_0x11ce('0x8')],_0x24c170[_0x11ce('0x9')],_0x24c170[_0x11ce('0xa')]];if(!_0x8db765)return _[_0x11ce('0xb')](_0x4bf19f);var _0x1dd949=_[_0x11ce('0xc')](_0x4bf19f);return _0x1dd949['length']>0x0&&_0x1dd949[_0x11ce('0xd')]<_0x4bf19f[_0x11ce('0xd')]?!![]:![];}function isIdle(_0x3ccbf4){return _0x3ccbf4===_0x11ce('0xe')||_0x3ccbf4===_0x11ce('0xf')||_0x3ccbf4===_0x11ce('0x10')||_0x3ccbf4===_0x11ce('0x11')||_[_0x11ce('0x12')](_0x3ccbf4);}function isAgentIdle(_0xc85fa8){if(_0xc85fa8[_0x11ce('0x13')]!=='idle'&&_0xc85fa8[_0x11ce('0x9')]){_0xc85fa8[_0x11ce('0x13')]=_0x11ce('0x14');return![];}return _['every']([_0xc85fa8['chatStatus'],_0xc85fa8[_0x11ce('0x15')],_0xc85fa8['mailStatus'],_0xc85fa8[_0x11ce('0x16')],_0xc85fa8[_0x11ce('0x17')],_0xc85fa8['voiceStatus'],_0xc85fa8[_0x11ce('0x18')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x11ce('0x19')]('Agents',{})[_0x11ce('0x1a')](function(_0x3d73ac){if(_0x3d73ac['error']){throw new Error(_0x11ce('0x1b'));}var _0x510705=_0x3d73ac['result'];return routingClient[_0x11ce('0x19')](_0x11ce('0x1c'),{})[_0x11ce('0x1a')](function(_0x182647){if(_0x182647['error']){throw new Error(_0x11ce('0x1d'));}var _0x13fd18=_0x182647['result'];return _[_0x11ce('0x1e')]({},_0x510705,_0x13fd18);});})[_0x11ce('0x1f')](function(_0x46d855){throw _0x46d855;});}exports[_0x11ce('0x20')]=getRealtimeAgents;function getAgentStatus(_0x598c0a){var _0x52af2b=_0x11ce('0xf');if(isAgentPaused(_0x598c0a))_0x52af2b=_0x11ce('0x14');else if(isAgentPaused(_0x598c0a,!![]))_0x52af2b=_0x11ce('0x21');else if(isAgentIdle(_0x598c0a))_0x52af2b=_0x11ce('0xe');else _0x52af2b='busy';return _0x52af2b;}exports[_0x11ce('0x22')]=getAgentStatus;function getAgentIdsByQueues(_0x1405c5,_0x2c7f37){var _0xccec94=_[_0x11ce('0x23')](_0x1405c5)?_0x1405c5:[_0x1405c5];var _0x50190e=_[_0x11ce('0x24')](_0x2c7f37)+'Queue';var _0x35bd3b=_['map'](_0xccec94,function(_0x2e6c57){return db[_0x50190e][_0x11ce('0x25')]({'where':{'id':_0x2e6c57}})[_0x11ce('0x1a')](function(_0xb80f56){if(!_0xb80f56)return[];return _0xb80f56[_0x11ce('0x26')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x11ce('0x27')](_0x35bd3b)[_0x11ce('0x1a')](function(_0x513b72){var _0x2f3989=_(_0x513b72)[_0x11ce('0x28')]()[_0x11ce('0x29')]('id')[_0x11ce('0x2a')]()[_0x11ce('0x2b')]();return _0x2f3989;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0xf33b5e,_0x5c8659,_0x147627){try{if(_0x5c8659[_0x11ce('0xd')]>0x0){_0xf33b5e=_0xf33b5e[_0x11ce('0xc')](function(_0x3a718f){return _0x5c8659[_0x11ce('0x2c')](_0x3a718f['id']);});}var _0x59b1ab=_0xf33b5e['filter'](function(_0xcc6db1){var _0xc3862f='busy';if(isAgentIdle(_0xcc6db1)){_0xc3862f=_0x11ce('0xe');}return _0xc3862f===_0x147627;});return _[_0x11ce('0x29')](_0x59b1ab,'id');}catch(_0x20d898){throw _0x20d898;}}exports[_0x11ce('0x2d')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x488cf8,_0x4fc2e2,_0xfc110f){return Promise[_0x11ce('0x2e')]()['then'](function(){if(_0x4fc2e2[_0x11ce('0xd')]>0x0){_0x488cf8=_0x488cf8[_0x11ce('0xc')](function(_0x2ae437){return _0x4fc2e2['includes'](_0x2ae437['id']);});}return _0x488cf8;})['then'](function(){return db[_0x11ce('0x2f')][_0x11ce('0x30')]({'attributes':['id',_0x11ce('0x31'),_0x11ce('0x32'),'chatPause',_0x11ce('0x5'),_0x11ce('0x6'),_0x11ce('0x7'),_0x11ce('0x8'),_0x11ce('0x9'),'whatsappPause',_0x11ce('0x33')],'where':{'id':{'$in':_[_0x11ce('0x29')](_0x488cf8,'id')}},'raw':!![]});})[_0x11ce('0x1a')](function(_0x351f1f){return _0x351f1f['map'](function(_0xf741e8){var _0x53bf9a=_['find'](_0x488cf8,['id',_0xf741e8['id']]);var _0x5e9333=filterAgentAttributes(_0x53bf9a);_[_0x11ce('0x1e')](_0xf741e8,_0x5e9333);_0xf741e8['globalStatus']=getAgentStatus(_0xf741e8);return _0xf741e8;});})['then'](function(_0x558258){var _0x5c0406=sortAgentsByStatus(_0x558258,_0xfc110f);return _[_0x11ce('0x29')](_0x5c0406,'id');})[_0x11ce('0x1f')](function(_0x4f1245){throw _0x4f1245;});}exports[_0x11ce('0x34')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x2f49bf){var _0x39d33e={'fields':[],'order':null};var _0x86adb=_0x2f49bf['split'](',');_0x39d33e['fields']=_[_0x11ce('0xc')](_0x86adb,function(_0x55d3a2){if(!_0x55d3a2[_0x11ce('0x2c')](_0x11ce('0x35'))){return!![];}_0x39d33e[_0x11ce('0x36')]=_[_0x11ce('0x37')](_0x55d3a2,'-')?_0x11ce('0x38'):_0x11ce('0x39');return![];});return _0x39d33e;}exports[_0x11ce('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0x58b922){if(_0x58b922[_0x11ce('0x2c')]('fullname')&&!_0x58b922['includes'](_0x11ce('0x3b'))){var _0x553f11=_0x58b922['substring'](0x0,_0x58b922['indexOf'](_0x11ce('0x32')));_0x58b922+=','+_0x553f11+_0x11ce('0x3b');}return _0x58b922;}exports[_0x11ce('0x3c')]=validateSortParameter;function sortAgentsByStatus(_0x4a706f,_0x1dee1a){var _0x1d7d25=_0x4a706f[_0x11ce('0x3d')](function(_0x397dec,_0x320708){if(_0x397dec[_0x11ce('0x35')]===_0x320708[_0x11ce('0x35')]){if(_0x397dec[_0x11ce('0x35')]===_0x11ce('0x14')){if(_0x1dee1a===_0x11ce('0x38')){return(_0x397dec[_0x11ce('0x33')]||'')<(_0x320708[_0x11ce('0x33')]||'')||_0x397dec[_0x11ce('0x32')][_0x11ce('0x3e')]()>_0x320708['fullname'][_0x11ce('0x3e')]()?0x1:-0x1;}else{return(_0x397dec[_0x11ce('0x33')]||'')<(_0x320708[_0x11ce('0x33')]||'')||_0x397dec[_0x11ce('0x32')]['toLowerCase']()>_0x320708['fullname'][_0x11ce('0x3e')]()?-0x1:0x1;}}else{if(_0x1dee1a==='DESC'){return _0x397dec[_0x11ce('0x32')][_0x11ce('0x3e')]()<_0x320708['fullname'][_0x11ce('0x3e')]()?0x1:-0x1;}else{return _0x397dec['fullname'][_0x11ce('0x3e')]()<_0x320708[_0x11ce('0x32')][_0x11ce('0x3e')]()?-0x1:0x1;}}}else{if(_0x1dee1a===_0x11ce('0x38')){return _0x397dec[_0x11ce('0x35')]<_0x320708[_0x11ce('0x35')]?0x1:-0x1;}else{return _0x397dec[_0x11ce('0x35')]<_0x320708[_0x11ce('0x35')]?-0x1:0x1;}}});return _0x1d7d25;}exports[_0x11ce('0x3f')]=sortAgentsByStatus;function filterAgentAttributes(_0x2239e4){var _0x5c4dad=[_0x11ce('0x40'),_0x11ce('0x41'),_0x11ce('0x42'),_0x11ce('0x43'),_0x11ce('0x33'),'lastPauseAt',_0x11ce('0x3b'),_0x11ce('0x44'),_0x11ce('0x4'),_0x11ce('0x7'),'mailPause',_0x11ce('0x8'),'whatsappPause',_0x11ce('0x5'),_0x11ce('0x9'),'chatCapacity','openchannelCapacity',_0x11ce('0x45'),_0x11ce('0x46'),_0x11ce('0x47'),_0x11ce('0x48'),'chatCurrentCapacity',_0x11ce('0x49'),'mailCurrentCapacity',_0x11ce('0x4a'),_0x11ce('0x4b'),_0x11ce('0x4c'),_0x11ce('0x4d'),_0x11ce('0x16'),_0x11ce('0x4e'),_0x11ce('0x17'),'whatsappStatus',_0x11ce('0x15'),'voiceStatus','chatStatusTime',_0x11ce('0x4f'),'mailStatusTime',_0x11ce('0x50'),_0x11ce('0x51'),_0x11ce('0x52'),'voiceStatusTime','queue','destconnectedlinenum',_0x11ce('0x53'),'phoneBarEnableScreenRecordingByAgent',_0x11ce('0x54'),'routealias'];var _0x12f13b=['chatPause','openchannelPause',_0x11ce('0x6'),_0x11ce('0x8'),_0x11ce('0xa'),'faxPause',_0x11ce('0x9'),'online'];var _0x3ba5ec=_(_0x2239e4)['omit'](_0x12f13b)['pick'](_0x5c4dad)['value']();return _0x3ba5ec;}exports['filterAgentAttributes']=filterAgentAttributes; \ No newline at end of file +var _0xac78=['lastLoginAt','lastPauseAt','chatPause','faxPause','openchannelCapacity','mailCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','whatsappStatus','faxStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','screenrecording','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','filterAgentAttributes','lodash','client','http','mailPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','voiceStatus','pause','openchannelStatus','smsStatus','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','busy','getAgentStatus','startCase','Queue','getAgents','all','flatten','value','getAgentIdsByQueues','map','getAgentIdsByStatus','resolve','includes','User','findAll','name','fullname','openchannelPause','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','internal','indexOf','sort','toLowerCase','sortAgentsByStatus','userpic','online'];(function(_0x5c1c6e,_0x438317){var _0x223e16=function(_0x5c87b0){while(--_0x5c87b0){_0x5c1c6e['push'](_0x5c1c6e['shift']());}};_0x223e16(++_0x438317);}(_0xac78,0xcf));var _0x8ac7=function(_0x3ed3d1,_0x397ef8){_0x3ed3d1=_0x3ed3d1-0x0;var _0x31d0c=_0xac78[_0x3ed3d1];return _0x31d0c;};'use strict';var _=require(_0x8ac7('0x0'));var jayson=require('jayson/promise');var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x8ac7('0x1')][_0x8ac7('0x2')]({'port':0x232a});var routingClient=jayson[_0x8ac7('0x1')][_0x8ac7('0x2')]({'port':0x232c});function isAgentPaused(_0x3ce98c,_0x2d9a8b){var _0x1d396d=[_0x3ce98c['chatPause'],_0x3ce98c['faxPause'],_0x3ce98c[_0x8ac7('0x3')],_0x3ce98c['openchannelPause'],_0x3ce98c[_0x8ac7('0x4')],_0x3ce98c[_0x8ac7('0x5')],_0x3ce98c[_0x8ac7('0x6')]];if(!_0x2d9a8b)return _[_0x8ac7('0x7')](_0x1d396d);var _0x34459a=_[_0x8ac7('0x8')](_0x1d396d);return _0x34459a[_0x8ac7('0x9')]>0x0&&_0x34459a[_0x8ac7('0x9')]<_0x1d396d[_0x8ac7('0x9')]?!![]:![];}function isIdle(_0x42eecb){return _0x42eecb===_0x8ac7('0xa')||_0x42eecb===_0x8ac7('0xb')||_0x42eecb===_0x8ac7('0xc')||_0x42eecb==='ringing'||_['isNil'](_0x42eecb);}function isAgentIdle(_0x24a427){if(_0x24a427[_0x8ac7('0xd')]!==_0x8ac7('0xa')&&_0x24a427[_0x8ac7('0x5')]){_0x24a427[_0x8ac7('0xd')]=_0x8ac7('0xe');return![];}return _[_0x8ac7('0x7')]([_0x24a427['chatStatus'],_0x24a427['faxStatus'],_0x24a427['mailStatus'],_0x24a427[_0x8ac7('0xf')],_0x24a427[_0x8ac7('0x10')],_0x24a427['voiceStatus'],_0x24a427['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient['request']('Agents',{})[_0x8ac7('0x11')](function(_0x20e95b){if(_0x20e95b[_0x8ac7('0x12')]){throw new Error(_0x8ac7('0x13'));}var _0x15f654=_0x20e95b[_0x8ac7('0x14')];return routingClient[_0x8ac7('0x15')](_0x8ac7('0x16'),{})[_0x8ac7('0x11')](function(_0x3724ab){if(_0x3724ab[_0x8ac7('0x12')]){throw new Error(_0x8ac7('0x17'));}var _0x350f95=_0x3724ab[_0x8ac7('0x14')];return _[_0x8ac7('0x18')]({},_0x15f654,_0x350f95);});})[_0x8ac7('0x19')](function(_0x572248){throw _0x572248;});}exports[_0x8ac7('0x1a')]=getRealtimeAgents;function getAgentStatus(_0x111516){var _0x50f4db=_0x8ac7('0xb');if(isAgentPaused(_0x111516))_0x50f4db=_0x8ac7('0xe');else if(isAgentPaused(_0x111516,!![]))_0x50f4db='*pause';else if(isAgentIdle(_0x111516))_0x50f4db=_0x8ac7('0xa');else _0x50f4db=_0x8ac7('0x1b');return _0x50f4db;}exports[_0x8ac7('0x1c')]=getAgentStatus;function getAgentIdsByQueues(_0x34210e,_0x43f79e){var _0x56d3b5=_['isArray'](_0x34210e)?_0x34210e:[_0x34210e];var _0x3d4fbc=_[_0x8ac7('0x1d')](_0x43f79e)+_0x8ac7('0x1e');var _0x3452c7=_['map'](_0x56d3b5,function(_0x34630a){return db[_0x3d4fbc]['findOne']({'where':{'id':_0x34630a}})['then'](function(_0x1b1191){if(!_0x1b1191)return[];return _0x1b1191[_0x8ac7('0x1f')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x8ac7('0x20')](_0x3452c7)['then'](function(_0x3f9464){var _0x3056ec=_(_0x3f9464)[_0x8ac7('0x21')]()['map']('id')['uniq']()[_0x8ac7('0x22')]();return _0x3056ec;});}exports[_0x8ac7('0x23')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x1e785b,_0x220b0b,_0x3e3dbd){try{if(_0x220b0b[_0x8ac7('0x9')]>0x0){_0x1e785b=_0x1e785b[_0x8ac7('0x8')](function(_0x4d0f41){return _0x220b0b['includes'](_0x4d0f41['id']);});}var _0xeb54e5=_0x1e785b[_0x8ac7('0x8')](function(_0x39f163){var _0x4b2d2b=_0x8ac7('0x1b');if(isAgentIdle(_0x39f163)){_0x4b2d2b=_0x8ac7('0xa');}return _0x4b2d2b===_0x3e3dbd;});return _[_0x8ac7('0x24')](_0xeb54e5,'id');}catch(_0x276fe5){throw _0x276fe5;}}exports[_0x8ac7('0x25')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x3934dc,_0x4987fe,_0xba9b69){return Promise[_0x8ac7('0x26')]()[_0x8ac7('0x11')](function(){if(_0x4987fe[_0x8ac7('0x9')]>0x0){_0x3934dc=_0x3934dc[_0x8ac7('0x8')](function(_0x310992){return _0x4987fe[_0x8ac7('0x27')](_0x310992['id']);});}return _0x3934dc;})[_0x8ac7('0x11')](function(){return db[_0x8ac7('0x28')][_0x8ac7('0x29')]({'attributes':['id',_0x8ac7('0x2a'),_0x8ac7('0x2b'),'chatPause','faxPause','mailPause',_0x8ac7('0x2c'),_0x8ac7('0x4'),_0x8ac7('0x5'),_0x8ac7('0x6'),_0x8ac7('0x2d')],'where':{'id':{'$in':_[_0x8ac7('0x24')](_0x3934dc,'id')}},'raw':!![]});})[_0x8ac7('0x11')](function(_0x60cf33){return _0x60cf33[_0x8ac7('0x24')](function(_0xe65338){var _0x5e7834=_[_0x8ac7('0x2e')](_0x3934dc,['id',_0xe65338['id']]);var _0x39ad3b=filterAgentAttributes(_0x5e7834);_['merge'](_0xe65338,_0x39ad3b);_0xe65338[_0x8ac7('0x2f')]=getAgentStatus(_0xe65338);return _0xe65338;});})[_0x8ac7('0x11')](function(_0x2d714f){var _0x266614=sortAgentsByStatus(_0x2d714f,_0xba9b69);return _[_0x8ac7('0x24')](_0x266614,'id');})[_0x8ac7('0x19')](function(_0x1e44b7){throw _0x1e44b7;});}exports[_0x8ac7('0x30')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x48c3cb){var _0x3454dd={'fields':[],'order':null};var _0x4959e4=_0x48c3cb[_0x8ac7('0x31')](',');_0x3454dd[_0x8ac7('0x32')]=_[_0x8ac7('0x8')](_0x4959e4,function(_0x5ef462){if(!_0x5ef462[_0x8ac7('0x27')](_0x8ac7('0x2f'))){return!![];}_0x3454dd[_0x8ac7('0x33')]=_[_0x8ac7('0x34')](_0x5ef462,'-')?_0x8ac7('0x35'):_0x8ac7('0x36');return![];});return _0x3454dd;}exports[_0x8ac7('0x37')]=getUpdatedSortOptions;function validateSortParameter(_0x4b9dfb){if(_0x4b9dfb[_0x8ac7('0x27')](_0x8ac7('0x2b'))&&!_0x4b9dfb[_0x8ac7('0x27')](_0x8ac7('0x38'))){var _0x311cdf=_0x4b9dfb['substring'](0x0,_0x4b9dfb[_0x8ac7('0x39')](_0x8ac7('0x2b')));_0x4b9dfb+=','+_0x311cdf+_0x8ac7('0x38');}return _0x4b9dfb;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0xbd3d2,_0x4050c9){var _0x3a8317=_0xbd3d2[_0x8ac7('0x3a')](function(_0x285140,_0x2bb076){if(_0x285140[_0x8ac7('0x2f')]===_0x2bb076[_0x8ac7('0x2f')]){if(_0x285140[_0x8ac7('0x2f')]===_0x8ac7('0xe')){if(_0x4050c9===_0x8ac7('0x35')){return(_0x285140[_0x8ac7('0x2d')]||'')<(_0x2bb076[_0x8ac7('0x2d')]||'')||_0x285140['fullname'][_0x8ac7('0x3b')]()>_0x2bb076[_0x8ac7('0x2b')][_0x8ac7('0x3b')]()?0x1:-0x1;}else{return(_0x285140['pauseType']||'')<(_0x2bb076[_0x8ac7('0x2d')]||'')||_0x285140[_0x8ac7('0x2b')][_0x8ac7('0x3b')]()>_0x2bb076[_0x8ac7('0x2b')][_0x8ac7('0x3b')]()?-0x1:0x1;}}else{if(_0x4050c9===_0x8ac7('0x35')){return _0x285140['fullname']['toLowerCase']()<_0x2bb076[_0x8ac7('0x2b')][_0x8ac7('0x3b')]()?0x1:-0x1;}else{return _0x285140[_0x8ac7('0x2b')]['toLowerCase']()<_0x2bb076[_0x8ac7('0x2b')][_0x8ac7('0x3b')]()?-0x1:0x1;}}}else{if(_0x4050c9===_0x8ac7('0x35')){return _0x285140[_0x8ac7('0x2f')]<_0x2bb076[_0x8ac7('0x2f')]?0x1:-0x1;}else{return _0x285140[_0x8ac7('0x2f')]<_0x2bb076[_0x8ac7('0x2f')]?-0x1:0x1;}}});return _0x3a8317;}exports[_0x8ac7('0x3c')]=sortAgentsByStatus;function filterAgentAttributes(_0x1cfa1f){var _0x439f88=[_0x8ac7('0x3d'),_0x8ac7('0x3e'),_0x8ac7('0x3f'),_0x8ac7('0x40'),_0x8ac7('0x2d'),_0x8ac7('0x40'),_0x8ac7('0x38'),'address',_0x8ac7('0x41'),_0x8ac7('0x2c'),'mailPause',_0x8ac7('0x4'),_0x8ac7('0x6'),_0x8ac7('0x42'),_0x8ac7('0x5'),'chatCapacity',_0x8ac7('0x43'),_0x8ac7('0x44'),'smsCapacity','whatsappCapacity',_0x8ac7('0x45'),'chatCurrentCapacity',_0x8ac7('0x46'),_0x8ac7('0x47'),'smsCurrentCapacity',_0x8ac7('0x48'),_0x8ac7('0x49'),'chatStatus','openchannelStatus',_0x8ac7('0x4a'),_0x8ac7('0x10'),_0x8ac7('0x4b'),_0x8ac7('0x4c'),_0x8ac7('0xd'),_0x8ac7('0x4d'),_0x8ac7('0x4e'),_0x8ac7('0x4f'),_0x8ac7('0x50'),_0x8ac7('0x51'),_0x8ac7('0x52'),_0x8ac7('0x53'),'queue','destconnectedlinenum',_0x8ac7('0x54'),'phoneBarEnableScreenRecordingByAgent',_0x8ac7('0x55'),_0x8ac7('0x56')];var _0x547b6a=[_0x8ac7('0x41'),_0x8ac7('0x2c'),'mailPause',_0x8ac7('0x4'),_0x8ac7('0x6'),_0x8ac7('0x42'),_0x8ac7('0x5'),'online'];var _0xcb88ff=_(_0x1cfa1f)[_0x8ac7('0x57')](_0x547b6a)[_0x8ac7('0x58')](_0x439f88)[_0x8ac7('0x22')]();return _0xcb88ff;}exports[_0x8ac7('0x59')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 31ab922..00ae722 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x592e=['erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','inbound','concat','map','get','available','waiting','outbound','merge','pick','initializeQueues','lodash','client','http','loggedIn','paused','busy','inUse','invalid','loggedInDb','notInUse','onHold','ringing','ringInUse','unavailable','unknown','pTalking','originated','message','statusMessage','Trunk','startProgressive','erlangCalls'];(function(_0x32832c,_0x24a45a){var _0x47e377=function(_0x2e1bab){while(--_0x2e1bab){_0x32832c['push'](_0x32832c['shift']());}};_0x47e377(++_0x24a45a);}(_0x592e,0x17a));var _0xe592=function(_0x190da7,_0x343c35){_0x190da7=_0x190da7-0x0;var _0x371875=_0x592e[_0x190da7];return _0x371875;};'use strict';var _=require(_0xe592('0x0'));var jayson=require('jayson/promise');var util=require('util');var amiClient=jayson[_0xe592('0x1')][_0xe592('0x2')]({'port':0x232a});var routingClient=jayson[_0xe592('0x1')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available',_0xe592('0x3'),_0xe592('0x4'),'waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0xe592('0x5'),_0xe592('0x6'),_0xe592('0x7'),_0xe592('0x8'),_0xe592('0x9'),_0xe592('0xa'),_0xe592('0xb'),_0xe592('0xc'),'talking',_0xe592('0xd'),_0xe592('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xe592('0xf'),_0xe592('0x10'),_0xe592('0x11'),_0xe592('0x12'),'dialActive','dialMethod',_0xe592('0x13'),'startPredictive',_0xe592('0x14'),_0xe592('0x15'),_0xe592('0x16'),_0xe592('0x17'),_0xe592('0x18'),_0xe592('0x19'),'dialPredictiveIntervalMaxThreshold',_0xe592('0x1a'),_0xe592('0x1b'),_0xe592('0x1c'),_0xe592('0x1d'),_0xe592('0x1e'),_0xe592('0x1f'),_0xe592('0x20'),_0xe592('0x21')];function getRealtimeQueues(_0xcfbfd3,_0x15d760){var _0x2bbc84=_0x15d760===_0xe592('0x22')?amiClient:routingClient;return _0x2bbc84[_0xe592('0x23')](_['startCase'](_0x15d760)+'Queues',_0xcfbfd3)['then'](function(_0x18fcb2){if(_0x18fcb2['error'])throw new Error(util[_0xe592('0x24')](_0xe592('0x25'),_0x15d760));return _0x18fcb2[_0xe592('0x26')];})['catch'](function(_0x416e41){throw _0x416e41;});}exports[_0xe592('0x27')]=getRealtimeQueues;function initializeQueues(_0x1759eb,_0x49d513,_0x18c864,_0x3ffe46){var _0xa4b4e=DEFAULT_QUEUE_ATTRIBUTES;if(_0x18c864===_0xe592('0x22')){if(_0x3ffe46===_0xe592('0x28')){_0xa4b4e=_0xa4b4e[_0xe592('0x29')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x3ffe46==='outbound'){_0xa4b4e=_0xa4b4e[_0xe592('0x29')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x1759eb[_0xe592('0x2a')](function(_0x2b382a){var _0xd4a3be=_0x2b382a[_0xe592('0x2b')]({'plain':!![]});_0xd4a3be[_0xe592('0x4')]=0x0;_0xd4a3be['loggedInDb']=0x0;_0xd4a3be['loggedIn']=0x0;_0xd4a3be[_0xe592('0x2c')]=0x0;_0xd4a3be[_0xe592('0x2d')]=0x0;if(_0x18c864===_0xe592('0x22')){_0xd4a3be['talking']=0x0;_0xd4a3be[_0xe592('0x5')]=0x0;if(_0x3ffe46===_0xe592('0x2e')){_0xd4a3be['pTalking']=0x0;_0xd4a3be[_0xe592('0x10')]=0x0;}}var _0x16e9ea=_['find'](_0x49d513,['id',_0xd4a3be['id']]);if(_0x16e9ea){_[_0xe592('0x2f')](_0xd4a3be,_[_0xe592('0x30')](_0x16e9ea,_0xa4b4e));}return _0xd4a3be;});}exports[_0xe592('0x31')]=initializeQueues; \ No newline at end of file +var _0xfcf1=['then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','outbound','map','get','loggedInDb','find','pick','lodash','jayson/promise','util','client','http','available','loggedIn','paused','waiting','invalid','notInUse','onHold','ringInUse','talking','unknown','pTalking','originated','message','statusMessage','dialActive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase'];(function(_0x576e2b,_0x328953){var _0x46461a=function(_0xce4d9e){while(--_0xce4d9e){_0x576e2b['push'](_0x576e2b['shift']());}};_0x46461a(++_0x328953);}(_0xfcf1,0x109));var _0x1fcf=function(_0x1a03e3,_0x384141){_0x1a03e3=_0x1a03e3-0x0;var _0x4238c5=_0xfcf1[_0x1a03e3];return _0x4238c5;};'use strict';var _=require(_0x1fcf('0x0'));var jayson=require(_0x1fcf('0x1'));var util=require(_0x1fcf('0x2'));var amiClient=jayson[_0x1fcf('0x3')]['http']({'port':0x232a});var routingClient=jayson[_0x1fcf('0x3')][_0x1fcf('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x1fcf('0x5'),_0x1fcf('0x6'),_0x1fcf('0x7'),_0x1fcf('0x8')];var VOICE_QUEUE_ATTRIBUTES=['busy','inUse',_0x1fcf('0x9'),'loggedInDb',_0x1fcf('0xa'),_0x1fcf('0xb'),'ringing',_0x1fcf('0xc'),_0x1fcf('0xd'),'unavailable',_0x1fcf('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x1fcf('0xf'),_0x1fcf('0x10'),_0x1fcf('0x11'),_0x1fcf('0x12'),_0x1fcf('0x13'),'dialMethod','Trunk','startPredictive','startProgressive',_0x1fcf('0x14'),'erlangCallToSecond',_0x1fcf('0x15'),_0x1fcf('0x16'),_0x1fcf('0x17'),_0x1fcf('0x18'),_0x1fcf('0x19'),_0x1fcf('0x1a'),'predictiveIntervalTotalCalls',_0x1fcf('0x1b'),_0x1fcf('0x1c'),_0x1fcf('0x1d'),_0x1fcf('0x1e'),_0x1fcf('0x1f')];function getRealtimeQueues(_0x4fe0ba,_0x55b96a){var _0x46d62e=_0x55b96a===_0x1fcf('0x20')?amiClient:routingClient;return _0x46d62e[_0x1fcf('0x21')](_[_0x1fcf('0x22')](_0x55b96a)+'Queues',_0x4fe0ba)[_0x1fcf('0x23')](function(_0xe74637){if(_0xe74637[_0x1fcf('0x24')])throw new Error(util[_0x1fcf('0x25')](_0x1fcf('0x26'),_0x55b96a));return _0xe74637[_0x1fcf('0x27')];})[_0x1fcf('0x28')](function(_0x26af2a){throw _0x26af2a;});}exports[_0x1fcf('0x29')]=getRealtimeQueues;function initializeQueues(_0x2ca311,_0x3939b4,_0x3935f2,_0x1e5649){var _0x483d43=DEFAULT_QUEUE_ATTRIBUTES;if(_0x3935f2===_0x1fcf('0x20')){if(_0x1e5649===_0x1fcf('0x2a')){_0x483d43=_0x483d43[_0x1fcf('0x2b')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x1e5649===_0x1fcf('0x2c')){_0x483d43=_0x483d43[_0x1fcf('0x2b')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x2ca311[_0x1fcf('0x2d')](function(_0x37a635){var _0x55c7c2=_0x37a635[_0x1fcf('0x2e')]({'plain':!![]});_0x55c7c2[_0x1fcf('0x7')]=0x0;_0x55c7c2[_0x1fcf('0x2f')]=0x0;_0x55c7c2[_0x1fcf('0x6')]=0x0;_0x55c7c2['available']=0x0;_0x55c7c2[_0x1fcf('0x8')]=0x0;if(_0x3935f2==='voice'){_0x55c7c2['talking']=0x0;_0x55c7c2['busy']=0x0;if(_0x1e5649==='outbound'){_0x55c7c2[_0x1fcf('0xf')]=0x0;_0x55c7c2[_0x1fcf('0x10')]=0x0;}}var _0x438d2e=_[_0x1fcf('0x30')](_0x3939b4,['id',_0x55c7c2['id']]);if(_0x438d2e){_['merge'](_0x55c7c2,_[_0x1fcf('0x31')](_0x438d2e,_0x483d43));}return _0x55c7c2;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 729b9dc..2dd7094 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(_0x21bfab,_0x2fee48){var _0x4db318=function(_0x10396d){while(--_0x10396d){_0x21bfab['push'](_0x21bfab['shift']());}};_0x4db318(++_0x2fee48);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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(_0x3f4579,_0x2d6f73){var _0x200f87=function(_0x3d41a2){while(--_0x3d41a2){_0x3f4579['push'](_0x3f4579['shift']());}};_0x200f87(++_0x2d6f73);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 5345d57..e3cb426 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 _0x4954=['lodash','crypto','bimedia-machine-uuid','../environment','networkInterfaces','keys','filter','family','internal','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','orderBy','cpus','map','model','join','createHash','md5','update','hex','platform','test','licenseToken','win32','utf8','replace','hostname','digest','substring'];(function(_0x352c08,_0x3c8fd8){var _0xebd1de=function(_0x197a71){while(--_0x197a71){_0x352c08['push'](_0x352c08['shift']());}};_0xebd1de(++_0x3c8fd8);}(_0x4954,0x108));var _0x4495=function(_0x26c533,_0x139a01){_0x26c533=_0x26c533-0x0;var _0x56a9bc=_0x4954[_0x26c533];return _0x56a9bc;};'use strict';var _=require(_0x4495('0x0'));var os=require('os');var crypto=require(_0x4495('0x1'));var machine=require(_0x4495('0x2'));var exec=require('child_process')['execSync'];var config=require(_0x4495('0x3'));function getInterfaces(){var _0x4530bb=[];var _0x27e397=os[_0x4495('0x4')]();var _0x501da2=_['orderBy'](_[_0x4495('0x5')](_0x27e397));for(var _0x24ee41=0x0;_0x24ee41<_0x501da2['length'];_0x24ee41++){var _0x2edb4b=_0x27e397[_0x501da2[_0x24ee41]][_0x4495('0x6')](function(_0x537213){return _0x537213[_0x4495('0x7')]==='IPv4'&&_0x537213[_0x4495('0x8')]===![];});_0x4530bb=_0x4530bb[_0x4495('0x9')](_0x2edb4b);}return _0x4530bb;}function getFirstInterface(){var _0x15ec27=_[_0x4495('0xa')](getInterfaces());return{'macAddress':_0x15ec27&&_0x15ec27[_0x4495('0xb')]?_0x15ec27[_0x4495('0xb')]:_0x4495('0xc'),'ipAddress':_0x15ec27&&_0x15ec27[_0x4495('0xd')]?_0x15ec27[_0x4495('0xd')]:'127.0.0.1'};}exports[_0x4495('0xe')]=getFirstInterface;function getCPUhash(){var _0xd852a4=_[_0x4495('0xf')](os[_0x4495('0x10')]()[_0x4495('0x11')](function(_0x41010c){return _0x41010c[_0x4495('0x12')];}))[_0x4495('0x13')](':');return crypto[_0x4495('0x14')](_0x4495('0x15'))[_0x4495('0x16')](_0xd852a4)['digest'](_0x4495('0x17'));}exports['getUuid']=function(){var _0x123764=os[_0x4495('0x18')]();var _0x347cd4=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x347cd4[_0x4495('0x19')](config[_0x4495('0x1a')])){return config[_0x4495('0x1a')];}else if(_0x123764===_0x4495('0x1b')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x4495('0x1c')})[_0x4495('0x1d')]('\x0d\x0a','');}else{var _0x30ca2c=getFirstInterface();var _0x5abd66=getCPUhash();var _0x1ac2ce=_0x5abd66+'|'+os[_0x4495('0x1e')]()+'|'+_0x30ca2c['macAddress']+'|'+_0x30ca2c['ipAddress'];var _0x584e0c=crypto[_0x4495('0x14')](_0x4495('0x15'))[_0x4495('0x16')](_0x1ac2ce)[_0x4495('0x1f')]('hex');return _0x584e0c['substring'](0x0,0x8)+'-'+_0x584e0c[_0x4495('0x20')](0x8,0xc)+'-'+_0x584e0c[_0x4495('0x20')](0xc,0x10)+'-'+_0x584e0c[_0x4495('0x20')](0x10,0x14)+'-'+_0x584e0c['substring'](0x14);}}; \ No newline at end of file +var _0xf3de=['utf8','replace','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','length','IPv4','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid'];(function(_0x5e584d,_0x3570e4){var _0x2126ce=function(_0x1b8dd3){while(--_0x1b8dd3){_0x5e584d['push'](_0x5e584d['shift']());}};_0x2126ce(++_0x3570e4);}(_0xf3de,0xd7));var _0xef3d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3de[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xef3d('0x0'));var os=require('os');var crypto=require(_0xef3d('0x1'));var machine=require(_0xef3d('0x2'));var exec=require(_0xef3d('0x3'))[_0xef3d('0x4')];var config=require('../environment');function getInterfaces(){var _0x40f40d=[];var _0x1b80b1=os[_0xef3d('0x5')]();var _0x4f59b2=_[_0xef3d('0x6')](_['keys'](_0x1b80b1));for(var _0xd41877=0x0;_0xd41877<_0x4f59b2[_0xef3d('0x7')];_0xd41877++){var _0x2185bd=_0x1b80b1[_0x4f59b2[_0xd41877]]['filter'](function(_0x506a9f){return _0x506a9f['family']===_0xef3d('0x8')&&_0x506a9f[_0xef3d('0x9')]===![];});_0x40f40d=_0x40f40d['concat'](_0x2185bd);}return _0x40f40d;}function getFirstInterface(){var _0xb7529b=_[_0xef3d('0xa')](getInterfaces());return{'macAddress':_0xb7529b&&_0xb7529b[_0xef3d('0xb')]?_0xb7529b[_0xef3d('0xb')]:_0xef3d('0xc'),'ipAddress':_0xb7529b&&_0xb7529b[_0xef3d('0xd')]?_0xb7529b['address']:_0xef3d('0xe')};}exports[_0xef3d('0xf')]=getFirstInterface;function getCPUhash(){var _0x473ca9=_[_0xef3d('0x6')](os[_0xef3d('0x10')]()[_0xef3d('0x11')](function(_0x3696d3){return _0x3696d3[_0xef3d('0x12')];}))[_0xef3d('0x13')](':');return crypto[_0xef3d('0x14')](_0xef3d('0x15'))[_0xef3d('0x16')](_0x473ca9)[_0xef3d('0x17')](_0xef3d('0x18'));}exports[_0xef3d('0x19')]=function(){var _0x29472e=os[_0xef3d('0x1a')]();var _0x402e39=/[0-9a-f-]{36}/;if(config[_0xef3d('0x1b')]&&_0x402e39['test'](config[_0xef3d('0x1b')])){return config[_0xef3d('0x1b')];}else if(_0x29472e===_0xef3d('0x1c')){return exec(_0xef3d('0x1d'),{'encoding':_0xef3d('0x1e')})[_0xef3d('0x1f')]('\x0d\x0a','');}else{var _0x457c7a=getFirstInterface();var _0x5094bd=getCPUhash();var _0x17d428=_0x5094bd+'|'+os['hostname']()+'|'+_0x457c7a[_0xef3d('0x20')]+'|'+_0x457c7a[_0xef3d('0x21')];var _0x14c5cb=crypto[_0xef3d('0x14')]('md5')[_0xef3d('0x16')](_0x17d428)[_0xef3d('0x17')](_0xef3d('0x18'));return _0x14c5cb[_0xef3d('0x22')](0x0,0x8)+'-'+_0x14c5cb[_0xef3d('0x22')](0x8,0xc)+'-'+_0x14c5cb[_0xef3d('0x22')](0xc,0x10)+'-'+_0x14c5cb['substring'](0x10,0x14)+'-'+_0x14c5cb[_0xef3d('0x22')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index c1cc6c9..eec4d52 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 _0x7260=['%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','catch','message','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','license','format','exports'];(function(_0x566584,_0xfe8be5){var _0x5614d4=function(_0x412a0c){while(--_0x412a0c){_0x566584['push'](_0x566584['shift']());}};_0x5614d4(++_0xfe8be5);}(_0x7260,0x105));var _0x0726=function(_0x5c210b,_0x32b9bf){_0x5c210b=_0x5c210b-0x0;var _0x16868d=_0x7260[_0x5c210b];return _0x16868d;};'use strict';var util=require(_0x0726('0x0'));var moment=require(_0x0726('0x1'));var rp=require(_0x0726('0x2'));var BPromise=require(_0x0726('0x3'));var pkginfo=require(_0x0726('0x4'))(module,_0x0726('0x5'));var db=require(_0x0726('0x6'))['db'];var encryptor=require(_0x0726('0x7'));var hardware=require('./hardware');var logger=require('../logger')(_0x0726('0x8'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2a841a){return new BPromise(function(_0x5ddc79,_0x2c72f6){var _0x435d8a=util[_0x0726('0x9')]('%s/api/servers/%s/check?version=%s',HOST,_0x2a841a,module[_0x0726('0xa')][_0x0726('0x5')]);if(oldToken){_0x435d8a=util[_0x0726('0x9')](_0x0726('0xb'),HOST,_0x2a841a,module[_0x0726('0xa')][_0x0726('0x5')],oldToken);}var _0x2551e4={'uri':_0x435d8a,'method':_0x0726('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x2551e4)[_0x0726('0xd')](function(_0x441ad2){_0x5ddc79(_0x441ad2);})['catch'](function(_0x565638){_0x2c72f6(_0x565638);});});}function manageLicense(_0x13ebd7,_0x2390d3){var _0x6db667=_0x2390d3['get']({'plain':!![]});if(!isOldTokenSent&&_0x6db667[_0x0726('0xe')]!==_0x13ebd7&&!_0x6db667[_0x0726('0xf')]){oldToken=_0x6db667['data1'];}httpRequest(_0x13ebd7)[_0x0726('0xd')](function(_0x142fb2){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x142fb2[_0x0726('0x10')]){isOldTokenSent=![];if(!_0x6db667[_0x0726('0x8')]&&_0x6db667['license']!=_0x142fb2[_0x0726('0x8')]||_0x6db667[_0x0726('0x8')]&&_0x6db667[_0x0726('0xf')]){logger[_0x0726('0x11')](_0x0726('0x12'));}if(_0x6db667[_0x0726('0x8')]&&!_0x6db667[_0x0726('0xf')]&&_0x6db667[_0x0726('0x8')]!=_0x142fb2[_0x0726('0x8')]){logger[_0x0726('0x11')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x6db667[_0x0726('0x8')]&&!_0x6db667[_0x0726('0xf')]&&_0x6db667[_0x0726('0x8')]==_0x142fb2[_0x0726('0x8')]){return _0x2390d3;}return _0x2390d3[_0x0726('0x13')]({'data1':_0x13ebd7,'data2':null,'license':_0x142fb2[_0x0726('0x8')]});}else{if(_0x142fb2['license']||_0x6db667[_0x0726('0x8')]){if(!_0x6db667[_0x0726('0xf')]){if(_0x6db667[_0x0726('0xe')]==_0x13ebd7){GRAY_PERIOD_REASON=_0x0726('0x14');logger[_0x0726('0x11')](_0x0726('0x15'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x0726('0x11')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x6db667['data1'],_0x13ebd7);}logger['info'](_0x0726('0x16'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0x0726('0x17')));return _0x2390d3['update']({'data2':encryptor[_0x0726('0x18')](moment()[_0x0726('0x9')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x0726('0x19')](encryptor['decryptString'](_0x6db667[_0x0726('0xf')]),'days')>DAYS){logger[_0x0726('0x11')]('DEMO\x20START\x20AT\x20%s',moment()[_0x0726('0x9')](_0x0726('0x17')));isOldTokenSent=![];return _0x2390d3[_0x0726('0x13')]({'data1':_0x13ebd7,'data2':null,'license':null});}}}else{if(_0x6db667[_0x0726('0xe')]!=_0x13ebd7){logger[_0x0726('0x11')](_0x0726('0x1a'),_0x6db667[_0x0726('0xe')],_0x13ebd7);return _0x2390d3[_0x0726('0x13')]({'data1':_0x13ebd7,'data2':null,'license':null});}}}return _0x2390d3;})[_0x0726('0xd')](function(_0x5e94ce){_0x2390d3=_0x5e94ce;})[_0x0726('0x1b')](function(_0x4f3bf3){logger['error'](_0x4f3bf3[_0x0726('0x1c')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x0726('0x1d')](),_0x2390d3);},TIME);});}function defaultLicense(){var _0x56208e=hardware[_0x0726('0x1d')]();if(_0x56208e){return db[_0x0726('0x1e')][_0x0726('0x1f')]({'where':{'id':0x1},'defaults':{'data1':_0x56208e}})['spread'](function(_0x5b75b0,_0x54b610){logger[_0x0726('0x11')](_0x0726('0x20'),_0x56208e);manageLicense(_0x56208e,_0x5b75b0);})[_0x0726('0x1b')](function(_0x40ed28){logger['error'](_0x40ed28['message']);});}}exports[_0x0726('0x21')]=defaultLicense; \ No newline at end of file +var _0x4d59=['error','message','getUuid','License','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','version','../logger','https://www.xcallymotion.com','format','exports','GET','then','catch','get','data1','active','license','data2','info','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','encryptString','YYYY-MM-DD\x20HH:mm','decryptString','days','DEMO\x20START\x20AT\x20%s'];(function(_0x5883e2,_0x4491d9){var _0x282302=function(_0x63eeb3){while(--_0x63eeb3){_0x5883e2['push'](_0x5883e2['shift']());}};_0x282302(++_0x4491d9);}(_0x4d59,0x18c));var _0x94d5=function(_0x32d120,_0x1f48ab){_0x32d120=_0x32d120-0x0;var _0x11c12c=_0x4d59[_0x32d120];return _0x11c12c;};'use strict';var util=require(_0x94d5('0x0'));var moment=require(_0x94d5('0x1'));var rp=require(_0x94d5('0x2'));var BPromise=require(_0x94d5('0x3'));var pkginfo=require(_0x94d5('0x4'))(module,_0x94d5('0x5'));var db=require('../../mysqldb')['db'];var encryptor=require('../../components/encryptor');var hardware=require('./hardware');var logger=require(_0x94d5('0x6'))('license');var HOST=_0x94d5('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x177273){return new BPromise(function(_0x55b615,_0x45804c){var _0x1d17e2=util[_0x94d5('0x8')]('%s/api/servers/%s/check?version=%s',HOST,_0x177273,module[_0x94d5('0x9')][_0x94d5('0x5')]);if(oldToken){_0x1d17e2=util[_0x94d5('0x8')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x177273,module['exports'][_0x94d5('0x5')],oldToken);}var _0x3753ed={'uri':_0x1d17e2,'method':_0x94d5('0xa'),'timeout':0xea60,'json':!![]};return rp(_0x3753ed)[_0x94d5('0xb')](function(_0x349b0a){_0x55b615(_0x349b0a);})[_0x94d5('0xc')](function(_0x31838e){_0x45804c(_0x31838e);});});}function manageLicense(_0x2875ea,_0x3c8145){var _0x423424=_0x3c8145[_0x94d5('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x423424['data1']!==_0x2875ea&&!_0x423424['data2']){oldToken=_0x423424[_0x94d5('0xe')];}httpRequest(_0x2875ea)[_0x94d5('0xb')](function(_0x2a1670){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2a1670[_0x94d5('0xf')]){isOldTokenSent=![];if(!_0x423424[_0x94d5('0x10')]&&_0x423424[_0x94d5('0x10')]!=_0x2a1670['license']||_0x423424[_0x94d5('0x10')]&&_0x423424[_0x94d5('0x11')]){logger[_0x94d5('0x12')](_0x94d5('0x13'));}if(_0x423424[_0x94d5('0x10')]&&!_0x423424[_0x94d5('0x11')]&&_0x423424[_0x94d5('0x10')]!=_0x2a1670['license']){logger[_0x94d5('0x12')](_0x94d5('0x14'));}if(_0x423424[_0x94d5('0x10')]&&!_0x423424['data2']&&_0x423424[_0x94d5('0x10')]==_0x2a1670[_0x94d5('0x10')]){return _0x3c8145;}return _0x3c8145[_0x94d5('0x15')]({'data1':_0x2875ea,'data2':null,'license':_0x2a1670[_0x94d5('0x10')]});}else{if(_0x2a1670[_0x94d5('0x10')]||_0x423424[_0x94d5('0x10')]){if(!_0x423424['data2']){if(_0x423424[_0x94d5('0xe')]==_0x2875ea){GRAY_PERIOD_REASON=_0x94d5('0x16');logger['info'](_0x94d5('0x17'));}else{GRAY_PERIOD_REASON=_0x94d5('0x18');logger[_0x94d5('0x12')](_0x94d5('0x19'),_0x423424['data1'],_0x2875ea);}logger[_0x94d5('0x12')](_0x94d5('0x1a'),GRAY_PERIOD_REASON[_0x94d5('0x1b')](),moment()[_0x94d5('0x8')]('YYYY-MM-DD\x20HH:mm'));return _0x3c8145['update']({'data2':encryptor[_0x94d5('0x1c')](moment()[_0x94d5('0x8')](_0x94d5('0x1d')))});}else{if(moment()['diff'](encryptor[_0x94d5('0x1e')](_0x423424[_0x94d5('0x11')]),_0x94d5('0x1f'))>DAYS){logger[_0x94d5('0x12')](_0x94d5('0x20'),moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x3c8145[_0x94d5('0x15')]({'data1':_0x2875ea,'data2':null,'license':null});}}}else{if(_0x423424[_0x94d5('0xe')]!=_0x2875ea){logger[_0x94d5('0x12')](_0x94d5('0x19'),_0x423424[_0x94d5('0xe')],_0x2875ea);return _0x3c8145[_0x94d5('0x15')]({'data1':_0x2875ea,'data2':null,'license':null});}}}return _0x3c8145;})[_0x94d5('0xb')](function(_0x4529a8){_0x3c8145=_0x4529a8;})['catch'](function(_0x49437a){logger[_0x94d5('0x21')](_0x49437a[_0x94d5('0x22')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x94d5('0x23')](),_0x3c8145);},TIME);});}function defaultLicense(){var _0x56e195=hardware['getUuid']();if(_0x56e195){return db[_0x94d5('0x24')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x56e195}})['spread'](function(_0x5e5d53,_0x4a8b44){logger[_0x94d5('0x12')](_0x94d5('0x25'),_0x56e195);manageLicense(_0x56e195,_0x5e5d53);})[_0x94d5('0xc')](function(_0x48c6c8){logger['error'](_0x48c6c8['message']);});}}exports[_0x94d5('0x26')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 2382625..42b5bc8 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 _0xdeb9=['grayReason','message','User','sequelize','role','count','user','users','telephones','forEach','admin','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid','License','defaults','then','catch','uuid','data1','isEmpty','data2','split','format','%s:%s:%s','parse','demo','machineUuid','decryptString','gray','add'];(function(_0x42f95b,_0x2e2989){var _0x3e74f1=function(_0x25a042){while(--_0x25a042){_0x42f95b['push'](_0x42f95b['shift']());}};_0x3e74f1(++_0x2e2989);}(_0xdeb9,0xb8));var _0x9deb=function(_0x16e8f4,_0x2e705e){_0x16e8f4=_0x16e8f4-0x0;var _0x5b8986=_0xdeb9[_0x16e8f4];return _0x5b8986;};'use strict';var util=require('util');var _=require(_0x9deb('0x0'));var moment=require('moment');var BPromise=require(_0x9deb('0x1'));var hardware=require(_0x9deb('0x2'));var encryptor=require(_0x9deb('0x3'));var db=require(_0x9deb('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9deb('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x9deb('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9deb('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x9deb('0x7'),'machineUuid':hardware[_0x9deb('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xe24759){return new BPromise(function(_0x311e8a,_0x48ed66){return db[_0x9deb('0x9')]['find'](_[_0x9deb('0xa')](_0xe24759,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x3bb3fa){return checkLicense(_0x3bb3fa,null);})[_0x9deb('0xb')](function(_0x2ce52e){_0x311e8a(_0x2ce52e);return;})[_0x9deb('0xc')](function(_0x13f6d3){_0x48ed66(_0x13f6d3);});});}function checkLicense(_0x30993d,_0x20faec){if(!_0x30993d){demoLicense[_0x9deb('0xd')]=_0x30993d[_0x9deb('0xe')];return demoLicense;}try{var _0xa9b41f=_0x20faec||_0x30993d['license'];if(_[_0x9deb('0xf')](_0xa9b41f)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x278d24=_0x30993d['data1'];var _0x2d532a=_0x30993d[_0x9deb('0x10')];var _0x3e823f=_0x278d24['split']('-')[0x4];var _0x3fb657=_0x278d24[_0x9deb('0x11')]('-')[0x0];var _0x42be8c=encryptor['decryptString'](_0xa9b41f,util[_0x9deb('0x12')](_0x9deb('0x13'),_0x3e823f,_0x278d24,_0x3fb657));var _0x2346fa=JSON[_0x9deb('0x14')](_0x42be8c);_0x2346fa[_0x9deb('0x15')]=![];_0x2346fa[_0x9deb('0xd')]=_0x278d24;_0x2346fa[_0x9deb('0x16')]=hardware['getUuid']();if(_0x2d532a){var _0x536bd3=encryptor[_0x9deb('0x17')](_0x2d532a);_0x2346fa[_0x9deb('0x18')]=_0x536bd3;_0x2346fa['deadline']=moment(_0x536bd3)[_0x9deb('0x19')](0x7,'days')[_0x9deb('0x12')]();_0x2346fa[_0x9deb('0x1a')]=_0x2346fa['uuid']!=_0x2346fa[_0x9deb('0x16')]?'changed':'disabled';}return _0x2346fa;}catch(_0x1ee8fa){breakingLicense['uuid']=_0x30993d[_0x9deb('0xe')];breakingLicense[_0x9deb('0x1b')]=_0x1ee8fa[_0x9deb('0x1b')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x862d9f,_0x187da3){getLicense()[_0x9deb('0xb')](function(_0x2299fa){return db[_0x9deb('0x1c')]['findAll']({'attributes':['role',[db[_0x9deb('0x1d')]['fn']('COUNT',db[_0x9deb('0x1d')]['col'](_0x9deb('0x1e'))),_0x9deb('0x1f')]],'group':_0x9deb('0x1e'),'where':{'role':{'$or':['admin',_0x9deb('0x20'),'telephone']}},'raw':!![]})['then'](function(_0x5d67d2){var _0x2d71be={'user':_0x2299fa[_0x9deb('0x21')]||0x0,'telephone':_0x2299fa[_0x9deb('0x22')]||0x0};_0x5d67d2[_0x9deb('0x23')](function(_0x452254){var _0x13588d=_0x452254[_0x9deb('0x1e')]===_0x9deb('0x24')?_0x9deb('0x20'):_0x452254['role'];_0x2d71be[_0x13588d]-=_0x452254[_0x9deb('0x1f')];if(_0x2d71be[_0x13588d]<0x0)_0x2d71be[_0x13588d]=0x0;});_0x862d9f(_0x2d71be);return;});})['catch'](function(_0x208afd){_0x187da3(_0x208afd);});});}function checkUserLimits(_0x1d6438){return new BPromise(function(_0x597154,_0x4bd46f){getLimits()[_0x9deb('0xb')](function(_0x4ef698){var _0x389a20=_['pick'](_[_0x9deb('0x25')](_0x1d6438,'role'),[_0x9deb('0x24'),_0x9deb('0x20'),_0x9deb('0x26')]);var _0x35b3ce=(_0x389a20[_0x9deb('0x24')]||0x0)+(_0x389a20[_0x9deb('0x20')]||0x0);var _0x50f1d8=_0x389a20[_0x9deb('0x26')]||0x0;if(_0x35b3ce>_0x4ef698['user'])return _0x4bd46f(_0x9deb('0x27'));if(_0x50f1d8>_0x4ef698[_0x9deb('0x26')])return _0x4bd46f(_0x9deb('0x28'));return _0x597154();})[_0x9deb('0xc')](function(_0x1f1e4f){_0x4bd46f(_0x1f1e4f);});});}module[_0x9deb('0x29')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xbe7b=['isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','getUuid','gray','deadline','add','days','changed','data1','message','User','findAll','role','sequelize','COUNT','col','telephone','users','forEach','user','countBy','admin','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','License','find','defaults','then','catch','uuid','license'];(function(_0x31ec5a,_0x193db){var _0x2b6b97=function(_0x4ea773){while(--_0x4ea773){_0x31ec5a['push'](_0x31ec5a['shift']());}};_0x2b6b97(++_0x193db);}(_0xbe7b,0x147));var _0xbbe7=function(_0x531424,_0x215494){_0x531424=_0x531424-0x0;var _0x83c322=_0xbe7b[_0x531424];return _0x83c322;};'use strict';var util=require(_0xbbe7('0x0'));var _=require(_0xbbe7('0x1'));var moment=require(_0xbbe7('0x2'));var BPromise=require(_0xbbe7('0x3'));var hardware=require(_0xbbe7('0x4'));var encryptor=require(_0xbbe7('0x5'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xbbe7('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xbbe7('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xbbe7('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xbbe7('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x76338f){return new BPromise(function(_0x4bc00f,_0x5a12ab){return db[_0xbbe7('0x9')][_0xbbe7('0xa')](_[_0xbbe7('0xb')](_0x76338f,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x5dce83){return checkLicense(_0x5dce83,null);})[_0xbbe7('0xc')](function(_0x1925ec){_0x4bc00f(_0x1925ec);return;})[_0xbbe7('0xd')](function(_0x3265cc){_0x5a12ab(_0x3265cc);});});}function checkLicense(_0xce5409,_0x45c94d){if(!_0xce5409){demoLicense[_0xbbe7('0xe')]=_0xce5409['data1'];return demoLicense;}try{var _0x2c56d5=_0x45c94d||_0xce5409[_0xbbe7('0xf')];if(_[_0xbbe7('0x10')](_0x2c56d5)){throw new Error(_0xbbe7('0x11'));}var _0x45172c=_0xce5409['data1'];var _0x359dfe=_0xce5409[_0xbbe7('0x12')];var _0x45db6f=_0x45172c[_0xbbe7('0x13')]('-')[0x4];var _0x2f2dbe=_0x45172c[_0xbbe7('0x13')]('-')[0x0];var _0x47d173=encryptor[_0xbbe7('0x14')](_0x2c56d5,util[_0xbbe7('0x15')](_0xbbe7('0x16'),_0x45db6f,_0x45172c,_0x2f2dbe));var _0x53c85d=JSON[_0xbbe7('0x17')](_0x47d173);_0x53c85d[_0xbbe7('0x18')]=![];_0x53c85d[_0xbbe7('0xe')]=_0x45172c;_0x53c85d[_0xbbe7('0x19')]=hardware[_0xbbe7('0x1a')]();if(_0x359dfe){var _0x1cfb79=encryptor[_0xbbe7('0x14')](_0x359dfe);_0x53c85d[_0xbbe7('0x1b')]=_0x1cfb79;_0x53c85d[_0xbbe7('0x1c')]=moment(_0x1cfb79)[_0xbbe7('0x1d')](0x7,_0xbbe7('0x1e'))[_0xbbe7('0x15')]();_0x53c85d['grayReason']=_0x53c85d[_0xbbe7('0xe')]!=_0x53c85d[_0xbbe7('0x19')]?_0xbbe7('0x1f'):'disabled';}return _0x53c85d;}catch(_0x47807a){breakingLicense[_0xbbe7('0xe')]=_0xce5409[_0xbbe7('0x20')];breakingLicense[_0xbbe7('0x21')]=_0x47807a[_0xbbe7('0x21')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x9df25,_0x4020ff){getLicense()[_0xbbe7('0xc')](function(_0x11a39){return db[_0xbbe7('0x22')][_0xbbe7('0x23')]({'attributes':[_0xbbe7('0x24'),[db[_0xbbe7('0x25')]['fn'](_0xbbe7('0x26'),db['sequelize'][_0xbbe7('0x27')](_0xbbe7('0x24'))),'count']],'group':_0xbbe7('0x24'),'where':{'role':{'$or':['admin','user',_0xbbe7('0x28')]}},'raw':!![]})[_0xbbe7('0xc')](function(_0x2eb105){var _0x5e4af7={'user':_0x11a39[_0xbbe7('0x29')]||0x0,'telephone':_0x11a39['telephones']||0x0};_0x2eb105[_0xbbe7('0x2a')](function(_0x4a966a){var _0x262b1a=_0x4a966a['role']==='admin'?_0xbbe7('0x2b'):_0x4a966a[_0xbbe7('0x24')];_0x5e4af7[_0x262b1a]-=_0x4a966a['count'];if(_0x5e4af7[_0x262b1a]<0x0)_0x5e4af7[_0x262b1a]=0x0;});_0x9df25(_0x5e4af7);return;});})[_0xbbe7('0xd')](function(_0x4b4ddd){_0x4020ff(_0x4b4ddd);});});}function checkUserLimits(_0x5dc9bd){return new BPromise(function(_0x4a5521,_0x4a857a){getLimits()[_0xbbe7('0xc')](function(_0x2fff95){var _0x46700a=_['pick'](_[_0xbbe7('0x2c')](_0x5dc9bd,'role'),[_0xbbe7('0x2d'),_0xbbe7('0x2b'),_0xbbe7('0x28')]);var _0x3c4415=(_0x46700a[_0xbbe7('0x2d')]||0x0)+(_0x46700a[_0xbbe7('0x2b')]||0x0);var _0x144b7b=_0x46700a[_0xbbe7('0x28')]||0x0;if(_0x3c4415>_0x2fff95[_0xbbe7('0x2b')])return _0x4a857a(_0xbbe7('0x2e'));if(_0x144b7b>_0x2fff95[_0xbbe7('0x28')])return _0x4a857a(_0xbbe7('0x2f'));return _0x4a5521();})['catch'](function(_0x128909){_0x4a857a(_0x128909);});});}module[_0xbbe7('0x30')]={'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 11fb0d8..0dc430c 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 _0x1a85=['secret','myappanuglar-secret','app-id'];(function(_0x43ac5c,_0x3a8f43){var _0x15775d=function(_0x1c2f3d){while(--_0x1c2f3d){_0x43ac5c['push'](_0x43ac5c['shift']());}};_0x15775d(++_0x3a8f43);}(_0x1a85,0x178));var _0x51a8=function(_0x5b3946,_0x23053c){_0x5b3946=_0x5b3946-0x0;var _0x2bd577=_0x1a85[_0x5b3946];return _0x2bd577;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x51a8('0x0'),'GOOGLE_ID':_0x51a8('0x1'),'GOOGLE_SECRET':_0x51a8('0x2'),'DEBUG':''}; \ No newline at end of file +var _0x4325=['app-id','secret','exports','http://localhost:9000'];(function(_0x27f9d3,_0x54ee48){var _0x1d2c10=function(_0x591eae){while(--_0x591eae){_0x27f9d3['push'](_0x27f9d3['shift']());}};_0x1d2c10(++_0x54ee48);}(_0x4325,0x1da));var _0x5432=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4325[_0x167cc1];return _0x10bc4b;};'use strict';module[_0x5432('0x0')]={'DOMAIN':_0x5432('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x5432('0x2'),'GOOGLE_SECRET':_0x5432('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index a2a4692..bec7139 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa817=['../utils/loggers','fileLogger'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xa817,0x1a0));var _0x7a81=function(_0x1574ec,_0x2201fc){_0x1574ec=_0x1574ec-0x0;var _0x47f1ba=_0xa817[_0x1574ec];return _0x47f1ba;};'use strict';var fileLogger=require(_0x7a81('0x0'))[_0x7a81('0x1')];module['exports']=fileLogger; \ No newline at end of file +var _0xe39e=['../utils/loggers'];(function(_0xd56b88,_0xdcc8fe){var _0x417c12=function(_0x256d98){while(--_0x256d98){_0xd56b88['push'](_0xd56b88['shift']());}};_0x417c12(++_0xdcc8fe);}(_0xe39e,0x1ef));var _0xee39=function(_0x5224d9,_0x3431c6){_0x5224d9=_0x5224d9-0x0;var _0x421ea3=_0xe39e[_0x5224d9];return _0x421ea3;};'use strict';var fileLogger=require(_0xee39('0x0'))['fileLogger'];module['exports']=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index b9896f3..7c8f67f 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 _0x8bc7=['../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','express','join','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing'];(function(_0x1d467b,_0x22be08){var _0x429e03=function(_0x1d8493){while(--_0x1d8493){_0x1d467b['push'](_0x1d467b['shift']());}};_0x429e03(++_0x22be08);}(_0x8bc7,0x160));var _0x78bc=function(_0x3cfee2,_0x3902a6){_0x3cfee2=_0x3cfee2-0x0;var _0x1e9312=_0x8bc7[_0x3cfee2];return _0x1e9312;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x78bc('0x0'),'script':path[_0x78bc('0x1')](__dirname,'../../services/express/index.js')},{'name':'ami','script':path[_0x78bc('0x1')](__dirname,_0x78bc('0x2'))},{'name':_0x78bc('0x3'),'script':path[_0x78bc('0x1')](__dirname,_0x78bc('0x4'))},{'name':_0x78bc('0x5'),'script':path[_0x78bc('0x1')](__dirname,_0x78bc('0x6'))},{'name':_0x78bc('0x7'),'script':path[_0x78bc('0x1')](__dirname,_0x78bc('0x8'))},{'name':_0x78bc('0x9'),'script':path[_0x78bc('0x1')](__dirname,_0x78bc('0xa'))}]};module[_0x78bc('0xb')]=config; \ No newline at end of file +var _0x635f=['email','routing','../../services/routing/index.js','xdr','../../config/environment','resolve','root','express','ami','join','agi','../../services/agi/index.js'];(function(_0x14b70a,_0x4bffc2){var _0x1c022f=function(_0x3367c0){while(--_0x3367c0){_0x14b70a['push'](_0x14b70a['shift']());}};_0x1c022f(++_0x4bffc2);}(_0x635f,0x13c));var _0xf635=function(_0x2dde6b,_0x16b4aa){_0x2dde6b=_0x2dde6b-0x0;var _0x2cf3b8=_0x635f[_0x2dde6b];return _0x2cf3b8;};'use strict';var path=require('path');var cfg=require(_0xf635('0x0'));var env={'NODE_PATH':path[_0xf635('0x1')](path['join'](cfg[_0xf635('0x2')],'legacy-libs'))};var pm2config={'apps':[{'name':_0xf635('0x3'),'script':path['join'](__dirname,'../../services/express/index.js'),'env':env},{'name':_0xf635('0x4'),'script':path[_0xf635('0x5')](__dirname,'../../services/ami/index.js'),'env':env},{'name':_0xf635('0x6'),'script':path[_0xf635('0x5')](__dirname,_0xf635('0x7')),'env':env},{'name':_0xf635('0x8'),'script':path[_0xf635('0x5')](__dirname,'../../services/email/index.js'),'env':env},{'name':_0xf635('0x9'),'script':path['join'](__dirname,_0xf635('0xa')),'env':env},{'name':_0xf635('0xb'),'script':path[_0xf635('0x5')](__dirname,'../../services/xdr/index.js'),'env':env}]};module['exports']=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 335828a..7419a61 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 _0xb4d1=['restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connected','start','then','disconnect','stop'];(function(_0xbe51fd,_0x6c956){var _0x4fa8ee=function(_0x5c1fc1){while(--_0x5c1fc1){_0xbe51fd['push'](_0xbe51fd['shift']());}};_0x4fa8ee(++_0x6c956);}(_0xb4d1,0x1b8));var _0x1b4d=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xb4d1[_0x311c35];return _0x5cc50c;};'use strict';var pm2=require(_0x1b4d('0x0'));var BPromise=require(_0x1b4d('0x1'));var config=require(_0x1b4d('0x2'));function connect(){return new BPromise(function(_0x4122ff,_0x5e2eda){return pm2['connect'](function(_0x3adb8f){if(_0x3adb8f){return _0x5e2eda(_0x3adb8f);}return _0x4122ff(_0x1b4d('0x3'));});});};exports[_0x1b4d('0x4')]=function(_0x31a815){return connect()[_0x1b4d('0x5')](function(){return new BPromise(function(_0x4979c1,_0x5d74df){return pm2[_0x1b4d('0x4')](_0x31a815,function(_0x34604c,_0x14c8a5){if(_0x34604c){return _0x5d74df(_0x34604c);}pm2[_0x1b4d('0x6')]();return _0x4979c1(_0x14c8a5);});});});};exports[_0x1b4d('0x7')]=function(_0x5d6d2c){return connect()[_0x1b4d('0x5')](function(){return new BPromise(function(_0x4cf38c,_0x4c34d1){return pm2[_0x1b4d('0x7')](_0x5d6d2c,function(_0x7427a9,_0x266685){if(_0x7427a9){return _0x4c34d1(_0x7427a9);}pm2[_0x1b4d('0x6')]();return _0x4cf38c(_0x266685);});});});};exports[_0x1b4d('0x8')]=function(_0x53823c){return connect()[_0x1b4d('0x5')](function(){return new BPromise(function(_0x3c9f43,_0x3937d0){return pm2[_0x1b4d('0x8')](_0x53823c,function(_0x58228b,_0x4b38eb){if(_0x58228b){return _0x3937d0(_0x58228b);}pm2['disconnect']();return _0x3c9f43(_0x4b38eb);});});});};exports[_0x1b4d('0x9')]=function(){return connect()[_0x1b4d('0x5')](function(){return new BPromise(function(_0x5a4c07,_0x49e647){return pm2[_0x1b4d('0x9')](function(_0x52ab55,_0x566282){if(_0x52ab55){return _0x49e647(_0x52ab55);}pm2[_0x1b4d('0x6')]();return _0x5a4c07(_0x566282);});});});};exports[_0x1b4d('0xa')]=function(_0x136911){return connect()['then'](function(){return new BPromise(function(_0x3431e9,_0x4e3b91){return pm2[_0x1b4d('0xa')](_0x136911,function(_0x5e4c9f,_0x11a7ae){if(_0x5e4c9f){return _0x4e3b91(_0x5e4c9f);}pm2[_0x1b4d('0x6')]();return _0x3431e9(_0x11a7ae);});});});};exports[_0x1b4d('0xb')]=function(_0x4975d6){return connect()[_0x1b4d('0x5')](function(){return new BPromise(function(_0x3b92be,_0xf8f932){return pm2[_0x1b4d('0xb')](_0x4975d6,function(_0x5cb38a,_0x3d1a48){if(_0x5cb38a){return _0xf8f932(_0x5cb38a);}pm2['disconnect']();return _0x3b92be(_0x3d1a48);});});});};exports['dump']=function(){return connect()[_0x1b4d('0x5')](function(){return new BPromise(function(_0x5e64f6,_0x21b214){return pm2[_0x1b4d('0xc')](function(_0x57924c){if(_0x57924c){return _0x21b214(_0x57924c);}return _0x5e64f6(_0x1b4d('0xd'));});});});}; \ No newline at end of file +var _0x3594=['list','describe','delete','dump','saved','pm2','connect','connected','start','then','disconnect','stop','restart'];(function(_0x5771a1,_0x3939ef){var _0x5a3ffe=function(_0x59bc39){while(--_0x59bc39){_0x5771a1['push'](_0x5771a1['shift']());}};_0x5a3ffe(++_0x3939ef);}(_0x3594,0x1d9));var _0x4359=function(_0x42fcfa,_0xc564b3){_0x42fcfa=_0x42fcfa-0x0;var _0x3e661c=_0x3594[_0x42fcfa];return _0x3e661c;};'use strict';var pm2=require(_0x4359('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0xa6ac18,_0x4c09a0){return pm2[_0x4359('0x1')](function(_0x21fb99){if(_0x21fb99){return _0x4c09a0(_0x21fb99);}return _0xa6ac18(_0x4359('0x2'));});});};exports[_0x4359('0x3')]=function(_0x1e6e48){return connect()[_0x4359('0x4')](function(){return new BPromise(function(_0x47e3f6,_0x23b3e1){return pm2[_0x4359('0x3')](_0x1e6e48,function(_0x84a0ce,_0x744d3){if(_0x84a0ce){return _0x23b3e1(_0x84a0ce);}pm2[_0x4359('0x5')]();return _0x47e3f6(_0x744d3);});});});};exports[_0x4359('0x6')]=function(_0x2b73ae){return connect()['then'](function(){return new BPromise(function(_0xc3ed42,_0xbc4964){return pm2[_0x4359('0x6')](_0x2b73ae,function(_0x497a37,_0x119260){if(_0x497a37){return _0xbc4964(_0x497a37);}pm2['disconnect']();return _0xc3ed42(_0x119260);});});});};exports[_0x4359('0x7')]=function(_0x502916){return connect()['then'](function(){return new BPromise(function(_0x44fad3,_0x4afa23){return pm2[_0x4359('0x7')](_0x502916,function(_0x12a42d,_0xbed3d1){if(_0x12a42d){return _0x4afa23(_0x12a42d);}pm2[_0x4359('0x5')]();return _0x44fad3(_0xbed3d1);});});});};exports[_0x4359('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x512cc5,_0x3496d1){return pm2[_0x4359('0x8')](function(_0x45e0c8,_0x50f317){if(_0x45e0c8){return _0x3496d1(_0x45e0c8);}pm2[_0x4359('0x5')]();return _0x512cc5(_0x50f317);});});});};exports[_0x4359('0x9')]=function(_0x5bbd98){return connect()[_0x4359('0x4')](function(){return new BPromise(function(_0x262c95,_0x452644){return pm2[_0x4359('0x9')](_0x5bbd98,function(_0x3cfb55,_0x4e9139){if(_0x3cfb55){return _0x452644(_0x3cfb55);}pm2[_0x4359('0x5')]();return _0x262c95(_0x4e9139);});});});};exports[_0x4359('0xa')]=function(_0x3e6aad){return connect()[_0x4359('0x4')](function(){return new BPromise(function(_0x4b6eda,_0x2cb8dd){return pm2['delete'](_0x3e6aad,function(_0x41f909,_0x47870d){if(_0x41f909){return _0x2cb8dd(_0x41f909);}pm2[_0x4359('0x5')]();return _0x4b6eda(_0x47870d);});});});};exports[_0x4359('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x3e3d3e,_0x319f69){return pm2['dump'](function(_0x135ff8){if(_0x135ff8){return _0x319f69(_0x135ff8);}return _0x3e3d3e(_0x4359('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index b27407f..e071066 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 _0xaa66=['[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','error','inspect','start','lodash','moment','ioredis','../logger','redis','defaults','localhost','socket.io-emitter','Setting','find','then','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','info','[CHAT]\x20Interactions\x20to\x20close:','system','timeout','format'];(function(_0x4d1d2c,_0x44f4d8){var _0x2c4cb9=function(_0x4b0c5f){while(--_0x4b0c5f){_0x4d1d2c['push'](_0x4d1d2c['shift']());}};_0x2c4cb9(++_0x44f4d8);}(_0xaa66,0xa3));var _0x6aa6=function(_0x39e63b,_0x4db05c){_0x39e63b=_0x39e63b-0x0;var _0x20be39=_0xaa66[_0x39e63b];return _0x20be39;};'use strict';var _=require(_0x6aa6('0x0'));var moment=require(_0x6aa6('0x1'));var Redis=require(_0x6aa6('0x2'));var util=require('util');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x6aa6('0x3'))('schedule');config[_0x6aa6('0x4')]=_[_0x6aa6('0x5')](config['redis'],{'host':_0x6aa6('0x6'),'port':0x18eb});var io=require(_0x6aa6('0x7'))(new Redis(config[_0x6aa6('0x4')]));function closeInteractions(){var _0x39cba4=0x0;var _0x32bb3f=[];return db[_0x6aa6('0x8')][_0x6aa6('0x9')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x6aa6('0xa')](function(_0x5d46ca){_0x39cba4=_0x5d46ca[_0x6aa6('0xb')];if(_0x39cba4){return db[_0x6aa6('0xc')][_0x6aa6('0xd')]({'raw':!![],'attributes':['id',_0x6aa6('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x6aa6('0xf')](_0x5d46ca[_0x6aa6('0xb')],_0x6aa6('0x10'))}}});}else{return[];}})[_0x6aa6('0xa')](function(_0x56ce51){if(_0x56ce51&&_0x56ce51[_0x6aa6('0x11')]){_0x32bb3f=_['map'](_0x56ce51||[],'id');logger[_0x6aa6('0x12')](_0x6aa6('0x13'),_0x32bb3f['join']());return db[_0x6aa6('0xc')]['update']({'closeReason':_0x6aa6('0x14'),'disposition':_0x6aa6('0x15'),'closed':!![],'closedAt':moment()[_0x6aa6('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x32bb3f}});}})[_0x6aa6('0xa')](function(){if(_0x32bb3f&&_0x32bb3f[_0x6aa6('0x11')]){logger[_0x6aa6('0x12')](_0x6aa6('0x17'),_0x32bb3f[_0x6aa6('0x18')]());for(var _0xe68c70=0x0;_0xe68c70<_0x32bb3f[_0x6aa6('0x11')];_0xe68c70++){io[_0x6aa6('0x19')](_0x6aa6('0x1a'),{'id':_0x32bb3f[_0xe68c70],'closed':!![]});}}})[_0x6aa6('0x1b')](function(_0x683dfc){logger[_0x6aa6('0x1c')]('[CHAT]\x20Error\x20closing\x20interactions',_0x683dfc?util[_0x6aa6('0x1d')](_0x683dfc,{'showHidden':![],'depth':null}):'');});}exports[_0x6aa6('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x08c4=['start','lodash','moment','ioredis','util','../logger','redis','defaults','Setting','find','chatTimeout','ChatInteraction','findAll','subtract','then','length','map','info','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions'];(function(_0x2649e2,_0x3e73be){var _0x4797d4=function(_0xfa2d8b){while(--_0xfa2d8b){_0x2649e2['push'](_0x2649e2['shift']());}};_0x4797d4(++_0x3e73be);}(_0x08c4,0x106));var _0x408c=function(_0x4bcdb4,_0xc52fa9){_0x4bcdb4=_0x4bcdb4-0x0;var _0x4eb83c=_0x08c4[_0x4bcdb4];return _0x4eb83c;};'use strict';var _=require(_0x408c('0x0'));var moment=require(_0x408c('0x1'));var Redis=require(_0x408c('0x2'));var util=require(_0x408c('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x408c('0x4'))('schedule');config[_0x408c('0x5')]=_[_0x408c('0x6')](config[_0x408c('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x408c('0x5')]));function closeInteractions(){var _0x2db5c3=0x0;var _0x3224b6=[];return db[_0x408c('0x7')][_0x408c('0x8')]({'raw':!![],'attributes':['id',_0x408c('0x9')],'where':{'id':0x1}})['then'](function(_0x15aeca){_0x2db5c3=_0x15aeca[_0x408c('0x9')];if(_0x2db5c3){return db[_0x408c('0xa')][_0x408c('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x408c('0xc')](_0x15aeca[_0x408c('0x9')],'minutes')}}});}else{return[];}})[_0x408c('0xd')](function(_0x491727){if(_0x491727&&_0x491727[_0x408c('0xe')]){_0x3224b6=_[_0x408c('0xf')](_0x491727||[],'id');logger[_0x408c('0x10')]('[CHAT]\x20Interactions\x20to\x20close:',_0x3224b6[_0x408c('0x11')]());return db[_0x408c('0xa')][_0x408c('0x12')]({'closeReason':_0x408c('0x13'),'disposition':_0x408c('0x14'),'closed':!![],'closedAt':moment()[_0x408c('0x15')](_0x408c('0x16'))},{'where':{'id':_0x3224b6}});}})['then'](function(){if(_0x3224b6&&_0x3224b6[_0x408c('0xe')]){logger[_0x408c('0x10')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x3224b6[_0x408c('0x11')]());for(var _0x533e17=0x0;_0x533e17<_0x3224b6['length'];_0x533e17++){io[_0x408c('0x17')](_0x408c('0x18'),{'id':_0x3224b6[_0x533e17],'closed':!![]});}}})[_0x408c('0x19')](function(_0x420536){logger[_0x408c('0x1a')](_0x408c('0x1b'),_0x420536?util['inspect'](_0x420536,{'showHidden':![],'depth':null}):'');});}exports[_0x408c('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index fa63b5a..3ec687c 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 _0x8da7=['exports'];(function(_0x1f56b7,_0x4ceccf){var _0x6b66fe=function(_0x50ab4f){while(--_0x50ab4f){_0x1f56b7['push'](_0x1f56b7['shift']());}};_0x6b66fe(++_0x4ceccf);}(_0x8da7,0x19b));var _0x78da=function(_0x271a34,_0x950180){_0x271a34=_0x271a34-0x0;var _0x2d4c4b=_0x8da7[_0x271a34];return _0x2d4c4b;};'use strict';function start(){var _0x56a164=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x56a164['startAllRefreshIntervals']();}module[_0x78da('0x0')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x4e14=['startAllRefreshIntervals','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x213128,_0x19760d){var _0x46bd40=function(_0xd4e4d){while(--_0xd4e4d){_0x213128['push'](_0x213128['shift']());}};_0x46bd40(++_0x19760d);}(_0x4e14,0x1a3));var _0x44e1=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x4e14[_0x29d94e];return _0x106237;};'use strict';function start(){var _0x5b5158=require(_0x44e1('0x0'));return _0x5b5158[_0x44e1('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index af73880..1bea613 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 _0xb9b4=['intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','my\x20id','resolve','cron','active','isBetween','startAt','endAt','add','add\x20cron','update','update\x20cron','stop\x20cron','run','start','util','path','moment','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','name','user','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','format','%s.%s','basename','extname','existsSync','status','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Sent','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','email\x20sent','catch','Smtp','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','jobs','map','toString','keyBy','difference'];(function(_0x3cb11a,_0x15f068){var _0x2451c7=function(_0x4042f3){while(--_0x4042f3){_0x3cb11a['push'](_0x3cb11a['shift']());}};_0x2451c7(++_0x15f068);}(_0xb9b4,0xbd));var _0x4b9b=function(_0x53983b,_0x1985b6){_0x53983b=_0x53983b-0x0;var _0x4d6c18=_0xb9b4[_0x53983b];return _0x4d6c18;};'use strict';var fs=require('fs');var util=require(_0x4b9b('0x0'));var path=require(_0x4b9b('0x1'));var _=require('lodash');var moment=require(_0x4b9b('0x2'));var CronJobManager=require(_0x4b9b('0x3'));var jayson=require('jayson/promise');var BPromise=require(_0x4b9b('0x4'));var logger=require(_0x4b9b('0x5'))(_0x4b9b('0x6'));var db=require(_0x4b9b('0x7'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x4b9b('0x8'));var client=jayson[_0x4b9b('0x9')][_0x4b9b('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x23fc26,_0x23e093){return function(){logger[_0x4b9b('0xb')](_0x4b9b('0xc'),_0x23fc26[_0x4b9b('0xd')]);var _0x3b11b1=!![];var _0x59f927=_0x23fc26[_0x4b9b('0xe')][_0x4b9b('0xf')]();var _0x4669b8={'account':_0x59f927,'message':{'from':util['format'](_0x4b9b('0x10'),_0x23fc26[_0x4b9b('0xe')][_0x4b9b('0x11')],_0x23fc26[_0x4b9b('0xe')][_0x4b9b('0xd')]||_0x23fc26['MailAccount']['Smtp'][_0x4b9b('0x12')]),'to':_0x23fc26['email'],'cc':_0x23fc26['cc'],'bcc':_0x23fc26['bcc'],'subject':util['format'](_0x4b9b('0x13'),_0x23e093[_0x4b9b('0x11')],_0x23fc26[_0x4b9b('0x14')],_0x23fc26[_0x4b9b('0x15')])}};var _0x27bbed=path[_0x4b9b('0x16')](__dirname,_0x4b9b('0x17'));var _0x44a4a2=_0x23e093[_0x4b9b('0x18')];var _0x5399f3=util[_0x4b9b('0x19')](_0x4b9b('0x1a'),path[_0x4b9b('0x1b')](_0x23e093['savename'],path[_0x4b9b('0x1c')](_0x23e093[_0x4b9b('0x18')])),'zip');var _0x1f2a80=path['join'](_0x27bbed,_0x44a4a2);var _0xf7c59c=path[_0x4b9b('0x16')](_0x27bbed,_0x5399f3);if(fs[_0x4b9b('0x1d')](_0x1f2a80)){_0x23e093[_0x4b9b('0x1e')]='Sent';_0x4669b8[_0x4b9b('0x1f')][_0x4b9b('0x20')]=[{'filename':_0x44a4a2,'path':_0x1f2a80}];_0x4669b8[_0x4b9b('0x1f')]['text']=util['format'](_0x4b9b('0x21'),JSON[_0x4b9b('0x22')](_0x23e093,null,0x2));}else if(fs[_0x4b9b('0x1d')](_0xf7c59c)){_0x23e093[_0x4b9b('0x1e')]=_0x4b9b('0x23');_0x4669b8[_0x4b9b('0x1f')]['attachments']=[{'filename':_0x5399f3,'path':_0xf7c59c}];}else{_0x4669b8[_0x4b9b('0x1f')][_0x4b9b('0x24')]=_0x4b9b('0x25');if(!_0x23fc26['sendIfEmpty']){_0x3b11b1=![];logger[_0x4b9b('0xb')](_0x4b9b('0x26'));}}if(_0x3b11b1){return client['request'](_0x4b9b('0x27'),_0x4669b8)[_0x4b9b('0x28')](function(_0x4a1819){if(_0x4a1819['error']){return logger[_0x4b9b('0x29')]('error\x20mail',JSON[_0x4b9b('0x22')](_0x4a1819));}return logger['info'](_0x4b9b('0x2a'));})[_0x4b9b('0x2b')](function(_0x5aea9d){return logger[_0x4b9b('0x29')]('error\x20mail',JSON[_0x4b9b('0x22')](_0x5aea9d));});}};}function handleError(){return function(_0xf48466){return logger['error'](JSON[_0x4b9b('0x22')](_0xf48466));};}function handleResult(_0x4fd217){return function(_0x97ce43){logger[_0x4b9b('0xb')]('data',JSON[_0x4b9b('0x22')](_0x97ce43));if(_0x4fd217[_0x4b9b('0xe')]&&_0x4fd217[_0x4b9b('0xe')][_0x4b9b('0x2c')]&&!_[_0x4b9b('0x2d')](_0x4fd217[_0x4b9b('0xd')])){setTimeout(handleSendEmail(_0x4fd217,_0x97ce43),0x3c*0x3e8);}};}function handleJob(_0x5a7bbe){return function(){try{if(_[_0x4b9b('0x2d')](_0x5a7bbe['subtractNumber'])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x4b9b('0x2d')](_0x5a7bbe[_0x4b9b('0x15')])){return logger[_0x4b9b('0xb')](_0x4b9b('0x2e'));}var _0x5cc32f={'startDate':moment()[_0x4b9b('0x2f')](_0x5a7bbe[_0x4b9b('0x14')],_0x5a7bbe['subtractUnit'])[_0x4b9b('0x19')](_0x4b9b('0x30')),'endDate':moment()['format'](_0x4b9b('0x30')),'type':_0x4b9b('0x31'),'output':_0x5a7bbe['output'],'name':_0x5a7bbe[_0x4b9b('0x11')]};if(!_[_0x4b9b('0x2d')](_0x5a7bbe['DefaultReportId'])){logger[_0x4b9b('0xb')]('exec\x20defaul\x20report\x20id:%s',_0x5a7bbe[_0x4b9b('0x32')]);return analyticDefaultReportController[_0x4b9b('0x33')]({'id':_0x5a7bbe[_0x4b9b('0x32')]},_0x5cc32f)[_0x4b9b('0x28')](handleResult(_0x5a7bbe))[_0x4b9b('0x2b')](handleError());}if(!_[_0x4b9b('0x2d')](_0x5a7bbe[_0x4b9b('0x34')])){logger[_0x4b9b('0xb')]('exec\x20custom\x20report\x20id:%s',_0x5a7bbe[_0x4b9b('0x34')]);return analyticCustomReportController['runReport']({'id':_0x5a7bbe[_0x4b9b('0x34')]},_0x5cc32f)['then'](handleResult(_0x5a7bbe))[_0x4b9b('0x2b')](handleError());}}catch(_0x39ab5a){logger[_0x4b9b('0x29')](JSON[_0x4b9b('0x22')](_0x39ab5a));}return logger[_0x4b9b('0xb')](_0x4b9b('0x35'));};}function getJobs(_0x422b8d){var _0x52b42e={};if(_0x422b8d){_0x52b42e['id']=_0x422b8d;}return db[_0x4b9b('0x36')][_0x4b9b('0x37')]({'where':_0x52b42e,'include':[{'model':db[_0x4b9b('0xe')],'attributes':['id',_0x4b9b('0x11'),_0x4b9b('0xd')],'include':[{'model':db[_0x4b9b('0x38')],'as':_0x4b9b('0x2c'),'include':[{'model':db[_0x4b9b('0x39')],'as':'CloudProvider'}]}]}]})[_0x4b9b('0x28')](function(_0x44d372){var _0x24da77=_['keys'](manager[_0x4b9b('0x3a')]);var _0x5d7113=_[_0x4b9b('0x3b')](_0x44d372,function(_0x3fec4f){return _0x3fec4f['id'][_0x4b9b('0x3c')]();});var _0xae9b7a=_[_0x4b9b('0x3d')](_0x44d372,function(_0x4642b2){return _0x4642b2['id'][_0x4b9b('0x3c')]();});var _0x3c58c8=_0x422b8d?_0x5d7113:_[_0x4b9b('0x3e')](_0x5d7113,_0x24da77);var _0x416b2e=_[_0x4b9b('0x3f')](_0x5d7113,_0x24da77);var _0x2e6a4a=_[_0x4b9b('0x3e')](_0x24da77,_0x5d7113);var _0x116afe;var _0x5b4062;for(_0x116afe=0x0;_0x116afe<_0x2e6a4a[_0x4b9b('0x40')]&&!_0x422b8d;_0x116afe+=0x1){_0x5b4062=_0x2e6a4a[_0x116afe]['toString']();if(manager[_0x4b9b('0x41')](_0x5b4062)){manager[_0x4b9b('0x42')](_0x5b4062);manager[_0x4b9b('0x43')](_0x5b4062);logger['info'](_0x4b9b('0x44'),_0x5b4062);}}logger[_0x4b9b('0xb')](_0x4b9b('0x45'),JSON[_0x4b9b('0x22')](_0x3c58c8));for(_0x116afe=0x0;_0x116afe<_0x3c58c8[_0x4b9b('0x40')];_0x116afe+=0x1){_0x5b4062=_0x3c58c8[_0x116afe]['toString']();logger[_0x4b9b('0xb')]('index',_0x5b4062);if(_0x422b8d){logger[_0x4b9b('0xb')](_0x4b9b('0x46'),_0x422b8d);logger[_0x4b9b('0xb')](JSON['stringify'](_0xae9b7a[_0x5b4062]));BPromise[_0x4b9b('0x47')]()[_0x4b9b('0x28')](handleJob(_0xae9b7a[_0x5b4062]));logger[_0x4b9b('0xb')]('run\x20job',_0xae9b7a[_0x5b4062]['name'],_0xae9b7a[_0x5b4062][_0x4b9b('0x48')]);}else if(_0xae9b7a[_0x5b4062][_0x4b9b('0x48')]&&_0xae9b7a[_0x5b4062][_0x4b9b('0x49')]&&moment()[_0x4b9b('0x4a')](_0xae9b7a[_0x5b4062][_0x4b9b('0x4b')],_0xae9b7a[_0x5b4062][_0x4b9b('0x4c')])){manager[_0x4b9b('0x4d')](_0x5b4062,_0xae9b7a[_0x5b4062][_0x4b9b('0x48')],handleJob(_0xae9b7a[_0x5b4062]));manager['start'](_0x5b4062);logger[_0x4b9b('0xb')](_0x4b9b('0x4e'),_0xae9b7a[_0x5b4062][_0x4b9b('0x11')],_0xae9b7a[_0x5b4062][_0x4b9b('0x48')]);}else if(manager[_0x4b9b('0x41')](_0x5b4062)){manager[_0x4b9b('0x42')](_0x5b4062);manager['deleteJob'](_0x5b4062);logger[_0x4b9b('0xb')]('stop\x20cron',_0xae9b7a[_0x5b4062][_0x4b9b('0x11')],_0xae9b7a[_0x5b4062][_0x4b9b('0x48')]);}}for(_0x116afe=0x0,_0x5b4062;_0x116afe<_0x416b2e[_0x4b9b('0x40')]&&!_0x422b8d;_0x116afe+=0x1){_0x5b4062=_0x416b2e[_0x116afe][_0x4b9b('0x3c')]();if(manager[_0x4b9b('0x41')](_0x5b4062)){if(_0xae9b7a[_0x5b4062]['cron']&&_0xae9b7a[_0x5b4062][_0x4b9b('0x49')]&&moment()['isBetween'](_0xae9b7a[_0x5b4062][_0x4b9b('0x4b')],_0xae9b7a[_0x5b4062][_0x4b9b('0x4c')])){manager[_0x4b9b('0x4f')](_0x5b4062,_0xae9b7a[_0x5b4062]['cron'],handleJob(_0xae9b7a[_0x5b4062]));logger[_0x4b9b('0xb')](_0x4b9b('0x50'),_0xae9b7a[_0x5b4062][_0x4b9b('0x11')],_0xae9b7a[_0x5b4062][_0x4b9b('0x48')]);}else{manager[_0x4b9b('0x42')](_0x5b4062);manager['deleteJob'](_0x5b4062);logger[_0x4b9b('0xb')](_0x4b9b('0x51'),_0xae9b7a[_0x5b4062][_0x4b9b('0x11')],_0xae9b7a[_0x5b4062][_0x4b9b('0x48')]);}}}})[_0x4b9b('0x2b')](function(_0xbd60c0){logger[_0x4b9b('0x29')](JSON[_0x4b9b('0x22')](_0xbd60c0));});}exports[_0x4b9b('0x52')]=function(_0x595fcf){return getJobs(_0x595fcf);};exports[_0x4b9b('0x53')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x4764=['text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','keys','jobs','toString','keyBy','difference','intersection','exists','stop','deleteJob','toRun','resolve','run\x20job','cron','active','endAt','add','start','add\x20cron','stop\x20cron','length','update','update\x20cron','run','util','path','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','MailAccount','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','../../files/reports','savename','%s.%s','basename','extname','join','existsSync','status','message','attachments'];(function(_0x5e1ee2,_0x5bfd9e){var _0x3b2474=function(_0x22526e){while(--_0x22526e){_0x5e1ee2['push'](_0x5e1ee2['shift']());}};_0x3b2474(++_0x5bfd9e);}(_0x4764,0x7f));var _0x4476=function(_0x2f746b,_0x2da6b9){_0x2f746b=_0x2f746b-0x0;var _0x56e063=_0x4764[_0x2f746b];return _0x56e063;};'use strict';var fs=require('fs');var util=require(_0x4476('0x0'));var path=require(_0x4476('0x1'));var _=require(_0x4476('0x2'));var moment=require(_0x4476('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x4476('0x4'));var BPromise=require(_0x4476('0x5'));var logger=require(_0x4476('0x6'))(_0x4476('0x7'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x4476('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0x4476('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5835f1,_0x23c754){return function(){logger[_0x4476('0xa')](_0x4476('0xb'),_0x5835f1[_0x4476('0xc')]);var _0x507afb=!![];var _0x413f65=_0x5835f1['MailAccount'][_0x4476('0xd')]();var _0x376b8b={'account':_0x413f65,'message':{'from':util[_0x4476('0xe')](_0x4476('0xf'),_0x5835f1[_0x4476('0x10')][_0x4476('0x11')],_0x5835f1[_0x4476('0x10')][_0x4476('0xc')]||_0x5835f1[_0x4476('0x10')][_0x4476('0x12')][_0x4476('0x13')]),'to':_0x5835f1[_0x4476('0xc')],'cc':_0x5835f1['cc'],'bcc':_0x5835f1[_0x4476('0x14')],'subject':util[_0x4476('0xe')](_0x4476('0x15'),_0x23c754[_0x4476('0x11')],_0x5835f1['subtractNumber'],_0x5835f1[_0x4476('0x16')])}};var _0x326463=path['join'](__dirname,_0x4476('0x17'));var _0x267d73=_0x23c754[_0x4476('0x18')];var _0x3b6000=util[_0x4476('0xe')](_0x4476('0x19'),path[_0x4476('0x1a')](_0x23c754[_0x4476('0x18')],path[_0x4476('0x1b')](_0x23c754[_0x4476('0x18')])),'zip');var _0x5dcbb0=path[_0x4476('0x1c')](_0x326463,_0x267d73);var _0x511024=path[_0x4476('0x1c')](_0x326463,_0x3b6000);if(fs[_0x4476('0x1d')](_0x5dcbb0)){_0x23c754[_0x4476('0x1e')]='Sent';_0x376b8b[_0x4476('0x1f')][_0x4476('0x20')]=[{'filename':_0x267d73,'path':_0x5dcbb0}];_0x376b8b['message'][_0x4476('0x21')]=util['format'](_0x4476('0x22'),JSON[_0x4476('0x23')](_0x23c754,null,0x2));}else if(fs[_0x4476('0x1d')](_0x511024)){_0x23c754[_0x4476('0x1e')]=_0x4476('0x24');_0x376b8b['message'][_0x4476('0x20')]=[{'filename':_0x3b6000,'path':_0x511024}];}else{_0x376b8b[_0x4476('0x1f')]['text']=_0x4476('0x25');if(!_0x5835f1['sendIfEmpty']){_0x507afb=![];logger[_0x4476('0xa')](_0x4476('0x26'));}}if(_0x507afb){return client['request']('SendMail',_0x376b8b)[_0x4476('0x27')](function(_0x454363){if(_0x454363[_0x4476('0x28')]){return logger['error'](_0x4476('0x29'),JSON['stringify'](_0x454363));}return logger[_0x4476('0xa')](_0x4476('0x2a'));})[_0x4476('0x2b')](function(_0x49c6b8){return logger[_0x4476('0x28')](_0x4476('0x29'),JSON[_0x4476('0x23')](_0x49c6b8));});}};}function handleError(){return function(_0x2b98fd){return logger[_0x4476('0x28')](JSON[_0x4476('0x23')](_0x2b98fd));};}function handleResult(_0x5cd779){return function(_0x194a35){logger[_0x4476('0xa')](_0x4476('0x2c'),JSON[_0x4476('0x23')](_0x194a35));if(_0x5cd779['MailAccount']&&_0x5cd779[_0x4476('0x10')][_0x4476('0x12')]&&!_[_0x4476('0x2d')](_0x5cd779[_0x4476('0xc')])){setTimeout(handleSendEmail(_0x5cd779,_0x194a35),0x3c*0x3e8);}};}function handleJob(_0x1ebcc8){return function(){try{if(_[_0x4476('0x2d')](_0x1ebcc8[_0x4476('0x2e')])){return logger['info'](_0x4476('0x2f'));}if(_[_0x4476('0x2d')](_0x1ebcc8['subtractUnit'])){return logger[_0x4476('0xa')](_0x4476('0x30'));}var _0x528808={'startDate':moment()[_0x4476('0x31')](_0x1ebcc8[_0x4476('0x2e')],_0x1ebcc8[_0x4476('0x16')])[_0x4476('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x4476('0xe')](_0x4476('0x32')),'type':_0x4476('0x33'),'output':_0x1ebcc8['output'],'name':_0x1ebcc8[_0x4476('0x11')]};if(!_[_0x4476('0x2d')](_0x1ebcc8['DefaultReportId'])){logger[_0x4476('0xa')]('exec\x20defaul\x20report\x20id:%s',_0x1ebcc8['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x1ebcc8['DefaultReportId']},_0x528808)[_0x4476('0x27')](handleResult(_0x1ebcc8))[_0x4476('0x2b')](handleError());}if(!_[_0x4476('0x2d')](_0x1ebcc8[_0x4476('0x34')])){logger[_0x4476('0xa')](_0x4476('0x35'),_0x1ebcc8[_0x4476('0x34')]);return analyticCustomReportController['runReport']({'id':_0x1ebcc8[_0x4476('0x34')]},_0x528808)[_0x4476('0x27')](handleResult(_0x1ebcc8))['catch'](handleError());}}catch(_0x38add7){logger[_0x4476('0x28')](JSON[_0x4476('0x23')](_0x38add7));}return logger[_0x4476('0xa')](_0x4476('0x36'));};}function getJobs(_0x28ffbf){var _0x1cdf4a={};if(_0x28ffbf){_0x1cdf4a['id']=_0x28ffbf;}return db[_0x4476('0x37')][_0x4476('0x38')]({'where':_0x1cdf4a,'include':[{'model':db['MailAccount'],'attributes':['id',_0x4476('0x11'),_0x4476('0xc')],'include':[{'model':db['MailServerOut'],'as':_0x4476('0x12'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]}]})[_0x4476('0x27')](function(_0x495743){var _0x58456a=_[_0x4476('0x39')](manager[_0x4476('0x3a')]);var _0x4c3293=_['map'](_0x495743,function(_0x144c4d){return _0x144c4d['id'][_0x4476('0x3b')]();});var _0x550355=_[_0x4476('0x3c')](_0x495743,function(_0x506049){return _0x506049['id'][_0x4476('0x3b')]();});var _0xc23a74=_0x28ffbf?_0x4c3293:_[_0x4476('0x3d')](_0x4c3293,_0x58456a);var _0xa2b247=_[_0x4476('0x3e')](_0x4c3293,_0x58456a);var _0x72df4c=_['difference'](_0x58456a,_0x4c3293);var _0x50fcbb;var _0x7be98d;for(_0x50fcbb=0x0;_0x50fcbb<_0x72df4c['length']&&!_0x28ffbf;_0x50fcbb+=0x1){_0x7be98d=_0x72df4c[_0x50fcbb][_0x4476('0x3b')]();if(manager[_0x4476('0x3f')](_0x7be98d)){manager[_0x4476('0x40')](_0x7be98d);manager[_0x4476('0x41')](_0x7be98d);logger['info']('delete\x20cron',_0x7be98d);}}logger['info'](_0x4476('0x42'),JSON[_0x4476('0x23')](_0xc23a74));for(_0x50fcbb=0x0;_0x50fcbb<_0xc23a74['length'];_0x50fcbb+=0x1){_0x7be98d=_0xc23a74[_0x50fcbb]['toString']();logger[_0x4476('0xa')]('index',_0x7be98d);if(_0x28ffbf){logger[_0x4476('0xa')]('my\x20id',_0x28ffbf);logger['info'](JSON['stringify'](_0x550355[_0x7be98d]));BPromise[_0x4476('0x43')]()[_0x4476('0x27')](handleJob(_0x550355[_0x7be98d]));logger['info'](_0x4476('0x44'),_0x550355[_0x7be98d][_0x4476('0x11')],_0x550355[_0x7be98d][_0x4476('0x45')]);}else if(_0x550355[_0x7be98d]['cron']&&_0x550355[_0x7be98d][_0x4476('0x46')]&&moment()['isBetween'](_0x550355[_0x7be98d]['startAt'],_0x550355[_0x7be98d][_0x4476('0x47')])){manager[_0x4476('0x48')](_0x7be98d,_0x550355[_0x7be98d][_0x4476('0x45')],handleJob(_0x550355[_0x7be98d]));manager[_0x4476('0x49')](_0x7be98d);logger[_0x4476('0xa')](_0x4476('0x4a'),_0x550355[_0x7be98d]['name'],_0x550355[_0x7be98d]['cron']);}else if(manager['exists'](_0x7be98d)){manager[_0x4476('0x40')](_0x7be98d);manager[_0x4476('0x41')](_0x7be98d);logger[_0x4476('0xa')](_0x4476('0x4b'),_0x550355[_0x7be98d][_0x4476('0x11')],_0x550355[_0x7be98d][_0x4476('0x45')]);}}for(_0x50fcbb=0x0,_0x7be98d;_0x50fcbb<_0xa2b247[_0x4476('0x4c')]&&!_0x28ffbf;_0x50fcbb+=0x1){_0x7be98d=_0xa2b247[_0x50fcbb][_0x4476('0x3b')]();if(manager['exists'](_0x7be98d)){if(_0x550355[_0x7be98d][_0x4476('0x45')]&&_0x550355[_0x7be98d]['active']&&moment()['isBetween'](_0x550355[_0x7be98d]['startAt'],_0x550355[_0x7be98d][_0x4476('0x47')])){manager[_0x4476('0x4d')](_0x7be98d,_0x550355[_0x7be98d]['cron'],handleJob(_0x550355[_0x7be98d]));logger[_0x4476('0xa')](_0x4476('0x4e'),_0x550355[_0x7be98d][_0x4476('0x11')],_0x550355[_0x7be98d]['cron']);}else{manager[_0x4476('0x40')](_0x7be98d);manager[_0x4476('0x41')](_0x7be98d);logger['info']('stop\x20cron',_0x550355[_0x7be98d][_0x4476('0x11')],_0x550355[_0x7be98d][_0x4476('0x45')]);}}}})[_0x4476('0x2b')](function(_0x2132f0){logger[_0x4476('0x28')](JSON[_0x4476('0x23')](_0x2132f0));});}exports[_0x4476('0x4f')]=function(_0x4ec631){return getJobs(_0x4ec631);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 35f24a6..b4a18a0 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 _0x7cda=['TranscriptionJob','fileText','TranscriptionJobStatus','Transcript','TranscriptFileUri','then','transcripts','length','results','tempSentiment','Sequelize','sentimentAccountId','language','bucket','ValidationError','CloudProvider','Cloud\x20Provider\x20not\x20available','sentimentRegion','update','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20configured','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Negative','COMPLETED','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','all','inspect','start','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','getTranscriptionJob','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','info'];(function(_0x57b432,_0x1589a0){var _0x2edf2a=function(_0x20edfc){while(--_0x20edfc){_0x57b432['push'](_0x57b432['shift']());}};_0x2edf2a(++_0x1589a0);}(_0x7cda,0xf6));var _0xa7cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cda[_0x3dd15e];return _0x231fd0;};var _=require('lodash');var AWS=require(_0xa7cd('0x0'));var rp=require(_0xa7cd('0x1'));var util=require(_0xa7cd('0x2'));var BPromise=require('bluebird');var db=require(_0xa7cd('0x3'))['db'];var logger=require(_0xa7cd('0x4'))('transcribe');function getTranscriptionJob(_0x232be5,_0xdb8470,_0x5560e0,_0x37990d){return new Promise(function(_0x5f20a2,_0x3d43e6){var _0x5c2b39=new AWS['TranscribeService']({'accessKeyId':_0xdb8470,'secretAccessKey':_0x232be5,'region':_0x5560e0});_0x5c2b39[_0xa7cd('0x5')]({'TranscriptionJobName':_0x37990d},function(_0x4a9e39,_0x2554e8){if(_0x4a9e39){return _0x3d43e6(_0x4a9e39);}else{return _0x5f20a2(_0x2554e8);}});});}function sentiment(_0x205075,_0x108be3,_0x6d21d3,_0x31879f,_0x372273){return new Promise(function(_0x39d8c4,_0x1a66f7){var _0xd20e5d=new AWS['Comprehend']({'accessKeyId':_0x108be3,'secretAccessKey':_0x205075,'region':_0x6d21d3});_0xd20e5d['detectSentiment']({'Text':_0x31879f,'LanguageCode':_0x372273[_0xa7cd('0x6')](0x0,0x2)},function(_0xf902eb,_0x53cf92){if(_0xf902eb){return _0x1a66f7(_0xf902eb);}else{return _0x39d8c4(_0x53cf92);}});});}function checkTranscribeJob(_0xc60cec,_0x4056ee,_0x57fb93){var _0x3bbf3b;return new BPromise(function(_0x3f72f8,_0x136aae){logger['info'](util[_0xa7cd('0x7')](_0xa7cd('0x8'),_0xc60cec['id'],_0xc60cec[_0xa7cd('0x9')]));return getTranscriptionJob(_0x57fb93[_0xa7cd('0xa')],_0x57fb93[_0xa7cd('0xb')],_0x4056ee[_0xa7cd('0xc')],_0xc60cec['transcribeName'])['then'](function(_0x44d991){logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0xc60cec['id'],_0xc60cec[_0xa7cd('0x9')],_0x44d991[_0xa7cd('0xe')]['TranscriptionJobStatus']));if(!_0xc60cec[_0xa7cd('0xf')]){switch(_0x44d991[_0xa7cd('0xe')][_0xa7cd('0x10')]){case'COMPLETED':var _0x111774={'transcribeStatus':_0x44d991[_0xa7cd('0xe')]['TranscriptionJobStatus'],'fileUri':_0x44d991[_0xa7cd('0xe')][_0xa7cd('0x11')][_0xa7cd('0x12')]};logger['info'](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0xc60cec['id']));return rp({'uri':_0x44d991[_0xa7cd('0xe')]['Transcript']['TranscriptFileUri'],'json':!![]})[_0xa7cd('0x13')](function(_0x4dc29b){logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0xc60cec['id']));if(_0x4dc29b&&_0x4dc29b['results']&&_0x4dc29b['results'][_0xa7cd('0x14')]&&_0x4dc29b['results'][_0xa7cd('0x14')][_0xa7cd('0x15')]){_0x111774['fileText']='';for(var _0x39f093=0x0;_0x39f093<_0x4dc29b['results'][_0xa7cd('0x14')][_0xa7cd('0x15')];_0x39f093++){_0x111774['fileText']+=_0x4dc29b[_0xa7cd('0x16')][_0xa7cd('0x14')][_0x39f093]['transcript']+'';}}return _0xc60cec['update'](_0x111774);})[_0xa7cd('0x13')](function(){logger['info'](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xc60cec['id']));if(!_0xc60cec[_0xa7cd('0x17')]){throw new db[(_0xa7cd('0x18'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4056ee['sentiment']||!_0x4056ee[_0xa7cd('0x19')]||!_0x4056ee['sentimentRegion']||!_0x4056ee[_0xa7cd('0x1a')]||!_0x4056ee[_0xa7cd('0x1b')]){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x111774[_0xa7cd('0xf')]){throw new Error('Transcript\x20not\x20available');}if(_0x4056ee[_0xa7cd('0x19')]===_0x57fb93['id']){return _0x57fb93;}else{return db[_0xa7cd('0x1d')]['findOne']({'where':{'id':_settings[_0xa7cd('0x19')]}});}})[_0xa7cd('0x13')](function(_0xb4cfa){if(!_0xb4cfa){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))](_0xa7cd('0x1e'));}if(!_0xb4cfa[_0xa7cd('0xa')]||!_0xb4cfa[_0xa7cd('0xb')]){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))]('Cloud\x20Provider\x20not\x20configured');}_0x3bbf3b=_0xb4cfa;logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0xc60cec['id']));return sentiment(_0x3bbf3b['data1'],_0x3bbf3b[_0xa7cd('0xb')],_0x4056ee[_0xa7cd('0x1f')],_0x111774['fileText'],_0x4056ee[_0xa7cd('0x1a')]);})[_0xa7cd('0x13')](function(_0x29c3d2){logger['info'](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0xc60cec['id']));return _0xc60cec[_0xa7cd('0x20')]({'sentiment':_0x29c3d2[_0xa7cd('0x21')],'sPositive':_0x29c3d2[_0xa7cd('0x22')][_0xa7cd('0x23')],'sNegative':_0x29c3d2['SentimentScore']['Negative'],'sMixed':_0x29c3d2[_0xa7cd('0x22')][_0xa7cd('0x24')],'sNeutral':_0x29c3d2[_0xa7cd('0x22')][_0xa7cd('0x25')]});})[_0xa7cd('0x13')](function(){logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xc60cec['id']));_0x3f72f8();});case _0xa7cd('0x26'):return _0xc60cec[_0xa7cd('0x20')]({'transcribeStatus':_0xa7cd('0x26'),'failureReason':_0x44d991[_0xa7cd('0xe')][_0xa7cd('0x27')]})[_0xa7cd('0x13')](function(){logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xc60cec['id']));_0x3f72f8();});default:logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')](_0xa7cd('0x28'),_0xc60cec['id']));break;}}else{return BPromise[_0xa7cd('0x29')]()[_0xa7cd('0x13')](function(){if(!_0xc60cec[_0xa7cd('0x17')]){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4056ee['sentiment']||!_0x4056ee[_0xa7cd('0x19')]||!_0x4056ee[_0xa7cd('0x1f')]||!_0x4056ee[_0xa7cd('0x1a')]||!_0x4056ee['bucket']){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))](_0xa7cd('0x2a'));}if(!_0xc60cec[_0xa7cd('0xf')]){throw new Error('Transcript\x20not\x20available');}if(_0x4056ee[_0xa7cd('0x19')]===_0x57fb93['id']){return _0x57fb93;}else{return db[_0xa7cd('0x1d')][_0xa7cd('0x2b')]({'where':{'id':_settings[_0xa7cd('0x19')]}});}})['then'](function(_0x5d2b48){if(!_0x5d2b48){throw new db['Sequelize'][(_0xa7cd('0x1c'))](_0xa7cd('0x1e'));}if(!_0x5d2b48[_0xa7cd('0xa')]||!_0x5d2b48['data2']){throw new db['Sequelize'][(_0xa7cd('0x1c'))](_0xa7cd('0x2c'));}_0x3bbf3b=_0x5d2b48;logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')](_0xa7cd('0x2d'),_0xc60cec['id']));return sentiment(_0x3bbf3b[_0xa7cd('0xa')],_0x3bbf3b[_0xa7cd('0xb')],_0x4056ee[_0xa7cd('0x1f')],_0xc60cec[_0xa7cd('0xf')],_0x4056ee[_0xa7cd('0x1a')]);})[_0xa7cd('0x13')](function(_0x31577f){logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')](_0xa7cd('0x2e'),_0xc60cec['id']));return _0xc60cec[_0xa7cd('0x20')]({'sentiment':_0x31577f['Sentiment'],'sPositive':_0x31577f[_0xa7cd('0x22')][_0xa7cd('0x23')],'sNegative':_0x31577f[_0xa7cd('0x22')][_0xa7cd('0x2f')],'sMixed':_0x31577f[_0xa7cd('0x22')][_0xa7cd('0x24')],'sNeutral':_0x31577f[_0xa7cd('0x22')]['Neutral'],'transcribeStatus':_0xa7cd('0x30')});})[_0xa7cd('0x13')](function(){logger[_0xa7cd('0xd')](util['format'](_0xa7cd('0x31'),_0xc60cec['id']));_0x3f72f8();});}})[_0xa7cd('0x32')](function(_0x6ee082){if(_0x6ee082){if(!_0x6ee082[_0xa7cd('0x33')]||_0x6ee082[_0xa7cd('0x33')]!==_0xa7cd('0x34')){logger[_0xa7cd('0x35')](util[_0xa7cd('0x7')](_0xa7cd('0x36'),_0xc60cec['id']),util['inspect'](_0x6ee082,{'showHidden':![],'depth':null}));}}_0x3f72f8();});});}function checkTranscribe(){var _0x5d1d6d;var _0x54299b;var _0x35e023;return db[_0xa7cd('0x37')][_0xa7cd('0x38')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xa7cd('0x13')](function(_0x2104fe){if(!_0x2104fe||!_0x2104fe['length']){throw new db['Sequelize']['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x5d1d6d=_0x2104fe;return db[_0xa7cd('0x39')][_0xa7cd('0x2b')]({'where':{'id':0x1}});})[_0xa7cd('0x13')](function(_0x11f0d0){if(!_0x11f0d0){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))](_0xa7cd('0x3a'));}_0x54299b=_0x11f0d0;if(!_0x54299b['transcribe']||!_0x54299b[_0xa7cd('0x3b')]||!_0x54299b['transcribeRegion']||!_0x54299b[_0xa7cd('0x1a')]||!_0x54299b[_0xa7cd('0x1b')]){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))](_0xa7cd('0x3c'));}return db[_0xa7cd('0x1d')][_0xa7cd('0x2b')]({'where':{'id':_0x54299b['transcribeAccountId']}});})[_0xa7cd('0x13')](function(_0x51c67f){if(!_0x51c67f){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))](_0xa7cd('0x1e'));}if(!_0x51c67f[_0xa7cd('0xa')]||!_0x51c67f[_0xa7cd('0xb')]){throw new db['Sequelize']['ValidationError'](_0xa7cd('0x2c'));}_0x35e023=_0x51c67f;var _0x46b48a=[];_0x5d1d6d[_0xa7cd('0x3d')](function(_0x2101ea){_0x46b48a['push'](checkTranscribeJob(_0x2101ea,_0x54299b,_0x35e023));});return BPromise[_0xa7cd('0x3e')](_0x46b48a);})[_0xa7cd('0x32')](function(_0x2dd1a2){if(_0x2dd1a2){if(!_0x2dd1a2[_0xa7cd('0x33')]||_0x2dd1a2['name']!=='SequelizeValidationError'){logger['error'](util[_0xa7cd('0x3f')](_0x2dd1a2,{'showHidden':![],'depth':null}));}}});}exports[_0xa7cd('0x40')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x566f=['lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data2','transcribeRegion','then','format','transcribeName','TranscriptionJobStatus','fileText','COMPLETED','TranscriptionJob','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','bucket','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','sentiment','CloudProvider','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','push','all','SequelizeValidationError','start'];(function(_0x288936,_0x36b619){var _0x1c7a30=function(_0x493ecf){while(--_0x493ecf){_0x288936['push'](_0x288936['shift']());}};_0x1c7a30(++_0x36b619);}(_0x566f,0x124));var _0xf566=function(_0x513795,_0x1de034){_0x513795=_0x513795-0x0;var _0xd484e=_0x566f[_0x513795];return _0xd484e;};var _=require(_0xf566('0x0'));var AWS=require(_0xf566('0x1'));var rp=require(_0xf566('0x2'));var util=require(_0xf566('0x3'));var BPromise=require(_0xf566('0x4'));var db=require(_0xf566('0x5'))['db'];var logger=require(_0xf566('0x6'))(_0xf566('0x7'));function getTranscriptionJob(_0x5eef34,_0xae69b5,_0x41a6be,_0x1a6dbc){return new Promise(function(_0x117398,_0x5898ea){var _0xacfc48=new AWS[(_0xf566('0x8'))]({'accessKeyId':_0xae69b5,'secretAccessKey':_0x5eef34,'region':_0x41a6be});_0xacfc48[_0xf566('0x9')]({'TranscriptionJobName':_0x1a6dbc},function(_0x1e33fa,_0x588e82){if(_0x1e33fa){return _0x5898ea(_0x1e33fa);}else{return _0x117398(_0x588e82);}});});}function sentiment(_0x2dd9f6,_0x5bf147,_0x112610,_0x18c2cc,_0x20c0bd){return new Promise(function(_0x357b9e,_0x537530){var _0x26ab55=new AWS[(_0xf566('0xa'))]({'accessKeyId':_0x5bf147,'secretAccessKey':_0x2dd9f6,'region':_0x112610});_0x26ab55[_0xf566('0xb')]({'Text':_0x18c2cc,'LanguageCode':_0x20c0bd[_0xf566('0xc')](0x0,0x2)},function(_0x3efa0d,_0x19408f){if(_0x3efa0d){return _0x537530(_0x3efa0d);}else{return _0x357b9e(_0x19408f);}});});}function checkTranscribeJob(_0x4aec5b,_0x3f15a6,_0x5d6937){var _0x1c1e09;return new BPromise(function(_0x272691,_0x1ed8ab){logger[_0xf566('0xd')](util['format'](_0xf566('0xe'),_0x4aec5b['id'],_0x4aec5b['transcribeName']));return getTranscriptionJob(_0x5d6937['data1'],_0x5d6937[_0xf566('0xf')],_0x3f15a6[_0xf566('0x10')],_0x4aec5b['transcribeName'])[_0xf566('0x11')](function(_0x312f10){logger['info'](util[_0xf566('0x12')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x4aec5b['id'],_0x4aec5b[_0xf566('0x13')],_0x312f10['TranscriptionJob'][_0xf566('0x14')]));if(!_0x4aec5b[_0xf566('0x15')]){switch(_0x312f10['TranscriptionJob'][_0xf566('0x14')]){case _0xf566('0x16'):var _0x21b2d0={'transcribeStatus':_0x312f10[_0xf566('0x17')]['TranscriptionJobStatus'],'fileUri':_0x312f10[_0xf566('0x17')][_0xf566('0x18')][_0xf566('0x19')]};logger['info'](util[_0xf566('0x12')](_0xf566('0x1a'),_0x4aec5b['id']));return rp({'uri':_0x312f10[_0xf566('0x17')][_0xf566('0x18')][_0xf566('0x19')],'json':!![]})[_0xf566('0x11')](function(_0x2ff105){logger[_0xf566('0xd')](util[_0xf566('0x12')](_0xf566('0x1b'),_0x4aec5b['id']));if(_0x2ff105&&_0x2ff105[_0xf566('0x1c')]&&_0x2ff105['results'][_0xf566('0x1d')]&&_0x2ff105[_0xf566('0x1c')]['transcripts'][_0xf566('0x1e')]){_0x21b2d0[_0xf566('0x15')]='';for(var _0x2e1b4f=0x0;_0x2e1b4f<_0x2ff105[_0xf566('0x1c')][_0xf566('0x1d')][_0xf566('0x1e')];_0x2e1b4f++){_0x21b2d0[_0xf566('0x15')]+=_0x2ff105['results']['transcripts'][_0x2e1b4f][_0xf566('0x1f')]+'';}}return _0x4aec5b[_0xf566('0x20')](_0x21b2d0);})[_0xf566('0x11')](function(){logger[_0xf566('0xd')](util[_0xf566('0x12')](_0xf566('0x21'),_0x4aec5b['id']));if(!_0x4aec5b['tempSentiment']){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))](_0xf566('0x24'));}if(!_0x3f15a6['sentiment']||!_0x3f15a6[_0xf566('0x25')]||!_0x3f15a6[_0xf566('0x26')]||!_0x3f15a6['language']||!_0x3f15a6[_0xf566('0x27')]){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x21b2d0[_0xf566('0x15')]){throw new Error(_0xf566('0x28'));}if(_0x3f15a6[_0xf566('0x25')]===_0x5d6937['id']){return _0x5d6937;}else{return db['CloudProvider'][_0xf566('0x29')]({'where':{'id':_settings[_0xf566('0x25')]}});}})['then'](function(_0x577d6a){if(!_0x577d6a){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))](_0xf566('0x2a'));}if(!_0x577d6a[_0xf566('0x2b')]||!_0x577d6a[_0xf566('0xf')]){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))](_0xf566('0x2c'));}_0x1c1e09=_0x577d6a;logger[_0xf566('0xd')](util[_0xf566('0x12')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4aec5b['id']));return sentiment(_0x1c1e09[_0xf566('0x2b')],_0x1c1e09['data2'],_0x3f15a6[_0xf566('0x26')],_0x21b2d0[_0xf566('0x15')],_0x3f15a6[_0xf566('0x2d')]);})[_0xf566('0x11')](function(_0x477492){logger[_0xf566('0xd')](util[_0xf566('0x12')](_0xf566('0x2e'),_0x4aec5b['id']));return _0x4aec5b[_0xf566('0x20')]({'sentiment':_0x477492[_0xf566('0x2f')],'sPositive':_0x477492[_0xf566('0x30')][_0xf566('0x31')],'sNegative':_0x477492[_0xf566('0x30')][_0xf566('0x32')],'sMixed':_0x477492[_0xf566('0x30')][_0xf566('0x33')],'sNeutral':_0x477492[_0xf566('0x30')][_0xf566('0x34')]});})[_0xf566('0x11')](function(){logger[_0xf566('0xd')](util[_0xf566('0x12')](_0xf566('0x21'),_0x4aec5b['id']));_0x272691();});case _0xf566('0x35'):return _0x4aec5b['update']({'transcribeStatus':_0xf566('0x35'),'failureReason':_0x312f10['TranscriptionJob']['FailureReason']})['then'](function(){logger[_0xf566('0xd')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4aec5b['id']));_0x272691();});default:logger[_0xf566('0xd')](util['format'](_0xf566('0x36'),_0x4aec5b['id']));break;}}else{return BPromise['resolve']()[_0xf566('0x11')](function(){if(!_0x4aec5b['tempSentiment']){throw new db['Sequelize'][(_0xf566('0x23'))](_0xf566('0x24'));}if(!_0x3f15a6[_0xf566('0x37')]||!_0x3f15a6['sentimentAccountId']||!_0x3f15a6[_0xf566('0x26')]||!_0x3f15a6['language']||!_0x3f15a6['bucket']){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x4aec5b[_0xf566('0x15')]){throw new Error(_0xf566('0x28'));}if(_0x3f15a6[_0xf566('0x25')]===_0x5d6937['id']){return _0x5d6937;}else{return db[_0xf566('0x38')][_0xf566('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x1444f5){if(!_0x1444f5){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))](_0xf566('0x2a'));}if(!_0x1444f5['data1']||!_0x1444f5[_0xf566('0xf')]){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))](_0xf566('0x2c'));}_0x1c1e09=_0x1444f5;logger[_0xf566('0xd')](util[_0xf566('0x12')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4aec5b['id']));return sentiment(_0x1c1e09[_0xf566('0x2b')],_0x1c1e09[_0xf566('0xf')],_0x3f15a6['sentimentRegion'],_0x4aec5b['fileText'],_0x3f15a6['language']);})[_0xf566('0x11')](function(_0x393d51){logger[_0xf566('0xd')](util[_0xf566('0x12')](_0xf566('0x2e'),_0x4aec5b['id']));return _0x4aec5b[_0xf566('0x20')]({'sentiment':_0x393d51['Sentiment'],'sPositive':_0x393d51[_0xf566('0x30')]['Positive'],'sNegative':_0x393d51[_0xf566('0x30')]['Negative'],'sMixed':_0x393d51[_0xf566('0x30')][_0xf566('0x33')],'sNeutral':_0x393d51[_0xf566('0x30')]['Neutral'],'transcribeStatus':_0xf566('0x16')});})[_0xf566('0x11')](function(){logger['info'](util[_0xf566('0x12')](_0xf566('0x21'),_0x4aec5b['id']));_0x272691();});}})[_0xf566('0x39')](function(_0x49c462){if(_0x49c462){if(!_0x49c462['name']||_0x49c462[_0xf566('0x3a')]!=='SequelizeValidationError'){logger[_0xf566('0x3b')](util['format'](_0xf566('0x3c'),_0x4aec5b['id']),util[_0xf566('0x3d')](_0x49c462,{'showHidden':![],'depth':null}));}}_0x272691();});});}function checkTranscribe(){var _0x53973a;var _0x31288d;var _0x4aa16f;return db[_0xf566('0x3e')][_0xf566('0x3f')]({'where':{'transcribeStatus':_0xf566('0x40')}})[_0xf566('0x11')](function(_0x5b731c){if(!_0x5b731c||!_0x5b731c[_0xf566('0x1e')]){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))](_0xf566('0x41'));}_0x53973a=_0x5b731c;return db['Setting'][_0xf566('0x29')]({'where':{'id':0x1}});})[_0xf566('0x11')](function(_0x253736){if(!_0x253736){throw new db['Sequelize'][(_0xf566('0x23'))](_0xf566('0x42'));}_0x31288d=_0x253736;if(!_0x31288d[_0xf566('0x7')]||!_0x31288d[_0xf566('0x43')]||!_0x31288d['transcribeRegion']||!_0x31288d[_0xf566('0x2d')]||!_0x31288d[_0xf566('0x27')]){throw new db['Sequelize'][(_0xf566('0x23'))](_0xf566('0x44'));}return db['CloudProvider'][_0xf566('0x29')]({'where':{'id':_0x31288d['transcribeAccountId']}});})[_0xf566('0x11')](function(_0xb50a2){if(!_0xb50a2){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))](_0xf566('0x2a'));}if(!_0xb50a2[_0xf566('0x2b')]||!_0xb50a2[_0xf566('0xf')]){throw new db[(_0xf566('0x22'))][(_0xf566('0x23'))]('Cloud\x20Provider\x20not\x20configured');}_0x4aa16f=_0xb50a2;var _0x6d24d3=[];_0x53973a['forEach'](function(_0x345530){_0x6d24d3[_0xf566('0x45')](checkTranscribeJob(_0x345530,_0x31288d,_0x4aa16f));});return BPromise[_0xf566('0x46')](_0x6d24d3);})[_0xf566('0x39')](function(_0x33f5ef){if(_0x33f5ef){if(!_0x33f5ef['name']||_0x33f5ef['name']!==_0xf566('0x47')){logger['error'](util['inspect'](_0x33f5ef,{'showHidden':![],'depth':null}));}}});}exports[_0xf566('0x48')]=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 a20d5b7..b61364a 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 _0x889d=['lastMsgAt','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','system','timeout','format','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','findAll'];(function(_0x4af93f,_0x5c2ed0){var _0x377cca=function(_0x4ca7dd){while(--_0x4ca7dd){_0x4af93f['push'](_0x4af93f['shift']());}};_0x377cca(++_0x5c2ed0);}(_0x889d,0x179));var _0xd889=function(_0xed1ea6,_0x5d20b7){_0xed1ea6=_0xed1ea6-0x0;var _0x4cc611=_0x889d[_0xed1ea6];return _0x4cc611;};'use strict';var _=require(_0xd889('0x0'));var moment=require(_0xd889('0x1'));var Redis=require(_0xd889('0x2'));var util=require(_0xd889('0x3'));var config=require(_0xd889('0x4'));var db=require(_0xd889('0x5'))['db'];var logger=require(_0xd889('0x6'))(_0xd889('0x7'));config[_0xd889('0x8')]=_[_0xd889('0x9')](config[_0xd889('0x8')],{'host':_0xd889('0xa'),'port':0x18eb});var io=require(_0xd889('0xb'))(new Redis(config[_0xd889('0x8')]));function closeInteractions(){var _0x58dd28=[];return db['WhatsappInteraction'][_0xd889('0xc')]({'raw':!![],'attributes':['id',_0xd889('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xd889('0xe')](0x18,_0xd889('0xf'))}}})[_0xd889('0x10')](function(_0x286ae1){if(_0x286ae1&&_0x286ae1['length']){_0x58dd28=_[_0xd889('0x11')](_0x286ae1||[],'id');logger[_0xd889('0x12')](_0xd889('0x13'),_0x58dd28[_0xd889('0x14')]());return db[_0xd889('0x15')]['update']({'closeReason':_0xd889('0x16'),'disposition':_0xd889('0x17'),'closed':!![],'closedAt':moment()[_0xd889('0x18')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x58dd28}});}})[_0xd889('0x10')](function(){if(_0x58dd28&&_0x58dd28[_0xd889('0x19')]){logger['info'](_0xd889('0x1a'),_0x58dd28[_0xd889('0x14')]());for(var _0x206653=0x0;_0x206653<_0x58dd28['length'];_0x206653++){io[_0xd889('0x1b')]('whatsappInteraction:update',{'id':_0x58dd28[_0x206653],'closed':!![]});}}})[_0xd889('0x1c')](function(_0xcc3481){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0xcc3481?util['inspect'](_0xcc3481,{'showHidden':![],'depth':null}):'');});}exports[_0xd889('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xb516=['[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','subtract','hours','then','length','map','info','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4a8f25,_0x1963a8){var _0x48ef13=function(_0x4f7389){while(--_0x4f7389){_0x4a8f25['push'](_0x4a8f25['shift']());}};_0x48ef13(++_0x1963a8);}(_0xb516,0x1ab));var _0x6b51=function(_0x54ae1f,_0x3a6d6e){_0x54ae1f=_0x54ae1f-0x0;var _0x2feabd=_0xb516[_0x54ae1f];return _0x2feabd;};'use strict';var _=require(_0x6b51('0x0'));var moment=require('moment');var Redis=require(_0x6b51('0x1'));var util=require(_0x6b51('0x2'));var config=require(_0x6b51('0x3'));var db=require(_0x6b51('0x4'))['db'];var logger=require('../logger')(_0x6b51('0x5'));config[_0x6b51('0x6')]=_[_0x6b51('0x7')](config['redis'],{'host':_0x6b51('0x8'),'port':0x18eb});var io=require(_0x6b51('0x9'))(new Redis(config[_0x6b51('0x6')]));function closeInteractions(){var _0xc50d78=[];return db[_0x6b51('0xa')][_0x6b51('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x6b51('0xc')](0x18,_0x6b51('0xd'))}}})[_0x6b51('0xe')](function(_0x577e0d){if(_0x577e0d&&_0x577e0d[_0x6b51('0xf')]){_0xc50d78=_[_0x6b51('0x10')](_0x577e0d||[],'id');logger[_0x6b51('0x11')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0xc50d78[_0x6b51('0x12')]());return db[_0x6b51('0xa')][_0x6b51('0x13')]({'closeReason':_0x6b51('0x14'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x6b51('0x15')](_0x6b51('0x16'))},{'where':{'id':_0xc50d78}});}})['then'](function(){if(_0xc50d78&&_0xc50d78['length']){logger['info'](_0x6b51('0x17'),_0xc50d78[_0x6b51('0x12')]());for(var _0x1bfe9d=0x0;_0x1bfe9d<_0xc50d78[_0x6b51('0xf')];_0x1bfe9d++){io[_0x6b51('0x18')](_0x6b51('0x19'),{'id':_0xc50d78[_0x1bfe9d],'closed':!![]});}}})[_0x6b51('0x1a')](function(_0x45da9f){logger[_0x6b51('0x1b')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x45da9f?util[_0x6b51('0x1c')](_0x45da9f,{'showHidden':![],'depth':null}):'');});}exports[_0x6b51('0x1d')]=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 fc87e4c..22c1701 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfca2=['bulkCreate','contacts1','CmHopper','log','finished\x20populating','hopper1','contacts2','hopper2','catch','util','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','push','CmContact','destroy','then'];(function(_0x9faa6a,_0x2127b8){var _0x5c38e5=function(_0x32cce9){while(--_0x32cce9){_0x9faa6a['push'](_0x9faa6a['shift']());}};_0x5c38e5(++_0x2127b8);}(_0xfca2,0x95));var _0x2fca=function(_0x5b7963,_0x10bff5){_0x5b7963=_0x5b7963-0x0;var _0x57f611=_0xfca2[_0x5b7963];return _0x57f611;};'use strict';var util=require(_0x2fca('0x0'));var db=require(_0x2fca('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x2fca('0x2')+i,'lastName':_0x2fca('0x3')+i,'phone':0xf879fb460+i,'email':_0x2fca('0x4')+i+_0x2fca('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2fca('0x6')](),'updatedAt':Date[_0x2fca('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x2fca('0x7')]({'id':i,'firstName':_0x2fca('0x2')+i,'lastName':_0x2fca('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x2fca('0x7')]({'id':i,'active':![],'scheduledat':Date[_0x2fca('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2fca('0x6')](),'updatedAt':Date['now']()});}db[_0x2fca('0x8')][_0x2fca('0x9')]({'where':{}})[_0x2fca('0xa')](function(){return db[_0x2fca('0x8')][_0x2fca('0xb')](contacts);})[_0x2fca('0xa')](function(){console['log']('finished\x20populating',_0x2fca('0xc'));return db['CmHopper'][_0x2fca('0x9')]({'where':{}});})[_0x2fca('0xa')](function(){return db[_0x2fca('0xd')][_0x2fca('0xb')](hopper);})[_0x2fca('0xa')](function(){console[_0x2fca('0xe')](_0x2fca('0xf'),_0x2fca('0x10'));return db[_0x2fca('0x8')][_0x2fca('0xb')](contacts2);})[_0x2fca('0xa')](function(){console[_0x2fca('0xe')](_0x2fca('0xf'),_0x2fca('0x11'));return db[_0x2fca('0xd')]['bulkCreate'](hopper2);})['then'](function(){console[_0x2fca('0xe')](_0x2fca('0xf'),_0x2fca('0x12'));})[_0x2fca('0x13')](function(_0x3a55a2){console[_0x2fca('0xe')](_0x3a55a2);}); \ No newline at end of file +var _0x9373=['hopper2','catch','util','../mysqldb','Biondo','innocenzo.biondo','@xcally.com','push','now','Innocenzo','CmContact','destroy','then','log','contacts1','CmHopper','bulkCreate','hopper1','finished\x20populating','contacts2'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0x9373,0x142));var _0x3937=function(_0x68a67c,_0x5884d5){_0x68a67c=_0x68a67c-0x0;var _0x30563f=_0x9373[_0x68a67c];return _0x30563f;};'use strict';var util=require(_0x3937('0x0'));var db=require(_0x3937('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x3937('0x2')+i,'phone':0xf879fb460+i,'email':_0x3937('0x3')+i+_0x3937('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x3937('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x3937('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3937('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x3937('0x5')]({'id':i,'firstName':_0x3937('0x7')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x3937('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x3937('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x3937('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3937('0x6')](),'updatedAt':Date[_0x3937('0x6')]()});}db[_0x3937('0x8')][_0x3937('0x9')]({'where':{}})[_0x3937('0xa')](function(){return db[_0x3937('0x8')]['bulkCreate'](contacts);})[_0x3937('0xa')](function(){console[_0x3937('0xb')]('finished\x20populating',_0x3937('0xc'));return db[_0x3937('0xd')][_0x3937('0x9')]({'where':{}});})[_0x3937('0xa')](function(){return db[_0x3937('0xd')][_0x3937('0xe')](hopper);})[_0x3937('0xa')](function(){console[_0x3937('0xb')]('finished\x20populating',_0x3937('0xf'));return db[_0x3937('0x8')][_0x3937('0xe')](contacts2);})[_0x3937('0xa')](function(){console[_0x3937('0xb')](_0x3937('0x10'),_0x3937('0x11'));return db[_0x3937('0xd')][_0x3937('0xe')](hopper2);})['then'](function(){console['log'](_0x3937('0x10'),_0x3937('0x12'));})[_0x3937('0x13')](function(_0x402080){console[_0x3937('0xb')](_0x402080);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index e974885..3c443d6 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e5f=['format','%s%s','agent','%s%s@xcally.com','password','friend','all','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push'];(function(_0x42a831,_0x5e084d){var _0xc8a765=function(_0x1df073){while(--_0x1df073){_0x42a831['push'](_0x42a831['shift']());}};_0xc8a765(++_0x5e084d);}(_0x1e5f,0xb1));var _0xf1e5=function(_0x4715d2,_0x3371b2){_0x4715d2=_0x4715d2-0x0;var _0x141811=_0x1e5f[_0x4715d2];return _0x141811;};'use strict';var util=require(_0xf1e5('0x0'));var db=require(_0xf1e5('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xf1e5('0x2')]({'name':util[_0xf1e5('0x3')](_0xf1e5('0x4'),_0xf1e5('0x5'),i),'fullname':util[_0xf1e5('0x3')](_0xf1e5('0x4'),_0xf1e5('0x5'),i),'email':util[_0xf1e5('0x3')](_0xf1e5('0x6'),_0xf1e5('0x5'),i),'role':_0xf1e5('0x5'),'password':_0xf1e5('0x7'),'internal':0xfa0+i,'type':_0xf1e5('0x8'),'transport':['udp','ws','wss'],'disallow':[_0xf1e5('0x9')],'allow':['ulaw'],'defaultuser':util[_0xf1e5('0x3')](_0xf1e5('0x4'),_0xf1e5('0x5'),i),'encryption':'yes','avpf':'yes','force_avp':_0xf1e5('0xa'),'icesupport':_0xf1e5('0xa'),'dtlsenable':_0xf1e5('0xa'),'dtlsverify':'no','dtlscertfile':_0xf1e5('0xb'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xf1e5('0xc'),'callerid':util['format'](_0xf1e5('0xd'),util[_0xf1e5('0x3')](_0xf1e5('0x4'),_0xf1e5('0x5'),i),0xfa0+i)});}db[_0xf1e5('0xe')][_0xf1e5('0xf')](users)[_0xf1e5('0x10')](function(){console[_0xf1e5('0x11')](_0xf1e5('0x12'));})[_0xf1e5('0x13')](function(_0x1ac3c8){console[_0xf1e5('0x11')](_0x1ac3c8);}); \ No newline at end of file +var _0x2220=['udp','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','catch','util','%s%s','agent','format','%s%s@xcally.com','password','friend'];(function(_0x337c64,_0x481924){var _0x4b0b1a=function(_0x4a840f){while(--_0x4a840f){_0x337c64['push'](_0x337c64['shift']());}};_0x4b0b1a(++_0x481924);}(_0x2220,0x14f));var _0x0222=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x2220[_0x341e0f];return _0x59555a;};'use strict';var util=require(_0x0222('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0x0222('0x1'),_0x0222('0x2'),i),'fullname':util[_0x0222('0x3')](_0x0222('0x1'),'agent',i),'email':util[_0x0222('0x3')](_0x0222('0x4'),'agent',i),'role':_0x0222('0x2'),'password':_0x0222('0x5'),'internal':0xfa0+i,'type':_0x0222('0x6'),'transport':[_0x0222('0x7'),'ws','wss'],'disallow':['all'],'allow':['ulaw'],'defaultuser':util[_0x0222('0x3')](_0x0222('0x1'),_0x0222('0x2'),i),'encryption':_0x0222('0x8'),'avpf':_0x0222('0x8'),'force_avp':_0x0222('0x8'),'icesupport':_0x0222('0x8'),'dtlsenable':_0x0222('0x8'),'dtlsverify':'no','dtlscertfile':_0x0222('0x9'),'dtlsprivatekey':_0x0222('0xa'),'dtlssetup':_0x0222('0xb'),'callerid':util['format'](_0x0222('0xc'),util[_0x0222('0x3')](_0x0222('0x1'),_0x0222('0x2'),i),0xfa0+i)});}db[_0x0222('0xd')][_0x0222('0xe')](users)[_0x0222('0xf')](function(){console[_0x0222('0x10')]('add\x20user');})[_0x0222('0x11')](function(_0x4b9e3a){console[_0x0222('0x10')](_0x4b9e3a);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 2982c5c..7577e68 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c25=['campaign:%s:%s','leave','map','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','default','connection','setMaxListeners','request','remoteAddress','remotePort','connectedAt','nsp','disconnect','CONNECTED','util','../mysqldb','./environment','name','role','agent','telephone','type','then','autoAssociation','ChatQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','User','where','Campaign','ivr','format','%s:queue:%s','Agents','length','user:%s','handshake','query','find','userProfileId','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','VoiceQueues','FaxQueues','SmsQueues','getVoiceQueues','getChatQueues','getSmsQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s'];(function(_0x110c84,_0x3ae4a8){var _0xb614dc=function(_0x4b3d7b){while(--_0x4b3d7b){_0x110c84['push'](_0x110c84['shift']());}};_0xb614dc(++_0x3ae4a8);}(_0x8c25,0xe2));var _0x58c2=function(_0x5c0eb3,_0x4be675){_0x5c0eb3=_0x5c0eb3-0x0;var _0x32a4e0=_0x8c25[_0x5c0eb3];return _0x32a4e0;};'use strict';var _=require('lodash');var util=require(_0x58c2('0x0'));var BPromise=require('bluebird');var db=require(_0x58c2('0x1'))['db'];var config=require(_0x58c2('0x2'));var queryQueues={'attributes':['id',_0x58c2('0x3')],'include':[{'as':'Agents','model':db['User'],'attributes':['id',_0x58c2('0x3'),_0x58c2('0x4')],'raw':!![],'where':{'role':_0x58c2('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x58c2('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0x58c2('0x3')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x58c2('0x3'),_0x58c2('0x7')],'where':{'type':'ivr'}};function getAssociatedResources(_0x42916a,_0x301334,_0x5f1014){return db['UserProfileSection']['findOne']({'where':{'name':_0x42916a,'userProfileId':_0x301334},'raw':!![]})[_0x58c2('0x8')](function(_0x390b4f){if(_0x390b4f){if(_0x390b4f[_0x58c2('0x9')]){switch(_0x42916a){case'VoiceQueues':case _0x58c2('0xa'):case'FaxQueues':case'SmsQueues':case _0x58c2('0xb'):case _0x58c2('0xc'):case _0x58c2('0xd'):return db[_0x5f1014][_0x58c2('0xe')](queryQueues);case _0x58c2('0xf'):return db[_0x5f1014][_0x58c2('0xe')](queryTelephones);case _0x58c2('0x10'):return db[_0x5f1014]['findAll'](queryTrunks);case _0x58c2('0x11'):return db[_0x5f1014][_0x58c2('0xe')](queryCampaigns);}}else{return db[_0x58c2('0x12')][_0x58c2('0xe')]({'attributes':[_0x58c2('0x13')],'where':{'sectionId':_0x390b4f['id']},'raw':!![]})['then'](function(_0xd4ef52){if(_0xd4ef52){var _0x5342a8={'where':{'id':_['map'](_0xd4ef52,_0x58c2('0x13'))},'raw':!![]};switch(_0x5f1014){case _0x58c2('0x14'):_0x5342a8[_0x58c2('0x15')][_0x58c2('0x4')]=_0x58c2('0x6');break;case _0x58c2('0x16'):_0x5342a8[_0x58c2('0x15')][_0x58c2('0x7')]=_0x58c2('0x17');break;}return db[_0x5f1014][_0x58c2('0xe')](_0x5342a8);}else{return[];}});}}else{return[];}})[_0x58c2('0x8')](function(_0x245ca5){return _0x245ca5;});}function joinOrLeaveQueues(_0x3890aa,_0x2ca868,_0x4f1955,_0x3ba7ea){_0x3890aa[_0x2ca868](util[_0x58c2('0x18')](_0x58c2('0x19'),_0x4f1955,_0x3ba7ea['name']));if(_0x3ba7ea[_0x58c2('0x1a')]){for(var _0x52c3ca=0x0;_0x52c3ca<_0x3ba7ea['Agents'][_0x58c2('0x1b')];_0x52c3ca+=0x1){_0x3890aa[_0x2ca868](util[_0x58c2('0x18')](_0x58c2('0x1c'),_0x3ba7ea[_0x58c2('0x1a')][_0x52c3ca][_0x58c2('0x3')]));}}}function joinOrLeave(_0x18d361,_0x5b419f,_0x804ace){var _0x2d42d2;if(_0x18d361[_0x58c2('0x1d')][_0x58c2('0x1e')]['id']){db['User'][_0x58c2('0x1f')]({'attributes':['id','name','role',_0x58c2('0x20')],'where':{'id':_0x18d361[_0x58c2('0x1d')][_0x58c2('0x1e')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x58c2('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x58c2('0x22')],'as':_0x58c2('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x58c2('0x24')],'as':_0x58c2('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x58c2('0x26')],'as':_0x58c2('0x27'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x58c2('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x58c2('0x29')],'as':_0x58c2('0x2a'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x377955){if(_0x377955){_0x2d42d2=_0x377955;_0x18d361[_0x5b419f](util[_0x58c2('0x18')]('user:%s',_0x377955[_0x58c2('0x3')]));var _0x30e40f=[];switch(_0x377955[_0x58c2('0x4')]){case _0x58c2('0x2b'):_0x18d361[_0x5b419f](_0x58c2('0x2c'));_0x18d361[_0x5b419f](_0x58c2('0x2d'));if(queryQueues[_0x58c2('0x2e')](_0x58c2('0x2f'))){delete queryQueues[_0x58c2('0x2f')];}_0x30e40f[_0x58c2('0x30')](db[_0x58c2('0x31')][_0x58c2('0xe')](queryQueues));_0x30e40f[_0x58c2('0x30')](db[_0x58c2('0x32')][_0x58c2('0xe')](queryQueues));_0x30e40f['push'](db[_0x58c2('0x33')][_0x58c2('0xe')](queryQueues));_0x30e40f[_0x58c2('0x30')](db[_0x58c2('0x34')][_0x58c2('0xe')](queryQueues));_0x30e40f['push'](db[_0x58c2('0x35')][_0x58c2('0xe')](queryQueues));_0x30e40f[_0x58c2('0x30')](db[_0x58c2('0x36')][_0x58c2('0xe')](queryQueues));_0x30e40f[_0x58c2('0x30')](db[_0x58c2('0x37')][_0x58c2('0xe')](queryQueues));_0x30e40f['push'](db[_0x58c2('0x14')][_0x58c2('0xe')](queryTelephones));_0x30e40f[_0x58c2('0x30')](db[_0x58c2('0x38')]['findAll'](queryTrunks));_0x30e40f[_0x58c2('0x30')](db[_0x58c2('0x16')]['findAll'](queryCampaigns));_0x30e40f[_0x58c2('0x30')](db['User'][_0x58c2('0xe')](queryAgents));break;case _0x58c2('0x39'):_0x18d361[_0x5b419f]('voice:inbound');_0x18d361[_0x5b419f](_0x58c2('0x2d'));_0x30e40f[_0x58c2('0x30')](getAssociatedResources(_0x58c2('0x3a'),_0x377955['userProfileId'],_0x58c2('0x31')));_0x30e40f[_0x58c2('0x30')](getAssociatedResources(_0x58c2('0xa'),_0x377955[_0x58c2('0x20')],_0x58c2('0x32')));_0x30e40f[_0x58c2('0x30')](getAssociatedResources(_0x58c2('0x3b'),_0x377955[_0x58c2('0x20')],_0x58c2('0x33')));_0x30e40f[_0x58c2('0x30')](getAssociatedResources(_0x58c2('0x3c'),_0x377955['userProfileId'],_0x58c2('0x34')));_0x30e40f['push'](getAssociatedResources(_0x58c2('0xb'),_0x377955[_0x58c2('0x20')],_0x58c2('0x35')));_0x30e40f[_0x58c2('0x30')](getAssociatedResources('OpenchannelQueues',_0x377955[_0x58c2('0x20')],_0x58c2('0x36')));_0x30e40f['push'](getAssociatedResources('WhatsappQueues',_0x377955[_0x58c2('0x20')],_0x58c2('0x37')));_0x30e40f[_0x58c2('0x30')](getAssociatedResources('Telephones',_0x377955[_0x58c2('0x20')],_0x58c2('0x14')));_0x30e40f[_0x58c2('0x30')](getAssociatedResources(_0x58c2('0x10'),_0x377955['userProfileId'],_0x58c2('0x38')));_0x30e40f['push'](getAssociatedResources('IvrCampaigns',_0x377955[_0x58c2('0x20')],_0x58c2('0x16')));_0x30e40f['push'](db[_0x58c2('0x14')]['findAll'](queryAgents));break;case _0x58c2('0x5'):_0x18d361[_0x5b419f](_0x58c2('0x2c'));_0x18d361[_0x5b419f](_0x58c2('0x2d'));_0x30e40f['push'](_0x377955[_0x58c2('0x3d')]({'attributes':['id',_0x58c2('0x3')]}));_0x30e40f[_0x58c2('0x30')](_0x377955[_0x58c2('0x3e')]({'attributes':['id','name']}));_0x30e40f['push'](_0x377955['getFaxQueues']({'attributes':['id',_0x58c2('0x3')]}));_0x30e40f[_0x58c2('0x30')](_0x377955[_0x58c2('0x3f')]({'attributes':['id',_0x58c2('0x3')]}));_0x30e40f[_0x58c2('0x30')](_0x377955['getMailQueues']({'attributes':['id','name']}));_0x30e40f[_0x58c2('0x30')](_0x377955['getOpenchannelQueues']({'attributes':['id',_0x58c2('0x3')]}));_0x30e40f[_0x58c2('0x30')](_0x377955[_0x58c2('0x40')]({'attributes':['id','name']}));break;}return BPromise[_0x58c2('0x41')](_0x30e40f);}})[_0x58c2('0x8')](function(_0x3ac186){if(_0x3ac186&&_0x3ac186['length']){for(var _0x539b70=0x0;_0x539b70<_0x3ac186[_0x58c2('0x1b')];_0x539b70+=0x1){for(var _0x463cb1=0x0;_0x463cb1<_0x3ac186[_0x539b70][_0x58c2('0x1b')];_0x463cb1+=0x1){switch(_0x539b70){case 0x0:joinOrLeaveQueues(_0x18d361,_0x5b419f,_0x58c2('0x42'),_0x3ac186[_0x539b70][_0x463cb1]);break;case 0x1:joinOrLeaveQueues(_0x18d361,_0x5b419f,_0x58c2('0x43'),_0x3ac186[_0x539b70][_0x463cb1]);break;case 0x2:joinOrLeaveQueues(_0x18d361,_0x5b419f,_0x58c2('0x44'),_0x3ac186[_0x539b70][_0x463cb1]);break;case 0x3:joinOrLeaveQueues(_0x18d361,_0x5b419f,_0x58c2('0x45'),_0x3ac186[_0x539b70][_0x463cb1]);break;case 0x4:joinOrLeaveQueues(_0x18d361,_0x5b419f,_0x58c2('0x46'),_0x3ac186[_0x539b70][_0x463cb1]);break;case 0x5:joinOrLeaveQueues(_0x18d361,_0x5b419f,_0x58c2('0x47'),_0x3ac186[_0x539b70][_0x463cb1]);break;case 0x6:joinOrLeaveQueues(_0x18d361,_0x5b419f,_0x58c2('0x48'),_0x3ac186[_0x539b70][_0x463cb1]);break;case 0x7:if(_0x2d42d2[_0x58c2('0x4')]!==_0x58c2('0x5'))_0x18d361[_0x5b419f](util[_0x58c2('0x18')](_0x58c2('0x49'),_0x3ac186[_0x539b70][_0x463cb1][_0x58c2('0x3')]));break;case 0x8:if(_0x2d42d2[_0x58c2('0x4')]!==_0x58c2('0x5'))_0x18d361[_0x5b419f](util[_0x58c2('0x18')]('trunk:%s',_0x3ac186[_0x539b70][_0x463cb1]['name']));break;case 0x9:if(_0x2d42d2['role']!==_0x58c2('0x5'))_0x18d361[_0x5b419f](util[_0x58c2('0x18')](_0x58c2('0x4a'),_0x3ac186[_0x539b70][_0x463cb1]['type'],_0x3ac186[_0x539b70][_0x463cb1][_0x58c2('0x3')]));break;case 0xa:_0x18d361[_0x5b419f](util[_0x58c2('0x18')](_0x58c2('0x1c'),_0x3ac186[_0x539b70][_0x463cb1]['name']));break;}}}}})[_0x58c2('0x8')](function(){if(_0x5b419f===_0x58c2('0x4b')){var _0x2496dd=_[_0x58c2('0x4c')](_0x2d42d2[_0x58c2('0x21')],'id');return _0x2d42d2[_0x58c2('0x4d')](_0x2496dd)[_0x58c2('0x8')](function(){for(var _0x3eeeaa=0x0;_0x3eeeaa<_0x2496dd[_0x58c2('0x1b')];_0x3eeeaa+=0x1){_0x804ace['emit'](_0x58c2('0x4e'),{'ChatInteractionId':Number(_0x2496dd[_0x3eeeaa]),'UserId':Number(_0x2d42d2['id'])});}});}})[_0x58c2('0x8')](function(){if(_0x5b419f===_0x58c2('0x4b')){var _0x4cf499=_[_0x58c2('0x4c')](_0x2d42d2[_0x58c2('0x23')],'id');return _0x2d42d2[_0x58c2('0x4f')](_0x4cf499)[_0x58c2('0x8')](function(){for(var _0x1e3e90=0x0;_0x1e3e90<_0x4cf499[_0x58c2('0x1b')];_0x1e3e90+=0x1){_0x804ace[_0x58c2('0x50')](_0x58c2('0x51'),{'MailInteractionId':Number(_0x4cf499[_0x1e3e90]),'UserId':Number(_0x2d42d2['id'])});}});}})[_0x58c2('0x8')](function(){if(_0x5b419f===_0x58c2('0x4b')){var _0x8a697e=_[_0x58c2('0x4c')](_0x2d42d2[_0x58c2('0x25')],'id');return _0x2d42d2[_0x58c2('0x52')](_0x8a697e)[_0x58c2('0x8')](function(){for(var _0x1f7e9d=0x0;_0x1f7e9d<_0x8a697e['length'];_0x1f7e9d+=0x1){_0x804ace[_0x58c2('0x50')](_0x58c2('0x53'),{'FaxInteractionId':Number(_0x8a697e[_0x1f7e9d]),'UserId':Number(_0x2d42d2['id'])});}});}})[_0x58c2('0x8')](function(){if(_0x5b419f===_0x58c2('0x4b')){var _0x340935=_[_0x58c2('0x4c')](_0x2d42d2[_0x58c2('0x27')],'id');return _0x2d42d2[_0x58c2('0x54')](_0x340935)[_0x58c2('0x8')](function(){for(var _0x4bba23=0x0;_0x4bba23<_0x340935[_0x58c2('0x1b')];_0x4bba23+=0x1){_0x804ace[_0x58c2('0x50')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x340935[_0x4bba23]),'UserId':Number(_0x2d42d2['id'])});}});}})[_0x58c2('0x8')](function(){if(_0x5b419f===_0x58c2('0x4b')){var _0x3422b8=_['map'](_0x2d42d2[_0x58c2('0x28')],'id');return _0x2d42d2[_0x58c2('0x55')](_0x3422b8)[_0x58c2('0x8')](function(){for(var _0x54d57c=0x0;_0x54d57c<_0x3422b8[_0x58c2('0x1b')];_0x54d57c+=0x1){_0x804ace[_0x58c2('0x50')](_0x58c2('0x56'),{'OpenchannelInteractionId':Number(_0x3422b8[_0x54d57c]),'UserId':Number(_0x2d42d2['id'])});}});}})[_0x58c2('0x8')](function(){if(_0x5b419f===_0x58c2('0x4b')){var _0x3f3338=_['map'](_0x2d42d2[_0x58c2('0x2a')],'id');return _0x2d42d2['removeWhatsappInteractions'](_0x3f3338)[_0x58c2('0x8')](function(){for(var _0x4057bb=0x0;_0x4057bb<_0x3f3338['length'];_0x4057bb+=0x1){_0x804ace['emit']('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x3f3338[_0x4057bb]),'UserId':Number(_0x2d42d2['id'])});}});}})[_0x58c2('0x57')](function(_0x4e6c3d){_0x18d361[_0x58c2('0x58')](_0x4e6c3d);});}}function onDisconnect(_0x21333c,_0x56bd3f){joinOrLeave(_0x21333c,_0x58c2('0x4b'),_0x56bd3f);}function onConnect(_0x2832f5){joinOrLeave(_0x2832f5,_0x58c2('0x59'));}exports[_0x58c2('0x5a')]=function(_0x5a63c1){_0x5a63c1['on'](_0x58c2('0x5b'),function(_0x1ab8cd){_0x1ab8cd[_0x58c2('0x5c')](0x0);_0x1ab8cd['address']=_0x1ab8cd[_0x58c2('0x5d')]['connection'][_0x58c2('0x5e')]+':'+_0x1ab8cd['request']['connection'][_0x58c2('0x5f')];_0x1ab8cd[_0x58c2('0x60')]=new Date();_0x1ab8cd[_0x58c2('0x58')]=function(_0x56d151){console['log']('SocketIO\x20'+_0x1ab8cd[_0x58c2('0x61')][_0x58c2('0x3')]+'['+_0x1ab8cd['address']+']',_0x56d151);};_0x1ab8cd['on'](_0x58c2('0x62'),function(){onDisconnect(_0x1ab8cd,_0x5a63c1);_0x1ab8cd[_0x58c2('0x58')]('DISCONNECTED');});onConnect(_0x1ab8cd);_0x1ab8cd[_0x58c2('0x58')](_0x58c2('0x63'));});}; \ No newline at end of file +var _0xdc36=['lodash','bluebird','../mysqldb','name','Agents','User','role','agent','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','where','telephone','Campaign','type','format','length','user:%s','query','find','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','admin','voice:outbound','include','push','VoiceQueue','FaxQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','Trunk','voice:inbound','getVoiceQueues','getChatQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','setMaxListeners','address','request','connection','remoteAddress','connectedAt','nsp','disconnect','DISCONNECTED','CONNECTED'];(function(_0xc477cf,_0x40c5a5){var _0x5ce6c4=function(_0x490fb6){while(--_0x490fb6){_0xc477cf['push'](_0xc477cf['shift']());}};_0x5ce6c4(++_0x40c5a5);}(_0xdc36,0x18c));var _0x6dc3=function(_0x15578a,_0x171c59){_0x15578a=_0x15578a-0x0;var _0x1f7625=_0xdc36[_0x15578a];return _0x1f7625;};'use strict';var _=require(_0x6dc3('0x0'));var util=require('util');var BPromise=require(_0x6dc3('0x1'));var db=require(_0x6dc3('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x6dc3('0x3')],'include':[{'as':_0x6dc3('0x4'),'model':db[_0x6dc3('0x5')],'attributes':['id','name',_0x6dc3('0x6')],'raw':!![],'where':{'role':_0x6dc3('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x6dc3('0x3')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x6dc3('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x6dc3('0x3')],'where':{'role':_0x6dc3('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x6dc3('0x3'),'type'],'where':{'type':_0x6dc3('0x8')}};function getAssociatedResources(_0x1aecc5,_0x554fe5,_0x88957d){return db[_0x6dc3('0x9')][_0x6dc3('0xa')]({'where':{'name':_0x1aecc5,'userProfileId':_0x554fe5},'raw':!![]})[_0x6dc3('0xb')](function(_0x55c3e9){if(_0x55c3e9){if(_0x55c3e9[_0x6dc3('0xc')]){switch(_0x1aecc5){case'VoiceQueues':case _0x6dc3('0xd'):case _0x6dc3('0xe'):case _0x6dc3('0xf'):case _0x6dc3('0x10'):case _0x6dc3('0x11'):case _0x6dc3('0x12'):return db[_0x88957d][_0x6dc3('0x13')](queryQueues);case _0x6dc3('0x14'):return db[_0x88957d]['findAll'](queryTelephones);case _0x6dc3('0x15'):return db[_0x88957d][_0x6dc3('0x13')](queryTrunks);case _0x6dc3('0x16'):return db[_0x88957d][_0x6dc3('0x13')](queryCampaigns);}}else{return db['UserProfileResource'][_0x6dc3('0x13')]({'attributes':[_0x6dc3('0x17')],'where':{'sectionId':_0x55c3e9['id']},'raw':!![]})[_0x6dc3('0xb')](function(_0x469b81){if(_0x469b81){var _0x22b39a={'where':{'id':_['map'](_0x469b81,'resourceId')},'raw':!![]};switch(_0x88957d){case'User':_0x22b39a[_0x6dc3('0x18')][_0x6dc3('0x6')]=_0x6dc3('0x19');break;case _0x6dc3('0x1a'):_0x22b39a[_0x6dc3('0x18')][_0x6dc3('0x1b')]=_0x6dc3('0x8');break;}return db[_0x88957d][_0x6dc3('0x13')](_0x22b39a);}else{return[];}});}}else{return[];}})['then'](function(_0x33edab){return _0x33edab;});}function joinOrLeaveQueues(_0x279bae,_0xd1bfd4,_0x148885,_0x473229){_0x279bae[_0xd1bfd4](util[_0x6dc3('0x1c')]('%s:queue:%s',_0x148885,_0x473229[_0x6dc3('0x3')]));if(_0x473229[_0x6dc3('0x4')]){for(var _0x22b18a=0x0;_0x22b18a<_0x473229[_0x6dc3('0x4')][_0x6dc3('0x1d')];_0x22b18a+=0x1){_0x279bae[_0xd1bfd4](util[_0x6dc3('0x1c')](_0x6dc3('0x1e'),_0x473229[_0x6dc3('0x4')][_0x22b18a][_0x6dc3('0x3')]));}}}function joinOrLeave(_0x435a55,_0x52d5f2,_0x38dd7e){var _0x12455c;if(_0x435a55['handshake'][_0x6dc3('0x1f')]['id']){db['User'][_0x6dc3('0x20')]({'attributes':['id','name','role',_0x6dc3('0x21')],'where':{'id':_0x435a55['handshake'][_0x6dc3('0x1f')]['id']},'include':[{'model':db[_0x6dc3('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x6dc3('0x23')],'as':_0x6dc3('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x6dc3('0x25')],'as':_0x6dc3('0x26'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x6dc3('0x27')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x6dc3('0x28')],'as':_0x6dc3('0x29'),'attributes':['id'],'raw':!![]}]})[_0x6dc3('0xb')](function(_0x598ab4){if(_0x598ab4){_0x12455c=_0x598ab4;_0x435a55[_0x52d5f2](util[_0x6dc3('0x1c')](_0x6dc3('0x1e'),_0x598ab4['name']));var _0xd7c2b5=[];switch(_0x598ab4[_0x6dc3('0x6')]){case _0x6dc3('0x2a'):_0x435a55[_0x52d5f2]('voice:inbound');_0x435a55[_0x52d5f2](_0x6dc3('0x2b'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0x6dc3('0x2c')];}_0xd7c2b5[_0x6dc3('0x2d')](db[_0x6dc3('0x2e')][_0x6dc3('0x13')](queryQueues));_0xd7c2b5['push'](db['ChatQueue'][_0x6dc3('0x13')](queryQueues));_0xd7c2b5['push'](db[_0x6dc3('0x2f')][_0x6dc3('0x13')](queryQueues));_0xd7c2b5[_0x6dc3('0x2d')](db[_0x6dc3('0x30')][_0x6dc3('0x13')](queryQueues));_0xd7c2b5[_0x6dc3('0x2d')](db['MailQueue']['findAll'](queryQueues));_0xd7c2b5[_0x6dc3('0x2d')](db[_0x6dc3('0x31')][_0x6dc3('0x13')](queryQueues));_0xd7c2b5['push'](db[_0x6dc3('0x32')][_0x6dc3('0x13')](queryQueues));_0xd7c2b5[_0x6dc3('0x2d')](db[_0x6dc3('0x5')]['findAll'](queryTelephones));_0xd7c2b5[_0x6dc3('0x2d')](db[_0x6dc3('0x33')][_0x6dc3('0x13')](queryTrunks));_0xd7c2b5[_0x6dc3('0x2d')](db['Campaign'][_0x6dc3('0x13')](queryCampaigns));_0xd7c2b5['push'](db[_0x6dc3('0x5')][_0x6dc3('0x13')](queryAgents));break;case'user':_0x435a55[_0x52d5f2](_0x6dc3('0x34'));_0x435a55[_0x52d5f2](_0x6dc3('0x2b'));_0xd7c2b5['push'](getAssociatedResources('VoiceQueues',_0x598ab4['userProfileId'],_0x6dc3('0x2e')));_0xd7c2b5[_0x6dc3('0x2d')](getAssociatedResources('ChatQueues',_0x598ab4[_0x6dc3('0x21')],'ChatQueue'));_0xd7c2b5[_0x6dc3('0x2d')](getAssociatedResources('FaxQueues',_0x598ab4['userProfileId'],'FaxQueue'));_0xd7c2b5[_0x6dc3('0x2d')](getAssociatedResources('SmsQueues',_0x598ab4[_0x6dc3('0x21')],'SmsQueue'));_0xd7c2b5[_0x6dc3('0x2d')](getAssociatedResources(_0x6dc3('0x10'),_0x598ab4[_0x6dc3('0x21')],'MailQueue'));_0xd7c2b5[_0x6dc3('0x2d')](getAssociatedResources(_0x6dc3('0x11'),_0x598ab4[_0x6dc3('0x21')],_0x6dc3('0x31')));_0xd7c2b5[_0x6dc3('0x2d')](getAssociatedResources(_0x6dc3('0x12'),_0x598ab4[_0x6dc3('0x21')],_0x6dc3('0x32')));_0xd7c2b5['push'](getAssociatedResources(_0x6dc3('0x14'),_0x598ab4[_0x6dc3('0x21')],_0x6dc3('0x5')));_0xd7c2b5[_0x6dc3('0x2d')](getAssociatedResources(_0x6dc3('0x15'),_0x598ab4['userProfileId'],_0x6dc3('0x33')));_0xd7c2b5['push'](getAssociatedResources(_0x6dc3('0x16'),_0x598ab4['userProfileId'],_0x6dc3('0x1a')));_0xd7c2b5[_0x6dc3('0x2d')](db[_0x6dc3('0x5')][_0x6dc3('0x13')](queryAgents));break;case'agent':_0x435a55[_0x52d5f2]('voice:inbound');_0x435a55[_0x52d5f2](_0x6dc3('0x2b'));_0xd7c2b5[_0x6dc3('0x2d')](_0x598ab4[_0x6dc3('0x35')]({'attributes':['id',_0x6dc3('0x3')]}));_0xd7c2b5['push'](_0x598ab4[_0x6dc3('0x36')]({'attributes':['id',_0x6dc3('0x3')]}));_0xd7c2b5[_0x6dc3('0x2d')](_0x598ab4['getFaxQueues']({'attributes':['id',_0x6dc3('0x3')]}));_0xd7c2b5[_0x6dc3('0x2d')](_0x598ab4['getSmsQueues']({'attributes':['id','name']}));_0xd7c2b5[_0x6dc3('0x2d')](_0x598ab4[_0x6dc3('0x37')]({'attributes':['id',_0x6dc3('0x3')]}));_0xd7c2b5[_0x6dc3('0x2d')](_0x598ab4[_0x6dc3('0x38')]({'attributes':['id',_0x6dc3('0x3')]}));_0xd7c2b5[_0x6dc3('0x2d')](_0x598ab4[_0x6dc3('0x39')]({'attributes':['id',_0x6dc3('0x3')]}));break;}return BPromise[_0x6dc3('0x3a')](_0xd7c2b5);}})[_0x6dc3('0xb')](function(_0x33ae2b){if(_0x33ae2b&&_0x33ae2b[_0x6dc3('0x1d')]){for(var _0x255718=0x0;_0x255718<_0x33ae2b[_0x6dc3('0x1d')];_0x255718+=0x1){for(var _0x413361=0x0;_0x413361<_0x33ae2b[_0x255718][_0x6dc3('0x1d')];_0x413361+=0x1){switch(_0x255718){case 0x0:joinOrLeaveQueues(_0x435a55,_0x52d5f2,_0x6dc3('0x3b'),_0x33ae2b[_0x255718][_0x413361]);break;case 0x1:joinOrLeaveQueues(_0x435a55,_0x52d5f2,_0x6dc3('0x3c'),_0x33ae2b[_0x255718][_0x413361]);break;case 0x2:joinOrLeaveQueues(_0x435a55,_0x52d5f2,_0x6dc3('0x3d'),_0x33ae2b[_0x255718][_0x413361]);break;case 0x3:joinOrLeaveQueues(_0x435a55,_0x52d5f2,_0x6dc3('0x3e'),_0x33ae2b[_0x255718][_0x413361]);break;case 0x4:joinOrLeaveQueues(_0x435a55,_0x52d5f2,'mail',_0x33ae2b[_0x255718][_0x413361]);break;case 0x5:joinOrLeaveQueues(_0x435a55,_0x52d5f2,_0x6dc3('0x3f'),_0x33ae2b[_0x255718][_0x413361]);break;case 0x6:joinOrLeaveQueues(_0x435a55,_0x52d5f2,_0x6dc3('0x40'),_0x33ae2b[_0x255718][_0x413361]);break;case 0x7:if(_0x12455c[_0x6dc3('0x6')]!=='agent')_0x435a55[_0x52d5f2](util[_0x6dc3('0x1c')](_0x6dc3('0x41'),_0x33ae2b[_0x255718][_0x413361]['name']));break;case 0x8:if(_0x12455c[_0x6dc3('0x6')]!==_0x6dc3('0x7'))_0x435a55[_0x52d5f2](util['format'](_0x6dc3('0x42'),_0x33ae2b[_0x255718][_0x413361][_0x6dc3('0x3')]));break;case 0x9:if(_0x12455c[_0x6dc3('0x6')]!==_0x6dc3('0x7'))_0x435a55[_0x52d5f2](util[_0x6dc3('0x1c')](_0x6dc3('0x43'),_0x33ae2b[_0x255718][_0x413361][_0x6dc3('0x1b')],_0x33ae2b[_0x255718][_0x413361][_0x6dc3('0x3')]));break;case 0xa:_0x435a55[_0x52d5f2](util[_0x6dc3('0x1c')](_0x6dc3('0x1e'),_0x33ae2b[_0x255718][_0x413361][_0x6dc3('0x3')]));break;}}}}})[_0x6dc3('0xb')](function(){if(_0x52d5f2===_0x6dc3('0x44')){var _0x32d90a=_[_0x6dc3('0x45')](_0x12455c[_0x6dc3('0x46')],'id');return _0x12455c[_0x6dc3('0x47')](_0x32d90a)[_0x6dc3('0xb')](function(){for(var _0x49a943=0x0;_0x49a943<_0x32d90a[_0x6dc3('0x1d')];_0x49a943+=0x1){_0x38dd7e[_0x6dc3('0x48')](_0x6dc3('0x49'),{'ChatInteractionId':Number(_0x32d90a[_0x49a943]),'UserId':Number(_0x12455c['id'])});}});}})[_0x6dc3('0xb')](function(){if(_0x52d5f2===_0x6dc3('0x44')){var _0xf8e0d7=_['map'](_0x12455c[_0x6dc3('0x24')],'id');return _0x12455c[_0x6dc3('0x4a')](_0xf8e0d7)['then'](function(){for(var _0x4a2d69=0x0;_0x4a2d69<_0xf8e0d7[_0x6dc3('0x1d')];_0x4a2d69+=0x1){_0x38dd7e[_0x6dc3('0x48')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0xf8e0d7[_0x4a2d69]),'UserId':Number(_0x12455c['id'])});}});}})[_0x6dc3('0xb')](function(){if(_0x52d5f2===_0x6dc3('0x44')){var _0x55f8da=_['map'](_0x12455c['FaxInteractions'],'id');return _0x12455c[_0x6dc3('0x4b')](_0x55f8da)['then'](function(){for(var _0x2bece6=0x0;_0x2bece6<_0x55f8da[_0x6dc3('0x1d')];_0x2bece6+=0x1){_0x38dd7e['emit'](_0x6dc3('0x4c'),{'FaxInteractionId':Number(_0x55f8da[_0x2bece6]),'UserId':Number(_0x12455c['id'])});}});}})[_0x6dc3('0xb')](function(){if(_0x52d5f2===_0x6dc3('0x44')){var _0x4b93cb=_[_0x6dc3('0x45')](_0x12455c[_0x6dc3('0x4d')],'id');return _0x12455c[_0x6dc3('0x4e')](_0x4b93cb)[_0x6dc3('0xb')](function(){for(var _0x4b43dc=0x0;_0x4b43dc<_0x4b93cb[_0x6dc3('0x1d')];_0x4b43dc+=0x1){_0x38dd7e[_0x6dc3('0x48')](_0x6dc3('0x4f'),{'SmsInteractionId':Number(_0x4b93cb[_0x4b43dc]),'UserId':Number(_0x12455c['id'])});}});}})['then'](function(){if(_0x52d5f2==='leave'){var _0x211d9d=_['map'](_0x12455c[_0x6dc3('0x50')],'id');return _0x12455c[_0x6dc3('0x51')](_0x211d9d)[_0x6dc3('0xb')](function(){for(var _0x237ca9=0x0;_0x237ca9<_0x211d9d[_0x6dc3('0x1d')];_0x237ca9+=0x1){_0x38dd7e[_0x6dc3('0x48')](_0x6dc3('0x52'),{'OpenchannelInteractionId':Number(_0x211d9d[_0x237ca9]),'UserId':Number(_0x12455c['id'])});}});}})[_0x6dc3('0xb')](function(){if(_0x52d5f2===_0x6dc3('0x44')){var _0x3aac2b=_[_0x6dc3('0x45')](_0x12455c['WhatsappInteractions'],'id');return _0x12455c[_0x6dc3('0x53')](_0x3aac2b)[_0x6dc3('0xb')](function(){for(var _0x557421=0x0;_0x557421<_0x3aac2b[_0x6dc3('0x1d')];_0x557421+=0x1){_0x38dd7e['emit'](_0x6dc3('0x54'),{'WhatsappInteractionId':Number(_0x3aac2b[_0x557421]),'UserId':Number(_0x12455c['id'])});}});}})[_0x6dc3('0x55')](function(_0x514528){_0x435a55[_0x6dc3('0x56')](_0x514528);});}}function onDisconnect(_0x486354,_0x9034c1){joinOrLeave(_0x486354,_0x6dc3('0x44'),_0x9034c1);}function onConnect(_0x2aa73d){joinOrLeave(_0x2aa73d,_0x6dc3('0x57'));}exports[_0x6dc3('0x58')]=function(_0x544082){_0x544082['on']('connection',function(_0x1240da){_0x1240da[_0x6dc3('0x59')](0x0);_0x1240da[_0x6dc3('0x5a')]=_0x1240da[_0x6dc3('0x5b')][_0x6dc3('0x5c')][_0x6dc3('0x5d')]+':'+_0x1240da[_0x6dc3('0x5b')][_0x6dc3('0x5c')]['remotePort'];_0x1240da[_0x6dc3('0x5e')]=new Date();_0x1240da[_0x6dc3('0x56')]=function(_0xc7e5f3){console[_0x6dc3('0x56')]('SocketIO\x20'+_0x1240da[_0x6dc3('0x5f')][_0x6dc3('0x3')]+'['+_0x1240da[_0x6dc3('0x5a')]+']',_0xc7e5f3);};_0x1240da['on'](_0x6dc3('0x60'),function(){onDisconnect(_0x1240da,_0x544082);_0x1240da[_0x6dc3('0x56')](_0x6dc3('0x61'));});onConnect(_0x1240da);_0x1240da[_0x6dc3('0x56')](_0x6dc3('0x62'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 159ac83..324af1c 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 _0x4017=['FaxMessage','Mail','MailInteraction','Openchannel','OpenchannelInteraction','request','info','Trigger,\x20%s','code','error','EventManager','get','channel','motionChannel','event','resolve','then','ContactId','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','undefined','interface','format','SIP/%s','name','agent','outgoingmessage','catch','AfterCreateMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','AfterCreate','changed','closed','substatus','AfterUpdate','User','find','fullname','email','default','length','hasOwnProperty','model','hook','callback','condition','util','../../mysqldb','jayson/promise','triggers','client','http','ChatInteraction','afterCreate','newinteraction','Chat','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction'];(function(_0x54ea7a,_0x19df9b){var _0x65a10d=function(_0x1bf936){while(--_0x1bf936){_0x54ea7a['push'](_0x54ea7a['shift']());}};_0x65a10d(++_0x19df9b);}(_0x4017,0x1a0));var _0x7401=function(_0x1df610,_0x58626f){_0x1df610=_0x1df610-0x0;var _0x9fbdc=_0x4017[_0x1df610];return _0x9fbdc;};'use strict';var util=require(_0x7401('0x0'));var db=require(_0x7401('0x1'))['db'];var jayson=require(_0x7401('0x2'));var logger=require('../logger')(_0x7401('0x3'));var client=jayson[_0x7401('0x4')][_0x7401('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x7401('0x6'),'event':_0x7401('0x7'),'condition':_0x7401('0x8'),'callback':afterCreate},{'channel':_0x7401('0x9'),'model':_0x7401('0x6'),'event':_0x7401('0xa'),'condition':_0x7401('0xb'),'callback':afterUpdate},{'channel':_0x7401('0x9'),'model':_0x7401('0xc'),'event':_0x7401('0x7'),'condition':_0x7401('0xd'),'callback':afterCreateMessage},{'channel':_0x7401('0x9'),'model':'ChatOfflineMessage','event':_0x7401('0x7'),'condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':'Sms','model':'SmsInteraction','event':_0x7401('0x7'),'condition':_0x7401('0x8'),'callback':afterCreate},{'channel':_0x7401('0xe'),'model':_0x7401('0xf'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x7401('0xe'),'model':_0x7401('0x10'),'event':_0x7401('0x7'),'condition':_0x7401('0xd'),'callback':afterCreateMessage},{'channel':_0x7401('0x11'),'model':'WhatsappInteraction','event':_0x7401('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x7401('0x11'),'model':_0x7401('0x12'),'event':_0x7401('0xa'),'condition':_0x7401('0xb'),'callback':afterUpdate},{'channel':_0x7401('0x11'),'model':_0x7401('0x13'),'event':'afterCreate','condition':_0x7401('0xd'),'callback':afterCreateMessage},{'channel':_0x7401('0x14'),'model':_0x7401('0x15'),'event':_0x7401('0x7'),'condition':_0x7401('0x8'),'callback':afterCreate},{'channel':_0x7401('0x14'),'model':'FaxInteraction','event':_0x7401('0xa'),'condition':_0x7401('0xb'),'callback':afterUpdate},{'channel':'Fax','model':_0x7401('0x16'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x7401('0x17'),'model':_0x7401('0x18'),'event':_0x7401('0x7'),'condition':_0x7401('0x8'),'callback':afterCreate},{'channel':'Mail','model':_0x7401('0x18'),'event':_0x7401('0xa'),'condition':_0x7401('0xb'),'callback':afterUpdate},{'channel':'Mail','model':'MailMessage','event':_0x7401('0x7'),'condition':_0x7401('0xd'),'callback':afterCreateMessage},{'channel':_0x7401('0x19'),'model':_0x7401('0x1a'),'event':_0x7401('0x7'),'condition':_0x7401('0x8'),'callback':afterCreate},{'channel':_0x7401('0x19'),'model':_0x7401('0x1a'),'event':'afterUpdate','condition':_0x7401('0xb'),'callback':afterUpdate},{'channel':_0x7401('0x19'),'model':'OpenchannelMessage','event':_0x7401('0x7'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x5892e0){return client[_0x7401('0x1b')]('EventManager',_0x5892e0)['then'](function(_0x24873b){logger[_0x7401('0x1c')](_0x7401('0x1d'),'EventManager',_0x24873b);if(_0x24873b['error']){if(_0x24873b['error'][_0x7401('0x1e')]===0x1f4){logger[_0x7401('0x1f')](_0x7401('0x1d'),_0x7401('0x20'),_0x24873b['error']);}}})['catch'](function(_0xbbb086){logger[_0x7401('0x1f')](_0x7401('0x1d'),_0x7401('0x20'),_0xbbb086);});}function afterCreateMessage(_0x5e9d69){return function(_0x2d415){_0x2d415=_0x2d415[_0x7401('0x21')]({'plain':!![]});_0x2d415[_0x7401('0x22')]=_0x5e9d69;_0x2d415[_0x7401('0x23')]=_0x5e9d69;_0x2d415[_0x7401('0x24')]=_0x2d415['direction'];Promise[_0x7401('0x25')]()[_0x7401('0x26')](function(){if(typeof _0x2d415[_0x7401('0x27')]==='undefined')return null;var _0x32e4f9='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2d415[_0x7401('0x27')];return db[_0x7401('0x28')][_0x7401('0x29')](_0x32e4f9,{'type':db[_0x7401('0x2a')][_0x7401('0x2b')][_0x7401('0x2c')],'raw':!![]});})['then'](function(_0x344d5e){if(_0x344d5e){_0x2d415[_0x7401('0x2d')]=_0x344d5e[0x0];}if(typeof _0x2d415[_0x7401('0x2e')]===_0x7401('0x2f'))return;return getAgent(_0x2d415['UserId']);})['then'](function(_0x3338f6){if(_0x3338f6){_0x2d415[_0x7401('0x30')]=util[_0x7401('0x31')](_0x7401('0x32'),_0x3338f6[_0x7401('0x33')]);_0x2d415[_0x7401('0x34')]=_0x3338f6;_0x2d415[_0x7401('0x22')]=_0x5e9d69;return request({'event':'incomingmessage','message':_0x2d415});}else{return request({'event':_0x7401('0x35'),'message':_0x2d415});}})[_0x7401('0x36')](function(_0x317d88){logger[_0x7401('0x1f')](_0x7401('0x1d'),_0x7401('0x37'),_0x317d88);});};}function afterCreateOfflineMessage(_0x4f5bd7){return function(_0x5cf710){_0x5cf710=_0x5cf710[_0x7401('0x21')]({'plain':!![]});_0x5cf710[_0x7401('0x22')]=_0x4f5bd7;_0x5cf710[_0x7401('0x23')]=_0x4f5bd7;_0x5cf710[_0x7401('0x24')]='offlineMessage';return request({'event':_0x5cf710[_0x7401('0x24')],'message':_0x5cf710});};}function afterCreate(_0x3cc367,_0x351f11){return function(_0x3c4ec7){_0x3c4ec7=_0x3c4ec7[_0x7401('0x21')]({'plain':!![]});_0x3c4ec7['channel']=_0x3cc367;_0x3c4ec7[_0x7401('0x23')]=_0x3cc367;_0x3c4ec7[_0x7401('0x24')]='opened';Promise['resolve']()[_0x7401('0x26')](function(){var _0x496f34=_0x7401('0x38')+_0x3c4ec7[_0x7401('0x27')];return db[_0x7401('0x28')][_0x7401('0x29')](_0x496f34,{'type':db[_0x7401('0x2a')]['QueryTypes'][_0x7401('0x2c')],'raw':!![]});})[_0x7401('0x26')](function(_0x49c415){if(_0x49c415){_0x3c4ec7[_0x7401('0x2d')]=_0x49c415[0x0];}if(typeof _0x3c4ec7[_0x7401('0x2e')]===_0x7401('0x2f'))return;return getAgent(_0x3c4ec7[_0x7401('0x2e')]);})[_0x7401('0x26')](function(_0x4b55df){if(_0x4b55df){_0x3c4ec7[_0x7401('0x30')]=util[_0x7401('0x31')](_0x7401('0x32'),_0x4b55df[_0x7401('0x33')]);_0x3c4ec7[_0x7401('0x34')]=_0x4b55df;}return request({'event':_0x351f11,'message':_0x3c4ec7});})[_0x7401('0x36')](function(_0x371184){logger[_0x7401('0x1f')]('Trigger,\x20%s',_0x7401('0x39'),_0x371184);});};}function afterUpdate(_0x57c75f){return function(_0x2743f4){var _0x2e25a7=_0x2743f4[_0x7401('0x3a')](_0x7401('0x3b'))&&_0x2743f4[_0x7401('0x3b')];var _0xe49588=_0x2743f4[_0x7401('0x3a')](_0x7401('0x3c'));if(_0x2e25a7||_0xe49588){var _0x264d14=_0x2e25a7?_0x7401('0xb'):'substatus';var _0x4418a2=_0x2743f4['get']({'plain':!![]});_0x4418a2[_0x7401('0x22')]=_0x57c75f;_0x4418a2[_0x7401('0x23')]=_0x57c75f;_0x4418a2['event']=_0x2e25a7?_0x7401('0x3b'):_0x7401('0x3c');var _0x5bd989=_0x7401('0x38')+_0x4418a2[_0x7401('0x27')];return db['sequelize']['query'](_0x5bd989,{'type':db[_0x7401('0x2a')][_0x7401('0x2b')][_0x7401('0x2c')],'raw':!![]})[_0x7401('0x26')](function(_0x59ed42){if(_0x59ed42){_0x4418a2[_0x7401('0x2d')]=_0x59ed42[0x0];}if(typeof _0x4418a2['UserId']===_0x7401('0x2f'))return;return getAgent(_0x4418a2[_0x7401('0x2e')]);})[_0x7401('0x26')](function(_0x4227d1){if(_0x4227d1){_0x4418a2[_0x7401('0x30')]=util[_0x7401('0x31')]('SIP/%s',_0x4227d1[_0x7401('0x33')]);_0x4418a2['agent']=_0x4227d1;}return request({'event':_0x264d14,'message':_0x4418a2});})[_0x7401('0x36')](function(_0x51dac6){logger[_0x7401('0x1f')](_0x7401('0x1d'),_0x7401('0x3d'),_0x51dac6);});}};}function getAgent(_0x406c78){return db[_0x7401('0x3e')][_0x7401('0x3f')]({'where':{'id':_0x406c78},'attributes':['id','name',_0x7401('0x40'),_0x7401('0x41'),'internal'],'raw':!![]})[_0x7401('0x26')](function(_0x498c5c){return _0x498c5c;});}exports[_0x7401('0x42')]=function(){for(var _0x3afbbf=0x0;_0x3afbbf=_0x401ce3['agents']){throw Error(_0x1b85('0x14'));}_0x52fdc9(_0x368abd);})['catch'](function(_0x4827a8){_0x596c01(_0x4827a8);});});}; \ No newline at end of file +var _0x0f46=['includes','clearBlockUser','blockedAt','updateAttributes','getLicense','role','User','count','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','bluebird','../mysqldb','voice','mail','chat','sms','whatsapp','openchannel','getChannels','toLowerCase'];(function(_0x1bbd62,_0x10e5ed){var _0x1fef47=function(_0x57a621){while(--_0x57a621){_0x1bbd62['push'](_0x1bbd62['shift']());}};_0x1fef47(++_0x10e5ed);}(_0x0f46,0x194));var _0x60f4=function(_0x93504f,_0x591f37){_0x93504f=_0x93504f-0x0;var _0x31ed83=_0x0f46[_0x93504f];return _0x31ed83;};'use strict';var _=require('lodash');var BPromise=require(_0x60f4('0x0'));var db=require(_0x60f4('0x1'))['db'];var util=require('./license/util');var channels=[_0x60f4('0x2'),_0x60f4('0x3'),_0x60f4('0x4'),'fax',_0x60f4('0x5'),_0x60f4('0x6'),_0x60f4('0x7')];exports[_0x60f4('0x8')]=function(){return channels;};exports['isValidChannel']=function(_0x4b1152){_0x4b1152=_0x4b1152[_0x60f4('0x9')]();return _[_0x60f4('0xa')](channels,_0x4b1152);};exports[_0x60f4('0xb')]=function(_0x232d7a,_0x41462e,_0x46bbeb,_0x4f1e83){var _0xd8cf7b={'loginAttempts':_0x41462e,'blocked':_0x46bbeb};if(!_['isUndefined'](_0x4f1e83)){_0xd8cf7b[_0x60f4('0xc')]=_0x4f1e83;}return _0x232d7a[_0x60f4('0xd')](_0xd8cf7b);};exports[_0x60f4('0xe')]=function(_0x41665f){return new BPromise(function(_0x49ed1c,_0x433f7b){var _0x4fee77=0x0;if(_0x41665f[_0x60f4('0xf')]!=='agent'){_0x49ed1c(_0x41665f);}db[_0x60f4('0x10')][_0x60f4('0x11')]({'where':{'role':_0x60f4('0x12'),'online':!![],'id':{'$ne':_0x41665f['id']}}})[_0x60f4('0x13')](function(_0x1c64f1){_0x4fee77=_0x1c64f1;return util['getLicense']();})[_0x60f4('0x13')](function(_0x1497e0){if(_0x1497e0&&_0x1497e0[_0x60f4('0x14')]&&_0x4fee77>=_0x1497e0[_0x60f4('0x14')]){throw Error(_0x60f4('0x15'));}_0x49ed1c(_0x41665f);})[_0x60f4('0x16')](function(_0x491fe5){_0x433f7b(_0x491fe5);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index d49f2f1..6472c2c 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x153f=['inherits','Forbidden','OutOfInterval','error','status','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error','Error','Bad\x20Request','name','Entity\x20not\x20found','Not\x20Found'];(function(_0x5fdb12,_0x435771){var _0x48ed34=function(_0x2f7a42){while(--_0x2f7a42){_0x5fdb12['push'](_0x5fdb12['shift']());}};_0x48ed34(++_0x435771);}(_0x153f,0x15b));var _0xf153=function(_0x4132ed,_0x1a6252){_0x4132ed=_0x4132ed-0x0;var _0x292212=_0x153f[_0x4132ed];return _0x292212;};'use strict';var util=require(_0xf153('0x0'));var logger=require(_0xf153('0x1'))(_0xf153('0x2'));var APIError=function(_0x44cea3,_0x2afb9a){this[_0xf153('0x3')]=_0x44cea3||_0xf153('0x4');this['name']=_0x2afb9a||_0xf153('0x5');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x1f9ead){this[_0xf153('0x3')]=_0x1f9ead||_0xf153('0x6');this[_0xf153('0x7')]=_0xf153('0x6');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x17ba96){this[_0xf153('0x3')]=_0x17ba96||_0xf153('0x8');this[_0xf153('0x7')]=_0xf153('0x9');util[_0xf153('0xa')](APINotFoundError,APIError);};function getStatusCode(_0x44845c){switch(_0x44845c){case _0xf153('0x6'):return 0x190;case _0xf153('0xb'),_0xf153('0xc'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x2b76eb){return function(_0x1c8de7){logger[_0xf153('0xd')](_0x1c8de7['stack']);var _0x3a8838=getStatusCode(_0x1c8de7[_0xf153('0x7')]);if(_0x1c8de7[_0xf153('0x7')])delete _0x1c8de7[_0xf153('0x7')];return _0x2b76eb[_0xf153('0xe')](_0x3a8838)[_0xf153('0xf')](_0x1c8de7);};}module[_0xf153('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xbec5=['error','stack','status','send','exports','util','../config/logger','message','Internal\x20Server\x20Error','name','inherits','Bad\x20Request','Entity\x20not\x20found','Not\x20Found','Forbidden','OutOfInterval'];(function(_0x9817f8,_0x1ca7ed){var _0x157f66=function(_0x1cefa8){while(--_0x1cefa8){_0x9817f8['push'](_0x9817f8['shift']());}};_0x157f66(++_0x1ca7ed);}(_0xbec5,0xe5));var _0x5bec=function(_0x445c98,_0x132bf7){_0x445c98=_0x445c98-0x0;var _0x2fe913=_0xbec5[_0x445c98];return _0x2fe913;};'use strict';var util=require(_0x5bec('0x0'));var logger=require(_0x5bec('0x1'))('api');var APIError=function(_0x1d4842,_0x38c81a){this[_0x5bec('0x2')]=_0x1d4842||_0x5bec('0x3');this[_0x5bec('0x4')]=_0x38c81a||'Error';util[_0x5bec('0x5')](APIError,Error);};var APIBadRequestError=function(_0x376cdb){this[_0x5bec('0x2')]=_0x376cdb||'Bad\x20Request';this[_0x5bec('0x4')]=_0x5bec('0x6');util[_0x5bec('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x406e65){this[_0x5bec('0x2')]=_0x406e65||_0x5bec('0x7');this[_0x5bec('0x4')]=_0x5bec('0x8');util['inherits'](APINotFoundError,APIError);};function getStatusCode(_0x41a827){switch(_0x41a827){case'Bad\x20Request':return 0x190;case _0x5bec('0x9'),_0x5bec('0xa'):return 0x193;case _0x5bec('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x4a5482){return function(_0x288d1b){logger[_0x5bec('0xb')](_0x288d1b[_0x5bec('0xc')]);var _0x57ffc4=getStatusCode(_0x288d1b[_0x5bec('0x4')]);if(_0x288d1b[_0x5bec('0x4')])delete _0x288d1b['name'];return _0x4a5482[_0x5bec('0xd')](_0x57ffc4)[_0x5bec('0xe')](_0x288d1b);};}module[_0x5bec('0xf')]={'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 c000688..7651258 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x84a3=['render','exports','404','status'];(function(_0x580078,_0x458893){var _0x168ae9=function(_0xe4ce9a){while(--_0xe4ce9a){_0x580078['push'](_0x580078['shift']());}};_0x168ae9(++_0x458893);}(_0x84a3,0x189));var _0x384a=function(_0x103c86,_0x1ef914){_0x103c86=_0x103c86-0x0;var _0x1d4773=_0x84a3[_0x103c86];return _0x1d4773;};'use strict';module[_0x384a('0x0')][0x194]=function pageNotFound(_0x147df8,_0x27eb68){var _0x5c64de=_0x384a('0x1');var _0x13aa92=0x194;var _0x45f797={'status':_0x13aa92};_0x27eb68[_0x384a('0x2')](_0x45f797[_0x384a('0x2')]);_0x27eb68[_0x384a('0x3')](_0x5c64de,{},function(_0x29c597,_0x1c7168){if(_0x29c597){return _0x27eb68[_0x384a('0x2')](_0x45f797[_0x384a('0x2')])['json'](_0x45f797);}_0x27eb68['send'](_0x1c7168);});}; \ No newline at end of file +var _0x62ef=['exports','404','status','send'];(function(_0x15ebfd,_0xbc1af8){var _0x268375=function(_0x32992b){while(--_0x32992b){_0x15ebfd['push'](_0x15ebfd['shift']());}};_0x268375(++_0xbc1af8);}(_0x62ef,0xd0));var _0xf62e=function(_0x125a8a,_0x490d31){_0x125a8a=_0x125a8a-0x0;var _0xe767a5=_0x62ef[_0x125a8a];return _0xe767a5;};'use strict';module[_0xf62e('0x0')][0x194]=function pageNotFound(_0x162465,_0x3182ed){var _0x5cad8f=_0xf62e('0x1');var _0x1cf337=0x194;var _0x57e2db={'status':_0x1cf337};_0x3182ed[_0xf62e('0x2')](_0x57e2db[_0xf62e('0x2')]);_0x3182ed['render'](_0x5cad8f,{},function(_0x421ca7,_0x3bb616){if(_0x421ca7){return _0x3182ed[_0xf62e('0x2')](_0x57e2db['status'])['json'](_0x57e2db);}_0x3182ed[_0xf62e('0x3')](_0x3bb616);});}; \ No newline at end of file diff --git a/server/migrations/2.6.11.js b/server/migrations/2.6.11.js index 99a8015..a8c5ae0 100644 --- a/server/migrations/2.6.11.js +++ b/server/migrations/2.6.11.js @@ -2,9 +2,8 @@ var BPromise = require('bluebird'); var util = require('util'); - var logger = require('../config/logger')('migration'); - +var updateAppConfig = require('../utils/update-app-config') var Sequence = function() {}; Sequence.prototype.enqueue = function(fn) { @@ -154,17 +153,20 @@ Migration.prototype.final = function(resolve) { }; module.exports = { - up: function(queryInterface, Sequelize) { + up: function(queryInterface /* , Sequelize */ ) { return new BPromise(function(resolve) { var migration = new Migration(queryInterface); // START FINAL migration.final(resolve); // END FINAL + + // Migrate app.json + return updateAppConfig(logger) }); }, - down: function(queryInterface, Sequelize) { + down: function( /* queryInterface, Sequelize */ ) { // var migration = new Migration(queryInterface); }, }; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index b3c04ec..aef091f 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa50f=['WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','User','cascade','UserId','hasOne','userSetting','hasMany','VoiceQueuesRt','Extensions','HopperFinals','ChatInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','chat_group_has_users','Contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','SmsInteractions','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','VoiceQueues','MailQueues','FaxQueues','SmsQueues','UserSmsQueue','OpenchannelQueues','WhatsappQueue','WhatsappQueues','ChatWebsites','user_has_fax_accounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','Sounds','moh_has_sounds','UserVoiceQueueRt','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','Contact','MailServerIn','MailAccountId','CloudProviderId','restrict','MailAccount','Imap','Smtp','Dispositions','Answers','MailMessage','Interactions','Applications','List','ListId','TemplateId','team_has_mail_queues','Account','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Interaction','ChatOfflineMessageId','TagId','ContactId','Items','FaxAccountId','Exntensions','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','user_has_chat_websites','OpenchannelQueueReport','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','team_has_chat_queues','CompanyId','Phones','CmContactId','Company','cm_contact_has_tags','CmHopperId','Agent','CampaignId','OwnerId','Automation','AutomationAllId','OneAny','AutomationAnyId','AutomationId','ParentId','Intervals','MailApplications','FaxApplications','SmsApplications','Schedule','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','AnalyticDefaultReport','DefaultReportId','AnalyticMetric','MetricId','SalesforceConfiguration','Configurations','SalesforceField','Subjects','Descriptions','Subject','SubjectId','Description','DescriptionId','FieldId','SugarcrmAccount','AccountId','SugarcrmConfiguration','SugarcrmField','Field','VariableId','DeskAccount','int_desk_configuration_has_tags','ZendeskConfiguration','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerField','Dynamics365Account','ChatQueueReport','FromId','ToId','SessionId','SmsQueueReport','JscriptyProject','ProjectId','ChatQueues','team_has_sms_queues','team_has_whatsapp_queues','VoicePrefixes','SquareProject','FromAccount','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToQueue','ToChatWebsiteId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','Resources','WhatsappAccount','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','user_has_whatsapp_interactions','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','exports','../config/environment','sequelize','lodash','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','xcall','database','username','options','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','import','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','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','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','Action','../api/action/action.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','Cdr','Sound','../api/sound/sound.model','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskField','FreshdeskAccount','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','JscriptyQuestionReport','JscriptySessionReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../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','../api/whatsappApplication/whatsappApplication.model'];(function(_0x12b8ec,_0x1655be){var _0x21af77=function(_0xe59f){while(--_0xe59f){_0x12b8ec['push'](_0x12b8ec['shift']());}};_0x21af77(++_0x1655be);}(_0xa50f,0xfa));var _0xfa50=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xa50f[_0x3e5086];return _0xfeb102;};'use strict';var config=require(_0xfa50('0x0'));var Sequelize=require(_0xfa50('0x1'));var _=require(_0xfa50('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config['sequelize']=_[_0xfa50('0x3')](config['sequelize'],{'database':_0xfa50('0x4'),'username':'xcall','password':_0xfa50('0x5'),'options':{'host':_0xfa50('0x6'),'port':0xcea,'dialect':_0xfa50('0x7'),'dialectOptions':{'charset':_0xfa50('0x8')},'logging':![],'timezone':timezone[_0xfa50('0x9')](),'define':{'charset':_0xfa50('0xa'),'collate':_0xfa50('0xb')}}});config['sequelizeHistory']=_[_0xfa50('0x3')](config[_0xfa50('0xc')],{'database':_0xfa50('0x4'),'username':_0xfa50('0xd'),'password':_0xfa50('0x5'),'options':{'host':_0xfa50('0x6'),'port':0xcea,'dialect':_0xfa50('0x7'),'dialectOptions':{'charset':_0xfa50('0x8')},'logging':![],'timezone':timezone[_0xfa50('0x9')](),'define':{'charset':'utf8','collate':_0xfa50('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xfa50('0x1')][_0xfa50('0xe')],config[_0xfa50('0x1')][_0xfa50('0xf')],config[_0xfa50('0x1')]['password'],config[_0xfa50('0x1')][_0xfa50('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xfa50('0xc')][_0xfa50('0xe')],config[_0xfa50('0xc')][_0xfa50('0xf')],config[_0xfa50('0xc')]['password'],config['sequelizeHistory'][_0xfa50('0x10')])};db['User']=db[_0xfa50('0x1')]['import'](_0xfa50('0x11'));db[_0xfa50('0x12')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x13'));db[_0xfa50('0x14')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x15'));db[_0xfa50('0x16')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/voiceExtension/voiceExtension.model');db[_0xfa50('0x18')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x19'));db[_0xfa50('0x1a')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x1b'));db[_0xfa50('0x1c')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x1d'));db['ScreenRecording']=db[_0xfa50('0x1')]['import'](_0xfa50('0x1e'));db[_0xfa50('0x1f')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x20'));db['VoiceMailMessage']=db[_0xfa50('0x1')]['import'](_0xfa50('0x21'));db[_0xfa50('0x22')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x23'));db[_0xfa50('0x24')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x25'));db[_0xfa50('0x26')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x27'));db[_0xfa50('0x28')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x29'));db['MemberReport']=db[_0xfa50('0x1')]['import'](_0xfa50('0x2a'));db['Trunk']=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/trunk/trunk.model');db[_0xfa50('0x2b')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x2c'));db['UserVoiceQueueRt']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x2d'));db[_0xfa50('0x2e')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x2f'));db[_0xfa50('0x30')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x31'));db[_0xfa50('0x32')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x33'));db[_0xfa50('0x34')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x35'));db['UserSmsQueue']=db[_0xfa50('0x1')]['import']('../api/userSmsQueue/userSmsQueue.model');db[_0xfa50('0x36')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x37'));db[_0xfa50('0x38')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x39'));db['MailServerIn']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x3a'));db[_0xfa50('0x3b')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x3c'));db['MailAccount']=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/mailAccount/mailAccount.model');db[_0xfa50('0x3d')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x3e'));db[_0xfa50('0x3f')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x40'));db[_0xfa50('0x41')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x42'));db['MailMessage']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x43'));db[_0xfa50('0x44')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/mailApplication/mailApplication.model');db[_0xfa50('0x45')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x46'));db[_0xfa50('0x47')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x48'));db[_0xfa50('0x49')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x4a'));db[_0xfa50('0x4b')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x4c'));db[_0xfa50('0x4d')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x4e'));db[_0xfa50('0x4f')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x50'));db[_0xfa50('0x51')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x52'));db[_0xfa50('0x53')]=db['sequelize']['import'](_0xfa50('0x54'));db[_0xfa50('0x55')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x56'));db['SmsAccount']=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x57'));db['SmsApplication']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x58'));db[_0xfa50('0x59')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x5a'));db[_0xfa50('0x5b')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x5c'));db[_0xfa50('0x5d')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/smsQueue/smsQueue.model');db[_0xfa50('0x5e')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/openchannelAccount/openchannelAccount.model');db['OpenchannelApplication']=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/openchannelApplication/openchannelApplication.model');db[_0xfa50('0x5f')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x60'));db['OpenchannelMessage']=db['sequelize']['import']('../api/openchannelMessage/openchannelMessage.model');db[_0xfa50('0x61')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x62'));db[_0xfa50('0x63')]=db['sequelize']['import'](_0xfa50('0x64'));db['OpenchannelQueueReport']=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x65'));db[_0xfa50('0x66')]=db[_0xfa50('0x1')]['import']('../api/chatApplication/chatApplication.model');db[_0xfa50('0x67')]=db[_0xfa50('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0xfa50('0x68')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x69'));db[_0xfa50('0x6a')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x6b'));db[_0xfa50('0x6c')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x6d'));db[_0xfa50('0x6e')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/chatGroup/chatGroup.model');db[_0xfa50('0x6f')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x70'));db[_0xfa50('0x71')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x72'));db[_0xfa50('0x73')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/cmContact/cmContact.model');db[_0xfa50('0x74')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x75'));db[_0xfa50('0x76')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x77'));db[_0xfa50('0x78')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0xfa50('0x79')]=db['sequelize']['import'](_0xfa50('0x7a'));db[_0xfa50('0x7b')]=db[_0xfa50('0x1')]['import']('../api/reportAgentPreview/reportAgentPreview.model');db[_0xfa50('0x7c')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/cmCustomField/cmCustomField.model');db[_0xfa50('0x7d')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x7e'));db['Automation']=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/automation/automation.model');db[_0xfa50('0x7f')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x80'));db[_0xfa50('0x81')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x82'));db[_0xfa50('0x83')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x84'));db[_0xfa50('0x85')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x86'));db[_0xfa50('0x87')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/pause/pause.model');db[_0xfa50('0x88')]=db[_0xfa50('0x1')]['import']('../api/cdr/cdr.model');db['VoiceQueuesLog']=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db['sequelize'][_0xfa50('0x17')]('../api/schedule/schedule.model');db[_0xfa50('0x89')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x8a'));db['Tag']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x8b'));db[_0xfa50('0x8c')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x8d'));db[_0xfa50('0x8e')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x8f'));db[_0xfa50('0x90')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x91'));db[_0xfa50('0x92')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/template/template.model');db[_0xfa50('0x93')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x94'));db[_0xfa50('0x95')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x96'));db[_0xfa50('0x97')]=db['sequelize']['import'](_0xfa50('0x98'));db[_0xfa50('0x99')]=db[_0xfa50('0x1')]['import']('../api/integrationReport/integrationReport.model');db[_0xfa50('0x9a')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x9b'));db['AnalyticDefaultReport']=db[_0xfa50('0x1')]['import'](_0xfa50('0x9c'));db[_0xfa50('0x9d')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x9e'));db['AnalyticMetric']=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/analyticMetric/analyticMetric.model');db[_0xfa50('0x9f')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xa0'));db['AnalyticTreeReport']=db['sequelize']['import'](_0xfa50('0xa1'));db[_0xfa50('0xa2')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xa3'));db['SalesforceConfiguration']=db['sequelize'][_0xfa50('0x17')](_0xfa50('0xa4'));db['SalesforceField']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xa5'));db['SugarcrmAccount']=db[_0xfa50('0x1')]['import'](_0xfa50('0xa6'));db['SugarcrmConfiguration']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xa7'));db['SugarcrmField']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xa8'));db['DeskAccount']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xa9'));db[_0xfa50('0xaa')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xab'));db[_0xfa50('0xac')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xad'));db[_0xfa50('0xae')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0xaf'));db[_0xfa50('0xb0')]=db[_0xfa50('0x1')]['import'](_0xfa50('0xb1'));db[_0xfa50('0xb2')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xb3'));db[_0xfa50('0xb4')]=db[_0xfa50('0x1')]['import'](_0xfa50('0xb5'));db['ZendeskConfiguration']=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xfa50('0xb6')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/intZendeskField/intZendeskField.model');db[_0xfa50('0xb7')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0xfa50('0x17')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0xfa50('0xb8')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xb9'));db[_0xfa50('0xba')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xbb'));db[_0xfa50('0xbc')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xbd'));db['VtigerField']=db['sequelize']['import'](_0xfa50('0xbe'));db[_0xfa50('0xbf')]=db[_0xfa50('0x1')]['import'](_0xfa50('0xc0'));db[_0xfa50('0xc1')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0xc2'));db[_0xfa50('0xc3')]=db[_0xfa50('0x1')]['import'](_0xfa50('0xc4'));db['Dynamics365Account']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xc5'));db[_0xfa50('0xc6')]=db['sequelize'][_0xfa50('0x17')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xfa50('0xc7')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0xc8'));db[_0xfa50('0xc9')]=db['sequelize'][_0xfa50('0x17')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0xfa50('0xca')]=db[_0xfa50('0x1')]['import'](_0xfa50('0xcb'));db[_0xfa50('0xcc')]=db['sequelize']['import'](_0xfa50('0xcd'));db[_0xfa50('0x97')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x98'));db[_0xfa50('0xce')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xcf'));db['ChatQueueReport']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xd0'));db[_0xfa50('0xd1')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0xfa50('0xd2')]=db[_0xfa50('0x1')]['import']('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xfa50('0xd3')]=db[_0xfa50('0x1')]['import']('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xfa50('0xd4')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xd5'));db['SquareReport']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xd6'));db[_0xfa50('0xd7')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xd8'));db['JscriptyProject']=db[_0xfa50('0x1')]['import'](_0xfa50('0xd9'));db[_0xfa50('0xda')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xdb'));db['SquareOdbc']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xdc'));db['SquareProject']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xdd'));db[_0xfa50('0xde')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xdf'));db['SquareMessage']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xe0'));db[_0xfa50('0xe1')]=db[_0xfa50('0x1')]['import'](_0xfa50('0xe2'));db['License']=db['sequelize']['import'](_0xfa50('0xe3'));db[_0xfa50('0xe4')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/campaign/campaign.model');db[_0xfa50('0xe5')]=db[_0xfa50('0x1')]['import'](_0xfa50('0xe6'));db[_0xfa50('0xe7')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xe8'));db[_0xfa50('0xe9')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xea'));db[_0xfa50('0xeb')]=db[_0xfa50('0x1')]['import'](_0xfa50('0xec'));db[_0xfa50('0xed')]=db['sequelize']['import']('../api/chatTransferReport/chatTransferReport.model');db[_0xfa50('0xee')]=db['sequelize']['import'](_0xfa50('0xef'));db[_0xfa50('0xf0')]=db['sequelize']['import'](_0xfa50('0xf1'));db[_0xfa50('0xf2')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xf3'));db[_0xfa50('0xf4')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/cmList/cmList.model');db[_0xfa50('0xf5')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0xf6'));db[_0xfa50('0xf7')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0xf8'));db[_0xfa50('0xf9')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xfa'));db[_0xfa50('0xfb')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/userProfileResource/userProfileResource.model');db[_0xfa50('0xfc')]=db[_0xfa50('0x1')]['import'](_0xfa50('0xfd'));db['WhatsappAccount']=db['sequelize'][_0xfa50('0x17')]('../api/whatsappAccount/whatsappAccount.model');db['WhatsappApplication']=db[_0xfa50('0x1')]['import'](_0xfa50('0xfe'));db[_0xfa50('0xff')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0xfa50('0x100')]=db['sequelize']['import']('../api/whatsappMessage/whatsappMessage.model');db[_0xfa50('0x101')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x102'));db[_0xfa50('0x103')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x104'));db['WhatsappQueue']=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x105'));db[_0xfa50('0x106')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/cloudProvider/cloudProvider.model');db[_0xfa50('0x107')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x108'));db[_0xfa50('0x109')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x10a'));db[_0xfa50('0x10b')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x10c'));db[_0xfa50('0x10d')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x10e'));db[_0xfa50('0x10f')]['hasOne'](db[_0xfa50('0x1f')],{'as':_0xfa50('0x1f'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x111')});db[_0xfa50('0x10f')][_0xfa50('0x112')](db[_0xfa50('0x10d')],{'as':_0xfa50('0x113'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x111')});db['User'][_0xfa50('0x114')](db[_0xfa50('0x1c')],{'as':'Recordings','foreignKey':_0xfa50('0x111')});db[_0xfa50('0x10f')][_0xfa50('0x114')](db['UserVoiceQueueRt'],{'as':_0xfa50('0x115'),'foreignKey':_0xfa50('0x111')});db[_0xfa50('0x10f')][_0xfa50('0x114')](db[_0xfa50('0x16')],{'as':_0xfa50('0x116'),'onDelete':_0xfa50('0x110'),'hooks':!![]});db['User'][_0xfa50('0x114')](db[_0xfa50('0x78')],{'as':_0xfa50('0x117'),'foreignKey':_0xfa50('0x111')});db['User']['hasMany'](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0xfa50('0x111')});db[_0xfa50('0x10f')]['hasMany'](db[_0xfa50('0x7b')],{'as':_0xfa50('0x7b'),'foreignKey':_0xfa50('0x111')});db[_0xfa50('0x10f')][_0xfa50('0x114')](db[_0xfa50('0x5f')],{'as':'OpenchannelInteractions','foreignKey':_0xfa50('0x111')});db[_0xfa50('0x10f')]['hasMany'](db[_0xfa50('0x67')],{'as':_0xfa50('0x118'),'foreignKey':'UserId'});db[_0xfa50('0x10f')]['hasMany'](db[_0xfa50('0x59')],{'as':'SmsInteractions','foreignKey':'UserId'});db[_0xfa50('0x10f')][_0xfa50('0x114')](db[_0xfa50('0x4f')],{'as':_0xfa50('0x119'),'foreignKey':'UserId'});db[_0xfa50('0x10f')][_0xfa50('0x114')](db['MailInteraction'],{'as':_0xfa50('0x11a'),'foreignKey':_0xfa50('0x111')});db[_0xfa50('0x10f')][_0xfa50('0x114')](db[_0xfa50('0xff')],{'as':_0xfa50('0x11b'),'foreignKey':_0xfa50('0x111')});db[_0xfa50('0x10f')]['hasMany'](db[_0xfa50('0xfc')],{'as':_0xfa50('0x11c'),'foreignKey':_0xfa50('0x11d')});db[_0xfa50('0x10f')][_0xfa50('0x11e')](db[_0xfa50('0xf7')],{'as':_0xfa50('0xf7'),'foreignKey':_0xfa50('0x11f')});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0x6e')],{'as':'Groups','through':_0xfa50('0x121')});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0x73')],{'as':_0xfa50('0x122'),'through':'cm_user_has_contacts'});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0xf4')],{'as':_0xfa50('0x123'),'through':_0xfa50('0x124')});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0xe1')],{'through':_0xfa50('0x125')});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0x41')],{'as':'MailInteractions','through':_0xfa50('0x126')});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0x67')],{'as':'ChatInteractions','through':_0xfa50('0x127')});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0x4f')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db[_0xfa50('0x10f')]['belongsToMany'](db[_0xfa50('0x59')],{'as':_0xfa50('0x128'),'through':_0xfa50('0x129')});db['User']['belongsToMany'](db['OpenchannelInteraction'],{'as':_0xfa50('0x12a'),'through':_0xfa50('0x12b')});db[_0xfa50('0x10f')][_0xfa50('0x120')](db['WhatsappInteraction'],{'as':_0xfa50('0x11b'),'through':'user_has_whatsapp_interactions'});db['User'][_0xfa50('0x120')](db[_0xfa50('0x1a')],{'as':_0xfa50('0x12c'),'through':_0xfa50('0x2e'),'required':![]});db['User'][_0xfa50('0x120')](db[_0xfa50('0xf5')],{'as':'VoicePrefixes','through':_0xfa50('0x10b'),'required':![]});db[_0xfa50('0x10f')]['belongsToMany'](db['MailQueue'],{'as':_0xfa50('0x12d'),'through':_0xfa50('0x32'),'required':![]});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0x6c')],{'as':'ChatQueues','through':_0xfa50('0x30'),'required':![],'hooks':!![]});db[_0xfa50('0x10f')]['belongsToMany'](db[_0xfa50('0x53')],{'as':_0xfa50('0x12e'),'through':_0xfa50('0x34'),'required':![]});db[_0xfa50('0x10f')]['belongsToMany'](db[_0xfa50('0x5d')],{'as':_0xfa50('0x12f'),'through':_0xfa50('0x130'),'required':![]});db['User'][_0xfa50('0x120')](db[_0xfa50('0x61')],{'as':_0xfa50('0x131'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0xfa50('0x120')](db[_0xfa50('0x132')],{'as':_0xfa50('0x133'),'through':_0xfa50('0x38'),'required':![]});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0xf4')],{'through':'cm_user_has_lists'});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0x63')],{'as':_0xfa50('0x134'),'through':'user_has_chat_websites'});db[_0xfa50('0x10f')][_0xfa50('0x120')](db['FaxAccount'],{'as':'FaxAccounts','through':_0xfa50('0x135')});db[_0xfa50('0x10f')]['belongsToMany'](db['MailAccount'],{'as':'MailAccounts','through':_0xfa50('0x136')});db[_0xfa50('0x10f')]['belongsToMany'](db[_0xfa50('0x5e')],{'as':'OpenchannelAccounts','through':_0xfa50('0x137')});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0x138')],{'as':'SmsAccounts','through':_0xfa50('0x139')});db[_0xfa50('0x10f')][_0xfa50('0x120')](db['WhatsappAccount'],{'as':_0xfa50('0x13a'),'through':_0xfa50('0x13b')});db[_0xfa50('0x12')][_0xfa50('0x114')](db['VoiceExtension'],{'as':_0xfa50('0x13c'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x13d')});db[_0xfa50('0x14')][_0xfa50('0x114')](db[_0xfa50('0x16')],{'onDelete':_0xfa50('0x110')});db[_0xfa50('0x16')]['hasMany'](db['VoiceExtension'],{'as':'Applications','onDelete':_0xfa50('0x110')});db[_0xfa50('0x18')][_0xfa50('0x120')](db['Sound'],{'as':_0xfa50('0x13e'),'through':_0xfa50('0x13f')});db[_0xfa50('0x1a')][_0xfa50('0x114')](db[_0xfa50('0x140')],{'as':_0xfa50('0x141'),'foreignKey':_0xfa50('0x142')});db[_0xfa50('0x1a')][_0xfa50('0x114')](db[_0xfa50('0x74')],{'as':_0xfa50('0x143'),'foreignKey':'VoiceQueueId'});db[_0xfa50('0x1a')][_0xfa50('0x114')](db[_0xfa50('0x78')],{'as':_0xfa50('0x117'),'foreignKey':_0xfa50('0x142')});db[_0xfa50('0x1a')]['hasMany'](db[_0xfa50('0x79')],{'as':_0xfa50('0x144'),'foreignKey':_0xfa50('0x142')});db['VoiceQueue'][_0xfa50('0x114')](db[_0xfa50('0x7b')],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db[_0xfa50('0x1a')][_0xfa50('0x114')](db['CmHopperBlack'],{'as':_0xfa50('0x145'),'foreignKey':_0xfa50('0x142')});db[_0xfa50('0x1a')]['hasMany'](db[_0xfa50('0xd4')],{'as':_0xfa50('0x146'),'foreignKey':'VoiceQueueId'});db[_0xfa50('0x1a')][_0xfa50('0x11e')](db['Trunk'],{'as':_0xfa50('0x147'),'foreignKey':'TrunkId'});db['VoiceQueue'][_0xfa50('0x11e')](db['Trunk'],{'as':_0xfa50('0x148'),'foreignKey':_0xfa50('0x149')});db[_0xfa50('0x1a')][_0xfa50('0x11e')](db[_0xfa50('0x85')],{'as':'Interval','foreignKey':_0xfa50('0x14a')});db[_0xfa50('0x1a')][_0xfa50('0x11e')](db[_0xfa50('0x87')],{'as':_0xfa50('0x14b'),'foreignKey':_0xfa50('0x14c')});db[_0xfa50('0x1a')][_0xfa50('0x120')](db['CmList'],{'as':'Lists','through':_0xfa50('0x14d')});db['VoiceQueue'][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x14e'),'through':_0xfa50('0x2e')});db[_0xfa50('0x1a')][_0xfa50('0x120')](db[_0xfa50('0xe1')],{'as':_0xfa50('0x14f'),'through':'TeamVoiceQueue'});db[_0xfa50('0x1a')][_0xfa50('0x120')](db[_0xfa50('0xf4')],{'as':_0xfa50('0x150'),'through':_0xfa50('0x151')});db[_0xfa50('0x1c')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x10f'),'foreignKey':_0xfa50('0x111')});db[_0xfa50('0x152')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x10f'),'foreignKey':'UserId'});db[_0xfa50('0x1f')][_0xfa50('0x114')](db[_0xfa50('0x153')],{'as':_0xfa50('0x154'),'onDelete':'cascade','foreignKey':_0xfa50('0x155'),'sourceKey':_0xfa50('0x156')});db[_0xfa50('0x153')]['belongsTo'](db[_0xfa50('0x1f')],{'foreignKey':_0xfa50('0x155'),'targetKey':'mailbox'});db[_0xfa50('0x22')][_0xfa50('0x114')](db['VoiceQueueReport'],{'as':_0xfa50('0x157'),'foreignKey':_0xfa50('0x158'),'constraints':![]});db[_0xfa50('0x22')][_0xfa50('0x114')](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':_0xfa50('0x158'),'constraints':![]});db[_0xfa50('0x22')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'as':'User','foreignKey':'UserId'});db['VoiceCallReport'][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':_0xfa50('0x159'),'foreignKey':'ContactId'});db[_0xfa50('0x15a')][_0xfa50('0x11e')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xfa50('0x15b')});db[_0xfa50('0x15a')]['belongsTo'](db[_0xfa50('0x106')],{'as':'CloudProvider','foreignKey':_0xfa50('0x15c'),'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x3b')][_0xfa50('0x11e')](db[_0xfa50('0x15e')],{'as':_0xfa50('0x15e'),'foreignKey':_0xfa50('0x15b')});db[_0xfa50('0x3b')][_0xfa50('0x11e')](db[_0xfa50('0x106')],{'as':_0xfa50('0x106'),'foreignKey':_0xfa50('0x15c'),'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x15e')][_0xfa50('0x112')](db[_0xfa50('0x15a')],{'as':_0xfa50('0x15f'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0x15e')][_0xfa50('0x112')](db[_0xfa50('0x3b')],{'as':_0xfa50('0x160'),'onDelete':_0xfa50('0x110')});db['MailAccount']['hasMany'](db[_0xfa50('0x81')],{'as':_0xfa50('0x161'),'foreignKey':_0xfa50('0x15b'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0x15e')]['hasMany'](db[_0xfa50('0x7f')],{'as':_0xfa50('0x162'),'foreignKey':_0xfa50('0x15b')});db[_0xfa50('0x15e')]['hasMany'](db[_0xfa50('0x163')],{'as':_0xfa50('0x154'),'foreignKey':_0xfa50('0x15b')});db[_0xfa50('0x15e')]['hasMany'](db[_0xfa50('0x41')],{'as':_0xfa50('0x164')});db[_0xfa50('0x15e')][_0xfa50('0x114')](db[_0xfa50('0x44')],{'as':_0xfa50('0x165')});db['MailAccount']['belongsTo'](db[_0xfa50('0xf4')],{'as':_0xfa50('0x166'),'foreignKey':_0xfa50('0x167')});db[_0xfa50('0x15e')][_0xfa50('0x11e')](db[_0xfa50('0x92')],{'as':_0xfa50('0x92'),'foreignKey':_0xfa50('0x168')});db[_0xfa50('0x15e')]['belongsTo'](db[_0xfa50('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0xfa50('0x14c')});db[_0xfa50('0x15e')][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x14e'),'through':_0xfa50('0x136')});db['MailQueue'][_0xfa50('0x120')](db['User'],{'as':_0xfa50('0x14e'),'through':'UserMailQueue'});db['MailQueue'][_0xfa50('0x120')](db[_0xfa50('0xe1')],{'through':_0xfa50('0x169'),'as':_0xfa50('0x14f')});db[_0xfa50('0x41')][_0xfa50('0x114')](db['MailMessage'],{'as':_0xfa50('0x154'),'onDelete':_0xfa50('0x110'),'foreignKey':'MailInteractionId'});db['MailInteraction'][_0xfa50('0x11e')](db[_0xfa50('0x15e')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x15b')});db['MailInteraction'][_0xfa50('0x11e')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xfa50('0x41')][_0xfa50('0x11e')](db['User'],{'as':_0xfa50('0x16b'),'foreignKey':'UserId'});db[_0xfa50('0x41')][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':_0xfa50('0x16d'),'as':_0xfa50('0x16e')});db[_0xfa50('0x41')][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':_0xfa50('0x16d'),'as':_0xfa50('0x16f')});db[_0xfa50('0x41')]['belongsToMany'](db[_0xfa50('0x10f')],{'as':_0xfa50('0x170'),'through':_0xfa50('0x126'),'foreignKey':'MailInteractionId'});db['MailMessage']['hasMany'](db[_0xfa50('0xe7')],{'as':'Attachments','onDelete':'cascade'});db['MailMessage'][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'as':'User'});db[_0xfa50('0x163')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'onDelete':'cascade','as':_0xfa50('0x159')});db[_0xfa50('0x163')]['belongsTo'](db[_0xfa50('0x41')],{'as':_0xfa50('0x171'),'foreignKey':'MailInteractionId'});db[_0xfa50('0x163')][_0xfa50('0x11e')](db['MailAccount'],{'as':_0xfa50('0x16a'),'foreignKey':'MailAccountId'});db[_0xfa50('0x163')][_0xfa50('0x11e')](db[_0xfa50('0x63')],{'as':_0xfa50('0x63'),'foreignKey':'ChatWebsiteId'});db[_0xfa50('0x163')][_0xfa50('0x11e')](db[_0xfa50('0x6a')],{'as':_0xfa50('0x6a'),'foreignKey':_0xfa50('0x172')});db['MailApplication'][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'onDelete':'restrict'});db[_0xfa50('0x44')][_0xfa50('0x11e')](db['MailQueue'],{'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x44')]['belongsTo'](db[_0xfa50('0x15e')],{'onDelete':_0xfa50('0x15d')});db['MailApplication'][_0xfa50('0x11e')](db['Interval'],{'onDelete':_0xfa50('0x15d'),'foreignKey':_0xfa50('0x14a')});db[_0xfa50('0x44')]['belongsTo'](db[_0xfa50('0x16c')],{'onDelete':_0xfa50('0x15d'),'foreignKey':_0xfa50('0x173')});db[_0xfa50('0x45')][_0xfa50('0x11e')](db['MailAccount'],{});db['MailQueueReport'][_0xfa50('0x11e')](db[_0xfa50('0xf4')],{'as':'List','foreignKey':_0xfa50('0x167')});db[_0xfa50('0x45')][_0xfa50('0x11e')](db['CmContact'],{'as':_0xfa50('0x159'),'foreignKey':_0xfa50('0x174')});db[_0xfa50('0x45')][_0xfa50('0x11e')](db[_0xfa50('0x41')],{});db['MailQueueReport']['belongsTo'](db[_0xfa50('0x163')],{});db[_0xfa50('0x45')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{});db[_0xfa50('0x45')]['belongsTo'](db[_0xfa50('0x3d')],{});db[_0xfa50('0x47')][_0xfa50('0x114')](db[_0xfa50('0x49')],{'as':_0xfa50('0x175'),'onDelete':_0xfa50('0x110')});db['FaxAccount']['hasMany'](db[_0xfa50('0x81')],{'as':_0xfa50('0x161'),'foreignKey':'FaxAccountId','onDelete':_0xfa50('0x110')});db['FaxAccount']['hasMany'](db[_0xfa50('0x7f')],{'as':_0xfa50('0x162'),'foreignKey':_0xfa50('0x176')});db[_0xfa50('0x4b')][_0xfa50('0x114')](db[_0xfa50('0x4f')],{'as':'Interactions'});db[_0xfa50('0x4b')][_0xfa50('0x114')](db[_0xfa50('0x4d')],{'as':_0xfa50('0x165')});db[_0xfa50('0x4b')][_0xfa50('0x114')](db['VoiceExtension'],{'as':_0xfa50('0x177'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0x4b')][_0xfa50('0x114')](db['FaxMessage'],{'as':_0xfa50('0x154')});db[_0xfa50('0x4b')][_0xfa50('0x11e')](db[_0xfa50('0x147')],{'as':_0xfa50('0x147')});db[_0xfa50('0x4b')][_0xfa50('0x11e')](db['CmList'],{'as':'List','foreignKey':_0xfa50('0x167')});db[_0xfa50('0x4b')]['belongsTo'](db[_0xfa50('0x87')],{'as':_0xfa50('0x14b'),'foreignKey':_0xfa50('0x14c')});db[_0xfa50('0x4b')][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':'Agents','through':'user_has_fax_accounts'});db[_0xfa50('0x4d')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x4d')]['belongsTo'](db[_0xfa50('0x53')],{'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x4d')]['belongsTo'](db[_0xfa50('0x4b')],{'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x4d')][_0xfa50('0x11e')](db[_0xfa50('0x16c')],{'onDelete':_0xfa50('0x15d'),'foreignKey':'TagId'});db['FaxInteraction'][_0xfa50('0x114')](db[_0xfa50('0x51')],{'as':'Messages','onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x178')});db[_0xfa50('0x4f')][_0xfa50('0x11e')](db[_0xfa50('0x4b')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x176')});db[_0xfa50('0x4f')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0xfa50('0x174')});db[_0xfa50('0x4f')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x16b'),'foreignKey':'UserId'});db[_0xfa50('0x4f')][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':_0xfa50('0x179'),'as':'Tags'});db[_0xfa50('0x4f')][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db[_0xfa50('0x4f')][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x170'),'through':'user_has_fax_interactions','foreignKey':_0xfa50('0x178')});db[_0xfa50('0x51')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'onDelete':_0xfa50('0x110'),'as':_0xfa50('0x10f')});db[_0xfa50('0x51')][_0xfa50('0x11e')](db[_0xfa50('0x4f')],{'as':_0xfa50('0x171'),'foreignKey':_0xfa50('0x178')});db['FaxMessage'][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'onDelete':_0xfa50('0x110'),'as':_0xfa50('0x159')});db['FaxMessage']['belongsTo'](db['Attachment'],{'as':_0xfa50('0xe7'),'foreignKey':_0xfa50('0x17a')});db[_0xfa50('0x51')]['belongsTo'](db['FaxAccount'],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x176')});db[_0xfa50('0x53')]['belongsToMany'](db[_0xfa50('0x10f')],{'as':_0xfa50('0x14e'),'through':_0xfa50('0x34')});db[_0xfa50('0x53')][_0xfa50('0x120')](db[_0xfa50('0xe1')],{'through':_0xfa50('0x17b'),'as':_0xfa50('0x14f')});db[_0xfa50('0x55')][_0xfa50('0x11e')](db[_0xfa50('0x4b')],{});db[_0xfa50('0x55')][_0xfa50('0x11e')](db[_0xfa50('0xf4')],{'as':_0xfa50('0x166'),'foreignKey':'ListId'});db[_0xfa50('0x55')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':_0xfa50('0x159'),'foreignKey':'ContactId'});db['FaxQueueReport'][_0xfa50('0x11e')](db[_0xfa50('0x4f')],{});db[_0xfa50('0x55')][_0xfa50('0x11e')](db['FaxMessage'],{});db[_0xfa50('0x55')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{});db[_0xfa50('0x55')][_0xfa50('0x11e')](db['FaxQueue'],{});db[_0xfa50('0x138')][_0xfa50('0x114')](db[_0xfa50('0x81')],{'as':_0xfa50('0x161'),'foreignKey':_0xfa50('0x17c'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0x138')][_0xfa50('0x114')](db['CannedAnswer'],{'as':_0xfa50('0x162'),'foreignKey':_0xfa50('0x17c')});db[_0xfa50('0x138')][_0xfa50('0x114')](db[_0xfa50('0x5b')],{'as':'Messages','foreignKey':_0xfa50('0x17c')});db['SmsAccount'][_0xfa50('0x114')](db[_0xfa50('0x59')],{'as':_0xfa50('0x164')});db[_0xfa50('0x138')][_0xfa50('0x114')](db['SmsApplication'],{'as':_0xfa50('0x165')});db[_0xfa50('0x138')][_0xfa50('0x11e')](db[_0xfa50('0xf4')],{'as':_0xfa50('0x166'),'foreignKey':_0xfa50('0x167')});db[_0xfa50('0x138')][_0xfa50('0x11e')](db[_0xfa50('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0xfa50('0x14c')});db['SmsAccount'][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':'Agents','through':_0xfa50('0x139')});db[_0xfa50('0x17d')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x17d')][_0xfa50('0x11e')](db[_0xfa50('0x5d')],{'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x17d')][_0xfa50('0x11e')](db[_0xfa50('0x138')],{'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x17d')]['belongsTo'](db['Interval'],{'onDelete':'restrict','foreignKey':_0xfa50('0x14a')});db[_0xfa50('0x17d')][_0xfa50('0x11e')](db[_0xfa50('0x16c')],{'onDelete':_0xfa50('0x15d'),'foreignKey':_0xfa50('0x173')});db[_0xfa50('0x59')][_0xfa50('0x114')](db[_0xfa50('0x5b')],{'as':_0xfa50('0x154'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x17e')});db[_0xfa50('0x59')][_0xfa50('0x11e')](db[_0xfa50('0x138')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x17c')});db[_0xfa50('0x59')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':_0xfa50('0x159'),'foreignKey':_0xfa50('0x174')});db[_0xfa50('0x59')][_0xfa50('0x11e')](db['User'],{'as':'Owner','foreignKey':'UserId'});db[_0xfa50('0x59')][_0xfa50('0x120')](db['Tag'],{'through':_0xfa50('0x17f'),'as':_0xfa50('0x16e')});db[_0xfa50('0x59')][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':_0xfa50('0x17f'),'as':_0xfa50('0x16f')});db[_0xfa50('0x59')][_0xfa50('0x120')](db['User'],{'as':_0xfa50('0x170'),'through':_0xfa50('0x129'),'foreignKey':_0xfa50('0x17e')});db[_0xfa50('0x5b')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'as':'User'});db[_0xfa50('0x5b')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'onDelete':_0xfa50('0x110'),'as':_0xfa50('0x159')});db[_0xfa50('0x5b')]['belongsTo'](db[_0xfa50('0x59')],{'onDelete':_0xfa50('0x110'),'as':'Interaction','foreignKey':'SmsInteractionId'});db[_0xfa50('0x5b')]['belongsTo'](db[_0xfa50('0x138')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x17c')});db['SmsQueue'][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':'Agents','through':_0xfa50('0x130'),'foreignKey':_0xfa50('0x180')});db[_0xfa50('0x5d')]['belongsToMany'](db[_0xfa50('0xe1')],{'through':'team_has_sms_queues','as':_0xfa50('0x14f')});db['OpenchannelAccount'][_0xfa50('0x114')](db['Disposition'],{'as':_0xfa50('0x161'),'foreignKey':_0xfa50('0x181'),'onDelete':'cascade'});db['OpenchannelAccount'][_0xfa50('0x114')](db[_0xfa50('0x7f')],{'as':_0xfa50('0x162'),'foreignKey':_0xfa50('0x181')});db['OpenchannelAccount'][_0xfa50('0x114')](db[_0xfa50('0x5f')],{'as':_0xfa50('0x164'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xfa50('0x114')](db[_0xfa50('0x182')],{'as':_0xfa50('0x154'),'foreignKey':_0xfa50('0x181')});db[_0xfa50('0x5e')][_0xfa50('0x114')](db[_0xfa50('0x183')],{'as':_0xfa50('0x165'),'foreignKey':_0xfa50('0x181')});db[_0xfa50('0x5e')][_0xfa50('0x11e')](db['CmList'],{'as':'List','foreignKey':_0xfa50('0x167')});db[_0xfa50('0x5e')][_0xfa50('0x11e')](db[_0xfa50('0x87')],{'as':_0xfa50('0x14b'),'foreignKey':_0xfa50('0x14c')});db[_0xfa50('0x5e')][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x14e'),'through':_0xfa50('0x137')});db['OpenchannelApplication'][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x183')][_0xfa50('0x11e')](db[_0xfa50('0x61')],{'onDelete':_0xfa50('0x15d'),'foreignKey':_0xfa50('0x184')});db['OpenchannelApplication']['belongsTo'](db[_0xfa50('0x5e')],{'onDelete':_0xfa50('0x15d'),'foreignKey':_0xfa50('0x181')});db[_0xfa50('0x183')][_0xfa50('0x11e')](db[_0xfa50('0x85')],{'onDelete':_0xfa50('0x15d'),'foreignKey':'IntervalId'});db['OpenchannelApplication']['belongsTo'](db[_0xfa50('0x16c')],{'onDelete':'restrict','foreignKey':_0xfa50('0x173')});db[_0xfa50('0x5f')][_0xfa50('0x114')](db[_0xfa50('0x182')],{'as':_0xfa50('0x154'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x185')});db[_0xfa50('0x5f')][_0xfa50('0x11e')](db['OpenchannelAccount'],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x181')});db[_0xfa50('0x5f')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':_0xfa50('0x159'),'foreignKey':_0xfa50('0x174')});db[_0xfa50('0x5f')][_0xfa50('0x11e')](db['User'],{'as':_0xfa50('0x16b'),'foreignKey':'UserId'});db['OpenchannelInteraction'][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':_0xfa50('0x186'),'as':_0xfa50('0x16e')});db[_0xfa50('0x5f')][_0xfa50('0x120')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0xfa50('0x16f')});db['OpenchannelInteraction'][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x170'),'through':_0xfa50('0x12b'),'foreignKey':_0xfa50('0x185')});db[_0xfa50('0x182')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'onDelete':_0xfa50('0x110'),'as':_0xfa50('0x10f')});db['OpenchannelMessage'][_0xfa50('0x11e')](db['CmContact'],{'onDelete':_0xfa50('0x110'),'as':_0xfa50('0x159')});db['OpenchannelMessage'][_0xfa50('0x11e')](db['OpenchannelInteraction'],{'onDelete':_0xfa50('0x110'),'as':'Interaction','foreignKey':_0xfa50('0x185')});db[_0xfa50('0x182')][_0xfa50('0x11e')](db[_0xfa50('0xe7')],{'as':_0xfa50('0xe7'),'foreignKey':_0xfa50('0x17a')});db[_0xfa50('0x182')][_0xfa50('0x11e')](db['OpenchannelAccount'],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x181')});db[_0xfa50('0x61')]['belongsToMany'](db[_0xfa50('0x10f')],{'as':'Agents','through':_0xfa50('0x36'),'foreignKey':_0xfa50('0x184')});db[_0xfa50('0x61')][_0xfa50('0x120')](db['Team'],{'through':_0xfa50('0x187'),'as':'Teams'});db[_0xfa50('0x63')]['hasMany'](db[_0xfa50('0x81')],{'as':_0xfa50('0x161'),'foreignKey':_0xfa50('0x188'),'onDelete':'cascade'});db[_0xfa50('0x63')][_0xfa50('0x114')](db['CannedAnswer'],{'as':_0xfa50('0x162'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite']['hasMany'](db[_0xfa50('0x6f')],{'as':_0xfa50('0x189')});db[_0xfa50('0x63')]['hasMany'](db[_0xfa50('0x67')],{'as':_0xfa50('0x164')});db[_0xfa50('0x63')][_0xfa50('0x114')](db[_0xfa50('0x66')],{'as':_0xfa50('0x165')});db[_0xfa50('0x63')][_0xfa50('0x114')](db['ChatMessage'],{'as':'Messages'});db[_0xfa50('0x63')][_0xfa50('0x11e')](db['CmList'],{'as':_0xfa50('0x166'),'foreignKey':_0xfa50('0x167')});db[_0xfa50('0x63')][_0xfa50('0x11e')](db['Interval'],{'as':_0xfa50('0x85'),'foreignKey':'IntervalId'});db[_0xfa50('0x63')][_0xfa50('0x11e')](db[_0xfa50('0x15e')],{'as':'MailAccount','foreignKey':_0xfa50('0x15b')});db['ChatWebsite'][_0xfa50('0x11e')](db[_0xfa50('0x87')],{'as':_0xfa50('0x14b'),'foreignKey':_0xfa50('0x14c')});db[_0xfa50('0x63')][_0xfa50('0x120')](db['User'],{'as':_0xfa50('0x14e'),'through':_0xfa50('0x18a')});db[_0xfa50('0x18b')][_0xfa50('0x11e')](db[_0xfa50('0x5e')],{});db[_0xfa50('0x18b')]['belongsTo'](db[_0xfa50('0xf4')],{'as':_0xfa50('0x166'),'foreignKey':'ListId'});db['OpenchannelQueueReport'][_0xfa50('0x11e')](db['CmContact'],{'as':_0xfa50('0x159'),'foreignKey':_0xfa50('0x174')});db[_0xfa50('0x18b')][_0xfa50('0x11e')](db[_0xfa50('0x5f')],{});db[_0xfa50('0x18b')][_0xfa50('0x11e')](db['OpenchannelMessage'],{});db[_0xfa50('0x18b')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{});db[_0xfa50('0x18b')][_0xfa50('0x11e')](db[_0xfa50('0x61')],{});db['ChatApplication'][_0xfa50('0x11e')](db['User'],{'as':'Agent','foreignKey':'UserId','onDelete':'restrict'});db[_0xfa50('0x66')][_0xfa50('0x11e')](db[_0xfa50('0x6c')],{'as':_0xfa50('0x18c'),'foreignKey':_0xfa50('0x18d'),'onDelete':_0xfa50('0x15d')});db['ChatApplication'][_0xfa50('0x11e')](db['ChatWebsite'],{'as':_0xfa50('0x18e'),'foreignKey':_0xfa50('0x188'),'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x66')]['belongsTo'](db[_0xfa50('0x16c')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xfa50('0x67')][_0xfa50('0x114')](db[_0xfa50('0x68')],{'as':_0xfa50('0x154'),'onDelete':'cascade','foreignKey':_0xfa50('0x18f')});db['ChatInteraction'][_0xfa50('0x11e')](db[_0xfa50('0x63')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x188')});db[_0xfa50('0x67')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':_0xfa50('0x159'),'foreignKey':_0xfa50('0x174')});db['ChatInteraction']['belongsTo'](db[_0xfa50('0x10f')],{'as':_0xfa50('0x16b'),'foreignKey':_0xfa50('0x111')});db[_0xfa50('0x67')][_0xfa50('0x120')](db['Tag'],{'through':_0xfa50('0x190'),'as':_0xfa50('0x16e')});db[_0xfa50('0x67')][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':_0xfa50('0x190'),'as':_0xfa50('0x16f')});db[_0xfa50('0x67')][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x170'),'through':_0xfa50('0x127'),'foreignKey':_0xfa50('0x18f')});db[_0xfa50('0x68')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'onDelete':_0xfa50('0x110'),'as':_0xfa50('0x10f')});db[_0xfa50('0x68')][_0xfa50('0x11e')](db['CmContact'],{'onDelete':_0xfa50('0x110'),'as':'Contact','foreignKey':_0xfa50('0x174')});db['ChatMessage'][_0xfa50('0x11e')](db[_0xfa50('0x67')],{'onDelete':_0xfa50('0x110'),'as':_0xfa50('0x171'),'foreignKey':'ChatInteractionId'});db['ChatMessage']['belongsTo'](db[_0xfa50('0xe7')],{'as':_0xfa50('0xe7'),'foreignKey':_0xfa50('0x17a')});db[_0xfa50('0x68')][_0xfa50('0x11e')](db[_0xfa50('0x63')],{'as':'Account','foreignKey':_0xfa50('0x188')});db[_0xfa50('0x6a')][_0xfa50('0x114')](db[_0xfa50('0xe7')],{'as':_0xfa50('0x191'),'foreignKey':_0xfa50('0x172'),'onDelete':_0xfa50('0x110'),'hooks':!![]});db[_0xfa50('0x6a')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'onDelete':_0xfa50('0x110'),'as':'Contact','foreignKey':'ContactId'});db[_0xfa50('0x6a')]['belongsTo'](db[_0xfa50('0x63')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x188')});db[_0xfa50('0x6c')][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x14e'),'through':'UserChatQueue','hooks':!![]});db[_0xfa50('0x6c')][_0xfa50('0x120')](db['Team'],{'through':_0xfa50('0x192'),'as':_0xfa50('0x14f')});db[_0xfa50('0x6e')][_0xfa50('0x114')](db['ChatInternalMessage'],{'as':_0xfa50('0x154'),'foreignKey':'ChatGroupId','onDelete':'cascade'});db[_0xfa50('0x6e')][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':'Members','through':_0xfa50('0x121')});db[_0xfa50('0x6f')][_0xfa50('0x11e')](db[_0xfa50('0x63')],{'as':_0xfa50('0x18e'),'foreignKey':_0xfa50('0x188')});db[_0xfa50('0x71')]['hasMany'](db[_0xfa50('0x73')],{'as':'Contacts','foreignKey':_0xfa50('0x193')});db[_0xfa50('0x73')][_0xfa50('0x114')](db['CmContactHasItem'],{'as':_0xfa50('0x194'),'foreignKey':_0xfa50('0x195')});db['CmContact']['hasMany'](db[_0xfa50('0x74')],{'as':_0xfa50('0x143'),'foreignKey':'ContactId'});db[_0xfa50('0x73')][_0xfa50('0x114')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'ContactId'});db[_0xfa50('0x73')][_0xfa50('0x114')](db['CmHopperHistory'],{'as':_0xfa50('0x144'),'foreignKey':'ContactId'});db[_0xfa50('0x73')]['hasMany'](db[_0xfa50('0x7b')],{'as':_0xfa50('0x7b'),'foreignKey':_0xfa50('0x174')});db[_0xfa50('0x73')]['hasMany'](db[_0xfa50('0xd4')],{'as':_0xfa50('0x146'),'foreignKey':_0xfa50('0x174')});db['CmContact']['hasMany'](db[_0xfa50('0x5f')],{'as':_0xfa50('0x12a'),'foreignKey':_0xfa50('0x174'),'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x73')][_0xfa50('0x114')](db[_0xfa50('0x67')],{'as':_0xfa50('0x118'),'foreignKey':_0xfa50('0x174'),'onDelete':'restrict'});db[_0xfa50('0x73')]['hasMany'](db['SmsInteraction'],{'as':_0xfa50('0x128'),'foreignKey':_0xfa50('0x174'),'onDelete':_0xfa50('0x15d')});db['CmContact'][_0xfa50('0x114')](db['FaxInteraction'],{'as':_0xfa50('0x119'),'foreignKey':'ContactId','onDelete':_0xfa50('0x15d')});db[_0xfa50('0x73')][_0xfa50('0x114')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0xfa50('0x174'),'onDelete':'restrict'});db[_0xfa50('0x73')][_0xfa50('0x11e')](db['CmCompany'],{'as':_0xfa50('0x196'),'foreignKey':'CompanyId'});db[_0xfa50('0x73')]['belongsTo'](db[_0xfa50('0xf4')],{'as':_0xfa50('0x166'),'foreignKey':_0xfa50('0x167'),'onDelete':'cascade'});db[_0xfa50('0x73')][_0xfa50('0x120')](db['User'],{'as':_0xfa50('0x170'),'through':'cm_user_has_contacts'});db[_0xfa50('0x73')]['belongsToMany'](db[_0xfa50('0x16c')],{'as':_0xfa50('0x16e'),'through':'cm_contact_has_tags'});db[_0xfa50('0x73')]['belongsToMany'](db[_0xfa50('0x16c')],{'through':_0xfa50('0x197'),'as':_0xfa50('0x16f')});db[_0xfa50('0x74')][_0xfa50('0x114')](db[_0xfa50('0x90')],{'as':'AdditionalPhones','foreignKey':_0xfa50('0x198')});db[_0xfa50('0x74')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':'Contact','foreignKey':_0xfa50('0x174'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0x74')]['belongsTo'](db['CmList'],{'as':_0xfa50('0x166'),'foreignKey':_0xfa50('0x167'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0x74')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x199'),'foreignKey':'UserId'});db[_0xfa50('0x74')]['belongsTo'](db[_0xfa50('0x1a')],{'as':_0xfa50('0x18c'),'foreignKey':_0xfa50('0x142'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0x74')][_0xfa50('0x11e')](db['Campaign'],{'as':_0xfa50('0xe4'),'foreignKey':_0xfa50('0x19a'),'onDelete':_0xfa50('0x110')});db['CmHopper']['belongsTo'](db[_0xfa50('0x10f')],{'as':'Owner','foreignKey':_0xfa50('0x19b')});db[_0xfa50('0x76')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':_0xfa50('0x159'),'foreignKey':_0xfa50('0x174'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0x76')][_0xfa50('0x11e')](db['CmList'],{'as':'List','foreignKey':_0xfa50('0x167'),'onDelete':'cascade'});db[_0xfa50('0x76')][_0xfa50('0x11e')](db[_0xfa50('0x1a')],{'as':_0xfa50('0x18c'),'foreignKey':_0xfa50('0x142'),'onDelete':_0xfa50('0x110')});db['CmHopperBlack'][_0xfa50('0x11e')](db['Campaign'],{'as':_0xfa50('0xe4'),'foreignKey':_0xfa50('0x19a'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0x19c')][_0xfa50('0x114')](db[_0xfa50('0x83')],{'as':{'plural':'All','singular':'OneAll'},'foreignKey':_0xfa50('0x19d'),'onDelete':_0xfa50('0x110'),'hooks':!![]});db[_0xfa50('0x19c')][_0xfa50('0x114')](db['Condition'],{'as':{'plural':'Any','singular':_0xfa50('0x19e')},'foreignKey':_0xfa50('0x19f'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0xfa50('0x114')](db[_0xfa50('0x7d')],{'as':'Actions','foreignKey':_0xfa50('0x1a0'),'onDelete':_0xfa50('0x110'),'hooks':!![]});db[_0xfa50('0x81')][_0xfa50('0x114')](db[_0xfa50('0x81')],{'as':'Dispositions','foreignKey':_0xfa50('0x1a1'),'onDelete':_0xfa50('0x110')});db['Interval'][_0xfa50('0x114')](db[_0xfa50('0x85')],{'as':_0xfa50('0x1a2'),'foreignKey':_0xfa50('0x14a'),'onDelete':_0xfa50('0x110'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0xfa50('0x16')],{'as':_0xfa50('0x116'),'foreignKey':'IntervalId','onDelete':'restrict'});db['Interval'][_0xfa50('0x114')](db['MailApplication'],{'as':_0xfa50('0x1a3'),'foreignKey':_0xfa50('0x14a')});db[_0xfa50('0x85')][_0xfa50('0x114')](db[_0xfa50('0x66')],{'as':'ChatApplications','foreignKey':_0xfa50('0x14a')});db[_0xfa50('0x85')][_0xfa50('0x114')](db[_0xfa50('0x4d')],{'as':_0xfa50('0x1a4'),'foreignKey':_0xfa50('0x14a')});db[_0xfa50('0x85')][_0xfa50('0x114')](db['SmsApplication'],{'as':_0xfa50('0x1a5'),'foreignKey':_0xfa50('0x14a')});db[_0xfa50('0x1a6')][_0xfa50('0x11e')](db['MailAccount'],{});db[_0xfa50('0x1a6')]['belongsTo'](db['AnalyticDefaultReport'],{'foreignKey':'DefaultReportId'});db[_0xfa50('0x1a6')][_0xfa50('0x11e')](db['AnalyticCustomReport'],{'foreignKey':_0xfa50('0x1a7')});db[_0xfa50('0x89')][_0xfa50('0x120')](db[_0xfa50('0x18')],{'as':_0xfa50('0x1a8'),'through':_0xfa50('0x13f'),'onDelete':'restrict'});db[_0xfa50('0x16c')][_0xfa50('0x120')](db['CmContact'],{'through':'cm_contact_has_tags'});db['Tag'][_0xfa50('0x120')](db['ChatInteraction'],{'through':_0xfa50('0x190')});db[_0xfa50('0x16c')][_0xfa50('0x120')](db[_0xfa50('0x41')],{'through':_0xfa50('0x16d')});db['Tag']['belongsToMany'](db['SmsInteraction'],{'through':_0xfa50('0x17f')});db[_0xfa50('0x16c')][_0xfa50('0x120')](db[_0xfa50('0x4f')],{'through':_0xfa50('0x179')});db['Tag']['belongsToMany'](db['OpenchannelInteraction'],{'through':_0xfa50('0x186')});db['Tag']['belongsToMany'](db[_0xfa50('0xff')],{'through':_0xfa50('0x1a9')});db['CmContactHasItem'][_0xfa50('0x11e')](db[_0xfa50('0x8c')],{'as':_0xfa50('0x1aa'),'foreignKey':_0xfa50('0x1ab')});db[_0xfa50('0x90')]['belongsTo'](db['CmHopper'],{'as':_0xfa50('0x1ac'),'foreignKey':_0xfa50('0x198')});db[_0xfa50('0x8e')][_0xfa50('0x11e')](db['CmContact'],{'as':_0xfa50('0x159'),'foreignKey':_0xfa50('0x195')});db[_0xfa50('0x93')][_0xfa50('0x114')](db['Condition'],{'as':{'plural':'AllConditions','singular':'AllCondition'},'foreignKey':_0xfa50('0x1ad'),'onDelete':_0xfa50('0x110'),'hooks':!![]});db[_0xfa50('0x93')][_0xfa50('0x114')](db[_0xfa50('0x83')],{'as':{'plural':_0xfa50('0x1ae'),'singular':_0xfa50('0x1af')},'foreignKey':_0xfa50('0x1b0'),'onDelete':_0xfa50('0x110'),'hooks':!![]});db[_0xfa50('0x93')][_0xfa50('0x114')](db[_0xfa50('0x7d')],{'as':_0xfa50('0x1b1'),'foreignKey':_0xfa50('0x1b2'),'onDelete':_0xfa50('0x110'),'hooks':!![]});db[_0xfa50('0x9a')]['hasMany'](db['AnalyticFieldReport'],{'as':_0xfa50('0x1b3'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1a7'),'hooks':!![]});db[_0xfa50('0x1b4')][_0xfa50('0x114')](db['AnalyticFieldReport'],{'as':_0xfa50('0x1b3'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1b5')});db[_0xfa50('0x1b6')][_0xfa50('0x114')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1b7')});db[_0xfa50('0x9f')][_0xfa50('0x11e')](db['AnalyticMetric'],{'foreignKey':_0xfa50('0x1b7')});db[_0xfa50('0xa2')][_0xfa50('0x114')](db[_0xfa50('0x1b8')],{'as':_0xfa50('0x1b9'),'onDelete':_0xfa50('0x110'),'foreignKey':'AccountId'});db[_0xfa50('0x1b8')][_0xfa50('0x114')](db[_0xfa50('0x1ba')],{'as':_0xfa50('0x1bb'),'onDelete':_0xfa50('0x110'),'foreignKey':'SubjectId'});db[_0xfa50('0x1b8')][_0xfa50('0x114')](db[_0xfa50('0x1ba')],{'as':_0xfa50('0x1bc'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xfa50('0x1b8')][_0xfa50('0x114')](db['SalesforceField'],{'as':_0xfa50('0x1b3'),'onDelete':_0xfa50('0x110'),'foreignKey':'FieldId'});db[_0xfa50('0x1b8')]['belongsTo'](db[_0xfa50('0xa2')],{'as':'Account','foreignKey':'AccountId'});db[_0xfa50('0x1ba')][_0xfa50('0x114')](db[_0xfa50('0x1ba')],{'as':_0xfa50('0x1bd'),'foreignKey':_0xfa50('0x1be')});db[_0xfa50('0x1ba')][_0xfa50('0x114')](db[_0xfa50('0x1ba')],{'as':_0xfa50('0x1bf'),'foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0x1ba')][_0xfa50('0x114')](db[_0xfa50('0x1ba')],{'as':'Field','foreignKey':_0xfa50('0x1c1')});db['SalesforceField'][_0xfa50('0x11e')](db[_0xfa50('0x95')],{'as':_0xfa50('0x95'),'foreignKey':'VariableId'});db[_0xfa50('0x1c2')][_0xfa50('0x114')](db['SugarcrmConfiguration'],{'as':'Configurations','onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0x1c4')][_0xfa50('0x114')](db[_0xfa50('0x1c5')],{'as':_0xfa50('0x1bb'),'onDelete':'cascade','foreignKey':_0xfa50('0x1be')});db[_0xfa50('0x1c4')][_0xfa50('0x114')](db[_0xfa50('0x1c5')],{'as':_0xfa50('0x1bc'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0x1c4')][_0xfa50('0x114')](db['SugarcrmField'],{'as':_0xfa50('0x1b3'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c1')});db[_0xfa50('0x1c4')][_0xfa50('0x11e')](db[_0xfa50('0x1c2')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0x1c5')]['hasMany'](db[_0xfa50('0x1c5')],{'as':_0xfa50('0x1bd'),'foreignKey':'SubjectId'});db[_0xfa50('0x1c5')]['hasMany'](db[_0xfa50('0x1c5')],{'as':_0xfa50('0x1bf'),'foreignKey':'DescriptionId'});db['SugarcrmField'][_0xfa50('0x114')](db[_0xfa50('0x1c5')],{'as':_0xfa50('0x1c6'),'foreignKey':_0xfa50('0x1c1')});db[_0xfa50('0x1c5')][_0xfa50('0x11e')](db[_0xfa50('0x95')],{'as':'Variable','foreignKey':_0xfa50('0x1c7')});db[_0xfa50('0x1c8')][_0xfa50('0x114')](db[_0xfa50('0xaa')],{'as':_0xfa50('0x1b9'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0xaa')]['hasMany'](db[_0xfa50('0xac')],{'as':_0xfa50('0x1bb'),'onDelete':'cascade','foreignKey':_0xfa50('0x1be')});db['DeskConfiguration'][_0xfa50('0x114')](db['DeskField'],{'as':_0xfa50('0x1bc'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0xaa')][_0xfa50('0x114')](db['DeskField'],{'as':_0xfa50('0x1b3'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c1')});db[_0xfa50('0xaa')][_0xfa50('0x11e')](db[_0xfa50('0x1c8')],{'as':_0xfa50('0x16a'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':_0xfa50('0x1c9')});db['DeskField']['hasMany'](db['DeskField'],{'as':_0xfa50('0x1bd'),'foreignKey':_0xfa50('0x1be')});db['DeskField'][_0xfa50('0x114')](db[_0xfa50('0xac')],{'as':'Description','foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0xac')]['hasMany'](db[_0xfa50('0xac')],{'as':_0xfa50('0x1c6'),'foreignKey':_0xfa50('0x1c1')});db[_0xfa50('0xac')][_0xfa50('0x11e')](db['Variable'],{'as':_0xfa50('0x95'),'foreignKey':_0xfa50('0x1c7')});db['ZohoAccount'][_0xfa50('0x114')](db[_0xfa50('0xb0')],{'as':_0xfa50('0x1b9'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c3')});db['ZohoConfiguration'][_0xfa50('0x114')](db[_0xfa50('0xb2')],{'as':_0xfa50('0x1bb'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1be')});db[_0xfa50('0xb0')][_0xfa50('0x114')](db[_0xfa50('0xb2')],{'as':_0xfa50('0x1bc'),'onDelete':'cascade','foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0xb0')][_0xfa50('0x114')](db['ZohoField'],{'as':_0xfa50('0x1b3'),'onDelete':'cascade','foreignKey':_0xfa50('0x1c1')});db[_0xfa50('0xb0')][_0xfa50('0x11e')](db[_0xfa50('0xae')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x1c3')});db['ZohoField'][_0xfa50('0x114')](db['ZohoField'],{'as':_0xfa50('0x1bd'),'foreignKey':_0xfa50('0x1be')});db[_0xfa50('0xb2')][_0xfa50('0x114')](db[_0xfa50('0xb2')],{'as':_0xfa50('0x1bf'),'foreignKey':'DescriptionId'});db[_0xfa50('0xb2')]['hasMany'](db[_0xfa50('0xb2')],{'as':_0xfa50('0x1c6'),'foreignKey':'FieldId'});db['ZohoField'][_0xfa50('0x11e')](db[_0xfa50('0x95')],{'as':_0xfa50('0x95'),'foreignKey':'VariableId'});db[_0xfa50('0xb4')][_0xfa50('0x114')](db[_0xfa50('0x1ca')],{'as':_0xfa50('0x1b9'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0x1ca')][_0xfa50('0x114')](db[_0xfa50('0xb6')],{'as':_0xfa50('0x1bb'),'foreignKey':_0xfa50('0x1be')});db['ZendeskConfiguration'][_0xfa50('0x114')](db['ZendeskField'],{'as':_0xfa50('0x1bc'),'foreignKey':_0xfa50('0x1c0')});db['ZendeskConfiguration']['hasMany'](db[_0xfa50('0xb6')],{'as':_0xfa50('0x1b3'),'foreignKey':_0xfa50('0x1c1')});db[_0xfa50('0x1ca')][_0xfa50('0x11e')](db[_0xfa50('0xb4')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0x1ca')][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':'int_zendesk_configuration_has_tags'});db[_0xfa50('0xb6')][_0xfa50('0x114')](db['ZendeskField'],{'as':_0xfa50('0x1bd'),'foreignKey':_0xfa50('0x1be')});db['ZendeskField']['hasMany'](db['ZendeskField'],{'as':'Description','foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0xb6')]['hasMany'](db['ZendeskField'],{'as':_0xfa50('0x1c6'),'foreignKey':_0xfa50('0x1c1')});db[_0xfa50('0xb6')][_0xfa50('0x11e')](db[_0xfa50('0x95')],{'as':_0xfa50('0x95'),'foreignKey':_0xfa50('0x1c7')});db[_0xfa50('0xb7')][_0xfa50('0x114')](db[_0xfa50('0x1cb')],{'as':_0xfa50('0x1b9'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0x1cb')][_0xfa50('0x114')](db[_0xfa50('0xb8')],{'as':_0xfa50('0x1bb'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1be')});db['FreshdeskConfiguration']['hasMany'](db['FreshdeskField'],{'as':'Descriptions','onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c0')});db['FreshdeskConfiguration'][_0xfa50('0x114')](db[_0xfa50('0xb8')],{'as':_0xfa50('0x1b3'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c1')});db['FreshdeskConfiguration'][_0xfa50('0x11e')](db[_0xfa50('0xb7')],{'as':'Account','foreignKey':'AccountId'});db[_0xfa50('0x1cb')][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':_0xfa50('0x1cc')});db[_0xfa50('0xb8')][_0xfa50('0x114')](db[_0xfa50('0xb8')],{'as':_0xfa50('0x1bd'),'foreignKey':_0xfa50('0x1be')});db[_0xfa50('0xb8')][_0xfa50('0x114')](db[_0xfa50('0xb8')],{'as':'Description','foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0xb8')]['hasMany'](db[_0xfa50('0xb8')],{'as':_0xfa50('0x1c6'),'foreignKey':_0xfa50('0x1c1')});db['FreshdeskField'][_0xfa50('0x11e')](db['Variable'],{'as':'Variable','foreignKey':_0xfa50('0x1c7')});db['VtigerAccount']['hasMany'](db[_0xfa50('0xbc')],{'as':_0xfa50('0x1b9'),'onDelete':_0xfa50('0x110'),'foreignKey':'AccountId'});db['VtigerConfiguration'][_0xfa50('0x114')](db[_0xfa50('0x1cd')],{'as':_0xfa50('0x1bb'),'foreignKey':_0xfa50('0x1be')});db[_0xfa50('0xbc')][_0xfa50('0x114')](db[_0xfa50('0x1cd')],{'as':_0xfa50('0x1bc'),'foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0xbc')][_0xfa50('0x114')](db['VtigerField'],{'as':_0xfa50('0x1b3'),'foreignKey':'FieldId'});db['VtigerConfiguration'][_0xfa50('0x11e')](db[_0xfa50('0xba')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0x1cd')][_0xfa50('0x114')](db['VtigerField'],{'as':_0xfa50('0x1bd'),'foreignKey':_0xfa50('0x1be')});db[_0xfa50('0x1cd')][_0xfa50('0x114')](db['VtigerField'],{'as':_0xfa50('0x1bf'),'foreignKey':_0xfa50('0x1c0')});db['VtigerField'][_0xfa50('0x114')](db[_0xfa50('0x1cd')],{'as':_0xfa50('0x1c6'),'foreignKey':_0xfa50('0x1c1')});db['VtigerField']['belongsTo'](db['Variable'],{'as':_0xfa50('0x95'),'foreignKey':_0xfa50('0x1c7')});db[_0xfa50('0xbf')]['hasMany'](db[_0xfa50('0xc1')],{'as':_0xfa50('0x1b9'),'onDelete':'cascade','foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0xc1')][_0xfa50('0x114')](db[_0xfa50('0xc3')],{'as':_0xfa50('0x1bb'),'foreignKey':_0xfa50('0x1be')});db[_0xfa50('0xc1')]['hasMany'](db[_0xfa50('0xc3')],{'as':_0xfa50('0x1bc'),'foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0xc1')][_0xfa50('0x114')](db[_0xfa50('0xc3')],{'as':_0xfa50('0x1b3'),'foreignKey':'FieldId'});db[_0xfa50('0xc1')][_0xfa50('0x11e')](db[_0xfa50('0xbf')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0xc3')][_0xfa50('0x114')](db[_0xfa50('0xc3')],{'as':'Subject','foreignKey':_0xfa50('0x1be')});db['ServicenowField'][_0xfa50('0x114')](db[_0xfa50('0xc3')],{'as':_0xfa50('0x1bf'),'foreignKey':_0xfa50('0x1c0')});db['ServicenowField'][_0xfa50('0x114')](db[_0xfa50('0xc3')],{'as':'Field','foreignKey':_0xfa50('0x1c1')});db['ServicenowField'][_0xfa50('0x11e')](db['Variable'],{'as':_0xfa50('0x95'),'foreignKey':_0xfa50('0x1c7')});db[_0xfa50('0x1ce')]['hasMany'](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':_0xfa50('0x110'),'foreignKey':'AccountId'});db[_0xfa50('0x1ce')][_0xfa50('0x11e')](db[_0xfa50('0x106')],{'as':_0xfa50('0x106'),'foreignKey':_0xfa50('0x15c')});db[_0xfa50('0xc6')][_0xfa50('0x114')](db[_0xfa50('0xc7')],{'as':_0xfa50('0x1bb'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1be')});db[_0xfa50('0xc6')][_0xfa50('0x114')](db['Dynamics365Field'],{'as':_0xfa50('0x1bc'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0xc6')][_0xfa50('0x114')](db[_0xfa50('0xc7')],{'as':_0xfa50('0x1b3'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c1')});db[_0xfa50('0xc6')][_0xfa50('0x11e')](db[_0xfa50('0x1ce')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0xc7')][_0xfa50('0x114')](db[_0xfa50('0xc7')],{'as':_0xfa50('0x1bd'),'foreignKey':_0xfa50('0x1be')});db[_0xfa50('0xc7')]['hasMany'](db[_0xfa50('0xc7')],{'as':_0xfa50('0x1bf'),'foreignKey':_0xfa50('0x1c0')});db['Dynamics365Field'][_0xfa50('0x114')](db[_0xfa50('0xc7')],{'as':_0xfa50('0x1c6'),'foreignKey':_0xfa50('0x1c1')});db[_0xfa50('0xc7')][_0xfa50('0x11e')](db['Variable'],{'as':_0xfa50('0x95'),'foreignKey':_0xfa50('0x1c7')});db[_0xfa50('0xc9')]['hasMany'](db[_0xfa50('0xca')],{'as':_0xfa50('0x1b9'),'onDelete':'cascade','foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0xca')][_0xfa50('0x114')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0xfa50('0x1be')});db[_0xfa50('0xca')][_0xfa50('0x114')](db[_0xfa50('0xcc')],{'as':'Descriptions','foreignKey':_0xfa50('0x1c0')});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0xfa50('0x1b3'),'foreignKey':_0xfa50('0x1c1')});db['FreshsalesConfiguration'][_0xfa50('0x11e')](db[_0xfa50('0xc9')],{'as':'Account','foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0xcc')][_0xfa50('0x114')](db[_0xfa50('0xcc')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xfa50('0xcc')][_0xfa50('0x114')](db['FreshsalesField'],{'as':'Description','foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0xcc')]['hasMany'](db[_0xfa50('0xcc')],{'as':'Field','foreignKey':_0xfa50('0x1c1')});db['FreshsalesField'][_0xfa50('0x11e')](db[_0xfa50('0x95')],{'as':_0xfa50('0x95'),'foreignKey':_0xfa50('0x1c7')});db[_0xfa50('0x1cf')][_0xfa50('0x11e')](db[_0xfa50('0x63')],{});db[_0xfa50('0x1cf')]['belongsTo'](db[_0xfa50('0xf4')],{'as':_0xfa50('0x166'),'foreignKey':_0xfa50('0x167')});db[_0xfa50('0x1cf')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':_0xfa50('0x159'),'foreignKey':_0xfa50('0x174')});db[_0xfa50('0x1cf')][_0xfa50('0x11e')](db[_0xfa50('0x67')],{});db['ChatQueueReport'][_0xfa50('0x11e')](db[_0xfa50('0x68')],{});db[_0xfa50('0x1cf')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{});db[_0xfa50('0x1cf')]['belongsTo'](db[_0xfa50('0x6c')],{});db['ChatInternalMessage'][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'onDelete':'cascade','foreignKey':_0xfa50('0x1d0')});db[_0xfa50('0xd1')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1d1')});db['JscriptySessionReport']['hasMany'](db[_0xfa50('0xd3')],{'foreignKey':_0xfa50('0x1d2'),'onDelete':_0xfa50('0x110')});db['JscriptySessionReport'][_0xfa50('0x114')](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xfa50('0x1d3')][_0xfa50('0x11e')](db[_0xfa50('0x138')],{});db['SmsQueueReport'][_0xfa50('0x11e')](db[_0xfa50('0xf4')],{'as':_0xfa50('0x166'),'foreignKey':_0xfa50('0x167')});db['SmsQueueReport'][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':_0xfa50('0x159'),'foreignKey':'ContactId'});db[_0xfa50('0x1d3')][_0xfa50('0x11e')](db[_0xfa50('0x59')],{});db['SmsQueueReport'][_0xfa50('0x11e')](db[_0xfa50('0x5b')],{});db[_0xfa50('0x1d3')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{});db[_0xfa50('0x1d3')][_0xfa50('0x11e')](db[_0xfa50('0x5d')],{});db[_0xfa50('0x1d4')][_0xfa50('0x114')](db['JscriptySessionReport'],{'foreignKey':_0xfa50('0x1d5')});db[_0xfa50('0x1d4')][_0xfa50('0x114')](db['JscriptyQuestionReport'],{'foreignKey':_0xfa50('0x1d5')});db[_0xfa50('0x1d4')]['hasMany'](db[_0xfa50('0xd2')],{'foreignKey':_0xfa50('0x1d5')});db[_0xfa50('0xe1')]['belongsToMany'](db['User'],{'as':_0xfa50('0x14e'),'through':'user_has_teams'});db[_0xfa50('0xe1')][_0xfa50('0x120')](db[_0xfa50('0x1a')],{'through':_0xfa50('0x107'),'as':_0xfa50('0x12c')});db['Team'][_0xfa50('0x120')](db['MailQueue'],{'through':_0xfa50('0x169'),'as':'MailQueues'});db[_0xfa50('0xe1')][_0xfa50('0x120')](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0xfa50('0x1d6')});db[_0xfa50('0xe1')][_0xfa50('0x120')](db[_0xfa50('0x53')],{'through':_0xfa50('0x17b'),'as':_0xfa50('0x12e')});db[_0xfa50('0xe1')][_0xfa50('0x120')](db[_0xfa50('0x5d')],{'through':_0xfa50('0x1d7'),'as':_0xfa50('0x12f')});db['Team'][_0xfa50('0x120')](db[_0xfa50('0x61')],{'through':'team_has_openchannel_queues','as':_0xfa50('0x131')});db[_0xfa50('0xe1')][_0xfa50('0x120')](db[_0xfa50('0x132')],{'through':_0xfa50('0x1d8'),'as':_0xfa50('0x133')});db[_0xfa50('0xe1')][_0xfa50('0x120')](db['VoicePrefix'],{'through':_0xfa50('0x109'),'as':_0xfa50('0x1d9')});db[_0xfa50('0xe4')][_0xfa50('0x114')](db[_0xfa50('0x74')],{'as':'Hoppers','foreignKey':_0xfa50('0x19a')});db[_0xfa50('0xe4')][_0xfa50('0x114')](db[_0xfa50('0x78')],{'as':'HopperFinals','foreignKey':_0xfa50('0x19a')});db['Campaign']['hasMany'](db[_0xfa50('0x79')],{'as':_0xfa50('0x144'),'foreignKey':_0xfa50('0x19a')});db[_0xfa50('0xe4')]['hasMany'](db[_0xfa50('0x76')],{'as':'HopperBlacks','foreignKey':_0xfa50('0x19a')});db[_0xfa50('0xe4')][_0xfa50('0x11e')](db[_0xfa50('0x147')],{'as':_0xfa50('0x147'),'foreignKey':'TrunkId'});db[_0xfa50('0xe4')][_0xfa50('0x11e')](db[_0xfa50('0x147')],{'as':_0xfa50('0x148'),'foreignKey':_0xfa50('0x149')});db['Campaign'][_0xfa50('0x11e')](db[_0xfa50('0x85')],{'as':_0xfa50('0x85'),'foreignKey':_0xfa50('0x14a')});db[_0xfa50('0xe4')][_0xfa50('0x11e')](db[_0xfa50('0x1da')],{'as':_0xfa50('0x1da'),'foreignKey':'SquareProjectId'});db[_0xfa50('0xe4')][_0xfa50('0x120')](db[_0xfa50('0xf4')],{'as':_0xfa50('0x123'),'through':'campaigns_has_cm_lists'});db[_0xfa50('0xe4')][_0xfa50('0x120')](db[_0xfa50('0xf4')],{'as':'BlackLists','through':'campaigns_has_cm_blacklists'});db[_0xfa50('0xe7')][_0xfa50('0x11e')](db[_0xfa50('0x6a')],{'as':_0xfa50('0x6a'),'foreignKey':_0xfa50('0x172')});db[_0xfa50('0xeb')][_0xfa50('0x11e')](db[_0xfa50('0x163')],{});db[_0xfa50('0xeb')][_0xfa50('0x11e')](db['MailInteraction'],{});db['MailTransferReport'][_0xfa50('0x11e')](db[_0xfa50('0x15e')],{'foreignKey':'FromMailAccountId','as':_0xfa50('0x1db')});db[_0xfa50('0xeb')][_0xfa50('0x11e')](db['User'],{'foreignKey':'FromUserId','as':_0xfa50('0x1dc')});db['MailTransferReport'][_0xfa50('0x11e')](db['User'],{'foreignKey':_0xfa50('0x1dd'),'as':_0xfa50('0x1de')});db[_0xfa50('0xeb')][_0xfa50('0x11e')](db[_0xfa50('0x3d')],{'foreignKey':_0xfa50('0x1df'),'as':'ToQueue'});db['MailTransferReport'][_0xfa50('0x11e')](db['MailAccount'],{'foreignKey':_0xfa50('0x1e0'),'as':_0xfa50('0x1e1')});db[_0xfa50('0xed')]['belongsTo'](db[_0xfa50('0x68')],{});db[_0xfa50('0xed')]['belongsTo'](db[_0xfa50('0x67')],{});db['ChatTransferReport'][_0xfa50('0x11e')](db[_0xfa50('0x63')],{'foreignKey':_0xfa50('0x1e2'),'as':_0xfa50('0x1db')});db[_0xfa50('0xed')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'foreignKey':_0xfa50('0x1e3'),'as':'FromAgent'});db[_0xfa50('0xed')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'foreignKey':'ToUserId','as':_0xfa50('0x1de')});db[_0xfa50('0xed')][_0xfa50('0x11e')](db['ChatQueue'],{'foreignKey':_0xfa50('0x1e4'),'as':_0xfa50('0x1e5')});db[_0xfa50('0xed')][_0xfa50('0x11e')](db[_0xfa50('0x63')],{'foreignKey':_0xfa50('0x1e6'),'as':_0xfa50('0x1e1')});db['FaxTransferReport'][_0xfa50('0x11e')](db['FaxMessage'],{});db[_0xfa50('0xee')][_0xfa50('0x11e')](db[_0xfa50('0x4f')],{});db[_0xfa50('0xee')][_0xfa50('0x11e')](db[_0xfa50('0x4b')],{'foreignKey':'FromFaxAccountId','as':_0xfa50('0x1db')});db[_0xfa50('0xee')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'foreignKey':_0xfa50('0x1e3'),'as':_0xfa50('0x1dc')});db[_0xfa50('0xee')][_0xfa50('0x11e')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db['FaxTransferReport'][_0xfa50('0x11e')](db[_0xfa50('0x53')],{'foreignKey':_0xfa50('0x1e7'),'as':_0xfa50('0x1e5')});db[_0xfa50('0xee')]['belongsTo'](db[_0xfa50('0x4b')],{'foreignKey':_0xfa50('0x1e8'),'as':_0xfa50('0x1e1')});db[_0xfa50('0xf0')]['belongsTo'](db[_0xfa50('0x182')],{});db[_0xfa50('0xf0')][_0xfa50('0x11e')](db[_0xfa50('0x5f')],{});db['OpenchannelTransferReport'][_0xfa50('0x11e')](db[_0xfa50('0x5e')],{'foreignKey':'FromOpenchannelAccountId','as':_0xfa50('0x1db')});db[_0xfa50('0xf0')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xfa50('0xf0')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'foreignKey':'ToUserId','as':_0xfa50('0x1de')});db[_0xfa50('0xf0')]['belongsTo'](db[_0xfa50('0x61')],{'foreignKey':_0xfa50('0x1e9'),'as':_0xfa50('0x1e5')});db[_0xfa50('0xf0')][_0xfa50('0x11e')](db[_0xfa50('0x5e')],{'foreignKey':_0xfa50('0x1ea'),'as':_0xfa50('0x1e1')});db[_0xfa50('0xf2')][_0xfa50('0x11e')](db[_0xfa50('0x5b')],{});db['SmsTransferReport'][_0xfa50('0x11e')](db[_0xfa50('0x59')],{});db[_0xfa50('0xf2')][_0xfa50('0x11e')](db['SmsAccount'],{'foreignKey':_0xfa50('0x1eb'),'as':_0xfa50('0x1db')});db['SmsTransferReport']['belongsTo'](db[_0xfa50('0x10f')],{'foreignKey':_0xfa50('0x1e3'),'as':_0xfa50('0x1dc')});db['SmsTransferReport'][_0xfa50('0x11e')](db['User'],{'foreignKey':_0xfa50('0x1dd'),'as':'ToAgent'});db[_0xfa50('0xf2')][_0xfa50('0x11e')](db[_0xfa50('0x5d')],{'foreignKey':'ToSmsQueueId','as':_0xfa50('0x1e5')});db[_0xfa50('0xf2')]['belongsTo'](db[_0xfa50('0x138')],{'foreignKey':_0xfa50('0x1ec'),'as':'ToAccount'});db[_0xfa50('0xf4')][_0xfa50('0x114')](db[_0xfa50('0x81')],{'as':_0xfa50('0x161'),'foreignKey':_0xfa50('0x167'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0xf4')]['hasMany'](db[_0xfa50('0x7c')],{'as':'CustomFields','foreignKey':_0xfa50('0x167')});db[_0xfa50('0xf4')][_0xfa50('0x114')](db[_0xfa50('0x73')],{'as':_0xfa50('0x122'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x167')});db[_0xfa50('0xf4')][_0xfa50('0x114')](db[_0xfa50('0x78')],{'as':'HopperFinals','foreignKey':_0xfa50('0x167')});db[_0xfa50('0xf4')][_0xfa50('0x114')](db[_0xfa50('0x79')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList']['hasMany'](db[_0xfa50('0x7b')],{'as':_0xfa50('0x7b'),'foreignKey':_0xfa50('0x167')});db[_0xfa50('0xf4')][_0xfa50('0x120')](db['VoiceQueue'],{'as':'Queues','through':'voice_queues_has_cm_lists'});db[_0xfa50('0xf4')]['belongsToMany'](db[_0xfa50('0x10f')],{'as':_0xfa50('0x14e'),'through':'cm_user_has_lists'});db[_0xfa50('0xf5')][_0xfa50('0x114')](db['VoiceExtension'],{'as':_0xfa50('0x116'),'onDelete':_0xfa50('0x110')});db['VoicePrefix']['belongsToMany'](db[_0xfa50('0x10f')],{'as':_0xfa50('0x14e'),'through':_0xfa50('0x10b')});db['VoicePrefix'][_0xfa50('0x120')](db[_0xfa50('0xe1')],{'through':'TeamVoicePrefix','as':_0xfa50('0x14f')});db[_0xfa50('0xf7')][_0xfa50('0x114')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x170'),'foreignKey':'userProfileId'});db[_0xfa50('0xf7')]['hasMany'](db['UserProfileSection'],{'as':'UserProfileSections','foreignKey':_0xfa50('0x11f'),'onDelete':'cascade'});db[_0xfa50('0xf9')][_0xfa50('0x114')](db[_0xfa50('0xfb')],{'as':_0xfa50('0x1ed'),'foreignKey':'sectionId','onDelete':_0xfa50('0x110')});db[_0xfa50('0x1ee')][_0xfa50('0x114')](db[_0xfa50('0x81')],{'as':_0xfa50('0x161'),'foreignKey':_0xfa50('0x1ef'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0x1ee')][_0xfa50('0x114')](db['CannedAnswer'],{'as':_0xfa50('0x162'),'foreignKey':_0xfa50('0x1ef')});db[_0xfa50('0x1ee')]['hasMany'](db[_0xfa50('0x100')],{'as':_0xfa50('0x154'),'foreignKey':_0xfa50('0x1ef')});db[_0xfa50('0x1ee')]['hasMany'](db['WhatsappInteraction'],{'as':_0xfa50('0x164')});db[_0xfa50('0x1ee')][_0xfa50('0x114')](db['WhatsappApplication'],{'as':_0xfa50('0x165')});db[_0xfa50('0x1ee')][_0xfa50('0x11e')](db['CmList'],{'as':_0xfa50('0x166'),'foreignKey':_0xfa50('0x167')});db['WhatsappAccount']['belongsTo'](db[_0xfa50('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0xfa50('0x14c')});db[_0xfa50('0x1ee')]['belongsToMany'](db[_0xfa50('0x10f')],{'as':'Agents','through':'user_has_whatsapp_accounts'});db['WhatsappApplication'][_0xfa50('0x11e')](db['User'],{'onDelete':'restrict'});db['WhatsappApplication'][_0xfa50('0x11e')](db[_0xfa50('0x132')],{'onDelete':_0xfa50('0x15d')});db['WhatsappApplication'][_0xfa50('0x11e')](db['WhatsappAccount'],{'onDelete':_0xfa50('0x15d')});db['WhatsappApplication'][_0xfa50('0x11e')](db['Interval'],{'onDelete':'restrict','foreignKey':_0xfa50('0x14a')});db[_0xfa50('0x1f0')][_0xfa50('0x11e')](db[_0xfa50('0x16c')],{'onDelete':_0xfa50('0x15d'),'foreignKey':_0xfa50('0x173')});db[_0xfa50('0xff')][_0xfa50('0x114')](db[_0xfa50('0x100')],{'as':_0xfa50('0x154'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1f1')});db[_0xfa50('0xff')][_0xfa50('0x11e')](db['WhatsappAccount'],{'as':'Account','foreignKey':_0xfa50('0x1ef')});db[_0xfa50('0xff')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':_0xfa50('0x159'),'foreignKey':'ContactId'});db[_0xfa50('0xff')]['belongsTo'](db[_0xfa50('0x10f')],{'as':_0xfa50('0x16b'),'foreignKey':_0xfa50('0x111')});db['WhatsappInteraction'][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':_0xfa50('0x1a9'),'as':_0xfa50('0x16e')});db[_0xfa50('0xff')]['belongsToMany'](db[_0xfa50('0x16c')],{'through':_0xfa50('0x1a9'),'as':'ThroughTags'});db[_0xfa50('0xff')]['belongsToMany'](db['User'],{'as':_0xfa50('0x170'),'through':_0xfa50('0x1f2'),'foreignKey':_0xfa50('0x1f1')});db['WhatsappMessage'][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'as':'User'});db[_0xfa50('0x100')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'onDelete':_0xfa50('0x110'),'as':_0xfa50('0x159')});db[_0xfa50('0x100')][_0xfa50('0x11e')](db[_0xfa50('0xff')],{'onDelete':_0xfa50('0x110'),'as':'Interaction','foreignKey':'WhatsappInteractionId'});db['WhatsappMessage'][_0xfa50('0x11e')](db['WhatsappAccount'],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x1ef')});db[_0xfa50('0x101')]['belongsTo'](db[_0xfa50('0x1ee')],{});db['WhatsappQueueReport']['belongsTo'](db['CmList'],{'as':_0xfa50('0x166'),'foreignKey':_0xfa50('0x167')});db[_0xfa50('0x101')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':_0xfa50('0x159'),'foreignKey':_0xfa50('0x174')});db[_0xfa50('0x101')]['belongsTo'](db[_0xfa50('0xff')],{});db[_0xfa50('0x101')][_0xfa50('0x11e')](db[_0xfa50('0x132')],{});db[_0xfa50('0x101')]['belongsTo'](db[_0xfa50('0x100')],{});db['WhatsappQueueReport'][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{});db[_0xfa50('0x103')]['belongsTo'](db['WhatsappMessage'],{});db[_0xfa50('0x103')][_0xfa50('0x11e')](db['WhatsappInteraction'],{});db[_0xfa50('0x103')][_0xfa50('0x11e')](db[_0xfa50('0x1ee')],{'foreignKey':_0xfa50('0x1f3'),'as':_0xfa50('0x1db')});db[_0xfa50('0x103')][_0xfa50('0x11e')](db['WhatsappAccount'],{'foreignKey':_0xfa50('0x1f4'),'as':_0xfa50('0x1e1')});db[_0xfa50('0x103')]['belongsTo'](db[_0xfa50('0x132')],{'foreignKey':_0xfa50('0x1f5'),'as':_0xfa50('0x1e5')});db['WhatsappTransferReport'][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'foreignKey':_0xfa50('0x1e3'),'as':_0xfa50('0x1dc')});db['WhatsappTransferReport'][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'foreignKey':_0xfa50('0x1dd'),'as':_0xfa50('0x1de')});db[_0xfa50('0x132')][_0xfa50('0x120')](db['User'],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':_0xfa50('0x1f6')});db['WhatsappQueue'][_0xfa50('0x120')](db[_0xfa50('0xe1')],{'through':_0xfa50('0x1d8'),'as':_0xfa50('0x14f')});db[_0xfa50('0x10d')][_0xfa50('0x11e')](db['User'],{'as':_0xfa50('0x1f7'),'foreignKey':_0xfa50('0x111'),'onDelete':_0xfa50('0x110'),'hooks':!![]});db[_0xfa50('0x106')][_0xfa50('0x112')](db['Dynamics365Account'],{'as':'Dynamics365Account','onDelete':_0xfa50('0x15d')});db[_0xfa50('0x106')]['hasOne'](db[_0xfa50('0x15a')],{'as':_0xfa50('0x15f'),'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x106')][_0xfa50('0x112')](db[_0xfa50('0x3b')],{'as':_0xfa50('0x160'),'onDelete':_0xfa50('0x15d')});module[_0xfa50('0x1f8')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xde5c=['VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailQueue','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueueReport','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','ChatGroup','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmHopper/cmHopper.model','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/disposition/disposition.model','../api/interval/interval.model','Pause','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','../api/user-setting/user-setting.model','hasOne','UserId','UserSetting','userSetting','cascade','Recordings','hasMany','Extensions','CmHopperFinal','HopperFinals','CmHopperHistory','ReportAgentPreview','ChatInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','cm_user_has_contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteraction','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoicePrefixes','ChatQueues','SmsQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','SmsAccount','SmsAccounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','VoiceContext','Sounds','Members','VoiceQueueId','CmHopper','Hoppers','HopperHistories','CmHopperBlack','HopperBlacks','TrunkBackup','TrunkBackupId','Interval','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','ContactId','MailAccountId','MailServerIn','CloudProvider','CloudProviderId','restrict','MailServerOut','Imap','Smtp','Disposition','Dispositions','Answers','MailMessage','Interactions','Applications','List','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Account','Contact','Owner','Tag','mail_interaction_has_tags','ThroughTags','Users','Attachment','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','IntervalId','DashboardItem','Items','FaxAccountId','Exntensions','FaxQueue','TagId','Tags','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsMessage','SmsApplication','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','OpenchannelQueueReport','Agent','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Website','CompanyId','CmContactId','JscriptySessions','OpenchannelInteractions','cm_contact_has_tags','AdditionalPhones','Campaign','CampaignId','OwnerId','Condition','All','OneAll','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','ContactItemType','Hopper','CmHopperId','Trigger','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','SubjectId','Descriptions','FieldId','Description','DescriptionId','VariableId','SugarcrmField','Subjects','Subject','Field','DeskField','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskConfiguration','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskAccount','int_freshdesk_configuration_has_tags','ServicenowConfiguration','Dynamics365Account','Dynamics365Field','FromId','ToId','SessionId','ProjectId','VoiceQueues','TeamVoicePrefix','TrunkId','SquareProjectId','Lists','campaigns_has_cm_lists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatWebsiteId','FromFaxAccountId','ToUserId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Contacts','Queues','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','WhatsappTransferReport','ToWhatsappAccountId','WhatsappQueueId','team_has_whatsapp_queues','user','exports','lodash','jstz','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','sequelize','username','password','options','database','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model'];(function(_0x76f12d,_0x4f8dcb){var _0x559167=function(_0x14b76b){while(--_0x14b76b){_0x76f12d['push'](_0x76f12d['shift']());}};_0x559167(++_0x4f8dcb);}(_0xde5c,0x1e2));var _0xcde5=function(_0x3b3210,_0x25e8ed){_0x3b3210=_0x3b3210-0x0;var _0x5b5484=_0xde5c[_0x3b3210];return _0x5b5484;};'use strict';var config=require('../config/environment');var Sequelize=require('sequelize');var _=require(_0xcde5('0x0'));var jstz=require(_0xcde5('0x1'));var timezone=jstz['determine']();config['sequelize']=_['defaultsDeep'](config['sequelize'],{'database':_0xcde5('0x2'),'username':_0xcde5('0x3'),'password':_0xcde5('0x4'),'options':{'host':_0xcde5('0x5'),'port':0xcea,'dialect':_0xcde5('0x6'),'dialectOptions':{'charset':_0xcde5('0x7')},'logging':![],'timezone':timezone[_0xcde5('0x8')](),'define':{'charset':_0xcde5('0x9'),'collate':_0xcde5('0xa')}}});config[_0xcde5('0xb')]=_['defaultsDeep'](config['sequelizeHistory'],{'database':_0xcde5('0x2'),'username':_0xcde5('0x3'),'password':'xC@LL1234','options':{'host':_0xcde5('0x5'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xcde5('0x7')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xcde5('0x9'),'collate':_0xcde5('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xcde5('0xc')]['database'],config['sequelize'][_0xcde5('0xd')],config['sequelize'][_0xcde5('0xe')],config[_0xcde5('0xc')][_0xcde5('0xf')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xcde5('0x10')],config[_0xcde5('0xb')][_0xcde5('0xd')],config[_0xcde5('0xb')]['password'],config[_0xcde5('0xb')]['options'])};db[_0xcde5('0x11')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x13'));db[_0xcde5('0x14')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x15'));db['VoiceContext']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x16'));db[_0xcde5('0x17')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x18'));db[_0xcde5('0x19')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x1a'));db[_0xcde5('0x1b')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x1c'));db[_0xcde5('0x1d')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x1e'));db[_0xcde5('0x1f')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x20'));db[_0xcde5('0x21')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x22'));db[_0xcde5('0x23')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x24'));db[_0xcde5('0x25')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x26'));db[_0xcde5('0x27')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x28'));db[_0xcde5('0x29')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xcde5('0x2a')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x2b'));db[_0xcde5('0x2c')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x2d'));db[_0xcde5('0x2e')]=db[_0xcde5('0xc')]['import']('../api/trunk/trunk.model');db[_0xcde5('0x2f')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0xcde5('0x30')]=db['sequelize'][_0xcde5('0x12')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0xcde5('0x31')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x32'));db[_0xcde5('0x33')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/userChatQueue/userChatQueue.model');db[_0xcde5('0x34')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x35'));db[_0xcde5('0x36')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x37'));db[_0xcde5('0x38')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0xcde5('0x39')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x3a'));db[_0xcde5('0x3b')]=db[_0xcde5('0xc')]['import']('../api/userWhatsappQueue/userWhatsappQueue.model');db['MailServerIn']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x3c'));db['MailServerOut']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x3d'));db['MailAccount']=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/mailAccount/mailAccount.model');db[_0xcde5('0x3e')]=db[_0xcde5('0xc')]['import']('../api/mailQueue/mailQueue.model');db['MailSubstatus']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x3f'));db[_0xcde5('0x40')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x41'));db['MailMessage']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x42'));db[_0xcde5('0x43')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x44'));db[_0xcde5('0x45')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/mailQueueReport/mailQueueReport.model');db[_0xcde5('0x46')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x47'));db['DashboardItem']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x48'));db[_0xcde5('0x49')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x4a'));db[_0xcde5('0x4b')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x4c'));db['FaxInteraction']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x4d'));db[_0xcde5('0x4e')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x4f'));db['FaxQueue']=db[_0xcde5('0xc')]['import']('../api/faxQueue/faxQueue.model');db[_0xcde5('0x50')]=db['sequelize'][_0xcde5('0x12')]('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x51'));db['SmsApplication']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x52'));db[_0xcde5('0x53')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x54'));db['SmsMessage']=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/smsMessage/smsMessage.model');db[_0xcde5('0x55')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/smsQueue/smsQueue.model');db[_0xcde5('0x56')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x57'));db['OpenchannelApplication']=db[_0xcde5('0xc')]['import'](_0xcde5('0x58'));db['OpenchannelInteraction']=db['sequelize']['import'](_0xcde5('0x59'));db[_0xcde5('0x5a')]=db['sequelize']['import'](_0xcde5('0x5b'));db[_0xcde5('0x5c')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x5d'));db[_0xcde5('0x5e')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x5f'));db['OpenchannelQueueReport']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x60'));db[_0xcde5('0x61')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x62'));db[_0xcde5('0x63')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x64'));db[_0xcde5('0x65')]=db['sequelize']['import'](_0xcde5('0x66'));db[_0xcde5('0x67')]=db[_0xcde5('0xc')]['import']('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xcde5('0x68')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/chatQueue/chatQueue.model');db[_0xcde5('0x69')]=db['sequelize'][_0xcde5('0x12')]('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db[_0xcde5('0xc')]['import']('../api/chatProactiveAction/chatProactiveAction.model');db[_0xcde5('0x6a')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x6b'));db[_0xcde5('0x6c')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/cmContact/cmContact.model');db['CmHopper']=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x6d'));db['CmHopperBlack']=db[_0xcde5('0xc')]['import']('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x6e'));db['CmHopperHistory']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x6f'));db['ReportAgentPreview']=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xcde5('0x70')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x71'));db[_0xcde5('0x72')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x73'));db[_0xcde5('0x74')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x75'));db[_0xcde5('0x76')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x77'));db['Condition']=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/condition/condition.model');db['Interval']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x78'));db[_0xcde5('0x79')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/pause/pause.model');db[_0xcde5('0x7a')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/cdr/cdr.model');db[_0xcde5('0x7b')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x7c'));db[_0xcde5('0x7d')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x7e'));db[_0xcde5('0x7f')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x80'));db['Tag']=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x81'));db['ContactItemType']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x82'));db[_0xcde5('0x83')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x84'));db[_0xcde5('0x85')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x86'));db[_0xcde5('0x87')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x88'));db['Trigger']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x89'));db[_0xcde5('0x8a')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/variable/variable.model');db[_0xcde5('0x8b')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x8c'));db[_0xcde5('0x8d')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x8e'));db[_0xcde5('0x8f')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xcde5('0x90')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x91'));db[_0xcde5('0x92')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x93'));db[_0xcde5('0x94')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/analyticMetric/analyticMetric.model');db[_0xcde5('0x95')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0xcde5('0xc')]['import'](_0xcde5('0x96'));db[_0xcde5('0x97')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x98'));db[_0xcde5('0x99')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x9a'));db[_0xcde5('0x9b')]=db[_0xcde5('0xc')]['import'](_0xcde5('0x9c'));db[_0xcde5('0x9d')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x9e'));db[_0xcde5('0x9f')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xa0'));db['SugarcrmField']=db['sequelize']['import'](_0xcde5('0xa1'));db[_0xcde5('0xa2')]=db[_0xcde5('0xc')]['import'](_0xcde5('0xa3'));db[_0xcde5('0xa4')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xa5'));db['DeskField']=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xa6'));db[_0xcde5('0xa7')]=db['sequelize']['import'](_0xcde5('0xa8'));db['ZohoConfiguration']=db[_0xcde5('0xc')]['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xcde5('0xa9')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xaa'));db[_0xcde5('0xab')]=db[_0xcde5('0xc')]['import']('../api/intZendeskAccount/intZendeskAccount.model');db['ZendeskConfiguration']=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xac'));db['ZendeskField']=db[_0xcde5('0xc')]['import'](_0xcde5('0xad'));db['FreshdeskAccount']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xae'));db[_0xcde5('0xaf')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xb0'));db[_0xcde5('0xb1')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xb2'));db[_0xcde5('0xb3')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xb4'));db[_0xcde5('0xb5')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xb6'));db[_0xcde5('0xb7')]=db[_0xcde5('0xc')]['import'](_0xcde5('0xb8'));db[_0xcde5('0xb9')]=db[_0xcde5('0xc')]['import'](_0xcde5('0xba'));db['ServicenowConfiguration']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xbb'));db[_0xcde5('0xbc')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xbd'));db['Dynamics365Account']=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0xcde5('0xbe')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xbf'));db['Dynamics365Field']=db['sequelize']['import'](_0xcde5('0xc0'));db[_0xcde5('0xc1')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xc2'));db[_0xcde5('0xc3')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xc4'));db[_0xcde5('0xc5')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xc6'));db[_0xcde5('0x8b')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x8c'));db['Network']=db[_0xcde5('0xc')]['import'](_0xcde5('0xc7'));db[_0xcde5('0xc8')]=db[_0xcde5('0xc')]['import'](_0xcde5('0xc9'));db[_0xcde5('0xca')]=db[_0xcde5('0xc')]['import'](_0xcde5('0xcb'));db[_0xcde5('0xcc')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xcd'));db[_0xcde5('0xce')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xcde5('0xcf')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xd0'));db[_0xcde5('0xd1')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xd2'));db[_0xcde5('0xd3')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/squareReport/squareReport.model');db[_0xcde5('0xd4')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xd5'));db[_0xcde5('0xd6')]=db[_0xcde5('0xc')]['import'](_0xcde5('0xd7'));db[_0xcde5('0xd8')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/setting/setting.model');db[_0xcde5('0xd9')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/squareOdbc/squareOdbc.model');db[_0xcde5('0xda')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xdb'));db[_0xcde5('0xdc')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xdd'));db[_0xcde5('0xde')]=db[_0xcde5('0xc')]['import'](_0xcde5('0xdf'));db[_0xcde5('0xe0')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xe1'));db[_0xcde5('0xe2')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xe3'));db['Campaign']=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/campaign/campaign.model');db[_0xcde5('0xe4')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xe5'));db['Attachment']=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xe6'));db['Plugin']=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/plugin/plugin.model');db[_0xcde5('0xe7')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xe8'));db[_0xcde5('0xe9')]=db['sequelize'][_0xcde5('0x12')]('../api/chatTransferReport/chatTransferReport.model');db[_0xcde5('0xea')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xeb'));db[_0xcde5('0xec')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xed'));db[_0xcde5('0xee')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xef'));db[_0xcde5('0xf0')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xf1'));db[_0xcde5('0xf2')]=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/voicePrefix/voicePrefix.model');db[_0xcde5('0xf3')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xf4'));db[_0xcde5('0xf5')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xf6'));db['UserProfileResource']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xf7'));db[_0xcde5('0xf8')]=db['sequelize'][_0xcde5('0x12')]('../api/userNotification/userNotification.model');db[_0xcde5('0xf9')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0xfa'));db['WhatsappApplication']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xfb'));db[_0xcde5('0xfc')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xfd'));db[_0xcde5('0xfe')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0xff'));db[_0xcde5('0x100')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x101'));db['WhatsappTransferReport']=db['sequelize'][_0xcde5('0x12')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xcde5('0x102')]=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x103'));db['CloudProvider']=db[_0xcde5('0xc')][_0xcde5('0x12')]('../api/cloudProvider/cloudProvider.model');db['TeamVoiceQueue']=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x104'));db['TeamVoicePrefix']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x105'));db[_0xcde5('0x106')]=db['sequelize'][_0xcde5('0x12')](_0xcde5('0x107'));db['UserSetting']=db[_0xcde5('0xc')][_0xcde5('0x12')](_0xcde5('0x108'));db['User'][_0xcde5('0x109')](db['VoiceMail'],{'as':'VoiceMail','onDelete':'cascade','foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x11')][_0xcde5('0x109')](db[_0xcde5('0x10b')],{'as':_0xcde5('0x10c'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x10a')});db['User']['hasMany'](db[_0xcde5('0x1d')],{'as':_0xcde5('0x10e'),'foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x11')][_0xcde5('0x10f')](db[_0xcde5('0x30')],{'as':'VoiceQueuesRt','foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x11')][_0xcde5('0x10f')](db[_0xcde5('0x17')],{'as':_0xcde5('0x110'),'onDelete':_0xcde5('0x10d'),'hooks':!![]});db[_0xcde5('0x11')][_0xcde5('0x10f')](db[_0xcde5('0x111')],{'as':_0xcde5('0x112'),'foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x11')]['hasMany'](db[_0xcde5('0x113')],{'as':'HopperHistory','foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x11')][_0xcde5('0x10f')](db['ReportAgentPreview'],{'as':_0xcde5('0x114'),'foreignKey':_0xcde5('0x10a')});db['User'][_0xcde5('0x10f')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x11')][_0xcde5('0x10f')](db[_0xcde5('0x63')],{'as':_0xcde5('0x115'),'foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x11')][_0xcde5('0x10f')](db[_0xcde5('0x53')],{'as':_0xcde5('0x116'),'foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x11')]['hasMany'](db[_0xcde5('0x117')],{'as':_0xcde5('0x118'),'foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x11')][_0xcde5('0x10f')](db[_0xcde5('0x40')],{'as':_0xcde5('0x119'),'foreignKey':_0xcde5('0x10a')});db['User'][_0xcde5('0x10f')](db[_0xcde5('0xfc')],{'as':'WhatsappInteractions','foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x11')][_0xcde5('0x10f')](db['UserNotification'],{'as':_0xcde5('0x11a'),'foreignKey':_0xcde5('0x11b')});db[_0xcde5('0x11')][_0xcde5('0x11c')](db[_0xcde5('0xf3')],{'as':_0xcde5('0xf3'),'foreignKey':_0xcde5('0x11d')});db['User'][_0xcde5('0x11e')](db[_0xcde5('0x69')],{'as':_0xcde5('0x11f'),'through':_0xcde5('0x120')});db['User']['belongsToMany'](db['CmContact'],{'as':'Contacts','through':_0xcde5('0x121')});db['User']['belongsToMany'](db[_0xcde5('0xf0')],{'as':'Lists','through':_0xcde5('0x122')});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0xe0')],{'through':_0xcde5('0x123')});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0x40')],{'as':_0xcde5('0x119'),'through':_0xcde5('0x124')});db[_0xcde5('0x11')]['belongsToMany'](db[_0xcde5('0x63')],{'as':'ChatInteractions','through':_0xcde5('0x125')});db[_0xcde5('0x11')]['belongsToMany'](db[_0xcde5('0x117')],{'as':'FaxInteractions','through':_0xcde5('0x126')});db['User'][_0xcde5('0x11e')](db['SmsInteraction'],{'as':_0xcde5('0x116'),'through':_0xcde5('0x127')});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0x128')],{'as':'OpenchannelInteractions','through':_0xcde5('0x129')});db[_0xcde5('0x11')][_0xcde5('0x11e')](db['WhatsappInteraction'],{'as':_0xcde5('0x12a'),'through':_0xcde5('0x12b')});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0x1b')],{'as':'VoiceQueues','through':_0xcde5('0x31'),'required':![]});db[_0xcde5('0x11')]['belongsToMany'](db[_0xcde5('0xf2')],{'as':_0xcde5('0x12c'),'through':_0xcde5('0x106'),'required':![]});db['User'][_0xcde5('0x11e')](db[_0xcde5('0x3e')],{'as':'MailQueues','through':'UserMailQueue','required':![]});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0x68')],{'as':_0xcde5('0x12d'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0xcde5('0x11')][_0xcde5('0x11e')](db['FaxQueue'],{'as':'FaxQueues','through':_0xcde5('0x36'),'required':![]});db['User'][_0xcde5('0x11e')](db[_0xcde5('0x55')],{'as':_0xcde5('0x12e'),'through':_0xcde5('0x38'),'required':![]});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0x5c')],{'as':'OpenchannelQueues','through':'UserOpenchannelQueue','required':![]});db['User']['belongsToMany'](db['WhatsappQueue'],{'as':_0xcde5('0x12f'),'through':_0xcde5('0x3b'),'required':![]});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0xf0')],{'through':_0xcde5('0x122')});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0x5e')],{'as':_0xcde5('0x130'),'through':_0xcde5('0x131')});db[_0xcde5('0x11')][_0xcde5('0x11e')](db['FaxAccount'],{'as':_0xcde5('0x132'),'through':_0xcde5('0x133')});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0x134')],{'as':_0xcde5('0x135'),'through':_0xcde5('0x136')});db[_0xcde5('0x11')][_0xcde5('0x11e')](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':'user_has_openchannel_accounts'});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0x137')],{'as':_0xcde5('0x138'),'through':'user_has_sms_accounts'});db[_0xcde5('0x11')][_0xcde5('0x11e')](db[_0xcde5('0xf9')],{'as':_0xcde5('0x139'),'through':_0xcde5('0x13a')});db[_0xcde5('0x14')][_0xcde5('0x10f')](db[_0xcde5('0x17')],{'as':_0xcde5('0x13b'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x13c')});db[_0xcde5('0x13d')][_0xcde5('0x10f')](db['VoiceExtension'],{'onDelete':'cascade'});db[_0xcde5('0x17')][_0xcde5('0x10f')](db[_0xcde5('0x17')],{'as':'Applications','onDelete':_0xcde5('0x10d')});db[_0xcde5('0x19')][_0xcde5('0x11e')](db[_0xcde5('0x7f')],{'as':_0xcde5('0x13e'),'through':'moh_has_sounds'});db['VoiceQueue']['hasMany'](db['UserVoiceQueueRt'],{'as':_0xcde5('0x13f'),'foreignKey':_0xcde5('0x140')});db[_0xcde5('0x1b')][_0xcde5('0x10f')](db[_0xcde5('0x141')],{'as':_0xcde5('0x142'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xcde5('0x10f')](db[_0xcde5('0x111')],{'as':_0xcde5('0x112'),'foreignKey':_0xcde5('0x140')});db['VoiceQueue'][_0xcde5('0x10f')](db['CmHopperHistory'],{'as':_0xcde5('0x143'),'foreignKey':_0xcde5('0x140')});db[_0xcde5('0x1b')][_0xcde5('0x10f')](db[_0xcde5('0x114')],{'as':_0xcde5('0x114'),'foreignKey':'VoiceQueueId'});db[_0xcde5('0x1b')][_0xcde5('0x10f')](db[_0xcde5('0x144')],{'as':_0xcde5('0x145'),'foreignKey':'VoiceQueueId'});db[_0xcde5('0x1b')][_0xcde5('0x10f')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':'VoiceQueueId'});db[_0xcde5('0x1b')]['belongsTo'](db['Trunk'],{'as':'Trunk','foreignKey':'TrunkId'});db['VoiceQueue'][_0xcde5('0x11c')](db[_0xcde5('0x2e')],{'as':_0xcde5('0x146'),'foreignKey':_0xcde5('0x147')});db[_0xcde5('0x1b')][_0xcde5('0x11c')](db[_0xcde5('0x148')],{'as':_0xcde5('0x148'),'foreignKey':'IntervalId'});db[_0xcde5('0x1b')][_0xcde5('0x11c')](db[_0xcde5('0x79')],{'as':_0xcde5('0x149'),'foreignKey':_0xcde5('0x14a')});db[_0xcde5('0x1b')][_0xcde5('0x11e')](db['CmList'],{'as':'Lists','through':_0xcde5('0x14b')});db['VoiceQueue'][_0xcde5('0x11e')](db[_0xcde5('0x11')],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x31')});db[_0xcde5('0x1b')][_0xcde5('0x11e')](db[_0xcde5('0xe0')],{'as':_0xcde5('0x14d'),'through':_0xcde5('0x14e')});db['VoiceQueue'][_0xcde5('0x11e')](db['CmList'],{'as':_0xcde5('0x14f'),'through':_0xcde5('0x150')});db[_0xcde5('0x1d')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x11'),'foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x1f')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':'User','foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x21')][_0xcde5('0x10f')](db[_0xcde5('0x23')],{'as':_0xcde5('0x151'),'onDelete':'cascade','foreignKey':_0xcde5('0x152'),'sourceKey':_0xcde5('0x153')});db['VoiceMailMessage'][_0xcde5('0x11c')](db['VoiceMail'],{'foreignKey':_0xcde5('0x152'),'targetKey':'mailbox'});db['VoiceCallReport'][_0xcde5('0x10f')](db[_0xcde5('0x2a')],{'as':_0xcde5('0x154'),'foreignKey':_0xcde5('0x155'),'constraints':![]});db['VoiceCallReport'][_0xcde5('0x10f')](db[_0xcde5('0x29')],{'as':_0xcde5('0x156'),'foreignKey':_0xcde5('0x155'),'constraints':![]});db['VoiceCallReport'][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x11'),'foreignKey':'UserId'});db['VoiceCallReport'][_0xcde5('0x11c')](db['CmContact'],{'as':'Contact','foreignKey':_0xcde5('0x157')});db['MailServerIn'][_0xcde5('0x11c')](db[_0xcde5('0x134')],{'as':_0xcde5('0x134'),'foreignKey':_0xcde5('0x158')});db[_0xcde5('0x159')][_0xcde5('0x11c')](db[_0xcde5('0x15a')],{'as':_0xcde5('0x15a'),'foreignKey':_0xcde5('0x15b'),'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x15d')]['belongsTo'](db[_0xcde5('0x134')],{'as':'MailAccount','foreignKey':_0xcde5('0x158')});db['MailServerOut'][_0xcde5('0x11c')](db[_0xcde5('0x15a')],{'as':_0xcde5('0x15a'),'foreignKey':'CloudProviderId','onDelete':_0xcde5('0x15c')});db[_0xcde5('0x134')][_0xcde5('0x109')](db[_0xcde5('0x159')],{'as':_0xcde5('0x15e'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0x134')][_0xcde5('0x109')](db[_0xcde5('0x15d')],{'as':_0xcde5('0x15f'),'onDelete':_0xcde5('0x10d')});db['MailAccount'][_0xcde5('0x10f')](db[_0xcde5('0x160')],{'as':_0xcde5('0x161'),'foreignKey':_0xcde5('0x158'),'onDelete':'cascade'});db['MailAccount'][_0xcde5('0x10f')](db[_0xcde5('0x76')],{'as':_0xcde5('0x162'),'foreignKey':_0xcde5('0x158')});db[_0xcde5('0x134')][_0xcde5('0x10f')](db[_0xcde5('0x163')],{'as':'Messages','foreignKey':_0xcde5('0x158')});db[_0xcde5('0x134')][_0xcde5('0x10f')](db[_0xcde5('0x40')],{'as':_0xcde5('0x164')});db[_0xcde5('0x134')]['hasMany'](db['MailApplication'],{'as':_0xcde5('0x165')});db[_0xcde5('0x134')][_0xcde5('0x11c')](db[_0xcde5('0xf0')],{'as':_0xcde5('0x166'),'foreignKey':_0xcde5('0x167')});db[_0xcde5('0x134')][_0xcde5('0x11c')](db[_0xcde5('0x87')],{'as':_0xcde5('0x87'),'foreignKey':_0xcde5('0x168')});db[_0xcde5('0x134')][_0xcde5('0x11c')](db['Pause'],{'as':_0xcde5('0x149'),'foreignKey':_0xcde5('0x14a')});db[_0xcde5('0x134')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xcde5('0x136')});db[_0xcde5('0x3e')]['belongsToMany'](db[_0xcde5('0x11')],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x34')});db[_0xcde5('0x3e')]['belongsToMany'](db[_0xcde5('0xe0')],{'through':_0xcde5('0x169'),'as':_0xcde5('0x14d')});db['MailInteraction'][_0xcde5('0x10f')](db[_0xcde5('0x163')],{'as':_0xcde5('0x151'),'onDelete':'cascade','foreignKey':_0xcde5('0x16a')});db[_0xcde5('0x40')]['belongsTo'](db['MailAccount'],{'as':_0xcde5('0x16b'),'foreignKey':'MailAccountId'});db[_0xcde5('0x40')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157')});db[_0xcde5('0x40')]['belongsTo'](db[_0xcde5('0x11')],{'as':_0xcde5('0x16d'),'foreignKey':_0xcde5('0x10a')});db['MailInteraction'][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':_0xcde5('0x16f'),'as':'Tags'});db['MailInteraction'][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':_0xcde5('0x16f'),'as':_0xcde5('0x170')});db[_0xcde5('0x40')][_0xcde5('0x11e')](db[_0xcde5('0x11')],{'as':_0xcde5('0x171'),'through':_0xcde5('0x124'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0xcde5('0x10f')](db[_0xcde5('0x172')],{'as':_0xcde5('0x173'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0x163')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x11')});db[_0xcde5('0x163')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'onDelete':_0xcde5('0x10d'),'as':'Contact'});db[_0xcde5('0x163')][_0xcde5('0x11c')](db[_0xcde5('0x40')],{'as':_0xcde5('0x174'),'foreignKey':_0xcde5('0x16a')});db[_0xcde5('0x163')][_0xcde5('0x11c')](db[_0xcde5('0x134')],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x158')});db[_0xcde5('0x163')][_0xcde5('0x11c')](db[_0xcde5('0x5e')],{'as':_0xcde5('0x5e'),'foreignKey':_0xcde5('0x175')});db[_0xcde5('0x163')][_0xcde5('0x11c')](db[_0xcde5('0x67')],{'as':_0xcde5('0x67'),'foreignKey':_0xcde5('0x176')});db[_0xcde5('0x43')][_0xcde5('0x11c')](db['User'],{'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x43')]['belongsTo'](db[_0xcde5('0x3e')],{'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x43')]['belongsTo'](db['MailAccount'],{'onDelete':_0xcde5('0x15c')});db['MailApplication'][_0xcde5('0x11c')](db[_0xcde5('0x148')],{'onDelete':_0xcde5('0x15c'),'foreignKey':_0xcde5('0x177')});db[_0xcde5('0x43')][_0xcde5('0x11c')](db[_0xcde5('0x16e')],{'onDelete':_0xcde5('0x15c'),'foreignKey':'TagId'});db['MailQueueReport'][_0xcde5('0x11c')](db[_0xcde5('0x134')],{});db[_0xcde5('0x45')][_0xcde5('0x11c')](db['CmList'],{'as':_0xcde5('0x166'),'foreignKey':'ListId'});db[_0xcde5('0x45')][_0xcde5('0x11c')](db['CmContact'],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157')});db[_0xcde5('0x45')][_0xcde5('0x11c')](db[_0xcde5('0x40')],{});db['MailQueueReport']['belongsTo'](db[_0xcde5('0x163')],{});db[_0xcde5('0x45')][_0xcde5('0x11c')](db['User'],{});db['MailQueueReport'][_0xcde5('0x11c')](db[_0xcde5('0x3e')],{});db[_0xcde5('0x46')][_0xcde5('0x10f')](db[_0xcde5('0x178')],{'as':_0xcde5('0x179'),'onDelete':'cascade'});db[_0xcde5('0x49')][_0xcde5('0x10f')](db[_0xcde5('0x160')],{'as':_0xcde5('0x161'),'foreignKey':'FaxAccountId','onDelete':'cascade'});db[_0xcde5('0x49')][_0xcde5('0x10f')](db[_0xcde5('0x76')],{'as':_0xcde5('0x162'),'foreignKey':_0xcde5('0x17a')});db[_0xcde5('0x49')][_0xcde5('0x10f')](db[_0xcde5('0x117')],{'as':_0xcde5('0x164')});db['FaxAccount'][_0xcde5('0x10f')](db['FaxApplication'],{'as':_0xcde5('0x165')});db['FaxAccount'][_0xcde5('0x10f')](db[_0xcde5('0x17')],{'as':_0xcde5('0x17b'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0x49')]['hasMany'](db[_0xcde5('0x4e')],{'as':'Messages'});db[_0xcde5('0x49')][_0xcde5('0x11c')](db[_0xcde5('0x2e')],{'as':_0xcde5('0x2e')});db[_0xcde5('0x49')][_0xcde5('0x11c')](db[_0xcde5('0xf0')],{'as':_0xcde5('0x166'),'foreignKey':'ListId'});db[_0xcde5('0x49')][_0xcde5('0x11c')](db[_0xcde5('0x79')],{'as':_0xcde5('0x149'),'foreignKey':_0xcde5('0x14a')});db[_0xcde5('0x49')]['belongsToMany'](db[_0xcde5('0x11')],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x133')});db[_0xcde5('0x4b')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'onDelete':'restrict'});db['FaxApplication']['belongsTo'](db[_0xcde5('0x17c')],{'onDelete':_0xcde5('0x15c')});db['FaxApplication'][_0xcde5('0x11c')](db[_0xcde5('0x49')],{'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x4b')][_0xcde5('0x11c')](db[_0xcde5('0x16e')],{'onDelete':_0xcde5('0x15c'),'foreignKey':_0xcde5('0x17d')});db[_0xcde5('0x117')][_0xcde5('0x10f')](db[_0xcde5('0x4e')],{'as':_0xcde5('0x151'),'onDelete':_0xcde5('0x10d'),'foreignKey':'FaxInteractionId'});db[_0xcde5('0x117')][_0xcde5('0x11c')](db[_0xcde5('0x49')],{'as':_0xcde5('0x16b'),'foreignKey':'FaxAccountId'});db[_0xcde5('0x117')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':'ContactId'});db[_0xcde5('0x117')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x16d'),'foreignKey':'UserId'});db[_0xcde5('0x117')]['belongsToMany'](db[_0xcde5('0x16e')],{'through':'fax_interaction_has_tags','as':_0xcde5('0x17e')});db[_0xcde5('0x117')][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':_0xcde5('0x17f'),'as':_0xcde5('0x170')});db[_0xcde5('0x117')][_0xcde5('0x11e')](db[_0xcde5('0x11')],{'as':_0xcde5('0x171'),'through':_0xcde5('0x126'),'foreignKey':'FaxInteractionId'});db[_0xcde5('0x4e')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'onDelete':_0xcde5('0x10d'),'as':_0xcde5('0x11')});db[_0xcde5('0x4e')][_0xcde5('0x11c')](db[_0xcde5('0x117')],{'as':_0xcde5('0x174'),'foreignKey':'FaxInteractionId'});db[_0xcde5('0x4e')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'onDelete':_0xcde5('0x10d'),'as':'Contact'});db['FaxMessage']['belongsTo'](db[_0xcde5('0x172')],{'as':_0xcde5('0x172'),'foreignKey':_0xcde5('0x180')});db[_0xcde5('0x4e')][_0xcde5('0x11c')](db['FaxAccount'],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x17a')});db['FaxQueue'][_0xcde5('0x11e')](db[_0xcde5('0x11')],{'as':'Agents','through':'UserFaxQueue'});db[_0xcde5('0x17c')]['belongsToMany'](db[_0xcde5('0xe0')],{'through':_0xcde5('0x181'),'as':_0xcde5('0x14d')});db['FaxQueueReport'][_0xcde5('0x11c')](db[_0xcde5('0x49')],{});db['FaxQueueReport'][_0xcde5('0x11c')](db[_0xcde5('0xf0')],{'as':'List','foreignKey':_0xcde5('0x167')});db[_0xcde5('0x50')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157')});db['FaxQueueReport'][_0xcde5('0x11c')](db[_0xcde5('0x117')],{});db[_0xcde5('0x50')][_0xcde5('0x11c')](db[_0xcde5('0x4e')],{});db[_0xcde5('0x50')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{});db['FaxQueueReport']['belongsTo'](db[_0xcde5('0x17c')],{});db['SmsAccount'][_0xcde5('0x10f')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xcde5('0x182'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0x137')][_0xcde5('0x10f')](db['CannedAnswer'],{'as':_0xcde5('0x162'),'foreignKey':'SmsAccountId'});db[_0xcde5('0x137')][_0xcde5('0x10f')](db[_0xcde5('0x183')],{'as':_0xcde5('0x151'),'foreignKey':_0xcde5('0x182')});db[_0xcde5('0x137')][_0xcde5('0x10f')](db[_0xcde5('0x53')],{'as':_0xcde5('0x164')});db[_0xcde5('0x137')]['hasMany'](db[_0xcde5('0x184')],{'as':_0xcde5('0x165')});db[_0xcde5('0x137')][_0xcde5('0x11c')](db[_0xcde5('0xf0')],{'as':_0xcde5('0x166'),'foreignKey':_0xcde5('0x167')});db[_0xcde5('0x137')][_0xcde5('0x11c')](db['Pause'],{'as':_0xcde5('0x149'),'foreignKey':_0xcde5('0x14a')});db[_0xcde5('0x137')][_0xcde5('0x11e')](db['User'],{'as':_0xcde5('0x14c'),'through':'user_has_sms_accounts'});db[_0xcde5('0x184')][_0xcde5('0x11c')](db['User'],{'onDelete':'restrict'});db[_0xcde5('0x184')][_0xcde5('0x11c')](db[_0xcde5('0x55')],{'onDelete':'restrict'});db['SmsApplication'][_0xcde5('0x11c')](db[_0xcde5('0x137')],{'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x184')][_0xcde5('0x11c')](db[_0xcde5('0x148')],{'onDelete':_0xcde5('0x15c'),'foreignKey':_0xcde5('0x177')});db['SmsApplication'][_0xcde5('0x11c')](db[_0xcde5('0x16e')],{'onDelete':_0xcde5('0x15c'),'foreignKey':'TagId'});db[_0xcde5('0x53')][_0xcde5('0x10f')](db[_0xcde5('0x183')],{'as':_0xcde5('0x151'),'onDelete':_0xcde5('0x10d'),'foreignKey':'SmsInteractionId'});db[_0xcde5('0x53')]['belongsTo'](db['SmsAccount'],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x182')});db['SmsInteraction']['belongsTo'](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157')});db['SmsInteraction'][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x16d'),'foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x53')]['belongsToMany'](db[_0xcde5('0x16e')],{'through':_0xcde5('0x185'),'as':_0xcde5('0x17e')});db['SmsInteraction'][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':_0xcde5('0x185'),'as':'ThroughTags'});db['SmsInteraction']['belongsToMany'](db[_0xcde5('0x11')],{'as':'Users','through':_0xcde5('0x127'),'foreignKey':'SmsInteractionId'});db[_0xcde5('0x183')]['belongsTo'](db[_0xcde5('0x11')],{'as':_0xcde5('0x11')});db[_0xcde5('0x183')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'onDelete':_0xcde5('0x10d'),'as':'Contact'});db[_0xcde5('0x183')][_0xcde5('0x11c')](db['SmsInteraction'],{'onDelete':_0xcde5('0x10d'),'as':_0xcde5('0x174'),'foreignKey':'SmsInteractionId'});db[_0xcde5('0x183')]['belongsTo'](db[_0xcde5('0x137')],{'as':'Account','foreignKey':_0xcde5('0x182')});db[_0xcde5('0x55')]['belongsToMany'](db[_0xcde5('0x11')],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x38'),'foreignKey':_0xcde5('0x186')});db[_0xcde5('0x55')][_0xcde5('0x11e')](db[_0xcde5('0xe0')],{'through':_0xcde5('0x187'),'as':_0xcde5('0x14d')});db[_0xcde5('0x56')][_0xcde5('0x10f')](db[_0xcde5('0x160')],{'as':'Dispositions','foreignKey':_0xcde5('0x188'),'onDelete':'cascade'});db[_0xcde5('0x56')][_0xcde5('0x10f')](db[_0xcde5('0x76')],{'as':_0xcde5('0x162'),'foreignKey':_0xcde5('0x188')});db[_0xcde5('0x56')][_0xcde5('0x10f')](db[_0xcde5('0x128')],{'as':_0xcde5('0x164'),'foreignKey':_0xcde5('0x188')});db[_0xcde5('0x56')]['hasMany'](db[_0xcde5('0x5a')],{'as':'Messages','foreignKey':_0xcde5('0x188')});db[_0xcde5('0x56')]['hasMany'](db[_0xcde5('0x189')],{'as':_0xcde5('0x165'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xcde5('0x11c')](db[_0xcde5('0xf0')],{'as':'List','foreignKey':_0xcde5('0x167')});db[_0xcde5('0x56')][_0xcde5('0x11c')](db[_0xcde5('0x79')],{'as':'mandatoryDispositionPause','foreignKey':_0xcde5('0x14a')});db[_0xcde5('0x56')][_0xcde5('0x11e')](db['User'],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x18a')});db['OpenchannelApplication']['belongsTo'](db['User'],{'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x189')][_0xcde5('0x11c')](db[_0xcde5('0x5c')],{'onDelete':'restrict','foreignKey':_0xcde5('0x18b')});db[_0xcde5('0x189')][_0xcde5('0x11c')](db[_0xcde5('0x56')],{'onDelete':_0xcde5('0x15c'),'foreignKey':'OpenchannelAccountId'});db[_0xcde5('0x189')][_0xcde5('0x11c')](db[_0xcde5('0x148')],{'onDelete':_0xcde5('0x15c'),'foreignKey':_0xcde5('0x177')});db[_0xcde5('0x189')][_0xcde5('0x11c')](db[_0xcde5('0x16e')],{'onDelete':_0xcde5('0x15c'),'foreignKey':_0xcde5('0x17d')});db[_0xcde5('0x128')][_0xcde5('0x10f')](db[_0xcde5('0x5a')],{'as':_0xcde5('0x151'),'onDelete':'cascade','foreignKey':_0xcde5('0x18c')});db['OpenchannelInteraction'][_0xcde5('0x11c')](db[_0xcde5('0x56')],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x188')});db[_0xcde5('0x128')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157')});db['OpenchannelInteraction']['belongsTo'](db[_0xcde5('0x11')],{'as':_0xcde5('0x16d'),'foreignKey':'UserId'});db[_0xcde5('0x128')][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':_0xcde5('0x18d'),'as':_0xcde5('0x17e')});db[_0xcde5('0x128')][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':_0xcde5('0x18d'),'as':_0xcde5('0x170')});db[_0xcde5('0x128')]['belongsToMany'](db[_0xcde5('0x11')],{'as':_0xcde5('0x171'),'through':_0xcde5('0x129'),'foreignKey':_0xcde5('0x18c')});db[_0xcde5('0x5a')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'onDelete':_0xcde5('0x10d'),'as':'User'});db['OpenchannelMessage'][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'onDelete':_0xcde5('0x10d'),'as':_0xcde5('0x16c')});db[_0xcde5('0x5a')]['belongsTo'](db['OpenchannelInteraction'],{'onDelete':_0xcde5('0x10d'),'as':_0xcde5('0x174'),'foreignKey':_0xcde5('0x18c')});db[_0xcde5('0x5a')]['belongsTo'](db[_0xcde5('0x172')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0xcde5('0x5a')]['belongsTo'](db[_0xcde5('0x56')],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x188')});db[_0xcde5('0x5c')][_0xcde5('0x11e')](db['User'],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x39'),'foreignKey':_0xcde5('0x18b')});db[_0xcde5('0x5c')]['belongsToMany'](db['Team'],{'through':_0xcde5('0x18e'),'as':_0xcde5('0x14d')});db['ChatWebsite'][_0xcde5('0x10f')](db[_0xcde5('0x160')],{'as':_0xcde5('0x161'),'foreignKey':_0xcde5('0x175'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0x5e')]['hasMany'](db[_0xcde5('0x76')],{'as':'Answers','foreignKey':_0xcde5('0x175')});db[_0xcde5('0x5e')]['hasMany'](db[_0xcde5('0x18f')],{'as':_0xcde5('0x190')});db[_0xcde5('0x5e')]['hasMany'](db['ChatInteraction'],{'as':_0xcde5('0x164')});db[_0xcde5('0x5e')][_0xcde5('0x10f')](db['ChatApplication'],{'as':_0xcde5('0x165')});db[_0xcde5('0x5e')]['hasMany'](db[_0xcde5('0x65')],{'as':'Messages'});db[_0xcde5('0x5e')][_0xcde5('0x11c')](db[_0xcde5('0xf0')],{'as':_0xcde5('0x166'),'foreignKey':_0xcde5('0x167')});db['ChatWebsite'][_0xcde5('0x11c')](db[_0xcde5('0x148')],{'as':_0xcde5('0x148'),'foreignKey':'IntervalId'});db[_0xcde5('0x5e')][_0xcde5('0x11c')](db[_0xcde5('0x134')],{'as':_0xcde5('0x134'),'foreignKey':'MailAccountId'});db['ChatWebsite'][_0xcde5('0x11c')](db[_0xcde5('0x79')],{'as':_0xcde5('0x149'),'foreignKey':_0xcde5('0x14a')});db[_0xcde5('0x5e')][_0xcde5('0x11e')](db['User'],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x131')});db[_0xcde5('0x191')][_0xcde5('0x11c')](db[_0xcde5('0x56')],{});db['OpenchannelQueueReport'][_0xcde5('0x11c')](db['CmList'],{'as':_0xcde5('0x166'),'foreignKey':_0xcde5('0x167')});db[_0xcde5('0x191')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157')});db[_0xcde5('0x191')][_0xcde5('0x11c')](db[_0xcde5('0x128')],{});db[_0xcde5('0x191')][_0xcde5('0x11c')](db[_0xcde5('0x5a')],{});db[_0xcde5('0x191')][_0xcde5('0x11c')](db['User'],{});db[_0xcde5('0x191')][_0xcde5('0x11c')](db['OpenchannelQueue'],{});db['ChatApplication'][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x192'),'foreignKey':_0xcde5('0x10a'),'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x61')][_0xcde5('0x11c')](db[_0xcde5('0x68')],{'as':_0xcde5('0x193'),'foreignKey':_0xcde5('0x194'),'onDelete':_0xcde5('0x15c')});db['ChatApplication'][_0xcde5('0x11c')](db[_0xcde5('0x5e')],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':'restrict'});db['ChatApplication'][_0xcde5('0x11c')](db[_0xcde5('0x16e')],{'onDelete':'restrict','foreignKey':_0xcde5('0x17d')});db['ChatInteraction'][_0xcde5('0x10f')](db[_0xcde5('0x65')],{'as':_0xcde5('0x151'),'onDelete':'cascade','foreignKey':_0xcde5('0x195')});db[_0xcde5('0x63')][_0xcde5('0x11c')](db[_0xcde5('0x5e')],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x175')});db['ChatInteraction'][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':'Contact','foreignKey':'ContactId'});db[_0xcde5('0x63')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':'Owner','foreignKey':_0xcde5('0x10a')});db[_0xcde5('0x63')][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':'chat_interaction_has_tags','as':_0xcde5('0x17e')});db[_0xcde5('0x63')]['belongsToMany'](db[_0xcde5('0x16e')],{'through':_0xcde5('0x196'),'as':_0xcde5('0x170')});db[_0xcde5('0x63')]['belongsToMany'](db[_0xcde5('0x11')],{'as':_0xcde5('0x171'),'through':_0xcde5('0x125'),'foreignKey':_0xcde5('0x195')});db[_0xcde5('0x65')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'onDelete':_0xcde5('0x10d'),'as':_0xcde5('0x11')});db['ChatMessage'][_0xcde5('0x11c')](db['CmContact'],{'onDelete':'cascade','as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157')});db['ChatMessage'][_0xcde5('0x11c')](db[_0xcde5('0x63')],{'onDelete':_0xcde5('0x10d'),'as':_0xcde5('0x174'),'foreignKey':'ChatInteractionId'});db[_0xcde5('0x65')][_0xcde5('0x11c')](db[_0xcde5('0x172')],{'as':_0xcde5('0x172'),'foreignKey':_0xcde5('0x180')});db[_0xcde5('0x65')][_0xcde5('0x11c')](db[_0xcde5('0x5e')],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x175')});db['ChatOfflineMessage'][_0xcde5('0x10f')](db[_0xcde5('0x172')],{'as':'Attachments','foreignKey':_0xcde5('0x176'),'onDelete':_0xcde5('0x10d'),'hooks':!![]});db[_0xcde5('0x67')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'onDelete':_0xcde5('0x10d'),'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157')});db[_0xcde5('0x67')][_0xcde5('0x11c')](db[_0xcde5('0x5e')],{'as':'Account','foreignKey':_0xcde5('0x175')});db[_0xcde5('0x68')]['belongsToMany'](db[_0xcde5('0x11')],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x33'),'hooks':!![]});db[_0xcde5('0x68')]['belongsToMany'](db[_0xcde5('0xe0')],{'through':_0xcde5('0x197'),'as':_0xcde5('0x14d')});db[_0xcde5('0x69')][_0xcde5('0x10f')](db[_0xcde5('0xca')],{'as':_0xcde5('0x151'),'foreignKey':_0xcde5('0x198'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0x69')]['belongsToMany'](db[_0xcde5('0x11')],{'as':_0xcde5('0x13f'),'through':'chat_group_has_users'});db[_0xcde5('0x18f')][_0xcde5('0x11c')](db[_0xcde5('0x5e')],{'as':_0xcde5('0x199'),'foreignKey':_0xcde5('0x175')});db[_0xcde5('0x6a')][_0xcde5('0x10f')](db[_0xcde5('0x6c')],{'as':'Contacts','foreignKey':_0xcde5('0x19a')});db[_0xcde5('0x6c')][_0xcde5('0x10f')](db[_0xcde5('0x83')],{'as':'Phones','foreignKey':_0xcde5('0x19b')});db[_0xcde5('0x6c')]['hasMany'](db[_0xcde5('0x141')],{'as':_0xcde5('0x142'),'foreignKey':_0xcde5('0x157')});db['CmContact'][_0xcde5('0x10f')](db[_0xcde5('0x111')],{'as':_0xcde5('0x112'),'foreignKey':'ContactId'});db[_0xcde5('0x6c')][_0xcde5('0x10f')](db[_0xcde5('0x113')],{'as':_0xcde5('0x143'),'foreignKey':_0xcde5('0x157')});db['CmContact'][_0xcde5('0x10f')](db[_0xcde5('0x114')],{'as':'ReportAgentPreview','foreignKey':_0xcde5('0x157')});db[_0xcde5('0x6c')][_0xcde5('0x10f')](db[_0xcde5('0xcf')],{'as':_0xcde5('0x19c'),'foreignKey':_0xcde5('0x157')});db[_0xcde5('0x6c')][_0xcde5('0x10f')](db[_0xcde5('0x128')],{'as':_0xcde5('0x19d'),'foreignKey':_0xcde5('0x157'),'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x6c')]['hasMany'](db[_0xcde5('0x63')],{'as':'ChatInteractions','foreignKey':_0xcde5('0x157'),'onDelete':'restrict'});db[_0xcde5('0x6c')][_0xcde5('0x10f')](db['SmsInteraction'],{'as':_0xcde5('0x116'),'foreignKey':_0xcde5('0x157'),'onDelete':'restrict'});db[_0xcde5('0x6c')][_0xcde5('0x10f')](db['FaxInteraction'],{'as':_0xcde5('0x118'),'foreignKey':'ContactId','onDelete':_0xcde5('0x15c')});db[_0xcde5('0x6c')]['hasMany'](db[_0xcde5('0x40')],{'as':_0xcde5('0x119'),'foreignKey':_0xcde5('0x157'),'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x6c')][_0xcde5('0x11c')](db[_0xcde5('0x6a')],{'as':'Company','foreignKey':_0xcde5('0x19a')});db[_0xcde5('0x6c')][_0xcde5('0x11c')](db[_0xcde5('0xf0')],{'as':'List','foreignKey':_0xcde5('0x167'),'onDelete':'cascade'});db['CmContact']['belongsToMany'](db[_0xcde5('0x11')],{'as':'Users','through':_0xcde5('0x121')});db['CmContact'][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'as':'Tags','through':'cm_contact_has_tags'});db[_0xcde5('0x6c')][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':_0xcde5('0x19e'),'as':_0xcde5('0x170')});db[_0xcde5('0x141')][_0xcde5('0x10f')](db[_0xcde5('0x85')],{'as':_0xcde5('0x19f'),'foreignKey':'CmHopperId'});db[_0xcde5('0x141')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0x141')][_0xcde5('0x11c')](db[_0xcde5('0xf0')],{'as':_0xcde5('0x166'),'foreignKey':'ListId','onDelete':_0xcde5('0x10d')});db['CmHopper'][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x192'),'foreignKey':_0xcde5('0x10a')});db['CmHopper'][_0xcde5('0x11c')](db[_0xcde5('0x1b')],{'as':_0xcde5('0x193'),'foreignKey':_0xcde5('0x140'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0x141')][_0xcde5('0x11c')](db[_0xcde5('0x1a0')],{'as':_0xcde5('0x1a0'),'foreignKey':_0xcde5('0x1a1'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0x141')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x16d'),'foreignKey':_0xcde5('0x1a2')});db[_0xcde5('0x144')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157'),'onDelete':_0xcde5('0x10d')});db['CmHopperBlack'][_0xcde5('0x11c')](db['CmList'],{'as':_0xcde5('0x166'),'foreignKey':_0xcde5('0x167'),'onDelete':'cascade'});db[_0xcde5('0x144')][_0xcde5('0x11c')](db['VoiceQueue'],{'as':_0xcde5('0x193'),'foreignKey':_0xcde5('0x140'),'onDelete':'cascade'});db['CmHopperBlack']['belongsTo'](db['Campaign'],{'as':_0xcde5('0x1a0'),'foreignKey':_0xcde5('0x1a1'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0x74')][_0xcde5('0x10f')](db[_0xcde5('0x1a3')],{'as':{'plural':_0xcde5('0x1a4'),'singular':_0xcde5('0x1a5')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0xcde5('0x74')][_0xcde5('0x10f')](db[_0xcde5('0x1a3')],{'as':{'plural':'Any','singular':_0xcde5('0x1a6')},'foreignKey':_0xcde5('0x1a7'),'onDelete':_0xcde5('0x10d'),'hooks':!![]});db['Automation']['hasMany'](db['Action'],{'as':_0xcde5('0x1a8'),'foreignKey':_0xcde5('0x1a9'),'onDelete':_0xcde5('0x10d'),'hooks':!![]});db[_0xcde5('0x160')][_0xcde5('0x10f')](db[_0xcde5('0x160')],{'as':_0xcde5('0x161'),'foreignKey':_0xcde5('0x1aa'),'onDelete':_0xcde5('0x10d')});db['Interval']['hasMany'](db[_0xcde5('0x148')],{'as':'Intervals','foreignKey':_0xcde5('0x177'),'onDelete':_0xcde5('0x10d'),'hooks':!![],'required':![]});db[_0xcde5('0x148')][_0xcde5('0x10f')](db[_0xcde5('0x17')],{'as':'Extensions','foreignKey':_0xcde5('0x177'),'onDelete':_0xcde5('0x15c')});db['Interval'][_0xcde5('0x10f')](db[_0xcde5('0x43')],{'as':_0xcde5('0x1ab'),'foreignKey':_0xcde5('0x177')});db[_0xcde5('0x148')][_0xcde5('0x10f')](db['ChatApplication'],{'as':_0xcde5('0x1ac'),'foreignKey':'IntervalId'});db[_0xcde5('0x148')]['hasMany'](db['FaxApplication'],{'as':_0xcde5('0x1ad'),'foreignKey':_0xcde5('0x177')});db[_0xcde5('0x148')][_0xcde5('0x10f')](db[_0xcde5('0x184')],{'as':_0xcde5('0x1ae'),'foreignKey':_0xcde5('0x177')});db[_0xcde5('0x7d')][_0xcde5('0x11c')](db[_0xcde5('0x134')],{});db[_0xcde5('0x7d')]['belongsTo'](db[_0xcde5('0x90')],{'foreignKey':_0xcde5('0x1af')});db['Schedule'][_0xcde5('0x11c')](db[_0xcde5('0x8f')],{'foreignKey':_0xcde5('0x1b0')});db['Sound'][_0xcde5('0x11e')](db[_0xcde5('0x19')],{'as':_0xcde5('0x1b1'),'through':_0xcde5('0x1b2'),'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x16e')][_0xcde5('0x11e')](db['CmContact'],{'through':_0xcde5('0x19e')});db[_0xcde5('0x16e')][_0xcde5('0x11e')](db['ChatInteraction'],{'through':_0xcde5('0x196')});db[_0xcde5('0x16e')][_0xcde5('0x11e')](db[_0xcde5('0x40')],{'through':'mail_interaction_has_tags'});db['Tag'][_0xcde5('0x11e')](db[_0xcde5('0x53')],{'through':_0xcde5('0x185')});db['Tag'][_0xcde5('0x11e')](db[_0xcde5('0x117')],{'through':_0xcde5('0x17f')});db['Tag'][_0xcde5('0x11e')](db[_0xcde5('0x128')],{'through':_0xcde5('0x18d')});db[_0xcde5('0x16e')][_0xcde5('0x11e')](db['WhatsappInteraction'],{'through':_0xcde5('0x1b3')});db[_0xcde5('0x83')][_0xcde5('0x11c')](db[_0xcde5('0x1b4')],{'as':'ItemType','foreignKey':'ItemTypeId'});db[_0xcde5('0x85')]['belongsTo'](db[_0xcde5('0x141')],{'as':_0xcde5('0x1b5'),'foreignKey':_0xcde5('0x1b6')});db[_0xcde5('0x83')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x19b')});db[_0xcde5('0x1b7')][_0xcde5('0x10f')](db[_0xcde5('0x1a3')],{'as':{'plural':'AllConditions','singular':_0xcde5('0x1b8')},'foreignKey':'TriggerAllId','onDelete':_0xcde5('0x10d'),'hooks':!![]});db[_0xcde5('0x1b7')][_0xcde5('0x10f')](db[_0xcde5('0x1a3')],{'as':{'plural':_0xcde5('0x1b9'),'singular':_0xcde5('0x1ba')},'foreignKey':_0xcde5('0x1bb'),'onDelete':_0xcde5('0x10d'),'hooks':!![]});db[_0xcde5('0x1b7')][_0xcde5('0x10f')](db[_0xcde5('0x72')],{'as':'Actions','foreignKey':_0xcde5('0x1bc'),'onDelete':_0xcde5('0x10d'),'hooks':!![]});db[_0xcde5('0x8f')]['hasMany'](db[_0xcde5('0x95')],{'as':'Fields','onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1b0'),'hooks':!![]});db[_0xcde5('0x90')][_0xcde5('0x10f')](db[_0xcde5('0x95')],{'as':_0xcde5('0x1bd'),'onDelete':'cascade','foreignKey':_0xcde5('0x1af')});db[_0xcde5('0x94')][_0xcde5('0x10f')](db[_0xcde5('0x95')],{'as':'Fields','onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1be')});db[_0xcde5('0x95')][_0xcde5('0x11c')](db[_0xcde5('0x94')],{'foreignKey':'MetricId'});db[_0xcde5('0x97')][_0xcde5('0x10f')](db[_0xcde5('0x99')],{'as':_0xcde5('0x1bf'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c0')});db['SalesforceConfiguration'][_0xcde5('0x10f')](db[_0xcde5('0x9b')],{'as':'Subjects','onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c1')});db['SalesforceConfiguration'][_0xcde5('0x10f')](db[_0xcde5('0x9b')],{'as':_0xcde5('0x1c2'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['SalesforceConfiguration'][_0xcde5('0x10f')](db[_0xcde5('0x9b')],{'as':_0xcde5('0x1bd'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0x99')][_0xcde5('0x11c')](db['SalesforceAccount'],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x1c0')});db[_0xcde5('0x9b')][_0xcde5('0x10f')](db[_0xcde5('0x9b')],{'as':'Subject','foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0x9b')][_0xcde5('0x10f')](db[_0xcde5('0x9b')],{'as':_0xcde5('0x1c4'),'foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0x9b')]['hasMany'](db[_0xcde5('0x9b')],{'as':'Field','foreignKey':'FieldId'});db[_0xcde5('0x9b')][_0xcde5('0x11c')](db[_0xcde5('0x8a')],{'as':_0xcde5('0x8a'),'foreignKey':_0xcde5('0x1c6')});db['SugarcrmAccount'][_0xcde5('0x10f')](db['SugarcrmConfiguration'],{'as':_0xcde5('0x1bf'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c0')});db[_0xcde5('0x9f')]['hasMany'](db[_0xcde5('0x1c7')],{'as':_0xcde5('0x1c8'),'onDelete':'cascade','foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0x9f')][_0xcde5('0x10f')](db[_0xcde5('0x1c7')],{'as':'Descriptions','onDelete':_0xcde5('0x10d'),'foreignKey':'DescriptionId'});db[_0xcde5('0x9f')][_0xcde5('0x10f')](db[_0xcde5('0x1c7')],{'as':_0xcde5('0x1bd'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0x9f')][_0xcde5('0x11c')](db[_0xcde5('0x9d')],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x1c0')});db[_0xcde5('0x1c7')]['hasMany'](db['SugarcrmField'],{'as':_0xcde5('0x1c9'),'foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0x1c7')][_0xcde5('0x10f')](db[_0xcde5('0x1c7')],{'as':'Description','foreignKey':_0xcde5('0x1c5')});db['SugarcrmField']['hasMany'](db[_0xcde5('0x1c7')],{'as':_0xcde5('0x1ca'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0x1c7')]['belongsTo'](db[_0xcde5('0x8a')],{'as':'Variable','foreignKey':_0xcde5('0x1c6')});db[_0xcde5('0xa2')][_0xcde5('0x10f')](db[_0xcde5('0xa4')],{'as':_0xcde5('0x1bf'),'onDelete':_0xcde5('0x10d'),'foreignKey':'AccountId'});db[_0xcde5('0xa4')][_0xcde5('0x10f')](db['DeskField'],{'as':_0xcde5('0x1c8'),'onDelete':_0xcde5('0x10d'),'foreignKey':'SubjectId'});db[_0xcde5('0xa4')][_0xcde5('0x10f')](db[_0xcde5('0x1cb')],{'as':_0xcde5('0x1c2'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0xa4')]['hasMany'](db[_0xcde5('0x1cb')],{'as':_0xcde5('0x1bd'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0xa4')][_0xcde5('0x11c')](db[_0xcde5('0xa2')],{'as':'Account','foreignKey':'AccountId'});db['DeskConfiguration']['belongsToMany'](db['Tag'],{'through':_0xcde5('0x1cc')});db[_0xcde5('0x1cb')][_0xcde5('0x10f')](db[_0xcde5('0x1cb')],{'as':_0xcde5('0x1c9'),'foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0x1cb')][_0xcde5('0x10f')](db['DeskField'],{'as':_0xcde5('0x1c4'),'foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0x1cb')][_0xcde5('0x10f')](db[_0xcde5('0x1cb')],{'as':'Field','foreignKey':'FieldId'});db[_0xcde5('0x1cb')]['belongsTo'](db['Variable'],{'as':_0xcde5('0x8a'),'foreignKey':_0xcde5('0x1c6')});db[_0xcde5('0xa7')][_0xcde5('0x10f')](db[_0xcde5('0x1cd')],{'as':_0xcde5('0x1bf'),'onDelete':_0xcde5('0x10d'),'foreignKey':'AccountId'});db[_0xcde5('0x1cd')][_0xcde5('0x10f')](db['ZohoField'],{'as':_0xcde5('0x1c8'),'onDelete':_0xcde5('0x10d'),'foreignKey':'SubjectId'});db[_0xcde5('0x1cd')][_0xcde5('0x10f')](db[_0xcde5('0xa9')],{'as':_0xcde5('0x1c2'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0x1cd')][_0xcde5('0x10f')](db[_0xcde5('0xa9')],{'as':_0xcde5('0x1bd'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0x1cd')][_0xcde5('0x11c')](db[_0xcde5('0xa7')],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x1c0')});db['ZohoField']['hasMany'](db[_0xcde5('0xa9')],{'as':'Subject','foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0xa9')][_0xcde5('0x10f')](db[_0xcde5('0xa9')],{'as':_0xcde5('0x1c4'),'foreignKey':'DescriptionId'});db[_0xcde5('0xa9')][_0xcde5('0x10f')](db[_0xcde5('0xa9')],{'as':_0xcde5('0x1ca'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0xa9')][_0xcde5('0x11c')](db['Variable'],{'as':'Variable','foreignKey':_0xcde5('0x1c6')});db[_0xcde5('0xab')][_0xcde5('0x10f')](db[_0xcde5('0x1ce')],{'as':_0xcde5('0x1bf'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c0')});db['ZendeskConfiguration'][_0xcde5('0x10f')](db[_0xcde5('0x1cf')],{'as':'Subjects','foreignKey':'SubjectId'});db['ZendeskConfiguration']['hasMany'](db['ZendeskField'],{'as':_0xcde5('0x1c2'),'foreignKey':_0xcde5('0x1c5')});db['ZendeskConfiguration'][_0xcde5('0x10f')](db[_0xcde5('0x1cf')],{'as':_0xcde5('0x1bd'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0x1ce')][_0xcde5('0x11c')](db['ZendeskAccount'],{'as':'Account','foreignKey':_0xcde5('0x1c0')});db[_0xcde5('0x1ce')][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':_0xcde5('0x1d0')});db[_0xcde5('0x1cf')]['hasMany'](db[_0xcde5('0x1cf')],{'as':'Subject','foreignKey':_0xcde5('0x1c1')});db['ZendeskField'][_0xcde5('0x10f')](db['ZendeskField'],{'as':'Description','foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0x1cf')][_0xcde5('0x10f')](db[_0xcde5('0x1cf')],{'as':_0xcde5('0x1ca'),'foreignKey':_0xcde5('0x1c3')});db['ZendeskField'][_0xcde5('0x11c')](db[_0xcde5('0x8a')],{'as':_0xcde5('0x8a'),'foreignKey':_0xcde5('0x1c6')});db[_0xcde5('0x1d1')]['hasMany'](db[_0xcde5('0xaf')],{'as':'Configurations','onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c0')});db['FreshdeskConfiguration'][_0xcde5('0x10f')](db[_0xcde5('0xb1')],{'as':_0xcde5('0x1c8'),'onDelete':_0xcde5('0x10d'),'foreignKey':'SubjectId'});db[_0xcde5('0xaf')]['hasMany'](db['FreshdeskField'],{'as':_0xcde5('0x1c2'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0xaf')]['hasMany'](db[_0xcde5('0xb1')],{'as':_0xcde5('0x1bd'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0xaf')][_0xcde5('0x11c')](db[_0xcde5('0x1d1')],{'as':_0xcde5('0x16b'),'foreignKey':'AccountId'});db[_0xcde5('0xaf')][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':_0xcde5('0x1d2')});db[_0xcde5('0xb1')][_0xcde5('0x10f')](db[_0xcde5('0xb1')],{'as':_0xcde5('0x1c9'),'foreignKey':_0xcde5('0x1c1')});db['FreshdeskField'][_0xcde5('0x10f')](db[_0xcde5('0xb1')],{'as':_0xcde5('0x1c4'),'foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0xb1')]['hasMany'](db[_0xcde5('0xb1')],{'as':'Field','foreignKey':'FieldId'});db[_0xcde5('0xb1')][_0xcde5('0x11c')](db[_0xcde5('0x8a')],{'as':_0xcde5('0x8a'),'foreignKey':_0xcde5('0x1c6')});db[_0xcde5('0xb3')][_0xcde5('0x10f')](db[_0xcde5('0xb5')],{'as':_0xcde5('0x1bf'),'onDelete':'cascade','foreignKey':_0xcde5('0x1c0')});db[_0xcde5('0xb5')][_0xcde5('0x10f')](db['VtigerField'],{'as':'Subjects','foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0xb5')][_0xcde5('0x10f')](db[_0xcde5('0xb7')],{'as':_0xcde5('0x1c2'),'foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0xb5')]['hasMany'](db['VtigerField'],{'as':_0xcde5('0x1bd'),'foreignKey':'FieldId'});db[_0xcde5('0xb5')][_0xcde5('0x11c')](db[_0xcde5('0xb3')],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x1c0')});db[_0xcde5('0xb7')][_0xcde5('0x10f')](db[_0xcde5('0xb7')],{'as':_0xcde5('0x1c9'),'foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0xb7')][_0xcde5('0x10f')](db[_0xcde5('0xb7')],{'as':_0xcde5('0x1c4'),'foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0xb7')][_0xcde5('0x10f')](db[_0xcde5('0xb7')],{'as':_0xcde5('0x1ca'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0xb7')]['belongsTo'](db[_0xcde5('0x8a')],{'as':_0xcde5('0x8a'),'foreignKey':'VariableId'});db[_0xcde5('0xb9')][_0xcde5('0x10f')](db[_0xcde5('0x1d3')],{'as':'Configurations','onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c0')});db[_0xcde5('0x1d3')]['hasMany'](db[_0xcde5('0xbc')],{'as':_0xcde5('0x1c8'),'foreignKey':'SubjectId'});db[_0xcde5('0x1d3')][_0xcde5('0x10f')](db[_0xcde5('0xbc')],{'as':_0xcde5('0x1c2'),'foreignKey':_0xcde5('0x1c5')});db['ServicenowConfiguration'][_0xcde5('0x10f')](db[_0xcde5('0xbc')],{'as':_0xcde5('0x1bd'),'foreignKey':'FieldId'});db[_0xcde5('0x1d3')][_0xcde5('0x11c')](db['ServicenowAccount'],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x1c0')});db[_0xcde5('0xbc')][_0xcde5('0x10f')](db[_0xcde5('0xbc')],{'as':_0xcde5('0x1c9'),'foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0xbc')]['hasMany'](db[_0xcde5('0xbc')],{'as':_0xcde5('0x1c4'),'foreignKey':_0xcde5('0x1c5')});db['ServicenowField'][_0xcde5('0x10f')](db['ServicenowField'],{'as':_0xcde5('0x1ca'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0xbc')][_0xcde5('0x11c')](db[_0xcde5('0x8a')],{'as':_0xcde5('0x8a'),'foreignKey':_0xcde5('0x1c6')});db[_0xcde5('0x1d4')]['hasMany'](db[_0xcde5('0xbe')],{'as':_0xcde5('0x1bf'),'onDelete':_0xcde5('0x10d'),'foreignKey':'AccountId'});db[_0xcde5('0x1d4')][_0xcde5('0x11c')](db[_0xcde5('0x15a')],{'as':_0xcde5('0x15a'),'foreignKey':_0xcde5('0x15b')});db[_0xcde5('0xbe')]['hasMany'](db[_0xcde5('0x1d5')],{'as':'Subjects','onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c1')});db['Dynamics365Configuration'][_0xcde5('0x10f')](db[_0xcde5('0x1d5')],{'as':_0xcde5('0x1c2'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xcde5('0xbe')][_0xcde5('0x10f')](db['Dynamics365Field'],{'as':_0xcde5('0x1bd'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c3')});db['Dynamics365Configuration'][_0xcde5('0x11c')](db['Dynamics365Account'],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x1c0')});db[_0xcde5('0x1d5')]['hasMany'](db[_0xcde5('0x1d5')],{'as':_0xcde5('0x1c9'),'foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0x1d5')][_0xcde5('0x10f')](db[_0xcde5('0x1d5')],{'as':_0xcde5('0x1c4'),'foreignKey':_0xcde5('0x1c5')});db['Dynamics365Field'][_0xcde5('0x10f')](db[_0xcde5('0x1d5')],{'as':_0xcde5('0x1ca'),'foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0x1d5')][_0xcde5('0x11c')](db[_0xcde5('0x8a')],{'as':_0xcde5('0x8a'),'foreignKey':'VariableId'});db[_0xcde5('0xc1')][_0xcde5('0x10f')](db[_0xcde5('0xc3')],{'as':'Configurations','onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1c0')});db[_0xcde5('0xc3')]['hasMany'](db[_0xcde5('0xc5')],{'as':'Subjects','foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0xc3')][_0xcde5('0x10f')](db['FreshsalesField'],{'as':'Descriptions','foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0xc3')]['hasMany'](db[_0xcde5('0xc5')],{'as':_0xcde5('0x1bd'),'foreignKey':_0xcde5('0x1c3')});db['FreshsalesConfiguration']['belongsTo'](db['FreshsalesAccount'],{'as':'Account','foreignKey':_0xcde5('0x1c0')});db['FreshsalesField'][_0xcde5('0x10f')](db[_0xcde5('0xc5')],{'as':_0xcde5('0x1c9'),'foreignKey':_0xcde5('0x1c1')});db[_0xcde5('0xc5')]['hasMany'](db[_0xcde5('0xc5')],{'as':_0xcde5('0x1c4'),'foreignKey':_0xcde5('0x1c5')});db[_0xcde5('0xc5')][_0xcde5('0x10f')](db[_0xcde5('0xc5')],{'as':'Field','foreignKey':_0xcde5('0x1c3')});db[_0xcde5('0xc5')]['belongsTo'](db['Variable'],{'as':_0xcde5('0x8a'),'foreignKey':'VariableId'});db['ChatQueueReport']['belongsTo'](db['ChatWebsite'],{});db['ChatQueueReport']['belongsTo'](db[_0xcde5('0xf0')],{'as':_0xcde5('0x166'),'foreignKey':_0xcde5('0x167')});db[_0xcde5('0xc8')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157')});db[_0xcde5('0xc8')][_0xcde5('0x11c')](db[_0xcde5('0x63')],{});db[_0xcde5('0xc8')]['belongsTo'](db[_0xcde5('0x65')],{});db[_0xcde5('0xc8')]['belongsTo'](db[_0xcde5('0x11')],{});db[_0xcde5('0xc8')][_0xcde5('0x11c')](db['ChatQueue'],{});db[_0xcde5('0xca')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1d6')});db['ChatInternalMessage'][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1d7')});db['JscriptySessionReport'][_0xcde5('0x10f')](db[_0xcde5('0xce')],{'foreignKey':_0xcde5('0x1d8'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0xcf')][_0xcde5('0x10f')](db[_0xcde5('0xcc')],{'foreignKey':_0xcde5('0x1d8'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0xd1')]['belongsTo'](db[_0xcde5('0x137')],{});db[_0xcde5('0xd1')][_0xcde5('0x11c')](db[_0xcde5('0xf0')],{'as':_0xcde5('0x166'),'foreignKey':_0xcde5('0x167')});db[_0xcde5('0xd1')]['belongsTo'](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':'ContactId'});db['SmsQueueReport'][_0xcde5('0x11c')](db[_0xcde5('0x53')],{});db[_0xcde5('0xd1')][_0xcde5('0x11c')](db['SmsMessage'],{});db[_0xcde5('0xd1')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{});db[_0xcde5('0xd1')][_0xcde5('0x11c')](db['SmsQueue'],{});db[_0xcde5('0xd6')]['hasMany'](db[_0xcde5('0xcf')],{'foreignKey':_0xcde5('0x1d9')});db['JscriptyProject'][_0xcde5('0x10f')](db['JscriptyQuestionReport'],{'foreignKey':_0xcde5('0x1d9')});db[_0xcde5('0xd6')]['hasMany'](db[_0xcde5('0xcc')],{'foreignKey':_0xcde5('0x1d9')});db['Team'][_0xcde5('0x11e')](db[_0xcde5('0x11')],{'as':_0xcde5('0x14c'),'through':'user_has_teams'});db[_0xcde5('0xe0')][_0xcde5('0x11e')](db[_0xcde5('0x1b')],{'through':'TeamVoiceQueue','as':_0xcde5('0x1da')});db[_0xcde5('0xe0')]['belongsToMany'](db[_0xcde5('0x3e')],{'through':'team_has_mail_queues','as':'MailQueues'});db['Team'][_0xcde5('0x11e')](db[_0xcde5('0x68')],{'through':_0xcde5('0x197'),'as':_0xcde5('0x12d')});db[_0xcde5('0xe0')][_0xcde5('0x11e')](db[_0xcde5('0x17c')],{'through':_0xcde5('0x181'),'as':'FaxQueues'});db[_0xcde5('0xe0')][_0xcde5('0x11e')](db[_0xcde5('0x55')],{'through':_0xcde5('0x187'),'as':'SmsQueues'});db[_0xcde5('0xe0')][_0xcde5('0x11e')](db[_0xcde5('0x5c')],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db[_0xcde5('0xe0')][_0xcde5('0x11e')](db[_0xcde5('0x102')],{'through':'team_has_whatsapp_queues','as':'WhatsappQueues'});db[_0xcde5('0xe0')][_0xcde5('0x11e')](db[_0xcde5('0xf2')],{'through':_0xcde5('0x1db'),'as':'VoicePrefixes'});db['Campaign'][_0xcde5('0x10f')](db[_0xcde5('0x141')],{'as':'Hoppers','foreignKey':_0xcde5('0x1a1')});db[_0xcde5('0x1a0')][_0xcde5('0x10f')](db[_0xcde5('0x111')],{'as':_0xcde5('0x112'),'foreignKey':_0xcde5('0x1a1')});db[_0xcde5('0x1a0')]['hasMany'](db[_0xcde5('0x113')],{'as':_0xcde5('0x143'),'foreignKey':_0xcde5('0x1a1')});db['Campaign'][_0xcde5('0x10f')](db[_0xcde5('0x144')],{'as':_0xcde5('0x145'),'foreignKey':_0xcde5('0x1a1')});db[_0xcde5('0x1a0')]['belongsTo'](db[_0xcde5('0x2e')],{'as':_0xcde5('0x2e'),'foreignKey':_0xcde5('0x1dc')});db['Campaign']['belongsTo'](db[_0xcde5('0x2e')],{'as':_0xcde5('0x146'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0xcde5('0x11c')](db[_0xcde5('0x148')],{'as':_0xcde5('0x148'),'foreignKey':_0xcde5('0x177')});db['Campaign'][_0xcde5('0x11c')](db[_0xcde5('0xda')],{'as':'SquareProject','foreignKey':_0xcde5('0x1dd')});db[_0xcde5('0x1a0')]['belongsToMany'](db[_0xcde5('0xf0')],{'as':_0xcde5('0x1de'),'through':_0xcde5('0x1df')});db['Campaign'][_0xcde5('0x11e')](db[_0xcde5('0xf0')],{'as':_0xcde5('0x14f'),'through':'campaigns_has_cm_blacklists'});db['Attachment'][_0xcde5('0x11c')](db[_0xcde5('0x67')],{'as':_0xcde5('0x67'),'foreignKey':_0xcde5('0x176')});db[_0xcde5('0xe7')][_0xcde5('0x11c')](db[_0xcde5('0x163')],{});db[_0xcde5('0xe7')][_0xcde5('0x11c')](db[_0xcde5('0x40')],{});db[_0xcde5('0xe7')][_0xcde5('0x11c')](db['MailAccount'],{'foreignKey':_0xcde5('0x1e0'),'as':_0xcde5('0x1e1')});db['MailTransferReport'][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'foreignKey':_0xcde5('0x1e2'),'as':_0xcde5('0x1e3')});db[_0xcde5('0xe7')][_0xcde5('0x11c')](db['User'],{'foreignKey':'ToUserId','as':_0xcde5('0x1e4')});db['MailTransferReport'][_0xcde5('0x11c')](db[_0xcde5('0x3e')],{'foreignKey':_0xcde5('0x1e5'),'as':_0xcde5('0x1e6')});db[_0xcde5('0xe7')][_0xcde5('0x11c')](db[_0xcde5('0x134')],{'foreignKey':_0xcde5('0x1e7'),'as':_0xcde5('0x1e8')});db['ChatTransferReport']['belongsTo'](db['ChatMessage'],{});db[_0xcde5('0xe9')]['belongsTo'](db[_0xcde5('0x63')],{});db['ChatTransferReport'][_0xcde5('0x11c')](db[_0xcde5('0x5e')],{'foreignKey':_0xcde5('0x1e9'),'as':_0xcde5('0x1e1')});db['ChatTransferReport'][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'foreignKey':_0xcde5('0x1e2'),'as':_0xcde5('0x1e3')});db[_0xcde5('0xe9')]['belongsTo'](db[_0xcde5('0x11')],{'foreignKey':'ToUserId','as':_0xcde5('0x1e4')});db[_0xcde5('0xe9')][_0xcde5('0x11c')](db[_0xcde5('0x68')],{'foreignKey':'ToChatQueueId','as':_0xcde5('0x1e6')});db['ChatTransferReport'][_0xcde5('0x11c')](db['ChatWebsite'],{'foreignKey':_0xcde5('0x1ea'),'as':'ToAccount'});db[_0xcde5('0xea')][_0xcde5('0x11c')](db['FaxMessage'],{});db[_0xcde5('0xea')][_0xcde5('0x11c')](db['FaxInteraction'],{});db[_0xcde5('0xea')][_0xcde5('0x11c')](db[_0xcde5('0x49')],{'foreignKey':_0xcde5('0x1eb'),'as':'FromAccount'});db[_0xcde5('0xea')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'foreignKey':'FromUserId','as':_0xcde5('0x1e3')});db[_0xcde5('0xea')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'foreignKey':_0xcde5('0x1ec'),'as':'ToAgent'});db['FaxTransferReport']['belongsTo'](db[_0xcde5('0x17c')],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db['FaxTransferReport'][_0xcde5('0x11c')](db['FaxAccount'],{'foreignKey':_0xcde5('0x1ed'),'as':_0xcde5('0x1e8')});db[_0xcde5('0xec')][_0xcde5('0x11c')](db[_0xcde5('0x5a')],{});db[_0xcde5('0xec')][_0xcde5('0x11c')](db[_0xcde5('0x128')],{});db[_0xcde5('0xec')]['belongsTo'](db[_0xcde5('0x56')],{'foreignKey':_0xcde5('0x1ee'),'as':_0xcde5('0x1e1')});db[_0xcde5('0xec')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'foreignKey':_0xcde5('0x1e2'),'as':_0xcde5('0x1e3')});db['OpenchannelTransferReport']['belongsTo'](db[_0xcde5('0x11')],{'foreignKey':_0xcde5('0x1ec'),'as':'ToAgent'});db[_0xcde5('0xec')][_0xcde5('0x11c')](db['OpenchannelQueue'],{'foreignKey':_0xcde5('0x1ef'),'as':_0xcde5('0x1e6')});db[_0xcde5('0xec')][_0xcde5('0x11c')](db[_0xcde5('0x56')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport'][_0xcde5('0x11c')](db[_0xcde5('0x183')],{});db[_0xcde5('0xee')]['belongsTo'](db[_0xcde5('0x53')],{});db['SmsTransferReport'][_0xcde5('0x11c')](db[_0xcde5('0x137')],{'foreignKey':_0xcde5('0x1f0'),'as':'FromAccount'});db[_0xcde5('0xee')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'foreignKey':_0xcde5('0x1e2'),'as':'FromAgent'});db[_0xcde5('0xee')][_0xcde5('0x11c')](db['User'],{'foreignKey':_0xcde5('0x1ec'),'as':_0xcde5('0x1e4')});db[_0xcde5('0xee')][_0xcde5('0x11c')](db[_0xcde5('0x55')],{'foreignKey':_0xcde5('0x1f1'),'as':_0xcde5('0x1e6')});db['SmsTransferReport'][_0xcde5('0x11c')](db[_0xcde5('0x137')],{'foreignKey':_0xcde5('0x1f2'),'as':'ToAccount'});db[_0xcde5('0xf0')][_0xcde5('0x10f')](db[_0xcde5('0x160')],{'as':_0xcde5('0x161'),'foreignKey':_0xcde5('0x167'),'onDelete':_0xcde5('0x10d')});db[_0xcde5('0xf0')][_0xcde5('0x10f')](db[_0xcde5('0x70')],{'as':_0xcde5('0x1f3'),'foreignKey':'ListId'});db[_0xcde5('0xf0')][_0xcde5('0x10f')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x1f4'),'onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x167')});db['CmList'][_0xcde5('0x10f')](db[_0xcde5('0x111')],{'as':'HopperFinals','foreignKey':_0xcde5('0x167')});db[_0xcde5('0xf0')][_0xcde5('0x10f')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0xcde5('0x167')});db[_0xcde5('0xf0')][_0xcde5('0x10f')](db[_0xcde5('0x114')],{'as':_0xcde5('0x114'),'foreignKey':'ListId'});db[_0xcde5('0xf0')]['belongsToMany'](db[_0xcde5('0x1b')],{'as':_0xcde5('0x1f5'),'through':_0xcde5('0x14b')});db[_0xcde5('0xf0')][_0xcde5('0x11e')](db[_0xcde5('0x11')],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x122')});db[_0xcde5('0xf2')][_0xcde5('0x10f')](db[_0xcde5('0x17')],{'as':'Extensions','onDelete':_0xcde5('0x10d')});db[_0xcde5('0xf2')][_0xcde5('0x11e')](db['User'],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x106')});db['VoicePrefix'][_0xcde5('0x11e')](db[_0xcde5('0xe0')],{'through':_0xcde5('0x1db'),'as':_0xcde5('0x14d')});db[_0xcde5('0xf3')][_0xcde5('0x10f')](db[_0xcde5('0x11')],{'as':_0xcde5('0x171'),'foreignKey':_0xcde5('0x11d')});db[_0xcde5('0xf3')][_0xcde5('0x10f')](db['UserProfileSection'],{'as':_0xcde5('0x1f6'),'foreignKey':_0xcde5('0x11d'),'onDelete':_0xcde5('0x10d')});db['UserProfileSection'][_0xcde5('0x10f')](db[_0xcde5('0x1f7')],{'as':_0xcde5('0x1f8'),'foreignKey':_0xcde5('0x1f9'),'onDelete':'cascade'});db[_0xcde5('0xf9')][_0xcde5('0x10f')](db['Disposition'],{'as':_0xcde5('0x161'),'foreignKey':'WhatsappAccountId','onDelete':'cascade'});db[_0xcde5('0xf9')]['hasMany'](db['CannedAnswer'],{'as':_0xcde5('0x162'),'foreignKey':_0xcde5('0x1fa')});db[_0xcde5('0xf9')][_0xcde5('0x10f')](db[_0xcde5('0xfe')],{'as':'Messages','foreignKey':_0xcde5('0x1fa')});db['WhatsappAccount'][_0xcde5('0x10f')](db[_0xcde5('0xfc')],{'as':_0xcde5('0x164')});db[_0xcde5('0xf9')][_0xcde5('0x10f')](db[_0xcde5('0x1fb')],{'as':_0xcde5('0x165')});db[_0xcde5('0xf9')][_0xcde5('0x11c')](db['CmList'],{'as':_0xcde5('0x166'),'foreignKey':_0xcde5('0x167')});db[_0xcde5('0xf9')][_0xcde5('0x11c')](db[_0xcde5('0x79')],{'as':_0xcde5('0x149'),'foreignKey':_0xcde5('0x14a')});db[_0xcde5('0xf9')][_0xcde5('0x11e')](db[_0xcde5('0x11')],{'as':_0xcde5('0x14c'),'through':_0xcde5('0x13a')});db['WhatsappApplication'][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'onDelete':_0xcde5('0x15c')});db['WhatsappApplication'][_0xcde5('0x11c')](db[_0xcde5('0x102')],{'onDelete':_0xcde5('0x15c')});db[_0xcde5('0x1fb')][_0xcde5('0x11c')](db[_0xcde5('0xf9')],{'onDelete':'restrict'});db['WhatsappApplication']['belongsTo'](db['Interval'],{'onDelete':_0xcde5('0x15c'),'foreignKey':_0xcde5('0x177')});db[_0xcde5('0x1fb')][_0xcde5('0x11c')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xcde5('0x17d')});db['WhatsappInteraction'][_0xcde5('0x10f')](db[_0xcde5('0xfe')],{'as':'Messages','onDelete':_0xcde5('0x10d'),'foreignKey':_0xcde5('0x1fc')});db['WhatsappInteraction'][_0xcde5('0x11c')](db['WhatsappAccount'],{'as':_0xcde5('0x16b'),'foreignKey':'WhatsappAccountId'});db[_0xcde5('0xfc')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':'Contact','foreignKey':_0xcde5('0x157')});db[_0xcde5('0xfc')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x16d'),'foreignKey':_0xcde5('0x10a')});db['WhatsappInteraction'][_0xcde5('0x11e')](db['Tag'],{'through':_0xcde5('0x1b3'),'as':'Tags'});db[_0xcde5('0xfc')][_0xcde5('0x11e')](db[_0xcde5('0x16e')],{'through':'whatsapp_interaction_has_tags','as':_0xcde5('0x170')});db[_0xcde5('0xfc')][_0xcde5('0x11e')](db[_0xcde5('0x11')],{'as':_0xcde5('0x171'),'through':'user_has_whatsapp_interactions','foreignKey':'WhatsappInteractionId'});db['WhatsappMessage'][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x11')});db['WhatsappMessage'][_0xcde5('0x11c')](db['CmContact'],{'onDelete':_0xcde5('0x10d'),'as':_0xcde5('0x16c')});db[_0xcde5('0xfe')]['belongsTo'](db[_0xcde5('0xfc')],{'onDelete':_0xcde5('0x10d'),'as':'Interaction','foreignKey':_0xcde5('0x1fc')});db[_0xcde5('0xfe')][_0xcde5('0x11c')](db[_0xcde5('0xf9')],{'as':_0xcde5('0x16b'),'foreignKey':_0xcde5('0x1fa')});db['WhatsappQueueReport'][_0xcde5('0x11c')](db[_0xcde5('0xf9')],{});db[_0xcde5('0x100')][_0xcde5('0x11c')](db[_0xcde5('0xf0')],{'as':_0xcde5('0x166'),'foreignKey':_0xcde5('0x167')});db[_0xcde5('0x100')][_0xcde5('0x11c')](db[_0xcde5('0x6c')],{'as':_0xcde5('0x16c'),'foreignKey':_0xcde5('0x157')});db['WhatsappQueueReport'][_0xcde5('0x11c')](db[_0xcde5('0xfc')],{});db['WhatsappQueueReport'][_0xcde5('0x11c')](db[_0xcde5('0x102')],{});db[_0xcde5('0x100')][_0xcde5('0x11c')](db[_0xcde5('0xfe')],{});db[_0xcde5('0x100')]['belongsTo'](db[_0xcde5('0x11')],{});db[_0xcde5('0x1fd')][_0xcde5('0x11c')](db['WhatsappMessage'],{});db[_0xcde5('0x1fd')][_0xcde5('0x11c')](db[_0xcde5('0xfc')],{});db['WhatsappTransferReport'][_0xcde5('0x11c')](db[_0xcde5('0xf9')],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db[_0xcde5('0x1fd')][_0xcde5('0x11c')](db[_0xcde5('0xf9')],{'foreignKey':_0xcde5('0x1fe'),'as':'ToAccount'});db[_0xcde5('0x1fd')][_0xcde5('0x11c')](db['WhatsappQueue'],{'foreignKey':'ToQueueId','as':_0xcde5('0x1e6')});db[_0xcde5('0x1fd')][_0xcde5('0x11c')](db['User'],{'foreignKey':_0xcde5('0x1e2'),'as':_0xcde5('0x1e3')});db[_0xcde5('0x1fd')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'foreignKey':_0xcde5('0x1ec'),'as':_0xcde5('0x1e4')});db[_0xcde5('0x102')][_0xcde5('0x11e')](db[_0xcde5('0x11')],{'as':'Agents','through':_0xcde5('0x3b'),'foreignKey':_0xcde5('0x1ff')});db['WhatsappQueue'][_0xcde5('0x11e')](db[_0xcde5('0xe0')],{'through':_0xcde5('0x200'),'as':_0xcde5('0x14d')});db[_0xcde5('0x10b')][_0xcde5('0x11c')](db[_0xcde5('0x11')],{'as':_0xcde5('0x201'),'foreignKey':_0xcde5('0x10a'),'onDelete':_0xcde5('0x10d'),'hooks':!![]});db['CloudProvider']['hasOne'](db[_0xcde5('0x1d4')],{'as':'Dynamics365Account','onDelete':_0xcde5('0x15c')});db[_0xcde5('0x15a')][_0xcde5('0x109')](db[_0xcde5('0x159')],{'as':_0xcde5('0x15e'),'onDelete':'restrict'});db[_0xcde5('0x15a')][_0xcde5('0x109')](db[_0xcde5('0x15d')],{'as':_0xcde5('0x15f'),'onDelete':_0xcde5('0x15c')});module[_0xcde5('0x202')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index e9bb3ff..15bad24 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a36=['./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/user-settings','./api/user-setting','./api/authLocal','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','./api/pm2','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','/index.html','path','express','./config/environment','./utils/client-side-logger','setupLoggers','then','use','/api/users','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/interactions','./api/chatInteraction','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x8a36,0xbe));var _0x68a3=function(_0x1cb000,_0x52ad31){_0x1cb000=_0x1cb000-0x0;var _0x558e01=_0x8a36[_0x1cb000];return _0x558e01;};'use strict';var path=require(_0x68a3('0x0'));var express=require(_0x68a3('0x1'));var errors=require('./errors');var config=require(_0x68a3('0x2'));var setupLoggers=require(_0x68a3('0x3'))[_0x68a3('0x4')];var clientSideLogs=require('./api/client-side-logs');exports['default']=function(_0x145037){return setupLoggers(_0x145037)[_0x68a3('0x5')](function(){_0x145037[_0x68a3('0x6')](_0x68a3('0x7'),require('./api/user'));_0x145037[_0x68a3('0x6')](_0x68a3('0x8'),require(_0x68a3('0x9')));_0x145037[_0x68a3('0x6')]('/api/voice/contexts',require(_0x68a3('0xa')));_0x145037[_0x68a3('0x6')](_0x68a3('0xb'),require('./api/voiceExtension'));_0x145037[_0x68a3('0x6')](_0x68a3('0xc'),require(_0x68a3('0xd')));_0x145037[_0x68a3('0x6')]('/api/voice/queues',require(_0x68a3('0xe')));_0x145037[_0x68a3('0x6')](_0x68a3('0xf'),require(_0x68a3('0x10')));_0x145037[_0x68a3('0x6')](_0x68a3('0x11'),require(_0x68a3('0x12')));_0x145037[_0x68a3('0x6')](_0x68a3('0x13'),require(_0x68a3('0x14')));_0x145037[_0x68a3('0x6')](_0x68a3('0x15'),require(_0x68a3('0x16')));_0x145037[_0x68a3('0x6')](_0x68a3('0x17'),require('./api/voiceCallReport'));_0x145037[_0x68a3('0x6')](_0x68a3('0x18'),require(_0x68a3('0x19')));_0x145037[_0x68a3('0x6')](_0x68a3('0x1a'),require(_0x68a3('0x1b')));_0x145037[_0x68a3('0x6')](_0x68a3('0x1c'),require(_0x68a3('0x1d')));_0x145037[_0x68a3('0x6')](_0x68a3('0x1e'),require(_0x68a3('0x1f')));_0x145037['use'](_0x68a3('0x20'),require(_0x68a3('0x21')));_0x145037[_0x68a3('0x6')](_0x68a3('0x22'),require(_0x68a3('0x23')));_0x145037['use'](_0x68a3('0x24'),require('./api/mailServerOut'));_0x145037[_0x68a3('0x6')](_0x68a3('0x25'),require(_0x68a3('0x26')));_0x145037['use'](_0x68a3('0x27'),require(_0x68a3('0x28')));_0x145037[_0x68a3('0x6')](_0x68a3('0x29'),require(_0x68a3('0x2a')));_0x145037[_0x68a3('0x6')](_0x68a3('0x2b'),require(_0x68a3('0x2c')));_0x145037[_0x68a3('0x6')](_0x68a3('0x2d'),require(_0x68a3('0x2e')));_0x145037[_0x68a3('0x6')]('/api/mail/applications',require(_0x68a3('0x2f')));_0x145037[_0x68a3('0x6')](_0x68a3('0x30'),require(_0x68a3('0x31')));_0x145037[_0x68a3('0x6')](_0x68a3('0x32'),require(_0x68a3('0x33')));_0x145037['use']('/api/dashboards/items',require(_0x68a3('0x34')));_0x145037[_0x68a3('0x6')](_0x68a3('0x35'),require(_0x68a3('0x36')));_0x145037[_0x68a3('0x6')](_0x68a3('0x37'),require(_0x68a3('0x38')));_0x145037['use'](_0x68a3('0x39'),require(_0x68a3('0x3a')));_0x145037['use']('/api/fax/messages',require('./api/faxMessage'));_0x145037['use']('/api/fax/queues',require(_0x68a3('0x3b')));_0x145037[_0x68a3('0x6')](_0x68a3('0x3c'),require(_0x68a3('0x3d')));_0x145037['use'](_0x68a3('0x3e'),require('./api/smsAccount'));_0x145037[_0x68a3('0x6')](_0x68a3('0x3f'),require('./api/smsApplication'));_0x145037[_0x68a3('0x6')](_0x68a3('0x40'),require(_0x68a3('0x41')));_0x145037[_0x68a3('0x6')](_0x68a3('0x42'),require(_0x68a3('0x43')));_0x145037[_0x68a3('0x6')](_0x68a3('0x44'),require('./api/smsQueue'));_0x145037[_0x68a3('0x6')](_0x68a3('0x45'),require(_0x68a3('0x46')));_0x145037[_0x68a3('0x6')](_0x68a3('0x47'),require('./api/openchannelApplication'));_0x145037[_0x68a3('0x6')](_0x68a3('0x48'),require(_0x68a3('0x49')));_0x145037['use'](_0x68a3('0x4a'),require(_0x68a3('0x4b')));_0x145037[_0x68a3('0x6')](_0x68a3('0x4c'),require(_0x68a3('0x4d')));_0x145037[_0x68a3('0x6')](_0x68a3('0x4e'),require('./api/chatWebsite'));_0x145037[_0x68a3('0x6')](_0x68a3('0x4f'),require(_0x68a3('0x50')));_0x145037['use']('/api/chat/applications',require('./api/chatApplication'));_0x145037['use'](_0x68a3('0x51'),require(_0x68a3('0x52')));_0x145037[_0x68a3('0x6')]('/api/chat/messages',require('./api/chatMessage'));_0x145037['use']('/api/chat/offline_messages',require(_0x68a3('0x53')));_0x145037['use']('/api/chat/queues',require(_0x68a3('0x54')));_0x145037[_0x68a3('0x6')](_0x68a3('0x55'),require(_0x68a3('0x56')));_0x145037[_0x68a3('0x6')](_0x68a3('0x57'),require(_0x68a3('0x58')));_0x145037['use'](_0x68a3('0x59'),require(_0x68a3('0x5a')));_0x145037[_0x68a3('0x6')](_0x68a3('0x5b'),require('./api/cmContact'));_0x145037[_0x68a3('0x6')](_0x68a3('0x5c'),require(_0x68a3('0x5d')));_0x145037['use'](_0x68a3('0x5e'),require(_0x68a3('0x5f')));_0x145037[_0x68a3('0x6')](_0x68a3('0x60'),require(_0x68a3('0x61')));_0x145037['use'](_0x68a3('0x62'),require(_0x68a3('0x63')));_0x145037[_0x68a3('0x6')](_0x68a3('0x64'),require(_0x68a3('0x65')));_0x145037[_0x68a3('0x6')](_0x68a3('0x66'),require(_0x68a3('0x67')));_0x145037[_0x68a3('0x6')](_0x68a3('0x68'),require('./api/automation'));_0x145037['use'](_0x68a3('0x69'),require(_0x68a3('0x6a')));_0x145037['use']('/api/dispositions',require(_0x68a3('0x6b')));_0x145037[_0x68a3('0x6')](_0x68a3('0x6c'),require('./api/condition'));_0x145037[_0x68a3('0x6')](_0x68a3('0x6d'),require(_0x68a3('0x6e')));_0x145037[_0x68a3('0x6')](_0x68a3('0x6f'),require('./api/pause'));_0x145037[_0x68a3('0x6')]('/api/cdr',require(_0x68a3('0x70')));_0x145037[_0x68a3('0x6')](_0x68a3('0x71'),require(_0x68a3('0x72')));_0x145037['use'](_0x68a3('0x73'),require(_0x68a3('0x74')));_0x145037[_0x68a3('0x6')]('/api/sounds',require(_0x68a3('0x75')));_0x145037[_0x68a3('0x6')](_0x68a3('0x76'),require(_0x68a3('0x77')));_0x145037['use'](_0x68a3('0x78'),require(_0x68a3('0x79')));_0x145037[_0x68a3('0x6')](_0x68a3('0x7a'),require(_0x68a3('0x7b')));_0x145037[_0x68a3('0x6')](_0x68a3('0x7c'),require(_0x68a3('0x7d')));_0x145037[_0x68a3('0x6')](_0x68a3('0x7e'),require(_0x68a3('0x7f')));_0x145037[_0x68a3('0x6')](_0x68a3('0x80'),require(_0x68a3('0x81')));_0x145037[_0x68a3('0x6')](_0x68a3('0x82'),require(_0x68a3('0x83')));_0x145037[_0x68a3('0x6')](_0x68a3('0x84'),require(_0x68a3('0x85')));_0x145037[_0x68a3('0x6')](_0x68a3('0x86'),require('./api/integrationReport'));_0x145037[_0x68a3('0x6')](_0x68a3('0x87'),require('./api/analyticCustomReport'));_0x145037[_0x68a3('0x6')](_0x68a3('0x88'),require(_0x68a3('0x89')));_0x145037[_0x68a3('0x6')](_0x68a3('0x8a'),require(_0x68a3('0x8b')));_0x145037[_0x68a3('0x6')](_0x68a3('0x8c'),require(_0x68a3('0x8d')));_0x145037[_0x68a3('0x6')](_0x68a3('0x8e'),require(_0x68a3('0x8f')));_0x145037[_0x68a3('0x6')](_0x68a3('0x90'),require(_0x68a3('0x91')));_0x145037['use'](_0x68a3('0x92'),require(_0x68a3('0x93')));_0x145037[_0x68a3('0x6')]('/api/integrations/salesforce/configurations',require(_0x68a3('0x94')));_0x145037[_0x68a3('0x6')](_0x68a3('0x95'),require(_0x68a3('0x96')));_0x145037[_0x68a3('0x6')](_0x68a3('0x97'),require(_0x68a3('0x98')));_0x145037[_0x68a3('0x6')](_0x68a3('0x99'),require('./api/intSugarcrmConfiguration'));_0x145037[_0x68a3('0x6')](_0x68a3('0x9a'),require(_0x68a3('0x9b')));_0x145037[_0x68a3('0x6')](_0x68a3('0x9c'),require('./api/intDeskAccount'));_0x145037[_0x68a3('0x6')](_0x68a3('0x9d'),require(_0x68a3('0x9e')));_0x145037[_0x68a3('0x6')](_0x68a3('0x9f'),require(_0x68a3('0xa0')));_0x145037[_0x68a3('0x6')](_0x68a3('0xa1'),require('./api/intZohoAccount'));_0x145037[_0x68a3('0x6')](_0x68a3('0xa2'),require(_0x68a3('0xa3')));_0x145037[_0x68a3('0x6')](_0x68a3('0xa4'),require(_0x68a3('0xa5')));_0x145037[_0x68a3('0x6')](_0x68a3('0xa6'),require(_0x68a3('0xa7')));_0x145037[_0x68a3('0x6')]('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x145037[_0x68a3('0x6')](_0x68a3('0xa8'),require(_0x68a3('0xa9')));_0x145037[_0x68a3('0x6')](_0x68a3('0xaa'),require(_0x68a3('0xab')));_0x145037[_0x68a3('0x6')](_0x68a3('0xac'),require(_0x68a3('0xad')));_0x145037[_0x68a3('0x6')]('/api/integrations/freshdesk/fields',require(_0x68a3('0xae')));_0x145037[_0x68a3('0x6')](_0x68a3('0xaf'),require(_0x68a3('0xb0')));_0x145037[_0x68a3('0x6')](_0x68a3('0xb1'),require('./api/intVtigerConfiguration'));_0x145037[_0x68a3('0x6')](_0x68a3('0xb2'),require('./api/intVtigerField'));_0x145037[_0x68a3('0x6')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x145037['use']('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x145037[_0x68a3('0x6')](_0x68a3('0xb3'),require(_0x68a3('0xb4')));_0x145037[_0x68a3('0x6')](_0x68a3('0xb5'),require('./api/intDynamics365Account'));_0x145037['use'](_0x68a3('0xb6'),require(_0x68a3('0xb7')));_0x145037[_0x68a3('0x6')](_0x68a3('0xb8'),require(_0x68a3('0xb9')));_0x145037[_0x68a3('0x6')]('/api/integrations/freshsales/accounts',require(_0x68a3('0xba')));_0x145037['use'](_0x68a3('0xbb'),require(_0x68a3('0xbc')));_0x145037['use']('/api/integrations/freshsales/fields',require(_0x68a3('0xbd')));_0x145037[_0x68a3('0x6')](_0x68a3('0xbe'),require(_0x68a3('0xbf')));_0x145037[_0x68a3('0x6')](_0x68a3('0xc0'),require(_0x68a3('0xc1')));_0x145037[_0x68a3('0x6')](_0x68a3('0xc2'),require(_0x68a3('0xc3')));_0x145037[_0x68a3('0x6')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x145037[_0x68a3('0x6')](_0x68a3('0xc4'),require(_0x68a3('0xc5')));_0x145037[_0x68a3('0x6')](_0x68a3('0xc6'),require(_0x68a3('0xc7')));_0x145037[_0x68a3('0x6')](_0x68a3('0xc8'),require(_0x68a3('0xc9')));_0x145037['use'](_0x68a3('0xca'),require(_0x68a3('0xcb')));_0x145037[_0x68a3('0x6')](_0x68a3('0xcc'),require(_0x68a3('0xcd')));_0x145037[_0x68a3('0x6')](_0x68a3('0xce'),require(_0x68a3('0xcf')));_0x145037[_0x68a3('0x6')](_0x68a3('0xd0'),require(_0x68a3('0xd1')));_0x145037[_0x68a3('0x6')](_0x68a3('0xd2'),require(_0x68a3('0xd3')));_0x145037[_0x68a3('0x6')](_0x68a3('0xd4'),require(_0x68a3('0xd5')));_0x145037[_0x68a3('0x6')](_0x68a3('0xd6'),require(_0x68a3('0xd7')));_0x145037['use'](_0x68a3('0xd8'),require(_0x68a3('0xd9')));_0x145037['use'](_0x68a3('0xda'),require(_0x68a3('0xdb')));_0x145037[_0x68a3('0x6')](_0x68a3('0xdc'),require(_0x68a3('0xdd')));_0x145037[_0x68a3('0x6')](_0x68a3('0xde'),require(_0x68a3('0xdf')));_0x145037[_0x68a3('0x6')](_0x68a3('0xe0'),require(_0x68a3('0xe1')));_0x145037['use'](_0x68a3('0xe2'),require(_0x68a3('0xe3')));_0x145037[_0x68a3('0x6')](_0x68a3('0xe4'),require(_0x68a3('0xe5')));_0x145037['use']('/api/mail/reports/transfer',require(_0x68a3('0xe6')));_0x145037[_0x68a3('0x6')](_0x68a3('0xe7'),require(_0x68a3('0xe8')));_0x145037[_0x68a3('0x6')](_0x68a3('0xe9'),require(_0x68a3('0xea')));_0x145037[_0x68a3('0x6')]('/api/openchannel/reports/transfer',require(_0x68a3('0xeb')));_0x145037[_0x68a3('0x6')](_0x68a3('0xec'),require(_0x68a3('0xed')));_0x145037[_0x68a3('0x6')]('/api/cm/lists',require('./api/cmList'));_0x145037[_0x68a3('0x6')](_0x68a3('0xee'),require(_0x68a3('0xef')));_0x145037[_0x68a3('0x6')]('/api/userProfiles',require(_0x68a3('0xf0')));_0x145037[_0x68a3('0x6')](_0x68a3('0xf1'),require('./api/userProfileSection'));_0x145037[_0x68a3('0x6')](_0x68a3('0xf2'),require('./api/userProfileResource'));_0x145037[_0x68a3('0x6')](_0x68a3('0xf3'),require(_0x68a3('0xf4')));_0x145037[_0x68a3('0x6')](_0x68a3('0xf5'),require('./api/whatsappAccount'));_0x145037[_0x68a3('0x6')]('/api/whatsapp/applications',require(_0x68a3('0xf6')));_0x145037['use']('/api/whatsapp/interactions',require(_0x68a3('0xf7')));_0x145037[_0x68a3('0x6')](_0x68a3('0xf8'),require('./api/whatsappMessage'));_0x145037['use'](_0x68a3('0xf9'),require(_0x68a3('0xfa')));_0x145037['use'](_0x68a3('0xfb'),require(_0x68a3('0xfc')));_0x145037[_0x68a3('0x6')](_0x68a3('0xfd'),require(_0x68a3('0xfe')));_0x145037[_0x68a3('0x6')](_0x68a3('0xff'),require(_0x68a3('0x100')));_0x145037[_0x68a3('0x6')]('/api/realtime',require(_0x68a3('0x101')));_0x145037['use'](_0x68a3('0x102'),require(_0x68a3('0x103')));_0x145037[_0x68a3('0x6')]('/api/auth/local',require(_0x68a3('0x104')));_0x145037[_0x68a3('0x6')](_0x68a3('0x105'),require(_0x68a3('0x106')));_0x145037[_0x68a3('0x6')]('/api/auth/activedirectory',require(_0x68a3('0x107')));_0x145037[_0x68a3('0x6')](_0x68a3('0x108'),require(_0x68a3('0x109')));_0x145037[_0x68a3('0x6')](_0x68a3('0x10a'),require(_0x68a3('0x10b')));_0x145037[_0x68a3('0x6')]('/api/version',require(_0x68a3('0x10c')));_0x145037[_0x68a3('0x6')](_0x68a3('0x10d'),require(_0x68a3('0x10e')));_0x145037[_0x68a3('0x6')]('/api/pm2',require(_0x68a3('0x10f')));_0x145037['use']('/api/webbar',require('./api/webbar'));_0x145037[_0x68a3('0x6')](_0x68a3('0x110'),clientSideLogs);_0x145037['use'](_0x68a3('0x111'),express[_0x68a3('0x112')](path[_0x68a3('0x113')](config[_0x68a3('0x114')],_0x68a3('0x111'))));_0x145037[_0x68a3('0x6')]('/www',express[_0x68a3('0x112')](path[_0x68a3('0x113')](config[_0x68a3('0x114')],_0x68a3('0x115'))));_0x145037[_0x68a3('0x6')](_0x68a3('0x116'),express['static'](path[_0x68a3('0x113')](config[_0x68a3('0x114')],_0x68a3('0x116'))));_0x145037[_0x68a3('0x6')](_0x68a3('0x117'),express[_0x68a3('0x112')](path['join'](config['root'],_0x68a3('0x118'),'3.1.0')));_0x145037[_0x68a3('0x6')]('/plugins',express['static'](path[_0x68a3('0x113')](config[_0x68a3('0x114')],_0x68a3('0x119'))));_0x145037['route'](_0x68a3('0x11a'))[_0x68a3('0x11b')](errors[0x194]);_0x145037[_0x68a3('0x11c')]('/*')['get'](function(_0x499ee9,_0x4e890f){_0x4e890f[_0x68a3('0x11d')](path['resolve'](_0x145037['get']('appPath')+_0x68a3('0x11e')));});return _0x145037;});}; \ No newline at end of file +var _0x647b=['/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./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/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','./api/pause','/api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','/api/templates','./api/template','/api/triggers','/api/variables','/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/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/cloudProviders','./api/cloudProvider','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','/api/auth/activedirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/system','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','join','static','/demo','root','/snippet','snippet','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','route','resolve','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','default','then','/api/users','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','./api/voiceMusicOnHold','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue'];(function(_0x3365c3,_0x18dc4e){var _0x13cdd6=function(_0x4328a0){while(--_0x4328a0){_0x3365c3['push'](_0x3365c3['shift']());}};_0x13cdd6(++_0x18dc4e);}(_0x647b,0xc7));var _0xb647=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x647b[_0x618414];return _0x21c19a;};'use strict';var path=require(_0xb647('0x0'));var express=require(_0xb647('0x1'));var errors=require(_0xb647('0x2'));var config=require(_0xb647('0x3'));var setupLoggers=require(_0xb647('0x4'))[_0xb647('0x5')];var clientSideLogs=require('./api/client-side-logs');exports[_0xb647('0x6')]=function(_0xb5c18d){return setupLoggers(_0xb5c18d)[_0xb647('0x7')](function(){_0xb5c18d['use'](_0xb647('0x8'),require(_0xb647('0x9')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xb'),require(_0xb647('0xc')));_0xb5c18d[_0xb647('0xa')]('/api/voice/contexts',require(_0xb647('0xd')));_0xb5c18d[_0xb647('0xa')]('/api/voice/extensions',require('./api/voiceExtension'));_0xb5c18d[_0xb647('0xa')]('/api/voice/mohs',require(_0xb647('0xe')));_0xb5c18d[_0xb647('0xa')]('/api/voice/queues',require('./api/voiceQueue'));_0xb5c18d[_0xb647('0xa')]('/api/voice/recordings',require(_0xb647('0xf')));_0xb5c18d['use'](_0xb647('0x10'),require('./api/screenRecording'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x11'),require('./api/voiceMail'));_0xb5c18d['use'](_0xb647('0x12'),require(_0xb647('0x13')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x14'),require('./api/voiceCallReport'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x15'),require(_0xb647('0x16')));_0xb5c18d[_0xb647('0xa')]('/api/voice/agents/reports',require(_0xb647('0x17')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x18'),require(_0xb647('0x19')));_0xb5c18d[_0xb647('0xa')]('/api/members/reports',require(_0xb647('0x1a')));_0xb5c18d['use'](_0xb647('0x1b'),require(_0xb647('0x1c')));_0xb5c18d['use'](_0xb647('0x1d'),require(_0xb647('0x1e')));_0xb5c18d[_0xb647('0xa')]('/api/mail/out_servers',require(_0xb647('0x1f')));_0xb5c18d['use'](_0xb647('0x20'),require(_0xb647('0x21')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x22'),require(_0xb647('0x23')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x24'),require(_0xb647('0x25')));_0xb5c18d[_0xb647('0xa')]('/api/mail/interactions',require(_0xb647('0x26')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x27'),require('./api/mailMessage'));_0xb5c18d['use'](_0xb647('0x28'),require(_0xb647('0x29')));_0xb5c18d['use'](_0xb647('0x2a'),require(_0xb647('0x2b')));_0xb5c18d[_0xb647('0xa')]('/api/dashboards',require(_0xb647('0x2c')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x2d'),require(_0xb647('0x2e')));_0xb5c18d['use'](_0xb647('0x2f'),require('./api/faxAccount'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x30'),require(_0xb647('0x31')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x32'),require(_0xb647('0x33')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x34'),require('./api/faxMessage'));_0xb5c18d[_0xb647('0xa')]('/api/fax/queues',require(_0xb647('0x35')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x36'),require('./api/faxQueueReport'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x37'),require(_0xb647('0x38')));_0xb5c18d['use']('/api/sms/applications',require(_0xb647('0x39')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x3a'),require(_0xb647('0x3b')));_0xb5c18d['use'](_0xb647('0x3c'),require('./api/smsMessage'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x3d'),require(_0xb647('0x3e')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x3f'),require(_0xb647('0x40')));_0xb5c18d['use']('/api/openchannel/applications',require(_0xb647('0x41')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x42'),require(_0xb647('0x43')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x44'),require(_0xb647('0x45')));_0xb5c18d['use'](_0xb647('0x46'),require(_0xb647('0x47')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x48'),require('./api/chatWebsite'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x49'),require(_0xb647('0x4a')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x4b'),require(_0xb647('0x4c')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x4d'),require(_0xb647('0x4e')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x4f'),require(_0xb647('0x50')));_0xb5c18d['use'](_0xb647('0x51'),require(_0xb647('0x52')));_0xb5c18d[_0xb647('0xa')]('/api/chat/queues',require('./api/chatQueue'));_0xb5c18d[_0xb647('0xa')]('/api/chat/groups',require(_0xb647('0x53')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x54'),require('./api/chatProactiveAction'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x55'),require(_0xb647('0x56')));_0xb5c18d['use'](_0xb647('0x57'),require(_0xb647('0x58')));_0xb5c18d['use'](_0xb647('0x59'),require(_0xb647('0x5a')));_0xb5c18d['use']('/api/cm/hopper_black',require(_0xb647('0x5b')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x5c'),require(_0xb647('0x5d')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x5e'),require(_0xb647('0x5f')));_0xb5c18d['use'](_0xb647('0x60'),require(_0xb647('0x61')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x62'),require('./api/action'));_0xb5c18d[_0xb647('0xa')]('/api/automations',require(_0xb647('0x63')));_0xb5c18d[_0xb647('0xa')]('/api/canned_answers',require(_0xb647('0x64')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x65'),require(_0xb647('0x66')));_0xb5c18d[_0xb647('0xa')]('/api/conditions',require(_0xb647('0x67')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x68'),require(_0xb647('0x69')));_0xb5c18d['use']('/api/pauses',require(_0xb647('0x6a')));_0xb5c18d[_0xb647('0xa')]('/api/cdr',require('./api/cdr'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x6b'),require('./api/voiceQueuesLog'));_0xb5c18d['use'](_0xb647('0x6c'),require('./api/schedule'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x6d'),require(_0xb647('0x6e')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x6f'),require(_0xb647('0x70')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x71'),require('./api/contactItemType'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x72'),require(_0xb647('0x73')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x74'),require('./api/cmHopperAdditionalPhone'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x75'),require(_0xb647('0x76')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x77'),require('./api/trigger'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x78'),require('./api/variable'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x79'),require(_0xb647('0x7a')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x7b'),require('./api/integrationReport'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x7c'),require(_0xb647('0x7d')));_0xb5c18d['use'](_0xb647('0x7e'),require(_0xb647('0x7f')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x80'),require(_0xb647('0x81')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x82'),require(_0xb647('0x83')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x84'),require(_0xb647('0x85')));_0xb5c18d['use'](_0xb647('0x86'),require(_0xb647('0x87')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x88'),require(_0xb647('0x89')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x8a'),require(_0xb647('0x8b')));_0xb5c18d['use'](_0xb647('0x8c'),require(_0xb647('0x8d')));_0xb5c18d[_0xb647('0xa')]('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0xb5c18d[_0xb647('0xa')]('/api/integrations/sugarcrm/configurations',require(_0xb647('0x8e')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x8f'),require(_0xb647('0x90')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x91'),require(_0xb647('0x92')));_0xb5c18d['use'](_0xb647('0x93'),require('./api/intDeskConfiguration'));_0xb5c18d['use'](_0xb647('0x94'),require(_0xb647('0x95')));_0xb5c18d[_0xb647('0xa')]('/api/integrations/zoho/accounts',require(_0xb647('0x96')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x97'),require(_0xb647('0x98')));_0xb5c18d['use'](_0xb647('0x99'),require(_0xb647('0x9a')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x9b'),require(_0xb647('0x9c')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x9d'),require('./api/intZendeskConfiguration'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x9e'),require('./api/intZendeskField'));_0xb5c18d[_0xb647('0xa')](_0xb647('0x9f'),require(_0xb647('0xa0')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xa1'),require(_0xb647('0xa2')));_0xb5c18d['use'](_0xb647('0xa3'),require(_0xb647('0xa4')));_0xb5c18d['use'](_0xb647('0xa5'),require(_0xb647('0xa6')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xa7'),require('./api/intVtigerConfiguration'));_0xb5c18d[_0xb647('0xa')](_0xb647('0xa8'),require(_0xb647('0xa9')));_0xb5c18d[_0xb647('0xa')]('/api/integrations/servicenow/accounts',require(_0xb647('0xaa')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xab'),require(_0xb647('0xac')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xad'),require(_0xb647('0xae')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xaf'),require(_0xb647('0xb0')));_0xb5c18d['use'](_0xb647('0xb1'),require('./api/intDynamics365Configuration'));_0xb5c18d[_0xb647('0xa')](_0xb647('0xb2'),require(_0xb647('0xb3')));_0xb5c18d['use']('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0xb5c18d[_0xb647('0xa')]('/api/integrations/freshsales/configurations',require(_0xb647('0xb4')));_0xb5c18d['use']('/api/integrations/freshsales/fields',require(_0xb647('0xb5')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xb6'),require(_0xb647('0xb7')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xb8'),require(_0xb647('0xb9')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xba'),require(_0xb647('0xbb')));_0xb5c18d[_0xb647('0xa')]('/api/jscripty/answers/reports',require(_0xb647('0xbc')));_0xb5c18d['use']('/api/jscripty/questions/reports',require(_0xb647('0xbd')));_0xb5c18d[_0xb647('0xa')]('/api/jscripty/sessions/reports',require(_0xb647('0xbe')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xbf'),require(_0xb647('0xc0')));_0xb5c18d['use']('/api/square/reports',require(_0xb647('0xc1')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xc2'),require(_0xb647('0xc3')));_0xb5c18d['use'](_0xb647('0xc4'),require(_0xb647('0xc5')));_0xb5c18d[_0xb647('0xa')]('/api/settings',require(_0xb647('0xc6')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xc7'),require(_0xb647('0xc8')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xc9'),require('./api/squareProject'));_0xb5c18d['use'](_0xb647('0xca'),require(_0xb647('0xcb')));_0xb5c18d['use'](_0xb647('0xcc'),require('./api/squareMessage'));_0xb5c18d[_0xb647('0xa')](_0xb647('0xcd'),require(_0xb647('0xce')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xcf'),require('./api/license'));_0xb5c18d[_0xb647('0xa')](_0xb647('0xd0'),require(_0xb647('0xd1')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xd2'),require('./api/migration'));_0xb5c18d[_0xb647('0xa')](_0xb647('0xd3'),require(_0xb647('0xd4')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xd5'),require(_0xb647('0xd6')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xd7'),require(_0xb647('0xd8')));_0xb5c18d['use']('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0xb5c18d[_0xb647('0xa')](_0xb647('0xd9'),require(_0xb647('0xda')));_0xb5c18d['use'](_0xb647('0xdb'),require(_0xb647('0xdc')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xdd'),require(_0xb647('0xde')));_0xb5c18d['use'](_0xb647('0xdf'),require(_0xb647('0xe0')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xe1'),require(_0xb647('0xe2')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xe3'),require('./api/userProfile'));_0xb5c18d['use']('/api/userProfile/sections',require(_0xb647('0xe4')));_0xb5c18d['use'](_0xb647('0xe5'),require(_0xb647('0xe6')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xe7'),require(_0xb647('0xe8')));_0xb5c18d['use'](_0xb647('0xe9'),require('./api/whatsappAccount'));_0xb5c18d[_0xb647('0xa')](_0xb647('0xea'),require('./api/whatsappApplication'));_0xb5c18d[_0xb647('0xa')]('/api/whatsapp/interactions',require('./api/whatsappInteraction'));_0xb5c18d['use'](_0xb647('0xeb'),require(_0xb647('0xec')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xed'),require('./api/whatsappQueueReport'));_0xb5c18d[_0xb647('0xa')](_0xb647('0xee'),require(_0xb647('0xef')));_0xb5c18d[_0xb647('0xa')]('/api/whatsapp/queues',require('./api/whatsappQueue'));_0xb5c18d['use'](_0xb647('0xf0'),require(_0xb647('0xf1')));_0xb5c18d[_0xb647('0xa')]('/api/realtime',require('./api/realtime'));_0xb5c18d[_0xb647('0xa')](_0xb647('0xf2'),require(_0xb647('0xf3')));_0xb5c18d['use'](_0xb647('0xf4'),require(_0xb647('0xf5')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xf6'),require('./api/authGoogle'));_0xb5c18d['use'](_0xb647('0xf7'),require('./api/authActiveDirectory'));_0xb5c18d[_0xb647('0xa')](_0xb647('0xf8'),require(_0xb647('0xf9')));_0xb5c18d['use'](_0xb647('0xfa'),require(_0xb647('0xfb')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xfc'),require('./api/version'));_0xb5c18d[_0xb647('0xa')]('/api/system',require(_0xb647('0xfd')));_0xb5c18d[_0xb647('0xa')]('/api/pm2',require(_0xb647('0xfe')));_0xb5c18d[_0xb647('0xa')](_0xb647('0xff'),require(_0xb647('0x100')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x101'),clientSideLogs);_0xb5c18d['use'](_0xb647('0x102'),express['static'](path[_0xb647('0x103')](config['root'],'/apidoc')));_0xb5c18d['use']('/www',express[_0xb647('0x104')](path[_0xb647('0x103')](config['root'],'/www')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x105'),express[_0xb647('0x104')](path[_0xb647('0x103')](config[_0xb647('0x106')],_0xb647('0x105'))));_0xb5c18d[_0xb647('0xa')](_0xb647('0x107'),express[_0xb647('0x104')](path[_0xb647('0x103')](config[_0xb647('0x106')],_0xb647('0x108'),'3.1.0')));_0xb5c18d[_0xb647('0xa')](_0xb647('0x109'),express['static'](path[_0xb647('0x103')](config['root'],_0xb647('0x10a'))));_0xb5c18d['route'](_0xb647('0x10b'))['get'](errors[0x194]);_0xb5c18d[_0xb647('0x10c')]('/*')['get'](function(_0x36294f,_0x357b16){_0x357b16['sendFile'](path[_0xb647('0x10d')](_0xb5c18d['get']('appPath')+_0xb647('0x10e')));});return _0xb5c18d;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index d68ff6a..b20f6b3 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0c42=['../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','port','rpc','localhost','error','log','../config/triggers','default','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc'];(function(_0x1e6579,_0x595c18){var _0x2f8541=function(_0x25e888){while(--_0x25e888){_0x1e6579['push'](_0x1e6579['shift']());}};_0x2f8541(++_0x595c18);}(_0x0c42,0x191));var _0x20c4=function(_0x1bcbb5,_0x578704){_0x1bcbb5=_0x1bcbb5-0x0;var _0x422c0d=_0x0c42[_0x1bcbb5];return _0x422c0d;};'use strict';var jayson=require(_0x20c4('0x0'));var _=require(_0x20c4('0x1'));var config=require(_0x20c4('0x2'));exports[_0x20c4('0x3')]=function(){return new Promise(function(_0xe6959,_0x5810aa){var _0x5d686d={};_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x5')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x6')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/voiceQueue/voiceQueue.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/voiceRecording/voiceRecording.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x7')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x8')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x9')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0xa')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0xb')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0xc')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0xd')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/mailAccount/mailAccount.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/mailQueue/mailQueue.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0xe')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0xf')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x10')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x11')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x12')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x13')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x14')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x15')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x16')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x17')));_0x5d686d=_['merge'](_0x5d686d,require('../api/smsAccount/smsAccount.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/smsInteraction/smsInteraction.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x18')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x19')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x1a')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x1b')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x1c')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x1d')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x1e')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x1f')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x20')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x21')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x22')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x23')));_0x5d686d=_['merge'](_0x5d686d,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x24')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x25')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x26')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x27')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x28')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x29')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x2a')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x2b')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/variable/variable.rpc'));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x2c')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x2d')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x2e')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x2f')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x30')));_0x5d686d=_['merge'](_0x5d686d,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x5d686d=_['merge'](_0x5d686d,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x31')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x32')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x33')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/squareReport/squareReport.rpc'));_0x5d686d=_['merge'](_0x5d686d,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x34')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x35')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x36')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x37')));_0x5d686d=_['merge'](_0x5d686d,require('../api/squareMessage/squareMessage.rpc'));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x38')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x39')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x3a')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x3b')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x3c')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x3d')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x3e')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x3f')));var _0x45d795=jayson[_0x20c4('0x40')](_0x5d686d)['http']();var _0xf6ee5d=config['rpc'][_0x20c4('0x41')]||config[_0x20c4('0x41')]+0x1;var _0x32fdba=config[_0x20c4('0x42')]['ip']||_0x20c4('0x43');_0x45d795['on'](_0x20c4('0x44'),function(_0x2f3e06){return _0x5810aa(_0x2f3e06);});_0x45d795[_0x20c4('0x3')](_0xf6ee5d,_0x32fdba,function(){console[_0x20c4('0x45')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x32fdba,_0xf6ee5d);require(_0x20c4('0x46'))[_0x20c4('0x47')]();return _0xe6959('RPC\x20listening\x20on\x20'+_0x32fdba+':'+_0xf6ee5d);});});}; \ No newline at end of file +var _0x34e9=['../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','port','localhost','error','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc'];(function(_0x5d5770,_0x28ba90){var _0x2e2301=function(_0x2bd5bb){while(--_0x2bd5bb){_0x5d5770['push'](_0x5d5770['shift']());}};_0x2e2301(++_0x28ba90);}(_0x34e9,0x167));var _0x934e=function(_0x1c92f8,_0x337c6e){_0x1c92f8=_0x1c92f8-0x0;var _0x39dd8a=_0x34e9[_0x1c92f8];return _0x39dd8a;};'use strict';var jayson=require(_0x934e('0x0'));var _=require(_0x934e('0x1'));var config=require(_0x934e('0x2'));exports[_0x934e('0x3')]=function(){return new Promise(function(_0x5056b1,_0x3c9b9b){var _0x348b12={};_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x5')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/voiceExtension/voiceExtension.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x6')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/voiceRecording/voiceRecording.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x7')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x8')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x9')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0xa')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0xb')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0xc')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0xd')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0xe')));_0x348b12=_['merge'](_0x348b12,require(_0x934e('0xf')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x10')));_0x348b12=_['merge'](_0x348b12,require(_0x934e('0x11')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/mailMessage/mailMessage.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x12')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x13')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x14')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x15')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x16')));_0x348b12=_['merge'](_0x348b12,require(_0x934e('0x17')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/faxQueue/faxQueue.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x18')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x19')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x1a')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x1b')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/smsQueue/smsQueue.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x1c')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x1d')));_0x348b12=_['merge'](_0x348b12,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x348b12=_['merge'](_0x348b12,require(_0x934e('0x1e')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x1f')));_0x348b12=_['merge'](_0x348b12,require(_0x934e('0x20')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/chatQueue/chatQueue.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x21')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x22')));_0x348b12=_['merge'](_0x348b12,require(_0x934e('0x23')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x24')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x25')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/interval/interval.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x26')));_0x348b12=_['merge'](_0x348b12,require(_0x934e('0x27')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x28')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/template/template.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x29')));_0x348b12=_['merge'](_0x348b12,require(_0x934e('0x2a')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x2b')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x2c')));_0x348b12=_['merge'](_0x348b12,require(_0x934e('0x2d')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x2e')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x2f')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x30')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x31')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x32')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x33')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x34')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x35')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x348b12=_['merge'](_0x348b12,require('../api/setting/setting.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/squareOdbc/squareOdbc.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x36')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/squareRecording/squareRecording.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x37')));_0x348b12=_['merge'](_0x348b12,require('../api/campaign/campaign.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x38')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/plugin/plugin.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x39')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x3a')));_0x348b12=_[_0x934e('0x4')](_0x348b12,require(_0x934e('0x3b')));var _0x3710eb=jayson[_0x934e('0x3c')](_0x348b12)['http']();var _0x59bedb=config['rpc'][_0x934e('0x3d')]||config[_0x934e('0x3d')]+0x1;var _0x5e0550=config['rpc']['ip']||_0x934e('0x3e');_0x3710eb['on'](_0x934e('0x3f'),function(_0x28fada){return _0x3c9b9b(_0x28fada);});_0x3710eb[_0x934e('0x3')](_0x59bedb,_0x5e0550,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x5e0550,_0x59bedb);require('../config/triggers')[_0x934e('0x40')]();return _0x5056b1(_0x934e('0x41')+_0x5e0550+':'+_0x59bedb);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index ce9e168..c940a85 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 _0x1a54=['SET\x20PRIORITY\x20%s','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayDigits','SAY\x20DIGITS\x20%s\x20%s','continueAt','setContext','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','EventEmitter','./reply','./error','call','utf8','setTimeout','setEncoding','headers','emit','ready','line','toLowerCase','hangup','substring','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','write','prototype','sendRequest','command','sync','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','isArray','join','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','setPriority'];(function(_0x29dadd,_0x26b6e0){var _0x12e802=function(_0x1f149d){while(--_0x1f149d){_0x29dadd['push'](_0x29dadd['shift']());}};_0x12e802(++_0x26b6e0);}(_0x1a54,0x12e));var _0x41a5=function(_0x54f882,_0x4ce7f4){_0x54f882=_0x54f882-0x0;var _0x221326=_0x1a54[_0x54f882];return _0x221326;};'use strict';var util=require(_0x41a5('0x0'));var _=require('lodash');var EventEmitter=require('events')[_0x41a5('0x1')];var AGIReply=require(_0x41a5('0x2'));var AGIError=require(_0x41a5('0x3'));function AGIChannel(_0x5a55b5){var _0x217f68=this,_0x3ba60a=new AGIReply(),_0x39fe63=![],_0x3b3d6e={};EventEmitter[_0x41a5('0x4')](_0x217f68);_0x5a55b5['setEncoding'](_0x41a5('0x5'));_0x5a55b5[_0x41a5('0x6')](0x8*0x3c*0x3c*0x3e8);_0x3ba60a[_0x41a5('0x7')](_0x41a5('0x5'));_0x3ba60a['on'](_0x41a5('0x8'),function(_0x45c3d6){for(var _0x206532 in _0x45c3d6){_0x217f68[_0x206532]=_0x45c3d6[_0x206532];}_0x217f68[_0x41a5('0x9')](_0x41a5('0xa'));});_0x3ba60a['on'](_0x41a5('0xb'),function(_0x29eb80){if(_0x29eb80[_0x41a5('0xc')]()==_0x41a5('0xd')){_0x217f68[_0x41a5('0x9')](_0x41a5('0xd'));return;}if(_0x29eb80[_0x41a5('0xe')](0x0,0xb)=='520-Invalid'){_0x39fe63=!![];}if(_0x39fe63){_0x3b3d6e['rx']+=_0x29eb80+'\x0a';if(_0x29eb80['search'](_0x41a5('0xf'))!=-0x1){_0x39fe63=![];}}else{_0x3b3d6e['rx']=_0x29eb80;}if(_0x39fe63){return;}if(typeof _0x3b3d6e['cb']==_0x41a5('0x10')){var _0x5b8bfe=_0x3b3d6e['rx'][_0x41a5('0xe')](0x0,0x3),_0x3aecdf=null,_0x35954d=null;_0x5b8bfe=parseInt(_0x5b8bfe);if(isNaN(_0x5b8bfe)){_0x3b3d6e['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x41a5('0x11')});return;}if(_0x5b8bfe!=0xc8){_0x3b3d6e['cb'](null,{'code':_0x5b8bfe,'result':-0x1,'extra':'KO'});return;}_0x3aecdf=_0x3b3d6e['rx'][_0x41a5('0xe')](0x4)[_0x41a5('0x12')](_0x41a5('0x13'),'');if(_0x3aecdf['indexOf']('\x20')!=-0x1){_0x3aecdf=_0x3aecdf['substr'](0x0,_0x3aecdf['indexOf']('\x20'));}if(_[_0x41a5('0x14')](_0x3aecdf,'-1')){_0x3aecdf=parseInt(_0x3aecdf);}_0x35954d=_0x3b3d6e['rx'][_0x41a5('0x15')]('\x20');if(_0x35954d[_0x41a5('0x16')]==0x3){_0x35954d=_0x35954d[0x2][_0x41a5('0xe')](0x1,_0x35954d[0x2][_0x41a5('0x16')]-0x1);}else if(_0x35954d[_0x41a5('0x16')]>0x3){var _0x47557b=/\((.+)\)/;var _0x3b7cf7=_0x3b3d6e['rx'][_0x41a5('0x17')](_0x47557b);if(_0x3b7cf7){_0x35954d=_0x3b7cf7[0x1];}else{_0x35954d=null;}}else{_0x35954d=null;}_0x3b3d6e['cb'](null,{'code':_0x5b8bfe,'result':_0x3aecdf,'extra':_0x35954d});}});_0x5a55b5['on'](_0x41a5('0x18'),function(_0x3b4cc8){_0x217f68['emit'](_0x41a5('0x18'),new AGIError(_0x41a5('0x19'),_0x3b4cc8[_0x41a5('0x1a')]));});_0x5a55b5['on'](_0x41a5('0x1b'),function(){_0x217f68[_0x41a5('0x9')](_0x41a5('0x1b'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x5a55b5['on'](_0x41a5('0x1c'),function(){_0x217f68[_0x41a5('0x9')](_0x41a5('0x1c'),new AGIError(_0x41a5('0x1d')));_0x5a55b5[_0x41a5('0x1e')]();});_0x5a55b5['pipe'](_0x3ba60a);this['command']=function(_0x4be7f2,_0x8e2d18){var _0x4be7f2=_0x4be7f2||'',_0x8e2d18=typeof _0x8e2d18==_0x41a5('0x10')?_0x8e2d18:new Function();_0x3b3d6e={'tx':_0x4be7f2,'rx':'','cb':_0x8e2d18};_0x5a55b5[_0x41a5('0x1f')](_0x4be7f2+'\x0a');},this[_0x41a5('0x1b')]=function(){_0x5a55b5[_0x41a5('0x1e')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x41a5('0x20')][_0x41a5('0x21')]=function(_0x1c50db){return this[_0x41a5('0x22')][_0x41a5('0x23')](this,_0x1c50db);};AGIChannel[_0x41a5('0x20')]['answer']=function(){return this[_0x41a5('0x21')](_0x41a5('0x24'));};AGIChannel[_0x41a5('0x20')][_0x41a5('0x25')]=function(_0x5ad479,_0x3553e1,_0x1877ed){_0x5ad479=_0x5ad479===undefined?'beep':_0x5ad479;_0x3553e1=_0x3553e1===undefined?'5':_0x3553e1;_0x1877ed=_0x1877ed===undefined?'1':_0x1877ed;return this[_0x41a5('0x21')](util[_0x41a5('0x26')](_0x41a5('0x27'),_0x5ad479,_0x3553e1*0x3e8,_0x1877ed));};AGIChannel[_0x41a5('0x20')][_0x41a5('0x28')]=function(_0x24fd01){_0x24fd01=_0x24fd01||'NO\x20MESSAGE';return this[_0x41a5('0x21')](util[_0x41a5('0x26')](_0x41a5('0x29'),_0x24fd01));};AGIChannel[_0x41a5('0x20')]['exec']=function(_0x30943f,_0x35f713){if(_[_0x41a5('0x2a')](_0x35f713)){return this[_0x41a5('0x21')](util['format']('EXEC\x20%s\x20%s',_0x30943f,_0x35f713[_0x41a5('0x2b')](',')));}return this[_0x41a5('0x21')](util[_0x41a5('0x26')](_0x41a5('0x2c'),_0x30943f,_0x35f713));};AGIChannel['prototype']['setContext']=function(_0x388e4d){return this[_0x41a5('0x21')](util[_0x41a5('0x26')](_0x41a5('0x2d'),_0x388e4d));};AGIChannel[_0x41a5('0x20')][_0x41a5('0x2e')]=function(_0x55776d){return this[_0x41a5('0x21')](util[_0x41a5('0x26')]('SET\x20EXTENSION\x20%s',_0x55776d));};AGIChannel['prototype'][_0x41a5('0x2f')]=function(_0x401b06){return this['sendRequest'](util['format'](_0x41a5('0x30'),_0x401b06));};AGIChannel['prototype'][_0x41a5('0xd')]=function(){return this[_0x41a5('0x21')]('HANGUP');};AGIChannel[_0x41a5('0x20')][_0x41a5('0x31')]=function(_0x16484c,_0x31b87d){var _0x2e22d0=_[_0x41a5('0x32')](_0x31b87d)||_[_0x41a5('0x33')](_0x31b87d)?_0x31b87d[_0x41a5('0x34')]():_0x31b87d;return this[_0x41a5('0x21')](util[_0x41a5('0x26')](_0x41a5('0x35'),_0x16484c,_0x2e22d0?_0x2e22d0[_0x41a5('0x34')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x41a5('0x20')]['sayNumber']=function(_0x3b904a,_0x538497){return this[_0x41a5('0x21')](util[_0x41a5('0x26')]('SAY\x20NUMBER\x20%s\x20%s',_0x3b904a,_0x538497));};AGIChannel[_0x41a5('0x20')][_0x41a5('0x36')]=function(_0x53ce7b,_0x4723b4){return this[_0x41a5('0x21')](util[_0x41a5('0x26')](_0x41a5('0x37'),_0x53ce7b,_0x4723b4));};AGIChannel[_0x41a5('0x20')]['sayPhonetic']=function(_0x49f978,_0x14c563){return this[_0x41a5('0x21')](util[_0x41a5('0x26')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x49f978,_0x14c563));};AGIChannel[_0x41a5('0x20')][_0x41a5('0x38')]=function(_0x564826,_0x47cf8e,_0x14cfa0){_0x47cf8e=_0x47cf8e||this['extension'];_0x14cfa0=_0x14cfa0||0x1;this[_0x41a5('0x39')](_0x564826);this[_0x41a5('0x2e')](_0x47cf8e);this[_0x41a5('0x2f')](_0x14cfa0);return this['noop'](util[_0x41a5('0x26')]('GOTO\x20%s\x20%s\x20%s',_0x564826,_0x47cf8e,_0x14cfa0));};AGIChannel[_0x41a5('0x20')][_0x41a5('0x3a')]=function(_0x69237){return this['sendRequest'](util[_0x41a5('0x26')](_0x41a5('0x3b'),_0x69237));};AGIChannel[_0x41a5('0x20')]['recordFile']=function(_0x4c7a3b,_0xdf7d3e,_0x24bcc4,_0x586b44,_0x57bd20,_0x48b39c){_0xdf7d3e=_0xdf7d3e||_0x41a5('0x3c');_0x24bcc4=_0x24bcc4||'';_0x586b44=_0x586b44===undefined?-0x1:_0x586b44==='-1'?-0x1:_0x586b44*0x3e8;_0x57bd20=_0x57bd20===undefined?'':'s='+_0x57bd20;_0x48b39c=_0x48b39c?_0x41a5('0x3d'):'';return this[_0x41a5('0x21')](util[_0x41a5('0x26')](_0x41a5('0x3e'),_0x4c7a3b,_0xdf7d3e,_0x24bcc4,_0x586b44,_0x48b39c,_0x57bd20));};AGIChannel[_0x41a5('0x20')][_0x41a5('0x3f')]=function(_0x52f835,_0x1d0d2f){_0x1d0d2f=_0x1d0d2f||'';return this['sendRequest'](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x52f835,_0x1d0d2f));};AGIChannel[_0x41a5('0x20')][_0x41a5('0x40')]=function(_0x940a0b){return this['exec'](_0x41a5('0x41'),_0x940a0b);};AGIChannel['prototype']['wait']=function(_0x240adf){return this['exec'](_0x41a5('0x42'),_0x240adf);};AGIChannel[_0x41a5('0x20')][_0x41a5('0x18')]=function(_0x4eec14,_0x5de0ca){this['noop'](util[_0x41a5('0x26')](_0x41a5('0x43'),_0x4eec14['id'],_0x4eec14[_0x41a5('0x44')],_0x5de0ca));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x41a5('0x45')]=AGIChannel; \ No newline at end of file +var _0x6515=['setTimeout','utf8','headers','emit','ready','line','toLowerCase','hangup','search','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sendRequest','sync','answer','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','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','setExtension','noop','GOTO\x20%s\x20%s\x20%s','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','events','./reply','./error','call','setEncoding'];(function(_0x54f380,_0xb75cb3){var _0x39079c=function(_0x2d73fd){while(--_0x2d73fd){_0x54f380['push'](_0x54f380['shift']());}};_0x39079c(++_0xb75cb3);}(_0x6515,0x1e5));var _0x5651=function(_0x599947,_0x1068d8){_0x599947=_0x599947-0x0;var _0x1670c6=_0x6515[_0x599947];return _0x1670c6;};'use strict';var util=require(_0x5651('0x0'));var _=require(_0x5651('0x1'));var EventEmitter=require(_0x5651('0x2'))['EventEmitter'];var AGIReply=require(_0x5651('0x3'));var AGIError=require(_0x5651('0x4'));function AGIChannel(_0x3221d5){var _0x299ab0=this,_0x1f4316=new AGIReply(),_0x188390=![],_0x27f505={};EventEmitter[_0x5651('0x5')](_0x299ab0);_0x3221d5[_0x5651('0x6')]('utf8');_0x3221d5[_0x5651('0x7')](0x8*0x3c*0x3c*0x3e8);_0x1f4316[_0x5651('0x6')](_0x5651('0x8'));_0x1f4316['on'](_0x5651('0x9'),function(_0x1dc334){for(var _0x445b30 in _0x1dc334){_0x299ab0[_0x445b30]=_0x1dc334[_0x445b30];}_0x299ab0[_0x5651('0xa')](_0x5651('0xb'));});_0x1f4316['on'](_0x5651('0xc'),function(_0x2de712){if(_0x2de712[_0x5651('0xd')]()==_0x5651('0xe')){_0x299ab0[_0x5651('0xa')](_0x5651('0xe'));return;}if(_0x2de712['substring'](0x0,0xb)=='520-Invalid'){_0x188390=!![];}if(_0x188390){_0x27f505['rx']+=_0x2de712+'\x0a';if(_0x2de712[_0x5651('0xf')](_0x5651('0x10'))!=-0x1){_0x188390=![];}}else{_0x27f505['rx']=_0x2de712;}if(_0x188390){return;}if(typeof _0x27f505['cb']==_0x5651('0x11')){var _0x20049c=_0x27f505['rx'][_0x5651('0x12')](0x0,0x3),_0x544659=null,_0x590ae4=null;_0x20049c=parseInt(_0x20049c);if(isNaN(_0x20049c)){_0x27f505['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x5651('0x13')});return;}if(_0x20049c!=0xc8){_0x27f505['cb'](null,{'code':_0x20049c,'result':-0x1,'extra':'KO'});return;}_0x544659=_0x27f505['rx'][_0x5651('0x12')](0x4)[_0x5651('0x14')](_0x5651('0x15'),'');if(_0x544659[_0x5651('0x16')]('\x20')!=-0x1){_0x544659=_0x544659[_0x5651('0x17')](0x0,_0x544659['indexOf']('\x20'));}if(_[_0x5651('0x18')](_0x544659,'-1')){_0x544659=parseInt(_0x544659);}_0x590ae4=_0x27f505['rx'][_0x5651('0x19')]('\x20');if(_0x590ae4[_0x5651('0x1a')]==0x3){_0x590ae4=_0x590ae4[0x2][_0x5651('0x12')](0x1,_0x590ae4[0x2][_0x5651('0x1a')]-0x1);}else if(_0x590ae4[_0x5651('0x1a')]>0x3){var _0x5dc0c3=/\((.+)\)/;var _0x27c8e1=_0x27f505['rx'][_0x5651('0x1b')](_0x5dc0c3);if(_0x27c8e1){_0x590ae4=_0x27c8e1[0x1];}else{_0x590ae4=null;}}else{_0x590ae4=null;}_0x27f505['cb'](null,{'code':_0x20049c,'result':_0x544659,'extra':_0x590ae4});}});_0x3221d5['on'](_0x5651('0x1c'),function(_0x47af77){_0x299ab0[_0x5651('0xa')]('error',new AGIError('E_AGI_SOCKET_ERROR',_0x47af77['code']));});_0x3221d5['on']('close',function(){_0x299ab0[_0x5651('0xa')](_0x5651('0x1d'),new AGIError(_0x5651('0x1e')));});_0x3221d5['on'](_0x5651('0x1f'),function(){_0x299ab0[_0x5651('0xa')](_0x5651('0x1f'),new AGIError(_0x5651('0x20')));_0x3221d5[_0x5651('0x21')]();});_0x3221d5[_0x5651('0x22')](_0x1f4316);this[_0x5651('0x23')]=function(_0x3dda51,_0x4b192f){var _0x3dda51=_0x3dda51||'',_0x4b192f=typeof _0x4b192f==_0x5651('0x11')?_0x4b192f:new Function();_0x27f505={'tx':_0x3dda51,'rx':'','cb':_0x4b192f};_0x3221d5[_0x5651('0x24')](_0x3dda51+'\x0a');},this[_0x5651('0x1d')]=function(){_0x3221d5[_0x5651('0x21')]();};}util[_0x5651('0x25')](AGIChannel,EventEmitter);AGIChannel[_0x5651('0x26')][_0x5651('0x27')]=function(_0x1f182a){return this['command'][_0x5651('0x28')](this,_0x1f182a);};AGIChannel['prototype'][_0x5651('0x29')]=function(){return this['sendRequest'](_0x5651('0x2a'));};AGIChannel['prototype']['getData']=function(_0x53b939,_0x49f9ff,_0x25f31b){_0x53b939=_0x53b939===undefined?_0x5651('0x2b'):_0x53b939;_0x49f9ff=_0x49f9ff===undefined?'5':_0x49f9ff;_0x25f31b=_0x25f31b===undefined?'1':_0x25f31b;return this['sendRequest'](util[_0x5651('0x2c')](_0x5651('0x2d'),_0x53b939,_0x49f9ff*0x3e8,_0x25f31b));};AGIChannel[_0x5651('0x26')]['noop']=function(_0xc05b38){_0xc05b38=_0xc05b38||_0x5651('0x2e');return this[_0x5651('0x27')](util[_0x5651('0x2c')](_0x5651('0x2f'),_0xc05b38));};AGIChannel[_0x5651('0x26')][_0x5651('0x30')]=function(_0x15d105,_0x4d96c2){if(_[_0x5651('0x31')](_0x4d96c2)){return this[_0x5651('0x27')](util[_0x5651('0x2c')](_0x5651('0x32'),_0x15d105,_0x4d96c2[_0x5651('0x33')](',')));}return this[_0x5651('0x27')](util['format']('EXEC\x20%s\x20%s',_0x15d105,_0x4d96c2));};AGIChannel['prototype'][_0x5651('0x34')]=function(_0x186229){return this['sendRequest'](util[_0x5651('0x2c')](_0x5651('0x35'),_0x186229));};AGIChannel[_0x5651('0x26')]['setExtension']=function(_0x157221){return this[_0x5651('0x27')](util[_0x5651('0x2c')](_0x5651('0x36'),_0x157221));};AGIChannel[_0x5651('0x26')][_0x5651('0x37')]=function(_0x10f308){return this['sendRequest'](util[_0x5651('0x2c')](_0x5651('0x38'),_0x10f308));};AGIChannel[_0x5651('0x26')][_0x5651('0xe')]=function(){return this[_0x5651('0x27')]('HANGUP');};AGIChannel[_0x5651('0x26')][_0x5651('0x39')]=function(_0x47b67b,_0x5e916a){var _0x59cc72=_[_0x5651('0x3a')](_0x5e916a)||_['isNumber'](_0x5e916a)?_0x5e916a[_0x5651('0x3b')]():_0x5e916a;return this[_0x5651('0x27')](util[_0x5651('0x2c')](_0x5651('0x3c'),_0x47b67b,_0x59cc72?_0x59cc72[_0x5651('0x3b')]()[_0x5651('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x5651('0x26')][_0x5651('0x3d')]=function(_0x56fcd0,_0x45b5ad){return this[_0x5651('0x27')](util[_0x5651('0x2c')](_0x5651('0x3e'),_0x56fcd0,_0x45b5ad));};AGIChannel[_0x5651('0x26')][_0x5651('0x3f')]=function(_0x22f614,_0x45aafb){return this[_0x5651('0x27')](util[_0x5651('0x2c')](_0x5651('0x40'),_0x22f614,_0x45aafb));};AGIChannel['prototype'][_0x5651('0x41')]=function(_0x4b1625,_0x398ab1){return this[_0x5651('0x27')](util[_0x5651('0x2c')](_0x5651('0x42'),_0x4b1625,_0x398ab1));};AGIChannel[_0x5651('0x26')][_0x5651('0x43')]=function(_0x510013,_0x30514a,_0xd494f3){_0x30514a=_0x30514a||this[_0x5651('0x44')];_0xd494f3=_0xd494f3||0x1;this[_0x5651('0x34')](_0x510013);this[_0x5651('0x45')](_0x30514a);this['setPriority'](_0xd494f3);return this[_0x5651('0x46')](util[_0x5651('0x2c')](_0x5651('0x47'),_0x510013,_0x30514a,_0xd494f3));};AGIChannel[_0x5651('0x26')]['getVariable']=function(_0x3a1931){return this[_0x5651('0x27')](util[_0x5651('0x2c')]('GET\x20VARIABLE\x20\x22%s\x22',_0x3a1931));};AGIChannel[_0x5651('0x26')]['recordFile']=function(_0x5577cd,_0x34104a,_0x5cb065,_0x4b069d,_0x39ffac,_0x54dae7){_0x34104a=_0x34104a||_0x5651('0x48');_0x5cb065=_0x5cb065||'';_0x4b069d=_0x4b069d===undefined?-0x1:_0x4b069d==='-1'?-0x1:_0x4b069d*0x3e8;_0x39ffac=_0x39ffac===undefined?'':'s='+_0x39ffac;_0x54dae7=_0x54dae7?'BEEP':'';return this[_0x5651('0x27')](util[_0x5651('0x2c')](_0x5651('0x49'),_0x5577cd,_0x34104a,_0x5cb065,_0x4b069d,_0x54dae7,_0x39ffac));};AGIChannel['prototype'][_0x5651('0x4a')]=function(_0x537668,_0x4a6652){_0x4a6652=_0x4a6652||'';return this[_0x5651('0x27')](util['format'](_0x5651('0x4b'),_0x537668,_0x4a6652));};AGIChannel[_0x5651('0x26')][_0x5651('0x4c')]=function(_0x53ecd7){return this[_0x5651('0x30')](_0x5651('0x4d'),_0x53ecd7);};AGIChannel[_0x5651('0x26')][_0x5651('0x4e')]=function(_0x1e2acc){return this['exec'](_0x5651('0x4f'),_0x1e2acc);};AGIChannel['prototype'][_0x5651('0x1c')]=function(_0x2bf1f4,_0x961b31){this[_0x5651('0x46')](util[_0x5651('0x2c')](_0x5651('0x50'),_0x2bf1f4['id'],_0x2bf1f4[_0x5651('0x51')],_0x961b31));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index d6488ea..39029f3 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 _0xf63b=['Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','message','name','exports','util','Undefined\x20error.','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.'];(function(_0x1b9d41,_0xd4009d){var _0x38ec46=function(_0x37e998){while(--_0x37e998){_0x1b9d41['push'](_0x1b9d41['shift']());}};_0x38ec46(++_0xd4009d);}(_0xf63b,0x191));var _0xbf63=function(_0xe61616,_0x1bd828){_0xe61616=_0xe61616-0x0;var _0x3fa7e0=_0xf63b[_0xe61616];return _0x3fa7e0;};'use strict';var util=require(_0xbf63('0x0'));var error={'E_AGI_UNDEFINED':_0xbf63('0x1'),'E_AGI_ARGUMENT_PORT':_0xbf63('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xbf63('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xbf63('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xbf63('0x5'),'E_AGI_SOCKET_ERROR':_0xbf63('0x6'),'E_AGI_SOCKET_CLOSE':_0xbf63('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xbf63('0x8'),'E_AGI_COMMAND_EMPTY':_0xbf63('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xbf63('0xa'),'E_AGI_IVR_ENTRY':_0xbf63('0xb')};function AGIError(_0x3e643a){var _0x3e643a=_0x3e643a||null,_0x461529=_0x461529||[],_0x5ef9b3=0x1,_0x148df9='';if(!error[_0x3e643a]){_0x3e643a=_0xbf63('0xc');}_0x461529[_0xbf63('0xd')](error[_0x3e643a]);while(arguments[_0x5ef9b3]){_0x461529[_0xbf63('0xd')](arguments[_0x5ef9b3]);_0x5ef9b3++;}_0x148df9=util['format']['apply'](util,_0x461529);this[_0xbf63('0xe')]=_0x148df9;this[_0xbf63('0xf')]=_0x3e643a;}module[_0xbf63('0x10')]=AGIError; \ No newline at end of file +var _0x9e48=['Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','apply','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.'];(function(_0x442279,_0x39eda9){var _0x23355a=function(_0x35f42d){while(--_0x35f42d){_0x442279['push'](_0x442279['shift']());}};_0x23355a(++_0x39eda9);}(_0x9e48,0x87));var _0x89e4=function(_0x2d7f58,_0x4d5c28){_0x2d7f58=_0x2d7f58-0x0;var _0x174c16=_0x9e48[_0x2d7f58];return _0x174c16;};'use strict';var util=require(_0x89e4('0x0'));var error={'E_AGI_UNDEFINED':_0x89e4('0x1'),'E_AGI_ARGUMENT_PORT':_0x89e4('0x2'),'E_AGI_SERVER_ERROR':_0x89e4('0x3'),'E_AGI_SERVER_CLOSE':_0x89e4('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x89e4('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x89e4('0x6'),'E_AGI_SOCKET_ERROR':_0x89e4('0x7'),'E_AGI_SOCKET_CLOSE':_0x89e4('0x8'),'E_AGI_SOCKET_TIMEOUT':_0x89e4('0x9'),'E_AGI_COMMAND_EMPTY':_0x89e4('0xa'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x89e4('0xb'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x443c4d){var _0x443c4d=_0x443c4d||null,_0x33b49e=_0x33b49e||[],_0x5a397a=0x1,_0x421099='';if(!error[_0x443c4d]){_0x443c4d=_0x89e4('0xc');}_0x33b49e[_0x89e4('0xd')](error[_0x443c4d]);while(arguments[_0x5a397a]){_0x33b49e[_0x89e4('0xd')](arguments[_0x5a397a]);_0x5a397a++;}_0x421099=util[_0x89e4('0xe')][_0x89e4('0xf')](util,_0x33b49e);this['message']=_0x421099;this[_0x89e4('0x10')]=_0x443c4d;}module[_0x89e4('0x11')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 2e8bcc4..18a97fc 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 _0xd3bb=['redis','subscribe','agi','emit','E_AGI_SERVER_ERROR','message','parse','exports','events','EventEmitter','ioredis','./error','../../config/environment'];(function(_0x12e24d,_0x59ce3d){var _0xabbeaf=function(_0xa75a68){while(--_0xa75a68){_0x12e24d['push'](_0x12e24d['shift']());}};_0xabbeaf(++_0x59ce3d);}(_0xd3bb,0x1e9));var _0xbd3b=function(_0x1499df,_0x5c754e){_0x1499df=_0x1499df-0x0;var _0x1252dd=_0xd3bb[_0x1499df];return _0x1252dd;};'use strict';var _=require('lodash');var EventEmitter=require(_0xbd3b('0x0'))[_0xbd3b('0x1')];var Redis=require(_0xbd3b('0x2'));var AGIError=require(_0xbd3b('0x3'));var config=require(_0xbd3b('0x4'));config[_0xbd3b('0x5')]=_['defaults'](config[_0xbd3b('0x5')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xbd3b('0x5')]);sub[_0xbd3b('0x6')](_0xbd3b('0x7'),function(_0x2d48c7){if(_0x2d48c7)return eventEmitter[_0xbd3b('0x8')]('error',new AGIError(_0xbd3b('0x9'),_0x2d48c7));});sub['on'](_0xbd3b('0xa'),function(_0x2f99f6,_0x58d8e1){if(_0x2f99f6!==_0xbd3b('0x7'))return;try{var _0x558bc2=JSON[_0xbd3b('0xb')](_0x58d8e1);eventEmitter[_0xbd3b('0x8')]('projectUpdate',_0x558bc2);}catch(_0x57b71f){eventEmitter[_0xbd3b('0x8')]('error',new AGIError(_0xbd3b('0x9'),_0x57b71f));}});module[_0xbd3b('0xc')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xc286=['lodash','events','EventEmitter','ioredis','./error','../../config/environment','redis','defaults','localhost','agi','emit','E_AGI_SERVER_ERROR','parse','projectUpdate','error','exports'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xc286,0xe0));var _0x6c28=function(_0x5c10dc,_0x1c0913){_0x5c10dc=_0x5c10dc-0x0;var _0x298b81=_0xc286[_0x5c10dc];return _0x298b81;};'use strict';var _=require(_0x6c28('0x0'));var EventEmitter=require(_0x6c28('0x1'))[_0x6c28('0x2')];var Redis=require(_0x6c28('0x3'));var AGIError=require(_0x6c28('0x4'));var config=require(_0x6c28('0x5'));config[_0x6c28('0x6')]=_[_0x6c28('0x7')](config['redis'],{'host':_0x6c28('0x8'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x6c28('0x6')]);sub['subscribe'](_0x6c28('0x9'),function(_0x9b0065){if(_0x9b0065)return eventEmitter[_0x6c28('0xa')]('error',new AGIError(_0x6c28('0xb'),_0x9b0065));});sub['on']('message',function(_0x101e42,_0x54a41f){if(_0x101e42!==_0x6c28('0x9'))return;try{var _0x34db41=JSON[_0x6c28('0xc')](_0x54a41f);eventEmitter[_0x6c28('0xa')](_0x6c28('0xd'),_0x34db41);}catch(_0x1b7d04){eventEmitter['emit'](_0x6c28('0xe'),new AGIError(_0x6c28('0xb'),_0x1b7d04));}});module[_0x6c28('0xf')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index c18bbe3..87579c1 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 _0x786c=['edges','numberOfEdges','prototype','addVertex','push','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','agicommand','target','invalid','vswitch','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices'];(function(_0x400eb4,_0x229c79){var _0x544f8e=function(_0x203188){while(--_0x203188){_0x400eb4['push'](_0x400eb4['shift']());}};_0x544f8e(++_0x229c79);}(_0x786c,0x172));var _0xc786=function(_0x50f419,_0x52b3e0){_0x50f419=_0x50f419-0x0;var _0x18cd95=_0x786c[_0x50f419];return _0x18cd95;};'use strict';var _=require(_0xc786('0x0'));var logger=require(_0xc786('0x1'))(_0xc786('0x2'));var verticesWithRetry=[_0xc786('0x3'),_0xc786('0x4'),_0xc786('0x5')];var Graph=function(){this[_0xc786('0x6')]={};this[_0xc786('0x7')]={};this[_0xc786('0x8')]=0x0;};Graph[_0xc786('0x9')][_0xc786('0xa')]=function(_0x21905b){this['vertices'][_0x21905b['id']]=_0x21905b;this[_0xc786('0x7')][_0x21905b['id']]=[];};Graph[_0xc786('0x9')]['addEdge']=function(_0x52146c,_0x23d4d1,_0x2f9f7a){this[_0xc786('0x7')][_0x52146c][_0xc786('0xb')]({'target':_0x23d4d1,'condition':_0x2f9f7a});this[_0xc786('0x8')]+=0x1;};Graph['prototype'][_0xc786('0xc')]=function(){return _['size'](this[_0xc786('0x6')]);};Graph[_0xc786('0x9')][_0xc786('0xd')]=function(){return this[_0xc786('0x8')];};Graph[_0xc786('0x9')][_0xc786('0xe')]=function(_0x3ec275){return this['vertices'][_0x3ec275];};Graph['prototype'][_0xc786('0xf')]=function(_0x13e3b5,_0x553b57){if(!this[_0xc786('0x6')][_0x13e3b5]){return logger['info'](_0xc786('0x10'));}var _0x58b01f=_0x553b57(this['vertices'][_0x13e3b5]);if(!_0x58b01f){return logger[_0xc786('0x11')](_0xc786('0x12'));}if(this[_0xc786('0x7')][_0x13e3b5][_0xc786('0x13')]===0x0){return logger['info'](_0xc786('0x14'));}for(var _0x35ae24=0x0,_0x4503ae=[],_0x2f691e=![];_0x35ae24\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','then','catch','agi_','substring','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare'];(function(_0x1f6ece,_0xe5621a){var _0x20cae0=function(_0x21a4a1){while(--_0x21a4a1){_0x1f6ece['push'](_0x1f6ece['shift']());}};_0x20cae0(++_0xe5621a);}(_0x5091,0x100));var _0x1509=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5091[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var syncho=require('syncho');var util=require(_0x1509('0x0'));var config=require(_0x1509('0x1'));var logger=require(_0x1509('0x2'))(_0x1509('0x3'));var utilLicense=require(_0x1509('0x4'));var rpc=require('./rpc');var Project=require(_0x1509('0x5'));var AGIEmitter=require(_0x1509('0x6'))[_0x1509('0x7')];var projects=[];config[_0x1509('0x3')]=_['defaults'](config[_0x1509('0x3')],{'ip':_0x1509('0x8'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x436c69){process[_0x1509('0x9')](function(){syncho(function(){try{setChannelVariables(_0x436c69);agiHandler(_0x436c69);}catch(_0x4bdcfd){logger[_0x1509('0xa')](_0x4bdcfd[_0x1509('0xb')]);}});});}function projectUpdateHandler(_0x4bc07f){try{var _0x137ee2=_[_0x1509('0xc')](projects,['id',_0x4bc07f['id']]);if(_0x137ee2>-0x1){if(_0x4bc07f[_0x1509('0xd')]===!![]){projects[_0x1509('0xe')](_0x137ee2,0x1);}else{projects[_0x137ee2]=_0x4bc07f;}}else{projects[_0x1509('0xf')](_0x4bc07f);}}catch(_0x3e944c){logger[_0x1509('0xa')](_0x3e944c[_0x1509('0xb')]);}}function listeningHandler(){console[_0x1509('0x10')](_0x1509('0x11'),config['agi']['port']);logger['info'](util[_0x1509('0x12')](_0x1509('0x13'),config['agi']['ip'],config[_0x1509('0x3')][_0x1509('0x14')]));}function errorHandler(_0x48aaff){if(_0x48aaff&&_0x48aaff[_0x1509('0x15')]&&_0x48aaff[_0x1509('0x16')]){logger[_0x1509('0xa')](util[_0x1509('0x12')](_0x1509('0x17'),_0x48aaff[_0x1509('0x15')],_0x48aaff[_0x1509('0x16')]));}else{logger[_0x1509('0xa')](util['format'](_0x1509('0x18'),_0x48aaff[_0x1509('0xb')]));}}function closeHandler(){logger[_0x1509('0x19')](util[_0x1509('0x12')](_0x1509('0x1a'),this[_0x1509('0x1b')],this[_0x1509('0x1c')],this[_0x1509('0x1d')],this[_0x1509('0x1e')],this['uniqueid']));try{createSquareReport(this);}catch(_0x1770d9){logger[_0x1509('0xa')](_0x1770d9['stack']);}}function timeoutHandler(){logger['info'](util[_0x1509('0x12')](_0x1509('0x1f'),this[_0x1509('0x1b')],this[_0x1509('0x1c')],this[_0x1509('0x1d')],this[_0x1509('0x1e')],this[_0x1509('0x20')]));}function hangupHandler(){logger[_0x1509('0x19')](util[_0x1509('0x12')](_0x1509('0x21'),this[_0x1509('0x1b')],this[_0x1509('0x1c')],this[_0x1509('0x1d')],this['dnid'],this[_0x1509('0x20')]));this['evtHangup']=!![];}function createSquareReport(_0x5921c1,_0x39d342){rpc[_0x1509('0x22')](_0x5921c1)[_0x1509('0x23')](function(_0x2e79f8){if(_0x39d342){_0x39d342(null,_0x2e79f8);}})[_0x1509('0x24')](function(_0x411f95){if(_0x39d342){_0x39d342(null,_0x411f95);}});}function setChannelVariables(_0x3cae06){for(var _0x394b8d in _0x3cae06){if(_0x3cae06['hasOwnProperty'](_0x394b8d)){if(_0x394b8d['indexOf'](_0x1509('0x25'))===0x0){_0x3cae06[_0x394b8d[_0x1509('0x26')](0x4)]=_0x3cae06[_0x394b8d];delete _0x3cae06[_0x394b8d];}}}}function agiHandler(_0x2ef393){logger['debug'](_0x1509('0x27'),JSON[_0x1509('0x28')](_0x2ef393,null,0x2));logger[_0x1509('0x19')](util[_0x1509('0x12')](_0x1509('0x29'),_0x2ef393[_0x1509('0x1b')],_0x2ef393[_0x1509('0x1c')],_0x2ef393[_0x1509('0x1d')],_0x2ef393[_0x1509('0x1e')],_0x2ef393[_0x1509('0x20')]));_0x2ef393['on'](_0x1509('0xa'),errorHandler);_0x2ef393['on'](_0x1509('0x2a'),closeHandler);_0x2ef393['on'](_0x1509('0x2b'),timeoutHandler);_0x2ef393[_0x1509('0x2c')]=![];_0x2ef393['on'](_0x1509('0x2d'),hangupHandler);var _0x49d7da=_[_0x1509('0x2e')](projects,[_0x1509('0x15'),_0x2ef393['arg_1']]);if(!_0x49d7da)return Project[_0x1509('0x2f')](_0x2ef393);if(!_0x49d7da[_0x1509('0x30')])return Project[_0x1509('0x31')](_0x2ef393);return Project[_0x1509('0x32')](_0x49d7da,_0x2ef393);}function main(){var _0x1ccd1b;return utilLicense[_0x1509('0x33')]()[_0x1509('0x23')](function(_0x417134){if(!_0x417134)return;if(_0x417134[_0x1509('0x34')]){if(_0x417134[_0x1509('0x35')]&&_0x417134[_0x1509('0x35')]>0x0){logger[_0x1509('0x19')](util[_0x1509('0x12')](_0x1509('0x36'),_0x417134[_0x1509('0x35')]));_0x1ccd1b=_0x417134[_0x1509('0x35')];}else{logger[_0x1509('0x19')](_0x1509('0x37'));}}else{logger[_0x1509('0x19')](_0x1509('0x38'));_0x1ccd1b=-0x1;}})[_0x1509('0x23')](function(){return Project[_0x1509('0x39')]();})[_0x1509('0x23')](function(_0x247b45){projects=_0x247b45;return;})[_0x1509('0x24')](function(_0x39fd31){logger[_0x1509('0xa')](_0x1509('0x3a'),_0x39fd31[_0x1509('0xb')]);})[_0x1509('0x3b')](function(){var _0x5a1737=require(_0x1509('0x3c'))(config[_0x1509('0x3')][_0x1509('0x14')],config['agi']['ip'],_0x1ccd1b);_0x5a1737['on'](_0x1509('0xa'),errorHandler);_0x5a1737['on']('listening',listeningHandler);_0x5a1737['on'](_0x1509('0x3d'),connectionHandler);_0x5a1737['on'](_0x1509('0x2a'),closeHandler);});}main(); \ No newline at end of file +var _0xa862=['EventEmitter','defaults','127.0.0.1','nextTick','error','stack','findIndex','deleted','log','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','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','evtHangup','createSquareReport','catch','hasOwnProperty','agi_','debug','variables','stringify','close','timeout','handleNotFound','production','handleUnpublished','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','then','getAll','[LICENSE]','finally','listening','lodash','syncho','util','../../config/environment','../../config/logger','agi','./rpc','./project','./events'];(function(_0x25b0fa,_0x2ede54){var _0xc1d901=function(_0x3275e8){while(--_0x3275e8){_0x25b0fa['push'](_0x25b0fa['shift']());}};_0xc1d901(++_0x2ede54);}(_0xa862,0x105));var _0x2a86=function(_0x18fdaf,_0x457de2){_0x18fdaf=_0x18fdaf-0x0;var _0x557a9b=_0xa862[_0x18fdaf];return _0x557a9b;};'use strict';var _=require(_0x2a86('0x0'));var syncho=require(_0x2a86('0x1'));var util=require(_0x2a86('0x2'));var config=require(_0x2a86('0x3'));var logger=require(_0x2a86('0x4'))(_0x2a86('0x5'));var utilLicense=require('../../config/license/util');var rpc=require(_0x2a86('0x6'));var Project=require(_0x2a86('0x7'));var AGIEmitter=require(_0x2a86('0x8'))[_0x2a86('0x9')];var projects=[];config['agi']=_[_0x2a86('0xa')](config[_0x2a86('0x5')],{'ip':_0x2a86('0xb'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x1e5eb6){process[_0x2a86('0xc')](function(){syncho(function(){try{setChannelVariables(_0x1e5eb6);agiHandler(_0x1e5eb6);}catch(_0x1032ee){logger[_0x2a86('0xd')](_0x1032ee[_0x2a86('0xe')]);}});});}function projectUpdateHandler(_0x515ae6){try{var _0x13170d=_[_0x2a86('0xf')](projects,['id',_0x515ae6['id']]);if(_0x13170d>-0x1){if(_0x515ae6[_0x2a86('0x10')]===!![]){projects['splice'](_0x13170d,0x1);}else{projects[_0x13170d]=_0x515ae6;}}else{projects['push'](_0x515ae6);}}catch(_0x4c37d1){logger['error'](_0x4c37d1[_0x2a86('0xe')]);}}function listeningHandler(){console[_0x2a86('0x11')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x2a86('0x5')]['port']);logger[_0x2a86('0x12')](util[_0x2a86('0x13')](_0x2a86('0x14'),config[_0x2a86('0x5')]['ip'],config[_0x2a86('0x5')][_0x2a86('0x15')]));}function errorHandler(_0x2cd9c){if(_0x2cd9c&&_0x2cd9c[_0x2a86('0x16')]&&_0x2cd9c['message']){logger['error'](util[_0x2a86('0x13')](_0x2a86('0x17'),_0x2cd9c['name'],_0x2cd9c['message']));}else{logger[_0x2a86('0xd')](util['format'](_0x2a86('0x18'),_0x2cd9c[_0x2a86('0xe')]));}}function closeHandler(){logger[_0x2a86('0x12')](util[_0x2a86('0x13')](_0x2a86('0x19'),this[_0x2a86('0x1a')],this[_0x2a86('0x1b')],this[_0x2a86('0x1c')],this[_0x2a86('0x1d')],this[_0x2a86('0x1e')]));try{createSquareReport(this);}catch(_0x603b2e){logger['error'](_0x603b2e[_0x2a86('0xe')]);}}function timeoutHandler(){logger[_0x2a86('0x12')](util['format'](_0x2a86('0x1f'),this['arg_1'],this[_0x2a86('0x1b')],this[_0x2a86('0x1c')],this[_0x2a86('0x1d')],this[_0x2a86('0x1e')]));}function hangupHandler(){logger[_0x2a86('0x12')](util[_0x2a86('0x13')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x2a86('0x1a')],this[_0x2a86('0x1b')],this[_0x2a86('0x1c')],this[_0x2a86('0x1d')],this[_0x2a86('0x1e')]));this[_0x2a86('0x20')]=!![];}function createSquareReport(_0x4719cc,_0x543257){rpc[_0x2a86('0x21')](_0x4719cc)['then'](function(_0x1aca4f){if(_0x543257){_0x543257(null,_0x1aca4f);}})[_0x2a86('0x22')](function(_0x47f88d){if(_0x543257){_0x543257(null,_0x47f88d);}});}function setChannelVariables(_0x2c2cba){for(var _0x9b5124 in _0x2c2cba){if(_0x2c2cba[_0x2a86('0x23')](_0x9b5124)){if(_0x9b5124['indexOf'](_0x2a86('0x24'))===0x0){_0x2c2cba[_0x9b5124['substring'](0x4)]=_0x2c2cba[_0x9b5124];delete _0x2c2cba[_0x9b5124];}}}}function agiHandler(_0x5a4c7f){logger[_0x2a86('0x25')](_0x2a86('0x26'),JSON[_0x2a86('0x27')](_0x5a4c7f,null,0x2));logger[_0x2a86('0x12')](util[_0x2a86('0x13')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x5a4c7f[_0x2a86('0x1a')],_0x5a4c7f[_0x2a86('0x1b')],_0x5a4c7f[_0x2a86('0x1c')],_0x5a4c7f[_0x2a86('0x1d')],_0x5a4c7f[_0x2a86('0x1e')]));_0x5a4c7f['on'](_0x2a86('0xd'),errorHandler);_0x5a4c7f['on'](_0x2a86('0x28'),closeHandler);_0x5a4c7f['on'](_0x2a86('0x29'),timeoutHandler);_0x5a4c7f[_0x2a86('0x20')]=![];_0x5a4c7f['on']('hangup',hangupHandler);var _0x353343=_['find'](projects,[_0x2a86('0x16'),_0x5a4c7f[_0x2a86('0x1a')]]);if(!_0x353343)return Project[_0x2a86('0x2a')](_0x5a4c7f);if(!_0x353343[_0x2a86('0x2b')])return Project[_0x2a86('0x2c')](_0x5a4c7f);return Project['initialize'](_0x353343,_0x5a4c7f);}function main(){var _0x46b8b8;return utilLicense[_0x2a86('0x2d')]()['then'](function(_0x30a7a7){if(!_0x30a7a7)return;if(_0x30a7a7['voice']){if(_0x30a7a7['callysquare']&&_0x30a7a7[_0x2a86('0x2e')]>0x0){logger[_0x2a86('0x12')](util['format'](_0x2a86('0x2f'),_0x30a7a7[_0x2a86('0x2e')]));_0x46b8b8=_0x30a7a7[_0x2a86('0x2e')];}else{logger[_0x2a86('0x12')](_0x2a86('0x30'));}}else{logger[_0x2a86('0x12')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x46b8b8=-0x1;}})[_0x2a86('0x31')](function(){return Project[_0x2a86('0x32')]();})['then'](function(_0x3f6c85){projects=_0x3f6c85;return;})[_0x2a86('0x22')](function(_0x345da3){logger[_0x2a86('0xd')](_0x2a86('0x33'),_0x345da3[_0x2a86('0xe')]);})[_0x2a86('0x34')](function(){var _0x37b6ec=require('./server')(config[_0x2a86('0x5')][_0x2a86('0x15')],config[_0x2a86('0x5')]['ip'],_0x46b8b8);_0x37b6ec['on'](_0x2a86('0xd'),errorHandler);_0x37b6ec['on'](_0x2a86('0x35'),listeningHandler);_0x37b6ec['on']('connection',connectionHandler);_0x37b6ec['on'](_0x2a86('0x28'),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 ffa710c..d21f511 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 _0xee86=['request','error','message','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http'];(function(_0x184575,_0x444400){var _0x28bb63=function(_0x525432){while(--_0x525432){_0x184575['push'](_0x184575['shift']());}};_0x28bb63(++_0x444400);}(_0xee86,0xb0));var _0x6ee8=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xee86[_0x525c7b];return _0x27b33e;};'use strict';var BPromise=require(_0x6ee8('0x0'));var jayson=require(_0x6ee8('0x1'));var client=jayson[_0x6ee8('0x2')][_0x6ee8('0x3')]({'port':0x232b});function request(_0x5a8057,_0x2c1031){return new BPromise(function(_0x319646,_0x198c6b){return client[_0x6ee8('0x4')](_0x5a8057,_0x2c1031)['then'](function(_0x5cbdd0){if(_0x5cbdd0[_0x6ee8('0x5')]){return _0x198c6b(_0x5cbdd0['error'][_0x6ee8('0x6')]);}else{return _0x319646(_0x5cbdd0['result']);}})[_0x6ee8('0x7')](function(_0x1ca583){return _0x198c6b(_0x1ca583);});});}exports[_0x6ee8('0x8')]=function(_0x1fb106,_0x5f06cf){return request(_0x6ee8('0x9'),{'account':_0x1fb106,'message':_0x5f06cf});}; \ No newline at end of file +var _0x8c1a=['sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','message'];(function(_0x59b439,_0x4e16b6){var _0x74d02b=function(_0x319ddc){while(--_0x319ddc){_0x59b439['push'](_0x59b439['shift']());}};_0x74d02b(++_0x4e16b6);}(_0x8c1a,0x18e));var _0xa8c1=function(_0x18bac5,_0x2e54fc){_0x18bac5=_0x18bac5-0x0;var _0xdc6c44=_0x8c1a[_0x18bac5];return _0xdc6c44;};'use strict';var BPromise=require(_0xa8c1('0x0'));var jayson=require(_0xa8c1('0x1'));var client=jayson[_0xa8c1('0x2')][_0xa8c1('0x3')]({'port':0x232b});function request(_0x586a1b,_0x2a793f){return new BPromise(function(_0x31e0f0,_0x228bf0){return client[_0xa8c1('0x4')](_0x586a1b,_0x2a793f)[_0xa8c1('0x5')](function(_0x4a519f){if(_0x4a519f['error']){return _0x228bf0(_0x4a519f['error'][_0xa8c1('0x6')]);}else{return _0x31e0f0(_0x4a519f['result']);}})['catch'](function(_0x2d84e4){return _0x228bf0(_0x2d84e4);});});}exports[_0xa8c1('0x7')]=function(_0x589fb6,_0x36cad9){return request(_0xa8c1('0x8'),{'account':_0x589fb6,'message':_0x36cad9});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index d997f29..01270f7 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 _0x1bc3=['hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','target','addEdge','source','value','toJson','mxGraphModel','production','start','stringify','joinAt','format','info','arg_1','calleridname','uniqueid','traverseBFS','debug','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','isUndefined','result','toString','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','clear','agicommand\x20not\x20found','[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','util','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand'];(function(_0xeed419,_0x5e2a5a){var _0x54d294=function(_0x58a054){while(--_0x58a054){_0xeed419['push'](_0xeed419['shift']());}};_0x54d294(++_0x5e2a5a);}(_0x1bc3,0x1e0));var _0x31bc=function(_0x55b6ce,_0x4e6416){_0x55b6ce=_0x55b6ce-0x0;var _0x4d03bc=_0x1bc3[_0x55b6ce];return _0x4d03bc;};'use strict';var _=require(_0x31bc('0x0'));var moment=require(_0x31bc('0x1'));var parser=require(_0x31bc('0x2'));var util=require(_0x31bc('0x3'));var logger=require(_0x31bc('0x4'))(_0x31bc('0x5'));var rpc=require(_0x31bc('0x6'));var mailRpc=require(_0x31bc('0x7'));var Graph=require(_0x31bc('0x8'));var Vertices=require(_0x31bc('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x31bc('0xa')]()[_0x31bc('0xb')](function(_0x4b0884){logger[_0x31bc('0xc')](_0x31bc('0xd'),_0x4b0884[_0x31bc('0xe')]);return[];});}function addVertex(_0x3f3a11,_0x577a00,_0x360a91){_0x577a00[_0x31bc('0xf')]=_0x360a91;if(_0x577a00[_0x31bc('0x10')](_0x31bc('0x11'))){_0x577a00[_0x31bc('0x12')]=parseInt(_0x577a00[_0x31bc('0x11')],0xa);}_0x3f3a11[_0x31bc('0x13')](_[_0x31bc('0x14')](_0x577a00,_0x31bc('0x15')));}function initGraph(_0x4dcaae,_0x4f7e48){var _0x3de9ed=new Graph();for(var _0x40a7d4 in _0x4dcaae){if(_0x4dcaae[_0x31bc('0x10')](_0x40a7d4)){if(_[_0x31bc('0x16')](_0x4dcaae[_0x40a7d4])){for(var _0x5a33e1=0x0;_0x5a33e1<_0x4dcaae[_0x40a7d4]['length'];_0x5a33e1+=0x1){addVertex(_0x3de9ed,_0x4dcaae[_0x40a7d4][_0x5a33e1],_0x40a7d4);}}else{addVertex(_0x3de9ed,_0x4dcaae[_0x40a7d4],_0x40a7d4);}}}for(var _0x370955=0x0;_0x370955<_0x4f7e48[_0x31bc('0x17')];_0x370955+=0x1){if(_0x4f7e48[_0x370955]['source']&&_0x4f7e48[_0x370955][_0x31bc('0x18')]){_0x3de9ed[_0x31bc('0x19')](_0x4f7e48[_0x370955][_0x31bc('0x1a')],_0x4f7e48[_0x370955][_0x31bc('0x18')],_0x4f7e48[_0x370955][_0x31bc('0x1b')]);}}return _0x3de9ed;}function getRoot(_0x11d3f8){return parser[_0x31bc('0x1c')](_0x11d3f8,{'object':!![]})[_0x31bc('0x1d')]['root'];}function inspect(_0x2011f8){return util['inspect'](_0x2011f8,{'showHidden':![],'depth':null});}function initialize(_0xb24628,_0xb783f3){var _0x469f35=getRoot(_0xb24628[_0x31bc('0x1e')]);if(!_0x469f35||!_0x469f35[_0x31bc('0x1f')])return;var _0x4f7f97,_0x56d635,_0x5ef5be;logger['debug']('root',JSON[_0x31bc('0x20')](_0x469f35,null,0x2));_0xb783f3[_0x31bc('0x21')]=moment()[_0x31bc('0x22')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f7f97=initGraph(_[_0x31bc('0x14')](_0x469f35,'mxCell'),_0x469f35[_0x31bc('0x15')]);_0x56d635=new Vertices(_0xb783f3,rpc,mailRpc);logger[_0x31bc('0x23')](util[_0x31bc('0x22')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xb783f3[_0x31bc('0x24')],_0xb783f3[_0x31bc('0x25')],_0xb783f3['callerid'],_0xb783f3['dnid'],_0xb783f3[_0x31bc('0x26')]));_0x4f7f97[_0x31bc('0x27')](_0x469f35[_0x31bc('0x1f')]['id'],function(_0x871cbc){try{_0x871cbc=_0x56d635['clear'](_0x871cbc);logger[_0x31bc('0x28')]('vertex',JSON[_0x31bc('0x20')](_0x871cbc,null,0x2));if(_0x871cbc[_0x31bc('0xf')]===_0x31bc('0x29')){logger[_0x31bc('0x23')](_0x31bc('0x2a'));_0xb783f3[_0x31bc('0x2b')]=_0x871cbc[_0x31bc('0x2b')]||_0xb783f3[_0x31bc('0x2b')];_0xb783f3['extension']=_0x871cbc[_0x31bc('0x2c')];_0xb783f3[_0x31bc('0x2d')]=_0x871cbc[_0x31bc('0x2d')]?_0x871cbc[_0x31bc('0x2d')]-0x1:0x1;return null;}else if(_0x871cbc&&_0x56d635[_0x871cbc[_0x31bc('0xf')]]){_0x5ef5be=_0x56d635[_0x871cbc[_0x31bc('0xf')]](_0x871cbc);logger['info'](_0x31bc('0x2e'),JSON['stringify'](_0x5ef5be,null,0x2));if(_0x5ef5be&&_0x5ef5be[_0x31bc('0x2f')]===AGI_CODE_SUCCESS&&_0x5ef5be['result']!==AGI_RESULT_ERROR&&!_0xb783f3['evtHangup']){logger['debug'](_0x31bc('0x2e'),inspect(_0x5ef5be));return _[_0x31bc('0x30')](_0x5ef5be['result'])?null:_0x5ef5be[_0x31bc('0x31')][_0x31bc('0x32')]();}else{logger[_0x31bc('0xc')](_0x31bc('0x2e'),inspect(_0x5ef5be));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x48c9e6){logger[_0x31bc('0xc')](_0x48c9e6[_0x31bc('0xe')]);return null;}});if(_0x469f35['finally']){logger[_0x31bc('0x23')](util['format'](_0x31bc('0x33'),_0xb783f3[_0x31bc('0x24')],_0xb783f3[_0x31bc('0x25')],_0xb783f3[_0x31bc('0x34')],_0xb783f3[_0x31bc('0x35')],_0xb783f3[_0x31bc('0x26')]));_0x4f7f97[_0x31bc('0x27')](_0x469f35['finally']['id'],function(_0x16a5fb){try{_0x16a5fb=_0x56d635[_0x31bc('0x36')](_0x16a5fb);logger[_0x31bc('0x28')]('vertex',JSON['stringify'](_0x16a5fb,null,0x2));if(_0x16a5fb&&_0x56d635[_0x16a5fb[_0x31bc('0xf')]]){_0x5ef5be=_0x56d635[_0x16a5fb[_0x31bc('0xf')]](_0x16a5fb);if(_0x5ef5be){logger[_0x31bc('0x28')](_0x31bc('0x2e'),inspect(_0x5ef5be));return _[_0x31bc('0x30')](_0x5ef5be['result'])?null:_0x5ef5be[_0x31bc('0x31')][_0x31bc('0x32')]();}else{logger[_0x31bc('0xc')]('response',inspect(_0x5ef5be));return null;}}else{logger['error'](_0x31bc('0x37'));return null;}}catch(_0x438f63){logger[_0x31bc('0xc')](_0x438f63[_0x31bc('0xe')]);return null;}});}logger['info'](util[_0x31bc('0x22')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xb783f3[_0x31bc('0x24')],_0xb783f3[_0x31bc('0x25')],_0xb783f3[_0x31bc('0x34')],_0xb783f3['dnid'],_0xb783f3[_0x31bc('0x26')]));logger[_0x31bc('0x23')](util['format'](_0x31bc('0x38'),_0xb783f3[_0x31bc('0x2b')],_0xb783f3[_0x31bc('0x2c')],parseInt(_0xb783f3[_0x31bc('0x2d')],0xa)+0x1));_0xb783f3[_0x31bc('0x39')](_0xb783f3[_0x31bc('0x2b')],_0xb783f3[_0x31bc('0x2c')],parseInt(_0xb783f3[_0x31bc('0x2d')],0xa)+0x1);_0xb783f3[_0x31bc('0x3a')]();}function handleNotFound(_0x513310){logger[_0x31bc('0xc')](util['format'](_0x31bc('0x3b'),_0x513310['arg_1']));_0x513310[_0x31bc('0x39')](_0x513310['context'],_0x513310[_0x31bc('0x2c')],parseInt(_0x513310[_0x31bc('0x2d')],0xa)+0x1);_0x513310['close']();}function handleUnpublished(_0x5de061){logger[_0x31bc('0xc')](util[_0x31bc('0x22')](_0x31bc('0x3c'),_0x5de061[_0x31bc('0x24')]));_0x5de061[_0x31bc('0x39')](_0x5de061[_0x31bc('0x2b')],_0x5de061[_0x31bc('0x2c')],parseInt(_0x5de061['priority'],0xa)+0x1);_0x5de061[_0x31bc('0x3a')]();}module[_0x31bc('0x3d')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xe979=['util','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','maxRetry','retry','omit','mxCell','isArray','length','source','target','addEdge','toJson','mxGraphModel','inspect','start','root','YYYY-MM-DD\x20HH:mm:ss','info','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','clear','vertex','stringify','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','evtHangup','debug','response','finally','format','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toString','agicommand\x20not\x20found','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','close','exports','moment','xml2json'];(function(_0x52973c,_0x3cbc09){var _0x192b6f=function(_0x397fbf){while(--_0x397fbf){_0x52973c['push'](_0x52973c['shift']());}};_0x192b6f(++_0x3cbc09);}(_0xe979,0x16c));var _0x9e97=function(_0x1a4a00,_0x3e3d48){_0x1a4a00=_0x1a4a00-0x0;var _0x3c4869=_0xe979[_0x1a4a00];return _0x3c4869;};'use strict';var _=require('lodash');var moment=require(_0x9e97('0x0'));var parser=require(_0x9e97('0x1'));var util=require(_0x9e97('0x2'));var logger=require(_0x9e97('0x3'))(_0x9e97('0x4'));var rpc=require(_0x9e97('0x5'));var mailRpc=require(_0x9e97('0x6'));var Graph=require(_0x9e97('0x7'));var Vertices=require(_0x9e97('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x9e97('0x9')]()['catch'](function(_0x2f43b9){logger[_0x9e97('0xa')](_0x9e97('0xb'),_0x2f43b9[_0x9e97('0xc')]);return[];});}function addVertex(_0x57d481,_0x4792ed,_0x3d9c01){_0x4792ed[_0x9e97('0xd')]=_0x3d9c01;if(_0x4792ed[_0x9e97('0xe')]('retry')){_0x4792ed[_0x9e97('0xf')]=parseInt(_0x4792ed[_0x9e97('0x10')],0xa);}_0x57d481['addVertex'](_[_0x9e97('0x11')](_0x4792ed,_0x9e97('0x12')));}function initGraph(_0x23f696,_0x423324){var _0x25613b=new Graph();for(var _0x224bde in _0x23f696){if(_0x23f696[_0x9e97('0xe')](_0x224bde)){if(_[_0x9e97('0x13')](_0x23f696[_0x224bde])){for(var _0x391eab=0x0;_0x391eab<_0x23f696[_0x224bde][_0x9e97('0x14')];_0x391eab+=0x1){addVertex(_0x25613b,_0x23f696[_0x224bde][_0x391eab],_0x224bde);}}else{addVertex(_0x25613b,_0x23f696[_0x224bde],_0x224bde);}}}for(var _0x44c439=0x0;_0x44c439<_0x423324[_0x9e97('0x14')];_0x44c439+=0x1){if(_0x423324[_0x44c439][_0x9e97('0x15')]&&_0x423324[_0x44c439][_0x9e97('0x16')]){_0x25613b[_0x9e97('0x17')](_0x423324[_0x44c439][_0x9e97('0x15')],_0x423324[_0x44c439][_0x9e97('0x16')],_0x423324[_0x44c439]['value']);}}return _0x25613b;}function getRoot(_0x3fad52){return parser[_0x9e97('0x18')](_0x3fad52,{'object':!![]})[_0x9e97('0x19')]['root'];}function inspect(_0x186674){return util[_0x9e97('0x1a')](_0x186674,{'showHidden':![],'depth':null});}function initialize(_0x1c72f0,_0x3615cc){var _0x2af46e=getRoot(_0x1c72f0['production']);if(!_0x2af46e||!_0x2af46e[_0x9e97('0x1b')])return;var _0x332bb9,_0x156f13,_0x3bf5fc;logger['debug'](_0x9e97('0x1c'),JSON['stringify'](_0x2af46e,null,0x2));_0x3615cc['joinAt']=moment()['format'](_0x9e97('0x1d'));_0x332bb9=initGraph(_['omit'](_0x2af46e,'mxCell'),_0x2af46e[_0x9e97('0x12')]);_0x156f13=new Vertices(_0x3615cc,rpc,mailRpc);logger[_0x9e97('0x1e')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3615cc[_0x9e97('0x1f')],_0x3615cc[_0x9e97('0x20')],_0x3615cc[_0x9e97('0x21')],_0x3615cc[_0x9e97('0x22')],_0x3615cc[_0x9e97('0x23')]));_0x332bb9[_0x9e97('0x24')](_0x2af46e[_0x9e97('0x1b')]['id'],function(_0x4643f9){try{_0x4643f9=_0x156f13[_0x9e97('0x25')](_0x4643f9);logger['debug'](_0x9e97('0x26'),JSON[_0x9e97('0x27')](_0x4643f9,null,0x2));if(_0x4643f9['agicommand']===_0x9e97('0x28')){logger[_0x9e97('0x1e')](_0x9e97('0x29'));_0x3615cc[_0x9e97('0x2a')]=_0x4643f9['context']||_0x3615cc[_0x9e97('0x2a')];_0x3615cc['extension']=_0x4643f9[_0x9e97('0x2b')];_0x3615cc[_0x9e97('0x2c')]=_0x4643f9[_0x9e97('0x2c')]?_0x4643f9[_0x9e97('0x2c')]-0x1:0x1;return null;}else if(_0x4643f9&&_0x156f13[_0x4643f9[_0x9e97('0xd')]]){_0x3bf5fc=_0x156f13[_0x4643f9[_0x9e97('0xd')]](_0x4643f9);logger[_0x9e97('0x1e')]('response',JSON[_0x9e97('0x27')](_0x3bf5fc,null,0x2));if(_0x3bf5fc&&_0x3bf5fc[_0x9e97('0x2d')]===AGI_CODE_SUCCESS&&_0x3bf5fc[_0x9e97('0x2e')]!==AGI_RESULT_ERROR&&!_0x3615cc[_0x9e97('0x2f')]){logger[_0x9e97('0x30')]('response',inspect(_0x3bf5fc));return _['isUndefined'](_0x3bf5fc[_0x9e97('0x2e')])?null:_0x3bf5fc[_0x9e97('0x2e')]['toString']();}else{logger[_0x9e97('0xa')](_0x9e97('0x31'),inspect(_0x3bf5fc));return null;}}else{logger[_0x9e97('0xa')]('agicommand\x20not\x20found');return null;}}catch(_0x63e2ff){logger[_0x9e97('0xa')](_0x63e2ff[_0x9e97('0xc')]);return null;}});if(_0x2af46e[_0x9e97('0x32')]){logger[_0x9e97('0x1e')](util[_0x9e97('0x33')](_0x9e97('0x34'),_0x3615cc[_0x9e97('0x1f')],_0x3615cc[_0x9e97('0x20')],_0x3615cc[_0x9e97('0x21')],_0x3615cc['dnid'],_0x3615cc['uniqueid']));_0x332bb9[_0x9e97('0x24')](_0x2af46e['finally']['id'],function(_0x333d14){try{_0x333d14=_0x156f13[_0x9e97('0x25')](_0x333d14);logger['debug'](_0x9e97('0x26'),JSON[_0x9e97('0x27')](_0x333d14,null,0x2));if(_0x333d14&&_0x156f13[_0x333d14[_0x9e97('0xd')]]){_0x3bf5fc=_0x156f13[_0x333d14[_0x9e97('0xd')]](_0x333d14);if(_0x3bf5fc){logger[_0x9e97('0x30')](_0x9e97('0x31'),inspect(_0x3bf5fc));return _['isUndefined'](_0x3bf5fc[_0x9e97('0x2e')])?null:_0x3bf5fc[_0x9e97('0x2e')][_0x9e97('0x35')]();}else{logger[_0x9e97('0xa')](_0x9e97('0x31'),inspect(_0x3bf5fc));return null;}}else{logger[_0x9e97('0xa')](_0x9e97('0x36'));return null;}}catch(_0x3d38c3){logger['error'](_0x3d38c3[_0x9e97('0xc')]);return null;}});}logger['info'](util[_0x9e97('0x33')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3615cc[_0x9e97('0x1f')],_0x3615cc[_0x9e97('0x20')],_0x3615cc[_0x9e97('0x21')],_0x3615cc[_0x9e97('0x22')],_0x3615cc[_0x9e97('0x23')]));logger[_0x9e97('0x1e')](util[_0x9e97('0x33')](_0x9e97('0x37'),_0x3615cc['context'],_0x3615cc[_0x9e97('0x2b')],parseInt(_0x3615cc[_0x9e97('0x2c')],0xa)+0x1));_0x3615cc[_0x9e97('0x38')](_0x3615cc['context'],_0x3615cc[_0x9e97('0x2b')],parseInt(_0x3615cc[_0x9e97('0x2c')],0xa)+0x1);_0x3615cc['close']();}function handleNotFound(_0x5eb9e9){logger[_0x9e97('0xa')](util[_0x9e97('0x33')](_0x9e97('0x39'),_0x5eb9e9[_0x9e97('0x1f')]));_0x5eb9e9['continueAt'](_0x5eb9e9[_0x9e97('0x2a')],_0x5eb9e9['extension'],parseInt(_0x5eb9e9[_0x9e97('0x2c')],0xa)+0x1);_0x5eb9e9['close']();}function handleUnpublished(_0x3a8479){logger[_0x9e97('0xa')](util['format'](_0x9e97('0x3a'),_0x3a8479[_0x9e97('0x1f')]));_0x3a8479[_0x9e97('0x38')](_0x3a8479[_0x9e97('0x2a')],_0x3a8479['extension'],parseInt(_0x3a8479['priority'],0xa)+0x1);_0x3a8479[_0x9e97('0x3b')]();}module[_0x9e97('0x3c')]={'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 45d69f7..186b3d5 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 _0xae7b=['emit','line','exports','util','stream','Transform','_localBuffer','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','slice','trim'];(function(_0x4c76ad,_0x24bdab){var _0xde0a18=function(_0x575d21){while(--_0x575d21){_0x4c76ad['push'](_0x4c76ad['shift']());}};_0xde0a18(++_0x24bdab);}(_0xae7b,0xbe));var _0xbae7=function(_0x268c4c,_0x5cce8d){_0x268c4c=_0x268c4c-0x0;var _0x37e96e=_0xae7b[_0x268c4c];return _0x37e96e;};'use strict';var util=require(_0xbae7('0x0'));var Transform=require(_0xbae7('0x1'))[_0xbae7('0x2')];function AGIReply(_0x593104){Transform['call'](this,_0x593104);this[_0xbae7('0x3')]='';this[_0xbae7('0x4')]=![];}util[_0xbae7('0x5')](AGIReply,Transform);AGIReply[_0xbae7('0x6')]['_transform']=function(_0x48b6a2,_0x339d6b,_0xb625f6){var _0x163147='\x0a',_0x56c84c=['\x0a\x0a',_0xbae7('0x7')],_0x429316=-0x1,_0x539635=-0x1,_0x228a90='',_0x319b0b=0x0,_0x100e0e='',_0x4dba83='';this['_localBuffer']+=_0x48b6a2[_0xbae7('0x8')]();_0x100e0e=this[_0xbae7('0x3')];if(!this[_0xbae7('0x4')]){_0x319b0b=0x0;while(_0x56c84c[_0x319b0b]){while((_0x539635=_0x100e0e[_0xbae7('0x9')](_0x56c84c[_0x319b0b]))!=-0x1){_0x228a90=_0x56c84c[_0x319b0b];_0x4dba83=_0x100e0e['substring'](0x0,_0x539635);_0x100e0e=_0x100e0e[_0xbae7('0xa')](_0x539635+_0x228a90[_0xbae7('0xb')]);var _0x484906=_0x4dba83['split'](_0x163147),_0x123146=0x0,_0x48af40={},_0x3d17ae='',_0x4090a1='',_0x5b1abe=-0x1;while(_0x484906[_0x123146]){_0x5b1abe=_0x484906[_0x123146][_0xbae7('0x9')](':');if(_0x5b1abe!=-0x1){_0x3d17ae=_0x484906[_0x123146][_0xbae7('0xc')](0x0,_0x5b1abe)[_0xbae7('0xd')]();_0x4090a1=_0x484906[_0x123146][_0xbae7('0xc')](_0x5b1abe+0x1)['trim']();if(_0x3d17ae[_0xbae7('0xb')]>0x0){_0x48af40[_0x3d17ae]=_0x4090a1;}}else{}_0x123146++;}this['emit']('headers',_0x48af40);this[_0xbae7('0x4')]=!![];}_0x319b0b++;}this[_0xbae7('0x3')]=_0x100e0e;}else{while((_0x429316=_0x100e0e[_0xbae7('0x9')](_0x163147))!=-0x1){_0x4dba83=_0x100e0e[_0xbae7('0xa')](0x0,_0x429316);this[_0xbae7('0xe')](_0xbae7('0xf'),_0x4dba83);_0x100e0e=_0x100e0e['substring'](_0x429316+_0x163147[_0xbae7('0xb')]);}this[_0xbae7('0x3')]=_0x100e0e;}_0xb625f6();};module[_0xbae7('0x10')]=AGIReply; \ No newline at end of file +var _0x6c29=['split','indexOf','slice','trim','_inBody','line','exports','util','stream','Transform','call','_localBuffer','prototype','_transform','toString','substring','length'];(function(_0xc5ece6,_0x49bb52){var _0x8b99b=function(_0x5036cd){while(--_0x5036cd){_0xc5ece6['push'](_0xc5ece6['shift']());}};_0x8b99b(++_0x49bb52);}(_0x6c29,0x1c1));var _0x96c2=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0x6c29[_0x2afbb0];return _0x411ff2;};'use strict';var util=require(_0x96c2('0x0'));var Transform=require(_0x96c2('0x1'))[_0x96c2('0x2')];function AGIReply(_0x292bfc){Transform[_0x96c2('0x3')](this,_0x292bfc);this[_0x96c2('0x4')]='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x96c2('0x5')][_0x96c2('0x6')]=function(_0x5c84c4,_0x1c8b4a,_0x43d7fd){var _0x2ee7c6='\x0a',_0x2f9b84=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x4e15bd=-0x1,_0x3dbbc2=-0x1,_0x2d1973='',_0x4406ad=0x0,_0x384fa2='',_0x18ca2c='';this[_0x96c2('0x4')]+=_0x5c84c4[_0x96c2('0x7')]();_0x384fa2=this[_0x96c2('0x4')];if(!this['_inBody']){_0x4406ad=0x0;while(_0x2f9b84[_0x4406ad]){while((_0x3dbbc2=_0x384fa2['indexOf'](_0x2f9b84[_0x4406ad]))!=-0x1){_0x2d1973=_0x2f9b84[_0x4406ad];_0x18ca2c=_0x384fa2[_0x96c2('0x8')](0x0,_0x3dbbc2);_0x384fa2=_0x384fa2[_0x96c2('0x8')](_0x3dbbc2+_0x2d1973[_0x96c2('0x9')]);var _0x4afb0e=_0x18ca2c[_0x96c2('0xa')](_0x2ee7c6),_0x1e763d=0x0,_0x1fcfe6={},_0x110a0d='',_0x605573='',_0xa933c3=-0x1;while(_0x4afb0e[_0x1e763d]){_0xa933c3=_0x4afb0e[_0x1e763d][_0x96c2('0xb')](':');if(_0xa933c3!=-0x1){_0x110a0d=_0x4afb0e[_0x1e763d][_0x96c2('0xc')](0x0,_0xa933c3)[_0x96c2('0xd')]();_0x605573=_0x4afb0e[_0x1e763d][_0x96c2('0xc')](_0xa933c3+0x1)['trim']();if(_0x110a0d[_0x96c2('0x9')]>0x0){_0x1fcfe6[_0x110a0d]=_0x605573;}}else{}_0x1e763d++;}this['emit']('headers',_0x1fcfe6);this[_0x96c2('0xe')]=!![];}_0x4406ad++;}this['_localBuffer']=_0x384fa2;}else{while((_0x4e15bd=_0x384fa2[_0x96c2('0xb')](_0x2ee7c6))!=-0x1){_0x18ca2c=_0x384fa2[_0x96c2('0x8')](0x0,_0x4e15bd);this['emit'](_0x96c2('0xf'),_0x18ca2c);_0x384fa2=_0x384fa2[_0x96c2('0x8')](_0x4e15bd+_0x2ee7c6[_0x96c2('0x9')]);}this[_0x96c2('0x4')]=_0x384fa2;}_0x43d7fd();};module[_0x96c2('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 677ae49..da4c1d6 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 _0x9221=['email','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn','getUserById','getContactByPhone','GetContactByPhone','phone','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','Interval','Intervals','ShowSmsAccount','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','LogoutUser','moment','jayson/promise','http','request','then','error','result','catch','GetSquareProjects','production','getSquareProject','getMailAccountById','ShowMailAccount','Smtp','CloudProvider','name'];(function(_0x48c23e,_0x5c8409){var _0x4f7aee=function(_0x852640){while(--_0x852640){_0x48c23e['push'](_0x48c23e['shift']());}};_0x4f7aee(++_0x5c8409);}(_0x9221,0x64));var _0x1922=function(_0x5585f5,_0x167771){_0x5585f5=_0x5585f5-0x0;var _0x3439c9=_0x9221[_0x5585f5];return _0x3439c9;};'use strict';var _=require('lodash');var moment=require(_0x1922('0x0'));var jayson=require(_0x1922('0x1'));var client=jayson['client'][_0x1922('0x2')]({'port':0x2329});function request(_0x1099ca,_0x5f14f2){return new Promise(function(_0x309b6b,_0x43c8a3){return client[_0x1922('0x3')](_0x1099ca,_0x5f14f2)[_0x1922('0x4')](function(_0x263f7f){if(_0x263f7f[_0x1922('0x5')]){return _0x43c8a3(_0x263f7f[_0x1922('0x5')]['message']);}else{return _0x309b6b(_0x263f7f[_0x1922('0x6')]);}})[_0x1922('0x7')](function(_0x195fa4){return _0x43c8a3(_0x195fa4);});});}exports['getSquareProjects']=function(){return request(_0x1922('0x8'),{'options':{'raw':![],'attributes':['id','name',_0x1922('0x9')]}});};exports[_0x1922('0xa')]=function(_0x1082d8){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x1082d8},'attributes':[_0x1922('0x9')]}});};exports[_0x1922('0xb')]=function(_0x5c488f){return request(_0x1922('0xc'),{'options':{'raw':![],'where':{'id':_0x5c488f},'include':[{'model':'MailServerOut','as':_0x1922('0xd'),'include':[{'model':'CloudProvider','as':_0x1922('0xe')}]}],'attributes':['id',_0x1922('0xf'),_0x1922('0x10')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x514b6d){return request(_0x1922('0x11'),{'options':{'where':{'id':_0x514b6d},'attributes':[_0x1922('0xf')]}});};exports[_0x1922('0x12')]=function(_0x3116dc){return request(_0x1922('0x13'),{'options':{'where':{'id':_0x3116dc},'attributes':['name']}});};exports[_0x1922('0x14')]=function(_0x4cb94e){return request(_0x1922('0x15'),{'options':{'where':{'id':_0x4cb94e},'attributes':[_0x1922('0xf')]}});};exports[_0x1922('0x16')]=function(_0x207ff4){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x207ff4},'attributes':[_0x1922('0x17')]}});};exports[_0x1922('0x18')]=function(_0x2c9ed9){return request('ShowUser',{'options':{'where':{'id':_0x2c9ed9},'attributes':['name']}});};exports[_0x1922('0x19')]=function(_0x51acda){return request(_0x1922('0x1a'),{'options':{'where':{'phone':_0x51acda[_0x1922('0x1b')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x4c60f8){return request(_0x1922('0x1c'),{'options':{'where':{'id':_0x4c60f8},'attributes':['name']}});};exports[_0x1922('0x1d')]=function(_0x199997){return request(_0x1922('0x1e'),{'options':{'where':{'id':_0x199997},'attributes':[_0x1922('0x1f')]}});};exports['getIntervalById']=function(_0x2f2c49){return request(_0x1922('0x20'),{'options':{'raw':![],'where':{'id':_0x2f2c49},'include':[{'model':_0x1922('0x21'),'as':_0x1922('0x22')}]}});};exports['getSmsAccountById']=function(_0xa5a368){return request(_0x1922('0x23'),{'options':{'where':{'id':_0xa5a368},'attributes':['id',_0x1922('0xf')]}});};exports['createSmsMessage']=function(_0x29b92f){return request('CreateSmsMessage',{'body':_0x29b92f});};exports['createSquareDetailsReport']=function(_0x82372b){return request(_0x1922('0x24'),{'body':_0x82372b});};exports[_0x1922('0x25')]=function(_0x17deb3){return request(_0x1922('0x26'),{'body':_[_0x1922('0x27')](_0x17deb3,{'project_name':_0x17deb3[_0x1922('0x28')],'prev_project_name':_0x17deb3[_0x1922('0x29')]||'','is_subproject':_0x17deb3[_0x1922('0x29')]?!![]:![],'leaveAt':moment()[_0x1922('0x2a')](_0x1922('0x2b'))})});};exports['createSquareRecording']=function(_0x3db249){return request('CreateSquareRecording',{'body':_0x3db249});};exports[_0x1922('0x2c')]=function(_0x43f56c){return request(_0x1922('0x2d'),{'body':_0x43f56c});};exports[_0x1922('0x2e')]=function(_0x1bb708){return request(_0x1922('0x2f'),{'options':{'raw':![],'where':{'phone':_0x1bb708[_0x1922('0x1b')],'ListId':_0x1bb708[_0x1922('0x30')]}}})[_0x1922('0x4')](function(_0x4b0799){if(_0x4b0799){return _0x4b0799;}return request(_0x1922('0x31'),{'body':_0x1bb708});});};exports[_0x1922('0x32')]=function(_0x353c71){return request(_0x1922('0x33'),{'options':{'where':{'id':_0x353c71},'attributes':[_0x1922('0xf')]}});};exports['agentLogin']=function(_0x10f398,_0x39d7d5){return request(_0x1922('0x34'),{'body':{'interface':_0x39d7d5},'options':{'where':_0x10f398}});};exports[_0x1922('0x35')]=function(_0x2a4215,_0x474e85,_0x17a45b){return request('PauseUser',{'body':{'type':_0x474e85,'uniqueid':_0x17a45b},'options':{'where':_0x2a4215}});};exports[_0x1922('0x36')]=function(_0x3f9435){return request(_0x1922('0x37'),{'body':{},'options':{'where':_0x3f9435}});};exports[_0x1922('0x38')]=function(_0x40234e){return request(_0x1922('0x39'),{'body':{},'options':{'where':_0x40234e}});}; \ No newline at end of file +var _0xcb81=['createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','client','request','then','error','message','catch','getSquareProjects','name','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording'];(function(_0x51b1a5,_0x285a4f){var _0x15c738=function(_0x5c94d7){while(--_0x5c94d7){_0x51b1a5['push'](_0x51b1a5['shift']());}};_0x15c738(++_0x285a4f);}(_0xcb81,0x154));var _0x1cb8=function(_0x74745d,_0x177606){_0x74745d=_0x74745d-0x0;var _0x174ab3=_0xcb81[_0x74745d];return _0x174ab3;};'use strict';var _=require(_0x1cb8('0x0'));var moment=require(_0x1cb8('0x1'));var jayson=require('jayson/promise');var client=jayson[_0x1cb8('0x2')]['http']({'port':0x2329});function request(_0x5e8697,_0x55f3a0){return new Promise(function(_0x38c3ea,_0x33a8f2){return client[_0x1cb8('0x3')](_0x5e8697,_0x55f3a0)[_0x1cb8('0x4')](function(_0x41b867){if(_0x41b867['error']){return _0x33a8f2(_0x41b867[_0x1cb8('0x5')][_0x1cb8('0x6')]);}else{return _0x38c3ea(_0x41b867['result']);}})[_0x1cb8('0x7')](function(_0x39b4ad){return _0x33a8f2(_0x39b4ad);});});}exports[_0x1cb8('0x8')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0x1cb8('0x9'),'production']}});};exports['getSquareProject']=function(_0x29e901){return request(_0x1cb8('0xa'),{'options':{'raw':![],'where':{'name':_0x29e901},'attributes':[_0x1cb8('0xb')]}});};exports[_0x1cb8('0xc')]=function(_0x267dde){return request(_0x1cb8('0xd'),{'options':{'raw':![],'where':{'id':_0x267dde},'include':[{'model':_0x1cb8('0xe'),'as':_0x1cb8('0xf'),'include':[{'model':'CloudProvider','as':_0x1cb8('0x10')}]}],'attributes':['id',_0x1cb8('0x9'),_0x1cb8('0x11')],'smtp':!![]}});};exports[_0x1cb8('0x12')]=function(_0x1371cb){return request('ShowSquareProject',{'options':{'where':{'id':_0x1371cb},'attributes':[_0x1cb8('0x9')]}});};exports[_0x1cb8('0x13')]=function(_0xcb6ad1){return request(_0x1cb8('0x14'),{'options':{'where':{'id':_0xcb6ad1},'attributes':[_0x1cb8('0x9')]}});};exports[_0x1cb8('0x15')]=function(_0x339ad0){return request(_0x1cb8('0x16'),{'options':{'where':{'id':_0x339ad0},'attributes':['name']}});};exports[_0x1cb8('0x17')]=function(_0x4b4917){return request(_0x1cb8('0x18'),{'options':{'where':{'id':_0x4b4917},'attributes':[_0x1cb8('0x19')]}});};exports[_0x1cb8('0x1a')]=function(_0x46abd0){return request(_0x1cb8('0x1b'),{'options':{'where':{'id':_0x46abd0},'attributes':[_0x1cb8('0x9')]}});};exports[_0x1cb8('0x1c')]=function(_0x9f0adb){return request(_0x1cb8('0x1d'),{'options':{'where':{'phone':_0x9f0adb[_0x1cb8('0x1e')]},'attributes':['id']}});};exports[_0x1cb8('0x1f')]=function(_0x3cda27){return request('ShowTrunk',{'options':{'where':{'id':_0x3cda27},'attributes':[_0x1cb8('0x9')]}});};exports[_0x1cb8('0x20')]=function(_0x170f34){return request(_0x1cb8('0x21'),{'options':{'where':{'id':_0x170f34},'attributes':['save_name']}});};exports[_0x1cb8('0x22')]=function(_0x4f9220){return request(_0x1cb8('0x23'),{'options':{'raw':![],'where':{'id':_0x4f9220},'include':[{'model':_0x1cb8('0x24'),'as':_0x1cb8('0x25')}]}});};exports[_0x1cb8('0x26')]=function(_0x559916){return request('ShowSmsAccount',{'options':{'where':{'id':_0x559916},'attributes':['id',_0x1cb8('0x9')]}});};exports[_0x1cb8('0x27')]=function(_0x22dafe){return request(_0x1cb8('0x28'),{'body':_0x22dafe});};exports[_0x1cb8('0x29')]=function(_0x30985c){return request(_0x1cb8('0x2a'),{'body':_0x30985c});};exports['createSquareReport']=function(_0x1ec384){return request(_0x1cb8('0x2b'),{'body':_[_0x1cb8('0x2c')](_0x1ec384,{'project_name':_0x1ec384[_0x1cb8('0x2d')],'prev_project_name':_0x1ec384[_0x1cb8('0x2e')]||'','is_subproject':_0x1ec384[_0x1cb8('0x2e')]?!![]:![],'leaveAt':moment()['format'](_0x1cb8('0x2f'))})});};exports[_0x1cb8('0x30')]=function(_0xfdfb31){return request(_0x1cb8('0x31'),{'body':_0xfdfb31});};exports[_0x1cb8('0x32')]=function(_0x4a9b74){return request(_0x1cb8('0x33'),{'body':_0x4a9b74});};exports[_0x1cb8('0x34')]=function(_0x3a8b53){return request(_0x1cb8('0x35'),{'options':{'raw':![],'where':{'phone':_0x3a8b53['phone'],'ListId':_0x3a8b53[_0x1cb8('0x36')]}}})[_0x1cb8('0x4')](function(_0x3a6a67){if(_0x3a6a67){return _0x3a6a67;}return request('CreateCmContact',{'body':_0x3a8b53});});};exports[_0x1cb8('0x37')]=function(_0x2a6da9){return request(_0x1cb8('0x38'),{'options':{'where':{'id':_0x2a6da9},'attributes':['name']}});};exports[_0x1cb8('0x39')]=function(_0x3e2af4,_0x239c62){return request(_0x1cb8('0x3a'),{'body':{'interface':_0x239c62},'options':{'where':_0x3e2af4}});};exports[_0x1cb8('0x3b')]=function(_0x54278d,_0x2607f0,_0x1de806){return request(_0x1cb8('0x3c'),{'body':{'type':_0x2607f0,'uniqueid':_0x1de806},'options':{'where':_0x54278d}});};exports[_0x1cb8('0x3d')]=function(_0x18fe1b){return request(_0x1cb8('0x3e'),{'body':{},'options':{'where':_0x18fe1b}});};exports[_0x1cb8('0x3f')]=function(_0x18cc99){return request(_0x1cb8('0x40'),{'body':{},'options':{'where':_0x18cc99}});}; \ 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 06fdb24..e6126f1 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 _0x7c1a=['./polly','./lex','exports'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x7c1a,0x159));var _0xa7c1=function(_0x59f3c8,_0x269e43){_0x59f3c8=_0x59f3c8-0x0;var _0x320c2f=_0x7c1a[_0x59f3c8];return _0x320c2f;};var polly=require(_0xa7c1('0x0'));var lex=require(_0xa7c1('0x1'));module[_0xa7c1('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xdfe7=['./lex','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdfe7,0xc8));var _0x7dfe=function(_0x2ea010,_0x20ab5b){_0x2ea010=_0x2ea010-0x0;var _0x215bc3=_0xdfe7[_0x2ea010];return _0x215bc3;};var polly=require('./polly');var lex=require(_0x7dfe('0x0'));module[_0x7dfe('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 4b7c7ac..77d1eb1 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 _0xd8b0=['exports','./lib/api'];(function(_0x483de0,_0x58b3e1){var _0x72e01c=function(_0x2dbe59){while(--_0x2dbe59){_0x483de0['push'](_0x483de0['shift']());}};_0x72e01c(++_0x58b3e1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var lex=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]=function(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1){return lex(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1);}; \ No newline at end of file +var _0x55e0=['./lib/api','exports'];(function(_0x499a53,_0x3f90d8){var _0xfa7d8a=function(_0x411bc3){while(--_0x411bc3){_0x499a53['push'](_0x499a53['shift']());}};_0xfa7d8a(++_0x3f90d8);}(_0x55e0,0xdc));var _0x055e=function(_0x484ba8,_0x38aa81){_0x484ba8=_0x484ba8-0x0;var _0x975e23=_0x55e0[_0x484ba8];return _0x975e23;};'use strict';var lex=require(_0x055e('0x0'));module[_0x055e('0x1')]=function(_0x2e09a6,_0x414740,_0x5b82b9,_0x578882,_0x3a2ee6,_0x2d9bd5){return lex(_0x2e09a6,_0x414740,_0x5b82b9,_0x578882,_0x3a2ee6,_0x2d9bd5);}; \ 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 f9e6ed1..9529b20 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(_0x51b127,_0x418542){var _0x3dd74d=function(_0xcc4f3b){while(--_0xcc4f3b){_0x51b127['push'](_0x51b127['shift']());}};_0x3dd74d(++_0x418542);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x44f0f2,_0x2f383f){var _0x5462f5=function(_0x3c47e6){while(--_0x3c47e6){_0x44f0f2['push'](_0x44f0f2['shift']());}};_0x5462f5(++_0x2f383f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 1dbab38..869508a 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 _0x4752=['./lib/api','exports'];(function(_0x24502f,_0x134350){var _0x402fd9=function(_0x5e90b2){while(--_0x5e90b2){_0x24502f['push'](_0x24502f['shift']());}};_0x402fd9(++_0x134350);}(_0x4752,0x9c));var _0x2475=function(_0x4a12fd,_0x27c87e){_0x4a12fd=_0x4a12fd-0x0;var _0x50bacd=_0x4752[_0x4a12fd];return _0x50bacd;};'use strict';var polly=require(_0x2475('0x0'));module[_0x2475('0x1')]=function(_0x2e3094,_0xc1a445,_0x99af8b,_0x2a7980,_0x25a073,_0x4014b5,_0x27fdae){return polly(_0x2e3094,_0xc1a445,_0x99af8b,_0x2a7980,_0x25a073,_0x4014b5,_0x27fdae);}; \ No newline at end of file +var _0x31ee=['./lib/api','exports'];(function(_0x19613f,_0x57e298){var _0x153aeb=function(_0x1d3c4f){while(--_0x1d3c4f){_0x19613f['push'](_0x19613f['shift']());}};_0x153aeb(++_0x57e298);}(_0x31ee,0x148));var _0xe31e=function(_0x9cca8c,_0x5b591e){_0x9cca8c=_0x9cca8c-0x0;var _0x40463e=_0x31ee[_0x9cca8c];return _0x40463e;};'use strict';var polly=require(_0xe31e('0x0'));module[_0xe31e('0x1')]=function(_0x40449f,_0x5be9be,_0x17e77b,_0x30ace9,_0x29a05d,_0x13dd84,_0x268f48){return polly(_0x40449f,_0x5be9be,_0x17e77b,_0x30ace9,_0x29a05d,_0x13dd84,_0x268f48);}; \ 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 fa6e46c..0b37dc3 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 _0x7b3a=['path','bluebird','randomstring','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text'];(function(_0x5a0247,_0x4043d0){var _0x2197c6=function(_0x30dcf6){while(--_0x30dcf6){_0x5a0247['push'](_0x5a0247['shift']());}};_0x2197c6(++_0x4043d0);}(_0x7b3a,0xf0));var _0xa7b3=function(_0xbc641b,_0x2dd133){_0xbc641b=_0xbc641b-0x0;var _0xdbed64=_0x7b3a[_0xbc641b];return _0xdbed64;};'use strict';var fs=require('fs');var path=require(_0xa7b3('0x0'));var BPromise=require(_0xa7b3('0x1'));var rs=require(_0xa7b3('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x37d91c,_0x34a3a4,_0x162e1a){return new BPromise(function(_0x1f2f64,_0x4a73a7){_0x37d91c[_0xa7b3('0x3')](_0x34a3a4,function(_0x35b02b,_0x3d6597){if(_0x35b02b){_0x4a73a7(_0x35b02b);}else if(_0x3d6597){if(_0x3d6597['AudioStream']instanceof Buffer){fs['writeFile'](_0x162e1a,_0x3d6597[_0xa7b3('0x4')],function(_0x513255){if(_0x513255){_0x4a73a7(_0x513255);}else{_0x1f2f64();}});}else{_0x4a73a7(new Error(_0xa7b3('0x5')));}}else{_0x4a73a7(new Error(_0xa7b3('0x6')));}});});}module[_0xa7b3('0x7')]=function(_0x2aebad,_0x4dc99e,_0x59e3f6,_0x224f50,_0x5c4685,_0x33e2cf,_0x6b7fc1){var _0x1d87f9=new AWS[(_0xa7b3('0x8'))]({'accessKeyId':_0x2aebad,'secretAccessKey':_0x4dc99e,'region':_0x59e3f6});var _0xf25ca6={'Text':_0x5c4685,'TextType':_0x33e2cf||_0xa7b3('0x9'),'OutputFormat':'mp3','VoiceId':_0x224f50};return pollyResult(_0x1d87f9,_0xf25ca6,_0x6b7fc1);}; \ No newline at end of file +var _0x53c5=['mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x99307b,_0x54ba56){var _0x252249=function(_0x303a0c){while(--_0x303a0c){_0x99307b['push'](_0x99307b['shift']());}};_0x252249(++_0x54ba56);}(_0x53c5,0x12d));var _0x553c=function(_0x369d74,_0x4d858c){_0x369d74=_0x369d74-0x0;var _0x439f60=_0x53c5[_0x369d74];return _0x439f60;};'use strict';var fs=require('fs');var path=require(_0x553c('0x0'));var BPromise=require(_0x553c('0x1'));var rs=require(_0x553c('0x2'));var AWS=require(_0x553c('0x3'));function pollyResult(_0x3564c9,_0x43343f,_0x4ad0f5){return new BPromise(function(_0xb02ab2,_0x3f43e5){_0x3564c9[_0x553c('0x4')](_0x43343f,function(_0x33f915,_0x18250d){if(_0x33f915){_0x3f43e5(_0x33f915);}else if(_0x18250d){if(_0x18250d[_0x553c('0x5')]instanceof Buffer){fs[_0x553c('0x6')](_0x4ad0f5,_0x18250d[_0x553c('0x5')],function(_0x39c89c){if(_0x39c89c){_0x3f43e5(_0x39c89c);}else{_0xb02ab2();}});}else{_0x3f43e5(new Error(_0x553c('0x7')));}}else{_0x3f43e5(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x553c('0x8')]=function(_0x2161fa,_0x323c8a,_0x52b902,_0x51b1fe,_0x266f78,_0x41ae0d,_0x1da949){var _0x42ef5b=new AWS['Polly']({'accessKeyId':_0x2161fa,'secretAccessKey':_0x323c8a,'region':_0x52b902});var _0x19f4a6={'Text':_0x266f78,'TextType':_0x41ae0d||'text','OutputFormat':_0x553c('0x9'),'VoiceId':_0x51b1fe};return pollyResult(_0x42ef5b,_0x19f4a6,_0x1da949);}; \ 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 04b6ead..f04bfa3 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. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x48c43d,_0xebded2,_0x8286fc,_0x3085dd){return asr(_0x48c43d,_0xebded2,_0x8286fc);}; \ No newline at end of file +var _0x4f73=['exports','./lib/api'];(function(_0x19047b,_0x47106a){var _0x3be5db=function(_0x144b9c){while(--_0x144b9c){_0x19047b['push'](_0x19047b['shift']());}};_0x3be5db(++_0x47106a);}(_0x4f73,0xb3));var _0x34f7=function(_0x58965a,_0x2e71db){_0x58965a=_0x58965a-0x0;var _0x254efc=_0x4f73[_0x58965a];return _0x254efc;};'use strict';var asr=require(_0x34f7('0x0'));module[_0x34f7('0x1')]=function(_0x30f167,_0x893378,_0x4f0885,_0x55967c){return asr(_0x30f167,_0x893378,_0x4f0885);}; \ 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 4b65f53..9405576 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 _0xe5b3=['https://speech.googleapis.com','exports','string','length','undefined','lang\x20should\x20be\x20a\x20string','base64','POST','/v1/speech:recognize?key=','LINEAR16','bluebird'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe5b3,0x133));var _0x3e5b=function(_0x312aaa,_0x5ace19){_0x312aaa=_0x312aaa-0x0;var _0x478545=_0xe5b3[_0x312aaa];return _0x478545;};'use strict';var url=require('url');var BPromise=require(_0x3e5b('0x0'));var fs=require('fs');var host=_0x3e5b('0x1');module[_0x3e5b('0x2')]=function(_0x1c38ed,_0x2a71ef,_0x3171c5){return new BPromise(function(_0x7f1cc0,_0x1e58ed){var _0x320b1e;if(typeof _0x1c38ed!==_0x3e5b('0x3')||_0x1c38ed[_0x3e5b('0x4')]===0x0){return _0x1e58ed('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x2a71ef!==_0x3e5b('0x3')||_0x2a71ef[_0x3e5b('0x4')]===0x0){return _0x1e58ed('key\x20should\x20be\x20a\x20string');}if(typeof _0x3171c5!==_0x3e5b('0x5')&&(typeof _0x3171c5!==_0x3e5b('0x3')||_0x3171c5[_0x3e5b('0x4')]===0x0)){return _0x1e58ed(_0x3e5b('0x6'));}try{_0x320b1e=fs['readFileSync'](_0x1c38ed)['toString'](_0x3e5b('0x7'));}catch(_0x3d3b6e){return _0x1e58ed(_0x3d3b6e);}return _0x7f1cc0({'method':_0x3e5b('0x8'),'uri':host+_0x3e5b('0x9')+_0x2a71ef,'body':{'config':{'encoding':_0x3e5b('0xa'),'sampleRateHertz':'8000','languageCode':_0x3171c5},'audio':{'content':_0x320b1e}},'json':!![]});});}; \ No newline at end of file +var _0x8868=['base64','/v1/speech:recognize?key=','url','bluebird','https://speech.googleapis.com','exports','string','length','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x8868,0x1ca));var _0x8886=function(_0x5dc577,_0x1de92b){_0x5dc577=_0x5dc577-0x0;var _0x250b22=_0x8868[_0x5dc577];return _0x250b22;};'use strict';var url=require(_0x8886('0x0'));var BPromise=require(_0x8886('0x1'));var fs=require('fs');var host=_0x8886('0x2');module[_0x8886('0x3')]=function(_0x11d0f9,_0x46ec8e,_0x34cd50){return new BPromise(function(_0x2508b2,_0x230fbb){var _0x224e93;if(typeof _0x11d0f9!==_0x8886('0x4')||_0x11d0f9['length']===0x0){return _0x230fbb('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x46ec8e!==_0x8886('0x4')||_0x46ec8e[_0x8886('0x5')]===0x0){return _0x230fbb('key\x20should\x20be\x20a\x20string');}if(typeof _0x34cd50!==_0x8886('0x6')&&(typeof _0x34cd50!=='string'||_0x34cd50[_0x8886('0x5')]===0x0)){return _0x230fbb(_0x8886('0x7'));}try{_0x224e93=fs[_0x8886('0x8')](_0x11d0f9)[_0x8886('0x9')](_0x8886('0xa'));}catch(_0x57b50){return _0x230fbb(_0x57b50);}return _0x2508b2({'method':'POST','uri':host+_0x8886('0xb')+_0x46ec8e,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':'8000','languageCode':_0x34cd50},'audio':{'content':_0x224e93}},'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 c8a6ea4..e246d55 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 _0xcf59=['./asr'];(function(_0xa6e0ec,_0x107711){var _0xc215c=function(_0x184b89){while(--_0x184b89){_0xa6e0ec['push'](_0xa6e0ec['shift']());}};_0xc215c(++_0x107711);}(_0xcf59,0x122));var _0x9cf5=function(_0x3786dd,_0x5777fc){_0x3786dd=_0x3786dd-0x0;var _0x4c7a8e=_0xcf59[_0x3786dd];return _0x4c7a8e;};var asr=require(_0x9cf5('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x1055=['./asr','exports'];(function(_0x400d80,_0x5d771f){var _0x56a6c9=function(_0x38f805){while(--_0x38f805){_0x400d80['push'](_0x400d80['shift']());}};_0x56a6c9(++_0x5d771f);}(_0x1055,0x1d0));var _0x5105=function(_0x4fdd64,_0x4ec5d4){_0x4fdd64=_0x4fdd64-0x0;var _0x1e9ae1=_0x1055[_0x4fdd64];return _0x1e9ae1;};var asr=require(_0x5105('0x0'));module[_0x5105('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index e68eade..20cf9cf 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 _0x0066=['audiofile','dirName','dialogflow','http','https','md5','path','querystring','request-promise','sox','url','parse','util','./aws','./google','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','download\x20error','pipe','end','transcode','error\x20convert','finish\x20to\x20convert','resolve','tmp','.wav','writeFileSync','base64','then','unlink','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','text:synthesize','POST','generate','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','utf8','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','asr','uri','results','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','source','result','action','actionIncomplete','fulfillment','speech','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','ispeechTTS','format','ispeechASR','model=%s','freeform=3','nda','text','channelData','CustomAction','AudioFromTts'];(function(_0x45175a,_0x2ab997){var _0x390448=function(_0x12f8f9){while(--_0x12f8f9){_0x45175a['push'](_0x45175a['shift']());}};_0x390448(++_0x2ab997);}(_0x0066,0x1a9));var _0x6006=function(_0xabe9cd,_0x39dda7){_0xabe9cd=_0xabe9cd-0x0;var _0x10cc3d=_0x0066[_0xabe9cd];return _0x10cc3d;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0x6006('0x0'));var fs=require('fs');var http=require(_0x6006('0x1'));var https=require(_0x6006('0x2'));var md5=require(_0x6006('0x3'));var path=require(_0x6006('0x4'));var querystring=require(_0x6006('0x5'));var rp=require(_0x6006('0x6'));var rs=require('randomstring');var sox=require(_0x6006('0x7'));var tts=require('google-tts-api');var urlParse=require(_0x6006('0x8'))[_0x6006('0x9')];var util=require(_0x6006('0xa'));var aws=require(_0x6006('0xb'));var google=require(_0x6006('0xc'));var sestek=require(_0x6006('0xd'));var tilde=require(_0x6006('0xe'));var logger=require('../../../config/logger')(_0x6006('0xf'));var ISPEECH_API=_0x6006('0x10');function downloadFile(_0x6f9897,_0x19cb9c){return new BPromise(function(_0x3304d5,_0x57d535){var _0x4852bc=urlParse(_0x6f9897);var _0xea162c=_0x4852bc[_0x6006('0x11')]===_0x6006('0x12')?https:http;var _0x33a01c={'host':_0x4852bc[_0x6006('0x13')],'path':_0x4852bc['path'],'headers':{'user-agent':_0x6006('0x14')}};_0xea162c[_0x6006('0x15')](_0x33a01c,function(_0x2b97b8){if(_0x2b97b8[_0x6006('0x16')]!==0xc8){logger[_0x6006('0x17')](_0x6006('0x18')+_0x6f9897+_0x6006('0x19')+_0x2b97b8[_0x6006('0x16')]+'\x20('+_0x2b97b8[_0x6006('0x1a')]+')');_0x57d535(new Error(_0x6006('0x18')+_0x6f9897+_0x6006('0x19')+_0x2b97b8[_0x6006('0x16')]+'\x20('+_0x2b97b8[_0x6006('0x1a')]+')'));return;}var _0x587f9b=fs[_0x6006('0x1b')](_0x19cb9c);_0x587f9b['on'](_0x6006('0x1c'),function(){logger[_0x6006('0x1d')](_0x6006('0x1e'));_0x587f9b[_0x6006('0x1f')](_0x3304d5);});_0x587f9b['on'](_0x6006('0x17'),function(_0xf759c7){fs['unlink'](_0x19cb9c);logger[_0x6006('0x17')](_0x6006('0x20'),_0xf759c7);_0x57d535(_0xf759c7);});_0x2b97b8[_0x6006('0x21')](_0x587f9b);})['on'](_0x6006('0x17'),function(_0xfbd90e){logger['error'](_0xfbd90e);_0x57d535(_0xfbd90e);})[_0x6006('0x22')]();});}function uploadFile(_0x2a78e0){return new BPromise(function(_0x5ab1fb,_0x462f06){var _0x3867ad=urlParse(_0x2a78e0);var _0x3db067=_0x3867ad[_0x6006('0x11')]===_0x6006('0x12')?https:http;var _0x42aeef={'host':_0x3867ad['host'],'path':_0x3867ad[_0x6006('0x4')],'headers':{'user-agent':_0x6006('0x14')}};_0x3db067[_0x6006('0x15')](_0x42aeef,function(_0x37f693){if(_0x37f693[_0x6006('0x16')]!==0xc8){_0x462f06(new Error(_0x6006('0x18')+_0x2a78e0+_0x6006('0x19')+_0x37f693[_0x6006('0x16')]+'\x20('+_0x37f693['statusMessage']+')'));return;}var _0x517545='';_0x37f693['on']('data',function(_0x1480bb){_0x517545+=_0x1480bb;});_0x37f693['on'](_0x6006('0x22'),function(){_0x5ab1fb(_0x517545);});})['on'](_0x6006('0x17'),function(_0x29fb9a){_0x462f06(_0x29fb9a);})[_0x6006('0x22')]();});}function convertFile(_0x2fb741,_0x5d9fd0){return new BPromise(function(_0x51a95e,_0x2feade){var _0x123c3b=sox[_0x6006('0x23')](_0x2fb741,_0x5d9fd0,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x123c3b['on'](_0x6006('0x17'),function(_0x415db1){logger[_0x6006('0x17')](_0x6006('0x24'),_0x415db1);_0x2feade(_0x415db1);});_0x123c3b['on']('end',function(){logger[_0x6006('0x1d')](_0x6006('0x25'));_0x51a95e();});_0x123c3b['start']();});}function base64Decode(_0x5645d0,_0x31ffb2){var _0x53f20d=path[_0x6006('0x26')](__dirname,_0x6006('0x27'),rs['generate'](0x4)+_0x6006('0x28'));fs[_0x6006('0x29')](_0x53f20d,_0x5645d0,_0x6006('0x2a'));return convertFile(_0x53f20d,_0x31ffb2)[_0x6006('0x2b')](function(){try{fs[_0x6006('0x2c')](_0x53f20d);fs[_0x6006('0x2d')](_0x31ffb2,_0x6006('0x2e'));}catch(_0x2408f9){logger[_0x6006('0x17')](_0x2408f9);}return _0x31ffb2[_0x6006('0x2f')]('.')[0x0];});}function base64Encode(_0x18286d){var _0x4a5a06=fs[_0x6006('0x30')](_0x18286d);return new Buffer(_0x4a5a06)[_0x6006('0x31')](_0x6006('0x2a'));}exports[_0x6006('0x32')]=function(_0x213e38,_0x1efca1,_0x4ac7a6,_0x311c8a,_0xe30ec,_0x247be5){var _0x14b456,_0x401d64;var _0x81869=_0x6006('0x33');var _0x451be0=_0x6006('0x34')+_0x213e38;var _0x21d10b={};if(_0x1efca1==='ssml'){_0x21d10b[_0x6006('0x35')]={'ssml':_0x4ac7a6};}else{_0x21d10b[_0x6006('0x35')]={'text':_0x4ac7a6};};_0x21d10b[_0x6006('0x36')]={'languageCode':_0x311c8a,'ssmlGender':_0xe30ec};_0x21d10b[_0x6006('0x37')]={'audioEncoding':_0x6006('0x38'),'sampleRateHertz':0x1f40};var _0xe9127={'url':_0x81869+_0x6006('0x39')+_0x451be0,'method':_0x6006('0x3a'),'json':!![],'body':_0x21d10b};return rp(_0xe9127)[_0x6006('0x2b')](function(_0x1fcc09){return new BPromise(function(_0x1730d8,_0x3314a2){_0x14b456=path[_0x6006('0x26')](__dirname,_0x6006('0x27'),rs[_0x6006('0x3b')](0x4)+_0x6006('0x3c'));var _0x4ecabb=Buffer[_0x6006('0x3d')](_0x1fcc09[_0x6006('0x3e')],_0x6006('0x2a'));return fs[_0x6006('0x3f')](_0x14b456,_0x4ecabb,function(_0x182a83){_0x3314a2(_0x182a83);},function(_0x38841c){fs[_0x6006('0x2d')](_0x14b456,_0x6006('0x2e'));_0x1730d8(_0x38841c);});});})[_0x6006('0x2b')](function(_0x57217e){_0x401d64=path[_0x6006('0x26')](__dirname,_0x6006('0x27'),rs[_0x6006('0x3b')](0x4)+_0x6006('0x28'));return convertFile(_0x14b456,_0x401d64);})[_0x6006('0x2b')](function(){try{fs['unlink'](_0x14b456);fs[_0x6006('0x2d')](_0x401d64,'777');}catch(_0x388ee4){logger[_0x6006('0x17')](_0x388ee4);}logger[_0x6006('0x1d')](_0x6006('0x40'),_0x401d64[_0x6006('0x2f')]('.')[0x0]);return _0x401d64[_0x6006('0x2f')]('.')[0x0];});};exports[_0x6006('0x41')]=function(_0x4b3258,_0x53e63a){var _0x2d9253='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x387b33,_0x40eed6;var _0x4b68f6;var _0x16f439={'encoding':_0x6006('0x42'),'method':'POST','timeout':0x2710,'url':_0x2d9253,'headers':{'Content-Type':_0x6006('0x43')},'body':_0x6006('0x44')+encodeURIComponent(JSON['stringify']([[[_0x6006('0x45'),JSON[_0x6006('0x46')]([_0x4b3258,_0x53e63a||'en',![],_0x6006('0x47')]),null,_0x6006('0x48')]]]))};return rp(_0x16f439)[_0x6006('0x2b')](function(_0x43fd54){try{_0x4b68f6=eval(_0x43fd54[_0x6006('0x49')](0x5))[0x0][0x2];}catch(_0x1e2af3){throw new Error(_0x6006('0x4a')+_0x43fd54[_0x6006('0x4b')]);}if(!_0x4b68f6){if(_0x4b3258[_0x6006('0x4c')]>0xc8){throw new Error(_0x6006('0x4d'));}else{throw new Error(_0x6006('0x4e')+_0x53e63a+_0x6006('0x4f'));}}try{_0x4b68f6=eval(_0x4b68f6)[0x0];}catch(_0x36ef22){throw new Error(_0x6006('0x4a')+res[_0x6006('0x4b')]);}const _0x2b479f=_0x4b68f6;_0x387b33=path[_0x6006('0x26')](__dirname,'tmp',rs[_0x6006('0x3b')](0x4)+_0x6006('0x3c'));fs[_0x6006('0x29')](_0x387b33,_0x4b68f6,{'encoding':_0x6006('0x2a')});_0x40eed6=path[_0x6006('0x26')](__dirname,'tmp',rs['generate'](0x4)+_0x6006('0x28'));return convertFile(_0x387b33,_0x40eed6);})[_0x6006('0x2b')](function(){try{fs['unlink'](_0x387b33);fs['chmodSync'](_0x40eed6,_0x6006('0x2e'));}catch(_0x1473dc){logger[_0x6006('0x17')](_0x1473dc);}logger[_0x6006('0x1d')]('goggleTTS\x20path',_0x40eed6[_0x6006('0x2f')]('.')[0x0]);return _0x40eed6[_0x6006('0x2f')]('.')[0x0];});};exports['googleASR']=function(_0x1550f5,_0x5407fe,_0x1d5b72){return google[_0x6006('0x50')](_0x1550f5,_0x5407fe,_0x1d5b72)['then'](function(_0x41b56d){logger['info'](_0x41b56d[_0x6006('0x51')]);return rp(_0x41b56d);})[_0x6006('0x2b')](function(_0x3f4c24){var _0x47e9b7='';var _0x341dbe=0x0;try{fs[_0x6006('0x2c')](_0x1550f5);}catch(_0x22beb1){logger[_0x6006('0x17')](_0x22beb1);}if(_0x3f4c24&&_0x3f4c24[_0x6006('0x52')]){_0x47e9b7=_0x3f4c24[_0x6006('0x52')]['map'](function(_0x5e5770){return _0x5e5770&&_0x5e5770[_0x6006('0x53')][0x0]&&_0x5e5770['alternatives'][0x0]['transcript']?_0x5e5770[_0x6006('0x53')][0x0][_0x6006('0x54')]:'';})['join']('\x0a');_0x341dbe=_0x3f4c24[_0x6006('0x52')]['map'](function(_0x318b62){return _0x318b62&&_0x318b62[_0x6006('0x53')][0x0]&&_0x318b62[_0x6006('0x53')][0x0][_0x6006('0x55')]?_0x318b62['alternatives'][0x0][_0x6006('0x55')]:0x0;})[_0x6006('0x56')]('\x0a');}logger[_0x6006('0x1d')](_0x6006('0x57'),_0x47e9b7);logger['info'](_0x6006('0x58'),_0x341dbe);return{'transcript':_0x47e9b7,'confidence':_0x341dbe};})[_0x6006('0x59')](function(_0x2b7056){logger[_0x6006('0x17')](_0x6006('0x5a'),_0x2b7056[_0x6006('0x16')],_0x2b7056[_0x6006('0x5b')],_0x2b7056[_0x6006('0x5c')]);});};exports['googleDialogflow']=function(_0x450a4a,_0x2eca3c,_0x22c679,_0x553f46){var _0x4cd08d=apiai(_0x2eca3c,{'language':_0x553f46||'en'});return _0x4cd08d[_0x6006('0x5d')](_0x22c679,{'sessionId':md5(_0x450a4a)})[_0x6006('0x2b')](function(_0x3074bb){logger[_0x6006('0x1d')](JSON[_0x6006('0x46')](_0x3074bb));return{'source':_0x3074bb['result'][_0x6006('0x5e')],'resolvedQuery':_0x3074bb[_0x6006('0x5f')]['resolvedQuery'],'action':_0x3074bb[_0x6006('0x5f')][_0x6006('0x60')],'actionIncomplete':_0x3074bb[_0x6006('0x5f')][_0x6006('0x61')],'speech':_0x3074bb['result'][_0x6006('0x62')][_0x6006('0x63')],'score':_0x3074bb[_0x6006('0x5f')]['score'],'statusCode':_0x3074bb['status'][_0x6006('0x64')],'endConversation':_0x3074bb['result'][_0x6006('0x65')][_0x6006('0x66')]||![],'isFallbackIntent':_0x3074bb[_0x6006('0x5f')][_0x6006('0x65')][_0x6006('0x67')]};});};exports[_0x6006('0x68')]=function(_0x233244,_0x1011b8,_0x2f155a,_0x2c7841,_0x572ab9,_0x23f731){var _0x46f6d3=_0x2c7841[_0x6006('0x69')](/\\n/g,'\x0a');var _0x1e2936={'credentials':{'private_key':_0x46f6d3,'client_email':_0x2f155a}};var _0x4bf43f=new dialogflow[(_0x6006('0x6a'))](_0x1e2936);var _0x2b7f88=_0x4bf43f[_0x6006('0x6b')](_0x1011b8,md5(_0x233244));var _0x5ae62e={'session':_0x2b7f88,'queryInput':{'text':{'text':_0x572ab9,'languageCode':_0x23f731}}};return _0x4bf43f[_0x6006('0x6c')](_0x5ae62e)[_0x6006('0x2b')](function(_0x1ff994){if(_0x1ff994&&_0x1ff994[_0x6006('0x4c')]){logger[_0x6006('0x1d')](_0x6006('0x6d'),JSON[_0x6006('0x46')](_0x1ff994));var _0x4d95ce=_0x1ff994[0x0];if(_0x4d95ce){var _0x114a6f={'action':_0x4d95ce[_0x6006('0x6e')][_0x6006('0x60')],'allRequiredParamsPresent':_0x4d95ce['queryResult'][_0x6006('0x6f')],'endConversation':_0x4d95ce['queryResult']['diagnosticInfo']&&_0x4d95ce['queryResult'][_0x6006('0x70')][_0x6006('0x71')]?_0x4d95ce[_0x6006('0x6e')][_0x6006('0x70')]['fields'][_0x6006('0x72')][_0x6006('0x73')]:![],'fulfillmentText':_0x4d95ce[_0x6006('0x6e')][_0x6006('0x74')],'intentName':_0x4d95ce['queryResult'][_0x6006('0x75')][_0x6006('0x5b')],'intentDisplayName':_0x4d95ce['queryResult'][_0x6006('0x75')][_0x6006('0x76')],'isFallbackIntent':_0x4d95ce['queryResult']['intent'][_0x6006('0x77')],'languageCode':_0x4d95ce[_0x6006('0x6e')]['languageCode'],'queryText':_0x4d95ce['queryResult'][_0x6006('0x78')],'responseId':_0x4d95ce[_0x6006('0x79')],'score':_0x4d95ce['queryResult'][_0x6006('0x7a')],'speech':_0x4d95ce[_0x6006('0x6e')][_0x6006('0x74')],'providerResponse':JSON[_0x6006('0x46')](_0x1ff994)};return _0x114a6f;}}});};exports[_0x6006('0x7b')]=function(_0x2b13c5,_0xc5b9a2,_0x42ed5b,_0x38b6c9){return tilde['asr'](_0x2b13c5,_0xc5b9a2,_0x42ed5b,_0x38b6c9)[_0x6006('0x2b')](function(_0xe74a23){try{fs[_0x6006('0x2c')](_0x2b13c5);}catch(_0x1ec9bd){logger[_0x6006('0x17')](_0x1ec9bd);}logger['info'](_0x6006('0x7c'),_0xe74a23['transcript']);logger[_0x6006('0x1d')](_0x6006('0x7d'),_0xe74a23[_0x6006('0x55')]);return _0xe74a23;});};exports[_0x6006('0x7e')]=function(_0x2e6c84,_0x8df704,_0x430b1e,_0x1b0239,_0x59a717,_0x54ff4c){var _0x14277f=path[_0x6006('0x26')](__dirname,_0x6006('0x27'),rs[_0x6006('0x3b')](0x4)+_0x6006('0x3c'));var _0xdb830a;return aws['polly'](_0x2e6c84,_0x8df704,_0x430b1e,_0x1b0239,_0x59a717,_0x54ff4c,_0x14277f)[_0x6006('0x2b')](function(){_0xdb830a=path[_0x6006('0x26')](__dirname,_0x6006('0x27'),rs[_0x6006('0x3b')](0x4)+_0x6006('0x28'));return convertFile(_0x14277f,_0xdb830a);})['then'](function(){try{fs['unlink'](_0x14277f);fs['chmodSync'](_0xdb830a,_0x6006('0x2e'));}catch(_0x16db60){logger[_0x6006('0x17')](_0x16db60);}return _0xdb830a['split']('.')[0x0];});};exports[_0x6006('0x7f')]=function(_0x201707,_0x21a1e0,_0x9b8c7d,_0x52f1cf,_0x1f22c7,_0x5885b2){return aws[_0x6006('0x80')](_0x201707,_0x21a1e0,_0x9b8c7d,_0x52f1cf,_0x1f22c7,_0x5885b2)[_0x6006('0x2b')](function(_0x28a03f){logger['info'](JSON[_0x6006('0x46')](_0x28a03f));return _0x28a03f;});};exports[_0x6006('0x81')]=function(_0x2d4b25,_0x40d1ba,_0x1eadbe,_0x1636b5){var _0x58222e=util[_0x6006('0x82')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x2d4b25,encodeURIComponent(_0x40d1ba),_0x1eadbe,_0x1636b5);var _0x590ffb=path[_0x6006('0x26')](__dirname,_0x6006('0x27'),rs[_0x6006('0x3b')](0x4)+_0x6006('0x3c'));var _0x2964e7;return downloadFile(_0x58222e,_0x590ffb)[_0x6006('0x2b')](function(){_0x2964e7=path[_0x6006('0x26')](__dirname,_0x6006('0x27'),rs[_0x6006('0x3b')](0x4)+_0x6006('0x28'));return convertFile(_0x590ffb,_0x2964e7);})[_0x6006('0x2b')](function(){try{fs[_0x6006('0x2c')](_0x590ffb);fs[_0x6006('0x2d')](_0x2964e7,_0x6006('0x2e'));}catch(_0x7fd96b){logger[_0x6006('0x17')](_0x7fd96b);}return _0x2964e7[_0x6006('0x2f')]('.')[0x0];});};exports[_0x6006('0x83')]=function(_0x2f3cc6,_0x441672,_0x12c40f,_0x1a9c7e){var _0x168857=util[_0x6006('0x82')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x441672,_0x12c40f,base64Encode(_0x2f3cc6),_0x1a9c7e?util[_0x6006('0x82')](_0x6006('0x84'),encodeURIComponent(_0x1a9c7e)):_0x6006('0x85'));return uploadFile(_0x168857)[_0x6006('0x2b')](function(_0x5a246a){return querystring[_0x6006('0x9')](_0x5a246a);});};exports['sestekNDA']=function(_0x158d91,_0x33b46b){return sestek[_0x6006('0x86')](_0x158d91,_0x33b46b)[_0x6006('0x2b')](function(_0x1cb845){logger[_0x6006('0x1d')](JSON[_0x6006('0x46')](_0x1cb845));var _0x26bd23={'speech':_0x1cb845[_0x6006('0x87')],'action':_0x1cb845[_0x6006('0x88')]?_0x1cb845[_0x6006('0x88')][_0x6006('0x89')]:undefined,'actiondata':_0x1cb845[_0x6006('0x88')]?_0x1cb845['channelData']['CustomActionData']:undefined};if(_0x1cb845['channelData']&&_0x1cb845[_0x6006('0x88')][_0x6006('0x8a')]){return base64Decode(_0x1cb845[_0x6006('0x88')]['AudioFromTts']['Data'],path['resolve'](__dirname,_0x6006('0x27'),rs[_0x6006('0x3b')](0x4)+_0x6006('0x28')))[_0x6006('0x2b')](function(_0xcf72ed){_0x26bd23[_0x6006('0x8b')]=_0xcf72ed;return _0x26bd23;});}return _0x26bd23;});};exports[_0x6006('0x8c')]=function(){return __dirname;}; \ No newline at end of file +var _0x8f13=['CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','parse','util','./aws','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','error','statusCode','statusMessage','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','finish','info','unlink','download\x20error','pipe','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert','tmp','generate','.wav','base64','then','split','readFileSync','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','text:synthesize','POST','resolve','.mp3','from','audioContent','writeFile','777','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','jQ1olc','stringify','null','generic','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','writeFileSync','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','confidence','catch','name','message','textRequest','result','actionIncomplete','fulfillment','speech','score','status','code','metadata','isFallbackIntent','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','chmodSync','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','sestekNDA','nda','text','channelData','CustomAction'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0x8f13,0x87));var _0x38f1=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x8f13[_0x36dfbd];return _0x4ecad9;};'use strict';var apiai=require(_0x38f1('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0x38f1('0x1'));var fs=require('fs');var http=require(_0x38f1('0x2'));var https=require(_0x38f1('0x3'));var md5=require(_0x38f1('0x4'));var path=require(_0x38f1('0x5'));var querystring=require(_0x38f1('0x6'));var rp=require(_0x38f1('0x7'));var rs=require(_0x38f1('0x8'));var sox=require(_0x38f1('0x9'));var tts=require(_0x38f1('0xa'));var urlParse=require('url')[_0x38f1('0xb')];var util=require(_0x38f1('0xc'));var aws=require(_0x38f1('0xd'));var google=require('./google');var sestek=require('./sestek');var tilde=require(_0x38f1('0xe'));var logger=require(_0x38f1('0xf'))(_0x38f1('0x10'));var ISPEECH_API=_0x38f1('0x11');function downloadFile(_0x593380,_0x2251bd){return new BPromise(function(_0x5b696f,_0x57114f){var _0x3f0976=urlParse(_0x593380);var _0x58d951=_0x3f0976[_0x38f1('0x12')]===_0x38f1('0x13')?https:http;var _0x5da310={'host':_0x3f0976[_0x38f1('0x14')],'path':_0x3f0976[_0x38f1('0x5')],'headers':{'user-agent':_0x38f1('0x15')}};_0x58d951[_0x38f1('0x16')](_0x5da310,function(_0x303a2a){if(_0x303a2a['statusCode']!==0xc8){logger[_0x38f1('0x17')]('request\x20to\x20'+_0x593380+'\x20failed,\x20status\x20code\x20=\x20'+_0x303a2a[_0x38f1('0x18')]+'\x20('+_0x303a2a[_0x38f1('0x19')]+')');_0x57114f(new Error(_0x38f1('0x1a')+_0x593380+_0x38f1('0x1b')+_0x303a2a[_0x38f1('0x18')]+'\x20('+_0x303a2a['statusMessage']+')'));return;}var _0x30798c=fs['createWriteStream'](_0x2251bd);_0x30798c['on'](_0x38f1('0x1c'),function(){logger[_0x38f1('0x1d')]('finish\x20download\x20file');_0x30798c['close'](_0x5b696f);});_0x30798c['on'](_0x38f1('0x17'),function(_0x34ab1a){fs[_0x38f1('0x1e')](_0x2251bd);logger[_0x38f1('0x17')](_0x38f1('0x1f'),_0x34ab1a);_0x57114f(_0x34ab1a);});_0x303a2a[_0x38f1('0x20')](_0x30798c);})['on'](_0x38f1('0x17'),function(_0x258ad3){logger[_0x38f1('0x17')](_0x258ad3);_0x57114f(_0x258ad3);})[_0x38f1('0x21')]();});}function uploadFile(_0x1f12d4){return new BPromise(function(_0x217dab,_0xb58270){var _0x1e87eb=urlParse(_0x1f12d4);var _0xfeb92c=_0x1e87eb['protocol']===_0x38f1('0x13')?https:http;var _0x35d1d6={'host':_0x1e87eb['host'],'path':_0x1e87eb['path'],'headers':{'user-agent':_0x38f1('0x15')}};_0xfeb92c[_0x38f1('0x16')](_0x35d1d6,function(_0x5f3163){if(_0x5f3163['statusCode']!==0xc8){_0xb58270(new Error(_0x38f1('0x1a')+_0x1f12d4+_0x38f1('0x1b')+_0x5f3163[_0x38f1('0x18')]+'\x20('+_0x5f3163[_0x38f1('0x19')]+')'));return;}var _0xb8d6da='';_0x5f3163['on'](_0x38f1('0x22'),function(_0x32127f){_0xb8d6da+=_0x32127f;});_0x5f3163['on']('end',function(){_0x217dab(_0xb8d6da);});})['on']('error',function(_0x48d66d){_0xb58270(_0x48d66d);})['end']();});}function convertFile(_0x40f78c,_0x1cbd3a){return new BPromise(function(_0x131891,_0x24b0a2){var _0x4d0738=sox[_0x38f1('0x23')](_0x40f78c,_0x1cbd3a,{'sampleRate':0x1f40,'format':_0x38f1('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4d0738['on'](_0x38f1('0x17'),function(_0x1f17e4){logger['error'](_0x38f1('0x25'),_0x1f17e4);_0x24b0a2(_0x1f17e4);});_0x4d0738['on'](_0x38f1('0x21'),function(){logger['info'](_0x38f1('0x26'));_0x131891();});_0x4d0738['start']();});}function base64Decode(_0x2e427d,_0x20de24){var _0x29f98d=path['resolve'](__dirname,_0x38f1('0x27'),rs[_0x38f1('0x28')](0x4)+_0x38f1('0x29'));fs['writeFileSync'](_0x29f98d,_0x2e427d,_0x38f1('0x2a'));return convertFile(_0x29f98d,_0x20de24)[_0x38f1('0x2b')](function(){try{fs[_0x38f1('0x1e')](_0x29f98d);fs['chmodSync'](_0x20de24,'777');}catch(_0x21f537){logger[_0x38f1('0x17')](_0x21f537);}return _0x20de24[_0x38f1('0x2c')]('.')[0x0];});}function base64Encode(_0x4e3815){var _0x1b5711=fs[_0x38f1('0x2d')](_0x4e3815);return new Buffer(_0x1b5711)['toString']('base64');}exports['googleCloudTTS']=function(_0x4f9ff9,_0x1cf9e6,_0x15a97d,_0x24ebf5,_0x530862,_0x228f74){var _0x9519,_0x35019d;var _0x406092=_0x38f1('0x2e');var _0x469131=_0x38f1('0x2f')+_0x4f9ff9;var _0x5709ba={};if(_0x1cf9e6===_0x38f1('0x30')){_0x5709ba['input']={'ssml':_0x15a97d};}else{_0x5709ba[_0x38f1('0x31')]={'text':_0x15a97d};};_0x5709ba['voice']={'languageCode':_0x24ebf5,'ssmlGender':_0x530862};_0x5709ba[_0x38f1('0x32')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x42ce58={'url':_0x406092+_0x38f1('0x33')+_0x469131,'method':_0x38f1('0x34'),'json':!![],'body':_0x5709ba};return rp(_0x42ce58)[_0x38f1('0x2b')](function(_0x201a77){return new BPromise(function(_0x2350e2,_0x283c51){_0x9519=path[_0x38f1('0x35')](__dirname,'tmp',rs[_0x38f1('0x28')](0x4)+_0x38f1('0x36'));var _0x17b7c5=Buffer[_0x38f1('0x37')](_0x201a77[_0x38f1('0x38')],_0x38f1('0x2a'));return fs[_0x38f1('0x39')](_0x9519,_0x17b7c5,function(_0x8a4421){_0x283c51(_0x8a4421);},function(_0x210750){fs['chmodSync'](_0x9519,_0x38f1('0x3a'));_0x2350e2(_0x210750);});});})[_0x38f1('0x2b')](function(_0x192471){_0x35019d=path['resolve'](__dirname,_0x38f1('0x27'),rs[_0x38f1('0x28')](0x4)+'.wav');return convertFile(_0x9519,_0x35019d);})[_0x38f1('0x2b')](function(){try{fs[_0x38f1('0x1e')](_0x9519);fs['chmodSync'](_0x35019d,_0x38f1('0x3a'));}catch(_0x397d52){logger[_0x38f1('0x17')](_0x397d52);}logger[_0x38f1('0x1d')](_0x38f1('0x3b'),_0x35019d[_0x38f1('0x2c')]('.')[0x0]);return _0x35019d[_0x38f1('0x2c')]('.')[0x0];});};exports[_0x38f1('0x3c')]=function(_0x13064e,_0x12e29f){var _0x560ced=_0x38f1('0x3d');var _0x50d206,_0x4d0d3a;var _0x5a7962;var _0x527cb2={'encoding':_0x38f1('0x3e'),'method':_0x38f1('0x34'),'timeout':0x2710,'url':_0x560ced,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON['stringify']([[[_0x38f1('0x3f'),JSON[_0x38f1('0x40')]([_0x13064e,_0x12e29f||'en',![],_0x38f1('0x41')]),null,_0x38f1('0x42')]]]))};return rp(_0x527cb2)['then'](function(_0xf8c093){try{_0x5a7962=eval(_0xf8c093['slice'](0x5))[0x0][0x2];}catch(_0x383d4d){throw new Error(_0x38f1('0x43')+_0xf8c093[_0x38f1('0x22')]);}if(!_0x5a7962){if(_0x13064e[_0x38f1('0x44')]>0xc8){throw new Error(_0x38f1('0x45'));}else{throw new Error(_0x38f1('0x46')+_0x12e29f+'\x22\x20might\x20not\x20exist');}}try{_0x5a7962=eval(_0x5a7962)[0x0];}catch(_0x3a465c){throw new Error(_0x38f1('0x43')+res['data']);}const _0x3a691d=_0x5a7962;_0x50d206=path[_0x38f1('0x35')](__dirname,_0x38f1('0x27'),rs[_0x38f1('0x28')](0x4)+_0x38f1('0x36'));fs[_0x38f1('0x47')](_0x50d206,_0x5a7962,{'encoding':'base64'});_0x4d0d3a=path[_0x38f1('0x35')](__dirname,_0x38f1('0x27'),rs['generate'](0x4)+_0x38f1('0x29'));return convertFile(_0x50d206,_0x4d0d3a);})[_0x38f1('0x2b')](function(){try{fs[_0x38f1('0x1e')](_0x50d206);fs['chmodSync'](_0x4d0d3a,_0x38f1('0x3a'));}catch(_0x548407){logger[_0x38f1('0x17')](_0x548407);}logger[_0x38f1('0x1d')](_0x38f1('0x48'),_0x4d0d3a['split']('.')[0x0]);return _0x4d0d3a['split']('.')[0x0];});};exports[_0x38f1('0x49')]=function(_0xde1340,_0xcdb295,_0x584e3b){return google['asr'](_0xde1340,_0xcdb295,_0x584e3b)[_0x38f1('0x2b')](function(_0x5508f8){logger[_0x38f1('0x1d')](_0x5508f8[_0x38f1('0x4a')]);return rp(_0x5508f8);})[_0x38f1('0x2b')](function(_0xdf617c){var _0x3d5871='';var _0x5432a0=0x0;try{fs['unlink'](_0xde1340);}catch(_0x2d6837){logger['error'](_0x2d6837);}if(_0xdf617c&&_0xdf617c[_0x38f1('0x4b')]){_0x3d5871=_0xdf617c[_0x38f1('0x4b')][_0x38f1('0x4c')](function(_0x175104){return _0x175104&&_0x175104[_0x38f1('0x4d')][0x0]&&_0x175104[_0x38f1('0x4d')][0x0][_0x38f1('0x4e')]?_0x175104[_0x38f1('0x4d')][0x0][_0x38f1('0x4e')]:'';})['join']('\x0a');_0x5432a0=_0xdf617c[_0x38f1('0x4b')]['map'](function(_0x186ff4){return _0x186ff4&&_0x186ff4[_0x38f1('0x4d')][0x0]&&_0x186ff4[_0x38f1('0x4d')][0x0]['confidence']?_0x186ff4[_0x38f1('0x4d')][0x0][_0x38f1('0x4f')]:0x0;})['join']('\x0a');}logger[_0x38f1('0x1d')]('googleASR\x20transcription',_0x3d5871);logger[_0x38f1('0x1d')]('googleASR\x20confidence',_0x5432a0);return{'transcript':_0x3d5871,'confidence':_0x5432a0};})[_0x38f1('0x50')](function(_0x948f0a){logger['error']('[%s]\x20%s:%s',_0x948f0a[_0x38f1('0x18')],_0x948f0a[_0x38f1('0x51')],_0x948f0a[_0x38f1('0x52')]);});};exports['googleDialogflow']=function(_0x2c0f52,_0x23b118,_0x4ea7f9,_0x27ac39){var _0x2e5ee6=apiai(_0x23b118,{'language':_0x27ac39||'en'});return _0x2e5ee6[_0x38f1('0x53')](_0x4ea7f9,{'sessionId':md5(_0x2c0f52)})[_0x38f1('0x2b')](function(_0x16bf08){logger['info'](JSON['stringify'](_0x16bf08));return{'source':_0x16bf08[_0x38f1('0x54')]['source'],'resolvedQuery':_0x16bf08[_0x38f1('0x54')]['resolvedQuery'],'action':_0x16bf08[_0x38f1('0x54')]['action'],'actionIncomplete':_0x16bf08['result'][_0x38f1('0x55')],'speech':_0x16bf08['result'][_0x38f1('0x56')][_0x38f1('0x57')],'score':_0x16bf08[_0x38f1('0x54')][_0x38f1('0x58')],'statusCode':_0x16bf08[_0x38f1('0x59')][_0x38f1('0x5a')],'endConversation':_0x16bf08['result']['metadata']['endConversation']||![],'isFallbackIntent':_0x16bf08['result'][_0x38f1('0x5b')][_0x38f1('0x5c')]};});};exports['googleDialogflowV2']=function(_0x4c878d,_0x172b45,_0x23df1c,_0x43695e,_0x13175a,_0x45649f){var _0x5bd8c6=_0x43695e[_0x38f1('0x5d')](/\\n/g,'\x0a');var _0x1d1f03={'credentials':{'private_key':_0x5bd8c6,'client_email':_0x23df1c}};var _0x17601b=new dialogflow[(_0x38f1('0x5e'))](_0x1d1f03);var _0x2236e2=_0x17601b[_0x38f1('0x5f')](_0x172b45,md5(_0x4c878d));var _0x17eaff={'session':_0x2236e2,'queryInput':{'text':{'text':_0x13175a,'languageCode':_0x45649f}}};return _0x17601b['detectIntent'](_0x17eaff)[_0x38f1('0x2b')](function(_0x3d0a63){if(_0x3d0a63&&_0x3d0a63[_0x38f1('0x44')]){logger[_0x38f1('0x1d')](_0x38f1('0x60'),JSON[_0x38f1('0x40')](_0x3d0a63));var _0x5d6f41=_0x3d0a63[0x0];if(_0x5d6f41){var _0x4076b4={'action':_0x5d6f41[_0x38f1('0x61')]['action'],'allRequiredParamsPresent':_0x5d6f41['queryResult'][_0x38f1('0x62')],'endConversation':_0x5d6f41['queryResult'][_0x38f1('0x63')]&&_0x5d6f41[_0x38f1('0x61')][_0x38f1('0x63')]['fields']?_0x5d6f41['queryResult'][_0x38f1('0x63')][_0x38f1('0x64')][_0x38f1('0x65')][_0x38f1('0x66')]:![],'fulfillmentText':_0x5d6f41['queryResult'][_0x38f1('0x67')],'intentName':_0x5d6f41['queryResult'][_0x38f1('0x68')][_0x38f1('0x51')],'intentDisplayName':_0x5d6f41[_0x38f1('0x61')][_0x38f1('0x68')][_0x38f1('0x69')],'isFallbackIntent':_0x5d6f41['queryResult'][_0x38f1('0x68')][_0x38f1('0x6a')],'languageCode':_0x5d6f41[_0x38f1('0x61')][_0x38f1('0x6b')],'queryText':_0x5d6f41[_0x38f1('0x61')]['queryText'],'responseId':_0x5d6f41['responseId'],'score':_0x5d6f41[_0x38f1('0x61')]['intentDetectionConfidence'],'speech':_0x5d6f41[_0x38f1('0x61')]['fulfillmentText'],'providerResponse':JSON['stringify'](_0x3d0a63)};return _0x4076b4;}}});};exports[_0x38f1('0x6c')]=function(_0x3b887f,_0x183114,_0x3789bb,_0x2cbec9){return tilde[_0x38f1('0x6d')](_0x3b887f,_0x183114,_0x3789bb,_0x2cbec9)[_0x38f1('0x2b')](function(_0x2e5e43){try{fs['unlink'](_0x3b887f);}catch(_0x3b62e8){logger[_0x38f1('0x17')](_0x3b62e8);}logger[_0x38f1('0x1d')](_0x38f1('0x6e'),_0x2e5e43[_0x38f1('0x4e')]);logger[_0x38f1('0x1d')](_0x38f1('0x6f'),_0x2e5e43['confidence']);return _0x2e5e43;});};exports[_0x38f1('0x70')]=function(_0x2641d9,_0x314be2,_0x191e53,_0x4e6f28,_0x1c0dfe,_0x2d46ed){var _0x13ea41=path['resolve'](__dirname,'tmp',rs[_0x38f1('0x28')](0x4)+'.mp3');var _0x4bbee4;return aws['polly'](_0x2641d9,_0x314be2,_0x191e53,_0x4e6f28,_0x1c0dfe,_0x2d46ed,_0x13ea41)[_0x38f1('0x2b')](function(){_0x4bbee4=path['resolve'](__dirname,_0x38f1('0x27'),rs[_0x38f1('0x28')](0x4)+_0x38f1('0x29'));return convertFile(_0x13ea41,_0x4bbee4);})[_0x38f1('0x2b')](function(){try{fs[_0x38f1('0x1e')](_0x13ea41);fs[_0x38f1('0x71')](_0x4bbee4,'777');}catch(_0x193cf6){logger['error'](_0x193cf6);}return _0x4bbee4[_0x38f1('0x2c')]('.')[0x0];});};exports['awsLex']=function(_0x3cc087,_0x34e1a3,_0xe713c3,_0x6aacb0,_0x178948,_0x4352a5){return aws[_0x38f1('0x72')](_0x3cc087,_0x34e1a3,_0xe713c3,_0x6aacb0,_0x178948,_0x4352a5)[_0x38f1('0x2b')](function(_0x166447){logger['info'](JSON[_0x38f1('0x40')](_0x166447));return _0x166447;});};exports[_0x38f1('0x73')]=function(_0x5f2daa,_0x4ae99f,_0x42d639,_0x1974f5){var _0x27437a=util[_0x38f1('0x74')](_0x38f1('0x75'),ISPEECH_API,_0x5f2daa,encodeURIComponent(_0x4ae99f),_0x42d639,_0x1974f5);var _0x1e9953=path[_0x38f1('0x35')](__dirname,_0x38f1('0x27'),rs[_0x38f1('0x28')](0x4)+_0x38f1('0x36'));var _0x53837b;return downloadFile(_0x27437a,_0x1e9953)[_0x38f1('0x2b')](function(){_0x53837b=path[_0x38f1('0x35')](__dirname,_0x38f1('0x27'),rs['generate'](0x4)+'.wav');return convertFile(_0x1e9953,_0x53837b);})[_0x38f1('0x2b')](function(){try{fs['unlink'](_0x1e9953);fs[_0x38f1('0x71')](_0x53837b,_0x38f1('0x3a'));}catch(_0x59f196){logger[_0x38f1('0x17')](_0x59f196);}return _0x53837b[_0x38f1('0x2c')]('.')[0x0];});};exports[_0x38f1('0x76')]=function(_0x1f0bed,_0x3de04a,_0x140ec0,_0x4019b1){var _0xe0bf9f=util[_0x38f1('0x74')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x3de04a,_0x140ec0,base64Encode(_0x1f0bed),_0x4019b1?util[_0x38f1('0x74')](_0x38f1('0x77'),encodeURIComponent(_0x4019b1)):'freeform=3');return uploadFile(_0xe0bf9f)[_0x38f1('0x2b')](function(_0x38afbc){return querystring['parse'](_0x38afbc);});};exports[_0x38f1('0x78')]=function(_0x33f4f6,_0x27ec99){return sestek[_0x38f1('0x79')](_0x33f4f6,_0x27ec99)[_0x38f1('0x2b')](function(_0x533ff5){logger[_0x38f1('0x1d')](JSON[_0x38f1('0x40')](_0x533ff5));var _0x5e2776={'speech':_0x533ff5[_0x38f1('0x7a')],'action':_0x533ff5[_0x38f1('0x7b')]?_0x533ff5[_0x38f1('0x7b')][_0x38f1('0x7c')]:undefined,'actiondata':_0x533ff5['channelData']?_0x533ff5[_0x38f1('0x7b')][_0x38f1('0x7d')]:undefined};if(_0x533ff5['channelData']&&_0x533ff5[_0x38f1('0x7b')][_0x38f1('0x7e')]){return base64Decode(_0x533ff5[_0x38f1('0x7b')][_0x38f1('0x7e')][_0x38f1('0x7f')],path[_0x38f1('0x35')](__dirname,_0x38f1('0x27'),rs[_0x38f1('0x28')](0x4)+_0x38f1('0x29')))[_0x38f1('0x2b')](function(_0x50d7a5){_0x5e2776[_0x38f1('0x80')]=_0x50d7a5;return _0x5e2776;});}return _0x5e2776;});};exports[_0x38f1('0x81')]=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 1f0e518..8f34e03 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 _0x8069=['exports','./nda'];(function(_0x286911,_0x2a5fb6){var _0x47e7e0=function(_0x528af0){while(--_0x528af0){_0x286911['push'](_0x286911['shift']());}};_0x47e7e0(++_0x2a5fb6);}(_0x8069,0x111));var _0x9806=function(_0x4ac100,_0x4f33f1){_0x4ac100=_0x4ac100-0x0;var _0x56bae7=_0x8069[_0x4ac100];return _0x56bae7;};var nda=require(_0x9806('0x0'));module[_0x9806('0x1')]={'nda':nda}; \ No newline at end of file +var nda=require('./nda');module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index f8b38d7..6083022 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 _0xe706=['ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','text','Bearer\x20','access_token','project','body','channelData','ProjectName','AudioOutputSettings','custom_action','info','request-promise','url','../../../../../config/logger','exports','POST','resolve','ndauth_url','/token','password','username','then'];(function(_0x909398,_0x2e6d0b){var _0x16e1f3=function(_0x444050){while(--_0x444050){_0x909398['push'](_0x909398['shift']());}};_0x16e1f3(++_0x2e6d0b);}(_0xe706,0xa3));var _0x6e70=function(_0x540c04,_0x4c1e2f){_0x540c04=_0x540c04-0x0;var _0x5bcb58=_0xe706[_0x540c04];return _0x5bcb58;};'use strict';var rp=require(_0x6e70('0x0'));var url=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('agi');module[_0x6e70('0x3')]=function(_0x315629,_0x2ca810){var _0x7dfbc3={'method':_0x6e70('0x4'),'uri':url[_0x6e70('0x5')](_0x2ca810[_0x6e70('0x6')],_0x6e70('0x7')),'form':{'grant_type':_0x6e70('0x8'),'username':_0x2ca810[_0x6e70('0x9')],'password':_0x2ca810[_0x6e70('0x8')]},'json':!![]};return rp(_0x7dfbc3)[_0x6e70('0xa')](function(_0x45a2d4){var _0x188ed3={'method':_0x6e70('0x4'),'uri':url[_0x6e70('0x5')](_0x2ca810[_0x6e70('0xb')],_0x6e70('0xc')),'body':{'type':_0x2ca810[_0x6e70('0xd')]||_0x6e70('0xe'),'channelId':_0x6e70('0xf'),'conversation':{'id':_0x315629[_0x6e70('0x10')]},'from':{'id':_0x315629[_0x6e70('0x11')],'name':_0x315629[_0x6e70('0x12')]},'recipient':{'id':_0x315629['dnid'],'name':_0x315629['extension']},'text':_0x2ca810[_0x6e70('0x13')],'channelData':{}},'headers':{'Authorization':_0x6e70('0x14')+_0x45a2d4[_0x6e70('0x15')]},'json':!![]};if(_0x2ca810[_0x6e70('0x16')]){_0x188ed3[_0x6e70('0x17')][_0x6e70('0x18')][_0x6e70('0x19')]=_0x2ca810[_0x6e70('0x16')];}if(_0x2ca810['ndagenerate_audio']=='1'){_0x188ed3['body']['channelData'][_0x6e70('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x2ca810['custom_action']){_0x188ed3[_0x6e70('0x17')][_0x6e70('0x18')]['CustomAction']=_0x2ca810[_0x6e70('0x1b')];if(_0x2ca810['custom_action_data']){_0x188ed3[_0x6e70('0x17')][_0x6e70('0x18')]['CustomActionData']=_0x2ca810['custom_action_data'];}}logger[_0x6e70('0x1c')](JSON['stringify'](_0x188ed3));return rp(_0x188ed3);});}; \ No newline at end of file +var _0x1d5b=['ProjectName','ndagenerate_audio','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','stringify','request-promise','url','../../../../../config/logger','exports','POST','resolve','password','username','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','callerid','calleridname','extension','text','Bearer\x20','project','body','channelData'];(function(_0x14aea2,_0x4fbda6){var _0x37423e=function(_0x3b9c20){while(--_0x3b9c20){_0x14aea2['push'](_0x14aea2['shift']());}};_0x37423e(++_0x4fbda6);}(_0x1d5b,0x13c));var _0xb1d5=function(_0x47d403,_0x2f4ab9){_0x47d403=_0x47d403-0x0;var _0x4ad563=_0x1d5b[_0x47d403];return _0x4ad563;};'use strict';var rp=require(_0xb1d5('0x0'));var url=require(_0xb1d5('0x1'));var logger=require(_0xb1d5('0x2'))('agi');module[_0xb1d5('0x3')]=function(_0x594c25,_0x2f9c5a){var _0x1a673c={'method':_0xb1d5('0x4'),'uri':url[_0xb1d5('0x5')](_0x2f9c5a['ndauth_url'],'/token'),'form':{'grant_type':_0xb1d5('0x6'),'username':_0x2f9c5a[_0xb1d5('0x7')],'password':_0x2f9c5a[_0xb1d5('0x6')]},'json':!![]};return rp(_0x1a673c)[_0xb1d5('0x8')](function(_0x3b452f){var _0xb2d955={'method':_0xb1d5('0x4'),'uri':url[_0xb1d5('0x5')](_0x2f9c5a['ndassistant_url'],_0xb1d5('0x9')),'body':{'type':_0x2f9c5a[_0xb1d5('0xa')]||'message','channelId':'Nda','conversation':{'id':_0x594c25[_0xb1d5('0xb')]},'from':{'id':_0x594c25[_0xb1d5('0xc')],'name':_0x594c25[_0xb1d5('0xd')]},'recipient':{'id':_0x594c25['dnid'],'name':_0x594c25[_0xb1d5('0xe')]},'text':_0x2f9c5a[_0xb1d5('0xf')],'channelData':{}},'headers':{'Authorization':_0xb1d5('0x10')+_0x3b452f['access_token']},'json':!![]};if(_0x2f9c5a[_0xb1d5('0x11')]){_0xb2d955[_0xb1d5('0x12')][_0xb1d5('0x13')][_0xb1d5('0x14')]=_0x2f9c5a['project'];}if(_0x2f9c5a[_0xb1d5('0x15')]=='1'){_0xb2d955[_0xb1d5('0x12')][_0xb1d5('0x13')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xb1d5('0x16')};}if(_0x2f9c5a[_0xb1d5('0x17')]){_0xb2d955[_0xb1d5('0x12')][_0xb1d5('0x13')][_0xb1d5('0x18')]=_0x2f9c5a[_0xb1d5('0x17')];if(_0x2f9c5a['custom_action_data']){_0xb2d955[_0xb1d5('0x12')]['channelData'][_0xb1d5('0x19')]=_0x2f9c5a[_0xb1d5('0x1a')];}}logger['info'](JSON[_0xb1d5('0x1b')](_0xb2d955));return rp(_0xb2d955);});}; \ 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 f1b4132..afeb938 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 _0xdd56=['./lib/api','exports'];(function(_0x448b5b,_0x8b12ae){var _0x590391=function(_0x425325){while(--_0x425325){_0x448b5b['push'](_0x448b5b['shift']());}};_0x590391(++_0x8b12ae);}(_0xdd56,0xf4));var _0x6dd5=function(_0xad56c9,_0x10f723){_0xad56c9=_0xad56c9-0x0;var _0x4838a2=_0xdd56[_0xad56c9];return _0x4838a2;};'use strict';var asr=require(_0x6dd5('0x0'));module[_0x6dd5('0x1')]=function(_0x131eb3,_0x8e04e7,_0x5a424d,_0x3c0d62){return asr(_0x131eb3,_0x8e04e7,_0x5a424d,_0x3c0d62);}; \ No newline at end of file +var _0x024d=['./lib/api','exports'];(function(_0x918eae,_0x33b06c){var _0x3efb9a=function(_0x4d58db){while(--_0x4d58db){_0x918eae['push'](_0x918eae['shift']());}};_0x3efb9a(++_0x33b06c);}(_0x024d,0x1e4));var _0xd024=function(_0xf88267,_0x585dab){_0xf88267=_0xf88267-0x0;var _0x450318=_0x024d[_0xf88267];return _0x450318;};'use strict';var asr=require(_0xd024('0x0'));module[_0xd024('0x1')]=function(_0x2660b9,_0x45e4d9,_0x3d2866,_0x27c79c){return asr(_0x2660b9,_0x45e4d9,_0x3d2866,_0x27c79c);}; \ 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 7fd4d41..2b85893 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 _0x5d92=['parse','result','final','Tilde\x20ASR\x20hypoteses','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','isObject','lodash','moment','crypto','../../../../../../config/logger','exports','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','info','unix','stringify','createReadStream','data','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate'];(function(_0x5a160a,_0x2a5bb8){var _0x491362=function(_0x3e30b4){while(--_0x3e30b4){_0x5a160a['push'](_0x5a160a['shift']());}};_0x491362(++_0x2a5bb8);}(_0x5d92,0xc7));var _0x25d9=function(_0xf2d08a,_0x4a20ee){_0xf2d08a=_0xf2d08a-0x0;var _0x43464e=_0x5d92[_0xf2d08a];return _0x43464e;};'use strict';var BPromise=require('bluebird');var _=require(_0x25d9('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x25d9('0x1'));var crypto=require(_0x25d9('0x2'));var logger=require(_0x25d9('0x3'))('agi');module[_0x25d9('0x4')]=function(_0x3767e8,_0x41c28f,_0x573fc2,_0x412eae){return new BPromise(function(_0x13c1c4,_0x59889c){logger['info'](_0x25d9('0x5'),_0x412eae||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x48d1af=new WebSocket(_0x412eae||_0x25d9('0x6'),{'perMessageDeflate':![]});var _0x102386='';var _0x48a34c='0';var _0x1650f2='1';var _0x3754bd=_0x25d9('0x7');function _0x38c4b5(_0x24dafa){var _0x295c67=crypto['createHash'](_0x25d9('0x8'));_0x295c67[_0x25d9('0x9')](_0x24dafa);return _0x295c67[_0x25d9('0xa')](_0x25d9('0xb'));}function _0x5b122d(){try{logger[_0x25d9('0xc')]('Open\x20Tilde\x20ASR\x20socket');var _0x40f7da=moment()[_0x25d9('0xd')]();var _0x4ee872=_0x38c4b5(_0x40f7da+_0x41c28f+_0x573fc2);_0x48d1af['send'](JSON[_0x25d9('0xe')]({'appID':_0x41c28f,'timestamp':_0x40f7da,'appKey':_0x4ee872}));var _0x108030=fs[_0x25d9('0xf')](_0x3767e8);_0x108030['on'](_0x25d9('0x10'),function(_0x29641e){_0x48d1af[_0x25d9('0x11')](_0x29641e);});_0x108030['on'](_0x25d9('0x12'),function(){_0x48d1af['send'](_0x25d9('0x13'));});}catch(_0x3be3a8){logger[_0x25d9('0x14')](_0x25d9('0x15'),JSON[_0x25d9('0xe')](_0x3be3a8));_0x48d1af[_0x25d9('0x16')]();}}function _0x109e4b(_0x3ccb99){try{if(_0x3ccb99){var _0x92a637=JSON[_0x25d9('0x17')](_0x3ccb99);switch(_0x92a637['status']){case 0x0:if(_0x92a637[_0x25d9('0x18')]){if(_0x92a637[_0x25d9('0x18')][_0x25d9('0x19')]){logger[_0x25d9('0xc')](_0x25d9('0x1a'),JSON[_0x25d9('0xe')](_0x92a637[_0x25d9('0x18')]['hypotheses']));_0x102386=_0x92a637[_0x25d9('0x18')][_0x25d9('0x1b')][0x0]['transcript'];_0x48a34c=_0x92a637['result'][_0x25d9('0x1b')][0x0][_0x25d9('0x1c')];_0x1650f2='0';_0x3754bd=_0x25d9('0x1d');_0x48d1af['terminate']();}}break;case 0x1:logger['info'](_0x25d9('0x7'));_0x1650f2='1';_0x3754bd=_0x25d9('0x7');break;case 0x2:logger['info'](_0x25d9('0x1e'));_0x1650f2='2';_0x3754bd=_0x25d9('0x1e');break;case 0x9:logger[_0x25d9('0xc')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x1650f2='9';_0x3754bd=_0x25d9('0x1f');break;case 0xa:logger[_0x25d9('0xc')]('Authentication\x20failed.');_0x1650f2='10';_0x3754bd=_0x25d9('0x20');break;case 0xb:logger[_0x25d9('0xc')](_0x25d9('0x21'));_0x1650f2='11';_0x3754bd=_0x25d9('0x21');}}}catch(_0xb04350){logger[_0x25d9('0x14')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x25d9('0xe')](_0xb04350));_0x48d1af[_0x25d9('0x16')]();}}function _0x26698d(){logger['info'](_0x25d9('0x22'));_0x13c1c4({'transcript':_0x102386,'confidence':_0x48a34c,'status':_0x1650f2,'status_message':_0x3754bd});}function _0x173c3a(_0x31b1a3){logger['error'](_0x25d9('0x23'));if(!_['isNil'](_0x31b1a3)){logger[_0x25d9('0x14')](_[_0x25d9('0x24')](_0x31b1a3)?JSON[_0x25d9('0xe')](_0x31b1a3):_0x31b1a3);}}_0x48d1af['on']('open',_0x5b122d);_0x48d1af['on']('message',_0x109e4b);_0x48d1af['on'](_0x25d9('0x12'),_0x26698d);_0x48d1af['on'](_0x25d9('0x14'),_0x173c3a);});}; \ No newline at end of file +var _0x8684=['No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','error','terminate','parse','status','final','Tilde\x20ASR\x20hypoteses','hypotheses','result','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','Error\x20Tilde\x20ASR\x20socket','isNil','open','message','bluebird','moment','crypto','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0x8684,0x125));var _0x4868=function(_0x59d2af,_0x1d7c95){_0x59d2af=_0x59d2af-0x0;var _0x2215f0=_0x8684[_0x59d2af];return _0x2215f0;};'use strict';var BPromise=require(_0x4868('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x4868('0x1'));var crypto=require(_0x4868('0x2'));var logger=require(_0x4868('0x3'))(_0x4868('0x4'));module[_0x4868('0x5')]=function(_0x31aa80,_0x31c86e,_0x69f521,_0x46f518){return new BPromise(function(_0x489488,_0x15cb88){logger['info'](_0x4868('0x6'),_0x46f518||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x49dbe2=new WebSocket(_0x46f518||_0x4868('0x7'),{'perMessageDeflate':![]});var _0x48a0e8='';var _0x29f2f0='0';var _0x44bef3='1';var _0x5d9dd1=_0x4868('0x8');function _0x3b3637(_0x322951){var _0x306d2c=crypto[_0x4868('0x9')](_0x4868('0xa'));_0x306d2c[_0x4868('0xb')](_0x322951);return _0x306d2c[_0x4868('0xc')](_0x4868('0xd'));}function _0x57aef0(){try{logger[_0x4868('0xe')](_0x4868('0xf'));var _0x2b04f9=moment()[_0x4868('0x10')]();var _0x59075c=_0x3b3637(_0x2b04f9+_0x31c86e+_0x69f521);_0x49dbe2[_0x4868('0x11')](JSON[_0x4868('0x12')]({'appID':_0x31c86e,'timestamp':_0x2b04f9,'appKey':_0x59075c}));var _0x212105=fs[_0x4868('0x13')](_0x31aa80);_0x212105['on'](_0x4868('0x14'),function(_0x46330c){_0x49dbe2[_0x4868('0x11')](_0x46330c);});_0x212105['on'](_0x4868('0x15'),function(){_0x49dbe2[_0x4868('0x11')]('EOS');});}catch(_0x33a33d){logger[_0x4868('0x16')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x33a33d));_0x49dbe2[_0x4868('0x17')]();}}function _0x3ece4d(_0x15151d){try{if(_0x15151d){var _0x1780df=JSON[_0x4868('0x18')](_0x15151d);switch(_0x1780df[_0x4868('0x19')]){case 0x0:if(_0x1780df['result']){if(_0x1780df['result'][_0x4868('0x1a')]){logger['info'](_0x4868('0x1b'),JSON[_0x4868('0x12')](_0x1780df['result'][_0x4868('0x1c')]));_0x48a0e8=_0x1780df[_0x4868('0x1d')][_0x4868('0x1c')][0x0][_0x4868('0x1e')];_0x29f2f0=_0x1780df[_0x4868('0x1d')][_0x4868('0x1c')][0x0][_0x4868('0x1f')];_0x44bef3='0';_0x5d9dd1=_0x4868('0x20');_0x49dbe2[_0x4868('0x17')]();}}break;case 0x1:logger[_0x4868('0xe')](_0x4868('0x8'));_0x44bef3='1';_0x5d9dd1='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger['info'](_0x4868('0x21'));_0x44bef3='2';_0x5d9dd1=_0x4868('0x21');break;case 0x9:logger[_0x4868('0xe')](_0x4868('0x22'));_0x44bef3='9';_0x5d9dd1=_0x4868('0x22');break;case 0xa:logger[_0x4868('0xe')](_0x4868('0x23'));_0x44bef3='10';_0x5d9dd1=_0x4868('0x23');break;case 0xb:logger[_0x4868('0xe')](_0x4868('0x24'));_0x44bef3='11';_0x5d9dd1=_0x4868('0x24');}}}catch(_0xc13662){logger[_0x4868('0x16')](_0x4868('0x25'),JSON[_0x4868('0x12')](_0xc13662));_0x49dbe2[_0x4868('0x17')]();}}function _0x184fd2(){logger[_0x4868('0xe')](_0x4868('0x26'));_0x489488({'transcript':_0x48a0e8,'confidence':_0x29f2f0,'status':_0x44bef3,'status_message':_0x5d9dd1});}function _0xa2aa0c(_0x863f02){logger[_0x4868('0x16')](_0x4868('0x27'));if(!_[_0x4868('0x28')](_0x863f02)){logger[_0x4868('0x16')](_['isObject'](_0x863f02)?JSON[_0x4868('0x12')](_0x863f02):_0x863f02);}}_0x49dbe2['on'](_0x4868('0x29'),_0x57aef0);_0x49dbe2['on'](_0x4868('0x2a'),_0x3ece4d);_0x49dbe2['on'](_0x4868('0x15'),_0x184fd2);_0x49dbe2['on'](_0x4868('0x16'),_0xa2aa0c);});}; \ 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 86ba7ce..acb39e5 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 _0xd6a1=['./asr','exports'];(function(_0x1711e0,_0x645432){var _0x186f71=function(_0x32030a){while(--_0x32030a){_0x1711e0['push'](_0x1711e0['shift']());}};_0x186f71(++_0x645432);}(_0xd6a1,0x16a));var _0x1d6a=function(_0x299471,_0x297ba4){_0x299471=_0x299471-0x0;var _0x52b1e1=_0xd6a1[_0x299471];return _0x52b1e1;};var asr=require(_0x1d6a('0x0'));module[_0x1d6a('0x1')]={'asr':asr}; \ No newline at end of file +var _0xf7b2=['./asr'];(function(_0x296754,_0x5befe9){var _0x1d9f1d=function(_0x3f033e){while(--_0x3f033e){_0x296754['push'](_0x296754['shift']());}};_0x1d9f1d(++_0x5befe9);}(_0xf7b2,0x174));var _0x2f7b=function(_0x11faa8,_0x349c0c){_0x11faa8=_0x11faa8-0x0;var _0x22bf15=_0xf7b2[_0x11faa8];return _0x22bf15;};var asr=require(_0x2f7b('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index e315e4e..14a1ba5 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 _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0xebc72a,_0x5a55c5){var _0x441d7d=function(_0x8a1eaf){while(--_0x8a1eaf){_0xebc72a['push'](_0xebc72a['shift']());}};_0x441d7d(++_0x5a55c5);}(_0x34e8,0x12c));var _0x834e=function(_0x85bfa6,_0x15c451){_0x85bfa6=_0x85bfa6-0x0;var _0x34b064=_0x34e8[_0x85bfa6];return _0x34b064;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);}; \ No newline at end of file +var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 807f2fc..7b99854 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 _0x0c1a=['maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','googleDialogflow','DIALOGFLOW_%s','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','dialogflowV2','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','SESTEK_NDA_%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','NOBEEP','recordFile','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','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','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeechASR','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','streamFile','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','math','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','Trying\x20SendMail\x20with\x20account\x20%s','sendMailMessage','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','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','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','arg_1','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','command','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\x20is\x20unreachable','tts','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','util','lodash','shelljs','moment','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getsecretdigits','channel','rpc','prototype','getVariableById','then','catch','getVoiceQueue','name','getSquareProjectById','getSquareOdbc','dsn','getUser','getUserById','getTrunk','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','label','agicommand','callerid','createSquareRecording','uniqueid','calleridname','context','extension','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agentPause','agentUnpause','agent','agentLogout','internal','%s/%s@from-sip/n','agentLogin','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','googleTTS','google_tts_language','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','sync','uri','url','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appsecret','clear','clone','hasOwnProperty','replaceObjectAllVariables','recursiveNodeIndex','length','isString','replaceAllVariables','saveRestApiResult','%s.%s','isArray','setVariable','split','replaceAll','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s'];(function(_0x229f05,_0x119629){var _0x4fb588=function(_0x26c469){while(--_0x26c469){_0x229f05['push'](_0x229f05['shift']());}};_0x4fb588(++_0x119629);}(_0x0c1a,0x127));var _0xa0c1=function(_0x474309,_0x1e0bb1){_0x474309=_0x474309-0x0;var _0x4f95eb=_0x0c1a[_0x474309];return _0x4f95eb;};'use strict';var fs=require('fs');var util=require(_0xa0c1('0x0'));var _=require(_0xa0c1('0x1'));var sh=require(_0xa0c1('0x2'));var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0xa0c1('0x3'));var Mustache=require('mustache');var rp=require(_0xa0c1('0x4'));var logger=require(_0xa0c1('0x5'))(_0xa0c1('0x6'));var config=require(_0xa0c1('0x7'));var shared=require(_0xa0c1('0x8'));var scripts=require(_0xa0c1('0x9'));var FILES_PATH=_0xa0c1('0xa');var recursiveMapAttributes=[_0xa0c1('0xb'),_0xa0c1('0xc')];var verticesWithRetry=[_0xa0c1('0xd'),'getdigits',_0xa0c1('0xe')];var AGIVertices=function(_0x166e8f,_0x119df0,_0x1afec5){this[_0xa0c1('0xf')]=_0x166e8f;this[_0xa0c1('0x10')]=_0x119df0;this['mailRpc']=_0x1afec5;};AGIVertices[_0xa0c1('0x11')]['getVariable']=function(_0x269f4c,_0x5d2f84){this['rpc'][_0xa0c1('0x12')](_0x269f4c)[_0xa0c1('0x13')](function(_0x25d55d){_0x5d2f84(null,_0x25d55d?_0x25d55d['name']:![]);})[_0xa0c1('0x14')](function(_0xd201d8){_0x5d2f84(_0xd201d8);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x15')]=function(_0x1cafb2,_0x1b7287){this['rpc']['getVoiceQueueById'](_0x1cafb2)[_0xa0c1('0x13')](function(_0x35c8fd){_0x1b7287(null,_0x35c8fd?_0x35c8fd[_0xa0c1('0x16')]:![]);})[_0xa0c1('0x14')](function(_0x10f3dc){_0x1b7287(_0x10f3dc);});};AGIVertices['prototype']['getSquareProject']=function(_0x3f70a4,_0x10dc55){this[_0xa0c1('0x10')][_0xa0c1('0x17')](_0x3f70a4)['then'](function(_0x29a801){_0x10dc55(null,_0x29a801?_0x29a801['name']:![]);})[_0xa0c1('0x14')](function(_0x509327){_0x10dc55(_0x509327);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x18')]=function(_0x956323,_0x11dbc6){this[_0xa0c1('0x10')]['getSquareOdbcById'](_0x956323)[_0xa0c1('0x13')](function(_0x409a8d){_0x11dbc6(null,_0x409a8d?_0x409a8d[_0xa0c1('0x19')]:![]);})[_0xa0c1('0x14')](function(_0x1c880a){_0x11dbc6(_0x1c880a);});};AGIVertices['prototype'][_0xa0c1('0x1a')]=function(_0x41bfc7,_0xf95130){this['rpc'][_0xa0c1('0x1b')](_0x41bfc7)[_0xa0c1('0x13')](function(_0x585393){_0xf95130(null,_0x585393?_0x585393['name']:![]);})[_0xa0c1('0x14')](function(_0xb88f2){_0xf95130(_0xb88f2);});};AGIVertices['prototype'][_0xa0c1('0x1c')]=function(_0x26b267,_0xb2237d){this[_0xa0c1('0x10')]['getTrunkById'](_0x26b267)[_0xa0c1('0x13')](function(_0x634887){_0xb2237d(null,_0x634887?_0x634887[_0xa0c1('0x16')]:![]);})['catch'](function(_0x30c757){_0xb2237d(_0x30c757);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x1d')]=function(_0x3ed7b5,_0x217a5f){var _0x49530b=this;this['rpc'][_0xa0c1('0x1e')](_0x3ed7b5)[_0xa0c1('0x13')](function(_0x3be9e2){_0x217a5f(null,_0x3be9e2?_0x49530b[_0xa0c1('0x1f')](_0x3be9e2[_0xa0c1('0x20')]):![]);})[_0xa0c1('0x14')](function(_0x44114e){_0x217a5f(_0x44114e);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x21')]=function(_0x121e2a,_0x24a5bf){this['rpc'][_0xa0c1('0x22')](_0x121e2a)['then'](function(_0xcd1f57){_0x24a5bf(null,_0xcd1f57?_0xcd1f57:![]);})[_0xa0c1('0x14')](function(_0x5d3344){_0x24a5bf(_0x5d3344);});};AGIVertices[_0xa0c1('0x11')]['sendMailMessage']=function(_0x28fb4e,_0x4e4498,_0x575e98){this['mailRpc']['sendMailMessage'](_0x28fb4e,_0x4e4498)[_0xa0c1('0x13')](function(){_0x575e98(null);})[_0xa0c1('0x14')](function(_0x1db772){_0x575e98(_0x1db772);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x23')]=function(_0x256bb6,_0x31a7fd){this['rpc'][_0xa0c1('0x24')](_0x256bb6)[_0xa0c1('0x13')](function(_0x39c846){if(_0x39c846){if(_0x39c846[_0xa0c1('0x25')]){_0x31a7fd(null,[_0x39c846[_0xa0c1('0x26')]]);}else{_0x31a7fd(null,_[_0xa0c1('0x27')](_0x39c846[_0xa0c1('0x28')],_0xa0c1('0x26')));}}else{_0x31a7fd(null,![]);}})['catch'](function(_0x38fcbb){_0x31a7fd(_0x38fcbb);});};AGIVertices['prototype'][_0xa0c1('0x1f')]=function(_0x2f025b){return util[_0xa0c1('0x29')](_0xa0c1('0x2a'),FILES_PATH,_0x2f025b);};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x2b')]=function(_0x4d9c24,_0x4fa2a3,_0xece281){odbc[_0xa0c1('0x2c')](_0x4d9c24,function(_0x250305){if(_0x250305){logger[_0xa0c1('0x2d')](_0xa0c1('0x2e'),_0x250305);_0xece281(_0x250305);}else{logger[_0xa0c1('0x2f')]('ODBC\x20connection\x20successfully');odbc[_0xa0c1('0x30')](_0x4fa2a3,function(_0x2542d8,_0x1a9251){if(_0x2542d8){logger[_0xa0c1('0x2f')]('Error\x20executing\x20query\x20%s',_0x4fa2a3);_0xece281(_0x2542d8);}else{logger[_0xa0c1('0x2f')]('Query\x20executed\x20correctly\x20%s',_0x4fa2a3);odbc[_0xa0c1('0x31')](function(_0x3bf0be){if(_0x3bf0be){logger[_0xa0c1('0x2d')](_0xa0c1('0x32'),_0x3bf0be);}_0xece281(null,_0x1a9251);});}});}});};AGIVertices['prototype'][_0xa0c1('0x33')]=function(_0x47a5e7,_0x20db9e){this[_0xa0c1('0x10')]['getSmsAccountById'](_0x47a5e7)[_0xa0c1('0x13')](function(_0xa1f005){_0x20db9e(null,_0xa1f005?_0xa1f005:![]);})[_0xa0c1('0x14')](function(_0x1ecb8c){_0x20db9e(_0x1ecb8c);});};AGIVertices[_0xa0c1('0x11')]['createSmsMessage']=function(_0x3ff66f,_0x4b40b9){this[_0xa0c1('0x10')][_0xa0c1('0x34')](_0x3ff66f)['then'](function(_0x4dcc72){_0x4b40b9(null,_0x4dcc72);})['catch'](function(_0x7b0c65){_0x4b40b9(_0x7b0c65);});};AGIVertices['prototype'][_0xa0c1('0x35')]=function(_0x2561ba,_0x2bc730,_0x1a4dce){this[_0xa0c1('0x10')][_0xa0c1('0x35')]({'uniqueid':this[_0xa0c1('0xf')]['uniqueid'],'node':_0x2561ba[_0xa0c1('0x36')],'application':_0x2561ba[_0xa0c1('0x37')],'data':_0x2bc730||null,'project_name':this['channel']['arg_1'],'callerid':this[_0xa0c1('0xf')][_0xa0c1('0x38')]})[_0xa0c1('0x13')](function(_0x42c058){if(_0x1a4dce){_0x1a4dce(null,_0x42c058);}})['catch'](function(_0x5ccd7d){if(_0x1a4dce){_0x1a4dce(_0x5ccd7d);}});};AGIVertices['prototype']['createSquareRecording']=function(_0x4653ba,_0x2841fb,_0x5706d7,_0x3dd230){this['rpc'][_0xa0c1('0x39')]({'uniqueid':this['channel'][_0xa0c1('0x3a')],'callerid':this['channel'][_0xa0c1('0x38')],'calleridname':this[_0xa0c1('0xf')][_0xa0c1('0x3b')],'context':this['channel'][_0xa0c1('0x3c')],'extension':this[_0xa0c1('0xf')][_0xa0c1('0x3d')],'priority':this[_0xa0c1('0xf')][_0xa0c1('0x3e')],'accountcode':this[_0xa0c1('0xf')][_0xa0c1('0x3f')],'dnid':this[_0xa0c1('0xf')]['dnid'],'projectName':this[_0xa0c1('0xf')]['arg_1'],'saveName':_0x2841fb,'filename':_0x4653ba[_0xa0c1('0x40')]||_0x2841fb,'savePath':_0x5706d7})['then'](function(_0x5479d7){_0x3dd230(null,_0x5479d7);})[_0xa0c1('0x14')](function(_0x245987){_0x3dd230(_0x245987);});};AGIVertices['prototype'][_0xa0c1('0x41')]=function(_0x5df18c,_0x2c3416,_0x2b09c3,_0x559a9c,_0x575b7e){this['rpc'][_0xa0c1('0x41')]({'uniqueid':this['channel'][_0xa0c1('0x3a')],'body':_0x5df18c,'direction':_0x2c3416,'providerName':_0x2b09c3,'providerResponse':_0x559a9c})['then'](function(_0x4771e5){if(_0x575b7e){_0x575b7e(null,_0x4771e5);}})[_0xa0c1('0x14')](function(_0x472d53){if(_0x575b7e){_0x575b7e(_0x472d53);}});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x42')]=function(_0x20eaad,_0x338b51){this[_0xa0c1('0x10')][_0xa0c1('0x42')]({'firstName':_[_0xa0c1('0x43')](_0x20eaad[_0xa0c1('0x16')])||_[_0xa0c1('0x44')](_0x20eaad[_0xa0c1('0x16')])?'callback_'+Math[_0xa0c1('0x45')]():_0x20eaad[_0xa0c1('0x16')],'lastName':_[_0xa0c1('0x43')](_0x20eaad[_0xa0c1('0x46')])||_[_0xa0c1('0x44')](_0x20eaad[_0xa0c1('0x46')])?null:_0x20eaad[_0xa0c1('0x46')],'phone':_0x20eaad[_0xa0c1('0x47')],'ListId':_0x20eaad[_0xa0c1('0x48')],'scheduledat':_0x20eaad[_0xa0c1('0x49')],'callbackUniqueid':this[_0xa0c1('0xf')][_0xa0c1('0x3a')],'tags':_0xa0c1('0x4a'),'description':_0xa0c1('0x4b')+_0x20eaad[_0xa0c1('0x49')][_0xa0c1('0x4c')](),'priority':_0x20eaad[_0xa0c1('0x4d')]})[_0xa0c1('0x13')](function(_0x1baa07){_0x338b51(null,_0x1baa07);})[_0xa0c1('0x14')](function(_0x1917ec){_0x338b51(_0x1917ec);});};AGIVertices['prototype'][_0xa0c1('0x4e')]=function(_0x2eee65,_0x2f26ac){this[_0xa0c1('0x10')]['getPauseById'](_0x2eee65)[_0xa0c1('0x13')](function(_0x43cc3e){_0x2f26ac(null,_0x43cc3e?_0x43cc3e[_0xa0c1('0x16')]:![]);})['catch'](function(_0x27e84b){_0x2f26ac(_0x27e84b);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x4f')]=function(_0xa99acf,_0x30acca,_0x33150f){var _0xb03a9={'role':'agent'};_0xb03a9[_0xa99acf]=this['channel']['callerid'];this[_0xa0c1('0x10')][_0xa0c1('0x4f')](_0xb03a9,_0x30acca,this[_0xa0c1('0xf')][_0xa0c1('0x3a')])[_0xa0c1('0x13')](function(_0x1ad99d){_0x33150f(null,_[_0xa0c1('0x44')](_0x1ad99d)?![]:!![]);})[_0xa0c1('0x14')](function(_0xc402f0){logger[_0xa0c1('0x2d')](_0xc402f0);_0x33150f(null,![]);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x50')]=function(_0x2239c0,_0x5c7548){var _0x4fbc24={'role':_0xa0c1('0x51')};_0x4fbc24[_0x2239c0]=this['channel'][_0xa0c1('0x38')];this['rpc'][_0xa0c1('0x50')](_0x4fbc24)[_0xa0c1('0x13')](function(_0x291230){_0x5c7548(null,_['isNil'](_0x291230)?![]:!![]);})[_0xa0c1('0x14')](function(_0x547c38){logger['error'](_0x547c38);_0x5c7548(null,![]);});};AGIVertices[_0xa0c1('0x11')]['agentLogout']=function(_0x44e6d4,_0x1820ef){var _0x3fa9a7={'role':_0xa0c1('0x51')};_0x3fa9a7[_0x44e6d4]=this['channel'][_0xa0c1('0x38')];this[_0xa0c1('0x10')][_0xa0c1('0x52')](_0x3fa9a7)[_0xa0c1('0x13')](function(_0x49cb6d){_0x1820ef(null,_[_0xa0c1('0x44')](_0x49cb6d)?![]:!![]);})[_0xa0c1('0x14')](function(_0x29e5bb){logger[_0xa0c1('0x2d')](_0x29e5bb);_0x1820ef(null,![]);});};AGIVertices[_0xa0c1('0x11')]['agentLogin']=function(_0x27a8ea,_0x5cf82a){var _0x511aea={'role':'agent'};_0x511aea[_0x27a8ea]=this['channel']['callerid'];var _0x774926=_0x27a8ea!=_0xa0c1('0x53')?util[_0xa0c1('0x29')](_0xa0c1('0x54'),'LOCAL',this[_0xa0c1('0xf')][_0xa0c1('0x38')]):undefined;this[_0xa0c1('0x10')][_0xa0c1('0x55')](_0x511aea,_0x774926)[_0xa0c1('0x13')](function(_0x5d0f8a){_0x5cf82a(null,_[_0xa0c1('0x44')](_0x5d0f8a)?![]:!![]);})['catch'](function(_0x223054){logger[_0xa0c1('0x2d')](_0x223054);_0x5cf82a(null,![]);});};AGIVertices[_0xa0c1('0x11')]['shellCommand']=function(_0x137b8d,_0x416404){sh[_0xa0c1('0x56')](_[_0xa0c1('0x57')](_0x137b8d),function(_0x5994c3,_0x29788a){var _0x3afad9=_0x29788a[_0xa0c1('0x58')](/(\r\n|\n|\r)/gm,'');_0x416404(null,_0x3afad9);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x59')]=function(_0x124e41,_0x345df6){scripts[_0xa0c1('0x59')](_0x124e41[_0xa0c1('0x5a')],_0x124e41['google_cloud_tts_text_type']||_0xa0c1('0x5b'),_0x124e41[_0xa0c1('0x5b')],_0x124e41[_0xa0c1('0x5c')]||_0xa0c1('0x5d'),_0x124e41[_0xa0c1('0x5e')]||_0xa0c1('0x5f'),_0x124e41['audioEncoding']||'MP3')[_0xa0c1('0x13')](function(_0x338d2f){_0x345df6(null,_0x338d2f);})[_0xa0c1('0x14')](function(_0x3e1ee8){_0x345df6(_0x3e1ee8);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x60')]=function(_0x132acd,_0x37b091){scripts[_0xa0c1('0x60')](_0x132acd[_0xa0c1('0x5b')],_0x132acd[_0xa0c1('0x61')]||'en',0x1)['then'](function(_0x18b0cd){_0x37b091(null,_0x18b0cd);})[_0xa0c1('0x14')](function(_0x6fa296){_0x37b091(_0x6fa296);});};AGIVertices[_0xa0c1('0x11')]['restAPI']=function(_0x239bcd,_0x12928e){var _0x4ef956={'uri':_0x239bcd['url'],'method':_0x239bcd[_0xa0c1('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x239bcd[_0xa0c1('0x63')])===_0xa0c1('0x64')&&parseInt(_0x239bcd['timeout'])>=0x1?parseInt(_0x239bcd[_0xa0c1('0x63')])*0x3e8:0x5*0x3e8};if(_[_0xa0c1('0x65')]([_0xa0c1('0x66'),'PUT'],_0x4ef956[_0xa0c1('0x62')][_0xa0c1('0x67')]())){try{_0x4ef956[_0xa0c1('0x68')]=_0x239bcd['rawBody']?JSON[_0xa0c1('0x69')](_0x239bcd[_0xa0c1('0xc')]):{};}catch(_0x21b9e7){logger[_0xa0c1('0x2d')](_0xa0c1('0x6a'),_0x21b9e7);}}try{_0x4ef956[_0xa0c1('0x6b')]=_0x239bcd[_0xa0c1('0xb')]?JSON['parse'](_0x239bcd['rawHeaders']):{};}catch(_0x1a633c){logger['error'](_0xa0c1('0x6c'),_0x1a633c);}if(_0x239bcd[_0xa0c1('0x6d')]){try{var _0x376d44=require(_0x239bcd[_0xa0c1('0x6d')])[_0xa0c1('0x6e')](this,_0x4ef956);_0x4ef956[_0xa0c1('0x6f')]=Mustache['render'](_0x239bcd[_0xa0c1('0x70')],_0x376d44,{},['$$','$$']);if(_0x4ef956['headers']){_0x4ef956[_0xa0c1('0x6b')]=JSON[_0xa0c1('0x69')](Mustache[_0xa0c1('0x71')](JSON[_0xa0c1('0x72')](_0x4ef956['headers']),_0x376d44,{},['$$','$$']));}if(_0x4ef956[_0xa0c1('0x68')]){_0x4ef956['body']=JSON[_0xa0c1('0x69')](Mustache[_0xa0c1('0x71')](JSON[_0xa0c1('0x72')](_0x4ef956[_0xa0c1('0x68')]),_0x376d44,{},['$$','$$']));}}catch(_0x34594a){logger[_0xa0c1('0x2d')](_0xa0c1('0x73'),_0x34594a);}}rp(_0x4ef956)[_0xa0c1('0x13')](function(_0x3f69cc){var _0x449dd1={'statusCode':_0x3f69cc[_0xa0c1('0x74')]||0xc8,'statusMessage':_0x3f69cc[_0xa0c1('0x75')]||'OK','headers':_0x3f69cc[_0xa0c1('0x6b')]||{},'body':_0x3f69cc['body']||{}};_0x12928e(null,_0x449dd1);})[_0xa0c1('0x14')](function(_0x4a8cb2){var _0x3c87c9={'statusCode':_0x4a8cb2['statusCode']||0x1f4,'statusMessage':_0x4a8cb2[_0xa0c1('0x76')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x4a8cb2[_0xa0c1('0x77')]['headers']||{},'body':_0x4a8cb2[_0xa0c1('0x77')][_0xa0c1('0x68')]||{}};_0x12928e(null,_0x3c87c9);});};AGIVertices[_0xa0c1('0x11')]['googleDialogflow']=function(_0x14863e,_0x5d846a){scripts['googleDialogflow'](this[_0xa0c1('0xf')][_0xa0c1('0x3a')],_0x14863e['key'],_0x14863e[_0xa0c1('0x5b')],_0x14863e[_0xa0c1('0x78')]||'en')[_0xa0c1('0x13')](function(_0x3435c4){_0x5d846a(null,_0x3435c4);})['catch'](function(_0x9e7281){_0x5d846a(_0x9e7281);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x79')]=function(_0x25a64c,_0x39c630){scripts[_0xa0c1('0x79')](this['channel'][_0xa0c1('0x3a')],_0x25a64c[_0xa0c1('0x7a')],_0x25a64c[_0xa0c1('0x7b')],_0x25a64c['private_key'],_0x25a64c[_0xa0c1('0x5b')],_0x25a64c[_0xa0c1('0x7c')]||'en')[_0xa0c1('0x13')](function(_0x1534b6){_0x39c630(null,_0x1534b6);})[_0xa0c1('0x14')](function(_0x5865bc){_0x39c630(_0x5865bc);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x7d')]=function(_0xcce523,_0x282e76){scripts[_0xa0c1('0x7d')](this[_0xa0c1('0xf')],_0xcce523)[_0xa0c1('0x13')](function(_0x6b8e43){_0x282e76(null,_0x6b8e43);})['catch'](function(_0xf81df3){_0x282e76(_0xf81df3);});};AGIVertices['prototype'][_0xa0c1('0x7e')]=function(_0xd4a776,_0x42b289){scripts[_0xa0c1('0x7e')](_0xd4a776[_0xa0c1('0x7f')],_0xd4a776[_0xa0c1('0x5b')],_0xd4a776[_0xa0c1('0x80')]||'en-US',_0xd4a776['speed'])[_0xa0c1('0x13')](function(_0x4d4979){_0x42b289(null,_0x4d4979);})[_0xa0c1('0x14')](function(_0x3732f1){_0x42b289(_0x3732f1);});};AGIVertices[_0xa0c1('0x11')]['ispeechASR']=function(_0x14c94d,_0x4f5e73,_0xfce59c){scripts['ispeechASR'](_0x4f5e73,_0x14c94d[_0xa0c1('0x7f')],_0x14c94d[_0xa0c1('0x81')]||'en-US',this[_0xa0c1('0x82')](_0x14c94d['model'])?_0x14c94d[_0xa0c1('0x83')]:undefined)[_0xa0c1('0x13')](function(_0x39956c){_0xfce59c(null,_0x39956c);})['catch'](function(_0x59aa5d){_0xfce59c(_0x59aa5d);});};AGIVertices[_0xa0c1('0x11')]['awsPolly']=function(_0x386bd4,_0x29f391){scripts[_0xa0c1('0x84')](_0x386bd4[_0xa0c1('0x85')],_0x386bd4[_0xa0c1('0x86')],_0x386bd4[_0xa0c1('0x87')],_0x386bd4[_0xa0c1('0x88')]||_0xa0c1('0x89'),_0x386bd4[_0xa0c1('0x5b')],_0x386bd4[_0xa0c1('0x8a')]||_0xa0c1('0x5b'))[_0xa0c1('0x13')](function(_0x25c64a){_0x29f391(null,_0x25c64a);})['catch'](function(_0x3a4ad5){_0x29f391(_0x3a4ad5);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x8b')]=function(_0x49ebc6,_0xf714be){scripts['awsLex'](this[_0xa0c1('0xf')][_0xa0c1('0x3a')],_0x49ebc6['aws_access_key_id'],_0x49ebc6[_0xa0c1('0x86')],_0x49ebc6[_0xa0c1('0x8c')],_0x49ebc6['text'],_0x49ebc6['aws_bot_name'])[_0xa0c1('0x13')](function(_0x59c9c4){_0xf714be(null,_0x59c9c4);})[_0xa0c1('0x14')](function(_0x22943b){_0xf714be(_0x22943b);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x8d')]=function(_0x3fd4fa,_0x4fdc1d,_0x513e10){scripts[_0xa0c1('0x8d')](_0x4fdc1d,_0x3fd4fa[_0xa0c1('0x7f')],_0x3fd4fa[_0xa0c1('0x8e')]||_0xa0c1('0x5d'))[_0xa0c1('0x13')](function(_0x2d9c8a){_0x513e10(null,_0x2d9c8a);})[_0xa0c1('0x14')](function(_0x21c852){_0x513e10(_0x21c852);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x8f')]=function(_0x55caab,_0x35e840,_0xe741b3){scripts[_0xa0c1('0x8f')](_0x35e840,_0x55caab['appid'],_0x55caab[_0xa0c1('0x90')],_0x55caab[_0xa0c1('0x6f')])['then'](function(_0x3d524a){_0xe741b3(null,_0x3d524a);})[_0xa0c1('0x14')](function(_0x40ed74){_0xe741b3(_0x40ed74);});};AGIVertices['prototype'][_0xa0c1('0x91')]=function(_0x5ae6e6){var _0x1cc8e6=_[_0xa0c1('0x65')](verticesWithRetry,_0x5ae6e6[_0xa0c1('0x37')])?_0x5ae6e6:_[_0xa0c1('0x92')](_0x5ae6e6);for(var _0x3e441e in _0x1cc8e6){if(_0x1cc8e6[_0xa0c1('0x93')](_0x3e441e)){if(_0x1cc8e6[_0x3e441e]&&_['isString'](_0x1cc8e6[_0x3e441e])){if(_[_0xa0c1('0x65')](recursiveMapAttributes,_0x3e441e)){_0x1cc8e6[_0x3e441e]=this[_0xa0c1('0x94')](_0x1cc8e6[_0x3e441e]);}else{_0x1cc8e6[_0x3e441e]=this['replaceAllVariables'](_0x1cc8e6[_0x3e441e]);}}}}return _0x1cc8e6;};AGIVertices[_0xa0c1('0x11')]['recursiveNodeIndex']=function(_0xe9ab80){for(var _0x5aca45 in _0xe9ab80){if(_0xe9ab80[_0xa0c1('0x93')](_0x5aca45)){if(_['isPlainObject'](_0xe9ab80[_0x5aca45])){this[_0xa0c1('0x95')](_0xe9ab80[_0x5aca45]);}else if(_['isArray'](_0xe9ab80[_0x5aca45])){for(var _0x44d5ad=0x0;_0x44d5ad<_0xe9ab80[_0x5aca45][_0xa0c1('0x96')];_0x44d5ad++){this['recursiveNodeIndex'](_0xe9ab80[_0x5aca45][_0x44d5ad]);}}else if(_[_0xa0c1('0x97')](_0xe9ab80[_0x5aca45])){_0xe9ab80[_0x5aca45]=this[_0xa0c1('0x98')](_0xe9ab80[_0x5aca45]);}}}};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x99')]=function(_0x5a5d5f,_0x4eeccb){for(var _0x45c2d4 in _0x5a5d5f){if(_0x5a5d5f[_0xa0c1('0x93')](_0x45c2d4)){if(_['isPlainObject'](_0x5a5d5f[_0x45c2d4])){if(!_[_0xa0c1('0x43')](_0x5a5d5f[_0x45c2d4])){this[_0xa0c1('0x99')](_0x5a5d5f[_0x45c2d4],util[_0xa0c1('0x29')](_0xa0c1('0x9a'),_0x4eeccb,_0x45c2d4));}}else if(_[_0xa0c1('0x9b')](_0x5a5d5f[_0x45c2d4])){for(var _0x163e94=0x0;_0x163e94<_0x5a5d5f[_0x45c2d4][_0xa0c1('0x96')];_0x163e94++){this[_0xa0c1('0x99')](_0x5a5d5f[_0x45c2d4][_0x163e94],util[_0xa0c1('0x29')](_0xa0c1('0x9a'),_0x4eeccb,_0x45c2d4+'['+_0x163e94+']'));}}else{if(!_[_0xa0c1('0x44')](_0x5a5d5f[_0x45c2d4])){this['channel'][_0xa0c1('0x9c')](util[_0xa0c1('0x29')]('%s.%s',_0x4eeccb,_0x45c2d4),_0x5a5d5f[_0x45c2d4]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x2111fc){try{var _0x54fabf=JSON[_0xa0c1('0x69')](_0x2111fc);this[_0xa0c1('0x95')](_0x54fabf);return JSON['stringify'](_0x54fabf);}catch(_0x56bab3){return this['replaceAllVariables'](_0x2111fc);}};AGIVertices[_0xa0c1('0x11')]['replaceAllVariables']=function(_0x3026ba){var _0x22d0e6=_0x3026ba['split']('{');for(var _0x460ecd=0x1;_0x460ecd<_0x22d0e6['length'];_0x460ecd+=0x1){var _0x8b1328=_0x22d0e6[_0x460ecd][_0xa0c1('0x9d')]('}');if(_0x8b1328['length']>0x1){_0x3026ba=_0x3026ba[_0xa0c1('0x9e')]('{'+_0x8b1328[0x0]+'}',this[_0xa0c1('0xf')][_0xa0c1('0x9f')](_0x8b1328[0x0])[_0xa0c1('0xa0')]||_0x8b1328[0x0]);}}if(_0x22d0e6['length']===0x1){return _0x3026ba['toString']();}return this['replaceAllVariables'](_0x3026ba);};AGIVertices['prototype'][_0xa0c1('0xa1')]=function(_0x19c730,_0x2cee2e){var _0x457845=this[_0xa0c1('0xf')]['getVariable'](_0x19c730);if(_0x457845[_0xa0c1('0xa2')]===-0x1){return _0x457845;}logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0xa3'),_0x2cee2e,_0x457845[_0xa0c1('0xa0')]));return this[_0xa0c1('0xf')]['setVariable'](_0x2cee2e,_0x457845[_0xa0c1('0xa0')]);};AGIVertices['prototype'][_0xa0c1('0x82')]=function(_0x27f554){return _0x27f554&&_0x27f554!=='0'&&_0x27f554!=='-1'&&_0x27f554!=='';};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0xa4')]=function(_0x4ec6af){this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x4ec6af,'-');_0x4ec6af[_0xa0c1('0xa5')]=_0x4ec6af[_0xa0c1('0xa4')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0xa6')]=function(_0x4bab42){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0xa7'),_0x4bab42['label']));if(!this[_0xa0c1('0x82')](_0x4bab42[_0xa0c1('0x5b')])){return this[_0xa0c1('0xf')]['noop']('no\x20text\x20configured');}var _0x1f5d42='\x22'+_0x4bab42['text']+'\x22';if(this[_0xa0c1('0x82')](_0x4bab42[_0xa0c1('0x77')])){_0x1f5d42+=','+_0x4bab42['options'];}var _0x488f6e=this[_0xa0c1('0xf')][_0xa0c1('0x56')](_0xa0c1('0xa8'),_0x1f5d42);if(_0x488f6e[_0xa0c1('0xa2')]===-0x1){return _0x488f6e;}return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0xaa'),_0x1f5d42));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0xab')]=function(_0x3ef94d){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x3ef94d[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x3ef94d[_0xa0c1('0xac')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xad'));}var _0x3efe0f=_0x3ef94d[_0xa0c1('0xac')];if(this[_0xa0c1('0x82')](_0x3ef94d[_0xa0c1('0x77')])){_0x3efe0f+=','+_0x3ef94d[_0xa0c1('0x77')];}var _0x2c416f=this[_0xa0c1('0xf')][_0xa0c1('0x56')]('MRCPRecog',_0x3efe0f);if(_0x2c416f[_0xa0c1('0xa2')]===-0x1){return _0x2c416f;}var _0x5dec11=this[_0xa0c1('0xa1')](_0xa0c1('0xae'),_0xa0c1('0xaf'));if(_0x5dec11[_0xa0c1('0xa2')]===-0x1){return _0x5dec11;}var _0x29331e=this[_0xa0c1('0xa1')](_0xa0c1('0xb0'),'MRCP_RECOG_TRANSCRIPT');if(_0x29331e[_0xa0c1('0xa2')]===-0x1){return _0x29331e;}var _0x2df1b9=this[_0xa0c1('0xa1')](_0xa0c1('0xb1'),_0xa0c1('0xb2'));if(_0x2df1b9[_0xa0c1('0xa2')]===-0x1){return _0x2df1b9;}return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xb3'),_0x3efe0f));};AGIVertices['prototype'][_0xa0c1('0x6')]=function(_0x520450){logger['info'](util['format'](_0xa0c1('0xb4'),_0x520450['label']));return this['channel'][_0xa0c1('0x6')]([_0x520450['command'],_0x520450[_0xa0c1('0xb5')]]);};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0xb6')]=function(_0x1d8391){logger[_0xa0c1('0x2f')](util['format'](_0xa0c1('0xb7'),_0x1d8391[_0xa0c1('0x36')]));if(this['isConfigured'](_0x1d8391['timeout'])){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x1d8391[_0xa0c1('0x63')]));var _0x3542a3=this[_0xa0c1('0xf')][_0xa0c1('0xb8')](_0x1d8391[_0xa0c1('0x63')]);if(_0x3542a3[_0xa0c1('0xa2')]===-0x1){return _0x3542a3;}}return this['channel'][_0xa0c1('0xb6')]();};AGIVertices[_0xa0c1('0x11')]['callback']=function(_0xec8c5d){logger[_0xa0c1('0x2f')](util['format'](_0xa0c1('0xb9'),_0xec8c5d[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0xec8c5d[_0xa0c1('0x48')])){return this['channel'][_0xa0c1('0x2d')](_0xec8c5d,_0xa0c1('0xba'));}_0xec8c5d[_0xa0c1('0x49')]=moment();if(this[_0xa0c1('0x82')](_0xec8c5d['delay'])){_0xec8c5d[_0xa0c1('0x49')]=moment()['add'](_0xec8c5d[_0xa0c1('0xbb')],_0xa0c1('0xbc'));}if(!this[_0xa0c1('0x82')](_0xec8c5d[_0xa0c1('0x4d')])){_0xec8c5d[_0xa0c1('0x4d')]=0x2;}this['createCmContact'][_0xa0c1('0x6e')](this,_0xec8c5d);return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0xbd'),_0xec8c5d[_0xa0c1('0x47')],_0xec8c5d[_0xa0c1('0x48')],_0xec8c5d[_0xa0c1('0x49')]));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0xbe')]=function(_0x48a4cc){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x48a4cc[_0xa0c1('0x36')]));var _0x185f30=this[_0xa0c1('0xf')][_0xa0c1('0x56')](_0x48a4cc[_0xa0c1('0xbf')],_0x48a4cc['options']);if(_0x185f30[_0xa0c1('0xa2')]===-0x1){return _0x185f30;}return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xc0'),_0x48a4cc[_0xa0c1('0xbf')],_0x48a4cc[_0xa0c1('0x77')]));};AGIVertices[_0xa0c1('0x11')]['lumenvoxtts']=function(_0x43a2cc){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x43a2cc[_0xa0c1('0x36')]));if(!this['isConfigured'](_0x43a2cc[_0xa0c1('0x5b')])){return this['channel'][_0xa0c1('0xa9')](_0xa0c1('0xc1'));}var _0x2e4455='\x22'+_0x43a2cc[_0xa0c1('0x5b')]+'\x22';if(this[_0xa0c1('0x82')](_0x43a2cc[_0xa0c1('0x77')])){_0x2e4455+=','+_0x43a2cc[_0xa0c1('0x77')];}var _0x57f4b7=this[_0xa0c1('0xf')][_0xa0c1('0x56')](_0xa0c1('0xa8'),_0x2e4455);if(_0x57f4b7['result']===-0x1){return _0x57f4b7;}return this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')](_0xa0c1('0xaa'),_0x2e4455));};AGIVertices['prototype'][_0xa0c1('0xc2')]=function(_0x296d4f){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0xc3'),_0x296d4f[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x296d4f['text'])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xc1'));}var _0x19138a='\x22'+_0x296d4f[_0xa0c1('0x5b')]+'\x22';if(this['isConfigured'](_0x296d4f[_0xa0c1('0x77')])){_0x19138a+=','+_0x296d4f[_0xa0c1('0x77')];}var _0x88cabf=this[_0xa0c1('0xf')][_0xa0c1('0x56')](_0xa0c1('0xa8'),_0x19138a);if(_0x88cabf[_0xa0c1('0xa2')]===-0x1){return _0x88cabf;}return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0xaa'),_0x19138a));};AGIVertices[_0xa0c1('0x11')]['lumenvoxasr']=function(_0x31e327){logger['info'](util[_0xa0c1('0x29')](_0xa0c1('0xc4'),_0x31e327[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x31e327[_0xa0c1('0xac')])){return this['channel'][_0xa0c1('0xa9')]('no\x20grammar\x20configured');}var _0x5aa939=_0x31e327[_0xa0c1('0xac')];if(this[_0xa0c1('0x82')](_0x31e327['options'])){_0x5aa939+=','+_0x31e327['options'];}var _0x4c64ab=this['channel'][_0xa0c1('0x56')](_0xa0c1('0xc5'),_0x5aa939);if(_0x4c64ab[_0xa0c1('0xa2')]===-0x1){return _0x4c64ab;}var _0x28ad24=this[_0xa0c1('0xa1')](_0xa0c1('0xae'),_0xa0c1('0xc6'));if(_0x28ad24[_0xa0c1('0xa2')]===-0x1){return _0x28ad24;}var _0x4e8ba8=this['getAndSetVariable']('RECOG_INPUT()',_0xa0c1('0xc7'));if(_0x4e8ba8[_0xa0c1('0xa2')]===-0x1){return _0x4e8ba8;}var _0x383ef0=this[_0xa0c1('0xa1')]('RECOG_INSTANCE()',_0xa0c1('0xc8'));if(_0x383ef0[_0xa0c1('0xa2')]===-0x1){return _0x383ef0;}return this[_0xa0c1('0xf')]['noop'](util['format'](_0xa0c1('0xb3'),_0x5aa939));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0xc9')]=function(_0x279854){logger['info'](util[_0xa0c1('0x29')](_0xa0c1('0xca'),_0x279854[_0xa0c1('0x36')]));if(!this['isConfigured'](_0x279854[_0xa0c1('0xac')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')]('no\x20grammar\x20configured');}var _0x9b3f99=_0x279854['grammar'];if(this['isConfigured'](_0x279854[_0xa0c1('0x77')])){_0x9b3f99+=','+_0x279854[_0xa0c1('0x77')];}var _0xe9edce=this[_0xa0c1('0xf')][_0xa0c1('0x56')]('MRCPRecog',_0x9b3f99);if(_0xe9edce[_0xa0c1('0xa2')]===-0x1){return _0xe9edce;}var _0x1db13a=this[_0xa0c1('0xa1')](_0xa0c1('0xae'),'SESTEK_ASR_CONFIDENCE');if(_0x1db13a['result']===-0x1){return _0x1db13a;}var _0x2625f2=this[_0xa0c1('0xa1')](_0xa0c1('0xb0'),_0xa0c1('0xcb'));if(_0x2625f2[_0xa0c1('0xa2')]===-0x1){return _0x2625f2;}var _0x3a0139=this[_0xa0c1('0xa1')](_0xa0c1('0xb1'),'SESTEK_ASR_INSTANCE');if(_0x3a0139[_0xa0c1('0xa2')]===-0x1){return _0x3a0139;}return this['channel']['noop'](util[_0xa0c1('0x29')](_0xa0c1('0xb3'),_0x9b3f99));};AGIVertices['prototype'][_0xa0c1('0xcc')]=function(_0x5b5d86){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0xcd'),_0x5b5d86[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x5b5d86['odbc_id'])){return this['channel'][_0xa0c1('0x2d')](_0x5b5d86,_0xa0c1('0xce'));}var _0x310f96=this[_0xa0c1('0x18')][_0xa0c1('0x6e')](this,_0x5b5d86[_0xa0c1('0xcf')]);if(!_0x310f96){return this['channel'][_0xa0c1('0x2d')](_0x5b5d86,_0xa0c1('0xd0'));}if(!this[_0xa0c1('0x82')](_0x5b5d86['query'])){return this[_0xa0c1('0xf')]['error'](_0x5b5d86,_0xa0c1('0xd1'));}var _0x4d4210=_0x5b5d86['query'][_0xa0c1('0x58')](/(\r\n|\n|\r)/gm,'\x20');this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xd2'),_0x4d4210));var _0x4502ce=this[_0xa0c1('0x2b')][_0xa0c1('0x6e')](this,_0x310f96,_0x4d4210);this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x5b5d86,_0x4d4210);if(!this[_0xa0c1('0x82')](_0x5b5d86[_0xa0c1('0xd3')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xd4'));}var _0x4354eb=this[_0xa0c1('0x9f')][_0xa0c1('0x6e')](this,_0x5b5d86['variable_id']);if(!_0x4354eb){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x5b5d86,'no\x20variable\x20found');}var _0x230a7a=this;_0x4502ce[_0xa0c1('0xd5')](function(_0x544117,_0x98b830){Object['keys'](_0x544117)['forEach'](function(_0x175dea){_0x230a7a['channel'][_0xa0c1('0x9c')](util[_0xa0c1('0x29')]('%s[%s][%s]',_0x4354eb,_0x98b830,_0x175dea),_0x544117[_0x175dea]);});});this[_0xa0c1('0xf')][_0xa0c1('0x9c')](util[_0xa0c1('0x29')](_0xa0c1('0xd6'),_0x4354eb),_0x4502ce['length']);return this['channel'][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xd7'),_0x4354eb));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0xd8')]=function(_0x4504de){logger[_0xa0c1('0xd9')](util[_0xa0c1('0x29')](_0xa0c1('0xda'),_0x4504de[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x4504de[_0xa0c1('0xdb')])){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x4504de,_0xa0c1('0xdc'));}var _0x33555c=this['getUser'][_0xa0c1('0x6e')](this,_0x4504de[_0xa0c1('0xdb')]);if(!_0x33555c){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x4504de,'no\x20user\x20found');}var _0x51d2c8=this[_0xa0c1('0xf')]['exec']('DIAL',[util['format']('SIP/%s',_0x33555c),_0x4504de[_0xa0c1('0x63')],_0x4504de[_0xa0c1('0xdd')],_0x4504de[_0xa0c1('0x70')]]);if(_0x51d2c8['result']===-0x1){return _0x51d2c8;}return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0xde'),_0xa0c1('0xdf')));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0xe0')]=function(_0x60b54c){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0xe1'),_0x60b54c[_0xa0c1('0x36')]));if(!this['isConfigured'](_0x60b54c[_0xa0c1('0x7f')])){return this['channel'][_0xa0c1('0xa9')](_0xa0c1('0xe2'));}if(!this['isConfigured'](_0x60b54c['text'])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xc1'));}this[_0xa0c1('0xf')][_0xa0c1('0xe3')]=!![];this[_0xa0c1('0x35')](_0x60b54c);this[_0xa0c1('0x41')](_0x60b54c[_0xa0c1('0x5b')],'in','','');this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0xe4'),_0x60b54c[_0xa0c1('0x5b')]));var _0x1dd930=this[_0xa0c1('0xe5')][_0xa0c1('0x6e')](this,_0x60b54c);if(_0x1dd930){for(var _0x5c4d1e in _0x1dd930){if(_0x1dd930[_0xa0c1('0x93')](_0x5c4d1e)){this[_0xa0c1('0xf')][_0xa0c1('0x9c')](util[_0xa0c1('0x29')](_0xa0c1('0xe6'),_0x5c4d1e[_0xa0c1('0x67')]()),_0x1dd930[_0x5c4d1e]);}}this['createSquareMessage'](_0x1dd930['speech'],'out','dialogflow','');return this['channel'][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xe7'),_0x1dd930[_0xa0c1('0xe8')]));}return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x60b54c,_0xa0c1('0xe9'));};AGIVertices[_0xa0c1('0x11')]['dialogflowV2']=function(_0x16e660){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0xea'),_0x16e660[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x16e660[_0xa0c1('0x7a')])){return this['channel'][_0xa0c1('0xa9')](_0xa0c1('0xeb'));}if(!this[_0xa0c1('0x82')](_0x16e660[_0xa0c1('0x7b')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xec'));}if(!this[_0xa0c1('0x82')](_0x16e660[_0xa0c1('0xed')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xee'));}if(!this[_0xa0c1('0x82')](_0x16e660[_0xa0c1('0x7c')])){return this['channel'][_0xa0c1('0xa9')]('no\x20anguage\x20configured');}if(!this[_0xa0c1('0x82')](_0x16e660['text'])){return this['channel'][_0xa0c1('0xa9')](_0xa0c1('0xc1'));}this['channel'][_0xa0c1('0xe3')]=!![];this[_0xa0c1('0x35')](_0x16e660);this[_0xa0c1('0x41')](_0x16e660[_0xa0c1('0x5b')],'in','','');this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')](_0xa0c1('0xef'),_0x16e660[_0xa0c1('0x5b')]));var _0x218bdd=this[_0xa0c1('0x79')][_0xa0c1('0x6e')](this,_0x16e660);if(_0x218bdd){for(var _0x347697 in _0x218bdd){if(_0x218bdd[_0xa0c1('0x93')](_0x347697)){if(_0x347697!=='providerResponse'){this[_0xa0c1('0xf')][_0xa0c1('0x9c')](util['format'](_0xa0c1('0xe6'),_0x347697['toUpperCase']()),_0x218bdd[_0x347697]);}}}this['createSquareMessage'](_0x218bdd[_0xa0c1('0xe8')],'out',_0xa0c1('0xf0'),_0x218bdd[_0xa0c1('0xf1')]);return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xf2'),_0x218bdd[_0xa0c1('0xe8')]));}return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x16e660,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0xf3')]=function(_0x2fedf7){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0xf4'),_0x2fedf7[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x2fedf7[_0xa0c1('0xf5')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xf6'));}if(!this[_0xa0c1('0x82')](_0x2fedf7[_0xa0c1('0xf7')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xf8'));}if(!this[_0xa0c1('0x82')](_0x2fedf7[_0xa0c1('0xf9')])){return this[_0xa0c1('0xf')]['noop'](_0xa0c1('0xfa'));}if(!this[_0xa0c1('0x82')](_0x2fedf7['ndassistant_url'])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xc1'));}this[_0xa0c1('0xf')][_0xa0c1('0xe3')]=!![];this['createSquareDetailsReport'](_0x2fedf7);this[_0xa0c1('0x41')](_0x2fedf7[_0xa0c1('0x5b')],'in','','');this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')]('Trying\x20SestekNDA:\x20%s',_0x2fedf7[_0xa0c1('0x5b')]));var _0x2f6a0e=this[_0xa0c1('0x7d')]['sync'](this,_0x2fedf7);if(_0x2f6a0e){for(var _0x670f08 in _0x2f6a0e){if(_0x2f6a0e[_0xa0c1('0x93')](_0x670f08)){this['channel']['setVariable'](util[_0xa0c1('0x29')](_0xa0c1('0xfb'),_0x670f08[_0xa0c1('0x67')]()),_0x2f6a0e[_0x670f08]);}}this[_0xa0c1('0x41')](_0x2f6a0e[_0xa0c1('0xe8')],_0xa0c1('0xfc'),_0xa0c1('0xf3'),'');if(_0x2f6a0e[_0xa0c1('0xfd')]){this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xfe'),_0x2f6a0e[_0xa0c1('0xfd')]));var _0x52b48f=this['channel']['streamFile'](_0x2f6a0e['audiofile']);try{fs[_0xa0c1('0xff')](_0x2f6a0e[_0xa0c1('0xfd')]+'.wav');}catch(_0x4d5949){logger[_0xa0c1('0x2d')](_0x4d5949);}return _0x52b48f;}else{return this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')](_0xa0c1('0x100'),_0x2f6a0e[_0xa0c1('0xe8')]));}}return this['channel'][_0xa0c1('0x2d')](_0x2fedf7,_0xa0c1('0x101'));};AGIVertices['prototype'][_0xa0c1('0x102')]=function(_0x296990){logger['info'](util['format'](_0xa0c1('0x103'),_0x296990[_0xa0c1('0x36')]));return this[_0xa0c1('0xf')][_0xa0c1('0xa9')]('end');};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x104')]=function(_0x52e1dd){logger['info'](util[_0xa0c1('0x29')](_0xa0c1('0x105'),_0x52e1dd[_0xa0c1('0x36')]));var _0x4c5f56='';if(_0x52e1dd[_0xa0c1('0x106')]){if(!this[_0xa0c1('0x82')](_0x52e1dd[_0xa0c1('0x106')])){return this[_0xa0c1('0xf')]['error'](_0x52e1dd,_0xa0c1('0x107'));}else{var _0x5ef3aa=parseInt(_0x52e1dd[_0xa0c1('0x106')],0xa);if(isNaN(_0x5ef3aa)){_0x4c5f56=_0x52e1dd[_0xa0c1('0x106')];}else{_0x4c5f56=this['getTrunk'][_0xa0c1('0x6e')](this,_0x52e1dd['trunk_id']);if(!_0x4c5f56){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x52e1dd,_0xa0c1('0x108'));}}}}else if(_0x52e1dd['trunk_name']){_0x4c5f56=_0x52e1dd[_0xa0c1('0x109')];}else{return this[_0xa0c1('0xf')]['error'](_0x52e1dd,_0xa0c1('0x107'));}var _0x518414=this['channel']['exec'](_0xa0c1('0xdf'),[util[_0xa0c1('0x29')]('SIP/%s/%s',_0x4c5f56,_0x52e1dd[_0xa0c1('0x47')]),_0x52e1dd['timeout'],_0x52e1dd[_0xa0c1('0xdd')],_0x52e1dd[_0xa0c1('0x70')]]);if(_0x518414['result']===-0x1){return _0x518414;}return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format']('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x10a')]=function(_0x96ffbb){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x10b'),_0x96ffbb['label']));return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0x10a'));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x10c')]=function(_0x2da8e7){logger[_0xa0c1('0x2f')](util['format'](_0xa0c1('0x10d'),_0x2da8e7[_0xa0c1('0x36')]));if(_0x2da8e7[_0xa0c1('0xa5')]===0x0){return this[_0xa0c1('0xa4')](_0x2da8e7);}_0x2da8e7[_0xa0c1('0xa5')]-=0x1;if(!this[_0xa0c1('0x82')](_0x2da8e7['file_id'])){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x2da8e7,_0xa0c1('0x10e'));}var _0x347b51=this[_0xa0c1('0x1d')][_0xa0c1('0x6e')](this,_0x2da8e7[_0xa0c1('0x10f')]);if(!_0x347b51){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x2da8e7,_0xa0c1('0x110'));}if(!this[_0xa0c1('0x82')](_0x2da8e7['variable_id'])){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0xed98d2=this[_0xa0c1('0xf')][_0xa0c1('0x111')](_0x347b51,_0x2da8e7[_0xa0c1('0x112')],_0x2da8e7[_0xa0c1('0x113')]);var _0x250b06=_0xed98d2[_0xa0c1('0xa2')]?_0xed98d2[_0xa0c1('0xa2')][_0xa0c1('0x4c')]():'';logger[_0xa0c1('0x2f')](_0xa0c1('0x114'),JSON[_0xa0c1('0x72')](_0xed98d2));if(_0xed98d2[_0xa0c1('0xa2')]===-0x1){this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x2da8e7,_0x250b06);return _0xed98d2;}else if(_0xed98d2[_0xa0c1('0xa0')]===_0xa0c1('0x63')){_0xed98d2[_0xa0c1('0xa2')]=_0x250b06[_0xa0c1('0x96')]>=parseInt(_0x2da8e7[_0xa0c1('0x115')])?'x':'i';}else{_0xed98d2['result']=_0x250b06[_0xa0c1('0x96')]>=parseInt(_0x2da8e7[_0xa0c1('0x115')])&&_0x250b06[_0xa0c1('0x96')]<=parseInt(_0x2da8e7[_0xa0c1('0x113')])?'x':'i';}var _0x8d8948=this['getVariable'][_0xa0c1('0x6e')](this,_0x2da8e7[_0xa0c1('0xd3')]);if(!_0x8d8948){return this[_0xa0c1('0xf')]['error'](_0x2da8e7,_0xa0c1('0x116'));}this['channel']['setVariable'](_0x8d8948,_0x250b06);if(this[_0xa0c1('0x82')](_0x2da8e7['hiddendigitsnum'])){var _0x26701f=parseInt(_0x2da8e7[_0xa0c1('0x117')],0xa);var _0x15e622=rs[_0xa0c1('0x118')]({'charset':'*','length':_0x26701f});var _0x48a4e0=_0x250b06[_0xa0c1('0x96')];if(_0x48a4e0>0x0){if(_0x48a4e0>_0x26701f){this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x2da8e7,_0x2da8e7[_0xa0c1('0x119')]==='first'?_0x15e622+_0x250b06[_0xa0c1('0x11a')](_0x26701f):_0x250b06[_0xa0c1('0x11a')](0x0,_0x48a4e0-_0x26701f)+_0x15e622);}else{this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x2da8e7,rs['generate']({'charset':'*','length':_0x48a4e0}));}}else{this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x2da8e7,'');}}else{this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x2da8e7,_0x250b06);}return _0xed98d2;};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0xe')]=function(_0x35ddd3){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x11b'),_0x35ddd3[_0xa0c1('0x36')]));return this[_0xa0c1('0x10c')](_0x35ddd3);};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x11c')]=function(_0x107e6d){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x11d'),_0x107e6d[_0xa0c1('0x36')]));this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x107e6d,_0x107e6d[_0xa0c1('0x11e')]);return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x11f'),_0x107e6d['goalname']));};AGIVertices['prototype'][_0xa0c1('0x120')]=function(_0x3fb2cb){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x121'),_0x3fb2cb[_0xa0c1('0x36')]));if(!this['isConfigured'](_0x3fb2cb[_0xa0c1('0x85')])||!this['isConfigured'](_0x3fb2cb[_0xa0c1('0x86')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x3fb2cb[_0xa0c1('0x5b')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xc1'));}this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')](_0xa0c1('0x122'),_0x3fb2cb[_0xa0c1('0x5b')]));var _0x5c56f4=this[_0xa0c1('0x84')][_0xa0c1('0x6e')](this,_0x3fb2cb);if(_0x5c56f4){this['channel']['noop'](util[_0xa0c1('0x29')](_0xa0c1('0x123'),_0x5c56f4));var _0x2382fe=this[_0xa0c1('0xf')]['streamFile'](_0x5c56f4);try{fs[_0xa0c1('0xff')](_0x5c56f4+_0xa0c1('0x124'));}catch(_0x105e03){logger[_0xa0c1('0x2d')](_0x105e03);}return _0x2382fe;}return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x3fb2cb,_0xa0c1('0x125'));};AGIVertices[_0xa0c1('0x11')]['awslex']=function(_0x2602cb){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x2602cb['label']));if(!this[_0xa0c1('0x82')](_0x2602cb[_0xa0c1('0x85')])||!this[_0xa0c1('0x82')](_0x2602cb[_0xa0c1('0x86')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0x126'));}if(!this[_0xa0c1('0x82')](_0x2602cb['aws_bot_name'])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0x127'));}if(!this[_0xa0c1('0x82')](_0x2602cb[_0xa0c1('0x5b')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xc1'));}this[_0xa0c1('0xf')][_0xa0c1('0xe3')]=!![];this[_0xa0c1('0x35')](_0x2602cb);this[_0xa0c1('0x41')](_0x2602cb['text'],'in','','');this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0x128'),_0x2602cb[_0xa0c1('0x5b')]));var _0x4f2757=this[_0xa0c1('0x8b')][_0xa0c1('0x6e')](this,_0x2602cb);if(_0x4f2757){for(var _0xd94182 in _0x4f2757){if(_0x4f2757[_0xa0c1('0x93')](_0xd94182)&&_[_0xa0c1('0x97')](_0x4f2757[_0xd94182])){this['channel']['setVariable'](util[_0xa0c1('0x29')](_0xa0c1('0x129'),_0xd94182[_0xa0c1('0x67')]()),_0x4f2757[_0xd94182]);}}if(_[_0xa0c1('0x44')](_0x4f2757[_0xa0c1('0x76')])){return this[_0xa0c1('0xf')]['noop'](_0xa0c1('0x12a'));}else{this[_0xa0c1('0x41')](_0x4f2757[_0xa0c1('0x76')],_0xa0c1('0xfc'),_0xa0c1('0x12b'),'');return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x12c'),_0x4f2757[_0xa0c1('0x76')]));}}return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x2602cb,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0xa0c1('0x12d')]=function(_0x57bdb9){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x12e'),_0x57bdb9['label'],_0x57bdb9[_0xa0c1('0x63')]));if(!this['isConfigured'](_0x57bdb9[_0xa0c1('0x7f')])){return this['channel'][_0xa0c1('0xa9')](_0xa0c1('0xe2'));}var _0x40c053='wav';var _0x1a416c=util[_0xa0c1('0x29')](_0xa0c1('0x12f'),FILES_PATH,rs[_0xa0c1('0x118')](0x4));var _0x5930be=util[_0xa0c1('0x29')](_0xa0c1('0x9a'),_0x1a416c,_0x40c053);var _0x274c5c=!![];if(_0x57bdb9[_0xa0c1('0x130')]==='NOBEEP'){_0x274c5c=![];}var _0x5494d8=this['channel']['recordFile'](_0x1a416c,_0x40c053,_0x57bdb9['intKey'],_0x57bdb9[_0xa0c1('0x63')],undefined,_0x274c5c);if(_0x5494d8[_0xa0c1('0xa2')]!==-0x1){this[_0xa0c1('0xf')]['noop'](util['format'](_0xa0c1('0x131'),_0x5930be));var _0x4e7e9c=this['googleASR'][_0xa0c1('0x6e')](this,_0x57bdb9,_0x5930be);if(_0x4e7e9c){for(var _0x281b43 in _0x4e7e9c){if(_0x4e7e9c[_0xa0c1('0x93')](_0x281b43)){this[_0xa0c1('0xf')][_0xa0c1('0x9c')](util['format'](_0xa0c1('0x132'),_0x281b43['toUpperCase']()),_0x4e7e9c[_0x281b43]);}}return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format']('GoogleASR\x20Result\x20%s',JSON[_0xa0c1('0x72')](_0x4e7e9c)));}}return _0x5494d8;};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x133')]=function(_0xb4284d){logger['info'](util[_0xa0c1('0x29')](_0xa0c1('0x134'),_0xb4284d['label']));if(!this[_0xa0c1('0x82')](_0xb4284d['appid'])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0x135'));}if(!this[_0xa0c1('0x82')](_0xb4284d[_0xa0c1('0x90')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0x136'));}var _0x19ea74=_0xa0c1('0x137');var _0x4d3c2d=util['format']('%s/recordings/%s',FILES_PATH,rs[_0xa0c1('0x118')](0x4));var _0x3ebf77=util[_0xa0c1('0x29')](_0xa0c1('0x9a'),_0x4d3c2d,_0x19ea74);var _0x3c11a=!![];if(_0xb4284d[_0xa0c1('0x130')]===_0xa0c1('0x138')){_0x3c11a=![];}var _0x530508=this[_0xa0c1('0xf')][_0xa0c1('0x139')](_0x4d3c2d,_0x19ea74,_0xb4284d[_0xa0c1('0x13a')],_0xb4284d[_0xa0c1('0x63')],undefined,_0x3c11a);if(_0x530508[_0xa0c1('0xa2')]!==-0x1){this['channel'][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x13b'),_0x3ebf77));var _0x284d9e=this[_0xa0c1('0x8f')][_0xa0c1('0x6e')](this,_0xb4284d,_0x3ebf77);if(_0x284d9e){for(var _0x40cf93 in _0x284d9e){if(_0x284d9e[_0xa0c1('0x93')](_0x40cf93)){this['channel'][_0xa0c1('0x9c')](util[_0xa0c1('0x29')](_0xa0c1('0x13c'),_0x40cf93['toUpperCase']()),_0x284d9e[_0x40cf93]);}}return this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')](_0xa0c1('0x13d'),JSON[_0xa0c1('0x72')](_0x284d9e)));}}return _0x530508;};AGIVertices['prototype'][_0xa0c1('0x13e')]=function(_0x4b6f09){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x4b6f09[_0xa0c1('0x36')]));return this[_0xa0c1('0xf')][_0xa0c1('0x13f')](_0x4b6f09[_0xa0c1('0x3c')],_0x4b6f09[_0xa0c1('0x3d')],_0x4b6f09[_0xa0c1('0x3e')]);};AGIVertices['prototype'][_0xa0c1('0x140')]=function(_0x379835){logger['info'](util[_0xa0c1('0x29')](_0xa0c1('0x141'),_0x379835[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x379835[_0xa0c1('0x142')])){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x379835,_0xa0c1('0x143'));}try{var _0x15c915=eval(_0x379835[_0xa0c1('0x142')])?_0xa0c1('0x144'):_0xa0c1('0x145');this['channel'][_0xa0c1('0xa9')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x379835[_0xa0c1('0x142')],_0x15c915));return{'code':0xc8,'result':_0x15c915};}catch(_0x47b1d7){return{'code':0xc8,'result':_0xa0c1('0x145')};}};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x146')]=function(_0x43f98f){logger[_0xa0c1('0x2f')](util['format'](_0xa0c1('0x147'),_0x43f98f['label']));if(!this[_0xa0c1('0x82')](_0x43f98f[_0xa0c1('0x148')])){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x43f98f,_0xa0c1('0x149'));}var _0x378b0c=this[_0xa0c1('0x23')][_0xa0c1('0x6e')](this,_0x43f98f[_0xa0c1('0x148')]);if(!_0x378b0c){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x43f98f,_0xa0c1('0x14a'));}for(var _0x357033=0x0;_0x357033<_0x378b0c[_0xa0c1('0x96')];_0x357033+=0x1){var _0x58afc4=this[_0xa0c1('0xf')][_0xa0c1('0x9f')](util[_0xa0c1('0x29')](_0xa0c1('0x14b'),_0x378b0c[_0x357033]));if(_0x58afc4[_0xa0c1('0xa2')]===-0x1){return _0x58afc4;}logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')]('IFTIME\x20%s\x20%s',_0x378b0c[_0x357033],_0x58afc4[_0xa0c1('0xa0')]));if(_0x58afc4[_0xa0c1('0xa0')]==='true'){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x14c'),_0x378b0c[_0x357033],_0xa0c1('0x144')));this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0x14c'),_0x378b0c[_0x357033],_0xa0c1('0x144')));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0xa0c1('0x29')](_0xa0c1('0x14c'),_0x378b0c[_0x357033],'false'));this['channel'][_0xa0c1('0xa9')](util['format'](_0xa0c1('0x14c'),_0x378b0c[_0x357033],'false'));}}return{'code':0xc8,'result':_0xa0c1('0x145')};};AGIVertices[_0xa0c1('0x11')]['hangup']=function(_0x11450a){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x14d'),_0x11450a[_0xa0c1('0x36')]));return this[_0xa0c1('0xf')][_0xa0c1('0x14e')]();};AGIVertices['prototype'][_0xa0c1('0x14f')]=function(_0x55218d){logger[_0xa0c1('0x2f')](util['format'](_0xa0c1('0x150'),_0x55218d[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x55218d[_0xa0c1('0x7f')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xe2'));}var _0xa2c1c2=_0xa0c1('0x137');var _0x3049cd=util[_0xa0c1('0x29')](_0xa0c1('0x12f'),FILES_PATH,rs[_0xa0c1('0x118')](0x4));var _0x63bbcc=util[_0xa0c1('0x29')]('%s.%s',_0x3049cd,_0xa2c1c2);var _0x5a1d0b=!![];if(_0x55218d[_0xa0c1('0x130')]===_0xa0c1('0x138')){_0x5a1d0b=![];}var _0x501328=this[_0xa0c1('0xf')][_0xa0c1('0x139')](_0x3049cd,_0xa2c1c2,_0x55218d['intKey'],_0x55218d[_0xa0c1('0x63')],undefined,_0x5a1d0b);if(_0x501328[_0xa0c1('0xa2')]!==-0x1){this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0x151'),_0x63bbcc));var _0x4acd24=this[_0xa0c1('0x152')][_0xa0c1('0x6e')](this,_0x55218d,_0x63bbcc);if(_0x4acd24){for(var _0x2c47ca in _0x4acd24){if(_0x4acd24['hasOwnProperty'](_0x2c47ca)){this[_0xa0c1('0xf')][_0xa0c1('0x9c')](util['format'](_0xa0c1('0x153'),_0x2c47ca[_0xa0c1('0x67')]()),_0x4acd24[_0x2c47ca]);}}return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')]('IspeechASR\x20Result\x20%s',JSON[_0xa0c1('0x72')](_0x4acd24)));}}return _0x501328;};AGIVertices['prototype'][_0xa0c1('0x154')]=function(_0x412dce){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x155'),_0x412dce[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x412dce[_0xa0c1('0x7f')])){return this[_0xa0c1('0xf')]['noop'](_0xa0c1('0xe2'));}if(!this[_0xa0c1('0x82')](_0x412dce[_0xa0c1('0x5b')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xc1'));}this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x156'),_0x412dce['text']));var _0x5b8aee=this[_0xa0c1('0x7e')][_0xa0c1('0x6e')](this,_0x412dce);if(_0x5b8aee){this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0x151'),_0x5b8aee));var _0x3a8644=this[_0xa0c1('0xf')][_0xa0c1('0x157')](_0x5b8aee,_0x412dce['intKey']);try{fs['unlink'](_0x5b8aee+_0xa0c1('0x124'));}catch(_0x40bec5){logger[_0xa0c1('0x2d')](_0x40bec5);}return _0x3a8644;}return this['channel'][_0xa0c1('0x2d')](_0x412dce,_0xa0c1('0x158'));};AGIVertices['prototype'][_0xa0c1('0x159')]=function(_0xe6d58b){logger[_0xa0c1('0x2f')](util['format'](_0xa0c1('0x15a'),_0xe6d58b[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0xe6d58b[_0xa0c1('0x15b')])){return this[_0xa0c1('0xf')]['error'](_0xe6d58b,_0xa0c1('0x15c'));}logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x15d'),this['channel']['callerid'],_0xe6d58b['findBy']));var _0x1f6914=this[_0xa0c1('0x55')][_0xa0c1('0x6e')](this,_0xe6d58b[_0xa0c1('0x15b')]);if(_0x1f6914){logger['info'](util[_0xa0c1('0x29')](_0xa0c1('0x15e'),this[_0xa0c1('0xf')]['callerid'],_0xe6d58b['findBy']));this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')](_0xa0c1('0x15e'),this[_0xa0c1('0xf')][_0xa0c1('0x38')],_0xe6d58b[_0xa0c1('0x15b')]));return{'code':0xc8,'result':_0xa0c1('0x15f')};}else{logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xa0c1('0x38')],_0xe6d58b[_0xa0c1('0x15b')]));this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')](_0xa0c1('0x160'),this[_0xa0c1('0xf')][_0xa0c1('0x38')],_0xe6d58b[_0xa0c1('0x15b')]));return{'code':0xc8,'result':_0xa0c1('0x161')};}};AGIVertices['prototype'][_0xa0c1('0x162')]=function(_0x3bf6dd){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x163'),_0x3bf6dd['label']));if(!this[_0xa0c1('0x82')](_0x3bf6dd[_0xa0c1('0x15b')])){return this[_0xa0c1('0xf')]['error'](_0x3bf6dd,_0xa0c1('0x15c'));}logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x15d'),this['channel']['callerid'],_0x3bf6dd[_0xa0c1('0x15b')]));var _0x1f481e=this[_0xa0c1('0x52')][_0xa0c1('0x6e')](this,_0x3bf6dd[_0xa0c1('0x15b')]);if(_0x1f481e){logger['info'](util[_0xa0c1('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x3bf6dd[_0xa0c1('0x15b')]));this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0x15e'),this['channel'][_0xa0c1('0x38')],_0x3bf6dd[_0xa0c1('0x15b')]));return{'code':0xc8,'result':_0xa0c1('0x15f')};}else{logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x160'),this['channel'][_0xa0c1('0x38')],_0x3bf6dd[_0xa0c1('0x15b')]));this['channel'][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x160'),this[_0xa0c1('0xf')]['callerid'],_0x3bf6dd[_0xa0c1('0x15b')]));return{'code':0xc8,'result':_0xa0c1('0x161')};}};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x164')]=function(_0xfbab31){logger[_0xa0c1('0x2f')](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0xfbab31['label']));if(!this[_0xa0c1('0x82')](_0xfbab31[_0xa0c1('0x165')])){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0xfbab31,'no\x20operation\x20configured');}this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')](_0xa0c1('0x166'),_0xfbab31['operation']));var _0xb6f657=eval(_0xfbab31['operation']);if(!this['isConfigured'](_0xfbab31[_0xa0c1('0xd3')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2dae35=this[_0xa0c1('0x9f')][_0xa0c1('0x6e')](this,_0xfbab31[_0xa0c1('0xd3')]);if(!_0x2dae35){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0xfbab31,_0xa0c1('0x116'));}if(_[_0xa0c1('0x9b')](_0xb6f657)){var _0x54ccf7=this;_0xb6f657[_0xa0c1('0xd5')](function(_0x213571,_0x44e086){_0x54ccf7[_0xa0c1('0xf')][_0xa0c1('0x9c')](util[_0xa0c1('0x29')](_0xa0c1('0x167'),_0x2dae35,_0x44e086),_0x213571);});return this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')](_0xa0c1('0x168'),_0x2dae35));}else{return this[_0xa0c1('0xf')][_0xa0c1('0x9c')](_0x2dae35,_0xb6f657);}};AGIVertices['prototype'][_0xa0c1('0xd')]=function(_0x2dfdb3){logger[_0xa0c1('0x2f')](util['format']('Enter\x20in\x20MENU\x20(%s)\x20block',_0x2dfdb3[_0xa0c1('0x36')]));if(_0x2dfdb3['retry']===0x0){return this['maxRetry'](_0x2dfdb3);}_0x2dfdb3['retry']-=0x1;if(!this[_0xa0c1('0x82')](_0x2dfdb3[_0xa0c1('0x10f')])){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x2dfdb3,'no\x20file\x20audio\x20selected');}var _0x8abb0d=this[_0xa0c1('0x1d')][_0xa0c1('0x6e')](this,_0x2dfdb3[_0xa0c1('0x10f')]);if(!_0x8abb0d){return this['channel'][_0xa0c1('0x2d')](_0x2dfdb3,_0xa0c1('0x110'));}var _0x4a8e00=this[_0xa0c1('0xf')]['getData'](_0x8abb0d,_0x2dfdb3[_0xa0c1('0x112')],_0x2dfdb3[_0xa0c1('0x169')]);var _0x2c1f3d=_0x4a8e00[_0xa0c1('0xa2')];if(_0x4a8e00[_0xa0c1('0xa2')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x2dfdb3,'-1');return _0x4a8e00;}else if(_0x4a8e00['extra']===_0xa0c1('0x63')){_0x4a8e00[_0xa0c1('0xa2')]=_0x4a8e00[_0xa0c1('0xa2')][_0xa0c1('0x96')]>0x0?_0x4a8e00[_0xa0c1('0xa2')]:'t';}else if(_[_0xa0c1('0x43')](_0x4a8e00['result'])){_0x4a8e00['result']='#';_0x2c1f3d='#';}if(!this[_0xa0c1('0x82')](_0x2dfdb3['variable_id'])){this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xd4'));}else{var _0x5ae374=this[_0xa0c1('0x9f')][_0xa0c1('0x6e')](this,_0x2dfdb3[_0xa0c1('0xd3')]);if(!_0x5ae374){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x2dfdb3,_0xa0c1('0x116'));}this[_0xa0c1('0xf')]['setVariable'](_0x5ae374,_0x2c1f3d);}this['createSquareDetailsReport'][_0xa0c1('0x6e')](this,_0x2dfdb3,_0x2c1f3d);return _0x4a8e00;};AGIVertices[_0xa0c1('0x11')]['noop']=function(_0x1df1fa){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x16a'),_0x1df1fa['label']));return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0x1df1fa['output']||_0x1df1fa[_0xa0c1('0x36')]);};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x16b')]=function(_0x5e7be8){logger[_0xa0c1('0x2f')](util['format'](_0xa0c1('0x16c'),_0x5e7be8[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x5e7be8[_0xa0c1('0x15b')])){return this['channel'][_0xa0c1('0x2d')](_0x5e7be8,_0xa0c1('0x15c'));}logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x15d'),this[_0xa0c1('0xf')]['callerid'],_0x5e7be8[_0xa0c1('0x15b')]));var _0x312697=this[_0xa0c1('0x4e')][_0xa0c1('0x6e')](this,_0x5e7be8[_0xa0c1('0x16d')]);var _0x53934d=this[_0xa0c1('0x4f')]['sync'](this,_0x5e7be8[_0xa0c1('0x15b')],_0x312697);if(_0x53934d){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x15e'),this[_0xa0c1('0xf')][_0xa0c1('0x38')],_0x5e7be8[_0xa0c1('0x15b')]));this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x15e'),this[_0xa0c1('0xf')][_0xa0c1('0x38')],_0x5e7be8[_0xa0c1('0x15b')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format'](_0xa0c1('0x160'),this[_0xa0c1('0xf')][_0xa0c1('0x38')],_0x5e7be8[_0xa0c1('0x15b')]));this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x15e'),this[_0xa0c1('0xf')][_0xa0c1('0x38')],_0x5e7be8['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x16e')]=function(_0x23d5f1){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x16f'),_0x23d5f1['label']));if(!this[_0xa0c1('0x82')](_0x23d5f1[_0xa0c1('0x10f')])){return this[_0xa0c1('0xf')]['error'](_0x23d5f1,'no\x20file\x20audio\x20selected');}var _0x13bc6b=this[_0xa0c1('0x1d')][_0xa0c1('0x6e')](this,_0x23d5f1[_0xa0c1('0x10f')]);if(!_0x13bc6b){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x23d5f1,'no\x20file\x20audio\x20found');}var _0x4a0c1e=this[_0xa0c1('0xf')]['exec'](_0xa0c1('0x170'),[_0x13bc6b,_0x23d5f1['opts']]);if(_0x4a0c1e[_0xa0c1('0xa2')]===-0x1){return _0x4a0c1e;}return this['channel'][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xc0'),_0xa0c1('0x170'),_0x13bc6b));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x171')]=function(_0x59293f){logger['info'](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x59293f['label']));if(!this[_0xa0c1('0x82')](_0x59293f[_0xa0c1('0x172')])){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x59293f,'no\x20queue\x20selected');}var _0x496f23='';var _0xa2a07=parseInt(_0x59293f[_0xa0c1('0x172')],0xa);if(isNaN(_0xa2a07)){_0x496f23=_0x59293f[_0xa0c1('0x172')];}else{_0x496f23=this[_0xa0c1('0x15')][_0xa0c1('0x6e')](this,_0x59293f['queue_id']);if(!_0x496f23){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x59293f,_0xa0c1('0x173'));}}var _0x256eb5='';if(this['isConfigured'](_0x59293f[_0xa0c1('0x10f')])){var _0x28daa1=this['getSound']['sync'](this,_0x59293f[_0xa0c1('0x10f')]);if(_0x28daa1){_0x256eb5=_0x28daa1;}}this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x59293f,_0x496f23);if(_0x59293f[_0xa0c1('0xdd')]['indexOf']('x')<0x0){_0x59293f[_0xa0c1('0xdd')]+='x';}if(_0x59293f[_0xa0c1('0xdd')][_0xa0c1('0x174')]('X')<0x0){_0x59293f[_0xa0c1('0xdd')]+='X';}this[_0xa0c1('0xf')][_0xa0c1('0x9c')]('XMCS-QUEUE',_0x496f23?_0x496f23[_0xa0c1('0x175')]():'');var _0x273251=this[_0xa0c1('0xf')][_0xa0c1('0x56')](_0xa0c1('0x176'),[_0x496f23,_0x59293f[_0xa0c1('0xdd')],_0x59293f['url'],_0x256eb5,_0x59293f['timeout'],_0x59293f[_0xa0c1('0x6')],_0x59293f[_0xa0c1('0x177')],_0x59293f[_0xa0c1('0x178')],'',_0x59293f[_0xa0c1('0x179')]]);if(_0x273251[_0xa0c1('0xa2')]===-0x1){return _0x273251;}return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xc0'),_0xa0c1('0x176'),_0x496f23));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x17a')]=function(_0x63eec5){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x17b'),_0x63eec5[_0xa0c1('0x36')]));var _0x464389=_0x63eec5['recordingFormat']||_0xa0c1('0x137');var _0x36aefe=util['format']('%s_%s',this['channel'][_0xa0c1('0x3a')],rs[_0xa0c1('0x118')](0x5));var _0x2ef2d2=util['format'](_0xa0c1('0x17c'),FILES_PATH,_0x36aefe,_0x464389);var _0x2b4406=util[_0xa0c1('0x29')]('%s/recordings/%s',FILES_PATH,_0x36aefe);this['createSquareRecording'][_0xa0c1('0x6e')](this,_0x63eec5,_0x36aefe,_0x2ef2d2);this[_0xa0c1('0xf')][_0xa0c1('0x9c')]('RECORDING_SAVENAME',_0x36aefe);logger[_0xa0c1('0x2f')](_0xa0c1('0x17d'),_0x2b4406,_0x464389,_0x63eec5[_0xa0c1('0x17e')],_0x63eec5[_0xa0c1('0x63')]);return this[_0xa0c1('0xf')][_0xa0c1('0x139')](_0x2b4406,_0x464389,_0x63eec5[_0xa0c1('0x17e')],_0x63eec5[_0xa0c1('0x63')],undefined,!![]);};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x17f')]=function(_0xf0f142){logger[_0xa0c1('0x2f')](util['format'](_0xa0c1('0x180'),_0xf0f142[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0xf0f142[_0xa0c1('0x70')])){return this['channel'][_0xa0c1('0xa9')](_0xa0c1('0x181'));}var _0x5c973e=this[_0xa0c1('0x182')][_0xa0c1('0x6e')](this,_0xf0f142);logger['info'](util[_0xa0c1('0x29')](_0xa0c1('0x183'),util[_0xa0c1('0x184')](_0x5c973e,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0xf0f142[_0xa0c1('0xd3')])){return this[_0xa0c1('0xf')]['noop'](_0xa0c1('0x185'));}var _0x534e58=this[_0xa0c1('0x9f')][_0xa0c1('0x6e')](this,_0xf0f142[_0xa0c1('0xd3')]);if(!_0x534e58){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0xf0f142,'no\x20variable\x20found');}this[_0xa0c1('0xf')][_0xa0c1('0x9c')](util[_0xa0c1('0x29')](_0xa0c1('0x186'),_0x534e58),_0x5c973e[_0xa0c1('0x74')]?_0x5c973e[_0xa0c1('0x74')]:_0xa0c1('0x187'));this['channel'][_0xa0c1('0x9c')](util[_0xa0c1('0x29')]('%s_STATUS_MESSAGE',_0x534e58),_0x5c973e[_0xa0c1('0x75')]?_0x5c973e[_0xa0c1('0x75')]:'OK');if(_0x5c973e[_0xa0c1('0x68')]){try{this['saveRestApiResult'](_0x5c973e[_0xa0c1('0x68')],_0x534e58);}catch(_0x1abd8b){logger[_0xa0c1('0x2d')](util[_0xa0c1('0x29')](_0xa0c1('0x188'),_0x534e58));}}return this['channel'][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xd7'),_0x534e58));};AGIVertices[_0xa0c1('0x11')]['saydigits']=function(_0x2b1d89){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x189'),_0x2b1d89[_0xa0c1('0x36')]));return this[_0xa0c1('0xf')]['sayDigits'](_0x2b1d89[_0xa0c1('0x18a')][_0xa0c1('0x58')](/\s+/g,''),_0x2b1d89[_0xa0c1('0x17e')]);};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x18b')]=function(_0x375718){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x18c'),_0x375718[_0xa0c1('0x36')]));return this[_0xa0c1('0xf')]['sayNumber'](_0x375718[_0xa0c1('0x64')][_0xa0c1('0x58')](/\s+/g,''),_0x375718[_0xa0c1('0x17e')]);};AGIVertices['prototype'][_0xa0c1('0x18d')]=function(_0x573389){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x18e'),_0x573389['label']));return this['channel'][_0xa0c1('0x18f')](_0x573389[_0xa0c1('0x5b')],_0x573389[_0xa0c1('0x17e')]);};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x190')]=function(_0x5dd5bd){logger['info'](util[_0xa0c1('0x29')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x5dd5bd[_0xa0c1('0x36')]));if(!this['isConfigured'](_0x5dd5bd[_0xa0c1('0x191')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0x192'));}var _0x3a14b7=this['getMailAccount'][_0xa0c1('0x6e')](this,_0x5dd5bd[_0xa0c1('0x191')]);if(!_0x3a14b7||!_0x3a14b7[_0xa0c1('0x193')]){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x5dd5bd,_0xa0c1('0x194'));}var _0xb68883={'from':util[_0xa0c1('0x29')](_0xa0c1('0x195'),_0x3a14b7[_0xa0c1('0x16')],_0x3a14b7[_0xa0c1('0x196')]||_0x3a14b7[_0xa0c1('0x193')]['user']),'to':_0x5dd5bd['to']||'','cc':_0x5dd5bd['cc']||'','bcc':_0x5dd5bd[_0xa0c1('0x197')]||'','subject':_0x5dd5bd[_0xa0c1('0x198')],'html':_0x5dd5bd['text'],'text':_0x5dd5bd[_0xa0c1('0x5b')]};if(this[_0xa0c1('0x82')](_0x5dd5bd['template_id'])){}logger[_0xa0c1('0xd9')]('sendMail\x20message',JSON[_0xa0c1('0x72')](_0xb68883));this['createSquareDetailsReport'][_0xa0c1('0x6e')](this,_0x5dd5bd,_0x5dd5bd[_0xa0c1('0x191')]);this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x199'),_0x3a14b7[_0xa0c1('0x16')]));this[_0xa0c1('0x19a')][_0xa0c1('0x6e')](this,_0x3a14b7[_0xa0c1('0x19b')],_0xb68883);return this['channel']['noop'](_0xa0c1('0x19c'));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x19d')]=function(_0x35434e){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x19e'),_0x35434e[_0xa0c1('0x36')]));return this[_0xa0c1('0xf')][_0xa0c1('0xa9')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x19f')]=function(_0x20ffba){logger[_0xa0c1('0x2f')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x20ffba[_0xa0c1('0x36')]));if(!this['isConfigured'](_0x20ffba[_0xa0c1('0x1a0')])){return this[_0xa0c1('0xf')]['noop'](_0xa0c1('0x1a1'));}var _0x568482=this[_0xa0c1('0x33')]['sync'](this,_0x20ffba['sms_account_id']);if(!_0x568482){return this[_0xa0c1('0xf')]['error'](_0x20ffba,'no\x20sms\x20account\x20found');}var _0x7955a4={'body':_0x20ffba[_0xa0c1('0x1a2')],'phone':_0x20ffba['to']||'','SmsAccountId':_0x568482['id']};logger['debug'](_0xa0c1('0x1a3'),JSON['stringify'](_0x7955a4));this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x20ffba,_0x20ffba[_0xa0c1('0x1a0')]);this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0x1a4'),_0x568482['name']));this[_0xa0c1('0x34')][_0xa0c1('0x6e')](this,_0x7955a4);return this[_0xa0c1('0xf')][_0xa0c1('0xa9')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x1a5')]=function(_0x3c575a){logger[_0xa0c1('0x2f')](util['format'](_0xa0c1('0x1a6'),_0x3c575a[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x3c575a[_0xa0c1('0xd3')])){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x3c575a,'no\x20variable\x20selected');}var _0x206ea3=this[_0xa0c1('0x9f')][_0xa0c1('0x6e')](this,_0x3c575a[_0xa0c1('0xd3')]);if(!_0x206ea3){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x3c575a,_0xa0c1('0x116'));}return this['channel'][_0xa0c1('0x9c')](_0x206ea3,_0x3c575a[_0xa0c1('0x1a7')]);};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x1a8')]=function(_0x4233c2){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x1a9'),_0x4233c2['label']));this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0x1aa'));if(_0x4233c2['answer']===_0xa0c1('0x1ab')){this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0x1ac'));return this[_0xa0c1('0xf')][_0xa0c1('0xb6')]();}return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0x1ad'));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x1ae')]=function(_0x563bbe){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x1af'),_0x563bbe['label']));if(!this['isConfigured'](_0x563bbe[_0xa0c1('0x1b0')])){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x563bbe,_0xa0c1('0x1b1'));}var _0x1e67f2=this['getSquareProject'][_0xa0c1('0x6e')](this,_0x563bbe[_0xa0c1('0x1b0')]);if(!this[_0xa0c1('0x82')](_0x1e67f2)){return this[_0xa0c1('0xf')]['error'](_0x563bbe,util[_0xa0c1('0x29')](_0xa0c1('0x1b2'),_0x563bbe[_0xa0c1('0x1b0')]));}if(_0x1e67f2===this[_0xa0c1('0xf')][_0xa0c1('0x1b3')]){return this['channel'][_0xa0c1('0x2d')](_0x563bbe,_0xa0c1('0x1b4'));}this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x563bbe,_0x1e67f2);var _0x25ae77=this['channel'][_0xa0c1('0x56')](_0xa0c1('0x1b5'),util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi']['host']||_0xa0c1('0x1b6'),_0x1e67f2,this[_0xa0c1('0xf')][_0xa0c1('0x1b3')]));if(_0x25ae77[_0xa0c1('0xa2')]===-0x1){return _0x25ae77;}return this['channel']['noop'](util[_0xa0c1('0x29')](_0xa0c1('0xc0'),_0xa0c1('0x1b5'),_0x1e67f2));};AGIVertices['prototype'][_0xa0c1('0x1b7')]=function(_0x3541fa){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x1b8'),_0x3541fa[_0xa0c1('0x36')]));var _0x5b0d39=this[_0xa0c1('0x1b9')]['sync'](this,_0x3541fa[_0xa0c1('0x1ba')]);this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x3541fa,_0x3541fa[_0xa0c1('0x1ba')]);if(this[_0xa0c1('0x82')](_0x3541fa[_0xa0c1('0xd3')])){var _0x530a6a=this[_0xa0c1('0x9f')][_0xa0c1('0x6e')](this,_0x3541fa[_0xa0c1('0xd3')]);if(_0x530a6a){this[_0xa0c1('0xf')][_0xa0c1('0x9c')](_0x530a6a,_0x5b0d39);return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x1bb'),_0x3541fa[_0xa0c1('0x1ba')],_0x530a6a));}}return this['channel'][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x1bc'),_0x3541fa[_0xa0c1('0x1ba')]));};AGIVertices[_0xa0c1('0x11')]['google_cloud_tts']=function(_0x19e7c5){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x1bd'),_0x19e7c5[_0xa0c1('0x36')]));_0x19e7c5[_0xa0c1('0x5b')]=_0x19e7c5['text'][_0xa0c1('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x19e7c5['apiKey'])){return this['channel'][_0xa0c1('0xa9')](_0xa0c1('0x1be'));}if(!this[_0xa0c1('0x82')](_0x19e7c5[_0xa0c1('0x5b')])){return this['channel'][_0xa0c1('0xa9')](_0xa0c1('0xc1'));}this['channel'][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x1bf'),_0x19e7c5['text']));var _0x35cbe4=this[_0xa0c1('0x59')]['sync'](this,_0x19e7c5);if(_0x35cbe4){this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x35cbe4));var _0x39292a=this[_0xa0c1('0xf')][_0xa0c1('0x157')](_0x35cbe4);try{fs[_0xa0c1('0xff')](_0x35cbe4+'.wav');}catch(_0x3c281e){logger[_0xa0c1('0x2d')](_0x3c281e);}return _0x39292a;}return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x19e7c5,_0xa0c1('0x1c0'));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x1c1')]=function(_0x2f9acc){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x2f9acc[_0xa0c1('0x36')]));_0x2f9acc[_0xa0c1('0x5b')]=_0x2f9acc['text'][_0xa0c1('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa0c1('0x82')](_0x2f9acc[_0xa0c1('0x5b')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xc1'));}this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')]('Trying\x20Google\x20TTS\x20%s',_0x2f9acc['text']));var _0x3ec245=this[_0xa0c1('0x60')]['sync'](this,_0x2f9acc);if(_0x3ec245){this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')]('Google\x20TTS\x20%s\x20file\x20created',_0x3ec245));var _0x2f3552=this[_0xa0c1('0xf')][_0xa0c1('0x157')](_0x3ec245);try{fs[_0xa0c1('0xff')](_0x3ec245+_0xa0c1('0x124'));}catch(_0x2121f6){logger[_0xa0c1('0x2d')](_0x2121f6);}return _0x2f3552;}return this['channel']['error'](_0x2f9acc,_0xa0c1('0x1c2'));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x1c3')]=function(_0x1adad7){logger[_0xa0c1('0x2f')](util['format'](_0xa0c1('0x1c4'),_0x1adad7['label']));if(!this[_0xa0c1('0x82')](_0x1adad7[_0xa0c1('0x15b')])){return this['channel'][_0xa0c1('0x2d')](_0x1adad7,_0xa0c1('0x15c'));}logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x15d'),this[_0xa0c1('0xf')][_0xa0c1('0x38')],_0x1adad7['findBy']));var _0x4522a4=this[_0xa0c1('0x50')][_0xa0c1('0x6e')](this,_0x1adad7[_0xa0c1('0x15b')]);if(_0x4522a4){logger['info'](util['format'](_0xa0c1('0x15e'),this[_0xa0c1('0xf')][_0xa0c1('0x38')],_0x1adad7[_0xa0c1('0x15b')]));this['channel']['noop'](util[_0xa0c1('0x29')](_0xa0c1('0x15e'),this['channel'][_0xa0c1('0x38')],_0x1adad7['findBy']));return{'code':0xc8,'result':_0xa0c1('0x15f')};}else{logger[_0xa0c1('0x2f')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xa0c1('0xf')]['callerid'],_0x1adad7[_0xa0c1('0x15b')]));this['channel'][_0xa0c1('0xa9')](util[_0xa0c1('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xa0c1('0xf')][_0xa0c1('0x38')],_0x1adad7['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['voicemail']=function(_0x1fe84a){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x1fe84a[_0xa0c1('0x36')]));var _0x576888=this[_0xa0c1('0xf')][_0xa0c1('0x56')](_0xa0c1('0x1c5'),[_0x1fe84a[_0xa0c1('0x1c6')],_0x1fe84a[_0xa0c1('0x77')]]);if(_0x576888[_0xa0c1('0xa2')]===-0x1){return _0x576888;}return this['channel'][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xc0'),_0xa0c1('0x1c5'),_0x1fe84a[_0xa0c1('0x1c6')]));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x1c7')]=function(_0x190bd1){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x1c8'),_0x190bd1[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x190bd1[_0xa0c1('0xd3')])){return this['channel']['error'](_0x190bd1,_0xa0c1('0x1c9'));}var _0x56f5e1=this['getVariable'][_0xa0c1('0x6e')](this,_0x190bd1[_0xa0c1('0xd3')]);if(!_0x56f5e1){return this[_0xa0c1('0xf')]['error'](_0x190bd1,_0xa0c1('0x116'));}var _0x43ddaa=this[_0xa0c1('0xf')][_0xa0c1('0x9f')](_0x56f5e1);return{'code':0xc8,'result':_0x43ddaa[_0xa0c1('0xa0')]?_0x43ddaa[_0xa0c1('0xa0')]:'-'};};String['prototype'][_0xa0c1('0x9e')]=function(_0x2248ad,_0x45f0a8){return this[_0xa0c1('0x9d')](_0x2248ad)[_0xa0c1('0x1ca')](_0x45f0a8);};module['exports']=AGIVertices; \ No newline at end of file +var _0x86f5=['ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','parse','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','headers','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clone','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isArray','isString','saveRestApiResult','setVariable','split','length','replaceAll','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','agi','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','wait','no\x20list\x20selected','scheduledAt','add','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','DIALOGFLOW_%s','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','.wav','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','%s.%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appid\x20configured','no\x20appsecret\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','true','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','agentLogin','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','FIND\x20AGENT\x20%s\x20BY\x20%s','agentLogout','math','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','getSound','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','no\x20find\x20by\x20configured','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','toLowerCase','macro','gosub','QUEUE','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','createSquareRecording','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','email','user','bcc','subject','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Skipped\x20Answer','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','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','command','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','join','exports','util','shelljs','odbc','moment','mustache','request-promise','../../config/logger','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','name','getSquareOdbc','getSquareOdbcById','then','dsn','getUser','getUserById','getTrunk','getSoundById','save_name','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','internal','%s/%s@from-sip/n','shellCommand','exec','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US'];(function(_0x2d0b09,_0xc9039b){var _0xff78d4=function(_0x52b645){while(--_0x52b645){_0x2d0b09['push'](_0x2d0b09['shift']());}};_0xff78d4(++_0xc9039b);}(_0x86f5,0x178));var _0x586f=function(_0xd3348b,_0x288d47){_0xd3348b=_0xd3348b-0x0;var _0x583cdc=_0x86f5[_0xd3348b];return _0x583cdc;};'use strict';var fs=require('fs');var util=require(_0x586f('0x0'));var _=require('lodash');var sh=require(_0x586f('0x1'));var odbc=require(_0x586f('0x2'))();var rs=require('randomstring');var moment=require(_0x586f('0x3'));var Mustache=require(_0x586f('0x4'));var rp=require(_0x586f('0x5'));var logger=require(_0x586f('0x6'))('agi');var config=require('../../config/environment');var shared=require(_0x586f('0x7'));var scripts=require(_0x586f('0x8'));var FILES_PATH=_0x586f('0x9');var recursiveMapAttributes=['rawHeaders',_0x586f('0xa')];var verticesWithRetry=[_0x586f('0xb'),_0x586f('0xc'),'getsecretdigits'];var AGIVertices=function(_0x5d31da,_0x27664e,_0x226d5a){this[_0x586f('0xd')]=_0x5d31da;this[_0x586f('0xe')]=_0x27664e;this[_0x586f('0xf')]=_0x226d5a;};AGIVertices[_0x586f('0x10')][_0x586f('0x11')]=function(_0x497eea,_0x21058a){this['rpc'][_0x586f('0x12')](_0x497eea)['then'](function(_0x3b0cfe){_0x21058a(null,_0x3b0cfe?_0x3b0cfe['name']:![]);})[_0x586f('0x13')](function(_0x560019){_0x21058a(_0x560019);});};AGIVertices[_0x586f('0x10')][_0x586f('0x14')]=function(_0x29b844,_0x3fc15c){this[_0x586f('0xe')][_0x586f('0x15')](_0x29b844)['then'](function(_0x219738){_0x3fc15c(null,_0x219738?_0x219738['name']:![]);})['catch'](function(_0x3381c6){_0x3fc15c(_0x3381c6);});};AGIVertices[_0x586f('0x10')][_0x586f('0x16')]=function(_0x178ca4,_0x30ec4d){this[_0x586f('0xe')]['getSquareProjectById'](_0x178ca4)['then'](function(_0x44f938){_0x30ec4d(null,_0x44f938?_0x44f938[_0x586f('0x17')]:![]);})[_0x586f('0x13')](function(_0x35a14e){_0x30ec4d(_0x35a14e);});};AGIVertices[_0x586f('0x10')][_0x586f('0x18')]=function(_0x276f07,_0x1ff7f4){this[_0x586f('0xe')][_0x586f('0x19')](_0x276f07)[_0x586f('0x1a')](function(_0x38fda7){_0x1ff7f4(null,_0x38fda7?_0x38fda7[_0x586f('0x1b')]:![]);})['catch'](function(_0x3e36fb){_0x1ff7f4(_0x3e36fb);});};AGIVertices[_0x586f('0x10')][_0x586f('0x1c')]=function(_0x32b709,_0x4a7c6a){this[_0x586f('0xe')][_0x586f('0x1d')](_0x32b709)[_0x586f('0x1a')](function(_0x2457b3){_0x4a7c6a(null,_0x2457b3?_0x2457b3[_0x586f('0x17')]:![]);})['catch'](function(_0x45e18e){_0x4a7c6a(_0x45e18e);});};AGIVertices[_0x586f('0x10')][_0x586f('0x1e')]=function(_0x15a854,_0x396a6f){this[_0x586f('0xe')]['getTrunkById'](_0x15a854)[_0x586f('0x1a')](function(_0x444032){_0x396a6f(null,_0x444032?_0x444032[_0x586f('0x17')]:![]);})[_0x586f('0x13')](function(_0x5536ce){_0x396a6f(_0x5536ce);});};AGIVertices[_0x586f('0x10')]['getSound']=function(_0x1063a3,_0xf059ad){var _0x7aa40d=this;this[_0x586f('0xe')][_0x586f('0x1f')](_0x1063a3)[_0x586f('0x1a')](function(_0x2ba6f1){_0xf059ad(null,_0x2ba6f1?_0x7aa40d['getSoundPath'](_0x2ba6f1[_0x586f('0x20')]):![]);})['catch'](function(_0x3d6bb2){_0xf059ad(_0x3d6bb2);});};AGIVertices['prototype']['getMailAccount']=function(_0x109bd0,_0x2a2f9f){this['rpc']['getMailAccountById'](_0x109bd0)[_0x586f('0x1a')](function(_0x13e324){_0x2a2f9f(null,_0x13e324?_0x13e324:![]);})['catch'](function(_0x15c0fa){_0x2a2f9f(_0x15c0fa);});};AGIVertices[_0x586f('0x10')][_0x586f('0x21')]=function(_0x3d7b00,_0x441c78,_0x339639){this['mailRpc'][_0x586f('0x21')](_0x3d7b00,_0x441c78)['then'](function(){_0x339639(null);})[_0x586f('0x13')](function(_0x37a7ca){_0x339639(_0x37a7ca);});};AGIVertices[_0x586f('0x10')][_0x586f('0x22')]=function(_0x304a5f,_0x3109a3){this[_0x586f('0xe')][_0x586f('0x23')](_0x304a5f)['then'](function(_0x32a272){if(_0x32a272){if(_0x32a272[_0x586f('0x24')]){_0x3109a3(null,[_0x32a272[_0x586f('0x25')]]);}else{_0x3109a3(null,_[_0x586f('0x26')](_0x32a272[_0x586f('0x27')],'interval'));}}else{_0x3109a3(null,![]);}})[_0x586f('0x13')](function(_0x5aa747){_0x3109a3(_0x5aa747);});};AGIVertices[_0x586f('0x10')]['getSoundPath']=function(_0x44ce55){return util[_0x586f('0x28')](_0x586f('0x29'),FILES_PATH,_0x44ce55);};AGIVertices[_0x586f('0x10')][_0x586f('0x2a')]=function(_0x3b7ffc,_0x3169c1,_0x42b622){odbc[_0x586f('0x2b')](_0x3b7ffc,function(_0x3405c5){if(_0x3405c5){logger['error'](_0x586f('0x2c'),_0x3405c5);_0x42b622(_0x3405c5);}else{logger[_0x586f('0x2d')]('ODBC\x20connection\x20successfully');odbc['query'](_0x3169c1,function(_0x46f31b,_0x4ab7fe){if(_0x46f31b){logger['info'](_0x586f('0x2e'),_0x3169c1);_0x42b622(_0x46f31b);}else{logger['info'](_0x586f('0x2f'),_0x3169c1);odbc[_0x586f('0x30')](function(_0x46bd3d){if(_0x46bd3d){logger[_0x586f('0x31')](_0x586f('0x32'),_0x46bd3d);}_0x42b622(null,_0x4ab7fe);});}});}});};AGIVertices[_0x586f('0x10')]['getSmsAccount']=function(_0x242ff8,_0x1ed450){this['rpc'][_0x586f('0x33')](_0x242ff8)['then'](function(_0x3c1ed8){_0x1ed450(null,_0x3c1ed8?_0x3c1ed8:![]);})[_0x586f('0x13')](function(_0x403267){_0x1ed450(_0x403267);});};AGIVertices[_0x586f('0x10')][_0x586f('0x34')]=function(_0x31871e,_0x37b43d){this[_0x586f('0xe')][_0x586f('0x34')](_0x31871e)[_0x586f('0x1a')](function(_0x5bf8fc){_0x37b43d(null,_0x5bf8fc);})['catch'](function(_0x2e9b2d){_0x37b43d(_0x2e9b2d);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x5729cb,_0x2c7bf6,_0x29866f){this[_0x586f('0xe')][_0x586f('0x35')]({'uniqueid':this[_0x586f('0xd')][_0x586f('0x36')],'node':_0x5729cb['label'],'application':_0x5729cb[_0x586f('0x37')],'data':_0x2c7bf6||null,'project_name':this[_0x586f('0xd')][_0x586f('0x38')],'callerid':this[_0x586f('0xd')]['callerid']})[_0x586f('0x1a')](function(_0x1867dd){if(_0x29866f){_0x29866f(null,_0x1867dd);}})['catch'](function(_0x37ec2c){if(_0x29866f){_0x29866f(_0x37ec2c);}});};AGIVertices[_0x586f('0x10')]['createSquareRecording']=function(_0x3ad982,_0x190202,_0x476aee,_0x1b77d2){this[_0x586f('0xe')]['createSquareRecording']({'uniqueid':this[_0x586f('0xd')]['uniqueid'],'callerid':this[_0x586f('0xd')][_0x586f('0x39')],'calleridname':this[_0x586f('0xd')]['calleridname'],'context':this[_0x586f('0xd')][_0x586f('0x3a')],'extension':this[_0x586f('0xd')][_0x586f('0x3b')],'priority':this['channel'][_0x586f('0x3c')],'accountcode':this['channel'][_0x586f('0x3d')],'dnid':this[_0x586f('0xd')][_0x586f('0x3e')],'projectName':this[_0x586f('0xd')]['arg_1'],'saveName':_0x190202,'filename':_0x3ad982[_0x586f('0x3f')]||_0x190202,'savePath':_0x476aee})[_0x586f('0x1a')](function(_0x266fdb){_0x1b77d2(null,_0x266fdb);})[_0x586f('0x13')](function(_0x44dc51){_0x1b77d2(_0x44dc51);});};AGIVertices[_0x586f('0x10')]['createSquareMessage']=function(_0x69f5b5,_0x5b6a8b,_0x23ca93,_0xfac0f6,_0x37b682){this[_0x586f('0xe')][_0x586f('0x40')]({'uniqueid':this[_0x586f('0xd')][_0x586f('0x36')],'body':_0x69f5b5,'direction':_0x5b6a8b,'providerName':_0x23ca93,'providerResponse':_0xfac0f6})[_0x586f('0x1a')](function(_0x3202d9){if(_0x37b682){_0x37b682(null,_0x3202d9);}})[_0x586f('0x13')](function(_0x23f20a){if(_0x37b682){_0x37b682(_0x23f20a);}});};AGIVertices[_0x586f('0x10')]['createCmContact']=function(_0x2e5b00,_0x51d5df){this['rpc'][_0x586f('0x41')]({'firstName':_[_0x586f('0x42')](_0x2e5b00['name'])||_[_0x586f('0x43')](_0x2e5b00[_0x586f('0x17')])?_0x586f('0x44')+Math[_0x586f('0x45')]():_0x2e5b00[_0x586f('0x17')],'lastName':_[_0x586f('0x42')](_0x2e5b00[_0x586f('0x46')])||_['isNil'](_0x2e5b00['lastName'])?null:_0x2e5b00['lastName'],'phone':_0x2e5b00[_0x586f('0x47')],'ListId':_0x2e5b00[_0x586f('0x48')],'scheduledat':_0x2e5b00['scheduledAt'],'callbackUniqueid':this[_0x586f('0xd')][_0x586f('0x36')],'tags':'callback','description':'Callback\x20scheduled\x20at\x20'+_0x2e5b00['scheduledAt'][_0x586f('0x49')](),'priority':_0x2e5b00[_0x586f('0x4a')]})[_0x586f('0x1a')](function(_0x149137){_0x51d5df(null,_0x149137);})[_0x586f('0x13')](function(_0x418f87){_0x51d5df(_0x418f87);});};AGIVertices[_0x586f('0x10')][_0x586f('0x4b')]=function(_0x838a0e,_0x332614){this[_0x586f('0xe')][_0x586f('0x4c')](_0x838a0e)[_0x586f('0x1a')](function(_0x538f12){_0x332614(null,_0x538f12?_0x538f12[_0x586f('0x17')]:![]);})[_0x586f('0x13')](function(_0x2f8a8b){_0x332614(_0x2f8a8b);});};AGIVertices[_0x586f('0x10')][_0x586f('0x4d')]=function(_0x541ad6,_0x180002,_0x35c404){var _0x1995ef={'role':_0x586f('0x4e')};_0x1995ef[_0x541ad6]=this['channel']['callerid'];this[_0x586f('0xe')][_0x586f('0x4d')](_0x1995ef,_0x180002,this[_0x586f('0xd')][_0x586f('0x36')])[_0x586f('0x1a')](function(_0x13660c){_0x35c404(null,_[_0x586f('0x43')](_0x13660c)?![]:!![]);})[_0x586f('0x13')](function(_0x5ecc31){logger[_0x586f('0x31')](_0x5ecc31);_0x35c404(null,![]);});};AGIVertices['prototype'][_0x586f('0x4f')]=function(_0x16d79c,_0x596e0c){var _0xf954b={'role':'agent'};_0xf954b[_0x16d79c]=this[_0x586f('0xd')][_0x586f('0x39')];this[_0x586f('0xe')][_0x586f('0x4f')](_0xf954b)['then'](function(_0x1735c0){_0x596e0c(null,_[_0x586f('0x43')](_0x1735c0)?![]:!![]);})[_0x586f('0x13')](function(_0x13843b){logger[_0x586f('0x31')](_0x13843b);_0x596e0c(null,![]);});};AGIVertices[_0x586f('0x10')]['agentLogout']=function(_0x3f74eb,_0x9643f0){var _0x17e793={'role':_0x586f('0x4e')};_0x17e793[_0x3f74eb]=this['channel'][_0x586f('0x39')];this[_0x586f('0xe')]['agentLogout'](_0x17e793)[_0x586f('0x1a')](function(_0x50dc83){_0x9643f0(null,_[_0x586f('0x43')](_0x50dc83)?![]:!![]);})[_0x586f('0x13')](function(_0x5265ea){logger['error'](_0x5265ea);_0x9643f0(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x1ae8b6,_0x411105){var _0xace017={'role':'agent'};_0xace017[_0x1ae8b6]=this[_0x586f('0xd')][_0x586f('0x39')];var _0x3d6df9=_0x1ae8b6!=_0x586f('0x50')?util[_0x586f('0x28')](_0x586f('0x51'),'LOCAL',this[_0x586f('0xd')]['callerid']):undefined;this[_0x586f('0xe')]['agentLogin'](_0xace017,_0x3d6df9)[_0x586f('0x1a')](function(_0xd05078){_0x411105(null,_[_0x586f('0x43')](_0xd05078)?![]:!![]);})[_0x586f('0x13')](function(_0x388287){logger[_0x586f('0x31')](_0x388287);_0x411105(null,![]);});};AGIVertices[_0x586f('0x10')][_0x586f('0x52')]=function(_0x48093f,_0x1e8d18){sh[_0x586f('0x53')](_[_0x586f('0x54')](_0x48093f),function(_0x4c184c,_0x15703b){var _0x1483f6=_0x15703b['replace'](/(\r\n|\n|\r)/gm,'');_0x1e8d18(null,_0x1483f6);});};AGIVertices[_0x586f('0x10')]['googleCloudTTS']=function(_0x3d240,_0x4769da){scripts[_0x586f('0x55')](_0x3d240[_0x586f('0x56')],_0x3d240[_0x586f('0x57')]||_0x586f('0x58'),_0x3d240[_0x586f('0x58')],_0x3d240[_0x586f('0x59')]||_0x586f('0x5a'),_0x3d240[_0x586f('0x5b')]||_0x586f('0x5c'),_0x3d240[_0x586f('0x5d')]||'MP3')[_0x586f('0x1a')](function(_0x299d4e){_0x4769da(null,_0x299d4e);})[_0x586f('0x13')](function(_0x38afc3){_0x4769da(_0x38afc3);});};AGIVertices[_0x586f('0x10')]['googleTTS']=function(_0x29399f,_0x5a8d1b){scripts[_0x586f('0x5e')](_0x29399f[_0x586f('0x58')],_0x29399f[_0x586f('0x5f')]||'en',0x1)[_0x586f('0x1a')](function(_0x3bf38c){_0x5a8d1b(null,_0x3bf38c);})[_0x586f('0x13')](function(_0x5030c0){_0x5a8d1b(_0x5030c0);});};AGIVertices['prototype'][_0x586f('0x60')]=function(_0x193f98,_0x3e5ed5){var _0x1b73e0={'uri':_0x193f98[_0x586f('0x61')],'method':_0x193f98[_0x586f('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x193f98[_0x586f('0x63')])===_0x586f('0x64')&&parseInt(_0x193f98[_0x586f('0x63')])>=0x1?parseInt(_0x193f98[_0x586f('0x63')])*0x3e8:0x5*0x3e8};if(_[_0x586f('0x65')]([_0x586f('0x66'),_0x586f('0x67')],_0x1b73e0[_0x586f('0x62')][_0x586f('0x68')]())){try{_0x1b73e0['body']=_0x193f98[_0x586f('0xa')]?JSON[_0x586f('0x69')](_0x193f98['rawBody']):{};}catch(_0x44da4a){logger[_0x586f('0x31')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x44da4a);}}try{_0x1b73e0['headers']=_0x193f98[_0x586f('0x6a')]?JSON[_0x586f('0x69')](_0x193f98[_0x586f('0x6a')]):{};}catch(_0x23c942){logger['error'](_0x586f('0x6b'),_0x23c942);}if(_0x193f98['computedVariables']){try{var _0x1a1c20=require(_0x193f98[_0x586f('0x6c')])[_0x586f('0x6d')](this,_0x1b73e0);_0x1b73e0['uri']=Mustache['render'](_0x193f98[_0x586f('0x61')],_0x1a1c20,{},['$$','$$']);if(_0x1b73e0[_0x586f('0x6e')]){_0x1b73e0[_0x586f('0x6e')]=JSON[_0x586f('0x69')](Mustache[_0x586f('0x6f')](JSON[_0x586f('0x70')](_0x1b73e0['headers']),_0x1a1c20,{},['$$','$$']));}if(_0x1b73e0[_0x586f('0x71')]){_0x1b73e0[_0x586f('0x71')]=JSON[_0x586f('0x69')](Mustache['render'](JSON['stringify'](_0x1b73e0[_0x586f('0x71')]),_0x1a1c20,{},['$$','$$']));}}catch(_0x1fc5b6){logger['error'](_0x586f('0x72'),_0x1fc5b6);}}rp(_0x1b73e0)['then'](function(_0x57e745){var _0x4e2637={'statusCode':_0x57e745['statusCode']||0xc8,'statusMessage':_0x57e745[_0x586f('0x73')]||'OK','headers':_0x57e745[_0x586f('0x6e')]||{},'body':_0x57e745[_0x586f('0x71')]||{}};_0x3e5ed5(null,_0x4e2637);})[_0x586f('0x13')](function(_0x253d69){var _0x5302d5={'statusCode':_0x253d69[_0x586f('0x74')]||0x1f4,'statusMessage':_0x253d69[_0x586f('0x75')]||_0x586f('0x76'),'headers':_0x253d69['options'][_0x586f('0x6e')]||{},'body':_0x253d69[_0x586f('0x77')][_0x586f('0x71')]||{}};_0x3e5ed5(null,_0x5302d5);});};AGIVertices[_0x586f('0x10')]['googleDialogflow']=function(_0x27600f,_0x49077b){scripts[_0x586f('0x78')](this[_0x586f('0xd')][_0x586f('0x36')],_0x27600f[_0x586f('0x79')],_0x27600f[_0x586f('0x58')],_0x27600f[_0x586f('0x7a')]||'en')[_0x586f('0x1a')](function(_0x176535){_0x49077b(null,_0x176535);})[_0x586f('0x13')](function(_0x221558){_0x49077b(_0x221558);});};AGIVertices[_0x586f('0x10')][_0x586f('0x7b')]=function(_0x28c215,_0x4a19e7){scripts[_0x586f('0x7b')](this[_0x586f('0xd')]['uniqueid'],_0x28c215[_0x586f('0x7c')],_0x28c215[_0x586f('0x7d')],_0x28c215['private_key'],_0x28c215[_0x586f('0x58')],_0x28c215[_0x586f('0x7e')]||'en')[_0x586f('0x1a')](function(_0x6a0a0d){_0x4a19e7(null,_0x6a0a0d);})[_0x586f('0x13')](function(_0x2dd076){_0x4a19e7(_0x2dd076);});};AGIVertices[_0x586f('0x10')][_0x586f('0x7f')]=function(_0x19dab4,_0x14c4c2){scripts[_0x586f('0x7f')](this[_0x586f('0xd')],_0x19dab4)['then'](function(_0x243b1f){_0x14c4c2(null,_0x243b1f);})[_0x586f('0x13')](function(_0x5a227a){_0x14c4c2(_0x5a227a);});};AGIVertices[_0x586f('0x10')][_0x586f('0x80')]=function(_0x535863,_0x1497eb){scripts[_0x586f('0x80')](_0x535863[_0x586f('0x79')],_0x535863['text'],_0x535863[_0x586f('0x81')]||_0x586f('0x5a'),_0x535863[_0x586f('0x82')])[_0x586f('0x1a')](function(_0xef1353){_0x1497eb(null,_0xef1353);})['catch'](function(_0x4945fa){_0x1497eb(_0x4945fa);});};AGIVertices[_0x586f('0x10')]['ispeechASR']=function(_0x4f6307,_0x4e9f1d,_0x45e45a){scripts[_0x586f('0x83')](_0x4e9f1d,_0x4f6307['key'],_0x4f6307[_0x586f('0x84')]||_0x586f('0x5a'),this[_0x586f('0x85')](_0x4f6307[_0x586f('0x86')])?_0x4f6307[_0x586f('0x86')]:undefined)[_0x586f('0x1a')](function(_0x1d9f9a){_0x45e45a(null,_0x1d9f9a);})[_0x586f('0x13')](function(_0x4e1a76){_0x45e45a(_0x4e1a76);});};AGIVertices[_0x586f('0x10')]['awsPolly']=function(_0x1df4f6,_0x31d9b8){scripts[_0x586f('0x87')](_0x1df4f6['aws_access_key_id'],_0x1df4f6[_0x586f('0x88')],_0x1df4f6[_0x586f('0x89')],_0x1df4f6[_0x586f('0x8a')]||'Amy',_0x1df4f6[_0x586f('0x58')],_0x1df4f6[_0x586f('0x8b')]||'text')[_0x586f('0x1a')](function(_0xe06283){_0x31d9b8(null,_0xe06283);})[_0x586f('0x13')](function(_0x3a0c1e){_0x31d9b8(_0x3a0c1e);});};AGIVertices['prototype'][_0x586f('0x8c')]=function(_0x23d209,_0x21641c){scripts[_0x586f('0x8c')](this['channel'][_0x586f('0x36')],_0x23d209[_0x586f('0x8d')],_0x23d209[_0x586f('0x88')],_0x23d209[_0x586f('0x8e')],_0x23d209[_0x586f('0x58')],_0x23d209[_0x586f('0x8f')])[_0x586f('0x1a')](function(_0x66bf15){_0x21641c(null,_0x66bf15);})[_0x586f('0x13')](function(_0x720e31){_0x21641c(_0x720e31);});};AGIVertices['prototype'][_0x586f('0x90')]=function(_0x31362d,_0x3fba4e,_0x55f4b0){scripts[_0x586f('0x90')](_0x3fba4e,_0x31362d[_0x586f('0x79')],_0x31362d[_0x586f('0x91')]||'en-US')[_0x586f('0x1a')](function(_0x49edac){_0x55f4b0(null,_0x49edac);})['catch'](function(_0x188e2b){_0x55f4b0(_0x188e2b);});};AGIVertices[_0x586f('0x10')][_0x586f('0x92')]=function(_0x216c61,_0x2eb509,_0x5c1cb1){scripts[_0x586f('0x92')](_0x2eb509,_0x216c61[_0x586f('0x93')],_0x216c61[_0x586f('0x94')],_0x216c61[_0x586f('0x95')])[_0x586f('0x1a')](function(_0x8870c1){_0x5c1cb1(null,_0x8870c1);})[_0x586f('0x13')](function(_0x3a6bc7){_0x5c1cb1(_0x3a6bc7);});};AGIVertices[_0x586f('0x10')]['clear']=function(_0xcd1d89){var _0x45b897=_[_0x586f('0x65')](verticesWithRetry,_0xcd1d89['agicommand'])?_0xcd1d89:_[_0x586f('0x96')](_0xcd1d89);for(var _0x17ffc1 in _0x45b897){if(_0x45b897['hasOwnProperty'](_0x17ffc1)){if(_0x45b897[_0x17ffc1]&&_['isString'](_0x45b897[_0x17ffc1])){if(_[_0x586f('0x65')](recursiveMapAttributes,_0x17ffc1)){_0x45b897[_0x17ffc1]=this[_0x586f('0x97')](_0x45b897[_0x17ffc1]);}else{_0x45b897[_0x17ffc1]=this[_0x586f('0x98')](_0x45b897[_0x17ffc1]);}}}}return _0x45b897;};AGIVertices['prototype'][_0x586f('0x99')]=function(_0x1f6a25){for(var _0x996245 in _0x1f6a25){if(_0x1f6a25[_0x586f('0x9a')](_0x996245)){if(_['isPlainObject'](_0x1f6a25[_0x996245])){this[_0x586f('0x99')](_0x1f6a25[_0x996245]);}else if(_[_0x586f('0x9b')](_0x1f6a25[_0x996245])){for(var _0x26687d=0x0;_0x26687d<_0x1f6a25[_0x996245]['length'];_0x26687d++){this[_0x586f('0x99')](_0x1f6a25[_0x996245][_0x26687d]);}}else if(_[_0x586f('0x9c')](_0x1f6a25[_0x996245])){_0x1f6a25[_0x996245]=this['replaceAllVariables'](_0x1f6a25[_0x996245]);}}}};AGIVertices[_0x586f('0x10')][_0x586f('0x9d')]=function(_0x1e182e,_0x3700e2){for(var _0x5060bc in _0x1e182e){if(_0x1e182e[_0x586f('0x9a')](_0x5060bc)){if(_['isPlainObject'](_0x1e182e[_0x5060bc])){if(!_['isEmpty'](_0x1e182e[_0x5060bc])){this[_0x586f('0x9d')](_0x1e182e[_0x5060bc],util[_0x586f('0x28')]('%s.%s',_0x3700e2,_0x5060bc));}}else if(_[_0x586f('0x9b')](_0x1e182e[_0x5060bc])){for(var _0x2aea52=0x0;_0x2aea52<_0x1e182e[_0x5060bc]['length'];_0x2aea52++){this[_0x586f('0x9d')](_0x1e182e[_0x5060bc][_0x2aea52],util[_0x586f('0x28')]('%s.%s',_0x3700e2,_0x5060bc+'['+_0x2aea52+']'));}}else{if(!_[_0x586f('0x43')](_0x1e182e[_0x5060bc])){this[_0x586f('0xd')][_0x586f('0x9e')](util[_0x586f('0x28')]('%s.%s',_0x3700e2,_0x5060bc),_0x1e182e[_0x5060bc]);}}}}};AGIVertices[_0x586f('0x10')][_0x586f('0x97')]=function(_0x21073a){try{var _0x26602e=JSON[_0x586f('0x69')](_0x21073a);this['recursiveNodeIndex'](_0x26602e);return JSON[_0x586f('0x70')](_0x26602e);}catch(_0x1ee6af){return this['replaceAllVariables'](_0x21073a);}};AGIVertices[_0x586f('0x10')][_0x586f('0x98')]=function(_0x137f69){var _0x5d8b4a=_0x137f69[_0x586f('0x9f')]('{');for(var _0x3e6c24=0x1;_0x3e6c24<_0x5d8b4a[_0x586f('0xa0')];_0x3e6c24+=0x1){var _0x50d96a=_0x5d8b4a[_0x3e6c24]['split']('}');if(_0x50d96a['length']>0x1){_0x137f69=_0x137f69[_0x586f('0xa1')]('{'+_0x50d96a[0x0]+'}',this[_0x586f('0xd')]['getVariable'](_0x50d96a[0x0])['extra']||_0x50d96a[0x0]);}}if(_0x5d8b4a[_0x586f('0xa0')]===0x1){return _0x137f69[_0x586f('0x49')]();}return this['replaceAllVariables'](_0x137f69);};AGIVertices[_0x586f('0x10')][_0x586f('0xa2')]=function(_0x33a760,_0x95a56d){var _0x3ccd0f=this['channel'][_0x586f('0x11')](_0x33a760);if(_0x3ccd0f[_0x586f('0xa3')]===-0x1){return _0x3ccd0f;}logger[_0x586f('0x2d')](util['format'](_0x586f('0xa4'),_0x95a56d,_0x3ccd0f[_0x586f('0xa5')]));return this[_0x586f('0xd')][_0x586f('0x9e')](_0x95a56d,_0x3ccd0f['extra']);};AGIVertices[_0x586f('0x10')][_0x586f('0x85')]=function(_0x671fec){return _0x671fec&&_0x671fec!=='0'&&_0x671fec!=='-1'&&_0x671fec!=='';};AGIVertices[_0x586f('0x10')][_0x586f('0xa6')]=function(_0x9931d4){this[_0x586f('0x35')][_0x586f('0x6d')](this,_0x9931d4,'-');_0x9931d4['retry']=_0x9931d4['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x586f('0x10')]['mrcpsynth']=function(_0x46b625){logger[_0x586f('0x2d')](util['format'](_0x586f('0xa7'),_0x46b625[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x46b625[_0x586f('0x58')])){return this['channel'][_0x586f('0xa9')]('no\x20text\x20configured');}var _0x5ce7fc='\x22'+_0x46b625[_0x586f('0x58')]+'\x22';if(this[_0x586f('0x85')](_0x46b625[_0x586f('0x77')])){_0x5ce7fc+=','+_0x46b625[_0x586f('0x77')];}var _0x3fd684=this['channel'][_0x586f('0x53')](_0x586f('0xaa'),_0x5ce7fc);if(_0x3fd684[_0x586f('0xa3')]===-0x1){return _0x3fd684;}return this['channel'][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0xab'),_0x5ce7fc));};AGIVertices['prototype'][_0x586f('0xac')]=function(_0x3bf90e){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0xad'),_0x3bf90e[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x3bf90e[_0x586f('0xae')])){return this[_0x586f('0xd')][_0x586f('0xa9')]('no\x20grammar\x20configured');}var _0x53eca2=_0x3bf90e[_0x586f('0xae')];if(this[_0x586f('0x85')](_0x3bf90e[_0x586f('0x77')])){_0x53eca2+=','+_0x3bf90e['options'];}var _0x5e9d62=this[_0x586f('0xd')]['exec']('MRCPRecog',_0x53eca2);if(_0x5e9d62[_0x586f('0xa3')]===-0x1){return _0x5e9d62;}var _0x9f664a=this[_0x586f('0xa2')](_0x586f('0xaf'),_0x586f('0xb0'));if(_0x9f664a[_0x586f('0xa3')]===-0x1){return _0x9f664a;}var _0x2b5137=this['getAndSetVariable'](_0x586f('0xb1'),_0x586f('0xb2'));if(_0x2b5137['result']===-0x1){return _0x2b5137;}var _0xc9d89c=this[_0x586f('0xa2')](_0x586f('0xb3'),'MRCP_RECOG_INSTANCE');if(_0xc9d89c['result']===-0x1){return _0xc9d89c;}return this[_0x586f('0xd')]['noop'](util['format'](_0x586f('0xb4'),_0x53eca2));};AGIVertices['prototype'][_0x586f('0xb5')]=function(_0x4a1f17){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0xb6'),_0x4a1f17[_0x586f('0xa8')]));return this[_0x586f('0xd')][_0x586f('0xb5')]([_0x4a1f17['command'],_0x4a1f17[_0x586f('0xb7')]]);};AGIVertices[_0x586f('0x10')][_0x586f('0xb8')]=function(_0x103daa){logger['info'](util[_0x586f('0x28')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x103daa[_0x586f('0xa8')]));if(this['isConfigured'](_0x103daa[_0x586f('0x63')])){logger[_0x586f('0x2d')](util[_0x586f('0x28')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x103daa[_0x586f('0x63')]));var _0x53e4c5=this[_0x586f('0xd')][_0x586f('0xb9')](_0x103daa[_0x586f('0x63')]);if(_0x53e4c5[_0x586f('0xa3')]===-0x1){return _0x53e4c5;}}return this[_0x586f('0xd')][_0x586f('0xb8')]();};AGIVertices[_0x586f('0x10')]['callback']=function(_0x4326dc){logger['info'](util[_0x586f('0x28')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x4326dc[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x4326dc[_0x586f('0x48')])){return this[_0x586f('0xd')][_0x586f('0x31')](_0x4326dc,_0x586f('0xba'));}_0x4326dc[_0x586f('0xbb')]=moment();if(this[_0x586f('0x85')](_0x4326dc['delay'])){_0x4326dc[_0x586f('0xbb')]=moment()[_0x586f('0xbc')](_0x4326dc[_0x586f('0xbd')],'minutes');}if(!this[_0x586f('0x85')](_0x4326dc[_0x586f('0x4a')])){_0x4326dc[_0x586f('0x4a')]=0x2;}this['createCmContact'][_0x586f('0x6d')](this,_0x4326dc);return this[_0x586f('0xd')]['noop'](util[_0x586f('0x28')](_0x586f('0xbe'),_0x4326dc[_0x586f('0x47')],_0x4326dc[_0x586f('0x48')],_0x4326dc[_0x586f('0xbb')]));};AGIVertices[_0x586f('0x10')][_0x586f('0xbf')]=function(_0x220825){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0xc0'),_0x220825[_0x586f('0xa8')]));var _0x503f40=this['channel'][_0x586f('0x53')](_0x220825[_0x586f('0xc1')],_0x220825[_0x586f('0x77')]);if(_0x503f40['result']===-0x1){return _0x503f40;}return this[_0x586f('0xd')]['noop'](util[_0x586f('0x28')](_0x586f('0xc2'),_0x220825['application'],_0x220825[_0x586f('0x77')]));};AGIVertices[_0x586f('0x10')][_0x586f('0xc3')]=function(_0x5f3709){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0xc4'),_0x5f3709[_0x586f('0xa8')]));if(!this['isConfigured'](_0x5f3709[_0x586f('0x58')])){return this[_0x586f('0xd')]['noop'](_0x586f('0xc5'));}var _0x5a3a84='\x22'+_0x5f3709[_0x586f('0x58')]+'\x22';if(this[_0x586f('0x85')](_0x5f3709[_0x586f('0x77')])){_0x5a3a84+=','+_0x5f3709['options'];}var _0x5909dc=this[_0x586f('0xd')][_0x586f('0x53')](_0x586f('0xaa'),_0x5a3a84);if(_0x5909dc[_0x586f('0xa3')]===-0x1){return _0x5909dc;}return this[_0x586f('0xd')]['noop'](util[_0x586f('0x28')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5a3a84));};AGIVertices[_0x586f('0x10')]['sestektts']=function(_0x1db7de){logger[_0x586f('0x2d')](util['format'](_0x586f('0xc6'),_0x1db7de['label']));if(!this['isConfigured'](_0x1db7de[_0x586f('0x58')])){return this['channel']['noop'](_0x586f('0xc5'));}var _0x424ac4='\x22'+_0x1db7de['text']+'\x22';if(this['isConfigured'](_0x1db7de['options'])){_0x424ac4+=','+_0x1db7de['options'];}var _0x10f187=this[_0x586f('0xd')]['exec'](_0x586f('0xaa'),_0x424ac4);if(_0x10f187[_0x586f('0xa3')]===-0x1){return _0x10f187;}return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0xab'),_0x424ac4));};AGIVertices[_0x586f('0x10')][_0x586f('0xc7')]=function(_0x38f72d){logger['info'](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x38f72d[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x38f72d[_0x586f('0xae')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xc8'));}var _0x182bd4=_0x38f72d[_0x586f('0xae')];if(this['isConfigured'](_0x38f72d[_0x586f('0x77')])){_0x182bd4+=','+_0x38f72d[_0x586f('0x77')];}var _0xf4b5e0=this[_0x586f('0xd')][_0x586f('0x53')](_0x586f('0xc9'),_0x182bd4);if(_0xf4b5e0['result']===-0x1){return _0xf4b5e0;}var _0x3733c5=this['getAndSetVariable'](_0x586f('0xaf'),_0x586f('0xca'));if(_0x3733c5['result']===-0x1){return _0x3733c5;}var _0x6915f5=this['getAndSetVariable'](_0x586f('0xb1'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x6915f5['result']===-0x1){return _0x6915f5;}var _0x4ae1d6=this['getAndSetVariable'](_0x586f('0xb3'),_0x586f('0xcb'));if(_0x4ae1d6['result']===-0x1){return _0x4ae1d6;}return this[_0x586f('0xd')]['noop'](util[_0x586f('0x28')](_0x586f('0xb4'),_0x182bd4));};AGIVertices[_0x586f('0x10')][_0x586f('0xcc')]=function(_0x171912){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0xcd'),_0x171912['label']));if(!this[_0x586f('0x85')](_0x171912['grammar'])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xc8'));}var _0x2c5196=_0x171912[_0x586f('0xae')];if(this[_0x586f('0x85')](_0x171912[_0x586f('0x77')])){_0x2c5196+=','+_0x171912[_0x586f('0x77')];}var _0x2caf64=this[_0x586f('0xd')][_0x586f('0x53')](_0x586f('0xc9'),_0x2c5196);if(_0x2caf64[_0x586f('0xa3')]===-0x1){return _0x2caf64;}var _0x564713=this[_0x586f('0xa2')](_0x586f('0xaf'),_0x586f('0xce'));if(_0x564713[_0x586f('0xa3')]===-0x1){return _0x564713;}var _0x1818f1=this[_0x586f('0xa2')](_0x586f('0xb1'),_0x586f('0xcf'));if(_0x1818f1['result']===-0x1){return _0x1818f1;}var _0x469323=this[_0x586f('0xa2')](_0x586f('0xb3'),_0x586f('0xd0'));if(_0x469323['result']===-0x1){return _0x469323;}return this[_0x586f('0xd')]['noop'](util[_0x586f('0x28')](_0x586f('0xb4'),_0x2c5196));};AGIVertices[_0x586f('0x10')]['database']=function(_0x235a73){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0xd1'),_0x235a73[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x235a73['odbc_id'])){return this['channel'][_0x586f('0x31')](_0x235a73,_0x586f('0xd2'));}var _0x49bf5a=this['getSquareOdbc'][_0x586f('0x6d')](this,_0x235a73[_0x586f('0xd3')]);if(!_0x49bf5a){return this[_0x586f('0xd')][_0x586f('0x31')](_0x235a73,_0x586f('0xd4'));}if(!this[_0x586f('0x85')](_0x235a73[_0x586f('0xd5')])){return this[_0x586f('0xd')][_0x586f('0x31')](_0x235a73,_0x586f('0xd6'));}var _0x4da907=_0x235a73['query'][_0x586f('0xd7')](/(\r\n|\n|\r)/gm,'\x20');this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0xd8'),_0x4da907));var _0x3f4073=this[_0x586f('0x2a')][_0x586f('0x6d')](this,_0x49bf5a,_0x4da907);this['createSquareDetailsReport'][_0x586f('0x6d')](this,_0x235a73,_0x4da907);if(!this[_0x586f('0x85')](_0x235a73[_0x586f('0xd9')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xda'));}var _0x51c3e0=this[_0x586f('0x11')][_0x586f('0x6d')](this,_0x235a73['variable_id']);if(!_0x51c3e0){return this['channel'][_0x586f('0x31')](_0x235a73,_0x586f('0xdb'));}var _0x3fdaae=this;_0x3f4073[_0x586f('0xdc')](function(_0x537f9b,_0x5eb7ff){Object[_0x586f('0xdd')](_0x537f9b)[_0x586f('0xdc')](function(_0x1fe270){_0x3fdaae[_0x586f('0xd')][_0x586f('0x9e')](util[_0x586f('0x28')](_0x586f('0xde'),_0x51c3e0,_0x5eb7ff,_0x1fe270),_0x537f9b[_0x1fe270]);});});this[_0x586f('0xd')][_0x586f('0x9e')](util[_0x586f('0x28')](_0x586f('0xdf'),_0x51c3e0),_0x3f4073['length']);return this[_0x586f('0xd')][_0x586f('0xa9')](util['format'](_0x586f('0xe0'),_0x51c3e0));};AGIVertices[_0x586f('0x10')][_0x586f('0xe1')]=function(_0x2467de){logger[_0x586f('0xe2')](util[_0x586f('0x28')](_0x586f('0xe3'),_0x2467de[_0x586f('0xa8')]));if(!this['isConfigured'](_0x2467de[_0x586f('0xe4')])){return this['channel'][_0x586f('0x31')](_0x2467de,_0x586f('0xe5'));}var _0x5528cd=this[_0x586f('0x1c')][_0x586f('0x6d')](this,_0x2467de[_0x586f('0xe4')]);if(!_0x5528cd){return this[_0x586f('0xd')][_0x586f('0x31')](_0x2467de,_0x586f('0xe6'));}var _0x2a9374=this[_0x586f('0xd')][_0x586f('0x53')](_0x586f('0xe7'),[util[_0x586f('0x28')](_0x586f('0xe8'),_0x5528cd),_0x2467de[_0x586f('0x63')],_0x2467de[_0x586f('0xe9')],_0x2467de[_0x586f('0x61')]]);if(_0x2a9374[_0x586f('0xa3')]===-0x1){return _0x2a9374;}return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')]('Executed\x20command\x20%s',_0x586f('0xe7')));};AGIVertices['prototype'][_0x586f('0xea')]=function(_0xe9d49f){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0xeb'),_0xe9d49f[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0xe9d49f[_0x586f('0x79')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xec'));}if(!this[_0x586f('0x85')](_0xe9d49f['text'])){return this['channel'][_0x586f('0xa9')](_0x586f('0xc5'));}this[_0x586f('0xd')][_0x586f('0xed')]=!![];this[_0x586f('0x35')](_0xe9d49f);this['createSquareMessage'](_0xe9d49f[_0x586f('0x58')],'in','','');this[_0x586f('0xd')]['noop'](util[_0x586f('0x28')]('Trying\x20Dialogflow:\x20%s',_0xe9d49f[_0x586f('0x58')]));var _0x2129e3=this[_0x586f('0x78')][_0x586f('0x6d')](this,_0xe9d49f);if(_0x2129e3){for(var _0x5732d4 in _0x2129e3){if(_0x2129e3[_0x586f('0x9a')](_0x5732d4)){this[_0x586f('0xd')][_0x586f('0x9e')](util['format'](_0x586f('0xee'),_0x5732d4['toUpperCase']()),_0x2129e3[_0x5732d4]);}}this['createSquareMessage'](_0x2129e3[_0x586f('0xef')],_0x586f('0xf0'),_0x586f('0xea'),'');return this['channel'][_0x586f('0xa9')](util[_0x586f('0x28')]('Dialogflow\x20Result\x20%s',_0x2129e3['speech']));}return this[_0x586f('0xd')]['error'](_0xe9d49f,_0x586f('0xf1'));};AGIVertices[_0x586f('0x10')][_0x586f('0xf2')]=function(_0x485467){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0xf3'),_0x485467['label']));if(!this[_0x586f('0x85')](_0x485467[_0x586f('0x7c')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xf4'));}if(!this[_0x586f('0x85')](_0x485467['client_email'])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xf5'));}if(!this[_0x586f('0x85')](_0x485467[_0x586f('0xf6')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xf7'));}if(!this[_0x586f('0x85')](_0x485467['dialogflowV2_language'])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xf8'));}if(!this[_0x586f('0x85')](_0x485467[_0x586f('0x58')])){return this[_0x586f('0xd')][_0x586f('0xa9')]('no\x20text\x20configured');}this['channel'][_0x586f('0xed')]=!![];this['createSquareDetailsReport'](_0x485467);this[_0x586f('0x40')](_0x485467[_0x586f('0x58')],'in','','');this[_0x586f('0xd')]['noop'](util[_0x586f('0x28')](_0x586f('0xf9'),_0x485467[_0x586f('0x58')]));var _0x299aa6=this[_0x586f('0x7b')][_0x586f('0x6d')](this,_0x485467);if(_0x299aa6){for(var _0x535f54 in _0x299aa6){if(_0x299aa6['hasOwnProperty'](_0x535f54)){if(_0x535f54!==_0x586f('0xfa')){this[_0x586f('0xd')][_0x586f('0x9e')](util['format'](_0x586f('0xee'),_0x535f54[_0x586f('0x68')]()),_0x299aa6[_0x535f54]);}}}this[_0x586f('0x40')](_0x299aa6[_0x586f('0xef')],_0x586f('0xf0'),_0x586f('0xf2'),_0x299aa6['providerResponse']);return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0xfb'),_0x299aa6[_0x586f('0xef')]));}return this[_0x586f('0xd')][_0x586f('0x31')](_0x485467,_0x586f('0xfc'));};AGIVertices[_0x586f('0x10')][_0x586f('0xfd')]=function(_0x24327e){logger['info'](util[_0x586f('0x28')](_0x586f('0xfe'),_0x24327e[_0x586f('0xa8')]));if(!this['isConfigured'](_0x24327e['ndauth_url'])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xff'));}if(!this['isConfigured'](_0x24327e['username'])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0x100'));}if(!this['isConfigured'](_0x24327e['password'])){return this['channel'][_0x586f('0xa9')]('no\x20password\x20configured');}if(!this['isConfigured'](_0x24327e[_0x586f('0x101')])){return this[_0x586f('0xd')]['noop'](_0x586f('0xc5'));}this['channel'][_0x586f('0xed')]=!![];this[_0x586f('0x35')](_0x24327e);this[_0x586f('0x40')](_0x24327e[_0x586f('0x58')],'in','','');this['channel']['noop'](util[_0x586f('0x28')](_0x586f('0x102'),_0x24327e[_0x586f('0x58')]));var _0x16f5cc=this[_0x586f('0x7f')]['sync'](this,_0x24327e);if(_0x16f5cc){for(var _0x10ffcf in _0x16f5cc){if(_0x16f5cc[_0x586f('0x9a')](_0x10ffcf)){this[_0x586f('0xd')][_0x586f('0x9e')](util[_0x586f('0x28')](_0x586f('0x103'),_0x10ffcf['toUpperCase']()),_0x16f5cc[_0x10ffcf]);}}this[_0x586f('0x40')](_0x16f5cc['speech'],'out','sesteknda','');if(_0x16f5cc[_0x586f('0x104')]){this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x16f5cc[_0x586f('0x104')]));var _0x2039dc=this[_0x586f('0xd')][_0x586f('0x105')](_0x16f5cc[_0x586f('0x104')]);try{fs['unlink'](_0x16f5cc[_0x586f('0x104')]+'.wav');}catch(_0x178547){logger[_0x586f('0x31')](_0x178547);}return _0x2039dc;}else{return this[_0x586f('0xd')]['noop'](util[_0x586f('0x28')]('SestekNDA\x20Result\x20%s',_0x16f5cc[_0x586f('0xef')]));}}return this[_0x586f('0xd')][_0x586f('0x31')](_0x24327e,_0x586f('0x106'));};AGIVertices[_0x586f('0x10')][_0x586f('0x107')]=function(_0x527107){logger[_0x586f('0x2d')](util['format'](_0x586f('0x108'),_0x527107[_0x586f('0xa8')]));return this[_0x586f('0xd')]['noop'](_0x586f('0x107'));};AGIVertices[_0x586f('0x10')][_0x586f('0x109')]=function(_0x12519d){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x10a'),_0x12519d[_0x586f('0xa8')]));var _0x34c653='';if(_0x12519d[_0x586f('0x10b')]){if(!this['isConfigured'](_0x12519d[_0x586f('0x10b')])){return this[_0x586f('0xd')][_0x586f('0x31')](_0x12519d,_0x586f('0x10c'));}else{var _0x1cb276=parseInt(_0x12519d[_0x586f('0x10b')],0xa);if(isNaN(_0x1cb276)){_0x34c653=_0x12519d[_0x586f('0x10b')];}else{_0x34c653=this[_0x586f('0x1e')]['sync'](this,_0x12519d['trunk_id']);if(!_0x34c653){return this[_0x586f('0xd')]['error'](_0x12519d,_0x586f('0x10d'));}}}}else if(_0x12519d[_0x586f('0x10e')]){_0x34c653=_0x12519d[_0x586f('0x10e')];}else{return this[_0x586f('0xd')][_0x586f('0x31')](_0x12519d,_0x586f('0x10c'));}var _0x2513e2=this['channel'][_0x586f('0x53')]('DIAL',[util[_0x586f('0x28')](_0x586f('0x10f'),_0x34c653,_0x12519d[_0x586f('0x47')]),_0x12519d[_0x586f('0x63')],_0x12519d['opts'],_0x12519d['url']]);if(_0x2513e2[_0x586f('0xa3')]===-0x1){return _0x2513e2;}return this[_0x586f('0xd')][_0x586f('0xa9')](util['format'](_0x586f('0x110'),'DIAL'));};AGIVertices['prototype'][_0x586f('0x111')]=function(_0x34de82){logger['info'](util[_0x586f('0x28')](_0x586f('0x112'),_0x34de82['label']));return this['channel'][_0x586f('0xa9')](_0x586f('0x111'));};AGIVertices[_0x586f('0x10')][_0x586f('0xc')]=function(_0x158c62){logger[_0x586f('0x2d')](util['format'](_0x586f('0x113'),_0x158c62[_0x586f('0xa8')]));if(_0x158c62[_0x586f('0x114')]===0x0){return this[_0x586f('0xa6')](_0x158c62);}_0x158c62[_0x586f('0x114')]-=0x1;if(!this[_0x586f('0x85')](_0x158c62['file_id'])){return this[_0x586f('0xd')][_0x586f('0x31')](_0x158c62,_0x586f('0x115'));}var _0x266170=this['getSound'][_0x586f('0x6d')](this,_0x158c62[_0x586f('0x116')]);if(!_0x266170){return this[_0x586f('0xd')]['error'](_0x158c62,_0x586f('0x117'));}if(!this[_0x586f('0x85')](_0x158c62[_0x586f('0xd9')])){return this[_0x586f('0xd')][_0x586f('0x31')](_0x586f('0xda'));}var _0x163ebf=this[_0x586f('0xd')][_0x586f('0x118')](_0x266170,_0x158c62[_0x586f('0x119')],_0x158c62[_0x586f('0x11a')]);var _0x41636e=_0x163ebf['result']?_0x163ebf[_0x586f('0xa3')][_0x586f('0x49')]():'';logger[_0x586f('0x2d')]('test',JSON[_0x586f('0x70')](_0x163ebf));if(_0x163ebf[_0x586f('0xa3')]===-0x1){this['createSquareDetailsReport'][_0x586f('0x6d')](this,_0x158c62,_0x41636e);return _0x163ebf;}else if(_0x163ebf[_0x586f('0xa5')]===_0x586f('0x63')){_0x163ebf[_0x586f('0xa3')]=_0x41636e[_0x586f('0xa0')]>=parseInt(_0x158c62['mindigit'])?'x':'i';}else{_0x163ebf[_0x586f('0xa3')]=_0x41636e['length']>=parseInt(_0x158c62[_0x586f('0x11b')])&&_0x41636e[_0x586f('0xa0')]<=parseInt(_0x158c62[_0x586f('0x11a')])?'x':'i';}var _0x3dc1d0=this[_0x586f('0x11')][_0x586f('0x6d')](this,_0x158c62[_0x586f('0xd9')]);if(!_0x3dc1d0){return this['channel']['error'](_0x158c62,'no\x20variable\x20found');}this['channel'][_0x586f('0x9e')](_0x3dc1d0,_0x41636e);if(this[_0x586f('0x85')](_0x158c62['hiddendigitsnum'])){var _0x10f1df=parseInt(_0x158c62[_0x586f('0x11c')],0xa);var _0x324311=rs[_0x586f('0x11d')]({'charset':'*','length':_0x10f1df});var _0x3d9c07=_0x41636e[_0x586f('0xa0')];if(_0x3d9c07>0x0){if(_0x3d9c07>_0x10f1df){this['createSquareDetailsReport'][_0x586f('0x6d')](this,_0x158c62,_0x158c62[_0x586f('0x11e')]===_0x586f('0x11f')?_0x324311+_0x41636e[_0x586f('0x120')](_0x10f1df):_0x41636e['substr'](0x0,_0x3d9c07-_0x10f1df)+_0x324311);}else{this[_0x586f('0x35')][_0x586f('0x6d')](this,_0x158c62,rs['generate']({'charset':'*','length':_0x3d9c07}));}}else{this['createSquareDetailsReport'][_0x586f('0x6d')](this,_0x158c62,'');}}else{this[_0x586f('0x35')]['sync'](this,_0x158c62,_0x41636e);}return _0x163ebf;};AGIVertices['prototype'][_0x586f('0x121')]=function(_0x1936e8){logger['info'](util[_0x586f('0x28')](_0x586f('0x122'),_0x1936e8[_0x586f('0xa8')]));return this[_0x586f('0xc')](_0x1936e8);};AGIVertices['prototype'][_0x586f('0x123')]=function(_0xcddf1b){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x124'),_0xcddf1b[_0x586f('0xa8')]));this['createSquareDetailsReport']['sync'](this,_0xcddf1b,_0xcddf1b[_0x586f('0x125')]);return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x126'),_0xcddf1b[_0x586f('0x125')]));};AGIVertices['prototype'][_0x586f('0x127')]=function(_0x26dd61){logger[_0x586f('0x2d')](util['format'](_0x586f('0x128'),_0x26dd61[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x26dd61['aws_access_key_id'])||!this[_0x586f('0x85')](_0x26dd61[_0x586f('0x88')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0x129'));}if(!this[_0x586f('0x85')](_0x26dd61[_0x586f('0x58')])){return this['channel'][_0x586f('0xa9')]('no\x20text\x20configured');}this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x12a'),_0x26dd61[_0x586f('0x58')]));var _0x1e1b76=this[_0x586f('0x87')][_0x586f('0x6d')](this,_0x26dd61);if(_0x1e1b76){this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x12b'),_0x1e1b76));var _0x5b3cdb=this[_0x586f('0xd')]['streamFile'](_0x1e1b76);try{fs[_0x586f('0x12c')](_0x1e1b76+_0x586f('0x12d'));}catch(_0x1df11f){logger['error'](_0x1df11f);}return _0x5b3cdb;}return this[_0x586f('0xd')][_0x586f('0x31')](_0x26dd61,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x586f('0x10')]['awslex']=function(_0xdedead){logger['info'](util[_0x586f('0x28')](_0x586f('0x12e'),_0xdedead['label']));if(!this[_0x586f('0x85')](_0xdedead[_0x586f('0x8d')])||!this[_0x586f('0x85')](_0xdedead[_0x586f('0x88')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0x129'));}if(!this[_0x586f('0x85')](_0xdedead['aws_bot_name'])){return this[_0x586f('0xd')]['noop'](_0x586f('0x12f'));}if(!this['isConfigured'](_0xdedead[_0x586f('0x58')])){return this['channel'][_0x586f('0xa9')](_0x586f('0xc5'));}this[_0x586f('0xd')][_0x586f('0xed')]=!![];this['createSquareDetailsReport'](_0xdedead);this['createSquareMessage'](_0xdedead['text'],'in','','');this[_0x586f('0xd')][_0x586f('0xa9')](util['format'](_0x586f('0x130'),_0xdedead[_0x586f('0x58')]));var _0xe53a03=this[_0x586f('0x8c')][_0x586f('0x6d')](this,_0xdedead);if(_0xe53a03){for(var _0x3a3e3b in _0xe53a03){if(_0xe53a03[_0x586f('0x9a')](_0x3a3e3b)&&_[_0x586f('0x9c')](_0xe53a03[_0x3a3e3b])){this[_0x586f('0xd')][_0x586f('0x9e')](util[_0x586f('0x28')](_0x586f('0x131'),_0x3a3e3b[_0x586f('0x68')]()),_0xe53a03[_0x3a3e3b]);}}if(_['isNil'](_0xe53a03[_0x586f('0x75')])){return this[_0x586f('0xd')]['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x586f('0x40')](_0xe53a03[_0x586f('0x75')],'out',_0x586f('0x132'),'');return this['channel']['noop'](util[_0x586f('0x28')]('Amazon\x20Lex\x20Result\x20%s',_0xe53a03[_0x586f('0x75')]));}}return this[_0x586f('0xd')][_0x586f('0x31')](_0xdedead,_0x586f('0x133'));};AGIVertices[_0x586f('0x10')][_0x586f('0x134')]=function(_0x5ac10d){logger[_0x586f('0x2d')](util[_0x586f('0x28')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x5ac10d[_0x586f('0xa8')],_0x5ac10d[_0x586f('0x63')]));if(!this['isConfigured'](_0x5ac10d[_0x586f('0x79')])){return this[_0x586f('0xd')][_0x586f('0xa9')]('no\x20key\x20configured');}var _0x134819=_0x586f('0x135');var _0x3aae3e=util[_0x586f('0x28')](_0x586f('0x136'),FILES_PATH,rs[_0x586f('0x11d')](0x4));var _0x435221=util[_0x586f('0x28')](_0x586f('0x137'),_0x3aae3e,_0x134819);var _0x236e74=!![];if(_0x5ac10d[_0x586f('0x138')]==='NOBEEP'){_0x236e74=![];}var _0x1a0d7e=this[_0x586f('0xd')][_0x586f('0x139')](_0x3aae3e,_0x134819,_0x5ac10d[_0x586f('0x13a')],_0x5ac10d[_0x586f('0x63')],undefined,_0x236e74);if(_0x1a0d7e[_0x586f('0xa3')]!==-0x1){this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x13b'),_0x435221));var _0x163f6a=this['googleASR'][_0x586f('0x6d')](this,_0x5ac10d,_0x435221);if(_0x163f6a){for(var _0x189456 in _0x163f6a){if(_0x163f6a['hasOwnProperty'](_0x189456)){this['channel']['setVariable'](util['format'](_0x586f('0x13c'),_0x189456[_0x586f('0x68')]()),_0x163f6a[_0x189456]);}}return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x13d'),JSON[_0x586f('0x70')](_0x163f6a)));}}return _0x1a0d7e;};AGIVertices['prototype'][_0x586f('0x13e')]=function(_0x3d2e4c){logger[_0x586f('0x2d')](util[_0x586f('0x28')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x3d2e4c[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x3d2e4c[_0x586f('0x93')])){return this[_0x586f('0xd')]['noop'](_0x586f('0x13f'));}if(!this['isConfigured'](_0x3d2e4c[_0x586f('0x94')])){return this['channel']['noop'](_0x586f('0x140'));}var _0x48109d='wav';var _0x1b6e32=util['format'](_0x586f('0x136'),FILES_PATH,rs[_0x586f('0x11d')](0x4));var _0x506f00=util[_0x586f('0x28')](_0x586f('0x137'),_0x1b6e32,_0x48109d);var _0x13d277=!![];if(_0x3d2e4c[_0x586f('0x138')]===_0x586f('0x141')){_0x13d277=![];}var _0x54446a=this[_0x586f('0xd')][_0x586f('0x139')](_0x1b6e32,_0x48109d,_0x3d2e4c[_0x586f('0x13a')],_0x3d2e4c[_0x586f('0x63')],undefined,_0x13d277);if(_0x54446a[_0x586f('0xa3')]!==-0x1){this[_0x586f('0xd')]['noop'](util['format'](_0x586f('0x142'),_0x506f00));var _0x1df91a=this[_0x586f('0x92')][_0x586f('0x6d')](this,_0x3d2e4c,_0x506f00);if(_0x1df91a){for(var _0x411815 in _0x1df91a){if(_0x1df91a[_0x586f('0x9a')](_0x411815)){this[_0x586f('0xd')][_0x586f('0x9e')](util[_0x586f('0x28')](_0x586f('0x143'),_0x411815[_0x586f('0x68')]()),_0x1df91a[_0x411815]);}}return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x144'),JSON[_0x586f('0x70')](_0x1df91a)));}}return _0x54446a;};AGIVertices[_0x586f('0x10')][_0x586f('0x145')]=function(_0x1a4ca5){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x146'),_0x1a4ca5[_0x586f('0xa8')]));return this[_0x586f('0xd')][_0x586f('0x147')](_0x1a4ca5['context'],_0x1a4ca5[_0x586f('0x3b')],_0x1a4ca5[_0x586f('0x3c')]);};AGIVertices[_0x586f('0x10')][_0x586f('0x148')]=function(_0x26e95e){logger[_0x586f('0x2d')](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x26e95e[_0x586f('0xa8')]));if(!this['isConfigured'](_0x26e95e[_0x586f('0x149')])){return this[_0x586f('0xd')][_0x586f('0x31')](_0x26e95e,_0x586f('0x14a'));}try{var _0x5ee17c=eval(_0x26e95e[_0x586f('0x149')])?'true':_0x586f('0x14b');this['channel'][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x14c'),_0x26e95e[_0x586f('0x149')],_0x5ee17c));return{'code':0xc8,'result':_0x5ee17c};}catch(_0x5a40d9){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x586f('0x10')][_0x586f('0x14d')]=function(_0x55265a){logger[_0x586f('0x2d')](util['format'](_0x586f('0x14e'),_0x55265a[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x55265a[_0x586f('0x14f')])){return this[_0x586f('0xd')][_0x586f('0x31')](_0x55265a,_0x586f('0x150'));}var _0x5c22f9=this[_0x586f('0x22')]['sync'](this,_0x55265a[_0x586f('0x14f')]);if(!_0x5c22f9){return this[_0x586f('0xd')][_0x586f('0x31')](_0x55265a,_0x586f('0x151'));}for(var _0x20581c=0x0;_0x20581c<_0x5c22f9[_0x586f('0xa0')];_0x20581c+=0x1){var _0x1eeb33=this[_0x586f('0xd')]['getVariable'](util['format'](_0x586f('0x152'),_0x5c22f9[_0x20581c]));if(_0x1eeb33[_0x586f('0xa3')]===-0x1){return _0x1eeb33;}logger['info'](util[_0x586f('0x28')]('IFTIME\x20%s\x20%s',_0x5c22f9[_0x20581c],_0x1eeb33[_0x586f('0xa5')]));if(_0x1eeb33[_0x586f('0xa5')]===_0x586f('0x153')){logger['info'](util['format'](_0x586f('0x154'),_0x5c22f9[_0x20581c],_0x586f('0x153')));this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x154'),_0x5c22f9[_0x20581c],_0x586f('0x153')));return{'code':0xc8,'result':_0x586f('0x153')};}else{logger[_0x586f('0x2d')](util['format']('IFTIME\x20%s\x20%s',_0x5c22f9[_0x20581c],_0x586f('0x14b')));this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x154'),_0x5c22f9[_0x20581c],_0x586f('0x14b')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x586f('0x10')][_0x586f('0x155')]=function(_0x25cb12){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x156'),_0x25cb12[_0x586f('0xa8')]));return this[_0x586f('0xd')][_0x586f('0x155')]();};AGIVertices[_0x586f('0x10')][_0x586f('0x157')]=function(_0xb4e1ec){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x158'),_0xb4e1ec['label']));if(!this[_0x586f('0x85')](_0xb4e1ec['key'])){return this['channel'][_0x586f('0xa9')](_0x586f('0xec'));}var _0x4be02c=_0x586f('0x135');var _0x2b2fb9=util[_0x586f('0x28')]('%s/recordings/%s',FILES_PATH,rs[_0x586f('0x11d')](0x4));var _0x212cda=util['format'](_0x586f('0x137'),_0x2b2fb9,_0x4be02c);var _0x455d26=!![];if(_0xb4e1ec[_0x586f('0x138')]===_0x586f('0x141')){_0x455d26=![];}var _0x1887c2=this[_0x586f('0xd')][_0x586f('0x139')](_0x2b2fb9,_0x4be02c,_0xb4e1ec[_0x586f('0x13a')],_0xb4e1ec[_0x586f('0x63')],undefined,_0x455d26);if(_0x1887c2[_0x586f('0xa3')]!==-0x1){this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x159'),_0x212cda));var _0x434a59=this[_0x586f('0x83')][_0x586f('0x6d')](this,_0xb4e1ec,_0x212cda);if(_0x434a59){for(var _0x41d441 in _0x434a59){if(_0x434a59[_0x586f('0x9a')](_0x41d441)){this[_0x586f('0xd')][_0x586f('0x9e')](util[_0x586f('0x28')](_0x586f('0x15a'),_0x41d441[_0x586f('0x68')]()),_0x434a59[_0x41d441]);}}return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')]('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x434a59)));}}return _0x1887c2;};AGIVertices[_0x586f('0x10')]['ispeechtts']=function(_0x220b99){logger[_0x586f('0x2d')](util[_0x586f('0x28')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x220b99[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x220b99[_0x586f('0x79')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xec'));}if(!this['isConfigured'](_0x220b99['text'])){return this['channel'][_0x586f('0xa9')]('no\x20text\x20configured');}this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x15b'),_0x220b99[_0x586f('0x58')]));var _0x4fbe9e=this[_0x586f('0x80')]['sync'](this,_0x220b99);if(_0x4fbe9e){this['channel']['noop'](util['format'](_0x586f('0x159'),_0x4fbe9e));var _0x95c5f2=this[_0x586f('0xd')][_0x586f('0x105')](_0x4fbe9e,_0x220b99['intKey']);try{fs[_0x586f('0x12c')](_0x4fbe9e+'.wav');}catch(_0x173362){logger[_0x586f('0x31')](_0x173362);}return _0x95c5f2;}return this[_0x586f('0xd')][_0x586f('0x31')](_0x220b99,_0x586f('0x15c'));};AGIVertices[_0x586f('0x10')][_0x586f('0x15d')]=function(_0x58c3a4){logger['info'](util[_0x586f('0x28')](_0x586f('0x15e'),_0x58c3a4[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x58c3a4[_0x586f('0x15f')])){return this[_0x586f('0xd')]['error'](_0x58c3a4,'no\x20find\x20by\x20configured');}logger[_0x586f('0x2d')](util[_0x586f('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x586f('0xd')][_0x586f('0x39')],_0x58c3a4[_0x586f('0x15f')]));var _0x4327c9=this[_0x586f('0x160')][_0x586f('0x6d')](this,_0x58c3a4['findBy']);if(_0x4327c9){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x161'),this[_0x586f('0xd')]['callerid'],_0x58c3a4['findBy']));this['channel'][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x161'),this[_0x586f('0xd')]['callerid'],_0x58c3a4[_0x586f('0x15f')]));return{'code':0xc8,'result':_0x586f('0x162')};}else{logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x163'),this['channel'][_0x586f('0x39')],_0x58c3a4[_0x586f('0x15f')]));this['channel'][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x163'),this[_0x586f('0xd')][_0x586f('0x39')],_0x58c3a4[_0x586f('0x15f')]));return{'code':0xc8,'result':_0x586f('0x164')};}};AGIVertices[_0x586f('0x10')]['logout']=function(_0x4bfd1c){logger['info'](util[_0x586f('0x28')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x4bfd1c[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x4bfd1c[_0x586f('0x15f')])){return this[_0x586f('0xd')]['error'](_0x4bfd1c,'no\x20find\x20by\x20configured');}logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x165'),this[_0x586f('0xd')][_0x586f('0x39')],_0x4bfd1c[_0x586f('0x15f')]));var _0x282166=this[_0x586f('0x166')]['sync'](this,_0x4bfd1c[_0x586f('0x15f')]);if(_0x282166){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x161'),this[_0x586f('0xd')][_0x586f('0x39')],_0x4bfd1c[_0x586f('0x15f')]));this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x161'),this[_0x586f('0xd')][_0x586f('0x39')],_0x4bfd1c[_0x586f('0x15f')]));return{'code':0xc8,'result':'success'};}else{logger[_0x586f('0x2d')](util['format'](_0x586f('0x163'),this[_0x586f('0xd')][_0x586f('0x39')],_0x4bfd1c[_0x586f('0x15f')]));this['channel'][_0x586f('0xa9')](util[_0x586f('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x586f('0xd')][_0x586f('0x39')],_0x4bfd1c[_0x586f('0x15f')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x586f('0x167')]=function(_0x1d5324){logger[_0x586f('0x2d')](util[_0x586f('0x28')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x1d5324['label']));if(!this['isConfigured'](_0x1d5324['operation'])){return this[_0x586f('0xd')][_0x586f('0x31')](_0x1d5324,_0x586f('0x168'));}this['channel']['noop'](util['format'](_0x586f('0x169'),_0x1d5324[_0x586f('0x16a')]));var _0x5abbb4=eval(_0x1d5324[_0x586f('0x16a')]);if(!this['isConfigured'](_0x1d5324[_0x586f('0xd9')])){return this['channel'][_0x586f('0xa9')](_0x586f('0xda'));}var _0x7804bf=this[_0x586f('0x11')][_0x586f('0x6d')](this,_0x1d5324[_0x586f('0xd9')]);if(!_0x7804bf){return this['channel'][_0x586f('0x31')](_0x1d5324,_0x586f('0xdb'));}if(_[_0x586f('0x9b')](_0x5abbb4)){var _0x3129e0=this;_0x5abbb4[_0x586f('0xdc')](function(_0x574f00,_0x3f9867){_0x3129e0[_0x586f('0xd')]['setVariable'](util['format'](_0x586f('0x16b'),_0x7804bf,_0x3f9867),_0x574f00);});return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x16c'),_0x7804bf));}else{return this[_0x586f('0xd')][_0x586f('0x9e')](_0x7804bf,_0x5abbb4);}};AGIVertices[_0x586f('0x10')]['menu']=function(_0x238cde){logger[_0x586f('0x2d')](util[_0x586f('0x28')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x238cde[_0x586f('0xa8')]));if(_0x238cde[_0x586f('0x114')]===0x0){return this[_0x586f('0xa6')](_0x238cde);}_0x238cde['retry']-=0x1;if(!this[_0x586f('0x85')](_0x238cde[_0x586f('0x116')])){return this[_0x586f('0xd')]['error'](_0x238cde,_0x586f('0x115'));}var _0x10d8ad=this[_0x586f('0x16d')]['sync'](this,_0x238cde[_0x586f('0x116')]);if(!_0x10d8ad){return this[_0x586f('0xd')][_0x586f('0x31')](_0x238cde,_0x586f('0x117'));}var _0x3c97e7=this[_0x586f('0xd')][_0x586f('0x118')](_0x10d8ad,_0x238cde['response'],_0x238cde[_0x586f('0x16e')]);var _0x4d403e=_0x3c97e7[_0x586f('0xa3')];if(_0x3c97e7[_0x586f('0xa3')]===-0x1){this[_0x586f('0x35')]['sync'](this,_0x238cde,'-1');return _0x3c97e7;}else if(_0x3c97e7[_0x586f('0xa5')]===_0x586f('0x63')){_0x3c97e7[_0x586f('0xa3')]=_0x3c97e7[_0x586f('0xa3')][_0x586f('0xa0')]>0x0?_0x3c97e7['result']:'t';}else if(_[_0x586f('0x42')](_0x3c97e7['result'])){_0x3c97e7[_0x586f('0xa3')]='#';_0x4d403e='#';}if(!this[_0x586f('0x85')](_0x238cde[_0x586f('0xd9')])){this[_0x586f('0xd')][_0x586f('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x35fa17=this[_0x586f('0x11')][_0x586f('0x6d')](this,_0x238cde[_0x586f('0xd9')]);if(!_0x35fa17){return this[_0x586f('0xd')][_0x586f('0x31')](_0x238cde,_0x586f('0xdb'));}this['channel'][_0x586f('0x9e')](_0x35fa17,_0x4d403e);}this['createSquareDetailsReport'][_0x586f('0x6d')](this,_0x238cde,_0x4d403e);return _0x3c97e7;};AGIVertices[_0x586f('0x10')][_0x586f('0xa9')]=function(_0x374413){logger[_0x586f('0x2d')](util['format'](_0x586f('0x16f'),_0x374413['label']));return this[_0x586f('0xd')][_0x586f('0xa9')](_0x374413[_0x586f('0x170')]||_0x374413[_0x586f('0xa8')]);};AGIVertices[_0x586f('0x10')][_0x586f('0x171')]=function(_0x26e441){logger['info'](util[_0x586f('0x28')](_0x586f('0x172'),_0x26e441[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x26e441['findBy'])){return this['channel']['error'](_0x26e441,_0x586f('0x173'));}logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x165'),this[_0x586f('0xd')]['callerid'],_0x26e441[_0x586f('0x15f')]));var _0x2fd552=this[_0x586f('0x4b')][_0x586f('0x6d')](this,_0x26e441[_0x586f('0x174')]);var _0x994d63=this[_0x586f('0x4d')]['sync'](this,_0x26e441[_0x586f('0x15f')],_0x2fd552);if(_0x994d63){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x161'),this[_0x586f('0xd')][_0x586f('0x39')],_0x26e441['findBy']));this[_0x586f('0xd')][_0x586f('0xa9')](util['format'](_0x586f('0x161'),this[_0x586f('0xd')][_0x586f('0x39')],_0x26e441[_0x586f('0x15f')]));return{'code':0xc8,'result':_0x586f('0x162')};}else{logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x163'),this[_0x586f('0xd')][_0x586f('0x39')],_0x26e441[_0x586f('0x15f')]));this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x161'),this[_0x586f('0xd')]['callerid'],_0x26e441[_0x586f('0x15f')]));return{'code':0xc8,'result':_0x586f('0x164')};}};AGIVertices[_0x586f('0x10')][_0x586f('0x175')]=function(_0x160163){logger[_0x586f('0x2d')](util['format'](_0x586f('0x176'),_0x160163[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x160163[_0x586f('0x116')])){return this['channel'][_0x586f('0x31')](_0x160163,_0x586f('0x115'));}var _0x24aa4c=this['getSound'][_0x586f('0x6d')](this,_0x160163[_0x586f('0x116')]);if(!_0x24aa4c){return this[_0x586f('0xd')][_0x586f('0x31')](_0x160163,_0x586f('0x117'));}var _0x511e6f=this[_0x586f('0xd')][_0x586f('0x53')](_0x586f('0x177'),[_0x24aa4c,_0x160163[_0x586f('0xe9')]]);if(_0x511e6f[_0x586f('0xa3')]===-0x1){return _0x511e6f;}return this['channel'][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0xc2'),_0x586f('0x177'),_0x24aa4c));};AGIVertices[_0x586f('0x10')][_0x586f('0x178')]=function(_0x4fae26){logger[_0x586f('0x2d')](util['format'](_0x586f('0x179'),_0x4fae26['label']));if(!this[_0x586f('0x85')](_0x4fae26[_0x586f('0x17a')])){return this['channel'][_0x586f('0x31')](_0x4fae26,_0x586f('0x17b'));}var _0x3ff6c5='';var _0x34371b=parseInt(_0x4fae26[_0x586f('0x17a')],0xa);if(isNaN(_0x34371b)){_0x3ff6c5=_0x4fae26[_0x586f('0x17a')];}else{_0x3ff6c5=this[_0x586f('0x14')][_0x586f('0x6d')](this,_0x4fae26['queue_id']);if(!_0x3ff6c5){return this[_0x586f('0xd')][_0x586f('0x31')](_0x4fae26,'no\x20queue\x20found');}}var _0x4c2f1b='';if(this['isConfigured'](_0x4fae26[_0x586f('0x116')])){var _0x3acdb1=this['getSound'][_0x586f('0x6d')](this,_0x4fae26[_0x586f('0x116')]);if(_0x3acdb1){_0x4c2f1b=_0x3acdb1;}}this[_0x586f('0x35')][_0x586f('0x6d')](this,_0x4fae26,_0x3ff6c5);if(_0x4fae26['opts'][_0x586f('0x17c')]('x')<0x0){_0x4fae26[_0x586f('0xe9')]+='x';}if(_0x4fae26['opts']['indexOf']('X')<0x0){_0x4fae26[_0x586f('0xe9')]+='X';}this[_0x586f('0xd')][_0x586f('0x9e')]('XMCS-QUEUE',_0x3ff6c5?_0x3ff6c5[_0x586f('0x17d')]():'');var _0x48a35e=this['channel'][_0x586f('0x53')]('QUEUE',[_0x3ff6c5,_0x4fae26['opts'],_0x4fae26[_0x586f('0x61')],_0x4c2f1b,_0x4fae26['timeout'],_0x4fae26[_0x586f('0xb5')],_0x4fae26[_0x586f('0x17e')],_0x4fae26[_0x586f('0x17f')],'',_0x4fae26['position']]);if(_0x48a35e['result']===-0x1){return _0x48a35e;}return this['channel'][_0x586f('0xa9')](util['format'](_0x586f('0xc2'),_0x586f('0x180'),_0x3ff6c5));};AGIVertices[_0x586f('0x10')]['record']=function(_0x17baae){logger[_0x586f('0x2d')](util['format'](_0x586f('0x181'),_0x17baae[_0x586f('0xa8')]));var _0x3450a8=_0x17baae[_0x586f('0x182')]||'wav';var _0x13f97b=util[_0x586f('0x28')]('%s_%s',this[_0x586f('0xd')][_0x586f('0x36')],rs['generate'](0x5));var _0x249bf4=util[_0x586f('0x28')](_0x586f('0x183'),FILES_PATH,_0x13f97b,_0x3450a8);var _0x126139=util['format'](_0x586f('0x136'),FILES_PATH,_0x13f97b);this[_0x586f('0x184')][_0x586f('0x6d')](this,_0x17baae,_0x13f97b,_0x249bf4);this['channel'][_0x586f('0x9e')](_0x586f('0x185'),_0x13f97b);logger[_0x586f('0x2d')](_0x586f('0x186'),_0x126139,_0x3450a8,_0x17baae[_0x586f('0x187')],_0x17baae[_0x586f('0x63')]);return this['channel'][_0x586f('0x139')](_0x126139,_0x3450a8,_0x17baae[_0x586f('0x187')],_0x17baae['timeout'],undefined,!![]);};AGIVertices[_0x586f('0x10')][_0x586f('0x188')]=function(_0x5ca564){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x189'),_0x5ca564[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x5ca564['url'])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0x18a'));}var _0x488e57=this[_0x586f('0x60')][_0x586f('0x6d')](this,_0x5ca564);logger[_0x586f('0x2d')](util['format'](_0x586f('0x18b'),util[_0x586f('0x18c')](_0x488e57,{'showHidden':![],'depth':null})));if(!this[_0x586f('0x85')](_0x5ca564[_0x586f('0xd9')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0x18d'));}var _0x4e150f=this[_0x586f('0x11')][_0x586f('0x6d')](this,_0x5ca564[_0x586f('0xd9')]);if(!_0x4e150f){return this[_0x586f('0xd')][_0x586f('0x31')](_0x5ca564,_0x586f('0xdb'));}this['channel'][_0x586f('0x9e')](util[_0x586f('0x28')](_0x586f('0x18e'),_0x4e150f),_0x488e57[_0x586f('0x74')]?_0x488e57[_0x586f('0x74')]:_0x586f('0x18f'));this[_0x586f('0xd')]['setVariable'](util['format'](_0x586f('0x190'),_0x4e150f),_0x488e57[_0x586f('0x73')]?_0x488e57['statusMessage']:'OK');if(_0x488e57[_0x586f('0x71')]){try{this[_0x586f('0x9d')](_0x488e57[_0x586f('0x71')],_0x4e150f);}catch(_0x270439){logger['error'](util[_0x586f('0x28')](_0x586f('0x191'),_0x4e150f));}}return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')]('variable\x20%s\x20set',_0x4e150f));};AGIVertices['prototype'][_0x586f('0x192')]=function(_0x4cf488){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x193'),_0x4cf488[_0x586f('0xa8')]));return this[_0x586f('0xd')]['sayDigits'](_0x4cf488[_0x586f('0x194')]['replace'](/\s+/g,''),_0x4cf488[_0x586f('0x187')]);};AGIVertices[_0x586f('0x10')][_0x586f('0x195')]=function(_0x99e2c4){logger[_0x586f('0x2d')](util['format'](_0x586f('0x196'),_0x99e2c4[_0x586f('0xa8')]));return this[_0x586f('0xd')]['sayNumber'](_0x99e2c4[_0x586f('0x64')][_0x586f('0xd7')](/\s+/g,''),_0x99e2c4[_0x586f('0x187')]);};AGIVertices['prototype'][_0x586f('0x197')]=function(_0x3909bb){logger['info'](util['format'](_0x586f('0x198'),_0x3909bb[_0x586f('0xa8')]));return this[_0x586f('0xd')][_0x586f('0x199')](_0x3909bb['text'],_0x3909bb['escape_digits']);};AGIVertices[_0x586f('0x10')][_0x586f('0x19a')]=function(_0x5333d6){logger['info'](util[_0x586f('0x28')](_0x586f('0x19b'),_0x5333d6[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x5333d6[_0x586f('0x19c')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0x19d'));}var _0x81617e=this[_0x586f('0x19e')][_0x586f('0x6d')](this,_0x5333d6[_0x586f('0x19c')]);if(!_0x81617e||!_0x81617e[_0x586f('0x19f')]){return this[_0x586f('0xd')]['error'](_0x5333d6,_0x586f('0x1a0'));}var _0x1f6aad={'from':util['format']('\x22%s\x22\x20<%s>',_0x81617e['name'],_0x81617e[_0x586f('0x1a1')]||_0x81617e[_0x586f('0x19f')][_0x586f('0x1a2')]),'to':_0x5333d6['to']||'','cc':_0x5333d6['cc']||'','bcc':_0x5333d6[_0x586f('0x1a3')]||'','subject':_0x5333d6[_0x586f('0x1a4')],'html':_0x5333d6[_0x586f('0x58')],'text':_0x5333d6['text']};if(this[_0x586f('0x85')](_0x5333d6['template_id'])){}logger['debug'](_0x586f('0x1a5'),JSON['stringify'](_0x1f6aad));this[_0x586f('0x35')][_0x586f('0x6d')](this,_0x5333d6,_0x5333d6[_0x586f('0x19c')]);this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x81617e[_0x586f('0x17')]));this[_0x586f('0x21')][_0x586f('0x6d')](this,_0x81617e['smtpOptions'],_0x1f6aad);return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0x1a6'));};AGIVertices[_0x586f('0x10')][_0x586f('0x1a7')]=function(_0x15d487){logger[_0x586f('0x2d')](util[_0x586f('0x28')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x15d487[_0x586f('0xa8')]));return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0x1a8'));};AGIVertices[_0x586f('0x10')]['sendSMS']=function(_0x3da17c){logger['info'](util['format'](_0x586f('0x1a9'),_0x3da17c[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x3da17c[_0x586f('0x1aa')])){return this[_0x586f('0xd')][_0x586f('0xa9')]('no\x20sms\x20account\x20configured');}var _0x4d8dd4=this['getSmsAccount'][_0x586f('0x6d')](this,_0x3da17c['sms_account_id']);if(!_0x4d8dd4){return this[_0x586f('0xd')][_0x586f('0x31')](_0x3da17c,'no\x20sms\x20account\x20found');}var _0xa18e50={'body':_0x3da17c[_0x586f('0x1ab')],'phone':_0x3da17c['to']||'','SmsAccountId':_0x4d8dd4['id']};logger[_0x586f('0xe2')](_0x586f('0x1ac'),JSON[_0x586f('0x70')](_0xa18e50));this['createSquareDetailsReport'][_0x586f('0x6d')](this,_0x3da17c,_0x3da17c['sms_account_id']);this['channel'][_0x586f('0xa9')](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x4d8dd4[_0x586f('0x17')]));this[_0x586f('0x34')]['sync'](this,_0xa18e50);return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0x1ad'));};AGIVertices[_0x586f('0x10')][_0x586f('0x1ae')]=function(_0x408cb7){logger['info'](util[_0x586f('0x28')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x408cb7[_0x586f('0xa8')]));if(!this[_0x586f('0x85')](_0x408cb7['variable_id'])){return this[_0x586f('0xd')][_0x586f('0x31')](_0x408cb7,'no\x20variable\x20selected');}var _0x1b49df=this[_0x586f('0x11')][_0x586f('0x6d')](this,_0x408cb7['variable_id']);if(!_0x1b49df){return this[_0x586f('0xd')]['error'](_0x408cb7,_0x586f('0xdb'));}return this[_0x586f('0xd')]['setVariable'](_0x1b49df,_0x408cb7[_0x586f('0x1af')]);};AGIVertices[_0x586f('0x10')][_0x586f('0x1b0')]=function(_0x538162){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x1b1'),_0x538162['label']));this['channel']['noop']('START\x20CALLY\x20SQUARE');if(_0x538162['answer']===_0x586f('0x1b2')){this[_0x586f('0xd')][_0x586f('0xa9')]('Answer');return this['channel'][_0x586f('0xb8')]();}return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0x1b3'));};AGIVertices[_0x586f('0x10')][_0x586f('0x1b4')]=function(_0x54c0cb){logger[_0x586f('0x2d')](util['format'](_0x586f('0x1b5'),_0x54c0cb[_0x586f('0xa8')]));if(!this['isConfigured'](_0x54c0cb[_0x586f('0x1b6')])){return this['channel'][_0x586f('0x31')](_0x54c0cb,_0x586f('0x1b7'));}var _0x274f42=this[_0x586f('0x16')]['sync'](this,_0x54c0cb['project_id']);if(!this['isConfigured'](_0x274f42)){return this[_0x586f('0xd')][_0x586f('0x31')](_0x54c0cb,util['format'](_0x586f('0x1b8'),_0x54c0cb[_0x586f('0x1b6')]));}if(_0x274f42===this['channel'][_0x586f('0x38')]){return this[_0x586f('0xd')]['error'](_0x54c0cb,_0x586f('0x1b9'));}this[_0x586f('0x35')][_0x586f('0x6d')](this,_0x54c0cb,_0x274f42);var _0x2c0ea0=this[_0x586f('0xd')][_0x586f('0x53')](_0x586f('0x1ba'),util[_0x586f('0x28')](_0x586f('0x1bb'),config[_0x586f('0xb5')][_0x586f('0x1bc')]||_0x586f('0x1bd'),_0x274f42,this[_0x586f('0xd')]['arg_1']));if(_0x2c0ea0[_0x586f('0xa3')]===-0x1){return _0x2c0ea0;}return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0xc2'),_0x586f('0x1ba'),_0x274f42));};AGIVertices[_0x586f('0x10')][_0x586f('0x1be')]=function(_0x3f20db){logger[_0x586f('0x2d')](util[_0x586f('0x28')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x3f20db['label']));var _0x58c03e=this[_0x586f('0x52')][_0x586f('0x6d')](this,_0x3f20db['command']);this['createSquareDetailsReport'][_0x586f('0x6d')](this,_0x3f20db,_0x3f20db['command']);if(this[_0x586f('0x85')](_0x3f20db[_0x586f('0xd9')])){var _0x29ec4e=this[_0x586f('0x11')]['sync'](this,_0x3f20db[_0x586f('0xd9')]);if(_0x29ec4e){this['channel'][_0x586f('0x9e')](_0x29ec4e,_0x58c03e);return this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x1bf'),_0x3f20db[_0x586f('0x1c0')],_0x29ec4e));}}return this[_0x586f('0xd')]['noop'](util[_0x586f('0x28')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x3f20db[_0x586f('0x1c0')]));};AGIVertices['prototype'][_0x586f('0x1c1')]=function(_0x4d8f0b){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x1c2'),_0x4d8f0b[_0x586f('0xa8')]));_0x4d8f0b['text']=_0x4d8f0b[_0x586f('0x58')][_0x586f('0xd7')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x586f('0x85')](_0x4d8f0b[_0x586f('0x56')])){return this['channel'][_0x586f('0xa9')](_0x586f('0x1c3'));}if(!this[_0x586f('0x85')](_0x4d8f0b[_0x586f('0x58')])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xc5'));}this[_0x586f('0xd')][_0x586f('0xa9')](util['format'](_0x586f('0x1c4'),_0x4d8f0b[_0x586f('0x58')]));var _0x1fe90f=this['googleCloudTTS']['sync'](this,_0x4d8f0b);if(_0x1fe90f){this['channel'][_0x586f('0xa9')](util['format'](_0x586f('0x1c5'),_0x1fe90f));var _0x533673=this['channel']['streamFile'](_0x1fe90f);try{fs['unlink'](_0x1fe90f+'.wav');}catch(_0x5a104c){logger[_0x586f('0x31')](_0x5a104c);}return _0x533673;}return this[_0x586f('0xd')][_0x586f('0x31')](_0x4d8f0b,_0x586f('0x1c6'));};AGIVertices[_0x586f('0x10')][_0x586f('0x1c7')]=function(_0x55382b){logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x1c8'),_0x55382b[_0x586f('0xa8')]));_0x55382b[_0x586f('0x58')]=_0x55382b[_0x586f('0x58')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x586f('0x85')](_0x55382b['text'])){return this[_0x586f('0xd')][_0x586f('0xa9')](_0x586f('0xc5'));}this['channel'][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x1c9'),_0x55382b['text']));var _0x2ddba5=this[_0x586f('0x5e')]['sync'](this,_0x55382b);if(_0x2ddba5){this[_0x586f('0xd')][_0x586f('0xa9')](util['format'](_0x586f('0x1ca'),_0x2ddba5));var _0x4b3809=this[_0x586f('0xd')][_0x586f('0x105')](_0x2ddba5);try{fs[_0x586f('0x12c')](_0x2ddba5+_0x586f('0x12d'));}catch(_0x3f46a0){logger[_0x586f('0x31')](_0x3f46a0);}return _0x4b3809;}return this[_0x586f('0xd')][_0x586f('0x31')](_0x55382b,_0x586f('0x1cb'));};AGIVertices[_0x586f('0x10')]['unpause']=function(_0x364dce){logger[_0x586f('0x2d')](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x364dce[_0x586f('0xa8')]));if(!this['isConfigured'](_0x364dce[_0x586f('0x15f')])){return this['channel'][_0x586f('0x31')](_0x364dce,_0x586f('0x173'));}logger[_0x586f('0x2d')](util['format'](_0x586f('0x165'),this[_0x586f('0xd')][_0x586f('0x39')],_0x364dce[_0x586f('0x15f')]));var _0x369dd7=this[_0x586f('0x4f')][_0x586f('0x6d')](this,_0x364dce[_0x586f('0x15f')]);if(_0x369dd7){logger['info'](util[_0x586f('0x28')](_0x586f('0x161'),this[_0x586f('0xd')][_0x586f('0x39')],_0x364dce['findBy']));this[_0x586f('0xd')][_0x586f('0xa9')](util[_0x586f('0x28')](_0x586f('0x161'),this[_0x586f('0xd')][_0x586f('0x39')],_0x364dce[_0x586f('0x15f')]));return{'code':0xc8,'result':_0x586f('0x162')};}else{logger[_0x586f('0x2d')](util[_0x586f('0x28')](_0x586f('0x163'),this[_0x586f('0xd')][_0x586f('0x39')],_0x364dce['findBy']));this[_0x586f('0xd')]['noop'](util[_0x586f('0x28')](_0x586f('0x163'),this['channel'][_0x586f('0x39')],_0x364dce[_0x586f('0x15f')]));return{'code':0xc8,'result':_0x586f('0x164')};}};AGIVertices[_0x586f('0x10')][_0x586f('0x1cc')]=function(_0x10566f){logger[_0x586f('0x2d')](util['format'](_0x586f('0x1cd'),_0x10566f[_0x586f('0xa8')]));var _0xb11643=this[_0x586f('0xd')]['exec'](_0x586f('0x1ce'),[_0x10566f['mailbox'],_0x10566f[_0x586f('0x77')]]);if(_0xb11643[_0x586f('0xa3')]===-0x1){return _0xb11643;}return this['channel']['noop'](util['format'](_0x586f('0xc2'),_0x586f('0x1ce'),_0x10566f[_0x586f('0x1cf')]));};AGIVertices[_0x586f('0x10')][_0x586f('0x1d0')]=function(_0x4c8da2){logger['info'](util[_0x586f('0x28')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x4c8da2['label']));if(!this['isConfigured'](_0x4c8da2[_0x586f('0xd9')])){return this['channel']['error'](_0x4c8da2,'no\x20variable\x20selected');}var _0x3e97bb=this[_0x586f('0x11')][_0x586f('0x6d')](this,_0x4c8da2[_0x586f('0xd9')]);if(!_0x3e97bb){return this[_0x586f('0xd')][_0x586f('0x31')](_0x4c8da2,'no\x20variable\x20found');}var _0x8dd3ff=this['channel'][_0x586f('0x11')](_0x3e97bb);return{'code':0xc8,'result':_0x8dd3ff[_0x586f('0xa5')]?_0x8dd3ff[_0x586f('0xa5')]:'-'};};String['prototype']['replaceAll']=function(_0x9056c3,_0x494b78){return this[_0x586f('0x9f')](_0x9056c3)[_0x586f('0x1d1')](_0x494b78);};module[_0x586f('0x1d2')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 343e349..2efbacc 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 _0x3a04=['blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','Action','QueuePause','then','getAgent','voicePause','info','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','timer','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','prototype','[ACW][syncAgentConnect]\x20%s','acw','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','syncAttendedTransfer','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:%]','exports','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0x3a04,0x145));var _0x43a0=function(_0x4da279,_0x287048){_0x4da279=_0x4da279-0x0;var _0xca923f=_0x3a04[_0x4da279];return _0xca923f;};'use strict';var _=require('lodash');var moment=require(_0x43a0('0x0'));var ami=require(_0x43a0('0x1'));var logger=require(_0x43a0('0x2'))('acw');var RpcUser=require(_0x43a0('0x3'));var RpcVoiceAgentReport=require(_0x43a0('0x4'));function Acw(_0x2f6488){this[_0x43a0('0x5')]=_0x2f6488['voiceQueues'];this[_0x43a0('0x6')]=_0x2f6488[_0x43a0('0x6')];this[_0x43a0('0x7')]=_0x2f6488[_0x43a0('0x7')];this[_0x43a0('0x8')]={};ami['on'](_0x43a0('0x9'),this[_0x43a0('0xa')][_0x43a0('0xb')](this));ami['on'](_0x43a0('0xc'),this[_0x43a0('0xd')][_0x43a0('0xb')](this));ami['on'](_0x43a0('0xe'),this[_0x43a0('0xf')][_0x43a0('0xb')](this));ami['on'](_0x43a0('0x10'),this[_0x43a0('0x11')][_0x43a0('0xb')](this));ami['on'](_0x43a0('0x12'),this['syncAttendedTransfer'][_0x43a0('0xb')](this));ami['on'](_0x43a0('0x13'),this[_0x43a0('0x14')][_0x43a0('0xb')](this));ami['on'](_0x43a0('0x15'),this[_0x43a0('0x16')][_0x43a0('0xb')](this));}function getDiff(_0x1e0d7d){var _0x34dd87=moment()['milliseconds'](0x0);var _0x20cc46=moment(_0x1e0d7d)[_0x43a0('0x17')](0x0);return _0x34dd87[_0x43a0('0x18')](_0x20cc46,_0x43a0('0x19'));}Acw['prototype']['startAcw']=function(_0x38b70d){try{var _0x3472fc=this;var _0x432656=this['channels'][_0x38b70d][_0x43a0('0x1a')];var _0x232558=this[_0x43a0('0x8')][_0x38b70d][_0x43a0('0x1b')];var _0x483cd7=this[_0x43a0('0x5')][_0x232558];var _0x3e17cc=![];var _0x4ca61c=_0x43a0('0x1c');if(_0x483cd7[_0x43a0('0x1d')]){if(_0x483cd7['mandatoryDispositionPause']['name']){_0x3e17cc=!![];_0x4ca61c=_0x483cd7[_0x43a0('0x1e')]['name'];}}return ami[_0x43a0('0x1f')]({'action':_0x43a0('0x20'),'interface':_0x432656,'paused':!![],'reason':_0x4ca61c})[_0x43a0('0x21')](function(){if(_0x3472fc['agents'][_0x432656]){return RpcUser[_0x43a0('0x22')](_0x3472fc[_0x43a0('0x6')][_0x432656]['id'])[_0x43a0('0x21')](function(_0x304169){if(_0x304169&&!_0x304169[_0x43a0('0x23')]){logger[_0x43a0('0x24')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x38b70d,_0x432656,_0x232558);var _0x5d545b=_0x3472fc[_0x43a0('0x8')][_0x38b70d][_0x43a0('0x25')]&&_0x3472fc[_0x43a0('0x8')][_0x38b70d][_0x43a0('0x26')]?_0x3472fc[_0x43a0('0x8')][_0x38b70d][_0x43a0('0x26')]:_0x38b70d;return RpcUser[_0x43a0('0x27')](_0x3472fc[_0x43a0('0x6')][_0x432656],_0x4ca61c,_0x5d545b)[_0x43a0('0x21')](function(){if(!_0x3e17cc){_0x3472fc['timers'][_0x432656]={};logger[_0x43a0('0x24')](_0x43a0('0x28'),_0x38b70d,_0x3472fc[_0x43a0('0x5')][_0x232558][_0x43a0('0x29')],_0x432656,_0x232558);_0x3472fc[_0x43a0('0x7')][_0x432656]['timer']=setTimeout(_0x3472fc[_0x43a0('0x2a')][_0x43a0('0xb')](_0x3472fc,_0x432656),_0x3472fc['voiceQueues'][_0x232558][_0x43a0('0x29')]*0x3e8);_0x3472fc[_0x43a0('0x7')][_0x432656][_0x43a0('0x2b')]=moment()[_0x43a0('0x2c')](_0x43a0('0x2d'));_0x3472fc[_0x43a0('0x7')][_0x432656]['uniqueid']=_0x38b70d;_0x3472fc[_0x43a0('0x7')][_0x432656][_0x43a0('0x1b')]=_0x232558;_0x3472fc[_0x43a0('0x7')][_0x432656]['updateAcw']=function(){var _0x350850=getDiff(_0x3472fc[_0x43a0('0x7')][_0x432656]['lastPauseAt']);clearTimeout(_0x3472fc[_0x43a0('0x7')][_0x432656][_0x43a0('0x2e')]);_0x3472fc[_0x43a0('0x7')][_0x432656][_0x43a0('0x2e')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x350850},_0x3472fc['timers'][_0x432656][_0x43a0('0x2f')],_0x432656)['then'](function(_0x5defd3){logger[_0x43a0('0x24')](_0x43a0('0x30'),_0x38b70d,_0x350850,_0x5defd3);})[_0x43a0('0x31')](function(_0x599873){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x38b70d,_0x599873);});delete _0x3472fc[_0x43a0('0x7')][_0x432656];};}});}else{logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x38b70d,_0x432656,_0x232558);}});}})['catch'](function(){logger[_0x43a0('0x32')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x38b70d,_0x3472fc[_0x43a0('0x5')][_0x232558][_0x43a0('0x29')],_0x432656,_0x232558);})[_0x43a0('0x33')](function(){delete _0x3472fc[_0x43a0('0x8')][_0x38b70d];});}catch(_0x3321a3){logger[_0x43a0('0x32')](_0x43a0('0x34'),_0x3321a3[_0x43a0('0x35')]);}};Acw['prototype'][_0x43a0('0x2a')]=function(_0x3864f5){try{var _0x14451f=this;if(_0x14451f[_0x43a0('0x7')][_0x3864f5]){_0x14451f[_0x43a0('0x7')][_0x3864f5]['timer']=![];var _0x216ddb=_0x14451f[_0x43a0('0x7')][_0x3864f5][_0x43a0('0x2f')];var _0x43f8b7=_0x14451f[_0x43a0('0x7')][_0x3864f5][_0x43a0('0x1b')];var _0x277d43=_0x14451f[_0x43a0('0x5')][_0x43f8b7][_0x43a0('0x29')];logger['info'](_0x43a0('0x36'),_0x216ddb,_0x3864f5);RpcUser[_0x43a0('0x37')](this[_0x43a0('0x6')][_0x3864f5]);RpcVoiceAgentReport['update']({'acwtime':_0x277d43,'agentacw':!![]},_0x216ddb,_0x3864f5)[_0x43a0('0x21')](function(_0x5f0e8d){logger[_0x43a0('0x24')](_0x43a0('0x30'),_0x216ddb,_0x277d43,_0x5f0e8d);})[_0x43a0('0x31')](function(_0xf939ad){logger[_0x43a0('0x32')](_0x43a0('0x38'),_0x216ddb,_0xf939ad);});}else{logger[_0x43a0('0x32')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x3864f5);if(_0x14451f['timers']){logger[_0x43a0('0x24')](_0x43a0('0x39'),JSON[_0x43a0('0x3a')](_0x14451f['timers']));}}}catch(_0x4a2a8a){logger[_0x43a0('0x32')](_0x43a0('0x3b'),_0x4a2a8a[_0x43a0('0x35')]);}};Acw[_0x43a0('0x3c')]['syncAgentConnect']=function(_0x5857f8){try{if(this['voiceQueues'][_0x5857f8['queue']]&&(this[_0x43a0('0x5')][_0x5857f8[_0x43a0('0x1b')]]['acw']||this['voiceQueues'][_0x5857f8['queue']][_0x43a0('0x1d')])){if(this[_0x43a0('0x6')][_0x5857f8[_0x43a0('0x1a')]]){this['channels'][_0x5857f8['uniqueid']]={'queue':_0x5857f8[_0x43a0('0x1b')],'interface':_0x5857f8[_0x43a0('0x1a')],'destlinkedid':_0x5857f8[_0x43a0('0x26')]};}}}catch(_0x3b8122){logger[_0x43a0('0x32')](_0x43a0('0x3d'),_0x3b8122['message']);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x47bebe){try{if(this['voiceQueues'][_0x47bebe[_0x43a0('0x1b')]]&&(this[_0x43a0('0x5')][_0x47bebe[_0x43a0('0x1b')]][_0x43a0('0x3e')]||this[_0x43a0('0x5')][_0x47bebe[_0x43a0('0x1b')]]['mandatoryDisposition'])){if(this[_0x43a0('0x6')][_0x47bebe['interface']]){this['channels'][_0x47bebe['uniqueid']]={'queue':_0x47bebe[_0x43a0('0x1b')],'interface':_0x47bebe[_0x43a0('0x1a')]};}}}catch(_0x943988){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x943988[_0x43a0('0x35')]);}};Acw[_0x43a0('0x3c')]['syncHangupRequest']=function(_0x79ba9c){try{if(this[_0x43a0('0x8')][_0x79ba9c[_0x43a0('0x2f')]]&&_['isUndefined'](this[_0x43a0('0x8')][_0x79ba9c[_0x43a0('0x2f')]]['attended'])){logger['info'](_0x43a0('0x3f'),_0x79ba9c[_0x43a0('0x2f')]);this[_0x43a0('0x40')](_0x79ba9c[_0x43a0('0x2f')]);}else if(this[_0x43a0('0x8')][_0x79ba9c[_0x43a0('0x41')]]&&_[_0x43a0('0x42')](this[_0x43a0('0x8')][_0x79ba9c[_0x43a0('0x41')]]['attended'])){logger[_0x43a0('0x24')](_0x43a0('0x43'),_0x79ba9c[_0x43a0('0x41')]);this[_0x43a0('0x40')](_0x79ba9c[_0x43a0('0x41')]);}}catch(_0x1264f1){logger[_0x43a0('0x32')](_0x43a0('0x44'),_0x1264f1[_0x43a0('0x35')]);}};Acw[_0x43a0('0x3c')]['syncHangup']=function(_0xa8b5e){try{if(this[_0x43a0('0x8')][_0xa8b5e[_0x43a0('0x2f')]]&&this['channels'][_0xa8b5e[_0x43a0('0x2f')]][_0x43a0('0x25')]){logger[_0x43a0('0x24')](_0x43a0('0x45'),_0xa8b5e[_0x43a0('0x2f')]);this[_0x43a0('0x40')](_0xa8b5e[_0x43a0('0x2f')]);}else if(this['channels'][_0xa8b5e['linkedid']]&&this[_0x43a0('0x8')][_0xa8b5e[_0x43a0('0x41')]]['attended']){logger[_0x43a0('0x24')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0xa8b5e[_0x43a0('0x41')]);this[_0x43a0('0x40')](_0xa8b5e['linkedid']);}}catch(_0x17a304){logger[_0x43a0('0x32')]('[ACW][syncHangup]\x20%s',_0x17a304[_0x43a0('0x35')]);}};Acw[_0x43a0('0x3c')][_0x43a0('0x46')]=function(_0x3e51ad){try{if(!_[_0x43a0('0x47')](this[_0x43a0('0x8')][_0x3e51ad['transfereeuniqueid']])){this[_0x43a0('0x40')](_0x3e51ad[_0x43a0('0x48')]);if(this[_0x43a0('0x8')][_0x3e51ad['secondtransfereruniqueid']]){this[_0x43a0('0x8')][_0x3e51ad[_0x43a0('0x49')]][_0x43a0('0x25')]=!![];this['channels'][_0x3e51ad['transfertargetuniqueid']]=this[_0x43a0('0x8')][_0x3e51ad['secondtransfereruniqueid']];delete this[_0x43a0('0x8')][_0x3e51ad[_0x43a0('0x49')]];}}else if(!_[_0x43a0('0x47')](this[_0x43a0('0x8')][_0x3e51ad[_0x43a0('0x4a')]])){this[_0x43a0('0x40')](_0x3e51ad[_0x43a0('0x4a')]);if(this[_0x43a0('0x8')][_0x3e51ad[_0x43a0('0x4b')]]){this['channels'][_0x3e51ad['origtransfereruniqueid']]['attended']=!![];this['channels'][_0x3e51ad[_0x43a0('0x48')]]=this[_0x43a0('0x8')][_0x3e51ad[_0x43a0('0x4b')]];delete this['channels'][_0x3e51ad[_0x43a0('0x4b')]];}}}catch(_0x122228){logger[_0x43a0('0x32')](_0x43a0('0x4c'),_0x122228['message']);}};Acw[_0x43a0('0x3c')][_0x43a0('0x14')]=function(_0x451b95){try{if(this[_0x43a0('0x8')][_0x451b95[_0x43a0('0x4d')]]){logger[_0x43a0('0x24')](_0x43a0('0x4e'),JSON[_0x43a0('0x3a')](_0x451b95[_0x43a0('0x4d')]));this[_0x43a0('0x40')](_0x451b95[_0x43a0('0x4d')]);}else if(this['channels'][_0x451b95[_0x43a0('0x4f')]]){logger[_0x43a0('0x24')](_0x43a0('0x50'),JSON[_0x43a0('0x3a')](_0x451b95[_0x43a0('0x4f')]));this[_0x43a0('0x40')](_0x451b95[_0x43a0('0x4f')]);}}catch(_0x4d5370){logger[_0x43a0('0x32')](_0x43a0('0x51'),_0x4d5370['message']);}};Acw[_0x43a0('0x3c')][_0x43a0('0x11')]=function(_0x15d723){try{if(this[_0x43a0('0x5')][_0x15d723[_0x43a0('0x1b')]]&&this[_0x43a0('0x5')][_0x15d723[_0x43a0('0x1b')]][_0x43a0('0x52')]===_0x43a0('0x53')){if(this[_0x43a0('0x6')][_0x15d723[_0x43a0('0x1a')]]){logger['info'](_0x43a0('0x54'),_0x15d723[_0x43a0('0x2f')],_0x15d723[_0x43a0('0x1a')],_0x15d723['queue']);return RpcUser['savePause'](this[_0x43a0('0x6')][_0x15d723[_0x43a0('0x1a')]],'Auto-Pause',_0x15d723[_0x43a0('0x2f')]);}}}catch(_0x568d7f){logger[_0x43a0('0x32')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x568d7f[_0x43a0('0x35')]);}};module[_0x43a0('0x55')]=Acw; \ No newline at end of file +var _0x7d62=['finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','then','voicePause','info','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','lastPauseAt','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','acwTimeout'];(function(_0x3b3362,_0x202631){var _0x223f5b=function(_0x21a21d){while(--_0x21a21d){_0x3b3362['push'](_0x3b3362['shift']());}};_0x223f5b(++_0x202631);}(_0x7d62,0x17b));var _0x27d6=function(_0x419b40,_0x4bbbc5){_0x419b40=_0x419b40-0x0;var _0x5afe27=_0x7d62[_0x419b40];return _0x5afe27;};'use strict';var _=require('lodash');var moment=require(_0x27d6('0x0'));var ami=require(_0x27d6('0x1'));var logger=require('../../../config/logger')(_0x27d6('0x2'));var RpcUser=require(_0x27d6('0x3'));var RpcVoiceAgentReport=require(_0x27d6('0x4'));function Acw(_0x344080){this[_0x27d6('0x5')]=_0x344080['voiceQueues'];this[_0x27d6('0x6')]=_0x344080[_0x27d6('0x6')];this[_0x27d6('0x7')]=_0x344080[_0x27d6('0x7')];this[_0x27d6('0x8')]={};ami['on'](_0x27d6('0x9'),this[_0x27d6('0xa')][_0x27d6('0xb')](this));ami['on']('hanguprequest',this[_0x27d6('0xc')]['bind'](this));ami['on'](_0x27d6('0xd'),this[_0x27d6('0xe')]['bind'](this));ami['on']('agentringnoanswer',this[_0x27d6('0xf')][_0x27d6('0xb')](this));ami['on'](_0x27d6('0x10'),this[_0x27d6('0x11')][_0x27d6('0xb')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x27d6('0xb')](this));ami['on'](_0x27d6('0x12'),this[_0x27d6('0x13')][_0x27d6('0xb')](this));}function getDiff(_0x52cf32){var _0x3261d7=moment()[_0x27d6('0x14')](0x0);var _0x18963c=moment(_0x52cf32)['milliseconds'](0x0);return _0x3261d7['diff'](_0x18963c,_0x27d6('0x15'));}Acw[_0x27d6('0x16')][_0x27d6('0x17')]=function(_0x24c938){try{var _0x300f8d=this;var _0x403f14=this[_0x27d6('0x8')][_0x24c938][_0x27d6('0x18')];var _0x4ed8dd=this['channels'][_0x24c938]['queue'];var _0x1e2529=this['voiceQueues'][_0x4ed8dd];var _0x2ff5fb=![];var _0x5cf997='ACW';if(_0x1e2529[_0x27d6('0x19')]){if(_0x1e2529[_0x27d6('0x1a')][_0x27d6('0x1b')]){_0x2ff5fb=!![];_0x5cf997=_0x1e2529[_0x27d6('0x1a')][_0x27d6('0x1b')];}}return ami[_0x27d6('0x1c')]({'action':_0x27d6('0x1d'),'interface':_0x403f14,'paused':!![],'reason':_0x5cf997})['then'](function(){if(_0x300f8d[_0x27d6('0x6')][_0x403f14]){return RpcUser[_0x27d6('0x1e')](_0x300f8d[_0x27d6('0x6')][_0x403f14]['id'])[_0x27d6('0x1f')](function(_0x285c18){if(_0x285c18&&!_0x285c18[_0x27d6('0x20')]){logger[_0x27d6('0x21')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x24c938,_0x403f14,_0x4ed8dd);var _0x7d2dd9=_0x300f8d[_0x27d6('0x8')][_0x24c938]['attended']&&_0x300f8d[_0x27d6('0x8')][_0x24c938][_0x27d6('0x22')]?_0x300f8d[_0x27d6('0x8')][_0x24c938][_0x27d6('0x22')]:_0x24c938;return RpcUser[_0x27d6('0x23')](_0x300f8d[_0x27d6('0x6')][_0x403f14],_0x5cf997,_0x7d2dd9)[_0x27d6('0x1f')](function(){if(!_0x2ff5fb){_0x300f8d['timers'][_0x403f14]={};logger[_0x27d6('0x21')](_0x27d6('0x24'),_0x24c938,_0x300f8d[_0x27d6('0x5')][_0x4ed8dd]['acwTimeout'],_0x403f14,_0x4ed8dd);_0x300f8d[_0x27d6('0x7')][_0x403f14][_0x27d6('0x25')]=setTimeout(_0x300f8d[_0x27d6('0x26')][_0x27d6('0xb')](_0x300f8d,_0x403f14),_0x300f8d[_0x27d6('0x5')][_0x4ed8dd]['acwTimeout']*0x3e8);_0x300f8d[_0x27d6('0x7')][_0x403f14]['lastPauseAt']=moment()[_0x27d6('0x27')](_0x27d6('0x28'));_0x300f8d['timers'][_0x403f14][_0x27d6('0x29')]=_0x24c938;_0x300f8d[_0x27d6('0x7')][_0x403f14][_0x27d6('0x2a')]=_0x4ed8dd;_0x300f8d[_0x27d6('0x7')][_0x403f14][_0x27d6('0x2b')]=function(){var _0x3481a9=getDiff(_0x300f8d[_0x27d6('0x7')][_0x403f14][_0x27d6('0x2c')]);clearTimeout(_0x300f8d[_0x27d6('0x7')][_0x403f14][_0x27d6('0x25')]);_0x300f8d[_0x27d6('0x7')][_0x403f14]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x3481a9},_0x300f8d[_0x27d6('0x7')][_0x403f14][_0x27d6('0x29')],_0x403f14)[_0x27d6('0x1f')](function(_0x2bd680){logger['info'](_0x27d6('0x2d'),_0x24c938,_0x3481a9,_0x2bd680);})[_0x27d6('0x2e')](function(_0xd14490){logger[_0x27d6('0x2f')](_0x27d6('0x30'),_0x24c938,_0xd14490);});delete _0x300f8d[_0x27d6('0x7')][_0x403f14];};}});}else{logger[_0x27d6('0x21')](_0x27d6('0x31'),_0x24c938,_0x403f14,_0x4ed8dd);}});}})[_0x27d6('0x2e')](function(){logger[_0x27d6('0x2f')](_0x27d6('0x24'),_0x24c938,_0x300f8d[_0x27d6('0x5')][_0x4ed8dd][_0x27d6('0x32')],_0x403f14,_0x4ed8dd);})[_0x27d6('0x33')](function(){delete _0x300f8d[_0x27d6('0x8')][_0x24c938];});}catch(_0x5697d5){logger[_0x27d6('0x2f')](_0x27d6('0x34'),_0x5697d5[_0x27d6('0x35')]);}};Acw[_0x27d6('0x16')]['stopAcw']=function(_0x2e2868){try{var _0x44117b=this;if(_0x44117b['timers'][_0x2e2868]){_0x44117b[_0x27d6('0x7')][_0x2e2868]['timer']=![];var _0x1c0cd6=_0x44117b[_0x27d6('0x7')][_0x2e2868]['uniqueid'];var _0x2ee37b=_0x44117b[_0x27d6('0x7')][_0x2e2868][_0x27d6('0x2a')];var _0x493ac2=_0x44117b['voiceQueues'][_0x2ee37b][_0x27d6('0x32')];logger['info'](_0x27d6('0x36'),_0x1c0cd6,_0x2e2868);RpcUser['saveUnpause'](this[_0x27d6('0x6')][_0x2e2868]);RpcVoiceAgentReport[_0x27d6('0x37')]({'acwtime':_0x493ac2,'agentacw':!![]},_0x1c0cd6,_0x2e2868)[_0x27d6('0x1f')](function(_0x399e35){logger[_0x27d6('0x21')](_0x27d6('0x2d'),_0x1c0cd6,_0x493ac2,_0x399e35);})[_0x27d6('0x2e')](function(_0x22a3b9){logger[_0x27d6('0x2f')]('[%s][UPDATE][ERRORS:%s]',_0x1c0cd6,_0x22a3b9);});}else{logger[_0x27d6('0x2f')](_0x27d6('0x38'),_0x2e2868);if(_0x44117b[_0x27d6('0x7')]){logger['info'](_0x27d6('0x39'),JSON[_0x27d6('0x3a')](_0x44117b[_0x27d6('0x7')]));}}}catch(_0x341496){logger['error'](_0x27d6('0x3b'),_0x341496[_0x27d6('0x35')]);}};Acw['prototype'][_0x27d6('0xa')]=function(_0x597f86){try{if(this[_0x27d6('0x5')][_0x597f86['queue']]&&(this[_0x27d6('0x5')][_0x597f86[_0x27d6('0x2a')]]['acw']||this[_0x27d6('0x5')][_0x597f86[_0x27d6('0x2a')]]['mandatoryDisposition'])){if(this[_0x27d6('0x6')][_0x597f86[_0x27d6('0x18')]]){this[_0x27d6('0x8')][_0x597f86['uniqueid']]={'queue':_0x597f86[_0x27d6('0x2a')],'interface':_0x597f86[_0x27d6('0x18')],'destlinkedid':_0x597f86[_0x27d6('0x22')]};}}}catch(_0x30eb87){logger['error'](_0x27d6('0x3c'),_0x30eb87[_0x27d6('0x35')]);}};Acw[_0x27d6('0x16')][_0x27d6('0x13')]=function(_0x3fb598){try{if(this[_0x27d6('0x5')][_0x3fb598['queue']]&&(this['voiceQueues'][_0x3fb598[_0x27d6('0x2a')]][_0x27d6('0x2')]||this[_0x27d6('0x5')][_0x3fb598[_0x27d6('0x2a')]][_0x27d6('0x19')])){if(this[_0x27d6('0x6')][_0x3fb598[_0x27d6('0x18')]]){this[_0x27d6('0x8')][_0x3fb598[_0x27d6('0x29')]]={'queue':_0x3fb598[_0x27d6('0x2a')],'interface':_0x3fb598[_0x27d6('0x18')]};}}}catch(_0x5ca42d){logger[_0x27d6('0x2f')](_0x27d6('0x3d'),_0x5ca42d['message']);}};Acw[_0x27d6('0x16')][_0x27d6('0xc')]=function(_0x2f745d){try{if(this['channels'][_0x2f745d[_0x27d6('0x29')]]&&_[_0x27d6('0x3e')](this['channels'][_0x2f745d[_0x27d6('0x29')]][_0x27d6('0x3f')])){logger['info'](_0x27d6('0x40'),_0x2f745d[_0x27d6('0x29')]);this[_0x27d6('0x17')](_0x2f745d[_0x27d6('0x29')]);}else if(this[_0x27d6('0x8')][_0x2f745d['linkedid']]&&_[_0x27d6('0x3e')](this[_0x27d6('0x8')][_0x2f745d[_0x27d6('0x41')]]['attended'])){logger[_0x27d6('0x21')](_0x27d6('0x42'),_0x2f745d['linkedid']);this[_0x27d6('0x17')](_0x2f745d[_0x27d6('0x41')]);}}catch(_0x37d08e){logger[_0x27d6('0x2f')](_0x27d6('0x43'),_0x37d08e[_0x27d6('0x35')]);}};Acw[_0x27d6('0x16')][_0x27d6('0xe')]=function(_0x3b2060){try{if(this['channels'][_0x3b2060[_0x27d6('0x29')]]&&this[_0x27d6('0x8')][_0x3b2060[_0x27d6('0x29')]][_0x27d6('0x3f')]){logger[_0x27d6('0x21')](_0x27d6('0x44'),_0x3b2060[_0x27d6('0x29')]);this[_0x27d6('0x17')](_0x3b2060[_0x27d6('0x29')]);}else if(this[_0x27d6('0x8')][_0x3b2060['linkedid']]&&this[_0x27d6('0x8')][_0x3b2060[_0x27d6('0x41')]]['attended']){logger['info'](_0x27d6('0x45'),_0x3b2060['linkedid']);this[_0x27d6('0x17')](_0x3b2060[_0x27d6('0x41')]);}}catch(_0x41e56e){logger['error']('[ACW][syncHangup]\x20%s',_0x41e56e[_0x27d6('0x35')]);}};Acw[_0x27d6('0x16')][_0x27d6('0x11')]=function(_0x268229){try{if(!_[_0x27d6('0x46')](this[_0x27d6('0x8')][_0x268229['transfereeuniqueid']])){this[_0x27d6('0x17')](_0x268229[_0x27d6('0x47')]);if(this[_0x27d6('0x8')][_0x268229['secondtransfereruniqueid']]){this['channels'][_0x268229[_0x27d6('0x48')]][_0x27d6('0x3f')]=!![];this[_0x27d6('0x8')][_0x268229['transfertargetuniqueid']]=this[_0x27d6('0x8')][_0x268229[_0x27d6('0x48')]];delete this[_0x27d6('0x8')][_0x268229[_0x27d6('0x48')]];}}else if(!_[_0x27d6('0x46')](this[_0x27d6('0x8')][_0x268229[_0x27d6('0x49')]])){this[_0x27d6('0x17')](_0x268229[_0x27d6('0x49')]);if(this[_0x27d6('0x8')][_0x268229['origtransfereruniqueid']]){this[_0x27d6('0x8')][_0x268229[_0x27d6('0x4a')]][_0x27d6('0x3f')]=!![];this['channels'][_0x268229[_0x27d6('0x47')]]=this[_0x27d6('0x8')][_0x268229['origtransfereruniqueid']];delete this[_0x27d6('0x8')][_0x268229[_0x27d6('0x4a')]];}}}catch(_0x854bed){logger[_0x27d6('0x2f')](_0x27d6('0x4b'),_0x854bed[_0x27d6('0x35')]);}};Acw[_0x27d6('0x16')]['syncBlindTransfer']=function(_0x586cb3){try{if(this[_0x27d6('0x8')][_0x586cb3['transfereruniqueid']]){logger['info'](_0x27d6('0x4c'),JSON['stringify'](_0x586cb3[_0x27d6('0x4d')]));this[_0x27d6('0x17')](_0x586cb3[_0x27d6('0x4d')]);}else if(this[_0x27d6('0x8')][_0x586cb3[_0x27d6('0x4e')]]){logger[_0x27d6('0x21')](_0x27d6('0x4f'),JSON[_0x27d6('0x3a')](_0x586cb3[_0x27d6('0x4e')]));this[_0x27d6('0x17')](_0x586cb3['transfererlinkedid']);}}catch(_0x63dd52){logger[_0x27d6('0x2f')](_0x27d6('0x50'),_0x63dd52[_0x27d6('0x35')]);}};Acw[_0x27d6('0x16')][_0x27d6('0xf')]=function(_0x2dd4d6){try{if(this['voiceQueues'][_0x2dd4d6[_0x27d6('0x2a')]]&&this[_0x27d6('0x5')][_0x2dd4d6[_0x27d6('0x2a')]][_0x27d6('0x51')]===_0x27d6('0x52')){if(this[_0x27d6('0x6')][_0x2dd4d6[_0x27d6('0x18')]]){logger[_0x27d6('0x21')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x2dd4d6[_0x27d6('0x29')],_0x2dd4d6[_0x27d6('0x18')],_0x2dd4d6[_0x27d6('0x2a')]);return RpcUser[_0x27d6('0x23')](this[_0x27d6('0x6')][_0x2dd4d6[_0x27d6('0x18')]],_0x27d6('0x53'),_0x2dd4d6[_0x27d6('0x29')]);}}}catch(_0x26e191){logger['error'](_0x27d6('0x54'),_0x26e191[_0x27d6('0x35')]);}};module[_0x27d6('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 8e879ef..6a8eec2 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 _0xede1=['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','then','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','util','../../config/logger','../../config/environment','asterisk','port','password','keepConnected','Action','promisify','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary'];(function(_0x1ecae6,_0x5f187b){var _0x27224e=function(_0xff11f){while(--_0xff11f){_0x1ecae6['push'](_0x1ecae6['shift']());}};_0x27224e(++_0x5f187b);}(_0xede1,0x194));var _0x1ede=function(_0x454a06,_0x4dd92f){_0x454a06=_0x454a06-0x0;var _0x200db2=_0xede1[_0x454a06];return _0x200db2;};'use strict';var Manager=require(_0x1ede('0x0'));var BPromise=require(_0x1ede('0x1'));var util=require(_0x1ede('0x2'));var logger=require(_0x1ede('0x3'))('ami');var config=require(_0x1ede('0x4'));var ami=new Manager(config[_0x1ede('0x5')][_0x1ede('0x6')],config[_0x1ede('0x5')]['ip'],config[_0x1ede('0x5')]['username'],config[_0x1ede('0x5')][_0x1ede('0x7')],!![]);ami[_0x1ede('0x8')]();ami[_0x1ede('0x9')]=BPromise[_0x1ede('0xa')](ami[_0x1ede('0xb')]);function error(_0x38bd02){logger['error'](util[_0x1ede('0xc')](_0x1ede('0xd'),config[_0x1ede('0x5')][_0x1ede('0xe')],config[_0x1ede('0x5')]['ip'],config['asterisk']['port'],util[_0x1ede('0xf')](_0x38bd02,![],null)));}function close(){logger[_0x1ede('0x10')](util['format'](_0x1ede('0x11'),config['asterisk'][_0x1ede('0xe')],config[_0x1ede('0x5')]['ip'],config[_0x1ede('0x5')][_0x1ede('0x6')]));}ami[_0x1ede('0x12')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0x1ede('0x13')]=function(){return function(){return ami['Action']({'action':_0x1ede('0x14')});};};ami[_0x1ede('0x15')]=function(){return function(){return ami[_0x1ede('0x9')]({'action':_0x1ede('0x16')});};};ami[_0x1ede('0x17')]=function(){return function(){return ami[_0x1ede('0x9')]({'action':_0x1ede('0x18')});};};ami[_0x1ede('0x19')]=function(){return function(){return ami[_0x1ede('0x9')]({'action':_0x1ede('0x1a')});};};function connect(){logger[_0x1ede('0x1b')](util[_0x1ede('0xc')](_0x1ede('0x1c'),config['asterisk'][_0x1ede('0xe')],config[_0x1ede('0x5')]['ip'],config[_0x1ede('0x5')][_0x1ede('0x6')]));ami[_0x1ede('0x1d')]('error',error);ami[_0x1ede('0x1d')](_0x1ede('0x1e'),close);}ami['on'](_0x1ede('0x1f'),connect);ami['on'](_0x1ede('0x20'),function(_0x4de750){logger[_0x1ede('0x1b')](util[_0x1ede('0xc')](_0x1ede('0x21'),config[_0x1ede('0x5')]['username'],config[_0x1ede('0x5')]['ip'],config['asterisk'][_0x1ede('0x6')],util[_0x1ede('0xf')](_0x4de750,![],null)));});ami['on'](_0x1ede('0x22'),function(){logger[_0x1ede('0x1b')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x1ede('0x5')]['username'],config[_0x1ede('0x5')]['ip'],config[_0x1ede('0x5')][_0x1ede('0x6')]));return Promise['resolve']()[_0x1ede('0x23')](ami[_0x1ede('0x12')]())[_0x1ede('0x23')](ami[_0x1ede('0x13')]())['then'](ami['actionSipPeerStatus']())[_0x1ede('0x23')](ami['actionQueueSummary']())[_0x1ede('0x23')](ami['actionCoreShowChannels']())[_0x1ede('0x24')](function(_0x23b7b0){logger[_0x1ede('0x10')](_0x1ede('0x25'),util['inspect'](_0x23b7b0,{'showHidden':![],'depth':null}));});});ami[_0x1ede('0x1d')](_0x1ede('0x10'),error);ami['once'](_0x1ede('0x1e'),close);module[_0x1ede('0x26')]=ami; \ No newline at end of file +var _0x66ba=['format','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','actionSipShowRegistry','then','catch','[ami.js][fullybooted]','asterisk-manager','bluebird','../../config/logger','ami','asterisk','username','password','keepConnected','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','actionCoreShowChannels','info'];(function(_0x38be78,_0x457852){var _0x4ebbf3=function(_0x508f26){while(--_0x508f26){_0x38be78['push'](_0x38be78['shift']());}};_0x4ebbf3(++_0x457852);}(_0x66ba,0xe5));var _0xa66b=function(_0xc96ce9,_0x39dab2){_0xc96ce9=_0xc96ce9-0x0;var _0x4f8966=_0x66ba[_0xc96ce9];return _0x4f8966;};'use strict';var Manager=require(_0xa66b('0x0'));var BPromise=require(_0xa66b('0x1'));var util=require('util');var logger=require(_0xa66b('0x2'))(_0xa66b('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0xa66b('0x4')]['port'],config['asterisk']['ip'],config['asterisk'][_0xa66b('0x5')],config['asterisk'][_0xa66b('0x6')],!![]);ami[_0xa66b('0x7')]();ami[_0xa66b('0x8')]=BPromise[_0xa66b('0x9')](ami[_0xa66b('0xa')]);function error(_0x283a8a){logger[_0xa66b('0xb')](util['format'](_0xa66b('0xc'),config['asterisk']['username'],config[_0xa66b('0x4')]['ip'],config[_0xa66b('0x4')][_0xa66b('0xd')],util[_0xa66b('0xe')](_0x283a8a,![],null)));}function close(){logger[_0xa66b('0xb')](util['format'](_0xa66b('0xf'),config[_0xa66b('0x4')][_0xa66b('0x5')],config[_0xa66b('0x4')]['ip'],config[_0xa66b('0x4')][_0xa66b('0xd')]));}ami['actionSipShowRegistry']=function(){return function(){return ami['Action']({'action':_0xa66b('0x10')});};};ami[_0xa66b('0x11')]=function(){return function(){return ami[_0xa66b('0x8')]({'action':_0xa66b('0x12')});};};ami[_0xa66b('0x13')]=function(){return function(){return ami[_0xa66b('0x8')]({'action':'sippeerstatus'});};};ami[_0xa66b('0x14')]=function(){return function(){return ami[_0xa66b('0x8')]({'action':'queuesummary'});};};ami[_0xa66b('0x15')]=function(){return function(){return ami['Action']({'action':'coreshowchannels'});};};function connect(){logger[_0xa66b('0x16')](util[_0xa66b('0x17')](_0xa66b('0x18'),config['asterisk'][_0xa66b('0x5')],config[_0xa66b('0x4')]['ip'],config[_0xa66b('0x4')]['port']));ami[_0xa66b('0x19')]('error',error);ami['once'](_0xa66b('0x1a'),close);}ami['on'](_0xa66b('0x1b'),connect);ami['on'](_0xa66b('0x1c'),function(_0x50a05b){logger['info'](util['format'](_0xa66b('0x1d'),config[_0xa66b('0x4')][_0xa66b('0x5')],config[_0xa66b('0x4')]['ip'],config[_0xa66b('0x4')][_0xa66b('0xd')],util[_0xa66b('0xe')](_0x50a05b,![],null)));});ami['on'](_0xa66b('0x1e'),function(){logger[_0xa66b('0x16')](util['format'](_0xa66b('0x1f'),config[_0xa66b('0x4')][_0xa66b('0x5')],config[_0xa66b('0x4')]['ip'],config[_0xa66b('0x4')][_0xa66b('0xd')]));return Promise['resolve']()['then'](ami[_0xa66b('0x20')]())[_0xa66b('0x21')](ami[_0xa66b('0x11')]())[_0xa66b('0x21')](ami[_0xa66b('0x13')]())[_0xa66b('0x21')](ami[_0xa66b('0x14')]())[_0xa66b('0x21')](ami[_0xa66b('0x15')]())[_0xa66b('0x22')](function(_0x2d64e6){logger[_0xa66b('0xb')](_0xa66b('0x23'),util[_0xa66b('0xe')](_0x2d64e6,{'showHidden':![],'depth':null}));});});ami[_0xa66b('0x19')](_0xa66b('0xb'),error);ami[_0xa66b('0x19')](_0xa66b('0x1a'),close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 7ef391b..daa0238 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 _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x3d4fdf,_0x210831){var _0xe0e37e=function(_0x32362b){while(--_0x32362b){_0x3d4fdf['push'](_0x3d4fdf['shift']());}};_0xe0e37e(++_0x210831);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x181f81,_0x594c9c){_0x181f81=_0x181f81-0x0;var _0x25b0c6=_0xbdb7[_0x181f81];return _0x25b0c6;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client; \ No newline at end of file +var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0xcb91[_0x420b24];return _0x4da552;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 37a0556..404dcf3 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 _0x7d6c=['is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','Error','isTrunkReachable','active','SIP/%s','status','checkIsTrunkReachable','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','Intervals','ifTime','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','Failure','\x20Timezone\x20unknow\x20','isArray','length','push','Action','command','interval','timezones','indexOf','true','catch','iftime\x20%s,%s','content','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','campaigns','undefined','resolve','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','dialMethod','predictive','power','handlePower','dialPowerLevel','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','uniqueid','type','ivr','updateOriginated','queue','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','agiafterat','createHistory','moveContactManagedDialer','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialQueueProject2','countdropretry','countglobal','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','add','dialDropRetryFrequency','minutes','ListId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','queueCallerAbandonCreateState','rescheduleContact','ContactId','VoiceQueueId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actions','channel','actionid','strategy','roundrobin','isNil','paused','stateinterface','locked','rrmemory','idHopper','syncQueueStatusComplete','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','syncOriginateResponse','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','saveInDb','dialAMDActive','MACHINE','Machine','countmachineretry','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','reason\x2019\x20machine....','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','createStateFinal','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','outboundUnknownCallsDay','cause-txt','Unknow','running','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','ACTIVE','checkDialMethod','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','dialPreviewRecallmeReminder','reachable','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','[uniqueid]','clearZombieChannels','[actions]','No\x20such\x20channel','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','[emptyContact]','checkPreviewRecallReminder','handleIvr','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialAgiAfterHangupAgent','dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','updatedAt','%s%s','XMD-','getCallerId','callerid','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','Trunk','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','from-sip','dialOriginateTimeout','[originateError]:\x20%s','[originate][error]','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialMachineMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','Global','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','loggedIn','outboundQueuePauses','[CatchErlangB]','predictiveIntervalPauses','floor','milliseconds','UserId','recallme','queueStatusComplete:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','voicePause','run','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','temp','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','[actionOriginate]\x20','checkIsBlackListIvr','checkContactBlack','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','getContactDialer','countReScheduled','[countReScheduled]\x20','RUNNING','checkIsBlackList','tryOriginatePredictive','dialOrderByScheduledAt','checkContactLowerLimitOriginate','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','abandonmentRate','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','[abandonmentRate]','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','Umin\x20=\x20','lodash','uuid','moment','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','booked','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/queueCallerAbandon','./models/hangup','env','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','agents','trunks','maxNumberOriginate','contactsId','uniqueId','optionPredictive','queueBooked','queueBookedRR','queuesSummary','syncAgentConnect','syncQueueCallerAbandon','originateresponse','bind','agentcomplete','syncAgentComplete','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','inspect','format','voice:queue:%s','voice_queue:save','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','getSeconds','startProgressive','name','startProgressive\x20value\x20cleared','startPredictive','debug','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','NULL_INTERVAL','Interval','\x20INTERVAL_IS_NULL','isEmpty','isIVRCampaignActive','INACTIVE','isIVRCampaign','campaign:ivr:%s','sendMessageOneNotActive','originated'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7d6c,0x19c));var _0xc7d6=function(_0x5de692,_0x334911){_0x5de692=_0x5de692-0x0;var _0x30995e=_0x7d6c[_0x5de692];return _0x30995e;};'use strict';var util=require('util');var _=require(_0xc7d6('0x0'));var uuid=require(_0xc7d6('0x1'));var moment=require(_0xc7d6('0x2'));var rr=require('rr');var Redis=require('ioredis');var utils=require('./utils');var hopperUtils=require(_0xc7d6('0x3'));var ut=require(_0xc7d6('0x4'));var config=require(_0xc7d6('0x5'));var logger=require(_0xc7d6('0x6'))('dialer');var loggerBooked=require('../../../config/logger')(_0xc7d6('0x7'));var loggerPredictive=require(_0xc7d6('0x6'))('predictive');var loggerPredictiveCalls=require(_0xc7d6('0x6'))('predictiveCalls');var loggerSyncQueueSummary=require(_0xc7d6('0x6'))(_0xc7d6('0x8'));var ami=require(_0xc7d6('0x9'));config[_0xc7d6('0xa')]=_[_0xc7d6('0xb')](config[_0xc7d6('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xc7d6('0xc'))(new Redis(config[_0xc7d6('0xa')]));var cmHopper=require(_0xc7d6('0xd'));var voiceQueueRt=require(_0xc7d6('0xe'));var RpcSetting=require(_0xc7d6('0xf'));var Interval=require(_0xc7d6('0x10'));var Action=require(_0xc7d6('0x11'));var History=require(_0xc7d6('0x12'));var Final=require(_0xc7d6('0x13'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0xc7d6('0x14'));var Hangup=require(_0xc7d6('0x15'));var ipAgi=process[_0xc7d6('0x16')]['XCALLY_IP_AGI']||_0xc7d6('0x17');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xc7d6('0x18')][_0xc7d6('0x19')]=function(_0x596e9d){this[_0xc7d6('0x1a')]=this[_0xc7d6('0x1a')]?this[_0xc7d6('0x1a')][_0xc7d6('0x1b')](_0x596e9d):_0x596e9d();};function Dialer(_0x420117,_0x2a1778){this[_0xc7d6('0x1c')]=new Sequence();this[_0xc7d6('0x1d')]=_0x2a1778;this[_0xc7d6('0x1e')]=_0x420117[_0xc7d6('0x1e')];this['campaigns']=_0x420117['campaigns'];this[_0xc7d6('0x1f')]=_0x420117[_0xc7d6('0x1f')];this['trunks']=_0x420117[_0xc7d6('0x20')];this[_0xc7d6('0x21')]=config[_0xc7d6('0x21')]||0x2;this['channels']={};this['actions']={};this[_0xc7d6('0x22')]={};this[_0xc7d6('0x23')]={};this[_0xc7d6('0x24')]={};this['startPredictive']={};this['startProgressive']={};this['ivrOriginated']={};this[_0xc7d6('0x25')]={};this[_0xc7d6('0x26')]={};this[_0xc7d6('0x27')]={};ami['on']('agentconnect',this[_0xc7d6('0x28')]['bind'](this));ami['on']('queuecallerabandon',this[_0xc7d6('0x29')]['bind'](this));ami['on'](_0xc7d6('0x2a'),this['syncOriginateResponse'][_0xc7d6('0x2b')](this));ami['on'](_0xc7d6('0x2c'),this[_0xc7d6('0x2d')][_0xc7d6('0x2b')](this));ami['on']('custom:queuesummary',this[_0xc7d6('0x8')][_0xc7d6('0x2b')](this));ami['on'](_0xc7d6('0x2e'),this[_0xc7d6('0x2f')][_0xc7d6('0x2b')](this));ami['on'](_0xc7d6('0x30'),this[_0xc7d6('0x31')][_0xc7d6('0x2b')](this));ami['on'](_0xc7d6('0x32'),this[_0xc7d6('0x33')][_0xc7d6('0x2b')](this));ami['on'](_0xc7d6('0x34'),this[_0xc7d6('0x35')][_0xc7d6('0x2b')](this));ami['on']('queuemember',this[_0xc7d6('0x36')][_0xc7d6('0x2b')](this));ami['on'](_0xc7d6('0x37'),this['syncQueueStatusComplete'][_0xc7d6('0x2b')](this));this[_0xc7d6('0x38')]();this[_0xc7d6('0x39')]();RpcSetting[_0xc7d6('0x3a')]()[_0xc7d6('0x3b')](function(_0x2ce2ea){previewRecallmeReminderInterval=_0x2ce2ea[_0xc7d6('0x3c')];});}function isNotNull(_0x4b5aec){return _0x4b5aec!==null&&!_[_0xc7d6('0x3d')](_0x4b5aec);}function msgResponse(_0x1c3cee,_0x280fa9,_0x5ecfcf){return{'action':_0x1c3cee,'response':_0x280fa9,'message':_0x5ecfcf,'stack':_0x5ecfcf};}function emit(_0x13d46c,_0xa63c26,_0x5a1d85){io['to'](_0x13d46c)[_0xc7d6('0x3e')](_0xa63c26,_0x5a1d85);}function emitOutboundVoiceQueueSummary(_0x5f29b9){if(_0x5f29b9['type']==='outbound'){logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0xc7d6('0x3f')](_0x5f29b9,{'showHidden':![],'depth':null}));emit(util[_0xc7d6('0x40')](_0xc7d6('0x41'),_0x5f29b9['name']),_0xc7d6('0x42'),_0x5f29b9);}}function checkGetDataPredictive(_0x1cb095){if(isNotNull(_0x1cb095)&&!_['isEmpty'](_0x1cb095)){loggerPredictive['info'](_0xc7d6('0x43'));loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x45'),_0x1cb095[_0xc7d6('0x46')]);loggerPredictive['info'](_0xc7d6('0x47'),_0x1cb095[_0xc7d6('0x48')]);loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x49'),_0x1cb095[_0xc7d6('0x4a')]);loggerPredictive['info'](_0xc7d6('0x4b'),_0x1cb095[_0xc7d6('0x4c')]);loggerPredictive[_0xc7d6('0x44')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1cb095[_0xc7d6('0x4d')]);loggerPredictive['info'](_0xc7d6('0x4e'),_0x1cb095[_0xc7d6('0x4f')]);loggerPredictive[_0xc7d6('0x44')]('---------------------------');if(_0x1cb095[_0xc7d6('0x46')]>0x0){if(!_[_0xc7d6('0x3d')](_0x1cb095[_0xc7d6('0x4f')])&&_0x1cb095[_0xc7d6('0x4f')]>0x0){return!![];}loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x50'));if(!_['isUndefined'](_0x1cb095[_0xc7d6('0x4d')])&&_0x1cb095[_0xc7d6('0x4d')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x51'));}}else{loggerPredictive[_0xc7d6('0x44')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0xb37e3a){return function(_0x5725b4){loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x52'));loggerPredictive['info'](_0xc7d6('0x53'),_0x5725b4[_0xc7d6('0x54')]);loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x55'),_0x5725b4[_0xc7d6('0x56')]);loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x57'),_0x5725b4[_0xc7d6('0x58')]);loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x59'),_0x5725b4['erlangBusyFactor']);loggerPredictive['info'](_0xc7d6('0x57'),_0x5725b4[_0xc7d6('0x58')]);loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x5a'));_[_0xc7d6('0x5b')](_0xb37e3a,_0x5725b4);};}function ifInterval(_0x5eeedf,_0x5091e9){if(_[_0xc7d6('0x3d')](_0x5091e9)){return![];}return utils[_0xc7d6('0x5c')](undefined,_0x5091e9)<_0x5eeedf*0x3c;}function clearPredictiveAttributes(_0x37b57b){if(_0x37b57b['startProgressive']){_0x37b57b[_0xc7d6('0x5d')]=undefined;loggerPredictive['debug'](_0x37b57b[_0xc7d6('0x5e')],_0xc7d6('0x5f'));}if(_0x37b57b[_0xc7d6('0x60')]){_0x37b57b[_0xc7d6('0x60')]=undefined;loggerPredictive[_0xc7d6('0x61')](_0x37b57b[_0xc7d6('0x5e')],_0xc7d6('0x62'));}if(_0x37b57b[_0xc7d6('0x63')]){clearInterval(_0x37b57b[_0xc7d6('0x63')]);_0x37b57b[_0xc7d6('0x63')]=undefined;loggerPredictive[_0xc7d6('0x61')](_0x37b57b[_0xc7d6('0x5e')],_0xc7d6('0x64'));}}function loggerCatchPredictive(_0x50a7e8,_0x12e7db){return function(_0x5e5b01){loggerPredictive[_0xc7d6('0x65')](_0x12e7db[_0xc7d6('0x5e')],_0x50a7e8);loggerPredictive[_0xc7d6('0x65')](_0x5e5b01[_0xc7d6('0x66')]);clearPredictiveAttributes(_0x12e7db);};}function loggerCatch(_0x1f0234){return function(_0x5b67f1){logger[_0xc7d6('0x65')](_0x1f0234,util[_0xc7d6('0x3f')](_0x5b67f1,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x53fab1,_0x1a2b92,_0x47a127){return function(_0x13945e){utils['checkContactLowerLimitOriginate'](_0x1a2b92,_0x47a127,0x0);logger[_0xc7d6('0x65')](_0x53fab1,util[_0xc7d6('0x3f')](_0x13945e,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x404332){return function(_0x25a199){if(isNotNull(_0x25a199)&&isNotNull(_0x25a199[0x0])){if(_0x25a199[0x0][_0xc7d6('0x67')]>0x0){_0x404332[_0xc7d6('0x68')]=utils[_0xc7d6('0x69')][_0xc7d6('0x6a')];logger[_0xc7d6('0x44')](_0xc7d6('0x6b')+_0x404332[_0xc7d6('0x5e')],_0x25a199[0x0]['contactsRescheduled'],_0xc7d6('0x6c'));}else{_0x404332['message']=utils[_0xc7d6('0x69')][_0xc7d6('0x6d')];logger['info'](_0xc7d6('0x6e')+_0x404332[_0xc7d6('0x5e')]);}}};}function createObjHistory(_0x60dc11,_0xd87625,_0x1f948f,_0x321916,_0x10e33b){_0x60dc11[_0xc7d6('0x68')]=_0x1f948f;var _0x3233ec=new Action(_0x60dc11,_0xd87625);var _0x39ad91=new History(_0x3233ec);_0x39ad91[_0xc7d6('0x6f')]=_0x321916;_0x39ad91[_0xc7d6('0x70')]=_0x10e33b;_0x39ad91[_0xc7d6('0x71')]=_0x3233ec[_0xc7d6('0x72')];return _0x39ad91;}function unlockQueueStatus(_0x5ca39d,_0x5c0db2){setTimeout(function(){if(_[_0xc7d6('0x3d')](_0x5ca39d[_0xc7d6('0x73')])){loggerBooked[_0xc7d6('0x65')](_0xc7d6('0x74'),_0x5c0db2);}_0x5ca39d[_0xc7d6('0x73')]=!![];loggerBooked[_0xc7d6('0x44')](_0xc7d6('0x75'),_0x5c0db2,JSON[_0xc7d6('0x76')](_[_0xc7d6('0x77')](_0x5ca39d,[_0xc7d6('0x5e'),_0xc7d6('0x73')])));},0x1f3);}function checkInterval(_0x366281){return function(){if(!isNotNull(_0x366281['Interval'])){_0x366281['message']=utils[_0xc7d6('0x69')][_0xc7d6('0x78')];throw _0x366281[_0xc7d6('0x5e')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x366281[_0xc7d6('0x79')]['Intervals'])){_0x366281[_0xc7d6('0x68')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x366281[_0xc7d6('0x5e')]+_0xc7d6('0x7a');}if(!isNotNull(_[_0xc7d6('0x7b')](_0x366281['Interval']['Intervals']))){_0x366281[_0xc7d6('0x68')]=utils[_0xc7d6('0x69')][_0xc7d6('0x78')];throw _0x366281[_0xc7d6('0x5e')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x5c0f53){return function(){if(!utils[_0xc7d6('0x7c')](_0x5c0f53)){_0x5c0f53[_0xc7d6('0x68')]=utils[_0xc7d6('0x69')][_0xc7d6('0x7d')];throw _0x5c0f53['name']+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0xce2ec8){if(utils[_0xc7d6('0x7e')](_0xce2ec8)){emit(util[_0xc7d6('0x40')](_0xc7d6('0x7f'),_0xce2ec8[_0xc7d6('0x5e')]),'campaign:save',_0xce2ec8);}}function loggerCatchQueueSummary(_0x12f3f7,_0x1a0fce){return function(_0x5d543d){clearPredictiveAttributes(_0x1a0fce);emitCampaignSummary(_0x1a0fce);loggerSyncQueueSummary[_0xc7d6('0x61')](_0x12f3f7,util[_0xc7d6('0x3f')](_0x5d543d,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x1c18c1){if(_0x1c18c1[_0xc7d6('0x80')]){if(_0x1c18c1[_0xc7d6('0x81')]===0x0){_0x1c18c1['sendMessageOneNotActive']=![];_0x1c18c1[_0xc7d6('0x68')]=utils['CAMPAIGN_STATUS'][_0xc7d6('0x7d')];loggerSyncQueueSummary[_0xc7d6('0x61')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1c18c1['name'],_0xc7d6('0x82'));}else{_0x1c18c1['message']=utils[_0xc7d6('0x69')][_0xc7d6('0x83')];loggerSyncQueueSummary[_0xc7d6('0x61')](_0xc7d6('0x84'),_0x1c18c1[_0xc7d6('0x5e')],_0xc7d6('0x85'));}emitCampaignSummary(_0x1c18c1);}}function myreject(_0xf2ac70){return function(_0x56bfa6){return _0xf2ac70(msgResponse('[ifTime][Action]',_0xc7d6('0x86'),JSON[_0xc7d6('0x76')](_0x56bfa6)));};}Dialer[_0xc7d6('0x18')][_0xc7d6('0x87')]=function(_0x93c126){return!_['isUndefined'](_0x93c126)&&_0x93c126&&!_[_0xc7d6('0x3d')](_0x93c126[_0xc7d6('0x5e')])&&!_[_0xc7d6('0x3d')](_0x93c126[_0xc7d6('0x88')])&&_0x93c126[_0xc7d6('0x88')]&&(this['trunks'][util[_0xc7d6('0x40')](_0xc7d6('0x89'),_0x93c126[_0xc7d6('0x5e')])][_0xc7d6('0x8a')]==='reachable'||this[_0xc7d6('0x20')][util[_0xc7d6('0x40')](_0xc7d6('0x89'),_0x93c126['name'])][_0xc7d6('0x8a')]==='unmonitored');};Dialer['prototype'][_0xc7d6('0x8b')]=function(_0x595c34){var _0x384ebf=this;return function(){if(!_0x384ebf[_0xc7d6('0x87')](_0x595c34['Trunk'])){if(!_0x384ebf[_0xc7d6('0x87')](_0x595c34[_0xc7d6('0x8c')])){_0x595c34['message']=utils[_0xc7d6('0x69')][_0xc7d6('0x8d')];throw _0x595c34[_0xc7d6('0x5e')]+_0xc7d6('0x8e');}}};};Dialer['prototype'][_0xc7d6('0x8f')]=function(_0x107717,_0x3fcb74,_0x2e8853,_0x19aaa4){var _0x66943d=this;return function(){var _0x45dbbf=!![];return _0x66943d['ifTimeIvr'](_0x107717,_0x3fcb74,_0x2e8853,_0x19aaa4,_0x45dbbf);};};Dialer[_0xc7d6('0x18')]['checkIfTimeIntervals']=function(_0x13abb8,_0x5650b3,_0xad5d06,_0x10c647){var _0x182809=this;return function(){var _0x325165=![];return _0x182809[_0xc7d6('0x90')](_0x13abb8[_0xc7d6('0x91')],_0x5650b3,_0xad5d06,_0x10c647,_0x325165);};};Dialer[_0xc7d6('0x18')][_0xc7d6('0x90')]=function(_0x70bc20,_0x532dff,_0x2be3ba,_0x54e0d5,_0x3ff404){var _0x3854af=[];return new Promise(function(_0x76a071,_0x5d9f55){if(!isNotNull(_0x70bc20)){_0x54e0d5[_0xc7d6('0x68')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];return _0x5d9f55(msgResponse(_0xc7d6('0x92'),'Failure',_0x2be3ba+_0xc7d6('0x93')));}if(_[_0xc7d6('0x7b')](_0x70bc20)){_0x54e0d5[_0xc7d6('0x68')]=utils[_0xc7d6('0x69')][_0xc7d6('0x94')];return _0x5d9f55(msgResponse(_0xc7d6('0x92'),'Failure',_0x2be3ba+'\x20Intervals\x20is\x20empty\x20'));}if(_0x532dff&&_[_0xc7d6('0x3d')](config['timezones'][_0x532dff])){_0x54e0d5[_0xc7d6('0x68')]=utils[_0xc7d6('0x69')][_0xc7d6('0x95')];return _0x5d9f55(msgResponse(_0xc7d6('0x92'),_0xc7d6('0x96'),_0x2be3ba+_0xc7d6('0x97')+_0x532dff));}if(_[_0xc7d6('0x98')](_0x70bc20)){for(var _0x417cb5=0x0;_0x417cb5<_0x70bc20[_0xc7d6('0x99')];_0x417cb5+=0x1){_0x3854af[_0xc7d6('0x9a')](ami[_0xc7d6('0x9b')]({'action':_0xc7d6('0x9c'),'command':util[_0xc7d6('0x40')]('iftime\x20%s,%s',_0x70bc20[_0x417cb5][_0xc7d6('0x9d')],!_[_0xc7d6('0x3d')](config[_0xc7d6('0x9e')][_0x532dff])?_0x532dff:'')})[_0xc7d6('0x3b')](function(_0x89722e){return _0x89722e['content'][_0xc7d6('0x9f')](_0xc7d6('0xa0'))>=0x0;})[_0xc7d6('0xa1')](myreject(_0x5d9f55)));}}else{_0x3854af['push'](ami['Action']({'action':_0xc7d6('0x9c'),'command':util[_0xc7d6('0x40')](_0xc7d6('0xa2'),_0x70bc20,!_[_0xc7d6('0x3d')](config[_0xc7d6('0x9e')][_0x532dff])?_0x532dff:'')})['then'](function(_0x4f741b){return _0x4f741b[_0xc7d6('0xa3')][_0xc7d6('0x9f')](_0xc7d6('0xa0'))>=0x0;})[_0xc7d6('0xa1')](myreject(_0x5d9f55)));}Promise[_0xc7d6('0xa4')](_0x3854af)['then'](function(_0x3d9a01){var _0x3fa7e1=_[_0xc7d6('0xa5')](_0x3d9a01);if(_0x3fa7e1){return _0x76a071(_0x3fa7e1);}else{_0x54e0d5[_0xc7d6('0x68')]=_0x3ff404?utils['CAMPAIGN_STATUS'][_0xc7d6('0xa6')]:utils[_0xc7d6('0x69')][_0xc7d6('0xa7')];return _0x5d9f55(msgResponse(_0xc7d6('0xa8'),_0xc7d6('0x96'),_0xc7d6('0xa9')+_0x3ff404+'\x20'+_0x2be3ba+_0xc7d6('0xaa')+util['inspect'](_0x70bc20,{'showHidden':![],'depth':null})+_0xc7d6('0xab')+_0x532dff));}})[_0xc7d6('0xa1')](function(_0x4d12b8){return _0x5d9f55(msgResponse(_0xc7d6('0x92'),_0xc7d6('0x96'),JSON[_0xc7d6('0x76')](_0x4d12b8)));});});};Dialer[_0xc7d6('0x18')]['loopCampaigns']=function(){var _0x4e3710=this;return cmHopper[_0xc7d6('0xac')]({'active':![]},{'where':{'active':!![]}})[_0xc7d6('0x3b')](function(){setInterval(function(){_0x4e3710[_0xc7d6('0xad')]();},0x3e8);});};Dialer[_0xc7d6('0x18')]['syncCampaigns']=function(){var _0x312271=this;var _0x275566;for(var _0x202d4f in this['campaigns']){if(typeof this[_0xc7d6('0xae')][_0x202d4f]!==_0xc7d6('0xaf')){_0x275566=this['campaigns'][_0x202d4f];if(utils[_0xc7d6('0x7e')](_0x275566)&&utils[_0xc7d6('0x7c')](_0x275566)){_0x275566['sendMessageOneNotActive']=!![];Promise[_0xc7d6('0xb0')]()['then'](checkIsIVRCampaignActive(_0x275566))['then'](checkInterval(_0x275566))[_0xc7d6('0x3b')](_0x312271[_0xc7d6('0x8b')](_0x275566))[_0xc7d6('0x3b')](_0x312271[_0xc7d6('0x8f')](_0x275566[_0xc7d6('0xb1')],_0x275566[_0xc7d6('0xb2')],_0x275566[_0xc7d6('0x5e')],_0x275566))[_0xc7d6('0x3b')](_0x312271[_0xc7d6('0xb3')](_0x275566[_0xc7d6('0x79')],_0x275566[_0xc7d6('0xb2')],_0x275566[_0xc7d6('0x5e')],_0x275566))['then'](_0x312271[_0xc7d6('0xb4')](_0x275566))[_0xc7d6('0xa1')](loggerCatchQueueSummary(_0xc7d6('0xb5'),_0x275566));}else{notSendMessagesCampaign(_0x275566);}}}};Dialer['prototype']['checkDialMethod']=function(_0x21826c){if(_0x21826c[_0xc7d6('0xb6')]!==_0xc7d6('0xb7')){clearPredictiveAttributes(_0x21826c);}switch(_0x21826c['dialMethod']){case'progressive':this['handlePower'](_0x21826c,0x1);break;case _0xc7d6('0xb8'):this[_0xc7d6('0xb9')](_0x21826c,_0x21826c[_0xc7d6('0xba')]);break;case'predictive':this[_0xc7d6('0xb7')](_0x21826c);break;case'booked':this[_0xc7d6('0xb9')](_0x21826c,0x1);break;default:logger[_0xc7d6('0x65')]('Queue',_0x21826c[_0xc7d6('0x5e')],_0xc7d6('0xbb'));}};Dialer[_0xc7d6('0x18')][_0xc7d6('0x92')]=function(_0x3f1be4,_0x3a273f){var _0x130d5a=_0x3f1be4[_0xc7d6('0xb2')];var _0x3f3c9b=_0x3a273f?_0x3f1be4[_0xc7d6('0xb1')]:_0x3f1be4[_0xc7d6('0x79')][_0xc7d6('0x91')];logger[_0xc7d6('0xbc')](_0xc7d6('0xbd'),_0x3f3c9b,_0x130d5a,_0x3f1be4[_0xc7d6('0x5e')],util[_0xc7d6('0x40')](_0xc7d6('0xbe'),_0x3f1be4[_0xc7d6('0x5e')],_0x3f1be4['id']));var _0x5c31ca=null;return Interval['intervalIftime'](_0x3f3c9b,_0x130d5a)['then'](function(_0x5135d5){if(_0x5135d5===!![]){return _0x5135d5;}else{_0x3f1be4[_0xc7d6('0x68')]=_0x3a273f?utils[_0xc7d6('0x69')][_0xc7d6('0xa6')]:utils[_0xc7d6('0x69')][_0xc7d6('0xa7')];_0x5c31ca=msgResponse(_0xc7d6('0xa8'),_0xc7d6('0x96'),_0xc7d6('0xa9')+_0x3a273f+'\x20'+_0x3f1be4[_0xc7d6('0x5e')]+_0xc7d6('0xaa')+util[_0xc7d6('0x3f')](_0x3f3c9b,{'showHidden':![],'depth':null})+_0xc7d6('0xab')+_0x130d5a);}if(_0x5c31ca!==null){logger['silly'](_0xc7d6('0xbf'),_0x5c31ca);_0x5c31ca[_0xc7d6('0xc0')]=_0x3a273f;throw _0x5c31ca;}})[_0xc7d6('0xa1')](function(_0x427430){logger[_0xc7d6('0x65')](_0xc7d6('0xc1'),_0x427430);throw msgResponse('[ifTime][Action]',_0xc7d6('0x86'),util[_0xc7d6('0x3f')](_0x427430,{'showHidden':![],'depth':null}));});};Dialer[_0xc7d6('0x18')][_0xc7d6('0x28')]=function(_0x46a7c9){if(this['voiceQueues'][_0x46a7c9['queue']]){if(this['uniqueId'][_0x46a7c9[_0xc7d6('0xc2')]]&&this['uniqueId'][_0x46a7c9[_0xc7d6('0xc2')]][_0xc7d6('0xc3')]!==_0xc7d6('0xc4')){this[_0xc7d6('0xc5')](this[_0xc7d6('0x1e')][_0x46a7c9[_0xc7d6('0xc6')]]);this[_0xc7d6('0x23')][_0x46a7c9[_0xc7d6('0xc2')]][_0xc7d6('0xc7')]=moment()[_0xc7d6('0x40')](_0xc7d6('0xc8'));}}};Dialer[_0xc7d6('0x18')][_0xc7d6('0x2d')]=function(_0x26acc5){var _0x1b927b=this[_0xc7d6('0x23')][_0x26acc5['uniqueid']];if(this['voiceQueues'][_0x26acc5[_0xc7d6('0xc6')]]){if(_0x1b927b&&_0x1b927b['type']!=='ivr'){delete this[_0xc7d6('0x23')][_0x26acc5[_0xc7d6('0xc2')]];this[_0xc7d6('0x1e')][_0x26acc5[_0xc7d6('0xc6')]][_0xc7d6('0xc9')]+=0x1;var _0x1ed6b5=new AgentComplete(_0x1b927b,_0x26acc5);if(_0x26acc5[_0xc7d6('0xca')]===_0xc7d6('0xcb')){_0x1ed6b5[_0xc7d6('0xcc')]=this[_0xc7d6('0x1e')][_0x26acc5['queue']]['dialQueueProject2']&&this[_0xc7d6('0x1e')][_0x26acc5['queue']]['dialAgiAfterHangupAgent']?moment()[_0xc7d6('0x40')](_0xc7d6('0xc8')):undefined;}hopperUtils[_0xc7d6('0xcd')](_0x1ed6b5)[_0xc7d6('0xa1')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0xc7d6('0xce')](_0x1ed6b5)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype']['syncQueueCallerAbandon']=function(_0x4c598){var _0x51d220=this[_0xc7d6('0x23')][_0x4c598[_0xc7d6('0xc2')]];var _0x85c3b4=this;var _0x1f754a=![];var _0x2eb90f;var _0x365442;if(this[_0xc7d6('0x1e')][_0x4c598['queue']]){if(_0x51d220&&_0x51d220['type']!=='ivr'){delete this['uniqueId'][_0x4c598[_0xc7d6('0xc2')]];this[_0xc7d6('0xc5')](this[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]]);_0x51d220[_0xc7d6('0xcf')]=moment()[_0xc7d6('0x40')](_0xc7d6('0xc8'));var _0x4cbf4d=new QueueCallerAbandon(_0x51d220,_0x4c598);if(utils[_0xc7d6('0x5c')](_0x51d220[_0xc7d6('0xcf')],_0x51d220[_0xc7d6('0xd0')])>=_0x51d220[_0xc7d6('0xd1')]){this[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]][_0xc7d6('0x4a')]+=0x1;this[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]][_0xc7d6('0xd2')]+=0x1;this[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]][_0xc7d6('0xd3')]+=0x1;_0x4cbf4d[_0xc7d6('0x6f')]=0xa;_0x4cbf4d[_0xc7d6('0x70')]=_0xc7d6('0xd4');_0x4cbf4d[_0xc7d6('0xd5')]=_0xc7d6('0xd6');_0x4cbf4d[_0xc7d6('0xcc')]=this['voiceQueues'][_0x4c598[_0xc7d6('0xc6')]][_0xc7d6('0xd7')]?moment()[_0xc7d6('0x40')](_0xc7d6('0xc8')):undefined;_0x4cbf4d[_0xc7d6('0xd8')]+=0x1;_0x4cbf4d[_0xc7d6('0xd9')]+=0x1;_0x2eb90f=this[_0xc7d6('0x1e')][_0x4c598['queue']]['dialDropRetryFrequency'];_0x365442=this[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]][_0xc7d6('0xda')];hopperUtils[_0xc7d6('0xdb')](_0x4cbf4d,_0x4cbf4d[_0xc7d6('0x6f')],_0x51d220[_0xc7d6('0xdc')])['then'](function(_0x4a77ea){_0x1f754a=_0x4a77ea[_0xc7d6('0xdd')]==0x1;if(_0x4cbf4d[_0xc7d6('0xd8')]>=_0x85c3b4[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]][_0xc7d6('0xde')]){_0x85c3b4['queueCallerAbandonCreateState'](_0x4cbf4d,_0x4a77ea[_0xc7d6('0xdd')]);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x4cbf4d[_0xc7d6('0xd8')],'scheduledat':moment()[_0xc7d6('0xdf')](_0x85c3b4['voiceQueues'][_0x4c598[_0xc7d6('0xc6')]][_0xc7d6('0xe0')],_0xc7d6('0xe1'))[_0xc7d6('0x40')](_0xc7d6('0xc8')),'ContactId':_0x51d220['ContactId'],'ListId':_0x51d220[_0xc7d6('0xe2')],'VoiceQueueId':_0x51d220['VoiceQueueId']||undefined,'CampaignId':_0x51d220[_0xc7d6('0xe3')]||undefined})['catch'](loggerCatch(_0xc7d6('0xe4')));var _0x4b55ad=new History(_0x4cbf4d);_0x4b55ad[_0xc7d6('0x6f')]=0xa;_0x4b55ad[_0xc7d6('0x70')]=_0xc7d6('0xd4');_0x4b55ad[_0xc7d6('0x72')]=moment()[_0xc7d6('0x40')](_0xc7d6('0xc8'));_0x4b55ad[_0xc7d6('0x71')]=_0x4b55ad[_0xc7d6('0x72')];_0x4b55ad['calleridname']=_0x4cbf4d[_0xc7d6('0xe5')];_0x4b55ad[_0xc7d6('0xe6')]=_0x4cbf4d[_0xc7d6('0xe6')];hopperUtils[_0xc7d6('0xcd')](_0x4b55ad)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0xe7')));}})[_0xc7d6('0x3b')](function(){if(_0x1f754a)hopperUtils[_0xc7d6('0xe8')](_0x4cbf4d,_0x2eb90f,_0x365442)['then'](function(){return 0x1;});});}else{this[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]][_0xc7d6('0x4c')]+=0x1;this[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]]['outboundDropCallsDayCallersExit']+=0x1;_0x4cbf4d['state']=0xb;_0x4cbf4d[_0xc7d6('0x70')]=_0xc7d6('0xe9');_0x4cbf4d['dropreason']=_0xc7d6('0xea');_0x4cbf4d[_0xc7d6('0xeb')]+=0x1;_0x4cbf4d[_0xc7d6('0xd9')]+=0x1;_0x2eb90f=this[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]][_0xc7d6('0xec')];_0x365442=this[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]][_0xc7d6('0xda')];hopperUtils['verifyAdditionalPhones'](_0x4cbf4d,_0x4cbf4d[_0xc7d6('0x6f')],_0x51d220[_0xc7d6('0xdc')])[_0xc7d6('0x3b')](function(_0x532d48){if(_0x4cbf4d[_0xc7d6('0xeb')]>=_0x85c3b4[_0xc7d6('0x1e')][_0x4c598['queue']][_0xc7d6('0xed')]){_0x85c3b4[_0xc7d6('0xee')](_0x4cbf4d,_0x532d48[_0xc7d6('0xdd')]);}else{hopperUtils[_0xc7d6('0xef')]({'active':![],'countabandonedretry':_0x4cbf4d[_0xc7d6('0xeb')],'scheduledat':moment()[_0xc7d6('0xdf')](_0x85c3b4[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]]['dialAbandonedRetryFrequency'],'minutes')[_0xc7d6('0x40')](_0xc7d6('0xc8')),'ContactId':_0x51d220[_0xc7d6('0xf0')],'ListId':_0x51d220[_0xc7d6('0xe2')],'VoiceQueueId':_0x51d220[_0xc7d6('0xf1')]||undefined,'CampaignId':_0x51d220[_0xc7d6('0xe3')]||undefined})['catch'](loggerCatch(_0xc7d6('0xf2')));var _0x36f9d5=new History(_0x4cbf4d);_0x36f9d5[_0xc7d6('0x6f')]=0xb;_0x36f9d5['statedesc']=_0xc7d6('0xe9');_0x36f9d5['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x36f9d5[_0xc7d6('0x71')]=_0x36f9d5[_0xc7d6('0x72')];_0x36f9d5[_0xc7d6('0xe5')]=_0x4cbf4d['calleridname'];_0x36f9d5[_0xc7d6('0xe6')]=_0x4cbf4d['calleridnum'];hopperUtils[_0xc7d6('0xcd')](_0x36f9d5)['catch'](loggerCatch(_0xc7d6('0xf3')));}})[_0xc7d6('0x3b')](function(){if(_0x1f754a)hopperUtils[_0xc7d6('0xe8')](_0x4cbf4d,_0x2eb90f,_0x365442)['then'](function(){return 0x1;});});}}}};Dialer[_0xc7d6('0x18')][_0xc7d6('0x33')]=function(_0x1e10bb){if(this['actions'][_0x1e10bb['uniqueid']]){this[_0xc7d6('0xf4')][_0x1e10bb[_0xc7d6('0xc2')]][_0xc7d6('0xf5')]=_0x1e10bb[_0xc7d6('0xf5')];}if(this[_0xc7d6('0x23')][_0x1e10bb['uniqueid']]){this[_0xc7d6('0x23')][_0x1e10bb[_0xc7d6('0xc2')]]['channel']=_0x1e10bb['channel'];}};Dialer['prototype'][_0xc7d6('0x36')]=function(_0x1bda04){if(!this[_0xc7d6('0xf4')][_0x1bda04['actionid']]){return;}var _0x437b46=this['voiceQueues'][this['actions'][_0x1bda04[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]][_0xc7d6('0xf7')]||'rrmemory';if(_0x437b46===_0xc7d6('0xf8')){if(this[_0xc7d6('0xf4')][_0x1bda04[_0xc7d6('0xf6')]]&&_[_0xc7d6('0xf9')](this[_0xc7d6('0xf4')][_0x1bda04[_0xc7d6('0xf6')]]['locked'])&&_0x1bda04[_0xc7d6('0x8a')]==='1'&&_0x1bda04[_0xc7d6('0xfa')]==='0'){if(this[_0xc7d6('0x1f')][_0x1bda04['stateinterface']]){if(!this['agents'][_0x1bda04[_0xc7d6('0xfb')]][_0xc7d6('0xfc')]){this[_0xc7d6('0x1f')][_0x1bda04[_0xc7d6('0xfb')]][_0xc7d6('0xfc')]=!![];this[_0xc7d6('0xf4')][_0x1bda04[_0xc7d6('0xf6')]][_0xc7d6('0xfc')]=!![];this[_0xc7d6('0xf4')][_0x1bda04[_0xc7d6('0xf6')]]['stateinterface']=_0x1bda04['stateinterface'];}}}}else if(_0x437b46===_0xc7d6('0xfd')){if(this[_0xc7d6('0xf4')][_0x1bda04[_0xc7d6('0xf6')]]){if(this[_0xc7d6('0x1f')][_0x1bda04['stateinterface']]){this[_0xc7d6('0xf4')][_0x1bda04['actionid']][_0xc7d6('0xfb')]=_0x1bda04[_0xc7d6('0xfb')];if(_[_0xc7d6('0xf9')](this[_0xc7d6('0x25')][this[_0xc7d6('0xf4')][_0x1bda04[_0xc7d6('0xf6')]]['queue']])){this[_0xc7d6('0x25')][this['actions'][_0x1bda04[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]]=[];}this[_0xc7d6('0x25')][this[_0xc7d6('0xf4')][_0x1bda04[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]][_0xc7d6('0x9a')](_[_0xc7d6('0x5b')](_['pick'](this[_0xc7d6('0xf4')][_0x1bda04[_0xc7d6('0xf6')]],[_0xc7d6('0xfe'),'stateinterface']),{'status':_0x1bda04['status'],'paused':_0x1bda04[_0xc7d6('0xfa')]}));}}}};Dialer[_0xc7d6('0x18')][_0xc7d6('0xff')]=function(_0x329bbe){if(!this[_0xc7d6('0xf4')][_0x329bbe['actionid']]){return;}var _0x473376=this;var _0xeaafdb=this[_0xc7d6('0x1e')][this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]];var _0x45092b=_0xeaafdb['strategy']||'rrmemory';if(_0x45092b===_0xc7d6('0xf8')){if(this['actions'][_0x329bbe[_0xc7d6('0xf6')]]&&this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]]['stateinterface']){this[_0xc7d6('0x1d')]['run'](this['actions'][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xfe')],this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xfb')])[_0xc7d6('0xa1')](function(_0xa864f8){logger[_0xc7d6('0x65')](_0xc7d6('0x100'),util[_0xc7d6('0x3f')](_0xa864f8,{'showHidden':![],'depth':null}));})[_0xc7d6('0x1b')](function(){_0x473376[_0xc7d6('0xc5')](_0x473376[_0xc7d6('0x1e')][_0x473376[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]]);_0x473376[_0xc7d6('0x1f')][_0x473376['actions'][_0x329bbe['actionid']]['stateinterface']][_0xc7d6('0xfc')]=![];delete _0x473376[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]];unlockQueueStatus(_0xeaafdb);});}else{this[_0xc7d6('0xc5')](this[_0xc7d6('0x1e')][this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xf0')],'ListId':this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xe2')],'VoiceQueueId':this[_0xc7d6('0xf4')][_0x329bbe['actionid']]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x329bbe[_0xc7d6('0xf6')]]['CampaignId']||undefined})[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x101')));delete this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]];unlockQueueStatus(_0xeaafdb);}}else if(_0x45092b===_0xc7d6('0xfd')){var _0x5be598;if(this[_0xc7d6('0xf4')][_0x329bbe['actionid']]&&!_['isEmpty'](this[_0xc7d6('0x25')][this[_0xc7d6('0xf4')][_0x329bbe['actionid']][_0xc7d6('0xc6')]])){if(this[_0xc7d6('0x26')][_0x473376[_0xc7d6('0xf4')][_0x329bbe['actionid']][_0xc7d6('0xc6')]]){this[_0xc7d6('0x26')][_0x473376[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]]=this[_0xc7d6('0x26')][this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]]['queue']]?this[_0xc7d6('0x26')][this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]]:this[_0xc7d6('0x25')][this['actions'][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]]?this[_0xc7d6('0x25')][this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]][_0xc7d6('0x102')]||0x0:0x0;}this[_0xc7d6('0x25')][this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]][_0xc7d6('0x102')]=this[_0xc7d6('0x26')][this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]];for(var _0x16c7f7=0x0;_0x16c7f7=_0x138d0f[_0xc7d6('0x127')]){_0x3db16d[_0xc7d6('0x128')](_0x355a16,_0x42a9e1,_0x5ab4f9,_0xc7d6('0x129'));}else{if(_0x355a16[_0xc7d6('0x121')]>=_0x138d0f['dialMachineMaxRetry']){_0x3db16d['createStateFinal'](_0x355a16,_0x42a9e1,_0x5ab4f9,_0xc7d6('0x12a'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x355a16['countmachineretry'],'scheduledat':moment()[_0xc7d6('0xdf')](_0x138d0f['dialMachineRetryFrequency'],_0xc7d6('0xe1'))[_0xc7d6('0x40')](_0xc7d6('0xc8')),'ContactId':_0x355a16[_0xc7d6('0xf0')],'ListId':_0x355a16['ListId'],'VoiceQueueId':_0x355a16[_0xc7d6('0xf1')]||undefined,'CampaignId':_0x355a16[_0xc7d6('0xe3')]||undefined})['catch'](loggerCatch(_0xc7d6('0x12b')));_0x42a9e1({'reschedule':0x1});}}});}if(_0x103084['type']===_0xc7d6('0xc4')&&this[_0xc7d6('0xae')][_0x103084['queue']][_0xc7d6('0x11e')]&&_0x54f8b2[_0xc7d6('0x114')]==='HANGUP'){delete this[_0xc7d6('0x23')][_0x54f8b2[_0xc7d6('0xc2')]];this['updateOriginated'](this[_0xc7d6('0xae')][_0x103084[_0xc7d6('0xc6')]]);_0x237300=new Hangup(_0x103084,_0x54f8b2);_0x237300[_0xc7d6('0x6f')]=0x12;_0x237300[_0xc7d6('0x70')]=_0xc7d6('0x117');_0x237300[_0xc7d6('0x118')]=_0xc7d6('0x119');ami['emit'](_0xc7d6('0x11a'),ut[_0xc7d6('0x11b')](_0x237300,_0xc7d6('0x11c')));this['saveInDb'](_0x237300,_0xc7d6('0x12c'),_0xc7d6('0x12d'));}if(_0x103084['type']===_0xc7d6('0xc4')&&this[_0xc7d6('0xae')][_0x103084[_0xc7d6('0xc6')]][_0xc7d6('0x11e')]&&_0x54f8b2[_0xc7d6('0x114')]===_0xc7d6('0x11f')){return new Promise(function(_0x30aaa3,_0x4236d1){delete _0x3db16d[_0xc7d6('0x23')][_0x54f8b2[_0xc7d6('0xc2')]];_0x3db16d[_0xc7d6('0xc5')](_0x3db16d['campaigns'][_0x103084['queue']]);_0x3db16d[_0xc7d6('0xae')][_0x103084[_0xc7d6('0xc6')]][_0xc7d6('0xc9')]+=0x1;_0x3db16d[_0xc7d6('0xae')][_0x103084['queue']][_0xc7d6('0x116')]+=0x1;var _0x4343e5=_0x3db16d['campaigns'][_0x103084[_0xc7d6('0xc6')]];var _0x4dc02e=new Hangup(_0x103084,_0x54f8b2);_0x4dc02e['state']=0x13;_0x4dc02e[_0xc7d6('0x70')]=_0xc7d6('0x120');_0x4dc02e[_0xc7d6('0x118')]=_0xc7d6('0x119');_0x4dc02e[_0xc7d6('0x121')]+=0x1;_0x4dc02e[_0xc7d6('0xd9')]+=0x1;_0x4dc02e[_0xc7d6('0x11c')]=!![];ami['emit'](_0xc7d6('0x11a'),ut[_0xc7d6('0x11b')](_0x4dc02e,'amd'));hopperUtils[_0xc7d6('0xcd')](_0x4dc02e)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x12e')));if(_0x4dc02e[_0xc7d6('0x122')]+_0x4dc02e[_0xc7d6('0x123')]+_0x4dc02e[_0xc7d6('0x124')]+_0x4dc02e[_0xc7d6('0x125')]+_0x4dc02e[_0xc7d6('0xd8')]+_0x4dc02e['countabandonedretry']+_0x4dc02e[_0xc7d6('0x121')]+_0x4dc02e['countagentrejectretry']>=_0x4343e5[_0xc7d6('0x127')]){_0x3db16d['stateGlobal'](_0x4dc02e,_0x30aaa3,_0x4236d1,'reason19\x20machine....');}else{if(_0x4dc02e[_0xc7d6('0x121')]>=_0x4343e5['dialMachineMaxRetry']){_0x3db16d[_0xc7d6('0x12f')](_0x4dc02e,_0x30aaa3,_0x4236d1,_0xc7d6('0x12a'));}else{hopperUtils[_0xc7d6('0xef')]({'active':![],'countmachineretry':_0x4dc02e['countmachineretry'],'scheduledat':moment()[_0xc7d6('0xdf')](_0x4343e5[_0xc7d6('0x130')],_0xc7d6('0xe1'))[_0xc7d6('0x40')](_0xc7d6('0xc8')),'ContactId':_0x4dc02e[_0xc7d6('0xf0')],'ListId':_0x4dc02e[_0xc7d6('0xe2')],'VoiceQueueId':_0x4dc02e[_0xc7d6('0xf1')]||undefined,'CampaignId':_0x4dc02e['CampaignId']||undefined})[_0xc7d6('0xa1')](loggerCatch('[rescheduleContact][Machine]'));_0x30aaa3({'reschedule':0x1});}}});}}};Dialer[_0xc7d6('0x18')][_0xc7d6('0x31')]=function(_0x13b37e){var _0x1445ed=this['uniqueId'][_0x13b37e[_0xc7d6('0xc2')]];var _0x660da9;if(_0x1445ed&&_0x1445ed[_0xc7d6('0xc3')]===_0xc7d6('0xc4')){delete this[_0xc7d6('0x23')][_0x13b37e[_0xc7d6('0xc2')]];this['updateOriginated'](this[_0xc7d6('0xae')][_0x1445ed[_0xc7d6('0xc6')]]);this[_0xc7d6('0xae')][_0x1445ed[_0xc7d6('0xc6')]][_0xc7d6('0x131')]+=0x1;_0x660da9=new Hangup(_0x1445ed,_0x13b37e);hopperUtils[_0xc7d6('0xcd')](_0x660da9)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x132')));hopperUtils['moveContactManagedDialer'](_0x660da9)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x133')));}if(_0x1445ed&&_0x1445ed[_0xc7d6('0xc3')]!==_0xc7d6('0xc4')&&isNotNull(this[_0xc7d6('0x1e')][_0x1445ed[_0xc7d6('0xc6')]][_0xc7d6('0x134')])){delete this['uniqueId'][_0x13b37e[_0xc7d6('0xc2')]];this[_0xc7d6('0xc5')](this[_0xc7d6('0x1e')][_0x1445ed['queue']]);this[_0xc7d6('0x1e')][_0x1445ed['queue']][_0xc7d6('0xc9')]+=0x1;this['voiceQueues'][_0x1445ed['queue']][_0xc7d6('0x116')]+=0x1;_0x660da9=new Hangup(_0x1445ed,_0x13b37e);_0x660da9[_0xc7d6('0x6f')]=0x10;_0x660da9[_0xc7d6('0x70')]='AnswerAGI';_0x660da9[_0xc7d6('0x118')]=_0xc7d6('0x135');hopperUtils[_0xc7d6('0xcd')](_0x660da9)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x132')));hopperUtils[_0xc7d6('0xce')](_0x660da9)[_0xc7d6('0xa1')](loggerCatch('[syncHangupIvr]'));}if(_0x1445ed&&_0x1445ed[_0xc7d6('0xc3')]!=='ivr'&&!isNotNull(this['voiceQueues'][_0x1445ed['queue']]['dialQueueProject'])){delete this[_0xc7d6('0x23')][_0x13b37e['uniqueid']];this[_0xc7d6('0xc5')](this[_0xc7d6('0x1e')][_0x1445ed[_0xc7d6('0xc6')]]);this['voiceQueues'][_0x1445ed[_0xc7d6('0xc6')]][_0xc7d6('0x136')]+=0x1;_0x660da9=new Hangup(_0x1445ed,_0x13b37e);_0x660da9[_0xc7d6('0x6f')]=0xc;_0x660da9[_0xc7d6('0x70')]=_0x13b37e[_0xc7d6('0x137')];_0x660da9['membername']=_0xc7d6('0x138');hopperUtils[_0xc7d6('0xcd')](_0x660da9)['catch'](loggerCatch(_0xc7d6('0x132')));hopperUtils[_0xc7d6('0xce')](_0x660da9)[_0xc7d6('0xa1')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xc7d6('0x18')]['syncQueueSummary']=function(_0xd9c073){var _0x2dbd56=this;if(!_0x2dbd56[_0xc7d6('0x27')][_0xd9c073['name']]){_0x2dbd56['queuesSummary'][_0xd9c073['name']]={'running':![]};}else if(_0x2dbd56[_0xc7d6('0x27')][_0xd9c073[_0xc7d6('0x5e')]][_0xc7d6('0x139')]===!![]){return;}else if(_0x2dbd56[_0xc7d6('0x27')][_0xd9c073[_0xc7d6('0x5e')]][_0xc7d6('0x139')]===![]){_0x2dbd56[_0xc7d6('0x27')][_0xd9c073[_0xc7d6('0x5e')]][_0xc7d6('0x139')]=!![];}var _0x3c805f=_0x2dbd56[_0xc7d6('0x1e')][_0xd9c073[_0xc7d6('0x5e')]];var _0x2b7c25=_0x3c805f[_0xc7d6('0x68')]!==utils[_0xc7d6('0x69')][_0xc7d6('0x7d')];var _0x1f69d2=utils['isPreviewCampaign'](_0x3c805f);_0x3c805f[_0xc7d6('0x13a')]=utils[_0xc7d6('0x13b')](_0x3c805f,_0x2dbd56[_0xc7d6('0x20')]);Promise[_0xc7d6('0xb0')]()[_0xc7d6('0x3b')](function(){if(_0x3c805f[_0xc7d6('0x13a')]===utils['CAMPAIGN_STATUS'][_0xc7d6('0x7d')]){if(_0x2b7c25){clearPredictiveAttributes(_0x3c805f);_0xd9c073[_0xc7d6('0x60')]=undefined;_0xd9c073[_0xc7d6('0x5d')]=undefined;}if(_0x3c805f['statusMessage']===utils[_0xc7d6('0x69')]['INACTIVE']){_0xd9c073[_0xc7d6('0x13c')]=0x0;_0xd9c073['paused']=0x0;_0xd9c073[_0xc7d6('0x13d')]=0x0;_0xd9c073[_0xc7d6('0x13e')]=0x0;_0xd9c073['pTalking']=0x0;}}else if(_0x3c805f[_0xc7d6('0x13a')]===utils[_0xc7d6('0x69')][_0xc7d6('0x13f')]&&!_0x1f69d2){return _0x2dbd56['ifTime'](_0x3c805f,!![])[_0xc7d6('0x3b')](function(){return _0x2dbd56[_0xc7d6('0x92')](_0x3c805f,![]);})['then'](function(){return _0x2dbd56[_0xc7d6('0x140')](_0x3c805f);})['catch'](function(_0x2124d1){loggerSyncQueueSummary[_0xc7d6('0x61')](_0xc7d6('0x141'),util[_0xc7d6('0x3f')](_0x2124d1,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x3c805f);});}else{clearPredictiveAttributes(_0x3c805f);}})['then'](function(){var _0xa17e6=_0xd9c073[_0xc7d6('0x142')](_0x3c805f);if(_0xa17e6||_0x3c805f[_0xc7d6('0x143')]){_0x3c805f[_0xc7d6('0x143')]=![];_0xd9c073[_0xc7d6('0x144')](_0x3c805f);Object[_0xc7d6('0x145')](_0x3c805f,_0xd9c073);emitOutboundVoiceQueueSummary(_0xd9c073);}_0x2dbd56[_0xc7d6('0x27')][_0x3c805f[_0xc7d6('0x5e')]]['running']=![];})[_0xc7d6('0xa1')](function(_0x463854){logger['error'](_0xc7d6('0x141'),util[_0xc7d6('0x3f')](_0x463854,{'showHidden':![],'depth':null}));_0x2dbd56[_0xc7d6('0x27')][_0x3c805f['name']][_0xc7d6('0x139')]=![];});};Dialer[_0xc7d6('0x18')]['syncQueueSummaryComplete']=_[_0xc7d6('0x146')](function(){var _0x2aaedb=_[_0xc7d6('0x147')](this['voiceQueues'],function(_0x198af5){return _0x198af5[_0xc7d6('0x148')];});var _0x27144d=_[_0xc7d6('0x147')](this['agents'],function(_0x56930c){return _0x56930c['online']&&_0x56930c[_0xc7d6('0x8a')]===_0xc7d6('0x149');});if(_0x2aaedb['length']>0x0&&_0x27144d[_0xc7d6('0x99')]>0x0){return Promise[_0xc7d6('0xb0')]()[_0xc7d6('0x3b')](cmHopper[_0xc7d6('0x14a')](_[_0xc7d6('0x14b')](_0x2aaedb,'id'),previewRecallmeReminderInterval,_['map'](_0x27144d,'id')))['then'](function(_0x214c60){for(var _0x13bc78=0x0;_0x13bc78<_0x214c60[_0xc7d6('0x99')];_0x13bc78++){var _0xd24ae0=_0x214c60[_0x13bc78][_0xc7d6('0x14c')]['name'];if(_0xd24ae0)io['to'](util[_0xc7d6('0x40')]('user:%s',_0xd24ae0))[_0xc7d6('0x3e')](_0xc7d6('0x14d'),{'hopper':_0x214c60[_0x13bc78]});}})[_0xc7d6('0xa1')](function(_0x293586){logger[_0xc7d6('0x65')]('checkPreviewRecallReminder',_0x293586);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0xc7d6('0x39')]=function(){var _0x1b8101=this;setInterval(function(){_0x1b8101['clearZombieChannels'](_0x1b8101['uniqueId'],_0xc7d6('0x14e'));_0x1b8101[_0xc7d6('0x14f')](_0x1b8101['actions'],_0xc7d6('0x150'));},0x32c8);};Dialer[_0xc7d6('0x18')][_0xc7d6('0x14f')]=function(_0x449a3f,_0x1d225b){var _0x12a5ca=this;for(var _0x50bb6f in _0x449a3f){if(typeof _0x449a3f[_0x50bb6f]!==_0xc7d6('0xaf')){this[_0xc7d6('0x1c')][_0xc7d6('0x19')](function(){if(!_[_0xc7d6('0xf9')](_0x449a3f[_0x50bb6f])){return ami['Action']({'action':_0xc7d6('0x8a'),'channel':_0x449a3f[_0x50bb6f][_0xc7d6('0xf5')]})['catch'](function(_0x132570){if(_0x132570[_0xc7d6('0x68')]===_0xc7d6('0x151')){setTimeout(function(){if(_0x449a3f[_0x50bb6f]&&_0x449a3f[_0x50bb6f]['type']!==_0xc7d6('0xc4')){_0x12a5ca[_0xc7d6('0xc5')](_0x12a5ca[_0xc7d6('0x1e')][_0x449a3f[_0x50bb6f]['queue']]);logger[_0xc7d6('0x65')]('[Dialer][checkChannel]',_0x1d225b,_0x50bb6f,_0x449a3f[_0x50bb6f][_0xc7d6('0xc6')]);delete _0x449a3f[_0x50bb6f];}if(_0x449a3f[_0x50bb6f]&&_0x449a3f[_0x50bb6f][_0xc7d6('0xc3')]===_0xc7d6('0xc4')){_0x12a5ca[_0xc7d6('0xc5')](_0x12a5ca[_0xc7d6('0xae')][_0x449a3f[_0x50bb6f]['queue']]);logger[_0xc7d6('0x65')](_0xc7d6('0x152'),_0x1d225b,_0x50bb6f,_0x449a3f[_0x50bb6f][_0xc7d6('0xc6')]);delete _0x449a3f[_0x50bb6f];}},0x2328);}});}});}}};Dialer[_0xc7d6('0x18')]['getVoiceQueueRtPauses']=function(_0x5879a7){return Promise[_0xc7d6('0xb0')]()[_0xc7d6('0x3b')](voiceQueueRt[_0xc7d6('0x153')](_0x5879a7))[_0xc7d6('0xa1')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype']['updateOriginated']=function(_0x4c3b4f){if(!_['isUndefined'](_0x4c3b4f)&&_0x4c3b4f!==null){if(typeof _0x4c3b4f[_0xc7d6('0x81')]!=='undefined'){if(_0x4c3b4f[_0xc7d6('0x81')]>0x0){_0x4c3b4f['originated']-=0x1;}else{logger[_0xc7d6('0x65')](_0xc7d6('0x154'));}}}else{logger[_0xc7d6('0x65')](_0xc7d6('0x155'));}};Dialer[_0xc7d6('0x18')][_0xc7d6('0x156')]=function(_0x4cc08a,_0x1c2a95){var _0x3f24a4=this;return function(_0x2d33f6){_0x3f24a4[_0xc7d6('0xc5')](_0x1c2a95);logger['error'](_0x4cc08a,util[_0xc7d6('0x3f')](_0x2d33f6,{'showHidden':![],'depth':null}));};};Dialer[_0xc7d6('0x18')][_0xc7d6('0x157')]=function(_0x304b2e,_0x16c1f8,_0x28e7f9){var _0x1eb344={'state':0x19,'statedesc':_0xc7d6('0x158')};this[_0xc7d6('0xc5')](_0x16c1f8);this['saveInDb'](_[_0xc7d6('0x5b')](_0x1eb344,_[_0xc7d6('0x77')](_0x28e7f9,['ContactId',_0xc7d6('0xe2'),'UserId',_0xc7d6('0xf1'),'CampaignId'])),'[emptyContact][createHistory]',_0xc7d6('0x159'));logger['error'](_0x304b2e);};Dialer['prototype']['saveInDb']=function(_0x221ab0,_0x157cbd,_0xde8fda){hopperUtils[_0xc7d6('0xcd')](_0x221ab0)[_0xc7d6('0xa1')](loggerCatch(_0x157cbd));hopperUtils[_0xc7d6('0xce')](_0x221ab0)[_0xc7d6('0xa1')](loggerCatch(_0xde8fda));};Dialer[_0xc7d6('0x18')]['queueCallerAbandonCreateState']=function(_0xdd2edd,_0xce60fc){hopperUtils['createHistory'](_0xdd2edd)[_0xc7d6('0xa1')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0xce60fc==0x0){hopperUtils[_0xc7d6('0xce')](_0xdd2edd)[_0xc7d6('0xa1')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0xc7d6('0x18')][_0xc7d6('0x15a')]=function(_0x1840e6){return Promise[_0xc7d6('0xb0')]()[_0xc7d6('0x3b')](cmHopper[_0xc7d6('0x14a')](_0x1840e6['id'],previewRecallmeReminderInterval))[_0xc7d6('0x3b')](function(_0x2502cd){for(var _0x5ac7b7=0x0;_0x5ac7b7<_0x2502cd[_0xc7d6('0x99')];_0x5ac7b7++){var _0x1f73ed=_0x2502cd[_0x5ac7b7][_0xc7d6('0x14c')]['name'];if(_0x1f73ed)io['to'](util[_0xc7d6('0x40')]('user:%s',_0x1f73ed))[_0xc7d6('0x3e')]('user:dialPreviewRecallReminder',{'hopper':_0x2502cd[_0x5ac7b7]});}})[_0xc7d6('0xa1')](function(){});};Dialer[_0xc7d6('0x18')][_0xc7d6('0xb4')]=function(_0xf80c59){var _0x721a3c=this;return function(){_0x721a3c[_0xc7d6('0x15b')](_0xf80c59);};};Dialer[_0xc7d6('0x18')]['actionOriginate']=function(_0x3622ab,_0x3e012d){var _0x27a2c3=this;var _0x2e4acb=uuid['v4']();this[_0xc7d6('0xf4')][_0x2e4acb]=new Action(_0x3622ab,_0x3e012d,_0x2e4acb);return new Promise(function(_0x3c3ef2,_0x25806a){if(_['isUndefined'](_0x3622ab)&&typeof _0x3622ab!==_0xc7d6('0x15c')){return _0x25806a(msgResponse(_0xc7d6('0x15d'),_0xc7d6('0x96'),_0xc7d6('0x15e')));}if(_['isUndefined'](_0x3e012d[_0xc7d6('0x15f')])||_0x3e012d[_0xc7d6('0x15f')]===null){return _0x25806a(msgResponse(_0xc7d6('0x15d'),_0xc7d6('0x96'),_0xc7d6('0x160')));}var _0x463e1b={'XMD-CALLERID':_0x27a2c3[_0xc7d6('0xf4')][_0x2e4acb][_0xc7d6('0x161')](),'XMD-AGI':_0x3622ab['dialQueueProject']?util[_0xc7d6('0x40')](_0xc7d6('0x162'),ipAgi,_0x3622ab[_0xc7d6('0x134')]):_0xc7d6('0x163'),'XMD-AGIAFTER':_0x3622ab[_0xc7d6('0xd7')]?util[_0xc7d6('0x40')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3622ab[_0xc7d6('0xd7')]):'NONE','XMD-QUEUE':utils[_0xc7d6('0x164')](_0x3622ab)?util[_0xc7d6('0x40')](_0xc7d6('0x165'),_0x3622ab[_0xc7d6('0x5e')],_0x3622ab['dialQueueOptions']||'',_0x3622ab[_0xc7d6('0x166')]?'c':'',_0x3622ab['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x3e012d[_0xc7d6('0xf0')],'XMD-CDRTYPE':_0xc7d6('0x167'),'CALLERID(all)':_0x27a2c3[_0xc7d6('0xf4')][_0x2e4acb]['getCaller'](),'XMD-AMD':_0x3622ab[_0xc7d6('0x11e')]?_0xc7d6('0x13f'):'NONE','XMD-DESTINATION':_0xc7d6('0x113')};if(_0x3622ab[_0xc7d6('0x11e')]){_0x463e1b[_0xc7d6('0x168')]=_0x3622ab[_0xc7d6('0x169')]||0x9c4;_0x463e1b[_0xc7d6('0x16a')]=_0x3622ab[_0xc7d6('0x16b')]||0x5dc;_0x463e1b['XMD-AMDAFTERGREETINGSILENCE']=_0x3622ab[_0xc7d6('0x16c')]||0x320;_0x463e1b[_0xc7d6('0x16d')]=_0x3622ab[_0xc7d6('0x16e')]||0x1388;_0x463e1b[_0xc7d6('0x16f')]=_0x3622ab['dialAMDMinWordLength']||0x64;_0x463e1b[_0xc7d6('0x170')]=_0x3622ab['dialAMDBetweenWordsSilence']||0x32;_0x463e1b[_0xc7d6('0x171')]=_0x3622ab['dialAMDMaximumNumberOfWords']||0x3;_0x463e1b[_0xc7d6('0x172')]=_0x3622ab[_0xc7d6('0x173')]||0x100;_0x463e1b[_0xc7d6('0x174')]=_0x3622ab[_0xc7d6('0x175')]||0x1388;}if(utils['isOutboundQueue'](_0x3622ab)){_0x463e1b[_0xc7d6('0x176')]=_0x3e012d[_0xc7d6('0xf1')];}else{_0x463e1b[_0xc7d6('0x177')]=_0x3e012d[_0xc7d6('0xe3')];}for(var _0xd6901d in _0x3e012d[_0xc7d6('0x178')]){if(typeof _0x3e012d[_0xc7d6('0x178')][_0xd6901d]!==_0xc7d6('0xaf')){if(isNotNull(_0x3e012d['Contact'][_0xd6901d])&&_0xd6901d!=='id'&&_0xd6901d!==_0xc7d6('0x179')&&_0xd6901d!=='createdAt'&&_0xd6901d!==_0xc7d6('0x17a')){_0x463e1b[util['format'](_0xc7d6('0x17b'),_0xc7d6('0x17c'),_['toUpper'](_0xd6901d))]=_0x3e012d[_0xc7d6('0x178')][_0xd6901d];}}}var _0x7b0959=_0x27a2c3[_0xc7d6('0x87')](_0x3622ab['Trunk'])?utils[_0xc7d6('0x17d')](_0x3622ab['Trunk'][_0xc7d6('0x17e')],_0x3622ab['dialOriginateCallerIdName'],_0x3622ab['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0xc7d6('0x17f')](_0x3622ab['dialOriginateCallerIdNumber'],_0x3622ab[_0xc7d6('0x180')]):_0x3622ab[_0xc7d6('0x181')]):utils[_0xc7d6('0x17d')](_['isNil'](_0x3622ab[_0xc7d6('0x8c')])?_0x3622ab[_0xc7d6('0x182')][_0xc7d6('0x17e')]:_0x3622ab[_0xc7d6('0x8c')][_0xc7d6('0x17e')],_0x3622ab['dialOriginateCallerIdName'],_0x3622ab[_0xc7d6('0x180')]>0x0?utils['getCallerIdRandom'](_0x3622ab[_0xc7d6('0x181')],_0x3622ab[_0xc7d6('0x180')]):_0x3622ab[_0xc7d6('0x181')]);if(_0x7b0959){_0x463e1b[_0xc7d6('0x183')]=_0x27a2c3['actions'][_0x2e4acb][_0xc7d6('0x184')]=utils[_0xc7d6('0x185')](_0x7b0959);_0x463e1b[_0xc7d6('0x186')]=_0x3e012d[_0xc7d6('0x15f')];}_0x3622ab[_0xc7d6('0x187')]=_0x463e1b;return ami['Action']({'actionid':_0x2e4acb,'action':_0xc7d6('0x15d'),'channel':_0x27a2c3['isTrunkReachable'](_0x3622ab[_0xc7d6('0x182')])?util[_0xc7d6('0x40')](_0xc7d6('0x188'),_0x3622ab[_0xc7d6('0x182')][_0xc7d6('0x5e')],isNotNull(_0x3622ab[_0xc7d6('0x189')])?_0x3622ab[_0xc7d6('0x189')]['trim']()||'':'',_0x3622ab[_0xc7d6('0x18a')]>0x0?_0x3e012d['phone'][_0xc7d6('0x18b')](_0x3622ab[_0xc7d6('0x18a')]):_0x3e012d[_0xc7d6('0x15f')]):util[_0xc7d6('0x40')](_0xc7d6('0x188'),_[_0xc7d6('0xf9')](_0x3622ab[_0xc7d6('0x8c')])?_0x3622ab[_0xc7d6('0x182')][_0xc7d6('0x5e')]:_0x3622ab['TrunkBackup'][_0xc7d6('0x5e')],isNotNull(_0x3622ab[_0xc7d6('0x189')])?_0x3622ab['dialPrefix'][_0xc7d6('0x18c')]()||'':'',_0x3622ab[_0xc7d6('0x18a')]>0x0?_0x3e012d[_0xc7d6('0x15f')][_0xc7d6('0x18b')](_0x3622ab[_0xc7d6('0x18a')]):_0x3e012d[_0xc7d6('0x15f')]),'callerid':_0x7b0959,'Exten':_0xc7d6('0x113'),'Context':_0xc7d6('0x18d'),'Priority':'1','variable':_0x463e1b,'timeout':(_0x3622ab[_0xc7d6('0x18e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2e4acb})[_0xc7d6('0x3b')](function(_0x290e41){return _0x3c3ef2(_0x290e41);})[_0xc7d6('0xa1')](function(_0x22a69e){_0x3622ab['outboundOriginateFailureCallsDay']+=0x1;var _0x485f21=new History(_0x27a2c3[_0xc7d6('0xf4')][_0x2e4acb]);logger[_0xc7d6('0x65')](util[_0xc7d6('0x40')](_0xc7d6('0x18f'),JSON[_0xc7d6('0x76')](_0x22a69e)));_0x485f21[_0xc7d6('0x6f')]=0xe;_0x485f21[_0xc7d6('0x70')]='OriginateError';_0x485f21[_0xc7d6('0x72')]=moment()['format'](_0xc7d6('0xc8'));_0x485f21['endtime']=_0x485f21[_0xc7d6('0x72')];hopperUtils[_0xc7d6('0xcd')](_0x485f21)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x190')));_0x27a2c3['moveContactManagedDialer'](_0x485f21)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x190')))[_0xc7d6('0x1b')](function(){delete _0x27a2c3[_0xc7d6('0xf4')][_0x2e4acb];return _0x25806a(msgResponse(_0xc7d6('0x15d'),_0xc7d6('0x86'),'originate\x20action\x20Error'));});});});};Dialer[_0xc7d6('0x18')][_0xc7d6('0x191')]=function(_0x5d738a,_0x39d386,_0x4a8a41){var _0x340b75=new History(_0x39d386);if(_0x340b75[_0xc7d6('0x122')]+_0x340b75[_0xc7d6('0x123')]+_0x340b75[_0xc7d6('0x124')]+_0x340b75[_0xc7d6('0x125')]+_0x340b75[_0xc7d6('0xd8')]+_0x340b75[_0xc7d6('0xeb')]+_0x340b75[_0xc7d6('0x121')]+_0x340b75[_0xc7d6('0x126')]>=_0x4a8a41['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x5d738a){case 0x3:if(_0x340b75[_0xc7d6('0x124')]>=_0x4a8a41['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0xc7d6('0xef')]({'active':![],'countnoanswerretry':_0x340b75['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xc7d6('0xdf')](_0x4a8a41[_0xc7d6('0x192')],_0xc7d6('0xe1'))[_0xc7d6('0x40')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x340b75[_0xc7d6('0xf0')],'ListId':_0x340b75[_0xc7d6('0xe2')],'VoiceQueueId':_0x340b75[_0xc7d6('0xf1')]||undefined,'CampaignId':_0x340b75[_0xc7d6('0xe3')]||undefined})[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x193')));break;case 0x5:if(_0x340b75['countbusyretry']>=_0x4a8a41[_0xc7d6('0x194')]-0x1){return!![];}hopperUtils[_0xc7d6('0xef')]({'active':![],'countbusyretry':_0x340b75['countbusyretry']+=0x1,'scheduledat':moment()[_0xc7d6('0xdf')](_0x4a8a41[_0xc7d6('0x195')],_0xc7d6('0xe1'))['format'](_0xc7d6('0xc8')),'ContactId':_0x340b75[_0xc7d6('0xf0')],'ListId':_0x340b75[_0xc7d6('0xe2')],'VoiceQueueId':_0x340b75[_0xc7d6('0xf1')]||undefined,'CampaignId':_0x340b75['CampaignId']||undefined})[_0xc7d6('0xa1')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x340b75[_0xc7d6('0x123')]>=_0x4a8a41[_0xc7d6('0x196')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x340b75[_0xc7d6('0x123')]+=0x1,'scheduledat':moment()['add'](_0x4a8a41[_0xc7d6('0x197')],_0xc7d6('0xe1'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x340b75[_0xc7d6('0xf0')],'ListId':_0x340b75[_0xc7d6('0xe2')],'VoiceQueueId':_0x340b75[_0xc7d6('0xf1')]||undefined,'CampaignId':_0x340b75[_0xc7d6('0xe3')]||undefined})[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x198')));break;case 0x0:if(_0x340b75[_0xc7d6('0x125')]>=_0x4a8a41[_0xc7d6('0x199')]-0x1){return!![];}else{hopperUtils[_0xc7d6('0xef')]({'active':![],'countnosuchnumberretry':_0x340b75['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xc7d6('0xdf')](_0x4a8a41[_0xc7d6('0x19a')],_0xc7d6('0xe1'))[_0xc7d6('0x40')](_0xc7d6('0xc8')),'ContactId':_0x340b75[_0xc7d6('0xf0')],'ListId':_0x340b75['ListId'],'VoiceQueueId':_0x340b75[_0xc7d6('0xf1')]||undefined,'CampaignId':_0x340b75[_0xc7d6('0xe3')]||undefined})['catch'](loggerCatch(_0xc7d6('0x19b')));}break;case 0xa:if(_0x340b75['countdropretry']>=_0x4a8a41['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0xc7d6('0xef')]({'active':![],'countdropretry':_0x340b75[_0xc7d6('0xd8')]+=0x1,'scheduledat':moment()[_0xc7d6('0xdf')](_0x4a8a41[_0xc7d6('0xe0')],_0xc7d6('0xe1'))[_0xc7d6('0x40')](_0xc7d6('0xc8')),'ContactId':_0x340b75[_0xc7d6('0xf0')],'ListId':_0x340b75[_0xc7d6('0xe2')],'VoiceQueueId':_0x340b75['VoiceQueueId']||undefined,'CampaignId':_0x340b75[_0xc7d6('0xe3')]||undefined})[_0xc7d6('0xa1')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x340b75[_0xc7d6('0xeb')]>=_0x4a8a41[_0xc7d6('0xed')]-0x1){return!![];}hopperUtils[_0xc7d6('0xef')]({'active':![],'countabandonedretry':_0x340b75[_0xc7d6('0xeb')]+=0x1,'scheduledat':moment()[_0xc7d6('0xdf')](_0x4a8a41[_0xc7d6('0xec')],_0xc7d6('0xe1'))['format'](_0xc7d6('0xc8')),'ContactId':_0x340b75[_0xc7d6('0xf0')],'ListId':_0x340b75['ListId'],'VoiceQueueId':_0x340b75['VoiceQueueId']||undefined,'CampaignId':_0x340b75[_0xc7d6('0xe3')]||undefined})[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0xf2')));break;case 0x13:if(_0x340b75['countmachineretry']>=_0x4a8a41[_0xc7d6('0x19c')]-0x1){return!![];}hopperUtils[_0xc7d6('0xef')]({'active':![],'countmachineretry':_0x340b75[_0xc7d6('0x121')]+=0x1,'scheduledat':moment()[_0xc7d6('0xdf')](_0x4a8a41[_0xc7d6('0x130')],'minutes')[_0xc7d6('0x40')](_0xc7d6('0xc8')),'ContactId':_0x340b75['ContactId'],'ListId':_0x340b75[_0xc7d6('0xe2')],'VoiceQueueId':_0x340b75['VoiceQueueId']||undefined,'CampaignId':_0x340b75[_0xc7d6('0xe3')]||undefined})['catch'](loggerCatch(_0xc7d6('0x12b')));break;case 0x14:if(_0x340b75[_0xc7d6('0x126')]>=_0x4a8a41['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x340b75[_0xc7d6('0x126')]+=0x1,'scheduledat':moment()['add'](_0x4a8a41[_0xc7d6('0x19d')],_0xc7d6('0xe1'))['format'](_0xc7d6('0xc8')),'ContactId':_0x340b75[_0xc7d6('0xf0')],'ListId':_0x340b75[_0xc7d6('0xe2')],'VoiceQueueId':_0x340b75['VoiceQueueId']||undefined,'CampaignId':_0x340b75[_0xc7d6('0xe3')]||undefined})[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x19e')));break;default:return!![];}};Dialer[_0xc7d6('0x18')][_0xc7d6('0x10e')]=function(_0x29df3c,_0x4c02ae,_0x169a72){var _0x36a8e3=this;var _0xac56aa=new History(_0x29df3c);var _0x2f1d3d=![];var _0x3641d1;var _0x3672b4;return new Promise(function(_0x52b225,_0xcbf8af){if(_['isUndefined'](_0x4c02ae)&&typeof _0x4c02ae!==_0xc7d6('0x15c')){return _0xcbf8af(msgResponse(_0xc7d6('0x19f'),_0xc7d6('0x96'),_0xc7d6('0x1a0')));}if(_['isUndefined'](_0x169a72)&&typeof _0x169a72!==_0xc7d6('0x15c')){return _0xcbf8af(msgResponse(_0xc7d6('0x19f'),_0xc7d6('0x96'),'evt\x20is\x20undefine'));}hopperUtils[_0xc7d6('0xdb')](_0xac56aa,_0x169a72[_0xc7d6('0xca')],_0x4c02ae)[_0xc7d6('0x3b')](function(_0x2e9295){if(_0x2e9295[_0xc7d6('0xdd')]==0x1)_0x2f1d3d=!![];switch(_0x169a72[_0xc7d6('0xca')]){case'0':_0x4c02ae[_0xc7d6('0x1a1')]+=0x1;_0xac56aa[_0xc7d6('0x6f')]=0x0;_0xac56aa[_0xc7d6('0x70')]=_0xc7d6('0x1a2');_0xac56aa[_0xc7d6('0x125')]+=0x1;_0xac56aa[_0xc7d6('0xd9')]+=0x1;ami['emit'](_0xc7d6('0x1a3'),ut[_0xc7d6('0x11b')](_0x29df3c,_0xc7d6('0x1a4')));_0x3641d1=_0x4c02ae[_0xc7d6('0x19a')];_0x3672b4=_0x4c02ae[_0xc7d6('0xda')];hopperUtils[_0xc7d6('0xcd')](_0xac56aa)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x12e')));if(_0x36a8e3[_0xc7d6('0x191')](0x0,_0x29df3c,_0x4c02ae)&&!_0x2f1d3d){if(_0xac56aa[_0xc7d6('0x125')]>=_0x4c02ae[_0xc7d6('0x199')]){_0x36a8e3[_0xc7d6('0x12f')](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1a5'));}else{_0x36a8e3[_0xc7d6('0x128')](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1a5'));}}break;case'3':_0x4c02ae['outboundNoAnswerCallsDay']+=0x1;_0xac56aa[_0xc7d6('0x6f')]=0x3;_0xac56aa[_0xc7d6('0x70')]=_0xc7d6('0x1a6');_0xac56aa[_0xc7d6('0x124')]+=0x1;_0xac56aa[_0xc7d6('0xd9')]+=0x1;var _0x5f1554=ut[_0xc7d6('0x1a7')](_0x29df3c,_0x4c02ae);ami['emit'](_0xc7d6('0x1a8'),_0x5f1554);_0x3641d1=_0x4c02ae[_0xc7d6('0x192')];_0x3672b4=_0x4c02ae[_0xc7d6('0xda')];hopperUtils[_0xc7d6('0xcd')](_0xac56aa)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x1a9')));if(_0x36a8e3[_0xc7d6('0x191')](0x3,_0x29df3c,_0x4c02ae)&&!_0x2f1d3d){if(_0xac56aa[_0xc7d6('0x124')]>=_0x4c02ae[_0xc7d6('0x1aa')]){_0x36a8e3[_0xc7d6('0x12f')](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1ab'));}else{_0x36a8e3[_0xc7d6('0x128')](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1ab'));}}break;case'5':_0x4c02ae[_0xc7d6('0x1ac')]+=0x1;_0xac56aa[_0xc7d6('0x6f')]=0x5;_0xac56aa[_0xc7d6('0x70')]=_0xc7d6('0x1ad');_0xac56aa[_0xc7d6('0x122')]+=0x1;_0xac56aa[_0xc7d6('0xd9')]+=0x1;ami[_0xc7d6('0x3e')](_0xc7d6('0x1ae'),ut[_0xc7d6('0x11b')](_0x29df3c,_0xc7d6('0x1af')));_0x3641d1=_0x4c02ae[_0xc7d6('0x195')];_0x3672b4=_0x4c02ae[_0xc7d6('0xda')];hopperUtils[_0xc7d6('0xcd')](_0xac56aa)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x1b0')));if(_0x36a8e3[_0xc7d6('0x191')](0x5,_0x29df3c,_0x4c02ae)&&!_0x2f1d3d){if(_0xac56aa[_0xc7d6('0x122')]>=_0x4c02ae['dialBusyMaxRetry']){_0x36a8e3[_0xc7d6('0x12f')](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1b1'));}else{_0x36a8e3[_0xc7d6('0x128')](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1b1'));}}break;case'8':_0x4c02ae[_0xc7d6('0x1b2')]+=0x1;_0xac56aa[_0xc7d6('0x6f')]=0x8;_0xac56aa[_0xc7d6('0x70')]=_0xc7d6('0x1b3');_0xac56aa[_0xc7d6('0x123')]+=0x1;_0xac56aa[_0xc7d6('0xd9')]+=0x1;_0x3641d1=_0x4c02ae['dialCongestionRetryFrequency'];_0x3672b4=_0x4c02ae['callAdditionalPhoneAfterMin'];ami[_0xc7d6('0x3e')](_0xc7d6('0x1b4'),ut[_0xc7d6('0x11b')](_0x29df3c,_0xc7d6('0x1b5')));hopperUtils[_0xc7d6('0xcd')](_0xac56aa)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x36a8e3[_0xc7d6('0x191')](0x8,_0x29df3c,_0x4c02ae)&&!_0x2f1d3d){if(_0xac56aa['countcongestionretry']>=_0x4c02ae[_0xc7d6('0x196')]){_0x36a8e3[_0xc7d6('0x12f')](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1b6'));}else{_0x36a8e3['stateGlobal'](_0xac56aa,_0x52b225,_0xcbf8af,'reason\x208\x20congestion');}}break;case'11':_0x4c02ae['outboundAbandonedCallsDay']+=0x1;_0xac56aa[_0xc7d6('0x6f')]=0xb;_0xac56aa[_0xc7d6('0x70')]=_0xc7d6('0xe9');_0xac56aa[_0xc7d6('0xeb')]+=0x1;_0xac56aa[_0xc7d6('0xd9')]+=0x1;_0x3641d1=_0x4c02ae['dialAbandonedRetryFrequency'];_0x3672b4=_0x4c02ae['callAdditionalPhoneAfterMin'];hopperUtils[_0xc7d6('0xcd')](_0xac56aa)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0xf3')));if(_0x36a8e3[_0xc7d6('0x191')](0xb,_0x29df3c,_0x4c02ae)&&!_0x2f1d3d){if(_0xac56aa[_0xc7d6('0xeb')]>=_0x4c02ae[_0xc7d6('0xed')]){_0x36a8e3['createStateFinal'](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1b7'));}else{_0x36a8e3[_0xc7d6('0x128')](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1b7'));}}break;case'20':_0x4c02ae[_0xc7d6('0x1b8')]+=0x1;_0xac56aa[_0xc7d6('0x6f')]=0x14;_0xac56aa[_0xc7d6('0x70')]=_0xc7d6('0x1b9');_0xac56aa[_0xc7d6('0x126')]+=0x1;_0xac56aa['countglobal']+=0x1;_0x3641d1=_0x4c02ae[_0xc7d6('0x19d')];_0x3672b4=_0x4c02ae[_0xc7d6('0xda')];ami['emit'](_0xc7d6('0x1ba'),ut[_0xc7d6('0x11b')](_0x29df3c,_0xc7d6('0x1bb')));hopperUtils['createHistory'](_0xac56aa)[_0xc7d6('0xa1')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x36a8e3[_0xc7d6('0x191')](0x14,_0x29df3c,_0x4c02ae)&&!_0x2f1d3d){if(_0xac56aa[_0xc7d6('0x126')]>=_0x4c02ae[_0xc7d6('0x1bc')]){_0x36a8e3[_0xc7d6('0x12f')](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1bd'));}else{_0x36a8e3[_0xc7d6('0x128')](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1bd'));}}break;default:_0x4c02ae[_0xc7d6('0x136')]+=0x1;_0xac56aa['state']=0xc;_0xac56aa[_0xc7d6('0x70')]=_0x169a72['reason'];_0x3641d1=_0x4c02ae[_0xc7d6('0x19d')];_0x3672b4=_0x4c02ae[_0xc7d6('0xda')];hopperUtils[_0xc7d6('0xcd')](_0xac56aa)[_0xc7d6('0xa1')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x36a8e3[_0xc7d6('0x191')](_0x169a72[_0xc7d6('0xca')],_0x29df3c,_0x4c02ae)&&!_0x2f1d3d){if(_0xac56aa[_0xc7d6('0x122')]+_0xac56aa[_0xc7d6('0x123')]+_0xac56aa[_0xc7d6('0x124')]+_0xac56aa[_0xc7d6('0x125')]+_0xac56aa[_0xc7d6('0xd8')]+_0xac56aa[_0xc7d6('0xeb')]+_0xac56aa[_0xc7d6('0x121')]+_0xac56aa[_0xc7d6('0x126')]>=_0x4c02ae['dialGlobalMaxRetry']){_0x36a8e3[_0xc7d6('0x128')](_0xac56aa,_0x52b225,_0xcbf8af,_0x169a72[_0xc7d6('0xca')]);}else{_0x36a8e3[_0xc7d6('0x12f')](_0xac56aa,_0x52b225,_0xcbf8af,_0x169a72[_0xc7d6('0xca')]);}}}})[_0xc7d6('0x3b')](function(){if(_0x2f1d3d){hopperUtils[_0xc7d6('0xe8')](_0xac56aa,_0x3641d1,_0x3672b4)[_0xc7d6('0x3b')](function(){return _0x52b225(0x1);});}});});};Dialer[_0xc7d6('0x18')]['stateGlobal']=function(_0x20ba36,_0x9577ad,_0x4fface,_0x55eeda){var _0x462e70=new Final(_0x20ba36);_0x462e70[_0xc7d6('0x6f')]=0xf;_0x462e70['statedesc']=_0xc7d6('0x1be');this[_0xc7d6('0x12f')](_0x462e70,_0x9577ad,_0x4fface,_0x55eeda);};Dialer[_0xc7d6('0x18')]['createStateFinal']=function(_0x42f794,_0x187384,_0x2bb079,_0x514c0a){hopperUtils[_0xc7d6('0xce')](_0x42f794)['then'](function(){return _0x187384(msgResponse('[callProgressDetecting]','Success',_0x514c0a));})['catch'](function(){return _0x2bb079(msgResponse('[moveContactManagedDialer][0]',_0xc7d6('0x96'),_0xc7d6('0x1bf')));});};Dialer[_0xc7d6('0x18')]['predictive']=function(_0x591fb2){var _0xb749e0=_0x591fb2['dialPredictiveOptimizationPercentage']/0x64;var _0x9adb1f=_0x591fb2['outboundDropCallsDayTimeout']/(_0x591fb2['outboundDropCallsDayTimeout']+_0x591fb2[_0xc7d6('0xc9')]);var _0x33ac52=Math[_0xc7d6('0x1c0')](_0x591fb2[_0xc7d6('0x1c1')]*(_0x591fb2[_0xc7d6('0x1c2')]/0x64));var _0x52b1f6=Math[_0xc7d6('0x1c0')](_0x591fb2[_0xc7d6('0x1c1')]*(_0x591fb2[_0xc7d6('0x1c3')]/0x64));var _0x2b9c44=_0x591fb2[_0xc7d6('0x13c')]+_0x591fb2[_0xc7d6('0x13e')];var _0x1cd41f=Math['floor'](_0x591fb2[_0xc7d6('0x54')]*_0x591fb2[_0xc7d6('0x58')]*_0x591fb2[_0xc7d6('0x1c4')]*_0x591fb2['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x591fb2[_0xc7d6('0x5d')])){if(!_[_0xc7d6('0x3d')](_0x591fb2[_0xc7d6('0x60')])){_0x591fb2['startPredictive']=undefined;loggerPredictive[_0xc7d6('0x65')](_0xc7d6('0x1c5'),_0xc7d6('0x1c6'));}if(!_[_0xc7d6('0x3d')](_0x591fb2[_0xc7d6('0x63')])){loggerPredictive[_0xc7d6('0x65')](_0xc7d6('0x1c5'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x591fb2[_0xc7d6('0x63')]);_0x591fb2['handlePredictive']=undefined;}_0x591fb2[_0xc7d6('0x5d')]=moment()[_0xc7d6('0x40')](_0xc7d6('0xc8'));loggerPredictive[_0xc7d6('0x44')](_0x591fb2[_0xc7d6('0x5e')],'collection\x20data\x20in\x20progressive\x20at',_0x591fb2[_0xc7d6('0x5d')]);this[_0xc7d6('0xb9')](_0x591fb2,0x1);}else if(ifInterval(_0x591fb2[_0xc7d6('0x1c7')],_0x591fb2[_0xc7d6('0x5d')])){this[_0xc7d6('0xb9')](_0x591fb2,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x591fb2[_0xc7d6('0x5d')],_0x591fb2[_0xc7d6('0x5e')]);_0x591fb2['erlangCalls']=0x0;_0x591fb2[_0xc7d6('0xd3')]=0x0;}else if(_0xb749e0<_0x9adb1f&&_0x591fb2[_0xc7d6('0x1c8')]===_0xc7d6('0x1c9')){clearPredictiveAttributes(_0x591fb2);loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x1ca'),_0xc7d6('0x1cb'),_0x9adb1f,'startProgressive',_0x591fb2[_0xc7d6('0x5e')]);}else if(_0x1cd41f<_0x591fb2[_0xc7d6('0xd3')]&&_0x591fb2[_0xc7d6('0x1c8')]==='dropRate'){clearPredictiveAttributes(_0x591fb2);loggerPredictive['info'](_0xc7d6('0x1cc'),_0xc7d6('0x1cd'),_0x1cd41f,_0xc7d6('0x1ce'),_0x591fb2[_0xc7d6('0xd3')],_0xc7d6('0x5d'),_0x591fb2[_0xc7d6('0x5e')]);}else if(!ifInterval(_0x591fb2[_0xc7d6('0x1c7')],_0x591fb2['startProgressive'])&&_['isUndefined'](_0x591fb2[_0xc7d6('0x60')])&&!_[_0xc7d6('0x3d')](_0x591fb2[_0xc7d6('0x5d')])){_0x591fb2[_0xc7d6('0x60')]=moment()[_0xc7d6('0x40')](_0xc7d6('0xc8'));loggerPredictive['info'](_0x591fb2[_0xc7d6('0x5e')],_0xc7d6('0x1cf'),_0x591fb2[_0xc7d6('0x60')]);hopperUtils[_0xc7d6('0x1d0')](_0x591fb2['dialPredictiveInterval'])[_0xc7d6('0x3b')](this[_0xc7d6('0x1d1')](_0x591fb2))[_0xc7d6('0x3b')](mergeDataErlangB(_0x591fb2))[_0xc7d6('0x3b')](this[_0xc7d6('0x1d2')](_0x591fb2))[_0xc7d6('0xa1')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x591fb2));}else if(!ifInterval(_0x591fb2[_0xc7d6('0x1c7')],_0x591fb2['startPredictive'])){_0x591fb2['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x591fb2[_0xc7d6('0x60')]=moment()[_0xc7d6('0x40')](_0xc7d6('0xc8'));loggerPredictive['info'](_0x591fb2[_0xc7d6('0x5e')],_0xc7d6('0x1d3'),_0x591fb2[_0xc7d6('0x60')]);clearInterval(_0x591fb2[_0xc7d6('0x63')]);_0x591fb2['handlePredictive']=undefined;hopperUtils[_0xc7d6('0x1d0')](_0x591fb2[_0xc7d6('0x1c7')])[_0xc7d6('0x3b')](this['getDataPredictive'](_0x591fb2))[_0xc7d6('0x3b')](mergeDataErlangB(_0x591fb2))['then'](this[_0xc7d6('0x1d2')](_0x591fb2))[_0xc7d6('0xa1')](loggerCatchPredictive(_0xc7d6('0x1d4'),_0x591fb2));}else if(_0x591fb2[_0xc7d6('0x1c1')]&&_0x2b9c44<_0x591fb2[_0xc7d6('0x1c1')]-_0x52b1f6){clearPredictiveAttributes(_0x591fb2);loggerPredictive[_0xc7d6('0x44')](_0x591fb2[_0xc7d6('0x5e')],_0xc7d6('0x1d5'),_0x2b9c44,_0xc7d6('0x1d6'),_0x591fb2['predictiveIntervalAvailable'],'-',_0x52b1f6,'=',_0x591fb2[_0xc7d6('0x1c1')]-_0x52b1f6,')');}else if(_0x591fb2[_0xc7d6('0x1c1')]&&_0x2b9c44>_0x591fb2[_0xc7d6('0x1c1')]+_0x33ac52){clearPredictiveAttributes(_0x591fb2);loggerPredictive[_0xc7d6('0x44')](_0x591fb2[_0xc7d6('0x5e')],_0xc7d6('0x1d5'),_0x2b9c44,_0xc7d6('0x1d7'),_0x591fb2['predictiveIntervalAvailable'],'+',_0x33ac52,'=',_0x591fb2[_0xc7d6('0x1c1')]+_0x33ac52,')');}};Dialer['prototype'][_0xc7d6('0x1d1')]=function(_0x8dfe90){var _0x219781=this;return function(_0x57341d){return new Promise(function(_0x5110b9,_0x47d186){_[_0xc7d6('0x5b')](_0x8dfe90,_0x57341d[0x0]);if(checkGetDataPredictive(_0x57341d[0x0])){var _0x40d7a3=_0x8dfe90[_0xc7d6('0x1c1')]=_0x8dfe90[_0xc7d6('0x13e')]+_0x8dfe90[_0xc7d6('0x13c')];var _0x341083=_0x8dfe90[_0xc7d6('0x1c7')]*0x3c;var _0x280b81=_0x57341d[0x0][_0xc7d6('0x4f')]+_0x57341d[0x0][_0xc7d6('0x4d')];var _0x14ecfa=(_0x57341d[0x0][_0xc7d6('0x48')]+_0x57341d[0x0][_0xc7d6('0x4a')]+_0x57341d[0x0][_0xc7d6('0x4c')])/_0x57341d[0x0][_0xc7d6('0x46')];_0x8dfe90[_0xc7d6('0x1c4')]=_0x14ecfa>0x0?_0x14ecfa:0x1;switch(_0x8dfe90['dialPredictiveOptimization']){case'dropRate':var _0x2e333c=_0x8dfe90[_0xc7d6('0x1d8')]/0x64;return _0x219781['abandonmentRate'](_0x40d7a3,_0x341083,_0x280b81,_0x14ecfa,_0x2e333c)[_0xc7d6('0x3b')](function(_0xf1892){return _0x5110b9(_0xf1892);});case _0xc7d6('0x1d9'):var _0x4557c9=_0x8dfe90[_0xc7d6('0x1d8')]/0x64;return _0x219781[_0xc7d6('0x1da')](_0x40d7a3,_0x341083,_0x280b81,_0x14ecfa,_0x4557c9)[_0xc7d6('0x3b')](function(_0x20d91a){return _0x5110b9(_0x20d91a);});default:return _0x47d186(msgResponse(_0xc7d6('0x1db'),_0xc7d6('0x96'),_0xc7d6('0x1dc')));}}else{return _0x47d186(msgResponse(_0xc7d6('0x1db'),_0xc7d6('0x96'),_0xc7d6('0x1dd')));}});};};Dialer[_0xc7d6('0x18')]['getDataPredictiveOld']=function(_0x3165f0){var _0x59650d=this;return function(_0x433ab3){return new Promise(function(_0xa2ede2,_0x2d3957){_[_0xc7d6('0x5b')](_0x3165f0,_0x433ab3[0x0]);if(checkGetDataPredictive(_0x433ab3[0x0])){loggerPredictive[_0xc7d6('0x44')](JSON[_0xc7d6('0x76')](_0x433ab3[0x0]));if(_0x3165f0[_0xc7d6('0x1c8')]===_0xc7d6('0x1c9')){return _0x59650d[_0xc7d6('0x153')](_0x3165f0['id'])[_0xc7d6('0x3b')](function(_0x2228ca){var _0x3a98e3=_0x3165f0[_0xc7d6('0x1de')]-_0x2228ca[0x0][_0xc7d6('0x1df')];var _0x5535fc=_0x3165f0['dialPredictiveInterval']*0x3c;var _0x57c78e=_0x433ab3[0x0][_0xc7d6('0x4f')]+_0x433ab3[0x0][_0xc7d6('0x4d')];var _0x25a323=(_0x433ab3[0x0][_0xc7d6('0x48')]+_0x433ab3[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x433ab3[0x0][_0xc7d6('0x4c')])/_0x433ab3[0x0][_0xc7d6('0x46')];var _0x15023e=_0x3165f0[_0xc7d6('0x1d8')]/0x64;_0x3165f0['predictiveIntervalPauses']=_0x2228ca[0x0]['outboundQueuePauses']||0x0;_0x3165f0['predictiveIntervalHitRate']=_0x25a323>0x0?_0x25a323:0x1;return _0x59650d['abandonmentRate'](_0x3a98e3,_0x5535fc,_0x57c78e,_0x25a323,_0x15023e);})[_0xc7d6('0x3b')](function(_0x176fe0){return _0xa2ede2(_0x176fe0);})[_0xc7d6('0xa1')](function(_0x1d7cbe){return _0x2d3957(msgResponse(_0xc7d6('0x1e0'),_0xc7d6('0x96'),JSON[_0xc7d6('0x76')](_0x1d7cbe)));});}if(_0x3165f0[_0xc7d6('0x1c8')]===_0xc7d6('0x1d9')){return _0x59650d[_0xc7d6('0x153')](_0x3165f0['id'])['then'](function(_0x271beb){var _0x36d179=_0x3165f0[_0xc7d6('0x1de')]-_0x271beb[0x0][_0xc7d6('0x1df')];var _0x1993ff=_0x3165f0[_0xc7d6('0x1c7')]*0x3c;var _0x40fcb5=_0x433ab3[0x0][_0xc7d6('0x4f')]+_0x433ab3[0x0][_0xc7d6('0x4d')];var _0x6bd14f=(_0x433ab3[0x0][_0xc7d6('0x48')]+_0x433ab3[0x0][_0xc7d6('0x4a')]+_0x433ab3[0x0][_0xc7d6('0x4c')])/_0x433ab3[0x0]['predictiveIntervalTotalCalls'];var _0x9585f7=_0x3165f0[_0xc7d6('0x1d8')]/0x64;_0x3165f0[_0xc7d6('0x1e1')]=_0x271beb[0x0][_0xc7d6('0x1df')]||0x0;_0x3165f0[_0xc7d6('0x1c4')]=_0x6bd14f>0x0?_0x6bd14f:0x1;return _0x59650d[_0xc7d6('0x1da')](_0x36d179,_0x1993ff,_0x40fcb5,_0x6bd14f,_0x9585f7);})[_0xc7d6('0x3b')](function(_0x31253e){return _0xa2ede2(_0x31253e);})['catch'](function(_0x4af921){return _0x2d3957(msgResponse(_0xc7d6('0x1e0'),_0xc7d6('0x96'),JSON['stringify'](_0x4af921)));});}}else{return _0x2d3957(msgResponse(_0xc7d6('0x1db'),'Failure',_0xc7d6('0x1dd')));}});};};Dialer['prototype'][_0xc7d6('0x1d2')]=function(_0x3e139e){var _0x14107c=this;return function(){var _0x15b5c4=0x0;var _0x3dd79c=Math[_0xc7d6('0x1e2')](_0x3e139e['erlangCallToSecond']*0x3e8);if(_0x3dd79c>0x0){_0x3dd79c=_0x3dd79c<0x64?0x64:_0x3dd79c;loggerPredictive[_0xc7d6('0x44')](_0x3e139e[_0xc7d6('0x5e')],'one\x20call\x20every:',_0x3dd79c,_0xc7d6('0x1e3'));_0x3e139e[_0xc7d6('0x63')]=setInterval(function(){_0x14107c[_0xc7d6('0x63')](_0x3e139e);loggerPredictiveCalls['info']('[handlePredictive]',_0x15b5c4+=0x1);},_0x3dd79c);}else{loggerPredictive['info'](_0x3e139e['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xc7d6('0x18')]['checkContactBlack']=function(_0x14d01c,_0x314a07){var _0x59357c=this;return function(_0x523392){if(_[_0xc7d6('0x7b')](_0x523392)){if(_[_0xc7d6('0xf9')](_0x314a07[_0xc7d6('0x1e4')])||!_0x314a07[_0xc7d6('0x1e5')]){if(_0x14d01c[_0xc7d6('0xb6')]==='booked'){_0x14d01c['queueStatusComplete']=_[_0xc7d6('0x3d')](_0x14d01c[_0xc7d6('0x73')])?!![]:_0x14d01c[_0xc7d6('0x73')];var _0x1ecc79=uuid['v4']();_0x59357c[_0xc7d6('0xf4')][_0x1ecc79]=new Action(_0x14d01c,_0x314a07,_0x1ecc79);loggerBooked[_0xc7d6('0x44')]('[booked][checkContactBlack]',_0x1ecc79,_0xc7d6('0x1e6'),JSON['stringify'](_0x14d01c[_0xc7d6('0x73')]),'Queue:\x20',_0x14d01c[_0xc7d6('0x5e')]);if(_0x14d01c[_0xc7d6('0x73')]){_0x14d01c[_0xc7d6('0x73')]=![];_0x59357c[_0xc7d6('0x25')][_0x59357c['actions'][_0x1ecc79][_0xc7d6('0xc6')]]=[];ami['Action']({'actionid':_0x1ecc79,'action':'queuestatus','queue':_0x14d01c[_0xc7d6('0x5e')]})[_0xc7d6('0xa1')](function(){_0x59357c['updateOriginated'](_0x14d01c);hopperUtils[_0xc7d6('0xef')]({'active':![],'ContactId':_0x59357c['actions'][_0x1ecc79][_0xc7d6('0xf0')],'ListId':_0x59357c[_0xc7d6('0xf4')][_0x1ecc79]['ListId'],'VoiceQueueId':_0x59357c['actions'][_0x1ecc79]['VoiceQueueId']||undefined,'CampaignId':_0x59357c[_0xc7d6('0xf4')][_0x1ecc79][_0xc7d6('0xe3')]||undefined})[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x1e7')));delete _0x59357c[_0xc7d6('0xf4')][_0x1ecc79];});}else{loggerBooked[_0xc7d6('0x44')](_0xc7d6('0x1e8'),JSON[_0xc7d6('0x76')](_0x14d01c[_0xc7d6('0x73')]),'Queue:\x20',_0x14d01c[_0xc7d6('0x5e')]);_0x59357c['updateOriginated'](_0x14d01c);hopperUtils[_0xc7d6('0xef')]({'active':![],'ContactId':_0x59357c['actions'][_0x1ecc79][_0xc7d6('0xf0')],'ListId':_0x59357c[_0xc7d6('0xf4')][_0x1ecc79]['ListId'],'VoiceQueueId':_0x59357c[_0xc7d6('0xf4')][_0x1ecc79][_0xc7d6('0xf1')]||undefined,'CampaignId':_0x59357c[_0xc7d6('0xf4')][_0x1ecc79][_0xc7d6('0xe3')]||undefined})[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x1e7')));delete _0x59357c[_0xc7d6('0xf4')][_0x1ecc79];}}else{return _0x59357c[_0xc7d6('0x1e9')](_0x14d01c,_0x314a07);}}else{if(utils[_0xc7d6('0x5c')](undefined,_0x314a07['scheduledat'])<_0x14d01c['dialRecallMeTimeout']*0x3c){if(_0x314a07[_0xc7d6('0x14c')]&&!_0x314a07[_0xc7d6('0x14c')][_0xc7d6('0x1ea')]){_0x59357c[_0xc7d6('0x1d')][_0xc7d6('0x1eb')](_0x314a07['id'])[_0xc7d6('0x1b')](function(){_0x59357c[_0xc7d6('0xc5')](_0x14d01c);});}else{hopperUtils[_0xc7d6('0x1ec')]({'active':![]},_0x314a07['id'],0x1)[_0xc7d6('0x1b')](function(){_0x59357c[_0xc7d6('0xc5')](_0x14d01c);});}}else{_0x14d01c['outboundReCallsDay']+=0x1;_0x59357c[_0xc7d6('0xc5')](_0x14d01c);if(_0x14d01c[_0xc7d6('0x1ed')]){hopperUtils[_0xc7d6('0xef')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x314a07[_0xc7d6('0xf0')],'ListId':_0x314a07[_0xc7d6('0xe2')],'VoiceQueueId':_0x314a07[_0xc7d6('0xf1')]||undefined,'CampaignId':_0x314a07['CampaignId']||undefined})[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x1ee')));hopperUtils[_0xc7d6('0xcd')](createObjHistory(_0x14d01c,_0x314a07,utils[_0xc7d6('0x69')][_0xc7d6('0x1ef')],0x17,_0xc7d6('0x1f0')))[_0xc7d6('0xa1')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x59357c[_0xc7d6('0x11d')](createObjHistory(_0x14d01c,_0x314a07,utils[_0xc7d6('0x69')][_0xc7d6('0x1f1')],0x16,_0xc7d6('0x1f2')),_0xc7d6('0x1f3'),_0xc7d6('0x1f4'));}}}}else{_0x14d01c[_0xc7d6('0x1f5')]+=0x1;_0x59357c[_0xc7d6('0x11d')](createObjHistory(_0x14d01c,_0x314a07,utils[_0xc7d6('0x69')][_0xc7d6('0x1f6')],0xd,_0xc7d6('0x1f7')),_0xc7d6('0x1f8'),_0xc7d6('0x1f9'));throw'inBlackList';}};};Dialer[_0xc7d6('0x18')][_0xc7d6('0x15b')]=function(_0x3c5e66){var _0x5d3249=this;var _0x4dfd5e=_0x3c5e66[_0xc7d6('0x1fa')]-_0x3c5e66['originated']-_0x3c5e66['temp'];emitCampaignSummary(_0x3c5e66);if(_0x4dfd5e>0x0){if(_0x4dfd5e>this[_0xc7d6('0x21')]){_0x4dfd5e=this[_0xc7d6('0x21')];}_0x3c5e66[_0xc7d6('0x1fb')]+=_0x4dfd5e;hopperUtils[_0xc7d6('0x1fc')](_0x3c5e66['id'],_0x4dfd5e,_0x3c5e66['dialOrderByScheduledAt'],_0x3c5e66)[_0xc7d6('0x3b')](function(_0x5b8dce){_0x3c5e66[_0xc7d6('0x1fb')]-=_0x4dfd5e;_0x3c5e66['temp']=_0x3c5e66[_0xc7d6('0x1fb')]>0x0?_0x3c5e66[_0xc7d6('0x1fb')]:0x0;if(!utils[_0xc7d6('0x1fd')](_0x5b8dce)){_0x3c5e66['message']=utils[_0xc7d6('0x69')][_0xc7d6('0x6d')];logger[_0xc7d6('0x44')](_0xc7d6('0x1fe')+_0x3c5e66[_0xc7d6('0x5e')]);}else{_0x3c5e66[_0xc7d6('0x81')]+=_0x5b8dce[_0xc7d6('0x99')];_0x3c5e66[_0xc7d6('0x68')]=utils[_0xc7d6('0x69')]['RUNNING'];for(var _0x70f295=0x0;_0x70f295<_0x5b8dce['length'];_0x70f295+=0x1){_0x3c5e66['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x5b8dce[_0x70f295])||_[_0xc7d6('0xf9')](_0x5b8dce[_0x70f295][_0xc7d6('0x178')])||_[_0xc7d6('0xf9')](_0x5b8dce[_0x70f295][_0xc7d6('0x15f')])){_0x5d3249[_0xc7d6('0x157')](_0xc7d6('0x1ff'),_0x3c5e66,_0x5b8dce[_0x70f295]);}else{hopperUtils[_0xc7d6('0x200')](_['pick'](_0x5b8dce[_0x70f295],['CampaignId',_0xc7d6('0x15f')]))['then'](_0x5d3249[_0xc7d6('0x201')](_0x3c5e66,_0x5b8dce[_0x70f295]))[_0xc7d6('0xa1')](_0x5d3249[_0xc7d6('0x156')]('[actionOriginateIvr]\x20',_0x3c5e66));}}}})['catch'](loggerGetContactDialer(_0xc7d6('0x202'),_0x3c5e66,_0x4dfd5e));}};Dialer['prototype']['handlePower']=function(_0x120708,_0x4cb4fd){var _0x2bc820=this;var _0x19aac3=[];if(_0x4cb4fd<0x1||_0x120708[_0xc7d6('0xb6')]===_0xc7d6('0x7')){_0x4cb4fd=0x1;}var _0x20d3dd=Math[_0xc7d6('0x1e2')](_0x120708['available']*_0x4cb4fd)-_0x120708[_0xc7d6('0x81')]-_0x120708['temp'];if(_0x120708[_0xc7d6('0x203')]>0x0){var _0x295c89=_0x120708[_0xc7d6('0x203')]-_0x120708[_0xc7d6('0x81')]-_0x120708[_0xc7d6('0x13e')]-_0x120708[_0xc7d6('0x1fb')]-_0x120708[_0xc7d6('0x204')];if(_0x20d3dd>_0x295c89){_0x20d3dd=_0x295c89;}}if(_0x20d3dd>0x0){if(_0x120708[_0xc7d6('0xb6')]===_0xc7d6('0x7')){_0x20d3dd=0x1;}if(_0x20d3dd>this['maxNumberOriginate']){_0x20d3dd=this[_0xc7d6('0x21')];}_0x120708[_0xc7d6('0x1fb')]+=_0x20d3dd;for(var _0x551669 in this[_0xc7d6('0x1f')]){if(typeof this[_0xc7d6('0x1f')][_0x551669]!==_0xc7d6('0xaf')){if(this['agents'][_0x551669][_0xc7d6('0x6f')]===_0xc7d6('0x205')&&this[_0xc7d6('0x1f')][_0x551669]['status']===_0xc7d6('0x149')){_0x19aac3[_0xc7d6('0x9a')](this['agents'][_0x551669]['id']);}}}hopperUtils[_0xc7d6('0x206')](_0x120708,_0x19aac3,_0x20d3dd)[_0xc7d6('0x3b')](function(_0x13b15c){_0x120708['temp']-=_0x20d3dd;_0x120708[_0xc7d6('0x1fb')]=_0x120708[_0xc7d6('0x1fb')]>0x0?_0x120708['temp']:0x0;if(!utils[_0xc7d6('0x1fd')](_0x13b15c)){hopperUtils[_0xc7d6('0x207')](_0x120708)[_0xc7d6('0x3b')](sendMessageReschedule(_0x120708))[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x208')));}else{_0x120708[_0xc7d6('0x81')]+=_0x13b15c[_0xc7d6('0x99')];_0x120708['message']=_0x120708[_0xc7d6('0xb6')]===_0xc7d6('0x7')?utils[_0xc7d6('0x69')]['ACTIVE']:utils[_0xc7d6('0x69')][_0xc7d6('0x209')];for(var _0x3bfd19=0x0;_0x3bfd19<_0x13b15c[_0xc7d6('0x99')];_0x3bfd19+=0x1){if(_[_0xc7d6('0xf9')](_0x13b15c[_0x3bfd19])||_[_0xc7d6('0xf9')](_0x13b15c[_0x3bfd19][_0xc7d6('0x178')])||_[_0xc7d6('0xf9')](_0x13b15c[_0x3bfd19][_0xc7d6('0x15f')])){_0x2bc820[_0xc7d6('0x157')](_0xc7d6('0x1ff'),_0x120708,_0x13b15c[_0x3bfd19]);}else{hopperUtils[_0xc7d6('0x20a')](_[_0xc7d6('0x77')](_0x13b15c[_0x3bfd19],[_0xc7d6('0xf1'),'phone']))[_0xc7d6('0x3b')](_0x2bc820[_0xc7d6('0x201')](_0x120708,_0x13b15c[_0x3bfd19]))[_0xc7d6('0xa1')](_0x2bc820[_0xc7d6('0x156')](_0xc7d6('0x1ff'),_0x120708));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x120708,_0x20d3dd));}};Dialer[_0xc7d6('0x18')][_0xc7d6('0x63')]=function(_0x2c83e5){if(_0x2c83e5[_0xc7d6('0x203')]>0x0){var _0x3b239f=_0x2c83e5[_0xc7d6('0x203')]-_0x2c83e5[_0xc7d6('0x81')]-_0x2c83e5[_0xc7d6('0x13e')];if(_0x3b239f>0x0){this[_0xc7d6('0x20b')](_0x2c83e5);}else{loggerPredictiveCalls[_0xc7d6('0x44')]('[handlePredictive][limitChannel]');}}else{this[_0xc7d6('0x20b')](_0x2c83e5);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x48d262){var _0x52c927=this;var _0x2cec6b=[];_0x48d262['originated']+=0x1;for(var _0xa42411 in this['agents']){if(typeof this[_0xc7d6('0x1f')][_0xa42411]!==_0xc7d6('0xaf')){if(this[_0xc7d6('0x1f')][_0xa42411][_0xc7d6('0x6f')]===_0xc7d6('0x205')&&this[_0xc7d6('0x1f')][_0xa42411][_0xc7d6('0x8a')]===_0xc7d6('0x149')){_0x2cec6b[_0xc7d6('0x9a')](this[_0xc7d6('0x1f')][_0xa42411]['id']);}}}return this[_0xc7d6('0x206')](_0x48d262['id'],_0x2cec6b,0x1,_0x48d262[_0xc7d6('0x20c')],_0x48d262)[_0xc7d6('0x3b')](function(_0x5723a0){if(!utils[_0xc7d6('0x1fd')](_0x5723a0)){utils[_0xc7d6('0x20d')](_0x48d262,0x1,0x0);return hopperUtils[_0xc7d6('0x207')](_0x48d262)[_0xc7d6('0x3b')](sendMessageReschedule(_0x48d262))[_0xc7d6('0xa1')](loggerCatch('[countReScheduled]\x20'));}else{_0x48d262['message']=utils[_0xc7d6('0x69')][_0xc7d6('0x209')];if(_['isNil'](_0x5723a0[0x0])||_['isNil'](_0x5723a0[0x0]['Contact'])||_[_0xc7d6('0xf9')](_0x5723a0[0x0]['phone'])){_0x52c927[_0xc7d6('0x157')]('[actionOriginate]\x20',_0x48d262,_0x5723a0[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0xc7d6('0x77')](_0x5723a0[0x0],[_0xc7d6('0xf1'),_0xc7d6('0x15f')]))[_0xc7d6('0x3b')](_0x52c927[_0xc7d6('0x201')](_0x48d262,_0x5723a0[0x0]))[_0xc7d6('0xa1')](_0x52c927[_0xc7d6('0x156')](_0xc7d6('0x20e'),_0x48d262));}}})[_0xc7d6('0xa1')](loggerGetContactDialer(_0xc7d6('0x20f'),_0x48d262,0x1));};Dialer[_0xc7d6('0x18')][_0xc7d6('0x210')]=function(_0x3f32e5,_0x256000,_0x46c7e4,_0x5125c7,_0x5bf7c5,_0x50e4bc){loggerPredictive[_0xc7d6('0x44')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive['info'](_0xc7d6('0x211'),_0x3f32e5);loggerPredictive[_0xc7d6('0x44')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x256000);loggerPredictive[_0xc7d6('0x44')]('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',_0x46c7e4);loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x212'),_0x5125c7);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5bf7c5);loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x5a'));return new Promise(function(_0x44c1c8,_0x5b4bc8){if(_0x3f32e5<=0x0||isNaN(_0x3f32e5)){return _0x5b4bc8(msgResponse(_0xc7d6('0x213'),_0xc7d6('0x86'),'m\x20=\x20'+_0x3f32e5));}if(_0x46c7e4<=0x0||isNaN(_0x46c7e4)){return _0x5b4bc8(msgResponse(_0xc7d6('0x213'),_0xc7d6('0x86'),_0xc7d6('0x214')+_0x46c7e4));}if(_0x5125c7<=0x0||isNaN(_0x5125c7)){return _0x5b4bc8(msgResponse(_0xc7d6('0x213'),_0xc7d6('0x86'),'p\x20=\x20'+_0x5125c7));}if(_0x256000<=0x0||isNaN(_0x256000)){return _0x5b4bc8(msgResponse('[abandonmentRate]',_0xc7d6('0x86'),_0xc7d6('0x215')+_0x256000));}if(_0x5bf7c5<=0x0||isNaN(_0x5bf7c5)){return _0x5b4bc8(msgResponse('[abandonmentRate]',_0xc7d6('0x86'),_0xc7d6('0x216')+_0x5bf7c5));}_0x50e4bc=_0x50e4bc||0x0;var _0x54507e=0x1/_0x46c7e4;var _0x1c6223=0x0;var _0x28e56a=0x0;var _0x158b89=0x0;var _0xbd28ba=0x0;for(var _0x311bba=0x0;_0x158b89<_0x5bf7c5;_0x311bba+=0x1){_0x28e56a=_0x311bba/_0x256000;_0x1c6223=(_0x5125c7*_0x28e56a+_0x50e4bc)/_0x54507e;_0x158b89=utils[_0xc7d6('0x217')](_0x1c6223,_0x3f32e5);_0xbd28ba=_0x1c6223/_0x3f32e5*(0x1-utils[_0xc7d6('0x217')](_0x1c6223,_0x3f32e5));}return _0x44c1c8({'erlangCalls':_0x311bba,'erlangCallToSecond':_0x256000/_0x311bba,'erlangAbandonmentRate':_0x158b89,'erlangBusyFactor':_0xbd28ba});});};Dialer[_0xc7d6('0x18')][_0xc7d6('0x1da')]=function(_0x517b26,_0x5502c1,_0x54ed67,_0xcaa182,_0x5dd293,_0xe5098f){loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x218'));loggerPredictive['info'](_0xc7d6('0x211'),_0x517b26);loggerPredictive['info'](_0xc7d6('0x219'),_0x5502c1);loggerPredictive[_0xc7d6('0x44')]('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',_0x54ed67);loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x212'),_0xcaa182);loggerPredictive['info'](_0xc7d6('0x21a'),_0x5dd293);loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x5a'));return new Promise(function(_0x2b747e,_0x29ee25){if(_0x517b26<=0x0||isNaN(_0x517b26)){return _0x29ee25(msgResponse('[busyFactor]','Error','m\x20=\x20'+_0x517b26));}if(_0x54ed67<=0x0||isNaN(_0x54ed67)){return _0x29ee25(msgResponse(_0xc7d6('0x21b'),_0xc7d6('0x86'),_0xc7d6('0x214')+_0x54ed67));}if(_0xcaa182<=0x0||isNaN(_0xcaa182)){return _0x29ee25(msgResponse(_0xc7d6('0x21b'),_0xc7d6('0x86'),_0xc7d6('0x21c')+_0xcaa182));}if(_0x5502c1<=0x0||isNaN(_0x5502c1)){return _0x29ee25(msgResponse(_0xc7d6('0x21b'),'Error',_0xc7d6('0x215')+_0x5502c1));}if(_0x5dd293<=0x0||isNaN(_0x5dd293)){return _0x29ee25(msgResponse(_0xc7d6('0x21b'),_0xc7d6('0x86'),_0xc7d6('0x21d')+_0x5dd293));}_0xe5098f=_0xe5098f||0x0;var _0x2de33d=0x1/_0x54ed67;var _0x30866a=0x0;var _0x4c68f1=0x0;var _0xec5776=0x0;var _0x10b32f=0x0;for(var _0x133724=0x0;_0x10b32f<_0x5dd293;_0x133724+=0x1){_0x4c68f1=_0x133724/_0x5502c1;_0x30866a=(_0xcaa182*_0x4c68f1+_0xe5098f)/_0x2de33d;_0xec5776=utils[_0xc7d6('0x217')](_0x30866a,_0x517b26);_0x10b32f=_0x30866a/_0x517b26*(0x1-utils[_0xc7d6('0x217')](_0x30866a,_0x517b26));}return _0x2b747e({'erlangCalls':_0x133724,'erlangCallToSecond':_0x5502c1/_0x133724,'erlangAbandonmentRate':_0xec5776,'erlangBusyFactor':_0x10b32f});});};module['exports']=Dialer; \ No newline at end of file +var _0x0fad=['format','campaign:ivr:%s','campaign:save','originated','sendMessageOneNotActive','is\x20not\x20active','is\x20disactive','Error','isTrunkReachable','active','SIP/%s','status','unmonitored','checkIsTrunkReachable','Trunk','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','ifTime','timezones','UNKNOWN_TIMEZONE','isArray','length','push','command','interval','then','content','indexOf','catch','iftime\x20%s,%s','true','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','loopCampaigns','resetActiveCalls','syncCampaigns','undefined','isIVRCampaign','resolve','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','dialPowerLevel','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','queue','uniqueid','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','syncAgentComplete','outboundAnswerCallsDay','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','getSeconds','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','statedesc','Drop','dropreason','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','add','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','Abandoned','countabandonedretry','verifyAdditionalPhones','dialAbandonedMaxRetry','rescheduleContact','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','channel','actionid','strategy','rrmemory','isNil','locked','paused','stateinterface','idHopper','roundrobin','preview','run','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','responsetime','getQueue','response','Success','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','value','outboundAnswerAgiCallsDay','HangupInAMD','custom:amd','buildObj','saveInDb','[syncHangupInAMD]','Machine','membername','AMD','amd','countbusyretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','dialAMDActive','HANGUP','[syncHangupInAMDIvr][createHistory]','[syncAgentComplete][createHistory][0]','countcongestionretry','countagentrejectretry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','outboundUnknownCallsDay','cause-txt','running','statusMessage','getQueueCampaignStatusMessage','startProgressive','available','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','syncQueueSummaryComplete','throttle','dialPreviewRecallmeReminder','filter','online','reachable','map','Agent','user:%s','user:dialPreviewRecallReminder','clearZombieChannels','[actions]','enqueue','Action','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','checkPreviewRecallReminder','handlePreviewRecallNotifications','handleIvr','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','Contact','tags','createdAt','%s%s','XMD-','toUpper','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','TrunkBackup','callerid','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','dialPrefix','trim','dialCutDigit','SIP/%s/%s%s','substring','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAgentRejectRetryFrequency','callProgressDetecting','[callProgressDetecting]','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','nosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','NoAnswer','[syncAgentComplete][createHistory][3]','createStateFinal','reason\x203\x20ringing\x20no\x20answer','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','talking','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','busyFactor','[getDataPredictive]','getDataPredictiveOld','getVoiceQueueRtPauses','loggedIn','predictiveIntervalPauses','outboundQueuePauses','abandonmentRate','[CatchErlangB]','agentBusyFactor','check\x20failure','erlangCallToSecond','one\x20call\x20every:','milliseconds','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','temp','getContactDialerIvr','dialOrderByScheduledAt','checkContactEmpty','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','floor','dialLimitQueue','not_inuse','[countReScheduled]\x20','RUNNING','checkIsBlackList','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','countReScheduled','emptyContact','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','erlangb','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','uuid','./utils','../preview/util/util','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','defaults','redis','../rpc/cmHopper','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','custom:queuesummarycomplete','hangup','newexten','varset','syncVarSet','syncQueueStatusComplete','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','name','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','predictiveIntervalAvgTalktime','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','startProgressive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','\x20INTERVAL_IS_NULL','NULL_INTERVAL','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active'];(function(_0x4c7ffe,_0x51381d){var _0x3be00f=function(_0x191566){while(--_0x191566){_0x4c7ffe['push'](_0x4c7ffe['shift']());}};_0x3be00f(++_0x51381d);}(_0x0fad,0x1a2));var _0xd0fa=function(_0x45161c,_0x5494fc){_0x45161c=_0x45161c-0x0;var _0x186581=_0x0fad[_0x45161c];return _0x186581;};'use strict';var util=require(_0xd0fa('0x0'));var _=require(_0xd0fa('0x1'));var uuid=require(_0xd0fa('0x2'));var moment=require('moment');var rr=require('rr');var Redis=require('ioredis');var utils=require(_0xd0fa('0x3'));var hopperUtils=require('./utils/hopper');var ut=require(_0xd0fa('0x4'));var config=require('../../../config/environment/');var logger=require(_0xd0fa('0x5'))(_0xd0fa('0x6'));var loggerBooked=require('../../../config/logger')(_0xd0fa('0x7'));var loggerPredictive=require('../../../config/logger')(_0xd0fa('0x8'));var loggerPredictiveCalls=require(_0xd0fa('0x5'))(_0xd0fa('0x9'));var loggerSyncQueueSummary=require(_0xd0fa('0x5'))(_0xd0fa('0xa'));var ami=require('../ami');config['redis']=_[_0xd0fa('0xb')](config[_0xd0fa('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd0fa('0xc')]));var cmHopper=require(_0xd0fa('0xd'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0xd0fa('0xe'));var Interval=require(_0xd0fa('0xf'));var Action=require(_0xd0fa('0x10'));var History=require(_0xd0fa('0x11'));var Final=require(_0xd0fa('0x12'));var AgentComplete=require(_0xd0fa('0x13'));var QueueCallerAbandon=require(_0xd0fa('0x14'));var Hangup=require(_0xd0fa('0x15'));var ipAgi=process['env'][_0xd0fa('0x16')]||_0xd0fa('0x17');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xd0fa('0x18')]['enqueue']=function(_0x5b0e1f){this[_0xd0fa('0x19')]=this[_0xd0fa('0x19')]?this[_0xd0fa('0x19')][_0xd0fa('0x1a')](_0x5b0e1f):_0x5b0e1f();};function Dialer(_0x226c7a,_0x5cd12c){this[_0xd0fa('0x1b')]=new Sequence();this['preview']=_0x5cd12c;this[_0xd0fa('0x1c')]=_0x226c7a[_0xd0fa('0x1c')];this[_0xd0fa('0x1d')]=_0x226c7a['campaigns'];this[_0xd0fa('0x1e')]=_0x226c7a[_0xd0fa('0x1e')];this[_0xd0fa('0x1f')]=_0x226c7a[_0xd0fa('0x1f')];this[_0xd0fa('0x20')]=config[_0xd0fa('0x20')]||0x2;this[_0xd0fa('0x21')]={};this[_0xd0fa('0x22')]={};this[_0xd0fa('0x23')]={};this[_0xd0fa('0x24')]={};this[_0xd0fa('0x25')]={};this[_0xd0fa('0x26')]={};this['startProgressive']={};this['ivrOriginated']={};this[_0xd0fa('0x27')]={};this[_0xd0fa('0x28')]={};this[_0xd0fa('0x29')]={};ami['on'](_0xd0fa('0x2a'),this[_0xd0fa('0x2b')][_0xd0fa('0x2c')](this));ami['on']('queuecallerabandon',this[_0xd0fa('0x2d')]['bind'](this));ami['on'](_0xd0fa('0x2e'),this[_0xd0fa('0x2f')][_0xd0fa('0x2c')](this));ami['on'](_0xd0fa('0x30'),this['syncAgentComplete'][_0xd0fa('0x2c')](this));ami['on'](_0xd0fa('0x31'),this[_0xd0fa('0xa')][_0xd0fa('0x2c')](this));ami['on'](_0xd0fa('0x32'),this['syncQueueSummaryComplete'][_0xd0fa('0x2c')](this));ami['on'](_0xd0fa('0x33'),this['syncHangup'][_0xd0fa('0x2c')](this));ami['on'](_0xd0fa('0x34'),this['syncNewExten'][_0xd0fa('0x2c')](this));ami['on'](_0xd0fa('0x35'),this[_0xd0fa('0x36')]['bind'](this));ami['on']('queuemember',this['syncQueueMember'][_0xd0fa('0x2c')](this));ami['on']('queuestatuscomplete',this[_0xd0fa('0x37')]['bind'](this));this['loopCampaigns']();this[_0xd0fa('0x38')]();RpcSetting[_0xd0fa('0x39')]()['then'](function(_0x3c15d8){previewRecallmeReminderInterval=_0x3c15d8[_0xd0fa('0x3a')];});}function isNotNull(_0xfa28ec){return _0xfa28ec!==null&&!_['isUndefined'](_0xfa28ec);}function msgResponse(_0x1ea404,_0x1784db,_0x146040){return{'action':_0x1ea404,'response':_0x1784db,'message':_0x146040,'stack':_0x146040};}function emit(_0x11acfa,_0x54ffaf,_0x512db1){io['to'](_0x11acfa)[_0xd0fa('0x3b')](_0x54ffaf,_0x512db1);}function emitOutboundVoiceQueueSummary(_0x8edca){if(_0x8edca[_0xd0fa('0x3c')]===_0xd0fa('0x3d')){logger[_0xd0fa('0x3e')](_0xd0fa('0x3f'),util[_0xd0fa('0x40')](_0x8edca,{'showHidden':![],'depth':null}));emit(util['format']('voice:queue:%s',_0x8edca[_0xd0fa('0x41')]),_0xd0fa('0x42'),_0x8edca);}}function checkGetDataPredictive(_0x5b18f5){if(isNotNull(_0x5b18f5)&&!_[_0xd0fa('0x43')](_0x5b18f5)){loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x45'));loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x46'),_0x5b18f5[_0xd0fa('0x47')]);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x48'),_0x5b18f5[_0xd0fa('0x49')]);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x4a'),_0x5b18f5['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x4b'),_0x5b18f5[_0xd0fa('0x4c')]);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x4d'),_0x5b18f5['predictiveIntervalAvgHoldtime']);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5b18f5[_0xd0fa('0x4e')]);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x4f'));if(_0x5b18f5[_0xd0fa('0x47')]>0x0){if(!_[_0xd0fa('0x50')](_0x5b18f5[_0xd0fa('0x4e')])&&_0x5b18f5[_0xd0fa('0x4e')]>0x0){return!![];}loggerPredictive['info'](_0xd0fa('0x51'));if(!_[_0xd0fa('0x50')](_0x5b18f5['predictiveIntervalAvgHoldtime'])&&_0x5b18f5['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x52'));}else{loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x53'));}}else{loggerPredictive[_0xd0fa('0x44')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x289dad){return function(_0x54e9f0){loggerPredictive['info'](_0xd0fa('0x54'));loggerPredictive['info'](_0xd0fa('0x55'),_0x54e9f0[_0xd0fa('0x56')]);loggerPredictive[_0xd0fa('0x44')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x54e9f0['erlangCallToSecond']);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x57'),_0x54e9f0[_0xd0fa('0x58')]);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x59'),_0x54e9f0[_0xd0fa('0x5a')]);loggerPredictive['info'](_0xd0fa('0x57'),_0x54e9f0[_0xd0fa('0x58')]);loggerPredictive[_0xd0fa('0x44')]('---------------------------');_[_0xd0fa('0x5b')](_0x289dad,_0x54e9f0);};}function ifInterval(_0xa158d3,_0x37eb96){if(_['isUndefined'](_0x37eb96)){return![];}return utils['getSeconds'](undefined,_0x37eb96)<_0xa158d3*0x3c;}function clearPredictiveAttributes(_0x253d8f){if(_0x253d8f['startProgressive']){_0x253d8f['startProgressive']=undefined;loggerPredictive['debug'](_0x253d8f[_0xd0fa('0x41')],_0xd0fa('0x5c'));}if(_0x253d8f[_0xd0fa('0x26')]){_0x253d8f[_0xd0fa('0x26')]=undefined;loggerPredictive[_0xd0fa('0x3e')](_0x253d8f[_0xd0fa('0x41')],'startPredictive\x20value\x20cleared');}if(_0x253d8f[_0xd0fa('0x5d')]){clearInterval(_0x253d8f['handlePredictive']);_0x253d8f[_0xd0fa('0x5d')]=undefined;loggerPredictive[_0xd0fa('0x3e')](_0x253d8f['name'],_0xd0fa('0x5e'));}}function loggerCatchPredictive(_0x4374f2,_0x78da70){return function(_0x4eedb5){loggerPredictive[_0xd0fa('0x5f')](_0x78da70[_0xd0fa('0x41')],_0x4374f2);loggerPredictive['error'](_0x4eedb5[_0xd0fa('0x60')]);clearPredictiveAttributes(_0x78da70);};}function loggerCatch(_0x3305d4){return function(_0x3a0130){logger['error'](_0x3305d4,util[_0xd0fa('0x40')](_0x3a0130,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x315a34,_0xb83f4,_0x246a49){return function(_0xf88fcb){utils['checkContactLowerLimitOriginate'](_0xb83f4,_0x246a49,0x0);logger[_0xd0fa('0x5f')](_0x315a34,util['inspect'](_0xf88fcb,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4d58f9){return function(_0x328ba9){if(isNotNull(_0x328ba9)&&isNotNull(_0x328ba9[0x0])){if(_0x328ba9[0x0][_0xd0fa('0x61')]>0x0){_0x4d58f9[_0xd0fa('0x62')]=utils[_0xd0fa('0x63')][_0xd0fa('0x64')];logger['info']('[getContactDialer2][ReScheduled]'+_0x4d58f9[_0xd0fa('0x41')],_0x328ba9[0x0][_0xd0fa('0x61')],_0xd0fa('0x65'));}else{_0x4d58f9[_0xd0fa('0x62')]=utils['CAMPAIGN_STATUS'][_0xd0fa('0x66')];logger[_0xd0fa('0x44')](_0xd0fa('0x67')+_0x4d58f9[_0xd0fa('0x41')]);}}};}function createObjHistory(_0x36a403,_0x462188,_0xaf864b,_0x5b4e0e,_0x229abc){_0x36a403[_0xd0fa('0x62')]=_0xaf864b;var _0x3fff0f=new Action(_0x36a403,_0x462188);var _0x2be98d=new History(_0x3fff0f);_0x2be98d[_0xd0fa('0x68')]=_0x5b4e0e;_0x2be98d['statedesc']=_0x229abc;_0x2be98d[_0xd0fa('0x69')]=_0x3fff0f[_0xd0fa('0x6a')];return _0x2be98d;}function unlockQueueStatus(_0x4be3df,_0xd82ec3){setTimeout(function(){if(_[_0xd0fa('0x50')](_0x4be3df[_0xd0fa('0x6b')])){loggerBooked[_0xd0fa('0x5f')](_0xd0fa('0x6c'),_0xd82ec3);}_0x4be3df[_0xd0fa('0x6b')]=!![];loggerBooked[_0xd0fa('0x44')](_0xd0fa('0x6d'),_0xd82ec3,JSON[_0xd0fa('0x6e')](_[_0xd0fa('0x6f')](_0x4be3df,[_0xd0fa('0x41'),_0xd0fa('0x6b')])));},0x1f3);}function checkInterval(_0x380615){return function(){if(!isNotNull(_0x380615[_0xd0fa('0x70')])){_0x380615['message']=utils[_0xd0fa('0x63')]['NULL_INTERVAL'];throw _0x380615[_0xd0fa('0x41')]+_0xd0fa('0x71');}if(!isNotNull(_0x380615[_0xd0fa('0x70')]['Intervals'])){_0x380615[_0xd0fa('0x62')]=utils[_0xd0fa('0x63')][_0xd0fa('0x72')];throw _0x380615[_0xd0fa('0x41')]+_0xd0fa('0x71');}if(!isNotNull(_[_0xd0fa('0x43')](_0x380615[_0xd0fa('0x70')][_0xd0fa('0x73')]))){_0x380615[_0xd0fa('0x62')]=utils['CAMPAIGN_STATUS'][_0xd0fa('0x72')];throw _0x380615['name']+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x3b2707){return function(){if(!utils[_0xd0fa('0x74')](_0x3b2707)){_0x3b2707[_0xd0fa('0x62')]=utils[_0xd0fa('0x63')][_0xd0fa('0x75')];throw _0x3b2707[_0xd0fa('0x41')]+_0xd0fa('0x76');}};}function emitCampaignSummary(_0x53bc3c){if(utils['isIVRCampaign'](_0x53bc3c)){emit(util[_0xd0fa('0x77')](_0xd0fa('0x78'),_0x53bc3c[_0xd0fa('0x41')]),_0xd0fa('0x79'),_0x53bc3c);}}function loggerCatchQueueSummary(_0x4fe0de,_0x407077){return function(_0x29737f){clearPredictiveAttributes(_0x407077);emitCampaignSummary(_0x407077);loggerSyncQueueSummary['debug'](_0x4fe0de,util['inspect'](_0x29737f,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x3dc9e2){if(_0x3dc9e2['sendMessageOneNotActive']){if(_0x3dc9e2[_0xd0fa('0x7a')]===0x0){_0x3dc9e2[_0xd0fa('0x7b')]=![];_0x3dc9e2[_0xd0fa('0x62')]=utils[_0xd0fa('0x63')][_0xd0fa('0x75')];loggerSyncQueueSummary[_0xd0fa('0x3e')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3dc9e2['name'],_0xd0fa('0x7c'));}else{_0x3dc9e2[_0xd0fa('0x62')]=utils[_0xd0fa('0x63')]['DISACTIVED'];loggerSyncQueueSummary[_0xd0fa('0x3e')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3dc9e2[_0xd0fa('0x41')],_0xd0fa('0x7d'));}emitCampaignSummary(_0x3dc9e2);}}function myreject(_0x3324e3){return function(_0x4a809f){return _0x3324e3(msgResponse('[ifTime][Action]',_0xd0fa('0x7e'),JSON[_0xd0fa('0x6e')](_0x4a809f)));};}Dialer[_0xd0fa('0x18')][_0xd0fa('0x7f')]=function(_0x4b4cbd){return!_[_0xd0fa('0x50')](_0x4b4cbd)&&_0x4b4cbd&&!_[_0xd0fa('0x50')](_0x4b4cbd['name'])&&!_['isUndefined'](_0x4b4cbd['active'])&&_0x4b4cbd[_0xd0fa('0x80')]&&(this['trunks'][util['format'](_0xd0fa('0x81'),_0x4b4cbd[_0xd0fa('0x41')])][_0xd0fa('0x82')]==='reachable'||this[_0xd0fa('0x1f')][util[_0xd0fa('0x77')](_0xd0fa('0x81'),_0x4b4cbd[_0xd0fa('0x41')])]['status']===_0xd0fa('0x83'));};Dialer['prototype'][_0xd0fa('0x84')]=function(_0x57f571){var _0x18ee99=this;return function(){if(!_0x18ee99[_0xd0fa('0x7f')](_0x57f571[_0xd0fa('0x85')])){if(!_0x18ee99['isTrunkReachable'](_0x57f571['TrunkBackup'])){_0x57f571['message']=utils['CAMPAIGN_STATUS'][_0xd0fa('0x86')];throw _0x57f571[_0xd0fa('0x41')]+_0xd0fa('0x87');}}};};Dialer[_0xd0fa('0x18')][_0xd0fa('0x88')]=function(_0x356ab2,_0x437811,_0x2899b9,_0x5c29dc){var _0x5584d6=this;return function(){var _0x1b8297=!![];return _0x5584d6[_0xd0fa('0x89')](_0x356ab2,_0x437811,_0x2899b9,_0x5c29dc,_0x1b8297);};};Dialer[_0xd0fa('0x18')][_0xd0fa('0x8a')]=function(_0x54cbb1,_0x5a6d0b,_0x3dacdb,_0xd36d0a){var _0xccc417=this;return function(){var _0xee4dc6=![];return _0xccc417[_0xd0fa('0x89')](_0x54cbb1['Intervals'],_0x5a6d0b,_0x3dacdb,_0xd36d0a,_0xee4dc6);};};Dialer['prototype'][_0xd0fa('0x89')]=function(_0xa646de,_0x3c2ba8,_0x34ea44,_0x5270a7,_0x3a5fb0){var _0x4c8912=[];return new Promise(function(_0x45fcb5,_0x1e79b0){if(!isNotNull(_0xa646de)){_0x5270a7[_0xd0fa('0x62')]=utils[_0xd0fa('0x63')][_0xd0fa('0x72')];return _0x1e79b0(msgResponse('ifTime',_0xd0fa('0x8b'),_0x34ea44+_0xd0fa('0x8c')));}if(_[_0xd0fa('0x43')](_0xa646de)){_0x5270a7[_0xd0fa('0x62')]=utils[_0xd0fa('0x63')]['EMPTY_INTERVAL'];return _0x1e79b0(msgResponse(_0xd0fa('0x8d'),_0xd0fa('0x8b'),_0x34ea44+'\x20Intervals\x20is\x20empty\x20'));}if(_0x3c2ba8&&_[_0xd0fa('0x50')](config[_0xd0fa('0x8e')][_0x3c2ba8])){_0x5270a7[_0xd0fa('0x62')]=utils['CAMPAIGN_STATUS'][_0xd0fa('0x8f')];return _0x1e79b0(msgResponse('ifTime',_0xd0fa('0x8b'),_0x34ea44+'\x20Timezone\x20unknow\x20'+_0x3c2ba8));}if(_[_0xd0fa('0x90')](_0xa646de)){for(var _0x4391f3=0x0;_0x4391f3<_0xa646de[_0xd0fa('0x91')];_0x4391f3+=0x1){_0x4c8912[_0xd0fa('0x92')](ami['Action']({'action':_0xd0fa('0x93'),'command':util[_0xd0fa('0x77')]('iftime\x20%s,%s',_0xa646de[_0x4391f3][_0xd0fa('0x94')],!_[_0xd0fa('0x50')](config[_0xd0fa('0x8e')][_0x3c2ba8])?_0x3c2ba8:'')})[_0xd0fa('0x95')](function(_0x256b8a){return _0x256b8a[_0xd0fa('0x96')][_0xd0fa('0x97')]('true')>=0x0;})[_0xd0fa('0x98')](myreject(_0x1e79b0)));}}else{_0x4c8912[_0xd0fa('0x92')](ami['Action']({'action':_0xd0fa('0x93'),'command':util[_0xd0fa('0x77')](_0xd0fa('0x99'),_0xa646de,!_[_0xd0fa('0x50')](config['timezones'][_0x3c2ba8])?_0x3c2ba8:'')})[_0xd0fa('0x95')](function(_0x2d56e6){return _0x2d56e6['content'][_0xd0fa('0x97')](_0xd0fa('0x9a'))>=0x0;})[_0xd0fa('0x98')](myreject(_0x1e79b0)));}Promise['all'](_0x4c8912)['then'](function(_0x44b8a1){var _0x5eb969=_[_0xd0fa('0x9b')](_0x44b8a1);if(_0x5eb969){return _0x45fcb5(_0x5eb969);}else{_0x5270a7[_0xd0fa('0x62')]=_0x3a5fb0?utils['CAMPAIGN_STATUS'][_0xd0fa('0x9c')]:utils[_0xd0fa('0x63')][_0xd0fa('0x9d')];return _0x1e79b0(msgResponse(_0xd0fa('0x9e'),_0xd0fa('0x8b'),_0xd0fa('0x9f')+_0x3a5fb0+'\x20'+_0x34ea44+_0xd0fa('0xa0')+util[_0xd0fa('0x40')](_0xa646de,{'showHidden':![],'depth':null})+_0xd0fa('0xa1')+_0x3c2ba8));}})['catch'](function(_0x5d5a1c){return _0x1e79b0(msgResponse(_0xd0fa('0x8d'),'Failure',JSON[_0xd0fa('0x6e')](_0x5d5a1c)));});});};Dialer['prototype'][_0xd0fa('0xa2')]=function(){var _0x338277=this;return cmHopper[_0xd0fa('0xa3')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x338277[_0xd0fa('0xa4')]();},0x3e8);});};Dialer[_0xd0fa('0x18')][_0xd0fa('0xa4')]=function(){var _0x35e790=this;var _0x144b80;for(var _0x413464 in this[_0xd0fa('0x1d')]){if(typeof this[_0xd0fa('0x1d')][_0x413464]!==_0xd0fa('0xa5')){_0x144b80=this[_0xd0fa('0x1d')][_0x413464];if(utils[_0xd0fa('0xa6')](_0x144b80)&&utils['isIVRCampaignActive'](_0x144b80)){_0x144b80[_0xd0fa('0x7b')]=!![];Promise[_0xd0fa('0xa7')]()[_0xd0fa('0x95')](checkIsIVRCampaignActive(_0x144b80))[_0xd0fa('0x95')](checkInterval(_0x144b80))[_0xd0fa('0x95')](_0x35e790['checkIsTrunkReachable'](_0x144b80))[_0xd0fa('0x95')](_0x35e790[_0xd0fa('0x88')](_0x144b80[_0xd0fa('0xa8')],_0x144b80[_0xd0fa('0xa9')],_0x144b80['name'],_0x144b80))[_0xd0fa('0x95')](_0x35e790[_0xd0fa('0x8a')](_0x144b80[_0xd0fa('0x70')],_0x144b80[_0xd0fa('0xa9')],_0x144b80['name'],_0x144b80))[_0xd0fa('0x95')](_0x35e790[_0xd0fa('0xaa')](_0x144b80))[_0xd0fa('0x98')](loggerCatchQueueSummary(_0xd0fa('0xab'),_0x144b80));}else{notSendMessagesCampaign(_0x144b80);}}}};Dialer[_0xd0fa('0x18')][_0xd0fa('0xac')]=function(_0x1135a8){if(_0x1135a8['dialMethod']!==_0xd0fa('0x8')){clearPredictiveAttributes(_0x1135a8);}switch(_0x1135a8[_0xd0fa('0xad')]){case _0xd0fa('0xae'):this['handlePower'](_0x1135a8,0x1);break;case'power':this[_0xd0fa('0xaf')](_0x1135a8,_0x1135a8[_0xd0fa('0xb0')]);break;case _0xd0fa('0x8'):this[_0xd0fa('0x8')](_0x1135a8);break;case _0xd0fa('0x7'):this[_0xd0fa('0xaf')](_0x1135a8,0x1);break;default:logger[_0xd0fa('0x5f')]('Queue',_0x1135a8[_0xd0fa('0x41')],'method\x20not\x20recognized');}};Dialer[_0xd0fa('0x18')]['ifTime']=function(_0x1960a0,_0x3ae02c){var _0x33e8b6=_0x1960a0[_0xd0fa('0xa9')];var _0xeba258=_0x3ae02c?_0x1960a0[_0xd0fa('0xa8')]:_0x1960a0['Interval'][_0xd0fa('0x73')];logger[_0xd0fa('0xb1')](_0xd0fa('0xb2'),_0xeba258,_0x33e8b6,_0x1960a0['name'],util[_0xd0fa('0x77')](_0xd0fa('0xb3'),_0x1960a0[_0xd0fa('0x41')],_0x1960a0['id']));var _0x374041=null;return Interval[_0xd0fa('0xb4')](_0xeba258,_0x33e8b6)[_0xd0fa('0x95')](function(_0x2a3433){if(_0x2a3433===!![]){return _0x2a3433;}else{_0x1960a0[_0xd0fa('0x62')]=_0x3ae02c?utils[_0xd0fa('0x63')][_0xd0fa('0x9c')]:utils[_0xd0fa('0x63')][_0xd0fa('0x9d')];_0x374041=msgResponse(_0xd0fa('0x9e'),'Failure','Global:\x20'+_0x3ae02c+'\x20'+_0x1960a0[_0xd0fa('0x41')]+'\x20Interval\x20is\x20overtime:\x20'+util[_0xd0fa('0x40')](_0xeba258,{'showHidden':![],'depth':null})+_0xd0fa('0xa1')+_0x33e8b6);}if(_0x374041!==null){logger[_0xd0fa('0xb1')](_0xd0fa('0xb5'),_0x374041);_0x374041[_0xd0fa('0xb6')]=_0x3ae02c;throw _0x374041;}})[_0xd0fa('0x98')](function(_0x3eb92a){logger['error']('AMI\x20IfTime',_0x3eb92a);throw msgResponse('[ifTime][Action]',_0xd0fa('0x7e'),util[_0xd0fa('0x40')](_0x3eb92a,{'showHidden':![],'depth':null}));});};Dialer[_0xd0fa('0x18')][_0xd0fa('0x2b')]=function(_0x46a46d){if(this[_0xd0fa('0x1c')][_0x46a46d[_0xd0fa('0xb7')]]){if(this[_0xd0fa('0x24')][_0x46a46d[_0xd0fa('0xb8')]]&&this[_0xd0fa('0x24')][_0x46a46d[_0xd0fa('0xb8')]]['type']!==_0xd0fa('0xb9')){this[_0xd0fa('0xba')](this[_0xd0fa('0x1c')][_0x46a46d[_0xd0fa('0xb7')]]);this['uniqueId'][_0x46a46d[_0xd0fa('0xb8')]][_0xd0fa('0xbb')]=moment()[_0xd0fa('0x77')](_0xd0fa('0xbc'));}}};Dialer[_0xd0fa('0x18')][_0xd0fa('0xbd')]=function(_0xa2ecd0){var _0xc92f4f=this[_0xd0fa('0x24')][_0xa2ecd0[_0xd0fa('0xb8')]];if(this[_0xd0fa('0x1c')][_0xa2ecd0[_0xd0fa('0xb7')]]){if(_0xc92f4f&&_0xc92f4f[_0xd0fa('0x3c')]!==_0xd0fa('0xb9')){delete this['uniqueId'][_0xa2ecd0['uniqueid']];this['voiceQueues'][_0xa2ecd0[_0xd0fa('0xb7')]][_0xd0fa('0xbe')]+=0x1;var _0x57fe36=new AgentComplete(_0xc92f4f,_0xa2ecd0);if(_0xa2ecd0['reason']===_0xd0fa('0xbf')){_0x57fe36[_0xd0fa('0xc0')]=this[_0xd0fa('0x1c')][_0xa2ecd0[_0xd0fa('0xb7')]][_0xd0fa('0xc1')]&&this[_0xd0fa('0x1c')][_0xa2ecd0[_0xd0fa('0xb7')]][_0xd0fa('0xc2')]?moment()[_0xd0fa('0x77')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0xd0fa('0xc3')](_0x57fe36)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0xc4')));hopperUtils[_0xd0fa('0xc5')](_0x57fe36)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0xc6')));}}};Dialer[_0xd0fa('0x18')]['syncQueueCallerAbandon']=function(_0x3ace11){var _0x3cf19a=this[_0xd0fa('0x24')][_0x3ace11['uniqueid']];var _0x3c89bd=this;var _0x4161f9=![];var _0x1b6ae1;var _0x42b377;if(this['voiceQueues'][_0x3ace11[_0xd0fa('0xb7')]]){if(_0x3cf19a&&_0x3cf19a[_0xd0fa('0x3c')]!==_0xd0fa('0xb9')){delete this['uniqueId'][_0x3ace11['uniqueid']];this[_0xd0fa('0xba')](this[_0xd0fa('0x1c')][_0x3ace11[_0xd0fa('0xb7')]]);_0x3cf19a['droptime']=moment()[_0xd0fa('0x77')](_0xd0fa('0xbc'));var _0x3568e5=new QueueCallerAbandon(_0x3cf19a,_0x3ace11);if(utils[_0xd0fa('0xc7')](_0x3cf19a['droptime'],_0x3cf19a['responsetime'])>=_0x3cf19a[_0xd0fa('0xc8')]){this[_0xd0fa('0x1c')][_0x3ace11[_0xd0fa('0xb7')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0xd0fa('0x1c')][_0x3ace11[_0xd0fa('0xb7')]][_0xd0fa('0xc9')]+=0x1;this[_0xd0fa('0x1c')][_0x3ace11[_0xd0fa('0xb7')]][_0xd0fa('0xca')]+=0x1;_0x3568e5[_0xd0fa('0x68')]=0xa;_0x3568e5[_0xd0fa('0xcb')]=_0xd0fa('0xcc');_0x3568e5[_0xd0fa('0xcd')]=_0xd0fa('0xce');_0x3568e5[_0xd0fa('0xc0')]=this[_0xd0fa('0x1c')][_0x3ace11[_0xd0fa('0xb7')]][_0xd0fa('0xc1')]?moment()[_0xd0fa('0x77')](_0xd0fa('0xbc')):undefined;_0x3568e5[_0xd0fa('0xcf')]+=0x1;_0x3568e5[_0xd0fa('0xd0')]+=0x1;_0x1b6ae1=this[_0xd0fa('0x1c')][_0x3ace11[_0xd0fa('0xb7')]][_0xd0fa('0xd1')];_0x42b377=this['voiceQueues'][_0x3ace11[_0xd0fa('0xb7')]][_0xd0fa('0xd2')];hopperUtils['verifyAdditionalPhones'](_0x3568e5,_0x3568e5[_0xd0fa('0x68')],_0x3cf19a[_0xd0fa('0xd3')])['then'](function(_0x1163f0){_0x4161f9=_0x1163f0[_0xd0fa('0xd4')]==0x1;if(_0x3568e5['countdropretry']>=_0x3c89bd['voiceQueues'][_0x3ace11[_0xd0fa('0xb7')]][_0xd0fa('0xd5')]){_0x3c89bd[_0xd0fa('0xd6')](_0x3568e5,_0x1163f0[_0xd0fa('0xd4')]);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x3568e5[_0xd0fa('0xcf')],'scheduledat':moment()[_0xd0fa('0xd7')](_0x3c89bd[_0xd0fa('0x1c')][_0x3ace11[_0xd0fa('0xb7')]]['dialDropRetryFrequency'],_0xd0fa('0xd8'))[_0xd0fa('0x77')](_0xd0fa('0xbc')),'ContactId':_0x3cf19a[_0xd0fa('0xd9')],'ListId':_0x3cf19a[_0xd0fa('0xda')],'VoiceQueueId':_0x3cf19a[_0xd0fa('0xdb')]||undefined,'CampaignId':_0x3cf19a[_0xd0fa('0xdc')]||undefined})['catch'](loggerCatch(_0xd0fa('0xdd')));var _0x1d99a2=new History(_0x3568e5);_0x1d99a2[_0xd0fa('0x68')]=0xa;_0x1d99a2['statedesc']=_0xd0fa('0xcc');_0x1d99a2['starttime']=moment()[_0xd0fa('0x77')](_0xd0fa('0xbc'));_0x1d99a2[_0xd0fa('0x69')]=_0x1d99a2[_0xd0fa('0x6a')];_0x1d99a2[_0xd0fa('0xde')]=_0x3568e5[_0xd0fa('0xde')];_0x1d99a2[_0xd0fa('0xdf')]=_0x3568e5[_0xd0fa('0xdf')];hopperUtils[_0xd0fa('0xc3')](_0x1d99a2)['catch'](loggerCatch(_0xd0fa('0xe0')));}})[_0xd0fa('0x95')](function(){if(_0x4161f9)hopperUtils[_0xd0fa('0xe1')](_0x3568e5,_0x1b6ae1,_0x42b377)[_0xd0fa('0x95')](function(){return 0x1;});});}else{this[_0xd0fa('0x1c')][_0x3ace11[_0xd0fa('0xb7')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xd0fa('0x1c')][_0x3ace11['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x3568e5['state']=0xb;_0x3568e5[_0xd0fa('0xcb')]=_0xd0fa('0xe2');_0x3568e5[_0xd0fa('0xcd')]='CALLEREXIT';_0x3568e5[_0xd0fa('0xe3')]+=0x1;_0x3568e5[_0xd0fa('0xd0')]+=0x1;_0x1b6ae1=this[_0xd0fa('0x1c')][_0x3ace11['queue']]['dialAbandonedRetryFrequency'];_0x42b377=this['voiceQueues'][_0x3ace11[_0xd0fa('0xb7')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0xd0fa('0xe4')](_0x3568e5,_0x3568e5['state'],_0x3cf19a['voiceQueue'])['then'](function(_0x1bbd4f){if(_0x3568e5[_0xd0fa('0xe3')]>=_0x3c89bd['voiceQueues'][_0x3ace11[_0xd0fa('0xb7')]][_0xd0fa('0xe5')]){_0x3c89bd['queueCallerAbandonCreateState'](_0x3568e5,_0x1bbd4f['additional']);}else{hopperUtils[_0xd0fa('0xe6')]({'active':![],'countabandonedretry':_0x3568e5[_0xd0fa('0xe3')],'scheduledat':moment()['add'](_0x3c89bd['voiceQueues'][_0x3ace11[_0xd0fa('0xb7')]][_0xd0fa('0xe7')],_0xd0fa('0xd8'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3cf19a[_0xd0fa('0xd9')],'ListId':_0x3cf19a[_0xd0fa('0xda')],'VoiceQueueId':_0x3cf19a[_0xd0fa('0xdb')]||undefined,'CampaignId':_0x3cf19a['CampaignId']||undefined})[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0xe8')));var _0x5bfe98=new History(_0x3568e5);_0x5bfe98[_0xd0fa('0x68')]=0xb;_0x5bfe98[_0xd0fa('0xcb')]=_0xd0fa('0xe2');_0x5bfe98['starttime']=moment()[_0xd0fa('0x77')](_0xd0fa('0xbc'));_0x5bfe98[_0xd0fa('0x69')]=_0x5bfe98[_0xd0fa('0x6a')];_0x5bfe98[_0xd0fa('0xde')]=_0x3568e5[_0xd0fa('0xde')];_0x5bfe98[_0xd0fa('0xdf')]=_0x3568e5['calleridnum'];hopperUtils['createHistory'](_0x5bfe98)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0xe9')));}})['then'](function(){if(_0x4161f9)hopperUtils[_0xd0fa('0xe1')](_0x3568e5,_0x1b6ae1,_0x42b377)[_0xd0fa('0x95')](function(){return 0x1;});});}}}};Dialer[_0xd0fa('0x18')][_0xd0fa('0xea')]=function(_0x53afc4){if(this[_0xd0fa('0x22')][_0x53afc4[_0xd0fa('0xb8')]]){this[_0xd0fa('0x22')][_0x53afc4[_0xd0fa('0xb8')]][_0xd0fa('0xeb')]=_0x53afc4[_0xd0fa('0xeb')];}if(this[_0xd0fa('0x24')][_0x53afc4['uniqueid']]){this[_0xd0fa('0x24')][_0x53afc4[_0xd0fa('0xb8')]]['channel']=_0x53afc4['channel'];}};Dialer[_0xd0fa('0x18')]['syncQueueMember']=function(_0xd96ca9){if(!this[_0xd0fa('0x22')][_0xd96ca9[_0xd0fa('0xec')]]){return;}var _0x19ef10=this[_0xd0fa('0x1c')][this['actions'][_0xd96ca9[_0xd0fa('0xec')]][_0xd0fa('0xb7')]][_0xd0fa('0xed')]||_0xd0fa('0xee');if(_0x19ef10==='roundrobin'){if(this['actions'][_0xd96ca9[_0xd0fa('0xec')]]&&_[_0xd0fa('0xef')](this[_0xd0fa('0x22')][_0xd96ca9['actionid']][_0xd0fa('0xf0')])&&_0xd96ca9[_0xd0fa('0x82')]==='1'&&_0xd96ca9[_0xd0fa('0xf1')]==='0'){if(this[_0xd0fa('0x1e')][_0xd96ca9['stateinterface']]){if(!this[_0xd0fa('0x1e')][_0xd96ca9[_0xd0fa('0xf2')]][_0xd0fa('0xf0')]){this[_0xd0fa('0x1e')][_0xd96ca9[_0xd0fa('0xf2')]][_0xd0fa('0xf0')]=!![];this['actions'][_0xd96ca9[_0xd0fa('0xec')]][_0xd0fa('0xf0')]=!![];this[_0xd0fa('0x22')][_0xd96ca9[_0xd0fa('0xec')]][_0xd0fa('0xf2')]=_0xd96ca9[_0xd0fa('0xf2')];}}}}else if(_0x19ef10===_0xd0fa('0xee')){if(this['actions'][_0xd96ca9['actionid']]){if(this['agents'][_0xd96ca9[_0xd0fa('0xf2')]]){this[_0xd0fa('0x22')][_0xd96ca9['actionid']]['stateinterface']=_0xd96ca9[_0xd0fa('0xf2')];if(_['isNil'](this[_0xd0fa('0x27')][this['actions'][_0xd96ca9['actionid']][_0xd0fa('0xb7')]])){this[_0xd0fa('0x27')][this[_0xd0fa('0x22')][_0xd96ca9[_0xd0fa('0xec')]]['queue']]=[];}this[_0xd0fa('0x27')][this['actions'][_0xd96ca9['actionid']][_0xd0fa('0xb7')]][_0xd0fa('0x92')](_[_0xd0fa('0x5b')](_[_0xd0fa('0x6f')](this[_0xd0fa('0x22')][_0xd96ca9[_0xd0fa('0xec')]],[_0xd0fa('0xf3'),_0xd0fa('0xf2')]),{'status':_0xd96ca9[_0xd0fa('0x82')],'paused':_0xd96ca9[_0xd0fa('0xf1')]}));}}}};Dialer[_0xd0fa('0x18')][_0xd0fa('0x37')]=function(_0x3c3da5){if(!this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]]){return;}var _0x26bc04=this;var _0x20351b=this[_0xd0fa('0x1c')][this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xb7')]];var _0x2a2263=_0x20351b[_0xd0fa('0xed')]||_0xd0fa('0xee');if(_0x2a2263===_0xd0fa('0xf4')){if(this[_0xd0fa('0x22')][_0x3c3da5['actionid']]&&this['actions'][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xf2')]){this[_0xd0fa('0xf5')][_0xd0fa('0xf6')](this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xf3')],this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xf2')])[_0xd0fa('0x98')](function(_0x442a5c){logger['error'](_0xd0fa('0xf7'),util['inspect'](_0x442a5c,{'showHidden':![],'depth':null}));})[_0xd0fa('0x1a')](function(){_0x26bc04['updateOriginated'](_0x26bc04[_0xd0fa('0x1c')][_0x26bc04['actions'][_0x3c3da5['actionid']][_0xd0fa('0xb7')]]);_0x26bc04[_0xd0fa('0x1e')][_0x26bc04['actions'][_0x3c3da5['actionid']][_0xd0fa('0xf2')]][_0xd0fa('0xf0')]=![];delete _0x26bc04[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]];unlockQueueStatus(_0x20351b);});}else{this['updateOriginated'](this[_0xd0fa('0x1c')][this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xb7')]]);hopperUtils[_0xd0fa('0xe6')]({'active':![],'ContactId':this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]]['ContactId'],'ListId':this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xda')],'VoiceQueueId':this['actions'][_0x3c3da5['actionid']][_0xd0fa('0xdb')]||undefined,'CampaignId':this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xdc')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x3c3da5[_0xd0fa('0xec')]];unlockQueueStatus(_0x20351b);}}else if(_0x2a2263===_0xd0fa('0xee')){var _0x4d2a82;if(this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]]&&!_[_0xd0fa('0x43')](this[_0xd0fa('0x27')][this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]]['queue']])){if(this[_0xd0fa('0x28')][_0x26bc04[_0xd0fa('0x22')][_0x3c3da5['actionid']]['queue']]){this['queueBookedRR'][_0x26bc04['actions'][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xb7')]]=this[_0xd0fa('0x28')][this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xb7')]]?this['queueBookedRR'][this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xb7')]]:this['queueBooked'][this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xb7')]]?this[_0xd0fa('0x27')][this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xb7')]][_0xd0fa('0xf8')]||0x0:0x0;}this[_0xd0fa('0x27')][this[_0xd0fa('0x22')][_0x3c3da5[_0xd0fa('0xec')]][_0xd0fa('0xb7')]][_0xd0fa('0xf8')]=this[_0xd0fa('0x28')][this[_0xd0fa('0x22')][_0x3c3da5['actionid']][_0xd0fa('0xb7')]];for(var _0x241cc3=0x0;_0x241cc3=_0xb94552[_0xd0fa('0x11b')]){_0x3f6ca1[_0xd0fa('0x11c')](_0x26125f,_0x12c22d,_0x47c606,_0xd0fa('0x11d'));}else{if(_0x26125f[_0xd0fa('0x11a')]>=_0xb94552[_0xd0fa('0x11e')]){_0x3f6ca1['createStateFinal'](_0x26125f,_0x12c22d,_0x47c606,_0xd0fa('0x11f'));}else{hopperUtils[_0xd0fa('0xe6')]({'active':![],'countmachineretry':_0x26125f[_0xd0fa('0x11a')],'scheduledat':moment()[_0xd0fa('0xd7')](_0xb94552[_0xd0fa('0x120')],_0xd0fa('0xd8'))[_0xd0fa('0x77')](_0xd0fa('0xbc')),'ContactId':_0x26125f[_0xd0fa('0xd9')],'ListId':_0x26125f['ListId'],'VoiceQueueId':_0x26125f[_0xd0fa('0xdb')]||undefined,'CampaignId':_0x26125f[_0xd0fa('0xdc')]||undefined})[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x121')));_0x12c22d({'reschedule':0x1});}}});}if(_0x3bd20a[_0xd0fa('0x3c')]===_0xd0fa('0xb9')&&this[_0xd0fa('0x1d')][_0x3bd20a[_0xd0fa('0xb7')]][_0xd0fa('0x122')]&&_0x361d20[_0xd0fa('0x10c')]===_0xd0fa('0x123')){delete this[_0xd0fa('0x24')][_0x361d20[_0xd0fa('0xb8')]];this[_0xd0fa('0xba')](this[_0xd0fa('0x1d')][_0x3bd20a['queue']]);_0x1f19dc=new Hangup(_0x3bd20a,_0x361d20);_0x1f19dc[_0xd0fa('0x68')]=0x12;_0x1f19dc['statedesc']=_0xd0fa('0x10e');_0x1f19dc[_0xd0fa('0x114')]=_0xd0fa('0x115');ami['emit']('custom:amd',ut[_0xd0fa('0x110')](_0x1f19dc,_0xd0fa('0x116')));this['saveInDb'](_0x1f19dc,_0xd0fa('0x124'),'[syncHangupInAMDIvr]');}if(_0x3bd20a[_0xd0fa('0x3c')]===_0xd0fa('0xb9')&&this[_0xd0fa('0x1d')][_0x3bd20a[_0xd0fa('0xb7')]]['dialAMDActive']&&_0x361d20['value']==='MACHINE'){return new Promise(function(_0x32e61c,_0x14fb0a){delete _0x3f6ca1[_0xd0fa('0x24')][_0x361d20[_0xd0fa('0xb8')]];_0x3f6ca1[_0xd0fa('0xba')](_0x3f6ca1['campaigns'][_0x3bd20a['queue']]);_0x3f6ca1[_0xd0fa('0x1d')][_0x3bd20a[_0xd0fa('0xb7')]][_0xd0fa('0xbe')]+=0x1;_0x3f6ca1[_0xd0fa('0x1d')][_0x3bd20a[_0xd0fa('0xb7')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x48fff4=_0x3f6ca1[_0xd0fa('0x1d')][_0x3bd20a[_0xd0fa('0xb7')]];var _0x151c2b=new Hangup(_0x3bd20a,_0x361d20);_0x151c2b['state']=0x13;_0x151c2b['statedesc']=_0xd0fa('0x113');_0x151c2b[_0xd0fa('0x114')]=_0xd0fa('0x115');_0x151c2b[_0xd0fa('0x11a')]+=0x1;_0x151c2b['countglobal']+=0x1;_0x151c2b[_0xd0fa('0x116')]=!![];ami[_0xd0fa('0x3b')](_0xd0fa('0x10f'),ut[_0xd0fa('0x110')](_0x151c2b,_0xd0fa('0x116')));hopperUtils[_0xd0fa('0xc3')](_0x151c2b)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x125')));if(_0x151c2b[_0xd0fa('0x117')]+_0x151c2b[_0xd0fa('0x126')]+_0x151c2b[_0xd0fa('0x118')]+_0x151c2b[_0xd0fa('0x119')]+_0x151c2b[_0xd0fa('0xcf')]+_0x151c2b[_0xd0fa('0xe3')]+_0x151c2b['countmachineretry']+_0x151c2b[_0xd0fa('0x127')]>=_0x48fff4['dialGlobalMaxRetry']){_0x3f6ca1['stateGlobal'](_0x151c2b,_0x32e61c,_0x14fb0a,_0xd0fa('0x11d'));}else{if(_0x151c2b['countmachineretry']>=_0x48fff4['dialMachineMaxRetry']){_0x3f6ca1['createStateFinal'](_0x151c2b,_0x32e61c,_0x14fb0a,'reason\x2019\x20machine....');}else{hopperUtils[_0xd0fa('0xe6')]({'active':![],'countmachineretry':_0x151c2b[_0xd0fa('0x11a')],'scheduledat':moment()[_0xd0fa('0xd7')](_0x48fff4['dialMachineRetryFrequency'],_0xd0fa('0xd8'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x151c2b[_0xd0fa('0xd9')],'ListId':_0x151c2b['ListId'],'VoiceQueueId':_0x151c2b[_0xd0fa('0xdb')]||undefined,'CampaignId':_0x151c2b[_0xd0fa('0xdc')]||undefined})[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x121')));_0x32e61c({'reschedule':0x1});}}});}}};Dialer[_0xd0fa('0x18')]['syncHangup']=function(_0x3537b2){var _0x1d668f=this[_0xd0fa('0x24')][_0x3537b2[_0xd0fa('0xb8')]];var _0xd2f880;if(_0x1d668f&&_0x1d668f[_0xd0fa('0x3c')]===_0xd0fa('0xb9')){delete this[_0xd0fa('0x24')][_0x3537b2[_0xd0fa('0xb8')]];this['updateOriginated'](this[_0xd0fa('0x1d')][_0x1d668f[_0xd0fa('0xb7')]]);this[_0xd0fa('0x1d')][_0x1d668f['queue']][_0xd0fa('0x128')]+=0x1;_0xd2f880=new Hangup(_0x1d668f,_0x3537b2);hopperUtils[_0xd0fa('0xc3')](_0xd2f880)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x129')));hopperUtils[_0xd0fa('0xc5')](_0xd2f880)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x1d668f&&_0x1d668f[_0xd0fa('0x3c')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x1d668f['queue']][_0xd0fa('0x12a')])){delete this[_0xd0fa('0x24')][_0x3537b2[_0xd0fa('0xb8')]];this['updateOriginated'](this[_0xd0fa('0x1c')][_0x1d668f[_0xd0fa('0xb7')]]);this[_0xd0fa('0x1c')][_0x1d668f[_0xd0fa('0xb7')]][_0xd0fa('0xbe')]+=0x1;this['voiceQueues'][_0x1d668f[_0xd0fa('0xb7')]][_0xd0fa('0x10d')]+=0x1;_0xd2f880=new Hangup(_0x1d668f,_0x3537b2);_0xd2f880['state']=0x10;_0xd2f880[_0xd0fa('0xcb')]=_0xd0fa('0x12b');_0xd2f880['membername']=_0xd0fa('0x12c');hopperUtils[_0xd0fa('0xc3')](_0xd2f880)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x129')));hopperUtils[_0xd0fa('0xc5')](_0xd2f880)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x12d')));}if(_0x1d668f&&_0x1d668f[_0xd0fa('0x3c')]!==_0xd0fa('0xb9')&&!isNotNull(this[_0xd0fa('0x1c')][_0x1d668f['queue']][_0xd0fa('0x12a')])){delete this[_0xd0fa('0x24')][_0x3537b2['uniqueid']];this['updateOriginated'](this[_0xd0fa('0x1c')][_0x1d668f[_0xd0fa('0xb7')]]);this[_0xd0fa('0x1c')][_0x1d668f['queue']][_0xd0fa('0x12e')]+=0x1;_0xd2f880=new Hangup(_0x1d668f,_0x3537b2);_0xd2f880['state']=0xc;_0xd2f880[_0xd0fa('0xcb')]=_0x3537b2[_0xd0fa('0x12f')];_0xd2f880[_0xd0fa('0x114')]='Unknow';hopperUtils[_0xd0fa('0xc3')](_0xd2f880)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x129')));hopperUtils[_0xd0fa('0xc5')](_0xd2f880)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x12d')));}};Dialer[_0xd0fa('0x18')][_0xd0fa('0xa')]=function(_0xf0ab98){var _0x12f3f2=this;if(!_0x12f3f2[_0xd0fa('0x29')][_0xf0ab98['name']]){_0x12f3f2[_0xd0fa('0x29')][_0xf0ab98[_0xd0fa('0x41')]]={'running':![]};}else if(_0x12f3f2[_0xd0fa('0x29')][_0xf0ab98[_0xd0fa('0x41')]][_0xd0fa('0x130')]===!![]){return;}else if(_0x12f3f2[_0xd0fa('0x29')][_0xf0ab98['name']][_0xd0fa('0x130')]===![]){_0x12f3f2[_0xd0fa('0x29')][_0xf0ab98[_0xd0fa('0x41')]][_0xd0fa('0x130')]=!![];}var _0x238dcc=_0x12f3f2['voiceQueues'][_0xf0ab98[_0xd0fa('0x41')]];var _0x333d86=_0x238dcc[_0xd0fa('0x62')]!==utils[_0xd0fa('0x63')][_0xd0fa('0x75')];var _0x33d253=utils['isPreviewCampaign'](_0x238dcc);_0x238dcc[_0xd0fa('0x131')]=utils[_0xd0fa('0x132')](_0x238dcc,_0x12f3f2[_0xd0fa('0x1f')]);Promise[_0xd0fa('0xa7')]()[_0xd0fa('0x95')](function(){if(_0x238dcc[_0xd0fa('0x131')]===utils[_0xd0fa('0x63')][_0xd0fa('0x75')]){if(_0x333d86){clearPredictiveAttributes(_0x238dcc);_0xf0ab98[_0xd0fa('0x26')]=undefined;_0xf0ab98[_0xd0fa('0x133')]=undefined;}if(_0x238dcc[_0xd0fa('0x131')]===utils[_0xd0fa('0x63')][_0xd0fa('0x75')]){_0xf0ab98[_0xd0fa('0x134')]=0x0;_0xf0ab98[_0xd0fa('0xf1')]=0x0;_0xf0ab98['inUse']=0x0;_0xf0ab98['talking']=0x0;_0xf0ab98[_0xd0fa('0x135')]=0x0;}}else if(_0x238dcc[_0xd0fa('0x131')]===utils[_0xd0fa('0x63')][_0xd0fa('0x136')]&&!_0x33d253){return _0x12f3f2[_0xd0fa('0x8d')](_0x238dcc,!![])[_0xd0fa('0x95')](function(){return _0x12f3f2[_0xd0fa('0x8d')](_0x238dcc,![]);})[_0xd0fa('0x95')](function(){return _0x12f3f2['checkDialMethod'](_0x238dcc);})['catch'](function(_0x49c4cf){loggerSyncQueueSummary['debug'](_0xd0fa('0x137'),util[_0xd0fa('0x40')](_0x49c4cf,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x238dcc);});}else{clearPredictiveAttributes(_0x238dcc);}})[_0xd0fa('0x95')](function(){var _0x45fc57=_0xf0ab98[_0xd0fa('0x138')](_0x238dcc);if(_0x45fc57||_0x238dcc['queueSummaryCountersUpdated']){_0x238dcc[_0xd0fa('0x139')]=![];_0xf0ab98[_0xd0fa('0x13a')](_0x238dcc);Object[_0xd0fa('0x13b')](_0x238dcc,_0xf0ab98);emitOutboundVoiceQueueSummary(_0xf0ab98);}_0x12f3f2[_0xd0fa('0x29')][_0x238dcc[_0xd0fa('0x41')]][_0xd0fa('0x130')]=![];})[_0xd0fa('0x98')](function(_0x2d9e10){logger[_0xd0fa('0x5f')](_0xd0fa('0x137'),util[_0xd0fa('0x40')](_0x2d9e10,{'showHidden':![],'depth':null}));_0x12f3f2[_0xd0fa('0x29')][_0x238dcc[_0xd0fa('0x41')]][_0xd0fa('0x130')]=![];});};Dialer[_0xd0fa('0x18')][_0xd0fa('0x13c')]=_[_0xd0fa('0x13d')](function(){var _0x93a1c8=_['filter'](this[_0xd0fa('0x1c')],function(_0x202f9e){return _0x202f9e[_0xd0fa('0x13e')];});var _0x3c9e2b=_[_0xd0fa('0x13f')](this['agents'],function(_0x24641f){return _0x24641f[_0xd0fa('0x140')]&&_0x24641f['status']===_0xd0fa('0x141');});if(_0x93a1c8[_0xd0fa('0x91')]>0x0&&_0x3c9e2b[_0xd0fa('0x91')]>0x0){return Promise['resolve']()[_0xd0fa('0x95')](cmHopper['handlePreviewRecallNotifications'](_[_0xd0fa('0x142')](_0x93a1c8,'id'),previewRecallmeReminderInterval,_[_0xd0fa('0x142')](_0x3c9e2b,'id')))['then'](function(_0x367a1f){for(var _0x5ddc73=0x0;_0x5ddc73<_0x367a1f['length'];_0x5ddc73++){var _0x4d5bcf=_0x367a1f[_0x5ddc73][_0xd0fa('0x143')]['name'];if(_0x4d5bcf)io['to'](util[_0xd0fa('0x77')](_0xd0fa('0x144'),_0x4d5bcf))['emit'](_0xd0fa('0x145'),{'hopper':_0x367a1f[_0x5ddc73]});}})[_0xd0fa('0x98')](function(_0x434f55){logger[_0xd0fa('0x5f')]('checkPreviewRecallReminder',_0x434f55);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xd0fa('0x18')][_0xd0fa('0x38')]=function(){var _0x199d92=this;setInterval(function(){_0x199d92[_0xd0fa('0x146')](_0x199d92['uniqueId'],'[uniqueid]');_0x199d92[_0xd0fa('0x146')](_0x199d92[_0xd0fa('0x22')],_0xd0fa('0x147'));},0x32c8);};Dialer[_0xd0fa('0x18')][_0xd0fa('0x146')]=function(_0x595df8,_0x236170){var _0x2eb2dd=this;for(var _0x4973d0 in _0x595df8){if(typeof _0x595df8[_0x4973d0]!=='undefined'){this[_0xd0fa('0x1b')][_0xd0fa('0x148')](function(){if(!_[_0xd0fa('0xef')](_0x595df8[_0x4973d0])){return ami[_0xd0fa('0x149')]({'action':_0xd0fa('0x82'),'channel':_0x595df8[_0x4973d0][_0xd0fa('0xeb')]})[_0xd0fa('0x98')](function(_0x3e3a00){if(_0x3e3a00[_0xd0fa('0x62')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x595df8[_0x4973d0]&&_0x595df8[_0x4973d0]['type']!==_0xd0fa('0xb9')){_0x2eb2dd[_0xd0fa('0xba')](_0x2eb2dd['voiceQueues'][_0x595df8[_0x4973d0][_0xd0fa('0xb7')]]);logger[_0xd0fa('0x5f')](_0xd0fa('0x14a'),_0x236170,_0x4973d0,_0x595df8[_0x4973d0]['queue']);delete _0x595df8[_0x4973d0];}if(_0x595df8[_0x4973d0]&&_0x595df8[_0x4973d0][_0xd0fa('0x3c')]===_0xd0fa('0xb9')){_0x2eb2dd[_0xd0fa('0xba')](_0x2eb2dd[_0xd0fa('0x1d')][_0x595df8[_0x4973d0]['queue']]);logger[_0xd0fa('0x5f')](_0xd0fa('0x14b'),_0x236170,_0x4973d0,_0x595df8[_0x4973d0][_0xd0fa('0xb7')]);delete _0x595df8[_0x4973d0];}},0x2328);}});}});}}};Dialer[_0xd0fa('0x18')]['getVoiceQueueRtPauses']=function(_0x55d496){return Promise[_0xd0fa('0xa7')]()[_0xd0fa('0x95')](voiceQueueRt['getVoiceQueueRtPauses'](_0x55d496))[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x14c')));};Dialer['prototype'][_0xd0fa('0xba')]=function(_0x36cf49){if(!_[_0xd0fa('0x50')](_0x36cf49)&&_0x36cf49!==null){if(typeof _0x36cf49[_0xd0fa('0x7a')]!==_0xd0fa('0xa5')){if(_0x36cf49[_0xd0fa('0x7a')]>0x0){_0x36cf49[_0xd0fa('0x7a')]-=0x1;}else{logger['error'](_0xd0fa('0x14d'));}}}else{logger[_0xd0fa('0x5f')](_0xd0fa('0x14e'));}};Dialer[_0xd0fa('0x18')][_0xd0fa('0x14f')]=function(_0x3b6c7c,_0x544f02){var _0x5d0f47=this;return function(_0x1f48b5){_0x5d0f47['updateOriginated'](_0x544f02);logger[_0xd0fa('0x5f')](_0x3b6c7c,util[_0xd0fa('0x40')](_0x1f48b5,{'showHidden':![],'depth':null}));};};Dialer[_0xd0fa('0x18')]['emptyContact']=function(_0x40b833,_0x36c3d2,_0x3e8f9e){var _0x14a784={'state':0x19,'statedesc':_0xd0fa('0x150')};this['updateOriginated'](_0x36c3d2);this['saveInDb'](_[_0xd0fa('0x5b')](_0x14a784,_[_0xd0fa('0x6f')](_0x3e8f9e,['ContactId',_0xd0fa('0xda'),_0xd0fa('0x151'),_0xd0fa('0xdb'),_0xd0fa('0xdc')])),_0xd0fa('0x152'),_0xd0fa('0x153'));logger[_0xd0fa('0x5f')](_0x40b833);};Dialer['prototype']['saveInDb']=function(_0x20b510,_0x3ba0fe,_0x23a448){hopperUtils[_0xd0fa('0xc3')](_0x20b510)[_0xd0fa('0x98')](loggerCatch(_0x3ba0fe));hopperUtils[_0xd0fa('0xc5')](_0x20b510)['catch'](loggerCatch(_0x23a448));};Dialer[_0xd0fa('0x18')][_0xd0fa('0xd6')]=function(_0x1af690,_0x5e1bbe){hopperUtils[_0xd0fa('0xc3')](_0x1af690)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0xc4')));if(_0x5e1bbe==0x0){hopperUtils[_0xd0fa('0xc5')](_0x1af690)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x154')));}};Dialer[_0xd0fa('0x18')][_0xd0fa('0x155')]=function(_0xa91ec7){return Promise['resolve']()[_0xd0fa('0x95')](cmHopper[_0xd0fa('0x156')](_0xa91ec7['id'],previewRecallmeReminderInterval))['then'](function(_0x27251f){for(var _0x3648c2=0x0;_0x3648c2<_0x27251f['length'];_0x3648c2++){var _0x209fe0=_0x27251f[_0x3648c2]['Agent'][_0xd0fa('0x41')];if(_0x209fe0)io['to'](util['format'](_0xd0fa('0x144'),_0x209fe0))[_0xd0fa('0x3b')](_0xd0fa('0x145'),{'hopper':_0x27251f[_0x3648c2]});}})[_0xd0fa('0x98')](function(){});};Dialer[_0xd0fa('0x18')][_0xd0fa('0xaa')]=function(_0x26f628){var _0x91013=this;return function(){_0x91013[_0xd0fa('0x157')](_0x26f628);};};Dialer[_0xd0fa('0x18')]['actionOriginate']=function(_0x85bdf0,_0x11c3e2){var _0x43c8e9=this;var _0x4820c5=uuid['v4']();this['actions'][_0x4820c5]=new Action(_0x85bdf0,_0x11c3e2,_0x4820c5);return new Promise(function(_0x174b87,_0x349efd){if(_[_0xd0fa('0x50')](_0x85bdf0)&&typeof _0x85bdf0!==_0xd0fa('0x158')){return _0x349efd(msgResponse(_0xd0fa('0x159'),_0xd0fa('0x8b'),_0xd0fa('0x15a')));}if(_['isUndefined'](_0x11c3e2[_0xd0fa('0x15b')])||_0x11c3e2[_0xd0fa('0x15b')]===null){return _0x349efd(msgResponse(_0xd0fa('0x159'),'Failure',_0xd0fa('0x15c')));}var _0x12a361={'XMD-CALLERID':_0x43c8e9[_0xd0fa('0x22')][_0x4820c5][_0xd0fa('0x15d')](),'XMD-AGI':_0x85bdf0[_0xd0fa('0x12a')]?util[_0xd0fa('0x77')](_0xd0fa('0x15e'),ipAgi,_0x85bdf0['dialQueueProject']):_0xd0fa('0x15f'),'XMD-AGIAFTER':_0x85bdf0[_0xd0fa('0xc1')]?util[_0xd0fa('0x77')]('\x22agi://%s/square,%s\x22',ipAgi,_0x85bdf0[_0xd0fa('0xc1')]):_0xd0fa('0x15f'),'XMD-QUEUE':utils[_0xd0fa('0x160')](_0x85bdf0)?util['format']('\x22%s,%s%s,,,%s\x22',_0x85bdf0[_0xd0fa('0x41')],_0x85bdf0['dialQueueOptions']||'',_0x85bdf0['dialAgiAfterHangupAgent']?'c':'',_0x85bdf0[_0xd0fa('0xc8')]||0x3):'NONE','XMD-CONTACTID':_0x11c3e2[_0xd0fa('0xd9')],'XMD-CDRTYPE':_0xd0fa('0x6'),'CALLERID(all)':_0x43c8e9[_0xd0fa('0x22')][_0x4820c5][_0xd0fa('0x15d')](),'XMD-AMD':_0x85bdf0[_0xd0fa('0x122')]?_0xd0fa('0x136'):_0xd0fa('0x15f'),'XMD-DESTINATION':_0xd0fa('0x10b')};if(_0x85bdf0['dialAMDActive']){_0x12a361[_0xd0fa('0x161')]=_0x85bdf0[_0xd0fa('0x162')]||0x9c4;_0x12a361['XMD-AMDGREETING']=_0x85bdf0[_0xd0fa('0x163')]||0x5dc;_0x12a361[_0xd0fa('0x164')]=_0x85bdf0['dialAMDAfterGreetingSilence']||0x320;_0x12a361[_0xd0fa('0x165')]=_0x85bdf0[_0xd0fa('0x166')]||0x1388;_0x12a361[_0xd0fa('0x167')]=_0x85bdf0[_0xd0fa('0x168')]||0x64;_0x12a361[_0xd0fa('0x169')]=_0x85bdf0['dialAMDBetweenWordsSilence']||0x32;_0x12a361['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x85bdf0[_0xd0fa('0x16a')]||0x3;_0x12a361[_0xd0fa('0x16b')]=_0x85bdf0[_0xd0fa('0x16c')]||0x100;_0x12a361[_0xd0fa('0x16d')]=_0x85bdf0[_0xd0fa('0x16e')]||0x1388;}if(utils[_0xd0fa('0x160')](_0x85bdf0)){_0x12a361['XMD-VOICEQUEUEID']=_0x11c3e2[_0xd0fa('0xdb')];}else{_0x12a361[_0xd0fa('0x16f')]=_0x11c3e2['CampaignId'];}for(var _0x250302 in _0x11c3e2[_0xd0fa('0x170')]){if(typeof _0x11c3e2[_0xd0fa('0x170')][_0x250302]!==_0xd0fa('0xa5')){if(isNotNull(_0x11c3e2[_0xd0fa('0x170')][_0x250302])&&_0x250302!=='id'&&_0x250302!==_0xd0fa('0x171')&&_0x250302!==_0xd0fa('0x172')&&_0x250302!=='updatedAt'){_0x12a361[util[_0xd0fa('0x77')](_0xd0fa('0x173'),_0xd0fa('0x174'),_[_0xd0fa('0x175')](_0x250302))]=_0x11c3e2['Contact'][_0x250302];}}}var _0x5a9e43=_0x43c8e9[_0xd0fa('0x7f')](_0x85bdf0[_0xd0fa('0x85')])?utils[_0xd0fa('0x176')](_0x85bdf0[_0xd0fa('0x85')]['callerid'],_0x85bdf0[_0xd0fa('0x177')],_0x85bdf0[_0xd0fa('0x178')]>0x0?utils[_0xd0fa('0x179')](_0x85bdf0['dialOriginateCallerIdNumber'],_0x85bdf0[_0xd0fa('0x178')]):_0x85bdf0[_0xd0fa('0x17a')]):utils['getCallerId'](_['isNil'](_0x85bdf0['TrunkBackup'])?_0x85bdf0['Trunk']['callerid']:_0x85bdf0[_0xd0fa('0x17b')][_0xd0fa('0x17c')],_0x85bdf0[_0xd0fa('0x177')],_0x85bdf0['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0xd0fa('0x179')](_0x85bdf0[_0xd0fa('0x17a')],_0x85bdf0[_0xd0fa('0x178')]):_0x85bdf0[_0xd0fa('0x17a')]);if(_0x5a9e43){_0x12a361['XMD-ORIGINATECALLERIDNAME']=_0x43c8e9['actions'][_0x4820c5]['originatecalleridname']=utils[_0xd0fa('0x17d')](_0x5a9e43);_0x12a361[_0xd0fa('0x17e')]=_0x11c3e2[_0xd0fa('0x15b')];}_0x85bdf0[_0xd0fa('0x17f')]=_0x12a361;return ami['Action']({'actionid':_0x4820c5,'action':_0xd0fa('0x159'),'channel':_0x43c8e9[_0xd0fa('0x7f')](_0x85bdf0[_0xd0fa('0x85')])?util[_0xd0fa('0x77')]('SIP/%s/%s%s',_0x85bdf0[_0xd0fa('0x85')][_0xd0fa('0x41')],isNotNull(_0x85bdf0[_0xd0fa('0x180')])?_0x85bdf0[_0xd0fa('0x180')][_0xd0fa('0x181')]()||'':'',_0x85bdf0[_0xd0fa('0x182')]>0x0?_0x11c3e2[_0xd0fa('0x15b')]['substring'](_0x85bdf0[_0xd0fa('0x182')]):_0x11c3e2[_0xd0fa('0x15b')]):util['format'](_0xd0fa('0x183'),_[_0xd0fa('0xef')](_0x85bdf0['TrunkBackup'])?_0x85bdf0[_0xd0fa('0x85')][_0xd0fa('0x41')]:_0x85bdf0[_0xd0fa('0x17b')][_0xd0fa('0x41')],isNotNull(_0x85bdf0['dialPrefix'])?_0x85bdf0[_0xd0fa('0x180')][_0xd0fa('0x181')]()||'':'',_0x85bdf0[_0xd0fa('0x182')]>0x0?_0x11c3e2[_0xd0fa('0x15b')][_0xd0fa('0x184')](_0x85bdf0[_0xd0fa('0x182')]):_0x11c3e2[_0xd0fa('0x15b')]),'callerid':_0x5a9e43,'Exten':_0xd0fa('0x10b'),'Context':'from-sip','Priority':'1','variable':_0x12a361,'timeout':(_0x85bdf0[_0xd0fa('0x185')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4820c5})[_0xd0fa('0x95')](function(_0x5b92aa){return _0x174b87(_0x5b92aa);})['catch'](function(_0x518208){_0x85bdf0[_0xd0fa('0x186')]+=0x1;var _0x1acc87=new History(_0x43c8e9[_0xd0fa('0x22')][_0x4820c5]);logger[_0xd0fa('0x5f')](util[_0xd0fa('0x77')](_0xd0fa('0x187'),JSON[_0xd0fa('0x6e')](_0x518208)));_0x1acc87[_0xd0fa('0x68')]=0xe;_0x1acc87['statedesc']=_0xd0fa('0x188');_0x1acc87['starttime']=moment()[_0xd0fa('0x77')](_0xd0fa('0xbc'));_0x1acc87['endtime']=_0x1acc87[_0xd0fa('0x6a')];hopperUtils[_0xd0fa('0xc3')](_0x1acc87)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x189')));_0x43c8e9[_0xd0fa('0xc5')](_0x1acc87)[_0xd0fa('0x98')](loggerCatch('[originate][error]'))[_0xd0fa('0x1a')](function(){delete _0x43c8e9[_0xd0fa('0x22')][_0x4820c5];return _0x349efd(msgResponse(_0xd0fa('0x159'),_0xd0fa('0x7e'),_0xd0fa('0x18a')));});});});};Dialer[_0xd0fa('0x18')][_0xd0fa('0x18b')]=function(_0x3553fa,_0x490d9a,_0x5b8307){var _0x14d097=new History(_0x490d9a);if(_0x14d097[_0xd0fa('0x117')]+_0x14d097['countcongestionretry']+_0x14d097[_0xd0fa('0x118')]+_0x14d097[_0xd0fa('0x119')]+_0x14d097['countdropretry']+_0x14d097['countabandonedretry']+_0x14d097[_0xd0fa('0x11a')]+_0x14d097['countagentrejectretry']>=_0x5b8307[_0xd0fa('0x11b')]-0x1){return!![];}switch(_0x3553fa){case 0x3:if(_0x14d097[_0xd0fa('0x118')]>=_0x5b8307[_0xd0fa('0x18c')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x14d097['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x5b8307[_0xd0fa('0x18d')],_0xd0fa('0xd8'))[_0xd0fa('0x77')](_0xd0fa('0xbc')),'ContactId':_0x14d097[_0xd0fa('0xd9')],'ListId':_0x14d097[_0xd0fa('0xda')],'VoiceQueueId':_0x14d097[_0xd0fa('0xdb')]||undefined,'CampaignId':_0x14d097[_0xd0fa('0xdc')]||undefined})[_0xd0fa('0x98')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x14d097[_0xd0fa('0x117')]>=_0x5b8307[_0xd0fa('0x18e')]-0x1){return!![];}hopperUtils[_0xd0fa('0xe6')]({'active':![],'countbusyretry':_0x14d097[_0xd0fa('0x117')]+=0x1,'scheduledat':moment()[_0xd0fa('0xd7')](_0x5b8307[_0xd0fa('0x18f')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x14d097[_0xd0fa('0xd9')],'ListId':_0x14d097[_0xd0fa('0xda')],'VoiceQueueId':_0x14d097['VoiceQueueId']||undefined,'CampaignId':_0x14d097[_0xd0fa('0xdc')]||undefined})[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x190')));break;case 0x8:if(_0x14d097['countcongestionretry']>=_0x5b8307[_0xd0fa('0x191')]-0x1){return!![];}hopperUtils[_0xd0fa('0xe6')]({'active':![],'countcongestionretry':_0x14d097['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x5b8307[_0xd0fa('0x192')],'minutes')[_0xd0fa('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x14d097[_0xd0fa('0xd9')],'ListId':_0x14d097[_0xd0fa('0xda')],'VoiceQueueId':_0x14d097['VoiceQueueId']||undefined,'CampaignId':_0x14d097[_0xd0fa('0xdc')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x14d097[_0xd0fa('0x119')]>=_0x5b8307[_0xd0fa('0x193')]-0x1){return!![];}else{hopperUtils[_0xd0fa('0xe6')]({'active':![],'countnosuchnumberretry':_0x14d097['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xd0fa('0xd7')](_0x5b8307['dialNoSuchNumberRetryFrequency'],_0xd0fa('0xd8'))[_0xd0fa('0x77')](_0xd0fa('0xbc')),'ContactId':_0x14d097[_0xd0fa('0xd9')],'ListId':_0x14d097[_0xd0fa('0xda')],'VoiceQueueId':_0x14d097[_0xd0fa('0xdb')]||undefined,'CampaignId':_0x14d097[_0xd0fa('0xdc')]||undefined})[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x194')));}break;case 0xa:if(_0x14d097['countdropretry']>=_0x5b8307[_0xd0fa('0xd5')]-0x1){return!![];}hopperUtils[_0xd0fa('0xe6')]({'active':![],'countdropretry':_0x14d097[_0xd0fa('0xcf')]+=0x1,'scheduledat':moment()[_0xd0fa('0xd7')](_0x5b8307['dialDropRetryFrequency'],_0xd0fa('0xd8'))[_0xd0fa('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x14d097['ContactId'],'ListId':_0x14d097[_0xd0fa('0xda')],'VoiceQueueId':_0x14d097[_0xd0fa('0xdb')]||undefined,'CampaignId':_0x14d097[_0xd0fa('0xdc')]||undefined})['catch'](loggerCatch(_0xd0fa('0xdd')));break;case 0xb:if(_0x14d097[_0xd0fa('0xe3')]>=_0x5b8307['dialAbandonedMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x14d097[_0xd0fa('0xe3')]+=0x1,'scheduledat':moment()[_0xd0fa('0xd7')](_0x5b8307['dialAbandonedRetryFrequency'],_0xd0fa('0xd8'))[_0xd0fa('0x77')](_0xd0fa('0xbc')),'ContactId':_0x14d097[_0xd0fa('0xd9')],'ListId':_0x14d097[_0xd0fa('0xda')],'VoiceQueueId':_0x14d097['VoiceQueueId']||undefined,'CampaignId':_0x14d097[_0xd0fa('0xdc')]||undefined})['catch'](loggerCatch(_0xd0fa('0xe8')));break;case 0x13:if(_0x14d097[_0xd0fa('0x11a')]>=_0x5b8307['dialMachineMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x14d097['countmachineretry']+=0x1,'scheduledat':moment()[_0xd0fa('0xd7')](_0x5b8307[_0xd0fa('0x120')],_0xd0fa('0xd8'))[_0xd0fa('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x14d097[_0xd0fa('0xd9')],'ListId':_0x14d097[_0xd0fa('0xda')],'VoiceQueueId':_0x14d097[_0xd0fa('0xdb')]||undefined,'CampaignId':_0x14d097[_0xd0fa('0xdc')]||undefined})[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x121')));break;case 0x14:if(_0x14d097[_0xd0fa('0x127')]>=_0x5b8307['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils[_0xd0fa('0xe6')]({'active':![],'countagentrejectretry':_0x14d097[_0xd0fa('0x127')]+=0x1,'scheduledat':moment()[_0xd0fa('0xd7')](_0x5b8307[_0xd0fa('0x195')],_0xd0fa('0xd8'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x14d097[_0xd0fa('0xd9')],'ListId':_0x14d097[_0xd0fa('0xda')],'VoiceQueueId':_0x14d097['VoiceQueueId']||undefined,'CampaignId':_0x14d097[_0xd0fa('0xdc')]||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype'][_0xd0fa('0x196')]=function(_0x75338b,_0x1bb07e,_0x473360){var _0xda7ca3=this;var _0xe78420=new History(_0x75338b);var _0x140862=![];var _0x9134b;var _0x3693bd;return new Promise(function(_0xb78ae8,_0x29aa0d){if(_[_0xd0fa('0x50')](_0x1bb07e)&&typeof _0x1bb07e!==_0xd0fa('0x158')){return _0x29aa0d(msgResponse('[callProgressDetecting]','Failure','entity\x20is\x20undefine'));}if(_['isUndefined'](_0x473360)&&typeof _0x473360!==_0xd0fa('0x158')){return _0x29aa0d(msgResponse(_0xd0fa('0x197'),_0xd0fa('0x8b'),_0xd0fa('0x198')));}hopperUtils[_0xd0fa('0xe4')](_0xe78420,_0x473360[_0xd0fa('0x199')],_0x1bb07e)[_0xd0fa('0x95')](function(_0x4cee8c){if(_0x4cee8c[_0xd0fa('0xd4')]==0x1)_0x140862=!![];switch(_0x473360[_0xd0fa('0x199')]){case'0':_0x1bb07e[_0xd0fa('0x19a')]+=0x1;_0xe78420['state']=0x0;_0xe78420[_0xd0fa('0xcb')]='NoSuchNumber';_0xe78420['countnosuchnumberretry']+=0x1;_0xe78420[_0xd0fa('0xd0')]+=0x1;ami['emit']('custom:agentnosuchnumber',ut[_0xd0fa('0x110')](_0x75338b,_0xd0fa('0x19b')));_0x9134b=_0x1bb07e[_0xd0fa('0x19c')];_0x3693bd=_0x1bb07e[_0xd0fa('0xd2')];hopperUtils[_0xd0fa('0xc3')](_0xe78420)[_0xd0fa('0x98')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0xda7ca3[_0xd0fa('0x18b')](0x0,_0x75338b,_0x1bb07e)&&!_0x140862){if(_0xe78420[_0xd0fa('0x119')]>=_0x1bb07e[_0xd0fa('0x193')]){_0xda7ca3['createStateFinal'](_0xe78420,_0xb78ae8,_0x29aa0d,_0xd0fa('0x19d'));}else{_0xda7ca3[_0xd0fa('0x11c')](_0xe78420,_0xb78ae8,_0x29aa0d,_0xd0fa('0x19d'));}}break;case'3':_0x1bb07e['outboundNoAnswerCallsDay']+=0x1;_0xe78420[_0xd0fa('0x68')]=0x3;_0xe78420[_0xd0fa('0xcb')]=_0xd0fa('0x19e');_0xe78420[_0xd0fa('0x118')]+=0x1;_0xe78420[_0xd0fa('0xd0')]+=0x1;var _0x51ba5a=ut['buildNoAnswerEventPayload'](_0x75338b,_0x1bb07e);ami[_0xd0fa('0x3b')]('custom:agentnoanswer',_0x51ba5a);_0x9134b=_0x1bb07e['dialNoAnswerRetryFrequency'];_0x3693bd=_0x1bb07e[_0xd0fa('0xd2')];hopperUtils[_0xd0fa('0xc3')](_0xe78420)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x19f')));if(_0xda7ca3[_0xd0fa('0x18b')](0x3,_0x75338b,_0x1bb07e)&&!_0x140862){if(_0xe78420[_0xd0fa('0x118')]>=_0x1bb07e[_0xd0fa('0x18c')]){_0xda7ca3[_0xd0fa('0x1a0')](_0xe78420,_0xb78ae8,_0x29aa0d,_0xd0fa('0x1a1'));}else{_0xda7ca3[_0xd0fa('0x11c')](_0xe78420,_0xb78ae8,_0x29aa0d,_0xd0fa('0x1a1'));}}break;case'5':_0x1bb07e['outboundBusyCallsDay']+=0x1;_0xe78420[_0xd0fa('0x68')]=0x5;_0xe78420[_0xd0fa('0xcb')]=_0xd0fa('0x1a2');_0xe78420[_0xd0fa('0x117')]+=0x1;_0xe78420['countglobal']+=0x1;ami[_0xd0fa('0x3b')]('custom:agentbusy',ut[_0xd0fa('0x110')](_0x75338b,_0xd0fa('0x1a3')));_0x9134b=_0x1bb07e[_0xd0fa('0x18f')];_0x3693bd=_0x1bb07e[_0xd0fa('0xd2')];hopperUtils[_0xd0fa('0xc3')](_0xe78420)['catch'](loggerCatch(_0xd0fa('0x1a4')));if(_0xda7ca3[_0xd0fa('0x18b')](0x5,_0x75338b,_0x1bb07e)&&!_0x140862){if(_0xe78420[_0xd0fa('0x117')]>=_0x1bb07e['dialBusyMaxRetry']){_0xda7ca3[_0xd0fa('0x1a0')](_0xe78420,_0xb78ae8,_0x29aa0d,_0xd0fa('0x1a5'));}else{_0xda7ca3['stateGlobal'](_0xe78420,_0xb78ae8,_0x29aa0d,'reason\x205\x20busy');}}break;case'8':_0x1bb07e['outboundCongestionCallsDay']+=0x1;_0xe78420[_0xd0fa('0x68')]=0x8;_0xe78420['statedesc']=_0xd0fa('0x1a6');_0xe78420[_0xd0fa('0x126')]+=0x1;_0xe78420[_0xd0fa('0xd0')]+=0x1;_0x9134b=_0x1bb07e[_0xd0fa('0x192')];_0x3693bd=_0x1bb07e[_0xd0fa('0xd2')];ami[_0xd0fa('0x3b')](_0xd0fa('0x1a7'),ut['buildObj'](_0x75338b,_0xd0fa('0x1a8')));hopperUtils[_0xd0fa('0xc3')](_0xe78420)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0xda7ca3['checkRetriveMax'](0x8,_0x75338b,_0x1bb07e)&&!_0x140862){if(_0xe78420[_0xd0fa('0x126')]>=_0x1bb07e[_0xd0fa('0x191')]){_0xda7ca3[_0xd0fa('0x1a0')](_0xe78420,_0xb78ae8,_0x29aa0d,_0xd0fa('0x1a9'));}else{_0xda7ca3[_0xd0fa('0x11c')](_0xe78420,_0xb78ae8,_0x29aa0d,_0xd0fa('0x1a9'));}}break;case'11':_0x1bb07e[_0xd0fa('0x1aa')]+=0x1;_0xe78420['state']=0xb;_0xe78420[_0xd0fa('0xcb')]=_0xd0fa('0xe2');_0xe78420['countabandonedretry']+=0x1;_0xe78420[_0xd0fa('0xd0')]+=0x1;_0x9134b=_0x1bb07e[_0xd0fa('0xe7')];_0x3693bd=_0x1bb07e['callAdditionalPhoneAfterMin'];hopperUtils[_0xd0fa('0xc3')](_0xe78420)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0xe9')));if(_0xda7ca3['checkRetriveMax'](0xb,_0x75338b,_0x1bb07e)&&!_0x140862){if(_0xe78420[_0xd0fa('0xe3')]>=_0x1bb07e[_0xd0fa('0xe5')]){_0xda7ca3[_0xd0fa('0x1a0')](_0xe78420,_0xb78ae8,_0x29aa0d,_0xd0fa('0x1ab'));}else{_0xda7ca3[_0xd0fa('0x11c')](_0xe78420,_0xb78ae8,_0x29aa0d,'reason\x2011\x20abandoned');}}break;case'20':_0x1bb07e['outboundRejectCallsDay']+=0x1;_0xe78420[_0xd0fa('0x68')]=0x14;_0xe78420[_0xd0fa('0xcb')]=_0xd0fa('0x1ac');_0xe78420[_0xd0fa('0x127')]+=0x1;_0xe78420[_0xd0fa('0xd0')]+=0x1;_0x9134b=_0x1bb07e[_0xd0fa('0x195')];_0x3693bd=_0x1bb07e['callAdditionalPhoneAfterMin'];ami[_0xd0fa('0x3b')](_0xd0fa('0x1ad'),ut[_0xd0fa('0x110')](_0x75338b,_0xd0fa('0x1ae')));hopperUtils[_0xd0fa('0xc3')](_0xe78420)[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x1af')));if(_0xda7ca3[_0xd0fa('0x18b')](0x14,_0x75338b,_0x1bb07e)&&!_0x140862){if(_0xe78420[_0xd0fa('0x127')]>=_0x1bb07e[_0xd0fa('0x1b0')]){_0xda7ca3[_0xd0fa('0x1a0')](_0xe78420,_0xb78ae8,_0x29aa0d,'reason\x2020\x20agentreject');}else{_0xda7ca3[_0xd0fa('0x11c')](_0xe78420,_0xb78ae8,_0x29aa0d,'reason\x2020\x20agentreject');}}break;default:_0x1bb07e[_0xd0fa('0x12e')]+=0x1;_0xe78420[_0xd0fa('0x68')]=0xc;_0xe78420[_0xd0fa('0xcb')]=_0x473360['reason'];_0x9134b=_0x1bb07e[_0xd0fa('0x195')];_0x3693bd=_0x1bb07e[_0xd0fa('0xd2')];hopperUtils[_0xd0fa('0xc3')](_0xe78420)[_0xd0fa('0x98')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0xda7ca3[_0xd0fa('0x18b')](_0x473360[_0xd0fa('0x199')],_0x75338b,_0x1bb07e)&&!_0x140862){if(_0xe78420['countbusyretry']+_0xe78420[_0xd0fa('0x126')]+_0xe78420[_0xd0fa('0x118')]+_0xe78420[_0xd0fa('0x119')]+_0xe78420[_0xd0fa('0xcf')]+_0xe78420['countabandonedretry']+_0xe78420[_0xd0fa('0x11a')]+_0xe78420[_0xd0fa('0x127')]>=_0x1bb07e['dialGlobalMaxRetry']){_0xda7ca3[_0xd0fa('0x11c')](_0xe78420,_0xb78ae8,_0x29aa0d,_0x473360['reason']);}else{_0xda7ca3[_0xd0fa('0x1a0')](_0xe78420,_0xb78ae8,_0x29aa0d,_0x473360['reason']);}}}})['then'](function(){if(_0x140862){hopperUtils['swapAdditionalPhones'](_0xe78420,_0x9134b,_0x3693bd)['then'](function(){return _0xb78ae8(0x1);});}});});};Dialer[_0xd0fa('0x18')][_0xd0fa('0x11c')]=function(_0x131651,_0x50df79,_0x46002d,_0x37167d){var _0x3f305a=new Final(_0x131651);_0x3f305a['state']=0xf;_0x3f305a['statedesc']=_0xd0fa('0x1b1');this[_0xd0fa('0x1a0')](_0x3f305a,_0x50df79,_0x46002d,_0x37167d);};Dialer[_0xd0fa('0x18')]['createStateFinal']=function(_0x4d7ac6,_0x45673b,_0x6956db,_0x30e57a){hopperUtils['moveContactManagedDialer'](_0x4d7ac6)[_0xd0fa('0x95')](function(){return _0x45673b(msgResponse('[callProgressDetecting]',_0xd0fa('0x106'),_0x30e57a));})[_0xd0fa('0x98')](function(){return _0x6956db(msgResponse(_0xd0fa('0x1b2'),_0xd0fa('0x8b'),_0xd0fa('0x1b3')));});};Dialer[_0xd0fa('0x18')][_0xd0fa('0x8')]=function(_0x267976){var _0x3912da=_0x267976[_0xd0fa('0x1b4')]/0x64;var _0x4f688a=_0x267976[_0xd0fa('0xc9')]/(_0x267976[_0xd0fa('0xc9')]+_0x267976[_0xd0fa('0xbe')]);var _0x31dd56=Math[_0xd0fa('0x1b5')](_0x267976[_0xd0fa('0x1b6')]*(_0x267976[_0xd0fa('0x1b7')]/0x64));var _0x1f4096=Math[_0xd0fa('0x1b5')](_0x267976[_0xd0fa('0x1b6')]*(_0x267976[_0xd0fa('0x1b8')]/0x64));var _0x1bc911=_0x267976[_0xd0fa('0x134')]+_0x267976[_0xd0fa('0x1b9')];var _0x5b34b9=Math['floor'](_0x267976[_0xd0fa('0x56')]*_0x267976[_0xd0fa('0x58')]*_0x267976[_0xd0fa('0x1ba')]*_0x267976['predictiveIntervalMultiplicativeFactor']);if(_[_0xd0fa('0x50')](_0x267976[_0xd0fa('0x133')])){if(!_[_0xd0fa('0x50')](_0x267976[_0xd0fa('0x26')])){_0x267976['startPredictive']=undefined;loggerPredictive[_0xd0fa('0x5f')](_0xd0fa('0x1bb'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xd0fa('0x50')](_0x267976[_0xd0fa('0x5d')])){loggerPredictive['error'](_0xd0fa('0x1bb'),_0xd0fa('0x1bc'));clearInterval(_0x267976[_0xd0fa('0x5d')]);_0x267976['handlePredictive']=undefined;}_0x267976[_0xd0fa('0x133')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x267976[_0xd0fa('0x41')],'collection\x20data\x20in\x20progressive\x20at',_0x267976[_0xd0fa('0x133')]);this[_0xd0fa('0xaf')](_0x267976,0x1);}else if(ifInterval(_0x267976[_0xd0fa('0x1bd')],_0x267976[_0xd0fa('0x133')])){this['handlePower'](_0x267976,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x267976[_0xd0fa('0x133')],_0x267976[_0xd0fa('0x41')]);_0x267976[_0xd0fa('0x56')]=0x0;_0x267976[_0xd0fa('0xca')]=0x0;}else if(_0x3912da<_0x4f688a&&_0x267976[_0xd0fa('0x1be')]===_0xd0fa('0x1bf')){clearPredictiveAttributes(_0x267976);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xd0fa('0x1c0'),_0x4f688a,_0xd0fa('0x133'),_0x267976[_0xd0fa('0x41')]);}else if(_0x5b34b9<_0x267976[_0xd0fa('0xca')]&&_0x267976[_0xd0fa('0x1be')]==='dropRate'){clearPredictiveAttributes(_0x267976);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x1c1'),_0xd0fa('0x1c2'),_0x5b34b9,'Drop\x20in\x20this\x20interval',_0x267976[_0xd0fa('0xca')],_0xd0fa('0x133'),_0x267976[_0xd0fa('0x41')]);}else if(!ifInterval(_0x267976['dialPredictiveInterval'],_0x267976[_0xd0fa('0x133')])&&_[_0xd0fa('0x50')](_0x267976[_0xd0fa('0x26')])&&!_[_0xd0fa('0x50')](_0x267976['startProgressive'])){_0x267976[_0xd0fa('0x26')]=moment()[_0xd0fa('0x77')](_0xd0fa('0xbc'));loggerPredictive['info'](_0x267976['name'],_0xd0fa('0x1c3'),_0x267976[_0xd0fa('0x26')]);hopperUtils[_0xd0fa('0x1c4')](_0x267976[_0xd0fa('0x1bd')])[_0xd0fa('0x95')](this[_0xd0fa('0x1c5')](_0x267976))[_0xd0fa('0x95')](mergeDataErlangB(_0x267976))[_0xd0fa('0x95')](this[_0xd0fa('0x1c6')](_0x267976))[_0xd0fa('0x98')](loggerCatchPredictive(_0xd0fa('0x1c7'),_0x267976));}else if(!ifInterval(_0x267976[_0xd0fa('0x1bd')],_0x267976[_0xd0fa('0x26')])){_0x267976[_0xd0fa('0xca')]=0x0;_0x267976['startPredictive']=moment()['format'](_0xd0fa('0xbc'));loggerPredictive[_0xd0fa('0x44')](_0x267976[_0xd0fa('0x41')],_0xd0fa('0x1c8'),_0x267976[_0xd0fa('0x26')]);clearInterval(_0x267976[_0xd0fa('0x5d')]);_0x267976[_0xd0fa('0x5d')]=undefined;hopperUtils['avgHandleTime'](_0x267976[_0xd0fa('0x1bd')])['then'](this[_0xd0fa('0x1c5')](_0x267976))['then'](mergeDataErlangB(_0x267976))[_0xd0fa('0x95')](this[_0xd0fa('0x1c6')](_0x267976))[_0xd0fa('0x98')](loggerCatchPredictive(_0xd0fa('0x1c9'),_0x267976));}else if(_0x267976[_0xd0fa('0x1b6')]&&_0x1bc911<_0x267976[_0xd0fa('0x1b6')]-_0x1f4096){clearPredictiveAttributes(_0x267976);loggerPredictive[_0xd0fa('0x44')](_0x267976['name'],_0xd0fa('0x1ca'),_0x1bc911,_0xd0fa('0x1cb'),_0x267976[_0xd0fa('0x1b6')],'-',_0x1f4096,'=',_0x267976[_0xd0fa('0x1b6')]-_0x1f4096,')');}else if(_0x267976['predictiveIntervalAvailable']&&_0x1bc911>_0x267976['predictiveIntervalAvailable']+_0x31dd56){clearPredictiveAttributes(_0x267976);loggerPredictive[_0xd0fa('0x44')](_0x267976[_0xd0fa('0x41')],_0xd0fa('0x1ca'),_0x1bc911,_0xd0fa('0x1cc'),_0x267976['predictiveIntervalAvailable'],'+',_0x31dd56,'=',_0x267976[_0xd0fa('0x1b6')]+_0x31dd56,')');}};Dialer[_0xd0fa('0x18')][_0xd0fa('0x1c5')]=function(_0x402b92){var _0x5b1266=this;return function(_0x3444a5){return new Promise(function(_0x4969a4,_0x23c0ff){_['merge'](_0x402b92,_0x3444a5[0x0]);if(checkGetDataPredictive(_0x3444a5[0x0])){var _0x6c0cec=_0x402b92[_0xd0fa('0x1b6')]=_0x402b92['talking']+_0x402b92[_0xd0fa('0x134')];var _0x4e38d5=_0x402b92['dialPredictiveInterval']*0x3c;var _0x1fd4df=_0x3444a5[0x0][_0xd0fa('0x4e')]+_0x3444a5[0x0][_0xd0fa('0x1cd')];var _0x41bd8a=(_0x3444a5[0x0][_0xd0fa('0x49')]+_0x3444a5[0x0][_0xd0fa('0x1ce')]+_0x3444a5[0x0][_0xd0fa('0x4c')])/_0x3444a5[0x0][_0xd0fa('0x47')];_0x402b92[_0xd0fa('0x1ba')]=_0x41bd8a>0x0?_0x41bd8a:0x1;switch(_0x402b92[_0xd0fa('0x1be')]){case'dropRate':var _0x557274=_0x402b92['dialPredictiveOptimizationPercentage']/0x64;return _0x5b1266['abandonmentRate'](_0x6c0cec,_0x4e38d5,_0x1fd4df,_0x41bd8a,_0x557274)[_0xd0fa('0x95')](function(_0x30bb2a){return _0x4969a4(_0x30bb2a);});case'agentBusyFactor':var _0x208e8c=_0x402b92[_0xd0fa('0x1b4')]/0x64;return _0x5b1266[_0xd0fa('0x1cf')](_0x6c0cec,_0x4e38d5,_0x1fd4df,_0x41bd8a,_0x208e8c)['then'](function(_0x42c2ff){return _0x4969a4(_0x42c2ff);});default:return _0x23c0ff(msgResponse(_0xd0fa('0x1d0'),'Failure','Unknown\x20Predictive'));}}else{return _0x23c0ff(msgResponse('[getDataPredictive]',_0xd0fa('0x8b'),'check\x20failure'));}});};};Dialer['prototype'][_0xd0fa('0x1d1')]=function(_0x55a962){var _0x465fbc=this;return function(_0xee00b8){return new Promise(function(_0x2b9655,_0x23a80d){_['merge'](_0x55a962,_0xee00b8[0x0]);if(checkGetDataPredictive(_0xee00b8[0x0])){loggerPredictive[_0xd0fa('0x44')](JSON[_0xd0fa('0x6e')](_0xee00b8[0x0]));if(_0x55a962[_0xd0fa('0x1be')]==='dropRate'){return _0x465fbc[_0xd0fa('0x1d2')](_0x55a962['id'])[_0xd0fa('0x95')](function(_0xdbee75){var _0x241e6d=_0x55a962[_0xd0fa('0x1d3')]-_0xdbee75[0x0]['outboundQueuePauses'];var _0x5dcbb1=_0x55a962['dialPredictiveInterval']*0x3c;var _0x3506c=_0xee00b8[0x0][_0xd0fa('0x4e')]+_0xee00b8[0x0][_0xd0fa('0x1cd')];var _0x49762c=(_0xee00b8[0x0][_0xd0fa('0x49')]+_0xee00b8[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xee00b8[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xee00b8[0x0][_0xd0fa('0x47')];var _0x209ddc=_0x55a962[_0xd0fa('0x1b4')]/0x64;_0x55a962[_0xd0fa('0x1d4')]=_0xdbee75[0x0][_0xd0fa('0x1d5')]||0x0;_0x55a962[_0xd0fa('0x1ba')]=_0x49762c>0x0?_0x49762c:0x1;return _0x465fbc[_0xd0fa('0x1d6')](_0x241e6d,_0x5dcbb1,_0x3506c,_0x49762c,_0x209ddc);})[_0xd0fa('0x95')](function(_0x11be4b){return _0x2b9655(_0x11be4b);})['catch'](function(_0xa8ea60){return _0x23a80d(msgResponse(_0xd0fa('0x1d7'),_0xd0fa('0x8b'),JSON['stringify'](_0xa8ea60)));});}if(_0x55a962['dialPredictiveOptimization']===_0xd0fa('0x1d8')){return _0x465fbc[_0xd0fa('0x1d2')](_0x55a962['id'])[_0xd0fa('0x95')](function(_0x92ca96){var _0x5e5b9f=_0x55a962[_0xd0fa('0x1d3')]-_0x92ca96[0x0][_0xd0fa('0x1d5')];var _0x1a3705=_0x55a962[_0xd0fa('0x1bd')]*0x3c;var _0xfb36f5=_0xee00b8[0x0][_0xd0fa('0x4e')]+_0xee00b8[0x0]['predictiveIntervalAvgHoldtime'];var _0x27f644=(_0xee00b8[0x0][_0xd0fa('0x49')]+_0xee00b8[0x0][_0xd0fa('0x1ce')]+_0xee00b8[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0xee00b8[0x0][_0xd0fa('0x47')];var _0x48e041=_0x55a962[_0xd0fa('0x1b4')]/0x64;_0x55a962[_0xd0fa('0x1d4')]=_0x92ca96[0x0][_0xd0fa('0x1d5')]||0x0;_0x55a962[_0xd0fa('0x1ba')]=_0x27f644>0x0?_0x27f644:0x1;return _0x465fbc[_0xd0fa('0x1cf')](_0x5e5b9f,_0x1a3705,_0xfb36f5,_0x27f644,_0x48e041);})[_0xd0fa('0x95')](function(_0x13ed98){return _0x2b9655(_0x13ed98);})[_0xd0fa('0x98')](function(_0x32c65d){return _0x23a80d(msgResponse(_0xd0fa('0x1d7'),_0xd0fa('0x8b'),JSON['stringify'](_0x32c65d)));});}}else{return _0x23a80d(msgResponse(_0xd0fa('0x1d0'),'Failure',_0xd0fa('0x1d9')));}});};};Dialer[_0xd0fa('0x18')]['startMethodPredictive']=function(_0x476d03){var _0x2b73bf=this;return function(){var _0x10eb0c=0x0;var _0x3705ce=Math['floor'](_0x476d03[_0xd0fa('0x1da')]*0x3e8);if(_0x3705ce>0x0){_0x3705ce=_0x3705ce<0x64?0x64:_0x3705ce;loggerPredictive[_0xd0fa('0x44')](_0x476d03[_0xd0fa('0x41')],_0xd0fa('0x1db'),_0x3705ce,_0xd0fa('0x1dc'));_0x476d03[_0xd0fa('0x5d')]=setInterval(function(){_0x2b73bf[_0xd0fa('0x5d')](_0x476d03);loggerPredictiveCalls[_0xd0fa('0x44')](_0xd0fa('0x1dd'),_0x10eb0c+=0x1);},_0x3705ce);}else{loggerPredictive[_0xd0fa('0x44')](_0x476d03[_0xd0fa('0x41')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xd0fa('0x18')][_0xd0fa('0x1de')]=function(_0x1f243f,_0x4a4bd5){var _0x3e0243=this;return function(_0x506f54){if(_[_0xd0fa('0x43')](_0x506f54)){if(_['isNil'](_0x4a4bd5[_0xd0fa('0x151')])||!_0x4a4bd5[_0xd0fa('0x1df')]){if(_0x1f243f[_0xd0fa('0xad')]==='booked'){_0x1f243f[_0xd0fa('0x6b')]=_[_0xd0fa('0x50')](_0x1f243f[_0xd0fa('0x6b')])?!![]:_0x1f243f[_0xd0fa('0x6b')];var _0x15e696=uuid['v4']();_0x3e0243[_0xd0fa('0x22')][_0x15e696]=new Action(_0x1f243f,_0x4a4bd5,_0x15e696);loggerBooked['info'](_0xd0fa('0x1e0'),_0x15e696,_0xd0fa('0x1e1'),JSON[_0xd0fa('0x6e')](_0x1f243f[_0xd0fa('0x6b')]),_0xd0fa('0x1e2'),_0x1f243f[_0xd0fa('0x41')]);if(_0x1f243f['queueStatusComplete']){_0x1f243f[_0xd0fa('0x6b')]=![];_0x3e0243[_0xd0fa('0x27')][_0x3e0243[_0xd0fa('0x22')][_0x15e696][_0xd0fa('0xb7')]]=[];ami[_0xd0fa('0x149')]({'actionid':_0x15e696,'action':_0xd0fa('0x1e3'),'queue':_0x1f243f[_0xd0fa('0x41')]})[_0xd0fa('0x98')](function(){_0x3e0243[_0xd0fa('0xba')](_0x1f243f);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x3e0243[_0xd0fa('0x22')][_0x15e696][_0xd0fa('0xd9')],'ListId':_0x3e0243['actions'][_0x15e696]['ListId'],'VoiceQueueId':_0x3e0243[_0xd0fa('0x22')][_0x15e696][_0xd0fa('0xdb')]||undefined,'CampaignId':_0x3e0243[_0xd0fa('0x22')][_0x15e696]['CampaignId']||undefined})['catch'](loggerCatch(_0xd0fa('0x1e4')));delete _0x3e0243[_0xd0fa('0x22')][_0x15e696];});}else{loggerBooked[_0xd0fa('0x44')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x1f243f[_0xd0fa('0x6b')]),_0xd0fa('0x1e2'),_0x1f243f[_0xd0fa('0x41')]);_0x3e0243[_0xd0fa('0xba')](_0x1f243f);hopperUtils[_0xd0fa('0xe6')]({'active':![],'ContactId':_0x3e0243['actions'][_0x15e696][_0xd0fa('0xd9')],'ListId':_0x3e0243['actions'][_0x15e696][_0xd0fa('0xda')],'VoiceQueueId':_0x3e0243[_0xd0fa('0x22')][_0x15e696][_0xd0fa('0xdb')]||undefined,'CampaignId':_0x3e0243[_0xd0fa('0x22')][_0x15e696][_0xd0fa('0xdc')]||undefined})[_0xd0fa('0x98')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x3e0243['actions'][_0x15e696];}}else{return _0x3e0243[_0xd0fa('0x1e5')](_0x1f243f,_0x4a4bd5);}}else{if(utils[_0xd0fa('0xc7')](undefined,_0x4a4bd5[_0xd0fa('0x1e6')])<_0x1f243f['dialRecallMeTimeout']*0x3c){if(_0x4a4bd5[_0xd0fa('0x143')]&&!_0x4a4bd5[_0xd0fa('0x143')][_0xd0fa('0x1e7')]){_0x3e0243[_0xd0fa('0xf5')]['run'](_0x4a4bd5['id'])['finally'](function(){_0x3e0243['updateOriginated'](_0x1f243f);});}else{hopperUtils[_0xd0fa('0x1e8')]({'active':![]},_0x4a4bd5['id'],0x1)[_0xd0fa('0x1a')](function(){_0x3e0243[_0xd0fa('0xba')](_0x1f243f);});}}else{_0x1f243f[_0xd0fa('0x1e9')]+=0x1;_0x3e0243[_0xd0fa('0xba')](_0x1f243f);if(_0x1f243f[_0xd0fa('0x1ea')]){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4a4bd5[_0xd0fa('0xd9')],'ListId':_0x4a4bd5[_0xd0fa('0xda')],'VoiceQueueId':_0x4a4bd5['VoiceQueueId']||undefined,'CampaignId':_0x4a4bd5[_0xd0fa('0xdc')]||undefined})[_0xd0fa('0x98')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0xd0fa('0xc3')](createObjHistory(_0x1f243f,_0x4a4bd5,utils[_0xd0fa('0x63')][_0xd0fa('0x1eb')],0x17,_0xd0fa('0x1ec')))[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x1ed')));}else{_0x3e0243[_0xd0fa('0x111')](createObjHistory(_0x1f243f,_0x4a4bd5,utils[_0xd0fa('0x63')]['RECALL_TIMEOUT'],0x16,_0xd0fa('0x1ee')),_0xd0fa('0x1ef'),_0xd0fa('0x1f0'));}}}}else{_0x1f243f['outboundBlacklistCallsDay']+=0x1;_0x3e0243[_0xd0fa('0x111')](createObjHistory(_0x1f243f,_0x4a4bd5,utils['CAMPAIGN_STATUS'][_0xd0fa('0x1f1')],0xd,_0xd0fa('0x1f2')),_0xd0fa('0x1f3'),_0xd0fa('0x1f4'));throw _0xd0fa('0x1f5');}};};Dialer['prototype']['handleIvr']=function(_0x59654e){var _0x5b7e2b=this;var _0x19645f=_0x59654e['limitCalls']-_0x59654e[_0xd0fa('0x7a')]-_0x59654e[_0xd0fa('0x1f6')];emitCampaignSummary(_0x59654e);if(_0x19645f>0x0){if(_0x19645f>this[_0xd0fa('0x20')]){_0x19645f=this[_0xd0fa('0x20')];}_0x59654e['temp']+=_0x19645f;hopperUtils[_0xd0fa('0x1f7')](_0x59654e['id'],_0x19645f,_0x59654e[_0xd0fa('0x1f8')],_0x59654e)['then'](function(_0x29018c){_0x59654e[_0xd0fa('0x1f6')]-=_0x19645f;_0x59654e[_0xd0fa('0x1f6')]=_0x59654e[_0xd0fa('0x1f6')]>0x0?_0x59654e['temp']:0x0;if(!utils[_0xd0fa('0x1f9')](_0x29018c)){_0x59654e['message']=utils['CAMPAIGN_STATUS']['NO_AVAILABLE_CONTACTS'];logger[_0xd0fa('0x44')]('[getContactCampaign2][Empty]'+_0x59654e[_0xd0fa('0x41')]);}else{_0x59654e['originated']+=_0x29018c[_0xd0fa('0x91')];_0x59654e[_0xd0fa('0x62')]=utils[_0xd0fa('0x63')]['RUNNING'];for(var _0x1858f2=0x0;_0x1858f2<_0x29018c[_0xd0fa('0x91')];_0x1858f2+=0x1){_0x59654e[_0xd0fa('0x1fa')]+=0x1;if(_[_0xd0fa('0xef')](_0x29018c[_0x1858f2])||_['isNil'](_0x29018c[_0x1858f2]['Contact'])||_[_0xd0fa('0xef')](_0x29018c[_0x1858f2][_0xd0fa('0x15b')])){_0x5b7e2b['emptyContact'](_0xd0fa('0x1fb'),_0x59654e,_0x29018c[_0x1858f2]);}else{hopperUtils[_0xd0fa('0x1fc')](_['pick'](_0x29018c[_0x1858f2],[_0xd0fa('0xdc'),_0xd0fa('0x15b')]))[_0xd0fa('0x95')](_0x5b7e2b[_0xd0fa('0x1de')](_0x59654e,_0x29018c[_0x1858f2]))[_0xd0fa('0x98')](_0x5b7e2b[_0xd0fa('0x14f')](_0xd0fa('0x1fd'),_0x59654e));}}}})[_0xd0fa('0x98')](loggerGetContactDialer('[getContactCampaign2]',_0x59654e,_0x19645f));}};Dialer[_0xd0fa('0x18')]['handlePower']=function(_0x3d55ba,_0x4d248c){var _0x298105=this;var _0x3badcb=[];if(_0x4d248c<0x1||_0x3d55ba['dialMethod']===_0xd0fa('0x7')){_0x4d248c=0x1;}var _0x388144=Math[_0xd0fa('0x1fe')](_0x3d55ba['available']*_0x4d248c)-_0x3d55ba[_0xd0fa('0x7a')]-_0x3d55ba[_0xd0fa('0x1f6')];if(_0x3d55ba[_0xd0fa('0x1ff')]>0x0){var _0x386947=_0x3d55ba[_0xd0fa('0x1ff')]-_0x3d55ba[_0xd0fa('0x7a')]-_0x3d55ba[_0xd0fa('0x1b9')]-_0x3d55ba[_0xd0fa('0x1f6')]-_0x3d55ba['pTalking'];if(_0x388144>_0x386947){_0x388144=_0x386947;}}if(_0x388144>0x0){if(_0x3d55ba[_0xd0fa('0xad')]===_0xd0fa('0x7')){_0x388144=0x1;}if(_0x388144>this[_0xd0fa('0x20')]){_0x388144=this[_0xd0fa('0x20')];}_0x3d55ba[_0xd0fa('0x1f6')]+=_0x388144;for(var _0x2eb795 in this['agents']){if(typeof this[_0xd0fa('0x1e')][_0x2eb795]!=='undefined'){if(this[_0xd0fa('0x1e')][_0x2eb795]['state']===_0xd0fa('0x200')&&this[_0xd0fa('0x1e')][_0x2eb795][_0xd0fa('0x82')]==='reachable'){_0x3badcb[_0xd0fa('0x92')](this[_0xd0fa('0x1e')][_0x2eb795]['id']);}}}hopperUtils['getContactDialer'](_0x3d55ba,_0x3badcb,_0x388144)[_0xd0fa('0x95')](function(_0x3c4fdf){_0x3d55ba['temp']-=_0x388144;_0x3d55ba[_0xd0fa('0x1f6')]=_0x3d55ba[_0xd0fa('0x1f6')]>0x0?_0x3d55ba[_0xd0fa('0x1f6')]:0x0;if(!utils['checkContactEmpty'](_0x3c4fdf)){hopperUtils['countReScheduled'](_0x3d55ba)['then'](sendMessageReschedule(_0x3d55ba))[_0xd0fa('0x98')](loggerCatch(_0xd0fa('0x201')));}else{_0x3d55ba[_0xd0fa('0x7a')]+=_0x3c4fdf[_0xd0fa('0x91')];_0x3d55ba[_0xd0fa('0x62')]=_0x3d55ba[_0xd0fa('0xad')]===_0xd0fa('0x7')?utils[_0xd0fa('0x63')][_0xd0fa('0x136')]:utils[_0xd0fa('0x63')][_0xd0fa('0x202')];for(var _0x283fa3=0x0;_0x283fa3<_0x3c4fdf['length'];_0x283fa3+=0x1){if(_[_0xd0fa('0xef')](_0x3c4fdf[_0x283fa3])||_[_0xd0fa('0xef')](_0x3c4fdf[_0x283fa3][_0xd0fa('0x170')])||_[_0xd0fa('0xef')](_0x3c4fdf[_0x283fa3][_0xd0fa('0x15b')])){_0x298105['emptyContact'](_0xd0fa('0x1fb'),_0x3d55ba,_0x3c4fdf[_0x283fa3]);}else{hopperUtils[_0xd0fa('0x203')](_['pick'](_0x3c4fdf[_0x283fa3],[_0xd0fa('0xdb'),_0xd0fa('0x15b')]))[_0xd0fa('0x95')](_0x298105[_0xd0fa('0x1de')](_0x3d55ba,_0x3c4fdf[_0x283fa3]))[_0xd0fa('0x98')](_0x298105[_0xd0fa('0x14f')]('[actionOriginate]\x20',_0x3d55ba));}}}})[_0xd0fa('0x98')](loggerGetContactDialer(_0xd0fa('0x204'),_0x3d55ba,_0x388144));}};Dialer[_0xd0fa('0x18')][_0xd0fa('0x5d')]=function(_0x5ba40e){if(_0x5ba40e[_0xd0fa('0x1ff')]>0x0){var _0x4204c8=_0x5ba40e['dialLimitQueue']-_0x5ba40e[_0xd0fa('0x7a')]-_0x5ba40e[_0xd0fa('0x1b9')];if(_0x4204c8>0x0){this['tryOriginatePredictive'](_0x5ba40e);}else{loggerPredictiveCalls[_0xd0fa('0x44')](_0xd0fa('0x205'));}}else{this[_0xd0fa('0x206')](_0x5ba40e);}};Dialer[_0xd0fa('0x18')][_0xd0fa('0x206')]=function(_0x2814ae){var _0xa71771=this;var _0x4a749e=[];_0x2814ae[_0xd0fa('0x7a')]+=0x1;for(var _0x22b81e in this['agents']){if(typeof this[_0xd0fa('0x1e')][_0x22b81e]!=='undefined'){if(this[_0xd0fa('0x1e')][_0x22b81e][_0xd0fa('0x68')]===_0xd0fa('0x200')&&this['agents'][_0x22b81e][_0xd0fa('0x82')]===_0xd0fa('0x141')){_0x4a749e[_0xd0fa('0x92')](this[_0xd0fa('0x1e')][_0x22b81e]['id']);}}}return this['getContactDialer'](_0x2814ae['id'],_0x4a749e,0x1,_0x2814ae[_0xd0fa('0x1f8')],_0x2814ae)[_0xd0fa('0x95')](function(_0x5da608){if(!utils['checkContactEmpty'](_0x5da608)){utils['checkContactLowerLimitOriginate'](_0x2814ae,0x1,0x0);return hopperUtils[_0xd0fa('0x207')](_0x2814ae)[_0xd0fa('0x95')](sendMessageReschedule(_0x2814ae))['catch'](loggerCatch(_0xd0fa('0x201')));}else{_0x2814ae[_0xd0fa('0x62')]=utils[_0xd0fa('0x63')]['RUNNING'];if(_[_0xd0fa('0xef')](_0x5da608[0x0])||_[_0xd0fa('0xef')](_0x5da608[0x0]['Contact'])||_[_0xd0fa('0xef')](_0x5da608[0x0][_0xd0fa('0x15b')])){_0xa71771[_0xd0fa('0x208')](_0xd0fa('0x1fb'),_0x2814ae,_0x5da608[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0xd0fa('0x6f')](_0x5da608[0x0],[_0xd0fa('0xdb'),'phone']))[_0xd0fa('0x95')](_0xa71771[_0xd0fa('0x1de')](_0x2814ae,_0x5da608[0x0]))[_0xd0fa('0x98')](_0xa71771[_0xd0fa('0x14f')](_0xd0fa('0x209'),_0x2814ae));}}})[_0xd0fa('0x98')](loggerGetContactDialer(_0xd0fa('0x20a'),_0x2814ae,0x1));};Dialer[_0xd0fa('0x18')][_0xd0fa('0x1d6')]=function(_0x8ae22a,_0x413ed5,_0x40170f,_0x324aee,_0x2b798d,_0x4cb760){loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x20b'));loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x20c'),_0x8ae22a);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x20d'),_0x413ed5);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x20e'),_0x40170f);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',_0x324aee);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x20f'),_0x2b798d);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x4f'));return new Promise(function(_0x3af70c,_0x1999c6){if(_0x8ae22a<=0x0||isNaN(_0x8ae22a)){return _0x1999c6(msgResponse(_0xd0fa('0x210'),_0xd0fa('0x7e'),'m\x20=\x20'+_0x8ae22a));}if(_0x40170f<=0x0||isNaN(_0x40170f)){return _0x1999c6(msgResponse(_0xd0fa('0x210'),'Error',_0xd0fa('0x211')+_0x40170f));}if(_0x324aee<=0x0||isNaN(_0x324aee)){return _0x1999c6(msgResponse(_0xd0fa('0x210'),'Error',_0xd0fa('0x212')+_0x324aee));}if(_0x413ed5<=0x0||isNaN(_0x413ed5)){return _0x1999c6(msgResponse('[abandonmentRate]',_0xd0fa('0x7e'),_0xd0fa('0x213')+_0x413ed5));}if(_0x2b798d<=0x0||isNaN(_0x2b798d)){return _0x1999c6(msgResponse('[abandonmentRate]','Error','Amax\x20=\x20'+_0x2b798d));}_0x4cb760=_0x4cb760||0x0;var _0x3df581=0x1/_0x40170f;var _0x151827=0x0;var _0x30c879=0x0;var _0x3d9cb7=0x0;var _0x1d74b2=0x0;for(var _0x6d2d6=0x0;_0x3d9cb7<_0x2b798d;_0x6d2d6+=0x1){_0x30c879=_0x6d2d6/_0x413ed5;_0x151827=(_0x324aee*_0x30c879+_0x4cb760)/_0x3df581;_0x3d9cb7=utils[_0xd0fa('0x214')](_0x151827,_0x8ae22a);_0x1d74b2=_0x151827/_0x8ae22a*(0x1-utils[_0xd0fa('0x214')](_0x151827,_0x8ae22a));}return _0x3af70c({'erlangCalls':_0x6d2d6,'erlangCallToSecond':_0x413ed5/_0x6d2d6,'erlangAbandonmentRate':_0x3d9cb7,'erlangBusyFactor':_0x1d74b2});});};Dialer['prototype'][_0xd0fa('0x1cf')]=function(_0x513cf8,_0x3da018,_0x52a9af,_0x181187,_0x3dd1a3,_0x5c7cd4){loggerPredictive[_0xd0fa('0x44')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x20c'),_0x513cf8);loggerPredictive['info'](_0xd0fa('0x20d'),_0x3da018);loggerPredictive[_0xd0fa('0x44')]('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',_0x52a9af);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x215'),_0x181187);loggerPredictive[_0xd0fa('0x44')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3dd1a3);loggerPredictive[_0xd0fa('0x44')](_0xd0fa('0x4f'));return new Promise(function(_0x161442,_0x1404a2){if(_0x513cf8<=0x0||isNaN(_0x513cf8)){return _0x1404a2(msgResponse(_0xd0fa('0x216'),_0xd0fa('0x7e'),'m\x20=\x20'+_0x513cf8));}if(_0x52a9af<=0x0||isNaN(_0x52a9af)){return _0x1404a2(msgResponse(_0xd0fa('0x216'),_0xd0fa('0x7e'),_0xd0fa('0x211')+_0x52a9af));}if(_0x181187<=0x0||isNaN(_0x181187)){return _0x1404a2(msgResponse(_0xd0fa('0x216'),'Error',_0xd0fa('0x212')+_0x181187));}if(_0x3da018<=0x0||isNaN(_0x3da018)){return _0x1404a2(msgResponse('[busyFactor]',_0xd0fa('0x7e'),_0xd0fa('0x213')+_0x3da018));}if(_0x3dd1a3<=0x0||isNaN(_0x3dd1a3)){return _0x1404a2(msgResponse(_0xd0fa('0x216'),_0xd0fa('0x7e'),_0xd0fa('0x217')+_0x3dd1a3));}_0x5c7cd4=_0x5c7cd4||0x0;var _0x2f2abf=0x1/_0x52a9af;var _0x26bd0b=0x0;var _0x386d76=0x0;var _0x298741=0x0;var _0xc6d21a=0x0;for(var _0x458711=0x0;_0xc6d21a<_0x3dd1a3;_0x458711+=0x1){_0x386d76=_0x458711/_0x3da018;_0x26bd0b=(_0x181187*_0x386d76+_0x5c7cd4)/_0x2f2abf;_0x298741=utils[_0xd0fa('0x214')](_0x26bd0b,_0x513cf8);_0xc6d21a=_0x26bd0b/_0x513cf8*(0x1-utils[_0xd0fa('0x214')](_0x26bd0b,_0x513cf8));}return _0x161442({'erlangCalls':_0x458711,'erlangCallToSecond':_0x3da018/_0x458711,'erlangAbandonmentRate':_0x298741,'erlangBusyFactor':_0xc6d21a});});};module[_0xd0fa('0x218')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index 7095824..2ea10b7 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3eb4=['lastName','number','queue','name','active','type','dialQueueTimeout','scheduledat','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','substring','dialCutDigit','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','Contact','phone'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3eb4,0x105));var _0x43eb=function(_0x3f14ae,_0x3a6d1f){_0x3f14ae=_0x3f14ae-0x0;var _0x4b4d0b=_0x3eb4[_0x3f14ae];return _0x4b4d0b;};'use strict';var util=require(_0x43eb('0x0'));var _=require(_0x43eb('0x1'));var moment=require(_0x43eb('0x2'));function checkNameSurname(_0x484448,_0x15cd12,_0x1ebfd7){var _0x44c06b='';if(!_[_0x43eb('0x3')](_0x15cd12)&&_0x43eb('0x4')===typeof _0x15cd12){_0x44c06b+=_0x15cd12;}if(!_[_0x43eb('0x3')](_0x1ebfd7)&&_0x43eb('0x4')===typeof _0x1ebfd7){_0x44c06b+='\x20'+_0x1ebfd7;}if(_0x44c06b!==''){return _0x44c06b;}return _0x484448;}function Action(_0x129bd7,_0xd1cf9d,_0x2be18f){this[_0x43eb('0x5')]=_0x129bd7;this[_0x43eb('0x6')]=_0x2be18f||undefined;this['name']=checkNameSurname(_0xd1cf9d[_0x43eb('0x7')][_0x43eb('0x8')],_0xd1cf9d[_0x43eb('0x7')]['firstName'],_0xd1cf9d[_0x43eb('0x7')][_0x43eb('0x9')]);this[_0x43eb('0xa')]=_0xd1cf9d[_0x43eb('0x8')];this[_0x43eb('0xb')]=_0x129bd7[_0x43eb('0xc')];this['active']=_0xd1cf9d[_0x43eb('0xd')]||![];this[_0x43eb('0xe')]=_0x129bd7[_0x43eb('0xe')];this[_0x43eb('0xf')]=_0x129bd7[_0x43eb('0xf')]||0x3;this[_0x43eb('0x10')]=_0xd1cf9d[_0x43eb('0x10')];this['countbusyretry']=_0xd1cf9d['countbusyretry'];this[_0x43eb('0x11')]=_0xd1cf9d[_0x43eb('0x11')];this[_0x43eb('0x12')]=_0xd1cf9d[_0x43eb('0x12')];this[_0x43eb('0x13')]=_0xd1cf9d[_0x43eb('0x13')];this['countdropretry']=_0xd1cf9d['countdropretry'];this[_0x43eb('0x14')]=_0xd1cf9d[_0x43eb('0x14')];this[_0x43eb('0x15')]=_0xd1cf9d[_0x43eb('0x15')];this[_0x43eb('0x16')]=_0xd1cf9d['countagentrejectretry'];this[_0x43eb('0x17')]=_0xd1cf9d[_0x43eb('0x17')];this[_0x43eb('0x18')]=_0xd1cf9d['ListId'];this[_0x43eb('0x19')]=_0xd1cf9d[_0x43eb('0x19')];this[_0x43eb('0x1a')]=_0xd1cf9d[_0x43eb('0x1a')];this[_0x43eb('0x1b')]=_0xd1cf9d[_0x43eb('0x1b')];this[_0x43eb('0x1c')]=_0xd1cf9d['id'];this[_0x43eb('0x1d')]=_0xd1cf9d[_0x43eb('0x7')]['firstName']||'';this[_0x43eb('0x1e')]=moment()[_0x43eb('0x1f')](_0x43eb('0x20'));this[_0x43eb('0x21')]=_0xd1cf9d[_0x43eb('0x21')];this[_0x43eb('0x22')]=_0xd1cf9d[_0x43eb('0x22')];this['callbackat']=_0xd1cf9d[_0x43eb('0x23')];this[_0x43eb('0x24')]=_0xd1cf9d[_0x43eb('0x24')];this['originatecalleridnum']='';this[_0x43eb('0x25')]='';}Action[_0x43eb('0x26')][_0x43eb('0x27')]=function(){return util[_0x43eb('0x1f')](_0x43eb('0x28'),this[_0x43eb('0xc')],this['voiceQueue']['dialCutDigit']>0x0?this[_0x43eb('0xa')][_0x43eb('0x29')](this[_0x43eb('0x5')][_0x43eb('0x2a')]):this[_0x43eb('0xa')]);};Action['prototype'][_0x43eb('0x2b')]=function(){return this[_0x43eb('0xb')];};module[_0x43eb('0x2c')]=Action; \ No newline at end of file +var _0x90bd=['util','lodash','moment','isNil','string','name','Contact','phone','number','queue','active','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','voiceQueue','dialCutDigit','substring','getQueue','exports'];(function(_0x16da81,_0x6efc64){var _0xfe4774=function(_0x2e2c5d){while(--_0x2e2c5d){_0x16da81['push'](_0x16da81['shift']());}};_0xfe4774(++_0x6efc64);}(_0x90bd,0x1c2));var _0xd90b=function(_0x48999d,_0x1e02cb){_0x48999d=_0x48999d-0x0;var _0x1ad0d1=_0x90bd[_0x48999d];return _0x1ad0d1;};'use strict';var util=require(_0xd90b('0x0'));var _=require(_0xd90b('0x1'));var moment=require(_0xd90b('0x2'));function checkNameSurname(_0x1586e2,_0x3d80f3,_0x7839ce){var _0x4dc496='';if(!_[_0xd90b('0x3')](_0x3d80f3)&&'string'===typeof _0x3d80f3){_0x4dc496+=_0x3d80f3;}if(!_[_0xd90b('0x3')](_0x7839ce)&&_0xd90b('0x4')===typeof _0x7839ce){_0x4dc496+='\x20'+_0x7839ce;}if(_0x4dc496!==''){return _0x4dc496;}return _0x1586e2;}function Action(_0x17a694,_0x139647,_0x25455d){this['voiceQueue']=_0x17a694;this['uniqueid']=_0x25455d||undefined;this[_0xd90b('0x5')]=checkNameSurname(_0x139647[_0xd90b('0x6')][_0xd90b('0x7')],_0x139647[_0xd90b('0x6')]['firstName'],_0x139647[_0xd90b('0x6')]['lastName']);this[_0xd90b('0x8')]=_0x139647[_0xd90b('0x7')];this[_0xd90b('0x9')]=_0x17a694[_0xd90b('0x5')];this[_0xd90b('0xa')]=_0x139647[_0xd90b('0xa')]||![];this['type']=_0x17a694['type'];this[_0xd90b('0xb')]=_0x17a694['dialQueueTimeout']||0x3;this[_0xd90b('0xc')]=_0x139647[_0xd90b('0xc')];this[_0xd90b('0xd')]=_0x139647['countbusyretry'];this[_0xd90b('0xe')]=_0x139647[_0xd90b('0xe')];this[_0xd90b('0xf')]=_0x139647[_0xd90b('0xf')];this[_0xd90b('0x10')]=_0x139647[_0xd90b('0x10')];this[_0xd90b('0x11')]=_0x139647[_0xd90b('0x11')];this[_0xd90b('0x12')]=_0x139647['countabandonedretry'];this[_0xd90b('0x13')]=_0x139647['countmachineretry'];this[_0xd90b('0x14')]=_0x139647[_0xd90b('0x14')];this[_0xd90b('0x15')]=_0x139647[_0xd90b('0x15')];this[_0xd90b('0x16')]=_0x139647[_0xd90b('0x16')];this[_0xd90b('0x17')]=_0x139647[_0xd90b('0x17')];this[_0xd90b('0x18')]=_0x139647[_0xd90b('0x18')];this[_0xd90b('0x19')]=_0x139647[_0xd90b('0x19')];this[_0xd90b('0x1a')]=_0x139647['id'];this[_0xd90b('0x1b')]=_0x139647['Contact'][_0xd90b('0x1c')]||'';this[_0xd90b('0x1d')]=moment()[_0xd90b('0x1e')](_0xd90b('0x1f'));this[_0xd90b('0x20')]=_0x139647[_0xd90b('0x20')];this[_0xd90b('0x21')]=_0x139647['callbackuniqueid'];this['callbackat']=_0x139647[_0xd90b('0x22')];this['recallme']=_0x139647[_0xd90b('0x23')];this[_0xd90b('0x24')]='';this[_0xd90b('0x25')]='';}Action[_0xd90b('0x26')][_0xd90b('0x27')]=function(){return util[_0xd90b('0x1e')]('\x22%s\x22\x20<%s>',this[_0xd90b('0x5')],this[_0xd90b('0x28')][_0xd90b('0x29')]>0x0?this[_0xd90b('0x8')][_0xd90b('0x2a')](this['voiceQueue'][_0xd90b('0x29')]):this[_0xd90b('0x8')]);};Action[_0xd90b('0x26')][_0xd90b('0x2b')]=function(){return this[_0xd90b('0x9')];};module[_0xd90b('0x2c')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index fc64e41..23fed23 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf14f=['reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','../utils','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername'];(function(_0x2a7517,_0x46caf1){var _0x32c1c8=function(_0x36c645){while(--_0x36c645){_0x2a7517['push'](_0x2a7517['shift']());}};_0x32c1c8(++_0x46caf1);}(_0xf14f,0x1c3));var _0xff14=function(_0x46401e,_0x2a345b){_0x46401e=_0x46401e-0x0;var _0x447cba=_0xf14f[_0x46401e];return _0x447cba;};'use strict';var moment=require(_0xff14('0x0'));var utils=require(_0xff14('0x1'));function AgentComplete(_0x25876b,_0x55c3c7){this['state']=0x4;this[_0xff14('0x2')]=_0xff14('0x3');this[_0xff14('0x4')]=_0x25876b[_0xff14('0x4')];this['type']=_0x25876b[_0xff14('0x5')];this[_0xff14('0x6')]=_0x25876b[_0xff14('0x5')]===_0xff14('0x7')?_0xff14('0x8'):_0x25876b[_0xff14('0x5')];this[_0xff14('0x9')]=_0x25876b[_0xff14('0x9')];this[_0xff14('0xa')]=_0x25876b['countcongestionretry'];this['countnoanswerretry']=_0x25876b[_0xff14('0xb')];this[_0xff14('0xc')]=_0x25876b['countbusyretry']+_0x25876b[_0xff14('0xa')]+_0x25876b[_0xff14('0xb')]+_0x25876b[_0xff14('0xd')]+_0x25876b[_0xff14('0xe')]+_0x25876b[_0xff14('0xf')]+_0x25876b[_0xff14('0x10')]+_0x25876b['countagentrejectretry'];this[_0xff14('0xd')]=_0x25876b[_0xff14('0xd')];this[_0xff14('0xe')]=_0x25876b[_0xff14('0xe')];this[_0xff14('0xf')]=_0x25876b['countabandonedretry'];this[_0xff14('0x10')]=_0x25876b['countmachineretry'];this[_0xff14('0x11')]=_0x25876b['countagentrejectretry'];this[_0xff14('0x12')]=_0x55c3c7[_0xff14('0x12')];this[_0xff14('0x13')]=_0x25876b[_0xff14('0x14')];this[_0xff14('0x15')]=_0x25876b['number'];this[_0xff14('0x16')]=_0x25876b[_0xff14('0x16')];this[_0xff14('0x17')]=_0x25876b[_0xff14('0x17')];this[_0xff14('0x18')]=_0x25876b[_0xff14('0x18')];this[_0xff14('0x19')]=moment()[_0xff14('0x1a')](_0xff14('0x1b'));this[_0xff14('0x1c')]=utils[_0xff14('0x1d')](_0x25876b[_0xff14('0x17')],_0x25876b[_0xff14('0x16')]);this[_0xff14('0x1e')]=utils['getSeconds'](_0x25876b[_0xff14('0x18')],_0x25876b['responsetime']);this[_0xff14('0x1f')]=utils['getSeconds'](this[_0xff14('0x19')],_0x25876b[_0xff14('0x18')]);this[_0xff14('0x8')]=_0x55c3c7[_0xff14('0x8')];this[_0xff14('0x20')]=_0x55c3c7[_0xff14('0x20')];this[_0xff14('0x21')]=_0x55c3c7[_0xff14('0x21')];this[_0xff14('0x22')]=_0x25876b[_0xff14('0x22')];this[_0xff14('0x23')]=_0x25876b['callbackuniqueid'];this['callbackat']=_0x25876b[_0xff14('0x24')];this[_0xff14('0x25')]=_0x25876b['recallme'];this['ContactId']=_0x25876b['ContactId'];this[_0xff14('0x26')]=_0x25876b[_0xff14('0x26')];this['UserId']=_0x25876b[_0xff14('0x27')];this[_0xff14('0x28')]=_0x25876b['VoiceQueueId'];this[_0xff14('0x29')]=_0x25876b['CampaignId'];this[_0xff14('0x2a')]=_0x25876b[_0xff14('0x2a')]||'';this['originatecalleridname']=_0x25876b[_0xff14('0x2b')]||'';this['agiafterat']=_0x25876b['agiafterat'];}module['exports']=AgentComplete; \ No newline at end of file +var _0x0cac=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','calleridnum','starttime','responsetime','answertime','endtime','format','ringtime','getSeconds','holdtime','talktime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','moment','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue'];(function(_0x4cf654,_0x25aedc){var _0x2c69f2=function(_0x57a4f7){while(--_0x57a4f7){_0x4cf654['push'](_0x4cf654['shift']());}};_0x2c69f2(++_0x25aedc);}(_0x0cac,0x17a));var _0xc0ca=function(_0x42e25e,_0x46cfd1){_0x42e25e=_0x42e25e-0x0;var _0x1ed3a6=_0x0cac[_0x42e25e];return _0x1ed3a6;};'use strict';var moment=require(_0xc0ca('0x0'));var utils=require('../utils');function AgentComplete(_0x43eb0a,_0x1fbcaa){this[_0xc0ca('0x1')]=0x4;this[_0xc0ca('0x2')]=_0xc0ca('0x3');this[_0xc0ca('0x4')]=_0x43eb0a[_0xc0ca('0x4')];this[_0xc0ca('0x5')]=_0x43eb0a[_0xc0ca('0x5')];this[_0xc0ca('0x6')]=_0x43eb0a['type']===_0xc0ca('0x7')?_0xc0ca('0x8'):_0x43eb0a[_0xc0ca('0x5')];this[_0xc0ca('0x9')]=_0x43eb0a[_0xc0ca('0x9')];this['countcongestionretry']=_0x43eb0a[_0xc0ca('0xa')];this[_0xc0ca('0xb')]=_0x43eb0a[_0xc0ca('0xb')];this[_0xc0ca('0xc')]=_0x43eb0a[_0xc0ca('0x9')]+_0x43eb0a[_0xc0ca('0xa')]+_0x43eb0a[_0xc0ca('0xb')]+_0x43eb0a[_0xc0ca('0xd')]+_0x43eb0a[_0xc0ca('0xe')]+_0x43eb0a[_0xc0ca('0xf')]+_0x43eb0a[_0xc0ca('0x10')]+_0x43eb0a[_0xc0ca('0x11')];this[_0xc0ca('0xd')]=_0x43eb0a['countnosuchnumberretry'];this[_0xc0ca('0xe')]=_0x43eb0a[_0xc0ca('0xe')];this['countabandonedretry']=_0x43eb0a['countabandonedretry'];this[_0xc0ca('0x10')]=_0x43eb0a[_0xc0ca('0x10')];this['countagentrejectretry']=_0x43eb0a[_0xc0ca('0x11')];this[_0xc0ca('0x12')]=_0x1fbcaa[_0xc0ca('0x12')];this[_0xc0ca('0x13')]=_0x43eb0a['name'];this[_0xc0ca('0x14')]=_0x43eb0a['number'];this['starttime']=_0x43eb0a[_0xc0ca('0x15')];this[_0xc0ca('0x16')]=_0x43eb0a[_0xc0ca('0x16')];this[_0xc0ca('0x17')]=_0x43eb0a[_0xc0ca('0x17')];this[_0xc0ca('0x18')]=moment()[_0xc0ca('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc0ca('0x1a')]=utils[_0xc0ca('0x1b')](_0x43eb0a[_0xc0ca('0x16')],_0x43eb0a['starttime']);this[_0xc0ca('0x1c')]=utils['getSeconds'](_0x43eb0a[_0xc0ca('0x17')],_0x43eb0a[_0xc0ca('0x16')]);this[_0xc0ca('0x1d')]=utils[_0xc0ca('0x1b')](this['endtime'],_0x43eb0a[_0xc0ca('0x17')]);this[_0xc0ca('0x8')]=_0x1fbcaa['queue'];this[_0xc0ca('0x1e')]=_0x1fbcaa[_0xc0ca('0x1e')];this['reason']=_0x1fbcaa['reason'];this[_0xc0ca('0x1f')]=_0x43eb0a[_0xc0ca('0x1f')];this[_0xc0ca('0x20')]=_0x43eb0a['callbackuniqueid'];this[_0xc0ca('0x21')]=_0x43eb0a[_0xc0ca('0x21')];this[_0xc0ca('0x22')]=_0x43eb0a[_0xc0ca('0x22')];this[_0xc0ca('0x23')]=_0x43eb0a[_0xc0ca('0x23')];this[_0xc0ca('0x24')]=_0x43eb0a[_0xc0ca('0x24')];this[_0xc0ca('0x25')]=_0x43eb0a['UserId'];this['VoiceQueueId']=_0x43eb0a[_0xc0ca('0x26')];this[_0xc0ca('0x27')]=_0x43eb0a[_0xc0ca('0x27')];this[_0xc0ca('0x28')]=_0x43eb0a[_0xc0ca('0x28')]||'';this[_0xc0ca('0x29')]=_0x43eb0a[_0xc0ca('0x29')]||'';this[_0xc0ca('0x2a')]=_0x43eb0a[_0xc0ca('0x2a')];}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index 8bb224d..f5fb23d 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f6e=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countagentrejectretry','countdropretry','countabandonedretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x1f6e,0xb0));var _0xe1f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1f6e[_0x3dd15e];return _0x231fd0;};'use strict';function Final(_0x398ab1){this['uniqueid']=_0x398ab1[_0xe1f6('0x0')];this[_0xe1f6('0x1')]=_0x398ab1[_0xe1f6('0x1')];this[_0xe1f6('0x2')]=_0x398ab1[_0xe1f6('0x2')];this[_0xe1f6('0x3')]=_0x398ab1['type']==='outbound'?_0xe1f6('0x4'):_0x398ab1[_0xe1f6('0x2')];this['countbusyretry']=_0x398ab1[_0xe1f6('0x5')];this['countcongestionretry']=_0x398ab1[_0xe1f6('0x6')];this[_0xe1f6('0x7')]=_0x398ab1[_0xe1f6('0x7')];this[_0xe1f6('0x8')]=_0x398ab1[_0xe1f6('0x5')]+_0x398ab1['countcongestionretry']+_0x398ab1[_0xe1f6('0x7')]+_0x398ab1[_0xe1f6('0x9')]+_0x398ab1['countdropretry']+_0x398ab1['countabandonedretry']+_0x398ab1['countmachineretry']+_0x398ab1[_0xe1f6('0xa')];this['countnosuchnumberretry']=_0x398ab1[_0xe1f6('0x9')];this[_0xe1f6('0xb')]=_0x398ab1[_0xe1f6('0xb')];this[_0xe1f6('0xc')]=_0x398ab1['countabandonedretry'];this[_0xe1f6('0xd')]=_0x398ab1[_0xe1f6('0xd')];this[_0xe1f6('0xa')]=_0x398ab1[_0xe1f6('0xa')];this[_0xe1f6('0x4')]=_0x398ab1[_0xe1f6('0x4')];this[_0xe1f6('0xe')]=_0x398ab1[_0xe1f6('0xe')];this[_0xe1f6('0xf')]=_0x398ab1[_0xe1f6('0xf')];this[_0xe1f6('0x10')]=_0x398ab1[_0xe1f6('0x10')];this[_0xe1f6('0x11')]=_0x398ab1['responsetime'];this[_0xe1f6('0x12')]=_0x398ab1[_0xe1f6('0x11')];this[_0xe1f6('0x13')]=_0x398ab1[_0xe1f6('0x13')]||0x0;this[_0xe1f6('0x14')]=_0x398ab1[_0xe1f6('0x14')]||0x0;this[_0xe1f6('0x15')]=_0x398ab1['talktime']||0x0;this[_0xe1f6('0x16')]=_0x398ab1[_0xe1f6('0x16')];this[_0xe1f6('0x17')]=_0x398ab1[_0xe1f6('0x17')];this['callbackat']=_0x398ab1[_0xe1f6('0x18')];this[_0xe1f6('0x19')]=_0x398ab1[_0xe1f6('0x19')];this[_0xe1f6('0x1a')]=_0x398ab1['ContactId'];this[_0xe1f6('0x1b')]=_0x398ab1[_0xe1f6('0x1b')];this['UserId']=_0x398ab1[_0xe1f6('0x1c')];this['VoiceQueueId']=_0x398ab1[_0xe1f6('0x1d')];this['CampaignId']=_0x398ab1[_0xe1f6('0x1e')];this[_0xe1f6('0x1f')]=_0x398ab1[_0xe1f6('0x1f')]||'';this[_0xe1f6('0x20')]=_0x398ab1[_0xe1f6('0x20')]||'';this[_0xe1f6('0x21')]=_0x398ab1['state'];this[_0xe1f6('0x22')]=_0x398ab1[_0xe1f6('0x22')];}module[_0xe1f6('0x23')]=Final; \ No newline at end of file +var _0xb7d4=['ringtime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','statedesc','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum','starttime','responsetime','endtime'];(function(_0x4343ab,_0x3404cd){var _0x23728d=function(_0x51fb39){while(--_0x51fb39){_0x4343ab['push'](_0x4343ab['shift']());}};_0x23728d(++_0x3404cd);}(_0xb7d4,0xe5));var _0x4b7d=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xb7d4[_0x178e48];return _0x440d7e;};'use strict';function Final(_0x44c3c8){this[_0x4b7d('0x0')]=_0x44c3c8['uniqueid'];this[_0x4b7d('0x1')]=_0x44c3c8[_0x4b7d('0x1')];this[_0x4b7d('0x2')]=_0x44c3c8[_0x4b7d('0x2')];this[_0x4b7d('0x3')]=_0x44c3c8[_0x4b7d('0x2')]==='outbound'?_0x4b7d('0x4'):_0x44c3c8[_0x4b7d('0x2')];this[_0x4b7d('0x5')]=_0x44c3c8[_0x4b7d('0x5')];this['countcongestionretry']=_0x44c3c8[_0x4b7d('0x6')];this[_0x4b7d('0x7')]=_0x44c3c8[_0x4b7d('0x7')];this[_0x4b7d('0x8')]=_0x44c3c8['countbusyretry']+_0x44c3c8['countcongestionretry']+_0x44c3c8[_0x4b7d('0x7')]+_0x44c3c8['countnosuchnumberretry']+_0x44c3c8[_0x4b7d('0x9')]+_0x44c3c8[_0x4b7d('0xa')]+_0x44c3c8[_0x4b7d('0xb')]+_0x44c3c8[_0x4b7d('0xc')];this[_0x4b7d('0xd')]=_0x44c3c8[_0x4b7d('0xd')];this[_0x4b7d('0x9')]=_0x44c3c8['countdropretry'];this[_0x4b7d('0xa')]=_0x44c3c8['countabandonedretry'];this[_0x4b7d('0xb')]=_0x44c3c8['countmachineretry'];this['countagentrejectretry']=_0x44c3c8['countagentrejectretry'];this[_0x4b7d('0x4')]=_0x44c3c8[_0x4b7d('0x4')];this['calleridname']=_0x44c3c8[_0x4b7d('0xe')];this[_0x4b7d('0xf')]=_0x44c3c8[_0x4b7d('0xf')];this['starttime']=_0x44c3c8[_0x4b7d('0x10')];this[_0x4b7d('0x11')]=_0x44c3c8['responsetime'];this[_0x4b7d('0x12')]=_0x44c3c8[_0x4b7d('0x11')];this[_0x4b7d('0x13')]=_0x44c3c8[_0x4b7d('0x13')]||0x0;this['holdtime']=_0x44c3c8['holdtime']||0x0;this['talktime']=_0x44c3c8['talktime']||0x0;this[_0x4b7d('0x14')]=_0x44c3c8[_0x4b7d('0x14')];this[_0x4b7d('0x15')]=_0x44c3c8[_0x4b7d('0x15')];this[_0x4b7d('0x16')]=_0x44c3c8[_0x4b7d('0x16')];this[_0x4b7d('0x17')]=_0x44c3c8[_0x4b7d('0x17')];this[_0x4b7d('0x18')]=_0x44c3c8['ContactId'];this['ListId']=_0x44c3c8['ListId'];this[_0x4b7d('0x19')]=_0x44c3c8['UserId'];this[_0x4b7d('0x1a')]=_0x44c3c8[_0x4b7d('0x1a')];this[_0x4b7d('0x1b')]=_0x44c3c8['CampaignId'];this[_0x4b7d('0x1c')]=_0x44c3c8['originatecalleridnum']||'';this[_0x4b7d('0x1d')]=_0x44c3c8['originatecalleridname']||'';this['state']=_0x44c3c8['state'];this[_0x4b7d('0x1e')]=_0x44c3c8[_0x4b7d('0x1e')];}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 98ea07a..f6f2f36 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfe00=['starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','state','statedesc','Answer','scheduledat','type','campaigntype','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xfe00,0x6d));var _0x0fe0=function(_0xf6ec0b,_0x3d8b8c){_0xf6ec0b=_0xf6ec0b-0x0;var _0x3c31b9=_0xfe00[_0xf6ec0b];return _0x3c31b9;};'use strict';var moment=require(_0x0fe0('0x0'));var utils=require('../utils');function Hangup(_0x4f2bc9,_0x3e165c){this[_0x0fe0('0x1')]=0x4;this[_0x0fe0('0x2')]=_0x0fe0('0x3');this[_0x0fe0('0x4')]=_0x4f2bc9[_0x0fe0('0x4')];this[_0x0fe0('0x5')]=_0x4f2bc9['type'];this[_0x0fe0('0x6')]=_0x4f2bc9[_0x0fe0('0x5')]==='outbound'?_0x0fe0('0x7'):_0x4f2bc9[_0x0fe0('0x5')];this[_0x0fe0('0x8')]=_0x4f2bc9['amd']||![];this[_0x0fe0('0x9')]=_0x4f2bc9[_0x0fe0('0x9')];this[_0x0fe0('0xa')]=_0x4f2bc9[_0x0fe0('0xa')];this[_0x0fe0('0xb')]=_0x4f2bc9[_0x0fe0('0xb')];this[_0x0fe0('0xc')]=_0x4f2bc9[_0x0fe0('0x9')]+_0x4f2bc9['countcongestionretry']+_0x4f2bc9[_0x0fe0('0xb')]+_0x4f2bc9['countnosuchnumberretry']+_0x4f2bc9['countdropretry']+_0x4f2bc9[_0x0fe0('0xd')]+_0x4f2bc9['countmachineretry']+_0x4f2bc9[_0x0fe0('0xe')];this[_0x0fe0('0xf')]=_0x4f2bc9[_0x0fe0('0xf')];this['countdropretry']=_0x4f2bc9[_0x0fe0('0x10')];this[_0x0fe0('0xd')]=_0x4f2bc9[_0x0fe0('0xd')];this[_0x0fe0('0x11')]=_0x4f2bc9['countmachineretry'];this['countagentrejectretry']=_0x4f2bc9[_0x0fe0('0xe')];this[_0x0fe0('0x12')]=_0x3e165c['uniqueid'];this[_0x0fe0('0x13')]=_0x4f2bc9[_0x0fe0('0x14')];this[_0x0fe0('0x15')]=_0x4f2bc9[_0x0fe0('0x16')];this[_0x0fe0('0x17')]=_0x4f2bc9[_0x0fe0('0x17')];this[_0x0fe0('0x18')]=_0x4f2bc9[_0x0fe0('0x18')];this['endtime']=moment()[_0x0fe0('0x19')](_0x0fe0('0x1a'));this[_0x0fe0('0x1b')]=utils[_0x0fe0('0x1c')](_0x4f2bc9[_0x0fe0('0x18')],_0x4f2bc9[_0x0fe0('0x17')]);this[_0x0fe0('0x1d')]=0x0;this[_0x0fe0('0x1e')]=utils[_0x0fe0('0x1c')](this[_0x0fe0('0x1f')],_0x4f2bc9[_0x0fe0('0x18')]);this[_0x0fe0('0x7')]=_0x4f2bc9[_0x0fe0('0x7')];this['membername']='IVR';this[_0x0fe0('0x20')]=_0x3e165c[_0x0fe0('0x21')];this[_0x0fe0('0x22')]=_0x4f2bc9[_0x0fe0('0x22')];this[_0x0fe0('0x23')]=_0x4f2bc9['callbackuniqueid'];this[_0x0fe0('0x24')]=_0x4f2bc9[_0x0fe0('0x24')];this[_0x0fe0('0x25')]=_0x4f2bc9[_0x0fe0('0x25')];this[_0x0fe0('0x26')]=_0x4f2bc9['ContactId'];this['ListId']=_0x4f2bc9[_0x0fe0('0x27')];this[_0x0fe0('0x28')]=_0x4f2bc9[_0x0fe0('0x28')];this['VoiceQueueId']=_0x4f2bc9[_0x0fe0('0x29')];this['CampaignId']=_0x4f2bc9[_0x0fe0('0x2a')];}module[_0x0fe0('0x2b')]=Hangup; \ No newline at end of file +var _0x67b6=['calleridnum','number','starttime','responsetime','endtime','format','ringtime','getSeconds','holdtime','talktime','queue','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','state','Answer','scheduledat','type','campaigntype','outbound','amd','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name'];(function(_0x4fa6a3,_0x2e411a){var _0x422238=function(_0x3a7a88){while(--_0x3a7a88){_0x4fa6a3['push'](_0x4fa6a3['shift']());}};_0x422238(++_0x2e411a);}(_0x67b6,0xed));var _0x667b=function(_0x248306,_0x2ab559){_0x248306=_0x248306-0x0;var _0x478118=_0x67b6[_0x248306];return _0x478118;};'use strict';var moment=require(_0x667b('0x0'));var utils=require(_0x667b('0x1'));function Hangup(_0x3a9601,_0x1fffee){this[_0x667b('0x2')]=0x4;this['statedesc']=_0x667b('0x3');this[_0x667b('0x4')]=_0x3a9601[_0x667b('0x4')];this[_0x667b('0x5')]=_0x3a9601[_0x667b('0x5')];this[_0x667b('0x6')]=_0x3a9601[_0x667b('0x5')]===_0x667b('0x7')?'queue':_0x3a9601[_0x667b('0x5')];this[_0x667b('0x8')]=_0x3a9601[_0x667b('0x8')]||![];this['countbusyretry']=_0x3a9601['countbusyretry'];this['countcongestionretry']=_0x3a9601[_0x667b('0x9')];this['countnoanswerretry']=_0x3a9601[_0x667b('0xa')];this[_0x667b('0xb')]=_0x3a9601[_0x667b('0xc')]+_0x3a9601['countcongestionretry']+_0x3a9601[_0x667b('0xa')]+_0x3a9601[_0x667b('0xd')]+_0x3a9601[_0x667b('0xe')]+_0x3a9601[_0x667b('0xf')]+_0x3a9601[_0x667b('0x10')]+_0x3a9601['countagentrejectretry'];this[_0x667b('0xd')]=_0x3a9601[_0x667b('0xd')];this['countdropretry']=_0x3a9601[_0x667b('0xe')];this['countabandonedretry']=_0x3a9601['countabandonedretry'];this[_0x667b('0x10')]=_0x3a9601['countmachineretry'];this[_0x667b('0x11')]=_0x3a9601['countagentrejectretry'];this[_0x667b('0x12')]=_0x1fffee[_0x667b('0x12')];this[_0x667b('0x13')]=_0x3a9601[_0x667b('0x14')];this[_0x667b('0x15')]=_0x3a9601[_0x667b('0x16')];this[_0x667b('0x17')]=_0x3a9601[_0x667b('0x17')];this['responsetime']=_0x3a9601[_0x667b('0x18')];this[_0x667b('0x19')]=moment()[_0x667b('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x667b('0x1b')]=utils[_0x667b('0x1c')](_0x3a9601[_0x667b('0x18')],_0x3a9601['starttime']);this[_0x667b('0x1d')]=0x0;this[_0x667b('0x1e')]=utils['getSeconds'](this[_0x667b('0x19')],_0x3a9601[_0x667b('0x18')]);this['queue']=_0x3a9601[_0x667b('0x1f')];this['membername']=_0x667b('0x20');this['reason']=_0x1fffee[_0x667b('0x21')];this[_0x667b('0x22')]=_0x3a9601['callback'];this[_0x667b('0x23')]=_0x3a9601[_0x667b('0x23')];this['callbackat']=_0x3a9601[_0x667b('0x24')];this[_0x667b('0x25')]=_0x3a9601[_0x667b('0x25')];this['ContactId']=_0x3a9601['ContactId'];this[_0x667b('0x26')]=_0x3a9601['ListId'];this[_0x667b('0x27')]=_0x3a9601['UserId'];this[_0x667b('0x28')]=_0x3a9601['VoiceQueueId'];this['CampaignId']=_0x3a9601[_0x667b('0x29')];}module[_0x667b('0x2a')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 3ae35fe..54faeca 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4d21=['countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','name','responsetime','getSeconds','starttime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry'];(function(_0x263f9d,_0x3d854e){var _0x4c4efa=function(_0x48d506){while(--_0x48d506){_0x263f9d['push'](_0x263f9d['shift']());}};_0x4c4efa(++_0x3d854e);}(_0x4d21,0x7c));var _0x14d2=function(_0x493fe2,_0xb64d6c){_0x493fe2=_0x493fe2-0x0;var _0x24e309=_0x4d21[_0x493fe2];return _0x24e309;};'use strict';var utils=require(_0x14d2('0x0'));function History(_0x38e449){this[_0x14d2('0x1')]=_0x38e449['uniqueid'];this[_0x14d2('0x2')]=_0x38e449['scheduledat']||undefined;this[_0x14d2('0x3')]=_0x38e449[_0x14d2('0x3')];this[_0x14d2('0x4')]=_0x38e449[_0x14d2('0x3')]===_0x14d2('0x5')?_0x14d2('0x6'):_0x38e449[_0x14d2('0x3')];this['countbusyretry']=_0x38e449[_0x14d2('0x7')];this[_0x14d2('0x8')]=_0x38e449[_0x14d2('0x8')];this[_0x14d2('0x9')]=_0x38e449['countnoanswerretry'];this['countglobal']=_0x38e449['countbusyretry']+_0x38e449[_0x14d2('0x8')]+_0x38e449[_0x14d2('0x9')]+_0x38e449[_0x14d2('0xa')]+_0x38e449[_0x14d2('0xb')]+_0x38e449[_0x14d2('0xc')]+_0x38e449['countmachineretry']+_0x38e449[_0x14d2('0xd')];this[_0x14d2('0xa')]=_0x38e449[_0x14d2('0xa')];this['countdropretry']=_0x38e449[_0x14d2('0xb')];this[_0x14d2('0xc')]=_0x38e449[_0x14d2('0xc')];this['countmachineretry']=_0x38e449[_0x14d2('0xe')];this[_0x14d2('0xd')]=_0x38e449['countagentrejectretry'];this['queue']=_0x38e449['queue'];this['calleridname']=_0x38e449[_0x14d2('0xf')];this['calleridnum']=_0x38e449['number'];this['starttime']=_0x38e449['starttime'];this[_0x14d2('0x10')]=_0x38e449[_0x14d2('0x10')];this['endtime']=_0x38e449[_0x14d2('0x10')];this['ringtime']=utils[_0x14d2('0x11')](_0x38e449[_0x14d2('0x10')],_0x38e449[_0x14d2('0x12')]);this['holdtime']=0x0;this[_0x14d2('0x13')]=0x0;this['callback']=_0x38e449['callback'];this[_0x14d2('0x14')]=_0x38e449[_0x14d2('0x14')];this[_0x14d2('0x15')]=_0x38e449[_0x14d2('0x15')];this[_0x14d2('0x16')]=_0x38e449[_0x14d2('0x16')];this[_0x14d2('0x17')]=_0x38e449[_0x14d2('0x17')];this[_0x14d2('0x18')]=_0x38e449[_0x14d2('0x18')];this[_0x14d2('0x19')]=_0x38e449['UserId'];this['VoiceQueueId']=_0x38e449[_0x14d2('0x1a')];this['CampaignId']=_0x38e449[_0x14d2('0x1b')];this[_0x14d2('0x1c')]=_0x38e449[_0x14d2('0x1c')]||'';this[_0x14d2('0x1d')]=_0x38e449[_0x14d2('0x1d')]||'';this['state']=_0x38e449[_0x14d2('0x1e')];this[_0x14d2('0x1f')]=_0x38e449[_0x14d2('0x1f')];}module[_0x14d2('0x20')]=History; \ No newline at end of file +var _0x46e2=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','starttime','responsetime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x4d4f4f,_0x32b2e2){var _0x5d48bc=function(_0x5a15de){while(--_0x5a15de){_0x4d4f4f['push'](_0x4d4f4f['shift']());}};_0x5d48bc(++_0x32b2e2);}(_0x46e2,0x114));var _0x246e=function(_0x549867,_0x33d66f){_0x549867=_0x549867-0x0;var _0x599d40=_0x46e2[_0x549867];return _0x599d40;};'use strict';var utils=require(_0x246e('0x0'));function History(_0x31e099){this[_0x246e('0x1')]=_0x31e099['uniqueid'];this[_0x246e('0x2')]=_0x31e099['scheduledat']||undefined;this[_0x246e('0x3')]=_0x31e099[_0x246e('0x3')];this[_0x246e('0x4')]=_0x31e099['type']===_0x246e('0x5')?_0x246e('0x6'):_0x31e099['type'];this['countbusyretry']=_0x31e099[_0x246e('0x7')];this[_0x246e('0x8')]=_0x31e099[_0x246e('0x8')];this[_0x246e('0x9')]=_0x31e099[_0x246e('0x9')];this[_0x246e('0xa')]=_0x31e099[_0x246e('0x7')]+_0x31e099[_0x246e('0x8')]+_0x31e099[_0x246e('0x9')]+_0x31e099[_0x246e('0xb')]+_0x31e099[_0x246e('0xc')]+_0x31e099[_0x246e('0xd')]+_0x31e099[_0x246e('0xe')]+_0x31e099[_0x246e('0xf')];this[_0x246e('0xb')]=_0x31e099[_0x246e('0xb')];this[_0x246e('0xc')]=_0x31e099[_0x246e('0xc')];this[_0x246e('0xd')]=_0x31e099['countabandonedretry'];this['countmachineretry']=_0x31e099[_0x246e('0xe')];this[_0x246e('0xf')]=_0x31e099[_0x246e('0xf')];this[_0x246e('0x6')]=_0x31e099[_0x246e('0x6')];this[_0x246e('0x10')]=_0x31e099[_0x246e('0x11')];this[_0x246e('0x12')]=_0x31e099['number'];this[_0x246e('0x13')]=_0x31e099['starttime'];this[_0x246e('0x14')]=_0x31e099['responsetime'];this['endtime']=_0x31e099[_0x246e('0x14')];this[_0x246e('0x15')]=utils['getSeconds'](_0x31e099['responsetime'],_0x31e099['starttime']);this[_0x246e('0x16')]=0x0;this['talktime']=0x0;this[_0x246e('0x17')]=_0x31e099[_0x246e('0x17')];this[_0x246e('0x18')]=_0x31e099[_0x246e('0x18')];this[_0x246e('0x19')]=_0x31e099[_0x246e('0x19')];this['recallme']=_0x31e099[_0x246e('0x1a')];this[_0x246e('0x1b')]=_0x31e099[_0x246e('0x1b')];this[_0x246e('0x1c')]=_0x31e099[_0x246e('0x1c')];this[_0x246e('0x1d')]=_0x31e099[_0x246e('0x1d')];this[_0x246e('0x1e')]=_0x31e099['VoiceQueueId'];this[_0x246e('0x1f')]=_0x31e099['CampaignId'];this['originatecalleridnum']=_0x31e099['originatecalleridnum']||'';this[_0x246e('0x20')]=_0x31e099['originatecalleridname']||'';this['state']=_0x31e099[_0x246e('0x21')];this['statedesc']=_0x31e099[_0x246e('0x22')];}module[_0x246e('0x23')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index e5e88d6..a041a79 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x909c=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','uniqueid','calleridname','calleridnum','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x25e109,_0x6ab24c){var _0xc0f7d6=function(_0x2fb92b){while(--_0x2fb92b){_0x25e109['push'](_0x25e109['shift']());}};_0xc0f7d6(++_0x6ab24c);}(_0x909c,0x1b5));var _0xc909=function(_0x5772a1,_0x1c0ce9){_0x5772a1=_0x5772a1-0x0;var _0x2db4a1=_0x909c[_0x5772a1];return _0x2db4a1;};'use strict';var utils=require(_0xc909('0x0'));function QueueCallerAbandon(_0x46f0c5,_0x2d5260){this[_0xc909('0x1')]=_0x46f0c5[_0xc909('0x1')];this[_0xc909('0x2')]=_0x46f0c5[_0xc909('0x2')];this[_0xc909('0x3')]=_0x46f0c5[_0xc909('0x2')]===_0xc909('0x4')?_0xc909('0x5'):_0x46f0c5[_0xc909('0x2')];this[_0xc909('0x6')]=_0x46f0c5['countbusyretry'];this[_0xc909('0x7')]=_0x46f0c5[_0xc909('0x7')];this[_0xc909('0x8')]=_0x46f0c5[_0xc909('0x8')];this['countglobal']=_0x46f0c5[_0xc909('0x6')]+_0x46f0c5[_0xc909('0x7')]+_0x46f0c5[_0xc909('0x8')]+_0x46f0c5[_0xc909('0x9')]+_0x46f0c5[_0xc909('0xa')]+_0x46f0c5[_0xc909('0xb')]+_0x46f0c5['countmachineretry']+_0x46f0c5[_0xc909('0xc')];this[_0xc909('0x9')]=_0x46f0c5['countnosuchnumberretry'];this[_0xc909('0xa')]=_0x46f0c5[_0xc909('0xa')];this[_0xc909('0xb')]=_0x46f0c5[_0xc909('0xb')];this['countmachineretry']=_0x46f0c5['countmachineretry'];this[_0xc909('0xc')]=_0x46f0c5[_0xc909('0xc')];this[_0xc909('0xd')]=_0x2d5260[_0xc909('0xd')];this[_0xc909('0xe')]=_0x46f0c5['name'];this[_0xc909('0xf')]=_0x46f0c5['number'];this[_0xc909('0x10')]=_0x46f0c5[_0xc909('0x10')];this[_0xc909('0x11')]=_0x46f0c5[_0xc909('0x11')];this[_0xc909('0x12')]=_0x46f0c5[_0xc909('0x12')];this[_0xc909('0x13')]=_0x46f0c5[_0xc909('0x13')];this[_0xc909('0x14')]=this[_0xc909('0x12')];this[_0xc909('0x15')]=utils[_0xc909('0x16')](_0x46f0c5['responsetime'],_0x46f0c5[_0xc909('0x10')]);this['holdtime']=utils[_0xc909('0x16')](this[_0xc909('0x12')],_0x46f0c5[_0xc909('0x11')]);this[_0xc909('0x17')]=0x0;this[_0xc909('0x5')]=_0x2d5260[_0xc909('0x5')];this['membername']=_0x2d5260['connectedlinename'];this[_0xc909('0x18')]=_0x2d5260[_0xc909('0x18')];this[_0xc909('0x19')]=_0x46f0c5[_0xc909('0x19')];this[_0xc909('0x1a')]=_0x46f0c5[_0xc909('0x1a')];this[_0xc909('0x1b')]=_0x46f0c5['callbackat'];this[_0xc909('0x1c')]=_0x46f0c5['recallme'];this[_0xc909('0x1d')]=_0x46f0c5[_0xc909('0x1d')];this[_0xc909('0x1e')]=_0x46f0c5[_0xc909('0x1e')];this[_0xc909('0x1f')]=_0x46f0c5[_0xc909('0x1f')];this[_0xc909('0x20')]=_0x46f0c5['VoiceQueueId'];this[_0xc909('0x21')]=_0x46f0c5['CampaignId'];this[_0xc909('0x22')]=_0x46f0c5[_0xc909('0x22')]||'';this[_0xc909('0x23')]=_0x46f0c5[_0xc909('0x23')]||'';this[_0xc909('0x24')]=_0x46f0c5[_0xc909('0x24')];this[_0xc909('0x25')]=_0x46f0c5[_0xc909('0x25')];this['statedesc']=_0x46f0c5[_0xc909('0x26')];}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xeabd=['membername','connectedlinename','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','name','number','starttime','responsetime','droptime','dropreason','ringtime','getSeconds','holdtime'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xeabd,0xb4));var _0xdeab=function(_0xd9fc62,_0x338164){_0xd9fc62=_0xd9fc62-0x0;var _0x5cb280=_0xeabd[_0xd9fc62];return _0x5cb280;};'use strict';var utils=require(_0xdeab('0x0'));function QueueCallerAbandon(_0x5d5609,_0x2dbf1e){this[_0xdeab('0x1')]=_0x5d5609[_0xdeab('0x1')];this[_0xdeab('0x2')]=_0x5d5609[_0xdeab('0x2')];this[_0xdeab('0x3')]=_0x5d5609['type']===_0xdeab('0x4')?_0xdeab('0x5'):_0x5d5609[_0xdeab('0x2')];this[_0xdeab('0x6')]=_0x5d5609[_0xdeab('0x6')];this[_0xdeab('0x7')]=_0x5d5609[_0xdeab('0x7')];this[_0xdeab('0x8')]=_0x5d5609[_0xdeab('0x8')];this[_0xdeab('0x9')]=_0x5d5609[_0xdeab('0x6')]+_0x5d5609[_0xdeab('0x7')]+_0x5d5609[_0xdeab('0x8')]+_0x5d5609[_0xdeab('0xa')]+_0x5d5609['countdropretry']+_0x5d5609[_0xdeab('0xb')]+_0x5d5609[_0xdeab('0xc')]+_0x5d5609[_0xdeab('0xd')];this[_0xdeab('0xa')]=_0x5d5609[_0xdeab('0xa')];this['countdropretry']=_0x5d5609[_0xdeab('0xe')];this[_0xdeab('0xb')]=_0x5d5609[_0xdeab('0xb')];this[_0xdeab('0xc')]=_0x5d5609['countmachineretry'];this[_0xdeab('0xd')]=_0x5d5609[_0xdeab('0xd')];this[_0xdeab('0xf')]=_0x2dbf1e['uniqueid'];this['calleridname']=_0x5d5609[_0xdeab('0x10')];this['calleridnum']=_0x5d5609[_0xdeab('0x11')];this[_0xdeab('0x12')]=_0x5d5609['starttime'];this[_0xdeab('0x13')]=_0x5d5609[_0xdeab('0x13')];this[_0xdeab('0x14')]=_0x5d5609['droptime'];this[_0xdeab('0x15')]=_0x5d5609[_0xdeab('0x15')];this['endtime']=this[_0xdeab('0x14')];this[_0xdeab('0x16')]=utils[_0xdeab('0x17')](_0x5d5609[_0xdeab('0x13')],_0x5d5609[_0xdeab('0x12')]);this[_0xdeab('0x18')]=utils[_0xdeab('0x17')](this[_0xdeab('0x14')],_0x5d5609[_0xdeab('0x13')]);this['talktime']=0x0;this[_0xdeab('0x5')]=_0x2dbf1e['queue'];this[_0xdeab('0x19')]=_0x2dbf1e[_0xdeab('0x1a')];this['reason']=_0x2dbf1e['reason'];this[_0xdeab('0x1b')]=_0x5d5609[_0xdeab('0x1b')];this[_0xdeab('0x1c')]=_0x5d5609[_0xdeab('0x1c')];this[_0xdeab('0x1d')]=_0x5d5609[_0xdeab('0x1d')];this[_0xdeab('0x1e')]=_0x5d5609[_0xdeab('0x1e')];this[_0xdeab('0x1f')]=_0x5d5609[_0xdeab('0x1f')];this[_0xdeab('0x20')]=_0x5d5609[_0xdeab('0x20')];this[_0xdeab('0x21')]=_0x5d5609['UserId'];this['VoiceQueueId']=_0x5d5609[_0xdeab('0x22')];this[_0xdeab('0x23')]=_0x5d5609['CampaignId'];this[_0xdeab('0x24')]=_0x5d5609[_0xdeab('0x24')]||'';this[_0xdeab('0x25')]=_0x5d5609[_0xdeab('0x25')]||'';this[_0xdeab('0x26')]=_0x5d5609[_0xdeab('0x26')];this[_0xdeab('0x27')]=_0x5d5609[_0xdeab('0x27')];this['statedesc']=_0x5d5609['statedesc'];}module[_0xdeab('0x28')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index a8fdf22..cbd2c17 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','temp','getContactDialer','getContactDialerIvr','error','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[unlockContact]','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopperBlack','inspect','dialOrderByScheduledAt'];(function(_0xa4e62f,_0x4dfa39){var _0x3157ac=function(_0x4a167c){while(--_0x4a167c){_0xa4e62f['push'](_0xa4e62f['shift']());}};_0x3157ac(++_0x4dfa39);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var util=require(_0x0a9e('0x0'));var logger=require(_0x0a9e('0x1'))(_0x0a9e('0x2'));var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0a9e('0x3'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x333808){return util[_0x0a9e('0x4')](_0x333808,{'showHidden':![],'depth':null});}function getContactDialer(_0x2ab90b,_0x991246,_0x981158){return cmHopper['getContactDialer'](_0x2ab90b['id'],_0x991246,_0x981158,_0x2ab90b[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x2cc193){_0x2ab90b['temp']-=_0x981158;if(_0x2ab90b['temp']<0x0){_0x2ab90b[_0x0a9e('0x7')]=0x0;}logger['error']('[getContactDialer]',inspectError(_0x2cc193));});}exports[_0x0a9e('0x8')]=getContactDialer;function getContactDialerIvr(_0xf81284,_0x307b3e){return cmHopper[_0x0a9e('0x9')](_0xf81284['id'],_0x307b3e,_0xf81284[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x4a4c56){_0xf81284['temp']-=_0x307b3e;if(_0xf81284['temp']<0x0){_0xf81284['temp']=0x0;}logger[_0x0a9e('0xa')](_0x0a9e('0xb'),inspectError(_0x4a4c56));});}exports[_0x0a9e('0x9')]=getContactDialerIvr;function countReScheduled(_0x26d672){return cmHopper[_0x0a9e('0xc')](_0x26d672)[_0x0a9e('0x6')](function(_0x5db4b0){logger[_0x0a9e('0xa')](_0x0a9e('0xd'),inspectError(_0x5db4b0));});}exports[_0x0a9e('0xc')]=countReScheduled;function rescheduleContact(_0x281129){return cmHopper[_0x0a9e('0xe')](_0x281129)[_0x0a9e('0x6')](function(_0x52a03d){logger[_0x0a9e('0xa')]('[rescheduleContact]',inspectError(_0x52a03d));});}exports[_0x0a9e('0xe')]=rescheduleContact;function unlockContact(_0x519dfd,_0x16033c,_0x12066b){return cmHopper['unlockContact'](_0x519dfd,_0x16033c,_0x12066b)[_0x0a9e('0x6')](function(_0x5a0a06){logger[_0x0a9e('0xa')](_0x0a9e('0xf'),inspectError(_0x5a0a06));});}exports[_0x0a9e('0x10')]=unlockContact;function moveContactManagedDialer(_0x205fd6){return cmHopper[_0x0a9e('0x11')](_0x205fd6)[_0x0a9e('0x6')](function(_0x530eb7){logger[_0x0a9e('0xa')](_0x0a9e('0x12'),inspectError(_0x530eb7));});}exports[_0x0a9e('0x11')]=moveContactManagedDialer;function checkIsBlackList(_0x1c696a){return cmHopperBlack[_0x0a9e('0x13')](_0x1c696a)['catch'](function(_0x2c3407){logger[_0x0a9e('0xa')]('[checkIsBlackList]',inspectError(_0x2c3407));});}exports[_0x0a9e('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0x5a09ef){return cmHopperBlack['checkIsBlackListIvr'](_0x5a09ef)[_0x0a9e('0x6')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x14'),inspectError(_0x432e56));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0xfb6e48,_0x2fb0e4,_0x3b45bc){return cmHopperAdditionalPhone[_0x0a9e('0x15')](_0xfb6e48,_0x2fb0e4,_0x3b45bc)[_0x0a9e('0x6')](function(_0x42ac8f){logger[_0x0a9e('0xa')]('[verifyAdditionalPhone]',inspectError(_0x42ac8f));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x197ec0,_0x3a8e58,_0x40c424){return cmHopperAdditionalPhone[_0x0a9e('0x16')](_0x197ec0,_0x3a8e58,_0x40c424)['catch'](function(_0x384319){logger['error'](_0x0a9e('0x17'),inspectError(_0x384319));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x1dc186){return cmHopperHistory[_0x0a9e('0x18')](_0x1dc186)[_0x0a9e('0x6')](function(_0x14433c){logger[_0x0a9e('0xa')](_0x0a9e('0x19'),inspectError(_0x14433c));});}exports[_0x0a9e('0x18')]=avgHandleTime;function createHistory(_0x14de77){return cmHopperHistory['createHistory'](_0x14de77)[_0x0a9e('0x6')](function(_0x468813){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),inspectError(_0x468813));});}exports['createHistory']=createHistory; \ No newline at end of file +var _0xb10b=['[createHistory]','util','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','inspect','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialer','[getContactDialerIvr]','getContactDialerIvr','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackList]','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[swapAdditionalPhone]','swapAdditionalPhones','avgHandleTime','[avgHandleTime]','createHistory'];(function(_0x112ea8,_0xf6b2e8){var _0x46ab52=function(_0x1c292f){while(--_0x1c292f){_0x112ea8['push'](_0x112ea8['shift']());}};_0x46ab52(++_0xf6b2e8);}(_0xb10b,0x12a));var _0xbb10=function(_0x34f545,_0x2bd2ee){_0x34f545=_0x34f545-0x0;var _0x1ff6b8=_0xb10b[_0x34f545];return _0x1ff6b8;};'use strict';var util=require(_0xbb10('0x0'));var logger=require('../../../../config/logger')(_0xbb10('0x1'));var cmHopper=require(_0xbb10('0x2'));var cmHopperAdditionalPhone=require(_0xbb10('0x3'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0xbb10('0x4'));function inspectError(_0x9bbed){return util[_0xbb10('0x5')](_0x9bbed,{'showHidden':![],'depth':null});}function getContactDialer(_0x22320e,_0x49baf4,_0x312b72){return cmHopper['getContactDialer'](_0x22320e['id'],_0x49baf4,_0x312b72,_0x22320e[_0xbb10('0x6')])[_0xbb10('0x7')](function(_0x513741){_0x22320e[_0xbb10('0x8')]-=_0x312b72;if(_0x22320e[_0xbb10('0x8')]<0x0){_0x22320e[_0xbb10('0x8')]=0x0;}logger[_0xbb10('0x9')](_0xbb10('0xa'),inspectError(_0x513741));});}exports[_0xbb10('0xb')]=getContactDialer;function getContactDialerIvr(_0x229887,_0xa3adc8){return cmHopper['getContactDialerIvr'](_0x229887['id'],_0xa3adc8,_0x229887['dialOrderByScheduledAt'])[_0xbb10('0x7')](function(_0x118a74){_0x229887[_0xbb10('0x8')]-=_0xa3adc8;if(_0x229887['temp']<0x0){_0x229887[_0xbb10('0x8')]=0x0;}logger['error'](_0xbb10('0xc'),inspectError(_0x118a74));});}exports[_0xbb10('0xd')]=getContactDialerIvr;function countReScheduled(_0x285009){return cmHopper[_0xbb10('0xe')](_0x285009)[_0xbb10('0x7')](function(_0x147230){logger['error'](_0xbb10('0xf'),inspectError(_0x147230));});}exports[_0xbb10('0xe')]=countReScheduled;function rescheduleContact(_0x45b9d6){return cmHopper[_0xbb10('0x10')](_0x45b9d6)[_0xbb10('0x7')](function(_0x2f2ebf){logger[_0xbb10('0x9')](_0xbb10('0x11'),inspectError(_0x2f2ebf));});}exports[_0xbb10('0x10')]=rescheduleContact;function unlockContact(_0x2b184e,_0x4a2bfc,_0x2eca0f){return cmHopper[_0xbb10('0x12')](_0x2b184e,_0x4a2bfc,_0x2eca0f)[_0xbb10('0x7')](function(_0x42db98){logger[_0xbb10('0x9')](_0xbb10('0x13'),inspectError(_0x42db98));});}exports[_0xbb10('0x12')]=unlockContact;function moveContactManagedDialer(_0x30efc6){return cmHopper[_0xbb10('0x14')](_0x30efc6)[_0xbb10('0x7')](function(_0x48b6e9){logger[_0xbb10('0x9')](_0xbb10('0x15'),inspectError(_0x48b6e9));});}exports[_0xbb10('0x14')]=moveContactManagedDialer;function checkIsBlackList(_0x109908){return cmHopperBlack[_0xbb10('0x16')](_0x109908)[_0xbb10('0x7')](function(_0x4deb49){logger[_0xbb10('0x9')](_0xbb10('0x17'),inspectError(_0x4deb49));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0x4c4b0d){return cmHopperBlack[_0xbb10('0x18')](_0x4c4b0d)[_0xbb10('0x7')](function(_0x2e911d){logger[_0xbb10('0x9')](_0xbb10('0x19'),inspectError(_0x2e911d));});}exports[_0xbb10('0x18')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x407cb4,_0x436104,_0x7f2377){return cmHopperAdditionalPhone[_0xbb10('0x1a')](_0x407cb4,_0x436104,_0x7f2377)[_0xbb10('0x7')](function(_0x26ad93){logger['error']('[verifyAdditionalPhone]',inspectError(_0x26ad93));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xc93a04,_0x3c5ae7,_0x2c89b9){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0xc93a04,_0x3c5ae7,_0x2c89b9)[_0xbb10('0x7')](function(_0x24d586){logger[_0xbb10('0x9')](_0xbb10('0x1b'),inspectError(_0x24d586));});}exports[_0xbb10('0x1c')]=swapAdditionalPhones;function avgHandleTime(_0x20d946){return cmHopperHistory[_0xbb10('0x1d')](_0x20d946)['catch'](function(_0x3796c7){logger[_0xbb10('0x9')](_0xbb10('0x1e'),inspectError(_0x3796c7));});}exports[_0xbb10('0x1d')]=avgHandleTime;function createHistory(_0x1d30aa){return cmHopperHistory[_0xbb10('0x1f')](_0x1d30aa)['catch'](function(_0x221624){logger['error'](_0xbb10('0x20'),inspectError(_0x221624));});}exports['createHistory']=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index 64e7b4e..310cd8d 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd808=['TrunkBackup','includes','status','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignActiveStatusMessage','match','extractCalleridName','string','isUndefined','format','\x22%s\x22\x20<%s>','getCallerId','pow','replace','random','toString','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','checkContactLowerLimitOriginate','lodash','moment','dialer','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','AVAILABLE_CONTACTS_FINISHED','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','isPreviewCampaign','type','ivr','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd808,0x103));var _0x8d80=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xd808[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0x8d80('0x0'));var moment=require(_0x8d80('0x1'));var util=require('util');var logger=require('../../../../config/logger')(_0x8d80('0x2'));var timezones=require('../../../../config/environment/shared')[_0x8d80('0x3')];var CAMPAIGN_STATUS={'ACTIVE':_0x8d80('0x4'),'BLACKLIST':_0x8d80('0x5'),'CONTACTS_RESCHEDULED':_0x8d80('0x6'),'DEACTIVATED':_0x8d80('0x7'),'DISACTIVED':_0x8d80('0x8'),'EMPTY_INTERVAL':_0x8d80('0x9'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0x8d80('0xa'),'NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0x8d80('0xb'),'QUEUE_RECALL':_0x8d80('0xc'),'RECALL_TIMEOUT':_0x8d80('0xd'),'RUNNING':_0x8d80('0xe'),'UNKNOWN_TIMEZONE':_0x8d80('0xf'),'UNREACHABLE_TRUNK':_0x8d80('0x10')};exports[_0x8d80('0x11')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x50c5c1){return _0x50c5c1[_0x8d80('0x12')]==='preview';}exports[_0x8d80('0x13')]=isPreviewCampaign;function isIVRCampaign(_0x7b33aa){return _0x7b33aa[_0x8d80('0x14')]===_0x8d80('0x15');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x429123){return _0x429123[_0x8d80('0x14')]==='outbound';}exports[_0x8d80('0x16')]=isOutboundQueue;function isQueueCampaignActive(_0x6e665e){return _0x6e665e[_0x8d80('0x17')];}exports[_0x8d80('0x18')]=isQueueCampaignActive;function isIVRCampaignActive(_0x45b57a){return _0x45b57a[_0x8d80('0x19')];}exports[_0x8d80('0x1a')]=isIVRCampaignActive;function getSeconds(_0x45e769,_0x3347f1){var _0x1e1dbe=moment(_0x45e769)[_0x8d80('0x1b')](0x0);var _0x480e72=moment(_0x3347f1)[_0x8d80('0x1b')](0x0);return _0x1e1dbe[_0x8d80('0x1c')](_0x480e72,'seconds');}exports[_0x8d80('0x1d')]=getSeconds;function hasQueueCampaignDataChanged(_0x54fb20,_0x54b2a7){var _0x553aed=![];var _0x29efa9=_0x54fb20[_0x8d80('0x12')]!==_0x54b2a7[_0x8d80('0x12')]||_0x54fb20[_0x8d80('0x17')]!==_0x54b2a7[_0x8d80('0x17')]||_0x54fb20[_0x8d80('0x1e')]!==_0x54b2a7[_0x8d80('0x1e')];var _0x58e23d=_0x54fb20[_0x8d80('0x1f')]!==_0x54b2a7[_0x8d80('0x1f')]||_0x54fb20[_0x8d80('0x20')]!==_0x54b2a7[_0x8d80('0x20')]||_0x54fb20[_0x8d80('0x21')]!==_0x54b2a7[_0x8d80('0x21')]||_0x54fb20[_0x8d80('0x22')]!==_0x54b2a7[_0x8d80('0x22')]||_0x54fb20['talking']!==_0x54b2a7[_0x8d80('0x23')]||_0x54fb20[_0x8d80('0x24')]!==_0x54b2a7[_0x8d80('0x24')]||_0x54fb20['waiting']!==_0x54b2a7[_0x8d80('0x25')]||_0x54fb20[_0x8d80('0x26')]!==_0x54b2a7[_0x8d80('0x26')]||_0x54fb20['originated']!==_0x54b2a7[_0x8d80('0x27')];if(_0x54fb20[_0x8d80('0x28')]&&_0x54b2a7[_0x8d80('0x28')]){_0x553aed=_0x54fb20[_0x8d80('0x28')][_0x8d80('0x29')]!==_0x54b2a7[_0x8d80('0x28')]['name']||_0x54fb20[_0x8d80('0x28')][_0x8d80('0x19')]!==_0x54b2a7[_0x8d80('0x28')][_0x8d80('0x19')];}return _0x29efa9||_0x58e23d||_0x553aed;}exports[_0x8d80('0x2a')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0xd6d69d){var _0x34b671=null;var _0x21f751=_0xd6d69d['dialTimezone'];if(_[_0x8d80('0x2b')](_0xd6d69d[_0x8d80('0x2c')])||_['isNil'](_0xd6d69d[_0x8d80('0x2d')])||_['isNil'](_0xd6d69d[_0x8d80('0x2d')][_0x8d80('0x2e')])){_0x34b671=CAMPAIGN_STATUS[_0x8d80('0x2f')];}else if(_['isEmpty'](_0xd6d69d[_0x8d80('0x2c')])||_[_0x8d80('0x30')](_0xd6d69d[_0x8d80('0x2d')][_0x8d80('0x2e')])){_0x34b671=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x21f751&&!timezones[_0x21f751]){_0x34b671=CAMPAIGN_STATUS[_0x8d80('0x31')];}return _0x34b671;}function checkAnyValidTrunk(_0x47f170,_0x36e5ab){var _0x455ace=null;var _0x28e45d=_0x8d80('0x32');var _0xf09981=[_0x8d80('0x33'),_0x8d80('0x34')];var _0x241d16=!![];if(_0x47f170[_0x8d80('0x28')]&&_0x47f170[_0x8d80('0x28')]['active']){_0x28e45d+=_0x47f170[_0x8d80('0x28')][_0x8d80('0x29')];_0x455ace=_0x36e5ab[_0x28e45d];_0x241d16=_0xf09981['includes'](_0x455ace['status']);}else if(_0x47f170[_0x8d80('0x35')]&&_0x47f170[_0x8d80('0x35')][_0x8d80('0x19')]){_0x28e45d+=_0x47f170[_0x8d80('0x35')]['name'];_0x455ace=_0x36e5ab[_0x28e45d];_0x241d16=_0xf09981[_0x8d80('0x36')](_0x455ace[_0x8d80('0x37')]);}return _0x241d16;}function getQueueCampaignStatusMessage(_0x3be366,_0x59a056){var _0x41ee7f=CAMPAIGN_STATUS['ACTIVE'];var _0x5d9271=isPreviewCampaign(_0x3be366);if(!isQueueCampaignActive(_0x3be366)){if(_0x5d9271){_0x41ee7f=CAMPAIGN_STATUS[_0x8d80('0x38')];}else{if(_0x3be366['originated']===0x0&&_0x3be366['talking']===0x0&&_0x3be366[_0x8d80('0x25')]===0x0&&(_0x3be366[_0x8d80('0x24')]||0x0)===0x0){_0x41ee7f=CAMPAIGN_STATUS[_0x8d80('0x38')];}else{_0x41ee7f=CAMPAIGN_STATUS[_0x8d80('0x39')];}}}else if(_0x3be366['loggedIn']===0x0){_0x41ee7f=CAMPAIGN_STATUS[_0x8d80('0x3a')];}else if(!checkAnyValidTrunk(_0x3be366,_0x59a056)){_0x41ee7f=CAMPAIGN_STATUS[_0x8d80('0x3b')];}else if(!isPreviewCampaign(_0x3be366)){var _0x1a62e5=checkAnyValidQueueCampaignInterval(_0x3be366);if(_0x1a62e5){_0x41ee7f=_0x1a62e5;}}return _0x41ee7f;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x34a6f9){var _0x470ef8=CAMPAIGN_STATUS[_0x8d80('0x39')];if(_0x34a6f9[_0x8d80('0x27')]===0x0&&_0x34a6f9['talking']===0x0&&_0x34a6f9[_0x8d80('0x25')]===0x0&&(_0x34a6f9[_0x8d80('0x24')]||0x0)===0x0){_0x470ef8=CAMPAIGN_STATUS['INACTIVE'];}return _0x470ef8;}exports[_0x8d80('0x3c')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x40f6a2){var _0x5359f2=_0x40f6a2[_0x8d80('0x3d')](/"(.*?)"/);return _0x5359f2?_0x5359f2[0x1]:_0x40f6a2;}exports[_0x8d80('0x3e')]=extractCalleridName;function getCallerId(_0x40cc3e,_0x4f265b,_0xaab1b5){if(!_['isUndefined'](_0xaab1b5)&&typeof _0xaab1b5===_0x8d80('0x3f')&&!_[_0x8d80('0x30')](_0xaab1b5)){if(!_[_0x8d80('0x40')](_0x4f265b)&&typeof _0x4f265b===_0x8d80('0x3f')&&!_[_0x8d80('0x30')](_0x4f265b)){return util[_0x8d80('0x41')](_0x8d80('0x42'),_0x4f265b,_0xaab1b5);}return util[_0x8d80('0x41')](_0x8d80('0x42'),_0xaab1b5,_0xaab1b5);}if(!_[_0x8d80('0x40')](_0x40cc3e)&&typeof _0x40cc3e===_0x8d80('0x3f')&&!_[_0x8d80('0x30')](_0x40cc3e)){return _0x40cc3e;}return'\x22\x22\x20<>';}exports[_0x8d80('0x43')]=getCallerId;function getCallerIdRandom(_0x295bbd,_0x451e68){var _0x58ea1f;var _0x15f627;var _0x5792b7;if(_0x451e68<=0x0){_0x451e68=0x1;}_0x58ea1f=new RegExp('\x5cw{0,'+_0x451e68+'}$');_0x15f627=Math['pow'](0xa,_0x451e68-0x1);_0x5792b7=Math[_0x8d80('0x44')](0xa,_0x451e68)-0x1;return util['format']('%s',_[_0x8d80('0x45')](_0x295bbd,_0x58ea1f,_[_0x8d80('0x46')](_0x15f627,_0x5792b7)[_0x8d80('0x47')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x2de10c){if(_0x2de10c['originated']&&_0x2de10c[_0x8d80('0x27')]>0x0){_0x2de10c['originated']-=0x1;}else{logger[_0x8d80('0x48')](_0x8d80('0x49'));}}exports[_0x8d80('0x4a')]=decrementOriginate;function checkContactEmpty(_0x57dd62){return _0x57dd62&&_0x57dd62[_0x8d80('0x4b')]>0x0;}exports[_0x8d80('0x4c')]=checkContactEmpty;function erlangb(_0x505047,_0x1a173d){if(_0x1a173d===0x0){return 0x0;}var _0x160cbb=0x1;for(var _0x42c83a=0x1;_0x42c83a<=_0x1a173d;_0x42c83a+=0x1){_0x160cbb=0x1+_0x160cbb*_0x42c83a/_0x505047;}return 0x1/_0x160cbb;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x240ffd,_0x569f1c,_0x529578){if(_0x569f1c>_0x529578){for(var _0x568845=0x0;_0x568845<_0x569f1c-_0x529578;_0x568845+=0x1){decrementOriginate(_0x240ffd);}}}exports[_0x8d80('0x4d')]=checkContactLowerLimitOriginate; \ No newline at end of file +var _0xf00c=['DISACTIVED','NO_AGENTS_LOGGED','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','pow','replace','random','toString','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','erlangb','checkContactLowerLimitOriginate','lodash','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','DEACTIVATED','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','isPreviewCampaign','type','ivr','outbound','isOutboundQueue','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','dialActive','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','INACTIVE'];(function(_0x4e70fb,_0x27cbd2){var _0x423a4c=function(_0x106d85){while(--_0x106d85){_0x4e70fb['push'](_0x4e70fb['shift']());}};_0x423a4c(++_0x27cbd2);}(_0xf00c,0xba));var _0xcf00=function(_0x56c370,_0x163d40){_0x56c370=_0x56c370-0x0;var _0x2fb924=_0xf00c[_0x56c370];return _0x2fb924;};'use strict';var _=require(_0xcf00('0x0'));var moment=require('moment');var util=require('util');var logger=require(_0xcf00('0x1'))(_0xcf00('0x2'));var timezones=require(_0xcf00('0x3'))[_0xcf00('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0xcf00('0x5'),'BLACKLIST':_0xcf00('0x6'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0xcf00('0x7'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':'INTERVAL_IS_EMPTY','INACTIVE':_0xcf00('0x8'),'NO_AGENTS_LOGGED':_0xcf00('0x9'),'NO_AVAILABLE_CONTACTS':_0xcf00('0xa'),'NULL_INTERVAL':_0xcf00('0xb'),'OVERTIME_INTERVAL':_0xcf00('0xc'),'OVERTIME_GLOBAL_INTERVAL':_0xcf00('0xd'),'QUEUE_RECALL':_0xcf00('0xe'),'RECALL_TIMEOUT':_0xcf00('0xf'),'RUNNING':_0xcf00('0x10'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0xcf00('0x11')};exports[_0xcf00('0x12')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x299b6d){return _0x299b6d[_0xcf00('0x13')]==='preview';}exports[_0xcf00('0x14')]=isPreviewCampaign;function isIVRCampaign(_0x49b7ad){return _0x49b7ad[_0xcf00('0x15')]===_0xcf00('0x16');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0xc08b36){return _0xc08b36[_0xcf00('0x15')]===_0xcf00('0x17');}exports[_0xcf00('0x18')]=isOutboundQueue;function isQueueCampaignActive(_0x66a668){return _0x66a668['dialActive'];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x57741c){return _0x57741c[_0xcf00('0x19')];}exports[_0xcf00('0x1a')]=isIVRCampaignActive;function getSeconds(_0x367e67,_0x24de10){var _0x2bc989=moment(_0x367e67)[_0xcf00('0x1b')](0x0);var _0x3a448a=moment(_0x24de10)[_0xcf00('0x1b')](0x0);return _0x2bc989[_0xcf00('0x1c')](_0x3a448a,_0xcf00('0x1d'));}exports[_0xcf00('0x1e')]=getSeconds;function hasQueueCampaignDataChanged(_0x363116,_0x40589c){var _0x5009b0=![];var _0x195dbb=_0x363116[_0xcf00('0x13')]!==_0x40589c[_0xcf00('0x13')]||_0x363116[_0xcf00('0x1f')]!==_0x40589c['dialActive']||_0x363116[_0xcf00('0x20')]!==_0x40589c[_0xcf00('0x20')];var _0x26ad92=_0x363116[_0xcf00('0x21')]!==_0x40589c[_0xcf00('0x21')]||_0x363116['loggedIn']!==_0x40589c[_0xcf00('0x22')]||_0x363116[_0xcf00('0x23')]!==_0x40589c[_0xcf00('0x23')]||_0x363116[_0xcf00('0x24')]!==_0x40589c[_0xcf00('0x24')]||_0x363116[_0xcf00('0x25')]!==_0x40589c[_0xcf00('0x25')]||_0x363116[_0xcf00('0x26')]!==_0x40589c['pTalking']||_0x363116[_0xcf00('0x27')]!==_0x40589c[_0xcf00('0x27')]||_0x363116[_0xcf00('0x28')]!==_0x40589c['inUse']||_0x363116[_0xcf00('0x29')]!==_0x40589c[_0xcf00('0x29')];if(_0x363116[_0xcf00('0x2a')]&&_0x40589c[_0xcf00('0x2a')]){_0x5009b0=_0x363116['Trunk']['name']!==_0x40589c['Trunk'][_0xcf00('0x2b')]||_0x363116[_0xcf00('0x2a')][_0xcf00('0x19')]!==_0x40589c[_0xcf00('0x2a')][_0xcf00('0x19')];}return _0x195dbb||_0x26ad92||_0x5009b0;}exports[_0xcf00('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x34af67){var _0x2f9f75=null;var _0x4ca82d=_0x34af67[_0xcf00('0x2d')];if(_[_0xcf00('0x2e')](_0x34af67[_0xcf00('0x2f')])||_[_0xcf00('0x2e')](_0x34af67[_0xcf00('0x30')])||_[_0xcf00('0x2e')](_0x34af67[_0xcf00('0x30')][_0xcf00('0x31')])){_0x2f9f75=CAMPAIGN_STATUS[_0xcf00('0x32')];}else if(_[_0xcf00('0x33')](_0x34af67[_0xcf00('0x2f')])||_['isEmpty'](_0x34af67[_0xcf00('0x30')]['Intervals'])){_0x2f9f75=CAMPAIGN_STATUS[_0xcf00('0x34')];}else if(_0x4ca82d&&!timezones[_0x4ca82d]){_0x2f9f75=CAMPAIGN_STATUS[_0xcf00('0x35')];}return _0x2f9f75;}function checkAnyValidTrunk(_0x43bda2,_0x2de9c7){var _0x47764d=null;var _0x1d44b4=_0xcf00('0x36');var _0x13a96e=[_0xcf00('0x37'),_0xcf00('0x38')];var _0x201dfa=!![];if(_0x43bda2[_0xcf00('0x2a')]&&_0x43bda2[_0xcf00('0x2a')][_0xcf00('0x19')]){_0x1d44b4+=_0x43bda2[_0xcf00('0x2a')][_0xcf00('0x2b')];_0x47764d=_0x2de9c7[_0x1d44b4];_0x201dfa=_0x13a96e[_0xcf00('0x39')](_0x47764d[_0xcf00('0x3a')]);}else if(_0x43bda2['TrunkBackup']&&_0x43bda2['TrunkBackup'][_0xcf00('0x19')]){_0x1d44b4+=_0x43bda2['TrunkBackup'][_0xcf00('0x2b')];_0x47764d=_0x2de9c7[_0x1d44b4];_0x201dfa=_0x13a96e[_0xcf00('0x39')](_0x47764d[_0xcf00('0x3a')]);}return _0x201dfa;}function getQueueCampaignStatusMessage(_0x578e56,_0x1694ce){var _0x598dc6=CAMPAIGN_STATUS['ACTIVE'];var _0x3250bc=isPreviewCampaign(_0x578e56);if(!isQueueCampaignActive(_0x578e56)){if(_0x3250bc){_0x598dc6=CAMPAIGN_STATUS[_0xcf00('0x3b')];}else{if(_0x578e56[_0xcf00('0x29')]===0x0&&_0x578e56['talking']===0x0&&_0x578e56[_0xcf00('0x27')]===0x0&&(_0x578e56[_0xcf00('0x26')]||0x0)===0x0){_0x598dc6=CAMPAIGN_STATUS[_0xcf00('0x3b')];}else{_0x598dc6=CAMPAIGN_STATUS[_0xcf00('0x3c')];}}}else if(_0x578e56[_0xcf00('0x22')]===0x0){_0x598dc6=CAMPAIGN_STATUS[_0xcf00('0x3d')];}else if(!checkAnyValidTrunk(_0x578e56,_0x1694ce)){_0x598dc6=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x578e56)){var _0x1d91a6=checkAnyValidQueueCampaignInterval(_0x578e56);if(_0x1d91a6){_0x598dc6=_0x1d91a6;}}return _0x598dc6;}exports[_0xcf00('0x3e')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x2062a0){var _0x29dcfc=CAMPAIGN_STATUS[_0xcf00('0x3c')];if(_0x2062a0['originated']===0x0&&_0x2062a0[_0xcf00('0x25')]===0x0&&_0x2062a0['waiting']===0x0&&(_0x2062a0[_0xcf00('0x26')]||0x0)===0x0){_0x29dcfc=CAMPAIGN_STATUS[_0xcf00('0x3b')];}return _0x29dcfc;}exports[_0xcf00('0x3f')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x4ae2ef){var _0x487923=_0x4ae2ef[_0xcf00('0x40')](/"(.*?)"/);return _0x487923?_0x487923[0x1]:_0x4ae2ef;}exports[_0xcf00('0x41')]=extractCalleridName;function getCallerId(_0x63c64e,_0x26f308,_0x5349ec){if(!_[_0xcf00('0x42')](_0x5349ec)&&typeof _0x5349ec===_0xcf00('0x43')&&!_[_0xcf00('0x33')](_0x5349ec)){if(!_[_0xcf00('0x42')](_0x26f308)&&typeof _0x26f308===_0xcf00('0x43')&&!_[_0xcf00('0x33')](_0x26f308)){return util['format']('\x22%s\x22\x20<%s>',_0x26f308,_0x5349ec);}return util[_0xcf00('0x44')](_0xcf00('0x45'),_0x5349ec,_0x5349ec);}if(!_[_0xcf00('0x42')](_0x63c64e)&&typeof _0x63c64e===_0xcf00('0x43')&&!_[_0xcf00('0x33')](_0x63c64e)){return _0x63c64e;}return'\x22\x22\x20<>';}exports[_0xcf00('0x46')]=getCallerId;function getCallerIdRandom(_0x5672f1,_0x4a5b51){var _0x107241;var _0x15aff2;var _0xf97ab7;if(_0x4a5b51<=0x0){_0x4a5b51=0x1;}_0x107241=new RegExp(_0xcf00('0x47')+_0x4a5b51+'}$');_0x15aff2=Math[_0xcf00('0x48')](0xa,_0x4a5b51-0x1);_0xf97ab7=Math['pow'](0xa,_0x4a5b51)-0x1;return util[_0xcf00('0x44')]('%s',_[_0xcf00('0x49')](_0x5672f1,_0x107241,_[_0xcf00('0x4a')](_0x15aff2,_0xf97ab7)[_0xcf00('0x4b')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x120b50){if(_0x120b50[_0xcf00('0x29')]&&_0x120b50[_0xcf00('0x29')]>0x0){_0x120b50['originated']-=0x1;}else{logger[_0xcf00('0x4c')](_0xcf00('0x4d'));}}exports[_0xcf00('0x4e')]=decrementOriginate;function checkContactEmpty(_0x4f40e7){return _0x4f40e7&&_0x4f40e7[_0xcf00('0x4f')]>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x247140,_0x48d785){if(_0x48d785===0x0){return 0x0;}var _0x372588=0x1;for(var _0x1044bc=0x1;_0x1044bc<=_0x48d785;_0x1044bc+=0x1){_0x372588=0x1+_0x372588*_0x1044bc/_0x247140;}return 0x1/_0x372588;}exports[_0xcf00('0x50')]=erlangb;function checkContactLowerLimitOriginate(_0x1508b3,_0x2bb258,_0x652b92){if(_0x2bb258>_0x652b92){for(var _0x44ca=0x0;_0x44ca<_0x2bb258-_0x652b92;_0x44ca+=0x1){decrementOriginate(_0x1508b3);}}}exports[_0xcf00('0x51')]=checkContactLowerLimitOriginate; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 0dfaf5b..36e155f 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(_0xb96a9b,_0x1c0e4f){var _0x4da4d4=function(_0x557a59){while(--_0x557a59){_0xb96a9b['push'](_0xb96a9b['shift']());}};_0x4da4d4(++_0x1c0e4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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(_0x584dbc,_0x4b102c){var _0x554b9a=function(_0x17b669){while(--_0x17b669){_0x584dbc['push'](_0x584dbc['shift']());}};_0x554b9a(++_0x4b102c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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 fbb62b6..da5fa26 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 _0x70dd=['\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','uuid','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','channels','faxAccounts','trunks','actions','syncNewchannel','syncVarSet','bind','newstate','syncNewState','newexten','syncReceiveFax','syncHangup','originateresponse','syncOriginateResponse','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','prototype','channelstate','channelstatedesc','syncNewExten','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]'];(function(_0x4fdc46,_0x2a3759){var _0x2c178a=function(_0x59ead9){while(--_0x59ead9){_0x4fdc46['push'](_0x4fdc46['shift']());}};_0x2c178a(++_0x2a3759);}(_0x70dd,0x75));var _0xd70d=function(_0x2e3d0e,_0x9160d){_0x2e3d0e=_0x2e3d0e-0x0;var _0x2510ac=_0x70dd[_0x2e3d0e];return _0x2510ac;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xd70d('0x0'));var moment=require('moment');var path=require(_0xd70d('0x1'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xd70d('0x2'));var logger=require(_0xd70d('0x3'))(_0xd70d('0x4'));var ami=require(_0xd70d('0x5'));var rpcDb=require(_0xd70d('0x6'));var Channel=require(_0xd70d('0x7'));var ut=require(_0xd70d('0x8'));var Action=require(_0xd70d('0x9'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x4b16b4){this[_0xd70d('0xa')]={};this[_0xd70d('0xb')]=_0x4b16b4['faxAccounts'];this['trunks']=_0x4b16b4[_0xd70d('0xc')];this[_0xd70d('0xd')]={};ami['on']('newchannel',this[_0xd70d('0xe')]['bind'](this));ami['on']('varset',this[_0xd70d('0xf')][_0xd70d('0x10')](this));ami['on'](_0xd70d('0x11'),this[_0xd70d('0x12')][_0xd70d('0x10')](this));ami['on'](_0xd70d('0x13'),this['syncNewExten'][_0xd70d('0x10')](this));ami['on']('faxstatus',this['syncFaxStatus']['bind'](this));ami['on']('receivefax',this[_0xd70d('0x14')][_0xd70d('0x10')](this));ami['on']('hangup',this[_0xd70d('0x15')][_0xd70d('0x10')](this));ami['on'](_0xd70d('0x16'),this[_0xd70d('0x17')][_0xd70d('0x10')](this));}Fax['prototype'][_0xd70d('0xe')]=function(_0x4dca2b){if(_0x4dca2b['context']===_0xd70d('0x18')){for(var _0xcf22a2 in this[_0xd70d('0xb')]){if(this[_0xd70d('0xb')][_0xd70d('0x19')](_0xcf22a2)){if(_0x4dca2b[_0xd70d('0x1a')]===this['faxAccounts'][_0xcf22a2][_0xd70d('0x1b')]){this[_0xd70d('0xa')][_0x4dca2b['uniqueid']]={};this[_0xd70d('0xa')][_0x4dca2b[_0xd70d('0x1c')]][_0xd70d('0x1d')]=_0x4dca2b[_0xd70d('0x1d')];this[_0xd70d('0xa')][_0x4dca2b[_0xd70d('0x1c')]]['id']=this['faxAccounts'][_0xcf22a2]['id'];this['channels'][_0x4dca2b[_0xd70d('0x1c')]][_0xd70d('0x1e')]=this['faxAccounts'][_0xcf22a2][_0xd70d('0x1e')];logger[_0xd70d('0x1f')](_0x4dca2b[_0xd70d('0x1c')],_0xd70d('0x20'));}}}}if(this['actions'][_0x4dca2b[_0xd70d('0x1c')]]){this['channels'][_0x4dca2b['uniqueid']]={};this[_0xd70d('0xa')][_0x4dca2b[_0xd70d('0x1c')]]['channel']=_0x4dca2b[_0xd70d('0x1d')];logger[_0xd70d('0x1f')](_0x4dca2b[_0xd70d('0x1c')],_0xd70d('0x20'));}};Fax['prototype']['syncVarSet']=function(_0x5a4d2c){if(this['channels'][_0x5a4d2c['uniqueid']]){for(var _0x396b9c in _0x5a4d2c[_0xd70d('0x21')]){if(_0x5a4d2c[_0xd70d('0x21')][_0xd70d('0x19')](_0x396b9c)){this[_0xd70d('0xa')][_0x5a4d2c['uniqueid']][_0x396b9c]=_0x5a4d2c[_0xd70d('0x22')];}}}};Fax[_0xd70d('0x23')][_0xd70d('0x12')]=function(_0x95edc6){if(this[_0xd70d('0xa')][_0x95edc6[_0xd70d('0x1c')]]){this['channels'][_0x95edc6['uniqueid']][_0xd70d('0x24')]=_0x95edc6[_0xd70d('0x24')];this['channels'][_0x95edc6[_0xd70d('0x1c')]][_0xd70d('0x25')]=_0x95edc6[_0xd70d('0x25')];}};Fax['prototype'][_0xd70d('0x26')]=function(_0x2a205a){if(this['channels'][_0x2a205a[_0xd70d('0x1c')]]){for(var _0x5cb18c in _0x2a205a[_0xd70d('0x21')]){if(_0x2a205a[_0xd70d('0x21')][_0xd70d('0x19')](_0x5cb18c)){this['channels'][_0x2a205a[_0xd70d('0x1c')]][_0x5cb18c]=_0x2a205a[_0xd70d('0x22')];}}}};Fax['prototype'][_0xd70d('0x27')]=function(_0x5c0f34){if(this[_0xd70d('0xa')][_0x5c0f34[_0xd70d('0x1c')]]){this[_0xd70d('0xa')][_0x5c0f34[_0xd70d('0x1c')]][_0xd70d('0x28')]=_0x5c0f34[_0xd70d('0x28')];this[_0xd70d('0xa')][_0x5c0f34[_0xd70d('0x1c')]][_0xd70d('0x29')]=_0x5c0f34[_0xd70d('0x29')];this[_0xd70d('0xa')][_0x5c0f34[_0xd70d('0x1c')]]['localstationid']=_0x5c0f34[_0xd70d('0x1b')];this[_0xd70d('0xa')][_0x5c0f34['uniqueid']]['filename']=_0x5c0f34[_0xd70d('0x2a')];logger[_0xd70d('0x1f')](_0x5c0f34['uniqueid'],_0xd70d('0x2b'));}};Fax[_0xd70d('0x23')][_0xd70d('0x14')]=function(_0x2e4a22){var _0x326e7d=this;if(this[_0xd70d('0xa')][_0x2e4a22[_0xd70d('0x1c')]]){var _0x34147c=this[_0xd70d('0xa')][_0x2e4a22[_0xd70d('0x1c')]]['id'];this[_0xd70d('0xa')][_0x2e4a22[_0xd70d('0x1c')]]['remotestationid']=_0x2e4a22[_0xd70d('0x2c')];this[_0xd70d('0xa')][_0x2e4a22[_0xd70d('0x1c')]][_0xd70d('0x2d')]=_0x2e4a22['pagestransferred'];this[_0xd70d('0xa')][_0x2e4a22['uniqueid']][_0xd70d('0x1b')]=_0x2e4a22[_0xd70d('0x1b')];this['channels'][_0x2e4a22['uniqueid']][_0xd70d('0x2e')]=_0x2e4a22[_0xd70d('0x2e')];this['channels'][_0x2e4a22[_0xd70d('0x1c')]][_0xd70d('0x2f')]=_0x2e4a22[_0xd70d('0x2f')];this[_0xd70d('0xa')][_0x2e4a22['uniqueid']][_0xd70d('0x2a')]=_0x2e4a22[_0xd70d('0x2a')];this[_0xd70d('0xa')][_0x2e4a22[_0xd70d('0x1c')]][_0xd70d('0x30')]=_0x2e4a22[_0xd70d('0x30')];if(this[_0xd70d('0xa')][_0x2e4a22[_0xd70d('0x1c')]][_0xd70d('0x2d')]>0x0){tiff2pdf(_0x2e4a22[_0xd70d('0x2a')],_0xd70d('0x31'),function(_0x1a3b6c){logger[_0xd70d('0x1f')](_0x2e4a22[_0xd70d('0x1c')],_0xd70d('0x32'),_0x1a3b6c[_0xd70d('0x33')]);attachment[_0xd70d('0x34')]({'name':path['parse'](_0x2e4a22[_0xd70d('0x2a')])['name'],'basename':path[_0xd70d('0x35')](_0x2e4a22[_0xd70d('0x2a')])[_0xd70d('0x1e')]+_0xd70d('0x36'),'type':_0xd70d('0x37')})[_0xd70d('0x38')](function(_0xd05ecb){faxAccount['notify'](_0x34147c,{'from':_0x2e4a22['calleridnum'],'mapKey':_0xd70d('0x4'),'body':path['parse'](_0x2e4a22['filename'])['name']+_0xd70d('0x36'),'AttachmentId':_0xd05ecb['id']})[_0xd70d('0x39')](function(_0x5bd7a9){logger[_0xd70d('0x3a')](_0x2e4a22[_0xd70d('0x1c')],_0xd70d('0x3b'),JSON[_0xd70d('0x3c')](_0x5bd7a9));});})[_0xd70d('0x39')](function(_0x284bc4){logger[_0xd70d('0x3a')](_0x2e4a22[_0xd70d('0x1c')],_0xd70d('0x3d'),JSON[_0xd70d('0x3c')](_0x284bc4));});});}logger['info'](_0x2e4a22[_0xd70d('0x1c')],_0xd70d('0x3d'));}};Fax[_0xd70d('0x23')][_0xd70d('0x17')]=function(_0x266e7d){if(this[_0xd70d('0xd')][_0x266e7d['uniqueid']]){_['merge'](this['channels'][_0x266e7d['uniqueid']],_['pick'](_0x266e7d,['response','reason']));}};function updateStatus(_0x544f59){if(_0x544f59[_0xd70d('0x3e')]){faxMessage[_0xd70d('0x3f')](_0x544f59['AttachmentId'],{'failMessage':_0xd70d('0x40')})[_0xd70d('0x38')](function(_0x26a6b0){ut[_0xd70d('0x41')](_0xd70d('0x42'),_0x26a6b0);})[_0xd70d('0x39')](function(_0x42f4b3){ut[_0xd70d('0x41')](_0xd70d('0x43'),_0x42f4b3);});}else{ut[_0xd70d('0x41')](_0xd70d('0x44'));}}Fax[_0xd70d('0x23')][_0xd70d('0x45')]=function(_0x576a58,_0x4f93e9,_0x2b440d){var _0x1dca91=this;var _0x398e05={};if(_0x4f93e9){_0x398e05={'read':_0x4f93e9};}else{_0x398e05={'failMessage':_0x2b440d};}if(this[_0xd70d('0xd')][_0x576a58][_0xd70d('0x3e')]){faxMessage[_0xd70d('0x3f')](this[_0xd70d('0xd')][_0x576a58][_0xd70d('0x3e')],_0x398e05)[_0xd70d('0x38')](function(_0x445bbf){ut[_0xd70d('0x41')]('[Fax][Message][Updated]',_0x445bbf);})[_0xd70d('0x39')](function(_0x2ad61f){ut[_0xd70d('0x41')]('[Fax][Message][NoUpdate1]',_0x2ad61f);})[_0xd70d('0x46')](function(){delete _0x1dca91[_0xd70d('0xa')][_0x576a58];delete _0x1dca91[_0xd70d('0xd')][_0x576a58];});}else{ut['logger'](_0xd70d('0x47'));delete this[_0xd70d('0xa')][_0x576a58];delete this[_0xd70d('0xd')][_0x576a58];}};Fax[_0xd70d('0x23')][_0xd70d('0x15')]=function(_0x459ccf){var _0x42bff8=this;if(this['channels'][_0x459ccf['uniqueid']]){if(this[_0xd70d('0xd')][_0x459ccf['uniqueid']]){this['channels'][_0x459ccf[_0xd70d('0x1c')]]['id']=this[_0xd70d('0xd')][_0x459ccf[_0xd70d('0x1c')]]['id'];this['channels'][_0x459ccf['uniqueid']][_0xd70d('0x1e')]=this[_0xd70d('0xd')][_0x459ccf[_0xd70d('0x1c')]][_0xd70d('0x1e')];}logger[_0xd70d('0x1f')](_0x459ccf[_0xd70d('0x1c')],this[_0xd70d('0xd')][_0x459ccf[_0xd70d('0x1c')]]?_0xd70d('0x48'):_0xd70d('0x49'),JSON[_0xd70d('0x3c')](this[_0xd70d('0xa')][_0x459ccf[_0xd70d('0x1c')]]));if(this[_0xd70d('0xd')][_0x459ccf[_0xd70d('0x1c')]]){if(this[_0xd70d('0xa')][_0x459ccf[_0xd70d('0x1c')]][_0xd70d('0x4a')]>0x0&&this[_0xd70d('0xa')][_0x459ccf[_0xd70d('0x1c')]]['faxstatus']===_0xd70d('0x4b')){this[_0xd70d('0x45')](_0x459ccf[_0xd70d('0x1c')],!![]);}else{this[_0xd70d('0x45')](_0x459ccf['uniqueid'],![],this['channels'][_0x459ccf['uniqueid']][_0xd70d('0x4c')]?_0xd70d('0x4d')+this[_0xd70d('0xa')][_0x459ccf[_0xd70d('0x1c')]][_0xd70d('0x4c')]:_0xd70d('0x4e'));}}}};Fax[_0xd70d('0x23')]['send']=function(_0x4dface){var _0x30b69c=this;return new BPromise(function(_0x5b11cc,_0xf4f6dc){_0x30b69c[_0xd70d('0x4f')](_0x4dface,_0x30b69c[_0xd70d('0xb')][_0x4dface[_0xd70d('0x50')]])[_0xd70d('0x38')](function(_0x236bcf){ut['logger'](_0xd70d('0x51'),_0x236bcf);_0x5b11cc(ut[_0xd70d('0x33')]('Fax\x20received'));})[_0xd70d('0x39')](function(_0x4de761){ut[_0xd70d('0x41')]('[Fax][execOriginate][failure]',_0x4de761);updateStatus(_0x4dface);_0xf4f6dc(ut[_0xd70d('0x33')](_0xd70d('0x52')));});});};Fax[_0xd70d('0x23')][_0xd70d('0x53')]=function(_0x1f5ccb){var _0x2961e1=this;return new BPromise(function(_0x401b6f,_0x2fbe29){var _0x553681=_0x2961e1[_0xd70d('0x54')](_0x2961e1[_0xd70d('0xb')][_0x1f5ccb[_0xd70d('0x50')]][_0xd70d('0x55')],_0x1f5ccb);if(_0x553681['isValid']){_0x401b6f(ut[_0xd70d('0x33')]('Trunk\x20Reachable'));}else{_0x2fbe29(ut[_0xd70d('0x33')](_0x553681[_0xd70d('0x33')]));}});};function originate(_0x47a4ad,_0x305918,_0x2018b3){return new BPromise(function(_0x45965b,_0x562399){if(_0x2018b3){var _0x341d74=util[_0xd70d('0x56')](_0xd70d('0x57'),path[_0xd70d('0x35')](_0x47a4ad[_0xd70d('0x1')])['name'],_0x47a4ad[_0xd70d('0x1')]);gs[_0xd70d('0x58')](_0x341d74)[_0xd70d('0x38')](function(){_0x47a4ad['path']=util[_0xd70d('0x56')](_0xd70d('0x59'),path[_0xd70d('0x35')](_0x47a4ad[_0xd70d('0x1')])[_0xd70d('0x5a')],path['parse'](_0x47a4ad[_0xd70d('0x1')])['name']);_0x305918[_0xd70d('0x5b')]=_0x47a4ad['path'];ut[_0xd70d('0x41')](_0xd70d('0x5c'),'');ami[_0xd70d('0x5d')](ut[_0xd70d('0x5e')](_0x47a4ad,_0x305918))[_0xd70d('0x38')](function(_0x4eef2a){_0x45965b(_0x4eef2a);})[_0xd70d('0x39')](function(_0x228ced){_0x562399(_0x228ced);});})['catch'](function(_0x5be5c2){_0x562399(_0x5be5c2);});}else{ami[_0xd70d('0x5d')](ut['variablesAction'](_0x47a4ad,_0x305918))[_0xd70d('0x38')](function(_0xb1adbb){_0x45965b(_0xb1adbb);})['catch'](function(_0x49ce21){_0x562399(_0x49ce21);});}});}Fax[_0xd70d('0x23')][_0xd70d('0x4f')]=function(_0x673daa,_0x522c3a){var _0x356baa=this;return new BPromise(function(_0x4539b1,_0x18c255){var _0x534eb6=uuid['v4']();var _0x56024a=ut[_0xd70d('0x5f')](_0x673daa,_0x522c3a);_0x356baa[_0xd70d('0xd')][_0x534eb6]=new Action(_0x534eb6,_0x522c3a,_0x673daa);var _0x5839b8=_0x356baa['actions'][_0x534eb6];if(path[_0xd70d('0x35')](_0x673daa[_0xd70d('0x1')])['ext']===_0xd70d('0x36')){originate(_0x5839b8,_0x56024a,!![])[_0xd70d('0x38')](function(_0x563772){_0x4539b1(_0x563772);})[_0xd70d('0x39')](function(_0x458cdc){_0x18c255(_0x458cdc);});}else{originate(_0x5839b8,_0x56024a,![])[_0xd70d('0x38')](function(_0x20f7ad){_0x4539b1(_0x20f7ad);})[_0xd70d('0x39')](function(_0x4b951f){_0x18c255(_0x4b951f);});}});};Fax[_0xd70d('0x23')][_0xd70d('0x60')]=function(_0x4dfec7){return!_[_0xd70d('0x61')](_0x4dfec7)&&!_[_0xd70d('0x61')](_0x4dfec7[_0xd70d('0x1e')])&&!_[_0xd70d('0x61')](_0x4dfec7[_0xd70d('0x62')])&&_0x4dfec7[_0xd70d('0x62')]&&!_[_0xd70d('0x61')](this[_0xd70d('0xc')][util[_0xd70d('0x56')](_0xd70d('0x63'),_0x4dfec7[_0xd70d('0x1e')])])&&!_[_0xd70d('0x61')](this[_0xd70d('0xc')][util[_0xd70d('0x56')](_0xd70d('0x63'),_0x4dfec7[_0xd70d('0x1e')])]['status'])&&(this['trunks'][util[_0xd70d('0x56')](_0xd70d('0x63'),_0x4dfec7[_0xd70d('0x1e')])][_0xd70d('0x29')]===_0xd70d('0x64')||this[_0xd70d('0xc')][util[_0xd70d('0x56')]('SIP/%s',_0x4dfec7[_0xd70d('0x1e')])][_0xd70d('0x29')]===_0xd70d('0x65'));};Fax[_0xd70d('0x23')][_0xd70d('0x54')]=function(_0x505f47,_0x538188){if(!this['isTrunkReachable'](_0x505f47)){ut[_0xd70d('0x41')](_0xd70d('0x66'),_[_0xd70d('0x61')](_0x505f47)?'':_0x505f47[_0xd70d('0x1e')]+_0xd70d('0x67'));return{'isValid':![],'message':_0xd70d('0x68')};}if(_[_0xd70d('0x61')](_0x538188[_0xd70d('0x4')])){ut[_0xd70d('0x41')](_0xd70d('0x69'),JSON[_0xd70d('0x3c')](_0x538188));return{'isValid':![],'message':_0xd70d('0x6a')};}if(_[_0xd70d('0x61')](_0x538188['path'])){ut[_0xd70d('0x41')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0xd70d('0x3c')](_0x538188));return{'isValid':![],'message':_0xd70d('0x6b')};}return{'isValid':!![],'message':_0xd70d('0x6c')};};module[_0xd70d('0x6d')]=Fax; \ No newline at end of file +var _0x9327=['.pdf','application/pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','updateStatus','then','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','execOriginate','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','message','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','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newexten','syncNewExten','receivefax','syncReceiveFax','hangup','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','prototype','variable','value','syncNewState','channelstate','channelstatedesc','syncFaxStatus','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','parse'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x9327,0xb0));var _0x7932=function(_0x46350a,_0xafe3ff){_0x46350a=_0x46350a-0x0;var _0x1b116a=_0x9327[_0x46350a];return _0x1b116a;};'use strict';var util=require(_0x7932('0x0'));var _=require(_0x7932('0x1'));var BPromise=require(_0x7932('0x2'));var uuid=require(_0x7932('0x3'));var moment=require(_0x7932('0x4'));var path=require(_0x7932('0x5'));var tiff2pdf=require(_0x7932('0x6'));var gs=require(_0x7932('0x7'));var logger=require(_0x7932('0x8'))(_0x7932('0x9'));var ami=require(_0x7932('0xa'));var rpcDb=require(_0x7932('0xb'));var Channel=require(_0x7932('0xc'));var ut=require(_0x7932('0xd'));var Action=require('./action');var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x7932('0xe'));var faxMessage=require(_0x7932('0xf'));function Fax(_0x2df331){this[_0x7932('0x10')]={};this[_0x7932('0x11')]=_0x2df331['faxAccounts'];this[_0x7932('0x12')]=_0x2df331[_0x7932('0x12')];this[_0x7932('0x13')]={};ami['on'](_0x7932('0x14'),this[_0x7932('0x15')][_0x7932('0x16')](this));ami['on'](_0x7932('0x17'),this[_0x7932('0x18')][_0x7932('0x16')](this));ami['on']('newstate',this['syncNewState'][_0x7932('0x16')](this));ami['on'](_0x7932('0x19'),this[_0x7932('0x1a')]['bind'](this));ami['on']('faxstatus',this['syncFaxStatus']['bind'](this));ami['on'](_0x7932('0x1b'),this[_0x7932('0x1c')]['bind'](this));ami['on'](_0x7932('0x1d'),this['syncHangup'][_0x7932('0x16')](this));ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));}Fax['prototype'][_0x7932('0x15')]=function(_0x5bb4ab){if(_0x5bb4ab[_0x7932('0x1e')]===_0x7932('0x1f')){for(var _0x18fcaf in this['faxAccounts']){if(this[_0x7932('0x11')][_0x7932('0x20')](_0x18fcaf)){if(_0x5bb4ab['exten']===this['faxAccounts'][_0x18fcaf][_0x7932('0x21')]){this[_0x7932('0x10')][_0x5bb4ab[_0x7932('0x22')]]={};this['channels'][_0x5bb4ab[_0x7932('0x22')]][_0x7932('0x23')]=_0x5bb4ab[_0x7932('0x23')];this['channels'][_0x5bb4ab[_0x7932('0x22')]]['id']=this[_0x7932('0x11')][_0x18fcaf]['id'];this['channels'][_0x5bb4ab['uniqueid']][_0x7932('0x24')]=this['faxAccounts'][_0x18fcaf]['name'];logger['info'](_0x5bb4ab[_0x7932('0x22')],_0x7932('0x25'));}}}}if(this[_0x7932('0x13')][_0x5bb4ab[_0x7932('0x22')]]){this[_0x7932('0x10')][_0x5bb4ab[_0x7932('0x22')]]={};this['channels'][_0x5bb4ab['uniqueid']]['channel']=_0x5bb4ab[_0x7932('0x23')];logger[_0x7932('0x26')](_0x5bb4ab[_0x7932('0x22')],_0x7932('0x25'));}};Fax[_0x7932('0x27')][_0x7932('0x18')]=function(_0x389f30){if(this['channels'][_0x389f30[_0x7932('0x22')]]){for(var _0x511237 in _0x389f30[_0x7932('0x28')]){if(_0x389f30[_0x7932('0x28')][_0x7932('0x20')](_0x511237)){this[_0x7932('0x10')][_0x389f30[_0x7932('0x22')]][_0x511237]=_0x389f30[_0x7932('0x29')];}}}};Fax[_0x7932('0x27')][_0x7932('0x2a')]=function(_0x1fd361){if(this[_0x7932('0x10')][_0x1fd361[_0x7932('0x22')]]){this[_0x7932('0x10')][_0x1fd361[_0x7932('0x22')]][_0x7932('0x2b')]=_0x1fd361['channelstate'];this[_0x7932('0x10')][_0x1fd361[_0x7932('0x22')]][_0x7932('0x2c')]=_0x1fd361['channelstatedesc'];}};Fax['prototype'][_0x7932('0x1a')]=function(_0x3a009f){if(this[_0x7932('0x10')][_0x3a009f['uniqueid']]){for(var _0x1fff11 in _0x3a009f[_0x7932('0x28')]){if(_0x3a009f['variable'][_0x7932('0x20')](_0x1fff11)){this[_0x7932('0x10')][_0x3a009f[_0x7932('0x22')]][_0x1fff11]=_0x3a009f[_0x7932('0x29')];}}}};Fax['prototype'][_0x7932('0x2d')]=function(_0x5ba982){if(this[_0x7932('0x10')][_0x5ba982[_0x7932('0x22')]]){this[_0x7932('0x10')][_0x5ba982[_0x7932('0x22')]][_0x7932('0x2e')]=_0x5ba982[_0x7932('0x2e')];this[_0x7932('0x10')][_0x5ba982[_0x7932('0x22')]][_0x7932('0x2f')]=_0x5ba982[_0x7932('0x2f')];this[_0x7932('0x10')][_0x5ba982[_0x7932('0x22')]][_0x7932('0x21')]=_0x5ba982[_0x7932('0x21')];this[_0x7932('0x10')][_0x5ba982['uniqueid']]['filename']=_0x5ba982[_0x7932('0x30')];logger['info'](_0x5ba982[_0x7932('0x22')],'\x20syncFaxStatus\x20');}};Fax[_0x7932('0x27')]['syncReceiveFax']=function(_0x577457){var _0x3ebdb5=this;if(this['channels'][_0x577457[_0x7932('0x22')]]){var _0x1253a5=this['channels'][_0x577457[_0x7932('0x22')]]['id'];this[_0x7932('0x10')][_0x577457['uniqueid']][_0x7932('0x31')]=_0x577457[_0x7932('0x31')];this[_0x7932('0x10')][_0x577457[_0x7932('0x22')]][_0x7932('0x32')]=_0x577457['pagestransferred'];this[_0x7932('0x10')][_0x577457['uniqueid']]['localstationid']=_0x577457[_0x7932('0x21')];this[_0x7932('0x10')][_0x577457[_0x7932('0x22')]][_0x7932('0x33')]=_0x577457['resolution'];this['channels'][_0x577457['uniqueid']]['transferrate']=_0x577457[_0x7932('0x34')];this[_0x7932('0x10')][_0x577457[_0x7932('0x22')]]['filename']=_0x577457['filename'];this[_0x7932('0x10')][_0x577457['uniqueid']][_0x7932('0x35')]=_0x577457['calleridnum'];if(this['channels'][_0x577457['uniqueid']][_0x7932('0x32')]>0x0){tiff2pdf(_0x577457[_0x7932('0x30')],'/var/opt/motion2/server/files/attachments/',function(_0x291ddf){logger[_0x7932('0x26')](_0x577457[_0x7932('0x22')],_0x7932('0x36'),_0x291ddf['message']);attachment['create']({'name':path[_0x7932('0x37')](_0x577457[_0x7932('0x30')])[_0x7932('0x24')],'basename':path[_0x7932('0x37')](_0x577457[_0x7932('0x30')])[_0x7932('0x24')]+_0x7932('0x38'),'type':_0x7932('0x39')})['then'](function(_0x9074f){faxAccount[_0x7932('0x3a')](_0x1253a5,{'from':_0x577457[_0x7932('0x35')],'mapKey':'fax','body':path['parse'](_0x577457['filename'])[_0x7932('0x24')]+_0x7932('0x38'),'AttachmentId':_0x9074f['id']})[_0x7932('0x3b')](function(_0x37ca10){logger[_0x7932('0x3c')](_0x577457['uniqueid'],_0x7932('0x3d'),JSON[_0x7932('0x3e')](_0x37ca10));});})[_0x7932('0x3b')](function(_0x5400e9){logger[_0x7932('0x3c')](_0x577457[_0x7932('0x22')],_0x7932('0x3f'),JSON['stringify'](_0x5400e9));});});}logger[_0x7932('0x26')](_0x577457['uniqueid'],_0x7932('0x3f'));}};Fax['prototype'][_0x7932('0x40')]=function(_0x257687){if(this[_0x7932('0x13')][_0x257687['uniqueid']]){_[_0x7932('0x41')](this['channels'][_0x257687[_0x7932('0x22')]],_[_0x7932('0x42')](_0x257687,[_0x7932('0x43'),_0x7932('0x44')]));}};function updateStatus(_0x5b63b4){if(_0x5b63b4[_0x7932('0x45')]){faxMessage[_0x7932('0x46')](_0x5b63b4[_0x7932('0x45')],{'failMessage':_0x7932('0x47')})['then'](function(_0xe094c6){ut['logger']('[Fax][Message][Error][Updated]',_0xe094c6);})[_0x7932('0x3b')](function(_0x488dfa){ut[_0x7932('0x48')]('[Fax][Message][Error][NoUpdate1]',_0x488dfa);});}else{ut[_0x7932('0x48')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x7932('0x27')][_0x7932('0x49')]=function(_0x5c8fe4,_0x409733,_0x213a93){var _0x2108c5=this;var _0x4488e9={};if(_0x409733){_0x4488e9={'read':_0x409733};}else{_0x4488e9={'failMessage':_0x213a93};}if(this['actions'][_0x5c8fe4]['AttachmentId']){faxMessage['update'](this[_0x7932('0x13')][_0x5c8fe4][_0x7932('0x45')],_0x4488e9)[_0x7932('0x4a')](function(_0x3d509b){ut['logger']('[Fax][Message][Updated]',_0x3d509b);})[_0x7932('0x3b')](function(_0x2b024e){ut[_0x7932('0x48')](_0x7932('0x4b'),_0x2b024e);})[_0x7932('0x4c')](function(){delete _0x2108c5['channels'][_0x5c8fe4];delete _0x2108c5['actions'][_0x5c8fe4];});}else{ut['logger'](_0x7932('0x4d'));delete this[_0x7932('0x10')][_0x5c8fe4];delete this['actions'][_0x5c8fe4];}};Fax[_0x7932('0x27')][_0x7932('0x4e')]=function(_0x3ff4cc){var _0x67414=this;if(this['channels'][_0x3ff4cc[_0x7932('0x22')]]){if(this[_0x7932('0x13')][_0x3ff4cc[_0x7932('0x22')]]){this[_0x7932('0x10')][_0x3ff4cc['uniqueid']]['id']=this[_0x7932('0x13')][_0x3ff4cc['uniqueid']]['id'];this['channels'][_0x3ff4cc[_0x7932('0x22')]][_0x7932('0x24')]=this[_0x7932('0x13')][_0x3ff4cc[_0x7932('0x22')]]['name'];}logger[_0x7932('0x26')](_0x3ff4cc[_0x7932('0x22')],this['actions'][_0x3ff4cc[_0x7932('0x22')]]?'\x20hangup\x20sendFile\x20':_0x7932('0x4f'),JSON[_0x7932('0x3e')](this[_0x7932('0x10')][_0x3ff4cc['uniqueid']]));if(this[_0x7932('0x13')][_0x3ff4cc[_0x7932('0x22')]]){if(this[_0x7932('0x10')][_0x3ff4cc[_0x7932('0x22')]][_0x7932('0x50')]>0x0&&this[_0x7932('0x10')][_0x3ff4cc['uniqueid']][_0x7932('0x51')]===_0x7932('0x52')){this[_0x7932('0x49')](_0x3ff4cc[_0x7932('0x22')],!![]);}else{this[_0x7932('0x49')](_0x3ff4cc['uniqueid'],![],this[_0x7932('0x10')][_0x3ff4cc['uniqueid']]['faxstatusstring']?_0x7932('0x53')+this[_0x7932('0x10')][_0x3ff4cc[_0x7932('0x22')]][_0x7932('0x54')]:_0x7932('0x55'));}}}};Fax[_0x7932('0x27')]['send']=function(_0x57cea4){var _0x2ea88a=this;return new BPromise(function(_0x11ba9a,_0x4c216b){_0x2ea88a[_0x7932('0x56')](_0x57cea4,_0x2ea88a['faxAccounts'][_0x57cea4['FaxAccountId']])[_0x7932('0x4a')](function(_0x55ef9c){ut[_0x7932('0x48')](_0x7932('0x57'),_0x55ef9c);_0x11ba9a(ut['message'](_0x7932('0x58')));})[_0x7932('0x3b')](function(_0x6b5c0e){ut[_0x7932('0x48')]('[Fax][execOriginate][failure]',_0x6b5c0e);updateStatus(_0x57cea4);_0x4c216b(ut['message'](_0x7932('0x59')));});});};Fax[_0x7932('0x27')][_0x7932('0x5a')]=function(_0x2e44a3){var _0x2bd6c2=this;return new BPromise(function(_0x378508,_0xc6b514){var _0x52efa5=_0x2bd6c2[_0x7932('0x5b')](_0x2bd6c2['faxAccounts'][_0x2e44a3[_0x7932('0x5c')]][_0x7932('0x5d')],_0x2e44a3);if(_0x52efa5[_0x7932('0x5e')]){_0x378508(ut[_0x7932('0x5f')]('Trunk\x20Reachable'));}else{_0xc6b514(ut[_0x7932('0x5f')](_0x52efa5[_0x7932('0x5f')]));}});};function originate(_0x42ed17,_0x31b049,_0x48815d){return new BPromise(function(_0x4bcf17,_0x1cc9a5){if(_0x48815d){var _0x56b5b7=util[_0x7932('0x60')](_0x7932('0x61'),path[_0x7932('0x37')](_0x42ed17[_0x7932('0x5')])[_0x7932('0x24')],_0x42ed17[_0x7932('0x5')]);gs['execute'](_0x56b5b7)[_0x7932('0x4a')](function(){_0x42ed17[_0x7932('0x5')]=util[_0x7932('0x60')](_0x7932('0x62'),path['parse'](_0x42ed17[_0x7932('0x5')])['dir'],path[_0x7932('0x37')](_0x42ed17[_0x7932('0x5')])[_0x7932('0x24')]);_0x31b049[_0x7932('0x63')]=_0x42ed17[_0x7932('0x5')];ut['logger'](_0x7932('0x64'),'');ami['Action'](ut['variablesAction'](_0x42ed17,_0x31b049))[_0x7932('0x4a')](function(_0x43e235){_0x4bcf17(_0x43e235);})['catch'](function(_0x8a32a2){_0x1cc9a5(_0x8a32a2);});})['catch'](function(_0x1dd881){_0x1cc9a5(_0x1dd881);});}else{ami[_0x7932('0x65')](ut['variablesAction'](_0x42ed17,_0x31b049))['then'](function(_0x43519e){_0x4bcf17(_0x43519e);})['catch'](function(_0x3ba03e){_0x1cc9a5(_0x3ba03e);});}});}Fax[_0x7932('0x27')][_0x7932('0x56')]=function(_0x5a70e8,_0x4432df){var _0x30dac2=this;return new BPromise(function(_0xfc5027,_0x7bbbc2){var _0x3e836d=uuid['v4']();var _0x287f27=ut[_0x7932('0x66')](_0x5a70e8,_0x4432df);_0x30dac2['actions'][_0x3e836d]=new Action(_0x3e836d,_0x4432df,_0x5a70e8);var _0x245832=_0x30dac2[_0x7932('0x13')][_0x3e836d];if(path['parse'](_0x5a70e8[_0x7932('0x5')])[_0x7932('0x67')]===_0x7932('0x38')){originate(_0x245832,_0x287f27,!![])[_0x7932('0x4a')](function(_0x411098){_0xfc5027(_0x411098);})[_0x7932('0x3b')](function(_0x25eab6){_0x7bbbc2(_0x25eab6);});}else{originate(_0x245832,_0x287f27,![])[_0x7932('0x4a')](function(_0x453746){_0xfc5027(_0x453746);})[_0x7932('0x3b')](function(_0x17d474){_0x7bbbc2(_0x17d474);});}});};Fax[_0x7932('0x27')][_0x7932('0x68')]=function(_0x61c668){return!_['isNil'](_0x61c668)&&!_[_0x7932('0x69')](_0x61c668[_0x7932('0x24')])&&!_[_0x7932('0x69')](_0x61c668[_0x7932('0x6a')])&&_0x61c668[_0x7932('0x6a')]&&!_[_0x7932('0x69')](this[_0x7932('0x12')][util['format'](_0x7932('0x6b'),_0x61c668[_0x7932('0x24')])])&&!_[_0x7932('0x69')](this[_0x7932('0x12')][util[_0x7932('0x60')]('SIP/%s',_0x61c668[_0x7932('0x24')])][_0x7932('0x2f')])&&(this['trunks'][util['format'](_0x7932('0x6b'),_0x61c668[_0x7932('0x24')])]['status']===_0x7932('0x6c')||this[_0x7932('0x12')][util['format'](_0x7932('0x6b'),_0x61c668['name'])][_0x7932('0x2f')]==='unmonitored');};Fax['prototype'][_0x7932('0x5b')]=function(_0x1d87a9,_0x18ccc5){if(!this[_0x7932('0x68')](_0x1d87a9)){ut[_0x7932('0x48')](_0x7932('0x6d'),_[_0x7932('0x69')](_0x1d87a9)?'':_0x1d87a9[_0x7932('0x24')]+_0x7932('0x6e'));return{'isValid':![],'message':_0x7932('0x6f')};}if(_[_0x7932('0x69')](_0x18ccc5[_0x7932('0x9')])){ut[_0x7932('0x48')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x18ccc5));return{'isValid':![],'message':_0x7932('0x70')};}if(_[_0x7932('0x69')](_0x18ccc5['path'])){ut['logger'](_0x7932('0x71'),JSON['stringify'](_0x18ccc5));return{'isValid':![],'message':_0x7932('0x72')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x7932('0x73')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 4201d4c..c6957dd 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 _0x1af3=['then','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','error','inspect','notify','resolve'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x1af3,0x1b3));var _0x31af=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x1af3[_0x4fde08];return _0x12e725;};'use strict';var util=require(_0x31af('0x0'));var BPromise=require(_0x31af('0x1'));var logger=require(_0x31af('0x2'))(_0x31af('0x3'));var _=require(_0x31af('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x4da9f8){return function(_0x2d4641){logger[_0x31af('0x5')](_0x4da9f8,util[_0x31af('0x6')](_0x2d4641,{'showHidden':![],'depth':null}));};}exports[_0x31af('0x7')]=function(_0x231e4c,_0x2ba586){return BPromise[_0x31af('0x8')]()[_0x31af('0x9')](faxAccount['notify'](_0x231e4c,_0x2ba586))[_0x31af('0xa')](loggerCatch(_0x31af('0xb')));}; \ No newline at end of file +var _0xaba4=['then','catch','[Notify]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaba4,0x1b3));var _0x4aba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaba4[_0x14add3];return _0x4a174f;};'use strict';var util=require('util');var BPromise=require(_0x4aba('0x0'));var logger=require(_0x4aba('0x1'))(_0x4aba('0x2'));var _=require(_0x4aba('0x3'));var faxAccount=require(_0x4aba('0x4'));function loggerCatch(_0x85d0b6){return function(_0x5c1417){logger[_0x4aba('0x5')](_0x85d0b6,util[_0x4aba('0x6')](_0x5c1417,{'showHidden':![],'depth':null}));};}exports[_0x4aba('0x7')]=function(_0x1c1568,_0x1d3893){return BPromise[_0x4aba('0x8')]()[_0x4aba('0x9')](faxAccount[_0x4aba('0x7')](_0x1c1568,_0x1d3893))[_0x4aba('0xa')](loggerCatch(_0x4aba('0xb')));}; \ 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 43f4212..62e7200 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 _0x31dc=['util','fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x31dc,0xe6));var _0xc31d=function(_0x5a5df4,_0x114e4f){_0x5a5df4=_0x5a5df4-0x0;var _0x314aa8=_0x31dc[_0x5a5df4];return _0x314aa8;};'use strict';var util=require(_0xc31d('0x0'));var logger=require('../../../../config/logger')(_0xc31d('0x1'));var BPromise=require(_0xc31d('0x2'));var exec=require(_0xc31d('0x3'))[_0xc31d('0x4')];exports[_0xc31d('0x5')]=function(_0x1819db){return new BPromise(function(_0x58dd56,_0x25314e){exec(_0x1819db,function(_0x2119ea,_0x429fbe,_0x2f7e30){logger[_0xc31d('0x6')](_0xc31d('0x7'),_0x429fbe);if(_0x2119ea){logger[_0xc31d('0x6')](_0xc31d('0x7'),_0xc31d('0x8'),util[_0xc31d('0x9')](_0x2119ea,{'showHidden':![],'depth':null}),_0x429fbe,_0x2f7e30);_0x25314e(_0x2119ea);}_0x58dd56(_0x429fbe);});});}; \ No newline at end of file +var _0x58da=['child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','util','../../../../config/logger','fax'];(function(_0x3d6db1,_0x4358f8){var _0x5e1cc3=function(_0x3ad5af){while(--_0x3ad5af){_0x3d6db1['push'](_0x3d6db1['shift']());}};_0x5e1cc3(++_0x4358f8);}(_0x58da,0x1b6));var _0xa58d=function(_0x11c3ca,_0x18c151){_0x11c3ca=_0x11c3ca-0x0;var _0x8133bc=_0x58da[_0x11c3ca];return _0x8133bc;};'use strict';var util=require(_0xa58d('0x0'));var logger=require(_0xa58d('0x1'))(_0xa58d('0x2'));var BPromise=require('bluebird');var exec=require(_0xa58d('0x3'))[_0xa58d('0x4')];exports[_0xa58d('0x5')]=function(_0x5184f1){return new BPromise(function(_0x3f1ee6,_0x16aa4e){exec(_0x5184f1,function(_0x31c624,_0x28df7b,_0x402678){logger[_0xa58d('0x6')](_0xa58d('0x7'),_0x28df7b);if(_0x31c624){logger['info'](_0xa58d('0x7'),_0xa58d('0x8'),util['inspect'](_0x31c624,{'showHidden':![],'depth':null}),_0x28df7b,_0x402678);_0x16aa4e(_0x31c624);}_0x3f1ee6(_0x28df7b);});});}; \ 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 9a4d125..0059bb8 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 _0x62e9=['uniqueid','originate','channel','from-sip','format','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','info','inspect','addVariables','ecm','headerinfo','minrate','\x22%s\x22','modem','gateway','faxdetect','localstationid','path','variablesAction'];(function(_0x43a1b8,_0x1c90c8){var _0x324ecc=function(_0x53a93b){while(--_0x53a93b){_0x43a1b8['push'](_0x43a1b8['shift']());}};_0x324ecc(++_0x1c90c8);}(_0x62e9,0x1e6));var _0x962e=function(_0x132299,_0x27324c){_0x132299=_0x132299-0x0;var _0x4389f5=_0x62e9[_0x132299];return _0x4389f5;};'use strict';var util=require(_0x962e('0x0'));var _=require(_0x962e('0x1'));var moment=require(_0x962e('0x2'));var logger=require(_0x962e('0x3'))(_0x962e('0x4'));exports['message']=function(_0x967e76){return{'message':_0x967e76};};exports['logger']=function(_0x510fdc,_0x4300f8){logger[_0x962e('0x5')](_0x510fdc,util[_0x962e('0x6')](_0x4300f8,{'showHidden':![],'depth':null}));};exports[_0x962e('0x7')]=function(_0x35213d,_0x234782){var _0x28ea41={'XMF-ECM':_0x234782[_0x962e('0x8')],'XMF-HEADERINFO':_0x234782[_0x962e('0x9')],'XMF-MINRATE':_0x234782[_0x962e('0xa')],'XMF-MAXRATE':_0x234782['maxrate'],'XMF-MODEM':util['format'](_0x962e('0xb'),_0x234782[_0x962e('0xc')]),'XMF-GATEWAY':_0x234782[_0x962e('0xd')],'XMF-FAXDETECT':_0x234782[_0x962e('0xe')],'XMF-T38TIMEOUT':_0x234782['t38timeout'],'XMF-LOCALSTATIONID':_0x234782[_0x962e('0xf')],'XMF-PATH':_0x35213d[_0x962e('0x10')]};return _0x28ea41;};exports[_0x962e('0x11')]=function(_0x26afc9,_0x1c06ad){return{'actionid':_0x26afc9[_0x962e('0x12')],'action':_0x962e('0x13'),'channel':_0x26afc9[_0x962e('0x14')],'Exten':'xcally-motion-fax','Context':_0x962e('0x15'),'Priority':'1','callerid':util[_0x962e('0x16')](_0x962e('0x17'),_0x26afc9[_0x962e('0x9')]?_0x26afc9[_0x962e('0x9')]:'',_0x26afc9[_0x962e('0xf')]),'variable':_0x1c06ad,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x26afc9[_0x962e('0x12')]};}; \ No newline at end of file +var _0x3d40=['from-sip','uniqueid','lodash','moment','message','logger','info','inspect','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','faxdetect','t38timeout','localstationid','variablesAction','channel'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x3d40,0x1b7));var _0x03d4=function(_0x1da969,_0xe95264){_0x1da969=_0x1da969-0x0;var _0x221055=_0x3d40[_0x1da969];return _0x221055;};'use strict';var util=require('util');var _=require(_0x03d4('0x0'));var moment=require(_0x03d4('0x1'));var logger=require('../../../../config/logger')('fax');exports[_0x03d4('0x2')]=function(_0x572617){return{'message':_0x572617};};exports[_0x03d4('0x3')]=function(_0x2c0738,_0x28c360){logger[_0x03d4('0x4')](_0x2c0738,util[_0x03d4('0x5')](_0x28c360,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x2d8182,_0x2f36f8){var _0xc8ce5b={'XMF-ECM':_0x2f36f8['ecm'],'XMF-HEADERINFO':_0x2f36f8[_0x03d4('0x6')],'XMF-MINRATE':_0x2f36f8[_0x03d4('0x7')],'XMF-MAXRATE':_0x2f36f8[_0x03d4('0x8')],'XMF-MODEM':util[_0x03d4('0x9')](_0x03d4('0xa'),_0x2f36f8[_0x03d4('0xb')]),'XMF-GATEWAY':_0x2f36f8['gateway'],'XMF-FAXDETECT':_0x2f36f8[_0x03d4('0xc')],'XMF-T38TIMEOUT':_0x2f36f8[_0x03d4('0xd')],'XMF-LOCALSTATIONID':_0x2f36f8[_0x03d4('0xe')],'XMF-PATH':_0x2d8182['path']};return _0xc8ce5b;};exports[_0x03d4('0xf')]=function(_0x1f7ca5,_0x4b80a6){return{'actionid':_0x1f7ca5['uniqueid'],'action':'originate','channel':_0x1f7ca5[_0x03d4('0x10')],'Exten':'xcally-motion-fax','Context':_0x03d4('0x11'),'Priority':'1','callerid':util[_0x03d4('0x9')]('\x22%s\x22\x20<%s>',_0x1f7ca5[_0x03d4('0x6')]?_0x1f7ca5['headerinfo']:'',_0x1f7ca5[_0x03d4('0xe')]),'variable':_0x4b80a6,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1f7ca5[_0x03d4('0x12')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index e9743fd..dbf4358 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 _0x909c=['initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','inspect','listen','sync','util','moment','./server','./realtime','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','initAgents','initTelephones','getVoiceQueues','initVoiceQueues','getTriggers','initTemplates','getZendeskAccounts'];(function(_0x1988ea,_0x5d7a22){var _0x23c4de=function(_0x53d3b8){while(--_0x53d3b8){_0x1988ea['push'](_0x1988ea['shift']());}};_0x23c4de(++_0x5d7a22);}(_0x909c,0x1b6));var _0xc909=function(_0x445af8,_0x31831c){_0x445af8=_0x445af8-0x0;var _0x47448d=_0x909c[_0x445af8];return _0x47448d;};'use strict';var util=require(_0xc909('0x0'));var moment=require(_0xc909('0x1'));var server=require(_0xc909('0x2'));var Realtime=require(_0xc909('0x3'));var Report=require('./report');var Acw=require(_0xc909('0x4'));var Trigger=require(_0xc909('0x5'));var Dialer=require(_0xc909('0x6'));var Preview=require(_0xc909('0x7'));var Fax=require('./fax');var user=require(_0xc909('0x8'));var voiceQueue=require(_0xc909('0x9'));var voiceQueueReport=require(_0xc909('0xa'));var voiceCallReport=require(_0xc909('0xb'));var trunk=require(_0xc909('0xc'));var trigger=require(_0xc909('0xd'));var template=require(_0xc909('0xe'));var cmHopperHistory=require(_0xc909('0xf'));var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xc909('0x10'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0xc909('0x11'));var sugarcrm=require(_0xc909('0x12'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xc909('0x13'));var zoho=require(_0xc909('0x14'));var vtiger=require(_0xc909('0x15'));var freshsales=require(_0xc909('0x16'));var servicenow=require(_0xc909('0x17'));var dynamics365=require(_0xc909('0x18'));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(_0xc909('0x19'))(_0xc909('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xc909('0x1b')](_0xc909('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xc909('0x1b')](_0xc909('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xc909('0x1d')]()[_0xc909('0x1e')](user['getAgents']())[_0xc909('0x1e')](realtime[_0xc909('0x1f')]())[_0xc909('0x1e')](user['getTelephones']())[_0xc909('0x1e')](realtime[_0xc909('0x20')]())[_0xc909('0x1e')](trunk['getTrunks']())[_0xc909('0x1e')](realtime['initTrunks']())[_0xc909('0x1e')](voiceQueue[_0xc909('0x21')]())[_0xc909('0x1e')](realtime[_0xc909('0x22')]())[_0xc909('0x1e')](trigger[_0xc909('0x23')]())[_0xc909('0x1e')](realtime['initTriggers']())[_0xc909('0x1e')](template['getTemplates']())['then'](realtime[_0xc909('0x24')]())[_0xc909('0x1e')](zendesk[_0xc909('0x25')]())[_0xc909('0x1e')](realtime[_0xc909('0x26')]())[_0xc909('0x1e')](salesforce[_0xc909('0x27')]())[_0xc909('0x1e')](realtime[_0xc909('0x28')]())['then'](sugarcrm['getSugarcrmAccounts']())[_0xc909('0x1e')](realtime[_0xc909('0x29')]())[_0xc909('0x1e')](freshdesk['getFreshdeskAccounts']())[_0xc909('0x1e')](realtime[_0xc909('0x2a')]())[_0xc909('0x1e')](desk[_0xc909('0x2b')]())[_0xc909('0x1e')](realtime[_0xc909('0x2c')]())[_0xc909('0x1e')](zoho[_0xc909('0x2d')]())[_0xc909('0x1e')](realtime[_0xc909('0x2e')]())[_0xc909('0x1e')](vtiger[_0xc909('0x2f')]())[_0xc909('0x1e')](realtime[_0xc909('0x30')]())[_0xc909('0x1e')](freshsales['getFreshsalesAccounts']())[_0xc909('0x1e')](realtime[_0xc909('0x31')]())[_0xc909('0x1e')](servicenow[_0xc909('0x32')]())[_0xc909('0x1e')](realtime[_0xc909('0x33')]())[_0xc909('0x1e')](dynamics365['getDynamics365Accounts']())[_0xc909('0x1e')](realtime['initDynamics365Accounts']())[_0xc909('0x1e')](campaign['getCampaigns']())['then'](realtime[_0xc909('0x34')]())[_0xc909('0x1e')](voiceExtension['getVoiceExtensions']())[_0xc909('0x1e')](realtime[_0xc909('0x35')]())['then'](faxAccount[_0xc909('0x36')]())['then'](realtime[_0xc909('0x37')]())[_0xc909('0x1e')](function(){return realtime;});}function initParams(){return Promise[_0xc909('0x1d')]()[_0xc909('0x1e')](voiceQueueReport[_0xc909('0x38')]())[_0xc909('0x1e')](realtime[_0xc909('0x39')]())['then'](cmHopperHistory[_0xc909('0x3a')]())[_0xc909('0x1e')](realtime[_0xc909('0x3b')]())[_0xc909('0x1e')](cmHopperHistory[_0xc909('0x3c')]())[_0xc909('0x1e')](realtime[_0xc909('0x3d')]())[_0xc909('0x1e')](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0xc909('0x3e')]())[_0xc909('0x3f')](function(_0x5c40aa){logger[_0xc909('0x40')]('[index.js][initParams]',util[_0xc909('0x41')](_0x5c40aa,{'showHidden':![],'depth':null}));});}function main(){return server[_0xc909('0x42')](realtime,preview,fax)[_0xc909('0x1e')](function(){return initRealtime();})[_0xc909('0x1e')](function(){return initParams();})[_0xc909('0x1e')](function(){report[_0xc909('0x43')]();setInterval(initRealtime,0x1388);})[_0xc909('0x3f')](function(_0x357900){logger['error']('[index.js][main]',util[_0xc909('0x41')](_0x357900,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x71fc=['initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','sync','[index.js][main]','util','./server','./report','./acw','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts'];(function(_0xeaf2ab,_0x59c9b8){var _0x33422a=function(_0x2406b4){while(--_0x2406b4){_0xeaf2ab['push'](_0xeaf2ab['shift']());}};_0x33422a(++_0x59c9b8);}(_0x71fc,0x64));var _0xc71f=function(_0x4cfb94,_0x2aad6d){_0x4cfb94=_0x4cfb94-0x0;var _0xec69eb=_0x71fc[_0x4cfb94];return _0xec69eb;};'use strict';var util=require(_0xc71f('0x0'));var moment=require('moment');var server=require(_0xc71f('0x1'));var Realtime=require('./realtime');var Report=require(_0xc71f('0x2'));var Acw=require(_0xc71f('0x3'));var Trigger=require('./trigger');var Dialer=require(_0xc71f('0x4'));var Preview=require('./preview');var Fax=require(_0xc71f('0x5'));var user=require(_0xc71f('0x6'));var voiceQueue=require(_0xc71f('0x7'));var voiceQueueReport=require(_0xc71f('0x8'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xc71f('0x9'));var trigger=require(_0xc71f('0xa'));var template=require('./rpc/template');var cmHopperHistory=require(_0xc71f('0xb'));var campaign=require(_0xc71f('0xc'));var voiceExtension=require(_0xc71f('0xd'));var faxAccount=require(_0xc71f('0xe'));var zendesk=require(_0xc71f('0xf'));var salesforce=require(_0xc71f('0x10'));var sugarcrm=require(_0xc71f('0x11'));var freshdesk=require(_0xc71f('0x12'));var desk=require(_0xc71f('0x13'));var zoho=require(_0xc71f('0x14'));var vtiger=require(_0xc71f('0x15'));var freshsales=require(_0xc71f('0x16'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xc71f('0x17'));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(_0xc71f('0x18'))(_0xc71f('0x19'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xc71f('0x1a')](_0xc71f('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xc71f('0x1a')](_0xc71f('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xc71f('0x1c')]()[_0xc71f('0x1d')](user['getAgents']())[_0xc71f('0x1d')](realtime[_0xc71f('0x1e')]())[_0xc71f('0x1d')](user[_0xc71f('0x1f')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x20')]())['then'](trunk[_0xc71f('0x21')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x22')]())[_0xc71f('0x1d')](voiceQueue[_0xc71f('0x23')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x24')]())[_0xc71f('0x1d')](trigger['getTriggers']())[_0xc71f('0x1d')](realtime[_0xc71f('0x25')]())[_0xc71f('0x1d')](template['getTemplates']())[_0xc71f('0x1d')](realtime[_0xc71f('0x26')]())[_0xc71f('0x1d')](zendesk[_0xc71f('0x27')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x28')]())[_0xc71f('0x1d')](salesforce[_0xc71f('0x29')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x2a')]())[_0xc71f('0x1d')](sugarcrm[_0xc71f('0x2b')]())['then'](realtime[_0xc71f('0x2c')]())['then'](freshdesk[_0xc71f('0x2d')]())['then'](realtime['initFreshdeskAccounts']())['then'](desk[_0xc71f('0x2e')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x2f')]())[_0xc71f('0x1d')](zoho['getZohoAccounts']())[_0xc71f('0x1d')](realtime[_0xc71f('0x30')]())['then'](vtiger['getVtigerAccounts']())[_0xc71f('0x1d')](realtime[_0xc71f('0x31')]())[_0xc71f('0x1d')](freshsales[_0xc71f('0x32')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x33')]())['then'](servicenow[_0xc71f('0x34')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x35')]())[_0xc71f('0x1d')](dynamics365[_0xc71f('0x36')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x37')]())[_0xc71f('0x1d')](campaign[_0xc71f('0x38')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x39')]())[_0xc71f('0x1d')](voiceExtension['getVoiceExtensions']())[_0xc71f('0x1d')](realtime[_0xc71f('0x3a')]())[_0xc71f('0x1d')](faxAccount[_0xc71f('0x3b')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x3c')]())[_0xc71f('0x1d')](function(){return realtime;});}function initParams(){return Promise[_0xc71f('0x1c')]()['then'](voiceQueueReport[_0xc71f('0x3d')]())[_0xc71f('0x1d')](realtime['initVoiceQueueReports']())[_0xc71f('0x1d')](cmHopperHistory[_0xc71f('0x3e')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x3f')]())[_0xc71f('0x1d')](cmHopperHistory[_0xc71f('0x40')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x41')]())[_0xc71f('0x1d')](voiceCallReport[_0xc71f('0x42')]())[_0xc71f('0x1d')](realtime[_0xc71f('0x43')]())[_0xc71f('0x44')](function(_0x2d4e0c){logger[_0xc71f('0x45')](_0xc71f('0x46'),util[_0xc71f('0x47')](_0x2d4e0c,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0xc71f('0x1d')](function(){return initRealtime();})['then'](function(){return initParams();})[_0xc71f('0x1d')](function(){report[_0xc71f('0x48')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x36ef6b){logger[_0xc71f('0x45')](_0xc71f('0x49'),util['inspect'](_0x36ef6b,{'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 acbd8ca..ce10471 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 _0xc12a=['format','online','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile','interface','voiceStatusTime','voiceStatusCallerIdNumber','onhold','prototype','updateStatusRealtime','toLowerCase','idle','inuse','voiceStatus','statePause','toNumber'];(function(_0x2132a3,_0x4639e9){var _0x21890c=function(_0x34b73d){while(--_0x34b73d){_0x2132a3['push'](_0x2132a3['shift']());}};_0x21890c(++_0x4639e9);}(_0xc12a,0x1c1));var _0xac12=function(_0x35f135,_0x4042dd){_0x35f135=_0x35f135-0x0;var _0x434f7c=_0xc12a[_0x35f135];return _0x434f7c;};'use strict';var _=require(_0xac12('0x0'));var util=require(_0xac12('0x1'));var moment=require('moment');var md5=require(_0xac12('0x2'));var Redis=require(_0xac12('0x3'));var config=require(_0xac12('0x4'));config[_0xac12('0x5')]=_[_0xac12('0x6')](config[_0xac12('0x5')],{'host':_0xac12('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xac12('0x5')]));function Agent(_0x1eacbd){this['id']=_0x1eacbd['id']||0x0;this[_0xac12('0x8')]=_0x1eacbd['name']||'';this['email']=_0x1eacbd[_0xac12('0x9')]||'';this[_0xac12('0xa')]=_0x1eacbd['accountcode']||'';this[_0xac12('0xb')]=_0x1eacbd[_0xac12('0xb')]||'';this[_0xac12('0xc')]=_0xac12('0xd');this[_0xac12('0xe')]=0x0;this[_0xac12('0xf')]='unknown';this[_0xac12('0x10')]='';this[_0xac12('0x11')]='';this[_0xac12('0x12')]='';this[_0xac12('0x13')]='';this['online']=_0x1eacbd['online']||![];this['voiceStatus']=_0xac12('0xd');this[_0xac12('0x14')]=0x0;this[_0xac12('0x15')]='';this['voiceStatusQueue']='';this[_0xac12('0x16')]=![];this['local']=![];this[_0xac12('0x2')]='';}Agent[_0xac12('0x17')][_0xac12('0x18')]=function(_0x4c1a01){var _0x470ecd;if(_0x4c1a01&&_0x4c1a01[_0xac12('0xc')]){_0x470ecd=_0x4c1a01[_0xac12('0xc')][_0xac12('0x19')]();switch(_0x470ecd){case'not_inuse':_0x470ecd=_0xac12('0x1a');break;case _0xac12('0x1b'):_0x470ecd='talking';break;}}if(_0x470ecd&&this[_0xac12('0x1c')]!==_0x470ecd||_0x4c1a01[_0xac12('0x1d')]){this[_0xac12('0x14')]=_[_0xac12('0x1e')](moment()[_0xac12('0x1f')]('x'));}if(_0x470ecd){this[_0xac12('0x1c')]=_0x470ecd;}var _0x4ad48f={'id':this['id'],'name':this[_0xac12('0x8')],'email':this[_0xac12('0x9')],'accountcode':this['accountcode'],'fullname':this[_0xac12('0xb')],'state':this[_0xac12('0xc')],'stateTime':this[_0xac12('0xe')],'status':this[_0xac12('0xf')],'address':this['address'],'online':this[_0xac12('0x20')],'voiceStatus':this[_0xac12('0x1c')],'voiceStatusTime':this[_0xac12('0x14')],'voiceStatusCallerIdNumber':this[_0xac12('0x15')],'voiceStatusQueue':this[_0xac12('0x21')],'interface':this[_0xac12('0x13')],'onhold':this['onhold']};var _0x4c9eb2=md5(JSON[_0xac12('0x22')](_0x4ad48f));if(this['md5']!==_0x4c9eb2){this[_0xac12('0x2')]=_0x4c9eb2;io['to'](util['format'](_0xac12('0x23'),_0x4ad48f[_0xac12('0x8')]))[_0xac12('0x24')](_0xac12('0x25'),_0x4ad48f);io['emit'](_0xac12('0x26'),_0x4ad48f);}};module[_0xac12('0x27')]=Agent; \ No newline at end of file +var _0x4b24=['mobile','interface','online','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','updateStatusRealtime','not_inuse','idle','inuse','statePause','voiceStatusTime','toNumber','format','voiceStatus','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','md5','ioredis','redis','defaults','localhost','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone'];(function(_0x1b02a8,_0x36cfd3){var _0x5b460a=function(_0x5db4d6){while(--_0x5db4d6){_0x1b02a8['push'](_0x1b02a8['shift']());}};_0x5b460a(++_0x36cfd3);}(_0x4b24,0x8a));var _0x44b2=function(_0x4a2612,_0x4a8bb7){_0x4a2612=_0x4a2612-0x0;var _0x23de4b=_0x4b24[_0x4a2612];return _0x23de4b;};'use strict';var _=require(_0x44b2('0x0'));var util=require(_0x44b2('0x1'));var moment=require(_0x44b2('0x2'));var md5=require(_0x44b2('0x3'));var Redis=require(_0x44b2('0x4'));var config=require('../../../config/environment');config[_0x44b2('0x5')]=_[_0x44b2('0x6')](config['redis'],{'host':_0x44b2('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x44b2('0x5')]));function Agent(_0x4df19b){this['id']=_0x4df19b['id']||0x0;this[_0x44b2('0x8')]=_0x4df19b[_0x44b2('0x8')]||'';this[_0x44b2('0x9')]=_0x4df19b[_0x44b2('0x9')]||'';this['accountcode']=_0x4df19b[_0x44b2('0xa')]||'';this[_0x44b2('0xb')]=_0x4df19b['fullname']||'';this[_0x44b2('0xc')]=_0x44b2('0xd');this[_0x44b2('0xe')]=0x0;this[_0x44b2('0xf')]=_0x44b2('0xd');this[_0x44b2('0x10')]='';this[_0x44b2('0x11')]='';this[_0x44b2('0x12')]='';this[_0x44b2('0x13')]='';this[_0x44b2('0x14')]=_0x4df19b['online']||![];this['voiceStatus']=_0x44b2('0xd');this['voiceStatusTime']=0x0;this[_0x44b2('0x15')]='';this[_0x44b2('0x16')]='';this[_0x44b2('0x17')]=![];this[_0x44b2('0x18')]=![];this[_0x44b2('0x3')]='';}Agent['prototype'][_0x44b2('0x19')]=function(_0x30da25){var _0x3c485f;if(_0x30da25&&_0x30da25['state']){_0x3c485f=_0x30da25[_0x44b2('0xc')]['toLowerCase']();switch(_0x3c485f){case _0x44b2('0x1a'):_0x3c485f=_0x44b2('0x1b');break;case _0x44b2('0x1c'):_0x3c485f='talking';break;}}if(_0x3c485f&&this['voiceStatus']!==_0x3c485f||_0x30da25[_0x44b2('0x1d')]){this[_0x44b2('0x1e')]=_[_0x44b2('0x1f')](moment()[_0x44b2('0x20')]('x'));}if(_0x3c485f){this[_0x44b2('0x21')]=_0x3c485f;}var _0x5243fc={'id':this['id'],'name':this[_0x44b2('0x8')],'email':this['email'],'accountcode':this['accountcode'],'fullname':this[_0x44b2('0xb')],'state':this[_0x44b2('0xc')],'stateTime':this[_0x44b2('0xe')],'status':this[_0x44b2('0xf')],'address':this[_0x44b2('0x10')],'online':this[_0x44b2('0x14')],'voiceStatus':this[_0x44b2('0x21')],'voiceStatusTime':this[_0x44b2('0x1e')],'voiceStatusCallerIdNumber':this[_0x44b2('0x15')],'voiceStatusQueue':this[_0x44b2('0x16')],'interface':this[_0x44b2('0x13')],'onhold':this[_0x44b2('0x17')]};var _0x12e7c3=md5(JSON['stringify'](_0x5243fc));if(this[_0x44b2('0x3')]!==_0x12e7c3){this[_0x44b2('0x3')]=_0x12e7c3;io['to'](util[_0x44b2('0x20')](_0x44b2('0x22'),_0x5243fc[_0x44b2('0x8')]))[_0x44b2('0x23')](_0x44b2('0x24'),_0x5243fc);io[_0x44b2('0x23')](_0x44b2('0x25'),_0x5243fc);}};module[_0x44b2('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 7b4e930..8ef375a 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 _0x7912=['message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrAnswerCallsDay'];(function(_0x5ad07c,_0x324dcd){var _0x204bae=function(_0x1245bc){while(--_0x1245bc){_0x5ad07c['push'](_0x5ad07c['shift']());}};_0x204bae(++_0x324dcd);}(_0x7912,0x17b));var _0x2791=function(_0x19a4ae,_0x21054a){_0x19a4ae=_0x19a4ae-0x0;var _0x13b6c3=_0x7912[_0x19a4ae];return _0x13b6c3;};'use strict';function Campaign(_0x2e800f){this['id']=_0x2e800f['id']||0x0;this['name']=_0x2e800f[_0x2791('0x0')]||'';this[_0x2791('0x1')]=_0x2e800f['type']||_0x2791('0x2');this['originated']=0x0;this[_0x2791('0x3')]=0x0;this[_0x2791('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x2791('0x5')]='';this['sendMessageOneNotActive']=!![];this[_0x2791('0x6')]=_0x2e800f['active'];this['limitCalls']=_0x2e800f[_0x2791('0x7')];this[_0x2791('0x8')]=_0x2e800f[_0x2791('0x8')]||null;this['dialGlobalInterval']=_0x2e800f[_0x2791('0x9')]?_0x2e800f['dialGlobalInterval']:null;this[_0x2791('0xa')]=_0x2e800f[_0x2791('0xa')];this[_0x2791('0xb')]=_0x2e800f[_0x2791('0xb')];this[_0x2791('0xc')]=_0x2e800f['dialOriginateTimeout']||0x1e;this[_0x2791('0xd')]=_0x2e800f[_0x2791('0xd')];this[_0x2791('0xe')]=_0x2e800f[_0x2791('0xe')];this['dialBusyMaxRetry']=_0x2e800f[_0x2791('0xf')];this[_0x2791('0x10')]=_0x2e800f['dialBusyRetryFrequency'];this[_0x2791('0x11')]=_0x2e800f[_0x2791('0x11')];this[_0x2791('0x12')]=_0x2e800f[_0x2791('0x12')];this[_0x2791('0x13')]=_0x2e800f[_0x2791('0x13')];this['dialNoSuchNumberMaxRetry']=_0x2e800f[_0x2791('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x2e800f[_0x2791('0x15')]||0x96;this[_0x2791('0x16')]=_0x2e800f[_0x2791('0x16')]||0x3;this[_0x2791('0x17')]=_0x2e800f[_0x2791('0x17')]||0x96;this[_0x2791('0x18')]=_0x2e800f[_0x2791('0x18')]||0x3;this['dialAbandonedRetryFrequency']=_0x2e800f[_0x2791('0x19')]||0x96;this['dialMachineMaxRetry']=_0x2e800f[_0x2791('0x1a')]||0x3;this[_0x2791('0x1b')]=_0x2e800f['dialMachineRetryFrequency']||0x96;this[_0x2791('0x1c')]=_0x2e800f[_0x2791('0x1c')]||0x3;this[_0x2791('0x1d')]=_0x2e800f['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x2e800f[_0x2791('0x1e')]||_0x2791('0x1f');this['dialPrefix']=_0x2e800f[_0x2791('0x20')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x2e800f['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x2791('0x21')]=_0x2e800f[_0x2791('0x21')]||undefined;this['TrunkBackup']=_0x2e800f[_0x2791('0x22')]?_0x2e800f[_0x2791('0x22')]:undefined;this[_0x2791('0x23')]=_0x2e800f[_0x2791('0x23')]?_0x2e800f[_0x2791('0x23')]:undefined;this[_0x2791('0x24')]=_0x2e800f[_0x2791('0x24')]?_0x2e800f[_0x2791('0x24')]:undefined;this[_0x2791('0x25')]=_0x2e800f[_0x2791('0x25')]?_0x2e800f[_0x2791('0x25')]:undefined;this['dialQueueProject']=_0x2e800f[_0x2791('0x25')]?_0x2e800f['SquareProject'][_0x2791('0x0')]:undefined;this[_0x2791('0x26')]=_0x2e800f[_0x2791('0x26')]||![];this[_0x2791('0x27')]=_0x2e800f[_0x2791('0x27')];this[_0x2791('0x28')]=_0x2e800f[_0x2791('0x28')];this[_0x2791('0x29')]=_0x2e800f['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x2e800f['dialAMDTotalAnalysisTime'];this[_0x2791('0x2a')]=_0x2e800f[_0x2791('0x2a')];this['dialAMDBetweenWordsSilence']=_0x2e800f[_0x2791('0x2b')];this[_0x2791('0x2c')]=_0x2e800f['dialAMDMaximumNumberOfWords'];this[_0x2791('0x2d')]=_0x2e800f[_0x2791('0x2d')];this[_0x2791('0x2e')]=_0x2e800f[_0x2791('0x2e')];}module[_0x2791('0x2f')]=Campaign; \ No newline at end of file +var _0x1c42=['dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','exports','name','type','temp','ivrAnswerCallsDay','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix'];(function(_0x284336,_0x4305fd){var _0x441d5a=function(_0x155e46){while(--_0x155e46){_0x284336['push'](_0x284336['shift']());}};_0x441d5a(++_0x4305fd);}(_0x1c42,0x1e6));var _0x21c4=function(_0x4f9ee7,_0x492b5a){_0x4f9ee7=_0x4f9ee7-0x0;var _0x5462a2=_0x1c42[_0x4f9ee7];return _0x5462a2;};'use strict';function Campaign(_0x54867e){this['id']=_0x54867e['id']||0x0;this[_0x21c4('0x0')]=_0x54867e[_0x21c4('0x0')]||'';this[_0x21c4('0x1')]=_0x54867e['type']||'campaign';this['originated']=0x0;this[_0x21c4('0x2')]=0x0;this[_0x21c4('0x3')]=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this[_0x21c4('0x4')]=!![];this[_0x21c4('0x5')]=_0x54867e['active'];this[_0x21c4('0x6')]=_0x54867e[_0x21c4('0x6')];this[_0x21c4('0x7')]=_0x54867e['dialTimezone']||null;this['dialGlobalInterval']=_0x54867e['dialGlobalInterval']?_0x54867e[_0x21c4('0x8')]:null;this[_0x21c4('0x9')]=_0x54867e[_0x21c4('0x9')];this[_0x21c4('0xa')]=_0x54867e[_0x21c4('0xa')];this['dialOriginateTimeout']=_0x54867e[_0x21c4('0xb')]||0x1e;this[_0x21c4('0xc')]=_0x54867e[_0x21c4('0xc')];this[_0x21c4('0xd')]=_0x54867e[_0x21c4('0xd')];this[_0x21c4('0xe')]=_0x54867e[_0x21c4('0xe')];this['dialBusyRetryFrequency']=_0x54867e['dialBusyRetryFrequency'];this[_0x21c4('0xf')]=_0x54867e[_0x21c4('0xf')];this[_0x21c4('0x10')]=_0x54867e[_0x21c4('0x10')];this[_0x21c4('0x11')]=_0x54867e[_0x21c4('0x11')];this[_0x21c4('0x12')]=_0x54867e[_0x21c4('0x12')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x54867e[_0x21c4('0x13')]||0x96;this[_0x21c4('0x14')]=_0x54867e[_0x21c4('0x14')]||0x3;this[_0x21c4('0x15')]=_0x54867e[_0x21c4('0x15')]||0x96;this[_0x21c4('0x16')]=_0x54867e[_0x21c4('0x16')]||0x3;this[_0x21c4('0x17')]=_0x54867e[_0x21c4('0x17')]||0x96;this[_0x21c4('0x18')]=_0x54867e[_0x21c4('0x18')]||0x3;this[_0x21c4('0x19')]=_0x54867e[_0x21c4('0x19')]||0x96;this[_0x21c4('0x1a')]=_0x54867e[_0x21c4('0x1a')]||0x3;this[_0x21c4('0x1b')]=_0x54867e[_0x21c4('0x1b')]||0x96;this[_0x21c4('0x1c')]=_0x54867e[_0x21c4('0x1c')]||_0x21c4('0x1d');this['dialPrefix']=_0x54867e[_0x21c4('0x1e')]||undefined;this[_0x21c4('0x1f')]=_0x54867e['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x21c4('0x20')]=_0x54867e[_0x21c4('0x20')]||undefined;this[_0x21c4('0x21')]=_0x54867e['TrunkBackup']?_0x54867e[_0x21c4('0x21')]:undefined;this[_0x21c4('0x22')]=_0x54867e[_0x21c4('0x22')]?_0x54867e[_0x21c4('0x22')]:undefined;this[_0x21c4('0x23')]=_0x54867e[_0x21c4('0x23')]?_0x54867e['Interval']:undefined;this[_0x21c4('0x24')]=_0x54867e['SquareProject']?_0x54867e['SquareProject']:undefined;this[_0x21c4('0x25')]=_0x54867e[_0x21c4('0x24')]?_0x54867e[_0x21c4('0x24')][_0x21c4('0x0')]:undefined;this[_0x21c4('0x26')]=_0x54867e['dialAMDActive']||![];this[_0x21c4('0x27')]=_0x54867e[_0x21c4('0x27')];this[_0x21c4('0x28')]=_0x54867e[_0x21c4('0x28')];this[_0x21c4('0x29')]=_0x54867e[_0x21c4('0x29')];this[_0x21c4('0x2a')]=_0x54867e[_0x21c4('0x2a')];this['dialAMDMinWordLength']=_0x54867e[_0x21c4('0x2b')];this['dialAMDBetweenWordsSilence']=_0x54867e['dialAMDBetweenWordsSilence'];this[_0x21c4('0x2c')]=_0x54867e[_0x21c4('0x2c')];this[_0x21c4('0x2d')]=_0x54867e[_0x21c4('0x2d')];this['dialAMDMaximumWordLength']=_0x54867e['dialAMDMaximumWordLength'];}module[_0x21c4('0x2e')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index aab77b2..65aa392 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 _0x69d4=['channel','calleridnum','calleridname','connectedlinenum','accountcode','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastdata','duration','billableseconds','disposition','monitor','queue','monitors','transfercalleridnum','exports','starttime'];(function(_0x2b9607,_0x3b5e1d){var _0x3044eb=function(_0x9e91c3){while(--_0x9e91c3){_0x2b9607['push'](_0x2b9607['shift']());}};_0x3044eb(++_0x3b5e1d);}(_0x69d4,0x83));var _0x469d=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0x69d4[_0x2a55f8];return _0x245efd;};'use strict';function Channel(){this[_0x469d('0x0')]=null;this[_0x469d('0x1')]='';this['destinationchannel']='';this[_0x469d('0x2')]=0x0;this[_0x469d('0x3')]='';this[_0x469d('0x4')]=undefined;this['connectedlinename']=undefined;this[_0x469d('0x5')]=0x0;this['context']='';this[_0x469d('0x6')]=0x0;this[_0x469d('0x7')]=0x0;this[_0x469d('0x8')]=0x0;this[_0x469d('0x9')]=![];this[_0x469d('0xa')]=null;this[_0x469d('0xb')]=null;this['unmanaged']=![];this[_0x469d('0xc')]=![];this['lastapplication']='';this[_0x469d('0xd')]='';this[_0x469d('0xe')]=0x0;this[_0x469d('0xf')]=0x0;this['holdtime']=0x0;this['type']=null;this['tag']=null;this[_0x469d('0x10')]=null;this[_0x469d('0x11')]=![];this['monitorFilename']=null;this[_0x469d('0x12')]=null;this[_0x469d('0x13')]=[];this[_0x469d('0x14')]=undefined;this['transferconnectedlinenum']=undefined;this['transferType']=undefined;this['mohtime']=0x0;}module[_0x469d('0x15')]=Channel; \ No newline at end of file +var _0x285b=['exten','answered','answertime','endtime','abandoned','lastapplication','lastdata','holdtime','type','tag','disposition','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','destinationchannel','calleridnum','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid'];(function(_0x32d369,_0x560b9c){var _0x59180b=function(_0x157fa2){while(--_0x157fa2){_0x32d369['push'](_0x32d369['shift']());}};_0x59180b(++_0x560b9c);}(_0x285b,0x171));var _0xb285=function(_0x53901e,_0x36adc1){_0x53901e=_0x53901e-0x0;var _0x27fdb1=_0x285b[_0x53901e];return _0x27fdb1;};'use strict';function Channel(){this[_0xb285('0x0')]=null;this['channel']='';this[_0xb285('0x1')]='';this[_0xb285('0x2')]=0x0;this['calleridname']='';this[_0xb285('0x3')]=undefined;this[_0xb285('0x4')]=undefined;this[_0xb285('0x5')]=0x0;this[_0xb285('0x6')]='';this[_0xb285('0x7')]=0x0;this[_0xb285('0x8')]=0x0;this[_0xb285('0x9')]=0x0;this[_0xb285('0xa')]=![];this[_0xb285('0xb')]=null;this[_0xb285('0xc')]=null;this['unmanaged']=![];this[_0xb285('0xd')]=![];this[_0xb285('0xe')]='';this[_0xb285('0xf')]='';this['duration']=0x0;this['billableseconds']=0x0;this[_0xb285('0x10')]=0x0;this[_0xb285('0x11')]=null;this[_0xb285('0x12')]=null;this[_0xb285('0x13')]=null;this['monitor']=![];this[_0xb285('0x14')]=null;this['queue']=null;this[_0xb285('0x15')]=[];this[_0xb285('0x16')]=undefined;this[_0xb285('0x17')]=undefined;this[_0xb285('0x18')]=undefined;this[_0xb285('0x19')]=0x0;}module[_0xb285('0x1a')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 7604960..a1b36d8 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 _0x566a=['consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey'];(function(_0x37cf32,_0x562b9c){var _0x1feaac=function(_0x142e17){while(--_0x142e17){_0x37cf32['push'](_0x37cf32['shift']());}};_0x1feaac(++_0x562b9c);}(_0x566a,0xe4));var _0xa566=function(_0x22fcf2,_0x45f2f0){_0x22fcf2=_0x22fcf2-0x0;var _0x4ccdb1=_0x566a[_0x22fcf2];return _0x4ccdb1;};'use strict';function DeskAccount(_0x1daeb7){this['id']=_0x1daeb7['id']||0x0;this['name']=_0x1daeb7[_0xa566('0x0')]||'';this[_0xa566('0x1')]=_0x1daeb7[_0xa566('0x1')]||'';this[_0xa566('0x2')]=_0x1daeb7[_0xa566('0x2')]||'';this[_0xa566('0x3')]=_0x1daeb7[_0xa566('0x3')]||'';this[_0xa566('0x4')]=_0x1daeb7[_0xa566('0x4')]||'';this[_0xa566('0x5')]=_0x1daeb7[_0xa566('0x5')]||'';this['consumerSecret']=_0x1daeb7[_0xa566('0x6')]||'';this[_0xa566('0x7')]=_0x1daeb7[_0xa566('0x7')]||'';this[_0xa566('0x8')]=_0x1daeb7[_0xa566('0x8')]||'';this['type']=_0x1daeb7[_0xa566('0x9')]||'';this[_0xa566('0xa')]=_0x1daeb7[_0xa566('0xa')]||'';this[_0xa566('0xb')]=_0x1daeb7[_0xa566('0xb')]||{};}module[_0xa566('0xc')]=DeskAccount; \ No newline at end of file +var _0xc608=['Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','serverUrl'];(function(_0x2652dd,_0x103985){var _0x5ca280=function(_0x5514f4){while(--_0x5514f4){_0x2652dd['push'](_0x2652dd['shift']());}};_0x5ca280(++_0x103985);}(_0xc608,0x12a));var _0x8c60=function(_0x4bbeb7,_0x374606){_0x4bbeb7=_0x4bbeb7-0x0;var _0x9bad8f=_0xc608[_0x4bbeb7];return _0x9bad8f;};'use strict';function DeskAccount(_0x14e53a){this['id']=_0x14e53a['id']||0x0;this[_0x8c60('0x0')]=_0x14e53a['name']||'';this['username']=_0x14e53a[_0x8c60('0x1')]||'';this[_0x8c60('0x2')]=_0x14e53a[_0x8c60('0x2')]||'';this[_0x8c60('0x3')]=_0x14e53a[_0x8c60('0x3')]||'';this[_0x8c60('0x4')]=_0x14e53a['password']||'';this[_0x8c60('0x5')]=_0x14e53a[_0x8c60('0x5')]||'';this[_0x8c60('0x6')]=_0x14e53a[_0x8c60('0x6')]||'';this[_0x8c60('0x7')]=_0x14e53a[_0x8c60('0x7')]||'';this[_0x8c60('0x8')]=_0x14e53a[_0x8c60('0x8')]||'';this['type']=_0x14e53a['type']||'';this[_0x8c60('0x9')]=_0x14e53a[_0x8c60('0x9')]||'';this[_0x8c60('0xa')]=_0x14e53a[_0x8c60('0xa')]||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 0bea7e5..89357f3 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 _0x0f1e=['serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0f1e,0x186));var _0xe0f1=function(_0x113bde,_0x4f07f2){_0x113bde=_0x113bde-0x0;var _0x2b8e60=_0x0f1e[_0x113bde];return _0x2b8e60;};'use strict';function Dynamics365Account(_0x96defd){this['id']=_0x96defd['id']||0x0;this[_0xe0f1('0x0')]=_0x96defd[_0xe0f1('0x0')]||'';this['username']=_0x96defd['username']||'';this[_0xe0f1('0x1')]=_0x96defd[_0xe0f1('0x1')]||'';this[_0xe0f1('0x2')]=_0x96defd[_0xe0f1('0x2')]||'';this[_0xe0f1('0x3')]=_0x96defd[_0xe0f1('0x3')]||'';this[_0xe0f1('0x4')]=_0x96defd['clientId']||'';this[_0xe0f1('0x5')]=_0x96defd[_0xe0f1('0x5')]||{};this['serverUrl']=_0x96defd[_0xe0f1('0x6')]||'';this[_0xe0f1('0x7')]=_0x96defd[_0xe0f1('0x7')]||![];this['Configurations']=_0x96defd[_0xe0f1('0x8')]||{};this[_0xe0f1('0x9')]=_0x96defd[_0xe0f1('0x9')]||{};}module[_0xe0f1('0xa')]=Dynamics365Account; \ No newline at end of file +var _0x4bf0=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports'];(function(_0x9809ea,_0x40572d){var _0x269fa6=function(_0x411b74){while(--_0x411b74){_0x9809ea['push'](_0x9809ea['shift']());}};_0x269fa6(++_0x40572d);}(_0x4bf0,0x1d4));var _0x04bf=function(_0x4057f1,_0x5df9a4){_0x4057f1=_0x4057f1-0x0;var _0x294892=_0x4bf0[_0x4057f1];return _0x294892;};'use strict';function Dynamics365Account(_0x129e98){this['id']=_0x129e98['id']||0x0;this[_0x04bf('0x0')]=_0x129e98[_0x04bf('0x0')]||'';this[_0x04bf('0x1')]=_0x129e98[_0x04bf('0x1')]||'';this[_0x04bf('0x2')]=_0x129e98[_0x04bf('0x2')]||'';this[_0x04bf('0x3')]=_0x129e98[_0x04bf('0x3')]||'';this[_0x04bf('0x4')]=_0x129e98[_0x04bf('0x4')]||'';this[_0x04bf('0x5')]=_0x129e98[_0x04bf('0x5')]||'';this[_0x04bf('0x6')]=_0x129e98[_0x04bf('0x6')]||{};this[_0x04bf('0x7')]=_0x129e98[_0x04bf('0x7')]||'';this[_0x04bf('0x8')]=_0x129e98[_0x04bf('0x8')]||![];this['Configurations']=_0x129e98[_0x04bf('0x9')]||{};this[_0x04bf('0xa')]=_0x129e98[_0x04bf('0xa')]||{};}module[_0x04bf('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 089c24f..8f629b5 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 _0xbc2d=['Trunk','ListId','key','exports','name','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','tech','SIP'];(function(_0x2bdb33,_0x3505df){var _0x36b487=function(_0x4419e3){while(--_0x4419e3){_0x2bdb33['push'](_0x2bdb33['shift']());}};_0x36b487(++_0x3505df);}(_0xbc2d,0x1c4));var _0xdbc2=function(_0x456ba9,_0x3de64d){_0x456ba9=_0x456ba9-0x0;var _0xed35b4=_0xbc2d[_0x456ba9];return _0xed35b4;};'use strict';function FaxAccount(_0x1d1f8b){this['id']=_0x1d1f8b['id']||0x0;this[_0xdbc2('0x0')]=_0x1d1f8b[_0xdbc2('0x0')]||'';this['description']=_0x1d1f8b['description'];this[_0xdbc2('0x1')]=_0x1d1f8b[_0xdbc2('0x1')];this['headerinfo']=_0x1d1f8b[_0xdbc2('0x2')];this[_0xdbc2('0x3')]=_0x1d1f8b['localstationid'];this['minrate']=_0x1d1f8b[_0xdbc2('0x4')]||0x960;this[_0xdbc2('0x5')]=_0x1d1f8b[_0xdbc2('0x5')]||0x3840;this[_0xdbc2('0x6')]=_0x1d1f8b[_0xdbc2('0x6')]||_0xdbc2('0x7');this[_0xdbc2('0x8')]=_0x1d1f8b[_0xdbc2('0x8')]||'no';this[_0xdbc2('0x9')]=_0x1d1f8b['faxdetect']||'no';this['t38timeout']=_0x1d1f8b['t38timeout']||0x1388;this[_0xdbc2('0xa')]=_0x1d1f8b[_0xdbc2('0xa')]||_0xdbc2('0xb');this[_0xdbc2('0xc')]=_0x1d1f8b[_0xdbc2('0xc')]?_0x1d1f8b[_0xdbc2('0xc')]:undefined;this[_0xdbc2('0xd')]=_0x1d1f8b[_0xdbc2('0xd')];this[_0xdbc2('0xe')]=_0x1d1f8b[_0xdbc2('0xe')];}module[_0xdbc2('0xf')]=FaxAccount; \ No newline at end of file +var _0x6b43=['exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x6b43,0x18d));var _0x36b4=function(_0xfc2644,_0x4a3b13){_0xfc2644=_0xfc2644-0x0;var _0x4873b7=_0x6b43[_0xfc2644];return _0x4873b7;};'use strict';function FaxAccount(_0x259e60){this['id']=_0x259e60['id']||0x0;this[_0x36b4('0x0')]=_0x259e60[_0x36b4('0x0')]||'';this[_0x36b4('0x1')]=_0x259e60[_0x36b4('0x1')];this[_0x36b4('0x2')]=_0x259e60[_0x36b4('0x2')];this[_0x36b4('0x3')]=_0x259e60[_0x36b4('0x3')];this[_0x36b4('0x4')]=_0x259e60[_0x36b4('0x4')];this['minrate']=_0x259e60[_0x36b4('0x5')]||0x960;this[_0x36b4('0x6')]=_0x259e60[_0x36b4('0x6')]||0x3840;this['modem']=_0x259e60[_0x36b4('0x7')]||_0x36b4('0x8');this[_0x36b4('0x9')]=_0x259e60['gateway']||'no';this[_0x36b4('0xa')]=_0x259e60['faxdetect']||'no';this[_0x36b4('0xb')]=_0x259e60['t38timeout']||0x1388;this[_0x36b4('0xc')]=_0x259e60[_0x36b4('0xc')]||_0x36b4('0xd');this[_0x36b4('0xe')]=_0x259e60['Trunk']?_0x259e60[_0x36b4('0xe')]:undefined;this[_0x36b4('0xf')]=_0x259e60[_0x36b4('0xf')];this['key']=_0x259e60[_0x36b4('0x10')];}module[_0x36b4('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index e4d066e..27a47e4 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 _0x28d9=['serverUrl','Configurations','exports','name','username'];(function(_0x4305b2,_0xdea0a9){var _0x4c97a7=function(_0x4c160f){while(--_0x4c160f){_0x4305b2['push'](_0x4305b2['shift']());}};_0x4c97a7(++_0xdea0a9);}(_0x28d9,0xcb));var _0x928d=function(_0x3c4778,_0x4fc6e9){_0x3c4778=_0x3c4778-0x0;var _0xac1d9b=_0x28d9[_0x3c4778];return _0xac1d9b;};'use strict';function FreshdeskAccount(_0x2f4c8a){this['id']=_0x2f4c8a['id']||0x0;this[_0x928d('0x0')]=_0x2f4c8a[_0x928d('0x0')]||'';this[_0x928d('0x1')]=_0x2f4c8a[_0x928d('0x1')]||'';this['apiKey']=_0x2f4c8a['token']||'';this['remoteUri']=_0x2f4c8a['remoteUri']||'';this[_0x928d('0x2')]=_0x2f4c8a[_0x928d('0x2')]||'';this[_0x928d('0x3')]=_0x2f4c8a[_0x928d('0x3')]||{};}module[_0x928d('0x4')]=FreshdeskAccount; \ No newline at end of file +var _0x0797=['apiKey','token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x4360c4,_0x2f8209){var _0x3168c8=function(_0x309523){while(--_0x309523){_0x4360c4['push'](_0x4360c4['shift']());}};_0x3168c8(++_0x2f8209);}(_0x0797,0x124));var _0x7079=function(_0xcd586e,_0x599911){_0xcd586e=_0xcd586e-0x0;var _0x3d6e15=_0x0797[_0xcd586e];return _0x3d6e15;};'use strict';function FreshdeskAccount(_0x12daeb){this['id']=_0x12daeb['id']||0x0;this[_0x7079('0x0')]=_0x12daeb['name']||'';this[_0x7079('0x1')]=_0x12daeb[_0x7079('0x1')]||'';this[_0x7079('0x2')]=_0x12daeb[_0x7079('0x3')]||'';this[_0x7079('0x4')]=_0x12daeb[_0x7079('0x4')]||'';this['serverUrl']=_0x12daeb[_0x7079('0x5')]||'';this[_0x7079('0x6')]=_0x12daeb[_0x7079('0x6')]||{};}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 b9a9c8e..2fcb351 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 _0x4b47=['serverUrl','Configurations','name','username','apiKey','token','remoteUri'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x4b47,0x1b4));var _0x74b4=function(_0x338a0c,_0x3ca555){_0x338a0c=_0x338a0c-0x0;var _0x46a4fe=_0x4b47[_0x338a0c];return _0x46a4fe;};'use strict';function FreshsalesAccount(_0x40f022){this['id']=_0x40f022['id']||0x0;this['name']=_0x40f022[_0x74b4('0x0')]||'';this[_0x74b4('0x1')]=_0x40f022[_0x74b4('0x1')]||'';this[_0x74b4('0x2')]=_0x40f022[_0x74b4('0x3')]||'';this[_0x74b4('0x4')]=_0x40f022['remoteUri']||'';this['serverUrl']=_0x40f022[_0x74b4('0x5')]||'';this[_0x74b4('0x6')]=_0x40f022['Configurations']||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0xe5e0=['apiKey','token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x123f2b,_0x46c143){var _0x3e1efd=function(_0x28fadc){while(--_0x28fadc){_0x123f2b['push'](_0x123f2b['shift']());}};_0x3e1efd(++_0x46c143);}(_0xe5e0,0x1be));var _0x0e5e=function(_0x5d9e08,_0x2fa647){_0x5d9e08=_0x5d9e08-0x0;var _0x435e67=_0xe5e0[_0x5d9e08];return _0x435e67;};'use strict';function FreshsalesAccount(_0x94e88){this['id']=_0x94e88['id']||0x0;this[_0x0e5e('0x0')]=_0x94e88[_0x0e5e('0x0')]||'';this[_0x0e5e('0x1')]=_0x94e88[_0x0e5e('0x1')]||'';this[_0x0e5e('0x2')]=_0x94e88[_0x0e5e('0x3')]||'';this[_0x0e5e('0x4')]=_0x94e88[_0x0e5e('0x4')]||'';this['serverUrl']=_0x94e88[_0x0e5e('0x5')]||'';this[_0x0e5e('0x6')]=_0x94e88[_0x0e5e('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index cdadf30..69bc3d1 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 _0x8320=['queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','priority','holdtime','assigned','voice','routealias','mohtime','variables','exports','uniqueid','calleridname','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallerexit'];(function(_0x515e5c,_0x3c3367){var _0x5427b3=function(_0x56ef07){while(--_0x56ef07){_0x515e5c['push'](_0x515e5c['shift']());}};_0x5427b3(++_0x3c3367);}(_0x8320,0x1c5));var _0x0832=function(_0x4d521e,_0x58ba39){_0x4d521e=_0x4d521e-0x0;var _0x3beb42=_0x8320[_0x4d521e];return _0x3beb42;};'use strict';function QueueReport(){this['type']='inbound';this[_0x0832('0x0')]='';this['calleridnum']='';this[_0x0832('0x1')]='';this[_0x0832('0x2')]='';this['queuecallerjoinAt']=null;this[_0x0832('0x3')]=null;this[_0x0832('0x4')]=0x1;this[_0x0832('0x5')]=0x1;this[_0x0832('0x6')]=![];this[_0x0832('0x7')]=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0x0832('0x8')]=![];this[_0x0832('0x9')]=null;this[_0x0832('0xa')]=0x1;this[_0x0832('0xb')]='';this[_0x0832('0xc')]='';this[_0x0832('0xd')]='';this['accountcode']='';this['context']='';this['exten']='';this[_0x0832('0xe')]='';this[_0x0832('0xf')]=0x0;this[_0x0832('0x10')]=![];this['lastAssignedTo']='';this['motionChannel']=_0x0832('0x11');this[_0x0832('0x12')]=null;this[_0x0832('0x13')]=0x0;this[_0x0832('0x14')]={};}module[_0x0832('0x15')]=QueueReport; \ No newline at end of file +var _0x188e=['inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerabandon','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','accountcode','assigned','motionChannel','routealias'];(function(_0x2a1374,_0x4d9327){var _0x45eead=function(_0x475b7a){while(--_0x475b7a){_0x2a1374['push'](_0x2a1374['shift']());}};_0x45eead(++_0x4d9327);}(_0x188e,0x140));var _0xe188=function(_0x37cc84,_0x1e2f2a){_0x37cc84=_0x37cc84-0x0;var _0x37ec6b=_0x188e[_0x37cc84];return _0x37ec6b;};'use strict';function QueueReport(){this['type']=_0xe188('0x0');this[_0xe188('0x1')]='';this[_0xe188('0x2')]='';this[_0xe188('0x3')]='';this[_0xe188('0x4')]='';this[_0xe188('0x5')]=null;this['queuecallerleaveAt']=null;this['position']=0x1;this['count']=0x1;this[_0xe188('0x6')]=![];this[_0xe188('0x7')]=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0xe188('0x8')]=![];this[_0xe188('0x9')]=null;this[_0xe188('0xa')]=0x1;this['channel']='';this[_0xe188('0xb')]='';this['connectedlinename']='';this[_0xe188('0xc')]='';this['context']='';this['exten']='';this['priority']='';this['holdtime']=0x0;this[_0xe188('0xd')]=![];this['lastAssignedTo']='';this[_0xe188('0xe')]='voice';this[_0xe188('0xf')]=null;this['mohtime']=0x0;this['variables']={};}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 3c7997d..7fe0fe4 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 _0xa8cb=['remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0x4800bf,_0x3f6aa0){var _0x4dc339=function(_0x5d32f2){while(--_0x5d32f2){_0x4800bf['push'](_0x4800bf['shift']());}};_0x4dc339(++_0x3f6aa0);}(_0xa8cb,0x1de));var _0xba8c=function(_0x37ec83,_0x6870fc){_0x37ec83=_0x37ec83-0x0;var _0x1aa4e6=_0xa8cb[_0x37ec83];return _0x1aa4e6;};'use strict';function SalesforceAccount(_0x399b52){this['id']=_0x399b52['id']||0x0;this[_0xba8c('0x0')]=_0x399b52['name']||'';this['username']=_0x399b52[_0xba8c('0x1')]||'';this[_0xba8c('0x2')]=_0x399b52['remoteUri']||'';this[_0xba8c('0x3')]=_0x399b52[_0xba8c('0x3')]||'';this[_0xba8c('0x4')]=_0x399b52[_0xba8c('0x4')]||'';this[_0xba8c('0x5')]=_0x399b52['clientSecret']||'';this[_0xba8c('0x6')]=_0x399b52['securityToken']||'';this[_0xba8c('0x7')]=_0x399b52[_0xba8c('0x7')]||_0xba8c('0x8');this[_0xba8c('0x9')]=_0x399b52[_0xba8c('0x9')]||'';this['Configurations']=_0x399b52[_0xba8c('0xa')]||{};}module[_0xba8c('0xb')]=SalesforceAccount; \ No newline at end of file +var _0xdd4f=['serverUrl','Configurations','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x2628b0,_0xa51fc9){var _0x44c69a=function(_0xd38a96){while(--_0xd38a96){_0x2628b0['push'](_0x2628b0['shift']());}};_0x44c69a(++_0xa51fc9);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x334b4f,_0x1530f1){_0x334b4f=_0x334b4f-0x0;var _0x899957=_0xdd4f[_0x334b4f];return _0x899957;};'use strict';function SalesforceAccount(_0x447337){this['id']=_0x447337['id']||0x0;this['name']=_0x447337['name']||'';this['username']=_0x447337[_0xfdd4('0x0')]||'';this[_0xfdd4('0x1')]=_0x447337['remoteUri']||'';this[_0xfdd4('0x2')]=_0x447337[_0xfdd4('0x2')]||'';this[_0xfdd4('0x3')]=_0x447337['clientId']||'';this[_0xfdd4('0x4')]=_0x447337[_0xfdd4('0x4')]||'';this[_0xfdd4('0x5')]=_0x447337[_0xfdd4('0x5')]||'';this[_0xfdd4('0x6')]=_0x447337['type']||_0xfdd4('0x7');this['serverUrl']=_0x447337[_0xfdd4('0x8')]||'';this[_0xfdd4('0x9')]=_0x447337[_0xfdd4('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index acac10a..ec45051 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 _0x230c=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x29ae84,_0x2a26e0){var _0x526794=function(_0x432b73){while(--_0x432b73){_0x29ae84['push'](_0x29ae84['shift']());}};_0x526794(++_0x2a26e0);}(_0x230c,0x1c9));var _0xc230=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x230c[_0x1928c9];return _0x51b5fb;};'use strict';function ServicenowAccount(_0x35ff2d){this['id']=_0x35ff2d['id']||0x0;this[_0xc230('0x0')]=_0x35ff2d['name']||'';this[_0xc230('0x1')]=_0x35ff2d[_0xc230('0x1')]||'';this[_0xc230('0x2')]=_0x35ff2d[_0xc230('0x2')]||'';this[_0xc230('0x3')]=_0x35ff2d[_0xc230('0x3')]||'';this[_0xc230('0x4')]=_0x35ff2d[_0xc230('0x4')]||'';this[_0xc230('0x5')]=_0x35ff2d[_0xc230('0x5')]||{};}module[_0xc230('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x25e3=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x3f2b1a,_0x5de6e8){var _0x377fd6=function(_0x5169fd){while(--_0x5169fd){_0x3f2b1a['push'](_0x3f2b1a['shift']());}};_0x377fd6(++_0x5de6e8);}(_0x25e3,0xce));var _0x325e=function(_0x29a75d,_0x3fb49b){_0x29a75d=_0x29a75d-0x0;var _0x33d125=_0x25e3[_0x29a75d];return _0x33d125;};'use strict';function ServicenowAccount(_0x10ca8e){this['id']=_0x10ca8e['id']||0x0;this['name']=_0x10ca8e[_0x325e('0x0')]||'';this[_0x325e('0x1')]=_0x10ca8e[_0x325e('0x1')]||'';this[_0x325e('0x2')]=_0x10ca8e[_0x325e('0x2')]||'';this['remoteUri']=_0x10ca8e[_0x325e('0x3')]||'';this['serverUrl']=_0x10ca8e[_0x325e('0x4')]||'';this['Configurations']=_0x10ca8e[_0x325e('0x5')]||{};}module[_0x325e('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 0ad4b19..2874d6a 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 _0x6278=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6278,0x7c));var _0x8627=function(_0x2a276d,_0x482b0c){_0x2a276d=_0x2a276d-0x0;var _0x2914cd=_0x6278[_0x2a276d];return _0x2914cd;};'use strict';function SugarcrmAccount(_0x91ac69){this['id']=_0x91ac69['id']||0x0;this[_0x8627('0x0')]=_0x91ac69[_0x8627('0x0')]||'';this[_0x8627('0x1')]=_0x91ac69[_0x8627('0x1')]||'';this[_0x8627('0x2')]=_0x91ac69['password']||'';this[_0x8627('0x3')]=_0x91ac69['remoteUri']||'';this[_0x8627('0x4')]=_0x91ac69[_0x8627('0x4')]||'';this[_0x8627('0x5')]=_0x91ac69[_0x8627('0x5')]||{};}module[_0x8627('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x535f=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x535f,0x160));var _0xf535=function(_0x4bf793,_0x404922){_0x4bf793=_0x4bf793-0x0;var _0x55a44b=_0x535f[_0x4bf793];return _0x55a44b;};'use strict';function SugarcrmAccount(_0x213768){this['id']=_0x213768['id']||0x0;this['name']=_0x213768[_0xf535('0x0')]||'';this[_0xf535('0x1')]=_0x213768[_0xf535('0x1')]||'';this[_0xf535('0x2')]=_0x213768[_0xf535('0x2')]||'';this[_0xf535('0x3')]=_0x213768[_0xf535('0x3')]||'';this[_0xf535('0x4')]=_0x213768[_0xf535('0x4')]||'';this['Configurations']=_0x213768[_0xf535('0x5')]||{};}module[_0xf535('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 be8e65b..f728698 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 _0x2143=['status','address','exports','name','state','unknown','stateTime'];(function(_0xe085c5,_0x5a85cc){var _0x52345a=function(_0x22ce94){while(--_0x22ce94){_0xe085c5['push'](_0xe085c5['shift']());}};_0x52345a(++_0x5a85cc);}(_0x2143,0x114));var _0x3214=function(_0x317ff1,_0x5117df){_0x317ff1=_0x317ff1-0x0;var _0x1f3dd3=_0x2143[_0x317ff1];return _0x1f3dd3;};'use strict';function Telephone(_0x554969){this['id']=_0x554969['id']||0x0;this[_0x3214('0x0')]=_0x554969[_0x3214('0x0')]||'';this['accountcode']=_0x554969['accountcode']||'';this[_0x3214('0x1')]=_0x3214('0x2');this[_0x3214('0x3')]=0x0;this[_0x3214('0x4')]=_0x3214('0x2');this[_0x3214('0x5')]='';}module[_0x3214('0x6')]=Telephone; \ No newline at end of file +var _0x205d=['name','state','unknown','stateTime','address','exports'];(function(_0x4eb6ec,_0x7f2520){var _0x58881b=function(_0x4f375f){while(--_0x4f375f){_0x4eb6ec['push'](_0x4eb6ec['shift']());}};_0x58881b(++_0x7f2520);}(_0x205d,0xf6));var _0xd205=function(_0x5dcd95,_0x1e72d4){_0x5dcd95=_0x5dcd95-0x0;var _0x271b17=_0x205d[_0x5dcd95];return _0x271b17;};'use strict';function Telephone(_0x3e0609){this['id']=_0x3e0609['id']||0x0;this[_0xd205('0x0')]=_0x3e0609[_0xd205('0x0')]||'';this['accountcode']=_0x3e0609['accountcode']||'';this[_0xd205('0x1')]=_0xd205('0x2');this[_0xd205('0x3')]=0x0;this['status']=_0xd205('0x2');this[_0xd205('0x4')]='';}module[_0xd205('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 09c4c10..cb09f51 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(_0x4e4865,_0x2f7d4c){var _0x3240d0=function(_0x220252){while(--_0x220252){_0x4e4865['push'](_0x4e4865['shift']());}};_0x3240d0(++_0x2f7d4c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x103ff7,_0x5a9dc1){var _0x5a3986=function(_0xebac0c){while(--_0xebac0c){_0x103ff7['push'](_0x103ff7['shift']());}};_0x5a3986(++_0x5a9dc1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index b64ab01..6f04c5d 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 _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x36b48f,_0x1c8d6d){var _0x454d96=function(_0xaaec3f){while(--_0xaaec3f){_0x36b48f['push'](_0x36b48f['shift']());}};_0x454d96(++_0x1c8d6d);}(_0x2032,0xd9));var _0x2203=function(_0x3715e7,_0x3143d2){_0x3715e7=_0x3715e7-0x0;var _0xbfc598=_0x2032[_0x3715e7];return _0xbfc598;};'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 +var _0x5f66=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x38b2d9,_0x19fd42){var _0x23a3e1=function(_0xd8192f){while(--_0xd8192f){_0x38b2d9['push'](_0x38b2d9['shift']());}};_0x23a3e1(++_0x19fd42);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';function Trigger(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||_0x65f6('0x2');this[_0x65f6('0x3')]=_0x253044[_0x65f6('0x3')]||![];this['AllConditions']=_0x253044[_0x65f6('0x4')]||[];this['AnyConditions']=_0x253044[_0x65f6('0x5')]||[];this[_0x65f6('0x6')]=_0x253044['Actions']||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 70fee96..eafa184 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 _0x5b82=['unknown','stateTime','status','registry','indexOf','host','port','domain','refresh','registrationtime','address','defaultuser','name','state'];(function(_0x21614f,_0x3b7d65){var _0x3554da=function(_0x32a53c){while(--_0x32a53c){_0x21614f['push'](_0x21614f['shift']());}};_0x3554da(++_0x3b7d65);}(_0x5b82,0x140));var _0x25b8=function(_0x40c83d,_0x37b817){_0x40c83d=_0x40c83d-0x0;var _0x38181d=_0x5b82[_0x40c83d];return _0x38181d;};'use strict';function Trunk(_0x215a60){this['id']=_0x215a60['id']||0x0;this['active']=_0x215a60['active']||![];this['name']=_0x215a60[_0x25b8('0x0')]||'';this[_0x25b8('0x1')]=_0x25b8('0x2');this[_0x25b8('0x3')]=0x0;this[_0x25b8('0x4')]=_0x25b8('0x2');this['registry']=_0x215a60[_0x25b8('0x5')]&&_0x215a60[_0x25b8('0x5')][_0x25b8('0x6')](':')?_0x215a60[_0x25b8('0x5')]['split'](':')[0x0]:'';this[_0x25b8('0x7')]='';this[_0x25b8('0x8')]='';this[_0x25b8('0x9')]='';this['domainport']='';this[_0x25b8('0xa')]='';this['stateRegistry']='unknown';this[_0x25b8('0xb')]='';this[_0x25b8('0xc')]='';this[_0x25b8('0xd')]=_0x215a60['defaultuser']||'';}module['exports']=Trunk; \ No newline at end of file +var _0x4035=['stateRegistry','registrationtime','address','defaultuser','exports','name','state','unknown','stateTime','status','registry','indexOf','host','port','domain','domainport','refresh'];(function(_0x5eed92,_0x97240c){var _0x31df38=function(_0x2eb336){while(--_0x2eb336){_0x5eed92['push'](_0x5eed92['shift']());}};_0x31df38(++_0x97240c);}(_0x4035,0x126));var _0x5403=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x4035[_0x37c22c];return _0x119d79;};'use strict';function Trunk(_0x1eb1a7){this['id']=_0x1eb1a7['id']||0x0;this['active']=_0x1eb1a7['active']||![];this[_0x5403('0x0')]=_0x1eb1a7[_0x5403('0x0')]||'';this[_0x5403('0x1')]=_0x5403('0x2');this[_0x5403('0x3')]=0x0;this[_0x5403('0x4')]='unknown';this[_0x5403('0x5')]=_0x1eb1a7[_0x5403('0x5')]&&_0x1eb1a7['registry'][_0x5403('0x6')](':')?_0x1eb1a7[_0x5403('0x5')]['split'](':')[0x0]:'';this[_0x5403('0x7')]='';this[_0x5403('0x8')]='';this[_0x5403('0x9')]='';this[_0x5403('0xa')]='';this[_0x5403('0xb')]='';this[_0x5403('0xc')]='unknown';this[_0x5403('0xd')]='';this[_0x5403('0xe')]='';this[_0x5403('0xf')]=_0x1eb1a7[_0x5403('0xf')]||'';}module[_0x5403('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 c88a53a..041a39d 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 _0xcfcd=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xcfcd,0x169));var _0xdcfc=function(_0x55b4c8,_0x3c1440){_0x55b4c8=_0x55b4c8-0x0;var _0x247ca1=_0xcfcd[_0x55b4c8];return _0x247ca1;};'use strict';function voiceExtension(_0x1762ae){this['id']=_0x1762ae['id']||0x0;this[_0xdcfc('0x0')]=_0x1762ae[_0xdcfc('0x0')]||'';this[_0xdcfc('0x1')]=_0x1762ae[_0xdcfc('0x1')]||_0xdcfc('0x2');this[_0xdcfc('0x3')]=_0x1762ae[_0xdcfc('0x3')]||![];}module[_0xdcfc('0x4')]=voiceExtension; \ No newline at end of file +var _0x0817=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x4a93a2,_0x2327de){var _0xc875b1=function(_0x7263c3){while(--_0x7263c3){_0x4a93a2['push'](_0x4a93a2['shift']());}};_0xc875b1(++_0x2327de);}(_0x0817,0xa8));var _0x7081=function(_0x1cd919,_0x408263){_0x1cd919=_0x1cd919-0x0;var _0x2ea8be=_0x0817[_0x1cd919];return _0x2ea8be;};'use strict';function voiceExtension(_0x2a62d2){this['id']=_0x2a62d2['id']||0x0;this['exten']=_0x2a62d2[_0x7081('0x0')]||'';this[_0x7081('0x1')]=_0x2a62d2[_0x7081('0x1')]||_0x7081('0x2');this['mandatoryDisposition']=_0x2a62d2[_0x7081('0x3')]||![];}module[_0x7081('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index ab92da9..90a1e90 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 _0xc63d=['dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','wav','wav49','gsm','fewestcalls','leastrecent','linear','random','roundrobin','rrmemory','name','monitor_format','type','total','sumDuration','sumHoldTime','sumBillable','abandoned','busy','inUse','notInUse','onHold','paused','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup'];(function(_0x22b39b,_0x2b7d63){var _0x280e1d=function(_0xc74635){while(--_0xc74635){_0x22b39b['push'](_0x22b39b['shift']());}};_0x280e1d(++_0x2b7d63);}(_0xc63d,0xaf));var _0xdc63=function(_0x56a52f,_0x47e091){_0x56a52f=_0x56a52f-0x0;var _0x27329d=_0xc63d[_0x56a52f];return _0x27329d;};'use strict';var monitorFormat={'wav':_0xdc63('0x0'),'wav49':_0xdc63('0x1'),'gsm':_0xdc63('0x2')};var strategy={'fewestcalls':_0xdc63('0x3'),'leastrecent':_0xdc63('0x4'),'linear':_0xdc63('0x5'),'random':_0xdc63('0x6'),'ringall':'ringall','rr':_0xdc63('0x7'),'rrmemory':_0xdc63('0x8'),'rrordered':'rrordered','wrandom':'wrandom'};function VoiceQueue(_0x5dd54b){this['id']=_0x5dd54b['id']||0x0;this[_0xdc63('0x9')]=_0x5dd54b[_0xdc63('0x9')]||'';this['monitor_format']=_0x5dd54b[_0xdc63('0xa')]||'';this[_0xdc63('0xb')]=_0x5dd54b[_0xdc63('0xb')]||'inbound';this['waiting']=0x0;this[_0xdc63('0xc')]=0x0;this['answered']=0x0;this[_0xdc63('0xd')]=0x0;this[_0xdc63('0xe')]=0x0;this[_0xdc63('0xf')]=0x0;this['unmanaged']=0x0;this[_0xdc63('0x10')]=0x0;this['available']=0x0;this[_0xdc63('0x11')]=0x0;this[_0xdc63('0x12')]=0x0;this['invalid']=0x0;this['loggedIn']=0x0;this[_0xdc63('0x13')]=0x0;this[_0xdc63('0x14')]=0x0;this[_0xdc63('0x15')]=0x0;this[_0xdc63('0x16')]=0x0;this[_0xdc63('0x17')]=0x0;this[_0xdc63('0x18')]=0x0;this[_0xdc63('0x19')]=0x0;this[_0xdc63('0x1a')]=0x0;this[_0xdc63('0x1b')]=_0x5dd54b['acw']||![];this[_0xdc63('0x1c')]=_0x5dd54b['acwTimeout']||0xa;this[_0xdc63('0x1d')]=_0x5dd54b[_0xdc63('0x1d')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0xdc63('0x1e')]='';this[_0xdc63('0x1f')]=0x0;this[_0xdc63('0x20')]=0x0;this[_0xdc63('0x21')]=_0x5dd54b[_0xdc63('0x21')]||null;this[_0xdc63('0x22')]=_0x5dd54b[_0xdc63('0x22')]?_0x5dd54b[_0xdc63('0x22')]:null;this[_0xdc63('0x23')]=_0x5dd54b[_0xdc63('0x23')];this[_0xdc63('0x24')]=_0x5dd54b[_0xdc63('0x24')]||_0xdc63('0x25');this[_0xdc63('0x26')]=_0x5dd54b[_0xdc63('0x26')]||0x0;this['dialLimitQueue']=_0x5dd54b[_0xdc63('0x27')]||0x0;this[_0xdc63('0x28')]=_0x5dd54b[_0xdc63('0x28')]||0x1;this[_0xdc63('0x29')]=_0x5dd54b[_0xdc63('0x29')]||_0xdc63('0x2a');this[_0xdc63('0x2b')]=_0x5dd54b[_0xdc63('0x2b')]||0.03;this[_0xdc63('0x2c')]=_0x5dd54b[_0xdc63('0x2c')]||0x258;this[_0xdc63('0x2d')]=_0x5dd54b['dialOriginateCallerIdName']||_0xdc63('0x2e');this['dialOriginateCallerIdNumber']=_0x5dd54b[_0xdc63('0x2f')]||_0xdc63('0x2e');this[_0xdc63('0x30')]=_0x5dd54b['dialOriginateTimeout']||0x1e;this[_0xdc63('0x31')]=_0x5dd54b[_0xdc63('0x31')]||_0xdc63('0x32');this[_0xdc63('0x33')]=_0x5dd54b[_0xdc63('0x33')]||0x3;this[_0xdc63('0x34')]=_0x5dd54b['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x5dd54b[_0xdc63('0x35')]||0x3;this[_0xdc63('0x36')]=_0x5dd54b[_0xdc63('0x36')]||0x96;this[_0xdc63('0x37')]=_0x5dd54b[_0xdc63('0x37')]||0x3;this[_0xdc63('0x38')]=_0x5dd54b[_0xdc63('0x38')]||0x96;this[_0xdc63('0x39')]=_0x5dd54b[_0xdc63('0x39')]||0x3;this['dialNoAnswerRetryFrequency']=_0x5dd54b[_0xdc63('0x3a')]||0x96;this[_0xdc63('0x3b')]=_0x5dd54b[_0xdc63('0x3b')]||0x3;this[_0xdc63('0x3c')]=_0x5dd54b[_0xdc63('0x3c')]||0x96;this['dialDropMaxRetry']=_0x5dd54b[_0xdc63('0x3d')]||0x3;this['dialDropRetryFrequency']=_0x5dd54b[_0xdc63('0x3e')]||0x96;this[_0xdc63('0x3f')]=_0x5dd54b[_0xdc63('0x3f')]||0x3;this[_0xdc63('0x40')]=_0x5dd54b[_0xdc63('0x40')]||0x96;this[_0xdc63('0x41')]=_0x5dd54b[_0xdc63('0x41')]||0x3;this['dialMachineRetryFrequency']=_0x5dd54b[_0xdc63('0x42')]||0x96;this['dialAgentRejectMaxRetry']=_0x5dd54b[_0xdc63('0x43')]||0x3;this['dialAgentRejectRetryFrequency']=_0x5dd54b[_0xdc63('0x44')]||0x96;this['callAdditionalPhoneAfterMin']=_0x5dd54b[_0xdc63('0x45')]||0x3;this[_0xdc63('0x46')]=_0x5dd54b['dialGlobalMaxRetry']||0x4;this[_0xdc63('0x47')]=_0x5dd54b['Trunk']?_0x5dd54b['Trunk']:undefined;this[_0xdc63('0x48')]=_0x5dd54b['TrunkBackup']?_0x5dd54b['TrunkBackup']:undefined;this['dialPrefix']=_0x5dd54b[_0xdc63('0x49')]||undefined;this[_0xdc63('0x4a')]=_0x5dd54b['Interval']?_0x5dd54b[_0xdc63('0x4a')]:undefined;this['dialOrderByScheduledAt']=_0x5dd54b[_0xdc63('0x4b')]||'DESC';this[_0xdc63('0x4c')]=_0x5dd54b[_0xdc63('0x4c')]||undefined;this[_0xdc63('0x4d')]=_0x5dd54b[_0xdc63('0x4d')]||undefined;this['strategy']=strategy[_0x5dd54b['strategy']];this['queueStatusComplete']=!![];this[_0xdc63('0x4e')]=_0x5dd54b['dialAMDActive']||![];this[_0xdc63('0x4f')]=_0x5dd54b[_0xdc63('0x4f')];this[_0xdc63('0x50')]=_0x5dd54b[_0xdc63('0x50')];this[_0xdc63('0x51')]=_0x5dd54b[_0xdc63('0x51')];this['dialAMDTotalAnalysisTime']=_0x5dd54b['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x5dd54b[_0xdc63('0x52')];this[_0xdc63('0x53')]=_0x5dd54b[_0xdc63('0x53')];this[_0xdc63('0x54')]=_0x5dd54b[_0xdc63('0x54')];this[_0xdc63('0x55')]=_0x5dd54b['dialAMDSilenceThreshold'];this[_0xdc63('0x56')]=_0x5dd54b[_0xdc63('0x56')];this['outboundRejectCallsDay']=0x0;this[_0xdc63('0x57')]=0x0;this['timeout']=_0x5dd54b['timeout'];this[_0xdc63('0x58')]=0x0;this[_0xdc63('0x59')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this[_0xdc63('0x5a')]=0x0;this[_0xdc63('0x5b')]=0x0;this[_0xdc63('0x5c')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xdc63('0x5d')]=0x0;this[_0xdc63('0x5e')]=0x0;this[_0xdc63('0x5f')]=0x0;this[_0xdc63('0x60')]=0x0;this[_0xdc63('0x61')]=0x0;this[_0xdc63('0x62')]=0x0;this[_0xdc63('0x63')]=undefined;this[_0xdc63('0x64')]=undefined;this['handlePredictive']=undefined;this[_0xdc63('0x65')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xdc63('0x66')]=0x0;this[_0xdc63('0x67')]=0x0;this[_0xdc63('0x68')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xdc63('0x69')]=0x0;this[_0xdc63('0x6a')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xdc63('0x6b')]=_0x5dd54b[_0xdc63('0x6c')]||0x14;this[_0xdc63('0x6d')]=_0x5dd54b[_0xdc63('0x6c')]||0xa;this[_0xdc63('0x6e')]=0x0;this[_0xdc63('0x6f')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xdc63('0x70')]=0x0;this['erlangCallToSecond']=0x0;this['erlangAbandonmentRate']=0x0;this[_0xdc63('0x71')]=0x0;this['dialRecallMeTimeout']=_0x5dd54b[_0xdc63('0x72')]||0x1e;this['dialRecallInQueue']=_0x5dd54b[_0xdc63('0x73')]||![];this[_0xdc63('0x74')]=!!_0x5dd54b[_0xdc63('0x74')]||![];this[_0xdc63('0x75')]=!!_0x5dd54b[_0xdc63('0x75')]||![];this[_0xdc63('0x76')]=_0x5dd54b[_0xdc63('0x76')]||undefined;this[_0xdc63('0x77')]=_0x5dd54b[_0xdc63('0x77')]||![];this[_0xdc63('0x78')]=_0x5dd54b[_0xdc63('0x78')]||![];this[_0xdc63('0xa')]=monitorFormat[_0x5dd54b[_0xdc63('0xa')]]?monitorFormat[_0x5dd54b[_0xdc63('0xa')]]:undefined;this['mandatoryDisposition']=_0x5dd54b[_0xdc63('0x79')]||![];this[_0xdc63('0x7a')]=_0x5dd54b[_0xdc63('0x7a')]?_0x5dd54b[_0xdc63('0x7a')]:undefined;this['queueSummaryCountersUpdated']=![];}module[_0xdc63('0x7b')]=VoiceQueue; \ No newline at end of file +var _0x8cc3=['roundrobin','rrmemory','rrordered','name','monitor_format','type','inbound','waiting','total','answered','sumHoldTime','unmanaged','abandoned','available','busy','inUse','invalid','loggedIn','notInUse','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialCutDigit','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','wav','wav49','gsm','leastrecent','random','ringall'];(function(_0x4c7a16,_0x55d676){var _0x25d1d4=function(_0x5724ce){while(--_0x5724ce){_0x4c7a16['push'](_0x4c7a16['shift']());}};_0x25d1d4(++_0x55d676);}(_0x8cc3,0x7a));var _0x38cc=function(_0x2612be,_0xd5c8dc){_0x2612be=_0x2612be-0x0;var _0x28c2c5=_0x8cc3[_0x2612be];return _0x28c2c5;};'use strict';var monitorFormat={'wav':_0x38cc('0x0'),'wav49':_0x38cc('0x1'),'gsm':_0x38cc('0x2')};var strategy={'fewestcalls':'fewestcalls','leastrecent':_0x38cc('0x3'),'linear':'linear','random':_0x38cc('0x4'),'ringall':_0x38cc('0x5'),'rr':_0x38cc('0x6'),'rrmemory':_0x38cc('0x7'),'rrordered':_0x38cc('0x8'),'wrandom':'wrandom'};function VoiceQueue(_0xb4f29){this['id']=_0xb4f29['id']||0x0;this[_0x38cc('0x9')]=_0xb4f29[_0x38cc('0x9')]||'';this['monitor_format']=_0xb4f29[_0x38cc('0xa')]||'';this[_0x38cc('0xb')]=_0xb4f29[_0x38cc('0xb')]||_0x38cc('0xc');this[_0x38cc('0xd')]=0x0;this[_0x38cc('0xe')]=0x0;this[_0x38cc('0xf')]=0x0;this['sumDuration']=0x0;this[_0x38cc('0x10')]=0x0;this['sumBillable']=0x0;this[_0x38cc('0x11')]=0x0;this[_0x38cc('0x12')]=0x0;this[_0x38cc('0x13')]=0x0;this[_0x38cc('0x14')]=0x0;this[_0x38cc('0x15')]=0x0;this[_0x38cc('0x16')]=0x0;this[_0x38cc('0x17')]=0x0;this[_0x38cc('0x18')]=0x0;this['onHold']=0x0;this['paused']=0x0;this[_0x38cc('0x19')]=0x0;this[_0x38cc('0x1a')]=0x0;this[_0x38cc('0x1b')]=0x0;this[_0x38cc('0x1c')]=0x0;this[_0x38cc('0x1d')]=0x0;this[_0x38cc('0x1e')]=_0xb4f29[_0x38cc('0x1e')]||![];this[_0x38cc('0x1f')]=_0xb4f29['acwTimeout']||0xa;this[_0x38cc('0x20')]=_0xb4f29[_0x38cc('0x20')]||'no';this[_0x38cc('0x21')]=!![];this[_0x38cc('0x22')]='';this[_0x38cc('0x23')]='';this[_0x38cc('0x24')]=0x0;this['temp']=0x0;this[_0x38cc('0x25')]=_0xb4f29[_0x38cc('0x25')]||null;this[_0x38cc('0x26')]=_0xb4f29[_0x38cc('0x26')]?_0xb4f29[_0x38cc('0x26')]:null;this['dialActive']=_0xb4f29[_0x38cc('0x27')];this['dialMethod']=_0xb4f29[_0x38cc('0x28')]||_0x38cc('0x29');this['dialLimitChannel']=_0xb4f29[_0x38cc('0x2a')]||0x0;this[_0x38cc('0x2b')]=_0xb4f29[_0x38cc('0x2b')]||0x0;this[_0x38cc('0x2c')]=_0xb4f29[_0x38cc('0x2c')]||0x1;this[_0x38cc('0x2d')]=_0xb4f29[_0x38cc('0x2d')]||_0x38cc('0x2e');this['dialPredictiveOptimizationPercentage']=_0xb4f29[_0x38cc('0x2f')]||0.03;this[_0x38cc('0x30')]=_0xb4f29[_0x38cc('0x30')]||0x258;this[_0x38cc('0x31')]=_0xb4f29['dialOriginateCallerIdName']||_0x38cc('0x32');this[_0x38cc('0x33')]=_0xb4f29[_0x38cc('0x33')]||_0x38cc('0x32');this['dialOriginateTimeout']=_0xb4f29[_0x38cc('0x34')]||0x1e;this['dialQueueOptions']=_0xb4f29[_0x38cc('0x35')]||'tTxX';this[_0x38cc('0x36')]=_0xb4f29[_0x38cc('0x36')]||0x3;this[_0x38cc('0x37')]=_0xb4f29[_0x38cc('0x37')]||undefined;this['dialCongestionMaxRetry']=_0xb4f29['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0xb4f29[_0x38cc('0x38')]||0x96;this[_0x38cc('0x39')]=_0xb4f29[_0x38cc('0x39')]||0x3;this[_0x38cc('0x3a')]=_0xb4f29[_0x38cc('0x3a')]||0x96;this[_0x38cc('0x3b')]=_0xb4f29['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0xb4f29[_0x38cc('0x3c')]||0x96;this[_0x38cc('0x3d')]=_0xb4f29[_0x38cc('0x3d')]||0x3;this[_0x38cc('0x3e')]=_0xb4f29['dialNoSuchNumberRetryFrequency']||0x96;this[_0x38cc('0x3f')]=_0xb4f29[_0x38cc('0x3f')]||0x3;this['dialDropRetryFrequency']=_0xb4f29[_0x38cc('0x40')]||0x96;this[_0x38cc('0x41')]=_0xb4f29['dialAbandonedMaxRetry']||0x3;this[_0x38cc('0x42')]=_0xb4f29['dialAbandonedRetryFrequency']||0x96;this[_0x38cc('0x43')]=_0xb4f29[_0x38cc('0x43')]||0x3;this[_0x38cc('0x44')]=_0xb4f29[_0x38cc('0x44')]||0x96;this['dialAgentRejectMaxRetry']=_0xb4f29['dialAgentRejectMaxRetry']||0x3;this[_0x38cc('0x45')]=_0xb4f29[_0x38cc('0x45')]||0x96;this[_0x38cc('0x46')]=_0xb4f29[_0x38cc('0x46')]||0x3;this[_0x38cc('0x47')]=_0xb4f29[_0x38cc('0x47')]||0x4;this[_0x38cc('0x48')]=_0xb4f29[_0x38cc('0x48')]?_0xb4f29[_0x38cc('0x48')]:undefined;this[_0x38cc('0x49')]=_0xb4f29['TrunkBackup']?_0xb4f29[_0x38cc('0x49')]:undefined;this[_0x38cc('0x4a')]=_0xb4f29[_0x38cc('0x4a')]||undefined;this[_0x38cc('0x4b')]=_0xb4f29[_0x38cc('0x4b')]?_0xb4f29[_0x38cc('0x4b')]:undefined;this['dialOrderByScheduledAt']=_0xb4f29[_0x38cc('0x4c')]||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0xb4f29['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x38cc('0x4d')]=_0xb4f29[_0x38cc('0x4d')]||undefined;this['strategy']=strategy[_0xb4f29['strategy']];this[_0x38cc('0x4e')]=!![];this[_0x38cc('0x4f')]=_0xb4f29[_0x38cc('0x4f')]||![];this[_0x38cc('0x50')]=_0xb4f29[_0x38cc('0x50')];this[_0x38cc('0x51')]=_0xb4f29[_0x38cc('0x51')];this[_0x38cc('0x52')]=_0xb4f29['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0xb4f29['dialAMDTotalAnalysisTime'];this[_0x38cc('0x53')]=_0xb4f29[_0x38cc('0x53')];this[_0x38cc('0x54')]=_0xb4f29[_0x38cc('0x54')];this[_0x38cc('0x55')]=_0xb4f29['dialAMDMaximumNumberOfWords'];this[_0x38cc('0x56')]=_0xb4f29[_0x38cc('0x56')];this['dialAMDMaximumWordLength']=_0xb4f29[_0x38cc('0x57')];this[_0x38cc('0x58')]=0x0;this[_0x38cc('0x59')]=0x0;this[_0x38cc('0x5a')]=_0xb4f29[_0x38cc('0x5a')];this[_0x38cc('0x5b')]=0x0;this[_0x38cc('0x5c')]=0x0;this[_0x38cc('0x5d')]=0x0;this[_0x38cc('0x5e')]=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x38cc('0x5f')]=0x0;this[_0x38cc('0x60')]=0x0;this[_0x38cc('0x61')]=0x0;this[_0x38cc('0x62')]=0x0;this[_0x38cc('0x63')]=0x0;this[_0x38cc('0x64')]=0x0;this['outboundReCallsDay']=0x0;this[_0x38cc('0x65')]=0x0;this[_0x38cc('0x66')]=undefined;this['startPredictive']=undefined;this[_0x38cc('0x67')]=undefined;this[_0x38cc('0x68')]=1.05;this[_0x38cc('0x69')]=0x0;this[_0x38cc('0x6a')]=0x0;this[_0x38cc('0x6b')]=0x0;this[_0x38cc('0x6c')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x38cc('0x6d')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x38cc('0x6e')]=0x0;this[_0x38cc('0x6f')]=_0xb4f29[_0x38cc('0x70')]||0x14;this[_0x38cc('0x71')]=_0xb4f29[_0x38cc('0x70')]||0xa;this[_0x38cc('0x72')]=0x0;this[_0x38cc('0x73')]=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this[_0x38cc('0x74')]=0x0;this[_0x38cc('0x75')]=0x0;this[_0x38cc('0x76')]=_0xb4f29[_0x38cc('0x76')]||0x1e;this[_0x38cc('0x77')]=_0xb4f29[_0x38cc('0x77')]||![];this[_0x38cc('0x78')]=!!_0xb4f29['dialPreviewAutoRecallMe']||![];this[_0x38cc('0x79')]=!!_0xb4f29[_0x38cc('0x79')]||![];this['dialQueueProject2']=_0xb4f29[_0x38cc('0x7a')]||undefined;this[_0x38cc('0x7b')]=_0xb4f29[_0x38cc('0x7b')]||![];this[_0x38cc('0x7c')]=_0xb4f29[_0x38cc('0x7c')]||![];this[_0x38cc('0xa')]=monitorFormat[_0xb4f29[_0x38cc('0xa')]]?monitorFormat[_0xb4f29[_0x38cc('0xa')]]:undefined;this[_0x38cc('0x7d')]=_0xb4f29['mandatoryDisposition']||![];this[_0x38cc('0x7e')]=_0xb4f29[_0x38cc('0x7e')]?_0xb4f29[_0x38cc('0x7e')]:undefined;this['queueSummaryCountersUpdated']=![];}module[_0x38cc('0x7f')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index bea6ca0..ecd3e1a 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac4f=['callers','length','online','incall','includes','status','keys','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','outboundAbandonedCallsDay','preview','exports','available','loggedInDb','ringing','answered','loggedIn','originated','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','paused','pTalking','talking','sumBillable','sumDuration','total','waiting','name','strategy','abandoned','busy','inUse','invalid','onHold','notInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','ringInUse','loggedin'];(function(_0x109ecb,_0x597118){var _0x13422b=function(_0x14c3e3){while(--_0x14c3e3){_0x109ecb['push'](_0x109ecb['shift']());}};_0x13422b(++_0x597118);}(_0xac4f,0x122));var _0xfac4=function(_0x5d84d6,_0x1a4671){_0x5d84d6=_0x5d84d6-0x0;var _0x2cd0f5=_0xac4f[_0x5d84d6];return _0x2cd0f5;};'use strict';var INBOUND_COUNTERS=[_0xfac4('0x0'),'loggedIn',_0xfac4('0x1'),'paused',_0xfac4('0x2'),'talking','waiting'];var OUTBOUND_COUNTERS=[_0xfac4('0x0'),_0xfac4('0x3'),'inUse',_0xfac4('0x4'),_0xfac4('0x1'),_0xfac4('0x5'),'outboundAbandonedCallsDay',_0xfac4('0x6'),_0xfac4('0x7'),_0xfac4('0x8'),_0xfac4('0x9'),_0xfac4('0xa'),_0xfac4('0xb'),'outboundReCallsDay',_0xfac4('0xc'),_0xfac4('0xd'),_0xfac4('0xe'),_0xfac4('0xf'),_0xfac4('0x10'),_0xfac4('0x11'),_0xfac4('0x12'),_0xfac4('0x13'),_0xfac4('0x14')];function VoiceQueueSummary(_0x2ebb02){this['id']=_0x2ebb02['id'];this[_0xfac4('0x15')]=_0x2ebb02[_0xfac4('0x15')];this['strategy']=_0x2ebb02[_0xfac4('0x16')];this['abandoned']=_0x2ebb02[_0xfac4('0x17')]||0x0;this[_0xfac4('0x3')]=_0x2ebb02[_0xfac4('0x3')]||0x0;this[_0xfac4('0x0')]=_0x2ebb02[_0xfac4('0x0')]||0x0;this[_0xfac4('0x18')]=_0x2ebb02[_0xfac4('0x18')]||0x0;this[_0xfac4('0x19')]=_0x2ebb02['inUse']||0x0;this[_0xfac4('0x1a')]=_0x2ebb02[_0xfac4('0x1a')]||0x0;this[_0xfac4('0x4')]=_0x2ebb02[_0xfac4('0x4')]||0x0;this[_0xfac4('0x1')]=_0x2ebb02[_0xfac4('0x1')]||0x0;this[_0xfac4('0x1b')]=_0x2ebb02[_0xfac4('0x1b')]||0x0;this[_0xfac4('0x1c')]=_0x2ebb02['notInUse']||0x0;this['paused']=_0x2ebb02['paused']||0x0;this[_0xfac4('0x2')]=_0x2ebb02[_0xfac4('0x2')]||0x0;this['ringInUse']=_0x2ebb02['ringInUse'];this['sumBillable']=_0x2ebb02[_0xfac4('0x11')];this[_0xfac4('0x12')]=_0x2ebb02['sumDuration'];this[_0xfac4('0x1d')]=_0x2ebb02[_0xfac4('0x1d')]||0x0;this[_0xfac4('0x10')]=_0x2ebb02[_0xfac4('0x10')]||0x0;this[_0xfac4('0x13')]=_0x2ebb02[_0xfac4('0x13')]||0x0;this[_0xfac4('0x1e')]=_0x2ebb02[_0xfac4('0x1e')];this[_0xfac4('0x1f')]=_0x2ebb02[_0xfac4('0x1f')]||0x0;this[_0xfac4('0x20')]=_0x2ebb02['unknown']||0x0;this[_0xfac4('0x21')]=_0x2ebb02[_0xfac4('0x21')]||0x0;this['waiting']=_0x2ebb02[_0xfac4('0x14')]||0x0;if(_0x2ebb02[_0xfac4('0x1e')]===_0xfac4('0x22')){this['pTalking']=_0x2ebb02[_0xfac4('0xf')]||0x0;this[_0xfac4('0x23')]=_0x2ebb02['dialActive'];this[_0xfac4('0x24')]=_0x2ebb02[_0xfac4('0x24')];this[_0xfac4('0x25')]=_0x2ebb02[_0xfac4('0x25')];this[_0xfac4('0x26')]=_0x2ebb02['dialOriginateCallerIdNumber'];this[_0xfac4('0x27')]=_0x2ebb02['dialOriginateTimeout'];this[_0xfac4('0x28')]=_0x2ebb02[_0xfac4('0x28')];this['temp']=_0x2ebb02[_0xfac4('0x29')];this['outboundAnswerAgiCallsDay']=_0x2ebb02[_0xfac4('0x2a')];this['outboundAnswerCallsDay']=_0x2ebb02['outboundAnswerCallsDay'];this[_0xfac4('0x7')]=_0x2ebb02['outboundBlacklistCallsDay'];this[_0xfac4('0x8')]=_0x2ebb02[_0xfac4('0x8')];this['outboundCongestionCallsDay']=_0x2ebb02['outboundCongestionCallsDay'];this[_0xfac4('0x2b')]=_0x2ebb02['outboundDropCallsDayACS'];this[_0xfac4('0x2c')]=_0x2ebb02[_0xfac4('0x2c')];this[_0xfac4('0x2d')]=_0x2ebb02[_0xfac4('0x2d')];this[_0xfac4('0xa')]=_0x2ebb02[_0xfac4('0xa')];this['outboundNoSuchCallsDay']=_0x2ebb02['outboundNoSuchCallsDay'];this[_0xfac4('0x2e')]=_0x2ebb02[_0xfac4('0x2e')];this[_0xfac4('0x2f')]=_0x2ebb02[_0xfac4('0x2f')];this[_0xfac4('0xc')]=_0x2ebb02[_0xfac4('0xc')];this[_0xfac4('0xd')]=_0x2ebb02[_0xfac4('0xd')];this[_0xfac4('0x30')]=_0x2ebb02[_0xfac4('0x30')];this['predictiveIntervalAvgHoldtime']=_0x2ebb02['predictiveIntervalAvgHoldtime'];this[_0xfac4('0x31')]=_0x2ebb02[_0xfac4('0x31')];this[_0xfac4('0x32')]=_0x2ebb02[_0xfac4('0x32')];this[_0xfac4('0x33')]=_0x2ebb02[_0xfac4('0x33')];this[_0xfac4('0x34')]=_0x2ebb02[_0xfac4('0x34')];this[_0xfac4('0x35')]=_0x2ebb02[_0xfac4('0x35')];this[_0xfac4('0x36')]=_0x2ebb02[_0xfac4('0x36')];this['predictiveIntervalMultiplicativeFactor']=_0x2ebb02[_0xfac4('0x37')];this[_0xfac4('0x38')]=_0x2ebb02[_0xfac4('0x38')];this[_0xfac4('0x39')]=_0x2ebb02[_0xfac4('0x39')];this[_0xfac4('0x3a')]=_0x2ebb02['predictiveIntervalTotalCalls'];this['originated']=_0x2ebb02[_0xfac4('0x5')];this[_0xfac4('0x3b')]=_0x2ebb02[_0xfac4('0x3b')];this['erlangCallToSecond']=_0x2ebb02[_0xfac4('0x3c')];this[_0xfac4('0x3d')]=_0x2ebb02[_0xfac4('0x3d')];this[_0xfac4('0x3e')]=_0x2ebb02[_0xfac4('0x3e')];this['startPredictive']=_0x2ebb02[_0xfac4('0x3f')];this[_0xfac4('0x40')]=_0x2ebb02[_0xfac4('0x40')];this[_0xfac4('0x41')]=_0x2ebb02[_0xfac4('0x41')];this[_0xfac4('0x42')]=_0x2ebb02[_0xfac4('0x42')];}if(_0x2ebb02[_0xfac4('0x43')]){this['Trunk']={'id':_0x2ebb02[_0xfac4('0x43')]['id'],'name':_0x2ebb02[_0xfac4('0x43')][_0xfac4('0x15')],'active':_0x2ebb02[_0xfac4('0x43')][_0xfac4('0x44')],'callerid':_0x2ebb02[_0xfac4('0x43')][_0xfac4('0x45')]};}}VoiceQueueSummary[_0xfac4('0x46')][_0xfac4('0x47')]=function(_0x1a9aee,_0x4127c6,_0x27847f,_0x288831){this[_0xfac4('0x1')]=0x0;this[_0xfac4('0x10')]=0x0;this['paused']=0x0;this['unknown']=0x0;this['notInUse']=0x0;this[_0xfac4('0x19')]=0x0;this[_0xfac4('0x18')]=0x0;this[_0xfac4('0x1a')]=0x0;this[_0xfac4('0x1f')]=0x0;this[_0xfac4('0x2')]=0x0;this[_0xfac4('0x48')]=0x0;this['onHold']=0x0;if(_0x27847f){if(_0x27847f['available']){this['available']=Number(_0x27847f[_0xfac4('0x0')]);}if(_0x27847f['loggedin']){this[_0xfac4('0x4')]=Number(_0x27847f[_0xfac4('0x49')]);}if(_0x27847f[_0xfac4('0x4a')]){this[_0xfac4('0x14')]=Number(_0x27847f[_0xfac4('0x4a')]);}}for(var _0x12aeff=0x0;_0x12aeff<_0x1a9aee[_0xfac4('0x4b')];_0x12aeff++){var _0x2c751f=_0x4127c6['SIP/'+_0x1a9aee[_0x12aeff][_0xfac4('0x15')]];if(_0x2c751f&&_0x2c751f[_0xfac4('0x4c')]){this['loggedInDb']+=0x1;}if(_0x1a9aee[_0x12aeff][_0xfac4('0x4d')]==='1'){this['talking']+=0x1;}if(_0x1a9aee[_0x12aeff][_0xfac4('0xe')]==='1'&&!['2','7','8'][_0xfac4('0x4e')](_0x1a9aee[_0x12aeff][_0xfac4('0x4f')])){this[_0xfac4('0xe')]+=0x1;}switch(_0x1a9aee[_0x12aeff][_0xfac4('0x4f')]){case'0':this[_0xfac4('0x20')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0xfac4('0x19')]+=0x1;break;case'3':this[_0xfac4('0x18')]+=0x1;break;case'4':this[_0xfac4('0x1a')]+=0x1;break;case'5':this[_0xfac4('0x1f')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0xfac4('0x48')]+=0x1;break;case'8':this[_0xfac4('0x1b')]+=0x1;break;}}if(this[_0xfac4('0x24')]==='booked'){var _0x4337ab=Object[_0xfac4('0x50')](_0x288831);for(var _0x32c735=0x0;_0x32c735<_0x4337ab[_0xfac4('0x4b')];_0x32c735++){var _0x594b99=_0x4337ab[_0x32c735];var _0x12afb6=_0x288831[_0x594b99];if(_0x12afb6['queue']===this[_0xfac4('0x15')]&&_0x12afb6['type']===_0xfac4('0x51')&&_0x12afb6[_0xfac4('0x52')]===_0xfac4('0x53')){this[_0xfac4('0x10')]+=0x1;}}if(this['talking']>this[_0xfac4('0x19')]){this['talking']=this['inUse'];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0xfac4('0x46')][_0xfac4('0x54')]=function(_0x248420){var _0x17116a=![];if(_0x248420){_0x17116a=INBOUND_COUNTERS[_0xfac4('0x55')](function(_0x357779){return this[_0x357779]!==_0x248420[_0x357779];},this);}return _0x17116a;};VoiceQueueSummary[_0xfac4('0x46')][_0xfac4('0x56')]=function(_0x1db04a){var _0x47b525=![];var _0x1c726d=![];var _0x41814e=![];if(_0x1db04a){_0x47b525=this[_0xfac4('0x24')]!==_0x1db04a[_0xfac4('0x24')]||this['dialActive']!==_0x1db04a[_0xfac4('0x23')]||this[_0xfac4('0x41')]!==_0x1db04a[_0xfac4('0x41')]||this[_0xfac4('0x42')]!==_0x1db04a['statusMessage'];_0x1c726d=OUTBOUND_COUNTERS[_0xfac4('0x55')](function(_0x53eefd){return this[_0x53eefd]!==_0x1db04a[_0x53eefd];},this);if(this[_0xfac4('0x43')]&&_0x1db04a[_0xfac4('0x43')]){_0x41814e=this[_0xfac4('0x43')]['name']!==_0x1db04a[_0xfac4('0x43')][_0xfac4('0x15')]||this[_0xfac4('0x43')][_0xfac4('0x44')]!==_0x1db04a[_0xfac4('0x43')][_0xfac4('0x44')];}}return _0x47b525||_0x1c726d||_0x41814e;};VoiceQueueSummary['prototype'][_0xfac4('0x57')]=function(_0x9c4efb){this[_0xfac4('0x3')]=_0x9c4efb[_0xfac4('0x3')];this[_0xfac4('0x41')]=_0x9c4efb[_0xfac4('0x41')];this[_0xfac4('0x42')]=_0x9c4efb['statusMessage'];this['originated']=_0x9c4efb[_0xfac4('0x5')];this[_0xfac4('0x58')]=_0x9c4efb[_0xfac4('0x58')];this['outboundAnswerCallsDay']=_0x9c4efb[_0xfac4('0x6')];this[_0xfac4('0x7')]=_0x9c4efb[_0xfac4('0x7')];this['outboundBusyCallsDay']=_0x9c4efb['outboundBusyCallsDay'];this[_0xfac4('0x9')]=_0x9c4efb[_0xfac4('0x9')];this[_0xfac4('0xa')]=_0x9c4efb[_0xfac4('0xa')];this['outboundNoSuchCallsDay']=_0x9c4efb[_0xfac4('0xb')];this[_0xfac4('0x2f')]=_0x9c4efb[_0xfac4('0x2f')];this[_0xfac4('0xc')]=_0x9c4efb['outboundRejectCallsDay'];this[_0xfac4('0xd')]=_0x9c4efb[_0xfac4('0xd')];this[_0xfac4('0x11')]=_0x9c4efb[_0xfac4('0x11')];this[_0xfac4('0x12')]=_0x9c4efb['sumDuration'];this['total']=_0x9c4efb['total'];if(this[_0xfac4('0x24')]===_0xfac4('0x59')){this[_0xfac4('0xf')]=_0x9c4efb[_0xfac4('0xf')];}};module[_0xfac4('0x5a')]=VoiceQueueSummary; \ No newline at end of file +var _0x8efc=['unavailable','unknown','unmanaged','outbound','pTalking','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','temp','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','message','statusMessage','Trunk','active','callerid','loggedin','callers','length','SIP/','online','includes','status','keys','queue','dialer','xcally-motion-preview','prototype','compareToInboundQueue','compareToOutboundQueue','dialActive','outboundNoSuchCallsDay','preview','exports','loggedInDb','ringing','waiting','available','loggedIn','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','paused','sumDuration','total','name','strategy','abandoned','answered','busy','inUse','invalid','onHold','notInUse','ringInUse','sumBillable','sumHoldTime','talking','type'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x8efc,0x8f));var _0xc8ef=function(_0x2fe689,_0x5794e5){_0x2fe689=_0x2fe689-0x0;var _0x35ea44=_0x8efc[_0x2fe689];return _0x35ea44;};'use strict';var INBOUND_COUNTERS=['available','loggedIn',_0xc8ef('0x0'),'paused',_0xc8ef('0x1'),'talking',_0xc8ef('0x2')];var OUTBOUND_COUNTERS=[_0xc8ef('0x3'),'answered','inUse',_0xc8ef('0x4'),'loggedInDb',_0xc8ef('0x5'),_0xc8ef('0x6'),_0xc8ef('0x7'),_0xc8ef('0x8'),_0xc8ef('0x9'),'outboundCongestionCallsDay',_0xc8ef('0xa'),'outboundNoSuchCallsDay',_0xc8ef('0xb'),_0xc8ef('0xc'),_0xc8ef('0xd'),_0xc8ef('0xe'),'pTalking','talking','sumBillable',_0xc8ef('0xf'),_0xc8ef('0x10'),_0xc8ef('0x2')];function VoiceQueueSummary(_0x3518cd){this['id']=_0x3518cd['id'];this['name']=_0x3518cd[_0xc8ef('0x11')];this[_0xc8ef('0x12')]=_0x3518cd[_0xc8ef('0x12')];this[_0xc8ef('0x13')]=_0x3518cd[_0xc8ef('0x13')]||0x0;this[_0xc8ef('0x14')]=_0x3518cd[_0xc8ef('0x14')]||0x0;this[_0xc8ef('0x3')]=_0x3518cd['available']||0x0;this['busy']=_0x3518cd[_0xc8ef('0x15')]||0x0;this[_0xc8ef('0x16')]=_0x3518cd[_0xc8ef('0x16')]||0x0;this[_0xc8ef('0x17')]=_0x3518cd[_0xc8ef('0x17')]||0x0;this[_0xc8ef('0x4')]=_0x3518cd[_0xc8ef('0x4')]||0x0;this[_0xc8ef('0x0')]=_0x3518cd['loggedInDb']||0x0;this['onHold']=_0x3518cd[_0xc8ef('0x18')]||0x0;this[_0xc8ef('0x19')]=_0x3518cd[_0xc8ef('0x19')]||0x0;this[_0xc8ef('0xe')]=_0x3518cd['paused']||0x0;this['ringing']=_0x3518cd['ringing']||0x0;this['ringInUse']=_0x3518cd[_0xc8ef('0x1a')];this['sumBillable']=_0x3518cd[_0xc8ef('0x1b')];this[_0xc8ef('0xf')]=_0x3518cd[_0xc8ef('0xf')];this['sumHoldTime']=_0x3518cd[_0xc8ef('0x1c')]||0x0;this[_0xc8ef('0x1d')]=_0x3518cd[_0xc8ef('0x1d')]||0x0;this[_0xc8ef('0x10')]=_0x3518cd[_0xc8ef('0x10')]||0x0;this[_0xc8ef('0x1e')]=_0x3518cd[_0xc8ef('0x1e')];this[_0xc8ef('0x1f')]=_0x3518cd[_0xc8ef('0x1f')]||0x0;this[_0xc8ef('0x20')]=_0x3518cd[_0xc8ef('0x20')]||0x0;this[_0xc8ef('0x21')]=_0x3518cd['unmanaged']||0x0;this['waiting']=_0x3518cd[_0xc8ef('0x2')]||0x0;if(_0x3518cd[_0xc8ef('0x1e')]===_0xc8ef('0x22')){this[_0xc8ef('0x23')]=_0x3518cd[_0xc8ef('0x23')]||0x0;this['dialActive']=_0x3518cd['dialActive'];this[_0xc8ef('0x24')]=_0x3518cd[_0xc8ef('0x24')];this[_0xc8ef('0x25')]=_0x3518cd['dialOriginateCallerIdName'];this[_0xc8ef('0x26')]=_0x3518cd[_0xc8ef('0x26')];this[_0xc8ef('0x27')]=_0x3518cd[_0xc8ef('0x27')];this['dialPrefix']=_0x3518cd['dialPrefix'];this[_0xc8ef('0x28')]=_0x3518cd[_0xc8ef('0x28')];this[_0xc8ef('0x29')]=_0x3518cd['outboundAnswerAgiCallsDay'];this[_0xc8ef('0x7')]=_0x3518cd[_0xc8ef('0x7')];this[_0xc8ef('0x8')]=_0x3518cd['outboundBlacklistCallsDay'];this[_0xc8ef('0x9')]=_0x3518cd[_0xc8ef('0x9')];this[_0xc8ef('0x2a')]=_0x3518cd[_0xc8ef('0x2a')];this[_0xc8ef('0x2b')]=_0x3518cd['outboundDropCallsDayACS'];this[_0xc8ef('0x2c')]=_0x3518cd['outboundDropCallsDayCallersExit'];this['outboundDropCallsDayTimeout']=_0x3518cd[_0xc8ef('0x2d')];this['outboundNoAnswerCallsDay']=_0x3518cd[_0xc8ef('0xa')];this['outboundNoSuchCallsDay']=_0x3518cd['outboundNoSuchCallsDay'];this[_0xc8ef('0x2e')]=_0x3518cd[_0xc8ef('0x2e')];this[_0xc8ef('0xb')]=_0x3518cd[_0xc8ef('0xb')];this[_0xc8ef('0xc')]=_0x3518cd[_0xc8ef('0xc')];this['outboundUnknownCallsDay']=_0x3518cd[_0xc8ef('0xd')];this[_0xc8ef('0x2f')]=_0x3518cd['predictiveIntervalAnsweredCalls'];this[_0xc8ef('0x30')]=_0x3518cd['predictiveIntervalAvgHoldtime'];this['predictiveIntervalAvgTalktime']=_0x3518cd[_0xc8ef('0x31')];this[_0xc8ef('0x32')]=_0x3518cd[_0xc8ef('0x32')];this[_0xc8ef('0x33')]=_0x3518cd['predictiveIntervalDroppedCallsTimeout'];this[_0xc8ef('0x34')]=_0x3518cd[_0xc8ef('0x34')];this[_0xc8ef('0x35')]=_0x3518cd[_0xc8ef('0x35')];this[_0xc8ef('0x36')]=_0x3518cd[_0xc8ef('0x36')];this[_0xc8ef('0x37')]=_0x3518cd['predictiveIntervalMultiplicativeFactor'];this[_0xc8ef('0x38')]=_0x3518cd['predictiveIntervalPauses'];this['predictiveIntervalAvailable']=_0x3518cd[_0xc8ef('0x39')];this[_0xc8ef('0x3a')]=_0x3518cd[_0xc8ef('0x3a')];this[_0xc8ef('0x5')]=_0x3518cd[_0xc8ef('0x5')];this[_0xc8ef('0x3b')]=_0x3518cd[_0xc8ef('0x3b')];this[_0xc8ef('0x3c')]=_0x3518cd[_0xc8ef('0x3c')];this[_0xc8ef('0x3d')]=_0x3518cd[_0xc8ef('0x3d')];this[_0xc8ef('0x3e')]=_0x3518cd[_0xc8ef('0x3e')];this['startPredictive']=_0x3518cd['startPredictive'];this[_0xc8ef('0x3f')]=_0x3518cd[_0xc8ef('0x3f')];this[_0xc8ef('0x40')]=_0x3518cd[_0xc8ef('0x40')];this[_0xc8ef('0x41')]=_0x3518cd['statusMessage'];}if(_0x3518cd[_0xc8ef('0x42')]){this[_0xc8ef('0x42')]={'id':_0x3518cd['Trunk']['id'],'name':_0x3518cd[_0xc8ef('0x42')][_0xc8ef('0x11')],'active':_0x3518cd[_0xc8ef('0x42')][_0xc8ef('0x43')],'callerid':_0x3518cd[_0xc8ef('0x42')][_0xc8ef('0x44')]};}}VoiceQueueSummary['prototype']['createReport']=function(_0x23d924,_0x4698f6,_0x14fdc8,_0x1d59b1){this['loggedInDb']=0x0;this[_0xc8ef('0x1d')]=0x0;this[_0xc8ef('0xe')]=0x0;this['unknown']=0x0;this[_0xc8ef('0x19')]=0x0;this[_0xc8ef('0x16')]=0x0;this[_0xc8ef('0x15')]=0x0;this[_0xc8ef('0x17')]=0x0;this['unavailable']=0x0;this[_0xc8ef('0x1')]=0x0;this[_0xc8ef('0x1a')]=0x0;this[_0xc8ef('0x18')]=0x0;if(_0x14fdc8){if(_0x14fdc8[_0xc8ef('0x3')]){this[_0xc8ef('0x3')]=Number(_0x14fdc8[_0xc8ef('0x3')]);}if(_0x14fdc8[_0xc8ef('0x45')]){this[_0xc8ef('0x4')]=Number(_0x14fdc8[_0xc8ef('0x45')]);}if(_0x14fdc8[_0xc8ef('0x46')]){this[_0xc8ef('0x2')]=Number(_0x14fdc8[_0xc8ef('0x46')]);}}for(var _0x2667a4=0x0;_0x2667a4<_0x23d924[_0xc8ef('0x47')];_0x2667a4++){var _0x10aa0d=_0x4698f6[_0xc8ef('0x48')+_0x23d924[_0x2667a4]['name']];if(_0x10aa0d&&_0x10aa0d[_0xc8ef('0x49')]){this[_0xc8ef('0x0')]+=0x1;}if(_0x23d924[_0x2667a4]['incall']==='1'){this[_0xc8ef('0x1d')]+=0x1;}if(_0x23d924[_0x2667a4]['paused']==='1'&&!['2','7','8'][_0xc8ef('0x4a')](_0x23d924[_0x2667a4]['status'])){this[_0xc8ef('0xe')]+=0x1;}switch(_0x23d924[_0x2667a4][_0xc8ef('0x4b')]){case'0':this['unknown']+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this['inUse']+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0xc8ef('0x17')]+=0x1;break;case'5':this[_0xc8ef('0x1f')]+=0x1;break;case'6':this[_0xc8ef('0x1')]+=0x1;break;case'7':this[_0xc8ef('0x1a')]+=0x1;break;case'8':this[_0xc8ef('0x18')]+=0x1;break;}}if(this['dialMethod']==='booked'){var _0x55063d=Object[_0xc8ef('0x4c')](_0x1d59b1);for(var _0x3517a8=0x0;_0x3517a8<_0x55063d[_0xc8ef('0x47')];_0x3517a8++){var _0x427e72=_0x55063d[_0x3517a8];var _0x331f3b=_0x1d59b1[_0x427e72];if(_0x331f3b[_0xc8ef('0x4d')]===this['name']&&_0x331f3b[_0xc8ef('0x1e')]===_0xc8ef('0x4e')&&_0x331f3b['exten']===_0xc8ef('0x4f')){this['talking']+=0x1;}}if(this[_0xc8ef('0x1d')]>this['inUse']){this['talking']=this[_0xc8ef('0x16')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0xc8ef('0x50')][_0xc8ef('0x51')]=function(_0x71fa5){var _0x226713=![];if(_0x71fa5){_0x226713=INBOUND_COUNTERS['some'](function(_0x2a15fb){return this[_0x2a15fb]!==_0x71fa5[_0x2a15fb];},this);}return _0x226713;};VoiceQueueSummary[_0xc8ef('0x50')][_0xc8ef('0x52')]=function(_0x5ae3ae){var _0x987dc7=![];var _0x5bdef1=![];var _0x472f65=![];if(_0x5ae3ae){_0x987dc7=this[_0xc8ef('0x24')]!==_0x5ae3ae[_0xc8ef('0x24')]||this[_0xc8ef('0x53')]!==_0x5ae3ae[_0xc8ef('0x53')]||this[_0xc8ef('0x40')]!==_0x5ae3ae[_0xc8ef('0x40')]||this[_0xc8ef('0x41')]!==_0x5ae3ae[_0xc8ef('0x41')];_0x5bdef1=OUTBOUND_COUNTERS['some'](function(_0x599cf1){return this[_0x599cf1]!==_0x5ae3ae[_0x599cf1];},this);if(this[_0xc8ef('0x42')]&&_0x5ae3ae['Trunk']){_0x472f65=this[_0xc8ef('0x42')]['name']!==_0x5ae3ae['Trunk'][_0xc8ef('0x11')]||this['Trunk']['active']!==_0x5ae3ae[_0xc8ef('0x42')]['active'];}}return _0x987dc7||_0x5bdef1||_0x472f65;};VoiceQueueSummary['prototype']['updateReportFromOutboundQueue']=function(_0x201b4c){this['answered']=_0x201b4c['answered'];this[_0xc8ef('0x40')]=_0x201b4c['message'];this['statusMessage']=_0x201b4c[_0xc8ef('0x41')];this[_0xc8ef('0x5')]=_0x201b4c[_0xc8ef('0x5')];this[_0xc8ef('0x6')]=_0x201b4c[_0xc8ef('0x6')];this['outboundAnswerCallsDay']=_0x201b4c['outboundAnswerCallsDay'];this[_0xc8ef('0x8')]=_0x201b4c[_0xc8ef('0x8')];this['outboundBusyCallsDay']=_0x201b4c[_0xc8ef('0x9')];this[_0xc8ef('0x2a')]=_0x201b4c['outboundCongestionCallsDay'];this['outboundNoAnswerCallsDay']=_0x201b4c['outboundNoAnswerCallsDay'];this[_0xc8ef('0x54')]=_0x201b4c['outboundNoSuchCallsDay'];this[_0xc8ef('0xb')]=_0x201b4c[_0xc8ef('0xb')];this[_0xc8ef('0xc')]=_0x201b4c[_0xc8ef('0xc')];this['outboundUnknownCallsDay']=_0x201b4c[_0xc8ef('0xd')];this[_0xc8ef('0x1b')]=_0x201b4c['sumBillable'];this[_0xc8ef('0xf')]=_0x201b4c[_0xc8ef('0xf')];this[_0xc8ef('0x10')]=_0x201b4c[_0xc8ef('0x10')];if(this[_0xc8ef('0x24')]===_0xc8ef('0x55')){this['pTalking']=_0x201b4c['pTalking'];}};module[_0xc8ef('0x56')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index d86de2b..ca201d3 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 _0xdcd6=['Configurations','username','accessKey','remoteUri','serverUrl'];(function(_0x4cb4a6,_0x31d41a){var _0x4c3978=function(_0x2df692){while(--_0x2df692){_0x4cb4a6['push'](_0x4cb4a6['shift']());}};_0x4c3978(++_0x31d41a);}(_0xdcd6,0x92));var _0x6dcd=function(_0x3e45a6,_0x576195){_0x3e45a6=_0x3e45a6-0x0;var _0x4751f7=_0xdcd6[_0x3e45a6];return _0x4751f7;};'use strict';function VtigerAccount(_0x2814e3){this['id']=_0x2814e3['id']||0x0;this['name']=_0x2814e3['name']||'';this[_0x6dcd('0x0')]=_0x2814e3[_0x6dcd('0x0')]||'';this['accessKey']=_0x2814e3[_0x6dcd('0x1')]||'';this[_0x6dcd('0x2')]=_0x2814e3[_0x6dcd('0x2')]||'';this[_0x6dcd('0x3')]=_0x2814e3[_0x6dcd('0x3')]||'';this[_0x6dcd('0x4')]=_0x2814e3['Configurations']||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x26e4=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x316da6,_0x14717f){var _0x24a235=function(_0x444f86){while(--_0x444f86){_0x316da6['push'](_0x316da6['shift']());}};_0x24a235(++_0x14717f);}(_0x26e4,0x1be));var _0x426e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x26e4[_0x501510];return _0x1e6ee5;};'use strict';function VtigerAccount(_0x5e8f2b){this['id']=_0x5e8f2b['id']||0x0;this[_0x426e('0x0')]=_0x5e8f2b['name']||'';this[_0x426e('0x1')]=_0x5e8f2b['username']||'';this[_0x426e('0x2')]=_0x5e8f2b['accessKey']||'';this['remoteUri']=_0x5e8f2b[_0x426e('0x3')]||'';this[_0x426e('0x4')]=_0x5e8f2b['serverUrl']||'';this[_0x426e('0x5')]=_0x5e8f2b[_0x426e('0x5')]||{};}module[_0x426e('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 07e5918..a06b22c 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 _0x830f=['name','username','token','remoteUri','authType','type','integrationTab','serverUrl','exports'];(function(_0x2b6acc,_0x1afc35){var _0x4d4a38=function(_0x2cf899){while(--_0x2cf899){_0x2b6acc['push'](_0x2b6acc['shift']());}};_0x4d4a38(++_0x1afc35);}(_0x830f,0x1ef));var _0xf830=function(_0x35f301,_0xfa346d){_0x35f301=_0x35f301-0x0;var _0x2164d8=_0x830f[_0x35f301];return _0x2164d8;};'use strict';function ZendeskAccount(_0x398cee){this['id']=_0x398cee['id']||0x0;this[_0xf830('0x0')]=_0x398cee[_0xf830('0x0')]||'';this[_0xf830('0x1')]=_0x398cee[_0xf830('0x1')]||'';this['password']=_0x398cee['password']||'';this[_0xf830('0x2')]=_0x398cee[_0xf830('0x2')]||'';this[_0xf830('0x3')]=_0x398cee['remoteUri']||'';this[_0xf830('0x4')]=_0x398cee['authType']||'';this[_0xf830('0x5')]=_0x398cee['type']||_0xf830('0x6');this[_0xf830('0x7')]=_0x398cee[_0xf830('0x7')]||'';this['Configurations']=_0x398cee['Configurations']||{};}module[_0xf830('0x8')]=ZendeskAccount; \ No newline at end of file +var _0xadaf=['Configurations','exports','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xadaf,0x14c));var _0xfada=function(_0x3d1769,_0x49d66e){_0x3d1769=_0x3d1769-0x0;var _0x44f99c=_0xadaf[_0x3d1769];return _0x44f99c;};'use strict';function ZendeskAccount(_0x115367){this['id']=_0x115367['id']||0x0;this[_0xfada('0x0')]=_0x115367[_0xfada('0x0')]||'';this['username']=_0x115367[_0xfada('0x1')]||'';this[_0xfada('0x2')]=_0x115367[_0xfada('0x2')]||'';this[_0xfada('0x3')]=_0x115367[_0xfada('0x3')]||'';this[_0xfada('0x4')]=_0x115367['remoteUri']||'';this[_0xfada('0x5')]=_0x115367['authType']||'';this[_0xfada('0x6')]=_0x115367['type']||_0xfada('0x7');this[_0xfada('0x8')]=_0x115367[_0xfada('0x8')]||'';this[_0xfada('0x9')]=_0x115367['Configurations']||{};}module[_0xfada('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 6f2549b..7acca9e 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 _0x234e=['zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','name','description','host'];(function(_0x349b8a,_0x35b021){var _0x1d5645=function(_0x1deb06){while(--_0x1deb06){_0x349b8a['push'](_0x349b8a['shift']());}};_0x1d5645(++_0x35b021);}(_0x234e,0xb1));var _0xe234=function(_0x4ad8f9,_0x237d5f){_0x4ad8f9=_0x4ad8f9-0x0;var _0x4bec6d=_0x234e[_0x4ad8f9];return _0x4bec6d;};'use strict';function ZohoAccount(_0x526b90){this['id']=_0x526b90['id']||0x0;this[_0xe234('0x0')]=_0x526b90[_0xe234('0x0')]||'';this[_0xe234('0x1')]=_0x526b90[_0xe234('0x1')]||'';this[_0xe234('0x2')]=_0x526b90[_0xe234('0x2')]||'';this[_0xe234('0x3')]=_0x526b90[_0xe234('0x3')]||'';this[_0xe234('0x4')]=_0x526b90[_0xe234('0x4')]||'';this[_0xe234('0x5')]=_0x526b90[_0xe234('0x5')]||'';this['serverUrl']=_0x526b90[_0xe234('0x6')]||'';this[_0xe234('0x7')]=_0x526b90[_0xe234('0x7')]||'';this[_0xe234('0x8')]=_0x526b90[_0xe234('0x8')]||'';this['Configurations']=_0x526b90[_0xe234('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x681e=['code','refreshToken','Configurations','name','description','host','zone','clientId','clientSecret','serverUrl'];(function(_0x1507ec,_0x715c90){var _0x35b4db=function(_0x166226){while(--_0x166226){_0x1507ec['push'](_0x1507ec['shift']());}};_0x35b4db(++_0x715c90);}(_0x681e,0x161));var _0xe681=function(_0x3838ef,_0x48962d){_0x3838ef=_0x3838ef-0x0;var _0x13894=_0x681e[_0x3838ef];return _0x13894;};'use strict';function ZohoAccount(_0x2e8ddf){this['id']=_0x2e8ddf['id']||0x0;this[_0xe681('0x0')]=_0x2e8ddf[_0xe681('0x0')]||'';this[_0xe681('0x1')]=_0x2e8ddf[_0xe681('0x1')]||'';this[_0xe681('0x2')]=_0x2e8ddf[_0xe681('0x2')]||'';this[_0xe681('0x3')]=_0x2e8ddf[_0xe681('0x3')]||'';this[_0xe681('0x4')]=_0x2e8ddf[_0xe681('0x4')]||'';this[_0xe681('0x5')]=_0x2e8ddf[_0xe681('0x5')]||'';this[_0xe681('0x6')]=_0x2e8ddf[_0xe681('0x6')]||'';this[_0xe681('0x7')]=_0x2e8ddf[_0xe681('0x7')]||'';this['refreshToken']=_0x2e8ddf[_0xe681('0x8')]||'';this[_0xe681('0x9')]=_0x2e8ddf[_0xe681('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index fd2a201..d523231 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 _0x955f=['countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','exports','util','lodash','moment','isNil','uniqueid','queue','name','type','campaigntype','dialAnswer','Agent','channelAgent','format','membername','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry'];(function(_0x2ea046,_0x5ab912){var _0x433e5a=function(_0x13202c){while(--_0x13202c){_0x2ea046['push'](_0x2ea046['shift']());}};_0x433e5a(++_0x5ab912);}(_0x955f,0x1eb));var _0xf955=function(_0x1f1850,_0x3c042a){_0x1f1850=_0x1f1850-0x0;var _0x2fd9ff=_0x955f[_0x1f1850];return _0x2fd9ff;};'use strict';var util=require(_0xf955('0x0'));var _=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));function checkNameSurname(_0x382225,_0x2834f7,_0x585f6e){var _0xd75c8f='';if(!_['isNil'](_0x2834f7)&&'string'===typeof _0x2834f7){_0xd75c8f+=_0x2834f7;}if(!_[_0xf955('0x3')](_0x585f6e)&&'string'===typeof _0x585f6e){_0xd75c8f+='\x20'+_0x585f6e;}if(_0xd75c8f!==''){return _0xd75c8f;}return _0x382225;}function Action(_0x13b796,_0x2caff2,_0x3fdac2,_0x59d5b3,_0x18432f){this[_0xf955('0x4')]=_0x3fdac2||undefined;this['idContact']=_0x13b796['id'];this[_0xf955('0x5')]=_0x2caff2[_0xf955('0x6')];this[_0xf955('0x7')]=_0x2caff2[_0xf955('0x7')];this[_0xf955('0x8')]=_0xf955('0x5');this[_0xf955('0x9')]=![];this['membername']=_[_0xf955('0x3')](_0x13b796['Agent'])?undefined:_0x13b796[_0xf955('0xa')][_0xf955('0x6')];this[_0xf955('0xb')]=this['membername']?util[_0xf955('0xc')]('SIP/%s',this[_0xf955('0xd')]):_0x59d5b3||undefined;this['calleridname']=checkNameSurname(_0x13b796[_0xf955('0xe')][_0xf955('0xf')],_0x13b796[_0xf955('0xe')][_0xf955('0x10')],_0x13b796[_0xf955('0xe')][_0xf955('0x11')]);this[_0xf955('0x12')]=_0x13b796[_0xf955('0x12')]||![];this[_0xf955('0x13')]=_0x13b796[_0xf955('0xf')];this['scheduledat']=_0x13b796[_0xf955('0x14')];this['countbusyretry']=_0x13b796[_0xf955('0x15')]||0x0;this[_0xf955('0x16')]=_0x13b796[_0xf955('0x16')]||0x0;this[_0xf955('0x17')]=_0x13b796['countnoanswerretry']||0x0;this['countglobal']=(_0x13b796[_0xf955('0x15')]||0x0)+(_0x13b796[_0xf955('0x16')]||0x0)+(_0x13b796[_0xf955('0x17')]||0x0)+(_0x13b796['countnosuchnumberretry']||0x0)+(_0x13b796[_0xf955('0x18')]||0x0)+(_0x13b796[_0xf955('0x19')]||0x0)+(_0x13b796[_0xf955('0x1a')]||0x0)+(_0x13b796[_0xf955('0x1b')]||0x0);this[_0xf955('0x1c')]=_0x13b796['countnosuchnumberretry']||0x0;this[_0xf955('0x18')]=_0x13b796[_0xf955('0x18')]||0x0;this[_0xf955('0x19')]=_0x13b796['countabandonedretry']||0x0;this[_0xf955('0x1a')]=_0x13b796['countmachineretry']||0x0;this[_0xf955('0x1b')]=_0x13b796[_0xf955('0x1b')]||0x0;this[_0xf955('0x1d')]=_0x13b796[_0xf955('0x1d')];this[_0xf955('0x1e')]=_0x13b796['callbackuniqueid'];this[_0xf955('0x1f')]=_0x13b796[_0xf955('0x1f')];this[_0xf955('0x20')]=_0x13b796[_0xf955('0x20')];this[_0xf955('0x21')]=_0x13b796[_0xf955('0x21')];this[_0xf955('0x22')]=_0x13b796['ListId'];this[_0xf955('0x23')]=_[_0xf955('0x3')](_0x13b796[_0xf955('0xa')])?_0x13b796[_0xf955('0x23')]:_0x13b796[_0xf955('0xa')]['id'];this[_0xf955('0x24')]=_0x13b796[_0xf955('0x24')];this['originatecalleridnum']='';this[_0xf955('0x25')]='';}Action[_0xf955('0x26')][_0xf955('0x27')]=function(){return util[_0xf955('0xc')](_0xf955('0x28'),this[_0xf955('0x29')],this['number']);};module[_0xf955('0x2a')]=Action; \ No newline at end of file +var _0x8f4c=['lodash','moment','isNil','string','idContact','queue','name','type','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','util'];(function(_0x36212c,_0x546f6a){var _0x1c911c=function(_0x1e6ed4){while(--_0x1e6ed4){_0x36212c['push'](_0x36212c['shift']());}};_0x1c911c(++_0x546f6a);}(_0x8f4c,0x113));var _0xc8f4=function(_0xa74d52,_0x430427){_0xa74d52=_0xa74d52-0x0;var _0x1e1247=_0x8f4c[_0xa74d52];return _0x1e1247;};'use strict';var util=require(_0xc8f4('0x0'));var _=require(_0xc8f4('0x1'));var moment=require(_0xc8f4('0x2'));function checkNameSurname(_0x43926b,_0x19893b,_0x134d73){var _0x580083='';if(!_[_0xc8f4('0x3')](_0x19893b)&&_0xc8f4('0x4')===typeof _0x19893b){_0x580083+=_0x19893b;}if(!_[_0xc8f4('0x3')](_0x134d73)&&'string'===typeof _0x134d73){_0x580083+='\x20'+_0x134d73;}if(_0x580083!==''){return _0x580083;}return _0x43926b;}function Action(_0x32cd80,_0x5208da,_0x4c86f8,_0x520063,_0x373506){this['uniqueid']=_0x4c86f8||undefined;this[_0xc8f4('0x5')]=_0x32cd80['id'];this[_0xc8f4('0x6')]=_0x5208da[_0xc8f4('0x7')];this[_0xc8f4('0x8')]=_0x5208da[_0xc8f4('0x8')];this['campaigntype']=_0xc8f4('0x6');this[_0xc8f4('0x9')]=![];this[_0xc8f4('0xa')]=_[_0xc8f4('0x3')](_0x32cd80['Agent'])?undefined:_0x32cd80[_0xc8f4('0xb')]['name'];this[_0xc8f4('0xc')]=this[_0xc8f4('0xa')]?util[_0xc8f4('0xd')](_0xc8f4('0xe'),this[_0xc8f4('0xa')]):_0x520063||undefined;this['calleridname']=checkNameSurname(_0x32cd80[_0xc8f4('0xf')][_0xc8f4('0x10')],_0x32cd80[_0xc8f4('0xf')][_0xc8f4('0x11')],_0x32cd80[_0xc8f4('0xf')][_0xc8f4('0x12')]);this['active']=_0x32cd80[_0xc8f4('0x13')]||![];this[_0xc8f4('0x14')]=_0x32cd80[_0xc8f4('0x10')];this[_0xc8f4('0x15')]=_0x32cd80[_0xc8f4('0x15')];this['countbusyretry']=_0x32cd80[_0xc8f4('0x16')]||0x0;this['countcongestionretry']=_0x32cd80['countcongestionretry']||0x0;this[_0xc8f4('0x17')]=_0x32cd80[_0xc8f4('0x17')]||0x0;this[_0xc8f4('0x18')]=(_0x32cd80[_0xc8f4('0x16')]||0x0)+(_0x32cd80[_0xc8f4('0x19')]||0x0)+(_0x32cd80[_0xc8f4('0x17')]||0x0)+(_0x32cd80[_0xc8f4('0x1a')]||0x0)+(_0x32cd80[_0xc8f4('0x1b')]||0x0)+(_0x32cd80[_0xc8f4('0x1c')]||0x0)+(_0x32cd80[_0xc8f4('0x1d')]||0x0)+(_0x32cd80[_0xc8f4('0x1e')]||0x0);this[_0xc8f4('0x1a')]=_0x32cd80[_0xc8f4('0x1a')]||0x0;this['countdropretry']=_0x32cd80[_0xc8f4('0x1b')]||0x0;this[_0xc8f4('0x1c')]=_0x32cd80[_0xc8f4('0x1c')]||0x0;this[_0xc8f4('0x1d')]=_0x32cd80[_0xc8f4('0x1d')]||0x0;this[_0xc8f4('0x1e')]=_0x32cd80[_0xc8f4('0x1e')]||0x0;this[_0xc8f4('0x1f')]=_0x32cd80['callback'];this[_0xc8f4('0x20')]=_0x32cd80[_0xc8f4('0x20')];this[_0xc8f4('0x21')]=_0x32cd80[_0xc8f4('0x21')];this['recallme']=_0x32cd80[_0xc8f4('0x22')];this['ContactId']=_0x32cd80[_0xc8f4('0x23')];this['ListId']=_0x32cd80[_0xc8f4('0x24')];this[_0xc8f4('0x25')]=_['isNil'](_0x32cd80[_0xc8f4('0xb')])?_0x32cd80[_0xc8f4('0x25')]:_0x32cd80[_0xc8f4('0xb')]['id'];this[_0xc8f4('0x26')]=_0x32cd80['VoiceQueueId'];this[_0xc8f4('0x27')]='';this[_0xc8f4('0x28')]='';}Action['prototype'][_0xc8f4('0x29')]=function(){return util[_0xc8f4('0xd')](_0xc8f4('0x2a'),this[_0xc8f4('0x2b')],this[_0xc8f4('0x2c')]);};module[_0xc8f4('0x2d')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 5e81140..ee437fc 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 _0x3e74=['unmonitored','run','execRun','unlock','unlockContact','getContactPreview','isValid','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','TrunkBackup','Trunk\x20not\x20working\x20correctly','dialActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','originatecalleridname','originatecalleridnum','addVariables','merge','toLowerVariables','starttime','variables','variablesAction','Action','[originated][increment]','OriginateError','syncNewExten','actionid','logLookAgent','YYYY-MM-DD\x20HH:mm:ss','response','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','cause','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destlinkedid','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','util','uuid','moment','ioredis','preview','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','../dialer/utils','redis','defaults','localhost','tail','sequence','voiceQueues','trunks','actions','clockClearZombieChannels','originateresponse','syncOriginateResponse','syncHangup','bind','hanguprequest','syncHangupRequest','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','sendMessageOneNotActive','originated','paused','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','message','DEACTIVATED','prototype','syncCampaigns','hasOwnProperty','dialMethod','type','outbound','clearZombieChannels','recallMe','clearZombieChannel','queue','pTalking:\x20','pTalking','dialAnswer','pick','contactId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','getContactRecallMe','agentReadyId','then','isNil','length','getDiff','Agent','voicePause','[RecallMe]','disableContact','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','logger2','[getContactRecallMe]','setMessage','IsNotLoggedIn','isActive','isTrunkReachable','Trunk','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','swapAdditionalPhones','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','total','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','BUSY','Busy','dialBusyRetryFrequency','busy','additional','Global','dialBusyMaxRetry','countbusyretry','incrementPreviewCounters','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','queueSummaryCountersUpdated','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Queue','agents','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable'];(function(_0x42df9d,_0x8050b9){var _0x1cf222=function(_0x2c0ecb){while(--_0x2c0ecb){_0x42df9d['push'](_0x42df9d['shift']());}};_0x1cf222(++_0x8050b9);}(_0x3e74,0x175));var _0x43e7=function(_0x183bd3,_0x3eb79f){_0x183bd3=_0x183bd3-0x0;var _0x3678e8=_0x3e74[_0x183bd3];return _0x3678e8;};'use strict';var util=require(_0x43e7('0x0'));var _=require('lodash');var uuid=require(_0x43e7('0x1'));var moment=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x43e7('0x4'));var loggerAction=require('../../../config/logger')(_0x43e7('0x5'));var ami=require(_0x43e7('0x6'));var rpcDb=require(_0x43e7('0x7'));var cmHopperAdditionalPhone=require(_0x43e7('0x8'));var Action=require(_0x43e7('0x9'));var ut=require('./util/util');var utils=require(_0x43e7('0xa'));config[_0x43e7('0xb')]=_[_0x43e7('0xc')](config[_0x43e7('0xb')],{'host':_0x43e7('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x43e7('0xb')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x39c8bd){this[_0x43e7('0xe')]=this['tail']?this[_0x43e7('0xe')]['finally'](_0x39c8bd):_0x39c8bd();};function Preview(_0xf7c520){this[_0x43e7('0xf')]=new Sequence();this['campaignsPreview']=_0xf7c520[_0x43e7('0x10')];this[_0x43e7('0x11')]=_0xf7c520[_0x43e7('0x11')];this[_0x43e7('0x12')]={};this['agents']=_0xf7c520['agents'];this[_0x43e7('0x13')]=0x0;ami['on'](_0x43e7('0x14'),this[_0x43e7('0x15')]['bind'](this));ami['on']('hangup',this[_0x43e7('0x16')][_0x43e7('0x17')](this));ami['on'](_0x43e7('0x18'),this[_0x43e7('0x19')]['bind'](this));ami['on']('dialend',this[_0x43e7('0x1a')][_0x43e7('0x17')](this));ami['on'](_0x43e7('0x1b'),this['syncNewExten']['bind'](this));ami['on'](_0x43e7('0x1c'),this[_0x43e7('0x1d')][_0x43e7('0x17')](this));ami['on'](_0x43e7('0x1e'),this[_0x43e7('0x1f')][_0x43e7('0x17')](this));ami['on'](_0x43e7('0x20'),this[_0x43e7('0x21')][_0x43e7('0x17')](this));this[_0x43e7('0x22')](this[_0x43e7('0x23')]);}function emit(_0x177ee1,_0x4b5d64,_0xef1a5a){io['to'](_0x177ee1)[_0x43e7('0x24')](_0x4b5d64,_0xef1a5a);}function emitVoiceQueueChannelRemove(_0x4b386b){logger[_0x43e7('0x25')](_0x43e7('0x26'),JSON[_0x43e7('0x27')](_0x4b386b));emit(util[_0x43e7('0x28')](_0x43e7('0x29'),_0x4b386b[_0x43e7('0x2a')]),'voice_queue_channel:remove',_0x4b386b);io[_0x43e7('0x24')]('voice_queue_presence:remove',_0x4b386b);}function notSendMessagesQueue(_0x4c9df3){if(_0x4c9df3[_0x43e7('0x2b')]){if(_0x4c9df3[_0x43e7('0x2c')]===0x0&&_0x4c9df3['pTalking']===0x0){_0x4c9df3[_0x43e7('0x2b')]=![];_0x4c9df3['available']=0x0;_0x4c9df3[_0x43e7('0x2d')]=0x0;_0x4c9df3['message']=utils[_0x43e7('0x2e')][_0x43e7('0x2f')];ut[_0x43e7('0x30')](_0x43e7('0x31'),_0x4c9df3['name']+'\x20is\x20not\x20active');}else{_0x4c9df3[_0x43e7('0x32')]=utils['CAMPAIGN_STATUS'][_0x43e7('0x33')];ut[_0x43e7('0x30')](_0x43e7('0x31'),_0x4c9df3[_0x43e7('0x2a')]+'\x20is\x20deactivated');}}}Preview[_0x43e7('0x34')][_0x43e7('0x22')]=function(){var _0x45b675=this;setInterval(function(){_0x45b675[_0x43e7('0x35')]();},0x7cf);};Preview[_0x43e7('0x34')][_0x43e7('0x35')]=function(){var _0x2b85a5=this[_0x43e7('0x23')];this[_0x43e7('0x13')]+=0x1;for(var _0x35dbcd in _0x2b85a5){if(_0x2b85a5[_0x43e7('0x36')](_0x35dbcd)&&(_0x2b85a5[_0x35dbcd][_0x43e7('0x37')]===_0x43e7('0x4')||_0x2b85a5[_0x35dbcd][_0x43e7('0x37')]==='booked')&&_0x2b85a5[_0x35dbcd][_0x43e7('0x38')]===_0x43e7('0x39')){if(this[_0x43e7('0x13')]>0x7){this[_0x43e7('0x13')]=0x0;this[_0x43e7('0x3a')]();}}if(_0x2b85a5['hasOwnProperty'](_0x35dbcd)&&_0x2b85a5[_0x35dbcd][_0x43e7('0x37')]===_0x43e7('0x4')&&_0x2b85a5[_0x35dbcd][_0x43e7('0x38')]===_0x43e7('0x39')){if(_0x2b85a5[_0x35dbcd]['dialActive']){this['setMessage'](_0x2b85a5[_0x35dbcd]);if(_0x2b85a5[_0x35dbcd]['dialPreviewAutoRecallMe'])this[_0x43e7('0x3b')](_0x2b85a5[_0x35dbcd]);}else{notSendMessagesQueue(_0x2b85a5[_0x35dbcd]);}}}};Preview[_0x43e7('0x34')][_0x43e7('0x3c')]=function(_0x234fe6){var _0x108313=this;this[_0x43e7('0xf')]['enqueue'](function(){if(!_['isNil'](_0x108313['actions'][_0x234fe6])){loggerAction['info']('[clearZombieChannels][talking]',_0x234fe6,'Queue',_0x108313['actions'][_0x234fe6][_0x43e7('0x3d')],'originated:\x20',JSON[_0x43e7('0x27')](_0x108313[_0x43e7('0x23')][_0x108313[_0x43e7('0x12')][_0x234fe6][_0x43e7('0x3d')]][_0x43e7('0x2c')]),_0x43e7('0x3e'),JSON[_0x43e7('0x27')](_0x108313['campaignsPreview'][_0x108313['actions'][_0x234fe6]['queue']][_0x43e7('0x3f')]),JSON[_0x43e7('0x27')](_0x108313[_0x43e7('0x12')][_0x234fe6][_0x43e7('0x40')]),JSON[_0x43e7('0x27')](_[_0x43e7('0x41')](_0x108313[_0x43e7('0x12')][_0x234fe6],[_0x43e7('0x42'),'UserId',_0x43e7('0x43'),_0x43e7('0x44')])));return ami['Action']({'action':_0x43e7('0x45'),'channel':_0x108313['actions'][_0x234fe6][_0x43e7('0x46')]})[_0x43e7('0x47')](function(_0x1c6f45){if(_0x1c6f45[_0x43e7('0x32')]===_0x43e7('0x48')){setTimeout(function(){if(_0x108313[_0x43e7('0x12')][_0x234fe6]){ut['updateOriginated'](_0x108313['campaignsPreview'][_0x108313[_0x43e7('0x12')][_0x234fe6][_0x43e7('0x3d')]],_0x43e7('0x49'));if(_0x108313[_0x43e7('0x12')][_0x234fe6][_0x43e7('0x40')]===!![]){ut['decrementTalkink'](_0x108313[_0x43e7('0x23')][_0x108313[_0x43e7('0x12')][_0x234fe6]['queue']],_0x43e7('0x49'));ut['loggerError'](_0x43e7('0x4a')+_0x234fe6,_0x108313['actions'][_0x234fe6][_0x43e7('0x3d')]);}ut[_0x43e7('0x4b')](_0x43e7('0x4c')+_0x234fe6,_0x108313[_0x43e7('0x12')][_0x234fe6]['queue']);delete _0x108313['actions'][_0x234fe6];}},0x2328);}});}});};Preview[_0x43e7('0x34')][_0x43e7('0x3a')]=function(){var _0xe979b5=this;loggerAction[_0x43e7('0x25')]('[action]',_['size'](this['actions']));for(var _0x35e4fb in this['actions']){if(_0xe979b5[_0x43e7('0x12')]['hasOwnProperty'](_0x35e4fb)){_0xe979b5['clearZombieChannel'](_0x35e4fb);}}};Preview[_0x43e7('0x34')]['recallMe']=function(_0x2de14f){var _0x39db7f=this;rpcDb[_0x43e7('0x4d')](_0x2de14f['id'],ut[_0x43e7('0x4e')](this['agents']))[_0x43e7('0x4f')](function(_0x2b9046){if(!_[_0x43e7('0x50')](_0x2b9046)){for(var _0x1fd277=0x0;_0x1fd277<_0x2b9046[_0x43e7('0x51')];_0x1fd277+=0x1){if(ut[_0x43e7('0x52')](_0x2b9046[_0x1fd277]['scheduledat'])<_0x2de14f['dialRecallMeTimeout']*0x3c){if(_0x2b9046[_0x1fd277][_0x43e7('0x53')]&&!_0x2b9046[_0x1fd277][_0x43e7('0x53')][_0x43e7('0x54')]){_0x39db7f['run'](_0x2b9046[_0x1fd277]['id'])['then'](ut['logger2'](_0x43e7('0x55')))[_0x43e7('0x47')](ut['logger2'](_0x43e7('0x55')));}else{rpcDb[_0x43e7('0x56')](_0x2b9046[_0x1fd277]['id']);}}else{var _0x3c96fe=new Action(_0x2b9046[_0x1fd277],_0x2de14f);_0x3c96fe['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2de14f['outboundReCallsDay']+=0x1;ut[_0x43e7('0x57')](_0x3c96fe,0x17,_0x43e7('0x58'));if(_0x2de14f['dialRecallInQueue']){rpcDb[_0x43e7('0x59')](ut[_0x43e7('0x5a')](_0x2b9046[_0x1fd277]));rpcDb[_0x43e7('0x5b')](_0x3c96fe,_0x43e7('0x5c'));}else{ut['logCustomer'](_0x3c96fe,0x16,_0x43e7('0x5d'));rpcDb['createCustomerHistory'](_0x3c96fe,'[HistoryRecallClose]');rpcDb[_0x43e7('0x5e')](_0x3c96fe,_0x43e7('0x5f'));}}}}})[_0x43e7('0x47')](ut[_0x43e7('0x60')](_0x43e7('0x61')));};Preview[_0x43e7('0x34')][_0x43e7('0x62')]=function(_0x256ddd){_0x256ddd[_0x43e7('0x2b')]=!![];if(ut[_0x43e7('0x63')](_0x256ddd['loggedIn'])){_0x256ddd[_0x43e7('0x32')]=utils[_0x43e7('0x2e')]['NO_AGENTS_LOGGED'];}else if(!ut[_0x43e7('0x64')](_0x256ddd['dialActive'])){_0x256ddd[_0x43e7('0x32')]=utils[_0x43e7('0x2e')][_0x43e7('0x2f')];}else if(!this[_0x43e7('0x65')](_0x256ddd[_0x43e7('0x66')])){if(!this['isTrunkReachable'](_0x256ddd['TrunkBackup'])){_0x256ddd[_0x43e7('0x32')]=utils[_0x43e7('0x2e')][_0x43e7('0x67')];}else{_0x256ddd[_0x43e7('0x32')]=utils[_0x43e7('0x2e')][_0x43e7('0x68')];}}else{_0x256ddd[_0x43e7('0x32')]=utils[_0x43e7('0x2e')][_0x43e7('0x68')];}};Preview[_0x43e7('0x34')][_0x43e7('0x69')]=function(_0x4ace49,_0x1ec35a,_0x2da2f3){var _0x50a3fa=this;var _0x4314d8=this[_0x43e7('0x12')][_0x1ec35a];var _0x2d0052=this['campaignsPreview'][_0x4314d8['queue']];var _0x459c13;var _0x3d9a29=![];var _0x4ebdde=0x2;var _0x283dd8=0x3;if(_0x2d0052){switch(_0x2da2f3){case'1':_0x2d0052['outboundNoSuchCallsDay']+=0x1;_0x4314d8['countnosuchnumberretry']+=0x1;_0x4314d8[_0x43e7('0x6a')]=ut[_0x43e7('0x6b')](_0x4314d8);ut[_0x43e7('0x57')](_0x4314d8,0x0,_0x43e7('0x6c'));ami[_0x43e7('0x24')]('custom:agentnosuchnumber',ut[_0x43e7('0x6d')](_0x4314d8,_0x43e7('0x6e')));rpcDb['createCustomerHistory'](_0x4314d8,_0x43e7('0x6f'));_0x50a3fa[_0x43e7('0x70')](_0x4314d8,'0',_0x2d0052)[_0x43e7('0x4f')](function(_0x5bb536){_0x3d9a29=_0x5bb536['additional']==0x1;_0x4ebdde=_0x2d0052['dialNoSuchNumberRetryFrequency'];_0x283dd8=_0x2d0052[_0x43e7('0x71')];if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052[_0x43e7('0x72')]){_0x459c13=ut[_0x43e7('0x73')](_0x4314d8,0xf,'Global');rpcDb['createCustomerFinal'](_0x459c13,_0x43e7('0x74'));}else{if(_0x4314d8[_0x43e7('0x75')]>=_0x2d0052[_0x43e7('0x76')]){rpcDb[_0x43e7('0x5e')](_0x4314d8,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x43e7('0x77')](ut[_0x43e7('0x78')](_0x4314d8,_0x43e7('0x75'),_0x2d0052[_0x43e7('0x79')]),_0x4314d8[_0x43e7('0x7a')],_0x4314d8[_0x43e7('0x7b')]);}}delete this[_0x43e7('0x12')][_0x4ace49[_0x43e7('0x7c')]];}else{_0x4314d8[_0x43e7('0x75')]++;logger[_0x43e7('0x25')](_0x43e7('0x7d'),_0x4314d8['countnosuchnumberretry']);logger['info']('id',_0x4314d8[_0x43e7('0x7e')]);_0x50a3fa['incrementPreviewCounters']({'id':_0x4314d8['idContact'],'field':{'countnosuchnumberretry':_0x4314d8['countnosuchnumberretry']}})[_0x43e7('0x4f')](function(){_0x50a3fa[_0x43e7('0x7f')](_0x4314d8,_0x4ebdde,_0x283dd8)['then'](function(){});});}});break;case _0x43e7('0x80'):var _0x135791=moment()[_0x43e7('0x28')]('YYYY-MM-DD\x20HH:mm:ss');_0x4314d8[_0x43e7('0x81')]=_0x135791;_0x4314d8[_0x43e7('0x82')]=_0x135791;_0x4314d8[_0x43e7('0x40')]=!![];_0x2d0052[_0x43e7('0x3f')]+=0x1;logger[_0x43e7('0x25')](_0x43e7('0x83'),_0x4314d8[_0x43e7('0x84')],'\x20Queue',_0x2d0052[_0x43e7('0x2a')],_0x43e7('0x3e'),_0x2d0052[_0x43e7('0x3f')]);ami['emit']('custom:agentconnect',ut[_0x43e7('0x6d')](_0x4314d8,'connect',this['campaignsPreview'][_0x4314d8[_0x43e7('0x3d')]]));if(_0x2d0052[_0x43e7('0x85')]){ami['emit'](_0x43e7('0x86'),ut[_0x43e7('0x87')](_0x4314d8));}break;case'16':ami[_0x43e7('0x24')](_0x43e7('0x88'),ut[_0x43e7('0x6d')](_0x4314d8,_0x43e7('0x89'),this[_0x43e7('0x23')][_0x4314d8['queue']]));emitVoiceQueueChannelRemove(ut[_0x43e7('0x6d')](_0x4314d8,_0x43e7('0x89')));_0x2d0052['outboundAnswerCallsDay']+=0x1;_0x2d0052[_0x43e7('0x8a')]+=0x1;_0x2d0052['answered']+=0x1;ut[_0x43e7('0x8b')](_0x2d0052,_0x43e7('0x8c'));_0x4314d8[_0x43e7('0x6a')]=ut[_0x43e7('0x6b')](_0x4314d8);ut['logCustomer'](_0x4314d8,0x4,_0x43e7('0x8d'));rpcDb[_0x43e7('0x5b')](_0x4314d8,_0x43e7('0x8e'));rpcDb['createCustomerFinal'](_0x4314d8,_0x43e7('0x8f'));rpcDb[_0x43e7('0x90')](_0x4314d8);_0x2d0052[_0x43e7('0x91')]+=_0x4314d8[_0x43e7('0x92')];_0x2d0052[_0x43e7('0x93')]+=_0x4314d8['talktime'];logger[_0x43e7('0x25')](_0x43e7('0x94'),_0x4314d8[_0x43e7('0x84')],_0x43e7('0x95'),_0x2d0052[_0x43e7('0x2a')],_0x43e7('0x3e'),_0x2d0052[_0x43e7('0x3f')]);delete this['actions'][_0x4ace49['linkedid']];break;case _0x43e7('0x96'):_0x2d0052['outboundBusyCallsDay']+=0x1;_0x4314d8['countbusyretry']+=0x1;_0x4314d8['countglobal']=ut[_0x43e7('0x6b')](_0x4314d8);ut[_0x43e7('0x57')](_0x4314d8,0x5,_0x43e7('0x97'));_0x4ebdde=_0x2d0052[_0x43e7('0x98')];_0x283dd8=_0x2d0052[_0x43e7('0x71')];ami[_0x43e7('0x24')]('custom:agentbusy',ut[_0x43e7('0x6d')](_0x4314d8,_0x43e7('0x99')));rpcDb[_0x43e7('0x5b')](_0x4314d8,'[callProgressDetectingCustomer][logBusy]');_0x50a3fa[_0x43e7('0x70')](_0x4314d8,'5',_0x2d0052)[_0x43e7('0x4f')](function(_0x184ae3){_0x3d9a29=_0x184ae3[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052[_0x43e7('0x72')]){_0x459c13=ut[_0x43e7('0x73')](_0x4314d8,0xf,_0x43e7('0x9b'));rpcDb['createCustomerFinal'](_0x459c13,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x4314d8['countbusyretry']>=_0x2d0052[_0x43e7('0x9c')]){rpcDb[_0x43e7('0x5e')](_0x4314d8,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x43e7('0x77')](ut[_0x43e7('0x78')](_0x4314d8,_0x43e7('0x9d'),_0x2d0052[_0x43e7('0x98')]),_0x4314d8['unlockAgent'],_0x4314d8['activeContact']);}}}else{_0x4314d8['countbusyretry']++;_0x50a3fa[_0x43e7('0x9e')]({'id':_0x4314d8[_0x43e7('0x7e')],'field':{'countbusyretry':_0x4314d8['countbusyretry']}})['then'](function(){_0x50a3fa[_0x43e7('0x7f')](_0x4314d8,_0x4ebdde,_0x283dd8)[_0x43e7('0x4f')](function(){});});}});break;case _0x43e7('0x9f'):_0x2d0052['outboundNoAnswerCallsDay']+=0x1;_0x4314d8[_0x43e7('0xa0')]+=0x1;_0x4314d8[_0x43e7('0x6a')]=ut[_0x43e7('0x6b')](_0x4314d8);ut[_0x43e7('0x57')](_0x4314d8,0x3,'NoAnswer');_0x4ebdde=_0x2d0052[_0x43e7('0xa1')];_0x283dd8=_0x2d0052['callAdditionalPhoneAfterMin'];var _0xa66309=ut[_0x43e7('0xa2')](_0x4314d8,_0x2d0052);ami[_0x43e7('0x24')](_0x43e7('0xa3'),_0xa66309);rpcDb[_0x43e7('0x5b')](_0x4314d8,_0x43e7('0xa4'));_0x50a3fa[_0x43e7('0x70')](_0x4314d8,'3',_0x2d0052)['then'](function(_0x109c86){_0x3d9a29=_0x109c86[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052[_0x43e7('0x72')]){_0x459c13=ut['cloneAction'](_0x4314d8,0xf,'Global');rpcDb['createCustomerFinal'](_0x459c13,_0x43e7('0xa5'));}else{if(_0x4314d8['countnoanswerretry']>=_0x2d0052[_0x43e7('0xa6')]){rpcDb[_0x43e7('0x5e')](_0x4314d8,_0x43e7('0xa4'));}else{rpcDb[_0x43e7('0x77')](ut[_0x43e7('0x78')](_0x4314d8,_0x43e7('0xa0'),_0x2d0052[_0x43e7('0xa1')]),_0x4314d8[_0x43e7('0x7a')],_0x4314d8[_0x43e7('0x7b')]);}}}else{_0x4314d8[_0x43e7('0xa0')]++;_0x50a3fa[_0x43e7('0x9e')]({'id':_0x4314d8['idContact'],'field':{'countnoanswerretry':_0x4314d8[_0x43e7('0xa0')]}})[_0x43e7('0x4f')](function(){_0x50a3fa[_0x43e7('0x7f')](_0x4314d8,_0x4ebdde,_0x283dd8)[_0x43e7('0x4f')](function(){});});}});break;case _0x43e7('0xa7'):_0x2d0052['outboundCongestionCallsDay']+=0x1;_0x4314d8['countcongestionretry']+=0x1;_0x4314d8[_0x43e7('0x6a')]=ut[_0x43e7('0x6b')](_0x4314d8);ut['logCustomer'](_0x4314d8,0x8,_0x43e7('0xa8'));_0x4ebdde=_0x2d0052[_0x43e7('0xa9')];_0x283dd8=_0x2d0052['callAdditionalPhoneAfterMin'];ami['emit'](_0x43e7('0xaa'),ut[_0x43e7('0x6d')](_0x4314d8,_0x43e7('0xab')));rpcDb[_0x43e7('0x5b')](_0x4314d8,_0x43e7('0xac'));_0x50a3fa['verifyAdditionalPhones'](_0x4314d8,'8',_0x2d0052)['then'](function(_0x403276){_0x3d9a29=_0x403276[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052[_0x43e7('0x72')]){_0x459c13=ut['cloneAction'](_0x4314d8,0xf,_0x43e7('0x9b'));rpcDb[_0x43e7('0x5e')](_0x459c13,_0x43e7('0xad'));}else{if(_0x4314d8[_0x43e7('0xae')]>=_0x2d0052['dialCongestionMaxRetry']){rpcDb[_0x43e7('0x5e')](_0x4314d8,_0x43e7('0xac'));}else{rpcDb[_0x43e7('0x77')](ut[_0x43e7('0x78')](_0x4314d8,_0x43e7('0xae'),_0x2d0052['dialBusyRetryFrequency']),_0x4314d8[_0x43e7('0x7a')],_0x4314d8[_0x43e7('0x7b')]);}}}else{_0x4314d8['countcongestionretry']++;_0x50a3fa[_0x43e7('0x9e')]({'id':_0x4314d8[_0x43e7('0x7e')],'field':{'countcongestionretry':_0x4314d8[_0x43e7('0xae')]}})[_0x43e7('0x4f')](function(){_0x50a3fa['swapAdditionalPhones'](_0x4314d8,_0x4ebdde,_0x283dd8)[_0x43e7('0x4f')](function(){});});}});break;case'CANCEL':_0x2d0052[_0x43e7('0xaf')]+=0x1;_0x4314d8[_0x43e7('0xb0')]+=0x1;_0x4314d8[_0x43e7('0x6a')]=ut[_0x43e7('0x6b')](_0x4314d8);ut[_0x43e7('0x57')](_0x4314d8,0x14,_0x43e7('0xb1'));_0x4ebdde=_0x2d0052[_0x43e7('0xb2')];_0x283dd8=_0x2d0052[_0x43e7('0x71')];ami[_0x43e7('0x24')]('custom:agentreject',ut[_0x43e7('0x6d')](_0x4314d8,_0x43e7('0xb3')));rpcDb[_0x43e7('0x5b')](_0x4314d8,_0x43e7('0xb4'));_0x50a3fa['verifyAdditionalPhones'](_0x4314d8,'20',_0x2d0052)['then'](function(_0x2c5bf9){_0x3d9a29=_0x2c5bf9[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052['dialGlobalMaxRetry']){_0x459c13=ut[_0x43e7('0x73')](_0x4314d8,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x459c13,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x4314d8[_0x43e7('0xb0')]>=_0x2d0052['dialAgentRejectMaxRetry']){rpcDb[_0x43e7('0x5e')](_0x4314d8,_0x43e7('0xb5'));}else{rpcDb[_0x43e7('0x77')](ut[_0x43e7('0x78')](_0x4314d8,_0x43e7('0xb0'),_0x2d0052['dialAgentRejectRetryFrequency']),_0x4314d8['unlockAgent'],_0x4314d8[_0x43e7('0x7b')]);}}}else{_0x4314d8[_0x43e7('0xa0')]++;_0x50a3fa['incrementPreviewCounters']({'id':_0x4314d8[_0x43e7('0x7e')],'field':{'countnoanswerretry':_0x4314d8[_0x43e7('0xa0')]}})[_0x43e7('0x4f')](function(){_0x50a3fa[_0x43e7('0x7f')](_0x4314d8,_0x4ebdde,_0x283dd8)[_0x43e7('0x4f')](function(){});});}});break;case _0x43e7('0xb6'):_0x2d0052[_0x43e7('0xb7')]+=0x1;_0x4314d8[_0x43e7('0xb8')]+=0x1;_0x4314d8[_0x43e7('0x6a')]=ut[_0x43e7('0x6b')](_0x4314d8);ut[_0x43e7('0x57')](_0x4314d8,0xb,_0x43e7('0xb9'));rpcDb[_0x43e7('0x5b')](_0x4314d8,_0x43e7('0xba'));_0x50a3fa[_0x43e7('0x70')](_0x4314d8,'11',_0x2d0052)[_0x43e7('0x4f')](function(_0x3286b1){_0x3d9a29=_0x3286b1[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052[_0x43e7('0x72')]){_0x459c13=ut[_0x43e7('0x73')](_0x4314d8,0xf,_0x43e7('0x9b'));rpcDb['createCustomerFinal'](_0x459c13,_0x43e7('0xba'));}else{if(_0x4314d8[_0x43e7('0xbb')]>=_0x2d0052[_0x43e7('0xbc')]){rpcDb[_0x43e7('0x5e')](_0x4314d8,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x43e7('0x77')](ut['scheduledAt'](_0x4314d8,_0x43e7('0xb8'),_0x2d0052[_0x43e7('0xbd')]),_0x4314d8[_0x43e7('0x7a')],_0x4314d8[_0x43e7('0x7b')]);}}}else{_0x4314d8[_0x43e7('0xa0')]++;_0x50a3fa[_0x43e7('0x9e')]({'id':_0x4314d8['idContact'],'field':{'countnoanswerretry':_0x4314d8[_0x43e7('0xa0')]}})[_0x43e7('0x4f')](function(){_0x50a3fa[_0x43e7('0x7f')](_0x4314d8,_0x4ebdde,_0x283dd8)[_0x43e7('0x4f')](function(){});});}});break;case'18':_0x2d0052[_0x43e7('0xbe')]+=0x1;_0x4314d8['countmachineretry']+=0x1;_0x4314d8['countglobal']=ut[_0x43e7('0x6b')](_0x4314d8);ut['logCustomer'](_0x4314d8,0x12,_0x4ace49[_0x43e7('0xbf')]||_0x4ace49[_0x43e7('0xc0')]);ami[_0x43e7('0x24')](_0x43e7('0xc1'),ut['buildObj'](_0x4314d8,'amd'));rpcDb['createCustomerHistory'](_0x4314d8,_0x43e7('0xc2'));_0x50a3fa['verifyAdditionalPhones'](_0x4314d8,'18',_0x2d0052)['then'](function(_0x4d7f0f){_0x3d9a29=_0x4d7f0f[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052['dialGlobalMaxRetry']){_0x459c13=ut[_0x43e7('0x73')](_0x4314d8,0x12,'Global');rpcDb[_0x43e7('0x5e')](_0x459c13,_0x43e7('0xc2'));}else{rpcDb[_0x43e7('0x5e')](_0x4314d8,_0x43e7('0xc2'));}}else{_0x4314d8[_0x43e7('0xa0')]++;_0x50a3fa['incrementPreviewCounters']({'id':_0x4314d8[_0x43e7('0x7e')],'field':{'countnoanswerretry':_0x4314d8[_0x43e7('0xa0')]}})[_0x43e7('0x4f')](function(){_0x50a3fa['swapAdditionalPhones'](_0x4314d8,_0x4ebdde,_0x283dd8)['then'](function(){});});}});delete this[_0x43e7('0x12')][_0x4ace49[_0x43e7('0x7c')]];break;case'19':_0x2d0052[_0x43e7('0xbe')]+=0x1;_0x4314d8[_0x43e7('0x6a')]=ut['totalGlobal'](_0x4314d8);ut[_0x43e7('0x57')](_0x4314d8,0x13,_0x4ace49[_0x43e7('0xbf')]||_0x4ace49[_0x43e7('0xc0')]);ami['emit'](_0x43e7('0xc1'),ut[_0x43e7('0x6d')](_0x4314d8,_0x43e7('0xc3')));rpcDb[_0x43e7('0x5b')](_0x4314d8,'[callProgressDetectingCustomer][machine]');_0x50a3fa[_0x43e7('0x70')](_0x4314d8,'18',_0x2d0052)['then'](function(_0x299086){_0x3d9a29=_0x299086[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut['totalGlobal'](_0x4314d8)>=_0x2d0052['dialGlobalMaxRetry']){_0x459c13=ut[_0x43e7('0x73')](_0x4314d8,0xf,_0x43e7('0x9b'));rpcDb[_0x43e7('0x5e')](_0x459c13,_0x43e7('0xc4'));}else{rpcDb[_0x43e7('0x5e')](_0x4314d8,_0x43e7('0xc4'));}}else{_0x4314d8[_0x43e7('0xa0')]++;_0x50a3fa[_0x43e7('0x9e')]({'id':_0x4314d8[_0x43e7('0x7e')],'field':{'countnoanswerretry':_0x4314d8[_0x43e7('0xa0')]}})[_0x43e7('0x4f')](function(){_0x50a3fa['swapAdditionalPhones'](_0x4314d8,_0x4ebdde,_0x283dd8)[_0x43e7('0x4f')](function(){});});}});delete this['actions'][_0x4ace49[_0x43e7('0x7c')]];break;default:if(_0x4314d8[_0x43e7('0x40')]){ut[_0x43e7('0x8b')](_0x2d0052,'[default]');ut[_0x43e7('0x4b')](_0x43e7('0xc5')+_0x2d0052[_0x43e7('0x2a')],_0x4ace49);}_0x2d0052[_0x43e7('0xbe')]+=0x1;_0x4314d8['countglobal']=ut[_0x43e7('0x6b')](_0x4314d8);ut[_0x43e7('0x57')](_0x4314d8,0xc,_0x4ace49['cause-txt']||_0x4ace49['dialstatus']);_0x4ebdde=_0x2d0052['dialAgentRejectRetryFrequency'];_0x283dd8=_0x2d0052[_0x43e7('0x71')];rpcDb[_0x43e7('0x5b')](_0x4314d8,_0x43e7('0xc6'));_0x50a3fa[_0x43e7('0x70')](_0x4314d8,'20',_0x2d0052)[_0x43e7('0x4f')](function(_0x40019e){_0x3d9a29=_0x40019e[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052['dialGlobalMaxRetry']){_0x459c13=ut[_0x43e7('0x73')](_0x4314d8,0xf,_0x43e7('0x9b'));rpcDb[_0x43e7('0x5e')](_0x459c13,_0x43e7('0xc7'));}else{rpcDb['createCustomerFinal'](_0x4314d8,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x43e7('0x12')][_0x4ace49[_0x43e7('0x7c')]];}else{_0x50a3fa[_0x43e7('0x7f')](_0x4314d8,_0x4ebdde,_0x283dd8)[_0x43e7('0x4f')](function(){});}});}if(!(_0x4314d8['dialAnswer']&&_0x2da2f3==='16')){ut[_0x43e7('0xc8')](_0x2d0052,_0x43e7('0xc9'));logger[_0x43e7('0x25')](_0x43e7('0xca'),_0x4314d8[_0x43e7('0x84')],_0x43e7('0x95'),_0x2d0052['name'],_0x43e7('0xcb'),_0x2d0052['originated']);}if(_0x2da2f3!=='ANSWER'){delete this[_0x43e7('0x12')][_0x4ace49[_0x43e7('0x7c')]];delete this['actions'][_0x4ace49['destlinkedid']];}_0x2d0052[_0x43e7('0xcc')]=!![];}};Preview[_0x43e7('0x34')]['callProgressDetectingAgent']=function(_0x189c38,_0x156a3c,_0x302138){if(_[_0x43e7('0xcd')](_0x156a3c)&&'object'!==typeof _0x156a3c){return;}if(_['isUndefined'](_0x302138)&&_0x43e7('0xce')!==typeof _0x302138){return;}switch(_0x302138[_0x43e7('0xcf')]){case'0':ut[_0x43e7('0xd0')](_0x189c38,0x0,'NoSuchNumber');rpcDb['createAgentHistory'](_0x189c38,_0x43e7('0xd1'));break;case'3':ut[_0x43e7('0xd0')](_0x189c38,0x3,_0x43e7('0xd2'));rpcDb[_0x43e7('0xd3')](_0x189c38,_0x43e7('0xd4'));break;case'5':ut[_0x43e7('0xd0')](_0x189c38,0x5,_0x43e7('0x97'));rpcDb[_0x43e7('0xd3')](_0x189c38,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x189c38,0x8,'Congestion');rpcDb[_0x43e7('0xd3')](_0x189c38,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x43e7('0xd0')](_0x189c38,0x16,_0x43e7('0xd5'));rpcDb[_0x43e7('0xd3')](_0x189c38,_0x43e7('0xd6'));break;default:ut[_0x43e7('0xd0')](_0x189c38,0xc,_0x302138['reason']);rpcDb[_0x43e7('0xd3')](_0x189c38,_0x43e7('0xd7'));}ut[_0x43e7('0xc8')](_0x156a3c,_0x43e7('0xd8'));logger['info'](_0x43e7('0xd9'),_0x189c38[_0x43e7('0x84')],_0x43e7('0x95'),_0x156a3c[_0x43e7('0x2a')],_0x43e7('0xcb'),_0x156a3c[_0x43e7('0x2c')]);delete this[_0x43e7('0x12')][_0x189c38['uniqueid']];};Preview[_0x43e7('0x34')][_0x43e7('0x70')]=function(_0x20fab2,_0x3637d9,_0x3c52d3){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x20fab2,_0x3637d9,_0x3c52d3)[_0x43e7('0x47')](logger[_0x43e7('0x25')]('[verifyAdditionalPhone]\x20'));};Preview[_0x43e7('0x34')][_0x43e7('0x7f')]=function(_0x577ac6,_0x235418,_0x368c57){return cmHopperAdditionalPhone[_0x43e7('0x7f')](_0x577ac6,_0x235418,_0x368c57)[_0x43e7('0x47')](logger[_0x43e7('0x25')]('[swapAdditionalPhone]\x20'));};Preview[_0x43e7('0x34')][_0x43e7('0x9e')]=function(_0x1e5d48){return Promise['resolve']()[_0x43e7('0x4f')](cmHopperAdditionalPhone[_0x43e7('0x9e')](_0x1e5d48))['catch'](logger[_0x43e7('0x25')](_0x43e7('0xda')));};Preview[_0x43e7('0x34')][_0x43e7('0xdb')]=function(_0x15b04a,_0x3b5f39,_0x4d5736,_0xcbdb35,_0xa5981f){var _0x19ddfa=this;return new Promise(function(_0x4a4031,_0x5a7f2e){if(_[_0x43e7('0x50')](_0x3b5f39)||_[_0x43e7('0x50')](_0x3b5f39[_0x43e7('0xdc')])||_[_0x43e7('0x50')](_0x3b5f39[_0x43e7('0xdd')])||_[_0x43e7('0x50')](_0x3b5f39[_0x43e7('0x43')])){_0x5a7f2e(ut[_0x43e7('0x32')]('Contact\x20is\x20undefined',_0xcbdb35,_0xa5981f));return;}var _0x723c7=uuid['v4']();var _0xfbdb90=_0x19ddfa[_0x43e7('0x23')][_0x3b5f39[_0x43e7('0xde')][_0x43e7('0x2a')]];var _0x114e00=_0x4d5736?_0x19ddfa[_0x43e7('0xdf')][_0x4d5736]['id']:undefined;_0x19ddfa[_0x43e7('0x12')][_0x723c7]=new Action(_0x3b5f39,_0xfbdb90,_0x723c7,_0x4d5736,_0x114e00);var _0x51e17c=_0x19ddfa[_0x43e7('0x12')][_0x723c7];_0x51e17c[_0x43e7('0x7a')]=_0xcbdb35;_0x51e17c[_0x43e7('0x7b')]=_0xa5981f;_0x51e17c[_0x43e7('0xe0')]=_0x4d5736;if(_[_0x43e7('0xe1')](_0x15b04a)){_0x19ddfa['execCall'](_0x51e17c,_0xfbdb90,_0x3b5f39,_0x4d5736)[_0x43e7('0x4f')](function(_0x186e57){logger[_0x43e7('0x25')](_0x43e7('0xe2'),_0x43e7('0xe3')+_0x51e17c['queue']+_0x43e7('0xe4')+_0x51e17c['idContact'],JSON[_0x43e7('0x27')](_0x186e57));ami[_0x43e7('0x24')](_0x43e7('0xe5'),ut[_0x43e7('0x6d')](_0x51e17c,'called',_0x19ddfa[_0x43e7('0x23')][_0x51e17c[_0x43e7('0x3d')]]));_0x4a4031(ut[_0x43e7('0x32')](_0x43e7('0xe6')));})[_0x43e7('0x47')](function(_0x27bbd6){ut[_0x43e7('0x30')](_0x43e7('0xe7'),_0x27bbd6);_0x5a7f2e(ut[_0x43e7('0x32')](_0x43e7('0xe8'),_0xcbdb35,_0xa5981f));});}else{_0xfbdb90[_0x43e7('0xe9')]+=0x1;ut['logBlacklist'](_0x51e17c);rpcDb['createHistory'](_0x51e17c,_0x43e7('0xea'));delete _0x19ddfa['actions'][_0x723c7];_0x5a7f2e(ut['message'](_0x43e7('0xeb'),_0xcbdb35,_0xa5981f));}});};Preview[_0x43e7('0x34')]['isTrunkReachable']=function(_0x143be2){return!_['isNil'](_0x143be2)&&!_['isNil'](_0x143be2['name'])&&!_[_0x43e7('0x50')](_0x143be2[_0x43e7('0xec')])&&_0x143be2[_0x43e7('0xec')]&&!_[_0x43e7('0x50')](this[_0x43e7('0x11')][util[_0x43e7('0x28')](_0x43e7('0xed'),_0x143be2[_0x43e7('0x2a')])])&&!_[_0x43e7('0x50')](this[_0x43e7('0x11')][util[_0x43e7('0x28')](_0x43e7('0xed'),_0x143be2[_0x43e7('0x2a')])][_0x43e7('0x45')])&&(this[_0x43e7('0x11')][util[_0x43e7('0x28')](_0x43e7('0xed'),_0x143be2[_0x43e7('0x2a')])][_0x43e7('0x45')]===_0x43e7('0xee')||this['trunks'][util[_0x43e7('0x28')](_0x43e7('0xed'),_0x143be2['name'])][_0x43e7('0x45')]===_0x43e7('0xef'));};Preview[_0x43e7('0x34')][_0x43e7('0xf0')]=function(_0x49441c,_0x31797a){return this[_0x43e7('0xf1')](_0x49441c,_0x31797a)['then'](function(_0x43500a){return _[_0x43e7('0x41')](_0x43500a,[_0x43e7('0x32')]);})['catch'](function(_0x22b824){if(_0x22b824[_0x43e7('0xf2')]){rpcDb[_0x43e7('0xf3')](_0x49441c);}if(_0x22b824[_0x43e7('0xec')]){rpcDb[_0x43e7('0x56')](_0x49441c);}throw _['pick'](_0x22b824,[_0x43e7('0x32')]);});};Preview[_0x43e7('0x34')]['execRun']=function(_0x1d31f5,_0x47b03b){var _0x4bf8ad=this;var _0x55baca,_0x5486a6;return rpcDb[_0x43e7('0xf4')](_0x1d31f5)[_0x43e7('0x4f')](function(_0x7f518f){if(!_[_0x43e7('0x50')](_0x7f518f[0x0])){_0x5486a6=_0x7f518f[0x0]['recallme']?![]:!![];_0x55baca=_0x7f518f[0x0]['recallme']?!![]:![];_0x55baca=_0x47b03b?!![]:_0x55baca;}var _0x267b26=_0x4bf8ad['validateContact'](_0x7f518f);if(_0x267b26[_0x43e7('0xf5')]){rpcDb['checkIsBlackList'](_[_0x43e7('0x41')](_0x7f518f[0x0],['VoiceQueueId','phone']))['then'](function(_0x5653b0){_0x4bf8ad[_0x43e7('0xdb')](_0x5653b0,_0x7f518f[0x0],_0x47b03b,_0x5486a6,_0x55baca)[_0x43e7('0x4f')](function(_0x574658){return _0x574658;})['catch'](function(_0x466aa7){throw _0x466aa7;});})[_0x43e7('0x47')](function(_0x517289){ut['logger'](_0x43e7('0xf6'),_0x517289);throw ut[_0x43e7('0x32')](_0x43e7('0xf7'),_0x5486a6,_0x55baca);});}else{throw ut[_0x43e7('0x32')](_0x267b26['message'],_0x5486a6,_0x55baca);}})[_0x43e7('0x47')](function(_0x536b7d){ut[_0x43e7('0x30')](_0x43e7('0xf8'),_0x536b7d);throw ut[_0x43e7('0x32')](_0x43e7('0xf7'),![],!![]);});};Preview[_0x43e7('0x34')][_0x43e7('0xf9')]=function(_0x2cbbda){if(_['isNil'](_0x2cbbda)||_[_0x43e7('0xe1')](_0x2cbbda)||!_[_0x43e7('0x50')](_0x2cbbda[0x0]['Agent'])&&_[_0x43e7('0x50')](_0x2cbbda[0x0][_0x43e7('0x53')][_0x43e7('0x2a')])){ut[_0x43e7('0x30')](_0x43e7('0xfa'),_0x2cbbda);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x3fd573=this['campaignsPreview'][_0x2cbbda[0x0][_0x43e7('0xde')]['name']];_0x3fd573[_0x43e7('0x32')]=utils[_0x43e7('0x2e')][_0x43e7('0x68')];if(_[_0x43e7('0x50')](_0x3fd573)){ut[_0x43e7('0x30')]('[Preview][validateContact][Empty\x20Campaign]',_0x3fd573);return{'isValid':![],'message':_0x43e7('0xfb')};}if(!this['isTrunkReachable'](_0x3fd573[_0x43e7('0x66')])){ut[_0x43e7('0x30')](_0x43e7('0xfc'),'campaign\x20Name:\x20'+_0x3fd573[_0x43e7('0x2a')]+_0x43e7('0xfd'));if(!this[_0x43e7('0x65')](_0x3fd573[_0x43e7('0xfe')])){ut[_0x43e7('0x30')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x3fd573[_0x43e7('0x2a')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x43e7('0xff')};}}if(!ut[_0x43e7('0x64')](_0x3fd573[_0x43e7('0x100')])){ut[_0x43e7('0x30')](_0x43e7('0x101'),_0x3fd573[_0x43e7('0x2a')]+_0x43e7('0x102'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x3fd573[_0x43e7('0x2a')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x43e7('0x103')};};Preview[_0x43e7('0x34')][_0x43e7('0x104')]=function(_0xbc6e18,_0x16c757,_0xf9178f,_0x3bb7ab){var _0x2be8c7=this;return new Promise(function(_0x2bb14d,_0x57f7ea){var _0x240478=_0xbc6e18['uniqueid'];var _0x2b7b33=_0x2be8c7[_0x43e7('0x65')](_0x16c757['Trunk'])?util[_0x43e7('0x28')](_0x43e7('0x105'),_0x16c757['Trunk'][_0x43e7('0x2a')],_[_0x43e7('0x50')](_0x16c757[_0x43e7('0x106')])?'':_0x16c757[_0x43e7('0x106')][_0x43e7('0x107')]()||'',_0x16c757[_0x43e7('0x108')]>0x0?_0xf9178f[_0x43e7('0xdd')][_0x43e7('0x109')](_0x16c757['dialCutDigit']):_0xf9178f[_0x43e7('0xdd')]):util[_0x43e7('0x28')](_0x43e7('0x105'),_['isNil'](_0x16c757[_0x43e7('0xfe')])?_0x16c757[_0x43e7('0x66')]['name']:_0x16c757[_0x43e7('0xfe')][_0x43e7('0x2a')],_['isNil'](_0x16c757[_0x43e7('0x106')])?'':_0x16c757[_0x43e7('0x106')][_0x43e7('0x107')]()||'',_0x16c757['dialCutDigit']>0x0?_0xf9178f[_0x43e7('0xdd')][_0x43e7('0x109')](_0x16c757['dialCutDigit']):_0xf9178f[_0x43e7('0xdd')]);var _0x2ed5e0=_0x2be8c7[_0x43e7('0x65')](_0x16c757[_0x43e7('0x66')])?ut['getCallerId'](_0x16c757['Trunk'][_0x43e7('0x10a')],_0x16c757[_0x43e7('0x10b')],_0x16c757[_0x43e7('0x10c')]>0x0?ut[_0x43e7('0x10d')](_0x16c757['dialOriginateCallerIdNumber'],_0x16c757[_0x43e7('0x10c')]):_0x16c757[_0x43e7('0x10e')]):ut[_0x43e7('0x10f')](_[_0x43e7('0x50')](_0x16c757['TrunkBackup'])?_0x16c757[_0x43e7('0x66')][_0x43e7('0x10a')]:_0x16c757[_0x43e7('0xfe')][_0x43e7('0x10a')],_0x16c757[_0x43e7('0x10b')],_0x16c757['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x16c757['dialOriginateCallerIdNumber'],_0x16c757[_0x43e7('0x10c')]):_0x16c757[_0x43e7('0x10e')]);if(_0x2ed5e0){_0xbc6e18[_0x43e7('0x110')]=ut['extractCalleridName'](_0x2ed5e0);_0xbc6e18[_0x43e7('0x111')]=ut['extractCalleridNumber'](_0x2ed5e0);}var _0x1c7f6a=ut[_0x43e7('0x112')](_0x16c757,_0xf9178f,_0x2b7b33,_0x2ed5e0,_0x240478,_0xbc6e18);_[_0x43e7('0x113')](_0xbc6e18,ut[_0x43e7('0x114')](_0x1c7f6a));_0xbc6e18[_0x43e7('0x115')]=moment()[_0x43e7('0x28')]('YYYY-MM-DD\x20HH:mm:ss');_0x16c757[_0x43e7('0x116')]=_0x1c7f6a;var _0x202421=ut[_0x43e7('0x117')](_0xbc6e18,_0x16c757,_0x1c7f6a,_0xbc6e18[_0x43e7('0x7b')],_0x3bb7ab);return ami[_0x43e7('0x118')](_0x202421)[_0x43e7('0x4f')](function(_0x4637f6){_0x16c757[_0x43e7('0x2c')]+=0x1;logger[_0x43e7('0x25')](_0x43e7('0x119'),_0x240478,_0x43e7('0x95'),_0x16c757[_0x43e7('0x2a')],_0x43e7('0xcb'),_0x16c757['originated']);_0x2bb14d(_0x4637f6);})[_0x43e7('0x47')](function(_0x24d6e4){ut['logAgent'](_0xbc6e18,0xe,_0x43e7('0x11a'));rpcDb[_0x43e7('0xd3')](_0xbc6e18,'[originateFailure][logOriginateFailure]');_0x57f7ea(_0x24d6e4);});});};Preview[_0x43e7('0x34')][_0x43e7('0x11b')]=function(_0x2b9cf9){if(this['actions'][_0x2b9cf9['linkedid']]){this[_0x43e7('0x12')][_0x2b9cf9[_0x43e7('0x7c')]][_0x43e7('0x46')]=_0x2b9cf9[_0x43e7('0x46')];}};Preview[_0x43e7('0x34')][_0x43e7('0x15')]=function(_0x25b5a2){var _0xfe77ea=this;var _0x5d2cb0=this[_0x43e7('0x12')][_0x25b5a2[_0x43e7('0x11c')]];if(_0x5d2cb0){if(_0x5d2cb0[_0x43e7('0xe0')]&&this[_0x43e7('0xdf')][_0x5d2cb0[_0x43e7('0xe0')]]){ut[_0x43e7('0x11d')](_0x5d2cb0,this[_0x43e7('0xdf')][_0x5d2cb0[_0x43e7('0xe0')]][_0x43e7('0x2a')],this[_0x43e7('0xdf')][_0x5d2cb0[_0x43e7('0xe0')]]['id']);}var _0x218743=_['clone'](_0x5d2cb0);_0x218743[_0x43e7('0x81')]=moment()[_0x43e7('0x28')](_0x43e7('0x11e'));var _0x21c8b9=_0xfe77ea[_0x43e7('0x23')][_0x5d2cb0[_0x43e7('0x3d')]];if(ut['isFailure'](_0x25b5a2[_0x43e7('0x11f')])){if(_0x5d2cb0['unlockAgent']){rpcDb[_0x43e7('0xf3')](_0x5d2cb0[_0x43e7('0x7e')]);}if(_0x5d2cb0[_0x43e7('0x7b')]){rpcDb['disableContact'](_0x5d2cb0[_0x43e7('0x7e')]);}ami[_0x43e7('0x24')]('custom:agentringnoanswer',ut[_0x43e7('0x6d')](_0x5d2cb0,'rejected',this[_0x43e7('0x23')][_0x5d2cb0[_0x43e7('0x3d')]]));this[_0x43e7('0x120')](_0x218743,_0x21c8b9,_0x25b5a2);}else{_0x5d2cb0[_0x43e7('0x115')]=moment()['format'](_0x43e7('0x11e'));ut[_0x43e7('0xd0')](_0x218743,0x4,_0x43e7('0x8d'));rpcDb['createAgentHistory'](_0x218743,_0x43e7('0x121'));}}};Preview[_0x43e7('0x34')][_0x43e7('0x16')]=function(_0x431345){var _0x77c2f=this[_0x43e7('0x12')][_0x431345['linkedid']];var _0x3f057e;if(_0x77c2f){_0x3f057e=this['campaignsPreview'][_0x77c2f[_0x43e7('0x3d')]];logger[_0x43e7('0x25')]('[syncHangup][talking]',_0x431345[_0x43e7('0x7c')],_0x43e7('0x95'),_0x3f057e['name'],_0x43e7('0x3e'),_0x3f057e[_0x43e7('0x3f')]);}if(this[_0x43e7('0x12')][_0x431345[_0x43e7('0x7c')]]&&_0x431345['linkedid']!==_0x431345['uniqueid']){if(_0x431345[_0x43e7('0x122')]==='16'&&this[_0x43e7('0x12')][_0x431345[_0x43e7('0x7c')]][_0x43e7('0x40')]){this[_0x43e7('0x69')](_0x431345,_0x431345[_0x43e7('0x7c')],_0x431345[_0x43e7('0x122')]);}else if(this[_0x43e7('0x12')][_0x431345['linkedid']][_0x43e7('0x40')]){logger[_0x43e7('0x25')]('[syncHangup][talking][cause]',_0x431345[_0x43e7('0x7c')],_0x431345[_0x43e7('0x122')],_0x43e7('0x95'),_0x3f057e[_0x43e7('0x2a')],_0x43e7('0x3e'),_0x3f057e[_0x43e7('0x3f')]);this[_0x43e7('0x69')](_0x431345,_0x431345['linkedid'],_0x431345[_0x43e7('0x122')]);}}else if(_0x77c2f&&_['isNil'](_0x77c2f[_0x43e7('0x123')])&&_0x3f057e[_0x43e7('0x124')]&&_0x431345['linkedid']===_0x431345[_0x43e7('0x84')]&&_['isNil'](_0x431345[_0x43e7('0xcf')])&&_0x431345[_0x43e7('0x122')]==='16'&&_0x431345[_0x43e7('0x125')]==='6'&&_['isUndefined'](_0x77c2f['transfer'])){if(_0x77c2f[_0x43e7('0x7a')]){rpcDb[_0x43e7('0xf3')](_0x77c2f['idContact']);}if(_0x77c2f[_0x43e7('0x7b')]){rpcDb[_0x43e7('0x56')](_0x77c2f[_0x43e7('0x7e')]);}_0x431345['reason']='22';this[_0x43e7('0x120')](_0x77c2f,_0x3f057e,_0x431345);}else if(_0x77c2f&&_0x77c2f[_0x43e7('0x126')]){if(_0x431345[_0x43e7('0x122')]==='16'&&this['actions'][_0x431345[_0x43e7('0x7c')]][_0x43e7('0x40')]){logger[_0x43e7('0x25')](_0x43e7('0x127'),_0x431345[_0x43e7('0x7c')],_0x431345[_0x43e7('0x122')],'\x20Queue',_0x3f057e[_0x43e7('0x2a')],_0x43e7('0x3e'),_0x3f057e[_0x43e7('0x3f')]);this[_0x43e7('0x69')](_0x431345,_0x431345[_0x43e7('0x7c')],_0x431345[_0x43e7('0x122')]);}else if(this[_0x43e7('0x12')][_0x431345[_0x43e7('0x7c')]][_0x43e7('0x40')]){logger[_0x43e7('0x25')](_0x43e7('0x128'),_0x431345[_0x43e7('0x7c')],_0x431345['cause'],'\x20Queue',_0x3f057e['name'],'pTalking:\x20',_0x3f057e[_0x43e7('0x3f')]);this[_0x43e7('0x69')](_0x431345,_0x431345[_0x43e7('0x7c')],_0x431345[_0x43e7('0x122')]);}}};Preview[_0x43e7('0x34')][_0x43e7('0x1a')]=function(_0x51dc07){if(this['actions'][_0x51dc07[_0x43e7('0x129')]]&&_0x51dc07[_0x43e7('0x129')]!==_0x51dc07['destuniqueid']){this['callProgressDetectingCustomer'](_0x51dc07,_0x51dc07[_0x43e7('0x129')],_0x51dc07[_0x43e7('0xc0')]);}};Preview['prototype'][_0x43e7('0x19')]=function(_0x57bcab){if(this['actions'][_0x57bcab[_0x43e7('0x7c')]]&&_0x57bcab[_0x43e7('0x7c')]!==_0x57bcab['uniqueid']&&!this['actions'][_0x57bcab[_0x43e7('0x7c')]][_0x43e7('0x40')]){if(_0x57bcab[_0x43e7('0x122')]==='1'){this[_0x43e7('0x69')](_0x57bcab,_0x57bcab['linkedid'],_0x57bcab[_0x43e7('0x122')]);}}};Preview[_0x43e7('0x34')]['addVariable']=function(_0x560373,_0x4cdb87,_0x4eaf92){if(this[_0x43e7('0x12')][_0x560373]){if(_[_0x43e7('0x50')](this['actions'][_0x560373]['variables'])){this[_0x43e7('0x12')][_0x560373][_0x43e7('0x116')]={};}this[_0x43e7('0x12')][_0x560373][_0x43e7('0x116')][_0x4cdb87]=_0x4eaf92;}};Preview[_0x43e7('0x34')]['syncVarSet']=function(_0x3836e7){try{if(!_[_0x43e7('0x50')](_0x3836e7)){if(ut[_0x43e7('0x12a')](_[_0x43e7('0x12b')](_0x3836e7[_0x43e7('0x12c')])[0x0])){this['addVariable'](_0x3836e7[_0x43e7('0x84')],_[_0x43e7('0x12b')](_0x3836e7[_0x43e7('0x12c')])[0x0],_0x3836e7[_0x43e7('0x12d')]);}}}catch(_0x5564b4){logger[_0x43e7('0x12e')](_0x43e7('0x12f'),util[_0x43e7('0x130')](_0x5564b4,{'showHidden':![],'depth':null}));}};Preview[_0x43e7('0x34')][_0x43e7('0x1f')]=function(_0x308403){if(_0x308403){if(this['actions'][_0x308403[_0x43e7('0x131')]]){this[_0x43e7('0x12')][_0x308403[_0x43e7('0x131')]][_0x43e7('0x126')]=!![];}}};Preview['prototype'][_0x43e7('0x21')]=function(_0x48c784){if(_0x48c784){if(this[_0x43e7('0x12')][_0x48c784['transfererlinkedid']]){this[_0x43e7('0x12')][_0x48c784['transfererlinkedid']][_0x43e7('0x126')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0xf3cd=['dialPreviewAutoRecallMe','recallMe','clearZombieChannel','enqueue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','UserId','ListId','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[action]','size','getContactRecallMe','agentReadyId','isNil','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','then','logger2','[RecallMe]','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','loggedIn','CAMPAIGN_STATUS','NO_AGENTS_LOGGED','isTrunkReachable','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialNoSuchNumberRetryFrequency','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','actioncountonusuch','idContact','swapAdditionalPhones','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','uniqueid','\x20Queue','custom:agentconnect','buildObj','connect','acw','custom:agentConnectPreview','buildAcw','complete','outboundAnswerCallsDay','answered','decrementTalkink','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','[syncHangup][talking][decrement]','linkedid','BUSY','outboundBusyCallsDay','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','additional','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','countbusyretry','incrementPreviewCounters','NOANSWER','outboundNoAnswerCallsDay','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','verifyAdditionalPhones','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logAnswerAGI]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','[incrementPreviewCounters]\x20','checkInBlack','VoiceQueueId','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','execRun','unlockContact','disableContact','getContactPreview','recallme','validateContact','isValid','phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','addVariables','toLowerVariables','variables','variablesAction','[originated][increment]','OriginateError','syncNewExten','actionid','clone','response','rejected','starttime','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','filterKey','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','../dialer/utils','redis','prototype','tail','finally','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','paused','message','INACTIVE','logger','DEACTIVATED','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','dialActive','setMessage'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0xf3cd[_0x295314];return _0x584b0c;};'use strict';var util=require(_0xdf3c('0x0'));var _=require(_0xdf3c('0x1'));var uuid=require(_0xdf3c('0x2'));var moment=require(_0xdf3c('0x3'));var Redis=require(_0xdf3c('0x4'));var config=require(_0xdf3c('0x5'));var logger=require('../../../config/logger')(_0xdf3c('0x6'));var loggerAction=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var ami=require('../ami');var rpcDb=require(_0xdf3c('0x9'));var cmHopperAdditionalPhone=require(_0xdf3c('0xa'));var Action=require(_0xdf3c('0xb'));var ut=require(_0xdf3c('0xc'));var utils=require(_0xdf3c('0xd'));config[_0xdf3c('0xe')]=_['defaults'](config[_0xdf3c('0xe')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdf3c('0xe')]));var Sequence=function(){};Sequence[_0xdf3c('0xf')]['enqueue']=function(_0x1dba4c){this[_0xdf3c('0x10')]=this[_0xdf3c('0x10')]?this[_0xdf3c('0x10')][_0xdf3c('0x11')](_0x1dba4c):_0x1dba4c();};function Preview(_0x1c456b){this[_0xdf3c('0x12')]=new Sequence();this[_0xdf3c('0x13')]=_0x1c456b['voiceQueues'];this[_0xdf3c('0x14')]=_0x1c456b[_0xdf3c('0x14')];this[_0xdf3c('0x15')]={};this[_0xdf3c('0x16')]=_0x1c456b['agents'];this[_0xdf3c('0x17')]=0x0;ami['on'](_0xdf3c('0x18'),this[_0xdf3c('0x19')]['bind'](this));ami['on'](_0xdf3c('0x1a'),this[_0xdf3c('0x1b')][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x1d'),this[_0xdf3c('0x1e')][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x1f'),this[_0xdf3c('0x20')][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x21'),this['syncNewExten'][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x22'),this[_0xdf3c('0x23')][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x24'),this[_0xdf3c('0x25')][_0xdf3c('0x1c')](this));ami['on'](_0xdf3c('0x26'),this[_0xdf3c('0x27')][_0xdf3c('0x1c')](this));this[_0xdf3c('0x28')](this[_0xdf3c('0x13')]);}function emit(_0x25487c,_0x5d2390,_0x4d620f){io['to'](_0x25487c)[_0xdf3c('0x29')](_0x5d2390,_0x4d620f);}function emitVoiceQueueChannelRemove(_0x583ce4){logger[_0xdf3c('0x2a')](_0xdf3c('0x2b'),JSON[_0xdf3c('0x2c')](_0x583ce4));emit(util[_0xdf3c('0x2d')](_0xdf3c('0x2e'),_0x583ce4[_0xdf3c('0x2f')]),'voice_queue_channel:remove',_0x583ce4);io[_0xdf3c('0x29')](_0xdf3c('0x30'),_0x583ce4);}function notSendMessagesQueue(_0x13e3ca){if(_0x13e3ca[_0xdf3c('0x31')]){if(_0x13e3ca[_0xdf3c('0x32')]===0x0&&_0x13e3ca[_0xdf3c('0x33')]===0x0){_0x13e3ca[_0xdf3c('0x31')]=![];_0x13e3ca[_0xdf3c('0x34')]=0x0;_0x13e3ca[_0xdf3c('0x35')]=0x0;_0x13e3ca[_0xdf3c('0x36')]=utils['CAMPAIGN_STATUS'][_0xdf3c('0x37')];ut[_0xdf3c('0x38')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x13e3ca[_0xdf3c('0x2f')]+'\x20is\x20not\x20active');}else{_0x13e3ca['message']=utils['CAMPAIGN_STATUS'][_0xdf3c('0x39')];ut[_0xdf3c('0x38')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x13e3ca['name']+_0xdf3c('0x3a'));}}}Preview[_0xdf3c('0xf')][_0xdf3c('0x28')]=function(){var _0x1ccdd4=this;setInterval(function(){_0x1ccdd4['syncCampaigns']();},0x7cf);};Preview[_0xdf3c('0xf')][_0xdf3c('0x3b')]=function(){var _0x5386bf=this['campaignsPreview'];this[_0xdf3c('0x17')]+=0x1;for(var _0x46f0e3 in _0x5386bf){if(_0x5386bf[_0xdf3c('0x3c')](_0x46f0e3)&&(_0x5386bf[_0x46f0e3]['dialMethod']===_0xdf3c('0x6')||_0x5386bf[_0x46f0e3][_0xdf3c('0x3d')]===_0xdf3c('0x3e'))&&_0x5386bf[_0x46f0e3][_0xdf3c('0x3f')]==='outbound'){if(this[_0xdf3c('0x17')]>0x7){this[_0xdf3c('0x17')]=0x0;this['clearZombieChannels']();}}if(_0x5386bf[_0xdf3c('0x3c')](_0x46f0e3)&&_0x5386bf[_0x46f0e3][_0xdf3c('0x3d')]===_0xdf3c('0x6')&&_0x5386bf[_0x46f0e3][_0xdf3c('0x3f')]==='outbound'){if(_0x5386bf[_0x46f0e3][_0xdf3c('0x40')]){this[_0xdf3c('0x41')](_0x5386bf[_0x46f0e3]);if(_0x5386bf[_0x46f0e3][_0xdf3c('0x42')])this[_0xdf3c('0x43')](_0x5386bf[_0x46f0e3]);}else{notSendMessagesQueue(_0x5386bf[_0x46f0e3]);}}}};Preview['prototype'][_0xdf3c('0x44')]=function(_0x3e7a4b){var _0x5ddd21=this;this['sequence'][_0xdf3c('0x45')](function(){if(!_['isNil'](_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b])){loggerAction['info']('[clearZombieChannels][talking]',_0x3e7a4b,'Queue',_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')],_0xdf3c('0x47'),JSON[_0xdf3c('0x2c')](_0x5ddd21['campaignsPreview'][_0x5ddd21['actions'][_0x3e7a4b][_0xdf3c('0x46')]]['originated']),_0xdf3c('0x48'),JSON[_0xdf3c('0x2c')](_0x5ddd21[_0xdf3c('0x13')][_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')]][_0xdf3c('0x33')]),JSON[_0xdf3c('0x2c')](_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x49')]),JSON['stringify'](_[_0xdf3c('0x4a')](_0x5ddd21['actions'][_0x3e7a4b],['contactId',_0xdf3c('0x4b'),'VoiceQueueId',_0xdf3c('0x4c')])));return ami['Action']({'action':_0xdf3c('0x4d'),'channel':_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x4e')]})[_0xdf3c('0x4f')](function(_0x3098cb){if(_0x3098cb[_0xdf3c('0x36')]===_0xdf3c('0x50')){setTimeout(function(){if(_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b]){ut[_0xdf3c('0x51')](_0x5ddd21[_0xdf3c('0x13')][_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')]],'[clearZombieChannel]');if(_0x5ddd21['actions'][_0x3e7a4b][_0xdf3c('0x49')]===!![]){ut['decrementTalkink'](_0x5ddd21[_0xdf3c('0x13')][_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')]],_0xdf3c('0x52'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x3e7a4b,_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')]);}ut[_0xdf3c('0x53')]('[Dialer][checkChannel][Preview]'+_0x3e7a4b,_0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b][_0xdf3c('0x46')]);delete _0x5ddd21[_0xdf3c('0x15')][_0x3e7a4b];}},0x2328);}});}});};Preview[_0xdf3c('0xf')]['clearZombieChannels']=function(){var _0x127685=this;loggerAction[_0xdf3c('0x2a')](_0xdf3c('0x54'),_[_0xdf3c('0x55')](this[_0xdf3c('0x15')]));for(var _0x55849e in this[_0xdf3c('0x15')]){if(_0x127685[_0xdf3c('0x15')][_0xdf3c('0x3c')](_0x55849e)){_0x127685[_0xdf3c('0x44')](_0x55849e);}}};Preview[_0xdf3c('0xf')][_0xdf3c('0x43')]=function(_0x555389){var _0x4d6349=this;rpcDb[_0xdf3c('0x56')](_0x555389['id'],ut[_0xdf3c('0x57')](this['agents']))['then'](function(_0x269723){if(!_[_0xdf3c('0x58')](_0x269723)){for(var _0x46b2bd=0x0;_0x46b2bd<_0x269723[_0xdf3c('0x59')];_0x46b2bd+=0x1){if(ut[_0xdf3c('0x5a')](_0x269723[_0x46b2bd][_0xdf3c('0x5b')])<_0x555389[_0xdf3c('0x5c')]*0x3c){if(_0x269723[_0x46b2bd][_0xdf3c('0x5d')]&&!_0x269723[_0x46b2bd][_0xdf3c('0x5d')]['voicePause']){_0x4d6349[_0xdf3c('0x5e')](_0x269723[_0x46b2bd]['id'])[_0xdf3c('0x5f')](ut[_0xdf3c('0x60')](_0xdf3c('0x61')))[_0xdf3c('0x4f')](ut[_0xdf3c('0x60')](_0xdf3c('0x61')));}else{rpcDb['disableContact'](_0x269723[_0x46b2bd]['id']);}}else{var _0x1751a8=new Action(_0x269723[_0x46b2bd],_0x555389);_0x1751a8['starttime']=moment()[_0xdf3c('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');_0x555389[_0xdf3c('0x62')]+=0x1;ut[_0xdf3c('0x63')](_0x1751a8,0x17,_0xdf3c('0x64'));if(_0x555389[_0xdf3c('0x65')]){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x269723[_0x46b2bd]));rpcDb['createCustomerHistory'](_0x1751a8,_0xdf3c('0x66'));}else{ut['logCustomer'](_0x1751a8,0x16,_0xdf3c('0x67'));rpcDb[_0xdf3c('0x68')](_0x1751a8,_0xdf3c('0x69'));rpcDb[_0xdf3c('0x6a')](_0x1751a8,_0xdf3c('0x69'));}}}}})['catch'](ut['logger2'](_0xdf3c('0x6b')));};Preview[_0xdf3c('0xf')]['setMessage']=function(_0x3b215d){_0x3b215d[_0xdf3c('0x31')]=!![];if(ut[_0xdf3c('0x6c')](_0x3b215d[_0xdf3c('0x6d')])){_0x3b215d[_0xdf3c('0x36')]=utils[_0xdf3c('0x6e')][_0xdf3c('0x6f')];}else if(!ut['isActive'](_0x3b215d['dialActive'])){_0x3b215d[_0xdf3c('0x36')]=utils[_0xdf3c('0x6e')][_0xdf3c('0x37')];}else if(!this[_0xdf3c('0x70')](_0x3b215d[_0xdf3c('0x71')])){if(!this[_0xdf3c('0x70')](_0x3b215d[_0xdf3c('0x72')])){_0x3b215d[_0xdf3c('0x36')]=utils[_0xdf3c('0x6e')][_0xdf3c('0x73')];}else{_0x3b215d[_0xdf3c('0x36')]=utils['CAMPAIGN_STATUS'][_0xdf3c('0x74')];}}else{_0x3b215d['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];}};Preview['prototype']['callProgressDetectingCustomer']=function(_0x1afc6c,_0x1c18a9,_0x5c53cd){var _0x4257c4=this;var _0x32427e=this['actions'][_0x1c18a9];var _0xa8dddb=this[_0xdf3c('0x13')][_0x32427e[_0xdf3c('0x46')]];var _0x1389e0;var _0x396461=![];var _0x28f387=0x2;var _0xb54629=0x3;if(_0xa8dddb){switch(_0x5c53cd){case'1':_0xa8dddb[_0xdf3c('0x75')]+=0x1;_0x32427e[_0xdf3c('0x76')]+=0x1;_0x32427e[_0xdf3c('0x77')]=ut[_0xdf3c('0x78')](_0x32427e);ut['logCustomer'](_0x32427e,0x0,_0xdf3c('0x79'));ami[_0xdf3c('0x29')](_0xdf3c('0x7a'),ut['buildObj'](_0x32427e,_0xdf3c('0x7b')));rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0x7c'));_0x4257c4['verifyAdditionalPhones'](_0x32427e,'0',_0xa8dddb)[_0xdf3c('0x5f')](function(_0x13bf69){_0x396461=_0x13bf69['additional']==0x1;_0x28f387=_0xa8dddb[_0xdf3c('0x7d')];_0xb54629=_0xa8dddb['callAdditionalPhoneAfterMin'];if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,_0xdf3c('0x81'));}else{if(_0x32427e[_0xdf3c('0x76')]>=_0xa8dddb[_0xdf3c('0x82')]){rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0x81'));}else{rpcDb[_0xdf3c('0x83')](ut[_0xdf3c('0x84')](_0x32427e,_0xdf3c('0x76'),_0xa8dddb[_0xdf3c('0x7d')]),_0x32427e[_0xdf3c('0x85')],_0x32427e[_0xdf3c('0x86')]);}}delete this[_0xdf3c('0x15')][_0x1afc6c['linkedid']];}else{_0x32427e['countnosuchnumberretry']++;logger[_0xdf3c('0x2a')](_0xdf3c('0x87'),_0x32427e[_0xdf3c('0x76')]);logger['info']('id',_0x32427e[_0xdf3c('0x88')]);_0x4257c4['incrementPreviewCounters']({'id':_0x32427e['idContact'],'field':{'countnosuchnumberretry':_0x32427e[_0xdf3c('0x76')]}})[_0xdf3c('0x5f')](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case _0xdf3c('0x8a'):var _0x9b7034=moment()[_0xdf3c('0x2d')](_0xdf3c('0x8b'));_0x32427e[_0xdf3c('0x8c')]=_0x9b7034;_0x32427e[_0xdf3c('0x8d')]=_0x9b7034;_0x32427e[_0xdf3c('0x49')]=!![];_0xa8dddb[_0xdf3c('0x33')]+=0x1;logger[_0xdf3c('0x2a')]('[syncHangup][talking][increment]',_0x32427e[_0xdf3c('0x8e')],_0xdf3c('0x8f'),_0xa8dddb[_0xdf3c('0x2f')],_0xdf3c('0x48'),_0xa8dddb[_0xdf3c('0x33')]);ami['emit'](_0xdf3c('0x90'),ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0x92'),this[_0xdf3c('0x13')][_0x32427e[_0xdf3c('0x46')]]));if(_0xa8dddb[_0xdf3c('0x93')]){ami[_0xdf3c('0x29')](_0xdf3c('0x94'),ut[_0xdf3c('0x95')](_0x32427e));}break;case'16':ami[_0xdf3c('0x29')]('custom:agentcomplete',ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0x96'),this[_0xdf3c('0x13')][_0x32427e[_0xdf3c('0x46')]]));emitVoiceQueueChannelRemove(ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0x96')));_0xa8dddb[_0xdf3c('0x97')]+=0x1;_0xa8dddb['total']+=0x1;_0xa8dddb[_0xdf3c('0x98')]+=0x1;ut[_0xdf3c('0x99')](_0xa8dddb,'[16]');_0x32427e['countglobal']=ut[_0xdf3c('0x78')](_0x32427e);ut[_0xdf3c('0x63')](_0x32427e,0x4,_0xdf3c('0x9a'));rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0x9b'));rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0x9c'));rpcDb[_0xdf3c('0x9d')](_0x32427e);_0xa8dddb['sumDuration']+=_0x32427e[_0xdf3c('0x9e')];_0xa8dddb[_0xdf3c('0x9f')]+=_0x32427e[_0xdf3c('0x9e')];logger['info'](_0xdf3c('0xa0'),_0x32427e[_0xdf3c('0x8e')],_0xdf3c('0x8f'),_0xa8dddb['name'],_0xdf3c('0x48'),_0xa8dddb[_0xdf3c('0x33')]);delete this[_0xdf3c('0x15')][_0x1afc6c[_0xdf3c('0xa1')]];break;case _0xdf3c('0xa2'):_0xa8dddb[_0xdf3c('0xa3')]+=0x1;_0x32427e['countbusyretry']+=0x1;_0x32427e['countglobal']=ut['totalGlobal'](_0x32427e);ut['logCustomer'](_0x32427e,0x5,'Busy');_0x28f387=_0xa8dddb[_0xdf3c('0xa4')];_0xb54629=_0xa8dddb[_0xdf3c('0xa5')];ami[_0xdf3c('0x29')]('custom:agentbusy',ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0xa6')));rpcDb[_0xdf3c('0x68')](_0x32427e,'[callProgressDetectingCustomer][logBusy]');_0x4257c4['verifyAdditionalPhones'](_0x32427e,'5',_0xa8dddb)[_0xdf3c('0x5f')](function(_0x4e3517){_0x396461=_0x4e3517[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut['totalGlobal'](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x32427e['countbusyretry']>=_0xa8dddb[_0xdf3c('0xa8')]){rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0xa9'));}else{rpcDb[_0xdf3c('0x83')](ut[_0xdf3c('0x84')](_0x32427e,_0xdf3c('0xaa'),_0xa8dddb['dialBusyRetryFrequency']),_0x32427e[_0xdf3c('0x85')],_0x32427e['activeContact']);}}}else{_0x32427e[_0xdf3c('0xaa')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e[_0xdf3c('0x88')],'field':{'countbusyretry':_0x32427e[_0xdf3c('0xaa')]}})[_0xdf3c('0x5f')](function(){_0x4257c4['swapAdditionalPhones'](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case _0xdf3c('0xac'):_0xa8dddb[_0xdf3c('0xad')]+=0x1;_0x32427e['countnoanswerretry']+=0x1;_0x32427e['countglobal']=ut['totalGlobal'](_0x32427e);ut['logCustomer'](_0x32427e,0x3,_0xdf3c('0xae'));_0x28f387=_0xa8dddb[_0xdf3c('0xaf')];_0xb54629=_0xa8dddb[_0xdf3c('0xa5')];var _0x391042=ut[_0xdf3c('0xb0')](_0x32427e,_0xa8dddb);ami[_0xdf3c('0x29')]('custom:agentnoanswer',_0x391042);rpcDb[_0xdf3c('0x68')](_0x32427e,'[callProgressDetectingCustomer][logNoAnswer]');_0x4257c4[_0xdf3c('0xb1')](_0x32427e,'3',_0xa8dddb)[_0xdf3c('0x5f')](function(_0x2e5f82){_0x396461=_0x2e5f82[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,_0xdf3c('0xb2'));}else{if(_0x32427e[_0xdf3c('0xb3')]>=_0xa8dddb[_0xdf3c('0xb4')]){rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0xb5'));}else{rpcDb['rescheduleContact'](ut[_0xdf3c('0x84')](_0x32427e,_0xdf3c('0xb3'),_0xa8dddb[_0xdf3c('0xaf')]),_0x32427e[_0xdf3c('0x85')],_0x32427e['activeContact']);}}}else{_0x32427e[_0xdf3c('0xb3')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e['idContact'],'field':{'countnoanswerretry':_0x32427e['countnoanswerretry']}})[_0xdf3c('0x5f')](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case _0xdf3c('0xb6'):_0xa8dddb[_0xdf3c('0xb7')]+=0x1;_0x32427e['countcongestionretry']+=0x1;_0x32427e[_0xdf3c('0x77')]=ut[_0xdf3c('0x78')](_0x32427e);ut[_0xdf3c('0x63')](_0x32427e,0x8,_0xdf3c('0xb8'));_0x28f387=_0xa8dddb[_0xdf3c('0xb9')];_0xb54629=_0xa8dddb[_0xdf3c('0xa5')];ami['emit'](_0xdf3c('0xba'),ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0xbb')));rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0xbc'));_0x4257c4['verifyAdditionalPhones'](_0x32427e,'8',_0xa8dddb)['then'](function(_0x5c99f2){_0x396461=_0x5c99f2[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,_0xdf3c('0xbd'));}else{if(_0x32427e[_0xdf3c('0xbe')]>=_0xa8dddb['dialCongestionMaxRetry']){rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0xbc'));}else{rpcDb[_0xdf3c('0x83')](ut[_0xdf3c('0x84')](_0x32427e,_0xdf3c('0xbe'),_0xa8dddb[_0xdf3c('0xa4')]),_0x32427e['unlockAgent'],_0x32427e[_0xdf3c('0x86')]);}}}else{_0x32427e[_0xdf3c('0xbe')]++;_0x4257c4['incrementPreviewCounters']({'id':_0x32427e['idContact'],'field':{'countcongestionretry':_0x32427e[_0xdf3c('0xbe')]}})['then'](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case'CANCEL':_0xa8dddb[_0xdf3c('0xbf')]+=0x1;_0x32427e[_0xdf3c('0xc0')]+=0x1;_0x32427e[_0xdf3c('0x77')]=ut[_0xdf3c('0x78')](_0x32427e);ut[_0xdf3c('0x63')](_0x32427e,0x14,_0xdf3c('0xc1'));_0x28f387=_0xa8dddb['dialAgentRejectRetryFrequency'];_0xb54629=_0xa8dddb[_0xdf3c('0xa5')];ami[_0xdf3c('0x29')](_0xdf3c('0xc2'),ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0xc3')));rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0xc4'));_0x4257c4['verifyAdditionalPhones'](_0x32427e,'20',_0xa8dddb)['then'](function(_0x1745fd){_0x396461=_0x1745fd[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb['dialGlobalMaxRetry']){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x1389e0,_0xdf3c('0xc5'));}else{if(_0x32427e[_0xdf3c('0xc0')]>=_0xa8dddb['dialAgentRejectMaxRetry']){rpcDb[_0xdf3c('0x6a')](_0x32427e,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xdf3c('0x83')](ut['scheduledAt'](_0x32427e,_0xdf3c('0xc0'),_0xa8dddb[_0xdf3c('0xc6')]),_0x32427e[_0xdf3c('0x85')],_0x32427e[_0xdf3c('0x86')]);}}}else{_0x32427e[_0xdf3c('0xb3')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e[_0xdf3c('0x88')],'field':{'countnoanswerretry':_0x32427e[_0xdf3c('0xb3')]}})[_0xdf3c('0x5f')](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case _0xdf3c('0xc7'):_0xa8dddb[_0xdf3c('0xc8')]+=0x1;_0x32427e[_0xdf3c('0xc9')]+=0x1;_0x32427e['countglobal']=ut[_0xdf3c('0x78')](_0x32427e);ut[_0xdf3c('0x63')](_0x32427e,0xb,_0xdf3c('0xca'));rpcDb['createCustomerHistory'](_0x32427e,_0xdf3c('0xcb'));_0x4257c4[_0xdf3c('0xb1')](_0x32427e,'11',_0xa8dddb)[_0xdf3c('0x5f')](function(_0x6e1899){_0x396461=_0x6e1899[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,_0xdf3c('0xcb'));}else{if(_0x32427e['countabandonedetry']>=_0xa8dddb[_0xdf3c('0xcc')]){rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0xcb'));}else{rpcDb[_0xdf3c('0x83')](ut[_0xdf3c('0x84')](_0x32427e,_0xdf3c('0xc9'),_0xa8dddb[_0xdf3c('0xcd')]),_0x32427e[_0xdf3c('0x85')],_0x32427e[_0xdf3c('0x86')]);}}}else{_0x32427e[_0xdf3c('0xb3')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e[_0xdf3c('0x88')],'field':{'countnoanswerretry':_0x32427e['countnoanswerretry']}})[_0xdf3c('0x5f')](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});break;case'18':_0xa8dddb[_0xdf3c('0xce')]+=0x1;_0x32427e[_0xdf3c('0xcf')]+=0x1;_0x32427e[_0xdf3c('0x77')]=ut[_0xdf3c('0x78')](_0x32427e);ut['logCustomer'](_0x32427e,0x12,_0x1afc6c[_0xdf3c('0xd0')]||_0x1afc6c[_0xdf3c('0xd1')]);ami[_0xdf3c('0x29')](_0xdf3c('0xd2'),ut['buildObj'](_0x32427e,_0xdf3c('0xd3')));rpcDb[_0xdf3c('0x68')](_0x32427e,'[callProgressDetectingCustomer][hangupInAMD]');_0x4257c4[_0xdf3c('0xb1')](_0x32427e,'18',_0xa8dddb)['then'](function(_0x418021){_0x396461=_0x418021[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut['totalGlobal'](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut[_0xdf3c('0x7f')](_0x32427e,0x12,_0xdf3c('0x80'));rpcDb['createCustomerFinal'](_0x1389e0,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0xdf3c('0x6a')](_0x32427e,'[callProgressDetectingCustomer][hangupInAMD]');}}else{_0x32427e[_0xdf3c('0xb3')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e[_0xdf3c('0x88')],'field':{'countnoanswerretry':_0x32427e[_0xdf3c('0xb3')]}})['then'](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)[_0xdf3c('0x5f')](function(){});});}});delete this['actions'][_0x1afc6c[_0xdf3c('0xa1')]];break;case'19':_0xa8dddb['outboundUnknownCallsDay']+=0x1;_0x32427e[_0xdf3c('0x77')]=ut[_0xdf3c('0x78')](_0x32427e);ut['logCustomer'](_0x32427e,0x13,_0x1afc6c['cause-txt']||_0x1afc6c[_0xdf3c('0xd1')]);ami['emit'](_0xdf3c('0xd2'),ut[_0xdf3c('0x91')](_0x32427e,_0xdf3c('0xd3')));rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0xd4'));_0x4257c4[_0xdf3c('0xb1')](_0x32427e,'18',_0xa8dddb)[_0xdf3c('0x5f')](function(_0x1d95d9){_0x396461=_0x1d95d9[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut['cloneAction'](_0x32427e,0xf,_0xdf3c('0x80'));rpcDb[_0xdf3c('0x6a')](_0x1389e0,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0xdf3c('0x6a')](_0x32427e,_0xdf3c('0xd4'));}}else{_0x32427e[_0xdf3c('0xb3')]++;_0x4257c4[_0xdf3c('0xab')]({'id':_0x32427e[_0xdf3c('0x88')],'field':{'countnoanswerretry':_0x32427e[_0xdf3c('0xb3')]}})['then'](function(){_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)['then'](function(){});});}});delete this[_0xdf3c('0x15')][_0x1afc6c[_0xdf3c('0xa1')]];break;default:if(_0x32427e[_0xdf3c('0x49')]){ut[_0xdf3c('0x99')](_0xa8dddb,_0xdf3c('0xd5'));ut[_0xdf3c('0x53')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0xa8dddb[_0xdf3c('0x2f')],_0x1afc6c);}_0xa8dddb[_0xdf3c('0xce')]+=0x1;_0x32427e['countglobal']=ut[_0xdf3c('0x78')](_0x32427e);ut[_0xdf3c('0x63')](_0x32427e,0xc,_0x1afc6c[_0xdf3c('0xd0')]||_0x1afc6c[_0xdf3c('0xd1')]);_0x28f387=_0xa8dddb[_0xdf3c('0xc6')];_0xb54629=_0xa8dddb[_0xdf3c('0xa5')];rpcDb[_0xdf3c('0x68')](_0x32427e,_0xdf3c('0xd6'));_0x4257c4['verifyAdditionalPhones'](_0x32427e,'20',_0xa8dddb)['then'](function(_0x44dc52){_0x396461=_0x44dc52[_0xdf3c('0xa7')]==0x1;if(!_0x396461){if(ut[_0xdf3c('0x78')](_0x32427e)>=_0xa8dddb[_0xdf3c('0x7e')]){_0x1389e0=ut['cloneAction'](_0x32427e,0xf,'Global');rpcDb[_0xdf3c('0x6a')](_0x1389e0,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xdf3c('0x6a')](_0x32427e,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xdf3c('0x15')][_0x1afc6c[_0xdf3c('0xa1')]];}else{_0x4257c4[_0xdf3c('0x89')](_0x32427e,_0x28f387,_0xb54629)['then'](function(){});}});}if(!(_0x32427e[_0xdf3c('0x49')]&&_0x5c53cd==='16')){ut[_0xdf3c('0x51')](_0xa8dddb,'[callProgressDetectingCustomer]');logger['info'](_0xdf3c('0xd7'),_0x32427e[_0xdf3c('0x8e')],_0xdf3c('0x8f'),_0xa8dddb[_0xdf3c('0x2f')],_0xdf3c('0x47'),_0xa8dddb[_0xdf3c('0x32')]);}if(_0x5c53cd!==_0xdf3c('0x8a')){delete this['actions'][_0x1afc6c['linkedid']];delete this[_0xdf3c('0x15')][_0x1afc6c[_0xdf3c('0xd8')]];}_0xa8dddb[_0xdf3c('0xd9')]=!![];}};Preview[_0xdf3c('0xf')][_0xdf3c('0xda')]=function(_0x268aa9,_0xa10e73,_0x828c9c){if(_[_0xdf3c('0xdb')](_0xa10e73)&&_0xdf3c('0xdc')!==typeof _0xa10e73){return;}if(_[_0xdf3c('0xdb')](_0x828c9c)&&_0xdf3c('0xdc')!==typeof _0x828c9c){return;}switch(_0x828c9c[_0xdf3c('0xdd')]){case'0':ut[_0xdf3c('0xde')](_0x268aa9,0x0,_0xdf3c('0x79'));rpcDb[_0xdf3c('0xdf')](_0x268aa9,_0xdf3c('0xe0'));break;case'3':ut[_0xdf3c('0xde')](_0x268aa9,0x3,_0xdf3c('0xae'));rpcDb['createAgentHistory'](_0x268aa9,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xdf3c('0xde')](_0x268aa9,0x5,'Busy');rpcDb['createAgentHistory'](_0x268aa9,_0xdf3c('0xe1'));break;case'8':ut['logAgent'](_0x268aa9,0x8,_0xdf3c('0xb8'));rpcDb[_0xdf3c('0xdf')](_0x268aa9,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut['logAgent'](_0x268aa9,0x16,'AnswerAGI');rpcDb[_0xdf3c('0xdf')](_0x268aa9,_0xdf3c('0xe2'));break;default:ut[_0xdf3c('0xde')](_0x268aa9,0xc,_0x828c9c['reason']);rpcDb[_0xdf3c('0xdf')](_0x268aa9,'[callProgressDetectingAgent][logCongestion]');}ut[_0xdf3c('0x51')](_0xa10e73,'[callProgressDetectingAgent]');logger['info'](_0xdf3c('0xe3'),_0x268aa9[_0xdf3c('0x8e')],_0xdf3c('0x8f'),_0xa10e73[_0xdf3c('0x2f')],_0xdf3c('0x47'),_0xa10e73[_0xdf3c('0x32')]);delete this['actions'][_0x268aa9['uniqueid']];};Preview[_0xdf3c('0xf')]['verifyAdditionalPhones']=function(_0x1a5e31,_0x14244a,_0x18e639){return cmHopperAdditionalPhone[_0xdf3c('0xb1')](_0x1a5e31,_0x14244a,_0x18e639)[_0xdf3c('0x4f')](logger[_0xdf3c('0x2a')](_0xdf3c('0xe4')));};Preview['prototype']['swapAdditionalPhones']=function(_0x40fdd4,_0x1446af,_0x3fa455){return cmHopperAdditionalPhone[_0xdf3c('0x89')](_0x40fdd4,_0x1446af,_0x3fa455)['catch'](logger[_0xdf3c('0x2a')](_0xdf3c('0xe5')));};Preview[_0xdf3c('0xf')][_0xdf3c('0xab')]=function(_0x33ef58){return Promise[_0xdf3c('0xe6')]()['then'](cmHopperAdditionalPhone[_0xdf3c('0xab')](_0x33ef58))[_0xdf3c('0x4f')](logger['info'](_0xdf3c('0xe7')));};Preview[_0xdf3c('0xf')][_0xdf3c('0xe8')]=function(_0x511a40,_0x87ec92,_0x1ebfff,_0x3487cf,_0xb1c08d){var _0x3100fa=this;return new Promise(function(_0x147769,_0x3c91ba){if(_[_0xdf3c('0x58')](_0x87ec92)||_[_0xdf3c('0x58')](_0x87ec92['Contact'])||_[_0xdf3c('0x58')](_0x87ec92['phone'])||_[_0xdf3c('0x58')](_0x87ec92[_0xdf3c('0xe9')])){_0x3c91ba(ut[_0xdf3c('0x36')](_0xdf3c('0xea'),_0x3487cf,_0xb1c08d));return;}var _0x90c66=uuid['v4']();var _0x34344b=_0x3100fa[_0xdf3c('0x13')][_0x87ec92[_0xdf3c('0xeb')][_0xdf3c('0x2f')]];var _0x36a8c7=_0x1ebfff?_0x3100fa[_0xdf3c('0x16')][_0x1ebfff]['id']:undefined;_0x3100fa['actions'][_0x90c66]=new Action(_0x87ec92,_0x34344b,_0x90c66,_0x1ebfff,_0x36a8c7);var _0x379996=_0x3100fa[_0xdf3c('0x15')][_0x90c66];_0x379996['unlockAgent']=_0x3487cf;_0x379996[_0xdf3c('0x86')]=_0xb1c08d;_0x379996[_0xdf3c('0xec')]=_0x1ebfff;if(_[_0xdf3c('0xed')](_0x511a40)){_0x3100fa[_0xdf3c('0xee')](_0x379996,_0x34344b,_0x87ec92,_0x1ebfff)['then'](function(_0x2670ef){logger[_0xdf3c('0x2a')](_0xdf3c('0xef'),'Queue:\x20'+_0x379996['queue']+'\x20IdHopper:\x20'+_0x379996[_0xdf3c('0x88')],JSON[_0xdf3c('0x2c')](_0x2670ef));ami[_0xdf3c('0x29')](_0xdf3c('0xf0'),ut[_0xdf3c('0x91')](_0x379996,_0xdf3c('0xf1'),_0x3100fa[_0xdf3c('0x13')][_0x379996[_0xdf3c('0x46')]]));_0x147769(ut['message'](_0xdf3c('0xf2')));})['catch'](function(_0x359366){ut[_0xdf3c('0x38')](_0xdf3c('0xf3'),_0x359366);_0x3c91ba(ut[_0xdf3c('0x36')](_0xdf3c('0xf4'),_0x3487cf,_0xb1c08d));});}else{_0x34344b[_0xdf3c('0xf5')]+=0x1;ut['logBlacklist'](_0x379996);rpcDb[_0xdf3c('0xf6')](_0x379996,_0xdf3c('0xf7'));delete _0x3100fa['actions'][_0x90c66];_0x3c91ba(ut[_0xdf3c('0x36')](_0xdf3c('0xf8'),_0x3487cf,_0xb1c08d));}});};Preview[_0xdf3c('0xf')][_0xdf3c('0x70')]=function(_0x4e66a3){return!_[_0xdf3c('0x58')](_0x4e66a3)&&!_['isNil'](_0x4e66a3[_0xdf3c('0x2f')])&&!_[_0xdf3c('0x58')](_0x4e66a3[_0xdf3c('0xf9')])&&_0x4e66a3[_0xdf3c('0xf9')]&&!_[_0xdf3c('0x58')](this[_0xdf3c('0x14')][util['format']('SIP/%s',_0x4e66a3['name'])])&&!_[_0xdf3c('0x58')](this[_0xdf3c('0x14')][util['format']('SIP/%s',_0x4e66a3[_0xdf3c('0x2f')])]['status'])&&(this['trunks'][util['format'](_0xdf3c('0xfa'),_0x4e66a3[_0xdf3c('0x2f')])][_0xdf3c('0x4d')]==='reachable'||this[_0xdf3c('0x14')][util['format'](_0xdf3c('0xfa'),_0x4e66a3[_0xdf3c('0x2f')])][_0xdf3c('0x4d')]===_0xdf3c('0xfb'));};Preview[_0xdf3c('0xf')][_0xdf3c('0x5e')]=function(_0xd5aa90,_0x2eef6f){return this[_0xdf3c('0xfc')](_0xd5aa90,_0x2eef6f)['then'](function(_0x17add4){return _[_0xdf3c('0x4a')](_0x17add4,['message']);})[_0xdf3c('0x4f')](function(_0x1e8646){if(_0x1e8646['unlock']){rpcDb[_0xdf3c('0xfd')](_0xd5aa90);}if(_0x1e8646['active']){rpcDb[_0xdf3c('0xfe')](_0xd5aa90);}throw _[_0xdf3c('0x4a')](_0x1e8646,[_0xdf3c('0x36')]);});};Preview[_0xdf3c('0xf')][_0xdf3c('0xfc')]=function(_0x1086a3,_0x232b34){var _0x41b5f4=this;var _0x171231,_0x2b27de;return rpcDb[_0xdf3c('0xff')](_0x1086a3)[_0xdf3c('0x5f')](function(_0x2a4dbf){if(!_[_0xdf3c('0x58')](_0x2a4dbf[0x0])){_0x2b27de=_0x2a4dbf[0x0][_0xdf3c('0x100')]?![]:!![];_0x171231=_0x2a4dbf[0x0][_0xdf3c('0x100')]?!![]:![];_0x171231=_0x232b34?!![]:_0x171231;}var _0x542a02=_0x41b5f4[_0xdf3c('0x101')](_0x2a4dbf);if(_0x542a02[_0xdf3c('0x102')]){rpcDb['checkIsBlackList'](_[_0xdf3c('0x4a')](_0x2a4dbf[0x0],[_0xdf3c('0xe9'),_0xdf3c('0x103')]))[_0xdf3c('0x5f')](function(_0x518290){_0x41b5f4[_0xdf3c('0xe8')](_0x518290,_0x2a4dbf[0x0],_0x232b34,_0x2b27de,_0x171231)[_0xdf3c('0x5f')](function(_0x5b25d7){return _0x5b25d7;})[_0xdf3c('0x4f')](function(_0x37b1a6){throw _0x37b1a6;});})['catch'](function(_0x59c8f9){ut[_0xdf3c('0x38')](_0xdf3c('0x104'),_0x59c8f9);throw ut[_0xdf3c('0x36')]('Call\x20unsuccessful',_0x2b27de,_0x171231);});}else{throw ut[_0xdf3c('0x36')](_0x542a02['message'],_0x2b27de,_0x171231);}})[_0xdf3c('0x4f')](function(_0x246958){ut[_0xdf3c('0x38')](_0xdf3c('0x105'),_0x246958);throw ut[_0xdf3c('0x36')](_0xdf3c('0x106'),![],!![]);});};Preview['prototype'][_0xdf3c('0x101')]=function(_0x47f9d1){if(_[_0xdf3c('0x58')](_0x47f9d1)||_[_0xdf3c('0xed')](_0x47f9d1)||!_[_0xdf3c('0x58')](_0x47f9d1[0x0]['Agent'])&&_[_0xdf3c('0x58')](_0x47f9d1[0x0]['Agent'][_0xdf3c('0x2f')])){ut[_0xdf3c('0x38')]('[Preview][validateContact][Empty\x20Contact]',_0x47f9d1);return{'isValid':![],'message':_0xdf3c('0x107')};}var _0x4185f0=this[_0xdf3c('0x13')][_0x47f9d1[0x0][_0xdf3c('0xeb')]['name']];_0x4185f0[_0xdf3c('0x36')]=utils[_0xdf3c('0x6e')][_0xdf3c('0x74')];if(_[_0xdf3c('0x58')](_0x4185f0)){ut[_0xdf3c('0x38')](_0xdf3c('0x108'),_0x4185f0);return{'isValid':![],'message':_0xdf3c('0x109')};}if(!this['isTrunkReachable'](_0x4185f0[_0xdf3c('0x71')])){ut[_0xdf3c('0x38')](_0xdf3c('0x10a'),_0xdf3c('0x10b')+_0x4185f0[_0xdf3c('0x2f')]+_0xdf3c('0x10c'));if(!this[_0xdf3c('0x70')](_0x4185f0[_0xdf3c('0x72')])){ut[_0xdf3c('0x38')](_0xdf3c('0x10a'),_0x4185f0[_0xdf3c('0x2f')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xdf3c('0x10d')};}}if(!ut[_0xdf3c('0x10e')](_0x4185f0[_0xdf3c('0x40')])){ut['logger'](_0xdf3c('0x10f'),_0x4185f0[_0xdf3c('0x2f')]+_0xdf3c('0x110'));return{'isValid':![],'message':_0xdf3c('0x10b')+_0x4185f0[_0xdf3c('0x2f')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xdf3c('0x111')};};Preview[_0xdf3c('0xf')]['execCall']=function(_0x2a0943,_0x3d4dc5,_0x38c6f3,_0xb39cc){var _0xcc2f18=this;return new Promise(function(_0x13ee9b,_0x8d7c0c){var _0x3d9041=_0x2a0943[_0xdf3c('0x8e')];var _0x4f8990=_0xcc2f18[_0xdf3c('0x70')](_0x3d4dc5[_0xdf3c('0x71')])?util['format'](_0xdf3c('0x112'),_0x3d4dc5[_0xdf3c('0x71')]['name'],_['isNil'](_0x3d4dc5[_0xdf3c('0x113')])?'':_0x3d4dc5[_0xdf3c('0x113')][_0xdf3c('0x114')]()||'',_0x3d4dc5[_0xdf3c('0x115')]>0x0?_0x38c6f3[_0xdf3c('0x103')][_0xdf3c('0x116')](_0x3d4dc5[_0xdf3c('0x115')]):_0x38c6f3[_0xdf3c('0x103')]):util['format'](_0xdf3c('0x112'),_[_0xdf3c('0x58')](_0x3d4dc5[_0xdf3c('0x72')])?_0x3d4dc5[_0xdf3c('0x71')]['name']:_0x3d4dc5[_0xdf3c('0x72')][_0xdf3c('0x2f')],_[_0xdf3c('0x58')](_0x3d4dc5[_0xdf3c('0x113')])?'':_0x3d4dc5['dialPrefix'][_0xdf3c('0x114')]()||'',_0x3d4dc5[_0xdf3c('0x115')]>0x0?_0x38c6f3[_0xdf3c('0x103')]['substring'](_0x3d4dc5['dialCutDigit']):_0x38c6f3[_0xdf3c('0x103')]);var _0xcaea00=_0xcc2f18[_0xdf3c('0x70')](_0x3d4dc5['Trunk'])?ut[_0xdf3c('0x117')](_0x3d4dc5[_0xdf3c('0x71')][_0xdf3c('0x118')],_0x3d4dc5[_0xdf3c('0x119')],_0x3d4dc5[_0xdf3c('0x11a')]>0x0?ut['getCallerIdRandom'](_0x3d4dc5['dialOriginateCallerIdNumber'],_0x3d4dc5[_0xdf3c('0x11a')]):_0x3d4dc5['dialOriginateCallerIdNumber']):ut[_0xdf3c('0x117')](_[_0xdf3c('0x58')](_0x3d4dc5[_0xdf3c('0x72')])?_0x3d4dc5[_0xdf3c('0x71')][_0xdf3c('0x118')]:_0x3d4dc5[_0xdf3c('0x72')]['callerid'],_0x3d4dc5[_0xdf3c('0x119')],_0x3d4dc5[_0xdf3c('0x11a')]>0x0?ut[_0xdf3c('0x11b')](_0x3d4dc5[_0xdf3c('0x11c')],_0x3d4dc5['dialRandomLastDigitCallerIdNumber']):_0x3d4dc5[_0xdf3c('0x11c')]);if(_0xcaea00){_0x2a0943[_0xdf3c('0x11d')]=ut[_0xdf3c('0x11e')](_0xcaea00);_0x2a0943['originatecalleridnum']=ut['extractCalleridNumber'](_0xcaea00);}var _0x1617d8=ut[_0xdf3c('0x11f')](_0x3d4dc5,_0x38c6f3,_0x4f8990,_0xcaea00,_0x3d9041,_0x2a0943);_['merge'](_0x2a0943,ut[_0xdf3c('0x120')](_0x1617d8));_0x2a0943['starttime']=moment()[_0xdf3c('0x2d')](_0xdf3c('0x8b'));_0x3d4dc5[_0xdf3c('0x121')]=_0x1617d8;var _0x1961cd=ut[_0xdf3c('0x122')](_0x2a0943,_0x3d4dc5,_0x1617d8,_0x2a0943[_0xdf3c('0x86')],_0xb39cc);return ami['Action'](_0x1961cd)[_0xdf3c('0x5f')](function(_0x2c24b7){_0x3d4dc5[_0xdf3c('0x32')]+=0x1;logger[_0xdf3c('0x2a')](_0xdf3c('0x123'),_0x3d9041,_0xdf3c('0x8f'),_0x3d4dc5[_0xdf3c('0x2f')],_0xdf3c('0x47'),_0x3d4dc5[_0xdf3c('0x32')]);_0x13ee9b(_0x2c24b7);})[_0xdf3c('0x4f')](function(_0x340107){ut['logAgent'](_0x2a0943,0xe,_0xdf3c('0x124'));rpcDb[_0xdf3c('0xdf')](_0x2a0943,'[originateFailure][logOriginateFailure]');_0x8d7c0c(_0x340107);});});};Preview[_0xdf3c('0xf')][_0xdf3c('0x125')]=function(_0x2accb4){if(this[_0xdf3c('0x15')][_0x2accb4[_0xdf3c('0xa1')]]){this['actions'][_0x2accb4[_0xdf3c('0xa1')]][_0xdf3c('0x4e')]=_0x2accb4[_0xdf3c('0x4e')];}};Preview[_0xdf3c('0xf')][_0xdf3c('0x19')]=function(_0x31391d){var _0x158c75=this;var _0x7554e2=this[_0xdf3c('0x15')][_0x31391d[_0xdf3c('0x126')]];if(_0x7554e2){if(_0x7554e2[_0xdf3c('0xec')]&&this[_0xdf3c('0x16')][_0x7554e2[_0xdf3c('0xec')]]){ut['logLookAgent'](_0x7554e2,this[_0xdf3c('0x16')][_0x7554e2[_0xdf3c('0xec')]]['name'],this[_0xdf3c('0x16')][_0x7554e2[_0xdf3c('0xec')]]['id']);}var _0x44388c=_[_0xdf3c('0x127')](_0x7554e2);_0x44388c[_0xdf3c('0x8c')]=moment()[_0xdf3c('0x2d')](_0xdf3c('0x8b'));var _0x15322a=_0x158c75[_0xdf3c('0x13')][_0x7554e2[_0xdf3c('0x46')]];if(ut['isFailure'](_0x31391d[_0xdf3c('0x128')])){if(_0x7554e2[_0xdf3c('0x85')]){rpcDb['unlockContact'](_0x7554e2[_0xdf3c('0x88')]);}if(_0x7554e2['activeContact']){rpcDb[_0xdf3c('0xfe')](_0x7554e2['idContact']);}ami[_0xdf3c('0x29')]('custom:agentringnoanswer',ut[_0xdf3c('0x91')](_0x7554e2,_0xdf3c('0x129'),this[_0xdf3c('0x13')][_0x7554e2[_0xdf3c('0x46')]]));this[_0xdf3c('0xda')](_0x44388c,_0x15322a,_0x31391d);}else{_0x7554e2[_0xdf3c('0x12a')]=moment()[_0xdf3c('0x2d')](_0xdf3c('0x8b'));ut['logAgent'](_0x44388c,0x4,_0xdf3c('0x9a'));rpcDb[_0xdf3c('0xdf')](_0x44388c,_0xdf3c('0x12b'));}}};Preview['prototype'][_0xdf3c('0x1b')]=function(_0x30b5c8){var _0x30e5ab=this[_0xdf3c('0x15')][_0x30b5c8['linkedid']];var _0x55a4fa;if(_0x30e5ab){_0x55a4fa=this['campaignsPreview'][_0x30e5ab['queue']];logger[_0xdf3c('0x2a')](_0xdf3c('0x12c'),_0x30b5c8[_0xdf3c('0xa1')],_0xdf3c('0x8f'),_0x55a4fa[_0xdf3c('0x2f')],_0xdf3c('0x48'),_0x55a4fa[_0xdf3c('0x33')]);}if(this['actions'][_0x30b5c8[_0xdf3c('0xa1')]]&&_0x30b5c8['linkedid']!==_0x30b5c8[_0xdf3c('0x8e')]){if(_0x30b5c8[_0xdf3c('0x12d')]==='16'&&this[_0xdf3c('0x15')][_0x30b5c8[_0xdf3c('0xa1')]][_0xdf3c('0x49')]){this[_0xdf3c('0x12e')](_0x30b5c8,_0x30b5c8[_0xdf3c('0xa1')],_0x30b5c8[_0xdf3c('0x12d')]);}else if(this['actions'][_0x30b5c8[_0xdf3c('0xa1')]][_0xdf3c('0x49')]){logger[_0xdf3c('0x2a')](_0xdf3c('0x12f'),_0x30b5c8[_0xdf3c('0xa1')],_0x30b5c8['cause'],'\x20Queue',_0x55a4fa[_0xdf3c('0x2f')],_0xdf3c('0x48'),_0x55a4fa[_0xdf3c('0x33')]);this[_0xdf3c('0x12e')](_0x30b5c8,_0x30b5c8[_0xdf3c('0xa1')],_0x30b5c8[_0xdf3c('0x12d')]);}}else if(_0x30e5ab&&_[_0xdf3c('0x58')](_0x30e5ab[_0xdf3c('0x130')])&&_0x55a4fa[_0xdf3c('0x131')]&&_0x30b5c8[_0xdf3c('0xa1')]===_0x30b5c8[_0xdf3c('0x8e')]&&_['isNil'](_0x30b5c8[_0xdf3c('0xdd')])&&_0x30b5c8[_0xdf3c('0x12d')]==='16'&&_0x30b5c8[_0xdf3c('0x132')]==='6'&&_[_0xdf3c('0xdb')](_0x30e5ab[_0xdf3c('0x133')])){if(_0x30e5ab[_0xdf3c('0x85')]){rpcDb[_0xdf3c('0xfd')](_0x30e5ab['idContact']);}if(_0x30e5ab[_0xdf3c('0x86')]){rpcDb['disableContact'](_0x30e5ab[_0xdf3c('0x88')]);}_0x30b5c8['reason']='22';this[_0xdf3c('0xda')](_0x30e5ab,_0x55a4fa,_0x30b5c8);}else if(_0x30e5ab&&_0x30e5ab[_0xdf3c('0x133')]){if(_0x30b5c8['cause']==='16'&&this['actions'][_0x30b5c8[_0xdf3c('0xa1')]][_0xdf3c('0x49')]){logger[_0xdf3c('0x2a')](_0xdf3c('0x134'),_0x30b5c8[_0xdf3c('0xa1')],_0x30b5c8['cause'],_0xdf3c('0x8f'),_0x55a4fa[_0xdf3c('0x2f')],_0xdf3c('0x48'),_0x55a4fa[_0xdf3c('0x33')]);this[_0xdf3c('0x12e')](_0x30b5c8,_0x30b5c8['linkedid'],_0x30b5c8[_0xdf3c('0x12d')]);}else if(this['actions'][_0x30b5c8[_0xdf3c('0xa1')]]['dialAnswer']){logger['info'](_0xdf3c('0x12f'),_0x30b5c8[_0xdf3c('0xa1')],_0x30b5c8[_0xdf3c('0x12d')],_0xdf3c('0x8f'),_0x55a4fa[_0xdf3c('0x2f')],'pTalking:\x20',_0x55a4fa[_0xdf3c('0x33')]);this[_0xdf3c('0x12e')](_0x30b5c8,_0x30b5c8['linkedid'],_0x30b5c8[_0xdf3c('0x12d')]);}}};Preview[_0xdf3c('0xf')][_0xdf3c('0x20')]=function(_0x386a3b){if(this[_0xdf3c('0x15')][_0x386a3b['destlinkedid']]&&_0x386a3b[_0xdf3c('0xd8')]!==_0x386a3b[_0xdf3c('0x135')]){this[_0xdf3c('0x12e')](_0x386a3b,_0x386a3b[_0xdf3c('0xd8')],_0x386a3b[_0xdf3c('0xd1')]);}};Preview['prototype'][_0xdf3c('0x1e')]=function(_0x43fc55){if(this[_0xdf3c('0x15')][_0x43fc55[_0xdf3c('0xa1')]]&&_0x43fc55[_0xdf3c('0xa1')]!==_0x43fc55[_0xdf3c('0x8e')]&&!this[_0xdf3c('0x15')][_0x43fc55[_0xdf3c('0xa1')]][_0xdf3c('0x49')]){if(_0x43fc55[_0xdf3c('0x12d')]==='1'){this[_0xdf3c('0x12e')](_0x43fc55,_0x43fc55[_0xdf3c('0xa1')],_0x43fc55[_0xdf3c('0x12d')]);}}};Preview[_0xdf3c('0xf')][_0xdf3c('0x136')]=function(_0x2be6c7,_0x18bbe0,_0x174e96){if(this['actions'][_0x2be6c7]){if(_[_0xdf3c('0x58')](this[_0xdf3c('0x15')][_0x2be6c7][_0xdf3c('0x121')])){this['actions'][_0x2be6c7][_0xdf3c('0x121')]={};}this['actions'][_0x2be6c7][_0xdf3c('0x121')][_0x18bbe0]=_0x174e96;}};Preview['prototype'][_0xdf3c('0x23')]=function(_0xd721b1){try{if(!_[_0xdf3c('0x58')](_0xd721b1)){if(ut[_0xdf3c('0x137')](_[_0xdf3c('0x138')](_0xd721b1[_0xdf3c('0x139')])[0x0])){this[_0xdf3c('0x136')](_0xd721b1[_0xdf3c('0x8e')],_[_0xdf3c('0x138')](_0xd721b1['variable'])[0x0],_0xd721b1[_0xdf3c('0x13a')]);}}}catch(_0x3e3d63){logger[_0xdf3c('0x13b')](_0xdf3c('0x13c'),util['inspect'](_0x3e3d63,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xdf3c('0x25')]=function(_0x2d412f){if(_0x2d412f){if(this[_0xdf3c('0x15')][_0x2d412f[_0xdf3c('0x13d')]]){this['actions'][_0x2d412f[_0xdf3c('0x13d')]]['transfer']=!![];}}};Preview['prototype'][_0xdf3c('0x27')]=function(_0x4255cd){if(_0x4255cd){if(this['actions'][_0x4255cd[_0xdf3c('0x13e')]]){this[_0xdf3c('0x15')][_0x4255cd['transfererlinkedid']][_0xdf3c('0x133')]=!![];}}};module[_0xdf3c('0x13f')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 20a72fa..0ff0a13 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 _0x135b=['COMPLETED','create','[voiceQueueReport]\x20','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','createHistory','catch','[createHistory]\x20','resolve','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','then','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason'];(function(_0x55b39f,_0x11ace2){var _0x5b55af=function(_0x227158){while(--_0x227158){_0x55b39f['push'](_0x55b39f['shift']());}};_0x5b55af(++_0x11ace2);}(_0x135b,0x11d));var _0xb135=function(_0x5eb542,_0x382306){_0x5eb542=_0x5eb542-0x0;var _0x17d20b=_0x135b[_0x5eb542];return _0x17d20b;};'use strict';var util=require(_0xb135('0x0'));var BPromise=require('bluebird');var logger=require(_0xb135('0x1'))(_0xb135('0x2'));var cmHopper=require(_0xb135('0x3'));var cmHopperHistory=require(_0xb135('0x4'));var cmHopperBlack=require(_0xb135('0x5'));var agentReportPreview=require(_0xb135('0x6'));var voiceQueueReport=require(_0xb135('0x7'));function loggerCatch(_0x23da99){return function(_0x4c9d62){logger['error'](_0x23da99,util[_0xb135('0x8')](_0x4c9d62,{'showHidden':![],'depth':null}));};}function create(_0x4604a7){return cmHopperHistory[_0xb135('0x9')](_0x4604a7)[_0xb135('0xa')](loggerCatch(_0xb135('0xb')));}function createAgent(_0x20c2dd){return BPromise[_0xb135('0xc')]()['then'](agentReportPreview[_0xb135('0x9')](_0x20c2dd))['catch'](loggerCatch(_0xb135('0xb')));}function moveContact(_0x5e529d){return cmHopper['moveContactManagedDialer'](_0x5e529d,!![])['catch'](loggerCatch(_0xb135('0xd')));}exports[_0xb135('0xe')]=function(_0x1e1834){return cmHopperBlack[_0xb135('0xe')](_0x1e1834)[_0xb135('0xa')](loggerCatch(_0xb135('0xf')));};exports[_0xb135('0x10')]=function(_0xf9580b){return BPromise[_0xb135('0xc')]()[_0xb135('0x11')](cmHopper[_0xb135('0x10')](_0xf9580b))[_0xb135('0xa')](loggerCatch(_0xb135('0x12')));};exports[_0xb135('0x9')]=function(_0x37ce7d,_0x4c2974){create(_0x37ce7d)[_0xb135('0xa')](loggerCatch(_0x4c2974));moveContact(_0x37ce7d)['catch'](loggerCatch(_0x4c2974));};exports[_0xb135('0x13')]=function(_0x51220a,_0x2d46b4){createAgent(_0x51220a)[_0xb135('0xa')](loggerCatch(_0x2d46b4));};exports[_0xb135('0x14')]=function(_0x2f4c04,_0x2995db){create(_0x2f4c04)[_0xb135('0xa')](loggerCatch(_0x2995db));};exports[_0xb135('0x15')]=function(_0x5827be,_0x661964){moveContact(_0x5827be)['catch'](loggerCatch(_0x661964));};exports[_0xb135('0x16')]=function(_0x5be6a1,_0x3f39c1,_0x4d8e87){if(_0x3f39c1){_0x5be6a1[_0xb135('0x17')]=null;}if(_0x4d8e87){_0x5be6a1[_0xb135('0x18')]=![];}return cmHopper[_0xb135('0x16')](_0x5be6a1)[_0xb135('0xa')](loggerCatch(_0xb135('0x19')));};exports[_0xb135('0x1a')]=function(_0x20b5a7){return cmHopper[_0xb135('0x1a')](_0x20b5a7)[_0xb135('0xa')](loggerCatch(_0xb135('0x1b')));};exports['unlockContact']=function(_0x4c72af){return cmHopper[_0xb135('0x1c')]({'UserId':null},_0x4c72af,0x1)[_0xb135('0xa')](loggerCatch(_0xb135('0x1d')));};exports[_0xb135('0x1e')]=function(_0x443a06){return cmHopper[_0xb135('0x1c')]({'active':![]},_0x443a06,0x1)[_0xb135('0xa')](loggerCatch(_0xb135('0x1f')));};exports['crateCustomerReportQueue']=function(_0x3dba14){var _0x98ed60={};_0x98ed60[_0xb135('0x20')]=_0x3dba14[_0xb135('0x20')];_0x98ed60[_0xb135('0x21')]=_0x3dba14['uniqueid'];_0x98ed60[_0xb135('0x22')]=_0x3dba14['calleridnum'];_0x98ed60['calleridname']=_0x3dba14[_0xb135('0x23')];_0x98ed60['queue']=_0x3dba14[_0xb135('0x24')];_0x98ed60['queuecallerjoinAt']=_0x3dba14[_0xb135('0x25')];_0x98ed60[_0xb135('0x26')]=_0x3dba14['answertime'];_0x98ed60[_0xb135('0x27')]=0x1;_0x98ed60[_0xb135('0x28')]=_0x3dba14['endtime'];_0x98ed60[_0xb135('0x29')]=_0x3dba14[_0xb135('0x2a')];_0x98ed60[_0xb135('0x2b')]=_0xb135('0x2c');_0x98ed60[_0xb135('0x2d')]=_0xb135('0x2e');_0x98ed60[_0xb135('0x2f')]=0x0;_0x98ed60[_0xb135('0x30')]=0x1;_0x98ed60[_0xb135('0x31')]=_0x3dba14[_0xb135('0x2a')];_0x98ed60[_0xb135('0x32')]=_0xb135('0x33');return BPromise[_0xb135('0xc')]()[_0xb135('0x11')](voiceQueueReport[_0xb135('0x34')](_0x98ed60))['catch'](loggerCatch(_0xb135('0x35')));};exports['getContactRecallMe']=function(_0x56b790,_0x8f690){return BPromise['resolve']()[_0xb135('0x11')](cmHopper['getContactRecallMe'](_0x56b790,_0x8f690))['catch'](loggerCatch(_0xb135('0x36')));};exports[_0xb135('0x37')]=function(_0x2a9621){return cmHopper[_0xb135('0x16')](_0x2a9621,!![],!![])[_0xb135('0xa')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0xb4e5=['../rpc/agentReportPreview','error','inspect','catch','resolve','then','createHistory','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','disableContact','crateCustomerReportQueue','type','uniqueid','calleridname','queuecallerjoinAt','answertime','queuecallerleaveAt','endtime','connectedlinename','membername','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack'];(function(_0x576b7f,_0x29a11c){var _0x55719b=function(_0x5509f4){while(--_0x5509f4){_0x576b7f['push'](_0x576b7f['shift']());}};_0x55719b(++_0x29a11c);}(_0xb4e5,0x1da));var _0x5b4e=function(_0x1565a8,_0x630c41){_0x1565a8=_0x1565a8-0x0;var _0x370252=_0xb4e5[_0x1565a8];return _0x370252;};'use strict';var util=require(_0x5b4e('0x0'));var BPromise=require(_0x5b4e('0x1'));var logger=require('../../../config/logger')(_0x5b4e('0x2'));var cmHopper=require(_0x5b4e('0x3'));var cmHopperHistory=require(_0x5b4e('0x4'));var cmHopperBlack=require(_0x5b4e('0x5'));var agentReportPreview=require(_0x5b4e('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x511a01){return function(_0x2e3146){logger[_0x5b4e('0x7')](_0x511a01,util[_0x5b4e('0x8')](_0x2e3146,{'showHidden':![],'depth':null}));};}function create(_0x5f5947){return cmHopperHistory['createHistory'](_0x5f5947)[_0x5b4e('0x9')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x571c91){return BPromise[_0x5b4e('0xa')]()[_0x5b4e('0xb')](agentReportPreview[_0x5b4e('0xc')](_0x571c91))['catch'](loggerCatch(_0x5b4e('0xd')));}function moveContact(_0x1f3135){return cmHopper[_0x5b4e('0xe')](_0x1f3135,!![])[_0x5b4e('0x9')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x5b4e('0xf')]=function(_0xf6954d){return cmHopperBlack[_0x5b4e('0xf')](_0xf6954d)[_0x5b4e('0x9')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x23b9f4){return BPromise[_0x5b4e('0xa')]()['then'](cmHopper[_0x5b4e('0x10')](_0x23b9f4))[_0x5b4e('0x9')](loggerCatch(_0x5b4e('0x11')));};exports[_0x5b4e('0xc')]=function(_0x23aea0,_0x23e6da){create(_0x23aea0)[_0x5b4e('0x9')](loggerCatch(_0x23e6da));moveContact(_0x23aea0)[_0x5b4e('0x9')](loggerCatch(_0x23e6da));};exports[_0x5b4e('0x12')]=function(_0x163a2b,_0x5915ad){createAgent(_0x163a2b)[_0x5b4e('0x9')](loggerCatch(_0x5915ad));};exports['createCustomerHistory']=function(_0x3cc399,_0x553c76){create(_0x3cc399)['catch'](loggerCatch(_0x553c76));};exports[_0x5b4e('0x13')]=function(_0x4d91fe,_0x2dcf4a){moveContact(_0x4d91fe)[_0x5b4e('0x9')](loggerCatch(_0x2dcf4a));};exports[_0x5b4e('0x14')]=function(_0x258939,_0x1d2eab,_0x14fd97){if(_0x1d2eab){_0x258939[_0x5b4e('0x15')]=null;}if(_0x14fd97){_0x258939[_0x5b4e('0x16')]=![];}return cmHopper[_0x5b4e('0x14')](_0x258939)['catch'](loggerCatch(_0x5b4e('0x17')));};exports[_0x5b4e('0x18')]=function(_0x53aa79){return cmHopper[_0x5b4e('0x18')](_0x53aa79)[_0x5b4e('0x9')](loggerCatch('[countReScheduled]\x20'));};exports[_0x5b4e('0x19')]=function(_0x301454){return cmHopper[_0x5b4e('0x19')]({'UserId':null},_0x301454,0x1)[_0x5b4e('0x9')](loggerCatch('[unlockContact]\x20'));};exports[_0x5b4e('0x1a')]=function(_0x179f28){return cmHopper['unlockContact']({'active':![]},_0x179f28,0x1)[_0x5b4e('0x9')](loggerCatch('[activeContact]\x20'));};exports[_0x5b4e('0x1b')]=function(_0x3bdde0){var _0xc20eb9={};_0xc20eb9[_0x5b4e('0x1c')]=_0x3bdde0[_0x5b4e('0x1c')];_0xc20eb9['uniqueid']=_0x3bdde0[_0x5b4e('0x1d')];_0xc20eb9['calleridnum']=_0x3bdde0['calleridnum'];_0xc20eb9['calleridname']=_0x3bdde0[_0x5b4e('0x1e')];_0xc20eb9['queue']=_0x3bdde0['queue'];_0xc20eb9[_0x5b4e('0x1f')]=_0x3bdde0[_0x5b4e('0x20')];_0xc20eb9[_0x5b4e('0x21')]=_0x3bdde0[_0x5b4e('0x20')];_0xc20eb9['queuecallercomplete']=0x1;_0xc20eb9['queuecallercompleteAt']=_0x3bdde0[_0x5b4e('0x22')];_0xc20eb9[_0x5b4e('0x23')]=_0x3bdde0[_0x5b4e('0x24')];_0xc20eb9['context']=_0x5b4e('0x25');_0xc20eb9[_0x5b4e('0x26')]=_0x5b4e('0x27');_0xc20eb9['holdtime']=0x0;_0xc20eb9[_0x5b4e('0x28')]=0x1;_0xc20eb9[_0x5b4e('0x29')]=_0x3bdde0[_0x5b4e('0x24')];_0xc20eb9['queuecallerexitreason']='COMPLETED';return BPromise[_0x5b4e('0xa')]()[_0x5b4e('0xb')](voiceQueueReport[_0x5b4e('0x2a')](_0xc20eb9))['catch'](loggerCatch(_0x5b4e('0x2b')));};exports['getContactRecallMe']=function(_0x4df537,_0xad4e52){return BPromise['resolve']()[_0x5b4e('0xb')](cmHopper[_0x5b4e('0x2c')](_0x4df537,_0xad4e52))[_0x5b4e('0x9')](loggerCatch(_0x5b4e('0x2d')));};exports[_0x5b4e('0x2e')]=function(_0x465a42){return cmHopper[_0x5b4e('0x14')](_0x465a42,!![],!![])[_0x5b4e('0x9')](loggerCatch(_0x5b4e('0x2f')));}; \ 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 f85b402..f3b5650 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 _0x8c7f=['Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','XMD-','toLowerVariables','toLower','updateOriginated','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','state','statedesc','starttime','responsetime','logAgent','YYYY-MM-DD\x20HH:mm:ss','getSeconds','logLookAgent','membername','UserId','logCustomer','endtime','talktime','answertime','variablesAction','uniqueid','originate','channelAgent','from-sip','timeout','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledat','add','minutes','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','lastevent','queue','interface','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','milliseconds','diff','seconds','CampaignId','filterKey','type','campaigntype','dialAnswer','active','countbusyretry','countcongestionretry','countglobal','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqos','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','noanswer','variables','forEach','toLowerCase','buildNoAnswerEventPayload','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','../../dialer/utils','error','inspect','logger','info','logger2','message','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','addVariables','Queue','name','calleridname','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview'];(function(_0x32fda4,_0x15a7ca){var _0x464fe5=function(_0x30f63d){while(--_0x30f63d){_0x32fda4['push'](_0x32fda4['shift']());}};_0x464fe5(++_0x15a7ca);}(_0x8c7f,0xf1));var _0xf8c7=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x8c7f[_0x297fd3];return _0x2af381;};'use strict';var util=require('util');var _=require(_0xf8c7('0x0'));var moment=require(_0xf8c7('0x1'));var logger=require(_0xf8c7('0x2'))(_0xf8c7('0x3'));var ipAgi=process[_0xf8c7('0x4')][_0xf8c7('0x5')]||'127.0.0.1';var utils=require(_0xf8c7('0x6'));exports['loggerCatch']=function(_0x487b75){return function(_0x1944b1){logger[_0xf8c7('0x7')](_0x487b75,util[_0xf8c7('0x8')](_0x1944b1,{'showHidden':![],'depth':null}));};};exports[_0xf8c7('0x9')]=function(_0x2ece32,_0xf16db0){logger[_0xf8c7('0xa')](_0x2ece32,util['inspect'](_0xf16db0,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x113b1a,_0x2355aa){logger['error'](_0x113b1a,util[_0xf8c7('0x8')](_0x2355aa,{'showHidden':![],'depth':null}));};exports[_0xf8c7('0xb')]=function(_0x1b2e99){return function(_0x5d6a75){logger['info'](_0x1b2e99,util[_0xf8c7('0x8')](_0x5d6a75,{'showHidden':![],'depth':null}));};};exports[_0xf8c7('0xc')]=function(_0x1e18e6,_0x3a01ef,_0x262e7f){return{'message':_0x1e18e6,'unlock':_0x3a01ef,'active':_0x262e7f};};exports['getCallerId']=function(_0x2ccc94,_0x3d88ac,_0x1630d3){if(!_[_0xf8c7('0xd')](_0x1630d3)&&_0xf8c7('0xe')===typeof _0x1630d3&&!_[_0xf8c7('0xf')](_0x1630d3)){if(!_[_0xf8c7('0xd')](_0x3d88ac)&&_0xf8c7('0xe')===typeof _0x3d88ac&&!_[_0xf8c7('0xf')](_0x3d88ac)){return util['format'](_0xf8c7('0x10'),_0x3d88ac,_0x1630d3);}return util[_0xf8c7('0x11')](_0xf8c7('0x10'),_0x1630d3,_0x1630d3);}if(!_[_0xf8c7('0xd')](_0x2ccc94)&&_0xf8c7('0xe')===typeof _0x2ccc94&&!_[_0xf8c7('0xf')](_0x2ccc94)){return _0x2ccc94;}return _0xf8c7('0x12');};exports['isActive']=function(_0x200491){if(_['isNil'](_0x200491)){return![];}return _0x200491;};exports[_0xf8c7('0x13')]=function(_0x10f2cf,_0xc90296,_0x1b5f90,_0x12465a,_0x21689c,_0x325277){var _0x290f81={'XMD-QUEUE':_0xc90296[_0xf8c7('0x14')]?_0xc90296[_0xf8c7('0x14')][_0xf8c7('0x15')]:'','XMD-CALLERID':_0x12465a,'XMD-CALLERID-PREVIEW':_0x325277?util['format'](_0xf8c7('0x10'),_0x325277[_0xf8c7('0x16')],_0x325277['calleridnum']):_0x12465a,'XMD-DIALID':_0x21689c,'XMD-CONTACTID':_0xc90296[_0xf8c7('0x17')],'XMD-CDRTYPE':_0xf8c7('0x18'),'CALLERID(all)':_0x12465a,'XMD-VOICEQUEUEID':_0xc90296['VoiceQueueId'],'XMD-DIALCHANNEL':_0x1b5f90,'XMD-DIALTIMEOUT':_0x10f2cf[_0xf8c7('0x19')]||0x1e,'XMD-DIALOPTIONS':util[_0xf8c7('0x11')](_0xf8c7('0x1a'),_0x10f2cf[_0xf8c7('0x1b')]?'g':'',_[_0xf8c7('0xf')](_0x10f2cf['monitor_format'])?'':_0xf8c7('0x1c')),'XMD-DIALURL':_0x10f2cf[_0xf8c7('0x1d')]||'','XMD-AGI':_0x10f2cf[_0xf8c7('0x1e')]?util[_0xf8c7('0x11')](_0xf8c7('0x1f'),ipAgi,_0x10f2cf[_0xf8c7('0x1e')]):_0xf8c7('0x20'),'XMD-AGIAFTER':_0x10f2cf[_0xf8c7('0x1b')]?util[_0xf8c7('0x11')](_0xf8c7('0x1f'),ipAgi,_0x10f2cf[_0xf8c7('0x1b')]):_0xf8c7('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x325277?_0x325277[_0xf8c7('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x325277?_0x325277['originatecalleridname']:'','XMD-DESTINATION':_0xf8c7('0x22'),'SIPADDHEADER':_0xf8c7('0x23')};if(!_['isEmpty'](_0x10f2cf[_0xf8c7('0x24')])){_0x290f81[util[_0xf8c7('0x11')]('%s',_0xf8c7('0x25'))]=_0x10f2cf[_0xf8c7('0x24')];_0x290f81[util['format']('%s',_0xf8c7('0x26'))]=_0x21689c;}if(_0xc90296&&_0xc90296[_0xf8c7('0x27')]){for(var _0xef7993 in _0xc90296[_0xf8c7('0x27')]){if(_0xc90296[_0xf8c7('0x27')][_0xf8c7('0x28')](_0xef7993)){if(!_['isNil'](_0xc90296[_0xf8c7('0x27')][_0xef7993])&&_0xef7993!=='id'&&_0xef7993!==_0xf8c7('0x29')&&_0xef7993!==_0xf8c7('0x2a')&&_0xef7993!=='updatedAt'){_0x290f81[util[_0xf8c7('0x11')]('%s%s',_0xf8c7('0x2b'),_['toUpper'](_0xef7993))]=_0xc90296[_0xf8c7('0x27')][_0xef7993];}}}}return _0x290f81;};exports[_0xf8c7('0x2c')]=function(_0x4543f2){var _0x3eb405={};for(var _0x2b7bc9 in _0x4543f2){if(_0x4543f2[_0xf8c7('0x28')](_0x2b7bc9)){_0x3eb405[util[_0xf8c7('0x11')]('%s',_[_0xf8c7('0x2d')](_0x2b7bc9))]=_0x4543f2[_0x2b7bc9];}}return{'variables':_0x3eb405};};exports[_0xf8c7('0x2e')]=function(_0x279f7c,_0x5e836c){if(!_[_0xf8c7('0x2f')](_0x279f7c)){if(_0x279f7c[_0xf8c7('0x28')]('originated')){if(_0x279f7c[_0xf8c7('0x30')]>0x0){_0x279f7c[_0xf8c7('0x30')]-=0x1;}else{logger[_0xf8c7('0x7')](_0xf8c7('0x31'),_0x5e836c);}}}else{logger[_0xf8c7('0x7')](_0xf8c7('0x32'),_0x5e836c);}};exports['logBlacklist']=function(_0x4efed6){var _0x598e72=moment()[_0xf8c7('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x4efed6[_0xf8c7('0x33')]=0xd;_0x4efed6[_0xf8c7('0x34')]='Blacklist';_0x4efed6[_0xf8c7('0x35')]=_0x598e72;_0x4efed6[_0xf8c7('0x36')]=_0x598e72;_0x4efed6['endtime']=_0x598e72;};exports[_0xf8c7('0x37')]=function(_0x3ec08c,_0x153c4b,_0x18ef1f){var _0x725530=moment()[_0xf8c7('0x11')](_0xf8c7('0x38'));_0x3ec08c[_0xf8c7('0x33')]=_0x153c4b;_0x3ec08c[_0xf8c7('0x34')]=_0x18ef1f;_0x3ec08c['responsetime']=_0x725530;_0x3ec08c['ringtime']=utils[_0xf8c7('0x39')](_0x3ec08c[_0xf8c7('0x36')],_0x3ec08c['starttime']);};exports[_0xf8c7('0x3a')]=function(_0x3eafbf,_0x126062,_0x1131a4){_0x3eafbf[_0xf8c7('0x3b')]=_0x126062;_0x3eafbf[_0xf8c7('0x3c')]=_0x1131a4;};exports[_0xf8c7('0x3d')]=function(_0x52116a,_0x9e9f42,_0xfc3dd8){var _0x3bb2e7=moment()[_0xf8c7('0x11')](_0xf8c7('0x38'));_0x52116a['state']=_0x9e9f42;_0x52116a[_0xf8c7('0x34')]=_0xfc3dd8;_0x52116a[_0xf8c7('0x36')]=_0x52116a[_0xf8c7('0x36')]?_0x52116a['responsetime']:_0x3bb2e7;_0x52116a[_0xf8c7('0x3e')]=_0x52116a[_0xf8c7('0x3e')]?_0x52116a['endtime']:_0x3bb2e7;_0x52116a['ringtime']=utils[_0xf8c7('0x39')](_0x52116a[_0xf8c7('0x36')]||0x0,_0x52116a['starttime']||0x0);_0x52116a[_0xf8c7('0x3f')]=_0x52116a['answertime']?utils[_0xf8c7('0x39')](_0x52116a[_0xf8c7('0x3e')],_0x52116a[_0xf8c7('0x40')]):0x0;};exports['isFailure']=function(_0x1d5b1a){return _0x1d5b1a==='Failure';};exports[_0xf8c7('0x41')]=function(_0x44be85,_0x2f8faa,_0xe56464,_0x58bd21,_0x41a7a0){var _0x2dd6ef=_0x58bd21?'RECALL':_0x44be85[_0xf8c7('0x16')];_0x2dd6ef=_0x41a7a0?'BOOKED':_0x2dd6ef;return{'actionid':_0x44be85[_0xf8c7('0x42')],'action':_0xf8c7('0x43'),'channel':_0x44be85[_0xf8c7('0x44')],'callerid':util[_0xf8c7('0x11')]('\x22%s\x22\x20<%s>',_0x2dd6ef,_0x44be85['calleridnum']),'Exten':_0xf8c7('0x22'),'Context':_0xf8c7('0x45'),'Priority':'1','variable':_0xe56464,'timeout':(_0x2f8faa[_0xf8c7('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x44be85['uniqueid']};};exports['totalGlobal']=function(_0x535f28){return _0x535f28['countbusyretry']+_0x535f28['countcongestionretry']+_0x535f28['countnoanswerretry']+_0x535f28[_0xf8c7('0x47')]+_0x535f28[_0xf8c7('0x48')];};exports[_0xf8c7('0x49')]=function(_0x21c6bb){var _0x308f7a=_[_0xf8c7('0x4a')](_0x21c6bb);_0x308f7a['state']=0xf;_0x308f7a['statedesc']='Global';return _0x308f7a;};exports['scheduledAt']=function(_0x53c8e1,_0x1884e4,_0x28e205){var _0x29c04b={};_0x29c04b[_0x1884e4]=_0x53c8e1[_0x1884e4];_0x29c04b['active']=![];_0x29c04b[_0xf8c7('0x4b')]=moment()[_0xf8c7('0x4c')](_0x28e205,_0xf8c7('0x4d'))[_0xf8c7('0x11')](_0xf8c7('0x38'));_0x29c04b[_0xf8c7('0x17')]=_0x53c8e1[_0xf8c7('0x17')];_0x29c04b[_0xf8c7('0x4e')]=_0x53c8e1[_0xf8c7('0x4e')];_0x29c04b[_0xf8c7('0x4f')]=_0x53c8e1[_0xf8c7('0x4f')]||undefined;return _0x29c04b;};exports['decrementTalkink']=function(_0x1bf77a,_0x5c5bb3){if(!_[_0xf8c7('0x2f')](_0x1bf77a)){if(_0x1bf77a[_0xf8c7('0x50')]>0x0){_0x1bf77a[_0xf8c7('0x50')]-=0x1;}else{logger[_0xf8c7('0x7')](_0x5c5bb3,_0xf8c7('0x51'));}}else{logger[_0xf8c7('0x7')](_0x5c5bb3,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x59ff35){if(_0x59ff35<=0x0){return!![];}return![];};function buildObj(_0x467eda,_0x514518,_0x140a77){_0x467eda[_0xf8c7('0x52')]=_0x514518;_0x467eda[_0xf8c7('0x15')]=_0x467eda[_0xf8c7('0x53')];_0x467eda[_0xf8c7('0x54')]=_0x467eda['channelAgent'];_0x467eda['motionChannel']=_0xf8c7('0x55');if(_0x140a77){_0x467eda['mandatoryDisposition']=_0x140a77[_0xf8c7('0x56')];}return _0x467eda;}exports['buildObj']=buildObj;exports[_0xf8c7('0x57')]=function(_0x51ed31){var _0x4196c1={};_0x4196c1[_0xf8c7('0x53')]=_0x51ed31[_0xf8c7('0x53')];_0x4196c1[_0xf8c7('0x54')]=_0x51ed31[_0xf8c7('0x44')];_0x4196c1[_0xf8c7('0x42')]=_0x51ed31['uniqueid'];return _0x4196c1;};exports[_0xf8c7('0x58')]=function(_0x36ba62){var _0x251b7e=[];for(var _0x5d5e7d in _0x36ba62){if(_0x36ba62['hasOwnProperty'](_0x5d5e7d)){if(!_[_0xf8c7('0x2f')](_0x36ba62[_0x5d5e7d])&&_0x36ba62[_0x5d5e7d][_0xf8c7('0x33')]===_0xf8c7('0x59')&&_0x36ba62[_0x5d5e7d][_0xf8c7('0x5a')]===_0xf8c7('0x5b')){_0x251b7e[_0xf8c7('0x5c')](_0x36ba62[_0x5d5e7d]['id']);}}}return _0x251b7e;};exports[_0xf8c7('0x5d')]=function(_0x5715a1){var _0x414589=moment()[_0xf8c7('0x5e')](0x0);var _0x1a1c59=moment(_0x5715a1)[_0xf8c7('0x5e')](0x0);return _0x414589[_0xf8c7('0x5f')](_0x1a1c59,_0xf8c7('0x60'));};exports['createBody']=function(_0x4df3b6){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4df3b6['ContactId'],'ListId':_0x4df3b6[_0xf8c7('0x4e')],'VoiceQueueId':_0x4df3b6[_0xf8c7('0x4f')]||undefined,'CampaignId':_0x4df3b6[_0xf8c7('0x61')]||undefined};};exports[_0xf8c7('0x62')]=function(_0x449ec8){if(_0x449ec8===_0xf8c7('0x42')||_0x449ec8==='idContact'||_0x449ec8===_0xf8c7('0x53')||_0x449ec8===_0xf8c7('0x63')||_0x449ec8===_0xf8c7('0x64')||_0x449ec8===_0xf8c7('0x65')||_0x449ec8===_0xf8c7('0x3b')||_0x449ec8===_0xf8c7('0x44')||_0x449ec8===_0xf8c7('0x16')||_0x449ec8===_0xf8c7('0x66')||_0x449ec8==='calleridnum'||_0x449ec8==='scheduledat'||_0x449ec8===_0xf8c7('0x67')||_0x449ec8===_0xf8c7('0x68')||_0x449ec8==='countnoanswerretry'||_0x449ec8===_0xf8c7('0x69')||_0x449ec8==='callback'||_0x449ec8===_0xf8c7('0x6a')||_0x449ec8===_0xf8c7('0x6b')||_0x449ec8==='recallme'||_0x449ec8===_0xf8c7('0x17')||_0x449ec8===_0xf8c7('0x4e')||_0x449ec8===_0xf8c7('0x3c')||_0x449ec8===_0xf8c7('0x4f')||_0x449ec8===_0xf8c7('0x6c')||_0x449ec8===_0xf8c7('0x6d')||_0x449ec8==='xmd-queue'||_0x449ec8==='xmd-phone'||_0x449ec8===_0xf8c7('0x6e')||_0x449ec8===_0xf8c7('0x6f')||_0x449ec8===_0xf8c7('0x70')||_0x449ec8===_0xf8c7('0x71')||_0x449ec8===_0xf8c7('0x72')||_0x449ec8===_0xf8c7('0x73')||_0x449ec8===_0xf8c7('0x74')||_0x449ec8===_0xf8c7('0x75')||_0x449ec8===_0xf8c7('0x76')||_0x449ec8==='xmd-agiafter'||_0x449ec8==='xmd-agi'||_0x449ec8==='rtpaudioqos'||_0x449ec8===_0xf8c7('0x77')||_0x449ec8===_0xf8c7('0x78')||_0x449ec8==='rtpaudioqosjitterbridged'||_0x449ec8===_0xf8c7('0x79')||_0x449ec8===_0xf8c7('0x7a')||_0x449ec8===_0xf8c7('0x7b')||_0x449ec8==='rtpaudioqosrttbridged'||_0x449ec8===_0xf8c7('0x7c')||_0x449ec8===_0xf8c7('0x77')||_0x449ec8==='rtpaudioqosjitter'||_0x449ec8==='rtpaudioqosjitterbridged'||_0x449ec8===_0xf8c7('0x79')||_0x449ec8===_0xf8c7('0x7a')||_0x449ec8===_0xf8c7('0x7b')||_0x449ec8===_0xf8c7('0x7d')||_0x449ec8===_0xf8c7('0x7e')||_0x449ec8==='bridgepvtcallid'||_0x449ec8==='state'||_0x449ec8===_0xf8c7('0x34')){return![];}return!![];};exports[_0xf8c7('0x7f')]=function(_0xe37c51,_0x170753){var _0x3d9537,_0x3268d2,_0x20eca0;if(_0x170753<=0x0){_0x170753=0x1;}_0x3d9537=new RegExp(_0xf8c7('0x80')+_0x170753+'}$');_0x3268d2=Math['pow'](0xa,_0x170753-0x1);_0x20eca0=Math[_0xf8c7('0x81')](0xa,_0x170753)-0x1;return util['format']('%s',_[_0xf8c7('0x82')](_0xe37c51,_0x3d9537,_[_0xf8c7('0x83')](_0x3268d2,_0x20eca0)));};exports['extractCalleridName']=function(_0x54c67f){var _0x626c13=_0x54c67f[_0xf8c7('0x84')](/"(.*?)"/);return _0x626c13?_0x626c13[0x1]:_0x54c67f;};exports['extractCalleridNumber']=function(_0x419a67){var _0xa3de0a=_0x419a67[_0xf8c7('0x84')](/<(.*?)>/);return _0xa3de0a?_0xa3de0a[0x1]:_0x419a67;};function buildNoAnswerEventPayload(_0x807dd5,_0x3cb1b8){var _0x1108e8=buildObj(_0x807dd5,_0xf8c7('0x85'));if(!_['isEmpty'](_0x3cb1b8[_0xf8c7('0x86')])){Object['keys'](_0x3cb1b8[_0xf8c7('0x86')])[_0xf8c7('0x87')](function(_0x479841){_0x1108e8[_0x479841[_0xf8c7('0x88')]()]=_0x3cb1b8[_0xf8c7('0x86')][_0x479841];});}return _0x1108e8;}exports[_0xf8c7('0x89')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x1e1c=['reachable','push','getDiff','milliseconds','diff','createBody','filterKey','idContact','type','campaigntype','dialAnswer','countnoanswerretry','countglobal','callbackuniqueid','callbackat','UserId','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosjitterbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','match','noanswer','variables','keys','toLowerCase','buildNoAnswerEventPayload','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','inspect','logger','info','loggerError','message','isUndefined','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','toLower','updateOriginated','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','endtime','logAgent','getSeconds','logLookAgent','membername','logCustomer','ringtime','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','originate','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','channelAgent','motionChannel','voice','mandatoryDisposition','buildObj','uniqueid','agentReadyId','not_inuse','status'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1e1c,0x154));var _0xc1e1=function(_0x2b71ec,_0x300588){_0x2b71ec=_0x2b71ec-0x0;var _0x568291=_0x1e1c[_0x2b71ec];return _0x568291;};'use strict';var util=require('util');var _=require(_0xc1e1('0x0'));var moment=require(_0xc1e1('0x1'));var logger=require(_0xc1e1('0x2'))(_0xc1e1('0x3'));var ipAgi=process['env'][_0xc1e1('0x4')]||_0xc1e1('0x5');var utils=require(_0xc1e1('0x6'));exports[_0xc1e1('0x7')]=function(_0x5e8230){return function(_0x55bec2){logger['error'](_0x5e8230,util[_0xc1e1('0x8')](_0x55bec2,{'showHidden':![],'depth':null}));};};exports[_0xc1e1('0x9')]=function(_0x5877a8,_0x32dfd7){logger[_0xc1e1('0xa')](_0x5877a8,util['inspect'](_0x32dfd7,{'showHidden':![],'depth':null}));};exports[_0xc1e1('0xb')]=function(_0x21b146,_0x56ffc8){logger['error'](_0x21b146,util[_0xc1e1('0x8')](_0x56ffc8,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x479c23){return function(_0x4dd72f){logger[_0xc1e1('0xa')](_0x479c23,util[_0xc1e1('0x8')](_0x4dd72f,{'showHidden':![],'depth':null}));};};exports[_0xc1e1('0xc')]=function(_0x1dce41,_0x12373f,_0x51dd89){return{'message':_0x1dce41,'unlock':_0x12373f,'active':_0x51dd89};};exports['getCallerId']=function(_0x428e77,_0x3db2aa,_0x544683){if(!_[_0xc1e1('0xd')](_0x544683)&&'string'===typeof _0x544683&&!_[_0xc1e1('0xe')](_0x544683)){if(!_[_0xc1e1('0xd')](_0x3db2aa)&&'string'===typeof _0x3db2aa&&!_[_0xc1e1('0xe')](_0x3db2aa)){return util[_0xc1e1('0xf')](_0xc1e1('0x10'),_0x3db2aa,_0x544683);}return util[_0xc1e1('0xf')]('\x22%s\x22\x20<%s>',_0x544683,_0x544683);}if(!_[_0xc1e1('0xd')](_0x428e77)&&'string'===typeof _0x428e77&&!_[_0xc1e1('0xe')](_0x428e77)){return _0x428e77;}return'\x22\x22\x20<>';};exports[_0xc1e1('0x11')]=function(_0xbf6bdb){if(_[_0xc1e1('0x12')](_0xbf6bdb)){return![];}return _0xbf6bdb;};exports['addVariables']=function(_0x4ff67d,_0x5f3c28,_0x1ce7a3,_0x2fb618,_0x5ec90c,_0x520e5d){var _0x5e78bc={'XMD-QUEUE':_0x5f3c28['Queue']?_0x5f3c28['Queue'][_0xc1e1('0x13')]:'','XMD-CALLERID':_0x2fb618,'XMD-CALLERID-PREVIEW':_0x520e5d?util['format'](_0xc1e1('0x10'),_0x520e5d[_0xc1e1('0x14')],_0x520e5d[_0xc1e1('0x15')]):_0x2fb618,'XMD-DIALID':_0x5ec90c,'XMD-CONTACTID':_0x5f3c28[_0xc1e1('0x16')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2fb618,'XMD-VOICEQUEUEID':_0x5f3c28[_0xc1e1('0x17')],'XMD-DIALCHANNEL':_0x1ce7a3,'XMD-DIALTIMEOUT':_0x4ff67d[_0xc1e1('0x18')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0xc1e1('0x19'),_0x4ff67d[_0xc1e1('0x1a')]?'g':'',_[_0xc1e1('0xe')](_0x4ff67d[_0xc1e1('0x1b')])?'':_0xc1e1('0x1c')),'XMD-DIALURL':_0x4ff67d[_0xc1e1('0x1d')]||'','XMD-AGI':_0x4ff67d['dialQueueProject']?util[_0xc1e1('0xf')](_0xc1e1('0x1e'),ipAgi,_0x4ff67d[_0xc1e1('0x1f')]):_0xc1e1('0x20'),'XMD-AGIAFTER':_0x4ff67d[_0xc1e1('0x1a')]?util['format'](_0xc1e1('0x1e'),ipAgi,_0x4ff67d[_0xc1e1('0x1a')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x520e5d?_0x520e5d[_0xc1e1('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x520e5d?_0x520e5d['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0xc1e1('0x22')};if(!_['isEmpty'](_0x4ff67d[_0xc1e1('0x1b')])){_0x5e78bc[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x4ff67d[_0xc1e1('0x1b')];_0x5e78bc[util['format']('%s',_0xc1e1('0x23'))]=_0x5ec90c;}if(_0x5f3c28&&_0x5f3c28[_0xc1e1('0x24')]){for(var _0x5e8ad9 in _0x5f3c28[_0xc1e1('0x24')]){if(_0x5f3c28[_0xc1e1('0x24')][_0xc1e1('0x25')](_0x5e8ad9)){if(!_[_0xc1e1('0x12')](_0x5f3c28['Contact'][_0x5e8ad9])&&_0x5e8ad9!=='id'&&_0x5e8ad9!==_0xc1e1('0x26')&&_0x5e8ad9!==_0xc1e1('0x27')&&_0x5e8ad9!==_0xc1e1('0x28')){_0x5e78bc[util['format'](_0xc1e1('0x29'),'XMD-',_[_0xc1e1('0x2a')](_0x5e8ad9))]=_0x5f3c28['Contact'][_0x5e8ad9];}}}}return _0x5e78bc;};exports[_0xc1e1('0x2b')]=function(_0x5301a7){var _0x13173c={};for(var _0x37262d in _0x5301a7){if(_0x5301a7[_0xc1e1('0x25')](_0x37262d)){_0x13173c[util[_0xc1e1('0xf')]('%s',_[_0xc1e1('0x2c')](_0x37262d))]=_0x5301a7[_0x37262d];}}return{'variables':_0x13173c};};exports[_0xc1e1('0x2d')]=function(_0x1c826,_0x1c4a07){if(!_[_0xc1e1('0x12')](_0x1c826)){if(_0x1c826['hasOwnProperty'](_0xc1e1('0x2e'))){if(_0x1c826[_0xc1e1('0x2e')]>0x0){_0x1c826[_0xc1e1('0x2e')]-=0x1;}else{logger[_0xc1e1('0x2f')](_0xc1e1('0x30'),_0x1c4a07);}}}else{logger[_0xc1e1('0x2f')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x1c4a07);}};exports[_0xc1e1('0x31')]=function(_0x24c459){var _0x2cfdd8=moment()[_0xc1e1('0xf')](_0xc1e1('0x32'));_0x24c459[_0xc1e1('0x33')]=0xd;_0x24c459[_0xc1e1('0x34')]='Blacklist';_0x24c459[_0xc1e1('0x35')]=_0x2cfdd8;_0x24c459[_0xc1e1('0x36')]=_0x2cfdd8;_0x24c459[_0xc1e1('0x37')]=_0x2cfdd8;};exports[_0xc1e1('0x38')]=function(_0x297b92,_0x5d7506,_0x3c2d86){var _0x2a7ef3=moment()['format'](_0xc1e1('0x32'));_0x297b92[_0xc1e1('0x33')]=_0x5d7506;_0x297b92[_0xc1e1('0x34')]=_0x3c2d86;_0x297b92[_0xc1e1('0x36')]=_0x2a7ef3;_0x297b92['ringtime']=utils[_0xc1e1('0x39')](_0x297b92[_0xc1e1('0x36')],_0x297b92[_0xc1e1('0x35')]);};exports[_0xc1e1('0x3a')]=function(_0x55f72,_0x3e8c7a,_0x2a2355){_0x55f72[_0xc1e1('0x3b')]=_0x3e8c7a;_0x55f72['UserId']=_0x2a2355;};exports[_0xc1e1('0x3c')]=function(_0x3a0ea2,_0x50ca0f,_0x57beac){var _0x2421f2=moment()['format'](_0xc1e1('0x32'));_0x3a0ea2['state']=_0x50ca0f;_0x3a0ea2[_0xc1e1('0x34')]=_0x57beac;_0x3a0ea2[_0xc1e1('0x36')]=_0x3a0ea2[_0xc1e1('0x36')]?_0x3a0ea2[_0xc1e1('0x36')]:_0x2421f2;_0x3a0ea2[_0xc1e1('0x37')]=_0x3a0ea2[_0xc1e1('0x37')]?_0x3a0ea2[_0xc1e1('0x37')]:_0x2421f2;_0x3a0ea2[_0xc1e1('0x3d')]=utils[_0xc1e1('0x39')](_0x3a0ea2['responsetime']||0x0,_0x3a0ea2[_0xc1e1('0x35')]||0x0);_0x3a0ea2[_0xc1e1('0x3e')]=_0x3a0ea2[_0xc1e1('0x3f')]?utils[_0xc1e1('0x39')](_0x3a0ea2['endtime'],_0x3a0ea2['answertime']):0x0;};exports['isFailure']=function(_0x31ceb6){return _0x31ceb6===_0xc1e1('0x40');};exports[_0xc1e1('0x41')]=function(_0x1103c8,_0x36ae6a,_0x56cfe5,_0xe5781,_0x4f3100){var _0x2331f0=_0xe5781?_0xc1e1('0x42'):_0x1103c8['calleridname'];_0x2331f0=_0x4f3100?_0xc1e1('0x43'):_0x2331f0;return{'actionid':_0x1103c8['uniqueid'],'action':_0xc1e1('0x44'),'channel':_0x1103c8['channelAgent'],'callerid':util[_0xc1e1('0xf')](_0xc1e1('0x10'),_0x2331f0,_0x1103c8[_0xc1e1('0x15')]),'Exten':_0xc1e1('0x45'),'Context':_0xc1e1('0x46'),'Priority':'1','variable':_0x56cfe5,'timeout':(_0x36ae6a[_0xc1e1('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1103c8['uniqueid']};};exports[_0xc1e1('0x48')]=function(_0x205f6e){return _0x205f6e[_0xc1e1('0x49')]+_0x205f6e[_0xc1e1('0x4a')]+_0x205f6e['countnoanswerretry']+_0x205f6e[_0xc1e1('0x4b')]+_0x205f6e[_0xc1e1('0x4c')];};exports[_0xc1e1('0x4d')]=function(_0x11e985){var _0x56ec4c=_[_0xc1e1('0x4e')](_0x11e985);_0x56ec4c['state']=0xf;_0x56ec4c[_0xc1e1('0x34')]=_0xc1e1('0x4f');return _0x56ec4c;};exports[_0xc1e1('0x50')]=function(_0x5bfb97,_0x343c48,_0x1c43a9){var _0x247fa7={};_0x247fa7[_0x343c48]=_0x5bfb97[_0x343c48];_0x247fa7[_0xc1e1('0x51')]=![];_0x247fa7[_0xc1e1('0x52')]=moment()[_0xc1e1('0x53')](_0x1c43a9,_0xc1e1('0x54'))[_0xc1e1('0xf')](_0xc1e1('0x32'));_0x247fa7[_0xc1e1('0x16')]=_0x5bfb97['ContactId'];_0x247fa7[_0xc1e1('0x55')]=_0x5bfb97[_0xc1e1('0x55')];_0x247fa7[_0xc1e1('0x17')]=_0x5bfb97[_0xc1e1('0x17')]||undefined;return _0x247fa7;};exports[_0xc1e1('0x56')]=function(_0x35a724,_0x316f76){if(!_[_0xc1e1('0x12')](_0x35a724)){if(_0x35a724[_0xc1e1('0x57')]>0x0){_0x35a724[_0xc1e1('0x57')]-=0x1;}else{logger[_0xc1e1('0x2f')](_0x316f76,_0xc1e1('0x58'));}}else{logger[_0xc1e1('0x2f')](_0x316f76,_0xc1e1('0x59'));}};exports['IsNotLoggedIn']=function(_0x504b7d){if(_0x504b7d<=0x0){return!![];}return![];};function buildObj(_0x2e4aa7,_0x36d2e6,_0x57f1f1){_0x2e4aa7[_0xc1e1('0x5a')]=_0x36d2e6;_0x2e4aa7[_0xc1e1('0x13')]=_0x2e4aa7[_0xc1e1('0x5b')];_0x2e4aa7['interface']=_0x2e4aa7[_0xc1e1('0x5c')];_0x2e4aa7[_0xc1e1('0x5d')]=_0xc1e1('0x5e');if(_0x57f1f1){_0x2e4aa7[_0xc1e1('0x5f')]=_0x57f1f1['mandatoryDisposition'];}return _0x2e4aa7;}exports[_0xc1e1('0x60')]=buildObj;exports['buildAcw']=function(_0xed2ad2){var _0x27d87c={};_0x27d87c[_0xc1e1('0x5b')]=_0xed2ad2[_0xc1e1('0x5b')];_0x27d87c['interface']=_0xed2ad2[_0xc1e1('0x5c')];_0x27d87c[_0xc1e1('0x61')]=_0xed2ad2[_0xc1e1('0x61')];return _0x27d87c;};exports[_0xc1e1('0x62')]=function(_0x445430){var _0x3344ec=[];for(var _0x15d4f2 in _0x445430){if(_0x445430[_0xc1e1('0x25')](_0x15d4f2)){if(!_['isNil'](_0x445430[_0x15d4f2])&&_0x445430[_0x15d4f2][_0xc1e1('0x33')]===_0xc1e1('0x63')&&_0x445430[_0x15d4f2][_0xc1e1('0x64')]===_0xc1e1('0x65')){_0x3344ec[_0xc1e1('0x66')](_0x445430[_0x15d4f2]['id']);}}}return _0x3344ec;};exports[_0xc1e1('0x67')]=function(_0x4937d0){var _0x28e3d9=moment()[_0xc1e1('0x68')](0x0);var _0x24e8d4=moment(_0x4937d0)[_0xc1e1('0x68')](0x0);return _0x28e3d9[_0xc1e1('0x69')](_0x24e8d4,'seconds');};exports[_0xc1e1('0x6a')]=function(_0x48b5d5){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x48b5d5[_0xc1e1('0x16')],'ListId':_0x48b5d5[_0xc1e1('0x55')],'VoiceQueueId':_0x48b5d5[_0xc1e1('0x17')]||undefined,'CampaignId':_0x48b5d5['CampaignId']||undefined};};exports[_0xc1e1('0x6b')]=function(_0x2d8658){if(_0x2d8658===_0xc1e1('0x61')||_0x2d8658===_0xc1e1('0x6c')||_0x2d8658===_0xc1e1('0x5b')||_0x2d8658===_0xc1e1('0x6d')||_0x2d8658===_0xc1e1('0x6e')||_0x2d8658===_0xc1e1('0x6f')||_0x2d8658===_0xc1e1('0x3b')||_0x2d8658===_0xc1e1('0x5c')||_0x2d8658==='calleridname'||_0x2d8658===_0xc1e1('0x51')||_0x2d8658==='calleridnum'||_0x2d8658==='scheduledat'||_0x2d8658===_0xc1e1('0x49')||_0x2d8658===_0xc1e1('0x4a')||_0x2d8658===_0xc1e1('0x70')||_0x2d8658===_0xc1e1('0x71')||_0x2d8658==='callback'||_0x2d8658===_0xc1e1('0x72')||_0x2d8658===_0xc1e1('0x73')||_0x2d8658==='recallme'||_0x2d8658===_0xc1e1('0x16')||_0x2d8658==='ListId'||_0x2d8658===_0xc1e1('0x74')||_0x2d8658===_0xc1e1('0x17')||_0x2d8658===_0xc1e1('0x75')||_0x2d8658===_0xc1e1('0x76')||_0x2d8658==='xmd-queue'||_0x2d8658===_0xc1e1('0x77')||_0x2d8658===_0xc1e1('0x78')||_0x2d8658==='xmd-dialurl'||_0x2d8658==='xmd-dialtimeout'||_0x2d8658===_0xc1e1('0x79')||_0x2d8658===_0xc1e1('0x7a')||_0x2d8658==='xmd-dialchannel'||_0x2d8658===_0xc1e1('0x7b')||_0x2d8658===_0xc1e1('0x7c')||_0x2d8658==='xmd-callerid'||_0x2d8658==='xmd-agiafter'||_0x2d8658===_0xc1e1('0x7d')||_0x2d8658===_0xc1e1('0x7e')||_0x2d8658===_0xc1e1('0x7f')||_0x2d8658===_0xc1e1('0x80')||_0x2d8658==='rtpaudioqosjitterbridged'||_0x2d8658===_0xc1e1('0x81')||_0x2d8658===_0xc1e1('0x82')||_0x2d8658===_0xc1e1('0x83')||_0x2d8658==='rtpaudioqosrttbridged'||_0x2d8658===_0xc1e1('0x7e')||_0x2d8658===_0xc1e1('0x7f')||_0x2d8658===_0xc1e1('0x80')||_0x2d8658===_0xc1e1('0x84')||_0x2d8658===_0xc1e1('0x81')||_0x2d8658===_0xc1e1('0x82')||_0x2d8658===_0xc1e1('0x83')||_0x2d8658===_0xc1e1('0x85')||_0x2d8658===_0xc1e1('0x86')||_0x2d8658===_0xc1e1('0x87')||_0x2d8658===_0xc1e1('0x33')||_0x2d8658===_0xc1e1('0x34')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x15496a,_0x2a3916){var _0x3b5f04,_0x3e0492,_0x3b9c6f;if(_0x2a3916<=0x0){_0x2a3916=0x1;}_0x3b5f04=new RegExp(_0xc1e1('0x88')+_0x2a3916+'}$');_0x3e0492=Math[_0xc1e1('0x89')](0xa,_0x2a3916-0x1);_0x3b9c6f=Math['pow'](0xa,_0x2a3916)-0x1;return util[_0xc1e1('0xf')]('%s',_[_0xc1e1('0x8a')](_0x15496a,_0x3b5f04,_[_0xc1e1('0x8b')](_0x3e0492,_0x3b9c6f)));};exports[_0xc1e1('0x8c')]=function(_0x292803){var _0x355c63=_0x292803[_0xc1e1('0x8d')](/"(.*?)"/);return _0x355c63?_0x355c63[0x1]:_0x292803;};exports['extractCalleridNumber']=function(_0x1fe95e){var _0x238625=_0x1fe95e['match'](/<(.*?)>/);return _0x238625?_0x238625[0x1]:_0x1fe95e;};function buildNoAnswerEventPayload(_0x5d44e1,_0x445405){var _0x5377b3=buildObj(_0x5d44e1,_0xc1e1('0x8e'));if(!_[_0xc1e1('0xe')](_0x445405[_0xc1e1('0x8f')])){Object[_0xc1e1('0x90')](_0x445405[_0xc1e1('0x8f')])['forEach'](function(_0xf1cbd4){_0x5377b3[_0xf1cbd4[_0xc1e1('0x91')]()]=_0x445405[_0xc1e1('0x8f')][_0xf1cbd4];});}return _0x5377b3;}exports[_0xc1e1('0x92')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 639e8bd..dd1d4a0 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 _0x58ed=['boolean','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','queueremove','queuepause'];(function(_0xc7caa8,_0x28ee9c){var _0x18fe7e=function(_0x5186fe){while(--_0x5186fe){_0xc7caa8['push'](_0xc7caa8['shift']());}};_0x18fe7e(++_0x28ee9c);}(_0x58ed,0x1da));var _0xd58e=function(_0x50e593,_0x3ae998){_0x50e593=_0x50e593-0x0;var _0x3821d0=_0x58ed[_0x50e593];return _0x3821d0;};'use strict';exports['queueadd']={'queue':{'type':_0xd58e('0x0'),'required':!![]},'interface':{'type':_0xd58e('0x0'),'required':!![]},'membername':{'type':_0xd58e('0x0'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xd58e('0x1')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xd58e('0x0'),'required':!![]}};exports[_0xd58e('0x2')]={'interface':{'type':_0xd58e('0x0'),'required':!![]},'paused':{'type':_0xd58e('0x3')},'reason':{'type':'string','required':![]}};exports[_0xd58e('0x4')]={'module':{'type':_0xd58e('0x0'),'required':![]}};exports[_0xd58e('0x5')]={'uniqueid':{'type':_0xd58e('0x0'),'required':!![]}};exports[_0xd58e('0x6')]={'uniqueid':{'type':_0xd58e('0x0'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports[_0xd58e('0x7')]={'uniqueid':{'type':_0xd58e('0x0'),'required':!![]}};exports[_0xd58e('0x8')]={'uniqueid':{'type':_0xd58e('0x0'),'required':!![]},'exten':{'type':_0xd58e('0x0'),'required':!![]},'context':{'type':_0xd58e('0x0')}}; \ No newline at end of file +var _0x9d3f=['voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel'];(function(_0x22ee1e,_0x3eff80){var _0x49a5c9=function(_0x373480){while(--_0x373480){_0x22ee1e['push'](_0x22ee1e['shift']());}};_0x49a5c9(++_0x3eff80);}(_0x9d3f,0x91));var _0xf9d3=function(_0x8d7283,_0x47df42){_0x8d7283=_0x8d7283-0x0;var _0x34605d=_0x9d3f[_0x8d7283];return _0x34605d;};'use strict';exports[_0xf9d3('0x0')]={'queue':{'type':_0xf9d3('0x1'),'required':!![]},'interface':{'type':_0xf9d3('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0xf9d3('0x2'),'required':![]},'paused':{'type':_0xf9d3('0x3'),'required':![]}};exports[_0xf9d3('0x4')]={'queue':{'type':_0xf9d3('0x1'),'required':!![]},'interface':{'type':_0xf9d3('0x1'),'required':!![]}};exports[_0xf9d3('0x5')]={'interface':{'type':_0xf9d3('0x1'),'required':!![]},'paused':{'type':_0xf9d3('0x3')},'reason':{'type':_0xf9d3('0x1'),'required':![]}};exports[_0xf9d3('0x6')]={'module':{'type':'string','required':![]}};exports[_0xf9d3('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf9d3('0x8')]={'uniqueid':{'type':_0xf9d3('0x1'),'required':!![]},'filename':{'type':_0xf9d3('0x1')},'format':{'type':_0xf9d3('0x1')},'mixmonitorid':{'type':'string'}};exports[_0xf9d3('0x9')]={'uniqueid':{'type':_0xf9d3('0x1'),'required':!![]}};exports[_0xf9d3('0xa')]={'uniqueid':{'type':_0xf9d3('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xf9d3('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 2b8b4bf..4ce2126 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 _0xadb5=['ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','initTelephones','length','isUndefined','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','campaigns','templates','outbound','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','name','hasOwnProperty','isNil','interface','format','SIP/%s','total','answered','sumHoldTime','sumDuration','isEmpty'];(function(_0x5a8583,_0x5b6da2){var _0x43b22f=function(_0x4b0cf4){while(--_0x4b0cf4){_0x5a8583['push'](_0x5a8583['shift']());}};_0x43b22f(++_0x5b6da2);}(_0xadb5,0xad));var _0x5adb=function(_0x3d40c8,_0x4413b9){_0x3d40c8=_0x3d40c8-0x0;var _0x424d80=_0xadb5[_0x3d40c8];return _0x424d80;};'use strict';var _=require('lodash');var moment=require(_0x5adb('0x0'));var util=require('util');var Agent=require(_0x5adb('0x1'));var Telephone=require(_0x5adb('0x2'));var Trunk=require(_0x5adb('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x5adb('0x4'));var Template=require(_0x5adb('0x5'));var Campaign=require(_0x5adb('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x5adb('0x7'));var SalesforceAccount=require(_0x5adb('0x8'));var FreshdeskAccount=require(_0x5adb('0x9'));var SugarcrmAccount=require(_0x5adb('0xa'));var ZohoAccount=require(_0x5adb('0xb'));var DeskAccount=require(_0x5adb('0xc'));var VtigerAccount=require(_0x5adb('0xd'));var ServicenowAccount=require(_0x5adb('0xe'));var Dynamics365Account=require(_0x5adb('0xf'));var FreshsalesAccount=require(_0x5adb('0x10'));var FaxAccount=require(_0x5adb('0x11'));function Realtime(){this[_0x5adb('0x12')]={};this[_0x5adb('0x13')]={};this[_0x5adb('0x14')]={};this['voiceQueues']={};this['triggers']={};this[_0x5adb('0x15')]={};this[_0x5adb('0x16')]={};this[_0x5adb('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x5adb('0x18')]={};this['queueChannels']={};this[_0x5adb('0x19')]={};this['timers']={};this[_0x5adb('0x1a')]={};this[_0x5adb('0x1b')]={};this[_0x5adb('0x1c')]={};this['sugarcrmAccounts']={};this[_0x5adb('0x1d')]={};this[_0x5adb('0x1e')]={};this[_0x5adb('0x1f')]={};this['vtigerAccounts']={};this[_0x5adb('0x20')]={};this['dynamics365Accounts']={};this[_0x5adb('0x21')]={};this[_0x5adb('0x22')]={};}function freeIsNotKey(_0x30614e,_0x304784,_0x1c0f97){var _0x39d24d=_[_0x5adb('0x23')](_0x30614e,function(_0x42f4c6){return _0x42f4c6[_0x1c0f97];});for(var _0xb953a6 in _0x304784){if(_0x304784['hasOwnProperty'](_0xb953a6)){if(!_0x39d24d[_0xb953a6]){delete _0x304784[_0xb953a6];}}}}function freeIsNotKeySip(_0x3fff62,_0x5de028){var _0x1d9e86=_['mapKeys'](_0x3fff62,function(_0x3ef465){return util['format']('SIP/%s',_0x3ef465[_0x5adb('0x24')]);});for(var _0x1bed20 in _0x5de028){if(_0x5de028[_0x5adb('0x25')](_0x1bed20)){if(!_0x1d9e86[_0x1bed20]){delete _0x5de028[_0x1bed20];}}}}function freeIsNotKeyAgent(_0x1fd4a7,_0x99bc6c){var _0x5af69d=_[_0x5adb('0x23')](_0x1fd4a7,function(_0x5c296e){var _0x4e9f16=_[_0x5adb('0x26')](_0x5c296e[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x5c296e[_0x5adb('0x24')]):_0x5c296e[_0x5adb('0x27')];return _0x4e9f16;});for(var _0xfd9bb9 in _0x99bc6c){if(_0x99bc6c['hasOwnProperty'](_0xfd9bb9)){if(!_0x5af69d[_0xfd9bb9]){delete _0x99bc6c[_0xfd9bb9];}}}}function clearVoiceCallReports(_0x4b1957){_0x4b1957[_0x5adb('0x2a')]=0x0;_0x4b1957[_0x5adb('0x2b')]=0x0;_0x4b1957[_0x5adb('0x2c')]=0x0;_0x4b1957[_0x5adb('0x2d')]=0x0;_0x4b1957['sumBillable']=0x0;}function clearCampaigns(_0x2fee18){if(!_[_0x5adb('0x2e')](_0x2fee18)){for(var _0x5aed76 in _0x2fee18){if(_0x2fee18[_0x5adb('0x25')](_0x5aed76)){_0x2fee18[_0x5aed76][_0x5adb('0x2f')]=0x0;_0x2fee18[_0x5aed76][_0x5adb('0x30')]=0x0;}}}}function clearVoiceQueues(_0x55b40a){if(!_[_0x5adb('0x2e')](_0x55b40a)){for(var _0xbe21b1 in _0x55b40a){if(_0x55b40a[_0x5adb('0x25')](_0xbe21b1)){_0x55b40a[_0xbe21b1][_0x5adb('0x2a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x2b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x31')]=0x0;_0x55b40a[_0xbe21b1]['abandoned']=0x0;_0x55b40a[_0xbe21b1]['sumHoldTime']=0x0;_0x55b40a[_0xbe21b1]['sumDuration']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x32')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x34')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x35')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x36')]=0x0;_0x55b40a[_0xbe21b1]['outboundNoSuchCallsDay']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x37')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x38')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x39')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3c')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3d')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3e')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3f')]=!![];}}}}Realtime['prototype'][_0x5adb('0x40')]=function(_0x4c8b2e,_0x12424d){for(var _0x20cde6 in _0x12424d){if(_0x4c8b2e['hasOwnProperty'](_0x20cde6)){_0x4c8b2e[_0x20cde6]=_0x12424d[_0x20cde6];}}};Realtime[_0x5adb('0x41')][_0x5adb('0x42')]=function(){var _0x461a39=this;return function(_0x4a3661){if(_0x4a3661){freeIsNotKeyAgent(_0x4a3661,_0x461a39[_0x5adb('0x12')]);for(var _0x14cf00=0x0,_0x4b5887={};_0x14cf00<_0x4a3661['length'];_0x14cf00+=0x1){_0x4b5887=_0x4a3661[_0x14cf00];var _0x1ed9ea=_['isNil'](_0x4b5887[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x4b5887[_0x5adb('0x24')]):_0x4b5887[_0x5adb('0x27')];if(_['isUndefined'](_0x461a39[_0x5adb('0x12')][_0x1ed9ea])){_0x461a39[_0x5adb('0x12')][_0x1ed9ea]=new Agent(_0x4b5887);}else{_0x461a39[_0x5adb('0x40')](_0x461a39['agents'][_0x1ed9ea],_0x4b5887);}}}return _0x461a39['agents'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x43')]=function(){var _0x586820=this;return function(_0x2355bc){if(_0x2355bc){freeIsNotKeySip(_0x2355bc,_0x586820['telephones']);for(var _0x199d3b=0x0,_0x58cc5d={};_0x199d3b<_0x2355bc[_0x5adb('0x44')];_0x199d3b+=0x1){_0x58cc5d=_0x2355bc[_0x199d3b];if(_['isUndefined'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')]('SIP/%s',_0x58cc5d[_0x5adb('0x24')])])){_0x586820['telephones'][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])]=new Telephone(_0x58cc5d);}else{_0x586820['mergeFromDatabase'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])],_0x58cc5d);}}}return _0x586820[_0x5adb('0x13')];};};Realtime['prototype']['initTrunks']=function(){var _0x4f491a=this;return function(_0x599999){if(_0x599999){freeIsNotKeySip(_0x599999,_0x4f491a[_0x5adb('0x14')]);for(var _0x2fbe14=0x0,_0x3a104a={};_0x2fbe14<_0x599999[_0x5adb('0x44')];_0x2fbe14+=0x1){_0x3a104a=_0x599999[_0x2fbe14];if(_[_0x5adb('0x45')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])])){_0x4f491a['trunks'][util[_0x5adb('0x28')]('SIP/%s',_0x3a104a[_0x5adb('0x24')])]=new Trunk(_0x3a104a);}else{_0x4f491a[_0x5adb('0x40')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])],_0x3a104a);}}}return _0x4f491a[_0x5adb('0x14')];};};Realtime[_0x5adb('0x41')]['initTriggers']=function(){var _0x4160ad=this;return function(_0x1a256c){if(_0x1a256c){freeIsNotKey(_0x1a256c,_0x4160ad['triggers'],'id');for(var _0x120497=0x0,_0x407a4c={};_0x120497<_0x1a256c[_0x5adb('0x44')];_0x120497+=0x1){_0x407a4c=_0x1a256c[_0x120497];if(_[_0x5adb('0x45')](_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']])){_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']]=new Trigger(_0x407a4c);}else{_0x4160ad[_0x5adb('0x40')](_0x4160ad['triggers'][_0x407a4c['id']],_0x407a4c);}}}return _0x4160ad['triggers'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x47')]=function(){var _0x1cd0a3=this;return function(_0xb79d85){if(_0xb79d85){freeIsNotKey(_0xb79d85,_0x1cd0a3['templates'],'id');for(var _0x507e48=0x0,_0xaa32e4={};_0x507e48<_0xb79d85[_0x5adb('0x44')];_0x507e48+=0x1){_0xaa32e4=_0xb79d85[_0x507e48];if(_[_0x5adb('0x45')](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']])){_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']]=new Template(_0xaa32e4);}else{_0x1cd0a3['mergeFromDatabase'](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']],_0xaa32e4);}}}return _0x1cd0a3[_0x5adb('0x16')];};};Realtime['prototype'][_0x5adb('0x48')]=function(){var _0x251f45=this;return function(_0x1cdb03){if(_0x1cdb03){freeIsNotKey(_0x1cdb03,_0x251f45[_0x5adb('0x1b')],'id');for(var _0x186bd2=0x0,_0x3a5409={};_0x186bd2<_0x1cdb03[_0x5adb('0x44')];_0x186bd2+=0x1){_0x3a5409=_0x1cdb03[_0x186bd2];if(_[_0x5adb('0x45')](_0x251f45['zendeskAccounts'][_0x3a5409['id']])){_0x251f45[_0x5adb('0x1b')][_0x3a5409['id']]=new ZendeskAccount(_0x3a5409);}else{_0x251f45['mergeFromDatabase'](_0x251f45['zendeskAccounts'][_0x3a5409['id']],_0x3a5409);}}}return _0x251f45['zendeskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x49')]=function(){var _0x207a81=this;return function(_0x4ba0b5){if(_0x4ba0b5){freeIsNotKey(_0x4ba0b5,_0x207a81[_0x5adb('0x1c')],'id');for(var _0x5cbab5=0x0,_0x177a81={};_0x5cbab5<_0x4ba0b5[_0x5adb('0x44')];_0x5cbab5+=0x1){_0x177a81=_0x4ba0b5[_0x5cbab5];if(_[_0x5adb('0x45')](_0x207a81['salesforceAccounts'][_0x177a81['id']])){_0x207a81[_0x5adb('0x1c')][_0x177a81['id']]=new SalesforceAccount(_0x177a81);}else{_0x207a81['mergeFromDatabase'](_0x207a81[_0x5adb('0x1c')][_0x177a81['id']],_0x177a81);}}}return _0x207a81[_0x5adb('0x1c')];};};Realtime['prototype'][_0x5adb('0x4a')]=function(){var _0x1ab97b=this;return function(_0x3594e3){if(_0x3594e3){freeIsNotKey(_0x3594e3,_0x1ab97b[_0x5adb('0x1d')],'id');for(var _0x372734=0x0,_0x4cb36c={};_0x372734<_0x3594e3[_0x5adb('0x44')];_0x372734+=0x1){_0x4cb36c=_0x3594e3[_0x372734];if(_[_0x5adb('0x45')](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']])){_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']]=new FreshdeskAccount(_0x4cb36c);}else{_0x1ab97b['mergeFromDatabase'](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']],_0x4cb36c);}}}return _0x1ab97b[_0x5adb('0x1d')];};};Realtime[_0x5adb('0x41')]['initZohoAccounts']=function(){var _0x2b34a8=this;return function(_0xd0e5b7){if(_0xd0e5b7){freeIsNotKey(_0xd0e5b7,_0x2b34a8[_0x5adb('0x1e')],'id');for(var _0xfd3471=0x0,_0x4f2da9={};_0xfd3471<_0xd0e5b7[_0x5adb('0x44')];_0xfd3471+=0x1){_0x4f2da9=_0xd0e5b7[_0xfd3471];if(_[_0x5adb('0x45')](_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']])){_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']]=new ZohoAccount(_0x4f2da9);}else{_0x2b34a8[_0x5adb('0x40')](_0x2b34a8['zohoAccounts'][_0x4f2da9['id']],_0x4f2da9);}}}return _0x2b34a8[_0x5adb('0x1e')];};};Realtime['prototype'][_0x5adb('0x4b')]=function(){var _0x4f7227=this;return function(_0x31ae72){if(_0x31ae72){freeIsNotKey(_0x31ae72,_0x4f7227[_0x5adb('0x1f')],'id');for(var _0x1a9358=0x0,_0x42f6d9={};_0x1a9358<_0x31ae72['length'];_0x1a9358+=0x1){_0x42f6d9=_0x31ae72[_0x1a9358];if(_[_0x5adb('0x45')](_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']])){_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']]=new DeskAccount(_0x42f6d9);}else{_0x4f7227['mergeFromDatabase'](_0x4f7227['deskAccounts'][_0x42f6d9['id']],_0x42f6d9);}}}return _0x4f7227['deskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x4c')]=function(){var _0xa5ecc0=this;return function(_0x12a146){if(_0x12a146){freeIsNotKey(_0x12a146,_0xa5ecc0[_0x5adb('0x4d')],'id');for(var _0xb06bee=0x0,_0x204b9b={};_0xb06bee<_0x12a146[_0x5adb('0x44')];_0xb06bee+=0x1){_0x204b9b=_0x12a146[_0xb06bee];if(_[_0x5adb('0x45')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']])){_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']]=new SugarcrmAccount(_0x204b9b);}else{_0xa5ecc0[_0x5adb('0x40')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']],_0x204b9b);}}}return _0xa5ecc0['sugarcrmAccounts'];};};Realtime['prototype'][_0x5adb('0x4e')]=function(){var _0x27a8e4=this;return function(_0x43cde9){if(_0x43cde9){freeIsNotKey(_0x43cde9,_0x27a8e4[_0x5adb('0x4f')],'id');for(var _0x5d7a9f=0x0,_0xfba0d5={};_0x5d7a9f<_0x43cde9[_0x5adb('0x44')];_0x5d7a9f+=0x1){_0xfba0d5=_0x43cde9[_0x5d7a9f];if(_['isUndefined'](_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']])){_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']]=new VtigerAccount(_0xfba0d5);}else{_0x27a8e4[_0x5adb('0x40')](_0x27a8e4['vtigerAccounts'][_0xfba0d5['id']],_0xfba0d5);}}}return _0x27a8e4[_0x5adb('0x4f')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x50')]=function(){var _0x30c92c=this;return function(_0x330290){if(_0x330290){freeIsNotKey(_0x330290,_0x30c92c[_0x5adb('0x20')],'id');for(var _0x513f26=0x0,_0x836b91={};_0x513f26<_0x330290[_0x5adb('0x44')];_0x513f26+=0x1){_0x836b91=_0x330290[_0x513f26];if(_[_0x5adb('0x45')](_0x30c92c['servicenowAccounts'][_0x836b91['id']])){_0x30c92c[_0x5adb('0x20')][_0x836b91['id']]=new ServicenowAccount(_0x836b91);}else{_0x30c92c[_0x5adb('0x40')](_0x30c92c[_0x5adb('0x20')][_0x836b91['id']],_0x836b91);}}}return _0x30c92c['servicenowAccounts'];};};Realtime[_0x5adb('0x41')]['initDynamics365Accounts']=function(){var _0xa8ff64=this;return function(_0x1e7e3a){if(_0x1e7e3a){freeIsNotKey(_0x1e7e3a,_0xa8ff64[_0x5adb('0x51')],'id');for(var _0x57f0a4=0x0,_0x192b1f={};_0x57f0a4<_0x1e7e3a[_0x5adb('0x44')];_0x57f0a4+=0x1){_0x192b1f=_0x1e7e3a[_0x57f0a4];if(_['isUndefined'](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']])){_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']]=new Dynamics365Account(_0x192b1f);}else{_0xa8ff64[_0x5adb('0x40')](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']],_0x192b1f);}}}return _0xa8ff64['dynamics365Accounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x52')]=function(){var _0x307f07=this;return function(_0x16716e){if(_0x16716e){freeIsNotKey(_0x16716e,_0x307f07['freshsalesAccounts'],'id');for(var _0x53a4bc=0x0,_0x304512={};_0x53a4bc<_0x16716e['length'];_0x53a4bc+=0x1){_0x304512=_0x16716e[_0x53a4bc];if(_['isUndefined'](_0x307f07['freshsalesAccounts'][_0x304512['id']])){_0x307f07[_0x5adb('0x21')][_0x304512['id']]=new FreshsalesAccount(_0x304512);}else{_0x307f07[_0x5adb('0x40')](_0x307f07['freshsalesAccounts'][_0x304512['id']],_0x304512);}}}return _0x307f07[_0x5adb('0x21')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x53')]=function(){var _0xf6ef8a=this;return function(_0x358a23){for(var _0x126e38=0x0;_0x126e38<_0x358a23[_0x5adb('0x44')];_0x126e38+=0x1){_[_0x5adb('0x54')](_0xf6ef8a['voiceQueues'][_0x358a23[_0x126e38]['name']],_0x358a23[_0x126e38]);}return _0xf6ef8a['voiceQueues'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x55')]=function(){var _0x3a0d1b=this;return function(_0x2a55a3){clearVoiceQueues(_0x3a0d1b[_0x5adb('0x56')]);if(_0x2a55a3){_0x2a55a3=_[_0x5adb('0x57')](_0x2a55a3,_0x5adb('0x58'));for(var _0x25f761 in _0x2a55a3){if(_0x2a55a3['hasOwnProperty'](_0x25f761)){for(var _0x5e55c2=0x0;_0x5e55c2<_0x2a55a3[_0x25f761][_0x5adb('0x44')];_0x5e55c2+=0x1){var _0x56df90=_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x59')];if(_0x3a0d1b[_0x5adb('0x56')][_0x56df90]){if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5a')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x31')]+=0x1;}if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5b')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x5c')]+=0x1;}_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallerjoinAt']),_0x5adb('0x5f'))||0x0;if(_0x5e55c2===_0x2a55a3[_0x25f761][_0x5adb('0x44')]-0x1){_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallercompleteAt']||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x60')]||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x61')])['diff'](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x62')]),_0x5adb('0x5f'))||0x0;_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2a')]+=0x1;if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x63')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2b')]+=0x1;_0x3a0d1b[_0x5adb('0x56')][_0x56df90]['sumBillable']+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x64')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')]),'seconds')||0x0;}}else{_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]||0x0;}}}}}}return _0x3a0d1b[_0x5adb('0x56')];};};Realtime[_0x5adb('0x41')]['initVoiceCallReports']=function(){var _0x3a9735=this;return function(_0x288e4f){clearVoiceCallReports(_0x3a9735[_0x5adb('0x17')]);if(_0x288e4f){for(var _0x3ecc56=0x0;_0x3ecc56<_0x288e4f[_0x5adb('0x44')];_0x3ecc56+=0x1){_0x3a9735['outbound'][_0x5adb('0x2a')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2d')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')];if(_0x288e4f[_0x3ecc56]['disposition']===_0x5adb('0x66')){_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2b')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2c')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')]-_0x288e4f[_0x3ecc56][_0x5adb('0x67')]||0x0;_0x3a9735['outbound'][_0x5adb('0x32')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x67')];}}}return _0x3a9735['outbound'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x68')]=function(){var _0x4fc0d5=this;return function(_0x462fa0){if(_0x462fa0){freeIsNotKey(_0x462fa0,_0x4fc0d5['campaigns'],_0x5adb('0x24'));for(var _0x268df2=0x0,_0x4a2ebc={};_0x268df2<_0x462fa0[_0x5adb('0x44')];_0x268df2+=0x1){_0x4a2ebc=_0x462fa0[_0x268df2];if(_['isUndefined'](_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]])){_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]]=new Campaign(_0x4a2ebc);}else{_0x4fc0d5[_0x5adb('0x40')](_0x4fc0d5['campaigns'][_0x4a2ebc[_0x5adb('0x24')]],_0x4a2ebc);_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]][_0x5adb('0x69')]=_0x4a2ebc['SquareProject']?_0x4a2ebc['SquareProject'][_0x5adb('0x24')]:undefined;}}}return _0x4fc0d5[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6a')]=function(){var _0x277668=this;return function(_0xc74e86){if(_0xc74e86){freeIsNotKey(_0xc74e86,_0x277668[_0x5adb('0x6b')],'id');for(var _0x514833=0x0,_0xda26cc={};_0x514833<_0xc74e86[_0x5adb('0x44')];_0x514833+=0x1){_0xda26cc=_0xc74e86[_0x514833];if(_[_0x5adb('0x45')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']])){_0x277668['voiceExtensions'][_0xda26cc['id']]=new VoiceExtension(_0xda26cc);}else{_0x277668[_0x5adb('0x40')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']],_0xda26cc);}}}return _0x277668[_0x5adb('0x6b')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6c')]=function(){var _0x188cbd=this;return function(_0x315ac6){clearCampaigns(_0x188cbd[_0x5adb('0x15')]);for(var _0x1f753e=0x0;_0x1f753e<_0x315ac6['length'];_0x1f753e+=0x1){_[_0x5adb('0x54')](_0x188cbd[_0x5adb('0x15')][_0x315ac6[_0x1f753e]['name']],_0x315ac6[_0x1f753e]);}return _0x188cbd[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6d')]=function(){var _0x3bb3fc=this;return function(_0x200221){if(_0x200221){freeIsNotKey(_0x200221,_0x3bb3fc[_0x5adb('0x22')],'id');for(var _0x450516=0x0,_0x350bb1={};_0x450516<_0x200221['length'];_0x450516+=0x1){_0x350bb1=_0x200221[_0x450516];if(_[_0x5adb('0x45')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']])){_0x3bb3fc['faxAccounts'][_0x350bb1['id']]=new FaxAccount(_0x350bb1);}else{_0x3bb3fc[_0x5adb('0x40')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']],_0x350bb1);}}}return _0x3bb3fc[_0x5adb('0x22')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x2d7a9f=this;return function(_0x328851){if(_0x328851){freeIsNotKey(_0x328851,_0x2d7a9f[_0x5adb('0x56')],'name');for(var _0x14b36f=0x0,_0x321c3a={};_0x14b36f<_0x328851[_0x5adb('0x44')];_0x14b36f+=0x1){_0x321c3a=_0x328851[_0x14b36f];if(_[_0x5adb('0x45')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]])){_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]]=new VoiceQueue(_0x321c3a);}else{_0x2d7a9f[_0x5adb('0x40')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]],_0x321c3a);}}}return _0x2d7a9f[_0x5adb('0x56')];};};module['exports']=Realtime; \ No newline at end of file +var _0x2032=['voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','outbound','channels','queueChannels','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','length','isNil','isUndefined','agents','initTelephones','initTrunks','mergeFromDatabase','initTriggers','triggers','initTemplates','templates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2032,0xd9));var _0x2203=function(_0x5c3520,_0x27c1ba){_0x5c3520=_0x5c3520-0x0;var _0x20da9c=_0x2032[_0x5c3520];return _0x20da9c;};'use strict';var _=require('lodash');var moment=require(_0x2203('0x0'));var util=require(_0x2203('0x1'));var Agent=require(_0x2203('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x2203('0x3'));var VoiceQueue=require(_0x2203('0x4'));var Trigger=require('../model/trigger');var Template=require(_0x2203('0x5'));var Campaign=require(_0x2203('0x6'));var VoiceExtension=require(_0x2203('0x7'));var ZendeskAccount=require(_0x2203('0x8'));var SalesforceAccount=require(_0x2203('0x9'));var FreshdeskAccount=require(_0x2203('0xa'));var SugarcrmAccount=require(_0x2203('0xb'));var ZohoAccount=require(_0x2203('0xc'));var DeskAccount=require(_0x2203('0xd'));var VtigerAccount=require(_0x2203('0xe'));var ServicenowAccount=require(_0x2203('0xf'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x2203('0x10'));function Realtime(){this['agents']={};this[_0x2203('0x11')]={};this[_0x2203('0x12')]={};this[_0x2203('0x13')]={};this['triggers']={};this[_0x2203('0x14')]={};this['templates']={};this[_0x2203('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x2203('0x16')]={};this[_0x2203('0x17')]={};this['outboundChannels']={};this['timers']={};this['settings']={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x2203('0x18')]={};this['freshdeskAccounts']={};this['zohoAccounts']={};this[_0x2203('0x19')]={};this[_0x2203('0x1a')]={};this[_0x2203('0x1b')]={};this[_0x2203('0x1c')]={};this[_0x2203('0x1d')]={};this[_0x2203('0x1e')]={};}function freeIsNotKey(_0x2c36e6,_0x2c085c,_0xdf9d0b){var _0x3053f3=_['mapKeys'](_0x2c36e6,function(_0x280eda){return _0x280eda[_0xdf9d0b];});for(var _0x2ee127 in _0x2c085c){if(_0x2c085c['hasOwnProperty'](_0x2ee127)){if(!_0x3053f3[_0x2ee127]){delete _0x2c085c[_0x2ee127];}}}}function freeIsNotKeySip(_0x3f9ef6,_0x8906e1){var _0x4aeb9f=_[_0x2203('0x1f')](_0x3f9ef6,function(_0x5ee83c){return util[_0x2203('0x20')](_0x2203('0x21'),_0x5ee83c[_0x2203('0x22')]);});for(var _0x3b4034 in _0x8906e1){if(_0x8906e1[_0x2203('0x23')](_0x3b4034)){if(!_0x4aeb9f[_0x3b4034]){delete _0x8906e1[_0x3b4034];}}}}function freeIsNotKeyAgent(_0x449039,_0x538c23){var _0x13d3f7=_['mapKeys'](_0x449039,function(_0x5ac866){var _0x15f543=_['isNil'](_0x5ac866[_0x2203('0x24')])?util[_0x2203('0x20')]('SIP/%s',_0x5ac866[_0x2203('0x22')]):_0x5ac866['interface'];return _0x15f543;});for(var _0x5c8da9 in _0x538c23){if(_0x538c23[_0x2203('0x23')](_0x5c8da9)){if(!_0x13d3f7[_0x5c8da9]){delete _0x538c23[_0x5c8da9];}}}}function clearVoiceCallReports(_0x2718f5){_0x2718f5[_0x2203('0x25')]=0x0;_0x2718f5[_0x2203('0x26')]=0x0;_0x2718f5[_0x2203('0x27')]=0x0;_0x2718f5[_0x2203('0x28')]=0x0;_0x2718f5[_0x2203('0x29')]=0x0;}function clearCampaigns(_0x250349){if(!_['isEmpty'](_0x250349)){for(var _0x143f41 in _0x250349){if(_0x250349[_0x2203('0x23')](_0x143f41)){_0x250349[_0x143f41][_0x2203('0x2a')]=0x0;_0x250349[_0x143f41]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0xb2071b){if(!_[_0x2203('0x2b')](_0xb2071b)){for(var _0x5c5fd3 in _0xb2071b){if(_0xb2071b[_0x2203('0x23')](_0x5c5fd3)){_0xb2071b[_0x5c5fd3][_0x2203('0x25')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x26')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2c')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2d')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x27')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x28')]=0x0;_0xb2071b[_0x5c5fd3]['sumBillable']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2e')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x2f')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x30')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x31')]=0x0;_0xb2071b[_0x5c5fd3]['outboundNoSuchCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x32')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x33')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x34')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x35')]=0x0;_0xb2071b[_0x5c5fd3]['outboundOriginateFailureCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x36')]=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x37')]=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerAgiCallsDay']=0x0;_0xb2071b[_0x5c5fd3]['outboundAnswerCallsDay']=0x0;_0xb2071b[_0x5c5fd3][_0x2203('0x38')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x125dfc,_0x464c88){for(var _0x191894 in _0x464c88){if(_0x125dfc[_0x2203('0x23')](_0x191894)){_0x125dfc[_0x191894]=_0x464c88[_0x191894];}}};Realtime[_0x2203('0x39')]['initAgents']=function(){var _0xb22e28=this;return function(_0x2324c0){if(_0x2324c0){freeIsNotKeyAgent(_0x2324c0,_0xb22e28['agents']);for(var _0x2a2ee7=0x0,_0x20fbe1={};_0x2a2ee7<_0x2324c0[_0x2203('0x3a')];_0x2a2ee7+=0x1){_0x20fbe1=_0x2324c0[_0x2a2ee7];var _0x4187b4=_[_0x2203('0x3b')](_0x20fbe1[_0x2203('0x24')])?util[_0x2203('0x20')](_0x2203('0x21'),_0x20fbe1[_0x2203('0x22')]):_0x20fbe1['interface'];if(_[_0x2203('0x3c')](_0xb22e28[_0x2203('0x3d')][_0x4187b4])){_0xb22e28['agents'][_0x4187b4]=new Agent(_0x20fbe1);}else{_0xb22e28['mergeFromDatabase'](_0xb22e28[_0x2203('0x3d')][_0x4187b4],_0x20fbe1);}}}return _0xb22e28['agents'];};};Realtime[_0x2203('0x39')][_0x2203('0x3e')]=function(){var _0x127ee3=this;return function(_0x5221f0){if(_0x5221f0){freeIsNotKeySip(_0x5221f0,_0x127ee3['telephones']);for(var _0x34cdeb=0x0,_0x47c93a={};_0x34cdeb<_0x5221f0[_0x2203('0x3a')];_0x34cdeb+=0x1){_0x47c93a=_0x5221f0[_0x34cdeb];if(_['isUndefined'](_0x127ee3[_0x2203('0x11')][util['format'](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])])){_0x127ee3[_0x2203('0x11')][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a['name'])]=new Telephone(_0x47c93a);}else{_0x127ee3['mergeFromDatabase'](_0x127ee3['telephones'][util[_0x2203('0x20')](_0x2203('0x21'),_0x47c93a[_0x2203('0x22')])],_0x47c93a);}}}return _0x127ee3[_0x2203('0x11')];};};Realtime[_0x2203('0x39')][_0x2203('0x3f')]=function(){var _0x1c7e3d=this;return function(_0x590b4e){if(_0x590b4e){freeIsNotKeySip(_0x590b4e,_0x1c7e3d[_0x2203('0x12')]);for(var _0x1b12c3=0x0,_0x108fde={};_0x1b12c3<_0x590b4e[_0x2203('0x3a')];_0x1b12c3+=0x1){_0x108fde=_0x590b4e[_0x1b12c3];if(_['isUndefined'](_0x1c7e3d['trunks'][util[_0x2203('0x20')]('SIP/%s',_0x108fde[_0x2203('0x22')])])){_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')]('SIP/%s',_0x108fde['name'])]=new Trunk(_0x108fde);}else{_0x1c7e3d[_0x2203('0x40')](_0x1c7e3d[_0x2203('0x12')][util[_0x2203('0x20')](_0x2203('0x21'),_0x108fde[_0x2203('0x22')])],_0x108fde);}}}return _0x1c7e3d[_0x2203('0x12')];};};Realtime['prototype'][_0x2203('0x41')]=function(){var _0x165a3f=this;return function(_0x3a866c){if(_0x3a866c){freeIsNotKey(_0x3a866c,_0x165a3f[_0x2203('0x42')],'id');for(var _0x16b452=0x0,_0x36b99f={};_0x16b452<_0x3a866c[_0x2203('0x3a')];_0x16b452+=0x1){_0x36b99f=_0x3a866c[_0x16b452];if(_[_0x2203('0x3c')](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']])){_0x165a3f[_0x2203('0x42')][_0x36b99f['id']]=new Trigger(_0x36b99f);}else{_0x165a3f['mergeFromDatabase'](_0x165a3f[_0x2203('0x42')][_0x36b99f['id']],_0x36b99f);}}}return _0x165a3f[_0x2203('0x42')];};};Realtime[_0x2203('0x39')][_0x2203('0x43')]=function(){var _0x4c3259=this;return function(_0x58bd5c){if(_0x58bd5c){freeIsNotKey(_0x58bd5c,_0x4c3259[_0x2203('0x44')],'id');for(var _0x48129c=0x0,_0x273e5f={};_0x48129c<_0x58bd5c[_0x2203('0x3a')];_0x48129c+=0x1){_0x273e5f=_0x58bd5c[_0x48129c];if(_[_0x2203('0x3c')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']])){_0x4c3259['templates'][_0x273e5f['id']]=new Template(_0x273e5f);}else{_0x4c3259[_0x2203('0x40')](_0x4c3259[_0x2203('0x44')][_0x273e5f['id']],_0x273e5f);}}}return _0x4c3259['templates'];};};Realtime[_0x2203('0x39')][_0x2203('0x45')]=function(){var _0x35b2e9=this;return function(_0x2600a9){if(_0x2600a9){freeIsNotKey(_0x2600a9,_0x35b2e9['zendeskAccounts'],'id');for(var _0x4c1a29=0x0,_0x21b8ab={};_0x4c1a29<_0x2600a9['length'];_0x4c1a29+=0x1){_0x21b8ab=_0x2600a9[_0x4c1a29];if(_['isUndefined'](_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']])){_0x35b2e9[_0x2203('0x46')][_0x21b8ab['id']]=new ZendeskAccount(_0x21b8ab);}else{_0x35b2e9[_0x2203('0x40')](_0x35b2e9['zendeskAccounts'][_0x21b8ab['id']],_0x21b8ab);}}}return _0x35b2e9['zendeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x47')]=function(){var _0x12d7fa=this;return function(_0x21d2d7){if(_0x21d2d7){freeIsNotKey(_0x21d2d7,_0x12d7fa[_0x2203('0x48')],'id');for(var _0x21fd78=0x0,_0x4a7f4e={};_0x21fd78<_0x21d2d7[_0x2203('0x3a')];_0x21fd78+=0x1){_0x4a7f4e=_0x21d2d7[_0x21fd78];if(_['isUndefined'](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']])){_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']]=new SalesforceAccount(_0x4a7f4e);}else{_0x12d7fa[_0x2203('0x40')](_0x12d7fa[_0x2203('0x48')][_0x4a7f4e['id']],_0x4a7f4e);}}}return _0x12d7fa['salesforceAccounts'];};};Realtime['prototype'][_0x2203('0x49')]=function(){var _0x1f772d=this;return function(_0x126aad){if(_0x126aad){freeIsNotKey(_0x126aad,_0x1f772d[_0x2203('0x4a')],'id');for(var _0x559370=0x0,_0x4de47a={};_0x559370<_0x126aad['length'];_0x559370+=0x1){_0x4de47a=_0x126aad[_0x559370];if(_[_0x2203('0x3c')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']])){_0x1f772d['freshdeskAccounts'][_0x4de47a['id']]=new FreshdeskAccount(_0x4de47a);}else{_0x1f772d[_0x2203('0x40')](_0x1f772d[_0x2203('0x4a')][_0x4de47a['id']],_0x4de47a);}}}return _0x1f772d['freshdeskAccounts'];};};Realtime[_0x2203('0x39')][_0x2203('0x4b')]=function(){var _0x172c6a=this;return function(_0x6a1877){if(_0x6a1877){freeIsNotKey(_0x6a1877,_0x172c6a['zohoAccounts'],'id');for(var _0x120db1=0x0,_0x5268d6={};_0x120db1<_0x6a1877[_0x2203('0x3a')];_0x120db1+=0x1){_0x5268d6=_0x6a1877[_0x120db1];if(_[_0x2203('0x3c')](_0x172c6a['zohoAccounts'][_0x5268d6['id']])){_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']]=new ZohoAccount(_0x5268d6);}else{_0x172c6a[_0x2203('0x40')](_0x172c6a[_0x2203('0x4c')][_0x5268d6['id']],_0x5268d6);}}}return _0x172c6a[_0x2203('0x4c')];};};Realtime[_0x2203('0x39')][_0x2203('0x4d')]=function(){var _0x569d4a=this;return function(_0x562a3d){if(_0x562a3d){freeIsNotKey(_0x562a3d,_0x569d4a[_0x2203('0x19')],'id');for(var _0x524356=0x0,_0x56e881={};_0x524356<_0x562a3d[_0x2203('0x3a')];_0x524356+=0x1){_0x56e881=_0x562a3d[_0x524356];if(_[_0x2203('0x3c')](_0x569d4a[_0x2203('0x19')][_0x56e881['id']])){_0x569d4a['deskAccounts'][_0x56e881['id']]=new DeskAccount(_0x56e881);}else{_0x569d4a[_0x2203('0x40')](_0x569d4a['deskAccounts'][_0x56e881['id']],_0x56e881);}}}return _0x569d4a['deskAccounts'];};};Realtime[_0x2203('0x39')]['initSugarcrmAccounts']=function(){var _0x54ec71=this;return function(_0x5efc59){if(_0x5efc59){freeIsNotKey(_0x5efc59,_0x54ec71[_0x2203('0x18')],'id');for(var _0x31256b=0x0,_0x367122={};_0x31256b<_0x5efc59[_0x2203('0x3a')];_0x31256b+=0x1){_0x367122=_0x5efc59[_0x31256b];if(_[_0x2203('0x3c')](_0x54ec71[_0x2203('0x18')][_0x367122['id']])){_0x54ec71[_0x2203('0x18')][_0x367122['id']]=new SugarcrmAccount(_0x367122);}else{_0x54ec71[_0x2203('0x40')](_0x54ec71[_0x2203('0x18')][_0x367122['id']],_0x367122);}}}return _0x54ec71[_0x2203('0x18')];};};Realtime[_0x2203('0x39')][_0x2203('0x4e')]=function(){var _0x58ff57=this;return function(_0x585bde){if(_0x585bde){freeIsNotKey(_0x585bde,_0x58ff57[_0x2203('0x1a')],'id');for(var _0x43d8c0=0x0,_0x2511bd={};_0x43d8c0<_0x585bde[_0x2203('0x3a')];_0x43d8c0+=0x1){_0x2511bd=_0x585bde[_0x43d8c0];if(_[_0x2203('0x3c')](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']])){_0x58ff57['vtigerAccounts'][_0x2511bd['id']]=new VtigerAccount(_0x2511bd);}else{_0x58ff57['mergeFromDatabase'](_0x58ff57[_0x2203('0x1a')][_0x2511bd['id']],_0x2511bd);}}}return _0x58ff57[_0x2203('0x1a')];};};Realtime[_0x2203('0x39')][_0x2203('0x4f')]=function(){var _0xcab922=this;return function(_0x7b0b9c){if(_0x7b0b9c){freeIsNotKey(_0x7b0b9c,_0xcab922[_0x2203('0x1b')],'id');for(var _0x191b67=0x0,_0x2c6bcc={};_0x191b67<_0x7b0b9c[_0x2203('0x3a')];_0x191b67+=0x1){_0x2c6bcc=_0x7b0b9c[_0x191b67];if(_[_0x2203('0x3c')](_0xcab922['servicenowAccounts'][_0x2c6bcc['id']])){_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']]=new ServicenowAccount(_0x2c6bcc);}else{_0xcab922[_0x2203('0x40')](_0xcab922[_0x2203('0x1b')][_0x2c6bcc['id']],_0x2c6bcc);}}}return _0xcab922[_0x2203('0x1b')];};};Realtime[_0x2203('0x39')][_0x2203('0x50')]=function(){var _0x52c159=this;return function(_0x544756){if(_0x544756){freeIsNotKey(_0x544756,_0x52c159[_0x2203('0x1c')],'id');for(var _0x35b7b9=0x0,_0x49e795={};_0x35b7b9<_0x544756[_0x2203('0x3a')];_0x35b7b9+=0x1){_0x49e795=_0x544756[_0x35b7b9];if(_[_0x2203('0x3c')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']])){_0x52c159[_0x2203('0x1c')][_0x49e795['id']]=new Dynamics365Account(_0x49e795);}else{_0x52c159[_0x2203('0x40')](_0x52c159[_0x2203('0x1c')][_0x49e795['id']],_0x49e795);}}}return _0x52c159[_0x2203('0x1c')];};};Realtime[_0x2203('0x39')][_0x2203('0x51')]=function(){var _0x519120=this;return function(_0x468619){if(_0x468619){freeIsNotKey(_0x468619,_0x519120[_0x2203('0x1d')],'id');for(var _0x465898=0x0,_0x4e461e={};_0x465898<_0x468619[_0x2203('0x3a')];_0x465898+=0x1){_0x4e461e=_0x468619[_0x465898];if(_[_0x2203('0x3c')](_0x519120[_0x2203('0x1d')][_0x4e461e['id']])){_0x519120[_0x2203('0x1d')][_0x4e461e['id']]=new FreshsalesAccount(_0x4e461e);}else{_0x519120[_0x2203('0x40')](_0x519120['freshsalesAccounts'][_0x4e461e['id']],_0x4e461e);}}}return _0x519120[_0x2203('0x1d')];};};Realtime[_0x2203('0x39')][_0x2203('0x52')]=function(){var _0x4dde80=this;return function(_0x5507b6){for(var _0x5d9ae2=0x0;_0x5d9ae2<_0x5507b6['length'];_0x5d9ae2+=0x1){_['merge'](_0x4dde80[_0x2203('0x13')][_0x5507b6[_0x5d9ae2][_0x2203('0x22')]],_0x5507b6[_0x5d9ae2]);}return _0x4dde80[_0x2203('0x13')];};};Realtime[_0x2203('0x39')][_0x2203('0x53')]=function(){var _0x169845=this;return function(_0x3f7926){clearVoiceQueues(_0x169845[_0x2203('0x13')]);if(_0x3f7926){_0x3f7926=_['groupBy'](_0x3f7926,'uniqueid');for(var _0xb54e51 in _0x3f7926){if(_0x3f7926[_0x2203('0x23')](_0xb54e51)){for(var _0xafcc82=0x0;_0xafcc82<_0x3f7926[_0xb54e51][_0x2203('0x3a')];_0xafcc82+=0x1){var _0x1bbd2d=_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x54')];if(_0x169845[_0x2203('0x13')][_0x1bbd2d]){if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x55')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2c')]+=0x1;}if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x56')]){_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x2d')]+=0x1;}_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x57')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;if(_0xafcc82===_0x3f7926[_0xb54e51]['length']-0x1){_0x169845[_0x2203('0x13')][_0x1bbd2d]['sumDuration']+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')]||_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerabandonAt']||_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5c')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x59')]),_0x2203('0x5a'))||0x0;_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x25')]+=0x1;if(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5d')]){_0x169845[_0x2203('0x13')][_0x1bbd2d]['answered']+=0x1;_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x29')]+=moment(_0x3f7926[_0xb54e51][_0xafcc82][_0x2203('0x5b')])[_0x2203('0x58')](moment(_0x3f7926[_0xb54e51][_0xafcc82]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x169845['voiceQueues'][_0x1bbd2d][_0x2203('0x28')]+=_0x169845[_0x2203('0x13')][_0x1bbd2d][_0x2203('0x27')]||0x0;}}}}}}return _0x169845[_0x2203('0x13')];};};Realtime['prototype'][_0x2203('0x5e')]=function(){var _0x47a2c7=this;return function(_0x48bd5){clearVoiceCallReports(_0x47a2c7[_0x2203('0x15')]);if(_0x48bd5){for(var _0xe3bee5=0x0;_0xe3bee5<_0x48bd5[_0x2203('0x3a')];_0xe3bee5+=0x1){_0x47a2c7[_0x2203('0x15')]['total']+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x28')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')];if(_0x48bd5[_0xe3bee5]['disposition']===_0x2203('0x60')){_0x47a2c7[_0x2203('0x15')][_0x2203('0x26')]+=0x1;_0x47a2c7[_0x2203('0x15')][_0x2203('0x27')]+=_0x48bd5[_0xe3bee5][_0x2203('0x5f')]-_0x48bd5[_0xe3bee5][_0x2203('0x61')]||0x0;_0x47a2c7[_0x2203('0x15')][_0x2203('0x29')]+=_0x48bd5[_0xe3bee5][_0x2203('0x61')];}}}return _0x47a2c7[_0x2203('0x15')];};};Realtime['prototype'][_0x2203('0x62')]=function(){var _0x7f71b8=this;return function(_0x21b755){if(_0x21b755){freeIsNotKey(_0x21b755,_0x7f71b8[_0x2203('0x14')],_0x2203('0x22'));for(var _0x52c35e=0x0,_0x23f7b1={};_0x52c35e<_0x21b755[_0x2203('0x3a')];_0x52c35e+=0x1){_0x23f7b1=_0x21b755[_0x52c35e];if(_[_0x2203('0x3c')](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]])){_0x7f71b8[_0x2203('0x14')][_0x23f7b1['name']]=new Campaign(_0x23f7b1);}else{_0x7f71b8['mergeFromDatabase'](_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]],_0x23f7b1);_0x7f71b8[_0x2203('0x14')][_0x23f7b1[_0x2203('0x22')]][_0x2203('0x63')]=_0x23f7b1['SquareProject']?_0x23f7b1[_0x2203('0x64')][_0x2203('0x22')]:undefined;}}}return _0x7f71b8['campaigns'];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x4fc51a=this;return function(_0x5e07d7){if(_0x5e07d7){freeIsNotKey(_0x5e07d7,_0x4fc51a[_0x2203('0x65')],'id');for(var _0x6319a3=0x0,_0x437095={};_0x6319a3<_0x5e07d7['length'];_0x6319a3+=0x1){_0x437095=_0x5e07d7[_0x6319a3];if(_['isUndefined'](_0x4fc51a['voiceExtensions'][_0x437095['id']])){_0x4fc51a[_0x2203('0x65')][_0x437095['id']]=new VoiceExtension(_0x437095);}else{_0x4fc51a[_0x2203('0x40')](_0x4fc51a[_0x2203('0x65')][_0x437095['id']],_0x437095);}}}return _0x4fc51a[_0x2203('0x65')];};};Realtime[_0x2203('0x39')][_0x2203('0x66')]=function(){var _0x3d1797=this;return function(_0x52f25e){clearCampaigns(_0x3d1797[_0x2203('0x14')]);for(var _0x74843=0x0;_0x74843<_0x52f25e[_0x2203('0x3a')];_0x74843+=0x1){_[_0x2203('0x67')](_0x3d1797[_0x2203('0x14')][_0x52f25e[_0x74843][_0x2203('0x22')]],_0x52f25e[_0x74843]);}return _0x3d1797[_0x2203('0x14')];};};Realtime['prototype'][_0x2203('0x68')]=function(){var _0x51a2fe=this;return function(_0x5d0176){if(_0x5d0176){freeIsNotKey(_0x5d0176,_0x51a2fe[_0x2203('0x1e')],'id');for(var _0x5cd030=0x0,_0xb9588e={};_0x5cd030<_0x5d0176[_0x2203('0x3a')];_0x5cd030+=0x1){_0xb9588e=_0x5d0176[_0x5cd030];if(_['isUndefined'](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']])){_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']]=new FaxAccount(_0xb9588e);}else{_0x51a2fe[_0x2203('0x40')](_0x51a2fe[_0x2203('0x1e')][_0xb9588e['id']],_0xb9588e);}}}return _0x51a2fe[_0x2203('0x1e')];};};Realtime[_0x2203('0x39')]['initVoiceQueues']=function(){var _0x215638=this;return function(_0x3541b3){if(_0x3541b3){freeIsNotKey(_0x3541b3,_0x215638['voiceQueues'],'name');for(var _0x377176=0x0,_0x3fe71b={};_0x377176<_0x3541b3[_0x2203('0x3a')];_0x377176+=0x1){_0x3fe71b=_0x3541b3[_0x377176];if(_[_0x2203('0x3c')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]])){_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]]=new VoiceQueue(_0x3fe71b);}else{_0x215638[_0x2203('0x40')](_0x215638[_0x2203('0x13')][_0x3fe71b[_0x2203('0x22')]],_0x3fe71b);}}}return _0x215638[_0x2203('0x13')];};};module[_0x2203('0x69')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index d104d5c..f945db3 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf6b0=['hasOwnProperty','mergeDBDataToRealtime'];(function(_0x1944f0,_0x4922e9){var _0x56f508=function(_0x5eb98f){while(--_0x5eb98f){_0x1944f0['push'](_0x1944f0['shift']());}};_0x56f508(++_0x4922e9);}(_0xf6b0,0x17a));var _0x0f6b=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xf6b0[_0x45d3f0];return _0x314b79;};'use strict';function mergeDBDataToRealtime(_0x26888e,_0x24863d){var _0x38575e=Object['assign']({},_0x26888e);for(var _0x2d291e in _0x24863d){if(_0x38575e[_0x0f6b('0x0')](_0x2d291e)){_0x38575e[_0x2d291e]=_0x24863d[_0x2d291e];}}return _0x38575e;}exports[_0x0f6b('0x1')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xc3ae=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xc3ae,0x163));var _0xec3a=function(_0xbe9771,_0x2b7a9d){_0xbe9771=_0xbe9771-0x0;var _0x52b66e=_0xc3ae[_0xbe9771];return _0x52b66e;};'use strict';function mergeDBDataToRealtime(_0x7b8797,_0x13a165){var _0x229b9e=Object[_0xec3a('0x0')]({},_0x7b8797);for(var _0x6f1de in _0x13a165){if(_0x229b9e[_0xec3a('0x1')](_0x6f1de)){_0x229b9e[_0x6f1de]=_0x13a165[_0x6f1de];}}return _0x229b9e;}exports[_0xec3a('0x2')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 484a674..7b22ec8 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 _0x15fe=['getAgentByInternal','calleridnum','outbound','internal','destination','exten','dialer','lastapplication','queue','context','destinationchannel','callerid','calleridpreview','originatecalleridnum','ANSWERED','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','type','getCallType','split','UserId','membername','monitor','monitors','monitorFilename','createdAt','xcally-motion-preview','connectedlinename','xcally-motion-dialer','isArray','forEach','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','../../../config/environment','../rpc/voiceCallReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','find','accountcode','isNil','name','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','keys','channel'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x15fe,0x87));var _0xe15f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x15fe[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xe15f('0x0'));var moment=require(_0xe15f('0x1'));var util=require('util');var config=require(_0xe15f('0x2'));var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xe15f('0x3'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xe15f('0x4'));var RpcVoiceRecording=require(_0xe15f('0x5'));var RpcVoiceTransferReport=require(_0xe15f('0x6'));var VoiceQueueReport=require(_0xe15f('0x7'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xe15f('0x8'));var VoiceDialReport=require(_0xe15f('0x9'));var UserReport=require(_0xe15f('0xa'));function Report(_0x5eecb8){this[_0xe15f('0xb')]=_0x5eecb8;this[_0xe15f('0xc')]=_0x5eecb8[_0xe15f('0xc')];this['telephones']=_0x5eecb8[_0xe15f('0xd')];}Report[_0xe15f('0xe')][_0xe15f('0xf')]=function(_0x14789d){var _0x1a53c1=new VoiceQueueReport(this['realtime']);var _0x587aca=new VoiceAgentReport(this[_0xe15f('0xb')]);var _0x2073eb=new VoiceDialReport(this[_0xe15f('0xb')]);var _0x5963d6=new VoiceCallReport(this[_0xe15f('0xb')]);var _0x1f804e=new UserReport(this[_0xe15f('0xb')]);if(config[_0xe15f('0x10')]&&config[_0xe15f('0x10')][_0xe15f('0x11')]){ami['on'](_0xe15f('0x12'),this[_0xe15f('0x13')][_0xe15f('0x14')](this));ami['on'](_0xe15f('0x15'),this[_0xe15f('0x16')][_0xe15f('0x14')](this));ami['on'](_0xe15f('0x17'),this[_0xe15f('0x18')][_0xe15f('0x14')](this));ami['on'](_0xe15f('0x19'),this[_0xe15f('0x1a')][_0xe15f('0x14')](this));ami['on'](_0xe15f('0x1b'),this[_0xe15f('0x1c')][_0xe15f('0x14')](this));ami['on']('attendedtransfer',this[_0xe15f('0x1d')]['bind'](this));}};Report[_0xe15f('0xe')][_0xe15f('0x1e')]=function(_0x71e3e6){var _0x421860;_0x421860=_[_0xe15f('0x1f')](this[_0xe15f('0xc')],function(_0x2d34b7){return _0x2d34b7[_0xe15f('0x20')]==_0x71e3e6||_0x2d34b7['name']==_0x71e3e6;});if(_[_0xe15f('0x21')](_0x421860)){var _0x4b56db=_[_0xe15f('0x1f')](this[_0xe15f('0xd')],function(_0x2ab97c){return _0x2ab97c['accountcode']==_0x71e3e6||_0x2ab97c[_0xe15f('0x22')]==_0x71e3e6;});if(_0x4b56db){_0x421860=_[_0xe15f('0x1f')](this[_0xe15f('0xc')],function(_0x118665){return _0x118665[_0xe15f('0x23')]==util[_0xe15f('0x24')](_0xe15f('0x25'),_0x4b56db[_0xe15f('0x22')]);});}}return _0x421860;};Report[_0xe15f('0xe')][_0xe15f('0x13')]=function(_0x7f1e80){for(var _0x596d3b=0x0;_0x596d3b<_0x7f1e80[_0xe15f('0x26')];_0x596d3b+=0x1){var _0x376bec=this[_0xe15f('0x1e')](_0x7f1e80[_0x596d3b][_0xe15f('0x27')]);if(_0x376bec){_0x7f1e80[_0x596d3b]['accountcode']=_0x376bec[_0xe15f('0x20')];_0x7f1e80[_0x596d3b][_0xe15f('0x28')]=!![];_0x7f1e80[_0x596d3b][_0xe15f('0x29')]=_0x376bec[_0xe15f('0x22')];_0x7f1e80[_0x596d3b][_0xe15f('0x23')]=_[_0xe15f('0x21')](_0x376bec[_0xe15f('0x23')])?util[_0xe15f('0x24')](_0xe15f('0x25'),_0x376bec[_0xe15f('0x22')]):_0x376bec[_0xe15f('0x23')];if(_0x7f1e80[_0x596d3b]['queuecallercomplete']){_0x7f1e80[_0x596d3b][_0xe15f('0x2a')]=moment()[_0xe15f('0x24')](_0xe15f('0x2b'));}if(_0x7f1e80[_0x596d3b]['queuecallerexit']){_0x7f1e80[_0x596d3b][_0xe15f('0x2c')]=moment()[_0xe15f('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xe15f('0x13')](_0x7f1e80[_0x596d3b]);}RpcVoiceQueueReport[_0xe15f('0x2d')](_0x7f1e80[_0x596d3b]);}};function extractCalleridNumber(_0x3e6f0b){var _0x52a4df=_0x3e6f0b[_0xe15f('0x2e')](/<(.*?)>/);return _0x52a4df?_0x52a4df[0x1]:_0x3e6f0b;}Report['prototype']['getAgentByInternal']=function(_0xb30bc4){for(var _0x38b167=0x0;_0x38b167','transfers','linkedid','uniqueid','UserId','membername','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','util','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime'];(function(_0x568a61,_0x2124f8){var _0x334c3b=function(_0x1afc39){while(--_0x1afc39){_0x568a61['push'](_0x568a61['shift']());}};_0x334c3b(++_0x2124f8);}(_0xcf71,0x161));var _0x1cf7=function(_0xc973f8,_0x1759ec){_0xc973f8=_0xc973f8-0x0;var _0x5cd9d5=_0xcf71[_0xc973f8];return _0x5cd9d5;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x1cf7('0x0'));var config=require('../../../config/environment');var ami=require(_0x1cf7('0x1'));var RpcVoiceAgentReport=require(_0x1cf7('0x2'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x1cf7('0x3'));var RpcMemberReport=require(_0x1cf7('0x4'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x1cf7('0x5'));var VoiceQueueReport=require(_0x1cf7('0x6'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x1cf7('0x7'));var VoiceDialReport=require(_0x1cf7('0x8'));var UserReport=require(_0x1cf7('0x9'));function Report(_0x38b6ed){this[_0x1cf7('0xa')]=_0x38b6ed;this[_0x1cf7('0xb')]=_0x38b6ed['agents'];this[_0x1cf7('0xc')]=_0x38b6ed['telephones'];}Report[_0x1cf7('0xd')][_0x1cf7('0xe')]=function(_0x3999f1){var _0x30e4f2=new VoiceQueueReport(this[_0x1cf7('0xa')]);var _0x4f35cc=new VoiceAgentReport(this['realtime']);var _0x28beab=new VoiceDialReport(this['realtime']);var _0x27abed=new VoiceCallReport(this[_0x1cf7('0xa')]);var _0x12d3ea=new UserReport(this[_0x1cf7('0xa')]);if(config[_0x1cf7('0xf')]&&config[_0x1cf7('0xf')][_0x1cf7('0x10')]){ami['on'](_0x1cf7('0x11'),this[_0x1cf7('0x12')]['bind'](this));ami['on']('custom:voiceCallReport',this[_0x1cf7('0x13')][_0x1cf7('0x14')](this));ami['on'](_0x1cf7('0x15'),this[_0x1cf7('0x16')][_0x1cf7('0x14')](this));ami['on']('custom:voiceDialReport',this[_0x1cf7('0x17')][_0x1cf7('0x14')](this));ami['on'](_0x1cf7('0x18'),this[_0x1cf7('0x19')]['bind'](this));ami['on'](_0x1cf7('0x1a'),this[_0x1cf7('0x1b')][_0x1cf7('0x14')](this));}};Report[_0x1cf7('0xd')]['findAgent']=function(_0x37d0cf){var _0x5ea0a9;_0x5ea0a9=_[_0x1cf7('0x1c')](this[_0x1cf7('0xb')],function(_0x4d6f44){return _0x4d6f44[_0x1cf7('0x1d')]==_0x37d0cf||_0x4d6f44['name']==_0x37d0cf;});if(_['isNil'](_0x5ea0a9)){var _0x2495a2=_['find'](this[_0x1cf7('0xc')],function(_0xf5ebee){return _0xf5ebee[_0x1cf7('0x1d')]==_0x37d0cf||_0xf5ebee['name']==_0x37d0cf;});if(_0x2495a2){_0x5ea0a9=_[_0x1cf7('0x1c')](this[_0x1cf7('0xb')],function(_0x241d32){return _0x241d32[_0x1cf7('0x1e')]==util[_0x1cf7('0x1f')](_0x1cf7('0x20'),_0x2495a2[_0x1cf7('0x21')]);});}}return _0x5ea0a9;};Report[_0x1cf7('0xd')]['voiceQueueReport']=function(_0x32d5c3){for(var _0x3b715c=0x0;_0x3b715c<_0x32d5c3['length'];_0x3b715c+=0x1){var _0x312d17=this[_0x1cf7('0x22')](_0x32d5c3[_0x3b715c]['connectedlinenum']);if(_0x312d17){_0x32d5c3[_0x3b715c][_0x1cf7('0x1d')]=_0x312d17[_0x1cf7('0x1d')];_0x32d5c3[_0x3b715c][_0x1cf7('0x23')]=!![];_0x32d5c3[_0x3b715c][_0x1cf7('0x24')]=_0x312d17[_0x1cf7('0x21')];_0x32d5c3[_0x3b715c]['interface']=_[_0x1cf7('0x25')](_0x312d17[_0x1cf7('0x1e')])?util[_0x1cf7('0x1f')](_0x1cf7('0x20'),_0x312d17[_0x1cf7('0x21')]):_0x312d17[_0x1cf7('0x1e')];if(_0x32d5c3[_0x3b715c][_0x1cf7('0x26')]){_0x32d5c3[_0x3b715c][_0x1cf7('0x27')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x32d5c3[_0x3b715c][_0x1cf7('0x28')]){_0x32d5c3[_0x3b715c][_0x1cf7('0x29')]=moment()[_0x1cf7('0x1f')](_0x1cf7('0x2a'));}RpcMemberReport[_0x1cf7('0x12')](_0x32d5c3[_0x3b715c]);}RpcVoiceQueueReport[_0x1cf7('0x2b')](_0x32d5c3[_0x3b715c]);}};function extractCalleridNumber(_0x420b90){var _0x561521=_0x420b90[_0x1cf7('0x2c')](/<(.*?)>/);return _0x561521?_0x561521[0x1]:_0x420b90;}Report['prototype'][_0x1cf7('0x2d')]=function(_0x56dcb2){for(var _0x22d63a=0x0;_0x22d63a0x0?!![]:![];if(!_0x1ed7ae){return this[_0x93d4('0x17')](this[_0x93d4('0x13')][_0x93d4('0x6d')]);}};VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0x19')]=function(_0x36c485){var _0x174906=this[_0x93d4('0x13')]['id'];if(this[_0x93d4('0x13')][_0x93d4('0x60')][_0x174906]&&this[_0x93d4('0x13')][_0x93d4('0x60')][_0x174906][_0x36c485[_0x93d4('0x61')]]){this[_0x93d4('0x13')][_0x93d4('0x60')][_0x174906][_0x36c485['actionid']][_0x93d4('0xf')][_0x93d4('0x6e')](_0x36c485);}};VoiceQueueReport['prototype'][_0x93d4('0x15')]=function(_0x5d3310){var _0x36d681=this;try{if(this['isNotNull'](_0x5d3310)&&this['isNotNull'](_0x5d3310[_0x93d4('0x50')])){logger[_0x93d4('0x4b')](_0x93d4('0x6f'),util[_0x93d4('0x43')](_0x5d3310,{'showHidden':![],'depth':null}));var _0x4a8702=this[_0x93d4('0x11')][_0x5d3310[_0x93d4('0x50')]];if(_0x4a8702){logger[_0x93d4('0x70')](_0x93d4('0x71'),_0x4a8702[_0x93d4('0x57')]);this['summary'][_0x93d4('0x5b')][_0x4a8702[_0x93d4('0x57')]]={'summaryEvent':_0x5d3310};this['summary'][_0x93d4('0x6c')]+=0x1;return ami[_0x93d4('0x3b')]({'action':_0x93d4('0x60'),'queue':_0x4a8702['name']})[_0x93d4('0x5f')](function(_0x3a6cf3){if(!_0x36d681['summary'][_0x93d4('0x60')][_0x5d3310['actionid']]){_0x36d681[_0x93d4('0x13')]['queuestatus'][_0x5d3310['actionid']]={};}_0x36d681[_0x93d4('0x13')]['queuestatus'][_0x5d3310[_0x93d4('0x61')]][_0x3a6cf3[_0x93d4('0x61')]]={'queue':_0x4a8702[_0x93d4('0x57')],'agents':[]};})[_0x93d4('0x3e')](function(_0x64fa5a){throw _0x64fa5a;});}}}catch(_0x426e9c){logger[_0x93d4('0x41')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x426e9c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x93d4('0x17')]=function(_0x15146f){if(this[_0x93d4('0x13')][_0x93d4('0x6c')]>0x0){this['summary'][_0x93d4('0x6d')]=_0x15146f;return;}logger[_0x93d4('0x4b')](_0x93d4('0x72'),util[_0x93d4('0x43')](_0x15146f,{'showHidden':![],'depth':null}));this[_0x93d4('0x13')]=initializeSummary();ami[_0x93d4('0x49')]('custom:queuesummarycomplete',{});};VoiceQueueReport['prototype'][_0x93d4('0x1a')]=function(_0x2abaa2){try{if(this[_0x93d4('0x59')](_0x2abaa2)){logger[_0x93d4('0x4b')](_0x93d4('0x73'),_0x2abaa2[_0x93d4('0x4d')],util['inspect'](_0x2abaa2,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x93d4('0xd')][_0x2abaa2[_0x93d4('0x4d')]])){this[_0x93d4('0xd')][_0x2abaa2[_0x93d4('0x4d')]]=[];}if(_[_0x93d4('0x5a')](this[_0x93d4('0x10')][_0x2abaa2['uniqueid']])){this[_0x93d4('0x10')][_0x2abaa2[_0x93d4('0x4d')]]={};}var _0xc79cf=new QueueReport();_0xc79cf[_0x93d4('0x50')]=_0x2abaa2['queue'];_0xc79cf['type']=this[_0x93d4('0x11')][_0xc79cf['queue']]&&this['voiceQueues'][_0xc79cf[_0x93d4('0x50')]][_0x93d4('0x55')]?this['voiceQueues'][_0xc79cf[_0x93d4('0x50')]]['type']||_0x93d4('0x56'):_0x93d4('0x56');_0xc79cf[_0x93d4('0x74')]=moment()[_0x93d4('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0xc79cf[_0x93d4('0x75')]=_0x2abaa2[_0x93d4('0x75')];_0xc79cf[_0x93d4('0x76')]=_0x2abaa2['count'];_0xc79cf[_0x93d4('0x4d')]=_0x2abaa2[_0x93d4('0x4d')];_0xc79cf['routealias']=this[_0x93d4('0x10')][_0x2abaa2[_0x93d4('0x4d')]][_0x93d4('0x77')];logger[_0x93d4('0x70')](_0x93d4('0x78'),_0xc79cf[_0x93d4('0x50')],_0xc79cf['type']);_['merge'](_0xc79cf,_[_0x93d4('0x79')](_0x2abaa2,_['keys'](_0xc79cf)));this[_0x93d4('0xd')][_0x2abaa2[_0x93d4('0x4d')]][_0x93d4('0x6e')](_0xc79cf);this[_0x93d4('0x10')][_0x2abaa2[_0x93d4('0x4d')]]=_0xc79cf;this[_0x93d4('0x4a')](_0xc79cf,'queuecallerjoin');}}catch(_0x45304c){logger[_0x93d4('0x41')](_0x93d4('0x73'),_0x2abaa2[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x45304c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x93d4('0x1c')]=function(_0x2a5cc2){try{if(this['isNotNull'](_0x2a5cc2)){logger['debug']('[%s][voiceQueueReport][queuecallerabandon]',_0x2a5cc2[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x2a5cc2,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2a5cc2[_0x93d4('0x4d')]]){var _0x3dcde8=_['last'](this[_0x93d4('0xd')][_0x2a5cc2['uniqueid']]);_0x3dcde8[_0x93d4('0x7a')]=![];_0x3dcde8[_0x93d4('0x7b')]=null;_0x3dcde8[_0x93d4('0x7c')]=_0x2a5cc2[_0x93d4('0x7c')];_0x3dcde8['originalposition']=_0x2a5cc2[_0x93d4('0x7d')];_0x3dcde8['queuecallerabandon']=!![];_0x3dcde8[_0x93d4('0x7e')]=moment()[_0x93d4('0x4e')](_0x93d4('0x7f'));_0x3dcde8[_0x93d4('0x52')]=_0x93d4('0x80');_0x3dcde8['lastAssignedTo']=null;logger[_0x93d4('0x70')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x3dcde8[_0x93d4('0x50')],_0x3dcde8[_0x93d4('0x55')]);this['channels'][_0x2a5cc2[_0x93d4('0x4d')]]=_0x3dcde8;this['emitVoiceQueueChannelRemove'](_0x3dcde8,_0x93d4('0x1b'));}}}catch(_0x2b794b){logger[_0x93d4('0x41')]('[%s][voiceQueueReport][queuecallerabandon]',_0x2a5cc2[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x2b794b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x93d4('0x81')]=function(_0x5343ec){try{if(this['isNotNull'](_0x5343ec)){logger[_0x93d4('0x4b')](_0x93d4('0x82'),_0x5343ec[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x5343ec,{'showHidden':![],'depth':null}));if(this[_0x93d4('0xd')][_0x5343ec[_0x93d4('0x4d')]]){var _0x2d7c6e=_[_0x93d4('0x83')](this[_0x93d4('0xd')][_0x5343ec[_0x93d4('0x4d')]]);_0x2d7c6e[_0x93d4('0x84')]=moment()[_0x93d4('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d7c6e['connectedlinenum']=_0x5343ec['connectedlinenum'];_0x2d7c6e[_0x93d4('0x85')]=_0x5343ec[_0x93d4('0x85')];logger[_0x93d4('0x70')](_0x93d4('0x86'),_0x2d7c6e[_0x93d4('0x50')],_0x2d7c6e[_0x93d4('0x55')],_0x5343ec['connectedlinenum'],_0x5343ec['connectedlinename']);this[_0x93d4('0x10')][_0x5343ec[_0x93d4('0x4d')]]=_0x2d7c6e;this['emitVoiceQueueChannelSave'](_0x2d7c6e,_0x93d4('0x1d'));}}}catch(_0x198bfc){logger[_0x93d4('0x41')](_0x93d4('0x82'),_0x5343ec[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x198bfc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0x87')]=function(_0x5d890e){try{if(this[_0x93d4('0x59')](_0x5d890e)){logger[_0x93d4('0x4b')](_0x93d4('0x88'),_0x5d890e[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x5d890e,{'showHidden':![],'depth':null}));if(this[_0x93d4('0xd')][_0x5d890e['uniqueid']]){var _0x385003=_[_0x93d4('0x83')](this[_0x93d4('0xd')][_0x5d890e[_0x93d4('0x4d')]]);_0x385003['queuecallercomplete']=!![];_0x385003[_0x93d4('0x52')]='COMPLETEDBYAGENT';logger[_0x93d4('0x70')](_0x93d4('0x89'),_0x385003['queue'],_0x385003[_0x93d4('0x55')]);}}}catch(_0x4276f3){logger['error'](_0x93d4('0x88'),_0x5d890e['uniqueid'],util[_0x93d4('0x43')](_0x4276f3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0x1f')]=function(_0xbd7b14){try{if(this[_0x93d4('0x59')](_0xbd7b14)){logger[_0x93d4('0x4b')](_0x93d4('0x8a'),_0xbd7b14[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0xbd7b14,{'showHidden':![],'depth':null}));if(this[_0x93d4('0xd')][_0xbd7b14['uniqueid']]){var _0x2cd9a3=_[_0x93d4('0x83')](this[_0x93d4('0xd')][_0xbd7b14[_0x93d4('0x4d')]]);_0x2cd9a3[_0x93d4('0x1b')]=![];_0x2cd9a3['queuecallerabandonAt']=null;_0x2cd9a3[_0x93d4('0x8b')]=!![];_0x2cd9a3['lastAssignedTo']=_0xbd7b14[_0x93d4('0x8c')];_0x2cd9a3[_0x93d4('0x7c')]=_0xbd7b14[_0x93d4('0x7c')];_0x2cd9a3['queuecallercomplete']=!![];_0x2cd9a3[_0x93d4('0x8d')]=![];_0x2cd9a3[_0x93d4('0x8e')]=null;if(!_0x2cd9a3[_0x93d4('0x8f')]){if(_0xbd7b14[_0x93d4('0x90')]=='transfer'){_0x2cd9a3[_0x93d4('0x52')]=_0x93d4('0x91');logger[_0x93d4('0x70')](_0x93d4('0x92'),_0x2cd9a3['queue'],_0x2cd9a3['type']);}else{if(_['startsWith'](_0xbd7b14[_0x93d4('0x3d')][_0x93d4('0x93')](),_0x93d4('0x94'))){if(this[_0x93d4('0xd')][_0xbd7b14[_0x93d4('0x95')]]){var _0x5c1dbe=_[_0x93d4('0x83')](this[_0x93d4('0xd')][_0xbd7b14[_0x93d4('0x95')]]);_0x5c1dbe[_0x93d4('0x7a')]=![];_0x5c1dbe[_0x93d4('0x8d')]=!![];_0x5c1dbe['queuecallerexitAt']=moment(_0x2cd9a3['queuecallerjoinAt'])[_0x93d4('0x96')](_0xbd7b14[_0x93d4('0x7c')],_0x93d4('0x97'))[_0x93d4('0x4e')](_0x93d4('0x7f'));_0x5c1dbe[_0x93d4('0x52')]=_0x93d4('0x98');_0x5c1dbe[_0x93d4('0x8f')]=!![];_0x5c1dbe[_0x93d4('0x99')]='FORWARD';_0x5c1dbe[_0x93d4('0x9a')]=_0xbd7b14[_0x93d4('0x9b')];_0x5c1dbe[_0x93d4('0x9c')]=_0xbd7b14['uniqueid'];logger[_0x93d4('0x70')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x5c1dbe['queue'],_0x5c1dbe[_0x93d4('0x55')]);var _0x116af3=this[_0x93d4('0xd')][_0xbd7b14['linkedid']];this[_0x93d4('0xd')][_0xbd7b14[_0x93d4('0x95')]]=this[_0x93d4('0xd')][_0xbd7b14[_0x93d4('0x4d')]];this['queueReports'][_0xbd7b14['uniqueid']]=_0x116af3;}}else{_0x2cd9a3[_0x93d4('0x52')]='COMPLETEDBY'+_0xbd7b14[_0x93d4('0x90')][_0x93d4('0x9d')]();logger[_0x93d4('0x70')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x2cd9a3[_0x93d4('0x50')],_0x2cd9a3[_0x93d4('0x55')],_0x2cd9a3[_0x93d4('0x52')]);}}}this[_0x93d4('0x10')][_0xbd7b14[_0x93d4('0x4d')]]=_0x2cd9a3;this[_0x93d4('0x47')](_0x2cd9a3,_0x93d4('0x1e'));}}}catch(_0x4e933d){logger[_0x93d4('0x41')](_0x93d4('0x8a'),_0xbd7b14[_0x93d4('0x4d')],util['inspect'](_0x4e933d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0x22')]=function(_0x3bbda4){try{if(this[_0x93d4('0x59')](_0x3bbda4)){logger[_0x93d4('0x4b')](_0x93d4('0x9e'),_0x3bbda4[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x3bbda4,{'showHidden':![],'depth':null}));this[_0x93d4('0x9f')](_0x3bbda4[_0x93d4('0x4d')],_[_0x93d4('0xa0')](_0x3bbda4[_0x93d4('0xa1')])[0x0],_0x3bbda4[_0x93d4('0xa2')]);if(this['queueReports'][_0x3bbda4[_0x93d4('0x4d')]]){var _0x2d688c=_[_0x93d4('0x83')](this[_0x93d4('0xd')][_0x3bbda4[_0x93d4('0x4d')]]);if(_0x2d688c){if(this[_0x93d4('0x59')](_0x3bbda4[_0x93d4('0xa1')])&&this[_0x93d4('0x59')](_0x3bbda4[_0x93d4('0xa1')][_0x93d4('0x60')])){switch(_0x3bbda4['value']){case _0x93d4('0xa3'):_0x2d688c[_0x93d4('0x8d')]=![];_0x2d688c[_0x93d4('0x8e')]=null;break;case _0x93d4('0xa4'):_0x2d688c[_0x93d4('0xa5')]=_0x93d4('0xa6');_0x2d688c['queuecallerexit']=!![];_0x2d688c['queuecallerexitAt']=moment()[_0x93d4('0x4e')](_0x93d4('0x7f'));_0x2d688c[_0x93d4('0x84')]=moment()[_0x93d4('0x4e')](_0x93d4('0x7f'));logger[_0x93d4('0x4b')](_0x93d4('0xa7'),_0x3bbda4[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x2d688c,{'showHidden':![],'depth':null}));ami[_0x93d4('0x49')](_0x93d4('0xa8'),_0x2d688c);break;default:_0x2d688c[_0x93d4('0x8d')]=!![];_0x2d688c[_0x93d4('0x8e')]=moment()[_0x93d4('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d688c[_0x93d4('0x84')]=moment()[_0x93d4('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2d688c['queuecallerabandon']=![];_0x2d688c[_0x93d4('0x7e')]=null;_0x2d688c['queuecallerexitreason']=_0x3bbda4['value'];this[_0x93d4('0x10')][_0x3bbda4['uniqueid']]=_0x2d688c;this[_0x93d4('0x47')](_0x2d688c,_0x93d4('0x21'));}else if(this[_0x93d4('0x59')](_0x3bbda4['variable'])&&this[_0x93d4('0x59')](_0x3bbda4['variable']['queueposition'])){if(!_0x2d688c[_0x93d4('0x1b')]){_0x2d688c[_0x93d4('0x8d')]=!![];_0x2d688c[_0x93d4('0x8e')]=moment()['format'](_0x93d4('0x7f'));_0x2d688c['queuecallerexitreason']=_0x93d4('0xa9');_0x2d688c[_0x93d4('0x84')]=moment()[_0x93d4('0x4e')](_0x93d4('0x7f'));this[_0x93d4('0x10')][_0x3bbda4[_0x93d4('0x4d')]]=_0x2d688c;}}logger['info'](_0x93d4('0xaa'),_0x3bbda4['uniqueid'],_0x2d688c[_0x93d4('0x50')],_0x2d688c[_0x93d4('0x55')],_['keys'](_0x3bbda4[_0x93d4('0xa1')])[0x0],_0x3bbda4['value']);_0x2d688c[_0x93d4('0x14')]=this['variables'][_0x3bbda4['uniqueid']];}}}}catch(_0x22b22d){logger[_0x93d4('0x41')](_0x93d4('0x9e'),_0x3bbda4['uniqueid'],util[_0x93d4('0x43')](_0x22b22d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0x9f')]=function(_0xde7f93,_0x386875,_0x5cf365){var _0x392d67=[_0x93d4('0xab'),_0x93d4('0xac'),_0x93d4('0xad'),_0x93d4('0xae'),_0x93d4('0xaf'),_0x93d4('0xb0'),_0x93d4('0xb1'),_0x93d4('0xb2'),_0x93d4('0xb3'),_0x93d4('0xb4'),'bridgepeer',_0x93d4('0xb5'),_0x93d4('0xb6'),_0x93d4('0xb7'),'memberinterface',_0x93d4('0xb8'),_0x93d4('0x8c'),'memberpenalty','memberrealtime'];if(!_[_0x93d4('0x3a')](_0x386875)&&!_[_0x93d4('0xb9')](_0x392d67,_0x386875)){if(_[_0x93d4('0x5a')](this[_0x93d4('0x14')][_0xde7f93])){this[_0x93d4('0x14')][_0xde7f93]={};}this[_0x93d4('0x14')][_0xde7f93][_0x386875]=_0x5cf365;}};VoiceQueueReport[_0x93d4('0x36')]['handleHangup']=function(_0x59ed42,_0x46ed3c,_0x38d33c){var _0x29d97f={};for(var _0x2eba9f=0x0;_0x2eba9f0x0?!![]:![];if(!_0x5bf7ed){return this[_0xebe1('0x18')](this[_0xebe1('0x13')]['completeEvent']);}};VoiceQueueReport[_0xebe1('0xb')][_0xebe1('0x6c')]=function(_0xe2b330){var _0x4861b1=this[_0xebe1('0x13')]['id'];if(this[_0xebe1('0x13')][_0xebe1('0x61')][_0x4861b1]&&this[_0xebe1('0x13')][_0xebe1('0x61')][_0x4861b1][_0xe2b330['actionid']]){this[_0xebe1('0x13')][_0xebe1('0x61')][_0x4861b1][_0xe2b330[_0xebe1('0x60')]]['agents']['push'](_0xe2b330);}};VoiceQueueReport['prototype'][_0xebe1('0x15')]=function(_0x2f68b2){var _0x4a0db5=this;try{if(this['isNotNull'](_0x2f68b2)&&this[_0xebe1('0x6d')](_0x2f68b2['queue'])){logger['debug'](_0xebe1('0x6e'),util[_0xebe1('0x3f')](_0x2f68b2,{'showHidden':![],'depth':null}));var _0x2af755=this[_0xebe1('0x12')][_0x2f68b2['queue']];if(_0x2af755){logger['info']('[voiceQueueReport][queuesummary]\x20name:%s',_0x2af755[_0xebe1('0x57')]);this['summary']['queues'][_0x2af755[_0xebe1('0x57')]]={'summaryEvent':_0x2f68b2};this[_0xebe1('0x13')][_0xebe1('0x6b')]+=0x1;return ami[_0xebe1('0x5e')]({'action':_0xebe1('0x61'),'queue':_0x2af755[_0xebe1('0x57')]})[_0xebe1('0x5f')](function(_0x3f45c6){if(!_0x4a0db5[_0xebe1('0x13')][_0xebe1('0x61')][_0x2f68b2[_0xebe1('0x60')]]){_0x4a0db5[_0xebe1('0x13')]['queuestatus'][_0x2f68b2[_0xebe1('0x60')]]={};}_0x4a0db5[_0xebe1('0x13')][_0xebe1('0x61')][_0x2f68b2[_0xebe1('0x60')]][_0x3f45c6[_0xebe1('0x60')]]={'queue':_0x2af755['name'],'agents':[]};})['catch'](function(_0x9dc6b7){throw _0x9dc6b7;});}}}catch(_0x55a53d){logger['error'](_0xebe1('0x62'),util[_0xebe1('0x3f')](_0x55a53d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xebe1('0x18')]=function(_0x5aa0fd){if(this['summary'][_0xebe1('0x6b')]>0x0){this[_0xebe1('0x13')]['completeEvent']=_0x5aa0fd;return;}logger[_0xebe1('0x49')](_0xebe1('0x6f'),util['inspect'](_0x5aa0fd,{'showHidden':![],'depth':null}));this[_0xebe1('0x13')]=initializeSummary();ami[_0xebe1('0x47')](_0xebe1('0x70'),{});};VoiceQueueReport[_0xebe1('0xb')][_0xebe1('0x1b')]=function(_0x260e28){try{if(this[_0xebe1('0x6d')](_0x260e28)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x260e28[_0xebe1('0x4b')],util[_0xebe1('0x3f')](_0x260e28,{'showHidden':![],'depth':null}));if(_[_0xebe1('0x59')](this[_0xebe1('0xf')][_0x260e28[_0xebe1('0x4b')]])){this[_0xebe1('0xf')][_0x260e28[_0xebe1('0x4b')]]=[];}if(_[_0xebe1('0x59')](this['channels'][_0x260e28[_0xebe1('0x4b')]])){this['channels'][_0x260e28[_0xebe1('0x4b')]]={};}var _0xa30a4d=new QueueReport();_0xa30a4d['queue']=_0x260e28[_0xebe1('0x53')];_0xa30a4d[_0xebe1('0x68')]=this['voiceQueues'][_0xa30a4d[_0xebe1('0x53')]]&&this[_0xebe1('0x12')][_0xa30a4d['queue']][_0xebe1('0x68')]?this[_0xebe1('0x12')][_0xa30a4d[_0xebe1('0x53')]]['type']||_0xebe1('0x69'):_0xebe1('0x69');_0xa30a4d[_0xebe1('0x71')]=moment()[_0xebe1('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0xa30a4d[_0xebe1('0x72')]=_0x260e28[_0xebe1('0x72')];_0xa30a4d[_0xebe1('0x73')]=_0x260e28[_0xebe1('0x73')];_0xa30a4d['uniqueid']=_0x260e28[_0xebe1('0x4b')];_0xa30a4d[_0xebe1('0x74')]=this['channels'][_0x260e28[_0xebe1('0x4b')]][_0xebe1('0x74')];logger[_0xebe1('0x75')](_0xebe1('0x76'),_0xa30a4d['queue'],_0xa30a4d['type']);_[_0xebe1('0x77')](_0xa30a4d,_[_0xebe1('0x78')](_0x260e28,_[_0xebe1('0x79')](_0xa30a4d)));this[_0xebe1('0xf')][_0x260e28[_0xebe1('0x4b')]]['push'](_0xa30a4d);this[_0xebe1('0x11')][_0x260e28[_0xebe1('0x4b')]]=_0xa30a4d;this['emitVoiceQueueChannelSave'](_0xa30a4d,_0xebe1('0x1a'));}}catch(_0x32f126){logger[_0xebe1('0x3d')](_0xebe1('0x7a'),_0x260e28['uniqueid'],util[_0xebe1('0x3f')](_0x32f126,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xebe1('0xb')][_0xebe1('0x7b')]=function(_0x58f9a5){try{if(this[_0xebe1('0x6d')](_0x58f9a5)){logger[_0xebe1('0x49')](_0xebe1('0x7c'),_0x58f9a5[_0xebe1('0x4b')],util[_0xebe1('0x3f')](_0x58f9a5,{'showHidden':![],'depth':null}));if(this[_0xebe1('0xf')][_0x58f9a5[_0xebe1('0x4b')]]){var _0x4d8dd1=_[_0xebe1('0x7d')](this[_0xebe1('0xf')][_0x58f9a5[_0xebe1('0x4b')]]);_0x4d8dd1[_0xebe1('0x7e')]=![];_0x4d8dd1[_0xebe1('0x7f')]=null;_0x4d8dd1['holdtime']=_0x58f9a5['holdtime'];_0x4d8dd1[_0xebe1('0x80')]=_0x58f9a5[_0xebe1('0x80')];_0x4d8dd1['queuecallerabandon']=!![];_0x4d8dd1[_0xebe1('0x81')]=moment()['format'](_0xebe1('0x82'));_0x4d8dd1[_0xebe1('0x52')]=_0xebe1('0x83');_0x4d8dd1['lastAssignedTo']=null;logger[_0xebe1('0x75')](_0xebe1('0x84'),_0x4d8dd1[_0xebe1('0x53')],_0x4d8dd1[_0xebe1('0x68')]);this[_0xebe1('0x11')][_0x58f9a5[_0xebe1('0x4b')]]=_0x4d8dd1;this[_0xebe1('0x45')](_0x4d8dd1,'queuecallerabandon');}}}catch(_0x5cf918){logger[_0xebe1('0x3d')](_0xebe1('0x7c'),_0x58f9a5[_0xebe1('0x4b')],util[_0xebe1('0x3f')](_0x5cf918,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xebe1('0x1e')]=function(_0x2f6f5c){try{if(this['isNotNull'](_0x2f6f5c)){logger['debug'](_0xebe1('0x85'),_0x2f6f5c[_0xebe1('0x4b')],util['inspect'](_0x2f6f5c,{'showHidden':![],'depth':null}));if(this[_0xebe1('0xf')][_0x2f6f5c['uniqueid']]){var _0x551123=_[_0xebe1('0x7d')](this[_0xebe1('0xf')][_0x2f6f5c[_0xebe1('0x4b')]]);_0x551123['queuecallerleaveAt']=moment()[_0xebe1('0x4c')](_0xebe1('0x82'));_0x551123['connectedlinenum']=_0x2f6f5c[_0xebe1('0x86')];_0x551123[_0xebe1('0x87')]=_0x2f6f5c[_0xebe1('0x87')];logger[_0xebe1('0x75')](_0xebe1('0x88'),_0x551123['queue'],_0x551123[_0xebe1('0x68')],_0x2f6f5c['connectedlinenum'],_0x2f6f5c[_0xebe1('0x87')]);this[_0xebe1('0x11')][_0x2f6f5c['uniqueid']]=_0x551123;this['emitVoiceQueueChannelSave'](_0x551123,'queuecallerleave');}}}catch(_0x17d7f1){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x2f6f5c[_0xebe1('0x4b')],util[_0xebe1('0x3f')](_0x17d7f1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xebe1('0xb')][_0xebe1('0x22')]=function(_0x423734){try{if(this[_0xebe1('0x6d')](_0x423734)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0x423734[_0xebe1('0x4b')],util[_0xebe1('0x3f')](_0x423734,{'showHidden':![],'depth':null}));if(this[_0xebe1('0xf')][_0x423734[_0xebe1('0x4b')]]){var _0x220a14=_[_0xebe1('0x7d')](this[_0xebe1('0xf')][_0x423734[_0xebe1('0x4b')]]);_0x220a14[_0xebe1('0x7e')]=!![];_0x220a14[_0xebe1('0x52')]=_0xebe1('0x89');logger[_0xebe1('0x75')](_0xebe1('0x8a'),_0x220a14[_0xebe1('0x53')],_0x220a14['type']);}}}catch(_0x7708ff){logger['error'](_0xebe1('0x8b'),_0x423734[_0xebe1('0x4b')],util[_0xebe1('0x3f')](_0x7708ff,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x5ab9ed){try{if(this[_0xebe1('0x6d')](_0x5ab9ed)){logger[_0xebe1('0x49')](_0xebe1('0x8c'),_0x5ab9ed[_0xebe1('0x4b')],util['inspect'](_0x5ab9ed,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5ab9ed[_0xebe1('0x4b')]]){var _0x25a726=_['last'](this['queueReports'][_0x5ab9ed[_0xebe1('0x4b')]]);_0x25a726[_0xebe1('0x1c')]=![];_0x25a726['queuecallerabandonAt']=null;_0x25a726[_0xebe1('0x8d')]=!![];_0x25a726[_0xebe1('0x8e')]=_0x5ab9ed[_0xebe1('0x8f')];_0x25a726[_0xebe1('0x90')]=_0x5ab9ed[_0xebe1('0x90')];_0x25a726['queuecallercomplete']=!![];_0x25a726['queuecallerexit']=![];_0x25a726[_0xebe1('0x91')]=null;if(!_0x25a726['transfer']){if(_0x5ab9ed[_0xebe1('0x92')]==_0xebe1('0x93')){_0x25a726[_0xebe1('0x52')]=_0xebe1('0x94');logger[_0xebe1('0x75')](_0xebe1('0x95'),_0x25a726['queue'],_0x25a726[_0xebe1('0x68')]);}else{if(_[_0xebe1('0x96')](_0x5ab9ed[_0xebe1('0x39')][_0xebe1('0x97')](),_0xebe1('0x98'))){if(this['queueReports'][_0x5ab9ed[_0xebe1('0x99')]]){var _0x208cb5=_[_0xebe1('0x7d')](this[_0xebe1('0xf')][_0x5ab9ed[_0xebe1('0x99')]]);_0x208cb5[_0xebe1('0x7e')]=![];_0x208cb5[_0xebe1('0x9a')]=!![];_0x208cb5[_0xebe1('0x91')]=moment(_0x25a726[_0xebe1('0x71')])[_0xebe1('0x9b')](_0x5ab9ed[_0xebe1('0x90')],_0xebe1('0x9c'))[_0xebe1('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x208cb5['queuecallerexitreason']=_0xebe1('0x9d');_0x208cb5[_0xebe1('0x93')]=!![];_0x208cb5[_0xebe1('0x9e')]=_0xebe1('0x9f');_0x208cb5[_0xebe1('0xa0')]=_0x5ab9ed[_0xebe1('0xa1')];_0x208cb5[_0xebe1('0xa2')]=_0x5ab9ed['uniqueid'];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x208cb5[_0xebe1('0x53')],_0x208cb5['type']);var _0x4b18dd=this[_0xebe1('0xf')][_0x5ab9ed[_0xebe1('0x99')]];this[_0xebe1('0xf')][_0x5ab9ed[_0xebe1('0x99')]]=this['queueReports'][_0x5ab9ed[_0xebe1('0x4b')]];this[_0xebe1('0xf')][_0x5ab9ed[_0xebe1('0x4b')]]=_0x4b18dd;}}else{_0x25a726['queuecallerexitreason']=_0xebe1('0xa3')+_0x5ab9ed[_0xebe1('0x92')][_0xebe1('0xa4')]();logger[_0xebe1('0x75')](_0xebe1('0xa5'),_0x25a726[_0xebe1('0x53')],_0x25a726[_0xebe1('0x68')],_0x25a726[_0xebe1('0x52')]);}}}this[_0xebe1('0x11')][_0x5ab9ed[_0xebe1('0x4b')]]=_0x25a726;this[_0xebe1('0x45')](_0x25a726,_0xebe1('0x1f'));}}}catch(_0x212846){logger[_0xebe1('0x3d')](_0xebe1('0x8c'),_0x5ab9ed[_0xebe1('0x4b')],util[_0xebe1('0x3f')](_0x212846,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xebe1('0xb')]['syncVarSet']=function(_0x5f7aad){try{if(this[_0xebe1('0x6d')](_0x5f7aad)){logger[_0xebe1('0x49')]('[%s][voiceQueueReport][varset]',_0x5f7aad['uniqueid'],util[_0xebe1('0x3f')](_0x5f7aad,{'showHidden':![],'depth':null}));this[_0xebe1('0xa6')](_0x5f7aad[_0xebe1('0x4b')],_[_0xebe1('0x79')](_0x5f7aad['variable'])[0x0],_0x5f7aad['value']);if(this['queueReports'][_0x5f7aad[_0xebe1('0x4b')]]){var _0x5de300=_[_0xebe1('0x7d')](this[_0xebe1('0xf')][_0x5f7aad[_0xebe1('0x4b')]]);if(_0x5de300){if(this[_0xebe1('0x6d')](_0x5f7aad[_0xebe1('0xa7')])&&this[_0xebe1('0x6d')](_0x5f7aad[_0xebe1('0xa7')]['queuestatus'])){switch(_0x5f7aad[_0xebe1('0xa8')]){case'CONTINUE':_0x5de300['queuecallerexit']=![];_0x5de300[_0xebe1('0x91')]=null;break;case _0xebe1('0xa9'):_0x5de300[_0xebe1('0xaa')]='timeout';_0x5de300['queuecallerexit']=!![];_0x5de300[_0xebe1('0x91')]=moment()['format'](_0xebe1('0x82'));_0x5de300['queuecallerleaveAt']=moment()[_0xebe1('0x4c')](_0xebe1('0x82'));logger[_0xebe1('0x49')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x5f7aad[_0xebe1('0x4b')],util[_0xebe1('0x3f')](_0x5de300,{'showHidden':![],'depth':null}));ami[_0xebe1('0x47')](_0xebe1('0xab'),_0x5de300);break;default:_0x5de300[_0xebe1('0x9a')]=!![];_0x5de300[_0xebe1('0x91')]=moment()[_0xebe1('0x4c')](_0xebe1('0x82'));_0x5de300[_0xebe1('0xac')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x5de300[_0xebe1('0x1c')]=![];_0x5de300[_0xebe1('0x81')]=null;_0x5de300[_0xebe1('0x52')]=_0x5f7aad[_0xebe1('0xa8')];this[_0xebe1('0x11')][_0x5f7aad['uniqueid']]=_0x5de300;this[_0xebe1('0x45')](_0x5de300,_0xebe1('0x23'));}else if(this['isNotNull'](_0x5f7aad[_0xebe1('0xa7')])&&this[_0xebe1('0x6d')](_0x5f7aad[_0xebe1('0xa7')][_0xebe1('0xad')])){if(!_0x5de300['queuecallerabandon']){_0x5de300[_0xebe1('0x9a')]=!![];_0x5de300[_0xebe1('0x91')]=moment()[_0xebe1('0x4c')](_0xebe1('0x82'));_0x5de300['queuecallerexitreason']='EXITWITHKEY';_0x5de300[_0xebe1('0xac')]=moment()[_0xebe1('0x4c')](_0xebe1('0x82'));this[_0xebe1('0x11')][_0x5f7aad[_0xebe1('0x4b')]]=_0x5de300;}}logger[_0xebe1('0x75')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x5f7aad['uniqueid'],_0x5de300[_0xebe1('0x53')],_0x5de300[_0xebe1('0x68')],_[_0xebe1('0x79')](_0x5f7aad['variable'])[0x0],_0x5f7aad['value']);_0x5de300[_0xebe1('0x40')]=this[_0xebe1('0x40')][_0x5f7aad[_0xebe1('0x4b')]];}}}}catch(_0x38428f){logger[_0xebe1('0x3d')]('[%s][voiceQueueReport][varset]',_0x5f7aad['uniqueid'],util[_0xebe1('0x3f')](_0x38428f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xebe1('0xb')]['addVariable']=function(_0x11a696,_0x1620ef,_0x585cd2){var _0x495a3c=[_0xebe1('0xae'),_0xebe1('0xaf'),'rtpaudioqosjitter',_0xebe1('0xb0'),_0xebe1('0xb1'),_0xebe1('0xb2'),_0xebe1('0xb3'),'rtpaudioqosrttbridged',_0xebe1('0xb4'),_0xebe1('0xb5'),_0xebe1('0xb6'),'bridgepvtcallid',_0xebe1('0xb7'),_0xebe1('0xb8'),_0xebe1('0xb9'),_0xebe1('0xba'),'membername',_0xebe1('0xbb'),'memberrealtime'];if(!_['isNil'](_0x1620ef)&&!_[_0xebe1('0xbc')](_0x495a3c,_0x1620ef)){if(_[_0xebe1('0x59')](this[_0xebe1('0x40')][_0x11a696])){this[_0xebe1('0x40')][_0x11a696]={};}this[_0xebe1('0x40')][_0x11a696][_0x1620ef]=_0x585cd2;}};VoiceQueueReport[_0xebe1('0xb')][_0xebe1('0xbd')]=function(_0x40389a,_0x37d1d2,_0x4e3a99){var _0x2ecb72={};for(var _0x4ea8a5=0x0;_0x4ea8a5=0x0?moment(_0x311517[_0x4cd4('0x1b')])[_0x4cd4('0xf')](_0x311517[_0x4cd4('0x1a')],_0x4cd4('0x10')):null,'data1':_0x4cd4('0x1c'),'data2':_0x311517[_0x4cd4('0x15')],'data3':_0x311517[_0x4cd4('0x13')],'data4':_0x311517[_0x4cd4('0x1d')]||null,'role':_0x4cd4('0x14'),'internal':_0x311517['accountcode']?_[_0x4cd4('0x16')](_0x311517[_0x4cd4('0x15')]):undefined,'uniqueid':_0x311517[_0x4cd4('0x17')]},'log':_0x4cd4('0x7')});}; \ No newline at end of file +var _0xfd82=['exten','agent','uniqueid','moment','lodash','util','../client','queuecallercompleteAt','Request','CreateMemberReport','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','seconds','inbound','calleridnum','queue','toNumber','accountcode','voiceDialReport','voice','membername','starttime','endtime','diff','outbound'];(function(_0x5d69fa,_0x4a0f8b){var _0x218c32=function(_0x24bd61){while(--_0x24bd61){_0x5d69fa['push'](_0x5d69fa['shift']());}};_0x218c32(++_0x4a0f8b);}(_0xfd82,0x1e3));var _0x2fd8=function(_0x3394f9,_0x299aa5){_0x3394f9=_0x3394f9-0x0;var _0x36f77e=_0xfd82[_0x3394f9];return _0x36f77e;};'use strict';var moment=require(_0x2fd8('0x0'));var _=require(_0x2fd8('0x1'));var util=require(_0x2fd8('0x2'));var client=require(_0x2fd8('0x3'));exports['voiceQueueReport']=function(_0xe6eac1){var _0x52e19e=_0xe6eac1[_0x2fd8('0x4')]||_0xe6eac1['queuecallerexitAt'];return client[_0x2fd8('0x5')](_0x2fd8('0x6'),{'body':{'channel':'voice','membername':_0xe6eac1[_0x2fd8('0x7')],'interface':_[_0x2fd8('0x8')](_0xe6eac1[_0x2fd8('0x9')])?util[_0x2fd8('0xa')](_0x2fd8('0xb'),_0xe6eac1['lastAssignedTo']):_0xe6eac1['interface'],'type':_0x2fd8('0xc'),'enterAt':_0xe6eac1[_0x2fd8('0xd')],'exitAt':_0x52e19e,'duration':moment(_0x52e19e)['diff'](_0xe6eac1[_0x2fd8('0xd')],_0x2fd8('0xe')),'data1':_0x2fd8('0xf'),'data2':_0xe6eac1[_0x2fd8('0x10')],'data3':_0xe6eac1['exten'],'data4':null,'data5':_0xe6eac1[_0x2fd8('0x11')],'role':'agent','internal':_0xe6eac1['accountcode']?_[_0x2fd8('0x12')](_0xe6eac1[_0x2fd8('0x13')]):undefined,'uniqueid':_0xe6eac1['uniqueid']},'log':'CreateMemberReport'});};exports[_0x2fd8('0x14')]=function(_0x29f3bf){return client[_0x2fd8('0x5')]('CreateMemberReport',{'body':{'channel':_0x2fd8('0x15'),'membername':_0x29f3bf[_0x2fd8('0x16')],'interface':_0x29f3bf[_0x2fd8('0x9')],'type':_0x2fd8('0xc'),'enterAt':_0x29f3bf[_0x2fd8('0x17')],'exitAt':_0x29f3bf[_0x2fd8('0x18')],'duration':moment(_0x29f3bf[_0x2fd8('0x18')])[_0x2fd8('0x19')](_0x29f3bf[_0x2fd8('0x17')],_0x2fd8('0xe'))>=0x0?moment(_0x29f3bf[_0x2fd8('0x18')])[_0x2fd8('0x19')](_0x29f3bf[_0x2fd8('0x17')],_0x2fd8('0xe')):null,'data1':_0x2fd8('0x1a'),'data2':_0x29f3bf[_0x2fd8('0x13')],'data3':_0x29f3bf[_0x2fd8('0x1b')],'data4':_0x29f3bf['dialstring']||null,'role':_0x2fd8('0x1c'),'internal':_0x29f3bf[_0x2fd8('0x13')]?_[_0x2fd8('0x12')](_0x29f3bf[_0x2fd8('0x13')]):undefined,'uniqueid':_0x29f3bf[_0x2fd8('0x1d')]},'log':_0x2fd8('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 7ee64f9..ee5957d 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 _0x1053=['stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x2e61ec,_0xcd3af0){var _0x399591=function(_0x34a482){while(--_0x34a482){_0x2e61ec['push'](_0x2e61ec['shift']());}};_0x399591(++_0xcd3af0);}(_0x1053,0xd5));var _0x3105=function(_0x4cebb6,_0x53ba59){_0x4cebb6=_0x4cebb6-0x0;var _0x5ef179=_0x1053[_0x4cebb6];return _0x5ef179;};'use strict';var client=require(_0x3105('0x0'));exports[_0x3105('0x1')]=function(){return client[_0x3105('0x2')](_0x3105('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3105('0x4'),_0x3105('0x5')]},'log':_0x3105('0x6')});}; \ No newline at end of file +var _0x3792=['ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings'];(function(_0x452bbe,_0x339a1b){var _0xd0622b=function(_0x1ebda3){while(--_0x1ebda3){_0x452bbe['push'](_0x452bbe['shift']());}};_0xd0622b(++_0x339a1b);}(_0x3792,0xbe));var _0x2379=function(_0x3d3951,_0x3cffe2){_0x3d3951=_0x3d3951-0x0;var _0x47f3a7=_0x3792[_0x3d3951];return _0x47f3a7;};'use strict';var client=require(_0x2379('0x0'));exports[_0x2379('0x1')]=function(){return client['Request'](_0x2379('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x2379('0x3'),_0x2379('0x4')]},'log':_0x2379('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index b13e2b5..58db729 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 _0x2dcf=['name','html','GetTemplate','../client','getTemplates'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2dcf,0x1c5));var _0xf2dc=function(_0x351768,_0x190bfa){_0x351768=_0x351768-0x0;var _0x518539=_0x2dcf[_0x351768];return _0x518539;};'use strict';var client=require(_0xf2dc('0x0'));exports[_0xf2dc('0x1')]=function(_0x1a3184){return function(_0x38fd42){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xf2dc('0x2'),_0xf2dc('0x3')]},'log':_0xf2dc('0x4')});};}; \ No newline at end of file +var _0x0901=['../client','getTemplates','Request','GetTemplate'];(function(_0x46e1d2,_0x5a0d8a){var _0x5689d0=function(_0x657c08){while(--_0x657c08){_0x46e1d2['push'](_0x46e1d2['shift']());}};_0x5689d0(++_0x5a0d8a);}(_0x0901,0x134));var _0x1090=function(_0x25715d,_0x2ede9e){_0x25715d=_0x25715d-0x0;var _0x3aeb0c=_0x0901[_0x25715d];return _0x3aeb0c;};'use strict';var client=require(_0x1090('0x0'));exports[_0x1090('0x1')]=function(_0x42b657){return function(_0x39882a){return client[_0x1090('0x2')](_0x1090('0x3'),{'options':{'raw':!![],'attributes':['id','name','html']},'log':_0x1090('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 9df0d54..bf8bd57 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 _0x5002=['data7','GetTrigger','getTriggers','Request','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','data5','data6'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5002,0x72));var _0x2500=function(_0x570664,_0x2f077b){_0x570664=_0x570664-0x0;var _0x86a2bf=_0x5002[_0x570664];return _0x86a2bf;};'use strict';var client=require('../client');exports[_0x2500('0x0')]=function(_0x160f6e){return function(_0x68b298){return client[_0x2500('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id','name',_0x2500('0x2'),_0x2500('0x3')],'include':[{'model':_0x2500('0x4'),'as':_0x2500('0x5'),'attributes':['id',_0x2500('0x6'),_0x2500('0x7'),_0x2500('0x8')]},{'model':_0x2500('0x4'),'as':_0x2500('0x9'),'attributes':['id',_0x2500('0x6'),_0x2500('0x7'),'value']},{'model':_0x2500('0xa'),'as':_0x2500('0xb'),'attributes':['id','action','data1','data2','data3','data4',_0x2500('0xc'),_0x2500('0xd'),_0x2500('0xe')]}]},'log':_0x2500('0xf')});};}; \ No newline at end of file +var _0x558d=['data2','data3','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','Condition','AllConditions','field','value','AnyConditions','operator','Action','Actions','action','data1'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x558d,0x16a));var _0xd558=function(_0x47041d,_0x42153f){_0x47041d=_0x47041d-0x0;var _0x5022bd=_0x558d[_0x47041d];return _0x5022bd;};'use strict';var client=require(_0xd558('0x0'));exports[_0xd558('0x1')]=function(_0x3da6c6){return function(_0x43a6cf){return client[_0xd558('0x2')](_0xd558('0x3'),{'options':{'raw':![],'attributes':['id',_0xd558('0x4'),_0xd558('0x5'),'status'],'include':[{'model':_0xd558('0x6'),'as':_0xd558('0x7'),'attributes':['id',_0xd558('0x8'),'operator',_0xd558('0x9')]},{'model':_0xd558('0x6'),'as':_0xd558('0xa'),'attributes':['id',_0xd558('0x8'),_0xd558('0xb'),_0xd558('0x9')]},{'model':_0xd558('0xc'),'as':_0xd558('0xd'),'attributes':['id',_0xd558('0xe'),_0xd558('0xf'),_0xd558('0x10'),_0xd558('0x11'),'data4',_0xd558('0x12'),_0xd558('0x13'),_0xd558('0x14')]}]},'log':_0xd558('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 5d93f65..6539ae0 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 _0x0eec=['GetTrunk','name','registry','defaultuser','../client','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0eec,0xac));var _0xc0ee=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0eec[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xc0ee('0x0'));exports['getTrunks']=function(_0x51c509){return function(_0x30bcf3){return client[_0xc0ee('0x1')](_0xc0ee('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xc0ee('0x3'),_0xc0ee('0x4'),_0xc0ee('0x5')]},'log':_0xc0ee('0x2')});};}; \ No newline at end of file +var _0x6510=['../client','getTrunks','Request','name','registry','defaultuser','GetTrunk'];(function(_0x265ec3,_0x1efa96){var _0x253820=function(_0x414e7c){while(--_0x414e7c){_0x265ec3['push'](_0x265ec3['shift']());}};_0x253820(++_0x1efa96);}(_0x6510,0x77));var _0x0651=function(_0x569338,_0x3230b5){_0x569338=_0x569338-0x0;var _0x106d4b=_0x6510[_0x569338];return _0x106d4b;};'use strict';var client=require(_0x0651('0x0'));exports[_0x0651('0x1')]=function(_0x1ce53b){return function(_0x1668b0){return client[_0x0651('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x0651('0x3'),_0x0651('0x4'),_0x0651('0x5')]},'log':_0x0651('0x6')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index a9a2564..97db0dd 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 _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});}; \ No newline at end of file +var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x4ca0a7,_0x1b26ac){var _0x26282a=function(_0x3dcc83){while(--_0x3dcc83){_0x4ca0a7['push'](_0x4ca0a7['shift']());}};_0x26282a(++_0x1b26ac);}(_0x70e0,0x17b));var _0x070e=function(_0x155d50,_0x221c92){_0x155d50=_0x155d50-0x0;var _0x599183=_0x70e0[_0x155d50];return _0x599183;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index f3a641b..41fc023 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 _0x0969=['../client','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x4fcd97,_0x4e553c){var _0x439b10=function(_0x16ac91){while(--_0x16ac91){_0x4fcd97['push'](_0x4fcd97['shift']());}};_0x439b10(++_0x4e553c);}(_0x0969,0x19a));var _0x9096=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x0969[_0x4fc9e6];return _0x551d28;};'use strict';var client=require(_0x9096('0x0'));exports['create']=function(_0x56a643){return client[_0x9096('0x1')](_0x9096('0x2'),{'body':_0x56a643,'log':_0x9096('0x2')});};exports[_0x9096('0x3')]=function(_0x3491e4,_0x555096,_0x48f48c){return client['Request'](_0x9096('0x4'),{'body':_0x3491e4,'options':{'where':{'uniqueid':_0x555096,'interface':_0x48f48c,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x25e6=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x46c8fb,_0x253501){var _0x48f9eb=function(_0x5d5b03){while(--_0x5d5b03){_0x46c8fb['push'](_0x46c8fb['shift']());}};_0x48f9eb(++_0x253501);}(_0x25e6,0x10d));var _0x625e=function(_0x324bab,_0x326e67){_0x324bab=_0x324bab-0x0;var _0x103149=_0x25e6[_0x324bab];return _0x103149;};'use strict';var client=require(_0x625e('0x0'));exports[_0x625e('0x1')]=function(_0x1f01ae){return client[_0x625e('0x2')](_0x625e('0x3'),{'body':_0x1f01ae,'log':_0x625e('0x3')});};exports[_0x625e('0x4')]=function(_0x8c3ff7,_0x1a0d6c,_0x4130d4){return client[_0x625e('0x2')](_0x625e('0x5'),{'body':_0x8c3ff7,'options':{'where':{'uniqueid':_0x1a0d6c,'interface':_0x4130d4,'agentcomplete':!![]}},'log':_0x625e('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 3ab5baf..cd1058d 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 _0x2a1f=['YYYY-MM-DD\x20HH:mm:ss','type','disposition','billableseconds','moment','lodash','../client','Request','CreateVoiceCallReport','merge','calleridnum','callerid','getVoiceCallReports','GetVoiceCallReport','startOf','day','format'];(function(_0x1ab958,_0x123fc9){var _0x1d560b=function(_0x185ff6){while(--_0x185ff6){_0x1ab958['push'](_0x1ab958['shift']());}};_0x1d560b(++_0x123fc9);}(_0x2a1f,0x6a));var _0xf2a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a1f[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xf2a1('0x0'));var util=require('util');var _=require(_0xf2a1('0x1'));var client=require(_0xf2a1('0x2'));exports['create']=function(_0x2802a7){return client[_0xf2a1('0x3')](_0xf2a1('0x4'),{'body':_[_0xf2a1('0x5')](_0x2802a7,{'source':_0x2802a7[_0xf2a1('0x6')],'destinationcontext':_0x2802a7['context'],'callerid':_0x2802a7[_0xf2a1('0x7')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0xf2a1('0x8')]=function(){return function(){return client[_0xf2a1('0x3')](_0xf2a1('0x9'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xf2a1('0xa')](_0xf2a1('0xb'))[_0xf2a1('0xc')](_0xf2a1('0xd')),moment()['endOf'](_0xf2a1('0xb'))[_0xf2a1('0xc')](_0xf2a1('0xd'))]}},'attributes':[_0xf2a1('0xe'),_0xf2a1('0xf'),'duration',_0xf2a1('0x10')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0xaade=['merge','context','callerid','DOCUMENTATION','getVoiceCallReports','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','GetVoiceCallReports','moment','lodash','create','Request','CreateVoiceCallReport'];(function(_0x56418e,_0x362812){var _0x5b160c=function(_0x5b44cb){while(--_0x5b44cb){_0x56418e['push'](_0x56418e['shift']());}};_0x5b160c(++_0x362812);}(_0xaade,0x118));var _0xeaad=function(_0x25dfd1,_0x545943){_0x25dfd1=_0x25dfd1-0x0;var _0xc99de2=_0xaade[_0x25dfd1];return _0xc99de2;};'use strict';var moment=require(_0xeaad('0x0'));var util=require('util');var _=require(_0xeaad('0x1'));var client=require('../client');exports[_0xeaad('0x2')]=function(_0x26dbdd){return client[_0xeaad('0x3')](_0xeaad('0x4'),{'body':_[_0xeaad('0x5')](_0x26dbdd,{'source':_0x26dbdd['calleridnum'],'destinationcontext':_0x26dbdd[_0xeaad('0x6')],'callerid':_0x26dbdd[_0xeaad('0x7')],'amaflags':_0xeaad('0x8')}),'log':'CreateVoiceCallReport'});};exports[_0xeaad('0x9')]=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0xeaad('0xa')],'createdAt':{'$between':[moment()[_0xeaad('0xb')](_0xeaad('0xc'))[_0xeaad('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0xeaad('0xc'))[_0xeaad('0xd')](_0xeaad('0xe'))]}},'attributes':[_0xeaad('0xf'),_0xeaad('0x10'),_0xeaad('0x11'),'billableseconds']},'log':_0xeaad('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index e80575e..451272e 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 _0x1856=['Request','CreateVoiceDialReport','create'];(function(_0xb61d88,_0x388bba){var _0x196a0d=function(_0x4c1f72){while(--_0x4c1f72){_0xb61d88['push'](_0xb61d88['shift']());}};_0x196a0d(++_0x388bba);}(_0x1856,0xf5));var _0x6185=function(_0xe967a0,_0x3d8df0){_0xe967a0=_0xe967a0-0x0;var _0x2c4c9c=_0x1856[_0xe967a0];return _0x2c4c9c;};'use strict';var client=require('../client');exports[_0x6185('0x0')]=function(_0x4f26f8){return client[_0x6185('0x1')](_0x6185('0x2'),{'body':_0x4f26f8,'log':_0x6185('0x2')});}; \ No newline at end of file +var _0xa2c5=['Request','CreateVoiceDialReport','../client','create'];(function(_0x393a0b,_0x2447b3){var _0x22b5b2=function(_0x1d9121){while(--_0x1d9121){_0x393a0b['push'](_0x393a0b['shift']());}};_0x22b5b2(++_0x2447b3);}(_0xa2c5,0x96));var _0x5a2c=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xa2c5[_0x2112d4];return _0x434972;};'use strict';var client=require(_0x5a2c('0x0'));exports[_0x5a2c('0x1')]=function(_0x7f481a){return client[_0x5a2c('0x2')](_0x5a2c('0x3'),{'body':_0x7f481a,'log':_0x5a2c('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 9ef2534..5b0920a 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 _0xb58b=['recordingFormat','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x2c29ee,_0x592b82){var _0xf8a52d=function(_0x36184f){while(--_0x36184f){_0x2c29ee['push'](_0x2c29ee['shift']());}};_0xf8a52d(++_0x592b82);}(_0xb58b,0x1f1));var _0xbb58=function(_0x47bb26,_0x2e29a6){_0x47bb26=_0x47bb26-0x0;var _0x13c38e=_0xb58b[_0x47bb26];return _0x13c38e;};'use strict';var client=require('../client');exports[_0xbb58('0x0')]=function(){return function(){return client[_0xbb58('0x1')](_0xbb58('0x2'),{'options':{'raw':!![],'attributes':['id','exten',_0xbb58('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xbb58('0x0')});};}; \ No newline at end of file +var _0xb84e=['Request','GetVoiceExtension','exten','getVoiceExtensions'];(function(_0x50e3f5,_0x52ead4){var _0x3e5226=function(_0x42131c){while(--_0x42131c){_0x50e3f5['push'](_0x50e3f5['shift']());}};_0x3e5226(++_0x52ead4);}(_0xb84e,0xbf));var _0xeb84=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0xb84e[_0x125ff8];return _0x2d9ef;};'use strict';var client=require('../client');exports[_0xeb84('0x0')]=function(){return function(){return client[_0xeb84('0x1')](_0xeb84('0x2'),{'options':{'raw':!![],'attributes':['id',_0xeb84('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index b0101f3..6a85e67 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 _0xcb1d=['dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','name','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','getVoiceQueues','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialQueueOptions'];(function(_0x13e2bd,_0x3f55af){var _0x640acb=function(_0x3a620a){while(--_0x3a620a){_0x13e2bd['push'](_0x13e2bd['shift']());}};_0x640acb(++_0x3f55af);}(_0xcb1d,0x1aa));var _0xdcb1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcb1d[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports[_0xdcb1('0x0')]=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name','acw',_0xdcb1('0x1'),_0xdcb1('0x2'),_0xdcb1('0x3'),_0xdcb1('0x4'),_0xdcb1('0x5'),_0xdcb1('0x6'),_0xdcb1('0x7'),_0xdcb1('0x8'),_0xdcb1('0x9'),_0xdcb1('0xa'),_0xdcb1('0xb'),_0xdcb1('0xc'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout',_0xdcb1('0xd'),_0xdcb1('0xe'),_0xdcb1('0xf'),_0xdcb1('0x10'),_0xdcb1('0x11'),'dialBusyMaxRetry',_0xdcb1('0x12'),_0xdcb1('0x13'),'dialNoAnswerRetryFrequency','dialGlobalMaxRetry',_0xdcb1('0x14'),'dialGlobalInterval',_0xdcb1('0x15'),_0xdcb1('0x16'),_0xdcb1('0x17'),_0xdcb1('0x18'),_0xdcb1('0x19'),_0xdcb1('0x1a'),_0xdcb1('0x1b'),'dialAMDMinWordLength',_0xdcb1('0x1c'),'dialAMDMaximumNumberOfWords',_0xdcb1('0x1d'),_0xdcb1('0x1e'),_0xdcb1('0x1f'),_0xdcb1('0x20'),'dialRecallInQueue',_0xdcb1('0x21'),_0xdcb1('0x22'),_0xdcb1('0x23'),_0xdcb1('0x24'),_0xdcb1('0x3'),_0xdcb1('0x25'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0xdcb1('0x26'),'dialNoSuchNumberRetryFrequency',_0xdcb1('0x27'),_0xdcb1('0x28'),_0xdcb1('0x29'),'dialAbandonedRetryFrequency',_0xdcb1('0x2a'),_0xdcb1('0x2b'),'dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency',_0xdcb1('0x2c'),_0xdcb1('0x2d'),_0xdcb1('0x2e'),'dialPreviewAutoRecallMe','dialPreviewRecallmeReminder'],'include':[{'model':'Trunk','as':'Trunk','attributes':['id',_0xdcb1('0x2f'),_0xdcb1('0x30'),_0xdcb1('0x31')]},{'model':_0xdcb1('0x32'),'as':_0xdcb1('0x33'),'attributes':['id','name']},{'model':'Trunk','as':_0xdcb1('0x34'),'attributes':['id','name',_0xdcb1('0x30'),_0xdcb1('0x31')]},{'model':_0xdcb1('0x35'),'as':_0xdcb1('0x35'),'attributes':['id','name'],'include':[{'model':_0xdcb1('0x35'),'as':_0xdcb1('0x36'),'attributes':['id',_0xdcb1('0x2f'),'interval']}]}]},'log':_0xdcb1('0x0')});};}; \ No newline at end of file +var _0x3270=['Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active'];(function(_0x414ee7,_0x42b2af){var _0x3eb5e1=function(_0x2c8b70){while(--_0x2c8b70){_0x414ee7['push'](_0x414ee7['shift']());}};_0x3eb5e1(++_0x42b2af);}(_0x3270,0xcf));var _0x0327=function(_0x219d87,_0x1cb6f7){_0x219d87=_0x219d87-0x0;var _0x22823d=_0x3270[_0x219d87];return _0x22823d;};'use strict';var client=require(_0x0327('0x0'));exports[_0x0327('0x1')]=function(){return function(){return client[_0x0327('0x2')](_0x0327('0x3'),{'options':{'raw':![],'attributes':['id',_0x0327('0x4'),_0x0327('0x5'),'acwTimeout','autopause',_0x0327('0x6'),_0x0327('0x7'),_0x0327('0x8'),_0x0327('0x9'),_0x0327('0xa'),'dialLimitQueue',_0x0327('0xb'),_0x0327('0xc'),_0x0327('0xd'),'dialPredictiveInterval','dialOriginateCallerIdName',_0x0327('0xe'),'dialOriginateTimeout',_0x0327('0xf'),_0x0327('0x10'),_0x0327('0x11'),_0x0327('0x12'),_0x0327('0x13'),'dialBusyMaxRetry',_0x0327('0x14'),_0x0327('0x15'),_0x0327('0x16'),_0x0327('0x17'),_0x0327('0x18'),_0x0327('0x19'),_0x0327('0x1a'),_0x0327('0x1b'),_0x0327('0x1c'),_0x0327('0x1d'),_0x0327('0x1e'),_0x0327('0x1f'),_0x0327('0x20'),'dialAMDMinWordLength','dialAMDBetweenWordsSilence',_0x0327('0x21'),_0x0327('0x22'),_0x0327('0x23'),_0x0327('0x24'),_0x0327('0x25'),'dialRecallInQueue',_0x0327('0x26'),_0x0327('0x27'),_0x0327('0x28'),_0x0327('0x29'),_0x0327('0x6'),_0x0327('0x2a'),_0x0327('0x2b'),_0x0327('0x2c'),_0x0327('0x2d'),'dialNoSuchNumberRetryFrequency',_0x0327('0x2e'),_0x0327('0x2f'),_0x0327('0x30'),_0x0327('0x31'),_0x0327('0x32'),_0x0327('0x33'),'dialAgentRejectMaxRetry',_0x0327('0x34'),_0x0327('0x35'),_0x0327('0x36'),_0x0327('0x37'),_0x0327('0x38'),_0x0327('0x39')],'include':[{'model':_0x0327('0x3a'),'as':'Trunk','attributes':['id',_0x0327('0x4'),_0x0327('0x3b'),_0x0327('0x3c')]},{'model':_0x0327('0x3d'),'as':_0x0327('0x3e'),'attributes':['id',_0x0327('0x4')]},{'model':_0x0327('0x3a'),'as':_0x0327('0x3f'),'attributes':['id',_0x0327('0x4'),_0x0327('0x3b'),_0x0327('0x3c')]},{'model':_0x0327('0x40'),'as':_0x0327('0x40'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0x0327('0x41'),'attributes':['id',_0x0327('0x4'),_0x0327('0x42')]}]}]},'log':_0x0327('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index d0e4835..af1c0b3 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(_0x592843,_0x13d6c9){var _0x59c753=function(_0x1b5eec){while(--_0x1b5eec){_0x592843['push'](_0x592843['shift']());}};_0x59c753(++_0x13d6c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x5d719f,_0x418029){var _0x3cd75a=function(_0xe745f7){while(--_0xe745f7){_0x5d719f['push'](_0x5d719f['shift']());}};_0x3cd75a(++_0x418029);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 0ba5db2..890a75a 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 _0x8f5e=['getVoiceQueueRtPauses','Request'];(function(_0x46a8d0,_0x315bd9){var _0x53185c=function(_0x3860a7){while(--_0x3860a7){_0x46a8d0['push'](_0x46a8d0['shift']());}};_0x53185c(++_0x315bd9);}(_0x8f5e,0x9d));var _0xe8f5=function(_0x18c10f,_0x4e28a5){_0x18c10f=_0x18c10f-0x0;var _0x1c63fa=_0x8f5e[_0x18c10f];return _0x1c63fa;};'use strict';var client=require('../client');exports['getVoiceQueueRtPauses']=function(_0x57ecd8){return function(){return client[_0xe8f5('0x0')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x57ecd8,'paused':!![]},'raw':!![]},'log':_0xe8f5('0x1')});};}; \ No newline at end of file +var _0xf357=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x1ec78e,_0x1f3c41){var _0x406d3c=function(_0xb03223){while(--_0xb03223){_0x1ec78e['push'](_0x1ec78e['shift']());}};_0x406d3c(++_0x1f3c41);}(_0xf357,0x17e));var _0x7f35=function(_0x50a519,_0x2b35f5){_0x50a519=_0x50a519-0x0;var _0x43d243=_0xf357[_0x50a519];return _0x43d243;};'use strict';var client=require(_0x7f35('0x0'));exports[_0x7f35('0x1')]=function(_0x34cdb0){return function(){return client[_0x7f35('0x2')](_0x7f35('0x3'),{'options':{'where':{'VoiceQueueId':_0x34cdb0,'paused':!![]},'raw':!![]},'log':_0x7f35('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index e9ed031..a743280 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(_0x18d47e,_0x210d88){var _0x3bf99f=function(_0x56973d){while(--_0x56973d){_0x18d47e['push'](_0x18d47e['shift']());}};_0x3bf99f(++_0x210d88);}(_0x7a54,0x106));var _0x47a5=function(_0x225206,_0x8f5afc){_0x225206=_0x225206-0x0;var _0x2f3ca8=_0x7a54[_0x225206];return _0x2f3ca8;};'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(_0x260130,_0x4a8829){var _0x9fa6a=function(_0x4c56e1){while(--_0x4c56e1){_0x260130['push'](_0x260130['shift']());}};_0x9fa6a(++_0x4a8829);}(_0x7a54,0x106));var _0x47a5=function(_0x4a5976,_0x5b9fb2){_0x4a5976=_0x4a5976-0x0;var _0x7059ac=_0x7a54[_0x4a5976];return _0x7059ac;};'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 7ac1d1b..bf69419 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 _0xe3e5=['../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','blind','attendedTransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetlinkedid','isexternal','origtransfererexten','attended'];(function(_0x4d1d2c,_0x44f4d8){var _0x2c4cb9=function(_0x4b0c5f){while(--_0x4b0c5f){_0x4d1d2c['push'](_0x4d1d2c['shift']());}};_0x2c4cb9(++_0x44f4d8);}(_0xe3e5,0xea));var _0x5e3e=function(_0x51eeb9,_0x3e319f){_0x51eeb9=_0x51eeb9-0x0;var _0x356790=_0xe3e5[_0x51eeb9];return _0x356790;};'use strict';var client=require(_0x5e3e('0x0'));exports['transfers']={};exports[_0x5e3e('0x1')]=function(_0x41ba13){return client[_0x5e3e('0x2')](_0x5e3e('0x3'),{'body':{'result':_0x41ba13[_0x5e3e('0x4')],'transfererchannel':_0x41ba13[_0x5e3e('0x5')],'transferercalleridnum':_0x41ba13[_0x5e3e('0x6')],'transferercalleridname':_0x41ba13[_0x5e3e('0x7')],'transfererconnectedlinenum':_0x41ba13[_0x5e3e('0x8')],'transfererconnectedlinename':_0x41ba13[_0x5e3e('0x9')],'transfereraccountcode':_0x41ba13['transfereraccountcode'],'transferercontext':_0x41ba13['transferercontext'],'transfererexten':_0x41ba13[_0x5e3e('0xa')],'transfererlinkedid':_0x41ba13[_0x5e3e('0xb')],'transfereechannel':_0x41ba13[_0x5e3e('0xc')],'transfereecalleridnum':_0x41ba13[_0x5e3e('0xd')],'transfereecalleridname':_0x41ba13['transfereecalleridname'],'transfereeconnectedlinenum':_0x41ba13[_0x5e3e('0xe')],'transfereeconnectedlinename':_0x41ba13[_0x5e3e('0xf')],'transfereeaccountcode':_0x41ba13[_0x5e3e('0x10')],'transfereecontext':_0x41ba13[_0x5e3e('0x11')],'transfereeexten':_0x41ba13[_0x5e3e('0x12')],'transfereelinkedid':_0x41ba13[_0x5e3e('0x13')],'isexternal':_0x41ba13['isexternal'],'context':_0x41ba13[_0x5e3e('0x14')],'extension':_0x41ba13[_0x5e3e('0x15')],'type':_0x5e3e('0x16')},'log':'CreateVoiceTransferReport'});};exports[_0x5e3e('0x17')]=function(_0x8344cf){return client[_0x5e3e('0x2')](_0x5e3e('0x3'),{'body':{'result':_0x8344cf[_0x5e3e('0x4')],'transfererchannel':_0x8344cf['origtransfererchannel'],'transferercalleridnum':_0x8344cf[_0x5e3e('0x18')],'transferercalleridname':_0x8344cf[_0x5e3e('0x19')],'transfererconnectedlinenum':_0x8344cf[_0x5e3e('0x1a')],'transfererconnectedlinename':_0x8344cf['secondtransfererconnectedlinename'],'transfereraccountcode':_0x8344cf[_0x5e3e('0x1b')],'transferercontext':_0x8344cf[_0x5e3e('0x1c')],'transfererexten':_0x8344cf[_0x5e3e('0x1d')],'transfererlinkedid':_0x8344cf['origtransfererlinkedid'],'transfereechannel':_0x8344cf[_0x5e3e('0x1e')],'transfereecalleridnum':_0x8344cf[_0x5e3e('0x1f')],'transfereecalleridname':_0x8344cf['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x8344cf[_0x5e3e('0x20')],'transfereeconnectedlinename':_0x8344cf[_0x5e3e('0x21')],'transfereeaccountcode':_0x8344cf[_0x5e3e('0x22')],'transfereecontext':_0x8344cf['transfertargetcontext'],'transfereeexten':_0x8344cf['transfertargetexten'],'transfereelinkedid':_0x8344cf[_0x5e3e('0x23')],'isexternal':_0x8344cf[_0x5e3e('0x24')],'context':_0x8344cf['origtransferercontext'],'extension':_0x8344cf[_0x5e3e('0x25')],'type':_0x5e3e('0x26')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0xd4ed=['origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','attended','../client','transfers','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','origtransfererchannel'];(function(_0x13d583,_0x5fa9fe){var _0x200579=function(_0x358d65){while(--_0x358d65){_0x13d583['push'](_0x13d583['shift']());}};_0x200579(++_0x5fa9fe);}(_0xd4ed,0xa2));var _0xdd4e=function(_0x45fd84,_0x2145c2){_0x45fd84=_0x45fd84-0x0;var _0x1add79=_0xd4ed[_0x45fd84];return _0x1add79;};'use strict';var client=require(_0xdd4e('0x0'));exports[_0xdd4e('0x1')]={};exports['blindTransfer']=function(_0x85cbf1){return client[_0xdd4e('0x2')](_0xdd4e('0x3'),{'body':{'result':_0x85cbf1[_0xdd4e('0x4')],'transfererchannel':_0x85cbf1[_0xdd4e('0x5')],'transferercalleridnum':_0x85cbf1[_0xdd4e('0x6')],'transferercalleridname':_0x85cbf1['transferercalleridname'],'transfererconnectedlinenum':_0x85cbf1['transfererconnectedlinenum'],'transfererconnectedlinename':_0x85cbf1['transfererconnectedlinename'],'transfereraccountcode':_0x85cbf1[_0xdd4e('0x7')],'transferercontext':_0x85cbf1[_0xdd4e('0x8')],'transfererexten':_0x85cbf1['transfererexten'],'transfererlinkedid':_0x85cbf1[_0xdd4e('0x9')],'transfereechannel':_0x85cbf1[_0xdd4e('0xa')],'transfereecalleridnum':_0x85cbf1[_0xdd4e('0xb')],'transfereecalleridname':_0x85cbf1[_0xdd4e('0xc')],'transfereeconnectedlinenum':_0x85cbf1['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x85cbf1[_0xdd4e('0xd')],'transfereeaccountcode':_0x85cbf1[_0xdd4e('0xe')],'transfereecontext':_0x85cbf1[_0xdd4e('0xf')],'transfereeexten':_0x85cbf1[_0xdd4e('0x10')],'transfereelinkedid':_0x85cbf1[_0xdd4e('0x11')],'isexternal':_0x85cbf1[_0xdd4e('0x12')],'context':_0x85cbf1[_0xdd4e('0x13')],'extension':_0x85cbf1[_0xdd4e('0x14')],'type':_0xdd4e('0x15')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x4c7b3a){return client[_0xdd4e('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x4c7b3a[_0xdd4e('0x4')],'transfererchannel':_0x4c7b3a[_0xdd4e('0x16')],'transferercalleridnum':_0x4c7b3a[_0xdd4e('0x17')],'transferercalleridname':_0x4c7b3a[_0xdd4e('0x18')],'transfererconnectedlinenum':_0x4c7b3a[_0xdd4e('0x19')],'transfererconnectedlinename':_0x4c7b3a[_0xdd4e('0x1a')],'transfereraccountcode':_0x4c7b3a[_0xdd4e('0x1b')],'transferercontext':_0x4c7b3a['secondtransferercontext'],'transfererexten':_0x4c7b3a['secondtransfererexten'],'transfererlinkedid':_0x4c7b3a[_0xdd4e('0x1c')],'transfereechannel':_0x4c7b3a['transfertargetchannel'],'transfereecalleridnum':_0x4c7b3a[_0xdd4e('0x1d')],'transfereecalleridname':_0x4c7b3a[_0xdd4e('0x1e')],'transfereeconnectedlinenum':_0x4c7b3a[_0xdd4e('0x1f')],'transfereeconnectedlinename':_0x4c7b3a[_0xdd4e('0x20')],'transfereeaccountcode':_0x4c7b3a['transfertargetaccountcode'],'transfereecontext':_0x4c7b3a[_0xdd4e('0x21')],'transfereeexten':_0x4c7b3a[_0xdd4e('0x22')],'transfereelinkedid':_0x4c7b3a[_0xdd4e('0x23')],'isexternal':_0x4c7b3a[_0xdd4e('0x12')],'context':_0x4c7b3a['origtransferercontext'],'extension':_0x4c7b3a['origtransfererexten'],'type':_0xdd4e('0x24')},'log':_0xdd4e('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 091f850..29e65c8 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 _0xbd51=['Action','then','message','error','isConnected','join','pick','command','Command','catch','voiceQueues','hasOwnProperty','push','length','find','undefined','values','channels','voicechannel','map','uniqueid','channel','format','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','type','outbound','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','telephones','trunks','outboundChannels','run','Event\x20name\x20mandatory','emit','custom:','send','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','jayson/promise','validate','moment','../../../config/environment','%s/%s','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','asterisk','username','ami\x20disconnected','keys','reload','module','action','Reload'];(function(_0x1ed3e6,_0x5a895c){var _0x165038=function(_0x4e3b9e){while(--_0x4e3b9e){_0x1ed3e6['push'](_0x1ed3e6['shift']());}};_0x165038(++_0x5a895c);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x3b4f79,_0x57e5e1){_0x3b4f79=_0x3b4f79-0x0;var _0x5b1c0a=_0xbd51[_0x3b4f79];return _0x5b1c0a;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var jayson=require(_0x1bd5('0x1'));var schema=require(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var config=require(_0x1bd5('0x4'));var properties=require('../properties');var ami=require('../ami');var VoiceQueueSummary=require('../model/voiceQueueSummary');exports['listen']=function(_0x3bce00,_0x362b24,_0x43e6b6){return new Promise(function(_0x59ddfb,_0x29abea){var _0x30a385={'QueuePause':function(_0x19077c){return new Promise(function(_0x27d58f){var _0xd8418f=util['format'](_0x1bd5('0x5'),'SIP',_0x19077c[_0x1bd5('0x6')]);if(_0x3bce00[_0x1bd5('0x7')]&&_0x3bce00[_0x1bd5('0x7')][_0xd8418f]&&_0x3bce00[_0x1bd5('0x7')][_0xd8418f][_0x1bd5('0x8')]){_0x3bce00[_0x1bd5('0x7')][_0xd8418f]['updateAcw']();}if(_0x3bce00[_0x1bd5('0x9')][_0xd8418f]){_0x3bce00['agents'][_0xd8418f][_0x1bd5('0xa')]({'statePause':_0x19077c[_0x1bd5('0xb')]?!![]:![]});}_0x27d58f({'code':0xc8,'message':_0x1bd5('0xc')});});},'Reload':function(_0x14606b){var _0x177be0=this;return new Promise(function(_0x81f02c,_0x1527c1){if(ami['isConnected']()==![]){return _0x1527c1(_0x177be0['error'](0x1f4,[config[_0x1bd5('0xd')]['ip'],config[_0x1bd5('0xd')][_0x1bd5('0xe')],_0x1bd5('0xf')]['join']('\x20')));}_0x14606b=_['pick'](_0x14606b,_[_0x1bd5('0x10')](properties[_0x1bd5('0x11')][_0x1bd5('0x12')]));_0x14606b[_0x1bd5('0x13')]=_0x1bd5('0x14');return ami[_0x1bd5('0x15')](_0x14606b)[_0x1bd5('0x16')](function(_0x3afc4a){_0x81f02c({'code':0xc8,'message':_0x3afc4a[_0x1bd5('0x17')]});})['catch'](function(_0x53ad5e){_0x1527c1(_0x177be0[_0x1bd5('0x18')](0x1f5,_0x53ad5e[_0x1bd5('0x17')]));});});},'Command':function(_0x476bd1){var _0xb95d4e=this;return new Promise(function(_0x459649,_0x2ff39a){if(ami[_0x1bd5('0x19')]()==![]){return _0x2ff39a(_0xb95d4e[_0x1bd5('0x18')](0x1f4,[config[_0x1bd5('0xd')]['ip'],config[_0x1bd5('0xd')][_0x1bd5('0xe')],_0x1bd5('0xf')][_0x1bd5('0x1a')]('\x20')));}_0x476bd1=_[_0x1bd5('0x1b')](_0x476bd1,_0x1bd5('0x1c'));_0x476bd1[_0x1bd5('0x13')]=_0x1bd5('0x1d');return ami[_0x1bd5('0x15')](_0x476bd1)['then'](function(_0x42c43d){_0x459649({'code':0xc8,'message':_0x42c43d['content']});})[_0x1bd5('0x1e')](function(_0x1e534e){_0x2ff39a(_0xb95d4e[_0x1bd5('0x18')](0x1f5,_0x1e534e['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x3f4156){var _0x4fa37c=[];for(var _0x2ed551 in _0x3bce00[_0x1bd5('0x1f')]){if(_0x3bce00[_0x1bd5('0x1f')][_0x1bd5('0x20')](_0x2ed551)){var _0x47c84b=_0x3bce00[_0x1bd5('0x1f')][_0x2ed551];var _0x69bb17=new VoiceQueueSummary(_0x47c84b);_0x4fa37c[_0x1bd5('0x21')](_0x69bb17);}}_0x3f4156({'count':_0x4fa37c[_0x1bd5('0x22')],'rows':_0x4fa37c});});},'UpdateVoiceQueue':function(_0x4cebd0){return new Promise(function(_0xdba332,_0x24d4d9){var _0x3595e9=_[_0x1bd5('0x23')](_0x3bce00[_0x1bd5('0x1f')],{'id':parseInt(_0x4cebd0['id'])});var _0xc73670=_['omit'](_0x4cebd0,['id']);if(_0x3595e9){for(var _0x289097 in _0xc73670){if(typeof _0xc73670[_0x289097]!==_0x1bd5('0x24')&&typeof _0x3595e9[_0x289097]!==_0x1bd5('0x24')){_0x3595e9[_0x289097]=_0xc73670[_0x289097];}}_0xdba332(_0x3595e9);}else{_0x24d4d9();}});},'VoiceChannels':function(){return new Promise(function(_0x4bcc77){var _0x176a33=_[_0x1bd5('0x25')](_0x3bce00[_0x1bd5('0x26')]);_0x4bcc77({'count':_0x176a33[_0x1bd5('0x22')],'rows':_0x176a33});});},'VoiceChannelMixMonitor':function(_0x1f4456){var _0x1d612b=this;return new Promise(function(_0x596e3c,_0x49ea1e){if(ami[_0x1bd5('0x19')]()==![]){return _0x49ea1e(_0x1d612b[_0x1bd5('0x18')](0x1f4,[config['asterisk']['ip'],config[_0x1bd5('0xd')][_0x1bd5('0xe')],_0x1bd5('0xf')][_0x1bd5('0x1a')]('\x20')));}var _0x558452=schema(properties[_0x1bd5('0x27')])[_0x1bd5('0x2')](_0x1f4456);if(_0x558452[_0x1bd5('0x22')]>0x0){return _0x49ea1e(_0x1d612b[_0x1bd5('0x18')](0x1f4,_[_0x1bd5('0x28')](_0x558452,_0x1bd5('0x17'))[_0x1bd5('0x1a')](',\x20')));}var _0x21df80=_['find'](_0x3bce00[_0x1bd5('0x26')],{'uniqueid':_0x1f4456[_0x1bd5('0x29')]});if(_0x21df80&&_0x21df80[_0x1bd5('0x2a')]){var _0x24c92e=util[_0x1bd5('0x2b')](_0x1bd5('0x2c'),_0x1f4456[_0x1bd5('0x2d')]||_0x1f4456['uniqueid'],_0x1f4456[_0x1bd5('0x2b')]||_0x1bd5('0x2e'));return ami[_0x1bd5('0x15')]({'action':_0x1bd5('0x2f'),'channel':_0x21df80[_0x1bd5('0x2a')],'file':_0x24c92e,'options':_0x1bd5('0x30')})[_0x1bd5('0x16')](function(_0x4cc9ba){var _0x5e8b61=_[_0x1bd5('0x23')](_0x21df80[_0x1bd5('0x31')],{'filename':_0x1bd5('0x32')+_0x24c92e['toLowerCase']()});if(_[_0x1bd5('0x33')](_0x5e8b61)){_0x21df80['monitors'][_0x1bd5('0x21')]({'filename':_0x1bd5('0x32')+_0x24c92e[_0x1bd5('0x34')](),'createdAt':moment()[_0x1bd5('0x2b')](_0x1bd5('0x35')),'mixmonitorid':_0x4cc9ba[_0x1bd5('0x36')],'status':_0x1bd5('0x37')});}else{_0x5e8b61[_0x1bd5('0x36')]=_0x4cc9ba['mixmonitorid'];_0x5e8b61[_0x1bd5('0x38')]=_0x1bd5('0x37');}_0x596e3c({'code':0xc8,'message':[_0x1f4456['uniqueid'],_0x1bd5('0x39'),_0x4cc9ba[_0x1bd5('0x36')]][_0x1bd5('0x1a')]('\x20'),'mixmonitorid':_0x4cc9ba['mixmonitorid']});})[_0x1bd5('0x1e')](function(_0x53482){_0x49ea1e(_0x1d612b[_0x1bd5('0x18')](0x1f5,[_0x1f4456[_0x1bd5('0x29')],_0x53482['message'][_0x1bd5('0x34')]()][_0x1bd5('0x1a')]('\x20')));});}else{return _0x49ea1e(_0x1d612b[_0x1bd5('0x18')](0x1f5,_0x1bd5('0x3a')));}});},'VoiceChannelStopMixMonitor':function(_0x4de69a){var _0x52cef9=this;return new Promise(function(_0x40eeff,_0x35afc7){if(ami[_0x1bd5('0x19')]()==![]){return _0x35afc7(_0x52cef9['error'](0x1f4,[config[_0x1bd5('0xd')]['ip'],config[_0x1bd5('0xd')]['username'],_0x1bd5('0xf')]['join']('\x20')));}var _0x21aac6=schema(properties[_0x1bd5('0x27')])['validate'](_0x4de69a);if(_0x21aac6[_0x1bd5('0x22')]>0x0){return _0x35afc7(_0x52cef9[_0x1bd5('0x18')](0x1f4,_[_0x1bd5('0x28')](_0x21aac6,_0x1bd5('0x17'))[_0x1bd5('0x1a')](',\x20')));}var _0x25b35a=_[_0x1bd5('0x23')](_0x3bce00[_0x1bd5('0x26')],{'uniqueid':_0x4de69a[_0x1bd5('0x29')]});if(_0x25b35a){return Promise[_0x1bd5('0x3b')]()[_0x1bd5('0x16')](function(){if(_0x25b35a[_0x1bd5('0x2a')]){return ami['Action']({'action':_0x1bd5('0x3c'),'channel':_0x25b35a[_0x1bd5('0x2a')],'mixmonitorid':_0x4de69a[_0x1bd5('0x36')]})['catch'](function(){});}})[_0x1bd5('0x16')](function(){if(_0x25b35a[_0x1bd5('0x3d')]){return ami['Action']({'action':_0x1bd5('0x3c'),'channel':_0x25b35a['destinationchannel'],'mixmonitorid':_0x4de69a[_0x1bd5('0x36')]})['catch'](function(){});}})[_0x1bd5('0x16')](function(){var _0xdd6c1a=_['find'](_0x25b35a[_0x1bd5('0x31')],{'mixmonitorid':_0x4de69a['mixmonitorid']});if(_0xdd6c1a){_0xdd6c1a[_0x1bd5('0x38')]=_0x1bd5('0x3e');}})[_0x1bd5('0x16')](function(){var _0xe71454=util[_0x1bd5('0x2b')](_0x1bd5('0x2c'),_0x4de69a[_0x1bd5('0x2d')]||_0x4de69a[_0x1bd5('0x29')],_0x4de69a['format']||_0x1bd5('0x2e'));var _0x227a68=_[_0x1bd5('0x23')](_0x25b35a[_0x1bd5('0x31')],{'filename':_0x1bd5('0x32')+_0xe71454[_0x1bd5('0x34')]()});if(_0x227a68){_0x227a68['status']=_0x1bd5('0x3e');}})[_0x1bd5('0x16')](function(){_0x40eeff({'code':0xc8,'message':[_0x4de69a[_0x1bd5('0x29')],_0x1bd5('0x3f')][_0x1bd5('0x1a')]('\x20')});})[_0x1bd5('0x1e')](function(_0x1ca2eb){_0x35afc7(_0x52cef9['error'](0x1f5,[_0x4de69a['uniqueid'],_0x1ca2eb[_0x1bd5('0x17')][_0x1bd5('0x34')]()][_0x1bd5('0x1a')]('\x20')));});}else{return _0x35afc7(_0x52cef9['error'](0x1f5,_0x1bd5('0x3a')));}});},'VoiceQueuesChannels':function(_0x1bb55b){var _0x1ad2ff=this;return new Promise(function(_0x1f2d7e){var _0x11813d=_[_0x1bd5('0x25')](_0x3bce00[_0x1bd5('0x40')]);var _0x4db78c={'count':_0x11813d[_0x1bd5('0x22')],'rows':_0x11813d};if(_0x1bb55b&&_0x1bb55b[_0x1bd5('0x41')]){if(!['inbound',_0x1bd5('0x42')]['includes'](_0x1bb55b[_0x1bd5('0x41')])){return _0x29abea(_0x1ad2ff['error'](0x190,_0x1bd5('0x43')));}var _0x555ba1=_['filter'](_0x11813d,function(_0x25308f){return _0x25308f[_0x1bd5('0x41')]===_0x1bb55b[_0x1bd5('0x41')];});_0x4db78c[_0x1bd5('0x44')]=_0x555ba1[_0x1bd5('0x22')];_0x4db78c[_0x1bd5('0x45')]=_0x555ba1;}_0x1f2d7e(_0x4db78c);});},'VoiceQueuesChannel':function(_0x35c478){var _0x51aebe=this;return new Promise(function(_0x1e0f65,_0x4d1598){var _0x251a2b=schema(properties[_0x1bd5('0x46')])[_0x1bd5('0x2')](_0x35c478);if(_0x251a2b['length']>0x0){return _0x4d1598(_0x51aebe['error'](0x1f4,_[_0x1bd5('0x28')](_0x251a2b,_0x1bd5('0x17'))[_0x1bd5('0x1a')](',\x20')));}var _0x19eb1e=_[_0x1bd5('0x23')](_0x3bce00[_0x1bd5('0x40')],{'uniqueid':_0x35c478[_0x1bd5('0x29')]});if(_0x19eb1e){_0x1e0f65(_0x19eb1e);}else{return _0x4d1598(_0x51aebe[_0x1bd5('0x18')](0x1f5,_0x1bd5('0x3a')));}});},'VoiceQueuesChannelHangup':function(_0x2c3ed0){var _0x560419=this;return new Promise(function(_0xa8980e,_0x5ed20a){if(ami[_0x1bd5('0x19')]()==![]){return _0x5ed20a(_0x560419[_0x1bd5('0x18')](0x1f4,[config[_0x1bd5('0xd')]['ip'],config['asterisk'][_0x1bd5('0xe')],_0x1bd5('0xf')][_0x1bd5('0x1a')]('\x20')));}var _0x55bd29=schema(properties[_0x1bd5('0x47')])[_0x1bd5('0x2')](_0x2c3ed0);if(_0x55bd29[_0x1bd5('0x22')]>0x0){return _0x5ed20a(_0x560419[_0x1bd5('0x18')](0x1f4,_['map'](_0x55bd29,'message')[_0x1bd5('0x1a')](',\x20')));}var _0xec9fac=_[_0x1bd5('0x23')](_0x3bce00['queueChannels'],{'uniqueid':_0x2c3ed0['uniqueid']});if(_0xec9fac&&_0xec9fac[_0x1bd5('0x2a')]){return ami['Action']({'action':_0x1bd5('0x48'),'channel':_0xec9fac[_0x1bd5('0x2a')]})['then'](function(_0x32f646){_0xa8980e({'code':0xc8,'message':[_0x2c3ed0['uniqueid'],_0x32f646[_0x1bd5('0x17')]['toLowerCase']()][_0x1bd5('0x1a')]('\x20')});})[_0x1bd5('0x1e')](function(_0x533a10){_0x5ed20a(_0x560419[_0x1bd5('0x18')](0x1f5,[_0x2c3ed0[_0x1bd5('0x29')],_0x533a10['message']['toLowerCase']()][_0x1bd5('0x1a')]('\x20')));});}else{return _0x5ed20a(_0x560419[_0x1bd5('0x18')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x1a9ad2){var _0x40b508=this;return new Promise(function(_0x5da595,_0x551f22){if(ami[_0x1bd5('0x19')]()==![]){return _0x551f22(_0x40b508[_0x1bd5('0x18')](0x1f4,[config[_0x1bd5('0xd')]['ip'],config['asterisk'][_0x1bd5('0xe')],_0x1bd5('0xf')]['join']('\x20')));}var _0x4b317d=schema(properties[_0x1bd5('0x49')])[_0x1bd5('0x2')](_0x1a9ad2);if(_0x4b317d[_0x1bd5('0x22')]>0x0){return _0x551f22(_0x40b508[_0x1bd5('0x18')](0x1f4,_[_0x1bd5('0x28')](_0x4b317d,'message')[_0x1bd5('0x1a')](',\x20')));}var _0x509671=_[_0x1bd5('0x23')](_0x3bce00[_0x1bd5('0x40')],{'uniqueid':_0x1a9ad2[_0x1bd5('0x29')]});if(_0x509671&&_0x509671[_0x1bd5('0x2a')]){return ami['Action']({'action':'Redirect','channel':_0x509671[_0x1bd5('0x2a')],'exten':_0x1a9ad2[_0x1bd5('0x4a')],'context':_0x1a9ad2[_0x1bd5('0x4b')]||_0x509671[_0x1bd5('0x4b')],'priority':0x1})[_0x1bd5('0x16')](function(_0x484fbf){_0x5da595({'code':0xc8,'message':[_0x1a9ad2[_0x1bd5('0x29')],_0x484fbf[_0x1bd5('0x17')][_0x1bd5('0x34')]()][_0x1bd5('0x1a')]('\x20')});})[_0x1bd5('0x1e')](function(_0x32d2b9){_0x551f22(_0x40b508[_0x1bd5('0x18')](0x1f5,[_0x1a9ad2[_0x1bd5('0x29')],_0x32d2b9[_0x1bd5('0x17')][_0x1bd5('0x34')]()][_0x1bd5('0x1a')]('\x20')));});}else{return _0x551f22(_0x40b508[_0x1bd5('0x18')](0x1f5,_0x1bd5('0x3a')));}});},'Agents':function(_0x1ffbab){return new Promise(function(_0x1f536d){var _0x4ba749=_[_0x1bd5('0x25')](_0x3bce00[_0x1bd5('0x9')]);if(_0x1ffbab&&_0x1ffbab['id']){var _0x56e99c=_[_0x1bd5('0x23')](_0x4ba749,function(_0x1d6223){return _0x1d6223['id']===_0x1ffbab['id'];});_0x1f536d(_0x56e99c);}else{_0x1f536d({'count':_0x4ba749[_0x1bd5('0x22')],'rows':_0x4ba749});}});},'Telephones':function(){return new Promise(function(_0xda1c4){var _0x86d88=_[_0x1bd5('0x25')](_0x3bce00[_0x1bd5('0x4c')]);_0xda1c4({'count':_0x86d88['length'],'rows':_0x86d88});});},'Trunks':function(){return new Promise(function(_0x3308eb){var _0x38e235=_[_0x1bd5('0x25')](_0x3bce00[_0x1bd5('0x4d')]);_0x3308eb({'count':_0x38e235['length'],'rows':_0x38e235});});},'OutboundChannels':function(){return new Promise(function(_0x2ed59d){var _0x31effa=_[_0x1bd5('0x25')](_0x3bce00[_0x1bd5('0x4e')]);_0x2ed59d({'count':_0x31effa[_0x1bd5('0x22')],'rows':_0x31effa});});},'Outbound':function(){return new Promise(function(_0x28fdd9){_0x28fdd9(_0x3bce00[_0x1bd5('0x42')]);});},'Campaigns':function(){return new Promise(function(_0x4cc7a5){var _0x42a3ea=_['values'](_0x3bce00['campaigns']);_0x4cc7a5({'count':_0x42a3ea[_0x1bd5('0x22')],'rows':_0x42a3ea});});},'VoiceQueuesPreview':function(_0x596db9){var _0x1ede81=this;return new Promise(function(_0x1a4ee6,_0x560f20){_0x362b24[_0x1bd5('0x4f')](_0x596db9['id'])[_0x1bd5('0x16')](function(_0xe5a36d){_0x1a4ee6({'code':0xc8,'message':_0xe5a36d[_0x1bd5('0x17')]});})[_0x1bd5('0x1e')](function(_0x2ab643){_0x560f20(_0x1ede81['error'](0x1f4,_0x2ab643[_0x1bd5('0x17')]));});});},'EventManager':function(_0x2ce284){var _0xdd5183=this;return new Promise(function(_0x1c9cec,_0x4e6258){if(!_0x2ce284['event']){return _0x4e6258(_0xdd5183[_0x1bd5('0x18')](0x1f4,_0x1bd5('0x50')));}ami[_0x1bd5('0x51')](_0x1bd5('0x52')+_0x2ce284['event'],_0x2ce284[_0x1bd5('0x17')]);_0x1c9cec({'code':0xc8,'message':_0x2ce284});});},'FaxAccounts':function(){return new Promise(function(_0x500007){var _0x5e64c0=_[_0x1bd5('0x25')](_0x3bce00['faxAccounts']);_0x500007({'count':_0x5e64c0[_0x1bd5('0x22')],'rows':_0x5e64c0});});},'SendFax':function(_0xefa91b){var _0x231556=this;return new Promise(function(_0x2a474a,_0xaa3282){_0x43e6b6[_0x1bd5('0x53')](_0xefa91b)[_0x1bd5('0x16')](function(_0x2b964b){_0x2a474a({'code':0xc8,'message':_0x2b964b[_0x1bd5('0x17')]});})['catch'](function(_0x2bc9c6){_0xaa3282(_0x231556['error'](0x1f4,_0x2bc9c6['message']));});});},'CheckAfterSend':function(_0x59b491){var _0x440fed=this;return new Promise(function(_0x524b86,_0x1a98f6){_0x43e6b6[_0x1bd5('0x54')](_0x59b491)[_0x1bd5('0x16')](function(_0x4a3f74){_0x524b86({'code':0xc8,'message':_0x4a3f74[_0x1bd5('0x17')]});})[_0x1bd5('0x1e')](function(_0x3410f8){_0x1a98f6(_0x440fed['error'](0x1f4,_0x3410f8[_0x1bd5('0x17')]));});});}};var _0x586dcc=jayson[_0x1bd5('0x55')](_0x30a385)[_0x1bd5('0x56')]();_0x586dcc['on'](_0x1bd5('0x18'),function(_0x50f2ac){return _0x29abea(_0x50f2ac);});_0x586dcc['listen'](0x232a,_0x1bd5('0x57'),function(){console['log'](_0x1bd5('0x58'),0x232a);return _0x59ddfb('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0x0e85=['MixMonitor\x20Success','voicechannel','resolve','StopMixMonitor','destinationchannel','status','stop','%s.%s','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','type','inbound','outbound','includes','filter','count','voicequeuechannel','queueChannels','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','emit','custom:','faxAccounts','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','validate','moment','../model/voiceQueueSummary','format','%s/%s','name','timers','timer','updateAcw','agents','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','keys','reload','module','action','Reload','Action','message','catch','pick','command','Command','content','voiceQueues','push','length','omit','undefined','values','channels','join','map','find','uniqueid','filename','wav','MixMonitor','channel','ai(mixmonitorid)','then','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x0e85,0x7c));var _0x50e8=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x0e85[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var jayson=require('jayson/promise');var schema=require(_0x50e8('0x2'));var moment=require(_0x50e8('0x3'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require('../ami');var VoiceQueueSummary=require(_0x50e8('0x4'));exports['listen']=function(_0x3048e3,_0x2401b2,_0xe3151e){return new Promise(function(_0xfde42,_0x5e8b01){var _0x3ce904={'QueuePause':function(_0x108edc){return new Promise(function(_0x42665e){var _0x988da0=util[_0x50e8('0x5')](_0x50e8('0x6'),'SIP',_0x108edc[_0x50e8('0x7')]);if(_0x3048e3[_0x50e8('0x8')]&&_0x3048e3[_0x50e8('0x8')][_0x988da0]&&_0x3048e3[_0x50e8('0x8')][_0x988da0][_0x50e8('0x9')]){_0x3048e3[_0x50e8('0x8')][_0x988da0][_0x50e8('0xa')]();}if(_0x3048e3[_0x50e8('0xb')][_0x988da0]){_0x3048e3['agents'][_0x988da0]['updateStatusRealtime']({'statePause':_0x108edc[_0x50e8('0xc')]?!![]:![]});}_0x42665e({'code':0xc8,'message':_0x50e8('0xd')});});},'Reload':function(_0x508377){var _0x49e02f=this;return new Promise(function(_0x3cb45c,_0x2abda1){if(ami[_0x50e8('0xe')]()==![]){return _0x2abda1(_0x49e02f[_0x50e8('0xf')](0x1f4,[config['asterisk']['ip'],config[_0x50e8('0x10')][_0x50e8('0x11')],_0x50e8('0x12')]['join']('\x20')));}_0x508377=_['pick'](_0x508377,_[_0x50e8('0x13')](properties[_0x50e8('0x14')][_0x50e8('0x15')]));_0x508377[_0x50e8('0x16')]=_0x50e8('0x17');return ami[_0x50e8('0x18')](_0x508377)['then'](function(_0x5a5ef2){_0x3cb45c({'code':0xc8,'message':_0x5a5ef2[_0x50e8('0x19')]});})[_0x50e8('0x1a')](function(_0x40d060){_0x2abda1(_0x49e02f[_0x50e8('0xf')](0x1f5,_0x40d060[_0x50e8('0x19')]));});});},'Command':function(_0x90c54c){var _0x1a451d=this;return new Promise(function(_0x53e0a1,_0x415596){if(ami['isConnected']()==![]){return _0x415596(_0x1a451d[_0x50e8('0xf')](0x1f4,[config[_0x50e8('0x10')]['ip'],config[_0x50e8('0x10')][_0x50e8('0x11')],_0x50e8('0x12')]['join']('\x20')));}_0x90c54c=_[_0x50e8('0x1b')](_0x90c54c,_0x50e8('0x1c'));_0x90c54c['action']=_0x50e8('0x1d');return ami[_0x50e8('0x18')](_0x90c54c)['then'](function(_0x1ce7fc){_0x53e0a1({'code':0xc8,'message':_0x1ce7fc[_0x50e8('0x1e')]});})['catch'](function(_0x47a3d8){_0x415596(_0x1a451d['error'](0x1f5,_0x47a3d8[_0x50e8('0x19')]));});});},'VoiceQueues':function(){return new Promise(function(_0x160372){var _0x124402=[];for(var _0x371a1f in _0x3048e3[_0x50e8('0x1f')]){if(_0x3048e3[_0x50e8('0x1f')]['hasOwnProperty'](_0x371a1f)){var _0x3a6442=_0x3048e3[_0x50e8('0x1f')][_0x371a1f];var _0x4b3a09=new VoiceQueueSummary(_0x3a6442);_0x124402[_0x50e8('0x20')](_0x4b3a09);}}_0x160372({'count':_0x124402[_0x50e8('0x21')],'rows':_0x124402});});},'UpdateVoiceQueue':function(_0x3a14ca){return new Promise(function(_0x2af330,_0x4fbf41){var _0x1f5a6c=_['find'](_0x3048e3[_0x50e8('0x1f')],{'id':parseInt(_0x3a14ca['id'])});var _0x39c0c6=_[_0x50e8('0x22')](_0x3a14ca,['id']);if(_0x1f5a6c){for(var _0x4f0b88 in _0x39c0c6){if(typeof _0x39c0c6[_0x4f0b88]!==_0x50e8('0x23')&&typeof _0x1f5a6c[_0x4f0b88]!==_0x50e8('0x23')){_0x1f5a6c[_0x4f0b88]=_0x39c0c6[_0x4f0b88];}}_0x2af330(_0x1f5a6c);}else{_0x4fbf41();}});},'VoiceChannels':function(){return new Promise(function(_0x1bed48){var _0x8d68c8=_[_0x50e8('0x24')](_0x3048e3[_0x50e8('0x25')]);_0x1bed48({'count':_0x8d68c8[_0x50e8('0x21')],'rows':_0x8d68c8});});},'VoiceChannelMixMonitor':function(_0x54d81d){var _0x290fd2=this;return new Promise(function(_0x123be9,_0x535c24){if(ami['isConnected']()==![]){return _0x535c24(_0x290fd2[_0x50e8('0xf')](0x1f4,[config[_0x50e8('0x10')]['ip'],config[_0x50e8('0x10')]['username'],'ami\x20disconnected'][_0x50e8('0x26')]('\x20')));}var _0x19e3cc=schema(properties['voicechannel'])[_0x50e8('0x2')](_0x54d81d);if(_0x19e3cc[_0x50e8('0x21')]>0x0){return _0x535c24(_0x290fd2[_0x50e8('0xf')](0x1f4,_[_0x50e8('0x27')](_0x19e3cc,'message')[_0x50e8('0x26')](',\x20')));}var _0x4ec6ad=_[_0x50e8('0x28')](_0x3048e3[_0x50e8('0x25')],{'uniqueid':_0x54d81d[_0x50e8('0x29')]});if(_0x4ec6ad&&_0x4ec6ad['channel']){var _0x306816=util[_0x50e8('0x5')]('%s.%s',_0x54d81d[_0x50e8('0x2a')]||_0x54d81d[_0x50e8('0x29')],_0x54d81d[_0x50e8('0x5')]||_0x50e8('0x2b'));return ami['Action']({'action':_0x50e8('0x2c'),'channel':_0x4ec6ad[_0x50e8('0x2d')],'file':_0x306816,'options':_0x50e8('0x2e')})[_0x50e8('0x2f')](function(_0x5e556c){var _0x3c7778=_[_0x50e8('0x28')](_0x4ec6ad[_0x50e8('0x30')],{'filename':'/var/spool/asterisk/monitor/'+_0x306816['toLowerCase']()});if(_['isNil'](_0x3c7778)){_0x4ec6ad[_0x50e8('0x30')][_0x50e8('0x20')]({'filename':_0x50e8('0x31')+_0x306816[_0x50e8('0x32')](),'createdAt':moment()[_0x50e8('0x5')](_0x50e8('0x33')),'mixmonitorid':_0x5e556c[_0x50e8('0x34')],'status':_0x50e8('0x35')});}else{_0x3c7778[_0x50e8('0x34')]=_0x5e556c[_0x50e8('0x34')];_0x3c7778['status']=_0x50e8('0x35');}_0x123be9({'code':0xc8,'message':[_0x54d81d[_0x50e8('0x29')],_0x50e8('0x36'),_0x5e556c[_0x50e8('0x34')]]['join']('\x20'),'mixmonitorid':_0x5e556c[_0x50e8('0x34')]});})[_0x50e8('0x1a')](function(_0x3fa815){_0x535c24(_0x290fd2[_0x50e8('0xf')](0x1f5,[_0x54d81d[_0x50e8('0x29')],_0x3fa815['message']['toLowerCase']()][_0x50e8('0x26')]('\x20')));});}else{return _0x535c24(_0x290fd2[_0x50e8('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x2ebd77){var _0xbf947f=this;return new Promise(function(_0x3db1ab,_0x3179a0){if(ami[_0x50e8('0xe')]()==![]){return _0x3179a0(_0xbf947f[_0x50e8('0xf')](0x1f4,[config[_0x50e8('0x10')]['ip'],config[_0x50e8('0x10')]['username'],_0x50e8('0x12')][_0x50e8('0x26')]('\x20')));}var _0x3ea251=schema(properties[_0x50e8('0x37')])['validate'](_0x2ebd77);if(_0x3ea251[_0x50e8('0x21')]>0x0){return _0x3179a0(_0xbf947f[_0x50e8('0xf')](0x1f4,_[_0x50e8('0x27')](_0x3ea251,_0x50e8('0x19'))['join'](',\x20')));}var _0x21dfbf=_['find'](_0x3048e3['channels'],{'uniqueid':_0x2ebd77['uniqueid']});if(_0x21dfbf){return Promise[_0x50e8('0x38')]()[_0x50e8('0x2f')](function(){if(_0x21dfbf['channel']){return ami[_0x50e8('0x18')]({'action':_0x50e8('0x39'),'channel':_0x21dfbf[_0x50e8('0x2d')],'mixmonitorid':_0x2ebd77[_0x50e8('0x34')]})[_0x50e8('0x1a')](function(){});}})[_0x50e8('0x2f')](function(){if(_0x21dfbf['destinationchannel']){return ami[_0x50e8('0x18')]({'action':'StopMixMonitor','channel':_0x21dfbf[_0x50e8('0x3a')],'mixmonitorid':_0x2ebd77[_0x50e8('0x34')]})['catch'](function(){});}})[_0x50e8('0x2f')](function(){var _0x56da97=_[_0x50e8('0x28')](_0x21dfbf[_0x50e8('0x30')],{'mixmonitorid':_0x2ebd77[_0x50e8('0x34')]});if(_0x56da97){_0x56da97[_0x50e8('0x3b')]=_0x50e8('0x3c');}})[_0x50e8('0x2f')](function(){var _0x229d60=util[_0x50e8('0x5')](_0x50e8('0x3d'),_0x2ebd77[_0x50e8('0x2a')]||_0x2ebd77[_0x50e8('0x29')],_0x2ebd77['format']||_0x50e8('0x2b'));var _0x275a1b=_['find'](_0x21dfbf[_0x50e8('0x30')],{'filename':'/var/spool/asterisk/monitor/'+_0x229d60[_0x50e8('0x32')]()});if(_0x275a1b){_0x275a1b['status']=_0x50e8('0x3c');}})[_0x50e8('0x2f')](function(){_0x3db1ab({'code':0xc8,'message':[_0x2ebd77[_0x50e8('0x29')],_0x50e8('0x3e')][_0x50e8('0x26')]('\x20')});})[_0x50e8('0x1a')](function(_0x2ee1a8){_0x3179a0(_0xbf947f['error'](0x1f5,[_0x2ebd77[_0x50e8('0x29')],_0x2ee1a8[_0x50e8('0x19')][_0x50e8('0x32')]()][_0x50e8('0x26')]('\x20')));});}else{return _0x3179a0(_0xbf947f[_0x50e8('0xf')](0x1f5,_0x50e8('0x3f')));}});},'VoiceQueuesChannels':function(_0x51746b){var _0x5122a2=this;return new Promise(function(_0x250b28){var _0xff2e24=_[_0x50e8('0x24')](_0x3048e3['queueChannels']);var _0xaa1302={'count':_0xff2e24[_0x50e8('0x21')],'rows':_0xff2e24};if(_0x51746b&&_0x51746b[_0x50e8('0x40')]){if(![_0x50e8('0x41'),_0x50e8('0x42')][_0x50e8('0x43')](_0x51746b[_0x50e8('0x40')])){return _0x5e8b01(_0x5122a2['error'](0x190,'Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound'));}var _0x55083e=_[_0x50e8('0x44')](_0xff2e24,function(_0x1400e7){return _0x1400e7[_0x50e8('0x40')]===_0x51746b[_0x50e8('0x40')];});_0xaa1302[_0x50e8('0x45')]=_0x55083e[_0x50e8('0x21')];_0xaa1302['rows']=_0x55083e;}_0x250b28(_0xaa1302);});},'VoiceQueuesChannel':function(_0x2f2154){var _0x3706b6=this;return new Promise(function(_0x460c8e,_0x443b4c){var _0x4a3281=schema(properties[_0x50e8('0x46')])[_0x50e8('0x2')](_0x2f2154);if(_0x4a3281[_0x50e8('0x21')]>0x0){return _0x443b4c(_0x3706b6[_0x50e8('0xf')](0x1f4,_[_0x50e8('0x27')](_0x4a3281,_0x50e8('0x19'))['join'](',\x20')));}var _0x234f94=_['find'](_0x3048e3['queueChannels'],{'uniqueid':_0x2f2154['uniqueid']});if(_0x234f94){_0x460c8e(_0x234f94);}else{return _0x443b4c(_0x3706b6[_0x50e8('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x7974b5){var _0x2d4759=this;return new Promise(function(_0x339f53,_0x2dd17e){if(ami[_0x50e8('0xe')]()==![]){return _0x2dd17e(_0x2d4759[_0x50e8('0xf')](0x1f4,[config[_0x50e8('0x10')]['ip'],config['asterisk'][_0x50e8('0x11')],_0x50e8('0x12')][_0x50e8('0x26')]('\x20')));}var _0x560ea7=schema(properties['voicequeuechannelhangup'])['validate'](_0x7974b5);if(_0x560ea7[_0x50e8('0x21')]>0x0){return _0x2dd17e(_0x2d4759[_0x50e8('0xf')](0x1f4,_[_0x50e8('0x27')](_0x560ea7,_0x50e8('0x19'))[_0x50e8('0x26')](',\x20')));}var _0x102181=_['find'](_0x3048e3[_0x50e8('0x47')],{'uniqueid':_0x7974b5['uniqueid']});if(_0x102181&&_0x102181[_0x50e8('0x2d')]){return ami[_0x50e8('0x18')]({'action':'Hangup','channel':_0x102181['channel']})['then'](function(_0x2eed72){_0x339f53({'code':0xc8,'message':[_0x7974b5[_0x50e8('0x29')],_0x2eed72['message'][_0x50e8('0x32')]()][_0x50e8('0x26')]('\x20')});})[_0x50e8('0x1a')](function(_0x3bbd6f){_0x2dd17e(_0x2d4759[_0x50e8('0xf')](0x1f5,[_0x7974b5['uniqueid'],_0x3bbd6f[_0x50e8('0x19')][_0x50e8('0x32')]()][_0x50e8('0x26')]('\x20')));});}else{return _0x2dd17e(_0x2d4759['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x238fdc){var _0x44e9a2=this;return new Promise(function(_0xd21879,_0x323c5a){if(ami[_0x50e8('0xe')]()==![]){return _0x323c5a(_0x44e9a2[_0x50e8('0xf')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x50e8('0x11')],'ami\x20disconnected'][_0x50e8('0x26')]('\x20')));}var _0x36a288=schema(properties['voicequeuechannelredirect'])[_0x50e8('0x2')](_0x238fdc);if(_0x36a288['length']>0x0){return _0x323c5a(_0x44e9a2['error'](0x1f4,_['map'](_0x36a288,_0x50e8('0x19'))[_0x50e8('0x26')](',\x20')));}var _0x12c037=_[_0x50e8('0x28')](_0x3048e3['queueChannels'],{'uniqueid':_0x238fdc['uniqueid']});if(_0x12c037&&_0x12c037[_0x50e8('0x2d')]){return ami[_0x50e8('0x18')]({'action':_0x50e8('0x48'),'channel':_0x12c037[_0x50e8('0x2d')],'exten':_0x238fdc[_0x50e8('0x49')],'context':_0x238fdc[_0x50e8('0x4a')]||_0x12c037[_0x50e8('0x4a')],'priority':0x1})[_0x50e8('0x2f')](function(_0x2635f0){_0xd21879({'code':0xc8,'message':[_0x238fdc[_0x50e8('0x29')],_0x2635f0[_0x50e8('0x19')][_0x50e8('0x32')]()][_0x50e8('0x26')]('\x20')});})[_0x50e8('0x1a')](function(_0x310091){_0x323c5a(_0x44e9a2[_0x50e8('0xf')](0x1f5,[_0x238fdc[_0x50e8('0x29')],_0x310091[_0x50e8('0x19')]['toLowerCase']()][_0x50e8('0x26')]('\x20')));});}else{return _0x323c5a(_0x44e9a2[_0x50e8('0xf')](0x1f5,_0x50e8('0x3f')));}});},'Agents':function(_0x2359c2){return new Promise(function(_0x5b7f4a){var _0x2e6992=_[_0x50e8('0x24')](_0x3048e3[_0x50e8('0xb')]);if(_0x2359c2&&_0x2359c2['id']){var _0x161a07=_[_0x50e8('0x28')](_0x2e6992,function(_0x9319f0){return _0x9319f0['id']===_0x2359c2['id'];});_0x5b7f4a(_0x161a07);}else{_0x5b7f4a({'count':_0x2e6992['length'],'rows':_0x2e6992});}});},'Telephones':function(){return new Promise(function(_0x2f5884){var _0x1b5987=_[_0x50e8('0x24')](_0x3048e3[_0x50e8('0x4b')]);_0x2f5884({'count':_0x1b5987['length'],'rows':_0x1b5987});});},'Trunks':function(){return new Promise(function(_0x279e00){var _0x53b139=_[_0x50e8('0x24')](_0x3048e3[_0x50e8('0x4c')]);_0x279e00({'count':_0x53b139[_0x50e8('0x21')],'rows':_0x53b139});});},'OutboundChannels':function(){return new Promise(function(_0x1637b2){var _0x3b1aea=_['values'](_0x3048e3[_0x50e8('0x4d')]);_0x1637b2({'count':_0x3b1aea[_0x50e8('0x21')],'rows':_0x3b1aea});});},'Outbound':function(){return new Promise(function(_0x1ac61b){_0x1ac61b(_0x3048e3[_0x50e8('0x42')]);});},'Campaigns':function(){return new Promise(function(_0x3a3820){var _0x1dc51d=_['values'](_0x3048e3[_0x50e8('0x4e')]);_0x3a3820({'count':_0x1dc51d[_0x50e8('0x21')],'rows':_0x1dc51d});});},'VoiceQueuesPreview':function(_0x4fc73d){var _0x2d35ab=this;return new Promise(function(_0x2fc1b6,_0x4f72e7){_0x2401b2[_0x50e8('0x4f')](_0x4fc73d['id'])['then'](function(_0x253b47){_0x2fc1b6({'code':0xc8,'message':_0x253b47[_0x50e8('0x19')]});})['catch'](function(_0x1cc4c3){_0x4f72e7(_0x2d35ab[_0x50e8('0xf')](0x1f4,_0x1cc4c3[_0x50e8('0x19')]));});});},'EventManager':function(_0x10bdad){var _0x5df5e8=this;return new Promise(function(_0xf21b2f,_0x47b14c){if(!_0x10bdad[_0x50e8('0x50')]){return _0x47b14c(_0x5df5e8[_0x50e8('0xf')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x50e8('0x51')](_0x50e8('0x52')+_0x10bdad[_0x50e8('0x50')],_0x10bdad[_0x50e8('0x19')]);_0xf21b2f({'code':0xc8,'message':_0x10bdad});});},'FaxAccounts':function(){return new Promise(function(_0x223355){var _0x3a4db0=_[_0x50e8('0x24')](_0x3048e3[_0x50e8('0x53')]);_0x223355({'count':_0x3a4db0[_0x50e8('0x21')],'rows':_0x3a4db0});});},'SendFax':function(_0x48d16a){var _0x381fdf=this;return new Promise(function(_0x152649,_0x38c8ef){_0xe3151e['send'](_0x48d16a)[_0x50e8('0x2f')](function(_0x1bf6ae){_0x152649({'code':0xc8,'message':_0x1bf6ae[_0x50e8('0x19')]});})['catch'](function(_0x56d8f1){_0x38c8ef(_0x381fdf[_0x50e8('0xf')](0x1f4,_0x56d8f1[_0x50e8('0x19')]));});});},'CheckAfterSend':function(_0x5d922b){var _0xa27033=this;return new Promise(function(_0x4fa56e,_0x1005da){_0xe3151e[_0x50e8('0x54')](_0x5d922b)[_0x50e8('0x2f')](function(_0x157b27){_0x4fa56e({'code':0xc8,'message':_0x157b27['message']});})[_0x50e8('0x1a')](function(_0x4ac008){_0x1005da(_0xa27033[_0x50e8('0xf')](0x1f4,_0x4ac008['message']));});});}};var _0x55d39f=jayson[_0x50e8('0x55')](_0x3ce904)[_0x50e8('0x56')]();_0x55d39f['on']('error',function(_0x18c2af){return _0x5e8b01(_0x18c2af);});_0x55d39f['listen'](0x232a,_0x50e8('0x57'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0xfde42(_0x50e8('0x58')+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 66af7f0..cfe709d 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 _0xf6b4=['createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','[CM][%s][%s]','stringify','emit','exec','data1','data2','data5','xmd-contactid','ListId','data3','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','phone','fax','scheduledAt','updatedAt','union','resolve','then','isEmpty','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','Unknown','destcalleridname',''];(function(_0x298b9b,_0x1778ca){var _0x57c485=function(_0x3d45dc){while(--_0x3d45dc){_0x298b9b['push'](_0x298b9b['shift']());}};_0x57c485(++_0x1778ca);}(_0xf6b4,0x1b6));var _0x4f6b=function(_0x203c05,_0x584521){_0x203c05=_0x203c05-0x0;var _0x43a504=_0xf6b4[_0x203c05];return _0x43a504;};'use strict';var _=require(_0x4f6b('0x0'));var BPromise=require(_0x4f6b('0x1'));var Redis=require(_0x4f6b('0x2'));var util=require(_0x4f6b('0x3'));var config=require(_0x4f6b('0x4'));var logger=require(_0x4f6b('0x5'))(_0x4f6b('0x6'));var cmContactRpc=require(_0x4f6b('0x7'));config[_0x4f6b('0x8')]=_['defaults'](config[_0x4f6b('0x8')],{'host':_0x4f6b('0x9'),'port':0x18eb});var io=require(_0x4f6b('0xa'))(new Redis(config[_0x4f6b('0x8')]));function emit(_0x527e65,_0xaba707,_0x597322,_0x337939,_0x9a1587){logger['info'](_0x4f6b('0xb'),_0x527e65,_0xaba707['id'],_0x597322,_0x337939,JSON[_0x4f6b('0xc')](_0x9a1587));io['to'](_0x597322)[_0x4f6b('0xd')](_0x337939,_0x9a1587);}exports[_0x4f6b('0xe')]=function(_0x183eec,_0x3529f3,_0x59ed6b,_0x5c75df){var _0x324ef1,_0x222935;var _0x8e2c73={};var _0x169d84;var _0x1d39f5=Number(_0x59ed6b[_0x4f6b('0xf')]);var _0x4917f4=_0x59ed6b[_0x4f6b('0x10')]?Boolean(Number(_0x59ed6b['data2'])):![];var _0x20d873;var _0x55b07a=![];if(!_['isNil'](_0x59ed6b[_0x4f6b('0x11')])){if(_0x59ed6b[_0x4f6b('0x11')]=='1')_0x55b07a=!![];}if(!_0x55b07a){if(_0x5c75df[_0x4f6b('0x12')]){_0x8e2c73['id']=_0x5c75df['xmd-contactid'];}}if(!_0x8e2c73['id']){_0x8e2c73[_0x4f6b('0x13')]=_0x1d39f5;_0x20d873=_0x59ed6b['data3']&&_0x59ed6b[_0x4f6b('0x14')]!=='0'?_0x59ed6b['data3']['split'](','):['phone'];_0x8e2c73[_0x4f6b('0x15')]=_[_0x4f6b('0x16')](_0x20d873,function(_0xb19188){var _0x3a7f2a={};_0x3a7f2a[_0xb19188]=_0x5c75df[_0x4f6b('0x17')]?_0x5c75df[_0x4f6b('0x18')]:_0x5c75df[_0x4f6b('0x19')];return _0x3a7f2a;});_0x169d84=_0x5c75df[_0x4f6b('0x17')]?_0x5c75df[_0x4f6b('0x18')]:_0x5c75df[_0x4f6b('0x19')];}var _0x173ed7=['id',_0x4f6b('0x1a'),_0x4f6b('0x1b'),_0x4f6b('0x1c'),'mobile',_0x4f6b('0x1d'),_0x4f6b('0x13'),'createdAt',_0x4f6b('0x1e'),_0x4f6b('0x1f')];var _0x2b1441=_[_0x4f6b('0x20')](_0x173ed7,_0x20d873);BPromise[_0x4f6b('0x21')]()[_0x4f6b('0x22')](cmContactRpc['getContacts']({'attributes':_0x2b1441,'where':_0x8e2c73,'phone':_0x169d84}))[_0x4f6b('0x22')](function(_0x5e99bf){_0x222935=_0x5e99bf;if(!_[_0x4f6b('0x23')](_0x222935)){if(_0x222935[_0x4f6b('0x24')]===0x1){_0x324ef1=_0x222935[0x0];logger[_0x4f6b('0x25')](_0x4f6b('0x26'),_0x5c75df[_0x4f6b('0x27')],_0x3529f3['id'],_0x324ef1['id']);}else{logger[_0x4f6b('0x25')](_0x4f6b('0x28'),_0x5c75df['uniqueid'],_0x3529f3['id'],_[_0x4f6b('0x16')](_0x222935,'id')[_0x4f6b('0x29')](','));}return;}else{logger['info'](_0x4f6b('0x2a'),_0x5c75df[_0x4f6b('0x27')],_0x3529f3['id']);var _0x456294={'ListId':_0x1d39f5};var _0x480d86=_0x59ed6b[_0x4f6b('0x2b')]&&_0x59ed6b[_0x4f6b('0x2b')]!=='0'?_0x59ed6b[_0x4f6b('0x2b')]:_0x4f6b('0x1c');if(_0x4917f4){logger['info'](_0x4f6b('0x2c'),_0x5c75df[_0x4f6b('0x27')],_0x3529f3['id']);_0x456294[_0x480d86]=_[_0x4f6b('0x2d')](_0x5c75df[_0x4f6b('0x17')])?_0x5c75df[_0x4f6b('0x19')]:_0x5c75df[_0x4f6b('0x18')];if(_[_0x4f6b('0x2d')](_0x5c75df[_0x4f6b('0x17')])){_0x456294[_0x4f6b('0x1a')]=_0x5c75df[_0x4f6b('0x2e')]&&_0x5c75df['calleridname']!==''?_0x5c75df[_0x4f6b('0x2e')]:_0x4f6b('0x2f');}else{_0x456294[_0x4f6b('0x1a')]=_0x5c75df[_0x4f6b('0x30')]&&_0x5c75df[_0x4f6b('0x30')]!==_0x4f6b('0x31')?_0x5c75df['destcalleridname']:_0x4f6b('0x2f');}return BPromise[_0x4f6b('0x21')]()[_0x4f6b('0x22')](cmContactRpc[_0x4f6b('0x32')](_0x456294))[_0x4f6b('0x22')](function(_0xfe327f){_0x324ef1=_0xfe327f;_0x222935[_0x4f6b('0x33')](_0xfe327f);if(_0x324ef1){logger[_0x4f6b('0x25')](_0x4f6b('0x34'),_0x5c75df[_0x4f6b('0x27')],_0x3529f3['id'],_0x324ef1['id']);}return;});}else{logger[_0x4f6b('0x25')](_0x4f6b('0x35'),_0x5c75df['uniqueid'],_0x3529f3['id']);_0x456294[_0x480d86]=_[_0x4f6b('0x2d')](_0x5c75df['routeId'])?_0x5c75df['calleridnum']:_0x5c75df[_0x4f6b('0x18')];if(_[_0x4f6b('0x2d')](_0x5c75df['routeId'])){_0x456294['firstName']=_0x5c75df[_0x4f6b('0x2e')]&&_0x5c75df['calleridname']!==_0x4f6b('0x31')?_0x5c75df['calleridname']:_0x4f6b('0x2f');}else{_0x456294['firstName']=_0x5c75df[_0x4f6b('0x30')]&&_0x5c75df[_0x4f6b('0x30')]!==''?_0x5c75df[_0x4f6b('0x30')]:_0x4f6b('0x2f');}_0x324ef1=_0x456294;_0x222935['push'](_0x456294);return;}}})['then'](function(){if(_0x183eec){emit(_0x5c75df[_0x4f6b('0x27')],_0x3529f3,util[_0x4f6b('0x36')](_0x4f6b('0x37'),_0x183eec[_0x4f6b('0x38')]),util[_0x4f6b('0x36')](_0x4f6b('0x39'),_0x59ed6b[_0x4f6b('0x3a')][_0x4f6b('0x3b')]()),{'evt':_[_0x4f6b('0x3c')](_0x5c75df,{'autoCreate':_0x4917f4}),'contact':_0x324ef1===undefined?{}:_0x324ef1,'contacts':_0x222935[_0x4f6b('0x24')]===0x0?undefined:_0x222935});}});}; \ No newline at end of file +var _0x7de8=['resolve','then','getContacts','isEmpty','[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]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','name','format','trigger:%s','action','toLowerCase','length','lodash','bluebird','ioredis','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','xmd-contactid','data3','split','phone','$or','map','routeId','calleridnum','destcalleridnum','firstName','mobile','fax','createdAt','updatedAt'];(function(_0x450bf9,_0x1895de){var _0x268350=function(_0xebafa7){while(--_0xebafa7){_0x450bf9['push'](_0x450bf9['shift']());}};_0x268350(++_0x1895de);}(_0x7de8,0x8b));var _0x87de=function(_0x2777c2,_0x3318b6){_0x2777c2=_0x2777c2-0x0;var _0x109e48=_0x7de8[_0x2777c2];return _0x109e48;};'use strict';var _=require(_0x87de('0x0'));var BPromise=require(_0x87de('0x1'));var Redis=require(_0x87de('0x2'));var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x87de('0x3'))(_0x87de('0x4'));var cmContactRpc=require(_0x87de('0x5'));config[_0x87de('0x6')]=_[_0x87de('0x7')](config['redis'],{'host':_0x87de('0x8'),'port':0x18eb});var io=require(_0x87de('0x9'))(new Redis(config[_0x87de('0x6')]));function emit(_0x531cc8,_0x552135,_0x364c1e,_0x4bbf6a,_0x3eced5){logger[_0x87de('0xa')](_0x87de('0xb'),_0x531cc8,_0x552135['id'],_0x364c1e,_0x4bbf6a,JSON[_0x87de('0xc')](_0x3eced5));io['to'](_0x364c1e)['emit'](_0x4bbf6a,_0x3eced5);}exports[_0x87de('0xd')]=function(_0x39f124,_0x3115b7,_0x59be7a,_0x1cdb77){var _0x49df2d,_0x5b7b48;var _0x39ae4c={};var _0xc2f0f2;var _0x2b5910=Number(_0x59be7a[_0x87de('0xe')]);var _0x3d703f=_0x59be7a[_0x87de('0xf')]?Boolean(Number(_0x59be7a['data2'])):![];var _0x2bf6b;var _0x5e93ff=![];if(!_[_0x87de('0x10')](_0x59be7a[_0x87de('0x11')])){if(_0x59be7a['data5']=='1')_0x5e93ff=!![];}if(!_0x5e93ff){if(_0x1cdb77[_0x87de('0x12')]){_0x39ae4c['id']=_0x1cdb77['xmd-contactid'];}}if(!_0x39ae4c['id']){_0x39ae4c['ListId']=_0x2b5910;_0x2bf6b=_0x59be7a[_0x87de('0x13')]&&_0x59be7a[_0x87de('0x13')]!=='0'?_0x59be7a[_0x87de('0x13')][_0x87de('0x14')](','):[_0x87de('0x15')];_0x39ae4c[_0x87de('0x16')]=_[_0x87de('0x17')](_0x2bf6b,function(_0x1d1169){var _0x4f1041={};_0x4f1041[_0x1d1169]=_0x1cdb77[_0x87de('0x18')]?_0x1cdb77['destcalleridnum']:_0x1cdb77[_0x87de('0x19')];return _0x4f1041;});_0xc2f0f2=_0x1cdb77[_0x87de('0x18')]?_0x1cdb77[_0x87de('0x1a')]:_0x1cdb77[_0x87de('0x19')];}var _0x29e267=['id',_0x87de('0x1b'),'lastName','phone',_0x87de('0x1c'),_0x87de('0x1d'),'ListId',_0x87de('0x1e'),'scheduledAt',_0x87de('0x1f')];var _0x563161=_['union'](_0x29e267,_0x2bf6b);BPromise[_0x87de('0x20')]()[_0x87de('0x21')](cmContactRpc[_0x87de('0x22')]({'attributes':_0x563161,'where':_0x39ae4c,'phone':_0xc2f0f2}))[_0x87de('0x21')](function(_0x533d22){_0x5b7b48=_0x533d22;if(!_[_0x87de('0x23')](_0x5b7b48)){if(_0x5b7b48['length']===0x1){_0x49df2d=_0x5b7b48[0x0];logger[_0x87de('0xa')](_0x87de('0x24'),_0x1cdb77[_0x87de('0x25')],_0x3115b7['id'],_0x49df2d['id']);}else{logger[_0x87de('0xa')](_0x87de('0x26'),_0x1cdb77[_0x87de('0x25')],_0x3115b7['id'],_[_0x87de('0x17')](_0x5b7b48,'id')['join'](','));}return;}else{logger['info'](_0x87de('0x27'),_0x1cdb77['uniqueid'],_0x3115b7['id']);var _0x51194c={'ListId':_0x2b5910};var _0x5386e9=_0x59be7a[_0x87de('0x28')]&&_0x59be7a['data4']!=='0'?_0x59be7a['data4']:_0x87de('0x15');if(_0x3d703f){logger[_0x87de('0xa')](_0x87de('0x29'),_0x1cdb77['uniqueid'],_0x3115b7['id']);_0x51194c[_0x5386e9]=_[_0x87de('0x10')](_0x1cdb77[_0x87de('0x18')])?_0x1cdb77[_0x87de('0x19')]:_0x1cdb77[_0x87de('0x1a')];if(_[_0x87de('0x10')](_0x1cdb77[_0x87de('0x18')])){_0x51194c['firstName']=_0x1cdb77['calleridname']&&_0x1cdb77[_0x87de('0x2a')]!==_0x87de('0x2b')?_0x1cdb77[_0x87de('0x2a')]:_0x87de('0x2c');}else{_0x51194c['firstName']=_0x1cdb77[_0x87de('0x2d')]&&_0x1cdb77['destcalleridname']!==''?_0x1cdb77[_0x87de('0x2d')]:_0x87de('0x2c');}return BPromise[_0x87de('0x20')]()['then'](cmContactRpc[_0x87de('0x2e')](_0x51194c))[_0x87de('0x21')](function(_0x2564fc){_0x49df2d=_0x2564fc;_0x5b7b48[_0x87de('0x2f')](_0x2564fc);if(_0x49df2d){logger[_0x87de('0xa')](_0x87de('0x30'),_0x1cdb77['uniqueid'],_0x3115b7['id'],_0x49df2d['id']);}return;});}else{logger[_0x87de('0xa')](_0x87de('0x31'),_0x1cdb77[_0x87de('0x25')],_0x3115b7['id']);_0x51194c[_0x5386e9]=_[_0x87de('0x10')](_0x1cdb77[_0x87de('0x18')])?_0x1cdb77[_0x87de('0x19')]:_0x1cdb77[_0x87de('0x1a')];if(_[_0x87de('0x10')](_0x1cdb77[_0x87de('0x18')])){_0x51194c['firstName']=_0x1cdb77[_0x87de('0x2a')]&&_0x1cdb77[_0x87de('0x2a')]!==_0x87de('0x2b')?_0x1cdb77[_0x87de('0x2a')]:_0x87de('0x2c');}else{_0x51194c[_0x87de('0x1b')]=_0x1cdb77['destcalleridname']&&_0x1cdb77[_0x87de('0x2d')]!==_0x87de('0x2b')?_0x1cdb77['destcalleridname']:_0x87de('0x2c');}_0x49df2d=_0x51194c;_0x5b7b48[_0x87de('0x2f')](_0x51194c);return;}}})[_0x87de('0x21')](function(){if(_0x39f124){emit(_0x1cdb77[_0x87de('0x25')],_0x3115b7,util['format'](_0x87de('0x32'),_0x39f124[_0x87de('0x33')]),util[_0x87de('0x34')](_0x87de('0x35'),_0x59be7a[_0x87de('0x36')][_0x87de('0x37')]()),{'evt':_['merge'](_0x1cdb77,{'autoCreate':_0x3d703f}),'contact':_0x49df2d===undefined?{}:_0x49df2d,'contacts':_0x5b7b48[_0x87de('0x38')]===0x0?undefined:_0x5b7b48});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 77d2780..07de4d8 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 _0x7d2a=['some','AnyConditions','field','ChatWebsiteId','operator','upperFirst','AccountId','value','interaction','message','event','agent','lastevent','mailSubstatus','substatus','offlineMessage','equals','exports','util','mustache','ioredis','./integration','./cmContact','./script','trigger','../ami','redis','defaults','socket.io-emitter','winapp','triggers','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','zohoAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentreject','custom:queuecallerabandon','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','undefined','motionChannel','voice','checkTriggers','agents','interface','checkTrigger','merge','variables','length','Actions','action','toLowerCase','motionbar','browser','popup','data2','html','render','template\x20not\x20found','url','buildUri','isNil','data3','data4','location','windowWidth','data5','800','windowHeight','data6','600','name','format','data1','jscripty','user:%s','trigger:%s','contactmanager','exec','integration','queue','routeId','script','replace','checkConditions','channel'];(function(_0x2de3a8,_0xba59c6){var _0x597892=function(_0x15fed8){while(--_0x15fed8){_0x2de3a8['push'](_0x2de3a8['shift']());}};_0x597892(++_0xba59c6);}(_0x7d2a,0x171));var _0xa7d2=function(_0x37b2b7,_0x32e421){_0x37b2b7=_0x37b2b7-0x0;var _0x4c3951=_0x7d2a[_0x37b2b7];return _0x4c3951;};'use strict';var util=require(_0xa7d2('0x0'));var _=require('lodash');var url=require('url');var Mustache=require(_0xa7d2('0x1'));var Redis=require(_0xa7d2('0x2'));var urlforward=require('./urlforward');var integration=require(_0xa7d2('0x3'));var cmContact=require(_0xa7d2('0x4'));var script=require(_0xa7d2('0x5'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xa7d2('0x6'));var ami=require(_0xa7d2('0x7'));config[_0xa7d2('0x8')]=_[_0xa7d2('0x9')](config[_0xa7d2('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xa7d2('0xa'))(new Redis(config[_0xa7d2('0x8')]));var operators={'equals':function(_0x20d699,_0x157b87){return _0x20d699==_0x157b87;},'not_equals':function(_0x6c7fc1,_0x5c96bb){return _0x6c7fc1!=_0x5c96bb;}};var barAndWebActions=['popup','url',_0xa7d2('0xb')];function Trigger(_0x22ee8b){this[_0xa7d2('0xc')]=_0x22ee8b[_0xa7d2('0xc')];this['agents']=_0x22ee8b['agents'];this[_0xa7d2('0xd')]=_0x22ee8b[_0xa7d2('0xd')];this[_0xa7d2('0xe')]=_0x22ee8b[_0xa7d2('0xe')];this['voiceExtensions']=_0x22ee8b[_0xa7d2('0xf')];this[_0xa7d2('0x10')]=_0x22ee8b['zendeskAccounts'];this[_0xa7d2('0x11')]=_0x22ee8b['freshdeskAccounts'];this[_0xa7d2('0x12')]=_0x22ee8b[_0xa7d2('0x12')];this[_0xa7d2('0x13')]=_0x22ee8b[_0xa7d2('0x13')];this['zohoAccounts']=_0x22ee8b['zohoAccounts'];this[_0xa7d2('0x14')]=_0x22ee8b[_0xa7d2('0x14')];this[_0xa7d2('0x15')]=_0x22ee8b[_0xa7d2('0x15')];this[_0xa7d2('0x16')]=_0x22ee8b['servicenowAccounts'];this['dynamics365Accounts']=_0x22ee8b[_0xa7d2('0x17')];this[_0xa7d2('0x18')]=_0x22ee8b[_0xa7d2('0x18')];this[_0xa7d2('0x19')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0xa7d2('0x12')],'freshdesk':this[_0xa7d2('0x11')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0xa7d2('0x1a')],'desk':this[_0xa7d2('0x14')],'vtiger':this[_0xa7d2('0x15')],'dynamics365':this['dynamics365Accounts'],'freshsales':this['freshsalesAccounts'],'servicenow':this['servicenowAccounts']};ami['on'](_0xa7d2('0x1b'),this[_0xa7d2('0x1c')][_0xa7d2('0x1d')](this));ami['on']('custom:agentconnect',this['syncCustomEvent']['bind'](this));ami['on'](_0xa7d2('0x1e'),this[_0xa7d2('0x1c')]['bind'](this));ami['on'](_0xa7d2('0x1f'),this['syncCustomEvent'][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x20'),this[_0xa7d2('0x1c')][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x21'),this[_0xa7d2('0x1c')]['bind'](this));ami['on'](_0xa7d2('0x22'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentcongestion',this['syncCustomEvent']['bind'](this));ami['on'](_0xa7d2('0x23'),this[_0xa7d2('0x1c')][_0xa7d2('0x1d')](this));ami['on']('custom:amd',this[_0xa7d2('0x1c')][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x24'),this[_0xa7d2('0x1c')][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x25'),this['syncCustomEvent'][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x26'),this['syncAgentDial'][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x27'),this[_0xa7d2('0x28')][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x29'),this[_0xa7d2('0x28')][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x2a'),this[_0xa7d2('0x1c')]['bind'](this));ami['on'](_0xa7d2('0x2b'),this['syncCustomEvent'][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x2c'),this[_0xa7d2('0x1c')][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x2d'),this['syncCustomEvent'][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x2e'),this[_0xa7d2('0x1c')][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x2f'),this[_0xa7d2('0x1c')][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x30'),this[_0xa7d2('0x1c')][_0xa7d2('0x1d')](this));ami['on']('custom:offlineMessage',this[_0xa7d2('0x1c')][_0xa7d2('0x1d')](this));}Trigger[_0xa7d2('0x31')][_0xa7d2('0x32')]=function(_0x372427,_0x1be86f,_0x3f082f){logger[_0xa7d2('0x33')](_0x372427,_0x1be86f,JSON['stringify'](_0x3f082f));io['to'](_0x372427)[_0xa7d2('0x32')](_0x1be86f,_0x3f082f);};Trigger[_0xa7d2('0x31')]['syncCustomEvent']=function(_0x37d93a){var _0xb680bd=_['clone'](_0x37d93a);if(typeof _0xb680bd['motionChannel']===_0xa7d2('0x34')){_0xb680bd[_0xa7d2('0x35')]=_0xa7d2('0x36');}this[_0xa7d2('0x37')](_0xb680bd);};Trigger['prototype'][_0xa7d2('0x28')]=function(_0x4449d6){if(this[_0xa7d2('0x38')][_0x4449d6[_0xa7d2('0x39')]]){this[_0xa7d2('0x1c')](_0x4449d6);}};Trigger[_0xa7d2('0x31')][_0xa7d2('0x37')]=function(_0xba3527){var _0x233618;for(var _0x2b946f in this[_0xa7d2('0xc')]){if(this[_0xa7d2('0xc')]['hasOwnProperty'](_0x2b946f)){if(this[_0xa7d2('0xc')][_0x2b946f]['status']){_0x233618=this[_0xa7d2('0x3a')](this[_0xa7d2('0xc')][_0x2b946f],_0xba3527);if(_0x233618){_[_0xa7d2('0x3b')](_0xba3527,_0xba3527[_0xa7d2('0x3c')]);for(var _0x19fb45=0x0,_0x5c747a,_0x2579bc,_0x3d321f;_0x19fb450x0){_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 _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','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','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0x43e5ac,_0x5eb4bc){var _0x4435dc=function(_0x488f27){while(--_0x488f27){_0x43e5ac['push'](_0x43e5ac['shift']());}};_0x4435dc(++_0x5eb4bc);}(_0x814b,0x1a2));var _0xb814=function(_0x403115,_0x2d6d03){_0x403115=_0x403115-0x0;var _0x596ef3=_0x814b[_0x403115];return _0x596ef3;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ 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 a772591..c6f01a5 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 _0x88be=['destcalleridnum','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','string','nameField','idField','indexOf','ticketType','incident','getString','Subjects','Descriptions','Fields','phonecall','callDirection','queue','/contacts(','phonecalls','assign','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','trigger:browser:url','stripTrailingSlash','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','md5','ioredis','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','data2','resolve','POST','clientId','username','password','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','email','length','internalemailaddress','isdisabled','info','systemuserid','userId','userEmail','toLowerCase','outbound','calleridnum','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId'];(function(_0x1abf77,_0x529f4c){var _0x27ccf2=function(_0x384a80){while(--_0x384a80){_0x1abf77['push'](_0x1abf77['shift']());}};_0x27ccf2(++_0x529f4c);}(_0x88be,0x9a));var _0xe88b=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x88be[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xe88b('0x0'));var rp=require(_0xe88b('0x1'));var util=require(_0xe88b('0x2'));var intUtil=require('./util');var md5=require(_0xe88b('0x3'));var Redis=require(_0xe88b('0x4'));var logger=require('../../../../config/logger')(_0xe88b('0x5'));var config=require(_0xe88b('0x6'));config[_0xe88b('0x7')]=_['defaults'](config[_0xe88b('0x7')],{'host':_0xe88b('0x8'),'port':0x18eb});var io=require(_0xe88b('0x9'))(new Redis(config['redis']));function getAuthToken(_0x5c641b,_0x23279c,_0x99cde3){if(_0x5c641b[_0xe88b('0xa')]){_0x5c641b[_0xe88b('0xb')]=_0x5c641b[_0xe88b('0xc')][_0xe88b('0xd')];_0x5c641b['tenantId']=_0x5c641b[_0xe88b('0xc')][_0xe88b('0xe')];return Promise[_0xe88b('0xf')](_0x5c641b['CloudProvider']['data5']);}var _0x5a4d8d={'method':_0xe88b('0x10'),'uri':_0x23279c,'form':{'client_id':_0x5c641b[_0xe88b('0x11')],'resource':_0x5c641b[_0xe88b('0xb')],'username':_0x5c641b[_0xe88b('0x12')],'password':_0x5c641b[_0xe88b('0x13')],'grant_type':'password','client_secret':_0x5c641b['clientSecret']},'json':!![]};return rp(_0x5a4d8d)[_0xe88b('0x14')](function(_0x25a08d){return _0x25a08d[_0xe88b('0x15')];})[_0xe88b('0x16')](function(_0x34c0bb){logger[_0xe88b('0x17')]('['+[_0x99cde3[_0xe88b('0x18')]()]+_0xe88b('0x19'));return _0x34c0bb[_0xe88b('0x1a')];});}function getUser(_0x158c81,_0x108f25,_0x51a117,_0x226cdd,_0x1a43d7,_0x448d27){return new Promise(function(_0x1e7a44,_0x5a7d93){return getAuthToken(_0x108f25,_0x226cdd,_0x448d27)[_0xe88b('0x14')](function(_0x9c55ff){var _0x2fa3ad={'method':_0xe88b('0x1b'),'uri':_0x1a43d7+_0xe88b('0x1c'),'headers':{'Authorization':_0xe88b('0x1d')+_0x9c55ff,'OData-Version':_0xe88b('0x1e')},'json':!![]};return rp(_0x2fa3ad);})[_0xe88b('0x14')](function(_0x358d1f){var _0x11688f=_0x358d1f['value'];var _0x237fda=![];var _0x4811ce=null;if(!_[_0xe88b('0x1f')](_0x51a117)){if(intUtil['validateEmail'](_0x51a117[_0xe88b('0x20')])){_0x158c81['userEmail']=_0x51a117['email'];for(_0x4811ce=0x0;_0x4811ce<_0x11688f[_0xe88b('0x21')];_0x4811ce++){if(_0x11688f[_0x4811ce][_0xe88b('0x22')]===_0x51a117[_0xe88b('0x20')]&&!_0x11688f[_0x4811ce][_0xe88b('0x23')]){_0x237fda=!![];logger[_0xe88b('0x24')]('['+[_0x448d27['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x11688f[_0x4811ce][_0xe88b('0x25')]+'!');_0x158c81[_0xe88b('0x26')]=_0x11688f[_0x4811ce][_0xe88b('0x25')];}}}}if(!_0x237fda){logger['info']('['+[_0x448d27[_0xe88b('0x18')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x158c81[_0xe88b('0x27')]=_0x108f25[_0xe88b('0x12')];for(_0x4811ce=0x0;_0x4811ce<_0x11688f[_0xe88b('0x21')];_0x4811ce++){if(_0x11688f[_0x4811ce][_0xe88b('0x22')]===_0x108f25[_0xe88b('0x12')]){_0x158c81[_0xe88b('0x26')]=_0x11688f[_0x4811ce][_0xe88b('0x25')];}}}_0x1e7a44(_0x158c81);})['catch'](function(_0x5c5163){_0x5a7d93(_0x5c5163[_0xe88b('0x1a')]);});});}function createEndUser(_0x35f764,_0x3602f4,_0xcc7b01,_0x328ad2,_0x4e0eb1,_0x41dfb1,_0x4286b0){return new Promise(function(_0x32d602,_0x507ebf){return getAuthToken(_0x3602f4,_0xcc7b01,_0x41dfb1)[_0xe88b('0x14')](function(_0x2fa571){var _0x11491a=_0x41dfb1[_0xe88b('0x28')]()===_0xe88b('0x29')?_0x4e0eb1['destcalleridnum']:_0x4e0eb1[_0xe88b('0x2a')];var _0x265ffd={'method':_0xe88b('0x10'),'uri':_0x328ad2+'contacts','body':{'fullname':_0x11491a,'firstname':_0x11491a,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xe88b('0x2b')+_0x35f764[_0xe88b('0x26')]+')'},'headers':{'Authorization':_0xe88b('0x1d')+_0x2fa571,'OData-Version':_0xe88b('0x1e')},'json':!![],'resolveWithFullResponse':!![]};_0x265ffd[_0xe88b('0x2c')][_0x4286b0]=_0x11491a;return rp(_0x265ffd);})[_0xe88b('0x14')](function(_0x5567fe){var _0x521aaf=_0x5567fe[_0xe88b('0x2d')][_0xe88b('0x2e')];var _0x26fe78=_0x521aaf[_0xe88b('0x2f')](_0x521aaf[_0xe88b('0x30')]('(')+0x1,_0x521aaf['lastIndexOf'](')'));_0x35f764[_0xe88b('0x31')]=_0x26fe78;_0x32d602(_0x35f764);})[_0xe88b('0x16')](function(_0x3444db){_0x507ebf(_0x3444db[_0xe88b('0x1a')]);});});}function getEndUser(_0x26e140,_0x4189e9,_0x2abd53,_0x5c12ef,_0x599f9e,_0x189135,_0x1863ba,_0x4e4c4f){var _0x296a63=_0x189135[_0xe88b('0x28')]()===_0xe88b('0x29')?_0x599f9e[_0xe88b('0x32')]:_0x599f9e['calleridnum'];return getAuthToken(_0x4189e9,_0x2abd53,_0x189135)[_0xe88b('0x14')](function(_0x5e9792){_0x4e4c4f=_0x4e4c4f?_0x4e4c4f:_0xe88b('0x33');var _0x429963={'method':'GET','uri':_0x5c12ef+_0xe88b('0x34')+_0x4e4c4f+_0xe88b('0x35')+_0x4e4c4f+_0xe88b('0x36')+_0x296a63[_0xe88b('0x37')]('+',_0xe88b('0x38'))+'\x27','headers':{'Authorization':_0xe88b('0x1d')+_0x5e9792,'If-None-Match':null,'OData-Version':_0xe88b('0x1e')},'json':!![]};return rp(_0x429963);})['then'](function(_0x23580d){var _0x57e93f=![];if(!_0x23580d)return _0x57e93f;var _0x367dfc=_0x23580d['value'];for(var _0x5d354b=0x0;_0x5d354b<_0x367dfc[_0xe88b('0x21')];_0x5d354b++){if(_0x367dfc[_0x5d354b][_0x4e4c4f]===_0x296a63){_0x57e93f=!![];_0x26e140['enduserId']=_0x367dfc[_0x5d354b][_0xe88b('0x39')];}}return _0x57e93f;})[_0xe88b('0x14')](function(_0x4011a4){if(_0x4011a4)return _0x26e140;if(_0x1863ba===_0xe88b('0x3a')){logger[_0xe88b('0x24')]('['+[_0x189135[_0xe88b('0x18')]()]+_0xe88b('0x3b'));return _0x26e140;}return createEndUser(_0x26e140,_0x4189e9,_0x2abd53,_0x5c12ef,_0x599f9e,_0x189135,_0x4e4c4f)[_0xe88b('0x14')](function(_0x5a694f){logger[_0xe88b('0x24')]('['+[_0x189135[_0xe88b('0x18')]()]+_0xe88b('0x3c'),_0x5a694f['enduserId']);return _0x5a694f;});});}function getCustomFields(_0x32e711,_0x214910,_0xa88546){var _0x495b67={};if(_0x32e711['length']>0x0){_[_0xe88b('0x3d')](_0x32e711,function(_0x3eaf08){if(_['includes']([_0xe88b('0x3e'),'picklist'],_0x3eaf08['type'])&&_0x3eaf08[_0xe88b('0x3f')]&&!_0x3eaf08['customField']){var _0x5bb5d7=_0x3eaf08[_0xe88b('0x40')][_0xe88b('0x28')]();var _0x244260=_0x5bb5d7[_0xe88b('0x2f')](0x0,_0x5bb5d7[_0xe88b('0x41')]('_'));var _0x287c10=_0x5bb5d7[_0xe88b('0x2f')](_0x5bb5d7[_0xe88b('0x41')]('_')+0x1);if(_0x244260===_0xa88546){_0x495b67[_0x287c10]=_0x3eaf08['content'];}}});}return _0x495b67;}function getTicket(_0x163fab,_0x39d850,_0x62e169,_0xd0e634,_0x52a55a,_0x3050d6,_0x463f37){return new Promise(function(_0xd40dc1,_0x4dac32){var _0x2e3dd5;return getAuthToken(_0x39d850,_0x62e169,_0x463f37)[_0xe88b('0x14')](function(_0x16f654){if(_0x3050d6[_0xe88b('0x42')]===_0xe88b('0x43')){_0x2e3dd5={'method':_0xe88b('0x10'),'uri':_0xd0e634+'incidents','body':Object['assign']({},{'title':intUtil[_0xe88b('0x44')](_0x3050d6[_0xe88b('0x45')],_0x52a55a,'\x20'),'description':intUtil[_0xe88b('0x44')](_0x3050d6[_0xe88b('0x46')],_0x52a55a,'\x0a'),'customerid_contact@odata.bind':_0x163fab['enduserId']?'/contacts('+_0x163fab[_0xe88b('0x31')]+')':undefined,'ownerid@odata.bind':_0xe88b('0x2b')+_0x163fab[_0xe88b('0x26')]+')','caseorigincode':'1'},getCustomFields(_0x3050d6[_0xe88b('0x47')],_0x52a55a,_0x3050d6['ticketType'])),'headers':{'Authorization':_0xe88b('0x1d')+_0x16f654,'OData-Version':_0xe88b('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3050d6['ticketType']===_0xe88b('0x48')){var _0x1c71c9=_0x163fab[_0xe88b('0x31')]?[{'partyid_systemuser@odata.bind':_0xe88b('0x2b')+_0x163fab[_0xe88b('0x26')]+')','participationtypemask':_0x163fab[_0xe88b('0x49')]===_0xe88b('0x4a')?0x2:0x1},{'partyid_contact@odata.bind':_0xe88b('0x4b')+_0x163fab[_0xe88b('0x31')]+')','participationtypemask':_0x163fab[_0xe88b('0x49')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xe88b('0x2b')+_0x163fab['userId']+')','participationtypemask':_0x163fab[_0xe88b('0x49')]===_0xe88b('0x4a')?0x2:0x1}];_0x2e3dd5={'method':_0xe88b('0x10'),'uri':_0xd0e634+_0xe88b('0x4c'),'body':Object[_0xe88b('0x4d')]({},{'subject':intUtil[_0xe88b('0x44')](_0x3050d6[_0xe88b('0x45')],_0x52a55a,'\x20'),'phonenumber':String(_0x52a55a[_0xe88b('0x2a')]),'description':intUtil[_0xe88b('0x44')](_0x3050d6[_0xe88b('0x46')],_0x52a55a,'\x0a'),'regardingobjectid_contact@odata.bind':_0x163fab['enduserId']?_0xe88b('0x4b')+_0x163fab[_0xe88b('0x31')]+')':undefined,'ownerid@odata.bind':_0xe88b('0x2b')+_0x163fab['userId']+')','directioncode':_0x163fab[_0xe88b('0x49')]===_0xe88b('0x4a')?![]:!![],'phonecall_activity_parties':_0x1c71c9},getCustomFields(_0x3050d6[_0xe88b('0x47')],_0x52a55a,_0x3050d6[_0xe88b('0x42')])),'headers':{'Authorization':_0xe88b('0x1d')+_0x16f654,'OData-Version':_0xe88b('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2e3dd5);})[_0xe88b('0x14')](function(_0x34c8fc){var _0x46d840=_0x34c8fc[_0xe88b('0x2d')][_0xe88b('0x2e')];var _0x4d276d=_0x46d840[_0xe88b('0x2f')](_0x46d840[_0xe88b('0x30')]('(')+0x1,_0x46d840[_0xe88b('0x30')](')'));_0x163fab[_0xe88b('0x4e')]=_0x4d276d;_0xd40dc1(_0x163fab);})[_0xe88b('0x16')](function(_0x71558a){_0x4dac32(_0x71558a[_0xe88b('0x1a')]);});});}function emit(_0x4ab1ce,_0x1aa5d2,_0x3195d8,_0xf19f6e){var _0x4c2959={'uri':util[_0xe88b('0x4f')](_0xe88b('0x50'),_0x4ab1ce,_0x3195d8,_0xf19f6e)};io['to'](util[_0xe88b('0x4f')]('user:%s',_0x1aa5d2))['emit'](_0xe88b('0x51'),_0x4c2959);}exports['cs']=function(_0x17a256,_0x223a3c,_0x25b159,_0x3d2ba6,_0x252695,_0x2674ce,_0x1816c8,_0x154a9f){var _0x16d57f={};_0x2674ce[_0xe88b('0xb')]=_0x2674ce[_0xe88b('0xa')]?intUtil[_0xe88b('0x52')](_0x2674ce[_0xe88b('0xc')]['data7']):intUtil[_0xe88b('0x52')](_0x2674ce[_0xe88b('0xb')]);_0x2674ce['serverUrl']=intUtil[_0xe88b('0x52')](_0x2674ce['serverUrl']);_0x16d57f[_0xe88b('0x49')]=_0x154a9f==='queue'||_0x154a9f===_0xe88b('0x53')?_0xe88b('0x4a'):_0xe88b('0x29');var _0x31aed2=_0x2674ce[_0xe88b('0xa')]?util[_0xe88b('0x4f')]('%s/api/data/v9.0/',_0x2674ce[_0xe88b('0xc')][_0xe88b('0xd')]):util[_0xe88b('0x4f')]('%s/api/data/v9.0/',_0x2674ce[_0xe88b('0xb')]);var _0x36fa97=util[_0xe88b('0x4f')]('https://login.microsoftonline.com/%s/oauth2/token',_0x2674ce['tenantId']);var _0x55563d=util[_0xe88b('0x4f')](_0xe88b('0x54'),_0x2674ce[_0xe88b('0x55')],_0x223a3c[_0xe88b('0x56')],md5(_0x223a3c[_0xe88b('0x56')]));if(_0x252695&&_0x252695['monitor_format']){logger[_0xe88b('0x24')](_0xe88b('0x57'),_0xe88b('0x58'));_0x223a3c[_0xe88b('0x59')]=_0x55563d;}else if(_0x1816c8&&_0x1816c8['recordingFormat']&&_0x1816c8['recordingFormat']!==_0xe88b('0x5a')){logger['info'](_0xe88b('0x5b'),_0xe88b('0x58'));_0x223a3c[_0xe88b('0x59')]=_0x55563d;}else{_0x223a3c[_0xe88b('0x59')]='';}return getUser(_0x16d57f,_0x2674ce,_0x3d2ba6,_0x36fa97,_0x31aed2,_0x154a9f)['then'](function(_0x7e519){logger[_0xe88b('0x24')]('['+_0x154a9f[_0xe88b('0x18')]()+']\x20The\x20User\x20ID\x20is:',_0x7e519['userId']);logger['info']('['+_0x154a9f[_0xe88b('0x18')]()+']\x20The\x20User\x20email\x20is:',_0x7e519['userEmail']);return getEndUser(_0x7e519,_0x2674ce,_0x36fa97,_0x31aed2,_0x223a3c,_0x154a9f,_0x25b159[_0xe88b('0x5c')],_0x25b159['additionalSearchContact']);})[_0xe88b('0x14')](function(_0x48ced0){logger[_0xe88b('0x24')]('['+_0x154a9f['toUpperCase']()+_0xe88b('0x5d'),_0x48ced0[_0xe88b('0x31')]);logger[_0xe88b('0x24')]('['+_0x154a9f['toUpperCase']()+_0xe88b('0x5e'),_0x223a3c[_0xe88b('0x2a')]);return getTicket(_0x48ced0,_0x2674ce,_0x36fa97,_0x31aed2,_0x223a3c,_0x25b159,_0x154a9f);})[_0xe88b('0x14')](function(_0x5a9762){logger[_0xe88b('0x24')](util[_0xe88b('0x4f')]('['+_0x154a9f[_0xe88b('0x18')]()+_0xe88b('0x5f'),_0x25b159[_0xe88b('0x42')],_0x5a9762['ticketId']));logger[_0xe88b('0x24')](util[_0xe88b('0x4f')]('['+_0x154a9f[_0xe88b('0x18')]()+_0xe88b('0x60'),_0x154a9f));if(_0x154a9f!==_0xe88b('0x53')&&_0x25b159[_0xe88b('0x61')]){logger[_0xe88b('0x24')]('['+_0x154a9f[_0xe88b('0x18')]()+']',_0xe88b('0x62'));emit(_0x2674ce[_0xe88b('0xb')],_0x3d2ba6[_0xe88b('0x63')],_0x25b159[_0xe88b('0x42')],_0x5a9762['ticketId']);}})[_0xe88b('0x16')](function(_0x5753df){logger['error']('['+_0x154a9f[_0xe88b('0x18')]()+_0xe88b('0x64'),_0x5753df[_0xe88b('0x1a')]);console[_0xe88b('0x17')](_0xe88b('0x65'),_0x5753df);});}; \ No newline at end of file +var _0x6c63=['/systemusers(','Bearer\x20','body','headers','odata-entityid','substring','lastIndexOf','enduserId','telephone1','contacts?$select=','&$filter=','replace','%2b','value','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','includes','string','picklist','type','nameField','idField','indexOf','ticketType','incident','POST','Subjects','getString','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','unmanaged','outbound','modernAuthentication','format','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','./util','md5','dynamics365','../../../../config/environment','defaults','redis','localhost','remoteUri','CloudProvider','data7','tenantId','resolve','clientId','username','password','clientSecret','then','access_token','error',']\x20Wrong\x20credentials!','GET','4.0','userEmail','length','internalemailaddress','email','info','toUpperCase','systemuserid','userId','catch','message','destcalleridnum','calleridnum','contacts'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x6c63,0x1d9));var _0x36c6=function(_0x4ed79a,_0xb08afc){_0x4ed79a=_0x4ed79a-0x0;var _0x58dbaf=_0x6c63[_0x4ed79a];return _0x58dbaf;};'use strict';var _=require(_0x36c6('0x0'));var rp=require(_0x36c6('0x1'));var util=require('util');var intUtil=require(_0x36c6('0x2'));var md5=require(_0x36c6('0x3'));var Redis=require('ioredis');var logger=require('../../../../config/logger')(_0x36c6('0x4'));var config=require(_0x36c6('0x5'));config['redis']=_[_0x36c6('0x6')](config[_0x36c6('0x7')],{'host':_0x36c6('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x36c6('0x7')]));function getAuthToken(_0x3ca818,_0x40c813,_0x13fe22){if(_0x3ca818['modernAuthentication']){_0x3ca818[_0x36c6('0x9')]=_0x3ca818[_0x36c6('0xa')][_0x36c6('0xb')];_0x3ca818[_0x36c6('0xc')]=_0x3ca818[_0x36c6('0xa')]['data2'];return Promise[_0x36c6('0xd')](_0x3ca818[_0x36c6('0xa')]['data5']);}var _0x1bc110={'method':'POST','uri':_0x40c813,'form':{'client_id':_0x3ca818[_0x36c6('0xe')],'resource':_0x3ca818[_0x36c6('0x9')],'username':_0x3ca818[_0x36c6('0xf')],'password':_0x3ca818[_0x36c6('0x10')],'grant_type':_0x36c6('0x10'),'client_secret':_0x3ca818[_0x36c6('0x11')]},'json':!![]};return rp(_0x1bc110)[_0x36c6('0x12')](function(_0xe413d0){return _0xe413d0[_0x36c6('0x13')];})['catch'](function(_0x274ff2){logger[_0x36c6('0x14')]('['+[_0x13fe22['toUpperCase']()]+_0x36c6('0x15'));return _0x274ff2['message'];});}function getUser(_0x3436bd,_0x2881b0,_0x396a6b,_0x24b083,_0x488220,_0x4dc9d2){return new Promise(function(_0x48e818,_0x5b5477){return getAuthToken(_0x2881b0,_0x24b083,_0x4dc9d2)[_0x36c6('0x12')](function(_0x33b870){var _0x1c1e1c={'method':_0x36c6('0x16'),'uri':_0x488220+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x33b870,'OData-Version':_0x36c6('0x17')},'json':!![]};return rp(_0x1c1e1c);})[_0x36c6('0x12')](function(_0x3105eb){var _0x424cdf=_0x3105eb['value'];var _0x1ff7f5=![];var _0x1341c5=null;if(!_['isNil'](_0x396a6b)){if(intUtil['validateEmail'](_0x396a6b['email'])){_0x3436bd[_0x36c6('0x18')]=_0x396a6b['email'];for(_0x1341c5=0x0;_0x1341c5<_0x424cdf[_0x36c6('0x19')];_0x1341c5++){if(_0x424cdf[_0x1341c5][_0x36c6('0x1a')]===_0x396a6b[_0x36c6('0x1b')]&&!_0x424cdf[_0x1341c5]['isdisabled']){_0x1ff7f5=!![];logger[_0x36c6('0x1c')]('['+[_0x4dc9d2[_0x36c6('0x1d')]()]+']\x20Agent\x20found\x20'+_0x424cdf[_0x1341c5][_0x36c6('0x1e')]+'!');_0x3436bd[_0x36c6('0x1f')]=_0x424cdf[_0x1341c5][_0x36c6('0x1e')];}}}}if(!_0x1ff7f5){logger['info']('['+[_0x4dc9d2[_0x36c6('0x1d')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x3436bd[_0x36c6('0x18')]=_0x2881b0[_0x36c6('0xf')];for(_0x1341c5=0x0;_0x1341c5<_0x424cdf[_0x36c6('0x19')];_0x1341c5++){if(_0x424cdf[_0x1341c5][_0x36c6('0x1a')]===_0x2881b0[_0x36c6('0xf')]){_0x3436bd[_0x36c6('0x1f')]=_0x424cdf[_0x1341c5][_0x36c6('0x1e')];}}}_0x48e818(_0x3436bd);})[_0x36c6('0x20')](function(_0x24e1d2){_0x5b5477(_0x24e1d2[_0x36c6('0x21')]);});});}function createEndUser(_0x3bc3b7,_0x54961a,_0x13231d,_0x96eea5,_0x53f6d4,_0x29a1b0,_0x30163f){return new Promise(function(_0xcdd971,_0x5aa081){return getAuthToken(_0x54961a,_0x13231d,_0x29a1b0)[_0x36c6('0x12')](function(_0x509974){var _0x392e89=_0x29a1b0['toLowerCase']()==='outbound'?_0x53f6d4[_0x36c6('0x22')]:_0x53f6d4[_0x36c6('0x23')];var _0x1e9d43={'method':'POST','uri':_0x96eea5+_0x36c6('0x24'),'body':{'fullname':_0x392e89,'firstname':_0x392e89,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x36c6('0x25')+_0x3bc3b7[_0x36c6('0x1f')]+')'},'headers':{'Authorization':_0x36c6('0x26')+_0x509974,'OData-Version':_0x36c6('0x17')},'json':!![],'resolveWithFullResponse':!![]};_0x1e9d43[_0x36c6('0x27')][_0x30163f]=_0x392e89;return rp(_0x1e9d43);})[_0x36c6('0x12')](function(_0x1c5a10){var _0x343d69=_0x1c5a10[_0x36c6('0x28')][_0x36c6('0x29')];var _0x1a0464=_0x343d69[_0x36c6('0x2a')](_0x343d69[_0x36c6('0x2b')]('(')+0x1,_0x343d69[_0x36c6('0x2b')](')'));_0x3bc3b7[_0x36c6('0x2c')]=_0x1a0464;_0xcdd971(_0x3bc3b7);})[_0x36c6('0x20')](function(_0x3c7630){_0x5aa081(_0x3c7630[_0x36c6('0x21')]);});});}function getEndUser(_0x37281d,_0x833c58,_0x21d2a2,_0x1e623d,_0x47496c,_0x23ec76,_0x418527,_0x2ced5f){var _0x1c31dd=_0x23ec76['toLowerCase']()==='outbound'?_0x47496c[_0x36c6('0x22')]:_0x47496c[_0x36c6('0x23')];return getAuthToken(_0x833c58,_0x21d2a2,_0x23ec76)[_0x36c6('0x12')](function(_0x9bdc8d){_0x2ced5f=_0x2ced5f?_0x2ced5f:_0x36c6('0x2d');var _0x448af6={'method':_0x36c6('0x16'),'uri':_0x1e623d+_0x36c6('0x2e')+_0x2ced5f+_0x36c6('0x2f')+_0x2ced5f+'\x20eq\x20\x27'+_0x1c31dd[_0x36c6('0x30')]('+',_0x36c6('0x31'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x9bdc8d,'If-None-Match':null,'OData-Version':_0x36c6('0x17')},'json':!![]};return rp(_0x448af6);})[_0x36c6('0x12')](function(_0x323a85){var _0x279508=![];if(!_0x323a85)return _0x279508;var _0x16d015=_0x323a85[_0x36c6('0x32')];for(var _0x44327f=0x0;_0x44327f<_0x16d015[_0x36c6('0x19')];_0x44327f++){if(_0x16d015[_0x44327f][_0x2ced5f]===_0x1c31dd){_0x279508=!![];_0x37281d[_0x36c6('0x2c')]=_0x16d015[_0x44327f][_0x36c6('0x33')];}}return _0x279508;})[_0x36c6('0x12')](function(_0x3b2856){if(_0x3b2856)return _0x37281d;if(_0x418527===_0x36c6('0x34')){logger[_0x36c6('0x1c')]('['+[_0x23ec76[_0x36c6('0x1d')]()]+_0x36c6('0x35'));return _0x37281d;}return createEndUser(_0x37281d,_0x833c58,_0x21d2a2,_0x1e623d,_0x47496c,_0x23ec76,_0x2ced5f)[_0x36c6('0x12')](function(_0x35dcb7){logger[_0x36c6('0x1c')]('['+[_0x23ec76[_0x36c6('0x1d')]()]+']\x20Enduser\x20created!',_0x35dcb7[_0x36c6('0x2c')]);return _0x35dcb7;});});}function getCustomFields(_0x52549a,_0x4ef2d2,_0xb1fa4e){var _0x22cd77={};if(_0x52549a[_0x36c6('0x19')]>0x0){_[_0x36c6('0x36')](_0x52549a,function(_0x55b46e){if(_[_0x36c6('0x37')]([_0x36c6('0x38'),_0x36c6('0x39')],_0x55b46e[_0x36c6('0x3a')])&&_0x55b46e[_0x36c6('0x3b')]&&!_0x55b46e['customField']){var _0xfbf3ae=_0x55b46e[_0x36c6('0x3c')]['toLowerCase']();var _0x54e96d=_0xfbf3ae['substring'](0x0,_0xfbf3ae[_0x36c6('0x3d')]('_'));var _0x5628c5=_0xfbf3ae[_0x36c6('0x2a')](_0xfbf3ae[_0x36c6('0x3d')]('_')+0x1);if(_0x54e96d===_0xb1fa4e){_0x22cd77[_0x5628c5]=_0x55b46e['content'];}}});}return _0x22cd77;}function getTicket(_0x60d870,_0x258caa,_0x1e3174,_0x39fecd,_0x2e9f04,_0x2f337d,_0x17bd60){return new Promise(function(_0x46b663,_0x436e81){var _0x500d68;return getAuthToken(_0x258caa,_0x1e3174,_0x17bd60)[_0x36c6('0x12')](function(_0x208f75){if(_0x2f337d[_0x36c6('0x3e')]===_0x36c6('0x3f')){_0x500d68={'method':_0x36c6('0x40'),'uri':_0x39fecd+'incidents','body':Object['assign']({},{'title':intUtil['getString'](_0x2f337d[_0x36c6('0x41')],_0x2e9f04,'\x20'),'description':intUtil[_0x36c6('0x42')](_0x2f337d[_0x36c6('0x43')],_0x2e9f04,'\x0a'),'customerid_contact@odata.bind':_0x60d870[_0x36c6('0x2c')]?_0x36c6('0x44')+_0x60d870[_0x36c6('0x2c')]+')':undefined,'ownerid@odata.bind':_0x36c6('0x25')+_0x60d870['userId']+')','caseorigincode':'1'},getCustomFields(_0x2f337d[_0x36c6('0x45')],_0x2e9f04,_0x2f337d[_0x36c6('0x3e')])),'headers':{'Authorization':_0x36c6('0x26')+_0x208f75,'OData-Version':_0x36c6('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2f337d[_0x36c6('0x3e')]===_0x36c6('0x46')){var _0x3a7ede=_0x60d870['enduserId']?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x60d870[_0x36c6('0x1f')]+')','participationtypemask':_0x60d870[_0x36c6('0x47')]===_0x36c6('0x48')?0x2:0x1},{'partyid_contact@odata.bind':_0x36c6('0x44')+_0x60d870[_0x36c6('0x2c')]+')','participationtypemask':_0x60d870[_0x36c6('0x47')]===_0x36c6('0x48')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x36c6('0x25')+_0x60d870[_0x36c6('0x1f')]+')','participationtypemask':_0x60d870[_0x36c6('0x47')]===_0x36c6('0x48')?0x2:0x1}];_0x500d68={'method':_0x36c6('0x40'),'uri':_0x39fecd+_0x36c6('0x49'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x2f337d['Subjects'],_0x2e9f04,'\x20'),'phonenumber':String(_0x2e9f04[_0x36c6('0x23')]),'description':intUtil[_0x36c6('0x42')](_0x2f337d[_0x36c6('0x43')],_0x2e9f04,'\x0a'),'regardingobjectid_contact@odata.bind':_0x60d870[_0x36c6('0x2c')]?_0x36c6('0x44')+_0x60d870[_0x36c6('0x2c')]+')':undefined,'ownerid@odata.bind':_0x36c6('0x25')+_0x60d870[_0x36c6('0x1f')]+')','directioncode':_0x60d870[_0x36c6('0x47')]===_0x36c6('0x48')?![]:!![],'phonecall_activity_parties':_0x3a7ede},getCustomFields(_0x2f337d['Fields'],_0x2e9f04,_0x2f337d[_0x36c6('0x3e')])),'headers':{'Authorization':_0x36c6('0x26')+_0x208f75,'OData-Version':_0x36c6('0x17')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x500d68);})[_0x36c6('0x12')](function(_0x3d00af){var _0x10dda0=_0x3d00af['headers']['odata-entityid'];var _0xc1d51b=_0x10dda0[_0x36c6('0x2a')](_0x10dda0[_0x36c6('0x2b')]('(')+0x1,_0x10dda0[_0x36c6('0x2b')](')'));_0x60d870['ticketId']=_0xc1d51b;_0x46b663(_0x60d870);})['catch'](function(_0x4dda83){_0x436e81(_0x4dda83[_0x36c6('0x21')]);});});}function emit(_0x2391ee,_0x4b46fa,_0x2ecd7d,_0x4cb6fb){var _0x4a2e71={'uri':util['format'](_0x36c6('0x4a'),_0x2391ee,_0x2ecd7d,_0x4cb6fb)};io['to'](util['format'](_0x36c6('0x4b'),_0x4b46fa))[_0x36c6('0x4c')](_0x36c6('0x4d'),_0x4a2e71);}exports['cs']=function(_0x3a86b9,_0x22ab35,_0x9ed7c8,_0x1dd4b1,_0x412977,_0x525154,_0x3baea7,_0x3df243){var _0x4b591c={};_0x525154[_0x36c6('0x9')]=_0x525154['modernAuthentication']?intUtil[_0x36c6('0x4e')](_0x525154[_0x36c6('0xa')][_0x36c6('0xb')]):intUtil[_0x36c6('0x4e')](_0x525154[_0x36c6('0x9')]);_0x525154['serverUrl']=intUtil[_0x36c6('0x4e')](_0x525154['serverUrl']);_0x4b591c[_0x36c6('0x47')]=_0x3df243===_0x36c6('0x48')||_0x3df243===_0x36c6('0x4f')?_0x36c6('0x48'):_0x36c6('0x50');var _0x3a4165=_0x525154[_0x36c6('0x51')]?util[_0x36c6('0x52')](_0x36c6('0x53'),_0x525154[_0x36c6('0xa')]['data7']):util['format'](_0x36c6('0x53'),_0x525154[_0x36c6('0x9')]);var _0x160ce7=util[_0x36c6('0x52')](_0x36c6('0x54'),_0x525154[_0x36c6('0xc')]);var _0x4a02f8=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x525154['serverUrl'],_0x22ab35['uniqueid'],md5(_0x22ab35[_0x36c6('0x55')]));if(_0x412977&&_0x412977[_0x36c6('0x56')]){logger[_0x36c6('0x1c')](_0x36c6('0x57'),_0x36c6('0x58'));_0x22ab35[_0x36c6('0x59')]=_0x4a02f8;}else if(_0x3baea7&&_0x3baea7['recordingFormat']&&_0x3baea7['recordingFormat']!==_0x36c6('0x5a')){logger[_0x36c6('0x1c')](_0x36c6('0x5b'),_0x36c6('0x58'));_0x22ab35['recordingURL']=_0x4a02f8;}else{_0x22ab35[_0x36c6('0x59')]='';}return getUser(_0x4b591c,_0x525154,_0x1dd4b1,_0x160ce7,_0x3a4165,_0x3df243)[_0x36c6('0x12')](function(_0x2a31d3){logger['info']('['+_0x3df243[_0x36c6('0x1d')]()+_0x36c6('0x5c'),_0x2a31d3[_0x36c6('0x1f')]);logger[_0x36c6('0x1c')]('['+_0x3df243['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x2a31d3[_0x36c6('0x18')]);return getEndUser(_0x2a31d3,_0x525154,_0x160ce7,_0x3a4165,_0x22ab35,_0x3df243,_0x9ed7c8[_0x36c6('0x5d')],_0x9ed7c8[_0x36c6('0x5e')]);})[_0x36c6('0x12')](function(_0x9c05b0){logger[_0x36c6('0x1c')]('['+_0x3df243[_0x36c6('0x1d')]()+_0x36c6('0x5f'),_0x9c05b0[_0x36c6('0x2c')]);logger[_0x36c6('0x1c')]('['+_0x3df243[_0x36c6('0x1d')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x22ab35[_0x36c6('0x23')]);return getTicket(_0x9c05b0,_0x525154,_0x160ce7,_0x3a4165,_0x22ab35,_0x9ed7c8,_0x3df243);})[_0x36c6('0x12')](function(_0x382492){logger[_0x36c6('0x1c')](util[_0x36c6('0x52')]('['+_0x3df243['toUpperCase']()+_0x36c6('0x60'),_0x9ed7c8[_0x36c6('0x3e')],_0x382492[_0x36c6('0x61')]));logger[_0x36c6('0x1c')](util['format']('['+_0x3df243[_0x36c6('0x1d')]()+_0x36c6('0x62'),_0x3df243));if(_0x3df243!==_0x36c6('0x4f')&&_0x9ed7c8['openNewTab']){logger[_0x36c6('0x1c')]('['+_0x3df243[_0x36c6('0x1d')]()+']',_0x36c6('0x63'));emit(_0x525154[_0x36c6('0x9')],_0x1dd4b1['name'],_0x9ed7c8[_0x36c6('0x3e')],_0x382492[_0x36c6('0x61')]);}})[_0x36c6('0x20')](function(_0x3ecde3){logger[_0x36c6('0x14')]('['+_0x3df243[_0x36c6('0x1d')]()+_0x36c6('0x64'),_0x3ecde3[_0x36c6('0x21')]);console[_0x36c6('0x14')](_0x36c6('0x65'),_0x3ecde3);});}; \ 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 7d7bc4d..483f175 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 _0xf353=['%s/helpdesk/tickets/%d','unmanaged','toUpperCase','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','socket.io-emitter','application/json','emit','info','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','validateEmail','%s/api/v2/agents','length','Agent\x20found!','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','idField','customField','push','content','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xf353,0xc5));var _0x3f35=function(_0x3b0196,_0x3e39a1){_0x3b0196=_0x3b0196-0x0;var _0x663b5a=_0xf353[_0x3b0196];return _0x663b5a;};'use strict';var _=require(_0x3f35('0x0'));var rp=require(_0x3f35('0x1'));var md5=require(_0x3f35('0x2'));var util=require('util');var Redis=require(_0x3f35('0x3'));var intUtil=require(_0x3f35('0x4'));var config=require(_0x3f35('0x5'));var logger=require(_0x3f35('0x6'))('freshdesk');config['redis']=_[_0x3f35('0x7')](config[_0x3f35('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x3f35('0x9'))(new Redis(config[_0x3f35('0x8')]));var headers={'Content-Type':'application/json','Accept':_0x3f35('0xa')};function emit(_0x53f957,_0x4d5898,_0x4c599f){io['to'](_0x53f957)[_0x3f35('0xb')](_0x4d5898,_0x4c599f);}function getTicket(_0x175a0d,_0x2ccadf,_0x2aabaa,_0x9ac484,_0x4f8d95){logger[_0x3f35('0xc')]('Creating\x20new\x20ticket...');var _0x4fbea4=_[_0x3f35('0xd')]({'responder_id':_0x2ccadf['id'],'requester_id':_0x2aabaa['id'],'name':util[_0x3f35('0xe')](_0x3f35('0xf'),_0x4f8d95[_0x3f35('0x10')]),'phone':_0x4f8d95[_0x3f35('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x3f35('0x12')](_0x9ac484['Subjects'],_0x4f8d95,'\x20'),'description':intUtil[_0x3f35('0x12')](_0x9ac484[_0x3f35('0x13')],_0x4f8d95,_0x3f35('0x14')),'tags':getTags(_0x9ac484[_0x3f35('0x15')],_0x3f35('0x16'))},getCustomFields(_0x9ac484[_0x3f35('0x17')],_0x4f8d95));_0x4fbea4[_0x3f35('0x18')]=_[_0x3f35('0x19')](_[_0x3f35('0x1a')](_0x4fbea4[_0x3f35('0x18')],'id'),_0x3f35('0x1b'));return request({'uri':util[_0x3f35('0xe')](_0x3f35('0x1c'),_0x175a0d[_0x3f35('0x1d')]),'method':_0x3f35('0x1e'),'body':_0x4fbea4})[_0x3f35('0x1f')](function(_0x20b9ee){logger['info']('Ticket\x20created!');return _0x20b9ee;});}function getUser(_0x3397cb,_0x2cb35a){if(intUtil[_0x3f35('0x20')](_0x2cb35a)){return request({'uri':util[_0x3f35('0xe')](_0x3f35('0x21'),_0x3397cb[_0x3f35('0x1d')]),'qs':{'email':_0x2cb35a}})['then'](function(_0x520e33){if(_0x520e33[_0x3f35('0x22')]){logger[_0x3f35('0xc')](_0x3f35('0x23'));return _['find'](_0x520e33,function(_0xb536c3){return _0xb536c3['contact'][_0x3f35('0x24')]===_0x2cb35a;});}else{logger[_0x3f35('0xc')](_0x3f35('0x25'));return request({'uri':util[_0x3f35('0xe')](_0x3f35('0x26'),_0x3397cb[_0x3f35('0x1d')])})['then'](function(_0x5b26a2){logger[_0x3f35('0xc')](_0x3f35('0x27'));return _0x5b26a2;});}});}else{logger[_0x3f35('0xc')](_0x3f35('0x28'));return request({'uri':util[_0x3f35('0xe')](_0x3f35('0x26'),_0x3397cb[_0x3f35('0x1d')])})[_0x3f35('0x1f')](function(_0x10b71c){logger['info'](_0x3f35('0x27'));return _0x10b71c;});}}function getEndUser(_0x23cd3a,_0x1415d6,_0x330852){logger['info'](_0x3f35('0x29'),_0x330852);return request({'uri':util[_0x3f35('0xe')]('%s/api/v2/contacts',_0x23cd3a[_0x3f35('0x1d')]),'qs':{'phone':_0x330852}})[_0x3f35('0x1f')](function(_0x1a2fd7){if(_0x1a2fd7[_0x3f35('0x22')]){logger[_0x3f35('0xc')](_0x3f35('0x2a'));return _[_0x3f35('0x2b')](_0x1a2fd7,{'phone':_0x330852});}else{logger[_0x3f35('0xc')](_0x3f35('0x2c'));return request({'uri':util['format'](_0x3f35('0x2d'),_0x23cd3a[_0x3f35('0x1d')]),'method':_0x3f35('0x1e'),'body':{'name':_0x1415d6,'phone':_0x330852}})[_0x3f35('0x1f')](function(_0xbca459){logger[_0x3f35('0xc')](_0x3f35('0x2e'));return _0xbca459;});}});}function getAuth(_0x2e05f8){return util[_0x3f35('0xe')](_0x3f35('0x2f'),new Buffer(_0x2e05f8[_0x3f35('0x30')]+':X')[_0x3f35('0x31')]('base64'));}function request(_0x387302){logger[_0x3f35('0x32')](_0x3f35('0x33'),JSON[_0x3f35('0x34')](_0x387302));return rp(_[_0x3f35('0x7')](_0x387302,{'method':_0x3f35('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x700a16,_0x5563a9){var _0x4544f6=[];if(_0x700a16&&_0x700a16[_0x3f35('0x22')]>0x0){_0x4544f6=_[_0x3f35('0x36')](_0x700a16,_0x5563a9);}return _0x4544f6;}function getCustomFields(_0x488a10,_0xdaab59){var _0x107edb=[];var _0x4022a5={'custom_fields':[]};if(_0x488a10['length']>0x0){_[_0x3f35('0x37')](_0x488a10,function(_0x549e06){if(_[_0x3f35('0x38')]([_0x3f35('0x39'),_0x3f35('0x3a')],_0x549e06[_0x3f35('0x3b')])&&_0x549e06[_0x3f35('0x3c')]&&!_0x549e06['customField']){_0x4022a5[_0x549e06[_0x3f35('0x3c')]['toLowerCase']()]=_0x549e06['content']['toString']();}else if(_[_0x3f35('0x38')]([_0x3f35('0x39'),_0x3f35('0x3a')],_0x549e06[_0x3f35('0x3b')])&&_0x549e06[_0x3f35('0x3d')]&&_0x549e06[_0x3f35('0x3e')]){_0x4022a5[_0x3f35('0x18')][_0x3f35('0x3f')]({'id':_0x549e06['idField'],'value':_0x549e06[_0x3f35('0x40')][_0x3f35('0x31')]()});}else if(_0x549e06[_0x3f35('0x3b')]==='variable'&&_0x549e06[_0x3f35('0x41')]&&_0x549e06['idField']&&_0x549e06[_0x3f35('0x3e')]){_0xdaab59[_0x549e06[_0x3f35('0x41')]]&&_0x4022a5['custom_fields'][_0x3f35('0x3f')]({'id':_0x549e06[_0x3f35('0x3d')],'value':_0xdaab59[_0x549e06['variableName']][_0x3f35('0x31')]()});}else if(_0x549e06[_0x3f35('0x3b')]===_0x3f35('0x42')&&_0x549e06[_0x3f35('0x43')]&&_0x549e06[_0x3f35('0x43')][_0x3f35('0x16')]&&_0x549e06[_0x3f35('0x3d')]&&_0x549e06['customField']){_0xdaab59[_0x549e06[_0x3f35('0x43')][_0x3f35('0x16')][_0x3f35('0x44')]()]&&_0x4022a5[_0x3f35('0x18')][_0x3f35('0x3f')]({'id':_0x549e06[_0x3f35('0x3d')],'value':_0xdaab59[_0x549e06[_0x3f35('0x43')][_0x3f35('0x16')][_0x3f35('0x44')]()][_0x3f35('0x31')]()});}});}return _0x4022a5;}exports[_0x3f35('0x45')]=function(_0x17cde1,_0x328966,_0x55c977,_0x41c5ae,_0x3e36ce,_0x352880){var _0x23a013,_0x106731;_0x352880['remoteUri']=intUtil[_0x3f35('0x46')](_0x352880[_0x3f35('0x1d')]);_0x352880[_0x3f35('0x47')]=intUtil[_0x3f35('0x46')](_0x352880[_0x3f35('0x47')]);if(_0x3e36ce&&_0x3e36ce[_0x3f35('0x48')]){logger[_0x3f35('0xc')](_0x3f35('0x49'),_0x3f35('0x4a'));_0x328966[_0x3f35('0x4b')]=util[_0x3f35('0xe')](_0x3f35('0x4c'),_0x352880['serverUrl'],_0x328966[_0x3f35('0x4d')],md5(_0x328966[_0x3f35('0x4d')]));}else{_0x328966['recordingURL']='';}headers[_0x3f35('0x4e')]=getAuth(_0x352880);return getUser(_0x352880,_0x41c5ae[_0x3f35('0x24')])[_0x3f35('0x1f')](function(_0x19def6){_0x23a013=_0x19def6;logger[_0x3f35('0xc')](_0x3f35('0x4f'),_0x23a013['id']);return getEndUser(_0x352880,_0x328966[_0x3f35('0x10')],_0x328966[_0x3f35('0x11')]);})[_0x3f35('0x1f')](function(_0x135f5e){_0x106731=_0x135f5e;logger[_0x3f35('0xc')]('The\x20Enduser\x20ID\x20is:',_0x106731['id']);return getTicket(_0x352880,_0x23a013,_0x106731,_0x55c977,_0x328966);})['then'](function(_0xe12db8){if(_0xe12db8&&_0xe12db8['id']){logger[_0x3f35('0xc')](_0x3f35('0x50'));logger[_0x3f35('0xc')]('The\x20Ticket\x20ID\x20is:',_0xe12db8['id']);logger[_0x3f35('0xc')](_0x3f35('0x49'),_0x3f35('0x51'));emit(util[_0x3f35('0xe')](_0x3f35('0x52'),_0x41c5ae[_0x3f35('0x16')]),_0x3f35('0x53'),{'uri':util[_0x3f35('0xe')]('%s/helpdesk/tickets/%d',_0x352880[_0x3f35('0x1d')],_0xe12db8['id'])});}})[_0x3f35('0x54')](function(_0x15baaa){logger['error']('[QUEUE]',JSON[_0x3f35('0x34')](_0x15baaa));});};exports[_0x3f35('0x55')]=function(_0x48b4bc,_0x1f2a4f,_0x36919d,_0xce83e4,_0x5bd303,_0x1c32d5,_0xf129b7){var _0x3bcd2e,_0xd3844d;_0x1c32d5[_0x3f35('0x1d')]=intUtil['stripTrailingSlash'](_0x1c32d5[_0x3f35('0x1d')]);_0x1c32d5[_0x3f35('0x47')]=intUtil['stripTrailingSlash'](_0x1c32d5[_0x3f35('0x47')]);if(_0xf129b7&&_0xf129b7[_0x3f35('0x56')]&&_0xf129b7['recordingFormat']!==_0x3f35('0x57')){logger[_0x3f35('0xc')](_0x3f35('0x58'),'Recording\x20is\x20enabled!');_0x1f2a4f[_0x3f35('0x4b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1c32d5[_0x3f35('0x47')],_0x1f2a4f['uniqueid'],md5(_0x1f2a4f[_0x3f35('0x4d')]));}headers[_0x3f35('0x4e')]=getAuth(_0x1c32d5);return getUser(_0x1c32d5,_0xce83e4[_0x3f35('0x24')])[_0x3f35('0x1f')](function(_0x4f0f89){_0x3bcd2e=_0x4f0f89;logger[_0x3f35('0xc')](_0x3f35('0x4f'),_0x3bcd2e['id']);return getEndUser(_0x1c32d5,_0x1f2a4f[_0x3f35('0x59')],_0x1f2a4f[_0x3f35('0x5a')]);})['then'](function(_0x75b015){_0xd3844d=_0x75b015;logger[_0x3f35('0xc')]('The\x20Enduser\x20ID\x20is:',_0xd3844d['id']);return getTicket(_0x1c32d5,_0x3bcd2e,_0xd3844d,_0x36919d,_0x1f2a4f);})['then'](function(_0x58bb3e){if(_0x58bb3e&&_0x58bb3e['id']){logger[_0x3f35('0xc')](_0x3f35('0x50'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x58bb3e['id']);logger[_0x3f35('0xc')](_0x3f35('0x58'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3f35('0xe')](_0x3f35('0x52'),_0xce83e4[_0x3f35('0x16')]),'trigger:browser:url',{'uri':util[_0x3f35('0xe')](_0x3f35('0x5b'),_0x1c32d5['remoteUri'],_0x58bb3e['id'])});}})[_0x3f35('0x54')](function(_0x502fb9){logger['error']('[OUTBOUND]',JSON[_0x3f35('0x34')](_0x502fb9));});};exports[_0x3f35('0x5c')]=function(_0x4d20b6,_0x4f5579,_0x3fe687,_0x5e4483,_0x471bb6,_0x162a60){var _0x47416e,_0x3e0872;_0x162a60[_0x3f35('0x1d')]=intUtil[_0x3f35('0x46')](_0x162a60[_0x3f35('0x1d')]);_0x162a60[_0x3f35('0x47')]=intUtil[_0x3f35('0x46')](_0x162a60[_0x3f35('0x47')]);if(_0x471bb6&&_0x471bb6['monitor_format']){logger[_0x3f35('0xc')]('['+_0x4f5579['lastevent'][_0x3f35('0x5d')]()+']',_0x3f35('0x4a'));_0x4f5579['recordingURL']=util[_0x3f35('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x162a60[_0x3f35('0x47')],_0x4f5579['uniqueid'],md5(_0x4f5579['uniqueid']));}else{_0x4f5579[_0x3f35('0x4b')]='';}headers[_0x3f35('0x4e')]=getAuth(_0x162a60);return getUser(_0x162a60,'')[_0x3f35('0x1f')](function(_0x2d4734){_0x47416e=_0x2d4734;logger[_0x3f35('0xc')](_0x3f35('0x4f'),_0x47416e['id']);return getEndUser(_0x162a60,_0x4f5579[_0x3f35('0x10')],_0x4f5579[_0x3f35('0x11')]);})[_0x3f35('0x1f')](function(_0x66fcfd){_0x3e0872=_0x66fcfd;logger[_0x3f35('0xc')](_0x3f35('0x5e'),_0x3e0872['id']);return getTicket(_0x162a60,_0x47416e,_0x3e0872,_0x3fe687,_0x4f5579);})['then'](function(_0x1ac3fe){if(_0x1ac3fe){logger[_0x3f35('0xc')](_0x3f35('0x50'));logger[_0x3f35('0xc')](_0x3f35('0x5f'),_0x1ac3fe['id']);}})['catch'](function(_0xbe0c94){logger['error']('['+_0x4f5579['lastevent'][_0x3f35('0x5d')]()+']',JSON[_0x3f35('0x34')](_0xbe0c94));});}; \ No newline at end of file +var _0x31bc=['uniqueid','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','recordingFormat','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','trigger:browser:url','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','
','Tags','Fields','custom_fields','mapValues','keyBy','format','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','nameField','toLowerCase','content','type','idField','customField','push','variableName','customVariable','Variable','name','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x31bc,0x187));var _0xc31b=function(_0x4aba69,_0x248f0b){_0x4aba69=_0x4aba69-0x0;var _0x57b23b=_0x31bc[_0x4aba69];return _0x57b23b;};'use strict';var _=require(_0xc31b('0x0'));var rp=require(_0xc31b('0x1'));var md5=require(_0xc31b('0x2'));var util=require(_0xc31b('0x3'));var Redis=require(_0xc31b('0x4'));var intUtil=require(_0xc31b('0x5'));var config=require(_0xc31b('0x6'));var logger=require('../../../../config/logger')(_0xc31b('0x7'));config[_0xc31b('0x8')]=_[_0xc31b('0x9')](config['redis'],{'host':_0xc31b('0xa'),'port':0x18eb});var io=require(_0xc31b('0xb'))(new Redis(config[_0xc31b('0x8')]));var headers={'Content-Type':_0xc31b('0xc'),'Accept':_0xc31b('0xc')};function emit(_0x3960b8,_0x29a2f4,_0x2ac311){io['to'](_0x3960b8)['emit'](_0x29a2f4,_0x2ac311);}function getTicket(_0x46b152,_0x10726e,_0xf8034c,_0x39db31,_0x1da45c){logger[_0xc31b('0xd')](_0xc31b('0xe'));var _0x3e21b6=_[_0xc31b('0xf')]({'responder_id':_0x10726e['id'],'requester_id':_0xf8034c['id'],'name':util['format'](_0xc31b('0x10'),_0x1da45c[_0xc31b('0x11')]),'phone':_0x1da45c[_0xc31b('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xc31b('0x13')](_0x39db31['Subjects'],_0x1da45c,'\x20'),'description':intUtil['getString'](_0x39db31[_0xc31b('0x14')],_0x1da45c,_0xc31b('0x15')),'tags':getTags(_0x39db31[_0xc31b('0x16')],'name')},getCustomFields(_0x39db31[_0xc31b('0x17')],_0x1da45c));_0x3e21b6[_0xc31b('0x18')]=_[_0xc31b('0x19')](_[_0xc31b('0x1a')](_0x3e21b6['custom_fields'],'id'),'value');return request({'uri':util[_0xc31b('0x1b')](_0xc31b('0x1c'),_0x46b152[_0xc31b('0x1d')]),'method':_0xc31b('0x1e'),'body':_0x3e21b6})[_0xc31b('0x1f')](function(_0x4172b4){logger['info'](_0xc31b('0x20'));return _0x4172b4;});}function getUser(_0x14b775,_0x224289){if(intUtil[_0xc31b('0x21')](_0x224289)){return request({'uri':util[_0xc31b('0x1b')](_0xc31b('0x22'),_0x14b775[_0xc31b('0x1d')]),'qs':{'email':_0x224289}})[_0xc31b('0x1f')](function(_0x49b3a0){if(_0x49b3a0[_0xc31b('0x23')]){logger['info'](_0xc31b('0x24'));return _[_0xc31b('0x25')](_0x49b3a0,function(_0x3ace3d){return _0x3ace3d['contact']['email']===_0x224289;});}else{logger[_0xc31b('0xd')](_0xc31b('0x26'));return request({'uri':util[_0xc31b('0x1b')]('%s/api/v2/agents/me',_0x14b775['remoteUri'])})[_0xc31b('0x1f')](function(_0x3a0ea2){logger[_0xc31b('0xd')](_0xc31b('0x27'));return _0x3a0ea2;});}});}else{logger[_0xc31b('0xd')](_0xc31b('0x28'));return request({'uri':util['format'](_0xc31b('0x29'),_0x14b775[_0xc31b('0x1d')])})[_0xc31b('0x1f')](function(_0xb01120){logger[_0xc31b('0xd')](_0xc31b('0x27'));return _0xb01120;});}}function getEndUser(_0x4a0875,_0x13cff7,_0x6f3909){logger[_0xc31b('0xd')](_0xc31b('0x2a'),_0x6f3909);return request({'uri':util[_0xc31b('0x1b')]('%s/api/v2/contacts',_0x4a0875[_0xc31b('0x1d')]),'qs':{'phone':_0x6f3909}})['then'](function(_0x4949a0){if(_0x4949a0[_0xc31b('0x23')]){logger[_0xc31b('0xd')](_0xc31b('0x2b'));return _[_0xc31b('0x25')](_0x4949a0,{'phone':_0x6f3909});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xc31b('0x1b')]('%s/api/v2/contacts',_0x4a0875['remoteUri']),'method':'POST','body':{'name':_0x13cff7,'phone':_0x6f3909}})[_0xc31b('0x1f')](function(_0xa6da32){logger[_0xc31b('0xd')]('Enduser\x20created.');return _0xa6da32;});}});}function getAuth(_0x544e17){return util['format'](_0xc31b('0x2c'),new Buffer(_0x544e17['apiKey']+':X')[_0xc31b('0x2d')](_0xc31b('0x2e')));}function request(_0x5118d8){logger[_0xc31b('0x2f')](_0xc31b('0x30'),JSON[_0xc31b('0x31')](_0x5118d8));return rp(_['defaults'](_0x5118d8,{'method':_0xc31b('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x1fe5c4,_0x5699ca){var _0x5d953a=[];if(_0x1fe5c4&&_0x1fe5c4[_0xc31b('0x23')]>0x0){_0x5d953a=_[_0xc31b('0x33')](_0x1fe5c4,_0x5699ca);}return _0x5d953a;}function getCustomFields(_0x18a6a3,_0x34fcb6){var _0x217fc1=[];var _0x25cc0c={'custom_fields':[]};if(_0x18a6a3[_0xc31b('0x23')]>0x0){_[_0xc31b('0x34')](_0x18a6a3,function(_0x2cd5bd){if(_[_0xc31b('0x35')]([_0xc31b('0x36'),_0xc31b('0x37')],_0x2cd5bd['type'])&&_0x2cd5bd['nameField']&&!_0x2cd5bd['customField']){_0x25cc0c[_0x2cd5bd[_0xc31b('0x38')][_0xc31b('0x39')]()]=_0x2cd5bd[_0xc31b('0x3a')]['toString']();}else if(_['includes']([_0xc31b('0x36'),_0xc31b('0x37')],_0x2cd5bd[_0xc31b('0x3b')])&&_0x2cd5bd[_0xc31b('0x3c')]&&_0x2cd5bd[_0xc31b('0x3d')]){_0x25cc0c[_0xc31b('0x18')][_0xc31b('0x3e')]({'id':_0x2cd5bd[_0xc31b('0x3c')],'value':_0x2cd5bd['content']['toString']()});}else if(_0x2cd5bd['type']==='variable'&&_0x2cd5bd[_0xc31b('0x3f')]&&_0x2cd5bd[_0xc31b('0x3c')]&&_0x2cd5bd[_0xc31b('0x3d')]){_0x34fcb6[_0x2cd5bd[_0xc31b('0x3f')]]&&_0x25cc0c[_0xc31b('0x18')][_0xc31b('0x3e')]({'id':_0x2cd5bd[_0xc31b('0x3c')],'value':_0x34fcb6[_0x2cd5bd[_0xc31b('0x3f')]][_0xc31b('0x2d')]()});}else if(_0x2cd5bd[_0xc31b('0x3b')]===_0xc31b('0x40')&&_0x2cd5bd[_0xc31b('0x41')]&&_0x2cd5bd[_0xc31b('0x41')][_0xc31b('0x42')]&&_0x2cd5bd[_0xc31b('0x3c')]&&_0x2cd5bd[_0xc31b('0x3d')]){_0x34fcb6[_0x2cd5bd['Variable']['name'][_0xc31b('0x39')]()]&&_0x25cc0c['custom_fields']['push']({'id':_0x2cd5bd[_0xc31b('0x3c')],'value':_0x34fcb6[_0x2cd5bd[_0xc31b('0x41')][_0xc31b('0x42')]['toLowerCase']()][_0xc31b('0x2d')]()});}});}return _0x25cc0c;}exports['queue']=function(_0x9b7e9f,_0x55fcca,_0x39db20,_0x137732,_0x43a199,_0x39e935){var _0x56de85,_0x834af7;_0x39e935[_0xc31b('0x1d')]=intUtil[_0xc31b('0x43')](_0x39e935[_0xc31b('0x1d')]);_0x39e935[_0xc31b('0x44')]=intUtil[_0xc31b('0x43')](_0x39e935[_0xc31b('0x44')]);if(_0x43a199&&_0x43a199[_0xc31b('0x45')]){logger['info'](_0xc31b('0x46'),_0xc31b('0x47'));_0x55fcca[_0xc31b('0x48')]=util['format'](_0xc31b('0x49'),_0x39e935[_0xc31b('0x44')],_0x55fcca['uniqueid'],md5(_0x55fcca[_0xc31b('0x4a')]));}else{_0x55fcca['recordingURL']='';}headers['Authorization']=getAuth(_0x39e935);return getUser(_0x39e935,_0x137732[_0xc31b('0x4b')])[_0xc31b('0x1f')](function(_0x5ed79b){_0x56de85=_0x5ed79b;logger[_0xc31b('0xd')](_0xc31b('0x4c'),_0x56de85['id']);return getEndUser(_0x39e935,_0x55fcca[_0xc31b('0x11')],_0x55fcca[_0xc31b('0x12')]);})['then'](function(_0x484c55){_0x834af7=_0x484c55;logger[_0xc31b('0xd')](_0xc31b('0x4d'),_0x834af7['id']);return getTicket(_0x39e935,_0x56de85,_0x834af7,_0x39db20,_0x55fcca);})[_0xc31b('0x1f')](function(_0x43219e){if(_0x43219e&&_0x43219e['id']){logger[_0xc31b('0xd')](_0xc31b('0x20'));logger['info'](_0xc31b('0x4e'),_0x43219e['id']);logger[_0xc31b('0xd')](_0xc31b('0x46'),_0xc31b('0x4f'));emit(util[_0xc31b('0x1b')](_0xc31b('0x50'),_0x137732[_0xc31b('0x42')]),'trigger:browser:url',{'uri':util[_0xc31b('0x1b')](_0xc31b('0x51'),_0x39e935['remoteUri'],_0x43219e['id'])});}})[_0xc31b('0x52')](function(_0x44001b){logger[_0xc31b('0x53')](_0xc31b('0x46'),JSON[_0xc31b('0x31')](_0x44001b));});};exports['outbound']=function(_0x57e815,_0x43d795,_0x3bd751,_0x493b45,_0x42ff03,_0x99f095,_0x502161){var _0x4f83e5,_0x2f1d5e;_0x99f095[_0xc31b('0x1d')]=intUtil['stripTrailingSlash'](_0x99f095[_0xc31b('0x1d')]);_0x99f095[_0xc31b('0x44')]=intUtil[_0xc31b('0x43')](_0x99f095[_0xc31b('0x44')]);if(_0x502161&&_0x502161[_0xc31b('0x54')]&&_0x502161[_0xc31b('0x54')]!=='none'){logger[_0xc31b('0xd')](_0xc31b('0x55'),_0xc31b('0x47'));_0x43d795[_0xc31b('0x48')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x99f095[_0xc31b('0x44')],_0x43d795[_0xc31b('0x4a')],md5(_0x43d795['uniqueid']));}headers[_0xc31b('0x56')]=getAuth(_0x99f095);return getUser(_0x99f095,_0x493b45[_0xc31b('0x4b')])[_0xc31b('0x1f')](function(_0x26ca04){_0x4f83e5=_0x26ca04;logger['info'](_0xc31b('0x4c'),_0x4f83e5['id']);return getEndUser(_0x99f095,_0x43d795[_0xc31b('0x57')],_0x43d795[_0xc31b('0x58')]);})[_0xc31b('0x1f')](function(_0x50dcef){_0x2f1d5e=_0x50dcef;logger[_0xc31b('0xd')](_0xc31b('0x4d'),_0x2f1d5e['id']);return getTicket(_0x99f095,_0x4f83e5,_0x2f1d5e,_0x3bd751,_0x43d795);})[_0xc31b('0x1f')](function(_0x2fc7d0){if(_0x2fc7d0&&_0x2fc7d0['id']){logger[_0xc31b('0xd')](_0xc31b('0x20'));logger['info'](_0xc31b('0x4e'),_0x2fc7d0['id']);logger['info'](_0xc31b('0x55'),_0xc31b('0x4f'));emit(util[_0xc31b('0x1b')]('user:%s',_0x493b45['name']),_0xc31b('0x59'),{'uri':util[_0xc31b('0x1b')](_0xc31b('0x51'),_0x99f095['remoteUri'],_0x2fc7d0['id'])});}})[_0xc31b('0x52')](function(_0x483338){logger[_0xc31b('0x53')](_0xc31b('0x55'),JSON[_0xc31b('0x31')](_0x483338));});};exports[_0xc31b('0x5a')]=function(_0x6e72e1,_0x10953e,_0x2bbea1,_0x2b0a8d,_0x48aa03,_0x45f4f2){var _0x1a3631,_0xe29b3b;_0x45f4f2['remoteUri']=intUtil['stripTrailingSlash'](_0x45f4f2[_0xc31b('0x1d')]);_0x45f4f2['serverUrl']=intUtil[_0xc31b('0x43')](_0x45f4f2[_0xc31b('0x44')]);if(_0x48aa03&&_0x48aa03[_0xc31b('0x45')]){logger['info']('['+_0x10953e[_0xc31b('0x5b')][_0xc31b('0x5c')]()+']',_0xc31b('0x47'));_0x10953e['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x45f4f2['serverUrl'],_0x10953e[_0xc31b('0x4a')],md5(_0x10953e[_0xc31b('0x4a')]));}else{_0x10953e[_0xc31b('0x48')]='';}headers[_0xc31b('0x56')]=getAuth(_0x45f4f2);return getUser(_0x45f4f2,'')[_0xc31b('0x1f')](function(_0x379ad2){_0x1a3631=_0x379ad2;logger[_0xc31b('0xd')](_0xc31b('0x4c'),_0x1a3631['id']);return getEndUser(_0x45f4f2,_0x10953e[_0xc31b('0x11')],_0x10953e[_0xc31b('0x12')]);})[_0xc31b('0x1f')](function(_0x5a7590){_0xe29b3b=_0x5a7590;logger[_0xc31b('0xd')](_0xc31b('0x4d'),_0xe29b3b['id']);return getTicket(_0x45f4f2,_0x1a3631,_0xe29b3b,_0x2bbea1,_0x10953e);})[_0xc31b('0x1f')](function(_0x525352){if(_0x525352){logger[_0xc31b('0xd')](_0xc31b('0x20'));logger[_0xc31b('0xd')]('The\x20Ticket\x20ID\x20is:',_0x525352['id']);}})['catch'](function(_0x1392b0){logger[_0xc31b('0x53')]('['+_0x10953e['lastevent'][_0xc31b('0x5c')]()+']',JSON['stringify'](_0x1392b0));});}; \ 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 ee256b0..a6c0f76 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 _0x752a=['serverUrl','remoteUri','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','The\x20ticket\x20ID\x20is:\x20%s',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','Getting\x20user\x20list','users','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','Admin\x20selected','catch','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','getString','Subjects','Descriptions','ticketId','task','/contacts/','user:%s','emit','apiKey','stripTrailingSlash'];(function(_0x5df44a,_0x47812e){var _0x4e22b2=function(_0x1215a7){while(--_0x1215a7){_0x5df44a['push'](_0x5df44a['shift']());}};_0x4e22b2(++_0x47812e);}(_0x752a,0xbc));var _0xa752=function(_0x303c30,_0x16edcb){_0x303c30=_0x303c30-0x0;var _0x43161b=_0x752a[_0x303c30];return _0x43161b;};'use strict';var _=require(_0xa752('0x0'));var rp=require(_0xa752('0x1'));var md5=require('md5');var util=require(_0xa752('0x2'));var moment=require(_0xa752('0x3'));var Promise=require(_0xa752('0x4'));var Redis=require(_0xa752('0x5'));var intUtil=require(_0xa752('0x6'));var config=require(_0xa752('0x7'));var logger=require(_0xa752('0x8'))(_0xa752('0x9'));config[_0xa752('0xa')]=_[_0xa752('0xb')](config[_0xa752('0xa')],{'host':_0xa752('0xc'),'port':0x18eb});var io=require(_0xa752('0xd'))(new Redis(config['redis']));function getAdminId(_0x4f5db2,_0x1d73e2,_0x3100d7,_0x4b8107){return new Promise(function(_0x2e41bd,_0x32ba50){var _0x298cbb=![];var _0x4247a5={'method':_0xa752('0xe'),'uri':_0x4b8107+_0xa752('0xf'),'json':!![]};_0x4247a5[_0xa752('0x10')]=_0x3100d7;logger[_0xa752('0x11')](_0xa752('0x12'));return rp(_0x4247a5)[_0xa752('0x13')](function(_0x43fad5){if(_0x43fad5){var _0x44c3d2=_0x43fad5['users'];var _0x174e60=null;for(_0x174e60=0x0;_0x174e60<_0x44c3d2[_0xa752('0x14')];_0x174e60++){if(_0x44c3d2[_0x174e60][_0xa752('0x15')]===_0x4f5db2[_0xa752('0x16')]){_0x4f5db2['adminId']=_0x44c3d2[_0x174e60]['id'];_0x298cbb=!![];}}if(_0x298cbb){logger[_0xa752('0x11')]('Admin\x20found:',_0x4f5db2[_0xa752('0x17')]);_0x2e41bd(_0x4f5db2);}else{_0x32ba50({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x32ba50({'statusCode':0x194,'message':_0xa752('0x18')});}})['catch'](function(_0x363a27){logger[_0xa752('0x19')]('['+[_0x1d73e2[_0xa752('0x1a')]()]+']',_0x363a27[_0xa752('0x1b')]);_0x32ba50(_0x363a27);});});}function getUser(_0x4a6573,_0x4e21c5,_0x6dd5e2){return function(_0x4fe6f5){return new Promise(function(_0x54fc74,_0x3e6c30){var _0x4c4c41={'method':_0xa752('0xe'),'uri':_0x6dd5e2+_0xa752('0xf'),'json':!![]};_0x4c4c41['headers']=_0x4e21c5;logger[_0xa752('0x11')](_0xa752('0x1c'));return rp(_0x4c4c41)[_0xa752('0x13')](function(_0x680368){if(_0x680368){var _0x35093b=_0x680368[_0xa752('0x1d')];var _0x1eaa3b=![];var _0x3588ad=null;if(_0x4fe6f5['agentEmail']!==null){logger[_0xa752('0x11')](_0xa752('0x1e'),_0x4fe6f5[_0xa752('0x1f')]);_0x4fe6f5[_0xa752('0x20')]=_0x4fe6f5[_0xa752('0x1f')];for(_0x3588ad=0x0;_0x3588ad<_0x35093b['length'];_0x3588ad++){if(_0x35093b[_0x3588ad][_0xa752('0x15')]===_0x4fe6f5[_0xa752('0x1f')]){_0x1eaa3b=!![];_0x4fe6f5['userId']=_0x35093b[_0x3588ad]['id'];logger[_0xa752('0x11')]('User\x20found:',_0x4fe6f5[_0xa752('0x21')]);}}}if(!_0x1eaa3b){logger[_0xa752('0x11')](_0xa752('0x22'));_0x4fe6f5[_0xa752('0x20')]=_0x4fe6f5[_0xa752('0x16')];_0x4fe6f5['userId']=_0x4fe6f5[_0xa752('0x17')];_0x1eaa3b=!![];}if(_0x1eaa3b){_0x54fc74(_0x4fe6f5);}else{_0x3e6c30({'statusCode':0x194,'message':_0xa752('0x18')});}}else{_0x3e6c30({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xa752('0x23')](function(_0x314eb9){logger[_0xa752('0x19')]('['+[_0x4a6573[_0xa752('0x1a')]()]+']',_0x314eb9[_0xa752('0x1b')]);_0x3e6c30(_0x314eb9);});});};}function searchContact(_0x5cb44c,_0x584e15,_0x35b74a,_0x4ded05){return new Promise(function(_0xcd946d,_0x7a542e){var _0x1c4f5a={'method':_0xa752('0xe'),'headers':_0x584e15,'uri':_0x5cb44c+'/api/lookup?q='+_0x4ded05+'&f='+_0x35b74a+_0xa752('0x24'),'json':!![]};rp(_0x1c4f5a)['then'](function(_0x657713){var _0x5c686b=_[_0xa752('0x25')](_0x657713[_0xa752('0x26')][_0xa752('0x26')],[_0x35b74a,_0x4ded05]);_0xcd946d(_0x5c686b);})[_0xa752('0x23')](function(_0x36c07d){_0x7a542e(_0x36c07d);});});}function getEndUser(_0x26ccc8,_0x4f0a88,_0x43796d){return function(_0x5155c9){return new Promise(function(_0x5879a0,_0x173403){logger['info'](util['format'](_0xa752('0x27'),_0x5155c9[_0xa752('0x28')]));searchContact(_0x43796d,_0x4f0a88,_0xa752('0x29'),_0x5155c9[_0xa752('0x28')])[_0xa752('0x13')](function(_0x3132c3){if(_0x3132c3){_0x5155c9[_0xa752('0x2a')]=_0x3132c3['id'];logger[_0xa752('0x11')](_0xa752('0x2b'),_0x5155c9['endUserId']);return _0x5879a0(_0x5155c9);}searchContact(_0x43796d,_0x4f0a88,_0xa752('0x2c'),_0x5155c9[_0xa752('0x28')])[_0xa752('0x13')](function(_0xa2d981){if(_0xa2d981){_0x5155c9[_0xa752('0x2a')]=_0xa2d981['id'];logger[_0xa752('0x11')](_0xa752('0x2d'),_0x5155c9[_0xa752('0x2a')]);return _0x5879a0(_0x5155c9);}createEndUser(_0x5155c9,_0x26ccc8,_0x4f0a88,_0x43796d)[_0xa752('0x13')](function(_0x10ee22){logger[_0xa752('0x11')](_0xa752('0x2e'),_0x10ee22[_0xa752('0x2a')]);return _0x5879a0(_0x10ee22);});});})[_0xa752('0x23')](function(_0x15e36d){_0x173403(_0x15e36d);});});};}function createEndUser(_0x2ffa57,_0x27f9be,_0x3f1762,_0x259741){return new Promise(function(_0x42f15d,_0x453610){var _0x47687a=moment();var _0x8803f3={'method':_0xa752('0x2f'),'uri':_0x259741+_0xa752('0x30'),'body':{'contact':{'last_name':_0x2ffa57[_0xa752('0x28')],'work_number':_0x2ffa57[_0xa752('0x28')],'mobile_number':_0x2ffa57[_0xa752('0x28')],'owner_id':_0x2ffa57['userId'],'created_at':_0x47687a[_0xa752('0x31')](_0xa752('0x32'))}},'json':!![]};_0x8803f3[_0xa752('0x10')]=_0x3f1762;logger[_0xa752('0x11')](_0xa752('0x33'));return rp(_0x8803f3)[_0xa752('0x13')](function(_0x12262b){_0x2ffa57['endUserId']=_0x12262b[_0xa752('0x34')]['id'];_0x42f15d(_0x2ffa57);})[_0xa752('0x23')](function(_0x588dc2){logger[_0xa752('0x19')]('['+[_0x27f9be[_0xa752('0x1a')]()]+']',_0x588dc2[_0xa752('0x1b')]);_0x453610(_0x588dc2[_0xa752('0x1b')]);});});}function getTicket(_0x3b7029,_0x35ef61,_0x4a561f,_0x1dd8d7,_0x19d1fb){return function(_0x33d703){logger[_0xa752('0x11')]('Creating\x20new\x20task');return new Promise(function(_0x2c5eee,_0x2564f7){var _0x543cc9=moment();var _0x540367={'method':_0xa752('0x2f'),'uri':_0x4a561f+_0xa752('0x35'),'body':{'title':intUtil[_0xa752('0x36')](_0x1dd8d7[_0xa752('0x37')],_0x19d1fb,'\x20'),'description':intUtil[_0xa752('0x36')](_0x1dd8d7[_0xa752('0x38')],_0x19d1fb,'\x0a'),'owner_id':_0x33d703['userId'],'creater_id':_0x33d703[_0xa752('0x17')],'targetable_id':_0x33d703[_0xa752('0x2a')],'targetable_type':'Contact','created_at':_0x543cc9['format'](_0xa752('0x32')),'due_date':_0x543cc9['add'](0x1e,'m')[_0xa752('0x31')](_0xa752('0x32'))},'json':!![]};_0x540367[_0xa752('0x10')]=_0x35ef61;return rp(_0x540367)['then'](function(_0x320284){_0x33d703[_0xa752('0x39')]=_0x320284[_0xa752('0x3a')]['id'];logger['info']('Task\x20created:',_0x33d703[_0xa752('0x39')]);_0x2c5eee(_0x33d703);})[_0xa752('0x23')](function(_0x567ba7){logger[_0xa752('0x19')]('['+[_0x3b7029[_0xa752('0x1a')]()]+']',_0x567ba7['message']);_0x2564f7(_0x567ba7['message']);});});};}function emit(_0x55adfa,_0x145ce3,_0x2155ac){var _0x44d899={'uri':_0x55adfa+_0xa752('0x3b')+_0x2155ac};io['to'](util[_0xa752('0x31')](_0xa752('0x3c'),_0x145ce3))[_0xa752('0x3d')]('trigger:browser:url',_0x44d899);}exports['cs']=function(_0x314da6,_0xda19e5,_0x56cfa4,_0x359609,_0x15779f,_0x321471,_0x215b96,_0x179b82){var _0x1ab87c={};var _0x399568={'Authorization':'Token\x20token='+_0x321471[_0xa752('0x3e')]};_0x321471['remoteUri']=intUtil[_0xa752('0x3f')](_0x321471['remoteUri']);_0x321471[_0xa752('0x40')]=intUtil[_0xa752('0x3f')](_0x321471[_0xa752('0x40')]);var _0x66724a=_0x321471[_0xa752('0x41')];_0x1ab87c['adminEmail']=_0x321471['username'];_0x1ab87c[_0xa752('0x28')]=_0x179b82[_0xa752('0x42')]()==='outbound'?_0xda19e5[_0xa752('0x43')]:_0xda19e5[_0xa752('0x44')];_0x1ab87c[_0xa752('0x45')]=_0x179b82===_0xa752('0x46')||_0x179b82===_0xa752('0x47')?_0xa752('0x46'):_0xa752('0x48');if(_0x359609){_0x1ab87c[_0xa752('0x1f')]=_0x359609[_0xa752('0x15')];}var _0x4ff59c=util[_0xa752('0x31')](_0xa752('0x49'),_0x321471[_0xa752('0x40')],_0xda19e5[_0xa752('0x4a')],md5(_0xda19e5[_0xa752('0x4a')]));if(_0x15779f&&_0x15779f[_0xa752('0x4b')]){logger[_0xa752('0x11')](_0xa752('0x4c'),_0xa752('0x4d'));_0xda19e5['recordingURL']=_0x4ff59c;}else if(_0x215b96&&_0x215b96[_0xa752('0x4e')]&&_0x215b96['recordingFormat']!==_0xa752('0x4f')){logger[_0xa752('0x11')]('[OUTBOUND]',_0xa752('0x4d'));_0xda19e5['recordingURL']=_0x4ff59c;}else{_0xda19e5[_0xa752('0x50')]='';}return getAdminId(_0x1ab87c,_0x179b82,_0x399568,_0x66724a)[_0xa752('0x13')](getUser(_0x179b82,_0x399568,_0x66724a))[_0xa752('0x13')](getEndUser(_0x179b82,_0x399568,_0x66724a))[_0xa752('0x13')](getTicket(_0x179b82,_0x399568,_0x66724a,_0x56cfa4,_0xda19e5))[_0xa752('0x13')](function(_0x2a2a0d){logger[_0xa752('0x11')](util[_0xa752('0x31')](_0xa752('0x51'),_0x2a2a0d[_0xa752('0x39')]));if(_0x179b82!=='unmanaged'){logger[_0xa752('0x11')]('['+[_0x179b82['toUpperCase']()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x66724a,_0x359609['name'],_0x2a2a0d[_0xa752('0x2a')]);}})['catch'](function(_0x3d0066){logger[_0xa752('0x19')]('['+[_0x179b82[_0xa752('0x1a')]()]+_0xa752('0x52'),util[_0xa752('0x53')](_0x3d0066,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x90d7=['error','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','Contact\x20found\x20mobile_number:','endUserId','Contact\x20found\x20work_number:','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','socket.io-emitter','GET','headers','info','users','length','email','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','/api/selector/owners','Getting\x20user\x20list','then','agentEmail','Getting\x20user\x20with\x20email','userEmail','User\x20found:','userId','Admin\x20selected'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x90d7,0xe1));var _0x790d=function(_0xe2988d,_0x4ef963){_0xe2988d=_0xe2988d-0x0;var _0x47b583=_0x90d7[_0xe2988d];return _0x47b583;};'use strict';var _=require(_0x790d('0x0'));var rp=require(_0x790d('0x1'));var md5=require(_0x790d('0x2'));var util=require(_0x790d('0x3'));var moment=require(_0x790d('0x4'));var Promise=require(_0x790d('0x5'));var Redis=require(_0x790d('0x6'));var intUtil=require(_0x790d('0x7'));var config=require(_0x790d('0x8'));var logger=require(_0x790d('0x9'))(_0x790d('0xa'));config[_0x790d('0xb')]=_[_0x790d('0xc')](config[_0x790d('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x790d('0xd'))(new Redis(config[_0x790d('0xb')]));function getAdminId(_0x49f971,_0x30799c,_0x4b1473,_0x211df6){return new Promise(function(_0x1282fb,_0x2e9edd){var _0x3259e7=![];var _0x591bd3={'method':_0x790d('0xe'),'uri':_0x211df6+'/api/selector/owners','json':!![]};_0x591bd3[_0x790d('0xf')]=_0x4b1473;logger[_0x790d('0x10')]('Getting\x20admin\x20information');return rp(_0x591bd3)['then'](function(_0x4cf949){if(_0x4cf949){var _0x82c640=_0x4cf949[_0x790d('0x11')];var _0x140c99=null;for(_0x140c99=0x0;_0x140c99<_0x82c640[_0x790d('0x12')];_0x140c99++){if(_0x82c640[_0x140c99][_0x790d('0x13')]===_0x49f971[_0x790d('0x14')]){_0x49f971['adminId']=_0x82c640[_0x140c99]['id'];_0x3259e7=!![];}}if(_0x3259e7){logger['info'](_0x790d('0x15'),_0x49f971[_0x790d('0x16')]);_0x1282fb(_0x49f971);}else{_0x2e9edd({'statusCode':0x194,'message':_0x790d('0x17')});}}else{_0x2e9edd({'statusCode':0x194,'message':_0x790d('0x17')});}})[_0x790d('0x18')](function(_0x5f32fd){logger['error']('['+[_0x30799c[_0x790d('0x19')]()]+']',_0x5f32fd[_0x790d('0x1a')]);_0x2e9edd(_0x5f32fd);});});}function getUser(_0x412c22,_0x30c167,_0x7ea7be){return function(_0x2a88f2){return new Promise(function(_0x23aecc,_0x24da35){var _0x10f5d5={'method':_0x790d('0xe'),'uri':_0x7ea7be+_0x790d('0x1b'),'json':!![]};_0x10f5d5['headers']=_0x30c167;logger[_0x790d('0x10')](_0x790d('0x1c'));return rp(_0x10f5d5)[_0x790d('0x1d')](function(_0x524fa2){if(_0x524fa2){var _0x220ff6=_0x524fa2[_0x790d('0x11')];var _0x5257f8=![];var _0x28df28=null;if(_0x2a88f2[_0x790d('0x1e')]!==null){logger[_0x790d('0x10')](_0x790d('0x1f'),_0x2a88f2[_0x790d('0x1e')]);_0x2a88f2[_0x790d('0x20')]=_0x2a88f2[_0x790d('0x1e')];for(_0x28df28=0x0;_0x28df28<_0x220ff6[_0x790d('0x12')];_0x28df28++){if(_0x220ff6[_0x28df28]['email']===_0x2a88f2[_0x790d('0x1e')]){_0x5257f8=!![];_0x2a88f2['userId']=_0x220ff6[_0x28df28]['id'];logger[_0x790d('0x10')](_0x790d('0x21'),_0x2a88f2[_0x790d('0x22')]);}}}if(!_0x5257f8){logger['info'](_0x790d('0x23'));_0x2a88f2[_0x790d('0x20')]=_0x2a88f2[_0x790d('0x14')];_0x2a88f2[_0x790d('0x22')]=_0x2a88f2[_0x790d('0x16')];_0x5257f8=!![];}if(_0x5257f8){_0x23aecc(_0x2a88f2);}else{_0x24da35({'statusCode':0x194,'message':_0x790d('0x17')});}}else{_0x24da35({'statusCode':0x194,'message':_0x790d('0x17')});}})[_0x790d('0x18')](function(_0x2d9a58){logger[_0x790d('0x24')]('['+[_0x412c22['toUpperCase']()]+']',_0x2d9a58['message']);_0x24da35(_0x2d9a58);});});};}function searchContact(_0x3bffc0,_0x38f7f5,_0x536a80,_0xdc02f4){return new Promise(function(_0x5839d5,_0x7d28bf){var _0x124779={'method':_0x790d('0xe'),'headers':_0x38f7f5,'uri':_0x3bffc0+_0x790d('0x25')+_0xdc02f4+_0x790d('0x26')+_0x536a80+_0x790d('0x27'),'json':!![]};rp(_0x124779)[_0x790d('0x1d')](function(_0x3a5827){var _0x429a65=_[_0x790d('0x28')](_0x3a5827['contacts'][_0x790d('0x29')],[_0x536a80,_0xdc02f4]);_0x5839d5(_0x429a65);})[_0x790d('0x18')](function(_0x3cf06b){_0x7d28bf(_0x3cf06b);});});}function getEndUser(_0x34df24,_0x23ca99,_0xad6a9c){return function(_0x78ca09){return new Promise(function(_0x4c10af,_0x189d86){logger[_0x790d('0x10')](util[_0x790d('0x2a')](_0x790d('0x2b'),_0x78ca09[_0x790d('0x2c')]));searchContact(_0xad6a9c,_0x23ca99,'mobile_number',_0x78ca09[_0x790d('0x2c')])['then'](function(_0x87cbe0){if(_0x87cbe0){_0x78ca09['endUserId']=_0x87cbe0['id'];logger['info'](_0x790d('0x2d'),_0x78ca09[_0x790d('0x2e')]);return _0x4c10af(_0x78ca09);}searchContact(_0xad6a9c,_0x23ca99,'work_number',_0x78ca09[_0x790d('0x2c')])['then'](function(_0x4ee3e1){if(_0x4ee3e1){_0x78ca09[_0x790d('0x2e')]=_0x4ee3e1['id'];logger['info'](_0x790d('0x2f'),_0x78ca09[_0x790d('0x2e')]);return _0x4c10af(_0x78ca09);}createEndUser(_0x78ca09,_0x34df24,_0x23ca99,_0xad6a9c)['then'](function(_0x321d5c){logger[_0x790d('0x10')]('Contact\x20created:',_0x321d5c[_0x790d('0x2e')]);return _0x4c10af(_0x321d5c);});});})[_0x790d('0x18')](function(_0x32a0e5){_0x189d86(_0x32a0e5);});});};}function createEndUser(_0x12df22,_0x3183fc,_0x36976c,_0x3edca4){return new Promise(function(_0x351e19,_0x4a4550){var _0x2e0946=moment();var _0x938238={'method':'POST','uri':_0x3edca4+_0x790d('0x30'),'body':{'contact':{'last_name':_0x12df22[_0x790d('0x2c')],'work_number':_0x12df22[_0x790d('0x2c')],'mobile_number':_0x12df22[_0x790d('0x2c')],'owner_id':_0x12df22[_0x790d('0x22')],'created_at':_0x2e0946['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x938238[_0x790d('0xf')]=_0x36976c;logger[_0x790d('0x10')](_0x790d('0x31'));return rp(_0x938238)['then'](function(_0x20bf7b){_0x12df22[_0x790d('0x2e')]=_0x20bf7b['contact']['id'];_0x351e19(_0x12df22);})[_0x790d('0x18')](function(_0x239366){logger[_0x790d('0x24')]('['+[_0x3183fc[_0x790d('0x19')]()]+']',_0x239366[_0x790d('0x1a')]);_0x4a4550(_0x239366[_0x790d('0x1a')]);});});}function getTicket(_0x56232f,_0x520443,_0x311f88,_0x46071b,_0x1df842){return function(_0x971408){logger[_0x790d('0x10')](_0x790d('0x32'));return new Promise(function(_0x10f753,_0x340da0){var _0x374544=moment();var _0x491994={'method':_0x790d('0x33'),'uri':_0x311f88+_0x790d('0x34'),'body':{'title':intUtil[_0x790d('0x35')](_0x46071b[_0x790d('0x36')],_0x1df842,'\x20'),'description':intUtil[_0x790d('0x35')](_0x46071b[_0x790d('0x37')],_0x1df842,'\x0a'),'owner_id':_0x971408['userId'],'creater_id':_0x971408[_0x790d('0x16')],'targetable_id':_0x971408['endUserId'],'targetable_type':_0x790d('0x38'),'created_at':_0x374544['format'](_0x790d('0x39')),'due_date':_0x374544[_0x790d('0x3a')](0x1e,'m')[_0x790d('0x2a')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x491994[_0x790d('0xf')]=_0x520443;return rp(_0x491994)[_0x790d('0x1d')](function(_0x19767a){_0x971408[_0x790d('0x3b')]=_0x19767a[_0x790d('0x3c')]['id'];logger[_0x790d('0x10')](_0x790d('0x3d'),_0x971408['ticketId']);_0x10f753(_0x971408);})[_0x790d('0x18')](function(_0x1742b2){logger[_0x790d('0x24')]('['+[_0x56232f[_0x790d('0x19')]()]+']',_0x1742b2[_0x790d('0x1a')]);_0x340da0(_0x1742b2[_0x790d('0x1a')]);});});};}function emit(_0x5e000f,_0x59895b,_0x325c7a){var _0x4da748={'uri':_0x5e000f+_0x790d('0x3e')+_0x325c7a};io['to'](util[_0x790d('0x2a')](_0x790d('0x3f'),_0x59895b))[_0x790d('0x40')]('trigger:browser:url',_0x4da748);}exports['cs']=function(_0x4088d9,_0x3a6b1b,_0x49d6ba,_0x40cd81,_0x19f6d9,_0x1961fc,_0xf05cfe,_0x34daca){var _0x3b17f1={};var _0x94608={'Authorization':_0x790d('0x41')+_0x1961fc[_0x790d('0x42')]};_0x1961fc[_0x790d('0x43')]=intUtil[_0x790d('0x44')](_0x1961fc[_0x790d('0x43')]);_0x1961fc['serverUrl']=intUtil[_0x790d('0x44')](_0x1961fc[_0x790d('0x45')]);var _0x130e2e=_0x1961fc[_0x790d('0x43')];_0x3b17f1[_0x790d('0x14')]=_0x1961fc[_0x790d('0x46')];_0x3b17f1[_0x790d('0x2c')]=_0x34daca[_0x790d('0x47')]()===_0x790d('0x48')?_0x3a6b1b[_0x790d('0x49')]:_0x3a6b1b[_0x790d('0x4a')];_0x3b17f1[_0x790d('0x4b')]=_0x34daca===_0x790d('0x4c')||_0x34daca===_0x790d('0x4d')?_0x790d('0x4c'):_0x790d('0x48');if(_0x40cd81){_0x3b17f1[_0x790d('0x1e')]=_0x40cd81[_0x790d('0x13')];}var _0x51f8fe=util['format'](_0x790d('0x4e'),_0x1961fc[_0x790d('0x45')],_0x3a6b1b[_0x790d('0x4f')],md5(_0x3a6b1b['uniqueid']));if(_0x19f6d9&&_0x19f6d9['monitor_format']){logger[_0x790d('0x10')]('[QUEUE]',_0x790d('0x50'));_0x3a6b1b[_0x790d('0x51')]=_0x51f8fe;}else if(_0xf05cfe&&_0xf05cfe[_0x790d('0x52')]&&_0xf05cfe[_0x790d('0x52')]!=='none'){logger[_0x790d('0x10')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3a6b1b['recordingURL']=_0x51f8fe;}else{_0x3a6b1b[_0x790d('0x51')]='';}return getAdminId(_0x3b17f1,_0x34daca,_0x94608,_0x130e2e)[_0x790d('0x1d')](getUser(_0x34daca,_0x94608,_0x130e2e))[_0x790d('0x1d')](getEndUser(_0x34daca,_0x94608,_0x130e2e))[_0x790d('0x1d')](getTicket(_0x34daca,_0x94608,_0x130e2e,_0x49d6ba,_0x3a6b1b))[_0x790d('0x1d')](function(_0x33c55b){logger[_0x790d('0x10')](util[_0x790d('0x2a')](_0x790d('0x53'),_0x33c55b[_0x790d('0x3b')]));if(_0x34daca!==_0x790d('0x4d')){logger[_0x790d('0x10')]('['+[_0x34daca[_0x790d('0x19')]()]+']',_0x790d('0x54'));emit(_0x130e2e,_0x40cd81[_0x790d('0x55')],_0x33c55b[_0x790d('0x2e')]);}})[_0x790d('0x18')](function(_0x563209){logger[_0x790d('0x24')]('['+[_0x34daca[_0x790d('0x19')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x790d('0x56')](_0x563209,{'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 73fed14..a0fcb49 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 _0x859b=['util','./salesforce','./zoho','./vtiger','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','servicenow','exec','includes','data1','toLowerCase','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','dynamics365','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','lodash'];(function(_0x1f7962,_0x181f16){var _0x3af491=function(_0x504ecf){while(--_0x504ecf){_0x1f7962['push'](_0x1f7962['shift']());}};_0x3af491(++_0x181f16);}(_0x859b,0x149));var _0xb859=function(_0x19fe24,_0x47a3b5){_0x19fe24=_0x19fe24-0x0;var _0x211c0a=_0x859b[_0x19fe24];return _0x211c0a;};'use strict';var _=require(_0xb859('0x0'));var util=require(_0xb859('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0xb859('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require(_0xb859('0x3'));var desk=require('./desk');var vtiger=require(_0xb859('0x4'));var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require(_0xb859('0x5'));var integrations=[_0xb859('0x6'),_0xb859('0x7'),_0xb859('0x8'),_0xb859('0x9'),_0xb859('0xa'),_0xb859('0xb'),_0xb859('0xc'),'dynamics365','freshsales',_0xb859('0xd')];exports[_0xb859('0xe')]=function(_0x99f4de,_0x54a7f0,_0x2aed7b,_0x33f474,_0x1f364b,_0x26e7ff){if(_0x2aed7b){if(_[_0xb859('0xf')](integrations,_0x99f4de[_0xb859('0x10')][_0xb859('0x11')]())){try{var _0x550bc4=null;var _0x29bcf1='';var _0x1ff913=_0x2aed7b[_0x99f4de[_0xb859('0x10')][_0xb859('0x11')]()];if(_0x1ff913){var _0x5e4b3c=_0x1ff913[_0x99f4de['data2']];if(_0x5e4b3c){var _0x5d382f=_[_0xb859('0x12')](_0x5e4b3c[_0xb859('0x13')],{'id':parseInt(_0x99f4de['data3'],0xa)});if(_0x5d382f){if(_0x33f474){if(_0x1f364b&&_0x54a7f0[_0xb859('0x14')]){_0x29bcf1=_0xb859('0x14');}else if(_0x54a7f0[_0xb859('0x15')]){_0x29bcf1=_0xb859('0x16');}else{console[_0xb859('0x17')](_0xb859('0x18'),_0x54a7f0);}}else{_0x29bcf1=_0xb859('0x19');}switch(_0x99f4de[_0xb859('0x10')][_0xb859('0x11')]()){case _0xb859('0x6'):zendesk[_0x29bcf1](_0x99f4de,_0x54a7f0,_0x5d382f,_0x33f474,_0x1f364b,_0x5e4b3c,_0x26e7ff);break;case _0xb859('0x7'):salesforce[_0x29bcf1](_0x99f4de,_0x54a7f0,_0x5d382f,_0x33f474,_0x1f364b,_0x5e4b3c,_0x26e7ff);break;case _0xb859('0x8'):sugarcrm[_0x29bcf1](_0x99f4de,_0x54a7f0,_0x5d382f,_0x33f474,_0x1f364b,_0x5e4b3c,_0x26e7ff);break;case'freshdesk':freshdesk[_0x29bcf1](_0x99f4de,_0x54a7f0,_0x5d382f,_0x33f474,_0x1f364b,_0x5e4b3c,_0x26e7ff);break;case'zoho':zoho[_0x29bcf1](_0x99f4de,_0x54a7f0,_0x5d382f,_0x33f474,_0x1f364b,_0x5e4b3c,_0x26e7ff);break;case _0xb859('0xb'):desk[_0x29bcf1](_0x99f4de,_0x54a7f0,_0x5d382f,_0x33f474,_0x1f364b,_0x5e4b3c,_0x26e7ff);break;case _0xb859('0xc'):vtiger[_0x29bcf1](_0x99f4de,_0x54a7f0,_0x5d382f,_0x33f474,_0x1f364b,_0x5e4b3c,_0x26e7ff);break;case'freshsales':freshsales['cs'](_0x99f4de,_0x54a7f0,_0x5d382f,_0x33f474,_0x1f364b,_0x5e4b3c,_0x26e7ff,_0x29bcf1);break;case'servicenow':servicenow['cs'](_0x99f4de,_0x54a7f0,_0x5d382f,_0x33f474,_0x1f364b,_0x5e4b3c,_0x26e7ff,_0x29bcf1);break;case _0xb859('0x1a'):dynamics365['cs'](_0x99f4de,_0x54a7f0,_0x5d382f,_0x33f474,_0x1f364b,_0x5e4b3c,_0x26e7ff,_0x29bcf1);break;default:console[_0xb859('0x17')]('unknown\x20integration');}}else{_0x550bc4=require(_0xb859('0x1b'))(_0x99f4de['data1'][_0xb859('0x11')]());_0x550bc4[_0xb859('0x1c')](_0xb859('0x1d'),util[_0xb859('0x1e')](_0xb859('0x1f'),_0x99f4de[_0xb859('0x10')][_0xb859('0x11')](),_0x99f4de[_0xb859('0x20')]));}}else{_0x550bc4=require(_0xb859('0x1b'))(_0x99f4de[_0xb859('0x10')]['toLowerCase']());_0x550bc4[_0xb859('0x1c')]('[EXEC]',util['format']('%s\x20account\x20#%s\x20not\x20found',_0x99f4de[_0xb859('0x10')][_0xb859('0x11')](),_0x99f4de['data2']));}}else{}}catch(_0x71a938){console['error'](_0x71a938);}}}}; \ No newline at end of file +var _0x87dd=['exec','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','zendesk','../../../../config/logger','error','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','sugarcrm','freshdesk','zoho','desk','vtiger','freshsales','servicenow'];(function(_0x1ffd08,_0x1a8839){var _0xd9e6ad=function(_0x29879a){while(--_0x29879a){_0x1ffd08['push'](_0x1ffd08['shift']());}};_0xd9e6ad(++_0x1a8839);}(_0x87dd,0x193));var _0xd87d=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0x87dd[_0x528575];return _0x3063b7;};'use strict';var _=require('lodash');var util=require(_0xd87d('0x0'));var zendesk=require(_0xd87d('0x1'));var salesforce=require(_0xd87d('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xd87d('0x3'));var zoho=require(_0xd87d('0x4'));var desk=require(_0xd87d('0x5'));var vtiger=require(_0xd87d('0x6'));var servicenow=require(_0xd87d('0x7'));var dynamics365=require(_0xd87d('0x8'));var freshsales=require(_0xd87d('0x9'));var integrations=['zendesk','salesforce',_0xd87d('0xa'),_0xd87d('0xb'),_0xd87d('0xc'),_0xd87d('0xd'),_0xd87d('0xe'),'dynamics365',_0xd87d('0xf'),_0xd87d('0x10')];exports[_0xd87d('0x11')]=function(_0xf40bb2,_0x5065a5,_0x4295b5,_0x13ba44,_0x55db84,_0x4980d5){if(_0x4295b5){if(_['includes'](integrations,_0xf40bb2[_0xd87d('0x12')][_0xd87d('0x13')]())){try{var _0xaac45c=null;var _0x3f3f26='';var _0x4a5baa=_0x4295b5[_0xf40bb2[_0xd87d('0x12')][_0xd87d('0x13')]()];if(_0x4a5baa){var _0x5a563c=_0x4a5baa[_0xf40bb2[_0xd87d('0x14')]];if(_0x5a563c){var _0x204782=_[_0xd87d('0x15')](_0x5a563c[_0xd87d('0x16')],{'id':parseInt(_0xf40bb2[_0xd87d('0x17')],0xa)});if(_0x204782){if(_0x13ba44){if(_0x55db84&&_0x5065a5[_0xd87d('0x18')]){_0x3f3f26=_0xd87d('0x18');}else if(_0x5065a5[_0xd87d('0x19')]){_0x3f3f26=_0xd87d('0x1a');}else{console[_0xd87d('0x1b')](_0xd87d('0x1c'),_0x5065a5);}}else{_0x3f3f26='unmanaged';}switch(_0xf40bb2[_0xd87d('0x12')][_0xd87d('0x13')]()){case _0xd87d('0x1d'):zendesk[_0x3f3f26](_0xf40bb2,_0x5065a5,_0x204782,_0x13ba44,_0x55db84,_0x5a563c,_0x4980d5);break;case'salesforce':salesforce[_0x3f3f26](_0xf40bb2,_0x5065a5,_0x204782,_0x13ba44,_0x55db84,_0x5a563c,_0x4980d5);break;case _0xd87d('0xa'):sugarcrm[_0x3f3f26](_0xf40bb2,_0x5065a5,_0x204782,_0x13ba44,_0x55db84,_0x5a563c,_0x4980d5);break;case _0xd87d('0xb'):freshdesk[_0x3f3f26](_0xf40bb2,_0x5065a5,_0x204782,_0x13ba44,_0x55db84,_0x5a563c,_0x4980d5);break;case _0xd87d('0xc'):zoho[_0x3f3f26](_0xf40bb2,_0x5065a5,_0x204782,_0x13ba44,_0x55db84,_0x5a563c,_0x4980d5);break;case'desk':desk[_0x3f3f26](_0xf40bb2,_0x5065a5,_0x204782,_0x13ba44,_0x55db84,_0x5a563c,_0x4980d5);break;case _0xd87d('0xe'):vtiger[_0x3f3f26](_0xf40bb2,_0x5065a5,_0x204782,_0x13ba44,_0x55db84,_0x5a563c,_0x4980d5);break;case _0xd87d('0xf'):freshsales['cs'](_0xf40bb2,_0x5065a5,_0x204782,_0x13ba44,_0x55db84,_0x5a563c,_0x4980d5,_0x3f3f26);break;case _0xd87d('0x10'):servicenow['cs'](_0xf40bb2,_0x5065a5,_0x204782,_0x13ba44,_0x55db84,_0x5a563c,_0x4980d5,_0x3f3f26);break;case'dynamics365':dynamics365['cs'](_0xf40bb2,_0x5065a5,_0x204782,_0x13ba44,_0x55db84,_0x5a563c,_0x4980d5,_0x3f3f26);break;default:console['log']('unknown\x20integration');}}else{_0xaac45c=require(_0xd87d('0x1e'))(_0xf40bb2[_0xd87d('0x12')][_0xd87d('0x13')]());_0xaac45c[_0xd87d('0x1f')](_0xd87d('0x20'),util[_0xd87d('0x21')]('%s\x20configuration\x20#%s\x20not\x20found',_0xf40bb2['data1'][_0xd87d('0x13')](),_0xf40bb2[_0xd87d('0x17')]));}}else{_0xaac45c=require(_0xd87d('0x1e'))(_0xf40bb2[_0xd87d('0x12')][_0xd87d('0x13')]());_0xaac45c[_0xd87d('0x1f')](_0xd87d('0x20'),util[_0xd87d('0x21')](_0xd87d('0x22'),_0xf40bb2[_0xd87d('0x12')][_0xd87d('0x13')](),_0xf40bb2[_0xd87d('0x14')]));}}else{}}catch(_0x32c0c7){console['error'](_0x32c0c7);}}}}; \ 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 72a07af..15e897c 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 _0x0986=['md5','jsforce','util','ioredis','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','endUserType','contact','lead','WhoId','WhatId','Case','ContactId','AccountId','leadId','info','sobject','isNil','validateEmail','User','execute','then','find','Email','Agent\x20%s\x20found.','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','additionalSearchContact','merge','$or','Contact','additionalSearchLead','account_contact_lead','cloneDeep','additionalSearchAccount','length','Lead','account','first','Name','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','Caller\x20-\x20%s','format','No\x20Company','upperFirst','create','forEach','includes','string','toString','idField','variableName','customVariable','Variable','name','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','queue','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','outbound','serverUrl','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','bluebird'];(function(_0x21f8b1,_0x496b9d){var _0x173733=function(_0x420789){while(--_0x420789){_0x21f8b1['push'](_0x21f8b1['shift']());}};_0x173733(++_0x496b9d);}(_0x0986,0x17f));var _0x6098=function(_0x18ab6c,_0x87743b){_0x18ab6c=_0x18ab6c-0x0;var _0x30d073=_0x0986[_0x18ab6c];return _0x30d073;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6098('0x0'));var md5=require(_0x6098('0x1'));var jsforce=require(_0x6098('0x2'));var util=require(_0x6098('0x3'));var Redis=require(_0x6098('0x4'));var intUtil=require(_0x6098('0x5'));var config=require('../../../../config/environment');var logger=require(_0x6098('0x6'))('salesforce');config[_0x6098('0x7')]=_[_0x6098('0x8')](config['redis'],{'host':_0x6098('0x9'),'port':0x18eb});var io=require(_0x6098('0xa'))(new Redis(config[_0x6098('0x7')]));function emit(_0x49eb9e,_0x49450f,_0xe0de29){io['to'](_0x49eb9e)['emit'](_0x49450f,_0xe0de29);}function getTicket(_0x1623db,_0x194bea,_0x4b1b8f,_0x4029cf,_0x3c21ed,_0x1cf191,_0x1915f4,_0x443ba8){var _0x1941b4=Object['assign']({},{'OwnerId':_0x194bea['id'],'Subject':intUtil[_0x6098('0xb')](_0x4029cf[_0x6098('0xc')],_0x3c21ed,'\x20'),'Description':intUtil[_0x6098('0xb')](_0x4029cf[_0x6098('0xd')],_0x3c21ed,'\x0a')},getCustomFields(_0x1cf191,_0x3c21ed));if(_0x4b1b8f){if(_0x4029cf[_0x6098('0xe')]===_0x6098('0xf')){_0x1941b4[_0x6098('0x10')]=moment[_0x6098('0x11')]();_0x1941b4['IsReminderSet']=![];_0x1941b4['IsRecurrence']=![];if(_0x4b1b8f[_0x6098('0x12')]===_0x6098('0x13')||_0x4b1b8f[_0x6098('0x12')]===_0x6098('0x14')){_0x1941b4[_0x6098('0x15')]=_0x4b1b8f['id'];}else if(_0x4b1b8f[_0x6098('0x12')]==='account'){_0x1941b4[_0x6098('0x16')]=_0x4b1b8f['id'];}}else if(_0x4029cf['ticketType']===_0x6098('0x17')){if(_0x4b1b8f[_0x6098('0x12')]==='contact'){_0x1941b4[_0x6098('0x18')]=_0x4b1b8f['id'];}else if(_0x4b1b8f['endUserType']==='account'){_0x1941b4[_0x6098('0x19')]=_0x4b1b8f['id'];}else if(_0x4b1b8f['endUserType']===_0x6098('0x14')&&_0x4029cf[_0x6098('0x1a')]){_0x1941b4[_0x4029cf[_0x6098('0x1a')]]=_0x4b1b8f['id'];}else{logger[_0x6098('0x1b')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x1915f4[_0x6098('0x1c')](_0x4029cf[_0x6098('0xe')])['create'](_0x1941b4);}function getUser(_0x245900,_0x4623c5,_0x375783){if(!_[_0x6098('0x1d')](_0x4623c5)&&intUtil[_0x6098('0x1e')](_0x4623c5)){var _0x356592={'Email':_0x4623c5};var _0x1d379e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x375783[_0x6098('0x1c')](_0x6098('0x1f'))['find'](_0x356592,_0x1d379e)[_0x6098('0x20')]()[_0x6098('0x21')](function(_0xe25b30){if(_0xe25b30['length']){var _0xd75960=_[_0x6098('0x22')](_0xe25b30,function(_0x81704f){return _0x81704f[_0x6098('0x23')]===_0x4623c5;});if(_0xd75960){logger[_0x6098('0x1b')](_0x6098('0x24'),_0x4623c5);return BPromise['resolve']({'id':_0xd75960['Id'],'name':_0xd75960['Name']});}}else{logger[_0x6098('0x1b')](_0x6098('0x25'),_0x4623c5);return _0x375783[_0x6098('0x26')]()[_0x6098('0x21')](function(_0x32f614){return BPromise[_0x6098('0x27')]({'id':_0x32f614[_0x6098('0x28')],'name':_0x32f614[_0x6098('0x29')]});});}});}else{logger[_0x6098('0x1b')](_0x6098('0x25'),_0x4623c5);return _0x375783[_0x6098('0x26')]()[_0x6098('0x21')](function(_0x757d4e){return BPromise['resolve']({'id':_0x757d4e[_0x6098('0x28')],'name':_0x757d4e['display_name']});});}}function getEndUser(_0x3a38bb,_0x198400,_0x332ca0,_0x298b6b,_0x401639){var _0x55171f={'$or':{'Phone':_0x298b6b}};var _0x2dfd9a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x6098('0x27')]()['then'](function(){logger[_0x6098('0x1b')](_0x6098('0x2a'),_0x298b6b,_0x198400[_0x6098('0x2b')]);switch(_0x198400['moduleSearch']){case'contact_lead':var _0x141a3e=_['cloneDeep'](_0x55171f);if(_0x198400[_0x6098('0x2c')]){var _0x2636fa={};_0x2636fa[_0x198400[_0x6098('0x2c')]]=_0x298b6b;_[_0x6098('0x2d')](_0x141a3e[_0x6098('0x2e')],_0x2636fa);}return _0x401639[_0x6098('0x1c')](_0x6098('0x2f'))[_0x6098('0x22')](_0x141a3e,_0x2dfd9a)[_0x6098('0x20')]()[_0x6098('0x21')](function(_0x592011){if(_0x592011&&_0x592011['length']){return _0x592011;}else{var _0x1cf3f9=_['cloneDeep'](_0x55171f);if(_0x198400[_0x6098('0x30')]){var _0x2cb089={};_0x2cb089[_0x198400['additionalSearchLead']]=_0x298b6b;_[_0x6098('0x2d')](_0x1cf3f9[_0x6098('0x2e')],_0x2cb089);}return _0x401639[_0x6098('0x1c')]('Lead')[_0x6098('0x22')](_0x1cf3f9,_0x2dfd9a);}});case _0x6098('0x31'):var _0x1addad=_[_0x6098('0x32')](_0x55171f);if(_0x198400[_0x6098('0x33')]){var _0x2636fa={};_0x2636fa[_0x198400[_0x6098('0x33')]]=_0x298b6b;_[_0x6098('0x2d')](_0x1addad[_0x6098('0x2e')],_0x2636fa);}return _0x401639[_0x6098('0x1c')]('Account')[_0x6098('0x22')](_0x1addad,_0x2dfd9a)[_0x6098('0x20')]()[_0x6098('0x21')](function(_0x1869f1){if(_0x1869f1&&_0x1869f1['length']){return _0x1869f1;}else{var _0x551283=_[_0x6098('0x32')](_0x55171f);if(_0x198400[_0x6098('0x2c')]){var _0x23e138={};_0x23e138[_0x198400[_0x6098('0x2c')]]=_0x298b6b;_['merge'](_0x551283[_0x6098('0x2e')],_0x23e138);}return _0x401639[_0x6098('0x1c')]('Contact')[_0x6098('0x22')](_0x551283,_0x2dfd9a)[_0x6098('0x21')](function(_0x1216b2){if(_0x1216b2&&_0x1216b2[_0x6098('0x34')]){return _0x1216b2;}else{var _0xdb4105=_[_0x6098('0x32')](_0x55171f);if(_0x198400[_0x6098('0x30')]){var _0x445269={};_0x445269[_0x198400[_0x6098('0x30')]]=_0x298b6b;_[_0x6098('0x2d')](_0xdb4105[_0x6098('0x2e')],_0x445269);}return _0x401639['sobject'](_0x6098('0x35'))[_0x6098('0x22')](_0xdb4105,_0x2dfd9a);}});}});case'contact':var _0x141a3e=_[_0x6098('0x32')](_0x55171f);if(_0x198400[_0x6098('0x2c')]){var _0x2636fa={};_0x2636fa[_0x198400[_0x6098('0x2c')]]=_0x298b6b;_[_0x6098('0x2d')](_0x141a3e['$or'],_0x2636fa);}return _0x401639[_0x6098('0x1c')](_0x6098('0x2f'))['find'](_0x141a3e,_0x2dfd9a)[_0x6098('0x20')]();case _0x6098('0x14'):var _0x1fef0d=_[_0x6098('0x32')](_0x55171f);if(_0x198400[_0x6098('0x30')]){var _0x2636fa={};_0x2636fa[_0x198400[_0x6098('0x30')]]=_0x298b6b;_[_0x6098('0x2d')](_0x1fef0d[_0x6098('0x2e')],_0x2636fa);}return _0x401639['sobject'](_0x6098('0x35'))[_0x6098('0x22')](_0x1fef0d,_0x2dfd9a);case _0x6098('0x36'):var _0x1addad=_[_0x6098('0x32')](_0x55171f);if(_0x198400[_0x6098('0x33')]){var _0x2636fa={};_0x2636fa[_0x198400[_0x6098('0x33')]]=_0x298b6b;_[_0x6098('0x2d')](_0x1addad[_0x6098('0x2e')],_0x2636fa);}return _0x401639[_0x6098('0x1c')]('Account')[_0x6098('0x22')](_0x1addad,_0x2dfd9a);default:return null;}})[_0x6098('0x21')](function(_0x139639){if(_0x139639&&_0x139639[_0x6098('0x34')]){var _0x5d364d=_[_0x6098('0x37')](_0x139639);if(_0x5d364d){return BPromise[_0x6098('0x27')]({'id':_0x5d364d['Id'],'name':_0x5d364d[_0x6098('0x38')],'phone':_0x5d364d[_0x6098('0x39')],'endUserType':_0x5d364d[_0x6098('0x3a')][_0x6098('0x3b')][_0x6098('0x3c')]()});}}})['then'](function(_0x494f39){if(_0x494f39){logger['info'](_0x6098('0x3d'),_0x494f39[_0x6098('0x12')],_0x298b6b);return BPromise[_0x6098('0x27')](_0x494f39);}else{logger[_0x6098('0x1b')](_0x6098('0x3e'),_0x298b6b);var _0x53c397={'Phone':_0x298b6b};if(_0x198400['moduleCreate']){if(_0x198400[_0x6098('0x3f')]===_0x6098('0x13')){logger['info'](_0x6098('0x40'),_0x298b6b,_0x198400[_0x6098('0x3f')]);_0x53c397[_0x6098('0x41')]=_0x332ca0!==_0x6098('0x42')?_0x332ca0:util['format'](_0x6098('0x43'),_0x298b6b);}else if(_0x198400[_0x6098('0x3f')]===_0x6098('0x14')){logger[_0x6098('0x1b')](_0x6098('0x40'),_0x298b6b,_0x198400[_0x6098('0x3f')]);_0x53c397['LastName']=_0x332ca0!==_0x6098('0x42')?_0x332ca0:util[_0x6098('0x44')](_0x6098('0x43'),_0x298b6b);_0x53c397['Company']=_0x6098('0x45');}else if(_0x198400[_0x6098('0x3f')]===_0x6098('0x36')){logger[_0x6098('0x1b')](_0x6098('0x40'),_0x298b6b,_0x198400[_0x6098('0x3f')]);_0x53c397[_0x6098('0x38')]=_0x332ca0!==_0x6098('0x42')?_0x332ca0:util[_0x6098('0x44')](_0x6098('0x43'),_0x298b6b);}else{return null;}}return _0x401639[_0x6098('0x1c')](_[_0x6098('0x46')](_0x198400[_0x6098('0x3f')]))[_0x6098('0x47')](_0x53c397)[_0x6098('0x21')](function(_0x2303e2){return BPromise[_0x6098('0x27')]({'id':_0x2303e2['id'],'endUserType':_0x198400['moduleCreate']});});}});}function getCustomFields(_0x5532d1,_0x5397bb){var _0x239794={};if(_0x5532d1[_0x6098('0x34')]>0x0){_[_0x6098('0x48')](_0x5532d1,function(_0x246cfc){if(_[_0x6098('0x49')]([_0x6098('0x4a'),'picklist'],_0x246cfc[_0x6098('0x3b')])&&_0x246cfc['idField']){_0x239794[_0x246cfc['idField']]=_0x246cfc['content'][_0x6098('0x4b')]();}else if(_0x246cfc[_0x6098('0x3b')]==='variable'&&_0x246cfc['variableName']&&_0x246cfc[_0x6098('0x4c')]){_0x5397bb[_0x246cfc[_0x6098('0x4d')]]&&(_0x239794[_0x246cfc['idField']]=_0x5397bb[_0x246cfc[_0x6098('0x4d')]]['toString']());}else if(_0x246cfc['type']===_0x6098('0x4e')&&_0x246cfc[_0x6098('0x4f')]&&_0x246cfc[_0x6098('0x4f')][_0x6098('0x50')]&&_0x246cfc[_0x6098('0x4c')]){_0x5397bb[_0x246cfc['Variable'][_0x6098('0x50')][_0x6098('0x3c')]()]&&(_0x239794[_0x246cfc[_0x6098('0x4c')]]=_0x5397bb[_0x246cfc['Variable'][_0x6098('0x50')][_0x6098('0x3c')]()][_0x6098('0x4b')]());}});}return _0x239794;}function getConnection(_0x537789){var _0x38db20=_0x537789[_0x6098('0x51')][_0x6098('0x52')](_0x537789[_0x6098('0x53')]);var _0x3ad54b=new jsforce['Connection']({'oauth2':{'loginUrl':_0x537789[_0x6098('0x54')]||_0x6098('0x55'),'clientId':_0x537789[_0x6098('0x56')],'clientSecret':_0x537789[_0x6098('0x57')]}});return _0x3ad54b[_0x6098('0x58')](_0x537789[_0x6098('0x59')],_0x38db20)[_0x6098('0x21')](function(){logger[_0x6098('0x1b')]('Connection\x20established.');return _0x3ad54b;});}exports[_0x6098('0x5a')]=function(_0x575440,_0x375aa4,_0x53f672,_0x14e3c7,_0x183e81,_0x1b42aa){var _0xf47ec1,_0x318301,_0x512e4d,_0x3dc229;_0x1b42aa['serverUrl']=intUtil[_0x6098('0x5b')](_0x1b42aa['serverUrl']);_0x1b42aa[_0x6098('0x54')]=intUtil[_0x6098('0x5b')](_0x1b42aa[_0x6098('0x54')]);if(_0x183e81&&_0x183e81[_0x6098('0x5c')]){logger[_0x6098('0x1b')](_0x6098('0x5d'),'Recording\x20is\x20enabled!');_0x375aa4[_0x6098('0x5e')]=util[_0x6098('0x44')](_0x6098('0x5f'),_0x1b42aa['serverUrl'],_0x375aa4[_0x6098('0x60')],md5(_0x375aa4[_0x6098('0x60')]));}else{_0x375aa4[_0x6098('0x5e')]='';}return getConnection(_0x1b42aa)[_0x6098('0x21')](function(_0x51df61){_0x3dc229=_0x51df61;return getUser(_0x1b42aa,_0x14e3c7[_0x6098('0x61')],_0x3dc229);})[_0x6098('0x21')](function(_0x1ee6c8){_0xf47ec1=_0x1ee6c8;return getEndUser(_0x1b42aa,_0x53f672,_0x375aa4[_0x6098('0x62')],_0x375aa4[_0x6098('0x63')],_0x3dc229);})[_0x6098('0x21')](function(_0xc37020){_0x318301=_0xc37020;return getTicket(_0x1b42aa,_0xf47ec1,_0x318301,_0x53f672,_0x375aa4,_0x53f672['Fields'],_0x3dc229,_0x6098('0x5a'));})[_0x6098('0x21')](function(_0x2c28b5){_0x512e4d=_0x2c28b5;logger[_0x6098('0x1b')](_0x6098('0x64'),_0x512e4d['id']);logger[_0x6098('0x1b')](_0x6098('0x65'),_0x512e4d['id'],_0x14e3c7['name'],_0x1b42aa[_0x6098('0x3b')]);switch(_0x1b42aa[_0x6098('0x3b')]){case _0x6098('0x66'):emit(util[_0x6098('0x44')]('user:%s',_0x14e3c7['name']),_0x6098('0x67'),{'recordId':_0x512e4d['id']});break;case _0x6098('0x68'):emit(util[_0x6098('0x44')](_0x6098('0x69'),_0x14e3c7[_0x6098('0x50')]),_0x6098('0x6a'),{'uri':util[_0x6098('0x44')](_0x6098('0x6b'),_0x3dc229[_0x6098('0x6c')],_0x512e4d['id'])});break;default:logger[_0x6098('0x6d')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x6098('0x6e')](function(_0x181a21){logger['error'](_0x6098('0x5d'),_0x181a21);});};exports[_0x6098('0x6f')]=function(_0x19e15b,_0xbb7285,_0x340622,_0x469a6b,_0x59efd7,_0x5916cd,_0x4f639d){var _0x3b2935,_0x40b838,_0x350190,_0x1a979b;_0x5916cd[_0x6098('0x70')]=intUtil[_0x6098('0x5b')](_0x5916cd[_0x6098('0x70')]);_0x5916cd[_0x6098('0x54')]=intUtil[_0x6098('0x5b')](_0x5916cd['remoteUri']);if(_0x4f639d&&_0x4f639d[_0x6098('0x71')]&&_0x4f639d[_0x6098('0x71')]!==_0x6098('0x72')){logger[_0x6098('0x1b')](_0x6098('0x73'),_0x6098('0x74'));_0xbb7285[_0x6098('0x5e')]=util['format'](_0x6098('0x5f'),_0x5916cd['serverUrl'],_0xbb7285[_0x6098('0x60')],md5(_0xbb7285[_0x6098('0x60')]));}return getConnection(_0x5916cd)[_0x6098('0x21')](function(_0xbac737){_0x1a979b=_0xbac737;return getUser(_0x5916cd,_0x469a6b['email'],_0x1a979b);})['then'](function(_0x3e1e8f){_0x3b2935=_0x3e1e8f;return getEndUser(_0x5916cd,_0x340622,_0xbb7285[_0x6098('0x75')],_0xbb7285[_0x6098('0x76')],_0x1a979b);})[_0x6098('0x21')](function(_0x24fccd){_0x40b838=_0x24fccd;return getTicket(_0x5916cd,_0x3b2935,_0x40b838,_0x340622,_0xbb7285,_0x340622[_0x6098('0x77')],_0x1a979b,_0x6098('0x6f'));})[_0x6098('0x21')](function(_0x539b86){_0x350190=_0x539b86;logger[_0x6098('0x1b')](_0x6098('0x78'),_0x350190['id']);logger[_0x6098('0x1b')](_0x6098('0x79'),_0x350190['id'],_0x469a6b[_0x6098('0x50')],_0x5916cd[_0x6098('0x3b')]);switch(_0x5916cd[_0x6098('0x3b')]){case _0x6098('0x66'):emit(util[_0x6098('0x44')](_0x6098('0x69'),_0x469a6b['name']),'trigger:salesforce:display',{'recordId':_0x350190['id']});break;case _0x6098('0x68'):emit(util[_0x6098('0x44')](_0x6098('0x69'),_0x469a6b['name']),_0x6098('0x6a'),{'uri':util[_0x6098('0x44')](_0x6098('0x6b'),_0x1a979b[_0x6098('0x6c')],_0x350190['id'])});break;default:logger[_0x6098('0x6d')](_0x6098('0x73'),_0x6098('0x7a'));}})['catch'](function(_0x5d46a5){logger[_0x6098('0x6d')](_0x6098('0x73'),_0x5d46a5);});};exports[_0x6098('0x7b')]=function(_0x4cf334,_0x4e11bd,_0x41e9d4,_0x5bbb17,_0x549ab8,_0x3a446b){var _0x33930b,_0x13cfa3,_0x29896a,_0x3120fb;_0x3a446b[_0x6098('0x70')]=intUtil[_0x6098('0x5b')](_0x3a446b[_0x6098('0x70')]);_0x3a446b[_0x6098('0x54')]=intUtil[_0x6098('0x5b')](_0x3a446b[_0x6098('0x54')]);if(_0x549ab8&&_0x549ab8[_0x6098('0x5c')]){logger[_0x6098('0x1b')]('['+_0x4e11bd[_0x6098('0x7c')][_0x6098('0x7d')]()+']',_0x6098('0x74'));_0x4e11bd[_0x6098('0x5e')]=util[_0x6098('0x44')](_0x6098('0x5f'),_0x3a446b[_0x6098('0x70')],_0x4e11bd['uniqueid'],md5(_0x4e11bd[_0x6098('0x60')]));}else{_0x4e11bd[_0x6098('0x5e')]='';}return getConnection(_0x3a446b)[_0x6098('0x21')](function(_0x3989d3){_0x3120fb=_0x3989d3;if(!_[_0x6098('0x1d')](_0x5bbb17)){return getUser(_0x3a446b,_0x5bbb17[_0x6098('0x50')],_0x3120fb);}else{return getUser(_0x3a446b,null,_0x3120fb);}})[_0x6098('0x21')](function(_0x2c5154){_0x33930b=_0x2c5154;return getEndUser(_0x3a446b,_0x41e9d4,_0x4e11bd['calleridname'],_0x4e11bd['calleridnum'],_0x3120fb);})[_0x6098('0x21')](function(_0x20a515){_0x13cfa3=_0x20a515;return getTicket(_0x3a446b,_0x33930b,_0x13cfa3,_0x41e9d4,_0x4e11bd,_0x41e9d4[_0x6098('0x77')],_0x3120fb);})[_0x6098('0x21')](function(_0x4da9d2){_0x29896a=_0x4da9d2;logger[_0x6098('0x1b')]('['+_0x4e11bd['lastevent'][_0x6098('0x7d')]()+_0x6098('0x7e'),_0x29896a['id']);logger[_0x6098('0x1b')]('['+_0x4e11bd['lastevent'][_0x6098('0x7d')]()+_0x6098('0x7f'),_0x3a446b[_0x6098('0x3b')]);})[_0x6098('0x6e')](function(_0x1184f7){logger[_0x6098('0x6d')]('['+_0x4e11bd[_0x6098('0x7c')][_0x6098('0x7d')]()+']',_0x1184f7);});}; \ No newline at end of file +var _0xe649=['[QUEUE]','recordingURL','uniqueid','email','calleridname','calleridnum','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','catch','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','%s/%s/e','[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','endUserType','contact','lead','WhoId','account','Case','ContactId','AccountId','leadId','sobject','create','isNil','validateEmail','User','find','length','Email','info','Agent\x20%s\x20found.','resolve','identity','then','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','execute','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','Name','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','forEach','idField','content','toString','variable','variableName','Variable','name','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','monitor_format'];(function(_0x58ded3,_0x3844d6){var _0x3ffeb1=function(_0x586bfa){while(--_0x586bfa){_0x58ded3['push'](_0x58ded3['shift']());}};_0x3ffeb1(++_0x3844d6);}(_0xe649,0x11d));var _0x9e64=function(_0x524180,_0xfaea9d){_0x524180=_0x524180-0x0;var _0x30e196=_0xe649[_0x524180];return _0x30e196;};'use strict';var _=require(_0x9e64('0x0'));var rp=require(_0x9e64('0x1'));var moment=require(_0x9e64('0x2'));var BPromise=require('bluebird');var md5=require(_0x9e64('0x3'));var jsforce=require(_0x9e64('0x4'));var util=require(_0x9e64('0x5'));var Redis=require(_0x9e64('0x6'));var intUtil=require(_0x9e64('0x7'));var config=require(_0x9e64('0x8'));var logger=require(_0x9e64('0x9'))('salesforce');config[_0x9e64('0xa')]=_[_0x9e64('0xb')](config[_0x9e64('0xa')],{'host':_0x9e64('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9e64('0xa')]));function emit(_0x60953,_0x382d19,_0x638714){io['to'](_0x60953)['emit'](_0x382d19,_0x638714);}function getTicket(_0x4763ac,_0x40e415,_0xe8d858,_0x11c10c,_0x5f1c98,_0x7f4b98,_0x497830,_0x2e89b3){var _0x34177c=Object[_0x9e64('0xd')]({},{'OwnerId':_0x40e415['id'],'Subject':intUtil[_0x9e64('0xe')](_0x11c10c[_0x9e64('0xf')],_0x5f1c98,'\x20'),'Description':intUtil[_0x9e64('0xe')](_0x11c10c[_0x9e64('0x10')],_0x5f1c98,'\x0a')},getCustomFields(_0x7f4b98,_0x5f1c98));if(_0xe8d858){if(_0x11c10c[_0x9e64('0x11')]===_0x9e64('0x12')){_0x34177c[_0x9e64('0x13')]=moment['utc']();_0x34177c['IsReminderSet']=![];_0x34177c['IsRecurrence']=![];if(_0xe8d858[_0x9e64('0x14')]===_0x9e64('0x15')||_0xe8d858[_0x9e64('0x14')]===_0x9e64('0x16')){_0x34177c[_0x9e64('0x17')]=_0xe8d858['id'];}else if(_0xe8d858[_0x9e64('0x14')]===_0x9e64('0x18')){_0x34177c['WhatId']=_0xe8d858['id'];}}else if(_0x11c10c[_0x9e64('0x11')]===_0x9e64('0x19')){if(_0xe8d858['endUserType']===_0x9e64('0x15')){_0x34177c[_0x9e64('0x1a')]=_0xe8d858['id'];}else if(_0xe8d858[_0x9e64('0x14')]===_0x9e64('0x18')){_0x34177c[_0x9e64('0x1b')]=_0xe8d858['id'];}else if(_0xe8d858[_0x9e64('0x14')]===_0x9e64('0x16')&&_0x11c10c['leadId']){_0x34177c[_0x11c10c[_0x9e64('0x1c')]]=_0xe8d858['id'];}else{logger['info']('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x497830[_0x9e64('0x1d')](_0x11c10c[_0x9e64('0x11')])[_0x9e64('0x1e')](_0x34177c);}function getUser(_0xaf480c,_0xd13d9d,_0x392e52){if(!_[_0x9e64('0x1f')](_0xd13d9d)&&intUtil[_0x9e64('0x20')](_0xd13d9d)){var _0x207de8={'Email':_0xd13d9d};var _0xa3ab04={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x392e52[_0x9e64('0x1d')](_0x9e64('0x21'))[_0x9e64('0x22')](_0x207de8,_0xa3ab04)['execute']()['then'](function(_0x1c456b){if(_0x1c456b[_0x9e64('0x23')]){var _0xe2bfc8=_[_0x9e64('0x22')](_0x1c456b,function(_0x44fd51){return _0x44fd51[_0x9e64('0x24')]===_0xd13d9d;});if(_0xe2bfc8){logger[_0x9e64('0x25')](_0x9e64('0x26'),_0xd13d9d);return BPromise[_0x9e64('0x27')]({'id':_0xe2bfc8['Id'],'name':_0xe2bfc8['Name']});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0xd13d9d);return _0x392e52[_0x9e64('0x28')]()[_0x9e64('0x29')](function(_0x30c665){return BPromise['resolve']({'id':_0x30c665[_0x9e64('0x2a')],'name':_0x30c665[_0x9e64('0x2b')]});});}});}else{logger[_0x9e64('0x25')](_0x9e64('0x2c'),_0xd13d9d);return _0x392e52[_0x9e64('0x28')]()[_0x9e64('0x29')](function(_0x3b56d2){return BPromise['resolve']({'id':_0x3b56d2[_0x9e64('0x2a')],'name':_0x3b56d2[_0x9e64('0x2b')]});});}}function getEndUser(_0x1515ae,_0x378475,_0x5142af,_0x598574,_0x1c95f9){var _0x5c84a1={'$or':{'Phone':_0x598574}};var _0x35e605={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x9e64('0x27')]()[_0x9e64('0x29')](function(){logger[_0x9e64('0x25')](_0x9e64('0x2d'),_0x598574,_0x378475[_0x9e64('0x2e')]);switch(_0x378475[_0x9e64('0x2e')]){case'contact_lead':var _0x4dd8bb=_[_0x9e64('0x2f')](_0x5c84a1);if(_0x378475[_0x9e64('0x30')]){var _0xa8ce={};_0xa8ce[_0x378475[_0x9e64('0x30')]]=_0x598574;_[_0x9e64('0x31')](_0x4dd8bb[_0x9e64('0x32')],_0xa8ce);}return _0x1c95f9['sobject']('Contact')[_0x9e64('0x22')](_0x4dd8bb,_0x35e605)[_0x9e64('0x33')]()['then'](function(_0x524d94){if(_0x524d94&&_0x524d94[_0x9e64('0x23')]){return _0x524d94;}else{var _0x1244e9=_[_0x9e64('0x2f')](_0x5c84a1);if(_0x378475[_0x9e64('0x34')]){var _0x2c8864={};_0x2c8864[_0x378475[_0x9e64('0x34')]]=_0x598574;_[_0x9e64('0x31')](_0x1244e9[_0x9e64('0x32')],_0x2c8864);}return _0x1c95f9['sobject'](_0x9e64('0x35'))[_0x9e64('0x22')](_0x1244e9,_0x35e605);}});case _0x9e64('0x36'):var _0x5cbceb=_[_0x9e64('0x2f')](_0x5c84a1);if(_0x378475[_0x9e64('0x37')]){var _0xa8ce={};_0xa8ce[_0x378475[_0x9e64('0x37')]]=_0x598574;_[_0x9e64('0x31')](_0x5cbceb[_0x9e64('0x32')],_0xa8ce);}return _0x1c95f9[_0x9e64('0x1d')](_0x9e64('0x38'))[_0x9e64('0x22')](_0x5cbceb,_0x35e605)['execute']()[_0x9e64('0x29')](function(_0x189ba7){if(_0x189ba7&&_0x189ba7[_0x9e64('0x23')]){return _0x189ba7;}else{var _0x251ea0=_[_0x9e64('0x2f')](_0x5c84a1);if(_0x378475[_0x9e64('0x30')]){var _0x50b41e={};_0x50b41e[_0x378475[_0x9e64('0x30')]]=_0x598574;_[_0x9e64('0x31')](_0x251ea0[_0x9e64('0x32')],_0x50b41e);}return _0x1c95f9[_0x9e64('0x1d')](_0x9e64('0x39'))[_0x9e64('0x22')](_0x251ea0,_0x35e605)[_0x9e64('0x29')](function(_0x499a79){if(_0x499a79&&_0x499a79[_0x9e64('0x23')]){return _0x499a79;}else{var _0x22c5a1=_[_0x9e64('0x2f')](_0x5c84a1);if(_0x378475[_0x9e64('0x34')]){var _0x45ed44={};_0x45ed44[_0x378475[_0x9e64('0x34')]]=_0x598574;_[_0x9e64('0x31')](_0x22c5a1[_0x9e64('0x32')],_0x45ed44);}return _0x1c95f9['sobject'](_0x9e64('0x35'))[_0x9e64('0x22')](_0x22c5a1,_0x35e605);}});}});case _0x9e64('0x15'):var _0x4dd8bb=_[_0x9e64('0x2f')](_0x5c84a1);if(_0x378475[_0x9e64('0x30')]){var _0xa8ce={};_0xa8ce[_0x378475[_0x9e64('0x30')]]=_0x598574;_[_0x9e64('0x31')](_0x4dd8bb[_0x9e64('0x32')],_0xa8ce);}return _0x1c95f9[_0x9e64('0x1d')](_0x9e64('0x39'))['find'](_0x4dd8bb,_0x35e605)['execute']();case _0x9e64('0x16'):var _0x198b52=_[_0x9e64('0x2f')](_0x5c84a1);if(_0x378475[_0x9e64('0x34')]){var _0xa8ce={};_0xa8ce[_0x378475[_0x9e64('0x34')]]=_0x598574;_[_0x9e64('0x31')](_0x198b52[_0x9e64('0x32')],_0xa8ce);}return _0x1c95f9['sobject'](_0x9e64('0x35'))[_0x9e64('0x22')](_0x198b52,_0x35e605);case _0x9e64('0x18'):var _0x5cbceb=_[_0x9e64('0x2f')](_0x5c84a1);if(_0x378475[_0x9e64('0x37')]){var _0xa8ce={};_0xa8ce[_0x378475[_0x9e64('0x37')]]=_0x598574;_[_0x9e64('0x31')](_0x5cbceb['$or'],_0xa8ce);}return _0x1c95f9['sobject'](_0x9e64('0x38'))[_0x9e64('0x22')](_0x5cbceb,_0x35e605);default:return null;}})[_0x9e64('0x29')](function(_0x1e4642){if(_0x1e4642&&_0x1e4642[_0x9e64('0x23')]){var _0x48a01f=_['first'](_0x1e4642);if(_0x48a01f){return BPromise[_0x9e64('0x27')]({'id':_0x48a01f['Id'],'name':_0x48a01f[_0x9e64('0x3a')],'phone':_0x48a01f[_0x9e64('0x3b')],'endUserType':_0x48a01f[_0x9e64('0x3c')][_0x9e64('0x3d')][_0x9e64('0x3e')]()});}}})['then'](function(_0x219069){if(_0x219069){logger[_0x9e64('0x25')](_0x9e64('0x3f'),_0x219069[_0x9e64('0x14')],_0x598574);return BPromise[_0x9e64('0x27')](_0x219069);}else{logger[_0x9e64('0x25')](_0x9e64('0x40'),_0x598574);var _0x427bb2={'Phone':_0x598574};if(_0x378475[_0x9e64('0x41')]){if(_0x378475[_0x9e64('0x41')]===_0x9e64('0x15')){logger[_0x9e64('0x25')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x598574,_0x378475['moduleCreate']);_0x427bb2[_0x9e64('0x42')]=_0x5142af!==_0x9e64('0x43')?_0x5142af:util[_0x9e64('0x44')](_0x9e64('0x45'),_0x598574);}else if(_0x378475[_0x9e64('0x41')]===_0x9e64('0x16')){logger[_0x9e64('0x25')](_0x9e64('0x46'),_0x598574,_0x378475[_0x9e64('0x41')]);_0x427bb2['LastName']=_0x5142af!==_0x9e64('0x43')?_0x5142af:util[_0x9e64('0x44')](_0x9e64('0x45'),_0x598574);_0x427bb2[_0x9e64('0x47')]=_0x9e64('0x48');}else if(_0x378475[_0x9e64('0x41')]===_0x9e64('0x18')){logger[_0x9e64('0x25')](_0x9e64('0x46'),_0x598574,_0x378475[_0x9e64('0x41')]);_0x427bb2['Name']=_0x5142af!==''?_0x5142af:util[_0x9e64('0x44')]('Caller\x20-\x20%s',_0x598574);}else{return null;}}return _0x1c95f9[_0x9e64('0x1d')](_[_0x9e64('0x49')](_0x378475['moduleCreate']))[_0x9e64('0x1e')](_0x427bb2)[_0x9e64('0x29')](function(_0x394c76){return BPromise[_0x9e64('0x27')]({'id':_0x394c76['id'],'endUserType':_0x378475['moduleCreate']});});}});}function getCustomFields(_0x25f5f4,_0x12f88e){var _0x280a5c={};if(_0x25f5f4['length']>0x0){_[_0x9e64('0x4a')](_0x25f5f4,function(_0x123bde){if(_['includes'](['string','picklist'],_0x123bde[_0x9e64('0x3d')])&&_0x123bde['idField']){_0x280a5c[_0x123bde[_0x9e64('0x4b')]]=_0x123bde[_0x9e64('0x4c')][_0x9e64('0x4d')]();}else if(_0x123bde[_0x9e64('0x3d')]===_0x9e64('0x4e')&&_0x123bde[_0x9e64('0x4f')]&&_0x123bde[_0x9e64('0x4b')]){_0x12f88e[_0x123bde['variableName']]&&(_0x280a5c[_0x123bde[_0x9e64('0x4b')]]=_0x12f88e[_0x123bde[_0x9e64('0x4f')]]['toString']());}else if(_0x123bde['type']==='customVariable'&&_0x123bde[_0x9e64('0x50')]&&_0x123bde[_0x9e64('0x50')][_0x9e64('0x51')]&&_0x123bde['idField']){_0x12f88e[_0x123bde[_0x9e64('0x50')]['name']['toLowerCase']()]&&(_0x280a5c[_0x123bde[_0x9e64('0x4b')]]=_0x12f88e[_0x123bde[_0x9e64('0x50')][_0x9e64('0x51')][_0x9e64('0x3e')]()][_0x9e64('0x4d')]());}});}return _0x280a5c;}function getConnection(_0x1fc474){var _0x36f40d=_0x1fc474[_0x9e64('0x52')][_0x9e64('0x53')](_0x1fc474[_0x9e64('0x54')]);var _0x5abff5=new jsforce[(_0x9e64('0x55'))]({'oauth2':{'loginUrl':_0x1fc474[_0x9e64('0x56')]||_0x9e64('0x57'),'clientId':_0x1fc474[_0x9e64('0x58')],'clientSecret':_0x1fc474[_0x9e64('0x59')]}});return _0x5abff5[_0x9e64('0x5a')](_0x1fc474[_0x9e64('0x5b')],_0x36f40d)[_0x9e64('0x29')](function(){logger[_0x9e64('0x25')]('Connection\x20established.');return _0x5abff5;});}exports[_0x9e64('0x5c')]=function(_0x13b954,_0x3298b3,_0x434f4c,_0x55e972,_0x476440,_0xa02b20){var _0x8dc7c9,_0xe0ccbb,_0x890431,_0x33b692;_0xa02b20[_0x9e64('0x5d')]=intUtil[_0x9e64('0x5e')](_0xa02b20[_0x9e64('0x5d')]);_0xa02b20['remoteUri']=intUtil[_0x9e64('0x5e')](_0xa02b20[_0x9e64('0x56')]);if(_0x476440&&_0x476440[_0x9e64('0x5f')]){logger[_0x9e64('0x25')](_0x9e64('0x60'),'Recording\x20is\x20enabled!');_0x3298b3[_0x9e64('0x61')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xa02b20['serverUrl'],_0x3298b3['uniqueid'],md5(_0x3298b3[_0x9e64('0x62')]));}else{_0x3298b3[_0x9e64('0x61')]='';}return getConnection(_0xa02b20)[_0x9e64('0x29')](function(_0x3562f0){_0x33b692=_0x3562f0;return getUser(_0xa02b20,_0x55e972[_0x9e64('0x63')],_0x33b692);})['then'](function(_0x5151a1){_0x8dc7c9=_0x5151a1;return getEndUser(_0xa02b20,_0x434f4c,_0x3298b3[_0x9e64('0x64')],_0x3298b3[_0x9e64('0x65')],_0x33b692);})[_0x9e64('0x29')](function(_0xe85cf){_0xe0ccbb=_0xe85cf;return getTicket(_0xa02b20,_0x8dc7c9,_0xe0ccbb,_0x434f4c,_0x3298b3,_0x434f4c[_0x9e64('0x66')],_0x33b692,_0x9e64('0x5c'));})[_0x9e64('0x29')](function(_0x19a0d6){_0x890431=_0x19a0d6;logger[_0x9e64('0x25')](_0x9e64('0x67'),_0x890431['id']);logger['info'](_0x9e64('0x68'),_0x890431['id'],_0x55e972[_0x9e64('0x51')],_0xa02b20[_0x9e64('0x3d')]);switch(_0xa02b20[_0x9e64('0x3d')]){case _0x9e64('0x69'):emit(util[_0x9e64('0x44')](_0x9e64('0x6a'),_0x55e972[_0x9e64('0x51')]),_0x9e64('0x6b'),{'recordId':_0x890431['id']});break;case _0x9e64('0x6c'):emit(util[_0x9e64('0x44')](_0x9e64('0x6a'),_0x55e972[_0x9e64('0x51')]),_0x9e64('0x6d'),{'uri':util[_0x9e64('0x44')]('%s/%s/e',_0x33b692[_0x9e64('0x6e')],_0x890431['id'])});break;default:logger[_0x9e64('0x6f')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x9e64('0x70')](function(_0x1af53d){logger[_0x9e64('0x6f')]('[QUEUE]',_0x1af53d);});};exports[_0x9e64('0x71')]=function(_0x57413c,_0x3f489d,_0x3beadf,_0x38c064,_0x11b4dc,_0x5550dd,_0x1672db){var _0x11b7e0,_0x35d0e2,_0x435638,_0x300881;_0x5550dd[_0x9e64('0x5d')]=intUtil[_0x9e64('0x5e')](_0x5550dd[_0x9e64('0x5d')]);_0x5550dd[_0x9e64('0x56')]=intUtil[_0x9e64('0x5e')](_0x5550dd[_0x9e64('0x56')]);if(_0x1672db&&_0x1672db['recordingFormat']&&_0x1672db['recordingFormat']!=='none'){logger[_0x9e64('0x25')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3f489d[_0x9e64('0x61')]=util[_0x9e64('0x44')](_0x9e64('0x72'),_0x5550dd['serverUrl'],_0x3f489d['uniqueid'],md5(_0x3f489d[_0x9e64('0x62')]));}return getConnection(_0x5550dd)[_0x9e64('0x29')](function(_0x40ef7a){_0x300881=_0x40ef7a;return getUser(_0x5550dd,_0x38c064['email'],_0x300881);})['then'](function(_0x4d1fa6){_0x11b7e0=_0x4d1fa6;return getEndUser(_0x5550dd,_0x3beadf,_0x3f489d[_0x9e64('0x73')],_0x3f489d[_0x9e64('0x74')],_0x300881);})[_0x9e64('0x29')](function(_0x2f1512){_0x35d0e2=_0x2f1512;return getTicket(_0x5550dd,_0x11b7e0,_0x35d0e2,_0x3beadf,_0x3f489d,_0x3beadf['Fields'],_0x300881,'outbound');})[_0x9e64('0x29')](function(_0x2604e9){_0x435638=_0x2604e9;logger[_0x9e64('0x25')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x435638['id']);logger[_0x9e64('0x25')](_0x9e64('0x75'),_0x435638['id'],_0x38c064['name'],_0x5550dd['type']);switch(_0x5550dd[_0x9e64('0x3d')]){case _0x9e64('0x69'):emit(util[_0x9e64('0x44')](_0x9e64('0x6a'),_0x38c064[_0x9e64('0x51')]),'trigger:salesforce:display',{'recordId':_0x435638['id']});break;case'newTab':emit(util['format'](_0x9e64('0x6a'),_0x38c064[_0x9e64('0x51')]),_0x9e64('0x6d'),{'uri':util['format'](_0x9e64('0x76'),_0x300881[_0x9e64('0x6e')],_0x435638['id'])});break;default:logger[_0x9e64('0x6f')](_0x9e64('0x77'),_0x9e64('0x78'));}})['catch'](function(_0x22b57f){logger[_0x9e64('0x6f')]('[OUTBOUND]',_0x22b57f);});};exports[_0x9e64('0x79')]=function(_0x6aebbf,_0x471f65,_0x318060,_0x10cd62,_0x271eb0,_0x3a28a3){var _0x129fca,_0x3ce51e,_0x1e5c18,_0x4c9b5d;_0x3a28a3[_0x9e64('0x5d')]=intUtil[_0x9e64('0x5e')](_0x3a28a3[_0x9e64('0x5d')]);_0x3a28a3[_0x9e64('0x56')]=intUtil[_0x9e64('0x5e')](_0x3a28a3['remoteUri']);if(_0x271eb0&&_0x271eb0[_0x9e64('0x5f')]){logger['info']('['+_0x471f65[_0x9e64('0x7a')][_0x9e64('0x7b')]()+']',_0x9e64('0x7c'));_0x471f65[_0x9e64('0x61')]=util[_0x9e64('0x44')](_0x9e64('0x72'),_0x3a28a3['serverUrl'],_0x471f65[_0x9e64('0x62')],md5(_0x471f65['uniqueid']));}else{_0x471f65[_0x9e64('0x61')]='';}return getConnection(_0x3a28a3)['then'](function(_0x1f2e0e){_0x4c9b5d=_0x1f2e0e;if(!_[_0x9e64('0x1f')](_0x10cd62)){return getUser(_0x3a28a3,_0x10cd62[_0x9e64('0x51')],_0x4c9b5d);}else{return getUser(_0x3a28a3,null,_0x4c9b5d);}})[_0x9e64('0x29')](function(_0x51be4e){_0x129fca=_0x51be4e;return getEndUser(_0x3a28a3,_0x318060,_0x471f65[_0x9e64('0x64')],_0x471f65[_0x9e64('0x65')],_0x4c9b5d);})[_0x9e64('0x29')](function(_0x5eab57){_0x3ce51e=_0x5eab57;return getTicket(_0x3a28a3,_0x129fca,_0x3ce51e,_0x318060,_0x471f65,_0x318060[_0x9e64('0x66')],_0x4c9b5d);})[_0x9e64('0x29')](function(_0x5d2dd9){_0x1e5c18=_0x5d2dd9;logger[_0x9e64('0x25')]('['+_0x471f65[_0x9e64('0x7a')][_0x9e64('0x7b')]()+_0x9e64('0x7d'),_0x1e5c18['id']);logger[_0x9e64('0x25')]('['+_0x471f65[_0x9e64('0x7a')][_0x9e64('0x7b')]()+_0x9e64('0x7e'),_0x3a28a3[_0x9e64('0x3d')]);})[_0x9e64('0x70')](function(_0x50726d){logger[_0x9e64('0x6f')]('['+_0x471f65[_0x9e64('0x7a')][_0x9e64('0x7b')]()+']',_0x50726d);});}; \ 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 f9ca89c..b4a6b89 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 _0x435d=['recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','sys_id','],\x20getAdminUser\x20crm','error','toUpperCase','message','info','validateEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','userEmail','adminEmail','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','then','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','toLowerCase','content','toString','idField','customField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','Subjects','getString','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]'];(function(_0x491a04,_0x158148){var _0x23696f=function(_0x4df819){while(--_0x4df819){_0x491a04['push'](_0x491a04['shift']());}};_0x23696f(++_0x158148);}(_0x435d,0x169));var _0xd435=function(_0x2c7a4d,_0x288484){_0x2c7a4d=_0x2c7a4d-0x0;var _0x33f0f7=_0x435d[_0x2c7a4d];return _0x33f0f7;};'use strict';var _=require(_0xd435('0x0'));var Promise=require(_0xd435('0x1'));var rp=require('request-promise');var util=require(_0xd435('0x2'));var md5=require(_0xd435('0x3'));var Redis=require(_0xd435('0x4'));var intUtil=require(_0xd435('0x5'));var config=require(_0xd435('0x6'));var logger=require(_0xd435('0x7'))(_0xd435('0x8'));config[_0xd435('0x9')]=_[_0xd435('0xa')](config['redis'],{'host':_0xd435('0xb'),'port':0x18eb});var io=require(_0xd435('0xc'))(new Redis(config['redis']));function getAdminUser(_0x5b3380,_0x3b2a63,_0x1fa61d,_0x4c5e37,_0x1d50ae,_0x4c8cd1){return new Promise(function(_0x525d96,_0x2066d4){var _0x52b2ed={'method':_0xd435('0xd'),'uri':_0x4c5e37+_0xd435('0xe')+'&'+_0x1d50ae+'&'+_0x4c8cd1,'auth':_0x3b2a63,'json':!![]};return rp(_0x52b2ed)['then'](function(_0x347330){if(_0x347330[_0xd435('0xf')][_0xd435('0x10')]>0x0){_0x1fa61d[_0xd435('0x11')]=_0x347330[_0xd435('0xf')][0x0][_0xd435('0x12')];}logger['info']('['+[_0x5b3380['toUpperCase']()]+_0xd435('0x13'),_0x1fa61d);_0x525d96(_0x1fa61d);})['catch'](function(_0x128d65){logger[_0xd435('0x14')]('['+[_0x5b3380[_0xd435('0x15')]()]+']',_0x128d65[_0xd435('0x16')]);_0x2066d4(_0x128d65['message']);});});}function getUser(_0x3dd392,_0x52f72f,_0x45196b,_0x330589,_0x3adcd7){return function(_0x446cbf){logger[_0xd435('0x17')]('['+[_0x3dd392[_0xd435('0x15')]()]+'],\x20getUser\x20input\x20crm',_0x446cbf);return new Promise(function(_0x1b626e,_0x5ed584){if(intUtil[_0xd435('0x18')](_0x446cbf['userEmail'])){var _0x12dd65={'method':_0xd435('0xd'),'uri':_0x45196b+_0xd435('0x19')+_0x446cbf['userEmail']+'&'+_0x330589+'&'+_0x3adcd7,'auth':_0x52f72f,'json':!![]};logger[_0xd435('0x17')]('['+[_0x3dd392[_0xd435('0x15')]()]+_0xd435('0x1a'),_0x12dd65);return rp(_0x12dd65)['then'](function(_0x2cebc3){logger[_0xd435('0x17')]('['+[_0x3dd392[_0xd435('0x15')]()]+_0xd435('0x1b'),_0x2cebc3);if(_0x2cebc3[_0xd435('0xf')][_0xd435('0x10')]>0x0&&String(_0x2cebc3[_0xd435('0xf')][0x0][_0xd435('0x1c')])===_0xd435('0x1d')){_0x446cbf[_0xd435('0x1e')]=_0x2cebc3[_0xd435('0xf')][0x0][_0xd435('0x12')];}else{_0x446cbf[_0xd435('0x1e')]=_0x446cbf[_0xd435('0x11')];_0x446cbf[_0xd435('0x1f')]=_0x446cbf[_0xd435('0x20')];}logger[_0xd435('0x17')]('['+[_0x3dd392[_0xd435('0x15')]()]+_0xd435('0x21'),_0x446cbf);_0x1b626e(_0x446cbf);})[_0xd435('0x22')](function(_0x5d1046){logger['error']('['+[_0x3dd392[_0xd435('0x15')]()]+']',_0x5d1046[_0xd435('0x16')]);_0x5ed584(_0x5d1046[_0xd435('0x16')]);});}else{logger[_0xd435('0x17')]('['+[_0x3dd392['toUpperCase']()]+_0xd435('0x23'));_0x446cbf[_0xd435('0x1e')]=_0x446cbf['adminId'];_0x446cbf[_0xd435('0x1f')]=_0x446cbf[_0xd435('0x20')];_0x1b626e(_0x446cbf);}});};}function createEndUser(_0x366900,_0x12f2f8,_0x278768,_0xa78643,_0x33d8d4){logger[_0xd435('0x17')]('['+[_0x366900[_0xd435('0x15')]()]+_0xd435('0x24'),_0x278768);return new Promise(function(_0x10aea7,_0xc911ef){var _0x43f7fb={'method':_0xd435('0x25'),'uri':_0xa78643+_0xd435('0x26')+_0x33d8d4,'body':{'user_name':_0x278768[_0xd435('0x27')],'roles':'user','first_name':_0x278768[_0xd435('0x27')],'active':_0xd435('0x1d'),'date_format':_0xd435('0x28'),'phone':_0x278768[_0xd435('0x27')]},'auth':_0x12f2f8,'json':!![]};return rp(_0x43f7fb)[_0xd435('0x29')](function(_0x26e481){logger[_0xd435('0x17')]('['+[_0x366900[_0xd435('0x15')]()]+_0xd435('0x2a'),_0x26e481[_0xd435('0xf')]);_0x278768[_0xd435('0x2b')]=_0x26e481[_0xd435('0xf')]['sys_id'];_0x10aea7(_0x278768);})[_0xd435('0x22')](function(_0x40dfc6){logger['error']('['+[_0x366900[_0xd435('0x15')]()]+']',_0x40dfc6[_0xd435('0x16')]);_0xc911ef(_0x40dfc6[_0xd435('0x16')]);});});}function getEndUser(_0x1b7e66,_0x5a3120,_0x71e9c3,_0x3b39a3,_0x27ef26){return function(_0x1c0299){logger['info']('['+[_0x1b7e66[_0xd435('0x15')]()]+_0xd435('0x2c'),_0x1c0299);return new Promise(function(_0x377f97,_0x325a91){var _0x195dee={'method':_0xd435('0xd'),'uri':_0x71e9c3+_0xd435('0x2d')+_0x1c0299[_0xd435('0x27')]+'&'+_0x3b39a3+'&'+_0x27ef26,'auth':_0x5a3120,'json':!![]};return rp(_0x195dee)['then'](function(_0xbf8b8f){if(_0xbf8b8f[_0xd435('0xf')]['length']>0x0){_0x1c0299['endUserId']=_0xbf8b8f[_0xd435('0xf')][0x0][_0xd435('0x12')];logger[_0xd435('0x17')]('['+[_0x1b7e66['toUpperCase']()]+_0xd435('0x2e'),_0x1c0299);_0x377f97(_0x1c0299);}else{return createEndUser(_0x1b7e66,_0x5a3120,_0x1c0299,_0x71e9c3,_0x3b39a3)[_0xd435('0x29')](function(_0x515d3c){logger['info']('['+[_0x1b7e66[_0xd435('0x15')]()]+_0xd435('0x2f'),_0x515d3c);_0x377f97(_0x515d3c);});}})[_0xd435('0x22')](function(_0x42703f){logger[_0xd435('0x14')]('['+[_0x1b7e66[_0xd435('0x15')]()]+']',_0x42703f[_0xd435('0x16')]);_0x325a91(_0x42703f['message']);});});};}function getCustomFields(_0x3ef09,_0x20bba0){var _0x1d17d7={};if(_0x3ef09['length']>0x0){_[_0xd435('0x30')](_0x3ef09,function(_0x57da79){if(_[_0xd435('0x31')]([_0xd435('0x32'),_0xd435('0x33')],_0x57da79[_0xd435('0x34')])&&_0x57da79[_0xd435('0x35')]&&!_0x57da79['customField']){_0x1d17d7[_0x57da79[_0xd435('0x35')][_0xd435('0x36')]()]=_0x57da79[_0xd435('0x37')][_0xd435('0x38')]();}else if(_[_0xd435('0x31')]([_0xd435('0x32'),'picklist'],_0x57da79[_0xd435('0x34')])&&_0x57da79[_0xd435('0x39')]&&_0x57da79[_0xd435('0x3a')]){_0x1d17d7[_0x57da79[_0xd435('0x39')]['toLowerCase']()]=_0x57da79['content']['toString']();}else if(_0x57da79[_0xd435('0x34')]===_0xd435('0x3b')&&_0x57da79[_0xd435('0x3c')]&&_0x57da79['idField']&&_0x57da79['customField']){_0x1d17d7[_0x57da79[_0xd435('0x39')]['toLowerCase']()]=_0x20bba0[_0x57da79['variableName']][_0xd435('0x38')]();}else if(_0x57da79[_0xd435('0x34')]===_0xd435('0x3d')&&_0x57da79[_0xd435('0x3e')]&&_0x57da79[_0xd435('0x3e')][_0xd435('0x3f')]&&_0x57da79[_0xd435('0x39')]&&_0x57da79[_0xd435('0x3a')]){_0x1d17d7[_0x57da79[_0xd435('0x39')][_0xd435('0x36')]()]=_0x20bba0[_0x57da79['Variable'][_0xd435('0x3f')][_0xd435('0x36')]()][_0xd435('0x38')]();}});}return _0x1d17d7;}function getTicket(_0x527c9d,_0x5d14f9,_0x4cd6e2,_0x367699,_0x14d620,_0x55d25c){return function(_0xcbf1b3){logger[_0xd435('0x17')]('['+[_0x527c9d[_0xd435('0x15')]()]+_0xd435('0x40'),_0xcbf1b3);return new Promise(function(_0x1397a7,_0x1e0b79){var _0x2e31c7=_0x527c9d[_0xd435('0x36')]()===_0xd435('0x41')?_0xcbf1b3[_0xd435('0x1e')]:_0xcbf1b3[_0xd435('0x2b')];var _0x5a0e20={'method':'POST','uri':_0x4cd6e2+_0xd435('0x42')+'?'+_0x55d25c,'body':Object['assign']({},{'active':_0xd435('0x1d'),'caller_id':_0x2e31c7,'assigned_to':_0xcbf1b3['userId'],'short_description':intUtil['getString'](_0x367699[_0xd435('0x43')],_0x14d620,'\x20'),'description':intUtil[_0xd435('0x44')](_0x367699[_0xd435('0x45')],_0x14d620,'\x0a')},getCustomFields(_0x367699['Fields'],_0x14d620)),'auth':_0x5d14f9,'json':!![]};return rp(_0x5a0e20)[_0xd435('0x29')](function(_0x30e5b0){logger['info']('['+[_0x527c9d[_0xd435('0x15')]()]+_0xd435('0x46'),_0x30e5b0[_0xd435('0xf')]);_0xcbf1b3[_0xd435('0x47')]=_0x30e5b0[_0xd435('0xf')][_0xd435('0x12')];_0xcbf1b3[_0xd435('0x48')]=_0x30e5b0[_0xd435('0xf')]['number'];logger[_0xd435('0x17')]('['+[_0x527c9d[_0xd435('0x15')]()]+']\x20getTicket\x20crm',_0xcbf1b3);_0x1397a7(_0xcbf1b3);})[_0xd435('0x22')](function(_0x14e5e1){logger[_0xd435('0x14')]('['+[_0x527c9d[_0xd435('0x15')]()]+']',_0x14e5e1[_0xd435('0x16')]);_0x1e0b79(_0x14e5e1['message']);});});};}function createRemoteTag(_0x17a84f,_0x57afdc,_0x425d2e,_0x302457){return new Promise(function(_0x55e5f7,_0x2d1c08){var _0x37ca0d={'method':_0xd435('0x25'),'uri':_0x425d2e+_0xd435('0x49')+'?'+_0x302457,'body':{'short_description':_0x17a84f,'global':!![],'active':!![],'name':_0x17a84f},'auth':_0x57afdc,'json':!![]};return rp(_0x37ca0d)['then'](function(_0x4ca11b){var _0x39bf02=_0x4ca11b[_0xd435('0xf')][_0xd435('0x12')];_0x55e5f7(_0x39bf02);});});}function getRemoteTag(_0x2e9871,_0x2bb5d6,_0x1aa872,_0x244938,_0x2a5782){return new Promise(function(_0x21828c,_0x1a310a){var _0x1172e8={'method':_0xd435('0xd'),'uri':_0x1aa872+_0xd435('0x49')+_0xd435('0x4a')+_0x2e9871+'&'+_0x244938,'auth':_0x2bb5d6,'json':!![]};return rp(_0x1172e8)[_0xd435('0x29')](function(_0xb438e0){if(_0xb438e0['result'][_0xd435('0x10')]>0x0){var _0x2a7205=_0xb438e0[_0xd435('0xf')][0x0][_0xd435('0x12')];_0x21828c(_0x2a7205);}else{return createRemoteTag(_0x2e9871,_0x2bb5d6,_0x1aa872,_0x244938)[_0xd435('0x29')](function(_0x499be5){_0x21828c(_0x499be5);});}});});}function assignTagToIncident(_0x5abc24,_0x1047d4,_0x47d864,_0x54b4a7,_0x239b0b){return new Promise(function(_0x121287,_0x167d5b){var _0x3b563e={'method':_0xd435('0x25'),'uri':_0x47d864+_0xd435('0x4b')+'?'+_0x239b0b,'body':{'label':_0x5abc24,'table':_0xd435('0x42'),'id_type':'Incident','table_key':_0x54b4a7[_0xd435('0x47')],'title':_0xd435('0x4c')+_0x54b4a7[_0xd435('0x48')],'id_display':_0x54b4a7[_0xd435('0x48')]},'auth':_0x1047d4,'json':!![]};return rp(_0x3b563e)[_0xd435('0x29')](function(_0xf03cef){_0x121287();})['catch'](function(){_0x121287();});});}function manageTags(_0x3783fd,_0x5227f0,_0x406cbd,_0x102620,_0x1480b3,_0x1d4eb2,_0x4b937f){return new Promise(function(_0x57cd4d,_0x1bfe58){var _0xe83d35=[];_0x5227f0[_0xd435('0x30')](function(_0x3dd30d){_0xe83d35[_0xd435('0x4d')](getRemoteTag(_0x3dd30d,_0x406cbd,_0x102620,_0x1d4eb2,_0x4b937f));});return Promise[_0xd435('0x4e')](_0xe83d35)['then'](function(_0x165df7){if(_0x165df7[_0xd435('0x10')]){logger[_0xd435('0x17')]('['+[_0x3783fd['toUpperCase']()]+_0xd435('0x4f'),_0x165df7);var _0x2ab98a=[];_0x165df7[_0xd435('0x30')](function(_0x529b2c){_0x2ab98a[_0xd435('0x4d')](assignTagToIncident(_0x529b2c,_0x406cbd,_0x102620,_0x1480b3,_0x1d4eb2));});return Promise[_0xd435('0x4e')](_0x2ab98a)[_0xd435('0x29')](function(){_0x57cd4d();})[_0xd435('0x22')](function(){_0x57cd4d();});}else{_0x57cd4d();}});});}function getTags(_0x1a20e3,_0x4d9439,_0x47e0f8,_0x124e63,_0x4807da,_0x4f1c81){return function(_0x275a84){return new Promise(function(_0x5dd11d,_0x432faa){var _0x3f80dc=[];var _0x2bb013=_0x124e63[_0xd435('0x50')];if(_0x2bb013&&_0x2bb013['length']>0x0){_0x3f80dc=_[_0xd435('0x51')](_0x2bb013,'name');}if(_0x3f80dc[_0xd435('0x10')]>0x0){return manageTags(_0x1a20e3,_0x3f80dc,_0x4d9439,_0x47e0f8,_0x275a84,_0x4807da,_0x4f1c81)[_0xd435('0x29')](function(){_0x5dd11d(_0x275a84);});}else{_0x5dd11d(_0x275a84);}});};}function emit(_0x474e78,_0x56f9a2,_0x235d43){var _0x3d90e9=_0xd435('0x52')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xd435('0x53')+_0xd435('0x54');var _0x19a9c0={'uri':_0x474e78+_0xd435('0x55')+_0x235d43+_0x3d90e9};io['to'](util['format'](_0xd435('0x56'),_0x56f9a2))[_0xd435('0x57')](_0xd435('0x58'),_0x19a9c0);}exports['cs']=function(_0x102c96,_0x42796f,_0x2afdc2,_0x29adca,_0x4df5a2,_0x1442fa,_0x25e185,_0x5685f7){var _0x538090={};var _0x3da58a={'user':_0x1442fa[_0xd435('0x59')],'pass':_0x1442fa[_0xd435('0x5a')]};var _0x2e463a=_0xd435('0x5b');var _0x40002d=_0xd435('0x5c');_0x1442fa[_0xd435('0x5d')]=intUtil[_0xd435('0x5e')](_0x1442fa[_0xd435('0x5d')]);_0x1442fa[_0xd435('0x5f')]=intUtil[_0xd435('0x5e')](_0x1442fa[_0xd435('0x5f')]);var _0x1fb7a0=util[_0xd435('0x60')](_0xd435('0x61'),_0x1442fa[_0xd435('0x5d')]);_0x538090['userEmail']=!_[_0xd435('0x62')](_0x29adca)?_0x29adca[_0xd435('0x63')]:null;_0x538090[_0xd435('0x20')]=_0x1442fa['email'];_0x538090[_0xd435('0x27')]=_0x5685f7[_0xd435('0x36')]()===_0xd435('0x41')?_0x42796f[_0xd435('0x64')]:_0x42796f[_0xd435('0x65')];_0x538090[_0xd435('0x66')]=_0x5685f7===_0xd435('0x67')||_0x5685f7==='unmanaged'?_0xd435('0x67'):'outbound';var _0xeb7ce4=util[_0xd435('0x60')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1442fa[_0xd435('0x5f')],_0x42796f[_0xd435('0x68')],md5(_0x42796f[_0xd435('0x68')]));if(_0x4df5a2&&_0x4df5a2[_0xd435('0x69')]){logger['info'](_0xd435('0x6a'),_0xd435('0x6b'));_0x42796f['recordingURL']=_0xeb7ce4;}else if(_0x25e185&&_0x25e185[_0xd435('0x6c')]&&_0x25e185['recordingFormat']!==_0xd435('0x6d')){logger[_0xd435('0x17')](_0xd435('0x6e'),'Recording\x20is\x20enabled!');_0x42796f['recordingURL']=_0xeb7ce4;}else{_0x42796f[_0xd435('0x6f')]='';}return getAdminUser(_0x5685f7,_0x3da58a,_0x538090,_0x1fb7a0,_0x40002d,_0x2e463a)[_0xd435('0x29')](getUser(_0x5685f7,_0x3da58a,_0x1fb7a0,_0x40002d,_0x2e463a))[_0xd435('0x29')](getEndUser(_0x5685f7,_0x3da58a,_0x1fb7a0,_0x40002d,_0x2e463a))[_0xd435('0x29')](getTicket(_0x5685f7,_0x3da58a,_0x1fb7a0,_0x2afdc2,_0x42796f,_0x40002d))[_0xd435('0x29')](function(_0x1f0849){logger['info'](util[_0xd435('0x60')](_0xd435('0x70'),_0x1f0849[_0xd435('0x47')]));logger[_0xd435('0x17')](util[_0xd435('0x60')](_0xd435('0x71'),_0x5685f7));if(_0x5685f7!==_0xd435('0x72')){logger['info']('['+[_0x5685f7['toUpperCase']()]+']',_0xd435('0x73'));emit(_0x1442fa['remoteUri'],_0x29adca[_0xd435('0x3f')],_0x1f0849[_0xd435('0x47')]);}})[_0xd435('0x22')](function(_0x4191f9){logger['error']('['+[_0x5685f7[_0xd435('0x15')]()]+_0xd435('0x74'),util[_0xd435('0x75')](_0x4191f9,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc886=[']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','POST','label','?sysparm_query=name%3D','label_entry','Incident','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','userEmail','],\x20createEndUser\x20input\x20crm','endUserNumber','user','System','endUserId','],\x20createEndUser\x20crm','forEach','includes','string','picklist','nameField','customField','content','toString','type','idField','variable','variableName','Variable','name','toLowerCase',']\x20getTicket\x20input\x20crm','outbound','incident','Subjects','Descriptions'];(function(_0x5e2128,_0xe2107e){var _0x2bbc88=function(_0x23ce4d){while(--_0x23ce4d){_0x5e2128['push'](_0x5e2128['shift']());}};_0x2bbc88(++_0xe2107e);}(_0xc886,0x9d));var _0x6c88=function(_0x55056f,_0x4eb350){_0x55056f=_0x55056f-0x0;var _0x5ca300=_0xc886[_0x55056f];return _0x5ca300;};'use strict';var _=require(_0x6c88('0x0'));var Promise=require('bluebird');var rp=require(_0x6c88('0x1'));var util=require(_0x6c88('0x2'));var md5=require(_0x6c88('0x3'));var Redis=require(_0x6c88('0x4'));var intUtil=require(_0x6c88('0x5'));var config=require(_0x6c88('0x6'));var logger=require(_0x6c88('0x7'))(_0x6c88('0x8'));config['redis']=_[_0x6c88('0x9')](config[_0x6c88('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x6c88('0xb'))(new Redis(config[_0x6c88('0xa')]));function getAdminUser(_0x41faad,_0x309b1d,_0x116d00,_0x2ab475,_0x4d808a,_0x3ec17e){return new Promise(function(_0x5ae3c8,_0x1d61c2){var _0x1d28b0={'method':_0x6c88('0xc'),'uri':_0x2ab475+_0x6c88('0xd')+'&'+_0x4d808a+'&'+_0x3ec17e,'auth':_0x309b1d,'json':!![]};return rp(_0x1d28b0)[_0x6c88('0xe')](function(_0x289b13){if(_0x289b13[_0x6c88('0xf')][_0x6c88('0x10')]>0x0){_0x116d00[_0x6c88('0x11')]=_0x289b13[_0x6c88('0xf')][0x0][_0x6c88('0x12')];}logger[_0x6c88('0x13')]('['+[_0x41faad[_0x6c88('0x14')]()]+'],\x20getAdminUser\x20crm',_0x116d00);_0x5ae3c8(_0x116d00);})[_0x6c88('0x15')](function(_0x102855){logger[_0x6c88('0x16')]('['+[_0x41faad['toUpperCase']()]+']',_0x102855[_0x6c88('0x17')]);_0x1d61c2(_0x102855[_0x6c88('0x17')]);});});}function getUser(_0x542c26,_0x880f33,_0x46f054,_0x455761,_0x571419){return function(_0x3b579c){logger[_0x6c88('0x13')]('['+[_0x542c26[_0x6c88('0x14')]()]+_0x6c88('0x18'),_0x3b579c);return new Promise(function(_0xbdcb27,_0x28cfb4){if(intUtil[_0x6c88('0x19')](_0x3b579c['userEmail'])){var _0x263231={'method':_0x6c88('0xc'),'uri':_0x46f054+_0x6c88('0x1a')+_0x3b579c['userEmail']+'&'+_0x455761+'&'+_0x571419,'auth':_0x880f33,'json':!![]};logger['info']('['+[_0x542c26['toUpperCase']()]+_0x6c88('0x1b'),_0x263231);return rp(_0x263231)[_0x6c88('0xe')](function(_0x2ffeb1){logger['info']('['+[_0x542c26[_0x6c88('0x14')]()]+'],\x20getUser\x20entity',_0x2ffeb1);if(_0x2ffeb1[_0x6c88('0xf')][_0x6c88('0x10')]>0x0&&String(_0x2ffeb1[_0x6c88('0xf')][0x0][_0x6c88('0x1c')])===_0x6c88('0x1d')){_0x3b579c[_0x6c88('0x1e')]=_0x2ffeb1['result'][0x0][_0x6c88('0x12')];}else{_0x3b579c[_0x6c88('0x1e')]=_0x3b579c[_0x6c88('0x11')];_0x3b579c['userEmail']=_0x3b579c[_0x6c88('0x1f')];}logger['info']('['+[_0x542c26[_0x6c88('0x14')]()]+_0x6c88('0x20'),_0x3b579c);_0xbdcb27(_0x3b579c);})[_0x6c88('0x15')](function(_0x51da04){logger['error']('['+[_0x542c26[_0x6c88('0x14')]()]+']',_0x51da04[_0x6c88('0x17')]);_0x28cfb4(_0x51da04['message']);});}else{logger['info']('['+[_0x542c26[_0x6c88('0x14')]()]+_0x6c88('0x21'));_0x3b579c[_0x6c88('0x1e')]=_0x3b579c[_0x6c88('0x11')];_0x3b579c[_0x6c88('0x22')]=_0x3b579c['adminEmail'];_0xbdcb27(_0x3b579c);}});};}function createEndUser(_0x80b825,_0x8b845e,_0x3cfdf3,_0x3044d4,_0xc87af){logger[_0x6c88('0x13')]('['+[_0x80b825[_0x6c88('0x14')]()]+_0x6c88('0x23'),_0x3cfdf3);return new Promise(function(_0x533e1e,_0x21c2fe){var _0x30513a={'method':'POST','uri':_0x3044d4+'sys_user?'+_0xc87af,'body':{'user_name':_0x3cfdf3[_0x6c88('0x24')],'roles':_0x6c88('0x25'),'first_name':_0x3cfdf3['endUserNumber'],'active':'true','date_format':_0x6c88('0x26'),'phone':_0x3cfdf3[_0x6c88('0x24')]},'auth':_0x8b845e,'json':!![]};return rp(_0x30513a)[_0x6c88('0xe')](function(_0x3970d0){logger[_0x6c88('0x13')]('['+[_0x80b825['toUpperCase']()]+'],\x20EndUser\x20schema',_0x3970d0[_0x6c88('0xf')]);_0x3cfdf3[_0x6c88('0x27')]=_0x3970d0['result'][_0x6c88('0x12')];_0x533e1e(_0x3cfdf3);})['catch'](function(_0x49328e){logger['error']('['+[_0x80b825[_0x6c88('0x14')]()]+']',_0x49328e[_0x6c88('0x17')]);_0x21c2fe(_0x49328e[_0x6c88('0x17')]);});});}function getEndUser(_0x251293,_0x13de04,_0x5e24c5,_0x3c3c60,_0x2587e3){return function(_0xd58459){logger[_0x6c88('0x13')]('['+[_0x251293[_0x6c88('0x14')]()]+'],\x20getEndUser\x20input\x20crm',_0xd58459);return new Promise(function(_0x101fa6,_0x3a609a){var _0x2e173f={'method':_0x6c88('0xc'),'uri':_0x5e24c5+'sys_user?sysparm_query=phone%3D'+_0xd58459[_0x6c88('0x24')]+'&'+_0x3c3c60+'&'+_0x2587e3,'auth':_0x13de04,'json':!![]};return rp(_0x2e173f)['then'](function(_0x296fed){if(_0x296fed['result']['length']>0x0){_0xd58459['endUserId']=_0x296fed[_0x6c88('0xf')][0x0][_0x6c88('0x12')];logger['info']('['+[_0x251293[_0x6c88('0x14')]()]+'],\x20getEndUser\x20crm',_0xd58459);_0x101fa6(_0xd58459);}else{return createEndUser(_0x251293,_0x13de04,_0xd58459,_0x5e24c5,_0x3c3c60)[_0x6c88('0xe')](function(_0x657d0b){logger[_0x6c88('0x13')]('['+[_0x251293[_0x6c88('0x14')]()]+_0x6c88('0x28'),_0x657d0b);_0x101fa6(_0x657d0b);});}})['catch'](function(_0x5a3f0c){logger[_0x6c88('0x16')]('['+[_0x251293[_0x6c88('0x14')]()]+']',_0x5a3f0c[_0x6c88('0x17')]);_0x3a609a(_0x5a3f0c[_0x6c88('0x17')]);});});};}function getCustomFields(_0x4fcebf,_0x2797c0){var _0x4b32d6={};if(_0x4fcebf[_0x6c88('0x10')]>0x0){_[_0x6c88('0x29')](_0x4fcebf,function(_0x2c3429){if(_[_0x6c88('0x2a')]([_0x6c88('0x2b'),_0x6c88('0x2c')],_0x2c3429['type'])&&_0x2c3429[_0x6c88('0x2d')]&&!_0x2c3429[_0x6c88('0x2e')]){_0x4b32d6[_0x2c3429[_0x6c88('0x2d')]['toLowerCase']()]=_0x2c3429[_0x6c88('0x2f')][_0x6c88('0x30')]();}else if(_[_0x6c88('0x2a')]([_0x6c88('0x2b'),_0x6c88('0x2c')],_0x2c3429[_0x6c88('0x31')])&&_0x2c3429['idField']&&_0x2c3429['customField']){_0x4b32d6[_0x2c3429[_0x6c88('0x32')]['toLowerCase']()]=_0x2c3429[_0x6c88('0x2f')]['toString']();}else if(_0x2c3429[_0x6c88('0x31')]===_0x6c88('0x33')&&_0x2c3429['variableName']&&_0x2c3429[_0x6c88('0x32')]&&_0x2c3429[_0x6c88('0x2e')]){_0x4b32d6[_0x2c3429['idField']['toLowerCase']()]=_0x2797c0[_0x2c3429[_0x6c88('0x34')]]['toString']();}else if(_0x2c3429[_0x6c88('0x31')]==='customVariable'&&_0x2c3429[_0x6c88('0x35')]&&_0x2c3429[_0x6c88('0x35')][_0x6c88('0x36')]&&_0x2c3429[_0x6c88('0x32')]&&_0x2c3429[_0x6c88('0x2e')]){_0x4b32d6[_0x2c3429[_0x6c88('0x32')][_0x6c88('0x37')]()]=_0x2797c0[_0x2c3429[_0x6c88('0x35')][_0x6c88('0x36')]['toLowerCase']()][_0x6c88('0x30')]();}});}return _0x4b32d6;}function getTicket(_0x41272f,_0x2b5efb,_0x1faa34,_0x5752af,_0x2c679c,_0x566697){return function(_0x3aed79){logger['info']('['+[_0x41272f[_0x6c88('0x14')]()]+_0x6c88('0x38'),_0x3aed79);return new Promise(function(_0x1996c4,_0x187963){var _0x47fb65=_0x41272f['toLowerCase']()===_0x6c88('0x39')?_0x3aed79[_0x6c88('0x1e')]:_0x3aed79[_0x6c88('0x27')];var _0x273048={'method':'POST','uri':_0x1faa34+_0x6c88('0x3a')+'?'+_0x566697,'body':Object['assign']({},{'active':_0x6c88('0x1d'),'caller_id':_0x47fb65,'assigned_to':_0x3aed79[_0x6c88('0x1e')],'short_description':intUtil['getString'](_0x5752af[_0x6c88('0x3b')],_0x2c679c,'\x20'),'description':intUtil['getString'](_0x5752af[_0x6c88('0x3c')],_0x2c679c,'\x0a')},getCustomFields(_0x5752af['Fields'],_0x2c679c)),'auth':_0x2b5efb,'json':!![]};return rp(_0x273048)['then'](function(_0x1597a2){logger[_0x6c88('0x13')]('['+[_0x41272f[_0x6c88('0x14')]()]+_0x6c88('0x3d'),_0x1597a2['result']);_0x3aed79[_0x6c88('0x3e')]=_0x1597a2[_0x6c88('0xf')][_0x6c88('0x12')];_0x3aed79[_0x6c88('0x3f')]=_0x1597a2[_0x6c88('0xf')][_0x6c88('0x40')];logger['info']('['+[_0x41272f[_0x6c88('0x14')]()]+_0x6c88('0x41'),_0x3aed79);_0x1996c4(_0x3aed79);})[_0x6c88('0x15')](function(_0x381ab0){logger[_0x6c88('0x16')]('['+[_0x41272f[_0x6c88('0x14')]()]+']',_0x381ab0[_0x6c88('0x17')]);_0x187963(_0x381ab0['message']);});});};}function createRemoteTag(_0x3eb9d1,_0x5582d0,_0x5bc9ed,_0x29aca2){return new Promise(function(_0x52b2a2,_0x32e9c2){var _0x3731d1={'method':_0x6c88('0x42'),'uri':_0x5bc9ed+'label'+'?'+_0x29aca2,'body':{'short_description':_0x3eb9d1,'global':!![],'active':!![],'name':_0x3eb9d1},'auth':_0x5582d0,'json':!![]};return rp(_0x3731d1)[_0x6c88('0xe')](function(_0x3e8df8){var _0x34b3c2=_0x3e8df8['result']['sys_id'];_0x52b2a2(_0x34b3c2);});});}function getRemoteTag(_0x2f5350,_0x442d4b,_0x21e117,_0x11168c,_0x157220){return new Promise(function(_0x507d58,_0x5bdc2e){var _0x8177fc={'method':_0x6c88('0xc'),'uri':_0x21e117+_0x6c88('0x43')+_0x6c88('0x44')+_0x2f5350+'&'+_0x11168c,'auth':_0x442d4b,'json':!![]};return rp(_0x8177fc)[_0x6c88('0xe')](function(_0x59bb53){if(_0x59bb53[_0x6c88('0xf')][_0x6c88('0x10')]>0x0){var _0x4a45f7=_0x59bb53[_0x6c88('0xf')][0x0]['sys_id'];_0x507d58(_0x4a45f7);}else{return createRemoteTag(_0x2f5350,_0x442d4b,_0x21e117,_0x11168c)[_0x6c88('0xe')](function(_0x5d5bfe){_0x507d58(_0x5d5bfe);});}});});}function assignTagToIncident(_0x343bbb,_0x164431,_0x455df7,_0x3de653,_0xa6005a){return new Promise(function(_0x1697c4,_0x1e26d5){var _0x593143={'method':'POST','uri':_0x455df7+_0x6c88('0x45')+'?'+_0xa6005a,'body':{'label':_0x343bbb,'table':'incident','id_type':_0x6c88('0x46'),'table_key':_0x3de653[_0x6c88('0x3e')],'title':'Incident\x20-\x20'+_0x3de653[_0x6c88('0x3f')],'id_display':_0x3de653['ticketNumber']},'auth':_0x164431,'json':!![]};return rp(_0x593143)[_0x6c88('0xe')](function(_0x4b2e4b){_0x1697c4();})[_0x6c88('0x15')](function(){_0x1697c4();});});}function manageTags(_0xec2a4,_0x49355f,_0x3c07db,_0x106e18,_0xc79782,_0x2e158,_0x5856d9){return new Promise(function(_0x3b92f1,_0x242183){var _0x3a33fa=[];_0x49355f[_0x6c88('0x29')](function(_0x5b0e6b){_0x3a33fa[_0x6c88('0x47')](getRemoteTag(_0x5b0e6b,_0x3c07db,_0x106e18,_0x2e158,_0x5856d9));});return Promise[_0x6c88('0x48')](_0x3a33fa)['then'](function(_0x3b3b77){if(_0x3b3b77['length']){logger['info']('['+[_0xec2a4[_0x6c88('0x14')]()]+_0x6c88('0x49'),_0x3b3b77);var _0x3bf195=[];_0x3b3b77[_0x6c88('0x29')](function(_0x9b9b25){_0x3bf195[_0x6c88('0x47')](assignTagToIncident(_0x9b9b25,_0x3c07db,_0x106e18,_0xc79782,_0x2e158));});return Promise['all'](_0x3bf195)['then'](function(){_0x3b92f1();})['catch'](function(){_0x3b92f1();});}else{_0x3b92f1();}});});}function getTags(_0x2d3c93,_0x2486d5,_0xa5fda6,_0x1501aa,_0x54754f,_0x147856){return function(_0x4ad771){return new Promise(function(_0x289db6,_0x1cf594){var _0x20f8d6=[];var _0x3e0926=_0x1501aa[_0x6c88('0x4a')];if(_0x3e0926&&_0x3e0926[_0x6c88('0x10')]>0x0){_0x20f8d6=_['map'](_0x3e0926,_0x6c88('0x36'));}if(_0x20f8d6[_0x6c88('0x10')]>0x0){return manageTags(_0x2d3c93,_0x20f8d6,_0x2486d5,_0xa5fda6,_0x4ad771,_0x54754f,_0x147856)[_0x6c88('0xe')](function(){_0x289db6(_0x4ad771);});}else{_0x289db6(_0x4ad771);}});};}function emit(_0x4d9e52,_0x477ae9,_0x43093e){var _0x53c4f4=_0x6c88('0x4b')+_0x6c88('0x4c')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x6c88('0x4d');var _0x580717={'uri':_0x4d9e52+_0x6c88('0x4e')+_0x43093e+_0x53c4f4};io['to'](util[_0x6c88('0x4f')](_0x6c88('0x50'),_0x477ae9))[_0x6c88('0x51')]('trigger:browser:url',_0x580717);}exports['cs']=function(_0x48583d,_0x5a717b,_0x212989,_0x4792ae,_0xcec883,_0x463db9,_0x19dd55,_0x5b85dd){var _0x47b1df={};var _0x1108f2={'user':_0x463db9[_0x6c88('0x52')],'pass':_0x463db9[_0x6c88('0x53')]};var _0x1348b0=_0x6c88('0x54');var _0x8a2d4=_0x6c88('0x55');_0x463db9['remoteUri']=intUtil[_0x6c88('0x56')](_0x463db9[_0x6c88('0x57')]);_0x463db9['serverUrl']=intUtil[_0x6c88('0x56')](_0x463db9[_0x6c88('0x58')]);var _0x50432e=util[_0x6c88('0x4f')](_0x6c88('0x59'),_0x463db9[_0x6c88('0x57')]);_0x47b1df[_0x6c88('0x22')]=!_[_0x6c88('0x5a')](_0x4792ae)?_0x4792ae[_0x6c88('0x5b')]:null;_0x47b1df[_0x6c88('0x1f')]=_0x463db9['email'];_0x47b1df[_0x6c88('0x24')]=_0x5b85dd[_0x6c88('0x37')]()===_0x6c88('0x39')?_0x5a717b[_0x6c88('0x5c')]:_0x5a717b[_0x6c88('0x5d')];_0x47b1df['callDirection']=_0x5b85dd===_0x6c88('0x5e')||_0x5b85dd===_0x6c88('0x5f')?_0x6c88('0x5e'):_0x6c88('0x39');var _0x1516e3=util[_0x6c88('0x4f')](_0x6c88('0x60'),_0x463db9['serverUrl'],_0x5a717b['uniqueid'],md5(_0x5a717b[_0x6c88('0x61')]));if(_0xcec883&&_0xcec883[_0x6c88('0x62')]){logger[_0x6c88('0x13')](_0x6c88('0x63'),_0x6c88('0x64'));_0x5a717b[_0x6c88('0x65')]=_0x1516e3;}else if(_0x19dd55&&_0x19dd55[_0x6c88('0x66')]&&_0x19dd55['recordingFormat']!==_0x6c88('0x67')){logger[_0x6c88('0x13')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x5a717b['recordingURL']=_0x1516e3;}else{_0x5a717b[_0x6c88('0x65')]='';}return getAdminUser(_0x5b85dd,_0x1108f2,_0x47b1df,_0x50432e,_0x8a2d4,_0x1348b0)['then'](getUser(_0x5b85dd,_0x1108f2,_0x50432e,_0x8a2d4,_0x1348b0))['then'](getEndUser(_0x5b85dd,_0x1108f2,_0x50432e,_0x8a2d4,_0x1348b0))[_0x6c88('0xe')](getTicket(_0x5b85dd,_0x1108f2,_0x50432e,_0x212989,_0x5a717b,_0x8a2d4))['then'](function(_0x9545c8){logger[_0x6c88('0x13')](util[_0x6c88('0x4f')](_0x6c88('0x68'),_0x9545c8[_0x6c88('0x3e')]));logger['info'](util[_0x6c88('0x4f')](_0x6c88('0x69'),_0x5b85dd));if(_0x5b85dd!==_0x6c88('0x5f')){logger['info']('['+[_0x5b85dd[_0x6c88('0x14')]()]+']',_0x6c88('0x6a'));emit(_0x463db9[_0x6c88('0x57')],_0x4792ae[_0x6c88('0x36')],_0x9545c8[_0x6c88('0x3e')]);}})[_0x6c88('0x15')](function(_0x6ad7eb){logger[_0x6c88('0x16')]('['+[_0x5b85dd[_0x6c88('0x14')]()]+_0x6c88('0x6b'),util[_0x6c88('0x6c')](_0x6ad7eb,{'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 b7500b4..49e4717 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 _0xacae=['xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Ticket\x20ID\x20is:','users','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','recordingFormat','destcalleridname','destcalleridnum','Fields','Outbound','Ticket\x20created!','contacts','version','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[OUTBOUND]','trigger:browser:url','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','redis','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','entry_list','find','user_name','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','phone_home','then','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','map','type','string','nameField','customField','toLowerCase','content','custom_fields','variable','Variable','POST','login','username','password','PLAIN'];(function(_0x5a99b6,_0x50c27f){var _0x18bb13=function(_0x5eefdf){while(--_0x5eefdf){_0x5a99b6['push'](_0x5a99b6['shift']());}};_0x18bb13(++_0x50c27f);}(_0xacae,0xab));var _0xeaca=function(_0x11fc36,_0x343f71){_0x11fc36=_0x11fc36-0x0;var _0x46b314=_0xacae[_0x11fc36];return _0x46b314;};'use strict';var _=require(_0xeaca('0x0'));var rp=require(_0xeaca('0x1'));var BPromise=require(_0xeaca('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0xeaca('0x3'));var intUtil=require(_0xeaca('0x4'));var config=require(_0xeaca('0x5'));var logger=require(_0xeaca('0x6'))(_0xeaca('0x7'));config['redis']=_[_0xeaca('0x8')](config[_0xeaca('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xeaca('0xa'))(new Redis(config[_0xeaca('0x9')]));var def={'method':'POST','json':!![]};function emit(_0x883d43,_0x5eb9ea,_0x1a1368){io['to'](_0x883d43)[_0xeaca('0xb')](_0x5eb9ea,_0x1a1368);}function getTicket(_0x1647a6,_0x27e8e2,_0x2c81d5,_0x2aafef,_0x26955a,_0x2c386c,_0x49a4f3,_0x2c0547){logger[_0xeaca('0xc')](_0xeaca('0xd'));var _0x424227=new Date();var _0x36d31e=[{'name':_0xeaca('0xe'),'value':intUtil[_0xeaca('0xf')](_0x2aafef['Subjects'],_0x26955a,'\x20')},{'name':_0xeaca('0x10'),'value':_0x27e8e2['id']},{'name':_0xeaca('0x11'),'value':_0x27e8e2['id']},{'name':_0xeaca('0x12'),'value':intUtil[_0xeaca('0xf')](_0x2aafef[_0xeaca('0x13')],_0x26955a,'\x0a')},{'name':_0xeaca('0x14'),'value':_0x424227[_0xeaca('0x15')]()[_0xeaca('0x16')](0x0,0x13)[_0xeaca('0x17')]('T','\x20')},{'name':_0xeaca('0x18'),'value':'0'},{'name':_0xeaca('0x19'),'value':'15'},{'name':_0xeaca('0x1a'),'value':_0x2c81d5['id']},{'name':_0xeaca('0x1b'),'value':_0xeaca('0x1c')},{'name':_0xeaca('0x1d'),'value':_0x2c81d5['name']},{'name':_0xeaca('0x1e'),'value':_0x2c0547}];if(_0x2c386c[_0xeaca('0x1f')]){_[_0xeaca('0x20')](_0x2c386c,function(_0x124f22){if(_0x26955a[_0x124f22[_0xeaca('0x21')]]){_0x36d31e[_0xeaca('0x22')]({'name':_0x124f22[_0xeaca('0x23')],'value':_0x26955a[_0x124f22[_0xeaca('0x21')]]});}});}return request({'form':{'method':_0xeaca('0x24'),'input_type':'JSON','response_type':_0xeaca('0x25'),'rest_data':JSON['stringify']({'session':_0x49a4f3['id'],'module_name':_0xeaca('0x26'),'name_value_list':_0x36d31e})}});}function getAuth(_0x506627){return util['format'](_0xeaca('0x27'),new Buffer(_0x506627[_0xeaca('0x28')]+':X')[_0xeaca('0x29')](_0xeaca('0x2a')));}function getServerInfo(_0x23a511){return request({'form':{'method':_0xeaca('0x2b'),'input_type':'JSON','response_type':_0xeaca('0x25'),'rest_data':JSON[_0xeaca('0x2c')]({'session':_0x23a511['id']})}});}function getUser(_0xf5fd62,_0x1a4e31,_0x48e90d){if(!_[_0xeaca('0x2d')](_0x1a4e31)){logger[_0xeaca('0xc')](_0xeaca('0x2e'),_0x1a4e31);return request({'form':{'method':'get_entry_list','input_type':_0xeaca('0x25'),'response_type':'JSON','rest_data':JSON[_0xeaca('0x2c')]({'session':_0x48e90d['id'],'module_name':_0xeaca('0x2f'),'query':util[_0xeaca('0x30')](_0xeaca('0x31'),_0x1a4e31),'order_by':'','offset':'0','select_fields':['id',_0xeaca('0xe'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x40fc07){if(_0x40fc07[_0xeaca('0x32')]['length']){var _0x25a4bf=_[_0xeaca('0x33')](_0x40fc07[_0xeaca('0x32')],function(_0x4f0ffa){return _0x4f0ffa['name_value_list'][_0xeaca('0x34')][_0xeaca('0x35')]===_0x1a4e31;});if(_0x25a4bf){logger['info'](_0xeaca('0x36'));return BPromise[_0xeaca('0x37')]({'id':_0x25a4bf[_0xeaca('0x38')]['id']['value'],'name':_0x25a4bf['name_value_list']['name'][_0xeaca('0x35')]});}}logger[_0xeaca('0xc')](_0xeaca('0x39'));return BPromise[_0xeaca('0x37')]({'id':_0x48e90d['name_value_list'][_0xeaca('0x3a')][_0xeaca('0x35')],'name':_0x48e90d['name_value_list'][_0xeaca('0x34')]['value']});});}else{logger[_0xeaca('0xc')](_0xeaca('0x3b'));return BPromise[_0xeaca('0x37')]({'id':_0x48e90d['name_value_list'][_0xeaca('0x3a')][_0xeaca('0x35')],'name':_0x48e90d[_0xeaca('0x38')][_0xeaca('0x34')][_0xeaca('0x35')]});}}function getEndUser(_0x1d03e2,_0x76539c,_0xb2a79b,_0x41b4a6){logger[_0xeaca('0xc')](_0xeaca('0x3c'),_0xb2a79b);return request({'form':{'method':_0xeaca('0x3d'),'input_type':_0xeaca('0x25'),'response_type':_0xeaca('0x25'),'rest_data':JSON[_0xeaca('0x2c')]({'session':_0x41b4a6['id'],'module_name':'Contacts','query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0xb2a79b),'order_by':'','offset':'0','select_fields':['id',_0xeaca('0xe'),_0xeaca('0x3e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xeaca('0x3f')](function(_0x39da0e){if(_0x39da0e['entry_list'][_0xeaca('0x1f')]){var _0x5b5471=_['find'](_0x39da0e[_0xeaca('0x32')],function(_0x5c06a8){return _0x5c06a8[_0xeaca('0x38')][_0xeaca('0x3e')]['value']===_0xb2a79b;});if(_0x5b5471){logger[_0xeaca('0xc')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x5b5471[_0xeaca('0x38')]['id'][_0xeaca('0x35')],'name':_0x5b5471[_0xeaca('0x38')][_0xeaca('0xe')]['value'],'phone':_0x5b5471['name_value_list']['phone_home'][_0xeaca('0x35')]});}}else{logger[_0xeaca('0xc')](_0xeaca('0x40'));return request({'form':{'method':'set_entry','input_type':_0xeaca('0x25'),'response_type':'JSON','rest_data':JSON[_0xeaca('0x2c')]({'session':_0x41b4a6['id'],'module_name':_0xeaca('0x1c'),'name_value_list':[{'name':_0xeaca('0x41'),'value':_0x76539c!==_0xeaca('0x42')?_0x76539c:util['format'](_0xeaca('0x43'),_0xb2a79b)},{'name':_0xeaca('0x3e'),'value':_0xb2a79b}]})}})[_0xeaca('0x3f')](function(_0x48f9ff){logger['info'](_0xeaca('0x44'));return BPromise['resolve']({'id':_0x48f9ff['id'],'name':_0x48f9ff['entry_list'][_0xeaca('0x41')][_0xeaca('0x35')],'phone':_0x48f9ff[_0xeaca('0x32')][_0xeaca('0x3e')][_0xeaca('0x35')]});});}});}function request(_0x56cda2){logger[_0xeaca('0x45')]('[HTTP]',JSON[_0xeaca('0x2c')](_0x56cda2));return rp(_['merge'](def,_0x56cda2));}function getTags(_0x4ea6ee,_0x412da6){var _0x304e65=[];if(_0x4ea6ee&&_0x4ea6ee[_0xeaca('0x1f')]>0x0){_0x304e65=_[_0xeaca('0x46')](_0x4ea6ee,_0x412da6);}return _0x304e65;}function getCustomFields(_0x15edad,_0x26f3e9){var _0x11d706=[];var _0x437324={'custom_fields':[]};if(_0x15edad[_0xeaca('0x1f')]>0x0){_[_0xeaca('0x20')](_0x15edad,function(_0x42b023){if(_0x42b023[_0xeaca('0x47')]===_0xeaca('0x48')&&_0x42b023[_0xeaca('0x49')]&&!_0x42b023[_0xeaca('0x4a')]){_0x437324[_0x42b023['nameField'][_0xeaca('0x4b')]()]=_0x42b023[_0xeaca('0x4c')]['toString']();}else if(_0x42b023[_0xeaca('0x47')]===_0xeaca('0x48')&&_0x42b023[_0xeaca('0x23')]&&_0x42b023['customField']){_0x437324[_0xeaca('0x4d')][_0xeaca('0x22')]({'id':_0x42b023['idField'],'value':_0x42b023['content'][_0xeaca('0x29')]()});}else if(_0x42b023['type']===_0xeaca('0x4e')&&_0x42b023[_0xeaca('0x21')]&&_0x42b023[_0xeaca('0x23')]&&_0x42b023[_0xeaca('0x4a')]){_0x26f3e9[_0x42b023[_0xeaca('0x21')]]&&_0x437324[_0xeaca('0x4d')][_0xeaca('0x22')]({'id':_0x42b023['idField'],'value':_0x26f3e9[_0x42b023['variableName']][_0xeaca('0x29')]()});}else if(_0x42b023['type']==='customVariable'&&_0x42b023[_0xeaca('0x4f')]&&_0x42b023[_0xeaca('0x4f')][_0xeaca('0xe')]&&_0x42b023[_0xeaca('0x23')]&&_0x42b023[_0xeaca('0x4a')]){_0x26f3e9[_0x42b023[_0xeaca('0x4f')]['name'][_0xeaca('0x4b')]()]&&_0x437324[_0xeaca('0x4d')]['push']({'id':_0x42b023[_0xeaca('0x23')],'value':_0x26f3e9[_0x42b023[_0xeaca('0x4f')][_0xeaca('0xe')][_0xeaca('0x4b')]()][_0xeaca('0x29')]()});}});}return _0x437324;}function getConnection(_0x1b87e2){return request({'method':_0xeaca('0x50'),'form':{'method':_0xeaca('0x51'),'input_type':_0xeaca('0x25'),'response_type':_0xeaca('0x25'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x1b87e2[_0xeaca('0x52')],'password':_0x1b87e2[_0xeaca('0x53')],'encryption':_0xeaca('0x54')},'application':_0xeaca('0x55')})}})[_0xeaca('0x3f')](function(_0x265d4a){var _0x4dedf1=_0x265d4a;if(_0x4dedf1['id']){def[_0xeaca('0x56')]=_0x4dedf1['id'];return BPromise[_0xeaca('0x37')](_0x4dedf1);}else{throw new Error(util['format'](_0xeaca('0x57'),_0x1b87e2['id']));}});}function setRelationship(_0x49c568,_0x39f973,_0x213566,_0x43bdce){return request({'form':{'method':_0xeaca('0x58'),'input_type':_0xeaca('0x25'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x49c568['id'],'module_name':_0xeaca('0x26'),'module_id':_0x213566['id'],'link_field_name':_0x43bdce,'related_ids':[_0x39f973['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xeaca('0x59')]=function(_0x4d039c,_0x386231,_0x5be27a,_0xa32ef,_0xacb9c8,_0x602ff2){var _0x273796,_0x4fcbf3,_0x1c8bde,_0x5af33d;_0x602ff2[_0xeaca('0x5a')]=intUtil[_0xeaca('0x5b')](_0x602ff2['remoteUri']);_0x602ff2[_0xeaca('0x5c')]=intUtil['stripTrailingSlash'](_0x602ff2[_0xeaca('0x5c')]);def[_0xeaca('0x5d')]=util[_0xeaca('0x30')](_0xeaca('0x5e'),_0x602ff2['remoteUri']);if(_0xacb9c8&&_0xacb9c8[_0xeaca('0x5f')]){logger[_0xeaca('0xc')]('[QUEUE]',_0xeaca('0x60'));_0x386231[_0xeaca('0x61')]=util['format'](_0xeaca('0x62'),_0x602ff2[_0xeaca('0x5c')],_0x386231[_0xeaca('0x63')],md5(_0x386231[_0xeaca('0x63')]));}else{_0x386231['recordingURL']='';}return getConnection(_0x602ff2)['then'](function(_0x149364){_0x5af33d=_0x149364;return getUser(_0x602ff2,_0xa32ef[_0xeaca('0xe')],_0x5af33d);})[_0xeaca('0x3f')](function(_0x2bad71){_0x273796=_0x2bad71;logger[_0xeaca('0xc')](_0xeaca('0x64'),_0x273796['id']);return getEndUser(_0x602ff2,_0x386231[_0xeaca('0x65')],_0x386231[_0xeaca('0x66')],_0x5af33d);})[_0xeaca('0x3f')](function(_0x5ba776){_0x4fcbf3=_0x5ba776;logger['info'](_0xeaca('0x67'),_0x4fcbf3['id']);return getTicket(_0x602ff2,_0x273796,_0x4fcbf3,_0x5be27a,_0x386231,_0x5be27a['Fields'],_0x5af33d,_0xeaca('0x68'));})[_0xeaca('0x3f')](function(_0x121307){_0x1c8bde=_0x121307;logger['info']('Ticket\x20created!');logger[_0xeaca('0xc')](_0xeaca('0x69'),_0x1c8bde['id']);return setRelationship(_0x5af33d,_0x273796,_0x1c8bde,_0xeaca('0x6a'));})['then'](function(){return setRelationship(_0x5af33d,_0x4fcbf3,_0x1c8bde,'contacts');})['then'](function(){return getServerInfo(_0x5af33d);})['then'](function(_0x1aa9d5){var _0x22bb72=parseInt(_0x1aa9d5['version'][_0xeaca('0x6b')](0x0));var _0x3d7230=util[_0xeaca('0x30')](_0xeaca('0x6c'),_0x602ff2[_0xeaca('0x5a')],_0x1c8bde['id']);if(_0x22bb72>0x6){_0x3d7230=util[_0xeaca('0x30')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x602ff2[_0xeaca('0x5a')],_0x1c8bde['id']);}logger[_0xeaca('0xc')](_0xeaca('0x6d'),_0xeaca('0x6e'));emit(util['format'](_0xeaca('0x6f'),_0xa32ef[_0xeaca('0xe')]),'trigger:browser:url',{'uri':_0x3d7230});})[_0xeaca('0x70')](function(_0x5e8085){logger[_0xeaca('0x71')]('[QUEUE]',JSON[_0xeaca('0x2c')](_0x5e8085));});};exports['outbound']=function(_0x20768c,_0x11fb94,_0xd75f01,_0x51f602,_0x15780f,_0x1bebdf,_0x27a676){var _0x195c32,_0x14c2f3,_0x57649c,_0x5385f1;_0x1bebdf['remoteUri']=intUtil[_0xeaca('0x5b')](_0x1bebdf[_0xeaca('0x5a')]);_0x1bebdf[_0xeaca('0x5c')]=intUtil[_0xeaca('0x5b')](_0x1bebdf[_0xeaca('0x5c')]);def['uri']=util[_0xeaca('0x30')](_0xeaca('0x5e'),_0x1bebdf[_0xeaca('0x5a')]);if(_0x27a676&&_0x27a676['recordingFormat']&&_0x27a676[_0xeaca('0x72')]!=='none'){logger['info']('[OUTBOUND]',_0xeaca('0x60'));_0x11fb94[_0xeaca('0x61')]=util[_0xeaca('0x30')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1bebdf['serverUrl'],_0x11fb94[_0xeaca('0x63')],md5(_0x11fb94['uniqueid']));}return getConnection(_0x1bebdf)[_0xeaca('0x3f')](function(_0x4160a2){_0x5385f1=_0x4160a2;return getUser(_0x1bebdf,_0x51f602['name'],_0x5385f1);})[_0xeaca('0x3f')](function(_0x33fb94){_0x195c32=_0x33fb94;logger['info'](_0xeaca('0x64'),_0x195c32['id']);return getEndUser(_0x1bebdf,_0x11fb94[_0xeaca('0x73')],_0x11fb94[_0xeaca('0x74')],_0x5385f1);})['then'](function(_0x4ecddc){_0x14c2f3=_0x4ecddc;logger[_0xeaca('0xc')](_0xeaca('0x67'),_0x14c2f3['id']);return getTicket(_0x1bebdf,_0x195c32,_0x14c2f3,_0xd75f01,_0x11fb94,_0xd75f01[_0xeaca('0x75')],_0x5385f1,_0xeaca('0x76'));})[_0xeaca('0x3f')](function(_0x4426ce){_0x57649c=_0x4426ce;logger[_0xeaca('0xc')](_0xeaca('0x77'));logger[_0xeaca('0xc')]('The\x20Ticket\x20ID\x20is:',_0x57649c['id']);return setRelationship(_0x5385f1,_0x195c32,_0x57649c,_0xeaca('0x6a'));})[_0xeaca('0x3f')](function(){return setRelationship(_0x5385f1,_0x14c2f3,_0x57649c,_0xeaca('0x78'));})[_0xeaca('0x3f')](function(){return getServerInfo(_0x5385f1);})[_0xeaca('0x3f')](function(_0x4fa23e){var _0x3b50e4=parseInt(_0x4fa23e[_0xeaca('0x79')][_0xeaca('0x6b')](0x0));var _0x5f11ab=util[_0xeaca('0x30')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x1bebdf[_0xeaca('0x5a')],_0x57649c['id']);if(_0x3b50e4>0x6){_0x5f11ab=util[_0xeaca('0x30')](_0xeaca('0x7a'),_0x1bebdf[_0xeaca('0x5a')],_0x57649c['id']);}logger['info'](_0xeaca('0x7b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xeaca('0x30')](_0xeaca('0x6f'),_0x51f602[_0xeaca('0xe')]),_0xeaca('0x7c'),{'uri':_0x5f11ab});})[_0xeaca('0x70')](function(_0x4df86c){logger[_0xeaca('0x71')](_0xeaca('0x7b'),JSON[_0xeaca('0x2c')](_0x4df86c));});};exports[_0xeaca('0x7d')]=function(_0x2c219a,_0x2904ff,_0xbd32af,_0x55c7ba,_0x564e80,_0x186493){var _0x5c47e3,_0x48e602,_0x350651,_0x567181;_0x186493[_0xeaca('0x5a')]=intUtil['stripTrailingSlash'](_0x186493[_0xeaca('0x5a')]);_0x186493['serverUrl']=intUtil[_0xeaca('0x5b')](_0x186493[_0xeaca('0x5c')]);def[_0xeaca('0x5d')]=util[_0xeaca('0x30')](_0xeaca('0x5e'),_0x186493[_0xeaca('0x5a')]);if(_0x564e80&&_0x564e80[_0xeaca('0x5f')]){logger[_0xeaca('0xc')]('['+_0x2904ff[_0xeaca('0x7e')][_0xeaca('0x7f')]()+']',_0xeaca('0x60'));_0x2904ff[_0xeaca('0x61')]=util[_0xeaca('0x30')](_0xeaca('0x62'),_0x186493[_0xeaca('0x5c')],_0x2904ff[_0xeaca('0x63')],md5(_0x2904ff['uniqueid']));}else{_0x2904ff[_0xeaca('0x61')]='';}return getConnection(_0x186493)[_0xeaca('0x3f')](function(_0x340aba){_0x567181=_0x340aba;if(!_['isNil'](_0x55c7ba)){return getUser(_0x186493,_0x55c7ba[_0xeaca('0xe')],_0x567181);}else{return getUser(_0x186493,null,_0x567181);}})[_0xeaca('0x3f')](function(_0x195db1){_0x5c47e3=_0x195db1;logger[_0xeaca('0xc')]('The\x20User\x20ID\x20is:',_0x5c47e3['id']);return getEndUser(_0x186493,_0x2904ff[_0xeaca('0x65')],_0x2904ff[_0xeaca('0x66')],_0x567181);})[_0xeaca('0x3f')](function(_0x484774){_0x48e602=_0x484774;logger[_0xeaca('0xc')](_0xeaca('0x67'),_0x48e602['id']);return getTicket(_0x186493,_0x5c47e3,_0x48e602,_0xbd32af,_0x2904ff,_0xbd32af[_0xeaca('0x75')],_0x567181,_0xeaca('0x68'));})['then'](function(_0x121d95){_0x350651=_0x121d95;logger['info'](_0xeaca('0x77'));logger[_0xeaca('0xc')](_0xeaca('0x69'),_0x350651['id']);return setRelationship(_0x567181,_0x5c47e3,_0x350651,_0xeaca('0x6a'));})[_0xeaca('0x3f')](function(){return setRelationship(_0x567181,_0x48e602,_0x350651,_0xeaca('0x78'));})['then'](function(){return getServerInfo(_0x567181);})[_0xeaca('0x70')](function(_0x40cca1){logger[_0xeaca('0x71')]('['+_0x2904ff[_0xeaca('0x7e')]['toUpperCase']()+']',JSON['stringify'](_0x40cca1));});}; \ No newline at end of file +var _0x27ce=['slice','replace','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','JSON','stringify','Calls','format','Basic\x20%s','toString','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','user_name','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','merge','map','type','string','customField','nameField','content','custom_fields','customVariable','Variable','toLowerCase','login','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','unmanaged','toUpperCase','isNil','catch','lastevent','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','Subjects','created_by','description','Descriptions','date_start','toISOString'];(function(_0x95411e,_0x38b4c3){var _0x2c8718=function(_0x35c672){while(--_0x35c672){_0x95411e['push'](_0x95411e['shift']());}};_0x2c8718(++_0x38b4c3);}(_0x27ce,0x1d5));var _0xe27c=function(_0x221c68,_0x4f6d49){_0x221c68=_0x221c68-0x0;var _0x3455b4=_0x27ce[_0x221c68];return _0x3455b4;};'use strict';var _=require(_0xe27c('0x0'));var rp=require(_0xe27c('0x1'));var BPromise=require(_0xe27c('0x2'));var md5=require(_0xe27c('0x3'));var util=require(_0xe27c('0x4'));var Redis=require(_0xe27c('0x5'));var intUtil=require(_0xe27c('0x6'));var config=require(_0xe27c('0x7'));var logger=require('../../../../config/logger')('sugarcrm');config[_0xe27c('0x8')]=_[_0xe27c('0x9')](config[_0xe27c('0x8')],{'host':_0xe27c('0xa'),'port':0x18eb});var io=require(_0xe27c('0xb'))(new Redis(config[_0xe27c('0x8')]));var def={'method':_0xe27c('0xc'),'json':!![]};function emit(_0x22eb75,_0x52fa05,_0xa1419e){io['to'](_0x22eb75)[_0xe27c('0xd')](_0x52fa05,_0xa1419e);}function getTicket(_0xeb72cf,_0x76f46e,_0x580df6,_0x433d02,_0x339248,_0x2f1951,_0x267d01,_0xfae31a){logger[_0xe27c('0xe')](_0xe27c('0xf'));var _0x173d36=new Date();var _0x3ac909=[{'name':_0xe27c('0x10'),'value':intUtil['getString'](_0x433d02[_0xe27c('0x11')],_0x339248,'\x20')},{'name':'assigned_user_id','value':_0x76f46e['id']},{'name':_0xe27c('0x12'),'value':_0x76f46e['id']},{'name':_0xe27c('0x13'),'value':intUtil['getString'](_0x433d02[_0xe27c('0x14')],_0x339248,'\x0a')},{'name':_0xe27c('0x15'),'value':_0x173d36[_0xe27c('0x16')]()[_0xe27c('0x17')](0x0,0x13)[_0xe27c('0x18')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xe27c('0x19'),'value':'15'},{'name':_0xe27c('0x1a'),'value':_0x580df6['id']},{'name':_0xe27c('0x1b'),'value':_0xe27c('0x1c')},{'name':_0xe27c('0x1d'),'value':_0x580df6[_0xe27c('0x10')]},{'name':_0xe27c('0x1e'),'value':_0xfae31a}];if(_0x2f1951[_0xe27c('0x1f')]){_[_0xe27c('0x20')](_0x2f1951,function(_0x1ee004){if(_0x339248[_0x1ee004[_0xe27c('0x21')]]){_0x3ac909[_0xe27c('0x22')]({'name':_0x1ee004[_0xe27c('0x23')],'value':_0x339248[_0x1ee004[_0xe27c('0x21')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0xe27c('0x24'),'rest_data':JSON[_0xe27c('0x25')]({'session':_0x267d01['id'],'module_name':_0xe27c('0x26'),'name_value_list':_0x3ac909})}});}function getAuth(_0x2d5eac){return util[_0xe27c('0x27')](_0xe27c('0x28'),new Buffer(_0x2d5eac['apiKey']+':X')[_0xe27c('0x29')]('base64'));}function getServerInfo(_0xea9fe6){return request({'form':{'method':_0xe27c('0x2a'),'input_type':_0xe27c('0x24'),'response_type':'JSON','rest_data':JSON[_0xe27c('0x25')]({'session':_0xea9fe6['id']})}});}function getUser(_0x5dbde9,_0x2f22bd,_0x22b0db){if(!_['isNil'](_0x2f22bd)){logger[_0xe27c('0xe')](_0xe27c('0x2b'),_0x2f22bd);return request({'form':{'method':_0xe27c('0x2c'),'input_type':_0xe27c('0x24'),'response_type':_0xe27c('0x24'),'rest_data':JSON[_0xe27c('0x25')]({'session':_0x22b0db['id'],'module_name':'Employees','query':util['format'](_0xe27c('0x2d'),_0x2f22bd),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe27c('0x2e')](function(_0x21e72d){if(_0x21e72d[_0xe27c('0x2f')]['length']){var _0x3d8951=_[_0xe27c('0x30')](_0x21e72d[_0xe27c('0x2f')],function(_0x2be748){return _0x2be748[_0xe27c('0x31')][_0xe27c('0x32')][_0xe27c('0x33')]===_0x2f22bd;});if(_0x3d8951){logger[_0xe27c('0xe')]('Agent\x20found!');return BPromise[_0xe27c('0x34')]({'id':_0x3d8951['name_value_list']['id']['value'],'name':_0x3d8951['name_value_list'][_0xe27c('0x10')][_0xe27c('0x33')]});}}logger[_0xe27c('0xe')](_0xe27c('0x35'));return BPromise['resolve']({'id':_0x22b0db[_0xe27c('0x31')]['user_id']['value'],'name':_0x22b0db['name_value_list'][_0xe27c('0x32')]['value']});});}else{logger[_0xe27c('0xe')](_0xe27c('0x36'));return BPromise[_0xe27c('0x34')]({'id':_0x22b0db['name_value_list']['user_id'][_0xe27c('0x33')],'name':_0x22b0db['name_value_list'][_0xe27c('0x32')][_0xe27c('0x33')]});}}function getEndUser(_0x3c02f4,_0x3bb53a,_0x204071,_0xbbce6){logger[_0xe27c('0xe')]('Searching\x20enduser\x20with\x20phone',_0x204071);return request({'form':{'method':_0xe27c('0x2c'),'input_type':_0xe27c('0x24'),'response_type':_0xe27c('0x24'),'rest_data':JSON[_0xe27c('0x25')]({'session':_0xbbce6['id'],'module_name':_0xe27c('0x1c'),'query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x204071),'order_by':'','offset':'0','select_fields':['id',_0xe27c('0x10'),_0xe27c('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x430acc){if(_0x430acc[_0xe27c('0x2f')][_0xe27c('0x1f')]){var _0x11e811=_[_0xe27c('0x30')](_0x430acc['entry_list'],function(_0x593015){return _0x593015[_0xe27c('0x31')][_0xe27c('0x37')]['value']===_0x204071;});if(_0x11e811){logger[_0xe27c('0xe')](_0xe27c('0x38'));return BPromise['resolve']({'id':_0x11e811[_0xe27c('0x31')]['id'][_0xe27c('0x33')],'name':_0x11e811['name_value_list'][_0xe27c('0x10')][_0xe27c('0x33')],'phone':_0x11e811[_0xe27c('0x31')]['phone_home'][_0xe27c('0x33')]});}}else{logger[_0xe27c('0xe')](_0xe27c('0x39'));return request({'form':{'method':_0xe27c('0x3a'),'input_type':_0xe27c('0x24'),'response_type':_0xe27c('0x24'),'rest_data':JSON[_0xe27c('0x25')]({'session':_0xbbce6['id'],'module_name':_0xe27c('0x1c'),'name_value_list':[{'name':'first_name','value':_0x3bb53a!==_0xe27c('0x3b')?_0x3bb53a:util[_0xe27c('0x27')](_0xe27c('0x3c'),_0x204071)},{'name':_0xe27c('0x37'),'value':_0x204071}]})}})[_0xe27c('0x2e')](function(_0x283e87){logger[_0xe27c('0xe')](_0xe27c('0x3d'));return BPromise['resolve']({'id':_0x283e87['id'],'name':_0x283e87[_0xe27c('0x2f')][_0xe27c('0x3e')][_0xe27c('0x33')],'phone':_0x283e87[_0xe27c('0x2f')][_0xe27c('0x37')]['value']});});}});}function request(_0x15dd7d){logger[_0xe27c('0x3f')](_0xe27c('0x40'),JSON['stringify'](_0x15dd7d));return rp(_[_0xe27c('0x41')](def,_0x15dd7d));}function getTags(_0x421d67,_0x3a3871){var _0x35ec62=[];if(_0x421d67&&_0x421d67[_0xe27c('0x1f')]>0x0){_0x35ec62=_[_0xe27c('0x42')](_0x421d67,_0x3a3871);}return _0x35ec62;}function getCustomFields(_0x5d573d,_0x2f1378){var _0x3d1b19=[];var _0x5b86fa={'custom_fields':[]};if(_0x5d573d[_0xe27c('0x1f')]>0x0){_[_0xe27c('0x20')](_0x5d573d,function(_0x5a0d97){if(_0x5a0d97[_0xe27c('0x43')]===_0xe27c('0x44')&&_0x5a0d97['nameField']&&!_0x5a0d97[_0xe27c('0x45')]){_0x5b86fa[_0x5a0d97[_0xe27c('0x46')]['toLowerCase']()]=_0x5a0d97[_0xe27c('0x47')]['toString']();}else if(_0x5a0d97[_0xe27c('0x43')]===_0xe27c('0x44')&&_0x5a0d97[_0xe27c('0x23')]&&_0x5a0d97[_0xe27c('0x45')]){_0x5b86fa['custom_fields'][_0xe27c('0x22')]({'id':_0x5a0d97[_0xe27c('0x23')],'value':_0x5a0d97[_0xe27c('0x47')]['toString']()});}else if(_0x5a0d97[_0xe27c('0x43')]==='variable'&&_0x5a0d97[_0xe27c('0x21')]&&_0x5a0d97['idField']&&_0x5a0d97[_0xe27c('0x45')]){_0x2f1378[_0x5a0d97[_0xe27c('0x21')]]&&_0x5b86fa[_0xe27c('0x48')][_0xe27c('0x22')]({'id':_0x5a0d97['idField'],'value':_0x2f1378[_0x5a0d97[_0xe27c('0x21')]][_0xe27c('0x29')]()});}else if(_0x5a0d97[_0xe27c('0x43')]===_0xe27c('0x49')&&_0x5a0d97[_0xe27c('0x4a')]&&_0x5a0d97[_0xe27c('0x4a')][_0xe27c('0x10')]&&_0x5a0d97[_0xe27c('0x23')]&&_0x5a0d97[_0xe27c('0x45')]){_0x2f1378[_0x5a0d97['Variable'][_0xe27c('0x10')][_0xe27c('0x4b')]()]&&_0x5b86fa[_0xe27c('0x48')]['push']({'id':_0x5a0d97['idField'],'value':_0x2f1378[_0x5a0d97[_0xe27c('0x4a')]['name'][_0xe27c('0x4b')]()][_0xe27c('0x29')]()});}});}return _0x5b86fa;}function getConnection(_0x6b130b){return request({'method':_0xe27c('0xc'),'form':{'method':_0xe27c('0x4c'),'input_type':_0xe27c('0x24'),'response_type':_0xe27c('0x24'),'rest_data':JSON[_0xe27c('0x25')]({'user_auth':{'user_name':_0x6b130b[_0xe27c('0x4d')],'password':_0x6b130b[_0xe27c('0x4e')],'encryption':_0xe27c('0x4f')},'application':'xCALLY\x20Motion\x20integration'})}})[_0xe27c('0x2e')](function(_0x222d23){var _0x44fc0b=_0x222d23;if(_0x44fc0b['id']){def[_0xe27c('0x50')]=_0x44fc0b['id'];return BPromise[_0xe27c('0x34')](_0x44fc0b);}else{throw new Error(util[_0xe27c('0x27')](_0xe27c('0x51'),_0x6b130b['id']));}});}function setRelationship(_0x5df175,_0x190e33,_0x2f5bcb,_0x2f7006){return request({'form':{'method':_0xe27c('0x52'),'input_type':_0xe27c('0x24'),'response_type':'JSON','rest_data':JSON[_0xe27c('0x25')]({'session':_0x5df175['id'],'module_name':'Calls','module_id':_0x2f5bcb['id'],'link_field_name':_0x2f7006,'related_ids':[_0x190e33['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xe27c('0x53')]=function(_0x2f5a8b,_0x3bf9f9,_0x20130e,_0x4e727b,_0x3b8292,_0x2fbd7b){var _0x4a3fd0,_0x5cd239,_0x1a9930,_0x352c9a;_0x2fbd7b[_0xe27c('0x54')]=intUtil[_0xe27c('0x55')](_0x2fbd7b[_0xe27c('0x54')]);_0x2fbd7b[_0xe27c('0x56')]=intUtil['stripTrailingSlash'](_0x2fbd7b['serverUrl']);def[_0xe27c('0x57')]=util['format'](_0xe27c('0x58'),_0x2fbd7b[_0xe27c('0x54')]);if(_0x3b8292&&_0x3b8292['monitor_format']){logger[_0xe27c('0xe')](_0xe27c('0x59'),_0xe27c('0x5a'));_0x3bf9f9[_0xe27c('0x5b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2fbd7b['serverUrl'],_0x3bf9f9[_0xe27c('0x5c')],md5(_0x3bf9f9[_0xe27c('0x5c')]));}else{_0x3bf9f9[_0xe27c('0x5b')]='';}return getConnection(_0x2fbd7b)[_0xe27c('0x2e')](function(_0x108275){_0x352c9a=_0x108275;return getUser(_0x2fbd7b,_0x4e727b['name'],_0x352c9a);})[_0xe27c('0x2e')](function(_0x5878b9){_0x4a3fd0=_0x5878b9;logger[_0xe27c('0xe')]('The\x20User\x20ID\x20is:',_0x4a3fd0['id']);return getEndUser(_0x2fbd7b,_0x3bf9f9[_0xe27c('0x5d')],_0x3bf9f9[_0xe27c('0x5e')],_0x352c9a);})[_0xe27c('0x2e')](function(_0x3ad60c){_0x5cd239=_0x3ad60c;logger[_0xe27c('0xe')](_0xe27c('0x5f'),_0x5cd239['id']);return getTicket(_0x2fbd7b,_0x4a3fd0,_0x5cd239,_0x20130e,_0x3bf9f9,_0x20130e[_0xe27c('0x60')],_0x352c9a,_0xe27c('0x61'));})[_0xe27c('0x2e')](function(_0x228798){_0x1a9930=_0x228798;logger[_0xe27c('0xe')](_0xe27c('0x62'));logger[_0xe27c('0xe')]('The\x20Ticket\x20ID\x20is:',_0x1a9930['id']);return setRelationship(_0x352c9a,_0x4a3fd0,_0x1a9930,_0xe27c('0x63'));})['then'](function(){return setRelationship(_0x352c9a,_0x5cd239,_0x1a9930,_0xe27c('0x64'));})['then'](function(){return getServerInfo(_0x352c9a);})[_0xe27c('0x2e')](function(_0x52eb3f){var _0x4fcbd8=parseInt(_0x52eb3f[_0xe27c('0x65')][_0xe27c('0x66')](0x0));var _0x13348d=util['format'](_0xe27c('0x67'),_0x2fbd7b[_0xe27c('0x54')],_0x1a9930['id']);if(_0x4fcbd8>0x6){_0x13348d=util['format'](_0xe27c('0x68'),_0x2fbd7b['remoteUri'],_0x1a9930['id']);}logger[_0xe27c('0xe')](_0xe27c('0x59'),_0xe27c('0x69'));emit(util[_0xe27c('0x27')](_0xe27c('0x6a'),_0x4e727b['name']),_0xe27c('0x6b'),{'uri':_0x13348d});})['catch'](function(_0x50806f){logger[_0xe27c('0x6c')]('[QUEUE]',JSON[_0xe27c('0x25')](_0x50806f));});};exports[_0xe27c('0x6d')]=function(_0x1b2eb0,_0x4b314,_0x317636,_0x174481,_0x57eb26,_0x93ff7c,_0x307210){var _0x2e9c2e,_0x3b5f12,_0x98011a,_0x480c21;_0x93ff7c[_0xe27c('0x54')]=intUtil[_0xe27c('0x55')](_0x93ff7c[_0xe27c('0x54')]);_0x93ff7c['serverUrl']=intUtil[_0xe27c('0x55')](_0x93ff7c[_0xe27c('0x56')]);def[_0xe27c('0x57')]=util[_0xe27c('0x27')](_0xe27c('0x58'),_0x93ff7c[_0xe27c('0x54')]);if(_0x307210&&_0x307210[_0xe27c('0x6e')]&&_0x307210[_0xe27c('0x6e')]!==_0xe27c('0x6f')){logger[_0xe27c('0xe')](_0xe27c('0x70'),'Recording\x20is\x20enabled!');_0x4b314[_0xe27c('0x5b')]=util[_0xe27c('0x27')](_0xe27c('0x71'),_0x93ff7c[_0xe27c('0x56')],_0x4b314[_0xe27c('0x5c')],md5(_0x4b314['uniqueid']));}return getConnection(_0x93ff7c)[_0xe27c('0x2e')](function(_0x6d7df5){_0x480c21=_0x6d7df5;return getUser(_0x93ff7c,_0x174481['name'],_0x480c21);})[_0xe27c('0x2e')](function(_0x2211f8){_0x2e9c2e=_0x2211f8;logger[_0xe27c('0xe')](_0xe27c('0x72'),_0x2e9c2e['id']);return getEndUser(_0x93ff7c,_0x4b314[_0xe27c('0x73')],_0x4b314[_0xe27c('0x74')],_0x480c21);})[_0xe27c('0x2e')](function(_0x47971b){_0x3b5f12=_0x47971b;logger['info']('The\x20Enduser\x20ID\x20is:',_0x3b5f12['id']);return getTicket(_0x93ff7c,_0x2e9c2e,_0x3b5f12,_0x317636,_0x4b314,_0x317636['Fields'],_0x480c21,'Outbound');})[_0xe27c('0x2e')](function(_0x2dd7b4){_0x98011a=_0x2dd7b4;logger[_0xe27c('0xe')](_0xe27c('0x62'));logger[_0xe27c('0xe')](_0xe27c('0x75'),_0x98011a['id']);return setRelationship(_0x480c21,_0x2e9c2e,_0x98011a,_0xe27c('0x63'));})[_0xe27c('0x2e')](function(){return setRelationship(_0x480c21,_0x3b5f12,_0x98011a,_0xe27c('0x64'));})[_0xe27c('0x2e')](function(){return getServerInfo(_0x480c21);})['then'](function(_0x59a1e4){var _0x25e120=parseInt(_0x59a1e4['version'][_0xe27c('0x66')](0x0));var _0x167f4d=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x93ff7c['remoteUri'],_0x98011a['id']);if(_0x25e120>0x6){_0x167f4d=util[_0xe27c('0x27')](_0xe27c('0x68'),_0x93ff7c['remoteUri'],_0x98011a['id']);}logger[_0xe27c('0xe')](_0xe27c('0x70'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe27c('0x27')](_0xe27c('0x6a'),_0x174481[_0xe27c('0x10')]),_0xe27c('0x6b'),{'uri':_0x167f4d});})['catch'](function(_0x2f95f1){logger[_0xe27c('0x6c')]('[OUTBOUND]',JSON[_0xe27c('0x25')](_0x2f95f1));});};exports[_0xe27c('0x76')]=function(_0x416e1e,_0x1d39d1,_0x3f39e5,_0x277a54,_0x315393,_0x5a7415){var _0x52adff,_0x49a395,_0x324d9e,_0x54e1ac;_0x5a7415[_0xe27c('0x54')]=intUtil[_0xe27c('0x55')](_0x5a7415[_0xe27c('0x54')]);_0x5a7415[_0xe27c('0x56')]=intUtil[_0xe27c('0x55')](_0x5a7415[_0xe27c('0x56')]);def['uri']=util[_0xe27c('0x27')]('%s/service/v4_1/rest.php',_0x5a7415[_0xe27c('0x54')]);if(_0x315393&&_0x315393['monitor_format']){logger['info']('['+_0x1d39d1['lastevent'][_0xe27c('0x77')]()+']',_0xe27c('0x5a'));_0x1d39d1['recordingURL']=util[_0xe27c('0x27')](_0xe27c('0x71'),_0x5a7415[_0xe27c('0x56')],_0x1d39d1[_0xe27c('0x5c')],md5(_0x1d39d1['uniqueid']));}else{_0x1d39d1[_0xe27c('0x5b')]='';}return getConnection(_0x5a7415)['then'](function(_0x3d1167){_0x54e1ac=_0x3d1167;if(!_[_0xe27c('0x78')](_0x277a54)){return getUser(_0x5a7415,_0x277a54['name'],_0x54e1ac);}else{return getUser(_0x5a7415,null,_0x54e1ac);}})['then'](function(_0x5e4f95){_0x52adff=_0x5e4f95;logger[_0xe27c('0xe')]('The\x20User\x20ID\x20is:',_0x52adff['id']);return getEndUser(_0x5a7415,_0x1d39d1[_0xe27c('0x5d')],_0x1d39d1[_0xe27c('0x5e')],_0x54e1ac);})[_0xe27c('0x2e')](function(_0x10757c){_0x49a395=_0x10757c;logger[_0xe27c('0xe')](_0xe27c('0x5f'),_0x49a395['id']);return getTicket(_0x5a7415,_0x52adff,_0x49a395,_0x3f39e5,_0x1d39d1,_0x3f39e5[_0xe27c('0x60')],_0x54e1ac,_0xe27c('0x61'));})[_0xe27c('0x2e')](function(_0x1c4a57){_0x324d9e=_0x1c4a57;logger['info'](_0xe27c('0x62'));logger['info'](_0xe27c('0x75'),_0x324d9e['id']);return setRelationship(_0x54e1ac,_0x52adff,_0x324d9e,_0xe27c('0x63'));})[_0xe27c('0x2e')](function(){return setRelationship(_0x54e1ac,_0x49a395,_0x324d9e,_0xe27c('0x64'));})[_0xe27c('0x2e')](function(){return getServerInfo(_0x54e1ac);})[_0xe27c('0x79')](function(_0xd517df){logger[_0xe27c('0x6c')]('['+_0x1d39d1[_0xe27c('0x7a')][_0xe27c('0x77')]()+']',JSON[_0xe27c('0x25')](_0xd517df));});}; \ 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 2073e68..ae3cf0c 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 _0x1472=['variableName','customVariable','Variable','name','toLowerCase','keyType','key','format','%s:\x20%s','keyContent','join','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','length','string','push','content','type','variable'];(function(_0x35de6c,_0x46bbcb){var _0x314f2d=function(_0x41a8e4){while(--_0x41a8e4){_0x35de6c['push'](_0x35de6c['shift']());}};_0x314f2d(++_0x46bbcb);}(_0x1472,0x1d3));var _0x2147=function(_0x385eb1,_0x497a94){_0x385eb1=_0x385eb1-0x0;var _0x5d40eb=_0x1472[_0x385eb1];return _0x5d40eb;};'use strict';var _=require(_0x2147('0x0'));var util=require(_0x2147('0x1'));exports['getString']=function(_0x1e76da,_0x1acf3f,_0x56522f){var _0x16e849=[];if(_0x1e76da[_0x2147('0x2')]>0x0){var _0xd76080=_['sortBy'](_0x1e76da,['id']);for(var _0x48464b=0x0;_0x48464b<_0xd76080[_0x2147('0x2')];_0x48464b++){var _0x3fde9f=_0xd76080[_0x48464b];if(_0x3fde9f['type']===_0x2147('0x3')){_0x16e849[_0x2147('0x4')](_0x3fde9f[_0x2147('0x5')]);}else if(_0x3fde9f[_0x2147('0x6')]===_0x2147('0x7')&&_0x3fde9f[_0x2147('0x8')]){_0x1acf3f[_0x3fde9f[_0x2147('0x8')]]&&_0x16e849[_0x2147('0x4')](_0x1acf3f[_0x3fde9f[_0x2147('0x8')]]['toString']());}else if(_0x3fde9f[_0x2147('0x6')]===_0x2147('0x9')&&_0x3fde9f['Variable']&&_0x3fde9f[_0x2147('0xa')][_0x2147('0xb')]){_0x1acf3f[_0x3fde9f['Variable'][_0x2147('0xb')][_0x2147('0xc')]()]&&_0x16e849['push'](_0x1acf3f[_0x3fde9f['Variable']['name'][_0x2147('0xc')]()]['toString']());}else if(_0x3fde9f[_0x2147('0x6')]==='keyValue'){if(_0x3fde9f[_0x2147('0xd')]==='string'&&_0x3fde9f[_0x2147('0xe')]){_0x16e849[_0x2147('0x4')](util[_0x2147('0xf')](_0x2147('0x10'),_0x3fde9f['key'],_0x3fde9f[_0x2147('0x11')]));}else if(_0x3fde9f['keyType']===_0x2147('0x7')&&_0x3fde9f[_0x2147('0x8')]&&_0x3fde9f[_0x2147('0xe')]){_0x1acf3f[_0x3fde9f[_0x2147('0x8')]]&&_0x16e849[_0x2147('0x4')](util['format']('%s:\x20%s',_0x3fde9f[_0x2147('0xe')],_0x1acf3f[_0x3fde9f[_0x2147('0x8')]]));}else if(_0x3fde9f[_0x2147('0xd')]===_0x2147('0x9')&&_0x3fde9f[_0x2147('0xa')]&&_0x3fde9f['Variable'][_0x2147('0xb')]&&_0x3fde9f[_0x2147('0xe')]){_0x1acf3f[_0x3fde9f[_0x2147('0xa')][_0x2147('0xb')]['toLowerCase']()]&&_0x16e849[_0x2147('0x4')](util[_0x2147('0xf')](_0x2147('0x10'),_0x3fde9f[_0x2147('0xe')],_0x1acf3f[_0x3fde9f[_0x2147('0xa')]['name']['toLowerCase']()]));}}}}return _0x16e849[_0x2147('0x12')](_0x56522f);};exports['stripTrailingSlash']=function(_0x4d820b){var _0x4999d1=_0x4d820b[_0x2147('0x13')](-0x1);if(_0x4999d1==='/'){_0x4d820b=_0x4d820b[_0x2147('0x14')](0x0,_0x4d820b[_0x2147('0x15')](_0x4999d1));}return _0x4d820b;};exports[_0x2147('0x16')]=function(_0x428743){if(!_[_0x2147('0x17')](_0x428743)&&_0x428743!==''){var _0x28459c=/^(([^<>()\[\]\\.,;:\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 _0x28459c[_0x2147('0x18')](String(_0x428743)[_0x2147('0xc')]());}else{return![];}}; \ No newline at end of file +var _0xa6c6=['push','content','type','variableName','toString','Variable','name','toLowerCase','keyValue','keyType','key','%s:\x20%s','keyContent','variable','format','customVariable','stripTrailingSlash','slice','substring','validateEmail','isNil','lodash','util','length','string'];(function(_0x2212d1,_0x483fc8){var _0x15eec5=function(_0x15e6ac){while(--_0x15e6ac){_0x2212d1['push'](_0x2212d1['shift']());}};_0x15eec5(++_0x483fc8);}(_0xa6c6,0x128));var _0x6a6c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xa6c6[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x6a6c('0x0'));var util=require(_0x6a6c('0x1'));exports['getString']=function(_0x5523f5,_0x3b9e51,_0x31a1ad){var _0x767ed5=[];if(_0x5523f5[_0x6a6c('0x2')]>0x0){var _0x2f7ca4=_['sortBy'](_0x5523f5,['id']);for(var _0x8fc2f3=0x0;_0x8fc2f3<_0x2f7ca4[_0x6a6c('0x2')];_0x8fc2f3++){var _0x941254=_0x2f7ca4[_0x8fc2f3];if(_0x941254['type']===_0x6a6c('0x3')){_0x767ed5[_0x6a6c('0x4')](_0x941254[_0x6a6c('0x5')]);}else if(_0x941254[_0x6a6c('0x6')]==='variable'&&_0x941254[_0x6a6c('0x7')]){_0x3b9e51[_0x941254['variableName']]&&_0x767ed5['push'](_0x3b9e51[_0x941254[_0x6a6c('0x7')]][_0x6a6c('0x8')]());}else if(_0x941254['type']==='customVariable'&&_0x941254[_0x6a6c('0x9')]&&_0x941254[_0x6a6c('0x9')]['name']){_0x3b9e51[_0x941254[_0x6a6c('0x9')][_0x6a6c('0xa')][_0x6a6c('0xb')]()]&&_0x767ed5[_0x6a6c('0x4')](_0x3b9e51[_0x941254[_0x6a6c('0x9')][_0x6a6c('0xa')]['toLowerCase']()][_0x6a6c('0x8')]());}else if(_0x941254[_0x6a6c('0x6')]===_0x6a6c('0xc')){if(_0x941254[_0x6a6c('0xd')]==='string'&&_0x941254[_0x6a6c('0xe')]){_0x767ed5[_0x6a6c('0x4')](util['format'](_0x6a6c('0xf'),_0x941254[_0x6a6c('0xe')],_0x941254[_0x6a6c('0x10')]));}else if(_0x941254[_0x6a6c('0xd')]===_0x6a6c('0x11')&&_0x941254[_0x6a6c('0x7')]&&_0x941254[_0x6a6c('0xe')]){_0x3b9e51[_0x941254[_0x6a6c('0x7')]]&&_0x767ed5[_0x6a6c('0x4')](util[_0x6a6c('0x12')](_0x6a6c('0xf'),_0x941254['key'],_0x3b9e51[_0x941254['variableName']]));}else if(_0x941254[_0x6a6c('0xd')]===_0x6a6c('0x13')&&_0x941254[_0x6a6c('0x9')]&&_0x941254['Variable'][_0x6a6c('0xa')]&&_0x941254['key']){_0x3b9e51[_0x941254['Variable'][_0x6a6c('0xa')][_0x6a6c('0xb')]()]&&_0x767ed5[_0x6a6c('0x4')](util['format'](_0x6a6c('0xf'),_0x941254[_0x6a6c('0xe')],_0x3b9e51[_0x941254[_0x6a6c('0x9')][_0x6a6c('0xa')]['toLowerCase']()]));}}}}return _0x767ed5['join'](_0x31a1ad);};exports[_0x6a6c('0x14')]=function(_0x5a1a91){var _0x320f6c=_0x5a1a91[_0x6a6c('0x15')](-0x1);if(_0x320f6c==='/'){_0x5a1a91=_0x5a1a91[_0x6a6c('0x16')](0x0,_0x5a1a91['lastIndexOf'](_0x320f6c));}return _0x5a1a91;};exports[_0x6a6c('0x17')]=function(_0x32d76d){if(!_[_0x6a6c('0x18')](_0x32d76d)&&_0x32d76d!==''){var _0x38db24=/^(([^<>()\[\]\\.,;:\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 _0x38db24['test'](String(_0x32d76d)[_0x6a6c('0xb')]());}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 a060b13..71359a6 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(_0x3cdb38,_0x402ef1){var _0x558522=function(_0x47f069){while(--_0x47f069){_0x3cdb38['push'](_0x3cdb38['shift']());}};_0x558522(++_0x402ef1);}(_0x34e8,0x12c));var _0x834e=function(_0x1a89d4,_0x4867df){_0x1a89d4=_0x1a89d4-0x0;var _0x59ae77=_0x34e8[_0x1a89d4];return _0x59ae77;};'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(_0x350cfa,_0x597d9c){var _0xe33526=function(_0xb7b79a){while(--_0xb7b79a){_0x350cfa['push'](_0x350cfa['shift']());}};_0xe33526(++_0x597d9c);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'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 097b831..4e4a395 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 _0xde53=['custom_fields','push','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','trigger:browser:url','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','info','format','%s/tickets.json','remoteUri','POST','merge','name','getString','Descriptions','Ticket\x20created!','ticket','validateEmail','type:user\x20role:agent\x20email:%s','then','count','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','length','%s/users.json','end-user','Enduser\x20created.','authType','password','username','token','%s/token:%s','Basic\x20%s','base64','[HTTP]','stringify','GET','map','string','picklist','type','nameField','toLowerCase','content','toString','idField','customField'];(function(_0x9d6369,_0xc84bae){var _0x3e1aff=function(_0x179fb1){while(--_0x179fb1){_0x9d6369['push'](_0x9d6369['shift']());}};_0x3e1aff(++_0xc84bae);}(_0xde53,0x1da));var _0x3de5=function(_0xc8148,_0x5a54e7){_0xc8148=_0xc8148-0x0;var _0xf94e19=_0xde53[_0xc8148];return _0xf94e19;};'use strict';var _=require(_0x3de5('0x0'));var rp=require('request-promise');var md5=require(_0x3de5('0x1'));var util=require(_0x3de5('0x2'));var Redis=require(_0x3de5('0x3'));var intUtil=require(_0x3de5('0x4'));var config=require(_0x3de5('0x5'));var logger=require(_0x3de5('0x6'))(_0x3de5('0x7'));config[_0x3de5('0x8')]=_[_0x3de5('0x9')](config[_0x3de5('0x8')],{'host':_0x3de5('0xa'),'port':0x18eb});var io=require(_0x3de5('0xb'))(new Redis(config[_0x3de5('0x8')]));function emit(_0x4c9e02,_0x33fabc,_0x4b4df5){io['to'](_0x4c9e02)['emit'](_0x33fabc,_0x4b4df5);}var headers={'Content-Type':_0x3de5('0xc'),'Accept':_0x3de5('0xc')};function getTicket(_0x41dda0,_0x4e6a54,_0x4b3ec0,_0xf5cb6f,_0x3d5fb6){logger[_0x3de5('0xd')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x3de5('0xe')](_0x3de5('0xf'),_0x41dda0[_0x3de5('0x10')]),'method':_0x3de5('0x11'),'body':{'ticket':_[_0x3de5('0x12')]({'requester_id':_0x4b3ec0['id'],'submitter_id':_0x4e6a54?_0x4e6a54['id']:undefined,'assignee_id':_0x4e6a54?_0x4e6a54['id']:undefined,'tags':getTags(_0xf5cb6f['Tags'],_0x3de5('0x13')),'subject':intUtil[_0x3de5('0x14')](_0xf5cb6f['Subjects'],_0x3d5fb6,'\x20'),'description':intUtil['getString'](_0xf5cb6f[_0x3de5('0x15')],_0x3d5fb6,'\x0a'),'comment':{'public':![],'body':intUtil[_0x3de5('0x14')](_0xf5cb6f[_0x3de5('0x15')],_0x3d5fb6,'\x0a')}},getCustomFields(_0xf5cb6f['Fields'],_0x3d5fb6))}})['then'](function(_0x18bbc0){logger[_0x3de5('0xd')](_0x3de5('0x16'));return _0x18bbc0[_0x3de5('0x17')];});}function getUser(_0x20f5e5,_0x51d3d7){if(intUtil[_0x3de5('0x18')](_0x51d3d7)){logger[_0x3de5('0xd')]('Getting\x20agent\x20with\x20email',_0x51d3d7);return request({'uri':util[_0x3de5('0xe')]('%s/search.json',_0x20f5e5[_0x3de5('0x10')]),'qs':{'query':util[_0x3de5('0xe')](_0x3de5('0x19'),_0x51d3d7)}})[_0x3de5('0x1a')](function(_0x1e7c24){if(_0x1e7c24[_0x3de5('0x1b')]){logger[_0x3de5('0xd')](_0x3de5('0x1c'));return _[_0x3de5('0x1d')](_0x1e7c24[_0x3de5('0x1e')],{'email':_0x51d3d7,'role':'agent'});}else{logger[_0x3de5('0xd')](_0x3de5('0x1f'));return request({'uri':util[_0x3de5('0xe')](_0x3de5('0x20'),_0x20f5e5[_0x3de5('0x10')])})[_0x3de5('0x1a')](function(_0x5550cf){logger['info'](_0x3de5('0x21'));return _0x5550cf['user'];});}});}else{logger[_0x3de5('0xd')](_0x3de5('0x1f'));return request({'uri':util['format'](_0x3de5('0x20'),_0x20f5e5[_0x3de5('0x10')])})['then'](function(_0x27fa9a){logger[_0x3de5('0xd')](_0x3de5('0x21'));return _0x27fa9a[_0x3de5('0x22')];});}}function getEndUser(_0x4f71ab,_0xd75bfd,_0x11b54b){logger[_0x3de5('0xd')](_0x3de5('0x23'),_0x11b54b);return request({'uri':util['format'](_0x3de5('0x24'),_0x4f71ab[_0x3de5('0x10')]),'qs':{'query':util[_0x3de5('0xe')]('type:user\x20role:end-user\x20phone:%s',_0x11b54b)}})[_0x3de5('0x1a')](function(_0x444b2c){var _0x40ef4a;if(_0x444b2c[_0x3de5('0x1e')]['length']){_0x444b2c[_0x3de5('0x1e')]=_['filter'](_0x444b2c[_0x3de5('0x1e')],{'suspended':![],'role':'end-user'});if(_0x444b2c[_0x3de5('0x1e')][_0x3de5('0x25')]){_0x40ef4a=_['first'](_0x444b2c['results']);}}if(_0x40ef4a){logger[_0x3de5('0xd')]('Enduser\x20found!');return _0x40ef4a;}else{logger[_0x3de5('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x3de5('0xe')](_0x3de5('0x26'),_0x4f71ab[_0x3de5('0x10')]),'method':'POST','body':{'user':{'role':_0x3de5('0x27'),'name':util['format']('Caller\x20-\x20%s',_0xd75bfd||_0x11b54b),'phone':_0x11b54b}}})[_0x3de5('0x1a')](function(_0xa51487){logger[_0x3de5('0xd')](_0x3de5('0x28'));return _0xa51487[_0x3de5('0x22')];});}});}function getAuth(_0x545a10){var _0x501a0d;if(_0x545a10[_0x3de5('0x29')]===_0x3de5('0x2a')){_0x501a0d=util[_0x3de5('0xe')]('%s:%s',_0x545a10[_0x3de5('0x2b')],_0x545a10[_0x3de5('0x2a')]);}else if(_0x545a10[_0x3de5('0x29')]===_0x3de5('0x2c')){_0x501a0d=util[_0x3de5('0xe')](_0x3de5('0x2d'),_0x545a10[_0x3de5('0x2b')],_0x545a10['token']);}return util['format'](_0x3de5('0x2e'),new Buffer(_0x501a0d)['toString'](_0x3de5('0x2f')));}function request(_0x1e2bcd){logger['debug'](_0x3de5('0x30'),JSON[_0x3de5('0x31')](_0x1e2bcd));return rp(_[_0x3de5('0x9')](_0x1e2bcd,{'method':_0x3de5('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x4b8bca,_0xdeae51){var _0x38a41f=[];if(_0x4b8bca&&_0x4b8bca['length']>0x0){_0x38a41f=_[_0x3de5('0x33')](_0x4b8bca,_0xdeae51);}return _0x38a41f;}function getCustomFields(_0x101d97,_0x3a8877){var _0xcc43d1=[];var _0x44c26c={'custom_fields':[]};if(_0x101d97[_0x3de5('0x25')]>0x0){_['forEach'](_0x101d97,function(_0x451c0b){if(_['includes']([_0x3de5('0x34'),_0x3de5('0x35')],_0x451c0b[_0x3de5('0x36')])&&_0x451c0b['nameField']&&!_0x451c0b['customField']){_0x44c26c[_0x451c0b[_0x3de5('0x37')][_0x3de5('0x38')]()]=_0x451c0b[_0x3de5('0x39')][_0x3de5('0x3a')]();}else if(_['includes']([_0x3de5('0x34'),_0x3de5('0x35')],_0x451c0b[_0x3de5('0x36')])&&_0x451c0b[_0x3de5('0x3b')]&&_0x451c0b[_0x3de5('0x3c')]){_0x44c26c[_0x3de5('0x3d')][_0x3de5('0x3e')]({'id':_0x451c0b['idField'],'value':_0x451c0b[_0x3de5('0x39')][_0x3de5('0x3a')]()});}else if(_0x451c0b[_0x3de5('0x36')]==='variable'&&_0x451c0b['variableName']&&_0x451c0b[_0x3de5('0x3b')]&&_0x451c0b[_0x3de5('0x3c')]){_0x3a8877[_0x451c0b[_0x3de5('0x3f')]]&&_0x44c26c[_0x3de5('0x3d')][_0x3de5('0x3e')]({'id':_0x451c0b[_0x3de5('0x3b')],'value':_0x3a8877[_0x451c0b['variableName']][_0x3de5('0x3a')]()});}else if(_0x451c0b[_0x3de5('0x36')]===_0x3de5('0x40')&&_0x451c0b[_0x3de5('0x41')]&&_0x451c0b[_0x3de5('0x41')][_0x3de5('0x13')]&&_0x451c0b[_0x3de5('0x3b')]&&_0x451c0b[_0x3de5('0x3c')]){_0x3a8877[_0x451c0b['Variable']['name'][_0x3de5('0x38')]()]&&_0x44c26c[_0x3de5('0x3d')][_0x3de5('0x3e')]({'id':_0x451c0b[_0x3de5('0x3b')],'value':_0x3a8877[_0x451c0b[_0x3de5('0x41')][_0x3de5('0x13')]['toLowerCase']()][_0x3de5('0x3a')]()});}});}return _0x44c26c;}exports[_0x3de5('0x42')]=function(_0x4e3b78,_0x752ee2,_0x50eaa0,_0x45b9f4,_0x921adb,_0x597515){var _0xb4e029,_0x2848b0;_0x597515['remoteUri']=intUtil[_0x3de5('0x43')](_0x597515[_0x3de5('0x10')]);_0x597515[_0x3de5('0x44')]=intUtil[_0x3de5('0x43')](_0x597515[_0x3de5('0x44')]);if(_0x921adb&&_0x921adb[_0x3de5('0x45')]){logger['info'](_0x3de5('0x46'),_0x3de5('0x47'));_0x752ee2[_0x3de5('0x48')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x597515[_0x3de5('0x44')],_0x752ee2[_0x3de5('0x49')],md5(_0x752ee2[_0x3de5('0x49')]));}else{_0x752ee2['recordingURL']='';}headers[_0x3de5('0x4a')]=getAuth(_0x597515);return getUser(_0x597515,_0x45b9f4[_0x3de5('0x4b')])[_0x3de5('0x1a')](function(_0x506960){_0xb4e029=_0x506960;logger[_0x3de5('0xd')](_0x3de5('0x4c'),_0xb4e029['id']);return getEndUser(_0x597515,_0x752ee2[_0x3de5('0x4d')],_0x752ee2['calleridnum']);})[_0x3de5('0x1a')](function(_0x487595){_0x2848b0=_0x487595;logger[_0x3de5('0xd')](_0x3de5('0x4e'),_0x2848b0['id']);return getTicket(_0x597515,_0xb4e029,_0x2848b0,_0x50eaa0,_0x752ee2);})[_0x3de5('0x1a')](function(_0x5743c1){if(_0x5743c1){logger[_0x3de5('0xd')](_0x3de5('0x4f'),_0x5743c1['id']);switch(_0x597515['type']){case _0x3de5('0x50'):logger[_0x3de5('0xd')]('[QUEUE]',_0x3de5('0x51'));return request({'uri':util[_0x3de5('0xe')](_0x3de5('0x52'),_0x597515['remoteUri'],_0xb4e029['id'],_0x5743c1['id']),'method':_0x3de5('0x11')});case'newTab':logger[_0x3de5('0xd')](_0x3de5('0x46'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3de5('0xe')]('user:%s',_0x45b9f4[_0x3de5('0x13')]),_0x3de5('0x53'),{'uri':util[_0x3de5('0xe')]('%s/agent/tickets/%s',_0x597515[_0x3de5('0x10')][_0x3de5('0x54')]('/api/v2',''),_0x5743c1['id'])});break;default:logger[_0x3de5('0x55')](_0x3de5('0x46'),_0x3de5('0x56'));}}})[_0x3de5('0x57')](function(_0x2c70f4){logger[_0x3de5('0x55')](_0x3de5('0x58'),util[_0x3de5('0x59')](_0x2c70f4,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x41adf5,_0x142569,_0x292122,_0x33e57e,_0x56587a,_0x62fc10,_0x3c3aa4){var _0x3546c7,_0x345cb4;_0x62fc10[_0x3de5('0x10')]=intUtil[_0x3de5('0x43')](_0x62fc10[_0x3de5('0x10')]);_0x62fc10[_0x3de5('0x44')]=intUtil[_0x3de5('0x43')](_0x62fc10[_0x3de5('0x44')]);if(_0x3c3aa4&&_0x3c3aa4[_0x3de5('0x5a')]&&_0x3c3aa4[_0x3de5('0x5a')]!==_0x3de5('0x5b')){logger[_0x3de5('0xd')]('[OUTBOUND]',_0x3de5('0x47'));_0x142569[_0x3de5('0x48')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x62fc10[_0x3de5('0x44')],_0x142569[_0x3de5('0x49')],md5(_0x142569[_0x3de5('0x49')]));}headers[_0x3de5('0x4a')]=getAuth(_0x62fc10);return getUser(_0x62fc10,_0x33e57e[_0x3de5('0x4b')])[_0x3de5('0x1a')](function(_0xe9a688){_0x3546c7=_0xe9a688;logger[_0x3de5('0xd')](_0x3de5('0x4c'),_0x3546c7['id']);return getEndUser(_0x62fc10,_0x142569[_0x3de5('0x5c')],_0x142569[_0x3de5('0x5d')]);})[_0x3de5('0x1a')](function(_0xf8d7f9){_0x345cb4=_0xf8d7f9;logger['info'](_0x3de5('0x4e'),_0x345cb4['id']);return getTicket(_0x62fc10,_0x3546c7,_0x345cb4,_0x292122,_0x142569);})[_0x3de5('0x1a')](function(_0x2d2bb3){if(_0x2d2bb3){logger[_0x3de5('0xd')](_0x3de5('0x4f'),_0x2d2bb3['id']);switch(_0x62fc10['type']){case _0x3de5('0x50'):logger[_0x3de5('0xd')](_0x3de5('0x5e'),_0x3de5('0x51'));return request({'uri':util[_0x3de5('0xe')](_0x3de5('0x52'),_0x62fc10['remoteUri'],_0x3546c7['id'],_0x2d2bb3['id']),'method':_0x3de5('0x11')});case _0x3de5('0x5f'):logger[_0x3de5('0xd')]('[OUTBOUND]',_0x3de5('0x60'));emit(util[_0x3de5('0xe')](_0x3de5('0x61'),_0x33e57e[_0x3de5('0x13')]),_0x3de5('0x53'),{'uri':util[_0x3de5('0xe')](_0x3de5('0x62'),_0x62fc10['remoteUri'][_0x3de5('0x54')](_0x3de5('0x63'),''),_0x2d2bb3['id'])});break;default:logger[_0x3de5('0x55')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x3de5('0x57')](function(_0x38cda1){logger[_0x3de5('0x55')](_0x3de5('0x64'),util['inspect'](_0x38cda1,{'showHidden':!![],'depth':null}));});};exports[_0x3de5('0x65')]=function(_0x39b8b1,_0xbc6de5,_0x45a6e2,_0x1b52f9,_0x275a58,_0x2e5d86){var _0xd13e7b,_0x42cafa;_0x2e5d86[_0x3de5('0x10')]=intUtil[_0x3de5('0x43')](_0x2e5d86[_0x3de5('0x10')]);_0x2e5d86[_0x3de5('0x44')]=intUtil[_0x3de5('0x43')](_0x2e5d86['serverUrl']);if(_0x275a58&&_0x275a58[_0x3de5('0x45')]){logger['info']('['+_0xbc6de5[_0x3de5('0x66')][_0x3de5('0x67')]()+']',_0x3de5('0x47'));_0xbc6de5[_0x3de5('0x48')]=util[_0x3de5('0xe')](_0x3de5('0x68'),_0x2e5d86[_0x3de5('0x44')],_0xbc6de5['uniqueid'],md5(_0xbc6de5[_0x3de5('0x49')]));}else{_0xbc6de5[_0x3de5('0x48')]='';}headers[_0x3de5('0x4a')]=getAuth(_0x2e5d86);return getUser(_0x2e5d86)[_0x3de5('0x1a')](function(_0x55426a){_0xd13e7b=_0x55426a;logger[_0x3de5('0xd')](_0x3de5('0x4c'),_0xd13e7b['id']);return getEndUser(_0x2e5d86,_0xbc6de5[_0x3de5('0x4d')],_0xbc6de5[_0x3de5('0x69')]);})[_0x3de5('0x1a')](function(_0x4071e4){_0x42cafa=_0x4071e4;logger[_0x3de5('0xd')](_0x3de5('0x4e'),_0x42cafa['id']);return getTicket(_0x2e5d86,_0xd13e7b,_0x42cafa,_0x45a6e2,_0xbc6de5);})['then'](function(_0x179f37){if(_0x179f37){logger[_0x3de5('0xd')](_0x3de5('0x4f'),_0x179f37['id']);}})[_0x3de5('0x57')](function(_0x3431c5){logger['error']('['+_0xbc6de5['lastevent'][_0x3de5('0x67')]()+']'+_0x3de5('0x6a'),util[_0x3de5('0x59')](_0x3431c5,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9fdf=['ioredis','./util','../../../../config/environment','zendesk','redis','defaults','localhost','emit','application/json','format','%s/tickets.json','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','ticket','validateEmail','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','authType','password','%s:%s','token','%s/token:%s','username','Basic\x20%s','toString','debug','stringify','GET','forEach','includes','type','nameField','toLowerCase','string','picklist','idField','customField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','email','destcalleridname','The\x20Enduser\x20ID\x20is:','replace','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','recordingURL','calleridname','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','request-promise','util'];(function(_0x516499,_0x1a7c98){var _0x2de0b0=function(_0x492977){while(--_0x492977){_0x516499['push'](_0x516499['shift']());}};_0x2de0b0(++_0x1a7c98);}(_0x9fdf,0x1ba));var _0xf9fd=function(_0x267c51,_0x4f98a0){_0x267c51=_0x267c51-0x0;var _0x47733a=_0x9fdf[_0x267c51];return _0x47733a;};'use strict';var _=require('lodash');var rp=require(_0xf9fd('0x0'));var md5=require('md5');var util=require(_0xf9fd('0x1'));var Redis=require(_0xf9fd('0x2'));var intUtil=require(_0xf9fd('0x3'));var config=require(_0xf9fd('0x4'));var logger=require('../../../../config/logger')(_0xf9fd('0x5'));config[_0xf9fd('0x6')]=_[_0xf9fd('0x7')](config[_0xf9fd('0x6')],{'host':_0xf9fd('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf9fd('0x6')]));function emit(_0x3ee01f,_0x4c1909,_0x441bbe){io['to'](_0x3ee01f)[_0xf9fd('0x9')](_0x4c1909,_0x441bbe);}var headers={'Content-Type':_0xf9fd('0xa'),'Accept':_0xf9fd('0xa')};function getTicket(_0x3222b3,_0x3f2976,_0x97bbd6,_0x119fb2,_0x5334b2){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0xf9fd('0xb')](_0xf9fd('0xc'),_0x3222b3['remoteUri']),'method':_0xf9fd('0xd'),'body':{'ticket':_[_0xf9fd('0xe')]({'requester_id':_0x97bbd6['id'],'submitter_id':_0x3f2976?_0x3f2976['id']:undefined,'assignee_id':_0x3f2976?_0x3f2976['id']:undefined,'tags':getTags(_0x119fb2[_0xf9fd('0xf')],_0xf9fd('0x10')),'subject':intUtil[_0xf9fd('0x11')](_0x119fb2[_0xf9fd('0x12')],_0x5334b2,'\x20'),'description':intUtil['getString'](_0x119fb2[_0xf9fd('0x13')],_0x5334b2,'\x0a'),'comment':{'public':![],'body':intUtil[_0xf9fd('0x11')](_0x119fb2['Descriptions'],_0x5334b2,'\x0a')}},getCustomFields(_0x119fb2[_0xf9fd('0x14')],_0x5334b2))}})[_0xf9fd('0x15')](function(_0x4241dd){logger[_0xf9fd('0x16')](_0xf9fd('0x17'));return _0x4241dd[_0xf9fd('0x18')];});}function getUser(_0xf82815,_0x302581){if(intUtil[_0xf9fd('0x19')](_0x302581)){logger[_0xf9fd('0x16')]('Getting\x20agent\x20with\x20email',_0x302581);return request({'uri':util[_0xf9fd('0xb')]('%s/search.json',_0xf82815[_0xf9fd('0x1a')]),'qs':{'query':util['format'](_0xf9fd('0x1b'),_0x302581)}})[_0xf9fd('0x15')](function(_0x36eacf){if(_0x36eacf[_0xf9fd('0x1c')]){logger[_0xf9fd('0x16')](_0xf9fd('0x1d'));return _['find'](_0x36eacf[_0xf9fd('0x1e')],{'email':_0x302581,'role':_0xf9fd('0x1f')});}else{logger[_0xf9fd('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf9fd('0xb')]('%s/users/me.json',_0xf82815[_0xf9fd('0x1a')])})['then'](function(_0x42a625){logger[_0xf9fd('0x16')](_0xf9fd('0x20'));return _0x42a625[_0xf9fd('0x21')];});}});}else{logger[_0xf9fd('0x16')](_0xf9fd('0x22'));return request({'uri':util[_0xf9fd('0xb')](_0xf9fd('0x23'),_0xf82815[_0xf9fd('0x1a')])})[_0xf9fd('0x15')](function(_0x429118){logger['info'](_0xf9fd('0x20'));return _0x429118[_0xf9fd('0x21')];});}}function getEndUser(_0x8c33ea,_0x4753d1,_0x20cf89){logger['info']('Searching\x20enduser\x20with\x20phone',_0x20cf89);return request({'uri':util[_0xf9fd('0xb')]('%s/search.json',_0x8c33ea[_0xf9fd('0x1a')]),'qs':{'query':util[_0xf9fd('0xb')](_0xf9fd('0x24'),_0x20cf89)}})[_0xf9fd('0x15')](function(_0x151ef6){var _0x53f156;if(_0x151ef6[_0xf9fd('0x1e')][_0xf9fd('0x25')]){_0x151ef6['results']=_[_0xf9fd('0x26')](_0x151ef6[_0xf9fd('0x1e')],{'suspended':![],'role':_0xf9fd('0x27')});if(_0x151ef6[_0xf9fd('0x1e')][_0xf9fd('0x25')]){_0x53f156=_[_0xf9fd('0x28')](_0x151ef6[_0xf9fd('0x1e')]);}}if(_0x53f156){logger[_0xf9fd('0x16')](_0xf9fd('0x29'));return _0x53f156;}else{logger['info'](_0xf9fd('0x2a'));return request({'uri':util[_0xf9fd('0xb')](_0xf9fd('0x2b'),_0x8c33ea[_0xf9fd('0x1a')]),'method':_0xf9fd('0xd'),'body':{'user':{'role':_0xf9fd('0x27'),'name':util['format']('Caller\x20-\x20%s',_0x4753d1||_0x20cf89),'phone':_0x20cf89}}})[_0xf9fd('0x15')](function(_0x304b2a){logger[_0xf9fd('0x16')](_0xf9fd('0x2c'));return _0x304b2a['user'];});}});}function getAuth(_0x5b26f9){var _0x31cc0a;if(_0x5b26f9[_0xf9fd('0x2d')]===_0xf9fd('0x2e')){_0x31cc0a=util['format'](_0xf9fd('0x2f'),_0x5b26f9['username'],_0x5b26f9[_0xf9fd('0x2e')]);}else if(_0x5b26f9[_0xf9fd('0x2d')]===_0xf9fd('0x30')){_0x31cc0a=util[_0xf9fd('0xb')](_0xf9fd('0x31'),_0x5b26f9[_0xf9fd('0x32')],_0x5b26f9[_0xf9fd('0x30')]);}return util['format'](_0xf9fd('0x33'),new Buffer(_0x31cc0a)[_0xf9fd('0x34')]('base64'));}function request(_0x5011d8){logger[_0xf9fd('0x35')]('[HTTP]',JSON[_0xf9fd('0x36')](_0x5011d8));return rp(_[_0xf9fd('0x7')](_0x5011d8,{'method':_0xf9fd('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x5a40cc,_0x5ddd4b){var _0x1fe6fb=[];if(_0x5a40cc&&_0x5a40cc[_0xf9fd('0x25')]>0x0){_0x1fe6fb=_['map'](_0x5a40cc,_0x5ddd4b);}return _0x1fe6fb;}function getCustomFields(_0x5303e2,_0xe37499){var _0x8972d1=[];var _0x8da1b4={'custom_fields':[]};if(_0x5303e2[_0xf9fd('0x25')]>0x0){_[_0xf9fd('0x38')](_0x5303e2,function(_0x38ce37){if(_[_0xf9fd('0x39')](['string','picklist'],_0x38ce37[_0xf9fd('0x3a')])&&_0x38ce37[_0xf9fd('0x3b')]&&!_0x38ce37['customField']){_0x8da1b4[_0x38ce37['nameField'][_0xf9fd('0x3c')]()]=_0x38ce37['content'][_0xf9fd('0x34')]();}else if(_[_0xf9fd('0x39')]([_0xf9fd('0x3d'),_0xf9fd('0x3e')],_0x38ce37['type'])&&_0x38ce37[_0xf9fd('0x3f')]&&_0x38ce37[_0xf9fd('0x40')]){_0x8da1b4[_0xf9fd('0x41')][_0xf9fd('0x42')]({'id':_0x38ce37[_0xf9fd('0x3f')],'value':_0x38ce37['content'][_0xf9fd('0x34')]()});}else if(_0x38ce37[_0xf9fd('0x3a')]===_0xf9fd('0x43')&&_0x38ce37[_0xf9fd('0x44')]&&_0x38ce37[_0xf9fd('0x3f')]&&_0x38ce37[_0xf9fd('0x40')]){_0xe37499[_0x38ce37[_0xf9fd('0x44')]]&&_0x8da1b4[_0xf9fd('0x41')][_0xf9fd('0x42')]({'id':_0x38ce37[_0xf9fd('0x3f')],'value':_0xe37499[_0x38ce37[_0xf9fd('0x44')]][_0xf9fd('0x34')]()});}else if(_0x38ce37[_0xf9fd('0x3a')]===_0xf9fd('0x45')&&_0x38ce37[_0xf9fd('0x46')]&&_0x38ce37[_0xf9fd('0x46')][_0xf9fd('0x10')]&&_0x38ce37[_0xf9fd('0x3f')]&&_0x38ce37[_0xf9fd('0x40')]){_0xe37499[_0x38ce37['Variable']['name']['toLowerCase']()]&&_0x8da1b4[_0xf9fd('0x41')][_0xf9fd('0x42')]({'id':_0x38ce37[_0xf9fd('0x3f')],'value':_0xe37499[_0x38ce37[_0xf9fd('0x46')][_0xf9fd('0x10')]['toLowerCase']()]['toString']()});}});}return _0x8da1b4;}exports[_0xf9fd('0x47')]=function(_0x566415,_0x490cf2,_0x397e64,_0x352d7f,_0x193fc6,_0x4765d6){var _0x46a121,_0x523393;_0x4765d6['remoteUri']=intUtil[_0xf9fd('0x48')](_0x4765d6[_0xf9fd('0x1a')]);_0x4765d6[_0xf9fd('0x49')]=intUtil[_0xf9fd('0x48')](_0x4765d6[_0xf9fd('0x49')]);if(_0x193fc6&&_0x193fc6[_0xf9fd('0x4a')]){logger[_0xf9fd('0x16')](_0xf9fd('0x4b'),'Recording\x20is\x20enabled!');_0x490cf2['recordingURL']=util['format'](_0xf9fd('0x4c'),_0x4765d6['serverUrl'],_0x490cf2[_0xf9fd('0x4d')],md5(_0x490cf2[_0xf9fd('0x4d')]));}else{_0x490cf2['recordingURL']='';}headers['Authorization']=getAuth(_0x4765d6);return getUser(_0x4765d6,_0x352d7f['email'])[_0xf9fd('0x15')](function(_0x35638a){_0x46a121=_0x35638a;logger[_0xf9fd('0x16')](_0xf9fd('0x4e'),_0x46a121['id']);return getEndUser(_0x4765d6,_0x490cf2['calleridname'],_0x490cf2[_0xf9fd('0x4f')]);})[_0xf9fd('0x15')](function(_0x29a509){_0x523393=_0x29a509;logger[_0xf9fd('0x16')]('The\x20Enduser\x20ID\x20is:',_0x523393['id']);return getTicket(_0x4765d6,_0x46a121,_0x523393,_0x397e64,_0x490cf2);})[_0xf9fd('0x15')](function(_0x42e584){if(_0x42e584){logger['info'](_0xf9fd('0x50'),_0x42e584['id']);switch(_0x4765d6[_0xf9fd('0x3a')]){case _0xf9fd('0x51'):logger[_0xf9fd('0x16')](_0xf9fd('0x4b'),_0xf9fd('0x52'));return request({'uri':util[_0xf9fd('0xb')](_0xf9fd('0x53'),_0x4765d6[_0xf9fd('0x1a')],_0x46a121['id'],_0x42e584['id']),'method':_0xf9fd('0xd')});case _0xf9fd('0x54'):logger[_0xf9fd('0x16')](_0xf9fd('0x4b'),_0xf9fd('0x55'));emit(util[_0xf9fd('0xb')](_0xf9fd('0x56'),_0x352d7f[_0xf9fd('0x10')]),_0xf9fd('0x57'),{'uri':util[_0xf9fd('0xb')](_0xf9fd('0x58'),_0x4765d6[_0xf9fd('0x1a')]['replace'](_0xf9fd('0x59'),''),_0x42e584['id'])});break;default:logger[_0xf9fd('0x5a')](_0xf9fd('0x4b'),_0xf9fd('0x5b'));}}})[_0xf9fd('0x5c')](function(_0x37a5aa){logger[_0xf9fd('0x5a')](_0xf9fd('0x5d'),util[_0xf9fd('0x5e')](_0x37a5aa,{'showHidden':!![],'depth':null}));});};exports[_0xf9fd('0x5f')]=function(_0x75e7db,_0x413429,_0x5ceb60,_0x21b48e,_0x2cc908,_0x4a0e17,_0x5814aa){var _0x27f08e,_0x1bf8f3;_0x4a0e17[_0xf9fd('0x1a')]=intUtil[_0xf9fd('0x48')](_0x4a0e17['remoteUri']);_0x4a0e17['serverUrl']=intUtil['stripTrailingSlash'](_0x4a0e17[_0xf9fd('0x49')]);if(_0x5814aa&&_0x5814aa[_0xf9fd('0x60')]&&_0x5814aa[_0xf9fd('0x60')]!==_0xf9fd('0x61')){logger[_0xf9fd('0x16')](_0xf9fd('0x62'),_0xf9fd('0x63'));_0x413429['recordingURL']=util[_0xf9fd('0xb')](_0xf9fd('0x4c'),_0x4a0e17[_0xf9fd('0x49')],_0x413429[_0xf9fd('0x4d')],md5(_0x413429[_0xf9fd('0x4d')]));}headers['Authorization']=getAuth(_0x4a0e17);return getUser(_0x4a0e17,_0x21b48e[_0xf9fd('0x64')])['then'](function(_0x6bfddb){_0x27f08e=_0x6bfddb;logger['info'](_0xf9fd('0x4e'),_0x27f08e['id']);return getEndUser(_0x4a0e17,_0x413429[_0xf9fd('0x65')],_0x413429['destcalleridnum']);})[_0xf9fd('0x15')](function(_0x4b374c){_0x1bf8f3=_0x4b374c;logger[_0xf9fd('0x16')](_0xf9fd('0x66'),_0x1bf8f3['id']);return getTicket(_0x4a0e17,_0x27f08e,_0x1bf8f3,_0x5ceb60,_0x413429);})[_0xf9fd('0x15')](function(_0x5dae2d){if(_0x5dae2d){logger[_0xf9fd('0x16')](_0xf9fd('0x50'),_0x5dae2d['id']);switch(_0x4a0e17[_0xf9fd('0x3a')]){case'integrationTab':logger[_0xf9fd('0x16')](_0xf9fd('0x62'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xf9fd('0xb')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4a0e17[_0xf9fd('0x1a')],_0x27f08e['id'],_0x5dae2d['id']),'method':_0xf9fd('0xd')});case _0xf9fd('0x54'):logger[_0xf9fd('0x16')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf9fd('0xb')]('user:%s',_0x21b48e['name']),_0xf9fd('0x57'),{'uri':util[_0xf9fd('0xb')](_0xf9fd('0x58'),_0x4a0e17[_0xf9fd('0x1a')][_0xf9fd('0x67')](_0xf9fd('0x59'),''),_0x5dae2d['id'])});break;default:logger[_0xf9fd('0x5a')](_0xf9fd('0x62'),_0xf9fd('0x5b'));}}})[_0xf9fd('0x5c')](function(_0x3af95d){logger[_0xf9fd('0x5a')](_0xf9fd('0x68'),util[_0xf9fd('0x5e')](_0x3af95d,{'showHidden':!![],'depth':null}));});};exports[_0xf9fd('0x69')]=function(_0x3b5dfb,_0x153553,_0x18887c,_0x3aa0c7,_0x91c64e,_0x128193){var _0x2000c6,_0xfe4eb3;_0x128193[_0xf9fd('0x1a')]=intUtil['stripTrailingSlash'](_0x128193['remoteUri']);_0x128193[_0xf9fd('0x49')]=intUtil[_0xf9fd('0x48')](_0x128193[_0xf9fd('0x49')]);if(_0x91c64e&&_0x91c64e[_0xf9fd('0x4a')]){logger[_0xf9fd('0x16')]('['+_0x153553['lastevent']['toUpperCase']()+']',_0xf9fd('0x63'));_0x153553[_0xf9fd('0x6a')]=util['format'](_0xf9fd('0x4c'),_0x128193['serverUrl'],_0x153553['uniqueid'],md5(_0x153553[_0xf9fd('0x4d')]));}else{_0x153553[_0xf9fd('0x6a')]='';}headers['Authorization']=getAuth(_0x128193);return getUser(_0x128193)['then'](function(_0x2225cc){_0x2000c6=_0x2225cc;logger['info'](_0xf9fd('0x4e'),_0x2000c6['id']);return getEndUser(_0x128193,_0x153553[_0xf9fd('0x6b')],_0x153553['calleridnum']);})['then'](function(_0x26cc4f){_0xfe4eb3=_0x26cc4f;logger[_0xf9fd('0x16')](_0xf9fd('0x66'),_0xfe4eb3['id']);return getTicket(_0x128193,_0x2000c6,_0xfe4eb3,_0x18887c,_0x153553);})[_0xf9fd('0x15')](function(_0x763626){if(_0x763626){logger[_0xf9fd('0x16')](_0xf9fd('0x50'),_0x763626['id']);}})[_0xf9fd('0x5c')](function(_0x1e5363){logger[_0xf9fd('0x5a')]('['+_0x153553[_0xf9fd('0x6c')][_0xf9fd('0x6d')]()+']'+_0xf9fd('0x6e'),util['inspect'](_0x1e5363,{'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 811170b..e92225c 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 _0xecb2=['POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','email','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','user','profile','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','Leads','nothing','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','Called','complete','connect','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Call_Start_Time','agentcalledAt','Inbound','merge','/crm/v2/Calls','log','queue','stripTrailingSlash','host','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','user:%s','https://crm.','lastevent','toUpperCase','lodash','request-promise','md5','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','debug','[HTTP]','stringify','length','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn'];(function(_0x35db8f,_0x3aff8d){var _0x51806b=function(_0x1e351b){while(--_0x1e351b){_0x35db8f['push'](_0x35db8f['shift']());}};_0x51806b(++_0x3aff8d);}(_0xecb2,0x112));var _0x2ecb=function(_0x29e4ab,_0x4866ee){_0x29e4ab=_0x29e4ab-0x0;var _0x553981=_0xecb2[_0x29e4ab];return _0x553981;};'use strict';var _=require(_0x2ecb('0x0'));var rp=require(_0x2ecb('0x1'));var md5=require(_0x2ecb('0x2'));var util=require('util');var intUtil=require(_0x2ecb('0x3'));var moment=require(_0x2ecb('0x4'));var Redis=require(_0x2ecb('0x5'));var BPromise=require(_0x2ecb('0x6'));var config=require(_0x2ecb('0x7'));var logger=require(_0x2ecb('0x8'))(_0x2ecb('0x9'));config[_0x2ecb('0xa')]=_[_0x2ecb('0xb')](config[_0x2ecb('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x2ecb('0xc'))(new Redis(config['redis']));function emit(_0x2bbcb3,_0x324bb,_0x27cd9c){io['to'](_0x2bbcb3)['emit'](_0x324bb,_0x27cd9c);}function request(_0x395910){logger[_0x2ecb('0xd')](_0x2ecb('0xe'),JSON[_0x2ecb('0xf')](_0x395910));return rp(_0x395910);}function getCustomFields(_0x2bbbd1,_0xd33862){var _0x5a0b48={};if(_0x2bbbd1[_0x2ecb('0x10')]>0x0){_['forEach'](_0x2bbbd1,function(_0x46a965){if(_['includes'](['string','picklist'],_0x46a965['type'])&&_0x46a965['idField']){_0x5a0b48[_0x46a965[_0x2ecb('0x11')]]=_0x46a965[_0x2ecb('0x12')]['toString']();}else if(_0x46a965[_0x2ecb('0x13')]===_0x2ecb('0x14')&&_0x46a965['variableName']&&_0x46a965['idField']&&_0xd33862[_0x46a965[_0x2ecb('0x15')]]){_0x5a0b48[_0x46a965['idField']]=_0xd33862[_0x46a965['variableName']][_0x2ecb('0x16')]();}else if(_0x46a965['type']===_0x2ecb('0x17')&&_0x46a965[_0x2ecb('0x18')]&&_0x46a965[_0x2ecb('0x18')]['name']&&_0x46a965[_0x2ecb('0x11')]&&_0xd33862[_0x46a965[_0x2ecb('0x18')]['name']['toLowerCase']()]){_0x5a0b48[_0x46a965[_0x2ecb('0x11')]]=_0xd33862[_0x46a965[_0x2ecb('0x18')][_0x2ecb('0x19')][_0x2ecb('0x1a')]()][_0x2ecb('0x16')]();}});}return _0x5a0b48;}function getName(_0x2fb1ad){if(_0x2fb1ad[_0x2ecb('0x1b')]('\x20')>0x0){var _0x2c1298=_0x2fb1ad[_0x2ecb('0x1c')](/ (.+)/);if(_0x2c1298[0x1]){return _0x2c1298;}}return[_0x2fb1ad,_0x2fb1ad];}var accountsTokens={};function getAccessToken(_0x7d0f91){return new Promise(function(_0x16de5e,_0x1c9633){if(!_[_0x2ecb('0x1d')](accountsTokens[_0x7d0f91['id']])&&!_['isNil'](accountsTokens[_0x7d0f91['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x7d0f91['id']][_0x2ecb('0x1e')])){_0x16de5e(accountsTokens[_0x7d0f91['id']]['access_token']);}}var _0x55bca5;switch(_0x7d0f91[_0x2ecb('0x1f')]){case'US':_0x55bca5=_0x2ecb('0x20');break;case'AU':_0x55bca5=_0x2ecb('0x21');break;case'EU':_0x55bca5=_0x2ecb('0x22');break;case'IN':_0x55bca5='https://accounts.zoho.in';break;case'CN':_0x55bca5=_0x2ecb('0x23');break;default:_0x55bca5=_0x2ecb('0x22');break;}var _0x475991={'method':_0x2ecb('0x24'),'uri':_0x55bca5+_0x2ecb('0x25'),'qs':{'refresh_token':_0x7d0f91[_0x2ecb('0x26')],'client_id':_0x7d0f91[_0x2ecb('0x27')],'client_secret':_0x7d0f91['clientSecret'],'grant_type':_0x2ecb('0x28')},'json':!![]};return rp(_0x475991)['then'](function(_0x4d82e6){accountsTokens[_0x7d0f91['id']]={'access_token':_0x4d82e6[_0x2ecb('0x29')],'expires_in':moment()['add'](_0x4d82e6['expires_in'],_0x2ecb('0x2a'))};_0x16de5e(_0x4d82e6[_0x2ecb('0x29')]);})[_0x2ecb('0x2b')](function(_0x3b16c1){logger[_0x2ecb('0x2c')](_0x2ecb('0x2d'),_0x3b16c1[_0x2ecb('0x2e')]);_0x1c9633(_0x3b16c1);});});}function getUser(_0xb39862,_0x27d82b,_0x442f83,_0x1a1587){logger[_0x2ecb('0x2f')](_0x2ecb('0x30'));return request({'method':_0x2ecb('0x31'),'uri':util[_0x2ecb('0x32')](_0x2ecb('0x33'),_0x27d82b),'qs':{'type':_0x2ecb('0x34')},'headers':{'Authorization':_0x2ecb('0x35')+_0xb39862},'json':!![]})[_0x2ecb('0x36')](function(_0x33bb55){if(_0x33bb55[_0x2ecb('0x37')]){var _0x1683f3=-0x1;if(_[_0x2ecb('0x38')](_0x33bb55[_0x2ecb('0x37')])){if(!_['isNil'](_0x1a1587)){_0x1683f3=_['findIndex'](_0x33bb55[_0x2ecb('0x37')],function(_0x448530){return _0x448530[_0x2ecb('0x39')]===_0x1a1587;});}if(_0x1683f3>=0x0){logger[_0x2ecb('0x2f')](_0x2ecb('0x3a'));}else{logger[_0x2ecb('0x2f')](_0x2ecb('0x3b'));_0x1683f3=_[_0x2ecb('0x3c')](_0x33bb55[_0x2ecb('0x37')],function(_0x4503df){return _0x4503df['profile']['name']==='Administrator';});}return _0x33bb55[_0x2ecb('0x37')][_0x1683f3];}else{if(_0x33bb55[_0x2ecb('0x3d')][_0x2ecb('0x3e')][_0x2ecb('0x19')]===_0x2ecb('0x3f')){logger[_0x2ecb('0x2f')](_0x2ecb('0x3b'));user=_0x33bb55[_0x2ecb('0x3d')];return user;}else{logger['error'](_0x2ecb('0x40'),JSON[_0x2ecb('0xf')](_0x33bb55));throw new Error(_0x2ecb('0x41')+JSON['stringify'](_0x33bb55));}}}else{logger[_0x2ecb('0x2c')](_0x2ecb('0x40'),JSON[_0x2ecb('0xf')](_0x33bb55));throw new Error(_0x2ecb('0x41')+JSON[_0x2ecb('0xf')](_0x33bb55));}})[_0x2ecb('0x2b')](function(_0x598df5){console[_0x2ecb('0x2c')](_0x598df5);});}function getZohoUser(_0x3605fd,_0x47c10f){return new BPromise(function(_0x261b7e,_0x1247d4){request(_0x3605fd)[_0x2ecb('0x36')](function(_0x286c0b){var _0x548b1a=null;if(_0x286c0b){_0x548b1a=_0x286c0b[_0x2ecb('0x42')][0x0];_0x548b1a[_0x2ecb('0x43')]=_0x47c10f;}_0x261b7e(_0x548b1a);})['catch'](function(_0x2977e0){_0x1247d4(_0x2977e0);});});}function createEndUser(_0x52fb24,_0x5f4986,_0x4dc090,_0x4de2f4,_0x42c12d,_0x349a35){var _0x4dc090=getName(_0x4dc090);return request({'method':_0x2ecb('0x24'),'uri':_0x2ecb('0x44')+_0x5f4986+'/crm/v2/'+_[_0x2ecb('0x45')](_0x349a35[_0x2ecb('0x46')])+'s','body':{'data':[{'Last_Name':_0x4dc090[0x1],'First_Name':_0x4dc090[0x0],'Phone':_0x4de2f4,'Owner':{'name':!_[_0x2ecb('0x1d')](_0x42c12d[_0x2ecb('0x47')][_0x2ecb('0x19')])?_0x42c12d[_0x2ecb('0x47')][_0x2ecb('0x19')]:!_[_0x2ecb('0x1d')](_0x42c12d[_0x2ecb('0x48')])?_0x42c12d[_0x2ecb('0x48')]+'\x20'+_0x42c12d[_0x2ecb('0x49')]:_0x42c12d[_0x2ecb('0x49')],'id':_0x42c12d['id']}}]},'headers':{'Authorization':_0x2ecb('0x35')+_0x52fb24},'json':!![]})['then'](function(_0x5bb1b4){if(_0x5bb1b4&&_0x5bb1b4['data'][0x0][_0x2ecb('0x4a')]===_0x2ecb('0x4b')){var _0x399351=_0x5bb1b4['data'][0x0][_0x2ecb('0x4c')];_0x399351[_0x2ecb('0x43')]=_['startCase'](_0x349a35['moduleCreate'])+'s';return _0x399351;}logger[_0x2ecb('0x2c')](_0x2ecb('0x40'),JSON[_0x2ecb('0xf')](data));throw new Error(_0x2ecb('0x4d')+JSON['stringify'](data));})[_0x2ecb('0x2b')](function(_0x2c139e){console['log'](_0x2ecb('0x4e'),_0x2c139e);});}function getEndUser(_0x28e56c,_0x4a91eb,_0xc10e73,_0x40ddc8,_0x393144,_0x1473c0,_0x36a585){var _0x312638={'method':_0x2ecb('0x31'),'uri':'','headers':{'Authorization':_0x2ecb('0x35')+_0x28e56c},'json':!![]};switch(_0x36a585[_0x2ecb('0x4f')]){case _0x2ecb('0x50'):_0x312638['uri']=_0x2ecb('0x44')+_0x4a91eb+_0x2ecb('0x51')+_0x393144+'))';return getZohoUser(_0x312638,_0x2ecb('0x52'))[_0x2ecb('0x36')](function(_0xc35d7c){if(_0xc35d7c)return _0xc35d7c;_0x312638[_0x2ecb('0x53')]='https://www.zohoapis.'+_0x4a91eb+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x393144+'))';return getZohoUser(_0x312638,_0x2ecb('0x54'))[_0x2ecb('0x36')](function(_0x1b4414){if(_0x1b4414)return _0x1b4414;if(_0x36a585[_0x2ecb('0x46')]!=_0x2ecb('0x55')){return createEndUser(_0x28e56c,_0x4a91eb,_0x40ddc8,_0x393144,_0x1473c0,_0x36a585);}else{return{};}});});break;case _0x2ecb('0x56'):_0x312638[_0x2ecb('0x53')]=_0x2ecb('0x44')+_0x4a91eb+_0x2ecb('0x51')+_0x393144+'))';return getZohoUser(_0x312638,'Contacts')[_0x2ecb('0x36')](function(_0x126525){if(_0x126525)return _0x126525;if(_0x36a585['moduleCreate']!=_0x2ecb('0x55')){return createEndUser(_0x28e56c,_0x4a91eb,_0x40ddc8,_0x393144,_0x1473c0,_0x36a585);}else{return{};}});break;case _0x2ecb('0x57'):_0x312638[_0x2ecb('0x53')]='https://www.zohoapis.'+_0x4a91eb+_0x2ecb('0x58')+_0x393144+'))';return getZohoUser(_0x312638,_0x2ecb('0x54'))['then'](function(_0x1818f1){if(_0x1818f1)return _0x1818f1;if(_0x36a585[_0x2ecb('0x46')]!=_0x2ecb('0x55')){return createEndUser(_0x28e56c,_0x4a91eb,_0x40ddc8,_0x393144,_0x1473c0,_0x36a585);}else{return{};}});break;}}function getCall(_0x36e880,_0x368ade,_0x16408d,_0x117a27,_0x2216dc,_0xa29984,_0xa0df78,_0x334958){logger[_0x2ecb('0x2f')](_0x2ecb('0x59'));var _0x4f842a={};_0x4f842a[_0x2ecb('0x5a')]={'name':!_[_0x2ecb('0x1d')](_0x117a27['role']['name'])&&!_[_0x2ecb('0x1d')](_0x117a27[_0x2ecb('0x3e')][_0x2ecb('0x19')])&&_0x117a27[_0x2ecb('0x3e')]['name']===_0x2ecb('0x5b')?_0x117a27[_0x2ecb('0x47')]['name']:!_['isNil'](_0x117a27[_0x2ecb('0x48')])?_0x117a27[_0x2ecb('0x48')]+'\x20'+_0x117a27[_0x2ecb('0x49')]:_0x117a27[_0x2ecb('0x49')],'id':_0x117a27['id']};_0x4f842a[_0x2ecb('0x5c')]=intUtil[_0x2ecb('0x5d')](_0xa29984[_0x2ecb('0x5e')],_0xa0df78,'\x20');_0x4f842a[_0x2ecb('0x5f')]=intUtil[_0x2ecb('0x5d')](_0xa29984[_0x2ecb('0x60')],_0xa0df78,'\x0a');if(_0x2216dc['enduserType']==='Contacts'){_0x4f842a['Who_Id']={'name':!_[_0x2ecb('0x1d')](_0x2216dc[_0x2ecb('0x61')])?_0x2216dc[_0x2ecb('0x61')]:!_[_0x2ecb('0x1d')](_0x2216dc['First_Name'])?_0x2216dc[_0x2ecb('0x62')]+'\x20'+_0x2216dc[_0x2ecb('0x63')]:_0x2216dc['Last_Name'],'id':_0x2216dc['id']};}if(_0x2216dc[_0x2ecb('0x43')]===_0x2ecb('0x54')){_0x4f842a[_0x2ecb('0x64')]={'name':!_[_0x2ecb('0x1d')](_0x2216dc[_0x2ecb('0x61')])?_0x2216dc[_0x2ecb('0x61')]:!_[_0x2ecb('0x1d')](_0x2216dc[_0x2ecb('0x62')])?_0x2216dc[_0x2ecb('0x62')]+'\x20'+_0x2216dc['Last_Name']:_0x2216dc[_0x2ecb('0x63')],'id':_0x2216dc['id']};_0x4f842a['$se_module']=_[_0x2ecb('0x45')](_0x2216dc['enduserType']);}if(_0xa0df78[_0x2ecb('0x65')]){_0x4f842a[_0x2ecb('0x66')]=moment[_0x2ecb('0x67')](parseInt(_0xa0df78[_0x2ecb('0x65')])*0x3e8)[_0x2ecb('0x32')](_0x2ecb('0x68'));}else if(_0xa0df78[_0x2ecb('0x69')]&&_0xa0df78[_0x2ecb('0x6a')]){_0x4f842a[_0x2ecb('0x66')]=moment[_0x2ecb('0x67')](moment(_0xa0df78[_0x2ecb('0x6a')],_0x2ecb('0x6b'))[_0x2ecb('0x6c')](moment(_0xa0df78[_0x2ecb('0x6d')],_0x2ecb('0x6b'))))[_0x2ecb('0x32')](_0x2ecb('0x68'));}switch(_0xa0df78['lastevent']){case'called':_0x4f842a['Call_Result']=_0x2ecb('0x6e');break;case _0x2ecb('0x6f'):case _0x2ecb('0x70'):_0x4f842a[_0x2ecb('0x71')]=_0x2ecb('0x72');break;case _0x2ecb('0x73'):_0x4f842a[_0x2ecb('0x71')]=_0x2ecb('0x74');break;case _0x2ecb('0x75'):_0x4f842a[_0x2ecb('0x71')]=_0x2ecb('0x76');break;case _0x2ecb('0x77'):_0x4f842a[_0x2ecb('0x71')]='Timeout';default:}_0x4f842a[_0x2ecb('0x78')]=(_0x334958==='outbound'?moment(_0xa0df78[_0x2ecb('0x6d')])['format'](_0x2ecb('0x6b')):moment(_0xa0df78[_0x2ecb('0x79')])[_0x2ecb('0x32')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x2ecb('0x32')](_0x2ecb('0x6b'));_0x4f842a['Call_Type']=_0x334958||_0x2ecb('0x7a');_0x4f842a=_[_0x2ecb('0x7b')](_0x4f842a,getCustomFields(_0xa29984['Fields'],_0xa0df78));return request({'method':_0x2ecb('0x24'),'uri':'https://www.zohoapis.'+_0x368ade+_0x2ecb('0x7c'),'headers':{'Authorization':_0x2ecb('0x35')+_0x36e880},'body':{'data':[_0x4f842a]},'json':!![]})['then'](function(_0x5f54bc){if(_0x5f54bc&&_0x5f54bc['data'][0x0][_0x2ecb('0x4a')]===_0x2ecb('0x4b')){logger[_0x2ecb('0x2f')]('Call\x20created!');return{'id':_0x5f54bc[_0x2ecb('0x42')][0x0][_0x2ecb('0x4c')]['id']};}})[_0x2ecb('0x2b')](function(_0x27aaf2){logger[_0x2ecb('0x2f')]('err',_0x27aaf2[_0x2ecb('0x2e')]);console[_0x2ecb('0x7d')]('err',_0x27aaf2);});}exports[_0x2ecb('0x7e')]=function(_0x41e89c,_0x5d2d16,_0x40d10e,_0x28be68,_0x5b618e,_0x4c8090){var _0x3f391c,_0x3667d7,_0x1e68ec;_0x4c8090['host']=intUtil[_0x2ecb('0x7f')](_0x4c8090[_0x2ecb('0x80')]);_0x4c8090['serverUrl']=intUtil[_0x2ecb('0x7f')](_0x4c8090[_0x2ecb('0x81')]);if(_0x5b618e&&_0x5b618e[_0x2ecb('0x82')]){logger[_0x2ecb('0x2f')]('[QUEUE]',_0x2ecb('0x83'));_0x5d2d16[_0x2ecb('0x84')]=_0x4c8090['serverUrl']+_0x2ecb('0x85')+_0x5d2d16[_0x2ecb('0x86')]+_0x2ecb('0x87')+md5(_0x5d2d16[_0x2ecb('0x86')]);}else{_0x5d2d16[_0x2ecb('0x84')]='';}var _0x9da6ea=_0x4c8090[_0x2ecb('0x80')]===_0x2ecb('0x88')?'eu':_0x2ecb('0x89');return getAccessToken(_0x4c8090)[_0x2ecb('0x36')](function(_0x4a6ff1){_0x1e68ec=_0x4a6ff1;return getUser(_0x1e68ec,_0x9da6ea,_0x4c8090,_0x28be68[_0x2ecb('0x39')]);})[_0x2ecb('0x36')](function(_0x557ff9){_0x3f391c=_0x557ff9;logger[_0x2ecb('0x2f')](_0x2ecb('0x8a'),_0x3f391c['id']);return getEndUser(_0x1e68ec,_0x9da6ea,_0x4c8090,_0x5d2d16[_0x2ecb('0x8b')],_0x5d2d16[_0x2ecb('0x8c')],_0x3f391c,_0x40d10e);})[_0x2ecb('0x36')](function(_0x3eab97){_0x3667d7=_0x3eab97;return getCall(_0x1e68ec,_0x9da6ea,_0x4c8090,_0x3f391c,_0x3667d7,_0x40d10e,_0x5d2d16,_0x2ecb('0x7a'));})[_0x2ecb('0x36')](function(_0x7fdc5c){if(_0x7fdc5c){logger['info'](_0x2ecb('0x8d'),_0x7fdc5c['id']);logger[_0x2ecb('0x2f')](_0x2ecb('0x8e'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x28be68['name']),'trigger:browser:url',{'uri':'https://crm.'+_0x4c8090[_0x2ecb('0x80')]+_0x2ecb('0x8f')+_0x7fdc5c['id']});}})[_0x2ecb('0x2b')](function(_0x5d7d61){logger[_0x2ecb('0x2c')]('[QUEUE]',JSON[_0x2ecb('0xf')](_0x5d7d61));});};exports[_0x2ecb('0x90')]=function(_0x17de1a,_0x5b52c2,_0x3c43a7,_0xe8d1ad,_0x46e31c,_0x13ea0a,_0x7f9b11){var _0x75ea09,_0x4edfc3,_0x488457;_0x13ea0a[_0x2ecb('0x80')]=intUtil[_0x2ecb('0x7f')](_0x13ea0a[_0x2ecb('0x80')]);_0x13ea0a[_0x2ecb('0x81')]=intUtil[_0x2ecb('0x7f')](_0x13ea0a[_0x2ecb('0x81')]);if(_0x7f9b11&&_0x7f9b11['recordingFormat']&&_0x7f9b11[_0x2ecb('0x91')]!==_0x2ecb('0x92')){logger[_0x2ecb('0x2f')](_0x2ecb('0x93'),_0x2ecb('0x83'));_0x5b52c2[_0x2ecb('0x84')]=_0x13ea0a[_0x2ecb('0x81')]+'/api/voice/recordings/'+_0x5b52c2[_0x2ecb('0x86')]+'/downloads?type=uniqueid&token='+md5(_0x5b52c2[_0x2ecb('0x86')]);}var _0x90a758=_0x13ea0a[_0x2ecb('0x80')]===_0x2ecb('0x88')?'eu':_0x2ecb('0x89');return getAccessToken(_0x13ea0a)['then'](function(_0xa5fd30){_0x488457=_0xa5fd30;return getUser(_0x488457,_0x90a758,_0x13ea0a,_0xe8d1ad['email']);})['then'](function(_0x4a411d){_0x75ea09=_0x4a411d;logger[_0x2ecb('0x2f')](_0x2ecb('0x8a'),_0x75ea09['id']);return getEndUser(_0x488457,_0x90a758,_0x13ea0a,_0x5b52c2[_0x2ecb('0x94')],_0x5b52c2[_0x2ecb('0x95')],_0x75ea09,_0x3c43a7);})['then'](function(_0x144d0f){_0x4edfc3=_0x144d0f;return getCall(_0x488457,_0x90a758,_0x13ea0a,_0x75ea09,_0x4edfc3,_0x3c43a7,_0x5b52c2,_0x2ecb('0x96'));})[_0x2ecb('0x36')](function(_0xea273f){if(_0xea273f){logger[_0x2ecb('0x2f')](_0x2ecb('0x8d'),_0xea273f['id']);logger[_0x2ecb('0x2f')](_0x2ecb('0x93'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x2ecb('0x97'),_0xe8d1ad['name']),'trigger:browser:url',{'uri':_0x2ecb('0x98')+_0x13ea0a[_0x2ecb('0x80')]+'/crm/EntityInfo.do?module=Calls&id='+_0xea273f['id']});}})[_0x2ecb('0x2b')](function(_0x49a2e7){logger[_0x2ecb('0x2c')](_0x2ecb('0x93'),JSON[_0x2ecb('0xf')](_0x49a2e7));});};exports['unmanaged']=function(_0xdd2789,_0x234d0d,_0x10e1c9,_0x2aa156,_0x3855bd,_0x2d6e1e){var _0x5e7652,_0x8dcad9,_0x47e292;_0x2d6e1e[_0x2ecb('0x80')]=intUtil[_0x2ecb('0x7f')](_0x2d6e1e[_0x2ecb('0x80')]);_0x2d6e1e['serverUrl']=intUtil[_0x2ecb('0x7f')](_0x2d6e1e[_0x2ecb('0x81')]);if(_0x3855bd&&_0x3855bd[_0x2ecb('0x82')]){logger[_0x2ecb('0x2f')]('['+_0x234d0d[_0x2ecb('0x99')][_0x2ecb('0x9a')]()+']','Recording\x20is\x20enabled!');_0x234d0d[_0x2ecb('0x84')]=_0x2d6e1e[_0x2ecb('0x81')]+_0x2ecb('0x85')+_0x234d0d['uniqueid']+_0x2ecb('0x87')+md5(_0x234d0d[_0x2ecb('0x86')]);}else{_0x234d0d[_0x2ecb('0x84')]='';}var _0x1e734c=_0x2d6e1e['host']==='zoho.eu'?'eu':'com';return getAccessToken(_0x2d6e1e)['then'](function(_0x369069){_0x47e292=_0x369069;return getUser(_0x47e292,_0x1e734c,_0x2d6e1e);})[_0x2ecb('0x36')](function(_0x5b1a2f){_0x5e7652=_0x5b1a2f;logger[_0x2ecb('0x2f')](_0x2ecb('0x8a'),_0x5e7652['id']);return getEndUser(_0x47e292,_0x1e734c,_0x2d6e1e,_0x234d0d[_0x2ecb('0x8b')],_0x234d0d[_0x2ecb('0x8c')],_0x5e7652,_0x10e1c9);})[_0x2ecb('0x36')](function(_0x24caf9){_0x8dcad9=_0x24caf9;return getCall(_0x47e292,_0x1e734c,_0x2d6e1e,_0x5e7652,_0x8dcad9,_0x10e1c9,_0x234d0d,_0x2ecb('0x7a'));})[_0x2ecb('0x36')](function(_0x1d3bde){if(_0x1d3bde){logger[_0x2ecb('0x2f')](_0x2ecb('0x8d'),_0x1d3bde['id']);}})[_0x2ecb('0x2b')](function(_0x57f559){logger[_0x2ecb('0x2c')]('['+_0x234d0d[_0x2ecb('0x99')][_0x2ecb('0x9a')]()+']',JSON['stringify'](_0x57f559));});}; \ No newline at end of file +var _0x43fd=['calleridname','calleridnum','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','recordingURL','com','destcalleridname','Outbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.','unmanaged','lastevent','zoho.eu','Inbound','toUpperCase','lodash','request-promise','util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','stringify','length','forEach','picklist','type','idField','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','expires_in','access_token','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','users','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','user','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','details','enduserType','Error:\x20','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Creating\x20new\x20call...','administrator','getString','Subjects','Description','Descriptions','Who_Id','First_Name','Last_Name','What_Id','Full_Name','talktime','Call_Duration','mm:ss','answertime','endtime','utc','diff','starttime','YYYY-MM-DDTHH:mm:ss','called','Called','connect','Call_Result','rejected','abandoned','Abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','merge','Fields','Call\x20created!','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','email','The\x20User\x20ID\x20is:'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x43fd,0x150));var _0xd43f=function(_0x5d3920,_0xcf28e){_0x5d3920=_0x5d3920-0x0;var _0x3103ae=_0x43fd[_0x5d3920];return _0x3103ae;};'use strict';var _=require(_0xd43f('0x0'));var rp=require(_0xd43f('0x1'));var md5=require('md5');var util=require(_0xd43f('0x2'));var intUtil=require('./util');var moment=require(_0xd43f('0x3'));var Redis=require(_0xd43f('0x4'));var BPromise=require(_0xd43f('0x5'));var config=require(_0xd43f('0x6'));var logger=require(_0xd43f('0x7'))(_0xd43f('0x8'));config[_0xd43f('0x9')]=_[_0xd43f('0xa')](config[_0xd43f('0x9')],{'host':_0xd43f('0xb'),'port':0x18eb});var io=require(_0xd43f('0xc'))(new Redis(config[_0xd43f('0x9')]));function emit(_0x39a819,_0x44b1bf,_0x587add){io['to'](_0x39a819)[_0xd43f('0xd')](_0x44b1bf,_0x587add);}function request(_0x43b9db){logger[_0xd43f('0xe')]('[HTTP]',JSON[_0xd43f('0xf')](_0x43b9db));return rp(_0x43b9db);}function getCustomFields(_0x1815de,_0x4d675b){var _0x36e63c={};if(_0x1815de[_0xd43f('0x10')]>0x0){_[_0xd43f('0x11')](_0x1815de,function(_0x2550fa){if(_['includes'](['string',_0xd43f('0x12')],_0x2550fa[_0xd43f('0x13')])&&_0x2550fa['idField']){_0x36e63c[_0x2550fa[_0xd43f('0x14')]]=_0x2550fa['content']['toString']();}else if(_0x2550fa[_0xd43f('0x13')]===_0xd43f('0x15')&&_0x2550fa['variableName']&&_0x2550fa[_0xd43f('0x14')]&&_0x4d675b[_0x2550fa[_0xd43f('0x16')]]){_0x36e63c[_0x2550fa['idField']]=_0x4d675b[_0x2550fa[_0xd43f('0x16')]][_0xd43f('0x17')]();}else if(_0x2550fa[_0xd43f('0x13')]===_0xd43f('0x18')&&_0x2550fa[_0xd43f('0x19')]&&_0x2550fa['Variable']['name']&&_0x2550fa['idField']&&_0x4d675b[_0x2550fa[_0xd43f('0x19')][_0xd43f('0x1a')][_0xd43f('0x1b')]()]){_0x36e63c[_0x2550fa[_0xd43f('0x14')]]=_0x4d675b[_0x2550fa['Variable'][_0xd43f('0x1a')][_0xd43f('0x1b')]()][_0xd43f('0x17')]();}});}return _0x36e63c;}function getName(_0x2702cf){if(_0x2702cf[_0xd43f('0x1c')]('\x20')>0x0){var _0x4b5608=_0x2702cf[_0xd43f('0x1d')](/ (.+)/);if(_0x4b5608[0x1]){return _0x4b5608;}}return[_0x2702cf,_0x2702cf];}var accountsTokens={};function getAccessToken(_0x5bae9e){return new Promise(function(_0x1ad9d3,_0x5d93f4){if(!_[_0xd43f('0x1e')](accountsTokens[_0x5bae9e['id']])&&!_[_0xd43f('0x1e')](accountsTokens[_0x5bae9e['id']]['access_token'])){if(moment()[_0xd43f('0x1f')](accountsTokens[_0x5bae9e['id']][_0xd43f('0x20')])){_0x1ad9d3(accountsTokens[_0x5bae9e['id']][_0xd43f('0x21')]);}}var _0x58bd30;switch(_0x5bae9e[_0xd43f('0x22')]){case'US':_0x58bd30='https://accounts.zoho.com';break;case'AU':_0x58bd30=_0xd43f('0x23');break;case'EU':_0x58bd30=_0xd43f('0x24');break;case'IN':_0x58bd30=_0xd43f('0x25');break;case'CN':_0x58bd30=_0xd43f('0x26');break;default:_0x58bd30=_0xd43f('0x24');break;}var _0x364d67={'method':'POST','uri':_0x58bd30+_0xd43f('0x27'),'qs':{'refresh_token':_0x5bae9e[_0xd43f('0x28')],'client_id':_0x5bae9e[_0xd43f('0x29')],'client_secret':_0x5bae9e[_0xd43f('0x2a')],'grant_type':_0xd43f('0x2b')},'json':!![]};return rp(_0x364d67)[_0xd43f('0x2c')](function(_0x2df5b4){accountsTokens[_0x5bae9e['id']]={'access_token':_0x2df5b4[_0xd43f('0x21')],'expires_in':moment()[_0xd43f('0x2d')](_0x2df5b4[_0xd43f('0x20')],'seconds')};_0x1ad9d3(_0x2df5b4[_0xd43f('0x21')]);})[_0xd43f('0x2e')](function(_0xed6845){logger[_0xd43f('0x2f')](_0xd43f('0x30'),_0xed6845[_0xd43f('0x31')]);_0x5d93f4(_0xed6845);});});}function getUser(_0x4efdb5,_0x23293d,_0x2442ea,_0x1db45c){logger[_0xd43f('0x32')](_0xd43f('0x33'));return request({'method':_0xd43f('0x34'),'uri':util[_0xd43f('0x35')](_0xd43f('0x36'),_0x23293d),'qs':{'type':_0xd43f('0x37')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4efdb5},'json':!![]})[_0xd43f('0x2c')](function(_0x422680){if(_0x422680['users']){var _0x3de6ca=-0x1;if(_['isArrayLikeObject'](_0x422680[_0xd43f('0x38')])){if(!_['isNil'](_0x1db45c)){_0x3de6ca=_[_0xd43f('0x39')](_0x422680['users'],function(_0x288ae9){return _0x288ae9['email']===_0x1db45c;});}if(_0x3de6ca>=0x0){logger[_0xd43f('0x32')](_0xd43f('0x3a'));}else{logger['info'](_0xd43f('0x3b'));_0x3de6ca=_[_0xd43f('0x39')](_0x422680[_0xd43f('0x38')],function(_0x32171d){return _0x32171d[_0xd43f('0x3c')][_0xd43f('0x1a')]==='Administrator';});}return _0x422680[_0xd43f('0x38')][_0x3de6ca];}else{if(_0x422680[_0xd43f('0x3d')]['profile'][_0xd43f('0x1a')]===_0xd43f('0x3e')){logger[_0xd43f('0x32')](_0xd43f('0x3b'));user=_0x422680[_0xd43f('0x3d')];return user;}else{logger['error'](_0xd43f('0x3f'),JSON['stringify'](_0x422680));throw new Error(_0xd43f('0x40')+JSON[_0xd43f('0xf')](_0x422680));}}}else{logger[_0xd43f('0x2f')](_0xd43f('0x3f'),JSON[_0xd43f('0xf')](_0x422680));throw new Error(_0xd43f('0x40')+JSON['stringify'](_0x422680));}})[_0xd43f('0x2e')](function(_0x1ea54d){console['error'](_0x1ea54d);});}function getZohoUser(_0x95e3b9,_0x28b2fa){return new BPromise(function(_0x29edbc,_0x48982d){request(_0x95e3b9)[_0xd43f('0x2c')](function(_0x4f0a86){var _0x20b56d=null;if(_0x4f0a86){_0x20b56d=_0x4f0a86[_0xd43f('0x41')][0x0];_0x20b56d['enduserType']=_0x28b2fa;}_0x29edbc(_0x20b56d);})[_0xd43f('0x2e')](function(_0x579f4b){_0x48982d(_0x579f4b);});});}function createEndUser(_0x1ec9f3,_0x2c7609,_0x4b9404,_0x4c8f8e,_0x5e7a0a,_0x5940af){var _0x4b9404=getName(_0x4b9404);return request({'method':_0xd43f('0x42'),'uri':_0xd43f('0x43')+_0x2c7609+_0xd43f('0x44')+_[_0xd43f('0x45')](_0x5940af[_0xd43f('0x46')])+'s','body':{'data':[{'Last_Name':_0x4b9404[0x1],'First_Name':_0x4b9404[0x0],'Phone':_0x4c8f8e,'Owner':{'name':!_[_0xd43f('0x1e')](_0x5e7a0a[_0xd43f('0x47')]['name'])?_0x5e7a0a['role'][_0xd43f('0x1a')]:!_[_0xd43f('0x1e')](_0x5e7a0a[_0xd43f('0x48')])?_0x5e7a0a[_0xd43f('0x48')]+'\x20'+_0x5e7a0a[_0xd43f('0x49')]:_0x5e7a0a[_0xd43f('0x49')],'id':_0x5e7a0a['id']}}]},'headers':{'Authorization':_0xd43f('0x4a')+_0x1ec9f3},'json':!![]})[_0xd43f('0x2c')](function(_0x41bf12){if(_0x41bf12&&_0x41bf12['data'][0x0][_0xd43f('0x4b')]===_0xd43f('0x4c')){var _0x417a58=_0x41bf12[_0xd43f('0x41')][0x0][_0xd43f('0x4d')];_0x417a58[_0xd43f('0x4e')]=_[_0xd43f('0x45')](_0x5940af[_0xd43f('0x46')])+'s';return _0x417a58;}logger['error'](_0xd43f('0x3f'),JSON['stringify'](data));throw new Error(_0xd43f('0x4f')+JSON[_0xd43f('0xf')](data));})[_0xd43f('0x2e')](function(_0x5b19bb){console['log'](_0xd43f('0x50'),_0x5b19bb);});}function getEndUser(_0x517327,_0x8b96c1,_0x2d7e10,_0x58bb2f,_0x1aae83,_0x2f00e1,_0x12d5b9){var _0x18d6b6={'method':_0xd43f('0x34'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x517327},'json':!![]};switch(_0x12d5b9[_0xd43f('0x51')]){case _0xd43f('0x52'):_0x18d6b6[_0xd43f('0x53')]='https://www.zohoapis.'+_0x8b96c1+_0xd43f('0x54')+_0x1aae83+'))';return getZohoUser(_0x18d6b6,_0xd43f('0x55'))['then'](function(_0x1e64a2){if(_0x1e64a2)return _0x1e64a2;_0x18d6b6[_0xd43f('0x53')]=_0xd43f('0x43')+_0x8b96c1+_0xd43f('0x56')+_0x1aae83+'))';return getZohoUser(_0x18d6b6,_0xd43f('0x57'))['then'](function(_0x4ae991){if(_0x4ae991)return _0x4ae991;if(_0x12d5b9[_0xd43f('0x46')]!=_0xd43f('0x58')){return createEndUser(_0x517327,_0x8b96c1,_0x58bb2f,_0x1aae83,_0x2f00e1,_0x12d5b9);}else{return{};}});});break;case'contact':_0x18d6b6[_0xd43f('0x53')]=_0xd43f('0x43')+_0x8b96c1+_0xd43f('0x54')+_0x1aae83+'))';return getZohoUser(_0x18d6b6,_0xd43f('0x55'))[_0xd43f('0x2c')](function(_0x39ad8f){if(_0x39ad8f)return _0x39ad8f;if(_0x12d5b9['moduleCreate']!='nothing'){return createEndUser(_0x517327,_0x8b96c1,_0x58bb2f,_0x1aae83,_0x2f00e1,_0x12d5b9);}else{return{};}});break;case _0xd43f('0x59'):_0x18d6b6[_0xd43f('0x53')]=_0xd43f('0x43')+_0x8b96c1+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x1aae83+'))';return getZohoUser(_0x18d6b6,_0xd43f('0x57'))['then'](function(_0x24b830){if(_0x24b830)return _0x24b830;if(_0x12d5b9['moduleCreate']!=_0xd43f('0x58')){return createEndUser(_0x517327,_0x8b96c1,_0x58bb2f,_0x1aae83,_0x2f00e1,_0x12d5b9);}else{return{};}});break;}}function getCall(_0x51833e,_0x89f548,_0x5041a6,_0x1ba071,_0x620665,_0x4c3036,_0x3ad9c4,_0x4972aa){logger[_0xd43f('0x32')](_0xd43f('0x5a'));var _0x41bfac={};_0x41bfac['Owner']={'name':!_[_0xd43f('0x1e')](_0x1ba071[_0xd43f('0x47')][_0xd43f('0x1a')])&&!_[_0xd43f('0x1e')](_0x1ba071[_0xd43f('0x3c')][_0xd43f('0x1a')])&&_0x1ba071[_0xd43f('0x3c')][_0xd43f('0x1a')]===_0xd43f('0x5b')?_0x1ba071[_0xd43f('0x47')]['name']:!_['isNil'](_0x1ba071[_0xd43f('0x48')])?_0x1ba071['first_name']+'\x20'+_0x1ba071[_0xd43f('0x49')]:_0x1ba071[_0xd43f('0x49')],'id':_0x1ba071['id']};_0x41bfac['Subject']=intUtil[_0xd43f('0x5c')](_0x4c3036[_0xd43f('0x5d')],_0x3ad9c4,'\x20');_0x41bfac[_0xd43f('0x5e')]=intUtil[_0xd43f('0x5c')](_0x4c3036[_0xd43f('0x5f')],_0x3ad9c4,'\x0a');if(_0x620665[_0xd43f('0x4e')]===_0xd43f('0x55')){_0x41bfac[_0xd43f('0x60')]={'name':!_[_0xd43f('0x1e')](_0x620665['Full_Name'])?_0x620665['Full_Name']:!_[_0xd43f('0x1e')](_0x620665[_0xd43f('0x61')])?_0x620665[_0xd43f('0x61')]+'\x20'+_0x620665[_0xd43f('0x62')]:_0x620665['Last_Name'],'id':_0x620665['id']};}if(_0x620665[_0xd43f('0x4e')]===_0xd43f('0x57')){_0x41bfac[_0xd43f('0x63')]={'name':!_['isNil'](_0x620665['Full_Name'])?_0x620665[_0xd43f('0x64')]:!_[_0xd43f('0x1e')](_0x620665['First_Name'])?_0x620665[_0xd43f('0x61')]+'\x20'+_0x620665[_0xd43f('0x62')]:_0x620665['Last_Name'],'id':_0x620665['id']};_0x41bfac['$se_module']=_['startCase'](_0x620665[_0xd43f('0x4e')]);}if(_0x3ad9c4[_0xd43f('0x65')]){_0x41bfac[_0xd43f('0x66')]=moment['utc'](parseInt(_0x3ad9c4[_0xd43f('0x65')])*0x3e8)[_0xd43f('0x35')](_0xd43f('0x67'));}else if(_0x3ad9c4[_0xd43f('0x68')]&&_0x3ad9c4[_0xd43f('0x69')]){_0x41bfac['Call_Duration']=moment[_0xd43f('0x6a')](moment(_0x3ad9c4[_0xd43f('0x69')],'YYYY-MM-DDTHH:mm:ss')[_0xd43f('0x6b')](moment(_0x3ad9c4[_0xd43f('0x6c')],_0xd43f('0x6d'))))['format'](_0xd43f('0x67'));}switch(_0x3ad9c4['lastevent']){case _0xd43f('0x6e'):_0x41bfac['Call_Result']=_0xd43f('0x6f');break;case'complete':case _0xd43f('0x70'):_0x41bfac[_0xd43f('0x71')]='Answered';break;case _0xd43f('0x72'):_0x41bfac[_0xd43f('0x71')]='Rejected';break;case _0xd43f('0x73'):_0x41bfac[_0xd43f('0x71')]=_0xd43f('0x74');break;case _0xd43f('0x75'):_0x41bfac['Call_Result']='Timeout';default:}_0x41bfac[_0xd43f('0x76')]=(_0x4972aa===_0xd43f('0x77')?moment(_0x3ad9c4[_0xd43f('0x6c')])[_0xd43f('0x35')](_0xd43f('0x6d')):moment(_0x3ad9c4[_0xd43f('0x78')])[_0xd43f('0x35')](_0xd43f('0x6d')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x41bfac['Call_Type']=_0x4972aa||'Inbound';_0x41bfac=_[_0xd43f('0x79')](_0x41bfac,getCustomFields(_0x4c3036[_0xd43f('0x7a')],_0x3ad9c4));return request({'method':'POST','uri':_0xd43f('0x43')+_0x89f548+'/crm/v2/Calls','headers':{'Authorization':_0xd43f('0x4a')+_0x51833e},'body':{'data':[_0x41bfac]},'json':!![]})[_0xd43f('0x2c')](function(_0x4c6d2a){if(_0x4c6d2a&&_0x4c6d2a['data'][0x0][_0xd43f('0x4b')]===_0xd43f('0x4c')){logger[_0xd43f('0x32')](_0xd43f('0x7b'));return{'id':_0x4c6d2a[_0xd43f('0x41')][0x0][_0xd43f('0x4d')]['id']};}})[_0xd43f('0x2e')](function(_0x389c34){logger[_0xd43f('0x32')](_0xd43f('0x7c'),_0x389c34['stack']);console[_0xd43f('0x7d')](_0xd43f('0x7c'),_0x389c34);});}exports[_0xd43f('0x7e')]=function(_0x105344,_0x4ee2c5,_0x5f42e4,_0x1e65b4,_0x47f4de,_0x172a48){var _0x5c8dd6,_0x3123c5,_0x1ead63;_0x172a48[_0xd43f('0x7f')]=intUtil[_0xd43f('0x80')](_0x172a48['host']);_0x172a48[_0xd43f('0x81')]=intUtil[_0xd43f('0x80')](_0x172a48[_0xd43f('0x81')]);if(_0x47f4de&&_0x47f4de[_0xd43f('0x82')]){logger[_0xd43f('0x32')](_0xd43f('0x83'),_0xd43f('0x84'));_0x4ee2c5['recordingURL']=_0x172a48['serverUrl']+_0xd43f('0x85')+_0x4ee2c5[_0xd43f('0x86')]+_0xd43f('0x87')+md5(_0x4ee2c5[_0xd43f('0x86')]);}else{_0x4ee2c5['recordingURL']='';}var _0x574545=_0x172a48[_0xd43f('0x7f')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x172a48)[_0xd43f('0x2c')](function(_0x2629ca){_0x1ead63=_0x2629ca;return getUser(_0x1ead63,_0x574545,_0x172a48,_0x1e65b4[_0xd43f('0x88')]);})[_0xd43f('0x2c')](function(_0x44ee2f){_0x5c8dd6=_0x44ee2f;logger['info'](_0xd43f('0x89'),_0x5c8dd6['id']);return getEndUser(_0x1ead63,_0x574545,_0x172a48,_0x4ee2c5[_0xd43f('0x8a')],_0x4ee2c5[_0xd43f('0x8b')],_0x5c8dd6,_0x5f42e4);})[_0xd43f('0x2c')](function(_0x113417){_0x3123c5=_0x113417;return getCall(_0x1ead63,_0x574545,_0x172a48,_0x5c8dd6,_0x3123c5,_0x5f42e4,_0x4ee2c5,'Inbound');})['then'](function(_0x207896){if(_0x207896){logger[_0xd43f('0x32')]('The\x20Call\x20ID\x20is:',_0x207896['id']);logger[_0xd43f('0x32')]('[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xd43f('0x8c'),_0x1e65b4[_0xd43f('0x1a')]),_0xd43f('0x8d'),{'uri':'https://crm.'+_0x172a48[_0xd43f('0x7f')]+_0xd43f('0x8e')+_0x207896['id']});}})['catch'](function(_0x409f28){logger[_0xd43f('0x2f')](_0xd43f('0x83'),JSON[_0xd43f('0xf')](_0x409f28));});};exports[_0xd43f('0x77')]=function(_0x8a0174,_0x5e8444,_0xea3f2f,_0x5c4c15,_0x50539a,_0x157446,_0x4d27cf){var _0x14a9ba,_0x4f8cb6,_0x2c3f0e;_0x157446[_0xd43f('0x7f')]=intUtil[_0xd43f('0x80')](_0x157446['host']);_0x157446['serverUrl']=intUtil['stripTrailingSlash'](_0x157446['serverUrl']);if(_0x4d27cf&&_0x4d27cf[_0xd43f('0x8f')]&&_0x4d27cf[_0xd43f('0x8f')]!==_0xd43f('0x90')){logger[_0xd43f('0x32')](_0xd43f('0x91'),_0xd43f('0x84'));_0x5e8444[_0xd43f('0x92')]=_0x157446[_0xd43f('0x81')]+'/api/voice/recordings/'+_0x5e8444['uniqueid']+_0xd43f('0x87')+md5(_0x5e8444[_0xd43f('0x86')]);}var _0x39c1e9=_0x157446[_0xd43f('0x7f')]==='zoho.eu'?'eu':_0xd43f('0x93');return getAccessToken(_0x157446)[_0xd43f('0x2c')](function(_0x4cc1de){_0x2c3f0e=_0x4cc1de;return getUser(_0x2c3f0e,_0x39c1e9,_0x157446,_0x5c4c15['email']);})['then'](function(_0x247c04){_0x14a9ba=_0x247c04;logger['info'](_0xd43f('0x89'),_0x14a9ba['id']);return getEndUser(_0x2c3f0e,_0x39c1e9,_0x157446,_0x5e8444[_0xd43f('0x94')],_0x5e8444['destcalleridnum'],_0x14a9ba,_0xea3f2f);})[_0xd43f('0x2c')](function(_0x4b126c){_0x4f8cb6=_0x4b126c;return getCall(_0x2c3f0e,_0x39c1e9,_0x157446,_0x14a9ba,_0x4f8cb6,_0xea3f2f,_0x5e8444,_0xd43f('0x95'));})['then'](function(_0x5282ac){if(_0x5282ac){logger[_0xd43f('0x32')](_0xd43f('0x96'),_0x5282ac['id']);logger['info'](_0xd43f('0x91'),_0xd43f('0x97'));emit(util[_0xd43f('0x35')](_0xd43f('0x8c'),_0x5c4c15[_0xd43f('0x1a')]),_0xd43f('0x8d'),{'uri':_0xd43f('0x98')+_0x157446[_0xd43f('0x7f')]+'/crm/EntityInfo.do?module=Calls&id='+_0x5282ac['id']});}})[_0xd43f('0x2e')](function(_0x497e6a){logger[_0xd43f('0x2f')]('[OUTBOUND]',JSON[_0xd43f('0xf')](_0x497e6a));});};exports[_0xd43f('0x99')]=function(_0x55fb55,_0x29d70c,_0x433ebe,_0x1120a8,_0x3b07ca,_0xaf2173){var _0x8172ca,_0x1ec37b,_0x3bb2e6;_0xaf2173[_0xd43f('0x7f')]=intUtil['stripTrailingSlash'](_0xaf2173[_0xd43f('0x7f')]);_0xaf2173[_0xd43f('0x81')]=intUtil['stripTrailingSlash'](_0xaf2173[_0xd43f('0x81')]);if(_0x3b07ca&&_0x3b07ca['monitor_format']){logger['info']('['+_0x29d70c[_0xd43f('0x9a')]['toUpperCase']()+']',_0xd43f('0x84'));_0x29d70c[_0xd43f('0x92')]=_0xaf2173[_0xd43f('0x81')]+_0xd43f('0x85')+_0x29d70c[_0xd43f('0x86')]+_0xd43f('0x87')+md5(_0x29d70c[_0xd43f('0x86')]);}else{_0x29d70c[_0xd43f('0x92')]='';}var _0x41796d=_0xaf2173['host']===_0xd43f('0x9b')?'eu':'com';return getAccessToken(_0xaf2173)['then'](function(_0x2f7597){_0x3bb2e6=_0x2f7597;return getUser(_0x3bb2e6,_0x41796d,_0xaf2173);})[_0xd43f('0x2c')](function(_0x462445){_0x8172ca=_0x462445;logger[_0xd43f('0x32')](_0xd43f('0x89'),_0x8172ca['id']);return getEndUser(_0x3bb2e6,_0x41796d,_0xaf2173,_0x29d70c[_0xd43f('0x8a')],_0x29d70c[_0xd43f('0x8b')],_0x8172ca,_0x433ebe);})['then'](function(_0x5f258b){_0x1ec37b=_0x5f258b;return getCall(_0x3bb2e6,_0x41796d,_0xaf2173,_0x8172ca,_0x1ec37b,_0x433ebe,_0x29d70c,_0xd43f('0x9c'));})[_0xd43f('0x2c')](function(_0x2a930a){if(_0x2a930a){logger[_0xd43f('0x32')]('The\x20Call\x20ID\x20is:',_0x2a930a['id']);}})['catch'](function(_0x2cf8b4){logger['error']('['+_0x29d70c[_0xd43f('0x9a')][_0xd43f('0x9d')]()+']',JSON['stringify'](_0x2cf8b4));});}; \ 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 9778ed0..76ce5d3 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 _0xe4e9=['error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','shelljs','mustache','../../../../config/logger','trigger','exec','data2','Script'];(function(_0x4f69db,_0x18c44d){var _0x31e6f4=function(_0x137c6b){while(--_0x137c6b){_0x4f69db['push'](_0x4f69db['shift']());}};_0x31e6f4(++_0x18c44d);}(_0xe4e9,0x16f));var _0x9e4e=function(_0x1cd47c,_0x5592fe){_0x1cd47c=_0x1cd47c-0x0;var _0x12b02f=_0xe4e9[_0x1cd47c];return _0x12b02f;};'use strict';var util=require('util');var sh=require(_0x9e4e('0x0'));var Mustache=require(_0x9e4e('0x1'));var logger=require(_0x9e4e('0x2'))(_0x9e4e('0x3'));exports[_0x9e4e('0x4')]=function(_0x3842c2,_0x5143c4){var _0x22e852=_0x3842c2[_0x9e4e('0x5')]?_0x3842c2[_0x9e4e('0x5')]:_0x9e4e('0x6');var _0x2ebcf1=_0x3842c2['data3']?Mustache['render'](_0x3842c2['data3'],_0x5143c4):_0x5143c4;sh[_0x9e4e('0x4')](_0x2ebcf1,function(_0x2135d3,_0x5ab738,_0x4087f4){if(_0x2135d3!==0x0){logger[_0x9e4e('0x7')](util['format'](_0x9e4e('0x8'),_0x22e852,_0x2ebcf1,_0x2135d3,_0x4087f4));}else{logger[_0x9e4e('0x9')](util[_0x9e4e('0xa')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x22e852,_0x2ebcf1,_0x5ab738));}});}; \ No newline at end of file +var _0xdfa2=['data3','render','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','mustache','../../../../config/logger','trigger','data2','Script'];(function(_0x3d8b26,_0x3640f6){var _0x2f8369=function(_0x255495){while(--_0x255495){_0x3d8b26['push'](_0x3d8b26['shift']());}};_0x2f8369(++_0x3640f6);}(_0xdfa2,0xf5));var _0x2dfa=function(_0x47a6db,_0x482938){_0x47a6db=_0x47a6db-0x0;var _0xe98416=_0xdfa2[_0x47a6db];return _0xe98416;};'use strict';var util=require(_0x2dfa('0x0'));var sh=require(_0x2dfa('0x1'));var Mustache=require(_0x2dfa('0x2'));var logger=require(_0x2dfa('0x3'))(_0x2dfa('0x4'));exports['exec']=function(_0x269fbe,_0x4b8266){var _0x4978ba=_0x269fbe[_0x2dfa('0x5')]?_0x269fbe['data2']:_0x2dfa('0x6');var _0x245309=_0x269fbe[_0x2dfa('0x7')]?Mustache[_0x2dfa('0x8')](_0x269fbe[_0x2dfa('0x7')],_0x4b8266):_0x4b8266;sh['exec'](_0x245309,function(_0x36f6ca,_0x47886f,_0x50b18d){if(_0x36f6ca!==0x0){logger[_0x2dfa('0x9')](util[_0x2dfa('0xa')](_0x2dfa('0xb'),_0x4978ba,_0x245309,_0x36f6ca,_0x50b18d));}else{logger[_0x2dfa('0xc')](util['format'](_0x2dfa('0xd'),_0x4978ba,_0x245309,_0x47886f));}});}; \ 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 8921458..b46ae7f 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 _0x8c94=['data2','then',',\x20request\x20body:\x20','stringify','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','request-promise','lodash','mustache','../../../../config/logger','trigger','exec','data1','render','number','data5','headers','data6','parse','error','toUpperCase','GET','DELETE','PUT','body','stack','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s'];(function(_0x611891,_0x34498d){var _0x285b64=function(_0x7fc9a0){while(--_0x7fc9a0){_0x611891['push'](_0x611891['shift']());}};_0x285b64(++_0x34498d);}(_0x8c94,0x6a));var _0x48c9=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x8c94[_0x13e741];return _0x3f8bb3;};'use strict';var rp=require(_0x48c9('0x0'));var util=require('util');var _=require(_0x48c9('0x1'));var Mustache=require(_0x48c9('0x2'));var logger=require(_0x48c9('0x3'))(_0x48c9('0x4'));exports[_0x48c9('0x5')]=function(_0xfcde36,_0x544383){var _0x90e91,_0x142aba;var _0x200c3a={'method':_0xfcde36[_0x48c9('0x6')]['toUpperCase'](),'uri':Mustache[_0x48c9('0x7')](_0xfcde36['data2'],_0x544383),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xfcde36['data5'])===_0x48c9('0x8')&&parseInt(_0xfcde36['data5'])>=0x1&&parseInt(_0xfcde36[_0x48c9('0x9')])<=0xa?parseInt(_0xfcde36[_0x48c9('0x9')])*0x3e8:0x5*0x3e8};try{_0x200c3a[_0x48c9('0xa')]=_0xfcde36[_0x48c9('0xb')]?JSON[_0x48c9('0xc')](Mustache['render'](_0xfcde36['data6'],_0x544383)):{};}catch(_0x25f14d){logger[_0x48c9('0xd')](_0x25f14d['stack']);}switch(_0xfcde36[_0x48c9('0x6')][_0x48c9('0xe')]()){case _0x48c9('0xf'):case _0x48c9('0x10'):_0x90e91=null;_0x200c3a['qs']=_0x544383;break;case'POST':case _0x48c9('0x11'):if(_0xfcde36['data7']){try{_0x90e91=JSON[_0x48c9('0xc')](Mustache[_0x48c9('0x7')](_0xfcde36['data7'],_0x544383));_0x200c3a[_0x48c9('0x12')]=_0x90e91;}catch(_0x1b6425){logger['error'](_0x1b6425[_0x48c9('0x13')]);logger['error']('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x90e91=_0x544383;_0x200c3a[_0x48c9('0x12')]=_0x90e91;}break;}logger['info'](util[_0x48c9('0x14')](_0x48c9('0x15'),_0xfcde36['data1'],_0xfcde36[_0x48c9('0x16')],JSON['stringify'](_0x200c3a)));rp(_0x200c3a)[_0x48c9('0x17')](function(_0x1e057e){_0x90e91=!_['isNil'](_0x90e91)?_0x48c9('0x18')+_0x90e91:'';_0x142aba=typeof _0x1e057e['body']==='object'?JSON[_0x48c9('0x19')](_0x1e057e[_0x48c9('0x12')]):_0x1e057e['body'];logger[_0x48c9('0x1a')](util['format'](_0x48c9('0x1b'),_0xfcde36[_0x48c9('0x6')],_0xfcde36[_0x48c9('0x16')],_0x1e057e['statusCode'],_0x142aba));})['catch'](function(_0x32cf47){logger[_0x48c9('0xd')](util[_0x48c9('0x14')](_0x48c9('0x1c'),_0xfcde36[_0x48c9('0x6')],_0xfcde36[_0x48c9('0x16')],_0x32cf47[_0x48c9('0x1d')],_0x32cf47[_0x48c9('0x1e')],_0x32cf47[_0x48c9('0x1f')]));});}; \ No newline at end of file +var _0xb792=['render','data2','data5','number','headers','error','GET','DELETE','PUT','data7','parse','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','util','lodash','../../../../config/logger','trigger','data1','toUpperCase'];(function(_0xe96711,_0x3c2895){var _0x311cc5=function(_0xf27035){while(--_0xf27035){_0xe96711['push'](_0xe96711['shift']());}};_0x311cc5(++_0x3c2895);}(_0xb792,0x19e));var _0x2b79=function(_0x50611d,_0x2a8e67){_0x50611d=_0x50611d-0x0;var _0x37ea81=_0xb792[_0x50611d];return _0x37ea81;};'use strict';var rp=require('request-promise');var util=require(_0x2b79('0x0'));var _=require(_0x2b79('0x1'));var Mustache=require('mustache');var logger=require(_0x2b79('0x2'))(_0x2b79('0x3'));exports['exec']=function(_0x1c453a,_0x58eb11){var _0x52a986,_0x2ca9d;var _0x407d5c={'method':_0x1c453a[_0x2b79('0x4')][_0x2b79('0x5')](),'uri':Mustache[_0x2b79('0x6')](_0x1c453a[_0x2b79('0x7')],_0x58eb11),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1c453a[_0x2b79('0x8')])===_0x2b79('0x9')&&parseInt(_0x1c453a[_0x2b79('0x8')])>=0x1&&parseInt(_0x1c453a[_0x2b79('0x8')])<=0xa?parseInt(_0x1c453a[_0x2b79('0x8')])*0x3e8:0x5*0x3e8};try{_0x407d5c[_0x2b79('0xa')]=_0x1c453a['data6']?JSON['parse'](Mustache[_0x2b79('0x6')](_0x1c453a['data6'],_0x58eb11)):{};}catch(_0x1c0e0b){logger[_0x2b79('0xb')](_0x1c0e0b['stack']);}switch(_0x1c453a[_0x2b79('0x4')][_0x2b79('0x5')]()){case _0x2b79('0xc'):case _0x2b79('0xd'):_0x52a986=null;_0x407d5c['qs']=_0x58eb11;break;case'POST':case _0x2b79('0xe'):if(_0x1c453a[_0x2b79('0xf')]){try{_0x52a986=JSON[_0x2b79('0x10')](Mustache[_0x2b79('0x6')](_0x1c453a[_0x2b79('0xf')],_0x58eb11));_0x407d5c[_0x2b79('0x11')]=_0x52a986;}catch(_0x1d5572){logger[_0x2b79('0xb')](_0x1d5572[_0x2b79('0x12')]);logger[_0x2b79('0xb')](_0x2b79('0x13'));}}else{_0x52a986=_0x58eb11;_0x407d5c[_0x2b79('0x11')]=_0x52a986;}break;}logger['info'](util[_0x2b79('0x14')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x1c453a[_0x2b79('0x4')],_0x1c453a[_0x2b79('0x7')],JSON['stringify'](_0x407d5c)));rp(_0x407d5c)[_0x2b79('0x15')](function(_0x5ac432){_0x52a986=!_[_0x2b79('0x16')](_0x52a986)?_0x2b79('0x17')+_0x52a986:'';_0x2ca9d=typeof _0x5ac432['body']===_0x2b79('0x18')?JSON['stringify'](_0x5ac432[_0x2b79('0x11')]):_0x5ac432[_0x2b79('0x11')];logger['info'](util[_0x2b79('0x14')](_0x2b79('0x19'),_0x1c453a[_0x2b79('0x4')],_0x1c453a[_0x2b79('0x7')],_0x5ac432[_0x2b79('0x1a')],_0x2ca9d));})['catch'](function(_0x3f3ea4){logger['error'](util[_0x2b79('0x14')](_0x2b79('0x1b'),_0x1c453a[_0x2b79('0x4')],_0x1c453a['data2'],_0x3f3ea4[_0x2b79('0x1a')],_0x3f3ea4[_0x2b79('0x1c')],_0x3f3ea4[_0x2b79('0x1d')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 02e844d..4296ced 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 _0xc5c9=['rpc','error','message','result','catch','exports','jayson/promise','bluebird','routing','http','Request','request','then','debug'];(function(_0x330e73,_0x4c848a){var _0x1a2854=function(_0x151e14){while(--_0x151e14){_0x330e73['push'](_0x330e73['shift']());}};_0x1a2854(++_0x4c848a);}(_0xc5c9,0x164));var _0x9c5c=function(_0x399dfd,_0x400a71){_0x399dfd=_0x399dfd-0x0;var _0x9afbdd=_0xc5c9[_0x399dfd];return _0x9afbdd;};'use strict';var jayson=require(_0x9c5c('0x0'));var BPromise=require(_0x9c5c('0x1'));var logger=require('../../config/logger')(_0x9c5c('0x2'));var client=jayson['client'][_0x9c5c('0x3')]({'port':0x2329});client[_0x9c5c('0x4')]=function(_0x316884,_0x12965b){return new BPromise(function(_0x38b701,_0x312f8b){return client[_0x9c5c('0x5')](_0x316884,_0x12965b)[_0x9c5c('0x6')](function(_0x357e42){logger[_0x9c5c('0x7')](_0x9c5c('0x8'),'routing',_0x316884,_0x12965b,_0x357e42);if(_0x357e42['error']){logger[_0x9c5c('0x9')](_0x9c5c('0x8'),_0x9c5c('0x2'),_0x316884,_0x357e42[_0x9c5c('0x9')]['message'],_0x12965b);return _0x312f8b(_0x357e42[_0x9c5c('0x9')][_0x9c5c('0xa')]);}else{return _0x38b701(_0x357e42[_0x9c5c('0xb')]);}})[_0x9c5c('0xc')](function(_0x3acfa1){logger[_0x9c5c('0x9')](_0x9c5c('0x8'),_0x9c5c('0x2'),_0x316884,_0x3acfa1,_0x12965b);return _0x312f8b(_0x3acfa1);});});};module[_0x9c5c('0xd')]=client; \ No newline at end of file +var _0x597c=['error','message','result','catch','jayson/promise','bluebird','routing','client','http','then','debug','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x597c,0x148));var _0xc597=function(_0x5d92a4,_0x518596){_0x5d92a4=_0x5d92a4-0x0;var _0x560cbb=_0x597c[_0x5d92a4];return _0x560cbb;};'use strict';var jayson=require(_0xc597('0x0'));var BPromise=require(_0xc597('0x1'));var logger=require('../../config/logger')(_0xc597('0x2'));var client=jayson[_0xc597('0x3')][_0xc597('0x4')]({'port':0x2329});client['Request']=function(_0x38b82a,_0x506602){return new BPromise(function(_0x1a931b,_0x153849){return client['request'](_0x38b82a,_0x506602)[_0xc597('0x5')](function(_0x2a4c84){logger[_0xc597('0x6')](_0xc597('0x7'),_0xc597('0x2'),_0x38b82a,_0x506602,_0x2a4c84);if(_0x2a4c84['error']){logger[_0xc597('0x8')](_0xc597('0x7'),_0xc597('0x2'),_0x38b82a,_0x2a4c84[_0xc597('0x8')][_0xc597('0x9')],_0x506602);return _0x153849(_0x2a4c84[_0xc597('0x8')][_0xc597('0x9')]);}else{return _0x1a931b(_0x2a4c84[_0xc597('0xa')]);}})[_0xc597('0xb')](function(_0x32ceef){logger[_0xc597('0x8')](_0xc597('0x7'),'routing',_0x38b82a,_0x32ceef,_0x506602);return _0x153849(_0x32ceef);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 8746ba1..12b9483 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 _0x262a=['../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','catch','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting'];(function(_0x35d3a8,_0x44406a){var _0x182378=function(_0x298e0b){while(--_0x298e0b){_0x35d3a8['push'](_0x35d3a8['shift']());}};_0x182378(++_0x44406a);}(_0x262a,0x16b));var _0xa262=function(_0x3f477c,_0x52b7ff){_0x3f477c=_0x3f477c-0x0;var _0x4c36b3=_0x262a[_0x3f477c];return _0x4c36b3;};'use strict';var server=require(_0xa262('0x0'));var Realtime=require(_0xa262('0x1'));var EmailChannel=require(_0xa262('0x2'));var mailAccount=require(_0xa262('0x3'));var setting=require(_0xa262('0x4'));var logger=require(_0xa262('0x5'))(_0xa262('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xa262('0x7')]()[_0xa262('0x8')](mailAccount[_0xa262('0x9')]())[_0xa262('0x8')](realtime[_0xa262('0xa')]())[_0xa262('0x8')](function(){email['refresh'](realtime[_0xa262('0xb')]);return realtime;});}function main(){return server[_0xa262('0xc')](realtime,email)[_0xa262('0x8')](function(){return initRealtime();})[_0xa262('0x8')](function(){return setting[_0xa262('0xd')]();})['then'](function(_0x5693c7){return setInterval(initRealtime,_0x5693c7[_0xa262('0xe')]*0x3e8);})[_0xa262('0xf')](function(_0x3b521d){logger['error']('Email\x20service\x20initialization',_0x3b521d);});}main(); \ No newline at end of file +var _0x44dc=['./rpc/setting','../../config/logger','email','then','initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','catch','Email\x20service\x20initialization','./server','./realtime'];(function(_0x44ac87,_0x5df547){var _0x39c440=function(_0x2bd3e9){while(--_0x2bd3e9){_0x44ac87['push'](_0x44ac87['shift']());}};_0x39c440(++_0x5df547);}(_0x44dc,0x102));var _0xc44d=function(_0x4acc43,_0x5125a0){_0x4acc43=_0x4acc43-0x0;var _0x12ba15=_0x44dc[_0x4acc43];return _0x12ba15;};'use strict';var server=require(_0xc44d('0x0'));var Realtime=require(_0xc44d('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var setting=require(_0xc44d('0x2'));var logger=require(_0xc44d('0x3'))(_0xc44d('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()['then'](mailAccount['getMailAccounts']())[_0xc44d('0x5')](realtime[_0xc44d('0x6')]())[_0xc44d('0x5')](function(){email['refresh'](realtime[_0xc44d('0x7')]);return realtime;});}function main(){return server[_0xc44d('0x8')](realtime,email)[_0xc44d('0x5')](function(){return initRealtime();})['then'](function(){return setting[_0xc44d('0x9')]();})[_0xc44d('0x5')](function(_0x25ba32){return setInterval(initRealtime,_0x25ba32[_0xc44d('0xa')]*0x3e8);})[_0xc44d('0xb')](function(_0x4aebc2){logger['error'](_0xc44d('0xc'),_0x4aebc2);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index a39580f..f77b0b5 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 _0x602e=['../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','Imap','messageStatus','isNil','stringify','md5','mailAccount:update','refresh','hasOwnProperty','active','service','provider','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','handleImapError','status','connected','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','verifySmtp','Smtp','lastSync','verified','verify','lodash','moment','ioredis','../../../config/environment'];(function(_0x270d0d,_0x3fe5af){var _0x1e000b=function(_0x1e241a){while(--_0x1e241a){_0x270d0d['push'](_0x270d0d['shift']());}};_0x1e000b(++_0x3fe5af);}(_0x602e,0x6a));var _0xe602=function(_0x1d1d09,_0x504d77){_0x1d1d09=_0x1d1d09-0x0;var _0x8827e=_0x602e[_0x1d1d09];return _0x8827e;};'use strict';var _=require(_0xe602('0x0'));var moment=require(_0xe602('0x1'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require(_0xe602('0x2'));var config=require(_0xe602('0x3'));var logger=require(_0xe602('0x4'))(_0xe602('0x5'));config[_0xe602('0x6')]=_['defaults'](config['redis'],{'host':_0xe602('0x7'),'port':0x18eb});var io=require(_0xe602('0x8'))(new Redis(config[_0xe602('0x6')]));var EmailImap=require(_0xe602('0x9'));var EmailSmtp=require(_0xe602('0xa'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x1a5544){logger[_0xe602('0xb')](_0xe602('0xc'));this[_0xe602('0xd')]=_0x1a5544[_0xe602('0xd')];this[_0xe602('0xe')]={};this[_0xe602('0xf')]=new EmailSmtp();}EmailChannel[_0xe602('0x10')][_0xe602('0x11')]=function(_0x179a43){var _0xe4dfbb=this['mailAccounts'][_0x179a43];var _0x5b705f={'id':_0xe4dfbb['id'],'name':_0xe4dfbb[_0xe602('0x12')],'key':_0xe4dfbb['key'],'active':_0xe4dfbb['active'],'Imap':{'status':_0xe4dfbb[_0xe602('0x13')]['status'],'messageStatus':_0xe4dfbb[_0xe602('0x13')][_0xe602('0x14')],'total':_0xe4dfbb[_0xe602('0x13')]['total']}};if(_[_0xe602('0x15')](md5Accounts[_0x179a43])){md5Accounts[_0x179a43]={};}var _0xfbd5d6=md5(JSON[_0xe602('0x16')](_0x5b705f));if(md5Accounts[_0x179a43][_0xe602('0x17')]!==_0xfbd5d6){md5Accounts[_0x179a43][_0xe602('0x17')]=_0xfbd5d6;io[_0xe602('0x11')](_0xe602('0x18'),_0x5b705f);}};EmailChannel['prototype'][_0xe602('0x19')]=function(_0x1c83ee){for(var _0x210592 in _0x1c83ee){if(_0x1c83ee[_0xe602('0x1a')](_0x210592)){if(_0x1c83ee[_0x210592]['Imap']&&_0x1c83ee[_0x210592][_0xe602('0x1b')]){var _0x59f31f=_0x1c83ee[_0x210592][_0xe602('0x13')];if(!_0x59f31f[_0xe602('0x1c')]&&_0x1c83ee[_0x210592][_0xe602('0x1d')]!=='custom')_0x59f31f[_0xe602('0x1c')]=_0x1c83ee[_0x210592]['provider'];if(!this[_0xe602('0xe')][_0xe602('0x1a')](_0x59f31f['id'])){this[_0xe602('0xe')][_0x59f31f['id']]=new EmailImap(_0x59f31f,_0x1c83ee[_0x210592][_0xe602('0x5')]);this['imapAccounts'][_0x59f31f['id']]['on'](_0xe602('0x1e'),this[_0xe602('0x1f')][_0xe602('0x20')](this,_0x210592));this[_0xe602('0xe')][_0x59f31f['id']]['on'](_0xe602('0x5'),this[_0xe602('0x21')][_0xe602('0x20')](this,_0x210592));this[_0xe602('0xe')][_0x59f31f['id']]['on'](_0xe602('0x22'),this[_0xe602('0x23')]['bind'](this,_0x210592));this['imapAccounts'][_0x59f31f['id']]['on']('error',this[_0xe602('0x24')]['bind'](this,_0x210592));}}else{if(_['isNil'](this['mailAccounts'][_0x210592][_0xe602('0x13')])){this[_0xe602('0xd')][_0x210592][_0xe602('0x13')]={};}this[_0xe602('0xd')][_0x210592]['Imap']['status']='disabled';this[_0xe602('0xd')][_0x210592][_0xe602('0x13')][_0xe602('0x14')]='';this[_0xe602('0x11')](_0x210592);}}}};EmailChannel[_0xe602('0x10')][_0xe602('0x1f')]=function(_0x4e9722,_0x171eff){if(this[_0xe602('0xd')][_0x4e9722]){this[_0xe602('0xd')][_0x4e9722][_0xe602('0x13')][_0xe602('0x25')]=_0xe602('0x26');this[_0xe602('0xd')][_0x4e9722][_0xe602('0x13')][_0xe602('0x14')]=_0x171eff[_0xe602('0x12')];if(_0x171eff['messages']){this['mailAccounts'][_0x4e9722][_0xe602('0x13')][_0xe602('0x27')]=_0x171eff['messages'][_0xe602('0x27')];}return this[_0xe602('0x11')](_0x4e9722);}};EmailChannel[_0xe602('0x10')]['handleImapEmail']=function(_0x47690d,_0x3c8625){logger[_0xe602('0xb')](_0xe602('0x28'),_0x3c8625[_0xe602('0x29')],_0x3c8625[_0xe602('0x2a')],_0x3c8625[_0xe602('0x2b')],_0x47690d);if(this[_0xe602('0xd')][_0x47690d]){return mailAccount[_0xe602('0x2c')](_0x47690d,_0x3c8625)[_0xe602('0x2d')](function(_0x19ff76){if(_0x19ff76){logger[_0xe602('0xb')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0x2bd327){logger[_0xe602('0x2e')](_0xe602('0x2f'),JSON[_0xe602('0x16')](_0x2bd327));});}};EmailChannel['prototype'][_0xe602('0x23')]=function(_0x151684){if(this[_0xe602('0xd')][_0x151684]&&this[_0xe602('0xd')][_0x151684]['Imap']){if(this[_0xe602('0xe')][this[_0xe602('0xd')][_0x151684][_0xe602('0x13')]['id']]){delete this['imapAccounts'][this[_0xe602('0xd')][_0x151684][_0xe602('0x13')]['id']];}this['mailAccounts'][_0x151684][_0xe602('0x13')]['lastSync']=moment();this['emit'](_0x151684);}};EmailChannel[_0xe602('0x10')][_0xe602('0x24')]=function(_0x3694cb,_0xeb3ac5){if(this[_0xe602('0xd')][_0x3694cb]){this['mailAccounts'][_0x3694cb][_0xe602('0x13')][_0xe602('0x25')]=_0xe602('0x2e');this[_0xe602('0xd')][_0x3694cb][_0xe602('0x13')]['messageStatus']=_0xeb3ac5;return this['emit'](_0x3694cb);}};EmailChannel[_0xe602('0x10')][_0xe602('0x30')]=function(_0x5cafcb,_0x248132){return this[_0xe602('0xf')][_0xe602('0x31')](_0x5cafcb,_0x248132);};EmailChannel[_0xe602('0x10')][_0xe602('0x32')]=function(_0x590267){var _0x285379=this;if(this[_0xe602('0xd')][_0x590267['id']]){if(_[_0xe602('0x15')](this[_0xe602('0xd')][_0x590267['id']][_0xe602('0x33')])){this[_0xe602('0xd')][_0x590267['id']][_0xe602('0x33')]={};}this[_0xe602('0xd')][_0x590267['id']][_0xe602('0x33')][_0xe602('0x34')]=moment();return new BPromise(function(_0x2bee93,_0x11029b){return _0x285379['smtp']['verify'](_0x590267)[_0xe602('0x2d')](function(_0xdb17c3){_0x285379[_0xe602('0xd')][_0x590267['id']][_0xe602('0x33')]['status']=_0xe602('0x35');_0x285379[_0xe602('0xd')][_0x590267['id']]['Smtp'][_0xe602('0x14')]='';_0x285379[_0xe602('0x11')](_0x590267['id']);_0x2bee93(_0xdb17c3);})['catch'](function(_0x3943bd){_0x285379[_0xe602('0xd')][_0x590267['id']][_0xe602('0x33')][_0xe602('0x25')]=_0xe602('0x2e');_0x285379[_0xe602('0xd')][_0x590267['id']][_0xe602('0x33')]['messageStatus']=_0x3943bd;_0x285379[_0xe602('0x11')](_0x590267['id']);_0x11029b(_0x3943bd);});});}return this['smtp'][_0xe602('0x36')](_0x590267);};module['exports']=EmailChannel; \ No newline at end of file +var _0x7ffc=['start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','key','active','Imap','status','messageStatus','total','stringify','md5','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','email','box','bind','handleImapEnd','error','handleImapError','isNil','disabled','connected','name','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','verifySmtp','Smtp','lastSync','verify','verified','lodash','moment','bluebird','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info'];(function(_0x464228,_0x1baafa){var _0x3df906=function(_0x1bf99a){while(--_0x1bf99a){_0x464228['push'](_0x464228['shift']());}};_0x3df906(++_0x1baafa);}(_0x7ffc,0x1cb));var _0xc7ff=function(_0x63a69b,_0x296888){_0x63a69b=_0x63a69b-0x0;var _0x425fa1=_0x7ffc[_0x63a69b];return _0x425fa1;};'use strict';var _=require(_0xc7ff('0x0'));var moment=require(_0xc7ff('0x1'));var BPromise=require(_0xc7ff('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0xc7ff('0x3'));var logger=require(_0xc7ff('0x4'))('email');config[_0xc7ff('0x5')]=_[_0xc7ff('0x6')](config[_0xc7ff('0x5')],{'host':_0xc7ff('0x7'),'port':0x18eb});var io=require(_0xc7ff('0x8'))(new Redis(config[_0xc7ff('0x5')]));var EmailImap=require(_0xc7ff('0x9'));var EmailSmtp=require(_0xc7ff('0xa'));var mailAccount=require(_0xc7ff('0xb'));var md5Accounts={};function EmailChannel(_0x30206c){logger[_0xc7ff('0xc')](_0xc7ff('0xd'));this[_0xc7ff('0xe')]=_0x30206c[_0xc7ff('0xe')];this[_0xc7ff('0xf')]={};this[_0xc7ff('0x10')]=new EmailSmtp();}EmailChannel[_0xc7ff('0x11')][_0xc7ff('0x12')]=function(_0x1c22b5){var _0x45f0f5=this[_0xc7ff('0xe')][_0x1c22b5];var _0x47cc17={'id':_0x45f0f5['id'],'name':_0x45f0f5['name'],'key':_0x45f0f5[_0xc7ff('0x13')],'active':_0x45f0f5[_0xc7ff('0x14')],'Imap':{'status':_0x45f0f5[_0xc7ff('0x15')][_0xc7ff('0x16')],'messageStatus':_0x45f0f5[_0xc7ff('0x15')][_0xc7ff('0x17')],'total':_0x45f0f5['Imap'][_0xc7ff('0x18')]}};if(_['isNil'](md5Accounts[_0x1c22b5])){md5Accounts[_0x1c22b5]={};}var _0x22a43b=md5(JSON[_0xc7ff('0x19')](_0x47cc17));if(md5Accounts[_0x1c22b5][_0xc7ff('0x1a')]!==_0x22a43b){md5Accounts[_0x1c22b5][_0xc7ff('0x1a')]=_0x22a43b;io['emit'](_0xc7ff('0x1b'),_0x47cc17);}};EmailChannel['prototype'][_0xc7ff('0x1c')]=function(_0x6ef77e){for(var _0x3bfd99 in _0x6ef77e){if(_0x6ef77e[_0xc7ff('0x1d')](_0x3bfd99)){if(_0x6ef77e[_0x3bfd99][_0xc7ff('0x15')]&&_0x6ef77e[_0x3bfd99][_0xc7ff('0x14')]){var _0x3ab83d=_0x6ef77e[_0x3bfd99][_0xc7ff('0x15')];if(!_0x3ab83d[_0xc7ff('0x1e')]&&_0x6ef77e[_0x3bfd99][_0xc7ff('0x1f')]!==_0xc7ff('0x20'))_0x3ab83d['service']=_0x6ef77e[_0x3bfd99][_0xc7ff('0x1f')];if(!this[_0xc7ff('0xf')][_0xc7ff('0x1d')](_0x3ab83d['id'])){this[_0xc7ff('0xf')][_0x3ab83d['id']]=new EmailImap(_0x3ab83d,_0x6ef77e[_0x3bfd99][_0xc7ff('0x21')]);this[_0xc7ff('0xf')][_0x3ab83d['id']]['on'](_0xc7ff('0x22'),this['handleImapBox'][_0xc7ff('0x23')](this,_0x3bfd99));this[_0xc7ff('0xf')][_0x3ab83d['id']]['on'](_0xc7ff('0x21'),this['handleImapEmail'][_0xc7ff('0x23')](this,_0x3bfd99));this[_0xc7ff('0xf')][_0x3ab83d['id']]['on']('end',this[_0xc7ff('0x24')][_0xc7ff('0x23')](this,_0x3bfd99));this[_0xc7ff('0xf')][_0x3ab83d['id']]['on'](_0xc7ff('0x25'),this[_0xc7ff('0x26')][_0xc7ff('0x23')](this,_0x3bfd99));}}else{if(_[_0xc7ff('0x27')](this['mailAccounts'][_0x3bfd99][_0xc7ff('0x15')])){this[_0xc7ff('0xe')][_0x3bfd99][_0xc7ff('0x15')]={};}this[_0xc7ff('0xe')][_0x3bfd99][_0xc7ff('0x15')][_0xc7ff('0x16')]=_0xc7ff('0x28');this['mailAccounts'][_0x3bfd99]['Imap'][_0xc7ff('0x17')]='';this[_0xc7ff('0x12')](_0x3bfd99);}}}};EmailChannel['prototype']['handleImapBox']=function(_0x4eba58,_0x46991f){if(this['mailAccounts'][_0x4eba58]){this[_0xc7ff('0xe')][_0x4eba58][_0xc7ff('0x15')][_0xc7ff('0x16')]=_0xc7ff('0x29');this['mailAccounts'][_0x4eba58][_0xc7ff('0x15')][_0xc7ff('0x17')]=_0x46991f[_0xc7ff('0x2a')];if(_0x46991f[_0xc7ff('0x2b')]){this[_0xc7ff('0xe')][_0x4eba58][_0xc7ff('0x15')]['total']=_0x46991f[_0xc7ff('0x2b')][_0xc7ff('0x18')];}return this['emit'](_0x4eba58);}};EmailChannel['prototype'][_0xc7ff('0x2c')]=function(_0x32c8a6,_0xc692){logger[_0xc7ff('0xc')](_0xc7ff('0x2d'),_0xc692[_0xc7ff('0x2e')],_0xc692['lastName'],_0xc692[_0xc7ff('0x2f')],_0x32c8a6);if(this[_0xc7ff('0xe')][_0x32c8a6]){return mailAccount['notify'](_0x32c8a6,_0xc692)[_0xc7ff('0x30')](function(_0x4b5299){if(_0x4b5299){logger[_0xc7ff('0xc')](_0xc7ff('0x31'));}})[_0xc7ff('0x32')](function(_0xe94484){logger['error'](_0xc7ff('0x33'),JSON[_0xc7ff('0x19')](_0xe94484));});}};EmailChannel[_0xc7ff('0x11')][_0xc7ff('0x24')]=function(_0x500382){if(this[_0xc7ff('0xe')][_0x500382]&&this[_0xc7ff('0xe')][_0x500382][_0xc7ff('0x15')]){if(this[_0xc7ff('0xf')][this['mailAccounts'][_0x500382][_0xc7ff('0x15')]['id']]){delete this[_0xc7ff('0xf')][this[_0xc7ff('0xe')][_0x500382][_0xc7ff('0x15')]['id']];}this[_0xc7ff('0xe')][_0x500382][_0xc7ff('0x15')]['lastSync']=moment();this[_0xc7ff('0x12')](_0x500382);}};EmailChannel['prototype']['handleImapError']=function(_0x4d7941,_0x13a5d9){if(this[_0xc7ff('0xe')][_0x4d7941]){this[_0xc7ff('0xe')][_0x4d7941][_0xc7ff('0x15')][_0xc7ff('0x16')]=_0xc7ff('0x25');this[_0xc7ff('0xe')][_0x4d7941][_0xc7ff('0x15')][_0xc7ff('0x17')]=_0x13a5d9;return this[_0xc7ff('0x12')](_0x4d7941);}};EmailChannel[_0xc7ff('0x11')][_0xc7ff('0x34')]=function(_0x59647e,_0x1596da){return this[_0xc7ff('0x10')][_0xc7ff('0x35')](_0x59647e,_0x1596da);};EmailChannel[_0xc7ff('0x11')][_0xc7ff('0x36')]=function(_0x24c047){var _0x1e1c7c=this;if(this[_0xc7ff('0xe')][_0x24c047['id']]){if(_[_0xc7ff('0x27')](this[_0xc7ff('0xe')][_0x24c047['id']][_0xc7ff('0x37')])){this[_0xc7ff('0xe')][_0x24c047['id']][_0xc7ff('0x37')]={};}this[_0xc7ff('0xe')][_0x24c047['id']][_0xc7ff('0x37')][_0xc7ff('0x38')]=moment();return new BPromise(function(_0x1532c0,_0x4b51f8){return _0x1e1c7c[_0xc7ff('0x10')][_0xc7ff('0x39')](_0x24c047)[_0xc7ff('0x30')](function(_0x405f44){_0x1e1c7c[_0xc7ff('0xe')][_0x24c047['id']][_0xc7ff('0x37')][_0xc7ff('0x16')]=_0xc7ff('0x3a');_0x1e1c7c[_0xc7ff('0xe')][_0x24c047['id']][_0xc7ff('0x37')][_0xc7ff('0x17')]='';_0x1e1c7c[_0xc7ff('0x12')](_0x24c047['id']);_0x1532c0(_0x405f44);})[_0xc7ff('0x32')](function(_0x3c64a6){_0x1e1c7c['mailAccounts'][_0x24c047['id']][_0xc7ff('0x37')][_0xc7ff('0x16')]=_0xc7ff('0x25');_0x1e1c7c[_0xc7ff('0xe')][_0x24c047['id']][_0xc7ff('0x37')][_0xc7ff('0x17')]=_0x3c64a6;_0x1e1c7c[_0xc7ff('0x12')](_0x24c047['id']);_0x4b51f8(_0x3c64a6);});});}return this[_0xc7ff('0x10')][_0xc7ff('0x39')](_0x24c047);};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 0da1e92..1e8eecb 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 _0xe125=['user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','email','anonymous@xcally.com','host','port','tls','autotls','required','openBox','handleOpenBox','emit','handleCloseBox','readUnseen','search','UNSEEN','length','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','lodash','imap','mailparser','iconv','Iconv','events','EventEmitter','./utils','mailbox','account','getAccount','handleReady','bind','once','end','handleEnd','error','handleError','inherits','prototype','connTimeout','authTimeout','service'];(function(_0x373096,_0x4d37aa){var _0x14a6d0=function(_0xb3b614){while(--_0xb3b614){_0x373096['push'](_0x373096['shift']());}};_0x14a6d0(++_0x4d37aa);}(_0xe125,0x1d9));var _0x5e12=function(_0x53eb8e,_0x15bd61){_0x53eb8e=_0x53eb8e-0x0;var _0x3bced1=_0xe125[_0x53eb8e];return _0x3bced1;};'use strict';var _=require(_0x5e12('0x0'));var util=require('util');var Imap=require(_0x5e12('0x1'));var simpleParser=require(_0x5e12('0x2'))['simpleParser'];var Iconv=require(_0x5e12('0x3'))[_0x5e12('0x4')];var EventEmitter=require(_0x5e12('0x5'))[_0x5e12('0x6')];var utils=require(_0x5e12('0x7'));var logger=require('../../../config/logger')('email');function EmailImap(_0x485b6c,_0x25eeab){this[_0x5e12('0x8')]=_0x485b6c[_0x5e12('0x8')];this[_0x5e12('0x9')]=this[_0x5e12('0xa')](_0x485b6c,_0x25eeab);this['imap']=new Imap(this['account']);this[_0x5e12('0x1')]['once']('ready',this[_0x5e12('0xb')][_0x5e12('0xc')](this));this[_0x5e12('0x1')][_0x5e12('0xd')](_0x5e12('0xe'),this[_0x5e12('0xf')][_0x5e12('0xc')](this));this[_0x5e12('0x1')]['on'](_0x5e12('0x10'),this[_0x5e12('0x11')][_0x5e12('0xc')](this));this['imap']['connect']();}util[_0x5e12('0x12')](EmailImap,EventEmitter);EmailImap[_0x5e12('0x13')][_0x5e12('0xa')]=function(_0xcbe5f7,_0x8bfdb){var _0xff6977={'connTimeout':_0xcbe5f7[_0x5e12('0x14')]?_0xcbe5f7['connTimeout']*0x3e8:0x2710,'authTimeout':_0xcbe5f7[_0x5e12('0x15')]?_0xcbe5f7[_0x5e12('0x15')]*0x3e8:0x1388};if(_0xcbe5f7[_0x5e12('0x16')]){_0xff6977[_0x5e12('0x17')]=_0xcbe5f7[_0x5e12('0x17')];if(_0xcbe5f7[_0x5e12('0x18')]){_0xff6977[_0x5e12('0x19')]=utils[_0x5e12('0x1a')](_0xcbe5f7[_0x5e12('0x1b')][_0x5e12('0x1c')],_0xcbe5f7['user']);}else{_0xff6977[_0x5e12('0x1d')]=_0xcbe5f7[_0x5e12('0x1d')];}}else{if(_0xcbe5f7[_0x5e12('0x1e')]){_0xff6977[_0x5e12('0x17')]=_0xcbe5f7[_0x5e12('0x17')];_0xff6977[_0x5e12('0x1d')]=_0xcbe5f7[_0x5e12('0x1d')];}}_0xff6977[_0x5e12('0x1f')]=_0x8bfdb||_0xcbe5f7['user']||_0x5e12('0x20');_0xff6977['host']=_0xcbe5f7[_0x5e12('0x21')];_0xff6977[_0x5e12('0x22')]=_0xcbe5f7[_0x5e12('0x22')]||0x3e1;if(_0xcbe5f7[_0x5e12('0x23')]){_0xff6977[_0x5e12('0x23')]=!![];}else{_0xff6977[_0x5e12('0x23')]=![];_0xff6977[_0x5e12('0x24')]=_0x5e12('0x25');}return _0xff6977;};EmailImap['prototype']['handleReady']=function(){this[_0x5e12('0x1')][_0x5e12('0x26')](this[_0x5e12('0x8')],![],this[_0x5e12('0x27')][_0x5e12('0xc')](this));};EmailImap['prototype'][_0x5e12('0x27')]=function(_0x14e662,_0x440faa){if(_0x14e662){this[_0x5e12('0x11')](_0x14e662,!![]);}else{this[_0x5e12('0x28')]('box',_0x440faa);this['readUnseen']();}};EmailImap['prototype'][_0x5e12('0x29')]=function(_0x136547){if(_0x136547){this[_0x5e12('0x11')](_0x136547,!![]);}else{this['imap'][_0x5e12('0xe')]();}};EmailImap['prototype'][_0x5e12('0x2a')]=function(){this[_0x5e12('0x1')][_0x5e12('0x2b')]([_0x5e12('0x2c')],this['handleReadUnseen'][_0x5e12('0xc')](this));};EmailImap[_0x5e12('0x13')]['handleReadUnseen']=function(_0x19ec97,_0x1b46a2){if(_0x19ec97){this[_0x5e12('0x11')](_0x19ec97,!![]);}else{if(_0x1b46a2[_0x5e12('0x2d')]){try{var _0x59fd88=this['imap'][_0x5e12('0x2e')](_0x1b46a2,{'bodies':'','markSeen':!![]});_0x59fd88['on'](_0x5e12('0x2f'),this[_0x5e12('0x30')]['bind'](this));_0x59fd88['once']('error',this['handleFetchError'][_0x5e12('0xc')](this));_0x59fd88[_0x5e12('0xd')](_0x5e12('0xe'),this[_0x5e12('0x31')]['bind'](this));}catch(_0x42600c){logger[_0x5e12('0x10')](_0x42600c);}}else{this['imap'][_0x5e12('0x32')](!![],this[_0x5e12('0x29')][_0x5e12('0xc')](this));}}};EmailImap[_0x5e12('0x13')][_0x5e12('0x30')]=function(_0x57270c){_0x57270c['on']('body',this[_0x5e12('0x33')][_0x5e12('0xc')](this));_0x57270c[_0x5e12('0xd')](_0x5e12('0x34'),this[_0x5e12('0x35')][_0x5e12('0xc')](this));_0x57270c[_0x5e12('0xd')](_0x5e12('0xe'),this[_0x5e12('0x36')]['bind'](this));};EmailImap[_0x5e12('0x13')][_0x5e12('0x33')]=function(_0x5063db){simpleParser(_0x5063db,{'Iconv':Iconv},this[_0x5e12('0x37')][_0x5e12('0xc')](this));};EmailImap[_0x5e12('0x13')]['handleMessageAttributes']=function(){};EmailImap['prototype']['handleMessageEnd']=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x1cffba,_0x10f588){if(_0x1cffba){logger['error'](_0x1cffba);}else{var _0x1cb573=this;utils[_0x5e12('0x38')](this['account'],_0x10f588,function(_0xeb913){_0x1cb573[_0x5e12('0x28')]('email',_0xeb913);});}};EmailImap['prototype'][_0x5e12('0x31')]=function(){this[_0x5e12('0x1')]['closeBox'](!![],this[_0x5e12('0x29')][_0x5e12('0xc')](this));};EmailImap[_0x5e12('0x13')][_0x5e12('0x39')]=function(_0x3eff0a){this['handleError'](_0x3eff0a);this[_0x5e12('0x1')][_0x5e12('0x32')](!![],this['handleCloseBox'][_0x5e12('0xc')](this));};EmailImap[_0x5e12('0x13')]['handleEnd']=function(){this[_0x5e12('0x28')](_0x5e12('0xe'));};EmailImap[_0x5e12('0x13')]['handleError']=function(_0x4a1aa1,_0x485d04){logger[_0x5e12('0x10')](_0x5e12('0x11'),this['account'][_0x5e12('0x1f')],JSON[_0x5e12('0x3a')](_0x4a1aa1));var _0x5d856a='';if(_0x4a1aa1){if(_0x4a1aa1[_0x5e12('0x3b')]){_0x5d856a=_0x4a1aa1['textCode'];}else{for(var _0x2fba5f in _0x4a1aa1){if(_0x4a1aa1[_0x5e12('0x3c')](_0x2fba5f)){_0x5d856a+=_[_0x5e12('0x3d')](_0x2fba5f)+':\x20'+_0x4a1aa1[_0x2fba5f]+'\x0a';}}}}if(_0x485d04){this['imap'][_0x5e12('0xe')]();}else{this[_0x5e12('0x28')](_0x5e12('0x10'),_0x5d856a);this[_0x5e12('0x28')](_0x5e12('0xe'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x0da8=['handleMessageEnd','handleSimpleParser','parser','handleEnd','stringify','textCode','hasOwnProperty','exports','lodash','mailparser','simpleParser','Iconv','events','./utils','../../../config/logger','email','mailbox','getAccount','account','imap','once','ready','handleReady','bind','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','generateXOAuth2Token','data5','authentication','password','anonymous@xcally.com','host','port','tls','autotls','required','emit','readUnseen','handleCloseBox','end','search','UNSEEN','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes'];(function(_0x29b9b1,_0x11549a){var _0xc55f20=function(_0x16f9f0){while(--_0x16f9f0){_0x29b9b1['push'](_0x29b9b1['shift']());}};_0xc55f20(++_0x11549a);}(_0x0da8,0x1b3));var _0x80da=function(_0x53d729,_0x1a2198){_0x53d729=_0x53d729-0x0;var _0x568f90=_0x0da8[_0x53d729];return _0x568f90;};'use strict';var _=require(_0x80da('0x0'));var util=require('util');var Imap=require('imap');var simpleParser=require(_0x80da('0x1'))[_0x80da('0x2')];var Iconv=require('iconv')[_0x80da('0x3')];var EventEmitter=require(_0x80da('0x4'))['EventEmitter'];var utils=require(_0x80da('0x5'));var logger=require(_0x80da('0x6'))(_0x80da('0x7'));function EmailImap(_0x538138,_0x1d21fa){this[_0x80da('0x8')]=_0x538138['mailbox'];this['account']=this[_0x80da('0x9')](_0x538138,_0x1d21fa);this['imap']=new Imap(this[_0x80da('0xa')]);this[_0x80da('0xb')][_0x80da('0xc')](_0x80da('0xd'),this[_0x80da('0xe')][_0x80da('0xf')](this));this['imap'][_0x80da('0xc')]('end',this['handleEnd']['bind'](this));this[_0x80da('0xb')]['on'](_0x80da('0x10'),this[_0x80da('0x11')][_0x80da('0xf')](this));this[_0x80da('0xb')][_0x80da('0x12')]();}util[_0x80da('0x13')](EmailImap,EventEmitter);EmailImap[_0x80da('0x14')][_0x80da('0x9')]=function(_0x2fbc59,_0x15585d){var _0x2d612f={'connTimeout':_0x2fbc59['connTimeout']?_0x2fbc59[_0x80da('0x15')]*0x3e8:0x2710,'authTimeout':_0x2fbc59['authTimeout']?_0x2fbc59[_0x80da('0x16')]*0x3e8:0x1388};if(_0x2fbc59[_0x80da('0x17')]){_0x2d612f['user']=_0x2fbc59[_0x80da('0x18')];if(_0x2fbc59[_0x80da('0x19')]){_0x2d612f['xoauth2']=utils[_0x80da('0x1a')](_0x2fbc59['CloudProvider'][_0x80da('0x1b')],_0x2fbc59[_0x80da('0x18')]);}else{_0x2d612f['password']=_0x2fbc59['password'];}}else{if(_0x2fbc59[_0x80da('0x1c')]){_0x2d612f['user']=_0x2fbc59['user'];_0x2d612f[_0x80da('0x1d')]=_0x2fbc59[_0x80da('0x1d')];}}_0x2d612f['email']=_0x15585d||_0x2fbc59[_0x80da('0x18')]||_0x80da('0x1e');_0x2d612f[_0x80da('0x1f')]=_0x2fbc59[_0x80da('0x1f')];_0x2d612f[_0x80da('0x20')]=_0x2fbc59[_0x80da('0x20')]||0x3e1;if(_0x2fbc59[_0x80da('0x21')]){_0x2d612f[_0x80da('0x21')]=!![];}else{_0x2d612f[_0x80da('0x21')]=![];_0x2d612f[_0x80da('0x22')]=_0x80da('0x23');}return _0x2d612f;};EmailImap[_0x80da('0x14')][_0x80da('0xe')]=function(){this['imap']['openBox'](this[_0x80da('0x8')],![],this['handleOpenBox'][_0x80da('0xf')](this));};EmailImap[_0x80da('0x14')]['handleOpenBox']=function(_0x16929b,_0x4e12ed){if(_0x16929b){this['handleError'](_0x16929b,!![]);}else{this[_0x80da('0x24')]('box',_0x4e12ed);this[_0x80da('0x25')]();}};EmailImap[_0x80da('0x14')][_0x80da('0x26')]=function(_0x2ff392){if(_0x2ff392){this[_0x80da('0x11')](_0x2ff392,!![]);}else{this[_0x80da('0xb')][_0x80da('0x27')]();}};EmailImap[_0x80da('0x14')][_0x80da('0x25')]=function(){this[_0x80da('0xb')][_0x80da('0x28')]([_0x80da('0x29')],this['handleReadUnseen'][_0x80da('0xf')](this));};EmailImap[_0x80da('0x14')]['handleReadUnseen']=function(_0x203a5a,_0x43b878){if(_0x203a5a){this[_0x80da('0x11')](_0x203a5a,!![]);}else{if(_0x43b878[_0x80da('0x2a')]){try{var _0x1fcd7e=this['imap'][_0x80da('0x2b')](_0x43b878,{'bodies':'','markSeen':!![]});_0x1fcd7e['on'](_0x80da('0x2c'),this[_0x80da('0x2d')][_0x80da('0xf')](this));_0x1fcd7e[_0x80da('0xc')](_0x80da('0x10'),this[_0x80da('0x2e')][_0x80da('0xf')](this));_0x1fcd7e[_0x80da('0xc')](_0x80da('0x27'),this[_0x80da('0x2f')][_0x80da('0xf')](this));}catch(_0x2af249){logger[_0x80da('0x10')](_0x2af249);}}else{this[_0x80da('0xb')][_0x80da('0x30')](!![],this[_0x80da('0x26')][_0x80da('0xf')](this));}}};EmailImap[_0x80da('0x14')][_0x80da('0x2d')]=function(_0x34665c){_0x34665c['on'](_0x80da('0x31'),this[_0x80da('0x32')]['bind'](this));_0x34665c['once'](_0x80da('0x33'),this[_0x80da('0x34')]['bind'](this));_0x34665c[_0x80da('0xc')]('end',this[_0x80da('0x35')][_0x80da('0xf')](this));};EmailImap[_0x80da('0x14')][_0x80da('0x32')]=function(_0x1e6371){simpleParser(_0x1e6371,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap[_0x80da('0x14')][_0x80da('0x34')]=function(){};EmailImap['prototype'][_0x80da('0x35')]=function(){};EmailImap['prototype'][_0x80da('0x36')]=function(_0x4abf4f,_0x59354b){if(_0x4abf4f){logger[_0x80da('0x10')](_0x4abf4f);}else{var _0x212089=this;utils[_0x80da('0x37')](this[_0x80da('0xa')],_0x59354b,function(_0x44cf48){_0x212089['emit'](_0x80da('0x7'),_0x44cf48);});}};EmailImap[_0x80da('0x14')][_0x80da('0x2f')]=function(){this[_0x80da('0xb')][_0x80da('0x30')](!![],this['handleCloseBox'][_0x80da('0xf')](this));};EmailImap[_0x80da('0x14')][_0x80da('0x2e')]=function(_0x45975a){this['handleError'](_0x45975a);this[_0x80da('0xb')][_0x80da('0x30')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x80da('0x14')][_0x80da('0x38')]=function(){this['emit'](_0x80da('0x27'));};EmailImap['prototype'][_0x80da('0x11')]=function(_0x303480,_0x2d2cab){logger['error']('handleError',this[_0x80da('0xa')][_0x80da('0x7')],JSON[_0x80da('0x39')](_0x303480));var _0x14e733='';if(_0x303480){if(_0x303480[_0x80da('0x3a')]){_0x14e733=_0x303480['textCode'];}else{for(var _0x7e883 in _0x303480){if(_0x303480[_0x80da('0x3b')](_0x7e883)){_0x14e733+=_['upperFirst'](_0x7e883)+':\x20'+_0x303480[_0x7e883]+'\x0a';}}}}if(_0x2d2cab){this['imap']['end']();}else{this[_0x80da('0x24')](_0x80da('0x10'),_0x14e733);this[_0x80da('0x24')](_0x80da('0x27'));}};module[_0x80da('0x3c')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 8ec1ff8..71294c5 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 _0xa25c=['verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','toString'];(function(_0x4d7181,_0x58f2b7){var _0x2a356b=function(_0x2a0038){while(--_0x2a0038){_0x4d7181['push'](_0x4d7181['shift']());}};_0x2a356b(++_0x58f2b7);}(_0xa25c,0x1ef));var _0xca25=function(_0x40c3a5,_0x4615ca){_0x40c3a5=_0x40c3a5-0x0;var _0x2b19da=_0xa25c[_0x40c3a5];return _0x2b19da;};'use strict';var nodemailer=require(_0xca25('0x0'));var inlineBase64=require(_0xca25('0x1'));function EmailSmtp(){}EmailSmtp[_0xca25('0x2')][_0xca25('0x3')]=function(_0x2d40b8,_0x4cf873){return new Promise(function(_0x819c16,_0x2f0919){var _0x3b1268=nodemailer[_0xca25('0x4')](_0x2d40b8);_0x3b1268[_0xca25('0x5')](_0xca25('0x6'),inlineBase64());_0x3b1268[_0xca25('0x7')](_0x4cf873,function(_0x9ec2bb,_0xdd6ff4){if(_0x9ec2bb){_0x2f0919(_0x9ec2bb[_0xca25('0x8')]());}else{_0x819c16(_0xdd6ff4);}});});};EmailSmtp[_0xca25('0x2')][_0xca25('0x9')]=function(_0x3f5df9){return new Promise(function(_0x32b7c5,_0x797033){var _0x2f6d65=nodemailer[_0xca25('0x4')](_0x3f5df9);_0x2f6d65[_0xca25('0x9')](function(_0x153f00,_0x1f39b3){if(_0x153f00){_0x797033(_0x153f00['toString']());}else{if(_0x1f39b3){_0x32b7c5(_0x1f39b3);}else{_0x797033(_0xca25('0xa'));}}});});};module[_0xca25('0xb')]=EmailSmtp; \ No newline at end of file +var _0x6c5d=['toString','verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','send','compile','sendMail'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x6c5d,0xc4));var _0xd6c5=function(_0x530bfd,_0x463ca2){_0x530bfd=_0x530bfd-0x0;var _0x2334f5=_0x6c5d[_0x530bfd];return _0x2334f5;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0xd6c5('0x0'));function EmailSmtp(){}EmailSmtp['prototype'][_0xd6c5('0x1')]=function(_0x2d6431,_0x59f3b5){return new Promise(function(_0x32822e,_0x20e21f){var _0x53781d=nodemailer['createTransport'](_0x2d6431);_0x53781d['use'](_0xd6c5('0x2'),inlineBase64());_0x53781d[_0xd6c5('0x3')](_0x59f3b5,function(_0x229661,_0x5bbafa){if(_0x229661){_0x20e21f(_0x229661[_0xd6c5('0x4')]());}else{_0x32822e(_0x5bbafa);}});});};EmailSmtp['prototype'][_0xd6c5('0x5')]=function(_0x5ca4fb){return new Promise(function(_0x12619a,_0x3ec6dd){var _0xe51e20=nodemailer['createTransport'](_0x5ca4fb);_0xe51e20['verify'](function(_0x1b1ae9,_0x306476){if(_0x1b1ae9){_0x3ec6dd(_0x1b1ae9['toString']());}else{if(_0x306476){_0x12619a(_0x306476);}else{_0x3ec6dd(_0xd6c5('0x6'));}}});});};module[_0xd6c5('0x7')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 355de06..0317767 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 _0xa50b=['head','address','generate','@xcally.com','value','name','substring','split','length','join','Anonymous','html','test','replace','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','user=','auth=Bearer\x20','utf-8','base64','moment','randomstring','path','util','../../../config/logger','email','../../../config/environment'];(function(_0x3ebf89,_0x380730){var _0xf8e782=function(_0x193c9b){while(--_0x193c9b){_0x3ebf89['push'](_0x3ebf89['shift']());}};_0xf8e782(++_0x380730);}(_0xa50b,0x1a3));var _0xba50=function(_0x3cf18c,_0x520870){_0x3cf18c=_0x3cf18c-0x0;var _0xc8e728=_0xa50b[_0x3cf18c];return _0xc8e728;};'use strict';var _=require('lodash');var moment=require(_0xba50('0x0'));var random=require(_0xba50('0x1'));var fs=require('fs');var path=require(_0xba50('0x2'));var util=require(_0xba50('0x3'));var tnef=require('node-tnef');var logger=require(_0xba50('0x4'))(_0xba50('0x5'));var config=require(_0xba50('0x6'));function getAddress(_0x101789){var _0x258796=_[_0xba50('0x7')](_0x101789['value']);return _0x258796&&_0x258796[_0xba50('0x8')]?_0x258796[_0xba50('0x8')]:'anonymous'+random[_0xba50('0x9')](0x6)+_0xba50('0xa');}function getFirstName(_0x2979bc){var _0x4c91ba=_[_0xba50('0x7')](_0x2979bc[_0xba50('0xb')]);if(_0x4c91ba&&_0x4c91ba[_0xba50('0xc')]){if(_0x4c91ba[_0xba50('0xc')]==_0x4c91ba['address']){return _0x4c91ba[_0xba50('0xc')][_0xba50('0xd')](0x0,_0x4c91ba[_0xba50('0xc')]['indexOf']('@'));}var _0x429237=_0x4c91ba[_0xba50('0xc')][_0xba50('0xe')](/\s+/);return _0x429237[_0xba50('0xf')]>0x1?_0x429237['slice'](0x0,-0x1)[_0xba50('0x10')]('\x20'):_0x4c91ba[_0xba50('0xc')];}return _0xba50('0x11');}function getLastName(_0x1c0f02){var _0x308335=_['head'](_0x1c0f02['value']);if(_0x308335&&_0x308335[_0xba50('0xc')]){var _0x1b03f7=_0x308335[_0xba50('0xc')]['split'](/\s+/);return _0x1b03f7[_0xba50('0xf')]>0x1?_0x1b03f7['pop']():'';}return'';}function getMails(_0x3121d7,_0x158e5d){var _0xb51721='';for(var _0x4de9b9=0x0;_0x4de9b9<_0x158e5d[_0xba50('0xb')][_0xba50('0xf')];_0x4de9b9+=0x1){if(_0x158e5d[_0xba50('0xb')][_0x4de9b9][_0xba50('0x8')]!==_0x3121d7){if(!_['isEmpty'](_0xb51721)){_0xb51721+=',';}_0xb51721+=_0x158e5d[_0xba50('0xb')][_0x4de9b9][_0xba50('0xc')]||_0x158e5d['value'][_0x4de9b9][_0xba50('0x8')]||'';_0xb51721+='\x20<';_0xb51721+=_0x158e5d['value'][_0x4de9b9][_0xba50('0x8')]?_0x158e5d[_0xba50('0xb')][_0x4de9b9][_0xba50('0x8')]:'anonymous'+random['generate'](0x6)+_0xba50('0xa');_0xb51721+='>';}}return _0xb51721;}function parseEmail(_0x38b564,_0x599281,_0x3b7146){if(_0x599281[_0xba50('0x12')]){var _0xe115c9=/)<[^<]*)*<\/script>/gi;while(_0xe115c9[_0xba50('0x13')](_0x599281['html'])){_0x599281[_0xba50('0x12')]=_0x599281[_0xba50('0x12')][_0xba50('0x14')](_0xe115c9,'');}if(_0x599281['html']['includes'](_0xba50('0x15'))){var _0x1dcc40=[];_0x599281['attachments'][_0xba50('0x16')](_0x4ea2c5=>{_0x1dcc40[_0xba50('0x17')](_0x4ea2c5[_0xba50('0x18')]);});var _0x50b5ff=/]+>/g;var _0x38270c=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x453da7=_0x599281[_0xba50('0x12')][_0xba50('0x14')](_0x38270c,'_SRC');var _0x48f5c7=_0x453da7['replace'](_0x50b5ff,'_IMG');for(let _0x3f701f=0x0;_0x3f701f<_0x1dcc40['length'];_0x3f701f++){var _0x5264f0=_0x48f5c7[_0xba50('0x14')](_0xba50('0x19'),_0xba50('0x1a')+_0x1dcc40[_0x3f701f]+_0xba50('0x1b'));_0x48f5c7=_0x5264f0;}_0x599281[_0xba50('0x12')]=_0x48f5c7;}_0x3b7146[_0xba50('0x1c')]=_0x599281[_0xba50('0x12')];}else{_0x3b7146[_0xba50('0x1c')]=_0x599281[_0xba50('0x1d')];}if(_0x3b7146[_0xba50('0x1c')]){_0x3b7146[_0xba50('0x1c')]=_0x3b7146['body'][_0xba50('0x14')](/0x0){var _0x31bfd8=[_0xba50('0x2f'),_0xba50('0x30'),_0xba50('0x31')];for(var _0x1b6eb2=0x0;_0x1b6eb2<_0x599281[_0xba50('0x2e')][_0xba50('0xf')];_0x1b6eb2++){var _0x72aa1a=_[_0xba50('0x32')](_0x31bfd8,_0x599281[_0xba50('0x2e')][_0x1b6eb2][_0xba50('0x33')]);if(_0x72aa1a>=0x0){_0x3b7146['isAutoreply']=!![];}}}return _0x3b7146;}exports['parser']=function(_0xef7a11,_0x27eed3,_0x23645e){var _0x526c63={'from':getAddress(_0x27eed3[_0xba50('0x34')]),'firstName':getFirstName(_0x27eed3[_0xba50('0x34')]),'lastName':getLastName(_0x27eed3[_0xba50('0x34')]),'mapKey':_0xba50('0x5'),'message':{'from':getMails(_0xef7a11[_0xba50('0x5')],_0x27eed3[_0xba50('0x34')]),'to':_0xef7a11[_0xba50('0x5')],'cc':'','subject':_0x27eed3[_0xba50('0x35')]||'','messageId':_0x27eed3[_0xba50('0x36')],'inReplyTo':_0x27eed3['inReplyTo'],'sentAt':moment(_0x27eed3[_0xba50('0x37')])[_0xba50('0x38')](_0xba50('0x39')),'attach':![],'attachments':[]}};if(!_0x27eed3[_0xba50('0x12')]&&!_0x27eed3['textAsHtml']){var _0x4b0565=_[_0xba50('0x3a')](_0x27eed3[_0xba50('0x25')],{'contentType':_0xba50('0x3b')});if(_0x4b0565[_0xba50('0xf')]){logger[_0xba50('0x3c')](util[_0xba50('0x38')](_0xba50('0x3d'),_0x27eed3[_0xba50('0x36')]));tnef['parseBuffer'](_[_0xba50('0x3e')](_0x4b0565)['content'],function(_0x43ffe0,_0x4be7f4){if(_0x4be7f4){_0x27eed3['html']=_0x4be7f4['BodyHTML']||_0xba50('0x3f');if(_0x4be7f4[_0xba50('0x40')]){for(var _0x139ac7=0x0;_0x139ac7<_0x4be7f4[_0xba50('0x40')][_0xba50('0xf')];_0x139ac7++){var _0x47d450=_0x4be7f4[_0xba50('0x40')][_0x139ac7];_0x526c63[_0xba50('0x1f')][_0xba50('0x25')]['push']({'filename':_0x47d450[_0xba50('0x41')],'content':Buffer[_0xba50('0x34')](_0x47d450[_0xba50('0x42')])});}}}_0x23645e(parseEmail(_0xef7a11,_0x27eed3,_0x526c63));});}else{_0x27eed3['html']=_0xba50('0x3f');_0x23645e(parseEmail(_0xef7a11,_0x27eed3,_0x526c63));}}else{_0x23645e(parseEmail(_0xef7a11,_0x27eed3,_0x526c63));}};exports['generateXOAuth2Token']=function(_0x33935a,_0x35ead5){var _0x80659f=[_0xba50('0x43')+(_0x35ead5||''),_0xba50('0x44')+_0x33935a,'',''];return Buffer[_0xba50('0x34')](_0x80659f[_0xba50('0x10')](''),_0xba50('0x45'))['toString'](_0xba50('0x46'));}; \ No newline at end of file +var _0x2262=['utf-8','toString','base64','lodash','moment','path','util','node-tnef','../../../config/logger','email','value','address','anonymous','head','name','substring','indexOf','split','slice','join','length','pop','generate','@xcally.com','html','test','replace','includes','attachments','forEach','push','filename','_SRC','_IMG','\x20]','body','Empty\x20message

','Attachments','Title','generateXOAuth2Token','user=','auth=Bearer\x20'];(function(_0x3a3e9b,_0x20a7a7){var _0x62fc59=function(_0x323f0a){while(--_0x323f0a){_0x3a3e9b['push'](_0x3a3e9b['shift']());}};_0x62fc59(++_0x20a7a7);}(_0x2262,0x99));var _0x2226=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2262[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2226('0x0'));var moment=require(_0x2226('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x2226('0x2'));var util=require(_0x2226('0x3'));var tnef=require(_0x2226('0x4'));var logger=require(_0x2226('0x5'))(_0x2226('0x6'));var config=require('../../../config/environment');function getAddress(_0xd0c2d4){var _0x31d97f=_['head'](_0xd0c2d4[_0x2226('0x7')]);return _0x31d97f&&_0x31d97f[_0x2226('0x8')]?_0x31d97f[_0x2226('0x8')]:_0x2226('0x9')+random['generate'](0x6)+'@xcally.com';}function getFirstName(_0x2be665){var _0x13814a=_[_0x2226('0xa')](_0x2be665[_0x2226('0x7')]);if(_0x13814a&&_0x13814a[_0x2226('0xb')]){if(_0x13814a[_0x2226('0xb')]==_0x13814a[_0x2226('0x8')]){return _0x13814a[_0x2226('0xb')][_0x2226('0xc')](0x0,_0x13814a[_0x2226('0xb')][_0x2226('0xd')]('@'));}var _0x510f4c=_0x13814a['name'][_0x2226('0xe')](/\s+/);return _0x510f4c['length']>0x1?_0x510f4c[_0x2226('0xf')](0x0,-0x1)[_0x2226('0x10')]('\x20'):_0x13814a[_0x2226('0xb')];}return'Anonymous';}function getLastName(_0x5928d2){var _0x44cda0=_[_0x2226('0xa')](_0x5928d2[_0x2226('0x7')]);if(_0x44cda0&&_0x44cda0[_0x2226('0xb')]){var _0x3d79c9=_0x44cda0[_0x2226('0xb')][_0x2226('0xe')](/\s+/);return _0x3d79c9[_0x2226('0x11')]>0x1?_0x3d79c9[_0x2226('0x12')]():'';}return'';}function getMails(_0x3419ed,_0x128401){var _0x1f013f='';for(var _0x4e0b6d=0x0;_0x4e0b6d<_0x128401['value']['length'];_0x4e0b6d+=0x1){if(_0x128401[_0x2226('0x7')][_0x4e0b6d][_0x2226('0x8')]!==_0x3419ed){if(!_['isEmpty'](_0x1f013f)){_0x1f013f+=',';}_0x1f013f+=_0x128401[_0x2226('0x7')][_0x4e0b6d][_0x2226('0xb')]||_0x128401[_0x2226('0x7')][_0x4e0b6d][_0x2226('0x8')]||'';_0x1f013f+='\x20<';_0x1f013f+=_0x128401['value'][_0x4e0b6d][_0x2226('0x8')]?_0x128401[_0x2226('0x7')][_0x4e0b6d][_0x2226('0x8')]:_0x2226('0x9')+random[_0x2226('0x13')](0x6)+_0x2226('0x14');_0x1f013f+='>';}}return _0x1f013f;}function parseEmail(_0x2c3839,_0x1ce6d1,_0x19368b){if(_0x1ce6d1[_0x2226('0x15')]){var _0x5e01ba=/)<[^<]*)*<\/script>/gi;while(_0x5e01ba[_0x2226('0x16')](_0x1ce6d1['html'])){_0x1ce6d1[_0x2226('0x15')]=_0x1ce6d1[_0x2226('0x15')][_0x2226('0x17')](_0x5e01ba,'');}if(_0x1ce6d1['html'][_0x2226('0x18')]('{_0x321215[_0x2226('0x1b')](_0x1edf11[_0x2226('0x1c')]);});var _0x39546d=/]+>/g;var _0xfe62ce=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5a1ada=_0x1ce6d1['html'][_0x2226('0x17')](_0xfe62ce,_0x2226('0x1d'));var _0x294e7e=_0x5a1ada[_0x2226('0x17')](_0x39546d,_0x2226('0x1e'));for(let _0x4e1ba9=0x0;_0x4e1ba9<_0x321215[_0x2226('0x11')];_0x4e1ba9++){var _0x246e78=_0x294e7e['replace']('_IMG','\x20[Attachment:\x20'+_0x321215[_0x4e1ba9]+_0x2226('0x1f'));_0x294e7e=_0x246e78;}_0x1ce6d1[_0x2226('0x15')]=_0x294e7e;}_0x19368b['body']=_0x1ce6d1[_0x2226('0x15')];}else{_0x19368b['body']=_0x1ce6d1['textAsHtml'];}if(_0x19368b[_0x2226('0x20')]){_0x19368b[_0x2226('0x20')]=_0x19368b[_0x2226('0x20')][_0x2226('0x17')](/0x0){var _0x22ab94=[_0x2226('0x32'),_0x2226('0x33'),_0x2226('0x34')];for(var _0x494fe2=0x0;_0x494fe2<_0x1ce6d1[_0x2226('0x31')]['length'];_0x494fe2++){var _0x1b0103=_[_0x2226('0xd')](_0x22ab94,_0x1ce6d1['headerLines'][_0x494fe2][_0x2226('0x35')]);if(_0x1b0103>=0x0){_0x19368b[_0x2226('0x36')]=!![];}}}return _0x19368b;}exports[_0x2226('0x37')]=function(_0x144de6,_0x3cab36,_0x150605){var _0x522d51={'from':getAddress(_0x3cab36[_0x2226('0x38')]),'firstName':getFirstName(_0x3cab36[_0x2226('0x38')]),'lastName':getLastName(_0x3cab36[_0x2226('0x38')]),'mapKey':_0x2226('0x6'),'message':{'from':getMails(_0x144de6[_0x2226('0x6')],_0x3cab36['from']),'to':_0x144de6['email'],'cc':'','subject':_0x3cab36['subject']||'','messageId':_0x3cab36[_0x2226('0x39')],'inReplyTo':_0x3cab36[_0x2226('0x3a')],'sentAt':moment(_0x3cab36['date'])[_0x2226('0x3b')](_0x2226('0x3c')),'attach':![],'attachments':[]}};if(!_0x3cab36[_0x2226('0x15')]&&!_0x3cab36[_0x2226('0x3d')]){var _0x136db2=_[_0x2226('0x3e')](_0x3cab36[_0x2226('0x19')],{'contentType':_0x2226('0x3f')});if(_0x136db2['length']){logger['info'](util['format'](_0x2226('0x40'),_0x3cab36[_0x2226('0x39')]));tnef[_0x2226('0x41')](_['first'](_0x136db2)[_0x2226('0x2f')],function(_0x1af8dc,_0x2094b0){if(_0x2094b0){_0x3cab36['html']=_0x2094b0['BodyHTML']||_0x2226('0x42');if(_0x2094b0[_0x2226('0x43')]){for(var _0x6db8af=0x0;_0x6db8af<_0x2094b0[_0x2226('0x43')][_0x2226('0x11')];_0x6db8af++){var _0x1b6445=_0x2094b0[_0x2226('0x43')][_0x6db8af];_0x522d51[_0x2226('0x22')][_0x2226('0x19')][_0x2226('0x1b')]({'filename':_0x1b6445[_0x2226('0x44')],'content':Buffer['from'](_0x1b6445['Data'])});}}}_0x150605(parseEmail(_0x144de6,_0x3cab36,_0x522d51));});}else{_0x3cab36[_0x2226('0x15')]=_0x2226('0x42');_0x150605(parseEmail(_0x144de6,_0x3cab36,_0x522d51));}}else{_0x150605(parseEmail(_0x144de6,_0x3cab36,_0x522d51));}};exports[_0x2226('0x45')]=function(_0xb5599b,_0x5138e5){var _0x560429=[_0x2226('0x46')+(_0x5138e5||''),_0x2226('0x47')+_0xb5599b,'',''];return Buffer[_0x2226('0x38')](_0x560429[_0x2226('0x10')](''),_0x2226('0x48'))[_0x2226('0x49')](_0x2226('0x4a'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 3595cca..5fc6e7e 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 _0xf5ce=['Smtp','exports','name','key','SERV','active','Imap'];(function(_0x29b7b6,_0x1cdfd3){var _0x16fc74=function(_0x15f641){while(--_0x15f641){_0x29b7b6['push'](_0x29b7b6['shift']());}};_0x16fc74(++_0x1cdfd3);}(_0xf5ce,0x1b4));var _0xef5c=function(_0x1aee8a,_0x55c058){_0x1aee8a=_0x1aee8a-0x0;var _0x153913=_0xf5ce[_0x1aee8a];return _0x153913;};'use strict';var _=require('lodash');function MailAccount(_0x331c52){this['id']=_0x331c52['id']||0x0;this[_0xef5c('0x0')]=_0x331c52[_0xef5c('0x0')]||'Service';this[_0xef5c('0x1')]=_0x331c52['key']||_0xef5c('0x2');this[_0xef5c('0x3')]=_0x331c52['active']||![];this[_0xef5c('0x4')]=_0x331c52['Imap']||[];this['Smtp']=_0x331c52[_0xef5c('0x5')]||[];}module[_0xef5c('0x6')]=MailAccount; \ No newline at end of file +var _0x1557=['exports','lodash','name','Service','key','SERV','active','Imap','Smtp'];(function(_0x2b8842,_0x2f66d0){var _0x3136a2=function(_0x75b8ba){while(--_0x75b8ba){_0x2b8842['push'](_0x2b8842['shift']());}};_0x3136a2(++_0x2f66d0);}(_0x1557,0x1c3));var _0x7155=function(_0x3b9fd3,_0x5d536c){_0x3b9fd3=_0x3b9fd3-0x0;var _0x43ac33=_0x1557[_0x3b9fd3];return _0x43ac33;};'use strict';var _=require(_0x7155('0x0'));function MailAccount(_0x37724b){this['id']=_0x37724b['id']||0x0;this[_0x7155('0x1')]=_0x37724b[_0x7155('0x1')]||_0x7155('0x2');this[_0x7155('0x3')]=_0x37724b[_0x7155('0x3')]||_0x7155('0x4');this[_0x7155('0x5')]=_0x37724b['active']||![];this[_0x7155('0x6')]=_0x37724b['Imap']||[];this[_0x7155('0x7')]=_0x37724b['Smtp']||[];}module[_0x7155('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 3ac0c37..f23af35 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 _0xdd7e=['lodash','mergeFromDatabase','hasOwnProperty','prototype','initMailAccounts','mailAccounts','isUndefined','merge','exports'];(function(_0x235504,_0x268219){var _0x5ab2ea=function(_0x1e8a60){while(--_0x1e8a60){_0x235504['push'](_0x235504['shift']());}};_0x5ab2ea(++_0x268219);}(_0xdd7e,0x1c2));var _0xedd7=function(_0x3802a1,_0x5d2527){_0x3802a1=_0x3802a1-0x0;var _0x1f61ae=_0xdd7e[_0x3802a1];return _0x1f61ae;};'use strict';var _=require(_0xedd7('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x430938,_0x4806b9,_0x3f7db8){var _0x4fd044=_['mapKeys'](_0x430938,function(_0x155898,_0x48899c){return _0x155898[_0x3f7db8];});for(var _0x51aeda in _0x4806b9){if(_0x4806b9['hasOwnProperty'](_0x51aeda)){if(!_0x4fd044[_0x51aeda]){delete _0x4806b9[_0x51aeda];}}}}Realtime['prototype'][_0xedd7('0x1')]=function(_0x38a6f6,_0x50d410){for(var _0x3d172e in _0x50d410){if(_0x38a6f6[_0xedd7('0x2')](_0x3d172e)){_0x38a6f6[_0x3d172e]=_0x50d410[_0x3d172e];}}};Realtime[_0xedd7('0x3')][_0xedd7('0x4')]=function(){var _0x17aa2b=this;return function(_0x718cfe){if(_0x718cfe){freeIsNotKey(_0x718cfe,_0x17aa2b[_0xedd7('0x5')],'id');for(var _0x58a10a=0x0,_0x400b6a={},_0x10a9bb={};_0x58a10a<_0x718cfe['length'];_0x58a10a+=0x1){_0x400b6a=_0x718cfe[_0x58a10a];if(_[_0xedd7('0x6')](_0x17aa2b[_0xedd7('0x5')][_0x400b6a['id']])){_0x17aa2b[_0xedd7('0x5')][_0x400b6a['id']]=new MailAccount(_0x400b6a);}else{_[_0xedd7('0x7')](_0x17aa2b['mailAccounts'][_0x400b6a['id']],_0x400b6a);}}}return _0x17aa2b[_0xedd7('0x5')];};};module[_0xedd7('0x8')]=Realtime; \ No newline at end of file +var _0x3295=['mergeFromDatabase','initMailAccounts','mailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mapKeys','hasOwnProperty'];(function(_0x705b98,_0x1c345b){var _0x47b72f=function(_0x44f02a){while(--_0x44f02a){_0x705b98['push'](_0x705b98['shift']());}};_0x47b72f(++_0x1c345b);}(_0x3295,0x167));var _0x5329=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0x3295[_0x1ca9e9];return _0x309f3c;};'use strict';var _=require(_0x5329('0x0'));var MailAccount=require(_0x5329('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x1dc502,_0x32b484,_0x53bb86){var _0x32416c=_[_0x5329('0x2')](_0x1dc502,function(_0x51433e,_0x45049b){return _0x51433e[_0x53bb86];});for(var _0x2b045b in _0x32b484){if(_0x32b484[_0x5329('0x3')](_0x2b045b)){if(!_0x32416c[_0x2b045b]){delete _0x32b484[_0x2b045b];}}}}Realtime['prototype'][_0x5329('0x4')]=function(_0x1a5976,_0x3a6d8e){for(var _0x538ce6 in _0x3a6d8e){if(_0x1a5976[_0x5329('0x3')](_0x538ce6)){_0x1a5976[_0x538ce6]=_0x3a6d8e[_0x538ce6];}}};Realtime['prototype'][_0x5329('0x5')]=function(){var _0x37c71e=this;return function(_0x47005e){if(_0x47005e){freeIsNotKey(_0x47005e,_0x37c71e[_0x5329('0x6')],'id');for(var _0x2b38d2=0x0,_0x4cf4e9={},_0x517152={};_0x2b38d2<_0x47005e[_0x5329('0x7')];_0x2b38d2+=0x1){_0x4cf4e9=_0x47005e[_0x2b38d2];if(_[_0x5329('0x8')](_0x37c71e[_0x5329('0x6')][_0x4cf4e9['id']])){_0x37c71e['mailAccounts'][_0x4cf4e9['id']]=new MailAccount(_0x4cf4e9);}else{_[_0x5329('0x9')](_0x37c71e[_0x5329('0x6')][_0x4cf4e9['id']],_0x4cf4e9);}}}return _0x37c71e[_0x5329('0x6')];};};module[_0x5329('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 8d71ea8..4511cba 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 _0x5d17=['getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts','name','provider','service','active','key','ListId','TemplateId','Imap','CloudProvider','type','data5'];(function(_0x4b934b,_0x12b060){var _0x23280f=function(_0x5b8feb){while(--_0x5b8feb){_0x4b934b['push'](_0x4b934b['shift']());}};_0x23280f(++_0x12b060);}(_0x5d17,0x114));var _0x75d1=function(_0x1e6e4e,_0x2b1b09){_0x1e6e4e=_0x1e6e4e-0x0;var _0x3d746b=_0x5d17[_0x1e6e4e];return _0x3d746b;};'use strict';var client=require(_0x75d1('0x0'));exports[_0x75d1('0x1')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id',_0x75d1('0x2'),_0x75d1('0x3'),_0x75d1('0x4'),'email',_0x75d1('0x5'),_0x75d1('0x6'),_0x75d1('0x7'),_0x75d1('0x8')],'raw':![],'include':[{'model':'MailServerIn','as':_0x75d1('0x9'),'include':[{'model':_0x75d1('0xa'),'attributes':['id',_0x75d1('0x2'),_0x75d1('0x4'),_0x75d1('0xb'),_0x75d1('0xc')],'as':_0x75d1('0xa')}]},{'model':'MailServerOut','as':'Smtp','include':[{'model':_0x75d1('0xa'),'attributes':['id','name','service',_0x75d1('0xb'),_0x75d1('0xc')],'as':'CloudProvider'}]}]},'log':_0x75d1('0xd')});};};exports[_0x75d1('0xe')]=function(_0x28b9b4,_0xe07f4a){return client[_0x75d1('0xf')](_0x75d1('0x10'),{'account':{'id':_0x28b9b4},'body':_0xe07f4a,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0xf3fe=['MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name','provider','email','active','key','ListId','TemplateId','CloudProvider','service','type','data5'];(function(_0x249e96,_0x3ea39d){var _0x17444c=function(_0x1221d0){while(--_0x1221d0){_0x249e96['push'](_0x249e96['shift']());}};_0x17444c(++_0x3ea39d);}(_0xf3fe,0x1cd));var _0xef3f=function(_0x545006,_0xd38399){_0x545006=_0x545006-0x0;var _0x48cc6d=_0xf3fe[_0x545006];return _0x48cc6d;};'use strict';var client=require('../client');exports[_0xef3f('0x0')]=function(){return function(){return client[_0xef3f('0x1')](_0xef3f('0x2'),{'options':{'attributes':['id',_0xef3f('0x3'),_0xef3f('0x4'),'service',_0xef3f('0x5'),_0xef3f('0x6'),_0xef3f('0x7'),_0xef3f('0x8'),_0xef3f('0x9')],'raw':![],'include':[{'model':'MailServerIn','as':'Imap','include':[{'model':_0xef3f('0xa'),'attributes':['id',_0xef3f('0x3'),_0xef3f('0xb'),_0xef3f('0xc'),_0xef3f('0xd')],'as':_0xef3f('0xa')}]},{'model':_0xef3f('0xe'),'as':_0xef3f('0xf'),'include':[{'model':_0xef3f('0xa'),'attributes':['id','name',_0xef3f('0xb'),'type',_0xef3f('0xd')],'as':_0xef3f('0xa')}]}]},'log':_0xef3f('0x10')});};};exports[_0xef3f('0x11')]=function(_0x4f0367,_0x1667e8){return client[_0xef3f('0x1')]('NotifyMailAccount',{'account':{'id':_0x4f0367},'body':_0x1667e8,'log':_0xef3f('0x12')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 6871336..171c06b 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 _0x6877=['Request','loginMailFrequency','../client','getSettings'];(function(_0x194a45,_0x5d1d26){var _0x71ded8=function(_0x1c489a){while(--_0x1c489a){_0x194a45['push'](_0x194a45['shift']());}};_0x71ded8(++_0x5d1d26);}(_0x6877,0x10e));var _0x7687=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x6877[_0x22b68a];return _0x1ac67a;};'use strict';var client=require(_0x7687('0x0'));exports[_0x7687('0x1')]=function(){return client[_0x7687('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7687('0x3')]},'log':'GetSettings'});}; \ No newline at end of file +var _0x4eb1=['ShowSetting','loginMailFrequency','GetSettings','../client','Request'];(function(_0x4836a6,_0x32a746){var _0x5bfaf3=function(_0x247e5c){while(--_0x247e5c){_0x4836a6['push'](_0x4836a6['shift']());}};_0x5bfaf3(++_0x32a746);}(_0x4eb1,0x94));var _0x14eb=function(_0x52bae3,_0xee057f){_0x52bae3=_0x52bae3-0x0;var _0x4d6b88=_0x4eb1[_0x52bae3];return _0x4d6b88;};'use strict';var client=require(_0x14eb('0x0'));exports['getSettings']=function(){return client[_0x14eb('0x1')](_0x14eb('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x14eb('0x3')]},'log':_0x14eb('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 595575a..7d42ea3 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 4f48c0a..9fafab8 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 _0xf84b=['../../config/express','../../routes','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','http','express','sticky-session','ioredis','../../config/environment','timeout','listen','socket.io','polling','redis','localhost','adapter','../../config/triggers','default'];(function(_0x15be66,_0x3a86c1){var _0x1d5d87=function(_0x4dd8d0){while(--_0x4dd8d0){_0x15be66['push'](_0x15be66['shift']());}};_0x1d5d87(++_0x3a86c1);}(_0xf84b,0x85));var _0xbf84=function(_0x102ce6,_0x40aee3){_0x102ce6=_0x102ce6-0x0;var _0x3f2cf4=_0xf84b[_0x102ce6];return _0x3f2cf4;};'use strict';var _=require('lodash');var http=require(_0xbf84('0x0'));var express=require(_0xbf84('0x1'));var sticky=require(_0xbf84('0x2'));var Redis=require(_0xbf84('0x3'));var config=require(_0xbf84('0x4'));var app=express();var server=http['createServer'](app);server[_0xbf84('0x5')]=0xdbba0;if(sticky[_0xbf84('0x6')](server,config['port'])){var socketio=require(_0xbf84('0x7'))(server,{'transports':['websocket',_0xbf84('0x8')]});config['redis']=_['defaults'](config[_0xbf84('0x9')],{'host':_0xbf84('0xa'),'port':0x18eb});socketio[_0xbf84('0xb')](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xbf84('0x9')])}));require(_0xbf84('0xc'))['default']();require('../../config/socketio')[_0xbf84('0xd')](socketio);require(_0xbf84('0xe'))[_0xbf84('0xd')](app);require(_0xbf84('0xf'))['default'](app);}else{server[_0xbf84('0x10')](_0xbf84('0x11'),function(){console['log'](_0xbf84('0x12'),config[_0xbf84('0x13')]);});}exports=module[_0xbf84('0x14')]=app; \ No newline at end of file +var _0xc429=['log','lodash','http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','port','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','listening'];(function(_0x23b212,_0x44f72b){var _0x49db1a=function(_0x9e5ba2){while(--_0x9e5ba2){_0x23b212['push'](_0x23b212['shift']());}};_0x49db1a(++_0x44f72b);}(_0xc429,0x1b1));var _0x9c42=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0xc429[_0x5b7788];return _0x573871;};'use strict';var _=require(_0x9c42('0x0'));var http=require(_0x9c42('0x1'));var express=require(_0x9c42('0x2'));var sticky=require(_0x9c42('0x3'));var Redis=require(_0x9c42('0x4'));var config=require(_0x9c42('0x5'));var app=express();var server=http[_0x9c42('0x6')](app);server[_0x9c42('0x7')]=0xdbba0;if(sticky['listen'](server,config[_0x9c42('0x8')])){var socketio=require(_0x9c42('0x9'))(server,{'transports':[_0x9c42('0xa'),_0x9c42('0xb')]});config[_0x9c42('0xc')]=_[_0x9c42('0xd')](config[_0x9c42('0xc')],{'host':_0x9c42('0xe'),'port':0x18eb});socketio[_0x9c42('0xf')](require(_0x9c42('0x10'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x9c42('0xc')])}));require(_0x9c42('0x11'))['default']();require(_0x9c42('0x12'))[_0x9c42('0x13')](socketio);require(_0x9c42('0x14'))[_0x9c42('0x13')](app);require(_0x9c42('0x15'))[_0x9c42('0x13')](app);}else{server['once'](_0x9c42('0x16'),function(){console[_0x9c42('0x17')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x9c42('0x8')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 4597ddc..3f35a47 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 _0xca0e=['result','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','then','debug','rpc','error','message'];(function(_0x4c18f2,_0x1c4824){var _0x17cec7=function(_0x2c23f4){while(--_0x2c23f4){_0x4c18f2['push'](_0x4c18f2['shift']());}};_0x17cec7(++_0x1c4824);}(_0xca0e,0x1ae));var _0xeca0=function(_0x417058,_0x5ad74e){_0x417058=_0x417058-0x0;var _0x3b7501=_0xca0e[_0x417058];return _0x3b7501;};'use strict';var jayson=require(_0xeca0('0x0'));var BPromise=require(_0xeca0('0x1'));var logger=require(_0xeca0('0x2'))(_0xeca0('0x3'));var client=jayson[_0xeca0('0x4')][_0xeca0('0x5')]({'port':0x2329});client[_0xeca0('0x6')]=function(_0x4219a6,_0x5b5f8e){return new BPromise(function(_0x2bdcad,_0x493f17){return client['request'](_0x4219a6,_0x5b5f8e)[_0xeca0('0x7')](function(_0x57c41a){logger[_0xeca0('0x8')](_0xeca0('0x9'),_0xeca0('0x3'),_0x4219a6,_0x5b5f8e,_0x57c41a);if(_0x57c41a['error']){logger[_0xeca0('0xa')](_0xeca0('0x9'),_0xeca0('0x3'),_0x4219a6,_0x57c41a[_0xeca0('0xa')][_0xeca0('0xb')],_0x5b5f8e);return _0x493f17(_0x57c41a[_0xeca0('0xa')][_0xeca0('0xb')]);}else{return _0x2bdcad(_0x57c41a[_0xeca0('0xc')]);}})['catch'](function(_0x226b3c){logger['error']('rpc','routing',_0x4219a6,_0x226b3c,_0x5b5f8e);return _0x493f17(_0x226b3c);});});};module['exports']=client; \ No newline at end of file +var _0x8966=['message','result','catch','rpc','exports','bluebird','client','http','Request','then','debug','error','routing'];(function(_0x24b08e,_0x1bc54b){var _0xc0cade=function(_0x4a1db3){while(--_0x4a1db3){_0x24b08e['push'](_0x24b08e['shift']());}};_0xc0cade(++_0x1bc54b);}(_0x8966,0xa1));var _0x6896=function(_0x1a525b,_0x3c77e1){_0x1a525b=_0x1a525b-0x0;var _0x28ca11=_0x8966[_0x1a525b];return _0x28ca11;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x6896('0x0'));var logger=require('../../config/logger')('routing');var client=jayson[_0x6896('0x1')][_0x6896('0x2')]({'port':0x2329});client[_0x6896('0x3')]=function(_0x443d44,_0x589cbc){return new BPromise(function(_0x2e7f18,_0x33daf8){return client['request'](_0x443d44,_0x589cbc)[_0x6896('0x4')](function(_0x34b161){logger[_0x6896('0x5')]('rpc','routing',_0x443d44,_0x589cbc,_0x34b161);if(_0x34b161[_0x6896('0x6')]){logger[_0x6896('0x6')]('rpc',_0x6896('0x7'),_0x443d44,_0x34b161[_0x6896('0x6')]['message'],_0x589cbc);return _0x33daf8(_0x34b161[_0x6896('0x6')][_0x6896('0x8')]);}else{return _0x2e7f18(_0x34b161[_0x6896('0x9')]);}})[_0x6896('0xa')](function(_0x4e792f){logger[_0x6896('0x6')](_0x6896('0xb'),_0x6896('0x7'),_0x443d44,_0x4e792f,_0x589cbc);return _0x33daf8(_0x4e792f);});});};module[_0x6896('0xc')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index a7e4965..f00356b 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 _0xadfe=['resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/faxQueue','./rpc/whatsappQueue'];(function(_0x223433,_0x4d0887){var _0x2fb5a8=function(_0x5a3bd2){while(--_0x5a3bd2){_0x223433['push'](_0x223433['shift']());}};_0x2fb5a8(++_0x4d0887);}(_0xadfe,0x1ad));var _0xeadf=function(_0xacb35c,_0xf6245e){_0xacb35c=_0xacb35c-0x0;var _0x44c8a9=_0xadfe[_0xacb35c];return _0x44c8a9;};'use strict';var BPromise=require(_0xeadf('0x0'));var server=require('./server');var Realtime=require(_0xeadf('0x1'));var user=require(_0xeadf('0x2'));var interval=require(_0xeadf('0x3'));var openchannelQueue=require(_0xeadf('0x4'));var chatQueue=require(_0xeadf('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xeadf('0x6'));var whatsappQueue=require(_0xeadf('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xeadf('0x8')]()[_0xeadf('0x9')](user[_0xeadf('0xa')]())[_0xeadf('0x9')](realtime[_0xeadf('0xb')]())[_0xeadf('0x9')](interval[_0xeadf('0xc')]())[_0xeadf('0x9')](realtime[_0xeadf('0xd')]())[_0xeadf('0x9')](openchannelQueue[_0xeadf('0xe')]())[_0xeadf('0x9')](realtime[_0xeadf('0xf')]())[_0xeadf('0x9')](chatQueue[_0xeadf('0x10')]())['then'](realtime[_0xeadf('0x11')]())[_0xeadf('0x9')](smsQueue['getSmsQueues']())[_0xeadf('0x9')](realtime['initSmsQueues']())[_0xeadf('0x9')](mailQueue['getMailQueues']())[_0xeadf('0x9')](realtime[_0xeadf('0x12')]())[_0xeadf('0x9')](faxQueue[_0xeadf('0x13')]())['then'](realtime[_0xeadf('0x14')]())[_0xeadf('0x9')](whatsappQueue['getWhatsappQueues']())[_0xeadf('0x9')](realtime[_0xeadf('0x15')]())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0x221078){return initRealtime();})[_0xeadf('0x9')](function(_0xb60c11){return setInterval(initRealtime,0x1388);})['catch'](function(_0x23a5f7){console[_0xeadf('0x16')](_0x23a5f7);});}main(); \ No newline at end of file +var _0xc897=['getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues'];(function(_0x18cf09,_0x451975){var _0x4104eb=function(_0x478317){while(--_0x478317){_0x18cf09['push'](_0x18cf09['shift']());}};_0x4104eb(++_0x451975);}(_0xc897,0xa7));var _0x7c89=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0xc897[_0x339129];return _0x1570df;};'use strict';var BPromise=require(_0x7c89('0x0'));var server=require(_0x7c89('0x1'));var Realtime=require(_0x7c89('0x2'));var user=require(_0x7c89('0x3'));var interval=require(_0x7c89('0x4'));var openchannelQueue=require(_0x7c89('0x5'));var chatQueue=require(_0x7c89('0x6'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x7c89('0x7'));var faxQueue=require(_0x7c89('0x8'));var whatsappQueue=require(_0x7c89('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x7c89('0xa')]()[_0x7c89('0xb')](user[_0x7c89('0xc')]())[_0x7c89('0xb')](realtime[_0x7c89('0xd')]())[_0x7c89('0xb')](interval[_0x7c89('0xe')]())[_0x7c89('0xb')](realtime['initIntervals']())[_0x7c89('0xb')](openchannelQueue[_0x7c89('0xf')]())['then'](realtime[_0x7c89('0x10')]())[_0x7c89('0xb')](chatQueue[_0x7c89('0x11')]())[_0x7c89('0xb')](realtime[_0x7c89('0x12')]())[_0x7c89('0xb')](smsQueue[_0x7c89('0x13')]())[_0x7c89('0xb')](realtime['initSmsQueues']())[_0x7c89('0xb')](mailQueue[_0x7c89('0x14')]())['then'](realtime[_0x7c89('0x15')]())['then'](faxQueue[_0x7c89('0x16')]())[_0x7c89('0xb')](realtime[_0x7c89('0x17')]())[_0x7c89('0xb')](whatsappQueue[_0x7c89('0x18')]())['then'](realtime[_0x7c89('0x19')]())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x7c89('0xb')](function(_0x204e59){return initRealtime();})[_0x7c89('0xb')](function(_0x438f24){return setInterval(initRealtime,0x1388);})['catch'](function(_0x2906e1){console[_0x7c89('0x1a')](_0x2906e1);});}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 e6a029e..70c86e8 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 _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x508e28,_0x4dc058){var _0x49b6d3=function(_0xd67e74){while(--_0xd67e74){_0x508e28['push'](_0x508e28['shift']());}};_0x49b6d3(++_0x4dc058);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2e249d,_0x41b7e7){_0x2e249d=_0x2e249d-0x0;var _0x1faa37=_0x5fc3[_0x2e249d];return _0x1faa37;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file +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(_0x3b320e,_0x232e26){var _0x25108c=function(_0x28c6ec){while(--_0x28c6ec){_0x3b320e['push'](_0x3b320e['shift']());}};_0x25108c(++_0x232e26);}(_0x814b,0x1a2));var _0xb814=function(_0x2183ca,_0x3778a9){_0x2183ca=_0x2183ca-0x0;var _0x21d00e=_0x814b[_0x2183ca];return _0x21d00e;};'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 diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 06fc0c5..650c1d1 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 _0x7ab8=['jayson/promise','http','then','error','message','result','catch','sendMailMessage','SendMail','bluebird'];(function(_0x559907,_0x55f18c){var _0x512891=function(_0x52f12b){while(--_0x52f12b){_0x559907['push'](_0x559907['shift']());}};_0x512891(++_0x55f18c);}(_0x7ab8,0x171));var _0x87ab=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x7ab8[_0x2c91e9];return _0x13f0ff;};'use strict';var BPromise=require(_0x87ab('0x0'));var jayson=require(_0x87ab('0x1'));var client=jayson['client'][_0x87ab('0x2')]({'port':0x232b});function request(_0x3d88f4,_0x347f58){return new BPromise(function(_0xc52019,_0x23fd32){return client['request'](_0x3d88f4,_0x347f58)[_0x87ab('0x3')](function(_0x405845){if(_0x405845[_0x87ab('0x4')]){return _0x23fd32(_0x405845[_0x87ab('0x4')][_0x87ab('0x5')]);}else{return _0xc52019(_0x405845[_0x87ab('0x6')]);}})[_0x87ab('0x7')](function(_0x4bec89){return _0x23fd32(_0x4bec89);});});}exports[_0x87ab('0x8')]=function(_0x4dd620,_0x2e0362){return request(_0x87ab('0x9'),{'account':_0x4dd620,'message':_0x2e0362});}; \ No newline at end of file +var _0x5704=['client','request','error','message','result','catch','sendMailMessage','bluebird','jayson/promise'];(function(_0x5d3f5c,_0x3cb3d3){var _0x11e0e7=function(_0x576e9e){while(--_0x576e9e){_0x5d3f5c['push'](_0x5d3f5c['shift']());}};_0x11e0e7(++_0x3cb3d3);}(_0x5704,0x11e));var _0x4570=function(_0x5c037a,_0x345a53){_0x5c037a=_0x5c037a-0x0;var _0xd51614=_0x5704[_0x5c037a];return _0xd51614;};'use strict';var BPromise=require(_0x4570('0x0'));var jayson=require(_0x4570('0x1'));var client=jayson[_0x4570('0x2')]['http']({'port':0x232b});function request(_0xb23105,_0x470e08){return new BPromise(function(_0x16934a,_0x15bc1b){return client[_0x4570('0x3')](_0xb23105,_0x470e08)['then'](function(_0x5f3ea4){if(_0x5f3ea4[_0x4570('0x4')]){return _0x15bc1b(_0x5f3ea4[_0x4570('0x4')][_0x4570('0x5')]);}else{return _0x16934a(_0x5f3ea4[_0x4570('0x6')]);}})[_0x4570('0x7')](function(_0x464957){return _0x15bc1b(_0x464957);});});}exports[_0x4570('0x8')]=function(_0x2fe5f7,_0x2cab96){return request('SendMail',{'account':_0x2fe5f7,'message':_0x2cab96});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index f86badb..993bd10 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 _0xbeac=['format','chatStatus','mailStatus','smsStatusTime','whatsappStatus','openchannelStatusTime','chatWaitingInteractions','faxWaitingInteractions','stringify','emit','exports','lodash','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','mailWaitingInteractions','openchannelWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','CurrentCapacity','maxcapacity','idle','mail','chat','openchannel','fax','sms','whatsapp','length','getChannelStatus','Status','StatusTime','toNumber'];(function(_0x4afadd,_0x2885c0){var _0x5a771d=function(_0x209854){while(--_0x209854){_0x4afadd['push'](_0x4afadd['shift']());}};_0x5a771d(++_0x2885c0);}(_0xbeac,0x1e7));var _0xcbea=function(_0x380eea,_0x711c86){_0x380eea=_0x380eea-0x0;var _0x1aa0ab=_0xbeac[_0x380eea];return _0x1aa0ab;};'use strict';var _=require(_0xcbea('0x0'));var moment=require('moment');var md5=require('md5');var Redis=require(_0xcbea('0x1'));var config=require(_0xcbea('0x2'));config['redis']=_[_0xcbea('0x3')](config[_0xcbea('0x4')],{'host':_0xcbea('0x5'),'port':0x18eb});var io=require(_0xcbea('0x6'))(new Redis(config['redis']));function Agent(_0x364fbe){this['id']=_0x364fbe['id']||0x0;this[_0xcbea('0x7')]=_0x364fbe[_0xcbea('0x7')]||'';this[_0xcbea('0x8')]=_0x364fbe['online']||!![];this[_0xcbea('0x9')]=_0x364fbe[_0xcbea('0x9')]||![];this[_0xcbea('0xa')]=_0x364fbe[_0xcbea('0xa')]||![];this[_0xcbea('0xb')]=_0x364fbe[_0xcbea('0xb')]||![];this[_0xcbea('0xc')]=_0x364fbe[_0xcbea('0xc')]||![];this[_0xcbea('0xd')]=_0x364fbe[_0xcbea('0xd')]||![];this[_0xcbea('0xe')]=_0x364fbe[_0xcbea('0xe')]||![];this['chatStatus']=_0xcbea('0xf');this[_0xcbea('0x10')]=0x0;this[_0xcbea('0x11')]=_0x364fbe[_0xcbea('0x11')]||0x0;this[_0xcbea('0x12')]=0x0;this['mailStatus']=_0xcbea('0xf');this[_0xcbea('0x13')]=0x0;this[_0xcbea('0x14')]=_0x364fbe[_0xcbea('0x14')]||0x0;this[_0xcbea('0x15')]=0x0;this[_0xcbea('0x16')]=_0xcbea('0xf');this[_0xcbea('0x17')]=0x0;this[_0xcbea('0x18')]=_0x364fbe[_0xcbea('0x18')]||0x0;this[_0xcbea('0x19')]=0x0;this[_0xcbea('0x1a')]='unknown';this['smsStatusTime']=0x0;this['smsCapacity']=_0x364fbe[_0xcbea('0x1b')]||0x0;this[_0xcbea('0x1c')]=0x0;this['whatsappStatus']=_0xcbea('0xf');this[_0xcbea('0x1d')]=0x0;this[_0xcbea('0x1e')]=_0x364fbe['whatsappCapacity']||0x0;this[_0xcbea('0x1f')]=0x0;this[_0xcbea('0x20')]='unknown';this['openchannelStatusTime']=0x0;this[_0xcbea('0x21')]=_0x364fbe[_0xcbea('0x21')]||0x0;this[_0xcbea('0x22')]=0x0;this[_0xcbea('0x23')]=![];this[_0xcbea('0x24')]=undefined;this[_0xcbea('0x25')]='';this['chatWaitingInteractions']={};this['faxWaitingInteractions']={};this[_0xcbea('0x26')]={};this[_0xcbea('0x27')]={};this['smsWaitingInteractions']={};this[_0xcbea('0x28')]={};this[_0xcbea('0x29')]();}Agent[_0xcbea('0x2a')]['getChannelStatus']=function(_0x5156ed){if(this[_0x5156ed+'CurrentCapacity']>0x0){if(this[_0x5156ed+'Capacity']>0x0&&this[_0x5156ed+_0xcbea('0x2b')]>=this[_0x5156ed+'Capacity']){return _0xcbea('0x2c');}else{return'working';}}else{return _0xcbea('0x2d');}};Agent[_0xcbea('0x2a')][_0xcbea('0x29')]=function(){var _0x2a99ca=[_0xcbea('0x2e'),_0xcbea('0x2f'),_0xcbea('0x30'),_0xcbea('0x31'),_0xcbea('0x32'),_0xcbea('0x33')];for(var _0x409583=0x0;_0x409583<_0x2a99ca[_0xcbea('0x34')];_0x409583+=0x1){var _0xabde1b=this[_0xcbea('0x35')](_0x2a99ca[_0x409583]);if(this[_0x2a99ca[_0x409583]+_0xcbea('0x36')]!==_0xabde1b){this[_0x2a99ca[_0x409583]+_0xcbea('0x37')]=_[_0xcbea('0x38')](moment()[_0xcbea('0x39')]('x'));}this[_0x2a99ca[_0x409583]+'Status']=_0xabde1b;}var _0x40eab0={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this[_0xcbea('0x9')],'chatPause':this[_0xcbea('0xa')],'mailPause':this[_0xcbea('0xb')],'smsPause':this[_0xcbea('0xd')],'faxPause':this[_0xcbea('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xcbea('0x3a')],'chatStatusTime':this[_0xcbea('0x10')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xcbea('0x3b')],'mailStatusTime':this[_0xcbea('0x13')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xcbea('0x15')],'faxStatus':this[_0xcbea('0x16')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xcbea('0x18')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xcbea('0x1a')],'smsStatusTime':this[_0xcbea('0x3c')],'smsCapacity':this[_0xcbea('0x1b')],'smsCurrentCapacity':this[_0xcbea('0x1c')],'whatsappStatus':this[_0xcbea('0x3d')],'whatsappStatusTime':this[_0xcbea('0x1d')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0xcbea('0x1f')],'openchannelStatus':this[_0xcbea('0x20')],'openchannelStatusTime':this[_0xcbea('0x3e')],'openchannelCapacity':this[_0xcbea('0x21')],'openchannelCurrentCapacity':this[_0xcbea('0x22')],'busy':this[_0xcbea('0x23')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0xcbea('0x3f')],'faxWaitingInteractions':this[_0xcbea('0x40')],'mailWaitingInteractions':this[_0xcbea('0x26')],'openchannelWaitingInteractions':this[_0xcbea('0x27')],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this[_0xcbea('0x28')]};var _0x1daa21=md5(JSON[_0xcbea('0x41')](_0x40eab0));if(this[_0xcbea('0x25')]!==_0x1daa21){this[_0xcbea('0x25')]=_0x1daa21;io[_0xcbea('0x42')]('user:save',_0x40eab0);}};module[_0xcbea('0x43')]=Agent; \ No newline at end of file +var _0xdea8=['faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','updateRealtime','prototype','CurrentCapacity','Capacity','idle','chat','fax','getChannelStatus','Status','StatusTime','toNumber','mailWaitingInteractions','whatsappWaitingInteractions','emit','user:save','moment','md5','ioredis','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause'];(function(_0x3552ce,_0x471447){var _0x136334=function(_0x36232e){while(--_0x36232e){_0x3552ce['push'](_0x3552ce['shift']());}};_0x136334(++_0x471447);}(_0xdea8,0xe5));var _0x8dea=function(_0x2f70fb,_0x54fc6b){_0x2f70fb=_0x2f70fb-0x0;var _0x273d29=_0xdea8[_0x2f70fb];return _0x273d29;};'use strict';var _=require('lodash');var moment=require(_0x8dea('0x0'));var md5=require(_0x8dea('0x1'));var Redis=require(_0x8dea('0x2'));var config=require('../../../config/environment');config[_0x8dea('0x3')]=_[_0x8dea('0x4')](config[_0x8dea('0x3')],{'host':_0x8dea('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8dea('0x3')]));function Agent(_0x1291c3){this['id']=_0x1291c3['id']||0x0;this[_0x8dea('0x6')]=_0x1291c3[_0x8dea('0x6')]||'';this[_0x8dea('0x7')]=_0x1291c3[_0x8dea('0x7')]||!![];this[_0x8dea('0x8')]=_0x1291c3['voicePause']||![];this[_0x8dea('0x9')]=_0x1291c3[_0x8dea('0x9')]||![];this[_0x8dea('0xa')]=_0x1291c3[_0x8dea('0xa')]||![];this['faxPause']=_0x1291c3[_0x8dea('0xb')]||![];this['smsPause']=_0x1291c3[_0x8dea('0xc')]||![];this[_0x8dea('0xd')]=_0x1291c3['openchannelPause']||![];this[_0x8dea('0xe')]=_0x8dea('0xf');this[_0x8dea('0x10')]=0x0;this[_0x8dea('0x11')]=_0x1291c3[_0x8dea('0x11')]||0x0;this[_0x8dea('0x12')]=0x0;this[_0x8dea('0x13')]=_0x8dea('0xf');this[_0x8dea('0x14')]=0x0;this[_0x8dea('0x15')]=_0x1291c3['mailCapacity']||0x0;this[_0x8dea('0x16')]=0x0;this[_0x8dea('0x17')]=_0x8dea('0xf');this[_0x8dea('0x18')]=0x0;this['faxCapacity']=_0x1291c3[_0x8dea('0x19')]||0x0;this[_0x8dea('0x1a')]=0x0;this[_0x8dea('0x1b')]=_0x8dea('0xf');this[_0x8dea('0x1c')]=0x0;this[_0x8dea('0x1d')]=_0x1291c3['smsCapacity']||0x0;this[_0x8dea('0x1e')]=0x0;this[_0x8dea('0x1f')]=_0x8dea('0xf');this[_0x8dea('0x20')]=0x0;this[_0x8dea('0x21')]=_0x1291c3[_0x8dea('0x21')]||0x0;this[_0x8dea('0x22')]=0x0;this[_0x8dea('0x23')]=_0x8dea('0xf');this[_0x8dea('0x24')]=0x0;this[_0x8dea('0x25')]=_0x1291c3[_0x8dea('0x25')]||0x0;this[_0x8dea('0x26')]=0x0;this[_0x8dea('0x27')]=![];this[_0x8dea('0x28')]=undefined;this[_0x8dea('0x1')]='';this[_0x8dea('0x29')]={};this[_0x8dea('0x2a')]={};this['mailWaitingInteractions']={};this[_0x8dea('0x2b')]={};this[_0x8dea('0x2c')]={};this['whatsappWaitingInteractions']={};this[_0x8dea('0x2d')]();}Agent[_0x8dea('0x2e')]['getChannelStatus']=function(_0x1a57ea){if(this[_0x1a57ea+_0x8dea('0x2f')]>0x0){if(this[_0x1a57ea+_0x8dea('0x30')]>0x0&&this[_0x1a57ea+_0x8dea('0x2f')]>=this[_0x1a57ea+_0x8dea('0x30')]){return'maxcapacity';}else{return'working';}}else{return _0x8dea('0x31');}};Agent['prototype']['updateRealtime']=function(){var _0x25e2be=['mail',_0x8dea('0x32'),'openchannel',_0x8dea('0x33'),'sms','whatsapp'];for(var _0x5e6521=0x0;_0x5e6521<_0x25e2be['length'];_0x5e6521+=0x1){var _0x2283c0=this[_0x8dea('0x34')](_0x25e2be[_0x5e6521]);if(this[_0x25e2be[_0x5e6521]+_0x8dea('0x35')]!==_0x2283c0){this[_0x25e2be[_0x5e6521]+_0x8dea('0x36')]=_[_0x8dea('0x37')](moment()['format']('x'));}this[_0x25e2be[_0x5e6521]+_0x8dea('0x35')]=_0x2283c0;}var _0x1793fb={'id':this['id'],'name':this['name'],'online':this[_0x8dea('0x7')],'voicePause':this[_0x8dea('0x8')],'chatPause':this['chatPause'],'mailPause':this[_0x8dea('0xa')],'smsPause':this[_0x8dea('0xc')],'faxPause':this[_0x8dea('0xb')],'openchannelPause':this[_0x8dea('0xd')],'chatStatus':this[_0x8dea('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x8dea('0x11')],'chatCurrentCapacity':this[_0x8dea('0x12')],'mailStatus':this[_0x8dea('0x13')],'mailStatusTime':this[_0x8dea('0x14')],'mailCapacity':this[_0x8dea('0x15')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x8dea('0x17')],'faxStatusTime':this[_0x8dea('0x18')],'faxCapacity':this[_0x8dea('0x19')],'faxCurrentCapacity':this[_0x8dea('0x1a')],'smsStatus':this[_0x8dea('0x1b')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x8dea('0x1d')],'smsCurrentCapacity':this[_0x8dea('0x1e')],'whatsappStatus':this[_0x8dea('0x1f')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x8dea('0x21')],'whatsappCurrentCapacity':this[_0x8dea('0x22')],'openchannelStatus':this[_0x8dea('0x23')],'openchannelStatusTime':this[_0x8dea('0x24')],'openchannelCapacity':this[_0x8dea('0x25')],'openchannelCurrentCapacity':this[_0x8dea('0x26')],'busy':this['busy'],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x8dea('0x29')],'faxWaitingInteractions':this[_0x8dea('0x2a')],'mailWaitingInteractions':this[_0x8dea('0x38')],'openchannelWaitingInteractions':this[_0x8dea('0x2b')],'smsWaitingInteractions':this[_0x8dea('0x2c')],'whatsappWaitingInteractions':this[_0x8dea('0x39')]};var _0x58264b=md5(JSON['stringify'](_0x1793fb));if(this[_0x8dea('0x1')]!==_0x58264b){this['md5']=_0x58264b;io[_0x8dea('0x3a')](_0x8dea('0x3b'),_0x1793fb);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index aab0dae..36fda93 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 _0x3a1a=['chat_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','updateRouting','_rr','loggedIn','paused','online','chatPause','available','chat:queue:%s','emit'];(function(_0x112f18,_0x1ec9c9){var _0x1e4f99=function(_0x492ef4){while(--_0x492ef4){_0x112f18['push'](_0x112f18['shift']());}};_0x1e4f99(++_0x1ec9c9);}(_0x3a1a,0x1cd));var _0xa3a1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3a1a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa3a1('0x0'));var md5=require(_0xa3a1('0x1'));var util=require(_0xa3a1('0x2'));var Redis=require(_0xa3a1('0x3'));var config=require('../../../config/environment');config[_0xa3a1('0x4')]=_[_0xa3a1('0x5')](config['redis'],{'host':_0xa3a1('0x6'),'port':0x18eb});var io=require(_0xa3a1('0x7'))(new Redis(config[_0xa3a1('0x4')]));function ChatQueue(_0x47e556){this['id']=_0x47e556['id']||0x0;this['name']=_0x47e556[_0xa3a1('0x8')]||'';this['timeout']=_0x47e556[_0xa3a1('0x9')]||0xa;this[_0xa3a1('0xa')]=_0x47e556[_0xa3a1('0xa')]||_0xa3a1('0xb');this[_0xa3a1('0xc')]=_0x47e556[_0xa3a1('0xc')];this[_0xa3a1('0xd')]={};this['waiting']=0x0;this[_0xa3a1('0x1')]='';this['updateRouting']();this[_0xa3a1('0xe')]();}ChatQueue[_0xa3a1('0xf')][_0xa3a1('0x10')]=function(){var _0x4275e2=this['mapAgentsId'][_0xa3a1('0x11')];this[_0xa3a1('0xd')]=_['map'](this[_0xa3a1('0xc')],'id');this[_0xa3a1('0xd')][_0xa3a1('0x11')]=_0x4275e2;};ChatQueue['prototype'][_0xa3a1('0xe')]=function(){this[_0xa3a1('0x12')]=0x0;this[_0xa3a1('0x13')]=0x0;for(var _0x43d5dc=0x0;_0x43d5dc=0x0?this[_0xa3a1('0x16')]:0x0;var _0x40c401={'id':this['id'],'available':this['available'],'loggedIn':this[_0xa3a1('0x12')],'name':this[_0xa3a1('0x8')],'paused':this[_0xa3a1('0x13')],'waiting':this['waiting']};var _0xc31c7b=md5(JSON['stringify'](_0x40c401));if(this[_0xa3a1('0x1')]!==_0xc31c7b){this[_0xa3a1('0x1')]=_0xc31c7b;io['to'](util['format'](_0xa3a1('0x17'),_0x40c401[_0xa3a1('0x8')]))[_0xa3a1('0x18')](_0xa3a1('0x19'),_0x40c401);}};module[_0xa3a1('0x1a')]=ChatQueue; \ No newline at end of file +var _0x3a46=['defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','chatPause','available','chat:queue:%s','emit','exports','lodash','util','ioredis','../../../config/environment','redis'];(function(_0x49684e,_0x9a24fb){var _0x54062f=function(_0x4e410a){while(--_0x4e410a){_0x49684e['push'](_0x49684e['shift']());}};_0x54062f(++_0x9a24fb);}(_0x3a46,0xc6));var _0x63a4=function(_0x3f50fb,_0x178a66){_0x3f50fb=_0x3f50fb-0x0;var _0xfb3678=_0x3a46[_0x3f50fb];return _0xfb3678;};'use strict';var _=require(_0x63a4('0x0'));var md5=require('md5');var util=require(_0x63a4('0x1'));var Redis=require(_0x63a4('0x2'));var config=require(_0x63a4('0x3'));config[_0x63a4('0x4')]=_[_0x63a4('0x5')](config['redis'],{'host':_0x63a4('0x6'),'port':0x18eb});var io=require(_0x63a4('0x7'))(new Redis(config[_0x63a4('0x4')]));function ChatQueue(_0xb68d79){this['id']=_0xb68d79['id']||0x0;this[_0x63a4('0x8')]=_0xb68d79[_0x63a4('0x8')]||'';this[_0x63a4('0x9')]=_0xb68d79[_0x63a4('0x9')]||0xa;this[_0x63a4('0xa')]=_0xb68d79[_0x63a4('0xa')]||_0x63a4('0xb');this[_0x63a4('0xc')]=_0xb68d79['Agents'];this[_0x63a4('0xd')]={};this[_0x63a4('0xe')]=0x0;this[_0x63a4('0xf')]='';this[_0x63a4('0x10')]();this[_0x63a4('0x11')]();}ChatQueue[_0x63a4('0x12')][_0x63a4('0x10')]=function(){var _0x199f33=this[_0x63a4('0xd')][_0x63a4('0x13')];this[_0x63a4('0xd')]=_[_0x63a4('0x14')](this[_0x63a4('0xc')],'id');this[_0x63a4('0xd')][_0x63a4('0x13')]=_0x199f33;};ChatQueue[_0x63a4('0x12')][_0x63a4('0x11')]=function(){this[_0x63a4('0x15')]=0x0;this[_0x63a4('0x16')]=0x0;for(var _0x3ee769=0x0;_0x3ee769=0x0?this['available']:0x0;var _0x4dbab0={'id':this['id'],'available':this['available'],'loggedIn':this[_0x63a4('0x15')],'name':this[_0x63a4('0x8')],'paused':this[_0x63a4('0x16')],'waiting':this[_0x63a4('0xe')]};var _0x5d186d=md5(JSON['stringify'](_0x4dbab0));if(this[_0x63a4('0xf')]!==_0x5d186d){this['md5']=_0x5d186d;io['to'](util['format'](_0x63a4('0x1a'),_0x4dbab0['name']))[_0x63a4('0x1b')]('chat_queue:save',_0x4dbab0);}};module[_0x63a4('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index a8c1802..1664f0c 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 _0x2e4b=['available','format','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','faxPause','paused'];(function(_0x318229,_0x8461b1){var _0x4958d7=function(_0x2fa180){while(--_0x2fa180){_0x318229['push'](_0x318229['shift']());}};_0x4958d7(++_0x8461b1);}(_0x2e4b,0xc9));var _0xb2e4=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0x2e4b[_0x59bcb1];return _0x4a737f;};'use strict';var _=require(_0xb2e4('0x0'));var md5=require(_0xb2e4('0x1'));var util=require(_0xb2e4('0x2'));var Redis=require(_0xb2e4('0x3'));var config=require(_0xb2e4('0x4'));config['redis']=_[_0xb2e4('0x5')](config['redis'],{'host':_0xb2e4('0x6'),'port':0x18eb});var io=require(_0xb2e4('0x7'))(new Redis(config['redis']));function FaxQueue(_0x1dd20c){this['id']=_0x1dd20c['id']||0x0;this[_0xb2e4('0x8')]=_0x1dd20c['name']||'';this[_0xb2e4('0x9')]=_0x1dd20c['timeout']||0xa;this[_0xb2e4('0xa')]=_0x1dd20c[_0xb2e4('0xa')]||'beepall';this[_0xb2e4('0xb')]=_0x1dd20c[_0xb2e4('0xb')];this[_0xb2e4('0xc')]={};this['waiting']=0x0;this[_0xb2e4('0x1')]='';this[_0xb2e4('0xd')]();this[_0xb2e4('0xe')]();}FaxQueue[_0xb2e4('0xf')]['updateRouting']=function(){var _0x21e62b=this[_0xb2e4('0xc')][_0xb2e4('0x10')];this[_0xb2e4('0xc')]=_[_0xb2e4('0x11')](this['Agents'],'id');this['mapAgentsId'][_0xb2e4('0x10')]=_0x21e62b;};FaxQueue['prototype'][_0xb2e4('0xe')]=function(){this[_0xb2e4('0x12')]=0x0;this['paused']=0x0;for(var _0x182837=0x0;_0x182837=0x0?this[_0xb2e4('0x17')]:0x0;var _0x405183={'id':this['id'],'available':this['available'],'loggedIn':this[_0xb2e4('0x12')],'name':this[_0xb2e4('0x8')],'paused':this[_0xb2e4('0x16')],'waiting':this['waiting']};var _0x77a135=md5(JSON['stringify'](_0x405183));if(this[_0xb2e4('0x1')]!==_0x77a135){this[_0xb2e4('0x1')]=_0x77a135;io['to'](util[_0xb2e4('0x18')]('fax:queue:%s',_0x405183[_0xb2e4('0x8')]))[_0xb2e4('0x19')](_0xb2e4('0x1a'),_0x405183);}};module[_0xb2e4('0x1b')]=FaxQueue; \ No newline at end of file +var _0x1863=['exports','lodash','util','ioredis','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','md5','updateRouting','updateRealtime','_rr','mapAgentsId','prototype','loggedIn','paused','length','faxPause','available','waiting','stringify','format','emit','fax_queue:save'];(function(_0x549966,_0x1bb990){var _0x4e1609=function(_0x2fd25c){while(--_0x2fd25c){_0x549966['push'](_0x549966['shift']());}};_0x4e1609(++_0x1bb990);}(_0x1863,0x71));var _0x3186=function(_0x1344d6,_0x2181e6){_0x1344d6=_0x1344d6-0x0;var _0xf45b24=_0x1863[_0x1344d6];return _0xf45b24;};'use strict';var _=require(_0x3186('0x0'));var md5=require('md5');var util=require(_0x3186('0x1'));var Redis=require(_0x3186('0x2'));var config=require('../../../config/environment');config[_0x3186('0x3')]=_[_0x3186('0x4')](config[_0x3186('0x3')],{'host':_0x3186('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3186('0x3')]));function FaxQueue(_0x256ea7){this['id']=_0x256ea7['id']||0x0;this['name']=_0x256ea7[_0x3186('0x6')]||'';this[_0x3186('0x7')]=_0x256ea7[_0x3186('0x7')]||0xa;this[_0x3186('0x8')]=_0x256ea7['strategy']||_0x3186('0x9');this['Agents']=_0x256ea7[_0x3186('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x3186('0xb')]='';this[_0x3186('0xc')]();this[_0x3186('0xd')]();}FaxQueue['prototype']['updateRouting']=function(){var _0x566050=this['mapAgentsId'][_0x3186('0xe')];this[_0x3186('0xf')]=_['map'](this[_0x3186('0xa')],'id');this[_0x3186('0xf')][_0x3186('0xe')]=_0x566050;};FaxQueue[_0x3186('0x10')]['updateRealtime']=function(){this[_0x3186('0x11')]=0x0;this[_0x3186('0x12')]=0x0;for(var _0x4d3614=0x0;_0x4d3614=0x0?this['available']:0x0;var _0x12eb74={'id':this['id'],'available':this[_0x3186('0x15')],'loggedIn':this[_0x3186('0x11')],'name':this[_0x3186('0x6')],'paused':this[_0x3186('0x12')],'waiting':this[_0x3186('0x16')]};var _0xc171fc=md5(JSON[_0x3186('0x17')](_0x12eb74));if(this[_0x3186('0xb')]!==_0xc171fc){this[_0x3186('0xb')]=_0xc171fc;io['to'](util[_0x3186('0x18')]('fax:queue:%s',_0x12eb74[_0x3186('0x6')]))[_0x3186('0x19')](_0x3186('0x1a'),_0x12eb74);}};module[_0x3186('0x1b')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 7146721..bbd1bb5 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 _0x410c=['name','Intervals','exports'];(function(_0x2e9187,_0x3763f6){var _0x1fc3a8=function(_0xb30d96){while(--_0xb30d96){_0x2e9187['push'](_0x2e9187['shift']());}};_0x1fc3a8(++_0x3763f6);}(_0x410c,0xc3));var _0xc410=function(_0x1cbd67,_0x58b7b0){_0x1cbd67=_0x1cbd67-0x0;var _0x221375=_0x410c[_0x1cbd67];return _0x221375;};'use strict';function Interval(_0x4a4c8f){this['id']=_0x4a4c8f['id']||0x0;this['name']=_0x4a4c8f[_0xc410('0x0')]||'';this[_0xc410('0x1')]=_0x4a4c8f[_0xc410('0x1')]||{};}module[_0xc410('0x2')]=Interval; \ No newline at end of file +var _0xc66c=['name','Intervals'];(function(_0x5f12c1,_0x17c8ae){var _0x424644=function(_0x5cbc96){while(--_0x5cbc96){_0x5f12c1['push'](_0x5f12c1['shift']());}};_0x424644(++_0x17c8ae);}(_0xc66c,0x6e));var _0xcc66=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xc66c[_0x4cf98e];return _0x1623ac;};'use strict';function Interval(_0x28652b){this['id']=_0x28652b['id']||0x0;this[_0xcc66('0x0')]=_0x28652b[_0xcc66('0x0')]||'';this['Intervals']=_0x28652b[_0xcc66('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 313f2e1..f19c631 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 _0xe26f=['mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','paused','length','online','available','loggedIn','stringify'];(function(_0xe1c059,_0x14c48a){var _0x2ff4c6=function(_0xa84df5){while(--_0xa84df5){_0xe1c059['push'](_0xe1c059['shift']());}};_0x2ff4c6(++_0x14c48a);}(_0xe26f,0x14e));var _0xfe26=function(_0x44558e,_0x254077){_0x44558e=_0x44558e-0x0;var _0x5d270b=_0xe26f[_0x44558e];return _0x5d270b;};'use strict';var _=require(_0xfe26('0x0'));var md5=require(_0xfe26('0x1'));var util=require(_0xfe26('0x2'));var Redis=require(_0xfe26('0x3'));var config=require('../../../config/environment');config['redis']=_[_0xfe26('0x4')](config[_0xfe26('0x5')],{'host':_0xfe26('0x6'),'port':0x18eb});var io=require(_0xfe26('0x7'))(new Redis(config[_0xfe26('0x5')]));function MailQueue(_0x259f25){this['id']=_0x259f25['id']||0x0;this['name']=_0x259f25[_0xfe26('0x8')]||'';this[_0xfe26('0x9')]=_0x259f25['timeout']||0xa;this[_0xfe26('0xa')]=_0x259f25['strategy']||_0xfe26('0xb');this[_0xfe26('0xc')]=_0x259f25['Agents'];this[_0xfe26('0xd')]={};this[_0xfe26('0xe')]=0x0;this['md5']='';this['updateRouting']();this[_0xfe26('0xf')]();}MailQueue[_0xfe26('0x10')][_0xfe26('0x11')]=function(){var _0x32902f=this[_0xfe26('0xd')][_0xfe26('0x12')];this[_0xfe26('0xd')]=_[_0xfe26('0x13')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x32902f;};MailQueue['prototype'][_0xfe26('0xf')]=function(){this['loggedIn']=0x0;this[_0xfe26('0x14')]=0x0;for(var _0x4d4135=0x0;_0x4d4135=0x0?this[_0xfe26('0x17')]:0x0;var _0x52ffc2={'id':this['id'],'available':this[_0xfe26('0x17')],'loggedIn':this[_0xfe26('0x18')],'name':this['name'],'paused':this[_0xfe26('0x14')],'waiting':this[_0xfe26('0xe')]};var _0x563a4e=md5(JSON[_0xfe26('0x19')](_0x52ffc2));if(this[_0xfe26('0x1')]!==_0x563a4e){this[_0xfe26('0x1')]=_0x563a4e;io['to'](util['format'](_0xfe26('0x1a'),_0x52ffc2['name']))[_0xfe26('0x1b')](_0xfe26('0x1c'),_0x52ffc2);}};module[_0xfe26('0x1d')]=MailQueue; \ No newline at end of file +var _0xe12a=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','paused','length','loggedIn','available','stringify','format','mail:queue:%s','exports','md5','util','../../../config/environment','redis','defaults'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe12a,0x97));var _0xae12=function(_0x1c3b79,_0x3cbf32){_0x1c3b79=_0x1c3b79-0x0;var _0xb8bff0=_0xe12a[_0x1c3b79];return _0xb8bff0;};'use strict';var _=require('lodash');var md5=require(_0xae12('0x0'));var util=require(_0xae12('0x1'));var Redis=require('ioredis');var config=require(_0xae12('0x2'));config[_0xae12('0x3')]=_[_0xae12('0x4')](config['redis'],{'host':_0xae12('0x5'),'port':0x18eb});var io=require(_0xae12('0x6'))(new Redis(config[_0xae12('0x3')]));function MailQueue(_0xb651c4){this['id']=_0xb651c4['id']||0x0;this['name']=_0xb651c4[_0xae12('0x7')]||'';this[_0xae12('0x8')]=_0xb651c4['timeout']||0xa;this[_0xae12('0x9')]=_0xb651c4[_0xae12('0x9')]||_0xae12('0xa');this['Agents']=_0xb651c4[_0xae12('0xb')];this[_0xae12('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0xae12('0xd')]();this[_0xae12('0xe')]();}MailQueue[_0xae12('0xf')][_0xae12('0xd')]=function(){var _0x2c2278=this[_0xae12('0xc')]['_rr'];this[_0xae12('0xc')]=_[_0xae12('0x10')](this[_0xae12('0xb')],'id');this[_0xae12('0xc')][_0xae12('0x11')]=_0x2c2278;};MailQueue[_0xae12('0xf')][_0xae12('0xe')]=function(){this['loggedIn']=0x0;this[_0xae12('0x12')]=0x0;for(var _0xac01a7=0x0;_0xac01a7=0x0?this[_0xae12('0x15')]:0x0;var _0x274222={'id':this['id'],'available':this['available'],'loggedIn':this[_0xae12('0x14')],'name':this['name'],'paused':this[_0xae12('0x12')],'waiting':this['waiting']};var _0x504301=md5(JSON[_0xae12('0x16')](_0x274222));if(this[_0xae12('0x0')]!==_0x504301){this[_0xae12('0x0')]=_0x504301;io['to'](util[_0xae12('0x17')](_0xae12('0x18'),_0x274222[_0xae12('0x7')]))['emit']('mail_queue:save',_0x274222);}};module[_0xae12('0x19')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 27eecc8..9056411 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 _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x55a51e,_0x4eedbd){var _0x496d0e=function(_0x1a815e){while(--_0x1a815e){_0x55a51e['push'](_0x55a51e['shift']());}};_0x496d0e(++_0x4eedbd);}(_0x5fc3,0xa8));var _0x35fc=function(_0x101a17,_0x5d047a){_0x101a17=_0x101a17-0x0;var _0x3b76ee=_0x5fc3[_0x101a17];return _0x3b76ee;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0xc88e0e,_0x130618){var _0xd89aa8=function(_0x2b6948){while(--_0x2b6948){_0xc88e0e['push'](_0xc88e0e['shift']());}};_0xd89aa8(++_0x130618);}(_0x5fc3,0xa8));var _0x35fc=function(_0x51beba,_0x202d19){_0x51beba=_0x51beba-0x0;var _0x167ee0=_0x5fc3[_0x51beba];return _0x167ee0;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index e00584c..c9b8807 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 _0x6953=['name','timeout','strategy','Agents','mapAgentsId','updateRouting','prototype','_rr','updateRealtime','loggedIn','paused','length','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','redis','localhost','socket.io-emitter'];(function(_0x4ee557,_0xcf8050){var _0x1e377f=function(_0x4a455f){while(--_0x4a455f){_0x4ee557['push'](_0x4ee557['shift']());}};_0x1e377f(++_0xcf8050);}(_0x6953,0x91));var _0x3695=function(_0x1ab181,_0x43ee89){_0x1ab181=_0x1ab181-0x0;var _0x1fd4a9=_0x6953[_0x1ab181];return _0x1fd4a9;};'use strict';var _=require(_0x3695('0x0'));var md5=require(_0x3695('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x3695('0x2')]=_['defaults'](config[_0x3695('0x2')],{'host':_0x3695('0x3'),'port':0x18eb});var io=require(_0x3695('0x4'))(new Redis(config['redis']));function SmsQueue(_0xd0f9a5){this['id']=_0xd0f9a5['id']||0x0;this['name']=_0xd0f9a5[_0x3695('0x5')]||'';this[_0x3695('0x6')]=_0xd0f9a5[_0x3695('0x6')]||0xa;this[_0x3695('0x7')]=_0xd0f9a5[_0x3695('0x7')]||'beepall';this[_0x3695('0x8')]=_0xd0f9a5['Agents'];this[_0x3695('0x9')]={};this['waiting']=0x0;this['md5']='';this[_0x3695('0xa')]();this['updateRealtime']();}SmsQueue[_0x3695('0xb')][_0x3695('0xa')]=function(){var _0x2a7ab7=this[_0x3695('0x9')][_0x3695('0xc')];this[_0x3695('0x9')]=_['map'](this[_0x3695('0x8')],'id');this[_0x3695('0x9')][_0x3695('0xc')]=_0x2a7ab7;};SmsQueue[_0x3695('0xb')][_0x3695('0xd')]=function(){this[_0x3695('0xe')]=0x0;this[_0x3695('0xf')]=0x0;for(var _0x4df429=0x0;_0x4df429=0x0?this['available']:0x0;var _0x1082db={'id':this['id'],'available':this[_0x3695('0x12')],'loggedIn':this[_0x3695('0xe')],'name':this[_0x3695('0x5')],'paused':this[_0x3695('0xf')],'waiting':this['waiting']};var _0x1bb921=md5(JSON[_0x3695('0x13')](_0x1082db));if(this[_0x3695('0x1')]!==_0x1bb921){this[_0x3695('0x1')]=_0x1bb921;io['to'](util[_0x3695('0x14')](_0x3695('0x15'),_0x1082db[_0x3695('0x5')]))[_0x3695('0x16')](_0x3695('0x17'),_0x1082db);}};module[_0x3695('0x18')]=SmsQueue; \ No newline at end of file +var _0xf257=['Agents','waiting','md5','prototype','mapAgentsId','_rr','map','updateRealtime','paused','length','smsPause','available','loggedIn','format','sms:queue:%s','emit','sms_queue:save','exports','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x3e1b11,_0x2882ad){var _0x1c9623=function(_0x42626e){while(--_0x42626e){_0x3e1b11['push'](_0x3e1b11['shift']());}};_0x1c9623(++_0x2882ad);}(_0xf257,0x82));var _0x7f25=function(_0x3a6930,_0x1d329e){_0x3a6930=_0x3a6930-0x0;var _0x9ebbe8=_0xf257[_0x3a6930];return _0x9ebbe8;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x7f25('0x0'));var Redis=require(_0x7f25('0x1'));var config=require(_0x7f25('0x2'));config[_0x7f25('0x3')]=_['defaults'](config[_0x7f25('0x3')],{'host':_0x7f25('0x4'),'port':0x18eb});var io=require(_0x7f25('0x5'))(new Redis(config[_0x7f25('0x3')]));function SmsQueue(_0x2829d7){this['id']=_0x2829d7['id']||0x0;this[_0x7f25('0x6')]=_0x2829d7[_0x7f25('0x6')]||'';this[_0x7f25('0x7')]=_0x2829d7[_0x7f25('0x7')]||0xa;this[_0x7f25('0x8')]=_0x2829d7[_0x7f25('0x8')]||_0x7f25('0x9');this[_0x7f25('0xa')]=_0x2829d7[_0x7f25('0xa')];this['mapAgentsId']={};this[_0x7f25('0xb')]=0x0;this[_0x7f25('0xc')]='';this['updateRouting']();this['updateRealtime']();}SmsQueue[_0x7f25('0xd')]['updateRouting']=function(){var _0x1d9f33=this[_0x7f25('0xe')][_0x7f25('0xf')];this[_0x7f25('0xe')]=_[_0x7f25('0x10')](this[_0x7f25('0xa')],'id');this[_0x7f25('0xe')]['_rr']=_0x1d9f33;};SmsQueue['prototype'][_0x7f25('0x11')]=function(){this['loggedIn']=0x0;this[_0x7f25('0x12')]=0x0;for(var _0x19b76b=0x0;_0x19b76b=0x0?this[_0x7f25('0x15')]:0x0;var _0x5e0067={'id':this['id'],'available':this[_0x7f25('0x15')],'loggedIn':this[_0x7f25('0x16')],'name':this[_0x7f25('0x6')],'paused':this[_0x7f25('0x12')],'waiting':this[_0x7f25('0xb')]};var _0x16f9e3=md5(JSON['stringify'](_0x5e0067));if(this['md5']!==_0x16f9e3){this[_0x7f25('0xc')]=_0x16f9e3;io['to'](util[_0x7f25('0x17')](_0x7f25('0x18'),_0x5e0067[_0x7f25('0x6')]))[_0x7f25('0x19')](_0x7f25('0x1a'),_0x5e0067);}};module[_0x7f25('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 4215488..0c0c2c1 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 _0x6d80=['loggedIn','length','online','whatsappPause','paused','available','stringify','format','whatsapp:queue:%s','emit','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','md5','updateRouting','updateRealtime','_rr','prototype'];(function(_0x28052b,_0x296e56){var _0x124155=function(_0xaa457a){while(--_0xaa457a){_0x28052b['push'](_0x28052b['shift']());}};_0x124155(++_0x296e56);}(_0x6d80,0x72));var _0x06d8=function(_0x2b7064,_0x4a1801){_0x2b7064=_0x2b7064-0x0;var _0x5258ca=_0x6d80[_0x2b7064];return _0x5258ca;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x06d8('0x0'));var Redis=require(_0x06d8('0x1'));var config=require(_0x06d8('0x2'));config[_0x06d8('0x3')]=_['defaults'](config['redis'],{'host':_0x06d8('0x4'),'port':0x18eb});var io=require(_0x06d8('0x5'))(new Redis(config[_0x06d8('0x3')]));function WhatsappQueue(_0x14b9d1){this['id']=_0x14b9d1['id']||0x0;this[_0x06d8('0x6')]=_0x14b9d1[_0x06d8('0x6')]||'';this[_0x06d8('0x7')]=_0x14b9d1[_0x06d8('0x7')]||0xa;this['strategy']=_0x14b9d1[_0x06d8('0x8')]||'beepall';this['Agents']=_0x14b9d1[_0x06d8('0x9')];this[_0x06d8('0xa')]={};this['waiting']=0x0;this[_0x06d8('0xb')]='';this[_0x06d8('0xc')]();this[_0x06d8('0xd')]();}WhatsappQueue['prototype'][_0x06d8('0xc')]=function(){var _0x54d339=this[_0x06d8('0xa')][_0x06d8('0xe')];this[_0x06d8('0xa')]=_['map'](this[_0x06d8('0x9')],'id');this[_0x06d8('0xa')][_0x06d8('0xe')]=_0x54d339;};WhatsappQueue[_0x06d8('0xf')][_0x06d8('0xd')]=function(){this[_0x06d8('0x10')]=0x0;this['paused']=0x0;for(var _0x467359=0x0;_0x467359=0x0?this[_0x06d8('0x15')]:0x0;var _0x1409a7={'id':this['id'],'available':this[_0x06d8('0x15')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x06d8('0x14')],'waiting':this['waiting']};var _0x34081b=md5(JSON[_0x06d8('0x16')](_0x1409a7));if(this[_0x06d8('0xb')]!==_0x34081b){this[_0x06d8('0xb')]=_0x34081b;io['to'](util[_0x06d8('0x17')](_0x06d8('0x18'),_0x1409a7[_0x06d8('0x6')]))[_0x06d8('0x19')]('whatsapp_queue:save',_0x1409a7);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x22fd=['updateRouting','updateRealtime','prototype','_rr','paused','online','loggedIn','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','name','timeout','beepall','Agents','mapAgentsId','waiting'];(function(_0x326e79,_0x33dc91){var _0x37eb89=function(_0xbaef25){while(--_0xbaef25){_0x326e79['push'](_0x326e79['shift']());}};_0x37eb89(++_0x33dc91);}(_0x22fd,0x10b));var _0xd22f=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x22fd[_0x1b4b23];return _0x2a325b;};'use strict';var _=require(_0xd22f('0x0'));var md5=require(_0xd22f('0x1'));var util=require(_0xd22f('0x2'));var Redis=require(_0xd22f('0x3'));var config=require(_0xd22f('0x4'));config[_0xd22f('0x5')]=_['defaults'](config[_0xd22f('0x5')],{'host':_0xd22f('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd22f('0x5')]));function WhatsappQueue(_0x3482ae){this['id']=_0x3482ae['id']||0x0;this[_0xd22f('0x7')]=_0x3482ae['name']||'';this['timeout']=_0x3482ae[_0xd22f('0x8')]||0xa;this['strategy']=_0x3482ae['strategy']||_0xd22f('0x9');this[_0xd22f('0xa')]=_0x3482ae['Agents'];this[_0xd22f('0xb')]={};this[_0xd22f('0xc')]=0x0;this[_0xd22f('0x1')]='';this[_0xd22f('0xd')]();this[_0xd22f('0xe')]();}WhatsappQueue[_0xd22f('0xf')][_0xd22f('0xd')]=function(){var _0x53b9c2=this[_0xd22f('0xb')][_0xd22f('0x10')];this[_0xd22f('0xb')]=_['map'](this[_0xd22f('0xa')],'id');this['mapAgentsId'][_0xd22f('0x10')]=_0x53b9c2;};WhatsappQueue[_0xd22f('0xf')][_0xd22f('0xe')]=function(){this['loggedIn']=0x0;this[_0xd22f('0x11')]=0x0;for(var _0x13e377=0x0;_0x13e377=0x0?this['available']:0x0;var _0x530ad9={'id':this['id'],'available':this[_0xd22f('0x15')],'loggedIn':this[_0xd22f('0x13')],'name':this['name'],'paused':this[_0xd22f('0x11')],'waiting':this[_0xd22f('0xc')]};var _0x1a5dd1=md5(JSON[_0xd22f('0x16')](_0x530ad9));if(this[_0xd22f('0x1')]!==_0x1a5dd1){this[_0xd22f('0x1')]=_0x1a5dd1;io['to'](util[_0xd22f('0x17')](_0xd22f('0x18'),_0x530ad9['name']))[_0xd22f('0x19')](_0xd22f('0x1a'),_0x530ad9);}};module[_0xd22f('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 fb5f57d..3523a39 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(_0x3c832a,_0x3fd924){var _0x780451=function(_0x3ae4d6){while(--_0x3ae4d6){_0x3c832a['push'](_0x3c832a['shift']());}};_0x780451(++_0x3fd924);}(_0xb10b,0x12a));var _0xbb10=function(_0x4d2aea,_0x4a8f11){_0x4d2aea=_0x4d2aea-0x0;var _0x1715b8=_0xb10b[_0x4d2aea];return _0x1715b8;};'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 _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(_0x51a9e8,_0x5a490d){var _0x50f18d=function(_0xc1acfd){while(--_0xc1acfd){_0x51a9e8['push'](_0x51a9e8['shift']());}};_0x50f18d(++_0x5a490d);}(_0xb10b,0x12a));var _0xbb10=function(_0x1df7b8,_0x2fe5e5){_0x1df7b8=_0x1df7b8-0x0;var _0x29d911=_0xb10b[_0x1df7b8];return _0x29d911;};'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 diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 58daae9..79dd139 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 _0x8188=['update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','../client'];(function(_0x58945b,_0x1dfcf5){var _0x13ddac=function(_0x471444){while(--_0x471444){_0x58945b['push'](_0x58945b['shift']());}};_0x13ddac(++_0x1dfcf5);}(_0x8188,0x18e));var _0x8818=function(_0x16f9f6,_0x300c07){_0x16f9f6=_0x16f9f6-0x0;var _0x24f2ff=_0x8188[_0x16f9f6];return _0x24f2ff;};'use strict';var client=require(_0x8818('0x0'));exports[_0x8818('0x1')]=function(_0x20db80,_0x25bb7b){return client[_0x8818('0x2')](_0x8818('0x3'),{'body':_0x25bb7b,'options':{'where':{'id':_0x20db80}},'log':_0x8818('0x4')});};exports[_0x8818('0x5')]=function(_0x5b13a6,_0x4765bc){return client[_0x8818('0x2')](_0x8818('0x6'),{'body':_0x4765bc,'options':{'where':{'id':_0x5b13a6}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x3a9b=['addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a9b,0x1f3));var _0xb3a9=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x3a9b[_0x36884e];return _0x1cc367;};'use strict';var client=require(_0xb3a9('0x0'));exports[_0xb3a9('0x1')]=function(_0x539634,_0x410660){return client[_0xb3a9('0x2')](_0xb3a9('0x3'),{'body':_0x410660,'options':{'where':{'id':_0x539634}},'log':_0xb3a9('0x4')});};exports['addTags']=function(_0x5a3799,_0x3c5dc4){return client[_0xb3a9('0x2')]('AddTagsToChatInteraction',{'body':_0x3c5dc4,'options':{'where':{'id':_0x5a3799}},'log':_0xb3a9('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index ed6abc6..41e11e1 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. * // * * // ************************************************************************* -'use strict';var client=require('../client');exports['create']=function(_0x3e5057){return client['Request']('CreateChatMessage',{'body':_0x3e5057,'log':'createChatMessage'});}; \ No newline at end of file +var _0x7aab=['Request'];(function(_0x507eea,_0x47f2de){var _0x4d6e1b=function(_0x30af34){while(--_0x30af34){_0x507eea['push'](_0x507eea['shift']());}};_0x4d6e1b(++_0x47f2de);}(_0x7aab,0x96));var _0xb7aa=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7aab[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports['create']=function(_0x5c1c69){return client[_0xb7aa('0x0')]('CreateChatMessage',{'body':_0x5c1c69,'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 6a0690c..0968624 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 _0x1354=['name','timeout','strategy','Agents','online','../client','getChatQueues','Request','GetChatQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1354,0x95));var _0x4135=function(_0x39d6a8,_0xc9c91a){_0x39d6a8=_0x39d6a8-0x0;var _0x93f3db=_0x1354[_0x39d6a8];return _0x93f3db;};'use strict';var client=require(_0x4135('0x0'));exports[_0x4135('0x1')]=function(){return function(){return client[_0x4135('0x2')](_0x4135('0x3'),{'options':{'raw':![],'attributes':['id',_0x4135('0x4'),_0x4135('0x5'),_0x4135('0x6')],'include':[{'model':'User','as':_0x4135('0x7'),'attributes':['id',_0x4135('0x4'),_0x4135('0x8'),'chatPause']}]},'log':_0x4135('0x1')});};}; \ No newline at end of file +var _0x7b83=['getChatQueues','Request','timeout','strategy','User','name','online','chatPause','../client'];(function(_0x43a1b8,_0x1c90c8){var _0x324ecc=function(_0x53a93b){while(--_0x53a93b){_0x43a1b8['push'](_0x43a1b8['shift']());}};_0x324ecc(++_0x1c90c8);}(_0x7b83,0xa1));var _0x37b8=function(_0x22e7ee,_0xd43e98){_0x22e7ee=_0x22e7ee-0x0;var _0xbf4677=_0x7b83[_0x22e7ee];return _0xbf4677;};'use strict';var client=require(_0x37b8('0x0'));exports[_0x37b8('0x1')]=function(){return function(){return client[_0x37b8('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id','name',_0x37b8('0x3'),_0x37b8('0x4')],'include':[{'model':_0x37b8('0x5'),'as':'Agents','attributes':['id',_0x37b8('0x6'),_0x37b8('0x7'),_0x37b8('0x8')]}]},'log':_0x37b8('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index ad83c6e..daca51b 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 _0xc576=['../client','create','Request','CreateChatQueueReport','UpdateChatQueueReport'];(function(_0x380af2,_0x36cf66){var _0x1789dc=function(_0x37b604){while(--_0x37b604){_0x380af2['push'](_0x380af2['shift']());}};_0x1789dc(++_0x36cf66);}(_0xc576,0x1ea));var _0x6c57=function(_0x19d0b6,_0x85209a){_0x19d0b6=_0x19d0b6-0x0;var _0x16060b=_0xc576[_0x19d0b6];return _0x16060b;};'use strict';var client=require(_0x6c57('0x0'));exports[_0x6c57('0x1')]=function(_0x8a70a3){return client[_0x6c57('0x2')](_0x6c57('0x3'),{'body':_0x8a70a3,'log':'CreateChatQueueReport'});};exports['update']=function(_0x10a252,_0x4e5df7){return client[_0x6c57('0x2')](_0x6c57('0x4'),{'body':_0x4e5df7,'options':{'where':{'uniqueid':_0x10a252},'order':[['id','DESC']],'limit':0x1},'log':_0x6c57('0x4')});}; \ No newline at end of file +var _0xb04a=['CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create','Request'];(function(_0x4d7892,_0x4984ec){var _0x2616a9=function(_0x4983e7){while(--_0x4983e7){_0x4d7892['push'](_0x4d7892['shift']());}};_0x2616a9(++_0x4984ec);}(_0xb04a,0xcf));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xab04('0x0'));exports[_0xab04('0x1')]=function(_0x44557d){return client[_0xab04('0x2')]('CreateChatQueueReport',{'body':_0x44557d,'log':_0xab04('0x3')});};exports[_0xab04('0x4')]=function(_0x20639d,_0x4b8c0f){return client[_0xab04('0x2')](_0xab04('0x5'),{'body':_0x4b8c0f,'options':{'where':{'uniqueid':_0x20639d},'order':[['id',_0xab04('0x6')]],'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 8996c6a..ccfc823 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x7a54,0x106));var _0x47a5=function(_0x4bc233,_0x5e94f2){_0x4bc233=_0x4bc233-0x0;var _0xafb2c8=_0x7a54[_0x4bc233];return _0xafb2c8;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x525b28,_0x5cf5a0){var _0x180178=function(_0x43e066){while(--_0x43e066){_0x525b28['push'](_0x525b28['shift']());}};_0x180178(++_0x5cf5a0);}(_0x7a54,0x106));var _0x47a5=function(_0x2e4776,_0x598a93){_0x2e4776=_0x2e4776-0x0;var _0x17479c=_0x7a54[_0x2e4776];return _0x17479c;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 7d4dec6..71ac698 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 _0xda9c=['../client','Request','CreateFaxMessage','createFaxMessage'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xda9c,0xfc));var _0xcda9=function(_0x5278ed,_0x75b0c){_0x5278ed=_0x5278ed-0x0;var _0x160945=_0xda9c[_0x5278ed];return _0x160945;};'use strict';var client=require(_0xcda9('0x0'));exports['create']=function(_0x439048){return client[_0xcda9('0x1')](_0xcda9('0x2'),{'body':_0x439048,'log':_0xcda9('0x3')});}; \ No newline at end of file +var _0x0fb4=['Request','../client','create'];(function(_0x4a08bc,_0x107ef3){var _0x576c83=function(_0x243cc6){while(--_0x243cc6){_0x4a08bc['push'](_0x4a08bc['shift']());}};_0x576c83(++_0x107ef3);}(_0x0fb4,0x169));var _0x40fb=function(_0x2675da,_0x5a250e){_0x2675da=_0x2675da-0x0;var _0x5e6153=_0x0fb4[_0x2675da];return _0x5e6153;};'use strict';var client=require(_0x40fb('0x0'));exports[_0x40fb('0x1')]=function(_0x297fb6){return client[_0x40fb('0x2')]('CreateFaxMessage',{'body':_0x297fb6,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 9e95189..e1aad01 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 _0x80eb=['Request','GetFaxQueue','name','strategy','User','Agents','online','faxPause','getFaxQueues','../client'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x80eb,0x10d));var _0xb80e=function(_0x5f8e8b,_0x1f9f15){_0x5f8e8b=_0x5f8e8b-0x0;var _0x1c4a04=_0x80eb[_0x5f8e8b];return _0x1c4a04;};'use strict';var client=require(_0xb80e('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xb80e('0x1')](_0xb80e('0x2'),{'options':{'raw':![],'attributes':['id',_0xb80e('0x3'),'timeout',_0xb80e('0x4')],'include':[{'model':_0xb80e('0x5'),'as':_0xb80e('0x6'),'attributes':['id',_0xb80e('0x3'),_0xb80e('0x7'),_0xb80e('0x8')]}]},'log':_0xb80e('0x9')});};}; \ No newline at end of file +var _0x19bb=['Agents','online','../client','getFaxQueues','Request','GetFaxQueue','name'];(function(_0x2e2051,_0x26b49e){var _0x199c53=function(_0xdd97cc){while(--_0xdd97cc){_0x2e2051['push'](_0x2e2051['shift']());}};_0x199c53(++_0x26b49e);}(_0x19bb,0xfe));var _0xb19b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x19bb[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0xb19b('0x0'));exports[_0xb19b('0x1')]=function(){return function(){return client[_0xb19b('0x2')](_0xb19b('0x3'),{'options':{'raw':![],'attributes':['id',_0xb19b('0x4'),'timeout','strategy'],'include':[{'model':'User','as':_0xb19b('0x5'),'attributes':['id',_0xb19b('0x4'),_0xb19b('0x6'),'faxPause']}]},'log':_0xb19b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 94316ef..6b08ea3 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 _0xfb10=['Request','CreateFaxQueueReport','DESC','UpdateFaxQueueReport','../client','create'];(function(_0x44b219,_0x51b2d0){var _0x182ae8=function(_0x19d3b4){while(--_0x19d3b4){_0x44b219['push'](_0x44b219['shift']());}};_0x182ae8(++_0x51b2d0);}(_0xfb10,0x13c));var _0x0fb1=function(_0x2cf6ed,_0x590955){_0x2cf6ed=_0x2cf6ed-0x0;var _0xc05f1f=_0xfb10[_0x2cf6ed];return _0xc05f1f;};'use strict';var client=require(_0x0fb1('0x0'));exports[_0x0fb1('0x1')]=function(_0x5e25b0){return client[_0x0fb1('0x2')](_0x0fb1('0x3'),{'body':_0x5e25b0,'log':_0x0fb1('0x3')});};exports['update']=function(_0x3bac16,_0x1e2f33){return client[_0x0fb1('0x2')]('UpdateFaxQueueReport',{'body':_0x1e2f33,'options':{'where':{'uniqueid':_0x3bac16},'order':[['id',_0x0fb1('0x4')]],'limit':0x1},'log':_0x0fb1('0x5')});}; \ No newline at end of file +var _0x5d96=['DESC','create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x5d96,0xdf));var _0x65d9=function(_0x2c4710,_0x22dc0f){_0x2c4710=_0x2c4710-0x0;var _0x826b3c=_0x5d96[_0x2c4710];return _0x826b3c;};'use strict';var client=require('../client');exports[_0x65d9('0x0')]=function(_0x2de423){return client[_0x65d9('0x1')](_0x65d9('0x2'),{'body':_0x2de423,'log':'CreateFaxQueueReport'});};exports[_0x65d9('0x3')]=function(_0x53c18f,_0x30e0ca){return client['Request'](_0x65d9('0x4'),{'body':_0x30e0ca,'options':{'where':{'uniqueid':_0x53c18f},'order':[['id',_0x65d9('0x5')]],'limit':0x1},'log':_0x65d9('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index a1ed6ff..2cbc788 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 _0x6cb1=['GetInterval','name','Interval','interval','getIntervals','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6cb1,0x154));var _0x16cb=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6cb1[_0x3947c9];return _0x2e7871;};'use strict';var client=require('../client');exports[_0x16cb('0x0')]=function(){return function(){return client[_0x16cb('0x1')](_0x16cb('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x16cb('0x3')],'include':[{'model':_0x16cb('0x4'),'as':'Intervals','attributes':['id','name',_0x16cb('0x5')]}]},'log':_0x16cb('0x0')});};}; \ No newline at end of file +var _0xb79e=['Request','GetInterval','name','interval','../client','getIntervals'];(function(_0x15ed68,_0x533f68){var _0x1076d2=function(_0x23aed3){while(--_0x23aed3){_0x15ed68['push'](_0x15ed68['shift']());}};_0x1076d2(++_0x533f68);}(_0xb79e,0x11e));var _0xeb79=function(_0x2d41df,_0x1e7955){_0x2d41df=_0x2d41df-0x0;var _0x406138=_0xb79e[_0x2d41df];return _0x406138;};'use strict';var client=require(_0xeb79('0x0'));exports[_0xeb79('0x1')]=function(){return function(){return client[_0xeb79('0x2')](_0xeb79('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xeb79('0x4')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0xeb79('0x4'),_0xeb79('0x5')]}]},'log':_0xeb79('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index b44cb1d..fc7273e 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 _0x4137=['updateMailInteraction','addTags','AddTagsToMailInteraction','../client','update','Request','UpdateMailInteraction'];(function(_0xfc406a,_0x4479e1){var _0x395473=function(_0x1fe8b6){while(--_0x1fe8b6){_0xfc406a['push'](_0xfc406a['shift']());}};_0x395473(++_0x4479e1);}(_0x4137,0xf8));var _0x7413=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4137[_0x46e363];return _0x3fb059;};'use strict';var client=require(_0x7413('0x0'));exports[_0x7413('0x1')]=function(_0x370399,_0x4f372c){return client[_0x7413('0x2')](_0x7413('0x3'),{'body':_0x4f372c,'options':{'where':{'id':_0x370399}},'log':_0x7413('0x4')});};exports[_0x7413('0x5')]=function(_0x258255,_0x3dc48a){return client[_0x7413('0x2')](_0x7413('0x6'),{'body':_0x3dc48a,'options':{'where':{'id':_0x258255}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x1c9a=['updateMailInteraction','AddTagsToMailInteraction','../client','Request','UpdateMailInteraction'];(function(_0x11f5ff,_0xa0ef18){var _0x46eefb=function(_0x51872a){while(--_0x51872a){_0x11f5ff['push'](_0x11f5ff['shift']());}};_0x46eefb(++_0xa0ef18);}(_0x1c9a,0x98));var _0xa1c9=function(_0x388c50,_0x42ee06){_0x388c50=_0x388c50-0x0;var _0x58bcdc=_0x1c9a[_0x388c50];return _0x58bcdc;};'use strict';var client=require(_0xa1c9('0x0'));exports['update']=function(_0x470dcd,_0x5c45c5){return client[_0xa1c9('0x1')](_0xa1c9('0x2'),{'body':_0x5c45c5,'options':{'where':{'id':_0x470dcd}},'log':_0xa1c9('0x3')});};exports['addTags']=function(_0x21c0fc,_0x45d1f7){return client[_0xa1c9('0x1')](_0xa1c9('0x4'),{'body':_0x45d1f7,'options':{'where':{'id':_0x21c0fc}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index d5cff76..4862814 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 _0xa029=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x4e03ca,_0x2149f9){var _0x39cd8a=function(_0x4760e7){while(--_0x4760e7){_0x4e03ca['push'](_0x4e03ca['shift']());}};_0x39cd8a(++_0x2149f9);}(_0xa029,0x1b7));var _0x9a02=function(_0xee566,_0x15f0d8){_0xee566=_0xee566-0x0;var _0x4176e4=_0xa029[_0xee566];return _0x4176e4;};'use strict';var client=require(_0x9a02('0x0'));exports[_0x9a02('0x1')]=function(_0x1add67){return client[_0x9a02('0x2')](_0x9a02('0x3'),{'body':_0x1add67,'log':_0x9a02('0x4')});}; \ No newline at end of file +var _0xbc9c=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0x39fd11,_0x5d7883){var _0x302799=function(_0x4a0615){while(--_0x4a0615){_0x39fd11['push'](_0x39fd11['shift']());}};_0x302799(++_0x5d7883);}(_0xbc9c,0x152));var _0xcbc9=function(_0x269916,_0x4c6a70){_0x269916=_0x269916-0x0;var _0x5c0019=_0xbc9c[_0x269916];return _0x5c0019;};'use strict';var client=require(_0xcbc9('0x0'));exports[_0xcbc9('0x1')]=function(_0x271579){return client[_0xcbc9('0x2')](_0xcbc9('0x3'),{'body':_0x271579,'log':_0xcbc9('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index a818ce1..109ce39 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 _0x4818=['../client','getMailQueues','Request','name','timeout','strategy','online','mailPause'];(function(_0x2644cd,_0x3e1e34){var _0x521b23=function(_0x127413){while(--_0x127413){_0x2644cd['push'](_0x2644cd['shift']());}};_0x521b23(++_0x3e1e34);}(_0x4818,0x158));var _0x8481=function(_0x5cb7ac,_0x368be8){_0x5cb7ac=_0x5cb7ac-0x0;var _0x8cfc1b=_0x4818[_0x5cb7ac];return _0x8cfc1b;};'use strict';var client=require(_0x8481('0x0'));exports[_0x8481('0x1')]=function(){return function(){return client[_0x8481('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x8481('0x3'),_0x8481('0x4'),_0x8481('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x8481('0x3'),_0x8481('0x6'),_0x8481('0x7')]}]},'log':_0x8481('0x1')});};}; \ No newline at end of file +var _0x287e=['getMailQueues','Request','GetMailQueue','name','timeout','strategy','User','Agents','online','mailPause','../client'];(function(_0x1c6227,_0x542c26){var _0x22a2ab=function(_0x274e77){while(--_0x274e77){_0x1c6227['push'](_0x1c6227['shift']());}};_0x22a2ab(++_0x542c26);}(_0x287e,0x1e3));var _0xe287=function(_0x53d294,_0x532130){_0x53d294=_0x53d294-0x0;var _0x3f6511=_0x287e[_0x53d294];return _0x3f6511;};'use strict';var client=require(_0xe287('0x0'));exports[_0xe287('0x1')]=function(){return function(){return client[_0xe287('0x2')](_0xe287('0x3'),{'options':{'raw':![],'attributes':['id',_0xe287('0x4'),_0xe287('0x5'),_0xe287('0x6')],'include':[{'model':_0xe287('0x7'),'as':_0xe287('0x8'),'attributes':['id','name',_0xe287('0x9'),_0xe287('0xa')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 1549650..e30cfb0 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 _0x7a74=['UpdateMailQueueReport','DESC','../client','Request','CreateMailQueueReport','update'];(function(_0x585ee5,_0x1c9dba){var _0x470808=function(_0x35c90d){while(--_0x35c90d){_0x585ee5['push'](_0x585ee5['shift']());}};_0x470808(++_0x1c9dba);}(_0x7a74,0x110));var _0x47a7=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x7a74[_0x4d8ed9];return _0x1e2140;};'use strict';var client=require(_0x47a7('0x0'));exports['create']=function(_0x4a6c2a){return client[_0x47a7('0x1')](_0x47a7('0x2'),{'body':_0x4a6c2a,'log':_0x47a7('0x2')});};exports[_0x47a7('0x3')]=function(_0x387b5f,_0x45d390){return client[_0x47a7('0x1')](_0x47a7('0x4'),{'body':_0x45d390,'options':{'where':{'uniqueid':_0x387b5f},'order':[['id',_0x47a7('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0xe787=['create','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x3357cc,_0x361702){var _0x4734d9=function(_0x20f39b){while(--_0x20f39b){_0x3357cc['push'](_0x3357cc['shift']());}};_0x4734d9(++_0x361702);}(_0xe787,0x1c7));var _0x7e78=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xe787[_0x5cb1af];return _0x8d7940;};'use strict';var client=require(_0x7e78('0x0'));exports[_0x7e78('0x1')]=function(_0x4698b5){return client['Request'](_0x7e78('0x2'),{'body':_0x4698b5,'log':'CreateMailQueueReport'});};exports[_0x7e78('0x3')]=function(_0x3db98e,_0x24e694){return client['Request'](_0x7e78('0x4'),{'body':_0x24e694,'options':{'where':{'uniqueid':_0x3db98e},'order':[['id',_0x7e78('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index ee9a2e6..4f43c01 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 _0x9219=['addTagsToChatInteraction','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction'];(function(_0x80d733,_0x266211){var _0x435868=function(_0x2ae0f0){while(--_0x2ae0f0){_0x80d733['push'](_0x80d733['shift']());}};_0x435868(++_0x266211);}(_0x9219,0xdf));var _0x9921=function(_0x1e346a,_0x2fa16e){_0x1e346a=_0x1e346a-0x0;var _0x59ace9=_0x9219[_0x1e346a];return _0x59ace9;};'use strict';var client=require('../client');exports[_0x9921('0x0')]=function(_0x52f3dc,_0x58f8af){return client[_0x9921('0x1')](_0x9921('0x2'),{'body':_0x58f8af,'options':{'where':{'id':_0x52f3dc}},'log':_0x9921('0x3')});};exports['addTags']=function(_0x553dad,_0x13d378){return client[_0x9921('0x1')](_0x9921('0x4'),{'body':_0x13d378,'options':{'where':{'id':_0x553dad}},'log':_0x9921('0x5')});}; \ No newline at end of file +var _0xe781=['../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','addTagsToChatInteraction'];(function(_0x5b80fe,_0x23bd36){var _0x365865=function(_0x4fbdec){while(--_0x4fbdec){_0x5b80fe['push'](_0x5b80fe['shift']());}};_0x365865(++_0x23bd36);}(_0xe781,0x16c));var _0x1e78=function(_0x1cdcab,_0x17a516){_0x1cdcab=_0x1cdcab-0x0;var _0x4393d0=_0xe781[_0x1cdcab];return _0x4393d0;};'use strict';var client=require(_0x1e78('0x0'));exports[_0x1e78('0x1')]=function(_0x20e4a0,_0x4af0af){return client[_0x1e78('0x2')](_0x1e78('0x3'),{'body':_0x4af0af,'options':{'where':{'id':_0x20e4a0}},'log':_0x1e78('0x4')});};exports[_0x1e78('0x5')]=function(_0x5c1f93,_0x15e66b){return client[_0x1e78('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x15e66b,'options':{'where':{'id':_0x5c1f93}},'log':_0x1e78('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index ebceacd..c8637b8 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 _0xf240=['create','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x1b7631,_0x200191){var _0x5eb6ea=function(_0x28f282){while(--_0x28f282){_0x1b7631['push'](_0x1b7631['shift']());}};_0x5eb6ea(++_0x200191);}(_0xf240,0x107));var _0x0f24=function(_0x2fb3af,_0x560f89){_0x2fb3af=_0x2fb3af-0x0;var _0x5597ce=_0xf240[_0x2fb3af];return _0x5597ce;};'use strict';var client=require(_0x0f24('0x0'));exports[_0x0f24('0x1')]=function(_0x6b5e13){return client['Request'](_0x0f24('0x2'),{'body':_0x6b5e13,'log':_0x0f24('0x3')});}; \ No newline at end of file +var _0xa698=['Request','CreateOpenchannelMessage','../client','create'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa698,0x6a));var _0x8a69=function(_0x31e485,_0x2f451c){_0x31e485=_0x31e485-0x0;var _0x1d3d2c=_0xa698[_0x31e485];return _0x1d3d2c;};'use strict';var client=require(_0x8a69('0x0'));exports[_0x8a69('0x1')]=function(_0x3476dd){return client[_0x8a69('0x2')](_0x8a69('0x3'),{'body':_0x3476dd,'log':'createOpenchannelMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index aa08068..517f32c 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 _0x7220=['name','timeout','User','online','../client','Request','GetOpenchannelQueue'];(function(_0x394f3b,_0x49bfdd){var _0x5085c3=function(_0xf8e3cc){while(--_0xf8e3cc){_0x394f3b['push'](_0x394f3b['shift']());}};_0x5085c3(++_0x49bfdd);}(_0x7220,0x14d));var _0x0722=function(_0x488a7e,_0x1b1694){_0x488a7e=_0x488a7e-0x0;var _0x20fd80=_0x7220[_0x488a7e];return _0x20fd80;};'use strict';var client=require(_0x0722('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x0722('0x1')](_0x0722('0x2'),{'options':{'raw':![],'attributes':['id',_0x0722('0x3'),_0x0722('0x4'),'strategy'],'include':[{'model':_0x0722('0x5'),'as':'Agents','attributes':['id',_0x0722('0x3'),_0x0722('0x6'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x05e2=['User','Agents','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy'];(function(_0x383545,_0x4790bd){var _0x5ba15=function(_0x2d8ed2){while(--_0x2d8ed2){_0x383545['push'](_0x383545['shift']());}};_0x5ba15(++_0x4790bd);}(_0x05e2,0xe0));var _0x205e=function(_0x25a0b9,_0x86e28f){_0x25a0b9=_0x25a0b9-0x0;var _0x30b9ab=_0x05e2[_0x25a0b9];return _0x30b9ab;};'use strict';var client=require(_0x205e('0x0'));exports[_0x205e('0x1')]=function(){return function(){return client[_0x205e('0x2')](_0x205e('0x3'),{'options':{'raw':![],'attributes':['id',_0x205e('0x4'),_0x205e('0x5'),_0x205e('0x6')],'include':[{'model':_0x205e('0x7'),'as':_0x205e('0x8'),'attributes':['id',_0x205e('0x4'),_0x205e('0x9'),_0x205e('0xa')]}]},'log':_0x205e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index c002dbd..7d0c43c 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 _0xc196=['../client','create','Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC'];(function(_0x565a43,_0x567abc){var _0x27cea3=function(_0x5dda1b){while(--_0x5dda1b){_0x565a43['push'](_0x565a43['shift']());}};_0x27cea3(++_0x567abc);}(_0xc196,0x1bc));var _0x6c19=function(_0x166658,_0x450374){_0x166658=_0x166658-0x0;var _0xd492bc=_0xc196[_0x166658];return _0xd492bc;};'use strict';var client=require(_0x6c19('0x0'));exports[_0x6c19('0x1')]=function(_0x17a79c){return client[_0x6c19('0x2')](_0x6c19('0x3'),{'body':_0x17a79c,'log':_0x6c19('0x3')});};exports['update']=function(_0x50189b,_0x26b087){return client[_0x6c19('0x2')](_0x6c19('0x4'),{'body':_0x26b087,'options':{'where':{'uniqueid':_0x50189b},'order':[['id',_0x6c19('0x5')]],'limit':0x1},'log':_0x6c19('0x4')});}; \ No newline at end of file +var _0xd8c8=['UpdateOpenchannelQueueReport','DESC','Request','CreateOpenchannelQueueReport'];(function(_0x5a3afd,_0x20a4ab){var _0x401ae4=function(_0xff9cf1){while(--_0xff9cf1){_0x5a3afd['push'](_0x5a3afd['shift']());}};_0x401ae4(++_0x20a4ab);}(_0xd8c8,0xba));var _0x8d8c=function(_0x2776c1,_0x36c713){_0x2776c1=_0x2776c1-0x0;var _0x5c80e7=_0xd8c8[_0x2776c1];return _0x5c80e7;};'use strict';var client=require('../client');exports['create']=function(_0x3a3ac2){return client[_0x8d8c('0x0')](_0x8d8c('0x1'),{'body':_0x3a3ac2,'log':_0x8d8c('0x1')});};exports['update']=function(_0x50a4c6,_0x3d3b55){return client[_0x8d8c('0x0')](_0x8d8c('0x2'),{'body':_0x3d3b55,'options':{'where':{'uniqueid':_0x50a4c6},'order':[['id',_0x8d8c('0x3')]],'limit':0x1},'log':_0x8d8c('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index c888c68..53b3281 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 _0x448b=['update','Request','UpdateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x15704d,_0x35fe98){var _0x5ba0b6=function(_0x63842b){while(--_0x63842b){_0x15704d['push'](_0x15704d['shift']());}};_0x5ba0b6(++_0x35fe98);}(_0x448b,0x125));var _0xb448=function(_0x2ed408,_0x2d5ed5){_0x2ed408=_0x2ed408-0x0;var _0x1d369b=_0x448b[_0x2ed408];return _0x1d369b;};'use strict';var client=require(_0xb448('0x0'));exports[_0xb448('0x1')]=function(_0x2556f1,_0x1a965f){return client[_0xb448('0x2')](_0xb448('0x3'),{'body':_0x1a965f,'options':{'where':{'id':_0x2556f1}},'log':'updateSmsInteraction'});};exports[_0xb448('0x4')]=function(_0x32bcae,_0x172a89){return client[_0xb448('0x2')](_0xb448('0x5'),{'body':_0x172a89,'options':{'where':{'id':_0x32bcae}},'log':_0xb448('0x6')});}; \ No newline at end of file +var _0xeb5d=['addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request'];(function(_0x120212,_0x103e00){var _0x4041c5=function(_0x14d36e){while(--_0x14d36e){_0x120212['push'](_0x120212['shift']());}};_0x4041c5(++_0x103e00);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xeb5d[_0x1cc8fe];return _0x230054;};'use strict';var client=require('../client');exports[_0xdeb5('0x0')]=function(_0x1ede03,_0x42c87c){return client[_0xdeb5('0x1')]('UpdateSmsInteraction',{'body':_0x42c87c,'options':{'where':{'id':_0x1ede03}},'log':'updateSmsInteraction'});};exports[_0xdeb5('0x2')]=function(_0x16c31b,_0x546313){return client[_0xdeb5('0x1')](_0xdeb5('0x3'),{'body':_0x546313,'options':{'where':{'id':_0x16c31b}},'log':_0xdeb5('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 790f551..21778c2 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 _0x1dc8=['create','../client'];(function(_0x19573b,_0x4ce77d){var _0x5acb1b=function(_0x2e7465){while(--_0x2e7465){_0x19573b['push'](_0x19573b['shift']());}};_0x5acb1b(++_0x4ce77d);}(_0x1dc8,0x117));var _0x81dc=function(_0x33aeab,_0x480b1a){_0x33aeab=_0x33aeab-0x0;var _0xa3bb02=_0x1dc8[_0x33aeab];return _0xa3bb02;};'use strict';var client=require(_0x81dc('0x0'));exports[_0x81dc('0x1')]=function(_0x2a7971){return client['Request']('CreateSmsMessage',{'body':_0x2a7971,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x03be=['CreateSmsMessage','Request'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x03be,0xcf));var _0xe03b=function(_0x2499ab,_0x28057f){_0x2499ab=_0x2499ab-0x0;var _0x4f9931=_0x03be[_0x2499ab];return _0x4f9931;};'use strict';var client=require('../client');exports['create']=function(_0xbd33cb){return client[_0xe03b('0x0')](_0xe03b('0x1'),{'body':_0xbd33cb,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 010020b..4c042c3 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x220d3b,_0x29c503){var _0x14354a=function(_0x424c6b){while(--_0x424c6b){_0x220d3b['push'](_0x220d3b['shift']());}};_0x14354a(++_0x29c503);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x4c1a2d,_0x1515fb){var _0x490c38=function(_0x5ef4bb){while(--_0x5ef4bb){_0x4c1a2d['push'](_0x4c1a2d['shift']());}};_0x490c38(++_0x1515fb);}(_0x70e0,0x17b));var _0x070e=function(_0x27e9d7,_0x2c5509){_0x27e9d7=_0x27e9d7-0x0;var _0x576f03=_0x70e0[_0x27e9d7];return _0x576f03;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index eb81c3d..7c37329 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 _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x2d1971,_0x20b764){var _0x4d7759=function(_0x56a550){while(--_0x56a550){_0x2d1971['push'](_0x2d1971['shift']());}};_0x4d7759(++_0x20b764);}(_0xedd9,0xfc));var _0x9edd=function(_0x3b0037,_0xb7c617){_0x3b0037=_0x3b0037-0x0;var _0x1d94ca=_0xedd9[_0x3b0037];return _0x1d94ca;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});}; \ No newline at end of file +var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x465c38,_0x7c29d8){var _0x130a9a=function(_0x31c676){while(--_0x31c676){_0x465c38['push'](_0x465c38['shift']());}};_0x130a9a(++_0x7c29d8);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'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 d82611c..9696488 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(_0x23f96a,_0x35e08e){var _0x4a72ee=function(_0x6cf3ee){while(--_0x6cf3ee){_0x23f96a['push'](_0x23f96a['shift']());}};_0x4a72ee(++_0x35e08e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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(_0x4fb3ce,_0x50e20c){var _0x281cea=function(_0x10c2f9){while(--_0x10c2f9){_0x4fb3ce['push'](_0x4fb3ce['shift']());}};_0x281cea(++_0x50e20c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 f922556..cc8d536 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 _0x2ef3=['../client','update','Request','UpdateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x74115b,_0x31f752){var _0x57ebbd=function(_0x234873){while(--_0x234873){_0x74115b['push'](_0x74115b['shift']());}};_0x57ebbd(++_0x31f752);}(_0x2ef3,0xba));var _0x32ef=function(_0x18c34b,_0x4297b1){_0x18c34b=_0x18c34b-0x0;var _0x1746cb=_0x2ef3[_0x18c34b];return _0x1746cb;};'use strict';var client=require(_0x32ef('0x0'));exports[_0x32ef('0x1')]=function(_0x47513a,_0x26e56e){return client[_0x32ef('0x2')](_0x32ef('0x3'),{'body':_0x26e56e,'options':{'where':{'id':_0x47513a}},'log':'updateWhatsappInteraction'});};exports[_0x32ef('0x4')]=function(_0x38b7f3,_0x524ab6){return client[_0x32ef('0x2')](_0x32ef('0x5'),{'body':_0x524ab6,'options':{'where':{'id':_0x38b7f3}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0xa0a1=['Request','addTags','AddTagsToWhatsappInteraction','../client'];(function(_0x2ef2fd,_0x1fd065){var _0x3d5a77=function(_0xef0304){while(--_0xef0304){_0x2ef2fd['push'](_0x2ef2fd['shift']());}};_0x3d5a77(++_0x1fd065);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x32f539,_0x51efdb){_0x32f539=_0x32f539-0x0;var _0x1867ab=_0xa0a1[_0x32f539];return _0x1867ab;};'use strict';var client=require(_0x1a0a('0x0'));exports['update']=function(_0x1495e1,_0x2ea09e){return client[_0x1a0a('0x1')]('UpdateWhatsappInteraction',{'body':_0x2ea09e,'options':{'where':{'id':_0x1495e1}},'log':'updateWhatsappInteraction'});};exports[_0x1a0a('0x2')]=function(_0x22f069,_0x5114de){return client[_0x1a0a('0x1')](_0x1a0a('0x3'),{'body':_0x5114de,'options':{'where':{'id':_0x22f069}},'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 a901c30..1ec9779 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 _0x53aa=['../client','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0x53aa,0x6f));var _0xa53a=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x53aa[_0x11c573];return _0x6b72de;};'use strict';var client=require(_0xa53a('0x0'));exports['create']=function(_0x2ca6be){return client['Request'](_0xa53a('0x1'),{'body':_0x2ca6be,'log':_0xa53a('0x2')});}; \ No newline at end of file +var _0x2ad0=['Request','../client','create'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x2ad0,0xdc));var _0x02ad=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x2ad0[_0x37c22c];return _0x119d79;};'use strict';var client=require(_0x02ad('0x0'));exports[_0x02ad('0x1')]=function(_0x37c8c8){return client[_0x02ad('0x2')]('CreateWhatsappMessage',{'body':_0x37c8c8,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index eade0b8..31681a0 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 _0xf87d=['name','strategy','User','../client','Request','GetWhatsappQueue'];(function(_0x25ecb0,_0x356f6c){var _0x5297e2=function(_0x3be847){while(--_0x3be847){_0x25ecb0['push'](_0x25ecb0['shift']());}};_0x5297e2(++_0x356f6c);}(_0xf87d,0x147));var _0xdf87=function(_0x355e5f,_0x4134e7){_0x355e5f=_0x355e5f-0x0;var _0x3d24a2=_0xf87d[_0x355e5f];return _0x3d24a2;};'use strict';var client=require(_0xdf87('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0xdf87('0x1')](_0xdf87('0x2'),{'options':{'raw':![],'attributes':['id',_0xdf87('0x3'),'timeout',_0xdf87('0x4')],'include':[{'model':_0xdf87('0x5'),'as':'Agents','attributes':['id',_0xdf87('0x3'),'online','whatsappPause']}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0x1902=['whatsappPause','../client','getWhatsappQueues','Request','timeout','strategy','User','Agents','name','online'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0x1902,0x97));var _0x2190=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1902[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x2190('0x0'));exports[_0x2190('0x1')]=function(){return function(){return client[_0x2190('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id','name',_0x2190('0x3'),_0x2190('0x4')],'include':[{'model':_0x2190('0x5'),'as':_0x2190('0x6'),'attributes':['id',_0x2190('0x7'),_0x2190('0x8'),_0x2190('0x9')]}]},'log':_0x2190('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index fe91865..5669297 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 _0x978d=['create','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x978d,0x73));var _0xd978=function(_0x2b1da8,_0x3050f5){_0x2b1da8=_0x2b1da8-0x0;var _0xd3ffb2=_0x978d[_0x2b1da8];return _0xd3ffb2;};'use strict';var client=require('../client');exports[_0xd978('0x0')]=function(_0x3d4d49){return client['Request']('CreateWhatsappQueueReport',{'body':_0x3d4d49,'log':_0xd978('0x1')});};exports[_0xd978('0x2')]=function(_0x41afb3,_0x47de71){return client['Request'](_0xd978('0x3'),{'body':_0x47de71,'options':{'where':{'uniqueid':_0x41afb3},'order':[['id',_0xd978('0x4')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0xc193=['create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x1c26d8,_0x199a1e){var _0x3aa879=function(_0x18d9eb){while(--_0x18d9eb){_0x1c26d8['push'](_0x1c26d8['shift']());}};_0x3aa879(++_0x199a1e);}(_0xc193,0x1aa));var _0x3c19=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xc193[_0x167cc1];return _0x10bc4b;};'use strict';var client=require(_0x3c19('0x0'));exports[_0x3c19('0x1')]=function(_0x7d76f){return client[_0x3c19('0x2')](_0x3c19('0x3'),{'body':_0x7d76f,'log':_0x3c19('0x3')});};exports[_0x3c19('0x4')]=function(_0x5e9928,_0x1afa74){return client[_0x3c19('0x2')](_0x3c19('0x5'),{'body':_0x1afa74,'options':{'where':{'uniqueid':_0x5e9928},'order':[['id',_0x3c19('0x6')]],'limit':0x1},'log':_0x3c19('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index c85bfee..07933a7 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 _0x8a1f=['map','join','stop','find','agents','timeout','createQueue','atimeout','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number','info','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s'];(function(_0x27e9fe,_0x20a34b){var _0x2cd812=function(_0x21b980){while(--_0x21b980){_0x27e9fe['push'](_0x27e9fe['shift']());}};_0x2cd812(++_0x20a34b);}(_0x8a1f,0x170));var _0xf8a1=function(_0x205c11,_0x941d3d){_0x205c11=_0x205c11-0x0;var _0x550e7b=_0x8a1f[_0x205c11];return _0x550e7b;};'use strict';var schema=require(_0xf8a1('0x0'));var _=require(_0xf8a1('0x1'));var util=require(_0xf8a1('0x2'));var seqqueue=require(_0xf8a1('0x3'));var logger=require(_0xf8a1('0x4'))(_0xf8a1('0x5'));var strategy=require(_0xf8a1('0x6'));var queue=schema({'name':{'type':_0xf8a1('0x7'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xf8a1('0x8'),'message':_0xf8a1('0x9')}});function writeLog(_0x5a0d62,_0x3ff744,_0x58aeca){return logger[_0xf8a1('0xa')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x5a0d62,_0x3ff744[_0xf8a1('0xb')],_0x58aeca));}function handleFindAgent(_0x568e21){return function(_0x5b4817){return _0x5b4817[_0xf8a1('0xb')]['toLowerCase']()===_0x568e21[_0xf8a1('0xc')]();};}exports[_0xf8a1('0xd')]=function(_0x38f6d6,_0x5b5f3e,_0x330d5d,_0x42ad9b){return function(_0x53d254){try{var _0x11b4c5={'name':_0x5b5f3e[0x0],'timeout':_0x5b5f3e[0x1]};var _0x40e59c=queue[_0xf8a1('0x0')](_0x11b4c5,{'typecast':!![]});if(_0x40e59c[_0xf8a1('0xe')]){logger[_0xf8a1('0xf')](_0xf8a1('0x10'),_0x38f6d6,_[_0xf8a1('0x11')](_0x40e59c,'message')[_0xf8a1('0x12')](',\x20'));_0x53d254[_0xf8a1('0x13')]();}else{var _0x1860f0=_[_0xf8a1('0x14')](_0x330d5d[_0xf8a1('0x15')],handleFindAgent(_0x11b4c5[_0xf8a1('0xb')]));if(_0x1860f0){var _0x149fae=(_0x11b4c5[_0xf8a1('0x16')]||0xa)*0x3e8;var _0x27b734,_0x45cf95;var _0x179273=seqqueue[_0xf8a1('0x17')](_0x149fae);_0x179273['id']=_0x38f6d6;_0x179273[_0xf8a1('0x18')]=_0x149fae;_0x179273['channel']=_0x42ad9b['channel'];writeLog(_0x38f6d6,_0x1860f0,util['format'](_0xf8a1('0x19'),_0x149fae));_0x330d5d[_0xf8a1('0x1a')][_0x38f6d6]['on'](_0xf8a1('0x1b'),function(){logger['info'](_0xf8a1('0x1c'),_0x38f6d6);clearTimeout(_0x45cf95);_0x45cf95=undefined;_0x179273[_0xf8a1('0x1d')]();if(_0x330d5d[_0xf8a1('0x1a')][_0x38f6d6]){delete _0x330d5d[_0xf8a1('0x1a')][_0x38f6d6];}_0x53d254[_0xf8a1('0x13')]();});_0x330d5d[_0xf8a1('0x1a')][_0x38f6d6]['on'](_0xf8a1('0x1e'),function(){if(_0x330d5d[_0xf8a1('0x1a')][_0x38f6d6]){delete _0x330d5d[_0xf8a1('0x1a')][_0x38f6d6];}});_0x45cf95=setTimeout(function(){logger[_0xf8a1('0xa')]('[%s][AGENT]\x20ROUTING\x20END',_0x38f6d6);clearTimeout(_0x45cf95);_0x179273[_0xf8a1('0x1d')]();_0x53d254['next']();},_0x149fae);strategy[_0xf8a1('0x1f')](_0x179273,_0x1860f0,_0x330d5d,_0x42ad9b);}else{logger[_0xf8a1('0xf')](_0xf8a1('0x20'),_0x38f6d6,_0x11b4c5[_0xf8a1('0xb')]);_0x53d254[_0xf8a1('0x13')]();}}}catch(_0x24df39){console[_0xf8a1('0x21')](_0x24df39);logger[_0xf8a1('0xf')]('[%s][QUEUE]\x20%s',_0x38f6d6,_0x24df39[_0xf8a1('0x22')]);_0x53d254[_0xf8a1('0x13')]();}};}; \ No newline at end of file +var _0xa418=['util','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','error','message','join','stop','find','agents','timeout','createQueue','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack'];(function(_0x10a273,_0x2f4263){var _0x7e3ade=function(_0x5d2a37){while(--_0x5d2a37){_0x10a273['push'](_0x10a273['shift']());}};_0x7e3ade(++_0x2f4263);}(_0xa418,0xb9));var _0x8a41=function(_0x2622a0,_0x5f2d71){_0x2622a0=_0x2622a0-0x0;var _0x1259f3=_0xa418[_0x2622a0];return _0x1259f3;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x8a41('0x0'));var seqqueue=require(_0x8a41('0x1'));var logger=require(_0x8a41('0x2'))('routing');var strategy=require(_0x8a41('0x3'));var queue=schema({'name':{'type':_0x8a41('0x4'),'required':!![],'message':_0x8a41('0x5')},'timeout':{'type':_0x8a41('0x6'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x1aac8e,_0x197a73,_0x30221b){return logger[_0x8a41('0x7')](util[_0x8a41('0x8')](_0x8a41('0x9'),_0x1aac8e,_0x197a73[_0x8a41('0xa')],_0x30221b));}function handleFindAgent(_0x79351e){return function(_0x37238b){return _0x37238b['name'][_0x8a41('0xb')]()===_0x79351e[_0x8a41('0xb')]();};}exports[_0x8a41('0xc')]=function(_0x2e0434,_0x2519da,_0x10c983,_0x1c94b7){return function(_0x5af548){try{var _0x45c376={'name':_0x2519da[0x0],'timeout':_0x2519da[0x1]};var _0x143cf4=queue[_0x8a41('0xd')](_0x45c376,{'typecast':!![]});if(_0x143cf4[_0x8a41('0xe')]){logger[_0x8a41('0xf')]('[%s][AGENT]\x20%s',_0x2e0434,_['map'](_0x143cf4,_0x8a41('0x10'))[_0x8a41('0x11')](',\x20'));_0x5af548[_0x8a41('0x12')]();}else{var _0x3a0e42=_[_0x8a41('0x13')](_0x10c983[_0x8a41('0x14')],handleFindAgent(_0x45c376[_0x8a41('0xa')]));if(_0x3a0e42){var _0x67294c=(_0x45c376[_0x8a41('0x15')]||0xa)*0x3e8;var _0x38e385,_0x3f4d71;var _0x525a1a=seqqueue[_0x8a41('0x16')](_0x67294c);_0x525a1a['id']=_0x2e0434;_0x525a1a['atimeout']=_0x67294c;_0x525a1a[_0x8a41('0x17')]=_0x1c94b7[_0x8a41('0x17')];writeLog(_0x2e0434,_0x3a0e42,util['format'](_0x8a41('0x18'),_0x67294c));_0x10c983[_0x8a41('0x19')][_0x2e0434]['on'](_0x8a41('0x1a'),function(){logger[_0x8a41('0x7')](_0x8a41('0x1b'),_0x2e0434);clearTimeout(_0x3f4d71);_0x3f4d71=undefined;_0x525a1a[_0x8a41('0x1c')]();if(_0x10c983[_0x8a41('0x19')][_0x2e0434]){delete _0x10c983['rules'][_0x2e0434];}_0x5af548[_0x8a41('0x12')]();});_0x10c983[_0x8a41('0x19')][_0x2e0434]['on'](_0x8a41('0x1d'),function(){if(_0x10c983[_0x8a41('0x19')][_0x2e0434]){delete _0x10c983[_0x8a41('0x19')][_0x2e0434];}});_0x3f4d71=setTimeout(function(){logger[_0x8a41('0x7')](_0x8a41('0x1e'),_0x2e0434);clearTimeout(_0x3f4d71);_0x525a1a[_0x8a41('0x1c')]();_0x5af548[_0x8a41('0x1f')]();},_0x67294c);strategy[_0x8a41('0x20')](_0x525a1a,_0x3a0e42,_0x10c983,_0x1c94b7);}else{logger[_0x8a41('0xf')](_0x8a41('0x21'),_0x2e0434,_0x45c376['name']);_0x5af548[_0x8a41('0x12')]();}}}catch(_0x3c7046){console[_0x8a41('0x22')](_0x3c7046);logger[_0x8a41('0xf')](_0x8a41('0x23'),_0x2e0434,_0x3c7046[_0x8a41('0x24')]);_0x5af548[_0x8a41('0x12')]();}};}; \ 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 f39239a..108e9d6 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 _0xee98=['Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','created','body','getMustacheRender','Message','create','then','catch','error','info','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','postText','amazonlex','providerResponse','dialogState','Failed','stringify','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','[%s][AMAZONLEX]\x20%s'];(function(_0x6a0be6,_0x55a79c){var _0x125fad=function(_0x2484ed){while(--_0x2484ed){_0x6a0be6['push'](_0x6a0be6['shift']());}};_0x125fad(++_0x55a79c);}(_0xee98,0x11e));var _0x8ee9=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xee98[_0x36ed48];return _0x51c63a;};'use strict';var _=require('lodash');var moment=require(_0x8ee9('0x0'));var AWS=require(_0x8ee9('0x1'));var utils=require('./utils');var logger=require(_0x8ee9('0x2'))(_0x8ee9('0x3'));var rpc={'chatMessage':require(_0x8ee9('0x4')),'openchannelMessage':require(_0x8ee9('0x5')),'mailMessage':require(_0x8ee9('0x6')),'smsMessage':require(_0x8ee9('0x7')),'faxMessage':require(_0x8ee9('0x8')),'whatsappMessage':require(_0x8ee9('0x9'))};exports[_0x8ee9('0xa')]=function(_0x24ec95,_0x5124b3){return function(_0x14b4ed){try{if(!_[_0x8ee9('0xb')](this['interaction'][_0x8ee9('0xc')])){logger['info'](_0x8ee9('0xd'),_0x24ec95,_0x8ee9('0xe'));return _0x14b4ed[_0x8ee9('0xf')]();}var _0x48e2cb={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x8ee9('0x10')),'direction':_0x8ee9('0x11')};if(this[_0x8ee9('0x12')]===_0x8ee9('0x13')||this[_0x8ee9('0x12')]===_0x8ee9('0x14')){_0x48e2cb[_0x8ee9('0x15')]=this['interaction']['phone'];}var _0xf82350=this[_0x8ee9('0x12')];if(_0xf82350===_0x8ee9('0x16')){_0x48e2cb[_0x8ee9('0x17')]=this[_0x8ee9('0x18')]['id'];}else{_0x48e2cb[_[_0x8ee9('0x19')](_0xf82350)+_0x8ee9('0x1a')]=this['account']['id'];}_0x48e2cb[_[_0x8ee9('0x19')](_0xf82350)+_0x8ee9('0x1b')]=this[_0x8ee9('0x1c')]['id'];if(this[_0x8ee9('0x1c')][_0x8ee9('0x1d')]){var _0x1087a0=_0x5124b3[0x4];if(!_['isEmpty'](_0x1087a0)){_0x48e2cb[_0x8ee9('0x1e')]=utils[_0x8ee9('0x1f')](_0x1087a0,this);return rpc[_0xf82350+_0x8ee9('0x20')][_0x8ee9('0x21')](_0x48e2cb)[_0x8ee9('0x22')](function(_0x4d823b){logger['info']('[%s][AMAZONLEX]\x20%s',_0x24ec95,_0x48e2cb[_0x8ee9('0x1e')]);})[_0x8ee9('0x23')](function(_0x173992){logger[_0x8ee9('0x24')]('[%s][AMAZONLEX]\x20%s',_0x24ec95,JSON['stringify'](_0x173992));})['finally'](function(){logger[_0x8ee9('0x25')](_0x8ee9('0x26'),_0x24ec95);_0x14b4ed[_0x8ee9('0x27')]();});}else{logger[_0x8ee9('0x25')](_0x8ee9('0x28'),_0x24ec95);_0x14b4ed['stop']();}}else{var _0x37f254=this;var _0x2b5a46=new AWS['LexRuntime']({'accessKeyId':_0x5124b3[0x0],'secretAccessKey':_0x5124b3[0x1],'region':_0x5124b3[0x2]});var _0x3385f1={'botAlias':_0x8ee9('0x29'),'botName':_0x5124b3[0x3],'inputText':this[_0x8ee9('0x2a')][_0x8ee9('0x1e')],'userId':this['channel']+':'+this['interaction']['id'][_0x8ee9('0x2b')]()};_0x2b5a46[_0x8ee9('0x2c')](_0x3385f1,function(_0x49c5e0,_0x394d27){if(_0x49c5e0){logger[_0x8ee9('0x24')]('[%s][AMAZONLEX]\x20%s',_0x24ec95,_0x49c5e0[_0x8ee9('0x2a')]);_0x14b4ed[_0x8ee9('0xf')]();}else if(_0x394d27&&_0x394d27[_0x8ee9('0x2a')]){_0x37f254[_0x8ee9('0x1e')][_0x8ee9('0x2d')]=_0x394d27;_0x48e2cb[_0x8ee9('0x1e')]=_0x394d27[_0x8ee9('0x2a')];_0x48e2cb['providerName']=_0x8ee9('0x2d');_0x48e2cb[_0x8ee9('0x2e')]=JSON['stringify'](_0x394d27);return rpc[_0xf82350+_0x8ee9('0x20')][_0x8ee9('0x21')](_0x48e2cb)[_0x8ee9('0x22')](function(_0x390d00){logger['info'](_0x8ee9('0xd'),_0x24ec95,_0x48e2cb[_0x8ee9('0x1e')]);if(_0x394d27[_0x8ee9('0x2f')]==_0x8ee9('0x30')){_0x14b4ed[_0x8ee9('0xf')]();}else{_0x14b4ed[_0x8ee9('0x27')]();}})[_0x8ee9('0x23')](function(_0xc267a6){logger[_0x8ee9('0x24')](_0x8ee9('0xd'),_0x24ec95,JSON[_0x8ee9('0x31')](_0xc267a6));_0x14b4ed[_0x8ee9('0xf')]();});}else{_0x14b4ed['next']();}});}}catch(_0x931ab9){logger['error'](_0x8ee9('0xd'),_0x24ec95,JSON[_0x8ee9('0x31')](_0x931ab9));_0x14b4ed[_0x8ee9('0x27')]();}};}; \ No newline at end of file +var _0x1102=['dialogState','Failed','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','out','channel','sms','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','Message','create','then','body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','message','toString','postText','next','providerName','amazonlex'];(function(_0x148785,_0x195ee5){var _0x17a172=function(_0x478b94){while(--_0x478b94){_0x148785['push'](_0x148785['shift']());}};_0x17a172(++_0x195ee5);}(_0x1102,0x192));var _0x2110=function(_0x126645,_0x16ede2){_0x126645=_0x126645-0x0;var _0x46968b=_0x1102[_0x126645];return _0x46968b;};'use strict';var _=require(_0x2110('0x0'));var moment=require(_0x2110('0x1'));var AWS=require(_0x2110('0x2'));var utils=require(_0x2110('0x3'));var logger=require(_0x2110('0x4'))(_0x2110('0x5'));var rpc={'chatMessage':require(_0x2110('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x2110('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x2110('0x8')),'whatsappMessage':require(_0x2110('0x9'))};exports[_0x2110('0xa')]=function(_0x320d7d,_0x5e5f68){return function(_0x369892){try{if(!_['isNil'](this['interaction'][_0x2110('0xb')])){logger[_0x2110('0xc')](_0x2110('0xd'),_0x320d7d,_0x2110('0xe'));return _0x369892['next']();}var _0x1c188d={'ContactId':this[_0x2110('0xf')]['id'],'sentAt':moment()[_0x2110('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x2110('0x11')};if(this[_0x2110('0x12')]===_0x2110('0x13')||this[_0x2110('0x12')]==='whatsapp'){_0x1c188d[_0x2110('0x14')]=this[_0x2110('0x15')]['phone'];}var _0xbd71b2=this[_0x2110('0x12')];if(_0xbd71b2===_0x2110('0x16')){_0x1c188d[_0x2110('0x17')]=this[_0x2110('0x18')]['id'];}else{_0x1c188d[_[_0x2110('0x19')](_0xbd71b2)+_0x2110('0x1a')]=this['account']['id'];}_0x1c188d[_[_0x2110('0x19')](_0xbd71b2)+_0x2110('0x1b')]=this['interaction']['id'];if(this[_0x2110('0x15')][_0x2110('0x1c')]){var _0x172433=_0x5e5f68[0x4];if(!_[_0x2110('0x1d')](_0x172433)){_0x1c188d['body']=utils[_0x2110('0x1e')](_0x172433,this);return rpc[_0xbd71b2+_0x2110('0x1f')][_0x2110('0x20')](_0x1c188d)[_0x2110('0x21')](function(_0x98e8ff){logger[_0x2110('0xc')](_0x2110('0xd'),_0x320d7d,_0x1c188d[_0x2110('0x22')]);})[_0x2110('0x23')](function(_0x5baa54){logger[_0x2110('0x24')](_0x2110('0xd'),_0x320d7d,JSON[_0x2110('0x25')](_0x5baa54));})[_0x2110('0x26')](function(){logger[_0x2110('0xc')](_0x2110('0x27'),_0x320d7d);_0x369892[_0x2110('0x28')]();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x320d7d);_0x369892['stop']();}}else{var _0x276688=this;var _0x111a08=new AWS[(_0x2110('0x29'))]({'accessKeyId':_0x5e5f68[0x0],'secretAccessKey':_0x5e5f68[0x1],'region':_0x5e5f68[0x2]});var _0x3155ff={'botAlias':'$LATEST','botName':_0x5e5f68[0x3],'inputText':this[_0x2110('0x2a')][_0x2110('0x22')],'userId':this[_0x2110('0x12')]+':'+this['interaction']['id'][_0x2110('0x2b')]()};_0x111a08[_0x2110('0x2c')](_0x3155ff,function(_0x8893c8,_0x288b38){if(_0x8893c8){logger[_0x2110('0x24')](_0x2110('0xd'),_0x320d7d,_0x8893c8[_0x2110('0x2a')]);_0x369892[_0x2110('0x2d')]();}else if(_0x288b38&&_0x288b38['message']){_0x276688[_0x2110('0x22')]['amazonlex']=_0x288b38;_0x1c188d[_0x2110('0x22')]=_0x288b38[_0x2110('0x2a')];_0x1c188d[_0x2110('0x2e')]=_0x2110('0x2f');_0x1c188d['providerResponse']=JSON['stringify'](_0x288b38);return rpc[_0xbd71b2+'Message'][_0x2110('0x20')](_0x1c188d)[_0x2110('0x21')](function(_0x58d91b){logger[_0x2110('0xc')](_0x2110('0xd'),_0x320d7d,_0x1c188d['body']);if(_0x288b38[_0x2110('0x30')]==_0x2110('0x31')){_0x369892[_0x2110('0x2d')]();}else{_0x369892['stop']();}})['catch'](function(_0x547abe){logger[_0x2110('0x24')](_0x2110('0xd'),_0x320d7d,JSON['stringify'](_0x547abe));_0x369892[_0x2110('0x2d')]();});}else{_0x369892[_0x2110('0x2d')]();}});}}catch(_0x894ab7){logger[_0x2110('0x24')](_0x2110('0xd'),_0x320d7d,JSON[_0x2110('0x25')](_0x894ab7));_0x369892[_0x2110('0x28')]();}};}; \ 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 1b1391d..727bf51 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 _0xaa5d=['./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','channel','body','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','info','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','mail','phone','read','subject','startsWith','Re:','Re:\x20','chat','account','upperFirst','AccountId','Message','inReplyTo','messageId','html','','';_0x142afc[_0xdaa5('0x2e')]={'Auto-Submitted':_0xdaa5('0x2f'),'X-Auto-Response-Suppress':_0xdaa5('0x30'),'Precedence':_0xdaa5('0x31')};return mailRpc[_0xdaa5('0x32')](this[_0xdaa5('0x24')][_0xdaa5('0x33')],_0x142afc)[_0xdaa5('0x34')](function(_0x2e0c35){logger[_0xdaa5('0x15')](_0xdaa5('0x35'),_0x326545);_0x142afc[_0xdaa5('0x29')]=_0x2e0c35['message'][_0xdaa5('0x29')];return rpc[_0x264004+_0xdaa5('0x27')][_0xdaa5('0x36')](_0x142afc);})[_0xdaa5('0x34')](function(_0x260d31){logger[_0xdaa5('0x15')]('[%s][AUTOREPLY]\x20%s',_0x326545,JSON[_0xdaa5('0x37')](_0x260d31));})['catch'](function(_0x439700){logger['error']('[RPC][%s][AUTOREPLY]\x20%s',_0x326545,JSON[_0xdaa5('0x37')](_0x439700));})[_0xdaa5('0x38')](function(){Promise['resolve']()[_0xdaa5('0x34')](function(){if(_0x2f48cd[0x0]!=='2'||_0xd3444e['autoreplyExecuted'])return;return rpc[_0x264004+_0xdaa5('0x39')][_0xdaa5('0x3a')](_0xd3444e['id'],{'autoreplyExecuted':!![]})[_0xdaa5('0x34')](function(_0x56c30f){logger[_0xdaa5('0x15')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x326545,JSON[_0xdaa5('0x37')](_0x56c30f));})['catch'](function(_0x4b897c){logger[_0xdaa5('0x3b')](_0xdaa5('0x3c'),_0x326545,JSON[_0xdaa5('0x37')](_0x4b897c));});})[_0xdaa5('0x34')](function(){_0x1402c7[_0xdaa5('0xf')]();});});}else{return rpc[this[_0xdaa5('0xb')]+_0xdaa5('0x27')][_0xdaa5('0x36')](_0x142afc)['then'](function(){logger['info'](_0xdaa5('0xd'),_0x326545,_0x142afc[_0xdaa5('0xc')]);})['catch'](function(_0x478eca){logger['error'](_0xdaa5('0xd'),_0x326545,JSON['stringify'](_0x478eca));})[_0xdaa5('0x38')](function(){Promise['resolve']()[_0xdaa5('0x34')](function(){if(_0x2f48cd[0x0]!=='2'||_0xd3444e[_0xdaa5('0x14')])return;return rpc[_0x264004+'Interaction'][_0xdaa5('0x3a')](_0xd3444e['id'],{'autoreplyExecuted':!![]})[_0xdaa5('0x34')](function(_0x122d96){logger[_0xdaa5('0x15')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x326545,JSON['stringify'](_0x122d96));})[_0xdaa5('0x3d')](function(_0x1c505c){logger['error'](_0xdaa5('0x3c'),_0x326545,JSON['stringify'](_0x1c505c));});})[_0xdaa5('0x34')](function(){_0x1402c7['next']();});});}}}catch(_0x4c5efa){logger[_0xdaa5('0x3b')](_0xdaa5('0xd'),_0x326545,JSON[_0xdaa5('0x37')](_0x4c5efa));_0x1402c7[_0xdaa5('0x3e')]();}};}; \ No newline at end of file +var _0x2617=['account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','html','','replace','';_0x1a836b[_0x7261('0x38')]={'Auto-Submitted':_0x7261('0x39'),'X-Auto-Response-Suppress':_0x7261('0x3a'),'Precedence':'auto_reply'};return mailRpc[_0x7261('0x3b')](this[_0x7261('0x2c')]['smtpOptions'],_0x1a836b)['then'](function(_0x29d709){logger[_0x7261('0x1b')](_0x7261('0x3c'),_0x361377);_0x1a836b[_0x7261('0x32')]=_0x29d709[_0x7261('0x24')]['messageId'];return rpc[_0x1eb435+'Message'][_0x7261('0x3d')](_0x1a836b);})[_0x7261('0x3e')](function(_0x29f03a){logger[_0x7261('0x1b')](_0x7261('0x16'),_0x361377,JSON[_0x7261('0x3f')](_0x29f03a));})['catch'](function(_0x14c469){logger[_0x7261('0x40')](_0x7261('0x41'),_0x361377,JSON['stringify'](_0x14c469));})['finally'](function(){Promise[_0x7261('0x42')]()[_0x7261('0x3e')](function(){if(_0x494f48[0x0]!=='2'||_0x21e5a2[_0x7261('0x1d')])return;return rpc[_0x1eb435+'Interaction'][_0x7261('0x43')](_0x21e5a2['id'],{'autoreplyExecuted':!![]})[_0x7261('0x3e')](function(_0x43e4ff){logger['info'](_0x7261('0x1e'),_0x361377,JSON[_0x7261('0x3f')](_0x43e4ff));})[_0x7261('0x44')](function(_0x10e29b){logger[_0x7261('0x40')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x361377,JSON['stringify'](_0x10e29b));});})['then'](function(){_0xb21c51[_0x7261('0x17')]();});});}else{return rpc[this[_0x7261('0x12')]+'Message'][_0x7261('0x3d')](_0x1a836b)[_0x7261('0x3e')](function(){logger[_0x7261('0x1b')](_0x7261('0x16'),_0x361377,_0x1a836b['body']);})['catch'](function(_0x4fff79){logger[_0x7261('0x40')](_0x7261('0x16'),_0x361377,JSON[_0x7261('0x3f')](_0x4fff79));})[_0x7261('0x45')](function(){Promise[_0x7261('0x42')]()[_0x7261('0x3e')](function(){if(_0x494f48[0x0]!=='2'||_0x21e5a2['autoreplyExecuted'])return;return rpc[_0x1eb435+'Interaction'][_0x7261('0x43')](_0x21e5a2['id'],{'autoreplyExecuted':!![]})[_0x7261('0x3e')](function(_0x56b326){logger[_0x7261('0x1b')](_0x7261('0x1e'),_0x361377,JSON[_0x7261('0x3f')](_0x56b326));})[_0x7261('0x44')](function(_0x14329b){logger[_0x7261('0x40')](_0x7261('0x46'),_0x361377,JSON['stringify'](_0x14329b));});})[_0x7261('0x3e')](function(){_0xb21c51[_0x7261('0x17')]();});});}}}catch(_0x216c12){logger[_0x7261('0x40')](_0x7261('0x16'),_0x361377,JSON['stringify'](_0x216c12));_0xb21c51[_0x7261('0x47')]();}};}; \ 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 813ae7e..b55ee5f 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 _0xfe68=['../../rpc/smsInteraction','../../rpc/faxInteraction','consequence','info','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','stringify','stop','[%s][CLOSE]\x20%s','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0x5523ac,_0x15b2bc){var _0x292fb8=function(_0x45a0e0){while(--_0x45a0e0){_0x5523ac['push'](_0x5523ac['shift']());}};_0x292fb8(++_0x15b2bc);}(_0xfe68,0x122));var _0x8fe6=function(_0x4604ad,_0x2c516e){_0x4604ad=_0x4604ad-0x0;var _0x3ed8ef=_0xfe68[_0x4604ad];return _0x3ed8ef;};'use strict';var moment=require(_0x8fe6('0x0'));var logger=require(_0x8fe6('0x1'))('routing');var rpc={'chatInteraction':require(_0x8fe6('0x2')),'openchannelInteraction':require(_0x8fe6('0x3')),'smsInteraction':require(_0x8fe6('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x8fe6('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x8fe6('0x6')]=function(_0x1fb0ec,_0x246119,_0x23d263,_0xe494e9){return function(_0x3de56c){try{logger[_0x8fe6('0x7')]('[%s][CLOSE]\x20reason\x20%s',_0x1fb0ec,_0x246119[0x0]);var _0x1cbbaa={'closed':0x1,'closedAt':moment()[_0x8fe6('0x8')](_0x8fe6('0x9')),'closeReason':_0x8fe6('0xa'),'disposition':_0x246119[0x0]};if(rpc[_0xe494e9[_0x8fe6('0xb')]+_0x8fe6('0xc')]){rpc[_0xe494e9[_0x8fe6('0xb')]+_0x8fe6('0xc')][_0x8fe6('0xd')](_0xe494e9[_0x8fe6('0xe')]['id'],_0x1cbbaa)[_0x8fe6('0xf')](function(_0x496401){logger[_0x8fe6('0x7')](_0x8fe6('0x10'),_0x1fb0ec,_0xe494e9[_0x8fe6('0xe')]['id']);})['catch'](function(_0x3e40d0){logger[_0x8fe6('0x11')]('[%s][CLOSE]\x20%s',_0x1fb0ec,JSON[_0x8fe6('0x12')](_0x3e40d0));})['finally'](function(){_0x3de56c[_0x8fe6('0x13')]();});}}catch(_0x503c73){logger[_0x8fe6('0x11')](_0x8fe6('0x14'),_0x1fb0ec,JSON[_0x8fe6('0x12')](_0x503c73));_0x3de56c['stop']();}};}; \ No newline at end of file +var _0xe1d2=['stop','moment','routing','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','finally'];(function(_0x453e2f,_0x2cf512){var _0x557b67=function(_0x5a7da4){while(--_0x5a7da4){_0x453e2f['push'](_0x453e2f['shift']());}};_0x557b67(++_0x2cf512);}(_0xe1d2,0x105));var _0x2e1d=function(_0x2b2e14,_0x9d7db0){_0x2b2e14=_0x2b2e14-0x0;var _0x13b47e=_0xe1d2[_0x2b2e14];return _0x13b47e;};'use strict';var moment=require(_0x2e1d('0x0'));var logger=require('../../../../config/logger')(_0x2e1d('0x1'));var rpc={'chatInteraction':require(_0x2e1d('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x2e1d('0x3')),'faxInteraction':require(_0x2e1d('0x4')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x2e1d('0x5')]=function(_0x247698,_0x284d2c,_0x50bde0,_0x2d933d){return function(_0x1a15ab){try{logger[_0x2e1d('0x6')]('[%s][CLOSE]\x20reason\x20%s',_0x247698,_0x284d2c[0x0]);var _0x51484c={'closed':0x1,'closedAt':moment()[_0x2e1d('0x7')](_0x2e1d('0x8')),'closeReason':_0x2e1d('0x9'),'disposition':_0x284d2c[0x0]};if(rpc[_0x2d933d[_0x2e1d('0xa')]+_0x2e1d('0xb')]){rpc[_0x2d933d[_0x2e1d('0xa')]+_0x2e1d('0xb')][_0x2e1d('0xc')](_0x2d933d[_0x2e1d('0xd')]['id'],_0x51484c)['then'](function(_0x2d1b91){logger[_0x2e1d('0x6')](_0x2e1d('0xe'),_0x247698,_0x2d933d[_0x2e1d('0xd')]['id']);})['catch'](function(_0x35a02e){logger[_0x2e1d('0xf')](_0x2e1d('0x10'),_0x247698,JSON[_0x2e1d('0x11')](_0x35a02e));})[_0x2e1d('0x12')](function(){_0x1a15ab[_0x2e1d('0x13')]();});}}catch(_0x51b1d1){logger[_0x2e1d('0xf')](_0x2e1d('0x10'),_0x247698,JSON['stringify'](_0x51b1d1));_0x1a15ab[_0x2e1d('0x13')]();}};}; \ 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 c844601..24da2f8 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 _0x4cfd=['body','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','textRequest','message','dialogflow','result','providerResponse','metadata','endConversation','stop','lodash','moment','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','isEmpty'];(function(_0x5dd69b,_0x118e05){var _0x1bc678=function(_0x4ff184){while(--_0x4ff184){_0x5dd69b['push'](_0x5dd69b['shift']());}};_0x1bc678(++_0x118e05);}(_0x4cfd,0x170));var _0xd4cf=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0x4cfd[_0x215e65];return _0xa85842;};'use strict';var _=require(_0xd4cf('0x0'));var moment=require(_0xd4cf('0x1'));var apiai=require('apiai-promise');var md5=require(_0xd4cf('0x2'));var utils=require(_0xd4cf('0x3'));var logger=require(_0xd4cf('0x4'))(_0xd4cf('0x5'));var rpc={'chatMessage':require(_0xd4cf('0x6')),'openchannelMessage':require(_0xd4cf('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xd4cf('0x8')),'faxMessage':require(_0xd4cf('0x9')),'whatsappMessage':require(_0xd4cf('0xa'))};exports[_0xd4cf('0xb')]=function(_0x2ebea9,_0x1b5e6f){return function(_0x4c992d){try{if(!_[_0xd4cf('0xc')](this[_0xd4cf('0xd')][_0xd4cf('0xe')])){logger[_0xd4cf('0xf')](_0xd4cf('0x10'),_0x2ebea9,_0xd4cf('0x11'));return _0x4c992d[_0xd4cf('0x12')]();}var _0x4cca5e={'ContactId':this[_0xd4cf('0x13')]['id'],'sentAt':moment()[_0xd4cf('0x14')](_0xd4cf('0x15')),'direction':_0xd4cf('0x16')};if(this[_0xd4cf('0x17')]==='sms'||this['channel']===_0xd4cf('0x18')){_0x4cca5e[_0xd4cf('0x19')]=this['interaction'][_0xd4cf('0x19')];}var _0x539d06=this[_0xd4cf('0x17')];if(_0x539d06==='chat'){_0x4cca5e[_0xd4cf('0x1a')]=this[_0xd4cf('0x1b')]['id'];}else{_0x4cca5e[_['upperFirst'](_0x539d06)+_0xd4cf('0x1c')]=this[_0xd4cf('0x1b')]['id'];}_0x4cca5e[_[_0xd4cf('0x1d')](_0x539d06)+_0xd4cf('0x1e')]=this[_0xd4cf('0xd')]['id'];if(this[_0xd4cf('0xd')]['created']){var _0x3aa40d=_0x1b5e6f[0x2];if(!_[_0xd4cf('0x1f')](_0x3aa40d)){_0x4cca5e[_0xd4cf('0x20')]=utils[_0xd4cf('0x21')](_0x3aa40d,this);return rpc[_0x539d06+_0xd4cf('0x22')][_0xd4cf('0x23')](_0x4cca5e)[_0xd4cf('0x24')](function(_0x1df3e0){logger[_0xd4cf('0xf')](_0xd4cf('0x10'),_0x2ebea9,_0x4cca5e[_0xd4cf('0x20')]);})[_0xd4cf('0x25')](function(_0x32c249){logger[_0xd4cf('0x26')](_0xd4cf('0x10'),_0x2ebea9,JSON[_0xd4cf('0x27')](_0x32c249));})[_0xd4cf('0x28')](function(){logger[_0xd4cf('0xf')](_0xd4cf('0x29'),_0x2ebea9);_0x4c992d['stop']();});}else{logger[_0xd4cf('0xf')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x2ebea9);_0x4c992d['stop']();}}else{var _0x10f6a7=this;var _0x3dbe6d=apiai(_0x1b5e6f[0x0],{'language':_0x1b5e6f[0x1]||'en'});return _0x3dbe6d[_0xd4cf('0x2a')](this[_0xd4cf('0x2b')][_0xd4cf('0x20')],{'sessionId':md5(this[_0xd4cf('0xd')]['id'])})['then'](function(_0x14c159){_0x10f6a7['body'][_0xd4cf('0x2c')]=_0x14c159;_0x4cca5e[_0xd4cf('0x20')]=_0x14c159[_0xd4cf('0x2d')]['fulfillment']['speech'];_0x4cca5e['providerName']=_0xd4cf('0x2c');_0x4cca5e[_0xd4cf('0x2e')]=JSON['stringify'](_0x14c159);return rpc[_0x539d06+'Message']['create'](_0x4cca5e)[_0xd4cf('0x24')](function(_0x5a3962){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x2ebea9,_0x4cca5e[_0xd4cf('0x20')]);if(_0x14c159['result'][_0xd4cf('0x2f')][_0xd4cf('0x30')]){_0x4c992d[_0xd4cf('0x12')]();}else{_0x4c992d[_0xd4cf('0x31')]();}})[_0xd4cf('0x25')](function(_0x2183c1){logger[_0xd4cf('0x26')](_0xd4cf('0x10'),_0x2ebea9,JSON['stringify'](_0x2183c1));_0x4c992d[_0xd4cf('0x12')]();});})[_0xd4cf('0x25')](function(_0x155f50){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x2ebea9,_0x155f50[_0xd4cf('0x2b')]);_0x4c992d[_0xd4cf('0x12')]();});}}catch(_0x37b387){logger[_0xd4cf('0x26')](_0xd4cf('0x10'),_0x2ebea9,JSON[_0xd4cf('0x27')](_0x37b387));_0x4c992d[_0xd4cf('0x31')]();}};}; \ No newline at end of file +var _0x7e4b=['out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','dialogflow','result','fulfillment','speech','providerResponse','metadata','endConversation','lodash','moment','md5','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x15e8ac,_0x24a790){var _0x2831f5=function(_0x243639){while(--_0x243639){_0x15e8ac['push'](_0x15e8ac['shift']());}};_0x2831f5(++_0x24a790);}(_0x7e4b,0x84));var _0xb7e4=function(_0x43f04a,_0x2f92ea){_0x43f04a=_0x43f04a-0x0;var _0x55a3b5=_0x7e4b[_0x43f04a];return _0x55a3b5;};'use strict';var _=require(_0xb7e4('0x0'));var moment=require(_0xb7e4('0x1'));var apiai=require('apiai-promise');var md5=require(_0xb7e4('0x2'));var utils=require(_0xb7e4('0x3'));var logger=require('../../../../config/logger')(_0xb7e4('0x4'));var rpc={'chatMessage':require(_0xb7e4('0x5')),'openchannelMessage':require(_0xb7e4('0x6')),'mailMessage':require(_0xb7e4('0x7')),'smsMessage':require(_0xb7e4('0x8')),'faxMessage':require(_0xb7e4('0x9')),'whatsappMessage':require(_0xb7e4('0xa'))};exports[_0xb7e4('0xb')]=function(_0x1d49a7,_0x4ba34c){return function(_0x334af2){try{if(!_['isNil'](this[_0xb7e4('0xc')][_0xb7e4('0xd')])){logger[_0xb7e4('0xe')](_0xb7e4('0xf'),_0x1d49a7,_0xb7e4('0x10'));return _0x334af2[_0xb7e4('0x11')]();}var _0x1c5eb8={'ContactId':this[_0xb7e4('0x12')]['id'],'sentAt':moment()[_0xb7e4('0x13')](_0xb7e4('0x14')),'direction':_0xb7e4('0x15')};if(this[_0xb7e4('0x16')]===_0xb7e4('0x17')||this['channel']==='whatsapp'){_0x1c5eb8[_0xb7e4('0x18')]=this[_0xb7e4('0xc')]['phone'];}var _0x2e6d47=this[_0xb7e4('0x16')];if(_0x2e6d47===_0xb7e4('0x19')){_0x1c5eb8[_0xb7e4('0x1a')]=this[_0xb7e4('0x1b')]['id'];}else{_0x1c5eb8[_[_0xb7e4('0x1c')](_0x2e6d47)+_0xb7e4('0x1d')]=this[_0xb7e4('0x1b')]['id'];}_0x1c5eb8[_[_0xb7e4('0x1c')](_0x2e6d47)+_0xb7e4('0x1e')]=this[_0xb7e4('0xc')]['id'];if(this[_0xb7e4('0xc')][_0xb7e4('0x1f')]){var _0x3a08f1=_0x4ba34c[0x2];if(!_['isEmpty'](_0x3a08f1)){_0x1c5eb8[_0xb7e4('0x20')]=utils[_0xb7e4('0x21')](_0x3a08f1,this);return rpc[_0x2e6d47+_0xb7e4('0x22')][_0xb7e4('0x23')](_0x1c5eb8)[_0xb7e4('0x24')](function(_0x88906e){logger[_0xb7e4('0xe')](_0xb7e4('0xf'),_0x1d49a7,_0x1c5eb8[_0xb7e4('0x20')]);})[_0xb7e4('0x25')](function(_0x4ee2f0){logger[_0xb7e4('0x26')](_0xb7e4('0xf'),_0x1d49a7,JSON[_0xb7e4('0x27')](_0x4ee2f0));})[_0xb7e4('0x28')](function(){logger[_0xb7e4('0xe')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x1d49a7);_0x334af2[_0xb7e4('0x29')]();});}else{logger[_0xb7e4('0xe')](_0xb7e4('0x2a'),_0x1d49a7);_0x334af2[_0xb7e4('0x29')]();}}else{var _0x18e4fb=this;var _0xba07f=apiai(_0x4ba34c[0x0],{'language':_0x4ba34c[0x1]||'en'});return _0xba07f['textRequest'](this[_0xb7e4('0x2b')][_0xb7e4('0x20')],{'sessionId':md5(this[_0xb7e4('0xc')]['id'])})[_0xb7e4('0x24')](function(_0x56e2e6){_0x18e4fb[_0xb7e4('0x20')][_0xb7e4('0x2c')]=_0x56e2e6;_0x1c5eb8['body']=_0x56e2e6[_0xb7e4('0x2d')][_0xb7e4('0x2e')][_0xb7e4('0x2f')];_0x1c5eb8['providerName']=_0xb7e4('0x2c');_0x1c5eb8[_0xb7e4('0x30')]=JSON['stringify'](_0x56e2e6);return rpc[_0x2e6d47+_0xb7e4('0x22')][_0xb7e4('0x23')](_0x1c5eb8)['then'](function(_0x1a9d1c){logger[_0xb7e4('0xe')](_0xb7e4('0xf'),_0x1d49a7,_0x1c5eb8['body']);if(_0x56e2e6[_0xb7e4('0x2d')][_0xb7e4('0x31')][_0xb7e4('0x32')]){_0x334af2[_0xb7e4('0x11')]();}else{_0x334af2[_0xb7e4('0x29')]();}})[_0xb7e4('0x25')](function(_0x2cd691){logger[_0xb7e4('0x26')](_0xb7e4('0xf'),_0x1d49a7,JSON[_0xb7e4('0x27')](_0x2cd691));_0x334af2[_0xb7e4('0x11')]();});})[_0xb7e4('0x25')](function(_0x16524e){logger['error'](_0xb7e4('0xf'),_0x1d49a7,_0x16524e[_0xb7e4('0x2b')]);_0x334af2[_0xb7e4('0x11')]();});}}catch(_0x222529){logger['error'](_0xb7e4('0xf'),_0x1d49a7,JSON[_0xb7e4('0x27')](_0x222529));_0x334af2[_0xb7e4('0x29')]();}};}; \ 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 d465479..8bd0e16 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 _0xa22a=['channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','create','catch','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','boolValue','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','fulfillmentText','push','all','lodash','dialogflow','md5','moment','bluebird','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','body','Message','then','error','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','interaction','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out'];(function(_0x12d48d,_0x4c060b){var _0x4503da=function(_0x1e80b4){while(--_0x1e80b4){_0x12d48d['push'](_0x12d48d['shift']());}};_0x4503da(++_0x4c060b);}(_0xa22a,0x153));var _0xaa22=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xa22a[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xaa22('0x0'));var dialogflow=require(_0xaa22('0x1'));var md5=require(_0xaa22('0x2'));var moment=require(_0xaa22('0x3'));var Promise=require(_0xaa22('0x4'));var logger=require('../../../../config/logger')(_0xaa22('0x5'));var utils=require(_0xaa22('0x6'));var rpc={'chatMessage':require(_0xaa22('0x7')),'openchannelMessage':require(_0xaa22('0x8')),'mailMessage':require(_0xaa22('0x9')),'smsMessage':require(_0xaa22('0xa')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xaa22('0xb'))};function createMessage(_0x4b03ae,_0x45b092,_0x2a556a,_0x145ae0){return new Promise(function(_0x2136d6,_0x57572d){var _0x3544a1=_['clone'](_0x2a556a);_0x3544a1[_0xaa22('0xc')]=_0x145ae0;return rpc[_0x45b092+_0xaa22('0xd')]['create'](_0x3544a1)[_0xaa22('0xe')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x4b03ae,_0x3544a1[_0xaa22('0xc')]);_0x2136d6();})['catch'](function(_0x449289){logger[_0xaa22('0xf')](_0xaa22('0x10'),_0x4b03ae,JSON[_0xaa22('0x11')](_0x449289));_0x57572d(_0x449289);});});}exports[_0xaa22('0x12')]=function(_0x40dffc,_0x82ec35){return function(_0x2e2c54){try{if(!_[_0xaa22('0x13')](this[_0xaa22('0x14')]['UserId'])){logger[_0xaa22('0x15')](_0xaa22('0x10'),_0x40dffc,_0xaa22('0x16'));return _0x2e2c54[_0xaa22('0x17')]();}var _0x1c56d3={'ContactId':this[_0xaa22('0x18')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xaa22('0x19')};if(this[_0xaa22('0x1a')]===_0xaa22('0x1b')||this[_0xaa22('0x1a')]===_0xaa22('0x1c')){_0x1c56d3[_0xaa22('0x1d')]=this['interaction']['phone'];}var _0x227a50=this[_0xaa22('0x1a')];if(_0x227a50===_0xaa22('0x1e')){_0x1c56d3[_0xaa22('0x1f')]=this[_0xaa22('0x20')]['id'];}else{_0x1c56d3[_[_0xaa22('0x21')](_0x227a50)+_0xaa22('0x22')]=this[_0xaa22('0x20')]['id'];}_0x1c56d3[_[_0xaa22('0x21')](_0x227a50)+_0xaa22('0x23')]=this[_0xaa22('0x14')]['id'];if(this[_0xaa22('0x14')][_0xaa22('0x24')]){var _0x2da6df=_0x82ec35[0x4];if(!_[_0xaa22('0x25')](_0x2da6df)){_0x1c56d3['body']=utils[_0xaa22('0x26')](_0x2da6df,this);return rpc[_0x227a50+_0xaa22('0xd')][_0xaa22('0x27')](_0x1c56d3)[_0xaa22('0xe')](function(_0x343f81){logger[_0xaa22('0x15')](_0xaa22('0x10'),_0x40dffc,_0x1c56d3[_0xaa22('0xc')]);})[_0xaa22('0x28')](function(_0x3cc867){logger[_0xaa22('0xf')](_0xaa22('0x10'),_0x40dffc,JSON[_0xaa22('0x11')](_0x3cc867));})[_0xaa22('0x29')](function(){logger['info'](_0xaa22('0x2a'),_0x40dffc);_0x2e2c54[_0xaa22('0x2b')]();});}else{logger['info'](_0xaa22('0x2c'),_0x40dffc);_0x2e2c54[_0xaa22('0x2b')]();}}else{var _0x5132d4=this;var _0xcfaffa=_0x82ec35[0x2][_0xaa22('0x2d')](/\\n/g,'\x0a');var _0x5e4681={'credentials':{'private_key':_0xcfaffa,'client_email':_0x82ec35[0x1]}};var _0x4e3267=new dialogflow[(_0xaa22('0x2e'))](_0x5e4681);var _0x5b5104=_0x4e3267[_0xaa22('0x2f')](_0x82ec35[0x0],md5(_0x5132d4['interaction']['id']));var _0x490160={'session':_0x5b5104,'queryInput':{'text':{'text':_0x5132d4[_0xaa22('0x30')]['body'],'languageCode':_0x82ec35[0x3]||'en'}}};return _0x4e3267['detectIntent'](_0x490160)[_0xaa22('0xe')](function(_0x5aeae1){if(_0x5aeae1&&_0x5aeae1['length']){_0x5132d4['body'][_0xaa22('0x31')]=_0x5aeae1;var _0x31a245=_0x5aeae1[0x0];var _0x58b829=_0x31a245[_0xaa22('0x32')]['diagnosticInfo']&&_0x31a245['queryResult'][_0xaa22('0x33')][_0xaa22('0x34')]?_0x31a245[_0xaa22('0x32')][_0xaa22('0x33')][_0xaa22('0x34')][_0xaa22('0x35')]['boolValue']:![];_0x5132d4[_0xaa22('0xc')][_0xaa22('0x36')]=_0x31a245[_0xaa22('0x32')][_0xaa22('0x37')];_0x5132d4[_0xaa22('0xc')][_0xaa22('0x38')]=_0x31a245[_0xaa22('0x32')][_0xaa22('0x39')];_0x5132d4['body']['DIALOGFLOWV2_ENDCONVERSATION']=_0x31a245[_0xaa22('0x32')]['diagnosticInfo']&&_0x31a245[_0xaa22('0x32')][_0xaa22('0x33')][_0xaa22('0x34')]?_0x31a245[_0xaa22('0x32')][_0xaa22('0x33')][_0xaa22('0x34')][_0xaa22('0x35')][_0xaa22('0x3a')]:![];_0x5132d4[_0xaa22('0xc')][_0xaa22('0x3b')]=_0x31a245[_0xaa22('0x32')]['intent'][_0xaa22('0x3c')];_0x5132d4[_0xaa22('0xc')][_0xaa22('0x3d')]=_0x31a245[_0xaa22('0x32')][_0xaa22('0x3e')][_0xaa22('0x3f')];_0x5132d4[_0xaa22('0xc')][_0xaa22('0x40')]=_0x31a245[_0xaa22('0x32')]['intent'][_0xaa22('0x41')];_0x5132d4['body'][_0xaa22('0x42')]=_0x31a245[_0xaa22('0x32')]['languageCode'];_0x5132d4['body'][_0xaa22('0x43')]=_0x31a245[_0xaa22('0x32')][_0xaa22('0x44')];_0x5132d4[_0xaa22('0xc')][_0xaa22('0x45')]=_0x31a245[_0xaa22('0x32')]['intentDetectionConfidence'];_0x1c56d3['providerName']=_0xaa22('0x31');_0x1c56d3['providerResponse']=JSON[_0xaa22('0x11')](_0x5aeae1);var _0x18fc90=[];for(var _0x520a3=0x0;_0x520a3<_0x5aeae1['length'];_0x520a3++){var _0x48c957=_0x5aeae1[_0x520a3];if(_0x48c957&&_0x48c957[_0xaa22('0x32')]&&_0x48c957[_0xaa22('0x32')][_0xaa22('0x46')]){_0x18fc90[_0xaa22('0x47')](createMessage(_0x40dffc,_0x227a50,_0x1c56d3,_0x48c957[_0xaa22('0x32')][_0xaa22('0x46')]));}}return Promise[_0xaa22('0x48')](_0x18fc90)['then'](function(){if(_0x58b829){_0x2e2c54[_0xaa22('0x17')]();}else{_0x2e2c54['stop']();}})[_0xaa22('0x28')](function(_0x517e42){logger[_0xaa22('0xf')](_0xaa22('0x10'),_0x40dffc,JSON[_0xaa22('0x11')](_0x517e42));_0x2e2c54['next']();});}})[_0xaa22('0x28')](function(_0x5d6003){logger[_0xaa22('0xf')](_0xaa22('0x10'),_0x40dffc,_0x5d6003[_0xaa22('0x30')]);_0x2e2c54[_0xaa22('0x17')]();});}}catch(_0x49fdbe){logger[_0xaa22('0xf')](_0xaa22('0x10'),_0x40dffc,JSON[_0xaa22('0x11')](_0x49fdbe));_0x2e2c54['stop']();}};}; \ No newline at end of file +var _0x32ff=['ChatWebsiteId','upperFirst','AccountId','InteractionId','created','isEmpty','create','then','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','fields','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','all','message','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','clone','body','Message','info','catch','error','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','phone','chat'];(function(_0x520062,_0xb840f2){var _0x31e31e=function(_0x203afb){while(--_0x203afb){_0x520062['push'](_0x520062['shift']());}};_0x31e31e(++_0xb840f2);}(_0x32ff,0xc7));var _0xf32f=function(_0x5b3272,_0x590e02){_0x5b3272=_0x5b3272-0x0;var _0x370472=_0x32ff[_0x5b3272];return _0x370472;};'use strict';var _=require(_0xf32f('0x0'));var dialogflow=require(_0xf32f('0x1'));var md5=require(_0xf32f('0x2'));var moment=require(_0xf32f('0x3'));var Promise=require(_0xf32f('0x4'));var logger=require(_0xf32f('0x5'))(_0xf32f('0x6'));var utils=require(_0xf32f('0x7'));var rpc={'chatMessage':require(_0xf32f('0x8')),'openchannelMessage':require(_0xf32f('0x9')),'mailMessage':require(_0xf32f('0xa')),'smsMessage':require(_0xf32f('0xb')),'faxMessage':require(_0xf32f('0xc')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x1b688d,_0x4e4d6e,_0x40f495,_0x2756a3){return new Promise(function(_0x23618f,_0x3ebe43){var _0x2e360b=_[_0xf32f('0xd')](_0x40f495);_0x2e360b[_0xf32f('0xe')]=_0x2756a3;return rpc[_0x4e4d6e+_0xf32f('0xf')]['create'](_0x2e360b)['then'](function(){logger[_0xf32f('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x1b688d,_0x2e360b['body']);_0x23618f();})[_0xf32f('0x11')](function(_0xaa135f){logger[_0xf32f('0x12')](_0xf32f('0x13'),_0x1b688d,JSON[_0xf32f('0x14')](_0xaa135f));_0x3ebe43(_0xaa135f);});});}exports[_0xf32f('0x15')]=function(_0x257380,_0x364948){return function(_0x5520fe){try{if(!_['isNil'](this[_0xf32f('0x16')][_0xf32f('0x17')])){logger[_0xf32f('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x257380,_0xf32f('0x18'));return _0x5520fe[_0xf32f('0x19')]();}var _0xeec5c={'ContactId':this[_0xf32f('0x1a')]['id'],'sentAt':moment()[_0xf32f('0x1b')](_0xf32f('0x1c')),'direction':'out'};if(this[_0xf32f('0x1d')]==='sms'||this[_0xf32f('0x1d')]==='whatsapp'){_0xeec5c[_0xf32f('0x1e')]=this[_0xf32f('0x16')][_0xf32f('0x1e')];}var _0x369812=this['channel'];if(_0x369812===_0xf32f('0x1f')){_0xeec5c[_0xf32f('0x20')]=this['account']['id'];}else{_0xeec5c[_[_0xf32f('0x21')](_0x369812)+_0xf32f('0x22')]=this['account']['id'];}_0xeec5c[_[_0xf32f('0x21')](_0x369812)+_0xf32f('0x23')]=this[_0xf32f('0x16')]['id'];if(this[_0xf32f('0x16')][_0xf32f('0x24')]){var _0x4699b4=_0x364948[0x4];if(!_[_0xf32f('0x25')](_0x4699b4)){_0xeec5c[_0xf32f('0xe')]=utils['getMustacheRender'](_0x4699b4,this);return rpc[_0x369812+_0xf32f('0xf')][_0xf32f('0x26')](_0xeec5c)[_0xf32f('0x27')](function(_0x27007d){logger[_0xf32f('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x257380,_0xeec5c[_0xf32f('0xe')]);})['catch'](function(_0x2dd1e4){logger[_0xf32f('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x257380,JSON['stringify'](_0x2dd1e4));})['finally'](function(){logger[_0xf32f('0x10')](_0xf32f('0x28'),_0x257380);_0x5520fe[_0xf32f('0x29')]();});}else{logger[_0xf32f('0x10')](_0xf32f('0x2a'),_0x257380);_0x5520fe[_0xf32f('0x29')]();}}else{var _0x1e504f=this;var _0x26bcee=_0x364948[0x2][_0xf32f('0x2b')](/\\n/g,'\x0a');var _0xf409ed={'credentials':{'private_key':_0x26bcee,'client_email':_0x364948[0x1]}};var _0x328c15=new dialogflow[(_0xf32f('0x2c'))](_0xf409ed);var _0x4f9feb=_0x328c15[_0xf32f('0x2d')](_0x364948[0x0],md5(_0x1e504f[_0xf32f('0x16')]['id']));var _0x375e57={'session':_0x4f9feb,'queryInput':{'text':{'text':_0x1e504f['message'][_0xf32f('0xe')],'languageCode':_0x364948[0x3]||'en'}}};return _0x328c15[_0xf32f('0x2e')](_0x375e57)[_0xf32f('0x27')](function(_0x165ea1){if(_0x165ea1&&_0x165ea1[_0xf32f('0x2f')]){_0x1e504f[_0xf32f('0xe')][_0xf32f('0x30')]=_0x165ea1;var _0x51c0da=_0x165ea1[0x0];var _0x83d503=_0x51c0da[_0xf32f('0x31')][_0xf32f('0x32')]&&_0x51c0da[_0xf32f('0x31')][_0xf32f('0x32')]['fields']?_0x51c0da[_0xf32f('0x31')]['diagnosticInfo']['fields'][_0xf32f('0x33')][_0xf32f('0x34')]:![];_0x1e504f[_0xf32f('0xe')][_0xf32f('0x35')]=_0x51c0da[_0xf32f('0x31')][_0xf32f('0x36')];_0x1e504f['body'][_0xf32f('0x37')]=_0x51c0da[_0xf32f('0x31')][_0xf32f('0x38')];_0x1e504f[_0xf32f('0xe')][_0xf32f('0x39')]=_0x51c0da[_0xf32f('0x31')][_0xf32f('0x32')]&&_0x51c0da[_0xf32f('0x31')]['diagnosticInfo'][_0xf32f('0x3a')]?_0x51c0da[_0xf32f('0x31')]['diagnosticInfo'][_0xf32f('0x3a')][_0xf32f('0x33')][_0xf32f('0x34')]:![];_0x1e504f['body'][_0xf32f('0x3b')]=_0x51c0da[_0xf32f('0x31')][_0xf32f('0x3c')][_0xf32f('0x3d')];_0x1e504f[_0xf32f('0xe')][_0xf32f('0x3e')]=_0x51c0da[_0xf32f('0x31')][_0xf32f('0x3c')][_0xf32f('0x3f')];_0x1e504f[_0xf32f('0xe')][_0xf32f('0x40')]=_0x51c0da[_0xf32f('0x31')][_0xf32f('0x3c')][_0xf32f('0x41')];_0x1e504f[_0xf32f('0xe')]['DIALOGFLOWV2_LANGUAGECODE']=_0x51c0da[_0xf32f('0x31')][_0xf32f('0x42')];_0x1e504f['body'][_0xf32f('0x43')]=_0x51c0da[_0xf32f('0x31')][_0xf32f('0x44')];_0x1e504f['body'][_0xf32f('0x45')]=_0x51c0da['queryResult'][_0xf32f('0x46')];_0xeec5c[_0xf32f('0x47')]='dialogflowV2';_0xeec5c[_0xf32f('0x48')]=JSON[_0xf32f('0x14')](_0x165ea1);var _0x550730=[];for(var _0x563f1a=0x0;_0x563f1a<_0x165ea1[_0xf32f('0x2f')];_0x563f1a++){var _0x388b34=_0x165ea1[_0x563f1a];if(_0x388b34&&_0x388b34[_0xf32f('0x31')]&&_0x388b34[_0xf32f('0x31')][_0xf32f('0x49')]){_0x550730[_0xf32f('0x4a')](createMessage(_0x257380,_0x369812,_0xeec5c,_0x388b34[_0xf32f('0x31')]['fulfillmentText']));}}return Promise[_0xf32f('0x4b')](_0x550730)['then'](function(){if(_0x83d503){_0x5520fe[_0xf32f('0x19')]();}else{_0x5520fe[_0xf32f('0x29')]();}})[_0xf32f('0x11')](function(_0x2c2f9f){logger[_0xf32f('0x12')](_0xf32f('0x13'),_0x257380,JSON[_0xf32f('0x14')](_0x2c2f9f));_0x5520fe[_0xf32f('0x19')]();});}})[_0xf32f('0x11')](function(_0x2f435d){logger[_0xf32f('0x12')](_0xf32f('0x13'),_0x257380,_0x2f435d[_0xf32f('0x4c')]);_0x5520fe[_0xf32f('0x19')]();});}}catch(_0x40faaa){logger['error'](_0xf32f('0x13'),_0x257380,JSON[_0xf32f('0x14')](_0x40faaa));_0x5520fe[_0xf32f('0x29')]();}};}; \ 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 59e7b7d..ec626b3 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 _0xeb54=['[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','../../../../config/logger','routing','string','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found'];(function(_0x1510e4,_0x1613e0){var _0xe0f3a9=function(_0x1af25f){while(--_0x1af25f){_0x1510e4['push'](_0x1510e4['shift']());}};_0xe0f3a9(++_0x1613e0);}(_0xeb54,0x14c));var _0x4eb5=function(_0x25534e,_0x316818){_0x25534e=_0x25534e-0x0;var _0x13e366=_0xeb54[_0x25534e];return _0x13e366;};'use strict';var schema=require(_0x4eb5('0x0'));var _=require(_0x4eb5('0x1'));var htmlToText=require(_0x4eb5('0x2'));var utils=require('./utils');var logger=require(_0x4eb5('0x3'))(_0x4eb5('0x4'));var gotoif=schema({'condition':{'type':_0x4eb5('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x4eb5('0x6'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x4eb5('0x6'),'message':_0x4eb5('0x7')}});exports[_0x4eb5('0x8')]=function(_0x20cd2a,_0x4f0a4c){return function(_0x3e5ef8){try{var _0x20adb9={'condition':htmlToText[_0x4eb5('0x9')](utils[_0x4eb5('0xa')](_0x4f0a4c[0x0],this),{'wordwrap':![]})[_0x4eb5('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4f0a4c[0x1],'priorityFalse':_0x4f0a4c[0x2]};var _0x59d83d=gotoif[_0x4eb5('0x0')](_0x20adb9,{'typecast':!![]});if(_0x59d83d[_0x4eb5('0xc')]){logger[_0x4eb5('0xd')](_0x4eb5('0xe'),_0x20cd2a,_[_0x4eb5('0xf')](_0x59d83d,_0x4eb5('0x10'))[_0x4eb5('0x11')](',\x20'));_0x3e5ef8[_0x4eb5('0x12')]();}else{try{var _0x172a45=eval('('+_0x20adb9[_0x4eb5('0x13')]+')');var _0x3dd77c=_0x172a45?_0x20adb9[_0x4eb5('0x14')]:_0x20adb9[_0x4eb5('0x15')];logger[_0x4eb5('0x16')](_0x4eb5('0x17'),_0x20cd2a,_0x20adb9['condition'],_0x172a45,_0x3dd77c||_0x4eb5('0x18'));if(_0x3dd77c){var _0x5d7fba=_[_0x4eb5('0x19')](_0x3e5ef8['rules'](),{'p':_0x3dd77c});if(_0x5d7fba>=0x0){logger['info'](_0x4eb5('0x1a'),_0x20cd2a,_0x3dd77c||_0x4eb5('0x18'),_0x5d7fba);_0x3e5ef8[_0x4eb5('0x18')](_0x5d7fba);}else{logger[_0x4eb5('0x16')](_0x4eb5('0x1b'),_0x20cd2a,_0x3dd77c||_0x4eb5('0x18'));_0x3e5ef8['stop']();}}else{_0x3e5ef8['next']();}}catch(_0x1a2a69){logger['error'](_0x4eb5('0x1c'),_0x20cd2a,_0x1a2a69[_0x4eb5('0x10')]);_0x3e5ef8['stop']();}}}catch(_0x30188d){logger[_0x4eb5('0xd')]('[%s][GOTOIF]\x20%s',_0x20cd2a,JSON[_0x4eb5('0x1d')](_0x30188d));_0x3e5ef8[_0x4eb5('0x12')]();}};}; \ No newline at end of file +var _0xb041=['getMustacheRender','replace','validate','length','error','map','message','stop','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','lodash','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString'];(function(_0x56ee34,_0x3cf604){var _0x1a27c2=function(_0x45626d){while(--_0x45626d){_0x56ee34['push'](_0x56ee34['shift']());}};_0x1a27c2(++_0x3cf604);}(_0xb041,0x12a));var _0x1b04=function(_0x3d1dc8,_0x10c198){_0x3d1dc8=_0x3d1dc8-0x0;var _0x4f0d1e=_0xb041[_0x3d1dc8];return _0x4f0d1e;};'use strict';var schema=require('validate');var _=require(_0x1b04('0x0'));var htmlToText=require(_0x1b04('0x1'));var utils=require('./utils');var logger=require(_0x1b04('0x2'))(_0x1b04('0x3'));var gotoif=schema({'condition':{'type':_0x1b04('0x4'),'required':!![],'message':_0x1b04('0x5')},'priorityTrue':{'type':_0x1b04('0x6'),'message':_0x1b04('0x7')},'priorityFalse':{'type':_0x1b04('0x6'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x1b04('0x8')]=function(_0x32e8ec,_0x3d015c){return function(_0x3c4b0f){try{var _0x550d4a={'condition':htmlToText[_0x1b04('0x9')](utils[_0x1b04('0xa')](_0x3d015c[0x0],this),{'wordwrap':![]})[_0x1b04('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3d015c[0x1],'priorityFalse':_0x3d015c[0x2]};var _0x20f9dd=gotoif[_0x1b04('0xc')](_0x550d4a,{'typecast':!![]});if(_0x20f9dd[_0x1b04('0xd')]){logger[_0x1b04('0xe')]('[%s][GOTOIF]\x20%s',_0x32e8ec,_[_0x1b04('0xf')](_0x20f9dd,_0x1b04('0x10'))['join'](',\x20'));_0x3c4b0f[_0x1b04('0x11')]();}else{try{var _0x2df6ce=eval('('+_0x550d4a[_0x1b04('0x12')]+')');var _0x4ade56=_0x2df6ce?_0x550d4a['priorityTrue']:_0x550d4a[_0x1b04('0x13')];logger[_0x1b04('0x14')](_0x1b04('0x15'),_0x32e8ec,_0x550d4a[_0x1b04('0x12')],_0x2df6ce,_0x4ade56||_0x1b04('0x16'));if(_0x4ade56){var _0x51eaa8=_[_0x1b04('0x17')](_0x3c4b0f[_0x1b04('0x18')](),{'p':_0x4ade56});if(_0x51eaa8>=0x0){logger[_0x1b04('0x14')](_0x1b04('0x19'),_0x32e8ec,_0x4ade56||'next',_0x51eaa8);_0x3c4b0f[_0x1b04('0x16')](_0x51eaa8);}else{logger[_0x1b04('0x14')](_0x1b04('0x1a'),_0x32e8ec,_0x4ade56||_0x1b04('0x16'));_0x3c4b0f[_0x1b04('0x11')]();}}else{_0x3c4b0f[_0x1b04('0x16')]();}}catch(_0x1581b6){logger[_0x1b04('0xe')](_0x1b04('0x1b'),_0x32e8ec,_0x1581b6[_0x1b04('0x10')]);_0x3c4b0f[_0x1b04('0x11')]();}}}catch(_0x1565f){logger[_0x1b04('0xe')]('[%s][GOTOIF]\x20%s',_0x32e8ec,JSON['stringify'](_0x1565f));_0x3c4b0f[_0x1b04('0x11')]();}};}; \ 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 2d14d76..a8a5756 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 _0x3cf9=['info','priority','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','error','stringify','validate','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','[%s][GOTOP]\x20%s','map','message','join'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x3cf9,0xd3));var _0x93cf=function(_0x1aef20,_0x4173f){_0x1aef20=_0x1aef20-0x0;var _0x216604=_0x3cf9[_0x1aef20];return _0x216604;};'use strict';var schema=require(_0x93cf('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')(_0x93cf('0x1'));var gotop=schema({'priority':{'type':_0x93cf('0x2'),'required':!![],'message':_0x93cf('0x3')}});exports[_0x93cf('0x4')]=function(_0x43d755,_0x1dc40a){return function(_0x14a52b){try{var _0x9e14d1={'priority':_0x1dc40a[0x0]};var _0x2c4881=gotop[_0x93cf('0x0')](_0x9e14d1,{'typecast':!![]});if(_0x2c4881[_0x93cf('0x5')]){logger['error'](_0x93cf('0x6'),_0x43d755,_[_0x93cf('0x7')](_0x2c4881,_0x93cf('0x8'))[_0x93cf('0x9')](',\x20'));_0x14a52b['stop']();}else{logger[_0x93cf('0xa')]('[%s][GOTOP]\x20priority\x20%s',_0x43d755,_0x9e14d1[_0x93cf('0xb')]);if(_0x9e14d1[_0x93cf('0xb')]){var _0x5170de=_['findIndex'](_0x14a52b['rules'](),{'p':_0x9e14d1[_0x93cf('0xb')]});if(_0x5170de>=0x0){logger[_0x93cf('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x43d755,_0x9e14d1[_0x93cf('0xb')]||_0x93cf('0xc'),_0x5170de);_0x14a52b['next'](_0x5170de);}else{logger[_0x93cf('0xa')](_0x93cf('0xd'),_0x43d755,_0x9e14d1[_0x93cf('0xb')]||_0x93cf('0xc'));_0x14a52b[_0x93cf('0xe')]();}}else{_0x14a52b['next']();}}}catch(_0x9add20){logger[_0x93cf('0xf')](_0x93cf('0x6'),_0x43d755,JSON[_0x93cf('0x10')](_0x9add20));_0x14a52b[_0x93cf('0xe')]();}};}; \ No newline at end of file +var _0x9025=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','message','join','stop','info','priority','findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','../../../../config/logger'];(function(_0x3932eb,_0x43b210){var _0x5316e5=function(_0x1744e8){while(--_0x1744e8){_0x3932eb['push'](_0x3932eb['shift']());}};_0x5316e5(++_0x43b210);}(_0x9025,0x1ce));var _0x5902=function(_0x30d19e,_0x46b59e){_0x30d19e=_0x30d19e-0x0;var _0xfbfa63=_0x9025[_0x30d19e];return _0xfbfa63;};'use strict';var schema=require(_0x5902('0x0'));var _=require('lodash');var logger=require(_0x5902('0x1'))('routing');var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x5902('0x2')}});exports[_0x5902('0x3')]=function(_0x2f1fd4,_0x149fa9){return function(_0x1af4b5){try{var _0x3382d8={'priority':_0x149fa9[0x0]};var _0x492ecb=gotop[_0x5902('0x0')](_0x3382d8,{'typecast':!![]});if(_0x492ecb[_0x5902('0x4')]){logger[_0x5902('0x5')](_0x5902('0x6'),_0x2f1fd4,_['map'](_0x492ecb,_0x5902('0x7'))[_0x5902('0x8')](',\x20'));_0x1af4b5[_0x5902('0x9')]();}else{logger[_0x5902('0xa')]('[%s][GOTOP]\x20priority\x20%s',_0x2f1fd4,_0x3382d8[_0x5902('0xb')]);if(_0x3382d8['priority']){var _0x48c719=_[_0x5902('0xc')](_0x1af4b5[_0x5902('0xd')](),{'p':_0x3382d8['priority']});if(_0x48c719>=0x0){logger[_0x5902('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x2f1fd4,_0x3382d8[_0x5902('0xb')]||_0x5902('0xe'),_0x48c719);_0x1af4b5[_0x5902('0xe')](_0x48c719);}else{logger[_0x5902('0xa')](_0x5902('0xf'),_0x2f1fd4,_0x3382d8[_0x5902('0xb')]||_0x5902('0xe'));_0x1af4b5['stop']();}}else{_0x1af4b5[_0x5902('0xe')]();}}}catch(_0x57adba){logger['error'](_0x5902('0x6'),_0x2f1fd4,JSON['stringify'](_0x57adba));_0x1af4b5['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index a0f4a94..abacbb2 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 _0x5216=['info','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/faxMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','then'];(function(_0x64a5fd,_0x4973a6){var _0x267481=function(_0x40c058){while(--_0x40c058){_0x64a5fd['push'](_0x64a5fd['shift']());}};_0x267481(++_0x4973a6);}(_0x5216,0x165));var _0x6521=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5216[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var utils=require(_0x6521('0x0'));var logger=require(_0x6521('0x1'))(_0x6521('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x6521('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x6521('0x4')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x6521('0x5')]=function(_0x3023bf,_0x52053c){return function(_0x7c46f8){try{var _0x54ebf2={'body':utils[_0x6521('0x6')](_0x52053c[0x0],this),'ContactId':this['contact']['id']};if(this[_0x6521('0x7')]===_0x6521('0x8')){_0x54ebf2[_0x6521('0x9')]=this[_0x6521('0xa')]['id'];}else{_0x54ebf2[_[_0x6521('0xb')](this[_0x6521('0x7')])+_0x6521('0xc')]=this[_0x6521('0xa')]['id'];}_0x54ebf2[_['upperFirst'](this['channel'])+_0x6521('0xd')]=this[_0x6521('0xe')]['id'];if(rpc[this[_0x6521('0x7')]+_0x6521('0xf')]){return rpc[this[_0x6521('0x7')]+_0x6521('0xf')][_0x6521('0x10')](_0x54ebf2)[_0x6521('0x11')](function(_0x40abac){logger[_0x6521('0x12')](_0x6521('0x13'),_0x3023bf,_0x54ebf2[_0x6521('0x14')]);_0x7c46f8[_0x6521('0x15')]();})['catch'](function(_0x26c746){logger[_0x6521('0x16')](_0x6521('0x13'),_0x3023bf,JSON[_0x6521('0x17')](_0x26c746));_0x7c46f8[_0x6521('0x18')]();});}}catch(_0x28711d){logger[_0x6521('0x16')](_0x6521('0x13'),_0x3023bf,JSON[_0x6521('0x17')](_0x28711d));_0x7c46f8[_0x6521('0x18')]();}};}; \ No newline at end of file +var _0x29b1=['[%s][MESSAGE]\x20%s','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','chat','account','upperFirst','AccountId','InteractionId','Message','info','body','next','catch','error','stringify','stop'];(function(_0x289583,_0x484d16){var _0x5b0c07=function(_0x1cc0d1){while(--_0x1cc0d1){_0x289583['push'](_0x289583['shift']());}};_0x5b0c07(++_0x484d16);}(_0x29b1,0x16d));var _0x129b=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x29b1[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x129b('0x0'));var utils=require(_0x129b('0x1'));var logger=require(_0x129b('0x2'))(_0x129b('0x3'));var rpc={'chatMessage':require(_0x129b('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x129b('0x5')),'smsMessage':require(_0x129b('0x6')),'faxMessage':require(_0x129b('0x7')),'whatsappMessage':require(_0x129b('0x8'))};exports[_0x129b('0x9')]=function(_0x3bf771,_0x31e428){return function(_0xe27ed4){try{var _0x5ce8f9={'body':utils[_0x129b('0xa')](_0x31e428[0x0],this),'ContactId':this['contact']['id']};if(this[_0x129b('0xb')]===_0x129b('0xc')){_0x5ce8f9['ChatWebsiteId']=this[_0x129b('0xd')]['id'];}else{_0x5ce8f9[_[_0x129b('0xe')](this['channel'])+_0x129b('0xf')]=this['account']['id'];}_0x5ce8f9[_[_0x129b('0xe')](this[_0x129b('0xb')])+_0x129b('0x10')]=this['interaction']['id'];if(rpc[this[_0x129b('0xb')]+_0x129b('0x11')]){return rpc[this[_0x129b('0xb')]+_0x129b('0x11')]['create'](_0x5ce8f9)['then'](function(_0x4cc6ee){logger[_0x129b('0x12')]('[%s][MESSAGE]\x20%s',_0x3bf771,_0x5ce8f9[_0x129b('0x13')]);_0xe27ed4[_0x129b('0x14')]();})[_0x129b('0x15')](function(_0x52137c){logger[_0x129b('0x16')]('[%s][MESSAGE]\x20%s',_0x3bf771,JSON[_0x129b('0x17')](_0x52137c));_0xe27ed4[_0x129b('0x18')]();});}}catch(_0x17fff2){logger['error'](_0x129b('0x19'),_0x3bf771,JSON[_0x129b('0x17')](_0x17fff2));_0xe27ed4[_0x129b('0x18')]();}};}; \ 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 0f9ec13..02cba79 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 _0x4a84=['../../../../config/logger','routing','consequence','info','getMustacheRender','next','error','[%s][NOOP]\x20%s','stringify','./utils'];(function(_0xe3e180,_0x517cdc){var _0x2b6435=function(_0x46f198){while(--_0x46f198){_0xe3e180['push'](_0xe3e180['shift']());}};_0x2b6435(++_0x517cdc);}(_0x4a84,0x12b));var _0x44a8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4a84[_0xa464c9];return _0x3d73c4;};'use strict';var utils=require(_0x44a8('0x0'));var logger=require(_0x44a8('0x1'))(_0x44a8('0x2'));exports[_0x44a8('0x3')]=function(_0x142c29,_0x6bb3fa){return function(_0xa40ec7){try{logger[_0x44a8('0x4')]('[%s][NOOP]\x20%s',_0x142c29,utils[_0x44a8('0x5')](_0x6bb3fa[0x0],this));_0xa40ec7[_0x44a8('0x6')]();}catch(_0x28c8f2){logger[_0x44a8('0x7')](_0x44a8('0x8'),_0x142c29,JSON[_0x44a8('0x9')](_0x28c8f2));_0xa40ec7['stop']();}};}; \ No newline at end of file +var _0xd5b7=['consequence','info','[%s][NOOP]\x20%s','next','error','stop','./utils','../../../../config/logger'];(function(_0x99378a,_0x35ca3a){var _0x55a2db=function(_0x4f4868){while(--_0x4f4868){_0x99378a['push'](_0x99378a['shift']());}};_0x55a2db(++_0x35ca3a);}(_0xd5b7,0x1de));var _0x7d5b=function(_0x589aee,_0x140a03){_0x589aee=_0x589aee-0x0;var _0x2f5ed4=_0xd5b7[_0x589aee];return _0x2f5ed4;};'use strict';var utils=require(_0x7d5b('0x0'));var logger=require(_0x7d5b('0x1'))('routing');exports[_0x7d5b('0x2')]=function(_0x342321,_0x2204a7){return function(_0x582b55){try{logger[_0x7d5b('0x3')](_0x7d5b('0x4'),_0x342321,utils['getMustacheRender'](_0x2204a7[0x0],this));_0x582b55[_0x7d5b('0x5')]();}catch(_0x1f786b){logger[_0x7d5b('0x6')]('[%s][NOOP]\x20%s',_0x342321,JSON['stringify'](_0x1f786b));_0x582b55[_0x7d5b('0x7')]();}};}; \ 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 0fb4015..29cb0c4 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 _0x0621=['InteractionId','interaction','MessageId','message','AccountId','info','name','QueueReport','create','catch','create\x20queue\x20report','accepted','update','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','createQueue','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','util','seq-queue','moment','ioredis','../../../../config/environment','./strategy','redis','localhost','socket.io-emitter','queue_id','account','from','joinAt','capitalize','pick','format','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel'];(function(_0x246a5a,_0x407cf8){var _0x3f7a94=function(_0x580cfe){while(--_0x580cfe){_0x246a5a['push'](_0x246a5a['shift']());}};_0x3f7a94(++_0x407cf8);}(_0x0621,0x1ea));var _0x1062=function(_0x465c9f,_0x2e8e90){_0x465c9f=_0x465c9f-0x0;var _0x83187f=_0x0621[_0x465c9f];return _0x83187f;};'use strict';var schema=require(_0x1062('0x0'));var _=require('lodash');var util=require(_0x1062('0x1'));var seqqueue=require(_0x1062('0x2'));var moment=require(_0x1062('0x3'));var Redis=require(_0x1062('0x4'));var config=require(_0x1062('0x5'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x1062('0x6'));config['redis']=_['defaults'](config[_0x1062('0x7')],{'host':_0x1062('0x8'),'port':0x18eb});var io=require(_0x1062('0x9'))(new Redis(config[_0x1062('0x7')]));var attributes=['id',_0x1062('0xa'),_0x1062('0xb'),'queue',_0x1062('0xc'),_0x1062('0xd')];function emit(_0x410d48,_0xf3fb8e,_0x3ca8cd){io['to'](_0x410d48)['emit'](_0xf3fb8e,_0x3ca8cd);}function emitChannelQueueInteraction(_0x194a50,_0x24c199,_0x357b51,_0x2cffe4,_0x15d2b3,_0xf275a6,_0x2ab79a,_0x4c58d6){var _0x7c0d4=_['clone'](_0x357b51);_0x7c0d4['queue_id']=_0x4c58d6;_0x7c0d4['queue']=_0x24c199;_0x7c0d4[_0x1062('0xb')]=_0x2cffe4;_0x7c0d4['id']=_0x15d2b3;if(_0xf275a6){attributes['push'](_[_0x1062('0xe')](_0x194a50)+'InteractionId');_0x2ab79a[util['format']('%sQueuesWaitingInteractions',_0x194a50)][_0x15d2b3]=_[_0x1062('0xf')](_0x7c0d4,attributes);}else{delete _0x2ab79a[util[_0x1062('0x10')](_0x1062('0x11'),_0x194a50)][_0x15d2b3];}emit(util[_0x1062('0x10')]('%s:queue:%s',_0x194a50,_0x24c199),util[_0x1062('0x10')](_0x1062('0x12'),_0x194a50,_0xf275a6?'save':_0x1062('0x13')),_[_0x1062('0xf')](_0x7c0d4,attributes));}var rpc={'openchannelQueueReport':require(_0x1062('0x14')),'mailQueueReport':require(_0x1062('0x15')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x1062('0x16')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x1062('0x17'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x1062('0x18')},'timeout':{'type':_0x1062('0x19'),'message':_0x1062('0x1a')}});function startRouting(_0x3b6f00,_0x46a845,_0x4d870e,_0x5f0ef7){if(_0x3b6f00&&_0x46a845&&_0x4d870e){_0x46a845[_0x1062('0x1b')]+=0x1;var _0x1d9a65={'uniqueid':_0x3b6f00,'from':_0x4d870e[_0x1062('0x1c')]?_0x4d870e[_0x1062('0x1c')]['from']:'','joinAt':moment()[_0x1062('0x10')](_0x1062('0x1d')),'ContactId':_0x4d870e[_0x1062('0x1e')]?_0x4d870e[_0x1062('0x1e')]['id']:null,'ListId':_0x4d870e[_0x1062('0x1f')]?_0x4d870e[_0x1062('0x1f')]['id']:null};_0x1d9a65[_[_0x1062('0x20')](_0x4d870e['channel'])+_0x1062('0x21')]=_0x46a845['id']||null;_0x1d9a65[_[_0x1062('0x20')](_0x4d870e[_0x1062('0x22')])+_0x1062('0x23')]=_0x4d870e[_0x1062('0x24')]?_0x4d870e[_0x1062('0x24')]['id']:null;_0x1d9a65[_[_0x1062('0x20')](_0x4d870e[_0x1062('0x22')])+_0x1062('0x25')]=_0x4d870e[_0x1062('0x26')]?_0x4d870e[_0x1062('0x26')]['id']:null;_0x1d9a65[_[_0x1062('0x20')](_0x4d870e[_0x1062('0x22')])+(_0x4d870e['channel']!=='chat'?_0x1062('0x27'):'WebsiteId')]=_0x4d870e['account']?_0x4d870e[_0x1062('0xb')]['id']:null;logger[_0x1062('0x28')](util[_0x1062('0x10')]('[%s][START:QUEUE][NAME:%s]',_0x3b6f00,_0x46a845[_0x1062('0x29')]));emitChannelQueueInteraction(_0x4d870e['channel'],_0x46a845[_0x1062('0x29')],_0x1d9a65,_0x4d870e[_0x1062('0xb')]['name'],_0x4d870e[_0x1062('0x26')]['id'],!![],_0x5f0ef7,_0x46a845['id']);if(rpc[_0x4d870e['channel']+'QueueReport']){return rpc[_0x4d870e['channel']+_0x1062('0x2a')][_0x1062('0x2b')](_0x1d9a65)[_0x1062('0x2c')](function(_0x5cbc9b){logger['error'](_0x1062('0x2d'));});}}}function stopRouting(_0x2e320b,_0x367f7b,_0x5313b8,_0x11153c){if(_0x2e320b&&_0x367f7b){_0x367f7b[_0x1062('0x1b')]-=0x1;var _0x418d7d={'leaveAt':moment()['format'](_0x1062('0x1d')),'acceptAt':moment()[_0x1062('0x10')](_0x1062('0x1d')),'reason':_0x1062('0x2e')};logger[_0x1062('0x28')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x2e320b,_0x367f7b[_0x1062('0x29')]));emitChannelQueueInteraction(_0x5313b8[_0x1062('0x22')],_0x367f7b[_0x1062('0x29')],_0x5313b8[_0x1062('0x1c')],_0x5313b8['account'][_0x1062('0x29')],_0x5313b8[_0x1062('0x26')]['id'],![],_0x11153c,_0x367f7b['id']);if(rpc[_0x5313b8['channel']+_0x1062('0x2a')]){return rpc[_0x5313b8[_0x1062('0x22')]+_0x1062('0x2a')][_0x1062('0x2f')](_0x2e320b,_0x418d7d)[_0x1062('0x2c')](function(_0x1cb76e){logger[_0x1062('0x30')](_0x1062('0x31'));});}}}function endRouting(_0x411989,_0x17d8bc,_0x3f875a,_0x390467){if(_0x411989&&_0x17d8bc){_0x17d8bc[_0x1062('0x1b')]-=0x1;var _0x133fd4={'leaveAt':moment()[_0x1062('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x1062('0x10')](_0x1062('0x1d')),'reason':_0x1062('0x32')};logger[_0x1062('0x28')](util[_0x1062('0x10')](_0x1062('0x33'),_0x411989,_0x17d8bc[_0x1062('0x29')]));emitChannelQueueInteraction(_0x3f875a[_0x1062('0x22')],_0x17d8bc['name'],_0x3f875a['body'],_0x3f875a[_0x1062('0xb')]['name'],_0x3f875a[_0x1062('0x26')]['id'],![],_0x390467);if(rpc[_0x3f875a[_0x1062('0x22')]+_0x1062('0x2a')]){return rpc[_0x3f875a['channel']+_0x1062('0x2a')][_0x1062('0x2f')](_0x411989,_0x133fd4)[_0x1062('0x2c')](function(_0x3361e9){logger['error'](_0x1062('0x31'));});}}}function handleFindQueue(_0x3f4f2c){return function(_0x5edf9f){return _0x5edf9f[_0x1062('0x29')][_0x1062('0x34')]()===_0x3f4f2c[_0x1062('0x34')]();};}exports[_0x1062('0x35')]=function(_0x36dfca,_0x40bed2,_0x4d1269,_0x2b010b){return function(_0xb1c06a){try{var _0x5824c9={'name':_0x40bed2[0x0],'timeout':_0x40bed2[0x1]};var _0x232539=queue[_0x1062('0x0')](_0x5824c9,{'typecast':!![]});if(_0x232539[_0x1062('0x36')]){logger[_0x1062('0x30')](_0x1062('0x37'),_0x36dfca,_[_0x1062('0x38')](_0x232539,_0x1062('0x26'))[_0x1062('0x39')](',\x20'));_0xb1c06a[_0x1062('0x3a')]();}else{var _0x5e8fac=_[_0x1062('0x3b')](_0x4d1269[_0x2b010b[_0x1062('0x22')]+'Queues'],handleFindQueue(_0x5824c9['name']));if(_0x5e8fac){startRouting(_0x36dfca,_0x5e8fac,_0x2b010b,_0x4d1269);var _0x1a40ab=(_0x5e8fac[_0x1062('0x32')]||0xa)*0x3e8;var _0x3d766a=(_0x5824c9[_0x1062('0x32')]||0x14)*0x3e8;var _0x5c11f1;if(_0x1a40ab>_0x3d766a){_0x3d766a=_0x1a40ab;}var _0xbc7f34=seqqueue[_0x1062('0x3c')](_0x1a40ab);_0xbc7f34['id']=_0x36dfca;_0xbc7f34[_0x1062('0x3d')]=_0x1a40ab;_0xbc7f34[_0x1062('0x3e')]=_0x3d766a;_0xbc7f34[_0x1062('0x22')]=_0x2b010b['channel'];_0x4d1269['rules'][_0x36dfca]['on'](_0x1062('0x3f'),function(){logger[_0x1062('0x28')](_0x1062('0x40'),_0x36dfca);stopRouting(_0x36dfca,_0x5e8fac,_0x2b010b,_0x4d1269);clearTimeout(_0x5c11f1);_0x5c11f1=undefined;_0xbc7f34[_0x1062('0x41')](!![]);if(_0x4d1269[_0x1062('0x42')][_0x36dfca]){delete _0x4d1269[_0x1062('0x42')][_0x36dfca];}_0xb1c06a['stop']();});_0x4d1269[_0x1062('0x42')][_0x36dfca]['on'](_0x1062('0x43'),function(){if(_0x4d1269[_0x1062('0x42')][_0x36dfca]){delete _0x4d1269['rules'][_0x36dfca];}});_0x5c11f1=setTimeout(function(){logger['info'](_0x1062('0x44'),_0x36dfca);endRouting(_0x36dfca,_0x5e8fac,_0x2b010b,_0x4d1269);clearTimeout(_0x5c11f1);_0xbc7f34[_0x1062('0x41')](!![]);_0xb1c06a[_0x1062('0x45')]();},_0x3d766a);switch(_0x5e8fac[_0x1062('0x46')]){case _0x1062('0x47'):strategy[_0x1062('0x47')](_0xbc7f34,_0x5e8fac,_0x4d1269,_0x2b010b);break;default:strategy['beepall'](_0xbc7f34,_0x5e8fac,_0x4d1269,_0x2b010b);}}else{logger[_0x1062('0x30')](_0x1062('0x48'),_0x36dfca,_0x5824c9[_0x1062('0x29')]);_0xb1c06a['stop']();}}}catch(_0x19ef15){console[_0x1062('0x49')](_0x19ef15);logger[_0x1062('0x30')](_0x1062('0x37'),_0x36dfca,_0x19ef15[_0x1062('0x4a')]);_0xb1c06a['stop']();}};}; \ No newline at end of file +var _0x7f10=['clone','push','InteractionId','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../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','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create\x20queue\x20report','waiting','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','error','[%s][QUEUE]\x20%s','join','stop','find','Queues','timeout','createQueue','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','from','joinAt','emit'];(function(_0x4b775b,_0x2b7978){var _0xabbc70=function(_0x5831be){while(--_0x5831be){_0x4b775b['push'](_0x4b775b['shift']());}};_0xabbc70(++_0x2b7978);}(_0x7f10,0x136));var _0x07f1=function(_0xe24fc0,_0x444ff6){_0xe24fc0=_0xe24fc0-0x0;var _0x185c6b=_0x7f10[_0xe24fc0];return _0x185c6b;};'use strict';var schema=require(_0x07f1('0x0'));var _=require(_0x07f1('0x1'));var util=require('util');var seqqueue=require(_0x07f1('0x2'));var moment=require(_0x07f1('0x3'));var Redis=require(_0x07f1('0x4'));var config=require(_0x07f1('0x5'));var logger=require(_0x07f1('0x6'))(_0x07f1('0x7'));var strategy=require(_0x07f1('0x8'));config[_0x07f1('0x9')]=_[_0x07f1('0xa')](config['redis'],{'host':_0x07f1('0xb'),'port':0x18eb});var io=require(_0x07f1('0xc'))(new Redis(config[_0x07f1('0x9')]));var attributes=['id',_0x07f1('0xd'),_0x07f1('0xe'),'queue',_0x07f1('0xf'),_0x07f1('0x10')];function emit(_0x44b33a,_0x54dc77,_0x4ef160){io['to'](_0x44b33a)[_0x07f1('0x11')](_0x54dc77,_0x4ef160);}function emitChannelQueueInteraction(_0x3196bf,_0x19a4a0,_0x2c17de,_0x4f5f40,_0x38ced2,_0x59c45a,_0x48f058,_0x22fc34){var _0x56aec7=_[_0x07f1('0x12')](_0x2c17de);_0x56aec7[_0x07f1('0xd')]=_0x22fc34;_0x56aec7['queue']=_0x19a4a0;_0x56aec7[_0x07f1('0xe')]=_0x4f5f40;_0x56aec7['id']=_0x38ced2;if(_0x59c45a){attributes[_0x07f1('0x13')](_['capitalize'](_0x3196bf)+_0x07f1('0x14'));_0x48f058[util[_0x07f1('0x15')](_0x07f1('0x16'),_0x3196bf)][_0x38ced2]=_[_0x07f1('0x17')](_0x56aec7,attributes);}else{delete _0x48f058[util[_0x07f1('0x15')](_0x07f1('0x16'),_0x3196bf)][_0x38ced2];}emit(util[_0x07f1('0x15')]('%s:queue:%s',_0x3196bf,_0x19a4a0),util['format'](_0x07f1('0x18'),_0x3196bf,_0x59c45a?_0x07f1('0x19'):_0x07f1('0x1a')),_[_0x07f1('0x17')](_0x56aec7,attributes));}var rpc={'openchannelQueueReport':require(_0x07f1('0x1b')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x07f1('0x1c')),'smsQueueReport':require(_0x07f1('0x1d')),'faxQueueReport':require(_0x07f1('0x1e')),'whatsappQueueReport':require(_0x07f1('0x1f'))};var queue=schema({'name':{'type':_0x07f1('0x20'),'required':!![],'message':_0x07f1('0x21')},'timeout':{'type':_0x07f1('0x22'),'message':_0x07f1('0x23')}});function startRouting(_0x148681,_0x584c45,_0x340c06,_0x22fd32){if(_0x148681&&_0x584c45&&_0x340c06){_0x584c45['waiting']+=0x1;var _0x4d9e7b={'uniqueid':_0x148681,'from':_0x340c06[_0x07f1('0x24')]?_0x340c06[_0x07f1('0x24')][_0x07f1('0xf')]:'','joinAt':moment()['format'](_0x07f1('0x25')),'ContactId':_0x340c06[_0x07f1('0x26')]?_0x340c06['contact']['id']:null,'ListId':_0x340c06['list']?_0x340c06['list']['id']:null};_0x4d9e7b[_[_0x07f1('0x27')](_0x340c06[_0x07f1('0x28')])+_0x07f1('0x29')]=_0x584c45['id']||null;_0x4d9e7b[_[_0x07f1('0x27')](_0x340c06[_0x07f1('0x28')])+_0x07f1('0x14')]=_0x340c06[_0x07f1('0x2a')]?_0x340c06[_0x07f1('0x2a')]['id']:null;_0x4d9e7b[_['upperFirst'](_0x340c06[_0x07f1('0x28')])+_0x07f1('0x2b')]=_0x340c06[_0x07f1('0x2c')]?_0x340c06['message']['id']:null;_0x4d9e7b[_['upperFirst'](_0x340c06[_0x07f1('0x28')])+(_0x340c06[_0x07f1('0x28')]!==_0x07f1('0x2d')?_0x07f1('0x2e'):'WebsiteId')]=_0x340c06[_0x07f1('0xe')]?_0x340c06[_0x07f1('0xe')]['id']:null;logger[_0x07f1('0x2f')](util[_0x07f1('0x15')](_0x07f1('0x30'),_0x148681,_0x584c45[_0x07f1('0x31')]));emitChannelQueueInteraction(_0x340c06[_0x07f1('0x28')],_0x584c45[_0x07f1('0x31')],_0x4d9e7b,_0x340c06[_0x07f1('0xe')]['name'],_0x340c06[_0x07f1('0x2c')]['id'],!![],_0x22fd32,_0x584c45['id']);if(rpc[_0x340c06[_0x07f1('0x28')]+_0x07f1('0x32')]){return rpc[_0x340c06[_0x07f1('0x28')]+_0x07f1('0x32')]['create'](_0x4d9e7b)['catch'](function(_0x34bff8){logger['error'](_0x07f1('0x33'));});}}}function stopRouting(_0x5ed743,_0x2dc694,_0x55df02,_0x263783){if(_0x5ed743&&_0x2dc694){_0x2dc694[_0x07f1('0x34')]-=0x1;var _0x4b4d8c={'leaveAt':moment()[_0x07f1('0x15')](_0x07f1('0x25')),'acceptAt':moment()[_0x07f1('0x15')](_0x07f1('0x25')),'reason':'accepted'};logger[_0x07f1('0x2f')](util[_0x07f1('0x15')](_0x07f1('0x35'),_0x5ed743,_0x2dc694[_0x07f1('0x31')]));emitChannelQueueInteraction(_0x55df02[_0x07f1('0x28')],_0x2dc694[_0x07f1('0x31')],_0x55df02['body'],_0x55df02[_0x07f1('0xe')][_0x07f1('0x31')],_0x55df02[_0x07f1('0x2c')]['id'],![],_0x263783,_0x2dc694['id']);if(rpc[_0x55df02[_0x07f1('0x28')]+_0x07f1('0x32')]){return rpc[_0x55df02[_0x07f1('0x28')]+_0x07f1('0x32')][_0x07f1('0x36')](_0x5ed743,_0x4b4d8c)[_0x07f1('0x37')](function(_0x4ae5b8){logger['error'](_0x07f1('0x38'));});}}}function endRouting(_0xbba8a0,_0xd65e9f,_0x74d380,_0xf44b46){if(_0xbba8a0&&_0xd65e9f){_0xd65e9f[_0x07f1('0x34')]-=0x1;var _0x413b23={'leaveAt':moment()[_0x07f1('0x15')](_0x07f1('0x25')),'exitAt':moment()[_0x07f1('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger[_0x07f1('0x2f')](util['format'](_0x07f1('0x39'),_0xbba8a0,_0xd65e9f['name']));emitChannelQueueInteraction(_0x74d380[_0x07f1('0x28')],_0xd65e9f[_0x07f1('0x31')],_0x74d380[_0x07f1('0x24')],_0x74d380[_0x07f1('0xe')]['name'],_0x74d380['message']['id'],![],_0xf44b46);if(rpc[_0x74d380['channel']+_0x07f1('0x32')]){return rpc[_0x74d380[_0x07f1('0x28')]+_0x07f1('0x32')][_0x07f1('0x36')](_0xbba8a0,_0x413b23)[_0x07f1('0x37')](function(_0x56310f){logger['error']('update\x20queue\x20report');});}}}function handleFindQueue(_0x46b4ea){return function(_0x217d3b){return _0x217d3b[_0x07f1('0x31')][_0x07f1('0x3a')]()===_0x46b4ea[_0x07f1('0x3a')]();};}exports[_0x07f1('0x3b')]=function(_0x4950ff,_0x305015,_0x5cd1ad,_0x1d70eb){return function(_0x34a07d){try{var _0x2f5976={'name':_0x305015[0x0],'timeout':_0x305015[0x1]};var _0x2df4b7=queue['validate'](_0x2f5976,{'typecast':!![]});if(_0x2df4b7[_0x07f1('0x3c')]){logger[_0x07f1('0x3d')](_0x07f1('0x3e'),_0x4950ff,_['map'](_0x2df4b7,_0x07f1('0x2c'))[_0x07f1('0x3f')](',\x20'));_0x34a07d[_0x07f1('0x40')]();}else{var _0x3f28b8=_[_0x07f1('0x41')](_0x5cd1ad[_0x1d70eb['channel']+_0x07f1('0x42')],handleFindQueue(_0x2f5976['name']));if(_0x3f28b8){startRouting(_0x4950ff,_0x3f28b8,_0x1d70eb,_0x5cd1ad);var _0x4aea85=(_0x3f28b8[_0x07f1('0x43')]||0xa)*0x3e8;var _0x420bd3=(_0x2f5976[_0x07f1('0x43')]||0x14)*0x3e8;var _0x2db9a9;if(_0x4aea85>_0x420bd3){_0x420bd3=_0x4aea85;}var _0x2c285a=seqqueue[_0x07f1('0x44')](_0x4aea85);_0x2c285a['id']=_0x4950ff;_0x2c285a[_0x07f1('0x45')]=_0x4aea85;_0x2c285a[_0x07f1('0x46')]=_0x420bd3;_0x2c285a['channel']=_0x1d70eb[_0x07f1('0x28')];_0x5cd1ad[_0x07f1('0x47')][_0x4950ff]['on']('end',function(){logger[_0x07f1('0x2f')](_0x07f1('0x48'),_0x4950ff);stopRouting(_0x4950ff,_0x3f28b8,_0x1d70eb,_0x5cd1ad);clearTimeout(_0x2db9a9);_0x2db9a9=undefined;_0x2c285a[_0x07f1('0x49')](!![]);if(_0x5cd1ad[_0x07f1('0x47')][_0x4950ff]){delete _0x5cd1ad[_0x07f1('0x47')][_0x4950ff];}_0x34a07d['stop']();});_0x5cd1ad[_0x07f1('0x47')][_0x4950ff]['on'](_0x07f1('0x4a'),function(){if(_0x5cd1ad[_0x07f1('0x47')][_0x4950ff]){delete _0x5cd1ad[_0x07f1('0x47')][_0x4950ff];}});_0x2db9a9=setTimeout(function(){logger[_0x07f1('0x2f')](_0x07f1('0x4b'),_0x4950ff);endRouting(_0x4950ff,_0x3f28b8,_0x1d70eb,_0x5cd1ad);clearTimeout(_0x2db9a9);_0x2c285a[_0x07f1('0x49')](!![]);_0x34a07d[_0x07f1('0x4c')]();},_0x420bd3);switch(_0x3f28b8[_0x07f1('0x4d')]){case _0x07f1('0x4e'):strategy[_0x07f1('0x4e')](_0x2c285a,_0x3f28b8,_0x5cd1ad,_0x1d70eb);break;default:strategy[_0x07f1('0x4f')](_0x2c285a,_0x3f28b8,_0x5cd1ad,_0x1d70eb);}}else{logger[_0x07f1('0x3d')](_0x07f1('0x50'),_0x4950ff,_0x2f5976[_0x07f1('0x31')]);_0x34a07d[_0x07f1('0x40')]();}}}catch(_0x3a614f){console['log'](_0x3a614f);logger[_0x07f1('0x3d')](_0x07f1('0x3e'),_0x4950ff,_0x3a614f[_0x07f1('0x51')]);_0x34a07d[_0x07f1('0x40')]();}};}; \ 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 cfcb1ca..125d246 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 _0xf021=['routing','notificationId','realtime','squeue','push','handleRun','bind','handleTimeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','forcedOwnership','busyQueue','channel','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','busy','STOP','lodash','uuid','./util','../../../../../config/logger'];(function(_0x27456f,_0x84b51e){var _0x35b210=function(_0x3d1e3b){while(--_0x3d1e3b){_0x27456f['push'](_0x27456f['shift']());}};_0x35b210(++_0x84b51e);}(_0xf021,0x18f));var _0x1f02=function(_0x38750a,_0x316de4){_0x38750a=_0x38750a-0x0;var _0x92e34a=_0xf021[_0x38750a];return _0x92e34a;};'use strict';var _=require(_0x1f02('0x0'));var uuid=require(_0x1f02('0x1'));var util=require(_0x1f02('0x2'));var logger=require(_0x1f02('0x3'))(_0x1f02('0x4'));var Agent=function(_0x53cc42,_0x1027d2,_0x54cd44,_0x2e8594){this[_0x1f02('0x5')]=uuid['v4']();this['squeue']=_0x53cc42;this['agent']=_0x1027d2;this[_0x1f02('0x6')]=_0x54cd44;this['routing']=_0x2e8594;this[_0x1f02('0x7')][_0x1f02('0x8')](this[_0x1f02('0x9')][_0x1f02('0xa')](this),this[_0x1f02('0xb')]['bind'](this));this[_0x1f02('0x7')]['on']('timeout',this['handleTimeout']['bind'](this));this[_0x1f02('0x7')]['on'](_0x1f02('0xc'),this[_0x1f02('0xd')][_0x1f02('0xa')](this));};Agent[_0x1f02('0xe')]['push']=function(){this[_0x1f02('0x7')][_0x1f02('0x8')](this[_0x1f02('0x9')]['bind'](this),this[_0x1f02('0xb')][_0x1f02('0xa')](this));};Agent[_0x1f02('0xe')]['handleDrained']=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0x1f02('0x9')]=function(){logger[_0x1f02('0xf')](_0x1f02('0x10'),this[_0x1f02('0x7')]['id'],this[_0x1f02('0x11')]['id']);if(_[_0x1f02('0x12')](this[_0x1f02('0x6')][_0x1f02('0x13')][this['agent']['id']])){logger[_0x1f02('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this['agent']['id']);setTimeout(this['push'][_0x1f02('0xa')](this),0x3e8);}else{if(this[_0x1f02('0x4')][_0x1f02('0x14')]||util['isAgentAvailable'](this[_0x1f02('0x7')]['id'],this[_0x1f02('0x6')][_0x1f02('0x13')][this[_0x1f02('0x11')]['id']],this['squeue']['channel'],![])){this[_0x1f02('0x6')][_0x1f02('0x13')][this['agent']['id']]['busy']=!![];this[_0x1f02('0x6')][_0x1f02('0x13')][this[_0x1f02('0x11')]['id']][_0x1f02('0x15')]=undefined;util['saveWaitingNotification'](this[_0x1f02('0x6')],this[_0x1f02('0x4')],this[_0x1f02('0x11')],this[_0x1f02('0x7')][_0x1f02('0x16')]);util[_0x1f02('0x17')](this[_0x1f02('0x5')],this['squeue']['id'],this[_0x1f02('0x6')][_0x1f02('0x13')][this['agent']['id']],null,this[_0x1f02('0x4')]);util[_0x1f02('0x18')](this['squeue']['id'],this['realtime'][_0x1f02('0x13')][this[_0x1f02('0x11')]['id']],_0x1f02('0x19')+(this[_0x1f02('0x4')][_0x1f02('0x14')]?_0x1f02('0x1a'):''));}else{logger[_0x1f02('0xf')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x1f02('0x8')][_0x1f02('0xa')](this),0x3e8);}}};Agent[_0x1f02('0xe')]['handleTimeout']=function(_0x5c2c42){if(_[_0x1f02('0x12')](this[_0x1f02('0x6')][_0x1f02('0x13')][this[_0x1f02('0x11')]['id']])){return logger[_0x1f02('0xf')](_0x1f02('0x1b'),this[_0x1f02('0x7')]['id'],this[_0x1f02('0x11')]['id']);}else{logger[_0x1f02('0xf')](_0x1f02('0x1c'),this['squeue']['id'],this[_0x1f02('0x11')]['id']);util['hideNotification'](this[_0x1f02('0x5')],this[_0x1f02('0x7')]['id'],this[_0x1f02('0x6')][_0x1f02('0x13')][this[_0x1f02('0x11')]['id']],null,this[_0x1f02('0x4')]);this['realtime']['agents'][this[_0x1f02('0x11')]['id']][_0x1f02('0x1d')]=![];this['realtime'][_0x1f02('0x13')][this['agent']['id']][_0x1f02('0x15')]=undefined;util['removeWaitingNotification'](this[_0x1f02('0x6')],this['routing'],this['agent'],this[_0x1f02('0x7')][_0x1f02('0x16')]);util[_0x1f02('0x18')](this[_0x1f02('0x7')]['id'],this['realtime'][_0x1f02('0x13')][this[_0x1f02('0x11')]['id']],_0x5c2c42?_0x1f02('0x1e'):'TIMEOUT');}if(!_0x5c2c42){setTimeout(this[_0x1f02('0x8')][_0x1f02('0xa')](this),0x3e8);}};function agent(_0x2a82fa,_0x390686,_0x4292b7,_0x2dbdc5){return new Agent(_0x2a82fa,_0x390686,_0x4292b7,_0x2dbdc5);}module['exports']=agent; \ No newline at end of file +var _0x17ba=['TIMEOUT','lodash','uuid','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','busy','busyQueue','saveWaitingNotification','showNotification','writeLog','forcedOwnership','debug','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','STOP'];(function(_0x1970c3,_0x401e21){var _0x3c7399=function(_0x3731ef){while(--_0x3731ef){_0x1970c3['push'](_0x1970c3['shift']());}};_0x3c7399(++_0x401e21);}(_0x17ba,0xab));var _0xa17b=function(_0x208356,_0x3cbf2f){_0x208356=_0x208356-0x0;var _0x40dac1=_0x17ba[_0x208356];return _0x40dac1;};'use strict';var _=require(_0xa17b('0x0'));var uuid=require(_0xa17b('0x1'));var util=require('./util');var logger=require(_0xa17b('0x2'))(_0xa17b('0x3'));var Agent=function(_0x2806ac,_0x3c60e5,_0x106b5b,_0x38c13c){this[_0xa17b('0x4')]=uuid['v4']();this[_0xa17b('0x5')]=_0x2806ac;this[_0xa17b('0x6')]=_0x3c60e5;this[_0xa17b('0x7')]=_0x106b5b;this[_0xa17b('0x3')]=_0x38c13c;this[_0xa17b('0x5')][_0xa17b('0x8')](this[_0xa17b('0x9')][_0xa17b('0xa')](this),this[_0xa17b('0xb')][_0xa17b('0xa')](this));this[_0xa17b('0x5')]['on'](_0xa17b('0xc'),this['handleTimeout'][_0xa17b('0xa')](this));this[_0xa17b('0x5')]['on'](_0xa17b('0xd'),this[_0xa17b('0xe')][_0xa17b('0xa')](this));};Agent[_0xa17b('0xf')][_0xa17b('0x8')]=function(){this['squeue'][_0xa17b('0x8')](this[_0xa17b('0x9')][_0xa17b('0xa')](this),this['handleTimeout'][_0xa17b('0xa')](this));};Agent[_0xa17b('0xf')][_0xa17b('0xe')]=function(){this[_0xa17b('0xb')](!![]);};Agent['prototype'][_0xa17b('0x9')]=function(){logger['debug'](_0xa17b('0x10'),this[_0xa17b('0x5')]['id'],this['agent']['id']);if(_[_0xa17b('0x11')](this[_0xa17b('0x7')][_0xa17b('0x12')][this[_0xa17b('0x6')]['id']])){logger['debug'](_0xa17b('0x13'),this['squeue']['id'],this['agent']['id']);setTimeout(this['push'][_0xa17b('0xa')](this),0x3e8);}else{if(this[_0xa17b('0x3')]['forcedOwnership']||util[_0xa17b('0x14')](this[_0xa17b('0x5')]['id'],this[_0xa17b('0x7')][_0xa17b('0x12')][this[_0xa17b('0x6')]['id']],this[_0xa17b('0x5')][_0xa17b('0x15')],![])){this['realtime'][_0xa17b('0x12')][this[_0xa17b('0x6')]['id']][_0xa17b('0x16')]=!![];this['realtime'][_0xa17b('0x12')][this[_0xa17b('0x6')]['id']][_0xa17b('0x17')]=undefined;util[_0xa17b('0x18')](this[_0xa17b('0x7')],this[_0xa17b('0x3')],this['agent'],this[_0xa17b('0x5')]['channel']);util[_0xa17b('0x19')](this[_0xa17b('0x4')],this['squeue']['id'],this['realtime'][_0xa17b('0x12')][this[_0xa17b('0x6')]['id']],null,this[_0xa17b('0x3')]);util[_0xa17b('0x1a')](this[_0xa17b('0x5')]['id'],this[_0xa17b('0x7')]['agents'][this['agent']['id']],'RINGING'+(this['routing'][_0xa17b('0x1b')]?':FORCED':''));}else{logger[_0xa17b('0x1c')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xa17b('0x5')]['id'],this[_0xa17b('0x6')]['id']);setTimeout(this[_0xa17b('0x8')][_0xa17b('0xa')](this),0x3e8);}}};Agent[_0xa17b('0xf')][_0xa17b('0xb')]=function(_0x2fbbe8){if(_[_0xa17b('0x11')](this[_0xa17b('0x7')][_0xa17b('0x12')][this[_0xa17b('0x6')]['id']])){return logger['debug']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0xa17b('0x6')]['id']);}else{logger[_0xa17b('0x1c')](_0xa17b('0x1d'),this[_0xa17b('0x5')]['id'],this[_0xa17b('0x6')]['id']);util[_0xa17b('0x1e')](this[_0xa17b('0x4')],this[_0xa17b('0x5')]['id'],this['realtime'][_0xa17b('0x12')][this['agent']['id']],null,this[_0xa17b('0x3')]);this[_0xa17b('0x7')][_0xa17b('0x12')][this[_0xa17b('0x6')]['id']][_0xa17b('0x16')]=![];this[_0xa17b('0x7')]['agents'][this[_0xa17b('0x6')]['id']][_0xa17b('0x17')]=undefined;util[_0xa17b('0x1f')](this[_0xa17b('0x7')],this[_0xa17b('0x3')],this['agent'],this[_0xa17b('0x5')]['channel']);util[_0xa17b('0x1a')](this['squeue']['id'],this[_0xa17b('0x7')][_0xa17b('0x12')][this['agent']['id']],_0x2fbbe8?_0xa17b('0x20'):_0xa17b('0x21'));}if(!_0x2fbbe8){setTimeout(this['push'][_0xa17b('0xa')](this),0x3e8);}};function agent(_0x107584,_0x3d4cf3,_0x55c1b6,_0xd71efd){return new Agent(_0x107584,_0x3d4cf3,_0x55c1b6,_0xd71efd);}module['exports']=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 4ec000c..ae5b048 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 _0x15e1=['push','handleRun','bind','timeout','drained','prototype','handleTimeout','handleDrained','isNil','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','busyQueue','saveWaitingNotification','showNotification','debug','[%s][QUEUE]\x20EMPTY','TIMEOUT','removeWaitingNotification','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x15e1,0x10f));var _0x115e=function(_0x31523e,_0x3ce635){_0x31523e=_0x31523e-0x0;var _0x195270=_0x15e1[_0x31523e];return _0x195270;};'use strict';var _=require(_0x115e('0x0'));var uuid=require(_0x115e('0x1'));var util=require(_0x115e('0x2'));var logger=require(_0x115e('0x3'))(_0x115e('0x4'));var Beepall=function(_0x3d91a1,_0xdd3f4,_0x27b2c8,_0x63569){this[_0x115e('0x5')]=uuid['v4']();this[_0x115e('0x6')]=_0x3d91a1;this[_0x115e('0x7')]=_0xdd3f4;this[_0x115e('0x8')]=_0x27b2c8;this[_0x115e('0x4')]=_0x63569;this[_0x115e('0x6')][_0x115e('0x9')](this[_0x115e('0xa')][_0x115e('0xb')](this),this['handleTimeout']['bind'](this));this[_0x115e('0x6')]['on'](_0x115e('0xc'),this['handleTimeout'][_0x115e('0xb')](this));this[_0x115e('0x6')]['on'](_0x115e('0xd'),this['handleDrained'][_0x115e('0xb')](this));};Beepall[_0x115e('0xe')][_0x115e('0x9')]=function(){this['squeue'][_0x115e('0x9')](this['handleRun'][_0x115e('0xb')](this),this[_0x115e('0xf')]['bind'](this));};Beepall['prototype'][_0x115e('0x10')]=function(){this[_0x115e('0xf')](!![]);};Beepall[_0x115e('0xe')][_0x115e('0xa')]=function(){var _0xabe4b9=!![];if(!_[_0x115e('0x11')](this[_0x115e('0x7')])&&!_['isNil'](this[_0x115e('0x7')][_0x115e('0x12')])&&this['queue'][_0x115e('0x12')]['length']>0x0){for(var _0x113fda=0x0,_0x48aaf5;_0x113fda0x0){for(var _0x3fadf9=0x0,_0x5d9f75;_0x3fadf90x0&&_0x3efe3b[_0x191375+_0xe851('0x23')]>=_0x3efe3b[_0x191375+_0xe851('0x21')]){writeLog(_0x36f0ba,_0x3efe3b,_0x191375[_0xe851('0x24')]()+_0xe851('0x25'));return![];}}return!![];};exports[_0xe851('0x26')]=function(_0x59395b,_0x219e09,_0x4d54b0,_0xb109e,_0xcf2b23){return sendNotification(!![],_0x59395b,_0x219e09,_0x4d54b0,_0xb109e,_0xcf2b23);};exports[_0xe851('0x27')]=function(_0x29d159,_0x476c6b,_0x16911a,_0xc0a98d,_0x4c3d83){return sendNotification(![],_0x29d159,_0x476c6b,_0x16911a,_0xc0a98d,_0x4c3d83);};exports[_0xe851('0x28')]=function(_0x22bdc7,_0xd954c2,_0x10728f){var _0x3b79df=_0xd954c2[_0xe851('0x29')][_0xe851('0x2a')];if(!_0x3b79df&&_0x10728f){_0x3b79df=_0x10728f['id'];}var _0x3c115b=_[_0xe851('0x2b')](_0x22bdc7[_0xd954c2[_0xe851('0x2c')]+'QueuesWaitingInteractions'],function(_0x49f3f1){var _0xb1a2ec=_[_0xe851('0x2d')](_0xd954c2['channel'])+_0xe851('0x2e');return _0x49f3f1[_0xb1a2ec]===_0xd954c2[_0xe851('0x29')]['id'];});if(!_0x3c115b&&_0x3b79df){_0x3c115b=_[_0xe851('0x2b')](_0x22bdc7[_0xe851('0x2f')][_0x3b79df][_0xd954c2[_0xe851('0x2c')]+_0xe851('0x30')],function(_0x3d5e57){return _0x3d5e57['id']===_0xd954c2['interaction']['id'];});}return _0x3c115b;};exports[_0xe851('0x31')]=function(_0x387ff1,_0x346dc1,_0x234b2f,_0x55f04b){_0x387ff1[_0xe851('0x2f')][_0x234b2f['id']][_0x55f04b+_0xe851('0x30')][_0x346dc1[_0xe851('0x17')]['id']]={'id':_0x346dc1[_0xe851('0x29')]['id']};};exports[_0xe851('0x32')]=function(_0x203524,_0x21be76,_0x3ab1ed,_0x4c3248){delete _0x203524[_0xe851('0x2f')][_0x3ab1ed['id']][_0x4c3248+_0xe851('0x30')][_0x21be76[_0xe851('0x17')]['id']];};exports[_0xe851('0x33')]=writeLog; \ No newline at end of file +var _0xa3bd=['emit','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','debug','busy','BUSY','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','hideNotification','checkWaitingNotifications','UserId','some','channel','QueuesWaitingInteractions','InteractionId','interaction','saveWaitingNotification','agents','WaitingInteractions','removeWaitingNotification','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','localhost','format','user:%s','name'];(function(_0x3e2f11,_0x214fd9){var _0x40fc4d=function(_0x41828d){while(--_0x41828d){_0x3e2f11['push'](_0x3e2f11['shift']());}};_0x40fc4d(++_0x214fd9);}(_0xa3bd,0xc2));var _0xda3b=function(_0x2d6a13,_0x9f13b0){_0x2d6a13=_0x2d6a13-0x0;var _0x108601=_0xa3bd[_0x2d6a13];return _0x108601;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xda3b('0x0'));var Redis=require(_0xda3b('0x1'));var config=require(_0xda3b('0x2'));var logger=require(_0xda3b('0x3'))(_0xda3b('0x4'));config[_0xda3b('0x5')]=_['defaults'](config[_0xda3b('0x5')],{'host':_0xda3b('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xda3b('0x5')]));function sendNotification(_0x12e30a,_0x4b5431,_0x70dadf,_0x1a21ed,_0x3870e5,_0x45f63d){io['to'](util[_0xda3b('0x7')](_0xda3b('0x8'),_0x1a21ed[_0xda3b('0x9')]))[_0xda3b('0xa')](_0xda3b('0xb'),_0x1a21ed);var _0xebfdd=_0x45f63d||{};var _0x389d16=_0x70dadf[_0xda3b('0xc')]('.');var _0xb78e4a={'uniqueid':_0x4b5431,'channel':_0x389d16[0x0],'id':_0x389d16[0x1],'title':_0x389d16[0x0]+_0xda3b('0xd'),'interactionId':_0x389d16[0x2],'queue':_0x3870e5?_0x3870e5['name']:null,'sound':_0xebfdd[_0xda3b('0xe')][_0xda3b('0xf')],'shake':_0xebfdd['account'][_0xda3b('0x10')]};try{if(!_0xebfdd[_0xda3b('0x11')]){_0xebfdd['body']={};}if(_0x3870e5){_0xebfdd['body'][_0xda3b('0x12')]=_0x3870e5;}else if(_0xebfdd[_0xda3b('0x11')][_0xda3b('0x12')]){delete _0xebfdd[_0xda3b('0x11')][_0xda3b('0x12')];}_0xb78e4a[_0xda3b('0x13')]=utils[_0xda3b('0x14')](_0xebfdd[_0xda3b('0xe')][_0xda3b('0x15')],_0xebfdd);}catch(_0x213b44){_0xb78e4a[_0xda3b('0x13')]=_0xda3b('0x16');logger[_0xda3b('0x17')](util[_0xda3b('0x7')](_0xda3b('0x18'),_0x4b5431,_0x213b44[_0xda3b('0x19')]));}io['to'](util[_0xda3b('0x7')](_0xda3b('0x8'),_0x1a21ed[_0xda3b('0x9')]))[_0xda3b('0xa')](util[_0xda3b('0x7')](_0xda3b('0x1a'),_0x12e30a?_0xda3b('0x1b'):_0xda3b('0x1c')),_0xb78e4a);}function writeLog(_0x191b6f,_0x400259,_0x376b38){return logger[_0xda3b('0x1d')](util[_0xda3b('0x7')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x191b6f,_0x400259[_0xda3b('0x9')],_0x376b38));}exports['isAgentAvailable']=function(_0x3110db,_0x2adf16,_0x3f6ca6,_0x2e74f0){if(_0x2adf16[_0xda3b('0x1e')]){writeLog(_0x3110db,_0x2adf16,_0xda3b('0x1f'));return![];}if(!_0x2adf16['online']){writeLog(_0x3110db,_0x2adf16,_0xda3b('0x20'));return![];}if(_0x2adf16[_0x3f6ca6+_0xda3b('0x21')]){writeLog(_0x3110db,_0x2adf16,_0xda3b('0x22'));return![];}if(_0x2e74f0&&_0x2adf16[_0xda3b('0x23')](_0x3f6ca6+_0xda3b('0x24'))&&_0x2adf16[_0xda3b('0x23')](_0x3f6ca6+_0xda3b('0x25'))){if(_0x2adf16[_0x3f6ca6+_0xda3b('0x24')]>0x0&&_0x2adf16[_0x3f6ca6+_0xda3b('0x25')]>=_0x2adf16[_0x3f6ca6+'Capacity']){writeLog(_0x3110db,_0x2adf16,_0x3f6ca6['toUpperCase']()+_0xda3b('0x26'));return![];}}return!![];};exports['showNotification']=function(_0x2529cf,_0xea3050,_0x1c9b4c,_0x3f476f,_0x277f27){return sendNotification(!![],_0x2529cf,_0xea3050,_0x1c9b4c,_0x3f476f,_0x277f27);};exports[_0xda3b('0x27')]=function(_0x536c76,_0x29899a,_0x3a9649,_0x4c3481,_0x13f110){return sendNotification(![],_0x536c76,_0x29899a,_0x3a9649,_0x4c3481,_0x13f110);};exports[_0xda3b('0x28')]=function(_0x3680c2,_0x2372ac,_0x2816ed){var _0x4bf35f=_0x2372ac['interaction'][_0xda3b('0x29')];if(!_0x4bf35f&&_0x2816ed){_0x4bf35f=_0x2816ed['id'];}var _0x3b18a1=_[_0xda3b('0x2a')](_0x3680c2[_0x2372ac[_0xda3b('0x2b')]+_0xda3b('0x2c')],function(_0xc58f98){var _0x380ce1=_['capitalize'](_0x2372ac[_0xda3b('0x2b')])+_0xda3b('0x2d');return _0xc58f98[_0x380ce1]===_0x2372ac['interaction']['id'];});if(!_0x3b18a1&&_0x4bf35f){_0x3b18a1=_[_0xda3b('0x2a')](_0x3680c2['agents'][_0x4bf35f][_0x2372ac[_0xda3b('0x2b')]+'WaitingInteractions'],function(_0x1d91c9){return _0x1d91c9['id']===_0x2372ac[_0xda3b('0x2e')]['id'];});}return _0x3b18a1;};exports[_0xda3b('0x2f')]=function(_0x2a108c,_0x5b1eac,_0x196e52,_0x430787){_0x2a108c[_0xda3b('0x30')][_0x196e52['id']][_0x430787+_0xda3b('0x31')][_0x5b1eac[_0xda3b('0x19')]['id']]={'id':_0x5b1eac[_0xda3b('0x2e')]['id']};};exports[_0xda3b('0x32')]=function(_0x4f3273,_0x53d4bc,_0x3061f9,_0x55d3c7){delete _0x4f3273['agents'][_0x3061f9['id']][_0x55d3c7+'WaitingInteractions'][_0x53d4bc['message']['id']];};exports['writeLog']=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 09736d1..f8563e0 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 _0x3337=['isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil'];(function(_0x5e9b8f,_0x31aa85){var _0xfbda62=function(_0xc9e587){while(--_0xc9e587){_0x5e9b8f['push'](_0x5e9b8f['shift']());}};_0xfbda62(++_0x31aa85);}(_0x3337,0x12e));var _0x7333=function(_0x25f797,_0x449916){_0x25f797=_0x25f797-0x0;var _0x157fdd=_0x3337[_0x25f797];return _0x157fdd;};'use strict';var schema=require(_0x7333('0x0'));var sh=require(_0x7333('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require(_0x7333('0x2'))(_0x7333('0x3'));var system=schema({'command':{'type':_0x7333('0x4'),'required':!![],'message':_0x7333('0x5')}});exports[_0x7333('0x6')]=function(_0x388430,_0x207847){return function(_0x4f3527){try{var _0x36e66a={'command':_0x207847[0x0]};var _0x636aa6=system[_0x7333('0x0')](_0x36e66a,{'typecast':!![]});if(_0x636aa6[_0x7333('0x7')]){logger[_0x7333('0x8')](_0x7333('0x9'),_0x388430,_['map'](_0x636aa6,_0x7333('0xa'))[_0x7333('0xb')](',\x20'));logger[_0x7333('0xc')](_0x7333('0xd'),_0x388430);_0x4f3527[_0x7333('0xe')]();}else{var _0x216cdf=this;var _0x3616d2=utils[_0x7333('0xf')](_0x207847[0x0],this);logger['info'](_0x7333('0x10'),_0x388430,_0x3616d2);sh[_0x7333('0x11')](_[_0x7333('0x12')](_0x3616d2),function(_0x481563,_0xe92b73){logger[_0x7333('0xc')](_0x7333('0x13'),_0x388430,_0x481563);if(_0x481563==0x0){var _0x2c3bc8=_0xe92b73[_0x7333('0x14')](/(\r\n|\n|\r)/gm,'');if(_[_0x7333('0x15')](_0x207847[0x1])||_[_0x7333('0x16')](_0x207847[0x1])){logger['info'](_0x7333('0x17'),_0x388430);_0x216cdf['body'][_0x207847[0x1]]=_0x2c3bc8;}else{logger[_0x7333('0xc')](_0x7333('0x18'),_0x388430,_0x207847[0x1],_0x2c3bc8);_0x216cdf['body'][_0x207847[0x1]]=_0x2c3bc8;}}_0x4f3527[_0x7333('0xe')]();});}}catch(_0x5014f4){logger[_0x7333('0x8')](_0x7333('0x9'),_0x388430,_[_0x7333('0x19')](_0x5014f4)?JSON[_0x7333('0x1a')](_0x5014f4):_0x5014f4);logger[_0x7333('0xc')](_0x7333('0xd'),_0x388430);_0x4f3527['next']();}};}; \ No newline at end of file +var _0x3b75=['string','consequence','error','[%s][SYSTEM]\x20%s','map','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','info','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger'];(function(_0x212aa0,_0xdba42b){var _0x4a19d0=function(_0x138874){while(--_0x138874){_0x212aa0['push'](_0x212aa0['shift']());}};_0x4a19d0(++_0xdba42b);}(_0x3b75,0xdc));var _0x53b7=function(_0x3d2e4b,_0x1f6653){_0x3d2e4b=_0x3d2e4b-0x0;var _0x509e78=_0x3b75[_0x3d2e4b];return _0x509e78;};'use strict';var schema=require(_0x53b7('0x0'));var sh=require(_0x53b7('0x1'));var _=require(_0x53b7('0x2'));var utils=require(_0x53b7('0x3'));var logger=require(_0x53b7('0x4'))('routing');var system=schema({'command':{'type':_0x53b7('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x53b7('0x6')]=function(_0x4c9b8f,_0x357ece){return function(_0xb78251){try{var _0x331d88={'command':_0x357ece[0x0]};var _0x287704=system[_0x53b7('0x0')](_0x331d88,{'typecast':!![]});if(_0x287704['length']){logger[_0x53b7('0x7')](_0x53b7('0x8'),_0x4c9b8f,_[_0x53b7('0x9')](_0x287704,'message')[_0x53b7('0xa')](',\x20'));logger['info'](_0x53b7('0xb'),_0x4c9b8f);_0xb78251[_0x53b7('0xc')]();}else{var _0x2fa631=this;var _0x3dae32=utils[_0x53b7('0xd')](_0x357ece[0x0],this);logger['info'](_0x53b7('0xe'),_0x4c9b8f,_0x3dae32);sh[_0x53b7('0xf')](_[_0x53b7('0x10')](_0x3dae32),function(_0x3c7d94,_0x2c55b6){logger[_0x53b7('0x11')](_0x53b7('0x12'),_0x4c9b8f,_0x3c7d94);if(_0x3c7d94==0x0){var _0x2171b7=_0x2c55b6[_0x53b7('0x13')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x357ece[0x1])||_[_0x53b7('0x14')](_0x357ece[0x1])){logger[_0x53b7('0x11')]('[%s][SYSTEM]\x20no\x20variable',_0x4c9b8f);_0x2fa631['body'][_0x357ece[0x1]]=_0x2171b7;}else{logger['info'](_0x53b7('0x15'),_0x4c9b8f,_0x357ece[0x1],_0x2171b7);_0x2fa631[_0x53b7('0x16')][_0x357ece[0x1]]=_0x2171b7;}}_0xb78251[_0x53b7('0xc')]();});}}catch(_0x47981a){logger[_0x53b7('0x7')](_0x53b7('0x8'),_0x4c9b8f,_[_0x53b7('0x17')](_0x47981a)?JSON[_0x53b7('0x18')](_0x47981a):_0x47981a);logger[_0x53b7('0x11')](_0x53b7('0xb'),_0x4c9b8f);_0xb78251['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index d896f31..b4008a7 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 _0x0d63=['../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][TAG]\x20%s','map','message','join','info','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction'];(function(_0x27c023,_0x14ace3){var _0x432271=function(_0x1581d5){while(--_0x1581d5){_0x27c023['push'](_0x27c023['shift']());}};_0x432271(++_0x14ace3);}(_0x0d63,0x130));var _0x30d6=function(_0x5bc27a,_0x3471d1){_0x5bc27a=_0x5bc27a-0x0;var _0x93af7d=_0x0d63[_0x5bc27a];return _0x93af7d;};'use strict';var schema=require(_0x30d6('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x30d6('0x1')),'openchannelInteraction':require(_0x30d6('0x2')),'smsInteraction':require(_0x30d6('0x3')),'mailInteraction':require(_0x30d6('0x4')),'faxInteraction':require(_0x30d6('0x5')),'whatsappInteraction':require(_0x30d6('0x6'))};var logger=require(_0x30d6('0x7'))(_0x30d6('0x8'));var tag=schema({'tag':{'type':_0x30d6('0x9'),'required':!![],'message':_0x30d6('0xa')}});exports['consequence']=function(_0x427acb,_0x1664ff,_0x179b56,_0x386537){return function(_0x4a3692){try{var _0x365ded={'tag':_0x1664ff[0x0]};var _0x1b99c8=tag[_0x30d6('0x0')](_0x365ded,{'typecast':!![]});if(_0x1b99c8['length']){logger[_0x30d6('0xb')](_0x30d6('0xc'),_0x427acb,_[_0x30d6('0xd')](_0x1b99c8,_0x30d6('0xe'))[_0x30d6('0xf')](',\x20'));logger[_0x30d6('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x427acb);_0x4a3692[_0x30d6('0x11')]();}else{var _0xb7c38f={'ids':[_0x1664ff[0x0]]};if(rpc[_0x386537[_0x30d6('0x12')]+_0x30d6('0x13')]){rpc[_0x386537[_0x30d6('0x12')]+_0x30d6('0x13')][_0x30d6('0x14')](_0x386537[_0x30d6('0x15')]['id'],_0xb7c38f)[_0x30d6('0x16')](function(_0x2f563e){logger['info'](_0x30d6('0x17'),_0x427acb,_0x1664ff[0x1],_0x386537['channel'],_0x386537[_0x30d6('0x15')]['id']);})[_0x30d6('0x18')](function(_0x42cb80){logger[_0x30d6('0xb')](_0x30d6('0xc'),_0x427acb,JSON[_0x30d6('0x19')](_0x42cb80));logger[_0x30d6('0x10')](_0x30d6('0x1a'),_0x427acb);})[_0x30d6('0x1b')](function(){_0x4a3692[_0x30d6('0x11')]();});}}}catch(_0x24576b){logger[_0x30d6('0xb')](_0x30d6('0xc'),_0x427acb,_['isObject'](_0x24576b)?JSON['stringify'](_0x24576b):_0x24576b);logger[_0x30d6('0x10')](_0x30d6('0x1a'),_0x427acb);_0x4a3692[_0x30d6('0x11')]();}};}; \ No newline at end of file +var _0x9322=['consequence','validate','length','error','[%s][TAG]\x20%s','map','join','info','next','channel','Interaction','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x587d76,_0x54a331){var _0x1deb7e=function(_0x3268f6){while(--_0x3268f6){_0x587d76['push'](_0x587d76['shift']());}};_0x1deb7e(++_0x54a331);}(_0x9322,0x1b2));var _0x2932=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9322[_0x167cc1];return _0x10bc4b;};'use strict';var schema=require('validate');var _=require('lodash');var rpc={'chatInteraction':require(_0x2932('0x0')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x2932('0x1')),'mailInteraction':require(_0x2932('0x2')),'faxInteraction':require(_0x2932('0x3')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x2932('0x4'))(_0x2932('0x5'));var tag=schema({'tag':{'type':_0x2932('0x6'),'required':!![],'message':_0x2932('0x7')}});exports[_0x2932('0x8')]=function(_0x350978,_0x300fc9,_0x1cc7df,_0x37f3d0){return function(_0x3f6e6e){try{var _0x378991={'tag':_0x300fc9[0x0]};var _0x46051b=tag[_0x2932('0x9')](_0x378991,{'typecast':!![]});if(_0x46051b[_0x2932('0xa')]){logger[_0x2932('0xb')](_0x2932('0xc'),_0x350978,_[_0x2932('0xd')](_0x46051b,'message')[_0x2932('0xe')](',\x20'));logger[_0x2932('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x350978);_0x3f6e6e[_0x2932('0x10')]();}else{var _0x35842d={'ids':[_0x300fc9[0x0]]};if(rpc[_0x37f3d0[_0x2932('0x11')]+_0x2932('0x12')]){rpc[_0x37f3d0[_0x2932('0x11')]+'Interaction']['addTags'](_0x37f3d0[_0x2932('0x13')]['id'],_0x35842d)[_0x2932('0x14')](function(_0xa6b647){logger[_0x2932('0xf')](_0x2932('0x15'),_0x350978,_0x300fc9[0x1],_0x37f3d0['channel'],_0x37f3d0[_0x2932('0x13')]['id']);})[_0x2932('0x16')](function(_0x99f583){logger[_0x2932('0xb')](_0x2932('0xc'),_0x350978,JSON[_0x2932('0x17')](_0x99f583));logger[_0x2932('0xf')](_0x2932('0x18'),_0x350978);})[_0x2932('0x19')](function(){_0x3f6e6e[_0x2932('0x10')]();});}}}catch(_0x4d969e){logger[_0x2932('0xb')](_0x2932('0xc'),_0x350978,_['isObject'](_0x4d969e)?JSON[_0x2932('0x17')](_0x4d969e):_0x4d969e);logger[_0x2932('0xf')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x350978);_0x3f6e6e[_0x2932('0x10')]();}};}; \ 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 986ae94..8f4cf0f 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 _0xe597=['POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&sessionId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','jsonrpc','2.0','method','login','stringify','utf8'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xe597,0x7f));var _0x7e59=function(_0x596905,_0x17c3b2){_0x596905=_0x596905-0x0;var _0x1ec83d=_0xe597[_0x596905];return _0x1ec83d;};'use strict';var rp=require(_0x7e59('0x0'));var logger=require(_0x7e59('0x1'))(_0x7e59('0x2'));var _=require(_0x7e59('0x3'));var arr=[];exports[_0x7e59('0x4')]=function(_0x128adb,_0x1ca340){return function(_0xa3c741){var _0x45cb1c=_0x1ca340[0xa];var _0x53b4e4=_0x1ca340[0xb];var _0x4b57a4=_0x1ca340[0xc];var _0x5d4d6b=_0x1ca340[0xd];var _0x1f27e=_0x1ca340[0xe];var _0x459c72=_0x1ca340[0xf][_0x7e59('0x5')](/\n/g,_0x7e59('0x6'));var _0x1be1f7=_0x1ca340[0x10][_0x7e59('0x5')](/\n/g,'\x20');if(!arr[_0x7e59('0x7')](_0x53b4e4)){arr[_0x7e59('0x8')](_0x53b4e4);var _0x38f65f=_0x1ca340[0x3];var _0x2f7ecf=_0x1ca340[0x4];var _0x681ba2=_0x1ca340[0x1];var _0x1f2700=_0x1ca340[0x0];var _0x2181d6={};_0x2181d6[_0x7e59('0x9')]=_0x1ca340[0x8]+_0x7e59('0xa')+_0x4b57a4+'|'+_0x45cb1c+'|'+_0x5d4d6b+'|'+_0x53b4e4+'|'+_0x1f27e;_0x2181d6['urlOnRing']=_0x1ca340[0x7]+_0x7e59('0xa')+_0x4b57a4+'|'+_0x45cb1c+'|'+_0x5d4d6b+'|'+_0x53b4e4+'|'+_0x1f27e+'|'+_0x459c72+'|'+_0x1be1f7;_0x2181d6['title']=_0x1ca340[0x9];var _0x5747e2={};_0x5747e2[_0x7e59('0xb')]=_0x7e59('0xc');_0x5747e2[_0x7e59('0xd')]=_0x7e59('0xe');var _0x446c03=[];_0x446c03[_0x7e59('0x8')](_0x1ca340[0x2]);_0x446c03[_0x7e59('0x8')](_0x1ca340[0x5]);_0x446c03[_0x7e59('0x8')](_0x1ca340[0x6]);_0x5747e2['params']=_0x446c03;_0x5747e2['id']=0x1;var _0xad9e10=JSON[_0x7e59('0xf')](_0x5747e2);var _0x2d7064={'encoding':_0x7e59('0x10'),'method':_0x7e59('0x11'),'timeout':0x2710,'url':_0x38f65f,'headers':{'Content-Type':_0x7e59('0x12')},'body':_0xad9e10};return rp(_0x2d7064)[_0x7e59('0x13')](function(_0x4721c6){const _0x6e56e9=JSON[_0x7e59('0x14')](_0x4721c6);if(!_0x6e56e9[_0x7e59('0x15')][_0x7e59('0x16')]){throw new Error(_0x7e59('0x17'));}var _0x3f4c4e=_0x53b4e4;var _0x39333e='channelId='+_0x681ba2+_0x7e59('0x18')+_0x1f2700+_0x7e59('0x19')+_0x3f4c4e+_0x7e59('0x1a')+JSON[_0x7e59('0xf')](_0x2181d6);var _0x402bdd=_0x2f7ecf+'?'+_0x39333e;return rp(_0x402bdd);})['then'](function(_0x4b02bf){logger['info'](_0x7e59('0x1b'),_0x128adb,_0x4b02bf);_0xa3c741[_0x7e59('0x1c')]();})[_0x7e59('0x1d')](function(_0x15b024){logger[_0x7e59('0x1e')](_0x7e59('0x1f'),_0x128adb,_[_0x7e59('0x20')](_0x15b024)?JSON['stringify'](_0x15b024):_0x15b024);_0xa3c741[_0x7e59('0x1c')]();});}else{logger[_0x7e59('0x21')](_0x7e59('0x22'),_0x128adb);_0xa3c741[_0x7e59('0x23')]();}};}; \ No newline at end of file +var _0xc21d=['push','params','stringify','POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&sessionId=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','isObject','next','request-promise','../../../../config/logger','routing','consequence','replace','includes','urlOnAnswer','?params=','urlOnRing','2.0','method'];(function(_0x7ca065,_0x2a221c){var _0x50cc06=function(_0x3329aa){while(--_0x3329aa){_0x7ca065['push'](_0x7ca065['shift']());}};_0x50cc06(++_0x2a221c);}(_0xc21d,0x1a8));var _0xdc21=function(_0xd02c81,_0x3cb4ea){_0xd02c81=_0xd02c81-0x0;var _0x214cde=_0xc21d[_0xd02c81];return _0x214cde;};'use strict';var rp=require(_0xdc21('0x0'));var logger=require(_0xdc21('0x1'))(_0xdc21('0x2'));var _=require('lodash');var arr=[];exports[_0xdc21('0x3')]=function(_0x2cc585,_0x53510d){return function(_0x54583f){var _0x57c3fb=_0x53510d[0xa];var _0x4e7f4f=_0x53510d[0xb];var _0x18f815=_0x53510d[0xc];var _0x3df87b=_0x53510d[0xd];var _0x41a0e5=_0x53510d[0xe];var _0x1cfc2e=_0x53510d[0xf][_0xdc21('0x4')](/\n/g,'\x20-\x20');var _0x39b91c=_0x53510d[0x10][_0xdc21('0x4')](/\n/g,'\x20');if(!arr[_0xdc21('0x5')](_0x4e7f4f)){arr['push'](_0x4e7f4f);var _0xe8163b=_0x53510d[0x3];var _0x1fa061=_0x53510d[0x4];var _0x5a838a=_0x53510d[0x1];var _0x50a465=_0x53510d[0x0];var _0x41d0c9={};_0x41d0c9[_0xdc21('0x6')]=_0x53510d[0x8]+_0xdc21('0x7')+_0x18f815+'|'+_0x57c3fb+'|'+_0x3df87b+'|'+_0x4e7f4f+'|'+_0x41a0e5;_0x41d0c9[_0xdc21('0x8')]=_0x53510d[0x7]+_0xdc21('0x7')+_0x18f815+'|'+_0x57c3fb+'|'+_0x3df87b+'|'+_0x4e7f4f+'|'+_0x41a0e5+'|'+_0x1cfc2e+'|'+_0x39b91c;_0x41d0c9['title']=_0x53510d[0x9];var _0xb0e70b={};_0xb0e70b['jsonrpc']=_0xdc21('0x9');_0xb0e70b[_0xdc21('0xa')]='login';var _0x5da74b=[];_0x5da74b['push'](_0x53510d[0x2]);_0x5da74b[_0xdc21('0xb')](_0x53510d[0x5]);_0x5da74b[_0xdc21('0xb')](_0x53510d[0x6]);_0xb0e70b[_0xdc21('0xc')]=_0x5da74b;_0xb0e70b['id']=0x1;var _0x3c977b=JSON[_0xdc21('0xd')](_0xb0e70b);var _0x7d8287={'encoding':'utf8','method':_0xdc21('0xe'),'timeout':0x2710,'url':_0xe8163b,'headers':{'Content-Type':_0xdc21('0xf')},'body':_0x3c977b};return rp(_0x7d8287)[_0xdc21('0x10')](function(_0x12ee9d){const _0x2ec2d5=JSON[_0xdc21('0x11')](_0x12ee9d);if(!_0x2ec2d5[_0xdc21('0x12')][_0xdc21('0x13')]){throw new Error(_0xdc21('0x14'));}var _0x48643c=_0x4e7f4f;var _0x14c95e='channelId='+_0x5a838a+_0xdc21('0x15')+_0x50a465+_0xdc21('0x16')+_0x48643c+'&data='+JSON[_0xdc21('0xd')](_0x41d0c9);var _0x197457=_0x1fa061+'?'+_0x14c95e;return rp(_0x197457);})[_0xdc21('0x10')](function(_0x475d2d){logger[_0xdc21('0x17')](_0xdc21('0x18'),_0x2cc585,_0x475d2d);_0x54583f['stop']();})[_0xdc21('0x19')](function(_0x9b69e1){logger[_0xdc21('0x1a')]('[%s][TVOX]\x20%s',_0x2cc585,_[_0xdc21('0x1b')](_0x9b69e1)?JSON[_0xdc21('0xd')](_0x9b69e1):_0x9b69e1);_0x54583f['stop']();});}else{logger['info']('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x2cc585);_0x54583f[_0xdc21('0x1c')]();}};}; \ 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 8890e00..3f390fb 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(_0x37f623,_0x3ab407){var _0x15737b=function(_0x45bb67){while(--_0x45bb67){_0x37f623['push'](_0x37f623['shift']());}};_0x15737b(++_0x3ab407);}(_0xe706,0xa3));var _0x6e70=function(_0x56edce,_0x3718d7){_0x56edce=_0x56edce-0x0;var _0x3ea2fe=_0xe706[_0x56edce];return _0x3ea2fe;};'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 _0xbaf0=['list','lodash','exports','render','merge','contact','message','account','interaction'];(function(_0x481a2b,_0x83a422){var _0x12c706=function(_0x480954){while(--_0x480954){_0x481a2b['push'](_0x481a2b['shift']());}};_0x12c706(++_0x83a422);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var Mustache=require('mustache');var _=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'getMustacheRender':function(_0x1e212d,_0x263f79){return Mustache[_0x0baf('0x2')](_0x1e212d,_[_0x0baf('0x3')](_0x263f79['body'],{'contact':_0x263f79[_0x0baf('0x4')],'message':_0x263f79[_0x0baf('0x5')],'account':_0x263f79[_0x0baf('0x6')],'interaction':_0x263f79[_0x0baf('0x7')],'list':_0x263f79[_0x0baf('0x8')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 8bb6d2a..8bf1ca6 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 _0x4349=['toLowerCase','autoreply','push','slice','dialogflow','split','dialogflowv2','appdata','amazonlex','tag','TagId','getMustacheRender','account','ContactId','body','%s:%s:%s','./interval','condition','intervals','consequence','priority','info','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4349,0x17e));var _0x9434=function(_0x677895,_0x2ed156){_0x677895=_0x677895-0x0;var _0x156217=_0x4349[_0x677895];return _0x156217;};'use strict';var _=require(_0x9434('0x0'));var util=require(_0x9434('0x1'));var path=require(_0x9434('0x2'));var fs=require('fs');var jayson=require(_0x9434('0x3'));var BPromise=require(_0x9434('0x4'));var utils=require(_0x9434('0x5'));var sUtils=require(_0x9434('0x6'));var logger=require(_0x9434('0x7'))(_0x9434('0x8'));var rpc={'openchannelQueueReport':require(_0x9434('0x9')),'mailQueueReport':require(_0x9434('0xa')),'chatQueueReport':require(_0x9434('0xb')),'smsQueueReport':require(_0x9434('0xc')),'faxQueueReport':require(_0x9434('0xd')),'whatsappQueueReport':require(_0x9434('0xe'))};var RuleEngine=require(_0x9434('0xf'));function getId(_0x10d41b,_0xb5e6d7,_0x116abf){return util[_0x9434('0x10')](_0x9434('0x11'),_0x10d41b,_0xb5e6d7||0x0,_0x116abf||0x0);}function getIntervals(_0x5a5489,_0x3f2845){var _0x1ecd03=[];if(!_[_0x9434('0x12')](_0x3f2845[_0x9434('0x13')])&&!_[_0x9434('0x12')](_0x5a5489[_0x3f2845[_0x9434('0x13')]])&&!_[_0x9434('0x12')](_0x5a5489[_0x3f2845[_0x9434('0x13')]]['Intervals'])){_0x1ecd03=_['map'](_0x5a5489[_0x3f2845['IntervalId']][_0x9434('0x14')],'interval');}else if(!_[_0x9434('0x12')](_0x3f2845[_0x9434('0x15')])){_0x1ecd03=[_0x3f2845[_0x9434('0x15')]];}return _0x1ecd03;}exports[_0x9434('0x16')]=function(_0x53b063){_0x53b063[_0x9434('0x17')]={};return new BPromise(function(_0x55c4f4,_0x4b4f81){var _0x31a14f={'Start':function(_0x58de55){var _0x4ad7cf=this;return new Promise(function(_0x2b5a45,_0x2c3009){if(_0x58de55){try{var _0x3cee90=[];var _0x417ffd=getId(_0x58de55[_0x9434('0x18')],_0x58de55[_0x9434('0x19')]?_0x58de55[_0x9434('0x19')]['id']:0x0,_0x58de55[_0x9434('0x1a')]?_0x58de55[_0x9434('0x1a')]['id']:0x0);var _0xeed87=sUtils['checkWaitingNotifications'](_0x53b063,_0x58de55);if(!_0xeed87&&_0x58de55[_0x9434('0x1b')]&&_[_0x9434('0x1c')](_0x58de55[_0x9434('0x1b')])&&_0x58de55[_0x9434('0x1b')][_0x9434('0x1d')]){for(var _0x59cff9=0x0;_0x59cff9<_0x58de55[_0x9434('0x1b')][_0x9434('0x1d')];_0x59cff9+=0x1){var _0x13572b=_0x58de55[_0x9434('0x1b')][_0x59cff9];if(fs[_0x9434('0x1e')](path[_0x9434('0x1f')](__dirname,_0x9434('0x1b'),_0x13572b[_0x9434('0x20')]+_0x9434('0x21')))){var _0x1d4e75=[];switch(_0x13572b[_0x9434('0x20')][_0x9434('0x22')]()){case _0x9434('0x23'):var _0x426a46=_0x13572b['appdata']['split'](',');if(_0x58de55[_0x9434('0x18')]==='mail'){_0x1d4e75[_0x9434('0x24')](_0x426a46[0x0]);_0x1d4e75[_0x9434('0x24')](_0x426a46[0x1]);_0x1d4e75[_0x9434('0x24')](_0x426a46[_0x9434('0x25')](0x2,_0x426a46[_0x9434('0x1d')])[_0x9434('0x1f')](','));}else{_0x1d4e75[_0x9434('0x24')](_0x426a46[0x0]);_0x1d4e75[_0x9434('0x24')](_0x426a46['slice'](0x1,_0x426a46[_0x9434('0x1d')])[_0x9434('0x1f')](','));}break;case _0x9434('0x26'):var _0x4e410b=_0x13572b['appdata'][_0x9434('0x27')](',');_0x1d4e75[_0x9434('0x24')](_0x4e410b[0x0]);_0x1d4e75['push'](_0x4e410b[0x1]);_0x1d4e75[_0x9434('0x24')](_0x4e410b[_0x9434('0x25')](0x2,_0x4e410b[_0x9434('0x1d')])[_0x9434('0x1f')](','));break;case _0x9434('0x28'):var _0x1a9e4c=_0x13572b[_0x9434('0x29')][_0x9434('0x27')](',');_0x1d4e75[_0x9434('0x24')](_0x1a9e4c[0x0]);_0x1d4e75[_0x9434('0x24')](_0x1a9e4c[0x1]);_0x1d4e75[_0x9434('0x24')](_0x1a9e4c[0x2]);_0x1d4e75[_0x9434('0x24')](_0x1a9e4c[0x3]);_0x1d4e75[_0x9434('0x24')](_0x1a9e4c[_0x9434('0x25')](0x4,_0x1a9e4c[_0x9434('0x1d')])[_0x9434('0x1f')](','));break;case _0x9434('0x2a'):var _0x3e3f7f=_0x13572b[_0x9434('0x29')][_0x9434('0x27')](',');_0x1d4e75[_0x9434('0x24')](_0x3e3f7f[0x0]);_0x1d4e75[_0x9434('0x24')](_0x3e3f7f[0x1]);_0x1d4e75[_0x9434('0x24')](_0x3e3f7f[0x2]);_0x1d4e75[_0x9434('0x24')](_0x3e3f7f[0x3]);_0x1d4e75['push'](_0x3e3f7f[_0x9434('0x25')](0x4,_0x3e3f7f[_0x9434('0x1d')])[_0x9434('0x1f')](','));break;case _0x9434('0x19'):_0x1d4e75[_0x9434('0x24')](_0x13572b['appdata']);break;case _0x9434('0x2b'):_0x1d4e75[_0x9434('0x24')](_0x13572b[_0x9434('0x2c')]);_0x1d4e75[_0x9434('0x24')](_0x13572b['appdata']);break;case'tvox':var _0x197b69=utils[_0x9434('0x2d')](_0x58de55[_0x9434('0x2e')]['notificationTemplate'],_0x58de55);var _0xa90738=_0x13572b['appdata'][_0x9434('0x27')](',');_0x1d4e75['push'](_0xa90738[0x0]);_0x1d4e75[_0x9434('0x24')](_0xa90738[0x1]);_0x1d4e75[_0x9434('0x24')](_0xa90738[0x2]);_0x1d4e75['push'](_0xa90738[0x3]);_0x1d4e75[_0x9434('0x24')](_0xa90738[0x4]);_0x1d4e75['push'](_0xa90738[0x5]);_0x1d4e75[_0x9434('0x24')](_0xa90738[0x6]);_0x1d4e75[_0x9434('0x24')](_0xa90738[0x7]);_0x1d4e75[_0x9434('0x24')](_0xa90738[0x8]);_0x1d4e75[_0x9434('0x24')](_0xa90738[0x9]);_0x1d4e75[_0x9434('0x24')](_0xa90738[0xa]);_0x1d4e75[_0x9434('0x24')](_0x58de55[_0x9434('0x1a')]['id']);_0x1d4e75[_0x9434('0x24')](_0x58de55['message']['id']);_0x1d4e75[_0x9434('0x24')](_0x13572b['ChatWebsiteId']);_0x1d4e75[_0x9434('0x24')](_0x58de55[_0x9434('0x1a')][_0x9434('0x2f')]);_0x1d4e75[_0x9434('0x24')](_0x58de55[_0x9434('0x30')][_0x9434('0x30')]);_0x1d4e75[_0x9434('0x24')](_0x197b69);break;default:_0x1d4e75=_['isNil'](_0x13572b[_0x9434('0x29')])?[]:_0x13572b[_0x9434('0x29')][_0x9434('0x27')](',');}var _0x82f6a7={'id':util[_0x9434('0x10')](_0x9434('0x31'),_0x417ffd,_0x13572b['id'],_0x13572b['app']),'condition':require(_0x9434('0x32'))[_0x9434('0x33')](_0x417ffd,getIntervals(_0x53b063[_0x9434('0x34')],_0x13572b),_0x53b063),'consequence':require('./applications/'+_0x13572b[_0x9434('0x20')])[_0x9434('0x35')](_0x417ffd,_0x1d4e75,_0x53b063,_0x58de55),'p':_0x13572b[_0x9434('0x36')]||0x0};logger[_0x9434('0x37')]('Push\x20new\x20rule',_0x82f6a7['id'],'on\x20interval',getIntervals(_0x53b063[_0x9434('0x34')],_0x13572b)['join'](_0x9434('0x38')));_0x3cee90['push'](_0x82f6a7);}else{logger[_0x9434('0x39')](_0x9434('0x3a'),path[_0x9434('0x1f')](__dirname,_0x9434('0x1b'),_0x13572b['app']+'.js'));}}_0x53b063[_0x9434('0x17')][_0x417ffd]=new RuleEngine(_0x3cee90);_0x53b063[_0x9434('0x17')][_0x417ffd][_0x9434('0x3b')](_0x58de55,function(_0x4d69a3){logger[_0x9434('0x37')](_0x9434('0x3c'),JSON[_0x9434('0x3d')](_0x4d69a3[_0x9434('0x3e')]));if(_0x53b063[_0x9434('0x17')][_0x417ffd]){_0x53b063[_0x9434('0x17')][_0x417ffd][_0x9434('0x3f')](_0x9434('0x40'));}});return _0x2b5a45({'code':0xc8,'message':_0x58de55});}else{if(_0xeed87){logger[_0x9434('0x37')](util[_0x9434('0x10')](_0x9434('0x41'),_0x417ffd));}else{logger['info'](_0x9434('0x42'));}return _0x2b5a45({'code':0xc8,'message':_0x58de55});}}catch(_0x556263){logger[_0x9434('0x39')](_0x556263[_0x9434('0x43')]);return _0x2c3009(_0x4ad7cf['error'](0x1f4,_0x556263));}}return _0x2c3009('routing\x20is\x20empty');});},'AcceptMessage':function(_0x2f81f2){var _0x3d397d=this;return new Promise(function(_0x36ac8a,_0x5532e0){if(_0x2f81f2['agent']&&_0x2f81f2[_0x9434('0x44')]['id']){if(_0x53b063[_0x9434('0x45')][_0x2f81f2[_0x9434('0x44')]['id']]){_0x53b063[_0x9434('0x45')][_0x2f81f2[_0x9434('0x44')]['id']][_0x9434('0x46')]=![];_0x53b063[_0x9434('0x45')][_0x2f81f2['agent']['id']][_0x9434('0x47')]=undefined;}}if(_0x2f81f2[_0x9434('0x19')]&&_0x2f81f2[_0x9434('0x19')]['id']){try{var _0x288df2=getId(_0x2f81f2[_0x9434('0x18')],_0x2f81f2[_0x9434('0x19')]?_0x2f81f2[_0x9434('0x19')]['id']:0x0,_0x2f81f2['interaction']?_0x2f81f2[_0x9434('0x1a')]['id']:0x0);if(_0x53b063[_0x9434('0x17')][_0x288df2]){_0x53b063[_0x9434('0x17')][_0x288df2][_0x9434('0x3f')](_0x9434('0x48'));if(rpc[_0x2f81f2['channel']+_0x9434('0x49')]){rpc[_0x2f81f2[_0x9434('0x18')]+'QueueReport'][_0x9434('0x4a')](_0x288df2,{'UserId':_0x2f81f2[_0x9434('0x19')][_0x9434('0x4b')]})['catch'](function(){logger[_0x9434('0x39')]('error\x20update\x20queue\x20report');});}}return _0x36ac8a({'code':0xc8,'message':_0x2f81f2});}catch(_0x50f125){logger[_0x9434('0x39')](_0x50f125['stack']);return _0x5532e0(_0x3d397d[_0x9434('0x39')](0x1f4,_0x50f125));}}logger[_0x9434('0x39')]('message\x20is\x20empty');return _0x5532e0(_0x3d397d[_0x9434('0x39')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x56232a){var _0x5851d4=this;return new Promise(function(_0xc45ff7,_0x237ef3){if(_0x56232a[_0x9434('0x44')]&&_0x56232a['agent']['id']){try{if(_0x53b063['agents'][_0x56232a[_0x9434('0x44')]['id']]){_0x53b063[_0x9434('0x45')][_0x56232a[_0x9434('0x44')]['id']][_0x9434('0x46')]=![];_0x53b063[_0x9434('0x45')][_0x56232a[_0x9434('0x44')]['id']][_0x9434('0x47')]=undefined;}return _0xc45ff7({'code':0xc8,'message':_0x56232a});}catch(_0x3ba6ab){logger[_0x9434('0x39')](_0x3ba6ab[_0x9434('0x43')]);return _0x237ef3(_0x5851d4['error'](0x1f4,_0x3ba6ab));}}logger['error'](_0x9434('0x4c'));return _0x237ef3(_0x5851d4[_0x9434('0x39')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x5222ae){var _0x1ecf36=this;return new Promise(function(_0x220d12,_0x494441){if(_0x5222ae[_0x9434('0x18')]&&_0x5222ae[_0x9434('0x1a')]&&_0x5222ae[_0x9434('0x1a')]['id']){try{var _0x1cf375=getId(_0x5222ae[_0x9434('0x18')],_0x5222ae[_0x9434('0x19')]?_0x5222ae[_0x9434('0x19')]['id']:0x0,_0x5222ae[_0x9434('0x1a')]?_0x5222ae[_0x9434('0x1a')]['id']:0x0);if(_0x53b063[_0x9434('0x17')][_0x1cf375]){_0x53b063[_0x9434('0x17')][_0x1cf375][_0x9434('0x3f')](_0x9434('0x48'));}return _0x220d12({'code':0xc8,'message':_0x5222ae});}catch(_0x385c8a){logger[_0x9434('0x39')](_0x385c8a['stack']);return _0x494441(_0x1ecf36['error'](0x1f4,_0x385c8a));}}logger[_0x9434('0x39')](_0x9434('0x4c'));return _0x494441(_0x1ecf36[_0x9434('0x39')](0x1f4,_0x9434('0x4c')));});},'AgentCapacity':function(_0x254f50){var _0x5d9829=this;return new Promise(function(_0x231e04,_0x31c948){if(_0x53b063[_0x9434('0x45')][_0x9434('0x4d')](_0x254f50['id'])){for(var _0x263e87 in _0x254f50[_0x9434('0x4e')]){if(_0x254f50[_0x9434('0x4e')][_0x9434('0x4d')](_0x263e87)){if(_0x53b063[_0x9434('0x45')][_0x254f50['id']]['hasOwnProperty'](_0x263e87+_0x9434('0x4f'))){_0x53b063[_0x9434('0x45')][_0x254f50['id']][_0x263e87+_0x9434('0x4f')]=parseInt(_0x254f50[_0x9434('0x4e')][_0x263e87],0xa);}}}_0x53b063[_0x9434('0x45')][_0x254f50['id']][_0x9434('0x50')]();return _0x231e04({'code':0xc8,'message':_0x53b063[_0x9434('0x45')][_0x254f50['id']]});}else{return _0x31c948(_0x5d9829[_0x9434('0x39')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x307e9f){return new Promise(function(_0x44a904){var _0x108b5b=_[_0x9434('0x51')](_0x53b063[_0x9434('0x45')]);if(_0x307e9f&&_0x307e9f['id']){var _0x327ee1=_['find'](_0x108b5b,function(_0x9cecf3){return _0x9cecf3['id']===_0x307e9f['id'];});_0x44a904(_0x327ee1);}else{_0x44a904({'count':_0x108b5b['length'],'rows':_0x108b5b});}});},'ChatQueues':function(){return new Promise(function(_0x4c288c){var _0x33876b=[];for(var _0x246df1 in _0x53b063[_0x9434('0x52')]){if(_0x53b063[_0x9434('0x52')][_0x9434('0x4d')](_0x246df1)){var _0x411785=_0x53b063[_0x9434('0x52')][_0x246df1];var _0x275877={'id':_0x411785['id'],'available':_0x411785[_0x9434('0x53')],'loggedIn':_0x411785[_0x9434('0x54')],'name':_0x411785[_0x9434('0x55')],'paused':_0x411785[_0x9434('0x56')],'waiting':_0x411785[_0x9434('0x57')]};_0x33876b['push'](_0x275877);}}_0x4c288c({'count':_0x33876b[_0x9434('0x1d')],'rows':_0x33876b});});},'MailQueues':function(){return new Promise(function(_0x14789e){var _0x19d5d5=[];for(var _0x356ae3 in _0x53b063[_0x9434('0x58')]){if(_0x53b063[_0x9434('0x58')][_0x9434('0x4d')](_0x356ae3)){var _0x34fead=_0x53b063['mailQueues'][_0x356ae3];var _0x475879={'id':_0x34fead['id'],'available':_0x34fead[_0x9434('0x53')],'loggedIn':_0x34fead[_0x9434('0x54')],'name':_0x34fead[_0x9434('0x55')],'paused':_0x34fead[_0x9434('0x56')],'waiting':_0x34fead[_0x9434('0x57')]};_0x19d5d5[_0x9434('0x24')](_0x475879);}}_0x14789e({'count':_0x19d5d5['length'],'rows':_0x19d5d5});});},'OpenchannelQueues':function(){return new Promise(function(_0x11d687){var _0x4b4b58=[];for(var _0x3c6261 in _0x53b063[_0x9434('0x59')]){if(_0x53b063[_0x9434('0x59')][_0x9434('0x4d')](_0x3c6261)){var _0x2e13b0=_0x53b063[_0x9434('0x59')][_0x3c6261];var _0x3be26b={'id':_0x2e13b0['id'],'available':_0x2e13b0[_0x9434('0x53')],'loggedIn':_0x2e13b0[_0x9434('0x54')],'name':_0x2e13b0[_0x9434('0x55')],'paused':_0x2e13b0[_0x9434('0x56')],'waiting':_0x2e13b0[_0x9434('0x57')]};_0x4b4b58[_0x9434('0x24')](_0x3be26b);}}_0x11d687({'count':_0x4b4b58[_0x9434('0x1d')],'rows':_0x4b4b58});});},'SmsQueues':function(){return new Promise(function(_0x16d9db){var _0x4e0c1c=[];for(var _0x2a61e6 in _0x53b063[_0x9434('0x5a')]){if(_0x53b063[_0x9434('0x5a')]['hasOwnProperty'](_0x2a61e6)){var _0x68c4ef=_0x53b063[_0x9434('0x5a')][_0x2a61e6];var _0x5efbd7={'id':_0x68c4ef['id'],'available':_0x68c4ef[_0x9434('0x53')],'loggedIn':_0x68c4ef[_0x9434('0x54')],'name':_0x68c4ef[_0x9434('0x55')],'paused':_0x68c4ef[_0x9434('0x56')],'waiting':_0x68c4ef[_0x9434('0x57')]};_0x4e0c1c[_0x9434('0x24')](_0x5efbd7);}}_0x16d9db({'count':_0x4e0c1c[_0x9434('0x1d')],'rows':_0x4e0c1c});});},'FaxQueues':function(){return new Promise(function(_0x4eaa68){var _0x21337d=[];for(var _0x1c2a5f in _0x53b063[_0x9434('0x5b')]){if(_0x53b063['faxQueues'][_0x9434('0x4d')](_0x1c2a5f)){var _0xf21e12=_0x53b063[_0x9434('0x5b')][_0x1c2a5f];var _0x5425ea={'id':_0xf21e12['id'],'available':_0xf21e12['available'],'loggedIn':_0xf21e12[_0x9434('0x54')],'name':_0xf21e12['name'],'paused':_0xf21e12[_0x9434('0x56')],'waiting':_0xf21e12[_0x9434('0x57')]};_0x21337d[_0x9434('0x24')](_0x5425ea);}}_0x4eaa68({'count':_0x21337d[_0x9434('0x1d')],'rows':_0x21337d});});},'WhatsappQueues':function(){return new Promise(function(_0x5a29cb){var _0xcad7ee=[];for(var _0x420939 in _0x53b063['whatsappQueues']){if(_0x53b063[_0x9434('0x5c')]['hasOwnProperty'](_0x420939)){var _0x114c75=_0x53b063['whatsappQueues'][_0x420939];var _0x5a25eb={'id':_0x114c75['id'],'available':_0x114c75[_0x9434('0x53')],'loggedIn':_0x114c75[_0x9434('0x54')],'name':_0x114c75[_0x9434('0x55')],'paused':_0x114c75[_0x9434('0x56')],'waiting':_0x114c75[_0x9434('0x57')]};_0xcad7ee[_0x9434('0x24')](_0x5a25eb);}}_0x5a29cb({'count':_0xcad7ee['length'],'rows':_0xcad7ee});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x4098cd){var _0x29a1bf=_[_0x9434('0x51')](_0x53b063['chatQueuesWaitingInteractions']);_0x4098cd({'count':_0x29a1bf[_0x9434('0x1d')],'rows':_0x29a1bf});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x164a27){var _0x4ebc50=_[_0x9434('0x51')](_0x53b063[_0x9434('0x5d')]);_0x164a27({'count':_0x4ebc50['length'],'rows':_0x4ebc50});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x12708b){var _0x3fb4b9=_[_0x9434('0x51')](_0x53b063[_0x9434('0x5e')]);_0x12708b({'count':_0x3fb4b9[_0x9434('0x1d')],'rows':_0x3fb4b9});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x1f8d49){var _0x1368d9=_[_0x9434('0x51')](_0x53b063[_0x9434('0x5f')]);_0x1f8d49({'count':_0x1368d9['length'],'rows':_0x1368d9});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x390f9d){var _0x1194f9=_['values'](_0x53b063[_0x9434('0x60')]);_0x390f9d({'count':_0x1194f9['length'],'rows':_0x1194f9});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x1dde9c){var _0x2b5506=_[_0x9434('0x51')](_0x53b063[_0x9434('0x61')]);_0x1dde9c({'count':_0x2b5506[_0x9434('0x1d')],'rows':_0x2b5506});});}};var _0x5c3d58=jayson[_0x9434('0x62')](_0x31a14f)[_0x9434('0x63')]();_0x5c3d58['on'](_0x9434('0x39'),function(_0x4e56c2){logger['error'](JSON['stringify'](_0x4e56c2));return _0x4b4f81(_0x4e56c2);});_0x5c3d58[_0x9434('0x16')](0x232c,_0x9434('0x64'),function(){console[_0x9434('0x65')](_0x9434('0x66'),0x232c);return _0x55c4f4(_0x9434('0x67')+0x232c);});});}; \ No newline at end of file +var _0xe9f5=['appdata','dialogflowv2','tag','TagId','getMustacheRender','account','notificationTemplate','body','intervals','./applications/','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','agent','agents','busy','busyQueue','end','UserId','catch','message\x20is\x20empty','emit','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','bluebird','./applications/strategy/util','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','isArray','applications','length','join','app','toLowerCase','autoreply','split','mail','push','slice','dialogflow'];(function(_0x37b5ca,_0x126698){var _0x5bc849=function(_0xbc3402){while(--_0xbc3402){_0x37b5ca['push'](_0x37b5ca['shift']());}};_0x5bc849(++_0x126698);}(_0xe9f5,0x1c0));var _0x5e9f=function(_0x54edab,_0x49b7ad){_0x54edab=_0x54edab-0x0;var _0x35c7c9=_0xe9f5[_0x54edab];return _0x35c7c9;};'use strict';var _=require(_0x5e9f('0x0'));var util=require(_0x5e9f('0x1'));var path=require(_0x5e9f('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x5e9f('0x3'));var utils=require('./applications/utils');var sUtils=require(_0x5e9f('0x4'));var logger=require('../../../config/logger')(_0x5e9f('0x5'));var rpc={'openchannelQueueReport':require(_0x5e9f('0x6')),'mailQueueReport':require(_0x5e9f('0x7')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x5e9f('0x8')),'faxQueueReport':require(_0x5e9f('0x9')),'whatsappQueueReport':require(_0x5e9f('0xa'))};var RuleEngine=require(_0x5e9f('0xb'));function getId(_0x59794e,_0x42d573,_0x54fb68){return util[_0x5e9f('0xc')](_0x5e9f('0xd'),_0x59794e,_0x42d573||0x0,_0x54fb68||0x0);}function getIntervals(_0x4bf7bb,_0x319e85){var _0x1c9b96=[];if(!_[_0x5e9f('0xe')](_0x319e85[_0x5e9f('0xf')])&&!_[_0x5e9f('0xe')](_0x4bf7bb[_0x319e85['IntervalId']])&&!_[_0x5e9f('0xe')](_0x4bf7bb[_0x319e85[_0x5e9f('0xf')]][_0x5e9f('0x10')])){_0x1c9b96=_[_0x5e9f('0x11')](_0x4bf7bb[_0x319e85[_0x5e9f('0xf')]][_0x5e9f('0x10')],_0x5e9f('0x12'));}else if(!_[_0x5e9f('0xe')](_0x319e85['interval'])){_0x1c9b96=[_0x319e85[_0x5e9f('0x12')]];}return _0x1c9b96;}exports[_0x5e9f('0x13')]=function(_0x149188){_0x149188[_0x5e9f('0x14')]={};return new BPromise(function(_0x7dea41,_0x36634f){var _0x4fe95a={'Start':function(_0x39b8f1){var _0x340042=this;return new Promise(function(_0x3a8339,_0xf4f97e){if(_0x39b8f1){try{var _0xc4ceb8=[];var _0x2f3872=getId(_0x39b8f1[_0x5e9f('0x15')],_0x39b8f1['message']?_0x39b8f1[_0x5e9f('0x16')]['id']:0x0,_0x39b8f1[_0x5e9f('0x17')]?_0x39b8f1[_0x5e9f('0x17')]['id']:0x0);var _0x3566ae=sUtils[_0x5e9f('0x18')](_0x149188,_0x39b8f1);if(!_0x3566ae&&_0x39b8f1['applications']&&_[_0x5e9f('0x19')](_0x39b8f1[_0x5e9f('0x1a')])&&_0x39b8f1['applications'][_0x5e9f('0x1b')]){for(var _0x27f92b=0x0;_0x27f92b<_0x39b8f1['applications'][_0x5e9f('0x1b')];_0x27f92b+=0x1){var _0x548ea9=_0x39b8f1[_0x5e9f('0x1a')][_0x27f92b];if(fs['existsSync'](path[_0x5e9f('0x1c')](__dirname,_0x5e9f('0x1a'),_0x548ea9[_0x5e9f('0x1d')]+'.js'))){var _0xdca7f1=[];switch(_0x548ea9[_0x5e9f('0x1d')][_0x5e9f('0x1e')]()){case _0x5e9f('0x1f'):var _0x1dc564=_0x548ea9['appdata'][_0x5e9f('0x20')](',');if(_0x39b8f1[_0x5e9f('0x15')]===_0x5e9f('0x21')){_0xdca7f1['push'](_0x1dc564[0x0]);_0xdca7f1[_0x5e9f('0x22')](_0x1dc564[0x1]);_0xdca7f1[_0x5e9f('0x22')](_0x1dc564['slice'](0x2,_0x1dc564['length'])[_0x5e9f('0x1c')](','));}else{_0xdca7f1[_0x5e9f('0x22')](_0x1dc564[0x0]);_0xdca7f1['push'](_0x1dc564[_0x5e9f('0x23')](0x1,_0x1dc564['length'])['join'](','));}break;case _0x5e9f('0x24'):var _0x7b0498=_0x548ea9[_0x5e9f('0x25')][_0x5e9f('0x20')](',');_0xdca7f1[_0x5e9f('0x22')](_0x7b0498[0x0]);_0xdca7f1['push'](_0x7b0498[0x1]);_0xdca7f1['push'](_0x7b0498[_0x5e9f('0x23')](0x2,_0x7b0498['length'])[_0x5e9f('0x1c')](','));break;case _0x5e9f('0x26'):var _0x42e99a=_0x548ea9[_0x5e9f('0x25')]['split'](',');_0xdca7f1[_0x5e9f('0x22')](_0x42e99a[0x0]);_0xdca7f1['push'](_0x42e99a[0x1]);_0xdca7f1[_0x5e9f('0x22')](_0x42e99a[0x2]);_0xdca7f1[_0x5e9f('0x22')](_0x42e99a[0x3]);_0xdca7f1[_0x5e9f('0x22')](_0x42e99a['slice'](0x4,_0x42e99a[_0x5e9f('0x1b')])[_0x5e9f('0x1c')](','));break;case'amazonlex':var _0x112a8c=_0x548ea9[_0x5e9f('0x25')][_0x5e9f('0x20')](',');_0xdca7f1[_0x5e9f('0x22')](_0x112a8c[0x0]);_0xdca7f1[_0x5e9f('0x22')](_0x112a8c[0x1]);_0xdca7f1[_0x5e9f('0x22')](_0x112a8c[0x2]);_0xdca7f1[_0x5e9f('0x22')](_0x112a8c[0x3]);_0xdca7f1[_0x5e9f('0x22')](_0x112a8c['slice'](0x4,_0x112a8c[_0x5e9f('0x1b')])[_0x5e9f('0x1c')](','));break;case _0x5e9f('0x16'):_0xdca7f1[_0x5e9f('0x22')](_0x548ea9[_0x5e9f('0x25')]);break;case _0x5e9f('0x27'):_0xdca7f1[_0x5e9f('0x22')](_0x548ea9[_0x5e9f('0x28')]);_0xdca7f1[_0x5e9f('0x22')](_0x548ea9[_0x5e9f('0x25')]);break;case'tvox':var _0x4b6954=utils[_0x5e9f('0x29')](_0x39b8f1[_0x5e9f('0x2a')][_0x5e9f('0x2b')],_0x39b8f1);var _0x54d88f=_0x548ea9['appdata'][_0x5e9f('0x20')](',');_0xdca7f1[_0x5e9f('0x22')](_0x54d88f[0x0]);_0xdca7f1[_0x5e9f('0x22')](_0x54d88f[0x1]);_0xdca7f1[_0x5e9f('0x22')](_0x54d88f[0x2]);_0xdca7f1[_0x5e9f('0x22')](_0x54d88f[0x3]);_0xdca7f1['push'](_0x54d88f[0x4]);_0xdca7f1[_0x5e9f('0x22')](_0x54d88f[0x5]);_0xdca7f1[_0x5e9f('0x22')](_0x54d88f[0x6]);_0xdca7f1[_0x5e9f('0x22')](_0x54d88f[0x7]);_0xdca7f1[_0x5e9f('0x22')](_0x54d88f[0x8]);_0xdca7f1[_0x5e9f('0x22')](_0x54d88f[0x9]);_0xdca7f1[_0x5e9f('0x22')](_0x54d88f[0xa]);_0xdca7f1['push'](_0x39b8f1['interaction']['id']);_0xdca7f1[_0x5e9f('0x22')](_0x39b8f1['message']['id']);_0xdca7f1['push'](_0x548ea9['ChatWebsiteId']);_0xdca7f1[_0x5e9f('0x22')](_0x39b8f1[_0x5e9f('0x17')]['ContactId']);_0xdca7f1[_0x5e9f('0x22')](_0x39b8f1['body'][_0x5e9f('0x2c')]);_0xdca7f1[_0x5e9f('0x22')](_0x4b6954);break;default:_0xdca7f1=_[_0x5e9f('0xe')](_0x548ea9['appdata'])?[]:_0x548ea9['appdata'][_0x5e9f('0x20')](',');}var _0x2553c5={'id':util[_0x5e9f('0xc')]('%s:%s:%s',_0x2f3872,_0x548ea9['id'],_0x548ea9['app']),'condition':require('./interval')['condition'](_0x2f3872,getIntervals(_0x149188[_0x5e9f('0x2d')],_0x548ea9),_0x149188),'consequence':require(_0x5e9f('0x2e')+_0x548ea9[_0x5e9f('0x1d')])['consequence'](_0x2f3872,_0xdca7f1,_0x149188,_0x39b8f1),'p':_0x548ea9['priority']||0x0};logger[_0x5e9f('0x2f')](_0x5e9f('0x30'),_0x2553c5['id'],_0x5e9f('0x31'),getIntervals(_0x149188[_0x5e9f('0x2d')],_0x548ea9)['join'](_0x5e9f('0x32')));_0xc4ceb8[_0x5e9f('0x22')](_0x2553c5);}else{logger[_0x5e9f('0x33')](_0x5e9f('0x34'),path['join'](__dirname,'applications',_0x548ea9['app']+_0x5e9f('0x35')));}}_0x149188[_0x5e9f('0x14')][_0x2f3872]=new RuleEngine(_0xc4ceb8);_0x149188[_0x5e9f('0x14')][_0x2f3872][_0x5e9f('0x36')](_0x39b8f1,function(_0x590045){logger[_0x5e9f('0x2f')](_0x5e9f('0x37'),JSON['stringify'](_0x590045['matchPath']));if(_0x149188[_0x5e9f('0x14')][_0x2f3872]){_0x149188[_0x5e9f('0x14')][_0x2f3872]['emit'](_0x5e9f('0x38'));}});return _0x3a8339({'code':0xc8,'message':_0x39b8f1});}else{if(_0x3566ae){logger[_0x5e9f('0x2f')](util['format'](_0x5e9f('0x39'),_0x2f3872));}else{logger['info'](_0x5e9f('0x3a'));}return _0x3a8339({'code':0xc8,'message':_0x39b8f1});}}catch(_0x377494){logger[_0x5e9f('0x33')](_0x377494[_0x5e9f('0x3b')]);return _0xf4f97e(_0x340042[_0x5e9f('0x33')](0x1f4,_0x377494));}}return _0xf4f97e('routing\x20is\x20empty');});},'AcceptMessage':function(_0x4fc663){var _0x33670d=this;return new Promise(function(_0x494daa,_0x8f725d){if(_0x4fc663[_0x5e9f('0x3c')]&&_0x4fc663[_0x5e9f('0x3c')]['id']){if(_0x149188[_0x5e9f('0x3d')][_0x4fc663[_0x5e9f('0x3c')]['id']]){_0x149188['agents'][_0x4fc663['agent']['id']][_0x5e9f('0x3e')]=![];_0x149188[_0x5e9f('0x3d')][_0x4fc663[_0x5e9f('0x3c')]['id']][_0x5e9f('0x3f')]=undefined;}}if(_0x4fc663[_0x5e9f('0x16')]&&_0x4fc663[_0x5e9f('0x16')]['id']){try{var _0x5d6fee=getId(_0x4fc663[_0x5e9f('0x15')],_0x4fc663[_0x5e9f('0x16')]?_0x4fc663[_0x5e9f('0x16')]['id']:0x0,_0x4fc663[_0x5e9f('0x17')]?_0x4fc663['interaction']['id']:0x0);if(_0x149188['rules'][_0x5d6fee]){_0x149188[_0x5e9f('0x14')][_0x5d6fee]['emit'](_0x5e9f('0x40'));if(rpc[_0x4fc663[_0x5e9f('0x15')]+'QueueReport']){rpc[_0x4fc663[_0x5e9f('0x15')]+'QueueReport']['update'](_0x5d6fee,{'UserId':_0x4fc663[_0x5e9f('0x16')][_0x5e9f('0x41')]})[_0x5e9f('0x42')](function(){logger['error']('error\x20update\x20queue\x20report');});}}return _0x494daa({'code':0xc8,'message':_0x4fc663});}catch(_0x8f86df){logger['error'](_0x8f86df[_0x5e9f('0x3b')]);return _0x8f725d(_0x33670d[_0x5e9f('0x33')](0x1f4,_0x8f86df));}}logger['error'](_0x5e9f('0x43'));return _0x8f725d(_0x33670d[_0x5e9f('0x33')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x2e8c79){var _0x3cdee9=this;return new Promise(function(_0x190ceb,_0x5e6ee7){if(_0x2e8c79[_0x5e9f('0x3c')]&&_0x2e8c79[_0x5e9f('0x3c')]['id']){try{if(_0x149188[_0x5e9f('0x3d')][_0x2e8c79[_0x5e9f('0x3c')]['id']]){_0x149188[_0x5e9f('0x3d')][_0x2e8c79[_0x5e9f('0x3c')]['id']]['busy']=![];_0x149188[_0x5e9f('0x3d')][_0x2e8c79[_0x5e9f('0x3c')]['id']][_0x5e9f('0x3f')]=undefined;}return _0x190ceb({'code':0xc8,'message':_0x2e8c79});}catch(_0x4b23f3){logger[_0x5e9f('0x33')](_0x4b23f3['stack']);return _0x5e6ee7(_0x3cdee9['error'](0x1f4,_0x4b23f3));}}logger['error'](_0x5e9f('0x43'));return _0x5e6ee7(_0x3cdee9[_0x5e9f('0x33')](0x1f4,_0x5e9f('0x43')));});},'AbandonInteraction':function(_0x575597){var _0x4ff42e=this;return new Promise(function(_0x40527a,_0x937d24){if(_0x575597['channel']&&_0x575597['interaction']&&_0x575597[_0x5e9f('0x17')]['id']){try{var _0x36e148=getId(_0x575597[_0x5e9f('0x15')],_0x575597['message']?_0x575597['message']['id']:0x0,_0x575597[_0x5e9f('0x17')]?_0x575597[_0x5e9f('0x17')]['id']:0x0);if(_0x149188['rules'][_0x36e148]){_0x149188[_0x5e9f('0x14')][_0x36e148][_0x5e9f('0x44')](_0x5e9f('0x40'));}return _0x40527a({'code':0xc8,'message':_0x575597});}catch(_0x4e8716){logger[_0x5e9f('0x33')](_0x4e8716[_0x5e9f('0x3b')]);return _0x937d24(_0x4ff42e[_0x5e9f('0x33')](0x1f4,_0x4e8716));}}logger[_0x5e9f('0x33')](_0x5e9f('0x43'));return _0x937d24(_0x4ff42e[_0x5e9f('0x33')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x7b0ed3){var _0x5595df=this;return new Promise(function(_0x4a2491,_0x27191c){if(_0x149188[_0x5e9f('0x3d')][_0x5e9f('0x45')](_0x7b0ed3['id'])){for(var _0x417e04 in _0x7b0ed3[_0x5e9f('0x46')]){if(_0x7b0ed3[_0x5e9f('0x46')][_0x5e9f('0x45')](_0x417e04)){if(_0x149188[_0x5e9f('0x3d')][_0x7b0ed3['id']][_0x5e9f('0x45')](_0x417e04+_0x5e9f('0x47'))){_0x149188[_0x5e9f('0x3d')][_0x7b0ed3['id']][_0x417e04+_0x5e9f('0x47')]=parseInt(_0x7b0ed3[_0x5e9f('0x46')][_0x417e04],0xa);}}}_0x149188[_0x5e9f('0x3d')][_0x7b0ed3['id']][_0x5e9f('0x48')]();return _0x4a2491({'code':0xc8,'message':_0x149188['agents'][_0x7b0ed3['id']]});}else{return _0x27191c(_0x5595df[_0x5e9f('0x33')](0x1f4,_0x5e9f('0x49')));}});},'Agents':function(_0x4a1ed7){return new Promise(function(_0x245859){var _0x2ce450=_[_0x5e9f('0x4a')](_0x149188['agents']);if(_0x4a1ed7&&_0x4a1ed7['id']){var _0x51618c=_['find'](_0x2ce450,function(_0x43bb4){return _0x43bb4['id']===_0x4a1ed7['id'];});_0x245859(_0x51618c);}else{_0x245859({'count':_0x2ce450[_0x5e9f('0x1b')],'rows':_0x2ce450});}});},'ChatQueues':function(){return new Promise(function(_0x36ca59){var _0x35ee57=[];for(var _0x1cc9ea in _0x149188[_0x5e9f('0x4b')]){if(_0x149188[_0x5e9f('0x4b')][_0x5e9f('0x45')](_0x1cc9ea)){var _0x2d28fe=_0x149188['chatQueues'][_0x1cc9ea];var _0x4c1e96={'id':_0x2d28fe['id'],'available':_0x2d28fe[_0x5e9f('0x4c')],'loggedIn':_0x2d28fe[_0x5e9f('0x4d')],'name':_0x2d28fe[_0x5e9f('0x4e')],'paused':_0x2d28fe[_0x5e9f('0x4f')],'waiting':_0x2d28fe[_0x5e9f('0x50')]};_0x35ee57['push'](_0x4c1e96);}}_0x36ca59({'count':_0x35ee57['length'],'rows':_0x35ee57});});},'MailQueues':function(){return new Promise(function(_0x47cb46){var _0x1dd607=[];for(var _0x2ef3d8 in _0x149188[_0x5e9f('0x51')]){if(_0x149188[_0x5e9f('0x51')][_0x5e9f('0x45')](_0x2ef3d8)){var _0x20b460=_0x149188['mailQueues'][_0x2ef3d8];var _0x3ce3be={'id':_0x20b460['id'],'available':_0x20b460[_0x5e9f('0x4c')],'loggedIn':_0x20b460[_0x5e9f('0x4d')],'name':_0x20b460[_0x5e9f('0x4e')],'paused':_0x20b460[_0x5e9f('0x4f')],'waiting':_0x20b460[_0x5e9f('0x50')]};_0x1dd607['push'](_0x3ce3be);}}_0x47cb46({'count':_0x1dd607[_0x5e9f('0x1b')],'rows':_0x1dd607});});},'OpenchannelQueues':function(){return new Promise(function(_0x1d55a7){var _0x14c394=[];for(var _0x100e90 in _0x149188[_0x5e9f('0x52')]){if(_0x149188[_0x5e9f('0x52')][_0x5e9f('0x45')](_0x100e90)){var _0xa02a69=_0x149188[_0x5e9f('0x52')][_0x100e90];var _0x462a33={'id':_0xa02a69['id'],'available':_0xa02a69['available'],'loggedIn':_0xa02a69['loggedIn'],'name':_0xa02a69[_0x5e9f('0x4e')],'paused':_0xa02a69['paused'],'waiting':_0xa02a69[_0x5e9f('0x50')]};_0x14c394['push'](_0x462a33);}}_0x1d55a7({'count':_0x14c394['length'],'rows':_0x14c394});});},'SmsQueues':function(){return new Promise(function(_0x3918bc){var _0x30834a=[];for(var _0x503f03 in _0x149188[_0x5e9f('0x53')]){if(_0x149188[_0x5e9f('0x53')]['hasOwnProperty'](_0x503f03)){var _0x2488a8=_0x149188[_0x5e9f('0x53')][_0x503f03];var _0x563d94={'id':_0x2488a8['id'],'available':_0x2488a8[_0x5e9f('0x4c')],'loggedIn':_0x2488a8[_0x5e9f('0x4d')],'name':_0x2488a8[_0x5e9f('0x4e')],'paused':_0x2488a8['paused'],'waiting':_0x2488a8['waiting']};_0x30834a[_0x5e9f('0x22')](_0x563d94);}}_0x3918bc({'count':_0x30834a[_0x5e9f('0x1b')],'rows':_0x30834a});});},'FaxQueues':function(){return new Promise(function(_0x51871f){var _0x44e515=[];for(var _0x2f6d24 in _0x149188[_0x5e9f('0x54')]){if(_0x149188[_0x5e9f('0x54')][_0x5e9f('0x45')](_0x2f6d24)){var _0xa55186=_0x149188[_0x5e9f('0x54')][_0x2f6d24];var _0x258463={'id':_0xa55186['id'],'available':_0xa55186[_0x5e9f('0x4c')],'loggedIn':_0xa55186[_0x5e9f('0x4d')],'name':_0xa55186[_0x5e9f('0x4e')],'paused':_0xa55186['paused'],'waiting':_0xa55186['waiting']};_0x44e515['push'](_0x258463);}}_0x51871f({'count':_0x44e515[_0x5e9f('0x1b')],'rows':_0x44e515});});},'WhatsappQueues':function(){return new Promise(function(_0x193713){var _0x230cda=[];for(var _0x544c27 in _0x149188['whatsappQueues']){if(_0x149188[_0x5e9f('0x55')]['hasOwnProperty'](_0x544c27)){var _0x4c164c=_0x149188[_0x5e9f('0x55')][_0x544c27];var _0x4c7520={'id':_0x4c164c['id'],'available':_0x4c164c[_0x5e9f('0x4c')],'loggedIn':_0x4c164c[_0x5e9f('0x4d')],'name':_0x4c164c[_0x5e9f('0x4e')],'paused':_0x4c164c[_0x5e9f('0x4f')],'waiting':_0x4c164c[_0x5e9f('0x50')]};_0x230cda[_0x5e9f('0x22')](_0x4c7520);}}_0x193713({'count':_0x230cda[_0x5e9f('0x1b')],'rows':_0x230cda});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0xfa4aaf){var _0x880743=_['values'](_0x149188[_0x5e9f('0x56')]);_0xfa4aaf({'count':_0x880743['length'],'rows':_0x880743});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x514e61){var _0x538e07=_[_0x5e9f('0x4a')](_0x149188[_0x5e9f('0x57')]);_0x514e61({'count':_0x538e07[_0x5e9f('0x1b')],'rows':_0x538e07});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x375ca6){var _0x545c3f=_[_0x5e9f('0x4a')](_0x149188['openchannelQueuesWaitingInteractions']);_0x375ca6({'count':_0x545c3f[_0x5e9f('0x1b')],'rows':_0x545c3f});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x3162f1){var _0x49aca9=_['values'](_0x149188[_0x5e9f('0x58')]);_0x3162f1({'count':_0x49aca9[_0x5e9f('0x1b')],'rows':_0x49aca9});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0xfe63a2){var _0x1f0499=_[_0x5e9f('0x4a')](_0x149188[_0x5e9f('0x59')]);_0xfe63a2({'count':_0x1f0499[_0x5e9f('0x1b')],'rows':_0x1f0499});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x13ddc1){var _0x4e3df8=_['values'](_0x149188[_0x5e9f('0x5a')]);_0x13ddc1({'count':_0x4e3df8['length'],'rows':_0x4e3df8});});}};var _0x1e6120=jayson[_0x5e9f('0x5b')](_0x4fe95a)[_0x5e9f('0x5c')]();_0x1e6120['on']('error',function(_0x5091de){logger[_0x5e9f('0x33')](JSON['stringify'](_0x5091de));return _0x36634f(_0x5091de);});_0x1e6120['listen'](0x232c,_0x5e9f('0x5d'),function(){console[_0x5e9f('0x5e')](_0x5e9f('0x5f'),0x232c);return _0x7dea41(_0x5e9f('0x60')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 3062768..eb78aa0 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 _0xceac=['rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','indexOf','true','[%s][INTERVAL]\x20%s','all','some','join','when','log','\x20|\x20','stack','util','jayson/promise','lodash','routing','client','http','request','then','error','message','result','catch','condition'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0xceac,0x1a5));var _0xccea=function(_0x477d8b,_0x156290){_0x477d8b=_0x477d8b-0x0;var _0x211e73=_0xceac[_0x477d8b];return _0x211e73;};'use strict';var util=require(_0xccea('0x0'));var BPromise=require('bluebird');var jayson=require(_0xccea('0x1'));var _=require(_0xccea('0x2'));var logger=require('../../../config/logger')(_0xccea('0x3'));var client=jayson[_0xccea('0x4')][_0xccea('0x5')]({'port':0x232a});function request(_0x4b9d8d,_0x310041){return new BPromise(function(_0x14ed74,_0x4cf47b){return client[_0xccea('0x6')](_0x4b9d8d,_0x310041)[_0xccea('0x7')](function(_0x1ee156){if(_0x1ee156[_0xccea('0x8')]){return _0x4cf47b(_0x1ee156['error'][_0xccea('0x9')]);}else{return _0x14ed74(_0x1ee156[_0xccea('0xa')]);}})[_0xccea('0xb')](function(_0x23236e){return _0x4cf47b(_0x23236e);});});}exports[_0xccea('0xc')]=function(_0x151abb,_0x12ea75,_0x1ab1b9){return function(_0x3bca61){if(_0x1ab1b9[_0xccea('0xd')]&&!_0x1ab1b9[_0xccea('0xd')][_0x151abb]){logger[_0xccea('0xe')](_0xccea('0xf'),_0x151abb);return _0x3bca61[_0xccea('0x10')]();}var _0x260c36=[];for(var _0x5898b0=0x0;_0x5898b0<_0x12ea75[_0xccea('0x11')];_0x5898b0+=0x1){_0x260c36[_0xccea('0x12')](request(_0xccea('0x13'),{'command':util[_0xccea('0x14')]('iftime\x20%s',_0x12ea75[_0x5898b0])})[_0xccea('0x7')](function(_0x16daae){return _0x16daae&&_0x16daae['message']&&_0x16daae[_0xccea('0x9')][_0xccea('0x15')](_0xccea('0x16'))>=0x0?!![]:![];})[_0xccea('0xb')](function(_0x21c082){logger[_0xccea('0x8')](_0xccea('0x17'),_0x151abb,_0x12ea75[_0x5898b0]);}));}BPromise[_0xccea('0x18')](_0x260c36)[_0xccea('0x7')](function(_0x500ba8){var _0xfdb15=_[_0xccea('0x19')](_0x500ba8);logger[_0xccea('0xe')]('[%s][INTERVAL]\x20%s\x20%s',_0x151abb,_0x12ea75[_0xccea('0x1a')]('\x20|\x20'),_0xfdb15);_0x3bca61[_0xccea('0x1b')](_0xfdb15);})[_0xccea('0xb')](function(_0x5aad34){console[_0xccea('0x1c')](_0x5aad34);logger[_0xccea('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x151abb,_0x12ea75[_0xccea('0x1a')](_0xccea('0x1d')),_0x5aad34[_0xccea('0x1e')]);_0x3bca61[_0xccea('0x10')]();});};}; \ No newline at end of file +var _0xb492=['[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','catch','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','bluebird','lodash','../../../config/logger','routing','request','then','error','message','result','rules','info'];(function(_0x4e697a,_0x56a14b){var _0x88850c=function(_0x4e368a){while(--_0x4e368a){_0x4e697a['push'](_0x4e697a['shift']());}};_0x88850c(++_0x56a14b);}(_0xb492,0x185));var _0x2b49=function(_0x51492a,_0x187318){_0x51492a=_0x51492a-0x0;var _0x32f391=_0xb492[_0x51492a];return _0x32f391;};'use strict';var util=require('util');var BPromise=require(_0x2b49('0x0'));var jayson=require('jayson/promise');var _=require(_0x2b49('0x1'));var logger=require(_0x2b49('0x2'))(_0x2b49('0x3'));var client=jayson['client']['http']({'port':0x232a});function request(_0x4f8774,_0x1d6c9f){return new BPromise(function(_0x4b367b,_0x43cb73){return client[_0x2b49('0x4')](_0x4f8774,_0x1d6c9f)[_0x2b49('0x5')](function(_0x2cd46b){if(_0x2cd46b[_0x2b49('0x6')]){return _0x43cb73(_0x2cd46b[_0x2b49('0x6')][_0x2b49('0x7')]);}else{return _0x4b367b(_0x2cd46b[_0x2b49('0x8')]);}})['catch'](function(_0x1a93e7){return _0x43cb73(_0x1a93e7);});});}exports['condition']=function(_0x50b985,_0x557e7d,_0x3aa61a){return function(_0x2b6abf){if(_0x3aa61a[_0x2b49('0x9')]&&!_0x3aa61a[_0x2b49('0x9')][_0x50b985]){logger[_0x2b49('0xa')](_0x2b49('0xb'),_0x50b985);return _0x2b6abf[_0x2b49('0xc')]();}var _0x3e837f=[];for(var _0x4ecf2a=0x0;_0x4ecf2a<_0x557e7d[_0x2b49('0xd')];_0x4ecf2a+=0x1){_0x3e837f['push'](request(_0x2b49('0xe'),{'command':util['format']('iftime\x20%s',_0x557e7d[_0x4ecf2a])})[_0x2b49('0x5')](function(_0x59bc5a){return _0x59bc5a&&_0x59bc5a[_0x2b49('0x7')]&&_0x59bc5a['message']['indexOf']('true')>=0x0?!![]:![];})[_0x2b49('0xf')](function(_0x92478){logger[_0x2b49('0x6')](_0x2b49('0x10'),_0x50b985,_0x557e7d[_0x4ecf2a]);}));}BPromise[_0x2b49('0x11')](_0x3e837f)[_0x2b49('0x5')](function(_0x4f7b37){var _0x1c0934=_[_0x2b49('0x12')](_0x4f7b37);logger[_0x2b49('0xa')](_0x2b49('0x13'),_0x50b985,_0x557e7d[_0x2b49('0x14')](_0x2b49('0x15')),_0x1c0934);_0x2b6abf[_0x2b49('0x16')](_0x1c0934);})['catch'](function(_0x4bf639){console[_0x2b49('0x17')](_0x4bf639);logger['error']('[%s][INTERVAL]\x20%s\x20%s',_0x50b985,_0x557e7d['join'](_0x2b49('0x15')),_0x4bf639[_0x2b49('0x18')]);_0x2b6abf['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 7b22218..c5e72c9 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 _0xa571=['calleridname','ATTENDED','secondtransfererexten','transfertargetuniqueid','clone','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','diffTime','agent','[%s][agents][hangup]','lodash','util','./utils','info','format','channel','membername','interface','calleridnum','connectedlinenum','lastevent','queue','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','debug','[%s][agents][agentcalled]','agentcalledAt','now','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','talktime','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','connect','answered_elsewhere','answeredelsewheremembername','[%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','transfertype','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfer','transferexten','transferuniqueid','transfereeuniqueid','agententerreason'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa571,0x107));var _0x1a57=function(_0x37062b,_0x1d9e05){_0x37062b=_0x37062b-0x0;var _0x3a9d05=_0xa571[_0x37062b];return _0x3a9d05;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var utils=require(_0x1a57('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1067d9,_0x48485e){utils[_0x1a57('0x3')](util[_0x1a57('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1067d9['uniqueid'],_0x1067d9[_0x1a57('0x5')],_0x1067d9['queue'],_0x1067d9[_0x1a57('0x6')],_0x1067d9[_0x1a57('0x7')],_0x1067d9[_0x1a57('0x8')],_0x1067d9[_0x1a57('0x9')],_0x1067d9[_0x1a57('0xa')]));if(_0x1067d9[_0x1a57('0xb')]){utils['getVoiceQueueByName'](_0x1067d9[_0x1a57('0xb')])[_0x1a57('0xc')](function(_0x3631d6){if(_0x3631d6){_0x1067d9['type']=_0x3631d6[_0x1a57('0xd')];_0x1067d9[_0x1a57('0xe')]=_0x1067d9[_0x1a57('0xf')]?_0x3631d6[_0x1a57('0x10')]:![];_0x1067d9[_0x1a57('0x11')]=_0x1067d9[_0x1a57('0xe')]?_0x3631d6[_0x1a57('0x12')]:0x0;}utils[_0x1a57('0x13')]('CreateVoiceAgentReport',_0x1067d9);});}else{utils['request'](_0x1a57('0x14'),_0x1067d9);}if(_0x48485e){delete transfers[_0x1067d9[_0x1a57('0x15')]];}else{delete agents[_0x1067d9[_0x1a57('0x16')]];}}exports['agentcalled']=function(_0x3de36a){try{utils[_0x1a57('0x17')](util['format'](_0x1a57('0x18'),_0x3de36a['uniqueid']),_0x3de36a);agents[_0x3de36a[_0x1a57('0x16')]]=_0x3de36a;agents[_0x3de36a[_0x1a57('0x16')]][_0x1a57('0x19')]=utils[_0x1a57('0x1a')]();agents[_0x3de36a['destuniqueid']][_0x1a57('0xa')]='called';agents[_0x3de36a['destuniqueid']][_0x1a57('0x9')]=null;agents[_0x3de36a[_0x1a57('0x16')]][_0x1a57('0x1b')]=null;utils['info'](util[_0x1a57('0x4')](_0x1a57('0x1c'),_0x3de36a[_0x1a57('0x15')],agents[_0x3de36a['destuniqueid']][_0x1a57('0x6')],_0x3de36a[_0x1a57('0x16')]));}catch(_0x451b34){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')]('[%s][agents][agentcalled]',_0x3de36a['uniqueid']),_0x451b34);}};exports[_0x1a57('0x1e')]=function(_0x21e811){try{if(!_[_0x1a57('0x1f')](agents[_0x21e811['destuniqueid']])){utils['debug'](util['format'](_0x1a57('0x20'),_0x21e811[_0x1a57('0x15')]),_0x21e811);utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x21'),_0x21e811[_0x1a57('0x15')],agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x6')],_0x21e811[_0x1a57('0x16')]));agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x1e')]=!![];agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x22')]=utils[_0x1a57('0x1a')]();agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0xa')]=_0x1a57('0x23');agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x24')]=_0x1a57('0x23');agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x25')]=_0x21e811['ringtime']?parseInt(_0x21e811['ringtime'])/0x3e8:0x0;agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x26')]=0x0;unanswered['push'](_0x21e811[_0x1a57('0x16')]);}}catch(_0x54f6a5){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')]('[%s][agents][agentringnoanswer]',_0x21e811[_0x1a57('0x15')]),_0x54f6a5);}};exports[_0x1a57('0x27')]=function(_0x30527c){try{_[_0x1a57('0x28')](agents,function(_0x492b90,_0x366d5f){if(_0x492b90[_0x1a57('0x15')]==_0x30527c[_0x1a57('0x15')]&&!_[_0x1a57('0x29')](unanswered,_0x492b90['destuniqueid'])){utils[_0x1a57('0x17')](util[_0x1a57('0x4')](_0x1a57('0x2a'),_0x30527c[_0x1a57('0x15')]),_0x30527c);utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x2b'),_0x30527c[_0x1a57('0x15')],_0x492b90[_0x1a57('0x6')],_0x492b90['destuniqueid']));_0x492b90[_0x1a57('0x1e')]=!![];_0x492b90[_0x1a57('0x22')]=utils['now']();_0x492b90['lastevent']=_0x1a57('0x2c');_0x492b90[_0x1a57('0x24')]=_0x1a57('0x2c');_0x492b90[_0x1a57('0x25')]=_0x30527c[_0x1a57('0x25')];_0x492b90[_0x1a57('0x26')]=0x0;writeDB(_0x492b90);}});}catch(_0xe80d94){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')](_0x1a57('0x2a'),_0x30527c[_0x1a57('0x15')]),_0xe80d94);}};exports[_0x1a57('0x2d')]=function(_0x12f3a7){try{if(agents[_0x12f3a7[_0x1a57('0x16')]]){utils[_0x1a57('0x17')](util[_0x1a57('0x4')](_0x1a57('0x2e'),_0x12f3a7[_0x1a57('0x15')]),_0x12f3a7);utils['info'](util[_0x1a57('0x4')](_0x1a57('0x2f'),_0x12f3a7[_0x1a57('0x15')],agents[_0x12f3a7[_0x1a57('0x16')]][_0x1a57('0x6')],_0x12f3a7[_0x1a57('0x16')]));agents[_0x12f3a7[_0x1a57('0x16')]][_0x1a57('0x30')]=utils[_0x1a57('0x1a')]();agents[_0x12f3a7['destuniqueid']]['connectedlinenum']=_0x12f3a7['connectedlinenum'];agents[_0x12f3a7['destuniqueid']][_0x1a57('0x1b')]=_0x12f3a7[_0x1a57('0x1b')];agents[_0x12f3a7[_0x1a57('0x16')]]['holdtime']=_0x12f3a7[_0x1a57('0x31')];agents[_0x12f3a7[_0x1a57('0x16')]][_0x1a57('0xa')]=_0x1a57('0x32');_['forIn'](agents,function(_0x1be254,_0x5e79f0){if(_0x1be254[_0x1a57('0x16')]!=_0x12f3a7[_0x1a57('0x16')]&&_0x1be254[_0x1a57('0x15')]==_0x12f3a7['uniqueid']){_0x1be254[_0x1a57('0x26')]=0x0;_0x1be254[_0x1a57('0x25')]=_0x12f3a7[_0x1a57('0x31')];_0x1be254[_0x1a57('0x1e')]=!![];_0x1be254[_0x1a57('0x22')]=utils['now']();_0x1be254[_0x1a57('0xa')]='answered_elsewhere';_0x1be254['reason']=_0x1a57('0x33');_0x1be254['answeredelsewheredestinationuniqueid']=_0x12f3a7[_0x1a57('0x16')];_0x1be254[_0x1a57('0x34')]=_0x12f3a7[_0x1a57('0x6')];writeDB(_0x1be254);}});}}catch(_0x59abb1){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')](_0x1a57('0x2e'),_0x12f3a7[_0x1a57('0x15')]),_0x59abb1);}};exports['agentcomplete']=function(_0xc7bab4){try{if(!_[_0x1a57('0x1f')](agents[_0xc7bab4['destuniqueid']])){utils[_0x1a57('0x17')](util['format']('[%s][agents][agentcomplete]',_0xc7bab4[_0x1a57('0x15')]),_0xc7bab4);utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x35'),_0xc7bab4['uniqueid'],agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0x6')],_0xc7bab4[_0x1a57('0x16')]));agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0xf')]=!![];agents[_0xc7bab4['destuniqueid']][_0x1a57('0x36')]=utils[_0x1a57('0x1a')]();agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0x26')]=utils['diffTime'](agents[_0xc7bab4[_0x1a57('0x16')]]['agentcompleteAt'],agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0x30')]);agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0x24')]=_0xc7bab4[_0x1a57('0x24')];agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0xa')]=_0x1a57('0x37');writeDB(agents[_0xc7bab4[_0x1a57('0x16')]]);}}catch(_0x424065){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')](_0x1a57('0x38'),_0xc7bab4['uniqueid']),_0x424065);}};exports[_0x1a57('0x39')]=function(_0x480aff){try{if(!_[_0x1a57('0x1f')](agents[_0x480aff[_0x1a57('0x3a')]])){utils[_0x1a57('0x17')](util[_0x1a57('0x4')](_0x1a57('0x3b'),_0x480aff[_0x1a57('0x15')]),_0x480aff);utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x3c'),_0x480aff['uniqueid'],agents[_0x480aff[_0x1a57('0x3a')]][_0x1a57('0x6')],agents[_0x480aff['transfereruniqueid']][_0x1a57('0x15')]));agents[_0x480aff[_0x1a57('0x3a')]]['transfer']=!![];agents[_0x480aff[_0x1a57('0x3a')]][_0x1a57('0x3d')]='blind';agents[_0x480aff['transfereruniqueid']]['transferexten']=_0x480aff[_0x1a57('0x3e')];agents[_0x480aff[_0x1a57('0x3a')]]['transferuniqueid']=agents[_0x480aff[_0x1a57('0x3a')]][_0x1a57('0x15')];}}catch(_0x572202){utils['error'](util['format'](_0x1a57('0x3b'),_0x480aff[_0x1a57('0x15')]),_0x572202);}};exports[_0x1a57('0x3f')]=function(_0x31be00){try{utils[_0x1a57('0x17')](util[_0x1a57('0x4')](_0x1a57('0x40'),_0x31be00[_0x1a57('0x41')]),_0x31be00);if(_0x31be00['origtransfereruniqueid']==_0x31be00['origtransfererlinkedid']){if(!_['isNil'](agents[_0x31be00['secondtransfereruniqueid']])){utils['info'](util[_0x1a57('0x4')](_0x1a57('0x42'),_0x31be00[_0x1a57('0x41')],agents[_0x31be00[_0x1a57('0x43')]][_0x1a57('0x6')]));agents[_0x31be00[_0x1a57('0x43')]][_0x1a57('0x44')]=!![];agents[_0x31be00[_0x1a57('0x43')]]['transfertype']='ATTENDED';agents[_0x31be00['secondtransfereruniqueid']][_0x1a57('0x45')]=_0x31be00['origtransfererexten'];agents[_0x31be00[_0x1a57('0x43')]][_0x1a57('0x46')]=_0x31be00[_0x1a57('0x41')];}if(_0x31be00[_0x1a57('0x47')]&&agents[_0x31be00[_0x1a57('0x47')]]){agents[_0x31be00[_0x1a57('0x47')]][_0x1a57('0x48')]=0x1;transfers[_0x31be00['transfereeuniqueid']]=_['clone'](agents[_0x31be00['transfereeuniqueid']]);transfers[_0x31be00[_0x1a57('0x47')]][_0x1a57('0x8')]=agents[_0x31be00[_0x1a57('0x43')]][_0x1a57('0x8')];transfers[_0x31be00[_0x1a57('0x47')]][_0x1a57('0x49')]=agents[_0x31be00[_0x1a57('0x43')]]['calleridname'];transfers[_0x31be00['transfereeuniqueid']][_0x1a57('0x19')]=utils[_0x1a57('0x1a')]();transfers[_0x31be00[_0x1a57('0x47')]][_0x1a57('0x30')]=utils[_0x1a57('0x1a')]();transfers[_0x31be00[_0x1a57('0x47')]]['holdtime']=0x0;transfers[_0x31be00['transfereeuniqueid']][_0x1a57('0x48')]=0x2;}}else if(_0x31be00[_0x1a57('0x43')]==_0x31be00['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x31be00[_0x1a57('0x41')]])){utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x42'),_0x31be00[_0x1a57('0x41')],agents[_0x31be00[_0x1a57('0x41')]][_0x1a57('0x6')]));agents[_0x31be00['origtransfereruniqueid']]['transfer']=!![];agents[_0x31be00[_0x1a57('0x41')]][_0x1a57('0x3d')]=_0x1a57('0x4a');agents[_0x31be00[_0x1a57('0x41')]]['transferexten']=_0x31be00[_0x1a57('0x4b')];agents[_0x31be00[_0x1a57('0x41')]][_0x1a57('0x46')]=_0x31be00[_0x1a57('0x43')];}if(_0x31be00[_0x1a57('0x4c')]&&agents[_0x31be00['transfertargetuniqueid']]){agents[_0x31be00['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x31be00[_0x1a57('0x4c')]]=_[_0x1a57('0x4d')](agents[_0x31be00[_0x1a57('0x4c')]]);transfers[_0x31be00[_0x1a57('0x4c')]][_0x1a57('0x8')]=agents[_0x31be00[_0x1a57('0x41')]][_0x1a57('0x8')];transfers[_0x31be00[_0x1a57('0x4c')]]['calleridname']=agents[_0x31be00[_0x1a57('0x41')]][_0x1a57('0x49')];transfers[_0x31be00['transfertargetuniqueid']]['agentcalledAt']=utils[_0x1a57('0x1a')]();transfers[_0x31be00['transfertargetuniqueid']][_0x1a57('0x30')]=utils[_0x1a57('0x1a')]();transfers[_0x31be00[_0x1a57('0x4c')]][_0x1a57('0x25')]=0x0;transfers[_0x31be00[_0x1a57('0x4c')]][_0x1a57('0x48')]=0x2;}}}catch(_0x213576){utils[_0x1a57('0x1d')](util['format'](_0x1a57('0x40'),_0x31be00[_0x1a57('0x41')]),_0x213576);}};exports['hangup']=function(_0x24b56c){try{utils[_0x1a57('0x17')](util[_0x1a57('0x4')]('[%s][agents][hangup]',_0x24b56c['uniqueid']),_0x24b56c);if(agents[_0x24b56c[_0x1a57('0x15')]]&&agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x24')]===_0x1a57('0x23')){if(_0x24b56c['cause']==='21'){agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x24')]=_0x1a57('0x4e');agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0xa')]='rejected';}utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x4f'),_0x24b56c[_0x1a57('0x15')],agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x6')],agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x24')],agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0xa')]));writeDB(agents[_0x24b56c[_0x1a57('0x15')]]);var _0x48a10e=unanswered[_0x1a57('0x50')](_0x24b56c[_0x1a57('0x15')]);if(_0x48a10e>-0x1){unanswered['splice'](_0x48a10e,0x1);}}if(transfers[_0x24b56c[_0x1a57('0x15')]]){transfers[_0x24b56c[_0x1a57('0x15')]]['agentcomplete']=!![];transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x36')]=utils[_0x1a57('0x1a')]();transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x26')]=utils[_0x1a57('0x51')](transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x36')],transfers[_0x24b56c['uniqueid']][_0x1a57('0x30')]);transfers[_0x24b56c[_0x1a57('0x15')]]['reason']=_0x1a57('0x52');transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0xa')]=_0x1a57('0x37');utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x4f'),_0x24b56c[_0x1a57('0x15')],transfers[_0x24b56c[_0x1a57('0x15')]]['membername'],transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x24')],transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0xa')]));writeDB(transfers[_0x24b56c[_0x1a57('0x15')]],!![]);}if(agents[_0x24b56c['uniqueid']]&&agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x30')]){agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0xf')]=!![];agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x36')]=utils[_0x1a57('0x1a')]();agents[_0x24b56c[_0x1a57('0x15')]]['talktime']=utils[_0x1a57('0x51')](agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x36')],agents[_0x24b56c[_0x1a57('0x15')]]['agentconnectAt']);agents[_0x24b56c['uniqueid']]['reason']=agents[_0x24b56c['uniqueid']]['transfer']?_0x1a57('0x44'):_0x1a57('0x52');agents[_0x24b56c['uniqueid']][_0x1a57('0xa')]=_0x1a57('0x37');utils['info'](util[_0x1a57('0x4')](_0x1a57('0x4f'),_0x24b56c[_0x1a57('0x15')],agents[_0x24b56c[_0x1a57('0x15')]]['membername'],agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x24')],agents[_0x24b56c['uniqueid']][_0x1a57('0xa')]));writeDB(agents[_0x24b56c[_0x1a57('0x15')]]);}}catch(_0x42d41e){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')](_0x1a57('0x53'),_0x24b56c[_0x1a57('0x15')]),_0x42d41e);}}; \ No newline at end of file +var _0x97c1=['connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','now','reason','holdtime','ringtime','talktime','push','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','agentconnectAt','connect','forIn','agentringnoanswerAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','agentcompleteAt','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','agentcalledAt','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','[%s][agents][hangup]','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','lodash','util','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','calleridnum','connectedlinenum','lastevent','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','called'];(function(_0x54082e,_0x3aeae2){var _0x3aa409=function(_0x20ed70){while(--_0x20ed70){_0x54082e['push'](_0x54082e['shift']());}};_0x3aa409(++_0x3aeae2);}(_0x97c1,0xdf));var _0x197c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x97c1[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x5e2e81,_0x498f9c){utils['info'](util[_0x197c('0x2')](_0x197c('0x3'),_0x5e2e81[_0x197c('0x4')],_0x5e2e81[_0x197c('0x5')],_0x5e2e81[_0x197c('0x6')],_0x5e2e81['membername'],_0x5e2e81['interface'],_0x5e2e81[_0x197c('0x7')],_0x5e2e81[_0x197c('0x8')],_0x5e2e81[_0x197c('0x9')]));if(_0x5e2e81[_0x197c('0x6')]){utils['getVoiceQueueByName'](_0x5e2e81['queue'])[_0x197c('0xa')](function(_0x5cffb8){if(_0x5cffb8){_0x5e2e81[_0x197c('0xb')]=_0x5cffb8[_0x197c('0xb')];_0x5e2e81[_0x197c('0xc')]=_0x5e2e81[_0x197c('0xd')]?_0x5cffb8['acw']:![];_0x5e2e81[_0x197c('0xe')]=_0x5e2e81[_0x197c('0xc')]?_0x5cffb8[_0x197c('0xf')]:0x0;}utils[_0x197c('0x10')](_0x197c('0x11'),_0x5e2e81);});}else{utils['request'](_0x197c('0x11'),_0x5e2e81);}if(_0x498f9c){delete transfers[_0x5e2e81[_0x197c('0x4')]];}else{delete agents[_0x5e2e81[_0x197c('0x12')]];}}exports[_0x197c('0x13')]=function(_0x567658){try{utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x15'),_0x567658[_0x197c('0x4')]),_0x567658);agents[_0x567658[_0x197c('0x12')]]=_0x567658;agents[_0x567658[_0x197c('0x12')]]['agentcalledAt']=utils['now']();agents[_0x567658[_0x197c('0x12')]][_0x197c('0x9')]=_0x197c('0x16');agents[_0x567658[_0x197c('0x12')]][_0x197c('0x8')]=null;agents[_0x567658[_0x197c('0x12')]][_0x197c('0x17')]=null;utils[_0x197c('0x18')](util['format'](_0x197c('0x19'),_0x567658['uniqueid'],agents[_0x567658['destuniqueid']][_0x197c('0x1a')],_0x567658[_0x197c('0x12')]));}catch(_0x2eca5e){utils[_0x197c('0x1b')](util['format'](_0x197c('0x15'),_0x567658[_0x197c('0x4')]),_0x2eca5e);}};exports[_0x197c('0x1c')]=function(_0x5c278a){try{if(!_[_0x197c('0x1d')](agents[_0x5c278a[_0x197c('0x12')]])){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x1e'),_0x5c278a[_0x197c('0x4')]),_0x5c278a);utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x1f'),_0x5c278a[_0x197c('0x4')],agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x1a')],_0x5c278a[_0x197c('0x12')]));agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x1c')]=!![];agents[_0x5c278a[_0x197c('0x12')]]['agentringnoanswerAt']=utils[_0x197c('0x20')]();agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x9')]='timeout';agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x21')]='timeout';agents[_0x5c278a['destuniqueid']][_0x197c('0x22')]=_0x5c278a['ringtime']?parseInt(_0x5c278a[_0x197c('0x23')])/0x3e8:0x0;agents[_0x5c278a[_0x197c('0x12')]][_0x197c('0x24')]=0x0;unanswered[_0x197c('0x25')](_0x5c278a[_0x197c('0x12')]);}}catch(_0x3cdcd8){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x1e'),_0x5c278a['uniqueid']),_0x3cdcd8);}};exports['queuecallerabandon']=function(_0x574274){try{_['forIn'](agents,function(_0x5f7425,_0x4c9256){if(_0x5f7425[_0x197c('0x4')]==_0x574274[_0x197c('0x4')]&&!_['includes'](unanswered,_0x5f7425[_0x197c('0x12')])){utils['debug'](util[_0x197c('0x2')](_0x197c('0x26'),_0x574274[_0x197c('0x4')]),_0x574274);utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x27'),_0x574274[_0x197c('0x4')],_0x5f7425[_0x197c('0x1a')],_0x5f7425[_0x197c('0x12')]));_0x5f7425['agentringnoanswer']=!![];_0x5f7425['agentringnoanswerAt']=utils[_0x197c('0x20')]();_0x5f7425[_0x197c('0x9')]=_0x197c('0x28');_0x5f7425[_0x197c('0x21')]=_0x197c('0x28');_0x5f7425[_0x197c('0x22')]=_0x574274[_0x197c('0x22')];_0x5f7425['talktime']=0x0;writeDB(_0x5f7425);}});}catch(_0x54e6be){utils[_0x197c('0x1b')](util[_0x197c('0x2')]('[%s][agents][queuecallerabandon]',_0x574274['uniqueid']),_0x54e6be);}};exports[_0x197c('0x29')]=function(_0x2a884b){try{if(agents[_0x2a884b[_0x197c('0x12')]]){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x2a'),_0x2a884b[_0x197c('0x4')]),_0x2a884b);utils[_0x197c('0x18')](util[_0x197c('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x2a884b[_0x197c('0x4')],agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x1a')],_0x2a884b[_0x197c('0x12')]));agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x2b')]=utils['now']();agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x8')]=_0x2a884b[_0x197c('0x8')];agents[_0x2a884b['destuniqueid']][_0x197c('0x17')]=_0x2a884b[_0x197c('0x17')];agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x22')]=_0x2a884b[_0x197c('0x23')];agents[_0x2a884b[_0x197c('0x12')]][_0x197c('0x9')]=_0x197c('0x2c');_[_0x197c('0x2d')](agents,function(_0x1dc01b,_0x4a12fc){if(_0x1dc01b[_0x197c('0x12')]!=_0x2a884b[_0x197c('0x12')]&&_0x1dc01b['uniqueid']==_0x2a884b['uniqueid']){_0x1dc01b[_0x197c('0x24')]=0x0;_0x1dc01b[_0x197c('0x22')]=_0x2a884b[_0x197c('0x23')];_0x1dc01b[_0x197c('0x1c')]=!![];_0x1dc01b[_0x197c('0x2e')]=utils['now']();_0x1dc01b[_0x197c('0x9')]=_0x197c('0x2f');_0x1dc01b[_0x197c('0x21')]=_0x197c('0x2f');_0x1dc01b[_0x197c('0x30')]=_0x2a884b['destuniqueid'];_0x1dc01b[_0x197c('0x31')]=_0x2a884b[_0x197c('0x1a')];writeDB(_0x1dc01b);}});}}catch(_0x6d7bda){utils[_0x197c('0x1b')](util[_0x197c('0x2')]('[%s][agents][agentconnect]',_0x2a884b[_0x197c('0x4')]),_0x6d7bda);}};exports[_0x197c('0xd')]=function(_0x3b7fc1){try{if(!_[_0x197c('0x1d')](agents[_0x3b7fc1[_0x197c('0x12')]])){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x32'),_0x3b7fc1[_0x197c('0x4')]),_0x3b7fc1);utils[_0x197c('0x18')](util[_0x197c('0x2')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3b7fc1['uniqueid'],agents[_0x3b7fc1['destuniqueid']]['membername'],_0x3b7fc1[_0x197c('0x12')]));agents[_0x3b7fc1[_0x197c('0x12')]]['agentcomplete']=!![];agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x33')]=utils['now']();agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x24')]=utils['diffTime'](agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x33')],agents[_0x3b7fc1['destuniqueid']][_0x197c('0x2b')]);agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x21')]=_0x3b7fc1['reason'];agents[_0x3b7fc1[_0x197c('0x12')]][_0x197c('0x9')]=_0x197c('0x34');writeDB(agents[_0x3b7fc1[_0x197c('0x12')]]);}}catch(_0x53295b){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x32'),_0x3b7fc1['uniqueid']),_0x53295b);}};exports['blindtransfer']=function(_0x3a5089){try{if(!_[_0x197c('0x1d')](agents[_0x3a5089[_0x197c('0x35')]])){utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x36'),_0x3a5089['uniqueid']),_0x3a5089);utils[_0x197c('0x18')](util['format'](_0x197c('0x37'),_0x3a5089[_0x197c('0x4')],agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x1a')],agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x4')]));agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x38')]=!![];agents[_0x3a5089['transfereruniqueid']][_0x197c('0x39')]=_0x197c('0x3a');agents[_0x3a5089[_0x197c('0x35')]]['transferexten']=_0x3a5089[_0x197c('0x3b')];agents[_0x3a5089['transfereruniqueid']][_0x197c('0x3c')]=agents[_0x3a5089[_0x197c('0x35')]][_0x197c('0x4')];}}catch(_0x22a106){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x36'),_0x3a5089[_0x197c('0x4')]),_0x22a106);}};exports['attendedtransfer']=function(_0x3e3176){try{utils[_0x197c('0x14')](util[_0x197c('0x2')]('[%s][agents][attendedtransfer]',_0x3e3176[_0x197c('0x3d')]),_0x3e3176);if(_0x3e3176[_0x197c('0x3d')]==_0x3e3176[_0x197c('0x3e')]){if(!_[_0x197c('0x1d')](agents[_0x3e3176[_0x197c('0x3f')]])){utils['info'](util['format'](_0x197c('0x40'),_0x3e3176[_0x197c('0x3d')],agents[_0x3e3176[_0x197c('0x3f')]][_0x197c('0x1a')]));agents[_0x3e3176[_0x197c('0x3f')]]['transfer']=!![];agents[_0x3e3176['secondtransfereruniqueid']][_0x197c('0x39')]=_0x197c('0x41');agents[_0x3e3176['secondtransfereruniqueid']][_0x197c('0x42')]=_0x3e3176[_0x197c('0x43')];agents[_0x3e3176[_0x197c('0x3f')]][_0x197c('0x3c')]=_0x3e3176[_0x197c('0x3d')];}if(_0x3e3176[_0x197c('0x44')]&&agents[_0x3e3176['transfereeuniqueid']]){agents[_0x3e3176[_0x197c('0x44')]][_0x197c('0x45')]=0x1;transfers[_0x3e3176['transfereeuniqueid']]=_['clone'](agents[_0x3e3176[_0x197c('0x44')]]);transfers[_0x3e3176['transfereeuniqueid']][_0x197c('0x7')]=agents[_0x3e3176[_0x197c('0x3f')]][_0x197c('0x7')];transfers[_0x3e3176['transfereeuniqueid']][_0x197c('0x46')]=agents[_0x3e3176[_0x197c('0x3f')]]['calleridname'];transfers[_0x3e3176[_0x197c('0x44')]][_0x197c('0x47')]=utils[_0x197c('0x20')]();transfers[_0x3e3176['transfereeuniqueid']][_0x197c('0x2b')]=utils[_0x197c('0x20')]();transfers[_0x3e3176['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x3e3176[_0x197c('0x44')]][_0x197c('0x45')]=0x2;}}else if(_0x3e3176[_0x197c('0x3f')]==_0x3e3176['secondtransfererlinkedid']){if(!_[_0x197c('0x1d')](agents[_0x3e3176[_0x197c('0x3d')]])){utils[_0x197c('0x18')](util['format'](_0x197c('0x40'),_0x3e3176[_0x197c('0x3d')],agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x1a')]));agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x38')]=!![];agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x39')]=_0x197c('0x41');agents[_0x3e3176[_0x197c('0x3d')]]['transferexten']=_0x3e3176[_0x197c('0x48')];agents[_0x3e3176['origtransfereruniqueid']]['transferuniqueid']=_0x3e3176['secondtransfereruniqueid'];}if(_0x3e3176['transfertargetuniqueid']&&agents[_0x3e3176[_0x197c('0x49')]]){agents[_0x3e3176[_0x197c('0x49')]][_0x197c('0x45')]=0x1;transfers[_0x3e3176[_0x197c('0x49')]]=_['clone'](agents[_0x3e3176[_0x197c('0x49')]]);transfers[_0x3e3176['transfertargetuniqueid']][_0x197c('0x7')]=agents[_0x3e3176['origtransfereruniqueid']][_0x197c('0x7')];transfers[_0x3e3176['transfertargetuniqueid']][_0x197c('0x46')]=agents[_0x3e3176[_0x197c('0x3d')]][_0x197c('0x46')];transfers[_0x3e3176[_0x197c('0x49')]]['agentcalledAt']=utils[_0x197c('0x20')]();transfers[_0x3e3176[_0x197c('0x49')]][_0x197c('0x2b')]=utils['now']();transfers[_0x3e3176[_0x197c('0x49')]][_0x197c('0x22')]=0x0;transfers[_0x3e3176[_0x197c('0x49')]][_0x197c('0x45')]=0x2;}}}catch(_0x5596f3){utils[_0x197c('0x1b')](util[_0x197c('0x2')](_0x197c('0x4a'),_0x3e3176[_0x197c('0x3d')]),_0x5596f3);}};exports[_0x197c('0x4b')]=function(_0x342efa){try{utils[_0x197c('0x14')](util[_0x197c('0x2')](_0x197c('0x4c'),_0x342efa[_0x197c('0x4')]),_0x342efa);if(agents[_0x342efa[_0x197c('0x4')]]&&agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')]==='timeout'){if(_0x342efa['cause']==='21'){agents[_0x342efa['uniqueid']][_0x197c('0x21')]='rejected';agents[_0x342efa[_0x197c('0x4')]]['lastevent']='rejected';}utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x4d'),_0x342efa['uniqueid'],agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x1a')],agents[_0x342efa['uniqueid']][_0x197c('0x21')],agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x9')]));writeDB(agents[_0x342efa[_0x197c('0x4')]]);var _0x54206a=unanswered[_0x197c('0x4e')](_0x342efa['uniqueid']);if(_0x54206a>-0x1){unanswered[_0x197c('0x4f')](_0x54206a,0x1);}}if(transfers[_0x342efa['uniqueid']]){transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0xd')]=!![];transfers[_0x342efa[_0x197c('0x4')]]['agentcompleteAt']=utils[_0x197c('0x20')]();transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x24')]=utils['diffTime'](transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x33')],transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x2b')]);transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')]='agent';transfers[_0x342efa[_0x197c('0x4')]]['lastevent']='complete';utils[_0x197c('0x18')](util[_0x197c('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x342efa[_0x197c('0x4')],transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x1a')],transfers[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')],transfers[_0x342efa['uniqueid']]['lastevent']));writeDB(transfers[_0x342efa['uniqueid']],!![]);}if(agents[_0x342efa['uniqueid']]&&agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x2b')]){agents[_0x342efa['uniqueid']]['agentcomplete']=!![];agents[_0x342efa[_0x197c('0x4')]]['agentcompleteAt']=utils['now']();agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x24')]=utils[_0x197c('0x50')](agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x33')],agents[_0x342efa[_0x197c('0x4')]]['agentconnectAt']);agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')]=agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x38')]?_0x197c('0x38'):_0x197c('0x51');agents[_0x342efa[_0x197c('0x4')]]['lastevent']=_0x197c('0x34');utils[_0x197c('0x18')](util[_0x197c('0x2')](_0x197c('0x4d'),_0x342efa[_0x197c('0x4')],agents[_0x342efa[_0x197c('0x4')]]['membername'],agents[_0x342efa[_0x197c('0x4')]][_0x197c('0x21')],agents[_0x342efa['uniqueid']][_0x197c('0x9')]));writeDB(agents[_0x342efa[_0x197c('0x4')]]);}}catch(_0x173303){utils[_0x197c('0x1b')](util[_0x197c('0x2')]('[%s][agents][hangup]',_0x342efa['uniqueid']),_0x173303);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index b5e5605..1941933 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 _0xeaab=['lastIndexOf','noop','gotoif','lastapplication','[%s][calls][newexten]','lodash','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','interface','calleridnum','lastevent','getUserByInternal','accountcode','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','error','hangup','callerid','calleridname','cause-txt','diffTime','endtime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','xmd-originatecalleridnum','value','source','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','Queue','lastdata','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][varset]\x20variable:sipcallid\x20value:%s','application','appdata','toLowerCase','set','startsWith','split','substring'];(function(_0x13c491,_0x2909a9){var _0x24bf67=function(_0x3514cf){while(--_0x3514cf){_0x13c491['push'](_0x13c491['shift']());}};_0x24bf67(++_0x2909a9);}(_0xeaab,0xd9));var _0xbeaa=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xeaab[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xbeaa('0x0'));var util=require('util');var utils=require(_0xbeaa('0x1'));var transfers=require(_0xbeaa('0x2'));var dispositions=['NO\x20ANSWER','FAILED',_0xbeaa('0x3'),_0xbeaa('0x4'),_0xbeaa('0x4'),_0xbeaa('0x4'),_0xbeaa('0x5'),_0xbeaa('0x6'),_0xbeaa('0x3'),_0xbeaa('0x3'),_0xbeaa('0x3')];var channels={};function writeDB(_0x42a779){var _0x346043;if(transfers[_0xbeaa('0x7')][_0x42a779[_0xbeaa('0x8')]]){_0x346043=_0x42a779[_0xbeaa('0x8')];_0x42a779['uniqueid']=transfers[_0xbeaa('0x7')][_0x42a779[_0xbeaa('0x8')]][_0xbeaa('0x9')];}utils[_0xbeaa('0xa')](util[_0xbeaa('0xb')](_0xbeaa('0xc'),_0x42a779[_0xbeaa('0x8')],_0x42a779['channel'],_0x42a779[_0xbeaa('0xd')],_0x42a779['membername'],_0x42a779[_0xbeaa('0xe')],_0x42a779[_0xbeaa('0xf')],_0x42a779['connectedlinenum'],_0x42a779[_0xbeaa('0x10')]));if(_0x42a779['accountcode']){utils[_0xbeaa('0x11')](_0x42a779[_0xbeaa('0x12')])['then'](function(_0x3f2f3d){if(_0x3f2f3d){_0x42a779[_0xbeaa('0x13')]=_0x3f2f3d['id'];}utils[_0xbeaa('0x14')](_0xbeaa('0x15'),_0x42a779);});}else{utils[_0xbeaa('0x14')](_0xbeaa('0x15'),_0x42a779);}if(channels[_0x42a779[_0xbeaa('0x8')]]){delete channels[_0x42a779[_0xbeaa('0x8')]];}else if(_0x346043&&channels[_0x346043]){if(!transfers[_0xbeaa('0x7')][_0x346043][_0xbeaa('0x16')])delete transfers[_0xbeaa('0x7')][_0x346043];delete channels[_0x346043];}}exports[_0xbeaa('0x17')]=function(_0x24c1ce){try{utils[_0xbeaa('0x18')](util[_0xbeaa('0xb')](_0xbeaa('0x19'),_0x24c1ce[_0xbeaa('0x8')]),_0x24c1ce);if(_0x24c1ce[_0xbeaa('0x8')]==_0x24c1ce[_0xbeaa('0x1a')]&&_0x24c1ce[_0xbeaa('0x1b')]!=_0xbeaa('0x1c')){utils['info'](util[_0xbeaa('0xb')](_0xbeaa('0x1d'),_0x24c1ce[_0xbeaa('0x8')],_0x24c1ce['context'],_0x24c1ce[_0xbeaa('0x1e')]));channels[_0x24c1ce[_0xbeaa('0x8')]]={'uniqueid':_0x24c1ce[_0xbeaa('0x8')],'accountcode':_0x24c1ce[_0xbeaa('0x12')],'source':_0x24c1ce[_0xbeaa('0xf')],'destination':_0x24c1ce[_0xbeaa('0x1e')],'destinationcontext':_0x24c1ce[_0xbeaa('0x1f')],'channel':_0x24c1ce['channel'],'starttime':utils[_0xbeaa('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xbeaa('0x4'),'amaflags':'DOCUMENTATION'};}}catch(_0x5f1ac0){utils['error'](util[_0xbeaa('0xb')](_0xbeaa('0x19'),_0x24c1ce[_0xbeaa('0x8')]),_0x5f1ac0);}};exports[_0xbeaa('0x21')]=function(_0x5345b9){try{utils['debug'](util['format'](_0xbeaa('0x22'),_0x5345b9[_0xbeaa('0x8')]),_0x5345b9);if(!_[_0xbeaa('0x23')](channels[_0x5345b9[_0xbeaa('0x8')]])&&_0x5345b9[_0xbeaa('0x24')]==0x6){utils['info'](util[_0xbeaa('0xb')](_0xbeaa('0x25'),_0x5345b9[_0xbeaa('0x8')],_0x5345b9['context'],_0x5345b9[_0xbeaa('0x1b')]));if(_[_0xbeaa('0x23')](channels[_0x5345b9[_0xbeaa('0x8')]]['systemanswertime'])){channels[_0x5345b9[_0xbeaa('0x8')]]['systemanswertime']=utils[_0xbeaa('0x20')]();}}else if(!_[_0xbeaa('0x23')](channels[_0x5345b9[_0xbeaa('0x1a')]])&&_0x5345b9[_0xbeaa('0x24')]==0x6&&_0x5345b9[_0xbeaa('0x1f')]!='transfer'){utils[_0xbeaa('0xa')](util[_0xbeaa('0xb')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x5345b9[_0xbeaa('0x8')],_0x5345b9[_0xbeaa('0x1a')],_0x5345b9['context'],_0x5345b9[_0xbeaa('0x1b')]));channels[_0x5345b9['linkedid']]['accountcode']=_0x5345b9['accountcode'];channels[_0x5345b9[_0xbeaa('0x1a')]][_0xbeaa('0x26')]=_0x5345b9[_0xbeaa('0x1b')];if(_['isNil'](channels[_0x5345b9[_0xbeaa('0x1a')]][_0xbeaa('0x27')])){channels[_0x5345b9[_0xbeaa('0x1a')]][_0xbeaa('0x27')]=utils['now']();}channels[_0x5345b9[_0xbeaa('0x1a')]][_0xbeaa('0x28')]=dispositions[_[_0xbeaa('0x29')](_0x5345b9[_0xbeaa('0x24')])]||_0xbeaa('0x5');}}catch(_0x44b2a8){utils[_0xbeaa('0x2a')](util[_0xbeaa('0xb')](_0xbeaa('0x22'),_0x5345b9['uniqueid']),_0x44b2a8);}};exports[_0xbeaa('0x2b')]=function(_0x197d0d){try{if(!_['isNil'](channels[_0x197d0d['uniqueid']])){utils[_0xbeaa('0x18')](util[_0xbeaa('0xb')]('[%s][calls][hangup]',_0x197d0d[_0xbeaa('0x8')]),_0x197d0d);if(_[_0xbeaa('0x23')](channels[_0x197d0d[_0xbeaa('0x8')]]['callerid'])){channels[_0x197d0d[_0xbeaa('0x8')]][_0xbeaa('0x2c')]=_0x197d0d[_0xbeaa('0x2d')]+'\x20<'+_0x197d0d[_0xbeaa('0xf')]+'>';}utils['info'](util['format']('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x197d0d['uniqueid'],channels[_0x197d0d[_0xbeaa('0x8')]][_0xbeaa('0x2c')],_0x197d0d[_0xbeaa('0x2e')]));channels[_0x197d0d[_0xbeaa('0x8')]]['endtime']=utils[_0xbeaa('0x20')]();channels[_0x197d0d[_0xbeaa('0x8')]]['duration']=utils[_0xbeaa('0x2f')](channels[_0x197d0d['uniqueid']][_0xbeaa('0x30')],channels[_0x197d0d[_0xbeaa('0x8')]][_0xbeaa('0x31')]);channels[_0x197d0d[_0xbeaa('0x8')]][_0xbeaa('0x32')]=channels[_0x197d0d[_0xbeaa('0x8')]]['answertime']?utils[_0xbeaa('0x2f')](channels[_0x197d0d[_0xbeaa('0x8')]][_0xbeaa('0x30')],channels[_0x197d0d[_0xbeaa('0x8')]][_0xbeaa('0x27')]):0x0;writeDB(channels[_0x197d0d['uniqueid']]);}}catch(_0x586f50){utils[_0xbeaa('0x2a')](util[_0xbeaa('0xb')]('[%s][calls][hangup]',_0x197d0d['uniqueid']),_0x586f50);}};exports[_0xbeaa('0x33')]=function(_0x4eab56){try{if(!_[_0xbeaa('0x23')](channels[_0x4eab56[_0xbeaa('0x34')]])){utils[_0xbeaa('0x18')](util[_0xbeaa('0xb')](_0xbeaa('0x35'),_0x4eab56[_0xbeaa('0x36')]),_0x4eab56);if(channels[_0x4eab56[_0xbeaa('0x34')]][_0xbeaa('0x1b')]==_0x4eab56['transfereechannel']){utils[_0xbeaa('0xa')](util[_0xbeaa('0xb')](_0xbeaa('0x37'),_0x4eab56['origtransfereruniqueid'],_0x4eab56[_0xbeaa('0x34')],_0x4eab56['secondtransfererchannel']));channels[_0x4eab56[_0xbeaa('0x34')]][_0xbeaa('0x26')]=_0x4eab56[_0xbeaa('0x38')];channels[_0x4eab56[_0xbeaa('0x34')]][_0xbeaa('0x39')]=_0xbeaa('0x3a');}else if(channels[_0x4eab56['localtwolinkedid']][_0xbeaa('0x1b')]=_0x4eab56['transfertargetchannel']){utils[_0xbeaa('0xa')](util[_0xbeaa('0xb')](_0xbeaa('0x37'),_0x4eab56['origtransfereruniqueid'],_0x4eab56[_0xbeaa('0x34')],_0x4eab56[_0xbeaa('0x3b')]));channels[_0x4eab56['localtwolinkedid']][_0xbeaa('0x26')]=_0x4eab56[_0xbeaa('0x3b')];channels[_0x4eab56['localtwolinkedid']][_0xbeaa('0x39')]=_0xbeaa('0x3a');}}}catch(_0x5962f9){utils['error'](util['format'](_0xbeaa('0x35'),_0x4eab56[_0xbeaa('0x36')]),_0x5962f9);}};exports[_0xbeaa('0x3c')]=function(_0x8bbbd3){try{if(!_[_0xbeaa('0x23')](channels[_0x8bbbd3[_0xbeaa('0x8')]])){utils[_0xbeaa('0x18')](util[_0xbeaa('0xb')](_0xbeaa('0x3d'),_0x8bbbd3[_0xbeaa('0x8')]),_0x8bbbd3);channels[_0x8bbbd3[_0xbeaa('0x8')]][_0xbeaa('0x3e')]=utils[_0xbeaa('0x20')]();utils[_0xbeaa('0xa')](util[_0xbeaa('0xb')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x8bbbd3[_0xbeaa('0x8')],channels[_0x8bbbd3['uniqueid']][_0xbeaa('0x3e')]));}}catch(_0x5e46de){utils['error'](util[_0xbeaa('0xb')](_0xbeaa('0x3d'),_0x8bbbd3[_0xbeaa('0x8')]),_0x5e46de);}};exports[_0xbeaa('0x3f')]=function(_0x490ef1){try{if(!_[_0xbeaa('0x23')](channels[_0x490ef1[_0xbeaa('0x8')]])){utils[_0xbeaa('0x18')](util[_0xbeaa('0xb')]('[%s][calls][musiconholdstop]',_0x490ef1[_0xbeaa('0x8')]),_0x490ef1);if(!_['isNil'](channels[_0x490ef1[_0xbeaa('0x8')]][_0xbeaa('0x3e')])){channels[_0x490ef1[_0xbeaa('0x8')]][_0xbeaa('0x40')]+=utils['diffTime'](utils['now'](),channels[_0x490ef1['uniqueid']]['musiconholdstartAt']);utils[_0xbeaa('0xa')](util[_0xbeaa('0xb')](_0xbeaa('0x41'),_0x490ef1[_0xbeaa('0x8')],channels[_0x490ef1[_0xbeaa('0x8')]][_0xbeaa('0x40')]));delete channels[_0x490ef1[_0xbeaa('0x8')]][_0xbeaa('0x3e')];}}}catch(_0x38f662){utils[_0xbeaa('0x2a')](util[_0xbeaa('0xb')](_0xbeaa('0x42'),_0x490ef1[_0xbeaa('0x8')]),_0x38f662);}};exports[_0xbeaa('0x43')]=function(_0x1e4ad4){try{if(!_['isNil'](channels[_0x1e4ad4['uniqueid']])){utils['debug'](util[_0xbeaa('0xb')](_0xbeaa('0x44'),_0x1e4ad4['uniqueid']),_0x1e4ad4);if(!_[_0xbeaa('0x23')](_0x1e4ad4['variable'][_0xbeaa('0x45')])){utils[_0xbeaa('0xa')](util[_0xbeaa('0xb')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x1e4ad4['uniqueid'],_0x1e4ad4[_0xbeaa('0x46')]));channels[_0x1e4ad4[_0xbeaa('0x8')]][_0xbeaa('0x47')]=_0x1e4ad4[_0xbeaa('0x46')];}if(!_['isNil'](_0x1e4ad4[_0xbeaa('0x48')][_0xbeaa('0x49')])){utils['info'](util[_0xbeaa('0xb')](_0xbeaa('0x4a'),_0x1e4ad4[_0xbeaa('0x8')],_0x1e4ad4['value']));channels[_0x1e4ad4['uniqueid']][_0xbeaa('0x4b')]=_0x1e4ad4['value'];channels[_0x1e4ad4[_0xbeaa('0x8')]][_0xbeaa('0x2c')]='\x22'+_0x1e4ad4['value']+_0xbeaa('0x4c')+_0x1e4ad4[_0xbeaa('0x46')]+'>';}if(!_[_0xbeaa('0x23')](_0x1e4ad4[_0xbeaa('0x48')][_0xbeaa('0x4d')])||!_[_0xbeaa('0x23')](_0x1e4ad4['variable']['xmd-callerid'])){utils[_0xbeaa('0xa')](util[_0xbeaa('0xb')](_0xbeaa('0x4e'),_0x1e4ad4[_0xbeaa('0x8')],!_[_0xbeaa('0x23')](_0x1e4ad4[_0xbeaa('0x48')][_0xbeaa('0x4d')])?_0xbeaa('0x4d'):_0xbeaa('0x4f'),_0x1e4ad4['value']));channels[_0x1e4ad4[_0xbeaa('0x8')]][_0xbeaa('0x2c')]=_0x1e4ad4[_0xbeaa('0x46')];}if(!_[_0xbeaa('0x23')](_0x1e4ad4[_0xbeaa('0x48')][_0xbeaa('0x50')])||!_[_0xbeaa('0x23')](_0x1e4ad4[_0xbeaa('0x48')][_0xbeaa('0x51')])){utils[_0xbeaa('0xa')](util[_0xbeaa('0xb')](_0xbeaa('0x4e'),_0x1e4ad4[_0xbeaa('0x8')],!_[_0xbeaa('0x23')](_0x1e4ad4[_0xbeaa('0x48')]['xmd-queue'])?_0xbeaa('0x50'):_0xbeaa('0x51'),_0x1e4ad4[_0xbeaa('0x46')]));channels[_0x1e4ad4[_0xbeaa('0x8')]]['lastapplication']=_0xbeaa('0x52');channels[_0x1e4ad4[_0xbeaa('0x8')]][_0xbeaa('0x53')]=_0x1e4ad4['value'];channels[_0x1e4ad4['uniqueid']][_0xbeaa('0xd')]=!![];}if(!_['isNil'](_0x1e4ad4[_0xbeaa('0x48')][_0xbeaa('0x54')])){utils['info'](util[_0xbeaa('0xb')](_0xbeaa('0x55'),_0x1e4ad4[_0xbeaa('0x8')],_0x1e4ad4[_0xbeaa('0x46')]));channels[_0x1e4ad4[_0xbeaa('0x8')]][_0xbeaa('0x56')]=_0x1e4ad4['value'];}if(!_[_0xbeaa('0x23')](_0x1e4ad4[_0xbeaa('0x48')][_0xbeaa('0x57')])){utils['info'](util[_0xbeaa('0xb')](_0xbeaa('0x58'),_0x1e4ad4[_0xbeaa('0x8')],_0x1e4ad4[_0xbeaa('0x46')]));channels[_0x1e4ad4[_0xbeaa('0x8')]]['type']=_0x1e4ad4[_0xbeaa('0x46')];}if(!_[_0xbeaa('0x23')](_0x1e4ad4[_0xbeaa('0x48')][_0xbeaa('0x59')])){utils[_0xbeaa('0xa')](util[_0xbeaa('0xb')](_0xbeaa('0x5a'),_0x1e4ad4[_0xbeaa('0x8')],_0x1e4ad4[_0xbeaa('0x46')]));channels[_0x1e4ad4[_0xbeaa('0x8')]][_0xbeaa('0x5b')]=_0x1e4ad4[_0xbeaa('0x46')];}if(!_['isNil'](_0x1e4ad4['variable'][_0xbeaa('0x5c')])){utils[_0xbeaa('0xa')](util['format'](_0xbeaa('0x5d'),_0x1e4ad4[_0xbeaa('0x8')],_0x1e4ad4[_0xbeaa('0x46')]));channels[_0x1e4ad4['uniqueid']][_0xbeaa('0x5c')]=_0x1e4ad4[_0xbeaa('0x46')];}}}catch(_0x398f06){utils[_0xbeaa('0x2a')](util[_0xbeaa('0xb')](_0xbeaa('0x44'),_0x1e4ad4[_0xbeaa('0x8')]),_0x398f06);}};exports['newexten']=function(_0x3a7866){try{if(!_['isNil'](channels[_0x3a7866[_0xbeaa('0x8')]])){utils[_0xbeaa('0x18')](util[_0xbeaa('0xb')]('[%s][calls][newexten]',_0x3a7866[_0xbeaa('0x8')]),_0x3a7866);utils[_0xbeaa('0xa')](util['format']('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x3a7866['uniqueid'],_0x3a7866[_0xbeaa('0x5e')],_0x3a7866[_0xbeaa('0x5f')]));if(_0x3a7866[_0xbeaa('0x5e')][_0xbeaa('0x60')]()==_0xbeaa('0x61')&&_[_0xbeaa('0x62')](_0x3a7866[_0xbeaa('0x5f')][_0xbeaa('0x60')](),'cdr')){var _0x38b591=_0x3a7866[_0xbeaa('0x5f')][_0xbeaa('0x63')]('=');var _0x476bd6=_0x38b591[0x0][_0xbeaa('0x64')](_0x38b591[0x0][_0xbeaa('0x65')]('(')+0x1,_0x38b591[0x0]['lastIndexOf'](')'));var _0x449415=_0x38b591[0x1];channels[_0x3a7866['uniqueid']][_0x476bd6]=_0x449415;}if(!_['includes']([_0xbeaa('0x2b'),_0xbeaa('0x66'),'execif',_0xbeaa('0x61'),_0xbeaa('0x67')],_0x3a7866[_0xbeaa('0x5e')][_0xbeaa('0x60')]())){channels[_0x3a7866[_0xbeaa('0x8')]][_0xbeaa('0x68')]=_0x3a7866[_0xbeaa('0x5e')];channels[_0x3a7866['uniqueid']]['lastdata']=_0x3a7866[_0xbeaa('0x5f')];}}}catch(_0x383afa){utils[_0xbeaa('0x2a')](util[_0xbeaa('0xb')](_0xbeaa('0x69'),_0x3a7866[_0xbeaa('0x8')]),_0x383afa);}}; \ No newline at end of file +var _0xf8fa=['noop','gotoif','[%s][calls][newexten]','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','uniqueid','blinds','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','recording','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','DOCUMENTATION','error','newstate','debug','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','isNil','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','now','disposition','toNumber','calleridname','callerid','cause-txt','endtime','starttime','billableseconds','diffTime','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','variable','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','appdata','toLowerCase','set','cdr','lastIndexOf','includes','hangup'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xf8fa,0x13e));var _0xaf8f=function(_0x297be0,_0x941d2b){_0x297be0=_0x297be0-0x0;var _0x19276e=_0xf8fa[_0x297be0];return _0x19276e;};'use strict';var _=require('lodash');var util=require(_0xaf8f('0x0'));var utils=require(_0xaf8f('0x1'));var transfers=require(_0xaf8f('0x2'));var dispositions=[_0xaf8f('0x3'),'FAILED',_0xaf8f('0x4'),'NO\x20ANSWER',_0xaf8f('0x3'),_0xaf8f('0x3'),_0xaf8f('0x5'),'BUSY',_0xaf8f('0x4'),_0xaf8f('0x4'),_0xaf8f('0x4')];var channels={};function writeDB(_0x3b3f23){var _0x65d0eb;if(transfers['blinds'][_0x3b3f23['uniqueid']]){_0x65d0eb=_0x3b3f23['uniqueid'];_0x3b3f23[_0xaf8f('0x6')]=transfers[_0xaf8f('0x7')][_0x3b3f23[_0xaf8f('0x6')]][_0xaf8f('0x8')];}utils[_0xaf8f('0x9')](util[_0xaf8f('0xa')](_0xaf8f('0xb'),_0x3b3f23[_0xaf8f('0x6')],_0x3b3f23['channel'],_0x3b3f23[_0xaf8f('0xc')],_0x3b3f23[_0xaf8f('0xd')],_0x3b3f23[_0xaf8f('0xe')],_0x3b3f23[_0xaf8f('0xf')],_0x3b3f23[_0xaf8f('0x10')],_0x3b3f23[_0xaf8f('0x11')]));if(_0x3b3f23[_0xaf8f('0x12')]){utils[_0xaf8f('0x13')](_0x3b3f23['accountcode'])['then'](function(_0x3fde7b){if(_0x3fde7b){_0x3b3f23[_0xaf8f('0x14')]=_0x3fde7b['id'];}utils[_0xaf8f('0x15')](_0xaf8f('0x16'),_0x3b3f23);});}else{utils[_0xaf8f('0x15')](_0xaf8f('0x16'),_0x3b3f23);}if(channels[_0x3b3f23[_0xaf8f('0x6')]]){delete channels[_0x3b3f23[_0xaf8f('0x6')]];}else if(_0x65d0eb&&channels[_0x65d0eb]){if(!transfers[_0xaf8f('0x7')][_0x65d0eb][_0xaf8f('0x17')])delete transfers[_0xaf8f('0x7')][_0x65d0eb];delete channels[_0x65d0eb];}}exports['newchannel']=function(_0x1fefe9){try{utils['debug'](util[_0xaf8f('0xa')](_0xaf8f('0x18'),_0x1fefe9['uniqueid']),_0x1fefe9);if(_0x1fefe9[_0xaf8f('0x6')]==_0x1fefe9[_0xaf8f('0x19')]&&_0x1fefe9[_0xaf8f('0x1a')]!=_0xaf8f('0x1b')){utils[_0xaf8f('0x9')](util['format'](_0xaf8f('0x1c'),_0x1fefe9[_0xaf8f('0x6')],_0x1fefe9[_0xaf8f('0x1d')],_0x1fefe9['exten']));channels[_0x1fefe9[_0xaf8f('0x6')]]={'uniqueid':_0x1fefe9[_0xaf8f('0x6')],'accountcode':_0x1fefe9[_0xaf8f('0x12')],'source':_0x1fefe9[_0xaf8f('0xf')],'destination':_0x1fefe9[_0xaf8f('0x1e')],'destinationcontext':_0x1fefe9[_0xaf8f('0x1d')],'channel':_0x1fefe9[_0xaf8f('0x1a')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xaf8f('0x3'),'amaflags':_0xaf8f('0x1f')};}}catch(_0x37a91c){utils[_0xaf8f('0x20')](util[_0xaf8f('0xa')]('[%s][calls][newchannel]',_0x1fefe9[_0xaf8f('0x6')]),_0x37a91c);}};exports[_0xaf8f('0x21')]=function(_0x4e75df){try{utils[_0xaf8f('0x22')](util['format']('[%s][calls][newstate]',_0x4e75df[_0xaf8f('0x6')]),_0x4e75df);if(!_['isNil'](channels[_0x4e75df[_0xaf8f('0x6')]])&&_0x4e75df[_0xaf8f('0x23')]==0x6){utils['info'](util[_0xaf8f('0xa')](_0xaf8f('0x24'),_0x4e75df['uniqueid'],_0x4e75df[_0xaf8f('0x1d')],_0x4e75df[_0xaf8f('0x1a')]));if(_['isNil'](channels[_0x4e75df[_0xaf8f('0x6')]][_0xaf8f('0x25')])){channels[_0x4e75df[_0xaf8f('0x6')]][_0xaf8f('0x25')]=utils['now']();}}else if(!_[_0xaf8f('0x26')](channels[_0x4e75df[_0xaf8f('0x19')]])&&_0x4e75df[_0xaf8f('0x23')]==0x6&&_0x4e75df['context']!='transfer'){utils[_0xaf8f('0x9')](util[_0xaf8f('0xa')](_0xaf8f('0x27'),_0x4e75df[_0xaf8f('0x6')],_0x4e75df['linkedid'],_0x4e75df[_0xaf8f('0x1d')],_0x4e75df[_0xaf8f('0x1a')]));channels[_0x4e75df[_0xaf8f('0x19')]][_0xaf8f('0x12')]=_0x4e75df[_0xaf8f('0x12')];channels[_0x4e75df[_0xaf8f('0x19')]][_0xaf8f('0x28')]=_0x4e75df[_0xaf8f('0x1a')];if(_[_0xaf8f('0x26')](channels[_0x4e75df[_0xaf8f('0x19')]]['answertime'])){channels[_0x4e75df[_0xaf8f('0x19')]][_0xaf8f('0x29')]=utils[_0xaf8f('0x2a')]();}channels[_0x4e75df['linkedid']][_0xaf8f('0x2b')]=dispositions[_[_0xaf8f('0x2c')](_0x4e75df['channelstate'])]||_0xaf8f('0x5');}}catch(_0xd8fb7c){utils[_0xaf8f('0x20')](util[_0xaf8f('0xa')]('[%s][calls][newstate]',_0x4e75df[_0xaf8f('0x6')]),_0xd8fb7c);}};exports['hangup']=function(_0x1321f6){try{if(!_['isNil'](channels[_0x1321f6['uniqueid']])){utils[_0xaf8f('0x22')](util[_0xaf8f('0xa')]('[%s][calls][hangup]',_0x1321f6['uniqueid']),_0x1321f6);if(_[_0xaf8f('0x26')](channels[_0x1321f6['uniqueid']]['callerid'])){channels[_0x1321f6[_0xaf8f('0x6')]]['callerid']=_0x1321f6[_0xaf8f('0x2d')]+'\x20<'+_0x1321f6[_0xaf8f('0xf')]+'>';}utils['info'](util[_0xaf8f('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x1321f6['uniqueid'],channels[_0x1321f6[_0xaf8f('0x6')]][_0xaf8f('0x2e')],_0x1321f6[_0xaf8f('0x2f')]));channels[_0x1321f6['uniqueid']][_0xaf8f('0x30')]=utils['now']();channels[_0x1321f6[_0xaf8f('0x6')]]['duration']=utils['diffTime'](channels[_0x1321f6[_0xaf8f('0x6')]][_0xaf8f('0x30')],channels[_0x1321f6['uniqueid']][_0xaf8f('0x31')]);channels[_0x1321f6[_0xaf8f('0x6')]][_0xaf8f('0x32')]=channels[_0x1321f6[_0xaf8f('0x6')]][_0xaf8f('0x29')]?utils[_0xaf8f('0x33')](channels[_0x1321f6[_0xaf8f('0x6')]][_0xaf8f('0x30')],channels[_0x1321f6[_0xaf8f('0x6')]][_0xaf8f('0x29')]):0x0;writeDB(channels[_0x1321f6[_0xaf8f('0x6')]]);}}catch(_0x822e96){utils[_0xaf8f('0x20')](util['format'](_0xaf8f('0x34'),_0x1321f6['uniqueid']),_0x822e96);}};exports[_0xaf8f('0x35')]=function(_0x280cc9){try{if(!_[_0xaf8f('0x26')](channels[_0x280cc9[_0xaf8f('0x36')]])){utils[_0xaf8f('0x22')](util[_0xaf8f('0xa')](_0xaf8f('0x37'),_0x280cc9[_0xaf8f('0x38')]),_0x280cc9);if(channels[_0x280cc9[_0xaf8f('0x36')]][_0xaf8f('0x1a')]==_0x280cc9[_0xaf8f('0x39')]){utils[_0xaf8f('0x9')](util[_0xaf8f('0xa')](_0xaf8f('0x3a'),_0x280cc9[_0xaf8f('0x38')],_0x280cc9['localtwolinkedid'],_0x280cc9['secondtransfererchannel']));channels[_0x280cc9['localtwolinkedid']]['destinationchannel']=_0x280cc9['secondtransfererchannel'];channels[_0x280cc9[_0xaf8f('0x36')]][_0xaf8f('0x3b')]='_attended';}else if(channels[_0x280cc9[_0xaf8f('0x36')]]['channel']=_0x280cc9[_0xaf8f('0x3c')]){utils[_0xaf8f('0x9')](util[_0xaf8f('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x280cc9[_0xaf8f('0x38')],_0x280cc9[_0xaf8f('0x36')],_0x280cc9['origtransfererchannel']));channels[_0x280cc9[_0xaf8f('0x36')]][_0xaf8f('0x28')]=_0x280cc9[_0xaf8f('0x3d')];channels[_0x280cc9[_0xaf8f('0x36')]][_0xaf8f('0x3b')]=_0xaf8f('0x3e');}}}catch(_0x2384d9){utils[_0xaf8f('0x20')](util['format'](_0xaf8f('0x37'),_0x280cc9[_0xaf8f('0x38')]),_0x2384d9);}};exports[_0xaf8f('0x3f')]=function(_0x1be1bd){try{if(!_['isNil'](channels[_0x1be1bd[_0xaf8f('0x6')]])){utils[_0xaf8f('0x22')](util[_0xaf8f('0xa')]('[%s][calls][musiconholdstart]',_0x1be1bd[_0xaf8f('0x6')]),_0x1be1bd);channels[_0x1be1bd[_0xaf8f('0x6')]]['musiconholdstartAt']=utils[_0xaf8f('0x2a')]();utils['info'](util['format']('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x1be1bd[_0xaf8f('0x6')],channels[_0x1be1bd[_0xaf8f('0x6')]][_0xaf8f('0x40')]));}}catch(_0x1b1dd3){utils[_0xaf8f('0x20')](util[_0xaf8f('0xa')]('[%s][calls][musiconholdstart]',_0x1be1bd[_0xaf8f('0x6')]),_0x1b1dd3);}};exports[_0xaf8f('0x41')]=function(_0x1ed7ae){try{if(!_[_0xaf8f('0x26')](channels[_0x1ed7ae['uniqueid']])){utils['debug'](util[_0xaf8f('0xa')](_0xaf8f('0x42'),_0x1ed7ae['uniqueid']),_0x1ed7ae);if(!_[_0xaf8f('0x26')](channels[_0x1ed7ae['uniqueid']][_0xaf8f('0x40')])){channels[_0x1ed7ae[_0xaf8f('0x6')]][_0xaf8f('0x43')]+=utils[_0xaf8f('0x33')](utils[_0xaf8f('0x2a')](),channels[_0x1ed7ae['uniqueid']][_0xaf8f('0x40')]);utils['info'](util[_0xaf8f('0xa')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x1ed7ae[_0xaf8f('0x6')],channels[_0x1ed7ae[_0xaf8f('0x6')]][_0xaf8f('0x43')]));delete channels[_0x1ed7ae[_0xaf8f('0x6')]]['musiconholdstartAt'];}}}catch(_0x1515aa){utils[_0xaf8f('0x20')](util[_0xaf8f('0xa')](_0xaf8f('0x42'),_0x1ed7ae[_0xaf8f('0x6')]),_0x1515aa);}};exports[_0xaf8f('0x44')]=function(_0x2636eb){try{if(!_['isNil'](channels[_0x2636eb[_0xaf8f('0x6')]])){utils[_0xaf8f('0x22')](util['format'](_0xaf8f('0x45'),_0x2636eb[_0xaf8f('0x6')]),_0x2636eb);if(!_[_0xaf8f('0x26')](_0x2636eb['variable']['xmd-originatecalleridnum'])){utils[_0xaf8f('0x9')](util[_0xaf8f('0xa')](_0xaf8f('0x46'),_0x2636eb[_0xaf8f('0x6')],_0x2636eb[_0xaf8f('0x47')]));channels[_0x2636eb['uniqueid']]['source']=_0x2636eb[_0xaf8f('0x47')];}if(!_[_0xaf8f('0x26')](_0x2636eb['variable'][_0xaf8f('0x48')])){utils['info'](util['format'](_0xaf8f('0x49'),_0x2636eb[_0xaf8f('0x6')],_0x2636eb[_0xaf8f('0x47')]));channels[_0x2636eb['uniqueid']][_0xaf8f('0x4a')]=_0x2636eb[_0xaf8f('0x47')];channels[_0x2636eb[_0xaf8f('0x6')]]['callerid']='\x22'+_0x2636eb['value']+_0xaf8f('0x4b')+_0x2636eb[_0xaf8f('0x47')]+'>';}if(!_[_0xaf8f('0x26')](_0x2636eb['variable'][_0xaf8f('0x4c')])||!_[_0xaf8f('0x26')](_0x2636eb[_0xaf8f('0x4d')]['xmd-callerid'])){utils['info'](util[_0xaf8f('0xa')](_0xaf8f('0x4e'),_0x2636eb['uniqueid'],!_[_0xaf8f('0x26')](_0x2636eb[_0xaf8f('0x4d')][_0xaf8f('0x4c')])?_0xaf8f('0x4c'):'xmd-callerid',_0x2636eb[_0xaf8f('0x47')]));channels[_0x2636eb[_0xaf8f('0x6')]][_0xaf8f('0x2e')]=_0x2636eb['value'];}if(!_[_0xaf8f('0x26')](_0x2636eb[_0xaf8f('0x4d')][_0xaf8f('0x4f')])||!_[_0xaf8f('0x26')](_0x2636eb[_0xaf8f('0x4d')][_0xaf8f('0x50')])){utils[_0xaf8f('0x9')](util[_0xaf8f('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x2636eb[_0xaf8f('0x6')],!_[_0xaf8f('0x26')](_0x2636eb[_0xaf8f('0x4d')]['xmd-queue'])?'xmd-queue':'xmcs-queue',_0x2636eb[_0xaf8f('0x47')]));channels[_0x2636eb[_0xaf8f('0x6')]][_0xaf8f('0x51')]=_0xaf8f('0x52');channels[_0x2636eb[_0xaf8f('0x6')]][_0xaf8f('0x53')]=_0x2636eb[_0xaf8f('0x47')];channels[_0x2636eb['uniqueid']][_0xaf8f('0xc')]=!![];}if(!_[_0xaf8f('0x26')](_0x2636eb[_0xaf8f('0x4d')]['xmd-contactid'])){utils[_0xaf8f('0x9')](util[_0xaf8f('0xa')](_0xaf8f('0x54'),_0x2636eb[_0xaf8f('0x6')],_0x2636eb[_0xaf8f('0x47')]));channels[_0x2636eb[_0xaf8f('0x6')]][_0xaf8f('0x55')]=_0x2636eb[_0xaf8f('0x47')];}if(!_[_0xaf8f('0x26')](_0x2636eb['variable'][_0xaf8f('0x56')])){utils['info'](util['format'](_0xaf8f('0x57'),_0x2636eb[_0xaf8f('0x6')],_0x2636eb[_0xaf8f('0x47')]));channels[_0x2636eb[_0xaf8f('0x6')]][_0xaf8f('0x58')]=_0x2636eb[_0xaf8f('0x47')];}if(!_[_0xaf8f('0x26')](_0x2636eb['variable'][_0xaf8f('0x59')])){utils['info'](util[_0xaf8f('0xa')](_0xaf8f('0x5a'),_0x2636eb['uniqueid'],_0x2636eb[_0xaf8f('0x47')]));channels[_0x2636eb['uniqueid']][_0xaf8f('0x5b')]=_0x2636eb[_0xaf8f('0x47')];}if(!_[_0xaf8f('0x26')](_0x2636eb[_0xaf8f('0x4d')][_0xaf8f('0x5c')])){utils['info'](util['format'](_0xaf8f('0x5d'),_0x2636eb[_0xaf8f('0x6')],_0x2636eb[_0xaf8f('0x47')]));channels[_0x2636eb[_0xaf8f('0x6')]][_0xaf8f('0x5c')]=_0x2636eb['value'];}}}catch(_0x32f993){utils['error'](util[_0xaf8f('0xa')](_0xaf8f('0x45'),_0x2636eb[_0xaf8f('0x6')]),_0x32f993);}};exports[_0xaf8f('0x5e')]=function(_0x2a0157){try{if(!_[_0xaf8f('0x26')](channels[_0x2a0157[_0xaf8f('0x6')]])){utils[_0xaf8f('0x22')](util[_0xaf8f('0xa')]('[%s][calls][newexten]',_0x2a0157['uniqueid']),_0x2a0157);utils[_0xaf8f('0x9')](util[_0xaf8f('0xa')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x2a0157[_0xaf8f('0x6')],_0x2a0157['application'],_0x2a0157[_0xaf8f('0x5f')]));if(_0x2a0157['application'][_0xaf8f('0x60')]()==_0xaf8f('0x61')&&_['startsWith'](_0x2a0157[_0xaf8f('0x5f')][_0xaf8f('0x60')](),_0xaf8f('0x62'))){var _0x401115=_0x2a0157[_0xaf8f('0x5f')]['split']('=');var _0x215982=_0x401115[0x0]['substring'](_0x401115[0x0][_0xaf8f('0x63')]('(')+0x1,_0x401115[0x0][_0xaf8f('0x63')](')'));var _0xced943=_0x401115[0x1];channels[_0x2a0157[_0xaf8f('0x6')]][_0x215982]=_0xced943;}if(!_[_0xaf8f('0x64')]([_0xaf8f('0x65'),_0xaf8f('0x66'),'execif','set',_0xaf8f('0x67')],_0x2a0157['application'][_0xaf8f('0x60')]())){channels[_0x2a0157[_0xaf8f('0x6')]][_0xaf8f('0x51')]=_0x2a0157['application'];channels[_0x2a0157['uniqueid']]['lastdata']=_0x2a0157[_0xaf8f('0x5f')];}}}catch(_0x9a6b7a){utils[_0xaf8f('0x20')](util[_0xaf8f('0xa')](_0xaf8f('0x68'),_0x2a0157[_0xaf8f('0x6')]),_0x9a6b7a);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index bdc503b..23f28b1 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 _0x6cff=['[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error','close','connect','info','[core]\x20connected','shutdown'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0x6cff,0x11c));var _0xf6cf=function(_0x569a45,_0x2da15b){_0x569a45=_0x569a45-0x0;var _0x1a5ef8=_0x6cff[_0x569a45];return _0x1a5ef8;};'use strict';var utils=require('./utils');exports[_0xf6cf('0x0')]=function(){utils[_0xf6cf('0x1')](_0xf6cf('0x2'));};exports[_0xf6cf('0x3')]=function(){utils[_0xf6cf('0x1')](_0xf6cf('0x4'));};exports['fullybooted']=function(){utils[_0xf6cf('0x1')](_0xf6cf('0x5'));};exports[_0xf6cf('0x6')]=function(_0x4353fa){utils[_0xf6cf('0x6')](_0xf6cf('0x7'),_0x4353fa);};exports[_0xf6cf('0x8')]=function(){utils[_0xf6cf('0x1')]('[core]\x20close');};exports['managerevent']=function(_0x47dbbf){}; \ No newline at end of file +var _0x99be=['info','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error','[core]\x20close','./utils','connect','shutdown'];(function(_0x12d985,_0xf9a9a9){var _0x580fc9=function(_0x46878a){while(--_0x46878a){_0x12d985['push'](_0x12d985['shift']());}};_0x580fc9(++_0xf9a9a9);}(_0x99be,0x1c8));var _0xe99b=function(_0x4c163a,_0x4efff5){_0x4c163a=_0x4c163a-0x0;var _0x580942=_0x99be[_0x4c163a];return _0x580942;};'use strict';var utils=require(_0xe99b('0x0'));exports[_0xe99b('0x1')]=function(){utils['info']('[core]\x20connected');};exports[_0xe99b('0x2')]=function(){utils[_0xe99b('0x3')](_0xe99b('0x4'));};exports['fullybooted']=function(){utils[_0xe99b('0x3')](_0xe99b('0x5'));};exports[_0xe99b('0x6')]=function(_0x1c10ca){utils['error'](_0xe99b('0x7'),_0x1c10ca);};exports['close']=function(){utils['info'](_0xe99b('0x8'));};exports['managerevent']=function(_0x56a218){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 44f5b42..b6d19ab 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 _0x9519=['answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','calleridname','cause-txt','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','info','application','set','startsWith','toLowerCase','cdr(routeid)','appdata','split','error','varset','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER'];(function(_0x383519,_0x199f38){var _0x4c5cc1=function(_0x24d75e){while(--_0x24d75e){_0x383519['push'](_0x383519['shift']());}};_0x4c5cc1(++_0x199f38);}(_0x9519,0x130));var _0x9951=function(_0x15a0a1,_0x167337){_0x15a0a1=_0x15a0a1-0x0;var _0xfe6be4=_0x9519[_0x15a0a1];return _0xfe6be4;};'use strict';var _=require(_0x9951('0x0'));var util=require(_0x9951('0x1'));var utils=require(_0x9951('0x2'));var dials={};function writeDB(_0x44dd8e){utils['info'](util[_0x9951('0x3')](_0x9951('0x4'),_0x44dd8e[_0x9951('0x5')],_0x44dd8e['channel'],_0x44dd8e['dialstring'],_0x44dd8e[_0x9951('0x6')],_0x44dd8e[_0x9951('0x7')],_0x44dd8e[_0x9951('0x8')]));utils['request'](_0x9951('0x9'),_0x44dd8e);delete dials[_0x44dd8e[_0x9951('0x5')]];}exports[_0x9951('0xa')]=function(_0x15b064){try{utils[_0x9951('0xb')](util[_0x9951('0x3')](_0x9951('0xc'),_0x15b064[_0x9951('0x5')]),_0x15b064);utils[_0x9951('0xd')](util[_0x9951('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x15b064['uniqueid'],_0x15b064[_0x9951('0xe')],_0x15b064['appdata']));if(_0x15b064[_0x9951('0xe')]['toLowerCase']()==_0x9951('0xf')&&_[_0x9951('0x10')](_0x15b064['appdata'][_0x9951('0x11')](),_0x9951('0x12'))){var _0x2bb737=_0x15b064[_0x9951('0x13')][_0x9951('0x14')]('=');dials[_0x15b064[_0x9951('0x5')]]={'routeId':_0x2bb737[0x1]};}}catch(_0x511e00){utils[_0x9951('0x15')](util[_0x9951('0x3')]('[%s][dials][newexten]',_0x15b064[_0x9951('0x5')]),_0x511e00);}};exports[_0x9951('0x16')]=function(_0x4e2b45){try{utils[_0x9951('0xb')](util[_0x9951('0x3')](_0x9951('0x17'),_0x4e2b45[_0x9951('0x5')]),_0x4e2b45);if(!_[_0x9951('0x18')](_0x4e2b45['variable'][_0x9951('0x19')])){utils[_0x9951('0xd')](util['format'](_0x9951('0x1a'),_0x4e2b45[_0x9951('0x5')],_0x4e2b45[_0x9951('0x1b')]));dials[_0x4e2b45[_0x9951('0x5')]]={'routeId':_0x4e2b45[_0x9951('0x1b')]};}}catch(_0x5b7402){utils[_0x9951('0x15')](util[_0x9951('0x3')]('[%s][dials][varset]',_0x4e2b45[_0x9951('0x5')]),_0x5b7402);}};exports[_0x9951('0x1c')]=function(_0x397a0b){try{if(!_['isNil'](dials[_0x397a0b[_0x9951('0x5')]])){utils[_0x9951('0xb')](util[_0x9951('0x3')]('[%s][dials][dialbegin]',_0x397a0b[_0x9951('0x5')]),_0x397a0b);dials[_0x397a0b[_0x9951('0x5')]]=_[_0x9951('0x1d')](dials[_0x397a0b[_0x9951('0x5')]],_0x397a0b);dials[_0x397a0b[_0x9951('0x5')]][_0x9951('0x1e')]=utils[_0x9951('0x1f')]();dials[_0x397a0b[_0x9951('0x5')]][_0x9951('0x20')]=_0x9951('0x21');utils['info'](util['format'](_0x9951('0x22'),_0x397a0b[_0x9951('0x5')],dials[_0x397a0b[_0x9951('0x5')]]['starttime']));}}catch(_0x28f0fd){utils['error'](util[_0x9951('0x3')](_0x9951('0x23'),_0x397a0b[_0x9951('0x5')]),_0x28f0fd);}};exports[_0x9951('0x24')]=function(_0x4d2dff){try{if(!_[_0x9951('0x18')](dials[_0x4d2dff[_0x9951('0x5')]])){utils[_0x9951('0xb')](util[_0x9951('0x3')](_0x9951('0x25'),_0x4d2dff['uniqueid']),_0x4d2dff);dials[_0x4d2dff['uniqueid']][_0x9951('0x8')]=_0x4d2dff['dialstatus'];if(_0x4d2dff[_0x9951('0x8')]==_0x9951('0x26')){dials[_0x4d2dff[_0x9951('0x5')]]=_[_0x9951('0x1d')](dials[_0x4d2dff[_0x9951('0x5')]],_0x4d2dff);dials[_0x4d2dff[_0x9951('0x5')]][_0x9951('0x27')]=utils[_0x9951('0x1f')]();dials[_0x4d2dff[_0x9951('0x5')]][_0x9951('0x20')]=_0x9951('0x28');utils[_0x9951('0xd')](util[_0x9951('0x3')](_0x9951('0x29'),_0x4d2dff[_0x9951('0x5')],_0x4d2dff[_0x9951('0x8')],dials[_0x4d2dff[_0x9951('0x5')]][_0x9951('0x27')]));}else{utils['info'](util[_0x9951('0x3')](_0x9951('0x2a'),_0x4d2dff['uniqueid'],_0x4d2dff['dialstatus']));}}}catch(_0xd0f6e5){utils[_0x9951('0x15')](util[_0x9951('0x3')](_0x9951('0x25'),_0x4d2dff[_0x9951('0x5')]),_0xd0f6e5);}};exports['hangup']=function(_0x46bb0c){try{if(!_[_0x9951('0x18')](dials[_0x46bb0c[_0x9951('0x5')]])){utils['debug'](util[_0x9951('0x3')]('[%s][dials][hangup]',_0x46bb0c[_0x9951('0x5')]),_0x46bb0c);utils[_0x9951('0xd')](util['format']('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x46bb0c[_0x9951('0x5')],_0x46bb0c[_0x9951('0x6')],_0x46bb0c[_0x9951('0x2b')],_0x46bb0c[_0x9951('0x2c')]));dials[_0x46bb0c[_0x9951('0x5')]]=_['assign'](dials[_0x46bb0c[_0x9951('0x5')]],{'endtime':utils[_0x9951('0x1f')](),'lastevent':'complete'});dials[_0x46bb0c[_0x9951('0x5')]]['duration']=utils[_0x9951('0x2d')](dials[_0x46bb0c[_0x9951('0x5')]][_0x9951('0x2e')],dials[_0x46bb0c[_0x9951('0x5')]]['starttime']);dials[_0x46bb0c[_0x9951('0x5')]][_0x9951('0x2f')]=utils[_0x9951('0x2d')](dials[_0x46bb0c['uniqueid']]['answertime']||dials[_0x46bb0c[_0x9951('0x5')]][_0x9951('0x2e')],dials[_0x46bb0c[_0x9951('0x5')]]['starttime']);dials[_0x46bb0c['uniqueid']][_0x9951('0x30')]=dials[_0x46bb0c['uniqueid']][_0x9951('0x27')]?utils['diffTime'](dials[_0x46bb0c[_0x9951('0x5')]][_0x9951('0x2e')],dials[_0x46bb0c['uniqueid']]['answertime']):0x0;writeDB(dials[_0x46bb0c['uniqueid']]);}}catch(_0x5a6d07){utils[_0x9951('0x15')](util[_0x9951('0x3')]('[%s][dials][hangup]',_0x46bb0c[_0x9951('0x5')]),_0x5a6d07);}}; \ No newline at end of file +var _0xb8e0=['assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','complete','diffTime','endtime','holdtime','billableseconds','lodash','./utils','info','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','uniqueid','newexten','debug','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr(routeid)','error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','[%s][dials][dialbegin]'];(function(_0x2d07bf,_0x4dc777){var _0x4f7dfa=function(_0x51b9b4){while(--_0x51b9b4){_0x2d07bf['push'](_0x2d07bf['shift']());}};_0x4f7dfa(++_0x4dc777);}(_0xb8e0,0x146));var _0x0b8e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xb8e0[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0x0b8e('0x0'));var util=require('util');var utils=require(_0x0b8e('0x1'));var dials={};function writeDB(_0x45ac0d){utils[_0x0b8e('0x2')](util['format']('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x45ac0d['uniqueid'],_0x45ac0d['channel'],_0x45ac0d[_0x0b8e('0x3')],_0x45ac0d[_0x0b8e('0x4')],_0x45ac0d[_0x0b8e('0x5')],_0x45ac0d[_0x0b8e('0x6')]));utils[_0x0b8e('0x7')](_0x0b8e('0x8'),_0x45ac0d);delete dials[_0x45ac0d[_0x0b8e('0x9')]];}exports[_0x0b8e('0xa')]=function(_0x581b24){try{utils[_0x0b8e('0xb')](util[_0x0b8e('0xc')](_0x0b8e('0xd'),_0x581b24['uniqueid']),_0x581b24);utils['info'](util[_0x0b8e('0xc')](_0x0b8e('0xe'),_0x581b24[_0x0b8e('0x9')],_0x581b24['application'],_0x581b24[_0x0b8e('0xf')]));if(_0x581b24[_0x0b8e('0x10')][_0x0b8e('0x11')]()==_0x0b8e('0x12')&&_[_0x0b8e('0x13')](_0x581b24['appdata'][_0x0b8e('0x11')](),_0x0b8e('0x14'))){var _0x1f4233=_0x581b24[_0x0b8e('0xf')]['split']('=');dials[_0x581b24[_0x0b8e('0x9')]]={'routeId':_0x1f4233[0x1]};}}catch(_0x529d6e){utils[_0x0b8e('0x15')](util[_0x0b8e('0xc')]('[%s][dials][newexten]',_0x581b24[_0x0b8e('0x9')]),_0x529d6e);}};exports[_0x0b8e('0x16')]=function(_0x2d37c2){try{utils[_0x0b8e('0xb')](util[_0x0b8e('0xc')](_0x0b8e('0x17'),_0x2d37c2[_0x0b8e('0x9')]),_0x2d37c2);if(!_[_0x0b8e('0x18')](_0x2d37c2[_0x0b8e('0x19')][_0x0b8e('0x1a')])){utils[_0x0b8e('0x2')](util[_0x0b8e('0xc')](_0x0b8e('0x1b'),_0x2d37c2[_0x0b8e('0x9')],_0x2d37c2[_0x0b8e('0x1c')]));dials[_0x2d37c2['uniqueid']]={'routeId':_0x2d37c2[_0x0b8e('0x1c')]};}}catch(_0x16b82e){utils[_0x0b8e('0x15')](util['format'](_0x0b8e('0x17'),_0x2d37c2[_0x0b8e('0x9')]),_0x16b82e);}};exports[_0x0b8e('0x1d')]=function(_0x297f32){try{if(!_['isNil'](dials[_0x297f32['uniqueid']])){utils[_0x0b8e('0xb')](util[_0x0b8e('0xc')](_0x0b8e('0x1e'),_0x297f32[_0x0b8e('0x9')]),_0x297f32);dials[_0x297f32[_0x0b8e('0x9')]]=_[_0x0b8e('0x1f')](dials[_0x297f32[_0x0b8e('0x9')]],_0x297f32);dials[_0x297f32[_0x0b8e('0x9')]][_0x0b8e('0x20')]=utils[_0x0b8e('0x21')]();dials[_0x297f32[_0x0b8e('0x9')]][_0x0b8e('0x22')]=_0x0b8e('0x23');utils[_0x0b8e('0x2')](util['format'](_0x0b8e('0x24'),_0x297f32['uniqueid'],dials[_0x297f32[_0x0b8e('0x9')]]['starttime']));}}catch(_0x5599da){utils[_0x0b8e('0x15')](util[_0x0b8e('0xc')]('[%s][dials][dialbegin]',_0x297f32['uniqueid']),_0x5599da);}};exports[_0x0b8e('0x25')]=function(_0x1cd49d){try{if(!_['isNil'](dials[_0x1cd49d[_0x0b8e('0x9')]])){utils[_0x0b8e('0xb')](util[_0x0b8e('0xc')](_0x0b8e('0x26'),_0x1cd49d[_0x0b8e('0x9')]),_0x1cd49d);dials[_0x1cd49d[_0x0b8e('0x9')]][_0x0b8e('0x6')]=_0x1cd49d[_0x0b8e('0x6')];if(_0x1cd49d[_0x0b8e('0x6')]==_0x0b8e('0x27')){dials[_0x1cd49d['uniqueid']]=_[_0x0b8e('0x1f')](dials[_0x1cd49d['uniqueid']],_0x1cd49d);dials[_0x1cd49d[_0x0b8e('0x9')]][_0x0b8e('0x28')]=utils[_0x0b8e('0x21')]();dials[_0x1cd49d[_0x0b8e('0x9')]][_0x0b8e('0x22')]=_0x0b8e('0x29');utils[_0x0b8e('0x2')](util[_0x0b8e('0xc')](_0x0b8e('0x2a'),_0x1cd49d[_0x0b8e('0x9')],_0x1cd49d[_0x0b8e('0x6')],dials[_0x1cd49d[_0x0b8e('0x9')]]['answertime']));}else{utils[_0x0b8e('0x2')](util[_0x0b8e('0xc')](_0x0b8e('0x2b'),_0x1cd49d[_0x0b8e('0x9')],_0x1cd49d[_0x0b8e('0x6')]));}}}catch(_0x39127e){utils[_0x0b8e('0x15')](util['format'](_0x0b8e('0x26'),_0x1cd49d[_0x0b8e('0x9')]),_0x39127e);}};exports[_0x0b8e('0x2c')]=function(_0x15e15){try{if(!_[_0x0b8e('0x18')](dials[_0x15e15[_0x0b8e('0x9')]])){utils[_0x0b8e('0xb')](util[_0x0b8e('0xc')](_0x0b8e('0x2d'),_0x15e15[_0x0b8e('0x9')]),_0x15e15);utils['info'](util[_0x0b8e('0xc')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x15e15['uniqueid'],_0x15e15[_0x0b8e('0x4')],_0x15e15['calleridname'],_0x15e15['cause-txt']));dials[_0x15e15[_0x0b8e('0x9')]]=_[_0x0b8e('0x1f')](dials[_0x15e15['uniqueid']],{'endtime':utils[_0x0b8e('0x21')](),'lastevent':_0x0b8e('0x2e')});dials[_0x15e15[_0x0b8e('0x9')]]['duration']=utils[_0x0b8e('0x2f')](dials[_0x15e15[_0x0b8e('0x9')]][_0x0b8e('0x30')],dials[_0x15e15[_0x0b8e('0x9')]][_0x0b8e('0x20')]);dials[_0x15e15['uniqueid']][_0x0b8e('0x31')]=utils[_0x0b8e('0x2f')](dials[_0x15e15[_0x0b8e('0x9')]][_0x0b8e('0x28')]||dials[_0x15e15[_0x0b8e('0x9')]][_0x0b8e('0x30')],dials[_0x15e15['uniqueid']][_0x0b8e('0x20')]);dials[_0x15e15[_0x0b8e('0x9')]][_0x0b8e('0x32')]=dials[_0x15e15[_0x0b8e('0x9')]]['answertime']?utils[_0x0b8e('0x2f')](dials[_0x15e15['uniqueid']]['endtime'],dials[_0x15e15[_0x0b8e('0x9')]]['answertime']):0x0;writeDB(dials[_0x15e15[_0x0b8e('0x9')]]);}}catch(_0x308f17){utils[_0x0b8e('0x15')](util[_0x0b8e('0xc')]('[%s][dials][hangup]',_0x15e15['uniqueid']),_0x308f17);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index dda0947..f3a1f08 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 _0xc3f3=['blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','util','xdr','disabled','env','production','local','port','asterisk','username','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./queues.controller','./recordings.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','format','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]'];(function(_0x4622ef,_0x5590bb){var _0xab19c9=function(_0x3f6216){while(--_0x3f6216){_0x4622ef['push'](_0x4622ef['shift']());}};_0xab19c9(++_0x5590bb);}(_0xc3f3,0x124));var _0x3c3f=function(_0x534485,_0x154021){_0x534485=_0x534485-0x0;var _0x4b63af=_0xc3f3[_0x534485];return _0x4b63af;};var AsteriskManager=require('asterisk-manager');var config=require(_0x3c3f('0x0'));var utils=require(_0x3c3f('0x1'));var util=require(_0x3c3f('0x2'));var isXDREnabled=config[_0x3c3f('0x3')]&&config[_0x3c3f('0x3')]['disabled']?!config[_0x3c3f('0x3')][_0x3c3f('0x4')]:!![];var isProduction=config[_0x3c3f('0x5')]===_0x3c3f('0x6')||![];var isLocalAsterisk=config[_0x3c3f('0x3')]&&config[_0x3c3f('0x3')][_0x3c3f('0x7')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x3c3f('0x8')],config['asterisk']['ip'],config[_0x3c3f('0x9')][_0x3c3f('0xa')],config[_0x3c3f('0x9')]['password'],!![]);ami[_0x3c3f('0xb')]();if(!isXDREnabled){utils[_0x3c3f('0xc')](_0x3c3f('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x3c3f('0xc')](_0x3c3f('0xe'));}else{var agents=require(_0x3c3f('0xf'));var calls=require('./calls.controller');var queues=require(_0x3c3f('0x10'));var recordings=require(_0x3c3f('0x11'));var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require(_0x3c3f('0x12'));ami['on'](_0x3c3f('0x13'),core['connect']);ami['on'](_0x3c3f('0x14'),core['shutdown']);ami['on'](_0x3c3f('0x15'),core[_0x3c3f('0x15')]);ami['on']('error',core[_0x3c3f('0x16')]);ami['on'](_0x3c3f('0x17'),core['close']);ami['on'](_0x3c3f('0x18'),core['managerevent']);ami['on'](_0x3c3f('0x19'),function(_0x50943c){try{utils[_0x3c3f('0x1a')](util['format'](_0x3c3f('0x1b'),_0x50943c['device']),_0x50943c);members[_0x3c3f('0x19')](_0x50943c);}catch(_0x2f57e1){utils['error'](util[_0x3c3f('0x1c')](_0x3c3f('0x1b'),_0x50943c['device']),_0x2f57e1);}});ami['on'](_0x3c3f('0x1d'),function(_0x5ade44){try{utils[_0x3c3f('0x1a')](util[_0x3c3f('0x1c')](_0x3c3f('0x1e'),_0x5ade44[_0x3c3f('0x1f')]),_0x5ade44);agents[_0x3c3f('0x1d')](_0x5ade44);}catch(_0x41482b){utils[_0x3c3f('0x16')](util['format'](_0x3c3f('0x1e'),_0x5ade44['uniqueid']),_0x41482b);}});ami['on'](_0x3c3f('0x20'),function(_0x364292){try{utils[_0x3c3f('0x1a')](util[_0x3c3f('0x1c')](_0x3c3f('0x21'),_0x364292['uniqueid']),_0x364292);agents[_0x3c3f('0x20')](_0x364292);}catch(_0x58b742){utils[_0x3c3f('0x16')](util[_0x3c3f('0x1c')](_0x3c3f('0x21'),_0x364292['uniqueid']),_0x58b742);}});ami['on'](_0x3c3f('0x22'),function(_0xe85aa5){try{utils[_0x3c3f('0x1a')](util['format'](_0x3c3f('0x23'),_0xe85aa5['uniqueid']),_0xe85aa5);agents[_0x3c3f('0x22')](_0xe85aa5);queues['agentconnect'](_0xe85aa5);}catch(_0x590530){utils['error'](util['format']('[%s][index][agentconnect]',_0xe85aa5[_0x3c3f('0x1f')]),_0x590530);}});ami['on'](_0x3c3f('0x24'),function(_0x37b277){try{utils[_0x3c3f('0x1a')](util['format'](_0x3c3f('0x25'),_0x37b277[_0x3c3f('0x1f')]),_0x37b277);agents[_0x3c3f('0x24')](_0x37b277);queues['agentcomplete'](_0x37b277);members[_0x3c3f('0x24')](_0x37b277);}catch(_0x2d9f1c){utils[_0x3c3f('0x16')](util[_0x3c3f('0x1c')](_0x3c3f('0x25'),_0x37b277['uniqueid']),_0x2d9f1c);}});ami['on'](_0x3c3f('0x26'),function(_0x3a9c6a){try{utils[_0x3c3f('0x1a')](util['format'](_0x3c3f('0x27'),_0x3a9c6a['uniqueid']),_0x3a9c6a);agents[_0x3c3f('0x26')](_0x3a9c6a);queues[_0x3c3f('0x26')](_0x3a9c6a);}catch(_0x1546f8){utils['error'](util[_0x3c3f('0x1c')](_0x3c3f('0x27'),_0x3a9c6a['uniqueid']),_0x1546f8);}});ami['on'](_0x3c3f('0x28'),function(_0xfc898b){try{utils[_0x3c3f('0x1a')](util['format']('[%s][index][queuecallerjoin]',_0xfc898b[_0x3c3f('0x1f')]),_0xfc898b);queues[_0x3c3f('0x28')](_0xfc898b);recordings[_0x3c3f('0x28')](_0xfc898b);}catch(_0x46c714){utils['error'](util['format'](_0x3c3f('0x29'),_0xfc898b['uniqueid']),_0x46c714);}});ami['on']('queuecallerleave',function(_0x47cf5b){try{utils[_0x3c3f('0x1a')](util['format'](_0x3c3f('0x2a'),_0x47cf5b[_0x3c3f('0x1f')]),_0x47cf5b);queues['queuecallerleave'](_0x47cf5b);}catch(_0x2296ef){utils['error'](util['format'](_0x3c3f('0x2a'),_0x47cf5b[_0x3c3f('0x1f')]),_0x2296ef);}});ami['on'](_0x3c3f('0x2b'),function(_0x4786ef){try{utils[_0x3c3f('0x1a')](util['format'](_0x3c3f('0x2c'),_0x4786ef['uniqueid']),_0x4786ef);queues[_0x3c3f('0x2b')](_0x4786ef);calls['musiconholdstart'](_0x4786ef);}catch(_0x4f86dc){utils[_0x3c3f('0x16')](util['format'](_0x3c3f('0x2c'),_0x4786ef[_0x3c3f('0x1f')]),_0x4f86dc);}});ami['on'](_0x3c3f('0x2d'),function(_0x222d7c){try{utils['debug'](util[_0x3c3f('0x1c')](_0x3c3f('0x2e'),_0x222d7c[_0x3c3f('0x1f')]),_0x222d7c);queues[_0x3c3f('0x2d')](_0x222d7c);calls[_0x3c3f('0x2d')](_0x222d7c);}catch(_0xee044){utils['error'](util[_0x3c3f('0x1c')](_0x3c3f('0x2e'),_0x222d7c[_0x3c3f('0x1f')]),_0xee044);}});ami['on']('newstate',function(_0x1a064c){try{utils['debug'](util[_0x3c3f('0x1c')](_0x3c3f('0x2f'),_0x1a064c['uniqueid']),_0x1a064c);calls[_0x3c3f('0x30')](_0x1a064c);recordings[_0x3c3f('0x30')](_0x1a064c);}catch(_0x260430){utils[_0x3c3f('0x16')](util['format']('[%s][index][newstate]',_0x1a064c[_0x3c3f('0x1f')]),_0x260430);}});ami['on'](_0x3c3f('0x31'),function(_0x5087b7){try{utils[_0x3c3f('0x1a')](util[_0x3c3f('0x1c')](_0x3c3f('0x32'),_0x5087b7[_0x3c3f('0x1f')]),_0x5087b7);calls['hangup'](_0x5087b7);recordings[_0x3c3f('0x31')](_0x5087b7);dials[_0x3c3f('0x31')](_0x5087b7);agents[_0x3c3f('0x31')](_0x5087b7);queues[_0x3c3f('0x31')](_0x5087b7);}catch(_0x127561){utils[_0x3c3f('0x16')](util[_0x3c3f('0x1c')](_0x3c3f('0x32'),_0x5087b7['uniqueid']),_0x127561);}});ami['on'](_0x3c3f('0x33'),function(_0x5257c3){try{utils[_0x3c3f('0x1a')](util[_0x3c3f('0x1c')](_0x3c3f('0x34'),_0x5257c3[_0x3c3f('0x1f')]),_0x5257c3);members[_0x3c3f('0x33')](_0x5257c3);}catch(_0x4336f6){utils['error'](util[_0x3c3f('0x1c')](_0x3c3f('0x34'),_0x5257c3['uniqueid']),_0x4336f6);}});ami['on'](_0x3c3f('0x35'),function(_0x166234){try{utils[_0x3c3f('0x1a')](util[_0x3c3f('0x1c')](_0x3c3f('0x36'),_0x166234[_0x3c3f('0x1f')]),_0x166234);queues[_0x3c3f('0x35')](_0x166234);agents[_0x3c3f('0x35')](_0x166234);transfers['blindtransfer'](_0x166234);recordings[_0x3c3f('0x35')](_0x166234);}catch(_0x5e473b){utils['error'](util[_0x3c3f('0x1c')]('[%s][index][blindtransfer]',_0x166234[_0x3c3f('0x1f')]),_0x5e473b);}});ami['on'](_0x3c3f('0x37'),function(_0x35dfc8){try{utils[_0x3c3f('0x1a')](util[_0x3c3f('0x1c')](_0x3c3f('0x38'),_0x35dfc8['origtransfereruniqueid']),_0x35dfc8);queues['attendedtransfer'](_0x35dfc8);transfers[_0x3c3f('0x37')](_0x35dfc8);agents[_0x3c3f('0x37')](_0x35dfc8);calls['attendedtransfer'](_0x35dfc8);}catch(_0x1869f6){utils['error'](util[_0x3c3f('0x1c')]('[%s][index][attendedtransfer]',_0x35dfc8[_0x3c3f('0x39')]),_0x1869f6);}});ami['on'](_0x3c3f('0x3a'),function(_0x40b804){try{utils[_0x3c3f('0x1a')](util[_0x3c3f('0x1c')]('[%s][index][varset]',_0x40b804[_0x3c3f('0x1f')]),_0x40b804);queues['varset'](_0x40b804);recordings[_0x3c3f('0x3a')](_0x40b804);calls[_0x3c3f('0x3a')](_0x40b804);dials[_0x3c3f('0x3a')](_0x40b804);}catch(_0x2fc750){utils[_0x3c3f('0x16')](util[_0x3c3f('0x1c')](_0x3c3f('0x3b'),_0x40b804[_0x3c3f('0x1f')]),_0x2fc750);}});ami['on']('newexten',function(_0x299c03){try{utils[_0x3c3f('0x1a')](util[_0x3c3f('0x1c')](_0x3c3f('0x3c'),_0x299c03['uniqueid']),_0x299c03);calls['newexten'](_0x299c03);recordings[_0x3c3f('0x3d')](_0x299c03);dials[_0x3c3f('0x3d')](_0x299c03);}catch(_0x4b23f1){utils['error'](util[_0x3c3f('0x1c')]('[%s][index][newexten]',_0x299c03[_0x3c3f('0x1f')]),_0x4b23f1);}});ami['on'](_0x3c3f('0x3e'),function(_0x3e76b9){try{utils[_0x3c3f('0x1a')](util[_0x3c3f('0x1c')](_0x3c3f('0x3f'),_0x3e76b9[_0x3c3f('0x1f')]),_0x3e76b9);calls['newchannel'](_0x3e76b9);recordings['newchannel'](_0x3e76b9);}catch(_0x3b5152){utils[_0x3c3f('0x16')](util['format'](_0x3c3f('0x3f'),_0x3e76b9[_0x3c3f('0x1f')]),_0x3b5152);}});ami['on'](_0x3c3f('0x40'),function(_0x44a54b){try{utils['debug'](util['format'](_0x3c3f('0x41'),_0x44a54b['uniqueid']),_0x44a54b);dials[_0x3c3f('0x40')](_0x44a54b);}catch(_0x3cc724){utils[_0x3c3f('0x16')](util['format'](_0x3c3f('0x42'),_0x44a54b[_0x3c3f('0x1f')]),_0x3cc724);}});ami['on'](_0x3c3f('0x43'),function(_0x37a13c){try{utils['debug'](util[_0x3c3f('0x1c')](_0x3c3f('0x44'),_0x37a13c['uniqueid']),_0x37a13c);dials[_0x3c3f('0x43')](_0x37a13c);}catch(_0x28ba7f){utils[_0x3c3f('0x16')](util[_0x3c3f('0x1c')]('[%s][index][dialend]',_0x37a13c[_0x3c3f('0x1f')]),_0x28ba7f);}});} \ No newline at end of file +var _0x1a2e=['util','xdr','disabled','env','production','local','port','asterisk','username','password','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','device','format','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','origtransfereruniqueid','attendedtransfer','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils'];(function(_0x49bdc4,_0x1e2507){var _0x1f7437=function(_0x25a9f9){while(--_0x25a9f9){_0x49bdc4['push'](_0x49bdc4['shift']());}};_0x1f7437(++_0x1e2507);}(_0x1a2e,0x19c));var _0xe1a2=function(_0x4fa614,_0x4296e5){_0x4fa614=_0x4fa614-0x0;var _0x42ef6e=_0x1a2e[_0x4fa614];return _0x42ef6e;};var AsteriskManager=require(_0xe1a2('0x0'));var config=require('../../config/environment');var utils=require(_0xe1a2('0x1'));var util=require(_0xe1a2('0x2'));var isXDREnabled=config[_0xe1a2('0x3')]&&config['xdr'][_0xe1a2('0x4')]?!config['xdr'][_0xe1a2('0x4')]:!![];var isProduction=config[_0xe1a2('0x5')]===_0xe1a2('0x6')||![];var isLocalAsterisk=config[_0xe1a2('0x3')]&&config[_0xe1a2('0x3')][_0xe1a2('0x7')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0xe1a2('0x8')],config[_0xe1a2('0x9')]['ip'],config[_0xe1a2('0x9')][_0xe1a2('0xa')],config[_0xe1a2('0x9')][_0xe1a2('0xb')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0xe1a2('0xc')](_0xe1a2('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils['info']('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0xe1a2('0xe'));var calls=require(_0xe1a2('0xf'));var queues=require('./queues.controller');var recordings=require(_0xe1a2('0x10'));var members=require(_0xe1a2('0x11'));var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require(_0xe1a2('0x12'));ami['on'](_0xe1a2('0x13'),core[_0xe1a2('0x13')]);ami['on']('shutdown',core[_0xe1a2('0x14')]);ami['on'](_0xe1a2('0x15'),core[_0xe1a2('0x15')]);ami['on'](_0xe1a2('0x16'),core[_0xe1a2('0x16')]);ami['on'](_0xe1a2('0x17'),core[_0xe1a2('0x17')]);ami['on'](_0xe1a2('0x18'),core[_0xe1a2('0x18')]);ami['on'](_0xe1a2('0x19'),function(_0xb3ae86){try{utils[_0xe1a2('0x1a')](util['format'](_0xe1a2('0x1b'),_0xb3ae86[_0xe1a2('0x1c')]),_0xb3ae86);members['devicestatechange'](_0xb3ae86);}catch(_0x19ed63){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x1b'),_0xb3ae86[_0xe1a2('0x1c')]),_0x19ed63);}});ami['on'](_0xe1a2('0x1e'),function(_0x8532c7){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')](_0xe1a2('0x1f'),_0x8532c7[_0xe1a2('0x20')]),_0x8532c7);agents[_0xe1a2('0x1e')](_0x8532c7);}catch(_0x2e2982){utils[_0xe1a2('0x16')](util['format']('[%s][index][agentcalled]',_0x8532c7[_0xe1a2('0x20')]),_0x2e2982);}});ami['on']('agentringnoanswer',function(_0x471d76){try{utils['debug'](util[_0xe1a2('0x1d')](_0xe1a2('0x21'),_0x471d76[_0xe1a2('0x20')]),_0x471d76);agents[_0xe1a2('0x22')](_0x471d76);}catch(_0x59b958){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x21'),_0x471d76[_0xe1a2('0x20')]),_0x59b958);}});ami['on'](_0xe1a2('0x23'),function(_0x13bb2b){try{utils[_0xe1a2('0x1a')](util['format'](_0xe1a2('0x24'),_0x13bb2b[_0xe1a2('0x20')]),_0x13bb2b);agents['agentconnect'](_0x13bb2b);queues[_0xe1a2('0x23')](_0x13bb2b);}catch(_0x2cd4c7){utils['error'](util['format']('[%s][index][agentconnect]',_0x13bb2b['uniqueid']),_0x2cd4c7);}});ami['on'](_0xe1a2('0x25'),function(_0x4b9782){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')]('[%s][index][agentcomplete]',_0x4b9782['uniqueid']),_0x4b9782);agents[_0xe1a2('0x25')](_0x4b9782);queues['agentcomplete'](_0x4b9782);members[_0xe1a2('0x25')](_0x4b9782);}catch(_0x1ba16b){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')]('[%s][index][agentcomplete]',_0x4b9782[_0xe1a2('0x20')]),_0x1ba16b);}});ami['on'](_0xe1a2('0x26'),function(_0x28c183){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')](_0xe1a2('0x27'),_0x28c183['uniqueid']),_0x28c183);agents[_0xe1a2('0x26')](_0x28c183);queues[_0xe1a2('0x26')](_0x28c183);}catch(_0x4e91db){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')]('[%s][index][queuecallerabandon]',_0x28c183[_0xe1a2('0x20')]),_0x4e91db);}});ami['on'](_0xe1a2('0x28'),function(_0x4a3b40){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')](_0xe1a2('0x29'),_0x4a3b40[_0xe1a2('0x20')]),_0x4a3b40);queues[_0xe1a2('0x28')](_0x4a3b40);recordings[_0xe1a2('0x28')](_0x4a3b40);}catch(_0x378081){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x29'),_0x4a3b40[_0xe1a2('0x20')]),_0x378081);}});ami['on'](_0xe1a2('0x2a'),function(_0x13cc2c){try{utils['debug'](util[_0xe1a2('0x1d')](_0xe1a2('0x2b'),_0x13cc2c[_0xe1a2('0x20')]),_0x13cc2c);queues[_0xe1a2('0x2a')](_0x13cc2c);}catch(_0xbf594e){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')]('[%s][index][queuecallerleave]',_0x13cc2c[_0xe1a2('0x20')]),_0xbf594e);}});ami['on']('musiconholdstart',function(_0x531678){try{utils['debug'](util['format'](_0xe1a2('0x2c'),_0x531678[_0xe1a2('0x20')]),_0x531678);queues[_0xe1a2('0x2d')](_0x531678);calls[_0xe1a2('0x2d')](_0x531678);}catch(_0x5e9a59){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x2c'),_0x531678[_0xe1a2('0x20')]),_0x5e9a59);}});ami['on']('musiconholdstop',function(_0x15ce0e){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')]('[%s][index][musiconholdstop]',_0x15ce0e[_0xe1a2('0x20')]),_0x15ce0e);queues[_0xe1a2('0x2e')](_0x15ce0e);calls[_0xe1a2('0x2e')](_0x15ce0e);}catch(_0x2fa01a){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')]('[%s][index][musiconholdstop]',_0x15ce0e[_0xe1a2('0x20')]),_0x2fa01a);}});ami['on'](_0xe1a2('0x2f'),function(_0x9ae94){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')](_0xe1a2('0x30'),_0x9ae94[_0xe1a2('0x20')]),_0x9ae94);calls[_0xe1a2('0x2f')](_0x9ae94);recordings['newstate'](_0x9ae94);}catch(_0x1a4366){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x30'),_0x9ae94[_0xe1a2('0x20')]),_0x1a4366);}});ami['on'](_0xe1a2('0x31'),function(_0x270625){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')]('[%s][index][hangup]',_0x270625[_0xe1a2('0x20')]),_0x270625);calls[_0xe1a2('0x31')](_0x270625);recordings[_0xe1a2('0x31')](_0x270625);dials[_0xe1a2('0x31')](_0x270625);agents[_0xe1a2('0x31')](_0x270625);queues[_0xe1a2('0x31')](_0x270625);}catch(_0x4eb8bf){utils[_0xe1a2('0x16')](util['format'](_0xe1a2('0x32'),_0x270625['uniqueid']),_0x4eb8bf);}});ami['on']('cdr',function(_0x39cb35){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')](_0xe1a2('0x33'),_0x39cb35[_0xe1a2('0x20')]),_0x39cb35);members[_0xe1a2('0x34')](_0x39cb35);}catch(_0x44b107){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x33'),_0x39cb35['uniqueid']),_0x44b107);}});ami['on'](_0xe1a2('0x35'),function(_0x533029){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')]('[%s][index][blindtransfer]',_0x533029[_0xe1a2('0x20')]),_0x533029);queues[_0xe1a2('0x35')](_0x533029);agents[_0xe1a2('0x35')](_0x533029);transfers[_0xe1a2('0x35')](_0x533029);recordings['blindtransfer'](_0x533029);}catch(_0x5c12f5){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x36'),_0x533029[_0xe1a2('0x20')]),_0x5c12f5);}});ami['on']('attendedtransfer',function(_0xe51dfc){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')]('[%s][index][attendedtransfer]',_0xe51dfc[_0xe1a2('0x37')]),_0xe51dfc);queues['attendedtransfer'](_0xe51dfc);transfers['attendedtransfer'](_0xe51dfc);agents['attendedtransfer'](_0xe51dfc);calls[_0xe1a2('0x38')](_0xe51dfc);}catch(_0x374256){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x39'),_0xe51dfc[_0xe1a2('0x37')]),_0x374256);}});ami['on'](_0xe1a2('0x3a'),function(_0x553308){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')](_0xe1a2('0x3b'),_0x553308[_0xe1a2('0x20')]),_0x553308);queues['varset'](_0x553308);recordings['varset'](_0x553308);calls[_0xe1a2('0x3a')](_0x553308);dials[_0xe1a2('0x3a')](_0x553308);}catch(_0xdd6d8a){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x3b'),_0x553308[_0xe1a2('0x20')]),_0xdd6d8a);}});ami['on'](_0xe1a2('0x3c'),function(_0x3a754c){try{utils['debug'](util['format']('[%s][index][newexten]',_0x3a754c[_0xe1a2('0x20')]),_0x3a754c);calls[_0xe1a2('0x3c')](_0x3a754c);recordings['newexten'](_0x3a754c);dials[_0xe1a2('0x3c')](_0x3a754c);}catch(_0x4a3cc6){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x3d'),_0x3a754c[_0xe1a2('0x20')]),_0x4a3cc6);}});ami['on'](_0xe1a2('0x3e'),function(_0x545f65){try{utils[_0xe1a2('0x1a')](util[_0xe1a2('0x1d')](_0xe1a2('0x3f'),_0x545f65[_0xe1a2('0x20')]),_0x545f65);calls['newchannel'](_0x545f65);recordings['newchannel'](_0x545f65);}catch(_0x2d72a4){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x3f'),_0x545f65[_0xe1a2('0x20')]),_0x2d72a4);}});ami['on'](_0xe1a2('0x40'),function(_0x3dd8c8){try{utils[_0xe1a2('0x1a')](util['format'](_0xe1a2('0x41'),_0x3dd8c8['uniqueid']),_0x3dd8c8);dials[_0xe1a2('0x40')](_0x3dd8c8);}catch(_0x224b59){utils[_0xe1a2('0x16')](util[_0xe1a2('0x1d')](_0xe1a2('0x42'),_0x3dd8c8[_0xe1a2('0x20')]),_0x224b59);}});ami['on'](_0xe1a2('0x43'),function(_0x3695e7){try{utils[_0xe1a2('0x1a')](util['format'](_0xe1a2('0x44'),_0x3695e7['uniqueid']),_0x3695e7);dials[_0xe1a2('0x43')](_0x3695e7);}catch(_0x2cb000){utils[_0xe1a2('0x16')](util['format'](_0xe1a2('0x44'),_0x3695e7[_0xe1a2('0x20')]),_0x2cb000);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 530b397..76553c4 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 _0xc678=['[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','membername','type','getUserByInterface','interface','then','internal','request','CreateMemberReport','getUserByName','split','startsWith','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','TALKING','now','agent','NOT_INUSE','exitAt','duration','error','agentcomplete','isNil','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','data2','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','source','./utils','Local/_attended@transfer','Queue:','info','format'];(function(_0x5c3596,_0x18c2bb){var _0x4b1e03=function(_0x1d7d06){while(--_0x1d7d06){_0x5c3596['push'](_0x5c3596['shift']());}};_0x4b1e03(++_0x18c2bb);}(_0xc678,0x1b4));var _0x8c67=function(_0x5dedb5,_0x1e3333){_0x5dedb5=_0x5dedb5-0x0;var _0x760ae3=_0xc678[_0x5dedb5];return _0x760ae3;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x8c67('0x0'));var members={};var exclude=[_0x8c67('0x1'),_0x8c67('0x2')];function writeDB(_0x4e359d){utils[_0x8c67('0x3')](util[_0x8c67('0x4')](_0x8c67('0x5'),_0x4e359d[_0x8c67('0x6')],_0x4e359d['interface'],_0x4e359d[_0x8c67('0x7')],_0x4e359d['data2'],_0x4e359d[_0x8c67('0x8')],_0x4e359d[_0x8c67('0x9')]));if(_0x4e359d['interface']){utils[_0x8c67('0xa')](_0x4e359d[_0x8c67('0xb')])[_0x8c67('0xc')](function(_0x10aa60){if(_0x10aa60){_0x4e359d[_0x8c67('0x8')]=_0x10aa60['name'];_0x4e359d[_0x8c67('0xd')]=_0x10aa60['internal'];utils[_0x8c67('0xe')](_0x8c67('0xf'),_0x4e359d);}else{utils[_0x8c67('0x10')](_0x4e359d['interface'][_0x8c67('0x11')]('/')[0x1])[_0x8c67('0xc')](function(_0x136cd){if(_0x136cd){_0x4e359d[_0x8c67('0x8')]=_0x136cd['name'];_0x4e359d[_0x8c67('0xd')]=_0x136cd['internal'];utils['request']('CreateMemberReport',_0x4e359d);}});}})['catch'](function(_0x284f6c){utils['error'](util[_0x8c67('0x4')]('[%s][members][writeDB]',_0x4e359d[_0x8c67('0x6')]),_0x284f6c);});}delete members[_0x4e359d[_0x8c67('0xb')]];}function startsWith(_0x28fbb0,_0x3b20df){return _['some'](_0x28fbb0,function(_0x3be259){return _[_0x8c67('0x12')](_0x3b20df,_0x3be259);});}exports[_0x8c67('0x13')]=function(_0x1bae2f){try{utils['debug'](util['format'](_0x8c67('0x14'),members[_0x1bae2f[_0x8c67('0x15')]]?members[_0x1bae2f[_0x8c67('0x15')]]['uniqueid']:_0x1bae2f[_0x8c67('0x15')]),_0x1bae2f);utils[_0x8c67('0x3')](util['format'](_0x8c67('0x16'),members[_0x1bae2f['device']]?members[_0x1bae2f[_0x8c67('0x15')]][_0x8c67('0x6')]:_0x1bae2f[_0x8c67('0x15')],_0x1bae2f[_0x8c67('0x17')],_0x1bae2f[_0x8c67('0x15')]));switch(_0x1bae2f['state']){case _0x8c67('0x18'):case _0x8c67('0x19'):if(!startsWith(exclude,_0x1bae2f['device'])){members[_0x1bae2f[_0x8c67('0x15')]]={'channel':'voice','interface':_0x1bae2f[_0x8c67('0x15')],'type':_0x8c67('0x1a'),'enterAt':utils[_0x8c67('0x1b')](),'role':_0x8c67('0x1c')};}break;case _0x8c67('0x1d'):if(!_['isNil'](members[_0x1bae2f[_0x8c67('0x15')]])){members[_0x1bae2f[_0x8c67('0x15')]][_0x8c67('0x1e')]=utils[_0x8c67('0x1b')]();members[_0x1bae2f[_0x8c67('0x15')]][_0x8c67('0x1f')]=utils['diffTime'](members[_0x1bae2f['device']][_0x8c67('0x1e')],members[_0x1bae2f['device']]['enterAt']);if(members[_0x1bae2f[_0x8c67('0x15')]][_0x8c67('0x6')]){writeDB(members[_0x1bae2f[_0x8c67('0x15')]]);}}break;default:break;}}catch(_0x506a77){utils[_0x8c67('0x20')](util[_0x8c67('0x4')](_0x8c67('0x14'),members[_0x1bae2f[_0x8c67('0x15')]]?members[_0x1bae2f['device']][_0x8c67('0x6')]:_0x1bae2f[_0x8c67('0x15')]),_0x506a77);}};exports[_0x8c67('0x21')]=function(_0x4768c4){try{if(!_[_0x8c67('0x22')](members[_0x4768c4[_0x8c67('0xb')]])){utils[_0x8c67('0x23')](util['format'](_0x8c67('0x24'),_0x4768c4[_0x8c67('0x6')]),_0x4768c4);utils[_0x8c67('0x3')](util[_0x8c67('0x4')](_0x8c67('0x25'),_0x4768c4['uniqueid'],_0x4768c4['interface'],_0x4768c4[_0x8c67('0x26')]));members[_0x4768c4[_0x8c67('0xb')]]=_[_0x8c67('0x27')](members[_0x4768c4[_0x8c67('0xb')]],{'data4':_0x4768c4[_0x8c67('0x26')],'uniqueid':_0x4768c4['uniqueid']});}}catch(_0x5c1dcb){utils[_0x8c67('0x20')](util[_0x8c67('0x4')](_0x8c67('0x24'),_0x4768c4['uniqueid']),_0x5c1dcb);}};exports[_0x8c67('0x28')]=function(_0x1f5a0b){try{utils['debug'](util['format'](_0x8c67('0x29'),_0x1f5a0b['uniqueid']),_0x1f5a0b);if(_0x1f5a0b['channel']){var _0x2a855a=_0x1f5a0b[_0x8c67('0x7')][_0x8c67('0x11')]('-')[0x0];if(!_[_0x8c67('0x22')](members[_0x2a855a])){members[_0x2a855a]=_[_0x8c67('0x27')](members[_0x2a855a],{'data1':members[_0x2a855a][_0x8c67('0x2a')]||_0x1f5a0b[_0x8c67('0x9')],'data2':members[_0x2a855a][_0x8c67('0x2b')]||_0x1f5a0b['source'],'data3':members[_0x2a855a]['data3']||_0x1f5a0b[_0x8c67('0x2c')],'uniqueid':members[_0x2a855a]['uniqueid']||_0x1f5a0b[_0x8c67('0x6')]});utils['info'](util[_0x8c67('0x4')](_0x8c67('0x2d'),_0x1f5a0b[_0x8c67('0x6')],members[_0x2a855a][_0x8c67('0x2a')],members[_0x2a855a]['data2'],members[_0x2a855a][_0x8c67('0x2e')]));if(members[_0x2a855a][_0x8c67('0x1e')]){writeDB(members[_0x2a855a]);}}}if(_0x1f5a0b['destinationchannel']){var _0x64ec58=_0x1f5a0b[_0x8c67('0x2f')][_0x8c67('0x11')]('-')[0x0];if(!_['isNil'](members[_0x64ec58])){members[_0x64ec58]=_['assign'](members[_0x64ec58],{'data1':members[_0x64ec58][_0x8c67('0x2a')]||_0x1f5a0b[_0x8c67('0x9')],'data2':members[_0x64ec58]['data2']||_0x1f5a0b[_0x8c67('0x30')],'data3':members[_0x64ec58][_0x8c67('0x2e')]||_0x1f5a0b[_0x8c67('0x2c')],'uniqueid':members[_0x64ec58][_0x8c67('0x6')]||_0x1f5a0b['uniqueid']});utils['info'](util[_0x8c67('0x4')](_0x8c67('0x2d'),_0x1f5a0b['uniqueid'],members[_0x64ec58]['data1'],members[_0x64ec58][_0x8c67('0x2b')],members[_0x64ec58][_0x8c67('0x2e')]));if(members[_0x64ec58][_0x8c67('0x1e')]){writeDB(members[_0x64ec58]);}}}}catch(_0xd6dc2f){utils[_0x8c67('0x20')](util[_0x8c67('0x4')](_0x8c67('0x29'),_0x1f5a0b[_0x8c67('0x6')]),_0xd6dc2f);}}; \ No newline at end of file +var _0x861c=['util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','split','error','[%s][members][writeDB]','some','startsWith','devicestatechange','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][devicestatechange]','agentcomplete','debug','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','data2','lodash'];(function(_0x55c1f0,_0x4f574f){var _0x1530fa=function(_0x631542){while(--_0x631542){_0x55c1f0['push'](_0x55c1f0['shift']());}};_0x1530fa(++_0x4f574f);}(_0x861c,0xdb));var _0xc861=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x861c[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xc861('0x0'));var util=require(_0xc861('0x1'));var utils=require(_0xc861('0x2'));var members={};var exclude=[_0xc861('0x3'),_0xc861('0x4')];function writeDB(_0x200550){utils[_0xc861('0x5')](util[_0xc861('0x6')](_0xc861('0x7'),_0x200550[_0xc861('0x8')],_0x200550[_0xc861('0x9')],_0x200550[_0xc861('0xa')],_0x200550['data2'],_0x200550[_0xc861('0xb')],_0x200550[_0xc861('0xc')]));if(_0x200550[_0xc861('0x9')]){utils[_0xc861('0xd')](_0x200550[_0xc861('0x9')])[_0xc861('0xe')](function(_0x3c9cd6){if(_0x3c9cd6){_0x200550[_0xc861('0xb')]=_0x3c9cd6[_0xc861('0xf')];_0x200550[_0xc861('0x10')]=_0x3c9cd6[_0xc861('0x10')];utils[_0xc861('0x11')](_0xc861('0x12'),_0x200550);}else{utils['getUserByName'](_0x200550[_0xc861('0x9')][_0xc861('0x13')]('/')[0x1])[_0xc861('0xe')](function(_0x43e524){if(_0x43e524){_0x200550['membername']=_0x43e524[_0xc861('0xf')];_0x200550[_0xc861('0x10')]=_0x43e524[_0xc861('0x10')];utils[_0xc861('0x11')]('CreateMemberReport',_0x200550);}});}})['catch'](function(_0x210ceb){utils[_0xc861('0x14')](util['format'](_0xc861('0x15'),_0x200550[_0xc861('0x8')]),_0x210ceb);});}delete members[_0x200550['interface']];}function startsWith(_0x21941e,_0x3ca46d){return _[_0xc861('0x16')](_0x21941e,function(_0xd8e34a){return _[_0xc861('0x17')](_0x3ca46d,_0xd8e34a);});}exports[_0xc861('0x18')]=function(_0x5d6040){try{utils['debug'](util[_0xc861('0x6')]('[%s][members][devicestatechange]',members[_0x5d6040[_0xc861('0x19')]]?members[_0x5d6040[_0xc861('0x19')]][_0xc861('0x8')]:_0x5d6040['device']),_0x5d6040);utils[_0xc861('0x5')](util['format'](_0xc861('0x1a'),members[_0x5d6040[_0xc861('0x19')]]?members[_0x5d6040[_0xc861('0x19')]][_0xc861('0x8')]:_0x5d6040[_0xc861('0x19')],_0x5d6040[_0xc861('0x1b')],_0x5d6040[_0xc861('0x19')]));switch(_0x5d6040[_0xc861('0x1b')]){case _0xc861('0x1c'):case _0xc861('0x1d'):if(!startsWith(exclude,_0x5d6040[_0xc861('0x19')])){members[_0x5d6040[_0xc861('0x19')]]={'channel':_0xc861('0x1e'),'interface':_0x5d6040[_0xc861('0x19')],'type':_0xc861('0x1f'),'enterAt':utils[_0xc861('0x20')](),'role':'agent'};}break;case _0xc861('0x21'):if(!_[_0xc861('0x22')](members[_0x5d6040[_0xc861('0x19')]])){members[_0x5d6040[_0xc861('0x19')]][_0xc861('0x23')]=utils[_0xc861('0x20')]();members[_0x5d6040['device']][_0xc861('0x24')]=utils[_0xc861('0x25')](members[_0x5d6040[_0xc861('0x19')]][_0xc861('0x23')],members[_0x5d6040[_0xc861('0x19')]][_0xc861('0x26')]);if(members[_0x5d6040['device']][_0xc861('0x8')]){writeDB(members[_0x5d6040['device']]);}}break;default:break;}}catch(_0x5af598){utils['error'](util[_0xc861('0x6')](_0xc861('0x27'),members[_0x5d6040[_0xc861('0x19')]]?members[_0x5d6040[_0xc861('0x19')]][_0xc861('0x8')]:_0x5d6040[_0xc861('0x19')]),_0x5af598);}};exports[_0xc861('0x28')]=function(_0x5c205a){try{if(!_['isNil'](members[_0x5c205a[_0xc861('0x9')]])){utils[_0xc861('0x29')](util[_0xc861('0x6')]('[%s][members][agentcomplete]',_0x5c205a[_0xc861('0x8')]),_0x5c205a);utils['info'](util[_0xc861('0x6')](_0xc861('0x2a'),_0x5c205a[_0xc861('0x8')],_0x5c205a[_0xc861('0x9')],_0x5c205a['queue']));members[_0x5c205a[_0xc861('0x9')]]=_[_0xc861('0x2b')](members[_0x5c205a[_0xc861('0x9')]],{'data4':_0x5c205a[_0xc861('0x2c')],'uniqueid':_0x5c205a[_0xc861('0x8')]});}}catch(_0x2b9ee9){utils[_0xc861('0x14')](util[_0xc861('0x6')](_0xc861('0x2d'),_0x5c205a['uniqueid']),_0x2b9ee9);}};exports[_0xc861('0x2e')]=function(_0x514f54){try{utils[_0xc861('0x29')](util[_0xc861('0x6')](_0xc861('0x2f'),_0x514f54[_0xc861('0x8')]),_0x514f54);if(_0x514f54[_0xc861('0xa')]){var _0x2dbef7=_0x514f54[_0xc861('0xa')][_0xc861('0x13')]('-')[0x0];if(!_[_0xc861('0x22')](members[_0x2dbef7])){members[_0x2dbef7]=_[_0xc861('0x2b')](members[_0x2dbef7],{'data1':members[_0x2dbef7][_0xc861('0x30')]||_0x514f54[_0xc861('0xc')],'data2':members[_0x2dbef7]['data2']||_0x514f54[_0xc861('0x31')],'data3':members[_0x2dbef7][_0xc861('0x32')]||_0x514f54[_0xc861('0x33')],'uniqueid':members[_0x2dbef7][_0xc861('0x8')]||_0x514f54[_0xc861('0x8')]});utils[_0xc861('0x5')](util[_0xc861('0x6')](_0xc861('0x34'),_0x514f54[_0xc861('0x8')],members[_0x2dbef7][_0xc861('0x30')],members[_0x2dbef7]['data2'],members[_0x2dbef7][_0xc861('0x32')]));if(members[_0x2dbef7]['exitAt']){writeDB(members[_0x2dbef7]);}}}if(_0x514f54[_0xc861('0x35')]){var _0x3afab2=_0x514f54[_0xc861('0x35')][_0xc861('0x13')]('-')[0x0];if(!_['isNil'](members[_0x3afab2])){members[_0x3afab2]=_['assign'](members[_0x3afab2],{'data1':members[_0x3afab2][_0xc861('0x30')]||_0x514f54['type'],'data2':members[_0x3afab2][_0xc861('0x36')]||_0x514f54[_0xc861('0x31')],'data3':members[_0x3afab2][_0xc861('0x32')]||_0x514f54['destination'],'uniqueid':members[_0x3afab2]['uniqueid']||_0x514f54[_0xc861('0x8')]});utils['info'](util[_0xc861('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x514f54[_0xc861('0x8')],members[_0x3afab2][_0xc861('0x30')],members[_0x3afab2][_0xc861('0x36')],members[_0x3afab2][_0xc861('0x32')]));if(members[_0x3afab2][_0xc861('0x23')]){writeDB(members[_0x3afab2]);}}}}catch(_0x24ce01){utils[_0xc861('0x14')](util[_0xc861('0x6')](_0xc861('0x2f'),_0x514f54[_0xc861('0x8')]),_0x24ce01);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index d1f15ca..a75bf57 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 _0xf1df=['[%s][queues][agentcomplete]','queuecallercompleteAt','reason','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfer','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDED','transferexten','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','uniqueid','channel','lastAssignedTo','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','format','[%s][queues][queuecallerjoin]','hangup','isNil','queuecallerleaveAt','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','info','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','[%s][queues][varset]','queuestatus','value','toUpperCase','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandon','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','membername','agentcomplete'];(function(_0x48ce47,_0xf0cac1){var _0x1a85bc=function(_0x2154af){while(--_0x2154af){_0x48ce47['push'](_0x48ce47['shift']());}};_0x1a85bc(++_0xf0cac1);}(_0xf1df,0x8e));var _0xff1d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf1df[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0xff1d('0x0'));var utils=require(_0xff1d('0x1'));var queues={};function writeDB(_0x384da4){utils['info'](util['format']('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x384da4[_0xff1d('0x2')],_0x384da4[_0xff1d('0x3')],_0x384da4['queue'],_0x384da4[_0xff1d('0x4')],_0x384da4['calleridnum'],_0x384da4[_0xff1d('0x5')],_0x384da4[_0xff1d('0x6')]));if(_0x384da4[_0xff1d('0x7')]){utils[_0xff1d('0x8')](_0x384da4[_0xff1d('0x7')])[_0xff1d('0x9')](function(_0xe5869b){if(_0xe5869b){_0x384da4[_0xff1d('0xa')]=_0xe5869b['type'];}utils[_0xff1d('0xb')](_0xff1d('0xc'),_0x384da4);});}else{utils[_0xff1d('0xb')](_0xff1d('0xc'),_0x384da4);}if(_0x384da4[_0xff1d('0xd')]){delete queues[_0x384da4[_0xff1d('0xd')]];}else{delete queues[_0x384da4['uniqueid']];}}exports['queuecallerjoin']=function(_0xbeec6d){try{utils[_0xff1d('0xe')](util['format']('[%s][queues][queuecallerjoin]',_0xbeec6d[_0xff1d('0x2')]),_0xbeec6d);utils['info'](util['format'](_0xff1d('0xf'),_0xbeec6d[_0xff1d('0x2')],_0xbeec6d[_0xff1d('0x7')],_0xbeec6d['position']));queues[_0xbeec6d['uniqueid']]=_[_0xff1d('0x10')](_0xbeec6d,{'originalposition':_0xbeec6d[_0xff1d('0x11')],'queuecallerjoinAt':utils[_0xff1d('0x12')](),'mohtime':0x0});}catch(_0x4e3bc3){utils[_0xff1d('0x13')](util[_0xff1d('0x14')](_0xff1d('0x15'),_0xbeec6d[_0xff1d('0x2')]),_0x4e3bc3);}};exports[_0xff1d('0x16')]=function(_0x38cf12){try{if(!_[_0xff1d('0x17')](queues[_0x38cf12[_0xff1d('0x2')]])){utils['debug'](util[_0xff1d('0x14')]('[%s][queues][hangup]',_0x38cf12[_0xff1d('0x2')]),_0x38cf12);if(queues[_0x38cf12[_0xff1d('0x2')]][_0xff1d('0x18')]){if(!queues[_0x38cf12[_0xff1d('0x2')]]['queuecallerabandon']&&!queues[_0x38cf12[_0xff1d('0x2')]][_0xff1d('0x19')]){queues[_0x38cf12[_0xff1d('0x2')]][_0xff1d('0x1a')]=!![];queues[_0x38cf12[_0xff1d('0x2')]]['queuecallercompleteAt']=utils[_0xff1d('0x12')]();queues[_0x38cf12['uniqueid']][_0xff1d('0x6')]=_0xff1d('0x1b');}utils[_0xff1d('0x1c')](util[_0xff1d('0x14')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x38cf12['uniqueid'],queues[_0x38cf12[_0xff1d('0x2')]][_0xff1d('0x1d')],queues[_0x38cf12[_0xff1d('0x2')]][_0xff1d('0x6')]));writeDB(queues[_0x38cf12[_0xff1d('0x2')]]);}else if(queues[_0x38cf12[_0xff1d('0x2')]][_0xff1d('0xd')]){utils[_0xff1d('0x1c')](util[_0xff1d('0x14')](_0xff1d('0x1e'),_0x38cf12['uniqueid'],queues[_0x38cf12['uniqueid']][_0xff1d('0x1d')],queues[_0x38cf12[_0xff1d('0x2')]][_0xff1d('0xd')]));queues[queues[_0x38cf12[_0xff1d('0x2')]][_0xff1d('0xd')]]=queues[_0x38cf12['uniqueid']];queues[queues[_0x38cf12[_0xff1d('0x2')]]['transfereduniqueid']][_0xff1d('0x1f')]=0x2;delete queues[_0x38cf12[_0xff1d('0x2')]];}}}catch(_0x14da69){utils['error'](util[_0xff1d('0x14')](_0xff1d('0x20'),_0x38cf12[_0xff1d('0x2')]),_0x14da69);}};exports['varset']=function(_0x4e3685){try{utils[_0xff1d('0xe')](util[_0xff1d('0x14')](_0xff1d('0x21'),_0x4e3685[_0xff1d('0x2')]),_0x4e3685);if(!_[_0xff1d('0x17')](_0x4e3685['variable'][_0xff1d('0x22')])&&_0x4e3685[_0xff1d('0x23')][_0xff1d('0x24')]()!=='CONTINUE'){if(!_[_0xff1d('0x17')](queues[_0x4e3685[_0xff1d('0x2')]])){queues[_0x4e3685['uniqueid']]['queuecallerabandon']=![];queues[_0x4e3685['uniqueid']]['queuecallerabandonAt']=null;queues[_0x4e3685[_0xff1d('0x2')]][_0xff1d('0x19')]=!![];queues[_0x4e3685[_0xff1d('0x2')]][_0xff1d('0x25')]=utils[_0xff1d('0x12')]();queues[_0x4e3685[_0xff1d('0x2')]]['queuecallerexitreason']=_0x4e3685['value']['toUpperCase']();utils[_0xff1d('0x1c')](util[_0xff1d('0x14')](_0xff1d('0x26'),_0x4e3685['uniqueid'],queues[_0x4e3685[_0xff1d('0x2')]]['name'],_0x4e3685[_0xff1d('0x23')],queues[_0x4e3685[_0xff1d('0x2')]][_0xff1d('0x6')]));writeDB(queues[_0x4e3685[_0xff1d('0x2')]]);}}else if(!_[_0xff1d('0x17')](_0x4e3685['variable'][_0xff1d('0x27')])){if(!_[_0xff1d('0x17')](queues[_0x4e3685[_0xff1d('0x2')]])&&!queues[_0x4e3685[_0xff1d('0x2')]][_0xff1d('0x28')]){queues[_0x4e3685[_0xff1d('0x2')]]['queuecallerabandon']=![];queues[_0x4e3685['uniqueid']][_0xff1d('0x29')]=null;queues[_0x4e3685[_0xff1d('0x2')]][_0xff1d('0x19')]=!![];queues[_0x4e3685[_0xff1d('0x2')]]['queuecallerexitAt']=utils[_0xff1d('0x12')]();queues[_0x4e3685[_0xff1d('0x2')]][_0xff1d('0x6')]=_0xff1d('0x2a');utils[_0xff1d('0x1c')](util['format'](_0xff1d('0x2b'),_0x4e3685[_0xff1d('0x2')],queues[_0x4e3685[_0xff1d('0x2')]][_0xff1d('0x1d')],_0x4e3685['value'],queues[_0x4e3685[_0xff1d('0x2')]][_0xff1d('0x6')]));}}}catch(_0x1334ae){utils[_0xff1d('0x13')](util[_0xff1d('0x14')]('[%s][queues][varset]',_0x4e3685[_0xff1d('0x2')]),_0x1334ae);}};exports['queuecallerabandon']=function(_0x3ccb67){try{if(!_[_0xff1d('0x17')](queues[_0x3ccb67[_0xff1d('0x2')]])){utils['debug'](util[_0xff1d('0x14')](_0xff1d('0x2c'),_0x3ccb67[_0xff1d('0x2')]),_0x3ccb67);queues[_0x3ccb67[_0xff1d('0x2')]]['queuecallerexit']=![];queues[_0x3ccb67['uniqueid']][_0xff1d('0x25')]=null;queues[_0x3ccb67['uniqueid']]['queuecallerabandon']=!![];queues[_0x3ccb67['uniqueid']][_0xff1d('0x29')]=utils[_0xff1d('0x12')]();queues[_0x3ccb67['uniqueid']][_0xff1d('0x6')]=_0xff1d('0x2d');utils[_0xff1d('0x1c')](util[_0xff1d('0x14')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x3ccb67['uniqueid'],queues[_0x3ccb67[_0xff1d('0x2')]]['name'],queues[_0x3ccb67['uniqueid']]['queuecallerexitreason']));}}catch(_0x110754){utils[_0xff1d('0x13')](util[_0xff1d('0x14')](_0xff1d('0x2c'),_0x3ccb67['uniqueid']),_0x110754);}};exports[_0xff1d('0x2e')]=function(_0x18bb88){try{if(!_[_0xff1d('0x17')](queues[_0x18bb88['uniqueid']])){utils[_0xff1d('0xe')](util[_0xff1d('0x14')]('[%s][queues][queuecallerleave]',_0x18bb88[_0xff1d('0x2')]),_0x18bb88);utils[_0xff1d('0x1c')](util[_0xff1d('0x14')](_0xff1d('0x2f'),_0x18bb88[_0xff1d('0x2')],queues[_0x18bb88[_0xff1d('0x2')]]['name'],_0x18bb88['connectedlinenum'],_0x18bb88[_0xff1d('0x30')]));queues[_0x18bb88['uniqueid']][_0xff1d('0x2e')]=!![];queues[_0x18bb88['uniqueid']]['queuecallerleaveAt']=utils[_0xff1d('0x12')]();queues[_0x18bb88[_0xff1d('0x2')]][_0xff1d('0x31')]=utils[_0xff1d('0x32')](queues[_0x18bb88[_0xff1d('0x2')]][_0xff1d('0x18')],queues[_0x18bb88[_0xff1d('0x2')]][_0xff1d('0x33')]);queues[_0x18bb88[_0xff1d('0x2')]][_0xff1d('0x11')]=_0x18bb88['position'];queues[_0x18bb88[_0xff1d('0x2')]][_0xff1d('0x34')]=_0x18bb88['count'];queues[_0x18bb88[_0xff1d('0x2')]][_0xff1d('0x35')]=_0x18bb88[_0xff1d('0x35')];queues[_0x18bb88[_0xff1d('0x2')]][_0xff1d('0x30')]=_0x18bb88['connectedlinename'];}}catch(_0x1fbe41){utils[_0xff1d('0x13')](util[_0xff1d('0x14')](_0xff1d('0x36'),_0x18bb88['uniqueid']),_0x1fbe41);}};exports[_0xff1d('0x37')]=function(_0x593590){try{if(!_['isNil'](queues[_0x593590[_0xff1d('0x2')]])){utils['debug'](util[_0xff1d('0x14')](_0xff1d('0x38'),_0x593590['uniqueid']),_0x593590);utils[_0xff1d('0x1c')](util[_0xff1d('0x14')](_0xff1d('0x39'),_0x593590['uniqueid'],queues[_0x593590[_0xff1d('0x2')]][_0xff1d('0x1d')],_0x593590['membername'],_0x593590[_0xff1d('0x3a')]));queues[_0x593590[_0xff1d('0x2')]][_0xff1d('0x28')]=![];queues[_0x593590[_0xff1d('0x2')]][_0xff1d('0x28')]=![];queues[_0x593590[_0xff1d('0x2')]]['queuecallerabandonAt']=null;queues[_0x593590[_0xff1d('0x2')]][_0xff1d('0x19')]=![];queues[_0x593590[_0xff1d('0x2')]][_0xff1d('0x6')]=null;queues[_0x593590[_0xff1d('0x2')]][_0xff1d('0x25')]=null;queues[_0x593590[_0xff1d('0x2')]][_0xff1d('0x3b')]=!![];queues[_0x593590['uniqueid']]['accountcode']=_0x593590['destaccountcode'];queues[_0x593590['uniqueid']][_0xff1d('0x4')]=_0x593590[_0xff1d('0x3c')];}}catch(_0x395a8f){utils['error'](util[_0xff1d('0x14')](_0xff1d('0x38'),_0x593590[_0xff1d('0x2')]),_0x395a8f);}};exports[_0xff1d('0x3d')]=function(_0x1720e2){try{if(!_[_0xff1d('0x17')](queues[_0x1720e2[_0xff1d('0x2')]])){if(queues[_0x1720e2[_0xff1d('0x2')]][_0xff1d('0x18')]){utils[_0xff1d('0xe')](util[_0xff1d('0x14')](_0xff1d('0x3e'),_0x1720e2[_0xff1d('0x2')]),_0x1720e2);queues[_0x1720e2['uniqueid']]['queuecallerabandon']=![];queues[_0x1720e2[_0xff1d('0x2')]][_0xff1d('0x28')]=![];queues[_0x1720e2[_0xff1d('0x2')]][_0xff1d('0x29')]=null;queues[_0x1720e2[_0xff1d('0x2')]][_0xff1d('0x19')]=![];queues[_0x1720e2[_0xff1d('0x2')]]['queuecallerexitAt']=null;queues[_0x1720e2[_0xff1d('0x2')]][_0xff1d('0x3b')]=!![];queues[_0x1720e2[_0xff1d('0x2')]]['lastAssignedTo']=_0x1720e2['membername'];queues[_0x1720e2['uniqueid']][_0xff1d('0x1a')]=!![];queues[_0x1720e2[_0xff1d('0x2')]][_0xff1d('0x3f')]=utils[_0xff1d('0x12')]();if(_0x1720e2[_0xff1d('0x40')]=='transfer'){if(!queues[_0x1720e2[_0xff1d('0x2')]]['transfer']){queues[_0x1720e2['uniqueid']]['queuecallerexitreason']=_0xff1d('0x41');}}else{queues[_0x1720e2[_0xff1d('0x2')]][_0xff1d('0x6')]='COMPLETEDBY'+_0x1720e2[_0xff1d('0x40')]['toUpperCase']();}utils['info'](util[_0xff1d('0x14')](_0xff1d('0x42'),_0x1720e2[_0xff1d('0x2')],queues[_0x1720e2[_0xff1d('0x2')]][_0xff1d('0x1d')],_0x1720e2[_0xff1d('0x3c')],queues[_0x1720e2[_0xff1d('0x2')]][_0xff1d('0x6')]));writeDB(queues[_0x1720e2[_0xff1d('0x2')]]);}}}catch(_0x2403a5){utils[_0xff1d('0x13')](util[_0xff1d('0x14')](_0xff1d('0x3e'),_0x1720e2[_0xff1d('0x2')]),_0x2403a5);}};exports[_0xff1d('0x43')]=function(_0x213d4e){try{if(!_[_0xff1d('0x17')](queues[_0x213d4e[_0xff1d('0x44')]])){utils[_0xff1d('0xe')](util[_0xff1d('0x14')](_0xff1d('0x45'),_0x213d4e[_0xff1d('0x2')]),_0x213d4e);queues[_0x213d4e['transfereeuniqueid']][_0xff1d('0x46')]=!![];queues[_0x213d4e[_0xff1d('0x44')]]['transfertype']='BLIND';queues[_0x213d4e['transfereeuniqueid']]['transferexten']=_0x213d4e[_0xff1d('0x47')];queues[_0x213d4e[_0xff1d('0x44')]][_0xff1d('0x48')]=_0x213d4e[_0xff1d('0x44')];queues[_0x213d4e[_0xff1d('0x44')]]['queuecallerexitreason']='BLINDTRANSFER';utils['info'](util[_0xff1d('0x14')](_0xff1d('0x49'),_0x213d4e[_0xff1d('0x2')],queues[_0x213d4e['transfereeuniqueid']][_0xff1d('0x1d')],_0x213d4e[_0xff1d('0x44')],_0x213d4e['extension']));}}catch(_0x53186c){utils[_0xff1d('0x13')](util[_0xff1d('0x14')](_0xff1d('0x45'),_0x213d4e['uniqueid']),_0x53186c);}};exports['attendedtransfer']=function(_0xf25582){try{utils['debug'](util[_0xff1d('0x14')](_0xff1d('0x4a'),_0xf25582[_0xff1d('0x4b')]),_0xf25582);if(_0xf25582[_0xff1d('0x4b')]==_0xf25582[_0xff1d('0x4c')]){if(!_[_0xff1d('0x17')](queues[_0xf25582[_0xff1d('0x4d')]])){utils[_0xff1d('0x1c')](util[_0xff1d('0x14')](_0xff1d('0x4e'),_0xf25582[_0xff1d('0x4b')],queues[_0xf25582[_0xff1d('0x4d')]][_0xff1d('0x1d')],_0xf25582[_0xff1d('0x4f')]));queues[_0xf25582[_0xff1d('0x4d')]][_0xff1d('0x46')]=!![];queues[_0xf25582[_0xff1d('0x4d')]][_0xff1d('0x50')]=_0xff1d('0x51');queues[_0xf25582['secondtransfererlinkedid']][_0xff1d('0x52')]=_0xf25582[_0xff1d('0x4f')];queues[_0xf25582['secondtransfererlinkedid']][_0xff1d('0x48')]=_0xf25582[_0xff1d('0x4b')];queues[_0xf25582[_0xff1d('0x4d')]][_0xff1d('0x6')]=_0xff1d('0x53');}if(!_[_0xff1d('0x17')](queues[_0xf25582[_0xff1d('0x4c')]])){if(_0xf25582[_0xff1d('0x54')]&&queues[_0xf25582[_0xff1d('0x54')]]){queues[_0xf25582[_0xff1d('0x54')]][_0xff1d('0x1f')]=0x1;queues[_0xf25582[_0xff1d('0x44')]]=_['clone'](queues[_0xf25582[_0xff1d('0x54')]]);queues[_0xf25582['transfereeuniqueid']][_0xff1d('0xd')]=_0xf25582[_0xff1d('0x55')];queues[_0xf25582[_0xff1d('0x44')]][_0xff1d('0x1f')]=0x2;queues[_0xf25582[_0xff1d('0x44')]][_0xff1d('0x56')]=queues[_0xf25582[_0xff1d('0x4d')]][_0xff1d('0x56')];queues[_0xf25582[_0xff1d('0x44')]][_0xff1d('0x57')]=queues[_0xf25582[_0xff1d('0x4d')]][_0xff1d('0x57')];queues[_0xf25582[_0xff1d('0x44')]]['queuecallerjoinAt']=utils[_0xff1d('0x12')]();queues[_0xf25582['transfereeuniqueid']][_0xff1d('0x18')]=utils[_0xff1d('0x12')]();queues[_0xf25582['transfereeuniqueid']][_0xff1d('0x31')]=0x0;queues[_0xf25582[_0xff1d('0x44')]][_0xff1d('0x58')]=0x0;utils[_0xff1d('0x1c')](util[_0xff1d('0x14')](_0xff1d('0x59'),_0xf25582[_0xff1d('0x4b')],queues[_0xf25582[_0xff1d('0x44')]][_0xff1d('0x1d')],queues[_0xf25582['transfereeuniqueid']][_0xff1d('0x56')],queues[_0xf25582['transfereeuniqueid']][_0xff1d('0x57')]));}else{utils[_0xff1d('0x1c')](util[_0xff1d('0x14')](_0xff1d('0x5a'),_0xf25582[_0xff1d('0x4b')],queues[_0xf25582[_0xff1d('0x4c')]][_0xff1d('0x1d')],_0xf25582['secondtransfererlinkedid']));queues[_0xf25582[_0xff1d('0x4c')]]['transfereduniqueid']=_0xf25582[_0xff1d('0x4d')];}}}else if(_0xf25582[_0xff1d('0x5b')]==_0xf25582[_0xff1d('0x4d')]){if(!_[_0xff1d('0x17')](queues[_0xf25582[_0xff1d('0x4c')]])){utils['info'](util['format'](_0xff1d('0x5c'),_0xf25582[_0xff1d('0x4b')],queues[_0xf25582[_0xff1d('0x4c')]][_0xff1d('0x1d')],_0xf25582[_0xff1d('0x5b')],_0xf25582[_0xff1d('0x5d')]));queues[_0xf25582[_0xff1d('0x4c')]]['transfer']=!![];queues[_0xf25582[_0xff1d('0x4c')]][_0xff1d('0x50')]=_0xff1d('0x51');queues[_0xf25582['origtransfererlinkedid']][_0xff1d('0x52')]=_0xf25582[_0xff1d('0x5d')];queues[_0xf25582['origtransfererlinkedid']][_0xff1d('0x48')]=_0xf25582[_0xff1d('0x5b')];queues[_0xf25582[_0xff1d('0x4c')]][_0xff1d('0x6')]=_0xff1d('0x53');}if(!_[_0xff1d('0x17')](queues[_0xf25582['secondtransfererlinkedid']])){if(_0xf25582[_0xff1d('0x5e')]&&queues[_0xf25582[_0xff1d('0x5e')]]){queues[_0xf25582['transfertargetlinkedid']][_0xff1d('0x1f')]=0x1;queues[_0xf25582[_0xff1d('0x55')]]=_[_0xff1d('0x5f')](queues[_0xf25582[_0xff1d('0x5e')]]);queues[_0xf25582[_0xff1d('0x55')]][_0xff1d('0xd')]=_0xf25582[_0xff1d('0x55')];queues[_0xf25582[_0xff1d('0x55')]][_0xff1d('0x1f')]=0x2;queues[_0xf25582[_0xff1d('0x55')]][_0xff1d('0x56')]=queues[_0xf25582[_0xff1d('0x4c')]]['calleridnum'];queues[_0xf25582[_0xff1d('0x55')]][_0xff1d('0x57')]=queues[_0xf25582[_0xff1d('0x4c')]][_0xff1d('0x57')];queues[_0xf25582['transfertargetuniqueid']][_0xff1d('0x33')]=utils[_0xff1d('0x12')]();queues[_0xf25582[_0xff1d('0x55')]][_0xff1d('0x18')]=utils[_0xff1d('0x12')]();queues[_0xf25582[_0xff1d('0x55')]][_0xff1d('0x31')]=0x0;queues[_0xf25582['transfertargetuniqueid']][_0xff1d('0x58')]=0x0;utils[_0xff1d('0x1c')](util[_0xff1d('0x14')](_0xff1d('0x60'),_0xf25582[_0xff1d('0x4b')],queues[_0xf25582[_0xff1d('0x55')]][_0xff1d('0x1d')],queues[_0xf25582['transfertargetuniqueid']][_0xff1d('0xd')],queues[_0xf25582[_0xff1d('0x55')]][_0xff1d('0x56')],queues[_0xf25582['transfertargetuniqueid']][_0xff1d('0x57')]));}else{utils[_0xff1d('0x1c')](util['format'](_0xff1d('0x5a'),_0xf25582[_0xff1d('0x4b')],queues[_0xf25582[_0xff1d('0x4d')]]['name'],_0xf25582[_0xff1d('0x4c')]));queues[_0xf25582['secondtransfererlinkedid']][_0xff1d('0xd')]=_0xf25582[_0xff1d('0x4c')];}}}}catch(_0x4d8de4){utils[_0xff1d('0x13')](util['format']('[%s][queues][attendedtransfer]',_0xf25582[_0xff1d('0x4b')]),_0x4d8de4);}};exports['musiconholdstart']=function(_0x38b164){try{if(!_['isNil'](queues[_0x38b164[_0xff1d('0x2')]])){utils[_0xff1d('0xe')](util['format'](_0xff1d('0x61'),_0x38b164[_0xff1d('0x2')]),_0x38b164);queues[_0x38b164[_0xff1d('0x2')]][_0xff1d('0x62')]=utils[_0xff1d('0x12')]();utils['info'](util[_0xff1d('0x14')](_0xff1d('0x63'),_0x38b164[_0xff1d('0x2')],queues[_0x38b164[_0xff1d('0x2')]]['name'],queues[_0x38b164['uniqueid']]['musiconholdstartAt']));}}catch(_0x1d2eaa){utils['error'](util['format'](_0xff1d('0x61'),_0x38b164['uniqueid']),_0x1d2eaa);}};exports['musiconholdstop']=function(_0x46eba2){try{if(!_[_0xff1d('0x17')](queues[_0x46eba2[_0xff1d('0x2')]])){if(!_[_0xff1d('0x17')](queues[_0x46eba2[_0xff1d('0x2')]][_0xff1d('0x62')])){utils['debug'](util[_0xff1d('0x14')](_0xff1d('0x64'),_0x46eba2[_0xff1d('0x2')]),_0x46eba2);queues[_0x46eba2[_0xff1d('0x2')]][_0xff1d('0x58')]+=utils['diffTime'](utils[_0xff1d('0x12')](),queues[_0x46eba2[_0xff1d('0x2')]][_0xff1d('0x62')]);utils[_0xff1d('0x1c')](util[_0xff1d('0x14')](_0xff1d('0x65'),_0x46eba2[_0xff1d('0x2')],queues[_0x46eba2[_0xff1d('0x2')]][_0xff1d('0x1d')],queues[_0x46eba2['uniqueid']][_0xff1d('0x58')]));delete queues[_0x46eba2['uniqueid']][_0xff1d('0x62')];}}}catch(_0x4aa506){utils[_0xff1d('0x13')](util[_0xff1d('0x14')]('[%s][queues][musiconholdstop]',_0x46eba2['uniqueid']),_0x4aa506);}}; \ No newline at end of file +var _0xae6d=['EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','count','[%s][queues][agentconnect]','destaccountcode','assigned','accountcode','membername','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','secondtransfererexten','secondtransfereruniqueid','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]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','info','format','channel','lastAssignedTo','queuecallerexitreason','queue','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','uniqueid','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','isNil','variable','queuestatus','value','toUpperCase','queuecallerabandonAt','queuecallerexitAt'];(function(_0x18313b,_0x5c914f){var _0x2ba97d=function(_0x41143d){while(--_0x41143d){_0x18313b['push'](_0x18313b['shift']());}};_0x2ba97d(++_0x5c914f);}(_0xae6d,0x1d6));var _0xdae6=function(_0x148f22,_0x5a5572){_0x148f22=_0x148f22-0x0;var _0x50ccfa=_0xae6d[_0x148f22];return _0x50ccfa;};'use strict';var _=require(_0xdae6('0x0'));var util=require(_0xdae6('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x5f3b5c){utils[_0xdae6('0x2')](util[_0xdae6('0x3')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x5f3b5c['uniqueid'],_0x5f3b5c[_0xdae6('0x4')],_0x5f3b5c['queue'],_0x5f3b5c[_0xdae6('0x5')],_0x5f3b5c['calleridnum'],_0x5f3b5c['accountcode'],_0x5f3b5c[_0xdae6('0x6')]));if(_0x5f3b5c[_0xdae6('0x7')]){utils[_0xdae6('0x8')](_0x5f3b5c[_0xdae6('0x7')])['then'](function(_0x2aa322){if(_0x2aa322){_0x5f3b5c['type']=_0x2aa322[_0xdae6('0x9')];}utils[_0xdae6('0xa')](_0xdae6('0xb'),_0x5f3b5c);});}else{utils['request']('CreateVoiceQueueReport',_0x5f3b5c);}if(_0x5f3b5c[_0xdae6('0xc')]){delete queues[_0x5f3b5c[_0xdae6('0xc')]];}else{delete queues[_0x5f3b5c['uniqueid']];}}exports['queuecallerjoin']=function(_0x3dc597){try{utils[_0xdae6('0xd')](util[_0xdae6('0x3')](_0xdae6('0xe'),_0x3dc597[_0xdae6('0xf')]),_0x3dc597);utils[_0xdae6('0x2')](util['format'](_0xdae6('0x10'),_0x3dc597[_0xdae6('0xf')],_0x3dc597[_0xdae6('0x7')],_0x3dc597[_0xdae6('0x11')]));queues[_0x3dc597['uniqueid']]=_[_0xdae6('0x12')](_0x3dc597,{'originalposition':_0x3dc597[_0xdae6('0x11')],'queuecallerjoinAt':utils[_0xdae6('0x13')](),'mohtime':0x0});}catch(_0x35c176){utils[_0xdae6('0x14')](util[_0xdae6('0x3')](_0xdae6('0xe'),_0x3dc597[_0xdae6('0xf')]),_0x35c176);}};exports['hangup']=function(_0x140617){try{if(!_['isNil'](queues[_0x140617[_0xdae6('0xf')]])){utils['debug'](util[_0xdae6('0x3')]('[%s][queues][hangup]',_0x140617['uniqueid']),_0x140617);if(queues[_0x140617[_0xdae6('0xf')]][_0xdae6('0x15')]){if(!queues[_0x140617['uniqueid']][_0xdae6('0x16')]&&!queues[_0x140617[_0xdae6('0xf')]][_0xdae6('0x17')]){queues[_0x140617['uniqueid']][_0xdae6('0x18')]=!![];queues[_0x140617[_0xdae6('0xf')]][_0xdae6('0x19')]=utils[_0xdae6('0x13')]();queues[_0x140617['uniqueid']][_0xdae6('0x6')]=_0xdae6('0x1a');}utils[_0xdae6('0x2')](util[_0xdae6('0x3')](_0xdae6('0x1b'),_0x140617[_0xdae6('0xf')],queues[_0x140617[_0xdae6('0xf')]]['name'],queues[_0x140617[_0xdae6('0xf')]][_0xdae6('0x6')]));writeDB(queues[_0x140617['uniqueid']]);}else if(queues[_0x140617[_0xdae6('0xf')]][_0xdae6('0xc')]){utils[_0xdae6('0x2')](util[_0xdae6('0x3')](_0xdae6('0x1c'),_0x140617[_0xdae6('0xf')],queues[_0x140617[_0xdae6('0xf')]][_0xdae6('0x1d')],queues[_0x140617[_0xdae6('0xf')]]['transfereduniqueid']));queues[queues[_0x140617[_0xdae6('0xf')]][_0xdae6('0xc')]]=queues[_0x140617['uniqueid']];queues[queues[_0x140617['uniqueid']]['transfereduniqueid']][_0xdae6('0x1e')]=0x2;delete queues[_0x140617[_0xdae6('0xf')]];}}}catch(_0x28138a){utils[_0xdae6('0x14')](util[_0xdae6('0x3')]('[%s][queues][hangup]',_0x140617[_0xdae6('0xf')]),_0x28138a);}};exports[_0xdae6('0x1f')]=function(_0x36c0f6){try{utils['debug'](util['format'](_0xdae6('0x20'),_0x36c0f6['uniqueid']),_0x36c0f6);if(!_[_0xdae6('0x21')](_0x36c0f6[_0xdae6('0x22')][_0xdae6('0x23')])&&_0x36c0f6[_0xdae6('0x24')][_0xdae6('0x25')]()!=='CONTINUE'){if(!_['isNil'](queues[_0x36c0f6['uniqueid']])){queues[_0x36c0f6[_0xdae6('0xf')]][_0xdae6('0x16')]=![];queues[_0x36c0f6[_0xdae6('0xf')]][_0xdae6('0x26')]=null;queues[_0x36c0f6[_0xdae6('0xf')]]['queuecallerexit']=!![];queues[_0x36c0f6[_0xdae6('0xf')]][_0xdae6('0x27')]=utils['now']();queues[_0x36c0f6[_0xdae6('0xf')]]['queuecallerexitreason']=_0x36c0f6['value'][_0xdae6('0x25')]();utils[_0xdae6('0x2')](util[_0xdae6('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x36c0f6[_0xdae6('0xf')],queues[_0x36c0f6['uniqueid']][_0xdae6('0x1d')],_0x36c0f6['value'],queues[_0x36c0f6['uniqueid']][_0xdae6('0x6')]));writeDB(queues[_0x36c0f6[_0xdae6('0xf')]]);}}else if(!_[_0xdae6('0x21')](_0x36c0f6[_0xdae6('0x22')]['queueposition'])){if(!_[_0xdae6('0x21')](queues[_0x36c0f6['uniqueid']])&&!queues[_0x36c0f6[_0xdae6('0xf')]][_0xdae6('0x16')]){queues[_0x36c0f6[_0xdae6('0xf')]]['queuecallerabandon']=![];queues[_0x36c0f6[_0xdae6('0xf')]][_0xdae6('0x26')]=null;queues[_0x36c0f6[_0xdae6('0xf')]]['queuecallerexit']=!![];queues[_0x36c0f6[_0xdae6('0xf')]][_0xdae6('0x27')]=utils[_0xdae6('0x13')]();queues[_0x36c0f6[_0xdae6('0xf')]][_0xdae6('0x6')]=_0xdae6('0x28');utils[_0xdae6('0x2')](util[_0xdae6('0x3')](_0xdae6('0x29'),_0x36c0f6[_0xdae6('0xf')],queues[_0x36c0f6[_0xdae6('0xf')]][_0xdae6('0x1d')],_0x36c0f6[_0xdae6('0x24')],queues[_0x36c0f6[_0xdae6('0xf')]][_0xdae6('0x6')]));}}}catch(_0x22f81d){utils[_0xdae6('0x14')](util[_0xdae6('0x3')](_0xdae6('0x20'),_0x36c0f6[_0xdae6('0xf')]),_0x22f81d);}};exports[_0xdae6('0x16')]=function(_0x3f130c){try{if(!_[_0xdae6('0x21')](queues[_0x3f130c['uniqueid']])){utils[_0xdae6('0xd')](util['format'](_0xdae6('0x2a'),_0x3f130c['uniqueid']),_0x3f130c);queues[_0x3f130c['uniqueid']][_0xdae6('0x17')]=![];queues[_0x3f130c[_0xdae6('0xf')]][_0xdae6('0x27')]=null;queues[_0x3f130c[_0xdae6('0xf')]][_0xdae6('0x16')]=!![];queues[_0x3f130c[_0xdae6('0xf')]][_0xdae6('0x26')]=utils[_0xdae6('0x13')]();queues[_0x3f130c[_0xdae6('0xf')]][_0xdae6('0x6')]=_0xdae6('0x2b');utils['info'](util[_0xdae6('0x3')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x3f130c['uniqueid'],queues[_0x3f130c[_0xdae6('0xf')]][_0xdae6('0x1d')],queues[_0x3f130c[_0xdae6('0xf')]]['queuecallerexitreason']));}}catch(_0x32e02a){utils[_0xdae6('0x14')](util[_0xdae6('0x3')](_0xdae6('0x2a'),_0x3f130c['uniqueid']),_0x32e02a);}};exports[_0xdae6('0x2c')]=function(_0x378477){try{if(!_[_0xdae6('0x21')](queues[_0x378477['uniqueid']])){utils[_0xdae6('0xd')](util[_0xdae6('0x3')](_0xdae6('0x2d'),_0x378477[_0xdae6('0xf')]),_0x378477);utils[_0xdae6('0x2')](util[_0xdae6('0x3')](_0xdae6('0x2e'),_0x378477[_0xdae6('0xf')],queues[_0x378477['uniqueid']][_0xdae6('0x1d')],_0x378477[_0xdae6('0x2f')],_0x378477[_0xdae6('0x30')]));queues[_0x378477['uniqueid']][_0xdae6('0x2c')]=!![];queues[_0x378477[_0xdae6('0xf')]][_0xdae6('0x15')]=utils[_0xdae6('0x13')]();queues[_0x378477[_0xdae6('0xf')]][_0xdae6('0x31')]=utils['diffTime'](queues[_0x378477[_0xdae6('0xf')]]['queuecallerleaveAt'],queues[_0x378477[_0xdae6('0xf')]]['queuecallerjoinAt']);queues[_0x378477[_0xdae6('0xf')]][_0xdae6('0x11')]=_0x378477[_0xdae6('0x11')];queues[_0x378477[_0xdae6('0xf')]][_0xdae6('0x32')]=_0x378477[_0xdae6('0x32')];queues[_0x378477[_0xdae6('0xf')]][_0xdae6('0x2f')]=_0x378477['connectedlinenum'];queues[_0x378477[_0xdae6('0xf')]][_0xdae6('0x30')]=_0x378477[_0xdae6('0x30')];}}catch(_0x4b4110){utils[_0xdae6('0x14')](util[_0xdae6('0x3')](_0xdae6('0x2d'),_0x378477[_0xdae6('0xf')]),_0x4b4110);}};exports['agentconnect']=function(_0x2836b5){try{if(!_[_0xdae6('0x21')](queues[_0x2836b5[_0xdae6('0xf')]])){utils[_0xdae6('0xd')](util[_0xdae6('0x3')](_0xdae6('0x33'),_0x2836b5['uniqueid']),_0x2836b5);utils[_0xdae6('0x2')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x2836b5[_0xdae6('0xf')],queues[_0x2836b5['uniqueid']]['name'],_0x2836b5['membername'],_0x2836b5[_0xdae6('0x34')]));queues[_0x2836b5[_0xdae6('0xf')]]['queuecallerabandon']=![];queues[_0x2836b5[_0xdae6('0xf')]][_0xdae6('0x16')]=![];queues[_0x2836b5[_0xdae6('0xf')]][_0xdae6('0x26')]=null;queues[_0x2836b5[_0xdae6('0xf')]]['queuecallerexit']=![];queues[_0x2836b5['uniqueid']][_0xdae6('0x6')]=null;queues[_0x2836b5[_0xdae6('0xf')]][_0xdae6('0x27')]=null;queues[_0x2836b5['uniqueid']][_0xdae6('0x35')]=!![];queues[_0x2836b5[_0xdae6('0xf')]][_0xdae6('0x36')]=_0x2836b5['destaccountcode'];queues[_0x2836b5[_0xdae6('0xf')]][_0xdae6('0x5')]=_0x2836b5[_0xdae6('0x37')];}}catch(_0x3d39b4){utils['error'](util[_0xdae6('0x3')]('[%s][queues][agentconnect]',_0x2836b5[_0xdae6('0xf')]),_0x3d39b4);}};exports[_0xdae6('0x38')]=function(_0x2eac84){try{if(!_[_0xdae6('0x21')](queues[_0x2eac84[_0xdae6('0xf')]])){if(queues[_0x2eac84['uniqueid']][_0xdae6('0x15')]){utils[_0xdae6('0xd')](util[_0xdae6('0x3')](_0xdae6('0x39'),_0x2eac84[_0xdae6('0xf')]),_0x2eac84);queues[_0x2eac84[_0xdae6('0xf')]]['queuecallerabandon']=![];queues[_0x2eac84['uniqueid']]['queuecallerabandon']=![];queues[_0x2eac84[_0xdae6('0xf')]][_0xdae6('0x26')]=null;queues[_0x2eac84['uniqueid']][_0xdae6('0x17')]=![];queues[_0x2eac84['uniqueid']][_0xdae6('0x27')]=null;queues[_0x2eac84[_0xdae6('0xf')]][_0xdae6('0x35')]=!![];queues[_0x2eac84[_0xdae6('0xf')]]['lastAssignedTo']=_0x2eac84[_0xdae6('0x37')];queues[_0x2eac84[_0xdae6('0xf')]]['queuecallercomplete']=!![];queues[_0x2eac84[_0xdae6('0xf')]][_0xdae6('0x19')]=utils[_0xdae6('0x13')]();if(_0x2eac84[_0xdae6('0x3a')]==_0xdae6('0x3b')){if(!queues[_0x2eac84[_0xdae6('0xf')]][_0xdae6('0x3b')]){queues[_0x2eac84[_0xdae6('0xf')]][_0xdae6('0x6')]='TRANSFER';}}else{queues[_0x2eac84[_0xdae6('0xf')]]['queuecallerexitreason']=_0xdae6('0x3c')+_0x2eac84['reason'][_0xdae6('0x25')]();}utils[_0xdae6('0x2')](util[_0xdae6('0x3')](_0xdae6('0x3d'),_0x2eac84[_0xdae6('0xf')],queues[_0x2eac84[_0xdae6('0xf')]][_0xdae6('0x1d')],_0x2eac84[_0xdae6('0x37')],queues[_0x2eac84['uniqueid']][_0xdae6('0x6')]));writeDB(queues[_0x2eac84[_0xdae6('0xf')]]);}}}catch(_0x3b2e0b){utils[_0xdae6('0x14')](util[_0xdae6('0x3')](_0xdae6('0x39'),_0x2eac84['uniqueid']),_0x3b2e0b);}};exports[_0xdae6('0x3e')]=function(_0x13e17a){try{if(!_[_0xdae6('0x21')](queues[_0x13e17a[_0xdae6('0x3f')]])){utils[_0xdae6('0xd')](util[_0xdae6('0x3')](_0xdae6('0x40'),_0x13e17a[_0xdae6('0xf')]),_0x13e17a);queues[_0x13e17a[_0xdae6('0x3f')]][_0xdae6('0x3b')]=!![];queues[_0x13e17a['transfereeuniqueid']][_0xdae6('0x41')]=_0xdae6('0x42');queues[_0x13e17a[_0xdae6('0x3f')]][_0xdae6('0x43')]=_0x13e17a['extension'];queues[_0x13e17a[_0xdae6('0x3f')]][_0xdae6('0x44')]=_0x13e17a[_0xdae6('0x3f')];queues[_0x13e17a[_0xdae6('0x3f')]][_0xdae6('0x6')]=_0xdae6('0x45');utils['info'](util['format'](_0xdae6('0x46'),_0x13e17a[_0xdae6('0xf')],queues[_0x13e17a[_0xdae6('0x3f')]][_0xdae6('0x1d')],_0x13e17a[_0xdae6('0x3f')],_0x13e17a['extension']));}}catch(_0x1ab84d){utils[_0xdae6('0x14')](util['format'](_0xdae6('0x40'),_0x13e17a[_0xdae6('0xf')]),_0x1ab84d);}};exports[_0xdae6('0x47')]=function(_0x180e91){try{utils['debug'](util[_0xdae6('0x3')](_0xdae6('0x48'),_0x180e91[_0xdae6('0x49')]),_0x180e91);if(_0x180e91[_0xdae6('0x49')]==_0x180e91[_0xdae6('0x4a')]){if(!_['isNil'](queues[_0x180e91[_0xdae6('0x4b')]])){utils['info'](util['format'](_0xdae6('0x4c'),_0x180e91[_0xdae6('0x49')],queues[_0x180e91[_0xdae6('0x4b')]][_0xdae6('0x1d')],_0x180e91['origtransfererexten']));queues[_0x180e91[_0xdae6('0x4b')]][_0xdae6('0x3b')]=!![];queues[_0x180e91[_0xdae6('0x4b')]][_0xdae6('0x41')]='ATTENDED';queues[_0x180e91[_0xdae6('0x4b')]][_0xdae6('0x43')]=_0x180e91[_0xdae6('0x4d')];queues[_0x180e91[_0xdae6('0x4b')]][_0xdae6('0x44')]=_0x180e91[_0xdae6('0x49')];queues[_0x180e91['secondtransfererlinkedid']][_0xdae6('0x6')]=_0xdae6('0x4e');}if(!_['isNil'](queues[_0x180e91['origtransfererlinkedid']])){if(_0x180e91['transfereelinkedid']&&queues[_0x180e91['transfereelinkedid']]){queues[_0x180e91[_0xdae6('0x4f')]][_0xdae6('0x1e')]=0x1;queues[_0x180e91['transfereeuniqueid']]=_[_0xdae6('0x50')](queues[_0x180e91['transfereelinkedid']]);queues[_0x180e91['transfereeuniqueid']]['transfereduniqueid']=_0x180e91[_0xdae6('0x51')];queues[_0x180e91[_0xdae6('0x3f')]][_0xdae6('0x1e')]=0x2;queues[_0x180e91[_0xdae6('0x3f')]][_0xdae6('0x52')]=queues[_0x180e91[_0xdae6('0x4b')]]['calleridnum'];queues[_0x180e91[_0xdae6('0x3f')]][_0xdae6('0x53')]=queues[_0x180e91[_0xdae6('0x4b')]][_0xdae6('0x53')];queues[_0x180e91[_0xdae6('0x3f')]][_0xdae6('0x54')]=utils[_0xdae6('0x13')]();queues[_0x180e91[_0xdae6('0x3f')]][_0xdae6('0x15')]=utils['now']();queues[_0x180e91[_0xdae6('0x3f')]][_0xdae6('0x31')]=0x0;queues[_0x180e91['transfereeuniqueid']]['mohtime']=0x0;utils[_0xdae6('0x2')](util[_0xdae6('0x3')](_0xdae6('0x55'),_0x180e91[_0xdae6('0x49')],queues[_0x180e91[_0xdae6('0x3f')]][_0xdae6('0x1d')],queues[_0x180e91[_0xdae6('0x3f')]][_0xdae6('0x52')],queues[_0x180e91[_0xdae6('0x3f')]][_0xdae6('0x53')]));}else{utils[_0xdae6('0x2')](util[_0xdae6('0x3')](_0xdae6('0x56'),_0x180e91[_0xdae6('0x49')],queues[_0x180e91['origtransfererlinkedid']]['name'],_0x180e91[_0xdae6('0x4b')]));queues[_0x180e91[_0xdae6('0x4a')]][_0xdae6('0xc')]=_0x180e91['secondtransfererlinkedid'];}}}else if(_0x180e91['secondtransfereruniqueid']==_0x180e91[_0xdae6('0x4b')]){if(!_[_0xdae6('0x21')](queues[_0x180e91[_0xdae6('0x4a')]])){utils['info'](util[_0xdae6('0x3')](_0xdae6('0x57'),_0x180e91[_0xdae6('0x49')],queues[_0x180e91[_0xdae6('0x4a')]][_0xdae6('0x1d')],_0x180e91['secondtransfereruniqueid'],_0x180e91['secondtransfererexten']));queues[_0x180e91[_0xdae6('0x4a')]]['transfer']=!![];queues[_0x180e91[_0xdae6('0x4a')]][_0xdae6('0x41')]=_0xdae6('0x58');queues[_0x180e91[_0xdae6('0x4a')]][_0xdae6('0x43')]=_0x180e91[_0xdae6('0x59')];queues[_0x180e91[_0xdae6('0x4a')]]['transferuniqueid']=_0x180e91[_0xdae6('0x5a')];queues[_0x180e91[_0xdae6('0x4a')]]['queuecallerexitreason']=_0xdae6('0x4e');}if(!_['isNil'](queues[_0x180e91['secondtransfererlinkedid']])){if(_0x180e91[_0xdae6('0x5b')]&&queues[_0x180e91[_0xdae6('0x5b')]]){queues[_0x180e91[_0xdae6('0x5b')]][_0xdae6('0x1e')]=0x1;queues[_0x180e91[_0xdae6('0x51')]]=_[_0xdae6('0x50')](queues[_0x180e91[_0xdae6('0x5b')]]);queues[_0x180e91[_0xdae6('0x51')]][_0xdae6('0xc')]=_0x180e91[_0xdae6('0x51')];queues[_0x180e91[_0xdae6('0x51')]][_0xdae6('0x1e')]=0x2;queues[_0x180e91['transfertargetuniqueid']][_0xdae6('0x52')]=queues[_0x180e91['origtransfererlinkedid']][_0xdae6('0x52')];queues[_0x180e91['transfertargetuniqueid']]['calleridname']=queues[_0x180e91['origtransfererlinkedid']][_0xdae6('0x53')];queues[_0x180e91[_0xdae6('0x51')]][_0xdae6('0x54')]=utils[_0xdae6('0x13')]();queues[_0x180e91[_0xdae6('0x51')]][_0xdae6('0x15')]=utils['now']();queues[_0x180e91[_0xdae6('0x51')]]['holdtime']=0x0;queues[_0x180e91['transfertargetuniqueid']][_0xdae6('0x5c')]=0x0;utils['info'](util[_0xdae6('0x3')](_0xdae6('0x5d'),_0x180e91[_0xdae6('0x49')],queues[_0x180e91[_0xdae6('0x51')]][_0xdae6('0x1d')],queues[_0x180e91[_0xdae6('0x51')]][_0xdae6('0xc')],queues[_0x180e91[_0xdae6('0x51')]][_0xdae6('0x52')],queues[_0x180e91[_0xdae6('0x51')]][_0xdae6('0x53')]));}else{utils[_0xdae6('0x2')](util[_0xdae6('0x3')](_0xdae6('0x56'),_0x180e91['origtransfereruniqueid'],queues[_0x180e91[_0xdae6('0x4b')]][_0xdae6('0x1d')],_0x180e91[_0xdae6('0x4a')]));queues[_0x180e91[_0xdae6('0x4b')]][_0xdae6('0xc')]=_0x180e91[_0xdae6('0x4a')];}}}}catch(_0x8ec06a){utils[_0xdae6('0x14')](util[_0xdae6('0x3')](_0xdae6('0x48'),_0x180e91[_0xdae6('0x49')]),_0x8ec06a);}};exports[_0xdae6('0x5e')]=function(_0x114118){try{if(!_[_0xdae6('0x21')](queues[_0x114118['uniqueid']])){utils[_0xdae6('0xd')](util[_0xdae6('0x3')](_0xdae6('0x5f'),_0x114118[_0xdae6('0xf')]),_0x114118);queues[_0x114118[_0xdae6('0xf')]]['musiconholdstartAt']=utils[_0xdae6('0x13')]();utils[_0xdae6('0x2')](util[_0xdae6('0x3')](_0xdae6('0x60'),_0x114118[_0xdae6('0xf')],queues[_0x114118['uniqueid']][_0xdae6('0x1d')],queues[_0x114118[_0xdae6('0xf')]][_0xdae6('0x61')]));}}catch(_0x292385){utils[_0xdae6('0x14')](util['format'](_0xdae6('0x5f'),_0x114118[_0xdae6('0xf')]),_0x292385);}};exports[_0xdae6('0x62')]=function(_0xdd922e){try{if(!_['isNil'](queues[_0xdd922e[_0xdae6('0xf')]])){if(!_[_0xdae6('0x21')](queues[_0xdd922e['uniqueid']][_0xdae6('0x61')])){utils['debug'](util[_0xdae6('0x3')](_0xdae6('0x63'),_0xdd922e[_0xdae6('0xf')]),_0xdd922e);queues[_0xdd922e[_0xdae6('0xf')]][_0xdae6('0x5c')]+=utils[_0xdae6('0x64')](utils[_0xdae6('0x13')](),queues[_0xdd922e[_0xdae6('0xf')]][_0xdae6('0x61')]);utils[_0xdae6('0x2')](util[_0xdae6('0x3')](_0xdae6('0x65'),_0xdd922e[_0xdae6('0xf')],queues[_0xdd922e[_0xdae6('0xf')]][_0xdae6('0x1d')],queues[_0xdd922e[_0xdae6('0xf')]][_0xdae6('0x5c')]));delete queues[_0xdd922e[_0xdae6('0xf')]][_0xdae6('0x61')];}}}catch(_0x49c4a4){utils[_0xdae6('0x14')](util[_0xdae6('0x3')](_0xdae6('0x63'),_0xdd922e[_0xdae6('0xf')]),_0x49c4a4);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 82ef576..23ea5db 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 _0x9fd7=['cdr','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','error','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','context','channel','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','isNil','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith'];(function(_0xf7fe02,_0x8938b6){var _0x4b7f19=function(_0x28e94c){while(--_0x28e94c){_0xf7fe02['push'](_0xf7fe02['shift']());}};_0x4b7f19(++_0x8938b6);}(_0x9fd7,0x1b1));var _0x79fd=function(_0x2793ec,_0x22261b){_0x2793ec=_0x2793ec-0x0;var _0x1ff26b=_0x9fd7[_0x2793ec];return _0x1ff26b;};'use strict';var _=require('lodash');var util=require(_0x79fd('0x0'));var utils=require(_0x79fd('0x1'));var transfers=require(_0x79fd('0x2'));var recordings={};function writeDB(_0x24d495){var _0x327a25;utils[_0x79fd('0x3')](util[_0x79fd('0x4')](_0x79fd('0x5'),_0x24d495[_0x79fd('0x6')]));if(transfers['blinds'][_0x24d495[_0x79fd('0x6')]]){_0x327a25=_0x24d495[_0x79fd('0x6')];_0x24d495[_0x79fd('0x6')]=transfers[_0x79fd('0x7')][_0x24d495[_0x79fd('0x6')]][_0x79fd('0x8')];}if(_0x24d495[_0x79fd('0x9')]){utils[_0x79fd('0xa')](_0x24d495['accountcode'])[_0x79fd('0xb')](function(_0x3a842d){if(_0x3a842d){_0x24d495['membername']=_0x3a842d['name'];_0x24d495[_0x79fd('0xc')]=_0x3a842d['id'];}utils[_0x79fd('0xd')](_0x79fd('0xe'),_0x24d495);});}else{utils[_0x79fd('0xd')]('CreateVoiceRecording',_0x24d495);}if(_0x327a25)delete transfers[_0x79fd('0x7')][_0x327a25];}exports['newchannel']=function(_0x1e1020){try{utils[_0x79fd('0xf')](util[_0x79fd('0x4')](_0x79fd('0x10'),_0x1e1020[_0x79fd('0x6')]),_0x1e1020);if(_0x1e1020['uniqueid']==_0x1e1020[_0x79fd('0x11')]){utils[_0x79fd('0x3')](util[_0x79fd('0x4')](_0x79fd('0x12'),_0x1e1020[_0x79fd('0x6')],_0x1e1020['context'],_0x1e1020['exten']));recordings[_0x1e1020['uniqueid']]={'uniqueid':_0x1e1020[_0x79fd('0x6')],'accountcode':_0x1e1020[_0x79fd('0x9')],'exten':_0x1e1020[_0x79fd('0x13')],'context':_0x1e1020['context'],'channel':_0x1e1020['channel'],'monitors':[]};}}catch(_0x4395c6){utils[_0x79fd('0x14')](util[_0x79fd('0x4')]('[%s][recordings][newchannel]',_0x1e1020[_0x79fd('0x6')]),_0x4395c6);}};exports['newstate']=function(_0x395b48){try{utils[_0x79fd('0xf')](util[_0x79fd('0x4')](_0x79fd('0x15'),_0x395b48[_0x79fd('0x6')]),_0x395b48);if(!_['isNil'](recordings[_0x395b48[_0x79fd('0x6')]])&&_0x395b48[_0x79fd('0x16')]==0x6){utils[_0x79fd('0x3')](util[_0x79fd('0x4')](_0x79fd('0x17'),_0x395b48['uniqueid'],_0x395b48[_0x79fd('0x18')],_0x395b48[_0x79fd('0x19')]));}else if(!_['isNil'](recordings[_0x395b48[_0x79fd('0x11')]])&&_0x395b48[_0x79fd('0x16')]==0x6&&_0x395b48[_0x79fd('0x18')]!='transfer'){utils[_0x79fd('0x3')](util['format'](_0x79fd('0x1a'),_0x395b48[_0x79fd('0x6')],_0x395b48[_0x79fd('0x11')],_0x395b48[_0x79fd('0x18')],_0x395b48[_0x79fd('0x19')]));recordings[_0x395b48[_0x79fd('0x11')]]['accountcode']=_0x395b48[_0x79fd('0x9')];}}catch(_0x557fa3){utils[_0x79fd('0x14')](util[_0x79fd('0x4')]('[%s][recordings][newstate]',_0x395b48[_0x79fd('0x6')]),_0x557fa3);}};exports['varset']=function(_0x434ba8){try{if(!_['isNil'](_0x434ba8['variable'])&&!_[_0x79fd('0x1b')](_0x434ba8[_0x79fd('0x1c')][_0x79fd('0x1d')])){utils[_0x79fd('0xf')](util[_0x79fd('0x4')](_0x79fd('0x1e'),_0x434ba8[_0x79fd('0x6')]),_0x434ba8);utils[_0x79fd('0x3')](util[_0x79fd('0x4')](_0x79fd('0x1f'),_0x434ba8['uniqueid'],_0x434ba8['variable'],_0x434ba8[_0x79fd('0x20')]));if(_[_0x79fd('0x21')](_0x434ba8[_0x79fd('0x20')],_0x79fd('0x22'))){_0x434ba8[_0x79fd('0x20')]=_0x434ba8['value'][_0x79fd('0x23')](_0x79fd('0x22'),_0x79fd('0x24'));}if(recordings[_0x434ba8[_0x79fd('0x11')]]){var _0x54c6b8=_['find'](recordings[_0x434ba8[_0x79fd('0x11')]][_0x79fd('0x25')],{'value':_0x434ba8[_0x79fd('0x20')]});if(_['isNil'](_0x54c6b8)){recordings[_0x434ba8[_0x79fd('0x11')]]['monitors'][_0x79fd('0x26')]({'value':_0x434ba8['value']});}}}}catch(_0x2ba943){utils[_0x79fd('0x14')](util[_0x79fd('0x4')](_0x79fd('0x1e'),_0x434ba8[_0x79fd('0x6')]),_0x2ba943);}};exports[_0x79fd('0x27')]=function(_0x590451){try{if(!_['isNil'](recordings[_0x590451[_0x79fd('0x6')]])){utils[_0x79fd('0xf')](util[_0x79fd('0x4')](_0x79fd('0x28'),_0x590451[_0x79fd('0x6')]),_0x590451);utils[_0x79fd('0x3')](util[_0x79fd('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x590451[_0x79fd('0x6')],_0x590451[_0x79fd('0x29')],_0x590451[_0x79fd('0x2a')],_0x590451['cause-txt']));recordings[_0x590451[_0x79fd('0x6')]][_0x79fd('0x29')]=_0x590451['calleridnum'];recordings[_0x590451[_0x79fd('0x6')]][_0x79fd('0x2a')]=_0x590451[_0x79fd('0x2a')];recordings[_0x590451[_0x79fd('0x6')]][_0x79fd('0x2b')]=_0x590451[_0x79fd('0x2b')];recordings[_0x590451[_0x79fd('0x6')]]['connectedlinename']=_0x590451[_0x79fd('0x2c')];if(recordings[_0x590451[_0x79fd('0x6')]][_0x79fd('0x2d')]==_0x79fd('0x2e')&&recordings[_0x590451[_0x79fd('0x6')]][_0x79fd('0x9')]){recordings[_0x590451[_0x79fd('0x6')]][_0x79fd('0x2b')]=recordings[_0x590451[_0x79fd('0x6')]][_0x79fd('0x9')];recordings[_0x590451[_0x79fd('0x6')]]['connectedlinename']='';}recordings[_0x590451[_0x79fd('0x6')]][_0x79fd('0x25')][_0x79fd('0x2f')](function(_0x13b845){var _0xff1d9c=_[_0x79fd('0x30')](recordings[_0x590451['uniqueid']]);_0xff1d9c[_0x79fd('0x20')]=_0x13b845[_0x79fd('0x20')];writeDB(_0xff1d9c);});delete recordings[_0x590451[_0x79fd('0x6')]];}}catch(_0x5d2283){utils[_0x79fd('0x14')](util['format'](_0x79fd('0x28'),_0x590451[_0x79fd('0x6')]),_0x5d2283);}};exports[_0x79fd('0x31')]=function(_0x567098){try{if(!_[_0x79fd('0x1b')](recordings[_0x567098[_0x79fd('0x6')]])){utils['debug'](util[_0x79fd('0x4')](_0x79fd('0x32'),_0x567098['uniqueid']),_0x567098);utils[_0x79fd('0x3')](util['format'](_0x79fd('0x33'),_0x567098[_0x79fd('0x6')],_0x567098[_0x79fd('0x34')],_0x567098[_0x79fd('0x35')]));if(_0x567098['application'][_0x79fd('0x36')]()==_0x79fd('0x37')&&_[_0x79fd('0x38')](_0x567098[_0x79fd('0x35')]['toLowerCase'](),_0x79fd('0x39'))){var _0x2536db=_0x567098[_0x79fd('0x35')][_0x79fd('0x3a')]('=');var _0x1ed67a=_0x2536db[0x0][_0x79fd('0x3b')](_0x2536db[0x0][_0x79fd('0x3c')]('(')+0x1,_0x2536db[0x0][_0x79fd('0x3c')](')'));var _0x354bd3=_0x2536db[0x1];recordings[_0x567098['uniqueid']][_0x1ed67a]=_0x354bd3;}}}catch(_0x457bba){utils['error'](util[_0x79fd('0x4')]('[%s][recordings][newexten]',_0x567098['uniqueid']),_0x457bba);}};exports['queuecallerjoin']=function(_0x53ea80){try{if(!_[_0x79fd('0x1b')](recordings[_0x53ea80['uniqueid']])){utils[_0x79fd('0xf')](util[_0x79fd('0x4')](_0x79fd('0x3d'),_0x53ea80['uniqueid']),_0x53ea80);utils[_0x79fd('0x3')](util['format'](_0x79fd('0x3e'),_0x53ea80[_0x79fd('0x6')],_0x53ea80['queue']));recordings[_0x53ea80[_0x79fd('0x6')]]['queue']=_0x53ea80[_0x79fd('0x3f')];}}catch(_0x1275fc){utils[_0x79fd('0x14')](util['format'](_0x79fd('0x3d'),_0x53ea80[_0x79fd('0x6')]),_0x1275fc);}};exports['blindtransfer']=function(_0xfae1d9){try{utils[_0x79fd('0xf')](util[_0x79fd('0x4')](_0x79fd('0x40'),_0xfae1d9[_0x79fd('0x6')]),_0xfae1d9);utils[_0x79fd('0x3')](util[_0x79fd('0x4')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xfae1d9[_0x79fd('0x6')],_0xfae1d9[_0x79fd('0x41')],_0xfae1d9['transferercalleridname'],_0xfae1d9[_0x79fd('0x42')],_0xfae1d9[_0x79fd('0x43')]));if(recordings[_0xfae1d9[_0x79fd('0x44')]]&&transfers[_0x79fd('0x7')][_0xfae1d9[_0x79fd('0x44')]]){transfers[_0x79fd('0x7')][_0xfae1d9['transfereruniqueid']][_0x79fd('0x45')]=!![];}}catch(_0x2f68a0){utils['error'](util[_0x79fd('0x4')](_0x79fd('0x40'),_0xfae1d9[_0x79fd('0x6')]),_0x2f68a0);}}; \ No newline at end of file +var _0x105a=['endsWith','value','.wav49','.WAV','find','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','startsWith','appdata','cdr','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','[%s][recordings][blindtransfer]','lodash','util','info','[%s][recordings][writeDB]','uniqueid','blinds','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','format','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','[%s][recordings][newstate]','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x105a,0xaf));var _0xa105=function(_0xf52af6,_0x5b1f48){_0xf52af6=_0xf52af6-0x0;var _0x10ab94=_0x105a[_0xf52af6];return _0x10ab94;};'use strict';var _=require(_0xa105('0x0'));var util=require(_0xa105('0x1'));var utils=require('./utils');var transfers=require('./transfers.controller');var recordings={};function writeDB(_0x3c4fee){var _0x238d9f;utils[_0xa105('0x2')](util['format'](_0xa105('0x3'),_0x3c4fee[_0xa105('0x4')]));if(transfers[_0xa105('0x5')][_0x3c4fee[_0xa105('0x4')]]){_0x238d9f=_0x3c4fee[_0xa105('0x4')];_0x3c4fee[_0xa105('0x4')]=transfers[_0xa105('0x5')][_0x3c4fee[_0xa105('0x4')]]['transfereeuniqueid'];}if(_0x3c4fee[_0xa105('0x6')]){utils[_0xa105('0x7')](_0x3c4fee[_0xa105('0x6')])[_0xa105('0x8')](function(_0x13c396){if(_0x13c396){_0x3c4fee[_0xa105('0x9')]=_0x13c396[_0xa105('0xa')];_0x3c4fee[_0xa105('0xb')]=_0x13c396['id'];}utils[_0xa105('0xc')]('CreateVoiceRecording',_0x3c4fee);});}else{utils['request'](_0xa105('0xd'),_0x3c4fee);}if(_0x238d9f)delete transfers[_0xa105('0x5')][_0x238d9f];}exports[_0xa105('0xe')]=function(_0x3d6be6){try{utils[_0xa105('0xf')](util[_0xa105('0x10')](_0xa105('0x11'),_0x3d6be6['uniqueid']),_0x3d6be6);if(_0x3d6be6[_0xa105('0x4')]==_0x3d6be6[_0xa105('0x12')]){utils[_0xa105('0x2')](util['format'](_0xa105('0x13'),_0x3d6be6[_0xa105('0x4')],_0x3d6be6[_0xa105('0x14')],_0x3d6be6['exten']));recordings[_0x3d6be6['uniqueid']]={'uniqueid':_0x3d6be6[_0xa105('0x4')],'accountcode':_0x3d6be6['accountcode'],'exten':_0x3d6be6[_0xa105('0x15')],'context':_0x3d6be6[_0xa105('0x14')],'channel':_0x3d6be6[_0xa105('0x16')],'monitors':[]};}}catch(_0x53698e){utils[_0xa105('0x17')](util['format']('[%s][recordings][newchannel]',_0x3d6be6[_0xa105('0x4')]),_0x53698e);}};exports[_0xa105('0x18')]=function(_0x124198){try{utils[_0xa105('0xf')](util[_0xa105('0x10')](_0xa105('0x19'),_0x124198[_0xa105('0x4')]),_0x124198);if(!_[_0xa105('0x1a')](recordings[_0x124198[_0xa105('0x4')]])&&_0x124198[_0xa105('0x1b')]==0x6){utils[_0xa105('0x2')](util[_0xa105('0x10')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x124198['uniqueid'],_0x124198[_0xa105('0x14')],_0x124198['channel']));}else if(!_[_0xa105('0x1a')](recordings[_0x124198['linkedid']])&&_0x124198['channelstate']==0x6&&_0x124198['context']!=_0xa105('0x1c')){utils[_0xa105('0x2')](util[_0xa105('0x10')](_0xa105('0x1d'),_0x124198['uniqueid'],_0x124198[_0xa105('0x12')],_0x124198[_0xa105('0x14')],_0x124198[_0xa105('0x16')]));recordings[_0x124198[_0xa105('0x12')]][_0xa105('0x6')]=_0x124198['accountcode'];}}catch(_0x4a5b79){utils['error'](util[_0xa105('0x10')](_0xa105('0x19'),_0x124198[_0xa105('0x4')]),_0x4a5b79);}};exports[_0xa105('0x1e')]=function(_0x16b558){try{if(!_[_0xa105('0x1a')](_0x16b558[_0xa105('0x1f')])&&!_['isNil'](_0x16b558['variable'][_0xa105('0x20')])){utils[_0xa105('0xf')](util['format'](_0xa105('0x21'),_0x16b558['uniqueid']),_0x16b558);utils['info'](util[_0xa105('0x10')](_0xa105('0x22'),_0x16b558[_0xa105('0x4')],_0x16b558[_0xa105('0x1f')],_0x16b558['value']));if(_[_0xa105('0x23')](_0x16b558[_0xa105('0x24')],'.wav49')){_0x16b558[_0xa105('0x24')]=_0x16b558[_0xa105('0x24')]['replace'](_0xa105('0x25'),_0xa105('0x26'));}if(recordings[_0x16b558[_0xa105('0x12')]]){var _0x23393a=_[_0xa105('0x27')](recordings[_0x16b558['linkedid']][_0xa105('0x28')],{'value':_0x16b558[_0xa105('0x24')]});if(_['isNil'](_0x23393a)){recordings[_0x16b558[_0xa105('0x12')]][_0xa105('0x28')][_0xa105('0x29')]({'value':_0x16b558['value']});}}}}catch(_0x40ffe8){utils['error'](util[_0xa105('0x10')]('[%s][recordings][varset]',_0x16b558['uniqueid']),_0x40ffe8);}};exports['hangup']=function(_0x3df2c1){try{if(!_[_0xa105('0x1a')](recordings[_0x3df2c1[_0xa105('0x4')]])){utils['debug'](util[_0xa105('0x10')](_0xa105('0x2a'),_0x3df2c1['uniqueid']),_0x3df2c1);utils[_0xa105('0x2')](util[_0xa105('0x10')](_0xa105('0x2b'),_0x3df2c1[_0xa105('0x4')],_0x3df2c1[_0xa105('0x2c')],_0x3df2c1['calleridname'],_0x3df2c1[_0xa105('0x2d')]));recordings[_0x3df2c1[_0xa105('0x4')]]['calleridnum']=_0x3df2c1[_0xa105('0x2c')];recordings[_0x3df2c1[_0xa105('0x4')]]['calleridname']=_0x3df2c1[_0xa105('0x2e')];recordings[_0x3df2c1[_0xa105('0x4')]]['connectedlinenum']=_0x3df2c1[_0xa105('0x2f')];recordings[_0x3df2c1[_0xa105('0x4')]][_0xa105('0x30')]=_0x3df2c1['connectedlinename'];if(recordings[_0x3df2c1['uniqueid']]['type']==_0xa105('0x31')&&recordings[_0x3df2c1[_0xa105('0x4')]]['accountcode']){recordings[_0x3df2c1[_0xa105('0x4')]][_0xa105('0x2f')]=recordings[_0x3df2c1[_0xa105('0x4')]][_0xa105('0x6')];recordings[_0x3df2c1[_0xa105('0x4')]][_0xa105('0x30')]='';}recordings[_0x3df2c1[_0xa105('0x4')]][_0xa105('0x28')][_0xa105('0x32')](function(_0x37489f){var _0x1ee102=_[_0xa105('0x33')](recordings[_0x3df2c1[_0xa105('0x4')]]);_0x1ee102[_0xa105('0x24')]=_0x37489f[_0xa105('0x24')];writeDB(_0x1ee102);});delete recordings[_0x3df2c1[_0xa105('0x4')]];}}catch(_0xc7fc2f){utils[_0xa105('0x17')](util['format'](_0xa105('0x2a'),_0x3df2c1[_0xa105('0x4')]),_0xc7fc2f);}};exports[_0xa105('0x34')]=function(_0x2bb3d0){try{if(!_[_0xa105('0x1a')](recordings[_0x2bb3d0['uniqueid']])){utils[_0xa105('0xf')](util[_0xa105('0x10')](_0xa105('0x35'),_0x2bb3d0[_0xa105('0x4')]),_0x2bb3d0);utils[_0xa105('0x2')](util[_0xa105('0x10')](_0xa105('0x36'),_0x2bb3d0[_0xa105('0x4')],_0x2bb3d0[_0xa105('0x37')],_0x2bb3d0['appdata']));if(_0x2bb3d0[_0xa105('0x37')][_0xa105('0x38')]()=='set'&&_[_0xa105('0x39')](_0x2bb3d0[_0xa105('0x3a')][_0xa105('0x38')](),_0xa105('0x3b'))){var _0x3aacb5=_0x2bb3d0['appdata']['split']('=');var _0x26c2f7=_0x3aacb5[0x0]['substring'](_0x3aacb5[0x0][_0xa105('0x3c')]('(')+0x1,_0x3aacb5[0x0][_0xa105('0x3c')](')'));var _0x3b2caf=_0x3aacb5[0x1];recordings[_0x2bb3d0[_0xa105('0x4')]][_0x26c2f7]=_0x3b2caf;}}}catch(_0x3c22e4){utils[_0xa105('0x17')](util[_0xa105('0x10')](_0xa105('0x35'),_0x2bb3d0[_0xa105('0x4')]),_0x3c22e4);}};exports[_0xa105('0x3d')]=function(_0x2d171b){try{if(!_[_0xa105('0x1a')](recordings[_0x2d171b[_0xa105('0x4')]])){utils['debug'](util[_0xa105('0x10')](_0xa105('0x3e'),_0x2d171b[_0xa105('0x4')]),_0x2d171b);utils[_0xa105('0x2')](util['format'](_0xa105('0x3f'),_0x2d171b[_0xa105('0x4')],_0x2d171b[_0xa105('0x40')]));recordings[_0x2d171b[_0xa105('0x4')]][_0xa105('0x40')]=_0x2d171b[_0xa105('0x40')];}}catch(_0x3ce3c){utils['error'](util['format'](_0xa105('0x3e'),_0x2d171b['uniqueid']),_0x3ce3c);}};exports['blindtransfer']=function(_0x120aed){try{utils['debug'](util['format']('[%s][recordings][blindtransfer]',_0x120aed[_0xa105('0x4')]),_0x120aed);utils[_0xa105('0x2')](util[_0xa105('0x10')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x120aed[_0xa105('0x4')],_0x120aed['transferercalleridnum'],_0x120aed[_0xa105('0x41')],_0x120aed[_0xa105('0x42')],_0x120aed[_0xa105('0x43')]));if(recordings[_0x120aed[_0xa105('0x44')]]&&transfers[_0xa105('0x5')][_0x120aed[_0xa105('0x44')]]){transfers[_0xa105('0x5')][_0x120aed[_0xa105('0x44')]]['recording']=!![];}}catch(_0x58a5f5){utils[_0xa105('0x17')](util[_0xa105('0x10')](_0xa105('0x45'),_0x120aed[_0xa105('0x4')]),_0x58a5f5);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index f8cdf8f..263f9a5 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 _0x7fb2=['transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','lodash','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','blind','transfereruniqueid','error','attendedtransfer','info','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode'];(function(_0x13c09f,_0x700024){var _0x3ef8b2=function(_0x42eac6){while(--_0x42eac6){_0x13c09f['push'](_0x13c09f['shift']());}};_0x3ef8b2(++_0x700024);}(_0x7fb2,0x1a8));var _0x27fb=function(_0x40db83,_0x3e5848){_0x40db83=_0x40db83-0x0;var _0x533552=_0x7fb2[_0x40db83];return _0x533552;};'use strict';var _=require(_0x27fb('0x0'));var util=require('util');var utils=require(_0x27fb('0x1'));function writeDB(_0x274cf8){utils['info'](util[_0x27fb('0x2')](_0x27fb('0x3'),_0x274cf8[_0x27fb('0x4')]===_0x27fb('0x5')?_0x274cf8[_0x27fb('0x6')]:_0x274cf8['uniqueid'],_0x274cf8[_0x27fb('0x4')]));utils['request'](_0x27fb('0x7'),_0x274cf8);}exports[_0x27fb('0x8')]={};exports[_0x27fb('0x9')]=function(_0x3b38cb){try{utils[_0x27fb('0xa')](util['format'](_0x27fb('0xb'),_0x3b38cb[_0x27fb('0xc')]),_0x3b38cb);utils['info'](util[_0x27fb('0x2')](_0x27fb('0xd'),_0x3b38cb['uniqueid'],_0x3b38cb['transferercalleridnum'],_0x3b38cb[_0x27fb('0xe')],_0x3b38cb[_0x27fb('0xf')],_0x3b38cb['transfereecalleridname']));_0x3b38cb[_0x27fb('0x4')]=_0x27fb('0x10');exports[_0x27fb('0x8')][_0x3b38cb[_0x27fb('0x11')]]=_0x3b38cb;writeDB(_0x3b38cb);}catch(_0x5aecc1){utils[_0x27fb('0x12')](util['format'](_0x27fb('0xb'),_0x3b38cb[_0x27fb('0xc')]),_0x5aecc1);}};exports[_0x27fb('0x13')]=function(_0x3ef149){try{utils['debug'](util['format']('[%s][transfers][attendedtransfer]',_0x3ef149[_0x27fb('0x6')]),_0x3ef149);utils[_0x27fb('0x14')](util[_0x27fb('0x2')](_0x27fb('0x15'),_0x3ef149[_0x27fb('0x6')],_0x3ef149[_0x27fb('0x16')],_0x3ef149[_0x27fb('0x17')],_0x3ef149[_0x27fb('0x18')],_0x3ef149['transfertargetcalleridname']));_0x3ef149=_[_0x27fb('0x19')](_0x3ef149,{'transfererchannel':_0x3ef149[_0x27fb('0x1a')],'transferercalleridnum':_0x3ef149['origtransferercalleridnum'],'transferercalleridname':_0x3ef149['origtransferercalleridname'],'transfererconnectedlinenum':_0x3ef149['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x3ef149['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3ef149['origtransfereraccountcode'],'transferercontext':_0x3ef149[_0x27fb('0x1b')],'transfererexten':_0x3ef149[_0x27fb('0x1c')],'transfererlinkedid':_0x3ef149['origtransfererlinkedid'],'context':_0x3ef149[_0x27fb('0x1d')],'extension':_0x3ef149[_0x27fb('0x1e')],'type':_0x27fb('0x5')});if(_[_0x27fb('0x1f')](_0x3ef149[_0x27fb('0x20')])){_0x3ef149=_[_0x27fb('0x19')](_0x3ef149,{'transfereechannel':_0x3ef149[_0x27fb('0x21')],'transfereecalleridnum':_0x3ef149[_0x27fb('0x18')],'transfereecalleridname':_0x3ef149[_0x27fb('0x22')],'transfereeconnectedlinenum':_0x3ef149[_0x27fb('0x23')],'transfereeconnectedlinename':_0x3ef149[_0x27fb('0x24')],'transfereeaccountcode':_0x3ef149[_0x27fb('0x25')],'transfereecontext':_0x3ef149[_0x27fb('0x26')],'transfereeexten':_0x3ef149[_0x27fb('0x27')],'transfereelinkedid':_0x3ef149[_0x27fb('0x28')]});}writeDB(_0x3ef149);}catch(_0x24ea9c){utils[_0x27fb('0x12')](util[_0x27fb('0x2')](_0x27fb('0x29'),_0x3ef149[_0x27fb('0x6')]),_0x24ea9c);}}; \ No newline at end of file +var _0xb67e=['blinds','debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','[%s][transfers][blindtransfer]','attendedtransfer','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','error','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport'];(function(_0x4b4f29,_0x4ed4e2){var _0x12c5f1=function(_0x27ed63){while(--_0x27ed63){_0x4b4f29['push'](_0x4b4f29['shift']());}};_0x12c5f1(++_0x4ed4e2);}(_0xb67e,0x6f));var _0xeb67=function(_0xcf8ea6,_0x56e11f){_0xcf8ea6=_0xcf8ea6-0x0;var _0x51cdc7=_0xb67e[_0xcf8ea6];return _0x51cdc7;};'use strict';var _=require(_0xeb67('0x0'));var util=require(_0xeb67('0x1'));var utils=require(_0xeb67('0x2'));function writeDB(_0x2e3d15){utils[_0xeb67('0x3')](util[_0xeb67('0x4')](_0xeb67('0x5'),_0x2e3d15[_0xeb67('0x6')]===_0xeb67('0x7')?_0x2e3d15[_0xeb67('0x8')]:_0x2e3d15[_0xeb67('0x9')],_0x2e3d15[_0xeb67('0x6')]));utils[_0xeb67('0xa')](_0xeb67('0xb'),_0x2e3d15);}exports[_0xeb67('0xc')]={};exports['blindtransfer']=function(_0x2e29bb){try{utils[_0xeb67('0xd')](util[_0xeb67('0x4')]('[%s][transfers][blindtransfer]',_0x2e29bb[_0xeb67('0x9')]),_0x2e29bb);utils[_0xeb67('0x3')](util[_0xeb67('0x4')](_0xeb67('0xe'),_0x2e29bb[_0xeb67('0x9')],_0x2e29bb[_0xeb67('0xf')],_0x2e29bb[_0xeb67('0x10')],_0x2e29bb[_0xeb67('0x11')],_0x2e29bb[_0xeb67('0x12')]));_0x2e29bb[_0xeb67('0x6')]=_0xeb67('0x13');exports['blinds'][_0x2e29bb[_0xeb67('0x14')]]=_0x2e29bb;writeDB(_0x2e29bb);}catch(_0x17371f){utils['error'](util[_0xeb67('0x4')](_0xeb67('0x15'),_0x2e29bb[_0xeb67('0x9')]),_0x17371f);}};exports[_0xeb67('0x16')]=function(_0x19440b){try{utils[_0xeb67('0xd')](util[_0xeb67('0x4')]('[%s][transfers][attendedtransfer]',_0x19440b['origtransfereruniqueid']),_0x19440b);utils[_0xeb67('0x3')](util[_0xeb67('0x4')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x19440b['origtransfereruniqueid'],_0x19440b[_0xeb67('0x17')],_0x19440b[_0xeb67('0x18')],_0x19440b[_0xeb67('0x19')],_0x19440b['transfertargetcalleridname']));_0x19440b=_[_0xeb67('0x1a')](_0x19440b,{'transfererchannel':_0x19440b['origtransfererchannel'],'transferercalleridnum':_0x19440b[_0xeb67('0x17')],'transferercalleridname':_0x19440b[_0xeb67('0x18')],'transfererconnectedlinenum':_0x19440b[_0xeb67('0x1b')],'transfererconnectedlinename':_0x19440b['secondtransfererconnectedlinename'],'transfereraccountcode':_0x19440b[_0xeb67('0x1c')],'transferercontext':_0x19440b[_0xeb67('0x1d')],'transfererexten':_0x19440b[_0xeb67('0x1e')],'transfererlinkedid':_0x19440b['origtransfererlinkedid'],'context':_0x19440b[_0xeb67('0x1f')],'extension':_0x19440b['origtransfererexten'],'type':'attended'});if(_[_0xeb67('0x20')](_0x19440b[_0xeb67('0x21')])){_0x19440b=_[_0xeb67('0x1a')](_0x19440b,{'transfereechannel':_0x19440b[_0xeb67('0x22')],'transfereecalleridnum':_0x19440b['transfertargetcalleridnum'],'transfereecalleridname':_0x19440b[_0xeb67('0x23')],'transfereeconnectedlinenum':_0x19440b['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x19440b[_0xeb67('0x24')],'transfereeaccountcode':_0x19440b[_0xeb67('0x25')],'transfereecontext':_0x19440b['transfertargetcontext'],'transfereeexten':_0x19440b[_0xeb67('0x26')],'transfereelinkedid':_0x19440b[_0xeb67('0x27')]});}writeDB(_0x19440b);}catch(_0x1ebc45){utils[_0xeb67('0x28')](util['format']('[%s][transfers][attendedtransfer]',_0x19440b[_0xeb67('0x8')]),_0x1ebc45);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 610290a..2468254 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 _0x01aa=['bluebird','jayson/promise','util','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','name','interface','[utils][getUser]\x20where:%s','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','GetVoiceQueue','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','result','[utils][getVoiceQueueByName]','addTime','add','subtractTime','subtract','seconds','format','diffTime','diff','sumTime','now','isAfter','isBefore'];(function(_0x59531c,_0x22cd3f){var _0x220a99=function(_0x1ed609){while(--_0x1ed609){_0x59531c['push'](_0x59531c['shift']());}};_0x220a99(++_0x22cd3f);}(_0x01aa,0x1ef));var _0xa01a=function(_0x34bf1b,_0x19d373){_0x34bf1b=_0x34bf1b-0x0;var _0x12976b=_0x01aa[_0x34bf1b];return _0x12976b;};'use strict';var BPromise=require(_0xa01a('0x0'));var jayson=require(_0xa01a('0x1'));var moment=require('moment');var util=require(_0xa01a('0x2'));var client=jayson['client']['http']({'port':0x2329});var logger=require(_0xa01a('0x3'))(_0xa01a('0x4'));exports[_0xa01a('0x5')]=function(_0x19843b,_0x4ab7aa){logger[_0xa01a('0x5')](_0x19843b,_0x4ab7aa?util[_0xa01a('0x6')](_0x4ab7aa,{'showHidden':![],'depth':null}):'');};exports[_0xa01a('0x7')]=function(_0x406d4f,_0x3892e5){logger['debug'](_0x406d4f,_0x3892e5?util['inspect'](_0x3892e5,{'showHidden':![],'depth':null}):'');};exports[_0xa01a('0x8')]=function(_0x3803c3,_0x497e57){logger[_0xa01a('0x8')](_0x3803c3,_0x497e57?util[_0xa01a('0x6')](_0x497e57,{'showHidden':![],'depth':null}):'');};exports[_0xa01a('0x9')]=function(_0x3c0a0d,_0x258454){return client['request'](_0x3c0a0d,{'body':_0x258454})[_0xa01a('0xa')](function(_0x70db91){logger['debug'](_0xa01a('0xb'),_0x3c0a0d,_0x70db91?util[_0xa01a('0x6')](_0x70db91,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x34c37e){logger[_0xa01a('0x8')](_0xa01a('0xb'),_0x3c0a0d,_0x34c37e?util[_0xa01a('0x6')](_0x34c37e,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3e9590){return client[_0xa01a('0x9')]('GetUser',{'options':{'raw':!![],'attributes':['id','internal',_0xa01a('0xc'),_0xa01a('0xd')],'where':_0x3e9590,'limit':0x1}})['then'](function(_0x1056dc){logger['debug'](_0xa01a('0xe'),JSON['stringify'](_0x3e9590),_0x1056dc?util[_0xa01a('0x6')](_0x1056dc,{'showHidden':![],'depth':null}):'');return _0x1056dc['result'][_0xa01a('0xf')]?_0x1056dc['result'][0x0]:null;});}exports[_0xa01a('0x10')]=function(_0x4545b3){return new BPromise(function(_0x2a3a8f,_0x5b47bd){if(_0x4545b3){return getUser({'internal':_0x4545b3})[_0xa01a('0xa')](function(_0xa5e72e){logger[_0xa01a('0x5')](_0xa01a('0x11'),_0x4545b3,_0xa5e72e?_0xa01a('0x12'):_0xa01a('0x13'));return _0x2a3a8f(_0xa5e72e);})[_0xa01a('0x14')](function(_0x58e23a){logger['error'](_0xa01a('0x15'),_0x58e23a?util[_0xa01a('0x6')](_0x58e23a,{'showHidden':![],'depth':null}):'');return _0x2a3a8f(null);});}return _0x2a3a8f(null);});};exports['getUserByInterface']=function(_0x50a7c9){return new BPromise(function(_0x437892,_0x30f93b){if(_0x50a7c9){return getUser({'interface':_0x50a7c9})[_0xa01a('0xa')](function(_0x3527fc){logger[_0xa01a('0x5')](_0xa01a('0x16'),_0x50a7c9,_0x3527fc?_0xa01a('0x12'):_0xa01a('0x13'));return _0x437892(_0x3527fc);})[_0xa01a('0x14')](function(_0x49d524){logger[_0xa01a('0x8')](_0xa01a('0x17'),_0x49d524?util[_0xa01a('0x6')](_0x49d524,{'showHidden':![],'depth':null}):'');return _0x437892(null);});}return _0x437892(null);});};exports[_0xa01a('0x18')]=function(_0x41d8f2){return new BPromise(function(_0xcd060c,_0x3bab3a){if(_0x41d8f2){return getUser({'name':_0x41d8f2})[_0xa01a('0xa')](function(_0x5d35af){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x41d8f2,_0x5d35af?'found':_0xa01a('0x13'));return _0xcd060c(_0x5d35af);})[_0xa01a('0x14')](function(_0x218219){logger[_0xa01a('0x8')](_0xa01a('0x19'),_0x218219?util[_0xa01a('0x6')](_0x218219,{'showHidden':![],'depth':null}):'');return _0xcd060c(null);});}return _0xcd060c(null);});};exports['getVoiceQueueByName']=function(_0x3b086d){return new BPromise(function(_0x17325c,_0x196e23){if(_0x3b086d){return client[_0xa01a('0x9')](_0xa01a('0x1a'),{'options':{'raw':!![],'attributes':['id',_0xa01a('0xc'),'type',_0xa01a('0x1b'),_0xa01a('0x1c')],'where':{'name':_0x3b086d},'limit':0x1}})['then'](function(_0x5c640f){logger[_0xa01a('0x7')](_0xa01a('0x1d'),_0x3b086d,_0x5c640f?util['inspect'](_0x5c640f,{'showHidden':![],'depth':null}):'');logger[_0xa01a('0x5')](_0xa01a('0x1e'),_0x3b086d,_0x5c640f?_0xa01a('0x12'):_0xa01a('0x13'));return _0x17325c(_0x5c640f['result'][_0xa01a('0xf')]?_0x5c640f[_0xa01a('0x1f')][0x0]:null);})['catch'](function(_0x2e21e4){logger[_0xa01a('0x8')](_0xa01a('0x20'),_0x2e21e4?util[_0xa01a('0x6')](_0x2e21e4,{'showHidden':![],'depth':null}):'');return _0x17325c(null);});}return _0x17325c(null);});};exports[_0xa01a('0x21')]=function(_0x16801b,_0x5956e1){return moment(_0x16801b)[_0xa01a('0x22')](_0x5956e1,'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xa01a('0x23')]=function(_0x3a2bb8,_0x2646f4){return moment(_0x3a2bb8)[_0xa01a('0x24')](_0x2646f4,_0xa01a('0x25'))[_0xa01a('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xa01a('0x27')]=function(_0x5605be,_0x3bb571){return moment(_0x5605be)[_0xa01a('0x28')](moment(_0x3bb571),_0xa01a('0x25'));};exports[_0xa01a('0x29')]=function(_0x2c5b1a,_0x490c6c){return parseInt(_0x2c5b1a,0xa)+parseInt(_0x490c6c,0xa);};exports[_0xa01a('0x2a')]=function(){return moment()[_0xa01a('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xa01a('0x2b')]=function(_0x39a22b,_0x4d069c){if(_0x4d069c){return moment(_0x39a22b)['isAfter'](_0x4d069c);}return!![];};exports[_0xa01a('0x2c')]=function(_0x5c3106,_0x5f27b3){if(_0x5f27b3){return moment(_0x5c3106)[_0xa01a('0x2c')](_0x5f27b3);}else if(_0x5c3106){return!![];}return![];}; \ No newline at end of file +var _0x04db=['length','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','[utils][getUserByInternal]','found','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','type','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','format','diffTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','info','inspect','error','request','then','debug','[utils][request]\x20name:%s','catch','GetUser','name','interface','[utils][getUser]\x20where:%s','stringify','result'];(function(_0x11af42,_0x88c201){var _0x24a5d8=function(_0x18fa0d){while(--_0x18fa0d){_0x11af42['push'](_0x11af42['shift']());}};_0x24a5d8(++_0x88c201);}(_0x04db,0x6a));var _0xb04d=function(_0x5305ab,_0x5ad712){_0x5305ab=_0x5305ab-0x0;var _0x222544=_0x04db[_0x5305ab];return _0x222544;};'use strict';var BPromise=require(_0xb04d('0x0'));var jayson=require(_0xb04d('0x1'));var moment=require(_0xb04d('0x2'));var util=require(_0xb04d('0x3'));var client=jayson[_0xb04d('0x4')][_0xb04d('0x5')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports['info']=function(_0x3d52a1,_0x309337){logger[_0xb04d('0x6')](_0x3d52a1,_0x309337?util[_0xb04d('0x7')](_0x309337,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x4d07b1,_0x55b6e5){logger['debug'](_0x4d07b1,_0x55b6e5?util[_0xb04d('0x7')](_0x55b6e5,{'showHidden':![],'depth':null}):'');};exports[_0xb04d('0x8')]=function(_0x51cf81,_0x4af65b){logger[_0xb04d('0x8')](_0x51cf81,_0x4af65b?util[_0xb04d('0x7')](_0x4af65b,{'showHidden':![],'depth':null}):'');};exports[_0xb04d('0x9')]=function(_0x4396b8,_0x5cee8b){return client[_0xb04d('0x9')](_0x4396b8,{'body':_0x5cee8b})[_0xb04d('0xa')](function(_0x2ba38c){logger[_0xb04d('0xb')](_0xb04d('0xc'),_0x4396b8,_0x2ba38c?util['inspect'](_0x2ba38c,{'showHidden':![],'depth':null}):'');})[_0xb04d('0xd')](function(_0x35c371){logger[_0xb04d('0x8')]('[utils][request]\x20name:%s',_0x4396b8,_0x35c371?util[_0xb04d('0x7')](_0x35c371,{'showHidden':![],'depth':null}):'');});};function getUser(_0x503a04){return client[_0xb04d('0x9')](_0xb04d('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0xb04d('0xf'),_0xb04d('0x10')],'where':_0x503a04,'limit':0x1}})['then'](function(_0x2efdf8){logger['debug'](_0xb04d('0x11'),JSON[_0xb04d('0x12')](_0x503a04),_0x2efdf8?util[_0xb04d('0x7')](_0x2efdf8,{'showHidden':![],'depth':null}):'');return _0x2efdf8[_0xb04d('0x13')][_0xb04d('0x14')]?_0x2efdf8['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x3dd072){return new BPromise(function(_0x4a5253,_0x1146ad){if(_0x3dd072){return getUser({'internal':_0x3dd072})['then'](function(_0x10e5c2){logger['info'](_0xb04d('0x15'),_0x3dd072,_0x10e5c2?'found':_0xb04d('0x16'));return _0x4a5253(_0x10e5c2);})['catch'](function(_0x44fc8f){logger[_0xb04d('0x8')](_0xb04d('0x17'),_0x44fc8f?util['inspect'](_0x44fc8f,{'showHidden':![],'depth':null}):'');return _0x4a5253(null);});}return _0x4a5253(null);});};exports['getUserByInterface']=function(_0x3b8a10){return new BPromise(function(_0x531ec0,_0xb4c63e){if(_0x3b8a10){return getUser({'interface':_0x3b8a10})[_0xb04d('0xa')](function(_0x2f1bfb){logger[_0xb04d('0x6')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x3b8a10,_0x2f1bfb?_0xb04d('0x18'):'notfound');return _0x531ec0(_0x2f1bfb);})['catch'](function(_0x31062e){logger[_0xb04d('0x8')](_0xb04d('0x19'),_0x31062e?util[_0xb04d('0x7')](_0x31062e,{'showHidden':![],'depth':null}):'');return _0x531ec0(null);});}return _0x531ec0(null);});};exports['getUserByName']=function(_0x17c13c){return new BPromise(function(_0x1fc130,_0x1eea69){if(_0x17c13c){return getUser({'name':_0x17c13c})[_0xb04d('0xa')](function(_0x1d7b98){logger['info'](_0xb04d('0x1a'),_0x17c13c,_0x1d7b98?_0xb04d('0x18'):_0xb04d('0x16'));return _0x1fc130(_0x1d7b98);})[_0xb04d('0xd')](function(_0x3571c5){logger[_0xb04d('0x8')](_0xb04d('0x1b'),_0x3571c5?util[_0xb04d('0x7')](_0x3571c5,{'showHidden':![],'depth':null}):'');return _0x1fc130(null);});}return _0x1fc130(null);});};exports['getVoiceQueueByName']=function(_0x14e59d){return new BPromise(function(_0x1671ae,_0x57f442){if(_0x14e59d){return client[_0xb04d('0x9')](_0xb04d('0x1c'),{'options':{'raw':!![],'attributes':['id',_0xb04d('0xf'),_0xb04d('0x1d'),'acw','acwTimeout'],'where':{'name':_0x14e59d},'limit':0x1}})[_0xb04d('0xa')](function(_0x2e959c){logger[_0xb04d('0xb')]('[utils][getVoiceQueueByName]\x20name:%s',_0x14e59d,_0x2e959c?util[_0xb04d('0x7')](_0x2e959c,{'showHidden':![],'depth':null}):'');logger['info'](_0xb04d('0x1e'),_0x14e59d,_0x2e959c?_0xb04d('0x18'):'notfound');return _0x1671ae(_0x2e959c[_0xb04d('0x13')][_0xb04d('0x14')]?_0x2e959c[_0xb04d('0x13')][0x0]:null);})['catch'](function(_0x1c5842){logger[_0xb04d('0x8')](_0xb04d('0x1f'),_0x1c5842?util[_0xb04d('0x7')](_0x1c5842,{'showHidden':![],'depth':null}):'');return _0x1671ae(null);});}return _0x1671ae(null);});};exports[_0xb04d('0x20')]=function(_0x3a8a2b,_0x7abef7){return moment(_0x3a8a2b)['add'](_0x7abef7,'seconds')['format'](_0xb04d('0x21'));};exports[_0xb04d('0x22')]=function(_0x2e0861,_0x1ee89d){return moment(_0x2e0861)[_0xb04d('0x23')](_0x1ee89d,_0xb04d('0x24'))[_0xb04d('0x25')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xb04d('0x26')]=function(_0x4d0665,_0x262c29){return moment(_0x4d0665)['diff'](moment(_0x262c29),_0xb04d('0x24'));};exports['sumTime']=function(_0x41b63c,_0x200634){return parseInt(_0x41b63c,0xa)+parseInt(_0x200634,0xa);};exports[_0xb04d('0x27')]=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xb04d('0x28')]=function(_0x2da4e5,_0x1af5be){if(_0x1af5be){return moment(_0x2da4e5)['isAfter'](_0x1af5be);}return!![];};exports[_0xb04d('0x29')]=function(_0x49a75d,_0x4f3847){if(_0x4f3847){return moment(_0x49a75d)['isBefore'](_0x4f3847);}else if(_0x49a75d){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 c47dad4..ad7e77f 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 _0x3e60=['lodash','path','util','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','log','xcally','role','name','ensureDir','then','client','catch','user','no-user','data','timestamp','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','method','headers','x-forwarded-for','connection','url','statusCode','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','remoteAddress','responseTime','agent_id','agent_name','setupLoggers','fs-extra'];(function(_0x54cdbe,_0x125fa4){var _0x52d8df=function(_0x41e1d3){while(--_0x41e1d3){_0x54cdbe['push'](_0x54cdbe['shift']());}};_0x52d8df(++_0x125fa4);}(_0x3e60,0x1c1));var _0x03e6=function(_0x5a5395,_0x5361f6){_0x5a5395=_0x5a5395-0x0;var _0x4da43d=_0x3e60[_0x5a5395];return _0x4da43d;};var fs=require(_0x03e6('0x0'));var _=require(_0x03e6('0x1'));var ewinston=require('express-winston');var path=require(_0x03e6('0x2'));var util=require(_0x03e6('0x3'));var fileLogger=require('./loggers')[_0x03e6('0x4')];var safeTemplate=require(_0x03e6('0x5'))[_0x03e6('0x6')];var maskSensitiveData=require(_0x03e6('0x7'))['maskSensitiveData'];function ClientSideLogger(){function _0x12a2c4(_0x2a1956){var _0x15930a=path[_0x03e6('0x8')](_0x03e6('0x9'),_0x03e6('0xa'),_0x03e6('0xb'));var _0x175c05=path[_0x03e6('0x8')]('client',_0x2a1956[_0x03e6('0xc')]+'-'+_0x2a1956[_0x03e6('0xd')]);return fs[_0x03e6('0xe')](path[_0x03e6('0x8')](_0x15930a,_0x175c05))[_0x03e6('0xf')](function(){var _0x3d77c6=fileLogger(_0x03e6('0x10'),path['join'](_0x15930a,_0x175c05));return _0x3d77c6;})[_0x03e6('0x11')](function(_0x218c97){throw _0x218c97;});}this[_0x03e6('0xa')]=function(_0x85674,_0x5b0a4c,_0x2cae46,_0x379e01){return _0x12a2c4(_0x85674[_0x03e6('0x12')])['then'](function(_0x5e5c1d){var _0x3bf510=_0x5e5c1d[_0x5b0a4c];return _0x3bf510;})[_0x03e6('0xf')](function(_0x2b0998){var _0x3385c9=_0x85674[_0x03e6('0x12')]?_0x85674[_0x03e6('0x12')]['id']:_0x03e6('0x13');var _0x265c2d=_0x379e01[_0x03e6('0x14')];var _0x430d13=_0x379e01[_0x03e6('0x15')];var _0x29839c=new Date(Number(_0x430d13));return _0x2b0998(_0x3385c9,_0x29839c,_0x2cae46,_0x265c2d);})[_0x03e6('0x11')](function(_0x5613d4){fileLogger(_0x03e6('0x10'))['error'](_0x5613d4);});};}function setupLoggers(_0x3dd2aa){return new Promise(function(_0x3bdded){var _0x2aec48=new ClientSideLogger();var _0x5828cb=fileLogger(_0x03e6('0x16'));var _0x2098fb=fileLogger(_0x03e6('0x17'));_0x3dd2aa[_0x03e6('0x18')](_0x03e6('0x19'),_0x2aec48);_0x3dd2aa[_0x03e6('0x1a')](ewinston[_0x03e6('0x1b')]({'winstonInstance':_0x5828cb,'meta':![],'statusLevels':!![],'msg':function(_0x317537,_0x38e7dd){var _0x317f68=_0x03e6('0x1c');if(!_[_0x03e6('0x1d')](_0x317537[_0x03e6('0x1e')])){_0x317f68+='\x20body=%s';var _0x37932c=_0x317537['body'];maskSensitiveData(_0x37932c);}return safeTemplate(util['format'](_0x317f68,_0x317537[_0x03e6('0x1f')],_0x317537['headers']['x-forwarded-for']?_0x317537[_0x03e6('0x20')][_0x03e6('0x21')]:_0x317537[_0x03e6('0x22')]['remoteAddress']||_0x317537['ip'],_0x317537[_0x03e6('0x23')],_0x38e7dd[_0x03e6('0x24')],_0x38e7dd['responseTime'],_0x317537[_0x03e6('0x12')]?_0x317537[_0x03e6('0x12')]['id']:null,_0x317537[_0x03e6('0x12')]?_0x317537[_0x03e6('0x12')][_0x03e6('0xd')]:null,_0x317537[_0x03e6('0x12')]?_0x317537[_0x03e6('0x12')]['role']:null,_0x37932c?util['inspect'](_0x37932c,![],null):''));}}));_0x3dd2aa[_0x03e6('0x1a')](ewinston[_0x03e6('0x1b')]({'winstonInstance':_0x2098fb,'meta':![],'statusLevels':!![],'msg':function(_0x2f92c6,_0xed5910){var _0x701871='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x2f92c6[_0x03e6('0x1e')]&&_0x2f92c6['body'][_0x03e6('0x25')]&&_0x2f92c6[_0x03e6('0x1e')]['agent_id']){_0x701871=_0x03e6('0x26');}return util[_0x03e6('0x27')](_0x701871,_0x2f92c6[_0x03e6('0x1f')],_0x2f92c6[_0x03e6('0x20')][_0x03e6('0x21')]?_0x2f92c6['headers'][_0x03e6('0x21')]:_0x2f92c6[_0x03e6('0x22')][_0x03e6('0x28')]||_0x2f92c6['ip'],_0x2f92c6[_0x03e6('0x23')],_0xed5910[_0x03e6('0x24')],_0xed5910[_0x03e6('0x29')],_0x2f92c6['user']?_0x2f92c6[_0x03e6('0x12')]['id']:null,_0x2f92c6[_0x03e6('0x12')]?_0x2f92c6[_0x03e6('0x12')][_0x03e6('0xd')]:null,_0x2f92c6[_0x03e6('0x12')]?_0x2f92c6[_0x03e6('0x12')][_0x03e6('0xc')]:null,_0x2f92c6[_0x03e6('0x1e')]&&_0x2f92c6[_0x03e6('0x1e')][_0x03e6('0x25')]?_0x2f92c6['body']['device']:'other',_0x2f92c6[_0x03e6('0x1e')]&&_0x2f92c6[_0x03e6('0x1e')][_0x03e6('0x2a')]?_0x2f92c6['body'][_0x03e6('0x2a')]:'',_0x2f92c6[_0x03e6('0x1e')]&&_0x2f92c6['body'][_0x03e6('0x2b')]?_0x2f92c6[_0x03e6('0x1e')][_0x03e6('0x2b')]:'');},'ignoreRoute':function(_0x311798){var _0x1fda78=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1fda78['test'](_0x311798['url']);}}));return _0x3bdded();});}exports[_0x03e6('0x2c')]=setupLoggers; \ No newline at end of file +var _0xe53b=['timestamp','error','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','x-forwarded-for','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','headers','remoteAddress','statusCode','other','agent_name','test','url','setupLoggers','lodash','express-winston','util','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','log','role','name','ensureDir','then','client','catch','user','no-user','data'];(function(_0x307583,_0x28983a){var _0x4b7055=function(_0x2276a6){while(--_0x2276a6){_0x307583['push'](_0x307583['shift']());}};_0x4b7055(++_0x28983a);}(_0xe53b,0x15d));var _0xbe53=function(_0x2a8150,_0x38262b){_0x2a8150=_0x2a8150-0x0;var _0x4472a3=_0xe53b[_0x2a8150];return _0x4472a3;};var fs=require('fs-extra');var _=require(_0xbe53('0x0'));var ewinston=require(_0xbe53('0x1'));var path=require('path');var util=require(_0xbe53('0x2'));var fileLogger=require('./loggers')[_0xbe53('0x3')];var safeTemplate=require(_0xbe53('0x4'))[_0xbe53('0x5')];var maskSensitiveData=require(_0xbe53('0x6'))['maskSensitiveData'];function ClientSideLogger(){function _0x368e5f(_0x364ce4){var _0x2e5e58=path[_0xbe53('0x7')](_0xbe53('0x8'),_0xbe53('0x9'),'xcally');var _0x34222a=path[_0xbe53('0x7')]('client',_0x364ce4[_0xbe53('0xa')]+'-'+_0x364ce4[_0xbe53('0xb')]);return fs[_0xbe53('0xc')](path[_0xbe53('0x7')](_0x2e5e58,_0x34222a))[_0xbe53('0xd')](function(){var _0xcbbf27=fileLogger(_0xbe53('0xe'),path[_0xbe53('0x7')](_0x2e5e58,_0x34222a));return _0xcbbf27;})[_0xbe53('0xf')](function(_0x43123f){throw _0x43123f;});}this[_0xbe53('0x9')]=function(_0x213075,_0x45385e,_0xe34562,_0x226660){return _0x368e5f(_0x213075[_0xbe53('0x10')])[_0xbe53('0xd')](function(_0x388382){var _0x4bdc07=_0x388382[_0x45385e];return _0x4bdc07;})[_0xbe53('0xd')](function(_0x152fab){var _0x28a719=_0x213075[_0xbe53('0x10')]?_0x213075[_0xbe53('0x10')]['id']:_0xbe53('0x11');var _0x19cbbb=_0x226660[_0xbe53('0x12')];var _0x335f13=_0x226660[_0xbe53('0x13')];var _0x41344b=new Date(Number(_0x335f13));return _0x152fab(_0x28a719,_0x41344b,_0xe34562,_0x19cbbb);})['catch'](function(_0x1798b3){fileLogger('client')[_0xbe53('0x14')](_0x1798b3);});};}function setupLoggers(_0x36a656){return new Promise(function(_0x33d955){var _0x234149=new ClientSideLogger();var _0x3a76b8=fileLogger('api');var _0x4dfe08=fileLogger(_0xbe53('0x15'));_0x36a656[_0xbe53('0x16')](_0xbe53('0x17'),_0x234149);_0x36a656[_0xbe53('0x18')](ewinston[_0xbe53('0x19')]({'winstonInstance':_0x3a76b8,'meta':![],'statusLevels':!![],'msg':function(_0x144376,_0x22a069){var _0x403b13=_0xbe53('0x1a');if(!_['isEmpty'](_0x144376[_0xbe53('0x1b')])){_0x403b13+=_0xbe53('0x1c');var _0x4345f8=_0x144376[_0xbe53('0x1b')];maskSensitiveData(_0x4345f8);}return safeTemplate(util[_0xbe53('0x1d')](_0x403b13,_0x144376[_0xbe53('0x1e')],_0x144376['headers']['x-forwarded-for']?_0x144376['headers'][_0xbe53('0x1f')]:_0x144376['connection']['remoteAddress']||_0x144376['ip'],_0x144376['url'],_0x22a069['statusCode'],_0x22a069[_0xbe53('0x20')],_0x144376[_0xbe53('0x10')]?_0x144376[_0xbe53('0x10')]['id']:null,_0x144376['user']?_0x144376[_0xbe53('0x10')][_0xbe53('0xb')]:null,_0x144376[_0xbe53('0x10')]?_0x144376['user'][_0xbe53('0xa')]:null,_0x4345f8?util[_0xbe53('0x21')](_0x4345f8,![],null):''));}}));_0x36a656[_0xbe53('0x18')](ewinston[_0xbe53('0x19')]({'winstonInstance':_0x4dfe08,'meta':![],'statusLevels':!![],'msg':function(_0x1c846b,_0x3bba07){var _0x2a2128=_0xbe53('0x22');if(_0x1c846b['body']&&_0x1c846b[_0xbe53('0x1b')][_0xbe53('0x23')]&&_0x1c846b[_0xbe53('0x1b')][_0xbe53('0x24')]){_0x2a2128=_0xbe53('0x25');}return util['format'](_0x2a2128,_0x1c846b[_0xbe53('0x1e')],_0x1c846b[_0xbe53('0x26')]['x-forwarded-for']?_0x1c846b['headers'][_0xbe53('0x1f')]:_0x1c846b['connection'][_0xbe53('0x27')]||_0x1c846b['ip'],_0x1c846b['url'],_0x3bba07[_0xbe53('0x28')],_0x3bba07['responseTime'],_0x1c846b[_0xbe53('0x10')]?_0x1c846b['user']['id']:null,_0x1c846b[_0xbe53('0x10')]?_0x1c846b['user'][_0xbe53('0xb')]:null,_0x1c846b[_0xbe53('0x10')]?_0x1c846b[_0xbe53('0x10')][_0xbe53('0xa')]:null,_0x1c846b[_0xbe53('0x1b')]&&_0x1c846b['body']['device']?_0x1c846b[_0xbe53('0x1b')][_0xbe53('0x23')]:_0xbe53('0x29'),_0x1c846b[_0xbe53('0x1b')]&&_0x1c846b['body'][_0xbe53('0x24')]?_0x1c846b[_0xbe53('0x1b')][_0xbe53('0x24')]:'',_0x1c846b[_0xbe53('0x1b')]&&_0x1c846b['body']['agent_name']?_0x1c846b[_0xbe53('0x1b')][_0xbe53('0x2a')]:'');},'ignoreRoute':function(_0x34f44d){var _0x17480d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x17480d[_0xbe53('0x2b')](_0x34f44d[_0xbe53('0x2c')]);}}));return _0x33d955();});}exports[_0xbe53('0x2d')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 7a949e8..daf5837 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47e0=['monthsShort','map','circularMonthInterval','clone','minutes','hours','day','endOf','isBetween','format','ddd','includes','dowCompare','daysInMonth','min','max','domCompare','monthCompare','guess','isMoment','padStart','length','moment-timezone','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','locale','toLowerCase','indexOf','slice','concat','exports'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x47e0,0x1f2));var _0x047e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x47e0[_0x20a584];return _0x4b41a8;};var _=require('lodash');var moment=require(_0x047e('0x0'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx]['map'](function(_0x522fde){return _0x522fde['source'];})[_0x047e('0x1')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x047e('0x2');var EINVALID_DATE=_0x047e('0x3');function throwIfDateNotValid(_0x5951d0){if(!_0x5951d0[_0x047e('0x4')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x4dd78a){var _0x5ab727=_0x4dd78a[_0x047e('0x5')](':')['map'](function(_0x406275){return parseInt(_0x406275,0xa);});var _0x42aa2d=_0x5ab727[0x0];var _0xb60a89=_0x5ab727[0x1];if(_0x42aa2d<0x0||_0x42aa2d>0x17||_0xb60a89<0x0||_0xb60a89>0x3b){throw new Error(EINVALID_DATE);}return[_0x42aa2d,_0xb60a89];}function circularDoWInterval(_0x2240bd,_0x293215){if(_0x2240bd===_0x293215){return[_0x2240bd];}else{var _0x437c89=moment[_0x047e('0x6')]();moment[_0x047e('0x6')]('en');var _0x446708=moment['weekdaysShort']()['map'](function(_0x2a425c){return _0x2a425c[_0x047e('0x7')]();});moment[_0x047e('0x6')](_0x437c89);var _0x2b041b=_0x446708['indexOf'](_0x2240bd);var _0xa86f59=_0x446708[_0x047e('0x8')](_0x293215);if(_0xa86f59>_0x2b041b){return _0x446708[_0x047e('0x9')](_0x2b041b,_0xa86f59+0x1);}else{var _0x55caf8=_0x446708[_0x047e('0x9')](0x0,_0xa86f59+0x1);var _0x201bf2=_0x446708[_0x047e('0x9')](_0x2b041b);return _0x201bf2[_0x047e('0xa')](_0x55caf8);}}}module[_0x047e('0xb')]['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x18e736,_0xb01638){if(_0x18e736===_0xb01638){return[_0x18e736];}else{var _0x18f4a4=moment[_0x047e('0x6')]();moment[_0x047e('0x6')]('en');var _0x58f237=moment[_0x047e('0xc')]()[_0x047e('0xd')](function(_0x4ad6f8){return _0x4ad6f8[_0x047e('0x7')]();});moment[_0x047e('0x6')](_0x18f4a4);var _0x584147=_0x58f237[_0x047e('0x8')](_0x18e736);var _0xf6a4e9=_0x58f237[_0x047e('0x8')](_0xb01638);if(_0xf6a4e9>_0x584147){return _0x58f237['slice'](_0x584147,_0xf6a4e9+0x1);}else{var _0x3871d7=_0x58f237['slice'](0x0,_0xf6a4e9+0x1);var _0x1b0483=_0x58f237['slice'](_0x584147);return _0x1b0483[_0x047e('0xa')](_0x3871d7);}}}module[_0x047e('0xb')][_0x047e('0xe')]=circularMonthInterval;function parseDom(_0x104cd7){var _0x68fb36=parseInt(_0x104cd7,0xa);if(_0x68fb36<0x1||_0x68fb36>0x1f){throw new Error(EINVALID_DATE);}return _0x68fb36;}function timeCompare(_0x26ea87,_0x156a18,_0x21c100){var _0x31492a=_0x26ea87[_0x047e('0xf')]();var _0x25aaf8=extractTime(_0x156a18);var _0x3b4537=_0x25aaf8[0x0];var _0x135c8c=_0x25aaf8[0x1];var _0x42d00=_0x26ea87[_0x047e('0xf')]()['hours'](_0x3b4537)[_0x047e('0x10')](_0x135c8c);throwIfDateNotValid(_0x42d00);var _0x56a421=extractTime(_0x21c100);var _0x65b602=_0x56a421[0x0];var _0x294e53=_0x56a421[0x1];var _0x3412d4=_0x26ea87[_0x047e('0xf')]()[_0x047e('0x11')](_0x65b602)['minutes'](_0x294e53);throwIfDateNotValid(_0x3412d4);if(_0x3412d4['isBefore'](_0x42d00)){var _0x264528=_0x31492a['clone']()['startOf'](_0x047e('0x12'));var _0x5683b8=_0x31492a[_0x047e('0xf')]()[_0x047e('0x13')](_0x047e('0x12'));return _0x31492a[_0x047e('0x14')](_0x42d00,_0x5683b8,undefined,'[]')||_0x31492a[_0x047e('0x14')](_0x264528,_0x3412d4,undefined,'[]');}else{return _0x31492a[_0x047e('0x14')](_0x42d00,_0x3412d4,undefined,'[]');}}module['exports']['timeCompare']=timeCompare;function dowCompare(_0x5df54a,_0x43564d,_0x186813){var _0x10bdaa=_0x5df54a[_0x047e('0x6')]('en')[_0x047e('0x15')](_0x047e('0x16'))[_0x047e('0x7')]();return circularDoWInterval(_0x43564d,_0x186813)[_0x047e('0x17')](_0x10bdaa);}module[_0x047e('0xb')][_0x047e('0x18')]=dowCompare;function domCompare(_0x2af856,_0x4b9823,_0x28e8db){var _0x4630dd=_0x2af856['date']();if(_0x4b9823===_0x28e8db){return _0x4630dd===_0x4b9823;}else{var _0x305929=_0x2af856[_0x047e('0x19')]();var _0x13c765=_0x4b9823<_0x28e8db;let _0x4b4380=![];var _0x4c1bf6=0x0;var _0x3c9e6d=0x0;if(_0x13c765){_0x4c1bf6=Math['max'](0x1,_0x4b9823);_0x3c9e6d=Math[_0x047e('0x1a')](_0x28e8db,_0x305929);_0x4b4380=_0x4630dd>=_0x4c1bf6&&_0x4630dd<=_0x3c9e6d;}else{_0x4c1bf6=Math['min'](_0x4b9823,_0x305929);_0x3c9e6d=Math[_0x047e('0x1b')](0x1,_0x28e8db);_0x4b4380=_0x4630dd>=_0x4c1bf6||_0x4630dd<=_0x3c9e6d;}return _0x4b4380;}}module[_0x047e('0xb')][_0x047e('0x1c')]=domCompare;function monthCompare(_0x46884e,_0x1f5006,_0x242f48){var _0x5c9ad4=_0x46884e[_0x047e('0x6')]('en')[_0x047e('0x15')]('MMM')[_0x047e('0x7')]();return circularMonthInterval(_0x1f5006,_0x242f48)[_0x047e('0x17')](_0x5c9ad4);}module[_0x047e('0xb')][_0x047e('0x1d')]=monthCompare;function iftime(_0x14d497,_0x3e0690=moment['tz'][_0x047e('0x1e')](),_0x701ebd=moment()){if(!validateRx['test'](_0x14d497)){throw new Error(EINVALID_STRING);}else{var _0x40a049=(moment[_0x047e('0x1f')](_0x701ebd)?_0x701ebd[_0x047e('0xf')]():moment(_0x701ebd))['tz'](_0x3e0690)['locale']('en');throwIfDateNotValid(_0x40a049);var _0xe63047=_0x14d497[_0x047e('0x5')](',');var _0x4a8803=_0xe63047[0x0];var _0x28e97c=_0xe63047[0x1];var _0x4a5c53=_0xe63047[0x2];var _0x29e896=_0xe63047[0x3];let _0x5a19c6=!![];if(_0x4a8803!=='*'){var _0x4795c3=_0x4a8803[_0x047e('0x5')]('-');var _0x21f683=_[_0x047e('0x20')](_0x4795c3[0x0],0x5,'0');var _0x5d77e4=_0x4795c3[_0x047e('0x21')]===0x2?_['padStart'](_0x4795c3[0x1],0x5,'0'):_0x21f683;_0x5a19c6=timeCompare(_0x40a049,_0x21f683,_0x5d77e4);}let _0x3c1431=!![];if(_0x28e97c!=='*'){var _0x5ebd7a=_0x28e97c['split']('-');var _0x15d720=_0x5ebd7a[0x0];var _0x458603=_0x5ebd7a[_0x047e('0x21')]===0x2?_0x5ebd7a[0x1]:_0x15d720;_0x3c1431=dowCompare(_0x40a049,_0x15d720,_0x458603);}let _0x698dab=!![];if(_0x4a5c53!=='*'){var _0x588012=_0x4a5c53['split']('-');var _0xe0eb82=parseDom(_0x588012[0x0]);var _0x4fb448=_0x588012['length']===0x2?parseDom(_0x588012[0x1]):_0xe0eb82;_0x698dab=domCompare(_0x40a049,_0xe0eb82,_0x4fb448);}let _0x3304e8=!![];if(_0x29e896!=='*'){var _0x455d8d=_0x29e896[_0x047e('0x5')]('-');var _0x1d6a50=_0x455d8d[0x0];var _0xf3d0fc=_0x455d8d[_0x047e('0x21')]===0x2?_0x455d8d[0x1]:_0x455d8d[0x0];_0x3304e8=monthCompare(_0x40a049,_0x1d6a50,_0xf3d0fc);}return _0x5a19c6&&_0x3c1431&&_0x698dab&&_0x3304e8;}}module[_0x047e('0xb')]['iftime']=iftime; \ No newline at end of file +var _0x8f08=['join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','split','map','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','clone','hours','minutes','startOf','day','endOf','isBetween','includes','dowCompare','date','min','domCompare','format','MMM','monthCompare','guess','isMoment','padStart','length','iftime','lodash','moment-timezone','source'];(function(_0x5f2aea,_0xf7936f){var _0x18f50b=function(_0x366fac){while(--_0x366fac){_0x5f2aea['push'](_0x5f2aea['shift']());}};_0x18f50b(++_0xf7936f);}(_0x8f08,0x1b9));var _0x88f0=function(_0x29e35f,_0x4859ef){_0x29e35f=_0x29e35f-0x0;var _0x266b74=_0x8f08[_0x29e35f];return _0x266b74;};var _=require(_0x88f0('0x0'));var moment=require(_0x88f0('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx]['map'](function(_0x3f09cf){return _0x3f09cf[_0x88f0('0x2')];})[_0x88f0('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x88f0('0x4');var EINVALID_DATE=_0x88f0('0x5');function throwIfDateNotValid(_0x926840){if(!_0x926840['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x25f250){var _0x42fe9b=_0x25f250[_0x88f0('0x6')](':')[_0x88f0('0x7')](function(_0x3b816e){return parseInt(_0x3b816e,0xa);});var _0x59168a=_0x42fe9b[0x0];var _0x26727e=_0x42fe9b[0x1];if(_0x59168a<0x0||_0x59168a>0x17||_0x26727e<0x0||_0x26727e>0x3b){throw new Error(EINVALID_DATE);}return[_0x59168a,_0x26727e];}function circularDoWInterval(_0x39fa07,_0x5abfca){if(_0x39fa07===_0x5abfca){return[_0x39fa07];}else{var _0x51175c=moment[_0x88f0('0x8')]();moment[_0x88f0('0x8')]('en');var _0x245328=moment[_0x88f0('0x9')]()[_0x88f0('0x7')](function(_0x4f8af2){return _0x4f8af2[_0x88f0('0xa')]();});moment['locale'](_0x51175c);var _0x82bf08=_0x245328[_0x88f0('0xb')](_0x39fa07);var _0x9743f6=_0x245328['indexOf'](_0x5abfca);if(_0x9743f6>_0x82bf08){return _0x245328['slice'](_0x82bf08,_0x9743f6+0x1);}else{var _0x1e9137=_0x245328['slice'](0x0,_0x9743f6+0x1);var _0x1d3039=_0x245328[_0x88f0('0xc')](_0x82bf08);return _0x1d3039[_0x88f0('0xd')](_0x1e9137);}}}module[_0x88f0('0xe')][_0x88f0('0xf')]=circularDoWInterval;function circularMonthInterval(_0x25395c,_0x37ae58){if(_0x25395c===_0x37ae58){return[_0x25395c];}else{var _0x38d8c9=moment[_0x88f0('0x8')]();moment[_0x88f0('0x8')]('en');var _0xe23c3e=moment[_0x88f0('0x10')]()[_0x88f0('0x7')](function(_0x54db52){return _0x54db52[_0x88f0('0xa')]();});moment[_0x88f0('0x8')](_0x38d8c9);var _0x5491b2=_0xe23c3e[_0x88f0('0xb')](_0x25395c);var _0x555244=_0xe23c3e['indexOf'](_0x37ae58);if(_0x555244>_0x5491b2){return _0xe23c3e[_0x88f0('0xc')](_0x5491b2,_0x555244+0x1);}else{var _0x404127=_0xe23c3e[_0x88f0('0xc')](0x0,_0x555244+0x1);var _0x4d7e82=_0xe23c3e['slice'](_0x5491b2);return _0x4d7e82[_0x88f0('0xd')](_0x404127);}}}module[_0x88f0('0xe')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x4c9b9c){var _0x34fd11=parseInt(_0x4c9b9c,0xa);if(_0x34fd11<0x1||_0x34fd11>0x1f){throw new Error(EINVALID_DATE);}return _0x34fd11;}function timeCompare(_0x5642d7,_0x57e54c,_0x582216){var _0x389f50=_0x5642d7[_0x88f0('0x11')]();var _0x1b038c=extractTime(_0x57e54c);var _0x573c4d=_0x1b038c[0x0];var _0x1523fc=_0x1b038c[0x1];var _0x1445d2=_0x5642d7[_0x88f0('0x11')]()[_0x88f0('0x12')](_0x573c4d)[_0x88f0('0x13')](_0x1523fc);throwIfDateNotValid(_0x1445d2);var _0x923d7c=extractTime(_0x582216);var _0x3a42b5=_0x923d7c[0x0];var _0x912608=_0x923d7c[0x1];var _0x4e4eb6=_0x5642d7[_0x88f0('0x11')]()[_0x88f0('0x12')](_0x3a42b5)[_0x88f0('0x13')](_0x912608);throwIfDateNotValid(_0x4e4eb6);if(_0x4e4eb6['isBefore'](_0x1445d2)){var _0x3c0b2c=_0x389f50[_0x88f0('0x11')]()[_0x88f0('0x14')](_0x88f0('0x15'));var _0x431bf7=_0x389f50['clone']()[_0x88f0('0x16')](_0x88f0('0x15'));return _0x389f50[_0x88f0('0x17')](_0x1445d2,_0x431bf7,undefined,'[]')||_0x389f50[_0x88f0('0x17')](_0x3c0b2c,_0x4e4eb6,undefined,'[]');}else{return _0x389f50[_0x88f0('0x17')](_0x1445d2,_0x4e4eb6,undefined,'[]');}}module['exports']['timeCompare']=timeCompare;function dowCompare(_0x14ccbc,_0x340e8b,_0x41f903){var _0x464f7b=_0x14ccbc[_0x88f0('0x8')]('en')['format']('ddd')['toLowerCase']();return circularDoWInterval(_0x340e8b,_0x41f903)[_0x88f0('0x18')](_0x464f7b);}module[_0x88f0('0xe')][_0x88f0('0x19')]=dowCompare;function domCompare(_0x19f11f,_0x51f4cb,_0xeee36e){var _0x2f7619=_0x19f11f[_0x88f0('0x1a')]();if(_0x51f4cb===_0xeee36e){return _0x2f7619===_0x51f4cb;}else{var _0x1bc3f4=_0x19f11f['daysInMonth']();var _0xb5b48c=_0x51f4cb<_0xeee36e;let _0x3223b7=![];var _0x477f0b=0x0;var _0x31f34c=0x0;if(_0xb5b48c){_0x477f0b=Math['max'](0x1,_0x51f4cb);_0x31f34c=Math[_0x88f0('0x1b')](_0xeee36e,_0x1bc3f4);_0x3223b7=_0x2f7619>=_0x477f0b&&_0x2f7619<=_0x31f34c;}else{_0x477f0b=Math[_0x88f0('0x1b')](_0x51f4cb,_0x1bc3f4);_0x31f34c=Math['max'](0x1,_0xeee36e);_0x3223b7=_0x2f7619>=_0x477f0b||_0x2f7619<=_0x31f34c;}return _0x3223b7;}}module[_0x88f0('0xe')][_0x88f0('0x1c')]=domCompare;function monthCompare(_0x301d78,_0x23bc7d,_0x3a830e){var _0x249271=_0x301d78['locale']('en')[_0x88f0('0x1d')](_0x88f0('0x1e'))[_0x88f0('0xa')]();return circularMonthInterval(_0x23bc7d,_0x3a830e)[_0x88f0('0x18')](_0x249271);}module['exports'][_0x88f0('0x1f')]=monthCompare;function iftime(_0x2efa88,_0x2a6c3f=moment['tz'][_0x88f0('0x20')](),_0x50e714=moment()){if(!validateRx['test'](_0x2efa88)){throw new Error(EINVALID_STRING);}else{var _0x14a206=(moment[_0x88f0('0x21')](_0x50e714)?_0x50e714[_0x88f0('0x11')]():moment(_0x50e714))['tz'](_0x2a6c3f)[_0x88f0('0x8')]('en');throwIfDateNotValid(_0x14a206);var _0x4eb9e8=_0x2efa88[_0x88f0('0x6')](',');var _0x1a0057=_0x4eb9e8[0x0];var _0xf6f435=_0x4eb9e8[0x1];var _0x9e198=_0x4eb9e8[0x2];var _0xb87f64=_0x4eb9e8[0x3];let _0x2da6d7=!![];if(_0x1a0057!=='*'){var _0x58b325=_0x1a0057[_0x88f0('0x6')]('-');var _0xb12e42=_[_0x88f0('0x22')](_0x58b325[0x0],0x5,'0');var _0x5bee9f=_0x58b325[_0x88f0('0x23')]===0x2?_['padStart'](_0x58b325[0x1],0x5,'0'):_0xb12e42;_0x2da6d7=timeCompare(_0x14a206,_0xb12e42,_0x5bee9f);}let _0x4ddcf1=!![];if(_0xf6f435!=='*'){var _0x26c9a7=_0xf6f435[_0x88f0('0x6')]('-');var _0x329cb6=_0x26c9a7[0x0];var _0x34728e=_0x26c9a7['length']===0x2?_0x26c9a7[0x1]:_0x329cb6;_0x4ddcf1=dowCompare(_0x14a206,_0x329cb6,_0x34728e);}let _0x291c32=!![];if(_0x9e198!=='*'){var _0x13fca7=_0x9e198[_0x88f0('0x6')]('-');var _0x26e6cb=parseDom(_0x13fca7[0x0]);var _0xf7d3e5=_0x13fca7[_0x88f0('0x23')]===0x2?parseDom(_0x13fca7[0x1]):_0x26e6cb;_0x291c32=domCompare(_0x14a206,_0x26e6cb,_0xf7d3e5);}let _0x226bc5=!![];if(_0xb87f64!=='*'){var _0x43b5cd=_0xb87f64[_0x88f0('0x6')]('-');var _0xc18ab9=_0x43b5cd[0x0];var _0x5d60ac=_0x43b5cd['length']===0x2?_0x43b5cd[0x1]:_0x43b5cd[0x0];_0x226bc5=monthCompare(_0x14a206,_0xc18ab9,_0x5d60ac);}return _0x2da6d7&&_0x4ddcf1&&_0x291c32&&_0x226bc5;}}module[_0x88f0('0xe')][_0x88f0('0x24')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 8e90745..975b06e 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x563b=['keys','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','Logger','transports','Console','warn','%s-%s','error','File','consoleLogger','path','moment','winston','../config/environment','debugLevel','info','redBG\x20white','red','bold\x20yellow','white','bold\x20green','bold\x20magenta','bold\x20blue','bold\x20cyan','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','}}}'];(function(_0x2c4e32,_0x3a5590){var _0x1eac30=function(_0x236c8e){while(--_0x236c8e){_0x2c4e32['push'](_0x2c4e32['shift']());}};_0x1eac30(++_0x3a5590);}(_0x563b,0xf8));var _0xb563=function(_0x23f80f,_0x10c1e6){_0x23f80f=_0x23f80f-0x0;var _0x2afe74=_0x563b[_0x23f80f];return _0x2afe74;};'use strict';var path=require(_0xb563('0x0'));var util=require('util');var moment=require(_0xb563('0x1'));var winston=require(_0xb563('0x2'));var config=require(_0xb563('0x3'));var debugLevel=config[_0xb563('0x4')]?config[_0xb563('0x4')]['toLowerCase']():_0xb563('0x5');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':_0xb563('0x6'),'error':_0xb563('0x7'),'warn':_0xb563('0x8'),'info':_0xb563('0x9'),'print':'bold\x20white','success':_0xb563('0xa'),'http':'gray','verbose':_0xb563('0xb'),'debug':_0xb563('0xc'),'silly':_0xb563('0xd')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x58272c,_0x67dca8,_0x1b3209){var _0x13782f=_0x58272c||_0xb563('0xe');return path[_0xb563('0xf')](_0x13782f,util[_0xb563('0x10')](_0xb563('0x11'),_0x67dca8,_0x1b3209));}function formatter(_0x3a60ae,_0x1e41d4){_0x1e41d4[_0xb563('0x12')]=_0x1e41d4[_0xb563('0x12')][_0xb563('0x13')](/@@{/g,_0xb563('0x14'))[_0xb563('0x13')](/}@@/g,'}}}')[_0xb563('0x13')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xb563('0x10')](_0xb563('0x15'),moment()['format'](_0xb563('0x16')),_0x1e41d4[_0xb563('0x17')]['toUpperCase'](),_0x3a60ae,_0x1e41d4[_0xb563('0x12')]);}function fileFormat(_0x1ba516,_0x5d8b67){_0x5d8b67[_0xb563('0x12')]=_0x5d8b67[_0xb563('0x12')][_0xb563('0x13')](/@@{/g,_0xb563('0x14'))[_0xb563('0x13')](/}@@/g,_0xb563('0x18'))[_0xb563('0x13')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x26e556=_0x5d8b67['meta']&&Object[_0xb563('0x19')](_0x5d8b67[_0xb563('0x1a')])[_0xb563('0x1b')]?'\x0a\x09'+JSON[_0xb563('0x1c')](_0x5d8b67[_0xb563('0x1a')]):'';return util[_0xb563('0x10')](_0xb563('0x1d'),moment()['format'](_0xb563('0x16')),_0x5d8b67[_0xb563('0x17')][_0xb563('0x1e')](),_0x1ba516,_0x5d8b67[_0xb563('0x12')],_0x26e556);}function consoleLogger(){var _0x346fc7=new winston[(_0xb563('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xb563('0x20'))][(_0xb563('0x21'))]({'level':_0xb563('0x22'),'json':![],'formatter':function(_0x3b42c5){return formatter('',_0x3b42c5);}})]});return _0x346fc7;}function fileLogger(_0x3e53b7,_0x306f05){var _0x24fba0=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xb563('0x20'))]['File']({'name':util[_0xb563('0x10')](_0xb563('0x23'),_0x3e53b7,_0xb563('0x24')),'filename':getLogFileName(_0x306f05,_0x3e53b7,_0xb563('0x24')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1f2a34){return fileFormat(_0x3e53b7,_0x1f2a34);}}),new winston[(_0xb563('0x20'))][(_0xb563('0x25'))]({'name':util['format'](_0xb563('0x23'),_0x3e53b7,debugLevel),'filename':getLogFileName(_0x306f05,_0x3e53b7,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x414a74){return fileFormat(_0x3e53b7,_0x414a74);}}),new winston[(_0xb563('0x20'))][(_0xb563('0x21'))]({'level':'warn','json':![],'formatter':function(_0x3db024){return fileFormat(_0x3e53b7,_0x3db024);}})]});return _0x24fba0;}exports[_0xb563('0x26')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file +var _0xf322=['white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','/var/log/xcally','join','format','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','{{{','meta','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','%s-%s','error','consoleLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','red','bold\x20yellow'];(function(_0x34aa94,_0x202a0a){var _0x43ca4a=function(_0x250f5a){while(--_0x250f5a){_0x34aa94['push'](_0x34aa94['shift']());}};_0x43ca4a(++_0x202a0a);}(_0xf322,0x12e));var _0x2f32=function(_0x32423b,_0x36a5a3){_0x32423b=_0x32423b-0x0;var _0x37c63f=_0xf322[_0x32423b];return _0x37c63f;};'use strict';var path=require(_0x2f32('0x0'));var util=require(_0x2f32('0x1'));var moment=require(_0x2f32('0x2'));var winston=require(_0x2f32('0x3'));var config=require(_0x2f32('0x4'));var debugLevel=config[_0x2f32('0x5')]?config['debugLevel'][_0x2f32('0x6')]():_0x2f32('0x7');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':_0x2f32('0x8'),'warn':_0x2f32('0x9'),'info':_0x2f32('0xa'),'print':_0x2f32('0xb'),'success':_0x2f32('0xc'),'http':_0x2f32('0xd'),'verbose':_0x2f32('0xe'),'debug':_0x2f32('0xf'),'silly':_0x2f32('0x10')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x5d02e3,_0x11f4d5,_0x27c71f){var _0x15d91d=_0x5d02e3||_0x2f32('0x11');return path[_0x2f32('0x12')](_0x15d91d,util[_0x2f32('0x13')](_0x2f32('0x14'),_0x11f4d5,_0x27c71f));}function formatter(_0xe4987,_0x4ffbf2){_0x4ffbf2[_0x2f32('0x15')]=_0x4ffbf2[_0x2f32('0x15')][_0x2f32('0x16')](/@@{/g,'{{{')[_0x2f32('0x16')](/}@@/g,_0x2f32('0x17'))[_0x2f32('0x16')](/@{/g,'{{')[_0x2f32('0x16')](/}@/g,'}}');return util['format'](_0x2f32('0x18'),moment()[_0x2f32('0x13')](_0x2f32('0x19')),_0x4ffbf2[_0x2f32('0x1a')][_0x2f32('0x1b')](),_0xe4987,_0x4ffbf2[_0x2f32('0x15')]);}function fileFormat(_0x2df906,_0x1ea3ae){_0x1ea3ae[_0x2f32('0x15')]=_0x1ea3ae['message']['replace'](/@@{/g,_0x2f32('0x1c'))[_0x2f32('0x16')](/}@@/g,_0x2f32('0x17'))[_0x2f32('0x16')](/@{/g,'{{')[_0x2f32('0x16')](/}@/g,'}}');var _0x4bd598=_0x1ea3ae[_0x2f32('0x1d')]&&Object['keys'](_0x1ea3ae[_0x2f32('0x1d')])['length']?'\x0a\x09'+JSON[_0x2f32('0x1e')](_0x1ea3ae['meta']):'';return util[_0x2f32('0x13')](_0x2f32('0x1f'),moment()[_0x2f32('0x13')](_0x2f32('0x19')),_0x1ea3ae[_0x2f32('0x1a')][_0x2f32('0x1b')](),_0x2df906,_0x1ea3ae[_0x2f32('0x15')],_0x4bd598);}function consoleLogger(){var _0x370d22=new winston[(_0x2f32('0x20'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x2f32('0x21'))][(_0x2f32('0x22'))]({'level':_0x2f32('0x23'),'json':![],'formatter':function(_0x3e2f05){return formatter('',_0x3e2f05);}})]});return _0x370d22;}function fileLogger(_0x1b3a01,_0x3adaea){var _0x1753ac=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x2f32('0x21'))]['File']({'name':util[_0x2f32('0x13')](_0x2f32('0x24'),_0x1b3a01,_0x2f32('0x25')),'filename':getLogFileName(_0x3adaea,_0x1b3a01,_0x2f32('0x25')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x15b7df){return fileFormat(_0x1b3a01,_0x15b7df);}}),new winston[(_0x2f32('0x21'))]['File']({'name':util[_0x2f32('0x13')](_0x2f32('0x24'),_0x1b3a01,debugLevel),'filename':getLogFileName(_0x3adaea,_0x1b3a01,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x105991){return fileFormat(_0x1b3a01,_0x105991);}}),new winston[(_0x2f32('0x21'))]['Console']({'level':'warn','json':![],'formatter':function(_0xa2bd2f){return fileFormat(_0x1b3a01,_0xa2bd2f);}})]});return _0x1753ac;}exports[_0x2f32('0x26')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index c76fa02..2c7309b 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 _0xda2d=['@@{','replace','}@@','includes','exports','maskSensitiveData','username','password','newPassword','apiKey','firstName','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','key','user','pass','accountSid','localstationid','dsn','secret','oldPassword','isPlainObject','isArray','isString'];(function(_0x1dfdde,_0x945501){var _0x57e2c7=function(_0x159673){while(--_0x159673){_0x1dfdde['push'](_0x1dfdde['shift']());}};_0x57e2c7(++_0x945501);}(_0xda2d,0x102));var _0xdda2=function(_0x349c33,_0x426d0e){_0x349c33=_0x349c33-0x0;var _0x5d9d1b=_0xda2d[_0x349c33];return _0x5d9d1b;};var _=require('lodash');var sensitiveFields=[_0xdda2('0x0'),_0xdda2('0x1'),_0xdda2('0x2'),_0xdda2('0x3'),_0xdda2('0x4'),'lastName','street','phone',_0xdda2('0x5'),_0xdda2('0x6'),_0xdda2('0x7'),_0xdda2('0x8'),_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb'),_0xdda2('0xc'),_0xdda2('0xd'),_0xdda2('0xe'),'channelSecret',_0xdda2('0xf'),_0xdda2('0x10'),'authToken',_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0x13'),_0xdda2('0x14'),_0xdda2('0x15'),_0xdda2('0x16'),_0xdda2('0x17'),_0xdda2('0x18'),'privateKey','accesskeyid','secretaccesskey',_0xdda2('0x19'),_0xdda2('0x1a'),_0xdda2('0x1b'),_0xdda2('0x1c'),_0xdda2('0x1d'),_0xdda2('0x1e'),_0xdda2('0x1f'),'registry',_0xdda2('0x20')];function maskSensitiveData(_0x4b0220){const _0xbef148=/(?!^)[\s\S](?!$)/g;if(_[_0xdda2('0x21')](_0x4b0220)){for(const _0x3553d5 in _0x4b0220){if(_[_0xdda2('0x22')](_0x4b0220[_0x3553d5])){for(let _0x1922b1=0x0;_0x1922b1<_0x4b0220[_0x3553d5]['length'];_0x1922b1++){maskSensitiveData(_0x4b0220[_0x3553d5][_0x1922b1]);}}else if(_['isPlainObject'](_0x4b0220[_0x3553d5])){maskSensitiveData(_0x4b0220[_0x3553d5]);}else if(_[_0xdda2('0x23')](_0x4b0220[_0x3553d5])){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5]['replace'](/{{{/g,_0xdda2('0x24'))[_0xdda2('0x25')](/}}}/g,_0xdda2('0x26'))[_0xdda2('0x25')](/{{/g,'@{')[_0xdda2('0x25')](/}}/g,'}@');if(_[_0xdda2('0x27')](sensitiveFields,_0x3553d5)){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5][_0xdda2('0x25')](_0xbef148,'*');}}}}}module[_0xdda2('0x28')][_0xdda2('0x29')]=maskSensitiveData; \ No newline at end of file +var _0x5f2f=['tenantId','token','channelSecret','accessTokenSecret','authToken','consumerKey','membername','exten','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','lodash','username','password','newPassword','apiKey','firstName','lastName','street','fax','email','clientId','clientSecret','securityToken','code'];(function(_0x582995,_0x55a862){var _0x322b86=function(_0x5e7130){while(--_0x5e7130){_0x582995['push'](_0x582995['shift']());}};_0x322b86(++_0x55a862);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x5f2f[_0x4d613c];return _0x301fe3;};var _=require(_0xf5f2('0x0'));var sensitiveFields=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3'),_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6'),_0xf5f2('0x7'),'phone','mobile',_0xf5f2('0x8'),_0xf5f2('0x9'),_0xf5f2('0xa'),_0xf5f2('0xb'),_0xf5f2('0xc'),_0xf5f2('0xd'),'accessKey',_0xf5f2('0xe'),_0xf5f2('0xf'),_0xf5f2('0x10'),'accessToken',_0xf5f2('0x11'),_0xf5f2('0x12'),_0xf5f2('0x13'),'consumerSecret',_0xf5f2('0x14'),'calleridname','calleridnum',_0xf5f2('0x15'),_0xf5f2('0x16'),'clientEmail',_0xf5f2('0x17'),_0xf5f2('0x18'),_0xf5f2('0x19'),_0xf5f2('0x1a'),_0xf5f2('0x1b'),_0xf5f2('0x1c'),'accountSid',_0xf5f2('0x1d'),_0xf5f2('0x1e'),_0xf5f2('0x1f'),_0xf5f2('0x20'),_0xf5f2('0x21')];function maskSensitiveData(_0x4d97fc){const _0xafe430=/(?!^)[\s\S](?!$)/g;if(_[_0xf5f2('0x22')](_0x4d97fc)){for(const _0x17d656 in _0x4d97fc){if(_[_0xf5f2('0x23')](_0x4d97fc[_0x17d656])){for(let _0x23e23a=0x0;_0x23e23a<_0x4d97fc[_0x17d656][_0xf5f2('0x24')];_0x23e23a++){maskSensitiveData(_0x4d97fc[_0x17d656][_0x23e23a]);}}else if(_[_0xf5f2('0x22')](_0x4d97fc[_0x17d656])){maskSensitiveData(_0x4d97fc[_0x17d656]);}else if(_[_0xf5f2('0x25')](_0x4d97fc[_0x17d656])){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](/{{{/g,_0xf5f2('0x27'))[_0xf5f2('0x26')](/}}}/g,_0xf5f2('0x28'))[_0xf5f2('0x26')](/{{/g,'@{')[_0xf5f2('0x26')](/}}/g,'}@');if(_[_0xf5f2('0x29')](sensitiveFields,_0x17d656)){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](_0xafe430,'*');}}}}}module[_0xf5f2('0x2a')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index e62d730..95a1315 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(_0x12b830,_0xd66540){var _0x261dc4=function(_0x57037a){while(--_0x57037a){_0x12b830['push'](_0x12b830['shift']());}};_0x261dc4(++_0xd66540);}(_0xb62e,0x1de));var _0xeb62=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb62e[_0xbca1b1];return _0x4e1686;};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 _0xda2d=['exports','safeTemplate','{\x20{\x20','\x20}\x20}','map','isPlainObject','keys','reduce'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0xda2d,0x102));var _0xdda2=function(_0x28ebdd,_0x5161f5){_0x28ebdd=_0x28ebdd-0x0;var _0x13687c=_0xda2d[_0x28ebdd];return _0x13687c;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x14e970){return _0x14e970==='{{'?_0xdda2('0x0'):_0xdda2('0x1');}function safeTemplate(_0x1f1fcc){var _0x329c5e=_0x1f1fcc;if(typeof _0x1f1fcc==='string'){_0x329c5e=_0x1f1fcc['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x1f1fcc)){_0x329c5e=_0x1f1fcc[_0xdda2('0x2')](function(_0x319129){return safeTemplate(_0x319129);});}else if(_[_0xdda2('0x3')](_0x1f1fcc)){_0x329c5e=Object[_0xdda2('0x4')](_0x1f1fcc)[_0xdda2('0x5')](function(_0xf38e58,_0x2f55dc){_0xf38e58[_0x2f55dc]=safeTemplate(_0x1f1fcc[_0x2f55dc]);return _0xf38e58;},{});}return _0x329c5e;}module[_0xdda2('0x6')][_0xdda2('0x7')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js new file mode 100644 index 0000000..cdfeeb2 --- /dev/null +++ b/server/utils/update-app-config.js @@ -0,0 +1,18 @@ +// ************************************************************************* +// * * +// * xCALLY Motion - The Omnichannel Contact Center * +// * Copyright (c) Xenialab s.r.l. All Rights Reserved * +// * * +// ************************************************************************* +// * * +// * Email: info@xcally.com * +// * Website: https://www.xcally.com * +// * * +// ************************************************************************* +// * * +// * The SOFTWARE PRODUCT is protected by copyright laws and international * +// * copyright treaties, as well as other intellectual property laws and * +// * treaties. The SOFTWARE PRODUCT is licensed, not sold. * +// * * +// ************************************************************************* +var _0xcb3e=['root','server/app.json','resolve','legacy-libs','isArray','apps','findIndex','name','motion2','env','string','then','updated','info','Updating\x20app.json','writeJSON','exports','path'];(function(_0x1caeea,_0x1f1470){var _0x110725=function(_0x4c96e6){while(--_0x4c96e6){_0x1caeea['push'](_0x1caeea['shift']());}};_0x110725(++_0x1f1470);}(_0xcb3e,0x1c1));var _0xecb3=function(_0x2632b7,_0x41bffc){_0x2632b7=_0x2632b7-0x0;var _0x553ed9=_0xcb3e[_0x2632b7];return _0x553ed9;};var fs=require('fs-extra');var path=require(_0xecb3('0x0'));var config=require('../config/environment');var root=config[_0xecb3('0x1')];var APP_JSON_PATH=path['resolve'](root,_0xecb3('0x2'));var NODEPATH=path[_0xecb3('0x3')](root,_0xecb3('0x4'));function setLegacyLibsNodeEnvPath(_0x55d778){let _0x5b17e7=![];if(Array[_0xecb3('0x5')](_0x55d778[_0xecb3('0x6')])){var _0x55e870=_0x55d778[_0xecb3('0x6')][_0xecb3('0x7')](function(_0x5a98d9){return _0x5a98d9[_0xecb3('0x8')]===_0xecb3('0x9');});if(_0x55e870>-0x1){var _0x526908=_0x55d778[_0xecb3('0x6')][_0x55e870];if(typeof _0x526908[_0xecb3('0xa')]['NODE_PATH']!==_0xecb3('0xb')){_0x526908[_0xecb3('0xa')]['NODE_PATH']=NODEPATH;_0x5b17e7=!![];}}return{'appConfig':_0x55d778,'updated':_0x5b17e7};}}function updateAppConfig(_0x2928e5){return fs['pathExists'](APP_JSON_PATH)['then'](function(_0x412cd0){if(_0x412cd0){return fs['readJSON'](APP_JSON_PATH)[_0xecb3('0xc')](function(_0x213998){var _0x3574af=setLegacyLibsNodeEnvPath(_0x213998);if(_0x3574af[_0xecb3('0xd')]){_0x2928e5[_0xecb3('0xe')](_0xecb3('0xf'));return fs[_0xecb3('0x10')](APP_JSON_PATH,_0x213998,{'spaces':0x2});}else{return Promise[_0xecb3('0x3')]();}});}else{return Promise[_0xecb3('0x3')]();}});}module[_0xecb3('0x11')]=updateAppConfig; \ No newline at end of file